commit 80a9592cea7301d807c15ce1a5c9d9aad4ea827f Author: André Menrath Date: Tue Oct 15 12:04:03 2024 +0200 init: add v 7.15.0 diff --git a/MEC-Installation-Guide.pdf b/MEC-Installation-Guide.pdf new file mode 100755 index 0000000..0d6aa81 Binary files /dev/null and b/MEC-Installation-Guide.pdf differ diff --git a/app/addons/ACF.php b/app/addons/ACF.php new file mode 100755 index 0000000..9660540 --- /dev/null +++ b/app/addons/ACF.php @@ -0,0 +1,59 @@ + + */ +class MEC_addon_ACF extends MEC_base +{ + /** + * @var MEC_factory + */ + public $factory; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // MEC Factory class + $this->factory = $this->getFactory(); + } + + /** + * Initialize the ACF addon + * @author Webnus + */ + public function init() + { + $this->factory->action('mec_wc_product_created', [$this, 'sync_acf_fields'], 10, 2); + $this->factory->action('mec_wc_product_updated', [$this, 'sync_acf_fields'], 10, 2); + } + + /** + * @param int $product_id + * @param int $event_id + * @return void + */ + public function sync_acf_fields($product_id, $event_id) + { + // ACF Plugin is not installed and activated + if(!class_exists('ACF')) return; + + // Event ACF Data + $data = get_fields($event_id, false); + + // Data is invalid + if(!is_array($data)) return; + if(!count($data)) return; + + // Store data for Product + foreach($data as $key => $value) + { + update_field($key, $value, $product_id); + } + } +} \ No newline at end of file diff --git a/app/addons/KC.php b/app/addons/KC.php new file mode 100755 index 0000000..bf0d3ba --- /dev/null +++ b/app/addons/KC.php @@ -0,0 +1,85 @@ + + */ +class MEC_addon_KC extends MEC_base +{ + /** + * @var MEC_factory + */ + public $factory; + + /** + * @var MEC_main + */ + public $main; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // MEC Factory class + $this->factory = $this->getFactory(); + + // MEC Main class + $this->main = $this->getMain(); + } + + /** + * Initialize the KC addon + * @author Webnus + * @return boolean + */ + public function init() + { + // King Composer is not installed + if(!function_exists('kc_add_map')) return false; + + $this->factory->action('init', array($this, 'map')); + return true; + } + + /** + * Register the addon in KC + * @author Webnus + */ + public function map() + { + $calendar_posts = get_posts(array('post_type'=>'mec_calendars', 'posts_per_page'=>'-1')); + + $calendars_name = $calendars_number = []; + foreach($calendar_posts as $calendar_post) + { + $calendars_name[] = $calendar_post->post_title; + $calendars_number[] = $calendar_post->ID; + } + + $calendars_array = array_combine($calendars_number, $calendars_name); + + kc_add_map(array + ( + 'MEC' => array( + 'name' => esc_html__('Modern Events Calendar', 'modern-events-calendar-lite'), + 'icon' => 'mec-kingcomposer-icon', + 'category' => esc_html__('Content', 'modern-events-calendar-lite'), + 'params' => array( + 'General' => array( + array( + 'name' => 'id', + 'label' => esc_html__('Shortcode', 'modern-events-calendar-lite'), + 'type' => 'select', + 'options' => $calendars_array, + 'description' => esc_html__('Select from predefined shortcodes', 'modern-events-calendar-lite'), + ), + ), + ) + ), + )); + } +} \ No newline at end of file diff --git a/app/addons/PMP.php b/app/addons/PMP.php new file mode 100755 index 0000000..2010bec --- /dev/null +++ b/app/addons/PMP.php @@ -0,0 +1,201 @@ + + */ +class MEC_addon_PMP extends MEC_base +{ + /** + * @var MEC_factory + */ + public $factory; + + /** + * @var MEC_main + */ + public $main; + public $settings; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // MEC Factory class + $this->factory = $this->getFactory(); + + // MEC Main class + $this->main = $this->getMain(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + } + + /** + * Initialize the PMP addon + * @author Webnus + * @return boolean + */ + public function init() + { + $event_restriction = isset($this->settings['pmp_status']) && $this->settings['pmp_status']; + $booking_restriction = isset($this->settings['pmp_booking_restriction']) && $this->settings['pmp_booking_restriction']; + $ticket_restriction = isset($this->settings['pmp_ticket_restrictions']) && $this->settings['pmp_ticket_restrictions']; + + // Module is not enabled + if(!$event_restriction && !$booking_restriction && !$ticket_restriction) return false; + + // Event Restriction + if($event_restriction) + { + // Metabox + add_action('admin_menu', [$this, 'metabox']); + + // Display Access Error + add_filter('mec_show_event_details_page', [$this, 'check'], 10, 2); + } + + // Booking Restriction + if($booking_restriction) + { + add_filter('mec_booking_module_abort', [$this, 'booking_abort'], 10, 2); + } + + // Ticket Restrictions + if($ticket_restriction) + { + add_action('mec_ticket_extra_options', [$this, 'ticket_plans_fields'], 10, 3); + add_filter('mec_get_tickets_availability', [$this, 'ticket_availability'], 10, 5); + } + + return true; + } + + public function metabox() + { + if(!defined('PMPRO_VERSION')) return; + + // Register + add_meta_box('pmpro_page_meta', esc_html__('Require Membership', 'modern-events-calendar-lite'), 'pmpro_page_meta', $this->main->get_main_post_type(), 'side', 'high'); + } + + public function check($status, $event_id) + { + if(!defined('PMPRO_VERSION')) return $status; + + // Has Access + if(function_exists('pmpro_has_membership_access')) + { + $response = pmpro_has_membership_access($event_id, NULL, true); + $available = $response[0] ?? true; + + if(!$available) + { + $post_membership_levels_ids = $response[1]; + $post_membership_levels_names = $response[2]; + + $content = pmpro_get_no_access_message('', $post_membership_levels_ids, $post_membership_levels_names); + $status = '

'.get_the_title($event_id).'

'.MEC_kses::page($content).'
'; + } + } + + return $status; + } + + public function booking_abort($abort, $event) + { + if(!function_exists('pmpro_hasMembershipLevel')) return $abort; + + // Event ID + $event_id = $event->ID; + if(!$event_id) return $abort; + + // Event Categories + $categories = (isset($event->data) and isset($event->data->categories) and is_array($event->data->categories)) ? $event->data->categories : []; + + // Event has no category + if(!count($categories)) return $abort; + + // User ID + $user_id = get_current_user_id(); + + // Booking Restriction Options + $options = isset($this->settings['pmp_booking']) && is_array($this->settings['pmp_booking']) ? $this->settings['pmp_booking'] : []; + + $needed_levels = []; + foreach($options as $level_id => $cats) + { + foreach($categories as $category) + { + if(in_array($category['id'], $cats)) $needed_levels[] = $level_id; + } + } + + $needed_levels = array_unique($needed_levels); + if($needed_levels and !pmpro_hasMembershipLevel($needed_levels, $user_id)) + { + return pmpro_get_no_access_message('', $needed_levels); + } + + return $abort; + } + + public function ticket_plans_fields($ticket_id, $data, $args = []) + { + if(!function_exists('pmpro_getAllLevels')) return; + + $name_prefix = $args['name_prefix'] ?? 'mec[tickets]'; + $advanced_class = $args['advanced_class'] ?? 'mec-basvanced-advanced w-hidden'; + + // Levels + $levels = pmpro_getAllLevels(); + ?> +
+
+
+


+
    + +
  • + +
  • + +
+
+
+ + */ +class MEC_addon_TNP extends MEC_base +{ + /** + * @var MEC_factory + */ + public $factory; + + /** + * @var MEC_main + */ + public $main; + public $settings; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // MEC Factory class + $this->factory = $this->getFactory(); + + // MEC Main class + $this->main = $this->getMain(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + } + + /** + * Initialize the TNP addon + * @author Webnus + * @return boolean + */ + public function init() + { + $this->factory->action('newsletter_register_blocks', array($this, 'register')); + + return true; + } + + public function register() + { + if(!class_exists('TNP_Composer')) return; + + TNP_Composer::register_block(MEC_ABSPATH.'app'.DS.'addons'.DS.'tnp'.DS.'simple'); + } +} \ No newline at end of file diff --git a/app/addons/VC.php b/app/addons/VC.php new file mode 100755 index 0000000..87445d3 --- /dev/null +++ b/app/addons/VC.php @@ -0,0 +1,78 @@ + + */ +class MEC_addon_VC extends MEC_base +{ + /** + * @var MEC_factory + */ + public $factory; + + /** + * @var MEC_main + */ + public $main; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // MEC Factory class + $this->factory = $this->getFactory(); + + // MEC Main class + $this->main = $this->getMain(); + } + + /** + * Initialize the VC addon + * @author Webnus + */ + public function init() + { + // Visual Composer is not installed + if(!function_exists('vc_map')) return false; + + $this->factory->action('vc_before_init', array($this, 'map')); + return true; + } + + /** + * Register the addon in VC + * @author Webnus + */ + public function map() + { + $calendar_posts = get_posts(array('post_type'=>'mec_calendars', 'posts_per_page'=>'-1')); + + $calendars = []; + foreach($calendar_posts as $calendar_post) $calendars[$calendar_post->post_title] = $calendar_post->ID; + + vc_map(array( + 'name'=>esc_html__('Modern Events Calendar', 'modern-events-calendar-lite'), + 'base'=>'MEC', + 'class'=>'', + 'controls'=>'full', + 'icon'=>$this->main->asset('img/ico-mec-vc.png'), + 'category'=>esc_html__('Content', 'modern-events-calendar-lite'), + 'params'=>array( + array( + 'type'=>'dropdown', + 'holder'=>'div', + 'class'=>'', + 'heading'=>esc_html__('Shortcode', 'modern-events-calendar-lite'), + 'param_name'=>'id', + 'value'=>$calendars, + 'description'=>esc_html__('Select from predefined shortcodes', 'modern-events-calendar-lite') + ) + ) + )); + } +} \ No newline at end of file diff --git a/app/addons/avada.php b/app/addons/avada.php new file mode 100755 index 0000000..76e9ab6 --- /dev/null +++ b/app/addons/avada.php @@ -0,0 +1,72 @@ + + */ +class MEC_addon_avada extends MEC_base +{ + /** + * @var MEC_factory + */ + public $factory; + + /** + * @var MEC_main + */ + public $main; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // MEC Factory class + $this->factory = $this->getFactory(); + + // MEC Main class + $this->main = $this->getMain(); + } + + /** + * Initialize the Elementor addon + * @author Webnus + */ + public function init() + { + $this->factory->action('fusion_builder_before_init', array($this, 'register')); + } + + public function register() + { + $calendar_posts = get_posts(array('post_type'=>'mec_calendars', 'posts_per_page'=>'-1')); + + $shortcodes = []; + foreach($calendar_posts as $calendar_post) + { + $shortcodes[$calendar_post->ID] = $calendar_post->post_title; + } + + fusion_builder_map([ + 'name' => esc_attr__('MEC', 'modern-events-calendar-lite'), + 'shortcode' => 'MEC', + 'icon' => 'fusiona-code', + 'preview' => MEC_ABSPATH.'app/addons/avada/preview.php', + 'preview_id' => 'mec-avada-shortcode-element', + 'allow_generator' => true, + 'params' => [ + [ + 'type' => 'select', + 'heading' => esc_attr__('Shortcode', 'modern-events-calendar-lite'), + 'description' => esc_attr__('Select one of created shortcodes.', 'modern-events-calendar-lite'), + 'param_name' => 'id', + 'value' => $shortcodes, + 'default' => '', + ], + ], + ]); + } +} \ No newline at end of file diff --git a/app/addons/avada/preview.php b/app/addons/avada/preview.php new file mode 100755 index 0000000..2a5fb81 --- /dev/null +++ b/app/addons/avada/preview.php @@ -0,0 +1,11 @@ + + diff --git a/app/addons/beaver.php b/app/addons/beaver.php new file mode 100755 index 0000000..5683f88 --- /dev/null +++ b/app/addons/beaver.php @@ -0,0 +1,54 @@ + + */ +class MEC_addon_beaver extends MEC_base +{ + /** + * @var MEC_factory + */ + public $factory; + + /** + * @var MEC_main + */ + public $main; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // MEC Factory class + $this->factory = $this->getFactory(); + + // MEC Main class + $this->main = $this->getMain(); + } + + /** + * Initialize the Elementor addon + * @author Webnus + */ + public function init() + { + // Beaver Builder is not installed + if(!class_exists( 'FLBuilder' ) ) return false; + define( 'MEC_BEAVER_DIR', plugin_dir_path( __FILE__ ) ); + define( 'MEC_BEAVER_URL', plugins_url( '/', __FILE__ ) ); + add_action( 'init', array($this,'mec_beaver_builder_shortcode') ); + return true; + } + + public function mec_beaver_builder_shortcode() { + if ( class_exists( 'FLBuilder' ) ) { + require_once MEC_ABSPATH.'app/addons/mec-beaver-builder/mec-beaver-builder.php'; + } + } + +} \ No newline at end of file diff --git a/app/addons/divi.php b/app/addons/divi.php new file mode 100755 index 0000000..7e4ab11 --- /dev/null +++ b/app/addons/divi.php @@ -0,0 +1,67 @@ + + */ +class MEC_addon_divi extends MEC_base +{ + /** + * @var MEC_factory + */ + public $factory; + + /** + * @var MEC_main + */ + public $main; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // MEC Factory class + $this->factory = $this->getFactory(); + + // MEC Main class + $this->main = $this->getMain(); + } + + /** + * Initialize the Elementor addon + * @author Webnus + */ + public function init() + { + // Divi is not installed + $theme = wp_get_theme(); // gets the current theme + + if('Divi' != $theme->get_template()) return false; + + add_action('divi_extensions_init', array($this, 'mecdivi_initialize_extension')); + add_filter('et_builder_load_actions', array($this, 'add_ajax_actions')); + + return true; + } + + /** + * Creates the extension's main class instance. + * + * @since 1.0.0 + */ + public function mecdivi_initialize_extension() + { + require_once plugin_dir_path( __FILE__ ) . 'divi/includes/Divi.php'; + require_once plugin_dir_path( __FILE__ ) . 'divi/includes/MECShortcodesForDivi.php'; + } + + public function add_ajax_actions($actions) + { + $actions[] = 'mec_load_single_page'; + return $actions; + } +} \ No newline at end of file diff --git a/app/addons/divi/includes/Divi.php b/app/addons/divi/includes/Divi.php new file mode 100755 index 0000000..769e79e --- /dev/null +++ b/app/addons/divi/includes/Divi.php @@ -0,0 +1,45 @@ +plugin_dir = plugin_dir_path( __FILE__ ); + $this->plugin_dir_url = plugin_dir_url( $this->plugin_dir ); + + parent::__construct( $name, $args ); + } +} + +new MECDIVI_Divi; diff --git a/app/addons/divi/includes/MECShortcodesForDivi.php b/app/addons/divi/includes/MECShortcodesForDivi.php new file mode 100755 index 0000000..880377f --- /dev/null +++ b/app/addons/divi/includes/MECShortcodesForDivi.php @@ -0,0 +1,20 @@ + { + API.registerModules(modules); +}); diff --git a/app/addons/divi/includes/loader.php b/app/addons/divi/includes/loader.php new file mode 100755 index 0000000..b055daf --- /dev/null +++ b/app/addons/divi/includes/loader.php @@ -0,0 +1,14 @@ + + ); + } +} + +export default MECShortcodes; diff --git a/app/addons/divi/includes/modules/MECShortcodes/MECShortcodes.php b/app/addons/divi/includes/modules/MECShortcodes/MECShortcodes.php new file mode 100755 index 0000000..9927d05 --- /dev/null +++ b/app/addons/divi/includes/modules/MECShortcodes/MECShortcodes.php @@ -0,0 +1,37 @@ + 'https://webnus.net', + 'author' => 'Webnus', + 'author_uri' => 'https://webnus.net', + ); + + public function init() { + $this->name = esc_html__( 'MEC Shortcodes', 'mecdivi-divi' ); + } + + public function get_fields() { + $calendar_posts = get_posts(array('post_type'=>'mec_calendars', 'posts_per_page'=>'-1')); + $calendars = []; + foreach($calendar_posts as $calendar_post) $calendars[$calendar_post->ID] = $calendar_post->post_title; + + return array( + 'shortcode_id' => array( + 'label' => esc_html__( 'MEC Shortcodes', 'mecdivi-divi' ), + 'type' => 'select', + 'options' => $calendars, + 'description' => esc_html__( 'Enter the shortcode_id of your choosing here.', 'mecdivi-divi' ), + ), + ); + } + public function render( $attrs, $content = NULL, $render_slug = NULL ) { + return do_shortcode('[MEC id="'.$this->props['shortcode_id'].'"]'); + } +} + +new MECDIVI_MECShortcodes; diff --git a/app/addons/divi/includes/modules/index.js b/app/addons/divi/includes/modules/index.js new file mode 100755 index 0000000..3d7b28b --- /dev/null +++ b/app/addons/divi/includes/modules/index.js @@ -0,0 +1,5 @@ +import MECShortcodes from './MECShortcodes/MECShortcodes'; + +export default [ + MECShortcodes, +]; diff --git a/app/addons/divi/scripts/builder-bundle.min.js b/app/addons/divi/scripts/builder-bundle.min.js new file mode 100755 index 0000000..76ae47b --- /dev/null +++ b/app/addons/divi/scripts/builder-bundle.min.js @@ -0,0 +1,201 @@ +!(function(e) { + var t = {}; + function n(o) { + if (t[o]) return t[o].exports; + var r = (t[o] = { i: o, l: !1, exports: {} }); + return e[o].call(r.exports, r, r.exports, n), (r.l = !0), r.exports; + } + (n.m = e), + (n.c = t), + (n.d = function(e, t, o) { + n.o(e, t) || + Object.defineProperty(e, t, { + configurable: !1, + enumerable: !0, + get: o + }); + }), + (n.n = function(e) { + var t = + e && e.__esModule + ? function() { + return e.default; + } + : function() { + return e; + }; + return n.d(t, "a", t), t; + }), + (n.o = function(e, t) { + return Object.prototype.hasOwnProperty.call(e, t); + }), + (n.p = "/"), + n((n.s = 1)); +})([ + function(e, t) { + e.exports = jQuery; + }, + function(e, t, n) { + n(2), (e.exports = n(3)); + }, + function(e, t, n) { + "use strict"; + }, + function(e, t, n) { + "use strict"; + Object.defineProperty(t, "__esModule", { value: !0 }); + var o = n(0), + r = n.n(o), + c = n(4); + r()(window).on("et_builder_api_ready", function(e, t) { + t.registerModules(c.a); + }); + }, + function(e, t, n) { + "use strict"; + var o = n(5); + t.a = [o.a]; + }, + function(e, t, n) { + "use strict"; + var o = n(6), + r = n.n(o), + c = n(0), + u = n.n(c); + function i(e) { + return (i = + "function" === typeof Symbol && "symbol" === typeof Symbol.iterator + ? function(e) { + return typeof e; + } + : function(e) { + return e && + "function" === typeof Symbol && + e.constructor === Symbol && + e !== Symbol.prototype + ? "symbol" + : typeof e; + })(e); + } + function a(e, t) { + for (var n = 0; n < t.length; n++) { + var o = t[n]; + (o.enumerable = o.enumerable || !1), + (o.configurable = !0), + "value" in o && (o.writable = !0), + Object.defineProperty(e, o.key, o); + } + } + function f(e, t) { + return !t || ("object" !== i(t) && "function" !== typeof t) + ? (function(e) { + if (void 0 === e) + throw new ReferenceError( + "this hasn't been initialised - super() hasn't been called" + ); + return e; + })(e) + : t; + } + var s = (function(e) { + function t() { + return ( + (function(e, t) { + if (!(e instanceof t)) + throw new TypeError("Cannot call a class as a function"); + })(this, t), + f( + this, + (t.__proto__ || Object.getPrototypeOf(t)).apply(this, arguments) + ) + ); + } + var n, c, i; + return ( + (function(e, t) { + if ("function" !== typeof t && null !== t) + throw new TypeError( + "Super expression must either be null or a function" + ); + (e.prototype = Object.create(t && t.prototype, { + constructor: { + value: e, + enumerable: !1, + writable: !0, + configurable: !0 + } + })), + t && + (Object.setPrototypeOf + ? Object.setPrototypeOf(e, t) + : (e.__proto__ = t)); + })(t, o["Component"]), + (n = t), + (c = [ + { + key: "render", + value: function() { + return ( + u.a.ajax({ + url: window.ETBuilderBackend.ajaxUrl, + type: "post", + data: { + action: "MECDIVI_load_mec_shortcode", + nonce: "et_admin_load_nonce", + shortcode_id: this.props.shortcode_id + }, + success: function(e) { + u()(".mec-shortcode").html(e); + var node = jQuery(".mec-event-masonry"); + if(typeof node !== 'undefined') + { + // var masonryShuffle = window.Shuffle; + + if (node === null) { + return; + } + + // var masonryShuffle = new Shuffle(node, { + // itemSelector: '.mec-masonry-item-wrap', + // }); + // masonryShuffle.sort({ + // by: node.data('created') + // }); + // var $container = $("#mec_skin_" + settings.id + " .mec-event-masonry"); + var $grid = node.isotope({ + filter: '*', + itemSelector: '.mec-masonry-item-wrap', + getSortData: { + date: '[data-sort-masonry]', + }, + sortBy: 'date', + animationOptions: { + duration: 750, + easing: 'linear', + queue: false + }, + }); + } + } + }), + r.a.createElement("div", { class: "mec-shortcode" }) + ); + } + } + ]) && a(n.prototype, c), + i && a(n, i), + t + ); + })(); + Object.defineProperty(s, "slug", { + configurable: !0, + enumerable: !0, + writable: !0, + value: "mecdivi_MECShortcodes" + }), + (t.a = s); + }, + function(e, t) { + e.exports = React; + } +]); diff --git a/app/addons/divi/scripts/frontend-bundle.min.js b/app/addons/divi/scripts/frontend-bundle.min.js new file mode 100755 index 0000000..297744f --- /dev/null +++ b/app/addons/divi/scripts/frontend-bundle.min.js @@ -0,0 +1 @@ +!function(n){var t={};function r(e){if(t[e])return t[e].exports;var o=t[e]={i:e,l:!1,exports:{}};return n[e].call(o.exports,o,o.exports,r),o.l=!0,o.exports}r.m=n,r.c=t,r.d=function(n,t,e){r.o(n,t)||Object.defineProperty(n,t,{configurable:!1,enumerable:!0,get:e})},r.n=function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return r.d(t,"a",t),t},r.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},r.p="/",r(r.s=7)}({7:function(n,t,r){n.exports=r(8)},8:function(n,t){jQuery(function(n){})}}); \ No newline at end of file diff --git a/app/addons/divi/scripts/frontend.js b/app/addons/divi/scripts/frontend.js new file mode 100755 index 0000000..a8780e5 --- /dev/null +++ b/app/addons/divi/scripts/frontend.js @@ -0,0 +1,3 @@ +// This script is loaded both on the frontend page and in the Visual Builder. + +jQuery(function($) {}); diff --git a/app/addons/divi/styles/style-dbp.min.css b/app/addons/divi/styles/style-dbp.min.css new file mode 100755 index 0000000..e69de29 diff --git a/app/addons/divi/styles/style.min.css b/app/addons/divi/styles/style.min.css new file mode 100755 index 0000000..bddb0bd --- /dev/null +++ b/app/addons/divi/styles/style.min.css @@ -0,0 +1 @@ + .mec-owl-carousel {display: none;width: 100%;-webkit-tap-highlight-color: transparent;position: relative;z-index: 1;}.mec-owl-carousel .owl-stage {position: relative;-ms-touch-action: pan-Y;-moz-backface-visibility: hidden;}.mec-owl-carousel .owl-stage:after {content: ".";display: block;clear: both;visibility: hidden;line-height: 0;height: 0;}.mec-owl-carousel .owl-stage-outer {position: relative;overflow: hidden;-webkit-transform: translate3d(0px, 0px, 0px);}.mec-owl-carousel .owl-wrapper, .mec-owl-carousel .owl-item {-webkit-backface-visibility: hidden;-moz-backface-visibility: hidden;-ms-backface-visibility: hidden;-webkit-transform: translate3d(0, 0, 0);-moz-transform: translate3d(0, 0, 0);-ms-transform: translate3d(0, 0, 0);}.mec-owl-carousel .owl-item {position: relative;min-height: 1px;float: left;-webkit-backface-visibility: hidden;-webkit-tap-highlight-color: transparent;-webkit-touch-callout: none;}.mec-owl-carousel .owl-item img {display: block;width: 100%;}.mec-owl-carousel .owl-nav.disabled, .mec-owl-carousel .owl-dots.disabled {display: none;}.mec-owl-carousel .owl-nav .owl-prev, .mec-owl-carousel .owl-nav .owl-next, .mec-owl-carousel .owl-dot {cursor: pointer;cursor: hand;-webkit-user-select: none;-khtml-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;}.mec-owl-carousel.owl-loaded {display: block;}.mec-owl-carousel.owl-loading {opacity: 0;display: block;}.mec-owl-carousel.owl-hidden {opacity: 0;}.mec-owl-carousel.owl-refresh .owl-item {visibility: hidden;}.mec-owl-carousel.owl-drag .owl-item {-webkit-user-select: none;-moz-user-select: none;-ms-user-select: none;user-select: none;}.mec-owl-carousel.owl-grab {cursor: move;cursor: grab;}.mec-owl-carousel.owl-rtl {direction: rtl;}.mec-owl-carousel.owl-rtl .owl-item {float: right;}.no-js .mec-owl-carousel {display: block;}.mec-owl-carousel .animated {animation-duration: 1000ms;animation-fill-mode: both;}.mec-owl-carousel .owl-animated-in {z-index: 0;}.mec-owl-carousel .owl-animated-out {z-index: 1;}.mec-owl-carousel .fadeOut {animation-name: fadeOut;}@keyframes fadeOut {0% {opacity: 1;}100% {opacity: 0;}}.owl-height {transition: height 500ms ease-in-out;}.mec-owl-carousel .owl-item .owl-lazy {opacity: 0;transition: opacity 400ms ease;}.mec-owl-carousel .owl-item img.owl-lazy {transform-style: preserve-3d;}.mec-owl-carousel .owl-video-wrapper {position: relative;height: 100%;background: #000;}.mec-owl-carousel .owl-video-play-icon {position: absolute;height: 80px;width: 80px;left: 50%;top: 50%;margin-left: -40px;margin-top: -40px;background: url("owl.video.play.png") no-repeat;cursor: pointer;z-index: 1;-webkit-backface-visibility: hidden;transition: transform 100ms ease;}.mec-owl-carousel .owl-video-play-icon:hover {-ms-transform: scale(1.3, 1.3);transform: scale(1.3, 1.3);}.mec-owl-carousel .owl-video-playing .owl-video-tn, .mec-owl-carousel .owl-video-playing .owl-video-play-icon {display: none;}.mec-owl-carousel .owl-video-tn {opacity: 0;height: 100%;background-position: center center;background-repeat: no-repeat;background-size: contain;transition: opacity 400ms ease;}.mec-owl-carousel .owl-video-frame {position: relative;z-index: 1;height: 100%;width: 100%;} \ No newline at end of file diff --git a/app/addons/elementor.php b/app/addons/elementor.php new file mode 100755 index 0000000..c4cc873 --- /dev/null +++ b/app/addons/elementor.php @@ -0,0 +1,77 @@ + + */ +class MEC_addon_elementor extends MEC_base +{ + /** + * @var MEC_factory + */ + public $factory; + + /** + * @var MEC_main + */ + public $main; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // MEC Factory class + $this->factory = $this->getFactory(); + + // MEC Main class + $this->main = $this->getMain(); + } + + /** + * Initialize the Elementor addon + * @author Webnus + */ + public function init() + { + // Elementor is not installed + if(!did_action('elementor/loaded')) return false; + + add_action('elementor/widgets/register', array($this, 'register_shortcode')); + + add_action( 'elementor/preview/enqueue_styles', function() + { + wp_enqueue_style( 'mec-owl-carousel-style' ); + wp_enqueue_style( 'mec-frontend-style' ); + }); + + add_action('elementor/editor/after_enqueue_scripts', function() + { + wp_enqueue_script('mec-owl-carousel-script'); + wp_enqueue_script('mec-frontend-script'); + }); + + return true; + } + + /** + * Register MEC Elementor Shortcode + * @author Webnus + */ + public function register_shortcode() + { + require_once MEC_ABSPATH.'app/addons/elementor/shortcode.php'; + \Elementor\Plugin::instance()->widgets_manager->register(new \Elementor\MEC_addon_elementor_shortcode()); + } + + /** + * Register the addon in Elementor + * @author Webnus + */ + public function map() + { + } +} \ No newline at end of file diff --git a/app/addons/elementor/index.html b/app/addons/elementor/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/addons/elementor/shortcode.php b/app/addons/elementor/shortcode.php new file mode 100755 index 0000000..0faff3b --- /dev/null +++ b/app/addons/elementor/shortcode.php @@ -0,0 +1,110 @@ + + */ +class MEC_addon_elementor_shortcode extends \Elementor\Widget_Base +{ + /** + * Retrieve MEC widget name. + * + * @since 1.0.0 + * @access public + * @return string Widget name. + */ + public function get_name() + { + return 'MEC'; + } + + /** + * Retrieve MEC widget title. + * + * @since 1.0.0 + * @access public + * @return string Widget title. + */ + public function get_title() + { + return esc_html__('Modern Events Calendar (MEC)', 'modern-events-calendar-lite'); + } + + /** + * Retrieve MEC widget icon. + * + * @since 1.0.0 + * @access public + * @return string Widget icon. + */ + public function get_icon() + { + return 'eicon-archive-posts'; + } + + /** + * Set widget category. + * + * @since 1.0.0 + * @access public + * @return array Widget category. + */ + public function get_categories() + { + return array('general'); + } + + /** + * Register MEC widget controls. + * + * @since 1.0.0 + * @access protected + */ + protected function register_controls() + { + $calendar_posts = get_posts(array('post_type'=>'mec_calendars', 'posts_per_page'=>'-1')); + + $calendars = []; + foreach($calendar_posts as $calendar_post) $calendars[$calendar_post->ID] = $calendar_post->post_title; + + // Content Tab + $this->start_controls_section( + 'content_section', + array( + 'label' => esc_html__('General', 'modern-events-calendar-lite'), + 'tab' => \Elementor\Controls_Manager::TAB_CONTENT, + ) + ); + + // Select Type Section + $this->add_control( + 'type', + array( + 'label' => esc_html__('Select Type', 'modern-events-calendar-lite'), + 'type' => \Elementor\Controls_Manager::SELECT, + 'options' => $calendars, + ) + ); + + $this->end_controls_section(); + } + + /** + * Render MEC widget output on the frontend. + * + * @since 1.0.0 + * @access protected + */ + protected function render() + { + $settings = $this->get_settings_for_display(); + if(!empty($settings['type'])) + { + echo do_shortcode('[MEC id="'.$settings['type'].'"]'); + } + } +} \ No newline at end of file diff --git a/app/addons/index.html b/app/addons/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/addons/learndash.php b/app/addons/learndash.php new file mode 100755 index 0000000..7e6e5a3 --- /dev/null +++ b/app/addons/learndash.php @@ -0,0 +1,158 @@ + + */ +class MEC_addon_learndash extends MEC_base +{ + /** + * @var MEC_factory + */ + public $factory; + + /** + * @var MEC_main + */ + public $main; + public $settings; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // MEC Factory class + $this->factory = $this->getFactory(); + + // MEC Main class + $this->main = $this->getMain(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + } + + /** + * Initialize the LD addon + * @author Webnus + * @return boolean + */ + public function init() + { + // Module is not enabled + if(!isset($this->settings['ld_status']) or (isset($this->settings['ld_status']) and !$this->settings['ld_status'])) return false; + + // Tickets + add_action('custom_field_ticket', array($this, 'add_courses_dropdown_to_tickets'), 10, 2); + add_action('custom_field_dynamic_ticket', array($this, 'add_courses_dropdown_to_raw_tickets')); + + // Enrollment Method + $enroll_method = (isset($this->settings['ld_enrollment_method']) and trim($this->settings['ld_enrollment_method'])) ? $this->settings['ld_enrollment_method'] : 'booking'; + + // Enroll + if($enroll_method === 'booking') add_action('mec_booking_completed', array($this, 'assign'), 10, 1); + elseif($enroll_method === 'confirm') add_action('mec_booking_confirmed', array($this, 'assign'), 10, 1); + elseif($enroll_method === 'verification') add_action('mec_booking_verified', array($this, 'assign'), 10, 1); + elseif($enroll_method === 'confirm_verification') + { + add_action('mec_booking_confirmed', array($this, 'pre_enroll'), 10, 1); + add_action('mec_booking_verified', array($this, 'pre_enroll'), 10, 1); + } + + return true; + } + + public function add_courses_dropdown_to_tickets($ticket, $key) + { + // LearnDash is not installed + if(!defined('LEARNDASH_VERSION')) return; + + $courses = $this->get_courses(); + if(!count($courses)) return; + ?> +
+ + +
+ add_courses_dropdown_to_tickets(array(), ':i:'); + } + + public function get_courses() + { + $courses = []; + + $args = ['post_type' => 'sfwd-courses', 'posts_per_page' => -1]; + if(!current_user_can('manage_options') and isset($this->settings['ld_course_access']) and $this->settings['ld_course_access'] === 'user') $args['author'] = get_current_user_id(); + + $posts = get_posts($args); + if($posts) foreach($posts as $post) $courses[$post->ID] = $post->post_title; + + return $courses; + } + + public function assign($book_id) + { + // LearnDash is not installed + if(!defined('LEARNDASH_VERSION')) return; + + // MEC User + $u = $this->getUser(); + + $event_id = get_post_meta($book_id, 'mec_event_id', true); + $ticket_ids = explode(',', get_post_meta($book_id, 'mec_ticket_id', true)); + + $attendees = get_post_meta($book_id, 'mec_attendees', true); + if(!is_array($attendees)) $attendees = []; + + $tickets = get_post_meta($event_id, 'mec_tickets', true); + + foreach($attendees as $key => $attendee) + { + if($key === 'attachments') continue; + if(!isset($attendee['id'])) continue; + + $ticket_id = $attendee['id']; + + if(!is_numeric($ticket_id)) continue; + if(!in_array($ticket_id, $ticket_ids)) continue; + if(!isset($tickets[$ticket_id])) continue; + + $ticket = $tickets[$ticket_id]; + + // Course ID + $course_id = $ticket['ld_course']; + + // User ID + $user_id = $u->register($attendee, [ + 'event_id' => $event_id, + ]); + + // Associate Course + ld_update_course_access($user_id, $course_id, false); + } + } + + public function pre_enroll($booking_id) + { + $confirmed = get_post_meta($booking_id, 'mec_confirmed', true); + $verified = get_post_meta($booking_id, 'mec_verified', true); + + if($confirmed == 1 and $verified == 1) $this->assign($booking_id); + } +} \ No newline at end of file diff --git a/app/addons/mec-beaver-builder/calendar.svg b/app/addons/mec-beaver-builder/calendar.svg new file mode 100755 index 0000000..8b77f50 --- /dev/null +++ b/app/addons/mec-beaver-builder/calendar.svg @@ -0,0 +1 @@ + diff --git a/app/addons/mec-beaver-builder/includes/frontend.php b/app/addons/mec-beaver-builder/includes/frontend.php new file mode 100755 index 0000000..1f4d306 --- /dev/null +++ b/app/addons/mec-beaver-builder/includes/frontend.php @@ -0,0 +1,3 @@ +
+ mec_shortcode.'"]') ?> +
diff --git a/app/addons/mec-beaver-builder/mec-beaver-builder.php b/app/addons/mec-beaver-builder/mec-beaver-builder.php new file mode 100755 index 0000000..8063a67 --- /dev/null +++ b/app/addons/mec-beaver-builder/mec-beaver-builder.php @@ -0,0 +1,39 @@ + esc_html__( 'Modern Events Calendar (MEC)', 'modern-events-calendar-lite'), + 'description' => esc_html__( 'MEC Shortcodes', 'modern-events-calendar-lite'), + 'category' => esc_html__( 'Basic', 'modern-events-calendar-lite'), + 'dir' => MEC_BEAVER_DIR . 'mec-beaver-builder/', + 'url' => MEC_BEAVER_URL . 'mec-beaver-builder/', + 'icon' => 'button.svg', + 'editor_export' => true, // Defaults to true and can be omitted. + 'enabled' => true, // Defaults to true and can be omitted. + 'partial_refresh' => false, // Defaults to false and can be omitted. + )); + } +} + +$calendar_posts = get_posts(array('post_type'=>'mec_calendars', 'posts_per_page'=>'-1')); +$calendars = []; +foreach($calendar_posts as $calendar_post) $calendars[$calendar_post->ID] = $calendar_post->post_title; +FLBuilder::register_module( 'mecBeaverBuilderShortcode', array( + 'my-tab-1' => array( + 'title' => esc_html__( 'Content', 'modern-events-calendar-lite'), + 'sections' => array( + 'my-section-1' => array( + 'title' => esc_html__( 'Select Shortcode', 'modern-events-calendar-lite'), + 'fields' => array( + 'mec_shortcode' => array( + 'type' => 'select', + 'label' => esc_html__( 'Select Shortcode', 'modern-events-calendar-lite'), + 'options' => $calendars, + ), + ) + ) + ) + ) +) ); \ No newline at end of file diff --git a/app/addons/tnp/index.html b/app/addons/tnp/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/addons/tnp/simple/block-empty.php b/app/addons/tnp/simple/block-empty.php new file mode 100755 index 0000000..4250ae0 --- /dev/null +++ b/app/addons/tnp/simple/block-empty.php @@ -0,0 +1 @@ +

\ No newline at end of file diff --git a/app/addons/tnp/simple/block-full.php b/app/addons/tnp/simple/block-full.php new file mode 100755 index 0000000..aab4450 --- /dev/null +++ b/app/addons/tnp/simple/block-full.php @@ -0,0 +1,54 @@ + + + + + + + + + + + + + post_content): ?> + + + + + + + + +
+ +
+ post_title; ?> +
+ post_content; ?> +
+ +
diff --git a/app/addons/tnp/simple/block-left.php b/app/addons/tnp/simple/block-left.php new file mode 100755 index 0000000..f0abfdf --- /dev/null +++ b/app/addons/tnp/simple/block-left.php @@ -0,0 +1,47 @@ + + + + + + +
+ +
+ + + + + + post_content): ?> + + + + + + + +
+ post_title; ?> +
+ post_content; ?> +
+ +
diff --git a/app/addons/tnp/simple/block-right.php b/app/addons/tnp/simple/block-right.php new file mode 100755 index 0000000..ad69536 --- /dev/null +++ b/app/addons/tnp/simple/block-right.php @@ -0,0 +1,51 @@ + + +
+ + + + + +
+ +
+ + + + + + post_content): ?> + + + + + + + +
+ post_title; ?> +
+ post_content; ?> +
+ +
+ +
diff --git a/app/addons/tnp/simple/block.php b/app/addons/tnp/simple/block.php new file mode 100755 index 0000000..fe9c825 --- /dev/null +++ b/app/addons/tnp/simple/block.php @@ -0,0 +1,71 @@ + NULL, + 'layout' => 'full', + + // block_ prefixed options are reserved for Newsletter and the ones below managed directly by Newsletter + 'block_padding_left' => 15, + 'block_padding_right' => 15, + 'block_padding_top' => 15, + 'block_padding_bottom' => 15, + 'block_background' => '#ffffff', +); + +$options = array_merge($default_options, $options); + +/** @var MEC_main $main */ +$main = MEC_base::getInstance('app.libraries.main'); + +$event_id = $options['event_id']; + +$layout = $options['layout']; +if(!$event_id) $layout = 'empty'; + +$td_width = round((600 - $options['block_padding_left'] - $options['block_padding_right'] - 20)/2); + +$featured_image_id = $event_id ? get_post_thumbnail_id($event_id) : NULL; +if($event_id and $featured_image_id) +{ + if($layout === 'full') + { + $image_width = 600 - $options['block_padding_left'] - $options['block_padding_right']; + $media = tnp_resize_2x($featured_image_id, [$image_width, 0]); + } + else + { + $media = tnp_resize_2x($featured_image_id, [$td_width, 0]); + } +} +else $media = false; + +$title_style = TNP_Composer::get_title_style($options, 'title', $composer); +$text_style = TNP_Composer::get_text_style($options, '', $composer); + +$event = $event_id ? get_post($event_id) : NULL; + +$button_options = $options; +$button_options['button_url'] = $event_id ? get_permalink($event) : NULL; +$button_options['button_label'] = esc_html__('Click Here', 'modern-events-calendar-lite'); + +switch ($layout) { + case 'left': + include __DIR__ . '/block-left.php'; + return; + case 'right': + include __DIR__ . '/block-right.php'; + return; + case 'empty': + include __DIR__ . '/block-empty.php'; + return; + default: + include __DIR__ . '/block-full.php'; + return; +} diff --git a/app/addons/tnp/simple/icon.png b/app/addons/tnp/simple/icon.png new file mode 100755 index 0000000..25ad911 Binary files /dev/null and b/app/addons/tnp/simple/icon.png differ diff --git a/app/addons/tnp/simple/index.html b/app/addons/tnp/simple/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/addons/tnp/simple/options.php b/app/addons/tnp/simple/options.php new file mode 100755 index 0000000..55dce43 --- /dev/null +++ b/app/addons/tnp/simple/options.php @@ -0,0 +1,26 @@ + + + $main->get_main_post_type(), + 'posts_per_page' => -1 +)); + +$options = array('' => '-----'); +foreach($posts as $post) $options['' . $post->ID] = $post->post_title; + +$fields->select('event_id', esc_html__('Event', 'modern-events-calendar-lite'), $options); ?> + +select('layout', esc_html__('Layout', 'modern-events-calendar-lite'), array( + 'full' => 'Full', + 'left' => 'Image left', + 'right' => 'Image right' +)); ?> + +block_commons(); \ No newline at end of file diff --git a/app/api/Campaign_Monitor/class/base_classes.php b/app/api/Campaign_Monitor/class/base_classes.php new file mode 100755 index 0000000..95dde69 --- /dev/null +++ b/app/api/Campaign_Monitor/class/base_classes.php @@ -0,0 +1,317 @@ +response = $response; + $this->http_status_code = $code; + } + + /** + * Can be used to check if a call to the api resulted in a successful response. + * @return boolean False if the call failed. Check the response property for the failure reason. + * @access public + */ + function was_successful() { + return $this->http_status_code >= 200 && $this->http_status_code < 300; + } + } +} +/** + * Base class for the create send PHP wrapper. + * This class includes functions to access the general data, + * i.e timezones, clients and getting your API Key from username and password + * @author tobyb + * + */ +if (!class_exists('CS_REST_Wrapper_Base')) { + class CS_REST_Wrapper_Base { + /** + * The protocol to use while accessing the api + * @var string http or https + * @access private + */ + var $_protocol; + + /** + * The base route of the create send api. + * @var string + * @access private + */ + var $_base_route; + + /** + * The serialiser to use for serialisation and deserialisation + * of API request and response data + * @var CS_REST_JsonSerialiser or CS_REST_XmlSerialiser + * @access private + */ + var $_serialiser; + + /** + * The transport to use to send API requests + * @var CS_REST_CurlTransport or CS_REST_SocketTransport or your own custom transport. + * @access private + */ + var $_transport; + + /** + * The logger to use for debugging of all API requests + * @var CS_REST_Log + * @access private + */ + var $_log; + + /** + * The default options to use for each API request. + * These can be overridden by passing in an array as the call_options argument + * to a single api request. + * Valid options are: + * + * deserialise boolean: + * Set this to false if you want to get the raw response. + * This can be useful if your passing json directly to javascript. + * + * While there are clearly other options there is no need to change them. + * @var array + * @access private + */ + var $_default_call_options; + + /** + * Constructor. + * @param $auth_details array Authentication details to use for API calls. + * This array must take one of the following forms: + * If using OAuth to authenticate: + * array( + * 'access_token' => 'your access token', + * 'refresh_token' => 'your refresh token') + * + * Or if using an API key: + * array('api_key' => 'your api key') + * + * Note that this method will continue to work in the deprecated + * case when $auth_details is passed in as a string containing an + * API key. + * @param $protocol string The protocol to use for requests (http|https) + * @param $debug_level int The level of debugging required CS_REST_LOG_NONE | CS_REST_LOG_ERROR | CS_REST_LOG_WARNING | CS_REST_LOG_VERBOSE + * @param $host string The host to send API requests to. There is no need to change this + * @param $log CS_REST_Log The logger to use. Used for dependency injection + * @param $serialiser The serialiser to use. Used for dependency injection + * @param $transport The transport to use. Used for dependency injection + * @access public + */ + function __construct( + $auth_details, + $protocol = 'https', + $debug_level = CS_REST_LOG_NONE, + $host = CS_HOST, + $log = NULL, + $serialiser = NULL, + $transport = NULL) { + + if (is_string($auth_details)) { + # If $auth_details is a string, assume it is an API key + $auth_details = array('api_key' => $auth_details); + } + + $this->_log = is_null($log) ? new CS_REST_Log($debug_level) : $log; + + $this->_protocol = $protocol; + $this->_base_route = $protocol.'://'.$host.'/api/v3.2/'; + + $this->_log->log_message('Creating wrapper for '.$this->_base_route, get_class($this), CS_REST_LOG_VERBOSE); + + $this->_transport = is_null($transport) ? + CS_REST_TRANSPORT_get_available($this->is_secure(), $this->_log) : + $transport; + + $transport_type = method_exists($this->_transport, 'get_type') ? $this->_transport->get_type() : 'Unknown'; + $this->_log->log_message('Using '.$transport_type.' for transport', get_class($this), CS_REST_LOG_WARNING); + + $this->_serialiser = is_null($serialiser) ? + CS_REST_SERIALISATION_get_available($this->_log) : $serialiser; + + $this->_log->log_message('Using '.$this->_serialiser->get_type().' json serialising', get_class($this), CS_REST_LOG_WARNING); + + $this->_default_call_options = array ( + 'authdetails' => $auth_details, + 'userAgent' => 'createsend-php v'.CS_REST_WRAPPER_VERSION. + ' PHPv'.phpversion().' over '.$transport_type.' with '.$this->_serialiser->get_type(), + 'contentType' => 'application/json; charset=utf-8', + 'deserialise' => true, + 'host' => $host, + 'protocol' => $protocol + ); + + } + + /** + * Refresh the current OAuth token using the current refresh token. + * @access public + */ + function refresh_token() { + if (!isset($this->_default_call_options['authdetails']) || + !isset($this->_default_call_options['authdetails']['refresh_token'])) { + trigger_error( + 'Error refreshing token. There is no refresh token set on this object.', + E_USER_ERROR); + return array(NULL, NULL, NULL); + } + $body = "grant_type=refresh_token&refresh_token=".urlencode( + $this->_default_call_options['authdetails']['refresh_token']); + $options = array('contentType' => 'application/x-www-form-urlencoded'); + $wrap = new CS_REST_Wrapper_Base( + NULL, 'https', CS_REST_LOG_NONE, CS_HOST, NULL, + new CS_REST_DoNothingSerialiser(), NULL); + + $result = $wrap->post_request(CS_OAUTH_TOKEN_URI, $body, $options); + if ($result->was_successful()) { + $access_token = $result->response->access_token; + $expires_in = $result->response->expires_in; + $refresh_token = $result->response->refresh_token; + $this->_default_call_options['authdetails'] = array( + 'access_token' => $access_token, + 'refresh_token' => $refresh_token + ); + return array($access_token, $expires_in, $refresh_token); + } else { + trigger_error( + 'Error refreshing token. '.$result->response->error.': '.$result->response->error_description, + E_USER_ERROR); + return array(NULL, NULL, NULL); + } + } + + /** + * @return boolean True if the wrapper is using SSL. + * @access public + */ + function is_secure() { + return $this->_protocol === 'https'; + } + + function put_request($route, $data, $call_options = array()) { + return $this->_call($call_options, CS_REST_PUT, $route, $data); + } + + function post_request($route, $data, $call_options = array()) { + return $this->_call($call_options, CS_REST_POST, $route, $data); + } + + function delete_request($route, $call_options = array()) { + return $this->_call($call_options, CS_REST_DELETE, $route); + } + + function get_request($route, $include_tracking_pref = NULL, $call_options = array()) { + + if(isset($include_tracking_pref) + && is_bool($include_tracking_pref)) { + $route .= '&includeTrackingPreference='.($include_tracking_pref ? "true" : "false"); + } + + return $this->_call($call_options, CS_REST_GET, $route); + } + + function get_request_with_params($route, $params) { + if(!is_null($params)) { + # http_build_query coerces booleans to 1 and 0, not helpful + foreach($params as $key=>$value) { + if(is_bool($value)) { + $params[$key] = ($value) ? 'true' : 'false'; + } + } + $route = $route . '?' . http_build_query($params); + } + return $this->get_request($route); + } + + function get_request_paged($route, $page_number, $page_size, $order_field, $order_direction, $include_tracking_pref = NULL, + $join_char = 'deprecated') { + // Stores our query values + $query = []; + // Extract any initial queries in the route into our local query + if(strpos($route, '?') !== false) { + $parts = parse_url($route); + $route = current(explode('?', $route)); + if(array_key_exists('query', $parts) && !empty($parts['query'])) { + parse_str($parts['query'], $query); + } + } + // Now selectively add supplied vars to the query + if(!is_null($page_number)) { + $query['page'] = $page_number; + } + if(!is_null($page_size)) { + $query['pageSize'] = $page_size; + } + if(!is_null($order_field)) { + $query['orderField'] = $order_field; + } + if(!is_null($order_direction)) { + $query['orderDirection'] = $order_direction; + } + // If we ended up with a query, add it back to the route + if(!empty($query)) { + $route .= '?'.http_build_query($query); + } + return $this->get_request($route, $include_tracking_pref); + } + + /** + * Internal method to make a general API request based on the provided options + * @param $call_options + * @access private + */ + function _call($call_options, $method, $route, $data = NULL) { + $call_options['route'] = $route; + $call_options['method'] = $method; + + if(!is_null($data)) { + $call_options['data'] = $this->_serialiser->serialise($data); + } + + $call_options = array_merge($this->_default_call_options, $call_options); + $this->_log->log_message('Making '.$call_options['method'].' call to: '.$call_options['route'], get_class($this), CS_REST_LOG_WARNING); + + $call_result = $this->_transport->make_call($call_options); + + $this->_log->log_message('Call result:
'.var_export($call_result, true).'
', + get_class($this), CS_REST_LOG_VERBOSE); + + if($call_options['deserialise']) { + $call_result['response'] = $this->_serialiser->deserialise($call_result['response']); + } + + return new CS_REST_Wrapper_Result($call_result['response'], $call_result['code']); + } + } +} \ No newline at end of file diff --git a/app/api/Campaign_Monitor/class/cacert.pem b/app/api/Campaign_Monitor/class/cacert.pem new file mode 100755 index 0000000..617991f --- /dev/null +++ b/app/api/Campaign_Monitor/class/cacert.pem @@ -0,0 +1,3849 @@ +## +## ca-bundle.crt -- Bundle of CA Root Certificates +## +## Certificate data from Mozilla as of: Thu Jun 28 15:03:08 2012 +## +## This is a bundle of X.509 certificates of public Certificate Authorities +## (CA). These were automatically extracted from Mozilla's root certificates +## file (certdata.txt). This file can be found in the mozilla source tree: +## http://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1 +## +## It contains the certificates in PEM format and therefore +## can be directly used with curl / libcurl / php_curl, or with +## an Apache+mod_ssl webserver for SSL client authentication. +## Just configure this file as the SSLCACertificateFile. +## + +# @(#) $RCSfile: certdata.txt,v $ $Revision: 1.85 $ $Date: 2012/06/28 13:50:18 $ + +GTE CyberTrust Global Root +========================== +-----BEGIN CERTIFICATE----- +MIICWjCCAcMCAgGlMA0GCSqGSIb3DQEBBAUAMHUxCzAJBgNVBAYTAlVTMRgwFgYDVQQKEw9HVEUg +Q29ycG9yYXRpb24xJzAlBgNVBAsTHkdURSBDeWJlclRydXN0IFNvbHV0aW9ucywgSW5jLjEjMCEG +A1UEAxMaR1RFIEN5YmVyVHJ1c3QgR2xvYmFsIFJvb3QwHhcNOTgwODEzMDAyOTAwWhcNMTgwODEz +MjM1OTAwWjB1MQswCQYDVQQGEwJVUzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMScwJQYDVQQL +Ex5HVEUgQ3liZXJUcnVzdCBTb2x1dGlvbnMsIEluYy4xIzAhBgNVBAMTGkdURSBDeWJlclRydXN0 +IEdsb2JhbCBSb290MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCVD6C28FCc6HrHiM3dFw4u +sJTQGz0O9pTAipTHBsiQl8i4ZBp6fmw8U+E3KHNgf7KXUwefU/ltWJTSr41tiGeA5u2ylc9yMcql +HHK6XALnZELn+aks1joNrI1CqiQBOeacPwGFVw1Yh0X404Wqk2kmhXBIgD8SFcd5tB8FLztimQID +AQABMA0GCSqGSIb3DQEBBAUAA4GBAG3rGwnpXtlR22ciYaQqPEh346B8pt5zohQDhT37qw4wxYMW +M4ETCJ57NE7fQMh017l93PR2VX2bY1QY6fDq81yx2YtCHrnAlU66+tXifPVoYb+O7AWXX1uw16OF +NMQkpw0PlZPvy5TYnh+dXIVtx6quTx8itc2VrbqnzPmrC3p/ +-----END CERTIFICATE----- + +Thawte Server CA +================ +-----BEGIN CERTIFICATE----- +MIIDEzCCAnygAwIBAgIBATANBgkqhkiG9w0BAQQFADCBxDELMAkGA1UEBhMCWkExFTATBgNVBAgT +DFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29uc3Vs +dGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEZMBcGA1UE +AxMQVGhhd3RlIFNlcnZlciBDQTEmMCQGCSqGSIb3DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0ZS5j +b20wHhcNOTYwODAxMDAwMDAwWhcNMjAxMjMxMjM1OTU5WjCBxDELMAkGA1UEBhMCWkExFTATBgNV +BAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29u +c3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEZMBcG +A1UEAxMQVGhhd3RlIFNlcnZlciBDQTEmMCQGCSqGSIb3DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0 +ZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANOkUG7I/1Zr5s9dtuoMaHVHoqrC2oQl +/Kj0R1HahbUgdJSGHg91yekIYfUGbTBuFRkC6VLAYttNmZ7iagxEOM3+vuNkCXDF/rFrKbYvScg7 +1CcEJRCXL+eQbcAoQpnXTEPew/UhbVSfXcNY4cDk2VuwuNy0e982OsK1ZiIS1ocNAgMBAAGjEzAR +MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAB/pMaVz7lcxG7oWDTSEwjsrZqG9J +GubaUeNgcGyEYRGhGshIPllDfU+VPaGLtwtimHp1it2ITk6eQNuozDJ0uW8NxuOzRAvZim+aKZuZ +GCg70eNAKJpaPNW15yAbi8qkq43pUdniTCxZqdq5snUb9kLy78fyGPmJvKP/iiMucEc= +-----END CERTIFICATE----- + +Thawte Premium Server CA +======================== +-----BEGIN CERTIFICATE----- +MIIDJzCCApCgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBzjELMAkGA1UEBhMCWkExFTATBgNVBAgT +DFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3dGUgQ29uc3Vs +dGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UE +AxMYVGhhd3RlIFByZW1pdW0gU2VydmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZl +ckB0aGF3dGUuY29tMB4XDTk2MDgwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgc4xCzAJBgNVBAYT +AlpBMRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsGA1UEChMU +VGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRpb24gU2VydmljZXMgRGl2 +aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQcmVtaXVtIFNlcnZlciBDQTEoMCYGCSqGSIb3DQEJARYZ +cHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0jY2 +aovXwlue2oFBYo847kkEVdbQ7xwblRZH7xhINTpS9CtqBo87L+pW46+GjZ4X9560ZXUCTe/LCaIh +Udib0GfQug2SBhRz1JPLlyoAnFxODLz6FVL88kRu2hFKbgifLy3j+ao6hnO2RlNYyIkFvYMRuHM/ +qgeN9EJN50CdHDcCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQQFAAOBgQAm +SCwWwlj66BZ0DKqqX1Q/8tfJeGBeXm43YyJ3Nn6yF8Q0ufUIhfzJATj/Tb7yFkJD57taRvvBxhEf +8UqwKEbJw8RCfbz6q1lu1bdRiBHjpIUZa4JMpAwSremkrj/xw0llmozFyD4lt5SZu5IycQfwhl7t +UCemDaYj+bvLpgcUQg== +-----END CERTIFICATE----- + +Equifax Secure CA +================= +-----BEGIN CERTIFICATE----- +MIIDIDCCAomgAwIBAgIENd70zzANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJVUzEQMA4GA1UE +ChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5 +MB4XDTk4MDgyMjE2NDE1MVoXDTE4MDgyMjE2NDE1MVowTjELMAkGA1UEBhMCVVMxEDAOBgNVBAoT +B0VxdWlmYXgxLTArBgNVBAsTJEVxdWlmYXggU2VjdXJlIENlcnRpZmljYXRlIEF1dGhvcml0eTCB +nzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAwV2xWGcIYu6gmi0fCG2RFGiYCh7+2gRvE4RiIcPR +fM6fBeC4AfBONOziipUEZKzxa1NfBbPLZ4C/QgKO/t0BCezhABRP/PvwDN1Dulsr4R+AcJkVV5MW +8Q+XarfCaCMczE1ZMKxRHjuvK9buY0V7xdlfUNLjUA86iOe/FP3gx7kCAwEAAaOCAQkwggEFMHAG +A1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEQMA4GA1UEChMHRXF1aWZheDEtMCsGA1UE +CxMkRXF1aWZheCBTZWN1cmUgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMBoG +A1UdEAQTMBGBDzIwMTgwODIyMTY0MTUxWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUSOZo+SvS +spXXR9gjIBBPM5iQn9QwHQYDVR0OBBYEFEjmaPkr0rKV10fYIyAQTzOYkJ/UMAwGA1UdEwQFMAMB +Af8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUAA4GBAFjOKer89961 +zgK5F7WF0bnj4JXMJTENAKaSbn+2kmOeUJXRmm/kEd5jhW6Y7qj/WsjTVbJmcVfewCHrPSqnI0kB +BIZCe/zuf6IWUrVnZ9NA2zsmWLIodz2uFHdh1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee95 +70+sB3c4 +-----END CERTIFICATE----- + +Digital Signature Trust Co. Global CA 1 +======================================= +-----BEGIN CERTIFICATE----- +MIIDKTCCApKgAwIBAgIENnAVljANBgkqhkiG9w0BAQUFADBGMQswCQYDVQQGEwJVUzEkMCIGA1UE +ChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMREwDwYDVQQLEwhEU1RDQSBFMTAeFw05ODEy +MTAxODEwMjNaFw0xODEyMTAxODQwMjNaMEYxCzAJBgNVBAYTAlVTMSQwIgYDVQQKExtEaWdpdGFs +IFNpZ25hdHVyZSBUcnVzdCBDby4xETAPBgNVBAsTCERTVENBIEUxMIGdMA0GCSqGSIb3DQEBAQUA +A4GLADCBhwKBgQCgbIGpzzQeJN3+hijM3oMv+V7UQtLodGBmE5gGHKlREmlvMVW5SXIACH7TpWJE +NySZj9mDSI+ZbZUTu0M7LklOiDfBu1h//uG9+LthzfNHwJmm8fOR6Hh8AMthyUQncWlVSn5JTe2i +o74CTADKAqjuAQIxZA9SLRN0dja1erQtcQIBA6OCASQwggEgMBEGCWCGSAGG+EIBAQQEAwIABzBo +BgNVHR8EYTBfMF2gW6BZpFcwVTELMAkGA1UEBhMCVVMxJDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0 +dXJlIFRydXN0IENvLjERMA8GA1UECxMIRFNUQ0EgRTExDTALBgNVBAMTBENSTDEwKwYDVR0QBCQw +IoAPMTk5ODEyMTAxODEwMjNagQ8yMDE4MTIxMDE4MTAyM1owCwYDVR0PBAQDAgEGMB8GA1UdIwQY +MBaAFGp5fpFpRhgTCgJ3pVlbYJglDqL4MB0GA1UdDgQWBBRqeX6RaUYYEwoCd6VZW2CYJQ6i+DAM +BgNVHRMEBTADAQH/MBkGCSqGSIb2fQdBAAQMMAobBFY0LjADAgSQMA0GCSqGSIb3DQEBBQUAA4GB +ACIS2Hod3IEGtgllsofIH160L+nEHvI8wbsEkBFKg05+k7lNQseSJqBcNJo4cvj9axY+IO6CizEq +kzaFI4iKPANo08kJD038bKTaKHKTDomAsH3+gG9lbRgzl4vCa4nuYD3Im+9/KzJic5PLPON74nZ4 +RbyhkwS7hp86W0N6w4pl +-----END CERTIFICATE----- + +Digital Signature Trust Co. Global CA 3 +======================================= +-----BEGIN CERTIFICATE----- +MIIDKTCCApKgAwIBAgIENm7TzjANBgkqhkiG9w0BAQUFADBGMQswCQYDVQQGEwJVUzEkMCIGA1UE +ChMbRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QgQ28uMREwDwYDVQQLEwhEU1RDQSBFMjAeFw05ODEy +MDkxOTE3MjZaFw0xODEyMDkxOTQ3MjZaMEYxCzAJBgNVBAYTAlVTMSQwIgYDVQQKExtEaWdpdGFs +IFNpZ25hdHVyZSBUcnVzdCBDby4xETAPBgNVBAsTCERTVENBIEUyMIGdMA0GCSqGSIb3DQEBAQUA +A4GLADCBhwKBgQC/k48Xku8zExjrEH9OFr//Bo8qhbxe+SSmJIi2A7fBw18DW9Fvrn5C6mYjuGOD +VvsoLeE4i7TuqAHhzhy2iCoiRoX7n6dwqUcUP87eZfCocfdPJmyMvMa1795JJ/9IKn3oTQPMx7JS +xhcxEzu1TdvIxPbDDyQq2gyd55FbgM2UnQIBA6OCASQwggEgMBEGCWCGSAGG+EIBAQQEAwIABzBo +BgNVHR8EYTBfMF2gW6BZpFcwVTELMAkGA1UEBhMCVVMxJDAiBgNVBAoTG0RpZ2l0YWwgU2lnbmF0 +dXJlIFRydXN0IENvLjERMA8GA1UECxMIRFNUQ0EgRTIxDTALBgNVBAMTBENSTDEwKwYDVR0QBCQw +IoAPMTk5ODEyMDkxOTE3MjZagQ8yMDE4MTIwOTE5MTcyNlowCwYDVR0PBAQDAgEGMB8GA1UdIwQY +MBaAFB6CTShlgDzJQW6sNS5ay97u+DlbMB0GA1UdDgQWBBQegk0oZYA8yUFurDUuWsve7vg5WzAM +BgNVHRMEBTADAQH/MBkGCSqGSIb2fQdBAAQMMAobBFY0LjADAgSQMA0GCSqGSIb3DQEBBQUAA4GB +AEeNg61i8tuwnkUiBbmi1gMOOHLnnvx75pO2mqWilMg0HZHRxdf0CiUPPXiBng+xZ8SQTGPdXqfi +up/1902lMXucKS1M/mQ+7LZT/uqb7YLbdHVLB3luHtgZg3Pe9T7Qtd7nS2h9Qy4qIOF+oHhEngj1 +mPnHfxsb1gYgAlihw6ID +-----END CERTIFICATE----- + +Verisign Class 3 Public Primary Certification Authority +======================================================= +-----BEGIN CERTIFICATE----- +MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkGA1UEBhMCVVMx +FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmltYXJ5 +IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVow +XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAz +IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA +A4GNADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhEBarsAx94 +f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/isI19wKTakyYbnsZogy1Ol +hec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0GCSqGSIb3DQEBAgUAA4GBALtMEivPLCYA +TxQT3ab7/AoRhIzzKBxnki98tsX63/Dolbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59Ah +WM1pF+NEHJwZRDmJXNycAA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2Omuf +Tqj/ZA1k +-----END CERTIFICATE----- + +Verisign Class 1 Public Primary Certification Authority - G2 +============================================================ +-----BEGIN CERTIFICATE----- +MIIDAjCCAmsCEEzH6qqYPnHTkxD4PTqJkZIwDQYJKoZIhvcNAQEFBQAwgcExCzAJBgNVBAYTAlVT +MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMSBQdWJsaWMgUHJpbWFy +eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln +biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz +dCBOZXR3b3JrMB4XDTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVT +MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMSBQdWJsaWMgUHJpbWFy +eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln +biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz +dCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCq0Lq+Fi24g9TK0g+8djHKlNgd +k4xWArzZbxpvUjZudVYKVdPfQ4chEWWKfo+9Id5rMj8bhDSVBZ1BNeuS65bdqlk/AVNtmU/t5eIq +WpDBucSmFc/IReumXY6cPvBkJHalzasab7bYe1FhbqZ/h8jit+U03EGI6glAvnOSPWvndQIDAQAB +MA0GCSqGSIb3DQEBBQUAA4GBAKlPww3HZ74sy9mozS11534Vnjty637rXC0Jh9ZrbWB85a7FkCMM +XErQr7Fd88e2CtvgFZMN3QO8x3aKtd1Pw5sTdbgBwObJW2uluIncrKTdcu1OofdPvAbT6shkdHvC +lUGcZXNY8ZCaPGqxmMnEh7zPRW1F4m4iP/68DzFc6PLZ +-----END CERTIFICATE----- + +Verisign Class 2 Public Primary Certification Authority - G2 +============================================================ +-----BEGIN CERTIFICATE----- +MIIDAzCCAmwCEQC5L2DMiJ+hekYJuFtwbIqvMA0GCSqGSIb3DQEBBQUAMIHBMQswCQYDVQQGEwJV +UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xPDA6BgNVBAsTM0NsYXNzIDIgUHVibGljIFByaW1h +cnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjE6MDgGA1UECxMxKGMpIDE5OTggVmVyaVNp +Z24sIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1 +c3QgTmV0d29yazAeFw05ODA1MTgwMDAwMDBaFw0yODA4MDEyMzU5NTlaMIHBMQswCQYDVQQGEwJV +UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xPDA6BgNVBAsTM0NsYXNzIDIgUHVibGljIFByaW1h +cnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjE6MDgGA1UECxMxKGMpIDE5OTggVmVyaVNp +Z24sIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1 +c3QgTmV0d29yazCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAp4gBIXQs5xoD8JjhlzwPIQjx +nNuX6Zr8wgQGE75fUsjMHiwSViy4AWkszJkfrbCWrnkE8hM5wXuYuggs6MKEEyyqaekJ9MepAqRC +wiNPStjwDqL7MWzJ5m+ZJwf15vRMeJ5t60aG+rmGyVTyssSv1EYcWskVMP8NbPUtDm3Of3cCAwEA +ATANBgkqhkiG9w0BAQUFAAOBgQByLvl/0fFx+8Se9sVeUYpAmLho+Jscg9jinb3/7aHmZuovCfTK +1+qlK5X2JGCGTUQug6XELaDTrnhpb3LabK4I8GOSN+a7xDAXrXfMSTWqz9iP0b63GJZHc2pUIjRk +LbYWm1lbtFFZOrMLFPQS32eg9K0yZF6xRnInjBJ7xUS0rg== +-----END CERTIFICATE----- + +Verisign Class 3 Public Primary Certification Authority - G2 +============================================================ +-----BEGIN CERTIFICATE----- +MIIDAjCCAmsCEH3Z/gfPqB63EHln+6eJNMYwDQYJKoZIhvcNAQEFBQAwgcExCzAJBgNVBAYTAlVT +MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMgUHJpbWFy +eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln +biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz +dCBOZXR3b3JrMB4XDTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVT +MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMgUHJpbWFy +eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2ln +biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVz +dCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDMXtERXVxp0KvTuWpMmR9ZmDCO +FoUgRm1HP9SFIIThbbP4pO0M8RcPO/mn+SXXwc+EY/J8Y8+iR/LGWzOOZEAEaMGAuWQcRXfH2G71 +lSk8UOg013gfqLptQ5GVj0VXXn7F+8qkBOvqlzdUMG+7AUcyM83cV5tkaWH4mx0ciU9cZwIDAQAB +MA0GCSqGSIb3DQEBBQUAA4GBAFFNzb5cy5gZnBWyATl4Lk0PZ3BwmcYQWpSkU01UbSuvDV1Ai2TT +1+7eVmGSX6bEHRBhNtMsJzzoKQm5EWR0zLVznxxIqbxhAe7iF6YM40AIOw7n60RzKprxaZLvcRTD +Oaxxp5EJb+RxBrO6WVcmeQD2+A2iMzAo1KpYoJ2daZH9 +-----END CERTIFICATE----- + +GlobalSign Root CA +================== +-----BEGIN CERTIFICATE----- +MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkGA1UEBhMCQkUx +GTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jvb3QgQ0ExGzAZBgNVBAMTEkds +b2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAwMDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNV +BAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYD +VQQDExJHbG9iYWxTaWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDa +DuaZjc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavpxy0Sy6sc +THAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp1Wrjsok6Vjk4bwY8iGlb +Kk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdGsnUOhugZitVtbNV4FpWi6cgKOOvyJBNP +c1STE4U6G7weNLWLBYy5d4ux2x8gkasJU26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrX +gzT/LCrBbBlDSgeF59N89iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV +HRMBAf8EBTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0BAQUF +AAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOzyj1hTdNGCbM+w6Dj +Y1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE38NflNUVyRRBnMRddWQVDf9VMOyG +j/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymPAbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhH +hm4qxFYxldBniYUr+WymXUadDKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveC +X4XSQRjbgbMEHMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A== +-----END CERTIFICATE----- + +GlobalSign Root CA - R2 +======================= +-----BEGIN CERTIFICATE----- +MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4GA1UECxMXR2xv +YmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh +bFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1MDgwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxT +aWduIFJvb3QgQ0EgLSBSMjETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2ln +bjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKbPJA6+Lm8omUVCxKs+IVSbC9N/hHD6 +ErPLv4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7SqbKSaZeqKeMWhG8eoLrvozp +s6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQBoZfXklqtTleiDTsvHgMCJiEbKjN +S7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzdC9XZzPnqJworc5HGnRusyMvo4KD0L5CL +TfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pazq+r1feqCapgvdzZX99yqWATXgAByUr6P6TqBwMhAo6C +ygPCm48CAwEAAaOBnDCBmTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4E +FgQUm+IHV2ccHsBqBt5ZtJot39wZhi4wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2NybC5nbG9i +YWxzaWduLm5ldC9yb290LXIyLmNybDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG3lm0mi3f3BmGLjAN +BgkqhkiG9w0BAQUFAAOCAQEAmYFThxxol4aR7OBKuEQLq4GsJ0/WwbgcQ3izDJr86iw8bmEbTUsp +9Z8FHSbBuOmDAGJFtqkIk7mpM0sYmsL4h4hO291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu +01yiPqFbQfXf5WRDLenVOavSot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG7 +9G+dwfCMNYxdAfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7 +TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg== +-----END CERTIFICATE----- + +ValiCert Class 1 VA +=================== +-----BEGIN CERTIFICATE----- +MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRp +b24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs +YXNzIDEgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZh +bGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNTIy +MjM0OFoXDTE5MDYyNTIyMjM0OFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0 +d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDEg +UG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0 +LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMIGfMA0GCSqGSIb3DQEBAQUA +A4GNADCBiQKBgQDYWYJ6ibiWuqYvaG9YLqdUHAZu9OqNSLwxlBfw8068srg1knaw0KWlAdcAAxIi +GQj4/xEjm84H9b9pGib+TunRf50sQB1ZaG6m+FiwnRqP0z/x3BkGgagO4DrdyFNFCQbmD3DD+kCm +DuJWBQ8YTfwggtFzVXSNdnKgHZ0dwN0/cQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFBoPUn0LBwG +lN+VYH+Wexf+T3GtZMjdd9LvWVXoP+iOBSoh8gfStadS/pyxtuJbdxdA6nLWI8sogTLDAHkY7FkX +icnGah5xyf23dKUlRWnFSKsZ4UWKJWsZ7uW7EvV/96aNUcPwnXS3qT6gpf+2SQMT2iLM7XGCK5nP +Orf1LXLI +-----END CERTIFICATE----- + +ValiCert Class 2 VA +=================== +-----BEGIN CERTIFICATE----- +MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRp +b24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs +YXNzIDIgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZh +bGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAw +MTk1NFoXDTE5MDYyNjAwMTk1NFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0 +d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDIg +UG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0 +LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMIGfMA0GCSqGSIb3DQEBAQUA +A4GNADCBiQKBgQDOOnHK5avIWZJV16vYdA757tn2VUdZZUcOBVXc65g2PFxTXdMwzzjsvUGJ7SVC +CSRrCl6zfN1SLUzm1NZ9WlmpZdRJEy0kTRxQb7XBhVQ7/nHk01xC+YDgkRoKWzk2Z/M/VXwbP7Rf +ZHM047QSv4dk+NoS/zcnwbNDu+97bi5p9wIDAQABMA0GCSqGSIb3DQEBBQUAA4GBADt/UG9vUJSZ +SWI4OB9L+KXIPqeCgfYrx+jFzug6EILLGACOTb2oWH+heQC1u+mNr0HZDzTuIYEZoDJJKPTEjlbV +UjP9UNV+mWwD5MlM/Mtsq2azSiGM5bUMMj4QssxsodyamEwCW/POuZ6lcg5Ktz885hZo+L7tdEy8 +W9ViH0Pd +-----END CERTIFICATE----- + +RSA Root Certificate 1 +====================== +-----BEGIN CERTIFICATE----- +MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRp +b24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs +YXNzIDMgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZh +bGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAw +MjIzM1oXDTE5MDYyNjAwMjIzM1owgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0 +d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENsYXNzIDMg +UG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0 +LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMIGfMA0GCSqGSIb3DQEBAQUA +A4GNADCBiQKBgQDjmFGWHOjVsQaBalfDcnWTq8+epvzzFlLWLU2fNUSoLgRNB0mKOCn1dzfnt6td +3zZxFJmP3MKS8edgkpfs2Ejcv8ECIMYkpChMMFp2bbFc893enhBxoYjHW5tBbcqwuI4V7q0zK89H +BFx1cQqYJJgpp0lZpd34t0NiYfPT4tBVPwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFa7AliEZwgs +3x/be0kz9dNnnfS0ChCzycUs4pJqcXgn8nCDQtM+z6lU9PHYkhaM0QTLS6vJn0WuPIqpsHEzXcjF +V9+vqDWzf4mH6eglkrh/hXqu1rweN1gqZ8mRzyqBPu3GOd/APhmcGcwTTYJBtYze4D1gCCAPRX5r +on+jjBXu +-----END CERTIFICATE----- + +Verisign Class 1 Public Primary Certification Authority - G3 +============================================================ +-----BEGIN CERTIFICATE----- +MIIEGjCCAwICEQCLW3VWhFSFCwDPrzhIzrGkMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV +UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv +cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl +IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDEgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw +CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy +dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv +cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDEgUHVibGljIFByaW1hcnkg +Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBAN2E1Lm0+afY8wR4nN493GwTFtl63SRRZsDHJlkNrAYIwpTRMx/wgzUfbhvI3qpuFU5UJ+/E +bRrsC+MO8ESlV8dAWB6jRx9x7GD2bZTIGDnt/kIYVt/kTEkQeE4BdjVjEjbdZrwBBDajVWjVojYJ +rKshJlQGrT/KFOCsyq0GHZXi+J3x4GD/wn91K0zM2v6HmSHquv4+VNfSWXjbPG7PoBMAGrgnoeS+ +Z5bKoMWznN3JdZ7rMJpfo83ZrngZPyPpXNspva1VyBtUjGP26KbqxzcSXKMpHgLZ2x87tNcPVkeB +FQRKr4Mn0cVYiMHd9qqnoxjaaKptEVHhv2Vrn5Z20T0CAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA +q2aN17O6x5q25lXQBfGfMY1aqtmqRiYPce2lrVNWYgFHKkTp/j90CxObufRNG7LRX7K20ohcs5/N +y9Sn2WCVhDr4wTcdYcrnsMXlkdpUpqwxga6X3s0IrLjAl4B/bnKk52kTlWUfxJM8/XmPBNQ+T+r3 +ns7NZ3xPZQL/kYVUc8f/NveGLezQXk//EZ9yBta4GvFMDSZl4kSAHsef493oCtrspSCAaWihT37h +a88HQfqDjrw43bAuEbFrskLMmrz5SCJ5ShkPshw+IHTZasO+8ih4E1Z5T21Q6huwtVexN2ZYI/Pc +D98Kh8TvhgXVOBRgmaNL3gaWcSzy27YfpO8/7g== +-----END CERTIFICATE----- + +Verisign Class 2 Public Primary Certification Authority - G3 +============================================================ +-----BEGIN CERTIFICATE----- +MIIEGTCCAwECEGFwy0mMX5hFKeewptlQW3owDQYJKoZIhvcNAQEFBQAwgcoxCzAJBgNVBAYTAlVT +MRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1c3QgTmV0d29y +azE6MDgGA1UECxMxKGMpIDE5OTkgVmVyaVNpZ24sIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ug +b25seTFFMEMGA1UEAxM8VmVyaVNpZ24gQ2xhc3MgMiBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0 +aW9uIEF1dGhvcml0eSAtIEczMB4XDTk5MTAwMTAwMDAwMFoXDTM2MDcxNjIzNTk1OVowgcoxCzAJ +BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjEfMB0GA1UECxMWVmVyaVNpZ24gVHJ1 +c3QgTmV0d29yazE6MDgGA1UECxMxKGMpIDE5OTkgVmVyaVNpZ24sIEluYy4gLSBGb3IgYXV0aG9y +aXplZCB1c2Ugb25seTFFMEMGA1UEAxM8VmVyaVNpZ24gQ2xhc3MgMiBQdWJsaWMgUHJpbWFyeSBD +ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEczMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC +AQEArwoNwtUs22e5LeWUJ92lvuCwTY+zYVY81nzD9M0+hsuiiOLh2KRpxbXiv8GmR1BeRjmL1Za6 +tW8UvxDOJxOeBUebMXoT2B/Z0wI3i60sR/COgQanDTAM6/c8DyAd3HJG7qUCyFvDyVZpTMUYwZF7 +C9UTAJu878NIPkZgIIUq1ZC2zYugzDLdt/1AVbJQHFauzI13TccgTacxdu9okoqQHgiBVrKtaaNS +0MscxCM9H5n+TOgWY47GCI72MfbS+uV23bUckqNJzc0BzWjNqWm6o+sdDZykIKbBoMXRRkwXbdKs +Zj+WjOCE1Db/IlnF+RFgqF8EffIa9iVCYQ/ESrg+iQIDAQABMA0GCSqGSIb3DQEBBQUAA4IBAQA0 +JhU8wI1NQ0kdvekhktdmnLfexbjQ5F1fdiLAJvmEOjr5jLX77GDx6M4EsMjdpwOPMPOY36TmpDHf +0xwLRtxyID+u7gU8pDM/CzmscHhzS5kr3zDCVLCoO1Wh/hYozUK9dG6A2ydEp85EXdQbkJgNHkKU +sQAsBNB0owIFImNjzYO1+8FtYmtpdf1dcEG59b98377BMnMiIYtYgXsVkXq642RIsH/7NiXaldDx +JBQX3RiAa0YjOVT1jmIJBB2UkKab5iXiQkWquJCtvgiPqQtCGJTPcjnhsUPgKM+351psE2tJs//j +GHyJizNdrDPXp/naOlXJWBD5qu9ats9LS98q +-----END CERTIFICATE----- + +Verisign Class 3 Public Primary Certification Authority - G3 +============================================================ +-----BEGIN CERTIFICATE----- +MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV +UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv +cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl +IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw +CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy +dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv +cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkg +Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBAMu6nFL8eB8aHm8bN3O9+MlrlBIwT/A2R/XQkQr1F8ilYcEWQE37imGQ5XYgwREGfassbqb1 +EUGO+i2tKmFZpGcmTNDovFJbcCAEWNF6yaRpvIMXZK0Fi7zQWM6NjPXr8EJJC52XJ2cybuGukxUc +cLwgTS8Y3pKI6GyFVxEa6X7jJhFUokWWVYPKMIno3Nij7SqAP395ZVc+FSBmCC+Vk7+qRy+oRpfw +EuL+wgorUeZ25rdGt+INpsyow0xZVYnm6FNcHOqd8GIWC6fJXwzw3sJ2zq/3avL6QaaiMxTJ5Xpj +055iN9WFZZ4O5lMkdBteHRJTW8cs54NJOxWuimi5V5cCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA +ERSWwauSCPc/L8my/uRan2Te2yFPhpk0djZX3dAVL8WtfxUfN2JzPtTnX84XA9s1+ivbrmAJXx5f +j267Cz3qWhMeDGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC +/Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565pF4ErWjfJXir0 +xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGtTxzhT5yvDwyd93gN2PQ1VoDa +t20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ== +-----END CERTIFICATE----- + +Verisign Class 4 Public Primary Certification Authority - G3 +============================================================ +-----BEGIN CERTIFICATE----- +MIIEGjCCAwICEQDsoKeLbnVqAc/EfMwvlF7XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV +UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv +cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl +IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDQgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw +CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy +dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv +cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDQgUHVibGljIFByaW1hcnkg +Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBAK3LpRFpxlmr8Y+1GQ9Wzsy1HyDkniYlS+BzZYlZ3tCD5PUPtbut8XzoIfzk6AzufEUiGXaS +tBO3IFsJ+mGuqPKljYXCKtbeZjbSmwL0qJJgfJxptI8kHtCGUvYynEFYHiK9zUVilQhu0GbdU6LM +8BDcVHOLBKFGMzNcF0C5nk3T875Vg+ixiY5afJqWIpA7iCXy0lOIAgwLePLmNxdLMEYH5IBtptiW +Lugs+BGzOA1mppvqySNb247i8xOOGlktqgLw7KSHZtzBP/XYufTsgsbSPZUd5cBPhMnZo0QoBmrX +Razwa2rvTl/4EYIeOGM0ZlDUPpNz+jDDZq3/ky2X7wMCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA +j/ola09b5KROJ1WrIhVZPMq1CtRK26vdoV9TxaBXOcLORyu+OshWv8LZJxA6sQU8wHcxuzrTBXtt +mhwwjIDLk5Mqg6sFUYICABFna/OIYUdfA5PVWw3g8dShMjWFsjrbsIKr0csKvE+MW8VLADsfKoKm +fjaF3H48ZwC15DtS4KjrXRX5xm3wrR0OhbepmnMUWluPQSjA1egtTaRezarZ7c7c2NU8Qh0XwRJd +RTjDOPP8hS6DRkiy1yBfkjaP53kPmF6Z6PDQpLv1U70qzlmwr25/bLvSHgCwIe34QWKCudiyxLtG +UPMxxY8BqHTr9Xgn2uf3ZkPznoM+IKrDNWCRzg== +-----END CERTIFICATE----- + +Entrust.net Secure Server CA +============================ +-----BEGIN CERTIFICATE----- +MIIE2DCCBEGgAwIBAgIEN0rSQzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMCVVMxFDASBgNV +BAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5uZXQvQ1BTIGluY29ycC4gYnkg +cmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRl +ZDE6MDgGA1UEAxMxRW50cnVzdC5uZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhv +cml0eTAeFw05OTA1MjUxNjA5NDBaFw0xOTA1MjUxNjM5NDBaMIHDMQswCQYDVQQGEwJVUzEUMBIG +A1UEChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5jb3JwLiBi +eSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBFbnRydXN0Lm5ldCBMaW1p +dGVkMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5MIGdMA0GCSqGSIb3DQEBAQUAA4GLADCBhwKBgQDNKIM0VBuJ8w+vN5Ex/68xYMmo6LIQ +aO2f55M28Qpku0f1BBc/I0dNxScZgSYMVHINiC3ZH5oSn7yzcdOAGT9HZnuMNSjSuQrfJNqc1lB5 +gXpa0zf3wkrYKZImZNHkmGw6AIr1NJtl+O3jEP/9uElY3KDegjlrgbEWGWG5VLbmQwIBA6OCAdcw +ggHTMBEGCWCGSAGG+EIBAQQEAwIABzCCARkGA1UdHwSCARAwggEMMIHeoIHboIHYpIHVMIHSMQsw +CQYDVQQGEwJVUzEUMBIGA1UEChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5l +dC9DUFMgaW5jb3JwLiBieSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBF +bnRydXN0Lm5ldCBMaW1pdGVkMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENl +cnRpZmljYXRpb24gQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMCmgJ6AlhiNodHRwOi8vd3d3LmVu +dHJ1c3QubmV0L0NSTC9uZXQxLmNybDArBgNVHRAEJDAigA8xOTk5MDUyNTE2MDk0MFqBDzIwMTkw +NTI1MTYwOTQwWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAU8BdiE1U9s/8KAGv7UISX8+1i0Bow +HQYDVR0OBBYEFPAXYhNVPbP/CgBr+1CEl/PtYtAaMAwGA1UdEwQFMAMBAf8wGQYJKoZIhvZ9B0EA +BAwwChsEVjQuMAMCBJAwDQYJKoZIhvcNAQEFBQADgYEAkNwwAvpkdMKnCqV8IY00F6j7Rw7/JXyN +Ewr75Ji174z4xRAN95K+8cPV1ZVqBLssziY2ZcgxxufuP+NXdYR6Ee9GTxj005i7qIcyunL2POI9 +n9cd2cNgQ4xYDiKWL2KjLB+6rQXvqzJ4h6BUcxm1XAX5Uj5tLUUL9wqT6u0G+bI= +-----END CERTIFICATE----- + +Entrust.net Premium 2048 Secure Server CA +========================================= +-----BEGIN CERTIFICATE----- +MIIEXDCCA0SgAwIBAgIEOGO5ZjANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChMLRW50cnVzdC5u +ZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBpbmNvcnAuIGJ5IHJlZi4gKGxp +bWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNV +BAMTKkVudHJ1c3QubmV0IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQx +NzUwNTFaFw0xOTEyMjQxODIwNTFaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3 +d3d3LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTEl +MCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEGA1UEAxMqRW50cnVzdC5u +ZXQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgKDIwNDgpMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEArU1LqRKGsuqjIAcVFmQqK0vRvwtKTY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOL +Gp18EzoOH1u3Hs/lJBQesYGpjX24zGtLA/ECDNyrpUAkAH90lKGdCCmziAv1h3edVc3kw37XamSr +hRSGlVuXMlBvPci6Zgzj/L24ScF2iUkZ/cCovYmjZy/Gn7xxGWC4LeksyZB2ZnuU4q941mVTXTzW +nLLPKQP5L6RQstRIzgUyVYr9smRMDuSYB3Xbf9+5CFVghTAp+XtIpGmG4zU/HoZdenoVve8AjhUi +VBcAkCaTvA5JaJG/+EfTnZVCwQ5N328mz8MYIWJmQ3DW1cAH4QIDAQABo3QwcjARBglghkgBhvhC +AQEEBAMCAAcwHwYDVR0jBBgwFoAUVeSB0RGAvtiJuQijMfmhJAkWuXAwHQYDVR0OBBYEFFXkgdER +gL7YibkIozH5oSQJFrlwMB0GCSqGSIb2fQdBAAQQMA4bCFY1LjA6NC4wAwIEkDANBgkqhkiG9w0B +AQUFAAOCAQEAWUesIYSKF8mciVMeuoCFGsY8Tj6xnLZ8xpJdGGQC49MGCBFhfGPjK50xA3B20qMo +oPS7mmNz7W3lKtvtFKkrxjYR0CvrB4ul2p5cGZ1WEvVUKcgF7bISKo30Axv/55IQh7A6tcOdBTcS +o8f0FbnVpDkWm1M6I5HxqIKiaohowXkCIryqptau37AUX7iH0N18f3v/rxzP5tsHrV7bhZ3QKw0z +2wTR5klAEyt2+z7pnIkPFc4YsIV4IU9rTw76NmfNB/L/CNDi3tm/Kq+4h4YhPATKt5Rof8886ZjX +OP/swNlQ8C5LWK5Gb9Auw2DaclVyvUxFnmG6v4SBkgPR0ml8xQ== +-----END CERTIFICATE----- + +Baltimore CyberTrust Root +========================= +-----BEGIN CERTIFICATE----- +MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJRTESMBAGA1UE +ChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYDVQQDExlCYWx0aW1vcmUgQ3li +ZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoXDTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMC +SUUxEjAQBgNVBAoTCUJhbHRpbW9yZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFs +dGltb3JlIEN5YmVyVHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKME +uyKrmD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjrIZ3AQSsB +UnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeKmpYcqWe4PwzV9/lSEy/C +G9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSuXmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9 +XbIGevOF6uvUA65ehD5f/xXtabz5OTZydc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjpr +l3RjM71oGDHweI12v/yejl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoI +VDaGezq1BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEB +BQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT929hkTI7gQCvlYpNRh +cL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3WgxjkzSswF07r51XgdIGn9w/xZchMB5 +hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsa +Y71k5h+3zvDyny67G7fyUIhzksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9H +RCwBXbsdtTLSR9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp +-----END CERTIFICATE----- + +Equifax Secure Global eBusiness CA +================================== +-----BEGIN CERTIFICATE----- +MIICkDCCAfmgAwIBAgIBATANBgkqhkiG9w0BAQQFADBaMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT +RXF1aWZheCBTZWN1cmUgSW5jLjEtMCsGA1UEAxMkRXF1aWZheCBTZWN1cmUgR2xvYmFsIGVCdXNp +bmVzcyBDQS0xMB4XDTk5MDYyMTA0MDAwMFoXDTIwMDYyMTA0MDAwMFowWjELMAkGA1UEBhMCVVMx +HDAaBgNVBAoTE0VxdWlmYXggU2VjdXJlIEluYy4xLTArBgNVBAMTJEVxdWlmYXggU2VjdXJlIEds +b2JhbCBlQnVzaW5lc3MgQ0EtMTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAuucXkAJlsTRV +PEnCUdXfp9E3j9HngXNBUmCbnaEXJnitx7HoJpQytd4zjTov2/KaelpzmKNc6fuKcxtc58O/gGzN +qfTWK8D3+ZmqY6KxRwIP1ORROhI8bIpaVIRw28HFkM9yRcuoWcDNM50/o5brhTMhHD4ePmBudpxn +hcXIw2ECAwEAAaNmMGQwEQYJYIZIAYb4QgEBBAQDAgAHMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0j +BBgwFoAUvqigdHJQa0S3ySPY+6j/s1draGwwHQYDVR0OBBYEFL6ooHRyUGtEt8kj2Puo/7NXa2hs +MA0GCSqGSIb3DQEBBAUAA4GBADDiAVGqx+pf2rnQZQ8w1j7aDRRJbpGTJxQx78T3LUX47Me/okEN +I7SS+RkAZ70Br83gcfxaz2TE4JaY0KNA4gGK7ycH8WUBikQtBmV1UsCGECAhX2xrD2yuCRyv8qIY +NMR1pHMc8Y3c7635s3a0kr/clRAevsvIO1qEYBlWlKlV +-----END CERTIFICATE----- + +Equifax Secure eBusiness CA 1 +============================= +-----BEGIN CERTIFICATE----- +MIICgjCCAeugAwIBAgIBBDANBgkqhkiG9w0BAQQFADBTMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT +RXF1aWZheCBTZWN1cmUgSW5jLjEmMCQGA1UEAxMdRXF1aWZheCBTZWN1cmUgZUJ1c2luZXNzIENB +LTEwHhcNOTkwNjIxMDQwMDAwWhcNMjAwNjIxMDQwMDAwWjBTMQswCQYDVQQGEwJVUzEcMBoGA1UE +ChMTRXF1aWZheCBTZWN1cmUgSW5jLjEmMCQGA1UEAxMdRXF1aWZheCBTZWN1cmUgZUJ1c2luZXNz +IENBLTEwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAM4vGbwXt3fek6lfWg0XTzQaDJj0ItlZ +1MRoRvC0NcWFAyDGr0WlIVFFQesWWDYyb+JQYmT5/VGcqiTZ9J2DKocKIdMSODRsjQBuWqDZQu4a +IZX5UkxVWsUPOE9G+m34LjXWHXzr4vCwdYDIqROsvojvOm6rXyo4YgKwEnv+j6YDAgMBAAGjZjBk +MBEGCWCGSAGG+EIBAQQEAwIABzAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFEp4MlIR21kW +Nl7fwRQ2QGpHfEyhMB0GA1UdDgQWBBRKeDJSEdtZFjZe38EUNkBqR3xMoTANBgkqhkiG9w0BAQQF +AAOBgQB1W6ibAxHm6VZMzfmpTMANmvPMZWnmJXbMWbfWVMMdzZmsGd20hdXgPfxiIKeES1hl8eL5 +lSE/9dR+WB5Hh1Q+WKG1tfgq73HnvMP2sUlG4tega+VWeponmHxGYhTnyfxuAxJ5gDgdSIKN/Bf+ +KpYrtWKmpj29f5JZzVoqgrI3eQ== +-----END CERTIFICATE----- + +Equifax Secure eBusiness CA 2 +============================= +-----BEGIN CERTIFICATE----- +MIIDIDCCAomgAwIBAgIEN3DPtTANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJVUzEXMBUGA1UE +ChMORXF1aWZheCBTZWN1cmUxJjAkBgNVBAsTHUVxdWlmYXggU2VjdXJlIGVCdXNpbmVzcyBDQS0y +MB4XDTk5MDYyMzEyMTQ0NVoXDTE5MDYyMzEyMTQ0NVowTjELMAkGA1UEBhMCVVMxFzAVBgNVBAoT +DkVxdWlmYXggU2VjdXJlMSYwJAYDVQQLEx1FcXVpZmF4IFNlY3VyZSBlQnVzaW5lc3MgQ0EtMjCB +nzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA5Dk5kx5SBhsoNviyoynF7Y6yEb3+6+e0dMKP/wXn +2Z0GvxLIPw7y1tEkshHe0XMJitSxLJgJDR5QRrKDpkWNYmi7hRsgcDKqQM2mll/EcTc/BPO3QSQ5 +BxoeLmFYoBIL5aXfxavqN3HMHMg3OrmXUqesxWoklE6ce8/AatbfIb0CAwEAAaOCAQkwggEFMHAG +A1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEXMBUGA1UEChMORXF1aWZheCBTZWN1cmUx +JjAkBgNVBAsTHUVxdWlmYXggU2VjdXJlIGVCdXNpbmVzcyBDQS0yMQ0wCwYDVQQDEwRDUkwxMBoG +A1UdEAQTMBGBDzIwMTkwNjIzMTIxNDQ1WjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUUJ4L6q9e +uSBIplBqy/3YIHqngnYwHQYDVR0OBBYEFFCeC+qvXrkgSKZQasv92CB6p4J2MAwGA1UdEwQFMAMB +Af8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUAA4GBAAyGgq3oThr1 +jokn4jVYPSm0B482UJW/bsGe68SQsoWou7dC4A8HOd/7npCy0cE+U58DRLB+S/Rv5Hwf5+Kx5Lia +78O9zt4LMjTZ3ijtM2vE1Nc9ElirfQkty3D1E4qUoSek1nDFbZS1yX2doNLGCEnZZpum0/QL3MUm +V+GRMOrN +-----END CERTIFICATE----- + +AddTrust Low-Value Services Root +================================ +-----BEGIN CERTIFICATE----- +MIIEGDCCAwCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQGEwJTRTEUMBIGA1UEChML +QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEwHwYDVQQDExhBZGRU +cnVzdCBDbGFzcyAxIENBIFJvb3QwHhcNMDAwNTMwMTAzODMxWhcNMjAwNTMwMTAzODMxWjBlMQsw +CQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBO +ZXR3b3JrMSEwHwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3QwggEiMA0GCSqGSIb3DQEB +AQUAA4IBDwAwggEKAoIBAQCWltQhSWDia+hBBwzexODcEyPNwTXH+9ZOEQpnXvUGW2ulCDtbKRY6 +54eyNAbFvAWlA3yCyykQruGIgb3WntP+LVbBFc7jJp0VLhD7Bo8wBN6ntGO0/7Gcrjyvd7ZWxbWr +oulpOj0OM3kyP3CCkplhbY0wCI9xP6ZIVxn4JdxLZlyldI+Yrsj5wAYi56xz36Uu+1LcsRVlIPo1 +Zmne3yzxbrww2ywkEtvrNTVokMsAsJchPXQhI2U0K7t4WaPW4XY5mqRJjox0r26kmqPZm9I4XJui +GMx1I4S+6+JNM3GOGvDC+Mcdoq0Dlyz4zyXG9rgkMbFjXZJ/Y/AlyVMuH79NAgMBAAGjgdIwgc8w +HQYDVR0OBBYEFJWxtPCUtr3H2tERCSG+wa9J/RB7MAsGA1UdDwQEAwIBBjAPBgNVHRMBAf8EBTAD +AQH/MIGPBgNVHSMEgYcwgYSAFJWxtPCUtr3H2tERCSG+wa9J/RB7oWmkZzBlMQswCQYDVQQGEwJT +RTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEw +HwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBACxt +ZBsfzQ3duQH6lmM0MkhHma6X7f1yFqZzR1r0693p9db7RcwpiURdv0Y5PejuvE1Uhh4dbOMXJ0Ph +iVYrqW9yTkkz43J8KiOavD7/KCrto/8cI7pDVwlnTUtiBi34/2ydYB7YHEt9tTEv2dB8Xfjea4MY +eDdXL+gzB2ffHsdrKpV2ro9Xo/D0UrSpUwjP4E/TelOL/bscVjby/rK25Xa71SJlpz/+0WatC7xr +mYbvP33zGDLKe8bjq2RGlfgmadlVg3sslgf/WSxEo8bl6ancoWOAWiFeIc9TVPC6b4nbqKqVz4vj +ccweGyBECMB6tkD9xOQ14R0WHNC8K47Wcdk= +-----END CERTIFICATE----- + +AddTrust External Root +====================== +-----BEGIN CERTIFICATE----- +MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEUMBIGA1UEChML +QWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYD +VQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEw +NDgzOFowbzELMAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRU +cnVzdCBFeHRlcm5hbCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0Eg +Um9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvtH7xsD821 ++iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9uMq/NzgtHj6RQa1wVsfw +Tz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzXmk6vBbOmcZSccbNQYArHE504B4YCqOmo +aSYYkKtMsE8jqzpPhNjfzp/haW+710LXa0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy +2xSoRcRdKn23tNbE7qzNE0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv7 +7+ldU9U0WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYDVR0P +BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0Jvf6xCZU7wO94CTL +VBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEmMCQGA1UECxMdQWRk +VHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsxIjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENB +IFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZl +j7DYd7usQWxHYINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5 +6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvCNr4TDea9Y355 +e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEXc4g/VhsxOBi0cQ+azcgOno4u +G+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5amnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ= +-----END CERTIFICATE----- + +AddTrust Public Services Root +============================= +-----BEGIN CERTIFICATE----- +MIIEFTCCAv2gAwIBAgIBATANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQGEwJTRTEUMBIGA1UEChML +QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSAwHgYDVQQDExdBZGRU +cnVzdCBQdWJsaWMgQ0EgUm9vdDAeFw0wMDA1MzAxMDQxNTBaFw0yMDA1MzAxMDQxNTBaMGQxCzAJ +BgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQIE5l +dHdvcmsxIDAeBgNVBAMTF0FkZFRydXN0IFB1YmxpYyBDQSBSb290MIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEA6Rowj4OIFMEg2Dybjxt+A3S72mnTRqX4jsIMEZBRpS9mVEBV6tsfSlbu +nyNu9DnLoblv8n75XYcmYZ4c+OLspoH4IcUkzBEMP9smcnrHAZcHF/nXGCwwfQ56HmIexkvA/X1i +d9NEHif2P0tEs7c42TkfYNVRknMDtABp4/MUTu7R3AnPdzRGULD4EfL+OHn3Bzn+UZKXC1sIXzSG +Aa2Il+tmzV7R/9x98oTaunet3IAIx6eH1lWfl2royBFkuucZKT8Rs3iQhCBSWxHveNCD9tVIkNAw +HM+A+WD+eeSI8t0A65RF62WUaUC6wNW0uLp9BBGo6zEFlpROWCGOn9Bg/QIDAQABo4HRMIHOMB0G +A1UdDgQWBBSBPjfYkrAfd59ctKtzquf2NGAv+jALBgNVHQ8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB +/zCBjgYDVR0jBIGGMIGDgBSBPjfYkrAfd59ctKtzquf2NGAv+qFopGYwZDELMAkGA1UEBhMCU0Ux +FDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQLExRBZGRUcnVzdCBUVFAgTmV0d29yazEgMB4G +A1UEAxMXQWRkVHJ1c3QgUHVibGljIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBAAP3FUr4 +JNojVhaTdt02KLmuG7jD8WS6IBh4lSknVwW8fCr0uVFV2ocC3g8WFzH4qnkuCRO7r7IgGRLlk/lL ++YPoRNWyQSW/iHVv/xD8SlTQX/D67zZzfRs2RcYhbbQVuE7PnFylPVoAjgbjPGsye/Kf8Lb93/Ao +GEjwxrzQvzSAlsJKsW2Ox5BF3i9nrEUEo3rcVZLJR2bYGozH7ZxOmuASu7VqTITh4SINhwBk/ox9 +Yjllpu9CtoAlEmEBqCQTcAARJl/6NVDFSMwGR+gn2HCNX2TmoUQmXiLsks3/QppEIW1cxeMiHV9H +EufOX1362KqxMy3ZdvJOOjMMK7MtkAY= +-----END CERTIFICATE----- + +AddTrust Qualified Certificates Root +==================================== +-----BEGIN CERTIFICATE----- +MIIEHjCCAwagAwIBAgIBATANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJTRTEUMBIGA1UEChML +QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSMwIQYDVQQDExpBZGRU +cnVzdCBRdWFsaWZpZWQgQ0EgUm9vdDAeFw0wMDA1MzAxMDQ0NTBaFw0yMDA1MzAxMDQ0NTBaMGcx +CzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQ +IE5ldHdvcmsxIzAhBgNVBAMTGkFkZFRydXN0IFF1YWxpZmllZCBDQSBSb290MIIBIjANBgkqhkiG +9w0BAQEFAAOCAQ8AMIIBCgKCAQEA5B6a/twJWoekn0e+EV+vhDTbYjx5eLfpMLXsDBwqxBb/4Oxx +64r1EW7tTw2R0hIYLUkVAcKkIhPHEWT/IhKauY5cLwjPcWqzZwFZ8V1G87B4pfYOQnrjfxvM0PC3 +KP0q6p6zsLkEqv32x7SxuCqg+1jxGaBvcCV+PmlKfw8i2O+tCBGaKZnhqkRFmhJePp1tUvznoD1o +L/BLcHwTOK28FSXx1s6rosAx1i+f4P8UWfyEk9mHfExUE+uf0S0R+Bg6Ot4l2ffTQO2kBhLEO+GR +wVY18BTcZTYJbqukB8c10cIDMzZbdSZtQvESa0NvS3GU+jQd7RNuyoB/mC9suWXY6QIDAQABo4HU +MIHRMB0GA1UdDgQWBBQ5lYtii1zJ1IC6WA+XPxUIQ8yYpzALBgNVHQ8EBAMCAQYwDwYDVR0TAQH/ +BAUwAwEB/zCBkQYDVR0jBIGJMIGGgBQ5lYtii1zJ1IC6WA+XPxUIQ8yYp6FrpGkwZzELMAkGA1UE +BhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQLExRBZGRUcnVzdCBUVFAgTmV0d29y +azEjMCEGA1UEAxMaQWRkVHJ1c3QgUXVhbGlmaWVkIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQAD +ggEBABmrder4i2VhlRO6aQTvhsoToMeqT2QbPxj2qC0sVY8FtzDqQmodwCVRLae/DLPt7wh/bDxG +GuoYQ992zPlmhpwsaPXpF/gxsxjE1kh9I0xowX67ARRvxdlu3rsEQmr49lx95dr6h+sNNVJn0J6X +dgWTP5XHAeZpVTh/EGGZyeNfpso+gmNIquIISD6q8rKFYqa0p9m9N5xotS1WfbC3P6CxB9bpT9ze +RXEwMn8bLgn5v1Kh7sKAPgZcLlVAwRv1cEWw3F369nJad9Jjzc9YiQBCYz95OdBEsIJuQRno3eDB +iFrRHnGTHyQwdOUeqN48Jzd/g66ed8/wMLH/S5noxqE= +-----END CERTIFICATE----- + +Entrust Root Certification Authority +==================================== +-----BEGIN CERTIFICATE----- +MIIEkTCCA3mgAwIBAgIERWtQVDANBgkqhkiG9w0BAQUFADCBsDELMAkGA1UEBhMCVVMxFjAUBgNV +BAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5lbnRydXN0Lm5ldC9DUFMgaXMgaW5jb3Jw +b3JhdGVkIGJ5IHJlZmVyZW5jZTEfMB0GA1UECxMWKGMpIDIwMDYgRW50cnVzdCwgSW5jLjEtMCsG +A1UEAxMkRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA2MTEyNzIwMjM0 +MloXDTI2MTEyNzIwNTM0MlowgbAxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMu +MTkwNwYDVQQLEzB3d3cuZW50cnVzdC5uZXQvQ1BTIGlzIGluY29ycG9yYXRlZCBieSByZWZlcmVu +Y2UxHzAdBgNVBAsTFihjKSAyMDA2IEVudHJ1c3QsIEluYy4xLTArBgNVBAMTJEVudHJ1c3QgUm9v +dCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +ALaVtkNC+sZtKm9I35RMOVcF7sN5EUFoNu3s/poBj6E4KPz3EEZmLk0eGrEaTsbRwJWIsMn/MYsz +A9u3g3s+IIRe7bJWKKf44LlAcTfFy0cOlypowCKVYhXbR9n10Cv/gkvJrT7eTNuQgFA/CYqEAOww +Cj0Yzfv9KlmaI5UXLEWeH25DeW0MXJj+SKfFI0dcXv1u5x609mhF0YaDW6KKjbHjKYD+JXGIrb68 +j6xSlkuqUY3kEzEZ6E5Nn9uss2rVvDlUccp6en+Q3X0dgNmBu1kmwhH+5pPi94DkZfs0Nw4pgHBN +rziGLp5/V6+eF67rHMsoIV+2HNjnogQi+dPa2MsCAwEAAaOBsDCBrTAOBgNVHQ8BAf8EBAMCAQYw +DwYDVR0TAQH/BAUwAwEB/zArBgNVHRAEJDAigA8yMDA2MTEyNzIwMjM0MlqBDzIwMjYxMTI3MjA1 +MzQyWjAfBgNVHSMEGDAWgBRokORnpKZTgMeGZqTx90tD+4S9bTAdBgNVHQ4EFgQUaJDkZ6SmU4DH +hmak8fdLQ/uEvW0wHQYJKoZIhvZ9B0EABBAwDhsIVjcuMTo0LjADAgSQMA0GCSqGSIb3DQEBBQUA +A4IBAQCT1DCw1wMgKtD5Y+iRDAUgqV8ZyntyTtSx29CW+1RaGSwMCPeyvIWonX9tO1KzKtvn1ISM +Y/YPyyYBkVBs9F8U4pN0wBOeMDpQ47RgxRzwIkSNcUesyBrJ6ZuaAGAT/3B+XxFNSRuzFVJ7yVTa +v52Vr2ua2J7p8eRDjeIRRDq/r72DQnNSi6q7pynP9WQcCk3RvKqsnyrQ/39/2n3qse0wJcGE2jTS +W3iDVuycNsMm4hH2Z0kdkquM++v/eu6FSqdQgPCnXEqULl8FmTxSQeDNtGPPAUO6nIPcj2A781q0 +tHuu2guQOHXvgR1m0vdXcDazv/wor3ElhVsT/h5/WrQ8 +-----END CERTIFICATE----- + +RSA Security 2048 v3 +==================== +-----BEGIN CERTIFICATE----- +MIIDYTCCAkmgAwIBAgIQCgEBAQAAAnwAAAAKAAAAAjANBgkqhkiG9w0BAQUFADA6MRkwFwYDVQQK +ExBSU0EgU2VjdXJpdHkgSW5jMR0wGwYDVQQLExRSU0EgU2VjdXJpdHkgMjA0OCBWMzAeFw0wMTAy +MjIyMDM5MjNaFw0yNjAyMjIyMDM5MjNaMDoxGTAXBgNVBAoTEFJTQSBTZWN1cml0eSBJbmMxHTAb +BgNVBAsTFFJTQSBTZWN1cml0eSAyMDQ4IFYzMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC +AQEAt49VcdKA3XtpeafwGFAyPGJn9gqVB93mG/Oe2dJBVGutn3y+Gc37RqtBaB4Y6lXIL5F4iSj7 +Jylg/9+PjDvJSZu1pJTOAeo+tWN7fyb9Gd3AIb2E0S1PRsNO3Ng3OTsor8udGuorryGlwSMiuLgb +WhOHV4PR8CDn6E8jQrAApX2J6elhc5SYcSa8LWrg903w8bYqODGBDSnhAMFRD0xS+ARaqn1y07iH +KrtjEAMqs6FPDVpeRrc9DvV07Jmf+T0kgYim3WBU6JU2PcYJk5qjEoAAVZkZR73QpXzDuvsf9/UP ++Ky5tfQ3mBMY3oVbtwyCO4dvlTlYMNpuAWgXIszACwIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/ +MA4GA1UdDwEB/wQEAwIBBjAfBgNVHSMEGDAWgBQHw1EwpKrpRa41JPr/JCwz0LGdjDAdBgNVHQ4E +FgQUB8NRMKSq6UWuNST6/yQsM9CxnYwwDQYJKoZIhvcNAQEFBQADggEBAF8+hnZuuDU8TjYcHnmY +v/3VEhF5Ug7uMYm83X/50cYVIeiKAVQNOvtUudZj1LGqlk2iQk3UUx+LEN5/Zb5gEydxiKRz44Rj +0aRV4VCT5hsOedBnvEbIvz8XDZXmxpBp3ue0L96VfdASPz0+f00/FGj1EVDVwfSQpQgdMWD/YIwj +VAqv/qFuxdF6Kmh4zx6CCiC0H63lhbJqaHVOrSU3lIW+vaHU6rcMSzyd6BIA8F+sDeGscGNz9395 +nzIlQnQFgCi/vcEkllgVsRch6YlL2weIZ/QVrXA+L02FO8K32/6YaCOJ4XQP3vTFhGMpG8zLB8kA +pKnXwiJPZ9d37CAFYd4= +-----END CERTIFICATE----- + +GeoTrust Global CA +================== +-----BEGIN CERTIFICATE----- +MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVTMRYwFAYDVQQK +Ew1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9iYWwgQ0EwHhcNMDIwNTIxMDQw +MDAwWhcNMjIwNTIxMDQwMDAwWjBCMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5j +LjEbMBkGA1UEAxMSR2VvVHJ1c3QgR2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB +CgKCAQEA2swYYzD99BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9mOSm9BXiLnTjo +BbdqfnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDviS2Aelet +8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU1XupGc1V3sjs0l44U+Vc +T4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+bw8HHa8sHo9gOeL6NlMTOdReJivbPagU +vTLrGAMoUgRx5aszPeE4uwc2hGKceeoWMPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTAD +AQH/MB0GA1UdDgQWBBTAephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVk +DBF9qn1luMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKInZ57Q +zxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfStQWVYrmm3ok9Nns4 +d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcFPseKUgzbFbS9bZvlxrFUaKnjaZC2 +mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Unhw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6p +XE0zX5IJL4hmXXeXxx12E6nV5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvm +Mw== +-----END CERTIFICATE----- + +GeoTrust Global CA 2 +==================== +-----BEGIN CERTIFICATE----- +MIIDZjCCAk6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBEMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN +R2VvVHJ1c3QgSW5jLjEdMBsGA1UEAxMUR2VvVHJ1c3QgR2xvYmFsIENBIDIwHhcNMDQwMzA0MDUw +MDAwWhcNMTkwMzA0MDUwMDAwWjBEMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5j +LjEdMBsGA1UEAxMUR2VvVHJ1c3QgR2xvYmFsIENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw +ggEKAoIBAQDvPE1APRDfO1MA4Wf+lGAVPoWI8YkNkMgoI5kF6CsgncbzYEbYwbLVjDHZ3CB5JIG/ +NTL8Y2nbsSpr7iFY8gjpeMtvy/wWUsiRxP89c96xPqfCfWbB9X5SJBri1WeR0IIQ13hLTytCOb1k +LUCgsBDTOEhGiKEMuzozKmKY+wCdE1l/bztyqu6mD4b5BWHqZ38MN5aL5mkWRxHCJ1kDs6ZgwiFA +Vvqgx306E+PsV8ez1q6diYD3Aecs9pYrEw15LNnA5IZ7S4wMcoKK+xfNAGw6EzywhIdLFnopsk/b +HdQL82Y3vdj2V7teJHq4PIu5+pIaGoSe2HSPqht/XvT+RSIhAgMBAAGjYzBhMA8GA1UdEwEB/wQF +MAMBAf8wHQYDVR0OBBYEFHE4NvICMVNHK266ZUapEBVYIAUJMB8GA1UdIwQYMBaAFHE4NvICMVNH +K266ZUapEBVYIAUJMA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQUFAAOCAQEAA/e1K6tdEPx7 +srJerJsOflN4WT5CBP51o62sgU7XAotexC3IUnbHLB/8gTKY0UvGkpMzNTEv/NgdRN3ggX+d6Yvh +ZJFiCzkIjKx0nVnZellSlxG5FntvRdOW2TF9AjYPnDtuzywNA0ZF66D0f0hExghAzN4bcLUprbqL +OzRldRtxIR0sFAqwlpW41uryZfspuk/qkZN0abby/+Ea0AzRdoXLiiW9l14sbxWZJue2Kf8i7MkC +x1YAzUm5s2x7UwQa4qjJqhIFI8LO57sEAszAR6LkxCkvW0VXiVHuPOtSCP8HNR6fNWpHSlaY0VqF +H4z1Ir+rzoPz4iIprn2DQKi6bA== +-----END CERTIFICATE----- + +GeoTrust Universal CA +===================== +-----BEGIN CERTIFICATE----- +MIIFaDCCA1CgAwIBAgIBATANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN +R2VvVHJ1c3QgSW5jLjEeMBwGA1UEAxMVR2VvVHJ1c3QgVW5pdmVyc2FsIENBMB4XDTA0MDMwNDA1 +MDAwMFoXDTI5MDMwNDA1MDAwMFowRTELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IElu +Yy4xHjAcBgNVBAMTFUdlb1RydXN0IFVuaXZlcnNhbCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIP +ADCCAgoCggIBAKYVVaCjxuAfjJ0hUNfBvitbtaSeodlyWL0AG0y/YckUHUWCq8YdgNY96xCcOq9t +JPi8cQGeBvV8Xx7BDlXKg5pZMK4ZyzBIle0iN430SppyZj6tlcDgFgDgEB8rMQ7XlFTTQjOgNB0e +RXbdT8oYN+yFFXoZCPzVx5zw8qkuEKmS5j1YPakWaDwvdSEYfyh3peFhF7em6fgemdtzbvQKoiFs +7tqqhZJmr/Z6a4LauiIINQ/PQvE1+mrufislzDoR5G2vc7J2Ha3QsnhnGqQ5HFELZ1aD/ThdDc7d +8Lsrlh/eezJS/R27tQahsiFepdaVaH/wmZ7cRQg+59IJDTWU3YBOU5fXtQlEIGQWFwMCTFMNaN7V +qnJNk22CDtucvc+081xdVHppCZbW2xHBjXWotM85yM48vCR85mLK4b19p71XZQvk/iXttmkQ3Cga +Rr0BHdCXteGYO8A3ZNY9lO4L4fUorgtWv3GLIylBjobFS1J72HGrH4oVpjuDWtdYAVHGTEHZf9hB +Z3KiKN9gg6meyHv8U3NyWfWTehd2Ds735VzZC1U0oqpbtWpU5xPKV+yXbfReBi9Fi1jUIxaS5BZu +KGNZMN9QAZxjiRqf2xeUgnA3wySemkfWWspOqGmJch+RbNt+nhutxx9z3SxPGWX9f5NAEC7S8O08 +ni4oPmkmM8V7AgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNq7LqqwDLiIJlF0 +XG0D08DYj3rWMB8GA1UdIwQYMBaAFNq7LqqwDLiIJlF0XG0D08DYj3rWMA4GA1UdDwEB/wQEAwIB +hjANBgkqhkiG9w0BAQUFAAOCAgEAMXjmx7XfuJRAyXHEqDXsRh3ChfMoWIawC/yOsjmPRFWrZIRc +aanQmjg8+uUfNeVE44B5lGiku8SfPeE0zTBGi1QrlaXv9z+ZhP015s8xxtxqv6fXIwjhmF7DWgh2 +qaavdy+3YL1ERmrvl/9zlcGO6JP7/TG37FcREUWbMPEaiDnBTzynANXH/KttgCJwpQzgXQQpAvvL +oJHRfNbDflDVnVi+QTjruXU8FdmbyUqDWcDaU/0zuzYYm4UPFd3uLax2k7nZAY1IEKj79TiG8dsK +xr2EoyNB3tZ3b4XUhRxQ4K5RirqNPnbiucon8l+f725ZDQbYKxek0nxru18UGkiPGkzns0ccjkxF +KyDuSN/n3QmOGKjaQI2SJhFTYXNd673nxE0pN2HrrDktZy4W1vUAg4WhzH92xH3kt0tm7wNFYGm2 +DFKWkoRepqO1pD4r2czYG0eq8kTaT/kD6PAUyz/zg97QwVTjt+gKN02LIFkDMBmhLMi9ER/frslK +xfMnZmaGrGiR/9nmUxwPi1xpZQomyB40w11Re9epnAahNt3ViZS82eQtDF4JbAiXfKM9fJP/P6EU +p8+1Xevb2xzEdt+Iub1FBZUbrvxGakyvSOPOrg/SfuvmbJxPgWp6ZKy7PtXny3YuxadIwVyQD8vI +P/rmMuGNG2+k5o7Y+SlIis5z/iw= +-----END CERTIFICATE----- + +GeoTrust Universal CA 2 +======================= +-----BEGIN CERTIFICATE----- +MIIFbDCCA1SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBHMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN +R2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVyc2FsIENBIDIwHhcNMDQwMzA0 +MDUwMDAwWhcNMjkwMzA0MDUwMDAwWjBHMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3Qg +SW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVyc2FsIENBIDIwggIiMA0GCSqGSIb3DQEBAQUA +A4ICDwAwggIKAoICAQCzVFLByT7y2dyxUxpZKeexw0Uo5dfR7cXFS6GqdHtXr0om/Nj1XqduGdt0 +DE81WzILAePb63p3NeqqWuDW6KFXlPCQo3RWlEQwAx5cTiuFJnSCegx2oG9NzkEtoBUGFF+3Qs17 +j1hhNNwqCPkuwwGmIkQcTAeC5lvO0Ep8BNMZcyfwqph/Lq9O64ceJHdqXbboW0W63MOhBW9Wjo8Q +JqVJwy7XQYci4E+GymC16qFjwAGXEHm9ADwSbSsVsaxLse4YuU6W3Nx2/zu+z18DwPw76L5GG//a +QMJS9/7jOvdqdzXQ2o3rXhhqMcceujwbKNZrVMaqW9eiLBsZzKIC9ptZvTdrhrVtgrrY6slWvKk2 +WP0+GfPtDCapkzj4T8FdIgbQl+rhrcZV4IErKIM6+vR7IVEAvlI4zs1meaj0gVbi0IMJR1FbUGrP +20gaXT73y/Zl92zxlfgCOzJWgjl6W70viRu/obTo/3+NjN8D8WBOWBFM66M/ECuDmgFz2ZRthAAn +ZqzwcEAJQpKtT5MNYQlRJNiS1QuUYbKHsu3/mjX/hVTK7URDrBs8FmtISgocQIgfksILAAX/8sgC +SqSqqcyZlpwvWOB94b67B9xfBHJcMTTD7F8t4D1kkCLm0ey4Lt1ZrtmhN79UNdxzMk+MBB4zsslG +8dhcyFVQyWi9qLo2CQIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBR281Xh+qQ2 ++/CfXGJx7Tz0RzgQKzAfBgNVHSMEGDAWgBR281Xh+qQ2+/CfXGJx7Tz0RzgQKzAOBgNVHQ8BAf8E +BAMCAYYwDQYJKoZIhvcNAQEFBQADggIBAGbBxiPz2eAubl/oz66wsCVNK/g7WJtAJDday6sWSf+z +dXkzoS9tcBc0kf5nfo/sm+VegqlVHy/c1FEHEv6sFj4sNcZj/NwQ6w2jqtB8zNHQL1EuxBRa3ugZ +4T7GzKQp5y6EqgYweHZUcyiYWTjgAA1i00J9IZ+uPTqM1fp3DRgrFg5fNuH8KrUwJM/gYwx7WBr+ +mbpCErGR9Hxo4sjoryzqyX6uuyo9DRXcNJW2GHSoag/HtPQTxORb7QrSpJdMKu0vbBKJPfEncKpq +A1Ihn0CoZ1Dy81of398j9tx4TuaYT1U6U+Pv8vSfx3zYWK8pIpe44L2RLrB27FcRz+8pRPPphXpg +Y+RdM4kX2TGq2tbzGDVyz4crL2MjhF2EjD9XoIj8mZEoJmmZ1I+XRL6O1UixpCgp8RW04eWe3fiP +pm8m1wk8OhwRDqZsN/etRIcsKMfYdIKz0G9KV7s1KSegi+ghp4dkNl3M2Basx7InQJJVOCiNUW7d +FGdTbHFcJoRNdVq2fmBWqU2t+5sel/MN2dKXVHfaPRK34B7vCAas+YWH6aLcr34YEoP9VhdBLtUp +gn2Z9DH2canPLAEnpQW5qrJITirvn5NSUZU8UnOOVkwXQMAJKOSLakhT2+zNVVXxxvjpoixMptEm +X36vWkzaH6byHCx+rgIW0lbQL1dTR+iS +-----END CERTIFICATE----- + +UTN-USER First-Network Applications +=================================== +-----BEGIN CERTIFICATE----- +MIIEZDCCA0ygAwIBAgIQRL4Mi1AAJLQR0zYwS8AzdzANBgkqhkiG9w0BAQUFADCBozELMAkGA1UE +BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl +IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xKzAp +BgNVBAMTIlVUTi1VU0VSRmlyc3QtTmV0d29yayBBcHBsaWNhdGlvbnMwHhcNOTkwNzA5MTg0ODM5 +WhcNMTkwNzA5MTg1NzQ5WjCBozELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5T +YWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho +dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xKzApBgNVBAMTIlVUTi1VU0VSRmlyc3QtTmV0d29yayBB +cHBsaWNhdGlvbnMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCz+5Gh5DZVhawGNFug +mliy+LUPBXeDrjKxdpJo7CNKyXY/45y2N3kDuatpjQclthln5LAbGHNhSuh+zdMvZOOmfAz6F4Cj +DUeJT1FxL+78P/m4FoCHiZMlIJpDgmkkdihZNaEdwH+DBmQWICzTSaSFtMBhf1EI+GgVkYDLpdXu +Ozr0hAReYFmnjDRy7rh4xdE7EkpvfmUnuaRVxblvQ6TFHSyZwFKkeEwVs0CYCGtDxgGwenv1axwi +P8vv/6jQOkt2FZ7S0cYu49tXGzKiuG/ohqY/cKvlcJKrRB5AUPuco2LkbG6gyN7igEL66S/ozjIE +j3yNtxyjNTwV3Z7DrpelAgMBAAGjgZEwgY4wCwYDVR0PBAQDAgHGMA8GA1UdEwEB/wQFMAMBAf8w +HQYDVR0OBBYEFPqGydvguul49Uuo1hXf8NPhahQ8ME8GA1UdHwRIMEYwRKBCoECGPmh0dHA6Ly9j +cmwudXNlcnRydXN0LmNvbS9VVE4tVVNFUkZpcnN0LU5ldHdvcmtBcHBsaWNhdGlvbnMuY3JsMA0G +CSqGSIb3DQEBBQUAA4IBAQCk8yXM0dSRgyLQzDKrm5ZONJFUICU0YV8qAhXhi6r/fWRRzwr/vH3Y +IWp4yy9Rb/hCHTO967V7lMPDqaAt39EpHx3+jz+7qEUqf9FuVSTiuwL7MT++6LzsQCv4AdRWOOTK +RIK1YSAhZ2X28AvnNPilwpyjXEAfhZOVBt5P1CeptqX8Fs1zMT+4ZSfP1FMa8Kxun08FDAOBp4Qp +xFq9ZFdyrTvPNximmMatBrTcCKME1SmklpoSZ0qMYEWd8SOasACcaLWYUNPvji6SZbFIPiG+FTAq +DbUMo2s/rn9X9R+WfN9v3YIwLGUbQErNaLly7HF27FSOH4UMAWr6pjisH8SE +-----END CERTIFICATE----- + +America Online Root Certification Authority 1 +============================================= +-----BEGIN CERTIFICATE----- +MIIDpDCCAoygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT +QW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBPbmxpbmUgUm9vdCBDZXJ0aWZp +Y2F0aW9uIEF1dGhvcml0eSAxMB4XDTAyMDUyODA2MDAwMFoXDTM3MTExOTIwNDMwMFowYzELMAkG +A1UEBhMCVVMxHDAaBgNVBAoTE0FtZXJpY2EgT25saW5lIEluYy4xNjA0BgNVBAMTLUFtZXJpY2Eg +T25saW5lIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMTCCASIwDQYJKoZIhvcNAQEBBQAD +ggEPADCCAQoCggEBAKgv6KRpBgNHw+kqmP8ZonCaxlCyfqXfaE0bfA+2l2h9LaaLl+lkhsmj76CG +v2BlnEtUiMJIxUo5vxTjWVXlGbR0yLQFOVwWpeKVBeASrlmLojNoWBym1BW32J/X3HGrfpq/m44z +DyL9Hy7nBzbvYjnF3cu6JRQj3gzGPTzOggjmZj7aUTsWOqMFf6Dch9Wc/HKpoH145LcxVR5lu9Rh +sCFg7RAycsWSJR74kEoYeEfffjA3PlAb2xzTa5qGUwew76wGePiEmf4hjUyAtgyC9mZweRrTT6PP +8c9GsEsPPt2IYriMqQkoO3rHl+Ee5fSfwMCuJKDIodkP1nsmgmkyPacCAwEAAaNjMGEwDwYDVR0T +AQH/BAUwAwEB/zAdBgNVHQ4EFgQUAK3Zo/Z59m50qX8zPYEX10zPM94wHwYDVR0jBBgwFoAUAK3Z +o/Z59m50qX8zPYEX10zPM94wDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEBBQUAA4IBAQB8itEf +GDeC4Liwo+1WlchiYZwFos3CYiZhzRAW18y0ZTTQEYqtqKkFZu90821fnZmv9ov761KyBZiibyrF +VL0lvV+uyIbqRizBs73B6UlwGBaXCBOMIOAbLjpHyx7kADCVW/RFo8AasAFOq73AI25jP4BKxQft +3OJvx8Fi8eNy1gTIdGcL+oiroQHIb/AUr9KZzVGTfu0uOMe9zkZQPXLjeSWdm4grECDdpbgyn43g +Kd8hdIaC2y+CMMbHNYaz+ZZfRtsMRf3zUMNvxsNIrUam4SdHCh0Om7bCd39j8uB9Gr784N/Xx6ds +sPmuujz9dLQR6FgNgLzTqIA6me11zEZ7 +-----END CERTIFICATE----- + +America Online Root Certification Authority 2 +============================================= +-----BEGIN CERTIFICATE----- +MIIFpDCCA4ygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEcMBoGA1UEChMT +QW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBPbmxpbmUgUm9vdCBDZXJ0aWZp +Y2F0aW9uIEF1dGhvcml0eSAyMB4XDTAyMDUyODA2MDAwMFoXDTM3MDkyOTE0MDgwMFowYzELMAkG +A1UEBhMCVVMxHDAaBgNVBAoTE0FtZXJpY2EgT25saW5lIEluYy4xNjA0BgNVBAMTLUFtZXJpY2Eg +T25saW5lIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMjCCAiIwDQYJKoZIhvcNAQEBBQAD +ggIPADCCAgoCggIBAMxBRR3pPU0Q9oyxQcngXssNt79Hc9PwVU3dxgz6sWYFas14tNwC206B89en +fHG8dWOgXeMHDEjsJcQDIPT/DjsS/5uN4cbVG7RtIuOx238hZK+GvFciKtZHgVdEglZTvYYUAQv8 +f3SkWq7xuhG1m1hagLQ3eAkzfDJHA1zEpYNI9FdWboE2JxhP7JsowtS013wMPgwr38oE18aO6lhO +qKSlGBxsRZijQdEt0sdtjRnxrXm3gT+9BoInLRBYBbV4Bbkv2wxrkJB+FFk4u5QkE+XRnRTf04JN +RvCAOVIyD+OEsnpD8l7eXz8d3eOyG6ChKiMDbi4BFYdcpnV1x5dhvt6G3NRI270qv0pV2uh9UPu0 +gBe4lL8BPeraunzgWGcXuVjgiIZGZ2ydEEdYMtA1fHkqkKJaEBEjNa0vzORKW6fIJ/KD3l67Xnfn +6KVuY8INXWHQjNJsWiEOyiijzirplcdIz5ZvHZIlyMbGwcEMBawmxNJ10uEqZ8A9W6Wa6897Gqid +FEXlD6CaZd4vKL3Ob5Rmg0gp2OpljK+T2WSfVVcmv2/LNzGZo2C7HK2JNDJiuEMhBnIMoVxtRsX6 +Kc8w3onccVvdtjc+31D1uAclJuW8tf48ArO3+L5DwYcRlJ4jbBeKuIonDFRH8KmzwICMoCfrHRnj +B453cMor9H124HhnAgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFE1FwWg4u3Op +aaEg5+31IqEjFNeeMB8GA1UdIwQYMBaAFE1FwWg4u3OpaaEg5+31IqEjFNeeMA4GA1UdDwEB/wQE +AwIBhjANBgkqhkiG9w0BAQUFAAOCAgEAZ2sGuV9FOypLM7PmG2tZTiLMubekJcmnxPBUlgtk87FY +T15R/LKXeydlwuXK5w0MJXti4/qftIe3RUavg6WXSIylvfEWK5t2LHo1YGwRgJfMqZJS5ivmae2p ++DYtLHe/YUjRYwu5W1LtGLBDQiKmsXeu3mnFzcccobGlHBD7GL4acN3Bkku+KVqdPzW+5X1R+FXg +JXUjhx5c3LqdsKyzadsXg8n33gy8CNyRnqjQ1xU3c6U1uPx+xURABsPr+CKAXEfOAuMRn0T//Zoy +zH1kUQ7rVyZ2OuMeIjzCpjbdGe+n/BLzJsBZMYVMnNjP36TMzCmT/5RtdlwTCJfy7aULTd3oyWgO +ZtMADjMSW7yV5TKQqLPGbIOtd+6Lfn6xqavT4fG2wLHqiMDn05DpKJKUe2h7lyoKZy2FAjgQ5ANh +1NolNscIWC2hp1GvMApJ9aZphwctREZ2jirlmjvXGKL8nDgQzMY70rUXOm/9riW99XJZZLF0Kjhf +GEzfz3EEWjbUvy+ZnOjZurGV5gJLIaFb1cFPj65pbVPbAZO1XB4Y3WRayhgoPmMEEf0cjQAPuDff +Z4qdZqkCapH/E8ovXYO8h5Ns3CRRFgQlZvqz2cK6Kb6aSDiCmfS/O0oxGfm/jiEzFMpPVF/7zvuP +cX/9XhmgD0uRuMRUvAawRY8mkaKO/qk= +-----END CERTIFICATE----- + +Visa eCommerce Root +=================== +-----BEGIN CERTIFICATE----- +MIIDojCCAoqgAwIBAgIQE4Y1TR0/BvLB+WUF1ZAcYjANBgkqhkiG9w0BAQUFADBrMQswCQYDVQQG +EwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMmVmlzYSBJbnRlcm5hdGlvbmFsIFNlcnZpY2Ug +QXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNvbW1lcmNlIFJvb3QwHhcNMDIwNjI2MDIxODM2 +WhcNMjIwNjI0MDAxNjEyWjBrMQswCQYDVQQGEwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMm +VmlzYSBJbnRlcm5hdGlvbmFsIFNlcnZpY2UgQXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNv +bW1lcmNlIFJvb3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvV95WHm6h2mCxlCfL +F9sHP4CFT8icttD0b0/Pmdjh28JIXDqsOTPHH2qLJj0rNfVIsZHBAk4ElpF7sDPwsRROEW+1QK8b +RaVK7362rPKgH1g/EkZgPI2h4H3PVz4zHvtH8aoVlwdVZqW1LS7YgFmypw23RuwhY/81q6UCzyr0 +TP579ZRdhE2o8mCP2w4lPJ9zcc+U30rq299yOIzzlr3xF7zSujtFWsan9sYXiwGd/BmoKoMWuDpI +/k4+oKsGGelT84ATB+0tvz8KPFUgOSwsAGl0lUq8ILKpeeUYiZGo3BxN77t+Nwtd/jmliFKMAGzs +GHxBvfaLdXe6YJ2E5/4tAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEG +MB0GA1UdDgQWBBQVOIMPPyw/cDMezUb+B4wg4NfDtzANBgkqhkiG9w0BAQUFAAOCAQEAX/FBfXxc +CLkr4NWSR/pnXKUTwwMhmytMiUbPWU3J/qVAtmPN3XEolWcRzCSs00Rsca4BIGsDoo8Ytyk6feUW +YFN4PMCvFYP3j1IzJL1kk5fui/fbGKhtcbP3LBfQdCVp9/5rPJS+TUtBjE7ic9DjkCJzQ83z7+pz +zkWKsKZJ/0x9nXGIxHYdkFsd7v3M9+79YKWxehZx0RbQfBI8bGmX265fOZpwLwU8GUYEmSA20GBu +YQa7FkKMcPcw++DbZqMAAb3mLNqRX6BGi01qnD093QVG/na/oAo85ADmJ7f/hC3euiInlhBx6yLt +398znM/jra6O1I7mT1GvFpLgXPYHDw== +-----END CERTIFICATE----- + +Certum Root CA +============== +-----BEGIN CERTIFICATE----- +MIIDDDCCAfSgAwIBAgIDAQAgMA0GCSqGSIb3DQEBBQUAMD4xCzAJBgNVBAYTAlBMMRswGQYDVQQK +ExJVbml6ZXRvIFNwLiB6IG8uby4xEjAQBgNVBAMTCUNlcnR1bSBDQTAeFw0wMjA2MTExMDQ2Mzla +Fw0yNzA2MTExMDQ2MzlaMD4xCzAJBgNVBAYTAlBMMRswGQYDVQQKExJVbml6ZXRvIFNwLiB6IG8u +by4xEjAQBgNVBAMTCUNlcnR1bSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM6x +wS7TT3zNJc4YPk/EjG+AanPIW1H4m9LcuwBcsaD8dQPugfCI7iNS6eYVM42sLQnFdvkrOYCJ5JdL +kKWoePhzQ3ukYbDYWMzhbGZ+nPMJXlVjhNWo7/OxLjBos8Q82KxujZlakE403Daaj4GIULdtlkIJ +89eVgw1BS7Bqa/j8D35in2fE7SZfECYPCE/wpFcozo+47UX2bu4lXapuOb7kky/ZR6By6/qmW6/K +Uz/iDsaWVhFu9+lmqSbYf5VT7QqFiLpPKaVCjF62/IUgAKpoC6EahQGcxEZjgoi2IrHu/qpGWX7P +NSzVttpd90gzFFS269lvzs2I1qsb2pY7HVkCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkq +hkiG9w0BAQUFAAOCAQEAuI3O7+cUus/usESSbLQ5PqKEbq24IXfS1HeCh+YgQYHu4vgRt2PRFze+ +GXYkHAQaTOs9qmdvLdTN/mUxcMUbpgIKumB7bVjCmkn+YzILa+M6wKyrO7Do0wlRjBCDxjTgxSvg +GrZgFCdsMneMvLJymM/NzD+5yCRCFNZX/OYmQ6kd5YCQzgNUKD73P9P4Te1qCjqTE5s7FCMTY5w/ +0YcneeVMUeMBrYVdGjux1XMQpNPyvG5k9VpWkKjHDkx0Dy5xO/fIR/RpbxXyEV6DHpx8Uq79AtoS +qFlnGNu8cN2bsWntgM6JQEhqDjXKKWYVIZQs6GAqm4VKQPNriiTsBhYscw== +-----END CERTIFICATE----- + +Comodo AAA Services root +======================== +-----BEGIN CERTIFICATE----- +MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS +R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg +TGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAw +MFoXDTI4MTIzMTIzNTk1OVowezELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hl +c3RlcjEQMA4GA1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNV +BAMMGEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQuaBtDFcCLNSS1UY8y2bmhG +C1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe3M/vg4aijJRPn2jymJBGhCfHdr/jzDUs +i14HZGWCwEiwqJH5YZ92IFCokcdmtet4YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszW +Y19zjNoFmag4qMsXeDZRrOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjH +Ypy+g8cmez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQUoBEK +Iz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wewYDVR0f +BHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20vQUFBQ2VydGlmaWNhdGVTZXJ2aWNl +cy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29tb2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2Vz +LmNybDANBgkqhkiG9w0BAQUFAAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm +7l3sAg9g1o1QGE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz +Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2G9w84FoVxp7Z +8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsil2D4kF501KKaU73yqWjgom7C +12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg== +-----END CERTIFICATE----- + +Comodo Secure Services root +=========================== +-----BEGIN CERTIFICATE----- +MIIEPzCCAyegAwIBAgIBATANBgkqhkiG9w0BAQUFADB+MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS +R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg +TGltaXRlZDEkMCIGA1UEAwwbU2VjdXJlIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAw +MDAwMFoXDTI4MTIzMTIzNTk1OVowfjELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFu +Y2hlc3RlcjEQMA4GA1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxJDAi +BgNVBAMMG1NlY3VyZSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBAMBxM4KK0HDrc4eCQNUd5MvJDkKQ+d40uaG6EfQlhfPMcm3ye5drswfxdySRXyWP +9nQ95IDC+DwN879A6vfIUtFyb+/Iq0G4bi4XKpVpDM3SHpR7LZQdqnXXs5jLrLxkU0C8j6ysNstc +rbvd4JQX7NFc0L/vpZXJkMWwrPsbQ996CF23uPJAGysnnlDOXmWCiIxe004MeuoIkbY2qitC++rC +oznl2yY4rYsK7hljxxwk3wN42ubqwUcaCwtGCd0C/N7Lh1/XMGNooa7cMqG6vv5Eq2i2pRcV/b3V +p6ea5EQz6YiO/O1R65NxTq0B50SOqy3LqP4BSUjwwN3HaNiS/j0CAwEAAaOBxzCBxDAdBgNVHQ4E +FgQUPNiTiMLAggnMAZkGkyDpnnAJY08wDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8w +gYEGA1UdHwR6MHgwO6A5oDeGNWh0dHA6Ly9jcmwuY29tb2RvY2EuY29tL1NlY3VyZUNlcnRpZmlj +YXRlU2VydmljZXMuY3JsMDmgN6A1hjNodHRwOi8vY3JsLmNvbW9kby5uZXQvU2VjdXJlQ2VydGlm +aWNhdGVTZXJ2aWNlcy5jcmwwDQYJKoZIhvcNAQEFBQADggEBAIcBbSMdflsXfcFhMs+P5/OKlFlm +4J4oqF7Tt/Q05qo5spcWxYJvMqTpjOev/e/C6LlLqqP05tqNZSH7uoDrJiiFGv45jN5bBAS0VPmj +Z55B+glSzAVIqMk/IQQezkhr/IXownuvf7fM+F86/TXGDe+X3EyrEeFryzHRbPtIgKvcnDe4IRRL +DXE97IMzbtFuMhbsmMcWi1mmNKsFVy2T96oTy9IT4rcuO81rUBcJaD61JlfutuC23bkpgHl9j6Pw +pCikFcSF9CfUa7/lXORlAnZUtOM3ZiTTGWHIUhDlizeauan5Hb/qmZJhlv8BzaFfDbxxvA6sCx1H +RR3B7Hzs/Sk= +-----END CERTIFICATE----- + +Comodo Trusted Services root +============================ +-----BEGIN CERTIFICATE----- +MIIEQzCCAyugAwIBAgIBATANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS +R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg +TGltaXRlZDElMCMGA1UEAwwcVHJ1c3RlZCBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczAeFw0wNDAxMDEw +MDAwMDBaFw0yODEyMzEyMzU5NTlaMH8xCzAJBgNVBAYTAkdCMRswGQYDVQQIDBJHcmVhdGVyIE1h +bmNoZXN0ZXIxEDAOBgNVBAcMB1NhbGZvcmQxGjAYBgNVBAoMEUNvbW9kbyBDQSBMaW1pdGVkMSUw +IwYDVQQDDBxUcnVzdGVkIENlcnRpZmljYXRlIFNlcnZpY2VzMIIBIjANBgkqhkiG9w0BAQEFAAOC +AQ8AMIIBCgKCAQEA33FvNlhTWvI2VFeAxHQIIO0Yfyod5jWaHiWsnOWWfnJSoBVC21ndZHoa0Lh7 +3TkVvFVIxO06AOoxEbrycXQaZ7jPM8yoMa+j49d/vzMtTGo87IvDktJTdyR0nAducPy9C1t2ul/y +/9c3S0pgePfw+spwtOpZqqPOSC+pw7ILfhdyFgymBwwbOM/JYrc/oJOlh0Hyt3BAd9i+FHzjqMB6 +juljatEPmsbS9Is6FARW1O24zG71++IsWL1/T2sr92AkWCTOJu80kTrV44HQsvAEAtdbtz6SrGsS +ivnkBbA7kUlcsutT6vifR4buv5XAwAaf0lteERv0xwQ1KdJVXOTt6wIDAQABo4HJMIHGMB0GA1Ud +DgQWBBTFe1i97doladL3WRaoszLAeydb9DAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB +/zCBgwYDVR0fBHwwejA8oDqgOIY2aHR0cDovL2NybC5jb21vZG9jYS5jb20vVHJ1c3RlZENlcnRp +ZmljYXRlU2VydmljZXMuY3JsMDqgOKA2hjRodHRwOi8vY3JsLmNvbW9kby5uZXQvVHJ1c3RlZENl +cnRpZmljYXRlU2VydmljZXMuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQDIk4E7ibSvuIQSTI3S8Ntw +uleGFTQQuS9/HrCoiWChisJ3DFBKmwCL2Iv0QeLQg4pKHBQGsKNoBXAxMKdTmw7pSqBYaWcOrp32 +pSxBvzwGa+RZzG0Q8ZZvH9/0BAKkn0U+yNj6NkZEUD+Cl5EfKNsYEYwq5GWDVxISjBc/lDb+XbDA +BHcTuPQV1T84zJQ6VdCsmPW6AF/ghhmBeC8owH7TzEIK9a5QoNE+xqFx7D+gIIxmOom0jtTYsU0l +R+4viMi14QVFwL4Ucd56/Y57fU0IlqUSc/AtyjcndBInTMu2l+nZrghtWjlA3QVHdWpaIbOjGM9O +9y5Xt5hwXsjEeLBi +-----END CERTIFICATE----- + +QuoVadis Root CA +================ +-----BEGIN CERTIFICATE----- +MIIF0DCCBLigAwIBAgIEOrZQizANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJCTTEZMBcGA1UE +ChMQUXVvVmFkaXMgTGltaXRlZDElMCMGA1UECxMcUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0 +eTEuMCwGA1UEAxMlUXVvVmFkaXMgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wMTAz +MTkxODMzMzNaFw0yMTAzMTcxODMzMzNaMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRp +cyBMaW1pdGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYDVQQD +EyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEAv2G1lVO6V/z68mcLOhrfEYBklbTRvM16z/Ypli4kVEAkOPcahdxYTMuk +J0KX0J+DisPkBgNbAKVRHnAEdOLB1Dqr1607BxgFjv2DrOpm2RgbaIr1VxqYuvXtdj182d6UajtL +F8HVj71lODqV0D1VNk7feVcxKh7YWWVJWCCYfqtffp/p1k3sg3Spx2zY7ilKhSoGFPlU5tPaZQeL +YzcS19Dsw3sgQUSj7cugF+FxZc4dZjH3dgEZyH0DWLaVSR2mEiboxgx24ONmy+pdpibu5cxfvWen +AScOospUxbF6lR1xHkopigPcakXBpBlebzbNw6Kwt/5cOOJSvPhEQ+aQuwIDAQABo4ICUjCCAk4w +PQYIKwYBBQUHAQEEMTAvMC0GCCsGAQUFBzABhiFodHRwczovL29jc3AucXVvdmFkaXNvZmZzaG9y +ZS5jb20wDwYDVR0TAQH/BAUwAwEB/zCCARoGA1UdIASCAREwggENMIIBCQYJKwYBBAG+WAABMIH7 +MIHUBggrBgEFBQcCAjCBxxqBxFJlbGlhbmNlIG9uIHRoZSBRdW9WYWRpcyBSb290IENlcnRpZmlj +YXRlIGJ5IGFueSBwYXJ0eSBhc3N1bWVzIGFjY2VwdGFuY2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJs +ZSBzdGFuZGFyZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIGNlcnRpZmljYXRpb24gcHJh +Y3RpY2VzLCBhbmQgdGhlIFF1b1ZhZGlzIENlcnRpZmljYXRlIFBvbGljeS4wIgYIKwYBBQUHAgEW +Fmh0dHA6Ly93d3cucXVvdmFkaXMuYm0wHQYDVR0OBBYEFItLbe3TKbkGGew5Oanwl4Rqy+/fMIGu +BgNVHSMEgaYwgaOAFItLbe3TKbkGGew5Oanwl4Rqy+/foYGEpIGBMH8xCzAJBgNVBAYTAkJNMRkw +FwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5MS4wLAYDVQQDEyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggQ6 +tlCLMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAitQUtf70mpKnGdSkfnIYj9lo +fFIk3WdvOXrEql494liwTXCYhGHoG+NpGA7O+0dQoE7/8CQfvbLO9Sf87C9TqnN7Az10buYWnuul +LsS/VidQK2K6vkscPFVcQR0kvoIgR13VRH56FmjffU1RcHhXHTMe/QKZnAzNCgVPx7uOpHX6Sm2x +gI4JVrmcGmD+XcHXetwReNDWXcG31a0ymQM6isxUJTkxgXsTIlG6Rmyhu576BGxJJnSP0nPrzDCi +5upZIof4l/UO/erMkqQWxFIY6iHOsfHmhIHluqmGKPJDWl0Snawe2ajlCmqnf6CHKc/yiU3U7MXi +5nrQNiOKSnQ2+Q== +-----END CERTIFICATE----- + +QuoVadis Root CA 2 +================== +-----BEGIN CERTIFICATE----- +MIIFtzCCA5+gAwIBAgICBQkwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoT +EFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJvb3QgQ0EgMjAeFw0wNjExMjQx +ODI3MDBaFw0zMTExMjQxODIzMzNaMEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM +aW1pdGVkMRswGQYDVQQDExJRdW9WYWRpcyBSb290IENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4IC +DwAwggIKAoICAQCaGMpLlA0ALa8DKYrwD4HIrkwZhR0In6spRIXzL4GtMh6QRr+jhiYaHv5+HBg6 +XJxgFyo6dIMzMH1hVBHL7avg5tKifvVrbxi3Cgst/ek+7wrGsxDp3MJGF/hd/aTa/55JWpzmM+Yk +lvc/ulsrHHo1wtZn/qtmUIttKGAr79dgw8eTvI02kfN/+NsRE8Scd3bBrrcCaoF6qUWD4gXmuVbB +lDePSHFjIuwXZQeVikvfj8ZaCuWw419eaxGrDPmF60Tp+ARz8un+XJiM9XOva7R+zdRcAitMOeGy +lZUtQofX1bOQQ7dsE/He3fbE+Ik/0XX1ksOR1YqI0JDs3G3eicJlcZaLDQP9nL9bFqyS2+r+eXyt +66/3FsvbzSUr5R/7mp/iUcw6UwxI5g69ybR2BlLmEROFcmMDBOAENisgGQLodKcftslWZvB1Jdxn +wQ5hYIizPtGo/KPaHbDRsSNU30R2be1B2MGyIrZTHN81Hdyhdyox5C315eXbyOD/5YDXC2Og/zOh +D7osFRXql7PSorW+8oyWHhqPHWykYTe5hnMz15eWniN9gqRMgeKh0bpnX5UHoycR7hYQe7xFSkyy +BNKr79X9DFHOUGoIMfmR2gyPZFwDwzqLID9ujWc9Otb+fVuIyV77zGHcizN300QyNQliBJIWENie +J0f7OyHj+OsdWwIDAQABo4GwMIGtMA8GA1UdEwEB/wQFMAMBAf8wCwYDVR0PBAQDAgEGMB0GA1Ud +DgQWBBQahGK8SEwzJQTU7tD2A8QZRtGUazBuBgNVHSMEZzBlgBQahGK8SEwzJQTU7tD2A8QZRtGU +a6FJpEcwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMT +ElF1b1ZhZGlzIFJvb3QgQ0EgMoICBQkwDQYJKoZIhvcNAQEFBQADggIBAD4KFk2fBluornFdLwUv +Z+YTRYPENvbzwCYMDbVHZF34tHLJRqUDGCdViXh9duqWNIAXINzng/iN/Ae42l9NLmeyhP3ZRPx3 +UIHmfLTJDQtyU/h2BwdBR5YM++CCJpNVjP4iH2BlfF/nJrP3MpCYUNQ3cVX2kiF495V5+vgtJodm +VjB3pjd4M1IQWK4/YY7yarHvGH5KWWPKjaJW1acvvFYfzznB4vsKqBUsfU16Y8Zsl0Q80m/DShcK ++JDSV6IZUaUtl0HaB0+pUNqQjZRG4T7wlP0QADj1O+hA4bRuVhogzG9Yje0uRY/W6ZM/57Es3zrW +IozchLsib9D45MY56QSIPMO661V6bYCZJPVsAfv4l7CUW+v90m/xd2gNNWQjrLhVoQPRTUIZ3Ph1 +WVaj+ahJefivDrkRoHy3au000LYmYjgahwz46P0u05B/B5EqHdZ+XIWDmbA4CD/pXvk1B+TJYm5X +f6dQlfe6yJvmjqIBxdZmv3lh8zwc4bmCXF2gw+nYSL0ZohEUGW6yhhtoPkg3Goi3XZZenMfvJ2II +4pEZXNLxId26F0KCl3GBUzGpn/Z9Yr9y4aOTHcyKJloJONDO1w2AFrR4pTqHTI2KpdVGl/IsELm8 +VCLAAVBpQ570su9t+Oza8eOx79+Rj1QqCyXBJhnEUhAFZdWCEOrCMc0u +-----END CERTIFICATE----- + +QuoVadis Root CA 3 +================== +-----BEGIN CERTIFICATE----- +MIIGnTCCBIWgAwIBAgICBcYwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoT +EFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJvb3QgQ0EgMzAeFw0wNjExMjQx +OTExMjNaFw0zMTExMjQxOTA2NDRaMEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM +aW1pdGVkMRswGQYDVQQDExJRdW9WYWRpcyBSb290IENBIDMwggIiMA0GCSqGSIb3DQEBAQUAA4IC +DwAwggIKAoICAQDMV0IWVJzmmNPTTe7+7cefQzlKZbPoFog02w1ZkXTPkrgEQK0CSzGrvI2RaNgg +DhoB4hp7Thdd4oq3P5kazethq8Jlph+3t723j/z9cI8LoGe+AaJZz3HmDyl2/7FWeUUrH556VOij +KTVopAFPD6QuN+8bv+OPEKhyq1hX51SGyMnzW9os2l2ObjyjPtr7guXd8lyyBTNvijbO0BNO/79K +DDRMpsMhvVAEVeuxu537RR5kFd5VAYwCdrXLoT9CabwvvWhDFlaJKjdhkf2mrk7AyxRllDdLkgbv +BNDInIjbC3uBr7E9KsRlOni27tyAsdLTmZw67mtaa7ONt9XOnMK+pUsvFrGeaDsGb659n/je7Mwp +p5ijJUMv7/FfJuGITfhebtfZFG4ZM2mnO4SJk8RTVROhUXhA+LjJou57ulJCg54U7QVSWllWp5f8 +nT8KKdjcT5EOE7zelaTfi5m+rJsziO+1ga8bxiJTyPbH7pcUsMV8eFLI8M5ud2CEpukqdiDtWAEX +MJPpGovgc2PZapKUSU60rUqFxKMiMPwJ7Wgic6aIDFUhWMXhOp8q3crhkODZc6tsgLjoC2SToJyM +Gf+z0gzskSaHirOi4XCPLArlzW1oUevaPwV/izLmE1xr/l9A4iLItLRkT9a6fUg+qGkM17uGcclz +uD87nSVL2v9A6wIDAQABo4IBlTCCAZEwDwYDVR0TAQH/BAUwAwEB/zCB4QYDVR0gBIHZMIHWMIHT +BgkrBgEEAb5YAAMwgcUwgZMGCCsGAQUFBwICMIGGGoGDQW55IHVzZSBvZiB0aGlzIENlcnRpZmlj +YXRlIGNvbnN0aXR1dGVzIGFjY2VwdGFuY2Ugb2YgdGhlIFF1b1ZhZGlzIFJvb3QgQ0EgMyBDZXJ0 +aWZpY2F0ZSBQb2xpY3kgLyBDZXJ0aWZpY2F0aW9uIFByYWN0aWNlIFN0YXRlbWVudC4wLQYIKwYB +BQUHAgEWIWh0dHA6Ly93d3cucXVvdmFkaXNnbG9iYWwuY29tL2NwczALBgNVHQ8EBAMCAQYwHQYD +VR0OBBYEFPLAE+CCQz777i9nMpY1XNu4ywLQMG4GA1UdIwRnMGWAFPLAE+CCQz777i9nMpY1XNu4 +ywLQoUmkRzBFMQswCQYDVQQGEwJCTTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDEbMBkGA1UE +AxMSUXVvVmFkaXMgUm9vdCBDQSAzggIFxjANBgkqhkiG9w0BAQUFAAOCAgEAT62gLEz6wPJv92ZV +qyM07ucp2sNbtrCD2dDQ4iH782CnO11gUyeim/YIIirnv6By5ZwkajGxkHon24QRiSemd1o417+s +hvzuXYO8BsbRd2sPbSQvS3pspweWyuOEn62Iix2rFo1bZhfZFvSLgNLd+LJ2w/w4E6oM3kJpK27z +POuAJ9v1pkQNn1pVWQvVDVJIxa6f8i+AxeoyUDUSly7B4f/xI4hROJ/yZlZ25w9Rl6VSDE1JUZU2 +Pb+iSwwQHYaZTKrzchGT5Or2m9qoXadNt54CrnMAyNojA+j56hl0YgCUyyIgvpSnWbWCar6ZeXqp +8kokUvd0/bpO5qgdAm6xDYBEwa7TIzdfu4V8K5Iu6H6li92Z4b8nby1dqnuH/grdS/yO9SbkbnBC +bjPsMZ57k8HkyWkaPcBrTiJt7qtYTcbQQcEr6k8Sh17rRdhs9ZgC06DYVYoGmRmioHfRMJ6szHXu +g/WwYjnPbFfiTNKRCw51KBuav/0aQ/HKd/s7j2G4aSgWQgRecCocIdiP4b0jWy10QJLZYxkNc91p +vGJHvOB0K7Lrfb5BG7XARsWhIstfTsEokt4YutUqKLsRixeTmJlglFwjz1onl14LBQaTNx47aTbr +qZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK4SVhM7JZG+Ju1zdXtg2pEto= +-----END CERTIFICATE----- + +Security Communication Root CA +============================== +-----BEGIN CERTIFICATE----- +MIIDWjCCAkKgAwIBAgIBADANBgkqhkiG9w0BAQUFADBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP +U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw +HhcNMDMwOTMwMDQyMDQ5WhcNMjMwOTMwMDQyMDQ5WjBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP +U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCzs/5/022x7xZ8V6UMbXaKL0u/ZPtM7orw +8yl89f/uKuDp6bpbZCKamm8sOiZpUQWZJtzVHGpxxpp9Hp3dfGzGjGdnSj74cbAZJ6kJDKaVv0uM +DPpVmDvY6CKhS3E4eayXkmmziX7qIWgGmBSWh9JhNrxtJ1aeV+7AwFb9Ms+k2Y7CI9eNqPPYJayX +5HA49LY6tJ07lyZDo6G8SVlyTCMwhwFY9k6+HGhWZq/NQV3Is00qVUarH9oe4kA92819uZKAnDfd +DJZkndwi92SL32HeFZRSFaB9UslLqCHJxrHty8OVYNEP8Ktw+N/LTX7s1vqr2b1/VPKl6Xn62dZ2 +JChzAgMBAAGjPzA9MB0GA1UdDgQWBBSgc0mZaNyFW2XjmygvV5+9M7wHSDALBgNVHQ8EBAMCAQYw +DwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAaECpqLvkT115swW1F7NgE+vGkl3g +0dNq/vu+m22/xwVtWSDEHPC32oRYAmP6SBbvT6UL90qY8j+eG61Ha2POCEfrUj94nK9NrvjVT8+a +mCoQQTlSxN3Zmw7vkwGusi7KaEIkQmywszo+zenaSMQVy+n5Bw+SUEmK3TGXX8npN6o7WWWXlDLJ +s58+OmJYxUmtYg5xpTKqL8aJdkNAExNnPaJUJRDL8Try2frbSVa7pv6nQTXD4IhhyYjH3zYQIphZ +6rBK+1YWc26sTfcioU+tHXotRSflMMFe8toTyyVCUZVHA4xsIcx0Qu1T/zOLjw9XARYvz6buyXAi +FL39vmwLAw== +-----END CERTIFICATE----- + +Sonera Class 1 Root CA +====================== +-----BEGIN CERTIFICATE----- +MIIDIDCCAgigAwIBAgIBJDANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEPMA0GA1UEChMG +U29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MxIENBMB4XDTAxMDQwNjEwNDkxM1oXDTIxMDQw +NjEwNDkxM1owOTELMAkGA1UEBhMCRkkxDzANBgNVBAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJh +IENsYXNzMSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALWJHytPZwp5/8Ue+H88 +7dF+2rDNbS82rDTG29lkFwhjMDMiikzujrsPDUJVyZ0upe/3p4zDq7mXy47vPxVnqIJyY1MPQYx9 +EJUkoVqlBvqSV536pQHydekfvFYmUk54GWVYVQNYwBSujHxVX3BbdyMGNpfzJLWaRpXk3w0LBUXl +0fIdgrvGE+D+qnr9aTCU89JFhfzyMlsy3uhsXR/LpCJ0sICOXZT3BgBLqdReLjVQCfOAl/QMF645 +2F/NM8EcyonCIvdFEu1eEpOdY6uCLrnrQkFEy0oaAIINnvmLVz5MxxftLItyM19yejhW1ebZrgUa +HXVFsculJRwSVzb9IjcCAwEAAaMzMDEwDwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQIR+IMi/ZT +iFIwCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQCLGrLJXWG04bkruVPRsoWdd44W7hE9 +28Jj2VuXZfsSZ9gqXLar5V7DtxYvyOirHYr9qxp81V9jz9yw3Xe5qObSIjiHBxTZ/75Wtf0HDjxV +yhbMp6Z3N/vbXB9OWQaHowND9Rart4S9Tu+fMTfwRvFAttEMpWT4Y14h21VOTzF2nBBhjrZTOqMR +vq9tfB69ri3iDGnHhVNoomG6xT60eVR4ngrHAr5i0RGCS2UvkVrCqIexVmiUefkl98HVrhq4uz2P +qYo4Ffdz0Fpg0YCw8NzVUM1O7pJIae2yIx4wzMiUyLb1O4Z/P6Yun/Y+LLWSlj7fLJOK/4GMDw9Z +IRlXvVWa +-----END CERTIFICATE----- + +Sonera Class 2 Root CA +====================== +-----BEGIN CERTIFICATE----- +MIIDIDCCAgigAwIBAgIBHTANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEPMA0GA1UEChMG +U29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MyIENBMB4XDTAxMDQwNjA3Mjk0MFoXDTIxMDQw +NjA3Mjk0MFowOTELMAkGA1UEBhMCRkkxDzANBgNVBAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJh +IENsYXNzMiBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJAXSjWdyvANlsdE+hY3 +/Ei9vX+ALTU74W+oZ6m/AxxNjG8yR9VBaKQTBME1DJqEQ/xcHf+Js+gXGM2RX/uJ4+q/Tl18GybT +dXnt5oTjV+WtKcT0OijnpXuENmmz/V52vaMtmdOQTiMofRhj8VQ7Jp12W5dCsv+u8E7s3TmVToMG +f+dJQMjFAbJUWmYdPfz56TwKnoG4cPABi+QjVHzIrviQHgCWctRUz2EjvOr7nQKV0ba5cTppCD8P +tOFCx4j1P5iop7oc4HFx71hXgVB6XGt0Rg6DA5jDjqhu8nYybieDwnPz3BjotJPqdURrBGAgcVeH +nfO+oJAjPYok4doh28MCAwEAAaMzMDEwDwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQISqCqWITT +XjwwCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQBazof5FnIVV0sd2ZvnoiYw7JNn39Yt +0jSv9zilzqsWuasvfDXLrNAPtEwr/IDva4yRXzZ299uzGxnq9LIR/WFxRL8oszodv7ND6J+/3DEI +cbCdjdY0RzKQxmUk96BKfARzjzlvF4xytb1LyHr4e4PDKE6cCepnP7JnBBvDFNr450kkkdAdavph +Oe9r5yF1BgfYErQhIHBCcYHaPJo2vqZbDWpsmh+Re/n570K6Tk6ezAyNlNzZRZxe7EJQY670XcSx +EtzKO6gunRRaBXW37Ndj4ro1tgQIkejanZz2ZrUYrAqmVCY0M9IbwdR/GjqOC6oybtv8TyWf2TLH +llpwrN9M +-----END CERTIFICATE----- + +Staat der Nederlanden Root CA +============================= +-----BEGIN CERTIFICATE----- +MIIDujCCAqKgAwIBAgIEAJiWijANBgkqhkiG9w0BAQUFADBVMQswCQYDVQQGEwJOTDEeMBwGA1UE +ChMVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSYwJAYDVQQDEx1TdGFhdCBkZXIgTmVkZXJsYW5kZW4g +Um9vdCBDQTAeFw0wMjEyMTcwOTIzNDlaFw0xNTEyMTYwOTE1MzhaMFUxCzAJBgNVBAYTAk5MMR4w +HAYDVQQKExVTdGFhdCBkZXIgTmVkZXJsYW5kZW4xJjAkBgNVBAMTHVN0YWF0IGRlciBOZWRlcmxh +bmRlbiBSb290IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmNK1URF6gaYUmHFt +vsznExvWJw56s2oYHLZhWtVhCb/ekBPHZ+7d89rFDBKeNVU+LCeIQGv33N0iYfXCxw719tV2U02P +jLwYdjeFnejKScfST5gTCaI+Ioicf9byEGW07l8Y1Rfj+MX94p2i71MOhXeiD+EwR+4A5zN9RGca +C1Hoi6CeUJhoNFIfLm0B8mBF8jHrqTFoKbt6QZ7GGX+UtFE5A3+y3qcym7RHjm+0Sq7lr7HcsBth +vJly3uSJt3omXdozSVtSnA71iq3DuD3oBmrC1SoLbHuEvVYFy4ZlkuxEK7COudxwC0barbxjiDn6 +22r+I/q85Ej0ZytqERAhSQIDAQABo4GRMIGOMAwGA1UdEwQFMAMBAf8wTwYDVR0gBEgwRjBEBgRV +HSAAMDwwOgYIKwYBBQUHAgEWLmh0dHA6Ly93d3cucGtpb3ZlcmhlaWQubmwvcG9saWNpZXMvcm9v +dC1wb2xpY3kwDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBSofeu8Y6R0E3QA7Jbg0zTBLL9s+DAN +BgkqhkiG9w0BAQUFAAOCAQEABYSHVXQ2YcG70dTGFagTtJ+k/rvuFbQvBgwp8qiSpGEN/KtcCFtR +EytNwiphyPgJWPwtArI5fZlmgb9uXJVFIGzmeafR2Bwp/MIgJ1HI8XxdNGdphREwxgDS1/PTfLbw +MVcoEoJz6TMvplW0C5GUR5z6u3pCMuiufi3IvKwUv9kP2Vv8wfl6leF9fpb8cbDCTMjfRTTJzg3y +nGQI0DvDKcWy7ZAEwbEpkcUwb8GpcjPM/l0WFywRaed+/sWDCN+83CI6LiBpIzlWYGeQiy52OfsR +iJf2fL1LuCAWZwWN4jvBcj+UlTfHXbme2JOhF4//DGYVwSR8MnwDHTuhWEUykw== +-----END CERTIFICATE----- + +TDC Internet Root CA +==================== +-----BEGIN CERTIFICATE----- +MIIEKzCCAxOgAwIBAgIEOsylTDANBgkqhkiG9w0BAQUFADBDMQswCQYDVQQGEwJESzEVMBMGA1UE +ChMMVERDIEludGVybmV0MR0wGwYDVQQLExRUREMgSW50ZXJuZXQgUm9vdCBDQTAeFw0wMTA0MDUx +NjMzMTdaFw0yMTA0MDUxNzAzMTdaMEMxCzAJBgNVBAYTAkRLMRUwEwYDVQQKEwxUREMgSW50ZXJu +ZXQxHTAbBgNVBAsTFFREQyBJbnRlcm5ldCBSb290IENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEAxLhAvJHVYx/XmaCLDEAedLdInUaMArLgJF/wGROnN4NrXceO+YQwzho7+vvOi20j +xsNuZp+Jpd/gQlBn+h9sHvTQBda/ytZO5GhgbEaqHF1j4QeGDmUApy6mcca8uYGoOn0a0vnRrEvL +znWv3Hv6gXPU/Lq9QYjUdLP5Xjg6PEOo0pVOd20TDJ2PeAG3WiAfAzc14izbSysseLlJ28TQx5yc +5IogCSEWVmb/Bexb4/DPqyQkXsN/cHoSxNK1EKC2IeGNeGlVRGn1ypYcNIUXJXfi9i8nmHj9eQY6 +otZaQ8H/7AQ77hPv01ha/5Lr7K7a8jcDR0G2l8ktCkEiu7vmpwIDAQABo4IBJTCCASEwEQYJYIZI +AYb4QgEBBAQDAgAHMGUGA1UdHwReMFwwWqBYoFakVDBSMQswCQYDVQQGEwJESzEVMBMGA1UEChMM +VERDIEludGVybmV0MR0wGwYDVQQLExRUREMgSW50ZXJuZXQgUm9vdCBDQTENMAsGA1UEAxMEQ1JM +MTArBgNVHRAEJDAigA8yMDAxMDQwNTE2MzMxN1qBDzIwMjEwNDA1MTcwMzE3WjALBgNVHQ8EBAMC +AQYwHwYDVR0jBBgwFoAUbGQBx/2FbazI2p5QCIUItTxWqFAwHQYDVR0OBBYEFGxkAcf9hW2syNqe +UAiFCLU8VqhQMAwGA1UdEwQFMAMBAf8wHQYJKoZIhvZ9B0EABBAwDhsIVjUuMDo0LjADAgSQMA0G +CSqGSIb3DQEBBQUAA4IBAQBOQ8zR3R0QGwZ/t6T609lN+yOfI1Rb5osvBCiLtSdtiaHsmGnc540m +gwV5dOy0uaOXwTUA/RXaOYE6lTGQ3pfphqiZdwzlWqCE/xIWrG64jcN7ksKsLtB9KOy282A4aW8+ +2ARVPp7MVdK6/rtHBNcK2RYKNCn1WBPVT8+PVkuzHu7TmHnaCB4Mb7j4Fifvwm899qNLPg7kbWzb +O0ESm70NRyN/PErQr8Cv9u8btRXE64PECV90i9kR+8JWsTz4cMo0jUNAE4z9mQNUecYu6oah9jrU +Cbz0vGbMPVjQV0kK7iXiQe4T+Zs4NNEA9X7nlB38aQNiuJkFBT1reBK9sG9l +-----END CERTIFICATE----- + +TDC OCES Root CA +================ +-----BEGIN CERTIFICATE----- +MIIFGTCCBAGgAwIBAgIEPki9xDANBgkqhkiG9w0BAQUFADAxMQswCQYDVQQGEwJESzEMMAoGA1UE +ChMDVERDMRQwEgYDVQQDEwtUREMgT0NFUyBDQTAeFw0wMzAyMTEwODM5MzBaFw0zNzAyMTEwOTA5 +MzBaMDExCzAJBgNVBAYTAkRLMQwwCgYDVQQKEwNUREMxFDASBgNVBAMTC1REQyBPQ0VTIENBMIIB +IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArGL2YSCyz8DGhdfjeebM7fI5kqSXLmSjhFuH +nEz9pPPEXyG9VhDr2y5h7JNp46PMvZnDBfwGuMo2HP6QjklMxFaaL1a8z3sM8W9Hpg1DTeLpHTk0 +zY0s2RKY+ePhwUp8hjjEqcRhiNJerxomTdXkoCJHhNlktxmW/OwZ5LKXJk5KTMuPJItUGBxIYXvV +iGjaXbXqzRowwYCDdlCqT9HU3Tjw7xb04QxQBr/q+3pJoSgrHPb8FTKjdGqPqcNiKXEx5TukYBde +dObaE+3pHx8b0bJoc8YQNHVGEBDjkAB2QMuLt0MJIf+rTpPGWOmlgtt3xDqZsXKVSQTwtyv6e1mO +3QIDAQABo4ICNzCCAjMwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwgewGA1UdIASB +5DCB4TCB3gYIKoFQgSkBAQEwgdEwLwYIKwYBBQUHAgEWI2h0dHA6Ly93d3cuY2VydGlmaWthdC5k +ay9yZXBvc2l0b3J5MIGdBggrBgEFBQcCAjCBkDAKFgNUREMwAwIBARqBgUNlcnRpZmlrYXRlciBm +cmEgZGVubmUgQ0EgdWRzdGVkZXMgdW5kZXIgT0lEIDEuMi4yMDguMTY5LjEuMS4xLiBDZXJ0aWZp +Y2F0ZXMgZnJvbSB0aGlzIENBIGFyZSBpc3N1ZWQgdW5kZXIgT0lEIDEuMi4yMDguMTY5LjEuMS4x +LjARBglghkgBhvhCAQEEBAMCAAcwgYEGA1UdHwR6MHgwSKBGoESkQjBAMQswCQYDVQQGEwJESzEM +MAoGA1UEChMDVERDMRQwEgYDVQQDEwtUREMgT0NFUyBDQTENMAsGA1UEAxMEQ1JMMTAsoCqgKIYm +aHR0cDovL2NybC5vY2VzLmNlcnRpZmlrYXQuZGsvb2Nlcy5jcmwwKwYDVR0QBCQwIoAPMjAwMzAy +MTEwODM5MzBagQ8yMDM3MDIxMTA5MDkzMFowHwYDVR0jBBgwFoAUYLWF7FZkfhIZJ2cdUBVLc647 ++RIwHQYDVR0OBBYEFGC1hexWZH4SGSdnHVAVS3OuO/kSMB0GCSqGSIb2fQdBAAQQMA4bCFY2LjA6 +NC4wAwIEkDANBgkqhkiG9w0BAQUFAAOCAQEACromJkbTc6gJ82sLMJn9iuFXehHTuJTXCRBuo7E4 +A9G28kNBKWKnctj7fAXmMXAnVBhOinxO5dHKjHiIzxvTkIvmI/gLDjNDfZziChmPyQE+dF10yYsc +A+UYyAFMP8uXBV2YcaaYb7Z8vTd/vuGTJW1v8AqtFxjhA7wHKcitJuj4YfD9IQl+mo6paH1IYnK9 +AOoBmbgGglGBTvH1tJFUuSN6AJqfXY3gPGS5GhKSKseCRHI53OI8xthV9RVOyAUO28bQYqbsFbS1 +AoLbrIyigfCbmTH1ICCoiGEKB5+U/NDXG8wuF/MEJ3Zn61SD/aSQfgY9BKNDLdr8C2LqL19iUw== +-----END CERTIFICATE----- + +UTN DATACorp SGC Root CA +======================== +-----BEGIN CERTIFICATE----- +MIIEXjCCA0agAwIBAgIQRL4Mi1AAIbQR0ypoBqmtaTANBgkqhkiG9w0BAQUFADCBkzELMAkGA1UE +BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl +IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xGzAZ +BgNVBAMTElVUTiAtIERBVEFDb3JwIFNHQzAeFw05OTA2MjQxODU3MjFaFw0xOTA2MjQxOTA2MzBa +MIGTMQswCQYDVQQGEwJVUzELMAkGA1UECBMCVVQxFzAVBgNVBAcTDlNhbHQgTGFrZSBDaXR5MR4w +HAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxITAfBgNVBAsTGGh0dHA6Ly93d3cudXNlcnRy +dXN0LmNvbTEbMBkGA1UEAxMSVVROIC0gREFUQUNvcnAgU0dDMIIBIjANBgkqhkiG9w0BAQEFAAOC +AQ8AMIIBCgKCAQEA3+5YEKIrblXEjr8uRgnn4AgPLit6E5Qbvfa2gI5lBZMAHryv4g+OGQ0SR+ys +raP6LnD43m77VkIVni5c7yPeIbkFdicZD0/Ww5y0vpQZY/KmEQrrU0icvvIpOxboGqBMpsn0GFlo +wHDyUwDAXlCCpVZvNvlK4ESGoE1O1kduSUrLZ9emxAW5jh70/P/N5zbgnAVssjMiFdC04MwXwLLA +9P4yPykqlXvY8qdOD1R8oQ2AswkDwf9c3V6aPryuvEeKaq5xyh+xKrhfQgUL7EYw0XILyulWbfXv +33i+Ybqypa4ETLyorGkVl73v67SMvzX41MPRKA5cOp9wGDMgd8SirwIDAQABo4GrMIGoMAsGA1Ud +DwQEAwIBxjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRTMtGzz3/64PGgXYVOktKeRR20TzA9 +BgNVHR8ENjA0MDKgMKAuhixodHRwOi8vY3JsLnVzZXJ0cnVzdC5jb20vVVROLURBVEFDb3JwU0dD +LmNybDAqBgNVHSUEIzAhBggrBgEFBQcDAQYKKwYBBAGCNwoDAwYJYIZIAYb4QgQBMA0GCSqGSIb3 +DQEBBQUAA4IBAQAnNZcAiosovcYzMB4p/OL31ZjUQLtgyr+rFywJNn9Q+kHcrpY6CiM+iVnJowft +Gzet/Hy+UUla3joKVAgWRcKZsYfNjGjgaQPpxE6YsjuMFrMOoAyYUJuTqXAJyCyjj98C5OBxOvG0 +I3KgqgHf35g+FFCgMSa9KOlaMCZ1+XtgHI3zzVAmbQQnmt/VDUVHKWss5nbZqSl9Mt3JNjy9rjXx +EZ4du5A/EkdOjtd+D2JzHVImOBwYSf0wdJrE5SIv2MCN7ZF6TACPcn9d2t0bi0Vr591pl6jFVkwP +DPafepE39peC4N1xaf92P2BNPM/3mfnGV/TJVTl4uix5yaaIK/QI +-----END CERTIFICATE----- + +UTN USERFirst Email Root CA +=========================== +-----BEGIN CERTIFICATE----- +MIIEojCCA4qgAwIBAgIQRL4Mi1AAJLQR0zYlJWfJiTANBgkqhkiG9w0BAQUFADCBrjELMAkGA1UE +BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl +IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xNjA0 +BgNVBAMTLVVUTi1VU0VSRmlyc3QtQ2xpZW50IEF1dGhlbnRpY2F0aW9uIGFuZCBFbWFpbDAeFw05 +OTA3MDkxNzI4NTBaFw0xOTA3MDkxNzM2NThaMIGuMQswCQYDVQQGEwJVUzELMAkGA1UECBMCVVQx +FzAVBgNVBAcTDlNhbHQgTGFrZSBDaXR5MR4wHAYDVQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsx +ITAfBgNVBAsTGGh0dHA6Ly93d3cudXNlcnRydXN0LmNvbTE2MDQGA1UEAxMtVVROLVVTRVJGaXJz +dC1DbGllbnQgQXV0aGVudGljYXRpb24gYW5kIEVtYWlsMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEAsjmFpPJ9q0E7YkY3rs3BYHW8OWX5ShpHornMSMxqmNVNNRm5pELlzkniii8efNIx +B8dOtINknS4p1aJkxIW9hVE1eaROaJB7HHqkkqgX8pgV8pPMyaQylbsMTzC9mKALi+VuG6JG+ni8 +om+rWV6lL8/K2m2qL+usobNqqrcuZzWLeeEeaYji5kbNoKXqvgvOdjp6Dpvq/NonWz1zHyLmSGHG +TPNpsaguG7bUMSAsvIKKjqQOpdeJQ/wWWq8dcdcRWdq6hw2v+vPhwvCkxWeM1tZUOt4KpLoDd7Nl +yP0e03RiqhjKaJMeoYV+9Udly/hNVyh00jT/MLbu9mIwFIws6wIDAQABo4G5MIG2MAsGA1UdDwQE +AwIBxjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBSJgmd9xJ0mcABLtFBIfN49rgRufTBYBgNV +HR8EUTBPME2gS6BJhkdodHRwOi8vY3JsLnVzZXJ0cnVzdC5jb20vVVROLVVTRVJGaXJzdC1DbGll +bnRBdXRoZW50aWNhdGlvbmFuZEVtYWlsLmNybDAdBgNVHSUEFjAUBggrBgEFBQcDAgYIKwYBBQUH +AwQwDQYJKoZIhvcNAQEFBQADggEBALFtYV2mGn98q0rkMPxTbyUkxsrt4jFcKw7u7mFVbwQ+zzne +xRtJlOTrIEy05p5QLnLZjfWqo7NK2lYcYJeA3IKirUq9iiv/Cwm0xtcgBEXkzYABurorbs6q15L+ +5K/r9CYdFip/bDCVNy8zEqx/3cfREYxRmLLQo5HQrfafnoOTHh1CuEava2bwm3/q4wMC5QJRwarV +NZ1yQAOJujEdxRBoUp7fooXFXAimeOZTT7Hot9MUnpOmw2TjrH5xzbyf6QMbzPvprDHBr3wVdAKZ +w7JHpsIyYdfHb0gkUSeh1YdV8nuPmD0Wnu51tvjQjvLzxq4oW6fw8zYX/MMF08oDSlQ= +-----END CERTIFICATE----- + +UTN USERFirst Hardware Root CA +============================== +-----BEGIN CERTIFICATE----- +MIIEdDCCA1ygAwIBAgIQRL4Mi1AAJLQR0zYq/mUK/TANBgkqhkiG9w0BAQUFADCBlzELMAkGA1UE +BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl +IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHzAd +BgNVBAMTFlVUTi1VU0VSRmlyc3QtSGFyZHdhcmUwHhcNOTkwNzA5MTgxMDQyWhcNMTkwNzA5MTgx +OTIyWjCBlzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0 +eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVz +ZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3QtSGFyZHdhcmUwggEiMA0GCSqGSIb3 +DQEBAQUAA4IBDwAwggEKAoIBAQCx98M4P7Sof885glFn0G2f0v9Y8+efK+wNiVSZuTiZFvfgIXlI +wrthdBKWHTxqctU8EGc6Oe0rE81m65UJM6Rsl7HoxuzBdXmcRl6Nq9Bq/bkqVRcQVLMZ8Jr28bFd +tqdt++BxF2uiiPsA3/4aMXcMmgF6sTLjKwEHOG7DpV4jvEWbe1DByTCP2+UretNb+zNAHqDVmBe8 +i4fDidNdoI6yqqr2jmmIBsX6iSHzCJ1pLgkzmykNRg+MzEk0sGlRvfkGzWitZky8PqxhvQqIDsjf +Pe58BEydCl5rkdbux+0ojatNh4lz0G6k0B4WixThdkQDf2Os5M1JnMWS9KsyoUhbAgMBAAGjgbkw +gbYwCwYDVR0PBAQDAgHGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFKFyXyYbKJhDlV0HN9WF +lp1L0sNFMEQGA1UdHwQ9MDswOaA3oDWGM2h0dHA6Ly9jcmwudXNlcnRydXN0LmNvbS9VVE4tVVNF +UkZpcnN0LUhhcmR3YXJlLmNybDAxBgNVHSUEKjAoBggrBgEFBQcDAQYIKwYBBQUHAwUGCCsGAQUF +BwMGBggrBgEFBQcDBzANBgkqhkiG9w0BAQUFAAOCAQEARxkP3nTGmZev/K0oXnWO6y1n7k57K9cM +//bey1WiCuFMVGWTYGufEpytXoMs61quwOQt9ABjHbjAbPLPSbtNk28GpgoiskliCE7/yMgUsogW +XecB5BKV5UU0s4tpvc+0hY91UZ59Ojg6FEgSxvunOxqNDYJAB+gECJChicsZUN/KHAG8HQQZexB2 +lzvukJDKxA4fFm517zP4029bHpbj4HR3dHuKom4t3XbWOTCC8KucUvIqx69JXn7HaOWCgchqJ/kn +iCrVWFCVH/A7HFe7fRQ5YiuayZSSKqMiDP+JJn1fIytH1xUdqWqeUQ0qUZ6B+dQ7XnASfxAynB67 +nfhmqA== +-----END CERTIFICATE----- + +UTN USERFirst Object Root CA +============================ +-----BEGIN CERTIFICATE----- +MIIEZjCCA06gAwIBAgIQRL4Mi1AAJLQR0zYt4LNfGzANBgkqhkiG9w0BAQUFADCBlTELMAkGA1UE +BhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEeMBwGA1UEChMVVGhl +IFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHTAb +BgNVBAMTFFVUTi1VU0VSRmlyc3QtT2JqZWN0MB4XDTk5MDcwOTE4MzEyMFoXDTE5MDcwOTE4NDAz +NlowgZUxCzAJBgNVBAYTAlVTMQswCQYDVQQIEwJVVDEXMBUGA1UEBxMOU2FsdCBMYWtlIENpdHkx +HjAcBgNVBAoTFVRoZSBVU0VSVFJVU1QgTmV0d29yazEhMB8GA1UECxMYaHR0cDovL3d3dy51c2Vy +dHJ1c3QuY29tMR0wGwYDVQQDExRVVE4tVVNFUkZpcnN0LU9iamVjdDCCASIwDQYJKoZIhvcNAQEB +BQADggEPADCCAQoCggEBAM6qgT+jo2F4qjEAVZURnicPHxzfOpuCaDDASmEd8S8O+r5596Uj71VR +loTN2+O5bj4x2AogZ8f02b+U60cEPgLOKqJdhwQJ9jCdGIqXsqoc/EHSoTbL+z2RuufZcDX65OeQ +w5ujm9M89RKZd7G3CeBo5hy485RjiGpq/gt2yb70IuRnuasaXnfBhQfdDWy/7gbHd2pBnqcP1/vu +lBe3/IW+pKvEHDHd17bR5PDv3xaPslKT16HUiaEHLr/hARJCHhrh2JU022R5KP+6LhHC5ehbkkj7 +RwvCbNqtMoNB86XlQXD9ZZBt+vpRxPm9lisZBCzTbafc8H9vg2XiaquHhnUCAwEAAaOBrzCBrDAL +BgNVHQ8EBAMCAcYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU2u1kdBScFDyr3ZmpvVsoTYs8 +ydgwQgYDVR0fBDswOTA3oDWgM4YxaHR0cDovL2NybC51c2VydHJ1c3QuY29tL1VUTi1VU0VSRmly +c3QtT2JqZWN0LmNybDApBgNVHSUEIjAgBggrBgEFBQcDAwYIKwYBBQUHAwgGCisGAQQBgjcKAwQw +DQYJKoZIhvcNAQEFBQADggEBAAgfUrE3RHjb/c652pWWmKpVZIC1WkDdIaXFwfNfLEzIR1pp6ujw +NTX00CXzyKakh0q9G7FzCL3Uw8q2NbtZhncxzaeAFK4T7/yxSPlrJSUtUbYsbUXBmMiKVl0+7kNO +PmsnjtA6S4ULX9Ptaqd1y9Fahy85dRNacrACgZ++8A+EVCBibGnU4U3GDZlDAQ0Slox4nb9QorFE +qmrPF3rPbw/U+CRVX/A0FklmPlBGyWNxODFiuGK581OtbLUrohKqGU8J2l7nk8aOFAj+8DCAGKCG +hU3IfdeLA/5u1fedFqySLKAj5ZyRUh+U3xeUc8OzwcFxBSAAeL0TUh2oPs0AH8g= +-----END CERTIFICATE----- + +Camerfirma Chambers of Commerce Root +==================================== +-----BEGIN CERTIFICATE----- +MIIEvTCCA6WgAwIBAgIBADANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJFVTEnMCUGA1UEChMe +QUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1i +ZXJzaWduLm9yZzEiMCAGA1UEAxMZQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdDAeFw0wMzA5MzAx +NjEzNDNaFw0zNzA5MzAxNjEzNDRaMH8xCzAJBgNVBAYTAkVVMScwJQYDVQQKEx5BQyBDYW1lcmZp +cm1hIFNBIENJRiBBODI3NDMyODcxIzAhBgNVBAsTGmh0dHA6Ly93d3cuY2hhbWJlcnNpZ24ub3Jn +MSIwIAYDVQQDExlDaGFtYmVycyBvZiBDb21tZXJjZSBSb290MIIBIDANBgkqhkiG9w0BAQEFAAOC +AQ0AMIIBCAKCAQEAtzZV5aVdGDDg2olUkfzIx1L4L1DZ77F1c2VHfRtbunXF/KGIJPov7coISjlU +xFF6tdpg6jg8gbLL8bvZkSM/SAFwdakFKq0fcfPJVD0dBmpAPrMMhe5cG3nCYsS4No41XQEMIwRH +NaqbYE6gZj3LJgqcQKH0XZi/caulAGgq7YN6D6IUtdQis4CwPAxaUWktWBiP7Zme8a7ileb2R6jW +DA+wWFjbw2Y3npuRVDM30pQcakjJyfKl2qUMI/cjDpwyVV5xnIQFUZot/eZOKjRa3spAN2cMVCFV +d9oKDMyXroDclDZK9D7ONhMeU+SsTjoF7Nuucpw4i9A5O4kKPnf+dQIBA6OCAUQwggFAMBIGA1Ud +EwEB/wQIMAYBAf8CAQwwPAYDVR0fBDUwMzAxoC+gLYYraHR0cDovL2NybC5jaGFtYmVyc2lnbi5v +cmcvY2hhbWJlcnNyb290LmNybDAdBgNVHQ4EFgQU45T1sU3p26EpW1eLTXYGduHRooowDgYDVR0P +AQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIABzAnBgNVHREEIDAegRxjaGFtYmVyc3Jvb3RAY2hh +bWJlcnNpZ24ub3JnMCcGA1UdEgQgMB6BHGNoYW1iZXJzcm9vdEBjaGFtYmVyc2lnbi5vcmcwWAYD +VR0gBFEwTzBNBgsrBgEEAYGHLgoDATA+MDwGCCsGAQUFBwIBFjBodHRwOi8vY3BzLmNoYW1iZXJz +aWduLm9yZy9jcHMvY2hhbWJlcnNyb290Lmh0bWwwDQYJKoZIhvcNAQEFBQADggEBAAxBl8IahsAi +fJ/7kPMa0QOx7xP5IV8EnNrJpY0nbJaHkb5BkAFyk+cefV/2icZdp0AJPaxJRUXcLo0waLIJuvvD +L8y6C98/d3tGfToSJI6WjzwFCm/SlCgdbQzALogi1djPHRPH8EjX1wWnz8dHnjs8NMiAT9QUu/wN +UPf6s+xCX6ndbcj0dc97wXImsQEcXCz9ek60AcUFV7nnPKoF2YjpB0ZBzu9Bga5Y34OirsrXdx/n +ADydb47kMgkdTXg0eDQ8lJsm7U9xxhl6vSAiSFr+S30Dt+dYvsYyTnQeaN2oaFuzPu5ifdmA6Ap1 +erfutGWaIZDgqtCYvDi1czyL+Nw= +-----END CERTIFICATE----- + +Camerfirma Global Chambersign Root +================================== +-----BEGIN CERTIFICATE----- +MIIExTCCA62gAwIBAgIBADANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJFVTEnMCUGA1UEChMe +QUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1i +ZXJzaWduLm9yZzEgMB4GA1UEAxMXR2xvYmFsIENoYW1iZXJzaWduIFJvb3QwHhcNMDMwOTMwMTYx +NDE4WhcNMzcwOTMwMTYxNDE4WjB9MQswCQYDVQQGEwJFVTEnMCUGA1UEChMeQUMgQ2FtZXJmaXJt +YSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1iZXJzaWduLm9yZzEg +MB4GA1UEAxMXR2xvYmFsIENoYW1iZXJzaWduIFJvb3QwggEgMA0GCSqGSIb3DQEBAQUAA4IBDQAw +ggEIAoIBAQCicKLQn0KuWxfH2H3PFIP8T8mhtxOviteePgQKkotgVvq0Mi+ITaFgCPS3CU6gSS9J +1tPfnZdan5QEcOw/Wdm3zGaLmFIoCQLfxS+EjXqXd7/sQJ0lcqu1PzKY+7e3/HKE5TWH+VX6ox8O +by4o3Wmg2UIQxvi1RMLQQ3/bvOSiPGpVeAp3qdjqGTK3L/5cPxvusZjsyq16aUXjlg9V9ubtdepl +6DJWk0aJqCWKZQbua795B9Dxt6/tLE2Su8CoX6dnfQTyFQhwrJLWfQTSM/tMtgsL+xrJxI0DqX5c +8lCrEqWhz0hQpe/SyBoT+rB/sYIcd2oPX9wLlY/vQ37mRQklAgEDo4IBUDCCAUwwEgYDVR0TAQH/ +BAgwBgEB/wIBDDA/BgNVHR8EODA2MDSgMqAwhi5odHRwOi8vY3JsLmNoYW1iZXJzaWduLm9yZy9j +aGFtYmVyc2lnbnJvb3QuY3JsMB0GA1UdDgQWBBRDnDafsJ4wTcbOX60Qq+UDpfqpFDAOBgNVHQ8B +Af8EBAMCAQYwEQYJYIZIAYb4QgEBBAQDAgAHMCoGA1UdEQQjMCGBH2NoYW1iZXJzaWducm9vdEBj +aGFtYmVyc2lnbi5vcmcwKgYDVR0SBCMwIYEfY2hhbWJlcnNpZ25yb290QGNoYW1iZXJzaWduLm9y +ZzBbBgNVHSAEVDBSMFAGCysGAQQBgYcuCgEBMEEwPwYIKwYBBQUHAgEWM2h0dHA6Ly9jcHMuY2hh +bWJlcnNpZ24ub3JnL2Nwcy9jaGFtYmVyc2lnbnJvb3QuaHRtbDANBgkqhkiG9w0BAQUFAAOCAQEA +PDtwkfkEVCeR4e3t/mh/YV3lQWVPMvEYBZRqHN4fcNs+ezICNLUMbKGKfKX0j//U2K0X1S0E0T9Y +gOKBWYi+wONGkyT+kL0mojAt6JcmVzWJdJYY9hXiryQZVgICsroPFOrGimbBhkVVi76SvpykBMdJ +PJ7oKXqJ1/6v/2j1pReQvayZzKWGVwlnRtvWFsJG8eSpUPWP0ZIV018+xgBJOm5YstHRJw0lyDL4 +IBHNfTIzSJRUTN3cecQwn+uOuFW114hcxWokPbLTBQNRxgfvzBRydD1ucs4YKIxKoHflCStFREes +t2d/AYoFWpO+ocH/+OcOZ6RHSXZddZAa9SaP8A== +-----END CERTIFICATE----- + +NetLock Qualified (Class QA) Root +================================= +-----BEGIN CERTIFICATE----- +MIIG0TCCBbmgAwIBAgIBezANBgkqhkiG9w0BAQUFADCByTELMAkGA1UEBhMCSFUxETAPBgNVBAcT +CEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0b25zYWdpIEtmdC4xGjAYBgNV +BAsTEVRhbnVzaXR2YW55a2lhZG9rMUIwQAYDVQQDEzlOZXRMb2NrIE1pbm9zaXRldHQgS296amVn +eXpvaSAoQ2xhc3MgUUEpIFRhbnVzaXR2YW55a2lhZG8xHjAcBgkqhkiG9w0BCQEWD2luZm9AbmV0 +bG9jay5odTAeFw0wMzAzMzAwMTQ3MTFaFw0yMjEyMTUwMTQ3MTFaMIHJMQswCQYDVQQGEwJIVTER +MA8GA1UEBxMIQnVkYXBlc3QxJzAlBgNVBAoTHk5ldExvY2sgSGFsb3phdGJpenRvbnNhZ2kgS2Z0 +LjEaMBgGA1UECxMRVGFudXNpdHZhbnlraWFkb2sxQjBABgNVBAMTOU5ldExvY2sgTWlub3NpdGV0 +dCBLb3pqZWd5em9pIChDbGFzcyBRQSkgVGFudXNpdHZhbnlraWFkbzEeMBwGCSqGSIb3DQEJARYP +aW5mb0BuZXRsb2NrLmh1MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx1Ilstg91IRV +CacbvWy5FPSKAtt2/GoqeKvld/Bu4IwjZ9ulZJm53QE+b+8tmjwi8F3JV6BVQX/yQ15YglMxZc4e +8ia6AFQer7C8HORSjKAyr7c3sVNnaHRnUPYtLmTeriZ539+Zhqurf4XsoPuAzPS4DB6TRWO53Lhb +m+1bOdRfYrCnjnxmOCyqsQhjF2d9zL2z8cM/z1A57dEZgxXbhxInlrfa6uWdvLrqOU+L73Sa58XQ +0uqGURzk/mQIKAR5BevKxXEOC++r6uwSEaEYBTJp0QwsGj0lmT+1fMptsK6ZmfoIYOcZwvK9UdPM +0wKswREMgM6r3JSda6M5UzrWhQIDAMV9o4ICwDCCArwwEgYDVR0TAQH/BAgwBgEB/wIBBDAOBgNV +HQ8BAf8EBAMCAQYwggJ1BglghkgBhvhCAQ0EggJmFoICYkZJR1lFTEVNISBFemVuIHRhbnVzaXR2 +YW55IGEgTmV0TG9jayBLZnQuIE1pbm9zaXRldHQgU3pvbGdhbHRhdGFzaSBTemFiYWx5emF0YWJh +biBsZWlydCBlbGphcmFzb2sgYWxhcGphbiBrZXN6dWx0LiBBIG1pbm9zaXRldHQgZWxla3Ryb25p +a3VzIGFsYWlyYXMgam9naGF0YXMgZXJ2ZW55ZXN1bGVzZW5laywgdmFsYW1pbnQgZWxmb2dhZGFz +YW5hayBmZWx0ZXRlbGUgYSBNaW5vc2l0ZXR0IFN6b2xnYWx0YXRhc2kgU3phYmFseXphdGJhbiwg +YXogQWx0YWxhbm9zIFN6ZXJ6b2Rlc2kgRmVsdGV0ZWxla2JlbiBlbG9pcnQgZWxsZW5vcnplc2kg +ZWxqYXJhcyBtZWd0ZXRlbGUuIEEgZG9rdW1lbnR1bW9rIG1lZ3RhbGFsaGF0b2sgYSBodHRwczov +L3d3dy5uZXRsb2NrLmh1L2RvY3MvIGNpbWVuIHZhZ3kga2VyaGV0b2sgYXogaW5mb0BuZXRsb2Nr +Lm5ldCBlLW1haWwgY2ltZW4uIFdBUk5JTkchIFRoZSBpc3N1YW5jZSBhbmQgdGhlIHVzZSBvZiB0 +aGlzIGNlcnRpZmljYXRlIGFyZSBzdWJqZWN0IHRvIHRoZSBOZXRMb2NrIFF1YWxpZmllZCBDUFMg +YXZhaWxhYmxlIGF0IGh0dHBzOi8vd3d3Lm5ldGxvY2suaHUvZG9jcy8gb3IgYnkgZS1tYWlsIGF0 +IGluZm9AbmV0bG9jay5uZXQwHQYDVR0OBBYEFAlqYhaSsFq7VQ7LdTI6MuWyIckoMA0GCSqGSIb3 +DQEBBQUAA4IBAQCRalCc23iBmz+LQuM7/KbD7kPgz/PigDVJRXYC4uMvBcXxKufAQTPGtpvQMznN +wNuhrWw3AkxYQTvyl5LGSKjN5Yo5iWH5Upfpvfb5lHTocQ68d4bDBsxafEp+NFAwLvt/MpqNPfMg +W/hqyobzMUwsWYACff44yTB1HLdV47yfuqhthCgFdbOLDcCRVCHnpgu0mfVRQdzNo0ci2ccBgcTc +R08m6h/t280NmPSjnLRzMkqWmf68f8glWPhY83ZmiVSkpj7EUFy6iRiCdUgh0k8T6GB+B3bbELVR +5qq5aKrN9p2QdRLqOBrKROi3macqaJVmlaut74nLYKkGEsaUR+ko +-----END CERTIFICATE----- + +NetLock Notary (Class A) Root +============================= +-----BEGIN CERTIFICATE----- +MIIGfTCCBWWgAwIBAgICAQMwDQYJKoZIhvcNAQEEBQAwga8xCzAJBgNVBAYTAkhVMRAwDgYDVQQI +EwdIdW5nYXJ5MREwDwYDVQQHEwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6 +dG9uc2FnaSBLZnQuMRowGAYDVQQLExFUYW51c2l0dmFueWtpYWRvazE2MDQGA1UEAxMtTmV0TG9j +ayBLb3pqZWd5em9pIChDbGFzcyBBKSBUYW51c2l0dmFueWtpYWRvMB4XDTk5MDIyNDIzMTQ0N1oX +DTE5MDIxOTIzMTQ0N1owga8xCzAJBgNVBAYTAkhVMRAwDgYDVQQIEwdIdW5nYXJ5MREwDwYDVQQH +EwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6dG9uc2FnaSBLZnQuMRowGAYD +VQQLExFUYW51c2l0dmFueWtpYWRvazE2MDQGA1UEAxMtTmV0TG9jayBLb3pqZWd5em9pIChDbGFz +cyBBKSBUYW51c2l0dmFueWtpYWRvMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvHSM +D7tM9DceqQWC2ObhbHDqeLVu0ThEDaiDzl3S1tWBxdRL51uUcCbbO51qTGL3cfNk1mE7PetzozfZ +z+qMkjvN9wfcZnSX9EUi3fRc4L9t875lM+QVOr/bmJBVOMTtplVjC7B4BPTjbsE/jvxReB+SnoPC +/tmwqcm8WgD/qaiYdPv2LD4VOQ22BFWoDpggQrOxJa1+mm9dU7GrDPzr4PN6s6iz/0b2Y6LYOph7 +tqyF/7AlT3Rj5xMHpQqPBffAZG9+pyeAlt7ULoZgx2srXnN7F+eRP2QM2EsiNCubMvJIH5+hCoR6 +4sKtlz2O1cH5VqNQ6ca0+pii7pXmKgOM3wIDAQABo4ICnzCCApswDgYDVR0PAQH/BAQDAgAGMBIG +A1UdEwEB/wQIMAYBAf8CAQQwEQYJYIZIAYb4QgEBBAQDAgAHMIICYAYJYIZIAYb4QgENBIICURaC +Ak1GSUdZRUxFTSEgRXplbiB0YW51c2l0dmFueSBhIE5ldExvY2sgS2Z0LiBBbHRhbGFub3MgU3pv +bGdhbHRhdGFzaSBGZWx0ZXRlbGVpYmVuIGxlaXJ0IGVsamFyYXNvayBhbGFwamFuIGtlc3p1bHQu +IEEgaGl0ZWxlc2l0ZXMgZm9seWFtYXRhdCBhIE5ldExvY2sgS2Z0LiB0ZXJtZWtmZWxlbG9zc2Vn +LWJpenRvc2l0YXNhIHZlZGkuIEEgZGlnaXRhbGlzIGFsYWlyYXMgZWxmb2dhZGFzYW5hayBmZWx0 +ZXRlbGUgYXogZWxvaXJ0IGVsbGVub3J6ZXNpIGVsamFyYXMgbWVndGV0ZWxlLiBBeiBlbGphcmFz +IGxlaXJhc2EgbWVndGFsYWxoYXRvIGEgTmV0TG9jayBLZnQuIEludGVybmV0IGhvbmxhcGphbiBh +IGh0dHBzOi8vd3d3Lm5ldGxvY2submV0L2RvY3MgY2ltZW4gdmFneSBrZXJoZXRvIGF6IGVsbGVu +b3J6ZXNAbmV0bG9jay5uZXQgZS1tYWlsIGNpbWVuLiBJTVBPUlRBTlQhIFRoZSBpc3N1YW5jZSBh +bmQgdGhlIHVzZSBvZiB0aGlzIGNlcnRpZmljYXRlIGlzIHN1YmplY3QgdG8gdGhlIE5ldExvY2sg +Q1BTIGF2YWlsYWJsZSBhdCBodHRwczovL3d3dy5uZXRsb2NrLm5ldC9kb2NzIG9yIGJ5IGUtbWFp +bCBhdCBjcHNAbmV0bG9jay5uZXQuMA0GCSqGSIb3DQEBBAUAA4IBAQBIJEb3ulZv+sgoA0BO5TE5 +ayZrU3/b39/zcT0mwBQOxmd7I6gMc90Bu8bKbjc5VdXHjFYgDigKDtIqpLBJUsY4B/6+CgmM0ZjP +ytoUMaFP0jn8DxEsQ8Pdq5PHVT5HfBgaANzze9jyf1JsIPQLX2lS9O74silg6+NJMSEN1rUQQeJB +CWziGppWS3cC9qCbmieH6FUpccKQn0V4GuEVZD3QDtigdp+uxdAu6tYPVuxkf1qbFFgBJ34TUMdr +KuZoPL9coAob4Q566eKAw+np9v1sEZ7Q5SgnK1QyQhSCdeZK8CtmdWOMovsEPoMOmzbwGOQmIMOM +8CgHrTwXZoi1/baI +-----END CERTIFICATE----- + +NetLock Business (Class B) Root +=============================== +-----BEGIN CERTIFICATE----- +MIIFSzCCBLSgAwIBAgIBaTANBgkqhkiG9w0BAQQFADCBmTELMAkGA1UEBhMCSFUxETAPBgNVBAcT +CEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0b25zYWdpIEtmdC4xGjAYBgNV +BAsTEVRhbnVzaXR2YW55a2lhZG9rMTIwMAYDVQQDEylOZXRMb2NrIFV6bGV0aSAoQ2xhc3MgQikg +VGFudXNpdHZhbnlraWFkbzAeFw05OTAyMjUxNDEwMjJaFw0xOTAyMjAxNDEwMjJaMIGZMQswCQYD +VQQGEwJIVTERMA8GA1UEBxMIQnVkYXBlc3QxJzAlBgNVBAoTHk5ldExvY2sgSGFsb3phdGJpenRv +bnNhZ2kgS2Z0LjEaMBgGA1UECxMRVGFudXNpdHZhbnlraWFkb2sxMjAwBgNVBAMTKU5ldExvY2sg +VXpsZXRpIChDbGFzcyBCKSBUYW51c2l0dmFueWtpYWRvMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCB +iQKBgQCx6gTsIKAjwo84YM/HRrPVG/77uZmeBNwcf4xKgZjupNTKihe5In+DCnVMm8Bp2GQ5o+2S +o/1bXHQawEfKOml2mrriRBf8TKPV/riXiK+IA4kfpPIEPsgHC+b5sy96YhQJRhTKZPWLgLViqNhr +1nGTLbO/CVRY7QbrqHvcQ7GhaQIDAQABo4ICnzCCApswEgYDVR0TAQH/BAgwBgEB/wIBBDAOBgNV +HQ8BAf8EBAMCAAYwEQYJYIZIAYb4QgEBBAQDAgAHMIICYAYJYIZIAYb4QgENBIICURaCAk1GSUdZ +RUxFTSEgRXplbiB0YW51c2l0dmFueSBhIE5ldExvY2sgS2Z0LiBBbHRhbGFub3MgU3pvbGdhbHRh +dGFzaSBGZWx0ZXRlbGVpYmVuIGxlaXJ0IGVsamFyYXNvayBhbGFwamFuIGtlc3p1bHQuIEEgaGl0 +ZWxlc2l0ZXMgZm9seWFtYXRhdCBhIE5ldExvY2sgS2Z0LiB0ZXJtZWtmZWxlbG9zc2VnLWJpenRv +c2l0YXNhIHZlZGkuIEEgZGlnaXRhbGlzIGFsYWlyYXMgZWxmb2dhZGFzYW5hayBmZWx0ZXRlbGUg +YXogZWxvaXJ0IGVsbGVub3J6ZXNpIGVsamFyYXMgbWVndGV0ZWxlLiBBeiBlbGphcmFzIGxlaXJh +c2EgbWVndGFsYWxoYXRvIGEgTmV0TG9jayBLZnQuIEludGVybmV0IGhvbmxhcGphbiBhIGh0dHBz +Oi8vd3d3Lm5ldGxvY2submV0L2RvY3MgY2ltZW4gdmFneSBrZXJoZXRvIGF6IGVsbGVub3J6ZXNA +bmV0bG9jay5uZXQgZS1tYWlsIGNpbWVuLiBJTVBPUlRBTlQhIFRoZSBpc3N1YW5jZSBhbmQgdGhl +IHVzZSBvZiB0aGlzIGNlcnRpZmljYXRlIGlzIHN1YmplY3QgdG8gdGhlIE5ldExvY2sgQ1BTIGF2 +YWlsYWJsZSBhdCBodHRwczovL3d3dy5uZXRsb2NrLm5ldC9kb2NzIG9yIGJ5IGUtbWFpbCBhdCBj +cHNAbmV0bG9jay5uZXQuMA0GCSqGSIb3DQEBBAUAA4GBAATbrowXr/gOkDFOzT4JwG06sPgzTEdM +43WIEJessDgVkcYplswhwG08pXTP2IKlOcNl40JwuyKQ433bNXbhoLXan3BukxowOR0w2y7jfLKR +stE3Kfq51hdcR0/jHTjrn9V7lagonhVK0dHQKwCXoOKSNitjrFgBazMpUIaD8QFI +-----END CERTIFICATE----- + +NetLock Express (Class C) Root +============================== +-----BEGIN CERTIFICATE----- +MIIFTzCCBLigAwIBAgIBaDANBgkqhkiG9w0BAQQFADCBmzELMAkGA1UEBhMCSFUxETAPBgNVBAcT +CEJ1ZGFwZXN0MScwJQYDVQQKEx5OZXRMb2NrIEhhbG96YXRiaXp0b25zYWdpIEtmdC4xGjAYBgNV +BAsTEVRhbnVzaXR2YW55a2lhZG9rMTQwMgYDVQQDEytOZXRMb2NrIEV4cHJlc3N6IChDbGFzcyBD +KSBUYW51c2l0dmFueWtpYWRvMB4XDTk5MDIyNTE0MDgxMVoXDTE5MDIyMDE0MDgxMVowgZsxCzAJ +BgNVBAYTAkhVMREwDwYDVQQHEwhCdWRhcGVzdDEnMCUGA1UEChMeTmV0TG9jayBIYWxvemF0Yml6 +dG9uc2FnaSBLZnQuMRowGAYDVQQLExFUYW51c2l0dmFueWtpYWRvazE0MDIGA1UEAxMrTmV0TG9j +ayBFeHByZXNzeiAoQ2xhc3MgQykgVGFudXNpdHZhbnlraWFkbzCBnzANBgkqhkiG9w0BAQEFAAOB +jQAwgYkCgYEA6+ywbGGKIyWvYCDj2Z/8kwvbXY2wobNAOoLO/XXgeDIDhlqGlZHtU/qdQPzm6N3Z +W3oDvV3zOwzDUXmbrVWg6dADEK8KuhRC2VImESLH0iDMgqSaqf64gXadarfSNnU+sYYJ9m5tfk63 +euyucYT2BDMIJTLrdKwWRMbkQJMdf60CAwEAAaOCAp8wggKbMBIGA1UdEwEB/wQIMAYBAf8CAQQw +DgYDVR0PAQH/BAQDAgAGMBEGCWCGSAGG+EIBAQQEAwIABzCCAmAGCWCGSAGG+EIBDQSCAlEWggJN +RklHWUVMRU0hIEV6ZW4gdGFudXNpdHZhbnkgYSBOZXRMb2NrIEtmdC4gQWx0YWxhbm9zIFN6b2xn +YWx0YXRhc2kgRmVsdGV0ZWxlaWJlbiBsZWlydCBlbGphcmFzb2sgYWxhcGphbiBrZXN6dWx0LiBB +IGhpdGVsZXNpdGVzIGZvbHlhbWF0YXQgYSBOZXRMb2NrIEtmdC4gdGVybWVrZmVsZWxvc3NlZy1i +aXp0b3NpdGFzYSB2ZWRpLiBBIGRpZ2l0YWxpcyBhbGFpcmFzIGVsZm9nYWRhc2FuYWsgZmVsdGV0 +ZWxlIGF6IGVsb2lydCBlbGxlbm9yemVzaSBlbGphcmFzIG1lZ3RldGVsZS4gQXogZWxqYXJhcyBs +ZWlyYXNhIG1lZ3RhbGFsaGF0byBhIE5ldExvY2sgS2Z0LiBJbnRlcm5ldCBob25sYXBqYW4gYSBo +dHRwczovL3d3dy5uZXRsb2NrLm5ldC9kb2NzIGNpbWVuIHZhZ3kga2VyaGV0byBheiBlbGxlbm9y +emVzQG5ldGxvY2submV0IGUtbWFpbCBjaW1lbi4gSU1QT1JUQU5UISBUaGUgaXNzdWFuY2UgYW5k +IHRoZSB1c2Ugb2YgdGhpcyBjZXJ0aWZpY2F0ZSBpcyBzdWJqZWN0IHRvIHRoZSBOZXRMb2NrIENQ +UyBhdmFpbGFibGUgYXQgaHR0cHM6Ly93d3cubmV0bG9jay5uZXQvZG9jcyBvciBieSBlLW1haWwg +YXQgY3BzQG5ldGxvY2submV0LjANBgkqhkiG9w0BAQQFAAOBgQAQrX/XDDKACtiG8XmYta3UzbM2 +xJZIwVzNmtkFLp++UOv0JhQQLdRmF/iewSf98e3ke0ugbLWrmldwpu2gpO0u9f38vf5NNwgMvOOW +gyL1SRt/Syu0VMGAfJlOHdCM7tCs5ZL6dVb+ZKATj7i4Fp1hBWeAyNDYpQcCNJgEjTME1A== +-----END CERTIFICATE----- + +XRamp Global CA Root +==================== +-----BEGIN CERTIFICATE----- +MIIEMDCCAxigAwIBAgIQUJRs7Bjq1ZxN1ZfvdY+grTANBgkqhkiG9w0BAQUFADCBgjELMAkGA1UE +BhMCVVMxHjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2Vj +dXJpdHkgU2VydmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBB +dXRob3JpdHkwHhcNMDQxMTAxMTcxNDA0WhcNMzUwMTAxMDUzNzE5WjCBgjELMAkGA1UEBhMCVVMx +HjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2VjdXJpdHkg +U2VydmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBBdXRob3Jp +dHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCYJB69FbS638eMpSe2OAtp87ZOqCwu +IR1cRN8hXX4jdP5efrRKt6atH67gBhbim1vZZ3RrXYCPKZ2GG9mcDZhtdhAoWORlsH9KmHmf4MMx +foArtYzAQDsRhtDLooY2YKTVMIJt2W7QDxIEM5dfT2Fa8OT5kavnHTu86M/0ay00fOJIYRyO82FE +zG+gSqmUsE3a56k0enI4qEHMPJQRfevIpoy3hsvKMzvZPTeL+3o+hiznc9cKV6xkmxnr9A8ECIqs +AxcZZPRaJSKNNCyy9mgdEm3Tih4U2sSPpuIjhdV6Db1q4Ons7Be7QhtnqiXtRYMh/MHJfNViPvry +xS3T/dRlAgMBAAGjgZ8wgZwwEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1Ud +EwEB/wQFMAMBAf8wHQYDVR0OBBYEFMZPoj0GY4QJnM5i5ASsjVy16bYbMDYGA1UdHwQvMC0wK6Ap +oCeGJWh0dHA6Ly9jcmwueHJhbXBzZWN1cml0eS5jb20vWEdDQS5jcmwwEAYJKwYBBAGCNxUBBAMC +AQEwDQYJKoZIhvcNAQEFBQADggEBAJEVOQMBG2f7Shz5CmBbodpNl2L5JFMn14JkTpAuw0kbK5rc +/Kh4ZzXxHfARvbdI4xD2Dd8/0sm2qlWkSLoC295ZLhVbO50WfUfXN+pfTXYSNrsf16GBBEYgoyxt +qZ4Bfj8pzgCT3/3JknOJiWSe5yvkHJEs0rnOfc5vMZnT5r7SHpDwCRR5XCOrTdLaIR9NmXmd4c8n +nxCbHIgNsIpkQTG4DmyQJKSbXHGPurt+HBvbaoAPIbzp26a3QPSyi6mx5O+aGtA9aZnuqCij4Tyz +8LIRnM98QObd50N9otg6tamN8jSZxNQQ4Qb9CYQQO+7ETPTsJ3xCwnR8gooJybQDJbw= +-----END CERTIFICATE----- + +Go Daddy Class 2 CA +=================== +-----BEGIN CERTIFICATE----- +MIIEADCCAuigAwIBAgIBADANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMY +VGhlIEdvIERhZGR5IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRp +ZmljYXRpb24gQXV0aG9yaXR5MB4XDTA0MDYyOTE3MDYyMFoXDTM0MDYyOTE3MDYyMFowYzELMAkG +A1UEBhMCVVMxITAfBgNVBAoTGFRoZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28g +RGFkZHkgQ2xhc3MgMiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASAwDQYJKoZIhvcNAQEBBQAD +ggENADCCAQgCggEBAN6d1+pXGEmhW+vXX0iG6r7d/+TvZxz0ZWizV3GgXne77ZtJ6XCAPVYYYwhv +2vLM0D9/AlQiVBDYsoHUwHU9S3/Hd8M+eKsaA7Ugay9qK7HFiH7Eux6wwdhFJ2+qN1j3hybX2C32 +qRe3H3I2TqYXP2WYktsqbl2i/ojgC95/5Y0V4evLOtXiEqITLdiOr18SPaAIBQi2XKVlOARFmR6j +YGB0xUGlcmIbYsUfb18aQr4CUWWoriMYavx4A6lNf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmY +vLEHZ6IVDd2gWMZEewo+YihfukEHU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjgcAwgb0wHQYDVR0O +BBYEFNLEsNKR1EwRcbNhyz2h/t2oatTjMIGNBgNVHSMEgYUwgYKAFNLEsNKR1EwRcbNhyz2h/t2o +atTjoWekZTBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYVGhlIEdvIERhZGR5IEdyb3VwLCBJbmMu +MTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggEAMAwG +A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wim +PQoZ+YeAEW5p5JYXMP80kWNyOO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKt +I3lpjbi2Tc7PTMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ +HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mERdEr/VxqHD3VI +Ls9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5CufReYNnyicsbkqWletNw+vHX/b +vZ8= +-----END CERTIFICATE----- + +Starfield Class 2 CA +==================== +-----BEGIN CERTIFICATE----- +MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzElMCMGA1UEChMc +U3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZpZWxkIENsYXNzIDIg +Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQwNjI5MTczOTE2WhcNMzQwNjI5MTczOTE2WjBo +MQswCQYDVQQGEwJVUzElMCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAG +A1UECxMpU3RhcmZpZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEgMA0GCSqG +SIb3DQEBAQUAA4IBDQAwggEIAoIBAQC3Msj+6XGmBIWtDBFk385N78gDGIc/oav7PKaf8MOh2tTY +bitTkPskpD6E8J7oX+zlJ0T1KKY/e97gKvDIr1MvnsoFAZMej2YcOadN+lq2cwQlZut3f+dZxkqZ +JRRU6ybH838Z1TBwj6+wRir/resp7defqgSHo9T5iaU0X9tDkYI22WY8sbi5gv2cOj4QyDvvBmVm +epsZGD3/cVE8MC5fvj13c7JdBmzDI1aaK4UmkhynArPkPw2vCHmCuDY96pzTNbO8acr1zJ3o/WSN +F4Azbl5KXZnJHoe0nRrA1W4TNSNe35tfPe/W93bC6j67eA0cQmdrBNj41tpvi/JEoAGrAgEDo4HF +MIHCMB0GA1UdDgQWBBS/X7fRzt0fhvRbVazc1xDCDqmI5zCBkgYDVR0jBIGKMIGHgBS/X7fRzt0f +hvRbVazc1xDCDqmI56FspGowaDELMAkGA1UEBhMCVVMxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNo +bm9sb2dpZXMsIEluYy4xMjAwBgNVBAsTKVN0YXJmaWVsZCBDbGFzcyAyIENlcnRpZmljYXRpb24g +QXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAAWdP4id0ckaVaGs +afPzWdqbAYcaT1epoXkJKtv3L7IezMdeatiDh6GX70k1PncGQVhiv45YuApnP+yz3SFmH8lU+nLM +PUxA2IGvd56Deruix/U0F47ZEUD0/CwqTRV/p2JdLiXTAAsgGh1o+Re49L2L7ShZ3U0WixeDyLJl +xy16paq8U4Zt3VekyvggQQto8PT7dL5WXXp59fkdheMtlb71cZBDzI0fmgAKhynpVSJYACPq4xJD +KVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEYWQPJIrSPnNVeKtelttQKbfi3 +QBFGmh95DmK/D5fs4C8fF5Q= +-----END CERTIFICATE----- + +StartCom Certification Authority +================================ +-----BEGIN CERTIFICATE----- +MIIHyTCCBbGgAwIBAgIBATANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMN +U3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmlu +ZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0 +NjM2WhcNMzYwOTE3MTk0NjM2WjB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRk +LjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMg +U3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw +ggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZkpMyONvg45iPwbm2xPN1y +o4UcodM9tDMr0y+v/uqwQVlntsQGfQqedIXWeUyAN3rfOQVSWff0G0ZDpNKFhdLDcfN1YjS6LIp/ +Ho/u7TTQEceWzVI9ujPW3U3eCztKS5/CJi/6tRYccjV3yjxd5srhJosaNnZcAdt0FCX+7bWgiA/d +eMotHweXMAEtcnn6RtYTKqi5pquDSR3l8u/d5AGOGAqPY1MWhWKpDhk6zLVmpsJrdAfkK+F2PrRt +2PZE4XNiHzvEvqBTViVsUQn3qqvKv3b9bZvzndu/PWa8DFaqr5hIlTpL36dYUNk4dalb6kMMAv+Z +6+hsTXBbKWWc3apdzK8BMewM69KN6Oqce+Zu9ydmDBpI125C4z/eIT574Q1w+2OqqGwaVLRcJXrJ +osmLFqa7LH4XXgVNWG4SHQHuEhANxjJ/GP/89PrNbpHoNkm+Gkhpi8KWTRoSsmkXwQqQ1vp5Iki/ +untp+HDH+no32NgN0nZPV/+Qt+OR0t3vwmC3Zzrd/qqc8NSLf3Iizsafl7b4r4qgEKjZ+xjGtrVc +UjyJthkqcwEKDwOzEmDyei+B26Nu/yYwl/WL3YlXtq09s68rxbd2AvCl1iuahhQqcvbjM4xdCUsT +37uMdBNSSwIDAQABo4ICUjCCAk4wDAYDVR0TBAUwAwEB/zALBgNVHQ8EBAMCAa4wHQYDVR0OBBYE +FE4L7xqkQFulF2mHMMo0aEPQQa7yMGQGA1UdHwRdMFswLKAqoCiGJmh0dHA6Ly9jZXJ0LnN0YXJ0 +Y29tLm9yZy9zZnNjYS1jcmwuY3JsMCugKaAnhiVodHRwOi8vY3JsLnN0YXJ0Y29tLm9yZy9zZnNj +YS1jcmwuY3JsMIIBXQYDVR0gBIIBVDCCAVAwggFMBgsrBgEEAYG1NwEBATCCATswLwYIKwYBBQUH +AgEWI2h0dHA6Ly9jZXJ0LnN0YXJ0Y29tLm9yZy9wb2xpY3kucGRmMDUGCCsGAQUFBwIBFilodHRw +Oi8vY2VydC5zdGFydGNvbS5vcmcvaW50ZXJtZWRpYXRlLnBkZjCB0AYIKwYBBQUHAgIwgcMwJxYg +U3RhcnQgQ29tbWVyY2lhbCAoU3RhcnRDb20pIEx0ZC4wAwIBARqBl0xpbWl0ZWQgTGlhYmlsaXR5 +LCByZWFkIHRoZSBzZWN0aW9uICpMZWdhbCBMaW1pdGF0aW9ucyogb2YgdGhlIFN0YXJ0Q29tIENl +cnRpZmljYXRpb24gQXV0aG9yaXR5IFBvbGljeSBhdmFpbGFibGUgYXQgaHR0cDovL2NlcnQuc3Rh +cnRjb20ub3JnL3BvbGljeS5wZGYwEQYJYIZIAYb4QgEBBAQDAgAHMDgGCWCGSAGG+EIBDQQrFilT +dGFydENvbSBGcmVlIFNTTCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTANBgkqhkiG9w0BAQUFAAOC +AgEAFmyZ9GYMNPXQhV59CuzaEE44HF7fpiUFS5Eyweg78T3dRAlbB0mKKctmArexmvclmAk8jhvh +3TaHK0u7aNM5Zj2gJsfyOZEdUauCe37Vzlrk4gNXcGmXCPleWKYK34wGmkUWFjgKXlf2Ysd6AgXm +vB618p70qSmD+LIU424oh0TDkBreOKk8rENNZEXO3SipXPJzewT4F+irsfMuXGRuczE6Eri8sxHk +fY+BUZo7jYn0TZNmezwD7dOaHZrzZVD1oNB1ny+v8OqCQ5j4aZyJecRDjkZy42Q2Eq/3JR44iZB3 +fsNrarnDy0RLrHiQi+fHLB5LEUTINFInzQpdn4XBidUaePKVEFMy3YCEZnXZtWgo+2EuvoSoOMCZ +EoalHmdkrQYuL6lwhceWD3yJZfWOQ1QOq92lgDmUYMA0yZZwLKMS9R9Ie70cfmu3nZD0Ijuu+Pwq +yvqCUqDvr0tVk+vBtfAii6w0TiYiBKGHLHVKt+V9E9e4DGTANtLJL4YSjCMJwRuCO3NJo2pXh5Tl +1njFmUNj403gdy3hZZlyaQQaRwnmDwFWJPsfvw55qVguucQJAX6Vum0ABj6y6koQOdjQK/W/7HW/ +lwLFCRsI3FU34oH7N4RDYiDK51ZLZer+bMEkkyShNOsF/5oirpt9P/FlUQqmMGqz9IgcgA38coro +g14= +-----END CERTIFICATE----- + +Taiwan GRCA +=========== +-----BEGIN CERTIFICATE----- +MIIFcjCCA1qgAwIBAgIQH51ZWtcvwgZEpYAIaeNe9jANBgkqhkiG9w0BAQUFADA/MQswCQYDVQQG +EwJUVzEwMC4GA1UECgwnR292ZXJubWVudCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4X +DTAyMTIwNTEzMjMzM1oXDTMyMTIwNTEzMjMzM1owPzELMAkGA1UEBhMCVFcxMDAuBgNVBAoMJ0dv +dmVybm1lbnQgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCAiIwDQYJKoZIhvcNAQEBBQAD +ggIPADCCAgoCggIBAJoluOzMonWoe/fOW1mKydGGEghU7Jzy50b2iPN86aXfTEc2pBsBHH8eV4qN +w8XRIePaJD9IK/ufLqGU5ywck9G/GwGHU5nOp/UKIXZ3/6m3xnOUT0b3EEk3+qhZSV1qgQdW8or5 +BtD3cCJNtLdBuTK4sfCxw5w/cP1T3YGq2GN49thTbqGsaoQkclSGxtKyyhwOeYHWtXBiCAEuTk8O +1RGvqa/lmr/czIdtJuTJV6L7lvnM4T9TjGxMfptTCAtsF/tnyMKtsc2AtJfcdgEWFelq16TheEfO +htX7MfP6Mb40qij7cEwdScevLJ1tZqa2jWR+tSBqnTuBto9AAGdLiYa4zGX+FVPpBMHWXx1E1wov +J5pGfaENda1UhhXcSTvxls4Pm6Dso3pdvtUqdULle96ltqqvKKyskKw4t9VoNSZ63Pc78/1Fm9G7 +Q3hub/FCVGqY8A2tl+lSXunVanLeavcbYBT0peS2cWeqH+riTcFCQP5nRhc4L0c/cZyu5SHKYS1t +B6iEfC3uUSXxY5Ce/eFXiGvviiNtsea9P63RPZYLhY3Naye7twWb7LuRqQoHEgKXTiCQ8P8NHuJB +O9NAOueNXdpm5AKwB1KYXA6OM5zCppX7VRluTI6uSw+9wThNXo+EHWbNxWCWtFJaBYmOlXqYwZE8 +lSOyDvR5tMl8wUohAgMBAAGjajBoMB0GA1UdDgQWBBTMzO/MKWCkO7GStjz6MmKPrCUVOzAMBgNV +HRMEBTADAQH/MDkGBGcqBwAEMTAvMC0CAQAwCQYFKw4DAhoFADAHBgVnKgMAAAQUA5vwIhP/lSg2 +09yewDL7MTqKUWUwDQYJKoZIhvcNAQEFBQADggIBAECASvomyc5eMN1PhnR2WPWus4MzeKR6dBcZ +TulStbngCnRiqmjKeKBMmo4sIy7VahIkv9Ro04rQ2JyftB8M3jh+Vzj8jeJPXgyfqzvS/3WXy6Tj +Zwj/5cAWtUgBfen5Cv8b5Wppv3ghqMKnI6mGq3ZW6A4M9hPdKmaKZEk9GhiHkASfQlK3T8v+R0F2 +Ne//AHY2RTKbxkaFXeIksB7jSJaYV0eUVXoPQbFEJPPB/hprv4j9wabak2BegUqZIJxIZhm1AHlU +D7gsL0u8qV1bYH+Mh6XgUmMqvtg7hUAV/h62ZT/FS9p+tXo1KaMuephgIqP0fSdOLeq0dDzpD6Qz +DxARvBMB1uUO07+1EqLhRSPAzAhuYbeJq4PjJB7mXQfnHyA+z2fI56wwbSdLaG5LKlwCCDTb+Hbk +Z6MmnD+iMsJKxYEYMRBWqoTvLQr/uB930r+lWKBi5NdLkXWNiYCYfm3LU05er/ayl4WXudpVBrkk +7tfGOB5jGxI7leFYrPLfhNVfmS8NVVvmONsuP3LpSIXLuykTjx44VbnzssQwmSNOXfJIoRIM3BKQ +CZBUkQM8R+XVyWXgt0t97EfTsws+rZ7QdAAO671RrcDeLMDDav7v3Aun+kbfYNucpllQdSNpc5Oy ++fwC00fmcc4QAu4njIT/rEUNE1yDMuAlpYYsfPQS +-----END CERTIFICATE----- + +Firmaprofesional Root CA +======================== +-----BEGIN CERTIFICATE----- +MIIEVzCCAz+gAwIBAgIBATANBgkqhkiG9w0BAQUFADCBnTELMAkGA1UEBhMCRVMxIjAgBgNVBAcT +GUMvIE11bnRhbmVyIDI0NCBCYXJjZWxvbmExQjBABgNVBAMTOUF1dG9yaWRhZCBkZSBDZXJ0aWZp +Y2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2MjYzNDA2ODEmMCQGCSqGSIb3DQEJARYXY2FA +ZmlybWFwcm9mZXNpb25hbC5jb20wHhcNMDExMDI0MjIwMDAwWhcNMTMxMDI0MjIwMDAwWjCBnTEL +MAkGA1UEBhMCRVMxIjAgBgNVBAcTGUMvIE11bnRhbmVyIDI0NCBCYXJjZWxvbmExQjBABgNVBAMT +OUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2MjYzNDA2 +ODEmMCQGCSqGSIb3DQEJARYXY2FAZmlybWFwcm9mZXNpb25hbC5jb20wggEiMA0GCSqGSIb3DQEB +AQUAA4IBDwAwggEKAoIBAQDnIwNvbyOlXnjOlSztlB5uCp4Bx+ow0Syd3Tfom5h5VtP8c9/Qit5V +j1H5WuretXDE7aTt/6MNbg9kUDGvASdYrv5sp0ovFy3Tc9UTHI9ZpTQsHVQERc1ouKDAA6XPhUJH +lShbz++AbOCQl4oBPB3zhxAwJkh91/zpnZFx/0GaqUC1N5wpIE8fUuOgfRNtVLcK3ulqTgesrBlf +3H5idPayBQC6haD9HThuy1q7hryUZzM1gywfI834yJFxzJeL764P3CkDG8A563DtwW4O2GcLiam8 +NeTvtjS0pbbELaW+0MOUJEjb35bTALVmGotmBQ/dPz/LP6pemkr4tErvlTcbAgMBAAGjgZ8wgZww +KgYDVR0RBCMwIYYfaHR0cDovL3d3dy5maXJtYXByb2Zlc2lvbmFsLmNvbTASBgNVHRMBAf8ECDAG +AQH/AgEBMCsGA1UdEAQkMCKADzIwMDExMDI0MjIwMDAwWoEPMjAxMzEwMjQyMjAwMDBaMA4GA1Ud +DwEB/wQEAwIBBjAdBgNVHQ4EFgQUMwugZtHq2s7eYpMEKFK1FH84aLcwDQYJKoZIhvcNAQEFBQAD +ggEBAEdz/o0nVPD11HecJ3lXV7cVVuzH2Fi3AQL0M+2TUIiefEaxvT8Ub/GzR0iLjJcG1+p+o1wq +u00vR+L4OQbJnC4xGgN49Lw4xiKLMzHwFgQEffl25EvXwOaD7FnMP97/T2u3Z36mhoEyIwOdyPdf +wUpgpZKpsaSgYMN4h7Mi8yrrW6ntBas3D7Hi05V2Y1Z0jFhyGzflZKG+TQyTmAyX9odtsz/ny4Cm +7YjHX1BiAuiZdBbQ5rQ58SfLyEDW44YQqSMSkuBpQWOnryULwMWSyx6Yo1q6xTMPoJcB3X/ge9YG +VM+h4k0460tQtcsm9MracEpqoeJ5quGnM/b9Sh/22WA= +-----END CERTIFICATE----- + +Wells Fargo Root CA +=================== +-----BEGIN CERTIFICATE----- +MIID5TCCAs2gAwIBAgIEOeSXnjANBgkqhkiG9w0BAQUFADCBgjELMAkGA1UEBhMCVVMxFDASBgNV +BAoTC1dlbGxzIEZhcmdvMSwwKgYDVQQLEyNXZWxscyBGYXJnbyBDZXJ0aWZpY2F0aW9uIEF1dGhv +cml0eTEvMC0GA1UEAxMmV2VsbHMgRmFyZ28gUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcN +MDAxMDExMTY0MTI4WhcNMjEwMTE0MTY0MTI4WjCBgjELMAkGA1UEBhMCVVMxFDASBgNVBAoTC1dl +bGxzIEZhcmdvMSwwKgYDVQQLEyNXZWxscyBGYXJnbyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEv +MC0GA1UEAxMmV2VsbHMgRmFyZ28gUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0GCSqG +SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDVqDM7Jvk0/82bfuUER84A4n135zHCLielTWi5MbqNQ1mX +x3Oqfz1cQJ4F5aHiidlMuD+b+Qy0yGIZLEWukR5zcUHESxP9cMIlrCL1dQu3U+SlK93OvRw6esP3 +E48mVJwWa2uv+9iWsWCaSOAlIiR5NM4OJgALTqv9i86C1y8IcGjBqAr5dE8Hq6T54oN+J3N0Prj5 +OEL8pahbSCOz6+MlsoCultQKnMJ4msZoGK43YjdeUXWoWGPAUe5AeH6orxqg4bB4nVCMe+ez/I4j +sNtlAHCEAQgAFG5Uhpq6zPk3EPbg3oQtnaSFN9OH4xXQwReQfhkhahKpdv0SAulPIV4XAgMBAAGj +YTBfMA8GA1UdEwEB/wQFMAMBAf8wTAYDVR0gBEUwQzBBBgtghkgBhvt7hwcBCzAyMDAGCCsGAQUF +BwIBFiRodHRwOi8vd3d3LndlbGxzZmFyZ28uY29tL2NlcnRwb2xpY3kwDQYJKoZIhvcNAQEFBQAD +ggEBANIn3ZwKdyu7IvICtUpKkfnRLb7kuxpo7w6kAOnu5+/u9vnldKTC2FJYxHT7zmu1Oyl5GFrv +m+0fazbuSCUlFLZWohDo7qd/0D+j0MNdJu4HzMPBJCGHHt8qElNvQRbn7a6U+oxy+hNH8Dx+rn0R +OhPs7fpvcmR7nX1/Jv16+yWt6j4pf0zjAFcysLPp7VMX2YuyFA4w6OXVE8Zkr8QA1dhYJPz1j+zx +x32l2w8n0cbyQIjmH/ZhqPRCyLk306m+LFZ4wnKbWV01QIroTmMatukgalHizqSQ33ZwmVxwQ023 +tqcZZE6St8WRPH9IFmV7Fv3L/PvZ1dZPIWU7Sn9Ho/s= +-----END CERTIFICATE----- + +Swisscom Root CA 1 +================== +-----BEGIN CERTIFICATE----- +MIIF2TCCA8GgAwIBAgIQXAuFXAvnWUHfV8w/f52oNjANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQG +EwJjaDERMA8GA1UEChMIU3dpc3Njb20xJTAjBgNVBAsTHERpZ2l0YWwgQ2VydGlmaWNhdGUgU2Vy +dmljZXMxGzAZBgNVBAMTElN3aXNzY29tIFJvb3QgQ0EgMTAeFw0wNTA4MTgxMjA2MjBaFw0yNTA4 +MTgyMjA2MjBaMGQxCzAJBgNVBAYTAmNoMREwDwYDVQQKEwhTd2lzc2NvbTElMCMGA1UECxMcRGln +aXRhbCBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczEbMBkGA1UEAxMSU3dpc3Njb20gUm9vdCBDQSAxMIIC +IjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0LmwqAzZuz8h+BvVM5OAFmUgdbI9m2BtRsiM +MW8Xw/qabFbtPMWRV8PNq5ZJkCoZSx6jbVfd8StiKHVFXqrWW/oLJdihFvkcxC7mlSpnzNApbjyF +NDhhSbEAn9Y6cV9Nbc5fuankiX9qUvrKm/LcqfmdmUc/TilftKaNXXsLmREDA/7n29uj/x2lzZAe +AR81sH8A25Bvxn570e56eqeqDFdvpG3FEzuwpdntMhy0XmeLVNxzh+XTF3xmUHJd1BpYwdnP2IkC +b6dJtDZd0KTeByy2dbcokdaXvij1mB7qWybJvbCXc9qukSbraMH5ORXWZ0sKbU/Lz7DkQnGMU3nn +7uHbHaBuHYwadzVcFh4rUx80i9Fs/PJnB3r1re3WmquhsUvhzDdf/X/NTa64H5xD+SpYVUNFvJbN +cA78yeNmuk6NO4HLFWR7uZToXTNShXEuT46iBhFRyePLoW4xCGQMwtI89Tbo19AOeCMgkckkKmUp +WyL3Ic6DXqTz3kvTaI9GdVyDCW4pa8RwjPWd1yAv/0bSKzjCL3UcPX7ape8eYIVpQtPM+GP+HkM5 +haa2Y0EQs3MevNP6yn0WR+Kn1dCjigoIlmJWbjTb2QK5MHXjBNLnj8KwEUAKrNVxAmKLMb7dxiNY +MUJDLXT5xp6mig/p/r+D5kNXJLrvRjSq1xIBOO0CAwEAAaOBhjCBgzAOBgNVHQ8BAf8EBAMCAYYw +HQYDVR0hBBYwFDASBgdghXQBUwABBgdghXQBUwABMBIGA1UdEwEB/wQIMAYBAf8CAQcwHwYDVR0j +BBgwFoAUAyUv3m+CATpcLNwroWm1Z9SM0/0wHQYDVR0OBBYEFAMlL95vggE6XCzcK6FptWfUjNP9 +MA0GCSqGSIb3DQEBBQUAA4ICAQA1EMvspgQNDQ/NwNurqPKIlwzfky9NfEBWMXrrpA9gzXrzvsMn +jgM+pN0S734edAY8PzHyHHuRMSG08NBsl9Tpl7IkVh5WwzW9iAUPWxAaZOHHgjD5Mq2eUCzneAXQ +MbFamIp1TpBcahQq4FJHgmDmHtqBsfsUC1rxn9KVuj7QG9YVHaO+htXbD8BJZLsuUBlL0iT43R4H +VtA4oJVwIHaM190e3p9xxCPvgxNcoyQVTSlAPGrEqdi3pkSlDfTgnXceQHAm/NrZNuR55LU/vJtl +vrsRls/bxig5OgjOR1tTWsWZ/l2p3e9M1MalrQLmjAcSHm8D0W+go/MpvRLHUKKwf4ipmXeascCl +OS5cfGniLLDqN2qk4Vrh9VDlg++luyqI54zb/W1elxmofmZ1a3Hqv7HHb6D0jqTsNFFbjCYDcKF3 +1QESVwA12yPeDooomf2xEG9L/zgtYE4snOtnta1J7ksfrK/7DZBaZmBwXarNeNQk7shBoJMBkpxq +nvy5JMWzFYJ+vq6VK+uxwNrjAWALXmmshFZhvnEX/h0TD/7Gh0Xp/jKgGg0TpJRVcaUWi7rKibCy +x/yP2FS1k2Kdzs9Z+z0YzirLNRWCXf9UIltxUvu3yf5gmwBBZPCqKuy2QkPOiWaByIufOVQDJdMW +NY6E0F/6MBr1mmz0DlP5OlvRHA== +-----END CERTIFICATE----- + +DigiCert Assured ID Root CA +=========================== +-----BEGIN CERTIFICATE----- +MIIDtzCCAp+gAwIBAgIQDOfg5RfYRv6P5WD8G/AwOTANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQw +IgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0EwHhcNMDYxMTEwMDAwMDAwWhcNMzEx +MTEwMDAwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQL +ExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0Ew +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtDhXO5EOAXLGH87dg+XESpa7cJpSIqvTO +9SA5KFhgDPiA2qkVlTJhPLWxKISKityfCgyDF3qPkKyK53lTXDGEKvYPmDI2dsze3Tyoou9q+yHy +UmHfnyDXH+Kx2f4YZNISW1/5WBg1vEfNoTb5a3/UsDg+wRvDjDPZ2C8Y/igPs6eD1sNuRMBhNZYW +/lmci3Zt1/GiSw0r/wty2p5g0I6QNcZ4VYcgoc/lbQrISXwxmDNsIumH0DJaoroTghHtORedmTpy +oeb6pNnVFzF1roV9Iq4/AUaG9ih5yLHa5FcXxH4cDrC0kqZWs72yl+2qp/C3xag/lRbQ/6GW6whf +GHdPAgMBAAGjYzBhMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRF +66Kv9JLLgjEtUYunpyGd823IDzAfBgNVHSMEGDAWgBRF66Kv9JLLgjEtUYunpyGd823IDzANBgkq +hkiG9w0BAQUFAAOCAQEAog683+Lt8ONyc3pklL/3cmbYMuRCdWKuh+vy1dneVrOfzM4UKLkNl2Bc +EkxY5NM9g0lFWJc1aRqoR+pWxnmrEthngYTffwk8lOa4JiwgvT2zKIn3X/8i4peEH+ll74fg38Fn +SbNd67IJKusm7Xi+fT8r87cmNW1fiQG2SVufAQWbqz0lwcy2f8Lxb4bG+mRo64EtlOtCt/qMHt1i +8b5QZ7dsvfPxH2sMNgcWfzd8qVttevESRmCD1ycEvkvOl77DZypoEd+A5wwzZr8TDRRu838fYxAe ++o0bJW1sj6W3YQGx0qMmoRBxna3iw/nDmVG3KwcIzi7mULKn+gpFL6Lw8g== +-----END CERTIFICATE----- + +DigiCert Global Root CA +======================= +-----BEGIN CERTIFICATE----- +MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBhMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAw +HgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBDQTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAw +MDAwMDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3 +dy5kaWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkq +hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsBCSDMAZOn +TjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97nh6Vfe63SKMI2tavegw5 +BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt43C/dxC//AH2hdmoRBBYMql1GNXRor5H +4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7PT19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y +7vrTC0LUq7dBMtoM1O/4gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQAB +o2MwYTAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbRTLtm +8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUwDQYJKoZIhvcNAQEF +BQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/EsrhMAtudXH/vTBH1jLuG2cenTnmCmr +EbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIt +tep3Sp+dWOIrWcBAI+0tKIJFPnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886 +UAb3LujEV0lsYSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk +CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4= +-----END CERTIFICATE----- + +DigiCert High Assurance EV Root CA +================================== +-----BEGIN CERTIFICATE----- +MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBsMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSsw +KQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5jZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAw +MFoXDTMxMTExMDAwMDAwMFowbDELMAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZ +MBcGA1UECxMQd3d3LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFu +Y2UgRVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm+9S75S0t +Mqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTWPNt0OKRKzE0lgvdKpVMS +OO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEMxChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3 +MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFBIk5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQ +NAQTXKFx01p8VdteZOE3hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUe +h10aUAsgEsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQFMAMB +Af8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaAFLE+w2kD+L9HAdSY +JhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3NecnzyIZgYIVyHbIUf4KmeqvxgydkAQ +V8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6zeM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFp +myPInngiK3BD41VHMWEZ71jFhS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkK +mNEVX58Svnw2Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe +vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep+OkuE6N36B9K +-----END CERTIFICATE----- + +Certplus Class 2 Primary CA +=========================== +-----BEGIN CERTIFICATE----- +MIIDkjCCAnqgAwIBAgIRAIW9S/PY2uNp9pTXX8OlRCMwDQYJKoZIhvcNAQEFBQAwPTELMAkGA1UE +BhMCRlIxETAPBgNVBAoTCENlcnRwbHVzMRswGQYDVQQDExJDbGFzcyAyIFByaW1hcnkgQ0EwHhcN +OTkwNzA3MTcwNTAwWhcNMTkwNzA2MjM1OTU5WjA9MQswCQYDVQQGEwJGUjERMA8GA1UEChMIQ2Vy +dHBsdXMxGzAZBgNVBAMTEkNsYXNzIDIgUHJpbWFyeSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBANxQltAS+DXSCHh6tlJw/W/uz7kRy1134ezpfgSN1sxvc0NXYKwzCkTsA18cgCSR +5aiRVhKC9+Ar9NuuYS6JEI1rbLqzAr3VNsVINyPi8Fo3UjMXEuLRYE2+L0ER4/YXJQyLkcAbmXuZ +Vg2v7tK8R1fjeUl7NIknJITesezpWE7+Tt9avkGtrAjFGA7v0lPubNCdEgETjdyAYveVqUSISnFO +YFWe2yMZeVYHDD9jC1yw4r5+FfyUM1hBOHTE4Y+L3yasH7WLO7dDWWuwJKZtkIvEcupdM5i3y95e +e++U8Rs+yskhwcWYAqqi9lt3m/V+llU0HGdpwPFC40es/CgcZlUCAwEAAaOBjDCBiTAPBgNVHRME +CDAGAQH/AgEKMAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQU43Mt38sOKAze3bOkynm4jrvoMIkwEQYJ +YIZIAYb4QgEBBAQDAgEGMDcGA1UdHwQwMC4wLKAqoCiGJmh0dHA6Ly93d3cuY2VydHBsdXMuY29t +L0NSTC9jbGFzczIuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQCnVM+IRBnL39R/AN9WM2K191EBkOvD +P9GIROkkXe/nFL0gt5o8AP5tn9uQ3Nf0YtaLcF3n5QRIqWh8yfFC82x/xXp8HVGIutIKPidd3i1R +TtMTZGnkLuPT55sJmabglZvOGtd/vjzOUrMRFcEPF80Du5wlFbqidon8BvEY0JNLDnyCt6X09l/+ +7UCmnYR0ObncHoUW2ikbhiMAybuJfm6AiB4vFLQDJKgybwOaRywwvlbGp0ICcBvqQNi6BQNwB6SW +//1IMwrh3KWBkJtN3X3n57LNXMhqlfil9o3EXXgIvnsG1knPGTZQIy4I5p4FTUcY1Rbpsda2ENW7 +l7+ijrRU +-----END CERTIFICATE----- + +DST Root CA X3 +============== +-----BEGIN CERTIFICATE----- +MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/MSQwIgYDVQQK +ExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMTDkRTVCBSb290IENBIFgzMB4X +DTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVowPzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1 +cmUgVHJ1c3QgQ28uMRcwFQYDVQQDEw5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQAD +ggEPADCCAQoCggEBAN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmT +rE4Orz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEqOLl5CjH9 +UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9bxiqKqy69cK3FCxolkHRy +xXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40d +utolucbY38EVAjqr2m7xPi71XAicPNaDaeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0T +AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQ +MA0GCSqGSIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69ikug +dB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXrAvHRAosZy5Q6XkjE +GB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZzR8srzJmwN0jP41ZL9c8PDHIyh8bw +RLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubS +fZGL+T0yjWW06XyxV3bqxbYoOb8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ +-----END CERTIFICATE----- + +DST ACES CA X6 +============== +-----BEGIN CERTIFICATE----- +MIIECTCCAvGgAwIBAgIQDV6ZCtadt3js2AdWO4YV2TANBgkqhkiG9w0BAQUFADBbMQswCQYDVQQG +EwJVUzEgMB4GA1UEChMXRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QxETAPBgNVBAsTCERTVCBBQ0VT +MRcwFQYDVQQDEw5EU1QgQUNFUyBDQSBYNjAeFw0wMzExMjAyMTE5NThaFw0xNzExMjAyMTE5NTha +MFsxCzAJBgNVBAYTAlVTMSAwHgYDVQQKExdEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdDERMA8GA1UE +CxMIRFNUIEFDRVMxFzAVBgNVBAMTDkRTVCBBQ0VTIENBIFg2MIIBIjANBgkqhkiG9w0BAQEFAAOC +AQ8AMIIBCgKCAQEAuT31LMmU3HWKlV1j6IR3dma5WZFcRt2SPp/5DgO0PWGSvSMmtWPuktKe1jzI +DZBfZIGxqAgNTNj50wUoUrQBJcWVHAx+PhCEdc/BGZFjz+iokYi5Q1K7gLFViYsx+tC3dr5BPTCa +pCIlF3PoHuLTrCq9Wzgh1SpL11V94zpVvddtawJXa+ZHfAjIgrrep4c9oW24MFbCswKBXy314pow +GCi4ZtPLAZZv6opFVdbgnf9nKxcCpk4aahELfrd755jWjHZvwTvbUJN+5dCOHze4vbrGn2zpfDPy +MjwmR/onJALJfh1biEITajV8fTXpLmaRcpPVMibEdPVTo7NdmvYJywIDAQABo4HIMIHFMA8GA1Ud +EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgHGMB8GA1UdEQQYMBaBFHBraS1vcHNAdHJ1c3Rkc3Qu +Y29tMGIGA1UdIARbMFkwVwYKYIZIAWUDAgEBATBJMEcGCCsGAQUFBwIBFjtodHRwOi8vd3d3LnRy +dXN0ZHN0LmNvbS9jZXJ0aWZpY2F0ZXMvcG9saWN5L0FDRVMtaW5kZXguaHRtbDAdBgNVHQ4EFgQU +CXIGThhDD+XWzMNqizF7eI+og7gwDQYJKoZIhvcNAQEFBQADggEBAKPYjtay284F5zLNAdMEA+V2 +5FYrnJmQ6AgwbN99Pe7lv7UkQIRJ4dEorsTCOlMwiPH1d25Ryvr/ma8kXxug/fKshMrfqfBfBC6t +Fr8hlxCBPeP/h40y3JTlR4peahPJlJU90u7INJXQgNStMgiAVDzgvVJT11J8smk/f3rPanTK+gQq +nExaBqXpIK1FZg9p8d2/6eMyi/rgwYZNcjwu2JN4Cir42NInPRmJX1p7ijvMDNpRrscL9yuwNwXs +vFcj4jjSm2jzVhKIT0J8uDHEtdvkyCE06UgRNe76x5JXxZ805Mf29w4LTJxoeHtxMcfrHuBnQfO3 +oKfN5XozNmr6mis= +-----END CERTIFICATE----- + +TURKTRUST Certificate Services Provider Root 1 +============================================== +-----BEGIN CERTIFICATE----- +MIID+zCCAuOgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBtzE/MD0GA1UEAww2VMOcUktUUlVTVCBF +bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGDAJUUjEP +MA0GA1UEBwwGQU5LQVJBMVYwVAYDVQQKDE0oYykgMjAwNSBUw5xSS1RSVVNUIEJpbGdpIMSwbGV0 +acWfaW0gdmUgQmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLjAeFw0wNTA1MTMx +MDI3MTdaFw0xNTAzMjIxMDI3MTdaMIG3MT8wPQYDVQQDDDZUw5xSS1RSVVNUIEVsZWt0cm9uaWsg +U2VydGlmaWthIEhpem1ldCBTYcSfbGF5xLFjxLFzxLExCzAJBgNVBAYMAlRSMQ8wDQYDVQQHDAZB +TktBUkExVjBUBgNVBAoMTShjKSAyMDA1IFTDnFJLVFJVU1QgQmlsZ2kgxLBsZXRpxZ9pbSB2ZSBC +aWxpxZ9pbSBHw7x2ZW5sacSfaSBIaXptZXRsZXJpIEEuxZ4uMIIBIjANBgkqhkiG9w0BAQEFAAOC +AQ8AMIIBCgKCAQEAylIF1mMD2Bxf3dJ7XfIMYGFbazt0K3gNfUW9InTojAPBxhEqPZW8qZSwu5GX +yGl8hMW0kWxsE2qkVa2kheiVfrMArwDCBRj1cJ02i67L5BuBf5OI+2pVu32Fks66WJ/bMsW9Xe8i +Si9BB35JYbOG7E6mQW6EvAPs9TscyB/C7qju6hJKjRTP8wrgUDn5CDX4EVmt5yLqS8oUBt5CurKZ +8y1UiBAG6uEaPj1nH/vO+3yC6BFdSsG5FOpU2WabfIl9BJpiyelSPJ6c79L1JuTm5Rh8i27fbMx4 +W09ysstcP4wFjdFMjK2Sx+F4f2VsSQZQLJ4ywtdKxnWKWU51b0dewQIDAQABoxAwDjAMBgNVHRME +BTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQAV9VX/N5aAWSGk/KEVTCD21F/aAyT8z5Aa9CEKmu46 +sWrv7/hg0Uw2ZkUd82YCdAR7kjCo3gp2D++Vbr3JN+YaDayJSFvMgzbC9UZcWYJWtNX+I7TYVBxE +q8Sn5RTOPEFhfEPmzcSBCYsk+1Ql1haolgxnB2+zUEfjHCQo3SqYpGH+2+oSN7wBGjSFvW5P55Fy +B0SFHljKVETd96y5y4khctuPwGkplyqjrhgjlxxBKot8KsF8kOipKMDTkcatKIdAaLX/7KfS0zgY +nNN9aV3wxqUeJBujR/xpB2jn5Jq07Q+hh4cCzofSSE7hvP/L8XKSRGQDJereW26fyfJOrN3H +-----END CERTIFICATE----- + +TURKTRUST Certificate Services Provider Root 2 +============================================== +-----BEGIN CERTIFICATE----- +MIIEPDCCAySgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBvjE/MD0GA1UEAww2VMOcUktUUlVTVCBF +bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJUUjEP +MA0GA1UEBwwGQW5rYXJhMV0wWwYDVQQKDFRUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUg +QmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLiAoYykgS2FzxLFtIDIwMDUwHhcN +MDUxMTA3MTAwNzU3WhcNMTUwOTE2MTAwNzU3WjCBvjE/MD0GA1UEAww2VMOcUktUUlVTVCBFbGVr +dHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJUUjEPMA0G +A1UEBwwGQW5rYXJhMV0wWwYDVQQKDFRUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUgQmls +acWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLiAoYykgS2FzxLFtIDIwMDUwggEiMA0G +CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCpNn7DkUNMwxmYCMjHWHtPFoylzkkBH3MOrHUTpvqe +LCDe2JAOCtFp0if7qnefJ1Il4std2NiDUBd9irWCPwSOtNXwSadktx4uXyCcUHVPr+G1QRT0mJKI +x+XlZEdhR3n9wFHxwZnn3M5q+6+1ATDcRhzviuyV79z/rxAc653YsKpqhRgNF8k+v/Gb0AmJQv2g +QrSdiVFVKc8bcLyEVK3BEx+Y9C52YItdP5qtygy/p1Zbj3e41Z55SZI/4PGXJHpsmxcPbe9TmJEr +5A++WXkHeLuXlfSfadRYhwqp48y2WBmfJiGxxFmNskF1wK1pzpwACPI2/z7woQ8arBT9pmAPAgMB +AAGjQzBBMB0GA1UdDgQWBBTZN7NOBf3Zz58SFq62iS/rJTqIHDAPBgNVHQ8BAf8EBQMDBwYAMA8G +A1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAHJglrfJ3NgpXiOFX7KzLXb7iNcX/ntt +Rbj2hWyfIvwqECLsqrkw9qtY1jkQMZkpAL2JZkH7dN6RwRgLn7Vhy506vvWolKMiVW4XSf/SKfE4 +Jl3vpao6+XF75tpYHdN0wgH6PmlYX63LaL4ULptswLbcoCb6dxriJNoaN+BnrdFzgw2lGh1uEpJ+ +hGIAF728JRhX8tepb1mIvDS3LoV4nZbcFMMsilKbloxSZj2GFotHuFEJjOp9zYhys2AzsfAKRO8P +9Qk3iCQOLGsgOqL6EfJANZxEaGM7rDNvY7wsu/LSy3Z9fYjYHcgFHW68lKlmjHdxx/qR+i9Rnuk5 +UrbnBEI= +-----END CERTIFICATE----- + +SwissSign Platinum CA - G2 +========================== +-----BEGIN CERTIFICATE----- +MIIFwTCCA6mgAwIBAgIITrIAZwwDXU8wDQYJKoZIhvcNAQEFBQAwSTELMAkGA1UEBhMCQ0gxFTAT +BgNVBAoTDFN3aXNzU2lnbiBBRzEjMCEGA1UEAxMaU3dpc3NTaWduIFBsYXRpbnVtIENBIC0gRzIw +HhcNMDYxMDI1MDgzNjAwWhcNMzYxMDI1MDgzNjAwWjBJMQswCQYDVQQGEwJDSDEVMBMGA1UEChMM +U3dpc3NTaWduIEFHMSMwIQYDVQQDExpTd2lzc1NpZ24gUGxhdGludW0gQ0EgLSBHMjCCAiIwDQYJ +KoZIhvcNAQEBBQADggIPADCCAgoCggIBAMrfogLi2vj8Bxax3mCq3pZcZB/HL37PZ/pEQtZ2Y5Wu +669yIIpFR4ZieIbWIDkm9K6j/SPnpZy1IiEZtzeTIsBQnIJ71NUERFzLtMKfkr4k2HtnIuJpX+UF +eNSH2XFwMyVTtIc7KZAoNppVRDBopIOXfw0enHb/FZ1glwCNioUD7IC+6ixuEFGSzH7VozPY1kne +WCqv9hbrS3uQMpe5up1Y8fhXSQQeol0GcN1x2/ndi5objM89o03Oy3z2u5yg+gnOI2Ky6Q0f4nIo +j5+saCB9bzuohTEJfwvH6GXp43gOCWcwizSC+13gzJ2BbWLuCB4ELE6b7P6pT1/9aXjvCR+htL/6 +8++QHkwFix7qepF6w9fl+zC8bBsQWJj3Gl/QKTIDE0ZNYWqFTFJ0LwYfexHihJfGmfNtf9dng34T +aNhxKFrYzt3oEBSa/m0jh26OWnA81Y0JAKeqvLAxN23IhBQeW71FYyBrS3SMvds6DsHPWhaPpZjy +domyExI7C3d3rLvlPClKknLKYRorXkzig3R3+jVIeoVNjZpTxN94ypeRSCtFKwH3HBqi7Ri6Cr2D ++m+8jVeTO9TUps4e8aCxzqv9KyiaTxvXw3LbpMS/XUz13XuWae5ogObnmLo2t/5u7Su9IPhlGdpV +CX4l3P5hYnL5fhgC72O00Puv5TtjjGePAgMBAAGjgawwgakwDgYDVR0PAQH/BAQDAgEGMA8GA1Ud +EwEB/wQFMAMBAf8wHQYDVR0OBBYEFFCvzAeHFUdvOMW0ZdHelarp35zMMB8GA1UdIwQYMBaAFFCv +zAeHFUdvOMW0ZdHelarp35zMMEYGA1UdIAQ/MD0wOwYJYIV0AVkBAQEBMC4wLAYIKwYBBQUHAgEW +IGh0dHA6Ly9yZXBvc2l0b3J5LnN3aXNzc2lnbi5jb20vMA0GCSqGSIb3DQEBBQUAA4ICAQAIhab1 +Fgz8RBrBY+D5VUYI/HAcQiiWjrfFwUF1TglxeeVtlspLpYhg0DB0uMoI3LQwnkAHFmtllXcBrqS3 +NQuB2nEVqXQXOHtYyvkv+8Bldo1bAbl93oI9ZLi+FHSjClTTLJUYFzX1UWs/j6KWYTl4a0vlpqD4 +U99REJNi54Av4tHgvI42Rncz7Lj7jposiU0xEQ8mngS7twSNC/K5/FqdOxa3L8iYq/6KUFkuozv8 +KV2LwUvJ4ooTHbG/u0IdUt1O2BReEMYxB+9xJ/cbOQncguqLs5WGXv312l0xpuAxtpTmREl0xRbl +9x8DYSjFyMsSoEJL+WuICI20MhjzdZ/EfwBPBZWcoxcCw7NTm6ogOSkrZvqdr16zktK1puEa+S1B +aYEUtLS17Yk9zvupnTVCRLEcFHOBzyoBNZox1S2PbYTfgE1X4z/FhHXaicYwu+uPyyIIoK6q8QNs +OktNCaUOcsZWayFCTiMlFGiudgp8DAdwZPmaL/YFOSbGDI8Zf0NebvRbFS/bYV3mZy8/CJT5YLSY +Mdp08YSTcU1f+2BY0fvEwW2JorsgH51xkcsymxM9Pn2SUjWskpSi0xjCfMfqr3YFFt1nJ8J+HAci +IfNAChs0B0QTwoRqjt8ZWr9/6x3iGjjRXK9HkmuAtTClyY3YqzGBH9/CZjfTk6mFhnll0g== +-----END CERTIFICATE----- + +SwissSign Gold CA - G2 +====================== +-----BEGIN CERTIFICATE----- +MIIFujCCA6KgAwIBAgIJALtAHEP1Xk+wMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNVBAYTAkNIMRUw +EwYDVQQKEwxTd2lzc1NpZ24gQUcxHzAdBgNVBAMTFlN3aXNzU2lnbiBHb2xkIENBIC0gRzIwHhcN +MDYxMDI1MDgzMDM1WhcNMzYxMDI1MDgzMDM1WjBFMQswCQYDVQQGEwJDSDEVMBMGA1UEChMMU3dp +c3NTaWduIEFHMR8wHQYDVQQDExZTd2lzc1NpZ24gR29sZCBDQSAtIEcyMIICIjANBgkqhkiG9w0B +AQEFAAOCAg8AMIICCgKCAgEAr+TufoskDhJuqVAtFkQ7kpJcyrhdhJJCEyq8ZVeCQD5XJM1QiyUq +t2/876LQwB8CJEoTlo8jE+YoWACjR8cGp4QjK7u9lit/VcyLwVcfDmJlD909Vopz2q5+bbqBHH5C +jCA12UNNhPqE21Is8w4ndwtrvxEvcnifLtg+5hg3Wipy+dpikJKVyh+c6bM8K8vzARO/Ws/BtQpg +vd21mWRTuKCWs2/iJneRjOBiEAKfNA+k1ZIzUd6+jbqEemA8atufK+ze3gE/bk3lUIbLtK/tREDF +ylqM2tIrfKjuvqblCqoOpd8FUrdVxyJdMmqXl2MT28nbeTZ7hTpKxVKJ+STnnXepgv9VHKVxaSvR +AiTysybUa9oEVeXBCsdtMDeQKuSeFDNeFhdVxVu1yzSJkvGdJo+hB9TGsnhQ2wwMC3wLjEHXuend +jIj3o02yMszYF9rNt85mndT9Xv+9lz4pded+p2JYryU0pUHHPbwNUMoDAw8IWh+Vc3hiv69yFGkO +peUDDniOJihC8AcLYiAQZzlG+qkDzAQ4embvIIO1jEpWjpEA/I5cgt6IoMPiaG59je883WX0XaxR +7ySArqpWl2/5rX3aYT+YdzylkbYcjCbaZaIJbcHiVOO5ykxMgI93e2CaHt+28kgeDrpOVG2Y4OGi +GqJ3UM/EY5LsRxmd6+ZrzsECAwEAAaOBrDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUw +AwEB/zAdBgNVHQ4EFgQUWyV7lqRlUX64OfPAeGZe6Drn8O4wHwYDVR0jBBgwFoAUWyV7lqRlUX64 +OfPAeGZe6Drn8O4wRgYDVR0gBD8wPTA7BglghXQBWQECAQEwLjAsBggrBgEFBQcCARYgaHR0cDov +L3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBACe645R88a7A3hfm +5djV9VSwg/S7zV4Fe0+fdWavPOhWfvxyeDgD2StiGwC5+OlgzczOUYrHUDFu4Up+GC9pWbY9ZIEr +44OE5iKHjn3g7gKZYbge9LgriBIWhMIxkziWMaa5O1M/wySTVltpkuzFwbs4AOPsF6m43Md8AYOf +Mke6UiI0HTJ6CVanfCU2qT1L2sCCbwq7EsiHSycR+R4tx5M/nttfJmtS2S6K8RTGRI0Vqbe/vd6m +Gu6uLftIdxf+u+yvGPUqUfA5hJeVbG4bwyvEdGB5JbAKJ9/fXtI5z0V9QkvfsywexcZdylU6oJxp +mo/a77KwPJ+HbBIrZXAVUjEaJM9vMSNQH4xPjyPDdEFjHFWoFN0+4FFQz/EbMFYOkrCChdiDyyJk +vC24JdVUorgG6q2SpCSgwYa1ShNqR88uC1aVVMvOmttqtKay20EIhid392qgQmwLOM7XdVAyksLf +KzAiSNDVQTglXaTpXZ/GlHXQRf0wl0OPkKsKx4ZzYEppLd6leNcG2mqeSz53OiATIgHQv2ieY2Br +NU0LbbqhPcCT4H8js1WtciVORvnSFu+wZMEBnunKoGqYDs/YYPIvSbjkQuE4NRb0yG5P94FW6Lqj +viOvrv1vA+ACOzB2+httQc8Bsem4yWb02ybzOqR08kkkW8mw0FfB+j564ZfJ +-----END CERTIFICATE----- + +SwissSign Silver CA - G2 +======================== +-----BEGIN CERTIFICATE----- +MIIFvTCCA6WgAwIBAgIITxvUL1S7L0swDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCQ0gxFTAT +BgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMB4X +DTA2MTAyNTA4MzI0NloXDTM2MTAyNTA4MzI0NlowRzELMAkGA1UEBhMCQ0gxFTATBgNVBAoTDFN3 +aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMIICIjANBgkqhkiG +9w0BAQEFAAOCAg8AMIICCgKCAgEAxPGHf9N4Mfc4yfjDmUO8x/e8N+dOcbpLj6VzHVxumK4DV644 +N0MvFz0fyM5oEMF4rhkDKxD6LHmD9ui5aLlV8gREpzn5/ASLHvGiTSf5YXu6t+WiE7brYT7QbNHm ++/pe7R20nqA1W6GSy/BJkv6FCgU+5tkL4k+73JU3/JHpMjUi0R86TieFnbAVlDLaYQ1HTWBCrpJH +6INaUFjpiou5XaHc3ZlKHzZnu0jkg7Y360g6rw9njxcH6ATK72oxh9TAtvmUcXtnZLi2kUpCe2Uu +MGoM9ZDulebyzYLs2aFK7PayS+VFheZteJMELpyCbTapxDFkH4aDCyr0NQp4yVXPQbBH6TCfmb5h +qAaEuSh6XzjZG6k4sIN/c8HDO0gqgg8hm7jMqDXDhBuDsz6+pJVpATqJAHgE2cn0mRmrVn5bi4Y5 +FZGkECwJMoBgs5PAKrYYC51+jUnyEEp/+dVGLxmSo5mnJqy7jDzmDrxHB9xzUfFwZC8I+bRHHTBs +ROopN4WSaGa8gzj+ezku01DwH/teYLappvonQfGbGHLy9YR0SslnxFSuSGTfjNFusB3hB48IHpmc +celM2KX3RxIfdNFRnobzwqIjQAtz20um53MGjMGg6cFZrEb65i/4z3GcRm25xBWNOHkDRUjvxF3X +CO6HOSKGsg0PWEP3calILv3q1h8CAwEAAaOBrDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/ +BAUwAwEB/zAdBgNVHQ4EFgQUF6DNweRBtjpbO8tFnb0cwpj6hlgwHwYDVR0jBBgwFoAUF6DNweRB +tjpbO8tFnb0cwpj6hlgwRgYDVR0gBD8wPTA7BglghXQBWQEDAQEwLjAsBggrBgEFBQcCARYgaHR0 +cDovL3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBAHPGgeAn0i0P +4JUw4ppBf1AsX19iYamGamkYDHRJ1l2E6kFSGG9YrVBWIGrGvShpWJHckRE1qTodvBqlYJ7YH39F +kWnZfrt4csEGDyrOj4VwYaygzQu4OSlWhDJOhrs9xCrZ1x9y7v5RoSJBsXECYxqCsGKrXlcSH9/L +3XWgwF15kIwb4FDm3jH+mHtwX6WQ2K34ArZv02DdQEsixT2tOnqfGhpHkXkzuoLcMmkDlm4fS/Bx +/uNncqCxv1yL5PqZIseEuRuNI5c/7SXgz2W79WEE790eslpBIlqhn10s6FvJbakMDHiqYMZWjwFa +DGi8aRl5xB9+lwW/xekkUV7U1UtT7dkjWjYDZaPBA61BMPNGG4WQr2W11bHkFlt4dR2Xem1ZqSqP +e97Dh4kQmUlzeMg9vVE1dCrV8X5pGyq7O70luJpaPXJhkGaH7gzWTdQRdAtq/gsD/KNVV4n+Ssuu +WxcFyPKNIzFTONItaj+CuY0IavdeQXRuwxF+B6wpYJE/OMpXEA29MC/HpeZBoNquBYeaoKRlbEwJ +DIm6uNO5wJOKMPqN5ZprFQFOZ6raYlY+hAhm0sQ2fac+EPyI4NSA5QC9qvNOBqN6avlicuMJT+ub +DgEj8Z+7fNzcbBGXJbLytGMU0gYqZ4yD9c7qB9iaah7s5Aq7KkzrCWA5zspi2C5u +-----END CERTIFICATE----- + +GeoTrust Primary Certification Authority +======================================== +-----BEGIN CERTIFICATE----- +MIIDfDCCAmSgAwIBAgIQGKy1av1pthU6Y2yv2vrEoTANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQG +EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjExMC8GA1UEAxMoR2VvVHJ1c3QgUHJpbWFyeSBD +ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjExMjcwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMFgx +CzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTEwLwYDVQQDEyhHZW9UcnVzdCBQ +cmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB +CgKCAQEAvrgVe//UfH1nrYNke8hCUy3f9oQIIGHWAVlqnEQRr+92/ZV+zmEwu3qDXwK9AWbK7hWN +b6EwnL2hhZ6UOvNWiAAxz9juapYC2e0DjPt1befquFUWBRaa9OBesYjAZIVcFU2Ix7e64HXprQU9 +nceJSOC7KMgD4TCTZF5SwFlwIjVXiIrxlQqD17wxcwE07e9GceBrAqg1cmuXm2bgyxx5X9gaBGge +RwLmnWDiNpcB3841kt++Z8dtd1k7j53WkBWUvEI0EME5+bEnPn7WinXFsq+W06Lem+SYvn3h6YGt +tm/81w7a4DSwDRp35+MImO9Y+pyEtzavwt+s0vQQBnBxNQIDAQABo0IwQDAPBgNVHRMBAf8EBTAD +AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQULNVQQZcVi/CPNmFbSvtr2ZnJM5IwDQYJKoZI +hvcNAQEFBQADggEBAFpwfyzdtzRP9YZRqSa+S7iq8XEN3GHHoOo0Hnp3DwQ16CePbJC/kRYkRj5K +Ts4rFtULUh38H2eiAkUxT87z+gOneZ1TatnaYzr4gNfTmeGl4b7UVXGYNTq+k+qurUKykG/g/CFN +NWMziUnWm07Kx+dOCQD32sfvmWKZd7aVIl6KoKv0uHiYyjgZmclynnjNS6yvGaBzEi38wkG6gZHa +Floxt/m0cYASSJlyc1pZU8FjUjPtp8nSOQJw+uCxQmYpqptR7TBUIhRf2asdweSU8Pj1K/fqynhG +1riR/aYNKxoUAT6A8EKglQdebc3MS6RFjasS6LPeWuWgfOgPIh1a6Vk= +-----END CERTIFICATE----- + +thawte Primary Root CA +====================== +-----BEGIN CERTIFICATE----- +MIIEIDCCAwigAwIBAgIQNE7VVyDV7exJ9C/ON9srbTANBgkqhkiG9w0BAQUFADCBqTELMAkGA1UE +BhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2 +aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhv +cml6ZWQgdXNlIG9ubHkxHzAdBgNVBAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwHhcNMDYxMTE3 +MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCBqTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwg +SW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMv +KGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxHzAdBgNVBAMT +FnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCs +oPD7gFnUnMekz52hWXMJEEUMDSxuaPFsW0hoSVk3/AszGcJ3f8wQLZU0HObrTQmnHNK4yZc2AreJ +1CRfBsDMRJSUjQJib+ta3RGNKJpchJAQeg29dGYvajig4tVUROsdB58Hum/u6f1OCyn1PoSgAfGc +q/gcfomk6KHYcWUNo1F77rzSImANuVud37r8UVsLr5iy6S7pBOhih94ryNdOwUxkHt3Ph1i6Sk/K +aAcdHJ1KxtUvkcx8cXIcxcBn6zL9yZJclNqFwJu/U30rCfSMnZEfl2pSy94JNqR32HuHUETVPm4p +afs5SSYeCaWAe0At6+gnhcn+Yf1+5nyXHdWdAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYD +VR0PAQH/BAQDAgEGMB0GA1UdDgQWBBR7W0XPr87Lev0xkhpqtvNG61dIUDANBgkqhkiG9w0BAQUF +AAOCAQEAeRHAS7ORtvzw6WfUDW5FvlXok9LOAz/t2iWwHVfLHjp2oEzsUHboZHIMpKnxuIvW1oeE +uzLlQRHAd9mzYJ3rG9XRbkREqaYB7FViHXe4XI5ISXycO1cRrK1zN44veFyQaEfZYGDm/Ac9IiAX +xPcW6cTYcvnIc3zfFi8VqT79aie2oetaupgf1eNNZAqdE8hhuvU5HIe6uL17In/2/qxAeeWsEG89 +jxt5dovEN7MhGITlNgDrYyCZuen+MwS7QcjBAvlEYyCegc5C09Y/LHbTY5xZ3Y+m4Q6gLkH3LpVH +z7z9M/P2C2F+fpErgUfCJzDupxBdN49cOSvkBPB7jVaMaA== +-----END CERTIFICATE----- + +VeriSign Class 3 Public Primary Certification Authority - G5 +============================================================ +-----BEGIN CERTIFICATE----- +MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCByjELMAkGA1UE +BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO +ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk +IHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRp +ZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCB +yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2ln +biBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBh +dXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmlt +YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw +ggEKAoIBAQCvJAgIKXo1nmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKz +j/i5Vbext0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIzSdhD +Y2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQGBO+QueQA5N06tRn/ +Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+rCpSx4/VBEnkjWNHiDxpg8v+R70r +fk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/NIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/ +BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2Uv +Z2lmMCEwHzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy +aXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKvMzEzMA0GCSqG +SIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzEp6B4Eq1iDkVwZMXnl2YtmAl+ +X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKE +KQsTb47bDN0lAtukixlE0kF6BWlKWE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiC +Km0oHw0LxOXnGiYZ4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vE +ZV8NhnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq +-----END CERTIFICATE----- + +SecureTrust CA +============== +-----BEGIN CERTIFICATE----- +MIIDuDCCAqCgAwIBAgIQDPCOXAgWpa1Cf/DrJxhZ0DANBgkqhkiG9w0BAQUFADBIMQswCQYDVQQG +EwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xFzAVBgNVBAMTDlNlY3VyZVRy +dXN0IENBMB4XDTA2MTEwNzE5MzExOFoXDTI5MTIzMTE5NDA1NVowSDELMAkGA1UEBhMCVVMxIDAe +BgNVBAoTF1NlY3VyZVRydXN0IENvcnBvcmF0aW9uMRcwFQYDVQQDEw5TZWN1cmVUcnVzdCBDQTCC +ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKukgeWVzfX2FI7CT8rU4niVWJxB4Q2ZQCQX +OZEzZum+4YOvYlyJ0fwkW2Gz4BERQRwdbvC4u/jep4G6pkjGnx29vo6pQT64lO0pGtSO0gMdA+9t +DWccV9cGrcrI9f4Or2YlSASWC12juhbDCE/RRvgUXPLIXgGZbf2IzIaowW8xQmxSPmjL8xk037uH +GFaAJsTQ3MBv396gwpEWoGQRS0S8Hvbn+mPeZqx2pHGj7DaUaHp3pLHnDi+BeuK1cobvomuL8A/b +01k/unK8RCSc43Oz969XL0Imnal0ugBS8kvNU3xHCzaFDmapCJcWNFfBZveA4+1wVMeT4C4oFVmH +ursCAwEAAaOBnTCBmjATBgkrBgEEAYI3FAIEBh4EAEMAQTALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/ +BAUwAwEB/zAdBgNVHQ4EFgQUQjK2FvoE/f5dS3rD/fdMQB1aQ68wNAYDVR0fBC0wKzApoCegJYYj +aHR0cDovL2NybC5zZWN1cmV0cnVzdC5jb20vU1RDQS5jcmwwEAYJKwYBBAGCNxUBBAMCAQAwDQYJ +KoZIhvcNAQEFBQADggEBADDtT0rhWDpSclu1pqNlGKa7UTt36Z3q059c4EVlew3KW+JwULKUBRSu +SceNQQcSc5R+DCMh/bwQf2AQWnL1mA6s7Ll/3XpvXdMc9P+IBWlCqQVxyLesJugutIxq/3HcuLHf +mbx8IVQr5Fiiu1cprp6poxkmD5kuCLDv/WnPmRoJjeOnnyvJNjR7JLN4TJUXpAYmHrZkUjZfYGfZ +nMUFdAvnZyPSCPyI6a6Lf+Ew9Dd+/cYy2i2eRDAwbO4H3tI0/NL/QPZL9GZGBlSm8jIKYyYwa5vR +3ItHuuG51WLQoqD0ZwV4KWMabwTW+MZMo5qxN7SN5ShLHZ4swrhovO0C7jE= +-----END CERTIFICATE----- + +Secure Global CA +================ +-----BEGIN CERTIFICATE----- +MIIDvDCCAqSgAwIBAgIQB1YipOjUiolN9BPI8PjqpTANBgkqhkiG9w0BAQUFADBKMQswCQYDVQQG +EwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBH +bG9iYWwgQ0EwHhcNMDYxMTA3MTk0MjI4WhcNMjkxMjMxMTk1MjA2WjBKMQswCQYDVQQGEwJVUzEg +MB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBHbG9iYWwg +Q0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvNS7YrGxVaQZx5RNoJLNP2MwhR/jx +YDiJiQPpvepeRlMJ3Fz1Wuj3RSoC6zFh1ykzTM7HfAo3fg+6MpjhHZevj8fcyTiW89sa/FHtaMbQ +bqR8JNGuQsiWUGMu4P51/pinX0kuleM5M2SOHqRfkNJnPLLZ/kG5VacJjnIFHovdRIWCQtBJwB1g +8NEXLJXr9qXBkqPFwqcIYA1gBBCWeZ4WNOaptvolRTnIHmX5k/Wq8VLcmZg9pYYaDDUz+kulBAYV +HDGA76oYa8J719rO+TMg1fW9ajMtgQT7sFzUnKPiXB3jqUJ1XnvUd+85VLrJChgbEplJL4hL/VBi +0XPnj3pDAgMBAAGjgZ0wgZowEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1Ud +EwEB/wQFMAMBAf8wHQYDVR0OBBYEFK9EBMJBfkiD2045AuzshHrmzsmkMDQGA1UdHwQtMCswKaAn +oCWGI2h0dHA6Ly9jcmwuc2VjdXJldHJ1c3QuY29tL1NHQ0EuY3JsMBAGCSsGAQQBgjcVAQQDAgEA +MA0GCSqGSIb3DQEBBQUAA4IBAQBjGghAfaReUw132HquHw0LURYD7xh8yOOvaliTFGCRsoTciE6+ +OYo68+aCiV0BN7OrJKQVDpI1WkpEXk5X+nXOH0jOZvQ8QCaSmGwb7iRGDBezUqXbpZGRzzfTb+cn +CDpOGR86p1hcF895P4vkp9MmI50mD1hp/Ed+stCNi5O/KU9DaXR2Z0vPB4zmAve14bRDtUstFJ/5 +3CYNv6ZHdAbYiNE6KTCEztI5gGIbqMdXSbxqVVFnFUq+NQfk1XWYN3kwFNspnWzFacxHVaIw98xc +f8LDmBxrThaA63p4ZUWiABqvDA1VZDRIuJK58bRQKfJPIx/abKwfROHdI3hRW8cW +-----END CERTIFICATE----- + +COMODO Certification Authority +============================== +-----BEGIN CERTIFICATE----- +MIIEHTCCAwWgAwIBAgIQToEtioJl4AsC7j41AkblPTANBgkqhkiG9w0BAQUFADCBgTELMAkGA1UE +BhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgG +A1UEChMRQ09NT0RPIENBIExpbWl0ZWQxJzAlBgNVBAMTHkNPTU9ETyBDZXJ0aWZpY2F0aW9uIEF1 +dGhvcml0eTAeFw0wNjEyMDEwMDAwMDBaFw0yOTEyMzEyMzU5NTlaMIGBMQswCQYDVQQGEwJHQjEb +MBkGA1UECBMSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRowGAYDVQQKExFD +T01PRE8gQ0EgTGltaXRlZDEnMCUGA1UEAxMeQ09NT0RPIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0ECLi3LjkRv3UcEbVASY06m/weaKXTuH ++7uIzg3jLz8GlvCiKVCZrts7oVewdFFxze1CkU1B/qnI2GqGd0S7WWaXUF601CxwRM/aN5VCaTww +xHGzUvAhTaHYujl8HJ6jJJ3ygxaYqhZ8Q5sVW7euNJH+1GImGEaaP+vB+fGQV+useg2L23IwambV +4EajcNxo2f8ESIl33rXp+2dtQem8Ob0y2WIC8bGoPW43nOIv4tOiJovGuFVDiOEjPqXSJDlqR6sA +1KGzqSX+DT+nHbrTUcELpNqsOO9VUCQFZUaTNE8tja3G1CEZ0o7KBWFxB3NH5YoZEr0ETc5OnKVI +rLsm9wIDAQABo4GOMIGLMB0GA1UdDgQWBBQLWOWLxkwVN6RAqTCpIb5HNlpW/zAOBgNVHQ8BAf8E +BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zBJBgNVHR8EQjBAMD6gPKA6hjhodHRwOi8vY3JsLmNvbW9k +b2NhLmNvbS9DT01PRE9DZXJ0aWZpY2F0aW9uQXV0aG9yaXR5LmNybDANBgkqhkiG9w0BAQUFAAOC +AQEAPpiem/Yb6dc5t3iuHXIYSdOH5EOC6z/JqvWote9VfCFSZfnVDeFs9D6Mk3ORLgLETgdxb8CP +OGEIqB6BCsAvIC9Bi5HcSEW88cbeunZrM8gALTFGTO3nnc+IlP8zwFboJIYmuNg4ON8qa90SzMc/ +RxdMosIGlgnW2/4/PEZB31jiVg88O8EckzXZOFKs7sjsLjBOlDW0JB9LeGna8gI4zJVSk/BwJVmc +IGfE7vmLV2H0knZ9P4SNVbfo5azV8fUZVqZa+5Acr5Pr5RzUZ5ddBA6+C4OmF4O5MBKgxTMVBbkN ++8cFduPYSo38NBejxiEovjBFMR7HeL5YYTisO+IBZQ== +-----END CERTIFICATE----- + +Network Solutions Certificate Authority +======================================= +-----BEGIN CERTIFICATE----- +MIID5jCCAs6gAwIBAgIQV8szb8JcFuZHFhfjkDFo4DANBgkqhkiG9w0BAQUFADBiMQswCQYDVQQG +EwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMuMTAwLgYDVQQDEydOZXR3b3Jr +IFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDYxMjAxMDAwMDAwWhcNMjkxMjMx +MjM1OTU5WjBiMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMu +MTAwLgYDVQQDEydOZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0G +CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDkvH6SMG3G2I4rC7xGzuAnlt7e+foS0zwzc7MEL7xx +jOWftiJgPl9dzgn/ggwbmlFQGiaJ3dVhXRncEg8tCqJDXRfQNJIg6nPPOCwGJgl6cvf6UDL4wpPT +aaIjzkGxzOTVHzbRijr4jGPiFFlp7Q3Tf2vouAPlT2rlmGNpSAW+Lv8ztumXWWn4Zxmuk2GWRBXT +crA/vGp97Eh/jcOrqnErU2lBUzS1sLnFBgrEsEX1QV1uiUV7PTsmjHTC5dLRfbIR1PtYMiKagMnc +/Qzpf14Dl847ABSHJ3A4qY5usyd2mFHgBeMhqxrVhSI8KbWaFsWAqPS7azCPL0YCorEMIuDTAgMB +AAGjgZcwgZQwHQYDVR0OBBYEFCEwyfsA106Y2oeqKtCnLrFAMadMMA4GA1UdDwEB/wQEAwIBBjAP +BgNVHRMBAf8EBTADAQH/MFIGA1UdHwRLMEkwR6BFoEOGQWh0dHA6Ly9jcmwubmV0c29sc3NsLmNv +bS9OZXR3b3JrU29sdXRpb25zQ2VydGlmaWNhdGVBdXRob3JpdHkuY3JsMA0GCSqGSIb3DQEBBQUA +A4IBAQC7rkvnt1frf6ott3NHhWrB5KUd5Oc86fRZZXe1eltajSU24HqXLjjAV2CDmAaDn7l2em5Q +4LqILPxFzBiwmZVRDuwduIj/h1AcgsLj4DKAv6ALR8jDMe+ZZzKATxcheQxpXN5eNK4CtSbqUN9/ +GGUsyfJj4akH/nxxH2szJGoeBfcFaMBqEssuXmHLrijTfsK0ZpEmXzwuJF/LWA/rKOyvEZbz3Htv +wKeI8lN3s2Berq4o2jUsbzRF0ybh3uxbTydrFny9RAQYgrOJeRcQcT16ohZO9QHNpGxlaKFJdlxD +ydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey +-----END CERTIFICATE----- + +WellsSecure Public Root Certificate Authority +============================================= +-----BEGIN CERTIFICATE----- +MIIEvTCCA6WgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoM +F1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYw +NAYDVQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcN +MDcxMjEzMTcwNzU0WhcNMjIxMjE0MDAwNzU0WjCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoMF1dl +bGxzIEZhcmdvIFdlbGxzU2VjdXJlMRwwGgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYwNAYD +VQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0G +CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDub7S9eeKPCCGeOARBJe+rWxxTkqxtnt3CxC5FlAM1 +iGd0V+PfjLindo8796jE2yljDpFoNoqXjopxaAkH5OjUDk/41itMpBb570OYj7OeUt9tkTmPOL13 +i0Nj67eT/DBMHAGTthP796EfvyXhdDcsHqRePGj4S78NuR4uNuip5Kf4D8uCdXw1LSLWwr8L87T8 +bJVhHlfXBIEyg1J55oNjz7fLY4sR4r1e6/aN7ZVyKLSsEmLpSjPmgzKuBXWVvYSV2ypcm44uDLiB +K0HmOFafSZtsdvqKXfcBeYF8wYNABf5x/Qw/zE5gCQ5lRxAvAcAFP4/4s0HvWkJ+We/SlwxlAgMB +AAGjggE0MIIBMDAPBgNVHRMBAf8EBTADAQH/MDkGA1UdHwQyMDAwLqAsoCqGKGh0dHA6Ly9jcmwu +cGtpLndlbGxzZmFyZ28uY29tL3dzcHJjYS5jcmwwDgYDVR0PAQH/BAQDAgHGMB0GA1UdDgQWBBQm +lRkQ2eihl5H/3BnZtQQ+0nMKajCBsgYDVR0jBIGqMIGngBQmlRkQ2eihl5H/3BnZtQQ+0nMKaqGB +i6SBiDCBhTELMAkGA1UEBhMCVVMxIDAeBgNVBAoMF1dlbGxzIEZhcmdvIFdlbGxzU2VjdXJlMRww +GgYDVQQLDBNXZWxscyBGYXJnbyBCYW5rIE5BMTYwNAYDVQQDDC1XZWxsc1NlY3VyZSBQdWJsaWMg +Um9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHmCAQEwDQYJKoZIhvcNAQEFBQADggEBALkVsUSRzCPI +K0134/iaeycNzXK7mQDKfGYZUMbVmO2rvwNa5U3lHshPcZeG1eMd/ZDJPHV3V3p9+N701NX3leZ0 +bh08rnyd2wIDBSxxSyU+B+NemvVmFymIGjifz6pBA4SXa5M4esowRBskRDPQ5NHcKDj0E0M1NSlj +qHyita04pO2t/caaH/+Xc/77szWnk4bGdpEA5qxRFsQnMlzbc9qlk1eOPm01JghZ1edE13YgY+es +E2fDbbFwRnzVlhE9iW9dqKHrjQrawx0zbKPqZxmamX9LPYNRKh3KL4YMon4QLSvUFpULB6ouFJJJ +tylv2G0xffX8oRAHh84vWdw+WNs= +-----END CERTIFICATE----- + +COMODO ECC Certification Authority +================================== +-----BEGIN CERTIFICATE----- +MIICiTCCAg+gAwIBAgIQH0evqmIAcFBUTAGem2OZKjAKBggqhkjOPQQDAzCBhTELMAkGA1UEBhMC +R0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UE +ChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBB +dXRob3JpdHkwHhcNMDgwMzA2MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0Ix +GzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR +Q09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBBdXRo +b3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQDR3svdcmCFYX7deSRFtSrYpn1PlILBs5BAH+X +4QokPB0BBO490o0JlwzgdeT6+3eKKvUDYEs2ixYjFq0JcfRK9ChQtP6IHG4/bC8vCVlbpVsLM5ni +wz2J+Wos77LTBumjQjBAMB0GA1UdDgQWBBR1cacZSBm8nZ3qQUfflMRId5nTeTAOBgNVHQ8BAf8E +BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjEA7wNbeqy3eApyt4jf/7VG +FAkK+qDmfQjGGoe9GKhzvSbKYAydzpmfz1wPMOG+FDHqAjAU9JM8SaczepBGR7NjfRObTrdvGDeA +U/7dIOA1mjbRxwG55tzd8/8dLDoWV9mSOdY= +-----END CERTIFICATE----- + +IGC/A +===== +-----BEGIN CERTIFICATE----- +MIIEAjCCAuqgAwIBAgIFORFFEJQwDQYJKoZIhvcNAQEFBQAwgYUxCzAJBgNVBAYTAkZSMQ8wDQYD +VQQIEwZGcmFuY2UxDjAMBgNVBAcTBVBhcmlzMRAwDgYDVQQKEwdQTS9TR0ROMQ4wDAYDVQQLEwVE +Q1NTSTEOMAwGA1UEAxMFSUdDL0ExIzAhBgkqhkiG9w0BCQEWFGlnY2FAc2dkbi5wbS5nb3V2LmZy +MB4XDTAyMTIxMzE0MjkyM1oXDTIwMTAxNzE0MjkyMlowgYUxCzAJBgNVBAYTAkZSMQ8wDQYDVQQI +EwZGcmFuY2UxDjAMBgNVBAcTBVBhcmlzMRAwDgYDVQQKEwdQTS9TR0ROMQ4wDAYDVQQLEwVEQ1NT +STEOMAwGA1UEAxMFSUdDL0ExIzAhBgkqhkiG9w0BCQEWFGlnY2FAc2dkbi5wbS5nb3V2LmZyMIIB +IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsh/R0GLFMzvABIaIs9z4iPf930Pfeo2aSVz2 +TqrMHLmh6yeJ8kbpO0px1R2OLc/mratjUMdUC24SyZA2xtgv2pGqaMVy/hcKshd+ebUyiHDKcMCW +So7kVc0dJ5S/znIq7Fz5cyD+vfcuiWe4u0dzEvfRNWk68gq5rv9GQkaiv6GFGvm/5P9JhfejcIYy +HF2fYPepraX/z9E0+X1bF8bc1g4oa8Ld8fUzaJ1O/Id8NhLWo4DoQw1VYZTqZDdH6nfK0LJYBcNd +frGoRpAxVs5wKpayMLh35nnAvSk7/ZR3TL0gzUEl4C7HG7vupARB0l2tEmqKm0f7yd1GQOGdPDPQ +tQIDAQABo3cwdTAPBgNVHRMBAf8EBTADAQH/MAsGA1UdDwQEAwIBRjAVBgNVHSAEDjAMMAoGCCqB +egF5AQEBMB0GA1UdDgQWBBSjBS8YYFDCiQrdKyFP/45OqDAxNjAfBgNVHSMEGDAWgBSjBS8YYFDC +iQrdKyFP/45OqDAxNjANBgkqhkiG9w0BAQUFAAOCAQEABdwm2Pp3FURo/C9mOnTgXeQp/wYHE4RK +q89toB9RlPhJy3Q2FLwV3duJL92PoF189RLrn544pEfMs5bZvpwlqwN+Mw+VgQ39FuCIvjfwbF3Q +MZsyK10XZZOYYLxuj7GoPB7ZHPOpJkL5ZB3C55L29B5aqhlSXa/oovdgoPaN8In1buAKBQGVyYsg +Crpa/JosPL3Dt8ldeCUFP1YUmwza+zpI/pdpXsoQhvdOlgQITeywvl3cO45Pwf2aNjSaTFR+FwNI +lQgRHAdvhQh+XU3Endv7rs6y0bO4g2wdsrN58dhwmX7wEwLOXt1R0982gaEbeC9xs/FZTEYYKKuF +0mBWWg== +-----END CERTIFICATE----- + +Security Communication EV RootCA1 +================================= +-----BEGIN CERTIFICATE----- +MIIDfTCCAmWgAwIBAgIBADANBgkqhkiG9w0BAQUFADBgMQswCQYDVQQGEwJKUDElMCMGA1UEChMc +U0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEqMCgGA1UECxMhU2VjdXJpdHkgQ29tbXVuaWNh +dGlvbiBFViBSb290Q0ExMB4XDTA3MDYwNjAyMTIzMloXDTM3MDYwNjAyMTIzMlowYDELMAkGA1UE +BhMCSlAxJTAjBgNVBAoTHFNFQ09NIFRydXN0IFN5c3RlbXMgQ08uLExURC4xKjAoBgNVBAsTIVNl +Y3VyaXR5IENvbW11bmljYXRpb24gRVYgUm9vdENBMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBALx/7FebJOD+nLpCeamIivqA4PUHKUPqjgo0No0c+qe1OXj/l3X3L+SqawSERMqm4miO +/VVQYg+kcQ7OBzgtQoVQrTyWb4vVog7P3kmJPdZkLjjlHmy1V4qe70gOzXppFodEtZDkBp2uoQSX +WHnvIEqCa4wiv+wfD+mEce3xDuS4GBPMVjZd0ZoeUWs5bmB2iDQL87PRsJ3KYeJkHcFGB7hj3R4z +ZbOOCVVSPbW9/wfrrWFVGCypaZhKqkDFMxRldAD5kd6vA0jFQFTcD4SQaCDFkpbcLuUCRarAX1T4 +bepJz11sS6/vmsJWXMY1VkJqMF/Cq/biPT+zyRGPMUzXn0kCAwEAAaNCMEAwHQYDVR0OBBYEFDVK +9U2vP9eCOKyrcWUXdYydVZPmMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqG +SIb3DQEBBQUAA4IBAQCoh+ns+EBnXcPBZsdAS5f8hxOQWsTvoMpfi7ent/HWtWS3irO4G8za+6xm +iEHO6Pzk2x6Ipu0nUBsCMCRGef4Eh3CXQHPRwMFXGZpppSeZq51ihPZRwSzJIxXYKLerJRO1RuGG +Av8mjMSIkh1W/hln8lXkgKNrnKt34VFxDSDbEJrbvXZ5B3eZKK2aXtqxT0QsNY6llsf9g/BYxnnW +mHyojf6GPgcWkuF75x3sM3Z+Qi5KhfmRiWiEA4Glm5q+4zfFVKtWOxgtQaQM+ELbmaDgcm+7XeEW +T1MKZPlO9L9OVL14bIjqv5wTJMJwaaJ/D8g8rQjJsJhAoyrniIPtd490 +-----END CERTIFICATE----- + +OISTE WISeKey Global Root GA CA +=============================== +-----BEGIN CERTIFICATE----- +MIID8TCCAtmgAwIBAgIQQT1yx/RrH4FDffHSKFTfmjANBgkqhkiG9w0BAQUFADCBijELMAkGA1UE +BhMCQ0gxEDAOBgNVBAoTB1dJU2VLZXkxGzAZBgNVBAsTEkNvcHlyaWdodCAoYykgMjAwNTEiMCAG +A1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNlZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBH +bG9iYWwgUm9vdCBHQSBDQTAeFw0wNTEyMTExNjAzNDRaFw0zNzEyMTExNjA5NTFaMIGKMQswCQYD +VQQGEwJDSDEQMA4GA1UEChMHV0lTZUtleTEbMBkGA1UECxMSQ29weXJpZ2h0IChjKSAyMDA1MSIw +IAYDVQQLExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBXSVNlS2V5 +IEdsb2JhbCBSb290IEdBIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy0+zAJs9 +Nt350UlqaxBJH+zYK7LG+DKBKUOVTJoZIyEVRd7jyBxRVVuuk+g3/ytr6dTqvirdqFEr12bDYVxg +Asj1znJ7O7jyTmUIms2kahnBAbtzptf2w93NvKSLtZlhuAGio9RN1AU9ka34tAhxZK9w8RxrfvbD +d50kc3vkDIzh2TbhmYsFmQvtRTEJysIA2/dyoJaqlYfQjse2YXMNdmaM3Bu0Y6Kff5MTMPGhJ9vZ +/yxViJGg4E8HsChWjBgbl0SOid3gF27nKu+POQoxhILYQBRJLnpB5Kf+42TMwVlxSywhp1t94B3R +LoGbw9ho972WG6xwsRYUC9tguSYBBQIDAQABo1EwTzALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUw +AwEB/zAdBgNVHQ4EFgQUswN+rja8sHnR3JQmthG+IbJphpQwEAYJKwYBBAGCNxUBBAMCAQAwDQYJ +KoZIhvcNAQEFBQADggEBAEuh/wuHbrP5wUOxSPMowB0uyQlB+pQAHKSkq0lPjz0e701vvbyk9vIm +MMkQyh2I+3QZH4VFvbBsUfk2ftv1TDI6QU9bR8/oCy22xBmddMVHxjtqD6wU2zz0c5ypBd8A3HR4 ++vg1YFkCExh8vPtNsCBtQ7tgMHpnM1zFmdH4LTlSc/uMqpclXHLZCB6rTjzjgTGfA6b7wP4piFXa +hNVQA7bihKOmNqoROgHhGEvWRGizPflTdISzRpFGlgC3gCy24eMQ4tui5yiPAZZiFj4A4xylNoEY +okxSdsARo27mHbrjWr42U8U+dY+GaSlYU7Wcu2+fXMUY7N0v4ZjJ/L7fCg0= +-----END CERTIFICATE----- + +S-TRUST Authentication and Encryption Root CA 2005 PN +===================================================== +-----BEGIN CERTIFICATE----- +MIIEezCCA2OgAwIBAgIQNxkY5lNUfBq1uMtZWts1tzANBgkqhkiG9w0BAQUFADCBrjELMAkGA1UE +BhMCREUxIDAeBgNVBAgTF0JhZGVuLVd1ZXJ0dGVtYmVyZyAoQlcpMRIwEAYDVQQHEwlTdHV0dGdh +cnQxKTAnBgNVBAoTIERldXRzY2hlciBTcGFya2Fzc2VuIFZlcmxhZyBHbWJIMT4wPAYDVQQDEzVT +LVRSVVNUIEF1dGhlbnRpY2F0aW9uIGFuZCBFbmNyeXB0aW9uIFJvb3QgQ0EgMjAwNTpQTjAeFw0w +NTA2MjIwMDAwMDBaFw0zMDA2MjEyMzU5NTlaMIGuMQswCQYDVQQGEwJERTEgMB4GA1UECBMXQmFk +ZW4tV3VlcnR0ZW1iZXJnIChCVykxEjAQBgNVBAcTCVN0dXR0Z2FydDEpMCcGA1UEChMgRGV1dHNj +aGVyIFNwYXJrYXNzZW4gVmVybGFnIEdtYkgxPjA8BgNVBAMTNVMtVFJVU1QgQXV0aGVudGljYXRp +b24gYW5kIEVuY3J5cHRpb24gUm9vdCBDQSAyMDA1OlBOMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEA2bVKwdMz6tNGs9HiTNL1toPQb9UY6ZOvJ44TzbUlNlA0EmQpoVXhOmCTnijJ4/Ob +4QSwI7+Vio5bG0F/WsPoTUzVJBY+h0jUJ67m91MduwwA7z5hca2/OnpYH5Q9XIHV1W/fuJvS9eXL +g3KSwlOyggLrra1fFi2SU3bxibYs9cEv4KdKb6AwajLrmnQDaHgTncovmwsdvs91DSaXm8f1Xgqf +eN+zvOyauu9VjxuapgdjKRdZYgkqeQd3peDRF2npW932kKvimAoA0SVtnteFhy+S8dF2g08LOlk3 +KC8zpxdQ1iALCvQm+Z845y2kuJuJja2tyWp9iRe79n+Ag3rm7QIDAQABo4GSMIGPMBIGA1UdEwEB +/wQIMAYBAf8CAQAwDgYDVR0PAQH/BAQDAgEGMCkGA1UdEQQiMCCkHjAcMRowGAYDVQQDExFTVFJv +bmxpbmUxLTIwNDgtNTAdBgNVHQ4EFgQUD8oeXHngovMpttKFswtKtWXsa1IwHwYDVR0jBBgwFoAU +D8oeXHngovMpttKFswtKtWXsa1IwDQYJKoZIhvcNAQEFBQADggEBAK8B8O0ZPCjoTVy7pWMciDMD +pwCHpB8gq9Yc4wYfl35UvbfRssnV2oDsF9eK9XvCAPbpEW+EoFolMeKJ+aQAPzFoLtU96G7m1R08 +P7K9n3frndOMusDXtk3sU5wPBG7qNWdX4wple5A64U8+wwCSersFiXOMy6ZNwPv2AtawB6MDwidA +nwzkhYItr5pCHdDHjfhA7p0GVxzZotiAFP7hYy0yh9WUUpY6RsZxlj33mA6ykaqP2vROJAA5Veit +F7nTNCtKqUDMFypVZUF0Qn71wK/Ik63yGFs9iQzbRzkk+OBM8h+wPQrKBU6JIRrjKpms/H+h8Q8b +Hz2eBIPdltkdOpQ= +-----END CERTIFICATE----- + +Microsec e-Szigno Root CA +========================= +-----BEGIN CERTIFICATE----- +MIIHqDCCBpCgAwIBAgIRAMy4579OKRr9otxmpRwsDxEwDQYJKoZIhvcNAQEFBQAwcjELMAkGA1UE +BhMCSFUxETAPBgNVBAcTCEJ1ZGFwZXN0MRYwFAYDVQQKEw1NaWNyb3NlYyBMdGQuMRQwEgYDVQQL +EwtlLVN6aWdubyBDQTEiMCAGA1UEAxMZTWljcm9zZWMgZS1Temlnbm8gUm9vdCBDQTAeFw0wNTA0 +MDYxMjI4NDRaFw0xNzA0MDYxMjI4NDRaMHIxCzAJBgNVBAYTAkhVMREwDwYDVQQHEwhCdWRhcGVz +dDEWMBQGA1UEChMNTWljcm9zZWMgTHRkLjEUMBIGA1UECxMLZS1Temlnbm8gQ0ExIjAgBgNVBAMT +GU1pY3Jvc2VjIGUtU3ppZ25vIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIB +AQDtyADVgXvNOABHzNuEwSFpLHSQDCHZU4ftPkNEU6+r+ICbPHiN1I2uuO/TEdyB5s87lozWbxXG +d36hL+BfkrYn13aaHUM86tnsL+4582pnS4uCzyL4ZVX+LMsvfUh6PXX5qqAnu3jCBspRwn5mS6/N +oqdNAoI/gqyFxuEPkEeZlApxcpMqyabAvjxWTHOSJ/FrtfX9/DAFYJLG65Z+AZHCabEeHXtTRbjc +QR/Ji3HWVBTji1R4P770Yjtb9aPs1ZJ04nQw7wHb4dSrmZsqa/i9phyGI0Jf7Enemotb9HI6QMVJ +PqW+jqpx62z69Rrkav17fVVA71hu5tnVvCSrwe+3AgMBAAGjggQ3MIIEMzBnBggrBgEFBQcBAQRb +MFkwKAYIKwYBBQUHMAGGHGh0dHBzOi8vcmNhLmUtc3ppZ25vLmh1L29jc3AwLQYIKwYBBQUHMAKG +IWh0dHA6Ly93d3cuZS1zemlnbm8uaHUvUm9vdENBLmNydDAPBgNVHRMBAf8EBTADAQH/MIIBcwYD +VR0gBIIBajCCAWYwggFiBgwrBgEEAYGoGAIBAQEwggFQMCgGCCsGAQUFBwIBFhxodHRwOi8vd3d3 +LmUtc3ppZ25vLmh1L1NaU1ovMIIBIgYIKwYBBQUHAgIwggEUHoIBEABBACAAdABhAG4A+gBzAO0A +dAB2AOEAbgB5ACAA6QByAHQAZQBsAG0AZQB6AOkAcwDpAGgAZQB6ACAA6QBzACAAZQBsAGYAbwBn +AGEAZADhAHMA4QBoAG8AegAgAGEAIABTAHoAbwBsAGcA4QBsAHQAYQB0APMAIABTAHoAbwBsAGcA +4QBsAHQAYQB0AOEAcwBpACAAUwB6AGEAYgDhAGwAeQB6AGEAdABhACAAcwB6AGUAcgBpAG4AdAAg +AGsAZQBsAGwAIABlAGwAagDhAHIAbgBpADoAIABoAHQAdABwADoALwAvAHcAdwB3AC4AZQAtAHMA +egBpAGcAbgBvAC4AaAB1AC8AUwBaAFMAWgAvMIHIBgNVHR8EgcAwgb0wgbqggbeggbSGIWh0dHA6 +Ly93d3cuZS1zemlnbm8uaHUvUm9vdENBLmNybIaBjmxkYXA6Ly9sZGFwLmUtc3ppZ25vLmh1L0NO +PU1pY3Jvc2VjJTIwZS1Temlnbm8lMjBSb290JTIwQ0EsT1U9ZS1Temlnbm8lMjBDQSxPPU1pY3Jv +c2VjJTIwTHRkLixMPUJ1ZGFwZXN0LEM9SFU/Y2VydGlmaWNhdGVSZXZvY2F0aW9uTGlzdDtiaW5h +cnkwDgYDVR0PAQH/BAQDAgEGMIGWBgNVHREEgY4wgYuBEGluZm9AZS1zemlnbm8uaHWkdzB1MSMw +IQYDVQQDDBpNaWNyb3NlYyBlLVN6aWduw7MgUm9vdCBDQTEWMBQGA1UECwwNZS1TemlnbsOzIEhT +WjEWMBQGA1UEChMNTWljcm9zZWMgS2Z0LjERMA8GA1UEBxMIQnVkYXBlc3QxCzAJBgNVBAYTAkhV +MIGsBgNVHSMEgaQwgaGAFMegSXUWYYTbMUuE0vE3QJDvTtz3oXakdDByMQswCQYDVQQGEwJIVTER +MA8GA1UEBxMIQnVkYXBlc3QxFjAUBgNVBAoTDU1pY3Jvc2VjIEx0ZC4xFDASBgNVBAsTC2UtU3pp +Z25vIENBMSIwIAYDVQQDExlNaWNyb3NlYyBlLVN6aWdubyBSb290IENBghEAzLjnv04pGv2i3Gal +HCwPETAdBgNVHQ4EFgQUx6BJdRZhhNsxS4TS8TdAkO9O3PcwDQYJKoZIhvcNAQEFBQADggEBANMT +nGZjWS7KXHAM/IO8VbH0jgdsZifOwTsgqRy7RlRw7lrMoHfqaEQn6/Ip3Xep1fvj1KcExJW4C+FE +aGAHQzAxQmHl7tnlJNUb3+FKG6qfx1/4ehHqE5MAyopYse7tDk2016g2JnzgOsHVV4Lxdbb9iV/a +86g4nzUGCM4ilb7N1fy+W955a9x6qWVmvrElWl/tftOsRm1M9DKHtCAE4Gx4sHfRhUZLphK3dehK +yVZs15KrnfVJONJPU+NVkBHbmJbGSfI+9J8b4PeI3CVimUTYc78/MPMMNz7UwiiAc7EBt51alhQB +S6kRnSlqLtBdgcDPsiBDxwPgN05dCtxZICU= +-----END CERTIFICATE----- + +Certigna +======== +-----BEGIN CERTIFICATE----- +MIIDqDCCApCgAwIBAgIJAP7c4wEPyUj/MA0GCSqGSIb3DQEBBQUAMDQxCzAJBgNVBAYTAkZSMRIw +EAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hMB4XDTA3MDYyOTE1MTMwNVoXDTI3 +MDYyOTE1MTMwNVowNDELMAkGA1UEBhMCRlIxEjAQBgNVBAoMCURoaW15b3RpczERMA8GA1UEAwwI +Q2VydGlnbmEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDIaPHJ1tazNHUmgh7stL7q +XOEm7RFHYeGifBZ4QCHkYJ5ayGPhxLGWkv8YbWkj4Sti993iNi+RB7lIzw7sebYs5zRLcAglozyH +GxnygQcPOJAZ0xH+hrTy0V4eHpbNgGzOOzGTtvKg0KmVEn2lmsxryIRWijOp5yIVUxbwzBfsV1/p +ogqYCd7jX5xv3EjjhQsVWqa6n6xI4wmy9/Qy3l40vhx4XUJbzg4ij02Q130yGLMLLGq/jj8UEYkg +DncUtT2UCIf3JR7VsmAA7G8qKCVuKj4YYxclPz5EIBb2JsglrgVKtOdjLPOMFlN+XPsRGgjBRmKf +Irjxwo1p3Po6WAbfAgMBAAGjgbwwgbkwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUGu3+QTmQ +tCRZvgHyUtVF9lo53BEwZAYDVR0jBF0wW4AUGu3+QTmQtCRZvgHyUtVF9lo53BGhOKQ2MDQxCzAJ +BgNVBAYTAkZSMRIwEAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hggkA/tzjAQ/J +SP8wDgYDVR0PAQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIABzANBgkqhkiG9w0BAQUFAAOCAQEA +hQMeknH2Qq/ho2Ge6/PAD/Kl1NqV5ta+aDY9fm4fTIrv0Q8hbV6lUmPOEvjvKtpv6zf+EwLHyzs+ +ImvaYS5/1HI93TDhHkxAGYwP15zRgzB7mFncfca5DClMoTOi62c6ZYTTluLtdkVwj7Ur3vkj1klu +PBS1xp81HlDQwY9qcEQCYsuuHWhBp6pX6FOqB9IG9tUUBguRA3UsbHK1YZWaDYu5Def131TN3ubY +1gkIl2PlwS6wt0QmwCbAr1UwnjvVNioZBPRcHv/PLLf/0P2HQBHVESO7SMAhqaQoLf0V+LBOK/Qw +WyH8EZE0vkHve52Xdf+XlcCWWC/qu0bXu+TZLg== +-----END CERTIFICATE----- + +AC Ra\xC3\xADz Certic\xC3\xA1mara S.A. +====================================== +-----BEGIN CERTIFICATE----- +MIIGZjCCBE6gAwIBAgIPB35Sk3vgFeNX8GmMy+wMMA0GCSqGSIb3DQEBBQUAMHsxCzAJBgNVBAYT +AkNPMUcwRQYDVQQKDD5Tb2NpZWRhZCBDYW1lcmFsIGRlIENlcnRpZmljYWNpw7NuIERpZ2l0YWwg +LSBDZXJ0aWPDoW1hcmEgUy5BLjEjMCEGA1UEAwwaQUMgUmHDrXogQ2VydGljw6FtYXJhIFMuQS4w +HhcNMDYxMTI3MjA0NjI5WhcNMzAwNDAyMjE0MjAyWjB7MQswCQYDVQQGEwJDTzFHMEUGA1UECgw+ +U29jaWVkYWQgQ2FtZXJhbCBkZSBDZXJ0aWZpY2FjacOzbiBEaWdpdGFsIC0gQ2VydGljw6FtYXJh +IFMuQS4xIzAhBgNVBAMMGkFDIFJhw616IENlcnRpY8OhbWFyYSBTLkEuMIICIjANBgkqhkiG9w0B +AQEFAAOCAg8AMIICCgKCAgEAq2uJo1PMSCMI+8PPUZYILrgIem08kBeGqentLhM0R7LQcNzJPNCN +yu5LF6vQhbCnIwTLqKL85XXbQMpiiY9QngE9JlsYhBzLfDe3fezTf3MZsGqy2IiKLUV0qPezuMDU +2s0iiXRNWhU5cxh0T7XrmafBHoi0wpOQY5fzp6cSsgkiBzPZkc0OnB8OIMfuuzONj8LSWKdf/WU3 +4ojC2I+GdV75LaeHM/J4Ny+LvB2GNzmxlPLYvEqcgxhaBvzz1NS6jBUJJfD5to0EfhcSM2tXSExP +2yYe68yQ54v5aHxwD6Mq0Do43zeX4lvegGHTgNiRg0JaTASJaBE8rF9ogEHMYELODVoqDA+bMMCm +8Ibbq0nXl21Ii/kDwFJnmxL3wvIumGVC2daa49AZMQyth9VXAnow6IYm+48jilSH5L887uvDdUhf +HjlvgWJsxS3EF1QZtzeNnDeRyPYL1epjb4OsOMLzP96a++EjYfDIJss2yKHzMI+ko6Kh3VOz3vCa +Mh+DkXkwwakfU5tTohVTP92dsxA7SH2JD/ztA/X7JWR1DhcZDY8AFmd5ekD8LVkH2ZD6mq093ICK +5lw1omdMEWux+IBkAC1vImHFrEsm5VoQgpukg3s0956JkSCXjrdCx2bD0Omk1vUgjcTDlaxECp1b +czwmPS9KvqfJpxAe+59QafMCAwEAAaOB5jCB4zAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQE +AwIBBjAdBgNVHQ4EFgQU0QnQ6dfOeXRU+Tows/RtLAMDG2gwgaAGA1UdIASBmDCBlTCBkgYEVR0g +ADCBiTArBggrBgEFBQcCARYfaHR0cDovL3d3dy5jZXJ0aWNhbWFyYS5jb20vZHBjLzBaBggrBgEF +BQcCAjBOGkxMaW1pdGFjaW9uZXMgZGUgZ2FyYW507WFzIGRlIGVzdGUgY2VydGlmaWNhZG8gc2Ug +cHVlZGVuIGVuY29udHJhciBlbiBsYSBEUEMuMA0GCSqGSIb3DQEBBQUAA4ICAQBclLW4RZFNjmEf +AygPU3zmpFmps4p6xbD/CHwso3EcIRNnoZUSQDWDg4902zNc8El2CoFS3UnUmjIz75uny3XlesuX +EpBcunvFm9+7OSPI/5jOCk0iAUgHforA1SBClETvv3eiiWdIG0ADBaGJ7M9i4z0ldma/Jre7Ir5v +/zlXdLp6yQGVwZVR6Kss+LGGIOk/yzVb0hfpKv6DExdA7ohiZVvVO2Dpezy4ydV/NgIlqmjCMRW3 +MGXrfx1IebHPOeJCgBbT9ZMj/EyXyVo3bHwi2ErN0o42gzmRkBDI8ck1fj+404HGIGQatlDCIaR4 +3NAvO2STdPCWkPHv+wlaNECW8DYSwaN0jJN+Qd53i+yG2dIPPy3RzECiiWZIHiCznCNZc6lEc7wk +eZBWN7PGKX6jD/EpOe9+XCgycDWs2rjIdWb8m0w5R44bb5tNAlQiM+9hup4phO9OSzNHdpdqy35f +/RWmnkJDW2ZaiogN9xa5P1FlK2Zqi9E4UqLWRhH6/JocdJ6PlwsCT2TG9WjTSy3/pDceiz+/RL5h +RqGEPQgnTIEgd4kI6mdAXmwIUV80WoyWaM3X94nCHNMyAK9Sy9NgWyo6R35rMDOhYil/SrnhLecU +Iw4OGEfhefwVVdCx/CVxY3UzHCMrr1zZ7Ud3YA47Dx7SwNxkBYn8eNZcLCZDqQ== +-----END CERTIFICATE----- + +TC TrustCenter Class 2 CA II +============================ +-----BEGIN CERTIFICATE----- +MIIEqjCCA5KgAwIBAgIOLmoAAQACH9dSISwRXDswDQYJKoZIhvcNAQEFBQAwdjELMAkGA1UEBhMC +REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNVBAsTGVRDIFRydXN0Q2VudGVy +IENsYXNzIDIgQ0ExJTAjBgNVBAMTHFRDIFRydXN0Q2VudGVyIENsYXNzIDIgQ0EgSUkwHhcNMDYw +MTEyMTQzODQzWhcNMjUxMjMxMjI1OTU5WjB2MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1 +c3RDZW50ZXIgR21iSDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBDQTElMCMGA1UE +AxMcVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBDQSBJSTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBAKuAh5uO8MN8h9foJIIRszzdQ2Lu+MNF2ujhoF/RKrLqk2jftMjWQ+nEdVl//OEd+DFw +IxuInie5e/060smp6RQvkL4DUsFJzfb95AhmC1eKokKguNV/aVyQMrKXDcpK3EY+AlWJU+MaWss2 +xgdW94zPEfRMuzBwBJWl9jmM/XOBCH2JXjIeIqkiRUuwZi4wzJ9l/fzLganx4Duvo4bRierERXlQ +Xa7pIXSSTYtZgo+U4+lK8edJsBTj9WLL1XK9H7nSn6DNqPoByNkN39r8R52zyFTfSUrxIan+GE7u +SNQZu+995OKdy1u2bv/jzVrndIIFuoAlOMvkaZ6vQaoahPUCAwEAAaOCATQwggEwMA8GA1UdEwEB +/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTjq1RMgKHbVkO3kUrL84J6E1wIqzCB +7QYDVR0fBIHlMIHiMIHfoIHcoIHZhjVodHRwOi8vd3d3LnRydXN0Y2VudGVyLmRlL2NybC92Mi90 +Y19jbGFzc18yX2NhX0lJLmNybIaBn2xkYXA6Ly93d3cudHJ1c3RjZW50ZXIuZGUvQ049VEMlMjBU +cnVzdENlbnRlciUyMENsYXNzJTIwMiUyMENBJTIwSUksTz1UQyUyMFRydXN0Q2VudGVyJTIwR21i +SCxPVT1yb290Y2VydHMsREM9dHJ1c3RjZW50ZXIsREM9ZGU/Y2VydGlmaWNhdGVSZXZvY2F0aW9u +TGlzdD9iYXNlPzANBgkqhkiG9w0BAQUFAAOCAQEAjNfffu4bgBCzg/XbEeprS6iSGNn3Bzn1LL4G +dXpoUxUc6krtXvwjshOg0wn/9vYua0Fxec3ibf2uWWuFHbhOIprtZjluS5TmVfwLG4t3wVMTZonZ +KNaL80VKY7f9ewthXbhtvsPcW3nS7Yblok2+XnR8au0WOB9/WIFaGusyiC2y8zl3gK9etmF1Kdsj +TYjKUCjLhdLTEKJZbtOTVAB6okaVhgWcqRmY5TFyDADiZ9lA4CQze28suVyrZZ0srHbqNZn1l7kP +JOzHdiEoZa5X6AeIdUpWoNIFOqTmjZKILPPy4cHGYdtBxceb9w4aUUXCYWvcZCcXjFq32nQozZfk +vQ== +-----END CERTIFICATE----- + +TC TrustCenter Class 3 CA II +============================ +-----BEGIN CERTIFICATE----- +MIIEqjCCA5KgAwIBAgIOSkcAAQAC5aBd1j8AUb8wDQYJKoZIhvcNAQEFBQAwdjELMAkGA1UEBhMC +REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNVBAsTGVRDIFRydXN0Q2VudGVy +IENsYXNzIDMgQ0ExJTAjBgNVBAMTHFRDIFRydXN0Q2VudGVyIENsYXNzIDMgQ0EgSUkwHhcNMDYw +MTEyMTQ0MTU3WhcNMjUxMjMxMjI1OTU5WjB2MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1 +c3RDZW50ZXIgR21iSDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMyBDQTElMCMGA1UE +AxMcVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMyBDQSBJSTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBALTgu1G7OVyLBMVMeRwjhjEQY0NVJz/GRcekPewJDRoeIMJWHt4bNwcwIi9v8Qbxq63W +yKthoy9DxLCyLfzDlml7forkzMA5EpBCYMnMNWju2l+QVl/NHE1bWEnrDgFPZPosPIlY2C8u4rBo +6SI7dYnWRBpl8huXJh0obazovVkdKyT21oQDZogkAHhg8fir/gKya/si+zXmFtGt9i4S5Po1auUZ +uV3bOx4a+9P/FRQI2AlqukWdFHlgfa9Aigdzs5OW03Q0jTo3Kd5c7PXuLjHCINy+8U9/I1LZW+Jk +2ZyqBwi1Rb3R0DHBq1SfqdLDYmAD8bs5SpJKPQq5ncWg/jcCAwEAAaOCATQwggEwMA8GA1UdEwEB +/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTUovyfs8PYA9NXXAek0CSnwPIA1DCB +7QYDVR0fBIHlMIHiMIHfoIHcoIHZhjVodHRwOi8vd3d3LnRydXN0Y2VudGVyLmRlL2NybC92Mi90 +Y19jbGFzc18zX2NhX0lJLmNybIaBn2xkYXA6Ly93d3cudHJ1c3RjZW50ZXIuZGUvQ049VEMlMjBU +cnVzdENlbnRlciUyMENsYXNzJTIwMyUyMENBJTIwSUksTz1UQyUyMFRydXN0Q2VudGVyJTIwR21i +SCxPVT1yb290Y2VydHMsREM9dHJ1c3RjZW50ZXIsREM9ZGU/Y2VydGlmaWNhdGVSZXZvY2F0aW9u +TGlzdD9iYXNlPzANBgkqhkiG9w0BAQUFAAOCAQEANmDkcPcGIEPZIxpC8vijsrlNirTzwppVMXzE +O2eatN9NDoqTSheLG43KieHPOh6sHfGcMrSOWXaiQYUlN6AT0PV8TtXqluJucsG7Kv5sbviRmEb8 +yRtXW+rIGjs/sFGYPAfaLFkB2otE6OF0/ado3VS6g0bsyEa1+K+XwDsJHI/OcpY9M1ZwvJbL2NV9 +IJqDnxrcOfHFcqMRA/07QlIp2+gB95tejNaNhk4Z+rwcvsUhpYeeeC422wlxo3I0+GzjBgnyXlal +092Y+tTmBvTwtiBjS+opvaqCZh77gaqnN60TGOaSw4HBM7uIHqHn4rS9MWwOUT1v+5ZWgOI2F9Hc +5A== +-----END CERTIFICATE----- + +TC TrustCenter Universal CA I +============================= +-----BEGIN CERTIFICATE----- +MIID3TCCAsWgAwIBAgIOHaIAAQAC7LdggHiNtgYwDQYJKoZIhvcNAQEFBQAweTELMAkGA1UEBhMC +REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxJDAiBgNVBAsTG1RDIFRydXN0Q2VudGVy +IFVuaXZlcnNhbCBDQTEmMCQGA1UEAxMdVEMgVHJ1c3RDZW50ZXIgVW5pdmVyc2FsIENBIEkwHhcN +MDYwMzIyMTU1NDI4WhcNMjUxMjMxMjI1OTU5WjB5MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMg +VHJ1c3RDZW50ZXIgR21iSDEkMCIGA1UECxMbVEMgVHJ1c3RDZW50ZXIgVW5pdmVyc2FsIENBMSYw +JAYDVQQDEx1UQyBUcnVzdENlbnRlciBVbml2ZXJzYWwgQ0EgSTCCASIwDQYJKoZIhvcNAQEBBQAD +ggEPADCCAQoCggEBAKR3I5ZEr5D0MacQ9CaHnPM42Q9e3s9B6DGtxnSRJJZ4Hgmgm5qVSkr1YnwC +qMqs+1oEdjneX/H5s7/zA1hV0qq34wQi0fiU2iIIAI3TfCZdzHd55yx4Oagmcw6iXSVphU9VDprv +xrlE4Vc93x9UIuVvZaozhDrzznq+VZeujRIPFDPiUHDDSYcTvFHe15gSWu86gzOSBnWLknwSaHtw +ag+1m7Z3W0hZneTvWq3zwZ7U10VOylY0Ibw+F1tvdwxIAUMpsN0/lm7mlaoMwCC2/T42J5zjXM9O +gdwZu5GQfezmlwQek8wiSdeXhrYTCjxDI3d+8NzmzSQfO4ObNDqDNOMCAwEAAaNjMGEwHwYDVR0j +BBgwFoAUkqR1LKSevoFE63n8isWVpesQdXMwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AYYwHQYDVR0OBBYEFJKkdSyknr6BROt5/IrFlaXrEHVzMA0GCSqGSIb3DQEBBQUAA4IBAQAo0uCG +1eb4e/CX3CJrO5UUVg8RMKWaTzqwOuAGy2X17caXJ/4l8lfmXpWMPmRgFVp/Lw0BxbFg/UU1z/Cy +vwbZ71q+s2IhtNerNXxTPqYn8aEt2hojnczd7Dwtnic0XQ/CNnm8yUpiLe1r2X1BQ3y2qsrtYbE3 +ghUJGooWMNjsydZHcnhLEEYUjl8Or+zHL6sQ17bxbuyGssLoDZJz3KL0Dzq/YSMQiZxIQG5wALPT +ujdEWBF6AmqI8Dc08BnprNRlc/ZpjGSUOnmFKbAWKwyCPwacx/0QK54PLLae4xW/2TYcuiUaUj0a +7CIMHOCkoj3w6DnPgcB77V0fb8XQC9eY +-----END CERTIFICATE----- + +Deutsche Telekom Root CA 2 +========================== +-----BEGIN CERTIFICATE----- +MIIDnzCCAoegAwIBAgIBJjANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJERTEcMBoGA1UEChMT +RGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRlcjEjMCEG +A1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290IENBIDIwHhcNOTkwNzA5MTIxMTAwWhcNMTkwNzA5 +MjM1OTAwWjBxMQswCQYDVQQGEwJERTEcMBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0G +A1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBS +b290IENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCrC6M14IspFLEUha88EOQ5 +bzVdSq7d6mGNlUn0b2SjGmBmpKlAIoTZ1KXleJMOaAGtuU1cOs7TuKhCQN/Po7qCWWqSG6wcmtoI +KyUn+WkjR/Hg6yx6m/UTAtB+NHzCnjwAWav12gz1MjwrrFDa1sPeg5TKqAyZMg4ISFZbavva4VhY +AUlfckE8FQYBjl2tqriTtM2e66foai1SNNs671x1Udrb8zH57nGYMsRUFUQM+ZtV7a3fGAigo4aK +Se5TBY8ZTNXeWHmb0mocQqvF1afPaA+W5OFhmHZhyJF81j4A4pFQh+GdCuatl9Idxjp9y7zaAzTV +jlsB9WoHtxa2bkp/AgMBAAGjQjBAMB0GA1UdDgQWBBQxw3kbuvVT1xfgiXotF2wKsyudMzAPBgNV +HRMECDAGAQH/AgEFMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAlGRZrTlk5ynr +E/5aw4sTV8gEJPB0d8Bg42f76Ymmg7+Wgnxu1MM9756AbrsptJh6sTtU6zkXR34ajgv8HzFZMQSy +zhfzLMdiNlXiItiJVbSYSKpk+tYcNthEeFpaIzpXl/V6ME+un2pMSyuOoAPjPuCp1NJ70rOo4nI8 +rZ7/gFnkm0W09juwzTkZmDLl6iFhkOQxIY40sfcvNUqFENrnijchvllj4PKFiDFT1FQUhXB59C4G +dyd1Lx+4ivn+xbrYNuSD7Odlt79jWvNGr4GUN9RBjNYj1h7P9WgbRGOiWrqnNVmh5XAFmw4jV5mU +Cm26OWMohpLzGITY+9HPBVZkVw== +-----END CERTIFICATE----- + +ComSign CA +========== +-----BEGIN CERTIFICATE----- +MIIDkzCCAnugAwIBAgIQFBOWgxRVjOp7Y+X8NId3RDANBgkqhkiG9w0BAQUFADA0MRMwEQYDVQQD +EwpDb21TaWduIENBMRAwDgYDVQQKEwdDb21TaWduMQswCQYDVQQGEwJJTDAeFw0wNDAzMjQxMTMy +MThaFw0yOTAzMTkxNTAyMThaMDQxEzARBgNVBAMTCkNvbVNpZ24gQ0ExEDAOBgNVBAoTB0NvbVNp +Z24xCzAJBgNVBAYTAklMMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA8ORUaSvTx49q +ROR+WCf4C9DklBKK8Rs4OC8fMZwG1Cyn3gsqrhqg455qv588x26i+YtkbDqthVVRVKU4VbirgwTy +P2Q298CNQ0NqZtH3FyrV7zb6MBBC11PN+fozc0yz6YQgitZBJzXkOPqUm7h65HkfM/sb2CEJKHxN +GGleZIp6GZPKfuzzcuc3B1hZKKxC+cX/zT/npfo4sdAMx9lSGlPWgcxCejVb7Us6eva1jsz/D3zk +YDaHL63woSV9/9JLEYhwVKZBqGdTUkJe5DSe5L6j7KpiXd3DTKaCQeQzC6zJMw9kglcq/QytNuEM +rkvF7zuZ2SOzW120V+x0cAwqTwIDAQABo4GgMIGdMAwGA1UdEwQFMAMBAf8wPQYDVR0fBDYwNDAy +oDCgLoYsaHR0cDovL2ZlZGlyLmNvbXNpZ24uY28uaWwvY3JsL0NvbVNpZ25DQS5jcmwwDgYDVR0P +AQH/BAQDAgGGMB8GA1UdIwQYMBaAFEsBmz5WGmU2dst7l6qSBe4y5ygxMB0GA1UdDgQWBBRLAZs+ +VhplNnbLe5eqkgXuMucoMTANBgkqhkiG9w0BAQUFAAOCAQEA0Nmlfv4pYEWdfoPPbrxHbvUanlR2 +QnG0PFg/LUAlQvaBnPGJEMgOqnhPOAlXsDzACPw1jvFIUY0McXS6hMTXcpuEfDhOZAYnKuGntewI +mbQKDdSFc8gS4TXt8QUxHXOZDOuWyt3T5oWq8Ir7dcHyCTxlZWTzTNity4hp8+SDtwy9F1qWF8pb +/627HOkthIDYIb6FUtnUdLlphbpN7Sgy6/lhSuTENh4Z3G+EER+V9YMoGKgzkkMn3V0TBEVPh9VG +zT2ouvDzuFYkRes3x+F2T3I5GN9+dHLHcy056mDmrRGiVod7w2ia/viMcKjfZTL0pECMocJEAw6U +AGegcQCCSA== +-----END CERTIFICATE----- + +ComSign Secured CA +================== +-----BEGIN CERTIFICATE----- +MIIDqzCCApOgAwIBAgIRAMcoRwmzuGxFjB36JPU2TukwDQYJKoZIhvcNAQEFBQAwPDEbMBkGA1UE +AxMSQ29tU2lnbiBTZWN1cmVkIENBMRAwDgYDVQQKEwdDb21TaWduMQswCQYDVQQGEwJJTDAeFw0w +NDAzMjQxMTM3MjBaFw0yOTAzMTYxNTA0NTZaMDwxGzAZBgNVBAMTEkNvbVNpZ24gU2VjdXJlZCBD +QTEQMA4GA1UEChMHQ29tU2lnbjELMAkGA1UEBhMCSUwwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw +ggEKAoIBAQDGtWhfHZQVw6QIVS3joFd67+l0Kru5fFdJGhFeTymHDEjWaueP1H5XJLkGieQcPOqs +49ohgHMhCu95mGwfCP+hUH3ymBvJVG8+pSjsIQQPRbsHPaHA+iqYHU4Gk/v1iDurX8sWv+bznkqH +7Rnqwp9D5PGBpX8QTz7RSmKtUxvLg/8HZaWSLWapW7ha9B20IZFKF3ueMv5WJDmyVIRD9YTC2LxB +kMyd1mja6YJQqTtoz7VdApRgFrFD2UNd3V2Hbuq7s8lr9gOUCXDeFhF6K+h2j0kQmHe5Y1yLM5d1 +9guMsqtb3nQgJT/j8xH5h2iGNXHDHYwt6+UarA9z1YJZQIDTAgMBAAGjgacwgaQwDAYDVR0TBAUw +AwEB/zBEBgNVHR8EPTA7MDmgN6A1hjNodHRwOi8vZmVkaXIuY29tc2lnbi5jby5pbC9jcmwvQ29t +U2lnblNlY3VyZWRDQS5jcmwwDgYDVR0PAQH/BAQDAgGGMB8GA1UdIwQYMBaAFMFL7XC29z58ADsA +j8c+DkWfHl3sMB0GA1UdDgQWBBTBS+1wtvc+fAA7AI/HPg5Fnx5d7DANBgkqhkiG9w0BAQUFAAOC +AQEAFs/ukhNQq3sUnjO2QiBq1BW9Cav8cujvR3qQrFHBZE7piL1DRYHjZiM/EoZNGeQFsOY3wo3a +BijJD4mkU6l1P7CW+6tMM1X5eCZGbxs2mPtCdsGCuY7e+0X5YxtiOzkGynd6qDwJz2w2PQ8KRUtp +FhpFfTMDZflScZAmlaxMDPWLkz/MdXSFmLr/YnpNH4n+rr2UAJm/EaXc4HnFFgt9AmEd6oX5AhVP +51qJThRv4zdLhfXBPGHg/QVBspJ/wx2g0K5SZGBrGMYmnNj1ZOQ2GmKfig8+/21OGVZOIJFsnzQz +OjRXUDpvgV4GxvU+fE6OK85lBi5d0ipTdF7Tbieejw== +-----END CERTIFICATE----- + +Cybertrust Global Root +====================== +-----BEGIN CERTIFICATE----- +MIIDoTCCAomgAwIBAgILBAAAAAABD4WqLUgwDQYJKoZIhvcNAQEFBQAwOzEYMBYGA1UEChMPQ3li +ZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2JhbCBSb290MB4XDTA2MTIxNTA4 +MDAwMFoXDTIxMTIxNTA4MDAwMFowOzEYMBYGA1UEChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQD +ExZDeWJlcnRydXN0IEdsb2JhbCBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA ++Mi8vRRQZhP/8NN57CPytxrHjoXxEnOmGaoQ25yiZXRadz5RfVb23CO21O1fWLE3TdVJDm71aofW +0ozSJ8bi/zafmGWgE07GKmSb1ZASzxQG9Dvj1Ci+6A74q05IlG2OlTEQXO2iLb3VOm2yHLtgwEZL +AfVJrn5GitB0jaEMAs7u/OePuGtm839EAL9mJRQr3RAwHQeWP032a7iPt3sMpTjr3kfb1V05/Iin +89cqdPHoWqI7n1C6poxFNcJQZZXcY4Lv3b93TZxiyWNzFtApD0mpSPCzqrdsxacwOUBdrsTiXSZT +8M4cIwhhqJQZugRiQOwfOHB3EgZxpzAYXSUnpQIDAQABo4GlMIGiMA4GA1UdDwEB/wQEAwIBBjAP +BgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBS2CHsNesysIEyGVjJez6tuhS1wVzA/BgNVHR8EODA2 +MDSgMqAwhi5odHRwOi8vd3d3Mi5wdWJsaWMtdHJ1c3QuY29tL2NybC9jdC9jdHJvb3QuY3JsMB8G +A1UdIwQYMBaAFLYIew16zKwgTIZWMl7Pq26FLXBXMA0GCSqGSIb3DQEBBQUAA4IBAQBW7wojoFRO +lZfJ+InaRcHUowAl9B8Tq7ejhVhpwjCt2BWKLePJzYFa+HMjWqd8BfP9IjsO0QbE2zZMcwSO5bAi +5MXzLqXZI+O4Tkogp24CJJ8iYGd7ix1yCcUxXOl5n4BHPa2hCwcUPUf/A2kaDAtE52Mlp3+yybh2 +hO0j9n0Hq0V+09+zv+mKts2oomcrUtW3ZfA5TGOgkXmTUg9U3YO7n9GPp1Nzw8v/MOx8BLjYRB+T +X3EJIrduPuocA06dGiBh+4E37F78CkWr1+cXVdCg6mCbpvbjjFspwgZgFJ0tl0ypkxWdYcQBX0jW +WL1WMRJOEcgh4LMRkWXbtKaIOM5V +-----END CERTIFICATE----- + +ePKI Root Certification Authority +================================= +-----BEGIN CERTIFICATE----- +MIIFsDCCA5igAwIBAgIQFci9ZUdcr7iXAF7kBtK8nTANBgkqhkiG9w0BAQUFADBeMQswCQYDVQQG +EwJUVzEjMCEGA1UECgwaQ2h1bmdod2EgVGVsZWNvbSBDby4sIEx0ZC4xKjAoBgNVBAsMIWVQS0kg +Um9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNDEyMjAwMjMxMjdaFw0zNDEyMjAwMjMx +MjdaMF4xCzAJBgNVBAYTAlRXMSMwIQYDVQQKDBpDaHVuZ2h3YSBUZWxlY29tIENvLiwgTHRkLjEq +MCgGA1UECwwhZVBLSSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0B +AQEFAAOCAg8AMIICCgKCAgEA4SUP7o3biDN1Z82tH306Tm2d0y8U82N0ywEhajfqhFAHSyZbCUNs +IZ5qyNUD9WBpj8zwIuQf5/dqIjG3LBXy4P4AakP/h2XGtRrBp0xtInAhijHyl3SJCRImHJ7K2RKi +lTza6We/CKBk49ZCt0Xvl/T29de1ShUCWH2YWEtgvM3XDZoTM1PRYfl61dd4s5oz9wCGzh1NlDiv +qOx4UXCKXBCDUSH3ET00hl7lSM2XgYI1TBnsZfZrxQWh7kcT1rMhJ5QQCtkkO7q+RBNGMD+XPNjX +12ruOzjjK9SXDrkb5wdJfzcq+Xd4z1TtW0ado4AOkUPB1ltfFLqfpo0kR0BZv3I4sjZsN/+Z0V0O +WQqraffAsgRFelQArr5T9rXn4fg8ozHSqf4hUmTFpmfwdQcGlBSBVcYn5AGPF8Fqcde+S/uUWH1+ +ETOxQvdibBjWzwloPn9s9h6PYq2lY9sJpx8iQkEeb5mKPtf5P0B6ebClAZLSnT0IFaUQAS2zMnao +lQ2zepr7BxB4EW/hj8e6DyUadCrlHJhBmd8hh+iVBmoKs2pHdmX2Os+PYhcZewoozRrSgx4hxyy/ +vv9haLdnG7t4TY3OZ+XkwY63I2binZB1NJipNiuKmpS5nezMirH4JYlcWrYvjB9teSSnUmjDhDXi +Zo1jDiVN1Rmy5nk3pyKdVDECAwEAAaNqMGgwHQYDVR0OBBYEFB4M97Zn8uGSJglFwFU5Lnc/Qkqi +MAwGA1UdEwQFMAMBAf8wOQYEZyoHAAQxMC8wLQIBADAJBgUrDgMCGgUAMAcGBWcqAwAABBRFsMLH +ClZ87lt4DJX5GFPBphzYEDANBgkqhkiG9w0BAQUFAAOCAgEACbODU1kBPpVJufGBuvl2ICO1J2B0 +1GqZNF5sAFPZn/KmsSQHRGoqxqWOeBLoR9lYGxMqXnmbnwoqZ6YlPwZpVnPDimZI+ymBV3QGypzq +KOg4ZyYr8dW1P2WT+DZdjo2NQCCHGervJ8A9tDkPJXtoUHRVnAxZfVo9QZQlUgjgRywVMRnVvwdV +xrsStZf0X4OFunHB2WyBEXYKCrC/gpf36j36+uwtqSiUO1bd0lEursC9CBWMd1I0ltabrNMdjmEP +NXubrjlpC2JgQCA2j6/7Nu4tCEoduL+bXPjqpRugc6bY+G7gMwRfaKonh+3ZwZCc7b3jajWvY9+r +GNm65ulK6lCKD2GTHuItGeIwlDWSXQ62B68ZgI9HkFFLLk3dheLSClIKF5r8GrBQAuUBo2M3IUxE +xJtRmREOc5wGj1QupyheRDmHVi03vYVElOEMSyycw5KFNGHLD7ibSkNS/jQ6fbjpKdx2qcgw+BRx +gMYeNkh0IkFch4LoGHGLQYlE535YW6i4jRPpp2zDR+2zGp1iro2C6pSe3VkQw63d4k3jMdXH7Ojy +sP6SHhYKGvzZ8/gntsm+HbRsZJB/9OTEW9c3rkIO3aQab3yIVMUWbuF6aC74Or8NpDyJO3inTmOD +BCEIZ43ygknQW/2xzQ+DhNQ+IIX3Sj0rnP0qCglN6oH4EZw= +-----END CERTIFICATE----- + +T\xc3\x9c\x42\xC4\xB0TAK UEKAE K\xC3\xB6k Sertifika Hizmet Sa\xC4\x9Flay\xc4\xb1\x63\xc4\xb1s\xc4\xb1 - S\xC3\xBCr\xC3\xBCm 3 +============================================================================================================================= +-----BEGIN CERTIFICATE----- +MIIFFzCCA/+gAwIBAgIBETANBgkqhkiG9w0BAQUFADCCASsxCzAJBgNVBAYTAlRSMRgwFgYDVQQH +DA9HZWJ6ZSAtIEtvY2FlbGkxRzBFBgNVBAoMPlTDvHJraXllIEJpbGltc2VsIHZlIFRla25vbG9q +aWsgQXJhxZ90xLFybWEgS3VydW11IC0gVMOcQsSwVEFLMUgwRgYDVQQLDD9VbHVzYWwgRWxla3Ry +b25payB2ZSBLcmlwdG9sb2ppIEFyYcWfdMSxcm1hIEVuc3RpdMO8c8O8IC0gVUVLQUUxIzAhBgNV +BAsMGkthbXUgU2VydGlmaWthc3lvbiBNZXJrZXppMUowSAYDVQQDDEFUw5xCxLBUQUsgVUVLQUUg +S8O2ayBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsSAtIFPDvHLDvG0gMzAeFw0wNzA4 +MjQxMTM3MDdaFw0xNzA4MjExMTM3MDdaMIIBKzELMAkGA1UEBhMCVFIxGDAWBgNVBAcMD0dlYnpl +IC0gS29jYWVsaTFHMEUGA1UECgw+VMO8cmtpeWUgQmlsaW1zZWwgdmUgVGVrbm9sb2ppayBBcmHF +n3TEsXJtYSBLdXJ1bXUgLSBUw5xCxLBUQUsxSDBGBgNVBAsMP1VsdXNhbCBFbGVrdHJvbmlrIHZl +IEtyaXB0b2xvamkgQXJhxZ90xLFybWEgRW5zdGl0w7xzw7wgLSBVRUtBRTEjMCEGA1UECwwaS2Ft +dSBTZXJ0aWZpa2FzeW9uIE1lcmtlemkxSjBIBgNVBAMMQVTDnELEsFRBSyBVRUtBRSBLw7ZrIFNl +cnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxIC0gU8O8csO8bSAzMIIBIjANBgkqhkiG9w0B +AQEFAAOCAQ8AMIIBCgKCAQEAim1L/xCIOsP2fpTo6iBkcK4hgb46ezzb8R1Sf1n68yJMlaCQvEhO +Eav7t7WNeoMojCZG2E6VQIdhn8WebYGHV2yKO7Rm6sxA/OOqbLLLAdsyv9Lrhc+hDVXDWzhXcLh1 +xnnRFDDtG1hba+818qEhTsXOfJlfbLm4IpNQp81McGq+agV/E5wrHur+R84EpW+sky58K5+eeROR +6Oqeyjh1jmKwlZMq5d/pXpduIF9fhHpEORlAHLpVK/swsoHvhOPc7Jg4OQOFCKlUAwUp8MmPi+oL +hmUZEdPpCSPeaJMDyTYcIW7OjGbxmTDY17PDHfiBLqi9ggtm/oLL4eAagsNAgQIDAQABo0IwQDAd +BgNVHQ4EFgQUvYiHyY/2pAoLquvF/pEjnatKijIwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF +MAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAB18+kmPNOm3JpIWmgV050vQbTlswyb2zrgxvMTfvCr4 +N5EY3ATIZJkrGG2AA1nJrvhY0D7twyOfaTyGOBye79oneNGEN3GKPEs5z35FBtYt2IpNeBLWrcLT +y9LQQfMmNkqblWwM7uXRQydmwYj3erMgbOqwaSvHIOgMA8RBBZniP+Rr+KCGgceExh/VS4ESshYh +LBOhgLJeDEoTniDYYkCrkOpkSi+sDQESeUWoL4cZaMjihccwsnX5OD+ywJO0a+IDRM5noN+J1q2M +dqMTw5RhK2vZbMEHCiIHhWyFJEapvj+LeISCfiQMnf2BN+MlqO02TpUsyZyQ2uypQjyttgI= +-----END CERTIFICATE----- + +Buypass Class 2 CA 1 +==================== +-----BEGIN CERTIFICATE----- +MIIDUzCCAjugAwIBAgIBATANBgkqhkiG9w0BAQUFADBLMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU +QnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMMFEJ1eXBhc3MgQ2xhc3MgMiBDQSAxMB4XDTA2 +MTAxMzEwMjUwOVoXDTE2MTAxMzEwMjUwOVowSzELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBh +c3MgQVMtOTgzMTYzMzI3MR0wGwYDVQQDDBRCdXlwYXNzIENsYXNzIDIgQ0EgMTCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAIs8B0XY9t/mx8q6jUPFR42wWsE425KEHK8T1A9vNkYgxC7M +cXA0ojTTNy7Y3Tp3L8DrKehc0rWpkTSHIln+zNvnma+WwajHQN2lFYxuyHyXA8vmIPLXl18xoS83 +0r7uvqmtqEyeIWZDO6i88wmjONVZJMHCR3axiFyCO7srpgTXjAePzdVBHfCuuCkslFJgNJQ72uA4 +0Z0zPhX0kzLFANq1KWYOOngPIVJfAuWSeyXTkh4vFZ2B5J2O6O+JzhRMVB0cgRJNcKi+EAUXfh/R +uFdV7c27UsKwHnjCTTZoy1YmwVLBvXb3WNVyfh9EdrsAiR0WnVE1703CVu9r4Iw7DekCAwEAAaNC +MEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUP42aWYv8e3uco684sDntkHGA1sgwDgYDVR0P +AQH/BAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQAVGn4TirnoB6NLJzKyQJHyIdFkhb5jatLPgcIV +1Xp+DCmsNx4cfHZSldq1fyOhKXdlyTKdqC5Wq2B2zha0jX94wNWZUYN/Xtm+DKhQ7SLHrQVMdvvt +7h5HZPb3J31cKA9FxVxiXqaakZG3Uxcu3K1gnZZkOb1naLKuBctN518fV4bVIJwo+28TOPX2EZL2 +fZleHwzoq0QkKXJAPTZSr4xYkHPB7GEseaHsh7U/2k3ZIQAw3pDaDtMaSKk+hQsUi4y8QZ5q9w5w +wDX3OaJdZtB7WZ+oRxKaJyOkLY4ng5IgodcVf/EuGO70SH8vf/GhGLWhC5SgYiAynB321O+/TIho +-----END CERTIFICATE----- + +Buypass Class 3 CA 1 +==================== +-----BEGIN CERTIFICATE----- +MIIDUzCCAjugAwIBAgIBAjANBgkqhkiG9w0BAQUFADBLMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU +QnV5cGFzcyBBUy05ODMxNjMzMjcxHTAbBgNVBAMMFEJ1eXBhc3MgQ2xhc3MgMyBDQSAxMB4XDTA1 +MDUwOTE0MTMwM1oXDTE1MDUwOTE0MTMwM1owSzELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1eXBh +c3MgQVMtOTgzMTYzMzI3MR0wGwYDVQQDDBRCdXlwYXNzIENsYXNzIDMgQ0EgMTCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAKSO13TZKWTeXx+HgJHqTjnmGcZEC4DVC69TB4sSveZn8AKx +ifZgisRbsELRwCGoy+Gb72RRtqfPFfV0gGgEkKBYouZ0plNTVUhjP5JW3SROjvi6K//zNIqeKNc0 +n6wv1g/xpC+9UrJJhW05NfBEMJNGJPO251P7vGGvqaMU+8IXF4Rs4HyI+MkcVyzwPX6UvCWThOia +AJpFBUJXgPROztmuOfbIUxAMZTpHe2DC1vqRycZxbL2RhzyRhkmr8w+gbCZ2Xhysm3HljbybIR6c +1jh+JIAVMYKWsUnTYjdbiAwKYjT+p0h+mbEwi5A3lRyoH6UsjfRVyNvdWQrCrXig9IsCAwEAAaNC +MEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUOBTmyPCppAP0Tj4io1vy1uCtQHQwDgYDVR0P +AQH/BAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQABZ6OMySU9E2NdFm/soT4JXJEVKirZgCFPBdy7 +pYmrEzMqnji3jG8CcmPHc3ceCQa6Oyh7pEfJYWsICCD8igWKH7y6xsL+z27sEzNxZy5p+qksP2bA +EllNC1QCkoS72xLvg3BweMhT+t/Gxv/ciC8HwEmdMldg0/L2mSlf56oBzKwzqBwKu5HEA6BvtjT5 +htOzdlSY9EqBs1OdTUDs5XcTRa9bqh/YL0yCe/4qxFi7T/ye/QNlGioOw6UgFpRreaaiErS7GqQj +el/wroQk5PMr+4okoyeYZdowdXb8GZHo2+ubPzK/QJcHJrrM85SFSnonk8+QQtS4Wxam58tAA915 +-----END CERTIFICATE----- + +EBG Elektronik Sertifika Hizmet Sa\xC4\x9Flay\xc4\xb1\x63\xc4\xb1s\xc4\xb1 +========================================================================== +-----BEGIN CERTIFICATE----- +MIIF5zCCA8+gAwIBAgIITK9zQhyOdAIwDQYJKoZIhvcNAQEFBQAwgYAxODA2BgNVBAMML0VCRyBF +bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMTcwNQYDVQQKDC5FQkcg +QmlsacWfaW0gVGVrbm9sb2ppbGVyaSB2ZSBIaXptZXRsZXJpIEEuxZ4uMQswCQYDVQQGEwJUUjAe +Fw0wNjA4MTcwMDIxMDlaFw0xNjA4MTQwMDMxMDlaMIGAMTgwNgYDVQQDDC9FQkcgRWxla3Ryb25p +ayBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsTE3MDUGA1UECgwuRUJHIEJpbGnFn2lt +IFRla25vbG9qaWxlcmkgdmUgSGl6bWV0bGVyaSBBLsWeLjELMAkGA1UEBhMCVFIwggIiMA0GCSqG +SIb3DQEBAQUAA4ICDwAwggIKAoICAQDuoIRh0DpqZhAy2DE4f6en5f2h4fuXd7hxlugTlkaDT7by +X3JWbhNgpQGR4lvFzVcfd2NR/y8927k/qqk153nQ9dAktiHq6yOU/im/+4mRDGSaBUorzAzu8T2b +gmmkTPiab+ci2hC6X5L8GCcKqKpE+i4stPtGmggDg3KriORqcsnlZR9uKg+ds+g75AxuetpX/dfr +eYteIAbTdgtsApWjluTLdlHRKJ2hGvxEok3MenaoDT2/F08iiFD9rrbskFBKW5+VQarKD7JK/oCZ +TqNGFav4c0JqwmZ2sQomFd2TkuzbqV9UIlKRcF0T6kjsbgNs2d1s/OsNA/+mgxKb8amTD8UmTDGy +Y5lhcucqZJnSuOl14nypqZoaqsNW2xCaPINStnuWt6yHd6i58mcLlEOzrz5z+kI2sSXFCjEmN1Zn +uqMLfdb3ic1nobc6HmZP9qBVFCVMLDMNpkGMvQQxahByCp0OLna9XvNRiYuoP1Vzv9s6xiQFlpJI +qkuNKgPlV5EQ9GooFW5Hd4RcUXSfGenmHmMWOeMRFeNYGkS9y8RsZteEBt8w9DeiQyJ50hBs37vm +ExH8nYQKE3vwO9D8owrXieqWfo1IhR5kX9tUoqzVegJ5a9KK8GfaZXINFHDk6Y54jzJ0fFfy1tb0 +Nokb+Clsi7n2l9GkLqq+CxnCRelwXQIDAJ3Zo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB +/wQEAwIBBjAdBgNVHQ4EFgQU587GT/wWZ5b6SqMHwQSny2re2kcwHwYDVR0jBBgwFoAU587GT/wW +Z5b6SqMHwQSny2re2kcwDQYJKoZIhvcNAQEFBQADggIBAJuYml2+8ygjdsZs93/mQJ7ANtyVDR2t +FcU22NU57/IeIl6zgrRdu0waypIN30ckHrMk2pGI6YNw3ZPX6bqz3xZaPt7gyPvT/Wwp+BVGoGgm +zJNSroIBk5DKd8pNSe/iWtkqvTDOTLKBtjDOWU/aWR1qeqRFsIImgYZ29fUQALjuswnoT4cCB64k +XPBfrAowzIpAoHMEwfuJJPaaHFy3PApnNgUIMbOv2AFoKuB4j3TeuFGkjGwgPaL7s9QJ/XvCgKqT +bCmYIai7FvOpEl90tYeY8pUm3zTvilORiF0alKM/fCL414i6poyWqD1SNGKfAB5UVUJnxk1Gj7sU +RT0KlhaOEKGXmdXTMIXM3rRyt7yKPBgpaP3ccQfuJDlq+u2lrDgv+R4QDgZxGhBM/nV+/x5XOULK +1+EVoVZVWRvRo68R2E7DpSvvkL/A7IITW43WciyTTo9qKd+FPNMN4KIYEsxVL0e3p5sC/kH2iExt +2qkBR4NkJ2IQgtYSe14DHzSpyZH+r11thie3I6p1GMog57AP14kOpmciY/SDQSsGS7tY1dHXt7kQ +Y9iJSrSq3RZj9W6+YKH47ejWkE8axsWgKdOnIaj1Wjz3x0miIZpKlVIglnKaZsv30oZDfCK+lvm9 +AahH3eU7QPl1K5srRmSGjR70j/sHd9DqSaIcjVIUpgqT +-----END CERTIFICATE----- + +certSIGN ROOT CA +================ +-----BEGIN CERTIFICATE----- +MIIDODCCAiCgAwIBAgIGIAYFFnACMA0GCSqGSIb3DQEBBQUAMDsxCzAJBgNVBAYTAlJPMREwDwYD +VQQKEwhjZXJ0U0lHTjEZMBcGA1UECxMQY2VydFNJR04gUk9PVCBDQTAeFw0wNjA3MDQxNzIwMDRa +Fw0zMTA3MDQxNzIwMDRaMDsxCzAJBgNVBAYTAlJPMREwDwYDVQQKEwhjZXJ0U0lHTjEZMBcGA1UE +CxMQY2VydFNJR04gUk9PVCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALczuX7I +JUqOtdu0KBuqV5Do0SLTZLrTk+jUrIZhQGpgV2hUhE28alQCBf/fm5oqrl0Hj0rDKH/v+yv6efHH +rfAQUySQi2bJqIirr1qjAOm+ukbuW3N7LBeCgV5iLKECZbO9xSsAfsT8AzNXDe3i+s5dRdY4zTW2 +ssHQnIFKquSyAVwdj1+ZxLGt24gh65AIgoDzMKND5pCCrlUoSe1b16kQOA7+j0xbm0bqQfWwCHTD +0IgztnzXdN/chNFDDnU5oSVAKOp4yw4sLjmdjItuFhwvJoIQ4uNllAoEwF73XVv4EOLQunpL+943 +AAAaWyjj0pxzPjKHmKHJUS/X3qwzs08CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8B +Af8EBAMCAcYwHQYDVR0OBBYEFOCMm9slSbPxfIbWskKHC9BroNnkMA0GCSqGSIb3DQEBBQUAA4IB +AQA+0hyJLjX8+HXd5n9liPRyTMks1zJO890ZeUe9jjtbkw9QSSQTaxQGcu8J06Gh40CEyecYMnQ8 +SG4Pn0vU9x7Tk4ZkVJdjclDVVc/6IJMCopvDI5NOFlV2oHB5bc0hH88vLbwZ44gx+FkagQnIl6Z0 +x2DEW8xXjrJ1/RsCCdtZb3KTafcxQdaIOL+Hsr0Wefmq5L6IJd1hJyMctTEHBDa0GpC9oHRxUIlt +vBTjD4au8as+x6AJzKNI0eDbZOeStc+vckNwi/nDhDwTqn6Sm1dTk/pwwpEOMfmbZ13pljheX7Nz +TogVZ96edhBiIL5VaZVDADlN9u6wWk5JRFRYX0KD +-----END CERTIFICATE----- + +CNNIC ROOT +========== +-----BEGIN CERTIFICATE----- +MIIDVTCCAj2gAwIBAgIESTMAATANBgkqhkiG9w0BAQUFADAyMQswCQYDVQQGEwJDTjEOMAwGA1UE +ChMFQ05OSUMxEzARBgNVBAMTCkNOTklDIFJPT1QwHhcNMDcwNDE2MDcwOTE0WhcNMjcwNDE2MDcw +OTE0WjAyMQswCQYDVQQGEwJDTjEOMAwGA1UEChMFQ05OSUMxEzARBgNVBAMTCkNOTklDIFJPT1Qw +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDTNfc/c3et6FtzF8LRb+1VvG7q6KR5smzD +o+/hn7E7SIX1mlwhIhAsxYLO2uOabjfhhyzcuQxauohV3/2q2x8x6gHx3zkBwRP9SFIhxFXf2tiz +VHa6dLG3fdfA6PZZxU3Iva0fFNrfWEQlMhkqx35+jq44sDB7R3IJMfAw28Mbdim7aXZOV/kbZKKT +VrdvmW7bCgScEeOAH8tjlBAKqeFkgjH5jCftppkA9nCTGPihNIaj3XrCGHn2emU1z5DrvTOTn1Or +czvmmzQgLx3vqR1jGqCA2wMv+SYahtKNu6m+UjqHZ0gNv7Sg2Ca+I19zN38m5pIEo3/PIKe38zrK +y5nLAgMBAAGjczBxMBEGCWCGSAGG+EIBAQQEAwIABzAfBgNVHSMEGDAWgBRl8jGtKvf33VKWCscC +wQ7vptU7ETAPBgNVHRMBAf8EBTADAQH/MAsGA1UdDwQEAwIB/jAdBgNVHQ4EFgQUZfIxrSr3991S +lgrHAsEO76bVOxEwDQYJKoZIhvcNAQEFBQADggEBAEs17szkrr/Dbq2flTtLP1se31cpolnKOOK5 +Gv+e5m4y3R6u6jW39ZORTtpC4cMXYFDy0VwmuYK36m3knITnA3kXr5g9lNvHugDnuL8BV8F3RTIM +O/G0HAiw/VGgod2aHRM2mm23xzy54cXZF/qD1T0VoDy7HgviyJA/qIYM/PmLXoXLT1tLYhFHxUV8 +BS9BsZ4QaRuZluBVeftOhpm4lNqGOGqTo+fLbuXf6iFViZx9fX+Y9QCJ7uOEwFyWtcVG6kbghVW2 +G8kS1sHNzYDzAgE8yGnLRUhj2JTQ7IUOO04RZfSCjKY9ri4ilAnIXOo8gV0WKgOXFlUJ24pBgp5m +mxE= +-----END CERTIFICATE----- + +ApplicationCA - Japanese Government +=================================== +-----BEGIN CERTIFICATE----- +MIIDoDCCAoigAwIBAgIBMTANBgkqhkiG9w0BAQUFADBDMQswCQYDVQQGEwJKUDEcMBoGA1UEChMT +SmFwYW5lc2UgR292ZXJubWVudDEWMBQGA1UECxMNQXBwbGljYXRpb25DQTAeFw0wNzEyMTIxNTAw +MDBaFw0xNzEyMTIxNTAwMDBaMEMxCzAJBgNVBAYTAkpQMRwwGgYDVQQKExNKYXBhbmVzZSBHb3Zl +cm5tZW50MRYwFAYDVQQLEw1BcHBsaWNhdGlvbkNBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB +CgKCAQEAp23gdE6Hj6UG3mii24aZS2QNcfAKBZuOquHMLtJqO8F6tJdhjYq+xpqcBrSGUeQ3DnR4 +fl+Kf5Sk10cI/VBaVuRorChzoHvpfxiSQE8tnfWuREhzNgaeZCw7NCPbXCbkcXmP1G55IrmTwcrN +wVbtiGrXoDkhBFcsovW8R0FPXjQilbUfKW1eSvNNcr5BViCH/OlQR9cwFO5cjFW6WY2H/CPek9AE +jP3vbb3QesmlOmpyM8ZKDQUXKi17safY1vC+9D/qDihtQWEjdnjDuGWk81quzMKq2edY3rZ+nYVu +nyoKb58DKTCXKB28t89UKU5RMfkntigm/qJj5kEW8DOYRwIDAQABo4GeMIGbMB0GA1UdDgQWBBRU +WssmP3HMlEYNllPqa0jQk/5CdTAOBgNVHQ8BAf8EBAMCAQYwWQYDVR0RBFIwUKROMEwxCzAJBgNV +BAYTAkpQMRgwFgYDVQQKDA/ml6XmnKzlm73mlL/lupwxIzAhBgNVBAsMGuOCouODl+ODquOCseOD +vOOCt+ODp+ODs0NBMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBADlqRHZ3ODrs +o2dGD/mLBqj7apAxzn7s2tGJfHrrLgy9mTLnsCTWw//1sogJhyzjVOGjprIIC8CFqMjSnHH2HZ9g +/DgzE+Ge3Atf2hZQKXsvcJEPmbo0NI2VdMV+eKlmXb3KIXdCEKxmJj3ekav9FfBv7WxfEPjzFvYD +io+nEhEMy/0/ecGc/WLuo89UDNErXxc+4z6/wCs+CZv+iKZ+tJIX/COUgb1up8WMwusRRdv4QcmW +dupwX3kSa+SjB1oF7ydJzyGfikwJcGapJsErEU4z0g781mzSDjJkaP+tBXhfAx2o45CsJOAPQKdL +rosot4LKGAfmt1t06SAZf7IbiVQ= +-----END CERTIFICATE----- + +GeoTrust Primary Certification Authority - G3 +============================================= +-----BEGIN CERTIFICATE----- +MIID/jCCAuagAwIBAgIQFaxulBmyeUtB9iepwxgPHzANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UE +BhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA4IEdlb1RydXN0 +IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFy +eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEczMB4XDTA4MDQwMjAwMDAwMFoXDTM3MTIwMTIz +NTk1OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAo +YykgMjAwOCBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNVBAMT +LUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBANziXmJYHTNXOTIz+uvLh4yn1ErdBojqZI4xmKU4kB6Yzy5j +K/BGvESyiaHAKAxJcCGVn2TAppMSAmUmhsalifD614SgcK9PGpc/BkTVyetyEH3kMSj7HGHmKAdE +c5IiaacDiGydY8hS2pgn5whMcD60yRLBxWeDXTPzAxHsatBT4tG6NmCUgLthY2xbF37fQJQeqw3C +IShwiP/WJmxsYAQlTlV+fe+/lEjetx3dcI0FX4ilm/LC7urRQEFtYjgdVgbFA0dRIBn8exALDmKu +dlW/X3e+PkkBUz2YJQN2JFodtNuJ6nnltrM7P7pMKEF/BqxqjsHQ9gUdfeZChuOl1UcCAwEAAaNC +MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMR5yo6hTgMdHNxr +2zFblD4/MH8tMA0GCSqGSIb3DQEBCwUAA4IBAQAtxRPPVoB7eni9n64smefv2t+UXglpp+duaIy9 +cr5HqQ6XErhK8WTTOd8lNNTBzU6B8A8ExCSzNJbGpqow32hhc9f5joWJ7w5elShKKiePEI4ufIbE +Ap7aDHdlDkQNkv39sxY2+hENHYwOB4lqKVb3cvTdFZx3NWZXqxNT2I7BQMXXExZacse3aQHEerGD +AWh9jUGhlBjBJVz88P6DAod8DQ3PLghcSkANPuyBYeYk28rgDi0Hsj5W3I31QYUHSJsMC8tJP33s +t/3LjWeJGqvtux6jAAgIFyqCXDFdRootD4abdNlF+9RAsXqqaC2Gspki4cErx5z481+oghLrGREt +-----END CERTIFICATE----- + +thawte Primary Root CA - G2 +=========================== +-----BEGIN CERTIFICATE----- +MIICiDCCAg2gAwIBAgIQNfwmXNmET8k9Jj1Xm67XVjAKBggqhkjOPQQDAzCBhDELMAkGA1UEBhMC +VVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjE4MDYGA1UECxMvKGMpIDIwMDcgdGhhd3RlLCBJbmMu +IC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAiBgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3Qg +Q0EgLSBHMjAeFw0wNzExMDUwMDAwMDBaFw0zODAxMTgyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEV +MBMGA1UEChMMdGhhd3RlLCBJbmMuMTgwNgYDVQQLEy8oYykgMjAwNyB0aGF3dGUsIEluYy4gLSBG +b3IgYXV0aG9yaXplZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAt +IEcyMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEotWcgnuVnfFSeIf+iha/BebfowJPDQfGAFG6DAJS +LSKkQjnE/o/qycG+1E3/n3qe4rF8mq2nhglzh9HnmuN6papu+7qzcMBniKI11KOasf2twu8x+qi5 +8/sIxpHR+ymVo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQU +mtgAMADna3+FGO6Lts6KDPgR4bswCgYIKoZIzj0EAwMDaQAwZgIxAN344FdHW6fmCsO99YCKlzUN +G4k8VIZ3KMqh9HneteY4sPBlcIx/AlTCv//YoT7ZzwIxAMSNlPzcU9LcnXgWHxUzI1NS41oxXZ3K +rr0TKUQNJ1uo52icEvdYPy5yAlejj6EULg== +-----END CERTIFICATE----- + +thawte Primary Root CA - G3 +=========================== +-----BEGIN CERTIFICATE----- +MIIEKjCCAxKgAwIBAgIQYAGXt0an6rS0mtZLL/eQ+zANBgkqhkiG9w0BAQsFADCBrjELMAkGA1UE +BhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2 +aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIwMDggdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhv +cml6ZWQgdXNlIG9ubHkxJDAiBgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMzAeFw0w +ODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIGuMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhh +d3RlLCBJbmMuMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9uIFNlcnZpY2VzIERpdmlzaW9uMTgwNgYD +VQQLEy8oYykgMjAwOCB0aGF3dGUsIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTEkMCIG +A1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAtIEczMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEAsr8nLPvb2FvdeHsbnndmgcs+vHyu86YnmjSjaDFxODNi5PNxZnmxqWWjpYvVj2At +P0LMqmsywCPLLEHd5N/8YZzic7IilRFDGF/Eth9XbAoFWCLINkw6fKXRz4aviKdEAhN0cXMKQlkC ++BsUa0Lfb1+6a4KinVvnSr0eAXLbS3ToO39/fR8EtCab4LRarEc9VbjXsCZSKAExQGbY2SS99irY +7CFJXJv2eul/VTV+lmuNk5Mny5K76qxAwJ/C+IDPXfRa3M50hqY+bAtTyr2SzhkGcuYMXDhpxwTW +vGzOW/b3aJzcJRVIiKHpqfiYnODz1TEoYRFsZ5aNOZnLwkUkOQIDAQABo0IwQDAPBgNVHRMBAf8E +BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUrWyqlGCc7eT/+j4KdCtjA/e2Wb8wDQYJ +KoZIhvcNAQELBQADggEBABpA2JVlrAmSicY59BDlqQ5mU1143vokkbvnRFHfxhY0Cu9qRFHqKweK +A3rD6z8KLFIWoCtDuSWQP3CpMyVtRRooOyfPqsMpQhvfO0zAMzRbQYi/aytlryjvsvXDqmbOe1bu +t8jLZ8HJnBoYuMTDSQPxYA5QzUbF83d597YV4Djbxy8ooAw/dyZ02SUS2jHaGh7cKUGRIjxpp7sC +8rZcJwOJ9Abqm+RyguOhCcHpABnTPtRwa7pxpqpYrvS76Wy274fMm7v/OeZWYdMKp8RcTGB7BXcm +er/YB1IsYvdwY9k5vG8cwnncdimvzsUsZAReiDZuMdRAGmI0Nj81Aa6sY6A= +-----END CERTIFICATE----- + +GeoTrust Primary Certification Authority - G2 +============================================= +-----BEGIN CERTIFICATE----- +MIICrjCCAjWgAwIBAgIQPLL0SAoA4v7rJDteYD7DazAKBggqhkjOPQQDAzCBmDELMAkGA1UEBhMC +VVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA3IEdlb1RydXN0IElu +Yy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBD +ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMB4XDTA3MTEwNTAwMDAwMFoXDTM4MDExODIzNTk1 +OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykg +MjAwNyBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNVBAMTLUdl +b1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjB2MBAGByqGSM49AgEG +BSuBBAAiA2IABBWx6P0DFUPlrOuHNxFi79KDNlJ9RVcLSo17VDs6bl8VAsBQps8lL33KSLjHUGMc +KiEIfJo22Av+0SbFWDEwKCXzXV2juLaltJLtbCyf691DiaI8S0iRHVDsJt/WYC69IaNCMEAwDwYD +VR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBVfNVdRVfslsq0DafwBo/q+ +EVXVMAoGCCqGSM49BAMDA2cAMGQCMGSWWaboCd6LuvpaiIjwH5HTRqjySkwCY/tsXzjbLkGTqQ7m +ndwxHLKgpxgceeHHNgIwOlavmnRs9vuD4DPTCF+hnMJbn0bWtsuRBmOiBuczrD6ogRLQy7rQkgu2 +npaqBA+K +-----END CERTIFICATE----- + +VeriSign Universal Root Certification Authority +=============================================== +-----BEGIN CERTIFICATE----- +MIIEuTCCA6GgAwIBAgIQQBrEZCGzEyEDDrvkEhrFHTANBgkqhkiG9w0BAQsFADCBvTELMAkGA1UE +BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO +ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk +IHVzZSBvbmx5MTgwNgYDVQQDEy9WZXJpU2lnbiBVbml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9u +IEF1dGhvcml0eTAeFw0wODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIG9MQswCQYDVQQGEwJV +UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv +cmsxOjA4BgNVBAsTMShjKSAyMDA4IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl +IG9ubHkxODA2BgNVBAMTL1ZlcmlTaWduIFVuaXZlcnNhbCBSb290IENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx2E3XrEBNNti1xWb/1hajCMj +1mCOkdeQmIN65lgZOIzF9uVkhbSicfvtvbnazU0AtMgtc6XHaXGVHzk8skQHnOgO+k1KxCHfKWGP +MiJhgsWHH26MfF8WIFFE0XBPV+rjHOPMee5Y2A7Cs0WTwCznmhcrewA3ekEzeOEz4vMQGn+HLL72 +9fdC4uW/h2KJXwBL38Xd5HVEMkE6HnFuacsLdUYI0crSK5XQz/u5QGtkjFdN/BMReYTtXlT2NJ8I +AfMQJQYXStrxHXpma5hgZqTZ79IugvHw7wnqRMkVauIDbjPTrJ9VAMf2CGqUuV/c4DPxhGD5WycR +tPwW8rtWaoAljQIDAQABo4GyMIGvMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMG0G +CCsGAQUFBwEMBGEwX6FdoFswWTBXMFUWCWltYWdlL2dpZjAhMB8wBwYFKw4DAhoEFI/l0xqGrI2O +a8PPgGrUSBgsexkuMCUWI2h0dHA6Ly9sb2dvLnZlcmlzaWduLmNvbS92c2xvZ28uZ2lmMB0GA1Ud +DgQWBBS2d/ppSEefUxLVwuoHMnYH0ZcHGTANBgkqhkiG9w0BAQsFAAOCAQEASvj4sAPmLGd75JR3 +Y8xuTPl9Dg3cyLk1uXBPY/ok+myDjEedO2Pzmvl2MpWRsXe8rJq+seQxIcaBlVZaDrHC1LGmWazx +Y8u4TB1ZkErvkBYoH1quEPuBUDgMbMzxPcP1Y+Oz4yHJJDnp/RVmRvQbEdBNc6N9Rvk97ahfYtTx +P/jgdFcrGJ2BtMQo2pSXpXDrrB2+BxHw1dvd5Yzw1TKwg+ZX4o+/vqGqvz0dtdQ46tewXDpPaj+P +wGZsY6rp2aQW9IHRlRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4 +mJO37M2CYfE45k+XmCpajQ== +-----END CERTIFICATE----- + +VeriSign Class 3 Public Primary Certification Authority - G4 +============================================================ +-----BEGIN CERTIFICATE----- +MIIDhDCCAwqgAwIBAgIQL4D+I4wOIg9IZxIokYesszAKBggqhkjOPQQDAzCByjELMAkGA1UEBhMC +VVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3 +b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVz +ZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmlj +YXRpb24gQXV0aG9yaXR5IC0gRzQwHhcNMDcxMTA1MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCByjEL +MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBU +cnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRo +b3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5 +IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzQwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAASnVnp8 +Utpkmw4tXNherJI9/gHmGUo9FANL+mAnINmDiWn6VMaaGF5VKmTeBvaNSjutEDxlPZCIBIngMGGz +rl0Bp3vefLK+ymVhAIau2o970ImtTR1ZmkGxvEeA3J5iw/mjgbIwga8wDwYDVR0TAQH/BAUwAwEB +/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEw +HzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVyaXNpZ24u +Y29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFLMWkf3upm7ktS5Jj4d4gYDs5bG1MAoGCCqGSM49BAMD +A2gAMGUCMGYhDBgmYFo4e1ZC4Kf8NoRRkSAsdk1DPcQdhCPQrNZ8NQbOzWm9kA3bbEhCHQ6qQgIx +AJw9SDkjOVgaFRJZap7v1VmyHVIsmXHNxynfGyphe3HR3vPA5Q06Sqotp9iGKt0uEA== +-----END CERTIFICATE----- + +NetLock Arany (Class Gold) Főtanúsítvány +============================================ +-----BEGIN CERTIFICATE----- +MIIEFTCCAv2gAwIBAgIGSUEs5AAQMA0GCSqGSIb3DQEBCwUAMIGnMQswCQYDVQQGEwJIVTERMA8G +A1UEBwwIQnVkYXBlc3QxFTATBgNVBAoMDE5ldExvY2sgS2Z0LjE3MDUGA1UECwwuVGFuw7pzw610 +dsOhbnlraWFkw7NrIChDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzKTE1MDMGA1UEAwwsTmV0TG9jayBB +cmFueSAoQ2xhc3MgR29sZCkgRsWRdGFuw7pzw610dsOhbnkwHhcNMDgxMjExMTUwODIxWhcNMjgx +MjA2MTUwODIxWjCBpzELMAkGA1UEBhMCSFUxETAPBgNVBAcMCEJ1ZGFwZXN0MRUwEwYDVQQKDAxO +ZXRMb2NrIEtmdC4xNzA1BgNVBAsMLlRhbsO6c8OtdHbDoW55a2lhZMOzayAoQ2VydGlmaWNhdGlv +biBTZXJ2aWNlcykxNTAzBgNVBAMMLE5ldExvY2sgQXJhbnkgKENsYXNzIEdvbGQpIEbFkXRhbsO6 +c8OtdHbDoW55MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxCRec75LbRTDofTjl5Bu +0jBFHjzuZ9lk4BqKf8owyoPjIMHj9DrTlF8afFttvzBPhCf2nx9JvMaZCpDyD/V/Q4Q3Y1GLeqVw +/HpYzY6b7cNGbIRwXdrzAZAj/E4wqX7hJ2Pn7WQ8oLjJM2P+FpD/sLj916jAwJRDC7bVWaaeVtAk +H3B5r9s5VA1lddkVQZQBr17s9o3x/61k/iCa11zr/qYfCGSji3ZVrR47KGAuhyXoqq8fxmRGILdw +fzzeSNuWU7c5d+Qa4scWhHaXWy+7GRWF+GmF9ZmnqfI0p6m2pgP8b4Y9VHx2BJtr+UBdADTHLpl1 +neWIA6pN+APSQnbAGwIDAKiLo0UwQzASBgNVHRMBAf8ECDAGAQH/AgEEMA4GA1UdDwEB/wQEAwIB +BjAdBgNVHQ4EFgQUzPpnk/C2uNClwB7zU/2MU9+D15YwDQYJKoZIhvcNAQELBQADggEBAKt/7hwW +qZw8UQCgwBEIBaeZ5m8BiFRhbvG5GK1Krf6BQCOUL/t1fC8oS2IkgYIL9WHxHG64YTjrgfpioTta +YtOUZcTh5m2C+C8lcLIhJsFyUR+MLMOEkMNaj7rP9KdlpeuY0fsFskZ1FSNqb4VjMIDw1Z4fKRzC +bLBQWV2QWzuoDTDPv31/zvGdg73JRm4gpvlhUbohL3u+pRVjodSVh/GeufOJ8z2FuLjbvrW5Kfna +NwUASZQDhETnv0Mxz3WLJdH0pmT1kvarBes96aULNmLazAZfNou2XjG4Kvte9nHfRCaexOYNkbQu +dZWAUWpLMKawYqGT8ZvYzsRjdT9ZR7E= +-----END CERTIFICATE----- + +Staat der Nederlanden Root CA - G2 +================================== +-----BEGIN CERTIFICATE----- +MIIFyjCCA7KgAwIBAgIEAJiWjDANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJOTDEeMBwGA1UE +CgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFhdCBkZXIgTmVkZXJsYW5kZW4g +Um9vdCBDQSAtIEcyMB4XDTA4MDMyNjExMTgxN1oXDTIwMDMyNTExMDMxMFowWjELMAkGA1UEBhMC +TkwxHjAcBgNVBAoMFVN0YWF0IGRlciBOZWRlcmxhbmRlbjErMCkGA1UEAwwiU3RhYXQgZGVyIE5l +ZGVybGFuZGVuIFJvb3QgQ0EgLSBHMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMVZ +5291qj5LnLW4rJ4L5PnZyqtdj7U5EILXr1HgO+EASGrP2uEGQxGZqhQlEq0i6ABtQ8SpuOUfiUtn +vWFI7/3S4GCI5bkYYCjDdyutsDeqN95kWSpGV+RLufg3fNU254DBtvPUZ5uW6M7XxgpT0GtJlvOj +CwV3SPcl5XCsMBQgJeN/dVrlSPhOewMHBPqCYYdu8DvEpMfQ9XQ+pV0aCPKbJdL2rAQmPlU6Yiil +e7Iwr/g3wtG61jj99O9JMDeZJiFIhQGp5Rbn3JBV3w/oOM2ZNyFPXfUib2rFEhZgF1XyZWampzCR +OME4HYYEhLoaJXhena/MUGDWE4dS7WMfbWV9whUYdMrhfmQpjHLYFhN9C0lK8SgbIHRrxT3dsKpI +CT0ugpTNGmXZK4iambwYfp/ufWZ8Pr2UuIHOzZgweMFvZ9C+X+Bo7d7iscksWXiSqt8rYGPy5V65 +48r6f1CGPqI0GAwJaCgRHOThuVw+R7oyPxjMW4T182t0xHJ04eOLoEq9jWYv6q012iDTiIJh8BIi +trzQ1aTsr1SIJSQ8p22xcik/Plemf1WvbibG/ufMQFxRRIEKeN5KzlW/HdXZt1bv8Hb/C3m1r737 +qWmRRpdogBQ2HbN/uymYNqUg+oJgYjOk7Na6B6duxc8UpufWkjTYgfX8HV2qXB72o007uPc5AgMB +AAGjgZcwgZQwDwYDVR0TAQH/BAUwAwEB/zBSBgNVHSAESzBJMEcGBFUdIAAwPzA9BggrBgEFBQcC +ARYxaHR0cDovL3d3dy5wa2lvdmVyaGVpZC5ubC9wb2xpY2llcy9yb290LXBvbGljeS1HMjAOBgNV +HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJFoMocVHYnitfGsNig0jQt8YojrMA0GCSqGSIb3DQEBCwUA +A4ICAQCoQUpnKpKBglBu4dfYszk78wIVCVBR7y29JHuIhjv5tLySCZa59sCrI2AGeYwRTlHSeYAz ++51IvuxBQ4EffkdAHOV6CMqqi3WtFMTC6GY8ggen5ieCWxjmD27ZUD6KQhgpxrRW/FYQoAUXvQwj +f/ST7ZwaUb7dRUG/kSS0H4zpX897IZmflZ85OkYcbPnNe5yQzSipx6lVu6xiNGI1E0sUOlWDuYaN +kqbG9AclVMwWVxJKgnjIFNkXgiYtXSAfea7+1HAWFpWD2DU5/1JddRwWxRNVz0fMdWVSSt7wsKfk +CpYL+63C4iWEst3kvX5ZbJvw8NjnyvLplzh+ib7M+zkXYT9y2zqR2GUBGR2tUKRXCnxLvJxxcypF +URmFzI79R6d0lR2o0a9OF7FpJsKqeFdbxU2n5Z4FF5TKsl+gSRiNNOkmbEgeqmiSBeGCc1qb3Adb +CG19ndeNIdn8FCCqwkXfP+cAslHkwvgFuXkajDTznlvkN1trSt8sV4pAWja63XVECDdCcAz+3F4h +oKOKwJCcaNpQ5kUQR3i2TtJlycM33+FCY7BXN0Ute4qcvwXqZVUz9zkQxSgqIXobisQk+T8VyJoV +IPVVYpbtbZNQvOSqeK3Zywplh6ZmwcSBo3c6WB4L7oOLnR7SUqTMHW+wmG2UMbX4cQrcufx9MmDm +66+KAQ== +-----END CERTIFICATE----- + +CA Disig +======== +-----BEGIN CERTIFICATE----- +MIIEDzCCAvegAwIBAgIBATANBgkqhkiG9w0BAQUFADBKMQswCQYDVQQGEwJTSzETMBEGA1UEBxMK +QnJhdGlzbGF2YTETMBEGA1UEChMKRGlzaWcgYS5zLjERMA8GA1UEAxMIQ0EgRGlzaWcwHhcNMDYw +MzIyMDEzOTM0WhcNMTYwMzIyMDEzOTM0WjBKMQswCQYDVQQGEwJTSzETMBEGA1UEBxMKQnJhdGlz +bGF2YTETMBEGA1UEChMKRGlzaWcgYS5zLjERMA8GA1UEAxMIQ0EgRGlzaWcwggEiMA0GCSqGSIb3 +DQEBAQUAA4IBDwAwggEKAoIBAQCS9jHBfYj9mQGp2HvycXXxMcbzdWb6UShGhJd4NLxs/LxFWYgm +GErENx+hSkS943EE9UQX4j/8SFhvXJ56CbpRNyIjZkMhsDxkovhqFQ4/61HhVKndBpnXmjxUizkD +Pw/Fzsbrg3ICqB9x8y34dQjbYkzo+s7552oftms1grrijxaSfQUMbEYDXcDtab86wYqg6I7ZuUUo +hwjstMoVvoLdtUSLLa2GDGhibYVW8qwUYzrG0ZmsNHhWS8+2rT+MitcE5eN4TPWGqvWP+j1scaMt +ymfraHtuM6kMgiioTGohQBUgDCZbg8KpFhXAJIJdKxatymP2dACw30PEEGBWZ2NFAgMBAAGjgf8w +gfwwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUjbJJaJ1yCCW5wCf1UJNWSEZx+Y8wDgYDVR0P +AQH/BAQDAgEGMDYGA1UdEQQvMC2BE2Nhb3BlcmF0b3JAZGlzaWcuc2uGFmh0dHA6Ly93d3cuZGlz +aWcuc2svY2EwZgYDVR0fBF8wXTAtoCugKYYnaHR0cDovL3d3dy5kaXNpZy5zay9jYS9jcmwvY2Ff +ZGlzaWcuY3JsMCygKqAohiZodHRwOi8vY2EuZGlzaWcuc2svY2EvY3JsL2NhX2Rpc2lnLmNybDAa +BgNVHSAEEzARMA8GDSuBHpGT5goAAAABAQEwDQYJKoZIhvcNAQEFBQADggEBAF00dGFMrzvY/59t +WDYcPQuBDRIrRhCA/ec8J9B6yKm2fnQwM6M6int0wHl5QpNt/7EpFIKrIYwvF/k/Ji/1WcbvgAa3 +mkkp7M5+cTxqEEHA9tOasnxakZzArFvITV734VP/Q3f8nktnbNfzg9Gg4H8l37iYC5oyOGwwoPP/ +CBUz91BKez6jPiCp3C9WgArtQVCwyfTssuMmRAAOb54GvCKWU3BlxFAKRmukLyeBEicTXxChds6K +ezfqwzlhA5WYOudsiCUI/HloDYd9Yvi0X/vF2Ey9WLw/Q1vUHgFNPGO+I++MzVpQuGhU+QqZMxEA +4Z7CRneC9VkGjCFMhwnN5ag= +-----END CERTIFICATE----- + +Juur-SK +======= +-----BEGIN CERTIFICATE----- +MIIE5jCCA86gAwIBAgIEO45L/DANBgkqhkiG9w0BAQUFADBdMRgwFgYJKoZIhvcNAQkBFglwa2lA +c2suZWUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKExlBUyBTZXJ0aWZpdHNlZXJpbWlza2Vza3VzMRAw +DgYDVQQDEwdKdXVyLVNLMB4XDTAxMDgzMDE0MjMwMVoXDTE2MDgyNjE0MjMwMVowXTEYMBYGCSqG +SIb3DQEJARYJcGtpQHNrLmVlMQswCQYDVQQGEwJFRTEiMCAGA1UEChMZQVMgU2VydGlmaXRzZWVy +aW1pc2tlc2t1czEQMA4GA1UEAxMHSnV1ci1TSzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBAIFxNj4zB9bjMI0TfncyRsvPGbJgMUaXhvSYRqTCZUXP00B841oiqBB4M8yIsdOBSvZiF3tf +TQou0M+LI+5PAk676w7KvRhj6IAcjeEcjT3g/1tf6mTll+g/mX8MCgkzABpTpyHhOEvWgxutr2TC ++Rx6jGZITWYfGAriPrsfB2WThbkasLnE+w0R9vXW+RvHLCu3GFH+4Hv2qEivbDtPL+/40UceJlfw +UR0zlv/vWT3aTdEVNMfqPxZIe5EcgEMPPbgFPtGzlc3Yyg/CQ2fbt5PgIoIuvvVoKIO5wTtpeyDa +Tpxt4brNj3pssAki14sL2xzVWiZbDcDq5WDQn/413z8CAwEAAaOCAawwggGoMA8GA1UdEwEB/wQF +MAMBAf8wggEWBgNVHSAEggENMIIBCTCCAQUGCisGAQQBzh8BAQEwgfYwgdAGCCsGAQUFBwICMIHD +HoHAAFMAZQBlACAAcwBlAHIAdABpAGYAaQBrAGEAYQB0ACAAbwBuACAAdgDkAGwAagBhAHMAdABh +AHQAdQBkACAAQQBTAC0AaQBzACAAUwBlAHIAdABpAGYAaQB0AHMAZQBlAHIAaQBtAGkAcwBrAGUA +cwBrAHUAcwAgAGEAbABhAG0ALQBTAEsAIABzAGUAcgB0AGkAZgBpAGsAYQBhAHQAaQBkAGUAIABr +AGkAbgBuAGkAdABhAG0AaQBzAGUAawBzMCEGCCsGAQUFBwIBFhVodHRwOi8vd3d3LnNrLmVlL2Nw +cy8wKwYDVR0fBCQwIjAgoB6gHIYaaHR0cDovL3d3dy5zay5lZS9qdXVyL2NybC8wHQYDVR0OBBYE +FASqekej5ImvGs8KQKcYP2/v6X2+MB8GA1UdIwQYMBaAFASqekej5ImvGs8KQKcYP2/v6X2+MA4G +A1UdDwEB/wQEAwIB5jANBgkqhkiG9w0BAQUFAAOCAQEAe8EYlFOiCfP+JmeaUOTDBS8rNXiRTHyo +ERF5TElZrMj3hWVcRrs7EKACr81Ptcw2Kuxd/u+gkcm2k298gFTsxwhwDY77guwqYHhpNjbRxZyL +abVAyJRld/JXIWY7zoVAtjNjGr95HvxcHdMdkxuLDF2FvZkwMhgJkVLpfKG6/2SSmuz+Ne6ML678 +IIbsSt4beDI3poHSna9aEhbKmVv8b20OxaAehsmR0FyYgl9jDIpaq9iVpszLita/ZEuOyoqysOkh +Mp6qqIWYNIE5ITuoOlIyPfZrN4YGWhWY3PARZv40ILcD9EEQfTmEeZZyY7aWAuVrua0ZTbvGRNs2 +yyqcjg== +-----END CERTIFICATE----- + +Hongkong Post Root CA 1 +======================= +-----BEGIN CERTIFICATE----- +MIIDMDCCAhigAwIBAgICA+gwDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoT +DUhvbmdrb25nIFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMB4XDTAzMDUx +NTA1MTMxNFoXDTIzMDUxNTA0NTIyOVowRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoTDUhvbmdrb25n +IFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEArP84tulmAknjorThkPlAj3n54r15/gK97iSSHSL22oVyaf7XPwnU3ZG1 +ApzQjVrhVcNQhrkpJsLj2aDxaQMoIIBFIi1WpztUlVYiWR8o3x8gPW2iNr4joLFutbEnPzlTCeqr +auh0ssJlXI6/fMN4hM2eFvz1Lk8gKgifd/PFHsSaUmYeSF7jEAaPIpjhZY4bXSNmO7ilMlHIhqqh +qZ5/dpTCpmy3QfDVyAY45tQM4vM7TG1QjMSDJ8EThFk9nnV0ttgCXjqQesBCNnLsak3c78QA3xMY +V18meMjWCnl3v/evt3a5pQuEF10Q6m/hq5URX208o1xNg1vysxmKgIsLhwIDAQABoyYwJDASBgNV +HRMBAf8ECDAGAQH/AgEDMA4GA1UdDwEB/wQEAwIBxjANBgkqhkiG9w0BAQUFAAOCAQEADkbVPK7i +h9legYsCmEEIjEy82tvuJxuC52pF7BaLT4Wg87JwvVqWuspube5Gi27nKi6Wsxkz67SfqLI37pio +l7Yutmcn1KZJ/RyTZXaeQi/cImyaT/JaFTmxcdcrUehtHJjA2Sr0oYJ71clBoiMBdDhViw+5Lmei +IAQ32pwL0xch4I+XeTRvhEgCIDMb5jREn5Fw9IBehEPCKdJsEhTkYY2sEJCehFC78JZvRZ+K88ps +T/oROhUVRsPNH4NbLUES7VBnQRM9IauUiqpOfMGx+6fWtScvl6tu4B3i0RwsH0Ti/L6RoZz71ilT +c4afU9hDDl3WY4JxHYB0yvbiAmvZWg== +-----END CERTIFICATE----- + +SecureSign RootCA11 +=================== +-----BEGIN CERTIFICATE----- +MIIDbTCCAlWgAwIBAgIBATANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQGEwJKUDErMCkGA1UEChMi +SmFwYW4gQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcywgSW5jLjEcMBoGA1UEAxMTU2VjdXJlU2lnbiBS +b290Q0ExMTAeFw0wOTA0MDgwNDU2NDdaFw0yOTA0MDgwNDU2NDdaMFgxCzAJBgNVBAYTAkpQMSsw +KQYDVQQKEyJKYXBhbiBDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzLCBJbmMuMRwwGgYDVQQDExNTZWN1 +cmVTaWduIFJvb3RDQTExMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA/XeqpRyQBTvL +TJszi1oURaTnkBbR31fSIRCkF/3frNYfp+TbfPfs37gD2pRY/V1yfIw/XwFndBWW4wI8h9uuywGO +wvNmxoVF9ALGOrVisq/6nL+k5tSAMJjzDbaTj6nU2DbysPyKyiyhFTOVMdrAG/LuYpmGYz+/3ZMq +g6h2uRMft85OQoWPIucuGvKVCbIFtUROd6EgvanyTgp9UK31BQ1FT0Zx/Sg+U/sE2C3XZR1KG/rP +O7AxmjVuyIsG0wCR8pQIZUyxNAYAeoni8McDWc/V1uinMrPmmECGxc0nEovMe863ETxiYAcjPitA +bpSACW22s293bzUIUPsCh8U+iQIDAQABo0IwQDAdBgNVHQ4EFgQUW/hNT7KlhtQ60vFjmqC+CfZX +t94wDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAKCh +OBZmLqdWHyGcBvod7bkixTgm2E5P7KN/ed5GIaGHd48HCJqypMWvDzKYC3xmKbabfSVSSUOrTC4r +bnpwrxYO4wJs+0LmGJ1F2FXI6Dvd5+H0LgscNFxsWEr7jIhQX5Ucv+2rIrVls4W6ng+4reV6G4pQ +Oh29Dbx7VFALuUKvVaAYga1lme++5Jy/xIWrQbJUb9wlze144o4MjQlJ3WN7WmmWAiGovVJZ6X01 +y8hSyn+B/tlr0/cR7SXf+Of5pPpyl4RTDaXQMhhRdlkUbA/r7F+AjHVDg8OFmP9Mni0N5HeDk061 +lgeLKBObjBmNQSdJQO7e5iNEOdyhIta6A/I= +-----END CERTIFICATE----- + +ACEDICOM Root +============= +-----BEGIN CERTIFICATE----- +MIIFtTCCA52gAwIBAgIIYY3HhjsBggUwDQYJKoZIhvcNAQEFBQAwRDEWMBQGA1UEAwwNQUNFRElD +T00gUm9vdDEMMAoGA1UECwwDUEtJMQ8wDQYDVQQKDAZFRElDT00xCzAJBgNVBAYTAkVTMB4XDTA4 +MDQxODE2MjQyMloXDTI4MDQxMzE2MjQyMlowRDEWMBQGA1UEAwwNQUNFRElDT00gUm9vdDEMMAoG +A1UECwwDUEtJMQ8wDQYDVQQKDAZFRElDT00xCzAJBgNVBAYTAkVTMIICIjANBgkqhkiG9w0BAQEF +AAOCAg8AMIICCgKCAgEA/5KV4WgGdrQsyFhIyv2AVClVYyT/kGWbEHV7w2rbYgIB8hiGtXxaOLHk +WLn709gtn70yN78sFW2+tfQh0hOR2QetAQXW8713zl9CgQr5auODAKgrLlUTY4HKRxx7XBZXehuD +YAQ6PmXDzQHe3qTWDLqO3tkE7hdWIpuPY/1NFgu3e3eM+SW10W2ZEi5PGrjm6gSSrj0RuVFCPYew +MYWveVqc/udOXpJPQ/yrOq2lEiZmueIM15jO1FillUAKt0SdE3QrwqXrIhWYENiLxQSfHY9g5QYb +m8+5eaA9oiM/Qj9r+hwDezCNzmzAv+YbX79nuIQZ1RXve8uQNjFiybwCq0Zfm/4aaJQ0PZCOrfbk +HQl/Sog4P75n/TSW9R28MHTLOO7VbKvU/PQAtwBbhTIWdjPp2KOZnQUAqhbm84F9b32qhm2tFXTT +xKJxqvQUfecyuB+81fFOvW8XAjnXDpVCOscAPukmYxHqC9FK/xidstd7LzrZlvvoHpKuE1XI2Sf2 +3EgbsCTBheN3nZqk8wwRHQ3ItBTutYJXCb8gWH8vIiPYcMt5bMlL8qkqyPyHK9caUPgn6C9D4zq9 +2Fdx/c6mUlv53U3t5fZvie27k5x2IXXwkkwp9y+cAS7+UEaeZAwUswdbxcJzbPEHXEUkFDWug/Fq +TYl6+rPYLWbwNof1K1MCAwEAAaOBqjCBpzAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFKaz +4SsrSbbXc6GqlPUB53NlTKxQMA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUprPhKytJttdzoaqU +9QHnc2VMrFAwRAYDVR0gBD0wOzA5BgRVHSAAMDEwLwYIKwYBBQUHAgEWI2h0dHA6Ly9hY2VkaWNv +bS5lZGljb21ncm91cC5jb20vZG9jMA0GCSqGSIb3DQEBBQUAA4ICAQDOLAtSUWImfQwng4/F9tqg +aHtPkl7qpHMyEVNEskTLnewPeUKzEKbHDZ3Ltvo/Onzqv4hTGzz3gvoFNTPhNahXwOf9jU8/kzJP +eGYDdwdY6ZXIfj7QeQCM8htRM5u8lOk6e25SLTKeI6RF+7YuE7CLGLHdztUdp0J/Vb77W7tH1Pwk +zQSulgUV1qzOMPPKC8W64iLgpq0i5ALudBF/TP94HTXa5gI06xgSYXcGCRZj6hitoocf8seACQl1 +ThCojz2GuHURwCRiipZ7SkXp7FnFvmuD5uHorLUwHv4FB4D54SMNUI8FmP8sX+g7tq3PgbUhh8oI +KiMnMCArz+2UW6yyetLHKKGKC5tNSixthT8Jcjxn4tncB7rrZXtaAWPWkFtPF2Y9fwsZo5NjEFIq +nxQWWOLcpfShFosOkYuByptZ+thrkQdlVV9SH686+5DdaaVbnG0OLLb6zqylfDJKZ0DcMDQj3dcE +I2bw/FWAp/tmGYI1Z2JwOV5vx+qQQEQIHriy1tvuWacNGHk0vFQYXlPKNFHtRQrmjseCNj6nOGOp +MCwXEGCSn1WHElkQwg9naRHMTh5+Spqtr0CodaxWkHS4oJyleW/c6RrIaQXpuvoDs3zk4E7Czp3o +tkYNbn5XOmeUwssfnHdKZ05phkOTOPu220+DkdRgfks+KzgHVZhepA== +-----END CERTIFICATE----- + +Verisign Class 1 Public Primary Certification Authority +======================================================= +-----BEGIN CERTIFICATE----- +MIICPDCCAaUCED9pHoGc8JpK83P/uUii5N0wDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCVVMx +FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAxIFB1YmxpYyBQcmltYXJ5 +IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVow +XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAx +IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA +A4GNADCBiQKBgQDlGb9to1ZhLZlIcfZn3rmN67eehoAKkQ76OCWvRoiC5XOooJskXQ0fzGVuDLDQ +VoQYh5oGmxChc9+0WDlrbsH2FdWoqD+qEgaNMax/sDTXjzRniAnNFBHiTkVWaR94AoDa3EeRKbs2 +yWNcxeDXLYd7obcysHswuiovMaruo2fa2wIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFgVKTk8d6Pa +XCUDfGD67gmZPCcQcMgMCeazh88K4hiWNWLMv5sneYlfycQJ9M61Hd8qveXbhpxoJeUwfLaJFf5n +0a3hUKw8fGJLj7qE1xIVGx/KXQ/BUpQqEZnae88MNhPVNdwQGVnqlMEAv3WP2fr9dgTbYruQagPZ +RjXZ+Hxb +-----END CERTIFICATE----- + +Verisign Class 3 Public Primary Certification Authority +======================================================= +-----BEGIN CERTIFICATE----- +MIICPDCCAaUCEDyRMcsf9tAbDpq40ES/Er4wDQYJKoZIhvcNAQEFBQAwXzELMAkGA1UEBhMCVVMx +FzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmltYXJ5 +IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2MDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVow +XzELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAz +IFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUA +A4GNADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhEBarsAx94 +f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/isI19wKTakyYbnsZogy1Ol +hec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBABByUqkFFBky +CEHwxWsKzH4PIRnN5GfcX6kb5sroc50i2JhucwNhkcV8sEVAbkSdjbCxlnRhLQ2pRdKkkirWmnWX +bj9T/UWZYB2oK0z5XqcJ2HUw19JlYD1n1khVdWk/kfVIC0dpImmClr7JyDiGSnoscxlIaU5rfGW/ +D/xwzoiQ +-----END CERTIFICATE----- + +Microsec e-Szigno Root CA 2009 +============================== +-----BEGIN CERTIFICATE----- +MIIECjCCAvKgAwIBAgIJAMJ+QwRORz8ZMA0GCSqGSIb3DQEBCwUAMIGCMQswCQYDVQQGEwJIVTER +MA8GA1UEBwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jv +c2VjIGUtU3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5o +dTAeFw0wOTA2MTYxMTMwMThaFw0yOTEyMzAxMTMwMThaMIGCMQswCQYDVQQGEwJIVTERMA8GA1UE +BwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jvc2VjIGUt +U3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5odTCCASIw +DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOn4j/NjrdqG2KfgQvvPkd6mJviZpWNwrZuuyjNA +fW2WbqEORO7hE52UQlKavXWFdCyoDh2Tthi3jCyoz/tccbna7P7ofo/kLx2yqHWH2Leh5TvPmUpG +0IMZfcChEhyVbUr02MelTTMuhTlAdX4UfIASmFDHQWe4oIBhVKZsTh/gnQ4H6cm6M+f+wFUoLAKA +pxn1ntxVUwOXewdI/5n7N4okxFnMUBBjjqqpGrCEGob5X7uxUG6k0QrM1XF+H6cbfPVTbiJfyyvm +1HxdrtbCxkzlBQHZ7Vf8wSN5/PrIJIOV87VqUQHQd9bpEqH5GoP7ghu5sJf0dgYzQ0mg/wu1+rUC +AwEAAaOBgDB+MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTLD8bf +QkPMPcu1SCOhGnqmKrs0aDAfBgNVHSMEGDAWgBTLD8bfQkPMPcu1SCOhGnqmKrs0aDAbBgNVHREE +FDASgRBpbmZvQGUtc3ppZ25vLmh1MA0GCSqGSIb3DQEBCwUAA4IBAQDJ0Q5eLtXMs3w+y/w9/w0o +lZMEyL/azXm4Q5DwpL7v8u8hmLzU1F0G9u5C7DBsoKqpyvGvivo/C3NqPuouQH4frlRheesuCDfX +I/OMn74dseGkddug4lQUsbocKaQY9hK6ohQU4zE1yED/t+AFdlfBHFny+L/k7SViXITwfn4fs775 +tyERzAMBVnCnEJIeGzSBHq2cGsMEPO0CYdYeBvNfOofyK/FFh+U9rNHHV4S9a67c2Pm2G2JwCz02 +yULyMtd6YebS2z3PyKnJm9zbWETXbzivf3jTo60adbocwTZ8jx5tHMN1Rq41Bab2XD0h7lbwyYIi +LXpUq3DDfSJlgnCW +-----END CERTIFICATE----- + +E-Guven Kok Elektronik Sertifika Hizmet Saglayicisi +=================================================== +-----BEGIN CERTIFICATE----- +MIIDtjCCAp6gAwIBAgIQRJmNPMADJ72cdpW56tustTANBgkqhkiG9w0BAQUFADB1MQswCQYDVQQG +EwJUUjEoMCYGA1UEChMfRWxla3Ryb25payBCaWxnaSBHdXZlbmxpZ2kgQS5TLjE8MDoGA1UEAxMz +ZS1HdXZlbiBLb2sgRWxla3Ryb25payBTZXJ0aWZpa2EgSGl6bWV0IFNhZ2xheWljaXNpMB4XDTA3 +MDEwNDExMzI0OFoXDTE3MDEwNDExMzI0OFowdTELMAkGA1UEBhMCVFIxKDAmBgNVBAoTH0VsZWt0 +cm9uaWsgQmlsZ2kgR3V2ZW5saWdpIEEuUy4xPDA6BgNVBAMTM2UtR3V2ZW4gS29rIEVsZWt0cm9u +aWsgU2VydGlmaWthIEhpem1ldCBTYWdsYXlpY2lzaTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBAMMSIJ6wXgBljU5Gu4Bc6SwGl9XzcslwuedLZYDBS75+PNdUMZTe1RK6UxYC6lhj71vY +8+0qGqpxSKPcEC1fX+tcS5yWCEIlKBHMilpiAVDV6wlTL/jDj/6z/P2douNffb7tC+Bg62nsM+3Y +jfsSSYMAyYuXjDtzKjKzEve5TfL0TW3H5tYmNwjy2f1rXKPlSFxYvEK+A1qBuhw1DADT9SN+cTAI +JjjcJRFHLfO6IxClv7wC90Nex/6wN1CZew+TzuZDLMN+DfIcQ2Zgy2ExR4ejT669VmxMvLz4Bcpk +9Ok0oSy1c+HCPujIyTQlCFzz7abHlJ+tiEMl1+E5YP6sOVkCAwEAAaNCMEAwDgYDVR0PAQH/BAQD +AgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFJ/uRLOU1fqRTy7ZVZoEVtstxNulMA0GCSqG +SIb3DQEBBQUAA4IBAQB/X7lTW2M9dTLn+sR0GstG30ZpHFLPqk/CaOv/gKlR6D1id4k9CnU58W5d +F4dvaAXBlGzZXd/aslnLpRCKysw5zZ/rTt5S/wzw9JKp8mxTq5vSR6AfdPebmvEvFZ96ZDAYBzwq +D2fK/A+JYZ1lpTzlvBNbCNvj/+27BrtqBrF6T2XGgv0enIu1De5Iu7i9qgi0+6N8y5/NkHZchpZ4 +Vwpm+Vganf2XKWDeEaaQHBkc7gGWIjQ0LpH5t8Qn0Xvmv/uARFoW5evg1Ao4vOSR49XrXMGs3xtq +fJ7lddK2l4fbzIcrQzqECK+rPNv3PGYxhrCdU3nt+CPeQuMtgvEP5fqX +-----END CERTIFICATE----- + +GlobalSign Root CA - R3 +======================= +-----BEGIN CERTIFICATE----- +MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4GA1UECxMXR2xv +YmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh +bFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxT +aWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2ln +bjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWt +iHL8RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsTgHeMCOFJ +0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmmKPZpO/bLyCiR5Z2KYVc3 +rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zdQQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjl +OCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZXriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2 +xmmFghcCAwEAAaNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE +FI/wS3+oLkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZURUm7 +lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMpjjM5RcOO5LlXbKr8 +EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK6fBdRoyV3XpYKBovHd7NADdBj+1E +bddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQXmcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18 +YIvDQVETI53O9zJrlAGomecsMx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7r +kpeDMdmztcpHWD9f +-----END CERTIFICATE----- + +TC TrustCenter Universal CA III +=============================== +-----BEGIN CERTIFICATE----- +MIID4TCCAsmgAwIBAgIOYyUAAQACFI0zFQLkbPQwDQYJKoZIhvcNAQEFBQAwezELMAkGA1UEBhMC +REUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxJDAiBgNVBAsTG1RDIFRydXN0Q2VudGVy +IFVuaXZlcnNhbCBDQTEoMCYGA1UEAxMfVEMgVHJ1c3RDZW50ZXIgVW5pdmVyc2FsIENBIElJSTAe +Fw0wOTA5MDkwODE1MjdaFw0yOTEyMzEyMzU5NTlaMHsxCzAJBgNVBAYTAkRFMRwwGgYDVQQKExNU +QyBUcnVzdENlbnRlciBHbWJIMSQwIgYDVQQLExtUQyBUcnVzdENlbnRlciBVbml2ZXJzYWwgQ0Ex +KDAmBgNVBAMTH1RDIFRydXN0Q2VudGVyIFVuaXZlcnNhbCBDQSBJSUkwggEiMA0GCSqGSIb3DQEB +AQUAA4IBDwAwggEKAoIBAQDC2pxisLlxErALyBpXsq6DFJmzNEubkKLF5+cvAqBNLaT6hdqbJYUt +QCggbergvbFIgyIpRJ9Og+41URNzdNW88jBmlFPAQDYvDIRlzg9uwliT6CwLOunBjvvya8o84pxO +juT5fdMnnxvVZ3iHLX8LR7PH6MlIfK8vzArZQe+f/prhsq75U7Xl6UafYOPfjdN/+5Z+s7Vy+Eut +CHnNaYlAJ/Uqwa1D7KRTyGG299J5KmcYdkhtWyUB0SbFt1dpIxVbYYqt8Bst2a9c8SaQaanVDED1 +M4BDj5yjdipFtK+/fz6HP3bFzSreIMUWWMv5G/UPyw0RUmS40nZid4PxWJ//AgMBAAGjYzBhMB8G +A1UdIwQYMBaAFFbn4VslQ4Dg9ozhcbyO5YAvxEjiMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/ +BAQDAgEGMB0GA1UdDgQWBBRW5+FbJUOA4PaM4XG8juWAL8RI4jANBgkqhkiG9w0BAQUFAAOCAQEA +g8ev6n9NCjw5sWi+e22JLumzCecYV42FmhfzdkJQEw/HkG8zrcVJYCtsSVgZ1OK+t7+rSbyUyKu+ +KGwWaODIl0YgoGhnYIg5IFHYaAERzqf2EQf27OysGh+yZm5WZ2B6dF7AbZc2rrUNXWZzwCUyRdhK +BgePxLcHsU0GDeGl6/R1yrqc0L2z0zIkTO5+4nYES0lT2PLpVDP85XEfPRRclkvxOvIAu2y0+pZV +CIgJwcyRGSmwIC3/yzikQOEXvnlhgP8HA4ZMTnsGnxGGjYnuJ8Tb4rwZjgvDwxPHLQNjO9Po5KIq +woIIlBZU8O8fJ5AluA0OKBtHd0e9HKgl8ZS0Zg== +-----END CERTIFICATE----- + +Autoridad de Certificacion Firmaprofesional CIF A62634068 +========================================================= +-----BEGIN CERTIFICATE----- +MIIGFDCCA/ygAwIBAgIIU+w77vuySF8wDQYJKoZIhvcNAQEFBQAwUTELMAkGA1UEBhMCRVMxQjBA +BgNVBAMMOUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2 +MjYzNDA2ODAeFw0wOTA1MjAwODM4MTVaFw0zMDEyMzEwODM4MTVaMFExCzAJBgNVBAYTAkVTMUIw +QAYDVQQDDDlBdXRvcmlkYWQgZGUgQ2VydGlmaWNhY2lvbiBGaXJtYXByb2Zlc2lvbmFsIENJRiBB +NjI2MzQwNjgwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDKlmuO6vj78aI14H9M2uDD +Utd9thDIAl6zQyrET2qyyhxdKJp4ERppWVevtSBC5IsP5t9bpgOSL/UR5GLXMnE42QQMcas9UX4P +B99jBVzpv5RvwSmCwLTaUbDBPLutN0pcyvFLNg4kq7/DhHf9qFD0sefGL9ItWY16Ck6WaVICqjaY +7Pz6FIMMNx/Jkjd/14Et5cS54D40/mf0PmbR0/RAz15iNA9wBj4gGFrO93IbJWyTdBSTo3OxDqqH +ECNZXyAFGUftaI6SEspd/NYrspI8IM/hX68gvqB2f3bl7BqGYTM+53u0P6APjqK5am+5hyZvQWyI +plD9amML9ZMWGxmPsu2bm8mQ9QEM3xk9Dz44I8kvjwzRAv4bVdZO0I08r0+k8/6vKtMFnXkIoctX +MbScyJCyZ/QYFpM6/EfY0XiWMR+6KwxfXZmtY4laJCB22N/9q06mIqqdXuYnin1oKaPnirjaEbsX +LZmdEyRG98Xi2J+Of8ePdG1asuhy9azuJBCtLxTa/y2aRnFHvkLfuwHb9H/TKI8xWVvTyQKmtFLK +bpf7Q8UIJm+K9Lv9nyiqDdVF8xM6HdjAeI9BZzwelGSuewvF6NkBiDkal4ZkQdU7hwxu+g/GvUgU +vzlN1J5Bto+WHWOWk9mVBngxaJ43BjuAiUVhOSPHG0SjFeUc+JIwuwIDAQABo4HvMIHsMBIGA1Ud +EwEB/wQIMAYBAf8CAQEwDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRlzeurNR4APn7VdMActHNH +DhpkLzCBpgYDVR0gBIGeMIGbMIGYBgRVHSAAMIGPMC8GCCsGAQUFBwIBFiNodHRwOi8vd3d3LmZp +cm1hcHJvZmVzaW9uYWwuY29tL2NwczBcBggrBgEFBQcCAjBQHk4AUABhAHMAZQBvACAAZABlACAA +bABhACAAQgBvAG4AYQBuAG8AdgBhACAANAA3ACAAQgBhAHIAYwBlAGwAbwBuAGEAIAAwADgAMAAx +ADcwDQYJKoZIhvcNAQEFBQADggIBABd9oPm03cXF661LJLWhAqvdpYhKsg9VSytXjDvlMd3+xDLx +51tkljYyGOylMnfX40S2wBEqgLk9am58m9Ot/MPWo+ZkKXzR4Tgegiv/J2Wv+xYVxC5xhOW1//qk +R71kMrv2JYSiJ0L1ILDCExARzRAVukKQKtJE4ZYm6zFIEv0q2skGz3QeqUvVhyj5eTSSPi5E6PaP +T481PyWzOdxjKpBrIF/EUhJOlywqrJ2X3kjyo2bbwtKDlaZmp54lD+kLM5FlClrD2VQS3a/DTg4f +Jl4N3LON7NWBcN7STyQF82xO9UxJZo3R/9ILJUFI/lGExkKvgATP0H5kSeTy36LssUzAKh3ntLFl +osS88Zj0qnAHY7S42jtM+kAiMFsRpvAFDsYCA0irhpuF3dvd6qJ2gHN99ZwExEWN57kci57q13XR +crHedUTnQn3iV2t93Jm8PYMo6oCTjcVMZcFwgbg4/EMxsvYDNEeyrPsiBsse3RdHHF9mudMaotoR +saS8I8nkvof/uZS2+F0gStRf571oe2XyFR7SOqkt6dhrJKyXWERHrVkY8SFlcN7ONGCoQPHzPKTD +KCOM/iczQ0CgFzzr6juwcqajuUpLXhZI9LK8yIySxZ2frHI2vDSANGupi5LAuBft7HZT9SQBjLMi +6Et8Vcad+qMUu2WFbm5PEn4KPJ2V +-----END CERTIFICATE----- + +Izenpe.com +========== +-----BEGIN CERTIFICATE----- +MIIF8TCCA9mgAwIBAgIQALC3WhZIX7/hy/WL1xnmfTANBgkqhkiG9w0BAQsFADA4MQswCQYDVQQG +EwJFUzEUMBIGA1UECgwLSVpFTlBFIFMuQS4xEzARBgNVBAMMCkl6ZW5wZS5jb20wHhcNMDcxMjEz +MTMwODI4WhcNMzcxMjEzMDgyNzI1WjA4MQswCQYDVQQGEwJFUzEUMBIGA1UECgwLSVpFTlBFIFMu +QS4xEzARBgNVBAMMCkl6ZW5wZS5jb20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDJ +03rKDx6sp4boFmVqscIbRTJxldn+EFvMr+eleQGPicPK8lVx93e+d5TzcqQsRNiekpsUOqHnJJAK +ClaOxdgmlOHZSOEtPtoKct2jmRXagaKH9HtuJneJWK3W6wyyQXpzbm3benhB6QiIEn6HLmYRY2xU ++zydcsC8Lv/Ct90NduM61/e0aL6i9eOBbsFGb12N4E3GVFWJGjMxCrFXuaOKmMPsOzTFlUFpfnXC +PCDFYbpRR6AgkJOhkEvzTnyFRVSa0QUmQbC1TR0zvsQDyCV8wXDbO/QJLVQnSKwv4cSsPsjLkkxT +OTcj7NMB+eAJRE1NZMDhDVqHIrytG6P+JrUV86f8hBnp7KGItERphIPzidF0BqnMC9bC3ieFUCbK +F7jJeodWLBoBHmy+E60QrLUk9TiRodZL2vG70t5HtfG8gfZZa88ZU+mNFctKy6lvROUbQc/hhqfK +0GqfvEyNBjNaooXlkDWgYlwWTvDjovoDGrQscbNYLN57C9saD+veIR8GdwYDsMnvmfzAuU8Lhij+ +0rnq49qlw0dpEuDb8PYZi+17cNcC1u2HGCgsBCRMd+RIihrGO5rUD8r6ddIBQFqNeb+Lz0vPqhbB +leStTIo+F5HUsWLlguWABKQDfo2/2n+iD5dPDNMN+9fR5XJ+HMh3/1uaD7euBUbl8agW7EekFwID +AQABo4H2MIHzMIGwBgNVHREEgagwgaWBD2luZm9AaXplbnBlLmNvbaSBkTCBjjFHMEUGA1UECgw+ +SVpFTlBFIFMuQS4gLSBDSUYgQTAxMzM3MjYwLVJNZXJjLlZpdG9yaWEtR2FzdGVpeiBUMTA1NSBG +NjIgUzgxQzBBBgNVBAkMOkF2ZGEgZGVsIE1lZGl0ZXJyYW5lbyBFdG9yYmlkZWEgMTQgLSAwMTAx +MCBWaXRvcmlhLUdhc3RlaXowDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0O +BBYEFB0cZQ6o8iV7tJHP5LGx5r1VdGwFMA0GCSqGSIb3DQEBCwUAA4ICAQB4pgwWSp9MiDrAyw6l +Fn2fuUhfGI8NYjb2zRlrrKvV9pF9rnHzP7MOeIWblaQnIUdCSnxIOvVFfLMMjlF4rJUT3sb9fbga +kEyrkgPH7UIBzg/YsfqikuFgba56awmqxinuaElnMIAkejEWOVt+8Rwu3WwJrfIxwYJOubv5vr8q +hT/AQKM6WfxZSzwoJNu0FXWuDYi6LnPAvViH5ULy617uHjAimcs30cQhbIHsvm0m5hzkQiCeR7Cs +g1lwLDXWrzY0tM07+DKo7+N4ifuNRSzanLh+QBxh5z6ikixL8s36mLYp//Pye6kfLqCTVyvehQP5 +aTfLnnhqBbTFMXiJ7HqnheG5ezzevh55hM6fcA5ZwjUukCox2eRFekGkLhObNA5me0mrZJfQRsN5 +nXJQY6aYWwa9SG3YOYNw6DXwBdGqvOPbyALqfP2C2sJbUjWumDqtujWTI6cfSN01RpiyEGjkpTHC +ClguGYEQyVB1/OpaFs4R1+7vUIgtYf8/QnMFlEPVjjxOAToZpR9GTnfQXeWBIiGH/pR9hNiTrdZo +Q0iy2+tzJOeRf1SktoA+naM8THLCV8Sg1Mw4J87VBp6iSNnpn86CcDaTmjvfliHjWbcM2pE38P1Z +WrOZyGlsQyYBNWNgVYkDOnXYukrZVP/u3oDYLdE41V4tC5h9Pmzb/CaIxw== +-----END CERTIFICATE----- + +Chambers of Commerce Root - 2008 +================================ +-----BEGIN CERTIFICATE----- +MIIHTzCCBTegAwIBAgIJAKPaQn6ksa7aMA0GCSqGSIb3DQEBBQUAMIGuMQswCQYDVQQGEwJFVTFD +MEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNv +bS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMu +QS4xKTAnBgNVBAMTIENoYW1iZXJzIG9mIENvbW1lcmNlIFJvb3QgLSAyMDA4MB4XDTA4MDgwMTEy +Mjk1MFoXDTM4MDczMTEyMjk1MFowga4xCzAJBgNVBAYTAkVVMUMwQQYDVQQHEzpNYWRyaWQgKHNl +ZSBjdXJyZW50IGFkZHJlc3MgYXQgd3d3LmNhbWVyZmlybWEuY29tL2FkZHJlc3MpMRIwEAYDVQQF +EwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENhbWVyZmlybWEgUy5BLjEpMCcGA1UEAxMgQ2hhbWJl +cnMgb2YgQ29tbWVyY2UgUm9vdCAtIDIwMDgwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +AQCvAMtwNyuAWko6bHiUfaN/Gh/2NdW928sNRHI+JrKQUrpjOyhYb6WzbZSm891kDFX29ufyIiKA +XuFixrYp4YFs8r/lfTJqVKAyGVn+H4vXPWCGhSRv4xGzdz4gljUha7MI2XAuZPeEklPWDrCQiorj +h40G072QDuKZoRuGDtqaCrsLYVAGUvGef3bsyw/QHg3PmTA9HMRFEFis1tPo1+XqxQEHd9ZR5gN/ +ikilTWh1uem8nk4ZcfUyS5xtYBkL+8ydddy/Js2Pk3g5eXNeJQ7KXOt3EgfLZEFHcpOrUMPrCXZk +NNI5t3YRCQ12RcSprj1qr7V9ZS+UWBDsXHyvfuK2GNnQm05aSd+pZgvMPMZ4fKecHePOjlO+Bd5g +D2vlGts/4+EhySnB8esHnFIbAURRPHsl18TlUlRdJQfKFiC4reRB7noI/plvg6aRArBsNlVq5331 +lubKgdaX8ZSD6e2wsWsSaR6s+12pxZjptFtYer49okQ6Y1nUCyXeG0+95QGezdIp1Z8XGQpvvwyQ +0wlf2eOKNcx5Wk0ZN5K3xMGtr/R5JJqyAQuxr1yW84Ay+1w9mPGgP0revq+ULtlVmhduYJ1jbLhj +ya6BXBg14JC7vjxPNyK5fuvPnnchpj04gftI2jE9K+OJ9dC1vX7gUMQSibMjmhAxhduub+84Mxh2 +EQIDAQABo4IBbDCCAWgwEgYDVR0TAQH/BAgwBgEB/wIBDDAdBgNVHQ4EFgQU+SSsD7K1+HnA+mCI +G8TZTQKeFxkwgeMGA1UdIwSB2zCB2IAU+SSsD7K1+HnA+mCIG8TZTQKeFxmhgbSkgbEwga4xCzAJ +BgNVBAYTAkVVMUMwQQYDVQQHEzpNYWRyaWQgKHNlZSBjdXJyZW50IGFkZHJlc3MgYXQgd3d3LmNh +bWVyZmlybWEuY29tL2FkZHJlc3MpMRIwEAYDVQQFEwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENh +bWVyZmlybWEgUy5BLjEpMCcGA1UEAxMgQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdCAtIDIwMDiC +CQCj2kJ+pLGu2jAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRVHSAAMCowKAYIKwYBBQUH +AgEWHGh0dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20wDQYJKoZIhvcNAQEFBQADggIBAJASryI1 +wqM58C7e6bXpeHxIvj99RZJe6dqxGfwWPJ+0W2aeaufDuV2I6A+tzyMP3iU6XsxPpcG1Lawk0lgH +3qLPaYRgM+gQDROpI9CF5Y57pp49chNyM/WqfcZjHwj0/gF/JM8rLFQJ3uIrbZLGOU8W6jx+ekbU +RWpGqOt1glanq6B8aBMz9p0w8G8nOSQjKpD9kCk18pPfNKXG9/jvjA9iSnyu0/VU+I22mlaHFoI6 +M6taIgj3grrqLuBHmrS1RaMFO9ncLkVAO+rcf+g769HsJtg1pDDFOqxXnrN2pSB7+R5KBWIBpih1 +YJeSDW4+TTdDDZIVnBgizVGZoCkaPF+KMjNbMMeJL0eYD6MDxvbxrN8y8NmBGuScvfaAFPDRLLmF +9dijscilIeUcE5fuDr3fKanvNFNb0+RqE4QGtjICxFKuItLcsiFCGtpA8CnJ7AoMXOLQusxI0zcK +zBIKinmwPQN/aUv0NCB9szTqjktk9T79syNnFQ0EuPAtwQlRPLJsFfClI9eDdOTlLsn+mCdCxqvG +nrDQWzilm1DefhiYtUU79nm06PcaewaD+9CL2rvHvRirCG88gGtAPxkZumWK5r7VXNM21+9AUiRg +OGcEMeyP84LG3rlV8zsxkVrctQgVrXYlCg17LofiDKYGvCYQbTed7N14jHyAxfDZd0jQ +-----END CERTIFICATE----- + +Global Chambersign Root - 2008 +============================== +-----BEGIN CERTIFICATE----- +MIIHSTCCBTGgAwIBAgIJAMnN0+nVfSPOMA0GCSqGSIb3DQEBBQUAMIGsMQswCQYDVQQGEwJFVTFD +MEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNv +bS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMu +QS4xJzAlBgNVBAMTHkdsb2JhbCBDaGFtYmVyc2lnbiBSb290IC0gMjAwODAeFw0wODA4MDExMjMx +NDBaFw0zODA3MzExMjMxNDBaMIGsMQswCQYDVQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUg +Y3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAGA1UEBRMJ +QTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xJzAlBgNVBAMTHkdsb2JhbCBD +aGFtYmVyc2lnbiBSb290IC0gMjAwODCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMDf +VtPkOpt2RbQT2//BthmLN0EYlVJH6xedKYiONWwGMi5HYvNJBL99RDaxccy9Wglz1dmFRP+RVyXf +XjaOcNFccUMd2drvXNL7G706tcuto8xEpw2uIRU/uXpbknXYpBI4iRmKt4DS4jJvVpyR1ogQC7N0 +ZJJ0YPP2zxhPYLIj0Mc7zmFLmY/CDNBAspjcDahOo7kKrmCgrUVSY7pmvWjg+b4aqIG7HkF4ddPB +/gBVsIdU6CeQNR1MM62X/JcumIS/LMmjv9GYERTtY/jKmIhYF5ntRQOXfjyGHoiMvvKRhI9lNNgA +TH23MRdaKXoKGCQwoze1eqkBfSbW+Q6OWfH9GzO1KTsXO0G2Id3UwD2ln58fQ1DJu7xsepeY7s2M +H/ucUa6LcL0nn3HAa6x9kGbo1106DbDVwo3VyJ2dwW3Q0L9R5OP4wzg2rtandeavhENdk5IMagfe +Ox2YItaswTXbo6Al/3K1dh3ebeksZixShNBFks4c5eUzHdwHU1SjqoI7mjcv3N2gZOnm3b2u/GSF +HTynyQbehP9r6GsaPMWis0L7iwk+XwhSx2LE1AVxv8Rk5Pihg+g+EpuoHtQ2TS9x9o0o9oOpE9Jh +wZG7SMA0j0GMS0zbaRL/UJScIINZc+18ofLx/d33SdNDWKBWY8o9PeU1VlnpDsogzCtLkykPAgMB +AAGjggFqMIIBZjASBgNVHRMBAf8ECDAGAQH/AgEMMB0GA1UdDgQWBBS5CcqcHtvTbDprru1U8VuT +BjUuXjCB4QYDVR0jBIHZMIHWgBS5CcqcHtvTbDprru1U8VuTBjUuXqGBsqSBrzCBrDELMAkGA1UE +BhMCRVUxQzBBBgNVBAcTOk1hZHJpZCAoc2VlIGN1cnJlbnQgYWRkcmVzcyBhdCB3d3cuY2FtZXJm +aXJtYS5jb20vYWRkcmVzcykxEjAQBgNVBAUTCUE4Mjc0MzI4NzEbMBkGA1UEChMSQUMgQ2FtZXJm +aXJtYSBTLkEuMScwJQYDVQQDEx5HbG9iYWwgQ2hhbWJlcnNpZ24gUm9vdCAtIDIwMDiCCQDJzdPp +1X0jzjAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRVHSAAMCowKAYIKwYBBQUHAgEWHGh0 +dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20wDQYJKoZIhvcNAQEFBQADggIBAICIf3DekijZBZRG +/5BXqfEv3xoNa/p8DhxJJHkn2EaqbylZUohwEurdPfWbU1Rv4WCiqAm57OtZfMY18dwY6fFn5a+6 +ReAJ3spED8IXDneRRXozX1+WLGiLwUePmJs9wOzL9dWCkoQ10b42OFZyMVtHLaoXpGNR6woBrX/s +dZ7LoR/xfxKxueRkf2fWIyr0uDldmOghp+G9PUIadJpwr2hsUF1Jz//7Dl3mLEfXgTpZALVza2Mg +9jFFCDkO9HB+QHBaP9BrQql0PSgvAm11cpUJjUhjxsYjV5KTXjXBjfkK9yydYhz2rXzdpjEetrHH +foUm+qRqtdpjMNHvkzeyZi99Bffnt0uYlDXA2TopwZ2yUDMdSqlapskD7+3056huirRXhOukP9Du +qqqHW2Pok+JrqNS4cnhrG+055F3Lm6qH1U9OAP7Zap88MQ8oAgF9mOinsKJknnn4SPIVqczmyETr +P3iZ8ntxPjzxmKfFGBI/5rsoM0LpRQp8bfKGeS/Fghl9CYl8slR2iK7ewfPM4W7bMdaTrpmg7yVq +c5iJWzouE4gev8CSlDQb4ye3ix5vQv/n6TebUB0tovkC7stYWDpxvGjjqsGvHCgfotwjZT+B6q6Z +09gwzxMNTxXJhLynSC34MCN32EZLeW32jO06f2ARePTpm67VVMB0gNELQp/B +-----END CERTIFICATE----- + +Go Daddy Root Certificate Authority - G2 +======================================== +-----BEGIN CERTIFICATE----- +MIIDxTCCAq2gAwIBAgIBADANBgkqhkiG9w0BAQsFADCBgzELMAkGA1UEBhMCVVMxEDAOBgNVBAgT +B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAYBgNVBAoTEUdvRGFkZHkuY29tLCBJbmMu +MTEwLwYDVQQDEyhHbyBEYWRkeSBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5 +MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgYMxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6 +b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMRowGAYDVQQKExFHb0RhZGR5LmNvbSwgSW5jLjExMC8G +A1UEAxMoR28gRGFkZHkgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAL9xYgjx+lk09xvJGKP3gElY6SKDE6bFIEMBO4Tx5oVJnyfq +9oQbTqC023CYxzIBsQU+B07u9PpPL1kwIuerGVZr4oAH/PMWdYA5UXvl+TW2dE6pjYIT5LY/qQOD ++qK+ihVqf94Lw7YZFAXK6sOoBJQ7RnwyDfMAZiLIjWltNowRGLfTshxgtDj6AozO091GB94KPutd +fMh8+7ArU6SSYmlRJQVhGkSBjCypQ5Yj36w6gZoOKcUcqeldHraenjAKOc7xiID7S13MMuyFYkMl +NAJWJwGRtDtwKj9useiciAF9n9T521NtYJ2/LOdYq7hfRvzOxBsDPAnrSTFcaUaz4EcCAwEAAaNC +MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFDqahQcQZyi27/a9 +BUFuIMGU2g/eMA0GCSqGSIb3DQEBCwUAA4IBAQCZ21151fmXWWcDYfF+OwYxdS2hII5PZYe096ac +vNjpL9DbWu7PdIxztDhC2gV7+AJ1uP2lsdeu9tfeE8tTEH6KRtGX+rcuKxGrkLAngPnon1rpN5+r +5N9ss4UXnT3ZJE95kTXWXwTrgIOrmgIttRD02JDHBHNA7XIloKmf7J6raBKZV8aPEjoJpL1E/QYV +N8Gb5DKj7Tjo2GTzLH4U/ALqn83/B2gX2yKQOC16jdFU8WnjXzPKej17CuPKf1855eJ1usV2GDPO +LPAvTK33sefOT6jEm0pUBsV/fdUID+Ic/n4XuKxe9tQWskMJDE32p2u0mYRlynqI4uJEvlz36hz1 +-----END CERTIFICATE----- + +Starfield Root Certificate Authority - G2 +========================================= +-----BEGIN CERTIFICATE----- +MIID3TCCAsWgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBjzELMAkGA1UEBhMCVVMxEDAOBgNVBAgT +B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNobm9s +b2dpZXMsIEluYy4xMjAwBgNVBAMTKVN0YXJmaWVsZCBSb290IENlcnRpZmljYXRlIEF1dGhvcml0 +eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgY8xCzAJBgNVBAYTAlVTMRAw +DgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFyZmllbGQg +VGVjaG5vbG9naWVzLCBJbmMuMTIwMAYDVQQDEylTdGFyZmllbGQgUm9vdCBDZXJ0aWZpY2F0ZSBB +dXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL3twQP89o/8ArFv +W59I2Z154qK3A2FWGMNHttfKPTUuiUP3oWmb3ooa/RMgnLRJdzIpVv257IzdIvpy3Cdhl+72WoTs +bhm5iSzchFvVdPtrX8WJpRBSiUZV9Lh1HOZ/5FSuS/hVclcCGfgXcVnrHigHdMWdSL5stPSksPNk +N3mSwOxGXn/hbVNMYq/NHwtjuzqd+/x5AJhhdM8mgkBj87JyahkNmcrUDnXMN/uLicFZ8WJ/X7Nf +ZTD4p7dNdloedl40wOiWVpmKs/B/pM293DIxfJHP4F8R+GuqSVzRmZTRouNjWwl2tVZi4Ut0HZbU +JtQIBFnQmA4O5t78w+wfkPECAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AQYwHQYDVR0OBBYEFHwMMh+n2TB/xH1oo2Kooc6rB1snMA0GCSqGSIb3DQEBCwUAA4IBAQARWfol +TwNvlJk7mh+ChTnUdgWUXuEok21iXQnCoKjUsHU48TRqneSfioYmUeYs0cYtbpUgSpIB7LiKZ3sx +4mcujJUDJi5DnUox9g61DLu34jd/IroAow57UvtruzvE03lRTs2Q9GcHGcg8RnoNAX3FWOdt5oUw +F5okxBDgBPfg8n/Uqgr/Qh037ZTlZFkSIHc40zI+OIF1lnP6aI+xy84fxez6nH7PfrHxBy22/L/K +pL/QlwVKvOoYKAKQvVR4CSFx09F9HdkWsKlhPdAKACL8x3vLCWRFCztAgfd9fDL1mMpYjn0q7pBZ +c2T5NnReJaH1ZgUufzkVqSr7UIuOhWn0 +-----END CERTIFICATE----- + +Starfield Services Root Certificate Authority - G2 +================================================== +-----BEGIN CERTIFICATE----- +MIID7zCCAtegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCVVMxEDAOBgNVBAgT +B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNobm9s +b2dpZXMsIEluYy4xOzA5BgNVBAMTMlN0YXJmaWVsZCBTZXJ2aWNlcyBSb290IENlcnRpZmljYXRl +IEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgZgxCzAJBgNV +BAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxT +dGFyZmllbGQgVGVjaG5vbG9naWVzLCBJbmMuMTswOQYDVQQDEzJTdGFyZmllbGQgU2VydmljZXMg +Um9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBANUMOsQq+U7i9b4Zl1+OiFOxHz/Lz58gE20pOsgPfTz3a3Y4Y9k2YKibXlwAgLIvWX/2 +h/klQ4bnaRtSmpDhcePYLQ1Ob/bISdm28xpWriu2dBTrz/sm4xq6HZYuajtYlIlHVv8loJNwU4Pa +hHQUw2eeBGg6345AWh1KTs9DkTvnVtYAcMtS7nt9rjrnvDH5RfbCYM8TWQIrgMw0R9+53pBlbQLP +LJGmpufehRhJfGZOozptqbXuNC66DQO4M99H67FrjSXZm86B0UVGMpZwh94CDklDhbZsc7tk6mFB +rMnUVN+HL8cisibMn1lUaJ/8viovxFUcdUBgF4UCVTmLfwUCAwEAAaNCMEAwDwYDVR0TAQH/BAUw +AwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJxfAN+qAdcwKziIorhtSpzyEZGDMA0GCSqG +SIb3DQEBCwUAA4IBAQBLNqaEd2ndOxmfZyMIbw5hyf2E3F/YNoHN2BtBLZ9g3ccaaNnRbobhiCPP +E95Dz+I0swSdHynVv/heyNXBve6SbzJ08pGCL72CQnqtKrcgfU28elUSwhXqvfdqlS5sdJ/PHLTy +xQGjhdByPq1zqwubdQxtRbeOlKyWN7Wg0I8VRw7j6IPdj/3vQQF3zCepYoUz8jcI73HPdwbeyBkd +iEDPfUYd/x7H4c7/I9vG+o1VTqkC50cRRj70/b17KSa7qWFiNyi2LSr2EIZkyXCn0q23KXB56jza +YyWf/Wi3MOxw+3WKt21gZ7IeyLnp2KhvAotnDU0mV3HaIPzBSlCNsSi6 +-----END CERTIFICATE----- + +AffirmTrust Commercial +====================== +-----BEGIN CERTIFICATE----- +MIIDTDCCAjSgAwIBAgIId3cGJyapsXwwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UEBhMCVVMxFDAS +BgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBDb21tZXJjaWFsMB4XDTEw +MDEyOTE0MDYwNloXDTMwMTIzMTE0MDYwNlowRDELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmly +bVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBDb21tZXJjaWFsMIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEA9htPZwcroRX1BiLLHwGy43NFBkRJLLtJJRTWzsO3qyxPxkEylFf6Eqdb +DuKPHx6GGaeqtS25Xw2Kwq+FNXkyLbscYjfysVtKPcrNcV/pQr6U6Mje+SJIZMblq8Yrba0F8PrV +C8+a5fBQpIs7R6UjW3p6+DM/uO+Zl+MgwdYoic+U+7lF7eNAFxHUdPALMeIrJmqbTFeurCA+ukV6 +BfO9m2kVrn1OIGPENXY6BwLJN/3HR+7o8XYdcxXyl6S1yHp52UKqK39c/s4mT6NmgTWvRLpUHhww +MmWd5jyTXlBOeuM61G7MGvv50jeuJCqrVwMiKA1JdX+3KNp1v47j3A55MQIDAQABo0IwQDAdBgNV +HQ4EFgQUnZPGU4teyq8/nx4P5ZmVvCT2lI8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AQYwDQYJKoZIhvcNAQELBQADggEBAFis9AQOzcAN/wr91LoWXym9e2iZWEnStB03TX8nfUYGXUPG +hi4+c7ImfU+TqbbEKpqrIZcUsd6M06uJFdhrJNTxFq7YpFzUf1GO7RgBsZNjvbz4YYCanrHOQnDi +qX0GJX0nof5v7LMeJNrjS1UaADs1tDvZ110w/YETifLCBivtZ8SOyUOyXGsViQK8YvxO8rUzqrJv +0wqiUOP2O+guRMLbZjipM1ZI8W0bM40NjD9gN53Tym1+NH4Nn3J2ixufcv1SNUFFApYvHLKac0kh +sUlHRUe072o0EclNmsxZt9YCnlpOZbWUrhvfKbAW8b8Angc6F2S1BLUjIZkKlTuXfO8= +-----END CERTIFICATE----- + +AffirmTrust Networking +====================== +-----BEGIN CERTIFICATE----- +MIIDTDCCAjSgAwIBAgIIfE8EORzUmS0wDQYJKoZIhvcNAQEFBQAwRDELMAkGA1UEBhMCVVMxFDAS +BgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBOZXR3b3JraW5nMB4XDTEw +MDEyOTE0MDgyNFoXDTMwMTIzMTE0MDgyNFowRDELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmly +bVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBOZXR3b3JraW5nMIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEAtITMMxcua5Rsa2FSoOujz3mUTOWUgJnLVWREZY9nZOIG41w3SfYvm4SE +Hi3yYJ0wTsyEheIszx6e/jarM3c1RNg1lho9Nuh6DtjVR6FqaYvZ/Ls6rnla1fTWcbuakCNrmreI +dIcMHl+5ni36q1Mr3Lt2PpNMCAiMHqIjHNRqrSK6mQEubWXLviRmVSRLQESxG9fhwoXA3hA/Pe24 +/PHxI1Pcv2WXb9n5QHGNfb2V1M6+oF4nI979ptAmDgAp6zxG8D1gvz9Q0twmQVGeFDdCBKNwV6gb +h+0t+nvujArjqWaJGctB+d1ENmHP4ndGyH329JKBNv3bNPFyfvMMFr20FQIDAQABo0IwQDAdBgNV +HQ4EFgQUBx/S55zawm6iQLSwelAQUHTEyL0wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AQYwDQYJKoZIhvcNAQEFBQADggEBAIlXshZ6qML91tmbmzTCnLQyFE2npN/svqe++EPbkTfOtDIu +UFUaNU52Q3Eg75N3ThVwLofDwR1t3Mu1J9QsVtFSUzpE0nPIxBsFZVpikpzuQY0x2+c06lkh1QF6 +12S4ZDnNye2v7UsDSKegmQGA3GWjNq5lWUhPgkvIZfFXHeVZLgo/bNjR9eUJtGxUAArgFU2HdW23 +WJZa3W3SAKD0m0i+wzekujbgfIeFlxoVot4uolu9rxj5kFDNcFn4J2dHy8egBzp90SxdbBk6ZrV9 +/ZFvgrG+CJPbFEfxojfHRZ48x3evZKiT3/Zpg4Jg8klCNO1aAFSFHBY2kgxc+qatv9s= +-----END CERTIFICATE----- + +AffirmTrust Premium +=================== +-----BEGIN CERTIFICATE----- +MIIFRjCCAy6gAwIBAgIIbYwURrGmCu4wDQYJKoZIhvcNAQEMBQAwQTELMAkGA1UEBhMCVVMxFDAS +BgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVzdCBQcmVtaXVtMB4XDTEwMDEy +OTE0MTAzNloXDTQwMTIzMTE0MTAzNlowQTELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRy +dXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVzdCBQcmVtaXVtMIICIjANBgkqhkiG9w0BAQEFAAOCAg8A +MIICCgKCAgEAxBLfqV/+Qd3d9Z+K4/as4Tx4mrzY8H96oDMq3I0gW64tb+eT2TZwamjPjlGjhVtn +BKAQJG9dKILBl1fYSCkTtuG+kU3fhQxTGJoeJKJPj/CihQvL9Cl/0qRY7iZNyaqoe5rZ+jjeRFcV +5fiMyNlI4g0WJx0eyIOFJbe6qlVBzAMiSy2RjYvmia9mx+n/K+k8rNrSs8PhaJyJ+HoAVt70VZVs ++7pk3WKL3wt3MutizCaam7uqYoNMtAZ6MMgpv+0GTZe5HMQxK9VfvFMSF5yZVylmd2EhMQcuJUmd +GPLu8ytxjLW6OQdJd/zvLpKQBY0tL3d770O/Nbua2Plzpyzy0FfuKE4mX4+QaAkvuPjcBukumj5R +p9EixAqnOEhss/n/fauGV+O61oV4d7pD6kh/9ti+I20ev9E2bFhc8e6kGVQa9QPSdubhjL08s9NI +S+LI+H+SqHZGnEJlPqQewQcDWkYtuJfzt9WyVSHvutxMAJf7FJUnM7/oQ0dG0giZFmA7mn7S5u04 +6uwBHjxIVkkJx0w3AJ6IDsBz4W9m6XJHMD4Q5QsDyZpCAGzFlH5hxIrff4IaC1nEWTJ3s7xgaVY5 +/bQGeyzWZDbZvUjthB9+pSKPKrhC9IK31FOQeE4tGv2Bb0TXOwF0lkLgAOIua+rF7nKsu7/+6qqo ++Nz2snmKtmcCAwEAAaNCMEAwHQYDVR0OBBYEFJ3AZ6YMItkm9UWrpmVSESfYRaxjMA8GA1UdEwEB +/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBDAUAA4ICAQCzV00QYk465KzquByv +MiPIs0laUZx2KI15qldGF9X1Uva3ROgIRL8YhNILgM3FEv0AVQVhh0HctSSePMTYyPtwni94loMg +Nt58D2kTiKV1NpgIpsbfrM7jWNa3Pt668+s0QNiigfV4Py/VpfzZotReBA4Xrf5B8OWycvpEgjNC +6C1Y91aMYj+6QrCcDFx+LmUmXFNPALJ4fqENmS2NuB2OosSw/WDQMKSOyARiqcTtNd56l+0OOF6S +L5Nwpamcb6d9Ex1+xghIsV5n61EIJenmJWtSKZGc0jlzCFfemQa0W50QBuHCAKi4HEoCChTQwUHK ++4w1IX2COPKpVJEZNZOUbWo6xbLQu4mGk+ibyQ86p3q4ofB4Rvr8Ny/lioTz3/4E2aFooC8k4gmV +BtWVyuEklut89pMFu+1z6S3RdTnX5yTb2E5fQ4+e0BQ5v1VwSJlXMbSc7kqYA5YwH2AG7hsj/oFg +IxpHYoWlzBk0gG+zrBrjn/B7SK3VAdlntqlyk+otZrWyuOQ9PLLvTIzq6we/qzWaVYa8GKa1qF60 +g2xraUDTn9zxw2lrueFtCfTxqlB2Cnp9ehehVZZCmTEJ3WARjQUwfuaORtGdFNrHF+QFlozEJLUb +zxQHskD4o55BhrwE0GuWyCqANP2/7waj3VjFhT0+j/6eKeC2uAloGRwYQw== +-----END CERTIFICATE----- + +AffirmTrust Premium ECC +======================= +-----BEGIN CERTIFICATE----- +MIIB/jCCAYWgAwIBAgIIdJclisc/elQwCgYIKoZIzj0EAwMwRTELMAkGA1UEBhMCVVMxFDASBgNV +BAoMC0FmZmlybVRydXN0MSAwHgYDVQQDDBdBZmZpcm1UcnVzdCBQcmVtaXVtIEVDQzAeFw0xMDAx +MjkxNDIwMjRaFw00MDEyMzExNDIwMjRaMEUxCzAJBgNVBAYTAlVTMRQwEgYDVQQKDAtBZmZpcm1U +cnVzdDEgMB4GA1UEAwwXQWZmaXJtVHJ1c3QgUHJlbWl1bSBFQ0MwdjAQBgcqhkjOPQIBBgUrgQQA +IgNiAAQNMF4bFZ0D0KF5Nbc6PJJ6yhUczWLznCZcBz3lVPqj1swS6vQUX+iOGasvLkjmrBhDeKzQ +N8O9ss0s5kfiGuZjuD0uL3jET9v0D6RoTFVya5UdThhClXjMNzyR4ptlKymjQjBAMB0GA1UdDgQW +BBSaryl6wBE1NSZRMADDav5A1a7WPDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAK +BggqhkjOPQQDAwNnADBkAjAXCfOHiFBar8jAQr9HX/VsaobgxCd05DhT1wV/GzTjxi+zygk8N53X +57hG8f2h4nECMEJZh0PUUd+60wkyWs6Iflc9nF9Ca/UHLbXwgpP5WW+uZPpY5Yse42O+tYHNbwKM +eQ== +-----END CERTIFICATE----- + +Certum Trusted Network CA +========================= +-----BEGIN CERTIFICATE----- +MIIDuzCCAqOgAwIBAgIDBETAMA0GCSqGSIb3DQEBBQUAMH4xCzAJBgNVBAYTAlBMMSIwIAYDVQQK +ExlVbml6ZXRvIFRlY2hub2xvZ2llcyBTLkEuMScwJQYDVQQLEx5DZXJ0dW0gQ2VydGlmaWNhdGlv +biBBdXRob3JpdHkxIjAgBgNVBAMTGUNlcnR1bSBUcnVzdGVkIE5ldHdvcmsgQ0EwHhcNMDgxMDIy +MTIwNzM3WhcNMjkxMjMxMTIwNzM3WjB+MQswCQYDVQQGEwJQTDEiMCAGA1UEChMZVW5pemV0byBU +ZWNobm9sb2dpZXMgUy5BLjEnMCUGA1UECxMeQ2VydHVtIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 +MSIwIAYDVQQDExlDZXJ0dW0gVHJ1c3RlZCBOZXR3b3JrIENBMIIBIjANBgkqhkiG9w0BAQEFAAOC +AQ8AMIIBCgKCAQEA4/t9o3K6wvDJFIf1awFO4W5AB7ptJ11/91sts1rHUV+rpDKmYYe2bg+G0jAC +l/jXaVehGDldamR5xgFZrDwxSjh80gTSSyjoIF87B6LMTXPb865Px1bVWqeWifrzq2jUI4ZZJ88J +J7ysbnKDHDBy3+Ci6dLhdHUZvSqeexVUBBvXQzmtVSjF4hq79MDkrjhJM8x2hZ85RdKknvISjFH4 +fOQtf/WsX+sWn7Et0brMkUJ3TCXJkDhv2/DM+44el1k+1WBO5gUo7Ul5E0u6SNsv+XLTOcr+H9g0 +cvW0QM8xAcPs3hEtF10fuFDRXhmnad4HMyjKUJX5p1TLVIZQRan5SQIDAQABo0IwQDAPBgNVHRMB +Af8EBTADAQH/MB0GA1UdDgQWBBQIds3LB/8k9sXN7buQvOKEN0Z19zAOBgNVHQ8BAf8EBAMCAQYw +DQYJKoZIhvcNAQEFBQADggEBAKaorSLOAT2mo/9i0Eidi15ysHhE49wcrwn9I0j6vSrEuVUEtRCj +jSfeC4Jj0O7eDDd5QVsisrCaQVymcODU0HfLI9MA4GxWL+FpDQ3Zqr8hgVDZBqWo/5U30Kr+4rP1 +mS1FhIrlQgnXdAIv94nYmem8J9RHjboNRhx3zxSkHLmkMcScKHQDNP8zGSal6Q10tz6XxnboJ5aj +Zt3hrvJBW8qYVoNzcOSGGtIxQbovvi0TWnZvTuhOgQ4/WwMioBK+ZlgRSssDxLQqKi2WF+A5VLxI +03YnnZotBqbJ7DnSq9ufmgsnAjUpsUCV5/nonFWIGUbWtzT1fs45mtk48VH3Tyw= +-----END CERTIFICATE----- + +Certinomis - Autorité Racine +============================= +-----BEGIN CERTIFICATE----- +MIIFnDCCA4SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJGUjETMBEGA1UEChMK +Q2VydGlub21pczEXMBUGA1UECxMOMDAwMiA0MzM5OTg5MDMxJjAkBgNVBAMMHUNlcnRpbm9taXMg +LSBBdXRvcml0w6kgUmFjaW5lMB4XDTA4MDkxNzA4Mjg1OVoXDTI4MDkxNzA4Mjg1OVowYzELMAkG +A1UEBhMCRlIxEzARBgNVBAoTCkNlcnRpbm9taXMxFzAVBgNVBAsTDjAwMDIgNDMzOTk4OTAzMSYw +JAYDVQQDDB1DZXJ0aW5vbWlzIC0gQXV0b3JpdMOpIFJhY2luZTCCAiIwDQYJKoZIhvcNAQEBBQAD +ggIPADCCAgoCggIBAJ2Fn4bT46/HsmtuM+Cet0I0VZ35gb5j2CN2DpdUzZlMGvE5x4jYF1AMnmHa +wE5V3udauHpOd4cN5bjr+p5eex7Ezyh0x5P1FMYiKAT5kcOrJ3NqDi5N8y4oH3DfVS9O7cdxbwly +Lu3VMpfQ8Vh30WC8Tl7bmoT2R2FFK/ZQpn9qcSdIhDWerP5pqZ56XjUl+rSnSTV3lqc2W+HN3yNw +2F1MpQiD8aYkOBOo7C+ooWfHpi2GR+6K/OybDnT0K0kCe5B1jPyZOQE51kqJ5Z52qz6WKDgmi92N +jMD2AR5vpTESOH2VwnHu7XSu5DaiQ3XV8QCb4uTXzEIDS3h65X27uK4uIJPT5GHfceF2Z5c/tt9q +c1pkIuVC28+BA5PY9OMQ4HL2AHCs8MF6DwV/zzRpRbWT5BnbUhYjBYkOjUjkJW+zeL9i9Qf6lSTC +lrLooyPCXQP8w9PlfMl1I9f09bze5N/NgL+RiH2nE7Q5uiy6vdFrzPOlKO1Enn1So2+WLhl+HPNb +xxaOu2B9d2ZHVIIAEWBsMsGoOBvrbpgT1u449fCfDu/+MYHB0iSVL1N6aaLwD4ZFjliCK0wi1F6g +530mJ0jfJUaNSih8hp75mxpZuWW/Bd22Ql095gBIgl4g9xGC3srYn+Y3RyYe63j3YcNBZFgCQfna +4NH4+ej9Uji29YnfAgMBAAGjWzBZMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0G +A1UdDgQWBBQNjLZh2kS40RR9w759XkjwzspqsDAXBgNVHSAEEDAOMAwGCiqBegFWAgIAAQEwDQYJ +KoZIhvcNAQEFBQADggIBACQ+YAZ+He86PtvqrxyaLAEL9MW12Ukx9F1BjYkMTv9sov3/4gbIOZ/x +WqndIlgVqIrTseYyCYIDbNc/CMf4uboAbbnW/FIyXaR/pDGUu7ZMOH8oMDX/nyNTt7buFHAAQCva +R6s0fl6nVjBhK4tDrP22iCj1a7Y+YEq6QpA0Z43q619FVDsXrIvkxmUP7tCMXWY5zjKn2BCXwH40 +nJ+U8/aGH88bc62UeYdocMMzpXDn2NU4lG9jeeu/Cg4I58UvD0KgKxRA/yHgBcUn4YQRE7rWhh1B +CxMjidPJC+iKunqjo3M3NYB9Ergzd0A4wPpeMNLytqOx1qKVl4GbUu1pTP+A5FPbVFsDbVRfsbjv +JL1vnxHDx2TCDyhihWZeGnuyt++uNckZM6i4J9szVb9o4XVIRFb7zdNIu0eJOqxp9YDG5ERQL1TE +qkPFMTFYvZbF6nVsmnWxTfj3l/+WFvKXTej28xH5On2KOG4Ey+HTRRWqpdEdnV1j6CTmNhTih60b +WfVEm/vXd3wfAXBioSAaosUaKPQhA+4u2cGA6rnZgtZbdsLLO7XSAPCjDuGtbkD326C00EauFddE +wk01+dIL8hf2rGbVJLJP0RyZwG71fet0BLj5TXcJ17TPBzAJ8bgAVtkXFhYKK4bfjwEZGuW7gmP/ +vgt2Fl43N+bYdJeimUV5 +-----END CERTIFICATE----- + +Root CA Generalitat Valenciana +============================== +-----BEGIN CERTIFICATE----- +MIIGizCCBXOgAwIBAgIEO0XlaDANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJFUzEfMB0GA1UE +ChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UECxMGUEtJR1ZBMScwJQYDVQQDEx5Sb290 +IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmEwHhcNMDEwNzA2MTYyMjQ3WhcNMjEwNzAxMTUyMjQ3 +WjBoMQswCQYDVQQGEwJFUzEfMB0GA1UEChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UE +CxMGUEtJR1ZBMScwJQYDVQQDEx5Sb290IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmEwggEiMA0G +CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDGKqtXETcvIorKA3Qdyu0togu8M1JAJke+WmmmO3I2 +F0zo37i7L3bhQEZ0ZQKQUgi0/6iMweDHiVYQOTPvaLRfX9ptI6GJXiKjSgbwJ/BXufjpTjJ3Cj9B +ZPPrZe52/lSqfR0grvPXdMIKX/UIKFIIzFVd0g/bmoGlu6GzwZTNVOAydTGRGmKy3nXiz0+J2ZGQ +D0EbtFpKd71ng+CT516nDOeB0/RSrFOyA8dEJvt55cs0YFAQexvba9dHq198aMpunUEDEO5rmXte +JajCq+TA81yc477OMUxkHl6AovWDfgzWyoxVjr7gvkkHD6MkQXpYHYTqWBLI4bft75PelAgxAgMB +AAGjggM7MIIDNzAyBggrBgEFBQcBAQQmMCQwIgYIKwYBBQUHMAGGFmh0dHA6Ly9vY3NwLnBraS5n +dmEuZXMwEgYDVR0TAQH/BAgwBgEB/wIBAjCCAjQGA1UdIASCAiswggInMIICIwYKKwYBBAG/VQIB +ADCCAhMwggHoBggrBgEFBQcCAjCCAdoeggHWAEEAdQB0AG8AcgBpAGQAYQBkACAAZABlACAAQwBl +AHIAdABpAGYAaQBjAGEAYwBpAPMAbgAgAFIAYQDtAHoAIABkAGUAIABsAGEAIABHAGUAbgBlAHIA +YQBsAGkAdABhAHQAIABWAGEAbABlAG4AYwBpAGEAbgBhAC4ADQAKAEwAYQAgAEQAZQBjAGwAYQBy +AGEAYwBpAPMAbgAgAGQAZQAgAFAAcgDhAGMAdABpAGMAYQBzACAAZABlACAAQwBlAHIAdABpAGYA +aQBjAGEAYwBpAPMAbgAgAHEAdQBlACAAcgBpAGcAZQAgAGUAbAAgAGYAdQBuAGMAaQBvAG4AYQBt +AGkAZQBuAHQAbwAgAGQAZQAgAGwAYQAgAHAAcgBlAHMAZQBuAHQAZQAgAEEAdQB0AG8AcgBpAGQA +YQBkACAAZABlACAAQwBlAHIAdABpAGYAaQBjAGEAYwBpAPMAbgAgAHMAZQAgAGUAbgBjAHUAZQBu +AHQAcgBhACAAZQBuACAAbABhACAAZABpAHIAZQBjAGMAaQDzAG4AIAB3AGUAYgAgAGgAdAB0AHAA +OgAvAC8AdwB3AHcALgBwAGsAaQAuAGcAdgBhAC4AZQBzAC8AYwBwAHMwJQYIKwYBBQUHAgEWGWh0 +dHA6Ly93d3cucGtpLmd2YS5lcy9jcHMwHQYDVR0OBBYEFHs100DSHHgZZu90ECjcPk+yeAT8MIGV +BgNVHSMEgY0wgYqAFHs100DSHHgZZu90ECjcPk+yeAT8oWykajBoMQswCQYDVQQGEwJFUzEfMB0G +A1UEChMWR2VuZXJhbGl0YXQgVmFsZW5jaWFuYTEPMA0GA1UECxMGUEtJR1ZBMScwJQYDVQQDEx5S +b290IENBIEdlbmVyYWxpdGF0IFZhbGVuY2lhbmGCBDtF5WgwDQYJKoZIhvcNAQEFBQADggEBACRh +TvW1yEICKrNcda3FbcrnlD+laJWIwVTAEGmiEi8YPyVQqHxK6sYJ2fR1xkDar1CdPaUWu20xxsdz +Ckj+IHLtb8zog2EWRpABlUt9jppSCS/2bxzkoXHPjCpaF3ODR00PNvsETUlR4hTJZGH71BTg9J63 +NI8KJr2XXPR5OkowGcytT6CYirQxlyric21+eLj4iIlPsSKRZEv1UN4D2+XFducTZnV+ZfsBn5OH +iJ35Rld8TWCvmHMTI6QgkYH60GFmuH3Rr9ZvHmw96RH9qfmCIoaZM3Fa6hlXPZHNqcCjbgcTpsnt ++GijnsNacgmHKNHEc8RzGF9QdRYxn7fofMM= +-----END CERTIFICATE----- + +A-Trust-nQual-03 +================ +-----BEGIN CERTIFICATE----- +MIIDzzCCAregAwIBAgIDAWweMA0GCSqGSIb3DQEBBQUAMIGNMQswCQYDVQQGEwJBVDFIMEYGA1UE +Cgw/QS1UcnVzdCBHZXMuIGYuIFNpY2hlcmhlaXRzc3lzdGVtZSBpbSBlbGVrdHIuIERhdGVudmVy +a2VociBHbWJIMRkwFwYDVQQLDBBBLVRydXN0LW5RdWFsLTAzMRkwFwYDVQQDDBBBLVRydXN0LW5R +dWFsLTAzMB4XDTA1MDgxNzIyMDAwMFoXDTE1MDgxNzIyMDAwMFowgY0xCzAJBgNVBAYTAkFUMUgw +RgYDVQQKDD9BLVRydXN0IEdlcy4gZi4gU2ljaGVyaGVpdHNzeXN0ZW1lIGltIGVsZWt0ci4gRGF0 +ZW52ZXJrZWhyIEdtYkgxGTAXBgNVBAsMEEEtVHJ1c3QtblF1YWwtMDMxGTAXBgNVBAMMEEEtVHJ1 +c3QtblF1YWwtMDMwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtPWFuA/OQO8BBC4SA +zewqo51ru27CQoT3URThoKgtUaNR8t4j8DRE/5TrzAUjlUC5B3ilJfYKvUWG6Nm9wASOhURh73+n +yfrBJcyFLGM/BWBzSQXgYHiVEEvc+RFZznF/QJuKqiTfC0Li21a8StKlDJu3Qz7dg9MmEALP6iPE +SU7l0+m0iKsMrmKS1GWH2WrX9IWf5DMiJaXlyDO6w8dB3F/GaswADm0yqLaHNgBid5seHzTLkDx4 +iHQF63n1k3Flyp3HaxgtPVxO59X4PzF9j4fsCiIvI+n+u33J4PTs63zEsMMtYrWacdaxaujs2e3V +cuy+VwHOBVWf3tFgiBCzAgMBAAGjNjA0MA8GA1UdEwEB/wQFMAMBAf8wEQYDVR0OBAoECERqlWdV +eRFPMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAVdRU0VlIXLOThaq/Yy/kgM40 +ozRiPvbY7meIMQQDbwvUB/tOdQ/TLtPAF8fGKOwGDREkDg6lXb+MshOWcdzUzg4NCmgybLlBMRmr +sQd7TZjTXLDR8KdCoLXEjq/+8T/0709GAHbrAvv5ndJAlseIOrifEXnzgGWovR/TeIGgUUw3tKZd +JXDRZslo+S4RFGjxVJgIrCaSD96JntT6s3kr0qN51OyLrIdTaEJMUVF0HhsnLuP1Hyl0Te2v9+GS +mYHovjrHF1D2t8b8m7CKa9aIA5GPBnc6hQLdmNVDeD/GMBWsm2vLV7eJUYs66MmEDNuxUCAKGkq6 +ahq97BvIxYSazQ== +-----END CERTIFICATE----- + +TWCA Root Certification Authority +================================= +-----BEGIN CERTIFICATE----- +MIIDezCCAmOgAwIBAgIBATANBgkqhkiG9w0BAQUFADBfMQswCQYDVQQGEwJUVzESMBAGA1UECgwJ +VEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NBIFJvb3QgQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkwHhcNMDgwODI4MDcyNDMzWhcNMzAxMjMxMTU1OTU5WjBfMQswCQYDVQQG +EwJUVzESMBAGA1UECgwJVEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NB +IFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK +AoIBAQCwfnK4pAOU5qfeCTiRShFAh6d8WWQUe7UREN3+v9XAu1bihSX0NXIP+FPQQeFEAcK0HMMx +QhZHhTMidrIKbw/lJVBPhYa+v5guEGcevhEFhgWQxFnQfHgQsIBct+HHK3XLfJ+utdGdIzdjp9xC +oi2SBBtQwXu4PhvJVgSLL1KbralW6cH/ralYhzC2gfeXRfwZVzsrb+RH9JlF/h3x+JejiB03HFyP +4HYlmlD4oFT/RJB2I9IyxsOrBr/8+7/zrX2SYgJbKdM1o5OaQ2RgXbL6Mv87BK9NQGr5x+PvI/1r +y+UPizgN7gr8/g+YnzAx3WxSZfmLgb4i4RxYA7qRG4kHAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIB +BjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqOFsmjd6LWvJPelSDGRjjCDWmujANBgkqhkiG +9w0BAQUFAAOCAQEAPNV3PdrfibqHDAhUaiBQkr6wQT25JmSDCi/oQMCXKCeCMErJk/9q56YAf4lC +mtYR5VPOL8zy2gXE/uJQxDqGfczafhAJO5I1KlOy/usrBdlsXebQ79NqZp4VKIV66IIArB6nCWlW +QtNoURi+VJq/REG6Sb4gumlc7rh3zc5sH62Dlhh9DrUUOYTxKOkto557HnpyWoOzeW/vtPzQCqVY +T0bf+215WfKEIlKuD8z7fDvnaspHYcN6+NOSBB+4IIThNlQWx0DeO4pz3N/GCUzf7Nr/1FNCocny +Yh0igzyXxfkZYiesZSLX0zzG5Y6yU8xJzrww/nsOM5D77dIUkR8Hrw== +-----END CERTIFICATE----- + +Security Communication RootCA2 +============================== +-----BEGIN CERTIFICATE----- +MIIDdzCCAl+gAwIBAgIBADANBgkqhkiG9w0BAQsFADBdMQswCQYDVQQGEwJKUDElMCMGA1UEChMc +U0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEnMCUGA1UECxMeU2VjdXJpdHkgQ29tbXVuaWNh +dGlvbiBSb290Q0EyMB4XDTA5MDUyOTA1MDAzOVoXDTI5MDUyOTA1MDAzOVowXTELMAkGA1UEBhMC +SlAxJTAjBgNVBAoTHFNFQ09NIFRydXN0IFN5c3RlbXMgQ08uLExURC4xJzAlBgNVBAsTHlNlY3Vy +aXR5IENvbW11bmljYXRpb24gUm9vdENBMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +ANAVOVKxUrO6xVmCxF1SrjpDZYBLx/KWvNs2l9amZIyoXvDjChz335c9S672XewhtUGrzbl+dp++ ++T42NKA7wfYxEUV0kz1XgMX5iZnK5atq1LXaQZAQwdbWQonCv/Q4EpVMVAX3NuRFg3sUZdbcDE3R +3n4MqzvEFb46VqZab3ZpUql6ucjrappdUtAtCms1FgkQhNBqyjoGADdH5H5XTz+L62e4iKrFvlNV +spHEfbmwhRkGeC7bYRr6hfVKkaHnFtWOojnflLhwHyg/i/xAXmODPIMqGplrz95Zajv8bxbXH/1K +EOtOghY6rCcMU/Gt1SSwawNQwS08Ft1ENCcadfsCAwEAAaNCMEAwHQYDVR0OBBYEFAqFqXdlBZh8 +QIH4D5csOPEK7DzPMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEB +CwUAA4IBAQBMOqNErLlFsceTfsgLCkLfZOoc7llsCLqJX2rKSpWeeo8HxdpFcoJxDjrSzG+ntKEj +u/Ykn8sX/oymzsLS28yN/HH8AynBbF0zX2S2ZTuJbxh2ePXcokgfGT+Ok+vx+hfuzU7jBBJV1uXk +3fs+BXziHV7Gp7yXT2g69ekuCkO2r1dcYmh8t/2jioSgrGK+KwmHNPBqAbubKVY8/gA3zyNs8U6q +tnRGEmyR7jTV7JqR50S+kDFy1UkC9gLl9B/rfNmWVan/7Ir5mUf/NVoCqgTLiluHcSmRvaS0eg29 +mvVXIwAHIRc/SjnRBUkLp7Y3gaVdjKozXoEofKd9J+sAro03 +-----END CERTIFICATE----- + +EC-ACC +====== +-----BEGIN CERTIFICATE----- +MIIFVjCCBD6gAwIBAgIQ7is969Qh3hSoYqwE893EATANBgkqhkiG9w0BAQUFADCB8zELMAkGA1UE +BhMCRVMxOzA5BgNVBAoTMkFnZW5jaWEgQ2F0YWxhbmEgZGUgQ2VydGlmaWNhY2lvIChOSUYgUS0w +ODAxMTc2LUkpMSgwJgYDVQQLEx9TZXJ2ZWlzIFB1YmxpY3MgZGUgQ2VydGlmaWNhY2lvMTUwMwYD +VQQLEyxWZWdldSBodHRwczovL3d3dy5jYXRjZXJ0Lm5ldC92ZXJhcnJlbCAoYykwMzE1MDMGA1UE +CxMsSmVyYXJxdWlhIEVudGl0YXRzIGRlIENlcnRpZmljYWNpbyBDYXRhbGFuZXMxDzANBgNVBAMT +BkVDLUFDQzAeFw0wMzAxMDcyMzAwMDBaFw0zMTAxMDcyMjU5NTlaMIHzMQswCQYDVQQGEwJFUzE7 +MDkGA1UEChMyQWdlbmNpYSBDYXRhbGFuYSBkZSBDZXJ0aWZpY2FjaW8gKE5JRiBRLTA4MDExNzYt +SSkxKDAmBgNVBAsTH1NlcnZlaXMgUHVibGljcyBkZSBDZXJ0aWZpY2FjaW8xNTAzBgNVBAsTLFZl +Z2V1IGh0dHBzOi8vd3d3LmNhdGNlcnQubmV0L3ZlcmFycmVsIChjKTAzMTUwMwYDVQQLEyxKZXJh +cnF1aWEgRW50aXRhdHMgZGUgQ2VydGlmaWNhY2lvIENhdGFsYW5lczEPMA0GA1UEAxMGRUMtQUND +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsyLHT+KXQpWIR4NA9h0X84NzJB5R85iK +w5K4/0CQBXCHYMkAqbWUZRkiFRfCQ2xmRJoNBD45b6VLeqpjt4pEndljkYRm4CgPukLjbo73FCeT +ae6RDqNfDrHrZqJyTxIThmV6PttPB/SnCWDaOkKZx7J/sxaVHMf5NLWUhdWZXqBIoH7nF2W4onW4 +HvPlQn2v7fOKSGRdghST2MDk/7NQcvJ29rNdQlB50JQ+awwAvthrDk4q7D7SzIKiGGUzE3eeml0a +E9jD2z3Il3rucO2n5nzbcc8tlGLfbdb1OL4/pYUKGbio2Al1QnDE6u/LDsg0qBIimAy4E5S2S+zw +0JDnJwIDAQABo4HjMIHgMB0GA1UdEQQWMBSBEmVjX2FjY0BjYXRjZXJ0Lm5ldDAPBgNVHRMBAf8E +BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUoMOLRKo3pUW/l4Ba0fF4opvpXY0wfwYD +VR0gBHgwdjB0BgsrBgEEAfV4AQMBCjBlMCwGCCsGAQUFBwIBFiBodHRwczovL3d3dy5jYXRjZXJ0 +Lm5ldC92ZXJhcnJlbDA1BggrBgEFBQcCAjApGidWZWdldSBodHRwczovL3d3dy5jYXRjZXJ0Lm5l +dC92ZXJhcnJlbCAwDQYJKoZIhvcNAQEFBQADggEBAKBIW4IB9k1IuDlVNZyAelOZ1Vr/sXE7zDkJ +lF7W2u++AVtd0x7Y/X1PzaBB4DSTv8vihpw3kpBWHNzrKQXlxJ7HNd+KDM3FIUPpqojlNcAZQmNa +Al6kSBg6hW/cnbw/nZzBh7h6YQjpdwt/cKt63dmXLGQehb+8dJahw3oS7AwaboMMPOhyRp/7SNVe +l+axofjk70YllJyJ22k4vuxcDlbHZVHlUIiIv0LVKz3l+bqeLrPK9HOSAgu+TGbrIP65y7WZf+a2 +E/rKS03Z7lNGBjvGTq2TWoF+bCpLagVFjPIhpDGQh2xlnJ2lYJU6Un/10asIbvPuW/mIPX64b24D +5EI= +-----END CERTIFICATE----- + +Hellenic Academic and Research Institutions RootCA 2011 +======================================================= +-----BEGIN CERTIFICATE----- +MIIEMTCCAxmgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBlTELMAkGA1UEBhMCR1IxRDBCBgNVBAoT +O0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgQ2VydC4gQXV0aG9y +aXR5MUAwPgYDVQQDEzdIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25z +IFJvb3RDQSAyMDExMB4XDTExMTIwNjEzNDk1MloXDTMxMTIwMTEzNDk1MlowgZUxCzAJBgNVBAYT +AkdSMUQwQgYDVQQKEztIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25z +IENlcnQuIEF1dGhvcml0eTFAMD4GA1UEAxM3SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNo +IEluc3RpdHV0aW9ucyBSb290Q0EgMjAxMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +AKlTAOMupvaO+mDYLZU++CwqVE7NuYRhlFhPjz2L5EPzdYmNUeTDN9KKiE15HrcS3UN4SoqS5tdI +1Q+kOilENbgH9mgdVc04UfCMJDGFr4PJfel3r+0ae50X+bOdOFAPplp5kYCvN66m0zH7tSYJnTxa +71HFK9+WXesyHgLacEnsbgzImjeN9/E2YEsmLIKe0HjzDQ9jpFEw4fkrJxIH2Oq9GGKYsFk3fb7u +8yBRQlqD75O6aRXxYp2fmTmCobd0LovUxQt7L/DICto9eQqakxylKHJzkUOap9FNhYS5qXSPFEDH +3N6sQWRstBmbAmNtJGSPRLIl6s5ddAxjMlyNh+UCAwEAAaOBiTCBhjAPBgNVHRMBAf8EBTADAQH/ +MAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQUppFC/RNhSiOeCKQp5dgTBCPuQSUwRwYDVR0eBEAwPqA8 +MAWCAy5ncjAFggMuZXUwBoIELmVkdTAGggQub3JnMAWBAy5ncjAFgQMuZXUwBoEELmVkdTAGgQQu +b3JnMA0GCSqGSIb3DQEBBQUAA4IBAQAf73lB4XtuP7KMhjdCSk4cNx6NZrokgclPEg8hwAOXhiVt +XdMiKahsog2p6z0GW5k6x8zDmjR/qw7IThzh+uTczQ2+vyT+bOdrwg3IBp5OjWEopmr95fZi6hg8 +TqBTnbI6nOulnJEWtk2C4AwFSKls9cz4y51JtPACpf1wA+2KIaWuE4ZJwzNzvoc7dIsXRSZMFpGD +/md9zU1jZ/rzAxKWeAaNsWftjj++n08C9bMJL/NMh98qy5V8AcysNnq/onN694/BtZqhFLKPM58N +7yLcZnuEvUUXBj08yrl3NI/K6s8/MT7jiOOASSXIl7WdmplNsDz4SgCbZN2fOUvRJ9e4 +-----END CERTIFICATE----- + +Actalis Authentication Root CA +============================== +-----BEGIN CERTIFICATE----- +MIIFuzCCA6OgAwIBAgIIVwoRl0LE48wwDQYJKoZIhvcNAQELBQAwazELMAkGA1UEBhMCSVQxDjAM +BgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8wMzM1ODUyMDk2NzEnMCUGA1UE +AwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290IENBMB4XDTExMDkyMjExMjIwMloXDTMwMDky +MjExMjIwMlowazELMAkGA1UEBhMCSVQxDjAMBgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlz +IFMucC5BLi8wMzM1ODUyMDk2NzEnMCUGA1UEAwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290 +IENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAp8bEpSmkLO/lGMWwUKNvUTufClrJ +wkg4CsIcoBh/kbWHuUA/3R1oHwiD1S0eiKD4j1aPbZkCkpAW1V8IbInX4ay8IMKx4INRimlNAJZa +by/ARH6jDuSRzVju3PvHHkVH3Se5CAGfpiEd9UEtL0z9KK3giq0itFZljoZUj5NDKd45RnijMCO6 +zfB9E1fAXdKDa0hMxKufgFpbOr3JpyI/gCczWw63igxdBzcIy2zSekciRDXFzMwujt0q7bd9Zg1f +YVEiVRvjRuPjPdA1YprbrxTIW6HMiRvhMCb8oJsfgadHHwTrozmSBp+Z07/T6k9QnBn+locePGX2 +oxgkg4YQ51Q+qDp2JE+BIcXjDwL4k5RHILv+1A7TaLndxHqEguNTVHnd25zS8gebLra8Pu2Fbe8l +EfKXGkJh90qX6IuxEAf6ZYGyojnP9zz/GPvG8VqLWeICrHuS0E4UT1lF9gxeKF+w6D9Fz8+vm2/7 +hNN3WpVvrJSEnu68wEqPSpP4RCHiMUVhUE4Q2OM1fEwZtN4Fv6MGn8i1zeQf1xcGDXqVdFUNaBr8 +EBtiZJ1t4JWgw5QHVw0U5r0F+7if5t+L4sbnfpb2U8WANFAoWPASUHEXMLrmeGO89LKtmyuy/uE5 +jF66CyCU3nuDuP/jVo23Eek7jPKxwV2dpAtMK9myGPW1n0sCAwEAAaNjMGEwHQYDVR0OBBYEFFLY +iDrIn3hm7YnzezhwlMkCAjbQMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUUtiIOsifeGbt +ifN7OHCUyQICNtAwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBCwUAA4ICAQALe3KHwGCmSUyI +WOYdiPcUZEim2FgKDk8TNd81HdTtBjHIgT5q1d07GjLukD0R0i70jsNjLiNmsGe+b7bAEzlgqqI0 +JZN1Ut6nna0Oh4lScWoWPBkdg/iaKWW+9D+a2fDzWochcYBNy+A4mz+7+uAwTc+G02UQGRjRlwKx +K3JCaKygvU5a2hi/a5iB0P2avl4VSM0RFbnAKVy06Ij3Pjaut2L9HmLecHgQHEhb2rykOLpn7VU+ +Xlff1ANATIGk0k9jpwlCCRT8AKnCgHNPLsBA2RF7SOp6AsDT6ygBJlh0wcBzIm2Tlf05fbsq4/aC +4yyXX04fkZT6/iyj2HYauE2yOE+b+h1IYHkm4vP9qdCa6HCPSXrW5b0KDtst842/6+OkfcvHlXHo +2qN8xcL4dJIEG4aspCJTQLas/kx2z/uUMsA1n3Y/buWQbqCmJqK4LL7RK4X9p2jIugErsWx0Hbhz +lefut8cl8ABMALJ+tguLHPPAUJ4lueAI3jZm/zel0btUZCzJJ7VLkn5l/9Mt4blOvH+kQSGQQXem +OR/qnuOf0GZvBeyqdn6/axag67XH/JJULysRJyU3eExRarDzzFhdFPFqSBX/wge2sY0PjlxQRrM9 +vwGYT7JZVEc+NHt4bVaTLnPqZih4zR0Uv6CPLy64Lo7yFIrM6bV8+2ydDKXhlg== +-----END CERTIFICATE----- + +Trustis FPS Root CA +=================== +-----BEGIN CERTIFICATE----- +MIIDZzCCAk+gAwIBAgIQGx+ttiD5JNM2a/fH8YygWTANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQG +EwJHQjEYMBYGA1UEChMPVHJ1c3RpcyBMaW1pdGVkMRwwGgYDVQQLExNUcnVzdGlzIEZQUyBSb290 +IENBMB4XDTAzMTIyMzEyMTQwNloXDTI0MDEyMTExMzY1NFowRTELMAkGA1UEBhMCR0IxGDAWBgNV +BAoTD1RydXN0aXMgTGltaXRlZDEcMBoGA1UECxMTVHJ1c3RpcyBGUFMgUm9vdCBDQTCCASIwDQYJ +KoZIhvcNAQEBBQADggEPADCCAQoCggEBAMVQe547NdDfxIzNjpvto8A2mfRC6qc+gIMPpqdZh8mQ +RUN+AOqGeSoDvT03mYlmt+WKVoaTnGhLaASMk5MCPjDSNzoiYYkchU59j9WvezX2fihHiTHcDnlk +H5nSW7r+f2C/revnPDgpai/lkQtV/+xvWNUtyd5MZnGPDNcE2gfmHhjjvSkCqPoc4Vu5g6hBSLwa +cY3nYuUtsuvffM/bq1rKMfFMIvMFE/eC+XN5DL7XSxzA0RU8k0Fk0ea+IxciAIleH2ulrG6nS4zt +o3Lmr2NNL4XSFDWaLk6M6jKYKIahkQlBOrTh4/L68MkKokHdqeMDx4gVOxzUGpTXn2RZEm0CAwEA +AaNTMFEwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBS6+nEleYtXQSUhhgtx67JkDoshZzAd +BgNVHQ4EFgQUuvpxJXmLV0ElIYYLceuyZA6LIWcwDQYJKoZIhvcNAQEFBQADggEBAH5Y//01GX2c +GE+esCu8jowU/yyg2kdbw++BLa8F6nRIW/M+TgfHbcWzk88iNVy2P3UnXwmWzaD+vkAMXBJV+JOC +yinpXj9WV4s4NvdFGkwozZ5BuO1WTISkQMi4sKUraXAEasP41BIy+Q7DsdwyhEQsb8tGD+pmQQ9P +8Vilpg0ND2HepZ5dfWWhPBfnqFVO76DH7cZEf1T1o+CP8HxVIo8ptoGj4W1OLBuAZ+ytIJ8MYmHV +l/9D7S3B2l0pKoU/rGXuhg8FjZBf3+6f9L/uHfuY5H+QK4R4EA5sSVPvFVtlRkpdr7r7OnIdzfYl +iB6XzCGcKQENZetX2fNXlrtIzYE= +-----END CERTIFICATE----- + +StartCom Certification Authority +================================ +-----BEGIN CERTIFICATE----- +MIIHhzCCBW+gAwIBAgIBLTANBgkqhkiG9w0BAQsFADB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMN +U3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmlu +ZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0 +NjM3WhcNMzYwOTE3MTk0NjM2WjB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRk +LjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMg +U3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw +ggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZkpMyONvg45iPwbm2xPN1y +o4UcodM9tDMr0y+v/uqwQVlntsQGfQqedIXWeUyAN3rfOQVSWff0G0ZDpNKFhdLDcfN1YjS6LIp/ +Ho/u7TTQEceWzVI9ujPW3U3eCztKS5/CJi/6tRYccjV3yjxd5srhJosaNnZcAdt0FCX+7bWgiA/d +eMotHweXMAEtcnn6RtYTKqi5pquDSR3l8u/d5AGOGAqPY1MWhWKpDhk6zLVmpsJrdAfkK+F2PrRt +2PZE4XNiHzvEvqBTViVsUQn3qqvKv3b9bZvzndu/PWa8DFaqr5hIlTpL36dYUNk4dalb6kMMAv+Z +6+hsTXBbKWWc3apdzK8BMewM69KN6Oqce+Zu9ydmDBpI125C4z/eIT574Q1w+2OqqGwaVLRcJXrJ +osmLFqa7LH4XXgVNWG4SHQHuEhANxjJ/GP/89PrNbpHoNkm+Gkhpi8KWTRoSsmkXwQqQ1vp5Iki/ +untp+HDH+no32NgN0nZPV/+Qt+OR0t3vwmC3Zzrd/qqc8NSLf3Iizsafl7b4r4qgEKjZ+xjGtrVc +UjyJthkqcwEKDwOzEmDyei+B26Nu/yYwl/WL3YlXtq09s68rxbd2AvCl1iuahhQqcvbjM4xdCUsT +37uMdBNSSwIDAQABo4ICEDCCAgwwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYD +VR0OBBYEFE4L7xqkQFulF2mHMMo0aEPQQa7yMB8GA1UdIwQYMBaAFE4L7xqkQFulF2mHMMo0aEPQ +Qa7yMIIBWgYDVR0gBIIBUTCCAU0wggFJBgsrBgEEAYG1NwEBATCCATgwLgYIKwYBBQUHAgEWImh0 +dHA6Ly93d3cuc3RhcnRzc2wuY29tL3BvbGljeS5wZGYwNAYIKwYBBQUHAgEWKGh0dHA6Ly93d3cu +c3RhcnRzc2wuY29tL2ludGVybWVkaWF0ZS5wZGYwgc8GCCsGAQUFBwICMIHCMCcWIFN0YXJ0IENv +bW1lcmNpYWwgKFN0YXJ0Q29tKSBMdGQuMAMCAQEagZZMaW1pdGVkIExpYWJpbGl0eSwgcmVhZCB0 +aGUgc2VjdGlvbiAqTGVnYWwgTGltaXRhdGlvbnMqIG9mIHRoZSBTdGFydENvbSBDZXJ0aWZpY2F0 +aW9uIEF1dGhvcml0eSBQb2xpY3kgYXZhaWxhYmxlIGF0IGh0dHA6Ly93d3cuc3RhcnRzc2wuY29t +L3BvbGljeS5wZGYwEQYJYIZIAYb4QgEBBAQDAgAHMDgGCWCGSAGG+EIBDQQrFilTdGFydENvbSBG +cmVlIFNTTCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTANBgkqhkiG9w0BAQsFAAOCAgEAjo/n3JR5 +fPGFf59Jb2vKXfuM/gTFwWLRfUKKvFO3lANmMD+x5wqnUCBVJX92ehQN6wQOQOY+2IirByeDqXWm +N3PH/UvSTa0XQMhGvjt/UfzDtgUx3M2FIk5xt/JxXrAaxrqTi3iSSoX4eA+D/i+tLPfkpLst0OcN +Org+zvZ49q5HJMqjNTbOx8aHmNrs++myziebiMMEofYLWWivydsQD032ZGNcpRJvkrKTlMeIFw6T +tn5ii5B/q06f/ON1FE8qMt9bDeD1e5MNq6HPh+GlBEXoPBKlCcWw0bdT82AUuoVpaiF8H3VhFyAX +e2w7QSlc4axa0c2Mm+tgHRns9+Ww2vl5GKVFP0lDV9LdJNUso/2RjSe15esUBppMeyG7Oq0wBhjA +2MFrLH9ZXF2RsXAiV+uKa0hK1Q8p7MZAwC+ITGgBF3f0JBlPvfrhsiAhS90a2Cl9qrjeVOwhVYBs +HvUwyKMQ5bLmKhQxw4UtjJixhlpPiVktucf3HMiKf8CdBUrmQk9io20ppB+Fq9vlgcitKj1MXVuE +JnHEhV5xJMqlG2zYYdMa4FTbzrqpMrUi9nNBCV24F10OD5mQ1kfabwo6YigUZ4LZ8dCAWZvLMdib +D4x3TrVoivJs9iQOLWxwxXPR3hTQcY+203sC9uO41Alua551hDnmfyWl8kgAwKQB2j8= +-----END CERTIFICATE----- + +StartCom Certification Authority G2 +=================================== +-----BEGIN CERTIFICATE----- +MIIFYzCCA0ugAwIBAgIBOzANBgkqhkiG9w0BAQsFADBTMQswCQYDVQQGEwJJTDEWMBQGA1UEChMN +U3RhcnRDb20gTHRkLjEsMCoGA1UEAxMjU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg +RzIwHhcNMTAwMTAxMDEwMDAxWhcNMzkxMjMxMjM1OTAxWjBTMQswCQYDVQQGEwJJTDEWMBQGA1UE +ChMNU3RhcnRDb20gTHRkLjEsMCoGA1UEAxMjU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3Jp +dHkgRzIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2iTZbB7cgNr2Cu+EWIAOVeq8O +o1XJJZlKxdBWQYeQTSFgpBSHO839sj60ZwNq7eEPS8CRhXBF4EKe3ikj1AENoBB5uNsDvfOpL9HG +4A/LnooUCri99lZi8cVytjIl2bLzvWXFDSxu1ZJvGIsAQRSCb0AgJnooD/Uefyf3lLE3PbfHkffi +Aez9lInhzG7TNtYKGXmu1zSCZf98Qru23QumNK9LYP5/Q0kGi4xDuFby2X8hQxfqp0iVAXV16iul +Q5XqFYSdCI0mblWbq9zSOdIxHWDirMxWRST1HFSr7obdljKF+ExP6JV2tgXdNiNnvP8V4so75qbs +O+wmETRIjfaAKxojAuuKHDp2KntWFhxyKrOq42ClAJ8Em+JvHhRYW6Vsi1g8w7pOOlz34ZYrPu8H +vKTlXcxNnw3h3Kq74W4a7I/htkxNeXJdFzULHdfBR9qWJODQcqhaX2YtENwvKhOuJv4KHBnM0D4L +nMgJLvlblnpHnOl68wVQdJVznjAJ85eCXuaPOQgeWeU1FEIT/wCc976qUM/iUUjXuG+v+E5+M5iS +FGI6dWPPe/regjupuznixL0sAA7IF6wT700ljtizkC+p2il9Ha90OrInwMEePnWjFqmveiJdnxMa +z6eg6+OGCtP95paV1yPIN93EfKo2rJgaErHgTuixO/XWb/Ew1wIDAQABo0IwQDAPBgNVHRMBAf8E +BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUS8W0QGutHLOlHGVuRjaJhwUMDrYwDQYJ +KoZIhvcNAQELBQADggIBAHNXPyzVlTJ+N9uWkusZXn5T50HsEbZH77Xe7XRcxfGOSeD8bpkTzZ+K +2s06Ctg6Wgk/XzTQLwPSZh0avZyQN8gMjgdalEVGKua+etqhqaRpEpKwfTbURIfXUfEpY9Z1zRbk +J4kd+MIySP3bmdCPX1R0zKxnNBFi2QwKN4fRoxdIjtIXHfbX/dtl6/2o1PXWT6RbdejF0mCy2wl+ +JYt7ulKSnj7oxXehPOBKc2thz4bcQ///If4jXSRK9dNtD2IEBVeC2m6kMyV5Sy5UGYvMLD0w6dEG +/+gyRr61M3Z3qAFdlsHB1b6uJcDJHgoJIIihDsnzb02CVAAgp9KP5DlUFy6NHrgbuxu9mk47EDTc +nIhT76IxW1hPkWLIwpqazRVdOKnWvvgTtZ8SafJQYqz7Fzf07rh1Z2AQ+4NQ+US1dZxAF7L+/Xld +blhYXzD8AK6vM8EOTmy6p6ahfzLbOOCxchcKK5HsamMm7YnUeMx0HgX4a/6ManY5Ka5lIxKVCCIc +l85bBu4M4ru8H0ST9tg4RQUh7eStqxK2A6RCLi3ECToDZ2mEmuFZkIoohdVddLHRDiBYmxOlsGOm +7XtH/UVVMKTumtTm4ofvmMkyghEpIrwACjFeLQ/Ajulrso8uBtjRkcfGEvRM/TAXw8HaOFvjqerm +obp573PYtlNXLfbQ4ddI +-----END CERTIFICATE----- + +Buypass Class 2 Root CA +======================= +-----BEGIN CERTIFICATE----- +MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU +QnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3MgQ2xhc3MgMiBSb290IENBMB4X +DTEwMTAyNjA4MzgwM1oXDTQwMTAyNjA4MzgwM1owTjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1 +eXBhc3MgQVMtOTgzMTYzMzI3MSAwHgYDVQQDDBdCdXlwYXNzIENsYXNzIDIgUm9vdCBDQTCCAiIw +DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANfHXvfBB9R3+0Mh9PT1aeTuMgHbo4Yf5FkNuud1 +g1Lr6hxhFUi7HQfKjK6w3Jad6sNgkoaCKHOcVgb/S2TwDCo3SbXlzwx87vFKu3MwZfPVL4O2fuPn +9Z6rYPnT8Z2SdIrkHJasW4DptfQxh6NR/Md+oW+OU3fUl8FVM5I+GC911K2GScuVr1QGbNgGE41b +/+EmGVnAJLqBcXmQRFBoJJRfuLMR8SlBYaNByyM21cHxMlAQTn/0hpPshNOOvEu/XAFOBz3cFIqU +CqTqc/sLUegTBxj6DvEr0VQVfTzh97QZQmdiXnfgolXsttlpF9U6r0TtSsWe5HonfOV116rLJeff +awrbD02TTqigzXsu8lkBarcNuAeBfos4GzjmCleZPe4h6KP1DBbdi+w0jpwqHAAVF41og9JwnxgI +zRFo1clrUs3ERo/ctfPYV3Me6ZQ5BL/T3jjetFPsaRyifsSP5BtwrfKi+fv3FmRmaZ9JUaLiFRhn +Bkp/1Wy1TbMz4GHrXb7pmA8y1x1LPC5aAVKRCfLf6o3YBkBjqhHk/sM3nhRSP/TizPJhk9H9Z2vX +Uq6/aKtAQ6BXNVN48FP4YUIHZMbXb5tMOA1jrGKvNouicwoN9SG9dKpN6nIDSdvHXx1iY8f93ZHs +M+71bbRuMGjeyNYmsHVee7QHIJihdjK4TWxPAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYD +VR0OBBYEFMmAd+BikoL1RpzzuvdMw964o605MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsF +AAOCAgEAU18h9bqwOlI5LJKwbADJ784g7wbylp7ppHR/ehb8t/W2+xUbP6umwHJdELFx7rxP462s +A20ucS6vxOOto70MEae0/0qyexAQH6dXQbLArvQsWdZHEIjzIVEpMMpghq9Gqx3tOluwlN5E40EI +osHsHdb9T7bWR9AUC8rmyrV7d35BH16Dx7aMOZawP5aBQW9gkOLo+fsicdl9sz1Gv7SEr5AcD48S +aq/v7h56rgJKihcrdv6sVIkkLE8/trKnToyokZf7KcZ7XC25y2a2t6hbElGFtQl+Ynhw/qlqYLYd +DnkM/crqJIByw5c/8nerQyIKx+u2DISCLIBrQYoIwOula9+ZEsuK1V6ADJHgJgg2SMX6OBE1/yWD +LfJ6v9r9jv6ly0UsH8SIU653DtmadsWOLB2jutXsMq7Aqqz30XpN69QH4kj3Io6wpJ9qzo6ysmD0 +oyLQI+uUWnpp3Q+/QFesa1lQ2aOZ4W7+jQF5JyMV3pKdewlNWudLSDBaGOYKbeaP4NK75t98biGC +wWg5TbSYWGZizEqQXsP6JwSxeRV0mcy+rSDeJmAc61ZRpqPq5KM/p/9h3PFaTWwyI0PurKju7koS +CTxdccK+efrCh2gdC/1cacwG0Jp9VJkqyTkaGa9LKkPzY11aWOIv4x3kqdbQCtCev9eBCfHJxyYN +rJgWVqA= +-----END CERTIFICATE----- + +Buypass Class 3 Root CA +======================= +-----BEGIN CERTIFICATE----- +MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU +QnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3MgQ2xhc3MgMyBSb290IENBMB4X +DTEwMTAyNjA4Mjg1OFoXDTQwMTAyNjA4Mjg1OFowTjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1 +eXBhc3MgQVMtOTgzMTYzMzI3MSAwHgYDVQQDDBdCdXlwYXNzIENsYXNzIDMgUm9vdCBDQTCCAiIw +DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAKXaCpUWUOOV8l6ddjEGMnqb8RB2uACatVI2zSRH +sJ8YZLya9vrVediQYkwiL944PdbgqOkcLNt4EemOaFEVcsfzM4fkoF0LXOBXByow9c3EN3coTRiR +5r/VUv1xLXA+58bEiuPwKAv0dpihi4dVsjoT/Lc+JzeOIuOoTyrvYLs9tznDDgFHmV0ST9tD+leh +7fmdvhFHJlsTmKtdFoqwNxxXnUX/iJY2v7vKB3tvh2PX0DJq1l1sDPGzbjniazEuOQAnFN44wOwZ +ZoYS6J1yFhNkUsepNxz9gjDthBgd9K5c/3ATAOux9TN6S9ZV+AWNS2mw9bMoNlwUxFFzTWsL8TQH +2xc519woe2v1n/MuwU8XKhDzzMro6/1rqy6any2CbgTUUgGTLT2G/H783+9CHaZr77kgxve9oKeV +/afmiSTYzIw0bOIjL9kSGiG5VZFvC5F5GQytQIgLcOJ60g7YaEi7ghM5EFjp2CoHxhLbWNvSO1UQ +RwUVZ2J+GGOmRj8JDlQyXr8NYnon74Do29lLBlo3WiXQCBJ31G8JUJc9yB3D34xFMFbG02SrZvPA +Xpacw8Tvw3xrizp5f7NJzz3iiZ+gMEuFuZyUJHmPfWupRWgPK9Dx2hzLabjKSWJtyNBjYt1gD1iq +j6G8BaVmos8bdrKEZLFMOVLAMLrwjEsCsLa3AgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYD +VR0OBBYEFEe4zf/lb+74suwvTg75JbCOPGvDMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsF +AAOCAgEAACAjQTUEkMJAYmDv4jVM1z+s4jSQuKFvdvoWFqRINyzpkMLyPPgKn9iB5btb2iUspKdV +cSQy9sgL8rxq+JOssgfCX5/bzMiKqr5qb+FJEMwx14C7u8jYog5kV+qi9cKpMRXSIGrs/CIBKM+G +uIAeqcwRpTzyFrNHnfzSgCHEy9BHcEGhyoMZCCxt8l13nIoUE9Q2HJLw5QY33KbmkJs4j1xrG0aG +Q0JfPgEHU1RdZX33inOhmlRaHylDFCfChQ+1iHsaO5S3HWCntZznKWlXWpuTekMwGwPXYshApqr8 +ZORK15FTAaggiG6cX0S5y2CBNOxv033aSF/rtJC8LakcC6wc1aJoIIAE1vyxjy+7SjENSoYc6+I2 +KSb12tjE8nVhz36udmNKekBlk4f4HoCMhuWG1o8O/FMsYOgWYRqiPkN7zTlgVGr18okmAWiDSKIz +6MkEkbIRNBE+6tBDGR8Dk5AM/1E9V/RBbuHLoL7ryWPNbczk+DaqaJ3tvV2XcEQNtg413OEMXbug +UZTLfhbrES+jkkXITHHZvMmZUldGL1DPvTVp9D0VzgalLA8+9oG6lLvDu79leNKGef9JOxqDDPDe +eOzI8k1MGt6CKfjBWtrt7uYnXuhF0J0cUahoq0Tj0Itq4/g7u9xN12TyUb7mqqta6THuBrxzvxNi +Cp/HuZc= +-----END CERTIFICATE----- \ No newline at end of file diff --git a/app/api/Campaign_Monitor/class/exceptions.php b/app/api/Campaign_Monitor/class/exceptions.php new file mode 100755 index 0000000..da6f2ec --- /dev/null +++ b/app/api/Campaign_Monitor/class/exceptions.php @@ -0,0 +1,10 @@ +_level = $level; + } + + function log_message($message, $module, $level) { + if($this->_level >= $level) { + echo date('G:i:s').' - '.$module.': '.$message."
\n"; + } + } + } +} \ No newline at end of file diff --git a/app/api/Campaign_Monitor/class/serialisation.php b/app/api/Campaign_Monitor/class/serialisation.php new file mode 100755 index 0000000..80960c3 --- /dev/null +++ b/app/api/Campaign_Monitor/class/serialisation.php @@ -0,0 +1,136 @@ +log_message('Getting serialiser', __FUNCTION__, CS_REST_LOG_VERBOSE); + if(function_exists('json_decode') && function_exists('json_encode')) { + return new CS_REST_NativeJsonSerialiser($log); + } else { + return new CS_REST_ServicesJsonSerialiser($log); + } + } +} + +if (!class_exists('CS_REST_BaseSerialiser')) { + class CS_REST_BaseSerialiser { + + var $_log; + + function __construct($log) { + $this->_log = $log; + } + + /** + * Recursively ensures that all data values are utf-8 encoded. + * @param array $data All values of this array are checked for utf-8 encoding. + */ + function check_encoding($data) { + + foreach($data as $k => $v) { + // If the element is a sub-array then recusively encode the array + if(is_array($v)) { + $data[$k] = $this->check_encoding($v); + // Otherwise if the element is a string then we need to check the encoding + } else if(is_string($v)) { + if((function_exists('mb_detect_encoding') && mb_detect_encoding($v) !== 'UTF-8') || + (function_exists('mb_check_encoding') && !mb_check_encoding($v, 'UTF-8'))) { + // The string is using some other encoding, make sure we utf-8 encode + $v = utf8_encode($v); + } + + $data[$k] = $v; + } + } + + return $data; + } + } +} + +if (!class_exists('CS_REST_DoNothingSerialiser')) { + class CS_REST_DoNothingSerialiser extends CS_REST_BaseSerialiser { + function __construct() {} + function get_type() { return 'do_nothing'; } + function serialise($data) { return $data; } + function deserialise($text) { + $data = json_decode($text); + return is_null($data) ? $text : $data; + } + function check_encoding($data) { return $data; } + } +} + +if (!class_exists('CS_REST_NativeJsonSerialiser')) { + class CS_REST_NativeJsonSerialiser extends CS_REST_BaseSerialiser { + + function get_format() { + return 'json'; + } + + function get_type() { + return 'native'; + } + + function serialise($data) { + if(is_null($data) || $data == '') return ''; + return json_encode($this->check_encoding($data)); + } + + function deserialise($text) { + $data = json_decode($text); + + return $this->strip_surrounding_quotes(is_null($data) ? $text : $data); + } + + /** + * We've had sporadic reports of people getting ID's from create routes with the surrounding quotes present. + * There is no case where these should be present. Just get rid of it. + */ + function strip_surrounding_quotes($data) { + if(is_string($data)) { + return trim($data, '"'); + } + + return $data; + } + } +} + +if (!class_exists('CS_REST_ServicesJsonSerialiser')) { + class CS_REST_ServicesJsonSerialiser extends CS_REST_BaseSerialiser { + + var $_serialiser; + + function __construct($log) { + parent::__construct($log); + if (!class_exists('Services_JSON', false)) { + require_once dirname(__FILE__).'/services_json.php'; + } + + $this->_serialiser = new Services_JSON(); + } + + function get_content_type() { + return 'application/json'; + } + + function get_format() { + return 'json'; + } + + function get_type() { + return 'services_json'; + } + + function serialise($data) { + if(is_null($data) || $data == '') return ''; + return $this->_serialiser->encode($this->check_encoding($data)); + } + + function deserialise($text) { + $data = $this->_serialiser->decode($text); + + return is_null($data) ? $text : $data; + } + } +} \ No newline at end of file diff --git a/app/api/Campaign_Monitor/class/services_json.php b/app/api/Campaign_Monitor/class/services_json.php new file mode 100755 index 0000000..4555960 --- /dev/null +++ b/app/api/Campaign_Monitor/class/services_json.php @@ -0,0 +1,774 @@ + + * @author Matt Knapp + * @author Brett Stimmerman + * @copyright 2005 Michal Migurski + * @version CVS: $Id: JSON.php,v 1.31 2006/06/28 05:54:17 migurski Exp $ + * @license http://www.opensource.org/licenses/bsd-license.php + * @link http://pear.php.net/pepr/pepr-proposal-show.php?id=198 + */ + +/** + * Marker constant for Services_JSON::decode(), used to flag stack state + */ +defined('SERVICES_JSON_SLICE') or define('SERVICES_JSON_SLICE', 1); + +/** + * Marker constant for Services_JSON::decode(), used to flag stack state + */ +defined('SERVICES_JSON_IN_STR') or define('SERVICES_JSON_IN_STR', 2); + +/** + * Marker constant for Services_JSON::decode(), used to flag stack state + */ +defined('SERVICES_JSON_IN_ARR') or define('SERVICES_JSON_IN_ARR', 3); + +/** + * Marker constant for Services_JSON::decode(), used to flag stack state + */ +defined('SERVICES_JSON_IN_OBJ') or define('SERVICES_JSON_IN_OBJ', 4); + +/** + * Marker constant for Services_JSON::decode(), used to flag stack state + */ +defined('SERVICES_JSON_IN_CMT') or define('SERVICES_JSON_IN_CMT', 5); + +/** + * Behavior switch for Services_JSON::decode() + */ +defined('SERVICES_JSON_LOOSE_TYPE') or define('SERVICES_JSON_LOOSE_TYPE', 16); + +/** + * Behavior switch for Services_JSON::decode() + */ +defined('SERVICES_JSON_SUPPRESS_ERRORS') or define('SERVICES_JSON_SUPPRESS_ERRORS', 32); + +/** + * Converts to and from JSON format. + * + * Brief example of use: + * + * + * // create a new instance of Services_JSON + * $json = new Services_JSON(); + * + * // convert a complexe value to JSON notation, and send it to the browser + * $value = array('foo', 'bar', array(1, 2, 'baz'), array(3, array(4))); + * $output = $json->encode($value); + * + * print($output); + * // prints: ["foo","bar",[1,2,"baz"],[3,[4]]] + * + * // accept incoming POST data, assumed to be in JSON notation + * $input = file_get_contents('php://input', 1000000); + * $value = $json->decode($input); + * + */ +if (!class_exists('Services_JSON')) { + class Services_JSON + { + /** + * constructs a new JSON instance + * + * @param int $use object behavior flags; combine with boolean-OR + * + * possible values: + * - SERVICES_JSON_LOOSE_TYPE: loose typing. + * "{...}" syntax creates associative arrays + * instead of objects in decode(). + * - SERVICES_JSON_SUPPRESS_ERRORS: error suppression. + * Values which can't be encoded (e.g. resources) + * appear as NULL instead of throwing errors. + * By default, a deeply-nested resource will + * bubble up with an error, so all return values + * from encode() should be checked with isError() + */ + function __construct($use = 0) + { + $this->use = $use; + } + + /** + * convert a string from one UTF-16 char to one UTF-8 char + * + * Normally should be handled by mb_convert_encoding, but + * provides a slower PHP-only method for installations + * that lack the multibye string extension. + * + * @param string $utf16 UTF-16 character + * @return string UTF-8 character + * @access private + */ + function utf162utf8($utf16) + { + // oh please oh please oh please oh please oh please + if(function_exists('mb_convert_encoding')) { + return mb_convert_encoding($utf16, 'UTF-8', 'UTF-16'); + } + + $bytes = (ord($utf16[0]) << 8) | ord($utf16[1]); + + switch(true) { + case ((0x7F & $bytes) == $bytes): + // this case should never be reached, because we are in ASCII range + // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + return chr(0x7F & $bytes); + + case (0x07FF & $bytes) == $bytes: + // return a 2-byte UTF-8 character + // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + return chr(0xC0 | (($bytes >> 6) & 0x1F)) + . chr(0x80 | ($bytes & 0x3F)); + + case (0xFFFF & $bytes) == $bytes: + // return a 3-byte UTF-8 character + // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + return chr(0xE0 | (($bytes >> 12) & 0x0F)) + . chr(0x80 | (($bytes >> 6) & 0x3F)) + . chr(0x80 | ($bytes & 0x3F)); + } + + // ignoring UTF-32 for now, sorry + return ''; + } + + /** + * convert a string from one UTF-8 char to one UTF-16 char + * + * Normally should be handled by mb_convert_encoding, but + * provides a slower PHP-only method for installations + * that lack the multibye string extension. + * + * @param string $utf8 UTF-8 character + * @return string UTF-16 character + * @access private + */ + function utf82utf16($utf8) + { + // oh please oh please oh please oh please oh please + if(function_exists('mb_convert_encoding')) { + return mb_convert_encoding($utf8, 'UTF-16', 'UTF-8'); + } + + switch(strlen($utf8)) { + case 1: + // this case should never be reached, because we are in ASCII range + // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + return $utf8; + + case 2: + // return a UTF-16 character from a 2-byte UTF-8 char + // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + return chr(0x07 & (ord($utf8[0]) >> 2)) + . chr((0xC0 & (ord($utf8[0]) << 6)) + | (0x3F & ord($utf8[1]))); + + case 3: + // return a UTF-16 character from a 3-byte UTF-8 char + // see: http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + return chr((0xF0 & (ord($utf8[0]) << 4)) + | (0x0F & (ord($utf8[1]) >> 2))) + . chr((0xC0 & (ord($utf8[1]) << 6)) + | (0x7F & ord($utf8[2]))); + } + + // ignoring UTF-32 for now, sorry + return ''; + } + + /** + * encodes an arbitrary variable into JSON format + * + * @param mixed $var any number, boolean, string, array, or object to be encoded. + * see argument 1 to Services_JSON() above for array-parsing behavior. + * if var is a strng, note that encode() always expects it + * to be in ASCII or UTF-8 format! + * + * @return mixed JSON string representation of input var or an error if a problem occurs + * @access public + */ + function encode($var) + { + switch (gettype($var)) { + case 'boolean': + return $var ? 'true' : 'false'; + + case 'NULL': + return 'null'; + + case 'integer': + return (int) $var; + + case 'double': + case 'float': + return (float) $var; + + case 'string': + // STRINGS ARE EXPECTED TO BE IN ASCII OR UTF-8 FORMAT + $ascii = ''; + $strlen_var = strlen($var); + + /* + * Iterate over every character in the string, + * escaping with a slash or encoding to UTF-8 where necessary + */ + for ($c = 0; $c < $strlen_var; ++$c) { + + $ord_var_c = ord($var[$c]); + + switch (true) { + case $ord_var_c == 0x08: + $ascii .= '\b'; + break; + case $ord_var_c == 0x09: + $ascii .= '\t'; + break; + case $ord_var_c == 0x0A: + $ascii .= '\n'; + break; + case $ord_var_c == 0x0C: + $ascii .= '\f'; + break; + case $ord_var_c == 0x0D: + $ascii .= '\r'; + break; + + case $ord_var_c == 0x22: + case $ord_var_c == 0x2F: + case $ord_var_c == 0x5C: + // double quote, slash, slosh + $ascii .= '\\'.$var[$c]; + break; + + case (($ord_var_c >= 0x20) && ($ord_var_c <= 0x7F)): + // characters U-00000000 - U-0000007F (same as ASCII) + $ascii .= $var[$c]; + break; + + case (($ord_var_c & 0xE0) == 0xC0): + // characters U-00000080 - U-000007FF, mask 110XXXXX + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + $char = pack('C*', $ord_var_c, ord($var[$c + 1])); + $c += 1; + $utf16 = $this->utf82utf16($char); + $ascii .= sprintf('\u%04s', bin2hex($utf16)); + break; + + case (($ord_var_c & 0xF0) == 0xE0): + // characters U-00000800 - U-0000FFFF, mask 1110XXXX + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + $char = pack('C*', $ord_var_c, + ord($var[$c + 1]), + ord($var[$c + 2])); + $c += 2; + $utf16 = $this->utf82utf16($char); + $ascii .= sprintf('\u%04s', bin2hex($utf16)); + break; + + case (($ord_var_c & 0xF8) == 0xF0): + // characters U-00010000 - U-001FFFFF, mask 11110XXX + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + $char = pack('C*', $ord_var_c, + ord($var[$c + 1]), + ord($var[$c + 2]), + ord($var[$c + 3])); + $c += 3; + $utf16 = $this->utf82utf16($char); + $ascii .= sprintf('\u%04s', bin2hex($utf16)); + break; + + case (($ord_var_c & 0xFC) == 0xF8): + // characters U-00200000 - U-03FFFFFF, mask 111110XX + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + $char = pack('C*', $ord_var_c, + ord($var[$c + 1]), + ord($var[$c + 2]), + ord($var[$c + 3]), + ord($var[$c + 4])); + $c += 4; + $utf16 = $this->utf82utf16($char); + $ascii .= sprintf('\u%04s', bin2hex($utf16)); + break; + + case (($ord_var_c & 0xFE) == 0xFC): + // characters U-04000000 - U-7FFFFFFF, mask 1111110X + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + $char = pack('C*', $ord_var_c, + ord($var[$c + 1]), + ord($var[$c + 2]), + ord($var[$c + 3]), + ord($var[$c + 4]), + ord($var[$c + 5])); + $c += 5; + $utf16 = $this->utf82utf16($char); + $ascii .= sprintf('\u%04s', bin2hex($utf16)); + break; + } + } + + return '"'.$ascii.'"'; + + case 'array': + /* + * As per JSON spec if any array key is not an integer + * we must treat the the whole array as an object. We + * also try to catch a sparsely populated associative + * array with numeric keys here because some JS engines + * will create an array with empty indexes up to + * max_index which can cause memory issues and because + * the keys, which may be relevant, will be remapped + * otherwise. + * + * As per the ECMA and JSON specification an object may + * have any string as a property. Unfortunately due to + * a hole in the ECMA specification if the key is a + * ECMA reserved word or starts with a digit the + * parameter is only accessible using ECMAScript's + * bracket notation. + */ + + // treat as a JSON object + if (is_array($var) && count($var) && (array_keys($var) !== range(0, sizeof($var) - 1))) { + $properties = array_map(array($this, 'name_value'), + array_keys($var), + array_values($var)); + + foreach($properties as $property) { + if($this->isError($property)) { + return $property; + } + } + + return '{' . join(',', $properties) . '}'; + } + + // treat it like a regular array + $elements = array_map(array($this, 'encode'), $var); + + foreach($elements as $element) { + if($this->isError($element)) { + return $element; + } + } + + return '[' . join(',', $elements) . ']'; + + case 'object': + $vars = get_object_vars($var); + + $properties = array_map(array($this, 'name_value'), + array_keys($vars), + array_values($vars)); + + foreach($properties as $property) { + if($this->isError($property)) { + return $property; + } + } + + return '{' . join(',', $properties) . '}'; + + default: + return ($this->use & SERVICES_JSON_SUPPRESS_ERRORS) + ? 'null' + : new Services_JSON_Error(gettype($var)." can not be encoded as JSON string"); + } + } + + /** + * array-walking function for use in generating JSON-formatted name-value pairs + * + * @param string $name name of key to use + * @param mixed $value reference to an array element to be encoded + * + * @return string JSON-formatted name-value pair, like '"name":value' + * @access private + */ + function name_value($name, $value) + { + $encoded_value = $this->encode($value); + + if($this->isError($encoded_value)) { + return $encoded_value; + } + + return $this->encode(strval($name)) . ':' . $encoded_value; + } + + /** + * reduce a string by removing leading and trailing comments and whitespace + * + * @param $str string string value to strip of comments and whitespace + * + * @return string string value stripped of comments and whitespace + * @access private + */ + function reduce_string($str) + { + $str = preg_replace(array( + + // eliminate single line comments in '// ...' form + '#^\s*//(.+)$#m', + + // eliminate multi-line comments in '/* ... */' form, at start of string + '#^\s*/\*(.+)\*/#Us', + + // eliminate multi-line comments in '/* ... */' form, at end of string + '#/\*(.+)\*/\s*$#Us' + + ), '', $str); + + // eliminate extraneous space + return trim($str); + } + + /** + * decodes a JSON string into appropriate variable + * + * @param string $str JSON-formatted string + * + * @return mixed number, boolean, string, array, or object + * corresponding to given JSON input string. + * See argument 1 to Services_JSON() above for object-output behavior. + * Note that decode() always returns strings + * in ASCII or UTF-8 format! + * @access public + */ + function decode($str) + { + $str = $this->reduce_string($str); + + switch (strtolower($str)) { + case 'true': + return true; + + case 'false': + return false; + + case 'null': + return null; + + default: + $m = []; + + if (is_numeric($str)) { + // Lookie-loo, it's a number + + // This would work on its own, but I'm trying to be + // good about returning integers where appropriate: + // return (float)$str; + + // Return float or int, as appropriate + return ((float)$str == (integer)$str) + ? (integer)$str + : (float)$str; + + } elseif (preg_match('/^("|\').*(\1)$/s', $str, $m) && $m[1] == $m[2]) { + // STRINGS RETURNED IN UTF-8 FORMAT + $delim = substr($str, 0, 1); + $chrs = substr($str, 1, -1); + $utf8 = ''; + $strlen_chrs = strlen($chrs); + + for ($c = 0; $c < $strlen_chrs; ++$c) { + + $substr_chrs_c_2 = substr($chrs, $c, 2); + $ord_chrs_c = ord($chrs[$c]); + + switch (true) { + case $substr_chrs_c_2 == '\b': + $utf8 .= chr(0x08); + ++$c; + break; + case $substr_chrs_c_2 == '\t': + $utf8 .= chr(0x09); + ++$c; + break; + case $substr_chrs_c_2 == '\n': + $utf8 .= chr(0x0A); + ++$c; + break; + case $substr_chrs_c_2 == '\f': + $utf8 .= chr(0x0C); + ++$c; + break; + case $substr_chrs_c_2 == '\r': + $utf8 .= chr(0x0D); + ++$c; + break; + + case $substr_chrs_c_2 == '\\"': + case $substr_chrs_c_2 == '\\\'': + case $substr_chrs_c_2 == '\\\\': + case $substr_chrs_c_2 == '\\/': + if (($delim == '"' && $substr_chrs_c_2 != '\\\'') || + ($delim == "'" && $substr_chrs_c_2 != '\\"')) { + $utf8 .= $chrs[++$c]; + } + break; + + case preg_match('/\\\u[0-9A-F]{4}/i', substr($chrs, $c, 6)): + // single, escaped unicode character + $utf16 = chr(hexdec(substr($chrs, ($c + 2), 2))) + . chr(hexdec(substr($chrs, ($c + 4), 2))); + $utf8 .= $this->utf162utf8($utf16); + $c += 5; + break; + + case ($ord_chrs_c >= 0x20) && ($ord_chrs_c <= 0x7F): + $utf8 .= $chrs[$c]; + break; + + case ($ord_chrs_c & 0xE0) == 0xC0: + // characters U-00000080 - U-000007FF, mask 110XXXXX + //see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + $utf8 .= substr($chrs, $c, 2); + ++$c; + break; + + case ($ord_chrs_c & 0xF0) == 0xE0: + // characters U-00000800 - U-0000FFFF, mask 1110XXXX + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + $utf8 .= substr($chrs, $c, 3); + $c += 2; + break; + + case ($ord_chrs_c & 0xF8) == 0xF0: + // characters U-00010000 - U-001FFFFF, mask 11110XXX + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + $utf8 .= substr($chrs, $c, 4); + $c += 3; + break; + + case ($ord_chrs_c & 0xFC) == 0xF8: + // characters U-00200000 - U-03FFFFFF, mask 111110XX + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + $utf8 .= substr($chrs, $c, 5); + $c += 4; + break; + + case ($ord_chrs_c & 0xFE) == 0xFC: + // characters U-04000000 - U-7FFFFFFF, mask 1111110X + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + $utf8 .= substr($chrs, $c, 6); + $c += 5; + break; + + } + + } + + return $utf8; + + } elseif (preg_match('/^\[.*\]$/s', $str) || preg_match('/^\{.*\}$/s', $str)) { + // array, or object notation + + if ($str[0] == '[') { + $stk = array(SERVICES_JSON_IN_ARR); + $arr = []; + } else { + if ($this->use & SERVICES_JSON_LOOSE_TYPE) { + $stk = array(SERVICES_JSON_IN_OBJ); + $obj = []; + } else { + $stk = array(SERVICES_JSON_IN_OBJ); + $obj = new stdClass(); + } + } + + array_push($stk, array('what' => SERVICES_JSON_SLICE, + 'where' => 0, + 'delim' => false)); + + $chrs = substr($str, 1, -1); + $chrs = $this->reduce_string($chrs); + + if ($chrs == '') { + if (reset($stk) == SERVICES_JSON_IN_ARR) { + return $arr; + + } else { + return $obj; + + } + } + + $strlen_chrs = strlen($chrs); + + for ($c = 0; $c <= $strlen_chrs; ++$c) { + + $top = end($stk); + $substr_chrs_c_2 = substr($chrs, $c, 2); + + if (($c == $strlen_chrs) || (($chrs[$c] == ',') && ($top['what'] == SERVICES_JSON_SLICE))) { + // found a comma that is not inside a string, array, etc., + // OR we've reached the end of the character list + $slice = substr($chrs, $top['where'], ($c - $top['where'])); + array_push($stk, array('what' => SERVICES_JSON_SLICE, 'where' => ($c + 1), 'delim' => false)); + + if (reset($stk) == SERVICES_JSON_IN_ARR) { + // we are in an array, so just push an element onto the stack + array_push($arr, $this->decode($slice)); + + } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) { + // we are in an object, so figure + // out the property name and set an + // element in an associative array, + // for now + $parts = []; + + if (preg_match('/^\s*(["\'].*[^\\\]["\'])\s*:\s*(\S.*),?$/Uis', $slice, $parts)) { + // "name":value pair + $key = $this->decode($parts[1]); + $val = $this->decode($parts[2]); + + if ($this->use & SERVICES_JSON_LOOSE_TYPE) { + $obj[$key] = $val; + } else { + $obj->$key = $val; + } + } elseif (preg_match('/^\s*(\w+)\s*:\s*(\S.*),?$/Uis', $slice, $parts)) { + // name:value pair, where name is unquoted + $key = $parts[1]; + $val = $this->decode($parts[2]); + + if ($this->use & SERVICES_JSON_LOOSE_TYPE) { + $obj[$key] = $val; + } else { + $obj->$key = $val; + } + } + + } + + } elseif ((($chrs[$c] == '"') || ($chrs[$c] == "'")) && ($top['what'] != SERVICES_JSON_IN_STR)) { + // found a quote, and we are not inside a string + array_push($stk, array('what' => SERVICES_JSON_IN_STR, 'where' => $c, 'delim' => $chrs[$c])); + + } elseif (($chrs[$c] == $top['delim']) && + ($top['what'] == SERVICES_JSON_IN_STR) && + ((strlen(substr($chrs, 0, $c)) - strlen(rtrim(substr($chrs, 0, $c), '\\'))) % 2 != 1)) { + // found a quote, we're in a string, and it's not escaped + // we know that it's not escaped becase there is _not_ an + // odd number of backslashes at the end of the string so far + array_pop($stk); + + } elseif (($chrs[$c] == '[') && + in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) { + // found a left-bracket, and we are in an array, object, or slice + array_push($stk, array('what' => SERVICES_JSON_IN_ARR, 'where' => $c, 'delim' => false)); + + } elseif (($chrs[$c] == ']') && ($top['what'] == SERVICES_JSON_IN_ARR)) { + // found a right-bracket, and we're in an array + array_pop($stk); + + } elseif (($chrs[$c] == '{') && + in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) { + // found a left-brace, and we are in an array, object, or slice + array_push($stk, array('what' => SERVICES_JSON_IN_OBJ, 'where' => $c, 'delim' => false)); + + } elseif (($chrs[$c] == '}') && ($top['what'] == SERVICES_JSON_IN_OBJ)) { + // found a right-brace, and we're in an object + array_pop($stk); + + } elseif (($substr_chrs_c_2 == '/*') && + in_array($top['what'], array(SERVICES_JSON_SLICE, SERVICES_JSON_IN_ARR, SERVICES_JSON_IN_OBJ))) { + // found a comment start, and we are in an array, object, or slice + array_push($stk, array('what' => SERVICES_JSON_IN_CMT, 'where' => $c, 'delim' => false)); + $c++; + + } elseif (($substr_chrs_c_2 == '*/') && ($top['what'] == SERVICES_JSON_IN_CMT)) { + // found a comment end, and we're in one now + array_pop($stk); + $c++; + + for ($i = $top['where']; $i <= $c; ++$i) + $chrs = substr_replace($chrs, ' ', $i, 1); + + } + + } + + if (reset($stk) == SERVICES_JSON_IN_ARR) { + return $arr; + + } elseif (reset($stk) == SERVICES_JSON_IN_OBJ) { + return $obj; + + } + + } + } + } + + function isError($data, $code = null) + { + if (is_object($data) && (get_class($data) == 'services_json_error' || + is_subclass_of($data, 'services_json_error'))) { + return true; + } + + return false; + } + } +} + +if (!class_exists('Services_JSON_Error')) { + class Services_JSON_Error + { + function __construct($message = 'unknown error', $code = null, + $mode = null, $options = null, $userinfo = null) + { + + } + } +} + +?> diff --git a/app/api/Campaign_Monitor/class/transport.php b/app/api/Campaign_Monitor/class/transport.php new file mode 100755 index 0000000..eb598aa --- /dev/null +++ b/app/api/Campaign_Monitor/class/transport.php @@ -0,0 +1,352 @@ +log_message('No transport is available', __FUNCTION__, CS_REST_LOG_ERROR); + trigger_error('No transport is available.'. + ($requires_ssl ? ' Try using non-secure (http) mode or ' : ' Please '). + 'ensure the cURL extension is loaded', E_USER_ERROR); + } + } +} + +if(!function_exists("CS_REST_TRANSPORT_can_use_raw_socket")) { + function CS_REST_TRANSPORT_can_use_raw_socket($requires_ssl) { + if(function_exists('fsockopen')) { + if($requires_ssl) { + return extension_loaded('openssl'); + } + + return true; + } + + return false; + } +} + +if (!class_exists('CS_REST_BaseTransport')) { + class CS_REST_BaseTransport { + + var $_log; + + function __construct($log) { + $this->_log = $log; + } + + function split_and_inflate($response, $may_be_compressed) { + $ra = explode("\r\n\r\n", $response); + + $result = array_pop($ra); + $headers = array_pop($ra); + + if($may_be_compressed && preg_match('/^Content-Encoding:\s+gzip\s+$/im', $headers)) { + $original_length = strlen($response); + $result = gzinflate(substr($result, 10, -8)); + + $this->_log->log_message('Inflated gzipped response: '.$original_length.' bytes ->'. + strlen($result).' bytes', get_class(), CS_REST_LOG_VERBOSE); + } + + return array($headers, $result); + } + + } +} +/** + * Provide HTTP request functionality via cURL extensions + * + * @author tobyb + * @since 1.0 + */ +if (!class_exists('CS_REST_CurlTransport')) { + class CS_REST_CurlTransport extends CS_REST_BaseTransport { + + var $_curl_zlib; + + function __construct($log) { + parent::__construct($log); + + $curl_version = curl_version(); + $this->_curl_zlib = isset($curl_version['libz_version']); + } + + /** + * @return string The type of transport used + */ + function get_type() { + return 'cURL'; + } + + function make_call($call_options) { + $ch = curl_init(); + + curl_setopt($ch, CURLOPT_URL, $call_options['route']); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_HEADER, true); + $headers = []; + $headers[] = 'Content-Type: '.$call_options['contentType']; + + + if (array_key_exists('authdetails', $call_options) && + isset($call_options['authdetails'])) { + if (array_key_exists('username', $call_options['authdetails']) && + array_key_exists('password', $call_options['authdetails'])) { + # Authenticating using basic auth for retrieving user's API key. + curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); + curl_setopt($ch, CURLOPT_USERPWD, $call_options['authdetails']['username'].':'.$call_options['authdetails']['password']); + } elseif (array_key_exists('access_token', $call_options['authdetails'])) { + # Authenticating using OAuth. + $access_token = $call_options['authdetails']['access_token']; + $headers[] = 'Authorization: Bearer '.$access_token; + } elseif (array_key_exists('api_key', $call_options['authdetails'])) { + # Authenticating using an API key. + curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); + $api_key = $call_options['authdetails']['api_key']; + curl_setopt($ch, CURLOPT_USERPWD, $api_key.':nopass'); + } + } + + curl_setopt($ch, CURLOPT_USERAGENT, $call_options['userAgent']); + curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, CS_REST_SOCKET_TIMEOUT); + curl_setopt($ch, CURLOPT_TIMEOUT, CS_REST_CALL_TIMEOUT); + + $inflate_response = false; + if($this->_curl_zlib) { + $this->_log->log_message('curl+zlib support available. Requesting gzipped response.', + get_class($this), CS_REST_LOG_VERBOSE); + curl_setopt($ch, CURLOPT_ENCODING, 'gzip'); + } else if(function_exists('gzinflate')) { + $headers[] = 'Accept-Encoding: gzip'; + $inflate_response = true; + } + + if($call_options['protocol'] === 'https') { + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); + + if(strlen(ini_get('curl.cainfo')) === 0) { + curl_setopt($ch, CURLOPT_CAINFO, dirname(__FILE__).'/cacert.pem'); + } + } + + switch($call_options['method']) { + case CS_REST_PUT: + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, CS_REST_PUT); + $headers[] = 'Content-Length: '.strlen($call_options['data']); + curl_setopt($ch, CURLOPT_POSTFIELDS, $call_options['data']); + break; + case CS_REST_POST: + curl_setopt($ch, CURLOPT_POST, true); + curl_setopt($ch, CURLOPT_POSTFIELDS, isset($call_options['data']) ? $call_options['data'] : ''); + break; + case CS_REST_DELETE: + curl_setopt($ch, CURLOPT_CUSTOMREQUEST, CS_REST_DELETE); + break; + } + + if(count($headers) > 0) { + curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); + } + + $response = curl_exec($ch); + + if(!$response && $response !== '') { + $this->_log->log_message('Error making request with curl_error: '.curl_errno($ch), + get_class($this), CS_REST_LOG_ERROR); + + require_once dirname(__FILE__).'/exceptions.php'; + throw new CurlException(curl_error($ch), curl_errno($ch)); + } + + list( $headers, $result ) = $this->split_and_inflate($response, $inflate_response); + + $this->_log->log_message('API Call Info for '.$call_options['method'].' '. + curl_getinfo($ch, CURLINFO_EFFECTIVE_URL).': '.curl_getinfo($ch, CURLINFO_SIZE_UPLOAD). + ' bytes uploaded. '.curl_getinfo($ch, CURLINFO_SIZE_DOWNLOAD).' bytes downloaded'. + ' Total time (seconds): '.curl_getinfo($ch, CURLINFO_TOTAL_TIME), + get_class($this), CS_REST_LOG_VERBOSE); + + $result = array( + 'code' => curl_getinfo($ch, CURLINFO_HTTP_CODE), + 'response' => $result + ); + + curl_close($ch); + + return $result; + } + } +} + +if (!class_exists('CS_REST_SocketWrapper')) { + class CS_REST_SocketWrapper { + var $socket; + + function open($domain, $port) { + $this->socket = fsockopen($domain, $port, $errno, $errstr, CS_REST_SOCKET_TIMEOUT); + + if(!$this->socket) { + die('Error making request with '.$errno.': '.$errstr); + return false; + } else if(function_exists('stream_set_timeout')) { + stream_set_timeout($this->socket, CS_REST_SOCKET_TIMEOUT); + } + + return true; + } + + function write($data) { + fwrite($this->socket, $data); + } + + function read() { + ob_start(); + fpassthru($this->socket); + + return ob_get_clean(); + } + + function close() { + fclose($this->socket); + } + } +} + +if (!class_exists('CS_REST_SocketTransport')) { + class CS_REST_SocketTransport extends CS_REST_BaseTransport { + + var $_socket_wrapper; + + function __construct($log, $socket_wrapper = NULL) { + parent::__construct($log); + + if(is_null($socket_wrapper)) { + $socket_wrapper = new CS_REST_SocketWrapper(); + } + + $this->_socket_wrapper = $socket_wrapper; + } + + /** + * @return string The type of transport used + */ + function get_type() { + return 'Socket'; + } + + function make_call($call_options) { + $start_host = strpos($call_options['route'], $call_options['host']); + $host_len = strlen($call_options['host']); + + $domain = substr($call_options['route'], $start_host, $host_len); + $host = $domain; + $path = substr($call_options['route'], $start_host + $host_len); + $protocol = substr($call_options['route'], 0, $start_host); + $port = 80; + + $this->_log->log_message('Creating socket to '.$domain.' over '.$protocol.' for request to '.$path, + get_class($this), CS_REST_LOG_VERBOSE); + + if($protocol === 'https://') { + $domain = 'ssl://'.$domain; + $port = 443; + } + + if($this->_socket_wrapper->open($domain, $port)) { + $inflate_response = function_exists('gzinflate'); + + $request = $this->_build_request($call_options, $host, $path, $inflate_response); + $this->_log->log_message('Sending
'.$request.'
down the socket', + get_class($this), CS_REST_LOG_VERBOSE); + + $this->_socket_wrapper->write($request); + $response = $this->_socket_wrapper->read(); + $this->_socket_wrapper->close(); + + $this->_log->log_message('API Call Info for '.$call_options['method'].' '. + $call_options['route'].': '.strlen($request). + ' bytes uploaded. '.strlen($response).' bytes downloaded', + get_class($this), CS_REST_LOG_VERBOSE); + + list( $headers, $result ) = $this->split_and_inflate($response, $inflate_response); + + $this->_log->log_message('Received headers
'.$headers.'
', + get_class($this), CS_REST_LOG_VERBOSE); + + return array( + 'code' => $this->_get_status_code($headers), + 'response' => trim($result) + ); + } + } + + function _get_status_code($headers) { + if (preg_match('%^\s*HTTP/1\.1 (?P\d{3})%', $headers, $regs)) { + $this->_log->log_message('Got HTTP Status Code: '.$regs['code'], + get_class($this), CS_REST_LOG_VERBOSE); + return $regs['code']; + } + + $this->_log->log_message('Failed to get HTTP status code from request headers
'.$headers.'
', + get_class($this), CS_REST_LOG_ERROR); + trigger_error('Failed to get HTTP status code from request', E_USER_ERROR); + } + + function _build_request($call_options, $host, $path, $accept_gzip) { + $request_auth_details = ''; + + if (array_key_exists('authdetails', $call_options)) { + if (array_key_exists('username', $call_options['authdetails']) && + array_key_exists('password', $call_options['authdetails'])) { + # Authenticating using basic auth for retrieving user's API key. + $request_auth_details .= 'Authorization: Basic '.base64_encode($call_options['authdetails']['username'].':'.$call_options['authdetails']['password'])."\n"; + } elseif (array_key_exists('access_token', $call_options['authdetails'])) { + # Authenticating using OAuth. + $access_token = $call_options['authdetails']['access_token']; + $request_auth_details .= 'Authorization: Bearer '.$access_token."\n"; + } elseif (array_key_exists('api_key', $call_options['authdetails'])) { + # Authenticating using an API key. + $api_key = $call_options['authdetails']['api_key']; + $request_auth_details .= 'Authorization: Basic '.base64_encode($api_key.':nopass')."\n"; + } + } + + $request = + $call_options['method'].' '.$path." HTTP/1.1\n". + 'Host: '.$host."\n". + $request_auth_details. + 'User-Agent: '.$call_options['userAgent']."\n". + "Connection: Close\n". + 'Content-Type: '.$call_options['contentType']."\n"; + + if($accept_gzip) { + $request .= + "Accept-Encoding: gzip\n"; + } + + if(isset($call_options['data'])) { + $request .= + 'Content-Length: '.strlen($call_options['data'])."\n\n". + $call_options['data']; + } + + return $request."\n\n"; + } + } +} \ No newline at end of file diff --git a/app/api/Campaign_Monitor/csrest_subscribers.php b/app/api/Campaign_Monitor/csrest_subscribers.php new file mode 100755 index 0000000..12a6848 --- /dev/null +++ b/app/api/Campaign_Monitor/csrest_subscribers.php @@ -0,0 +1,235 @@ + 'your access token', + * 'refresh_token' => 'your refresh token') + * + * Or if using an API key: + * array('api_key' => 'your api key') + * @param string $protocol The protocol to use for requests (http|https) + * @param int $debug_level The level of debugging required CS_REST_LOG_NONE | CS_REST_LOG_ERROR | CS_REST_LOG_WARNING | CS_REST_LOG_VERBOSE + * @param string $host The host to send API requests to. There is no need to change this + * @param CS_REST_Log $log The logger to use. Used for dependency injection + * @param object|null $serialiser The serialiser to use. Used for dependency injection + * @param object|null $transport The transport to use. Used for dependency injection + * @access public + */ + function __construct ( + $list_id, + $auth_details, + $protocol = 'https', + $debug_level = CS_REST_LOG_NONE, + $host = 'api.createsend.com', + $log = NULL, + $serialiser = NULL, + $transport = NULL) { + + parent::__construct($auth_details, $protocol, $debug_level, $host, $log, $serialiser, $transport); + $this->set_list_id($list_id); + + } + + /** + * Change the list id used for calls after construction + * @param $list_id + * @access public + */ + function set_list_id($list_id) { + $this->_subscribers_base_route = $this->_base_route.'subscribers/'.$list_id; + } + + /** + * Adds a new subscriber to the specified list + * @param array $subscriber The subscriber details to use during creation. + * This array should be of the form + * array ( + * 'EmailAddress' => The new subscribers email address + * 'Name' => The name of the new subscriber + * 'CustomFields' => array( + * array( + * 'Key' => The custom fields personalisation tag + * 'Value' => The value for this subscriber + * ) + * ) + * 'ConsentToTrack' => Subscriber tracking preference ("yes", "no") + * 'Resubscribe' => Whether we should resubscribe this subscriber if they already exist in the list + * 'RestartSubscriptionBasedAutoResponders' => Whether we should restart subscription based auto responders which are sent when the subscriber first subscribes to a list. + * ) + * @access public + * @return CS_REST_Wrapper_Result A successful response will be empty + */ + function add($subscriber) { + return $this->post_request($this->_subscribers_base_route.'.json', $subscriber); + } + + /** + * Updates an existing subscriber (email, name, state, or custom fields) in the specified list. + * The update is performed even for inactive subscribers, but will return an error in the event of the + * given email not existing in the list. + * @param string $email The email address of the susbcriber to be updated + * @param array $subscriber The subscriber details to use for the update. Empty parameters will remain unchanged + * This array should be of the form + * array ( + * 'EmailAddress' => The new email address + * 'Name' => The name of the subscriber + * 'CustomFields' => array( + * array( + * 'Key' => The custom fields personalisation tag + * 'Value' => The value for this subscriber + * 'Clear' => true/false (pass true to remove this custom field. in the case of a [multi-option, select many] field, pass an option in the 'Value' field to clear that option or leave Value blank to remove all options) + * ) + * ) + * 'ConsentToTrack' => Subscriber tracking preference ("yes", "no") + * 'Resubscribe' => Whether we should resubscribe this subscriber if they already exist in the list + * 'RestartSubscriptionBasedAutoResponders' => Whether we should restart subscription based auto responders which are sent when the subscriber first subscribes to a list. + * ) + * @access public + * @return CS_REST_Wrapper_Result A successful response will be empty + */ + function update($email, $subscriber) { + return $this->put_request($this->_subscribers_base_route.'.json?email='.urlencode($email), $subscriber); + } + + /** + * Imports an array of subscribers into the current list + * @param array $subscribers An array of subscribers to import. + * This array should be of the form + * array ( + * array ( + * 'EmailAddress' => The new subscribers email address + * 'Name' => The name of the new subscriber + * 'CustomFields' => array( + * array( + * 'Key' => The custom fields personalisation tag + * 'Value' => The value for this subscriber + * 'Clear' => true/false (pass true to remove this custom field. in the case of a [multi-option, select many] field, pass an option in the 'Value' field to clear that option or leave Value blank to remove all options) + * ) + * ) + * ) + * ) + * @param bool $resubscribe Whether we should resubscribe any existing subscribers + * @param bool $queueSubscriptionBasedAutoResponders By default, subscription based auto responders do not trigger during an import. Pass a value of true to override this behaviour + * @param bool $restartSubscriptionBasedAutoResponders By default, subscription based auto responders will not be restarted + * @access public + * @return CS_REST_Wrapper_Result A successful response will be an object of the form + * { + * 'TotalUniqueEmailsSubmitted' => The number of unique emails submitted in the call + * 'TotalExistingSubscribers' => The number of subscribers who already existed in the list + * 'TotalNewSubscribers' => The number of new subscriptions to the list + * 'DuplicateEmailsInSubmission' => array The emails which appeared more than once in the batch + * 'FailureDetails' => array ( + * { + * 'EmailAddress' => The email address which failed + * 'Code' => The Create Send API Error code + * 'Message' => The reason for the failure + * } + * ) + * } + * + */ + function import($subscribers, $resubscribe, $queueSubscriptionBasedAutoResponders = false, $restartSubscriptionBasedAutoResponders = false) { + $subscribers = array( + 'Resubscribe' => $resubscribe, + 'QueueSubscriptionBasedAutoResponders' => $queueSubscriptionBasedAutoResponders, + 'Subscribers' => $subscribers, + 'RestartSubscriptionBasedAutoresponders' => $restartSubscriptionBasedAutoResponders + ); + + return $this->post_request($this->_subscribers_base_route.'/import.json', $subscribers); + } + + /** + * Gets a subscriber details, including custom fields + * @access public + * @return CS_REST_Wrapper_Result A successful response will be an object of the form + * { + * 'EmailAddress' => The subscriber email address + * 'Name' => The subscribers name + * 'Date' => The date the subscriber was added to the list + * 'State' => The current state of the subscriber + * 'CustomFields' => array( + * { + * 'Key' => The custom fields personalisation tag + * 'Value' => The custom field value for this subscriber + * } + * ) + * } + */ + function get($email, $include_tracking_pref = NULL) { + return $this->get_request($this->_subscribers_base_route.'.json?email='.urlencode($email), $include_tracking_pref); + } + + /** + * Gets the sending history to a specific subscriber + * @access public + * @return CS_REST_Wrapper_Result A successful response will be an object of the form + * array( + * { + * ID => The id of the email which was sent + * Type => 'Campaign' + * Name => The name of the email + * Actions => array( + * { + * Event => The type of action (Click, Open, Unsubscribe etc) + * Date => The date the event occurred + * IPAddress => The IP that the event originated from + * Detail => Any available details about the event i.e the URL for clicks + * } + * ) + * } + * ) + */ + function get_history($email) { + return $this->get_request($this->_subscribers_base_route.'/history.json?email='.urlencode($email)); + } + + /** + * Unsubscribes the given subscriber from the current list + * @param string $email The email address to unsubscribe + * @access public + * @return CS_REST_Wrapper_Result A successful response will be empty + */ + function unsubscribe($email) { + // We need to build the subscriber data structure. + $email = array( + 'EmailAddress' => $email + ); + + return $this->post_request($this->_subscribers_base_route.'/unsubscribe.json', $email); + } + + /** + * deletes the given subscriber from the current list + * @param string $email The email address to delete + * @access public + * @return CS_REST_Wrapper_Result A successful response will be empty + */ + function delete($email) { + return $this->delete_request($this->_subscribers_base_route.'.json?email='.urlencode($email)); + } + } +} \ No newline at end of file diff --git a/app/api/Google/Auth/Abstract.php b/app/api/Google/Auth/Abstract.php new file mode 100755 index 0000000..52dbed5 --- /dev/null +++ b/app/api/Google/Auth/Abstract.php @@ -0,0 +1,38 @@ + + * + */ +abstract class Google_Auth_Abstract +{ + /** + * An utility function that first calls $this->auth->sign($request) and then + * executes makeRequest() on that signed request. Used for when a request + * should be authenticated + * @param Google_Http_Request $request + * @return Google_Http_Request $request + */ + abstract public function authenticatedRequest(Google_Http_Request $request); + abstract public function sign(Google_Http_Request $request); +} diff --git a/app/api/Google/Auth/AppIdentity.php b/app/api/Google/Auth/AppIdentity.php new file mode 100755 index 0000000..b4ac9ca --- /dev/null +++ b/app/api/Google/Auth/AppIdentity.php @@ -0,0 +1,120 @@ +client = $client; + } + + /** + * Retrieve an access token for the scopes supplied. + */ + public function authenticateForScope($scopes) + { + if ($this->token && $this->tokenScopes == $scopes) { + return $this->token; + } + + $cacheKey = self::CACHE_PREFIX; + if (is_string($scopes)) { + $cacheKey .= $scopes; + } else if (is_array($scopes)) { + $cacheKey .= implode(":", $scopes); + } + + $this->token = $this->client->getCache()->get($cacheKey); + if (!$this->token) { + $this->retrieveToken($scopes, $cacheKey); + } else if ($this->token['expiration_time'] < time()) { + $this->client->getCache()->delete($cacheKey); + $this->retrieveToken($scopes, $cacheKey); + } + + $this->tokenScopes = $scopes; + return $this->token; + } + + /** + * Retrieve a new access token and store it in cache + * @param mixed $scopes + * @param string $cacheKey + */ + private function retrieveToken($scopes, $cacheKey) + { + $this->token = AppIdentityService::getAccessToken($scopes); + if ($this->token) { + $this->client->getCache()->set( + $cacheKey, + $this->token + ); + } + } + + /** + * Perform an authenticated / signed apiHttpRequest. + * This function takes the apiHttpRequest, calls apiAuth->sign on it + * (which can modify the request in what ever way fits the auth mechanism) + * and then calls apiCurlIO::makeRequest on the signed request + * + * @param Google_Http_Request $request + * @return Google_Http_Request The resulting HTTP response including the + * responseHttpCode, responseHeaders and responseBody. + */ + public function authenticatedRequest(Google_Http_Request $request) + { + $request = $this->sign($request); + return $this->client->getIo()->makeRequest($request); + } + + public function sign(Google_Http_Request $request) + { + if (!$this->token) { + // No token, so nothing to do. + return $request; + } + + $this->client->getLogger()->debug('App Identity authentication'); + + // Add the OAuth2 header to the request + $request->setRequestHeaders( + array('Authorization' => 'Bearer ' . $this->token['access_token']) + ); + + return $request; + } +} diff --git a/app/api/Google/Auth/AssertionCredentials.php b/app/api/Google/Auth/AssertionCredentials.php new file mode 100755 index 0000000..a7e5f54 --- /dev/null +++ b/app/api/Google/Auth/AssertionCredentials.php @@ -0,0 +1,136 @@ +serviceAccountName = $serviceAccountName; + $this->scopes = is_string($scopes) ? $scopes : implode(' ', $scopes); + $this->privateKey = $privateKey; + $this->privateKeyPassword = $privateKeyPassword; + $this->assertionType = $assertionType; + $this->sub = $sub; + $this->prn = $sub; + $this->useCache = $useCache; + } + + /** + * Generate a unique key to represent this credential. + * @return string + */ + public function getCacheKey() + { + if (!$this->useCache) { + return false; + } + $h = $this->sub; + $h .= $this->assertionType; + $h .= $this->privateKey; + $h .= $this->scopes; + $h .= $this->serviceAccountName; + return md5($h); + } + + public function generateAssertion() + { + $now = time(); + + $jwtParams = array( + 'aud' => Google_Auth_OAuth2::OAUTH2_TOKEN_URI, + 'scope' => $this->scopes, + 'iat' => $now, + 'exp' => $now + self::MAX_TOKEN_LIFETIME_SECS, + 'iss' => $this->serviceAccountName, + ); + + if ($this->sub !== false) { + $jwtParams['sub'] = $this->sub; + } else if ($this->prn !== false) { + $jwtParams['prn'] = $this->prn; + } + + return $this->makeSignedJwt($jwtParams); + } + + /** + * Creates a signed JWT. + * @param array $payload + * @return string The signed JWT. + */ + private function makeSignedJwt($payload) + { + $header = array('typ' => 'JWT', 'alg' => 'RS256'); + + $payload = json_encode($payload); + // Handle some overzealous escaping in PHP json that seemed to cause some errors + // with claimsets. + $payload = str_replace('\/', '/', $payload); + + $segments = array( + Google_Utils::urlSafeB64Encode(json_encode($header)), + Google_Utils::urlSafeB64Encode($payload) + ); + + $signingInput = implode('.', $segments); + $signer = new Google_Signer_P12($this->privateKey, $this->privateKeyPassword); + $signature = $signer->sign($signingInput); + $segments[] = Google_Utils::urlSafeB64Encode($signature); + + return implode(".", $segments); + } +} diff --git a/app/api/Google/Auth/ComputeEngine.php b/app/api/Google/Auth/ComputeEngine.php new file mode 100755 index 0000000..de9d675 --- /dev/null +++ b/app/api/Google/Auth/ComputeEngine.php @@ -0,0 +1,146 @@ + + */ +class Google_Auth_ComputeEngine extends Google_Auth_Abstract +{ + const METADATA_AUTH_URL = + 'http://metadata/computeMetadata/v1/instance/service-accounts/default/token'; + private $client; + private $token; + + public function __construct(Google_Client $client, $config = null) + { + $this->client = $client; + } + + /** + * Perform an authenticated / signed apiHttpRequest. + * This function takes the apiHttpRequest, calls apiAuth->sign on it + * (which can modify the request in what ever way fits the auth mechanism) + * and then calls apiCurlIO::makeRequest on the signed request + * + * @param Google_Http_Request $request + * @return Google_Http_Request The resulting HTTP response including the + * responseHttpCode, responseHeaders and responseBody. + */ + public function authenticatedRequest(Google_Http_Request $request) + { + $request = $this->sign($request); + return $this->client->getIo()->makeRequest($request); + } + + /** + * @param string $token + * @throws Google_Auth_Exception + */ + public function setAccessToken($token) + { + $token = json_decode($token, true); + if ($token == null) { + throw new Google_Auth_Exception('Could not json decode the token'); + } + if (! isset($token['access_token'])) { + throw new Google_Auth_Exception("Invalid token format"); + } + $token['created'] = time(); + $this->token = $token; + } + + public function getAccessToken() + { + return json_encode($this->token); + } + + /** + * Acquires a new access token from the compute engine metadata server. + * @throws Google_Auth_Exception + */ + public function acquireAccessToken() + { + $request = new Google_Http_Request( + self::METADATA_AUTH_URL, + 'GET', + array( + 'Metadata-Flavor' => 'Google' + ) + ); + $request->disableGzip(); + $response = $this->client->getIo()->makeRequest($request); + + if ($response->getResponseHttpCode() == 200) { + $this->setAccessToken($response->getResponseBody()); + $this->token['created'] = time(); + return $this->getAccessToken(); + } else { + throw new Google_Auth_Exception( + sprintf( + "Error fetching service account access token, message: '%s'", + $response->getResponseBody() + ), + $response->getResponseHttpCode() + ); + } + } + + /** + * Include an accessToken in a given apiHttpRequest. + * @param Google_Http_Request $request + * @return Google_Http_Request + * @throws Google_Auth_Exception + */ + public function sign(Google_Http_Request $request) + { + if ($this->isAccessTokenExpired()) { + $this->acquireAccessToken(); + } + + $this->client->getLogger()->debug('Compute engine service account authentication'); + + $request->setRequestHeaders( + array('Authorization' => 'Bearer ' . $this->token['access_token']) + ); + + return $request; + } + + /** + * Returns if the access_token is expired. + * @return bool Returns True if the access_token is expired. + */ + public function isAccessTokenExpired() + { + if (!$this->token || !isset($this->token['created'])) { + return true; + } + + // If the token is set to expire in the next 30 seconds. + $expired = ($this->token['created'] + + ($this->token['expires_in'] - 30)) < time(); + + return $expired; + } +} diff --git a/app/api/Google/Auth/Exception.php b/app/api/Google/Auth/Exception.php new file mode 100755 index 0000000..61bf52d --- /dev/null +++ b/app/api/Google/Auth/Exception.php @@ -0,0 +1,24 @@ + + */ +class Google_Auth_LoginTicket +{ + const USER_ATTR = "sub"; + + // Information from id token envelope. + private $envelope; + + // Information from id token payload. + private $payload; + + /** + * Creates a user based on the supplied token. + * + * @param string $envelope Header from a verified authentication token. + * @param string $payload Information from a verified authentication token. + */ + public function __construct($envelope, $payload) + { + $this->envelope = $envelope; + $this->payload = $payload; + } + + /** + * Returns the numeric identifier for the user. + * @throws Google_Auth_Exception + * @return + */ + public function getUserId() + { + if (array_key_exists(self::USER_ATTR, $this->payload)) { + return $this->payload[self::USER_ATTR]; + } + throw new Google_Auth_Exception("No user_id in token"); + } + + /** + * Returns attributes from the login ticket. This can contain + * various information about the user session. + * @return array + */ + public function getAttributes() + { + return array("envelope" => $this->envelope, "payload" => $this->payload); + } +} diff --git a/app/api/Google/Auth/OAuth2.php b/app/api/Google/Auth/OAuth2.php new file mode 100755 index 0000000..dde843c --- /dev/null +++ b/app/api/Google/Auth/OAuth2.php @@ -0,0 +1,646 @@ +client = $client; + } + + /** + * Perform an authenticated / signed apiHttpRequest. + * This function takes the apiHttpRequest, calls apiAuth->sign on it + * (which can modify the request in what ever way fits the auth mechanism) + * and then calls apiCurlIO::makeRequest on the signed request + * + * @param Google_Http_Request $request + * @return Google_Http_Request The resulting HTTP response including the + * responseHttpCode, responseHeaders and responseBody. + */ + public function authenticatedRequest(Google_Http_Request $request) + { + $request = $this->sign($request); + return $this->client->getIo()->makeRequest($request); + } + + /** + * @param string $code + * @param boolean $crossClient + * @throws Google_Auth_Exception + * @return string + */ + public function authenticate($code, $crossClient = false) + { + if (strlen($code) == 0) { + throw new Google_Auth_Exception("Invalid code"); + } + + $arguments = array( + 'code' => $code, + 'grant_type' => 'authorization_code', + 'client_id' => $this->client->getClassConfig($this, 'client_id'), + 'client_secret' => $this->client->getClassConfig($this, 'client_secret') + ); + + if ($crossClient !== true) { + $arguments['redirect_uri'] = $this->client->getClassConfig($this, 'redirect_uri'); + } + + // We got here from the redirect from a successful authorization grant, + // fetch the access token + $request = new Google_Http_Request( + self::OAUTH2_TOKEN_URI, + 'POST', + array(), + $arguments + ); + $request->disableGzip(); + $response = $this->client->getIo()->makeRequest($request); + + if ($response->getResponseHttpCode() == 200) { + $this->setAccessToken($response->getResponseBody()); + $this->token['created'] = time(); + return $this->getAccessToken(); + } else { + $decodedResponse = json_decode($response->getResponseBody(), true); + if ($decodedResponse != null && $decodedResponse['error']) { + $errorText = $decodedResponse['error']; + if (isset($decodedResponse['error_description'])) { + $errorText .= ": " . $decodedResponse['error_description']; + } + } + throw new Google_Auth_Exception( + sprintf( + "Error fetching OAuth2 access token, message: '%s'", + $errorText + ), + $response->getResponseHttpCode() + ); + } + } + + /** + * Create a URL to obtain user authorization. + * The authorization endpoint allows the user to first + * authenticate, and then grant/deny the access request. + * @param string $scope The scope is expressed as a list of space-delimited strings. + * @return string + */ + public function createAuthUrl($scope) + { + $params = array( + 'response_type' => 'code', + 'redirect_uri' => $this->client->getClassConfig($this, 'redirect_uri'), + 'client_id' => $this->client->getClassConfig($this, 'client_id'), + 'scope' => $scope, + 'access_type' => $this->client->getClassConfig($this, 'access_type'), + ); + + // Prefer prompt to approval prompt. + if ($this->client->getClassConfig($this, 'prompt')) { + $params = $this->maybeAddParam($params, 'prompt'); + } else { + $params = $this->maybeAddParam($params, 'approval_prompt'); + } + $params = $this->maybeAddParam($params, 'login_hint'); + $params = $this->maybeAddParam($params, 'hd'); + $params = $this->maybeAddParam($params, 'openid.realm'); + $params = $this->maybeAddParam($params, 'include_granted_scopes'); + + // If the list of scopes contains plus.login, add request_visible_actions + // to auth URL. + $rva = $this->client->getClassConfig($this, 'request_visible_actions'); + if (strpos($scope, 'plus.login') && strlen($rva) > 0) { + $params['request_visible_actions'] = $rva; + } + + if (isset($this->state)) { + $params['state'] = $this->state; + } + + return self::OAUTH2_AUTH_URL . "?" . http_build_query($params, '', '&'); + } + + /** + * @param string $token + * @throws Google_Auth_Exception + */ + public function setAccessToken($token) + { + $token = json_decode($token, true); + if ($token == null) { + throw new Google_Auth_Exception('Could not json decode the token'); + } + if (! isset($token['access_token'])) { + throw new Google_Auth_Exception("Invalid token format"); + } + $this->token = $token; + } + + public function getAccessToken() + { + return json_encode($this->token); + } + + public function getRefreshToken() + { + if (array_key_exists('refresh_token', $this->token)) { + return $this->token['refresh_token']; + } else { + return null; + } + } + + public function setState($state) + { + $this->state = $state; + } + + public function setAssertionCredentials(Google_Auth_AssertionCredentials $creds) + { + $this->assertionCredentials = $creds; + } + + /** + * Include an accessToken in a given apiHttpRequest. + * @param Google_Http_Request $request + * @return Google_Http_Request + * @throws Google_Auth_Exception + */ + public function sign(Google_Http_Request $request) + { + // add the developer key to the request before signing it + if ($this->client->getClassConfig($this, 'developer_key')) { + $request->setQueryParam('key', $this->client->getClassConfig($this, 'developer_key')); + } + + // Cannot sign the request without an OAuth access token. + if (null == $this->token && null == $this->assertionCredentials) { + return $request; + } + + // Check if the token is set to expire in the next 30 seconds + // (or has already expired). + if ($this->isAccessTokenExpired()) { + if ($this->assertionCredentials) { + $this->refreshTokenWithAssertion(); + } else { + $this->client->getLogger()->debug('OAuth2 access token expired'); + if (! array_key_exists('refresh_token', $this->token)) { + $error = "The OAuth 2.0 access token has expired," + ." and a refresh token is not available. Refresh tokens" + ." are not returned for responses that were auto-approved."; + + $this->client->getLogger()->error($error); + throw new Google_Auth_Exception($error); + } + $this->refreshToken($this->token['refresh_token']); + } + } + + $this->client->getLogger()->debug('OAuth2 authentication'); + + // Add the OAuth2 header to the request + $request->setRequestHeaders( + array('Authorization' => 'Bearer ' . $this->token['access_token']) + ); + + return $request; + } + + /** + * Fetches a fresh access token with the given refresh token. + * @param string $refreshToken + * @return void + */ + public function refreshToken($refreshToken) + { + $this->refreshTokenRequest( + array( + 'client_id' => $this->client->getClassConfig($this, 'client_id'), + 'client_secret' => $this->client->getClassConfig($this, 'client_secret'), + 'refresh_token' => $refreshToken, + 'grant_type' => 'refresh_token' + ) + ); + } + + /** + * Fetches a fresh access token with a given assertion token. + * @param Google_Auth_AssertionCredentials $assertionCredentials optional. + * @return void + */ + public function refreshTokenWithAssertion($assertionCredentials = null) + { + if (!$assertionCredentials) { + $assertionCredentials = $this->assertionCredentials; + } + + $cacheKey = $assertionCredentials->getCacheKey(); + + if ($cacheKey) { + // We can check whether we have a token available in the + // cache. If it is expired, we can retrieve a new one from + // the assertion. + $token = $this->client->getCache()->get($cacheKey); + if ($token) { + $this->setAccessToken($token); + } + if (!$this->isAccessTokenExpired()) { + return; + } + } + + $this->client->getLogger()->debug('OAuth2 access token expired'); + $this->refreshTokenRequest( + array( + 'grant_type' => 'assertion', + 'assertion_type' => $assertionCredentials->assertionType, + 'assertion' => $assertionCredentials->generateAssertion(), + ) + ); + + if ($cacheKey) { + // Attempt to cache the token. + $this->client->getCache()->set( + $cacheKey, + $this->getAccessToken() + ); + } + } + + private function refreshTokenRequest($params) + { + if (isset($params['assertion'])) { + $this->client->getLogger()->info( + 'OAuth2 access token refresh with Signed JWT assertion grants.' + ); + } else { + $this->client->getLogger()->info('OAuth2 access token refresh'); + } + + $http = new Google_Http_Request( + self::OAUTH2_TOKEN_URI, + 'POST', + array(), + $params + ); + $http->disableGzip(); + $request = $this->client->getIo()->makeRequest($http); + + $code = $request->getResponseHttpCode(); + $body = $request->getResponseBody(); + if (200 == $code) { + $token = json_decode($body, true); + if ($token == null) { + throw new Google_Auth_Exception("Could not json decode the access token"); + } + + if (! isset($token['access_token']) || ! isset($token['expires_in'])) { + throw new Google_Auth_Exception("Invalid token format"); + } + + if (isset($token['id_token'])) { + $this->token['id_token'] = $token['id_token']; + } + $this->token['access_token'] = $token['access_token']; + $this->token['expires_in'] = $token['expires_in']; + $this->token['created'] = time(); + } else { + throw new Google_Auth_Exception("Error refreshing the OAuth2 token, message: '$body'", $code); + } + } + + /** + * Revoke an OAuth2 access token or refresh token. This method will revoke the current access + * token, if a token isn't provided. + * @throws Google_Auth_Exception + * @param string|null $token The token (access token or a refresh token) that should be revoked. + * @return boolean Returns True if the revocation was successful, otherwise False. + */ + public function revokeToken($token = null) + { + if (!$token) { + if (!$this->token) { + // Not initialized, no token to actually revoke + return false; + } elseif (array_key_exists('refresh_token', $this->token)) { + $token = $this->token['refresh_token']; + } else { + $token = $this->token['access_token']; + } + } + $request = new Google_Http_Request( + self::OAUTH2_REVOKE_URI, + 'POST', + array(), + "token=$token" + ); + $request->disableGzip(); + $response = $this->client->getIo()->makeRequest($request); + $code = $response->getResponseHttpCode(); + if ($code == 200) { + $this->token = null; + return true; + } + + return false; + } + + /** + * Returns if the access_token is expired. + * @return bool Returns True if the access_token is expired. + */ + public function isAccessTokenExpired() + { + if (!$this->token || !isset($this->token['created'])) { + return true; + } + + // If the token is set to expire in the next 30 seconds. + $expired = ($this->token['created'] + + ($this->token['expires_in'] - 30)) < time(); + + return $expired; + } + + // Gets federated sign-on certificates to use for verifying identity tokens. + // Returns certs as array structure, where keys are key ids, and values + // are PEM encoded certificates. + private function getFederatedSignOnCerts() + { + return $this->retrieveCertsFromLocation( + $this->client->getClassConfig($this, 'federated_signon_certs_url') + ); + } + + /** + * Retrieve and cache a certificates file. + * + * @param $url string location + * @throws Google_Auth_Exception + * @return array certificates + */ + public function retrieveCertsFromLocation($url) + { + // If we're retrieving a local file, just grab it. + if ("http" != substr($url, 0, 4)) { + $file = file_get_contents($url); + if ($file) { + return json_decode($file, true); + } else { + throw new Google_Auth_Exception( + "Failed to retrieve verification certificates: '" . + $url . "'." + ); + } + } + + // This relies on makeRequest caching certificate responses. + $request = $this->client->getIo()->makeRequest( + new Google_Http_Request( + $url + ) + ); + if ($request->getResponseHttpCode() == 200) { + $certs = json_decode($request->getResponseBody(), true); + if ($certs) { + return $certs; + } + } + throw new Google_Auth_Exception( + "Failed to retrieve verification certificates: '" . + $request->getResponseBody() . "'.", + $request->getResponseHttpCode() + ); + } + + /** + * Verifies an id token and returns the authenticated apiLoginTicket. + * Throws an exception if the id token is not valid. + * The audience parameter can be used to control which id tokens are + * accepted. By default, the id token must have been issued to this OAuth2 client. + * + * @param $id_token + * @param $audience + * @return Google_Auth_LoginTicket + */ + public function verifyIdToken($id_token = null, $audience = null) + { + if (!$id_token) { + $id_token = $this->token['id_token']; + } + $certs = $this->getFederatedSignonCerts(); + if (!$audience) { + $audience = $this->client->getClassConfig($this, 'client_id'); + } + + return $this->verifySignedJwtWithCerts( + $id_token, + $certs, + $audience, + array(self::OAUTH2_ISSUER, self::OAUTH2_ISSUER_HTTPS) + ); + } + + /** + * Verifies the id token, returns the verified token contents. + * + * @param $jwt string the token + * @param $certs array of certificates + * @param $required_audience string the expected consumer of the token + * @param [$issuer] the expected issues, defaults to Google + * @param [$max_expiry] the max lifetime of a token, defaults to MAX_TOKEN_LIFETIME_SECS + * @throws Google_Auth_Exception + * @return mixed token information if valid, false if not + */ + public function verifySignedJwtWithCerts( + $jwt, + $certs, + $required_audience, + $issuer = null, + $max_expiry = null + ) { + if (!$max_expiry) { + // Set the maximum time we will accept a token for. + $max_expiry = self::MAX_TOKEN_LIFETIME_SECS; + } + + $segments = explode(".", $jwt); + if (count($segments) != 3) { + throw new Google_Auth_Exception("Wrong number of segments in token: $jwt"); + } + $signed = $segments[0] . "." . $segments[1]; + $signature = Google_Utils::urlSafeB64Decode($segments[2]); + + // Parse envelope. + $envelope = json_decode(Google_Utils::urlSafeB64Decode($segments[0]), true); + if (!$envelope) { + throw new Google_Auth_Exception("Can't parse token envelope: " . $segments[0]); + } + + // Parse token + $json_body = Google_Utils::urlSafeB64Decode($segments[1]); + $payload = json_decode($json_body, true); + if (!$payload) { + throw new Google_Auth_Exception("Can't parse token payload: " . $segments[1]); + } + + // Check signature + $verified = false; + foreach ($certs as $keyName => $pem) { + $public_key = new Google_Verifier_Pem($pem); + if ($public_key->verify($signed, $signature)) { + $verified = true; + break; + } + } + + if (!$verified) { + throw new Google_Auth_Exception("Invalid token signature: $jwt"); + } + + // Check issued-at timestamp + $iat = 0; + if (array_key_exists("iat", $payload)) { + $iat = $payload["iat"]; + } + if (!$iat) { + throw new Google_Auth_Exception("No issue time in token: $json_body"); + } + $earliest = $iat - self::CLOCK_SKEW_SECS; + + // Check expiration timestamp + $now = time(); + $exp = 0; + if (array_key_exists("exp", $payload)) { + $exp = $payload["exp"]; + } + if (!$exp) { + throw new Google_Auth_Exception("No expiration time in token: $json_body"); + } + if ($exp >= $now + $max_expiry) { + throw new Google_Auth_Exception( + sprintf("Expiration time too far in future: %s", $json_body) + ); + } + + $latest = $exp + self::CLOCK_SKEW_SECS; + if ($now < $earliest) { + throw new Google_Auth_Exception( + sprintf( + "Token used too early, %s < %s: %s", + $now, + $earliest, + $json_body + ) + ); + } + if ($now > $latest) { + throw new Google_Auth_Exception( + sprintf( + "Token used too late, %s > %s: %s", + $now, + $latest, + $json_body + ) + ); + } + + // support HTTP and HTTPS issuers + // @see https://developers.google.com/identity/sign-in/web/backend-auth + $iss = $payload['iss']; + if ($issuer && !in_array($iss, (array) $issuer)) { + throw new Google_Auth_Exception( + sprintf( + "Invalid issuer, %s not in %s: %s", + $iss, + "[".implode(",", (array) $issuer)."]", + $json_body + ) + ); + } + + // Check audience + $aud = $payload["aud"]; + if ($aud != $required_audience) { + throw new Google_Auth_Exception( + sprintf( + "Wrong recipient, %s != %s:", + $aud, + $required_audience, + $json_body + ) + ); + } + + // All good. + return new Google_Auth_LoginTicket($envelope, $payload); + } + + /** + * Add a parameter to the auth params if not empty string. + */ + private function maybeAddParam($params, $name) + { + $param = $this->client->getClassConfig($this, $name); + if ($param != '') { + $params[$name] = $param; + } + return $params; + } +} diff --git a/app/api/Google/Auth/Simple.php b/app/api/Google/Auth/Simple.php new file mode 100755 index 0000000..cee5976 --- /dev/null +++ b/app/api/Google/Auth/Simple.php @@ -0,0 +1,63 @@ +client = $client; + } + + /** + * Perform an authenticated / signed apiHttpRequest. + * This function takes the apiHttpRequest, calls apiAuth->sign on it + * (which can modify the request in what ever way fits the auth mechanism) + * and then calls apiCurlIO::makeRequest on the signed request + * + * @param Google_Http_Request $request + * @return Google_Http_Request The resulting HTTP response including the + * responseHttpCode, responseHeaders and responseBody. + */ + public function authenticatedRequest(Google_Http_Request $request) + { + $request = $this->sign($request); + return $this->io->makeRequest($request); + } + + public function sign(Google_Http_Request $request) + { + $key = $this->client->getClassConfig($this, 'developer_key'); + if ($key) { + $this->client->getLogger()->debug( + 'Simple API Access developer key authentication' + ); + $request->setQueryParam('key', $key); + } + return $request; + } +} diff --git a/app/api/Google/Cache/Abstract.php b/app/api/Google/Cache/Abstract.php new file mode 100755 index 0000000..e6c7530 --- /dev/null +++ b/app/api/Google/Cache/Abstract.php @@ -0,0 +1,53 @@ + + */ +abstract class Google_Cache_Abstract +{ + + abstract public function __construct(Google_Client $client); + + /** + * Retrieves the data for the given key, or false if they + * key is unknown or expired + * + * @param String $key The key who's data to retrieve + * @param boolean|int $expiration Expiration time in seconds + * + */ + abstract public function get($key, $expiration = false); + + /** + * Store the key => $value set. The $value is serialized + * by this function so can be of any type + * + * @param string $key Key of the data + * @param string $value data + */ + abstract public function set($key, $value); + + /** + * Removes the key/data pair for the given $key + * + * @param String $key + */ + abstract public function delete($key); +} diff --git a/app/api/Google/Cache/Apc.php b/app/api/Google/Cache/Apc.php new file mode 100755 index 0000000..d3a8db1 --- /dev/null +++ b/app/api/Google/Cache/Apc.php @@ -0,0 +1,113 @@ + + */ +class Google_Cache_Apc extends Google_Cache_Abstract +{ + /** + * @var Google_Client the current client + */ + private $client; + + public function __construct(Google_Client $client) + { + if (! function_exists('apc_add') ) { + $error = "Apc functions not available"; + + $client->getLogger()->error($error); + throw new Google_Cache_Exception($error); + } + + $this->client = $client; + } + + /** + * @inheritDoc + */ + public function get($key, $expiration = false) + { + $ret = apc_fetch($key); + if ($ret === false) { + $this->client->getLogger()->debug( + 'APC cache miss', + array('key' => $key) + ); + return false; + } + if (is_numeric($expiration) && (time() - $ret['time'] > $expiration)) { + $this->client->getLogger()->debug( + 'APC cache miss (expired)', + array('key' => $key, 'var' => $ret) + ); + $this->delete($key); + return false; + } + + $this->client->getLogger()->debug( + 'APC cache hit', + array('key' => $key, 'var' => $ret) + ); + + return $ret['data']; + } + + /** + * @inheritDoc + */ + public function set($key, $value) + { + $var = array('time' => time(), 'data' => $value); + $rc = apc_store($key, $var); + + if ($rc == false) { + $this->client->getLogger()->error( + 'APC cache set failed', + array('key' => $key, 'var' => $var) + ); + throw new Google_Cache_Exception("Couldn't store data"); + } + + $this->client->getLogger()->debug( + 'APC cache set', + array('key' => $key, 'var' => $var) + ); + } + + /** + * @inheritDoc + * @param String $key + */ + public function delete($key) + { + $this->client->getLogger()->debug( + 'APC cache delete', + array('key' => $key) + ); + apc_delete($key); + } +} diff --git a/app/api/Google/Cache/Exception.php b/app/api/Google/Cache/Exception.php new file mode 100755 index 0000000..32030c0 --- /dev/null +++ b/app/api/Google/Cache/Exception.php @@ -0,0 +1,24 @@ + + */ +class Google_Cache_File extends Google_Cache_Abstract +{ + const MAX_LOCK_RETRIES = 10; + private $path; + private $fh; + + /** + * @var Google_Client the current client + */ + private $client; + + public function __construct(Google_Client $client) + { + $this->client = $client; + $this->path = $this->client->getClassConfig($this, 'directory'); + } + + public function get($key, $expiration = false) + { + $storageFile = $this->getCacheFile($key); + $data = false; + + if (!file_exists($storageFile)) { + $this->client->getLogger()->debug( + 'File cache miss', + array('key' => $key, 'file' => $storageFile) + ); + return false; + } + + if ($expiration) { + $mtime = filemtime($storageFile); + if ((time() - $mtime) >= $expiration) { + $this->client->getLogger()->debug( + 'File cache miss (expired)', + array('key' => $key, 'file' => $storageFile) + ); + $this->delete($key); + return false; + } + } + + if ($this->acquireReadLock($storageFile)) { + if (filesize($storageFile) > 0) { + $data = fread($this->fh, filesize($storageFile)); + $data = unserialize($data); + } else { + $this->client->getLogger()->debug( + 'Cache file was empty', + array('file' => $storageFile) + ); + } + $this->unlock($storageFile); + } + + $this->client->getLogger()->debug( + 'File cache hit', + array('key' => $key, 'file' => $storageFile, 'var' => $data) + ); + + return $data; + } + + public function set($key, $value) + { + $storageFile = $this->getWriteableCacheFile($key); + if ($this->acquireWriteLock($storageFile)) { + // We serialize the whole request object, since we don't only want the + // responseContent but also the postBody used, headers, size, etc. + $data = serialize($value); + $result = fwrite($this->fh, $data); + $this->unlock($storageFile); + + $this->client->getLogger()->debug( + 'File cache set', + array('key' => $key, 'file' => $storageFile, 'var' => $value) + ); + } else { + $this->client->getLogger()->notice( + 'File cache set failed', + array('key' => $key, 'file' => $storageFile) + ); + } + } + + public function delete($key) + { + $file = $this->getCacheFile($key); + if (file_exists($file) && !unlink($file)) { + $this->client->getLogger()->error( + 'File cache delete failed', + array('key' => $key, 'file' => $file) + ); + throw new Google_Cache_Exception("Cache file could not be deleted"); + } + + $this->client->getLogger()->debug( + 'File cache delete', + array('key' => $key, 'file' => $file) + ); + } + + private function getWriteableCacheFile($file) + { + return $this->getCacheFile($file, true); + } + + private function getCacheFile($file, $forWrite = false) + { + return $this->getCacheDir($file, $forWrite) . '/' . md5($file); + } + + private function getCacheDir($file, $forWrite) + { + // use the first 2 characters of the hash as a directory prefix + // this should prevent slowdowns due to huge directory listings + // and thus give some basic amount of scalability + $storageDir = $this->path . '/' . substr(md5($file), 0, 2); + if ($forWrite && ! is_dir($storageDir)) { + if (! mkdir($storageDir, 0700, true)) { + $this->client->getLogger()->error( + 'File cache creation failed', + array('dir' => $storageDir) + ); + throw new Google_Cache_Exception("Could not create storage directory: $storageDir"); + } + } + return $storageDir; + } + + private function acquireReadLock($storageFile) + { + return $this->acquireLock(LOCK_SH, $storageFile); + } + + private function acquireWriteLock($storageFile) + { + $rc = $this->acquireLock(LOCK_EX, $storageFile); + if (!$rc) { + $this->client->getLogger()->notice( + 'File cache write lock failed', + array('file' => $storageFile) + ); + $this->delete($storageFile); + } + return $rc; + } + + private function acquireLock($type, $storageFile) + { + $mode = $type == LOCK_EX ? "w" : "r"; + $this->fh = fopen($storageFile, $mode); + if (!$this->fh) { + $this->client->getLogger()->error( + 'Failed to open file during lock acquisition', + array('file' => $storageFile) + ); + return false; + } + if ($type == LOCK_EX) { + chmod($storageFile, 0600); + } + $count = 0; + while (!flock($this->fh, $type | LOCK_NB)) { + // Sleep for 10ms. + usleep(10000); + if (++$count < self::MAX_LOCK_RETRIES) { + return false; + } + } + return true; + } + + public function unlock($storageFile) + { + if ($this->fh) { + flock($this->fh, LOCK_UN); + } + } +} diff --git a/app/api/Google/Cache/Memcache.php b/app/api/Google/Cache/Memcache.php new file mode 100755 index 0000000..b6510b4 --- /dev/null +++ b/app/api/Google/Cache/Memcache.php @@ -0,0 +1,184 @@ + + */ +class Google_Cache_Memcache extends Google_Cache_Abstract +{ + private $connection = false; + private $mc = false; + private $host; + private $port; + + /** + * @var Google_Client the current client + */ + private $client; + + public function __construct(Google_Client $client) + { + if (!function_exists('memcache_connect') && !class_exists("Memcached")) { + $error = "Memcache functions not available"; + + $client->getLogger()->error($error); + throw new Google_Cache_Exception($error); + } + + $this->client = $client; + + if ($client->isAppEngine()) { + // No credentials needed for GAE. + $this->mc = new Memcached(); + $this->connection = true; + } else { + $this->host = $client->getClassConfig($this, 'host'); + $this->port = $client->getClassConfig($this, 'port'); + if (empty($this->host) || (empty($this->port) && (string) $this->port != "0")) { + $error = "You need to supply a valid memcache host and port"; + + $client->getLogger()->error($error); + throw new Google_Cache_Exception($error); + } + } + } + + /** + * @inheritDoc + */ + public function get($key, $expiration = false) + { + $this->connect(); + $ret = false; + if ($this->mc) { + $ret = $this->mc->get($key); + } else { + $ret = memcache_get($this->connection, $key); + } + if ($ret === false) { + $this->client->getLogger()->debug( + 'Memcache cache miss', + array('key' => $key) + ); + return false; + } + if (is_numeric($expiration) && (time() - $ret['time'] > $expiration)) { + $this->client->getLogger()->debug( + 'Memcache cache miss (expired)', + array('key' => $key, 'var' => $ret) + ); + $this->delete($key); + return false; + } + + $this->client->getLogger()->debug( + 'Memcache cache hit', + array('key' => $key, 'var' => $ret) + ); + + return $ret['data']; + } + + /** + * @inheritDoc + * @param string $key + * @param string $value + * @throws Google_Cache_Exception + */ + public function set($key, $value) + { + $this->connect(); + // we store it with the cache_time default expiration so objects will at + // least get cleaned eventually. + $data = array('time' => time(), 'data' => $value); + $rc = false; + if ($this->mc) { + $rc = $this->mc->set($key, $data); + } else { + $rc = memcache_set($this->connection, $key, $data, false); + } + if ($rc == false) { + $this->client->getLogger()->error( + 'Memcache cache set failed', + array('key' => $key, 'var' => $data) + ); + + throw new Google_Cache_Exception("Couldn't store data in cache"); + } + + $this->client->getLogger()->debug( + 'Memcache cache set', + array('key' => $key, 'var' => $data) + ); + } + + /** + * @inheritDoc + * @param String $key + */ + public function delete($key) + { + $this->connect(); + if ($this->mc) { + $this->mc->delete($key, 0); + } else { + memcache_delete($this->connection, $key, 0); + } + + $this->client->getLogger()->debug( + 'Memcache cache delete', + array('key' => $key) + ); + } + + /** + * Lazy initialiser for memcache connection. Uses pconnect for to take + * advantage of the persistence pool where possible. + */ + private function connect() + { + if ($this->connection) { + return; + } + + if (class_exists("Memcached")) { + $this->mc = new Memcached(); + $this->mc->addServer($this->host, $this->port); + $this->connection = true; + } else { + $this->connection = memcache_pconnect($this->host, $this->port); + } + + if (! $this->connection) { + $error = "Couldn't connect to memcache server"; + + $this->client->getLogger()->error($error); + throw new Google_Cache_Exception($error); + } + } +} diff --git a/app/api/Google/Cache/Null.php b/app/api/Google/Cache/Null.php new file mode 100755 index 0000000..c30dc6d --- /dev/null +++ b/app/api/Google/Cache/Null.php @@ -0,0 +1,57 @@ +isAppEngine()) { + // Automatically use Memcache if we're in AppEngine. + $config->setCacheClass('Google_Cache_Memcache'); + } + + if (version_compare(phpversion(), "5.3.4", "<=") || $this->isAppEngine()) { + // Automatically disable compress.zlib, as currently unsupported. + $config->setClassConfig('Google_Http_Request', 'disable_gzip', true); + } + } + + if ($config->getIoClass() == Google_Config::USE_AUTO_IO_SELECTION) { + if (function_exists('curl_version') && function_exists('curl_exec') + && !$this->isAppEngine()) { + $config->setIoClass("Google_IO_Curl"); + } else { + $config->setIoClass("Google_IO_Stream"); + } + } + + $this->config = $config; + } + + /** + * Get a string containing the version of the library. + * + * @return string + */ + public function getLibraryVersion() + { + return self::LIBVER; + } + + /** + * Attempt to exchange a code for an valid authentication token. + * If $crossClient is set to true, the request body will not include + * the request_uri argument + * Helper wrapped around the OAuth 2.0 implementation. + * + * @param $code string code from accounts.google.com + * @param $crossClient boolean, whether this is a cross-client authentication + * @return string token + */ + public function authenticate($code, $crossClient = false) + { + $this->authenticated = true; + return $this->getAuth()->authenticate($code, $crossClient); + } + + /** + * Loads a service account key and parameters from a JSON + * file from the Google Developer Console. Uses that and the + * given array of scopes to return an assertion credential for + * use with refreshTokenWithAssertionCredential. + * + * @param string $jsonLocation File location of the project-key.json. + * @param array $scopes The scopes to assert. + * @return Google_Auth_AssertionCredentials. + * @ + */ + public function loadServiceAccountJson($jsonLocation, $scopes) + { + $data = json_decode(file_get_contents($jsonLocation)); + if (isset($data->type) && $data->type == 'service_account') { + // Service Account format. + $cred = new Google_Auth_AssertionCredentials( + $data->client_email, + $scopes, + $data->private_key + ); + return $cred; + } else { + throw new Google_Exception("Invalid service account JSON file."); + } + } + + /** + * Set the auth config from the JSON string provided. + * This structure should match the file downloaded from + * the "Download JSON" button on in the Google Developer + * Console. + * @param string $json the configuration json + * @throws Google_Exception + */ + public function setAuthConfig($json) + { + $data = json_decode($json); + $key = isset($data->installed) ? 'installed' : 'web'; + if (!isset($data->$key)) { + throw new Google_Exception("Invalid client secret JSON file."); + } + $this->setClientId($data->$key->client_id); + $this->setClientSecret($data->$key->client_secret); + if (isset($data->$key->redirect_uris)) { + $this->setRedirectUri($data->$key->redirect_uris[0]); + } + } + + /** + * Set the auth config from the JSON file in the path + * provided. This should match the file downloaded from + * the "Download JSON" button on in the Google Developer + * Console. + * @param string $file the file location of the client json + */ + public function setAuthConfigFile($file) + { + $this->setAuthConfig(file_get_contents($file)); + } + + /** + * @throws Google_Auth_Exception + * @return array + * @visible For Testing + */ + public function prepareScopes() + { + if (empty($this->requestedScopes)) { + throw new Google_Auth_Exception("No scopes specified"); + } + $scopes = implode(' ', $this->requestedScopes); + return $scopes; + } + + /** + * Set the OAuth 2.0 access token using the string that resulted from calling createAuthUrl() + * or Google_Client#getAccessToken(). + * @param string $accessToken JSON encoded string containing in the following format: + * {"access_token":"TOKEN", "refresh_token":"TOKEN", "token_type":"Bearer", + * "expires_in":3600, "id_token":"TOKEN", "created":1320790426} + */ + public function setAccessToken($accessToken) + { + if ($accessToken == 'null') { + $accessToken = null; + } + $this->getAuth()->setAccessToken($accessToken); + } + + + + /** + * Set the authenticator object + * @param Google_Auth_Abstract $auth + */ + public function setAuth(Google_Auth_Abstract $auth) + { + $this->config->setAuthClass(get_class($auth)); + $this->auth = $auth; + } + + /** + * Set the IO object + * @param Google_IO_Abstract $io + */ + public function setIo(Google_IO_Abstract $io) + { + $this->config->setIoClass(get_class($io)); + $this->io = $io; + } + + /** + * Set the Cache object + * @param Google_Cache_Abstract $cache + */ + public function setCache(Google_Cache_Abstract $cache) + { + $this->config->setCacheClass(get_class($cache)); + $this->cache = $cache; + } + + /** + * Set the Logger object + * @param Google_Logger_Abstract $logger + */ + public function setLogger(Google_Logger_Abstract $logger) + { + $this->config->setLoggerClass(get_class($logger)); + $this->logger = $logger; + } + + /** + * Construct the OAuth 2.0 authorization request URI. + * @return string + */ + public function createAuthUrl() + { + $scopes = $this->prepareScopes(); + return $this->getAuth()->createAuthUrl($scopes); + } + + /** + * Get the OAuth 2.0 access token. + * @return string $accessToken JSON encoded string in the following format: + * {"access_token":"TOKEN", "refresh_token":"TOKEN", "token_type":"Bearer", + * "expires_in":3600,"id_token":"TOKEN", "created":1320790426} + */ + public function getAccessToken() + { + $token = $this->getAuth()->getAccessToken(); + // The response is json encoded, so could be the string null. + // It is arguable whether this check should be here or lower + // in the library. + return (null == $token || 'null' == $token || '[]' == $token) ? null : $token; + } + + /** + * Get the OAuth 2.0 refresh token. + * @return string $refreshToken refresh token or null if not available + */ + public function getRefreshToken() + { + return $this->getAuth()->getRefreshToken(); + } + + /** + * Returns if the access_token is expired. + * @return bool Returns True if the access_token is expired. + */ + public function isAccessTokenExpired() + { + return $this->getAuth()->isAccessTokenExpired(); + } + + /** + * Set OAuth 2.0 "state" parameter to achieve per-request customization. + * @see http://tools.ietf.org/html/draft-ietf-oauth-v2-22#section-3.1.2.2 + * @param string $state + */ + public function setState($state) + { + $this->getAuth()->setState($state); + } + + /** + * @param string $accessType Possible values for access_type include: + * {@code "offline"} to request offline access from the user. + * {@code "online"} to request online access from the user. + */ + public function setAccessType($accessType) + { + $this->config->setAccessType($accessType); + } + + /** + * @param string $approvalPrompt Possible values for approval_prompt include: + * {@code "force"} to force the approval UI to appear. (This is the default value) + * {@code "auto"} to request auto-approval when possible. + */ + public function setApprovalPrompt($approvalPrompt) + { + $this->config->setApprovalPrompt($approvalPrompt); + } + + /** + * Set the login hint, email address or sub id. + * @param string $loginHint + */ + public function setLoginHint($loginHint) + { + $this->config->setLoginHint($loginHint); + } + + /** + * Set the application name, this is included in the User-Agent HTTP header. + * @param string $applicationName + */ + public function setApplicationName($applicationName) + { + $this->config->setApplicationName($applicationName); + } + + /** + * Set the OAuth 2.0 Client ID. + * @param string $clientId + */ + public function setClientId($clientId) + { + $this->config->setClientId($clientId); + } + + /** + * Set the OAuth 2.0 Client Secret. + * @param string $clientSecret + */ + public function setClientSecret($clientSecret) + { + $this->config->setClientSecret($clientSecret); + } + + /** + * Set the OAuth 2.0 Redirect URI. + * @param string $redirectUri + */ + public function setRedirectUri($redirectUri) + { + $this->config->setRedirectUri($redirectUri); + } + + /** + * If 'plus.login' is included in the list of requested scopes, you can use + * this method to define types of app activities that your app will write. + * You can find a list of available types here: + * @link https://developers.google.com/+/api/moment-types + * + * @param array $requestVisibleActions Array of app activity types + */ + public function setRequestVisibleActions($requestVisibleActions) + { + if (is_array($requestVisibleActions)) { + $requestVisibleActions = join(" ", $requestVisibleActions); + } + $this->config->setRequestVisibleActions($requestVisibleActions); + } + + /** + * Set the developer key to use, these are obtained through the API Console. + * @see http://code.google.com/apis/console-help/#generatingdevkeys + * @param string $developerKey + */ + public function setDeveloperKey($developerKey) + { + $this->config->setDeveloperKey($developerKey); + } + + /** + * Set the hd (hosted domain) parameter streamlines the login process for + * Google Apps hosted accounts. By including the domain of the user, you + * restrict sign-in to accounts at that domain. + * @param $hd string - the domain to use. + */ + public function setHostedDomain($hd) + { + $this->config->setHostedDomain($hd); + } + + /** + * Set the prompt hint. Valid values are none, consent and select_account. + * If no value is specified and the user has not previously authorized + * access, then the user is shown a consent screen. + * @param $prompt string + */ + public function setPrompt($prompt) + { + $this->config->setPrompt($prompt); + } + + /** + * openid.realm is a parameter from the OpenID 2.0 protocol, not from OAuth + * 2.0. It is used in OpenID 2.0 requests to signify the URL-space for which + * an authentication request is valid. + * @param $realm string - the URL-space to use. + */ + public function setOpenidRealm($realm) + { + $this->config->setOpenidRealm($realm); + } + + /** + * If this is provided with the value true, and the authorization request is + * granted, the authorization will include any previous authorizations + * granted to this user/application combination for other scopes. + * @param $include boolean - the URL-space to use. + */ + public function setIncludeGrantedScopes($include) + { + $this->config->setIncludeGrantedScopes($include); + } + + /** + * Fetches a fresh OAuth 2.0 access token with the given refresh token. + * @param string $refreshToken + */ + public function refreshToken($refreshToken) + { + $this->getAuth()->refreshToken($refreshToken); + } + + /** + * Revoke an OAuth2 access token or refresh token. This method will revoke the current access + * token, if a token isn't provided. + * @throws Google_Auth_Exception + * @param string|null $token The token (access token or a refresh token) that should be revoked. + * @return boolean Returns True if the revocation was successful, otherwise False. + */ + public function revokeToken($token = null) + { + return $this->getAuth()->revokeToken($token); + } + + /** + * Verify an id_token. This method will verify the current id_token, if one + * isn't provided. + * @throws Google_Auth_Exception + * @param string|null $token The token (id_token) that should be verified. + * @return Google_Auth_LoginTicket Returns an apiLoginTicket if the verification was + * successful. + */ + public function verifyIdToken($token = null) + { + return $this->getAuth()->verifyIdToken($token); + } + + /** + * Verify a JWT that was signed with your own certificates. + * + * @param $id_token string The JWT token + * @param $cert_location array of certificates + * @param $audience string the expected consumer of the token + * @param $issuer string the expected issuer, defaults to Google + * @param [$max_expiry] the max lifetime of a token, defaults to MAX_TOKEN_LIFETIME_SECS + * @return mixed token information if valid, false if not + */ + public function verifySignedJwt($id_token, $cert_location, $audience, $issuer, $max_expiry = null) + { + $auth = new Google_Auth_OAuth2($this); + $certs = $auth->retrieveCertsFromLocation($cert_location); + return $auth->verifySignedJwtWithCerts($id_token, $certs, $audience, $issuer, $max_expiry); + } + + /** + * @param $creds Google_Auth_AssertionCredentials + */ + public function setAssertionCredentials(Google_Auth_AssertionCredentials $creds) + { + $this->getAuth()->setAssertionCredentials($creds); + } + + /** + * Set the scopes to be requested. Must be called before createAuthUrl(). + * Will remove any previously configured scopes. + * @param array $scopes, ie: array('https://www.googleapis.com/auth/plus.login', + * 'https://www.googleapis.com/auth/moderator') + */ + public function setScopes($scopes) + { + $this->requestedScopes = []; + $this->addScope($scopes); + } + + /** + * This functions adds a scope to be requested as part of the OAuth2.0 flow. + * Will append any scopes not previously requested to the scope parameter. + * A single string will be treated as a scope to request. An array of strings + * will each be appended. + * @param $scope_or_scopes string|array e.g. "profile" + */ + public function addScope($scope_or_scopes) + { + if (is_string($scope_or_scopes) && !in_array($scope_or_scopes, $this->requestedScopes)) { + $this->requestedScopes[] = $scope_or_scopes; + } else if (is_array($scope_or_scopes)) { + foreach ($scope_or_scopes as $scope) { + $this->addScope($scope); + } + } + } + + /** + * Returns the list of scopes requested by the client + * @return array the list of scopes + * + */ + public function getScopes() + { + return $this->requestedScopes; + } + + /** + * Declare whether batch calls should be used. This may increase throughput + * by making multiple requests in one connection. + * + * @param boolean $useBatch True if the batch support should + * be enabled. Defaults to False. + */ + public function setUseBatch($useBatch) + { + // This is actually an alias for setDefer. + $this->setDefer($useBatch); + } + + /** + * Declare whether making API calls should make the call immediately, or + * return a request which can be called with ->execute(); + * + * @param boolean $defer True if calls should not be executed right away. + */ + public function setDefer($defer) + { + $this->deferExecution = $defer; + } + + /** + * Helper method to execute deferred HTTP requests. + * + * @param $request Google_Http_Request|Google_Http_Batch + * @throws Google_Exception + * @return object of the type of the expected class or array. + */ + public function execute($request) + { + if ($request instanceof Google_Http_Request) { + $request->setUserAgent( + $this->getApplicationName() + . " " . self::USER_AGENT_SUFFIX + . $this->getLibraryVersion() + ); + if (!$this->getClassConfig("Google_Http_Request", "disable_gzip")) { + $request->enableGzip(); + } + $request->maybeMoveParametersToBody(); + return Google_Http_REST::execute($this, $request); + } else if ($request instanceof Google_Http_Batch) { + return $request->execute(); + } else { + throw new Google_Exception("Do not know how to execute this type of object."); + } + } + + /** + * Whether or not to return raw requests + * @return boolean + */ + public function shouldDefer() + { + return $this->deferExecution; + } + + /** + * @return Google_Auth_Abstract Authentication implementation + */ + public function getAuth() + { + if (!isset($this->auth)) { + $class = $this->config->getAuthClass(); + $this->auth = new $class($this); + } + return $this->auth; + } + + /** + * @return Google_IO_Abstract IO implementation + */ + public function getIo() + { + if (!isset($this->io)) { + $class = $this->config->getIoClass(); + $this->io = new $class($this); + } + return $this->io; + } + + /** + * @return Google_Cache_Abstract Cache implementation + */ + public function getCache() + { + if (!isset($this->cache)) { + $class = $this->config->getCacheClass(); + $this->cache = new $class($this); + } + return $this->cache; + } + + /** + * @return Google_Logger_Abstract Logger implementation + */ + public function getLogger() + { + if (!isset($this->logger)) { + $class = $this->config->getLoggerClass(); + $this->logger = new $class($this); + } + return $this->logger; + } + + /** + * Retrieve custom configuration for a specific class. + * @param $class string|object - class or instance of class to retrieve + * @param $key string optional - key to retrieve + * @return array + */ + public function getClassConfig($class, $key = null) + { + if (!is_string($class)) { + $class = get_class($class); + } + return $this->config->getClassConfig($class, $key); + } + + /** + * Set configuration specific to a given class. + * $config->setClassConfig('Google_Cache_File', + * array('directory' => '/tmp/cache')); + * @param $class string|object - The class name for the configuration + * @param $config string key or an array of configuration values + * @param $value string optional - if $config is a key, the value + * + */ + public function setClassConfig($class, $config, $value = null) + { + if (!is_string($class)) { + $class = get_class($class); + } + $this->config->setClassConfig($class, $config, $value); + + } + + /** + * @return string the base URL to use for calls to the APIs + */ + public function getBasePath() + { + return $this->config->getBasePath(); + } + + /** + * @return string the name of the application + */ + public function getApplicationName() + { + return $this->config->getApplicationName(); + } + + /** + * Are we running in Google AppEngine? + * return bool + */ + public function isAppEngine() + { + return (isset($_SERVER['SERVER_SOFTWARE']) && + strpos($_SERVER['SERVER_SOFTWARE'], 'Google App Engine') !== false); + } +} diff --git a/app/api/Google/Collection.php b/app/api/Google/Collection.php new file mode 100755 index 0000000..8b88ee7 --- /dev/null +++ b/app/api/Google/Collection.php @@ -0,0 +1,123 @@ +modelData[$this->collection_key]) + && is_array($this->modelData[$this->collection_key])) { + reset($this->modelData[$this->collection_key]); + } + } + + /** + * @return mixed + */ + public function current() + { + $this->coerceType($this->key()); + if (is_array($this->modelData[$this->collection_key])) { + return current($this->modelData[$this->collection_key]); + } + + return null; + } + + /** + * @return bool|float|int|string|null + */ + public function key() + { + if (isset($this->modelData[$this->collection_key]) + && is_array($this->modelData[$this->collection_key])) { + return key($this->modelData[$this->collection_key]); + } + + return null; + } + + /** + * @return mixed|void + */ + public function next() + { + return next($this->modelData[$this->collection_key]); + } + + /** + * @return bool + */ + public function valid() + { + $key = $this->key(); + return $key !== null && $key !== false; + } + + /** + * @return int + */ + public function count() + { + if (!isset($this->modelData[$this->collection_key])) { + return 0; + } + return count($this->modelData[$this->collection_key]); + } + + public function offsetExists($offset) + { + if (!is_numeric($offset)) { + return parent::offsetExists($offset); + } + return isset($this->modelData[$this->collection_key][$offset]); + } + + public function offsetGet($offset) + { + if (!is_numeric($offset)) { + return parent::offsetGet($offset); + } + $this->coerceType($offset); + return $this->modelData[$this->collection_key][$offset]; + } + + public function offsetSet($offset, $value) + { + if (!is_numeric($offset)) { + return parent::offsetSet($offset, $value); + } + $this->modelData[$this->collection_key][$offset] = $value; + } + + public function offsetUnset($offset) + { + if (!is_numeric($offset)) { + return parent::offsetUnset($offset); + } + unset($this->modelData[$this->collection_key][$offset]); + } + + private function coerceType($offset) + { + $typeKey = $this->keyType($this->collection_key); + if (isset($this->$typeKey) && !is_object($this->modelData[$this->collection_key][$offset])) { + $type = $this->$typeKey; + $this->modelData[$this->collection_key][$offset] = + new $type($this->modelData[$this->collection_key][$offset]); + } + } +} diff --git a/app/api/Google/Config.php b/app/api/Google/Config.php new file mode 100755 index 0000000..710d580 --- /dev/null +++ b/app/api/Google/Config.php @@ -0,0 +1,456 @@ +configuration = array( + // The application_name is included in the User-Agent HTTP header. + 'application_name' => '', + + // Which Authentication, Storage and HTTP IO classes to use. + 'auth_class' => 'Google_Auth_OAuth2', + 'io_class' => self::USE_AUTO_IO_SELECTION, + 'cache_class' => 'Google_Cache_File', + 'logger_class' => 'Google_Logger_Null', + + // Don't change these unless you're working against a special development + // or testing environment. + 'base_path' => 'https://www.googleapis.com', + + // Definition of class specific values, like file paths and so on. + 'classes' => array( + 'Google_IO_Abstract' => array( + 'request_timeout_seconds' => 100, + ), + 'Google_IO_Curl' => array( + 'disable_proxy_workaround' => false, + 'options' => null, + ), + 'Google_Logger_Abstract' => array( + 'level' => 'debug', + 'log_format' => "[%datetime%] %level%: %message% %context%\n", + 'date_format' => 'd/M/Y:H:i:s O', + 'allow_newlines' => true + ), + 'Google_Logger_File' => array( + 'file' => 'php://stdout', + 'mode' => 0640, + 'lock' => false, + ), + 'Google_Http_Request' => array( + // Disable the use of gzip on calls if set to true. Defaults to false. + 'disable_gzip' => self::GZIP_ENABLED, + + // We default gzip to disabled on uploads even if gzip is otherwise + // enabled, due to some issues seen with small packet sizes for uploads. + // Please test with this option before enabling gzip for uploads in + // a production environment. + 'enable_gzip_for_uploads' => self::GZIP_UPLOADS_DISABLED, + ), + // If you want to pass in OAuth 2.0 settings, they will need to be + // structured like this. + 'Google_Auth_OAuth2' => array( + // Keys for OAuth 2.0 access, see the API console at + // https://developers.google.com/console + 'client_id' => '', + 'client_secret' => '', + 'redirect_uri' => '', + + // Simple API access key, also from the API console. Ensure you get + // a Server key, and not a Browser key. + 'developer_key' => '', + + // Other parameters. + 'hd' => '', + 'prompt' => '', + 'openid.realm' => '', + 'include_granted_scopes' => '', + 'login_hint' => '', + 'request_visible_actions' => '', + 'access_type' => 'online', + 'approval_prompt' => 'auto', + 'federated_signon_certs_url' => + 'https://www.googleapis.com/oauth2/v1/certs', + ), + 'Google_Task_Runner' => array( + // Delays are specified in seconds + 'initial_delay' => 1, + 'max_delay' => 60, + // Base number for exponential backoff + 'factor' => 2, + // A random number between -jitter and jitter will be added to the + // factor on each iteration to allow for better distribution of + // retries. + 'jitter' => .5, + // Maximum number of retries allowed + 'retries' => 0 + ), + 'Google_Service_Exception' => array( + 'retry_map' => array( + '500' => self::TASK_RETRY_ALWAYS, + '503' => self::TASK_RETRY_ALWAYS, + 'rateLimitExceeded' => self::TASK_RETRY_ALWAYS, + 'userRateLimitExceeded' => self::TASK_RETRY_ALWAYS + ) + ), + 'Google_IO_Exception' => array( + 'retry_map' => !extension_loaded('curl') ? array() : array( + CURLE_COULDNT_RESOLVE_HOST => self::TASK_RETRY_ALWAYS, + CURLE_COULDNT_CONNECT => self::TASK_RETRY_ALWAYS, + CURLE_OPERATION_TIMEOUTED => self::TASK_RETRY_ALWAYS, + CURLE_SSL_CONNECT_ERROR => self::TASK_RETRY_ALWAYS, + CURLE_GOT_NOTHING => self::TASK_RETRY_ALWAYS + ) + ), + // Set a default directory for the file cache. + 'Google_Cache_File' => array( + 'directory' => sys_get_temp_dir() . '/Google_Client' + ) + ), + ); + if ($ini_file_location) { + $ini = parse_ini_file($ini_file_location, true); + if (is_array($ini) && count($ini)) { + $merged_configuration = $ini + $this->configuration; + if (isset($ini['classes']) && isset($this->configuration['classes'])) { + $merged_configuration['classes'] = $ini['classes'] + $this->configuration['classes']; + } + $this->configuration = $merged_configuration; + } + } + } + + /** + * Set configuration specific to a given class. + * $config->setClassConfig('Google_Cache_File', + * array('directory' => '/tmp/cache')); + * @param $class string The class name for the configuration + * @param $config string key or an array of configuration values + * @param $value string optional - if $config is a key, the value + */ + public function setClassConfig($class, $config, $value = null) + { + if (!is_array($config)) { + if (!isset($this->configuration['classes'][$class])) { + $this->configuration['classes'][$class] = []; + } + $this->configuration['classes'][$class][$config] = $value; + } else { + $this->configuration['classes'][$class] = $config; + } + } + + public function getClassConfig($class, $key = null) + { + if (!isset($this->configuration['classes'][$class])) { + return null; + } + if ($key === null) { + return $this->configuration['classes'][$class]; + } else { + return $this->configuration['classes'][$class][$key]; + } + } + + /** + * Return the configured cache class. + * @return string + */ + public function getCacheClass() + { + return $this->configuration['cache_class']; + } + + /** + * Return the configured logger class. + * @return string + */ + public function getLoggerClass() + { + return $this->configuration['logger_class']; + } + + /** + * Return the configured Auth class. + * @return string + */ + public function getAuthClass() + { + return $this->configuration['auth_class']; + } + + /** + * Set the auth class. + * + * @param $class string the class name to set + */ + public function setAuthClass($class) + { + $prev = $this->configuration['auth_class']; + if (!isset($this->configuration['classes'][$class]) && + isset($this->configuration['classes'][$prev])) { + $this->configuration['classes'][$class] = + $this->configuration['classes'][$prev]; + } + $this->configuration['auth_class'] = $class; + } + + /** + * Set the IO class. + * + * @param $class string the class name to set + */ + public function setIoClass($class) + { + $prev = $this->configuration['io_class']; + if (!isset($this->configuration['classes'][$class]) && + isset($this->configuration['classes'][$prev])) { + $this->configuration['classes'][$class] = + $this->configuration['classes'][$prev]; + } + $this->configuration['io_class'] = $class; + } + + /** + * Set the cache class. + * + * @param $class string the class name to set + */ + public function setCacheClass($class) + { + $prev = $this->configuration['cache_class']; + if (!isset($this->configuration['classes'][$class]) && + isset($this->configuration['classes'][$prev])) { + $this->configuration['classes'][$class] = + $this->configuration['classes'][$prev]; + } + $this->configuration['cache_class'] = $class; + } + + /** + * Set the logger class. + * + * @param $class string the class name to set + */ + public function setLoggerClass($class) + { + $prev = $this->configuration['logger_class']; + if (!isset($this->configuration['classes'][$class]) && + isset($this->configuration['classes'][$prev])) { + $this->configuration['classes'][$class] = + $this->configuration['classes'][$prev]; + } + $this->configuration['logger_class'] = $class; + } + + /** + * Return the configured IO class. + * + * @return string + */ + public function getIoClass() + { + return $this->configuration['io_class']; + } + + /** + * Set the application name, this is included in the User-Agent HTTP header. + * @param string $name + */ + public function setApplicationName($name) + { + $this->configuration['application_name'] = $name; + } + + /** + * @return string the name of the application + */ + public function getApplicationName() + { + return $this->configuration['application_name']; + } + + /** + * Set the client ID for the auth class. + * @param $clientId string - the API console client ID + */ + public function setClientId($clientId) + { + $this->setAuthConfig('client_id', $clientId); + } + + /** + * Set the client secret for the auth class. + * @param $secret string - the API console client secret + */ + public function setClientSecret($secret) + { + $this->setAuthConfig('client_secret', $secret); + } + + /** + * Set the redirect uri for the auth class. Note that if using the + * Javascript based sign in flow, this should be the string 'postmessage'. + * + * @param $uri string - the URI that users should be redirected to + */ + public function setRedirectUri($uri) + { + $this->setAuthConfig('redirect_uri', $uri); + } + + /** + * Set the app activities for the auth class. + * @param $rva string a space separated list of app activity types + */ + public function setRequestVisibleActions($rva) + { + $this->setAuthConfig('request_visible_actions', $rva); + } + + /** + * Set the the access type requested (offline or online.) + * @param $access string - the access type + */ + public function setAccessType($access) + { + $this->setAuthConfig('access_type', $access); + } + + /** + * Set when to show the approval prompt (auto or force) + * @param $approval string - the approval request + */ + public function setApprovalPrompt($approval) + { + $this->setAuthConfig('approval_prompt', $approval); + } + + /** + * Set the login hint (email address or sub identifier) + * @param $hint string + */ + public function setLoginHint($hint) + { + $this->setAuthConfig('login_hint', $hint); + } + + /** + * Set the developer key for the auth class. Note that this is separate value + * from the client ID - if it looks like a URL, its a client ID! + * @param $key string - the API console developer key + */ + public function setDeveloperKey($key) + { + $this->setAuthConfig('developer_key', $key); + } + + /** + * Set the hd (hosted domain) parameter streamlines the login process for + * Google Apps hosted accounts. By including the domain of the user, you + * restrict sign-in to accounts at that domain. + * + * This should not be used to ensure security on your application - check + * the hd values within an id token (@see Google_Auth_LoginTicket) after sign + * in to ensure that the user is from the domain you were expecting. + * + * @param $hd string - the domain to use. + */ + public function setHostedDomain($hd) + { + $this->setAuthConfig('hd', $hd); + } + + /** + * Set the prompt hint. Valid values are none, consent and select_account. + * If no value is specified and the user has not previously authorized + * access, then the user is shown a consent screen. + * @param $prompt string + */ + public function setPrompt($prompt) + { + $this->setAuthConfig('prompt', $prompt); + } + + /** + * openid.realm is a parameter from the OpenID 2.0 protocol, not from OAuth + * 2.0. It is used in OpenID 2.0 requests to signify the URL-space for which + * an authentication request is valid. + * @param $realm string - the URL-space to use. + */ + public function setOpenidRealm($realm) + { + $this->setAuthConfig('openid.realm', $realm); + } + + /** + * If this is provided with the value true, and the authorization request is + * granted, the authorization will include any previous authorizations + * granted to this user/application combination for other scopes. + * @param $include boolean - the URL-space to use. + */ + public function setIncludeGrantedScopes($include) + { + $this->setAuthConfig( + 'include_granted_scopes', + $include ? "true" : "false" + ); + } + + /** + * @return string the base URL to use for API calls + */ + public function getBasePath() + { + return $this->configuration['base_path']; + } + + /** + * Set the auth configuration for the current auth class. + * @param $key - the key to set + * @param $value - the parameter value + */ + private function setAuthConfig($key, $value) + { + if (!isset($this->configuration['classes'][$this->getAuthClass()])) { + $this->configuration['classes'][$this->getAuthClass()] = []; + } + $this->configuration['classes'][$this->getAuthClass()][$key] = $value; + } +} diff --git a/app/api/Google/Exception.php b/app/api/Google/Exception.php new file mode 100755 index 0000000..9629818 --- /dev/null +++ b/app/api/Google/Exception.php @@ -0,0 +1,20 @@ +client = $client; + $this->root_url = rtrim($rootUrl ? $rootUrl : $this->client->getBasePath(), '/'); + $this->batch_path = $batchPath ? $batchPath : 'batch'; + $this->expected_classes = []; + $boundary = (false == $boundary) ? mt_rand() : $boundary; + $this->boundary = str_replace('"', '', $boundary); + } + + public function add(Google_Http_Request $request, $key = false) + { + if (false == $key) { + $key = mt_rand(); + } + + $this->requests[$key] = $request; + } + + public function execute() + { + $body = ''; + + /** @var Google_Http_Request $req */ + foreach ($this->requests as $key => $req) { + $body .= "--{$this->boundary}\n"; + $body .= $req->toBatchString($key) . "\n\n"; + $this->expected_classes["response-" . $key] = $req->getExpectedClass(); + } + + $body .= "--{$this->boundary}--"; + + $url = $this->root_url . '/' . $this->batch_path; + $httpRequest = new Google_Http_Request($url, 'POST'); + $httpRequest->setRequestHeaders( + array('Content-Type' => 'multipart/mixed; boundary=' . $this->boundary) + ); + + $httpRequest->setPostBody($body); + $response = $this->client->getIo()->makeRequest($httpRequest); + + return $this->parseResponse($response); + } + + public function parseResponse(Google_Http_Request $response) + { + $contentType = $response->getResponseHeader('content-type'); + $contentType = explode(';', $contentType); + $boundary = false; + foreach ($contentType as $part) { + $part = (explode('=', $part, 2)); + if (isset($part[0]) && 'boundary' == trim($part[0])) { + $boundary = $part[1]; + } + } + + $body = $response->getResponseBody(); + if ($body) { + $body = str_replace("--$boundary--", "--$boundary", $body); + $parts = explode("--$boundary", $body); + $responses = []; + + foreach ($parts as $part) { + $part = trim($part); + if (!empty($part)) { + list($metaHeaders, $part) = explode("\r\n\r\n", $part, 2); + $metaHeaders = $this->client->getIo()->getHttpResponseHeaders($metaHeaders); + + $status = substr($part, 0, strpos($part, "\n")); + $status = explode(" ", $status); + $status = $status[1]; + + list($partHeaders, $partBody) = $this->client->getIo()->ParseHttpResponse($part, false); + $response = new Google_Http_Request(""); + $response->setResponseHttpCode($status); + $response->setResponseHeaders($partHeaders); + $response->setResponseBody($partBody); + + // Need content id. + $key = $metaHeaders['content-id']; + + if (isset($this->expected_classes[$key]) && + strlen($this->expected_classes[$key]) > 0) { + $class = $this->expected_classes[$key]; + $response->setExpectedClass($class); + } + + try { + $response = Google_Http_REST::decodeHttpResponse($response, $this->client); + $responses[$key] = $response; + } catch (Google_Service_Exception $e) { + // Store the exception as the response, so successful responses + // can be processed. + $responses[$key] = $e; + } + } + } + + return $responses; + } + + return null; + } +} diff --git a/app/api/Google/Http/CacheParser.php b/app/api/Google/Http/CacheParser.php new file mode 100755 index 0000000..5f9b4f7 --- /dev/null +++ b/app/api/Google/Http/CacheParser.php @@ -0,0 +1,185 @@ +getRequestMethod(); + if (! in_array($method, self::$CACHEABLE_HTTP_METHODS)) { + return false; + } + + // Don't cache authorized requests/responses. + // [rfc2616-14.8] When a shared cache receives a request containing an + // Authorization field, it MUST NOT return the corresponding response + // as a reply to any other request... + if ($resp->getRequestHeader("authorization")) { + return false; + } + + return true; + } + + /** + * Check if an HTTP response can be cached by a private local cache. + * + * @static + * @param Google_Http_Request $resp + * @return bool True if the response is cacheable. + * False if the response is un-cacheable. + */ + public static function isResponseCacheable(Google_Http_Request $resp) + { + // First, check if the HTTP request was cacheable before inspecting the + // HTTP response. + if (false == self::isRequestCacheable($resp)) { + return false; + } + + $code = $resp->getResponseHttpCode(); + if (! in_array($code, self::$CACHEABLE_STATUS_CODES)) { + return false; + } + + // The resource is uncacheable if the resource is already expired and + // the resource doesn't have an ETag for revalidation. + $etag = $resp->getResponseHeader("etag"); + if (self::isExpired($resp) && $etag == false) { + return false; + } + + // [rfc2616-14.9.2] If [no-store is] sent in a response, a cache MUST NOT + // store any part of either this response or the request that elicited it. + $cacheControl = $resp->getParsedCacheControl(); + if (isset($cacheControl['no-store'])) { + return false; + } + + // Pragma: no-cache is an http request directive, but is occasionally + // used as a response header incorrectly. + $pragma = $resp->getResponseHeader('pragma'); + if ($pragma == 'no-cache' || strpos($pragma, 'no-cache') !== false) { + return false; + } + + // [rfc2616-14.44] Vary: * is extremely difficult to cache. "It implies that + // a cache cannot determine from the request headers of a subsequent request + // whether this response is the appropriate representation." + // Given this, we deem responses with the Vary header as uncacheable. + $vary = $resp->getResponseHeader('vary'); + if ($vary) { + return false; + } + + return true; + } + + /** + * @static + * @param Google_Http_Request $resp + * @return bool True if the HTTP response is considered to be expired. + * False if it is considered to be fresh. + */ + public static function isExpired(Google_Http_Request $resp) + { + // HTTP/1.1 clients and caches MUST treat other invalid date formats, + // especially including the value “0”, as in the past. + $parsedExpires = false; + $responseHeaders = $resp->getResponseHeaders(); + + if (isset($responseHeaders['expires'])) { + $rawExpires = $responseHeaders['expires']; + // Check for a malformed expires header first. + if (empty($rawExpires) || (is_numeric($rawExpires) && $rawExpires <= 0)) { + return true; + } + + // See if we can parse the expires header. + $parsedExpires = strtotime($rawExpires); + if (false == $parsedExpires || $parsedExpires <= 0) { + return true; + } + } + + // Calculate the freshness of an http response. + $freshnessLifetime = false; + $cacheControl = $resp->getParsedCacheControl(); + if (isset($cacheControl['max-age'])) { + $freshnessLifetime = $cacheControl['max-age']; + } + + $rawDate = $resp->getResponseHeader('date'); + $parsedDate = strtotime($rawDate); + + if (empty($rawDate) || false == $parsedDate) { + // We can't default this to now, as that means future cache reads + // will always pass with the logic below, so we will require a + // date be injected if not supplied. + throw new Google_Exception("All cacheable requests must have creation dates."); + } + + if (false == $freshnessLifetime && isset($responseHeaders['expires'])) { + $freshnessLifetime = $parsedExpires - $parsedDate; + } + + if (false == $freshnessLifetime) { + return true; + } + + // Calculate the age of an http response. + $age = max(0, time() - $parsedDate); + if (isset($responseHeaders['age'])) { + $age = max($age, strtotime($responseHeaders['age'])); + } + + return $freshnessLifetime <= $age; + } + + /** + * Determine if a cache entry should be revalidated with by the origin. + * + * @param Google_Http_Request $response + * @return bool True if the entry is expired, else return false. + */ + public static function mustRevalidate(Google_Http_Request $response) + { + // [13.3] When a cache has a stale entry that it would like to use as a + // response to a client's request, it first has to check with the origin + // server to see if its cached entry is still usable. + return self::isExpired($response); + } +} diff --git a/app/api/Google/Http/MediaFileUpload.php b/app/api/Google/Http/MediaFileUpload.php new file mode 100755 index 0000000..b625dd0 --- /dev/null +++ b/app/api/Google/Http/MediaFileUpload.php @@ -0,0 +1,341 @@ +client = $client; + $this->request = $request; + $this->mimeType = $mimeType; + $this->data = $data; + $this->size = strlen($this->data); + $this->resumable = $resumable; + if (!$chunkSize) { + $chunkSize = 256 * 1024; + } + $this->chunkSize = $chunkSize; + $this->progress = 0; + $this->boundary = $boundary; + + // Process Media Request + $this->process(); + } + + /** + * Set the size of the file that is being uploaded. + * @param $size - int file size in bytes + */ + public function setFileSize($size) + { + $this->size = $size; + } + + /** + * Return the progress on the upload + * @return int progress in bytes uploaded. + */ + public function getProgress() + { + return $this->progress; + } + + /** + * Return the HTTP result code from the last call made. + * @return int code + */ + public function getHttpResultCode() + { + return $this->httpResultCode; + } + + /** + * Sends a PUT-Request to google drive and parses the response, + * setting the appropiate variables from the response() + * + * @param Google_Http_Request $httpRequest the Reuqest which will be send + * + * @return false|mixed false when the upload is unfinished or the decoded http response + * + */ + private function makePutRequest(Google_Http_Request $httpRequest) + { + if ($this->client->getClassConfig("Google_Http_Request", "enable_gzip_for_uploads")) { + $httpRequest->enableGzip(); + } else { + $httpRequest->disableGzip(); + } + + $response = $this->client->getIo()->makeRequest($httpRequest); + $response->setExpectedClass($this->request->getExpectedClass()); + $code = $response->getResponseHttpCode(); + $this->httpResultCode = $code; + + if (308 == $code) { + // Track the amount uploaded. + $range = explode('-', $response->getResponseHeader('range')); + $this->progress = $range[1] + 1; + + // Allow for changing upload URLs. + $location = $response->getResponseHeader('location'); + if ($location) { + $this->resumeUri = $location; + } + + // No problems, but upload not complete. + return false; + } else { + return Google_Http_REST::decodeHttpResponse($response, $this->client); + } + } + + /** + * Send the next part of the file to upload. + * @param [$chunk] the next set of bytes to send. If false will used $data passed + * at construct time. + */ + public function nextChunk($chunk = false) + { + if (false == $this->resumeUri) { + $this->resumeUri = $this->fetchResumeUri(); + } + + if (false == $chunk) { + $chunk = substr($this->data, $this->progress, $this->chunkSize); + } + $lastBytePos = $this->progress + strlen($chunk) - 1; + $headers = array( + 'content-range' => "bytes $this->progress-$lastBytePos/$this->size", + 'content-type' => $this->request->getRequestHeader('content-type'), + 'content-length' => $this->chunkSize, + 'expect' => '', + ); + + $httpRequest = new Google_Http_Request( + $this->resumeUri, + 'PUT', + $headers, + $chunk + ); + return $this->makePutRequest($httpRequest); + } + + /** + * Resume a previously unfinished upload + * @param $resumeUri the resume-URI of the unfinished, resumable upload. + */ + public function resume($resumeUri) + { + $this->resumeUri = $resumeUri; + $headers = array( + 'content-range' => "bytes */$this->size", + 'content-length' => 0, + ); + $httpRequest = new Google_Http_Request( + $this->resumeUri, + 'PUT', + $headers + ); + return $this->makePutRequest($httpRequest); + } + + /** + * @return array|bool + * @visible for testing + */ + private function process() + { + $postBody = false; + $contentType = false; + + $meta = $this->request->getPostBody(); + $meta = is_string($meta) ? json_decode($meta, true) : $meta; + + $uploadType = $this->getUploadType($meta); + $this->request->setQueryParam('uploadType', $uploadType); + $this->transformToUploadUrl(); + $mimeType = $this->mimeType ? + $this->mimeType : + $this->request->getRequestHeader('content-type'); + + if (self::UPLOAD_RESUMABLE_TYPE == $uploadType) { + $contentType = $mimeType; + $postBody = is_string($meta) ? $meta : json_encode($meta); + } else if (self::UPLOAD_MEDIA_TYPE == $uploadType) { + $contentType = $mimeType; + $postBody = $this->data; + } else if (self::UPLOAD_MULTIPART_TYPE == $uploadType) { + // This is a multipart/related upload. + $boundary = $this->boundary ? $this->boundary : mt_rand(); + $boundary = str_replace('"', '', $boundary); + $contentType = 'multipart/related; boundary=' . $boundary; + $related = "--$boundary\r\n"; + $related .= "Content-Type: application/json; charset=UTF-8\r\n"; + $related .= "\r\n" . json_encode($meta) . "\r\n"; + $related .= "--$boundary\r\n"; + $related .= "Content-Type: $mimeType\r\n"; + $related .= "Content-Transfer-Encoding: base64\r\n"; + $related .= "\r\n" . base64_encode($this->data) . "\r\n"; + $related .= "--$boundary--"; + $postBody = $related; + } + + $this->request->setPostBody($postBody); + + if (isset($contentType) && $contentType) { + $contentTypeHeader['content-type'] = $contentType; + $this->request->setRequestHeaders($contentTypeHeader); + } + } + + private function transformToUploadUrl() + { + $base = $this->request->getBaseComponent(); + $this->request->setBaseComponent($base . '/upload'); + } + + /** + * Valid upload types: + * - resumable (UPLOAD_RESUMABLE_TYPE) + * - media (UPLOAD_MEDIA_TYPE) + * - multipart (UPLOAD_MULTIPART_TYPE) + * @param $meta + * @return string + * @visible for testing + */ + public function getUploadType($meta) + { + if ($this->resumable) { + return self::UPLOAD_RESUMABLE_TYPE; + } + + if (false == $meta && $this->data) { + return self::UPLOAD_MEDIA_TYPE; + } + + return self::UPLOAD_MULTIPART_TYPE; + } + + public function getResumeUri() + { + return ( $this->resumeUri !== null ? $this->resumeUri : $this->fetchResumeUri() ); + } + + private function fetchResumeUri() + { + $result = null; + $body = $this->request->getPostBody(); + if ($body) { + $headers = array( + 'content-type' => 'application/json; charset=UTF-8', + 'content-length' => Google_Utils::getStrLen($body), + 'x-upload-content-type' => $this->mimeType, + 'x-upload-content-length' => $this->size, + 'expect' => '', + ); + $this->request->setRequestHeaders($headers); + } + + $response = $this->client->getIo()->makeRequest($this->request); + $location = $response->getResponseHeader('location'); + $code = $response->getResponseHttpCode(); + + if (200 == $code && true == $location) { + return $location; + } + $message = $code; + $body = @json_decode($response->getResponseBody()); + if (!empty($body->error->errors) ) { + $message .= ': '; + foreach ($body->error->errors as $error) { + $message .= "{$error->domain}, {$error->message};"; + } + $message = rtrim($message, ';'); + } + + $error = "Failed to start the resumable upload (HTTP {$message})"; + $this->client->getLogger()->error($error); + throw new Google_Exception($error); + } + + public function setChunkSize($chunkSize) + { + $this->chunkSize = $chunkSize; + } +} diff --git a/app/api/Google/Http/REST.php b/app/api/Google/Http/REST.php new file mode 100755 index 0000000..eb788ad --- /dev/null +++ b/app/api/Google/Http/REST.php @@ -0,0 +1,178 @@ +getRequestMethod(), $req->getUrl()), + array(get_class(), 'doExecute'), + array($client, $req) + ); + + return $runner->run(); + } + + /** + * Executes a Google_Http_Request + * + * @param Google_Client $client + * @param Google_Http_Request $req + * @return array decoded result + * @throws Google_Service_Exception on server side error (ie: not authenticated, + * invalid or malformed post body, invalid url) + */ + public static function doExecute(Google_Client $client, Google_Http_Request $req) + { + $httpRequest = $client->getIo()->makeRequest($req); + $httpRequest->setExpectedClass($req->getExpectedClass()); + return self::decodeHttpResponse($httpRequest, $client); + } + + /** + * Decode an HTTP Response. + * @static + * @throws Google_Service_Exception + * @param Google_Http_Request $response The http response to be decoded. + * @param Google_Client $client + * @return mixed|null + */ + public static function decodeHttpResponse($response, Google_Client $client = null) + { + $code = $response->getResponseHttpCode(); + $body = $response->getResponseBody(); + $decoded = null; + + if ((intVal($code)) >= 300) { + $decoded = json_decode($body, true); + $err = 'Error calling ' . $response->getRequestMethod() . ' ' . $response->getUrl(); + if (isset($decoded['error']) && + isset($decoded['error']['message']) && + isset($decoded['error']['code'])) { + // if we're getting a json encoded error definition, use that instead of the raw response + // body for improved readability + $err .= ": ({$decoded['error']['code']}) {$decoded['error']['message']}"; + } else { + $err .= ": ($code) $body"; + } + + $errors = null; + // Specific check for APIs which don't return error details, such as Blogger. + if (isset($decoded['error']) && isset($decoded['error']['errors'])) { + $errors = $decoded['error']['errors']; + } + + $map = null; + if ($client) { + $client->getLogger()->error( + $err, + array('code' => $code, 'errors' => $errors) + ); + + $map = $client->getClassConfig( + 'Google_Service_Exception', + 'retry_map' + ); + } + throw new Google_Service_Exception($err, $code, null, $errors, $map); + } + + // Only attempt to decode the response, if the response code wasn't (204) 'no content' + if ($code != '204') { + if ($response->getExpectedRaw()) { + return $body; + } + + $decoded = json_decode($body, true); + if ($decoded === null || $decoded === "") { + $error = "Invalid json in service response: $body"; + if ($client) { + $client->getLogger()->error($error); + } + throw new Google_Service_Exception($error); + } + + if ($response->getExpectedClass()) { + $class = $response->getExpectedClass(); + $decoded = new $class($decoded); + } + } + return $decoded; + } + + /** + * Parse/expand request parameters and create a fully qualified + * request uri. + * @static + * @param string $servicePath + * @param string $restPath + * @param array $params + * @return string $requestUrl + */ + public static function createRequestUri($servicePath, $restPath, $params) + { + $requestUrl = $servicePath . $restPath; + $uriTemplateVars = []; + $queryVars = []; + foreach ($params as $paramName => $paramSpec) { + if ($paramSpec['type'] == 'boolean') { + $paramSpec['value'] = ($paramSpec['value']) ? 'true' : 'false'; + } + if ($paramSpec['location'] == 'path') { + $uriTemplateVars[$paramName] = $paramSpec['value']; + } else if ($paramSpec['location'] == 'query') { + if (isset($paramSpec['repeated']) && is_array($paramSpec['value'])) { + foreach ($paramSpec['value'] as $value) { + $queryVars[] = $paramName . '=' . rawurlencode(rawurldecode($value)); + } + } else { + $queryVars[] = $paramName . '=' . rawurlencode(rawurldecode($paramSpec['value'])); + } + } + } + + if (count($uriTemplateVars)) { + $uriTemplateParser = new Google_Utils_URITemplate(); + $requestUrl = $uriTemplateParser->parse($requestUrl, $uriTemplateVars); + } + + if (count($queryVars)) { + $requestUrl .= '?' . implode('&', $queryVars); + } + + return $requestUrl; + } +} diff --git a/app/api/Google/Http/Request.php b/app/api/Google/Http/Request.php new file mode 100755 index 0000000..b675b3e --- /dev/null +++ b/app/api/Google/Http/Request.php @@ -0,0 +1,504 @@ + + * @author Chirag Shah + * + */ +class Google_Http_Request +{ + const GZIP_UA = " (gzip)"; + + private $batchHeaders = array( + 'Content-Type' => 'application/http', + 'Content-Transfer-Encoding' => 'binary', + 'MIME-Version' => '1.0', + ); + + protected $queryParams; + protected $requestMethod; + protected $requestHeaders; + protected $baseComponent = null; + protected $path; + protected $postBody; + protected $userAgent = ''; + protected $canGzip = null; + + protected $responseHttpCode; + protected $responseHeaders; + protected $responseBody; + + protected $expectedClass; + protected $expectedRaw = false; + + public $accessKey; + + public function __construct( + $url, + $method = 'GET', + $headers = array(), + $postBody = null + ) { + $this->setUrl($url); + $this->setRequestMethod($method); + $this->setRequestHeaders($headers); + $this->setPostBody($postBody); + } + + /** + * Misc function that returns the base url component of the $url + * used by the OAuth signing class to calculate the base string + * @return string The base url component of the $url. + */ + public function getBaseComponent() + { + return $this->baseComponent; + } + + /** + * Set the base URL that path and query parameters will be added to. + * @param $baseComponent string + */ + public function setBaseComponent($baseComponent) + { + $this->baseComponent = rtrim($baseComponent, '/'); + } + + /** + * Enable support for gzipped responses with this request. + */ + public function enableGzip() + { + $this->setRequestHeaders(array("Accept-Encoding" => "gzip")); + $this->canGzip = true; + $this->setUserAgent($this->userAgent); + } + + /** + * Disable support for gzip responses with this request. + */ + public function disableGzip() + { + if ( + isset($this->requestHeaders['accept-encoding']) && + $this->requestHeaders['accept-encoding'] == "gzip" + ) { + unset($this->requestHeaders['accept-encoding']); + } + $this->canGzip = false; + $this->userAgent = str_replace(self::GZIP_UA, "", $this->userAgent); + } + + /** + * Can this request accept a gzip response? + * @return bool + */ + public function canGzip() + { + return $this->canGzip; + } + + /** + * Misc function that returns an array of the query parameters of the current + * url used by the OAuth signing class to calculate the signature + * @return array Query parameters in the query string. + */ + public function getQueryParams() + { + return $this->queryParams; + } + + /** + * Set a new query parameter. + * @param $key - string to set, does not need to be URL encoded + * @param $value - string to set, does not need to be URL encoded + */ + public function setQueryParam($key, $value) + { + $this->queryParams[$key] = $value; + } + + /** + * @return string HTTP Response Code. + */ + public function getResponseHttpCode() + { + return (int) $this->responseHttpCode; + } + + /** + * @param int $responseHttpCode HTTP Response Code. + */ + public function setResponseHttpCode($responseHttpCode) + { + $this->responseHttpCode = $responseHttpCode; + } + + /** + * @return $responseHeaders (array) HTTP Response Headers. + */ + public function getResponseHeaders() + { + return $this->responseHeaders; + } + + /** + * @return string HTTP Response Body + */ + public function getResponseBody() + { + return $this->responseBody; + } + + /** + * Set the class the response to this request should expect. + * + * @param $class string the class name + */ + public function setExpectedClass($class) + { + $this->expectedClass = $class; + } + + /** + * Retrieve the expected class the response should expect. + * @return string class name + */ + public function getExpectedClass() + { + return $this->expectedClass; + } + + /** + * Enable expected raw response + */ + public function enableExpectedRaw() + { + $this->expectedRaw = true; + } + + /** + * Disable expected raw response + */ + public function disableExpectedRaw() + { + $this->expectedRaw = false; + } + + /** + * Expected raw response or not. + * @return boolean expected raw response + */ + public function getExpectedRaw() + { + return $this->expectedRaw; + } + + /** + * @param array $headers The HTTP response headers + * to be normalized. + */ + public function setResponseHeaders($headers) + { + $headers = Google_Utils::normalize($headers); + if ($this->responseHeaders) { + $headers = array_merge($this->responseHeaders, $headers); + } + + $this->responseHeaders = $headers; + } + + /** + * @param string $key + * @return array|boolean Returns the requested HTTP header or + * false if unavailable. + */ + public function getResponseHeader($key) + { + return isset($this->responseHeaders[$key]) + ? $this->responseHeaders[$key] + : false; + } + + /** + * @param string $responseBody The HTTP response body. + */ + public function setResponseBody($responseBody) + { + $this->responseBody = $responseBody; + } + + /** + * @return string $url The request URL. + */ + public function getUrl() + { + return $this->baseComponent . $this->path . + (count($this->queryParams) ? + "?" . $this->buildQuery($this->queryParams) : + ''); + } + + /** + * @return string $method HTTP Request Method. + */ + public function getRequestMethod() + { + return $this->requestMethod; + } + + /** + * @return array $headers HTTP Request Headers. + */ + public function getRequestHeaders() + { + return $this->requestHeaders; + } + + /** + * @param string $key + * @return array|boolean Returns the requested HTTP header or + * false if unavailable. + */ + public function getRequestHeader($key) + { + return isset($this->requestHeaders[$key]) + ? $this->requestHeaders[$key] + : false; + } + + /** + * @return string $postBody HTTP Request Body. + */ + public function getPostBody() + { + return $this->postBody; + } + + /** + * @param string $url the url to set + */ + public function setUrl($url) + { + if (substr($url, 0, 4) != 'http') { + // Force the path become relative. + if (substr($url, 0, 1) !== '/') { + $url = '/' . $url; + } + } + $parts = parse_url($url); + if (isset($parts['host'])) { + $this->baseComponent = sprintf( + "%s%s%s", + isset($parts['scheme']) ? $parts['scheme'] . "://" : '', + isset($parts['host']) ? $parts['host'] : '', + isset($parts['port']) ? ":" . $parts['port'] : '' + ); + } + $this->path = isset($parts['path']) ? $parts['path'] : ''; + $this->queryParams = []; + if (isset($parts['query'])) { + $this->queryParams = $this->parseQuery($parts['query']); + } + } + + /** + * @param string $method Set he HTTP Method and normalize + * it to upper-case, as required by HTTP. + * + */ + public function setRequestMethod($method) + { + $this->requestMethod = strtoupper($method); + } + + /** + * @param array $headers The HTTP request headers + * to be set and normalized. + */ + public function setRequestHeaders($headers) + { + $headers = Google_Utils::normalize($headers); + if ($this->requestHeaders) { + $headers = array_merge($this->requestHeaders, $headers); + } + $this->requestHeaders = $headers; + } + + /** + * @param string $postBody the postBody to set + */ + public function setPostBody($postBody) + { + $this->postBody = $postBody; + } + + /** + * Set the User-Agent Header. + * @param string $userAgent The User-Agent. + */ + public function setUserAgent($userAgent) + { + $this->userAgent = $userAgent; + if ($this->canGzip) { + $this->userAgent = $userAgent . self::GZIP_UA; + } + } + + /** + * @return string The User-Agent. + */ + public function getUserAgent() + { + return $this->userAgent; + } + + /** + * Returns a cache key depending on if this was an OAuth signed request + * in which case it will use the non-signed url and access key to make this + * cache key unique per authenticated user, else use the plain request url + * @return string The md5 hash of the request cache key. + */ + public function getCacheKey() + { + $key = $this->getUrl(); + + if (isset($this->accessKey)) { + $key .= $this->accessKey; + } + + if (isset($this->requestHeaders['authorization'])) { + $key .= $this->requestHeaders['authorization']; + } + + return md5($key); + } + + public function getParsedCacheControl() + { + $parsed = []; + $rawCacheControl = $this->getResponseHeader('cache-control'); + if ($rawCacheControl) { + $rawCacheControl = str_replace(', ', '&', $rawCacheControl); + parse_str($rawCacheControl, $parsed); + } + + return $parsed; + } + + /** + * @param string $id + * @return string A string representation of the HTTP Request. + */ + public function toBatchString($id) + { + $str = ''; + $path = parse_url($this->getUrl(), PHP_URL_PATH) . "?" . + http_build_query($this->queryParams); + $str .= $this->getRequestMethod() . ' ' . $path . " HTTP/1.1\n"; + + foreach ($this->getRequestHeaders() as $key => $val) { + $str .= $key . ': ' . $val . "\n"; + } + + if ($this->getPostBody()) { + $str .= "\n"; + $str .= $this->getPostBody(); + } + + $headers = ''; + foreach ($this->batchHeaders as $key => $val) { + $headers .= $key . ': ' . $val . "\n"; + } + + $headers .= "Content-ID: $id\n"; + $str = $headers . "\n" . $str; + + return $str; + } + + /** + * Our own version of parse_str that allows for multiple variables + * with the same name. + * @param $string - the query string to parse + */ + private function parseQuery($string) + { + $return = []; + $parts = explode("&", $string); + foreach ($parts as $part) { + list($key, $value) = explode('=', $part, 2); + $value = urldecode($value); + if (isset($return[$key])) { + if (!is_array($return[$key])) { + $return[$key] = array($return[$key]); + } + $return[$key][] = $value; + } else { + $return[$key] = $value; + } + } + return $return; + } + + /** + * A version of build query that allows for multiple + * duplicate keys. + * @param $parts array of key value pairs + */ + private function buildQuery($parts) + { + $return = []; + foreach ($parts as $key => $value) { + if (is_array($value)) { + foreach ($value as $v) { + $return[] = urlencode($key) . "=" . urlencode($v); + } + } else { + $return[] = urlencode($key) . "=" . urlencode($value); + } + } + return implode('&', $return); + } + + /** + * If we're POSTing and have no body to send, we can send the query + * parameters in there, which avoids length issues with longer query + * params. + */ + public function maybeMoveParametersToBody() + { + if ($this->getRequestMethod() == "POST" && empty($this->postBody)) { + $this->setRequestHeaders( + array( + "content-type" => + "application/x-www-form-urlencoded; charset=UTF-8" + ) + ); + $this->setPostBody($this->buildQuery($this->queryParams)); + $this->queryParams = []; + } + } +} diff --git a/app/api/Google/IO/Abstract.php b/app/api/Google/IO/Abstract.php new file mode 100755 index 0000000..bf23b40 --- /dev/null +++ b/app/api/Google/IO/Abstract.php @@ -0,0 +1,339 @@ + null, "PUT" => null); + private static $HOP_BY_HOP = array( + 'connection' => true, + 'keep-alive' => true, + 'proxy-authenticate' => true, + 'proxy-authorization' => true, + 'te' => true, + 'trailers' => true, + 'transfer-encoding' => true, + 'upgrade' => true + ); + + + /** @var Google_Client */ + protected $client; + + public function __construct(Google_Client $client) + { + $this->client = $client; + $timeout = $client->getClassConfig('Google_IO_Abstract', 'request_timeout_seconds'); + if ($timeout > 0) { + $this->setTimeout($timeout); + } + } + + /** + * Executes a Google_Http_Request + * @param Google_Http_Request $request the http request to be executed + * @return array containing response headers, body, and http code + * @throws Google_IO_Exception on curl or IO error + */ + abstract public function executeRequest(Google_Http_Request $request); + + /** + * Set options that update the transport implementation's behavior. + * @param $options + */ + abstract public function setOptions($options); + + /** + * Set the maximum request time in seconds. + * @param $timeout in seconds + */ + abstract public function setTimeout($timeout); + + /** + * Get the maximum request time in seconds. + * @return timeout in seconds + */ + abstract public function getTimeout(); + + /** + * Test for the presence of a cURL header processing bug + * + * The cURL bug was present in versions prior to 7.30.0 and caused the header + * length to be miscalculated when a "Connection established" header added by + * some proxies was present. + * + * @return boolean + */ + abstract protected function needsQuirk(); + + /** + * @visible for testing. + * Cache the response to an HTTP request if it is cacheable. + * @param Google_Http_Request $request + * @return bool Returns true if the insertion was successful. + * Otherwise, return false. + */ + public function setCachedRequest(Google_Http_Request $request) + { + // Determine if the request is cacheable. + if (Google_Http_CacheParser::isResponseCacheable($request)) { + $this->client->getCache()->set($request->getCacheKey(), $request); + return true; + } + + return false; + } + + /** + * Execute an HTTP Request + * + * @param Google_Http_Request $request the http request to be executed + * @return Google_Http_Request http request with the response http code, + * response headers and response body filled in + * @throws Google_IO_Exception on curl or IO error + */ + public function makeRequest(Google_Http_Request $request) + { + // First, check to see if we have a valid cached version. + $cached = $this->getCachedRequest($request); + if ($cached !== false && $cached instanceof Google_Http_Request) { + if (!$this->checkMustRevalidateCachedRequest($cached, $request)) { + return $cached; + } + } + + if (array_key_exists($request->getRequestMethod(), self::$ENTITY_HTTP_METHODS)) { + $request = $this->processEntityRequest($request); + } + + list($responseData, $responseHeaders, $respHttpCode) = $this->executeRequest($request); + + if ($respHttpCode == 304 && $cached) { + // If the server responded NOT_MODIFIED, return the cached request. + $this->updateCachedRequest($cached, $responseHeaders); + return $cached; + } + + if (!isset($responseHeaders['Date']) && !isset($responseHeaders['date'])) { + $responseHeaders['date'] = date("r"); + } + + $request->setResponseHttpCode($respHttpCode); + $request->setResponseHeaders($responseHeaders); + $request->setResponseBody($responseData); + // Store the request in cache (the function checks to see if the request + // can actually be cached) + $this->setCachedRequest($request); + return $request; + } + + /** + * @visible for testing. + * @param Google_Http_Request $request + * @return Google_Http_Request|bool Returns the cached object or + * false if the operation was unsuccessful. + */ + public function getCachedRequest(Google_Http_Request $request) + { + if (false === Google_Http_CacheParser::isRequestCacheable($request)) { + return false; + } + + return $this->client->getCache()->get($request->getCacheKey()); + } + + /** + * @visible for testing + * Process an http request that contains an enclosed entity. + * @param Google_Http_Request $request + * @return Google_Http_Request Processed request with the enclosed entity. + */ + public function processEntityRequest(Google_Http_Request $request) + { + $postBody = $request->getPostBody(); + $contentType = $request->getRequestHeader("content-type"); + + // Set the default content-type as application/x-www-form-urlencoded. + if (false == $contentType) { + $contentType = self::FORM_URLENCODED; + $request->setRequestHeaders(array('content-type' => $contentType)); + } + + // Force the payload to match the content-type asserted in the header. + if ($contentType == self::FORM_URLENCODED && is_array($postBody)) { + $postBody = http_build_query($postBody, '', '&'); + $request->setPostBody($postBody); + } + + // Make sure the content-length header is set. + if (!$postBody || is_string($postBody)) { + $postsLength = strlen($postBody); + $request->setRequestHeaders(array('content-length' => $postsLength)); + } + + return $request; + } + + /** + * Check if an already cached request must be revalidated, and if so update + * the request with the correct ETag headers. + * @param Google_Http_Request $cached A previously cached response. + * @param Google_Http_Request $request The outbound request. + * return bool If the cached object needs to be revalidated, false if it is + * still current and can be re-used. + */ + protected function checkMustRevalidateCachedRequest($cached, $request) + { + if (Google_Http_CacheParser::mustRevalidate($cached)) { + $addHeaders = []; + if ($cached->getResponseHeader('etag')) { + // [13.3.4] If an entity tag has been provided by the origin server, + // we must use that entity tag in any cache-conditional request. + $addHeaders['If-None-Match'] = $cached->getResponseHeader('etag'); + } elseif ($cached->getResponseHeader('date')) { + $addHeaders['If-Modified-Since'] = $cached->getResponseHeader('date'); + } + + $request->setRequestHeaders($addHeaders); + return true; + } else { + return false; + } + } + + /** + * Update a cached request, using the headers from the last response. + * @param Google_Http_Request $cached A previously cached response. + * @param mixed Associative array of response headers from the last request. + */ + protected function updateCachedRequest($cached, $responseHeaders) + { + $hopByHop = self::$HOP_BY_HOP; + if (!empty($responseHeaders['connection'])) { + $connectionHeaders = array_map( + 'strtolower', + array_filter( + array_map('trim', explode(',', $responseHeaders['connection'])) + ) + ); + $hopByHop += array_fill_keys($connectionHeaders, true); + } + + $endToEnd = array_diff_key($responseHeaders, $hopByHop); + $cached->setResponseHeaders($endToEnd); + } + + /** + * Used by the IO lib and also the batch processing. + * + * @param $respData + * @param $headerSize + * @return array + */ + public function parseHttpResponse($respData, $headerSize) + { + // check proxy header + foreach (self::$CONNECTION_ESTABLISHED_HEADERS as $established_header) { + if (stripos($respData, $established_header) !== false) { + // existed, remove it + $respData = str_ireplace($established_header, '', $respData); + // Subtract the proxy header size unless the cURL bug prior to 7.30.0 + // is present which prevented the proxy header size from being taken into + // account. + if (!$this->needsQuirk()) { + $headerSize -= strlen($established_header); + } + break; + } + } + + if ($headerSize) { + $responseBody = substr($respData, $headerSize); + $responseHeaders = substr($respData, 0, $headerSize); + } else { + $responseSegments = explode("\r\n\r\n", $respData, 2); + $responseHeaders = $responseSegments[0]; + $responseBody = isset($responseSegments[1]) ? $responseSegments[1] : + null; + } + + $responseHeaders = $this->getHttpResponseHeaders($responseHeaders); + return array($responseHeaders, $responseBody); + } + + /** + * Parse out headers from raw headers + * @param rawHeaders array or string + * @return array + */ + public function getHttpResponseHeaders($rawHeaders) + { + if (is_array($rawHeaders)) { + return $this->parseArrayHeaders($rawHeaders); + } else { + return $this->parseStringHeaders($rawHeaders); + } + } + + private function parseStringHeaders($rawHeaders) + { + $headers = []; + $responseHeaderLines = explode("\r\n", $rawHeaders); + foreach ($responseHeaderLines as $headerLine) { + if ($headerLine && strpos($headerLine, ':') !== false) { + list($header, $value) = explode(': ', $headerLine, 2); + $header = strtolower($header); + if (isset($headers[$header])) { + $headers[$header] .= "\n" . $value; + } else { + $headers[$header] = $value; + } + } + } + return $headers; + } + + private function parseArrayHeaders($rawHeaders) + { + $header_count = count($rawHeaders); + $headers = []; + + for ($i = 0; $i < $header_count; $i++) { + $header = $rawHeaders[$i]; + // Times will have colons in - so we just want the first match. + $header_parts = explode(': ', $header, 2); + if (count($header_parts) == 2) { + $headers[strtolower($header_parts[0])] = $header_parts[1]; + } + } + + return $headers; + } +} diff --git a/app/api/Google/IO/Curl.php b/app/api/Google/IO/Curl.php new file mode 100755 index 0000000..8d2e7b3 --- /dev/null +++ b/app/api/Google/IO/Curl.php @@ -0,0 +1,194 @@ + + */ + +if (!class_exists('Google_Client')) { + require_once dirname(__FILE__) . '/../autoload.php'; +} + +class Google_IO_Curl extends Google_IO_Abstract +{ + // cURL hex representation of version 7.30.0 + const NO_QUIRK_VERSION = 0x071E00; + + private $options = []; + + /** @var bool $disableProxyWorkaround */ + private $disableProxyWorkaround; + + public function __construct(Google_Client $client) + { + if (!extension_loaded('curl')) { + $error = 'The cURL IO handler requires the cURL extension to be enabled'; + $client->getLogger()->critical($error); + throw new Google_IO_Exception($error); + } + + parent::__construct($client); + + $this->disableProxyWorkaround = $this->client->getClassConfig( + 'Google_IO_Curl', + 'disable_proxy_workaround' + ); + } + + /** + * Execute an HTTP Request + * + * @param Google_Http_Request $request the http request to be executed + * @return array containing response headers, body, and http code + * @throws Google_IO_Exception on curl or IO error + */ + public function executeRequest(Google_Http_Request $request) + { + $curl = curl_init(); + + if ($request->getPostBody()) { + curl_setopt($curl, CURLOPT_POSTFIELDS, $request->getPostBody()); + } + + $requestHeaders = $request->getRequestHeaders(); + if ($requestHeaders && is_array($requestHeaders)) { + $curlHeaders = []; + foreach ($requestHeaders as $k => $v) { + $curlHeaders[] = "$k: $v"; + } + curl_setopt($curl, CURLOPT_HTTPHEADER, $curlHeaders); + } + curl_setopt($curl, CURLOPT_URL, $request->getUrl()); + + curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $request->getRequestMethod()); + curl_setopt($curl, CURLOPT_USERAGENT, $request->getUserAgent()); + + curl_setopt($curl, CURLOPT_FOLLOWLOCATION, false); + curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, true); + + // The SSL version will be determined by the underlying library + // @see https://github.com/google/google-api-php-client/pull/644 + //curl_setopt($curl, CURLOPT_SSLVERSION, 1); + + curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); + curl_setopt($curl, CURLOPT_HEADER, true); + + if ($request->canGzip()) { + curl_setopt($curl, CURLOPT_ENCODING, 'gzip,deflate'); + } + + $options = $this->client->getClassConfig('Google_IO_Curl', 'options'); + if (is_array($options)) { + $this->setOptions($options); + } + + foreach ($this->options as $key => $var) { + curl_setopt($curl, $key, $var); + } + + if (!isset($this->options[CURLOPT_CAINFO])) { + curl_setopt($curl, CURLOPT_CAINFO, dirname(__FILE__) . '/cacerts.pem'); + } + + $this->client->getLogger()->debug( + 'cURL request', + array( + 'url' => $request->getUrl(), + 'method' => $request->getRequestMethod(), + 'headers' => $requestHeaders, + 'body' => $request->getPostBody() + ) + ); + + $response = curl_exec($curl); + if ($response === false) { + $error = curl_error($curl); + $code = curl_errno($curl); + $map = $this->client->getClassConfig('Google_IO_Exception', 'retry_map'); + + $this->client->getLogger()->error('cURL ' . $error); + throw new Google_IO_Exception($error, $code, null, $map); + } + $headerSize = curl_getinfo($curl, CURLINFO_HEADER_SIZE); + + list($responseHeaders, $responseBody) = $this->parseHttpResponse($response, $headerSize); + $responseCode = curl_getinfo($curl, CURLINFO_HTTP_CODE); + + $this->client->getLogger()->debug( + 'cURL response', + array( + 'code' => $responseCode, + 'headers' => $responseHeaders, + 'body' => $responseBody, + ) + ); + + return array($responseBody, $responseHeaders, $responseCode); + } + + /** + * Set options that update the transport implementation's behavior. + * @param $options + */ + public function setOptions($options) + { + $this->options = $options + $this->options; + } + + /** + * Set the maximum request time in seconds. + * @param $timeout in seconds + */ + public function setTimeout($timeout) + { + // Since this timeout is really for putting a bound on the time + // we'll set them both to the same. If you need to specify a longer + // CURLOPT_TIMEOUT, or a higher CONNECTTIMEOUT, the best thing to + // do is use the setOptions method for the values individually. + $this->options[CURLOPT_CONNECTTIMEOUT] = $timeout; + $this->options[CURLOPT_TIMEOUT] = $timeout; + } + + /** + * Get the maximum request time in seconds. + * @return timeout in seconds + */ + public function getTimeout() + { + return $this->options[CURLOPT_TIMEOUT]; + } + + /** + * Test for the presence of a cURL header processing bug + * + * {@inheritDoc} + * + * @return boolean + */ + protected function needsQuirk() + { + if ($this->disableProxyWorkaround) { + return false; + } + + $ver = curl_version(); + $versionNum = $ver['version_number']; + return $versionNum < Google_IO_Curl::NO_QUIRK_VERSION; + } +} diff --git a/app/api/Google/IO/Exception.php b/app/api/Google/IO/Exception.php new file mode 100755 index 0000000..30d9c2d --- /dev/null +++ b/app/api/Google/IO/Exception.php @@ -0,0 +1,69 @@ += 0) { + parent::__construct($message, $code, $previous); + } else { + parent::__construct($message, $code); + } + + if (is_array($retryMap)) { + $this->retryMap = $retryMap; + } + } + + /** + * Gets the number of times the associated task can be retried. + * + * NOTE: -1 is returned if the task can be retried indefinitely + * + * @return integer + */ + public function allowedRetries() + { + if (isset($this->retryMap[$this->code])) { + return $this->retryMap[$this->code]; + } + + return 0; + } +} diff --git a/app/api/Google/IO/Stream.php b/app/api/Google/IO/Stream.php new file mode 100755 index 0000000..867c90f --- /dev/null +++ b/app/api/Google/IO/Stream.php @@ -0,0 +1,243 @@ + + */ + +if (!class_exists('Google_Client')) { + require_once dirname(__FILE__) . '/../autoload.php'; +} + +class Google_IO_Stream extends Google_IO_Abstract +{ + const TIMEOUT = "timeout"; + const ZLIB = "compress.zlib://"; + private $options = []; + private $trappedErrorNumber; + private $trappedErrorString; + + private static $DEFAULT_HTTP_CONTEXT = array( + "follow_location" => 0, + "ignore_errors" => 1, + ); + + private static $DEFAULT_SSL_CONTEXT = array( + "verify_peer" => true, + ); + + public function __construct(Google_Client $client) + { + if (!ini_get('allow_url_fopen')) { + $error = 'The stream IO handler requires the allow_url_fopen runtime ' . + 'configuration to be enabled'; + $client->getLogger()->critical($error); + throw new Google_IO_Exception($error); + } + + parent::__construct($client); + } + + /** + * Execute an HTTP Request + * + * @param Google_Http_Request $request the http request to be executed + * @return array containing response headers, body, and http code + * @throws Google_IO_Exception on curl or IO error + */ + public function executeRequest(Google_Http_Request $request) + { + $default_options = stream_context_get_options(stream_context_get_default()); + + $requestHttpContext = array_key_exists('http', $default_options) ? + $default_options['http'] : []; + + if ($request->getPostBody()) { + $requestHttpContext["content"] = $request->getPostBody(); + } + + $requestHeaders = $request->getRequestHeaders(); + if ($requestHeaders && is_array($requestHeaders)) { + $headers = ""; + foreach ($requestHeaders as $k => $v) { + $headers .= "$k: $v\r\n"; + } + $requestHttpContext["header"] = $headers; + } + + $requestHttpContext["method"] = $request->getRequestMethod(); + $requestHttpContext["user_agent"] = $request->getUserAgent(); + + $requestSslContext = array_key_exists('ssl', $default_options) ? + $default_options['ssl'] : []; + + if (!$this->client->isAppEngine() && !array_key_exists("cafile", $requestSslContext)) { + $requestSslContext["cafile"] = dirname(__FILE__) . '/cacerts.pem'; + } + + $options = array( + "http" => array_merge( + self::$DEFAULT_HTTP_CONTEXT, + $requestHttpContext + ), + "ssl" => array_merge( + self::$DEFAULT_SSL_CONTEXT, + $requestSslContext + ) + ); + + $context = stream_context_create($options); + + $url = $request->getUrl(); + + if ($request->canGzip()) { + $url = self::ZLIB . $url; + } + + $this->client->getLogger()->debug( + 'Stream request', + array( + 'url' => $url, + 'method' => $request->getRequestMethod(), + 'headers' => $requestHeaders, + 'body' => $request->getPostBody() + ) + ); + + // We are trapping any thrown errors in this method only and + // throwing an exception. + $this->trappedErrorNumber = null; + $this->trappedErrorString = null; + + // START - error trap. + set_error_handler(array($this, 'trapError')); + $fh = fopen($url, 'r', false, $context); + restore_error_handler(); + // END - error trap. + + if ($this->trappedErrorNumber) { + $error = sprintf( + "HTTP Error: Unable to connect: '%s'", + $this->trappedErrorString + ); + + $this->client->getLogger()->error('Stream ' . $error); + throw new Google_IO_Exception($error, $this->trappedErrorNumber); + } + + $response_data = false; + $respHttpCode = self::UNKNOWN_CODE; + if ($fh) { + if (isset($this->options[self::TIMEOUT])) { + stream_set_timeout($fh, $this->options[self::TIMEOUT]); + } + + $response_data = stream_get_contents($fh); + fclose($fh); + + $respHttpCode = $this->getHttpResponseCode($http_response_header); + } + + if (false === $response_data) { + $error = sprintf( + "HTTP Error: Unable to connect: '%s'", + $respHttpCode + ); + + $this->client->getLogger()->error('Stream ' . $error); + throw new Google_IO_Exception($error, $respHttpCode); + } + + $responseHeaders = $this->getHttpResponseHeaders($http_response_header); + + $this->client->getLogger()->debug( + 'Stream response', + array( + 'code' => $respHttpCode, + 'headers' => $responseHeaders, + 'body' => $response_data, + ) + ); + + return array($response_data, $responseHeaders, $respHttpCode); + } + + /** + * Set options that update the transport implementation's behavior. + * @param $options + */ + public function setOptions($options) + { + $this->options = $options + $this->options; + } + + /** + * Method to handle errors, used for error handling around + * stream connection methods. + */ + public function trapError($errno, $errstr) + { + $this->trappedErrorNumber = $errno; + $this->trappedErrorString = $errstr; + } + + /** + * Set the maximum request time in seconds. + * @param $timeout in seconds + */ + public function setTimeout($timeout) + { + $this->options[self::TIMEOUT] = $timeout; + } + + /** + * Get the maximum request time in seconds. + * @return timeout in seconds + */ + public function getTimeout() + { + return $this->options[self::TIMEOUT]; + } + + /** + * Test for the presence of a cURL header processing bug + * + * {@inheritDoc} + * + * @return boolean + */ + protected function needsQuirk() + { + return false; + } + + protected function getHttpResponseCode($response_headers) + { + $header_count = count($response_headers); + + for ($i = 0; $i < $header_count; $i++) { + $header = $response_headers[$i]; + if (strncasecmp("HTTP", $header, strlen("HTTP")) == 0) { + $response = explode(' ', $header); + return $response[1]; + } + } + return self::UNKNOWN_CODE; + } +} diff --git a/app/api/Google/IO/cacerts.pem b/app/api/Google/IO/cacerts.pem new file mode 100755 index 0000000..971512a --- /dev/null +++ b/app/api/Google/IO/cacerts.pem @@ -0,0 +1,2183 @@ +# Issuer: CN=GTE CyberTrust Global Root O=GTE Corporation OU=GTE CyberTrust Solutions, Inc. +# Subject: CN=GTE CyberTrust Global Root O=GTE Corporation OU=GTE CyberTrust Solutions, Inc. +# Label: "GTE CyberTrust Global Root" +# Serial: 421 +# MD5 Fingerprint: ca:3d:d3:68:f1:03:5c:d0:32:fa:b8:2b:59:e8:5a:db +# SHA1 Fingerprint: 97:81:79:50:d8:1c:96:70:cc:34:d8:09:cf:79:44:31:36:7e:f4:74 +# SHA256 Fingerprint: a5:31:25:18:8d:21:10:aa:96:4b:02:c7:b7:c6:da:32:03:17:08:94:e5:fb:71:ff:fb:66:67:d5:e6:81:0a:36 +-----BEGIN CERTIFICATE----- +MIICWjCCAcMCAgGlMA0GCSqGSIb3DQEBBAUAMHUxCzAJBgNVBAYTAlVTMRgwFgYD +VQQKEw9HVEUgQ29ycG9yYXRpb24xJzAlBgNVBAsTHkdURSBDeWJlclRydXN0IFNv +bHV0aW9ucywgSW5jLjEjMCEGA1UEAxMaR1RFIEN5YmVyVHJ1c3QgR2xvYmFsIFJv +b3QwHhcNOTgwODEzMDAyOTAwWhcNMTgwODEzMjM1OTAwWjB1MQswCQYDVQQGEwJV +UzEYMBYGA1UEChMPR1RFIENvcnBvcmF0aW9uMScwJQYDVQQLEx5HVEUgQ3liZXJU +cnVzdCBTb2x1dGlvbnMsIEluYy4xIzAhBgNVBAMTGkdURSBDeWJlclRydXN0IEds +b2JhbCBSb290MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCVD6C28FCc6HrH +iM3dFw4usJTQGz0O9pTAipTHBsiQl8i4ZBp6fmw8U+E3KHNgf7KXUwefU/ltWJTS +r41tiGeA5u2ylc9yMcqlHHK6XALnZELn+aks1joNrI1CqiQBOeacPwGFVw1Yh0X4 +04Wqk2kmhXBIgD8SFcd5tB8FLztimQIDAQABMA0GCSqGSIb3DQEBBAUAA4GBAG3r +GwnpXtlR22ciYaQqPEh346B8pt5zohQDhT37qw4wxYMWM4ETCJ57NE7fQMh017l9 +3PR2VX2bY1QY6fDq81yx2YtCHrnAlU66+tXifPVoYb+O7AWXX1uw16OFNMQkpw0P +lZPvy5TYnh+dXIVtx6quTx8itc2VrbqnzPmrC3p/ +-----END CERTIFICATE----- + +# Issuer: CN=Thawte Server CA O=Thawte Consulting cc OU=Certification Services Division +# Subject: CN=Thawte Server CA O=Thawte Consulting cc OU=Certification Services Division +# Label: "Thawte Server CA" +# Serial: 1 +# MD5 Fingerprint: c5:70:c4:a2:ed:53:78:0c:c8:10:53:81:64:cb:d0:1d +# SHA1 Fingerprint: 23:e5:94:94:51:95:f2:41:48:03:b4:d5:64:d2:a3:a3:f5:d8:8b:8c +# SHA256 Fingerprint: b4:41:0b:73:e2:e6:ea:ca:47:fb:c4:2f:8f:a4:01:8a:f4:38:1d:c5:4c:fa:a8:44:50:46:1e:ed:09:45:4d:e9 +-----BEGIN CERTIFICATE----- +MIIDEzCCAnygAwIBAgIBATANBgkqhkiG9w0BAQQFADCBxDELMAkGA1UEBhMCWkEx +FTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYD +VQQKExRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlv +biBTZXJ2aWNlcyBEaXZpc2lvbjEZMBcGA1UEAxMQVGhhd3RlIFNlcnZlciBDQTEm +MCQGCSqGSIb3DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0ZS5jb20wHhcNOTYwODAx +MDAwMDAwWhcNMjAxMjMxMjM1OTU5WjCBxDELMAkGA1UEBhMCWkExFTATBgNVBAgT +DFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYDVQQKExRUaGF3 +dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNl +cyBEaXZpc2lvbjEZMBcGA1UEAxMQVGhhd3RlIFNlcnZlciBDQTEmMCQGCSqGSIb3 +DQEJARYXc2VydmVyLWNlcnRzQHRoYXd0ZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQAD +gY0AMIGJAoGBANOkUG7I/1Zr5s9dtuoMaHVHoqrC2oQl/Kj0R1HahbUgdJSGHg91 +yekIYfUGbTBuFRkC6VLAYttNmZ7iagxEOM3+vuNkCXDF/rFrKbYvScg71CcEJRCX +L+eQbcAoQpnXTEPew/UhbVSfXcNY4cDk2VuwuNy0e982OsK1ZiIS1ocNAgMBAAGj +EzARMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEEBQADgYEAB/pMaVz7lcxG +7oWDTSEwjsrZqG9JGubaUeNgcGyEYRGhGshIPllDfU+VPaGLtwtimHp1it2ITk6e +QNuozDJ0uW8NxuOzRAvZim+aKZuZGCg70eNAKJpaPNW15yAbi8qkq43pUdniTCxZ +qdq5snUb9kLy78fyGPmJvKP/iiMucEc= +-----END CERTIFICATE----- + +# Issuer: CN=Thawte Premium Server CA O=Thawte Consulting cc OU=Certification Services Division +# Subject: CN=Thawte Premium Server CA O=Thawte Consulting cc OU=Certification Services Division +# Label: "Thawte Premium Server CA" +# Serial: 1 +# MD5 Fingerprint: 06:9f:69:79:16:66:90:02:1b:8c:8c:a2:c3:07:6f:3a +# SHA1 Fingerprint: 62:7f:8d:78:27:65:63:99:d2:7d:7f:90:44:c9:fe:b3:f3:3e:fa:9a +# SHA256 Fingerprint: ab:70:36:36:5c:71:54:aa:29:c2:c2:9f:5d:41:91:16:3b:16:2a:22:25:01:13:57:d5:6d:07:ff:a7:bc:1f:72 +-----BEGIN CERTIFICATE----- +MIIDJzCCApCgAwIBAgIBATANBgkqhkiG9w0BAQQFADCBzjELMAkGA1UEBhMCWkEx +FTATBgNVBAgTDFdlc3Rlcm4gQ2FwZTESMBAGA1UEBxMJQ2FwZSBUb3duMR0wGwYD +VQQKExRUaGF3dGUgQ29uc3VsdGluZyBjYzEoMCYGA1UECxMfQ2VydGlmaWNhdGlv +biBTZXJ2aWNlcyBEaXZpc2lvbjEhMB8GA1UEAxMYVGhhd3RlIFByZW1pdW0gU2Vy +dmVyIENBMSgwJgYJKoZIhvcNAQkBFhlwcmVtaXVtLXNlcnZlckB0aGF3dGUuY29t +MB4XDTk2MDgwMTAwMDAwMFoXDTIwMTIzMTIzNTk1OVowgc4xCzAJBgNVBAYTAlpB +MRUwEwYDVQQIEwxXZXN0ZXJuIENhcGUxEjAQBgNVBAcTCUNhcGUgVG93bjEdMBsG +A1UEChMUVGhhd3RlIENvbnN1bHRpbmcgY2MxKDAmBgNVBAsTH0NlcnRpZmljYXRp +b24gU2VydmljZXMgRGl2aXNpb24xITAfBgNVBAMTGFRoYXd0ZSBQcmVtaXVtIFNl +cnZlciBDQTEoMCYGCSqGSIb3DQEJARYZcHJlbWl1bS1zZXJ2ZXJAdGhhd3RlLmNv +bTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA0jY2aovXwlue2oFBYo847kkE +VdbQ7xwblRZH7xhINTpS9CtqBo87L+pW46+GjZ4X9560ZXUCTe/LCaIhUdib0GfQ +ug2SBhRz1JPLlyoAnFxODLz6FVL88kRu2hFKbgifLy3j+ao6hnO2RlNYyIkFvYMR +uHM/qgeN9EJN50CdHDcCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG +9w0BAQQFAAOBgQAmSCwWwlj66BZ0DKqqX1Q/8tfJeGBeXm43YyJ3Nn6yF8Q0ufUI +hfzJATj/Tb7yFkJD57taRvvBxhEf8UqwKEbJw8RCfbz6q1lu1bdRiBHjpIUZa4JM +pAwSremkrj/xw0llmozFyD4lt5SZu5IycQfwhl7tUCemDaYj+bvLpgcUQg== +-----END CERTIFICATE----- + +# Issuer: O=Equifax OU=Equifax Secure Certificate Authority +# Subject: O=Equifax OU=Equifax Secure Certificate Authority +# Label: "Equifax Secure CA" +# Serial: 903804111 +# MD5 Fingerprint: 67:cb:9d:c0:13:24:8a:82:9b:b2:17:1e:d1:1b:ec:d4 +# SHA1 Fingerprint: d2:32:09:ad:23:d3:14:23:21:74:e4:0d:7f:9d:62:13:97:86:63:3a +# SHA256 Fingerprint: 08:29:7a:40:47:db:a2:36:80:c7:31:db:6e:31:76:53:ca:78:48:e1:be:bd:3a:0b:01:79:a7:07:f9:2c:f1:78 +-----BEGIN CERTIFICATE----- +MIIDIDCCAomgAwIBAgIENd70zzANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJV +UzEQMA4GA1UEChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2Vy +dGlmaWNhdGUgQXV0aG9yaXR5MB4XDTk4MDgyMjE2NDE1MVoXDTE4MDgyMjE2NDE1 +MVowTjELMAkGA1UEBhMCVVMxEDAOBgNVBAoTB0VxdWlmYXgxLTArBgNVBAsTJEVx +dWlmYXggU2VjdXJlIENlcnRpZmljYXRlIEF1dGhvcml0eTCBnzANBgkqhkiG9w0B +AQEFAAOBjQAwgYkCgYEAwV2xWGcIYu6gmi0fCG2RFGiYCh7+2gRvE4RiIcPRfM6f +BeC4AfBONOziipUEZKzxa1NfBbPLZ4C/QgKO/t0BCezhABRP/PvwDN1Dulsr4R+A +cJkVV5MW8Q+XarfCaCMczE1ZMKxRHjuvK9buY0V7xdlfUNLjUA86iOe/FP3gx7kC +AwEAAaOCAQkwggEFMHAGA1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEQ +MA4GA1UEChMHRXF1aWZheDEtMCsGA1UECxMkRXF1aWZheCBTZWN1cmUgQ2VydGlm +aWNhdGUgQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMBoGA1UdEAQTMBGBDzIwMTgw +ODIyMTY0MTUxWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUSOZo+SvSspXXR9gj +IBBPM5iQn9QwHQYDVR0OBBYEFEjmaPkr0rKV10fYIyAQTzOYkJ/UMAwGA1UdEwQF +MAMBAf8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUA +A4GBAFjOKer89961zgK5F7WF0bnj4JXMJTENAKaSbn+2kmOeUJXRmm/kEd5jhW6Y +7qj/WsjTVbJmcVfewCHrPSqnI0kBBIZCe/zuf6IWUrVnZ9NA2zsmWLIodz2uFHdh +1voqZiegDfqnc1zqcPGUIWVEX/r87yloqaKHee9570+sB3c4 +-----END CERTIFICATE----- + +# Issuer: O=VeriSign, Inc. OU=Class 3 Public Primary Certification Authority +# Subject: O=VeriSign, Inc. OU=Class 3 Public Primary Certification Authority +# Label: "Verisign Class 3 Public Primary Certification Authority" +# Serial: 149843929435818692848040365716851702463 +# MD5 Fingerprint: 10:fc:63:5d:f6:26:3e:0d:f3:25:be:5f:79:cd:67:67 +# SHA1 Fingerprint: 74:2c:31:92:e6:07:e4:24:eb:45:49:54:2b:e1:bb:c5:3e:61:74:e2 +# SHA256 Fingerprint: e7:68:56:34:ef:ac:f6:9a:ce:93:9a:6b:25:5b:7b:4f:ab:ef:42:93:5b:50:a2:65:ac:b5:cb:60:27:e4:4e:70 +-----BEGIN CERTIFICATE----- +MIICPDCCAaUCEHC65B0Q2Sk0tjjKewPMur8wDQYJKoZIhvcNAQECBQAwXzELMAkG +A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz +cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2 +MDEyOTAwMDAwMFoXDTI4MDgwMTIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV +BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt +YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE +BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is +I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G +CSqGSIb3DQEBAgUAA4GBALtMEivPLCYATxQT3ab7/AoRhIzzKBxnki98tsX63/Do +lbwdj2wsqFHMc9ikwFPwTtYmwHYBV4GSXiHx0bH/59AhWM1pF+NEHJwZRDmJXNyc +AA9WjQKZ7aKQRUzkuxCkPfAyAw7xzvjoyVGM5mKf5p/AfbdynMk2OmufTqj/ZA1k +-----END CERTIFICATE----- + +# Issuer: O=VeriSign, Inc. OU=Class 3 Public Primary Certification Authority - G2/(c) 1998 VeriSign, Inc. - For authorized use only/VeriSign Trust Network +# Subject: O=VeriSign, Inc. OU=Class 3 Public Primary Certification Authority - G2/(c) 1998 VeriSign, Inc. - For authorized use only/VeriSign Trust Network +# Label: "Verisign Class 3 Public Primary Certification Authority - G2" +# Serial: 167285380242319648451154478808036881606 +# MD5 Fingerprint: a2:33:9b:4c:74:78:73:d4:6c:e7:c1:f3:8d:cb:5c:e9 +# SHA1 Fingerprint: 85:37:1c:a6:e5:50:14:3d:ce:28:03:47:1b:de:3a:09:e8:f8:77:0f +# SHA256 Fingerprint: 83:ce:3c:12:29:68:8a:59:3d:48:5f:81:97:3c:0f:91:95:43:1e:da:37:cc:5e:36:43:0e:79:c7:a8:88:63:8b +-----BEGIN CERTIFICATE----- +MIIDAjCCAmsCEH3Z/gfPqB63EHln+6eJNMYwDQYJKoZIhvcNAQEFBQAwgcExCzAJ +BgNVBAYTAlVTMRcwFQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xh +c3MgMyBQdWJsaWMgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcy +MTowOAYDVQQLEzEoYykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3Jp +emVkIHVzZSBvbmx5MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMB4X +DTk4MDUxODAwMDAwMFoXDTI4MDgwMTIzNTk1OVowgcExCzAJBgNVBAYTAlVTMRcw +FQYDVQQKEw5WZXJpU2lnbiwgSW5jLjE8MDoGA1UECxMzQ2xhc3MgMyBQdWJsaWMg +UHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMTowOAYDVQQLEzEo +YykgMTk5OCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5 +MR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMIGfMA0GCSqGSIb3DQEB +AQUAA4GNADCBiQKBgQDMXtERXVxp0KvTuWpMmR9ZmDCOFoUgRm1HP9SFIIThbbP4 +pO0M8RcPO/mn+SXXwc+EY/J8Y8+iR/LGWzOOZEAEaMGAuWQcRXfH2G71lSk8UOg0 +13gfqLptQ5GVj0VXXn7F+8qkBOvqlzdUMG+7AUcyM83cV5tkaWH4mx0ciU9cZwID +AQABMA0GCSqGSIb3DQEBBQUAA4GBAFFNzb5cy5gZnBWyATl4Lk0PZ3BwmcYQWpSk +U01UbSuvDV1Ai2TT1+7eVmGSX6bEHRBhNtMsJzzoKQm5EWR0zLVznxxIqbxhAe7i +F6YM40AIOw7n60RzKprxaZLvcRTDOaxxp5EJb+RxBrO6WVcmeQD2+A2iMzAo1KpY +oJ2daZH9 +-----END CERTIFICATE----- + +# Issuer: CN=GlobalSign Root CA O=GlobalSign nv-sa OU=Root CA +# Subject: CN=GlobalSign Root CA O=GlobalSign nv-sa OU=Root CA +# Label: "GlobalSign Root CA" +# Serial: 4835703278459707669005204 +# MD5 Fingerprint: 3e:45:52:15:09:51:92:e1:b7:5d:37:9f:b1:87:29:8a +# SHA1 Fingerprint: b1:bc:96:8b:d4:f4:9d:62:2a:a8:9a:81:f2:15:01:52:a4:1d:82:9c +# SHA256 Fingerprint: eb:d4:10:40:e4:bb:3e:c7:42:c9:e3:81:d3:1e:f2:a4:1a:48:b6:68:5c:96:e7:ce:f3:c1:df:6c:d4:33:1c:99 +-----BEGIN CERTIFICATE----- +MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkG +A1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jv +b3QgQ0ExGzAZBgNVBAMTEkdsb2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAw +MDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9i +YWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYDVQQDExJHbG9iYWxT +aWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDaDuaZ +jc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavp +xy0Sy6scTHAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp +1Wrjsok6Vjk4bwY8iGlbKk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdG +snUOhugZitVtbNV4FpWi6cgKOOvyJBNPc1STE4U6G7weNLWLBYy5d4ux2x8gkasJ +U26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrXgzT/LCrBbBlDSgeF59N8 +9iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8E +BTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0B +AQUFAAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOz +yj1hTdNGCbM+w6DjY1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE +38NflNUVyRRBnMRddWQVDf9VMOyGj/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymP +AbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhHhm4qxFYxldBniYUr+WymXUad +DKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveCX4XSQRjbgbME +HMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A== +-----END CERTIFICATE----- + +# Issuer: CN=GlobalSign O=GlobalSign OU=GlobalSign Root CA - R2 +# Subject: CN=GlobalSign O=GlobalSign OU=GlobalSign Root CA - R2 +# Label: "GlobalSign Root CA - R2" +# Serial: 4835703278459682885658125 +# MD5 Fingerprint: 94:14:77:7e:3e:5e:fd:8f:30:bd:41:b0:cf:e7:d0:30 +# SHA1 Fingerprint: 75:e0:ab:b6:13:85:12:27:1c:04:f8:5f:dd:de:38:e4:b7:24:2e:fe +# SHA256 Fingerprint: ca:42:dd:41:74:5f:d0:b8:1e:b9:02:36:2c:f9:d8:bf:71:9d:a1:bd:1b:1e:fc:94:6f:5b:4c:99:f4:2c:1b:9e +-----BEGIN CERTIFICATE----- +MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4G +A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNp +Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1 +MDgwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMjETMBEG +A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAKbPJA6+Lm8omUVCxKs+IVSbC9N/hHD6ErPL +v4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7SqbKSaZeqKeMWhG8 +eoLrvozps6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQBoZfXklq +tTleiDTsvHgMCJiEbKjNS7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzd +C9XZzPnqJworc5HGnRusyMvo4KD0L5CLTfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pa +zq+r1feqCapgvdzZX99yqWATXgAByUr6P6TqBwMhAo6CygPCm48CAwEAAaOBnDCB +mTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUm+IH +V2ccHsBqBt5ZtJot39wZhi4wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2NybC5n +bG9iYWxzaWduLm5ldC9yb290LXIyLmNybDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG +3lm0mi3f3BmGLjANBgkqhkiG9w0BAQUFAAOCAQEAmYFThxxol4aR7OBKuEQLq4Gs +J0/WwbgcQ3izDJr86iw8bmEbTUsp9Z8FHSbBuOmDAGJFtqkIk7mpM0sYmsL4h4hO +291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu01yiPqFbQfXf5WRDLenVOavS +ot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG79G+dwfCMNYxd +AfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7 +TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg== +-----END CERTIFICATE----- + +# Issuer: CN=http://www.valicert.com/ O=ValiCert, Inc. OU=ValiCert Class 1 Policy Validation Authority +# Subject: CN=http://www.valicert.com/ O=ValiCert, Inc. OU=ValiCert Class 1 Policy Validation Authority +# Label: "ValiCert Class 1 VA" +# Serial: 1 +# MD5 Fingerprint: 65:58:ab:15:ad:57:6c:1e:a8:a7:b5:69:ac:bf:ff:eb +# SHA1 Fingerprint: e5:df:74:3c:b6:01:c4:9b:98:43:dc:ab:8c:e8:6a:81:10:9f:e4:8e +# SHA256 Fingerprint: f4:c1:49:55:1a:30:13:a3:5b:c7:bf:fe:17:a7:f3:44:9b:c1:ab:5b:5a:0a:e7:4b:06:c2:3b:90:00:4c:01:04 +-----BEGIN CERTIFICATE----- +MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0 +IFZhbGlkYXRpb24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAz +BgNVBAsTLFZhbGlDZXJ0IENsYXNzIDEgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9y +aXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG +9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNTIyMjM0OFoXDTE5MDYy +NTIyMjM0OFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0d29y +azEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs +YXNzIDEgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRw +Oi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNl +cnQuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDYWYJ6ibiWuqYvaG9Y +LqdUHAZu9OqNSLwxlBfw8068srg1knaw0KWlAdcAAxIiGQj4/xEjm84H9b9pGib+ +TunRf50sQB1ZaG6m+FiwnRqP0z/x3BkGgagO4DrdyFNFCQbmD3DD+kCmDuJWBQ8Y +TfwggtFzVXSNdnKgHZ0dwN0/cQIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFBoPUn0 +LBwGlN+VYH+Wexf+T3GtZMjdd9LvWVXoP+iOBSoh8gfStadS/pyxtuJbdxdA6nLW +I8sogTLDAHkY7FkXicnGah5xyf23dKUlRWnFSKsZ4UWKJWsZ7uW7EvV/96aNUcPw +nXS3qT6gpf+2SQMT2iLM7XGCK5nPOrf1LXLI +-----END CERTIFICATE----- + +# Issuer: CN=http://www.valicert.com/ O=ValiCert, Inc. OU=ValiCert Class 2 Policy Validation Authority +# Subject: CN=http://www.valicert.com/ O=ValiCert, Inc. OU=ValiCert Class 2 Policy Validation Authority +# Label: "ValiCert Class 2 VA" +# Serial: 1 +# MD5 Fingerprint: a9:23:75:9b:ba:49:36:6e:31:c2:db:f2:e7:66:ba:87 +# SHA1 Fingerprint: 31:7a:2a:d0:7f:2b:33:5e:f5:a1:c3:4e:4b:57:e8:b7:d8:f1:fc:a6 +# SHA256 Fingerprint: 58:d0:17:27:9c:d4:dc:63:ab:dd:b1:96:a6:c9:90:6c:30:c4:e0:87:83:ea:e8:c1:60:99:54:d6:93:55:59:6b +-----BEGIN CERTIFICATE----- +MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0 +IFZhbGlkYXRpb24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAz +BgNVBAsTLFZhbGlDZXJ0IENsYXNzIDIgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9y +aXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG +9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAwMTk1NFoXDTE5MDYy +NjAwMTk1NFowgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0d29y +azEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs +YXNzIDIgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRw +Oi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNl +cnQuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDOOnHK5avIWZJV16vY +dA757tn2VUdZZUcOBVXc65g2PFxTXdMwzzjsvUGJ7SVCCSRrCl6zfN1SLUzm1NZ9 +WlmpZdRJEy0kTRxQb7XBhVQ7/nHk01xC+YDgkRoKWzk2Z/M/VXwbP7RfZHM047QS +v4dk+NoS/zcnwbNDu+97bi5p9wIDAQABMA0GCSqGSIb3DQEBBQUAA4GBADt/UG9v +UJSZSWI4OB9L+KXIPqeCgfYrx+jFzug6EILLGACOTb2oWH+heQC1u+mNr0HZDzTu +IYEZoDJJKPTEjlbVUjP9UNV+mWwD5MlM/Mtsq2azSiGM5bUMMj4QssxsodyamEwC +W/POuZ6lcg5Ktz885hZo+L7tdEy8W9ViH0Pd +-----END CERTIFICATE----- + +# Issuer: CN=http://www.valicert.com/ O=ValiCert, Inc. OU=ValiCert Class 3 Policy Validation Authority +# Subject: CN=http://www.valicert.com/ O=ValiCert, Inc. OU=ValiCert Class 3 Policy Validation Authority +# Label: "RSA Root Certificate 1" +# Serial: 1 +# MD5 Fingerprint: a2:6f:53:b7:ee:40:db:4a:68:e7:fa:18:d9:10:4b:72 +# SHA1 Fingerprint: 69:bd:8c:f4:9c:d3:00:fb:59:2e:17:93:ca:55:6a:f3:ec:aa:35:fb +# SHA256 Fingerprint: bc:23:f9:8a:31:3c:b9:2d:e3:bb:fc:3a:5a:9f:44:61:ac:39:49:4c:4a:e1:5a:9e:9d:f1:31:e9:9b:73:01:9a +-----BEGIN CERTIFICATE----- +MIIC5zCCAlACAQEwDQYJKoZIhvcNAQEFBQAwgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0 +IFZhbGlkYXRpb24gTmV0d29yazEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAz +BgNVBAsTLFZhbGlDZXJ0IENsYXNzIDMgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9y +aXR5MSEwHwYDVQQDExhodHRwOi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG +9w0BCQEWEWluZm9AdmFsaWNlcnQuY29tMB4XDTk5MDYyNjAwMjIzM1oXDTE5MDYy +NjAwMjIzM1owgbsxJDAiBgNVBAcTG1ZhbGlDZXJ0IFZhbGlkYXRpb24gTmV0d29y +azEXMBUGA1UEChMOVmFsaUNlcnQsIEluYy4xNTAzBgNVBAsTLFZhbGlDZXJ0IENs +YXNzIDMgUG9saWN5IFZhbGlkYXRpb24gQXV0aG9yaXR5MSEwHwYDVQQDExhodHRw +Oi8vd3d3LnZhbGljZXJ0LmNvbS8xIDAeBgkqhkiG9w0BCQEWEWluZm9AdmFsaWNl +cnQuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDjmFGWHOjVsQaBalfD +cnWTq8+epvzzFlLWLU2fNUSoLgRNB0mKOCn1dzfnt6td3zZxFJmP3MKS8edgkpfs +2Ejcv8ECIMYkpChMMFp2bbFc893enhBxoYjHW5tBbcqwuI4V7q0zK89HBFx1cQqY +JJgpp0lZpd34t0NiYfPT4tBVPwIDAQABMA0GCSqGSIb3DQEBBQUAA4GBAFa7AliE +Zwgs3x/be0kz9dNnnfS0ChCzycUs4pJqcXgn8nCDQtM+z6lU9PHYkhaM0QTLS6vJ +n0WuPIqpsHEzXcjFV9+vqDWzf4mH6eglkrh/hXqu1rweN1gqZ8mRzyqBPu3GOd/A +PhmcGcwTTYJBtYze4D1gCCAPRX5ron+jjBXu +-----END CERTIFICATE----- + +# Issuer: CN=VeriSign Class 3 Public Primary Certification Authority - G3 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 1999 VeriSign, Inc. - For authorized use only +# Subject: CN=VeriSign Class 3 Public Primary Certification Authority - G3 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 1999 VeriSign, Inc. - For authorized use only +# Label: "Verisign Class 3 Public Primary Certification Authority - G3" +# Serial: 206684696279472310254277870180966723415 +# MD5 Fingerprint: cd:68:b6:a7:c7:c4:ce:75:e0:1d:4f:57:44:61:92:09 +# SHA1 Fingerprint: 13:2d:0d:45:53:4b:69:97:cd:b2:d5:c3:39:e2:55:76:60:9b:5c:c6 +# SHA256 Fingerprint: eb:04:cf:5e:b1:f3:9a:fa:76:2f:2b:b1:20:f2:96:cb:a5:20:c1:b9:7d:b1:58:95:65:b8:1c:b9:a1:7b:72:44 +-----BEGIN CERTIFICATE----- +MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQsw +CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZl +cmlTaWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWdu +LCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlT +aWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3Jp +dHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQswCQYD +VQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlT +aWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJ +bmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWdu +IENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg +LSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMu6nFL8eB8aHm8b +N3O9+MlrlBIwT/A2R/XQkQr1F8ilYcEWQE37imGQ5XYgwREGfassbqb1EUGO+i2t +KmFZpGcmTNDovFJbcCAEWNF6yaRpvIMXZK0Fi7zQWM6NjPXr8EJJC52XJ2cybuGu +kxUccLwgTS8Y3pKI6GyFVxEa6X7jJhFUokWWVYPKMIno3Nij7SqAP395ZVc+FSBm +CC+Vk7+qRy+oRpfwEuL+wgorUeZ25rdGt+INpsyow0xZVYnm6FNcHOqd8GIWC6fJ +Xwzw3sJ2zq/3avL6QaaiMxTJ5Xpj055iN9WFZZ4O5lMkdBteHRJTW8cs54NJOxWu +imi5V5cCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAERSWwauSCPc/L8my/uRan2Te +2yFPhpk0djZX3dAVL8WtfxUfN2JzPtTnX84XA9s1+ivbrmAJXx5fj267Cz3qWhMe +DGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC +/Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565p +F4ErWjfJXir0xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGt +TxzhT5yvDwyd93gN2PQ1VoDat20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ== +-----END CERTIFICATE----- + +# Issuer: CN=VeriSign Class 4 Public Primary Certification Authority - G3 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 1999 VeriSign, Inc. - For authorized use only +# Subject: CN=VeriSign Class 4 Public Primary Certification Authority - G3 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 1999 VeriSign, Inc. - For authorized use only +# Label: "Verisign Class 4 Public Primary Certification Authority - G3" +# Serial: 314531972711909413743075096039378935511 +# MD5 Fingerprint: db:c8:f2:27:2e:b1:ea:6a:29:23:5d:fe:56:3e:33:df +# SHA1 Fingerprint: c8:ec:8c:87:92:69:cb:4b:ab:39:e9:8d:7e:57:67:f3:14:95:73:9d +# SHA256 Fingerprint: e3:89:36:0d:0f:db:ae:b3:d2:50:58:4b:47:30:31:4e:22:2f:39:c1:56:a0:20:14:4e:8d:96:05:61:79:15:06 +-----BEGIN CERTIFICATE----- +MIIEGjCCAwICEQDsoKeLbnVqAc/EfMwvlF7XMA0GCSqGSIb3DQEBBQUAMIHKMQsw +CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZl +cmlTaWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWdu +LCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlT +aWduIENsYXNzIDQgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3Jp +dHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQswCQYD +VQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlT +aWduIFRydXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJ +bmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWdu +IENsYXNzIDQgUHVibGljIFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg +LSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAK3LpRFpxlmr8Y+1 +GQ9Wzsy1HyDkniYlS+BzZYlZ3tCD5PUPtbut8XzoIfzk6AzufEUiGXaStBO3IFsJ ++mGuqPKljYXCKtbeZjbSmwL0qJJgfJxptI8kHtCGUvYynEFYHiK9zUVilQhu0Gbd +U6LM8BDcVHOLBKFGMzNcF0C5nk3T875Vg+ixiY5afJqWIpA7iCXy0lOIAgwLePLm +NxdLMEYH5IBtptiWLugs+BGzOA1mppvqySNb247i8xOOGlktqgLw7KSHZtzBP/XY +ufTsgsbSPZUd5cBPhMnZo0QoBmrXRazwa2rvTl/4EYIeOGM0ZlDUPpNz+jDDZq3/ +ky2X7wMCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEAj/ola09b5KROJ1WrIhVZPMq1 +CtRK26vdoV9TxaBXOcLORyu+OshWv8LZJxA6sQU8wHcxuzrTBXttmhwwjIDLk5Mq +g6sFUYICABFna/OIYUdfA5PVWw3g8dShMjWFsjrbsIKr0csKvE+MW8VLADsfKoKm +fjaF3H48ZwC15DtS4KjrXRX5xm3wrR0OhbepmnMUWluPQSjA1egtTaRezarZ7c7c +2NU8Qh0XwRJdRTjDOPP8hS6DRkiy1yBfkjaP53kPmF6Z6PDQpLv1U70qzlmwr25/ +bLvSHgCwIe34QWKCudiyxLtGUPMxxY8BqHTr9Xgn2uf3ZkPznoM+IKrDNWCRzg== +-----END CERTIFICATE----- + +# Issuer: CN=Entrust.net Secure Server Certification Authority O=Entrust.net OU=www.entrust.net/CPS incorp. by ref. (limits liab.)/(c) 1999 Entrust.net Limited +# Subject: CN=Entrust.net Secure Server Certification Authority O=Entrust.net OU=www.entrust.net/CPS incorp. by ref. (limits liab.)/(c) 1999 Entrust.net Limited +# Label: "Entrust.net Secure Server CA" +# Serial: 927650371 +# MD5 Fingerprint: df:f2:80:73:cc:f1:e6:61:73:fc:f5:42:e9:c5:7c:ee +# SHA1 Fingerprint: 99:a6:9b:e6:1a:fe:88:6b:4d:2b:82:00:7c:b8:54:fc:31:7e:15:39 +# SHA256 Fingerprint: 62:f2:40:27:8c:56:4c:4d:d8:bf:7d:9d:4f:6f:36:6e:a8:94:d2:2f:5f:34:d9:89:a9:83:ac:ec:2f:ff:ed:50 +-----BEGIN CERTIFICATE----- +MIIE2DCCBEGgAwIBAgIEN0rSQzANBgkqhkiG9w0BAQUFADCBwzELMAkGA1UEBhMC +VVMxFDASBgNVBAoTC0VudHJ1c3QubmV0MTswOQYDVQQLEzJ3d3cuZW50cnVzdC5u +ZXQvQ1BTIGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTElMCMGA1UECxMc +KGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDE6MDgGA1UEAxMxRW50cnVzdC5u +ZXQgU2VjdXJlIFNlcnZlciBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw05OTA1 +MjUxNjA5NDBaFw0xOTA1MjUxNjM5NDBaMIHDMQswCQYDVQQGEwJVUzEUMBIGA1UE +ChMLRW50cnVzdC5uZXQxOzA5BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5j +b3JwLiBieSByZWYuIChsaW1pdHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBF +bnRydXN0Lm5ldCBMaW1pdGVkMTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUg +U2VydmVyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGdMA0GCSqGSIb3DQEBAQUA +A4GLADCBhwKBgQDNKIM0VBuJ8w+vN5Ex/68xYMmo6LIQaO2f55M28Qpku0f1BBc/ +I0dNxScZgSYMVHINiC3ZH5oSn7yzcdOAGT9HZnuMNSjSuQrfJNqc1lB5gXpa0zf3 +wkrYKZImZNHkmGw6AIr1NJtl+O3jEP/9uElY3KDegjlrgbEWGWG5VLbmQwIBA6OC +AdcwggHTMBEGCWCGSAGG+EIBAQQEAwIABzCCARkGA1UdHwSCARAwggEMMIHeoIHb +oIHYpIHVMIHSMQswCQYDVQQGEwJVUzEUMBIGA1UEChMLRW50cnVzdC5uZXQxOzA5 +BgNVBAsTMnd3dy5lbnRydXN0Lm5ldC9DUFMgaW5jb3JwLiBieSByZWYuIChsaW1p +dHMgbGlhYi4pMSUwIwYDVQQLExwoYykgMTk5OSBFbnRydXN0Lm5ldCBMaW1pdGVk +MTowOAYDVQQDEzFFbnRydXN0Lm5ldCBTZWN1cmUgU2VydmVyIENlcnRpZmljYXRp +b24gQXV0aG9yaXR5MQ0wCwYDVQQDEwRDUkwxMCmgJ6AlhiNodHRwOi8vd3d3LmVu +dHJ1c3QubmV0L0NSTC9uZXQxLmNybDArBgNVHRAEJDAigA8xOTk5MDUyNTE2MDk0 +MFqBDzIwMTkwNTI1MTYwOTQwWjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAU8Bdi +E1U9s/8KAGv7UISX8+1i0BowHQYDVR0OBBYEFPAXYhNVPbP/CgBr+1CEl/PtYtAa +MAwGA1UdEwQFMAMBAf8wGQYJKoZIhvZ9B0EABAwwChsEVjQuMAMCBJAwDQYJKoZI +hvcNAQEFBQADgYEAkNwwAvpkdMKnCqV8IY00F6j7Rw7/JXyNEwr75Ji174z4xRAN +95K+8cPV1ZVqBLssziY2ZcgxxufuP+NXdYR6Ee9GTxj005i7qIcyunL2POI9n9cd +2cNgQ4xYDiKWL2KjLB+6rQXvqzJ4h6BUcxm1XAX5Uj5tLUUL9wqT6u0G+bI= +-----END CERTIFICATE----- + +# Issuer: CN=Entrust.net Certification Authority (2048) O=Entrust.net OU=www.entrust.net/CPS_2048 incorp. by ref. (limits liab.)/(c) 1999 Entrust.net Limited +# Subject: CN=Entrust.net Certification Authority (2048) O=Entrust.net OU=www.entrust.net/CPS_2048 incorp. by ref. (limits liab.)/(c) 1999 Entrust.net Limited +# Label: "Entrust.net Premium 2048 Secure Server CA" +# Serial: 946059622 +# MD5 Fingerprint: ba:21:ea:20:d6:dd:db:8f:c1:57:8b:40:ad:a1:fc:fc +# SHA1 Fingerprint: 80:1d:62:d0:7b:44:9d:5c:5c:03:5c:98:ea:61:fa:44:3c:2a:58:fe +# SHA256 Fingerprint: d1:c3:39:ea:27:84:eb:87:0f:93:4f:c5:63:4e:4a:a9:ad:55:05:01:64:01:f2:64:65:d3:7a:57:46:63:35:9f +-----BEGIN CERTIFICATE----- +MIIEXDCCA0SgAwIBAgIEOGO5ZjANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChML +RW50cnVzdC5uZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBp +bmNvcnAuIGJ5IHJlZi4gKGxpbWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5 +IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNVBAMTKkVudHJ1c3QubmV0IENlcnRp +ZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQxNzUwNTFaFw0xOTEy +MjQxODIwNTFaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3d3d3 +LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxp +YWIuKTElMCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEG +A1UEAxMqRW50cnVzdC5uZXQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgKDIwNDgp +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArU1LqRKGsuqjIAcVFmQq +K0vRvwtKTY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOLGp18EzoOH1u3Hs/lJBQe +sYGpjX24zGtLA/ECDNyrpUAkAH90lKGdCCmziAv1h3edVc3kw37XamSrhRSGlVuX +MlBvPci6Zgzj/L24ScF2iUkZ/cCovYmjZy/Gn7xxGWC4LeksyZB2ZnuU4q941mVT +XTzWnLLPKQP5L6RQstRIzgUyVYr9smRMDuSYB3Xbf9+5CFVghTAp+XtIpGmG4zU/ +HoZdenoVve8AjhUiVBcAkCaTvA5JaJG/+EfTnZVCwQ5N328mz8MYIWJmQ3DW1cAH +4QIDAQABo3QwcjARBglghkgBhvhCAQEEBAMCAAcwHwYDVR0jBBgwFoAUVeSB0RGA +vtiJuQijMfmhJAkWuXAwHQYDVR0OBBYEFFXkgdERgL7YibkIozH5oSQJFrlwMB0G +CSqGSIb2fQdBAAQQMA4bCFY1LjA6NC4wAwIEkDANBgkqhkiG9w0BAQUFAAOCAQEA +WUesIYSKF8mciVMeuoCFGsY8Tj6xnLZ8xpJdGGQC49MGCBFhfGPjK50xA3B20qMo +oPS7mmNz7W3lKtvtFKkrxjYR0CvrB4ul2p5cGZ1WEvVUKcgF7bISKo30Axv/55IQ +h7A6tcOdBTcSo8f0FbnVpDkWm1M6I5HxqIKiaohowXkCIryqptau37AUX7iH0N18 +f3v/rxzP5tsHrV7bhZ3QKw0z2wTR5klAEyt2+z7pnIkPFc4YsIV4IU9rTw76NmfN +B/L/CNDi3tm/Kq+4h4YhPATKt5Rof8886ZjXOP/swNlQ8C5LWK5Gb9Auw2DaclVy +vUxFnmG6v4SBkgPR0ml8xQ== +-----END CERTIFICATE----- + +# Issuer: CN=Baltimore CyberTrust Root O=Baltimore OU=CyberTrust +# Subject: CN=Baltimore CyberTrust Root O=Baltimore OU=CyberTrust +# Label: "Baltimore CyberTrust Root" +# Serial: 33554617 +# MD5 Fingerprint: ac:b6:94:a5:9c:17:e0:d7:91:52:9b:b1:97:06:a6:e4 +# SHA1 Fingerprint: d4:de:20:d0:5e:66:fc:53:fe:1a:50:88:2c:78:db:28:52:ca:e4:74 +# SHA256 Fingerprint: 16:af:57:a9:f6:76:b0:ab:12:60:95:aa:5e:ba:de:f2:2a:b3:11:19:d6:44:ac:95:cd:4b:93:db:f3:f2:6a:eb +-----BEGIN CERTIFICATE----- +MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJ +RTESMBAGA1UEChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYD +VQQDExlCYWx0aW1vcmUgQ3liZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoX +DTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMCSUUxEjAQBgNVBAoTCUJhbHRpbW9y +ZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFsdGltb3JlIEN5YmVy +VHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKMEuyKr +mD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjr +IZ3AQSsBUnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeK +mpYcqWe4PwzV9/lSEy/CG9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSu +XmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9XbIGevOF6uvUA65ehD5f/xXtabz5OTZy +dc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjprl3RjM71oGDHweI12v/ye +jl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoIVDaGezq1 +BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3 +DQEBBQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT92 +9hkTI7gQCvlYpNRhcL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3Wgx +jkzSswF07r51XgdIGn9w/xZchMB5hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0 +Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsaY71k5h+3zvDyny67G7fyUIhz +ksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9HRCwBXbsdtTLS +R9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp +-----END CERTIFICATE----- + +# Issuer: CN=Equifax Secure Global eBusiness CA-1 O=Equifax Secure Inc. +# Subject: CN=Equifax Secure Global eBusiness CA-1 O=Equifax Secure Inc. +# Label: "Equifax Secure Global eBusiness CA" +# Serial: 1 +# MD5 Fingerprint: 8f:5d:77:06:27:c4:98:3c:5b:93:78:e7:d7:7d:9b:cc +# SHA1 Fingerprint: 7e:78:4a:10:1c:82:65:cc:2d:e1:f1:6d:47:b4:40:ca:d9:0a:19:45 +# SHA256 Fingerprint: 5f:0b:62:ea:b5:e3:53:ea:65:21:65:16:58:fb:b6:53:59:f4:43:28:0a:4a:fb:d1:04:d7:7d:10:f9:f0:4c:07 +-----BEGIN CERTIFICATE----- +MIICkDCCAfmgAwIBAgIBATANBgkqhkiG9w0BAQQFADBaMQswCQYDVQQGEwJVUzEc +MBoGA1UEChMTRXF1aWZheCBTZWN1cmUgSW5jLjEtMCsGA1UEAxMkRXF1aWZheCBT +ZWN1cmUgR2xvYmFsIGVCdXNpbmVzcyBDQS0xMB4XDTk5MDYyMTA0MDAwMFoXDTIw +MDYyMTA0MDAwMFowWjELMAkGA1UEBhMCVVMxHDAaBgNVBAoTE0VxdWlmYXggU2Vj +dXJlIEluYy4xLTArBgNVBAMTJEVxdWlmYXggU2VjdXJlIEdsb2JhbCBlQnVzaW5l +c3MgQ0EtMTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAuucXkAJlsTRVPEnC +UdXfp9E3j9HngXNBUmCbnaEXJnitx7HoJpQytd4zjTov2/KaelpzmKNc6fuKcxtc +58O/gGzNqfTWK8D3+ZmqY6KxRwIP1ORROhI8bIpaVIRw28HFkM9yRcuoWcDNM50/ +o5brhTMhHD4ePmBudpxnhcXIw2ECAwEAAaNmMGQwEQYJYIZIAYb4QgEBBAQDAgAH +MA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUvqigdHJQa0S3ySPY+6j/s1dr +aGwwHQYDVR0OBBYEFL6ooHRyUGtEt8kj2Puo/7NXa2hsMA0GCSqGSIb3DQEBBAUA +A4GBADDiAVGqx+pf2rnQZQ8w1j7aDRRJbpGTJxQx78T3LUX47Me/okENI7SS+RkA +Z70Br83gcfxaz2TE4JaY0KNA4gGK7ycH8WUBikQtBmV1UsCGECAhX2xrD2yuCRyv +8qIYNMR1pHMc8Y3c7635s3a0kr/clRAevsvIO1qEYBlWlKlV +-----END CERTIFICATE----- + +# Issuer: CN=Equifax Secure eBusiness CA-1 O=Equifax Secure Inc. +# Subject: CN=Equifax Secure eBusiness CA-1 O=Equifax Secure Inc. +# Label: "Equifax Secure eBusiness CA 1" +# Serial: 4 +# MD5 Fingerprint: 64:9c:ef:2e:44:fc:c6:8f:52:07:d0:51:73:8f:cb:3d +# SHA1 Fingerprint: da:40:18:8b:91:89:a3:ed:ee:ae:da:97:fe:2f:9d:f5:b7:d1:8a:41 +# SHA256 Fingerprint: cf:56:ff:46:a4:a1:86:10:9d:d9:65:84:b5:ee:b5:8a:51:0c:42:75:b0:e5:f9:4f:40:bb:ae:86:5e:19:f6:73 +-----BEGIN CERTIFICATE----- +MIICgjCCAeugAwIBAgIBBDANBgkqhkiG9w0BAQQFADBTMQswCQYDVQQGEwJVUzEc +MBoGA1UEChMTRXF1aWZheCBTZWN1cmUgSW5jLjEmMCQGA1UEAxMdRXF1aWZheCBT +ZWN1cmUgZUJ1c2luZXNzIENBLTEwHhcNOTkwNjIxMDQwMDAwWhcNMjAwNjIxMDQw +MDAwWjBTMQswCQYDVQQGEwJVUzEcMBoGA1UEChMTRXF1aWZheCBTZWN1cmUgSW5j +LjEmMCQGA1UEAxMdRXF1aWZheCBTZWN1cmUgZUJ1c2luZXNzIENBLTEwgZ8wDQYJ +KoZIhvcNAQEBBQADgY0AMIGJAoGBAM4vGbwXt3fek6lfWg0XTzQaDJj0ItlZ1MRo +RvC0NcWFAyDGr0WlIVFFQesWWDYyb+JQYmT5/VGcqiTZ9J2DKocKIdMSODRsjQBu +WqDZQu4aIZX5UkxVWsUPOE9G+m34LjXWHXzr4vCwdYDIqROsvojvOm6rXyo4YgKw +Env+j6YDAgMBAAGjZjBkMBEGCWCGSAGG+EIBAQQEAwIABzAPBgNVHRMBAf8EBTAD +AQH/MB8GA1UdIwQYMBaAFEp4MlIR21kWNl7fwRQ2QGpHfEyhMB0GA1UdDgQWBBRK +eDJSEdtZFjZe38EUNkBqR3xMoTANBgkqhkiG9w0BAQQFAAOBgQB1W6ibAxHm6VZM +zfmpTMANmvPMZWnmJXbMWbfWVMMdzZmsGd20hdXgPfxiIKeES1hl8eL5lSE/9dR+ +WB5Hh1Q+WKG1tfgq73HnvMP2sUlG4tega+VWeponmHxGYhTnyfxuAxJ5gDgdSIKN +/Bf+KpYrtWKmpj29f5JZzVoqgrI3eQ== +-----END CERTIFICATE----- + +# Issuer: O=Equifax Secure OU=Equifax Secure eBusiness CA-2 +# Subject: O=Equifax Secure OU=Equifax Secure eBusiness CA-2 +# Label: "Equifax Secure eBusiness CA 2" +# Serial: 930140085 +# MD5 Fingerprint: aa:bf:bf:64:97:da:98:1d:6f:c6:08:3a:95:70:33:ca +# SHA1 Fingerprint: 39:4f:f6:85:0b:06:be:52:e5:18:56:cc:10:e1:80:e8:82:b3:85:cc +# SHA256 Fingerprint: 2f:27:4e:48:ab:a4:ac:7b:76:59:33:10:17:75:50:6d:c3:0e:e3:8e:f6:ac:d5:c0:49:32:cf:e0:41:23:42:20 +-----BEGIN CERTIFICATE----- +MIIDIDCCAomgAwIBAgIEN3DPtTANBgkqhkiG9w0BAQUFADBOMQswCQYDVQQGEwJV +UzEXMBUGA1UEChMORXF1aWZheCBTZWN1cmUxJjAkBgNVBAsTHUVxdWlmYXggU2Vj +dXJlIGVCdXNpbmVzcyBDQS0yMB4XDTk5MDYyMzEyMTQ0NVoXDTE5MDYyMzEyMTQ0 +NVowTjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDkVxdWlmYXggU2VjdXJlMSYwJAYD +VQQLEx1FcXVpZmF4IFNlY3VyZSBlQnVzaW5lc3MgQ0EtMjCBnzANBgkqhkiG9w0B +AQEFAAOBjQAwgYkCgYEA5Dk5kx5SBhsoNviyoynF7Y6yEb3+6+e0dMKP/wXn2Z0G +vxLIPw7y1tEkshHe0XMJitSxLJgJDR5QRrKDpkWNYmi7hRsgcDKqQM2mll/EcTc/ +BPO3QSQ5BxoeLmFYoBIL5aXfxavqN3HMHMg3OrmXUqesxWoklE6ce8/AatbfIb0C +AwEAAaOCAQkwggEFMHAGA1UdHwRpMGcwZaBjoGGkXzBdMQswCQYDVQQGEwJVUzEX +MBUGA1UEChMORXF1aWZheCBTZWN1cmUxJjAkBgNVBAsTHUVxdWlmYXggU2VjdXJl +IGVCdXNpbmVzcyBDQS0yMQ0wCwYDVQQDEwRDUkwxMBoGA1UdEAQTMBGBDzIwMTkw +NjIzMTIxNDQ1WjALBgNVHQ8EBAMCAQYwHwYDVR0jBBgwFoAUUJ4L6q9euSBIplBq +y/3YIHqngnYwHQYDVR0OBBYEFFCeC+qvXrkgSKZQasv92CB6p4J2MAwGA1UdEwQF +MAMBAf8wGgYJKoZIhvZ9B0EABA0wCxsFVjMuMGMDAgbAMA0GCSqGSIb3DQEBBQUA +A4GBAAyGgq3oThr1jokn4jVYPSm0B482UJW/bsGe68SQsoWou7dC4A8HOd/7npCy +0cE+U58DRLB+S/Rv5Hwf5+Kx5Lia78O9zt4LMjTZ3ijtM2vE1Nc9ElirfQkty3D1 +E4qUoSek1nDFbZS1yX2doNLGCEnZZpum0/QL3MUmV+GRMOrN +-----END CERTIFICATE----- + +# Issuer: CN=AddTrust Class 1 CA Root O=AddTrust AB OU=AddTrust TTP Network +# Subject: CN=AddTrust Class 1 CA Root O=AddTrust AB OU=AddTrust TTP Network +# Label: "AddTrust Low-Value Services Root" +# Serial: 1 +# MD5 Fingerprint: 1e:42:95:02:33:92:6b:b9:5f:c0:7f:da:d6:b2:4b:fc +# SHA1 Fingerprint: cc:ab:0e:a0:4c:23:01:d6:69:7b:dd:37:9f:cd:12:eb:24:e3:94:9d +# SHA256 Fingerprint: 8c:72:09:27:9a:c0:4e:27:5e:16:d0:7f:d3:b7:75:e8:01:54:b5:96:80:46:e3:1f:52:dd:25:76:63:24:e9:a7 +-----BEGIN CERTIFICATE----- +MIIEGDCCAwCgAwIBAgIBATANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQGEwJTRTEU +MBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3 +b3JrMSEwHwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3QwHhcNMDAwNTMw +MTAzODMxWhcNMjAwNTMwMTAzODMxWjBlMQswCQYDVQQGEwJTRTEUMBIGA1UEChML +QWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3b3JrMSEwHwYD +VQQDExhBZGRUcnVzdCBDbGFzcyAxIENBIFJvb3QwggEiMA0GCSqGSIb3DQEBAQUA +A4IBDwAwggEKAoIBAQCWltQhSWDia+hBBwzexODcEyPNwTXH+9ZOEQpnXvUGW2ul +CDtbKRY654eyNAbFvAWlA3yCyykQruGIgb3WntP+LVbBFc7jJp0VLhD7Bo8wBN6n +tGO0/7Gcrjyvd7ZWxbWroulpOj0OM3kyP3CCkplhbY0wCI9xP6ZIVxn4JdxLZlyl +dI+Yrsj5wAYi56xz36Uu+1LcsRVlIPo1Zmne3yzxbrww2ywkEtvrNTVokMsAsJch +PXQhI2U0K7t4WaPW4XY5mqRJjox0r26kmqPZm9I4XJuiGMx1I4S+6+JNM3GOGvDC ++Mcdoq0Dlyz4zyXG9rgkMbFjXZJ/Y/AlyVMuH79NAgMBAAGjgdIwgc8wHQYDVR0O +BBYEFJWxtPCUtr3H2tERCSG+wa9J/RB7MAsGA1UdDwQEAwIBBjAPBgNVHRMBAf8E +BTADAQH/MIGPBgNVHSMEgYcwgYSAFJWxtPCUtr3H2tERCSG+wa9J/RB7oWmkZzBl +MQswCQYDVQQGEwJTRTEUMBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFk +ZFRydXN0IFRUUCBOZXR3b3JrMSEwHwYDVQQDExhBZGRUcnVzdCBDbGFzcyAxIENB +IFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBACxtZBsfzQ3duQH6lmM0MkhHma6X +7f1yFqZzR1r0693p9db7RcwpiURdv0Y5PejuvE1Uhh4dbOMXJ0PhiVYrqW9yTkkz +43J8KiOavD7/KCrto/8cI7pDVwlnTUtiBi34/2ydYB7YHEt9tTEv2dB8Xfjea4MY +eDdXL+gzB2ffHsdrKpV2ro9Xo/D0UrSpUwjP4E/TelOL/bscVjby/rK25Xa71SJl +pz/+0WatC7xrmYbvP33zGDLKe8bjq2RGlfgmadlVg3sslgf/WSxEo8bl6ancoWOA +WiFeIc9TVPC6b4nbqKqVz4vjccweGyBECMB6tkD9xOQ14R0WHNC8K47Wcdk= +-----END CERTIFICATE----- + +# Issuer: CN=AddTrust External CA Root O=AddTrust AB OU=AddTrust External TTP Network +# Subject: CN=AddTrust External CA Root O=AddTrust AB OU=AddTrust External TTP Network +# Label: "AddTrust External Root" +# Serial: 1 +# MD5 Fingerprint: 1d:35:54:04:85:78:b0:3f:42:42:4d:bf:20:73:0a:3f +# SHA1 Fingerprint: 02:fa:f3:e2:91:43:54:68:60:78:57:69:4d:f5:e4:5b:68:85:18:68 +# SHA256 Fingerprint: 68:7f:a4:51:38:22:78:ff:f0:c8:b1:1f:8d:43:d5:76:67:1c:6e:b2:bc:ea:b4:13:fb:83:d9:65:d0:6d:2f:f2 +-----BEGIN CERTIFICATE----- +MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEU +MBIGA1UEChMLQWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFs +IFRUUCBOZXR3b3JrMSIwIAYDVQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290 +MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEwNDgzOFowbzELMAkGA1UEBhMCU0Ux +FDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRUcnVzdCBFeHRlcm5h +bCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0EgUm9v +dDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvt +H7xsD821+iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9 +uMq/NzgtHj6RQa1wVsfwTz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzX +mk6vBbOmcZSccbNQYArHE504B4YCqOmoaSYYkKtMsE8jqzpPhNjfzp/haW+710LX +a0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy2xSoRcRdKn23tNbE7qzN +E0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv77+ldU9U0 +WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYD +VR0PBAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0 +Jvf6xCZU7wO94CTLVBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRU +cnVzdCBBQjEmMCQGA1UECxMdQWRkVHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsx +IjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENBIFJvb3SCAQEwDQYJKoZIhvcN +AQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZlj7DYd7usQWxH +YINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5 +6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvC +Nr4TDea9Y355e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEX +c4g/VhsxOBi0cQ+azcgOno4uG+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5a +mnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ= +-----END CERTIFICATE----- + +# Issuer: CN=AddTrust Public CA Root O=AddTrust AB OU=AddTrust TTP Network +# Subject: CN=AddTrust Public CA Root O=AddTrust AB OU=AddTrust TTP Network +# Label: "AddTrust Public Services Root" +# Serial: 1 +# MD5 Fingerprint: c1:62:3e:23:c5:82:73:9c:03:59:4b:2b:e9:77:49:7f +# SHA1 Fingerprint: 2a:b6:28:48:5e:78:fb:f3:ad:9e:79:10:dd:6b:df:99:72:2c:96:e5 +# SHA256 Fingerprint: 07:91:ca:07:49:b2:07:82:aa:d3:c7:d7:bd:0c:df:c9:48:58:35:84:3e:b2:d7:99:60:09:ce:43:ab:6c:69:27 +-----BEGIN CERTIFICATE----- +MIIEFTCCAv2gAwIBAgIBATANBgkqhkiG9w0BAQUFADBkMQswCQYDVQQGEwJTRTEU +MBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3 +b3JrMSAwHgYDVQQDExdBZGRUcnVzdCBQdWJsaWMgQ0EgUm9vdDAeFw0wMDA1MzAx +MDQxNTBaFw0yMDA1MzAxMDQxNTBaMGQxCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtB +ZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQIE5ldHdvcmsxIDAeBgNV +BAMTF0FkZFRydXN0IFB1YmxpYyBDQSBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOC +AQ8AMIIBCgKCAQEA6Rowj4OIFMEg2Dybjxt+A3S72mnTRqX4jsIMEZBRpS9mVEBV +6tsfSlbunyNu9DnLoblv8n75XYcmYZ4c+OLspoH4IcUkzBEMP9smcnrHAZcHF/nX +GCwwfQ56HmIexkvA/X1id9NEHif2P0tEs7c42TkfYNVRknMDtABp4/MUTu7R3AnP +dzRGULD4EfL+OHn3Bzn+UZKXC1sIXzSGAa2Il+tmzV7R/9x98oTaunet3IAIx6eH +1lWfl2royBFkuucZKT8Rs3iQhCBSWxHveNCD9tVIkNAwHM+A+WD+eeSI8t0A65RF +62WUaUC6wNW0uLp9BBGo6zEFlpROWCGOn9Bg/QIDAQABo4HRMIHOMB0GA1UdDgQW +BBSBPjfYkrAfd59ctKtzquf2NGAv+jALBgNVHQ8EBAMCAQYwDwYDVR0TAQH/BAUw +AwEB/zCBjgYDVR0jBIGGMIGDgBSBPjfYkrAfd59ctKtzquf2NGAv+qFopGYwZDEL +MAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQLExRBZGRU +cnVzdCBUVFAgTmV0d29yazEgMB4GA1UEAxMXQWRkVHJ1c3QgUHVibGljIENBIFJv +b3SCAQEwDQYJKoZIhvcNAQEFBQADggEBAAP3FUr4JNojVhaTdt02KLmuG7jD8WS6 +IBh4lSknVwW8fCr0uVFV2ocC3g8WFzH4qnkuCRO7r7IgGRLlk/lL+YPoRNWyQSW/ +iHVv/xD8SlTQX/D67zZzfRs2RcYhbbQVuE7PnFylPVoAjgbjPGsye/Kf8Lb93/Ao +GEjwxrzQvzSAlsJKsW2Ox5BF3i9nrEUEo3rcVZLJR2bYGozH7ZxOmuASu7VqTITh +4SINhwBk/ox9Yjllpu9CtoAlEmEBqCQTcAARJl/6NVDFSMwGR+gn2HCNX2TmoUQm +XiLsks3/QppEIW1cxeMiHV9HEufOX1362KqxMy3ZdvJOOjMMK7MtkAY= +-----END CERTIFICATE----- + +# Issuer: CN=AddTrust Qualified CA Root O=AddTrust AB OU=AddTrust TTP Network +# Subject: CN=AddTrust Qualified CA Root O=AddTrust AB OU=AddTrust TTP Network +# Label: "AddTrust Qualified Certificates Root" +# Serial: 1 +# MD5 Fingerprint: 27:ec:39:47:cd:da:5a:af:e2:9a:01:65:21:a9:4c:bb +# SHA1 Fingerprint: 4d:23:78:ec:91:95:39:b5:00:7f:75:8f:03:3b:21:1e:c5:4d:8b:cf +# SHA256 Fingerprint: 80:95:21:08:05:db:4b:bc:35:5e:44:28:d8:fd:6e:c2:cd:e3:ab:5f:b9:7a:99:42:98:8e:b8:f4:dc:d0:60:16 +-----BEGIN CERTIFICATE----- +MIIEHjCCAwagAwIBAgIBATANBgkqhkiG9w0BAQUFADBnMQswCQYDVQQGEwJTRTEU +MBIGA1UEChMLQWRkVHJ1c3QgQUIxHTAbBgNVBAsTFEFkZFRydXN0IFRUUCBOZXR3 +b3JrMSMwIQYDVQQDExpBZGRUcnVzdCBRdWFsaWZpZWQgQ0EgUm9vdDAeFw0wMDA1 +MzAxMDQ0NTBaFw0yMDA1MzAxMDQ0NTBaMGcxCzAJBgNVBAYTAlNFMRQwEgYDVQQK +EwtBZGRUcnVzdCBBQjEdMBsGA1UECxMUQWRkVHJ1c3QgVFRQIE5ldHdvcmsxIzAh +BgNVBAMTGkFkZFRydXN0IFF1YWxpZmllZCBDQSBSb290MIIBIjANBgkqhkiG9w0B +AQEFAAOCAQ8AMIIBCgKCAQEA5B6a/twJWoekn0e+EV+vhDTbYjx5eLfpMLXsDBwq +xBb/4Oxx64r1EW7tTw2R0hIYLUkVAcKkIhPHEWT/IhKauY5cLwjPcWqzZwFZ8V1G +87B4pfYOQnrjfxvM0PC3KP0q6p6zsLkEqv32x7SxuCqg+1jxGaBvcCV+PmlKfw8i +2O+tCBGaKZnhqkRFmhJePp1tUvznoD1oL/BLcHwTOK28FSXx1s6rosAx1i+f4P8U +WfyEk9mHfExUE+uf0S0R+Bg6Ot4l2ffTQO2kBhLEO+GRwVY18BTcZTYJbqukB8c1 +0cIDMzZbdSZtQvESa0NvS3GU+jQd7RNuyoB/mC9suWXY6QIDAQABo4HUMIHRMB0G +A1UdDgQWBBQ5lYtii1zJ1IC6WA+XPxUIQ8yYpzALBgNVHQ8EBAMCAQYwDwYDVR0T +AQH/BAUwAwEB/zCBkQYDVR0jBIGJMIGGgBQ5lYtii1zJ1IC6WA+XPxUIQ8yYp6Fr +pGkwZzELMAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMR0wGwYDVQQL +ExRBZGRUcnVzdCBUVFAgTmV0d29yazEjMCEGA1UEAxMaQWRkVHJ1c3QgUXVhbGlm +aWVkIENBIFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBABmrder4i2VhlRO6aQTv +hsoToMeqT2QbPxj2qC0sVY8FtzDqQmodwCVRLae/DLPt7wh/bDxGGuoYQ992zPlm +hpwsaPXpF/gxsxjE1kh9I0xowX67ARRvxdlu3rsEQmr49lx95dr6h+sNNVJn0J6X +dgWTP5XHAeZpVTh/EGGZyeNfpso+gmNIquIISD6q8rKFYqa0p9m9N5xotS1WfbC3 +P6CxB9bpT9zeRXEwMn8bLgn5v1Kh7sKAPgZcLlVAwRv1cEWw3F369nJad9Jjzc9Y +iQBCYz95OdBEsIJuQRno3eDBiFrRHnGTHyQwdOUeqN48Jzd/g66ed8/wMLH/S5no +xqE= +-----END CERTIFICATE----- + +# Issuer: CN=Entrust Root Certification Authority O=Entrust, Inc. OU=www.entrust.net/CPS is incorporated by reference/(c) 2006 Entrust, Inc. +# Subject: CN=Entrust Root Certification Authority O=Entrust, Inc. OU=www.entrust.net/CPS is incorporated by reference/(c) 2006 Entrust, Inc. +# Label: "Entrust Root Certification Authority" +# Serial: 1164660820 +# MD5 Fingerprint: d6:a5:c3:ed:5d:dd:3e:00:c1:3d:87:92:1f:1d:3f:e4 +# SHA1 Fingerprint: b3:1e:b1:b7:40:e3:6c:84:02:da:dc:37:d4:4d:f5:d4:67:49:52:f9 +# SHA256 Fingerprint: 73:c1:76:43:4f:1b:c6:d5:ad:f4:5b:0e:76:e7:27:28:7c:8d:e5:76:16:c1:e6:e6:14:1a:2b:2c:bc:7d:8e:4c +-----BEGIN CERTIFICATE----- +MIIEkTCCA3mgAwIBAgIERWtQVDANBgkqhkiG9w0BAQUFADCBsDELMAkGA1UEBhMC +VVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5lbnRydXN0 +Lm5ldC9DUFMgaXMgaW5jb3Jwb3JhdGVkIGJ5IHJlZmVyZW5jZTEfMB0GA1UECxMW +KGMpIDIwMDYgRW50cnVzdCwgSW5jLjEtMCsGA1UEAxMkRW50cnVzdCBSb290IENl +cnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA2MTEyNzIwMjM0MloXDTI2MTEyNzIw +NTM0MlowgbAxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMTkw +NwYDVQQLEzB3d3cuZW50cnVzdC5uZXQvQ1BTIGlzIGluY29ycG9yYXRlZCBieSBy +ZWZlcmVuY2UxHzAdBgNVBAsTFihjKSAyMDA2IEVudHJ1c3QsIEluYy4xLTArBgNV +BAMTJEVudHJ1c3QgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASIwDQYJ +KoZIhvcNAQEBBQADggEPADCCAQoCggEBALaVtkNC+sZtKm9I35RMOVcF7sN5EUFo +Nu3s/poBj6E4KPz3EEZmLk0eGrEaTsbRwJWIsMn/MYszA9u3g3s+IIRe7bJWKKf4 +4LlAcTfFy0cOlypowCKVYhXbR9n10Cv/gkvJrT7eTNuQgFA/CYqEAOwwCj0Yzfv9 +KlmaI5UXLEWeH25DeW0MXJj+SKfFI0dcXv1u5x609mhF0YaDW6KKjbHjKYD+JXGI +rb68j6xSlkuqUY3kEzEZ6E5Nn9uss2rVvDlUccp6en+Q3X0dgNmBu1kmwhH+5pPi +94DkZfs0Nw4pgHBNrziGLp5/V6+eF67rHMsoIV+2HNjnogQi+dPa2MsCAwEAAaOB +sDCBrTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zArBgNVHRAEJDAi +gA8yMDA2MTEyNzIwMjM0MlqBDzIwMjYxMTI3MjA1MzQyWjAfBgNVHSMEGDAWgBRo +kORnpKZTgMeGZqTx90tD+4S9bTAdBgNVHQ4EFgQUaJDkZ6SmU4DHhmak8fdLQ/uE +vW0wHQYJKoZIhvZ9B0EABBAwDhsIVjcuMTo0LjADAgSQMA0GCSqGSIb3DQEBBQUA +A4IBAQCT1DCw1wMgKtD5Y+iRDAUgqV8ZyntyTtSx29CW+1RaGSwMCPeyvIWonX9t +O1KzKtvn1ISMY/YPyyYBkVBs9F8U4pN0wBOeMDpQ47RgxRzwIkSNcUesyBrJ6Zua +AGAT/3B+XxFNSRuzFVJ7yVTav52Vr2ua2J7p8eRDjeIRRDq/r72DQnNSi6q7pynP +9WQcCk3RvKqsnyrQ/39/2n3qse0wJcGE2jTSW3iDVuycNsMm4hH2Z0kdkquM++v/ +eu6FSqdQgPCnXEqULl8FmTxSQeDNtGPPAUO6nIPcj2A781q0tHuu2guQOHXvgR1m +0vdXcDazv/wor3ElhVsT/h5/WrQ8 +-----END CERTIFICATE----- + +# Issuer: CN=GeoTrust Global CA O=GeoTrust Inc. +# Subject: CN=GeoTrust Global CA O=GeoTrust Inc. +# Label: "GeoTrust Global CA" +# Serial: 144470 +# MD5 Fingerprint: f7:75:ab:29:fb:51:4e:b7:77:5e:ff:05:3c:99:8e:f5 +# SHA1 Fingerprint: de:28:f4:a4:ff:e5:b9:2f:a3:c5:03:d1:a3:49:a7:f9:96:2a:82:12 +# SHA256 Fingerprint: ff:85:6a:2d:25:1d:cd:88:d3:66:56:f4:50:12:67:98:cf:ab:aa:de:40:79:9c:72:2d:e4:d2:b5:db:36:a7:3a +-----BEGIN CERTIFICATE----- +MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVT +MRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9i +YWwgQ0EwHhcNMDIwNTIxMDQwMDAwWhcNMjIwNTIxMDQwMDAwWjBCMQswCQYDVQQG +EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEbMBkGA1UEAxMSR2VvVHJ1c3Qg +R2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2swYYzD9 +9BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9mOSm9BXiLnTjoBbdq +fnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDv +iS2Aelet8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU +1XupGc1V3sjs0l44U+VcT4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+ +bw8HHa8sHo9gOeL6NlMTOdReJivbPagUvTLrGAMoUgRx5aszPeE4uwc2hGKceeoW +MPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTA +ephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVkDBF9qn1l +uMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKIn +Z57QzxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfS +tQWVYrmm3ok9Nns4d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcF +PseKUgzbFbS9bZvlxrFUaKnjaZC2mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Un +hw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6pXE0zX5IJL4hmXXeXxx12E6nV +5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvmMw== +-----END CERTIFICATE----- + +# Issuer: CN=GeoTrust Global CA 2 O=GeoTrust Inc. +# Subject: CN=GeoTrust Global CA 2 O=GeoTrust Inc. +# Label: "GeoTrust Global CA 2" +# Serial: 1 +# MD5 Fingerprint: 0e:40:a7:6c:de:03:5d:8f:d1:0f:e4:d1:8d:f9:6c:a9 +# SHA1 Fingerprint: a9:e9:78:08:14:37:58:88:f2:05:19:b0:6d:2b:0d:2b:60:16:90:7d +# SHA256 Fingerprint: ca:2d:82:a0:86:77:07:2f:8a:b6:76:4f:f0:35:67:6c:fe:3e:5e:32:5e:01:21:72:df:3f:92:09:6d:b7:9b:85 +-----BEGIN CERTIFICATE----- +MIIDZjCCAk6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBEMQswCQYDVQQGEwJVUzEW +MBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEdMBsGA1UEAxMUR2VvVHJ1c3QgR2xvYmFs +IENBIDIwHhcNMDQwMzA0MDUwMDAwWhcNMTkwMzA0MDUwMDAwWjBEMQswCQYDVQQG +EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEdMBsGA1UEAxMUR2VvVHJ1c3Qg +R2xvYmFsIENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDvPE1A +PRDfO1MA4Wf+lGAVPoWI8YkNkMgoI5kF6CsgncbzYEbYwbLVjDHZ3CB5JIG/NTL8 +Y2nbsSpr7iFY8gjpeMtvy/wWUsiRxP89c96xPqfCfWbB9X5SJBri1WeR0IIQ13hL +TytCOb1kLUCgsBDTOEhGiKEMuzozKmKY+wCdE1l/bztyqu6mD4b5BWHqZ38MN5aL +5mkWRxHCJ1kDs6ZgwiFAVvqgx306E+PsV8ez1q6diYD3Aecs9pYrEw15LNnA5IZ7 +S4wMcoKK+xfNAGw6EzywhIdLFnopsk/bHdQL82Y3vdj2V7teJHq4PIu5+pIaGoSe +2HSPqht/XvT+RSIhAgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE +FHE4NvICMVNHK266ZUapEBVYIAUJMB8GA1UdIwQYMBaAFHE4NvICMVNHK266ZUap +EBVYIAUJMA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQUFAAOCAQEAA/e1K6td +EPx7srJerJsOflN4WT5CBP51o62sgU7XAotexC3IUnbHLB/8gTKY0UvGkpMzNTEv +/NgdRN3ggX+d6YvhZJFiCzkIjKx0nVnZellSlxG5FntvRdOW2TF9AjYPnDtuzywN +A0ZF66D0f0hExghAzN4bcLUprbqLOzRldRtxIR0sFAqwlpW41uryZfspuk/qkZN0 +abby/+Ea0AzRdoXLiiW9l14sbxWZJue2Kf8i7MkCx1YAzUm5s2x7UwQa4qjJqhIF +I8LO57sEAszAR6LkxCkvW0VXiVHuPOtSCP8HNR6fNWpHSlaY0VqFH4z1Ir+rzoPz +4iIprn2DQKi6bA== +-----END CERTIFICATE----- + +# Issuer: CN=GeoTrust Universal CA O=GeoTrust Inc. +# Subject: CN=GeoTrust Universal CA O=GeoTrust Inc. +# Label: "GeoTrust Universal CA" +# Serial: 1 +# MD5 Fingerprint: 92:65:58:8b:a2:1a:31:72:73:68:5c:b4:a5:7a:07:48 +# SHA1 Fingerprint: e6:21:f3:35:43:79:05:9a:4b:68:30:9d:8a:2f:74:22:15:87:ec:79 +# SHA256 Fingerprint: a0:45:9b:9f:63:b2:25:59:f5:fa:5d:4c:6d:b3:f9:f7:2f:f1:93:42:03:35:78:f0:73:bf:1d:1b:46:cb:b9:12 +-----BEGIN CERTIFICATE----- +MIIFaDCCA1CgAwIBAgIBATANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJVUzEW +MBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEeMBwGA1UEAxMVR2VvVHJ1c3QgVW5pdmVy +c2FsIENBMB4XDTA0MDMwNDA1MDAwMFoXDTI5MDMwNDA1MDAwMFowRTELMAkGA1UE +BhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xHjAcBgNVBAMTFUdlb1RydXN0 +IFVuaXZlcnNhbCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAKYV +VaCjxuAfjJ0hUNfBvitbtaSeodlyWL0AG0y/YckUHUWCq8YdgNY96xCcOq9tJPi8 +cQGeBvV8Xx7BDlXKg5pZMK4ZyzBIle0iN430SppyZj6tlcDgFgDgEB8rMQ7XlFTT +QjOgNB0eRXbdT8oYN+yFFXoZCPzVx5zw8qkuEKmS5j1YPakWaDwvdSEYfyh3peFh +F7em6fgemdtzbvQKoiFs7tqqhZJmr/Z6a4LauiIINQ/PQvE1+mrufislzDoR5G2v +c7J2Ha3QsnhnGqQ5HFELZ1aD/ThdDc7d8Lsrlh/eezJS/R27tQahsiFepdaVaH/w +mZ7cRQg+59IJDTWU3YBOU5fXtQlEIGQWFwMCTFMNaN7VqnJNk22CDtucvc+081xd +VHppCZbW2xHBjXWotM85yM48vCR85mLK4b19p71XZQvk/iXttmkQ3CgaRr0BHdCX +teGYO8A3ZNY9lO4L4fUorgtWv3GLIylBjobFS1J72HGrH4oVpjuDWtdYAVHGTEHZ +f9hBZ3KiKN9gg6meyHv8U3NyWfWTehd2Ds735VzZC1U0oqpbtWpU5xPKV+yXbfRe +Bi9Fi1jUIxaS5BZuKGNZMN9QAZxjiRqf2xeUgnA3wySemkfWWspOqGmJch+RbNt+ +nhutxx9z3SxPGWX9f5NAEC7S8O08ni4oPmkmM8V7AgMBAAGjYzBhMA8GA1UdEwEB +/wQFMAMBAf8wHQYDVR0OBBYEFNq7LqqwDLiIJlF0XG0D08DYj3rWMB8GA1UdIwQY +MBaAFNq7LqqwDLiIJlF0XG0D08DYj3rWMA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG +9w0BAQUFAAOCAgEAMXjmx7XfuJRAyXHEqDXsRh3ChfMoWIawC/yOsjmPRFWrZIRc +aanQmjg8+uUfNeVE44B5lGiku8SfPeE0zTBGi1QrlaXv9z+ZhP015s8xxtxqv6fX +IwjhmF7DWgh2qaavdy+3YL1ERmrvl/9zlcGO6JP7/TG37FcREUWbMPEaiDnBTzyn +ANXH/KttgCJwpQzgXQQpAvvLoJHRfNbDflDVnVi+QTjruXU8FdmbyUqDWcDaU/0z +uzYYm4UPFd3uLax2k7nZAY1IEKj79TiG8dsKxr2EoyNB3tZ3b4XUhRxQ4K5RirqN +Pnbiucon8l+f725ZDQbYKxek0nxru18UGkiPGkzns0ccjkxFKyDuSN/n3QmOGKja +QI2SJhFTYXNd673nxE0pN2HrrDktZy4W1vUAg4WhzH92xH3kt0tm7wNFYGm2DFKW +koRepqO1pD4r2czYG0eq8kTaT/kD6PAUyz/zg97QwVTjt+gKN02LIFkDMBmhLMi9 +ER/frslKxfMnZmaGrGiR/9nmUxwPi1xpZQomyB40w11Re9epnAahNt3ViZS82eQt +DF4JbAiXfKM9fJP/P6EUp8+1Xevb2xzEdt+Iub1FBZUbrvxGakyvSOPOrg/Sfuvm +bJxPgWp6ZKy7PtXny3YuxadIwVyQD8vIP/rmMuGNG2+k5o7Y+SlIis5z/iw= +-----END CERTIFICATE----- + +# Issuer: CN=GeoTrust Universal CA 2 O=GeoTrust Inc. +# Subject: CN=GeoTrust Universal CA 2 O=GeoTrust Inc. +# Label: "GeoTrust Universal CA 2" +# Serial: 1 +# MD5 Fingerprint: 34:fc:b8:d0:36:db:9e:14:b3:c2:f2:db:8f:e4:94:c7 +# SHA1 Fingerprint: 37:9a:19:7b:41:85:45:35:0c:a6:03:69:f3:3c:2e:af:47:4f:20:79 +# SHA256 Fingerprint: a0:23:4f:3b:c8:52:7c:a5:62:8e:ec:81:ad:5d:69:89:5d:a5:68:0d:c9:1d:1c:b8:47:7f:33:f8:78:b9:5b:0b +-----BEGIN CERTIFICATE----- +MIIFbDCCA1SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBHMQswCQYDVQQGEwJVUzEW +MBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVy +c2FsIENBIDIwHhcNMDQwMzA0MDUwMDAwWhcNMjkwMzA0MDUwMDAwWjBHMQswCQYD +VQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMXR2VvVHJ1 +c3QgVW5pdmVyc2FsIENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +AQCzVFLByT7y2dyxUxpZKeexw0Uo5dfR7cXFS6GqdHtXr0om/Nj1XqduGdt0DE81 +WzILAePb63p3NeqqWuDW6KFXlPCQo3RWlEQwAx5cTiuFJnSCegx2oG9NzkEtoBUG +FF+3Qs17j1hhNNwqCPkuwwGmIkQcTAeC5lvO0Ep8BNMZcyfwqph/Lq9O64ceJHdq +XbboW0W63MOhBW9Wjo8QJqVJwy7XQYci4E+GymC16qFjwAGXEHm9ADwSbSsVsaxL +se4YuU6W3Nx2/zu+z18DwPw76L5GG//aQMJS9/7jOvdqdzXQ2o3rXhhqMcceujwb +KNZrVMaqW9eiLBsZzKIC9ptZvTdrhrVtgrrY6slWvKk2WP0+GfPtDCapkzj4T8Fd +IgbQl+rhrcZV4IErKIM6+vR7IVEAvlI4zs1meaj0gVbi0IMJR1FbUGrP20gaXT73 +y/Zl92zxlfgCOzJWgjl6W70viRu/obTo/3+NjN8D8WBOWBFM66M/ECuDmgFz2ZRt +hAAnZqzwcEAJQpKtT5MNYQlRJNiS1QuUYbKHsu3/mjX/hVTK7URDrBs8FmtISgoc +QIgfksILAAX/8sgCSqSqqcyZlpwvWOB94b67B9xfBHJcMTTD7F8t4D1kkCLm0ey4 +Lt1ZrtmhN79UNdxzMk+MBB4zsslG8dhcyFVQyWi9qLo2CQIDAQABo2MwYTAPBgNV +HRMBAf8EBTADAQH/MB0GA1UdDgQWBBR281Xh+qQ2+/CfXGJx7Tz0RzgQKzAfBgNV +HSMEGDAWgBR281Xh+qQ2+/CfXGJx7Tz0RzgQKzAOBgNVHQ8BAf8EBAMCAYYwDQYJ +KoZIhvcNAQEFBQADggIBAGbBxiPz2eAubl/oz66wsCVNK/g7WJtAJDday6sWSf+z +dXkzoS9tcBc0kf5nfo/sm+VegqlVHy/c1FEHEv6sFj4sNcZj/NwQ6w2jqtB8zNHQ +L1EuxBRa3ugZ4T7GzKQp5y6EqgYweHZUcyiYWTjgAA1i00J9IZ+uPTqM1fp3DRgr +Fg5fNuH8KrUwJM/gYwx7WBr+mbpCErGR9Hxo4sjoryzqyX6uuyo9DRXcNJW2GHSo +ag/HtPQTxORb7QrSpJdMKu0vbBKJPfEncKpqA1Ihn0CoZ1Dy81of398j9tx4TuaY +T1U6U+Pv8vSfx3zYWK8pIpe44L2RLrB27FcRz+8pRPPphXpgY+RdM4kX2TGq2tbz +GDVyz4crL2MjhF2EjD9XoIj8mZEoJmmZ1I+XRL6O1UixpCgp8RW04eWe3fiPpm8m +1wk8OhwRDqZsN/etRIcsKMfYdIKz0G9KV7s1KSegi+ghp4dkNl3M2Basx7InQJJV +OCiNUW7dFGdTbHFcJoRNdVq2fmBWqU2t+5sel/MN2dKXVHfaPRK34B7vCAas+YWH +6aLcr34YEoP9VhdBLtUpgn2Z9DH2canPLAEnpQW5qrJITirvn5NSUZU8UnOOVkwX +QMAJKOSLakhT2+zNVVXxxvjpoixMptEmX36vWkzaH6byHCx+rgIW0lbQL1dTR+iS +-----END CERTIFICATE----- + +# Issuer: CN=America Online Root Certification Authority 1 O=America Online Inc. +# Subject: CN=America Online Root Certification Authority 1 O=America Online Inc. +# Label: "America Online Root Certification Authority 1" +# Serial: 1 +# MD5 Fingerprint: 14:f1:08:ad:9d:fa:64:e2:89:e7:1c:cf:a8:ad:7d:5e +# SHA1 Fingerprint: 39:21:c1:15:c1:5d:0e:ca:5c:cb:5b:c4:f0:7d:21:d8:05:0b:56:6a +# SHA256 Fingerprint: 77:40:73:12:c6:3a:15:3d:5b:c0:0b:4e:51:75:9c:df:da:c2:37:dc:2a:33:b6:79:46:e9:8e:9b:fa:68:0a:e3 +-----BEGIN CERTIFICATE----- +MIIDpDCCAoygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEc +MBoGA1UEChMTQW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBP +bmxpbmUgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAxMB4XDTAyMDUyODA2 +MDAwMFoXDTM3MTExOTIwNDMwMFowYzELMAkGA1UEBhMCVVMxHDAaBgNVBAoTE0Ft +ZXJpY2EgT25saW5lIEluYy4xNjA0BgNVBAMTLUFtZXJpY2EgT25saW5lIFJvb3Qg +Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMTCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBAKgv6KRpBgNHw+kqmP8ZonCaxlCyfqXfaE0bfA+2l2h9LaaLl+lk +hsmj76CGv2BlnEtUiMJIxUo5vxTjWVXlGbR0yLQFOVwWpeKVBeASrlmLojNoWBym +1BW32J/X3HGrfpq/m44zDyL9Hy7nBzbvYjnF3cu6JRQj3gzGPTzOggjmZj7aUTsW +OqMFf6Dch9Wc/HKpoH145LcxVR5lu9RhsCFg7RAycsWSJR74kEoYeEfffjA3PlAb +2xzTa5qGUwew76wGePiEmf4hjUyAtgyC9mZweRrTT6PP8c9GsEsPPt2IYriMqQko +O3rHl+Ee5fSfwMCuJKDIodkP1nsmgmkyPacCAwEAAaNjMGEwDwYDVR0TAQH/BAUw +AwEB/zAdBgNVHQ4EFgQUAK3Zo/Z59m50qX8zPYEX10zPM94wHwYDVR0jBBgwFoAU +AK3Zo/Z59m50qX8zPYEX10zPM94wDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEB +BQUAA4IBAQB8itEfGDeC4Liwo+1WlchiYZwFos3CYiZhzRAW18y0ZTTQEYqtqKkF +Zu90821fnZmv9ov761KyBZiibyrFVL0lvV+uyIbqRizBs73B6UlwGBaXCBOMIOAb +LjpHyx7kADCVW/RFo8AasAFOq73AI25jP4BKxQft3OJvx8Fi8eNy1gTIdGcL+oir +oQHIb/AUr9KZzVGTfu0uOMe9zkZQPXLjeSWdm4grECDdpbgyn43gKd8hdIaC2y+C +MMbHNYaz+ZZfRtsMRf3zUMNvxsNIrUam4SdHCh0Om7bCd39j8uB9Gr784N/Xx6ds +sPmuujz9dLQR6FgNgLzTqIA6me11zEZ7 +-----END CERTIFICATE----- + +# Issuer: CN=America Online Root Certification Authority 2 O=America Online Inc. +# Subject: CN=America Online Root Certification Authority 2 O=America Online Inc. +# Label: "America Online Root Certification Authority 2" +# Serial: 1 +# MD5 Fingerprint: d6:ed:3c:ca:e2:66:0f:af:10:43:0d:77:9b:04:09:bf +# SHA1 Fingerprint: 85:b5:ff:67:9b:0c:79:96:1f:c8:6e:44:22:00:46:13:db:17:92:84 +# SHA256 Fingerprint: 7d:3b:46:5a:60:14:e5:26:c0:af:fc:ee:21:27:d2:31:17:27:ad:81:1c:26:84:2d:00:6a:f3:73:06:cc:80:bd +-----BEGIN CERTIFICATE----- +MIIFpDCCA4ygAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEc +MBoGA1UEChMTQW1lcmljYSBPbmxpbmUgSW5jLjE2MDQGA1UEAxMtQW1lcmljYSBP +bmxpbmUgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAyMB4XDTAyMDUyODA2 +MDAwMFoXDTM3MDkyOTE0MDgwMFowYzELMAkGA1UEBhMCVVMxHDAaBgNVBAoTE0Ft +ZXJpY2EgT25saW5lIEluYy4xNjA0BgNVBAMTLUFtZXJpY2EgT25saW5lIFJvb3Qg +Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgMjCCAiIwDQYJKoZIhvcNAQEBBQADggIP +ADCCAgoCggIBAMxBRR3pPU0Q9oyxQcngXssNt79Hc9PwVU3dxgz6sWYFas14tNwC +206B89enfHG8dWOgXeMHDEjsJcQDIPT/DjsS/5uN4cbVG7RtIuOx238hZK+GvFci +KtZHgVdEglZTvYYUAQv8f3SkWq7xuhG1m1hagLQ3eAkzfDJHA1zEpYNI9FdWboE2 +JxhP7JsowtS013wMPgwr38oE18aO6lhOqKSlGBxsRZijQdEt0sdtjRnxrXm3gT+9 +BoInLRBYBbV4Bbkv2wxrkJB+FFk4u5QkE+XRnRTf04JNRvCAOVIyD+OEsnpD8l7e +Xz8d3eOyG6ChKiMDbi4BFYdcpnV1x5dhvt6G3NRI270qv0pV2uh9UPu0gBe4lL8B +PeraunzgWGcXuVjgiIZGZ2ydEEdYMtA1fHkqkKJaEBEjNa0vzORKW6fIJ/KD3l67 +Xnfn6KVuY8INXWHQjNJsWiEOyiijzirplcdIz5ZvHZIlyMbGwcEMBawmxNJ10uEq +Z8A9W6Wa6897GqidFEXlD6CaZd4vKL3Ob5Rmg0gp2OpljK+T2WSfVVcmv2/LNzGZ +o2C7HK2JNDJiuEMhBnIMoVxtRsX6Kc8w3onccVvdtjc+31D1uAclJuW8tf48ArO3 ++L5DwYcRlJ4jbBeKuIonDFRH8KmzwICMoCfrHRnjB453cMor9H124HhnAgMBAAGj +YzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFE1FwWg4u3OpaaEg5+31IqEj +FNeeMB8GA1UdIwQYMBaAFE1FwWg4u3OpaaEg5+31IqEjFNeeMA4GA1UdDwEB/wQE +AwIBhjANBgkqhkiG9w0BAQUFAAOCAgEAZ2sGuV9FOypLM7PmG2tZTiLMubekJcmn +xPBUlgtk87FYT15R/LKXeydlwuXK5w0MJXti4/qftIe3RUavg6WXSIylvfEWK5t2 +LHo1YGwRgJfMqZJS5ivmae2p+DYtLHe/YUjRYwu5W1LtGLBDQiKmsXeu3mnFzccc +obGlHBD7GL4acN3Bkku+KVqdPzW+5X1R+FXgJXUjhx5c3LqdsKyzadsXg8n33gy8 +CNyRnqjQ1xU3c6U1uPx+xURABsPr+CKAXEfOAuMRn0T//ZoyzH1kUQ7rVyZ2OuMe +IjzCpjbdGe+n/BLzJsBZMYVMnNjP36TMzCmT/5RtdlwTCJfy7aULTd3oyWgOZtMA +DjMSW7yV5TKQqLPGbIOtd+6Lfn6xqavT4fG2wLHqiMDn05DpKJKUe2h7lyoKZy2F +AjgQ5ANh1NolNscIWC2hp1GvMApJ9aZphwctREZ2jirlmjvXGKL8nDgQzMY70rUX +Om/9riW99XJZZLF0KjhfGEzfz3EEWjbUvy+ZnOjZurGV5gJLIaFb1cFPj65pbVPb +AZO1XB4Y3WRayhgoPmMEEf0cjQAPuDffZ4qdZqkCapH/E8ovXYO8h5Ns3CRRFgQl +Zvqz2cK6Kb6aSDiCmfS/O0oxGfm/jiEzFMpPVF/7zvuPcX/9XhmgD0uRuMRUvAaw +RY8mkaKO/qk= +-----END CERTIFICATE----- + +# Issuer: CN=AAA Certificate Services O=Comodo CA Limited +# Subject: CN=AAA Certificate Services O=Comodo CA Limited +# Label: "Comodo AAA Services root" +# Serial: 1 +# MD5 Fingerprint: 49:79:04:b0:eb:87:19:ac:47:b0:bc:11:51:9b:74:d0 +# SHA1 Fingerprint: d1:eb:23:a4:6d:17:d6:8f:d9:25:64:c2:f1:f1:60:17:64:d8:e3:49 +# SHA256 Fingerprint: d7:a7:a0:fb:5d:7e:27:31:d7:71:e9:48:4e:bc:de:f7:1d:5f:0c:3e:0a:29:48:78:2b:c8:3e:e0:ea:69:9e:f4 +-----BEGIN CERTIFICATE----- +MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEb +MBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow +GAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmlj +YXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAwMFoXDTI4MTIzMTIzNTk1OVowezEL +MAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE +BwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNVBAMM +GEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQua +BtDFcCLNSS1UY8y2bmhGC1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe +3M/vg4aijJRPn2jymJBGhCfHdr/jzDUsi14HZGWCwEiwqJH5YZ92IFCokcdmtet4 +YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszWY19zjNoFmag4qMsXeDZR +rOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjHYpy+g8cm +ez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQU +oBEKIz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF +MAMBAf8wewYDVR0fBHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20v +QUFBQ2VydGlmaWNhdGVTZXJ2aWNlcy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29t +b2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2VzLmNybDANBgkqhkiG9w0BAQUF +AAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm7l3sAg9g1o1Q +GE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz +Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2 +G9w84FoVxp7Z8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsi +l2D4kF501KKaU73yqWjgom7C12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3 +smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg== +-----END CERTIFICATE----- + +# Issuer: CN=Secure Certificate Services O=Comodo CA Limited +# Subject: CN=Secure Certificate Services O=Comodo CA Limited +# Label: "Comodo Secure Services root" +# Serial: 1 +# MD5 Fingerprint: d3:d9:bd:ae:9f:ac:67:24:b3:c8:1b:52:e1:b9:a9:bd +# SHA1 Fingerprint: 4a:65:d5:f4:1d:ef:39:b8:b8:90:4a:4a:d3:64:81:33:cf:c7:a1:d1 +# SHA256 Fingerprint: bd:81:ce:3b:4f:65:91:d1:1a:67:b5:fc:7a:47:fd:ef:25:52:1b:f9:aa:4e:18:b9:e3:df:2e:34:a7:80:3b:e8 +-----BEGIN CERTIFICATE----- +MIIEPzCCAyegAwIBAgIBATANBgkqhkiG9w0BAQUFADB+MQswCQYDVQQGEwJHQjEb +MBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow +GAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDEkMCIGA1UEAwwbU2VjdXJlIENlcnRp +ZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAwMFoXDTI4MTIzMTIzNTk1OVow +fjELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G +A1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxJDAiBgNV +BAMMG1NlY3VyZSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEB +BQADggEPADCCAQoCggEBAMBxM4KK0HDrc4eCQNUd5MvJDkKQ+d40uaG6EfQlhfPM +cm3ye5drswfxdySRXyWP9nQ95IDC+DwN879A6vfIUtFyb+/Iq0G4bi4XKpVpDM3S +HpR7LZQdqnXXs5jLrLxkU0C8j6ysNstcrbvd4JQX7NFc0L/vpZXJkMWwrPsbQ996 +CF23uPJAGysnnlDOXmWCiIxe004MeuoIkbY2qitC++rCoznl2yY4rYsK7hljxxwk +3wN42ubqwUcaCwtGCd0C/N7Lh1/XMGNooa7cMqG6vv5Eq2i2pRcV/b3Vp6ea5EQz +6YiO/O1R65NxTq0B50SOqy3LqP4BSUjwwN3HaNiS/j0CAwEAAaOBxzCBxDAdBgNV +HQ4EFgQUPNiTiMLAggnMAZkGkyDpnnAJY08wDgYDVR0PAQH/BAQDAgEGMA8GA1Ud +EwEB/wQFMAMBAf8wgYEGA1UdHwR6MHgwO6A5oDeGNWh0dHA6Ly9jcmwuY29tb2Rv +Y2EuY29tL1NlY3VyZUNlcnRpZmljYXRlU2VydmljZXMuY3JsMDmgN6A1hjNodHRw +Oi8vY3JsLmNvbW9kby5uZXQvU2VjdXJlQ2VydGlmaWNhdGVTZXJ2aWNlcy5jcmww +DQYJKoZIhvcNAQEFBQADggEBAIcBbSMdflsXfcFhMs+P5/OKlFlm4J4oqF7Tt/Q0 +5qo5spcWxYJvMqTpjOev/e/C6LlLqqP05tqNZSH7uoDrJiiFGv45jN5bBAS0VPmj +Z55B+glSzAVIqMk/IQQezkhr/IXownuvf7fM+F86/TXGDe+X3EyrEeFryzHRbPtI +gKvcnDe4IRRLDXE97IMzbtFuMhbsmMcWi1mmNKsFVy2T96oTy9IT4rcuO81rUBcJ +aD61JlfutuC23bkpgHl9j6PwpCikFcSF9CfUa7/lXORlAnZUtOM3ZiTTGWHIUhDl +izeauan5Hb/qmZJhlv8BzaFfDbxxvA6sCx1HRR3B7Hzs/Sk= +-----END CERTIFICATE----- + +# Issuer: CN=Trusted Certificate Services O=Comodo CA Limited +# Subject: CN=Trusted Certificate Services O=Comodo CA Limited +# Label: "Comodo Trusted Services root" +# Serial: 1 +# MD5 Fingerprint: 91:1b:3f:6e:cd:9e:ab:ee:07:fe:1f:71:d2:b3:61:27 +# SHA1 Fingerprint: e1:9f:e3:0e:8b:84:60:9e:80:9b:17:0d:72:a8:c5:ba:6e:14:09:bd +# SHA256 Fingerprint: 3f:06:e5:56:81:d4:96:f5:be:16:9e:b5:38:9f:9f:2b:8f:f6:1e:17:08:df:68:81:72:48:49:cd:5d:27:cb:69 +-----BEGIN CERTIFICATE----- +MIIEQzCCAyugAwIBAgIBATANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJHQjEb +MBkGA1UECAwSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRow +GAYDVQQKDBFDb21vZG8gQ0EgTGltaXRlZDElMCMGA1UEAwwcVHJ1c3RlZCBDZXJ0 +aWZpY2F0ZSBTZXJ2aWNlczAeFw0wNDAxMDEwMDAwMDBaFw0yODEyMzEyMzU5NTla +MH8xCzAJBgNVBAYTAkdCMRswGQYDVQQIDBJHcmVhdGVyIE1hbmNoZXN0ZXIxEDAO +BgNVBAcMB1NhbGZvcmQxGjAYBgNVBAoMEUNvbW9kbyBDQSBMaW1pdGVkMSUwIwYD +VQQDDBxUcnVzdGVkIENlcnRpZmljYXRlIFNlcnZpY2VzMIIBIjANBgkqhkiG9w0B +AQEFAAOCAQ8AMIIBCgKCAQEA33FvNlhTWvI2VFeAxHQIIO0Yfyod5jWaHiWsnOWW +fnJSoBVC21ndZHoa0Lh73TkVvFVIxO06AOoxEbrycXQaZ7jPM8yoMa+j49d/vzMt +TGo87IvDktJTdyR0nAducPy9C1t2ul/y/9c3S0pgePfw+spwtOpZqqPOSC+pw7IL +fhdyFgymBwwbOM/JYrc/oJOlh0Hyt3BAd9i+FHzjqMB6juljatEPmsbS9Is6FARW +1O24zG71++IsWL1/T2sr92AkWCTOJu80kTrV44HQsvAEAtdbtz6SrGsSivnkBbA7 +kUlcsutT6vifR4buv5XAwAaf0lteERv0xwQ1KdJVXOTt6wIDAQABo4HJMIHGMB0G +A1UdDgQWBBTFe1i97doladL3WRaoszLAeydb9DAOBgNVHQ8BAf8EBAMCAQYwDwYD +VR0TAQH/BAUwAwEB/zCBgwYDVR0fBHwwejA8oDqgOIY2aHR0cDovL2NybC5jb21v +ZG9jYS5jb20vVHJ1c3RlZENlcnRpZmljYXRlU2VydmljZXMuY3JsMDqgOKA2hjRo +dHRwOi8vY3JsLmNvbW9kby5uZXQvVHJ1c3RlZENlcnRpZmljYXRlU2VydmljZXMu +Y3JsMA0GCSqGSIb3DQEBBQUAA4IBAQDIk4E7ibSvuIQSTI3S8NtwuleGFTQQuS9/ +HrCoiWChisJ3DFBKmwCL2Iv0QeLQg4pKHBQGsKNoBXAxMKdTmw7pSqBYaWcOrp32 +pSxBvzwGa+RZzG0Q8ZZvH9/0BAKkn0U+yNj6NkZEUD+Cl5EfKNsYEYwq5GWDVxIS +jBc/lDb+XbDABHcTuPQV1T84zJQ6VdCsmPW6AF/ghhmBeC8owH7TzEIK9a5QoNE+ +xqFx7D+gIIxmOom0jtTYsU0lR+4viMi14QVFwL4Ucd56/Y57fU0IlqUSc/Atyjcn +dBInTMu2l+nZrghtWjlA3QVHdWpaIbOjGM9O9y5Xt5hwXsjEeLBi +-----END CERTIFICATE----- + +# Issuer: CN=UTN - DATACorp SGC O=The USERTRUST Network OU=http://www.usertrust.com +# Subject: CN=UTN - DATACorp SGC O=The USERTRUST Network OU=http://www.usertrust.com +# Label: "UTN DATACorp SGC Root CA" +# Serial: 91374294542884689855167577680241077609 +# MD5 Fingerprint: b3:a5:3e:77:21:6d:ac:4a:c0:c9:fb:d5:41:3d:ca:06 +# SHA1 Fingerprint: 58:11:9f:0e:12:82:87:ea:50:fd:d9:87:45:6f:4f:78:dc:fa:d6:d4 +# SHA256 Fingerprint: 85:fb:2f:91:dd:12:27:5a:01:45:b6:36:53:4f:84:02:4a:d6:8b:69:b8:ee:88:68:4f:f7:11:37:58:05:b3:48 +-----BEGIN CERTIFICATE----- +MIIEXjCCA0agAwIBAgIQRL4Mi1AAIbQR0ypoBqmtaTANBgkqhkiG9w0BAQUFADCB +kzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug +Q2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho +dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xGzAZBgNVBAMTElVUTiAtIERBVEFDb3Jw +IFNHQzAeFw05OTA2MjQxODU3MjFaFw0xOTA2MjQxOTA2MzBaMIGTMQswCQYDVQQG +EwJVUzELMAkGA1UECBMCVVQxFzAVBgNVBAcTDlNhbHQgTGFrZSBDaXR5MR4wHAYD +VQQKExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxITAfBgNVBAsTGGh0dHA6Ly93d3cu +dXNlcnRydXN0LmNvbTEbMBkGA1UEAxMSVVROIC0gREFUQUNvcnAgU0dDMIIBIjAN +BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA3+5YEKIrblXEjr8uRgnn4AgPLit6 +E5Qbvfa2gI5lBZMAHryv4g+OGQ0SR+ysraP6LnD43m77VkIVni5c7yPeIbkFdicZ +D0/Ww5y0vpQZY/KmEQrrU0icvvIpOxboGqBMpsn0GFlowHDyUwDAXlCCpVZvNvlK +4ESGoE1O1kduSUrLZ9emxAW5jh70/P/N5zbgnAVssjMiFdC04MwXwLLA9P4yPykq +lXvY8qdOD1R8oQ2AswkDwf9c3V6aPryuvEeKaq5xyh+xKrhfQgUL7EYw0XILyulW +bfXv33i+Ybqypa4ETLyorGkVl73v67SMvzX41MPRKA5cOp9wGDMgd8SirwIDAQAB +o4GrMIGoMAsGA1UdDwQEAwIBxjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRT +MtGzz3/64PGgXYVOktKeRR20TzA9BgNVHR8ENjA0MDKgMKAuhixodHRwOi8vY3Js +LnVzZXJ0cnVzdC5jb20vVVROLURBVEFDb3JwU0dDLmNybDAqBgNVHSUEIzAhBggr +BgEFBQcDAQYKKwYBBAGCNwoDAwYJYIZIAYb4QgQBMA0GCSqGSIb3DQEBBQUAA4IB +AQAnNZcAiosovcYzMB4p/OL31ZjUQLtgyr+rFywJNn9Q+kHcrpY6CiM+iVnJowft +Gzet/Hy+UUla3joKVAgWRcKZsYfNjGjgaQPpxE6YsjuMFrMOoAyYUJuTqXAJyCyj +j98C5OBxOvG0I3KgqgHf35g+FFCgMSa9KOlaMCZ1+XtgHI3zzVAmbQQnmt/VDUVH +KWss5nbZqSl9Mt3JNjy9rjXxEZ4du5A/EkdOjtd+D2JzHVImOBwYSf0wdJrE5SIv +2MCN7ZF6TACPcn9d2t0bi0Vr591pl6jFVkwPDPafepE39peC4N1xaf92P2BNPM/3 +mfnGV/TJVTl4uix5yaaIK/QI +-----END CERTIFICATE----- + +# Issuer: CN=UTN-USERFirst-Hardware O=The USERTRUST Network OU=http://www.usertrust.com +# Subject: CN=UTN-USERFirst-Hardware O=The USERTRUST Network OU=http://www.usertrust.com +# Label: "UTN USERFirst Hardware Root CA" +# Serial: 91374294542884704022267039221184531197 +# MD5 Fingerprint: 4c:56:41:e5:0d:bb:2b:e8:ca:a3:ed:18:08:ad:43:39 +# SHA1 Fingerprint: 04:83:ed:33:99:ac:36:08:05:87:22:ed:bc:5e:46:00:e3:be:f9:d7 +# SHA256 Fingerprint: 6e:a5:47:41:d0:04:66:7e:ed:1b:48:16:63:4a:a3:a7:9e:6e:4b:96:95:0f:82:79:da:fc:8d:9b:d8:81:21:37 +-----BEGIN CERTIFICATE----- +MIIEdDCCA1ygAwIBAgIQRL4Mi1AAJLQR0zYq/mUK/TANBgkqhkiG9w0BAQUFADCB +lzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug +Q2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExho +dHRwOi8vd3d3LnVzZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3Qt +SGFyZHdhcmUwHhcNOTkwNzA5MTgxMDQyWhcNMTkwNzA5MTgxOTIyWjCBlzELMAkG +A1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2UgQ2l0eTEe +MBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSEwHwYDVQQLExhodHRwOi8v +d3d3LnVzZXJ0cnVzdC5jb20xHzAdBgNVBAMTFlVUTi1VU0VSRmlyc3QtSGFyZHdh +cmUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCx98M4P7Sof885glFn +0G2f0v9Y8+efK+wNiVSZuTiZFvfgIXlIwrthdBKWHTxqctU8EGc6Oe0rE81m65UJ +M6Rsl7HoxuzBdXmcRl6Nq9Bq/bkqVRcQVLMZ8Jr28bFdtqdt++BxF2uiiPsA3/4a +MXcMmgF6sTLjKwEHOG7DpV4jvEWbe1DByTCP2+UretNb+zNAHqDVmBe8i4fDidNd +oI6yqqr2jmmIBsX6iSHzCJ1pLgkzmykNRg+MzEk0sGlRvfkGzWitZky8PqxhvQqI +DsjfPe58BEydCl5rkdbux+0ojatNh4lz0G6k0B4WixThdkQDf2Os5M1JnMWS9Ksy +oUhbAgMBAAGjgbkwgbYwCwYDVR0PBAQDAgHGMA8GA1UdEwEB/wQFMAMBAf8wHQYD +VR0OBBYEFKFyXyYbKJhDlV0HN9WFlp1L0sNFMEQGA1UdHwQ9MDswOaA3oDWGM2h0 +dHA6Ly9jcmwudXNlcnRydXN0LmNvbS9VVE4tVVNFUkZpcnN0LUhhcmR3YXJlLmNy +bDAxBgNVHSUEKjAoBggrBgEFBQcDAQYIKwYBBQUHAwUGCCsGAQUFBwMGBggrBgEF +BQcDBzANBgkqhkiG9w0BAQUFAAOCAQEARxkP3nTGmZev/K0oXnWO6y1n7k57K9cM +//bey1WiCuFMVGWTYGufEpytXoMs61quwOQt9ABjHbjAbPLPSbtNk28Gpgoiskli +CE7/yMgUsogWXecB5BKV5UU0s4tpvc+0hY91UZ59Ojg6FEgSxvunOxqNDYJAB+gE +CJChicsZUN/KHAG8HQQZexB2lzvukJDKxA4fFm517zP4029bHpbj4HR3dHuKom4t +3XbWOTCC8KucUvIqx69JXn7HaOWCgchqJ/kniCrVWFCVH/A7HFe7fRQ5YiuayZSS +KqMiDP+JJn1fIytH1xUdqWqeUQ0qUZ6B+dQ7XnASfxAynB67nfhmqA== +-----END CERTIFICATE----- + +# Issuer: CN=XRamp Global Certification Authority O=XRamp Security Services Inc OU=www.xrampsecurity.com +# Subject: CN=XRamp Global Certification Authority O=XRamp Security Services Inc OU=www.xrampsecurity.com +# Label: "XRamp Global CA Root" +# Serial: 107108908803651509692980124233745014957 +# MD5 Fingerprint: a1:0b:44:b3:ca:10:d8:00:6e:9d:0f:d8:0f:92:0a:d1 +# SHA1 Fingerprint: b8:01:86:d1:eb:9c:86:a5:41:04:cf:30:54:f3:4c:52:b7:e5:58:c6 +# SHA256 Fingerprint: ce:cd:dc:90:50:99:d8:da:df:c5:b1:d2:09:b7:37:cb:e2:c1:8c:fb:2c:10:c0:ff:0b:cf:0d:32:86:fc:1a:a2 +-----BEGIN CERTIFICATE----- +MIIEMDCCAxigAwIBAgIQUJRs7Bjq1ZxN1ZfvdY+grTANBgkqhkiG9w0BAQUFADCB +gjELMAkGA1UEBhMCVVMxHjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEk +MCIGA1UEChMbWFJhbXAgU2VjdXJpdHkgU2VydmljZXMgSW5jMS0wKwYDVQQDEyRY +UmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQxMTAxMTcx +NDA0WhcNMzUwMTAxMDUzNzE5WjCBgjELMAkGA1UEBhMCVVMxHjAcBgNVBAsTFXd3 +dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2VjdXJpdHkgU2Vy +dmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBB +dXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCYJB69FbS6 +38eMpSe2OAtp87ZOqCwuIR1cRN8hXX4jdP5efrRKt6atH67gBhbim1vZZ3RrXYCP +KZ2GG9mcDZhtdhAoWORlsH9KmHmf4MMxfoArtYzAQDsRhtDLooY2YKTVMIJt2W7Q +DxIEM5dfT2Fa8OT5kavnHTu86M/0ay00fOJIYRyO82FEzG+gSqmUsE3a56k0enI4 +qEHMPJQRfevIpoy3hsvKMzvZPTeL+3o+hiznc9cKV6xkmxnr9A8ECIqsAxcZZPRa +JSKNNCyy9mgdEm3Tih4U2sSPpuIjhdV6Db1q4Ons7Be7QhtnqiXtRYMh/MHJfNVi +PvryxS3T/dRlAgMBAAGjgZ8wgZwwEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0P +BAQDAgGGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFMZPoj0GY4QJnM5i5ASs +jVy16bYbMDYGA1UdHwQvMC0wK6ApoCeGJWh0dHA6Ly9jcmwueHJhbXBzZWN1cml0 +eS5jb20vWEdDQS5jcmwwEAYJKwYBBAGCNxUBBAMCAQEwDQYJKoZIhvcNAQEFBQAD +ggEBAJEVOQMBG2f7Shz5CmBbodpNl2L5JFMn14JkTpAuw0kbK5rc/Kh4ZzXxHfAR +vbdI4xD2Dd8/0sm2qlWkSLoC295ZLhVbO50WfUfXN+pfTXYSNrsf16GBBEYgoyxt +qZ4Bfj8pzgCT3/3JknOJiWSe5yvkHJEs0rnOfc5vMZnT5r7SHpDwCRR5XCOrTdLa +IR9NmXmd4c8nnxCbHIgNsIpkQTG4DmyQJKSbXHGPurt+HBvbaoAPIbzp26a3QPSy +i6mx5O+aGtA9aZnuqCij4Tyz8LIRnM98QObd50N9otg6tamN8jSZxNQQ4Qb9CYQQ +O+7ETPTsJ3xCwnR8gooJybQDJbw= +-----END CERTIFICATE----- + +# Issuer: O=The Go Daddy Group, Inc. OU=Go Daddy Class 2 Certification Authority +# Subject: O=The Go Daddy Group, Inc. OU=Go Daddy Class 2 Certification Authority +# Label: "Go Daddy Class 2 CA" +# Serial: 0 +# MD5 Fingerprint: 91:de:06:25:ab:da:fd:32:17:0c:bb:25:17:2a:84:67 +# SHA1 Fingerprint: 27:96:ba:e6:3f:18:01:e2:77:26:1b:a0:d7:77:70:02:8f:20:ee:e4 +# SHA256 Fingerprint: c3:84:6b:f2:4b:9e:93:ca:64:27:4c:0e:c6:7c:1e:cc:5e:02:4f:fc:ac:d2:d7:40:19:35:0e:81:fe:54:6a:e4 +-----BEGIN CERTIFICATE----- +MIIEADCCAuigAwIBAgIBADANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEh +MB8GA1UEChMYVGhlIEdvIERhZGR5IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBE +YWRkeSBDbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA0MDYyOTE3 +MDYyMFoXDTM0MDYyOTE3MDYyMFowYzELMAkGA1UEBhMCVVMxITAfBgNVBAoTGFRo +ZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28gRGFkZHkgQ2xhc3Mg +MiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASAwDQYJKoZIhvcNAQEBBQADggEN +ADCCAQgCggEBAN6d1+pXGEmhW+vXX0iG6r7d/+TvZxz0ZWizV3GgXne77ZtJ6XCA +PVYYYwhv2vLM0D9/AlQiVBDYsoHUwHU9S3/Hd8M+eKsaA7Ugay9qK7HFiH7Eux6w +wdhFJ2+qN1j3hybX2C32qRe3H3I2TqYXP2WYktsqbl2i/ojgC95/5Y0V4evLOtXi +EqITLdiOr18SPaAIBQi2XKVlOARFmR6jYGB0xUGlcmIbYsUfb18aQr4CUWWoriMY +avx4A6lNf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmYvLEHZ6IVDd2gWMZEewo+ +YihfukEHU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjgcAwgb0wHQYDVR0OBBYEFNLE +sNKR1EwRcbNhyz2h/t2oatTjMIGNBgNVHSMEgYUwgYKAFNLEsNKR1EwRcbNhyz2h +/t2oatTjoWekZTBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYVGhlIEdvIERhZGR5 +IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRpZmlj +YXRpb24gQXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQAD +ggEBADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wimPQoZ+YeAEW5p5JYXMP80kWNy +OO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKtI3lpjbi2Tc7P +TMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ +HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mER +dEr/VxqHD3VILs9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5Cuf +ReYNnyicsbkqWletNw+vHX/bvZ8= +-----END CERTIFICATE----- + +# Issuer: O=Starfield Technologies, Inc. OU=Starfield Class 2 Certification Authority +# Subject: O=Starfield Technologies, Inc. OU=Starfield Class 2 Certification Authority +# Label: "Starfield Class 2 CA" +# Serial: 0 +# MD5 Fingerprint: 32:4a:4b:bb:c8:63:69:9b:be:74:9a:c6:dd:1d:46:24 +# SHA1 Fingerprint: ad:7e:1c:28:b0:64:ef:8f:60:03:40:20:14:c3:d0:e3:37:0e:b5:8a +# SHA256 Fingerprint: 14:65:fa:20:53:97:b8:76:fa:a6:f0:a9:95:8e:55:90:e4:0f:cc:7f:aa:4f:b7:c2:c8:67:75:21:fb:5f:b6:58 +-----BEGIN CERTIFICATE----- +MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzEl +MCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMp +U3RhcmZpZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQw +NjI5MTczOTE2WhcNMzQwNjI5MTczOTE2WjBoMQswCQYDVQQGEwJVUzElMCMGA1UE +ChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZp +ZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEgMA0GCSqGSIb3 +DQEBAQUAA4IBDQAwggEIAoIBAQC3Msj+6XGmBIWtDBFk385N78gDGIc/oav7PKaf +8MOh2tTYbitTkPskpD6E8J7oX+zlJ0T1KKY/e97gKvDIr1MvnsoFAZMej2YcOadN ++lq2cwQlZut3f+dZxkqZJRRU6ybH838Z1TBwj6+wRir/resp7defqgSHo9T5iaU0 +X9tDkYI22WY8sbi5gv2cOj4QyDvvBmVmepsZGD3/cVE8MC5fvj13c7JdBmzDI1aa +K4UmkhynArPkPw2vCHmCuDY96pzTNbO8acr1zJ3o/WSNF4Azbl5KXZnJHoe0nRrA +1W4TNSNe35tfPe/W93bC6j67eA0cQmdrBNj41tpvi/JEoAGrAgEDo4HFMIHCMB0G +A1UdDgQWBBS/X7fRzt0fhvRbVazc1xDCDqmI5zCBkgYDVR0jBIGKMIGHgBS/X7fR +zt0fhvRbVazc1xDCDqmI56FspGowaDELMAkGA1UEBhMCVVMxJTAjBgNVBAoTHFN0 +YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xMjAwBgNVBAsTKVN0YXJmaWVsZCBD +bGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8w +DQYJKoZIhvcNAQEFBQADggEBAAWdP4id0ckaVaGsafPzWdqbAYcaT1epoXkJKtv3 +L7IezMdeatiDh6GX70k1PncGQVhiv45YuApnP+yz3SFmH8lU+nLMPUxA2IGvd56D +eruix/U0F47ZEUD0/CwqTRV/p2JdLiXTAAsgGh1o+Re49L2L7ShZ3U0WixeDyLJl +xy16paq8U4Zt3VekyvggQQto8PT7dL5WXXp59fkdheMtlb71cZBDzI0fmgAKhynp +VSJYACPq4xJDKVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEY +WQPJIrSPnNVeKtelttQKbfi3QBFGmh95DmK/D5fs4C8fF5Q= +-----END CERTIFICATE----- + +# Issuer: CN=StartCom Certification Authority O=StartCom Ltd. OU=Secure Digital Certificate Signing +# Subject: CN=StartCom Certification Authority O=StartCom Ltd. OU=Secure Digital Certificate Signing +# Label: "StartCom Certification Authority" +# Serial: 1 +# MD5 Fingerprint: 22:4d:8f:8a:fc:f7:35:c2:bb:57:34:90:7b:8b:22:16 +# SHA1 Fingerprint: 3e:2b:f7:f2:03:1b:96:f3:8c:e6:c4:d8:a8:5d:3e:2d:58:47:6a:0f +# SHA256 Fingerprint: c7:66:a9:be:f2:d4:07:1c:86:3a:31:aa:49:20:e8:13:b2:d1:98:60:8c:b7:b7:cf:e2:11:43:b8:36:df:09:ea +-----BEGIN CERTIFICATE----- +MIIHyTCCBbGgAwIBAgIBATANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJJTDEW +MBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwg +Q2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0NjM2WhcNMzYwOTE3MTk0NjM2WjB9 +MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMi +U2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3Rh +cnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUA +A4ICDwAwggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZk +pMyONvg45iPwbm2xPN1yo4UcodM9tDMr0y+v/uqwQVlntsQGfQqedIXWeUyAN3rf +OQVSWff0G0ZDpNKFhdLDcfN1YjS6LIp/Ho/u7TTQEceWzVI9ujPW3U3eCztKS5/C +Ji/6tRYccjV3yjxd5srhJosaNnZcAdt0FCX+7bWgiA/deMotHweXMAEtcnn6RtYT +Kqi5pquDSR3l8u/d5AGOGAqPY1MWhWKpDhk6zLVmpsJrdAfkK+F2PrRt2PZE4XNi +HzvEvqBTViVsUQn3qqvKv3b9bZvzndu/PWa8DFaqr5hIlTpL36dYUNk4dalb6kMM +Av+Z6+hsTXBbKWWc3apdzK8BMewM69KN6Oqce+Zu9ydmDBpI125C4z/eIT574Q1w ++2OqqGwaVLRcJXrJosmLFqa7LH4XXgVNWG4SHQHuEhANxjJ/GP/89PrNbpHoNkm+ +Gkhpi8KWTRoSsmkXwQqQ1vp5Iki/untp+HDH+no32NgN0nZPV/+Qt+OR0t3vwmC3 +Zzrd/qqc8NSLf3Iizsafl7b4r4qgEKjZ+xjGtrVcUjyJthkqcwEKDwOzEmDyei+B +26Nu/yYwl/WL3YlXtq09s68rxbd2AvCl1iuahhQqcvbjM4xdCUsT37uMdBNSSwID +AQABo4ICUjCCAk4wDAYDVR0TBAUwAwEB/zALBgNVHQ8EBAMCAa4wHQYDVR0OBBYE +FE4L7xqkQFulF2mHMMo0aEPQQa7yMGQGA1UdHwRdMFswLKAqoCiGJmh0dHA6Ly9j +ZXJ0LnN0YXJ0Y29tLm9yZy9zZnNjYS1jcmwuY3JsMCugKaAnhiVodHRwOi8vY3Js +LnN0YXJ0Y29tLm9yZy9zZnNjYS1jcmwuY3JsMIIBXQYDVR0gBIIBVDCCAVAwggFM +BgsrBgEEAYG1NwEBATCCATswLwYIKwYBBQUHAgEWI2h0dHA6Ly9jZXJ0LnN0YXJ0 +Y29tLm9yZy9wb2xpY3kucGRmMDUGCCsGAQUFBwIBFilodHRwOi8vY2VydC5zdGFy +dGNvbS5vcmcvaW50ZXJtZWRpYXRlLnBkZjCB0AYIKwYBBQUHAgIwgcMwJxYgU3Rh +cnQgQ29tbWVyY2lhbCAoU3RhcnRDb20pIEx0ZC4wAwIBARqBl0xpbWl0ZWQgTGlh +YmlsaXR5LCByZWFkIHRoZSBzZWN0aW9uICpMZWdhbCBMaW1pdGF0aW9ucyogb2Yg +dGhlIFN0YXJ0Q29tIENlcnRpZmljYXRpb24gQXV0aG9yaXR5IFBvbGljeSBhdmFp +bGFibGUgYXQgaHR0cDovL2NlcnQuc3RhcnRjb20ub3JnL3BvbGljeS5wZGYwEQYJ +YIZIAYb4QgEBBAQDAgAHMDgGCWCGSAGG+EIBDQQrFilTdGFydENvbSBGcmVlIFNT +TCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTANBgkqhkiG9w0BAQUFAAOCAgEAFmyZ +9GYMNPXQhV59CuzaEE44HF7fpiUFS5Eyweg78T3dRAlbB0mKKctmArexmvclmAk8 +jhvh3TaHK0u7aNM5Zj2gJsfyOZEdUauCe37Vzlrk4gNXcGmXCPleWKYK34wGmkUW +FjgKXlf2Ysd6AgXmvB618p70qSmD+LIU424oh0TDkBreOKk8rENNZEXO3SipXPJz +ewT4F+irsfMuXGRuczE6Eri8sxHkfY+BUZo7jYn0TZNmezwD7dOaHZrzZVD1oNB1 +ny+v8OqCQ5j4aZyJecRDjkZy42Q2Eq/3JR44iZB3fsNrarnDy0RLrHiQi+fHLB5L +EUTINFInzQpdn4XBidUaePKVEFMy3YCEZnXZtWgo+2EuvoSoOMCZEoalHmdkrQYu +L6lwhceWD3yJZfWOQ1QOq92lgDmUYMA0yZZwLKMS9R9Ie70cfmu3nZD0Ijuu+Pwq +yvqCUqDvr0tVk+vBtfAii6w0TiYiBKGHLHVKt+V9E9e4DGTANtLJL4YSjCMJwRuC +O3NJo2pXh5Tl1njFmUNj403gdy3hZZlyaQQaRwnmDwFWJPsfvw55qVguucQJAX6V +um0ABj6y6koQOdjQK/W/7HW/lwLFCRsI3FU34oH7N4RDYiDK51ZLZer+bMEkkySh +NOsF/5oirpt9P/FlUQqmMGqz9IgcgA38corog14= +-----END CERTIFICATE----- + +# Issuer: CN=DigiCert Assured ID Root CA O=DigiCert Inc OU=www.digicert.com +# Subject: CN=DigiCert Assured ID Root CA O=DigiCert Inc OU=www.digicert.com +# Label: "DigiCert Assured ID Root CA" +# Serial: 17154717934120587862167794914071425081 +# MD5 Fingerprint: 87:ce:0b:7b:2a:0e:49:00:e1:58:71:9b:37:a8:93:72 +# SHA1 Fingerprint: 05:63:b8:63:0d:62:d7:5a:bb:c8:ab:1e:4b:df:b5:a8:99:b2:4d:43 +# SHA256 Fingerprint: 3e:90:99:b5:01:5e:8f:48:6c:00:bc:ea:9d:11:1e:e7:21:fa:ba:35:5a:89:bc:f1:df:69:56:1e:3d:c6:32:5c +-----BEGIN CERTIFICATE----- +MIIDtzCCAp+gAwIBAgIQDOfg5RfYRv6P5WD8G/AwOTANBgkqhkiG9w0BAQUFADBl +MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJv +b3QgQ0EwHhcNMDYxMTEwMDAwMDAwWhcNMzExMTEwMDAwMDAwWjBlMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNl +cnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0EwggEi +MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtDhXO5EOAXLGH87dg+XESpa7c +JpSIqvTO9SA5KFhgDPiA2qkVlTJhPLWxKISKityfCgyDF3qPkKyK53lTXDGEKvYP +mDI2dsze3Tyoou9q+yHyUmHfnyDXH+Kx2f4YZNISW1/5WBg1vEfNoTb5a3/UsDg+ +wRvDjDPZ2C8Y/igPs6eD1sNuRMBhNZYW/lmci3Zt1/GiSw0r/wty2p5g0I6QNcZ4 +VYcgoc/lbQrISXwxmDNsIumH0DJaoroTghHtORedmTpyoeb6pNnVFzF1roV9Iq4/ +AUaG9ih5yLHa5FcXxH4cDrC0kqZWs72yl+2qp/C3xag/lRbQ/6GW6whfGHdPAgMB +AAGjYzBhMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQW +BBRF66Kv9JLLgjEtUYunpyGd823IDzAfBgNVHSMEGDAWgBRF66Kv9JLLgjEtUYun +pyGd823IDzANBgkqhkiG9w0BAQUFAAOCAQEAog683+Lt8ONyc3pklL/3cmbYMuRC +dWKuh+vy1dneVrOfzM4UKLkNl2BcEkxY5NM9g0lFWJc1aRqoR+pWxnmrEthngYTf +fwk8lOa4JiwgvT2zKIn3X/8i4peEH+ll74fg38FnSbNd67IJKusm7Xi+fT8r87cm +NW1fiQG2SVufAQWbqz0lwcy2f8Lxb4bG+mRo64EtlOtCt/qMHt1i8b5QZ7dsvfPx +H2sMNgcWfzd8qVttevESRmCD1ycEvkvOl77DZypoEd+A5wwzZr8TDRRu838fYxAe ++o0bJW1sj6W3YQGx0qMmoRBxna3iw/nDmVG3KwcIzi7mULKn+gpFL6Lw8g== +-----END CERTIFICATE----- + +# Issuer: CN=DigiCert Global Root CA O=DigiCert Inc OU=www.digicert.com +# Subject: CN=DigiCert Global Root CA O=DigiCert Inc OU=www.digicert.com +# Label: "DigiCert Global Root CA" +# Serial: 10944719598952040374951832963794454346 +# MD5 Fingerprint: 79:e4:a9:84:0d:7d:3a:96:d7:c0:4f:e2:43:4c:89:2e +# SHA1 Fingerprint: a8:98:5d:3a:65:e5:e5:c4:b2:d7:d6:6d:40:c6:dd:2f:b1:9c:54:36 +# SHA256 Fingerprint: 43:48:a0:e9:44:4c:78:cb:26:5e:05:8d:5e:89:44:b4:d8:4f:96:62:bd:26:db:25:7f:89:34:a4:43:c7:01:61 +-----BEGIN CERTIFICATE----- +MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBh +MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSAwHgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBD +QTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAwMDAwMDBaMGExCzAJBgNVBAYTAlVT +MRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5kaWdpY2VydC5j +b20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkqhkiG +9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsB +CSDMAZOnTjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97 +nh6Vfe63SKMI2tavegw5BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt +43C/dxC//AH2hdmoRBBYMql1GNXRor5H4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7P +T19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y7vrTC0LUq7dBMtoM1O/4 +gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQABo2MwYTAO +BgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbR +TLtm8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUw +DQYJKoZIhvcNAQEFBQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/Esr +hMAtudXH/vTBH1jLuG2cenTnmCmrEbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg +06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIttep3Sp+dWOIrWcBAI+0tKIJF +PnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886UAb3LujEV0ls +YSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk +CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4= +-----END CERTIFICATE----- + +# Issuer: CN=DigiCert High Assurance EV Root CA O=DigiCert Inc OU=www.digicert.com +# Subject: CN=DigiCert High Assurance EV Root CA O=DigiCert Inc OU=www.digicert.com +# Label: "DigiCert High Assurance EV Root CA" +# Serial: 3553400076410547919724730734378100087 +# MD5 Fingerprint: d4:74:de:57:5c:39:b2:d3:9c:85:83:c5:c0:65:49:8a +# SHA1 Fingerprint: 5f:b7:ee:06:33:e2:59:db:ad:0c:4c:9a:e6:d3:8f:1a:61:c7:dc:25 +# SHA256 Fingerprint: 74:31:e5:f4:c3:c1:ce:46:90:77:4f:0b:61:e0:54:40:88:3b:a9:a0:1e:d0:0b:a6:ab:d7:80:6e:d3:b1:18:cf +-----BEGIN CERTIFICATE----- +MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBs +MQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSswKQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5j +ZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAwMFoXDTMxMTExMDAwMDAwMFowbDEL +MAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZMBcGA1UECxMQd3d3 +LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFuY2Ug +RVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm ++9S75S0tMqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTW +PNt0OKRKzE0lgvdKpVMSOO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEM +xChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFB +Ik5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQNAQTXKFx01p8VdteZOE3 +hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUeh10aUAsg +EsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQF +MAMBAf8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaA +FLE+w2kD+L9HAdSYJhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3Nec +nzyIZgYIVyHbIUf4KmeqvxgydkAQV8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6z +eM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFpmyPInngiK3BD41VHMWEZ71jF +hS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkKmNEVX58Svnw2 +Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe +vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep ++OkuE6N36B9K +-----END CERTIFICATE----- + +# Issuer: CN=GeoTrust Primary Certification Authority O=GeoTrust Inc. +# Subject: CN=GeoTrust Primary Certification Authority O=GeoTrust Inc. +# Label: "GeoTrust Primary Certification Authority" +# Serial: 32798226551256963324313806436981982369 +# MD5 Fingerprint: 02:26:c3:01:5e:08:30:37:43:a9:d0:7d:cf:37:e6:bf +# SHA1 Fingerprint: 32:3c:11:8e:1b:f7:b8:b6:52:54:e2:e2:10:0d:d6:02:90:37:f0:96 +# SHA256 Fingerprint: 37:d5:10:06:c5:12:ea:ab:62:64:21:f1:ec:8c:92:01:3f:c5:f8:2a:e9:8e:e5:33:eb:46:19:b8:de:b4:d0:6c +-----BEGIN CERTIFICATE----- +MIIDfDCCAmSgAwIBAgIQGKy1av1pthU6Y2yv2vrEoTANBgkqhkiG9w0BAQUFADBY +MQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjExMC8GA1UEAxMo +R2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjEx +MjcwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMFgxCzAJBgNVBAYTAlVTMRYwFAYDVQQK +Ew1HZW9UcnVzdCBJbmMuMTEwLwYDVQQDEyhHZW9UcnVzdCBQcmltYXJ5IENlcnRp +ZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC +AQEAvrgVe//UfH1nrYNke8hCUy3f9oQIIGHWAVlqnEQRr+92/ZV+zmEwu3qDXwK9 +AWbK7hWNb6EwnL2hhZ6UOvNWiAAxz9juapYC2e0DjPt1befquFUWBRaa9OBesYjA +ZIVcFU2Ix7e64HXprQU9nceJSOC7KMgD4TCTZF5SwFlwIjVXiIrxlQqD17wxcwE0 +7e9GceBrAqg1cmuXm2bgyxx5X9gaBGgeRwLmnWDiNpcB3841kt++Z8dtd1k7j53W +kBWUvEI0EME5+bEnPn7WinXFsq+W06Lem+SYvn3h6YGttm/81w7a4DSwDRp35+MI +mO9Y+pyEtzavwt+s0vQQBnBxNQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4G +A1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQULNVQQZcVi/CPNmFbSvtr2ZnJM5IwDQYJ +KoZIhvcNAQEFBQADggEBAFpwfyzdtzRP9YZRqSa+S7iq8XEN3GHHoOo0Hnp3DwQ1 +6CePbJC/kRYkRj5KTs4rFtULUh38H2eiAkUxT87z+gOneZ1TatnaYzr4gNfTmeGl +4b7UVXGYNTq+k+qurUKykG/g/CFNNWMziUnWm07Kx+dOCQD32sfvmWKZd7aVIl6K +oKv0uHiYyjgZmclynnjNS6yvGaBzEi38wkG6gZHaFloxt/m0cYASSJlyc1pZU8Fj +UjPtp8nSOQJw+uCxQmYpqptR7TBUIhRf2asdweSU8Pj1K/fqynhG1riR/aYNKxoU +AT6A8EKglQdebc3MS6RFjasS6LPeWuWgfOgPIh1a6Vk= +-----END CERTIFICATE----- + +# Issuer: CN=thawte Primary Root CA O=thawte, Inc. OU=Certification Services Division/(c) 2006 thawte, Inc. - For authorized use only +# Subject: CN=thawte Primary Root CA O=thawte, Inc. OU=Certification Services Division/(c) 2006 thawte, Inc. - For authorized use only +# Label: "thawte Primary Root CA" +# Serial: 69529181992039203566298953787712940909 +# MD5 Fingerprint: 8c:ca:dc:0b:22:ce:f5:be:72:ac:41:1a:11:a8:d8:12 +# SHA1 Fingerprint: 91:c6:d6:ee:3e:8a:c8:63:84:e5:48:c2:99:29:5c:75:6c:81:7b:81 +# SHA256 Fingerprint: 8d:72:2f:81:a9:c1:13:c0:79:1d:f1:36:a2:96:6d:b2:6c:95:0a:97:1d:b4:6b:41:99:f4:ea:54:b7:8b:fb:9f +-----BEGIN CERTIFICATE----- +MIIEIDCCAwigAwIBAgIQNE7VVyDV7exJ9C/ON9srbTANBgkqhkiG9w0BAQUFADCB +qTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMf +Q2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIw +MDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxHzAdBgNV +BAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwHhcNMDYxMTE3MDAwMDAwWhcNMzYw +NzE2MjM1OTU5WjCBqTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5j +LjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYG +A1UECxMvKGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl +IG9ubHkxHzAdBgNVBAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwggEiMA0GCSqG +SIb3DQEBAQUAA4IBDwAwggEKAoIBAQCsoPD7gFnUnMekz52hWXMJEEUMDSxuaPFs +W0hoSVk3/AszGcJ3f8wQLZU0HObrTQmnHNK4yZc2AreJ1CRfBsDMRJSUjQJib+ta +3RGNKJpchJAQeg29dGYvajig4tVUROsdB58Hum/u6f1OCyn1PoSgAfGcq/gcfomk +6KHYcWUNo1F77rzSImANuVud37r8UVsLr5iy6S7pBOhih94ryNdOwUxkHt3Ph1i6 +Sk/KaAcdHJ1KxtUvkcx8cXIcxcBn6zL9yZJclNqFwJu/U30rCfSMnZEfl2pSy94J +NqR32HuHUETVPm4pafs5SSYeCaWAe0At6+gnhcn+Yf1+5nyXHdWdAgMBAAGjQjBA +MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBR7W0XP +r87Lev0xkhpqtvNG61dIUDANBgkqhkiG9w0BAQUFAAOCAQEAeRHAS7ORtvzw6WfU +DW5FvlXok9LOAz/t2iWwHVfLHjp2oEzsUHboZHIMpKnxuIvW1oeEuzLlQRHAd9mz +YJ3rG9XRbkREqaYB7FViHXe4XI5ISXycO1cRrK1zN44veFyQaEfZYGDm/Ac9IiAX +xPcW6cTYcvnIc3zfFi8VqT79aie2oetaupgf1eNNZAqdE8hhuvU5HIe6uL17In/2 +/qxAeeWsEG89jxt5dovEN7MhGITlNgDrYyCZuen+MwS7QcjBAvlEYyCegc5C09Y/ +LHbTY5xZ3Y+m4Q6gLkH3LpVHz7z9M/P2C2F+fpErgUfCJzDupxBdN49cOSvkBPB7 +jVaMaA== +-----END CERTIFICATE----- + +# Issuer: CN=VeriSign Class 3 Public Primary Certification Authority - G5 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 2006 VeriSign, Inc. - For authorized use only +# Subject: CN=VeriSign Class 3 Public Primary Certification Authority - G5 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 2006 VeriSign, Inc. - For authorized use only +# Label: "VeriSign Class 3 Public Primary Certification Authority - G5" +# Serial: 33037644167568058970164719475676101450 +# MD5 Fingerprint: cb:17:e4:31:67:3e:e2:09:fe:45:57:93:f3:0a:fa:1c +# SHA1 Fingerprint: 4e:b6:d5:78:49:9b:1c:cf:5f:58:1e:ad:56:be:3d:9b:67:44:a5:e5 +# SHA256 Fingerprint: 9a:cf:ab:7e:43:c8:d8:80:d0:6b:26:2a:94:de:ee:e4:b4:65:99:89:c3:d0:ca:f1:9b:af:64:05:e4:1a:b7:df +-----BEGIN CERTIFICATE----- +MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCB +yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL +ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJp +U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxW +ZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCByjEL +MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZW +ZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2ln +biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJp +U2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9y +aXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvJAgIKXo1 +nmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKzj/i5Vbex +t0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIz +SdhDY2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQG +BO+QueQA5N06tRn/Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+ +rCpSx4/VBEnkjWNHiDxpg8v+R70rfk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/ +NIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8E +BAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEwHzAH +BgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy +aXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKv +MzEzMA0GCSqGSIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzE +p6B4Eq1iDkVwZMXnl2YtmAl+X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y +5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKEKQsTb47bDN0lAtukixlE0kF6BWlK +WE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiCKm0oHw0LxOXnGiYZ +4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vEZV8N +hnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq +-----END CERTIFICATE----- + +# Issuer: CN=COMODO Certification Authority O=COMODO CA Limited +# Subject: CN=COMODO Certification Authority O=COMODO CA Limited +# Label: "COMODO Certification Authority" +# Serial: 104350513648249232941998508985834464573 +# MD5 Fingerprint: 5c:48:dc:f7:42:72:ec:56:94:6d:1c:cc:71:35:80:75 +# SHA1 Fingerprint: 66:31:bf:9e:f7:4f:9e:b6:c9:d5:a6:0c:ba:6a:be:d1:f7:bd:ef:7b +# SHA256 Fingerprint: 0c:2c:d6:3d:f7:80:6f:a3:99:ed:e8:09:11:6b:57:5b:f8:79:89:f0:65:18:f9:80:8c:86:05:03:17:8b:af:66 +-----BEGIN CERTIFICATE----- +MIIEHTCCAwWgAwIBAgIQToEtioJl4AsC7j41AkblPTANBgkqhkiG9w0BAQUFADCB +gTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4G +A1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxJzAlBgNV +BAMTHkNPTU9ETyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjEyMDEwMDAw +MDBaFw0yOTEyMzEyMzU5NTlaMIGBMQswCQYDVQQGEwJHQjEbMBkGA1UECBMSR3Jl +YXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRowGAYDVQQKExFDT01P +RE8gQ0EgTGltaXRlZDEnMCUGA1UEAxMeQ09NT0RPIENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0ECLi3LjkRv3 +UcEbVASY06m/weaKXTuH+7uIzg3jLz8GlvCiKVCZrts7oVewdFFxze1CkU1B/qnI +2GqGd0S7WWaXUF601CxwRM/aN5VCaTwwxHGzUvAhTaHYujl8HJ6jJJ3ygxaYqhZ8 +Q5sVW7euNJH+1GImGEaaP+vB+fGQV+useg2L23IwambV4EajcNxo2f8ESIl33rXp ++2dtQem8Ob0y2WIC8bGoPW43nOIv4tOiJovGuFVDiOEjPqXSJDlqR6sA1KGzqSX+ +DT+nHbrTUcELpNqsOO9VUCQFZUaTNE8tja3G1CEZ0o7KBWFxB3NH5YoZEr0ETc5O +nKVIrLsm9wIDAQABo4GOMIGLMB0GA1UdDgQWBBQLWOWLxkwVN6RAqTCpIb5HNlpW +/zAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zBJBgNVHR8EQjBAMD6g +PKA6hjhodHRwOi8vY3JsLmNvbW9kb2NhLmNvbS9DT01PRE9DZXJ0aWZpY2F0aW9u +QXV0aG9yaXR5LmNybDANBgkqhkiG9w0BAQUFAAOCAQEAPpiem/Yb6dc5t3iuHXIY +SdOH5EOC6z/JqvWote9VfCFSZfnVDeFs9D6Mk3ORLgLETgdxb8CPOGEIqB6BCsAv +IC9Bi5HcSEW88cbeunZrM8gALTFGTO3nnc+IlP8zwFboJIYmuNg4ON8qa90SzMc/ +RxdMosIGlgnW2/4/PEZB31jiVg88O8EckzXZOFKs7sjsLjBOlDW0JB9LeGna8gI4 +zJVSk/BwJVmcIGfE7vmLV2H0knZ9P4SNVbfo5azV8fUZVqZa+5Acr5Pr5RzUZ5dd +BA6+C4OmF4O5MBKgxTMVBbkN+8cFduPYSo38NBejxiEovjBFMR7HeL5YYTisO+IB +ZQ== +-----END CERTIFICATE----- + +# Issuer: CN=Network Solutions Certificate Authority O=Network Solutions L.L.C. +# Subject: CN=Network Solutions Certificate Authority O=Network Solutions L.L.C. +# Label: "Network Solutions Certificate Authority" +# Serial: 116697915152937497490437556386812487904 +# MD5 Fingerprint: d3:f3:a6:16:c0:fa:6b:1d:59:b1:2d:96:4d:0e:11:2e +# SHA1 Fingerprint: 74:f8:a3:c3:ef:e7:b3:90:06:4b:83:90:3c:21:64:60:20:e5:df:ce +# SHA256 Fingerprint: 15:f0:ba:00:a3:ac:7a:f3:ac:88:4c:07:2b:10:11:a0:77:bd:77:c0:97:f4:01:64:b2:f8:59:8a:bd:83:86:0c +-----BEGIN CERTIFICATE----- +MIID5jCCAs6gAwIBAgIQV8szb8JcFuZHFhfjkDFo4DANBgkqhkiG9w0BAQUFADBi +MQswCQYDVQQGEwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMu +MTAwLgYDVQQDEydOZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3Jp +dHkwHhcNMDYxMjAxMDAwMDAwWhcNMjkxMjMxMjM1OTU5WjBiMQswCQYDVQQGEwJV +UzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMuMTAwLgYDVQQDEydO +ZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0GCSqG +SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDkvH6SMG3G2I4rC7xGzuAnlt7e+foS0zwz +c7MEL7xxjOWftiJgPl9dzgn/ggwbmlFQGiaJ3dVhXRncEg8tCqJDXRfQNJIg6nPP +OCwGJgl6cvf6UDL4wpPTaaIjzkGxzOTVHzbRijr4jGPiFFlp7Q3Tf2vouAPlT2rl +mGNpSAW+Lv8ztumXWWn4Zxmuk2GWRBXTcrA/vGp97Eh/jcOrqnErU2lBUzS1sLnF +BgrEsEX1QV1uiUV7PTsmjHTC5dLRfbIR1PtYMiKagMnc/Qzpf14Dl847ABSHJ3A4 +qY5usyd2mFHgBeMhqxrVhSI8KbWaFsWAqPS7azCPL0YCorEMIuDTAgMBAAGjgZcw +gZQwHQYDVR0OBBYEFCEwyfsA106Y2oeqKtCnLrFAMadMMA4GA1UdDwEB/wQEAwIB +BjAPBgNVHRMBAf8EBTADAQH/MFIGA1UdHwRLMEkwR6BFoEOGQWh0dHA6Ly9jcmwu +bmV0c29sc3NsLmNvbS9OZXR3b3JrU29sdXRpb25zQ2VydGlmaWNhdGVBdXRob3Jp +dHkuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQC7rkvnt1frf6ott3NHhWrB5KUd5Oc8 +6fRZZXe1eltajSU24HqXLjjAV2CDmAaDn7l2em5Q4LqILPxFzBiwmZVRDuwduIj/ +h1AcgsLj4DKAv6ALR8jDMe+ZZzKATxcheQxpXN5eNK4CtSbqUN9/GGUsyfJj4akH +/nxxH2szJGoeBfcFaMBqEssuXmHLrijTfsK0ZpEmXzwuJF/LWA/rKOyvEZbz3Htv +wKeI8lN3s2Berq4o2jUsbzRF0ybh3uxbTydrFny9RAQYgrOJeRcQcT16ohZO9QHN +pGxlaKFJdlxDydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey +-----END CERTIFICATE----- + +# Issuer: CN=COMODO ECC Certification Authority O=COMODO CA Limited +# Subject: CN=COMODO ECC Certification Authority O=COMODO CA Limited +# Label: "COMODO ECC Certification Authority" +# Serial: 41578283867086692638256921589707938090 +# MD5 Fingerprint: 7c:62:ff:74:9d:31:53:5e:68:4a:d5:78:aa:1e:bf:23 +# SHA1 Fingerprint: 9f:74:4e:9f:2b:4d:ba:ec:0f:31:2c:50:b6:56:3b:8e:2d:93:c3:11 +# SHA256 Fingerprint: 17:93:92:7a:06:14:54:97:89:ad:ce:2f:8f:34:f7:f0:b6:6d:0f:3a:e3:a3:b8:4d:21:ec:15:db:ba:4f:ad:c7 +-----BEGIN CERTIFICATE----- +MIICiTCCAg+gAwIBAgIQH0evqmIAcFBUTAGem2OZKjAKBggqhkjOPQQDAzCBhTEL +MAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UE +BxMHU2FsZm9yZDEaMBgGA1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMT +IkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDgwMzA2MDAw +MDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0IxGzAZBgNVBAgTEkdy +ZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMRQ09N +T0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlv +biBBdXRob3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQDR3svdcmCFYX7deSR +FtSrYpn1PlILBs5BAH+X4QokPB0BBO490o0JlwzgdeT6+3eKKvUDYEs2ixYjFq0J +cfRK9ChQtP6IHG4/bC8vCVlbpVsLM5niwz2J+Wos77LTBumjQjBAMB0GA1UdDgQW +BBR1cacZSBm8nZ3qQUfflMRId5nTeTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/ +BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjEA7wNbeqy3eApyt4jf/7VGFAkK+qDm +fQjGGoe9GKhzvSbKYAydzpmfz1wPMOG+FDHqAjAU9JM8SaczepBGR7NjfRObTrdv +GDeAU/7dIOA1mjbRxwG55tzd8/8dLDoWV9mSOdY= +-----END CERTIFICATE----- + +# Issuer: CN=TC TrustCenter Class 2 CA II O=TC TrustCenter GmbH OU=TC TrustCenter Class 2 CA +# Subject: CN=TC TrustCenter Class 2 CA II O=TC TrustCenter GmbH OU=TC TrustCenter Class 2 CA +# Label: "TC TrustCenter Class 2 CA II" +# Serial: 941389028203453866782103406992443 +# MD5 Fingerprint: ce:78:33:5c:59:78:01:6e:18:ea:b9:36:a0:b9:2e:23 +# SHA1 Fingerprint: ae:50:83:ed:7c:f4:5c:bc:8f:61:c6:21:fe:68:5d:79:42:21:15:6e +# SHA256 Fingerprint: e6:b8:f8:76:64:85:f8:07:ae:7f:8d:ac:16:70:46:1f:07:c0:a1:3e:ef:3a:1f:f7:17:53:8d:7a:ba:d3:91:b4 +-----BEGIN CERTIFICATE----- +MIIEqjCCA5KgAwIBAgIOLmoAAQACH9dSISwRXDswDQYJKoZIhvcNAQEFBQAwdjEL +MAkGA1UEBhMCREUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNV +BAsTGVRDIFRydXN0Q2VudGVyIENsYXNzIDIgQ0ExJTAjBgNVBAMTHFRDIFRydXN0 +Q2VudGVyIENsYXNzIDIgQ0EgSUkwHhcNMDYwMTEyMTQzODQzWhcNMjUxMjMxMjI1 +OTU5WjB2MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1c3RDZW50ZXIgR21i +SDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBDQTElMCMGA1UEAxMc +VEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMiBDQSBJSTCCASIwDQYJKoZIhvcNAQEBBQAD +ggEPADCCAQoCggEBAKuAh5uO8MN8h9foJIIRszzdQ2Lu+MNF2ujhoF/RKrLqk2jf +tMjWQ+nEdVl//OEd+DFwIxuInie5e/060smp6RQvkL4DUsFJzfb95AhmC1eKokKg +uNV/aVyQMrKXDcpK3EY+AlWJU+MaWss2xgdW94zPEfRMuzBwBJWl9jmM/XOBCH2J +XjIeIqkiRUuwZi4wzJ9l/fzLganx4Duvo4bRierERXlQXa7pIXSSTYtZgo+U4+lK +8edJsBTj9WLL1XK9H7nSn6DNqPoByNkN39r8R52zyFTfSUrxIan+GE7uSNQZu+99 +5OKdy1u2bv/jzVrndIIFuoAlOMvkaZ6vQaoahPUCAwEAAaOCATQwggEwMA8GA1Ud +EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTjq1RMgKHbVkO3 +kUrL84J6E1wIqzCB7QYDVR0fBIHlMIHiMIHfoIHcoIHZhjVodHRwOi8vd3d3LnRy +dXN0Y2VudGVyLmRlL2NybC92Mi90Y19jbGFzc18yX2NhX0lJLmNybIaBn2xkYXA6 +Ly93d3cudHJ1c3RjZW50ZXIuZGUvQ049VEMlMjBUcnVzdENlbnRlciUyMENsYXNz +JTIwMiUyMENBJTIwSUksTz1UQyUyMFRydXN0Q2VudGVyJTIwR21iSCxPVT1yb290 +Y2VydHMsREM9dHJ1c3RjZW50ZXIsREM9ZGU/Y2VydGlmaWNhdGVSZXZvY2F0aW9u +TGlzdD9iYXNlPzANBgkqhkiG9w0BAQUFAAOCAQEAjNfffu4bgBCzg/XbEeprS6iS +GNn3Bzn1LL4GdXpoUxUc6krtXvwjshOg0wn/9vYua0Fxec3ibf2uWWuFHbhOIprt +ZjluS5TmVfwLG4t3wVMTZonZKNaL80VKY7f9ewthXbhtvsPcW3nS7Yblok2+XnR8 +au0WOB9/WIFaGusyiC2y8zl3gK9etmF1KdsjTYjKUCjLhdLTEKJZbtOTVAB6okaV +hgWcqRmY5TFyDADiZ9lA4CQze28suVyrZZ0srHbqNZn1l7kPJOzHdiEoZa5X6AeI +dUpWoNIFOqTmjZKILPPy4cHGYdtBxceb9w4aUUXCYWvcZCcXjFq32nQozZfkvQ== +-----END CERTIFICATE----- + +# Issuer: CN=TC TrustCenter Class 3 CA II O=TC TrustCenter GmbH OU=TC TrustCenter Class 3 CA +# Subject: CN=TC TrustCenter Class 3 CA II O=TC TrustCenter GmbH OU=TC TrustCenter Class 3 CA +# Label: "TC TrustCenter Class 3 CA II" +# Serial: 1506523511417715638772220530020799 +# MD5 Fingerprint: 56:5f:aa:80:61:12:17:f6:67:21:e6:2b:6d:61:56:8e +# SHA1 Fingerprint: 80:25:ef:f4:6e:70:c8:d4:72:24:65:84:fe:40:3b:8a:8d:6a:db:f5 +# SHA256 Fingerprint: 8d:a0:84:fc:f9:9c:e0:77:22:f8:9b:32:05:93:98:06:fa:5c:b8:11:e1:c8:13:f6:a1:08:c7:d3:36:b3:40:8e +-----BEGIN CERTIFICATE----- +MIIEqjCCA5KgAwIBAgIOSkcAAQAC5aBd1j8AUb8wDQYJKoZIhvcNAQEFBQAwdjEL +MAkGA1UEBhMCREUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxIjAgBgNV +BAsTGVRDIFRydXN0Q2VudGVyIENsYXNzIDMgQ0ExJTAjBgNVBAMTHFRDIFRydXN0 +Q2VudGVyIENsYXNzIDMgQ0EgSUkwHhcNMDYwMTEyMTQ0MTU3WhcNMjUxMjMxMjI1 +OTU5WjB2MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1c3RDZW50ZXIgR21i +SDEiMCAGA1UECxMZVEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMyBDQTElMCMGA1UEAxMc +VEMgVHJ1c3RDZW50ZXIgQ2xhc3MgMyBDQSBJSTCCASIwDQYJKoZIhvcNAQEBBQAD +ggEPADCCAQoCggEBALTgu1G7OVyLBMVMeRwjhjEQY0NVJz/GRcekPewJDRoeIMJW +Ht4bNwcwIi9v8Qbxq63WyKthoy9DxLCyLfzDlml7forkzMA5EpBCYMnMNWju2l+Q +Vl/NHE1bWEnrDgFPZPosPIlY2C8u4rBo6SI7dYnWRBpl8huXJh0obazovVkdKyT2 +1oQDZogkAHhg8fir/gKya/si+zXmFtGt9i4S5Po1auUZuV3bOx4a+9P/FRQI2Alq +ukWdFHlgfa9Aigdzs5OW03Q0jTo3Kd5c7PXuLjHCINy+8U9/I1LZW+Jk2ZyqBwi1 +Rb3R0DHBq1SfqdLDYmAD8bs5SpJKPQq5ncWg/jcCAwEAAaOCATQwggEwMA8GA1Ud +EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTUovyfs8PYA9NX +XAek0CSnwPIA1DCB7QYDVR0fBIHlMIHiMIHfoIHcoIHZhjVodHRwOi8vd3d3LnRy +dXN0Y2VudGVyLmRlL2NybC92Mi90Y19jbGFzc18zX2NhX0lJLmNybIaBn2xkYXA6 +Ly93d3cudHJ1c3RjZW50ZXIuZGUvQ049VEMlMjBUcnVzdENlbnRlciUyMENsYXNz +JTIwMyUyMENBJTIwSUksTz1UQyUyMFRydXN0Q2VudGVyJTIwR21iSCxPVT1yb290 +Y2VydHMsREM9dHJ1c3RjZW50ZXIsREM9ZGU/Y2VydGlmaWNhdGVSZXZvY2F0aW9u +TGlzdD9iYXNlPzANBgkqhkiG9w0BAQUFAAOCAQEANmDkcPcGIEPZIxpC8vijsrlN +irTzwppVMXzEO2eatN9NDoqTSheLG43KieHPOh6sHfGcMrSOWXaiQYUlN6AT0PV8 +TtXqluJucsG7Kv5sbviRmEb8yRtXW+rIGjs/sFGYPAfaLFkB2otE6OF0/ado3VS6 +g0bsyEa1+K+XwDsJHI/OcpY9M1ZwvJbL2NV9IJqDnxrcOfHFcqMRA/07QlIp2+gB +95tejNaNhk4Z+rwcvsUhpYeeeC422wlxo3I0+GzjBgnyXlal092Y+tTmBvTwtiBj +S+opvaqCZh77gaqnN60TGOaSw4HBM7uIHqHn4rS9MWwOUT1v+5ZWgOI2F9Hc5A== +-----END CERTIFICATE----- + +# Issuer: CN=TC TrustCenter Universal CA I O=TC TrustCenter GmbH OU=TC TrustCenter Universal CA +# Subject: CN=TC TrustCenter Universal CA I O=TC TrustCenter GmbH OU=TC TrustCenter Universal CA +# Label: "TC TrustCenter Universal CA I" +# Serial: 601024842042189035295619584734726 +# MD5 Fingerprint: 45:e1:a5:72:c5:a9:36:64:40:9e:f5:e4:58:84:67:8c +# SHA1 Fingerprint: 6b:2f:34:ad:89:58:be:62:fd:b0:6b:5c:ce:bb:9d:d9:4f:4e:39:f3 +# SHA256 Fingerprint: eb:f3:c0:2a:87:89:b1:fb:7d:51:19:95:d6:63:b7:29:06:d9:13:ce:0d:5e:10:56:8a:8a:77:e2:58:61:67:e7 +-----BEGIN CERTIFICATE----- +MIID3TCCAsWgAwIBAgIOHaIAAQAC7LdggHiNtgYwDQYJKoZIhvcNAQEFBQAweTEL +MAkGA1UEBhMCREUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxJDAiBgNV +BAsTG1RDIFRydXN0Q2VudGVyIFVuaXZlcnNhbCBDQTEmMCQGA1UEAxMdVEMgVHJ1 +c3RDZW50ZXIgVW5pdmVyc2FsIENBIEkwHhcNMDYwMzIyMTU1NDI4WhcNMjUxMjMx +MjI1OTU5WjB5MQswCQYDVQQGEwJERTEcMBoGA1UEChMTVEMgVHJ1c3RDZW50ZXIg +R21iSDEkMCIGA1UECxMbVEMgVHJ1c3RDZW50ZXIgVW5pdmVyc2FsIENBMSYwJAYD +VQQDEx1UQyBUcnVzdENlbnRlciBVbml2ZXJzYWwgQ0EgSTCCASIwDQYJKoZIhvcN +AQEBBQADggEPADCCAQoCggEBAKR3I5ZEr5D0MacQ9CaHnPM42Q9e3s9B6DGtxnSR +JJZ4Hgmgm5qVSkr1YnwCqMqs+1oEdjneX/H5s7/zA1hV0qq34wQi0fiU2iIIAI3T +fCZdzHd55yx4Oagmcw6iXSVphU9VDprvxrlE4Vc93x9UIuVvZaozhDrzznq+VZeu +jRIPFDPiUHDDSYcTvFHe15gSWu86gzOSBnWLknwSaHtwag+1m7Z3W0hZneTvWq3z +wZ7U10VOylY0Ibw+F1tvdwxIAUMpsN0/lm7mlaoMwCC2/T42J5zjXM9OgdwZu5GQ +fezmlwQek8wiSdeXhrYTCjxDI3d+8NzmzSQfO4ObNDqDNOMCAwEAAaNjMGEwHwYD +VR0jBBgwFoAUkqR1LKSevoFE63n8isWVpesQdXMwDwYDVR0TAQH/BAUwAwEB/zAO +BgNVHQ8BAf8EBAMCAYYwHQYDVR0OBBYEFJKkdSyknr6BROt5/IrFlaXrEHVzMA0G +CSqGSIb3DQEBBQUAA4IBAQAo0uCG1eb4e/CX3CJrO5UUVg8RMKWaTzqwOuAGy2X1 +7caXJ/4l8lfmXpWMPmRgFVp/Lw0BxbFg/UU1z/CyvwbZ71q+s2IhtNerNXxTPqYn +8aEt2hojnczd7Dwtnic0XQ/CNnm8yUpiLe1r2X1BQ3y2qsrtYbE3ghUJGooWMNjs +ydZHcnhLEEYUjl8Or+zHL6sQ17bxbuyGssLoDZJz3KL0Dzq/YSMQiZxIQG5wALPT +ujdEWBF6AmqI8Dc08BnprNRlc/ZpjGSUOnmFKbAWKwyCPwacx/0QK54PLLae4xW/ +2TYcuiUaUj0a7CIMHOCkoj3w6DnPgcB77V0fb8XQC9eY +-----END CERTIFICATE----- + +# Issuer: CN=Cybertrust Global Root O=Cybertrust, Inc +# Subject: CN=Cybertrust Global Root O=Cybertrust, Inc +# Label: "Cybertrust Global Root" +# Serial: 4835703278459682877484360 +# MD5 Fingerprint: 72:e4:4a:87:e3:69:40:80:77:ea:bc:e3:f4:ff:f0:e1 +# SHA1 Fingerprint: 5f:43:e5:b1:bf:f8:78:8c:ac:1c:c7:ca:4a:9a:c6:22:2b:cc:34:c6 +# SHA256 Fingerprint: 96:0a:df:00:63:e9:63:56:75:0c:29:65:dd:0a:08:67:da:0b:9c:bd:6e:77:71:4a:ea:fb:23:49:ab:39:3d:a3 +-----BEGIN CERTIFICATE----- +MIIDoTCCAomgAwIBAgILBAAAAAABD4WqLUgwDQYJKoZIhvcNAQEFBQAwOzEYMBYG +A1UEChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2Jh +bCBSb290MB4XDTA2MTIxNTA4MDAwMFoXDTIxMTIxNTA4MDAwMFowOzEYMBYGA1UE +ChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2JhbCBS +b290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA+Mi8vRRQZhP/8NN5 +7CPytxrHjoXxEnOmGaoQ25yiZXRadz5RfVb23CO21O1fWLE3TdVJDm71aofW0ozS +J8bi/zafmGWgE07GKmSb1ZASzxQG9Dvj1Ci+6A74q05IlG2OlTEQXO2iLb3VOm2y +HLtgwEZLAfVJrn5GitB0jaEMAs7u/OePuGtm839EAL9mJRQr3RAwHQeWP032a7iP +t3sMpTjr3kfb1V05/Iin89cqdPHoWqI7n1C6poxFNcJQZZXcY4Lv3b93TZxiyWNz +FtApD0mpSPCzqrdsxacwOUBdrsTiXSZT8M4cIwhhqJQZugRiQOwfOHB3EgZxpzAY +XSUnpQIDAQABo4GlMIGiMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/ +MB0GA1UdDgQWBBS2CHsNesysIEyGVjJez6tuhS1wVzA/BgNVHR8EODA2MDSgMqAw +hi5odHRwOi8vd3d3Mi5wdWJsaWMtdHJ1c3QuY29tL2NybC9jdC9jdHJvb3QuY3Js +MB8GA1UdIwQYMBaAFLYIew16zKwgTIZWMl7Pq26FLXBXMA0GCSqGSIb3DQEBBQUA +A4IBAQBW7wojoFROlZfJ+InaRcHUowAl9B8Tq7ejhVhpwjCt2BWKLePJzYFa+HMj +Wqd8BfP9IjsO0QbE2zZMcwSO5bAi5MXzLqXZI+O4Tkogp24CJJ8iYGd7ix1yCcUx +XOl5n4BHPa2hCwcUPUf/A2kaDAtE52Mlp3+yybh2hO0j9n0Hq0V+09+zv+mKts2o +omcrUtW3ZfA5TGOgkXmTUg9U3YO7n9GPp1Nzw8v/MOx8BLjYRB+TX3EJIrduPuoc +A06dGiBh+4E37F78CkWr1+cXVdCg6mCbpvbjjFspwgZgFJ0tl0ypkxWdYcQBX0jW +WL1WMRJOEcgh4LMRkWXbtKaIOM5V +-----END CERTIFICATE----- + +# Issuer: CN=GeoTrust Primary Certification Authority - G3 O=GeoTrust Inc. OU=(c) 2008 GeoTrust Inc. - For authorized use only +# Subject: CN=GeoTrust Primary Certification Authority - G3 O=GeoTrust Inc. OU=(c) 2008 GeoTrust Inc. - For authorized use only +# Label: "GeoTrust Primary Certification Authority - G3" +# Serial: 28809105769928564313984085209975885599 +# MD5 Fingerprint: b5:e8:34:36:c9:10:44:58:48:70:6d:2e:83:d4:b8:05 +# SHA1 Fingerprint: 03:9e:ed:b8:0b:e7:a0:3c:69:53:89:3b:20:d2:d9:32:3a:4c:2a:fd +# SHA256 Fingerprint: b4:78:b8:12:25:0d:f8:78:63:5c:2a:a7:ec:7d:15:5e:aa:62:5e:e8:29:16:e2:cd:29:43:61:88:6c:d1:fb:d4 +-----BEGIN CERTIFICATE----- +MIID/jCCAuagAwIBAgIQFaxulBmyeUtB9iepwxgPHzANBgkqhkiG9w0BAQsFADCB +mDELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsT +MChjKSAyMDA4IEdlb1RydXN0IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25s +eTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhv +cml0eSAtIEczMB4XDTA4MDQwMjAwMDAwMFoXDTM3MTIwMTIzNTk1OVowgZgxCzAJ +BgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykg +MjAwOCBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0 +BgNVBAMTLUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg +LSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANziXmJYHTNXOTIz ++uvLh4yn1ErdBojqZI4xmKU4kB6Yzy5jK/BGvESyiaHAKAxJcCGVn2TAppMSAmUm +hsalifD614SgcK9PGpc/BkTVyetyEH3kMSj7HGHmKAdEc5IiaacDiGydY8hS2pgn +5whMcD60yRLBxWeDXTPzAxHsatBT4tG6NmCUgLthY2xbF37fQJQeqw3CIShwiP/W +JmxsYAQlTlV+fe+/lEjetx3dcI0FX4ilm/LC7urRQEFtYjgdVgbFA0dRIBn8exAL +DmKudlW/X3e+PkkBUz2YJQN2JFodtNuJ6nnltrM7P7pMKEF/BqxqjsHQ9gUdfeZC +huOl1UcCAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYw +HQYDVR0OBBYEFMR5yo6hTgMdHNxr2zFblD4/MH8tMA0GCSqGSIb3DQEBCwUAA4IB +AQAtxRPPVoB7eni9n64smefv2t+UXglpp+duaIy9cr5HqQ6XErhK8WTTOd8lNNTB +zU6B8A8ExCSzNJbGpqow32hhc9f5joWJ7w5elShKKiePEI4ufIbEAp7aDHdlDkQN +kv39sxY2+hENHYwOB4lqKVb3cvTdFZx3NWZXqxNT2I7BQMXXExZacse3aQHEerGD +AWh9jUGhlBjBJVz88P6DAod8DQ3PLghcSkANPuyBYeYk28rgDi0Hsj5W3I31QYUH +SJsMC8tJP33st/3LjWeJGqvtux6jAAgIFyqCXDFdRootD4abdNlF+9RAsXqqaC2G +spki4cErx5z481+oghLrGREt +-----END CERTIFICATE----- + +# Issuer: CN=thawte Primary Root CA - G2 O=thawte, Inc. OU=(c) 2007 thawte, Inc. - For authorized use only +# Subject: CN=thawte Primary Root CA - G2 O=thawte, Inc. OU=(c) 2007 thawte, Inc. - For authorized use only +# Label: "thawte Primary Root CA - G2" +# Serial: 71758320672825410020661621085256472406 +# MD5 Fingerprint: 74:9d:ea:60:24:c4:fd:22:53:3e:cc:3a:72:d9:29:4f +# SHA1 Fingerprint: aa:db:bc:22:23:8f:c4:01:a1:27:bb:38:dd:f4:1d:db:08:9e:f0:12 +# SHA256 Fingerprint: a4:31:0d:50:af:18:a6:44:71:90:37:2a:86:af:af:8b:95:1f:fb:43:1d:83:7f:1e:56:88:b4:59:71:ed:15:57 +-----BEGIN CERTIFICATE----- +MIICiDCCAg2gAwIBAgIQNfwmXNmET8k9Jj1Xm67XVjAKBggqhkjOPQQDAzCBhDEL +MAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjE4MDYGA1UECxMvKGMp +IDIwMDcgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAi +BgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMjAeFw0wNzExMDUwMDAw +MDBaFw0zODAxMTgyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhh +d3RlLCBJbmMuMTgwNgYDVQQLEy8oYykgMjAwNyB0aGF3dGUsIEluYy4gLSBGb3Ig +YXV0aG9yaXplZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9v +dCBDQSAtIEcyMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEotWcgnuVnfFSeIf+iha/ +BebfowJPDQfGAFG6DAJSLSKkQjnE/o/qycG+1E3/n3qe4rF8mq2nhglzh9HnmuN6 +papu+7qzcMBniKI11KOasf2twu8x+qi58/sIxpHR+ymVo0IwQDAPBgNVHRMBAf8E +BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUmtgAMADna3+FGO6Lts6K +DPgR4bswCgYIKoZIzj0EAwMDaQAwZgIxAN344FdHW6fmCsO99YCKlzUNG4k8VIZ3 +KMqh9HneteY4sPBlcIx/AlTCv//YoT7ZzwIxAMSNlPzcU9LcnXgWHxUzI1NS41ox +XZ3Krr0TKUQNJ1uo52icEvdYPy5yAlejj6EULg== +-----END CERTIFICATE----- + +# Issuer: CN=thawte Primary Root CA - G3 O=thawte, Inc. OU=Certification Services Division/(c) 2008 thawte, Inc. - For authorized use only +# Subject: CN=thawte Primary Root CA - G3 O=thawte, Inc. OU=Certification Services Division/(c) 2008 thawte, Inc. - For authorized use only +# Label: "thawte Primary Root CA - G3" +# Serial: 127614157056681299805556476275995414779 +# MD5 Fingerprint: fb:1b:5d:43:8a:94:cd:44:c6:76:f2:43:4b:47:e7:31 +# SHA1 Fingerprint: f1:8b:53:8d:1b:e9:03:b6:a6:f0:56:43:5b:17:15:89:ca:f3:6b:f2 +# SHA256 Fingerprint: 4b:03:f4:58:07:ad:70:f2:1b:fc:2c:ae:71:c9:fd:e4:60:4c:06:4c:f5:ff:b6:86:ba:e5:db:aa:d7:fd:d3:4c +-----BEGIN CERTIFICATE----- +MIIEKjCCAxKgAwIBAgIQYAGXt0an6rS0mtZLL/eQ+zANBgkqhkiG9w0BAQsFADCB +rjELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMf +Q2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIw +MDggdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAiBgNV +BAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMzAeFw0wODA0MDIwMDAwMDBa +Fw0zNzEyMDEyMzU5NTlaMIGuMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhhd3Rl +LCBJbmMuMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9uIFNlcnZpY2VzIERpdmlzaW9u +MTgwNgYDVQQLEy8oYykgMjAwOCB0aGF3dGUsIEluYy4gLSBGb3IgYXV0aG9yaXpl +ZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAtIEcz +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsr8nLPvb2FvdeHsbnndm +gcs+vHyu86YnmjSjaDFxODNi5PNxZnmxqWWjpYvVj2AtP0LMqmsywCPLLEHd5N/8 +YZzic7IilRFDGF/Eth9XbAoFWCLINkw6fKXRz4aviKdEAhN0cXMKQlkC+BsUa0Lf +b1+6a4KinVvnSr0eAXLbS3ToO39/fR8EtCab4LRarEc9VbjXsCZSKAExQGbY2SS9 +9irY7CFJXJv2eul/VTV+lmuNk5Mny5K76qxAwJ/C+IDPXfRa3M50hqY+bAtTyr2S +zhkGcuYMXDhpxwTWvGzOW/b3aJzcJRVIiKHpqfiYnODz1TEoYRFsZ5aNOZnLwkUk +OQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNV +HQ4EFgQUrWyqlGCc7eT/+j4KdCtjA/e2Wb8wDQYJKoZIhvcNAQELBQADggEBABpA +2JVlrAmSicY59BDlqQ5mU1143vokkbvnRFHfxhY0Cu9qRFHqKweKA3rD6z8KLFIW +oCtDuSWQP3CpMyVtRRooOyfPqsMpQhvfO0zAMzRbQYi/aytlryjvsvXDqmbOe1bu +t8jLZ8HJnBoYuMTDSQPxYA5QzUbF83d597YV4Djbxy8ooAw/dyZ02SUS2jHaGh7c +KUGRIjxpp7sC8rZcJwOJ9Abqm+RyguOhCcHpABnTPtRwa7pxpqpYrvS76Wy274fM +m7v/OeZWYdMKp8RcTGB7BXcmer/YB1IsYvdwY9k5vG8cwnncdimvzsUsZAReiDZu +MdRAGmI0Nj81Aa6sY6A= +-----END CERTIFICATE----- + +# Issuer: CN=GeoTrust Primary Certification Authority - G2 O=GeoTrust Inc. OU=(c) 2007 GeoTrust Inc. - For authorized use only +# Subject: CN=GeoTrust Primary Certification Authority - G2 O=GeoTrust Inc. OU=(c) 2007 GeoTrust Inc. - For authorized use only +# Label: "GeoTrust Primary Certification Authority - G2" +# Serial: 80682863203381065782177908751794619243 +# MD5 Fingerprint: 01:5e:d8:6b:bd:6f:3d:8e:a1:31:f8:12:e0:98:73:6a +# SHA1 Fingerprint: 8d:17:84:d5:37:f3:03:7d:ec:70:fe:57:8b:51:9a:99:e6:10:d7:b0 +# SHA256 Fingerprint: 5e:db:7a:c4:3b:82:a0:6a:87:61:e8:d7:be:49:79:eb:f2:61:1f:7d:d7:9b:f9:1c:1c:6b:56:6a:21:9e:d7:66 +-----BEGIN CERTIFICATE----- +MIICrjCCAjWgAwIBAgIQPLL0SAoA4v7rJDteYD7DazAKBggqhkjOPQQDAzCBmDEL +MAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChj +KSAyMDA3IEdlb1RydXN0IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2 +MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0 +eSAtIEcyMB4XDTA3MTEwNTAwMDAwMFoXDTM4MDExODIzNTk1OVowgZgxCzAJBgNV +BAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykgMjAw +NyBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNV +BAMTLUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBH +MjB2MBAGByqGSM49AgEGBSuBBAAiA2IABBWx6P0DFUPlrOuHNxFi79KDNlJ9RVcL +So17VDs6bl8VAsBQps8lL33KSLjHUGMcKiEIfJo22Av+0SbFWDEwKCXzXV2juLal +tJLtbCyf691DiaI8S0iRHVDsJt/WYC69IaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAO +BgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBVfNVdRVfslsq0DafwBo/q+EVXVMAoG +CCqGSM49BAMDA2cAMGQCMGSWWaboCd6LuvpaiIjwH5HTRqjySkwCY/tsXzjbLkGT +qQ7mndwxHLKgpxgceeHHNgIwOlavmnRs9vuD4DPTCF+hnMJbn0bWtsuRBmOiBucz +rD6ogRLQy7rQkgu2npaqBA+K +-----END CERTIFICATE----- + +# Issuer: CN=VeriSign Universal Root Certification Authority O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 2008 VeriSign, Inc. - For authorized use only +# Subject: CN=VeriSign Universal Root Certification Authority O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 2008 VeriSign, Inc. - For authorized use only +# Label: "VeriSign Universal Root Certification Authority" +# Serial: 85209574734084581917763752644031726877 +# MD5 Fingerprint: 8e:ad:b5:01:aa:4d:81:e4:8c:1d:d1:e1:14:00:95:19 +# SHA1 Fingerprint: 36:79:ca:35:66:87:72:30:4d:30:a5:fb:87:3b:0f:a7:7b:b7:0d:54 +# SHA256 Fingerprint: 23:99:56:11:27:a5:71:25:de:8c:ef:ea:61:0d:df:2f:a0:78:b5:c8:06:7f:4e:82:82:90:bf:b8:60:e8:4b:3c +-----BEGIN CERTIFICATE----- +MIIEuTCCA6GgAwIBAgIQQBrEZCGzEyEDDrvkEhrFHTANBgkqhkiG9w0BAQsFADCB +vTELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQL +ExZWZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJp +U2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MTgwNgYDVQQDEy9W +ZXJpU2lnbiBVbml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAe +Fw0wODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIG9MQswCQYDVQQGEwJVUzEX +MBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0 +IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAyMDA4IFZlcmlTaWduLCBJbmMuIC0gRm9y +IGF1dGhvcml6ZWQgdXNlIG9ubHkxODA2BgNVBAMTL1ZlcmlTaWduIFVuaXZlcnNh +bCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEAx2E3XrEBNNti1xWb/1hajCMj1mCOkdeQmIN65lgZOIzF +9uVkhbSicfvtvbnazU0AtMgtc6XHaXGVHzk8skQHnOgO+k1KxCHfKWGPMiJhgsWH +H26MfF8WIFFE0XBPV+rjHOPMee5Y2A7Cs0WTwCznmhcrewA3ekEzeOEz4vMQGn+H +LL729fdC4uW/h2KJXwBL38Xd5HVEMkE6HnFuacsLdUYI0crSK5XQz/u5QGtkjFdN +/BMReYTtXlT2NJ8IAfMQJQYXStrxHXpma5hgZqTZ79IugvHw7wnqRMkVauIDbjPT +rJ9VAMf2CGqUuV/c4DPxhGD5WycRtPwW8rtWaoAljQIDAQABo4GyMIGvMA8GA1Ud +EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMG0GCCsGAQUFBwEMBGEwX6FdoFsw +WTBXMFUWCWltYWdlL2dpZjAhMB8wBwYFKw4DAhoEFI/l0xqGrI2Oa8PPgGrUSBgs +exkuMCUWI2h0dHA6Ly9sb2dvLnZlcmlzaWduLmNvbS92c2xvZ28uZ2lmMB0GA1Ud +DgQWBBS2d/ppSEefUxLVwuoHMnYH0ZcHGTANBgkqhkiG9w0BAQsFAAOCAQEASvj4 +sAPmLGd75JR3Y8xuTPl9Dg3cyLk1uXBPY/ok+myDjEedO2Pzmvl2MpWRsXe8rJq+ +seQxIcaBlVZaDrHC1LGmWazxY8u4TB1ZkErvkBYoH1quEPuBUDgMbMzxPcP1Y+Oz +4yHJJDnp/RVmRvQbEdBNc6N9Rvk97ahfYtTxP/jgdFcrGJ2BtMQo2pSXpXDrrB2+ +BxHw1dvd5Yzw1TKwg+ZX4o+/vqGqvz0dtdQ46tewXDpPaj+PwGZsY6rp2aQW9IHR +lRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4mJO3 +7M2CYfE45k+XmCpajQ== +-----END CERTIFICATE----- + +# Issuer: CN=VeriSign Class 3 Public Primary Certification Authority - G4 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 2007 VeriSign, Inc. - For authorized use only +# Subject: CN=VeriSign Class 3 Public Primary Certification Authority - G4 O=VeriSign, Inc. OU=VeriSign Trust Network/(c) 2007 VeriSign, Inc. - For authorized use only +# Label: "VeriSign Class 3 Public Primary Certification Authority - G4" +# Serial: 63143484348153506665311985501458640051 +# MD5 Fingerprint: 3a:52:e1:e7:fd:6f:3a:e3:6f:f3:6f:99:1b:f9:22:41 +# SHA1 Fingerprint: 22:d5:d8:df:8f:02:31:d1:8d:f7:9d:b7:cf:8a:2d:64:c9:3f:6c:3a +# SHA256 Fingerprint: 69:dd:d7:ea:90:bb:57:c9:3e:13:5d:c8:5e:a6:fc:d5:48:0b:60:32:39:bd:c4:54:fc:75:8b:2a:26:cf:7f:79 +-----BEGIN CERTIFICATE----- +MIIDhDCCAwqgAwIBAgIQL4D+I4wOIg9IZxIokYesszAKBggqhkjOPQQDAzCByjEL +MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZW +ZXJpU2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2ln +biwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJp +U2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9y +aXR5IC0gRzQwHhcNMDcxMTA1MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCByjELMAkG +A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJp +U2lnbiBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwg +SW5jLiAtIEZvciBhdXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2ln +biBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5 +IC0gRzQwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAASnVnp8Utpkmw4tXNherJI9/gHm +GUo9FANL+mAnINmDiWn6VMaaGF5VKmTeBvaNSjutEDxlPZCIBIngMGGzrl0Bp3ve +fLK+ymVhAIau2o970ImtTR1ZmkGxvEeA3J5iw/mjgbIwga8wDwYDVR0TAQH/BAUw +AwEB/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJ +aW1hZ2UvZ2lmMCEwHzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYj +aHR0cDovL2xvZ28udmVyaXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFLMW +kf3upm7ktS5Jj4d4gYDs5bG1MAoGCCqGSM49BAMDA2gAMGUCMGYhDBgmYFo4e1ZC +4Kf8NoRRkSAsdk1DPcQdhCPQrNZ8NQbOzWm9kA3bbEhCHQ6qQgIxAJw9SDkjOVga +FRJZap7v1VmyHVIsmXHNxynfGyphe3HR3vPA5Q06Sqotp9iGKt0uEA== +-----END CERTIFICATE----- + +# Issuer: O=VeriSign, Inc. OU=Class 3 Public Primary Certification Authority +# Subject: O=VeriSign, Inc. OU=Class 3 Public Primary Certification Authority +# Label: "Verisign Class 3 Public Primary Certification Authority" +# Serial: 80507572722862485515306429940691309246 +# MD5 Fingerprint: ef:5a:f1:33:ef:f1:cd:bb:51:02:ee:12:14:4b:96:c4 +# SHA1 Fingerprint: a1:db:63:93:91:6f:17:e4:18:55:09:40:04:15:c7:02:40:b0:ae:6b +# SHA256 Fingerprint: a4:b6:b3:99:6f:c2:f3:06:b3:fd:86:81:bd:63:41:3d:8c:50:09:cc:4f:a3:29:c2:cc:f0:e2:fa:1b:14:03:05 +-----BEGIN CERTIFICATE----- +MIICPDCCAaUCEDyRMcsf9tAbDpq40ES/Er4wDQYJKoZIhvcNAQEFBQAwXzELMAkG +A1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFz +cyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTk2 +MDEyOTAwMDAwMFoXDTI4MDgwMjIzNTk1OVowXzELMAkGA1UEBhMCVVMxFzAVBgNV +BAoTDlZlcmlTaWduLCBJbmMuMTcwNQYDVQQLEy5DbGFzcyAzIFB1YmxpYyBQcmlt +YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIGfMA0GCSqGSIb3DQEBAQUAA4GN +ADCBiQKBgQDJXFme8huKARS0EN8EQNvjV69qRUCPhAwL0TPZ2RHP7gJYHyX3KqhE +BarsAx94f56TuZoAqiN91qyFomNFx3InzPRMxnVx0jnvT0Lwdd8KkMaOIG+YD/is +I19wKTakyYbnsZogy1Olhec9vn2a/iRFM9x2Fe0PonFkTGUugWhFpwIDAQABMA0G +CSqGSIb3DQEBBQUAA4GBABByUqkFFBkyCEHwxWsKzH4PIRnN5GfcX6kb5sroc50i +2JhucwNhkcV8sEVAbkSdjbCxlnRhLQ2pRdKkkirWmnWXbj9T/UWZYB2oK0z5XqcJ +2HUw19JlYD1n1khVdWk/kfVIC0dpImmClr7JyDiGSnoscxlIaU5rfGW/D/xwzoiQ +-----END CERTIFICATE----- + +# Issuer: CN=GlobalSign O=GlobalSign OU=GlobalSign Root CA - R3 +# Subject: CN=GlobalSign O=GlobalSign OU=GlobalSign Root CA - R3 +# Label: "GlobalSign Root CA - R3" +# Serial: 4835703278459759426209954 +# MD5 Fingerprint: c5:df:b8:49:ca:05:13:55:ee:2d:ba:1a:c3:3e:b0:28 +# SHA1 Fingerprint: d6:9b:56:11:48:f0:1c:77:c5:45:78:c1:09:26:df:5b:85:69:76:ad +# SHA256 Fingerprint: cb:b5:22:d7:b7:f1:27:ad:6a:01:13:86:5b:df:1c:d4:10:2e:7d:07:59:af:63:5a:7c:f4:72:0d:c9:63:c5:3b +-----BEGIN CERTIFICATE----- +MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4G +A1UECxMXR2xvYmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNp +Z24xEzARBgNVBAMTCkdsb2JhbFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4 +MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxTaWduIFJvb3QgQ0EgLSBSMzETMBEG +A1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2lnbjCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWtiHL8 +RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsT +gHeMCOFJ0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmm +KPZpO/bLyCiR5Z2KYVc3rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zd +QQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjlOCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZ +XriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2xmmFghcCAwEAAaNCMEAw +DgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFI/wS3+o +LkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZU +RUm7lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMp +jjM5RcOO5LlXbKr8EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK +6fBdRoyV3XpYKBovHd7NADdBj+1EbddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQX +mcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18YIvDQVETI53O9zJrlAGomecs +Mx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7rkpeDMdmztcpH +WD9f +-----END CERTIFICATE----- + +# Issuer: CN=TC TrustCenter Universal CA III O=TC TrustCenter GmbH OU=TC TrustCenter Universal CA +# Subject: CN=TC TrustCenter Universal CA III O=TC TrustCenter GmbH OU=TC TrustCenter Universal CA +# Label: "TC TrustCenter Universal CA III" +# Serial: 2010889993983507346460533407902964 +# MD5 Fingerprint: 9f:dd:db:ab:ff:8e:ff:45:21:5f:f0:6c:9d:8f:fe:2b +# SHA1 Fingerprint: 96:56:cd:7b:57:96:98:95:d0:e1:41:46:68:06:fb:b8:c6:11:06:87 +# SHA256 Fingerprint: 30:9b:4a:87:f6:ca:56:c9:31:69:aa:a9:9c:6d:98:88:54:d7:89:2b:d5:43:7e:2d:07:b2:9c:be:da:55:d3:5d +-----BEGIN CERTIFICATE----- +MIID4TCCAsmgAwIBAgIOYyUAAQACFI0zFQLkbPQwDQYJKoZIhvcNAQEFBQAwezEL +MAkGA1UEBhMCREUxHDAaBgNVBAoTE1RDIFRydXN0Q2VudGVyIEdtYkgxJDAiBgNV +BAsTG1RDIFRydXN0Q2VudGVyIFVuaXZlcnNhbCBDQTEoMCYGA1UEAxMfVEMgVHJ1 +c3RDZW50ZXIgVW5pdmVyc2FsIENBIElJSTAeFw0wOTA5MDkwODE1MjdaFw0yOTEy +MzEyMzU5NTlaMHsxCzAJBgNVBAYTAkRFMRwwGgYDVQQKExNUQyBUcnVzdENlbnRl +ciBHbWJIMSQwIgYDVQQLExtUQyBUcnVzdENlbnRlciBVbml2ZXJzYWwgQ0ExKDAm +BgNVBAMTH1RDIFRydXN0Q2VudGVyIFVuaXZlcnNhbCBDQSBJSUkwggEiMA0GCSqG +SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDC2pxisLlxErALyBpXsq6DFJmzNEubkKLF +5+cvAqBNLaT6hdqbJYUtQCggbergvbFIgyIpRJ9Og+41URNzdNW88jBmlFPAQDYv +DIRlzg9uwliT6CwLOunBjvvya8o84pxOjuT5fdMnnxvVZ3iHLX8LR7PH6MlIfK8v +zArZQe+f/prhsq75U7Xl6UafYOPfjdN/+5Z+s7Vy+EutCHnNaYlAJ/Uqwa1D7KRT +yGG299J5KmcYdkhtWyUB0SbFt1dpIxVbYYqt8Bst2a9c8SaQaanVDED1M4BDj5yj +dipFtK+/fz6HP3bFzSreIMUWWMv5G/UPyw0RUmS40nZid4PxWJ//AgMBAAGjYzBh +MB8GA1UdIwQYMBaAFFbn4VslQ4Dg9ozhcbyO5YAvxEjiMA8GA1UdEwEB/wQFMAMB +Af8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRW5+FbJUOA4PaM4XG8juWAL8RI +4jANBgkqhkiG9w0BAQUFAAOCAQEAg8ev6n9NCjw5sWi+e22JLumzCecYV42Fmhfz +dkJQEw/HkG8zrcVJYCtsSVgZ1OK+t7+rSbyUyKu+KGwWaODIl0YgoGhnYIg5IFHY +aAERzqf2EQf27OysGh+yZm5WZ2B6dF7AbZc2rrUNXWZzwCUyRdhKBgePxLcHsU0G +DeGl6/R1yrqc0L2z0zIkTO5+4nYES0lT2PLpVDP85XEfPRRclkvxOvIAu2y0+pZV +CIgJwcyRGSmwIC3/yzikQOEXvnlhgP8HA4ZMTnsGnxGGjYnuJ8Tb4rwZjgvDwxPH +LQNjO9Po5KIqwoIIlBZU8O8fJ5AluA0OKBtHd0e9HKgl8ZS0Zg== +-----END CERTIFICATE----- + +# Issuer: CN=Go Daddy Root Certificate Authority - G2 O=GoDaddy.com, Inc. +# Subject: CN=Go Daddy Root Certificate Authority - G2 O=GoDaddy.com, Inc. +# Label: "Go Daddy Root Certificate Authority - G2" +# Serial: 0 +# MD5 Fingerprint: 80:3a:bc:22:c1:e6:fb:8d:9b:3b:27:4a:32:1b:9a:01 +# SHA1 Fingerprint: 47:be:ab:c9:22:ea:e8:0e:78:78:34:62:a7:9f:45:c2:54:fd:e6:8b +# SHA256 Fingerprint: 45:14:0b:32:47:eb:9c:c8:c5:b4:f0:d7:b5:30:91:f7:32:92:08:9e:6e:5a:63:e2:74:9d:d3:ac:a9:19:8e:da +-----BEGIN CERTIFICATE----- +MIIDxTCCAq2gAwIBAgIBADANBgkqhkiG9w0BAQsFADCBgzELMAkGA1UEBhMCVVMx +EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAYBgNVBAoT +EUdvRGFkZHkuY29tLCBJbmMuMTEwLwYDVQQDEyhHbyBEYWRkeSBSb290IENlcnRp +ZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIz +NTk1OVowgYMxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQH +EwpTY290dHNkYWxlMRowGAYDVQQKExFHb0RhZGR5LmNvbSwgSW5jLjExMC8GA1UE +AxMoR28gRGFkZHkgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIw +DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL9xYgjx+lk09xvJGKP3gElY6SKD +E6bFIEMBO4Tx5oVJnyfq9oQbTqC023CYxzIBsQU+B07u9PpPL1kwIuerGVZr4oAH +/PMWdYA5UXvl+TW2dE6pjYIT5LY/qQOD+qK+ihVqf94Lw7YZFAXK6sOoBJQ7Rnwy +DfMAZiLIjWltNowRGLfTshxgtDj6AozO091GB94KPutdfMh8+7ArU6SSYmlRJQVh +GkSBjCypQ5Yj36w6gZoOKcUcqeldHraenjAKOc7xiID7S13MMuyFYkMlNAJWJwGR +tDtwKj9useiciAF9n9T521NtYJ2/LOdYq7hfRvzOxBsDPAnrSTFcaUaz4EcCAwEA +AaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYE +FDqahQcQZyi27/a9BUFuIMGU2g/eMA0GCSqGSIb3DQEBCwUAA4IBAQCZ21151fmX +WWcDYfF+OwYxdS2hII5PZYe096acvNjpL9DbWu7PdIxztDhC2gV7+AJ1uP2lsdeu +9tfeE8tTEH6KRtGX+rcuKxGrkLAngPnon1rpN5+r5N9ss4UXnT3ZJE95kTXWXwTr +gIOrmgIttRD02JDHBHNA7XIloKmf7J6raBKZV8aPEjoJpL1E/QYVN8Gb5DKj7Tjo +2GTzLH4U/ALqn83/B2gX2yKQOC16jdFU8WnjXzPKej17CuPKf1855eJ1usV2GDPO +LPAvTK33sefOT6jEm0pUBsV/fdUID+Ic/n4XuKxe9tQWskMJDE32p2u0mYRlynqI +4uJEvlz36hz1 +-----END CERTIFICATE----- + +# Issuer: CN=Starfield Root Certificate Authority - G2 O=Starfield Technologies, Inc. +# Subject: CN=Starfield Root Certificate Authority - G2 O=Starfield Technologies, Inc. +# Label: "Starfield Root Certificate Authority - G2" +# Serial: 0 +# MD5 Fingerprint: d6:39:81:c6:52:7e:96:69:fc:fc:ca:66:ed:05:f2:96 +# SHA1 Fingerprint: b5:1c:06:7c:ee:2b:0c:3d:f8:55:ab:2d:92:f4:fe:39:d4:e7:0f:0e +# SHA256 Fingerprint: 2c:e1:cb:0b:f9:d2:f9:e1:02:99:3f:be:21:51:52:c3:b2:dd:0c:ab:de:1c:68:e5:31:9b:83:91:54:db:b7:f5 +-----BEGIN CERTIFICATE----- +MIID3TCCAsWgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBjzELMAkGA1UEBhMCVVMx +EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoT +HFN0YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xMjAwBgNVBAMTKVN0YXJmaWVs +ZCBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAw +MFoXDTM3MTIzMTIzNTk1OVowgY8xCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6 +b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFyZmllbGQgVGVj +aG5vbG9naWVzLCBJbmMuMTIwMAYDVQQDEylTdGFyZmllbGQgUm9vdCBDZXJ0aWZp +Y2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBAL3twQP89o/8ArFvW59I2Z154qK3A2FWGMNHttfKPTUuiUP3oWmb3ooa/RMg +nLRJdzIpVv257IzdIvpy3Cdhl+72WoTsbhm5iSzchFvVdPtrX8WJpRBSiUZV9Lh1 +HOZ/5FSuS/hVclcCGfgXcVnrHigHdMWdSL5stPSksPNkN3mSwOxGXn/hbVNMYq/N +Hwtjuzqd+/x5AJhhdM8mgkBj87JyahkNmcrUDnXMN/uLicFZ8WJ/X7NfZTD4p7dN +dloedl40wOiWVpmKs/B/pM293DIxfJHP4F8R+GuqSVzRmZTRouNjWwl2tVZi4Ut0 +HZbUJtQIBFnQmA4O5t78w+wfkPECAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAO +BgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFHwMMh+n2TB/xH1oo2Kooc6rB1snMA0G +CSqGSIb3DQEBCwUAA4IBAQARWfolTwNvlJk7mh+ChTnUdgWUXuEok21iXQnCoKjU +sHU48TRqneSfioYmUeYs0cYtbpUgSpIB7LiKZ3sx4mcujJUDJi5DnUox9g61DLu3 +4jd/IroAow57UvtruzvE03lRTs2Q9GcHGcg8RnoNAX3FWOdt5oUwF5okxBDgBPfg +8n/Uqgr/Qh037ZTlZFkSIHc40zI+OIF1lnP6aI+xy84fxez6nH7PfrHxBy22/L/K +pL/QlwVKvOoYKAKQvVR4CSFx09F9HdkWsKlhPdAKACL8x3vLCWRFCztAgfd9fDL1 +mMpYjn0q7pBZc2T5NnReJaH1ZgUufzkVqSr7UIuOhWn0 +-----END CERTIFICATE----- + +# Issuer: CN=Starfield Services Root Certificate Authority - G2 O=Starfield Technologies, Inc. +# Subject: CN=Starfield Services Root Certificate Authority - G2 O=Starfield Technologies, Inc. +# Label: "Starfield Services Root Certificate Authority - G2" +# Serial: 0 +# MD5 Fingerprint: 17:35:74:af:7b:61:1c:eb:f4:f9:3c:e2:ee:40:f9:a2 +# SHA1 Fingerprint: 92:5a:8f:8d:2c:6d:04:e0:66:5f:59:6a:ff:22:d8:63:e8:25:6f:3f +# SHA256 Fingerprint: 56:8d:69:05:a2:c8:87:08:a4:b3:02:51:90:ed:cf:ed:b1:97:4a:60:6a:13:c6:e5:29:0f:cb:2a:e6:3e:da:b5 +-----BEGIN CERTIFICATE----- +MIID7zCCAtegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCVVMx +EDAOBgNVBAgTB0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoT +HFN0YXJmaWVsZCBUZWNobm9sb2dpZXMsIEluYy4xOzA5BgNVBAMTMlN0YXJmaWVs +ZCBTZXJ2aWNlcyBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5 +MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgZgxCzAJBgNVBAYTAlVTMRAwDgYD +VQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFy +ZmllbGQgVGVjaG5vbG9naWVzLCBJbmMuMTswOQYDVQQDEzJTdGFyZmllbGQgU2Vy +dmljZXMgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBANUMOsQq+U7i9b4Zl1+OiFOxHz/Lz58gE20p +OsgPfTz3a3Y4Y9k2YKibXlwAgLIvWX/2h/klQ4bnaRtSmpDhcePYLQ1Ob/bISdm2 +8xpWriu2dBTrz/sm4xq6HZYuajtYlIlHVv8loJNwU4PahHQUw2eeBGg6345AWh1K +Ts9DkTvnVtYAcMtS7nt9rjrnvDH5RfbCYM8TWQIrgMw0R9+53pBlbQLPLJGmpufe +hRhJfGZOozptqbXuNC66DQO4M99H67FrjSXZm86B0UVGMpZwh94CDklDhbZsc7tk +6mFBrMnUVN+HL8cisibMn1lUaJ/8viovxFUcdUBgF4UCVTmLfwUCAwEAAaNCMEAw +DwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJxfAN+q +AdcwKziIorhtSpzyEZGDMA0GCSqGSIb3DQEBCwUAA4IBAQBLNqaEd2ndOxmfZyMI +bw5hyf2E3F/YNoHN2BtBLZ9g3ccaaNnRbobhiCPPE95Dz+I0swSdHynVv/heyNXB +ve6SbzJ08pGCL72CQnqtKrcgfU28elUSwhXqvfdqlS5sdJ/PHLTyxQGjhdByPq1z +qwubdQxtRbeOlKyWN7Wg0I8VRw7j6IPdj/3vQQF3zCepYoUz8jcI73HPdwbeyBkd +iEDPfUYd/x7H4c7/I9vG+o1VTqkC50cRRj70/b17KSa7qWFiNyi2LSr2EIZkyXCn +0q23KXB56jzaYyWf/Wi3MOxw+3WKt21gZ7IeyLnp2KhvAotnDU0mV3HaIPzBSlCN +sSi6 +-----END CERTIFICATE----- + +# Issuer: CN=AffirmTrust Commercial O=AffirmTrust +# Subject: CN=AffirmTrust Commercial O=AffirmTrust +# Label: "AffirmTrust Commercial" +# Serial: 8608355977964138876 +# MD5 Fingerprint: 82:92:ba:5b:ef:cd:8a:6f:a6:3d:55:f9:84:f6:d6:b7 +# SHA1 Fingerprint: f9:b5:b6:32:45:5f:9c:be:ec:57:5f:80:dc:e9:6e:2c:c7:b2:78:b7 +# SHA256 Fingerprint: 03:76:ab:1d:54:c5:f9:80:3c:e4:b2:e2:01:a0:ee:7e:ef:7b:57:b6:36:e8:a9:3c:9b:8d:48:60:c9:6f:5f:a7 +-----BEGIN CERTIFICATE----- +MIIDTDCCAjSgAwIBAgIId3cGJyapsXwwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UE +BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVz +dCBDb21tZXJjaWFsMB4XDTEwMDEyOTE0MDYwNloXDTMwMTIzMTE0MDYwNlowRDEL +MAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZp +cm1UcnVzdCBDb21tZXJjaWFsMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC +AQEA9htPZwcroRX1BiLLHwGy43NFBkRJLLtJJRTWzsO3qyxPxkEylFf6EqdbDuKP +Hx6GGaeqtS25Xw2Kwq+FNXkyLbscYjfysVtKPcrNcV/pQr6U6Mje+SJIZMblq8Yr +ba0F8PrVC8+a5fBQpIs7R6UjW3p6+DM/uO+Zl+MgwdYoic+U+7lF7eNAFxHUdPAL +MeIrJmqbTFeurCA+ukV6BfO9m2kVrn1OIGPENXY6BwLJN/3HR+7o8XYdcxXyl6S1 +yHp52UKqK39c/s4mT6NmgTWvRLpUHhwwMmWd5jyTXlBOeuM61G7MGvv50jeuJCqr +VwMiKA1JdX+3KNp1v47j3A55MQIDAQABo0IwQDAdBgNVHQ4EFgQUnZPGU4teyq8/ +nx4P5ZmVvCT2lI8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwDQYJ +KoZIhvcNAQELBQADggEBAFis9AQOzcAN/wr91LoWXym9e2iZWEnStB03TX8nfUYG +XUPGhi4+c7ImfU+TqbbEKpqrIZcUsd6M06uJFdhrJNTxFq7YpFzUf1GO7RgBsZNj +vbz4YYCanrHOQnDiqX0GJX0nof5v7LMeJNrjS1UaADs1tDvZ110w/YETifLCBivt +Z8SOyUOyXGsViQK8YvxO8rUzqrJv0wqiUOP2O+guRMLbZjipM1ZI8W0bM40NjD9g +N53Tym1+NH4Nn3J2ixufcv1SNUFFApYvHLKac0khsUlHRUe072o0EclNmsxZt9YC +nlpOZbWUrhvfKbAW8b8Angc6F2S1BLUjIZkKlTuXfO8= +-----END CERTIFICATE----- + +# Issuer: CN=AffirmTrust Networking O=AffirmTrust +# Subject: CN=AffirmTrust Networking O=AffirmTrust +# Label: "AffirmTrust Networking" +# Serial: 8957382827206547757 +# MD5 Fingerprint: 42:65:ca:be:01:9a:9a:4c:a9:8c:41:49:cd:c0:d5:7f +# SHA1 Fingerprint: 29:36:21:02:8b:20:ed:02:f5:66:c5:32:d1:d6:ed:90:9f:45:00:2f +# SHA256 Fingerprint: 0a:81:ec:5a:92:97:77:f1:45:90:4a:f3:8d:5d:50:9f:66:b5:e2:c5:8f:cd:b5:31:05:8b:0e:17:f3:f0:b4:1b +-----BEGIN CERTIFICATE----- +MIIDTDCCAjSgAwIBAgIIfE8EORzUmS0wDQYJKoZIhvcNAQEFBQAwRDELMAkGA1UE +BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVz +dCBOZXR3b3JraW5nMB4XDTEwMDEyOTE0MDgyNFoXDTMwMTIzMTE0MDgyNFowRDEL +MAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZp +cm1UcnVzdCBOZXR3b3JraW5nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKC +AQEAtITMMxcua5Rsa2FSoOujz3mUTOWUgJnLVWREZY9nZOIG41w3SfYvm4SEHi3y +YJ0wTsyEheIszx6e/jarM3c1RNg1lho9Nuh6DtjVR6FqaYvZ/Ls6rnla1fTWcbua +kCNrmreIdIcMHl+5ni36q1Mr3Lt2PpNMCAiMHqIjHNRqrSK6mQEubWXLviRmVSRL +QESxG9fhwoXA3hA/Pe24/PHxI1Pcv2WXb9n5QHGNfb2V1M6+oF4nI979ptAmDgAp +6zxG8D1gvz9Q0twmQVGeFDdCBKNwV6gbh+0t+nvujArjqWaJGctB+d1ENmHP4ndG +yH329JKBNv3bNPFyfvMMFr20FQIDAQABo0IwQDAdBgNVHQ4EFgQUBx/S55zawm6i +QLSwelAQUHTEyL0wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwDQYJ +KoZIhvcNAQEFBQADggEBAIlXshZ6qML91tmbmzTCnLQyFE2npN/svqe++EPbkTfO +tDIuUFUaNU52Q3Eg75N3ThVwLofDwR1t3Mu1J9QsVtFSUzpE0nPIxBsFZVpikpzu +QY0x2+c06lkh1QF612S4ZDnNye2v7UsDSKegmQGA3GWjNq5lWUhPgkvIZfFXHeVZ +Lgo/bNjR9eUJtGxUAArgFU2HdW23WJZa3W3SAKD0m0i+wzekujbgfIeFlxoVot4u +olu9rxj5kFDNcFn4J2dHy8egBzp90SxdbBk6ZrV9/ZFvgrG+CJPbFEfxojfHRZ48 +x3evZKiT3/Zpg4Jg8klCNO1aAFSFHBY2kgxc+qatv9s= +-----END CERTIFICATE----- + +# Issuer: CN=AffirmTrust Premium O=AffirmTrust +# Subject: CN=AffirmTrust Premium O=AffirmTrust +# Label: "AffirmTrust Premium" +# Serial: 7893706540734352110 +# MD5 Fingerprint: c4:5d:0e:48:b6:ac:28:30:4e:0a:bc:f9:38:16:87:57 +# SHA1 Fingerprint: d8:a6:33:2c:e0:03:6f:b1:85:f6:63:4f:7d:6a:06:65:26:32:28:27 +# SHA256 Fingerprint: 70:a7:3f:7f:37:6b:60:07:42:48:90:45:34:b1:14:82:d5:bf:0e:69:8e:cc:49:8d:f5:25:77:eb:f2:e9:3b:9a +-----BEGIN CERTIFICATE----- +MIIFRjCCAy6gAwIBAgIIbYwURrGmCu4wDQYJKoZIhvcNAQEMBQAwQTELMAkGA1UE +BhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVz +dCBQcmVtaXVtMB4XDTEwMDEyOTE0MTAzNloXDTQwMTIzMTE0MTAzNlowQTELMAkG +A1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1U +cnVzdCBQcmVtaXVtMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAxBLf +qV/+Qd3d9Z+K4/as4Tx4mrzY8H96oDMq3I0gW64tb+eT2TZwamjPjlGjhVtnBKAQ +JG9dKILBl1fYSCkTtuG+kU3fhQxTGJoeJKJPj/CihQvL9Cl/0qRY7iZNyaqoe5rZ ++jjeRFcV5fiMyNlI4g0WJx0eyIOFJbe6qlVBzAMiSy2RjYvmia9mx+n/K+k8rNrS +s8PhaJyJ+HoAVt70VZVs+7pk3WKL3wt3MutizCaam7uqYoNMtAZ6MMgpv+0GTZe5 +HMQxK9VfvFMSF5yZVylmd2EhMQcuJUmdGPLu8ytxjLW6OQdJd/zvLpKQBY0tL3d7 +70O/Nbua2Plzpyzy0FfuKE4mX4+QaAkvuPjcBukumj5Rp9EixAqnOEhss/n/fauG +V+O61oV4d7pD6kh/9ti+I20ev9E2bFhc8e6kGVQa9QPSdubhjL08s9NIS+LI+H+S +qHZGnEJlPqQewQcDWkYtuJfzt9WyVSHvutxMAJf7FJUnM7/oQ0dG0giZFmA7mn7S +5u046uwBHjxIVkkJx0w3AJ6IDsBz4W9m6XJHMD4Q5QsDyZpCAGzFlH5hxIrff4Ia +C1nEWTJ3s7xgaVY5/bQGeyzWZDbZvUjthB9+pSKPKrhC9IK31FOQeE4tGv2Bb0TX +OwF0lkLgAOIua+rF7nKsu7/+6qqo+Nz2snmKtmcCAwEAAaNCMEAwHQYDVR0OBBYE +FJ3AZ6YMItkm9UWrpmVSESfYRaxjMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/ +BAQDAgEGMA0GCSqGSIb3DQEBDAUAA4ICAQCzV00QYk465KzquByvMiPIs0laUZx2 +KI15qldGF9X1Uva3ROgIRL8YhNILgM3FEv0AVQVhh0HctSSePMTYyPtwni94loMg +Nt58D2kTiKV1NpgIpsbfrM7jWNa3Pt668+s0QNiigfV4Py/VpfzZotReBA4Xrf5B +8OWycvpEgjNC6C1Y91aMYj+6QrCcDFx+LmUmXFNPALJ4fqENmS2NuB2OosSw/WDQ +MKSOyARiqcTtNd56l+0OOF6SL5Nwpamcb6d9Ex1+xghIsV5n61EIJenmJWtSKZGc +0jlzCFfemQa0W50QBuHCAKi4HEoCChTQwUHK+4w1IX2COPKpVJEZNZOUbWo6xbLQ +u4mGk+ibyQ86p3q4ofB4Rvr8Ny/lioTz3/4E2aFooC8k4gmVBtWVyuEklut89pMF +u+1z6S3RdTnX5yTb2E5fQ4+e0BQ5v1VwSJlXMbSc7kqYA5YwH2AG7hsj/oFgIxpH +YoWlzBk0gG+zrBrjn/B7SK3VAdlntqlyk+otZrWyuOQ9PLLvTIzq6we/qzWaVYa8 +GKa1qF60g2xraUDTn9zxw2lrueFtCfTxqlB2Cnp9ehehVZZCmTEJ3WARjQUwfuaO +RtGdFNrHF+QFlozEJLUbzxQHskD4o55BhrwE0GuWyCqANP2/7waj3VjFhT0+j/6e +KeC2uAloGRwYQw== +-----END CERTIFICATE----- + +# Issuer: CN=AffirmTrust Premium ECC O=AffirmTrust +# Subject: CN=AffirmTrust Premium ECC O=AffirmTrust +# Label: "AffirmTrust Premium ECC" +# Serial: 8401224907861490260 +# MD5 Fingerprint: 64:b0:09:55:cf:b1:d5:99:e2:be:13:ab:a6:5d:ea:4d +# SHA1 Fingerprint: b8:23:6b:00:2f:1d:16:86:53:01:55:6c:11:a4:37:ca:eb:ff:c3:bb +# SHA256 Fingerprint: bd:71:fd:f6:da:97:e4:cf:62:d1:64:7a:dd:25:81:b0:7d:79:ad:f8:39:7e:b4:ec:ba:9c:5e:84:88:82:14:23 +-----BEGIN CERTIFICATE----- +MIIB/jCCAYWgAwIBAgIIdJclisc/elQwCgYIKoZIzj0EAwMwRTELMAkGA1UEBhMC +VVMxFDASBgNVBAoMC0FmZmlybVRydXN0MSAwHgYDVQQDDBdBZmZpcm1UcnVzdCBQ +cmVtaXVtIEVDQzAeFw0xMDAxMjkxNDIwMjRaFw00MDEyMzExNDIwMjRaMEUxCzAJ +BgNVBAYTAlVTMRQwEgYDVQQKDAtBZmZpcm1UcnVzdDEgMB4GA1UEAwwXQWZmaXJt +VHJ1c3QgUHJlbWl1bSBFQ0MwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQNMF4bFZ0D +0KF5Nbc6PJJ6yhUczWLznCZcBz3lVPqj1swS6vQUX+iOGasvLkjmrBhDeKzQN8O9 +ss0s5kfiGuZjuD0uL3jET9v0D6RoTFVya5UdThhClXjMNzyR4ptlKymjQjBAMB0G +A1UdDgQWBBSaryl6wBE1NSZRMADDav5A1a7WPDAPBgNVHRMBAf8EBTADAQH/MA4G +A1UdDwEB/wQEAwIBBjAKBggqhkjOPQQDAwNnADBkAjAXCfOHiFBar8jAQr9HX/Vs +aobgxCd05DhT1wV/GzTjxi+zygk8N53X57hG8f2h4nECMEJZh0PUUd+60wkyWs6I +flc9nF9Ca/UHLbXwgpP5WW+uZPpY5Yse42O+tYHNbwKMeQ== +-----END CERTIFICATE----- + +# Issuer: CN=StartCom Certification Authority O=StartCom Ltd. OU=Secure Digital Certificate Signing +# Subject: CN=StartCom Certification Authority O=StartCom Ltd. OU=Secure Digital Certificate Signing +# Label: "StartCom Certification Authority" +# Serial: 45 +# MD5 Fingerprint: c9:3b:0d:84:41:fc:a4:76:79:23:08:57:de:10:19:16 +# SHA1 Fingerprint: a3:f1:33:3f:e2:42:bf:cf:c5:d1:4e:8f:39:42:98:40:68:10:d1:a0 +# SHA256 Fingerprint: e1:78:90:ee:09:a3:fb:f4:f4:8b:9c:41:4a:17:d6:37:b7:a5:06:47:e9:bc:75:23:22:72:7f:cc:17:42:a9:11 +-----BEGIN CERTIFICATE----- +MIIHhzCCBW+gAwIBAgIBLTANBgkqhkiG9w0BAQsFADB9MQswCQYDVQQGEwJJTDEW +MBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwg +Q2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0NjM3WhcNMzYwOTE3MTk0NjM2WjB9 +MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjErMCkGA1UECxMi +U2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMgU3Rh +cnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUA +A4ICDwAwggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZk +pMyONvg45iPwbm2xPN1yo4UcodM9tDMr0y+v/uqwQVlntsQGfQqedIXWeUyAN3rf +OQVSWff0G0ZDpNKFhdLDcfN1YjS6LIp/Ho/u7TTQEceWzVI9ujPW3U3eCztKS5/C +Ji/6tRYccjV3yjxd5srhJosaNnZcAdt0FCX+7bWgiA/deMotHweXMAEtcnn6RtYT +Kqi5pquDSR3l8u/d5AGOGAqPY1MWhWKpDhk6zLVmpsJrdAfkK+F2PrRt2PZE4XNi +HzvEvqBTViVsUQn3qqvKv3b9bZvzndu/PWa8DFaqr5hIlTpL36dYUNk4dalb6kMM +Av+Z6+hsTXBbKWWc3apdzK8BMewM69KN6Oqce+Zu9ydmDBpI125C4z/eIT574Q1w ++2OqqGwaVLRcJXrJosmLFqa7LH4XXgVNWG4SHQHuEhANxjJ/GP/89PrNbpHoNkm+ +Gkhpi8KWTRoSsmkXwQqQ1vp5Iki/untp+HDH+no32NgN0nZPV/+Qt+OR0t3vwmC3 +Zzrd/qqc8NSLf3Iizsafl7b4r4qgEKjZ+xjGtrVcUjyJthkqcwEKDwOzEmDyei+B +26Nu/yYwl/WL3YlXtq09s68rxbd2AvCl1iuahhQqcvbjM4xdCUsT37uMdBNSSwID +AQABo4ICEDCCAgwwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYD +VR0OBBYEFE4L7xqkQFulF2mHMMo0aEPQQa7yMB8GA1UdIwQYMBaAFE4L7xqkQFul +F2mHMMo0aEPQQa7yMIIBWgYDVR0gBIIBUTCCAU0wggFJBgsrBgEEAYG1NwEBATCC +ATgwLgYIKwYBBQUHAgEWImh0dHA6Ly93d3cuc3RhcnRzc2wuY29tL3BvbGljeS5w +ZGYwNAYIKwYBBQUHAgEWKGh0dHA6Ly93d3cuc3RhcnRzc2wuY29tL2ludGVybWVk +aWF0ZS5wZGYwgc8GCCsGAQUFBwICMIHCMCcWIFN0YXJ0IENvbW1lcmNpYWwgKFN0 +YXJ0Q29tKSBMdGQuMAMCAQEagZZMaW1pdGVkIExpYWJpbGl0eSwgcmVhZCB0aGUg +c2VjdGlvbiAqTGVnYWwgTGltaXRhdGlvbnMqIG9mIHRoZSBTdGFydENvbSBDZXJ0 +aWZpY2F0aW9uIEF1dGhvcml0eSBQb2xpY3kgYXZhaWxhYmxlIGF0IGh0dHA6Ly93 +d3cuc3RhcnRzc2wuY29tL3BvbGljeS5wZGYwEQYJYIZIAYb4QgEBBAQDAgAHMDgG +CWCGSAGG+EIBDQQrFilTdGFydENvbSBGcmVlIFNTTCBDZXJ0aWZpY2F0aW9uIEF1 +dGhvcml0eTANBgkqhkiG9w0BAQsFAAOCAgEAjo/n3JR5fPGFf59Jb2vKXfuM/gTF +wWLRfUKKvFO3lANmMD+x5wqnUCBVJX92ehQN6wQOQOY+2IirByeDqXWmN3PH/UvS +Ta0XQMhGvjt/UfzDtgUx3M2FIk5xt/JxXrAaxrqTi3iSSoX4eA+D/i+tLPfkpLst +0OcNOrg+zvZ49q5HJMqjNTbOx8aHmNrs++myziebiMMEofYLWWivydsQD032ZGNc +pRJvkrKTlMeIFw6Ttn5ii5B/q06f/ON1FE8qMt9bDeD1e5MNq6HPh+GlBEXoPBKl +CcWw0bdT82AUuoVpaiF8H3VhFyAXe2w7QSlc4axa0c2Mm+tgHRns9+Ww2vl5GKVF +P0lDV9LdJNUso/2RjSe15esUBppMeyG7Oq0wBhjA2MFrLH9ZXF2RsXAiV+uKa0hK +1Q8p7MZAwC+ITGgBF3f0JBlPvfrhsiAhS90a2Cl9qrjeVOwhVYBsHvUwyKMQ5bLm +KhQxw4UtjJixhlpPiVktucf3HMiKf8CdBUrmQk9io20ppB+Fq9vlgcitKj1MXVuE +JnHEhV5xJMqlG2zYYdMa4FTbzrqpMrUi9nNBCV24F10OD5mQ1kfabwo6YigUZ4LZ +8dCAWZvLMdibD4x3TrVoivJs9iQOLWxwxXPR3hTQcY+203sC9uO41Alua551hDnm +fyWl8kgAwKQB2j8= +-----END CERTIFICATE----- + +# Issuer: CN=StartCom Certification Authority G2 O=StartCom Ltd. +# Subject: CN=StartCom Certification Authority G2 O=StartCom Ltd. +# Label: "StartCom Certification Authority G2" +# Serial: 59 +# MD5 Fingerprint: 78:4b:fb:9e:64:82:0a:d3:b8:4c:62:f3:64:f2:90:64 +# SHA1 Fingerprint: 31:f1:fd:68:22:63:20:ee:c6:3b:3f:9d:ea:4a:3e:53:7c:7c:39:17 +# SHA256 Fingerprint: c7:ba:65:67:de:93:a7:98:ae:1f:aa:79:1e:71:2d:37:8f:ae:1f:93:c4:39:7f:ea:44:1b:b7:cb:e6:fd:59:95 +-----BEGIN CERTIFICATE----- +MIIFYzCCA0ugAwIBAgIBOzANBgkqhkiG9w0BAQsFADBTMQswCQYDVQQGEwJJTDEW +MBQGA1UEChMNU3RhcnRDb20gTHRkLjEsMCoGA1UEAxMjU3RhcnRDb20gQ2VydGlm +aWNhdGlvbiBBdXRob3JpdHkgRzIwHhcNMTAwMTAxMDEwMDAxWhcNMzkxMjMxMjM1 +OTAxWjBTMQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRkLjEsMCoG +A1UEAxMjU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgRzIwggIiMA0G +CSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2iTZbB7cgNr2Cu+EWIAOVeq8Oo1XJ +JZlKxdBWQYeQTSFgpBSHO839sj60ZwNq7eEPS8CRhXBF4EKe3ikj1AENoBB5uNsD +vfOpL9HG4A/LnooUCri99lZi8cVytjIl2bLzvWXFDSxu1ZJvGIsAQRSCb0AgJnoo +D/Uefyf3lLE3PbfHkffiAez9lInhzG7TNtYKGXmu1zSCZf98Qru23QumNK9LYP5/ +Q0kGi4xDuFby2X8hQxfqp0iVAXV16iulQ5XqFYSdCI0mblWbq9zSOdIxHWDirMxW +RST1HFSr7obdljKF+ExP6JV2tgXdNiNnvP8V4so75qbsO+wmETRIjfaAKxojAuuK +HDp2KntWFhxyKrOq42ClAJ8Em+JvHhRYW6Vsi1g8w7pOOlz34ZYrPu8HvKTlXcxN +nw3h3Kq74W4a7I/htkxNeXJdFzULHdfBR9qWJODQcqhaX2YtENwvKhOuJv4KHBnM +0D4LnMgJLvlblnpHnOl68wVQdJVznjAJ85eCXuaPOQgeWeU1FEIT/wCc976qUM/i +UUjXuG+v+E5+M5iSFGI6dWPPe/regjupuznixL0sAA7IF6wT700ljtizkC+p2il9 +Ha90OrInwMEePnWjFqmveiJdnxMaz6eg6+OGCtP95paV1yPIN93EfKo2rJgaErHg +TuixO/XWb/Ew1wIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQE +AwIBBjAdBgNVHQ4EFgQUS8W0QGutHLOlHGVuRjaJhwUMDrYwDQYJKoZIhvcNAQEL +BQADggIBAHNXPyzVlTJ+N9uWkusZXn5T50HsEbZH77Xe7XRcxfGOSeD8bpkTzZ+K +2s06Ctg6Wgk/XzTQLwPSZh0avZyQN8gMjgdalEVGKua+etqhqaRpEpKwfTbURIfX +UfEpY9Z1zRbkJ4kd+MIySP3bmdCPX1R0zKxnNBFi2QwKN4fRoxdIjtIXHfbX/dtl +6/2o1PXWT6RbdejF0mCy2wl+JYt7ulKSnj7oxXehPOBKc2thz4bcQ///If4jXSRK +9dNtD2IEBVeC2m6kMyV5Sy5UGYvMLD0w6dEG/+gyRr61M3Z3qAFdlsHB1b6uJcDJ +HgoJIIihDsnzb02CVAAgp9KP5DlUFy6NHrgbuxu9mk47EDTcnIhT76IxW1hPkWLI +wpqazRVdOKnWvvgTtZ8SafJQYqz7Fzf07rh1Z2AQ+4NQ+US1dZxAF7L+/XldblhY +XzD8AK6vM8EOTmy6p6ahfzLbOOCxchcKK5HsamMm7YnUeMx0HgX4a/6ManY5Ka5l +IxKVCCIcl85bBu4M4ru8H0ST9tg4RQUh7eStqxK2A6RCLi3ECToDZ2mEmuFZkIoo +hdVddLHRDiBYmxOlsGOm7XtH/UVVMKTumtTm4ofvmMkyghEpIrwACjFeLQ/Ajulr +so8uBtjRkcfGEvRM/TAXw8HaOFvjqermobp573PYtlNXLfbQ4ddI +-----END CERTIFICATE----- diff --git a/app/api/Google/Logger/Abstract.php b/app/api/Google/Logger/Abstract.php new file mode 100755 index 0000000..03e46cb --- /dev/null +++ b/app/api/Google/Logger/Abstract.php @@ -0,0 +1,408 @@ + 600, + self::ALERT => 550, + self::CRITICAL => 500, + self::ERROR => 400, + self::WARNING => 300, + self::NOTICE => 250, + self::INFO => 200, + self::DEBUG => 100, + ); + + /** + * @var integer $level The minimum logging level + */ + protected $level = self::DEBUG; + + /** + * @var string $logFormat The current log format + */ + protected $logFormat = self::DEFAULT_LOG_FORMAT; + /** + * @var string $dateFormat The current date format + */ + protected $dateFormat = self::DEFAULT_DATE_FORMAT; + + /** + * @var boolean $allowNewLines If newlines are allowed + */ + protected $allowNewLines = false; + + /** + * @param Google_Client $client The current Google client + */ + public function __construct(Google_Client $client) + { + $this->setLevel( + $client->getClassConfig('Google_Logger_Abstract', 'level') + ); + + $format = $client->getClassConfig('Google_Logger_Abstract', 'log_format'); + $this->logFormat = $format ? $format : self::DEFAULT_LOG_FORMAT; + + $format = $client->getClassConfig('Google_Logger_Abstract', 'date_format'); + $this->dateFormat = $format ? $format : self::DEFAULT_DATE_FORMAT; + + $this->allowNewLines = (bool) $client->getClassConfig( + 'Google_Logger_Abstract', + 'allow_newlines' + ); + } + + /** + * Sets the minimum logging level that this logger handles. + * + * @param integer $level + */ + public function setLevel($level) + { + $this->level = $this->normalizeLevel($level); + } + + /** + * Checks if the logger should handle messages at the provided level. + * + * @param integer $level + * @return boolean + */ + public function shouldHandle($level) + { + return $this->normalizeLevel($level) >= $this->level; + } + + /** + * System is unusable. + * + * @param string $message The log message + * @param array $context The log context + */ + public function emergency($message, array $context = array()) + { + $this->log(self::EMERGENCY, $message, $context); + } + + /** + * Action must be taken immediately. + * + * Example: Entire website down, database unavailable, etc. This should + * trigger the SMS alerts and wake you up. + * + * @param string $message The log message + * @param array $context The log context + */ + public function alert($message, array $context = array()) + { + $this->log(self::ALERT, $message, $context); + } + + /** + * Critical conditions. + * + * Example: Application component unavailable, unexpected exception. + * + * @param string $message The log message + * @param array $context The log context + */ + public function critical($message, array $context = array()) + { + $this->log(self::CRITICAL, $message, $context); + } + + /** + * Runtime errors that do not require immediate action but should typically + * be logged and monitored. + * + * @param string $message The log message + * @param array $context The log context + */ + public function error($message, array $context = array()) + { + $this->log(self::ERROR, $message, $context); + } + + /** + * Exceptional occurrences that are not errors. + * + * Example: Use of deprecated APIs, poor use of an API, undesirable things + * that are not necessarily wrong. + * + * @param string $message The log message + * @param array $context The log context + */ + public function warning($message, array $context = array()) + { + $this->log(self::WARNING, $message, $context); + } + + /** + * Normal but significant events. + * + * @param string $message The log message + * @param array $context The log context + */ + public function notice($message, array $context = array()) + { + $this->log(self::NOTICE, $message, $context); + } + + /** + * Interesting events. + * + * Example: User logs in, SQL logs. + * + * @param string $message The log message + * @param array $context The log context + */ + public function info($message, array $context = array()) + { + $this->log(self::INFO, $message, $context); + } + + /** + * Detailed debug information. + * + * @param string $message The log message + * @param array $context The log context + */ + public function debug($message, array $context = array()) + { + $this->log(self::DEBUG, $message, $context); + } + + /** + * Logs with an arbitrary level. + * + * @param mixed $level The log level + * @param string $message The log message + * @param array $context The log context + */ + public function log($level, $message, array $context = array()) + { + if (!$this->shouldHandle($level)) { + return false; + } + + $levelName = is_int($level) ? array_search($level, self::$levels) : $level; + $message = $this->interpolate( + array( + 'message' => $message, + 'context' => $context, + 'level' => strtoupper($levelName), + 'datetime' => new DateTime(), + ) + ); + + $this->write($message); + } + + /** + * Interpolates log variables into the defined log format. + * + * @param array $variables The log variables. + * @return string + */ + protected function interpolate(array $variables = array()) + { + $template = $this->logFormat; + + if (!$variables['context']) { + $template = str_replace('%context%', '', $template); + unset($variables['context']); + } else { + $this->reverseJsonInContext($variables['context']); + } + + foreach ($variables as $key => $value) { + if (strpos($template, '%'. $key .'%') !== false) { + $template = str_replace( + '%' . $key . '%', + $this->export($value), + $template + ); + } + } + + return $template; + } + + /** + * Reverses JSON encoded PHP arrays and objects so that they log better. + * + * @param array $context The log context + */ + protected function reverseJsonInContext(array &$context) + { + if (!$context) { + return; + } + + foreach ($context as $key => $val) { + if (!$val || !is_string($val) || !($val[0] == '{' || $val[0] == '[')) { + continue; + } + + $json = @json_decode($val); + if (is_object($json) || is_array($json)) { + $context[$key] = $json; + } + } + } + + /** + * Exports a PHP value for logging to a string. + * + * @param mixed $value The value to + */ + protected function export($value) + { + if (is_string($value)) { + if ($this->allowNewLines) { + return $value; + } + + return preg_replace('/[\r\n]+/', ' ', $value); + } + + if (is_resource($value)) { + return sprintf( + 'resource(%d) of type (%s)', + $value, + get_resource_type($value) + ); + } + + if ($value instanceof DateTime) { + return $value->format($this->dateFormat); + } + + if (version_compare(PHP_VERSION, '5.4.0', '>=')) { + $options = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE; + + if ($this->allowNewLines) { + $options |= JSON_PRETTY_PRINT; + } + + return @json_encode($value, $options); + } + + return str_replace('\\/', '/', @json_encode($value)); + } + + /** + * Converts a given log level to the integer form. + * + * @param mixed $level The logging level + * @return integer $level The normalized level + * @throws Google_Logger_Exception If $level is invalid + */ + protected function normalizeLevel($level) + { + if (is_int($level) && array_search($level, self::$levels) !== false) { + return $level; + } + + if (is_string($level) && isset(self::$levels[$level])) { + return self::$levels[$level]; + } + + throw new Google_Logger_Exception( + sprintf("Unknown LogLevel: '%s'", $level) + ); + } + + /** + * Writes a message to the current log implementation. + * + * @param string $message The message + */ + abstract protected function write($message); +} diff --git a/app/api/Google/Logger/Exception.php b/app/api/Google/Logger/Exception.php new file mode 100755 index 0000000..d3fcc92 --- /dev/null +++ b/app/api/Google/Logger/Exception.php @@ -0,0 +1,24 @@ +getClassConfig('Google_Logger_File', 'file'); + if (!is_string($file) && !is_resource($file)) { + throw new Google_Logger_Exception( + 'File logger requires a filename or a valid file pointer' + ); + } + + $mode = $client->getClassConfig('Google_Logger_File', 'mode'); + if (!$mode) { + $this->mode = $mode; + } + + $this->lock = (bool) $client->getClassConfig('Google_Logger_File', 'lock'); + $this->file = $file; + } + + /** + * {@inheritdoc} + */ + protected function write($message) + { + if (is_string($this->file)) { + $this->open(); + } elseif (!is_resource($this->file)) { + throw new Google_Logger_Exception('File pointer is no longer available'); + } + + if ($this->lock) { + flock($this->file, LOCK_EX); + } + + fwrite($this->file, (string) $message); + + if ($this->lock) { + flock($this->file, LOCK_UN); + } + } + + /** + * Opens the log for writing. + * + * @return resource + */ + private function open() + { + // Used for trapping `fopen()` errors. + $this->trappedErrorNumber = null; + $this->trappedErrorString = null; + + $old = set_error_handler(array($this, 'trapError')); + + $needsChmod = !file_exists($this->file); + $fh = fopen($this->file, 'a'); + + restore_error_handler(); + + // Handles trapped `fopen()` errors. + if ($this->trappedErrorNumber) { + throw new Google_Logger_Exception( + sprintf( + "Logger Error: '%s'", + $this->trappedErrorString + ), + $this->trappedErrorNumber + ); + } + + if ($needsChmod) { + @chmod($this->file, $this->mode & ~umask()); + } + + return $this->file = $fh; + } + + /** + * Closes the log stream resource. + */ + private function close() + { + if (is_resource($this->file)) { + fclose($this->file); + } + } + + /** + * Traps `fopen()` errors. + * + * @param integer $errno The error number + * @param string $errstr The error string + */ + private function trapError($errno, $errstr) + { + $this->trappedErrorNumber = $errno; + $this->trappedErrorString = $errstr; + } + + public function __destruct() + { + $this->close(); + } +} diff --git a/app/api/Google/Logger/Null.php b/app/api/Google/Logger/Null.php new file mode 100755 index 0000000..3bd60a1 --- /dev/null +++ b/app/api/Google/Logger/Null.php @@ -0,0 +1,43 @@ +setLogger($logger); + } + } + + /** + * Sets the PSR-3 logger where logging will be delegated. + * + * NOTE: The `$logger` should technically implement + * `Psr\Log\LoggerInterface`, but we don't explicitly require this so that + * we can be compatible with PHP 5.2. + * + * @param Psr\Log\LoggerInterface $logger The PSR-3 logger + */ + public function setLogger(/*Psr\Log\LoggerInterface*/ $logger) + { + $this->logger = $logger; + } + + /** + * {@inheritdoc} + */ + public function shouldHandle($level) + { + return isset($this->logger) && parent::shouldHandle($level); + } + + /** + * {@inheritdoc} + */ + public function log($level, $message, array $context = array()) + { + if (!$this->shouldHandle($level)) { + return false; + } + + if ($context) { + $this->reverseJsonInContext($context); + } + + $levelName = is_int($level) ? array_search($level, self::$levels) : $level; + $this->logger->log($levelName, $message, $context); + } + + /** + * {@inheritdoc} + */ + protected function write($message, array $context = array()) + { + } +} diff --git a/app/api/Google/Model.php b/app/api/Google/Model.php new file mode 100755 index 0000000..a2cbbe8 --- /dev/null +++ b/app/api/Google/Model.php @@ -0,0 +1,312 @@ +mapTypes($array); + } + $this->gapiInit(); + } + + /** + * Getter that handles passthrough access to the data array, and lazy object creation. + * @param string $key Property name. + * @return mixed The value if any, or null. + */ + public function __get($key) + { + $keyTypeName = $this->keyType($key); + $keyDataType = $this->dataType($key); + if (isset($this->$keyTypeName) && !isset($this->processed[$key])) { + if (isset($this->modelData[$key])) { + $val = $this->modelData[$key]; + } else if (isset($this->$keyDataType) && + ($this->$keyDataType == 'array' || $this->$keyDataType == 'map')) { + $val = []; + } else { + $val = null; + } + + if ($this->isAssociativeArray($val)) { + if (isset($this->$keyDataType) && 'map' == $this->$keyDataType) { + foreach ($val as $arrayKey => $arrayItem) { + $this->modelData[$key][$arrayKey] = + $this->createObjectFromName($keyTypeName, $arrayItem); + } + } else { + $this->modelData[$key] = $this->createObjectFromName($keyTypeName, $val); + } + } else if (is_array($val)) { + $arrayObject = []; + foreach ($val as $arrayIndex => $arrayItem) { + $arrayObject[$arrayIndex] = + $this->createObjectFromName($keyTypeName, $arrayItem); + } + $this->modelData[$key] = $arrayObject; + } + $this->processed[$key] = true; + } + + return isset($this->modelData[$key]) ? $this->modelData[$key] : null; + } + + /** + * Initialize this object's properties from an array. + * + * @param array $array Used to seed this object's properties. + * @return void + */ + protected function mapTypes($array) + { + // Hard initialise simple types, lazy load more complex ones. + foreach ($array as $key => $val) { + if ( !property_exists($this, $this->keyType($key)) && + property_exists($this, $key)) { + $this->$key = $val; + unset($array[$key]); + } elseif (property_exists($this, $camelKey = Google_Utils::camelCase($key))) { + // This checks if property exists as camelCase, leaving it in array as snake_case + // in case of backwards compatibility issues. + $this->$camelKey = $val; + } + } + $this->modelData = $array; + } + + /** + * Blank initialiser to be used in subclasses to do post-construction initialisation - this + * avoids the need for subclasses to have to implement the variadics handling in their + * constructors. + */ + protected function gapiInit() + { + return; + } + + /** + * Create a simplified object suitable for straightforward + * conversion to JSON. This is relatively expensive + * due to the usage of reflection, but shouldn't be called + * a whole lot, and is the most straightforward way to filter. + */ + public function toSimpleObject() + { + $object = new stdClass(); + + // Process all other data. + foreach ($this->modelData as $key => $val) { + $result = $this->getSimpleValue($val); + if ($result !== null) { + $object->$key = $this->nullPlaceholderCheck($result); + } + } + + // Process all public properties. + $reflect = new ReflectionObject($this); + $props = $reflect->getProperties(ReflectionProperty::IS_PUBLIC); + foreach ($props as $member) { + $name = $member->getName(); + $result = $this->getSimpleValue($this->$name); + if ($result !== null) { + $name = $this->getMappedName($name); + $object->$name = $this->nullPlaceholderCheck($result); + } + } + + return $object; + } + + /** + * Handle different types of values, primarily + * other objects and map and array data types. + */ + private function getSimpleValue($value) + { + if ($value instanceof Google_Model) { + return $value->toSimpleObject(); + } else if (is_array($value)) { + $return = []; + foreach ($value as $key => $a_value) { + $a_value = $this->getSimpleValue($a_value); + if ($a_value !== null) { + $key = $this->getMappedName($key); + $return[$key] = $this->nullPlaceholderCheck($a_value); + } + } + return $return; + } + return $value; + } + + /** + * Check whether the value is the null placeholder and return true null. + */ + private function nullPlaceholderCheck($value) + { + if ($value === self::NULL_VALUE) { + return null; + } + return $value; + } + + /** + * If there is an internal name mapping, use that. + */ + private function getMappedName($key) + { + if (isset($this->internal_gapi_mappings) && + isset($this->internal_gapi_mappings[$key])) { + $key = $this->internal_gapi_mappings[$key]; + } + return $key; + } + + /** + * Returns true only if the array is associative. + * @param array $array + * @return bool True if the array is associative. + */ + protected function isAssociativeArray($array) + { + if (!is_array($array)) { + return false; + } + $keys = array_keys($array); + foreach ($keys as $key) { + if (is_string($key)) { + return true; + } + } + return false; + } + + /** + * Given a variable name, discover its type. + * + * @param $name + * @param $item + * @return object The object from the item. + */ + private function createObjectFromName($name, $item) + { + $type = $this->$name; + return new $type($item); + } + + /** + * Verify if $obj is an array. + * @throws Google_Exception Thrown if $obj isn't an array. + * @param array $obj Items that should be validated. + * @param string $method Method expecting an array as an argument. + */ + public function assertIsArray($obj, $method) + { + if ($obj && !is_array($obj)) { + throw new Google_Exception( + "Incorrect parameter type passed to $method(). Expected an array." + ); + } + } + + /** + * @param mixed $offset + * @return bool + */ + public function offsetExists($offset) + { + return isset($this->$offset) || isset($this->modelData[$offset]); + } + + /** + * @param mixed $offset + * @return mixed + */ + public function offsetGet($offset) + { + return isset($this->$offset) ? + $this->$offset : + $this->__get($offset); + } + + /** + * @param mixed $offset + * @param mixed $value + * @return void + */ + public function offsetSet($offset, $value) + { + if (property_exists($this, $offset)) { + $this->$offset = $value; + } else { + $this->modelData[$offset] = $value; + $this->processed[$offset] = true; + } + } + + /** + * @param mixed $offset + * @return void + */ + public function offsetUnset($offset) + { + unset($this->modelData[$offset]); + } + + protected function keyType($key) + { + return $key . "Type"; + } + + protected function dataType($key) + { + return $key . "DataType"; + } + + public function __isset($key) + { + return isset($this->modelData[$key]); + } + + public function __unset($key) + { + unset($this->modelData[$key]); + } +} diff --git a/app/api/Google/Service.php b/app/api/Google/Service.php new file mode 100755 index 0000000..0848ac4 --- /dev/null +++ b/app/api/Google/Service.php @@ -0,0 +1,56 @@ +client = $client; + } + + /** + * Return the associated Google_Client class. + * @return Google_Client + */ + public function getClient() + { + return $this->client; + } + + /** + * Create a new HTTP Batch handler for this service + * + * @return Google_Http_Batch + */ + public function createBatch() + { + return new Google_Http_Batch( + $this->client, + false, + $this->rootUrl, + $this->batchPath + ); + } +} diff --git a/app/api/Google/Service/Calendar.php b/app/api/Google/Service/Calendar.php new file mode 100755 index 0000000..2ce6985 --- /dev/null +++ b/app/api/Google/Service/Calendar.php @@ -0,0 +1,3856 @@ + + * Lets you manipulate events and other calendar data.

+ * + *

+ * For more information about this service, see the API + * Documentation + *

+ * + * @author Google, Inc. + */ +class Google_Service_Calendar extends Google_Service +{ + /** Manage your calendars. */ + const CALENDAR = + "https://www.googleapis.com/auth/calendar"; + /** View your calendars. */ + const CALENDAR_READONLY = + "https://www.googleapis.com/auth/calendar.readonly"; + + public $acl; + public $calendarList; + public $calendars; + public $channels; + public $colors; + public $events; + public $freebusy; + public $settings; + public $serviceName; + + /** + * Constructs the internal representation of the Calendar service. + * + * @param Google_Client $client + */ + public function __construct(Google_Client $client) + { + parent::__construct($client); + $this->rootUrl = 'https://www.googleapis.com/'; + $this->servicePath = 'calendar/v3/'; + $this->version = 'v3'; + $this->serviceName = 'calendar'; + + $this->acl = new Google_Service_Calendar_Acl_Resource( + $this, + $this->serviceName, + 'acl', + array( + 'methods' => array( + 'delete' => array( + 'path' => 'calendars/{calendarId}/acl/{ruleId}', + 'httpMethod' => 'DELETE', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'ruleId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'get' => array( + 'path' => 'calendars/{calendarId}/acl/{ruleId}', + 'httpMethod' => 'GET', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'ruleId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'insert' => array( + 'path' => 'calendars/{calendarId}/acl', + 'httpMethod' => 'POST', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'list' => array( + 'path' => 'calendars/{calendarId}/acl', + 'httpMethod' => 'GET', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'maxResults' => array( + 'location' => 'query', + 'type' => 'integer', + ), + 'pageToken' => array( + 'location' => 'query', + 'type' => 'string', + ), + 'showDeleted' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + 'syncToken' => array( + 'location' => 'query', + 'type' => 'string', + ), + ), + ),'patch' => array( + 'path' => 'calendars/{calendarId}/acl/{ruleId}', + 'httpMethod' => 'PATCH', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'ruleId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'update' => array( + 'path' => 'calendars/{calendarId}/acl/{ruleId}', + 'httpMethod' => 'PUT', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'ruleId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'watch' => array( + 'path' => 'calendars/{calendarId}/acl/watch', + 'httpMethod' => 'POST', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'maxResults' => array( + 'location' => 'query', + 'type' => 'integer', + ), + 'pageToken' => array( + 'location' => 'query', + 'type' => 'string', + ), + 'showDeleted' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + 'syncToken' => array( + 'location' => 'query', + 'type' => 'string', + ), + ), + ), + ) + ) + ); + $this->calendarList = new Google_Service_Calendar_CalendarList_Resource( + $this, + $this->serviceName, + 'calendarList', + array( + 'methods' => array( + 'delete' => array( + 'path' => 'users/me/calendarList/{calendarId}', + 'httpMethod' => 'DELETE', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'get' => array( + 'path' => 'users/me/calendarList/{calendarId}', + 'httpMethod' => 'GET', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'insert' => array( + 'path' => 'users/me/calendarList', + 'httpMethod' => 'POST', + 'parameters' => array( + 'colorRgbFormat' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + ), + ),'list' => array( + 'path' => 'users/me/calendarList', + 'httpMethod' => 'GET', + 'parameters' => array( + 'maxResults' => array( + 'location' => 'query', + 'type' => 'integer', + ), + 'minAccessRole' => array( + 'location' => 'query', + 'type' => 'string', + ), + 'pageToken' => array( + 'location' => 'query', + 'type' => 'string', + ), + 'showDeleted' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + 'showHidden' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + 'syncToken' => array( + 'location' => 'query', + 'type' => 'string', + ), + ), + ),'patch' => array( + 'path' => 'users/me/calendarList/{calendarId}', + 'httpMethod' => 'PATCH', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'colorRgbFormat' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + ), + ),'update' => array( + 'path' => 'users/me/calendarList/{calendarId}', + 'httpMethod' => 'PUT', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'colorRgbFormat' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + ), + ),'watch' => array( + 'path' => 'users/me/calendarList/watch', + 'httpMethod' => 'POST', + 'parameters' => array( + 'maxResults' => array( + 'location' => 'query', + 'type' => 'integer', + ), + 'minAccessRole' => array( + 'location' => 'query', + 'type' => 'string', + ), + 'pageToken' => array( + 'location' => 'query', + 'type' => 'string', + ), + 'showDeleted' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + 'showHidden' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + 'syncToken' => array( + 'location' => 'query', + 'type' => 'string', + ), + ), + ), + ) + ) + ); + $this->calendars = new Google_Service_Calendar_Calendars_Resource( + $this, + $this->serviceName, + 'calendars', + array( + 'methods' => array( + 'clear' => array( + 'path' => 'calendars/{calendarId}/clear', + 'httpMethod' => 'POST', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'delete' => array( + 'path' => 'calendars/{calendarId}', + 'httpMethod' => 'DELETE', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'get' => array( + 'path' => 'calendars/{calendarId}', + 'httpMethod' => 'GET', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'insert' => array( + 'path' => 'calendars', + 'httpMethod' => 'POST', + 'parameters' => array(), + ),'patch' => array( + 'path' => 'calendars/{calendarId}', + 'httpMethod' => 'PATCH', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'update' => array( + 'path' => 'calendars/{calendarId}', + 'httpMethod' => 'PUT', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ), + ) + ) + ); + $this->channels = new Google_Service_Calendar_Channels_Resource( + $this, + $this->serviceName, + 'channels', + array( + 'methods' => array( + 'stop' => array( + 'path' => 'channels/stop', + 'httpMethod' => 'POST', + 'parameters' => array(), + ), + ) + ) + ); + $this->colors = new Google_Service_Calendar_Colors_Resource( + $this, + $this->serviceName, + 'colors', + array( + 'methods' => array( + 'get' => array( + 'path' => 'colors', + 'httpMethod' => 'GET', + 'parameters' => array(), + ), + ) + ) + ); + $this->events = new Google_Service_Calendar_Events_Resource( + $this, + $this->serviceName, + 'events', + array( + 'methods' => array( + 'delete' => array( + 'path' => 'calendars/{calendarId}/events/{eventId}', + 'httpMethod' => 'DELETE', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'eventId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'sendNotifications' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + ), + ),'get' => array( + 'path' => 'calendars/{calendarId}/events/{eventId}', + 'httpMethod' => 'GET', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'eventId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'alwaysIncludeEmail' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + 'maxAttendees' => array( + 'location' => 'query', + 'type' => 'integer', + ), + 'timeZone' => array( + 'location' => 'query', + 'type' => 'string', + ), + ), + ),'import' => array( + 'path' => 'calendars/{calendarId}/events/import', + 'httpMethod' => 'POST', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'supportsAttachments' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + ), + ),'insert' => array( + 'path' => 'calendars/{calendarId}/events', + 'httpMethod' => 'POST', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'maxAttendees' => array( + 'location' => 'query', + 'type' => 'integer', + ), + 'sendNotifications' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + 'supportsAttachments' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + ), + ),'instances' => array( + 'path' => 'calendars/{calendarId}/events/{eventId}/instances', + 'httpMethod' => 'GET', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'eventId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'alwaysIncludeEmail' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + 'maxAttendees' => array( + 'location' => 'query', + 'type' => 'integer', + ), + 'maxResults' => array( + 'location' => 'query', + 'type' => 'integer', + ), + 'originalStart' => array( + 'location' => 'query', + 'type' => 'string', + ), + 'pageToken' => array( + 'location' => 'query', + 'type' => 'string', + ), + 'showDeleted' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + 'timeMax' => array( + 'location' => 'query', + 'type' => 'string', + ), + 'timeMin' => array( + 'location' => 'query', + 'type' => 'string', + ), + 'timeZone' => array( + 'location' => 'query', + 'type' => 'string', + ), + ), + ),'list' => array( + 'path' => 'calendars/{calendarId}/events', + 'httpMethod' => 'GET', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'alwaysIncludeEmail' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + 'iCalUID' => array( + 'location' => 'query', + 'type' => 'string', + ), + 'maxAttendees' => array( + 'location' => 'query', + 'type' => 'integer', + ), + 'maxResults' => array( + 'location' => 'query', + 'type' => 'integer', + ), + 'orderBy' => array( + 'location' => 'query', + 'type' => 'string', + ), + 'pageToken' => array( + 'location' => 'query', + 'type' => 'string', + ), + 'privateExtendedProperty' => array( + 'location' => 'query', + 'type' => 'string', + 'repeated' => true, + ), + 'q' => array( + 'location' => 'query', + 'type' => 'string', + ), + 'sharedExtendedProperty' => array( + 'location' => 'query', + 'type' => 'string', + 'repeated' => true, + ), + 'showDeleted' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + 'showHiddenInvitations' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + 'singleEvents' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + 'syncToken' => array( + 'location' => 'query', + 'type' => 'string', + ), + 'timeMax' => array( + 'location' => 'query', + 'type' => 'string', + ), + 'timeMin' => array( + 'location' => 'query', + 'type' => 'string', + ), + 'timeZone' => array( + 'location' => 'query', + 'type' => 'string', + ), + 'updatedMin' => array( + 'location' => 'query', + 'type' => 'string', + ), + ), + ),'move' => array( + 'path' => 'calendars/{calendarId}/events/{eventId}/move', + 'httpMethod' => 'POST', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'eventId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'destination' => array( + 'location' => 'query', + 'type' => 'string', + 'required' => true, + ), + 'sendNotifications' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + ), + ),'patch' => array( + 'path' => 'calendars/{calendarId}/events/{eventId}', + 'httpMethod' => 'PATCH', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'eventId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'alwaysIncludeEmail' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + 'maxAttendees' => array( + 'location' => 'query', + 'type' => 'integer', + ), + 'sendNotifications' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + 'supportsAttachments' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + ), + ),'quickAdd' => array( + 'path' => 'calendars/{calendarId}/events/quickAdd', + 'httpMethod' => 'POST', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'text' => array( + 'location' => 'query', + 'type' => 'string', + 'required' => true, + ), + 'sendNotifications' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + ), + ),'update' => array( + 'path' => 'calendars/{calendarId}/events/{eventId}', + 'httpMethod' => 'PUT', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'eventId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'alwaysIncludeEmail' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + 'maxAttendees' => array( + 'location' => 'query', + 'type' => 'integer', + ), + 'sendNotifications' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + 'supportsAttachments' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + ), + ),'watch' => array( + 'path' => 'calendars/{calendarId}/events/watch', + 'httpMethod' => 'POST', + 'parameters' => array( + 'calendarId' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + 'alwaysIncludeEmail' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + 'iCalUID' => array( + 'location' => 'query', + 'type' => 'string', + ), + 'maxAttendees' => array( + 'location' => 'query', + 'type' => 'integer', + ), + 'maxResults' => array( + 'location' => 'query', + 'type' => 'integer', + ), + 'orderBy' => array( + 'location' => 'query', + 'type' => 'string', + ), + 'pageToken' => array( + 'location' => 'query', + 'type' => 'string', + ), + 'privateExtendedProperty' => array( + 'location' => 'query', + 'type' => 'string', + 'repeated' => true, + ), + 'q' => array( + 'location' => 'query', + 'type' => 'string', + ), + 'sharedExtendedProperty' => array( + 'location' => 'query', + 'type' => 'string', + 'repeated' => true, + ), + 'showDeleted' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + 'showHiddenInvitations' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + 'singleEvents' => array( + 'location' => 'query', + 'type' => 'boolean', + ), + 'syncToken' => array( + 'location' => 'query', + 'type' => 'string', + ), + 'timeMax' => array( + 'location' => 'query', + 'type' => 'string', + ), + 'timeMin' => array( + 'location' => 'query', + 'type' => 'string', + ), + 'timeZone' => array( + 'location' => 'query', + 'type' => 'string', + ), + 'updatedMin' => array( + 'location' => 'query', + 'type' => 'string', + ), + ), + ), + ) + ) + ); + $this->freebusy = new Google_Service_Calendar_Freebusy_Resource( + $this, + $this->serviceName, + 'freebusy', + array( + 'methods' => array( + 'query' => array( + 'path' => 'freeBusy', + 'httpMethod' => 'POST', + 'parameters' => array(), + ), + ) + ) + ); + $this->settings = new Google_Service_Calendar_Settings_Resource( + $this, + $this->serviceName, + 'settings', + array( + 'methods' => array( + 'get' => array( + 'path' => 'users/me/settings/{setting}', + 'httpMethod' => 'GET', + 'parameters' => array( + 'setting' => array( + 'location' => 'path', + 'type' => 'string', + 'required' => true, + ), + ), + ),'list' => array( + 'path' => 'users/me/settings', + 'httpMethod' => 'GET', + 'parameters' => array( + 'maxResults' => array( + 'location' => 'query', + 'type' => 'integer', + ), + 'pageToken' => array( + 'location' => 'query', + 'type' => 'string', + ), + 'syncToken' => array( + 'location' => 'query', + 'type' => 'string', + ), + ), + ),'watch' => array( + 'path' => 'users/me/settings/watch', + 'httpMethod' => 'POST', + 'parameters' => array( + 'maxResults' => array( + 'location' => 'query', + 'type' => 'integer', + ), + 'pageToken' => array( + 'location' => 'query', + 'type' => 'string', + ), + 'syncToken' => array( + 'location' => 'query', + 'type' => 'string', + ), + ), + ), + ) + ) + ); + } +} + + +/** + * The "acl" collection of methods. + * Typical usage is: + * + * $calendarService = new Google_Service_Calendar(...); + * $acl = $calendarService->acl; + * + */ +class Google_Service_Calendar_Acl_Resource extends Google_Service_Resource +{ + + /** + * Deletes an access control rule. (acl.delete) + * + * @param string $calendarId Calendar identifier. To retrieve calendar IDs call + * the calendarList.list method. If you want to access the primary calendar of + * the currently logged in user, use the "primary" keyword. + * @param string $ruleId ACL rule identifier. + * @param array $optParams Optional parameters. + */ + public function delete($calendarId, $ruleId, $optParams = array()) + { + $params = array('calendarId' => $calendarId, 'ruleId' => $ruleId); + $params = array_merge($params, $optParams); + return $this->call('delete', array($params)); + } + + /** + * Returns an access control rule. (acl.get) + * + * @param string $calendarId Calendar identifier. To retrieve calendar IDs call + * the calendarList.list method. If you want to access the primary calendar of + * the currently logged in user, use the "primary" keyword. + * @param string $ruleId ACL rule identifier. + * @param array $optParams Optional parameters. + * @return Google_Service_Calendar_AclRule + */ + public function get($calendarId, $ruleId, $optParams = array()) + { + $params = array('calendarId' => $calendarId, 'ruleId' => $ruleId); + $params = array_merge($params, $optParams); + return $this->call('get', array($params), "Google_Service_Calendar_AclRule"); + } + + /** + * Creates an access control rule. (acl.insert) + * + * @param string $calendarId Calendar identifier. To retrieve calendar IDs call + * the calendarList.list method. If you want to access the primary calendar of + * the currently logged in user, use the "primary" keyword. + * @param Google_AclRule $postBody + * @param array $optParams Optional parameters. + * @return Google_Service_Calendar_AclRule + */ + public function insert($calendarId, Google_Service_Calendar_AclRule $postBody, $optParams = array()) + { + $params = array('calendarId' => $calendarId, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('insert', array($params), "Google_Service_Calendar_AclRule"); + } + + /** + * Returns the rules in the access control list for the calendar. (acl.listAcl) + * + * @param string $calendarId Calendar identifier. To retrieve calendar IDs call + * the calendarList.list method. If you want to access the primary calendar of + * the currently logged in user, use the "primary" keyword. + * @param array $optParams Optional parameters. + * + * @opt_param int maxResults Maximum number of entries returned on one result + * page. By default the value is 100 entries. The page size can never be larger + * than 250 entries. Optional. + * @opt_param string pageToken Token specifying which result page to return. + * Optional. + * @opt_param bool showDeleted Whether to include deleted ACLs in the result. + * Deleted ACLs are represented by role equal to "none". Deleted ACLs will + * always be included if syncToken is provided. Optional. The default is False. + * @opt_param string syncToken Token obtained from the nextSyncToken field + * returned on the last page of results from the previous list request. It makes + * the result of this list request contain only entries that have changed since + * then. All entries deleted since the previous list request will always be in + * the result set and it is not allowed to set showDeleted to False. If the + * syncToken expires, the server will respond with a 410 GONE response code and + * the client should clear its storage and perform a full synchronization + * without any syncToken. Learn more about incremental synchronization. + * Optional. The default is to return all entries. + * @return Google_Service_Calendar_Acl + */ + public function listAcl($calendarId, $optParams = array()) + { + $params = array('calendarId' => $calendarId); + $params = array_merge($params, $optParams); + return $this->call('list', array($params), "Google_Service_Calendar_Acl"); + } + + /** + * Updates an access control rule. This method supports patch semantics. + * (acl.patch) + * + * @param string $calendarId Calendar identifier. To retrieve calendar IDs call + * the calendarList.list method. If you want to access the primary calendar of + * the currently logged in user, use the "primary" keyword. + * @param string $ruleId ACL rule identifier. + * @param Google_AclRule $postBody + * @param array $optParams Optional parameters. + * @return Google_Service_Calendar_AclRule + */ + public function patch($calendarId, $ruleId, Google_Service_Calendar_AclRule $postBody, $optParams = array()) + { + $params = array('calendarId' => $calendarId, 'ruleId' => $ruleId, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('patch', array($params), "Google_Service_Calendar_AclRule"); + } + + /** + * Updates an access control rule. (acl.update) + * + * @param string $calendarId Calendar identifier. To retrieve calendar IDs call + * the calendarList.list method. If you want to access the primary calendar of + * the currently logged in user, use the "primary" keyword. + * @param string $ruleId ACL rule identifier. + * @param Google_AclRule $postBody + * @param array $optParams Optional parameters. + * @return Google_Service_Calendar_AclRule + */ + public function update($calendarId, $ruleId, Google_Service_Calendar_AclRule $postBody, $optParams = array()) + { + $params = array('calendarId' => $calendarId, 'ruleId' => $ruleId, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('update', array($params), "Google_Service_Calendar_AclRule"); + } + + /** + * Watch for changes to ACL resources. (acl.watch) + * + * @param string $calendarId Calendar identifier. To retrieve calendar IDs call + * the calendarList.list method. If you want to access the primary calendar of + * the currently logged in user, use the "primary" keyword. + * @param Google_Channel $postBody + * @param array $optParams Optional parameters. + * + * @opt_param int maxResults Maximum number of entries returned on one result + * page. By default the value is 100 entries. The page size can never be larger + * than 250 entries. Optional. + * @opt_param string pageToken Token specifying which result page to return. + * Optional. + * @opt_param bool showDeleted Whether to include deleted ACLs in the result. + * Deleted ACLs are represented by role equal to "none". Deleted ACLs will + * always be included if syncToken is provided. Optional. The default is False. + * @opt_param string syncToken Token obtained from the nextSyncToken field + * returned on the last page of results from the previous list request. It makes + * the result of this list request contain only entries that have changed since + * then. All entries deleted since the previous list request will always be in + * the result set and it is not allowed to set showDeleted to False. If the + * syncToken expires, the server will respond with a 410 GONE response code and + * the client should clear its storage and perform a full synchronization + * without any syncToken. Learn more about incremental synchronization. + * Optional. The default is to return all entries. + * @return Google_Service_Calendar_Channel + */ + public function watch($calendarId, Google_Service_Calendar_Channel $postBody, $optParams = array()) + { + $params = array('calendarId' => $calendarId, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('watch', array($params), "Google_Service_Calendar_Channel"); + } +} + +/** + * The "calendarList" collection of methods. + * Typical usage is: + * + * $calendarService = new Google_Service_Calendar(...); + * $calendarList = $calendarService->calendarList; + * + */ +class Google_Service_Calendar_CalendarList_Resource extends Google_Service_Resource +{ + + /** + * Deletes an entry on the user's calendar list. (calendarList.delete) + * + * @param string $calendarId Calendar identifier. To retrieve calendar IDs call + * the calendarList.list method. If you want to access the primary calendar of + * the currently logged in user, use the "primary" keyword. + * @param array $optParams Optional parameters. + */ + public function delete($calendarId, $optParams = array()) + { + $params = array('calendarId' => $calendarId); + $params = array_merge($params, $optParams); + return $this->call('delete', array($params)); + } + + /** + * Returns an entry on the user's calendar list. (calendarList.get) + * + * @param string $calendarId Calendar identifier. To retrieve calendar IDs call + * the calendarList.list method. If you want to access the primary calendar of + * the currently logged in user, use the "primary" keyword. + * @param array $optParams Optional parameters. + * @return Google_Service_Calendar_CalendarListEntry + */ + public function get($calendarId, $optParams = array()) + { + $params = array('calendarId' => $calendarId); + $params = array_merge($params, $optParams); + return $this->call('get', array($params), "Google_Service_Calendar_CalendarListEntry"); + } + + /** + * Adds an entry to the user's calendar list. (calendarList.insert) + * + * @param Google_CalendarListEntry $postBody + * @param array $optParams Optional parameters. + * + * @opt_param bool colorRgbFormat Whether to use the foregroundColor and + * backgroundColor fields to write the calendar colors (RGB). If this feature is + * used, the index-based colorId field will be set to the best matching option + * automatically. Optional. The default is False. + * @return Google_Service_Calendar_CalendarListEntry + */ + public function insert(Google_Service_Calendar_CalendarListEntry $postBody, $optParams = array()) + { + $params = array('postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('insert', array($params), "Google_Service_Calendar_CalendarListEntry"); + } + + /** + * Returns entries on the user's calendar list. (calendarList.listCalendarList) + * + * @param array $optParams Optional parameters. + * + * @opt_param int maxResults Maximum number of entries returned on one result + * page. By default the value is 100 entries. The page size can never be larger + * than 250 entries. Optional. + * @opt_param string minAccessRole The minimum access role for the user in the + * returned entries. Optional. The default is no restriction. + * @opt_param string pageToken Token specifying which result page to return. + * Optional. + * @opt_param bool showDeleted Whether to include deleted calendar list entries + * in the result. Optional. The default is False. + * @opt_param bool showHidden Whether to show hidden entries. Optional. The + * default is False. + * @opt_param string syncToken Token obtained from the nextSyncToken field + * returned on the last page of results from the previous list request. It makes + * the result of this list request contain only entries that have changed since + * then. If only read-only fields such as calendar properties or ACLs have + * changed, the entry won't be returned. All entries deleted and hidden since + * the previous list request will always be in the result set and it is not + * allowed to set showDeleted neither showHidden to False. To ensure client + * state consistency minAccessRole query parameter cannot be specified together + * with nextSyncToken. If the syncToken expires, the server will respond with a + * 410 GONE response code and the client should clear its storage and perform a + * full synchronization without any syncToken. Learn more about incremental + * synchronization. Optional. The default is to return all entries. + * @return Google_Service_Calendar_CalendarList + */ + public function listCalendarList($optParams = array()) + { + $params = []; + $params = array_merge($params, $optParams); + return $this->call('list', array($params), "Google_Service_Calendar_CalendarList"); + } + + /** + * Updates an entry on the user's calendar list. This method supports patch + * semantics. (calendarList.patch) + * + * @param string $calendarId Calendar identifier. To retrieve calendar IDs call + * the calendarList.list method. If you want to access the primary calendar of + * the currently logged in user, use the "primary" keyword. + * @param Google_CalendarListEntry $postBody + * @param array $optParams Optional parameters. + * + * @opt_param bool colorRgbFormat Whether to use the foregroundColor and + * backgroundColor fields to write the calendar colors (RGB). If this feature is + * used, the index-based colorId field will be set to the best matching option + * automatically. Optional. The default is False. + * @return Google_Service_Calendar_CalendarListEntry + */ + public function patch($calendarId, Google_Service_Calendar_CalendarListEntry $postBody, $optParams = array()) + { + $params = array('calendarId' => $calendarId, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('patch', array($params), "Google_Service_Calendar_CalendarListEntry"); + } + + /** + * Updates an entry on the user's calendar list. (calendarList.update) + * + * @param string $calendarId Calendar identifier. To retrieve calendar IDs call + * the calendarList.list method. If you want to access the primary calendar of + * the currently logged in user, use the "primary" keyword. + * @param Google_CalendarListEntry $postBody + * @param array $optParams Optional parameters. + * + * @opt_param bool colorRgbFormat Whether to use the foregroundColor and + * backgroundColor fields to write the calendar colors (RGB). If this feature is + * used, the index-based colorId field will be set to the best matching option + * automatically. Optional. The default is False. + * @return Google_Service_Calendar_CalendarListEntry + */ + public function update($calendarId, Google_Service_Calendar_CalendarListEntry $postBody, $optParams = array()) + { + $params = array('calendarId' => $calendarId, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('update', array($params), "Google_Service_Calendar_CalendarListEntry"); + } + + /** + * Watch for changes to CalendarList resources. (calendarList.watch) + * + * @param Google_Channel $postBody + * @param array $optParams Optional parameters. + * + * @opt_param int maxResults Maximum number of entries returned on one result + * page. By default the value is 100 entries. The page size can never be larger + * than 250 entries. Optional. + * @opt_param string minAccessRole The minimum access role for the user in the + * returned entries. Optional. The default is no restriction. + * @opt_param string pageToken Token specifying which result page to return. + * Optional. + * @opt_param bool showDeleted Whether to include deleted calendar list entries + * in the result. Optional. The default is False. + * @opt_param bool showHidden Whether to show hidden entries. Optional. The + * default is False. + * @opt_param string syncToken Token obtained from the nextSyncToken field + * returned on the last page of results from the previous list request. It makes + * the result of this list request contain only entries that have changed since + * then. If only read-only fields such as calendar properties or ACLs have + * changed, the entry won't be returned. All entries deleted and hidden since + * the previous list request will always be in the result set and it is not + * allowed to set showDeleted neither showHidden to False. To ensure client + * state consistency minAccessRole query parameter cannot be specified together + * with nextSyncToken. If the syncToken expires, the server will respond with a + * 410 GONE response code and the client should clear its storage and perform a + * full synchronization without any syncToken. Learn more about incremental + * synchronization. Optional. The default is to return all entries. + * @return Google_Service_Calendar_Channel + */ + public function watch(Google_Service_Calendar_Channel $postBody, $optParams = array()) + { + $params = array('postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('watch', array($params), "Google_Service_Calendar_Channel"); + } +} + +/** + * The "calendars" collection of methods. + * Typical usage is: + * + * $calendarService = new Google_Service_Calendar(...); + * $calendars = $calendarService->calendars; + * + */ +class Google_Service_Calendar_Calendars_Resource extends Google_Service_Resource +{ + + /** + * Clears a primary calendar. This operation deletes all events associated with + * the primary calendar of an account. (calendars.clear) + * + * @param string $calendarId Calendar identifier. To retrieve calendar IDs call + * the calendarList.list method. If you want to access the primary calendar of + * the currently logged in user, use the "primary" keyword. + * @param array $optParams Optional parameters. + */ + public function clear($calendarId, $optParams = array()) + { + $params = array('calendarId' => $calendarId); + $params = array_merge($params, $optParams); + return $this->call('clear', array($params)); + } + + /** + * Deletes a secondary calendar. Use calendars.clear for clearing all events on + * primary calendars. (calendars.delete) + * + * @param string $calendarId Calendar identifier. To retrieve calendar IDs call + * the calendarList.list method. If you want to access the primary calendar of + * the currently logged in user, use the "primary" keyword. + * @param array $optParams Optional parameters. + */ + public function delete($calendarId, $optParams = array()) + { + $params = array('calendarId' => $calendarId); + $params = array_merge($params, $optParams); + return $this->call('delete', array($params)); + } + + /** + * Returns metadata for a calendar. (calendars.get) + * + * @param string $calendarId Calendar identifier. To retrieve calendar IDs call + * the calendarList.list method. If you want to access the primary calendar of + * the currently logged in user, use the "primary" keyword. + * @param array $optParams Optional parameters. + * @return Google_Service_Calendar_Calendar + */ + public function get($calendarId, $optParams = array()) + { + $params = array('calendarId' => $calendarId); + $params = array_merge($params, $optParams); + return $this->call('get', array($params), "Google_Service_Calendar_Calendar"); + } + + /** + * Creates a secondary calendar. (calendars.insert) + * + * @param Google_Calendar $postBody + * @param array $optParams Optional parameters. + * @return Google_Service_Calendar_Calendar + */ + public function insert(Google_Service_Calendar_Calendar $postBody, $optParams = array()) + { + $params = array('postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('insert', array($params), "Google_Service_Calendar_Calendar"); + } + + /** + * Updates metadata for a calendar. This method supports patch semantics. + * (calendars.patch) + * + * @param string $calendarId Calendar identifier. To retrieve calendar IDs call + * the calendarList.list method. If you want to access the primary calendar of + * the currently logged in user, use the "primary" keyword. + * @param Google_Calendar $postBody + * @param array $optParams Optional parameters. + * @return Google_Service_Calendar_Calendar + */ + public function patch($calendarId, Google_Service_Calendar_Calendar $postBody, $optParams = array()) + { + $params = array('calendarId' => $calendarId, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('patch', array($params), "Google_Service_Calendar_Calendar"); + } + + /** + * Updates metadata for a calendar. (calendars.update) + * + * @param string $calendarId Calendar identifier. To retrieve calendar IDs call + * the calendarList.list method. If you want to access the primary calendar of + * the currently logged in user, use the "primary" keyword. + * @param Google_Calendar $postBody + * @param array $optParams Optional parameters. + * @return Google_Service_Calendar_Calendar + */ + public function update($calendarId, Google_Service_Calendar_Calendar $postBody, $optParams = array()) + { + $params = array('calendarId' => $calendarId, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('update', array($params), "Google_Service_Calendar_Calendar"); + } +} + +/** + * The "channels" collection of methods. + * Typical usage is: + * + * $calendarService = new Google_Service_Calendar(...); + * $channels = $calendarService->channels; + * + */ +class Google_Service_Calendar_Channels_Resource extends Google_Service_Resource +{ + + /** + * Stop watching resources through this channel (channels.stop) + * + * @param Google_Channel $postBody + * @param array $optParams Optional parameters. + */ + public function stop(Google_Service_Calendar_Channel $postBody, $optParams = array()) + { + $params = array('postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('stop', array($params)); + } +} + +/** + * The "colors" collection of methods. + * Typical usage is: + * + * $calendarService = new Google_Service_Calendar(...); + * $colors = $calendarService->colors; + * + */ +class Google_Service_Calendar_Colors_Resource extends Google_Service_Resource +{ + + /** + * Returns the color definitions for calendars and events. (colors.get) + * + * @param array $optParams Optional parameters. + * @return Google_Service_Calendar_Colors + */ + public function get($optParams = array()) + { + $params = []; + $params = array_merge($params, $optParams); + return $this->call('get', array($params), "Google_Service_Calendar_Colors"); + } +} + +/** + * The "events" collection of methods. + * Typical usage is: + * + * $calendarService = new Google_Service_Calendar(...); + * $events = $calendarService->events; + * + */ +class Google_Service_Calendar_Events_Resource extends Google_Service_Resource +{ + + /** + * Deletes an event. (events.delete) + * + * @param string $calendarId Calendar identifier. To retrieve calendar IDs call + * the calendarList.list method. If you want to access the primary calendar of + * the currently logged in user, use the "primary" keyword. + * @param string $eventId Event identifier. + * @param array $optParams Optional parameters. + * + * @opt_param bool sendNotifications Whether to send notifications about the + * deletion of the event. Optional. The default is False. + */ + public function delete($calendarId, $eventId, $optParams = array()) + { + $params = array('calendarId' => $calendarId, 'eventId' => $eventId); + $params = array_merge($params, $optParams); + return $this->call('delete', array($params)); + } + + /** + * Returns an event. (events.get) + * + * @param string $calendarId Calendar identifier. To retrieve calendar IDs call + * the calendarList.list method. If you want to access the primary calendar of + * the currently logged in user, use the "primary" keyword. + * @param string $eventId Event identifier. + * @param array $optParams Optional parameters. + * + * @opt_param bool alwaysIncludeEmail Whether to always include a value in the + * email field for the organizer, creator and attendees, even if no real email + * is available (i.e. a generated, non-working value will be provided). The use + * of this option is discouraged and should only be used by clients which cannot + * handle the absence of an email address value in the mentioned places. + * Optional. The default is False. + * @opt_param int maxAttendees The maximum number of attendees to include in the + * response. If there are more than the specified number of attendees, only the + * participant is returned. Optional. + * @opt_param string timeZone Time zone used in the response. Optional. The + * default is the time zone of the calendar. + * @return Google_Service_Calendar_Event + */ + public function get($calendarId, $eventId, $optParams = array()) + { + $params = array('calendarId' => $calendarId, 'eventId' => $eventId); + $params = array_merge($params, $optParams); + return $this->call('get', array($params), "Google_Service_Calendar_Event"); + } + + /** + * Imports an event. This operation is used to add a private copy of an existing + * event to a calendar. (events.import) + * + * @param string $calendarId Calendar identifier. To retrieve calendar IDs call + * the calendarList.list method. If you want to access the primary calendar of + * the currently logged in user, use the "primary" keyword. + * @param Google_Event $postBody + * @param array $optParams Optional parameters. + * + * @opt_param bool supportsAttachments Whether API client performing operation + * supports event attachments. Optional. The default is False. + * @return Google_Service_Calendar_Event + */ + public function import($calendarId, Google_Service_Calendar_Event $postBody, $optParams = array()) + { + $params = array('calendarId' => $calendarId, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('import', array($params), "Google_Service_Calendar_Event"); + } + + /** + * Creates an event. (events.insert) + * + * @param string $calendarId Calendar identifier. To retrieve calendar IDs call + * the calendarList.list method. If you want to access the primary calendar of + * the currently logged in user, use the "primary" keyword. + * @param Google_Event $postBody + * @param array $optParams Optional parameters. + * + * @opt_param int maxAttendees The maximum number of attendees to include in the + * response. If there are more than the specified number of attendees, only the + * participant is returned. Optional. + * @opt_param bool sendNotifications Whether to send notifications about the + * creation of the new event. Optional. The default is False. + * @opt_param bool supportsAttachments Whether API client performing operation + * supports event attachments. Optional. The default is False. + * @return Google_Service_Calendar_Event + */ + public function insert($calendarId, Google_Service_Calendar_Event $postBody, $optParams = array()) + { + $params = array('calendarId' => $calendarId, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('insert', array($params), "Google_Service_Calendar_Event"); + } + + /** + * Returns instances of the specified recurring event. (events.instances) + * + * @param string $calendarId Calendar identifier. To retrieve calendar IDs call + * the calendarList.list method. If you want to access the primary calendar of + * the currently logged in user, use the "primary" keyword. + * @param string $eventId Recurring event identifier. + * @param array $optParams Optional parameters. + * + * @opt_param bool alwaysIncludeEmail Whether to always include a value in the + * email field for the organizer, creator and attendees, even if no real email + * is available (i.e. a generated, non-working value will be provided). The use + * of this option is discouraged and should only be used by clients which cannot + * handle the absence of an email address value in the mentioned places. + * Optional. The default is False. + * @opt_param int maxAttendees The maximum number of attendees to include in the + * response. If there are more than the specified number of attendees, only the + * participant is returned. Optional. + * @opt_param int maxResults Maximum number of events returned on one result + * page. By default the value is 250 events. The page size can never be larger + * than 2500 events. Optional. + * @opt_param string originalStart The original start time of the instance in + * the result. Optional. + * @opt_param string pageToken Token specifying which result page to return. + * Optional. + * @opt_param bool showDeleted Whether to include deleted events (with status + * equals "cancelled") in the result. Cancelled instances of recurring events + * will still be included if singleEvents is False. Optional. The default is + * False. + * @opt_param string timeMax Upper bound (exclusive) for an event's start time + * to filter by. Optional. The default is not to filter by start time. Must be + * an RFC3339 timestamp with mandatory time zone offset. + * @opt_param string timeMin Lower bound (inclusive) for an event's end time to + * filter by. Optional. The default is not to filter by end time. Must be an + * RFC3339 timestamp with mandatory time zone offset. + * @opt_param string timeZone Time zone used in the response. Optional. The + * default is the time zone of the calendar. + * @return Google_Service_Calendar_Events + */ + public function instances($calendarId, $eventId, $optParams = array()) + { + $params = array('calendarId' => $calendarId, 'eventId' => $eventId); + $params = array_merge($params, $optParams); + return $this->call('instances', array($params), "Google_Service_Calendar_Events"); + } + + /** + * Returns events on the specified calendar. (events.listEvents) + * + * @param string $calendarId Calendar identifier. To retrieve calendar IDs call + * the calendarList.list method. If you want to access the primary calendar of + * the currently logged in user, use the "primary" keyword. + * @param array $optParams Optional parameters. + * + * @opt_param bool alwaysIncludeEmail Whether to always include a value in the + * email field for the organizer, creator and attendees, even if no real email + * is available (i.e. a generated, non-working value will be provided). The use + * of this option is discouraged and should only be used by clients which cannot + * handle the absence of an email address value in the mentioned places. + * Optional. The default is False. + * @opt_param string iCalUID Specifies event ID in the iCalendar format to be + * included in the response. Optional. + * @opt_param int maxAttendees The maximum number of attendees to include in the + * response. If there are more than the specified number of attendees, only the + * participant is returned. Optional. + * @opt_param int maxResults Maximum number of events returned on one result + * page. By default the value is 250 events. The page size can never be larger + * than 2500 events. Optional. + * @opt_param string orderBy The order of the events returned in the result. + * Optional. The default is an unspecified, stable order. + * @opt_param string pageToken Token specifying which result page to return. + * Optional. + * @opt_param string privateExtendedProperty Extended properties constraint + * specified as propertyName=value. Matches only private properties. This + * parameter might be repeated multiple times to return events that match all + * given constraints. + * @opt_param string q Free text search terms to find events that match these + * terms in any field, except for extended properties. Optional. + * @opt_param string sharedExtendedProperty Extended properties constraint + * specified as propertyName=value. Matches only shared properties. This + * parameter might be repeated multiple times to return events that match all + * given constraints. + * @opt_param bool showDeleted Whether to include deleted events (with status + * equals "cancelled") in the result. Cancelled instances of recurring events + * (but not the underlying recurring event) will still be included if + * showDeleted and singleEvents are both False. If showDeleted and singleEvents + * are both True, only single instances of deleted events (but not the + * underlying recurring events) are returned. Optional. The default is False. + * @opt_param bool showHiddenInvitations Whether to include hidden invitations + * in the result. Optional. The default is False. + * @opt_param bool singleEvents Whether to expand recurring events into + * instances and only return single one-off events and instances of recurring + * events, but not the underlying recurring events themselves. Optional. The + * default is False. + * @opt_param string syncToken Token obtained from the nextSyncToken field + * returned on the last page of results from the previous list request. It makes + * the result of this list request contain only entries that have changed since + * then. All events deleted since the previous list request will always be in + * the result set and it is not allowed to set showDeleted to False. There are + * several query parameters that cannot be specified together with nextSyncToken + * to ensure consistency of the client state. + * + * These are: - iCalUID - orderBy - privateExtendedProperty - q - + * sharedExtendedProperty - timeMin - timeMax - updatedMin If the syncToken + * expires, the server will respond with a 410 GONE response code and the client + * should clear its storage and perform a full synchronization without any + * syncToken. Learn more about incremental synchronization. Optional. The + * default is to return all entries. + * @opt_param string timeMax Upper bound (exclusive) for an event's start time + * to filter by. Optional. The default is not to filter by start time. Must be + * an RFC3339 timestamp with mandatory time zone offset, e.g., + * 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided + * but will be ignored. + * @opt_param string timeMin Lower bound (inclusive) for an event's end time to + * filter by. Optional. The default is not to filter by end time. Must be an + * RFC3339 timestamp with mandatory time zone offset, e.g., + * 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided + * but will be ignored. + * @opt_param string timeZone Time zone used in the response. Optional. The + * default is the time zone of the calendar. + * @opt_param string updatedMin Lower bound for an event's last modification + * time (as a RFC3339 timestamp) to filter by. When specified, entries deleted + * since this time will always be included regardless of showDeleted. Optional. + * The default is not to filter by last modification time. + * @return Google_Service_Calendar_Events + */ + public function listEvents($calendarId, $optParams = array()) + { + $params = array('calendarId' => $calendarId); + $params = array_merge($params, $optParams); + return $this->call('list', array($params), "Google_Service_Calendar_Events"); + } + + /** + * Moves an event to another calendar, i.e. changes an event's organizer. + * (events.move) + * + * @param string $calendarId Calendar identifier of the source calendar where + * the event currently is on. + * @param string $eventId Event identifier. + * @param string $destination Calendar identifier of the target calendar where + * the event is to be moved to. + * @param array $optParams Optional parameters. + * + * @opt_param bool sendNotifications Whether to send notifications about the + * change of the event's organizer. Optional. The default is False. + * @return Google_Service_Calendar_Event + */ + public function move($calendarId, $eventId, $destination, $optParams = array()) + { + $params = array('calendarId' => $calendarId, 'eventId' => $eventId, 'destination' => $destination); + $params = array_merge($params, $optParams); + return $this->call('move', array($params), "Google_Service_Calendar_Event"); + } + + /** + * Updates an event. This method supports patch semantics. (events.patch) + * + * @param string $calendarId Calendar identifier. To retrieve calendar IDs call + * the calendarList.list method. If you want to access the primary calendar of + * the currently logged in user, use the "primary" keyword. + * @param string $eventId Event identifier. + * @param Google_Event $postBody + * @param array $optParams Optional parameters. + * + * @opt_param bool alwaysIncludeEmail Whether to always include a value in the + * email field for the organizer, creator and attendees, even if no real email + * is available (i.e. a generated, non-working value will be provided). The use + * of this option is discouraged and should only be used by clients which cannot + * handle the absence of an email address value in the mentioned places. + * Optional. The default is False. + * @opt_param int maxAttendees The maximum number of attendees to include in the + * response. If there are more than the specified number of attendees, only the + * participant is returned. Optional. + * @opt_param bool sendNotifications Whether to send notifications about the + * event update (e.g. attendee's responses, title changes, etc.). Optional. The + * default is False. + * @opt_param bool supportsAttachments Whether API client performing operation + * supports event attachments. Optional. The default is False. + * @return Google_Service_Calendar_Event + */ + public function patch($calendarId, $eventId, Google_Service_Calendar_Event $postBody, $optParams = array()) + { + $params = array('calendarId' => $calendarId, 'eventId' => $eventId, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('patch', array($params), "Google_Service_Calendar_Event"); + } + + /** + * Creates an event based on a simple text string. (events.quickAdd) + * + * @param string $calendarId Calendar identifier. To retrieve calendar IDs call + * the calendarList.list method. If you want to access the primary calendar of + * the currently logged in user, use the "primary" keyword. + * @param string $text The text describing the event to be created. + * @param array $optParams Optional parameters. + * + * @opt_param bool sendNotifications Whether to send notifications about the + * creation of the event. Optional. The default is False. + * @return Google_Service_Calendar_Event + */ + public function quickAdd($calendarId, $text, $optParams = array()) + { + $params = array('calendarId' => $calendarId, 'text' => $text); + $params = array_merge($params, $optParams); + return $this->call('quickAdd', array($params), "Google_Service_Calendar_Event"); + } + + /** + * Updates an event. (events.update) + * + * @param string $calendarId Calendar identifier. To retrieve calendar IDs call + * the calendarList.list method. If you want to access the primary calendar of + * the currently logged in user, use the "primary" keyword. + * @param string $eventId Event identifier. + * @param Google_Event $postBody + * @param array $optParams Optional parameters. + * + * @opt_param bool alwaysIncludeEmail Whether to always include a value in the + * email field for the organizer, creator and attendees, even if no real email + * is available (i.e. a generated, non-working value will be provided). The use + * of this option is discouraged and should only be used by clients which cannot + * handle the absence of an email address value in the mentioned places. + * Optional. The default is False. + * @opt_param int maxAttendees The maximum number of attendees to include in the + * response. If there are more than the specified number of attendees, only the + * participant is returned. Optional. + * @opt_param bool sendNotifications Whether to send notifications about the + * event update (e.g. attendee's responses, title changes, etc.). Optional. The + * default is False. + * @opt_param bool supportsAttachments Whether API client performing operation + * supports event attachments. Optional. The default is False. + * @return Google_Service_Calendar_Event + */ + public function update($calendarId, $eventId, Google_Service_Calendar_Event $postBody, $optParams = array()) + { + $params = array('calendarId' => $calendarId, 'eventId' => $eventId, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('update', array($params), "Google_Service_Calendar_Event"); + } + + /** + * Watch for changes to Events resources. (events.watch) + * + * @param string $calendarId Calendar identifier. To retrieve calendar IDs call + * the calendarList.list method. If you want to access the primary calendar of + * the currently logged in user, use the "primary" keyword. + * @param Google_Channel $postBody + * @param array $optParams Optional parameters. + * + * @opt_param bool alwaysIncludeEmail Whether to always include a value in the + * email field for the organizer, creator and attendees, even if no real email + * is available (i.e. a generated, non-working value will be provided). The use + * of this option is discouraged and should only be used by clients which cannot + * handle the absence of an email address value in the mentioned places. + * Optional. The default is False. + * @opt_param string iCalUID Specifies event ID in the iCalendar format to be + * included in the response. Optional. + * @opt_param int maxAttendees The maximum number of attendees to include in the + * response. If there are more than the specified number of attendees, only the + * participant is returned. Optional. + * @opt_param int maxResults Maximum number of events returned on one result + * page. By default the value is 250 events. The page size can never be larger + * than 2500 events. Optional. + * @opt_param string orderBy The order of the events returned in the result. + * Optional. The default is an unspecified, stable order. + * @opt_param string pageToken Token specifying which result page to return. + * Optional. + * @opt_param string privateExtendedProperty Extended properties constraint + * specified as propertyName=value. Matches only private properties. This + * parameter might be repeated multiple times to return events that match all + * given constraints. + * @opt_param string q Free text search terms to find events that match these + * terms in any field, except for extended properties. Optional. + * @opt_param string sharedExtendedProperty Extended properties constraint + * specified as propertyName=value. Matches only shared properties. This + * parameter might be repeated multiple times to return events that match all + * given constraints. + * @opt_param bool showDeleted Whether to include deleted events (with status + * equals "cancelled") in the result. Cancelled instances of recurring events + * (but not the underlying recurring event) will still be included if + * showDeleted and singleEvents are both False. If showDeleted and singleEvents + * are both True, only single instances of deleted events (but not the + * underlying recurring events) are returned. Optional. The default is False. + * @opt_param bool showHiddenInvitations Whether to include hidden invitations + * in the result. Optional. The default is False. + * @opt_param bool singleEvents Whether to expand recurring events into + * instances and only return single one-off events and instances of recurring + * events, but not the underlying recurring events themselves. Optional. The + * default is False. + * @opt_param string syncToken Token obtained from the nextSyncToken field + * returned on the last page of results from the previous list request. It makes + * the result of this list request contain only entries that have changed since + * then. All events deleted since the previous list request will always be in + * the result set and it is not allowed to set showDeleted to False. There are + * several query parameters that cannot be specified together with nextSyncToken + * to ensure consistency of the client state. + * + * These are: - iCalUID - orderBy - privateExtendedProperty - q - + * sharedExtendedProperty - timeMin - timeMax - updatedMin If the syncToken + * expires, the server will respond with a 410 GONE response code and the client + * should clear its storage and perform a full synchronization without any + * syncToken. Learn more about incremental synchronization. Optional. The + * default is to return all entries. + * @opt_param string timeMax Upper bound (exclusive) for an event's start time + * to filter by. Optional. The default is not to filter by start time. Must be + * an RFC3339 timestamp with mandatory time zone offset, e.g., + * 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided + * but will be ignored. + * @opt_param string timeMin Lower bound (inclusive) for an event's end time to + * filter by. Optional. The default is not to filter by end time. Must be an + * RFC3339 timestamp with mandatory time zone offset, e.g., + * 2011-06-03T10:00:00-07:00, 2011-06-03T10:00:00Z. Milliseconds may be provided + * but will be ignored. + * @opt_param string timeZone Time zone used in the response. Optional. The + * default is the time zone of the calendar. + * @opt_param string updatedMin Lower bound for an event's last modification + * time (as a RFC3339 timestamp) to filter by. When specified, entries deleted + * since this time will always be included regardless of showDeleted. Optional. + * The default is not to filter by last modification time. + * @return Google_Service_Calendar_Channel + */ + public function watch($calendarId, Google_Service_Calendar_Channel $postBody, $optParams = array()) + { + $params = array('calendarId' => $calendarId, 'postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('watch', array($params), "Google_Service_Calendar_Channel"); + } +} + +/** + * The "freebusy" collection of methods. + * Typical usage is: + * + * $calendarService = new Google_Service_Calendar(...); + * $freebusy = $calendarService->freebusy; + * + */ +class Google_Service_Calendar_Freebusy_Resource extends Google_Service_Resource +{ + + /** + * Returns free/busy information for a set of calendars. (freebusy.query) + * + * @param Google_FreeBusyRequest $postBody + * @param array $optParams Optional parameters. + * @return Google_Service_Calendar_FreeBusyResponse + */ + public function query(Google_Service_Calendar_FreeBusyRequest $postBody, $optParams = array()) + { + $params = array('postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('query', array($params), "Google_Service_Calendar_FreeBusyResponse"); + } +} + +/** + * The "settings" collection of methods. + * Typical usage is: + * + * $calendarService = new Google_Service_Calendar(...); + * $settings = $calendarService->settings; + * + */ +class Google_Service_Calendar_Settings_Resource extends Google_Service_Resource +{ + + /** + * Returns a single user setting. (settings.get) + * + * @param string $setting The id of the user setting. + * @param array $optParams Optional parameters. + * @return Google_Service_Calendar_Setting + */ + public function get($setting, $optParams = array()) + { + $params = array('setting' => $setting); + $params = array_merge($params, $optParams); + return $this->call('get', array($params), "Google_Service_Calendar_Setting"); + } + + /** + * Returns all user settings for the authenticated user. (settings.listSettings) + * + * @param array $optParams Optional parameters. + * + * @opt_param int maxResults Maximum number of entries returned on one result + * page. By default the value is 100 entries. The page size can never be larger + * than 250 entries. Optional. + * @opt_param string pageToken Token specifying which result page to return. + * Optional. + * @opt_param string syncToken Token obtained from the nextSyncToken field + * returned on the last page of results from the previous list request. It makes + * the result of this list request contain only entries that have changed since + * then. If the syncToken expires, the server will respond with a 410 GONE + * response code and the client should clear its storage and perform a full + * synchronization without any syncToken. Learn more about incremental + * synchronization. Optional. The default is to return all entries. + * @return Google_Service_Calendar_Settings + */ + public function listSettings($optParams = array()) + { + $params = []; + $params = array_merge($params, $optParams); + return $this->call('list', array($params), "Google_Service_Calendar_Settings"); + } + + /** + * Watch for changes to Settings resources. (settings.watch) + * + * @param Google_Channel $postBody + * @param array $optParams Optional parameters. + * + * @opt_param int maxResults Maximum number of entries returned on one result + * page. By default the value is 100 entries. The page size can never be larger + * than 250 entries. Optional. + * @opt_param string pageToken Token specifying which result page to return. + * Optional. + * @opt_param string syncToken Token obtained from the nextSyncToken field + * returned on the last page of results from the previous list request. It makes + * the result of this list request contain only entries that have changed since + * then. If the syncToken expires, the server will respond with a 410 GONE + * response code and the client should clear its storage and perform a full + * synchronization without any syncToken. Learn more about incremental + * synchronization. Optional. The default is to return all entries. + * @return Google_Service_Calendar_Channel + */ + public function watch(Google_Service_Calendar_Channel $postBody, $optParams = array()) + { + $params = array('postBody' => $postBody); + $params = array_merge($params, $optParams); + return $this->call('watch', array($params), "Google_Service_Calendar_Channel"); + } +} + + + + +class Google_Service_Calendar_Acl extends Google_Collection +{ + protected $collection_key = 'items'; + protected $internal_gapi_mappings = array( + ); + public $etag; + protected $itemsType = 'Google_Service_Calendar_AclRule'; + protected $itemsDataType = 'array'; + public $kind; + public $nextPageToken; + public $nextSyncToken; + + + public function setEtag($etag) + { + $this->etag = $etag; + } + public function getEtag() + { + return $this->etag; + } + public function setItems($items) + { + $this->items = $items; + } + public function getItems() + { + return $this->items; + } + public function setKind($kind) + { + $this->kind = $kind; + } + public function getKind() + { + return $this->kind; + } + public function setNextPageToken($nextPageToken) + { + $this->nextPageToken = $nextPageToken; + } + public function getNextPageToken() + { + return $this->nextPageToken; + } + public function setNextSyncToken($nextSyncToken) + { + $this->nextSyncToken = $nextSyncToken; + } + public function getNextSyncToken() + { + return $this->nextSyncToken; + } +} + +class Google_Service_Calendar_AclRule extends Google_Model +{ + protected $internal_gapi_mappings = array( + ); + public $etag; + public $id; + public $kind; + public $role; + protected $scopeType = 'Google_Service_Calendar_AclRuleScope'; + protected $scopeDataType = ''; + + + public function setEtag($etag) + { + $this->etag = $etag; + } + public function getEtag() + { + return $this->etag; + } + public function setId($id) + { + $this->id = $id; + } + public function getId() + { + return $this->id; + } + public function setKind($kind) + { + $this->kind = $kind; + } + public function getKind() + { + return $this->kind; + } + public function setRole($role) + { + $this->role = $role; + } + public function getRole() + { + return $this->role; + } + public function setScope(Google_Service_Calendar_AclRuleScope $scope) + { + $this->scope = $scope; + } + public function getScope() + { + return $this->scope; + } +} + +class Google_Service_Calendar_AclRuleScope extends Google_Model +{ + protected $internal_gapi_mappings = array( + ); + public $type; + public $value; + + + public function setType($type) + { + $this->type = $type; + } + public function getType() + { + return $this->type; + } + public function setValue($value) + { + $this->value = $value; + } + public function getValue() + { + return $this->value; + } +} + +class Google_Service_Calendar_Calendar extends Google_Model +{ + protected $internal_gapi_mappings = array( + ); + public $description; + public $etag; + public $id; + public $kind; + public $location; + public $summary; + public $timeZone; + + + public function setDescription($description) + { + $this->description = $description; + } + public function getDescription() + { + return $this->description; + } + public function setEtag($etag) + { + $this->etag = $etag; + } + public function getEtag() + { + return $this->etag; + } + public function setId($id) + { + $this->id = $id; + } + public function getId() + { + return $this->id; + } + public function setKind($kind) + { + $this->kind = $kind; + } + public function getKind() + { + return $this->kind; + } + public function setLocation($location) + { + $this->location = $location; + } + public function getLocation() + { + return $this->location; + } + public function setSummary($summary) + { + $this->summary = $summary; + } + public function getSummary() + { + return $this->summary; + } + public function setTimeZone($timeZone) + { + $this->timeZone = $timeZone; + } + public function getTimeZone() + { + return $this->timeZone; + } +} + +class Google_Service_Calendar_CalendarList extends Google_Collection +{ + protected $collection_key = 'items'; + protected $internal_gapi_mappings = array( + ); + public $etag; + protected $itemsType = 'Google_Service_Calendar_CalendarListEntry'; + protected $itemsDataType = 'array'; + public $kind; + public $nextPageToken; + public $nextSyncToken; + + + public function setEtag($etag) + { + $this->etag = $etag; + } + public function getEtag() + { + return $this->etag; + } + public function setItems($items) + { + $this->items = $items; + } + public function getItems() + { + return $this->items; + } + public function setKind($kind) + { + $this->kind = $kind; + } + public function getKind() + { + return $this->kind; + } + public function setNextPageToken($nextPageToken) + { + $this->nextPageToken = $nextPageToken; + } + public function getNextPageToken() + { + return $this->nextPageToken; + } + public function setNextSyncToken($nextSyncToken) + { + $this->nextSyncToken = $nextSyncToken; + } + public function getNextSyncToken() + { + return $this->nextSyncToken; + } +} + +class Google_Service_Calendar_CalendarListEntry extends Google_Collection +{ + protected $collection_key = 'defaultReminders'; + protected $internal_gapi_mappings = array( + ); + public $accessRole; + public $backgroundColor; + public $colorId; + protected $defaultRemindersType = 'Google_Service_Calendar_EventReminder'; + protected $defaultRemindersDataType = 'array'; + public $deleted; + public $description; + public $etag; + public $foregroundColor; + public $hidden; + public $id; + public $kind; + public $location; + protected $notificationSettingsType = 'Google_Service_Calendar_CalendarListEntryNotificationSettings'; + protected $notificationSettingsDataType = ''; + public $primary; + public $selected; + public $summary; + public $summaryOverride; + public $timeZone; + + + public function setAccessRole($accessRole) + { + $this->accessRole = $accessRole; + } + public function getAccessRole() + { + return $this->accessRole; + } + public function setBackgroundColor($backgroundColor) + { + $this->backgroundColor = $backgroundColor; + } + public function getBackgroundColor() + { + return $this->backgroundColor; + } + public function setColorId($colorId) + { + $this->colorId = $colorId; + } + public function getColorId() + { + return $this->colorId; + } + public function setDefaultReminders($defaultReminders) + { + $this->defaultReminders = $defaultReminders; + } + public function getDefaultReminders() + { + return $this->defaultReminders; + } + public function setDeleted($deleted) + { + $this->deleted = $deleted; + } + public function getDeleted() + { + return $this->deleted; + } + public function setDescription($description) + { + $this->description = $description; + } + public function getDescription() + { + return $this->description; + } + public function setEtag($etag) + { + $this->etag = $etag; + } + public function getEtag() + { + return $this->etag; + } + public function setForegroundColor($foregroundColor) + { + $this->foregroundColor = $foregroundColor; + } + public function getForegroundColor() + { + return $this->foregroundColor; + } + public function setHidden($hidden) + { + $this->hidden = $hidden; + } + public function getHidden() + { + return $this->hidden; + } + public function setId($id) + { + $this->id = $id; + } + public function getId() + { + return $this->id; + } + public function setKind($kind) + { + $this->kind = $kind; + } + public function getKind() + { + return $this->kind; + } + public function setLocation($location) + { + $this->location = $location; + } + public function getLocation() + { + return $this->location; + } + public function setNotificationSettings(Google_Service_Calendar_CalendarListEntryNotificationSettings $notificationSettings) + { + $this->notificationSettings = $notificationSettings; + } + public function getNotificationSettings() + { + return $this->notificationSettings; + } + public function setPrimary($primary) + { + $this->primary = $primary; + } + public function getPrimary() + { + return $this->primary; + } + public function setSelected($selected) + { + $this->selected = $selected; + } + public function getSelected() + { + return $this->selected; + } + public function setSummary($summary) + { + $this->summary = $summary; + } + public function getSummary() + { + return $this->summary; + } + public function setSummaryOverride($summaryOverride) + { + $this->summaryOverride = $summaryOverride; + } + public function getSummaryOverride() + { + return $this->summaryOverride; + } + public function setTimeZone($timeZone) + { + $this->timeZone = $timeZone; + } + public function getTimeZone() + { + return $this->timeZone; + } +} + +class Google_Service_Calendar_CalendarListEntryNotificationSettings extends Google_Collection +{ + protected $collection_key = 'notifications'; + protected $internal_gapi_mappings = array( + ); + protected $notificationsType = 'Google_Service_Calendar_CalendarNotification'; + protected $notificationsDataType = 'array'; + + + public function setNotifications($notifications) + { + $this->notifications = $notifications; + } + public function getNotifications() + { + return $this->notifications; + } +} + +class Google_Service_Calendar_CalendarNotification extends Google_Model +{ + protected $internal_gapi_mappings = array( + ); + public $method; + public $type; + + + public function setMethod($method) + { + $this->method = $method; + } + public function getMethod() + { + return $this->method; + } + public function setType($type) + { + $this->type = $type; + } + public function getType() + { + return $this->type; + } +} + +class Google_Service_Calendar_Channel extends Google_Model +{ + protected $internal_gapi_mappings = array( + ); + public $address; + public $expiration; + public $id; + public $kind; + public $params; + public $payload; + public $resourceId; + public $resourceUri; + public $token; + public $type; + + + public function setAddress($address) + { + $this->address = $address; + } + public function getAddress() + { + return $this->address; + } + public function setExpiration($expiration) + { + $this->expiration = $expiration; + } + public function getExpiration() + { + return $this->expiration; + } + public function setId($id) + { + $this->id = $id; + } + public function getId() + { + return $this->id; + } + public function setKind($kind) + { + $this->kind = $kind; + } + public function getKind() + { + return $this->kind; + } + public function setParams($params) + { + $this->params = $params; + } + public function getParams() + { + return $this->params; + } + public function setPayload($payload) + { + $this->payload = $payload; + } + public function getPayload() + { + return $this->payload; + } + public function setResourceId($resourceId) + { + $this->resourceId = $resourceId; + } + public function getResourceId() + { + return $this->resourceId; + } + public function setResourceUri($resourceUri) + { + $this->resourceUri = $resourceUri; + } + public function getResourceUri() + { + return $this->resourceUri; + } + public function setToken($token) + { + $this->token = $token; + } + public function getToken() + { + return $this->token; + } + public function setType($type) + { + $this->type = $type; + } + public function getType() + { + return $this->type; + } +} + +class Google_Service_Calendar_ColorDefinition extends Google_Model +{ + protected $internal_gapi_mappings = array( + ); + public $background; + public $foreground; + + + public function setBackground($background) + { + $this->background = $background; + } + public function getBackground() + { + return $this->background; + } + public function setForeground($foreground) + { + $this->foreground = $foreground; + } + public function getForeground() + { + return $this->foreground; + } +} + +class Google_Service_Calendar_Colors extends Google_Model +{ + protected $internal_gapi_mappings = array( + ); + protected $calendarType = 'Google_Service_Calendar_ColorDefinition'; + protected $calendarDataType = 'map'; + protected $eventType = 'Google_Service_Calendar_ColorDefinition'; + protected $eventDataType = 'map'; + public $kind; + public $updated; + + + public function setCalendar($calendar) + { + $this->calendar = $calendar; + } + public function getCalendar() + { + return $this->calendar; + } + public function setEvent($event) + { + $this->event = $event; + } + public function getEvent() + { + return $this->event; + } + public function setKind($kind) + { + $this->kind = $kind; + } + public function getKind() + { + return $this->kind; + } + public function setUpdated($updated) + { + $this->updated = $updated; + } + public function getUpdated() + { + return $this->updated; + } +} + +class Google_Service_Calendar_Error extends Google_Model +{ + protected $internal_gapi_mappings = array( + ); + public $domain; + public $reason; + + + public function setDomain($domain) + { + $this->domain = $domain; + } + public function getDomain() + { + return $this->domain; + } + public function setReason($reason) + { + $this->reason = $reason; + } + public function getReason() + { + return $this->reason; + } +} + +class Google_Service_Calendar_Event extends Google_Collection +{ + protected $collection_key = 'recurrence'; + protected $internal_gapi_mappings = array( + ); + public $anyoneCanAddSelf; + protected $attachmentsType = 'Google_Service_Calendar_EventAttachment'; + protected $attachmentsDataType = 'array'; + protected $attendeesType = 'Google_Service_Calendar_EventAttendee'; + protected $attendeesDataType = 'array'; + public $attendeesOmitted; + public $colorId; + public $created; + protected $creatorType = 'Google_Service_Calendar_EventCreator'; + protected $creatorDataType = ''; + public $description; + protected $endType = 'Google_Service_Calendar_EventDateTime'; + protected $endDataType = ''; + public $endTimeUnspecified; + public $etag; + protected $extendedPropertiesType = 'Google_Service_Calendar_EventExtendedProperties'; + protected $extendedPropertiesDataType = ''; + protected $gadgetType = 'Google_Service_Calendar_EventGadget'; + protected $gadgetDataType = ''; + public $guestsCanInviteOthers; + public $guestsCanModify; + public $guestsCanSeeOtherGuests; + public $hangoutLink; + public $htmlLink; + public $iCalUID; + public $id; + public $kind; + public $location; + public $locked; + protected $organizerType = 'Google_Service_Calendar_EventOrganizer'; + protected $organizerDataType = ''; + protected $originalStartTimeType = 'Google_Service_Calendar_EventDateTime'; + protected $originalStartTimeDataType = ''; + public $privateCopy; + public $recurrence; + public $recurringEventId; + protected $remindersType = 'Google_Service_Calendar_EventReminders'; + protected $remindersDataType = ''; + public $sequence; + protected $sourceType = 'Google_Service_Calendar_EventSource'; + protected $sourceDataType = ''; + protected $startType = 'Google_Service_Calendar_EventDateTime'; + protected $startDataType = ''; + public $status; + public $summary; + public $transparency; + public $updated; + public $visibility; + + + public function setAnyoneCanAddSelf($anyoneCanAddSelf) + { + $this->anyoneCanAddSelf = $anyoneCanAddSelf; + } + public function getAnyoneCanAddSelf() + { + return $this->anyoneCanAddSelf; + } + public function setAttachments($attachments) + { + $this->attachments = $attachments; + } + public function getAttachments() + { + return $this->attachments; + } + public function setAttendees($attendees) + { + $this->attendees = $attendees; + } + public function getAttendees() + { + return $this->attendees; + } + public function setAttendeesOmitted($attendeesOmitted) + { + $this->attendeesOmitted = $attendeesOmitted; + } + public function getAttendeesOmitted() + { + return $this->attendeesOmitted; + } + public function setColorId($colorId) + { + $this->colorId = $colorId; + } + public function getColorId() + { + return $this->colorId; + } + public function setCreated($created) + { + $this->created = $created; + } + public function getCreated() + { + return $this->created; + } + public function setCreator(Google_Service_Calendar_EventCreator $creator) + { + $this->creator = $creator; + } + public function getCreator() + { + return $this->creator; + } + public function setDescription($description) + { + $this->description = $description; + } + public function getDescription() + { + return $this->description; + } + public function setEnd(Google_Service_Calendar_EventDateTime $end) + { + $this->end = $end; + } + public function getEnd() + { + return $this->end; + } + public function setEndTimeUnspecified($endTimeUnspecified) + { + $this->endTimeUnspecified = $endTimeUnspecified; + } + public function getEndTimeUnspecified() + { + return $this->endTimeUnspecified; + } + public function setEtag($etag) + { + $this->etag = $etag; + } + public function getEtag() + { + return $this->etag; + } + public function setExtendedProperties(Google_Service_Calendar_EventExtendedProperties $extendedProperties) + { + $this->extendedProperties = $extendedProperties; + } + public function getExtendedProperties() + { + return $this->extendedProperties; + } + public function setGadget(Google_Service_Calendar_EventGadget $gadget) + { + $this->gadget = $gadget; + } + public function getGadget() + { + return $this->gadget; + } + public function setGuestsCanInviteOthers($guestsCanInviteOthers) + { + $this->guestsCanInviteOthers = $guestsCanInviteOthers; + } + public function getGuestsCanInviteOthers() + { + return $this->guestsCanInviteOthers; + } + public function setGuestsCanModify($guestsCanModify) + { + $this->guestsCanModify = $guestsCanModify; + } + public function getGuestsCanModify() + { + return $this->guestsCanModify; + } + public function setGuestsCanSeeOtherGuests($guestsCanSeeOtherGuests) + { + $this->guestsCanSeeOtherGuests = $guestsCanSeeOtherGuests; + } + public function getGuestsCanSeeOtherGuests() + { + return $this->guestsCanSeeOtherGuests; + } + public function setHangoutLink($hangoutLink) + { + $this->hangoutLink = $hangoutLink; + } + public function getHangoutLink() + { + return $this->hangoutLink; + } + public function setHtmlLink($htmlLink) + { + $this->htmlLink = $htmlLink; + } + public function getHtmlLink() + { + return $this->htmlLink; + } + public function setICalUID($iCalUID) + { + $this->iCalUID = $iCalUID; + } + public function getICalUID() + { + return $this->iCalUID; + } + public function setId($id) + { + $this->id = $id; + } + public function getId() + { + return $this->id; + } + public function setKind($kind) + { + $this->kind = $kind; + } + public function getKind() + { + return $this->kind; + } + public function setLocation($location) + { + $this->location = $location; + } + public function getLocation() + { + return $this->location; + } + public function setLocked($locked) + { + $this->locked = $locked; + } + public function getLocked() + { + return $this->locked; + } + public function setOrganizer(Google_Service_Calendar_EventOrganizer $organizer) + { + $this->organizer = $organizer; + } + public function getOrganizer() + { + return $this->organizer; + } + public function setOriginalStartTime(Google_Service_Calendar_EventDateTime $originalStartTime) + { + $this->originalStartTime = $originalStartTime; + } + public function getOriginalStartTime() + { + return $this->originalStartTime; + } + public function setPrivateCopy($privateCopy) + { + $this->privateCopy = $privateCopy; + } + public function getPrivateCopy() + { + return $this->privateCopy; + } + public function setRecurrence($recurrence) + { + $this->recurrence = $recurrence; + } + public function getRecurrence() + { + return $this->recurrence; + } + public function setRecurringEventId($recurringEventId) + { + $this->recurringEventId = $recurringEventId; + } + public function getRecurringEventId() + { + return $this->recurringEventId; + } + public function setReminders(Google_Service_Calendar_EventReminders $reminders) + { + $this->reminders = $reminders; + } + public function getReminders() + { + return $this->reminders; + } + public function setSequence($sequence) + { + $this->sequence = $sequence; + } + public function getSequence() + { + return $this->sequence; + } + public function setSource(Google_Service_Calendar_EventSource $source) + { + $this->source = $source; + } + public function getSource() + { + return $this->source; + } + public function setStart(Google_Service_Calendar_EventDateTime $start) + { + $this->start = $start; + } + public function getStart() + { + return $this->start; + } + public function setStatus($status) + { + $this->status = $status; + } + public function getStatus() + { + return $this->status; + } + public function setSummary($summary) + { + $this->summary = $summary; + } + public function getSummary() + { + return $this->summary; + } + public function setTransparency($transparency) + { + $this->transparency = $transparency; + } + public function getTransparency() + { + return $this->transparency; + } + public function setUpdated($updated) + { + $this->updated = $updated; + } + public function getUpdated() + { + return $this->updated; + } + public function setVisibility($visibility) + { + $this->visibility = $visibility; + } + public function getVisibility() + { + return $this->visibility; + } +} + +class Google_Service_Calendar_EventAttachment extends Google_Model +{ + protected $internal_gapi_mappings = array( + ); + public $fileId; + public $fileUrl; + public $iconLink; + public $mimeType; + public $title; + + + public function setFileId($fileId) + { + $this->fileId = $fileId; + } + public function getFileId() + { + return $this->fileId; + } + public function setFileUrl($fileUrl) + { + $this->fileUrl = $fileUrl; + } + public function getFileUrl() + { + return $this->fileUrl; + } + public function setIconLink($iconLink) + { + $this->iconLink = $iconLink; + } + public function getIconLink() + { + return $this->iconLink; + } + public function setMimeType($mimeType) + { + $this->mimeType = $mimeType; + } + public function getMimeType() + { + return $this->mimeType; + } + public function setTitle($title) + { + $this->title = $title; + } + public function getTitle() + { + return $this->title; + } +} + +class Google_Service_Calendar_EventAttendee extends Google_Model +{ + protected $internal_gapi_mappings = array( + ); + public $additionalGuests; + public $comment; + public $displayName; + public $email; + public $id; + public $optional; + public $organizer; + public $resource; + public $responseStatus; + public $self; + + + public function setAdditionalGuests($additionalGuests) + { + $this->additionalGuests = $additionalGuests; + } + public function getAdditionalGuests() + { + return $this->additionalGuests; + } + public function setComment($comment) + { + $this->comment = $comment; + } + public function getComment() + { + return $this->comment; + } + public function setDisplayName($displayName) + { + $this->displayName = $displayName; + } + public function getDisplayName() + { + return $this->displayName; + } + public function setEmail($email) + { + $this->email = $email; + } + public function getEmail() + { + return $this->email; + } + public function setId($id) + { + $this->id = $id; + } + public function getId() + { + return $this->id; + } + public function setOptional($optional) + { + $this->optional = $optional; + } + public function getOptional() + { + return $this->optional; + } + public function setOrganizer($organizer) + { + $this->organizer = $organizer; + } + public function getOrganizer() + { + return $this->organizer; + } + public function setResource($resource) + { + $this->resource = $resource; + } + public function getResource() + { + return $this->resource; + } + public function setResponseStatus($responseStatus) + { + $this->responseStatus = $responseStatus; + } + public function getResponseStatus() + { + return $this->responseStatus; + } + public function setSelf($self) + { + $this->self = $self; + } + public function getSelf() + { + return $this->self; + } +} + +class Google_Service_Calendar_EventCreator extends Google_Model +{ + protected $internal_gapi_mappings = array( + ); + public $displayName; + public $email; + public $id; + public $self; + + + public function setDisplayName($displayName) + { + $this->displayName = $displayName; + } + public function getDisplayName() + { + return $this->displayName; + } + public function setEmail($email) + { + $this->email = $email; + } + public function getEmail() + { + return $this->email; + } + public function setId($id) + { + $this->id = $id; + } + public function getId() + { + return $this->id; + } + public function setSelf($self) + { + $this->self = $self; + } + public function getSelf() + { + return $this->self; + } +} + +class Google_Service_Calendar_EventDateTime extends Google_Model +{ + protected $internal_gapi_mappings = array( + ); + public $date; + public $dateTime; + public $timeZone; + + + public function setDate($date) + { + $this->date = $date; + } + public function getDate() + { + return $this->date; + } + public function setDateTime($dateTime) + { + $this->dateTime = $dateTime; + } + public function getDateTime() + { + return $this->dateTime; + } + public function setTimeZone($timeZone) + { + $this->timeZone = $timeZone; + } + public function getTimeZone() + { + return $this->timeZone; + } +} + +class Google_Service_Calendar_EventExtendedProperties extends Google_Model +{ + protected $internal_gapi_mappings = array( + ); + public $private; + public $shared; + + + public function setPrivate($private) + { + $this->private = $private; + } + public function getPrivate() + { + return $this->private; + } + public function setShared($shared) + { + $this->shared = $shared; + } + public function getShared() + { + return $this->shared; + } +} + +class Google_Service_Calendar_EventGadget extends Google_Model +{ + protected $internal_gapi_mappings = array( + ); + public $display; + public $height; + public $iconLink; + public $link; + public $preferences; + public $title; + public $type; + public $width; + + + public function setDisplay($display) + { + $this->display = $display; + } + public function getDisplay() + { + return $this->display; + } + public function setHeight($height) + { + $this->height = $height; + } + public function getHeight() + { + return $this->height; + } + public function setIconLink($iconLink) + { + $this->iconLink = $iconLink; + } + public function getIconLink() + { + return $this->iconLink; + } + public function setLink($link) + { + $this->link = $link; + } + public function getLink() + { + return $this->link; + } + public function setPreferences($preferences) + { + $this->preferences = $preferences; + } + public function getPreferences() + { + return $this->preferences; + } + public function setTitle($title) + { + $this->title = $title; + } + public function getTitle() + { + return $this->title; + } + public function setType($type) + { + $this->type = $type; + } + public function getType() + { + return $this->type; + } + public function setWidth($width) + { + $this->width = $width; + } + public function getWidth() + { + return $this->width; + } +} + +class Google_Service_Calendar_EventOrganizer extends Google_Model +{ + protected $internal_gapi_mappings = array( + ); + public $displayName; + public $email; + public $id; + public $self; + + + public function setDisplayName($displayName) + { + $this->displayName = $displayName; + } + public function getDisplayName() + { + return $this->displayName; + } + public function setEmail($email) + { + $this->email = $email; + } + public function getEmail() + { + return $this->email; + } + public function setId($id) + { + $this->id = $id; + } + public function getId() + { + return $this->id; + } + public function setSelf($self) + { + $this->self = $self; + } + public function getSelf() + { + return $this->self; + } +} + +class Google_Service_Calendar_EventReminder extends Google_Model +{ + protected $internal_gapi_mappings = array( + ); + public $method; + public $minutes; + + + public function setMethod($method) + { + $this->method = $method; + } + public function getMethod() + { + return $this->method; + } + public function setMinutes($minutes) + { + $this->minutes = $minutes; + } + public function getMinutes() + { + return $this->minutes; + } +} + +class Google_Service_Calendar_EventReminders extends Google_Collection +{ + protected $collection_key = 'overrides'; + protected $internal_gapi_mappings = array( + ); + protected $overridesType = 'Google_Service_Calendar_EventReminder'; + protected $overridesDataType = 'array'; + public $useDefault; + + + public function setOverrides($overrides) + { + $this->overrides = $overrides; + } + public function getOverrides() + { + return $this->overrides; + } + public function setUseDefault($useDefault) + { + $this->useDefault = $useDefault; + } + public function getUseDefault() + { + return $this->useDefault; + } +} + +class Google_Service_Calendar_EventSource extends Google_Model +{ + protected $internal_gapi_mappings = array( + ); + public $title; + public $url; + + + public function setTitle($title) + { + $this->title = $title; + } + public function getTitle() + { + return $this->title; + } + public function setUrl($url) + { + $this->url = $url; + } + public function getUrl() + { + return $this->url; + } +} + +class Google_Service_Calendar_Events extends Google_Collection +{ + protected $collection_key = 'items'; + protected $internal_gapi_mappings = array( + ); + public $accessRole; + protected $defaultRemindersType = 'Google_Service_Calendar_EventReminder'; + protected $defaultRemindersDataType = 'array'; + public $description; + public $etag; + protected $itemsType = 'Google_Service_Calendar_Event'; + protected $itemsDataType = 'array'; + public $kind; + public $nextPageToken; + public $nextSyncToken; + public $summary; + public $timeZone; + public $updated; + + + public function setAccessRole($accessRole) + { + $this->accessRole = $accessRole; + } + public function getAccessRole() + { + return $this->accessRole; + } + public function setDefaultReminders($defaultReminders) + { + $this->defaultReminders = $defaultReminders; + } + public function getDefaultReminders() + { + return $this->defaultReminders; + } + public function setDescription($description) + { + $this->description = $description; + } + public function getDescription() + { + return $this->description; + } + public function setEtag($etag) + { + $this->etag = $etag; + } + public function getEtag() + { + return $this->etag; + } + public function setItems($items) + { + $this->items = $items; + } + public function getItems() + { + return $this->items; + } + public function setKind($kind) + { + $this->kind = $kind; + } + public function getKind() + { + return $this->kind; + } + public function setNextPageToken($nextPageToken) + { + $this->nextPageToken = $nextPageToken; + } + public function getNextPageToken() + { + return $this->nextPageToken; + } + public function setNextSyncToken($nextSyncToken) + { + $this->nextSyncToken = $nextSyncToken; + } + public function getNextSyncToken() + { + return $this->nextSyncToken; + } + public function setSummary($summary) + { + $this->summary = $summary; + } + public function getSummary() + { + return $this->summary; + } + public function setTimeZone($timeZone) + { + $this->timeZone = $timeZone; + } + public function getTimeZone() + { + return $this->timeZone; + } + public function setUpdated($updated) + { + $this->updated = $updated; + } + public function getUpdated() + { + return $this->updated; + } +} + +class Google_Service_Calendar_FreeBusyCalendar extends Google_Collection +{ + protected $collection_key = 'errors'; + protected $internal_gapi_mappings = array( + ); + protected $busyType = 'Google_Service_Calendar_TimePeriod'; + protected $busyDataType = 'array'; + protected $errorsType = 'Google_Service_Calendar_Error'; + protected $errorsDataType = 'array'; + + + public function setBusy($busy) + { + $this->busy = $busy; + } + public function getBusy() + { + return $this->busy; + } + public function setErrors($errors) + { + $this->errors = $errors; + } + public function getErrors() + { + return $this->errors; + } +} + +class Google_Service_Calendar_FreeBusyGroup extends Google_Collection +{ + protected $collection_key = 'errors'; + protected $internal_gapi_mappings = array( + ); + public $calendars; + protected $errorsType = 'Google_Service_Calendar_Error'; + protected $errorsDataType = 'array'; + + + public function setCalendars($calendars) + { + $this->calendars = $calendars; + } + public function getCalendars() + { + return $this->calendars; + } + public function setErrors($errors) + { + $this->errors = $errors; + } + public function getErrors() + { + return $this->errors; + } +} + +class Google_Service_Calendar_FreeBusyRequest extends Google_Collection +{ + protected $collection_key = 'items'; + protected $internal_gapi_mappings = array( + ); + public $calendarExpansionMax; + public $groupExpansionMax; + protected $itemsType = 'Google_Service_Calendar_FreeBusyRequestItem'; + protected $itemsDataType = 'array'; + public $timeMax; + public $timeMin; + public $timeZone; + + + public function setCalendarExpansionMax($calendarExpansionMax) + { + $this->calendarExpansionMax = $calendarExpansionMax; + } + public function getCalendarExpansionMax() + { + return $this->calendarExpansionMax; + } + public function setGroupExpansionMax($groupExpansionMax) + { + $this->groupExpansionMax = $groupExpansionMax; + } + public function getGroupExpansionMax() + { + return $this->groupExpansionMax; + } + public function setItems($items) + { + $this->items = $items; + } + public function getItems() + { + return $this->items; + } + public function setTimeMax($timeMax) + { + $this->timeMax = $timeMax; + } + public function getTimeMax() + { + return $this->timeMax; + } + public function setTimeMin($timeMin) + { + $this->timeMin = $timeMin; + } + public function getTimeMin() + { + return $this->timeMin; + } + public function setTimeZone($timeZone) + { + $this->timeZone = $timeZone; + } + public function getTimeZone() + { + return $this->timeZone; + } +} + +class Google_Service_Calendar_FreeBusyRequestItem extends Google_Model +{ + protected $internal_gapi_mappings = array( + ); + public $id; + + + public function setId($id) + { + $this->id = $id; + } + public function getId() + { + return $this->id; + } +} + +class Google_Service_Calendar_FreeBusyResponse extends Google_Model +{ + protected $internal_gapi_mappings = array( + ); + protected $calendarsType = 'Google_Service_Calendar_FreeBusyCalendar'; + protected $calendarsDataType = 'map'; + protected $groupsType = 'Google_Service_Calendar_FreeBusyGroup'; + protected $groupsDataType = 'map'; + public $kind; + public $timeMax; + public $timeMin; + + + public function setCalendars($calendars) + { + $this->calendars = $calendars; + } + public function getCalendars() + { + return $this->calendars; + } + public function setGroups($groups) + { + $this->groups = $groups; + } + public function getGroups() + { + return $this->groups; + } + public function setKind($kind) + { + $this->kind = $kind; + } + public function getKind() + { + return $this->kind; + } + public function setTimeMax($timeMax) + { + $this->timeMax = $timeMax; + } + public function getTimeMax() + { + return $this->timeMax; + } + public function setTimeMin($timeMin) + { + $this->timeMin = $timeMin; + } + public function getTimeMin() + { + return $this->timeMin; + } +} + +class Google_Service_Calendar_Setting extends Google_Model +{ + protected $internal_gapi_mappings = array( + ); + public $etag; + public $id; + public $kind; + public $value; + + + public function setEtag($etag) + { + $this->etag = $etag; + } + public function getEtag() + { + return $this->etag; + } + public function setId($id) + { + $this->id = $id; + } + public function getId() + { + return $this->id; + } + public function setKind($kind) + { + $this->kind = $kind; + } + public function getKind() + { + return $this->kind; + } + public function setValue($value) + { + $this->value = $value; + } + public function getValue() + { + return $this->value; + } +} + +class Google_Service_Calendar_Settings extends Google_Collection +{ + protected $collection_key = 'items'; + protected $internal_gapi_mappings = array( + ); + public $etag; + protected $itemsType = 'Google_Service_Calendar_Setting'; + protected $itemsDataType = 'array'; + public $kind; + public $nextPageToken; + public $nextSyncToken; + + + public function setEtag($etag) + { + $this->etag = $etag; + } + public function getEtag() + { + return $this->etag; + } + public function setItems($items) + { + $this->items = $items; + } + public function getItems() + { + return $this->items; + } + public function setKind($kind) + { + $this->kind = $kind; + } + public function getKind() + { + return $this->kind; + } + public function setNextPageToken($nextPageToken) + { + $this->nextPageToken = $nextPageToken; + } + public function getNextPageToken() + { + return $this->nextPageToken; + } + public function setNextSyncToken($nextSyncToken) + { + $this->nextSyncToken = $nextSyncToken; + } + public function getNextSyncToken() + { + return $this->nextSyncToken; + } +} + +class Google_Service_Calendar_TimePeriod extends Google_Model +{ + protected $internal_gapi_mappings = array( + ); + public $end; + public $start; + + + public function setEnd($end) + { + $this->end = $end; + } + public function getEnd() + { + return $this->end; + } + public function setStart($start) + { + $this->start = $start; + } + public function getStart() + { + return $this->start; + } +} diff --git a/app/api/Google/Service/Exception.php b/app/api/Google/Service/Exception.php new file mode 100755 index 0000000..7bf8937 --- /dev/null +++ b/app/api/Google/Service/Exception.php @@ -0,0 +1,105 @@ += 0) { + parent::__construct($message, $code, $previous); + } else { + parent::__construct($message, $code); + } + + $this->errors = $errors; + + if (is_array($retryMap)) { + $this->retryMap = $retryMap; + } + } + + /** + * An example of the possible errors returned. + * + * { + * "domain": "global", + * "reason": "authError", + * "message": "Invalid Credentials", + * "locationType": "header", + * "location": "Authorization", + * } + * + * @return [{string, string}] List of errors return in an HTTP response or []. + */ + public function getErrors() + { + return $this->errors; + } + + /** + * Gets the number of times the associated task can be retried. + * + * NOTE: -1 is returned if the task can be retried indefinitely + * + * @return integer + */ + public function allowedRetries() + { + if (isset($this->retryMap[$this->code])) { + return $this->retryMap[$this->code]; + } + + $errors = $this->getErrors(); + + if (!empty($errors) && isset($errors[0]['reason']) && + isset($this->retryMap[$errors[0]['reason']])) { + return $this->retryMap[$errors[0]['reason']]; + } + + return 0; + } +} diff --git a/app/api/Google/Service/Resource.php b/app/api/Google/Service/Resource.php new file mode 100755 index 0000000..e8d3214 --- /dev/null +++ b/app/api/Google/Service/Resource.php @@ -0,0 +1,255 @@ + array('type' => 'string', 'location' => 'query'), + 'fields' => array('type' => 'string', 'location' => 'query'), + 'trace' => array('type' => 'string', 'location' => 'query'), + 'userIp' => array('type' => 'string', 'location' => 'query'), + 'quotaUser' => array('type' => 'string', 'location' => 'query'), + 'data' => array('type' => 'string', 'location' => 'body'), + 'mimeType' => array('type' => 'string', 'location' => 'header'), + 'uploadType' => array('type' => 'string', 'location' => 'query'), + 'mediaUpload' => array('type' => 'complex', 'location' => 'query'), + 'prettyPrint' => array('type' => 'string', 'location' => 'query'), + ); + + /** @var string $rootUrl */ + private $rootUrl; + + /** @var Google_Client $client */ + private $client; + + /** @var string $serviceName */ + private $serviceName; + + /** @var string $servicePath */ + private $servicePath; + + /** @var string $resourceName */ + private $resourceName; + + /** @var array $methods */ + private $methods; + + public function __construct($service, $serviceName, $resourceName, $resource) + { + $this->rootUrl = $service->rootUrl; + $this->client = $service->getClient(); + $this->servicePath = $service->servicePath; + $this->serviceName = $serviceName; + $this->resourceName = $resourceName; + $this->methods = is_array($resource) && isset($resource['methods']) ? + $resource['methods'] : + array($resourceName => $resource); + } + + /** + * TODO: This function needs simplifying. + * @param $name + * @param $arguments + * @param $expected_class - optional, the expected class name + * @return Google_Http_Request|expected_class + * @throws Google_Exception + */ + public function call($name, $arguments, $expected_class = null) + { + if (! isset($this->methods[$name])) { + $this->client->getLogger()->error( + 'Service method unknown', + array( + 'service' => $this->serviceName, + 'resource' => $this->resourceName, + 'method' => $name + ) + ); + + throw new Google_Exception( + "Unknown function: " . + "{$this->serviceName}->{$this->resourceName}->{$name}()" + ); + } + $method = $this->methods[$name]; + $parameters = $arguments[0]; + + // postBody is a special case since it's not defined in the discovery + // document as parameter, but we abuse the param entry for storing it. + $postBody = null; + if (isset($parameters['postBody'])) { + if ($parameters['postBody'] instanceof Google_Model) { + // In the cases the post body is an existing object, we want + // to use the smart method to create a simple object for + // for JSONification. + $parameters['postBody'] = $parameters['postBody']->toSimpleObject(); + } else if (is_object($parameters['postBody'])) { + // If the post body is another kind of object, we will try and + // wrangle it into a sensible format. + $parameters['postBody'] = + $this->convertToArrayAndStripNulls($parameters['postBody']); + } + $postBody = json_encode($parameters['postBody']); + if ($postBody === false && $parameters['postBody'] !== false) { + throw new Google_Exception("JSON encoding failed. Ensure all strings in the request are UTF-8 encoded."); + } + unset($parameters['postBody']); + } + + // TODO: optParams here probably should have been + // handled already - this may well be redundant code. + if (isset($parameters['optParams'])) { + $optParams = $parameters['optParams']; + unset($parameters['optParams']); + $parameters = array_merge($parameters, $optParams); + } + + if (!isset($method['parameters'])) { + $method['parameters'] = []; + } + + $method['parameters'] = array_merge( + $this->stackParameters, + $method['parameters'] + ); + foreach ($parameters as $key => $val) { + if ($key != 'postBody' && ! isset($method['parameters'][$key])) { + $this->client->getLogger()->error( + 'Service parameter unknown', + array( + 'service' => $this->serviceName, + 'resource' => $this->resourceName, + 'method' => $name, + 'parameter' => $key + ) + ); + throw new Google_Exception("($name) unknown parameter: '$key'"); + } + } + + foreach ($method['parameters'] as $paramName => $paramSpec) { + if (isset($paramSpec['required']) && + $paramSpec['required'] && + ! isset($parameters[$paramName]) + ) { + $this->client->getLogger()->error( + 'Service parameter missing', + array( + 'service' => $this->serviceName, + 'resource' => $this->resourceName, + 'method' => $name, + 'parameter' => $paramName + ) + ); + throw new Google_Exception("($name) missing required param: '$paramName'"); + } + if (isset($parameters[$paramName])) { + $value = $parameters[$paramName]; + $parameters[$paramName] = $paramSpec; + $parameters[$paramName]['value'] = $value; + unset($parameters[$paramName]['required']); + } else { + // Ensure we don't pass nulls. + unset($parameters[$paramName]); + } + } + + $this->client->getLogger()->info( + 'Service Call', + array( + 'service' => $this->serviceName, + 'resource' => $this->resourceName, + 'method' => $name, + 'arguments' => $parameters, + ) + ); + + $url = Google_Http_REST::createRequestUri( + $this->servicePath, + $method['path'], + $parameters + ); + $httpRequest = new Google_Http_Request( + $url, + $method['httpMethod'], + null, + $postBody + ); + + if ($this->rootUrl) { + $httpRequest->setBaseComponent($this->rootUrl); + } else { + $httpRequest->setBaseComponent($this->client->getBasePath()); + } + + if ($postBody) { + $contentTypeHeader = []; + $contentTypeHeader['content-type'] = 'application/json; charset=UTF-8'; + $httpRequest->setRequestHeaders($contentTypeHeader); + $httpRequest->setPostBody($postBody); + } + + $httpRequest = $this->client->getAuth()->sign($httpRequest); + $httpRequest->setExpectedClass($expected_class); + + if (isset($parameters['data']) && + ($parameters['uploadType']['value'] == 'media' || $parameters['uploadType']['value'] == 'multipart')) { + // If we are doing a simple media upload, trigger that as a convenience. + $mfu = new Google_Http_MediaFileUpload( + $this->client, + $httpRequest, + isset($parameters['mimeType']) ? $parameters['mimeType']['value'] : 'application/octet-stream', + $parameters['data']['value'] + ); + } + + if (isset($parameters['alt']) && $parameters['alt']['value'] == 'media') { + $httpRequest->enableExpectedRaw(); + } + + if ($this->client->shouldDefer()) { + // If we are in batch or upload mode, return the raw request. + return $httpRequest; + } + + return $this->client->execute($httpRequest); + } + + protected function convertToArrayAndStripNulls($o) + { + $o = (array) $o; + foreach ($o as $k => $v) { + if ($v === null) { + unset($o[$k]); + } elseif (is_object($v) || is_array($v)) { + $o[$k] = $this->convertToArrayAndStripNulls($o[$k]); + } + } + return $o; + } +} diff --git a/app/api/Google/Signer/Abstract.php b/app/api/Google/Signer/Abstract.php new file mode 100755 index 0000000..1b5676d --- /dev/null +++ b/app/api/Google/Signer/Abstract.php @@ -0,0 +1,29 @@ + + */ +abstract class Google_Signer_Abstract +{ + /** + * Signs data, returns the signature as binary data. + */ + abstract public function sign($data); +} diff --git a/app/api/Google/Signer/P12.php b/app/api/Google/Signer/P12.php new file mode 100755 index 0000000..17592c5 --- /dev/null +++ b/app/api/Google/Signer/P12.php @@ -0,0 +1,94 @@ + + */ +class Google_Signer_P12 extends Google_Signer_Abstract +{ + // OpenSSL private key resource + private $privateKey; + + // Creates a new signer from a .p12 file. + public function __construct($p12, $password) + { + if (!function_exists('openssl_x509_read')) { + throw new Google_Exception( + 'The Google PHP API library needs the openssl PHP extension' + ); + } + + // If the private key is provided directly, then this isn't in the p12 + // format. Different versions of openssl support different p12 formats + // and the key from google wasn't being accepted by the version available + // at the time. + if (!$password && strpos($p12, "-----BEGIN RSA PRIVATE KEY-----") !== false) { + $this->privateKey = openssl_pkey_get_private($p12); + } elseif ($password === 'notasecret' && strpos($p12, "-----BEGIN PRIVATE KEY-----") !== false) { + $this->privateKey = openssl_pkey_get_private($p12); + } else { + // This throws on error + $certs = []; + if (!openssl_pkcs12_read($p12, $certs, $password)) { + throw new Google_Auth_Exception( + "Unable to parse the p12 file. " . + "Is this a .p12 file? Is the password correct? OpenSSL error: " . + openssl_error_string() + ); + } + // TODO(beaton): is this part of the contract for the openssl_pkcs12_read + // method? What happens if there are multiple private keys? Do we care? + if (!array_key_exists("pkey", $certs) || !$certs["pkey"]) { + throw new Google_Auth_Exception("No private key found in p12 file."); + } + $this->privateKey = openssl_pkey_get_private($certs['pkey']); + } + + if (!$this->privateKey) { + throw new Google_Auth_Exception("Unable to load private key"); + } + } + + public function __destruct() + { + if ($this->privateKey) { + openssl_pkey_free($this->privateKey); + } + } + + public function sign($data) + { + if (version_compare(PHP_VERSION, '5.3.0') < 0) { + throw new Google_Auth_Exception( + "PHP 5.3.0 or higher is required to use service accounts." + ); + } + $hash = defined("OPENSSL_ALGO_SHA256") ? OPENSSL_ALGO_SHA256 : "sha256"; + if (!openssl_sign($data, $signature, $this->privateKey, $hash)) { + throw new Google_Auth_Exception("Unable to sign data"); + } + return $signature; + } +} diff --git a/app/api/Google/Task/Exception.php b/app/api/Google/Task/Exception.php new file mode 100755 index 0000000..4c2ca79 --- /dev/null +++ b/app/api/Google/Task/Exception.php @@ -0,0 +1,24 @@ +getClassConfig('Google_Task_Runner'); + + if (isset($config['initial_delay'])) { + if ($config['initial_delay'] < 0) { + throw new Google_Task_Exception( + 'Task configuration `initial_delay` must not be negative.' + ); + } + + $this->delay = $config['initial_delay']; + } + + if (isset($config['max_delay'])) { + if ($config['max_delay'] <= 0) { + throw new Google_Task_Exception( + 'Task configuration `max_delay` must be greater than 0.' + ); + } + + $this->maxDelay = $config['max_delay']; + } + + if (isset($config['factor'])) { + if ($config['factor'] <= 0) { + throw new Google_Task_Exception( + 'Task configuration `factor` must be greater than 0.' + ); + } + + $this->factor = $config['factor']; + } + + if (isset($config['jitter'])) { + if ($config['jitter'] <= 0) { + throw new Google_Task_Exception( + 'Task configuration `jitter` must be greater than 0.' + ); + } + + $this->jitter = $config['jitter']; + } + + if (isset($config['retries'])) { + if ($config['retries'] < 0) { + throw new Google_Task_Exception( + 'Task configuration `retries` must not be negative.' + ); + } + $this->maxAttempts += $config['retries']; + } + + if (!is_callable($action)) { + throw new Google_Task_Exception( + 'Task argument `$action` must be a valid callable.' + ); + } + + $this->name = $name; + $this->client = $client; + $this->action = $action; + $this->arguments = $arguments; + } + + /** + * Checks if a retry can be attempted. + * + * @return boolean + */ + public function canAttmpt() + { + return $this->attempts < $this->maxAttempts; + } + + /** + * Runs the task and (if applicable) automatically retries when errors occur. + * + * @return mixed + * @throws Google_Task_Retryable on failure when no retries are available. + */ + public function run() + { + while ($this->attempt()) { + try { + return call_user_func_array($this->action, $this->arguments); + } catch (Google_Task_Retryable $exception) { + $allowedRetries = $exception->allowedRetries(); + + if (!$this->canAttmpt() || !$allowedRetries) { + throw $exception; + } + + if ($allowedRetries > 0) { + $this->maxAttempts = min( + $this->maxAttempts, + $this->attempts + $allowedRetries + ); + } + } + } + } + + /** + * Runs a task once, if possible. This is useful for bypassing the `run()` + * loop. + * + * NOTE: If this is not the first attempt, this function will sleep in + * accordance to the backoff configurations before running the task. + * + * @return boolean + */ + public function attempt() + { + if (!$this->canAttmpt()) { + return false; + } + + if ($this->attempts > 0) { + $this->backOff(); + } + + $this->attempts++; + return true; + } + + /** + * Sleeps in accordance to the backoff configurations. + */ + private function backOff() + { + $delay = $this->getDelay(); + + $this->client->getLogger()->debug( + 'Retrying task with backoff', + array( + 'request' => $this->name, + 'retry' => $this->attempts, + 'backoff_seconds' => $delay + ) + ); + + usleep($delay * 1000000); + } + + /** + * Gets the delay (in seconds) for the current backoff period. + * + * @return float + */ + private function getDelay() + { + $jitter = $this->getJitter(); + $factor = $this->attempts > 1 ? $this->factor + $jitter : 1 + abs($jitter); + + return $this->delay = min($this->maxDelay, $this->delay * $factor); + } + + /** + * Gets the current jitter (random number between -$this->jitter and + * $this->jitter). + * + * @return float + */ + private function getJitter() + { + return $this->jitter * 2 * mt_rand() / mt_getrandmax() - $this->jitter; + } +} diff --git a/app/api/Google/Utils.php b/app/api/Google/Utils.php new file mode 100755 index 0000000..74fb84a --- /dev/null +++ b/app/api/Google/Utils.php @@ -0,0 +1,133 @@ += 0x20) && ($ordinalValue <= 0x7F)): + // characters U-00000000 - U-0000007F (same as ASCII) + $ret ++; + break; + case (($ordinalValue & 0xE0) == 0xC0): + // characters U-00000080 - U-000007FF, mask 110XXXXX + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + $ret += 2; + break; + case (($ordinalValue & 0xF0) == 0xE0): + // characters U-00000800 - U-0000FFFF, mask 1110XXXX + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + $ret += 3; + break; + case (($ordinalValue & 0xF8) == 0xF0): + // characters U-00010000 - U-001FFFFF, mask 11110XXX + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + $ret += 4; + break; + case (($ordinalValue & 0xFC) == 0xF8): + // characters U-00200000 - U-03FFFFFF, mask 111110XX + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + $ret += 5; + break; + case (($ordinalValue & 0xFE) == 0xFC): + // characters U-04000000 - U-7FFFFFFF, mask 1111110X + // see http://www.cl.cam.ac.uk/~mgk25/unicode.html#utf-8 + $ret += 6; + break; + default: + $ret ++; + } + } + return $ret; + } + + /** + * Normalize all keys in an array to lower-case. + * @param array $arr + * @return array Normalized array. + */ + public static function normalize($arr) + { + if (!is_array($arr)) { + return []; + } + + $normalized = []; + foreach ($arr as $key => $val) { + $normalized[strtolower($key)] = $val; + } + return $normalized; + } + + /** + * Convert a string to camelCase + * @param string $value + * @return string + */ + public static function camelCase($value) + { + $value = ucwords(str_replace(array('-', '_'), ' ', $value)); + $value = str_replace(' ', '', $value); + $value[0] = strtolower($value[0]); + return $value; + } +} diff --git a/app/api/Google/Utils/URITemplate.php b/app/api/Google/Utils/URITemplate.php new file mode 100755 index 0000000..ab30ce7 --- /dev/null +++ b/app/api/Google/Utils/URITemplate.php @@ -0,0 +1,333 @@ + "reserved", + "/" => "segments", + "." => "dotprefix", + "#" => "fragment", + ";" => "semicolon", + "?" => "form", + "&" => "continuation" + ); + + /** + * @var reserved array + * These are the characters which should not be URL encoded in reserved + * strings. + */ + private $reserved = array( + "=", ",", "!", "@", "|", ":", "/", "?", "#", + "[", "]",'$', "&", "'", "(", ")", "*", "+", ";" + ); + private $reservedEncoded = array( + "%3D", "%2C", "%21", "%40", "%7C", "%3A", "%2F", "%3F", + "%23", "%5B", "%5D", "%24", "%26", "%27", "%28", "%29", + "%2A", "%2B", "%3B" + ); + + public function parse($string, array $parameters) + { + return $this->resolveNextSection($string, $parameters); + } + + /** + * This function finds the first matching {...} block and + * executes the replacement. It then calls itself to find + * subsequent blocks, if any. + */ + private function resolveNextSection($string, $parameters) + { + $start = strpos($string, "{"); + if ($start === false) { + return $string; + } + $end = strpos($string, "}"); + if ($end === false) { + return $string; + } + $string = $this->replace($string, $start, $end, $parameters); + return $this->resolveNextSection($string, $parameters); + } + + private function replace($string, $start, $end, $parameters) + { + // We know a data block will have {} round it, so we can strip that. + $data = substr($string, $start + 1, $end - $start - 1); + + // If the first character is one of the reserved operators, it effects + // the processing of the stream. + if (isset($this->operators[$data[0]])) { + $op = $this->operators[$data[0]]; + $data = substr($data, 1); + $prefix = ""; + $prefix_on_missing = false; + + switch ($op) { + case "reserved": + // Reserved means certain characters should not be URL encoded + $data = $this->replaceVars($data, $parameters, ",", null, true); + break; + case "fragment": + // Comma separated with fragment prefix. Bare values only. + $prefix = "#"; + $prefix_on_missing = true; + $data = $this->replaceVars($data, $parameters, ",", null, true); + break; + case "segments": + // Slash separated data. Bare values only. + $prefix = "/"; + $data =$this->replaceVars($data, $parameters, "/"); + break; + case "dotprefix": + // Dot separated data. Bare values only. + $prefix = "."; + $prefix_on_missing = true; + $data = $this->replaceVars($data, $parameters, "."); + break; + case "semicolon": + // Semicolon prefixed and separated. Uses the key name + $prefix = ";"; + $data = $this->replaceVars($data, $parameters, ";", "=", false, true, false); + break; + case "form": + // Standard URL format. Uses the key name + $prefix = "?"; + $data = $this->replaceVars($data, $parameters, "&", "="); + break; + case "continuation": + // Standard URL, but with leading ampersand. Uses key name. + $prefix = "&"; + $data = $this->replaceVars($data, $parameters, "&", "="); + break; + } + + // Add the initial prefix character if data is valid. + if ($data || ($data !== false && $prefix_on_missing)) { + $data = $prefix . $data; + } + + } else { + // If no operator we replace with the defaults. + $data = $this->replaceVars($data, $parameters); + } + // This is chops out the {...} and replaces with the new section. + return substr($string, 0, $start) . $data . substr($string, $end + 1); + } + + private function replaceVars( + $section, + $parameters, + $sep = ",", + $combine = null, + $reserved = false, + $tag_empty = false, + $combine_on_empty = true + ) { + if (strpos($section, ",") === false) { + // If we only have a single value, we can immediately process. + return $this->combine( + $section, + $parameters, + $sep, + $combine, + $reserved, + $tag_empty, + $combine_on_empty + ); + } else { + // If we have multiple values, we need to split and loop over them. + // Each is treated individually, then glued together with the + // separator character. + $vars = explode(",", $section); + return $this->combineList( + $vars, + $sep, + $parameters, + $combine, + $reserved, + false, // Never emit empty strings in multi-param replacements + $combine_on_empty + ); + } + } + + public function combine( + $key, + $parameters, + $sep, + $combine, + $reserved, + $tag_empty, + $combine_on_empty + ) { + $length = false; + $explode = false; + $skip_final_combine = false; + $value = false; + + // Check for length restriction. + if (strpos($key, ":") !== false) { + list($key, $length) = explode(":", $key); + } + + // Check for explode parameter. + if ($key[strlen($key) - 1] == "*") { + $explode = true; + $key = substr($key, 0, -1); + $skip_final_combine = true; + } + + // Define the list separator. + $list_sep = $explode ? $sep : ","; + + if (isset($parameters[$key])) { + $data_type = $this->getDataType($parameters[$key]); + switch ($data_type) { + case self::TYPE_SCALAR: + $value = $this->getValue($parameters[$key], $length); + break; + case self::TYPE_LIST: + $values = []; + foreach ($parameters[$key] as $pkey => $pvalue) { + $pvalue = $this->getValue($pvalue, $length); + if ($combine && $explode) { + $values[$pkey] = $key . $combine . $pvalue; + } else { + $values[$pkey] = $pvalue; + } + } + $value = implode($list_sep, $values); + if ($value == '') { + return ''; + } + break; + case self::TYPE_MAP: + $values = []; + foreach ($parameters[$key] as $pkey => $pvalue) { + $pvalue = $this->getValue($pvalue, $length); + if ($explode) { + $pkey = $this->getValue($pkey, $length); + $values[] = $pkey . "=" . $pvalue; // Explode triggers = combine. + } else { + $values[] = $pkey; + $values[] = $pvalue; + } + } + $value = implode($list_sep, $values); + if ($value == '') { + return false; + } + break; + } + } else if ($tag_empty) { + // If we are just indicating empty values with their key name, return that. + return $key; + } else { + // Otherwise we can skip this variable due to not being defined. + return false; + } + + if ($reserved) { + $value = str_replace($this->reservedEncoded, $this->reserved, $value); + } + + // If we do not need to include the key name, we just return the raw + // value. + if (!$combine || $skip_final_combine) { + return $value; + } + + // Else we combine the key name: foo=bar, if value is not the empty string. + return $key . ($value != '' || $combine_on_empty ? $combine . $value : ''); + } + + /** + * Return the type of a passed in value + */ + private function getDataType($data) + { + if (is_array($data)) { + reset($data); + if (key($data) !== 0) { + return self::TYPE_MAP; + } + return self::TYPE_LIST; + } + return self::TYPE_SCALAR; + } + + /** + * Utility function that merges multiple combine calls + * for multi-key templates. + */ + private function combineList( + $vars, + $sep, + $parameters, + $combine, + $reserved, + $tag_empty, + $combine_on_empty + ) { + $ret = []; + foreach ($vars as $var) { + $response = $this->combine( + $var, + $parameters, + $sep, + $combine, + $reserved, + $tag_empty, + $combine_on_empty + ); + if ($response === false) { + continue; + } + $ret[] = $response; + } + return implode($sep, $ret); + } + + /** + * Utility function to encode and trim values + */ + private function getValue($value, $length) + { + if ($length) { + $value = substr($value, 0, $length); + } + $value = rawurlencode($value); + return $value; + } +} diff --git a/app/api/Google/Verifier/Abstract.php b/app/api/Google/Verifier/Abstract.php new file mode 100755 index 0000000..a70e713 --- /dev/null +++ b/app/api/Google/Verifier/Abstract.php @@ -0,0 +1,30 @@ + + */ +abstract class Google_Verifier_Abstract +{ + /** + * Checks a signature, returns true if the signature is correct, + * false otherwise. + */ + abstract public function verify($data, $signature); +} diff --git a/app/api/Google/Verifier/Pem.php b/app/api/Google/Verifier/Pem.php new file mode 100755 index 0000000..e0dd922 --- /dev/null +++ b/app/api/Google/Verifier/Pem.php @@ -0,0 +1,75 @@ + + */ +class Google_Verifier_Pem extends Google_Verifier_Abstract +{ + private $publicKey; + + /** + * Constructs a verifier from the supplied PEM-encoded certificate. + * + * $pem: a PEM encoded certificate (not a file). + * @param $pem + * @throws Google_Auth_Exception + * @throws Google_Exception + */ + public function __construct($pem) + { + if (!function_exists('openssl_x509_read')) { + throw new Google_Exception('Google API PHP client needs the openssl PHP extension'); + } + $this->publicKey = openssl_x509_read($pem); + if (!$this->publicKey) { + throw new Google_Auth_Exception("Unable to parse PEM: $pem"); + } + } + + public function __destruct() + { + if ($this->publicKey) { + openssl_x509_free($this->publicKey); + } + } + + /** + * Verifies the signature on data. + * + * Returns true if the signature is valid, false otherwise. + * @param $data + * @param $signature + * @throws Google_Auth_Exception + * @return bool + */ + public function verify($data, $signature) + { + $hash = defined("OPENSSL_ALGO_SHA256") ? OPENSSL_ALGO_SHA256 : "sha256"; + $status = openssl_verify($data, $signature, $this->publicKey, $hash); + if ($status === -1) { + throw new Google_Auth_Exception('Signature verification error: ' . openssl_error_string()); + } + return $status === 1; + } +} diff --git a/app/api/Google/autoload.php b/app/api/Google/autoload.php new file mode 100755 index 0000000..b641bfa --- /dev/null +++ b/app/api/Google/autoload.php @@ -0,0 +1,37 @@ + 'true', + ); + + public function __construct(array $parameters = array()) { + $this->_parameters = array_merge($this->_parameters, $parameters); + } + + public function getEvents(array $parameters = array()) { + return $this->get('/:urlname/events', $parameters); + } + + public function getEvent(array $parameters = array()) { + return $this->get('/:urlname/events/:id', $parameters); + } + + public function getPhotos(array $parameters = array()) { + return $this->get('/2/photos', $parameters)->results; + } + + public function getDiscussionBoards(array $parameters = array()) { + return $this->get('/:urlname/boards', $parameters); + } + + public function getDiscussions(array $parameters = array()) { + return $this->get('/:urlname/boards/:bid/discussions', $parameters); + } + + public function getMembers(array $parameters = array()) { + return $this->get('/2/members', $parameters); + } + + public function getNext($response) { + if (!isset($response) || !isset($response->meta->next)) + { + throw new Exception("Invalid response object."); + } + return $this->get_url($response->meta->next); + } + + public function get($path, array $parameters = array()) { + $parameters = array_merge($this->_parameters, $parameters); + + if (preg_match_all('/:([a-z]+)/', $path, $matches)) { + + foreach ($matches[0] as $i => $match) { + + if (isset($parameters[$matches[1][$i]])) { + $path = str_replace($match, $parameters[$matches[1][$i]], $path); + unset($parameters[$matches[1][$i]]); + } else { + throw new Exception("Missing parameter '" . $matches[1][$i] . "' for path '" . $path . "'."); + } + } + } + + $url = self::BASE . $path . '?' . http_build_query($parameters); + + return $this->get_url($url); + } + + protected function get_url($url) { + + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, $url); + curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept-Charset: utf-8")); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); + + $content = curl_exec($ch); + + if (curl_errno($ch)) { + $error = curl_error($ch); + curl_close($ch); + + throw new Exception("Failed retrieving '" . $url . "' because of ' " . $error . "'."); + } + + $response = json_decode($content); + $status = curl_getinfo($ch, CURLINFO_HTTP_CODE); + + curl_close($ch); + + if ($status != 200) { + + if (isset($response->errors[0]->message)) { + $error = $response->errors[0]->message; + } else { + $error = 'Status ' . $status; + } + + throw new Exception("Failed retrieving '" . $url . "' because of ' " . $error . "'."); + } + + if (isset($response) == false) { + + switch (json_last_error()) { + case JSON_ERROR_NONE: + $error = 'No errors'; + break; + case JSON_ERROR_DEPTH: + $error = 'Maximum stack depth exceeded'; + break; + case JSON_ERROR_STATE_MISMATCH: + $error = ' Underflow or the modes mismatch'; + break; + case JSON_ERROR_CTRL_CHAR: + $error = 'Unexpected control character found'; + break; + case JSON_ERROR_SYNTAX: + $error = 'Syntax error, malformed JSON'; + break; + case JSON_ERROR_UTF8: + $error = 'Malformed UTF-8 characters, possibly incorrectly encoded'; + break; + default: + $error = 'Unknown error'; + break; + } + + throw new Exception("Cannot read response by '" . $url . "' because of: '" . $error . "'."); + } + + return $response; + } +} + diff --git a/app/api/Stripe/Account.php b/app/api/Stripe/Account.php new file mode 100755 index 0000000..65de047 --- /dev/null +++ b/app/api/Stripe/Account.php @@ -0,0 +1,431 @@ +create and manage Express or + * Custom accounts. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|\Stripe\StripeObject $business_profile Business information about the account. + * @property null|string $business_type The business type. + * @property \Stripe\StripeObject $capabilities + * @property bool $charges_enabled Whether the account can create live charges. + * @property \Stripe\StripeObject $company + * @property string $country The account's country. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $default_currency Three-letter ISO currency code representing the default currency for the account. This must be a currency that Stripe supports in the account's country. + * @property bool $details_submitted Whether account details have been submitted. Standard accounts cannot receive payouts before this is true. + * @property null|string $email The primary user's email address. + * @property \Stripe\Collection $external_accounts External accounts (bank accounts and debit cards) currently attached to this account + * @property \Stripe\Person $individual

This is an object representing a person associated with a Stripe account.

A platform cannot access a Standard or Express account's persons after the account starts onboarding, such as after generating an account link for the account. See the Standard onboarding or Express onboarding documentation for information about platform pre-filling and account onboarding steps.

Related guide: Handling Identity Verification with the API.

+ * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property bool $payouts_enabled Whether Stripe can send payouts to this account. + * @property \Stripe\StripeObject $requirements + * @property null|\Stripe\StripeObject $settings Options for customizing how the account functions within Stripe. + * @property \Stripe\StripeObject $tos_acceptance + * @property string $type The Stripe account type. Can be standard, express, or custom. + */ +class Account extends ApiResource +{ + const OBJECT_NAME = 'account'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Delete; + use ApiOperations\NestedResource; + use ApiOperations\Update; + + const BUSINESS_TYPE_COMPANY = 'company'; + const BUSINESS_TYPE_GOVERNMENT_ENTITY = 'government_entity'; + const BUSINESS_TYPE_INDIVIDUAL = 'individual'; + const BUSINESS_TYPE_NON_PROFIT = 'non_profit'; + + const CAPABILITY_CARD_PAYMENTS = 'card_payments'; + const CAPABILITY_LEGACY_PAYMENTS = 'legacy_payments'; + const CAPABILITY_PLATFORM_PAYMENTS = 'platform_payments'; + const CAPABILITY_TRANSFERS = 'transfers'; + + const CAPABILITY_STATUS_ACTIVE = 'active'; + const CAPABILITY_STATUS_INACTIVE = 'inactive'; + const CAPABILITY_STATUS_PENDING = 'pending'; + + const TYPE_CUSTOM = 'custom'; + const TYPE_EXPRESS = 'express'; + const TYPE_STANDARD = 'standard'; + + use ApiOperations\Retrieve { + retrieve as protected _retrieve; + } + + public static function getSavedNestedResources() + { + static $savedNestedResources = null; + if (null === $savedNestedResources) { + $savedNestedResources = new Util\Set([ + 'external_account', + 'bank_account', + ]); + } + + return $savedNestedResources; + } + + public function instanceUrl() + { + if (null === $this['id']) { + return '/v1/account'; + } + + return parent::instanceUrl(); + } + + public function serializeParameters($force = false) + { + $update = parent::serializeParameters($force); + if (isset($this->_values['legal_entity'])) { + $entity = $this['legal_entity']; + if (isset($entity->_values['additional_owners'])) { + $owners = $entity['additional_owners']; + $entityUpdate = isset($update['legal_entity']) ? $update['legal_entity'] : []; + $entityUpdate['additional_owners'] = $this->serializeAdditionalOwners($entity, $owners); + $update['legal_entity'] = $entityUpdate; + } + } + if (isset($this->_values['individual'])) { + $individual = $this['individual']; + if (($individual instanceof Person) && !isset($update['individual'])) { + $update['individual'] = $individual->serializeParameters($force); + } + } + + return $update; + } + + private function serializeAdditionalOwners($legalEntity, $additionalOwners) + { + if (isset($legalEntity->_originalValues['additional_owners'])) { + $originalValue = $legalEntity->_originalValues['additional_owners']; + } else { + $originalValue = []; + } + if (($originalValue) && (\count($originalValue) > \count($additionalOwners))) { + throw new Exception\InvalidArgumentException( + 'You cannot delete an item from an array, you must instead set a new array' + ); + } + + $updateArr = []; + foreach ($additionalOwners as $i => $v) { + $update = ($v instanceof StripeObject) ? $v->serializeParameters() : $v; + + if ([] !== $update) { + if (!$originalValue + || !\array_key_exists($i, $originalValue) + || ($update !== $legalEntity->serializeParamsValue($originalValue[$i], null, false, true))) { + $updateArr[$i] = $update; + } + } + } + + return $updateArr; + } + + /** + * @param null|array|string $id the ID of the account to retrieve, or an + * options array containing an `id` key + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Account + */ + public static function retrieve($id = null, $opts = null) + { + if (!$opts && \is_string($id) && 'sk_' === \substr($id, 0, 3)) { + $opts = $id; + $id = null; + } + + return self::_retrieve($id, $opts); + } + + /** + * @param null|array $clientId + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\StripeObject object containing the response from the API + */ + public function deauthorize($clientId = null, $opts = null) + { + $params = [ + 'client_id' => $clientId, + 'stripe_user_id' => $this->id, + ]; + + return OAuth::deauthorize($params, $opts); + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection the list of persons + */ + public function persons($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/persons'; + list($response, $opts) = $this->_request('get', $url, $params, $opts); + $obj = Util\Util::convertToStripeObject($response, $opts); + $obj->setLastResponse($response); + + return $obj; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return Account the rejected account + */ + public function reject($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/reject'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /* + * Capabilities methods + * We can not add the capabilities() method today as the Account object already has a + * capabilities property which is a hash and not the sub-list of capabilities. + */ + + const PATH_CAPABILITIES = '/capabilities'; + + /** + * @param string $id the ID of the account on which to retrieve the capabilities + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection the list of capabilities + */ + public static function allCapabilities($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_CAPABILITIES, $params, $opts); + } + + /** + * @param string $id the ID of the account to which the capability belongs + * @param string $capabilityId the ID of the capability to retrieve + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Capability + */ + public static function retrieveCapability($id, $capabilityId, $params = null, $opts = null) + { + return self::_retrieveNestedResource($id, static::PATH_CAPABILITIES, $capabilityId, $params, $opts); + } + + /** + * @param string $id the ID of the account to which the capability belongs + * @param string $capabilityId the ID of the capability to update + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Capability + */ + public static function updateCapability($id, $capabilityId, $params = null, $opts = null) + { + return self::_updateNestedResource($id, static::PATH_CAPABILITIES, $capabilityId, $params, $opts); + } + + const PATH_EXTERNAL_ACCOUNTS = '/external_accounts'; + + /** + * @param string $id the ID of the account on which to retrieve the external accounts + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection the list of external accounts (BankAccount or Card) + */ + public static function allExternalAccounts($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_EXTERNAL_ACCOUNTS, $params, $opts); + } + + /** + * @param string $id the ID of the account on which to create the external account + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BankAccount|\Stripe\Card + */ + public static function createExternalAccount($id, $params = null, $opts = null) + { + return self::_createNestedResource($id, static::PATH_EXTERNAL_ACCOUNTS, $params, $opts); + } + + /** + * @param string $id the ID of the account to which the external account belongs + * @param string $externalAccountId the ID of the external account to delete + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BankAccount|\Stripe\Card + */ + public static function deleteExternalAccount($id, $externalAccountId, $params = null, $opts = null) + { + return self::_deleteNestedResource($id, static::PATH_EXTERNAL_ACCOUNTS, $externalAccountId, $params, $opts); + } + + /** + * @param string $id the ID of the account to which the external account belongs + * @param string $externalAccountId the ID of the external account to retrieve + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BankAccount|\Stripe\Card + */ + public static function retrieveExternalAccount($id, $externalAccountId, $params = null, $opts = null) + { + return self::_retrieveNestedResource($id, static::PATH_EXTERNAL_ACCOUNTS, $externalAccountId, $params, $opts); + } + + /** + * @param string $id the ID of the account to which the external account belongs + * @param string $externalAccountId the ID of the external account to update + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BankAccount|\Stripe\Card + */ + public static function updateExternalAccount($id, $externalAccountId, $params = null, $opts = null) + { + return self::_updateNestedResource($id, static::PATH_EXTERNAL_ACCOUNTS, $externalAccountId, $params, $opts); + } + + const PATH_LOGIN_LINKS = '/login_links'; + + /** + * @param string $id the ID of the account on which to create the login link + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\LoginLink + */ + public static function createLoginLink($id, $params = null, $opts = null) + { + return self::_createNestedResource($id, static::PATH_LOGIN_LINKS, $params, $opts); + } + + const PATH_PERSONS = '/persons'; + + /** + * @param string $id the ID of the account on which to retrieve the persons + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection the list of persons + */ + public static function allPersons($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_PERSONS, $params, $opts); + } + + /** + * @param string $id the ID of the account on which to create the person + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Person + */ + public static function createPerson($id, $params = null, $opts = null) + { + return self::_createNestedResource($id, static::PATH_PERSONS, $params, $opts); + } + + /** + * @param string $id the ID of the account to which the person belongs + * @param string $personId the ID of the person to delete + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Person + */ + public static function deletePerson($id, $personId, $params = null, $opts = null) + { + return self::_deleteNestedResource($id, static::PATH_PERSONS, $personId, $params, $opts); + } + + /** + * @param string $id the ID of the account to which the person belongs + * @param string $personId the ID of the person to retrieve + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Person + */ + public static function retrievePerson($id, $personId, $params = null, $opts = null) + { + return self::_retrieveNestedResource($id, static::PATH_PERSONS, $personId, $params, $opts); + } + + /** + * @param string $id the ID of the account to which the person belongs + * @param string $personId the ID of the person to update + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Person + */ + public static function updatePerson($id, $personId, $params = null, $opts = null) + { + return self::_updateNestedResource($id, static::PATH_PERSONS, $personId, $params, $opts); + } +} diff --git a/app/api/Stripe/AccountLink.php b/app/api/Stripe/AccountLink.php new file mode 100755 index 0000000..87f5739 --- /dev/null +++ b/app/api/Stripe/AccountLink.php @@ -0,0 +1,26 @@ +Connect + * Onboarding. + * + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property int $expires_at The timestamp at which this account link will expire. + * @property string $url The URL for the account link. + */ +class AccountLink extends ApiResource +{ + const OBJECT_NAME = 'account_link'; + + use ApiOperations\Create; +} diff --git a/app/api/Stripe/AlipayAccount.php b/app/api/Stripe/AlipayAccount.php new file mode 100755 index 0000000..13f4ad6 --- /dev/null +++ b/app/api/Stripe/AlipayAccount.php @@ -0,0 +1,75 @@ +json, $opts); + if (!($obj instanceof \Stripe\Collection)) { + throw new \Stripe\Exception\UnexpectedValueException( + 'Expected type ' . \Stripe\Collection::class . ', got "' . \get_class($obj) . '" instead.' + ); + } + $obj->setLastResponse($response); + $obj->setFilters($params); + + return $obj; + } +} diff --git a/app/api/Stripe/ApiOperations/Create.php b/app/api/Stripe/ApiOperations/Create.php new file mode 100755 index 0000000..d1dead9 --- /dev/null +++ b/app/api/Stripe/ApiOperations/Create.php @@ -0,0 +1,31 @@ +json, $opts); + $obj->setLastResponse($response); + + return $obj; + } +} diff --git a/app/api/Stripe/ApiOperations/Delete.php b/app/api/Stripe/ApiOperations/Delete.php new file mode 100755 index 0000000..291546a --- /dev/null +++ b/app/api/Stripe/ApiOperations/Delete.php @@ -0,0 +1,30 @@ +instanceUrl(); + list($response, $opts) = $this->_request('delete', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/app/api/Stripe/ApiOperations/NestedResource.php b/app/api/Stripe/ApiOperations/NestedResource.php new file mode 100755 index 0000000..ed9c830 --- /dev/null +++ b/app/api/Stripe/ApiOperations/NestedResource.php @@ -0,0 +1,135 @@ +json, $opts); + $obj->setLastResponse($response); + + return $obj; + } + + /** + * @param string $id + * @param string $nestedPath + * @param null|string $nestedId + * + * @return string + */ + protected static function _nestedResourceUrl($id, $nestedPath, $nestedId = null) + { + $url = static::resourceUrl($id) . $nestedPath; + if (null !== $nestedId) { + $url .= "/{$nestedId}"; + } + + return $url; + } + + /** + * @param string $id + * @param string $nestedPath + * @param null|array $params + * @param null|array|string $options + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\StripeObject + */ + protected static function _createNestedResource($id, $nestedPath, $params = null, $options = null) + { + $url = static::_nestedResourceUrl($id, $nestedPath); + + return self::_nestedResourceOperation('post', $url, $params, $options); + } + + /** + * @param string $id + * @param string $nestedPath + * @param null|string $nestedId + * @param null|array $params + * @param null|array|string $options + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\StripeObject + */ + protected static function _retrieveNestedResource($id, $nestedPath, $nestedId, $params = null, $options = null) + { + $url = static::_nestedResourceUrl($id, $nestedPath, $nestedId); + + return self::_nestedResourceOperation('get', $url, $params, $options); + } + + /** + * @param string $id + * @param string $nestedPath + * @param null|string $nestedId + * @param null|array $params + * @param null|array|string $options + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\StripeObject + */ + protected static function _updateNestedResource($id, $nestedPath, $nestedId, $params = null, $options = null) + { + $url = static::_nestedResourceUrl($id, $nestedPath, $nestedId); + + return self::_nestedResourceOperation('post', $url, $params, $options); + } + + /** + * @param string $id + * @param string $nestedPath + * @param null|string $nestedId + * @param null|array $params + * @param null|array|string $options + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\StripeObject + */ + protected static function _deleteNestedResource($id, $nestedPath, $nestedId, $params = null, $options = null) + { + $url = static::_nestedResourceUrl($id, $nestedPath, $nestedId); + + return self::_nestedResourceOperation('delete', $url, $params, $options); + } + + /** + * @param string $id + * @param string $nestedPath + * @param null|array $params + * @param null|array|string $options + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\StripeObject + */ + protected static function _allNestedResources($id, $nestedPath, $params = null, $options = null) + { + $url = static::_nestedResourceUrl($id, $nestedPath); + + return self::_nestedResourceOperation('get', $url, $params, $options); + } +} diff --git a/app/api/Stripe/ApiOperations/Request.php b/app/api/Stripe/ApiOperations/Request.php new file mode 100755 index 0000000..f645a8f --- /dev/null +++ b/app/api/Stripe/ApiOperations/Request.php @@ -0,0 +1,68 @@ + 100, " + . "'currency' => 'usd', 'source' => 'tok_1234'])\")"; + + throw new \Stripe\Exception\InvalidArgumentException($message); + } + } + + /** + * @param string $method HTTP method ('get', 'post', etc.) + * @param string $url URL for the request + * @param array $params list of parameters for the request + * @param null|array|string $options + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return array tuple containing (the JSON response, $options) + */ + protected function _request($method, $url, $params = [], $options = null) + { + $opts = $this->_opts->merge($options); + list($resp, $options) = static::_staticRequest($method, $url, $params, $opts); + $this->setLastResponse($resp); + + return [$resp->json, $options]; + } + + /** + * @param string $method HTTP method ('get', 'post', etc.) + * @param string $url URL for the request + * @param array $params list of parameters for the request + * @param null|array|string $options + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return array tuple containing (the JSON response, $options) + */ + protected static function _staticRequest($method, $url, $params, $options) + { + $opts = \Stripe\Util\RequestOptions::parse($options); + $baseUrl = isset($opts->apiBase) ? $opts->apiBase : static::baseUrl(); + $requestor = new \Stripe\ApiRequestor($opts->apiKey, $baseUrl); + list($response, $opts->apiKey) = $requestor->request($method, $url, $params, $opts->headers); + $opts->discardNonPersistentHeaders(); + + return [$response, $opts]; + } +} diff --git a/app/api/Stripe/ApiOperations/Retrieve.php b/app/api/Stripe/ApiOperations/Retrieve.php new file mode 100755 index 0000000..ddd8e51 --- /dev/null +++ b/app/api/Stripe/ApiOperations/Retrieve.php @@ -0,0 +1,30 @@ +refresh(); + + return $instance; + } +} diff --git a/app/api/Stripe/ApiOperations/Update.php b/app/api/Stripe/ApiOperations/Update.php new file mode 100755 index 0000000..841b039 --- /dev/null +++ b/app/api/Stripe/ApiOperations/Update.php @@ -0,0 +1,52 @@ +json, $opts); + $obj->setLastResponse($response); + + return $obj; + } + + /** + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return static the saved resource + */ + public function save($opts = null) + { + $params = $this->serializeParameters(); + if (\count($params) > 0) { + $url = $this->instanceUrl(); + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + } + + return $this; + } +} diff --git a/app/api/Stripe/ApiRequestor.php b/app/api/Stripe/ApiRequestor.php new file mode 100755 index 0000000..4ebe9b3 --- /dev/null +++ b/app/api/Stripe/ApiRequestor.php @@ -0,0 +1,526 @@ +_apiKey = $apiKey; + if (!$apiBase) { + $apiBase = Stripe::$apiBase; + } + $this->_apiBase = $apiBase; + } + + /** + * Creates a telemetry json blob for use in 'X-Stripe-Client-Telemetry' headers. + * + * @static + * + * @param RequestTelemetry $requestTelemetry + * + * @return string + */ + private static function _telemetryJson($requestTelemetry) + { + $payload = [ + 'last_request_metrics' => [ + 'request_id' => $requestTelemetry->requestId, + 'request_duration_ms' => $requestTelemetry->requestDuration, + ], + ]; + + $result = \json_encode($payload); + if (false !== $result) { + return $result; + } + Stripe::getLogger()->error('Serializing telemetry payload failed!'); + + return '{}'; + } + + /** + * @static + * + * @param ApiResource|array|bool|mixed $d + * + * @return ApiResource|array|mixed|string + */ + private static function _encodeObjects($d) + { + if ($d instanceof ApiResource) { + return Util\Util::utf8($d->id); + } + if (true === $d) { + return 'true'; + } + if (false === $d) { + return 'false'; + } + if (\is_array($d)) { + $res = []; + foreach ($d as $k => $v) { + $res[$k] = self::_encodeObjects($v); + } + + return $res; + } + + return Util\Util::utf8($d); + } + + /** + * @param string $method + * @param string $url + * @param null|array $params + * @param null|array $headers + * + * @throws Exception\ApiErrorException + * + * @return array tuple containing (ApiReponse, API key) + */ + public function request($method, $url, $params = null, $headers = null) + { + $params = $params ?: []; + $headers = $headers ?: []; + list($rbody, $rcode, $rheaders, $myApiKey) = + $this->_requestRaw($method, $url, $params, $headers); + $json = $this->_interpretResponse($rbody, $rcode, $rheaders); + $resp = new ApiResponse($rbody, $rcode, $rheaders, $json); + + return [$resp, $myApiKey]; + } + + /** + * @param string $rbody a JSON string + * @param int $rcode + * @param array $rheaders + * @param array $resp + * + * @throws Exception\UnexpectedValueException + * @throws Exception\ApiErrorException + */ + public function handleErrorResponse($rbody, $rcode, $rheaders, $resp) + { + if (!\is_array($resp) || !isset($resp['error'])) { + $msg = "Invalid response object from API: {$rbody} " + . "(HTTP response code was {$rcode})"; + + throw new Exception\UnexpectedValueException($msg); + } + + $errorData = $resp['error']; + + $error = null; + if (\is_string($errorData)) { + $error = self::_specificOAuthError($rbody, $rcode, $rheaders, $resp, $errorData); + } + if (!$error) { + $error = self::_specificAPIError($rbody, $rcode, $rheaders, $resp, $errorData); + } + + throw $error; + } + + /** + * @static + * + * @param string $rbody + * @param int $rcode + * @param array $rheaders + * @param array $resp + * @param array $errorData + * + * @return Exception\ApiErrorException + */ + private static function _specificAPIError($rbody, $rcode, $rheaders, $resp, $errorData) + { + $msg = isset($errorData['message']) ? $errorData['message'] : null; + $param = isset($errorData['param']) ? $errorData['param'] : null; + $code = isset($errorData['code']) ? $errorData['code'] : null; + $type = isset($errorData['type']) ? $errorData['type'] : null; + $declineCode = isset($errorData['decline_code']) ? $errorData['decline_code'] : null; + + switch ($rcode) { + case 400: + // 'rate_limit' code is deprecated, but left here for backwards compatibility + // for API versions earlier than 2015-09-08 + if ('rate_limit' === $code) { + return Exception\RateLimitException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code, $param); + } + if ('idempotency_error' === $type) { + return Exception\IdempotencyException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code); + } + + // no break + case 404: + return Exception\InvalidRequestException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code, $param); + + case 401: + return Exception\AuthenticationException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code); + + case 402: + return Exception\CardException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code, $declineCode, $param); + + case 403: + return Exception\PermissionException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code); + + case 429: + return Exception\RateLimitException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code, $param); + + default: + return Exception\UnknownApiErrorException::factory($msg, $rcode, $rbody, $resp, $rheaders, $code); + } + } + + /** + * @static + * + * @param bool|string $rbody + * @param int $rcode + * @param array $rheaders + * @param array $resp + * @param string $errorCode + * + * @return Exception\OAuth\OAuthErrorException + */ + private static function _specificOAuthError($rbody, $rcode, $rheaders, $resp, $errorCode) + { + $description = isset($resp['error_description']) ? $resp['error_description'] : $errorCode; + + switch ($errorCode) { + case 'invalid_client': + return Exception\OAuth\InvalidClientException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode); + + case 'invalid_grant': + return Exception\OAuth\InvalidGrantException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode); + + case 'invalid_request': + return Exception\OAuth\InvalidRequestException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode); + + case 'invalid_scope': + return Exception\OAuth\InvalidScopeException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode); + + case 'unsupported_grant_type': + return Exception\OAuth\UnsupportedGrantTypeException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode); + + case 'unsupported_response_type': + return Exception\OAuth\UnsupportedResponseTypeException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode); + + default: + return Exception\OAuth\UnknownOAuthErrorException::factory($description, $rcode, $rbody, $resp, $rheaders, $errorCode); + } + } + + /** + * @static + * + * @param null|array $appInfo + * + * @return null|string + */ + private static function _formatAppInfo($appInfo) + { + if (null !== $appInfo) { + $string = $appInfo['name']; + if (null !== $appInfo['version']) { + $string .= '/' . $appInfo['version']; + } + if (null !== $appInfo['url']) { + $string .= ' (' . $appInfo['url'] . ')'; + } + + return $string; + } + + return null; + } + + /** + * @static + * + * @param string $disabledFunctionsOutput - String value of the 'disable_function' setting, as output by \ini_get('disable_functions') + * @param string $functionName - Name of the function we are interesting in seeing whether or not it is disabled + * @param mixed $disableFunctionsOutput + * + * @return bool + */ + private static function _isDisabled($disableFunctionsOutput, $functionName) + { + $disabledFunctions = \explode(',', $disableFunctionsOutput); + foreach ($disabledFunctions as $disabledFunction) { + if (\trim($disabledFunction) === $functionName) { + return true; + } + } + + return false; + } + + /** + * @static + * + * @param string $apiKey + * @param null $clientInfo + * + * @return array + */ + private static function _defaultHeaders($apiKey, $clientInfo = null) + { + $uaString = 'Stripe/v1 PhpBindings/' . Stripe::VERSION; + + $langVersion = \PHP_VERSION; + $uname_disabled = static::_isDisabled(\ini_get('disable_functions'), 'php_uname'); + $uname = $uname_disabled ? '(disabled)' : \php_uname(); + + $appInfo = Stripe::getAppInfo(); + $ua = [ + 'bindings_version' => Stripe::VERSION, + 'lang' => 'php', + 'lang_version' => $langVersion, + 'publisher' => 'stripe', + 'uname' => $uname, + ]; + if ($clientInfo) { + $ua = \array_merge($clientInfo, $ua); + } + if (null !== $appInfo) { + $uaString .= ' ' . self::_formatAppInfo($appInfo); + $ua['application'] = $appInfo; + } + + return [ + 'X-Stripe-Client-User-Agent' => \json_encode($ua), + 'User-Agent' => $uaString, + 'Authorization' => 'Bearer ' . $apiKey, + ]; + } + + /** + * @param string $method + * @param string $url + * @param array $params + * @param array $headers + * + * @throws Exception\AuthenticationException + * @throws Exception\ApiConnectionException + * + * @return array + */ + private function _requestRaw($method, $url, $params, $headers) + { + $myApiKey = $this->_apiKey; + if (!$myApiKey) { + $myApiKey = Stripe::$apiKey; + } + + if (!$myApiKey) { + $msg = 'No API key provided. (HINT: set your API key using ' + . '"Stripe::setApiKey()". You can generate API keys from ' + . 'the Stripe web interface. See https://stripe.com/api for ' + . 'details, or email support@stripe.com if you have any questions.'; + + throw new Exception\AuthenticationException($msg); + } + + // Clients can supply arbitrary additional keys to be included in the + // X-Stripe-Client-User-Agent header via the optional getUserAgentInfo() + // method + $clientUAInfo = null; + if (\method_exists($this->httpClient(), 'getUserAgentInfo')) { + $clientUAInfo = $this->httpClient()->getUserAgentInfo(); + } + + if ($params && \is_array($params)) { + $optionKeysInParams = \array_filter( + static::$OPTIONS_KEYS, + function ($key) use ($params) { + return \array_key_exists($key, $params); + } + ); + if (\count($optionKeysInParams) > 0) { + $message = \sprintf('Options found in $params: %s. Options should ' + . 'be passed in their own array after $params. (HINT: pass an ' + . 'empty array to $params if you do not have any.)', \implode(', ', $optionKeysInParams)); + \trigger_error($message, \E_USER_WARNING); + } + } + + $absUrl = $this->_apiBase . $url; + $params = self::_encodeObjects($params); + $defaultHeaders = $this->_defaultHeaders($myApiKey, $clientUAInfo); + if (Stripe::$apiVersion) { + $defaultHeaders['Stripe-Version'] = Stripe::$apiVersion; + } + + if (Stripe::$accountId) { + $defaultHeaders['Stripe-Account'] = Stripe::$accountId; + } + + if (Stripe::$enableTelemetry && null !== self::$requestTelemetry) { + $defaultHeaders['X-Stripe-Client-Telemetry'] = self::_telemetryJson(self::$requestTelemetry); + } + + $hasFile = false; + foreach ($params as $k => $v) { + if (\is_resource($v)) { + $hasFile = true; + $params[$k] = self::_processResourceParam($v); + } elseif ($v instanceof \CURLFile) { + $hasFile = true; + } + } + + if ($hasFile) { + $defaultHeaders['Content-Type'] = 'multipart/form-data'; + } else { + $defaultHeaders['Content-Type'] = 'application/x-www-form-urlencoded'; + } + + $combinedHeaders = \array_merge($defaultHeaders, $headers); + $rawHeaders = []; + + foreach ($combinedHeaders as $header => $value) { + $rawHeaders[] = $header . ': ' . $value; + } + + $requestStartMs = Util\Util::currentTimeMillis(); + + list($rbody, $rcode, $rheaders) = $this->httpClient()->request( + $method, + $absUrl, + $rawHeaders, + $params, + $hasFile + ); + + if (isset($rheaders['request-id']) + && \is_string($rheaders['request-id']) + && \strlen($rheaders['request-id']) > 0) { + self::$requestTelemetry = new RequestTelemetry( + $rheaders['request-id'], + Util\Util::currentTimeMillis() - $requestStartMs + ); + } + + return [$rbody, $rcode, $rheaders, $myApiKey]; + } + + /** + * @param resource $resource + * + * @throws Exception\InvalidArgumentException + * + * @return \CURLFile|string + */ + private function _processResourceParam($resource) + { + if ('stream' !== \get_resource_type($resource)) { + throw new Exception\InvalidArgumentException( + 'Attempted to upload a resource that is not a stream' + ); + } + + $metaData = \stream_get_meta_data($resource); + if ('plainfile' !== $metaData['wrapper_type']) { + throw new Exception\InvalidArgumentException( + 'Only plainfile resource streams are supported' + ); + } + + // We don't have the filename or mimetype, but the API doesn't care + return new \CURLFile($metaData['uri']); + } + + /** + * @param string $rbody + * @param int $rcode + * @param array $rheaders + * + * @throws Exception\UnexpectedValueException + * @throws Exception\ApiErrorException + * + * @return array + */ + private function _interpretResponse($rbody, $rcode, $rheaders) + { + $resp = \json_decode($rbody, true); + $jsonError = \json_last_error(); + if (null === $resp && \JSON_ERROR_NONE !== $jsonError) { + $msg = "Invalid response body from API: {$rbody} " + . "(HTTP response code was {$rcode}, json_last_error() was {$jsonError})"; + + throw new Exception\UnexpectedValueException($msg, $rcode); + } + + if ($rcode < 200 || $rcode >= 300) { + $this->handleErrorResponse($rbody, $rcode, $rheaders, $resp); + } + + return $resp; + } + + /** + * @static + * + * @param HttpClient\ClientInterface $client + */ + public static function setHttpClient($client) + { + self::$_httpClient = $client; + } + + /** + * @static + * + * Resets any stateful telemetry data + */ + public static function resetTelemetry() + { + self::$requestTelemetry = null; + } + + /** + * @return HttpClient\ClientInterface + */ + private function httpClient() + { + if (!self::$_httpClient) { + self::$_httpClient = HttpClient\CurlClient::instance(); + } + + return self::$_httpClient; + } +} diff --git a/app/api/Stripe/ApiResource.php b/app/api/Stripe/ApiResource.php new file mode 100755 index 0000000..0d22de0 --- /dev/null +++ b/app/api/Stripe/ApiResource.php @@ -0,0 +1,120 @@ +{$k}; + if ((static::getSavedNestedResources()->includes($k)) + && ($v instanceof ApiResource)) { + $v->saveWithParent = true; + } + } + + /** + * @throws Exception\ApiErrorException + * + * @return ApiResource the refreshed resource + */ + public function refresh() + { + $requestor = new ApiRequestor($this->_opts->apiKey, static::baseUrl()); + $url = $this->instanceUrl(); + + list($response, $this->_opts->apiKey) = $requestor->request( + 'get', + $url, + $this->_retrieveOptions, + $this->_opts->headers + ); + $this->setLastResponse($response); + $this->refreshFrom($response->json, $this->_opts); + + return $this; + } + + /** + * @return string the base URL for the given class + */ + public static function baseUrl() + { + return Stripe::$apiBase; + } + + /** + * @return string the endpoint URL for the given class + */ + public static function classUrl() + { + // Replace dots with slashes for namespaced resources, e.g. if the object's name is + // "foo.bar", then its URL will be "/v1/foo/bars". + $base = \str_replace('.', '/', static::OBJECT_NAME); + + return "/v1/{$base}s"; + } + + /** + * @param null|string $id the ID of the resource + * + * @throws Exception\UnexpectedValueException if $id is null + * + * @return string the instance endpoint URL for the given class + */ + public static function resourceUrl($id) + { + if (null === $id) { + $class = static::class; + $message = 'Could not determine which URL to request: ' + . "{$class} instance has invalid ID: {$id}"; + + throw new Exception\UnexpectedValueException($message); + } + $id = Util\Util::utf8($id); + $base = static::classUrl(); + $extn = \urlencode($id); + + return "{$base}/{$extn}"; + } + + /** + * @return string the full API URL for this API resource + */ + public function instanceUrl() + { + return static::resourceUrl($this['id']); + } +} diff --git a/app/api/Stripe/ApiResponse.php b/app/api/Stripe/ApiResponse.php new file mode 100755 index 0000000..64ed3e2 --- /dev/null +++ b/app/api/Stripe/ApiResponse.php @@ -0,0 +1,45 @@ +body = $body; + $this->code = $code; + $this->headers = $headers; + $this->json = $json; + } +} diff --git a/app/api/Stripe/ApplePayDomain.php b/app/api/Stripe/ApplePayDomain.php new file mode 100755 index 0000000..4bb458c --- /dev/null +++ b/app/api/Stripe/ApplePayDomain.php @@ -0,0 +1,31 @@ +true
if the object exists in live mode or the value false if the object exists in test mode. + */ +class ApplePayDomain extends ApiResource +{ + const OBJECT_NAME = 'apple_pay_domain'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Delete; + use ApiOperations\Retrieve; + + /** + * @return string The class URL for this resource. It needs to be special + * cased because it doesn't fit into the standard resource pattern. + */ + public static function classUrl() + { + return '/v1/apple_pay/domains'; + } +} diff --git a/app/api/Stripe/ApplicationFee.php b/app/api/Stripe/ApplicationFee.php new file mode 100755 index 0000000..364ca17 --- /dev/null +++ b/app/api/Stripe/ApplicationFee.php @@ -0,0 +1,90 @@ +ISO currency code, in lowercase. Must be a supported currency. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|string|\Stripe\Charge $originating_transaction ID of the corresponding charge on the platform account, if this fee was the result of a charge using the destination parameter. + * @property bool $refunded Whether the fee has been fully refunded. If the fee is only partially refunded, this attribute will still be false. + * @property \Stripe\Collection $refunds A list of refunds that have been applied to the fee. + */ +class ApplicationFee extends ApiResource +{ + const OBJECT_NAME = 'application_fee'; + + use ApiOperations\All; + use ApiOperations\NestedResource; + use ApiOperations\Retrieve; + + const PATH_REFUNDS = '/refunds'; + + /** + * @param string $id the ID of the application fee on which to retrieve the fee refunds + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection the list of fee refunds + */ + public static function allRefunds($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_REFUNDS, $params, $opts); + } + + /** + * @param string $id the ID of the application fee on which to create the fee refund + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ApplicationFeeRefund + */ + public static function createRefund($id, $params = null, $opts = null) + { + return self::_createNestedResource($id, static::PATH_REFUNDS, $params, $opts); + } + + /** + * @param string $id the ID of the application fee to which the fee refund belongs + * @param string $refundId the ID of the fee refund to retrieve + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ApplicationFeeRefund + */ + public static function retrieveRefund($id, $refundId, $params = null, $opts = null) + { + return self::_retrieveNestedResource($id, static::PATH_REFUNDS, $refundId, $params, $opts); + } + + /** + * @param string $id the ID of the application fee to which the fee refund belongs + * @param string $refundId the ID of the fee refund to update + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ApplicationFeeRefund + */ + public static function updateRefund($id, $refundId, $params = null, $opts = null) + { + return self::_updateNestedResource($id, static::PATH_REFUNDS, $refundId, $params, $opts); + } +} diff --git a/app/api/Stripe/ApplicationFeeRefund.php b/app/api/Stripe/ApplicationFeeRefund.php new file mode 100755 index 0000000..12ccb9b --- /dev/null +++ b/app/api/Stripe/ApplicationFeeRefund.php @@ -0,0 +1,66 @@ +Application Fee Refund objects allow you to refund an application + * fee that has previously been created but not yet refunded. Funds will be + * refunded to the Stripe account from which the fee was originally collected. + * + * Related guide: Refunding + * Application Fees. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount Amount, in %s. + * @property null|string|\Stripe\BalanceTransaction $balance_transaction Balance transaction that describes the impact on your account balance. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property string|\Stripe\ApplicationFee $fee ID of the application fee that was refunded. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + */ +class ApplicationFeeRefund extends ApiResource +{ + const OBJECT_NAME = 'fee_refund'; + + use ApiOperations\Update { + save as protected _save; + } + + /** + * @return string the API URL for this Stripe refund + */ + public function instanceUrl() + { + $id = $this['id']; + $fee = $this['fee']; + if (!$id) { + throw new Exception\UnexpectedValueException( + 'Could not determine which URL to request: ' . + "class instance has invalid ID: {$id}", + null + ); + } + $id = Util\Util::utf8($id); + $fee = Util\Util::utf8($fee); + + $base = ApplicationFee::classUrl(); + $feeExtn = \urlencode($fee); + $extn = \urlencode($id); + + return "{$base}/{$feeExtn}/refunds/{$extn}"; + } + + /** + * @param null|array|string $opts + * + * @return ApplicationFeeRefund the saved refund + */ + public function save($opts = null) + { + return $this->_save($opts); + } +} diff --git a/app/api/Stripe/Balance.php b/app/api/Stripe/Balance.php new file mode 100755 index 0000000..efc815c --- /dev/null +++ b/app/api/Stripe/Balance.php @@ -0,0 +1,45 @@ +transactions + * that contributed to the balance (charges, payouts, and so forth). + * + * The available and pending amounts for each currency are broken down further by + * payment source types. + * + * Related guide: Understanding Connect + * Account Balances. + * + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property \Stripe\StripeObject[] $available Funds that are available to be transferred or paid out, whether automatically by Stripe or explicitly via the Transfers API or Payouts API. The available balance for each currency and payment type can be found in the source_types property. + * @property \Stripe\StripeObject[] $connect_reserved Funds held due to negative balances on connected Custom accounts. The connect reserve balance for each currency and payment type can be found in the source_types property. + * @property \Stripe\StripeObject[] $instant_available Funds that can be paid out using Instant Payouts. + * @property \Stripe\StripeObject $issuing + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject[] $pending Funds that are not yet available in the balance, due to the 7-day rolling pay cycle. The pending balance for each currency, and for each payment type, can be found in the source_types property. + */ +class Balance extends SingletonApiResource +{ + const OBJECT_NAME = 'balance'; + + /** + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Balance + */ + public static function retrieve($opts = null) + { + return self::_singletonRetrieve($opts); + } +} diff --git a/app/api/Stripe/BalanceTransaction.php b/app/api/Stripe/BalanceTransaction.php new file mode 100755 index 0000000..29246ae --- /dev/null +++ b/app/api/Stripe/BalanceTransaction.php @@ -0,0 +1,71 @@ +Balance + * Transaction Types. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount Gross amount of the transaction, in %s. + * @property int $available_on The date the transaction's net funds will become available in the Stripe balance. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|float $exchange_rate The exchange rate used, if applicable, for this transaction. Specifically, if money was converted from currency A to currency B, then the amount in currency A, times exchange_rate, would be the amount in currency B. For example, suppose you charged a customer 10.00 EUR. Then the PaymentIntent's amount would be 1000 and currency would be eur. Suppose this was converted into 12.34 USD in your Stripe account. Then the BalanceTransaction's amount would be 1234, currency would be usd, and exchange_rate would be 1.234. + * @property int $fee Fees (in %s) paid for this transaction. + * @property \Stripe\StripeObject[] $fee_details Detailed breakdown of fees (in %s) paid for this transaction. + * @property int $net Net amount of the transaction, in %s. + * @property string $reporting_category Learn more about how reporting categories can help you understand balance transactions from an accounting perspective. + * @property null|string|\Stripe\StripeObject $source The Stripe object to which this transaction is related. + * @property string $status If the transaction's net funds are available in the Stripe balance yet. Either available or pending. + * @property string $type Transaction type: adjustment, advance, advance_funding, anticipation_repayment, application_fee, application_fee_refund, charge, connect_collection_transfer, contribution, issuing_authorization_hold, issuing_authorization_release, issuing_dispute, issuing_transaction, payment, payment_failure_refund, payment_refund, payout, payout_cancel, payout_failure, refund, refund_failure, reserve_transaction, reserved_funds, stripe_fee, stripe_fx_fee, tax_fee, topup, topup_reversal, transfer, transfer_cancel, transfer_failure, or transfer_refund. Learn more about balance transaction types and what they represent. If you are looking to classify transactions for accounting purposes, you might want to consider reporting_category instead. + */ +class BalanceTransaction extends ApiResource +{ + const OBJECT_NAME = 'balance_transaction'; + + use ApiOperations\All; + use ApiOperations\Retrieve; + + const TYPE_ADJUSTMENT = 'adjustment'; + const TYPE_ADVANCE = 'advance'; + const TYPE_ADVANCE_FUNDING = 'advance_funding'; + const TYPE_ANTICIPATION_REPAYMENT = 'anticipation_repayment'; + const TYPE_APPLICATION_FEE = 'application_fee'; + const TYPE_APPLICATION_FEE_REFUND = 'application_fee_refund'; + const TYPE_CHARGE = 'charge'; + const TYPE_CONNECT_COLLECTION_TRANSFER = 'connect_collection_transfer'; + const TYPE_CONTRIBUTION = 'contribution'; + const TYPE_ISSUING_AUTHORIZATION_HOLD = 'issuing_authorization_hold'; + const TYPE_ISSUING_AUTHORIZATION_RELEASE = 'issuing_authorization_release'; + const TYPE_ISSUING_DISPUTE = 'issuing_dispute'; + const TYPE_ISSUING_TRANSACTION = 'issuing_transaction'; + const TYPE_PAYMENT = 'payment'; + const TYPE_PAYMENT_FAILURE_REFUND = 'payment_failure_refund'; + const TYPE_PAYMENT_REFUND = 'payment_refund'; + const TYPE_PAYOUT = 'payout'; + const TYPE_PAYOUT_CANCEL = 'payout_cancel'; + const TYPE_PAYOUT_FAILURE = 'payout_failure'; + const TYPE_REFUND = 'refund'; + const TYPE_REFUND_FAILURE = 'refund_failure'; + const TYPE_RESERVE_TRANSACTION = 'reserve_transaction'; + const TYPE_RESERVED_FUNDS = 'reserved_funds'; + const TYPE_STRIPE_FEE = 'stripe_fee'; + const TYPE_STRIPE_FX_FEE = 'stripe_fx_fee'; + const TYPE_TAX_FEE = 'tax_fee'; + const TYPE_TOPUP = 'topup'; + const TYPE_TOPUP_REVERSAL = 'topup_reversal'; + const TYPE_TRANSFER = 'transfer'; + const TYPE_TRANSFER_CANCEL = 'transfer_cancel'; + const TYPE_TRANSFER_FAILURE = 'transfer_failure'; + const TYPE_TRANSFER_REFUND = 'transfer_refund'; +} diff --git a/app/api/Stripe/BankAccount.php b/app/api/Stripe/BankAccount.php new file mode 100755 index 0000000..08e0295 --- /dev/null +++ b/app/api/Stripe/BankAccount.php @@ -0,0 +1,132 @@ +Customer objects. + * + * On the other hand External Accounts are + * transfer destinations on Account objects for Custom accounts. They + * can be bank accounts or debit cards as well, and are documented in the links + * above. + * + * Related guide: Bank Debits and + * Transfers. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|string|\Stripe\Account $account The ID of the account that the bank account is associated with. + * @property null|string $account_holder_name The name of the person or business that owns the bank account. + * @property null|string $account_holder_type The type of entity that holds the account. This can be either individual or company. + * @property null|string[] $available_payout_methods A set of available payout methods for this bank account. Only values from this set should be passed as the method when creating a payout. + * @property null|string $bank_name Name of the bank associated with the routing number (e.g., WELLS FARGO). + * @property string $country Two-letter ISO code representing the country the bank account is located in. + * @property string $currency Three-letter ISO code for the currency paid out to the bank account. + * @property null|string|\Stripe\Customer $customer The ID of the customer that the bank account is associated with. + * @property null|bool $default_for_currency Whether this bank account is the default external account for its currency. + * @property null|string $fingerprint Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. + * @property string $last4 The last four digits of the bank account number. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|string $routing_number The routing transit number for the bank account. + * @property string $status

For bank accounts, possible values are new, validated, verified, verification_failed, or errored. A bank account that hasn't had any activity or validation performed is new. If Stripe can determine that the bank account exists, its status will be validated. Note that there often isn’t enough information to know (e.g., for smaller credit unions), and the validation is not always run. If customer bank account verification has succeeded, the bank account status will be verified. If the verification failed for any reason, such as microdeposit failure, the status will be verification_failed. If a transfer sent to this bank account fails, we'll set the status to errored and will not continue to send transfers until the bank details are updated.

For external accounts, possible values are new and errored. Validations aren't run against external accounts because they're only used for payouts. This means the other statuses don't apply. If a transfer fails, the status is set to errored and transfers are stopped until account details are updated.

+ */ +class BankAccount extends ApiResource +{ + const OBJECT_NAME = 'bank_account'; + + use ApiOperations\Delete; + use ApiOperations\Update; + + /** + * Possible string representations of the bank verification status. + * + * @see https://stripe.com/docs/api/external_account_bank_accounts/object#account_bank_account_object-status + */ + const STATUS_NEW = 'new'; + const STATUS_VALIDATED = 'validated'; + const STATUS_VERIFIED = 'verified'; + const STATUS_VERIFICATION_FAILED = 'verification_failed'; + const STATUS_ERRORED = 'errored'; + + /** + * @return string The instance URL for this resource. It needs to be special + * cased because it doesn't fit into the standard resource pattern. + */ + public function instanceUrl() + { + if ($this['customer']) { + $base = Customer::classUrl(); + $parent = $this['customer']; + $path = 'sources'; + } elseif ($this['account']) { + $base = Account::classUrl(); + $parent = $this['account']; + $path = 'external_accounts'; + } else { + $msg = 'Bank accounts cannot be accessed without a customer ID or account ID.'; + + throw new Exception\UnexpectedValueException($msg, null); + } + $parentExtn = \urlencode(Util\Util::utf8($parent)); + $extn = \urlencode(Util\Util::utf8($this['id'])); + + return "{$base}/{$parentExtn}/{$path}/{$extn}"; + } + + /** + * @param array|string $_id + * @param null|array|string $_opts + * + * @throws \Stripe\Exception\BadMethodCallException + */ + public static function retrieve($_id, $_opts = null) + { + $msg = 'Bank accounts cannot be retrieved without a customer ID or ' . + 'an account ID. Retrieve a bank account using ' . + "`Customer::retrieveSource('customer_id', " . + "'bank_account_id')` or `Account::retrieveExternalAccount(" . + "'account_id', 'bank_account_id')`."; + + throw new Exception\BadMethodCallException($msg); + } + + /** + * @param string $_id + * @param null|array $_params + * @param null|array|string $_options + * + * @throws \Stripe\Exception\BadMethodCallException + */ + public static function update($_id, $_params = null, $_options = null) + { + $msg = 'Bank accounts cannot be updated without a customer ID or an ' . + 'account ID. Update a bank account using ' . + "`Customer::updateSource('customer_id', 'bank_account_id', " . + '$updateParams)` or `Account::updateExternalAccount(' . + "'account_id', 'bank_account_id', \$updateParams)`."; + + throw new Exception\BadMethodCallException($msg); + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return BankAccount the verified bank account + */ + public function verify($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/verify'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/app/api/Stripe/BaseStripeClient.php b/app/api/Stripe/BaseStripeClient.php new file mode 100755 index 0000000..30cdc27 --- /dev/null +++ b/app/api/Stripe/BaseStripeClient.php @@ -0,0 +1,269 @@ + */ + private $config; + + /** @var \Stripe\Util\RequestOptions */ + private $defaultOpts; + + /** + * Initializes a new instance of the {@link BaseStripeClient} class. + * + * The constructor takes a single argument. The argument can be a string, in which case it + * should be the API key. It can also be an array with various configuration settings. + * + * Configuration settings include the following options: + * + * - api_key (null|string): the Stripe API key, to be used in regular API requests. + * - client_id (null|string): the Stripe client ID, to be used in OAuth requests. + * - stripe_account (null|string): a Stripe account ID. If set, all requests sent by the client + * will automatically use the {@code Stripe-Account} header with that account ID. + * - stripe_version (null|string): a Stripe API verion. If set, all requests sent by the client + * will include the {@code Stripe-Version} header with that API version. + * + * The following configuration settings are also available, though setting these should rarely be necessary + * (only useful if you want to send requests to a mock server like stripe-mock): + * + * - api_base (string): the base URL for regular API requests. Defaults to + * {@link DEFAULT_API_BASE}. + * - connect_base (string): the base URL for OAuth requests. Defaults to + * {@link DEFAULT_CONNECT_BASE}. + * - files_base (string): the base URL for file creation requests. Defaults to + * {@link DEFAULT_FILES_BASE}. + * + * @param array|string $config the API key as a string, or an array containing + * the client configuration settings + */ + public function __construct($config = []) + { + if (\is_string($config)) { + $config = ['api_key' => $config]; + } elseif (!\is_array($config)) { + throw new \Stripe\Exception\InvalidArgumentException('$config must be a string or an array'); + } + + $config = \array_merge($this->getDefaultConfig(), $config); + $this->validateConfig($config); + + $this->config = $config; + + $this->defaultOpts = \Stripe\Util\RequestOptions::parse([ + 'stripe_account' => $config['stripe_account'], + 'stripe_version' => $config['stripe_version'], + ]); + } + + /** + * Gets the API key used by the client to send requests. + * + * @return null|string the API key used by the client to send requests + */ + public function getApiKey() + { + return $this->config['api_key']; + } + + /** + * Gets the client ID used by the client in OAuth requests. + * + * @return null|string the client ID used by the client in OAuth requests + */ + public function getClientId() + { + return $this->config['client_id']; + } + + /** + * Gets the base URL for Stripe's API. + * + * @return string the base URL for Stripe's API + */ + public function getApiBase() + { + return $this->config['api_base']; + } + + /** + * Gets the base URL for Stripe's OAuth API. + * + * @return string the base URL for Stripe's OAuth API + */ + public function getConnectBase() + { + return $this->config['connect_base']; + } + + /** + * Gets the base URL for Stripe's Files API. + * + * @return string the base URL for Stripe's Files API + */ + public function getFilesBase() + { + return $this->config['files_base']; + } + + /** + * Sends a request to Stripe's API. + * + * @param string $method the HTTP method + * @param string $path the path of the request + * @param array $params the parameters of the request + * @param array|\Stripe\Util\RequestOptions $opts the special modifiers of the request + * + * @return \Stripe\StripeObject the object returned by Stripe's API + */ + public function request($method, $path, $params, $opts) + { + $opts = $this->defaultOpts->merge($opts, true); + $baseUrl = $opts->apiBase ?: $this->getApiBase(); + $requestor = new \Stripe\ApiRequestor($this->apiKeyForRequest($opts), $baseUrl); + list($response, $opts->apiKey) = $requestor->request($method, $path, $params, $opts->headers); + $opts->discardNonPersistentHeaders(); + $obj = \Stripe\Util\Util::convertToStripeObject($response->json, $opts); + $obj->setLastResponse($response); + + return $obj; + } + + /** + * Sends a request to Stripe's API. + * + * @param string $method the HTTP method + * @param string $path the path of the request + * @param array $params the parameters of the request + * @param array|\Stripe\Util\RequestOptions $opts the special modifiers of the request + * + * @return \Stripe\Collection of ApiResources + */ + public function requestCollection($method, $path, $params, $opts) + { + $obj = $this->request($method, $path, $params, $opts); + if (!($obj instanceof \Stripe\Collection)) { + $received_class = \get_class($obj); + $msg = "Expected to receive `Stripe\\Collection` object from Stripe API. Instead received `{$received_class}`."; + + throw new \Stripe\Exception\UnexpectedValueException($msg); + } + $obj->setFilters($params); + + return $obj; + } + + /** + * @param \Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\AuthenticationException + * + * @return string + */ + private function apiKeyForRequest($opts) + { + $apiKey = $opts->apiKey ?: $this->getApiKey(); + + if (null === $apiKey) { + $msg = 'No API key provided. Set your API key when constructing the ' + . 'StripeClient instance, or provide it on a per-request basis ' + . 'using the `api_key` key in the $opts argument.'; + + throw new \Stripe\Exception\AuthenticationException($msg); + } + + return $apiKey; + } + + /** + * TODO: replace this with a private constant when we drop support for PHP < 5. + * + * @return array + */ + private function getDefaultConfig() + { + return [ + 'api_key' => null, + 'client_id' => null, + 'stripe_account' => null, + 'stripe_version' => null, + 'api_base' => self::DEFAULT_API_BASE, + 'connect_base' => self::DEFAULT_CONNECT_BASE, + 'files_base' => self::DEFAULT_FILES_BASE, + ]; + } + + /** + * @param array $config + * + * @throws \Stripe\Exception\InvalidArgumentException + */ + private function validateConfig($config) + { + // api_key + if (null !== $config['api_key'] && !\is_string($config['api_key'])) { + throw new \Stripe\Exception\InvalidArgumentException('api_key must be null or a string'); + } + + if (null !== $config['api_key'] && ('' === $config['api_key'])) { + $msg = 'api_key cannot be the empty string'; + + throw new \Stripe\Exception\InvalidArgumentException($msg); + } + + if (null !== $config['api_key'] && (\preg_match('/\s/', $config['api_key']))) { + $msg = 'api_key cannot contain whitespace'; + + throw new \Stripe\Exception\InvalidArgumentException($msg); + } + + // client_id + if (null !== $config['client_id'] && !\is_string($config['client_id'])) { + throw new \Stripe\Exception\InvalidArgumentException('client_id must be null or a string'); + } + + // stripe_account + if (null !== $config['stripe_account'] && !\is_string($config['stripe_account'])) { + throw new \Stripe\Exception\InvalidArgumentException('stripe_account must be null or a string'); + } + + // stripe_version + if (null !== $config['stripe_version'] && !\is_string($config['stripe_version'])) { + throw new \Stripe\Exception\InvalidArgumentException('stripe_version must be null or a string'); + } + + // api_base + if (!\is_string($config['api_base'])) { + throw new \Stripe\Exception\InvalidArgumentException('api_base must be a string'); + } + + // connect_base + if (!\is_string($config['connect_base'])) { + throw new \Stripe\Exception\InvalidArgumentException('connect_base must be a string'); + } + + // files_base + if (!\is_string($config['files_base'])) { + throw new \Stripe\Exception\InvalidArgumentException('files_base must be a string'); + } + + // check absence of extra keys + $extraConfigKeys = \array_diff(\array_keys($config), \array_keys($this->getDefaultConfig())); + if (!empty($extraConfigKeys)) { + // Wrap in single quote to more easily catch trailing spaces errors + $invalidKeys = "'" . \implode("', '", $extraConfigKeys) . "'"; + + throw new \Stripe\Exception\InvalidArgumentException('Found unknown key(s) in configuration array: ' . $invalidKeys); + } + } +} diff --git a/app/api/Stripe/BillingPortal/Configuration.php b/app/api/Stripe/BillingPortal/Configuration.php new file mode 100755 index 0000000..3cb5676 --- /dev/null +++ b/app/api/Stripe/BillingPortal/Configuration.php @@ -0,0 +1,31 @@ +overriden when creating the session. + * @property \Stripe\StripeObject $features + * @property bool $is_default Whether the configuration is the default. If true, this configuration can be managed in the Dashboard and portal sessions will use this configuration unless it is overriden when creating the session. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch. + */ +class Configuration extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'billing_portal.configuration'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; +} diff --git a/app/api/Stripe/BillingPortal/Session.php b/app/api/Stripe/BillingPortal/Session.php new file mode 100755 index 0000000..ede9472 --- /dev/null +++ b/app/api/Stripe/BillingPortal/Session.php @@ -0,0 +1,42 @@ +product + * overview and integration + * guide. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property string|\Stripe\BillingPortal\Configuration $configuration The configuration used by this session, describing the features available. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $customer The ID of the customer for this session. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|string $on_behalf_of The account for which the session was created on behalf of. When specified, only subscriptions and invoices with this on_behalf_of account appear in the portal. For more information, see the docs. Use the Accounts API to modify the on_behalf_of account's branding settings, which the portal displays. + * @property string $return_url The URL to redirect customers to when they click on the portal's link to return to your website. + * @property string $url The short-lived URL of the session that gives customers access to the customer portal. + */ +class Session extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'billing_portal.session'; + + use \Stripe\ApiOperations\Create; +} diff --git a/app/api/Stripe/BitcoinReceiver.php b/app/api/Stripe/BitcoinReceiver.php new file mode 100755 index 0000000..8abe693 --- /dev/null +++ b/app/api/Stripe/BitcoinReceiver.php @@ -0,0 +1,71 @@ +currency that you are collecting as payment. + * @property int $amount_received The amount of currency to which bitcoin_amount_received has been converted. + * @property int $bitcoin_amount The amount of bitcoin that the customer should send to fill the receiver. The bitcoin_amount is denominated in Satoshi: there are 10^8 Satoshi in one bitcoin. + * @property int $bitcoin_amount_received The amount of bitcoin that has been sent by the customer to this receiver. + * @property string $bitcoin_uri This URI can be displayed to the customer as a clickable link (to activate their bitcoin client) or as a QR code (for mobile wallets). + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO code for the currency to which the bitcoin will be converted. + * @property null|string $customer The customer ID of the bitcoin receiver. + * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|string $email The customer's email address, set by the API call that creates the receiver. + * @property bool $filled This flag is initially false and updates to true when the customer sends the bitcoin_amount to this receiver. + * @property string $inbound_address A bitcoin address that is specific to this receiver. The customer can send bitcoin to this address to fill the receiver. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|string $payment The ID of the payment created from the receiver, if any. Hidden when viewing the receiver with a publishable key. + * @property null|string $refund_address The refund address of this bitcoin receiver. + * @property \Stripe\Collection $transactions A list with one entry for each time that the customer sent bitcoin to the receiver. Hidden when viewing the receiver with a publishable key. + * @property bool $uncaptured_funds This receiver contains uncaptured funds that can be used for a payment or refunded. + * @property null|bool $used_for_payment Indicate if this source is used for payment. + */ +class BitcoinReceiver extends ApiResource +{ + const OBJECT_NAME = 'bitcoin_receiver'; + + use ApiOperations\All; + use ApiOperations\Retrieve; + + /** + * @return string The class URL for this resource. It needs to be special + * cased because it doesn't fit into the standard resource pattern. + */ + public static function classUrl() + { + return '/v1/bitcoin/receivers'; + } + + /** + * @return string The instance URL for this resource. It needs to be special + * cased because it doesn't fit into the standard resource pattern. + */ + public function instanceUrl() + { + if ($this['customer']) { + $base = Customer::classUrl(); + $parent = $this['customer']; + $path = 'sources'; + $parentExtn = \urlencode(Util\Util::utf8($parent)); + $extn = \urlencode(Util\Util::utf8($this['id'])); + + return "{$base}/{$parentExtn}/{$path}/{$extn}"; + } + + $base = BitcoinReceiver::classUrl(); + $extn = \urlencode(Util\Util::utf8($this['id'])); + + return "{$base}/{$extn}"; + } +} diff --git a/app/api/Stripe/BitcoinTransaction.php b/app/api/Stripe/BitcoinTransaction.php new file mode 100755 index 0000000..35e3624 --- /dev/null +++ b/app/api/Stripe/BitcoinTransaction.php @@ -0,0 +1,19 @@ +currency that the transaction was converted to in real-time. + * @property int $bitcoin_amount The amount of bitcoin contained in the transaction. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO code for the currency to which this transaction was converted. + * @property string $receiver The receiver to which this transaction was sent. + */ +class BitcoinTransaction extends ApiResource +{ + const OBJECT_NAME = 'bitcoin_transaction'; +} diff --git a/app/api/Stripe/Capability.php b/app/api/Stripe/Capability.php new file mode 100755 index 0000000..29731c9 --- /dev/null +++ b/app/api/Stripe/Capability.php @@ -0,0 +1,87 @@ +Account + * capabilities. + * + * @property string $id The identifier for the capability. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property string|\Stripe\Account $account The account for which the capability enables functionality. + * @property bool $requested Whether the capability has been requested. + * @property null|int $requested_at Time at which the capability was requested. Measured in seconds since the Unix epoch. + * @property \Stripe\StripeObject $requirements + * @property string $status The status of the capability. Can be active, inactive, pending, or unrequested. + */ +class Capability extends ApiResource +{ + const OBJECT_NAME = 'capability'; + + use ApiOperations\Update; + + const STATUS_ACTIVE = 'active'; + const STATUS_INACTIVE = 'inactive'; + const STATUS_PENDING = 'pending'; + const STATUS_UNREQUESTED = 'unrequested'; + + /** + * @return string the API URL for this Stripe account reversal + */ + public function instanceUrl() + { + $id = $this['id']; + $account = $this['account']; + if (!$id) { + throw new Exception\UnexpectedValueException( + 'Could not determine which URL to request: ' . + "class instance has invalid ID: {$id}", + null + ); + } + $id = Util\Util::utf8($id); + $account = Util\Util::utf8($account); + + $base = Account::classUrl(); + $accountExtn = \urlencode($account); + $extn = \urlencode($id); + + return "{$base}/{$accountExtn}/capabilities/{$extn}"; + } + + /** + * @param array|string $_id + * @param null|array|string $_opts + * + * @throws \Stripe\Exception\BadMethodCallException + */ + public static function retrieve($_id, $_opts = null) + { + $msg = 'Capabilities cannot be retrieved without an account ID. ' . + 'Retrieve a capability using `Account::retrieveCapability(' . + "'account_id', 'capability_id')`."; + + throw new Exception\BadMethodCallException($msg); + } + + /** + * @param string $_id + * @param null|array $_params + * @param null|array|string $_options + * + * @throws \Stripe\Exception\BadMethodCallException + */ + public static function update($_id, $_params = null, $_options = null) + { + $msg = 'Capabilities cannot be updated without an account ID. ' . + 'Update a capability using `Account::updateCapability(' . + "'account_id', 'capability_id', \$updateParams)`."; + + throw new Exception\BadMethodCallException($msg); + } +} diff --git a/app/api/Stripe/Card.php b/app/api/Stripe/Card.php new file mode 100755 index 0000000..2e18ad6 --- /dev/null +++ b/app/api/Stripe/Card.php @@ -0,0 +1,142 @@ +Card Payments + * with Sources. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|string|\Stripe\Account $account The account this card belongs to. This attribute will not be in the card object if the card belongs to a customer or recipient instead. + * @property null|string $address_city City/District/Suburb/Town/Village. + * @property null|string $address_country Billing address country, if provided when creating card. + * @property null|string $address_line1 Address line 1 (Street address/PO Box/Company name). + * @property null|string $address_line1_check If address_line1 was provided, results of the check: pass, fail, unavailable, or unchecked. + * @property null|string $address_line2 Address line 2 (Apartment/Suite/Unit/Building). + * @property null|string $address_state State/County/Province/Region. + * @property null|string $address_zip ZIP or postal code. + * @property null|string $address_zip_check If address_zip was provided, results of the check: pass, fail, unavailable, or unchecked. + * @property null|string[] $available_payout_methods A set of available payout methods for this card. Only values from this set should be passed as the method when creating a payout. + * @property string $brand Card brand. Can be American Express, Diners Club, Discover, JCB, MasterCard, UnionPay, Visa, or Unknown. + * @property null|string $country Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. + * @property null|string $currency Three-letter ISO code for currency. Only applicable on accounts (not customers or recipients). The card can be used as a transfer destination for funds in this currency. + * @property null|string|\Stripe\Customer $customer The customer that this card belongs to. This attribute will not be in the card object if the card belongs to an account or recipient instead. + * @property null|string $cvc_check If a CVC was provided, results of the check: pass, fail, unavailable, or unchecked. A result of unchecked indicates that CVC was provided but hasn't been checked yet. Checks are typically performed when attaching a card to a Customer object, or when creating a charge. For more details, see Check if a card is valid without a charge. + * @property null|bool $default_for_currency Whether this card is the default external account for its currency. + * @property null|string $dynamic_last4 (For tokenized numbers only.) The last four digits of the device account number. + * @property int $exp_month Two-digit number representing the card's expiration month. + * @property int $exp_year Four-digit number representing the card's expiration year. + * @property null|string $fingerprint Uniquely identifies this particular card number. You can use this attribute to check whether two customers who’ve signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. + * @property string $funding Card funding type. Can be credit, debit, prepaid, or unknown. + * @property string $last4 The last four digits of the card. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|string $name Cardholder name. + * @property null|string|\Stripe\Recipient $recipient The recipient that this card belongs to. This attribute will not be in the card object if the card belongs to a customer or account instead. + * @property null|string $tokenization_method If the card number is tokenized, this is the method that was used. Can be android_pay (includes Google Pay), apple_pay, masterpass, visa_checkout, or null. + */ +class Card extends ApiResource +{ + const OBJECT_NAME = 'card'; + + use ApiOperations\Delete; + use ApiOperations\Update; + + /** + * Possible string representations of the CVC check status. + * + * @see https://stripe.com/docs/api/cards/object#card_object-cvc_check + */ + const CVC_CHECK_FAIL = 'fail'; + const CVC_CHECK_PASS = 'pass'; + const CVC_CHECK_UNAVAILABLE = 'unavailable'; + const CVC_CHECK_UNCHECKED = 'unchecked'; + + /** + * Possible string representations of the funding of the card. + * + * @see https://stripe.com/docs/api/cards/object#card_object-funding + */ + const FUNDING_CREDIT = 'credit'; + const FUNDING_DEBIT = 'debit'; + const FUNDING_PREPAID = 'prepaid'; + const FUNDING_UNKNOWN = 'unknown'; + + /** + * Possible string representations of the tokenization method when using Apple Pay or Google Pay. + * + * @see https://stripe.com/docs/api/cards/object#card_object-tokenization_method + */ + const TOKENIZATION_METHOD_APPLE_PAY = 'apple_pay'; + const TOKENIZATION_METHOD_GOOGLE_PAY = 'google_pay'; + + /** + * @return string The instance URL for this resource. It needs to be special + * cased because cards are nested resources that may belong to different + * top-level resources. + */ + public function instanceUrl() + { + if ($this['customer']) { + $base = Customer::classUrl(); + $parent = $this['customer']; + $path = 'sources'; + } elseif ($this['account']) { + $base = Account::classUrl(); + $parent = $this['account']; + $path = 'external_accounts'; + } elseif ($this['recipient']) { + $base = Recipient::classUrl(); + $parent = $this['recipient']; + $path = 'cards'; + } else { + $msg = 'Cards cannot be accessed without a customer ID, account ID or recipient ID.'; + + throw new Exception\UnexpectedValueException($msg); + } + $parentExtn = \urlencode(Util\Util::utf8($parent)); + $extn = \urlencode(Util\Util::utf8($this['id'])); + + return "{$base}/{$parentExtn}/{$path}/{$extn}"; + } + + /** + * @param array|string $_id + * @param null|array|string $_opts + * + * @throws \Stripe\Exception\BadMethodCallException + */ + public static function retrieve($_id, $_opts = null) + { + $msg = 'Cards cannot be retrieved without a customer ID or an ' . + 'account ID. Retrieve a card using ' . + "`Customer::retrieveSource('customer_id', 'card_id')` or " . + "`Account::retrieveExternalAccount('account_id', 'card_id')`."; + + throw new Exception\BadMethodCallException($msg); + } + + /** + * @param string $_id + * @param null|array $_params + * @param null|array|string $_options + * + * @throws \Stripe\Exception\BadMethodCallException + */ + public static function update($_id, $_params = null, $_options = null) + { + $msg = 'Cards cannot be updated without a customer ID or an ' . + 'account ID. Update a card using ' . + "`Customer::updateSource('customer_id', 'card_id', " . + '$updateParams)` or `Account::updateExternalAccount(' . + "'account_id', 'card_id', \$updateParams)`."; + + throw new Exception\BadMethodCallException($msg); + } +} diff --git a/app/api/Stripe/Charge.php b/app/api/Stripe/Charge.php new file mode 100755 index 0000000..c7bbac9 --- /dev/null +++ b/app/api/Stripe/Charge.php @@ -0,0 +1,146 @@ +Charge object. You + * can retrieve and refund individual charges as well as list all charges. Charges + * are identified by a unique, random ID. + * + * Related guide: Accept a + * payment with the Charges API. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount Amount intended to be collected by this payment. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + * @property int $amount_captured Amount in %s captured (can be less than the amount attribute on the charge if a partial capture was made). + * @property int $amount_refunded Amount in %s refunded (can be less than the amount attribute on the charge if a partial refund was issued). + * @property null|string|\Stripe\StripeObject $application ID of the Connect application that created the charge. + * @property null|string|\Stripe\ApplicationFee $application_fee The application fee (if any) for the charge. See the Connect documentation for details. + * @property null|int $application_fee_amount The amount of the application fee (if any) requested for the charge. See the Connect documentation for details. + * @property null|string|\Stripe\BalanceTransaction $balance_transaction ID of the balance transaction that describes the impact of this charge on your account balance (not including refunds or disputes). + * @property \Stripe\StripeObject $billing_details + * @property null|string $calculated_statement_descriptor The full statement descriptor that is passed to card networks, and that is displayed on your customers' credit card and bank statements. Allows you to see what the statement descriptor looks like after the static and dynamic portions are combined. + * @property bool $captured If the charge was created without capturing, this Boolean represents whether it is still uncaptured or has since been captured. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string|\Stripe\Customer $customer ID of the customer this charge is for if one exists. + * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|string|\Stripe\Account $destination ID of an existing, connected Stripe account to transfer funds to if transfer_data was specified in the charge request. + * @property null|string|\Stripe\Dispute $dispute Details about the dispute if the charge has been disputed. + * @property bool $disputed Whether the charge has been disputed. + * @property null|string $failure_code Error code explaining reason for charge failure if available (see the errors section for a list of codes). + * @property null|string $failure_message Message to user further explaining reason for charge failure if available. + * @property null|\Stripe\StripeObject $fraud_details Information on fraud assessments for the charge. + * @property null|string|\Stripe\Invoice $invoice ID of the invoice this charge is for if one exists. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|string|\Stripe\Account $on_behalf_of The account (if any) the charge was made on behalf of without triggering an automatic transfer. See the Connect documentation for details. + * @property null|string|\Stripe\Order $order ID of the order this charge is for if one exists. + * @property null|\Stripe\StripeObject $outcome Details about whether the payment was accepted, and why. See understanding declines for details. + * @property bool $paid true if the charge succeeded, or was successfully authorized for later capture. + * @property null|string|\Stripe\PaymentIntent $payment_intent ID of the PaymentIntent associated with this charge, if one exists. + * @property null|string $payment_method ID of the payment method used in this charge. + * @property null|\Stripe\StripeObject $payment_method_details Details about the payment method at the time of the transaction. + * @property null|string $receipt_email This is the email address that the receipt for this charge was sent to. + * @property null|string $receipt_number This is the transaction number that appears on email receipts sent for this charge. This attribute will be null until a receipt has been sent. + * @property null|string $receipt_url This is the URL to view the receipt for this charge. The receipt is kept up-to-date to the latest state of the charge, including any refunds. If the charge is for an Invoice, the receipt will be stylized as an Invoice receipt. + * @property bool $refunded Whether the charge has been fully refunded. If the charge is only partially refunded, this attribute will still be false. + * @property \Stripe\Collection $refunds A list of refunds that have been applied to the charge. + * @property null|string|\Stripe\Review $review ID of the review associated with this charge if one exists. + * @property null|\Stripe\StripeObject $shipping Shipping information for the charge. + * @property null|\Stripe\Account|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source $source This is a legacy field that will be removed in the future. It contains the Source, Card, or BankAccount object used for the charge. For details about the payment method used for this charge, refer to payment_method or payment_method_details instead. + * @property null|string|\Stripe\Transfer $source_transfer The transfer ID which created this charge. Only present if the charge came from another Stripe account. See the Connect documentation for details. + * @property null|string $statement_descriptor For card charges, use statement_descriptor_suffix instead. Otherwise, you can use this value as the complete description of a charge on your customers’ statements. Must contain at least one letter, maximum 22 characters. + * @property null|string $statement_descriptor_suffix Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. + * @property string $status The status of the payment is either succeeded, pending, or failed. + * @property string|\Stripe\Transfer $transfer ID of the transfer to the destination account (only applicable if the charge was created using the destination parameter). + * @property null|\Stripe\StripeObject $transfer_data An optional dictionary including the account to automatically transfer to as part of a destination charge. See the Connect documentation for details. + * @property null|string $transfer_group A string that identifies this transaction as part of a group. See the Connect documentation for details. + */ +class Charge extends ApiResource +{ + const OBJECT_NAME = 'charge'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const STATUS_FAILED = 'failed'; + const STATUS_PENDING = 'pending'; + const STATUS_SUCCEEDED = 'succeeded'; + + /** + * Possible string representations of decline codes. + * These strings are applicable to the decline_code property of the \Stripe\Exception\CardException exception. + * + * @see https://stripe.com/docs/declines/codes + */ + const DECLINED_AUTHENTICATION_REQUIRED = 'authentication_required'; + const DECLINED_APPROVE_WITH_ID = 'approve_with_id'; + const DECLINED_CALL_ISSUER = 'call_issuer'; + const DECLINED_CARD_NOT_SUPPORTED = 'card_not_supported'; + const DECLINED_CARD_VELOCITY_EXCEEDED = 'card_velocity_exceeded'; + const DECLINED_CURRENCY_NOT_SUPPORTED = 'currency_not_supported'; + const DECLINED_DO_NOT_HONOR = 'do_not_honor'; + const DECLINED_DO_NOT_TRY_AGAIN = 'do_not_try_again'; + const DECLINED_DUPLICATED_TRANSACTION = 'duplicate_transaction'; + const DECLINED_EXPIRED_CARD = 'expired_card'; + const DECLINED_FRAUDULENT = 'fraudulent'; + const DECLINED_GENERIC_DECLINE = 'generic_decline'; + const DECLINED_INCORRECT_NUMBER = 'incorrect_number'; + const DECLINED_INCORRECT_CVC = 'incorrect_cvc'; + const DECLINED_INCORRECT_PIN = 'incorrect_pin'; + const DECLINED_INCORRECT_ZIP = 'incorrect_zip'; + const DECLINED_INSUFFICIENT_FUNDS = 'insufficient_funds'; + const DECLINED_INVALID_ACCOUNT = 'invalid_account'; + const DECLINED_INVALID_AMOUNT = 'invalid_amount'; + const DECLINED_INVALID_CVC = 'invalid_cvc'; + const DECLINED_INVALID_EXPIRY_YEAR = 'invalid_expiry_year'; + const DECLINED_INVALID_NUMBER = 'invalid_number'; + const DECLINED_INVALID_PIN = 'invalid_pin'; + const DECLINED_ISSUER_NOT_AVAILABLE = 'issuer_not_available'; + const DECLINED_LOST_CARD = 'lost_card'; + const DECLINED_MERCHANT_BLACKLIST = 'merchant_blacklist'; + const DECLINED_NEW_ACCOUNT_INFORMATION_AVAILABLE = 'new_account_information_available'; + const DECLINED_NO_ACTION_TAKEN = 'no_action_taken'; + const DECLINED_NOT_PERMITTED = 'not_permitted'; + const DECLINED_OFFLINE_PIN_REQUIRED = 'offline_pin_required'; + const DECLINED_ONLINE_OR_OFFLINE_PIN_REQUIRED = 'online_or_offline_pin_required'; + const DECLINED_PICKUP_CARD = 'pickup_card'; + const DECLINED_PIN_TRY_EXCEEDED = 'pin_try_exceeded'; + const DECLINED_PROCESSING_ERROR = 'processing_error'; + const DECLINED_REENTER_TRANSACTION = 'reenter_transaction'; + const DECLINED_RESTRICTED_CARD = 'restricted_card'; + const DECLINED_REVOCATION_OF_ALL_AUTHORIZATIONS = 'revocation_of_all_authorizations'; + const DECLINED_REVOCATION_OF_AUTHORIZATION = 'revocation_of_authorization'; + const DECLINED_SECURITY_VIOLATION = 'security_violation'; + const DECLINED_SERVICE_NOT_ALLOWED = 'service_not_allowed'; + const DECLINED_STOLEN_CARD = 'stolen_card'; + const DECLINED_STOP_PAYMENT_ORDER = 'stop_payment_order'; + const DECLINED_TESTMODE_DECLINE = 'testmode_decline'; + const DECLINED_TRANSACTION_NOT_ALLOWED = 'transaction_not_allowed'; + const DECLINED_TRY_AGAIN_LATER = 'try_again_later'; + const DECLINED_WITHDRAWAL_COUNT_LIMIT_EXCEEDED = 'withdrawal_count_limit_exceeded'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return Charge the captured charge + */ + public function capture($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/capture'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/app/api/Stripe/Checkout/Session.php b/app/api/Stripe/Checkout/Session.php new file mode 100755 index 0000000..f5a7c82 --- /dev/null +++ b/app/api/Stripe/Checkout/Session.php @@ -0,0 +1,89 @@ +Checkout. We recommend + * creating a new Session each time your customer attempts to pay. + * + * Once payment is successful, the Checkout Session will contain a reference to the + * Customer, and either the + * successful PaymentIntent or an + * active Subscription. + * + * You can create a Checkout Session on your server and pass its ID to the client + * to begin Checkout. + * + * Related guide: Checkout + * Server Quickstart. + * + * @property string $id Unique identifier for the object. Used to pass to redirectToCheckout in Stripe.js. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|bool $allow_promotion_codes Enables user redeemable promotion codes. + * @property null|int $amount_subtotal Total of all items before discounts or taxes are applied. + * @property null|int $amount_total Total of all items after discounts and taxes are applied. + * @property null|string $billing_address_collection Describes whether Checkout should collect the customer's billing address. + * @property string $cancel_url The URL the customer will be directed to if they decide to cancel payment and return to your website. + * @property null|string $client_reference_id A unique string to reference the Checkout Session. This can be a customer ID, a cart ID, or similar, and can be used to reconcile the Session with your internal systems. + * @property null|string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string|\Stripe\Customer $customer The ID of the customer for this Session. For Checkout Sessions in payment or subscription mode, Checkout will create a new customer object based on information provided during the payment flow unless an existing customer was provided when the Session was created. + * @property null|\Stripe\StripeObject $customer_details The customer details including the customer's tax exempt status and the customer's tax IDs. + * @property null|string $customer_email If provided, this value will be used when the Customer object is created. If not provided, customers will be asked to enter their email address. Use this parameter to prefill customer data if you already have an email on file. To access information about the customer once the payment flow is complete, use the customer attribute. + * @property \Stripe\Collection $line_items The line items purchased by the customer. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|string $locale The IETF language tag of the locale Checkout is displayed in. If blank or auto, the browser's locale is used. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property string $mode The mode of the Checkout Session. + * @property null|string|\Stripe\PaymentIntent $payment_intent The ID of the PaymentIntent for Checkout Sessions in payment mode. + * @property string[] $payment_method_types A list of the types of payment methods (e.g. card) this Checkout Session is allowed to accept. + * @property string $payment_status The payment status of the Checkout Session, one of paid, unpaid, or no_payment_required. You can use this value to decide when to fulfill your customer's order. + * @property null|string|\Stripe\SetupIntent $setup_intent The ID of the SetupIntent for Checkout Sessions in setup mode. + * @property null|\Stripe\StripeObject $shipping Shipping information for this Checkout Session. + * @property null|\Stripe\StripeObject $shipping_address_collection When set, provides configuration for Checkout to collect a shipping address from a customer. + * @property null|string $submit_type Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button. submit_type can only be specified on Checkout Sessions in payment mode, but not Checkout Sessions in subscription or setup mode. + * @property null|string|\Stripe\Subscription $subscription The ID of the subscription for Checkout Sessions in subscription mode. + * @property string $success_url The URL the customer will be directed to after the payment or subscription creation is successful. + * @property null|\Stripe\StripeObject $total_details Tax and discount details for the computed total amount. + */ +class Session extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'checkout.session'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\NestedResource; + use \Stripe\ApiOperations\Retrieve; + + const BILLING_ADDRESS_COLLECTION_AUTO = 'auto'; + const BILLING_ADDRESS_COLLECTION_REQUIRED = 'required'; + + const PAYMENT_STATUS_NO_PAYMENT_REQUIRED = 'no_payment_required'; + const PAYMENT_STATUS_PAID = 'paid'; + const PAYMENT_STATUS_UNPAID = 'unpaid'; + + const SUBMIT_TYPE_AUTO = 'auto'; + const SUBMIT_TYPE_BOOK = 'book'; + const SUBMIT_TYPE_DONATE = 'donate'; + const SUBMIT_TYPE_PAY = 'pay'; + + const PATH_LINE_ITEMS = '/line_items'; + + /** + * @param string $id the ID of the session on which to retrieve the items + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection the list of items + */ + public static function allLineItems($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_LINE_ITEMS, $params, $opts); + } +} diff --git a/app/api/Stripe/Collection.php b/app/api/Stripe/Collection.php new file mode 100755 index 0000000..7162be2 --- /dev/null +++ b/app/api/Stripe/Collection.php @@ -0,0 +1,282 @@ +filters; + } + + /** + * Sets the filters, removing paging options. + * + * @param array $filters the filters + */ + public function setFilters($filters) + { + $this->filters = $filters; + } + + public function offsetGet($k) + { + if (\is_string($k)) { + return parent::offsetGet($k); + } + $msg = "You tried to access the {$k} index, but Collection " . + 'types only support string keys. (HINT: List calls ' . + 'return an object with a `data` (which is the data ' . + "array). You likely want to call ->data[{$k}])"; + + throw new Exception\InvalidArgumentException($msg); + } + + public function all($params = null, $opts = null) + { + self::_validateParams($params); + list($url, $params) = $this->extractPathAndUpdateParams($params); + + list($response, $opts) = $this->_request('get', $url, $params, $opts); + $obj = Util\Util::convertToStripeObject($response, $opts); + if (!($obj instanceof \Stripe\Collection)) { + throw new \Stripe\Exception\UnexpectedValueException( + 'Expected type ' . \Stripe\Collection::class . ', got "' . \get_class($obj) . '" instead.' + ); + } + $obj->setFilters($params); + + return $obj; + } + + public function create($params = null, $opts = null) + { + self::_validateParams($params); + list($url, $params) = $this->extractPathAndUpdateParams($params); + + list($response, $opts) = $this->_request('post', $url, $params, $opts); + + return Util\Util::convertToStripeObject($response, $opts); + } + + public function retrieve($id, $params = null, $opts = null) + { + self::_validateParams($params); + list($url, $params) = $this->extractPathAndUpdateParams($params); + + $id = Util\Util::utf8($id); + $extn = \urlencode($id); + list($response, $opts) = $this->_request( + 'get', + "{$url}/{$extn}", + $params, + $opts + ); + + return Util\Util::convertToStripeObject($response, $opts); + } + + /** + * @return int the number of objects in the current page + */ + public function count() + { + return \count($this->data); + } + + /** + * @return \ArrayIterator an iterator that can be used to iterate + * across objects in the current page + */ + #[\ReturnTypeWillChange] + public function getIterator() + { + return new \ArrayIterator($this->data); + } + + /** + * @return \ArrayIterator an iterator that can be used to iterate + * backwards across objects in the current page + */ + public function getReverseIterator() + { + return new \ArrayIterator(\array_reverse($this->data)); + } + + /** + * @return \Generator|StripeObject[] A generator that can be used to + * iterate across all objects across all pages. As page boundaries are + * encountered, the next page will be fetched automatically for + * continued iteration. + */ + public function autoPagingIterator() + { + $page = $this; + + while (true) { + $filters = $this->filters ?: []; + if (\array_key_exists('ending_before', $filters) + && !\array_key_exists('starting_after', $filters)) { + foreach ($page->getReverseIterator() as $item) { + yield $item; + } + $page = $page->previousPage(); + } else { + foreach ($page as $item) { + yield $item; + } + $page = $page->nextPage(); + } + + if ($page->isEmpty()) { + break; + } + } + } + + /** + * Returns an empty collection. This is returned from {@see nextPage()} + * when we know that there isn't a next page in order to replicate the + * behavior of the API when it attempts to return a page beyond the last. + * + * @param null|array|string $opts + * + * @return Collection + */ + public static function emptyCollection($opts = null) + { + return Collection::constructFrom(['data' => []], $opts); + } + + /** + * Returns true if the page object contains no element. + * + * @return bool + */ + public function isEmpty() + { + return empty($this->data); + } + + /** + * Fetches the next page in the resource list (if there is one). + * + * This method will try to respect the limit of the current page. If none + * was given, the default limit will be fetched again. + * + * @param null|array $params + * @param null|array|string $opts + * + * @return Collection + */ + public function nextPage($params = null, $opts = null) + { + if (!$this->has_more) { + return static::emptyCollection($opts); + } + + $lastId = \end($this->data)->id; + + $params = \array_merge( + $this->filters ?: [], + ['starting_after' => $lastId], + $params ?: [] + ); + + return $this->all($params, $opts); + } + + /** + * Fetches the previous page in the resource list (if there is one). + * + * This method will try to respect the limit of the current page. If none + * was given, the default limit will be fetched again. + * + * @param null|array $params + * @param null|array|string $opts + * + * @return Collection + */ + public function previousPage($params = null, $opts = null) + { + if (!$this->has_more) { + return static::emptyCollection($opts); + } + + $firstId = $this->data[0]->id; + + $params = \array_merge( + $this->filters ?: [], + ['ending_before' => $firstId], + $params ?: [] + ); + + return $this->all($params, $opts); + } + + /** + * Gets the first item from the current page. Returns `null` if the current page is empty. + * + * @return null|\Stripe\StripeObject + */ + public function first() + { + return \count($this->data) > 0 ? $this->data[0] : null; + } + + /** + * Gets the last item from the current page. Returns `null` if the current page is empty. + * + * @return null|\Stripe\StripeObject + */ + public function last() + { + return \count($this->data) > 0 ? $this->data[\count($this->data) - 1] : null; + } + + private function extractPathAndUpdateParams($params) + { + $url = \parse_url($this->url); + if (!isset($url['path'])) { + throw new Exception\UnexpectedValueException("Could not parse list url into parts: {$url}"); + } + + if (isset($url['query'])) { + // If the URL contains a query param, parse it out into $params so they + // don't interact weirdly with each other. + $query = []; + \parse_str($url['query'], $query); + $params = \array_merge($params ?: [], $query); + } + + return [$url['path'], $params]; + } +} diff --git a/app/api/Stripe/CountrySpec.php b/app/api/Stripe/CountrySpec.php new file mode 100755 index 0000000..86b5738 --- /dev/null +++ b/app/api/Stripe/CountrySpec.php @@ -0,0 +1,30 @@ +an online guide. + * + * @property string $id Unique identifier for the object. Represented as the ISO country code for this country. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property string $default_currency The default currency for this country. This applies to both payment methods and bank accounts. + * @property \Stripe\StripeObject $supported_bank_account_currencies Currencies that can be accepted in the specific country (for transfers). + * @property string[] $supported_payment_currencies Currencies that can be accepted in the specified country (for payments). + * @property string[] $supported_payment_methods Payment methods available in the specified country. You may need to enable some payment methods (e.g., ACH) on your account before they appear in this list. The stripe payment method refers to charging through your platform. + * @property string[] $supported_transfer_countries Countries that can accept transfers from the specified country. + * @property \Stripe\StripeObject $verification_fields + */ +class CountrySpec extends ApiResource +{ + const OBJECT_NAME = 'country_spec'; + + use ApiOperations\All; + use ApiOperations\Retrieve; +} diff --git a/app/api/Stripe/Coupon.php b/app/api/Stripe/Coupon.php new file mode 100755 index 0000000..59a5cc2 --- /dev/null +++ b/app/api/Stripe/Coupon.php @@ -0,0 +1,41 @@ +invoices or orders. Coupons do + * not work with conventional one-off charges. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|int $amount_off Amount (in the currency specified) that will be taken off the subtotal of any invoices for this customer. + * @property \Stripe\StripeObject $applies_to + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string $currency If amount_off has been set, the three-letter ISO code for the currency of the amount to take off. + * @property string $duration One of forever, once, and repeating. Describes how long a customer who applies this coupon will get the discount. + * @property null|int $duration_in_months If duration is repeating, the number of months the coupon applies. Null if coupon duration is forever or once. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|int $max_redemptions Maximum number of times this coupon can be redeemed, in total, across all customers, before it is no longer valid. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|string $name Name of the coupon displayed to customers on for instance invoices or receipts. + * @property null|float $percent_off Percent that will be taken off the subtotal of any invoices for this customer for the duration of the coupon. For example, a coupon with percent_off of 50 will make a %s100 invoice %s50 instead. + * @property null|int $redeem_by Date after which the coupon can no longer be redeemed. + * @property int $times_redeemed Number of times this coupon has been applied to a customer. + * @property bool $valid Taking account of the above properties, whether this coupon can still be applied to a customer. + */ +class Coupon extends ApiResource +{ + const OBJECT_NAME = 'coupon'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Delete; + use ApiOperations\Retrieve; + use ApiOperations\Update; +} diff --git a/app/api/Stripe/CreditNote.php b/app/api/Stripe/CreditNote.php new file mode 100755 index 0000000..68bd0ed --- /dev/null +++ b/app/api/Stripe/CreditNote.php @@ -0,0 +1,111 @@ +Credit Notes. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount The integer amount in %s representing the total amount of the credit note, including tax. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property string|\Stripe\Customer $customer ID of the customer. + * @property null|string|\Stripe\CustomerBalanceTransaction $customer_balance_transaction Customer balance transaction related to this credit note. + * @property int $discount_amount The integer amount in %s representing the total amount of discount that was credited. + * @property \Stripe\StripeObject[] $discount_amounts The aggregate amounts calculated per discount for all line items. + * @property string|\Stripe\Invoice $invoice ID of the invoice. + * @property \Stripe\Collection $lines Line items that make up the credit note + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|string $memo Customer-facing text that appears on the credit note PDF. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property string $number A unique number that identifies this particular credit note and appears on the PDF of the credit note and its associated invoice. + * @property null|int $out_of_band_amount Amount that was credited outside of Stripe. + * @property string $pdf The link to download the PDF of the credit note. + * @property null|string $reason Reason for issuing this credit note, one of duplicate, fraudulent, order_change, or product_unsatisfactory + * @property null|string|\Stripe\Refund $refund Refund related to this credit note. + * @property string $status Status of this credit note, one of issued or void. Learn more about voiding credit notes. + * @property int $subtotal The integer amount in %s representing the amount of the credit note, excluding tax and invoice level discounts. + * @property \Stripe\StripeObject[] $tax_amounts The aggregate amounts calculated per tax rate for all line items. + * @property int $total The integer amount in %s representing the total amount of the credit note, including tax and all discount. + * @property string $type Type of this credit note, one of pre_payment or post_payment. A pre_payment credit note means it was issued when the invoice was open. A post_payment credit note means it was issued when the invoice was paid. + * @property null|int $voided_at The time that the credit note was voided. + */ +class CreditNote extends ApiResource +{ + const OBJECT_NAME = 'credit_note'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\NestedResource; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const REASON_DUPLICATE = 'duplicate'; + const REASON_FRAUDULENT = 'fraudulent'; + const REASON_ORDER_CHANGE = 'order_change'; + const REASON_PRODUCT_UNSATISFACTORY = 'product_unsatisfactory'; + + const STATUS_ISSUED = 'issued'; + const STATUS_VOID = 'void'; + + const TYPE_POST_PAYMENT = 'post_payment'; + const TYPE_PRE_PAYMENT = 'pre_payment'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CreditNote the previewed credit note + */ + public static function preview($params = null, $opts = null) + { + $url = static::classUrl() . '/preview'; + list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); + $obj->setLastResponse($response); + + return $obj; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return CreditNote the voided credit note + */ + public function voidCreditNote($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/void'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + const PATH_LINES = '/lines'; + + /** + * @param string $id the ID of the credit note on which to retrieve the credit note line items + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection the list of credit note line items + */ + public static function allLines($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_LINES, $params, $opts); + } +} diff --git a/app/api/Stripe/CreditNoteLineItem.php b/app/api/Stripe/CreditNoteLineItem.php new file mode 100755 index 0000000..1e1755e --- /dev/null +++ b/app/api/Stripe/CreditNoteLineItem.php @@ -0,0 +1,26 @@ +true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|int $quantity The number of units of product being credited. + * @property \Stripe\StripeObject[] $tax_amounts The amount of tax calculated per tax rate for this line item + * @property \Stripe\TaxRate[] $tax_rates The tax rates which apply to the line item. + * @property string $type The type of the credit note line item, one of invoice_line_item or custom_line_item. When the type is invoice_line_item there is an additional invoice_line_item property on the resource the value of which is the id of the credited line item on the invoice. + * @property null|int $unit_amount The cost of each unit of product being credited. + * @property null|string $unit_amount_decimal Same as unit_amount, but contains a decimal value with at most 12 decimal places. + */ +class CreditNoteLineItem extends ApiResource +{ + const OBJECT_NAME = 'credit_note_line_item'; +} diff --git a/app/api/Stripe/Customer.php b/app/api/Stripe/Customer.php new file mode 100755 index 0000000..3c306b3 --- /dev/null +++ b/app/api/Stripe/Customer.php @@ -0,0 +1,276 @@ +Customer objects allow you to perform recurring charges, and to + * track multiple charges, that are associated with the same customer. The API + * allows you to create, delete, and update your customers. You can retrieve + * individual customers as well as a list of all your customers. + * + * Related guide: Save a card during + * payment. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|\Stripe\StripeObject $address The customer's address. + * @property int $balance Current balance, if any, being stored on the customer. If negative, the customer has credit to apply to their next invoice. If positive, the customer has an amount owed that will be added to their next invoice. The balance does not refer to any unpaid invoices; it solely takes into account amounts that have yet to be successfully applied to any invoice. This balance is only taken into account as invoices are finalized. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string $currency Three-letter ISO code for the currency the customer can be charged in for recurring billing purposes. + * @property null|string|\Stripe\Account|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source $default_source

ID of the default payment source for the customer.

If you are using payment methods created via the PaymentMethods API, see the invoice_settings.default_payment_method field instead.

+ * @property null|bool $delinquent

When the customer's latest invoice is billed by charging automatically, delinquent is true if the invoice's latest charge failed. When the customer's latest invoice is billed by sending an invoice, delinquent is true if the invoice isn't paid by its due date.

If an invoice is marked uncollectible by dunning, delinquent doesn't get reset to false.

+ * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|\Stripe\Discount $discount Describes the current discount active on the customer, if there is one. + * @property null|string $email The customer's email address. + * @property null|string $invoice_prefix The prefix for the customer used to generate unique invoice numbers. + * @property \Stripe\StripeObject $invoice_settings + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|string $name The customer's full name or business name. + * @property int $next_invoice_sequence The suffix of the customer's next invoice number, e.g., 0001. + * @property null|string $phone The customer's phone number. + * @property null|string[] $preferred_locales The customer's preferred locales (languages), ordered by preference. + * @property null|\Stripe\StripeObject $shipping Mailing and shipping address for the customer. Appears on invoices emailed to this customer. + * @property \Stripe\Collection $sources The customer's payment sources, if any. + * @property \Stripe\Collection $subscriptions The customer's current subscriptions, if any. + * @property null|string $tax_exempt Describes the customer's tax exemption status. One of none, exempt, or reverse. When set to reverse, invoice and receipt PDFs include the text "Reverse charge". + * @property \Stripe\Collection $tax_ids The customer's tax IDs. + */ +class Customer extends ApiResource +{ + const OBJECT_NAME = 'customer'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Delete; + use ApiOperations\NestedResource; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const TAX_EXEMPT_EXEMPT = 'exempt'; + const TAX_EXEMPT_NONE = 'none'; + const TAX_EXEMPT_REVERSE = 'reverse'; + + public static function getSavedNestedResources() + { + static $savedNestedResources = null; + if (null === $savedNestedResources) { + $savedNestedResources = new Util\Set([ + 'source', + ]); + } + + return $savedNestedResources; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @return \Stripe\Customer the updated customer + */ + public function deleteDiscount($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/discount'; + list($response, $opts) = $this->_request('delete', $url, $params, $opts); + $this->refreshFrom(['discount' => null], $opts, true); + } + + const PATH_BALANCE_TRANSACTIONS = '/balance_transactions'; + + /** + * @param string $id the ID of the customer on which to retrieve the customer balance transactions + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection the list of customer balance transactions + */ + public static function allBalanceTransactions($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_BALANCE_TRANSACTIONS, $params, $opts); + } + + /** + * @param string $id the ID of the customer on which to create the customer balance transaction + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CustomerBalanceTransaction + */ + public static function createBalanceTransaction($id, $params = null, $opts = null) + { + return self::_createNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $params, $opts); + } + + /** + * @param string $id the ID of the customer to which the customer balance transaction belongs + * @param string $balanceTransactionId the ID of the customer balance transaction to retrieve + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CustomerBalanceTransaction + */ + public static function retrieveBalanceTransaction($id, $balanceTransactionId, $params = null, $opts = null) + { + return self::_retrieveNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $balanceTransactionId, $params, $opts); + } + + /** + * @param string $id the ID of the customer to which the customer balance transaction belongs + * @param string $balanceTransactionId the ID of the customer balance transaction to update + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CustomerBalanceTransaction + */ + public static function updateBalanceTransaction($id, $balanceTransactionId, $params = null, $opts = null) + { + return self::_updateNestedResource($id, static::PATH_BALANCE_TRANSACTIONS, $balanceTransactionId, $params, $opts); + } + + const PATH_SOURCES = '/sources'; + + /** + * @param string $id the ID of the customer on which to retrieve the payment sources + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection the list of payment sources (AlipayAccount, BankAccount, BitcoinReceiver, Card or Source) + */ + public static function allSources($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_SOURCES, $params, $opts); + } + + /** + * @param string $id the ID of the customer on which to create the payment source + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source + */ + public static function createSource($id, $params = null, $opts = null) + { + return self::_createNestedResource($id, static::PATH_SOURCES, $params, $opts); + } + + /** + * @param string $id the ID of the customer to which the payment source belongs + * @param string $sourceId the ID of the payment source to delete + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source + */ + public static function deleteSource($id, $sourceId, $params = null, $opts = null) + { + return self::_deleteNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts); + } + + /** + * @param string $id the ID of the customer to which the payment source belongs + * @param string $sourceId the ID of the payment source to retrieve + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source + */ + public static function retrieveSource($id, $sourceId, $params = null, $opts = null) + { + return self::_retrieveNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts); + } + + /** + * @param string $id the ID of the customer to which the payment source belongs + * @param string $sourceId the ID of the payment source to update + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source + */ + public static function updateSource($id, $sourceId, $params = null, $opts = null) + { + return self::_updateNestedResource($id, static::PATH_SOURCES, $sourceId, $params, $opts); + } + + const PATH_TAX_IDS = '/tax_ids'; + + /** + * @param string $id the ID of the customer on which to retrieve the tax ids + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection the list of tax ids + */ + public static function allTaxIds($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_TAX_IDS, $params, $opts); + } + + /** + * @param string $id the ID of the customer on which to create the tax id + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TaxId + */ + public static function createTaxId($id, $params = null, $opts = null) + { + return self::_createNestedResource($id, static::PATH_TAX_IDS, $params, $opts); + } + + /** + * @param string $id the ID of the customer to which the tax id belongs + * @param string $taxIdId the ID of the tax id to delete + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TaxId + */ + public static function deleteTaxId($id, $taxIdId, $params = null, $opts = null) + { + return self::_deleteNestedResource($id, static::PATH_TAX_IDS, $taxIdId, $params, $opts); + } + + /** + * @param string $id the ID of the customer to which the tax id belongs + * @param string $taxIdId the ID of the tax id to retrieve + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TaxId + */ + public static function retrieveTaxId($id, $taxIdId, $params = null, $opts = null) + { + return self::_retrieveNestedResource($id, static::PATH_TAX_IDS, $taxIdId, $params, $opts); + } +} diff --git a/app/api/Stripe/CustomerBalanceTransaction.php b/app/api/Stripe/CustomerBalanceTransaction.php new file mode 100755 index 0000000..ad3bc21 --- /dev/null +++ b/app/api/Stripe/CustomerBalanceTransaction.php @@ -0,0 +1,103 @@ +balance + * value, which denotes a debit or credit that's automatically applied to their + * next invoice upon finalization. You may modify the value directly by using the + * update customer API, + * or by creating a Customer Balance Transaction, which increments or decrements + * the customer's balance by the specified amount. + * + * Related guide: Customer Balance to + * learn more. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount The amount of the transaction. A negative value is a credit for the customer's balance, and a positive value is a debit to the customer's balance. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string|\Stripe\CreditNote $credit_note The ID of the credit note (if any) related to the transaction. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property string|\Stripe\Customer $customer The ID of the customer the transaction belongs to. + * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property int $ending_balance The customer's balance after the transaction was applied. A negative value decreases the amount due on the customer's next invoice. A positive value increases the amount due on the customer's next invoice. + * @property null|string|\Stripe\Invoice $invoice The ID of the invoice (if any) related to the transaction. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property string $type Transaction type: adjustment, applied_to_invoice, credit_note, initial, invoice_too_large, invoice_too_small, unspent_receiver_credit, or unapplied_from_invoice. See the Customer Balance page to learn more about transaction types. + */ +class CustomerBalanceTransaction extends ApiResource +{ + const OBJECT_NAME = 'customer_balance_transaction'; + + const TYPE_ADJUSTMENT = 'adjustment'; + const TYPE_APPLIED_TO_INVOICE = 'applied_to_invoice'; + const TYPE_CREDIT_NOTE = 'credit_note'; + const TYPE_INITIAL = 'initial'; + const TYPE_INVOICE_TOO_LARGE = 'invoice_too_large'; + const TYPE_INVOICE_TOO_SMALL = 'invoice_too_small'; + const TYPE_UNSPENT_RECEIVER_CREDIT = 'unspent_receiver_credit'; + + const TYPE_ADJUSTEMENT = 'adjustment'; + + /** + * @return string the API URL for this balance transaction + */ + public function instanceUrl() + { + $id = $this['id']; + $customer = $this['customer']; + if (!$id) { + throw new Exception\UnexpectedValueException( + "Could not determine which URL to request: class instance has invalid ID: {$id}", + null + ); + } + $id = Util\Util::utf8($id); + $customer = Util\Util::utf8($customer); + + $base = Customer::classUrl(); + $customerExtn = \urlencode($customer); + $extn = \urlencode($id); + + return "{$base}/{$customerExtn}/balance_transactions/{$extn}"; + } + + /** + * @param array|string $_id + * @param null|array|string $_opts + * + * @throws \Stripe\Exception\BadMethodCallException + */ + public static function retrieve($_id, $_opts = null) + { + $msg = 'Customer Balance Transactions cannot be retrieved without a ' . + 'customer ID. Retrieve a Customer Balance Transaction using ' . + "`Customer::retrieveBalanceTransaction('customer_id', " . + "'balance_transaction_id')`."; + + throw new Exception\BadMethodCallException($msg); + } + + /** + * @param string $_id + * @param null|array $_params + * @param null|array|string $_options + * + * @throws \Stripe\Exception\BadMethodCallException + */ + public static function update($_id, $_params = null, $_options = null) + { + $msg = 'Customer Balance Transactions cannot be updated without a ' . + 'customer ID. Update a Customer Balance Transaction using ' . + "`Customer::updateBalanceTransaction('customer_id', " . + "'balance_transaction_id', \$updateParams)`."; + + throw new Exception\BadMethodCallException($msg); + } +} diff --git a/app/api/Stripe/Discount.php b/app/api/Stripe/Discount.php new file mode 100755 index 0000000..ceb0d59 --- /dev/null +++ b/app/api/Stripe/Discount.php @@ -0,0 +1,23 @@ +Disputes and Fraud + * documentation. + * + * Related guide: Disputes and + * Fraud. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount Disputed amount. Usually the amount of the charge, but can differ (usually because of currency fluctuation or because only part of the order is disputed). + * @property \Stripe\BalanceTransaction[] $balance_transactions List of zero, one, or two balance transactions that show funds withdrawn and reinstated to your Stripe account as a result of this dispute. + * @property string|\Stripe\Charge $charge ID of the charge that was disputed. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property \Stripe\StripeObject $evidence + * @property \Stripe\StripeObject $evidence_details + * @property bool $is_charge_refundable If true, it is still possible to refund the disputed payment. Once the payment has been fully refunded, no further funds will be withdrawn from your Stripe account as a result of this dispute. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|string $network_reason_code Network-dependent reason code for the dispute. + * @property null|string|\Stripe\PaymentIntent $payment_intent ID of the PaymentIntent that was disputed. + * @property string $reason Reason given by cardholder for dispute. Possible values are bank_cannot_process, check_returned, credit_not_processed, customer_initiated, debit_not_authorized, duplicate, fraudulent, general, incorrect_account_details, insufficient_funds, product_not_received, product_unacceptable, subscription_canceled, or unrecognized. Read more about dispute reasons. + * @property string $status Current status of dispute. Possible values are warning_needs_response, warning_under_review, warning_closed, needs_response, under_review, charge_refunded, won, or lost. + */ +class Dispute extends ApiResource +{ + const OBJECT_NAME = 'dispute'; + + use ApiOperations\All; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const REASON_BANK_CANNOT_PROCESS = 'bank_cannot_process'; + const REASON_CHECK_RETURNED = 'check_returned'; + const REASON_CREDIT_NOT_PROCESSED = 'credit_not_processed'; + const REASON_CUSTOMER_INITIATED = 'customer_initiated'; + const REASON_DEBIT_NOT_AUTHORIZED = 'debit_not_authorized'; + const REASON_DUPLICATE = 'duplicate'; + const REASON_FRAUDULENT = 'fraudulent'; + const REASON_GENERAL = 'general'; + const REASON_INCORRECT_ACCOUNT_DETAILS = 'incorrect_account_details'; + const REASON_INSUFFICIENT_FUNDS = 'insufficient_funds'; + const REASON_PRODUCT_NOT_RECEIVED = 'product_not_received'; + const REASON_PRODUCT_UNACCEPTABLE = 'product_unacceptable'; + const REASON_SUBSCRIPTION_CANCELED = 'subscription_canceled'; + const REASON_UNRECOGNIZED = 'unrecognized'; + + const STATUS_CHARGE_REFUNDED = 'charge_refunded'; + const STATUS_LOST = 'lost'; + const STATUS_NEEDS_RESPONSE = 'needs_response'; + const STATUS_UNDER_REVIEW = 'under_review'; + const STATUS_WARNING_CLOSED = 'warning_closed'; + const STATUS_WARNING_NEEDS_RESPONSE = 'warning_needs_response'; + const STATUS_WARNING_UNDER_REVIEW = 'warning_under_review'; + const STATUS_WON = 'won'; + + /** + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Dispute the closed dispute + */ + // TODO: add $params to standardize signature + public function close($opts = null) + { + $url = $this->instanceUrl() . '/close'; + list($response, $opts) = $this->_request('post', $url, null, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/app/api/Stripe/EphemeralKey.php b/app/api/Stripe/EphemeralKey.php new file mode 100755 index 0000000..8822319 --- /dev/null +++ b/app/api/Stripe/EphemeralKey.php @@ -0,0 +1,43 @@ +true if the object exists in live mode or the value false if the object exists in test mode. + * @property string $secret The key's secret. You can use this value to make authorized requests to the Stripe API. + * @property array $associated_objects + */ +class EphemeralKey extends ApiResource +{ + const OBJECT_NAME = 'ephemeral_key'; + + use ApiOperations\Create { + create as protected _create; + } + + use ApiOperations\Delete; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\InvalidArgumentException if stripe_version is missing + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\EphemeralKey the created key + */ + public static function create($params = null, $opts = null) + { + if (!$opts || !isset($opts['stripe_version'])) { + throw new Exception\InvalidArgumentException('stripe_version must be specified to create an ephemeral key'); + } + + return self::_create($params, $opts); + } +} diff --git a/app/api/Stripe/ErrorObject.php b/app/api/Stripe/ErrorObject.php new file mode 100755 index 0000000..a5081c6 --- /dev/null +++ b/app/api/Stripe/ErrorObject.php @@ -0,0 +1,164 @@ + null, + 'code' => null, + 'decline_code' => null, + 'doc_url' => null, + 'message' => null, + 'param' => null, + 'payment_intent' => null, + 'payment_method' => null, + 'setup_intent' => null, + 'source' => null, + 'type' => null, + ], $values); + parent::refreshFrom($values, $opts, $partial); + } +} diff --git a/app/api/Stripe/Event.php b/app/api/Stripe/Event.php new file mode 100755 index 0000000..c25b64e --- /dev/null +++ b/app/api/Stripe/Event.php @@ -0,0 +1,231 @@ +Event object. For example, when a charge succeeds, we create a + * charge.succeeded event; and when an invoice payment attempt fails, + * we create an invoice.payment_failed event. Note that many API + * requests may cause multiple events to be created. For example, if you create a + * new subscription for a customer, you will receive both a + * customer.subscription.created event and a + * charge.succeeded event. + * + * Events occur when the state of another API resource changes. The state of that + * resource at the time of the change is embedded in the event's data field. For + * example, a charge.succeeded event will contain a charge, and an + * invoice.payment_failed event will contain an invoice. + * + * As with other API resources, you can use endpoints to retrieve an individual event or a list of events from the API. + * We also have a separate webhooks system for sending the + * Event objects directly to an endpoint on your server. Webhooks are + * managed in your account + * settings, and our Using + * Webhooks guide will help you get set up. + * + * When using Connect, you can also + * receive notifications of events that occur in connected accounts. For these + * events, there will be an additional account attribute in the + * received Event object. + * + * NOTE: Right now, access to events through the Retrieve Event API is + * guaranteed only for 30 days. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property string $account The connected account that originated the event. + * @property null|string $api_version The Stripe API version used to render data. Note: This property is populated only for events on or after October 31, 2014. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property \Stripe\StripeObject $data + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property int $pending_webhooks Number of webhooks that have yet to be successfully delivered (i.e., to return a 20x response) to the URLs you've specified. + * @property null|\Stripe\StripeObject $request Information on the API request that instigated the event. + * @property string $type Description of the event (e.g., invoice.created or charge.refunded). + */ +class Event extends ApiResource +{ + const OBJECT_NAME = 'event'; + + use ApiOperations\All; + use ApiOperations\Retrieve; + + /** + * Possible string representations of event types. + * + * @see https://stripe.com/docs/api#event_types + */ + const ACCOUNT_UPDATED = 'account.updated'; + const ACCOUNT_APPLICATION_AUTHORIZED = 'account.application.authorized'; + const ACCOUNT_APPLICATION_DEAUTHORIZED = 'account.application.deauthorized'; + const ACCOUNT_EXTERNAL_ACCOUNT_CREATED = 'account.external_account.created'; + const ACCOUNT_EXTERNAL_ACCOUNT_DELETED = 'account.external_account.deleted'; + const ACCOUNT_EXTERNAL_ACCOUNT_UPDATED = 'account.external_account.updated'; + const APPLICATION_FEE_CREATED = 'application_fee.created'; + const APPLICATION_FEE_REFUNDED = 'application_fee.refunded'; + const APPLICATION_FEE_REFUND_UPDATED = 'application_fee.refund.updated'; + const BALANCE_AVAILABLE = 'balance.available'; + const CAPABILITY_UPDATED = 'capability.updated'; + const CHARGE_CAPTURED = 'charge.captured'; + const CHARGE_EXPIRED = 'charge.expired'; + const CHARGE_FAILED = 'charge.failed'; + const CHARGE_PENDING = 'charge.pending'; + const CHARGE_REFUNDED = 'charge.refunded'; + const CHARGE_SUCCEEDED = 'charge.succeeded'; + const CHARGE_UPDATED = 'charge.updated'; + const CHARGE_DISPUTE_CLOSED = 'charge.dispute.closed'; + const CHARGE_DISPUTE_CREATED = 'charge.dispute.created'; + const CHARGE_DISPUTE_FUNDS_REINSTATED = 'charge.dispute.funds_reinstated'; + const CHARGE_DISPUTE_FUNDS_WITHDRAWN = 'charge.dispute.funds_withdrawn'; + const CHARGE_DISPUTE_UPDATED = 'charge.dispute.updated'; + const CHARGE_REFUND_UPDATED = 'charge.refund.updated'; + const CHECKOUT_SESSION_ASYNC_PAYMENT_FAILED = 'checkout.session.async_payment_failed'; + const CHECKOUT_SESSION_ASYNC_PAYMENT_SUCCEEDED = 'checkout.session.async_payment_succeeded'; + const CHECKOUT_SESSION_COMPLETED = 'checkout.session.completed'; + const COUPON_CREATED = 'coupon.created'; + const COUPON_DELETED = 'coupon.deleted'; + const COUPON_UPDATED = 'coupon.updated'; + const CREDIT_NOTE_CREATED = 'credit_note.created'; + const CREDIT_NOTE_UPDATED = 'credit_note.updated'; + const CREDIT_NOTE_VOIDED = 'credit_note.voided'; + const CUSTOMER_CREATED = 'customer.created'; + const CUSTOMER_DELETED = 'customer.deleted'; + const CUSTOMER_UPDATED = 'customer.updated'; + const CUSTOMER_DISCOUNT_CREATED = 'customer.discount.created'; + const CUSTOMER_DISCOUNT_DELETED = 'customer.discount.deleted'; + const CUSTOMER_DISCOUNT_UPDATED = 'customer.discount.updated'; + const CUSTOMER_SOURCE_CREATED = 'customer.source.created'; + const CUSTOMER_SOURCE_DELETED = 'customer.source.deleted'; + const CUSTOMER_SOURCE_EXPIRING = 'customer.source.expiring'; + const CUSTOMER_SOURCE_UPDATED = 'customer.source.updated'; + const CUSTOMER_SUBSCRIPTION_CREATED = 'customer.subscription.created'; + const CUSTOMER_SUBSCRIPTION_DELETED = 'customer.subscription.deleted'; + const CUSTOMER_SUBSCRIPTION_PENDING_UPDATE_APPLIED = 'customer.subscription.pending_update_applied'; + const CUSTOMER_SUBSCRIPTION_PENDING_UPDATE_EXPIRED = 'customer.subscription.pending_update_expired'; + const CUSTOMER_SUBSCRIPTION_TRIAL_WILL_END = 'customer.subscription.trial_will_end'; + const CUSTOMER_SUBSCRIPTION_UPDATED = 'customer.subscription.updated'; + const CUSTOMER_TAX_ID_CREATED = 'customer.tax_id.created'; + const CUSTOMER_TAX_ID_DELETED = 'customer.tax_id.deleted'; + const CUSTOMER_TAX_ID_UPDATED = 'customer.tax_id.updated'; + const FILE_CREATED = 'file.created'; + const INVOICE_CREATED = 'invoice.created'; + const INVOICE_DELETED = 'invoice.deleted'; + const INVOICE_FINALIZATION_FAILED = 'invoice.finalization_failed'; + const INVOICE_FINALIZED = 'invoice.finalized'; + const INVOICE_MARKED_UNCOLLECTIBLE = 'invoice.marked_uncollectible'; + const INVOICE_PAID = 'invoice.paid'; + const INVOICE_PAYMENT_ACTION_REQUIRED = 'invoice.payment_action_required'; + const INVOICE_PAYMENT_FAILED = 'invoice.payment_failed'; + const INVOICE_PAYMENT_SUCCEEDED = 'invoice.payment_succeeded'; + const INVOICE_SENT = 'invoice.sent'; + const INVOICE_UPCOMING = 'invoice.upcoming'; + const INVOICE_UPDATED = 'invoice.updated'; + const INVOICE_VOIDED = 'invoice.voided'; + const INVOICEITEM_CREATED = 'invoiceitem.created'; + const INVOICEITEM_DELETED = 'invoiceitem.deleted'; + const INVOICEITEM_UPDATED = 'invoiceitem.updated'; + const ISSUER_FRAUD_RECORD_CREATED = 'issuer_fraud_record.created'; + const ISSUING_AUTHORIZATION_CREATED = 'issuing_authorization.created'; + const ISSUING_AUTHORIZATION_REQUEST = 'issuing_authorization.request'; + const ISSUING_AUTHORIZATION_UPDATED = 'issuing_authorization.updated'; + const ISSUING_CARD_CREATED = 'issuing_card.created'; + const ISSUING_CARD_UPDATED = 'issuing_card.updated'; + const ISSUING_CARDHOLDER_CREATED = 'issuing_cardholder.created'; + const ISSUING_CARDHOLDER_UPDATED = 'issuing_cardholder.updated'; + const ISSUING_DISPUTE_CLOSED = 'issuing_dispute.closed'; + const ISSUING_DISPUTE_CREATED = 'issuing_dispute.created'; + const ISSUING_DISPUTE_FUNDS_REINSTATED = 'issuing_dispute.funds_reinstated'; + const ISSUING_DISPUTE_SUBMITTED = 'issuing_dispute.submitted'; + const ISSUING_DISPUTE_UPDATED = 'issuing_dispute.updated'; + const ISSUING_TRANSACTION_CREATED = 'issuing_transaction.created'; + const ISSUING_TRANSACTION_UPDATED = 'issuing_transaction.updated'; + const MANDATE_UPDATED = 'mandate.updated'; + const ORDER_CREATED = 'order.created'; + const ORDER_PAYMENT_FAILED = 'order.payment_failed'; + const ORDER_PAYMENT_SUCCEEDED = 'order.payment_succeeded'; + const ORDER_UPDATED = 'order.updated'; + const ORDER_RETURN_CREATED = 'order_return.created'; + const PAYMENT_INTENT_AMOUNT_CAPTURABLE_UPDATED = 'payment_intent.amount_capturable_updated'; + const PAYMENT_INTENT_CANCELED = 'payment_intent.canceled'; + const PAYMENT_INTENT_CREATED = 'payment_intent.created'; + const PAYMENT_INTENT_PAYMENT_FAILED = 'payment_intent.payment_failed'; + const PAYMENT_INTENT_PROCESSING = 'payment_intent.processing'; + const PAYMENT_INTENT_REQUIRES_ACTION = 'payment_intent.requires_action'; + const PAYMENT_INTENT_SUCCEEDED = 'payment_intent.succeeded'; + const PAYMENT_METHOD_ATTACHED = 'payment_method.attached'; + const PAYMENT_METHOD_AUTOMATICALLY_UPDATED = 'payment_method.automatically_updated'; + const PAYMENT_METHOD_CARD_AUTOMATICALLY_UPDATED = 'payment_method.card_automatically_updated'; + const PAYMENT_METHOD_DETACHED = 'payment_method.detached'; + const PAYMENT_METHOD_UPDATED = 'payment_method.updated'; + const PAYOUT_CANCELED = 'payout.canceled'; + const PAYOUT_CREATED = 'payout.created'; + const PAYOUT_FAILED = 'payout.failed'; + const PAYOUT_PAID = 'payout.paid'; + const PAYOUT_UPDATED = 'payout.updated'; + const PERSON_CREATED = 'person.created'; + const PERSON_DELETED = 'person.deleted'; + const PERSON_UPDATED = 'person.updated'; + const PING = 'ping'; + const PLAN_CREATED = 'plan.created'; + const PLAN_DELETED = 'plan.deleted'; + const PLAN_UPDATED = 'plan.updated'; + const PRICE_CREATED = 'price.created'; + const PRICE_DELETED = 'price.deleted'; + const PRICE_UPDATED = 'price.updated'; + const PRODUCT_CREATED = 'product.created'; + const PRODUCT_DELETED = 'product.deleted'; + const PRODUCT_UPDATED = 'product.updated'; + const PROMOTION_CODE_CREATED = 'promotion_code.created'; + const PROMOTION_CODE_DELETED = 'promotion_code.deleted'; + const PROMOTION_CODE_UPDATED = 'promotion_code.updated'; + const RADAR_EARLY_FRAUD_WARNING_CREATED = 'radar.early_fraud_warning.created'; + const RADAR_EARLY_FRAUD_WARNING_UPDATED = 'radar.early_fraud_warning.updated'; + const RECIPIENT_CREATED = 'recipient.created'; + const RECIPIENT_DELETED = 'recipient.deleted'; + const RECIPIENT_UPDATED = 'recipient.updated'; + const REPORTING_REPORT_RUN_FAILED = 'reporting.report_run.failed'; + const REPORTING_REPORT_RUN_SUCCEEDED = 'reporting.report_run.succeeded'; + const REPORTING_REPORT_TYPE_UPDATED = 'reporting.report_type.updated'; + const REVIEW_CLOSED = 'review.closed'; + const REVIEW_OPENED = 'review.opened'; + const SETUP_INTENT_CANCELED = 'setup_intent.canceled'; + const SETUP_INTENT_CREATED = 'setup_intent.created'; + const SETUP_INTENT_REQUIRES_ACTION = 'setup_intent.requires_action'; + const SETUP_INTENT_SETUP_FAILED = 'setup_intent.setup_failed'; + const SETUP_INTENT_SUCCEEDED = 'setup_intent.succeeded'; + const SIGMA_SCHEDULED_QUERY_RUN_CREATED = 'sigma.scheduled_query_run.created'; + const SKU_CREATED = 'sku.created'; + const SKU_DELETED = 'sku.deleted'; + const SKU_UPDATED = 'sku.updated'; + const SOURCE_CANCELED = 'source.canceled'; + const SOURCE_CHARGEABLE = 'source.chargeable'; + const SOURCE_FAILED = 'source.failed'; + const SOURCE_MANDATE_NOTIFICATION = 'source.mandate_notification'; + const SOURCE_REFUND_ATTRIBUTES_REQUIRED = 'source.refund_attributes_required'; + const SOURCE_TRANSACTION_CREATED = 'source.transaction.created'; + const SOURCE_TRANSACTION_UPDATED = 'source.transaction.updated'; + const SUBSCRIPTION_SCHEDULE_ABORTED = 'subscription_schedule.aborted'; + const SUBSCRIPTION_SCHEDULE_CANCELED = 'subscription_schedule.canceled'; + const SUBSCRIPTION_SCHEDULE_COMPLETED = 'subscription_schedule.completed'; + const SUBSCRIPTION_SCHEDULE_CREATED = 'subscription_schedule.created'; + const SUBSCRIPTION_SCHEDULE_EXPIRING = 'subscription_schedule.expiring'; + const SUBSCRIPTION_SCHEDULE_RELEASED = 'subscription_schedule.released'; + const SUBSCRIPTION_SCHEDULE_UPDATED = 'subscription_schedule.updated'; + const TAX_RATE_CREATED = 'tax_rate.created'; + const TAX_RATE_UPDATED = 'tax_rate.updated'; + const TOPUP_CANCELED = 'topup.canceled'; + const TOPUP_CREATED = 'topup.created'; + const TOPUP_FAILED = 'topup.failed'; + const TOPUP_REVERSED = 'topup.reversed'; + const TOPUP_SUCCEEDED = 'topup.succeeded'; + const TRANSFER_CREATED = 'transfer.created'; + const TRANSFER_REVERSED = 'transfer.reversed'; + const TRANSFER_UPDATED = 'transfer.updated'; +} diff --git a/app/api/Stripe/Exception/ApiConnectionException.php b/app/api/Stripe/Exception/ApiConnectionException.php new file mode 100755 index 0000000..1abc974 --- /dev/null +++ b/app/api/Stripe/Exception/ApiConnectionException.php @@ -0,0 +1,12 @@ +setHttpStatus($httpStatus); + $instance->setHttpBody($httpBody); + $instance->setJsonBody($jsonBody); + $instance->setHttpHeaders($httpHeaders); + $instance->setStripeCode($stripeCode); + + $instance->setRequestId(null); + if ($httpHeaders && isset($httpHeaders['Request-Id'])) { + $instance->setRequestId($httpHeaders['Request-Id']); + } + + $instance->setError($instance->constructErrorObject()); + + return $instance; + } + + /** + * Gets the Stripe error object. + * + * @return null|\Stripe\ErrorObject + */ + public function getError() + { + return $this->error; + } + + /** + * Sets the Stripe error object. + * + * @param null|\Stripe\ErrorObject $error + */ + public function setError($error) + { + $this->error = $error; + } + + /** + * Gets the HTTP body as a string. + * + * @return null|string + */ + public function getHttpBody() + { + return $this->httpBody; + } + + /** + * Sets the HTTP body as a string. + * + * @param null|string $httpBody + */ + public function setHttpBody($httpBody) + { + $this->httpBody = $httpBody; + } + + /** + * Gets the HTTP headers array. + * + * @return null|array|\Stripe\Util\CaseInsensitiveArray + */ + public function getHttpHeaders() + { + return $this->httpHeaders; + } + + /** + * Sets the HTTP headers array. + * + * @param null|array|\Stripe\Util\CaseInsensitiveArray $httpHeaders + */ + public function setHttpHeaders($httpHeaders) + { + $this->httpHeaders = $httpHeaders; + } + + /** + * Gets the HTTP status code. + * + * @return null|int + */ + public function getHttpStatus() + { + return $this->httpStatus; + } + + /** + * Sets the HTTP status code. + * + * @param null|int $httpStatus + */ + public function setHttpStatus($httpStatus) + { + $this->httpStatus = $httpStatus; + } + + /** + * Gets the JSON deserialized body. + * + * @return null|array + */ + public function getJsonBody() + { + return $this->jsonBody; + } + + /** + * Sets the JSON deserialized body. + * + * @param null|array $jsonBody + */ + public function setJsonBody($jsonBody) + { + $this->jsonBody = $jsonBody; + } + + /** + * Gets the Stripe request ID. + * + * @return null|string + */ + public function getRequestId() + { + return $this->requestId; + } + + /** + * Sets the Stripe request ID. + * + * @param null|string $requestId + */ + public function setRequestId($requestId) + { + $this->requestId = $requestId; + } + + /** + * Gets the Stripe error code. + * + * Cf. the `CODE_*` constants on {@see \Stripe\ErrorObject} for possible + * values. + * + * @return null|string + */ + public function getStripeCode() + { + return $this->stripeCode; + } + + /** + * Sets the Stripe error code. + * + * @param null|string $stripeCode + */ + public function setStripeCode($stripeCode) + { + $this->stripeCode = $stripeCode; + } + + /** + * Returns the string representation of the exception. + * + * @return string + */ + public function __toString() + { + $statusStr = (null === $this->getHttpStatus()) ? '' : "(Status {$this->getHttpStatus()}) "; + $idStr = (null === $this->getRequestId()) ? '' : "(Request {$this->getRequestId()}) "; + + return "{$statusStr}{$idStr}{$this->getMessage()}"; + } + + protected function constructErrorObject() + { + if (null === $this->jsonBody || !\array_key_exists('error', $this->jsonBody)) { + return null; + } + + return \Stripe\ErrorObject::constructFrom($this->jsonBody['error']); + } +} diff --git a/app/api/Stripe/Exception/AuthenticationException.php b/app/api/Stripe/Exception/AuthenticationException.php new file mode 100755 index 0000000..bd9356b --- /dev/null +++ b/app/api/Stripe/Exception/AuthenticationException.php @@ -0,0 +1,11 @@ +setDeclineCode($declineCode); + $instance->setStripeParam($stripeParam); + + return $instance; + } + + /** + * Gets the decline code. + * + * @return null|string + */ + public function getDeclineCode() + { + return $this->declineCode; + } + + /** + * Sets the decline code. + * + * @param null|string $declineCode + */ + public function setDeclineCode($declineCode) + { + $this->declineCode = $declineCode; + } + + /** + * Gets the parameter related to the error. + * + * @return null|string + */ + public function getStripeParam() + { + return $this->stripeParam; + } + + /** + * Sets the parameter related to the error. + * + * @param null|string $stripeParam + */ + public function setStripeParam($stripeParam) + { + $this->stripeParam = $stripeParam; + } +} diff --git a/app/api/Stripe/Exception/ExceptionInterface.php b/app/api/Stripe/Exception/ExceptionInterface.php new file mode 100755 index 0000000..a0ccea9 --- /dev/null +++ b/app/api/Stripe/Exception/ExceptionInterface.php @@ -0,0 +1,22 @@ +setStripeParam($stripeParam); + + return $instance; + } + + /** + * Gets the parameter related to the error. + * + * @return null|string + */ + public function getStripeParam() + { + return $this->stripeParam; + } + + /** + * Sets the parameter related to the error. + * + * @param null|string $stripeParam + */ + public function setStripeParam($stripeParam) + { + $this->stripeParam = $stripeParam; + } +} diff --git a/app/api/Stripe/Exception/OAuth/ExceptionInterface.php b/app/api/Stripe/Exception/OAuth/ExceptionInterface.php new file mode 100755 index 0000000..bc1986f --- /dev/null +++ b/app/api/Stripe/Exception/OAuth/ExceptionInterface.php @@ -0,0 +1,10 @@ +jsonBody) { + return null; + } + + return \Stripe\OAuthErrorObject::constructFrom($this->jsonBody); + } +} diff --git a/app/api/Stripe/Exception/OAuth/UnknownOAuthErrorException.php b/app/api/Stripe/Exception/OAuth/UnknownOAuthErrorException.php new file mode 100755 index 0000000..f1d6f94 --- /dev/null +++ b/app/api/Stripe/Exception/OAuth/UnknownOAuthErrorException.php @@ -0,0 +1,12 @@ +setHttpBody($httpBody); + $instance->setSigHeader($sigHeader); + + return $instance; + } + + /** + * Gets the HTTP body as a string. + * + * @return null|string + */ + public function getHttpBody() + { + return $this->httpBody; + } + + /** + * Sets the HTTP body as a string. + * + * @param null|string $httpBody + */ + public function setHttpBody($httpBody) + { + $this->httpBody = $httpBody; + } + + /** + * Gets the `Stripe-Signature` HTTP header. + * + * @return null|string + */ + public function getSigHeader() + { + return $this->sigHeader; + } + + /** + * Sets the `Stripe-Signature` HTTP header. + * + * @param null|string $sigHeader + */ + public function setSigHeader($sigHeader) + { + $this->sigHeader = $sigHeader; + } +} diff --git a/app/api/Stripe/Exception/UnexpectedValueException.php b/app/api/Stripe/Exception/UnexpectedValueException.php new file mode 100755 index 0000000..5270eeb --- /dev/null +++ b/app/api/Stripe/Exception/UnexpectedValueException.php @@ -0,0 +1,7 @@ +Exchange Rate objects allow you to determine the rates that Stripe + * is currently using to convert from one currency to another. Since this number is + * variable throughout the day, there are various reasons why you might want to + * know the current rate (for example, to dynamically price an item for a user with + * a default payment in a foreign currency). + * + * If you want a guarantee that the charge is made with a certain exchange rate you + * expect is current, you can pass in exchange_rate to charges + * endpoints. If the value is no longer up to date, the charge won't go through. + * Please refer to our Exchange + * Rates API guide for more details. + * + * @property string $id Unique identifier for the object. Represented as the three-letter ISO currency code in lowercase. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property \Stripe\StripeObject $rates Hash where the keys are supported currencies and the values are the exchange rate at which the base id currency converts to the key currency. + */ +class ExchangeRate extends ApiResource +{ + const OBJECT_NAME = 'exchange_rate'; + + use ApiOperations\All; + use ApiOperations\Retrieve; +} diff --git a/app/api/Stripe/File.php b/app/api/Stripe/File.php new file mode 100755 index 0000000..8a835f6 --- /dev/null +++ b/app/api/Stripe/File.php @@ -0,0 +1,82 @@ +create file request (for + * example, when uploading dispute evidence) or it may have been created by Stripe + * (for example, the results of a Sigma scheduled + * query). + * + * Related guide: File Upload + * Guide. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|int $expires_at The time at which the file expires and is no longer available in epoch seconds. + * @property null|string $filename A filename for the file, suitable for saving to a filesystem. + * @property null|\Stripe\Collection $links A list of file links that point at this file. + * @property string $purpose The purpose of the uploaded file. + * @property int $size The size in bytes of the file object. + * @property null|string $title A user friendly title for the document. + * @property null|string $type The type of the file returned (e.g., csv, pdf, jpg, or png). + * @property null|string $url The URL from which the file can be downloaded using your live secret API key. + */ +class File extends ApiResource +{ + const OBJECT_NAME = 'file'; + + use ApiOperations\All; + use ApiOperations\Retrieve; + + const PURPOSE_ACCOUNT_REQUIREMENT = 'account_requirement'; + const PURPOSE_ADDITIONAL_VERIFICATION = 'additional_verification'; + const PURPOSE_BUSINESS_ICON = 'business_icon'; + const PURPOSE_BUSINESS_LOGO = 'business_logo'; + const PURPOSE_CUSTOMER_SIGNATURE = 'customer_signature'; + const PURPOSE_DISPUTE_EVIDENCE = 'dispute_evidence'; + const PURPOSE_IDENTITY_DOCUMENT = 'identity_document'; + const PURPOSE_PCI_DOCUMENT = 'pci_document'; + const PURPOSE_TAX_DOCUMENT_USER_UPLOAD = 'tax_document_user_upload'; + + // This resource can have two different object names. In latter API + // versions, only `file` is used, but since stripe-php may be used with + // any API version, we need to support deserializing the older + // `file_upload` object into the same class. + const OBJECT_NAME_ALT = 'file_upload'; + + use ApiOperations\Create { + create as protected _create; + } + + public static function classUrl() + { + return '/v1/files'; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\File the created file + */ + public static function create($params = null, $opts = null) + { + $opts = \Stripe\Util\RequestOptions::parse($opts); + if (null === $opts->apiBase) { + $opts->apiBase = Stripe::$apiUploadBase; + } + // Manually flatten params, otherwise curl's multipart encoder will + // choke on nested arrays. + $flatParams = \array_column(\Stripe\Util\Util::flattenParams($params), 1, 0); + + return static::_create($flatParams, $opts); + } +} diff --git a/app/api/Stripe/FileLink.php b/app/api/Stripe/FileLink.php new file mode 100755 index 0000000..23eab02 --- /dev/null +++ b/app/api/Stripe/FileLink.php @@ -0,0 +1,30 @@ +File object with non-Stripe users, you + * can create a FileLink. FileLinks contain a URL that + * can be used to retrieve the contents of the file without authentication. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property bool $expired Whether this link is already expired. + * @property null|int $expires_at Time at which the link expires. + * @property string|\Stripe\File $file The file object this link points to. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|string $url The publicly accessible URL to download the file. + */ +class FileLink extends ApiResource +{ + const OBJECT_NAME = 'file_link'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; +} diff --git a/app/api/Stripe/HttpClient/ClientInterface.php b/app/api/Stripe/HttpClient/ClientInterface.php new file mode 100755 index 0000000..0dca25b --- /dev/null +++ b/app/api/Stripe/HttpClient/ClientInterface.php @@ -0,0 +1,22 @@ +defaultOptions = $defaultOptions; + $this->randomGenerator = $randomGenerator ?: new Util\RandomGenerator(); + $this->initUserAgentInfo(); + + $this->enableHttp2 = $this->canSafelyUseHttp2(); + } + + public function __destruct() + { + $this->closeCurlHandle(); + } + + public function initUserAgentInfo() + { + $curlVersion = \curl_version(); + $this->userAgentInfo = [ + 'httplib' => 'curl ' . $curlVersion['version'], + 'ssllib' => $curlVersion['ssl_version'], + ]; + } + + public function getDefaultOptions() + { + return $this->defaultOptions; + } + + public function getUserAgentInfo() + { + return $this->userAgentInfo; + } + + /** + * @return bool + */ + public function getEnablePersistentConnections() + { + return $this->enablePersistentConnections; + } + + /** + * @param bool $enable + */ + public function setEnablePersistentConnections($enable) + { + $this->enablePersistentConnections = $enable; + } + + /** + * @return bool + */ + public function getEnableHttp2() + { + return $this->enableHttp2; + } + + /** + * @param bool $enable + */ + public function setEnableHttp2($enable) + { + $this->enableHttp2 = $enable; + } + + /** + * @return null|callable + */ + public function getRequestStatusCallback() + { + return $this->requestStatusCallback; + } + + /** + * Sets a callback that is called after each request. The callback will + * receive the following parameters: + *
    + *
  1. string $rbody The response body
  2. + *
  3. integer $rcode The response status code
  4. + *
  5. \Stripe\Util\CaseInsensitiveArray $rheaders The response headers
  6. + *
  7. integer $errno The curl error number
  8. + *
  9. string|null $message The curl error message
  10. + *
  11. boolean $shouldRetry Whether the request will be retried
  12. + *
  13. integer $numRetries The number of the retry attempt
  14. + *
. + * + * @param null|callable $requestStatusCallback + */ + public function setRequestStatusCallback($requestStatusCallback) + { + $this->requestStatusCallback = $requestStatusCallback; + } + + // USER DEFINED TIMEOUTS + + const DEFAULT_TIMEOUT = 80; + const DEFAULT_CONNECT_TIMEOUT = 30; + + private $timeout = self::DEFAULT_TIMEOUT; + private $connectTimeout = self::DEFAULT_CONNECT_TIMEOUT; + + public function setTimeout($seconds) + { + $this->timeout = (int) \max($seconds, 0); + + return $this; + } + + public function setConnectTimeout($seconds) + { + $this->connectTimeout = (int) \max($seconds, 0); + + return $this; + } + + public function getTimeout() + { + return $this->timeout; + } + + public function getConnectTimeout() + { + return $this->connectTimeout; + } + + // END OF USER DEFINED TIMEOUTS + + public function request($method, $absUrl, $headers, $params, $hasFile) + { + $opts = []; + if (\is_callable($this->defaultOptions)) { // call defaultOptions callback, set options to return value + $opts = \call_user_func_array($this->defaultOptions, \func_get_args()); + if (!\is_array($opts)) { + throw new Exception\UnexpectedValueException('Non-array value returned by defaultOptions CurlClient callback'); + } + } elseif (\is_array($this->defaultOptions)) { // set default curlopts from array + $opts = $this->defaultOptions; + } + + $method = \strtolower($method); + + $params = Util\Util::objectsToIds($params); + + if ('get' === $method) { + if ($hasFile) { + throw new Exception\UnexpectedValueException( + 'Issuing a GET request with a file parameter' + ); + } + $opts[\CURLOPT_HTTPGET] = 1; + if (\count($params) > 0) { + $encoded = Util\Util::encodeParameters($params); + $absUrl = "{$absUrl}?{$encoded}"; + } + } elseif ('post' === $method) { + $opts[\CURLOPT_POST] = 1; + $opts[\CURLOPT_POSTFIELDS] = $hasFile ? $params : Util\Util::encodeParameters($params); + } elseif ('delete' === $method) { + $opts[\CURLOPT_CUSTOMREQUEST] = 'DELETE'; + if (\count($params) > 0) { + $encoded = Util\Util::encodeParameters($params); + $absUrl = "{$absUrl}?{$encoded}"; + } + } else { + throw new Exception\UnexpectedValueException("Unrecognized method {$method}"); + } + + // It is only safe to retry network failures on POST requests if we + // add an Idempotency-Key header + if (('post' === $method) && (Stripe::$maxNetworkRetries > 0)) { + if (!$this->hasHeader($headers, 'Idempotency-Key')) { + $headers[] = 'Idempotency-Key: ' . $this->randomGenerator->uuid(); + } + } + + // By default for large request body sizes (> 1024 bytes), cURL will + // send a request without a body and with a `Expect: 100-continue` + // header, which gives the server a chance to respond with an error + // status code in cases where one can be determined right away (say + // on an authentication problem for example), and saves the "large" + // request body from being ever sent. + // + // Unfortunately, the bindings don't currently correctly handle the + // success case (in which the server sends back a 100 CONTINUE), so + // we'll error under that condition. To compensate for that problem + // for the time being, override cURL's behavior by simply always + // sending an empty `Expect:` header. + $headers[] = 'Expect: '; + + $absUrl = Util\Util::utf8($absUrl); + $opts[\CURLOPT_URL] = $absUrl; + $opts[\CURLOPT_RETURNTRANSFER] = true; + $opts[\CURLOPT_CONNECTTIMEOUT] = $this->connectTimeout; + $opts[\CURLOPT_TIMEOUT] = $this->timeout; + $opts[\CURLOPT_HTTPHEADER] = $headers; + $opts[\CURLOPT_CAINFO] = Stripe::getCABundlePath(); + if (!Stripe::getVerifySslCerts()) { + $opts[\CURLOPT_SSL_VERIFYPEER] = false; + } + + if (!isset($opts[\CURLOPT_HTTP_VERSION]) && $this->getEnableHttp2()) { + // For HTTPS requests, enable HTTP/2, if supported + $opts[\CURLOPT_HTTP_VERSION] = \CURL_HTTP_VERSION_2TLS; + } + + // Stripe's API servers are only accessible over IPv4. Force IPv4 resolving to avoid + // potential issues (cf. https://github.com/stripe/stripe-php/issues/1045). + $opts[\CURLOPT_IPRESOLVE] = \CURL_IPRESOLVE_V4; + + list($rbody, $rcode, $rheaders) = $this->executeRequestWithRetries($opts, $absUrl); + + return [$rbody, $rcode, $rheaders]; + } + + /** + * @param array $opts cURL options + * @param string $absUrl + */ + private function executeRequestWithRetries($opts, $absUrl) + { + $numRetries = 0; + + while (true) { + $rcode = 0; + $errno = 0; + $message = null; + + // Create a callback to capture HTTP headers for the response + $rheaders = new Util\CaseInsensitiveArray(); + $headerCallback = function ($curl, $header_line) use (&$rheaders) { + // Ignore the HTTP request line (HTTP/1.1 200 OK) + if (false === \strpos($header_line, ':')) { + return \strlen($header_line); + } + list($key, $value) = \explode(':', \trim($header_line), 2); + $rheaders[\trim($key)] = \trim($value); + + return \strlen($header_line); + }; + $opts[\CURLOPT_HEADERFUNCTION] = $headerCallback; + + $this->resetCurlHandle(); + \curl_setopt_array($this->curlHandle, $opts); + $rbody = \curl_exec($this->curlHandle); + + if (false === $rbody) { + $errno = \curl_errno($this->curlHandle); + $message = \curl_error($this->curlHandle); + } else { + $rcode = \curl_getinfo($this->curlHandle, \CURLINFO_HTTP_CODE); + } + if (!$this->getEnablePersistentConnections()) { + $this->closeCurlHandle(); + } + + $shouldRetry = $this->shouldRetry($errno, $rcode, $rheaders, $numRetries); + + if (\is_callable($this->getRequestStatusCallback())) { + \call_user_func_array( + $this->getRequestStatusCallback(), + [$rbody, $rcode, $rheaders, $errno, $message, $shouldRetry, $numRetries] + ); + } + + if ($shouldRetry) { + ++$numRetries; + $sleepSeconds = $this->sleepTime($numRetries, $rheaders); + \usleep((int) ($sleepSeconds * 1000000)); + } else { + break; + } + } + + if (false === $rbody) { + $this->handleCurlError($absUrl, $errno, $message, $numRetries); + } + + return [$rbody, $rcode, $rheaders]; + } + + /** + * @param string $url + * @param int $errno + * @param string $message + * @param int $numRetries + * + * @throws Exception\ApiConnectionException + */ + private function handleCurlError($url, $errno, $message, $numRetries) + { + switch ($errno) { + case \CURLE_COULDNT_CONNECT: + case \CURLE_COULDNT_RESOLVE_HOST: + case \CURLE_OPERATION_TIMEOUTED: + $msg = "Could not connect to Stripe ({$url}). Please check your " + . 'internet connection and try again. If this problem persists, ' + . "you should check Stripe's service status at " + . 'https://twitter.com/stripestatus, or'; + + break; + + case \CURLE_SSL_CACERT: + case \CURLE_SSL_PEER_CERTIFICATE: + $msg = "Could not verify Stripe's SSL certificate. Please make sure " + . 'that your network is not intercepting certificates. ' + . "(Try going to {$url} in your browser.) " + . 'If this problem persists,'; + + break; + + default: + $msg = 'Unexpected error communicating with Stripe. ' + . 'If this problem persists,'; + } + $msg .= ' let us know at support@stripe.com.'; + + $msg .= "\n\n(Network error [errno {$errno}]: {$message})"; + + if ($numRetries > 0) { + $msg .= "\n\nRequest was retried {$numRetries} times."; + } + + throw new Exception\ApiConnectionException($msg); + } + + /** + * Checks if an error is a problem that we should retry on. This includes both + * socket errors that may represent an intermittent problem and some special + * HTTP statuses. + * + * @param int $errno + * @param int $rcode + * @param array|\Stripe\Util\CaseInsensitiveArray $rheaders + * @param int $numRetries + * + * @return bool + */ + private function shouldRetry($errno, $rcode, $rheaders, $numRetries) + { + if ($numRetries >= Stripe::getMaxNetworkRetries()) { + return false; + } + + // Retry on timeout-related problems (either on open or read). + if (\CURLE_OPERATION_TIMEOUTED === $errno) { + return true; + } + + // Destination refused the connection, the connection was reset, or a + // variety of other connection failures. This could occur from a single + // saturated server, so retry in case it's intermittent. + if (\CURLE_COULDNT_CONNECT === $errno) { + return true; + } + + // The API may ask us not to retry (eg; if doing so would be a no-op) + // or advise us to retry (eg; in cases of lock timeouts); we defer to that. + if (isset($rheaders['stripe-should-retry'])) { + if ('false' === $rheaders['stripe-should-retry']) { + return false; + } + if ('true' === $rheaders['stripe-should-retry']) { + return true; + } + } + + // 409 Conflict + if (409 === $rcode) { + return true; + } + + // Retry on 500, 503, and other internal errors. + // + // Note that we expect the stripe-should-retry header to be false + // in most cases when a 500 is returned, since our idempotency framework + // would typically replay it anyway. + if ($rcode >= 500) { + return true; + } + + return false; + } + + /** + * Provides the number of seconds to wait before retrying a request. + * + * @param int $numRetries + * @param array|\Stripe\Util\CaseInsensitiveArray $rheaders + * + * @return int + */ + private function sleepTime($numRetries, $rheaders) + { + // Apply exponential backoff with $initialNetworkRetryDelay on the + // number of $numRetries so far as inputs. Do not allow the number to exceed + // $maxNetworkRetryDelay. + $sleepSeconds = \min( + Stripe::getInitialNetworkRetryDelay() * 1.0 * 2 ** ($numRetries - 1), + Stripe::getMaxNetworkRetryDelay() + ); + + // Apply some jitter by randomizing the value in the range of + // ($sleepSeconds / 2) to ($sleepSeconds). + $sleepSeconds *= 0.5 * (1 + $this->randomGenerator->randFloat()); + + // But never sleep less than the base sleep seconds. + $sleepSeconds = \max(Stripe::getInitialNetworkRetryDelay(), $sleepSeconds); + + // And never sleep less than the time the API asks us to wait, assuming it's a reasonable ask. + $retryAfter = isset($rheaders['retry-after']) ? (float) ($rheaders['retry-after']) : 0.0; + if (\floor($retryAfter) === $retryAfter && $retryAfter <= Stripe::getMaxRetryAfter()) { + $sleepSeconds = \max($sleepSeconds, $retryAfter); + } + + return $sleepSeconds; + } + + /** + * Initializes the curl handle. If already initialized, the handle is closed first. + */ + private function initCurlHandle() + { + $this->closeCurlHandle(); + $this->curlHandle = \curl_init(); + } + + /** + * Closes the curl handle if initialized. Do nothing if already closed. + */ + private function closeCurlHandle() + { + if (null !== $this->curlHandle) { + \curl_close($this->curlHandle); + $this->curlHandle = null; + } + } + + /** + * Resets the curl handle. If the handle is not already initialized, or if persistent + * connections are disabled, the handle is reinitialized instead. + */ + private function resetCurlHandle() + { + if (null !== $this->curlHandle && $this->getEnablePersistentConnections()) { + \curl_reset($this->curlHandle); + } else { + $this->initCurlHandle(); + } + } + + /** + * Indicates whether it is safe to use HTTP/2 or not. + * + * @return bool + */ + private function canSafelyUseHttp2() + { + // Versions of curl older than 7.60.0 don't respect GOAWAY frames + // (cf. https://github.com/curl/curl/issues/2416), which Stripe use. + $curlVersion = \curl_version()['version']; + + return \version_compare($curlVersion, '7.60.0') >= 0; + } + + /** + * Checks if a list of headers contains a specific header name. + * + * @param string[] $headers + * @param string $name + * + * @return bool + */ + private function hasHeader($headers, $name) + { + foreach ($headers as $header) { + if (0 === \strncasecmp($header, "{$name}: ", \strlen($name) + 2)) { + return true; + } + } + + return false; + } +} diff --git a/app/api/Stripe/HttpClient/data/ca-certificates.crt b/app/api/Stripe/HttpClient/data/ca-certificates.crt new file mode 100755 index 0000000..9b9492b --- /dev/null +++ b/app/api/Stripe/HttpClient/data/ca-certificates.crt @@ -0,0 +1,3646 @@ +## +## Bundle of CA Root Certificates +## +## Certificate data from Mozilla as of: Wed Sep 20 03:12:05 2017 GMT +## +## This is a bundle of X.509 certificates of public Certificate Authorities +## (CA). These were automatically extracted from Mozilla's root certificates +## file (certdata.txt). This file can be found in the mozilla source tree: +## https://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt +## +## It contains the certificates in PEM format and therefore +## can be directly used with curl / libcurl / php_curl, or with +## an Apache+mod_ssl webserver for SSL client authentication. +## Just configure this file as the SSLCACertificateFile. +## +## Conversion done with mk-ca-bundle.pl version 1.27. +## SHA256: 2b2dbe5244e0047e088c597998883a913f6c5fffd1cb5c0fe5a368c8466cb2ec +## + + +GlobalSign Root CA +================== +-----BEGIN CERTIFICATE----- +MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkGA1UEBhMCQkUx +GTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jvb3QgQ0ExGzAZBgNVBAMTEkds +b2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAwMDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNV +BAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYD +VQQDExJHbG9iYWxTaWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDa +DuaZjc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavpxy0Sy6sc +THAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp1Wrjsok6Vjk4bwY8iGlb +Kk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdGsnUOhugZitVtbNV4FpWi6cgKOOvyJBNP +c1STE4U6G7weNLWLBYy5d4ux2x8gkasJU26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrX +gzT/LCrBbBlDSgeF59N89iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV +HRMBAf8EBTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0BAQUF +AAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOzyj1hTdNGCbM+w6Dj +Y1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE38NflNUVyRRBnMRddWQVDf9VMOyG +j/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymPAbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhH +hm4qxFYxldBniYUr+WymXUadDKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveC +X4XSQRjbgbMEHMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A== +-----END CERTIFICATE----- + +GlobalSign Root CA - R2 +======================= +-----BEGIN CERTIFICATE----- +MIIDujCCAqKgAwIBAgILBAAAAAABD4Ym5g0wDQYJKoZIhvcNAQEFBQAwTDEgMB4GA1UECxMXR2xv +YmFsU2lnbiBSb290IENBIC0gUjIxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh +bFNpZ24wHhcNMDYxMjE1MDgwMDAwWhcNMjExMjE1MDgwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxT +aWduIFJvb3QgQ0EgLSBSMjETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2ln +bjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKbPJA6+Lm8omUVCxKs+IVSbC9N/hHD6 +ErPLv4dfxn+G07IwXNb9rfF73OX4YJYJkhD10FPe+3t+c4isUoh7SqbKSaZeqKeMWhG8eoLrvozp +s6yWJQeXSpkqBy+0Hne/ig+1AnwblrjFuTosvNYSuetZfeLQBoZfXklqtTleiDTsvHgMCJiEbKjN +S7SgfQx5TfC4LcshytVsW33hoCmEofnTlEnLJGKRILzdC9XZzPnqJworc5HGnRusyMvo4KD0L5CL +TfuwNhv2GXqF4G3yYROIXJ/gkwpRl4pazq+r1feqCapgvdzZX99yqWATXgAByUr6P6TqBwMhAo6C +ygPCm48CAwEAAaOBnDCBmTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4E +FgQUm+IHV2ccHsBqBt5ZtJot39wZhi4wNgYDVR0fBC8wLTAroCmgJ4YlaHR0cDovL2NybC5nbG9i +YWxzaWduLm5ldC9yb290LXIyLmNybDAfBgNVHSMEGDAWgBSb4gdXZxwewGoG3lm0mi3f3BmGLjAN +BgkqhkiG9w0BAQUFAAOCAQEAmYFThxxol4aR7OBKuEQLq4GsJ0/WwbgcQ3izDJr86iw8bmEbTUsp +9Z8FHSbBuOmDAGJFtqkIk7mpM0sYmsL4h4hO291xNBrBVNpGP+DTKqttVCL1OmLNIG+6KYnX3ZHu +01yiPqFbQfXf5WRDLenVOavSot+3i9DAgBkcRcAtjOj4LaR0VknFBbVPFd5uRHg5h6h+u/N5GJG7 +9G+dwfCMNYxdAfvDbbnvRG15RjF+Cv6pgsH/76tuIMRQyV+dTZsXjAzlAcmgQWpzU/qlULRuJQ/7 +TBj0/VLZjmmx6BEP3ojY+x1J96relc8geMJgEtslQIxq/H5COEBkEveegeGTLg== +-----END CERTIFICATE----- + +Verisign Class 3 Public Primary Certification Authority - G3 +============================================================ +-----BEGIN CERTIFICATE----- +MIIEGjCCAwICEQCbfgZJoz5iudXukEhxKe9XMA0GCSqGSIb3DQEBBQUAMIHKMQswCQYDVQQGEwJV +UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv +cmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl +IG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkgQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkgLSBHMzAeFw05OTEwMDEwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMIHKMQsw +CQYDVQQGEwJVUzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRy +dXN0IE5ldHdvcmsxOjA4BgNVBAsTMShjKSAxOTk5IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhv +cml6ZWQgdXNlIG9ubHkxRTBDBgNVBAMTPFZlcmlTaWduIENsYXNzIDMgUHVibGljIFByaW1hcnkg +Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBAMu6nFL8eB8aHm8bN3O9+MlrlBIwT/A2R/XQkQr1F8ilYcEWQE37imGQ5XYgwREGfassbqb1 +EUGO+i2tKmFZpGcmTNDovFJbcCAEWNF6yaRpvIMXZK0Fi7zQWM6NjPXr8EJJC52XJ2cybuGukxUc +cLwgTS8Y3pKI6GyFVxEa6X7jJhFUokWWVYPKMIno3Nij7SqAP395ZVc+FSBmCC+Vk7+qRy+oRpfw +EuL+wgorUeZ25rdGt+INpsyow0xZVYnm6FNcHOqd8GIWC6fJXwzw3sJ2zq/3avL6QaaiMxTJ5Xpj +055iN9WFZZ4O5lMkdBteHRJTW8cs54NJOxWuimi5V5cCAwEAATANBgkqhkiG9w0BAQUFAAOCAQEA +ERSWwauSCPc/L8my/uRan2Te2yFPhpk0djZX3dAVL8WtfxUfN2JzPtTnX84XA9s1+ivbrmAJXx5f +j267Cz3qWhMeDGBvtcC1IyIuBwvLqXTLR7sdwdela8wv0kL9Sd2nic9TutoAWii/gt/4uhMdUIaC +/Y4wjylGsB49Ndo4YhYYSq3mtlFs3q9i6wHQHiT+eo8SGhJouPtmmRQURVyu565pF4ErWjfJXir0 +xuKhXFSbplQAz/DxwceYMBo7Nhbbo27q/a2ywtrvAkcTisDxszGtTxzhT5yvDwyd93gN2PQ1VoDa +t20Xj50egWTh/sVFuq1ruQp6Tk9LhO5L8X3dEQ== +-----END CERTIFICATE----- + +Entrust.net Premium 2048 Secure Server CA +========================================= +-----BEGIN CERTIFICATE----- +MIIEKjCCAxKgAwIBAgIEOGPe+DANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChMLRW50cnVzdC5u +ZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBpbmNvcnAuIGJ5IHJlZi4gKGxp +bWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNV +BAMTKkVudHJ1c3QubmV0IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQx +NzUwNTFaFw0yOTA3MjQxNDE1MTJaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3 +d3d3LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTEl +MCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEGA1UEAxMqRW50cnVzdC5u +ZXQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgKDIwNDgpMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEArU1LqRKGsuqjIAcVFmQqK0vRvwtKTY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOL +Gp18EzoOH1u3Hs/lJBQesYGpjX24zGtLA/ECDNyrpUAkAH90lKGdCCmziAv1h3edVc3kw37XamSr +hRSGlVuXMlBvPci6Zgzj/L24ScF2iUkZ/cCovYmjZy/Gn7xxGWC4LeksyZB2ZnuU4q941mVTXTzW +nLLPKQP5L6RQstRIzgUyVYr9smRMDuSYB3Xbf9+5CFVghTAp+XtIpGmG4zU/HoZdenoVve8AjhUi +VBcAkCaTvA5JaJG/+EfTnZVCwQ5N328mz8MYIWJmQ3DW1cAH4QIDAQABo0IwQDAOBgNVHQ8BAf8E +BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUVeSB0RGAvtiJuQijMfmhJAkWuXAwDQYJ +KoZIhvcNAQEFBQADggEBADubj1abMOdTmXx6eadNl9cZlZD7Bh/KM3xGY4+WZiT6QBshJ8rmcnPy +T/4xmf3IDExoU8aAghOY+rat2l098c5u9hURlIIM7j+VrxGrD9cv3h8Dj1csHsm7mhpElesYT6Yf +zX1XEC+bBAlahLVu2B064dae0Wx5XnkcFMXj0EyTO2U87d89vqbllRrDtRnDvV5bu/8j72gZyxKT +J1wDLW8w0B62GqzeWvfRqqgnpv55gcR5mTNXuhKwqeBCbJPKVt7+bYQLCIt+jerXmCHG8+c8eS9e +nNFMFY3h7CI3zJpDC5fcgJCNs2ebb0gIFVbPv/ErfF6adulZkMV8gzURZVE= +-----END CERTIFICATE----- + +Baltimore CyberTrust Root +========================= +-----BEGIN CERTIFICATE----- +MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJRTESMBAGA1UE +ChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYDVQQDExlCYWx0aW1vcmUgQ3li +ZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoXDTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMC +SUUxEjAQBgNVBAoTCUJhbHRpbW9yZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFs +dGltb3JlIEN5YmVyVHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKME +uyKrmD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjrIZ3AQSsB +UnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeKmpYcqWe4PwzV9/lSEy/C +G9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSuXmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9 +XbIGevOF6uvUA65ehD5f/xXtabz5OTZydc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjpr +l3RjM71oGDHweI12v/yejl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoI +VDaGezq1BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEB +BQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT929hkTI7gQCvlYpNRh +cL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3WgxjkzSswF07r51XgdIGn9w/xZchMB5 +hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsa +Y71k5h+3zvDyny67G7fyUIhzksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9H +RCwBXbsdtTLSR9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp +-----END CERTIFICATE----- + +AddTrust External Root +====================== +-----BEGIN CERTIFICATE----- +MIIENjCCAx6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBvMQswCQYDVQQGEwJTRTEUMBIGA1UEChML +QWRkVHJ1c3QgQUIxJjAkBgNVBAsTHUFkZFRydXN0IEV4dGVybmFsIFRUUCBOZXR3b3JrMSIwIAYD +VQQDExlBZGRUcnVzdCBFeHRlcm5hbCBDQSBSb290MB4XDTAwMDUzMDEwNDgzOFoXDTIwMDUzMDEw +NDgzOFowbzELMAkGA1UEBhMCU0UxFDASBgNVBAoTC0FkZFRydXN0IEFCMSYwJAYDVQQLEx1BZGRU +cnVzdCBFeHRlcm5hbCBUVFAgTmV0d29yazEiMCAGA1UEAxMZQWRkVHJ1c3QgRXh0ZXJuYWwgQ0Eg +Um9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALf3GjPm8gAELTngTlvtH7xsD821 ++iO2zt6bETOXpClMfZOfvUq8k+0DGuOPz+VtUFrWlymUWoCwSXrbLpX9uMq/NzgtHj6RQa1wVsfw +Tz/oMp50ysiQVOnGXw94nZpAPA6sYapeFI+eh6FqUNzXmk6vBbOmcZSccbNQYArHE504B4YCqOmo +aSYYkKtMsE8jqzpPhNjfzp/haW+710LXa0Tkx63ubUFfclpxCDezeWWkWaCUN/cALw3CknLa0Dhy +2xSoRcRdKn23tNbE7qzNE0S3ySvdQwAl+mG5aWpYIxG3pzOPVnVZ9c0p10a3CitlttNCbxWyuHv7 +7+ldU9U0WicCAwEAAaOB3DCB2TAdBgNVHQ4EFgQUrb2YejS0Jvf6xCZU7wO94CTLVBowCwYDVR0P +BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wgZkGA1UdIwSBkTCBjoAUrb2YejS0Jvf6xCZU7wO94CTL +VBqhc6RxMG8xCzAJBgNVBAYTAlNFMRQwEgYDVQQKEwtBZGRUcnVzdCBBQjEmMCQGA1UECxMdQWRk +VHJ1c3QgRXh0ZXJuYWwgVFRQIE5ldHdvcmsxIjAgBgNVBAMTGUFkZFRydXN0IEV4dGVybmFsIENB +IFJvb3SCAQEwDQYJKoZIhvcNAQEFBQADggEBALCb4IUlwtYj4g+WBpKdQZic2YR5gdkeWxQHIzZl +j7DYd7usQWxHYINRsPkyPef89iYTx4AWpb9a/IfPeHmJIZriTAcKhjW88t5RxNKWt9x+Tu5w/Rw5 +6wwCURQtjr0W4MHfRnXnJK3s9EK0hZNwEGe6nQY1ShjTK3rMUUKhemPR5ruhxSvCNr4TDea9Y355 +e6cJDUCrat2PisP29owaQgVR1EX1n6diIWgVIEM8med8vSTYqZEXc4g/VhsxOBi0cQ+azcgOno4u +G+GMmIPLHzHxREzGBHNJdmAPx/i9F4BrLunMTA5amnkPIAou1Z5jJh5VkpTYghdae9C8x49OhgQ= +-----END CERTIFICATE----- + +Entrust Root Certification Authority +==================================== +-----BEGIN CERTIFICATE----- +MIIEkTCCA3mgAwIBAgIERWtQVDANBgkqhkiG9w0BAQUFADCBsDELMAkGA1UEBhMCVVMxFjAUBgNV +BAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5lbnRydXN0Lm5ldC9DUFMgaXMgaW5jb3Jw +b3JhdGVkIGJ5IHJlZmVyZW5jZTEfMB0GA1UECxMWKGMpIDIwMDYgRW50cnVzdCwgSW5jLjEtMCsG +A1UEAxMkRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA2MTEyNzIwMjM0 +MloXDTI2MTEyNzIwNTM0MlowgbAxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMu +MTkwNwYDVQQLEzB3d3cuZW50cnVzdC5uZXQvQ1BTIGlzIGluY29ycG9yYXRlZCBieSByZWZlcmVu +Y2UxHzAdBgNVBAsTFihjKSAyMDA2IEVudHJ1c3QsIEluYy4xLTArBgNVBAMTJEVudHJ1c3QgUm9v +dCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +ALaVtkNC+sZtKm9I35RMOVcF7sN5EUFoNu3s/poBj6E4KPz3EEZmLk0eGrEaTsbRwJWIsMn/MYsz +A9u3g3s+IIRe7bJWKKf44LlAcTfFy0cOlypowCKVYhXbR9n10Cv/gkvJrT7eTNuQgFA/CYqEAOww +Cj0Yzfv9KlmaI5UXLEWeH25DeW0MXJj+SKfFI0dcXv1u5x609mhF0YaDW6KKjbHjKYD+JXGIrb68 +j6xSlkuqUY3kEzEZ6E5Nn9uss2rVvDlUccp6en+Q3X0dgNmBu1kmwhH+5pPi94DkZfs0Nw4pgHBN +rziGLp5/V6+eF67rHMsoIV+2HNjnogQi+dPa2MsCAwEAAaOBsDCBrTAOBgNVHQ8BAf8EBAMCAQYw +DwYDVR0TAQH/BAUwAwEB/zArBgNVHRAEJDAigA8yMDA2MTEyNzIwMjM0MlqBDzIwMjYxMTI3MjA1 +MzQyWjAfBgNVHSMEGDAWgBRokORnpKZTgMeGZqTx90tD+4S9bTAdBgNVHQ4EFgQUaJDkZ6SmU4DH +hmak8fdLQ/uEvW0wHQYJKoZIhvZ9B0EABBAwDhsIVjcuMTo0LjADAgSQMA0GCSqGSIb3DQEBBQUA +A4IBAQCT1DCw1wMgKtD5Y+iRDAUgqV8ZyntyTtSx29CW+1RaGSwMCPeyvIWonX9tO1KzKtvn1ISM +Y/YPyyYBkVBs9F8U4pN0wBOeMDpQ47RgxRzwIkSNcUesyBrJ6ZuaAGAT/3B+XxFNSRuzFVJ7yVTa +v52Vr2ua2J7p8eRDjeIRRDq/r72DQnNSi6q7pynP9WQcCk3RvKqsnyrQ/39/2n3qse0wJcGE2jTS +W3iDVuycNsMm4hH2Z0kdkquM++v/eu6FSqdQgPCnXEqULl8FmTxSQeDNtGPPAUO6nIPcj2A781q0 +tHuu2guQOHXvgR1m0vdXcDazv/wor3ElhVsT/h5/WrQ8 +-----END CERTIFICATE----- + +GeoTrust Global CA +================== +-----BEGIN CERTIFICATE----- +MIIDVDCCAjygAwIBAgIDAjRWMA0GCSqGSIb3DQEBBQUAMEIxCzAJBgNVBAYTAlVTMRYwFAYDVQQK +Ew1HZW9UcnVzdCBJbmMuMRswGQYDVQQDExJHZW9UcnVzdCBHbG9iYWwgQ0EwHhcNMDIwNTIxMDQw +MDAwWhcNMjIwNTIxMDQwMDAwWjBCMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5j +LjEbMBkGA1UEAxMSR2VvVHJ1c3QgR2xvYmFsIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB +CgKCAQEA2swYYzD99BcjGlZ+W988bDjkcbd4kdS8odhM+KhDtgPpTSEHCIjaWC9mOSm9BXiLnTjo +BbdqfnGk5sRgprDvgOSJKA+eJdbtg/OtppHHmMlCGDUUna2YRpIuT8rxh0PBFpVXLVDviS2Aelet +8u5fa9IAjbkU+BQVNdnARqN7csiRv8lVK83Qlz6cJmTM386DGXHKTubU1XupGc1V3sjs0l44U+Vc +T4wt/lAjNvxm5suOpDkZALeVAjmRCw7+OC7RHQWa9k0+bw8HHa8sHo9gOeL6NlMTOdReJivbPagU +vTLrGAMoUgRx5aszPeE4uwc2hGKceeoWMPRfwCvocWvk+QIDAQABo1MwUTAPBgNVHRMBAf8EBTAD +AQH/MB0GA1UdDgQWBBTAephojYn7qwVkDBF9qn1luMrMTjAfBgNVHSMEGDAWgBTAephojYn7qwVk +DBF9qn1luMrMTjANBgkqhkiG9w0BAQUFAAOCAQEANeMpauUvXVSOKVCUn5kaFOSPeCpilKInZ57Q +zxpeR+nBsqTP3UEaBU6bS+5Kb1VSsyShNwrrZHYqLizz/Tt1kL/6cdjHPTfStQWVYrmm3ok9Nns4 +d0iXrKYgjy6myQzCsplFAMfOEVEiIuCl6rYVSAlk6l5PdPcFPseKUgzbFbS9bZvlxrFUaKnjaZC2 +mqUPuLk/IH2uSrW4nOQdtqvmlKXBx4Ot2/Unhw4EbNX/3aBd7YdStysVAq45pmp06drE57xNNB6p +XE0zX5IJL4hmXXeXxx12E6nV5fEWCRE11azbJHFwLJhWC9kXtNHjUStedejV0NxPNO3CBWaAocvm +Mw== +-----END CERTIFICATE----- + +GeoTrust Universal CA +===================== +-----BEGIN CERTIFICATE----- +MIIFaDCCA1CgAwIBAgIBATANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN +R2VvVHJ1c3QgSW5jLjEeMBwGA1UEAxMVR2VvVHJ1c3QgVW5pdmVyc2FsIENBMB4XDTA0MDMwNDA1 +MDAwMFoXDTI5MDMwNDA1MDAwMFowRTELMAkGA1UEBhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IElu +Yy4xHjAcBgNVBAMTFUdlb1RydXN0IFVuaXZlcnNhbCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIP +ADCCAgoCggIBAKYVVaCjxuAfjJ0hUNfBvitbtaSeodlyWL0AG0y/YckUHUWCq8YdgNY96xCcOq9t +JPi8cQGeBvV8Xx7BDlXKg5pZMK4ZyzBIle0iN430SppyZj6tlcDgFgDgEB8rMQ7XlFTTQjOgNB0e +RXbdT8oYN+yFFXoZCPzVx5zw8qkuEKmS5j1YPakWaDwvdSEYfyh3peFhF7em6fgemdtzbvQKoiFs +7tqqhZJmr/Z6a4LauiIINQ/PQvE1+mrufislzDoR5G2vc7J2Ha3QsnhnGqQ5HFELZ1aD/ThdDc7d +8Lsrlh/eezJS/R27tQahsiFepdaVaH/wmZ7cRQg+59IJDTWU3YBOU5fXtQlEIGQWFwMCTFMNaN7V +qnJNk22CDtucvc+081xdVHppCZbW2xHBjXWotM85yM48vCR85mLK4b19p71XZQvk/iXttmkQ3Cga +Rr0BHdCXteGYO8A3ZNY9lO4L4fUorgtWv3GLIylBjobFS1J72HGrH4oVpjuDWtdYAVHGTEHZf9hB +Z3KiKN9gg6meyHv8U3NyWfWTehd2Ds735VzZC1U0oqpbtWpU5xPKV+yXbfReBi9Fi1jUIxaS5BZu +KGNZMN9QAZxjiRqf2xeUgnA3wySemkfWWspOqGmJch+RbNt+nhutxx9z3SxPGWX9f5NAEC7S8O08 +ni4oPmkmM8V7AgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNq7LqqwDLiIJlF0 +XG0D08DYj3rWMB8GA1UdIwQYMBaAFNq7LqqwDLiIJlF0XG0D08DYj3rWMA4GA1UdDwEB/wQEAwIB +hjANBgkqhkiG9w0BAQUFAAOCAgEAMXjmx7XfuJRAyXHEqDXsRh3ChfMoWIawC/yOsjmPRFWrZIRc +aanQmjg8+uUfNeVE44B5lGiku8SfPeE0zTBGi1QrlaXv9z+ZhP015s8xxtxqv6fXIwjhmF7DWgh2 +qaavdy+3YL1ERmrvl/9zlcGO6JP7/TG37FcREUWbMPEaiDnBTzynANXH/KttgCJwpQzgXQQpAvvL +oJHRfNbDflDVnVi+QTjruXU8FdmbyUqDWcDaU/0zuzYYm4UPFd3uLax2k7nZAY1IEKj79TiG8dsK +xr2EoyNB3tZ3b4XUhRxQ4K5RirqNPnbiucon8l+f725ZDQbYKxek0nxru18UGkiPGkzns0ccjkxF +KyDuSN/n3QmOGKjaQI2SJhFTYXNd673nxE0pN2HrrDktZy4W1vUAg4WhzH92xH3kt0tm7wNFYGm2 +DFKWkoRepqO1pD4r2czYG0eq8kTaT/kD6PAUyz/zg97QwVTjt+gKN02LIFkDMBmhLMi9ER/frslK +xfMnZmaGrGiR/9nmUxwPi1xpZQomyB40w11Re9epnAahNt3ViZS82eQtDF4JbAiXfKM9fJP/P6EU +p8+1Xevb2xzEdt+Iub1FBZUbrvxGakyvSOPOrg/SfuvmbJxPgWp6ZKy7PtXny3YuxadIwVyQD8vI +P/rmMuGNG2+k5o7Y+SlIis5z/iw= +-----END CERTIFICATE----- + +GeoTrust Universal CA 2 +======================= +-----BEGIN CERTIFICATE----- +MIIFbDCCA1SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBHMQswCQYDVQQGEwJVUzEWMBQGA1UEChMN +R2VvVHJ1c3QgSW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVyc2FsIENBIDIwHhcNMDQwMzA0 +MDUwMDAwWhcNMjkwMzA0MDUwMDAwWjBHMQswCQYDVQQGEwJVUzEWMBQGA1UEChMNR2VvVHJ1c3Qg +SW5jLjEgMB4GA1UEAxMXR2VvVHJ1c3QgVW5pdmVyc2FsIENBIDIwggIiMA0GCSqGSIb3DQEBAQUA +A4ICDwAwggIKAoICAQCzVFLByT7y2dyxUxpZKeexw0Uo5dfR7cXFS6GqdHtXr0om/Nj1XqduGdt0 +DE81WzILAePb63p3NeqqWuDW6KFXlPCQo3RWlEQwAx5cTiuFJnSCegx2oG9NzkEtoBUGFF+3Qs17 +j1hhNNwqCPkuwwGmIkQcTAeC5lvO0Ep8BNMZcyfwqph/Lq9O64ceJHdqXbboW0W63MOhBW9Wjo8Q +JqVJwy7XQYci4E+GymC16qFjwAGXEHm9ADwSbSsVsaxLse4YuU6W3Nx2/zu+z18DwPw76L5GG//a +QMJS9/7jOvdqdzXQ2o3rXhhqMcceujwbKNZrVMaqW9eiLBsZzKIC9ptZvTdrhrVtgrrY6slWvKk2 +WP0+GfPtDCapkzj4T8FdIgbQl+rhrcZV4IErKIM6+vR7IVEAvlI4zs1meaj0gVbi0IMJR1FbUGrP +20gaXT73y/Zl92zxlfgCOzJWgjl6W70viRu/obTo/3+NjN8D8WBOWBFM66M/ECuDmgFz2ZRthAAn +ZqzwcEAJQpKtT5MNYQlRJNiS1QuUYbKHsu3/mjX/hVTK7URDrBs8FmtISgocQIgfksILAAX/8sgC +SqSqqcyZlpwvWOB94b67B9xfBHJcMTTD7F8t4D1kkCLm0ey4Lt1ZrtmhN79UNdxzMk+MBB4zsslG +8dhcyFVQyWi9qLo2CQIDAQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBR281Xh+qQ2 ++/CfXGJx7Tz0RzgQKzAfBgNVHSMEGDAWgBR281Xh+qQ2+/CfXGJx7Tz0RzgQKzAOBgNVHQ8BAf8E +BAMCAYYwDQYJKoZIhvcNAQEFBQADggIBAGbBxiPz2eAubl/oz66wsCVNK/g7WJtAJDday6sWSf+z +dXkzoS9tcBc0kf5nfo/sm+VegqlVHy/c1FEHEv6sFj4sNcZj/NwQ6w2jqtB8zNHQL1EuxBRa3ugZ +4T7GzKQp5y6EqgYweHZUcyiYWTjgAA1i00J9IZ+uPTqM1fp3DRgrFg5fNuH8KrUwJM/gYwx7WBr+ +mbpCErGR9Hxo4sjoryzqyX6uuyo9DRXcNJW2GHSoag/HtPQTxORb7QrSpJdMKu0vbBKJPfEncKpq +A1Ihn0CoZ1Dy81of398j9tx4TuaYT1U6U+Pv8vSfx3zYWK8pIpe44L2RLrB27FcRz+8pRPPphXpg +Y+RdM4kX2TGq2tbzGDVyz4crL2MjhF2EjD9XoIj8mZEoJmmZ1I+XRL6O1UixpCgp8RW04eWe3fiP +pm8m1wk8OhwRDqZsN/etRIcsKMfYdIKz0G9KV7s1KSegi+ghp4dkNl3M2Basx7InQJJVOCiNUW7d +FGdTbHFcJoRNdVq2fmBWqU2t+5sel/MN2dKXVHfaPRK34B7vCAas+YWH6aLcr34YEoP9VhdBLtUp +gn2Z9DH2canPLAEnpQW5qrJITirvn5NSUZU8UnOOVkwXQMAJKOSLakhT2+zNVVXxxvjpoixMptEm +X36vWkzaH6byHCx+rgIW0lbQL1dTR+iS +-----END CERTIFICATE----- + +Visa eCommerce Root +=================== +-----BEGIN CERTIFICATE----- +MIIDojCCAoqgAwIBAgIQE4Y1TR0/BvLB+WUF1ZAcYjANBgkqhkiG9w0BAQUFADBrMQswCQYDVQQG +EwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMmVmlzYSBJbnRlcm5hdGlvbmFsIFNlcnZpY2Ug +QXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNvbW1lcmNlIFJvb3QwHhcNMDIwNjI2MDIxODM2 +WhcNMjIwNjI0MDAxNjEyWjBrMQswCQYDVQQGEwJVUzENMAsGA1UEChMEVklTQTEvMC0GA1UECxMm +VmlzYSBJbnRlcm5hdGlvbmFsIFNlcnZpY2UgQXNzb2NpYXRpb24xHDAaBgNVBAMTE1Zpc2EgZUNv +bW1lcmNlIFJvb3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvV95WHm6h2mCxlCfL +F9sHP4CFT8icttD0b0/Pmdjh28JIXDqsOTPHH2qLJj0rNfVIsZHBAk4ElpF7sDPwsRROEW+1QK8b +RaVK7362rPKgH1g/EkZgPI2h4H3PVz4zHvtH8aoVlwdVZqW1LS7YgFmypw23RuwhY/81q6UCzyr0 +TP579ZRdhE2o8mCP2w4lPJ9zcc+U30rq299yOIzzlr3xF7zSujtFWsan9sYXiwGd/BmoKoMWuDpI +/k4+oKsGGelT84ATB+0tvz8KPFUgOSwsAGl0lUq8ILKpeeUYiZGo3BxN77t+Nwtd/jmliFKMAGzs +GHxBvfaLdXe6YJ2E5/4tAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEG +MB0GA1UdDgQWBBQVOIMPPyw/cDMezUb+B4wg4NfDtzANBgkqhkiG9w0BAQUFAAOCAQEAX/FBfXxc +CLkr4NWSR/pnXKUTwwMhmytMiUbPWU3J/qVAtmPN3XEolWcRzCSs00Rsca4BIGsDoo8Ytyk6feUW +YFN4PMCvFYP3j1IzJL1kk5fui/fbGKhtcbP3LBfQdCVp9/5rPJS+TUtBjE7ic9DjkCJzQ83z7+pz +zkWKsKZJ/0x9nXGIxHYdkFsd7v3M9+79YKWxehZx0RbQfBI8bGmX265fOZpwLwU8GUYEmSA20GBu +YQa7FkKMcPcw++DbZqMAAb3mLNqRX6BGi01qnD093QVG/na/oAo85ADmJ7f/hC3euiInlhBx6yLt +398znM/jra6O1I7mT1GvFpLgXPYHDw== +-----END CERTIFICATE----- + +Certum Root CA +============== +-----BEGIN CERTIFICATE----- +MIIDDDCCAfSgAwIBAgIDAQAgMA0GCSqGSIb3DQEBBQUAMD4xCzAJBgNVBAYTAlBMMRswGQYDVQQK +ExJVbml6ZXRvIFNwLiB6IG8uby4xEjAQBgNVBAMTCUNlcnR1bSBDQTAeFw0wMjA2MTExMDQ2Mzla +Fw0yNzA2MTExMDQ2MzlaMD4xCzAJBgNVBAYTAlBMMRswGQYDVQQKExJVbml6ZXRvIFNwLiB6IG8u +by4xEjAQBgNVBAMTCUNlcnR1bSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM6x +wS7TT3zNJc4YPk/EjG+AanPIW1H4m9LcuwBcsaD8dQPugfCI7iNS6eYVM42sLQnFdvkrOYCJ5JdL +kKWoePhzQ3ukYbDYWMzhbGZ+nPMJXlVjhNWo7/OxLjBos8Q82KxujZlakE403Daaj4GIULdtlkIJ +89eVgw1BS7Bqa/j8D35in2fE7SZfECYPCE/wpFcozo+47UX2bu4lXapuOb7kky/ZR6By6/qmW6/K +Uz/iDsaWVhFu9+lmqSbYf5VT7QqFiLpPKaVCjF62/IUgAKpoC6EahQGcxEZjgoi2IrHu/qpGWX7P +NSzVttpd90gzFFS269lvzs2I1qsb2pY7HVkCAwEAAaMTMBEwDwYDVR0TAQH/BAUwAwEB/zANBgkq +hkiG9w0BAQUFAAOCAQEAuI3O7+cUus/usESSbLQ5PqKEbq24IXfS1HeCh+YgQYHu4vgRt2PRFze+ +GXYkHAQaTOs9qmdvLdTN/mUxcMUbpgIKumB7bVjCmkn+YzILa+M6wKyrO7Do0wlRjBCDxjTgxSvg +GrZgFCdsMneMvLJymM/NzD+5yCRCFNZX/OYmQ6kd5YCQzgNUKD73P9P4Te1qCjqTE5s7FCMTY5w/ +0YcneeVMUeMBrYVdGjux1XMQpNPyvG5k9VpWkKjHDkx0Dy5xO/fIR/RpbxXyEV6DHpx8Uq79AtoS +qFlnGNu8cN2bsWntgM6JQEhqDjXKKWYVIZQs6GAqm4VKQPNriiTsBhYscw== +-----END CERTIFICATE----- + +Comodo AAA Services root +======================== +-----BEGIN CERTIFICATE----- +MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS +R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg +TGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAw +MFoXDTI4MTIzMTIzNTk1OVowezELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hl +c3RlcjEQMA4GA1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNV +BAMMGEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQuaBtDFcCLNSS1UY8y2bmhG +C1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe3M/vg4aijJRPn2jymJBGhCfHdr/jzDUs +i14HZGWCwEiwqJH5YZ92IFCokcdmtet4YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszW +Y19zjNoFmag4qMsXeDZRrOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjH +Ypy+g8cmez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQUoBEK +Iz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wewYDVR0f +BHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20vQUFBQ2VydGlmaWNhdGVTZXJ2aWNl +cy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29tb2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2Vz +LmNybDANBgkqhkiG9w0BAQUFAAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm +7l3sAg9g1o1QGE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz +Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2G9w84FoVxp7Z +8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsil2D4kF501KKaU73yqWjgom7C +12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg== +-----END CERTIFICATE----- + +QuoVadis Root CA +================ +-----BEGIN CERTIFICATE----- +MIIF0DCCBLigAwIBAgIEOrZQizANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJCTTEZMBcGA1UE +ChMQUXVvVmFkaXMgTGltaXRlZDElMCMGA1UECxMcUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0 +eTEuMCwGA1UEAxMlUXVvVmFkaXMgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wMTAz +MTkxODMzMzNaFw0yMTAzMTcxODMzMzNaMH8xCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRp +cyBMaW1pdGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MS4wLAYDVQQD +EyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEAv2G1lVO6V/z68mcLOhrfEYBklbTRvM16z/Ypli4kVEAkOPcahdxYTMuk +J0KX0J+DisPkBgNbAKVRHnAEdOLB1Dqr1607BxgFjv2DrOpm2RgbaIr1VxqYuvXtdj182d6UajtL +F8HVj71lODqV0D1VNk7feVcxKh7YWWVJWCCYfqtffp/p1k3sg3Spx2zY7ilKhSoGFPlU5tPaZQeL +YzcS19Dsw3sgQUSj7cugF+FxZc4dZjH3dgEZyH0DWLaVSR2mEiboxgx24ONmy+pdpibu5cxfvWen +AScOospUxbF6lR1xHkopigPcakXBpBlebzbNw6Kwt/5cOOJSvPhEQ+aQuwIDAQABo4ICUjCCAk4w +PQYIKwYBBQUHAQEEMTAvMC0GCCsGAQUFBzABhiFodHRwczovL29jc3AucXVvdmFkaXNvZmZzaG9y +ZS5jb20wDwYDVR0TAQH/BAUwAwEB/zCCARoGA1UdIASCAREwggENMIIBCQYJKwYBBAG+WAABMIH7 +MIHUBggrBgEFBQcCAjCBxxqBxFJlbGlhbmNlIG9uIHRoZSBRdW9WYWRpcyBSb290IENlcnRpZmlj +YXRlIGJ5IGFueSBwYXJ0eSBhc3N1bWVzIGFjY2VwdGFuY2Ugb2YgdGhlIHRoZW4gYXBwbGljYWJs +ZSBzdGFuZGFyZCB0ZXJtcyBhbmQgY29uZGl0aW9ucyBvZiB1c2UsIGNlcnRpZmljYXRpb24gcHJh +Y3RpY2VzLCBhbmQgdGhlIFF1b1ZhZGlzIENlcnRpZmljYXRlIFBvbGljeS4wIgYIKwYBBQUHAgEW +Fmh0dHA6Ly93d3cucXVvdmFkaXMuYm0wHQYDVR0OBBYEFItLbe3TKbkGGew5Oanwl4Rqy+/fMIGu +BgNVHSMEgaYwgaOAFItLbe3TKbkGGew5Oanwl4Rqy+/foYGEpIGBMH8xCzAJBgNVBAYTAkJNMRkw +FwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMSUwIwYDVQQLExxSb290IENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5MS4wLAYDVQQDEyVRdW9WYWRpcyBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggQ6 +tlCLMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAitQUtf70mpKnGdSkfnIYj9lo +fFIk3WdvOXrEql494liwTXCYhGHoG+NpGA7O+0dQoE7/8CQfvbLO9Sf87C9TqnN7Az10buYWnuul +LsS/VidQK2K6vkscPFVcQR0kvoIgR13VRH56FmjffU1RcHhXHTMe/QKZnAzNCgVPx7uOpHX6Sm2x +gI4JVrmcGmD+XcHXetwReNDWXcG31a0ymQM6isxUJTkxgXsTIlG6Rmyhu576BGxJJnSP0nPrzDCi +5upZIof4l/UO/erMkqQWxFIY6iHOsfHmhIHluqmGKPJDWl0Snawe2ajlCmqnf6CHKc/yiU3U7MXi +5nrQNiOKSnQ2+Q== +-----END CERTIFICATE----- + +QuoVadis Root CA 2 +================== +-----BEGIN CERTIFICATE----- +MIIFtzCCA5+gAwIBAgICBQkwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoT +EFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJvb3QgQ0EgMjAeFw0wNjExMjQx +ODI3MDBaFw0zMTExMjQxODIzMzNaMEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM +aW1pdGVkMRswGQYDVQQDExJRdW9WYWRpcyBSb290IENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4IC +DwAwggIKAoICAQCaGMpLlA0ALa8DKYrwD4HIrkwZhR0In6spRIXzL4GtMh6QRr+jhiYaHv5+HBg6 +XJxgFyo6dIMzMH1hVBHL7avg5tKifvVrbxi3Cgst/ek+7wrGsxDp3MJGF/hd/aTa/55JWpzmM+Yk +lvc/ulsrHHo1wtZn/qtmUIttKGAr79dgw8eTvI02kfN/+NsRE8Scd3bBrrcCaoF6qUWD4gXmuVbB +lDePSHFjIuwXZQeVikvfj8ZaCuWw419eaxGrDPmF60Tp+ARz8un+XJiM9XOva7R+zdRcAitMOeGy +lZUtQofX1bOQQ7dsE/He3fbE+Ik/0XX1ksOR1YqI0JDs3G3eicJlcZaLDQP9nL9bFqyS2+r+eXyt +66/3FsvbzSUr5R/7mp/iUcw6UwxI5g69ybR2BlLmEROFcmMDBOAENisgGQLodKcftslWZvB1Jdxn +wQ5hYIizPtGo/KPaHbDRsSNU30R2be1B2MGyIrZTHN81Hdyhdyox5C315eXbyOD/5YDXC2Og/zOh +D7osFRXql7PSorW+8oyWHhqPHWykYTe5hnMz15eWniN9gqRMgeKh0bpnX5UHoycR7hYQe7xFSkyy +BNKr79X9DFHOUGoIMfmR2gyPZFwDwzqLID9ujWc9Otb+fVuIyV77zGHcizN300QyNQliBJIWENie +J0f7OyHj+OsdWwIDAQABo4GwMIGtMA8GA1UdEwEB/wQFMAMBAf8wCwYDVR0PBAQDAgEGMB0GA1Ud +DgQWBBQahGK8SEwzJQTU7tD2A8QZRtGUazBuBgNVHSMEZzBlgBQahGK8SEwzJQTU7tD2A8QZRtGU +a6FJpEcwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMT +ElF1b1ZhZGlzIFJvb3QgQ0EgMoICBQkwDQYJKoZIhvcNAQEFBQADggIBAD4KFk2fBluornFdLwUv +Z+YTRYPENvbzwCYMDbVHZF34tHLJRqUDGCdViXh9duqWNIAXINzng/iN/Ae42l9NLmeyhP3ZRPx3 +UIHmfLTJDQtyU/h2BwdBR5YM++CCJpNVjP4iH2BlfF/nJrP3MpCYUNQ3cVX2kiF495V5+vgtJodm +VjB3pjd4M1IQWK4/YY7yarHvGH5KWWPKjaJW1acvvFYfzznB4vsKqBUsfU16Y8Zsl0Q80m/DShcK ++JDSV6IZUaUtl0HaB0+pUNqQjZRG4T7wlP0QADj1O+hA4bRuVhogzG9Yje0uRY/W6ZM/57Es3zrW +IozchLsib9D45MY56QSIPMO661V6bYCZJPVsAfv4l7CUW+v90m/xd2gNNWQjrLhVoQPRTUIZ3Ph1 +WVaj+ahJefivDrkRoHy3au000LYmYjgahwz46P0u05B/B5EqHdZ+XIWDmbA4CD/pXvk1B+TJYm5X +f6dQlfe6yJvmjqIBxdZmv3lh8zwc4bmCXF2gw+nYSL0ZohEUGW6yhhtoPkg3Goi3XZZenMfvJ2II +4pEZXNLxId26F0KCl3GBUzGpn/Z9Yr9y4aOTHcyKJloJONDO1w2AFrR4pTqHTI2KpdVGl/IsELm8 +VCLAAVBpQ570su9t+Oza8eOx79+Rj1QqCyXBJhnEUhAFZdWCEOrCMc0u +-----END CERTIFICATE----- + +QuoVadis Root CA 3 +================== +-----BEGIN CERTIFICATE----- +MIIGnTCCBIWgAwIBAgICBcYwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoT +EFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJvb3QgQ0EgMzAeFw0wNjExMjQx +OTExMjNaFw0zMTExMjQxOTA2NDRaMEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM +aW1pdGVkMRswGQYDVQQDExJRdW9WYWRpcyBSb290IENBIDMwggIiMA0GCSqGSIb3DQEBAQUAA4IC +DwAwggIKAoICAQDMV0IWVJzmmNPTTe7+7cefQzlKZbPoFog02w1ZkXTPkrgEQK0CSzGrvI2RaNgg +DhoB4hp7Thdd4oq3P5kazethq8Jlph+3t723j/z9cI8LoGe+AaJZz3HmDyl2/7FWeUUrH556VOij +KTVopAFPD6QuN+8bv+OPEKhyq1hX51SGyMnzW9os2l2ObjyjPtr7guXd8lyyBTNvijbO0BNO/79K +DDRMpsMhvVAEVeuxu537RR5kFd5VAYwCdrXLoT9CabwvvWhDFlaJKjdhkf2mrk7AyxRllDdLkgbv +BNDInIjbC3uBr7E9KsRlOni27tyAsdLTmZw67mtaa7ONt9XOnMK+pUsvFrGeaDsGb659n/je7Mwp +p5ijJUMv7/FfJuGITfhebtfZFG4ZM2mnO4SJk8RTVROhUXhA+LjJou57ulJCg54U7QVSWllWp5f8 +nT8KKdjcT5EOE7zelaTfi5m+rJsziO+1ga8bxiJTyPbH7pcUsMV8eFLI8M5ud2CEpukqdiDtWAEX +MJPpGovgc2PZapKUSU60rUqFxKMiMPwJ7Wgic6aIDFUhWMXhOp8q3crhkODZc6tsgLjoC2SToJyM +Gf+z0gzskSaHirOi4XCPLArlzW1oUevaPwV/izLmE1xr/l9A4iLItLRkT9a6fUg+qGkM17uGcclz +uD87nSVL2v9A6wIDAQABo4IBlTCCAZEwDwYDVR0TAQH/BAUwAwEB/zCB4QYDVR0gBIHZMIHWMIHT +BgkrBgEEAb5YAAMwgcUwgZMGCCsGAQUFBwICMIGGGoGDQW55IHVzZSBvZiB0aGlzIENlcnRpZmlj +YXRlIGNvbnN0aXR1dGVzIGFjY2VwdGFuY2Ugb2YgdGhlIFF1b1ZhZGlzIFJvb3QgQ0EgMyBDZXJ0 +aWZpY2F0ZSBQb2xpY3kgLyBDZXJ0aWZpY2F0aW9uIFByYWN0aWNlIFN0YXRlbWVudC4wLQYIKwYB +BQUHAgEWIWh0dHA6Ly93d3cucXVvdmFkaXNnbG9iYWwuY29tL2NwczALBgNVHQ8EBAMCAQYwHQYD +VR0OBBYEFPLAE+CCQz777i9nMpY1XNu4ywLQMG4GA1UdIwRnMGWAFPLAE+CCQz777i9nMpY1XNu4 +ywLQoUmkRzBFMQswCQYDVQQGEwJCTTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDEbMBkGA1UE +AxMSUXVvVmFkaXMgUm9vdCBDQSAzggIFxjANBgkqhkiG9w0BAQUFAAOCAgEAT62gLEz6wPJv92ZV +qyM07ucp2sNbtrCD2dDQ4iH782CnO11gUyeim/YIIirnv6By5ZwkajGxkHon24QRiSemd1o417+s +hvzuXYO8BsbRd2sPbSQvS3pspweWyuOEn62Iix2rFo1bZhfZFvSLgNLd+LJ2w/w4E6oM3kJpK27z +POuAJ9v1pkQNn1pVWQvVDVJIxa6f8i+AxeoyUDUSly7B4f/xI4hROJ/yZlZ25w9Rl6VSDE1JUZU2 +Pb+iSwwQHYaZTKrzchGT5Or2m9qoXadNt54CrnMAyNojA+j56hl0YgCUyyIgvpSnWbWCar6ZeXqp +8kokUvd0/bpO5qgdAm6xDYBEwa7TIzdfu4V8K5Iu6H6li92Z4b8nby1dqnuH/grdS/yO9SbkbnBC +bjPsMZ57k8HkyWkaPcBrTiJt7qtYTcbQQcEr6k8Sh17rRdhs9ZgC06DYVYoGmRmioHfRMJ6szHXu +g/WwYjnPbFfiTNKRCw51KBuav/0aQ/HKd/s7j2G4aSgWQgRecCocIdiP4b0jWy10QJLZYxkNc91p +vGJHvOB0K7Lrfb5BG7XARsWhIstfTsEokt4YutUqKLsRixeTmJlglFwjz1onl14LBQaTNx47aTbr +qZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK4SVhM7JZG+Ju1zdXtg2pEto= +-----END CERTIFICATE----- + +Security Communication Root CA +============================== +-----BEGIN CERTIFICATE----- +MIIDWjCCAkKgAwIBAgIBADANBgkqhkiG9w0BAQUFADBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP +U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw +HhcNMDMwOTMwMDQyMDQ5WhcNMjMwOTMwMDQyMDQ5WjBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP +U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCzs/5/022x7xZ8V6UMbXaKL0u/ZPtM7orw +8yl89f/uKuDp6bpbZCKamm8sOiZpUQWZJtzVHGpxxpp9Hp3dfGzGjGdnSj74cbAZJ6kJDKaVv0uM +DPpVmDvY6CKhS3E4eayXkmmziX7qIWgGmBSWh9JhNrxtJ1aeV+7AwFb9Ms+k2Y7CI9eNqPPYJayX +5HA49LY6tJ07lyZDo6G8SVlyTCMwhwFY9k6+HGhWZq/NQV3Is00qVUarH9oe4kA92819uZKAnDfd +DJZkndwi92SL32HeFZRSFaB9UslLqCHJxrHty8OVYNEP8Ktw+N/LTX7s1vqr2b1/VPKl6Xn62dZ2 +JChzAgMBAAGjPzA9MB0GA1UdDgQWBBSgc0mZaNyFW2XjmygvV5+9M7wHSDALBgNVHQ8EBAMCAQYw +DwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAaECpqLvkT115swW1F7NgE+vGkl3g +0dNq/vu+m22/xwVtWSDEHPC32oRYAmP6SBbvT6UL90qY8j+eG61Ha2POCEfrUj94nK9NrvjVT8+a +mCoQQTlSxN3Zmw7vkwGusi7KaEIkQmywszo+zenaSMQVy+n5Bw+SUEmK3TGXX8npN6o7WWWXlDLJ +s58+OmJYxUmtYg5xpTKqL8aJdkNAExNnPaJUJRDL8Try2frbSVa7pv6nQTXD4IhhyYjH3zYQIphZ +6rBK+1YWc26sTfcioU+tHXotRSflMMFe8toTyyVCUZVHA4xsIcx0Qu1T/zOLjw9XARYvz6buyXAi +FL39vmwLAw== +-----END CERTIFICATE----- + +Sonera Class 2 Root CA +====================== +-----BEGIN CERTIFICATE----- +MIIDIDCCAgigAwIBAgIBHTANBgkqhkiG9w0BAQUFADA5MQswCQYDVQQGEwJGSTEPMA0GA1UEChMG +U29uZXJhMRkwFwYDVQQDExBTb25lcmEgQ2xhc3MyIENBMB4XDTAxMDQwNjA3Mjk0MFoXDTIxMDQw +NjA3Mjk0MFowOTELMAkGA1UEBhMCRkkxDzANBgNVBAoTBlNvbmVyYTEZMBcGA1UEAxMQU29uZXJh +IENsYXNzMiBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJAXSjWdyvANlsdE+hY3 +/Ei9vX+ALTU74W+oZ6m/AxxNjG8yR9VBaKQTBME1DJqEQ/xcHf+Js+gXGM2RX/uJ4+q/Tl18GybT +dXnt5oTjV+WtKcT0OijnpXuENmmz/V52vaMtmdOQTiMofRhj8VQ7Jp12W5dCsv+u8E7s3TmVToMG +f+dJQMjFAbJUWmYdPfz56TwKnoG4cPABi+QjVHzIrviQHgCWctRUz2EjvOr7nQKV0ba5cTppCD8P +tOFCx4j1P5iop7oc4HFx71hXgVB6XGt0Rg6DA5jDjqhu8nYybieDwnPz3BjotJPqdURrBGAgcVeH +nfO+oJAjPYok4doh28MCAwEAAaMzMDEwDwYDVR0TAQH/BAUwAwEB/zARBgNVHQ4ECgQISqCqWITT +XjwwCwYDVR0PBAQDAgEGMA0GCSqGSIb3DQEBBQUAA4IBAQBazof5FnIVV0sd2ZvnoiYw7JNn39Yt +0jSv9zilzqsWuasvfDXLrNAPtEwr/IDva4yRXzZ299uzGxnq9LIR/WFxRL8oszodv7ND6J+/3DEI +cbCdjdY0RzKQxmUk96BKfARzjzlvF4xytb1LyHr4e4PDKE6cCepnP7JnBBvDFNr450kkkdAdavph +Oe9r5yF1BgfYErQhIHBCcYHaPJo2vqZbDWpsmh+Re/n570K6Tk6ezAyNlNzZRZxe7EJQY670XcSx +EtzKO6gunRRaBXW37Ndj4ro1tgQIkejanZz2ZrUYrAqmVCY0M9IbwdR/GjqOC6oybtv8TyWf2TLH +llpwrN9M +-----END CERTIFICATE----- + +Camerfirma Chambers of Commerce Root +==================================== +-----BEGIN CERTIFICATE----- +MIIEvTCCA6WgAwIBAgIBADANBgkqhkiG9w0BAQUFADB/MQswCQYDVQQGEwJFVTEnMCUGA1UEChMe +QUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1i +ZXJzaWduLm9yZzEiMCAGA1UEAxMZQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdDAeFw0wMzA5MzAx +NjEzNDNaFw0zNzA5MzAxNjEzNDRaMH8xCzAJBgNVBAYTAkVVMScwJQYDVQQKEx5BQyBDYW1lcmZp +cm1hIFNBIENJRiBBODI3NDMyODcxIzAhBgNVBAsTGmh0dHA6Ly93d3cuY2hhbWJlcnNpZ24ub3Jn +MSIwIAYDVQQDExlDaGFtYmVycyBvZiBDb21tZXJjZSBSb290MIIBIDANBgkqhkiG9w0BAQEFAAOC +AQ0AMIIBCAKCAQEAtzZV5aVdGDDg2olUkfzIx1L4L1DZ77F1c2VHfRtbunXF/KGIJPov7coISjlU +xFF6tdpg6jg8gbLL8bvZkSM/SAFwdakFKq0fcfPJVD0dBmpAPrMMhe5cG3nCYsS4No41XQEMIwRH +NaqbYE6gZj3LJgqcQKH0XZi/caulAGgq7YN6D6IUtdQis4CwPAxaUWktWBiP7Zme8a7ileb2R6jW +DA+wWFjbw2Y3npuRVDM30pQcakjJyfKl2qUMI/cjDpwyVV5xnIQFUZot/eZOKjRa3spAN2cMVCFV +d9oKDMyXroDclDZK9D7ONhMeU+SsTjoF7Nuucpw4i9A5O4kKPnf+dQIBA6OCAUQwggFAMBIGA1Ud +EwEB/wQIMAYBAf8CAQwwPAYDVR0fBDUwMzAxoC+gLYYraHR0cDovL2NybC5jaGFtYmVyc2lnbi5v +cmcvY2hhbWJlcnNyb290LmNybDAdBgNVHQ4EFgQU45T1sU3p26EpW1eLTXYGduHRooowDgYDVR0P +AQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIABzAnBgNVHREEIDAegRxjaGFtYmVyc3Jvb3RAY2hh +bWJlcnNpZ24ub3JnMCcGA1UdEgQgMB6BHGNoYW1iZXJzcm9vdEBjaGFtYmVyc2lnbi5vcmcwWAYD +VR0gBFEwTzBNBgsrBgEEAYGHLgoDATA+MDwGCCsGAQUFBwIBFjBodHRwOi8vY3BzLmNoYW1iZXJz +aWduLm9yZy9jcHMvY2hhbWJlcnNyb290Lmh0bWwwDQYJKoZIhvcNAQEFBQADggEBAAxBl8IahsAi +fJ/7kPMa0QOx7xP5IV8EnNrJpY0nbJaHkb5BkAFyk+cefV/2icZdp0AJPaxJRUXcLo0waLIJuvvD +L8y6C98/d3tGfToSJI6WjzwFCm/SlCgdbQzALogi1djPHRPH8EjX1wWnz8dHnjs8NMiAT9QUu/wN +UPf6s+xCX6ndbcj0dc97wXImsQEcXCz9ek60AcUFV7nnPKoF2YjpB0ZBzu9Bga5Y34OirsrXdx/n +ADydb47kMgkdTXg0eDQ8lJsm7U9xxhl6vSAiSFr+S30Dt+dYvsYyTnQeaN2oaFuzPu5ifdmA6Ap1 +erfutGWaIZDgqtCYvDi1czyL+Nw= +-----END CERTIFICATE----- + +Camerfirma Global Chambersign Root +================================== +-----BEGIN CERTIFICATE----- +MIIExTCCA62gAwIBAgIBADANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJFVTEnMCUGA1UEChMe +QUMgQ2FtZXJmaXJtYSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1i +ZXJzaWduLm9yZzEgMB4GA1UEAxMXR2xvYmFsIENoYW1iZXJzaWduIFJvb3QwHhcNMDMwOTMwMTYx +NDE4WhcNMzcwOTMwMTYxNDE4WjB9MQswCQYDVQQGEwJFVTEnMCUGA1UEChMeQUMgQ2FtZXJmaXJt +YSBTQSBDSUYgQTgyNzQzMjg3MSMwIQYDVQQLExpodHRwOi8vd3d3LmNoYW1iZXJzaWduLm9yZzEg +MB4GA1UEAxMXR2xvYmFsIENoYW1iZXJzaWduIFJvb3QwggEgMA0GCSqGSIb3DQEBAQUAA4IBDQAw +ggEIAoIBAQCicKLQn0KuWxfH2H3PFIP8T8mhtxOviteePgQKkotgVvq0Mi+ITaFgCPS3CU6gSS9J +1tPfnZdan5QEcOw/Wdm3zGaLmFIoCQLfxS+EjXqXd7/sQJ0lcqu1PzKY+7e3/HKE5TWH+VX6ox8O +by4o3Wmg2UIQxvi1RMLQQ3/bvOSiPGpVeAp3qdjqGTK3L/5cPxvusZjsyq16aUXjlg9V9ubtdepl +6DJWk0aJqCWKZQbua795B9Dxt6/tLE2Su8CoX6dnfQTyFQhwrJLWfQTSM/tMtgsL+xrJxI0DqX5c +8lCrEqWhz0hQpe/SyBoT+rB/sYIcd2oPX9wLlY/vQ37mRQklAgEDo4IBUDCCAUwwEgYDVR0TAQH/ +BAgwBgEB/wIBDDA/BgNVHR8EODA2MDSgMqAwhi5odHRwOi8vY3JsLmNoYW1iZXJzaWduLm9yZy9j +aGFtYmVyc2lnbnJvb3QuY3JsMB0GA1UdDgQWBBRDnDafsJ4wTcbOX60Qq+UDpfqpFDAOBgNVHQ8B +Af8EBAMCAQYwEQYJYIZIAYb4QgEBBAQDAgAHMCoGA1UdEQQjMCGBH2NoYW1iZXJzaWducm9vdEBj +aGFtYmVyc2lnbi5vcmcwKgYDVR0SBCMwIYEfY2hhbWJlcnNpZ25yb290QGNoYW1iZXJzaWduLm9y +ZzBbBgNVHSAEVDBSMFAGCysGAQQBgYcuCgEBMEEwPwYIKwYBBQUHAgEWM2h0dHA6Ly9jcHMuY2hh +bWJlcnNpZ24ub3JnL2Nwcy9jaGFtYmVyc2lnbnJvb3QuaHRtbDANBgkqhkiG9w0BAQUFAAOCAQEA +PDtwkfkEVCeR4e3t/mh/YV3lQWVPMvEYBZRqHN4fcNs+ezICNLUMbKGKfKX0j//U2K0X1S0E0T9Y +gOKBWYi+wONGkyT+kL0mojAt6JcmVzWJdJYY9hXiryQZVgICsroPFOrGimbBhkVVi76SvpykBMdJ +PJ7oKXqJ1/6v/2j1pReQvayZzKWGVwlnRtvWFsJG8eSpUPWP0ZIV018+xgBJOm5YstHRJw0lyDL4 +IBHNfTIzSJRUTN3cecQwn+uOuFW114hcxWokPbLTBQNRxgfvzBRydD1ucs4YKIxKoHflCStFREes +t2d/AYoFWpO+ocH/+OcOZ6RHSXZddZAa9SaP8A== +-----END CERTIFICATE----- + +XRamp Global CA Root +==================== +-----BEGIN CERTIFICATE----- +MIIEMDCCAxigAwIBAgIQUJRs7Bjq1ZxN1ZfvdY+grTANBgkqhkiG9w0BAQUFADCBgjELMAkGA1UE +BhMCVVMxHjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2Vj +dXJpdHkgU2VydmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBB +dXRob3JpdHkwHhcNMDQxMTAxMTcxNDA0WhcNMzUwMTAxMDUzNzE5WjCBgjELMAkGA1UEBhMCVVMx +HjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2VjdXJpdHkg +U2VydmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBBdXRob3Jp +dHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCYJB69FbS638eMpSe2OAtp87ZOqCwu +IR1cRN8hXX4jdP5efrRKt6atH67gBhbim1vZZ3RrXYCPKZ2GG9mcDZhtdhAoWORlsH9KmHmf4MMx +foArtYzAQDsRhtDLooY2YKTVMIJt2W7QDxIEM5dfT2Fa8OT5kavnHTu86M/0ay00fOJIYRyO82FE +zG+gSqmUsE3a56k0enI4qEHMPJQRfevIpoy3hsvKMzvZPTeL+3o+hiznc9cKV6xkmxnr9A8ECIqs +AxcZZPRaJSKNNCyy9mgdEm3Tih4U2sSPpuIjhdV6Db1q4Ons7Be7QhtnqiXtRYMh/MHJfNViPvry +xS3T/dRlAgMBAAGjgZ8wgZwwEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1Ud +EwEB/wQFMAMBAf8wHQYDVR0OBBYEFMZPoj0GY4QJnM5i5ASsjVy16bYbMDYGA1UdHwQvMC0wK6Ap +oCeGJWh0dHA6Ly9jcmwueHJhbXBzZWN1cml0eS5jb20vWEdDQS5jcmwwEAYJKwYBBAGCNxUBBAMC +AQEwDQYJKoZIhvcNAQEFBQADggEBAJEVOQMBG2f7Shz5CmBbodpNl2L5JFMn14JkTpAuw0kbK5rc +/Kh4ZzXxHfARvbdI4xD2Dd8/0sm2qlWkSLoC295ZLhVbO50WfUfXN+pfTXYSNrsf16GBBEYgoyxt +qZ4Bfj8pzgCT3/3JknOJiWSe5yvkHJEs0rnOfc5vMZnT5r7SHpDwCRR5XCOrTdLaIR9NmXmd4c8n +nxCbHIgNsIpkQTG4DmyQJKSbXHGPurt+HBvbaoAPIbzp26a3QPSyi6mx5O+aGtA9aZnuqCij4Tyz +8LIRnM98QObd50N9otg6tamN8jSZxNQQ4Qb9CYQQO+7ETPTsJ3xCwnR8gooJybQDJbw= +-----END CERTIFICATE----- + +Go Daddy Class 2 CA +=================== +-----BEGIN CERTIFICATE----- +MIIEADCCAuigAwIBAgIBADANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMY +VGhlIEdvIERhZGR5IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRp +ZmljYXRpb24gQXV0aG9yaXR5MB4XDTA0MDYyOTE3MDYyMFoXDTM0MDYyOTE3MDYyMFowYzELMAkG +A1UEBhMCVVMxITAfBgNVBAoTGFRoZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28g +RGFkZHkgQ2xhc3MgMiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASAwDQYJKoZIhvcNAQEBBQAD +ggENADCCAQgCggEBAN6d1+pXGEmhW+vXX0iG6r7d/+TvZxz0ZWizV3GgXne77ZtJ6XCAPVYYYwhv +2vLM0D9/AlQiVBDYsoHUwHU9S3/Hd8M+eKsaA7Ugay9qK7HFiH7Eux6wwdhFJ2+qN1j3hybX2C32 +qRe3H3I2TqYXP2WYktsqbl2i/ojgC95/5Y0V4evLOtXiEqITLdiOr18SPaAIBQi2XKVlOARFmR6j +YGB0xUGlcmIbYsUfb18aQr4CUWWoriMYavx4A6lNf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmY +vLEHZ6IVDd2gWMZEewo+YihfukEHU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjgcAwgb0wHQYDVR0O +BBYEFNLEsNKR1EwRcbNhyz2h/t2oatTjMIGNBgNVHSMEgYUwgYKAFNLEsNKR1EwRcbNhyz2h/t2o +atTjoWekZTBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYVGhlIEdvIERhZGR5IEdyb3VwLCBJbmMu +MTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggEAMAwG +A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wim +PQoZ+YeAEW5p5JYXMP80kWNyOO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKt +I3lpjbi2Tc7PTMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ +HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mERdEr/VxqHD3VI +Ls9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5CufReYNnyicsbkqWletNw+vHX/b +vZ8= +-----END CERTIFICATE----- + +Starfield Class 2 CA +==================== +-----BEGIN CERTIFICATE----- +MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzElMCMGA1UEChMc +U3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZpZWxkIENsYXNzIDIg +Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQwNjI5MTczOTE2WhcNMzQwNjI5MTczOTE2WjBo +MQswCQYDVQQGEwJVUzElMCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAG +A1UECxMpU3RhcmZpZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEgMA0GCSqG +SIb3DQEBAQUAA4IBDQAwggEIAoIBAQC3Msj+6XGmBIWtDBFk385N78gDGIc/oav7PKaf8MOh2tTY +bitTkPskpD6E8J7oX+zlJ0T1KKY/e97gKvDIr1MvnsoFAZMej2YcOadN+lq2cwQlZut3f+dZxkqZ +JRRU6ybH838Z1TBwj6+wRir/resp7defqgSHo9T5iaU0X9tDkYI22WY8sbi5gv2cOj4QyDvvBmVm +epsZGD3/cVE8MC5fvj13c7JdBmzDI1aaK4UmkhynArPkPw2vCHmCuDY96pzTNbO8acr1zJ3o/WSN +F4Azbl5KXZnJHoe0nRrA1W4TNSNe35tfPe/W93bC6j67eA0cQmdrBNj41tpvi/JEoAGrAgEDo4HF +MIHCMB0GA1UdDgQWBBS/X7fRzt0fhvRbVazc1xDCDqmI5zCBkgYDVR0jBIGKMIGHgBS/X7fRzt0f +hvRbVazc1xDCDqmI56FspGowaDELMAkGA1UEBhMCVVMxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNo +bm9sb2dpZXMsIEluYy4xMjAwBgNVBAsTKVN0YXJmaWVsZCBDbGFzcyAyIENlcnRpZmljYXRpb24g +QXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAAWdP4id0ckaVaGs +afPzWdqbAYcaT1epoXkJKtv3L7IezMdeatiDh6GX70k1PncGQVhiv45YuApnP+yz3SFmH8lU+nLM +PUxA2IGvd56Deruix/U0F47ZEUD0/CwqTRV/p2JdLiXTAAsgGh1o+Re49L2L7ShZ3U0WixeDyLJl +xy16paq8U4Zt3VekyvggQQto8PT7dL5WXXp59fkdheMtlb71cZBDzI0fmgAKhynpVSJYACPq4xJD +KVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEYWQPJIrSPnNVeKtelttQKbfi3 +QBFGmh95DmK/D5fs4C8fF5Q= +-----END CERTIFICATE----- + +StartCom Certification Authority +================================ +-----BEGIN CERTIFICATE----- +MIIHyTCCBbGgAwIBAgIBATANBgkqhkiG9w0BAQUFADB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMN +U3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmlu +ZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0 +NjM2WhcNMzYwOTE3MTk0NjM2WjB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRk +LjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMg +U3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw +ggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZkpMyONvg45iPwbm2xPN1y +o4UcodM9tDMr0y+v/uqwQVlntsQGfQqedIXWeUyAN3rfOQVSWff0G0ZDpNKFhdLDcfN1YjS6LIp/ +Ho/u7TTQEceWzVI9ujPW3U3eCztKS5/CJi/6tRYccjV3yjxd5srhJosaNnZcAdt0FCX+7bWgiA/d +eMotHweXMAEtcnn6RtYTKqi5pquDSR3l8u/d5AGOGAqPY1MWhWKpDhk6zLVmpsJrdAfkK+F2PrRt +2PZE4XNiHzvEvqBTViVsUQn3qqvKv3b9bZvzndu/PWa8DFaqr5hIlTpL36dYUNk4dalb6kMMAv+Z +6+hsTXBbKWWc3apdzK8BMewM69KN6Oqce+Zu9ydmDBpI125C4z/eIT574Q1w+2OqqGwaVLRcJXrJ +osmLFqa7LH4XXgVNWG4SHQHuEhANxjJ/GP/89PrNbpHoNkm+Gkhpi8KWTRoSsmkXwQqQ1vp5Iki/ +untp+HDH+no32NgN0nZPV/+Qt+OR0t3vwmC3Zzrd/qqc8NSLf3Iizsafl7b4r4qgEKjZ+xjGtrVc +UjyJthkqcwEKDwOzEmDyei+B26Nu/yYwl/WL3YlXtq09s68rxbd2AvCl1iuahhQqcvbjM4xdCUsT +37uMdBNSSwIDAQABo4ICUjCCAk4wDAYDVR0TBAUwAwEB/zALBgNVHQ8EBAMCAa4wHQYDVR0OBBYE +FE4L7xqkQFulF2mHMMo0aEPQQa7yMGQGA1UdHwRdMFswLKAqoCiGJmh0dHA6Ly9jZXJ0LnN0YXJ0 +Y29tLm9yZy9zZnNjYS1jcmwuY3JsMCugKaAnhiVodHRwOi8vY3JsLnN0YXJ0Y29tLm9yZy9zZnNj +YS1jcmwuY3JsMIIBXQYDVR0gBIIBVDCCAVAwggFMBgsrBgEEAYG1NwEBATCCATswLwYIKwYBBQUH +AgEWI2h0dHA6Ly9jZXJ0LnN0YXJ0Y29tLm9yZy9wb2xpY3kucGRmMDUGCCsGAQUFBwIBFilodHRw +Oi8vY2VydC5zdGFydGNvbS5vcmcvaW50ZXJtZWRpYXRlLnBkZjCB0AYIKwYBBQUHAgIwgcMwJxYg +U3RhcnQgQ29tbWVyY2lhbCAoU3RhcnRDb20pIEx0ZC4wAwIBARqBl0xpbWl0ZWQgTGlhYmlsaXR5 +LCByZWFkIHRoZSBzZWN0aW9uICpMZWdhbCBMaW1pdGF0aW9ucyogb2YgdGhlIFN0YXJ0Q29tIENl +cnRpZmljYXRpb24gQXV0aG9yaXR5IFBvbGljeSBhdmFpbGFibGUgYXQgaHR0cDovL2NlcnQuc3Rh +cnRjb20ub3JnL3BvbGljeS5wZGYwEQYJYIZIAYb4QgEBBAQDAgAHMDgGCWCGSAGG+EIBDQQrFilT +dGFydENvbSBGcmVlIFNTTCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTANBgkqhkiG9w0BAQUFAAOC +AgEAFmyZ9GYMNPXQhV59CuzaEE44HF7fpiUFS5Eyweg78T3dRAlbB0mKKctmArexmvclmAk8jhvh +3TaHK0u7aNM5Zj2gJsfyOZEdUauCe37Vzlrk4gNXcGmXCPleWKYK34wGmkUWFjgKXlf2Ysd6AgXm +vB618p70qSmD+LIU424oh0TDkBreOKk8rENNZEXO3SipXPJzewT4F+irsfMuXGRuczE6Eri8sxHk +fY+BUZo7jYn0TZNmezwD7dOaHZrzZVD1oNB1ny+v8OqCQ5j4aZyJecRDjkZy42Q2Eq/3JR44iZB3 +fsNrarnDy0RLrHiQi+fHLB5LEUTINFInzQpdn4XBidUaePKVEFMy3YCEZnXZtWgo+2EuvoSoOMCZ +EoalHmdkrQYuL6lwhceWD3yJZfWOQ1QOq92lgDmUYMA0yZZwLKMS9R9Ie70cfmu3nZD0Ijuu+Pwq +yvqCUqDvr0tVk+vBtfAii6w0TiYiBKGHLHVKt+V9E9e4DGTANtLJL4YSjCMJwRuCO3NJo2pXh5Tl +1njFmUNj403gdy3hZZlyaQQaRwnmDwFWJPsfvw55qVguucQJAX6Vum0ABj6y6koQOdjQK/W/7HW/ +lwLFCRsI3FU34oH7N4RDYiDK51ZLZer+bMEkkyShNOsF/5oirpt9P/FlUQqmMGqz9IgcgA38coro +g14= +-----END CERTIFICATE----- + +Taiwan GRCA +=========== +-----BEGIN CERTIFICATE----- +MIIFcjCCA1qgAwIBAgIQH51ZWtcvwgZEpYAIaeNe9jANBgkqhkiG9w0BAQUFADA/MQswCQYDVQQG +EwJUVzEwMC4GA1UECgwnR292ZXJubWVudCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4X +DTAyMTIwNTEzMjMzM1oXDTMyMTIwNTEzMjMzM1owPzELMAkGA1UEBhMCVFcxMDAuBgNVBAoMJ0dv +dmVybm1lbnQgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCAiIwDQYJKoZIhvcNAQEBBQAD +ggIPADCCAgoCggIBAJoluOzMonWoe/fOW1mKydGGEghU7Jzy50b2iPN86aXfTEc2pBsBHH8eV4qN +w8XRIePaJD9IK/ufLqGU5ywck9G/GwGHU5nOp/UKIXZ3/6m3xnOUT0b3EEk3+qhZSV1qgQdW8or5 +BtD3cCJNtLdBuTK4sfCxw5w/cP1T3YGq2GN49thTbqGsaoQkclSGxtKyyhwOeYHWtXBiCAEuTk8O +1RGvqa/lmr/czIdtJuTJV6L7lvnM4T9TjGxMfptTCAtsF/tnyMKtsc2AtJfcdgEWFelq16TheEfO +htX7MfP6Mb40qij7cEwdScevLJ1tZqa2jWR+tSBqnTuBto9AAGdLiYa4zGX+FVPpBMHWXx1E1wov +J5pGfaENda1UhhXcSTvxls4Pm6Dso3pdvtUqdULle96ltqqvKKyskKw4t9VoNSZ63Pc78/1Fm9G7 +Q3hub/FCVGqY8A2tl+lSXunVanLeavcbYBT0peS2cWeqH+riTcFCQP5nRhc4L0c/cZyu5SHKYS1t +B6iEfC3uUSXxY5Ce/eFXiGvviiNtsea9P63RPZYLhY3Naye7twWb7LuRqQoHEgKXTiCQ8P8NHuJB +O9NAOueNXdpm5AKwB1KYXA6OM5zCppX7VRluTI6uSw+9wThNXo+EHWbNxWCWtFJaBYmOlXqYwZE8 +lSOyDvR5tMl8wUohAgMBAAGjajBoMB0GA1UdDgQWBBTMzO/MKWCkO7GStjz6MmKPrCUVOzAMBgNV +HRMEBTADAQH/MDkGBGcqBwAEMTAvMC0CAQAwCQYFKw4DAhoFADAHBgVnKgMAAAQUA5vwIhP/lSg2 +09yewDL7MTqKUWUwDQYJKoZIhvcNAQEFBQADggIBAECASvomyc5eMN1PhnR2WPWus4MzeKR6dBcZ +TulStbngCnRiqmjKeKBMmo4sIy7VahIkv9Ro04rQ2JyftB8M3jh+Vzj8jeJPXgyfqzvS/3WXy6Tj +Zwj/5cAWtUgBfen5Cv8b5Wppv3ghqMKnI6mGq3ZW6A4M9hPdKmaKZEk9GhiHkASfQlK3T8v+R0F2 +Ne//AHY2RTKbxkaFXeIksB7jSJaYV0eUVXoPQbFEJPPB/hprv4j9wabak2BegUqZIJxIZhm1AHlU +D7gsL0u8qV1bYH+Mh6XgUmMqvtg7hUAV/h62ZT/FS9p+tXo1KaMuephgIqP0fSdOLeq0dDzpD6Qz +DxARvBMB1uUO07+1EqLhRSPAzAhuYbeJq4PjJB7mXQfnHyA+z2fI56wwbSdLaG5LKlwCCDTb+Hbk +Z6MmnD+iMsJKxYEYMRBWqoTvLQr/uB930r+lWKBi5NdLkXWNiYCYfm3LU05er/ayl4WXudpVBrkk +7tfGOB5jGxI7leFYrPLfhNVfmS8NVVvmONsuP3LpSIXLuykTjx44VbnzssQwmSNOXfJIoRIM3BKQ +CZBUkQM8R+XVyWXgt0t97EfTsws+rZ7QdAAO671RrcDeLMDDav7v3Aun+kbfYNucpllQdSNpc5Oy ++fwC00fmcc4QAu4njIT/rEUNE1yDMuAlpYYsfPQS +-----END CERTIFICATE----- + +DigiCert Assured ID Root CA +=========================== +-----BEGIN CERTIFICATE----- +MIIDtzCCAp+gAwIBAgIQDOfg5RfYRv6P5WD8G/AwOTANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQw +IgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0EwHhcNMDYxMTEwMDAwMDAwWhcNMzEx +MTEwMDAwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQL +ExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0Ew +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtDhXO5EOAXLGH87dg+XESpa7cJpSIqvTO +9SA5KFhgDPiA2qkVlTJhPLWxKISKityfCgyDF3qPkKyK53lTXDGEKvYPmDI2dsze3Tyoou9q+yHy +UmHfnyDXH+Kx2f4YZNISW1/5WBg1vEfNoTb5a3/UsDg+wRvDjDPZ2C8Y/igPs6eD1sNuRMBhNZYW +/lmci3Zt1/GiSw0r/wty2p5g0I6QNcZ4VYcgoc/lbQrISXwxmDNsIumH0DJaoroTghHtORedmTpy +oeb6pNnVFzF1roV9Iq4/AUaG9ih5yLHa5FcXxH4cDrC0kqZWs72yl+2qp/C3xag/lRbQ/6GW6whf +GHdPAgMBAAGjYzBhMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRF +66Kv9JLLgjEtUYunpyGd823IDzAfBgNVHSMEGDAWgBRF66Kv9JLLgjEtUYunpyGd823IDzANBgkq +hkiG9w0BAQUFAAOCAQEAog683+Lt8ONyc3pklL/3cmbYMuRCdWKuh+vy1dneVrOfzM4UKLkNl2Bc +EkxY5NM9g0lFWJc1aRqoR+pWxnmrEthngYTffwk8lOa4JiwgvT2zKIn3X/8i4peEH+ll74fg38Fn +SbNd67IJKusm7Xi+fT8r87cmNW1fiQG2SVufAQWbqz0lwcy2f8Lxb4bG+mRo64EtlOtCt/qMHt1i +8b5QZ7dsvfPxH2sMNgcWfzd8qVttevESRmCD1ycEvkvOl77DZypoEd+A5wwzZr8TDRRu838fYxAe ++o0bJW1sj6W3YQGx0qMmoRBxna3iw/nDmVG3KwcIzi7mULKn+gpFL6Lw8g== +-----END CERTIFICATE----- + +DigiCert Global Root CA +======================= +-----BEGIN CERTIFICATE----- +MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBhMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAw +HgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBDQTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAw +MDAwMDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3 +dy5kaWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkq +hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsBCSDMAZOn +TjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97nh6Vfe63SKMI2tavegw5 +BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt43C/dxC//AH2hdmoRBBYMql1GNXRor5H +4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7PT19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y +7vrTC0LUq7dBMtoM1O/4gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQAB +o2MwYTAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbRTLtm +8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUwDQYJKoZIhvcNAQEF +BQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/EsrhMAtudXH/vTBH1jLuG2cenTnmCmr +EbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIt +tep3Sp+dWOIrWcBAI+0tKIJFPnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886 +UAb3LujEV0lsYSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk +CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4= +-----END CERTIFICATE----- + +DigiCert High Assurance EV Root CA +================================== +-----BEGIN CERTIFICATE----- +MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBsMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSsw +KQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5jZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAw +MFoXDTMxMTExMDAwMDAwMFowbDELMAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZ +MBcGA1UECxMQd3d3LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFu +Y2UgRVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm+9S75S0t +Mqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTWPNt0OKRKzE0lgvdKpVMS +OO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEMxChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3 +MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFBIk5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQ +NAQTXKFx01p8VdteZOE3hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUe +h10aUAsgEsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQFMAMB +Af8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaAFLE+w2kD+L9HAdSY +JhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3NecnzyIZgYIVyHbIUf4KmeqvxgydkAQ +V8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6zeM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFp +myPInngiK3BD41VHMWEZ71jFhS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkK +mNEVX58Svnw2Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe +vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep+OkuE6N36B9K +-----END CERTIFICATE----- + +Certplus Class 2 Primary CA +=========================== +-----BEGIN CERTIFICATE----- +MIIDkjCCAnqgAwIBAgIRAIW9S/PY2uNp9pTXX8OlRCMwDQYJKoZIhvcNAQEFBQAwPTELMAkGA1UE +BhMCRlIxETAPBgNVBAoTCENlcnRwbHVzMRswGQYDVQQDExJDbGFzcyAyIFByaW1hcnkgQ0EwHhcN +OTkwNzA3MTcwNTAwWhcNMTkwNzA2MjM1OTU5WjA9MQswCQYDVQQGEwJGUjERMA8GA1UEChMIQ2Vy +dHBsdXMxGzAZBgNVBAMTEkNsYXNzIDIgUHJpbWFyeSBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEP +ADCCAQoCggEBANxQltAS+DXSCHh6tlJw/W/uz7kRy1134ezpfgSN1sxvc0NXYKwzCkTsA18cgCSR +5aiRVhKC9+Ar9NuuYS6JEI1rbLqzAr3VNsVINyPi8Fo3UjMXEuLRYE2+L0ER4/YXJQyLkcAbmXuZ +Vg2v7tK8R1fjeUl7NIknJITesezpWE7+Tt9avkGtrAjFGA7v0lPubNCdEgETjdyAYveVqUSISnFO +YFWe2yMZeVYHDD9jC1yw4r5+FfyUM1hBOHTE4Y+L3yasH7WLO7dDWWuwJKZtkIvEcupdM5i3y95e +e++U8Rs+yskhwcWYAqqi9lt3m/V+llU0HGdpwPFC40es/CgcZlUCAwEAAaOBjDCBiTAPBgNVHRME +CDAGAQH/AgEKMAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQU43Mt38sOKAze3bOkynm4jrvoMIkwEQYJ +YIZIAYb4QgEBBAQDAgEGMDcGA1UdHwQwMC4wLKAqoCiGJmh0dHA6Ly93d3cuY2VydHBsdXMuY29t +L0NSTC9jbGFzczIuY3JsMA0GCSqGSIb3DQEBBQUAA4IBAQCnVM+IRBnL39R/AN9WM2K191EBkOvD +P9GIROkkXe/nFL0gt5o8AP5tn9uQ3Nf0YtaLcF3n5QRIqWh8yfFC82x/xXp8HVGIutIKPidd3i1R +TtMTZGnkLuPT55sJmabglZvOGtd/vjzOUrMRFcEPF80Du5wlFbqidon8BvEY0JNLDnyCt6X09l/+ +7UCmnYR0ObncHoUW2ikbhiMAybuJfm6AiB4vFLQDJKgybwOaRywwvlbGp0ICcBvqQNi6BQNwB6SW +//1IMwrh3KWBkJtN3X3n57LNXMhqlfil9o3EXXgIvnsG1knPGTZQIy4I5p4FTUcY1Rbpsda2ENW7 +l7+ijrRU +-----END CERTIFICATE----- + +DST Root CA X3 +============== +-----BEGIN CERTIFICATE----- +MIIDSjCCAjKgAwIBAgIQRK+wgNajJ7qJMDmGLvhAazANBgkqhkiG9w0BAQUFADA/MSQwIgYDVQQK +ExtEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdCBDby4xFzAVBgNVBAMTDkRTVCBSb290IENBIFgzMB4X +DTAwMDkzMDIxMTIxOVoXDTIxMDkzMDE0MDExNVowPzEkMCIGA1UEChMbRGlnaXRhbCBTaWduYXR1 +cmUgVHJ1c3QgQ28uMRcwFQYDVQQDEw5EU1QgUm9vdCBDQSBYMzCCASIwDQYJKoZIhvcNAQEBBQAD +ggEPADCCAQoCggEBAN+v6ZdQCINXtMxiZfaQguzH0yxrMMpb7NnDfcdAwRgUi+DoM3ZJKuM/IUmT +rE4Orz5Iy2Xu/NMhD2XSKtkyj4zl93ewEnu1lcCJo6m67XMuegwGMoOifooUMM0RoOEqOLl5CjH9 +UL2AZd+3UWODyOKIYepLYYHsUmu5ouJLGiifSKOeDNoJjj4XLh7dIN9bxiqKqy69cK3FCxolkHRy +xXtqqzTWMIn/5WgTe1QLyNau7Fqckh49ZLOMxt+/yUFw7BZy1SbsOFU5Q9D8/RhcQPGX69Wam40d +utolucbY38EVAjqr2m7xPi71XAicPNaDaeQQmxkqtilX4+U9m5/wAl0CAwEAAaNCMEAwDwYDVR0T +AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMSnsaR7LHH62+FLkHX/xBVghYkQ +MA0GCSqGSIb3DQEBBQUAA4IBAQCjGiybFwBcqR7uKGY3Or+Dxz9LwwmglSBd49lZRNI+DT69ikug +dB/OEIKcdBodfpga3csTS7MgROSR6cz8faXbauX+5v3gTt23ADq1cEmv8uXrAvHRAosZy5Q6XkjE +GB5YGV8eAlrwDPGxrancWYaLbumR9YbK+rlmM6pZW87ipxZzR8srzJmwN0jP41ZL9c8PDHIyh8bw +RLtTcm1D9SZImlJnt1ir/md2cXjbDaJWFBM5JDGFoqgCWjBH4d1QB7wCCZAA62RjYJsWvIjJEubS +fZGL+T0yjWW06XyxV3bqxbYoOb8VZRzI9neWagqNdwvYkQsEjgfbKbYK7p2CNTUQ +-----END CERTIFICATE----- + +DST ACES CA X6 +============== +-----BEGIN CERTIFICATE----- +MIIECTCCAvGgAwIBAgIQDV6ZCtadt3js2AdWO4YV2TANBgkqhkiG9w0BAQUFADBbMQswCQYDVQQG +EwJVUzEgMB4GA1UEChMXRGlnaXRhbCBTaWduYXR1cmUgVHJ1c3QxETAPBgNVBAsTCERTVCBBQ0VT +MRcwFQYDVQQDEw5EU1QgQUNFUyBDQSBYNjAeFw0wMzExMjAyMTE5NThaFw0xNzExMjAyMTE5NTha +MFsxCzAJBgNVBAYTAlVTMSAwHgYDVQQKExdEaWdpdGFsIFNpZ25hdHVyZSBUcnVzdDERMA8GA1UE +CxMIRFNUIEFDRVMxFzAVBgNVBAMTDkRTVCBBQ0VTIENBIFg2MIIBIjANBgkqhkiG9w0BAQEFAAOC +AQ8AMIIBCgKCAQEAuT31LMmU3HWKlV1j6IR3dma5WZFcRt2SPp/5DgO0PWGSvSMmtWPuktKe1jzI +DZBfZIGxqAgNTNj50wUoUrQBJcWVHAx+PhCEdc/BGZFjz+iokYi5Q1K7gLFViYsx+tC3dr5BPTCa +pCIlF3PoHuLTrCq9Wzgh1SpL11V94zpVvddtawJXa+ZHfAjIgrrep4c9oW24MFbCswKBXy314pow +GCi4ZtPLAZZv6opFVdbgnf9nKxcCpk4aahELfrd755jWjHZvwTvbUJN+5dCOHze4vbrGn2zpfDPy +MjwmR/onJALJfh1biEITajV8fTXpLmaRcpPVMibEdPVTo7NdmvYJywIDAQABo4HIMIHFMA8GA1Ud +EwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgHGMB8GA1UdEQQYMBaBFHBraS1vcHNAdHJ1c3Rkc3Qu +Y29tMGIGA1UdIARbMFkwVwYKYIZIAWUDAgEBATBJMEcGCCsGAQUFBwIBFjtodHRwOi8vd3d3LnRy +dXN0ZHN0LmNvbS9jZXJ0aWZpY2F0ZXMvcG9saWN5L0FDRVMtaW5kZXguaHRtbDAdBgNVHQ4EFgQU +CXIGThhDD+XWzMNqizF7eI+og7gwDQYJKoZIhvcNAQEFBQADggEBAKPYjtay284F5zLNAdMEA+V2 +5FYrnJmQ6AgwbN99Pe7lv7UkQIRJ4dEorsTCOlMwiPH1d25Ryvr/ma8kXxug/fKshMrfqfBfBC6t +Fr8hlxCBPeP/h40y3JTlR4peahPJlJU90u7INJXQgNStMgiAVDzgvVJT11J8smk/f3rPanTK+gQq +nExaBqXpIK1FZg9p8d2/6eMyi/rgwYZNcjwu2JN4Cir42NInPRmJX1p7ijvMDNpRrscL9yuwNwXs +vFcj4jjSm2jzVhKIT0J8uDHEtdvkyCE06UgRNe76x5JXxZ805Mf29w4LTJxoeHtxMcfrHuBnQfO3 +oKfN5XozNmr6mis= +-----END CERTIFICATE----- + +SwissSign Gold CA - G2 +====================== +-----BEGIN CERTIFICATE----- +MIIFujCCA6KgAwIBAgIJALtAHEP1Xk+wMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNVBAYTAkNIMRUw +EwYDVQQKEwxTd2lzc1NpZ24gQUcxHzAdBgNVBAMTFlN3aXNzU2lnbiBHb2xkIENBIC0gRzIwHhcN +MDYxMDI1MDgzMDM1WhcNMzYxMDI1MDgzMDM1WjBFMQswCQYDVQQGEwJDSDEVMBMGA1UEChMMU3dp +c3NTaWduIEFHMR8wHQYDVQQDExZTd2lzc1NpZ24gR29sZCBDQSAtIEcyMIICIjANBgkqhkiG9w0B +AQEFAAOCAg8AMIICCgKCAgEAr+TufoskDhJuqVAtFkQ7kpJcyrhdhJJCEyq8ZVeCQD5XJM1QiyUq +t2/876LQwB8CJEoTlo8jE+YoWACjR8cGp4QjK7u9lit/VcyLwVcfDmJlD909Vopz2q5+bbqBHH5C +jCA12UNNhPqE21Is8w4ndwtrvxEvcnifLtg+5hg3Wipy+dpikJKVyh+c6bM8K8vzARO/Ws/BtQpg +vd21mWRTuKCWs2/iJneRjOBiEAKfNA+k1ZIzUd6+jbqEemA8atufK+ze3gE/bk3lUIbLtK/tREDF +ylqM2tIrfKjuvqblCqoOpd8FUrdVxyJdMmqXl2MT28nbeTZ7hTpKxVKJ+STnnXepgv9VHKVxaSvR +AiTysybUa9oEVeXBCsdtMDeQKuSeFDNeFhdVxVu1yzSJkvGdJo+hB9TGsnhQ2wwMC3wLjEHXuend +jIj3o02yMszYF9rNt85mndT9Xv+9lz4pded+p2JYryU0pUHHPbwNUMoDAw8IWh+Vc3hiv69yFGkO +peUDDniOJihC8AcLYiAQZzlG+qkDzAQ4embvIIO1jEpWjpEA/I5cgt6IoMPiaG59je883WX0XaxR +7ySArqpWl2/5rX3aYT+YdzylkbYcjCbaZaIJbcHiVOO5ykxMgI93e2CaHt+28kgeDrpOVG2Y4OGi +GqJ3UM/EY5LsRxmd6+ZrzsECAwEAAaOBrDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUw +AwEB/zAdBgNVHQ4EFgQUWyV7lqRlUX64OfPAeGZe6Drn8O4wHwYDVR0jBBgwFoAUWyV7lqRlUX64 +OfPAeGZe6Drn8O4wRgYDVR0gBD8wPTA7BglghXQBWQECAQEwLjAsBggrBgEFBQcCARYgaHR0cDov +L3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBACe645R88a7A3hfm +5djV9VSwg/S7zV4Fe0+fdWavPOhWfvxyeDgD2StiGwC5+OlgzczOUYrHUDFu4Up+GC9pWbY9ZIEr +44OE5iKHjn3g7gKZYbge9LgriBIWhMIxkziWMaa5O1M/wySTVltpkuzFwbs4AOPsF6m43Md8AYOf +Mke6UiI0HTJ6CVanfCU2qT1L2sCCbwq7EsiHSycR+R4tx5M/nttfJmtS2S6K8RTGRI0Vqbe/vd6m +Gu6uLftIdxf+u+yvGPUqUfA5hJeVbG4bwyvEdGB5JbAKJ9/fXtI5z0V9QkvfsywexcZdylU6oJxp +mo/a77KwPJ+HbBIrZXAVUjEaJM9vMSNQH4xPjyPDdEFjHFWoFN0+4FFQz/EbMFYOkrCChdiDyyJk +vC24JdVUorgG6q2SpCSgwYa1ShNqR88uC1aVVMvOmttqtKay20EIhid392qgQmwLOM7XdVAyksLf +KzAiSNDVQTglXaTpXZ/GlHXQRf0wl0OPkKsKx4ZzYEppLd6leNcG2mqeSz53OiATIgHQv2ieY2Br +NU0LbbqhPcCT4H8js1WtciVORvnSFu+wZMEBnunKoGqYDs/YYPIvSbjkQuE4NRb0yG5P94FW6Lqj +viOvrv1vA+ACOzB2+httQc8Bsem4yWb02ybzOqR08kkkW8mw0FfB+j564ZfJ +-----END CERTIFICATE----- + +SwissSign Silver CA - G2 +======================== +-----BEGIN CERTIFICATE----- +MIIFvTCCA6WgAwIBAgIITxvUL1S7L0swDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCQ0gxFTAT +BgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMB4X +DTA2MTAyNTA4MzI0NloXDTM2MTAyNTA4MzI0NlowRzELMAkGA1UEBhMCQ0gxFTATBgNVBAoTDFN3 +aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMIICIjANBgkqhkiG +9w0BAQEFAAOCAg8AMIICCgKCAgEAxPGHf9N4Mfc4yfjDmUO8x/e8N+dOcbpLj6VzHVxumK4DV644 +N0MvFz0fyM5oEMF4rhkDKxD6LHmD9ui5aLlV8gREpzn5/ASLHvGiTSf5YXu6t+WiE7brYT7QbNHm ++/pe7R20nqA1W6GSy/BJkv6FCgU+5tkL4k+73JU3/JHpMjUi0R86TieFnbAVlDLaYQ1HTWBCrpJH +6INaUFjpiou5XaHc3ZlKHzZnu0jkg7Y360g6rw9njxcH6ATK72oxh9TAtvmUcXtnZLi2kUpCe2Uu +MGoM9ZDulebyzYLs2aFK7PayS+VFheZteJMELpyCbTapxDFkH4aDCyr0NQp4yVXPQbBH6TCfmb5h +qAaEuSh6XzjZG6k4sIN/c8HDO0gqgg8hm7jMqDXDhBuDsz6+pJVpATqJAHgE2cn0mRmrVn5bi4Y5 +FZGkECwJMoBgs5PAKrYYC51+jUnyEEp/+dVGLxmSo5mnJqy7jDzmDrxHB9xzUfFwZC8I+bRHHTBs +ROopN4WSaGa8gzj+ezku01DwH/teYLappvonQfGbGHLy9YR0SslnxFSuSGTfjNFusB3hB48IHpmc +celM2KX3RxIfdNFRnobzwqIjQAtz20um53MGjMGg6cFZrEb65i/4z3GcRm25xBWNOHkDRUjvxF3X +CO6HOSKGsg0PWEP3calILv3q1h8CAwEAAaOBrDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/ +BAUwAwEB/zAdBgNVHQ4EFgQUF6DNweRBtjpbO8tFnb0cwpj6hlgwHwYDVR0jBBgwFoAUF6DNweRB +tjpbO8tFnb0cwpj6hlgwRgYDVR0gBD8wPTA7BglghXQBWQEDAQEwLjAsBggrBgEFBQcCARYgaHR0 +cDovL3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBAHPGgeAn0i0P +4JUw4ppBf1AsX19iYamGamkYDHRJ1l2E6kFSGG9YrVBWIGrGvShpWJHckRE1qTodvBqlYJ7YH39F +kWnZfrt4csEGDyrOj4VwYaygzQu4OSlWhDJOhrs9xCrZ1x9y7v5RoSJBsXECYxqCsGKrXlcSH9/L +3XWgwF15kIwb4FDm3jH+mHtwX6WQ2K34ArZv02DdQEsixT2tOnqfGhpHkXkzuoLcMmkDlm4fS/Bx +/uNncqCxv1yL5PqZIseEuRuNI5c/7SXgz2W79WEE790eslpBIlqhn10s6FvJbakMDHiqYMZWjwFa +DGi8aRl5xB9+lwW/xekkUV7U1UtT7dkjWjYDZaPBA61BMPNGG4WQr2W11bHkFlt4dR2Xem1ZqSqP +e97Dh4kQmUlzeMg9vVE1dCrV8X5pGyq7O70luJpaPXJhkGaH7gzWTdQRdAtq/gsD/KNVV4n+Ssuu +WxcFyPKNIzFTONItaj+CuY0IavdeQXRuwxF+B6wpYJE/OMpXEA29MC/HpeZBoNquBYeaoKRlbEwJ +DIm6uNO5wJOKMPqN5ZprFQFOZ6raYlY+hAhm0sQ2fac+EPyI4NSA5QC9qvNOBqN6avlicuMJT+ub +DgEj8Z+7fNzcbBGXJbLytGMU0gYqZ4yD9c7qB9iaah7s5Aq7KkzrCWA5zspi2C5u +-----END CERTIFICATE----- + +GeoTrust Primary Certification Authority +======================================== +-----BEGIN CERTIFICATE----- +MIIDfDCCAmSgAwIBAgIQGKy1av1pthU6Y2yv2vrEoTANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQG +EwJVUzEWMBQGA1UEChMNR2VvVHJ1c3QgSW5jLjExMC8GA1UEAxMoR2VvVHJ1c3QgUHJpbWFyeSBD +ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNjExMjcwMDAwMDBaFw0zNjA3MTYyMzU5NTlaMFgx +CzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTEwLwYDVQQDEyhHZW9UcnVzdCBQ +cmltYXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB +CgKCAQEAvrgVe//UfH1nrYNke8hCUy3f9oQIIGHWAVlqnEQRr+92/ZV+zmEwu3qDXwK9AWbK7hWN +b6EwnL2hhZ6UOvNWiAAxz9juapYC2e0DjPt1befquFUWBRaa9OBesYjAZIVcFU2Ix7e64HXprQU9 +nceJSOC7KMgD4TCTZF5SwFlwIjVXiIrxlQqD17wxcwE07e9GceBrAqg1cmuXm2bgyxx5X9gaBGge +RwLmnWDiNpcB3841kt++Z8dtd1k7j53WkBWUvEI0EME5+bEnPn7WinXFsq+W06Lem+SYvn3h6YGt +tm/81w7a4DSwDRp35+MImO9Y+pyEtzavwt+s0vQQBnBxNQIDAQABo0IwQDAPBgNVHRMBAf8EBTAD +AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQULNVQQZcVi/CPNmFbSvtr2ZnJM5IwDQYJKoZI +hvcNAQEFBQADggEBAFpwfyzdtzRP9YZRqSa+S7iq8XEN3GHHoOo0Hnp3DwQ16CePbJC/kRYkRj5K +Ts4rFtULUh38H2eiAkUxT87z+gOneZ1TatnaYzr4gNfTmeGl4b7UVXGYNTq+k+qurUKykG/g/CFN +NWMziUnWm07Kx+dOCQD32sfvmWKZd7aVIl6KoKv0uHiYyjgZmclynnjNS6yvGaBzEi38wkG6gZHa +Floxt/m0cYASSJlyc1pZU8FjUjPtp8nSOQJw+uCxQmYpqptR7TBUIhRf2asdweSU8Pj1K/fqynhG +1riR/aYNKxoUAT6A8EKglQdebc3MS6RFjasS6LPeWuWgfOgPIh1a6Vk= +-----END CERTIFICATE----- + +thawte Primary Root CA +====================== +-----BEGIN CERTIFICATE----- +MIIEIDCCAwigAwIBAgIQNE7VVyDV7exJ9C/ON9srbTANBgkqhkiG9w0BAQUFADCBqTELMAkGA1UE +BhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2 +aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhv +cml6ZWQgdXNlIG9ubHkxHzAdBgNVBAMTFnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwHhcNMDYxMTE3 +MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCBqTELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwg +SW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMv +KGMpIDIwMDYgdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxHzAdBgNVBAMT +FnRoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCs +oPD7gFnUnMekz52hWXMJEEUMDSxuaPFsW0hoSVk3/AszGcJ3f8wQLZU0HObrTQmnHNK4yZc2AreJ +1CRfBsDMRJSUjQJib+ta3RGNKJpchJAQeg29dGYvajig4tVUROsdB58Hum/u6f1OCyn1PoSgAfGc +q/gcfomk6KHYcWUNo1F77rzSImANuVud37r8UVsLr5iy6S7pBOhih94ryNdOwUxkHt3Ph1i6Sk/K +aAcdHJ1KxtUvkcx8cXIcxcBn6zL9yZJclNqFwJu/U30rCfSMnZEfl2pSy94JNqR32HuHUETVPm4p +afs5SSYeCaWAe0At6+gnhcn+Yf1+5nyXHdWdAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYD +VR0PAQH/BAQDAgEGMB0GA1UdDgQWBBR7W0XPr87Lev0xkhpqtvNG61dIUDANBgkqhkiG9w0BAQUF +AAOCAQEAeRHAS7ORtvzw6WfUDW5FvlXok9LOAz/t2iWwHVfLHjp2oEzsUHboZHIMpKnxuIvW1oeE +uzLlQRHAd9mzYJ3rG9XRbkREqaYB7FViHXe4XI5ISXycO1cRrK1zN44veFyQaEfZYGDm/Ac9IiAX +xPcW6cTYcvnIc3zfFi8VqT79aie2oetaupgf1eNNZAqdE8hhuvU5HIe6uL17In/2/qxAeeWsEG89 +jxt5dovEN7MhGITlNgDrYyCZuen+MwS7QcjBAvlEYyCegc5C09Y/LHbTY5xZ3Y+m4Q6gLkH3LpVH +z7z9M/P2C2F+fpErgUfCJzDupxBdN49cOSvkBPB7jVaMaA== +-----END CERTIFICATE----- + +VeriSign Class 3 Public Primary Certification Authority - G5 +============================================================ +-----BEGIN CERTIFICATE----- +MIIE0zCCA7ugAwIBAgIQGNrRniZ96LtKIVjNzGs7SjANBgkqhkiG9w0BAQUFADCByjELMAkGA1UE +BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO +ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk +IHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRp +ZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwHhcNMDYxMTA4MDAwMDAwWhcNMzYwNzE2MjM1OTU5WjCB +yjELMAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2ln +biBUcnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNiBWZXJpU2lnbiwgSW5jLiAtIEZvciBh +dXRob3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmlt +YXJ5IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw +ggEKAoIBAQCvJAgIKXo1nmAMqudLO07cfLw8RRy7K+D+KQL5VwijZIUVJ/XxrcgxiV0i6CqqpkKz +j/i5Vbext0uz/o9+B1fs70PbZmIVYc9gDaTY3vjgw2IIPVQT60nKWVSFJuUrjxuf6/WhkcIzSdhD +Y2pSS9KP6HBRTdGJaXvHcPaz3BJ023tdS1bTlr8Vd6Gw9KIl8q8ckmcY5fQGBO+QueQA5N06tRn/ +Arr0PO7gi+s3i+z016zy9vA9r911kTMZHRxAy3QkGSGT2RT+rCpSx4/VBEnkjWNHiDxpg8v+R70r +fk/Fla4OndTRQ8Bnc+MUCH7lP59zuDMKz10/NIeWiu5T6CUVAgMBAAGjgbIwga8wDwYDVR0TAQH/ +BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2Uv +Z2lmMCEwHzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVy +aXNpZ24uY29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFH/TZafC3ey78DAJ80M5+gKvMzEzMA0GCSqG +SIb3DQEBBQUAA4IBAQCTJEowX2LP2BqYLz3q3JktvXf2pXkiOOzEp6B4Eq1iDkVwZMXnl2YtmAl+ +X6/WzChl8gGqCBpH3vn5fJJaCGkgDdk+bW48DW7Y5gaRQBi5+MHt39tBquCWIMnNZBU4gcmU7qKE +KQsTb47bDN0lAtukixlE0kF6BWlKWE9gyn6CagsCqiUXObXbf+eEZSqVir2G3l6BFoMtEMze/aiC +Km0oHw0LxOXnGiYZ4fQRbxC1lfznQgUy286dUV4otp6F01vvpX1FQHKOtw5rDgb7MzVIcbidJ4vE +ZV8NhnacRHr2lVz2XTIIM6RUthg/aFzyQkqFOFSDX9HoLPKsEdao7WNq +-----END CERTIFICATE----- + +SecureTrust CA +============== +-----BEGIN CERTIFICATE----- +MIIDuDCCAqCgAwIBAgIQDPCOXAgWpa1Cf/DrJxhZ0DANBgkqhkiG9w0BAQUFADBIMQswCQYDVQQG +EwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xFzAVBgNVBAMTDlNlY3VyZVRy +dXN0IENBMB4XDTA2MTEwNzE5MzExOFoXDTI5MTIzMTE5NDA1NVowSDELMAkGA1UEBhMCVVMxIDAe +BgNVBAoTF1NlY3VyZVRydXN0IENvcnBvcmF0aW9uMRcwFQYDVQQDEw5TZWN1cmVUcnVzdCBDQTCC +ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKukgeWVzfX2FI7CT8rU4niVWJxB4Q2ZQCQX +OZEzZum+4YOvYlyJ0fwkW2Gz4BERQRwdbvC4u/jep4G6pkjGnx29vo6pQT64lO0pGtSO0gMdA+9t +DWccV9cGrcrI9f4Or2YlSASWC12juhbDCE/RRvgUXPLIXgGZbf2IzIaowW8xQmxSPmjL8xk037uH +GFaAJsTQ3MBv396gwpEWoGQRS0S8Hvbn+mPeZqx2pHGj7DaUaHp3pLHnDi+BeuK1cobvomuL8A/b +01k/unK8RCSc43Oz969XL0Imnal0ugBS8kvNU3xHCzaFDmapCJcWNFfBZveA4+1wVMeT4C4oFVmH +ursCAwEAAaOBnTCBmjATBgkrBgEEAYI3FAIEBh4EAEMAQTALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/ +BAUwAwEB/zAdBgNVHQ4EFgQUQjK2FvoE/f5dS3rD/fdMQB1aQ68wNAYDVR0fBC0wKzApoCegJYYj +aHR0cDovL2NybC5zZWN1cmV0cnVzdC5jb20vU1RDQS5jcmwwEAYJKwYBBAGCNxUBBAMCAQAwDQYJ +KoZIhvcNAQEFBQADggEBADDtT0rhWDpSclu1pqNlGKa7UTt36Z3q059c4EVlew3KW+JwULKUBRSu +SceNQQcSc5R+DCMh/bwQf2AQWnL1mA6s7Ll/3XpvXdMc9P+IBWlCqQVxyLesJugutIxq/3HcuLHf +mbx8IVQr5Fiiu1cprp6poxkmD5kuCLDv/WnPmRoJjeOnnyvJNjR7JLN4TJUXpAYmHrZkUjZfYGfZ +nMUFdAvnZyPSCPyI6a6Lf+Ew9Dd+/cYy2i2eRDAwbO4H3tI0/NL/QPZL9GZGBlSm8jIKYyYwa5vR +3ItHuuG51WLQoqD0ZwV4KWMabwTW+MZMo5qxN7SN5ShLHZ4swrhovO0C7jE= +-----END CERTIFICATE----- + +Secure Global CA +================ +-----BEGIN CERTIFICATE----- +MIIDvDCCAqSgAwIBAgIQB1YipOjUiolN9BPI8PjqpTANBgkqhkiG9w0BAQUFADBKMQswCQYDVQQG +EwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBH +bG9iYWwgQ0EwHhcNMDYxMTA3MTk0MjI4WhcNMjkxMjMxMTk1MjA2WjBKMQswCQYDVQQGEwJVUzEg +MB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBHbG9iYWwg +Q0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvNS7YrGxVaQZx5RNoJLNP2MwhR/jx +YDiJiQPpvepeRlMJ3Fz1Wuj3RSoC6zFh1ykzTM7HfAo3fg+6MpjhHZevj8fcyTiW89sa/FHtaMbQ +bqR8JNGuQsiWUGMu4P51/pinX0kuleM5M2SOHqRfkNJnPLLZ/kG5VacJjnIFHovdRIWCQtBJwB1g +8NEXLJXr9qXBkqPFwqcIYA1gBBCWeZ4WNOaptvolRTnIHmX5k/Wq8VLcmZg9pYYaDDUz+kulBAYV +HDGA76oYa8J719rO+TMg1fW9ajMtgQT7sFzUnKPiXB3jqUJ1XnvUd+85VLrJChgbEplJL4hL/VBi +0XPnj3pDAgMBAAGjgZ0wgZowEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1Ud +EwEB/wQFMAMBAf8wHQYDVR0OBBYEFK9EBMJBfkiD2045AuzshHrmzsmkMDQGA1UdHwQtMCswKaAn +oCWGI2h0dHA6Ly9jcmwuc2VjdXJldHJ1c3QuY29tL1NHQ0EuY3JsMBAGCSsGAQQBgjcVAQQDAgEA +MA0GCSqGSIb3DQEBBQUAA4IBAQBjGghAfaReUw132HquHw0LURYD7xh8yOOvaliTFGCRsoTciE6+ +OYo68+aCiV0BN7OrJKQVDpI1WkpEXk5X+nXOH0jOZvQ8QCaSmGwb7iRGDBezUqXbpZGRzzfTb+cn +CDpOGR86p1hcF895P4vkp9MmI50mD1hp/Ed+stCNi5O/KU9DaXR2Z0vPB4zmAve14bRDtUstFJ/5 +3CYNv6ZHdAbYiNE6KTCEztI5gGIbqMdXSbxqVVFnFUq+NQfk1XWYN3kwFNspnWzFacxHVaIw98xc +f8LDmBxrThaA63p4ZUWiABqvDA1VZDRIuJK58bRQKfJPIx/abKwfROHdI3hRW8cW +-----END CERTIFICATE----- + +COMODO Certification Authority +============================== +-----BEGIN CERTIFICATE----- +MIIEHTCCAwWgAwIBAgIQToEtioJl4AsC7j41AkblPTANBgkqhkiG9w0BAQUFADCBgTELMAkGA1UE +BhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgG +A1UEChMRQ09NT0RPIENBIExpbWl0ZWQxJzAlBgNVBAMTHkNPTU9ETyBDZXJ0aWZpY2F0aW9uIEF1 +dGhvcml0eTAeFw0wNjEyMDEwMDAwMDBaFw0yOTEyMzEyMzU5NTlaMIGBMQswCQYDVQQGEwJHQjEb +MBkGA1UECBMSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRowGAYDVQQKExFD +T01PRE8gQ0EgTGltaXRlZDEnMCUGA1UEAxMeQ09NT0RPIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0ECLi3LjkRv3UcEbVASY06m/weaKXTuH ++7uIzg3jLz8GlvCiKVCZrts7oVewdFFxze1CkU1B/qnI2GqGd0S7WWaXUF601CxwRM/aN5VCaTww +xHGzUvAhTaHYujl8HJ6jJJ3ygxaYqhZ8Q5sVW7euNJH+1GImGEaaP+vB+fGQV+useg2L23IwambV +4EajcNxo2f8ESIl33rXp+2dtQem8Ob0y2WIC8bGoPW43nOIv4tOiJovGuFVDiOEjPqXSJDlqR6sA +1KGzqSX+DT+nHbrTUcELpNqsOO9VUCQFZUaTNE8tja3G1CEZ0o7KBWFxB3NH5YoZEr0ETc5OnKVI +rLsm9wIDAQABo4GOMIGLMB0GA1UdDgQWBBQLWOWLxkwVN6RAqTCpIb5HNlpW/zAOBgNVHQ8BAf8E +BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zBJBgNVHR8EQjBAMD6gPKA6hjhodHRwOi8vY3JsLmNvbW9k +b2NhLmNvbS9DT01PRE9DZXJ0aWZpY2F0aW9uQXV0aG9yaXR5LmNybDANBgkqhkiG9w0BAQUFAAOC +AQEAPpiem/Yb6dc5t3iuHXIYSdOH5EOC6z/JqvWote9VfCFSZfnVDeFs9D6Mk3ORLgLETgdxb8CP +OGEIqB6BCsAvIC9Bi5HcSEW88cbeunZrM8gALTFGTO3nnc+IlP8zwFboJIYmuNg4ON8qa90SzMc/ +RxdMosIGlgnW2/4/PEZB31jiVg88O8EckzXZOFKs7sjsLjBOlDW0JB9LeGna8gI4zJVSk/BwJVmc +IGfE7vmLV2H0knZ9P4SNVbfo5azV8fUZVqZa+5Acr5Pr5RzUZ5ddBA6+C4OmF4O5MBKgxTMVBbkN ++8cFduPYSo38NBejxiEovjBFMR7HeL5YYTisO+IBZQ== +-----END CERTIFICATE----- + +Network Solutions Certificate Authority +======================================= +-----BEGIN CERTIFICATE----- +MIID5jCCAs6gAwIBAgIQV8szb8JcFuZHFhfjkDFo4DANBgkqhkiG9w0BAQUFADBiMQswCQYDVQQG +EwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMuMTAwLgYDVQQDEydOZXR3b3Jr +IFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDYxMjAxMDAwMDAwWhcNMjkxMjMx +MjM1OTU5WjBiMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMu +MTAwLgYDVQQDEydOZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0G +CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDkvH6SMG3G2I4rC7xGzuAnlt7e+foS0zwzc7MEL7xx +jOWftiJgPl9dzgn/ggwbmlFQGiaJ3dVhXRncEg8tCqJDXRfQNJIg6nPPOCwGJgl6cvf6UDL4wpPT +aaIjzkGxzOTVHzbRijr4jGPiFFlp7Q3Tf2vouAPlT2rlmGNpSAW+Lv8ztumXWWn4Zxmuk2GWRBXT +crA/vGp97Eh/jcOrqnErU2lBUzS1sLnFBgrEsEX1QV1uiUV7PTsmjHTC5dLRfbIR1PtYMiKagMnc +/Qzpf14Dl847ABSHJ3A4qY5usyd2mFHgBeMhqxrVhSI8KbWaFsWAqPS7azCPL0YCorEMIuDTAgMB +AAGjgZcwgZQwHQYDVR0OBBYEFCEwyfsA106Y2oeqKtCnLrFAMadMMA4GA1UdDwEB/wQEAwIBBjAP +BgNVHRMBAf8EBTADAQH/MFIGA1UdHwRLMEkwR6BFoEOGQWh0dHA6Ly9jcmwubmV0c29sc3NsLmNv +bS9OZXR3b3JrU29sdXRpb25zQ2VydGlmaWNhdGVBdXRob3JpdHkuY3JsMA0GCSqGSIb3DQEBBQUA +A4IBAQC7rkvnt1frf6ott3NHhWrB5KUd5Oc86fRZZXe1eltajSU24HqXLjjAV2CDmAaDn7l2em5Q +4LqILPxFzBiwmZVRDuwduIj/h1AcgsLj4DKAv6ALR8jDMe+ZZzKATxcheQxpXN5eNK4CtSbqUN9/ +GGUsyfJj4akH/nxxH2szJGoeBfcFaMBqEssuXmHLrijTfsK0ZpEmXzwuJF/LWA/rKOyvEZbz3Htv +wKeI8lN3s2Berq4o2jUsbzRF0ybh3uxbTydrFny9RAQYgrOJeRcQcT16ohZO9QHNpGxlaKFJdlxD +ydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey +-----END CERTIFICATE----- + +COMODO ECC Certification Authority +================================== +-----BEGIN CERTIFICATE----- +MIICiTCCAg+gAwIBAgIQH0evqmIAcFBUTAGem2OZKjAKBggqhkjOPQQDAzCBhTELMAkGA1UEBhMC +R0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UE +ChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBB +dXRob3JpdHkwHhcNMDgwMzA2MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0Ix +GzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR +Q09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBBdXRo +b3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQDR3svdcmCFYX7deSRFtSrYpn1PlILBs5BAH+X +4QokPB0BBO490o0JlwzgdeT6+3eKKvUDYEs2ixYjFq0JcfRK9ChQtP6IHG4/bC8vCVlbpVsLM5ni +wz2J+Wos77LTBumjQjBAMB0GA1UdDgQWBBR1cacZSBm8nZ3qQUfflMRId5nTeTAOBgNVHQ8BAf8E +BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjEA7wNbeqy3eApyt4jf/7VG +FAkK+qDmfQjGGoe9GKhzvSbKYAydzpmfz1wPMOG+FDHqAjAU9JM8SaczepBGR7NjfRObTrdvGDeA +U/7dIOA1mjbRxwG55tzd8/8dLDoWV9mSOdY= +-----END CERTIFICATE----- + +Security Communication EV RootCA1 +================================= +-----BEGIN CERTIFICATE----- +MIIDfTCCAmWgAwIBAgIBADANBgkqhkiG9w0BAQUFADBgMQswCQYDVQQGEwJKUDElMCMGA1UEChMc +U0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEqMCgGA1UECxMhU2VjdXJpdHkgQ29tbXVuaWNh +dGlvbiBFViBSb290Q0ExMB4XDTA3MDYwNjAyMTIzMloXDTM3MDYwNjAyMTIzMlowYDELMAkGA1UE +BhMCSlAxJTAjBgNVBAoTHFNFQ09NIFRydXN0IFN5c3RlbXMgQ08uLExURC4xKjAoBgNVBAsTIVNl +Y3VyaXR5IENvbW11bmljYXRpb24gRVYgUm9vdENBMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBALx/7FebJOD+nLpCeamIivqA4PUHKUPqjgo0No0c+qe1OXj/l3X3L+SqawSERMqm4miO +/VVQYg+kcQ7OBzgtQoVQrTyWb4vVog7P3kmJPdZkLjjlHmy1V4qe70gOzXppFodEtZDkBp2uoQSX +WHnvIEqCa4wiv+wfD+mEce3xDuS4GBPMVjZd0ZoeUWs5bmB2iDQL87PRsJ3KYeJkHcFGB7hj3R4z +ZbOOCVVSPbW9/wfrrWFVGCypaZhKqkDFMxRldAD5kd6vA0jFQFTcD4SQaCDFkpbcLuUCRarAX1T4 +bepJz11sS6/vmsJWXMY1VkJqMF/Cq/biPT+zyRGPMUzXn0kCAwEAAaNCMEAwHQYDVR0OBBYEFDVK +9U2vP9eCOKyrcWUXdYydVZPmMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqG +SIb3DQEBBQUAA4IBAQCoh+ns+EBnXcPBZsdAS5f8hxOQWsTvoMpfi7ent/HWtWS3irO4G8za+6xm +iEHO6Pzk2x6Ipu0nUBsCMCRGef4Eh3CXQHPRwMFXGZpppSeZq51ihPZRwSzJIxXYKLerJRO1RuGG +Av8mjMSIkh1W/hln8lXkgKNrnKt34VFxDSDbEJrbvXZ5B3eZKK2aXtqxT0QsNY6llsf9g/BYxnnW +mHyojf6GPgcWkuF75x3sM3Z+Qi5KhfmRiWiEA4Glm5q+4zfFVKtWOxgtQaQM+ELbmaDgcm+7XeEW +T1MKZPlO9L9OVL14bIjqv5wTJMJwaaJ/D8g8rQjJsJhAoyrniIPtd490 +-----END CERTIFICATE----- + +OISTE WISeKey Global Root GA CA +=============================== +-----BEGIN CERTIFICATE----- +MIID8TCCAtmgAwIBAgIQQT1yx/RrH4FDffHSKFTfmjANBgkqhkiG9w0BAQUFADCBijELMAkGA1UE +BhMCQ0gxEDAOBgNVBAoTB1dJU2VLZXkxGzAZBgNVBAsTEkNvcHlyaWdodCAoYykgMjAwNTEiMCAG +A1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNlZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBH +bG9iYWwgUm9vdCBHQSBDQTAeFw0wNTEyMTExNjAzNDRaFw0zNzEyMTExNjA5NTFaMIGKMQswCQYD +VQQGEwJDSDEQMA4GA1UEChMHV0lTZUtleTEbMBkGA1UECxMSQ29weXJpZ2h0IChjKSAyMDA1MSIw +IAYDVQQLExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBXSVNlS2V5 +IEdsb2JhbCBSb290IEdBIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAy0+zAJs9 +Nt350UlqaxBJH+zYK7LG+DKBKUOVTJoZIyEVRd7jyBxRVVuuk+g3/ytr6dTqvirdqFEr12bDYVxg +Asj1znJ7O7jyTmUIms2kahnBAbtzptf2w93NvKSLtZlhuAGio9RN1AU9ka34tAhxZK9w8RxrfvbD +d50kc3vkDIzh2TbhmYsFmQvtRTEJysIA2/dyoJaqlYfQjse2YXMNdmaM3Bu0Y6Kff5MTMPGhJ9vZ +/yxViJGg4E8HsChWjBgbl0SOid3gF27nKu+POQoxhILYQBRJLnpB5Kf+42TMwVlxSywhp1t94B3R +LoGbw9ho972WG6xwsRYUC9tguSYBBQIDAQABo1EwTzALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUw +AwEB/zAdBgNVHQ4EFgQUswN+rja8sHnR3JQmthG+IbJphpQwEAYJKwYBBAGCNxUBBAMCAQAwDQYJ +KoZIhvcNAQEFBQADggEBAEuh/wuHbrP5wUOxSPMowB0uyQlB+pQAHKSkq0lPjz0e701vvbyk9vIm +MMkQyh2I+3QZH4VFvbBsUfk2ftv1TDI6QU9bR8/oCy22xBmddMVHxjtqD6wU2zz0c5ypBd8A3HR4 ++vg1YFkCExh8vPtNsCBtQ7tgMHpnM1zFmdH4LTlSc/uMqpclXHLZCB6rTjzjgTGfA6b7wP4piFXa +hNVQA7bihKOmNqoROgHhGEvWRGizPflTdISzRpFGlgC3gCy24eMQ4tui5yiPAZZiFj4A4xylNoEY +okxSdsARo27mHbrjWr42U8U+dY+GaSlYU7Wcu2+fXMUY7N0v4ZjJ/L7fCg0= +-----END CERTIFICATE----- + +Certigna +======== +-----BEGIN CERTIFICATE----- +MIIDqDCCApCgAwIBAgIJAP7c4wEPyUj/MA0GCSqGSIb3DQEBBQUAMDQxCzAJBgNVBAYTAkZSMRIw +EAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hMB4XDTA3MDYyOTE1MTMwNVoXDTI3 +MDYyOTE1MTMwNVowNDELMAkGA1UEBhMCRlIxEjAQBgNVBAoMCURoaW15b3RpczERMA8GA1UEAwwI +Q2VydGlnbmEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDIaPHJ1tazNHUmgh7stL7q +XOEm7RFHYeGifBZ4QCHkYJ5ayGPhxLGWkv8YbWkj4Sti993iNi+RB7lIzw7sebYs5zRLcAglozyH +GxnygQcPOJAZ0xH+hrTy0V4eHpbNgGzOOzGTtvKg0KmVEn2lmsxryIRWijOp5yIVUxbwzBfsV1/p +ogqYCd7jX5xv3EjjhQsVWqa6n6xI4wmy9/Qy3l40vhx4XUJbzg4ij02Q130yGLMLLGq/jj8UEYkg +DncUtT2UCIf3JR7VsmAA7G8qKCVuKj4YYxclPz5EIBb2JsglrgVKtOdjLPOMFlN+XPsRGgjBRmKf +Irjxwo1p3Po6WAbfAgMBAAGjgbwwgbkwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUGu3+QTmQ +tCRZvgHyUtVF9lo53BEwZAYDVR0jBF0wW4AUGu3+QTmQtCRZvgHyUtVF9lo53BGhOKQ2MDQxCzAJ +BgNVBAYTAkZSMRIwEAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hggkA/tzjAQ/J +SP8wDgYDVR0PAQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIABzANBgkqhkiG9w0BAQUFAAOCAQEA +hQMeknH2Qq/ho2Ge6/PAD/Kl1NqV5ta+aDY9fm4fTIrv0Q8hbV6lUmPOEvjvKtpv6zf+EwLHyzs+ +ImvaYS5/1HI93TDhHkxAGYwP15zRgzB7mFncfca5DClMoTOi62c6ZYTTluLtdkVwj7Ur3vkj1klu +PBS1xp81HlDQwY9qcEQCYsuuHWhBp6pX6FOqB9IG9tUUBguRA3UsbHK1YZWaDYu5Def131TN3ubY +1gkIl2PlwS6wt0QmwCbAr1UwnjvVNioZBPRcHv/PLLf/0P2HQBHVESO7SMAhqaQoLf0V+LBOK/Qw +WyH8EZE0vkHve52Xdf+XlcCWWC/qu0bXu+TZLg== +-----END CERTIFICATE----- + +Deutsche Telekom Root CA 2 +========================== +-----BEGIN CERTIFICATE----- +MIIDnzCCAoegAwIBAgIBJjANBgkqhkiG9w0BAQUFADBxMQswCQYDVQQGEwJERTEcMBoGA1UEChMT +RGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0GA1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRlcjEjMCEG +A1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBSb290IENBIDIwHhcNOTkwNzA5MTIxMTAwWhcNMTkwNzA5 +MjM1OTAwWjBxMQswCQYDVQQGEwJERTEcMBoGA1UEChMTRGV1dHNjaGUgVGVsZWtvbSBBRzEfMB0G +A1UECxMWVC1UZWxlU2VjIFRydXN0IENlbnRlcjEjMCEGA1UEAxMaRGV1dHNjaGUgVGVsZWtvbSBS +b290IENBIDIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCrC6M14IspFLEUha88EOQ5 +bzVdSq7d6mGNlUn0b2SjGmBmpKlAIoTZ1KXleJMOaAGtuU1cOs7TuKhCQN/Po7qCWWqSG6wcmtoI +KyUn+WkjR/Hg6yx6m/UTAtB+NHzCnjwAWav12gz1MjwrrFDa1sPeg5TKqAyZMg4ISFZbavva4VhY +AUlfckE8FQYBjl2tqriTtM2e66foai1SNNs671x1Udrb8zH57nGYMsRUFUQM+ZtV7a3fGAigo4aK +Se5TBY8ZTNXeWHmb0mocQqvF1afPaA+W5OFhmHZhyJF81j4A4pFQh+GdCuatl9Idxjp9y7zaAzTV +jlsB9WoHtxa2bkp/AgMBAAGjQjBAMB0GA1UdDgQWBBQxw3kbuvVT1xfgiXotF2wKsyudMzAPBgNV +HRMECDAGAQH/AgEFMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQUFAAOCAQEAlGRZrTlk5ynr +E/5aw4sTV8gEJPB0d8Bg42f76Ymmg7+Wgnxu1MM9756AbrsptJh6sTtU6zkXR34ajgv8HzFZMQSy +zhfzLMdiNlXiItiJVbSYSKpk+tYcNthEeFpaIzpXl/V6ME+un2pMSyuOoAPjPuCp1NJ70rOo4nI8 +rZ7/gFnkm0W09juwzTkZmDLl6iFhkOQxIY40sfcvNUqFENrnijchvllj4PKFiDFT1FQUhXB59C4G +dyd1Lx+4ivn+xbrYNuSD7Odlt79jWvNGr4GUN9RBjNYj1h7P9WgbRGOiWrqnNVmh5XAFmw4jV5mU +Cm26OWMohpLzGITY+9HPBVZkVw== +-----END CERTIFICATE----- + +Cybertrust Global Root +====================== +-----BEGIN CERTIFICATE----- +MIIDoTCCAomgAwIBAgILBAAAAAABD4WqLUgwDQYJKoZIhvcNAQEFBQAwOzEYMBYGA1UEChMPQ3li +ZXJ0cnVzdCwgSW5jMR8wHQYDVQQDExZDeWJlcnRydXN0IEdsb2JhbCBSb290MB4XDTA2MTIxNTA4 +MDAwMFoXDTIxMTIxNTA4MDAwMFowOzEYMBYGA1UEChMPQ3liZXJ0cnVzdCwgSW5jMR8wHQYDVQQD +ExZDeWJlcnRydXN0IEdsb2JhbCBSb290MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA ++Mi8vRRQZhP/8NN57CPytxrHjoXxEnOmGaoQ25yiZXRadz5RfVb23CO21O1fWLE3TdVJDm71aofW +0ozSJ8bi/zafmGWgE07GKmSb1ZASzxQG9Dvj1Ci+6A74q05IlG2OlTEQXO2iLb3VOm2yHLtgwEZL +AfVJrn5GitB0jaEMAs7u/OePuGtm839EAL9mJRQr3RAwHQeWP032a7iPt3sMpTjr3kfb1V05/Iin +89cqdPHoWqI7n1C6poxFNcJQZZXcY4Lv3b93TZxiyWNzFtApD0mpSPCzqrdsxacwOUBdrsTiXSZT +8M4cIwhhqJQZugRiQOwfOHB3EgZxpzAYXSUnpQIDAQABo4GlMIGiMA4GA1UdDwEB/wQEAwIBBjAP +BgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBS2CHsNesysIEyGVjJez6tuhS1wVzA/BgNVHR8EODA2 +MDSgMqAwhi5odHRwOi8vd3d3Mi5wdWJsaWMtdHJ1c3QuY29tL2NybC9jdC9jdHJvb3QuY3JsMB8G +A1UdIwQYMBaAFLYIew16zKwgTIZWMl7Pq26FLXBXMA0GCSqGSIb3DQEBBQUAA4IBAQBW7wojoFRO +lZfJ+InaRcHUowAl9B8Tq7ejhVhpwjCt2BWKLePJzYFa+HMjWqd8BfP9IjsO0QbE2zZMcwSO5bAi +5MXzLqXZI+O4Tkogp24CJJ8iYGd7ix1yCcUxXOl5n4BHPa2hCwcUPUf/A2kaDAtE52Mlp3+yybh2 +hO0j9n0Hq0V+09+zv+mKts2oomcrUtW3ZfA5TGOgkXmTUg9U3YO7n9GPp1Nzw8v/MOx8BLjYRB+T +X3EJIrduPuocA06dGiBh+4E37F78CkWr1+cXVdCg6mCbpvbjjFspwgZgFJ0tl0ypkxWdYcQBX0jW +WL1WMRJOEcgh4LMRkWXbtKaIOM5V +-----END CERTIFICATE----- + +ePKI Root Certification Authority +================================= +-----BEGIN CERTIFICATE----- +MIIFsDCCA5igAwIBAgIQFci9ZUdcr7iXAF7kBtK8nTANBgkqhkiG9w0BAQUFADBeMQswCQYDVQQG +EwJUVzEjMCEGA1UECgwaQ2h1bmdod2EgVGVsZWNvbSBDby4sIEx0ZC4xKjAoBgNVBAsMIWVQS0kg +Um9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNDEyMjAwMjMxMjdaFw0zNDEyMjAwMjMx +MjdaMF4xCzAJBgNVBAYTAlRXMSMwIQYDVQQKDBpDaHVuZ2h3YSBUZWxlY29tIENvLiwgTHRkLjEq +MCgGA1UECwwhZVBLSSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0B +AQEFAAOCAg8AMIICCgKCAgEA4SUP7o3biDN1Z82tH306Tm2d0y8U82N0ywEhajfqhFAHSyZbCUNs +IZ5qyNUD9WBpj8zwIuQf5/dqIjG3LBXy4P4AakP/h2XGtRrBp0xtInAhijHyl3SJCRImHJ7K2RKi +lTza6We/CKBk49ZCt0Xvl/T29de1ShUCWH2YWEtgvM3XDZoTM1PRYfl61dd4s5oz9wCGzh1NlDiv +qOx4UXCKXBCDUSH3ET00hl7lSM2XgYI1TBnsZfZrxQWh7kcT1rMhJ5QQCtkkO7q+RBNGMD+XPNjX +12ruOzjjK9SXDrkb5wdJfzcq+Xd4z1TtW0ado4AOkUPB1ltfFLqfpo0kR0BZv3I4sjZsN/+Z0V0O +WQqraffAsgRFelQArr5T9rXn4fg8ozHSqf4hUmTFpmfwdQcGlBSBVcYn5AGPF8Fqcde+S/uUWH1+ +ETOxQvdibBjWzwloPn9s9h6PYq2lY9sJpx8iQkEeb5mKPtf5P0B6ebClAZLSnT0IFaUQAS2zMnao +lQ2zepr7BxB4EW/hj8e6DyUadCrlHJhBmd8hh+iVBmoKs2pHdmX2Os+PYhcZewoozRrSgx4hxyy/ +vv9haLdnG7t4TY3OZ+XkwY63I2binZB1NJipNiuKmpS5nezMirH4JYlcWrYvjB9teSSnUmjDhDXi +Zo1jDiVN1Rmy5nk3pyKdVDECAwEAAaNqMGgwHQYDVR0OBBYEFB4M97Zn8uGSJglFwFU5Lnc/Qkqi +MAwGA1UdEwQFMAMBAf8wOQYEZyoHAAQxMC8wLQIBADAJBgUrDgMCGgUAMAcGBWcqAwAABBRFsMLH +ClZ87lt4DJX5GFPBphzYEDANBgkqhkiG9w0BAQUFAAOCAgEACbODU1kBPpVJufGBuvl2ICO1J2B0 +1GqZNF5sAFPZn/KmsSQHRGoqxqWOeBLoR9lYGxMqXnmbnwoqZ6YlPwZpVnPDimZI+ymBV3QGypzq +KOg4ZyYr8dW1P2WT+DZdjo2NQCCHGervJ8A9tDkPJXtoUHRVnAxZfVo9QZQlUgjgRywVMRnVvwdV +xrsStZf0X4OFunHB2WyBEXYKCrC/gpf36j36+uwtqSiUO1bd0lEursC9CBWMd1I0ltabrNMdjmEP +NXubrjlpC2JgQCA2j6/7Nu4tCEoduL+bXPjqpRugc6bY+G7gMwRfaKonh+3ZwZCc7b3jajWvY9+r +GNm65ulK6lCKD2GTHuItGeIwlDWSXQ62B68ZgI9HkFFLLk3dheLSClIKF5r8GrBQAuUBo2M3IUxE +xJtRmREOc5wGj1QupyheRDmHVi03vYVElOEMSyycw5KFNGHLD7ibSkNS/jQ6fbjpKdx2qcgw+BRx +gMYeNkh0IkFch4LoGHGLQYlE535YW6i4jRPpp2zDR+2zGp1iro2C6pSe3VkQw63d4k3jMdXH7Ojy +sP6SHhYKGvzZ8/gntsm+HbRsZJB/9OTEW9c3rkIO3aQab3yIVMUWbuF6aC74Or8NpDyJO3inTmOD +BCEIZ43ygknQW/2xzQ+DhNQ+IIX3Sj0rnP0qCglN6oH4EZw= +-----END CERTIFICATE----- + +T\xc3\x9c\x42\xC4\xB0TAK UEKAE K\xC3\xB6k Sertifika Hizmet Sa\xC4\x9Flay\xc4\xb1\x63\xc4\xb1s\xc4\xb1 - S\xC3\xBCr\xC3\xBCm 3 +============================================================================================================================= +-----BEGIN CERTIFICATE----- +MIIFFzCCA/+gAwIBAgIBETANBgkqhkiG9w0BAQUFADCCASsxCzAJBgNVBAYTAlRSMRgwFgYDVQQH +DA9HZWJ6ZSAtIEtvY2FlbGkxRzBFBgNVBAoMPlTDvHJraXllIEJpbGltc2VsIHZlIFRla25vbG9q +aWsgQXJhxZ90xLFybWEgS3VydW11IC0gVMOcQsSwVEFLMUgwRgYDVQQLDD9VbHVzYWwgRWxla3Ry +b25payB2ZSBLcmlwdG9sb2ppIEFyYcWfdMSxcm1hIEVuc3RpdMO8c8O8IC0gVUVLQUUxIzAhBgNV +BAsMGkthbXUgU2VydGlmaWthc3lvbiBNZXJrZXppMUowSAYDVQQDDEFUw5xCxLBUQUsgVUVLQUUg +S8O2ayBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsSAtIFPDvHLDvG0gMzAeFw0wNzA4 +MjQxMTM3MDdaFw0xNzA4MjExMTM3MDdaMIIBKzELMAkGA1UEBhMCVFIxGDAWBgNVBAcMD0dlYnpl +IC0gS29jYWVsaTFHMEUGA1UECgw+VMO8cmtpeWUgQmlsaW1zZWwgdmUgVGVrbm9sb2ppayBBcmHF +n3TEsXJtYSBLdXJ1bXUgLSBUw5xCxLBUQUsxSDBGBgNVBAsMP1VsdXNhbCBFbGVrdHJvbmlrIHZl +IEtyaXB0b2xvamkgQXJhxZ90xLFybWEgRW5zdGl0w7xzw7wgLSBVRUtBRTEjMCEGA1UECwwaS2Ft +dSBTZXJ0aWZpa2FzeW9uIE1lcmtlemkxSjBIBgNVBAMMQVTDnELEsFRBSyBVRUtBRSBLw7ZrIFNl +cnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxIC0gU8O8csO8bSAzMIIBIjANBgkqhkiG9w0B +AQEFAAOCAQ8AMIIBCgKCAQEAim1L/xCIOsP2fpTo6iBkcK4hgb46ezzb8R1Sf1n68yJMlaCQvEhO +Eav7t7WNeoMojCZG2E6VQIdhn8WebYGHV2yKO7Rm6sxA/OOqbLLLAdsyv9Lrhc+hDVXDWzhXcLh1 +xnnRFDDtG1hba+818qEhTsXOfJlfbLm4IpNQp81McGq+agV/E5wrHur+R84EpW+sky58K5+eeROR +6Oqeyjh1jmKwlZMq5d/pXpduIF9fhHpEORlAHLpVK/swsoHvhOPc7Jg4OQOFCKlUAwUp8MmPi+oL +hmUZEdPpCSPeaJMDyTYcIW7OjGbxmTDY17PDHfiBLqi9ggtm/oLL4eAagsNAgQIDAQABo0IwQDAd +BgNVHQ4EFgQUvYiHyY/2pAoLquvF/pEjnatKijIwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF +MAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAB18+kmPNOm3JpIWmgV050vQbTlswyb2zrgxvMTfvCr4 +N5EY3ATIZJkrGG2AA1nJrvhY0D7twyOfaTyGOBye79oneNGEN3GKPEs5z35FBtYt2IpNeBLWrcLT +y9LQQfMmNkqblWwM7uXRQydmwYj3erMgbOqwaSvHIOgMA8RBBZniP+Rr+KCGgceExh/VS4ESshYh +LBOhgLJeDEoTniDYYkCrkOpkSi+sDQESeUWoL4cZaMjihccwsnX5OD+ywJO0a+IDRM5noN+J1q2M +dqMTw5RhK2vZbMEHCiIHhWyFJEapvj+LeISCfiQMnf2BN+MlqO02TpUsyZyQ2uypQjyttgI= +-----END CERTIFICATE----- + +certSIGN ROOT CA +================ +-----BEGIN CERTIFICATE----- +MIIDODCCAiCgAwIBAgIGIAYFFnACMA0GCSqGSIb3DQEBBQUAMDsxCzAJBgNVBAYTAlJPMREwDwYD +VQQKEwhjZXJ0U0lHTjEZMBcGA1UECxMQY2VydFNJR04gUk9PVCBDQTAeFw0wNjA3MDQxNzIwMDRa +Fw0zMTA3MDQxNzIwMDRaMDsxCzAJBgNVBAYTAlJPMREwDwYDVQQKEwhjZXJ0U0lHTjEZMBcGA1UE +CxMQY2VydFNJR04gUk9PVCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALczuX7I +JUqOtdu0KBuqV5Do0SLTZLrTk+jUrIZhQGpgV2hUhE28alQCBf/fm5oqrl0Hj0rDKH/v+yv6efHH +rfAQUySQi2bJqIirr1qjAOm+ukbuW3N7LBeCgV5iLKECZbO9xSsAfsT8AzNXDe3i+s5dRdY4zTW2 +ssHQnIFKquSyAVwdj1+ZxLGt24gh65AIgoDzMKND5pCCrlUoSe1b16kQOA7+j0xbm0bqQfWwCHTD +0IgztnzXdN/chNFDDnU5oSVAKOp4yw4sLjmdjItuFhwvJoIQ4uNllAoEwF73XVv4EOLQunpL+943 +AAAaWyjj0pxzPjKHmKHJUS/X3qwzs08CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8B +Af8EBAMCAcYwHQYDVR0OBBYEFOCMm9slSbPxfIbWskKHC9BroNnkMA0GCSqGSIb3DQEBBQUAA4IB +AQA+0hyJLjX8+HXd5n9liPRyTMks1zJO890ZeUe9jjtbkw9QSSQTaxQGcu8J06Gh40CEyecYMnQ8 +SG4Pn0vU9x7Tk4ZkVJdjclDVVc/6IJMCopvDI5NOFlV2oHB5bc0hH88vLbwZ44gx+FkagQnIl6Z0 +x2DEW8xXjrJ1/RsCCdtZb3KTafcxQdaIOL+Hsr0Wefmq5L6IJd1hJyMctTEHBDa0GpC9oHRxUIlt +vBTjD4au8as+x6AJzKNI0eDbZOeStc+vckNwi/nDhDwTqn6Sm1dTk/pwwpEOMfmbZ13pljheX7Nz +TogVZ96edhBiIL5VaZVDADlN9u6wWk5JRFRYX0KD +-----END CERTIFICATE----- + +GeoTrust Primary Certification Authority - G3 +============================================= +-----BEGIN CERTIFICATE----- +MIID/jCCAuagAwIBAgIQFaxulBmyeUtB9iepwxgPHzANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UE +BhMCVVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA4IEdlb1RydXN0 +IEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFy +eSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEczMB4XDTA4MDQwMjAwMDAwMFoXDTM3MTIwMTIz +NTk1OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAo +YykgMjAwOCBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNVBAMT +LUdlb1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMzCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBANziXmJYHTNXOTIz+uvLh4yn1ErdBojqZI4xmKU4kB6Yzy5j +K/BGvESyiaHAKAxJcCGVn2TAppMSAmUmhsalifD614SgcK9PGpc/BkTVyetyEH3kMSj7HGHmKAdE +c5IiaacDiGydY8hS2pgn5whMcD60yRLBxWeDXTPzAxHsatBT4tG6NmCUgLthY2xbF37fQJQeqw3C +IShwiP/WJmxsYAQlTlV+fe+/lEjetx3dcI0FX4ilm/LC7urRQEFtYjgdVgbFA0dRIBn8exALDmKu +dlW/X3e+PkkBUz2YJQN2JFodtNuJ6nnltrM7P7pMKEF/BqxqjsHQ9gUdfeZChuOl1UcCAwEAAaNC +MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFMR5yo6hTgMdHNxr +2zFblD4/MH8tMA0GCSqGSIb3DQEBCwUAA4IBAQAtxRPPVoB7eni9n64smefv2t+UXglpp+duaIy9 +cr5HqQ6XErhK8WTTOd8lNNTBzU6B8A8ExCSzNJbGpqow32hhc9f5joWJ7w5elShKKiePEI4ufIbE +Ap7aDHdlDkQNkv39sxY2+hENHYwOB4lqKVb3cvTdFZx3NWZXqxNT2I7BQMXXExZacse3aQHEerGD +AWh9jUGhlBjBJVz88P6DAod8DQ3PLghcSkANPuyBYeYk28rgDi0Hsj5W3I31QYUHSJsMC8tJP33s +t/3LjWeJGqvtux6jAAgIFyqCXDFdRootD4abdNlF+9RAsXqqaC2Gspki4cErx5z481+oghLrGREt +-----END CERTIFICATE----- + +thawte Primary Root CA - G2 +=========================== +-----BEGIN CERTIFICATE----- +MIICiDCCAg2gAwIBAgIQNfwmXNmET8k9Jj1Xm67XVjAKBggqhkjOPQQDAzCBhDELMAkGA1UEBhMC +VVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjE4MDYGA1UECxMvKGMpIDIwMDcgdGhhd3RlLCBJbmMu +IC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAiBgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3Qg +Q0EgLSBHMjAeFw0wNzExMDUwMDAwMDBaFw0zODAxMTgyMzU5NTlaMIGEMQswCQYDVQQGEwJVUzEV +MBMGA1UEChMMdGhhd3RlLCBJbmMuMTgwNgYDVQQLEy8oYykgMjAwNyB0aGF3dGUsIEluYy4gLSBG +b3IgYXV0aG9yaXplZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAt +IEcyMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEotWcgnuVnfFSeIf+iha/BebfowJPDQfGAFG6DAJS +LSKkQjnE/o/qycG+1E3/n3qe4rF8mq2nhglzh9HnmuN6papu+7qzcMBniKI11KOasf2twu8x+qi5 +8/sIxpHR+ymVo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQU +mtgAMADna3+FGO6Lts6KDPgR4bswCgYIKoZIzj0EAwMDaQAwZgIxAN344FdHW6fmCsO99YCKlzUN +G4k8VIZ3KMqh9HneteY4sPBlcIx/AlTCv//YoT7ZzwIxAMSNlPzcU9LcnXgWHxUzI1NS41oxXZ3K +rr0TKUQNJ1uo52icEvdYPy5yAlejj6EULg== +-----END CERTIFICATE----- + +thawte Primary Root CA - G3 +=========================== +-----BEGIN CERTIFICATE----- +MIIEKjCCAxKgAwIBAgIQYAGXt0an6rS0mtZLL/eQ+zANBgkqhkiG9w0BAQsFADCBrjELMAkGA1UE +BhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMfQ2VydGlmaWNhdGlvbiBTZXJ2 +aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIwMDggdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhv +cml6ZWQgdXNlIG9ubHkxJDAiBgNVBAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMzAeFw0w +ODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIGuMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhh +d3RlLCBJbmMuMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9uIFNlcnZpY2VzIERpdmlzaW9uMTgwNgYD +VQQLEy8oYykgMjAwOCB0aGF3dGUsIEluYy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTEkMCIG +A1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAtIEczMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEAsr8nLPvb2FvdeHsbnndmgcs+vHyu86YnmjSjaDFxODNi5PNxZnmxqWWjpYvVj2At +P0LMqmsywCPLLEHd5N/8YZzic7IilRFDGF/Eth9XbAoFWCLINkw6fKXRz4aviKdEAhN0cXMKQlkC ++BsUa0Lfb1+6a4KinVvnSr0eAXLbS3ToO39/fR8EtCab4LRarEc9VbjXsCZSKAExQGbY2SS99irY +7CFJXJv2eul/VTV+lmuNk5Mny5K76qxAwJ/C+IDPXfRa3M50hqY+bAtTyr2SzhkGcuYMXDhpxwTW +vGzOW/b3aJzcJRVIiKHpqfiYnODz1TEoYRFsZ5aNOZnLwkUkOQIDAQABo0IwQDAPBgNVHRMBAf8E +BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUrWyqlGCc7eT/+j4KdCtjA/e2Wb8wDQYJ +KoZIhvcNAQELBQADggEBABpA2JVlrAmSicY59BDlqQ5mU1143vokkbvnRFHfxhY0Cu9qRFHqKweK +A3rD6z8KLFIWoCtDuSWQP3CpMyVtRRooOyfPqsMpQhvfO0zAMzRbQYi/aytlryjvsvXDqmbOe1bu +t8jLZ8HJnBoYuMTDSQPxYA5QzUbF83d597YV4Djbxy8ooAw/dyZ02SUS2jHaGh7cKUGRIjxpp7sC +8rZcJwOJ9Abqm+RyguOhCcHpABnTPtRwa7pxpqpYrvS76Wy274fMm7v/OeZWYdMKp8RcTGB7BXcm +er/YB1IsYvdwY9k5vG8cwnncdimvzsUsZAReiDZuMdRAGmI0Nj81Aa6sY6A= +-----END CERTIFICATE----- + +GeoTrust Primary Certification Authority - G2 +============================================= +-----BEGIN CERTIFICATE----- +MIICrjCCAjWgAwIBAgIQPLL0SAoA4v7rJDteYD7DazAKBggqhkjOPQQDAzCBmDELMAkGA1UEBhMC +VVMxFjAUBgNVBAoTDUdlb1RydXN0IEluYy4xOTA3BgNVBAsTMChjKSAyMDA3IEdlb1RydXN0IElu +Yy4gLSBGb3IgYXV0aG9yaXplZCB1c2Ugb25seTE2MDQGA1UEAxMtR2VvVHJ1c3QgUHJpbWFyeSBD +ZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEcyMB4XDTA3MTEwNTAwMDAwMFoXDTM4MDExODIzNTk1 +OVowgZgxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1HZW9UcnVzdCBJbmMuMTkwNwYDVQQLEzAoYykg +MjAwNyBHZW9UcnVzdCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxNjA0BgNVBAMTLUdl +b1RydXN0IFByaW1hcnkgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBHMjB2MBAGByqGSM49AgEG +BSuBBAAiA2IABBWx6P0DFUPlrOuHNxFi79KDNlJ9RVcLSo17VDs6bl8VAsBQps8lL33KSLjHUGMc +KiEIfJo22Av+0SbFWDEwKCXzXV2juLaltJLtbCyf691DiaI8S0iRHVDsJt/WYC69IaNCMEAwDwYD +VR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBVfNVdRVfslsq0DafwBo/q+ +EVXVMAoGCCqGSM49BAMDA2cAMGQCMGSWWaboCd6LuvpaiIjwH5HTRqjySkwCY/tsXzjbLkGTqQ7m +ndwxHLKgpxgceeHHNgIwOlavmnRs9vuD4DPTCF+hnMJbn0bWtsuRBmOiBuczrD6ogRLQy7rQkgu2 +npaqBA+K +-----END CERTIFICATE----- + +VeriSign Universal Root Certification Authority +=============================================== +-----BEGIN CERTIFICATE----- +MIIEuTCCA6GgAwIBAgIQQBrEZCGzEyEDDrvkEhrFHTANBgkqhkiG9w0BAQsFADCBvTELMAkGA1UE +BhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBO +ZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwOCBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVk +IHVzZSBvbmx5MTgwNgYDVQQDEy9WZXJpU2lnbiBVbml2ZXJzYWwgUm9vdCBDZXJ0aWZpY2F0aW9u +IEF1dGhvcml0eTAeFw0wODA0MDIwMDAwMDBaFw0zNzEyMDEyMzU5NTlaMIG9MQswCQYDVQQGEwJV +UzEXMBUGA1UEChMOVmVyaVNpZ24sIEluYy4xHzAdBgNVBAsTFlZlcmlTaWduIFRydXN0IE5ldHdv +cmsxOjA4BgNVBAsTMShjKSAyMDA4IFZlcmlTaWduLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNl +IG9ubHkxODA2BgNVBAMTL1ZlcmlTaWduIFVuaXZlcnNhbCBSb290IENlcnRpZmljYXRpb24gQXV0 +aG9yaXR5MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAx2E3XrEBNNti1xWb/1hajCMj +1mCOkdeQmIN65lgZOIzF9uVkhbSicfvtvbnazU0AtMgtc6XHaXGVHzk8skQHnOgO+k1KxCHfKWGP +MiJhgsWHH26MfF8WIFFE0XBPV+rjHOPMee5Y2A7Cs0WTwCznmhcrewA3ekEzeOEz4vMQGn+HLL72 +9fdC4uW/h2KJXwBL38Xd5HVEMkE6HnFuacsLdUYI0crSK5XQz/u5QGtkjFdN/BMReYTtXlT2NJ8I +AfMQJQYXStrxHXpma5hgZqTZ79IugvHw7wnqRMkVauIDbjPTrJ9VAMf2CGqUuV/c4DPxhGD5WycR +tPwW8rtWaoAljQIDAQABo4GyMIGvMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMG0G +CCsGAQUFBwEMBGEwX6FdoFswWTBXMFUWCWltYWdlL2dpZjAhMB8wBwYFKw4DAhoEFI/l0xqGrI2O +a8PPgGrUSBgsexkuMCUWI2h0dHA6Ly9sb2dvLnZlcmlzaWduLmNvbS92c2xvZ28uZ2lmMB0GA1Ud +DgQWBBS2d/ppSEefUxLVwuoHMnYH0ZcHGTANBgkqhkiG9w0BAQsFAAOCAQEASvj4sAPmLGd75JR3 +Y8xuTPl9Dg3cyLk1uXBPY/ok+myDjEedO2Pzmvl2MpWRsXe8rJq+seQxIcaBlVZaDrHC1LGmWazx +Y8u4TB1ZkErvkBYoH1quEPuBUDgMbMzxPcP1Y+Oz4yHJJDnp/RVmRvQbEdBNc6N9Rvk97ahfYtTx +P/jgdFcrGJ2BtMQo2pSXpXDrrB2+BxHw1dvd5Yzw1TKwg+ZX4o+/vqGqvz0dtdQ46tewXDpPaj+P +wGZsY6rp2aQW9IHRlRQOfc2VNNnSj3BzgXucfr2YYdhFh5iQxeuGMMY1v/D/w1WIg0vvBZIGcfK4 +mJO37M2CYfE45k+XmCpajQ== +-----END CERTIFICATE----- + +VeriSign Class 3 Public Primary Certification Authority - G4 +============================================================ +-----BEGIN CERTIFICATE----- +MIIDhDCCAwqgAwIBAgIQL4D+I4wOIg9IZxIokYesszAKBggqhkjOPQQDAzCByjELMAkGA1UEBhMC +VVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBUcnVzdCBOZXR3 +b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRob3JpemVkIHVz +ZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5IENlcnRpZmlj +YXRpb24gQXV0aG9yaXR5IC0gRzQwHhcNMDcxMTA1MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCByjEL +MAkGA1UEBhMCVVMxFzAVBgNVBAoTDlZlcmlTaWduLCBJbmMuMR8wHQYDVQQLExZWZXJpU2lnbiBU +cnVzdCBOZXR3b3JrMTowOAYDVQQLEzEoYykgMjAwNyBWZXJpU2lnbiwgSW5jLiAtIEZvciBhdXRo +b3JpemVkIHVzZSBvbmx5MUUwQwYDVQQDEzxWZXJpU2lnbiBDbGFzcyAzIFB1YmxpYyBQcmltYXJ5 +IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzQwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAASnVnp8 +Utpkmw4tXNherJI9/gHmGUo9FANL+mAnINmDiWn6VMaaGF5VKmTeBvaNSjutEDxlPZCIBIngMGGz +rl0Bp3vefLK+ymVhAIau2o970ImtTR1ZmkGxvEeA3J5iw/mjgbIwga8wDwYDVR0TAQH/BAUwAwEB +/zAOBgNVHQ8BAf8EBAMCAQYwbQYIKwYBBQUHAQwEYTBfoV2gWzBZMFcwVRYJaW1hZ2UvZ2lmMCEw +HzAHBgUrDgMCGgQUj+XTGoasjY5rw8+AatRIGCx7GS4wJRYjaHR0cDovL2xvZ28udmVyaXNpZ24u +Y29tL3ZzbG9nby5naWYwHQYDVR0OBBYEFLMWkf3upm7ktS5Jj4d4gYDs5bG1MAoGCCqGSM49BAMD +A2gAMGUCMGYhDBgmYFo4e1ZC4Kf8NoRRkSAsdk1DPcQdhCPQrNZ8NQbOzWm9kA3bbEhCHQ6qQgIx +AJw9SDkjOVgaFRJZap7v1VmyHVIsmXHNxynfGyphe3HR3vPA5Q06Sqotp9iGKt0uEA== +-----END CERTIFICATE----- + +NetLock Arany (Class Gold) Főtanúsítvány +======================================== +-----BEGIN CERTIFICATE----- +MIIEFTCCAv2gAwIBAgIGSUEs5AAQMA0GCSqGSIb3DQEBCwUAMIGnMQswCQYDVQQGEwJIVTERMA8G +A1UEBwwIQnVkYXBlc3QxFTATBgNVBAoMDE5ldExvY2sgS2Z0LjE3MDUGA1UECwwuVGFuw7pzw610 +dsOhbnlraWFkw7NrIChDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzKTE1MDMGA1UEAwwsTmV0TG9jayBB +cmFueSAoQ2xhc3MgR29sZCkgRsWRdGFuw7pzw610dsOhbnkwHhcNMDgxMjExMTUwODIxWhcNMjgx +MjA2MTUwODIxWjCBpzELMAkGA1UEBhMCSFUxETAPBgNVBAcMCEJ1ZGFwZXN0MRUwEwYDVQQKDAxO +ZXRMb2NrIEtmdC4xNzA1BgNVBAsMLlRhbsO6c8OtdHbDoW55a2lhZMOzayAoQ2VydGlmaWNhdGlv +biBTZXJ2aWNlcykxNTAzBgNVBAMMLE5ldExvY2sgQXJhbnkgKENsYXNzIEdvbGQpIEbFkXRhbsO6 +c8OtdHbDoW55MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxCRec75LbRTDofTjl5Bu +0jBFHjzuZ9lk4BqKf8owyoPjIMHj9DrTlF8afFttvzBPhCf2nx9JvMaZCpDyD/V/Q4Q3Y1GLeqVw +/HpYzY6b7cNGbIRwXdrzAZAj/E4wqX7hJ2Pn7WQ8oLjJM2P+FpD/sLj916jAwJRDC7bVWaaeVtAk +H3B5r9s5VA1lddkVQZQBr17s9o3x/61k/iCa11zr/qYfCGSji3ZVrR47KGAuhyXoqq8fxmRGILdw +fzzeSNuWU7c5d+Qa4scWhHaXWy+7GRWF+GmF9ZmnqfI0p6m2pgP8b4Y9VHx2BJtr+UBdADTHLpl1 +neWIA6pN+APSQnbAGwIDAKiLo0UwQzASBgNVHRMBAf8ECDAGAQH/AgEEMA4GA1UdDwEB/wQEAwIB +BjAdBgNVHQ4EFgQUzPpnk/C2uNClwB7zU/2MU9+D15YwDQYJKoZIhvcNAQELBQADggEBAKt/7hwW +qZw8UQCgwBEIBaeZ5m8BiFRhbvG5GK1Krf6BQCOUL/t1fC8oS2IkgYIL9WHxHG64YTjrgfpioTta +YtOUZcTh5m2C+C8lcLIhJsFyUR+MLMOEkMNaj7rP9KdlpeuY0fsFskZ1FSNqb4VjMIDw1Z4fKRzC +bLBQWV2QWzuoDTDPv31/zvGdg73JRm4gpvlhUbohL3u+pRVjodSVh/GeufOJ8z2FuLjbvrW5Kfna +NwUASZQDhETnv0Mxz3WLJdH0pmT1kvarBes96aULNmLazAZfNou2XjG4Kvte9nHfRCaexOYNkbQu +dZWAUWpLMKawYqGT8ZvYzsRjdT9ZR7E= +-----END CERTIFICATE----- + +Staat der Nederlanden Root CA - G2 +================================== +-----BEGIN CERTIFICATE----- +MIIFyjCCA7KgAwIBAgIEAJiWjDANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJOTDEeMBwGA1UE +CgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFhdCBkZXIgTmVkZXJsYW5kZW4g +Um9vdCBDQSAtIEcyMB4XDTA4MDMyNjExMTgxN1oXDTIwMDMyNTExMDMxMFowWjELMAkGA1UEBhMC +TkwxHjAcBgNVBAoMFVN0YWF0IGRlciBOZWRlcmxhbmRlbjErMCkGA1UEAwwiU3RhYXQgZGVyIE5l +ZGVybGFuZGVuIFJvb3QgQ0EgLSBHMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMVZ +5291qj5LnLW4rJ4L5PnZyqtdj7U5EILXr1HgO+EASGrP2uEGQxGZqhQlEq0i6ABtQ8SpuOUfiUtn +vWFI7/3S4GCI5bkYYCjDdyutsDeqN95kWSpGV+RLufg3fNU254DBtvPUZ5uW6M7XxgpT0GtJlvOj +CwV3SPcl5XCsMBQgJeN/dVrlSPhOewMHBPqCYYdu8DvEpMfQ9XQ+pV0aCPKbJdL2rAQmPlU6Yiil +e7Iwr/g3wtG61jj99O9JMDeZJiFIhQGp5Rbn3JBV3w/oOM2ZNyFPXfUib2rFEhZgF1XyZWampzCR +OME4HYYEhLoaJXhena/MUGDWE4dS7WMfbWV9whUYdMrhfmQpjHLYFhN9C0lK8SgbIHRrxT3dsKpI +CT0ugpTNGmXZK4iambwYfp/ufWZ8Pr2UuIHOzZgweMFvZ9C+X+Bo7d7iscksWXiSqt8rYGPy5V65 +48r6f1CGPqI0GAwJaCgRHOThuVw+R7oyPxjMW4T182t0xHJ04eOLoEq9jWYv6q012iDTiIJh8BIi +trzQ1aTsr1SIJSQ8p22xcik/Plemf1WvbibG/ufMQFxRRIEKeN5KzlW/HdXZt1bv8Hb/C3m1r737 +qWmRRpdogBQ2HbN/uymYNqUg+oJgYjOk7Na6B6duxc8UpufWkjTYgfX8HV2qXB72o007uPc5AgMB +AAGjgZcwgZQwDwYDVR0TAQH/BAUwAwEB/zBSBgNVHSAESzBJMEcGBFUdIAAwPzA9BggrBgEFBQcC +ARYxaHR0cDovL3d3dy5wa2lvdmVyaGVpZC5ubC9wb2xpY2llcy9yb290LXBvbGljeS1HMjAOBgNV +HQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJFoMocVHYnitfGsNig0jQt8YojrMA0GCSqGSIb3DQEBCwUA +A4ICAQCoQUpnKpKBglBu4dfYszk78wIVCVBR7y29JHuIhjv5tLySCZa59sCrI2AGeYwRTlHSeYAz ++51IvuxBQ4EffkdAHOV6CMqqi3WtFMTC6GY8ggen5ieCWxjmD27ZUD6KQhgpxrRW/FYQoAUXvQwj +f/ST7ZwaUb7dRUG/kSS0H4zpX897IZmflZ85OkYcbPnNe5yQzSipx6lVu6xiNGI1E0sUOlWDuYaN +kqbG9AclVMwWVxJKgnjIFNkXgiYtXSAfea7+1HAWFpWD2DU5/1JddRwWxRNVz0fMdWVSSt7wsKfk +CpYL+63C4iWEst3kvX5ZbJvw8NjnyvLplzh+ib7M+zkXYT9y2zqR2GUBGR2tUKRXCnxLvJxxcypF +URmFzI79R6d0lR2o0a9OF7FpJsKqeFdbxU2n5Z4FF5TKsl+gSRiNNOkmbEgeqmiSBeGCc1qb3Adb +CG19ndeNIdn8FCCqwkXfP+cAslHkwvgFuXkajDTznlvkN1trSt8sV4pAWja63XVECDdCcAz+3F4h +oKOKwJCcaNpQ5kUQR3i2TtJlycM33+FCY7BXN0Ute4qcvwXqZVUz9zkQxSgqIXobisQk+T8VyJoV +IPVVYpbtbZNQvOSqeK3Zywplh6ZmwcSBo3c6WB4L7oOLnR7SUqTMHW+wmG2UMbX4cQrcufx9MmDm +66+KAQ== +-----END CERTIFICATE----- + +Hongkong Post Root CA 1 +======================= +-----BEGIN CERTIFICATE----- +MIIDMDCCAhigAwIBAgICA+gwDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoT +DUhvbmdrb25nIFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMB4XDTAzMDUx +NTA1MTMxNFoXDTIzMDUxNTA0NTIyOVowRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoTDUhvbmdrb25n +IFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEArP84tulmAknjorThkPlAj3n54r15/gK97iSSHSL22oVyaf7XPwnU3ZG1 +ApzQjVrhVcNQhrkpJsLj2aDxaQMoIIBFIi1WpztUlVYiWR8o3x8gPW2iNr4joLFutbEnPzlTCeqr +auh0ssJlXI6/fMN4hM2eFvz1Lk8gKgifd/PFHsSaUmYeSF7jEAaPIpjhZY4bXSNmO7ilMlHIhqqh +qZ5/dpTCpmy3QfDVyAY45tQM4vM7TG1QjMSDJ8EThFk9nnV0ttgCXjqQesBCNnLsak3c78QA3xMY +V18meMjWCnl3v/evt3a5pQuEF10Q6m/hq5URX208o1xNg1vysxmKgIsLhwIDAQABoyYwJDASBgNV +HRMBAf8ECDAGAQH/AgEDMA4GA1UdDwEB/wQEAwIBxjANBgkqhkiG9w0BAQUFAAOCAQEADkbVPK7i +h9legYsCmEEIjEy82tvuJxuC52pF7BaLT4Wg87JwvVqWuspube5Gi27nKi6Wsxkz67SfqLI37pio +l7Yutmcn1KZJ/RyTZXaeQi/cImyaT/JaFTmxcdcrUehtHJjA2Sr0oYJ71clBoiMBdDhViw+5Lmei +IAQ32pwL0xch4I+XeTRvhEgCIDMb5jREn5Fw9IBehEPCKdJsEhTkYY2sEJCehFC78JZvRZ+K88ps +T/oROhUVRsPNH4NbLUES7VBnQRM9IauUiqpOfMGx+6fWtScvl6tu4B3i0RwsH0Ti/L6RoZz71ilT +c4afU9hDDl3WY4JxHYB0yvbiAmvZWg== +-----END CERTIFICATE----- + +SecureSign RootCA11 +=================== +-----BEGIN CERTIFICATE----- +MIIDbTCCAlWgAwIBAgIBATANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQGEwJKUDErMCkGA1UEChMi +SmFwYW4gQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcywgSW5jLjEcMBoGA1UEAxMTU2VjdXJlU2lnbiBS +b290Q0ExMTAeFw0wOTA0MDgwNDU2NDdaFw0yOTA0MDgwNDU2NDdaMFgxCzAJBgNVBAYTAkpQMSsw +KQYDVQQKEyJKYXBhbiBDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzLCBJbmMuMRwwGgYDVQQDExNTZWN1 +cmVTaWduIFJvb3RDQTExMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA/XeqpRyQBTvL +TJszi1oURaTnkBbR31fSIRCkF/3frNYfp+TbfPfs37gD2pRY/V1yfIw/XwFndBWW4wI8h9uuywGO +wvNmxoVF9ALGOrVisq/6nL+k5tSAMJjzDbaTj6nU2DbysPyKyiyhFTOVMdrAG/LuYpmGYz+/3ZMq +g6h2uRMft85OQoWPIucuGvKVCbIFtUROd6EgvanyTgp9UK31BQ1FT0Zx/Sg+U/sE2C3XZR1KG/rP +O7AxmjVuyIsG0wCR8pQIZUyxNAYAeoni8McDWc/V1uinMrPmmECGxc0nEovMe863ETxiYAcjPitA +bpSACW22s293bzUIUPsCh8U+iQIDAQABo0IwQDAdBgNVHQ4EFgQUW/hNT7KlhtQ60vFjmqC+CfZX +t94wDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAKCh +OBZmLqdWHyGcBvod7bkixTgm2E5P7KN/ed5GIaGHd48HCJqypMWvDzKYC3xmKbabfSVSSUOrTC4r +bnpwrxYO4wJs+0LmGJ1F2FXI6Dvd5+H0LgscNFxsWEr7jIhQX5Ucv+2rIrVls4W6ng+4reV6G4pQ +Oh29Dbx7VFALuUKvVaAYga1lme++5Jy/xIWrQbJUb9wlze144o4MjQlJ3WN7WmmWAiGovVJZ6X01 +y8hSyn+B/tlr0/cR7SXf+Of5pPpyl4RTDaXQMhhRdlkUbA/r7F+AjHVDg8OFmP9Mni0N5HeDk061 +lgeLKBObjBmNQSdJQO7e5iNEOdyhIta6A/I= +-----END CERTIFICATE----- + +ACEDICOM Root +============= +-----BEGIN CERTIFICATE----- +MIIFtTCCA52gAwIBAgIIYY3HhjsBggUwDQYJKoZIhvcNAQEFBQAwRDEWMBQGA1UEAwwNQUNFRElD +T00gUm9vdDEMMAoGA1UECwwDUEtJMQ8wDQYDVQQKDAZFRElDT00xCzAJBgNVBAYTAkVTMB4XDTA4 +MDQxODE2MjQyMloXDTI4MDQxMzE2MjQyMlowRDEWMBQGA1UEAwwNQUNFRElDT00gUm9vdDEMMAoG +A1UECwwDUEtJMQ8wDQYDVQQKDAZFRElDT00xCzAJBgNVBAYTAkVTMIICIjANBgkqhkiG9w0BAQEF +AAOCAg8AMIICCgKCAgEA/5KV4WgGdrQsyFhIyv2AVClVYyT/kGWbEHV7w2rbYgIB8hiGtXxaOLHk +WLn709gtn70yN78sFW2+tfQh0hOR2QetAQXW8713zl9CgQr5auODAKgrLlUTY4HKRxx7XBZXehuD +YAQ6PmXDzQHe3qTWDLqO3tkE7hdWIpuPY/1NFgu3e3eM+SW10W2ZEi5PGrjm6gSSrj0RuVFCPYew +MYWveVqc/udOXpJPQ/yrOq2lEiZmueIM15jO1FillUAKt0SdE3QrwqXrIhWYENiLxQSfHY9g5QYb +m8+5eaA9oiM/Qj9r+hwDezCNzmzAv+YbX79nuIQZ1RXve8uQNjFiybwCq0Zfm/4aaJQ0PZCOrfbk +HQl/Sog4P75n/TSW9R28MHTLOO7VbKvU/PQAtwBbhTIWdjPp2KOZnQUAqhbm84F9b32qhm2tFXTT +xKJxqvQUfecyuB+81fFOvW8XAjnXDpVCOscAPukmYxHqC9FK/xidstd7LzrZlvvoHpKuE1XI2Sf2 +3EgbsCTBheN3nZqk8wwRHQ3ItBTutYJXCb8gWH8vIiPYcMt5bMlL8qkqyPyHK9caUPgn6C9D4zq9 +2Fdx/c6mUlv53U3t5fZvie27k5x2IXXwkkwp9y+cAS7+UEaeZAwUswdbxcJzbPEHXEUkFDWug/Fq +TYl6+rPYLWbwNof1K1MCAwEAAaOBqjCBpzAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFKaz +4SsrSbbXc6GqlPUB53NlTKxQMA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUprPhKytJttdzoaqU +9QHnc2VMrFAwRAYDVR0gBD0wOzA5BgRVHSAAMDEwLwYIKwYBBQUHAgEWI2h0dHA6Ly9hY2VkaWNv +bS5lZGljb21ncm91cC5jb20vZG9jMA0GCSqGSIb3DQEBBQUAA4ICAQDOLAtSUWImfQwng4/F9tqg +aHtPkl7qpHMyEVNEskTLnewPeUKzEKbHDZ3Ltvo/Onzqv4hTGzz3gvoFNTPhNahXwOf9jU8/kzJP +eGYDdwdY6ZXIfj7QeQCM8htRM5u8lOk6e25SLTKeI6RF+7YuE7CLGLHdztUdp0J/Vb77W7tH1Pwk +zQSulgUV1qzOMPPKC8W64iLgpq0i5ALudBF/TP94HTXa5gI06xgSYXcGCRZj6hitoocf8seACQl1 +ThCojz2GuHURwCRiipZ7SkXp7FnFvmuD5uHorLUwHv4FB4D54SMNUI8FmP8sX+g7tq3PgbUhh8oI +KiMnMCArz+2UW6yyetLHKKGKC5tNSixthT8Jcjxn4tncB7rrZXtaAWPWkFtPF2Y9fwsZo5NjEFIq +nxQWWOLcpfShFosOkYuByptZ+thrkQdlVV9SH686+5DdaaVbnG0OLLb6zqylfDJKZ0DcMDQj3dcE +I2bw/FWAp/tmGYI1Z2JwOV5vx+qQQEQIHriy1tvuWacNGHk0vFQYXlPKNFHtRQrmjseCNj6nOGOp +MCwXEGCSn1WHElkQwg9naRHMTh5+Spqtr0CodaxWkHS4oJyleW/c6RrIaQXpuvoDs3zk4E7Czp3o +tkYNbn5XOmeUwssfnHdKZ05phkOTOPu220+DkdRgfks+KzgHVZhepA== +-----END CERTIFICATE----- + +Microsec e-Szigno Root CA 2009 +============================== +-----BEGIN CERTIFICATE----- +MIIECjCCAvKgAwIBAgIJAMJ+QwRORz8ZMA0GCSqGSIb3DQEBCwUAMIGCMQswCQYDVQQGEwJIVTER +MA8GA1UEBwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jv +c2VjIGUtU3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5o +dTAeFw0wOTA2MTYxMTMwMThaFw0yOTEyMzAxMTMwMThaMIGCMQswCQYDVQQGEwJIVTERMA8GA1UE +BwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jvc2VjIGUt +U3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5odTCCASIw +DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOn4j/NjrdqG2KfgQvvPkd6mJviZpWNwrZuuyjNA +fW2WbqEORO7hE52UQlKavXWFdCyoDh2Tthi3jCyoz/tccbna7P7ofo/kLx2yqHWH2Leh5TvPmUpG +0IMZfcChEhyVbUr02MelTTMuhTlAdX4UfIASmFDHQWe4oIBhVKZsTh/gnQ4H6cm6M+f+wFUoLAKA +pxn1ntxVUwOXewdI/5n7N4okxFnMUBBjjqqpGrCEGob5X7uxUG6k0QrM1XF+H6cbfPVTbiJfyyvm +1HxdrtbCxkzlBQHZ7Vf8wSN5/PrIJIOV87VqUQHQd9bpEqH5GoP7ghu5sJf0dgYzQ0mg/wu1+rUC +AwEAAaOBgDB+MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTLD8bf +QkPMPcu1SCOhGnqmKrs0aDAfBgNVHSMEGDAWgBTLD8bfQkPMPcu1SCOhGnqmKrs0aDAbBgNVHREE +FDASgRBpbmZvQGUtc3ppZ25vLmh1MA0GCSqGSIb3DQEBCwUAA4IBAQDJ0Q5eLtXMs3w+y/w9/w0o +lZMEyL/azXm4Q5DwpL7v8u8hmLzU1F0G9u5C7DBsoKqpyvGvivo/C3NqPuouQH4frlRheesuCDfX +I/OMn74dseGkddug4lQUsbocKaQY9hK6ohQU4zE1yED/t+AFdlfBHFny+L/k7SViXITwfn4fs775 +tyERzAMBVnCnEJIeGzSBHq2cGsMEPO0CYdYeBvNfOofyK/FFh+U9rNHHV4S9a67c2Pm2G2JwCz02 +yULyMtd6YebS2z3PyKnJm9zbWETXbzivf3jTo60adbocwTZ8jx5tHMN1Rq41Bab2XD0h7lbwyYIi +LXpUq3DDfSJlgnCW +-----END CERTIFICATE----- + +GlobalSign Root CA - R3 +======================= +-----BEGIN CERTIFICATE----- +MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4GA1UECxMXR2xv +YmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh +bFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxT +aWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2ln +bjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWt +iHL8RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsTgHeMCOFJ +0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmmKPZpO/bLyCiR5Z2KYVc3 +rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zdQQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjl +OCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZXriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2 +xmmFghcCAwEAAaNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE +FI/wS3+oLkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZURUm7 +lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMpjjM5RcOO5LlXbKr8 +EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK6fBdRoyV3XpYKBovHd7NADdBj+1E +bddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQXmcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18 +YIvDQVETI53O9zJrlAGomecsMx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7r +kpeDMdmztcpHWD9f +-----END CERTIFICATE----- + +Autoridad de Certificacion Firmaprofesional CIF A62634068 +========================================================= +-----BEGIN CERTIFICATE----- +MIIGFDCCA/ygAwIBAgIIU+w77vuySF8wDQYJKoZIhvcNAQEFBQAwUTELMAkGA1UEBhMCRVMxQjBA +BgNVBAMMOUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2 +MjYzNDA2ODAeFw0wOTA1MjAwODM4MTVaFw0zMDEyMzEwODM4MTVaMFExCzAJBgNVBAYTAkVTMUIw +QAYDVQQDDDlBdXRvcmlkYWQgZGUgQ2VydGlmaWNhY2lvbiBGaXJtYXByb2Zlc2lvbmFsIENJRiBB +NjI2MzQwNjgwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDKlmuO6vj78aI14H9M2uDD +Utd9thDIAl6zQyrET2qyyhxdKJp4ERppWVevtSBC5IsP5t9bpgOSL/UR5GLXMnE42QQMcas9UX4P +B99jBVzpv5RvwSmCwLTaUbDBPLutN0pcyvFLNg4kq7/DhHf9qFD0sefGL9ItWY16Ck6WaVICqjaY +7Pz6FIMMNx/Jkjd/14Et5cS54D40/mf0PmbR0/RAz15iNA9wBj4gGFrO93IbJWyTdBSTo3OxDqqH +ECNZXyAFGUftaI6SEspd/NYrspI8IM/hX68gvqB2f3bl7BqGYTM+53u0P6APjqK5am+5hyZvQWyI +plD9amML9ZMWGxmPsu2bm8mQ9QEM3xk9Dz44I8kvjwzRAv4bVdZO0I08r0+k8/6vKtMFnXkIoctX +MbScyJCyZ/QYFpM6/EfY0XiWMR+6KwxfXZmtY4laJCB22N/9q06mIqqdXuYnin1oKaPnirjaEbsX +LZmdEyRG98Xi2J+Of8ePdG1asuhy9azuJBCtLxTa/y2aRnFHvkLfuwHb9H/TKI8xWVvTyQKmtFLK +bpf7Q8UIJm+K9Lv9nyiqDdVF8xM6HdjAeI9BZzwelGSuewvF6NkBiDkal4ZkQdU7hwxu+g/GvUgU +vzlN1J5Bto+WHWOWk9mVBngxaJ43BjuAiUVhOSPHG0SjFeUc+JIwuwIDAQABo4HvMIHsMBIGA1Ud +EwEB/wQIMAYBAf8CAQEwDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRlzeurNR4APn7VdMActHNH +DhpkLzCBpgYDVR0gBIGeMIGbMIGYBgRVHSAAMIGPMC8GCCsGAQUFBwIBFiNodHRwOi8vd3d3LmZp +cm1hcHJvZmVzaW9uYWwuY29tL2NwczBcBggrBgEFBQcCAjBQHk4AUABhAHMAZQBvACAAZABlACAA +bABhACAAQgBvAG4AYQBuAG8AdgBhACAANAA3ACAAQgBhAHIAYwBlAGwAbwBuAGEAIAAwADgAMAAx +ADcwDQYJKoZIhvcNAQEFBQADggIBABd9oPm03cXF661LJLWhAqvdpYhKsg9VSytXjDvlMd3+xDLx +51tkljYyGOylMnfX40S2wBEqgLk9am58m9Ot/MPWo+ZkKXzR4Tgegiv/J2Wv+xYVxC5xhOW1//qk +R71kMrv2JYSiJ0L1ILDCExARzRAVukKQKtJE4ZYm6zFIEv0q2skGz3QeqUvVhyj5eTSSPi5E6PaP +T481PyWzOdxjKpBrIF/EUhJOlywqrJ2X3kjyo2bbwtKDlaZmp54lD+kLM5FlClrD2VQS3a/DTg4f +Jl4N3LON7NWBcN7STyQF82xO9UxJZo3R/9ILJUFI/lGExkKvgATP0H5kSeTy36LssUzAKh3ntLFl +osS88Zj0qnAHY7S42jtM+kAiMFsRpvAFDsYCA0irhpuF3dvd6qJ2gHN99ZwExEWN57kci57q13XR +crHedUTnQn3iV2t93Jm8PYMo6oCTjcVMZcFwgbg4/EMxsvYDNEeyrPsiBsse3RdHHF9mudMaotoR +saS8I8nkvof/uZS2+F0gStRf571oe2XyFR7SOqkt6dhrJKyXWERHrVkY8SFlcN7ONGCoQPHzPKTD +KCOM/iczQ0CgFzzr6juwcqajuUpLXhZI9LK8yIySxZ2frHI2vDSANGupi5LAuBft7HZT9SQBjLMi +6Et8Vcad+qMUu2WFbm5PEn4KPJ2V +-----END CERTIFICATE----- + +Izenpe.com +========== +-----BEGIN CERTIFICATE----- +MIIF8TCCA9mgAwIBAgIQALC3WhZIX7/hy/WL1xnmfTANBgkqhkiG9w0BAQsFADA4MQswCQYDVQQG +EwJFUzEUMBIGA1UECgwLSVpFTlBFIFMuQS4xEzARBgNVBAMMCkl6ZW5wZS5jb20wHhcNMDcxMjEz +MTMwODI4WhcNMzcxMjEzMDgyNzI1WjA4MQswCQYDVQQGEwJFUzEUMBIGA1UECgwLSVpFTlBFIFMu +QS4xEzARBgNVBAMMCkl6ZW5wZS5jb20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDJ +03rKDx6sp4boFmVqscIbRTJxldn+EFvMr+eleQGPicPK8lVx93e+d5TzcqQsRNiekpsUOqHnJJAK +ClaOxdgmlOHZSOEtPtoKct2jmRXagaKH9HtuJneJWK3W6wyyQXpzbm3benhB6QiIEn6HLmYRY2xU ++zydcsC8Lv/Ct90NduM61/e0aL6i9eOBbsFGb12N4E3GVFWJGjMxCrFXuaOKmMPsOzTFlUFpfnXC +PCDFYbpRR6AgkJOhkEvzTnyFRVSa0QUmQbC1TR0zvsQDyCV8wXDbO/QJLVQnSKwv4cSsPsjLkkxT +OTcj7NMB+eAJRE1NZMDhDVqHIrytG6P+JrUV86f8hBnp7KGItERphIPzidF0BqnMC9bC3ieFUCbK +F7jJeodWLBoBHmy+E60QrLUk9TiRodZL2vG70t5HtfG8gfZZa88ZU+mNFctKy6lvROUbQc/hhqfK +0GqfvEyNBjNaooXlkDWgYlwWTvDjovoDGrQscbNYLN57C9saD+veIR8GdwYDsMnvmfzAuU8Lhij+ +0rnq49qlw0dpEuDb8PYZi+17cNcC1u2HGCgsBCRMd+RIihrGO5rUD8r6ddIBQFqNeb+Lz0vPqhbB +leStTIo+F5HUsWLlguWABKQDfo2/2n+iD5dPDNMN+9fR5XJ+HMh3/1uaD7euBUbl8agW7EekFwID +AQABo4H2MIHzMIGwBgNVHREEgagwgaWBD2luZm9AaXplbnBlLmNvbaSBkTCBjjFHMEUGA1UECgw+ +SVpFTlBFIFMuQS4gLSBDSUYgQTAxMzM3MjYwLVJNZXJjLlZpdG9yaWEtR2FzdGVpeiBUMTA1NSBG +NjIgUzgxQzBBBgNVBAkMOkF2ZGEgZGVsIE1lZGl0ZXJyYW5lbyBFdG9yYmlkZWEgMTQgLSAwMTAx +MCBWaXRvcmlhLUdhc3RlaXowDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0O +BBYEFB0cZQ6o8iV7tJHP5LGx5r1VdGwFMA0GCSqGSIb3DQEBCwUAA4ICAQB4pgwWSp9MiDrAyw6l +Fn2fuUhfGI8NYjb2zRlrrKvV9pF9rnHzP7MOeIWblaQnIUdCSnxIOvVFfLMMjlF4rJUT3sb9fbga +kEyrkgPH7UIBzg/YsfqikuFgba56awmqxinuaElnMIAkejEWOVt+8Rwu3WwJrfIxwYJOubv5vr8q +hT/AQKM6WfxZSzwoJNu0FXWuDYi6LnPAvViH5ULy617uHjAimcs30cQhbIHsvm0m5hzkQiCeR7Cs +g1lwLDXWrzY0tM07+DKo7+N4ifuNRSzanLh+QBxh5z6ikixL8s36mLYp//Pye6kfLqCTVyvehQP5 +aTfLnnhqBbTFMXiJ7HqnheG5ezzevh55hM6fcA5ZwjUukCox2eRFekGkLhObNA5me0mrZJfQRsN5 +nXJQY6aYWwa9SG3YOYNw6DXwBdGqvOPbyALqfP2C2sJbUjWumDqtujWTI6cfSN01RpiyEGjkpTHC +ClguGYEQyVB1/OpaFs4R1+7vUIgtYf8/QnMFlEPVjjxOAToZpR9GTnfQXeWBIiGH/pR9hNiTrdZo +Q0iy2+tzJOeRf1SktoA+naM8THLCV8Sg1Mw4J87VBp6iSNnpn86CcDaTmjvfliHjWbcM2pE38P1Z +WrOZyGlsQyYBNWNgVYkDOnXYukrZVP/u3oDYLdE41V4tC5h9Pmzb/CaIxw== +-----END CERTIFICATE----- + +Chambers of Commerce Root - 2008 +================================ +-----BEGIN CERTIFICATE----- +MIIHTzCCBTegAwIBAgIJAKPaQn6ksa7aMA0GCSqGSIb3DQEBBQUAMIGuMQswCQYDVQQGEwJFVTFD +MEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNv +bS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMu +QS4xKTAnBgNVBAMTIENoYW1iZXJzIG9mIENvbW1lcmNlIFJvb3QgLSAyMDA4MB4XDTA4MDgwMTEy +Mjk1MFoXDTM4MDczMTEyMjk1MFowga4xCzAJBgNVBAYTAkVVMUMwQQYDVQQHEzpNYWRyaWQgKHNl +ZSBjdXJyZW50IGFkZHJlc3MgYXQgd3d3LmNhbWVyZmlybWEuY29tL2FkZHJlc3MpMRIwEAYDVQQF +EwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENhbWVyZmlybWEgUy5BLjEpMCcGA1UEAxMgQ2hhbWJl +cnMgb2YgQ29tbWVyY2UgUm9vdCAtIDIwMDgwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoIC +AQCvAMtwNyuAWko6bHiUfaN/Gh/2NdW928sNRHI+JrKQUrpjOyhYb6WzbZSm891kDFX29ufyIiKA +XuFixrYp4YFs8r/lfTJqVKAyGVn+H4vXPWCGhSRv4xGzdz4gljUha7MI2XAuZPeEklPWDrCQiorj +h40G072QDuKZoRuGDtqaCrsLYVAGUvGef3bsyw/QHg3PmTA9HMRFEFis1tPo1+XqxQEHd9ZR5gN/ +ikilTWh1uem8nk4ZcfUyS5xtYBkL+8ydddy/Js2Pk3g5eXNeJQ7KXOt3EgfLZEFHcpOrUMPrCXZk +NNI5t3YRCQ12RcSprj1qr7V9ZS+UWBDsXHyvfuK2GNnQm05aSd+pZgvMPMZ4fKecHePOjlO+Bd5g +D2vlGts/4+EhySnB8esHnFIbAURRPHsl18TlUlRdJQfKFiC4reRB7noI/plvg6aRArBsNlVq5331 +lubKgdaX8ZSD6e2wsWsSaR6s+12pxZjptFtYer49okQ6Y1nUCyXeG0+95QGezdIp1Z8XGQpvvwyQ +0wlf2eOKNcx5Wk0ZN5K3xMGtr/R5JJqyAQuxr1yW84Ay+1w9mPGgP0revq+ULtlVmhduYJ1jbLhj +ya6BXBg14JC7vjxPNyK5fuvPnnchpj04gftI2jE9K+OJ9dC1vX7gUMQSibMjmhAxhduub+84Mxh2 +EQIDAQABo4IBbDCCAWgwEgYDVR0TAQH/BAgwBgEB/wIBDDAdBgNVHQ4EFgQU+SSsD7K1+HnA+mCI +G8TZTQKeFxkwgeMGA1UdIwSB2zCB2IAU+SSsD7K1+HnA+mCIG8TZTQKeFxmhgbSkgbEwga4xCzAJ +BgNVBAYTAkVVMUMwQQYDVQQHEzpNYWRyaWQgKHNlZSBjdXJyZW50IGFkZHJlc3MgYXQgd3d3LmNh +bWVyZmlybWEuY29tL2FkZHJlc3MpMRIwEAYDVQQFEwlBODI3NDMyODcxGzAZBgNVBAoTEkFDIENh +bWVyZmlybWEgUy5BLjEpMCcGA1UEAxMgQ2hhbWJlcnMgb2YgQ29tbWVyY2UgUm9vdCAtIDIwMDiC +CQCj2kJ+pLGu2jAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRVHSAAMCowKAYIKwYBBQUH +AgEWHGh0dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20wDQYJKoZIhvcNAQEFBQADggIBAJASryI1 +wqM58C7e6bXpeHxIvj99RZJe6dqxGfwWPJ+0W2aeaufDuV2I6A+tzyMP3iU6XsxPpcG1Lawk0lgH +3qLPaYRgM+gQDROpI9CF5Y57pp49chNyM/WqfcZjHwj0/gF/JM8rLFQJ3uIrbZLGOU8W6jx+ekbU +RWpGqOt1glanq6B8aBMz9p0w8G8nOSQjKpD9kCk18pPfNKXG9/jvjA9iSnyu0/VU+I22mlaHFoI6 +M6taIgj3grrqLuBHmrS1RaMFO9ncLkVAO+rcf+g769HsJtg1pDDFOqxXnrN2pSB7+R5KBWIBpih1 +YJeSDW4+TTdDDZIVnBgizVGZoCkaPF+KMjNbMMeJL0eYD6MDxvbxrN8y8NmBGuScvfaAFPDRLLmF +9dijscilIeUcE5fuDr3fKanvNFNb0+RqE4QGtjICxFKuItLcsiFCGtpA8CnJ7AoMXOLQusxI0zcK +zBIKinmwPQN/aUv0NCB9szTqjktk9T79syNnFQ0EuPAtwQlRPLJsFfClI9eDdOTlLsn+mCdCxqvG +nrDQWzilm1DefhiYtUU79nm06PcaewaD+9CL2rvHvRirCG88gGtAPxkZumWK5r7VXNM21+9AUiRg +OGcEMeyP84LG3rlV8zsxkVrctQgVrXYlCg17LofiDKYGvCYQbTed7N14jHyAxfDZd0jQ +-----END CERTIFICATE----- + +Global Chambersign Root - 2008 +============================== +-----BEGIN CERTIFICATE----- +MIIHSTCCBTGgAwIBAgIJAMnN0+nVfSPOMA0GCSqGSIb3DQEBBQUAMIGsMQswCQYDVQQGEwJFVTFD +MEEGA1UEBxM6TWFkcmlkIChzZWUgY3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNv +bS9hZGRyZXNzKTESMBAGA1UEBRMJQTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMu +QS4xJzAlBgNVBAMTHkdsb2JhbCBDaGFtYmVyc2lnbiBSb290IC0gMjAwODAeFw0wODA4MDExMjMx +NDBaFw0zODA3MzExMjMxNDBaMIGsMQswCQYDVQQGEwJFVTFDMEEGA1UEBxM6TWFkcmlkIChzZWUg +Y3VycmVudCBhZGRyZXNzIGF0IHd3dy5jYW1lcmZpcm1hLmNvbS9hZGRyZXNzKTESMBAGA1UEBRMJ +QTgyNzQzMjg3MRswGQYDVQQKExJBQyBDYW1lcmZpcm1hIFMuQS4xJzAlBgNVBAMTHkdsb2JhbCBD +aGFtYmVyc2lnbiBSb290IC0gMjAwODCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMDf +VtPkOpt2RbQT2//BthmLN0EYlVJH6xedKYiONWwGMi5HYvNJBL99RDaxccy9Wglz1dmFRP+RVyXf +XjaOcNFccUMd2drvXNL7G706tcuto8xEpw2uIRU/uXpbknXYpBI4iRmKt4DS4jJvVpyR1ogQC7N0 +ZJJ0YPP2zxhPYLIj0Mc7zmFLmY/CDNBAspjcDahOo7kKrmCgrUVSY7pmvWjg+b4aqIG7HkF4ddPB +/gBVsIdU6CeQNR1MM62X/JcumIS/LMmjv9GYERTtY/jKmIhYF5ntRQOXfjyGHoiMvvKRhI9lNNgA +TH23MRdaKXoKGCQwoze1eqkBfSbW+Q6OWfH9GzO1KTsXO0G2Id3UwD2ln58fQ1DJu7xsepeY7s2M +H/ucUa6LcL0nn3HAa6x9kGbo1106DbDVwo3VyJ2dwW3Q0L9R5OP4wzg2rtandeavhENdk5IMagfe +Ox2YItaswTXbo6Al/3K1dh3ebeksZixShNBFks4c5eUzHdwHU1SjqoI7mjcv3N2gZOnm3b2u/GSF +HTynyQbehP9r6GsaPMWis0L7iwk+XwhSx2LE1AVxv8Rk5Pihg+g+EpuoHtQ2TS9x9o0o9oOpE9Jh +wZG7SMA0j0GMS0zbaRL/UJScIINZc+18ofLx/d33SdNDWKBWY8o9PeU1VlnpDsogzCtLkykPAgMB +AAGjggFqMIIBZjASBgNVHRMBAf8ECDAGAQH/AgEMMB0GA1UdDgQWBBS5CcqcHtvTbDprru1U8VuT +BjUuXjCB4QYDVR0jBIHZMIHWgBS5CcqcHtvTbDprru1U8VuTBjUuXqGBsqSBrzCBrDELMAkGA1UE +BhMCRVUxQzBBBgNVBAcTOk1hZHJpZCAoc2VlIGN1cnJlbnQgYWRkcmVzcyBhdCB3d3cuY2FtZXJm +aXJtYS5jb20vYWRkcmVzcykxEjAQBgNVBAUTCUE4Mjc0MzI4NzEbMBkGA1UEChMSQUMgQ2FtZXJm +aXJtYSBTLkEuMScwJQYDVQQDEx5HbG9iYWwgQ2hhbWJlcnNpZ24gUm9vdCAtIDIwMDiCCQDJzdPp +1X0jzjAOBgNVHQ8BAf8EBAMCAQYwPQYDVR0gBDYwNDAyBgRVHSAAMCowKAYIKwYBBQUHAgEWHGh0 +dHA6Ly9wb2xpY3kuY2FtZXJmaXJtYS5jb20wDQYJKoZIhvcNAQEFBQADggIBAICIf3DekijZBZRG +/5BXqfEv3xoNa/p8DhxJJHkn2EaqbylZUohwEurdPfWbU1Rv4WCiqAm57OtZfMY18dwY6fFn5a+6 +ReAJ3spED8IXDneRRXozX1+WLGiLwUePmJs9wOzL9dWCkoQ10b42OFZyMVtHLaoXpGNR6woBrX/s +dZ7LoR/xfxKxueRkf2fWIyr0uDldmOghp+G9PUIadJpwr2hsUF1Jz//7Dl3mLEfXgTpZALVza2Mg +9jFFCDkO9HB+QHBaP9BrQql0PSgvAm11cpUJjUhjxsYjV5KTXjXBjfkK9yydYhz2rXzdpjEetrHH +foUm+qRqtdpjMNHvkzeyZi99Bffnt0uYlDXA2TopwZ2yUDMdSqlapskD7+3056huirRXhOukP9Du +qqqHW2Pok+JrqNS4cnhrG+055F3Lm6qH1U9OAP7Zap88MQ8oAgF9mOinsKJknnn4SPIVqczmyETr +P3iZ8ntxPjzxmKfFGBI/5rsoM0LpRQp8bfKGeS/Fghl9CYl8slR2iK7ewfPM4W7bMdaTrpmg7yVq +c5iJWzouE4gev8CSlDQb4ye3ix5vQv/n6TebUB0tovkC7stYWDpxvGjjqsGvHCgfotwjZT+B6q6Z +09gwzxMNTxXJhLynSC34MCN32EZLeW32jO06f2ARePTpm67VVMB0gNELQp/B +-----END CERTIFICATE----- + +Go Daddy Root Certificate Authority - G2 +======================================== +-----BEGIN CERTIFICATE----- +MIIDxTCCAq2gAwIBAgIBADANBgkqhkiG9w0BAQsFADCBgzELMAkGA1UEBhMCVVMxEDAOBgNVBAgT +B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAYBgNVBAoTEUdvRGFkZHkuY29tLCBJbmMu +MTEwLwYDVQQDEyhHbyBEYWRkeSBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5 +MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgYMxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6 +b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMRowGAYDVQQKExFHb0RhZGR5LmNvbSwgSW5jLjExMC8G +A1UEAxMoR28gRGFkZHkgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZI +hvcNAQEBBQADggEPADCCAQoCggEBAL9xYgjx+lk09xvJGKP3gElY6SKDE6bFIEMBO4Tx5oVJnyfq +9oQbTqC023CYxzIBsQU+B07u9PpPL1kwIuerGVZr4oAH/PMWdYA5UXvl+TW2dE6pjYIT5LY/qQOD ++qK+ihVqf94Lw7YZFAXK6sOoBJQ7RnwyDfMAZiLIjWltNowRGLfTshxgtDj6AozO091GB94KPutd +fMh8+7ArU6SSYmlRJQVhGkSBjCypQ5Yj36w6gZoOKcUcqeldHraenjAKOc7xiID7S13MMuyFYkMl +NAJWJwGRtDtwKj9useiciAF9n9T521NtYJ2/LOdYq7hfRvzOxBsDPAnrSTFcaUaz4EcCAwEAAaNC +MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFDqahQcQZyi27/a9 +BUFuIMGU2g/eMA0GCSqGSIb3DQEBCwUAA4IBAQCZ21151fmXWWcDYfF+OwYxdS2hII5PZYe096ac +vNjpL9DbWu7PdIxztDhC2gV7+AJ1uP2lsdeu9tfeE8tTEH6KRtGX+rcuKxGrkLAngPnon1rpN5+r +5N9ss4UXnT3ZJE95kTXWXwTrgIOrmgIttRD02JDHBHNA7XIloKmf7J6raBKZV8aPEjoJpL1E/QYV +N8Gb5DKj7Tjo2GTzLH4U/ALqn83/B2gX2yKQOC16jdFU8WnjXzPKej17CuPKf1855eJ1usV2GDPO +LPAvTK33sefOT6jEm0pUBsV/fdUID+Ic/n4XuKxe9tQWskMJDE32p2u0mYRlynqI4uJEvlz36hz1 +-----END CERTIFICATE----- + +Starfield Root Certificate Authority - G2 +========================================= +-----BEGIN CERTIFICATE----- +MIID3TCCAsWgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBjzELMAkGA1UEBhMCVVMxEDAOBgNVBAgT +B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNobm9s +b2dpZXMsIEluYy4xMjAwBgNVBAMTKVN0YXJmaWVsZCBSb290IENlcnRpZmljYXRlIEF1dGhvcml0 +eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgY8xCzAJBgNVBAYTAlVTMRAw +DgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFyZmllbGQg +VGVjaG5vbG9naWVzLCBJbmMuMTIwMAYDVQQDEylTdGFyZmllbGQgUm9vdCBDZXJ0aWZpY2F0ZSBB +dXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL3twQP89o/8ArFv +W59I2Z154qK3A2FWGMNHttfKPTUuiUP3oWmb3ooa/RMgnLRJdzIpVv257IzdIvpy3Cdhl+72WoTs +bhm5iSzchFvVdPtrX8WJpRBSiUZV9Lh1HOZ/5FSuS/hVclcCGfgXcVnrHigHdMWdSL5stPSksPNk +N3mSwOxGXn/hbVNMYq/NHwtjuzqd+/x5AJhhdM8mgkBj87JyahkNmcrUDnXMN/uLicFZ8WJ/X7Nf +ZTD4p7dNdloedl40wOiWVpmKs/B/pM293DIxfJHP4F8R+GuqSVzRmZTRouNjWwl2tVZi4Ut0HZbU +JtQIBFnQmA4O5t78w+wfkPECAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AQYwHQYDVR0OBBYEFHwMMh+n2TB/xH1oo2Kooc6rB1snMA0GCSqGSIb3DQEBCwUAA4IBAQARWfol +TwNvlJk7mh+ChTnUdgWUXuEok21iXQnCoKjUsHU48TRqneSfioYmUeYs0cYtbpUgSpIB7LiKZ3sx +4mcujJUDJi5DnUox9g61DLu34jd/IroAow57UvtruzvE03lRTs2Q9GcHGcg8RnoNAX3FWOdt5oUw +F5okxBDgBPfg8n/Uqgr/Qh037ZTlZFkSIHc40zI+OIF1lnP6aI+xy84fxez6nH7PfrHxBy22/L/K +pL/QlwVKvOoYKAKQvVR4CSFx09F9HdkWsKlhPdAKACL8x3vLCWRFCztAgfd9fDL1mMpYjn0q7pBZ +c2T5NnReJaH1ZgUufzkVqSr7UIuOhWn0 +-----END CERTIFICATE----- + +Starfield Services Root Certificate Authority - G2 +================================================== +-----BEGIN CERTIFICATE----- +MIID7zCCAtegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCVVMxEDAOBgNVBAgT +B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNobm9s +b2dpZXMsIEluYy4xOzA5BgNVBAMTMlN0YXJmaWVsZCBTZXJ2aWNlcyBSb290IENlcnRpZmljYXRl +IEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgZgxCzAJBgNV +BAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxT +dGFyZmllbGQgVGVjaG5vbG9naWVzLCBJbmMuMTswOQYDVQQDEzJTdGFyZmllbGQgU2VydmljZXMg +Um9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC +AQoCggEBANUMOsQq+U7i9b4Zl1+OiFOxHz/Lz58gE20pOsgPfTz3a3Y4Y9k2YKibXlwAgLIvWX/2 +h/klQ4bnaRtSmpDhcePYLQ1Ob/bISdm28xpWriu2dBTrz/sm4xq6HZYuajtYlIlHVv8loJNwU4Pa +hHQUw2eeBGg6345AWh1KTs9DkTvnVtYAcMtS7nt9rjrnvDH5RfbCYM8TWQIrgMw0R9+53pBlbQLP +LJGmpufehRhJfGZOozptqbXuNC66DQO4M99H67FrjSXZm86B0UVGMpZwh94CDklDhbZsc7tk6mFB +rMnUVN+HL8cisibMn1lUaJ/8viovxFUcdUBgF4UCVTmLfwUCAwEAAaNCMEAwDwYDVR0TAQH/BAUw +AwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJxfAN+qAdcwKziIorhtSpzyEZGDMA0GCSqG +SIb3DQEBCwUAA4IBAQBLNqaEd2ndOxmfZyMIbw5hyf2E3F/YNoHN2BtBLZ9g3ccaaNnRbobhiCPP +E95Dz+I0swSdHynVv/heyNXBve6SbzJ08pGCL72CQnqtKrcgfU28elUSwhXqvfdqlS5sdJ/PHLTy +xQGjhdByPq1zqwubdQxtRbeOlKyWN7Wg0I8VRw7j6IPdj/3vQQF3zCepYoUz8jcI73HPdwbeyBkd +iEDPfUYd/x7H4c7/I9vG+o1VTqkC50cRRj70/b17KSa7qWFiNyi2LSr2EIZkyXCn0q23KXB56jza +YyWf/Wi3MOxw+3WKt21gZ7IeyLnp2KhvAotnDU0mV3HaIPzBSlCNsSi6 +-----END CERTIFICATE----- + +AffirmTrust Commercial +====================== +-----BEGIN CERTIFICATE----- +MIIDTDCCAjSgAwIBAgIId3cGJyapsXwwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UEBhMCVVMxFDAS +BgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBDb21tZXJjaWFsMB4XDTEw +MDEyOTE0MDYwNloXDTMwMTIzMTE0MDYwNlowRDELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmly +bVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBDb21tZXJjaWFsMIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEA9htPZwcroRX1BiLLHwGy43NFBkRJLLtJJRTWzsO3qyxPxkEylFf6Eqdb +DuKPHx6GGaeqtS25Xw2Kwq+FNXkyLbscYjfysVtKPcrNcV/pQr6U6Mje+SJIZMblq8Yrba0F8PrV +C8+a5fBQpIs7R6UjW3p6+DM/uO+Zl+MgwdYoic+U+7lF7eNAFxHUdPALMeIrJmqbTFeurCA+ukV6 +BfO9m2kVrn1OIGPENXY6BwLJN/3HR+7o8XYdcxXyl6S1yHp52UKqK39c/s4mT6NmgTWvRLpUHhww +MmWd5jyTXlBOeuM61G7MGvv50jeuJCqrVwMiKA1JdX+3KNp1v47j3A55MQIDAQABo0IwQDAdBgNV +HQ4EFgQUnZPGU4teyq8/nx4P5ZmVvCT2lI8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AQYwDQYJKoZIhvcNAQELBQADggEBAFis9AQOzcAN/wr91LoWXym9e2iZWEnStB03TX8nfUYGXUPG +hi4+c7ImfU+TqbbEKpqrIZcUsd6M06uJFdhrJNTxFq7YpFzUf1GO7RgBsZNjvbz4YYCanrHOQnDi +qX0GJX0nof5v7LMeJNrjS1UaADs1tDvZ110w/YETifLCBivtZ8SOyUOyXGsViQK8YvxO8rUzqrJv +0wqiUOP2O+guRMLbZjipM1ZI8W0bM40NjD9gN53Tym1+NH4Nn3J2ixufcv1SNUFFApYvHLKac0kh +sUlHRUe072o0EclNmsxZt9YCnlpOZbWUrhvfKbAW8b8Angc6F2S1BLUjIZkKlTuXfO8= +-----END CERTIFICATE----- + +AffirmTrust Networking +====================== +-----BEGIN CERTIFICATE----- +MIIDTDCCAjSgAwIBAgIIfE8EORzUmS0wDQYJKoZIhvcNAQEFBQAwRDELMAkGA1UEBhMCVVMxFDAS +BgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBOZXR3b3JraW5nMB4XDTEw +MDEyOTE0MDgyNFoXDTMwMTIzMTE0MDgyNFowRDELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmly +bVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBOZXR3b3JraW5nMIIBIjANBgkqhkiG9w0BAQEF +AAOCAQ8AMIIBCgKCAQEAtITMMxcua5Rsa2FSoOujz3mUTOWUgJnLVWREZY9nZOIG41w3SfYvm4SE +Hi3yYJ0wTsyEheIszx6e/jarM3c1RNg1lho9Nuh6DtjVR6FqaYvZ/Ls6rnla1fTWcbuakCNrmreI +dIcMHl+5ni36q1Mr3Lt2PpNMCAiMHqIjHNRqrSK6mQEubWXLviRmVSRLQESxG9fhwoXA3hA/Pe24 +/PHxI1Pcv2WXb9n5QHGNfb2V1M6+oF4nI979ptAmDgAp6zxG8D1gvz9Q0twmQVGeFDdCBKNwV6gb +h+0t+nvujArjqWaJGctB+d1ENmHP4ndGyH329JKBNv3bNPFyfvMMFr20FQIDAQABo0IwQDAdBgNV +HQ4EFgQUBx/S55zawm6iQLSwelAQUHTEyL0wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC +AQYwDQYJKoZIhvcNAQEFBQADggEBAIlXshZ6qML91tmbmzTCnLQyFE2npN/svqe++EPbkTfOtDIu +UFUaNU52Q3Eg75N3ThVwLofDwR1t3Mu1J9QsVtFSUzpE0nPIxBsFZVpikpzuQY0x2+c06lkh1QF6 +12S4ZDnNye2v7UsDSKegmQGA3GWjNq5lWUhPgkvIZfFXHeVZLgo/bNjR9eUJtGxUAArgFU2HdW23 +WJZa3W3SAKD0m0i+wzekujbgfIeFlxoVot4uolu9rxj5kFDNcFn4J2dHy8egBzp90SxdbBk6ZrV9 +/ZFvgrG+CJPbFEfxojfHRZ48x3evZKiT3/Zpg4Jg8klCNO1aAFSFHBY2kgxc+qatv9s= +-----END CERTIFICATE----- + +AffirmTrust Premium +=================== +-----BEGIN CERTIFICATE----- +MIIFRjCCAy6gAwIBAgIIbYwURrGmCu4wDQYJKoZIhvcNAQEMBQAwQTELMAkGA1UEBhMCVVMxFDAS +BgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVzdCBQcmVtaXVtMB4XDTEwMDEy +OTE0MTAzNloXDTQwMTIzMTE0MTAzNlowQTELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRy +dXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVzdCBQcmVtaXVtMIICIjANBgkqhkiG9w0BAQEFAAOCAg8A +MIICCgKCAgEAxBLfqV/+Qd3d9Z+K4/as4Tx4mrzY8H96oDMq3I0gW64tb+eT2TZwamjPjlGjhVtn +BKAQJG9dKILBl1fYSCkTtuG+kU3fhQxTGJoeJKJPj/CihQvL9Cl/0qRY7iZNyaqoe5rZ+jjeRFcV +5fiMyNlI4g0WJx0eyIOFJbe6qlVBzAMiSy2RjYvmia9mx+n/K+k8rNrSs8PhaJyJ+HoAVt70VZVs ++7pk3WKL3wt3MutizCaam7uqYoNMtAZ6MMgpv+0GTZe5HMQxK9VfvFMSF5yZVylmd2EhMQcuJUmd +GPLu8ytxjLW6OQdJd/zvLpKQBY0tL3d770O/Nbua2Plzpyzy0FfuKE4mX4+QaAkvuPjcBukumj5R +p9EixAqnOEhss/n/fauGV+O61oV4d7pD6kh/9ti+I20ev9E2bFhc8e6kGVQa9QPSdubhjL08s9NI +S+LI+H+SqHZGnEJlPqQewQcDWkYtuJfzt9WyVSHvutxMAJf7FJUnM7/oQ0dG0giZFmA7mn7S5u04 +6uwBHjxIVkkJx0w3AJ6IDsBz4W9m6XJHMD4Q5QsDyZpCAGzFlH5hxIrff4IaC1nEWTJ3s7xgaVY5 +/bQGeyzWZDbZvUjthB9+pSKPKrhC9IK31FOQeE4tGv2Bb0TXOwF0lkLgAOIua+rF7nKsu7/+6qqo ++Nz2snmKtmcCAwEAAaNCMEAwHQYDVR0OBBYEFJ3AZ6YMItkm9UWrpmVSESfYRaxjMA8GA1UdEwEB +/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBDAUAA4ICAQCzV00QYk465KzquByv +MiPIs0laUZx2KI15qldGF9X1Uva3ROgIRL8YhNILgM3FEv0AVQVhh0HctSSePMTYyPtwni94loMg +Nt58D2kTiKV1NpgIpsbfrM7jWNa3Pt668+s0QNiigfV4Py/VpfzZotReBA4Xrf5B8OWycvpEgjNC +6C1Y91aMYj+6QrCcDFx+LmUmXFNPALJ4fqENmS2NuB2OosSw/WDQMKSOyARiqcTtNd56l+0OOF6S +L5Nwpamcb6d9Ex1+xghIsV5n61EIJenmJWtSKZGc0jlzCFfemQa0W50QBuHCAKi4HEoCChTQwUHK ++4w1IX2COPKpVJEZNZOUbWo6xbLQu4mGk+ibyQ86p3q4ofB4Rvr8Ny/lioTz3/4E2aFooC8k4gmV +BtWVyuEklut89pMFu+1z6S3RdTnX5yTb2E5fQ4+e0BQ5v1VwSJlXMbSc7kqYA5YwH2AG7hsj/oFg +IxpHYoWlzBk0gG+zrBrjn/B7SK3VAdlntqlyk+otZrWyuOQ9PLLvTIzq6we/qzWaVYa8GKa1qF60 +g2xraUDTn9zxw2lrueFtCfTxqlB2Cnp9ehehVZZCmTEJ3WARjQUwfuaORtGdFNrHF+QFlozEJLUb +zxQHskD4o55BhrwE0GuWyCqANP2/7waj3VjFhT0+j/6eKeC2uAloGRwYQw== +-----END CERTIFICATE----- + +AffirmTrust Premium ECC +======================= +-----BEGIN CERTIFICATE----- +MIIB/jCCAYWgAwIBAgIIdJclisc/elQwCgYIKoZIzj0EAwMwRTELMAkGA1UEBhMCVVMxFDASBgNV +BAoMC0FmZmlybVRydXN0MSAwHgYDVQQDDBdBZmZpcm1UcnVzdCBQcmVtaXVtIEVDQzAeFw0xMDAx +MjkxNDIwMjRaFw00MDEyMzExNDIwMjRaMEUxCzAJBgNVBAYTAlVTMRQwEgYDVQQKDAtBZmZpcm1U +cnVzdDEgMB4GA1UEAwwXQWZmaXJtVHJ1c3QgUHJlbWl1bSBFQ0MwdjAQBgcqhkjOPQIBBgUrgQQA +IgNiAAQNMF4bFZ0D0KF5Nbc6PJJ6yhUczWLznCZcBz3lVPqj1swS6vQUX+iOGasvLkjmrBhDeKzQ +N8O9ss0s5kfiGuZjuD0uL3jET9v0D6RoTFVya5UdThhClXjMNzyR4ptlKymjQjBAMB0GA1UdDgQW +BBSaryl6wBE1NSZRMADDav5A1a7WPDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAK +BggqhkjOPQQDAwNnADBkAjAXCfOHiFBar8jAQr9HX/VsaobgxCd05DhT1wV/GzTjxi+zygk8N53X +57hG8f2h4nECMEJZh0PUUd+60wkyWs6Iflc9nF9Ca/UHLbXwgpP5WW+uZPpY5Yse42O+tYHNbwKM +eQ== +-----END CERTIFICATE----- + +Certum Trusted Network CA +========================= +-----BEGIN CERTIFICATE----- +MIIDuzCCAqOgAwIBAgIDBETAMA0GCSqGSIb3DQEBBQUAMH4xCzAJBgNVBAYTAlBMMSIwIAYDVQQK +ExlVbml6ZXRvIFRlY2hub2xvZ2llcyBTLkEuMScwJQYDVQQLEx5DZXJ0dW0gQ2VydGlmaWNhdGlv +biBBdXRob3JpdHkxIjAgBgNVBAMTGUNlcnR1bSBUcnVzdGVkIE5ldHdvcmsgQ0EwHhcNMDgxMDIy +MTIwNzM3WhcNMjkxMjMxMTIwNzM3WjB+MQswCQYDVQQGEwJQTDEiMCAGA1UEChMZVW5pemV0byBU +ZWNobm9sb2dpZXMgUy5BLjEnMCUGA1UECxMeQ2VydHVtIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 +MSIwIAYDVQQDExlDZXJ0dW0gVHJ1c3RlZCBOZXR3b3JrIENBMIIBIjANBgkqhkiG9w0BAQEFAAOC +AQ8AMIIBCgKCAQEA4/t9o3K6wvDJFIf1awFO4W5AB7ptJ11/91sts1rHUV+rpDKmYYe2bg+G0jAC +l/jXaVehGDldamR5xgFZrDwxSjh80gTSSyjoIF87B6LMTXPb865Px1bVWqeWifrzq2jUI4ZZJ88J +J7ysbnKDHDBy3+Ci6dLhdHUZvSqeexVUBBvXQzmtVSjF4hq79MDkrjhJM8x2hZ85RdKknvISjFH4 +fOQtf/WsX+sWn7Et0brMkUJ3TCXJkDhv2/DM+44el1k+1WBO5gUo7Ul5E0u6SNsv+XLTOcr+H9g0 +cvW0QM8xAcPs3hEtF10fuFDRXhmnad4HMyjKUJX5p1TLVIZQRan5SQIDAQABo0IwQDAPBgNVHRMB +Af8EBTADAQH/MB0GA1UdDgQWBBQIds3LB/8k9sXN7buQvOKEN0Z19zAOBgNVHQ8BAf8EBAMCAQYw +DQYJKoZIhvcNAQEFBQADggEBAKaorSLOAT2mo/9i0Eidi15ysHhE49wcrwn9I0j6vSrEuVUEtRCj +jSfeC4Jj0O7eDDd5QVsisrCaQVymcODU0HfLI9MA4GxWL+FpDQ3Zqr8hgVDZBqWo/5U30Kr+4rP1 +mS1FhIrlQgnXdAIv94nYmem8J9RHjboNRhx3zxSkHLmkMcScKHQDNP8zGSal6Q10tz6XxnboJ5aj +Zt3hrvJBW8qYVoNzcOSGGtIxQbovvi0TWnZvTuhOgQ4/WwMioBK+ZlgRSssDxLQqKi2WF+A5VLxI +03YnnZotBqbJ7DnSq9ufmgsnAjUpsUCV5/nonFWIGUbWtzT1fs45mtk48VH3Tyw= +-----END CERTIFICATE----- + +Certinomis - Autorité Racine +============================ +-----BEGIN CERTIFICATE----- +MIIFnDCCA4SgAwIBAgIBATANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJGUjETMBEGA1UEChMK +Q2VydGlub21pczEXMBUGA1UECxMOMDAwMiA0MzM5OTg5MDMxJjAkBgNVBAMMHUNlcnRpbm9taXMg +LSBBdXRvcml0w6kgUmFjaW5lMB4XDTA4MDkxNzA4Mjg1OVoXDTI4MDkxNzA4Mjg1OVowYzELMAkG +A1UEBhMCRlIxEzARBgNVBAoTCkNlcnRpbm9taXMxFzAVBgNVBAsTDjAwMDIgNDMzOTk4OTAzMSYw +JAYDVQQDDB1DZXJ0aW5vbWlzIC0gQXV0b3JpdMOpIFJhY2luZTCCAiIwDQYJKoZIhvcNAQEBBQAD +ggIPADCCAgoCggIBAJ2Fn4bT46/HsmtuM+Cet0I0VZ35gb5j2CN2DpdUzZlMGvE5x4jYF1AMnmHa +wE5V3udauHpOd4cN5bjr+p5eex7Ezyh0x5P1FMYiKAT5kcOrJ3NqDi5N8y4oH3DfVS9O7cdxbwly +Lu3VMpfQ8Vh30WC8Tl7bmoT2R2FFK/ZQpn9qcSdIhDWerP5pqZ56XjUl+rSnSTV3lqc2W+HN3yNw +2F1MpQiD8aYkOBOo7C+ooWfHpi2GR+6K/OybDnT0K0kCe5B1jPyZOQE51kqJ5Z52qz6WKDgmi92N +jMD2AR5vpTESOH2VwnHu7XSu5DaiQ3XV8QCb4uTXzEIDS3h65X27uK4uIJPT5GHfceF2Z5c/tt9q +c1pkIuVC28+BA5PY9OMQ4HL2AHCs8MF6DwV/zzRpRbWT5BnbUhYjBYkOjUjkJW+zeL9i9Qf6lSTC +lrLooyPCXQP8w9PlfMl1I9f09bze5N/NgL+RiH2nE7Q5uiy6vdFrzPOlKO1Enn1So2+WLhl+HPNb +xxaOu2B9d2ZHVIIAEWBsMsGoOBvrbpgT1u449fCfDu/+MYHB0iSVL1N6aaLwD4ZFjliCK0wi1F6g +530mJ0jfJUaNSih8hp75mxpZuWW/Bd22Ql095gBIgl4g9xGC3srYn+Y3RyYe63j3YcNBZFgCQfna +4NH4+ej9Uji29YnfAgMBAAGjWzBZMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0G +A1UdDgQWBBQNjLZh2kS40RR9w759XkjwzspqsDAXBgNVHSAEEDAOMAwGCiqBegFWAgIAAQEwDQYJ +KoZIhvcNAQEFBQADggIBACQ+YAZ+He86PtvqrxyaLAEL9MW12Ukx9F1BjYkMTv9sov3/4gbIOZ/x +WqndIlgVqIrTseYyCYIDbNc/CMf4uboAbbnW/FIyXaR/pDGUu7ZMOH8oMDX/nyNTt7buFHAAQCva +R6s0fl6nVjBhK4tDrP22iCj1a7Y+YEq6QpA0Z43q619FVDsXrIvkxmUP7tCMXWY5zjKn2BCXwH40 +nJ+U8/aGH88bc62UeYdocMMzpXDn2NU4lG9jeeu/Cg4I58UvD0KgKxRA/yHgBcUn4YQRE7rWhh1B +CxMjidPJC+iKunqjo3M3NYB9Ergzd0A4wPpeMNLytqOx1qKVl4GbUu1pTP+A5FPbVFsDbVRfsbjv +JL1vnxHDx2TCDyhihWZeGnuyt++uNckZM6i4J9szVb9o4XVIRFb7zdNIu0eJOqxp9YDG5ERQL1TE +qkPFMTFYvZbF6nVsmnWxTfj3l/+WFvKXTej28xH5On2KOG4Ey+HTRRWqpdEdnV1j6CTmNhTih60b +WfVEm/vXd3wfAXBioSAaosUaKPQhA+4u2cGA6rnZgtZbdsLLO7XSAPCjDuGtbkD326C00EauFddE +wk01+dIL8hf2rGbVJLJP0RyZwG71fet0BLj5TXcJ17TPBzAJ8bgAVtkXFhYKK4bfjwEZGuW7gmP/ +vgt2Fl43N+bYdJeimUV5 +-----END CERTIFICATE----- + +TWCA Root Certification Authority +================================= +-----BEGIN CERTIFICATE----- +MIIDezCCAmOgAwIBAgIBATANBgkqhkiG9w0BAQUFADBfMQswCQYDVQQGEwJUVzESMBAGA1UECgwJ +VEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NBIFJvb3QgQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkwHhcNMDgwODI4MDcyNDMzWhcNMzAxMjMxMTU1OTU5WjBfMQswCQYDVQQG +EwJUVzESMBAGA1UECgwJVEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NB +IFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK +AoIBAQCwfnK4pAOU5qfeCTiRShFAh6d8WWQUe7UREN3+v9XAu1bihSX0NXIP+FPQQeFEAcK0HMMx +QhZHhTMidrIKbw/lJVBPhYa+v5guEGcevhEFhgWQxFnQfHgQsIBct+HHK3XLfJ+utdGdIzdjp9xC +oi2SBBtQwXu4PhvJVgSLL1KbralW6cH/ralYhzC2gfeXRfwZVzsrb+RH9JlF/h3x+JejiB03HFyP +4HYlmlD4oFT/RJB2I9IyxsOrBr/8+7/zrX2SYgJbKdM1o5OaQ2RgXbL6Mv87BK9NQGr5x+PvI/1r +y+UPizgN7gr8/g+YnzAx3WxSZfmLgb4i4RxYA7qRG4kHAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIB +BjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqOFsmjd6LWvJPelSDGRjjCDWmujANBgkqhkiG +9w0BAQUFAAOCAQEAPNV3PdrfibqHDAhUaiBQkr6wQT25JmSDCi/oQMCXKCeCMErJk/9q56YAf4lC +mtYR5VPOL8zy2gXE/uJQxDqGfczafhAJO5I1KlOy/usrBdlsXebQ79NqZp4VKIV66IIArB6nCWlW +QtNoURi+VJq/REG6Sb4gumlc7rh3zc5sH62Dlhh9DrUUOYTxKOkto557HnpyWoOzeW/vtPzQCqVY +T0bf+215WfKEIlKuD8z7fDvnaspHYcN6+NOSBB+4IIThNlQWx0DeO4pz3N/GCUzf7Nr/1FNCocny +Yh0igzyXxfkZYiesZSLX0zzG5Y6yU8xJzrww/nsOM5D77dIUkR8Hrw== +-----END CERTIFICATE----- + +Security Communication RootCA2 +============================== +-----BEGIN CERTIFICATE----- +MIIDdzCCAl+gAwIBAgIBADANBgkqhkiG9w0BAQsFADBdMQswCQYDVQQGEwJKUDElMCMGA1UEChMc +U0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEnMCUGA1UECxMeU2VjdXJpdHkgQ29tbXVuaWNh +dGlvbiBSb290Q0EyMB4XDTA5MDUyOTA1MDAzOVoXDTI5MDUyOTA1MDAzOVowXTELMAkGA1UEBhMC +SlAxJTAjBgNVBAoTHFNFQ09NIFRydXN0IFN5c3RlbXMgQ08uLExURC4xJzAlBgNVBAsTHlNlY3Vy +aXR5IENvbW11bmljYXRpb24gUm9vdENBMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +ANAVOVKxUrO6xVmCxF1SrjpDZYBLx/KWvNs2l9amZIyoXvDjChz335c9S672XewhtUGrzbl+dp++ ++T42NKA7wfYxEUV0kz1XgMX5iZnK5atq1LXaQZAQwdbWQonCv/Q4EpVMVAX3NuRFg3sUZdbcDE3R +3n4MqzvEFb46VqZab3ZpUql6ucjrappdUtAtCms1FgkQhNBqyjoGADdH5H5XTz+L62e4iKrFvlNV +spHEfbmwhRkGeC7bYRr6hfVKkaHnFtWOojnflLhwHyg/i/xAXmODPIMqGplrz95Zajv8bxbXH/1K +EOtOghY6rCcMU/Gt1SSwawNQwS08Ft1ENCcadfsCAwEAAaNCMEAwHQYDVR0OBBYEFAqFqXdlBZh8 +QIH4D5csOPEK7DzPMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEB +CwUAA4IBAQBMOqNErLlFsceTfsgLCkLfZOoc7llsCLqJX2rKSpWeeo8HxdpFcoJxDjrSzG+ntKEj +u/Ykn8sX/oymzsLS28yN/HH8AynBbF0zX2S2ZTuJbxh2ePXcokgfGT+Ok+vx+hfuzU7jBBJV1uXk +3fs+BXziHV7Gp7yXT2g69ekuCkO2r1dcYmh8t/2jioSgrGK+KwmHNPBqAbubKVY8/gA3zyNs8U6q +tnRGEmyR7jTV7JqR50S+kDFy1UkC9gLl9B/rfNmWVan/7Ir5mUf/NVoCqgTLiluHcSmRvaS0eg29 +mvVXIwAHIRc/SjnRBUkLp7Y3gaVdjKozXoEofKd9J+sAro03 +-----END CERTIFICATE----- + +EC-ACC +====== +-----BEGIN CERTIFICATE----- +MIIFVjCCBD6gAwIBAgIQ7is969Qh3hSoYqwE893EATANBgkqhkiG9w0BAQUFADCB8zELMAkGA1UE +BhMCRVMxOzA5BgNVBAoTMkFnZW5jaWEgQ2F0YWxhbmEgZGUgQ2VydGlmaWNhY2lvIChOSUYgUS0w +ODAxMTc2LUkpMSgwJgYDVQQLEx9TZXJ2ZWlzIFB1YmxpY3MgZGUgQ2VydGlmaWNhY2lvMTUwMwYD +VQQLEyxWZWdldSBodHRwczovL3d3dy5jYXRjZXJ0Lm5ldC92ZXJhcnJlbCAoYykwMzE1MDMGA1UE +CxMsSmVyYXJxdWlhIEVudGl0YXRzIGRlIENlcnRpZmljYWNpbyBDYXRhbGFuZXMxDzANBgNVBAMT +BkVDLUFDQzAeFw0wMzAxMDcyMzAwMDBaFw0zMTAxMDcyMjU5NTlaMIHzMQswCQYDVQQGEwJFUzE7 +MDkGA1UEChMyQWdlbmNpYSBDYXRhbGFuYSBkZSBDZXJ0aWZpY2FjaW8gKE5JRiBRLTA4MDExNzYt +SSkxKDAmBgNVBAsTH1NlcnZlaXMgUHVibGljcyBkZSBDZXJ0aWZpY2FjaW8xNTAzBgNVBAsTLFZl +Z2V1IGh0dHBzOi8vd3d3LmNhdGNlcnQubmV0L3ZlcmFycmVsIChjKTAzMTUwMwYDVQQLEyxKZXJh +cnF1aWEgRW50aXRhdHMgZGUgQ2VydGlmaWNhY2lvIENhdGFsYW5lczEPMA0GA1UEAxMGRUMtQUND +MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsyLHT+KXQpWIR4NA9h0X84NzJB5R85iK +w5K4/0CQBXCHYMkAqbWUZRkiFRfCQ2xmRJoNBD45b6VLeqpjt4pEndljkYRm4CgPukLjbo73FCeT +ae6RDqNfDrHrZqJyTxIThmV6PttPB/SnCWDaOkKZx7J/sxaVHMf5NLWUhdWZXqBIoH7nF2W4onW4 +HvPlQn2v7fOKSGRdghST2MDk/7NQcvJ29rNdQlB50JQ+awwAvthrDk4q7D7SzIKiGGUzE3eeml0a +E9jD2z3Il3rucO2n5nzbcc8tlGLfbdb1OL4/pYUKGbio2Al1QnDE6u/LDsg0qBIimAy4E5S2S+zw +0JDnJwIDAQABo4HjMIHgMB0GA1UdEQQWMBSBEmVjX2FjY0BjYXRjZXJ0Lm5ldDAPBgNVHRMBAf8E +BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUoMOLRKo3pUW/l4Ba0fF4opvpXY0wfwYD +VR0gBHgwdjB0BgsrBgEEAfV4AQMBCjBlMCwGCCsGAQUFBwIBFiBodHRwczovL3d3dy5jYXRjZXJ0 +Lm5ldC92ZXJhcnJlbDA1BggrBgEFBQcCAjApGidWZWdldSBodHRwczovL3d3dy5jYXRjZXJ0Lm5l +dC92ZXJhcnJlbCAwDQYJKoZIhvcNAQEFBQADggEBAKBIW4IB9k1IuDlVNZyAelOZ1Vr/sXE7zDkJ +lF7W2u++AVtd0x7Y/X1PzaBB4DSTv8vihpw3kpBWHNzrKQXlxJ7HNd+KDM3FIUPpqojlNcAZQmNa +Al6kSBg6hW/cnbw/nZzBh7h6YQjpdwt/cKt63dmXLGQehb+8dJahw3oS7AwaboMMPOhyRp/7SNVe +l+axofjk70YllJyJ22k4vuxcDlbHZVHlUIiIv0LVKz3l+bqeLrPK9HOSAgu+TGbrIP65y7WZf+a2 +E/rKS03Z7lNGBjvGTq2TWoF+bCpLagVFjPIhpDGQh2xlnJ2lYJU6Un/10asIbvPuW/mIPX64b24D +5EI= +-----END CERTIFICATE----- + +Hellenic Academic and Research Institutions RootCA 2011 +======================================================= +-----BEGIN CERTIFICATE----- +MIIEMTCCAxmgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBlTELMAkGA1UEBhMCR1IxRDBCBgNVBAoT +O0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgQ2VydC4gQXV0aG9y +aXR5MUAwPgYDVQQDEzdIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25z +IFJvb3RDQSAyMDExMB4XDTExMTIwNjEzNDk1MloXDTMxMTIwMTEzNDk1MlowgZUxCzAJBgNVBAYT +AkdSMUQwQgYDVQQKEztIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25z +IENlcnQuIEF1dGhvcml0eTFAMD4GA1UEAxM3SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNo +IEluc3RpdHV0aW9ucyBSb290Q0EgMjAxMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB +AKlTAOMupvaO+mDYLZU++CwqVE7NuYRhlFhPjz2L5EPzdYmNUeTDN9KKiE15HrcS3UN4SoqS5tdI +1Q+kOilENbgH9mgdVc04UfCMJDGFr4PJfel3r+0ae50X+bOdOFAPplp5kYCvN66m0zH7tSYJnTxa +71HFK9+WXesyHgLacEnsbgzImjeN9/E2YEsmLIKe0HjzDQ9jpFEw4fkrJxIH2Oq9GGKYsFk3fb7u +8yBRQlqD75O6aRXxYp2fmTmCobd0LovUxQt7L/DICto9eQqakxylKHJzkUOap9FNhYS5qXSPFEDH +3N6sQWRstBmbAmNtJGSPRLIl6s5ddAxjMlyNh+UCAwEAAaOBiTCBhjAPBgNVHRMBAf8EBTADAQH/ +MAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQUppFC/RNhSiOeCKQp5dgTBCPuQSUwRwYDVR0eBEAwPqA8 +MAWCAy5ncjAFggMuZXUwBoIELmVkdTAGggQub3JnMAWBAy5ncjAFgQMuZXUwBoEELmVkdTAGgQQu +b3JnMA0GCSqGSIb3DQEBBQUAA4IBAQAf73lB4XtuP7KMhjdCSk4cNx6NZrokgclPEg8hwAOXhiVt +XdMiKahsog2p6z0GW5k6x8zDmjR/qw7IThzh+uTczQ2+vyT+bOdrwg3IBp5OjWEopmr95fZi6hg8 +TqBTnbI6nOulnJEWtk2C4AwFSKls9cz4y51JtPACpf1wA+2KIaWuE4ZJwzNzvoc7dIsXRSZMFpGD +/md9zU1jZ/rzAxKWeAaNsWftjj++n08C9bMJL/NMh98qy5V8AcysNnq/onN694/BtZqhFLKPM58N +7yLcZnuEvUUXBj08yrl3NI/K6s8/MT7jiOOASSXIl7WdmplNsDz4SgCbZN2fOUvRJ9e4 +-----END CERTIFICATE----- + +Actalis Authentication Root CA +============================== +-----BEGIN CERTIFICATE----- +MIIFuzCCA6OgAwIBAgIIVwoRl0LE48wwDQYJKoZIhvcNAQELBQAwazELMAkGA1UEBhMCSVQxDjAM +BgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8wMzM1ODUyMDk2NzEnMCUGA1UE +AwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290IENBMB4XDTExMDkyMjExMjIwMloXDTMwMDky +MjExMjIwMlowazELMAkGA1UEBhMCSVQxDjAMBgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlz +IFMucC5BLi8wMzM1ODUyMDk2NzEnMCUGA1UEAwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290 +IENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAp8bEpSmkLO/lGMWwUKNvUTufClrJ +wkg4CsIcoBh/kbWHuUA/3R1oHwiD1S0eiKD4j1aPbZkCkpAW1V8IbInX4ay8IMKx4INRimlNAJZa +by/ARH6jDuSRzVju3PvHHkVH3Se5CAGfpiEd9UEtL0z9KK3giq0itFZljoZUj5NDKd45RnijMCO6 +zfB9E1fAXdKDa0hMxKufgFpbOr3JpyI/gCczWw63igxdBzcIy2zSekciRDXFzMwujt0q7bd9Zg1f +YVEiVRvjRuPjPdA1YprbrxTIW6HMiRvhMCb8oJsfgadHHwTrozmSBp+Z07/T6k9QnBn+locePGX2 +oxgkg4YQ51Q+qDp2JE+BIcXjDwL4k5RHILv+1A7TaLndxHqEguNTVHnd25zS8gebLra8Pu2Fbe8l +EfKXGkJh90qX6IuxEAf6ZYGyojnP9zz/GPvG8VqLWeICrHuS0E4UT1lF9gxeKF+w6D9Fz8+vm2/7 +hNN3WpVvrJSEnu68wEqPSpP4RCHiMUVhUE4Q2OM1fEwZtN4Fv6MGn8i1zeQf1xcGDXqVdFUNaBr8 +EBtiZJ1t4JWgw5QHVw0U5r0F+7if5t+L4sbnfpb2U8WANFAoWPASUHEXMLrmeGO89LKtmyuy/uE5 +jF66CyCU3nuDuP/jVo23Eek7jPKxwV2dpAtMK9myGPW1n0sCAwEAAaNjMGEwHQYDVR0OBBYEFFLY +iDrIn3hm7YnzezhwlMkCAjbQMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUUtiIOsifeGbt +ifN7OHCUyQICNtAwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBCwUAA4ICAQALe3KHwGCmSUyI +WOYdiPcUZEim2FgKDk8TNd81HdTtBjHIgT5q1d07GjLukD0R0i70jsNjLiNmsGe+b7bAEzlgqqI0 +JZN1Ut6nna0Oh4lScWoWPBkdg/iaKWW+9D+a2fDzWochcYBNy+A4mz+7+uAwTc+G02UQGRjRlwKx +K3JCaKygvU5a2hi/a5iB0P2avl4VSM0RFbnAKVy06Ij3Pjaut2L9HmLecHgQHEhb2rykOLpn7VU+ +Xlff1ANATIGk0k9jpwlCCRT8AKnCgHNPLsBA2RF7SOp6AsDT6ygBJlh0wcBzIm2Tlf05fbsq4/aC +4yyXX04fkZT6/iyj2HYauE2yOE+b+h1IYHkm4vP9qdCa6HCPSXrW5b0KDtst842/6+OkfcvHlXHo +2qN8xcL4dJIEG4aspCJTQLas/kx2z/uUMsA1n3Y/buWQbqCmJqK4LL7RK4X9p2jIugErsWx0Hbhz +lefut8cl8ABMALJ+tguLHPPAUJ4lueAI3jZm/zel0btUZCzJJ7VLkn5l/9Mt4blOvH+kQSGQQXem +OR/qnuOf0GZvBeyqdn6/axag67XH/JJULysRJyU3eExRarDzzFhdFPFqSBX/wge2sY0PjlxQRrM9 +vwGYT7JZVEc+NHt4bVaTLnPqZih4zR0Uv6CPLy64Lo7yFIrM6bV8+2ydDKXhlg== +-----END CERTIFICATE----- + +Trustis FPS Root CA +=================== +-----BEGIN CERTIFICATE----- +MIIDZzCCAk+gAwIBAgIQGx+ttiD5JNM2a/fH8YygWTANBgkqhkiG9w0BAQUFADBFMQswCQYDVQQG +EwJHQjEYMBYGA1UEChMPVHJ1c3RpcyBMaW1pdGVkMRwwGgYDVQQLExNUcnVzdGlzIEZQUyBSb290 +IENBMB4XDTAzMTIyMzEyMTQwNloXDTI0MDEyMTExMzY1NFowRTELMAkGA1UEBhMCR0IxGDAWBgNV +BAoTD1RydXN0aXMgTGltaXRlZDEcMBoGA1UECxMTVHJ1c3RpcyBGUFMgUm9vdCBDQTCCASIwDQYJ +KoZIhvcNAQEBBQADggEPADCCAQoCggEBAMVQe547NdDfxIzNjpvto8A2mfRC6qc+gIMPpqdZh8mQ +RUN+AOqGeSoDvT03mYlmt+WKVoaTnGhLaASMk5MCPjDSNzoiYYkchU59j9WvezX2fihHiTHcDnlk +H5nSW7r+f2C/revnPDgpai/lkQtV/+xvWNUtyd5MZnGPDNcE2gfmHhjjvSkCqPoc4Vu5g6hBSLwa +cY3nYuUtsuvffM/bq1rKMfFMIvMFE/eC+XN5DL7XSxzA0RU8k0Fk0ea+IxciAIleH2ulrG6nS4zt +o3Lmr2NNL4XSFDWaLk6M6jKYKIahkQlBOrTh4/L68MkKokHdqeMDx4gVOxzUGpTXn2RZEm0CAwEA +AaNTMFEwDwYDVR0TAQH/BAUwAwEB/zAfBgNVHSMEGDAWgBS6+nEleYtXQSUhhgtx67JkDoshZzAd +BgNVHQ4EFgQUuvpxJXmLV0ElIYYLceuyZA6LIWcwDQYJKoZIhvcNAQEFBQADggEBAH5Y//01GX2c +GE+esCu8jowU/yyg2kdbw++BLa8F6nRIW/M+TgfHbcWzk88iNVy2P3UnXwmWzaD+vkAMXBJV+JOC +yinpXj9WV4s4NvdFGkwozZ5BuO1WTISkQMi4sKUraXAEasP41BIy+Q7DsdwyhEQsb8tGD+pmQQ9P +8Vilpg0ND2HepZ5dfWWhPBfnqFVO76DH7cZEf1T1o+CP8HxVIo8ptoGj4W1OLBuAZ+ytIJ8MYmHV +l/9D7S3B2l0pKoU/rGXuhg8FjZBf3+6f9L/uHfuY5H+QK4R4EA5sSVPvFVtlRkpdr7r7OnIdzfYl +iB6XzCGcKQENZetX2fNXlrtIzYE= +-----END CERTIFICATE----- + +StartCom Certification Authority +================================ +-----BEGIN CERTIFICATE----- +MIIHhzCCBW+gAwIBAgIBLTANBgkqhkiG9w0BAQsFADB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMN +U3RhcnRDb20gTHRkLjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmlu +ZzEpMCcGA1UEAxMgU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDYwOTE3MTk0 +NjM3WhcNMzYwOTE3MTk0NjM2WjB9MQswCQYDVQQGEwJJTDEWMBQGA1UEChMNU3RhcnRDb20gTHRk +LjErMCkGA1UECxMiU2VjdXJlIERpZ2l0YWwgQ2VydGlmaWNhdGUgU2lnbmluZzEpMCcGA1UEAxMg +U3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAw +ggIKAoICAQDBiNsJvGxGfHiflXu1M5DycmLWwTYgIiRezul38kMKogZkpMyONvg45iPwbm2xPN1y +o4UcodM9tDMr0y+v/uqwQVlntsQGfQqedIXWeUyAN3rfOQVSWff0G0ZDpNKFhdLDcfN1YjS6LIp/ +Ho/u7TTQEceWzVI9ujPW3U3eCztKS5/CJi/6tRYccjV3yjxd5srhJosaNnZcAdt0FCX+7bWgiA/d +eMotHweXMAEtcnn6RtYTKqi5pquDSR3l8u/d5AGOGAqPY1MWhWKpDhk6zLVmpsJrdAfkK+F2PrRt +2PZE4XNiHzvEvqBTViVsUQn3qqvKv3b9bZvzndu/PWa8DFaqr5hIlTpL36dYUNk4dalb6kMMAv+Z +6+hsTXBbKWWc3apdzK8BMewM69KN6Oqce+Zu9ydmDBpI125C4z/eIT574Q1w+2OqqGwaVLRcJXrJ +osmLFqa7LH4XXgVNWG4SHQHuEhANxjJ/GP/89PrNbpHoNkm+Gkhpi8KWTRoSsmkXwQqQ1vp5Iki/ +untp+HDH+no32NgN0nZPV/+Qt+OR0t3vwmC3Zzrd/qqc8NSLf3Iizsafl7b4r4qgEKjZ+xjGtrVc +UjyJthkqcwEKDwOzEmDyei+B26Nu/yYwl/WL3YlXtq09s68rxbd2AvCl1iuahhQqcvbjM4xdCUsT +37uMdBNSSwIDAQABo4ICEDCCAgwwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYD +VR0OBBYEFE4L7xqkQFulF2mHMMo0aEPQQa7yMB8GA1UdIwQYMBaAFE4L7xqkQFulF2mHMMo0aEPQ +Qa7yMIIBWgYDVR0gBIIBUTCCAU0wggFJBgsrBgEEAYG1NwEBATCCATgwLgYIKwYBBQUHAgEWImh0 +dHA6Ly93d3cuc3RhcnRzc2wuY29tL3BvbGljeS5wZGYwNAYIKwYBBQUHAgEWKGh0dHA6Ly93d3cu +c3RhcnRzc2wuY29tL2ludGVybWVkaWF0ZS5wZGYwgc8GCCsGAQUFBwICMIHCMCcWIFN0YXJ0IENv +bW1lcmNpYWwgKFN0YXJ0Q29tKSBMdGQuMAMCAQEagZZMaW1pdGVkIExpYWJpbGl0eSwgcmVhZCB0 +aGUgc2VjdGlvbiAqTGVnYWwgTGltaXRhdGlvbnMqIG9mIHRoZSBTdGFydENvbSBDZXJ0aWZpY2F0 +aW9uIEF1dGhvcml0eSBQb2xpY3kgYXZhaWxhYmxlIGF0IGh0dHA6Ly93d3cuc3RhcnRzc2wuY29t +L3BvbGljeS5wZGYwEQYJYIZIAYb4QgEBBAQDAgAHMDgGCWCGSAGG+EIBDQQrFilTdGFydENvbSBG +cmVlIFNTTCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTANBgkqhkiG9w0BAQsFAAOCAgEAjo/n3JR5 +fPGFf59Jb2vKXfuM/gTFwWLRfUKKvFO3lANmMD+x5wqnUCBVJX92ehQN6wQOQOY+2IirByeDqXWm +N3PH/UvSTa0XQMhGvjt/UfzDtgUx3M2FIk5xt/JxXrAaxrqTi3iSSoX4eA+D/i+tLPfkpLst0OcN +Org+zvZ49q5HJMqjNTbOx8aHmNrs++myziebiMMEofYLWWivydsQD032ZGNcpRJvkrKTlMeIFw6T +tn5ii5B/q06f/ON1FE8qMt9bDeD1e5MNq6HPh+GlBEXoPBKlCcWw0bdT82AUuoVpaiF8H3VhFyAX +e2w7QSlc4axa0c2Mm+tgHRns9+Ww2vl5GKVFP0lDV9LdJNUso/2RjSe15esUBppMeyG7Oq0wBhjA +2MFrLH9ZXF2RsXAiV+uKa0hK1Q8p7MZAwC+ITGgBF3f0JBlPvfrhsiAhS90a2Cl9qrjeVOwhVYBs +HvUwyKMQ5bLmKhQxw4UtjJixhlpPiVktucf3HMiKf8CdBUrmQk9io20ppB+Fq9vlgcitKj1MXVuE +JnHEhV5xJMqlG2zYYdMa4FTbzrqpMrUi9nNBCV24F10OD5mQ1kfabwo6YigUZ4LZ8dCAWZvLMdib +D4x3TrVoivJs9iQOLWxwxXPR3hTQcY+203sC9uO41Alua551hDnmfyWl8kgAwKQB2j8= +-----END CERTIFICATE----- + +StartCom Certification Authority G2 +=================================== +-----BEGIN CERTIFICATE----- +MIIFYzCCA0ugAwIBAgIBOzANBgkqhkiG9w0BAQsFADBTMQswCQYDVQQGEwJJTDEWMBQGA1UEChMN +U3RhcnRDb20gTHRkLjEsMCoGA1UEAxMjU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkg +RzIwHhcNMTAwMTAxMDEwMDAxWhcNMzkxMjMxMjM1OTAxWjBTMQswCQYDVQQGEwJJTDEWMBQGA1UE +ChMNU3RhcnRDb20gTHRkLjEsMCoGA1UEAxMjU3RhcnRDb20gQ2VydGlmaWNhdGlvbiBBdXRob3Jp +dHkgRzIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2iTZbB7cgNr2Cu+EWIAOVeq8O +o1XJJZlKxdBWQYeQTSFgpBSHO839sj60ZwNq7eEPS8CRhXBF4EKe3ikj1AENoBB5uNsDvfOpL9HG +4A/LnooUCri99lZi8cVytjIl2bLzvWXFDSxu1ZJvGIsAQRSCb0AgJnooD/Uefyf3lLE3PbfHkffi +Aez9lInhzG7TNtYKGXmu1zSCZf98Qru23QumNK9LYP5/Q0kGi4xDuFby2X8hQxfqp0iVAXV16iul +Q5XqFYSdCI0mblWbq9zSOdIxHWDirMxWRST1HFSr7obdljKF+ExP6JV2tgXdNiNnvP8V4so75qbs +O+wmETRIjfaAKxojAuuKHDp2KntWFhxyKrOq42ClAJ8Em+JvHhRYW6Vsi1g8w7pOOlz34ZYrPu8H +vKTlXcxNnw3h3Kq74W4a7I/htkxNeXJdFzULHdfBR9qWJODQcqhaX2YtENwvKhOuJv4KHBnM0D4L +nMgJLvlblnpHnOl68wVQdJVznjAJ85eCXuaPOQgeWeU1FEIT/wCc976qUM/iUUjXuG+v+E5+M5iS +FGI6dWPPe/regjupuznixL0sAA7IF6wT700ljtizkC+p2il9Ha90OrInwMEePnWjFqmveiJdnxMa +z6eg6+OGCtP95paV1yPIN93EfKo2rJgaErHgTuixO/XWb/Ew1wIDAQABo0IwQDAPBgNVHRMBAf8E +BTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUS8W0QGutHLOlHGVuRjaJhwUMDrYwDQYJ +KoZIhvcNAQELBQADggIBAHNXPyzVlTJ+N9uWkusZXn5T50HsEbZH77Xe7XRcxfGOSeD8bpkTzZ+K +2s06Ctg6Wgk/XzTQLwPSZh0avZyQN8gMjgdalEVGKua+etqhqaRpEpKwfTbURIfXUfEpY9Z1zRbk +J4kd+MIySP3bmdCPX1R0zKxnNBFi2QwKN4fRoxdIjtIXHfbX/dtl6/2o1PXWT6RbdejF0mCy2wl+ +JYt7ulKSnj7oxXehPOBKc2thz4bcQ///If4jXSRK9dNtD2IEBVeC2m6kMyV5Sy5UGYvMLD0w6dEG +/+gyRr61M3Z3qAFdlsHB1b6uJcDJHgoJIIihDsnzb02CVAAgp9KP5DlUFy6NHrgbuxu9mk47EDTc +nIhT76IxW1hPkWLIwpqazRVdOKnWvvgTtZ8SafJQYqz7Fzf07rh1Z2AQ+4NQ+US1dZxAF7L+/Xld +blhYXzD8AK6vM8EOTmy6p6ahfzLbOOCxchcKK5HsamMm7YnUeMx0HgX4a/6ManY5Ka5lIxKVCCIc +l85bBu4M4ru8H0ST9tg4RQUh7eStqxK2A6RCLi3ECToDZ2mEmuFZkIoohdVddLHRDiBYmxOlsGOm +7XtH/UVVMKTumtTm4ofvmMkyghEpIrwACjFeLQ/Ajulrso8uBtjRkcfGEvRM/TAXw8HaOFvjqerm +obp573PYtlNXLfbQ4ddI +-----END CERTIFICATE----- + +Buypass Class 2 Root CA +======================= +-----BEGIN CERTIFICATE----- +MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU +QnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3MgQ2xhc3MgMiBSb290IENBMB4X +DTEwMTAyNjA4MzgwM1oXDTQwMTAyNjA4MzgwM1owTjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1 +eXBhc3MgQVMtOTgzMTYzMzI3MSAwHgYDVQQDDBdCdXlwYXNzIENsYXNzIDIgUm9vdCBDQTCCAiIw +DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANfHXvfBB9R3+0Mh9PT1aeTuMgHbo4Yf5FkNuud1 +g1Lr6hxhFUi7HQfKjK6w3Jad6sNgkoaCKHOcVgb/S2TwDCo3SbXlzwx87vFKu3MwZfPVL4O2fuPn +9Z6rYPnT8Z2SdIrkHJasW4DptfQxh6NR/Md+oW+OU3fUl8FVM5I+GC911K2GScuVr1QGbNgGE41b +/+EmGVnAJLqBcXmQRFBoJJRfuLMR8SlBYaNByyM21cHxMlAQTn/0hpPshNOOvEu/XAFOBz3cFIqU +CqTqc/sLUegTBxj6DvEr0VQVfTzh97QZQmdiXnfgolXsttlpF9U6r0TtSsWe5HonfOV116rLJeff +awrbD02TTqigzXsu8lkBarcNuAeBfos4GzjmCleZPe4h6KP1DBbdi+w0jpwqHAAVF41og9JwnxgI +zRFo1clrUs3ERo/ctfPYV3Me6ZQ5BL/T3jjetFPsaRyifsSP5BtwrfKi+fv3FmRmaZ9JUaLiFRhn +Bkp/1Wy1TbMz4GHrXb7pmA8y1x1LPC5aAVKRCfLf6o3YBkBjqhHk/sM3nhRSP/TizPJhk9H9Z2vX +Uq6/aKtAQ6BXNVN48FP4YUIHZMbXb5tMOA1jrGKvNouicwoN9SG9dKpN6nIDSdvHXx1iY8f93ZHs +M+71bbRuMGjeyNYmsHVee7QHIJihdjK4TWxPAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYD +VR0OBBYEFMmAd+BikoL1RpzzuvdMw964o605MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsF +AAOCAgEAU18h9bqwOlI5LJKwbADJ784g7wbylp7ppHR/ehb8t/W2+xUbP6umwHJdELFx7rxP462s +A20ucS6vxOOto70MEae0/0qyexAQH6dXQbLArvQsWdZHEIjzIVEpMMpghq9Gqx3tOluwlN5E40EI +osHsHdb9T7bWR9AUC8rmyrV7d35BH16Dx7aMOZawP5aBQW9gkOLo+fsicdl9sz1Gv7SEr5AcD48S +aq/v7h56rgJKihcrdv6sVIkkLE8/trKnToyokZf7KcZ7XC25y2a2t6hbElGFtQl+Ynhw/qlqYLYd +DnkM/crqJIByw5c/8nerQyIKx+u2DISCLIBrQYoIwOula9+ZEsuK1V6ADJHgJgg2SMX6OBE1/yWD +LfJ6v9r9jv6ly0UsH8SIU653DtmadsWOLB2jutXsMq7Aqqz30XpN69QH4kj3Io6wpJ9qzo6ysmD0 +oyLQI+uUWnpp3Q+/QFesa1lQ2aOZ4W7+jQF5JyMV3pKdewlNWudLSDBaGOYKbeaP4NK75t98biGC +wWg5TbSYWGZizEqQXsP6JwSxeRV0mcy+rSDeJmAc61ZRpqPq5KM/p/9h3PFaTWwyI0PurKju7koS +CTxdccK+efrCh2gdC/1cacwG0Jp9VJkqyTkaGa9LKkPzY11aWOIv4x3kqdbQCtCev9eBCfHJxyYN +rJgWVqA= +-----END CERTIFICATE----- + +Buypass Class 3 Root CA +======================= +-----BEGIN CERTIFICATE----- +MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU +QnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3MgQ2xhc3MgMyBSb290IENBMB4X +DTEwMTAyNjA4Mjg1OFoXDTQwMTAyNjA4Mjg1OFowTjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1 +eXBhc3MgQVMtOTgzMTYzMzI3MSAwHgYDVQQDDBdCdXlwYXNzIENsYXNzIDMgUm9vdCBDQTCCAiIw +DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAKXaCpUWUOOV8l6ddjEGMnqb8RB2uACatVI2zSRH +sJ8YZLya9vrVediQYkwiL944PdbgqOkcLNt4EemOaFEVcsfzM4fkoF0LXOBXByow9c3EN3coTRiR +5r/VUv1xLXA+58bEiuPwKAv0dpihi4dVsjoT/Lc+JzeOIuOoTyrvYLs9tznDDgFHmV0ST9tD+leh +7fmdvhFHJlsTmKtdFoqwNxxXnUX/iJY2v7vKB3tvh2PX0DJq1l1sDPGzbjniazEuOQAnFN44wOwZ +ZoYS6J1yFhNkUsepNxz9gjDthBgd9K5c/3ATAOux9TN6S9ZV+AWNS2mw9bMoNlwUxFFzTWsL8TQH +2xc519woe2v1n/MuwU8XKhDzzMro6/1rqy6any2CbgTUUgGTLT2G/H783+9CHaZr77kgxve9oKeV +/afmiSTYzIw0bOIjL9kSGiG5VZFvC5F5GQytQIgLcOJ60g7YaEi7ghM5EFjp2CoHxhLbWNvSO1UQ +RwUVZ2J+GGOmRj8JDlQyXr8NYnon74Do29lLBlo3WiXQCBJ31G8JUJc9yB3D34xFMFbG02SrZvPA +Xpacw8Tvw3xrizp5f7NJzz3iiZ+gMEuFuZyUJHmPfWupRWgPK9Dx2hzLabjKSWJtyNBjYt1gD1iq +j6G8BaVmos8bdrKEZLFMOVLAMLrwjEsCsLa3AgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYD +VR0OBBYEFEe4zf/lb+74suwvTg75JbCOPGvDMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsF +AAOCAgEAACAjQTUEkMJAYmDv4jVM1z+s4jSQuKFvdvoWFqRINyzpkMLyPPgKn9iB5btb2iUspKdV +cSQy9sgL8rxq+JOssgfCX5/bzMiKqr5qb+FJEMwx14C7u8jYog5kV+qi9cKpMRXSIGrs/CIBKM+G +uIAeqcwRpTzyFrNHnfzSgCHEy9BHcEGhyoMZCCxt8l13nIoUE9Q2HJLw5QY33KbmkJs4j1xrG0aG +Q0JfPgEHU1RdZX33inOhmlRaHylDFCfChQ+1iHsaO5S3HWCntZznKWlXWpuTekMwGwPXYshApqr8 +ZORK15FTAaggiG6cX0S5y2CBNOxv033aSF/rtJC8LakcC6wc1aJoIIAE1vyxjy+7SjENSoYc6+I2 +KSb12tjE8nVhz36udmNKekBlk4f4HoCMhuWG1o8O/FMsYOgWYRqiPkN7zTlgVGr18okmAWiDSKIz +6MkEkbIRNBE+6tBDGR8Dk5AM/1E9V/RBbuHLoL7ryWPNbczk+DaqaJ3tvV2XcEQNtg413OEMXbug +UZTLfhbrES+jkkXITHHZvMmZUldGL1DPvTVp9D0VzgalLA8+9oG6lLvDu79leNKGef9JOxqDDPDe +eOzI8k1MGt6CKfjBWtrt7uYnXuhF0J0cUahoq0Tj0Itq4/g7u9xN12TyUb7mqqta6THuBrxzvxNi +Cp/HuZc= +-----END CERTIFICATE----- + +T-TeleSec GlobalRoot Class 3 +============================ +-----BEGIN CERTIFICATE----- +MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoM +IlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBU +cnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDMwHhcNMDgx +MDAxMTAyOTU2WhcNMzMxMDAxMjM1OTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lz +dGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBD +ZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDMwggEiMA0GCSqGSIb3 +DQEBAQUAA4IBDwAwggEKAoIBAQC9dZPwYiJvJK7genasfb3ZJNW4t/zN8ELg63iIVl6bmlQdTQyK +9tPPcPRStdiTBONGhnFBSivwKixVA9ZIw+A5OO3yXDw/RLyTPWGrTs0NvvAgJ1gORH8EGoel15YU +NpDQSXuhdfsaa3Ox+M6pCSzyU9XDFES4hqX2iys52qMzVNn6chr3IhUciJFrf2blw2qAsCTz34ZF +iP0Zf3WHHx+xGwpzJFu5ZeAsVMhg02YXP+HMVDNzkQI6pn97djmiH5a2OK61yJN0HZ65tOVgnS9W +0eDrXltMEnAMbEQgqxHY9Bn20pxSN+f6tsIxO0rUFJmtxxr1XV/6B7h8DR/Wgx6zAgMBAAGjQjBA +MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS1A/d2O2GCahKqGFPr +AyGUv/7OyjANBgkqhkiG9w0BAQsFAAOCAQEAVj3vlNW92nOyWL6ukK2YJ5f+AbGwUgC4TeQbIXQb +fsDuXmkqJa9c1h3a0nnJ85cp4IaH3gRZD/FZ1GSFS5mvJQQeyUapl96Cshtwn5z2r3Ex3XsFpSzT +ucpH9sry9uetuUg/vBa3wW306gmv7PO15wWeph6KU1HWk4HMdJP2udqmJQV0eVp+QD6CSyYRMG7h +P0HHRwA11fXT91Q+gT3aSWqas+8QPebrb9HIIkfLzM8BMZLZGOMivgkeGj5asuRrDFR6fUNOuIml +e9eiPZaGzPImNC1qkp2aGtAw4l1OBLBfiyB+d8E9lYLRRpo7PHi4b6HQDWSieB4pTpPDpFQUWw== +-----END CERTIFICATE----- + +EE Certification Centre Root CA +=============================== +-----BEGIN CERTIFICATE----- +MIIEAzCCAuugAwIBAgIQVID5oHPtPwBMyonY43HmSjANBgkqhkiG9w0BAQUFADB1MQswCQYDVQQG +EwJFRTEiMCAGA1UECgwZQVMgU2VydGlmaXRzZWVyaW1pc2tlc2t1czEoMCYGA1UEAwwfRUUgQ2Vy +dGlmaWNhdGlvbiBDZW50cmUgUm9vdCBDQTEYMBYGCSqGSIb3DQEJARYJcGtpQHNrLmVlMCIYDzIw +MTAxMDMwMTAxMDMwWhgPMjAzMDEyMTcyMzU5NTlaMHUxCzAJBgNVBAYTAkVFMSIwIAYDVQQKDBlB +UyBTZXJ0aWZpdHNlZXJpbWlza2Vza3VzMSgwJgYDVQQDDB9FRSBDZXJ0aWZpY2F0aW9uIENlbnRy +ZSBSb290IENBMRgwFgYJKoZIhvcNAQkBFglwa2lAc2suZWUwggEiMA0GCSqGSIb3DQEBAQUAA4IB +DwAwggEKAoIBAQDIIMDs4MVLqwd4lfNE7vsLDP90jmG7sWLqI9iroWUyeuuOF0+W2Ap7kaJjbMeM +TC55v6kF/GlclY1i+blw7cNRfdCT5mzrMEvhvH2/UpvObntl8jixwKIy72KyaOBhU8E2lf/slLo2 +rpwcpzIP5Xy0xm90/XsY6KxX7QYgSzIwWFv9zajmofxwvI6Sc9uXp3whrj3B9UiHbCe9nyV0gVWw +93X2PaRka9ZP585ArQ/dMtO8ihJTmMmJ+xAdTX7Nfh9WDSFwhfYggx/2uh8Ej+p3iDXE/+pOoYtN +P2MbRMNE1CV2yreN1x5KZmTNXMWcg+HCCIia7E6j8T4cLNlsHaFLAgMBAAGjgYowgYcwDwYDVR0T +AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFBLyWj7qVhy/zQas8fElyalL1BSZ +MEUGA1UdJQQ+MDwGCCsGAQUFBwMCBggrBgEFBQcDAQYIKwYBBQUHAwMGCCsGAQUFBwMEBggrBgEF +BQcDCAYIKwYBBQUHAwkwDQYJKoZIhvcNAQEFBQADggEBAHv25MANqhlHt01Xo/6tu7Fq1Q+e2+Rj +xY6hUFaTlrg4wCQiZrxTFGGVv9DHKpY5P30osxBAIWrEr7BSdxjhlthWXePdNl4dp1BUoMUq5KqM +lIpPnTX/dqQGE5Gion0ARD9V04I8GtVbvFZMIi5GQ4okQC3zErg7cBqklrkar4dBGmoYDQZPxz5u +uSlNDUmJEYcyW+ZLBMjkXOZ0c5RdFpgTlf7727FE5TpwrDdr5rMzcijJs1eg9gIWiAYLtqZLICjU +3j2LrTcFU3T+bsy8QxdxXvnFzBqpYe73dgzzcvRyrc9yAjYHR8/vGVCJYMzpJJUPwssd8m92kMfM +dcGWxZ0= +-----END CERTIFICATE----- + +TURKTRUST Certificate Services Provider Root 2007 +================================================= +-----BEGIN CERTIFICATE----- +MIIEPTCCAyWgAwIBAgIBATANBgkqhkiG9w0BAQUFADCBvzE/MD0GA1UEAww2VMOcUktUUlVTVCBF +bGVrdHJvbmlrIFNlcnRpZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxMQswCQYDVQQGEwJUUjEP +MA0GA1UEBwwGQW5rYXJhMV4wXAYDVQQKDFVUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUg +QmlsacWfaW0gR8O8dmVubGnEn2kgSGl6bWV0bGVyaSBBLsWeLiAoYykgQXJhbMSxayAyMDA3MB4X +DTA3MTIyNTE4MzcxOVoXDTE3MTIyMjE4MzcxOVowgb8xPzA9BgNVBAMMNlTDnFJLVFJVU1QgRWxl +a3Ryb25payBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsTELMAkGA1UEBhMCVFIxDzAN +BgNVBAcMBkFua2FyYTFeMFwGA1UECgxVVMOcUktUUlVTVCBCaWxnaSDEsGxldGnFn2ltIHZlIEJp +bGnFn2ltIEfDvHZlbmxpxJ9pIEhpem1ldGxlcmkgQS7Fni4gKGMpIEFyYWzEsWsgMjAwNzCCASIw +DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKu3PgqMyKVYFeaK7yc9SrToJdPNM8Ig3BnuiD9N +YvDdE3ePYakqtdTyuTFYKTsvP2qcb3N2Je40IIDu6rfwxArNK4aUyeNgsURSsloptJGXg9i3phQv +KUmi8wUG+7RP2qFsmmaf8EMJyupyj+sA1zU511YXRxcw9L6/P8JorzZAwan0qafoEGsIiveGHtya +KhUG9qPw9ODHFNRRf8+0222vR5YXm3dx2KdxnSQM9pQ/hTEST7ruToK4uT6PIzdezKKqdfcYbwnT +rqdUKDT74eA7YH2gvnmJhsifLfkKS8RQouf9eRbHegsYz85M733WB2+Y8a+xwXrXgTW4qhe04MsC +AwEAAaNCMEAwHQYDVR0OBBYEFCnFkKslrxHkYb+j/4hhkeYO/pyBMA4GA1UdDwEB/wQEAwIBBjAP +BgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBBQUAA4IBAQAQDdr4Ouwo0RSVgrESLFF6QSU2TJ/s +Px+EnWVUXKgWAkD6bho3hO9ynYYKVZ1WKKxmLNA6VpM0ByWtCLCPyA8JWcqdmBzlVPi5RX9ql2+I +aE1KBiY3iAIOtsbWcpnOa3faYjGkVh+uX4132l32iPwa2Z61gfAyuOOI0JzzaqC5mxRZNTZPz/OO +Xl0XrRWV2N2y1RVuAE6zS89mlOTgzbUF2mNXi+WzqtvALhyQRNsaXRik7r4EW5nVcV9VZWRi1aKb +BFmGyGJ353yCRWo9F7/snXUMrqNvWtMvmDb08PUZqxFdyKbjKlhqQgnDvZImZjINXQhVdP+MmNAK +poRq0Tl9 +-----END CERTIFICATE----- + +D-TRUST Root Class 3 CA 2 2009 +============================== +-----BEGIN CERTIFICATE----- +MIIEMzCCAxugAwIBAgIDCYPzMA0GCSqGSIb3DQEBCwUAME0xCzAJBgNVBAYTAkRFMRUwEwYDVQQK +DAxELVRydXN0IEdtYkgxJzAlBgNVBAMMHkQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgMjAwOTAe +Fw0wOTExMDUwODM1NThaFw0yOTExMDUwODM1NThaME0xCzAJBgNVBAYTAkRFMRUwEwYDVQQKDAxE +LVRydXN0IEdtYkgxJzAlBgNVBAMMHkQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgMjAwOTCCASIw +DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANOySs96R+91myP6Oi/WUEWJNTrGa9v+2wBoqOAD +ER03UAifTUpolDWzU9GUY6cgVq/eUXjsKj3zSEhQPgrfRlWLJ23DEE0NkVJD2IfgXU42tSHKXzlA +BF9bfsyjxiupQB7ZNoTWSPOSHjRGICTBpFGOShrvUD9pXRl/RcPHAY9RySPocq60vFYJfxLLHLGv +KZAKyVXMD9O0Gu1HNVpK7ZxzBCHQqr0ME7UAyiZsxGsMlFqVlNpQmvH/pStmMaTJOKDfHR+4CS7z +p+hnUquVH+BGPtikw8paxTGA6Eian5Rp/hnd2HN8gcqW3o7tszIFZYQ05ub9VxC1X3a/L7AQDcUC +AwEAAaOCARowggEWMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFP3aFMSfMN4hvR5COfyrYyNJ +4PGEMA4GA1UdDwEB/wQEAwIBBjCB0wYDVR0fBIHLMIHIMIGAoH6gfIZ6bGRhcDovL2RpcmVjdG9y +eS5kLXRydXN0Lm5ldC9DTj1ELVRSVVNUJTIwUm9vdCUyMENsYXNzJTIwMyUyMENBJTIwMiUyMDIw +MDksTz1ELVRydXN0JTIwR21iSCxDPURFP2NlcnRpZmljYXRlcmV2b2NhdGlvbmxpc3QwQ6BBoD+G +PWh0dHA6Ly93d3cuZC10cnVzdC5uZXQvY3JsL2QtdHJ1c3Rfcm9vdF9jbGFzc18zX2NhXzJfMjAw +OS5jcmwwDQYJKoZIhvcNAQELBQADggEBAH+X2zDI36ScfSF6gHDOFBJpiBSVYEQBrLLpME+bUMJm +2H6NMLVwMeniacfzcNsgFYbQDfC+rAF1hM5+n02/t2A7nPPKHeJeaNijnZflQGDSNiH+0LS4F9p0 +o3/U37CYAqxva2ssJSRyoWXuJVrl5jLn8t+rSfrzkGkj2wTZ51xY/GXUl77M/C4KzCUqNQT4YJEV +dT1B/yMfGchs64JTBKbkTCJNjYy6zltz7GRUUG3RnFX7acM2w4y8PIWmawomDeCTmGCufsYkl4ph +X5GOZpIJhzbNi5stPvZR1FDUWSi9g/LMKHtThm3YJohw1+qRzT65ysCQblrGXnRl11z+o+I= +-----END CERTIFICATE----- + +D-TRUST Root Class 3 CA 2 EV 2009 +================================= +-----BEGIN CERTIFICATE----- +MIIEQzCCAyugAwIBAgIDCYP0MA0GCSqGSIb3DQEBCwUAMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQK +DAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAw +OTAeFw0wOTExMDUwODUwNDZaFw0yOTExMDUwODUwNDZaMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQK +DAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAw +OTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJnxhDRwui+3MKCOvXwEz75ivJn9gpfS +egpnljgJ9hBOlSJzmY3aFS3nBfwZcyK3jpgAvDw9rKFs+9Z5JUut8Mxk2og+KbgPCdM03TP1YtHh +zRnp7hhPTFiu4h7WDFsVWtg6uMQYZB7jM7K1iXdODL/ZlGsTl28So/6ZqQTMFexgaDbtCHu39b+T +7WYxg4zGcTSHThfqr4uRjRxWQa4iN1438h3Z0S0NL2lRp75mpoo6Kr3HGrHhFPC+Oh25z1uxav60 +sUYgovseO3Dvk5h9jHOW8sXvhXCtKSb8HgQ+HKDYD8tSg2J87otTlZCpV6LqYQXY+U3EJ/pure35 +11H3a6UCAwEAAaOCASQwggEgMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNOUikxiEyoZLsyv +cop9NteaHNxnMA4GA1UdDwEB/wQEAwIBBjCB3QYDVR0fBIHVMIHSMIGHoIGEoIGBhn9sZGFwOi8v +ZGlyZWN0b3J5LmQtdHJ1c3QubmV0L0NOPUQtVFJVU1QlMjBSb290JTIwQ2xhc3MlMjAzJTIwQ0El +MjAyJTIwRVYlMjAyMDA5LE89RC1UcnVzdCUyMEdtYkgsQz1ERT9jZXJ0aWZpY2F0ZXJldm9jYXRp +b25saXN0MEagRKBChkBodHRwOi8vd3d3LmQtdHJ1c3QubmV0L2NybC9kLXRydXN0X3Jvb3RfY2xh +c3NfM19jYV8yX2V2XzIwMDkuY3JsMA0GCSqGSIb3DQEBCwUAA4IBAQA07XtaPKSUiO8aEXUHL7P+ +PPoeUSbrh/Yp3uDx1MYkCenBz1UbtDDZzhr+BlGmFaQt77JLvyAoJUnRpjZ3NOhk31KxEcdzes05 +nsKtjHEh8lprr988TlWvsoRlFIm5d8sqMb7Po23Pb0iUMkZv53GMoKaEGTcH8gNFCSuGdXzfX2lX +ANtu2KZyIktQ1HWYVt+3GP9DQ1CuekR78HlR10M9p9OB0/DJT7naxpeG0ILD5EJt/rDiZE4OJudA +NCa1CInXCGNjOCd1HjPqbqjdn5lPdE2BiYBL3ZqXKVwvvoFBuYz/6n1gBp7N1z3TLqMVvKjmJuVv +w9y4AyHqnxbxLFS1 +-----END CERTIFICATE----- + +PSCProcert +========== +-----BEGIN CERTIFICATE----- +MIIJhjCCB26gAwIBAgIBCzANBgkqhkiG9w0BAQsFADCCAR4xPjA8BgNVBAMTNUF1dG9yaWRhZCBk +ZSBDZXJ0aWZpY2FjaW9uIFJhaXogZGVsIEVzdGFkbyBWZW5lem9sYW5vMQswCQYDVQQGEwJWRTEQ +MA4GA1UEBxMHQ2FyYWNhczEZMBcGA1UECBMQRGlzdHJpdG8gQ2FwaXRhbDE2MDQGA1UEChMtU2lz +dGVtYSBOYWNpb25hbCBkZSBDZXJ0aWZpY2FjaW9uIEVsZWN0cm9uaWNhMUMwQQYDVQQLEzpTdXBl +cmludGVuZGVuY2lhIGRlIFNlcnZpY2lvcyBkZSBDZXJ0aWZpY2FjaW9uIEVsZWN0cm9uaWNhMSUw +IwYJKoZIhvcNAQkBFhZhY3JhaXpAc3VzY2VydGUuZ29iLnZlMB4XDTEwMTIyODE2NTEwMFoXDTIw +MTIyNTIzNTk1OVowgdExJjAkBgkqhkiG9w0BCQEWF2NvbnRhY3RvQHByb2NlcnQubmV0LnZlMQ8w +DQYDVQQHEwZDaGFjYW8xEDAOBgNVBAgTB01pcmFuZGExKjAoBgNVBAsTIVByb3ZlZWRvciBkZSBD +ZXJ0aWZpY2Fkb3MgUFJPQ0VSVDE2MDQGA1UEChMtU2lzdGVtYSBOYWNpb25hbCBkZSBDZXJ0aWZp +Y2FjaW9uIEVsZWN0cm9uaWNhMQswCQYDVQQGEwJWRTETMBEGA1UEAxMKUFNDUHJvY2VydDCCAiIw +DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANW39KOUM6FGqVVhSQ2oh3NekS1wwQYalNo97BVC +wfWMrmoX8Yqt/ICV6oNEolt6Vc5Pp6XVurgfoCfAUFM+jbnADrgV3NZs+J74BCXfgI8Qhd19L3uA +3VcAZCP4bsm+lU/hdezgfl6VzbHvvnpC2Mks0+saGiKLt38GieU89RLAu9MLmV+QfI4tL3czkkoh +RqipCKzx9hEC2ZUWno0vluYC3XXCFCpa1sl9JcLB/KpnheLsvtF8PPqv1W7/U0HU9TI4seJfxPmO +EO8GqQKJ/+MMbpfg353bIdD0PghpbNjU5Db4g7ayNo+c7zo3Fn2/omnXO1ty0K+qP1xmk6wKImG2 +0qCZyFSTXai20b1dCl53lKItwIKOvMoDKjSuc/HUtQy9vmebVOvh+qBa7Dh+PsHMosdEMXXqP+UH +0quhJZb25uSgXTcYOWEAM11G1ADEtMo88aKjPvM6/2kwLkDd9p+cJsmWN63nOaK/6mnbVSKVUyqU +td+tFjiBdWbjxywbk5yqjKPK2Ww8F22c3HxT4CAnQzb5EuE8XL1mv6JpIzi4mWCZDlZTOpx+FIyw +Bm/xhnaQr/2v/pDGj59/i5IjnOcVdo/Vi5QTcmn7K2FjiO/mpF7moxdqWEfLcU8UC17IAggmosvp +r2uKGcfLFFb14dq12fy/czja+eevbqQ34gcnAgMBAAGjggMXMIIDEzASBgNVHRMBAf8ECDAGAQH/ +AgEBMDcGA1UdEgQwMC6CD3N1c2NlcnRlLmdvYi52ZaAbBgVghl4CAqASDBBSSUYtRy0yMDAwNDAz +Ni0wMB0GA1UdDgQWBBRBDxk4qpl/Qguk1yeYVKIXTC1RVDCCAVAGA1UdIwSCAUcwggFDgBStuyId +xuDSAaj9dlBSk+2YwU2u06GCASakggEiMIIBHjE+MDwGA1UEAxM1QXV0b3JpZGFkIGRlIENlcnRp +ZmljYWNpb24gUmFpeiBkZWwgRXN0YWRvIFZlbmV6b2xhbm8xCzAJBgNVBAYTAlZFMRAwDgYDVQQH +EwdDYXJhY2FzMRkwFwYDVQQIExBEaXN0cml0byBDYXBpdGFsMTYwNAYDVQQKEy1TaXN0ZW1hIE5h +Y2lvbmFsIGRlIENlcnRpZmljYWNpb24gRWxlY3Ryb25pY2ExQzBBBgNVBAsTOlN1cGVyaW50ZW5k +ZW5jaWEgZGUgU2VydmljaW9zIGRlIENlcnRpZmljYWNpb24gRWxlY3Ryb25pY2ExJTAjBgkqhkiG +9w0BCQEWFmFjcmFpekBzdXNjZXJ0ZS5nb2IudmWCAQowDgYDVR0PAQH/BAQDAgEGME0GA1UdEQRG +MESCDnByb2NlcnQubmV0LnZloBUGBWCGXgIBoAwMClBTQy0wMDAwMDKgGwYFYIZeAgKgEgwQUklG +LUotMzE2MzUzNzMtNzB2BgNVHR8EbzBtMEagRKBChkBodHRwOi8vd3d3LnN1c2NlcnRlLmdvYi52 +ZS9sY3IvQ0VSVElGSUNBRE8tUkFJWi1TSEEzODRDUkxERVIuY3JsMCOgIaAfhh1sZGFwOi8vYWNy +YWl6LnN1c2NlcnRlLmdvYi52ZTA3BggrBgEFBQcBAQQrMCkwJwYIKwYBBQUHMAGGG2h0dHA6Ly9v +Y3NwLnN1c2NlcnRlLmdvYi52ZTBBBgNVHSAEOjA4MDYGBmCGXgMBAjAsMCoGCCsGAQUFBwIBFh5o +dHRwOi8vd3d3LnN1c2NlcnRlLmdvYi52ZS9kcGMwDQYJKoZIhvcNAQELBQADggIBACtZ6yKZu4Sq +T96QxtGGcSOeSwORR3C7wJJg7ODU523G0+1ng3dS1fLld6c2suNUvtm7CpsR72H0xpkzmfWvADmN +g7+mvTV+LFwxNG9s2/NkAZiqlCxB3RWGymspThbASfzXg0gTB1GEMVKIu4YXx2sviiCtxQuPcD4q +uxtxj7mkoP3YldmvWb8lK5jpY5MvYB7Eqvh39YtsL+1+LrVPQA3uvFd359m21D+VJzog1eWuq2w1 +n8GhHVnchIHuTQfiSLaeS5UtQbHh6N5+LwUeaO6/u5BlOsju6rEYNxxik6SgMexxbJHmpHmJWhSn +FFAFTKQAVzAswbVhltw+HoSvOULP5dAssSS830DD7X9jSr3hTxJkhpXzsOfIt+FTvZLm8wyWuevo +5pLtp4EJFAv8lXrPj9Y0TzYS3F7RNHXGRoAvlQSMx4bEqCaJqD8Zm4G7UaRKhqsLEQ+xrmNTbSjq +3TNWOByyrYDT13K9mmyZY+gAu0F2BbdbmRiKw7gSXFbPVgx96OLP7bx0R/vu0xdOIk9W/1DzLuY5 +poLWccret9W6aAjtmcz9opLLabid+Qqkpj5PkygqYWwHJgD/ll9ohri4zspV4KuxPX+Y1zMOWj3Y +eMLEYC/HYvBhkdI4sPaeVdtAgAUSM84dkpvRabP/v/GSCmE1P93+hvS84Bpxs2Km +-----END CERTIFICATE----- + +CA Disig Root R1 +================ +-----BEGIN CERTIFICATE----- +MIIFaTCCA1GgAwIBAgIJAMMDmu5QkG4oMA0GCSqGSIb3DQEBBQUAMFIxCzAJBgNVBAYTAlNLMRMw +EQYDVQQHEwpCcmF0aXNsYXZhMRMwEQYDVQQKEwpEaXNpZyBhLnMuMRkwFwYDVQQDExBDQSBEaXNp +ZyBSb290IFIxMB4XDTEyMDcxOTA5MDY1NloXDTQyMDcxOTA5MDY1NlowUjELMAkGA1UEBhMCU0sx +EzARBgNVBAcTCkJyYXRpc2xhdmExEzARBgNVBAoTCkRpc2lnIGEucy4xGTAXBgNVBAMTEENBIERp +c2lnIFJvb3QgUjEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCqw3j33Jijp1pedxiy +3QRkD2P9m5YJgNXoqqXinCaUOuiZc4yd39ffg/N4T0Dhf9Kn0uXKE5Pn7cZ3Xza1lK/oOI7bm+V8 +u8yN63Vz4STN5qctGS7Y1oprFOsIYgrY3LMATcMjfF9DCCMyEtztDK3AfQ+lekLZWnDZv6fXARz2 +m6uOt0qGeKAeVjGu74IKgEH3G8muqzIm1Cxr7X1r5OJeIgpFy4QxTaz+29FHuvlglzmxZcfe+5nk +CiKxLU3lSCZpq+Kq8/v8kiky6bM+TR8noc2OuRf7JT7JbvN32g0S9l3HuzYQ1VTW8+DiR0jm3hTa +YVKvJrT1cU/J19IG32PK/yHoWQbgCNWEFVP3Q+V8xaCJmGtzxmjOZd69fwX3se72V6FglcXM6pM6 +vpmumwKjrckWtc7dXpl4fho5frLABaTAgqWjR56M6ly2vGfb5ipN0gTco65F97yLnByn1tUD3AjL +LhbKXEAz6GfDLuemROoRRRw1ZS0eRWEkG4IupZ0zXWX4Qfkuy5Q/H6MMMSRE7cderVC6xkGbrPAX +ZcD4XW9boAo0PO7X6oifmPmvTiT6l7Jkdtqr9O3jw2Dv1fkCyC2fg69naQanMVXVz0tv/wQFx1is +XxYb5dKj6zHbHzMVTdDypVP1y+E9Tmgt2BLdqvLmTZtJ5cUoobqwWsagtQIDAQABo0IwQDAPBgNV +HRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUiQq0OJMa5qvum5EY+fU8PjXQ +04IwDQYJKoZIhvcNAQEFBQADggIBADKL9p1Kyb4U5YysOMo6CdQbzoaz3evUuii+Eq5FLAR0rBNR +xVgYZk2C2tXck8An4b58n1KeElb21Zyp9HWc+jcSjxyT7Ff+Bw+r1RL3D65hXlaASfX8MPWbTx9B +LxyE04nH4toCdu0Jz2zBuByDHBb6lM19oMgY0sidbvW9adRtPTXoHqJPYNcHKfyyo6SdbhWSVhlM +CrDpfNIZTUJG7L399ldb3Zh+pE3McgODWF3vkzpBemOqfDqo9ayk0d2iLbYq/J8BjuIQscTK5Gfb +VSUZP/3oNn6z4eGBrxEWi1CXYBmCAMBrTXO40RMHPuq2MU/wQppt4hF05ZSsjYSVPCGvxdpHyN85 +YmLLW1AL14FABZyb7bq2ix4Eb5YgOe2kfSnbSM6C3NQCjR0EMVrHS/BsYVLXtFHCgWzN4funodKS +ds+xDzdYpPJScWc/DIh4gInByLUfkmO+p3qKViwaqKactV2zY9ATIKHrkWzQjX2v3wvkF7mGnjix +lAxYjOBVqjtjbZqJYLhkKpLGN/R+Q0O3c+gB53+XD9fyexn9GtePyfqFa3qdnom2piiZk4hA9z7N +UaPK6u95RyG1/jLix8NRb76AdPCkwzryT+lf3xkK8jsTQ6wxpLPn6/wY1gGp8yqPNg7rtLG8t0zJ +a7+h89n07eLw4+1knj0vllJPgFOL +-----END CERTIFICATE----- + +CA Disig Root R2 +================ +-----BEGIN CERTIFICATE----- +MIIFaTCCA1GgAwIBAgIJAJK4iNuwisFjMA0GCSqGSIb3DQEBCwUAMFIxCzAJBgNVBAYTAlNLMRMw +EQYDVQQHEwpCcmF0aXNsYXZhMRMwEQYDVQQKEwpEaXNpZyBhLnMuMRkwFwYDVQQDExBDQSBEaXNp +ZyBSb290IFIyMB4XDTEyMDcxOTA5MTUzMFoXDTQyMDcxOTA5MTUzMFowUjELMAkGA1UEBhMCU0sx +EzARBgNVBAcTCkJyYXRpc2xhdmExEzARBgNVBAoTCkRpc2lnIGEucy4xGTAXBgNVBAMTEENBIERp +c2lnIFJvb3QgUjIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCio8QACdaFXS1tFPbC +w3OeNcJxVX6B+6tGUODBfEl45qt5WDza/3wcn9iXAng+a0EE6UG9vgMsRfYvZNSrXaNHPWSb6Wia +xswbP7q+sos0Ai6YVRn8jG+qX9pMzk0DIaPY0jSTVpbLTAwAFjxfGs3Ix2ymrdMxp7zo5eFm1tL7 +A7RBZckQrg4FY8aAamkw/dLukO8NJ9+flXP04SXabBbeQTg06ov80egEFGEtQX6sx3dOy1FU+16S +GBsEWmjGycT6txOgmLcRK7fWV8x8nhfRyyX+hk4kLlYMeE2eARKmK6cBZW58Yh2EhN/qwGu1pSqV +g8NTEQxzHQuyRpDRQjrOQG6Vrf/GlK1ul4SOfW+eioANSW1z4nuSHsPzwfPrLgVv2RvPN3YEyLRa +5Beny912H9AZdugsBbPWnDTYltxhh5EF5EQIM8HauQhl1K6yNg3ruji6DOWbnuuNZt2Zz9aJQfYE +koopKW1rOhzndX0CcQ7zwOe9yxndnWCywmZgtrEE7snmhrmaZkCo5xHtgUUDi/ZnWejBBhG93c+A +Ak9lQHhcR1DIm+YfgXvkRKhbhZri3lrVx/k6RGZL5DJUfORsnLMOPReisjQS1n6yqEm70XooQL6i +Fh/f5DcfEXP7kAplQ6INfPgGAVUzfbANuPT1rqVCV3w2EYx7XsQDnYx5nQIDAQABo0IwQDAPBgNV +HRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUtZn4r7CU9eMg1gqtzk5WpC5u +Qu0wDQYJKoZIhvcNAQELBQADggIBACYGXnDnZTPIgm7ZnBc6G3pmsgH2eDtpXi/q/075KMOYKmFM +tCQSin1tERT3nLXK5ryeJ45MGcipvXrA1zYObYVybqjGom32+nNjf7xueQgcnYqfGopTpti72TVV +sRHFqQOzVju5hJMiXn7B9hJSi+osZ7z+Nkz1uM/Rs0mSO9MpDpkblvdhuDvEK7Z4bLQjb/D907Je +dR+Zlais9trhxTF7+9FGs9K8Z7RiVLoJ92Owk6Ka+elSLotgEqv89WBW7xBci8QaQtyDW2QOy7W8 +1k/BfDxujRNt+3vrMNDcTa/F1balTFtxyegxvug4BkihGuLq0t4SOVga/4AOgnXmt8kHbA7v/zjx +mHHEt38OFdAlab0inSvtBfZGR6ztwPDUO+Ls7pZbkBNOHlY667DvlruWIxG68kOGdGSVyCh13x01 +utI3gzhTODY7z2zp+WsO0PsE6E9312UBeIYMej4hYvF/Y3EMyZ9E26gnonW+boE+18DrG5gPcFw0 +sorMwIUY6256s/daoQe/qUKS82Ail+QUoQebTnbAjn39pCXHR+3/H3OszMOl6W8KjptlwlCFtaOg +UxLMVYdh84GuEEZhvUQhuMI9dM9+JDX6HAcOmz0iyu8xL4ysEr3vQCj8KWefshNPZiTEUxnpHikV +7+ZtsH8tZ/3zbBt1RqPlShfppNcL +-----END CERTIFICATE----- + +ACCVRAIZ1 +========= +-----BEGIN CERTIFICATE----- +MIIH0zCCBbugAwIBAgIIXsO3pkN/pOAwDQYJKoZIhvcNAQEFBQAwQjESMBAGA1UEAwwJQUNDVlJB +SVoxMRAwDgYDVQQLDAdQS0lBQ0NWMQ0wCwYDVQQKDARBQ0NWMQswCQYDVQQGEwJFUzAeFw0xMTA1 +MDUwOTM3MzdaFw0zMDEyMzEwOTM3MzdaMEIxEjAQBgNVBAMMCUFDQ1ZSQUlaMTEQMA4GA1UECwwH +UEtJQUNDVjENMAsGA1UECgwEQUNDVjELMAkGA1UEBhMCRVMwggIiMA0GCSqGSIb3DQEBAQUAA4IC +DwAwggIKAoICAQCbqau/YUqXry+XZpp0X9DZlv3P4uRm7x8fRzPCRKPfmt4ftVTdFXxpNRFvu8gM +jmoYHtiP2Ra8EEg2XPBjs5BaXCQ316PWywlxufEBcoSwfdtNgM3802/J+Nq2DoLSRYWoG2ioPej0 +RGy9ocLLA76MPhMAhN9KSMDjIgro6TenGEyxCQ0jVn8ETdkXhBilyNpAlHPrzg5XPAOBOp0KoVdD +aaxXbXmQeOW1tDvYvEyNKKGno6e6Ak4l0Squ7a4DIrhrIA8wKFSVf+DuzgpmndFALW4ir50awQUZ +0m/A8p/4e7MCQvtQqR0tkw8jq8bBD5L/0KIV9VMJcRz/RROE5iZe+OCIHAr8Fraocwa48GOEAqDG +WuzndN9wrqODJerWx5eHk6fGioozl2A3ED6XPm4pFdahD9GILBKfb6qkxkLrQaLjlUPTAYVtjrs7 +8yM2x/474KElB0iryYl0/wiPgL/AlmXz7uxLaL2diMMxs0Dx6M/2OLuc5NF/1OVYm3z61PMOm3WR +5LpSLhl+0fXNWhn8ugb2+1KoS5kE3fj5tItQo05iifCHJPqDQsGH+tUtKSpacXpkatcnYGMN285J +9Y0fkIkyF/hzQ7jSWpOGYdbhdQrqeWZ2iE9x6wQl1gpaepPluUsXQA+xtrn13k/c4LOsOxFwYIRK +Q26ZIMApcQrAZQIDAQABo4ICyzCCAscwfQYIKwYBBQUHAQEEcTBvMEwGCCsGAQUFBzAChkBodHRw +Oi8vd3d3LmFjY3YuZXMvZmlsZWFkbWluL0FyY2hpdm9zL2NlcnRpZmljYWRvcy9yYWl6YWNjdjEu +Y3J0MB8GCCsGAQUFBzABhhNodHRwOi8vb2NzcC5hY2N2LmVzMB0GA1UdDgQWBBTSh7Tj3zcnk1X2 +VuqB5TbMjB4/vTAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFNKHtOPfNyeTVfZW6oHlNsyM +Hj+9MIIBcwYDVR0gBIIBajCCAWYwggFiBgRVHSAAMIIBWDCCASIGCCsGAQUFBwICMIIBFB6CARAA +QQB1AHQAbwByAGkAZABhAGQAIABkAGUAIABDAGUAcgB0AGkAZgBpAGMAYQBjAGkA8wBuACAAUgBh +AO0AegAgAGQAZQAgAGwAYQAgAEEAQwBDAFYAIAAoAEEAZwBlAG4AYwBpAGEAIABkAGUAIABUAGUA +YwBuAG8AbABvAGcA7QBhACAAeQAgAEMAZQByAHQAaQBmAGkAYwBhAGMAaQDzAG4AIABFAGwAZQBj +AHQAcgDzAG4AaQBjAGEALAAgAEMASQBGACAAUQA0ADYAMAAxADEANQA2AEUAKQAuACAAQwBQAFMA +IABlAG4AIABoAHQAdABwADoALwAvAHcAdwB3AC4AYQBjAGMAdgAuAGUAczAwBggrBgEFBQcCARYk +aHR0cDovL3d3dy5hY2N2LmVzL2xlZ2lzbGFjaW9uX2MuaHRtMFUGA1UdHwROMEwwSqBIoEaGRGh0 +dHA6Ly93d3cuYWNjdi5lcy9maWxlYWRtaW4vQXJjaGl2b3MvY2VydGlmaWNhZG9zL3JhaXphY2N2 +MV9kZXIuY3JsMA4GA1UdDwEB/wQEAwIBBjAXBgNVHREEEDAOgQxhY2N2QGFjY3YuZXMwDQYJKoZI +hvcNAQEFBQADggIBAJcxAp/n/UNnSEQU5CmH7UwoZtCPNdpNYbdKl02125DgBS4OxnnQ8pdpD70E +R9m+27Up2pvZrqmZ1dM8MJP1jaGo/AaNRPTKFpV8M9xii6g3+CfYCS0b78gUJyCpZET/LtZ1qmxN +YEAZSUNUY9rizLpm5U9EelvZaoErQNV/+QEnWCzI7UiRfD+mAM/EKXMRNt6GGT6d7hmKG9Ww7Y49 +nCrADdg9ZuM8Db3VlFzi4qc1GwQA9j9ajepDvV+JHanBsMyZ4k0ACtrJJ1vnE5Bc5PUzolVt3OAJ +TS+xJlsndQAJxGJ3KQhfnlmstn6tn1QwIgPBHnFk/vk4CpYY3QIUrCPLBhwepH2NDd4nQeit2hW3 +sCPdK6jT2iWH7ehVRE2I9DZ+hJp4rPcOVkkO1jMl1oRQQmwgEh0q1b688nCBpHBgvgW1m54ERL5h +I6zppSSMEYCUWqKiuUnSwdzRp+0xESyeGabu4VXhwOrPDYTkF7eifKXeVSUG7szAh1xA2syVP1Xg +Nce4hL60Xc16gwFy7ofmXx2utYXGJt/mwZrpHgJHnyqobalbz+xFd3+YJ5oyXSrjhO7FmGYvliAd +3djDJ9ew+f7Zfc3Qn48LFFhRny+Lwzgt3uiP1o2HpPVWQxaZLPSkVrQ0uGE3ycJYgBugl6H8WY3p +EfbRD0tVNEYqi4Y7 +-----END CERTIFICATE----- + +TWCA Global Root CA +=================== +-----BEGIN CERTIFICATE----- +MIIFQTCCAymgAwIBAgICDL4wDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVFcxEjAQBgNVBAoT +CVRBSVdBTi1DQTEQMA4GA1UECxMHUm9vdCBDQTEcMBoGA1UEAxMTVFdDQSBHbG9iYWwgUm9vdCBD +QTAeFw0xMjA2MjcwNjI4MzNaFw0zMDEyMzExNTU5NTlaMFExCzAJBgNVBAYTAlRXMRIwEAYDVQQK +EwlUQUlXQU4tQ0ExEDAOBgNVBAsTB1Jvb3QgQ0ExHDAaBgNVBAMTE1RXQ0EgR2xvYmFsIFJvb3Qg +Q0EwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCwBdvI64zEbooh745NnHEKH1Jw7W2C +nJfF10xORUnLQEK1EjRsGcJ0pDFfhQKX7EMzClPSnIyOt7h52yvVavKOZsTuKwEHktSz0ALfUPZV +r2YOy+BHYC8rMjk1Ujoog/h7FsYYuGLWRyWRzvAZEk2tY/XTP3VfKfChMBwqoJimFb3u/Rk28OKR +Q4/6ytYQJ0lM793B8YVwm8rqqFpD/G2Gb3PpN0Wp8DbHzIh1HrtsBv+baz4X7GGqcXzGHaL3SekV +tTzWoWH1EfcFbx39Eb7QMAfCKbAJTibc46KokWofwpFFiFzlmLhxpRUZyXx1EcxwdE8tmx2RRP1W +KKD+u4ZqyPpcC1jcxkt2yKsi2XMPpfRaAok/T54igu6idFMqPVMnaR1sjjIsZAAmY2E2TqNGtz99 +sy2sbZCilaLOz9qC5wc0GZbpuCGqKX6mOL6OKUohZnkfs8O1CWfe1tQHRvMq2uYiN2DLgbYPoA/p +yJV/v1WRBXrPPRXAb94JlAGD1zQbzECl8LibZ9WYkTunhHiVJqRaCPgrdLQABDzfuBSO6N+pjWxn +kjMdwLfS7JLIvgm/LCkFbwJrnu+8vyq8W8BQj0FwcYeyTbcEqYSjMq+u7msXi7Kx/mzhkIyIqJdI +zshNy/MGz19qCkKxHh53L46g5pIOBvwFItIm4TFRfTLcDwIDAQABoyMwITAOBgNVHQ8BAf8EBAMC +AQYwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAgEAXzSBdu+WHdXltdkCY4QWwa6g +cFGn90xHNcgL1yg9iXHZqjNB6hQbbCEAwGxCGX6faVsgQt+i0trEfJdLjbDorMjupWkEmQqSpqsn +LhpNgb+E1HAerUf+/UqdM+DyucRFCCEK2mlpc3INvjT+lIutwx4116KD7+U4x6WFH6vPNOw/KP4M +8VeGTslV9xzU2KV9Bnpv1d8Q34FOIWWxtuEXeZVFBs5fzNxGiWNoRI2T9GRwoD2dKAXDOXC4Ynsg +/eTb6QihuJ49CcdP+yz4k3ZB3lLg4VfSnQO8d57+nile98FRYB/e2guyLXW3Q0iT5/Z5xoRdgFlg +lPx4mI88k1HtQJAH32RjJMtOcQWh15QaiDLxInQirqWm2BJpTGCjAu4r7NRjkgtevi92a6O2JryP +A9gK8kxkRr05YuWW6zRjESjMlfGt7+/cgFhI6Uu46mWs6fyAtbXIRfmswZ/ZuepiiI7E8UuDEq3m +i4TWnsLrgxifarsbJGAzcMzs9zLzXNl5fe+epP7JI8Mk7hWSsT2RTyaGvWZzJBPqpK5jwa19hAM8 +EHiGG3njxPPyBJUgriOCxLM6AGK/5jYk4Ve6xx6QddVfP5VhK8E7zeWzaGHQRiapIVJpLesux+t3 +zqY6tQMzT3bR51xUAV3LePTJDL/PEo4XLSNolOer/qmyKwbQBM0= +-----END CERTIFICATE----- + +TeliaSonera Root CA v1 +====================== +-----BEGIN CERTIFICATE----- +MIIFODCCAyCgAwIBAgIRAJW+FqD3LkbxezmCcvqLzZYwDQYJKoZIhvcNAQEFBQAwNzEUMBIGA1UE +CgwLVGVsaWFTb25lcmExHzAdBgNVBAMMFlRlbGlhU29uZXJhIFJvb3QgQ0EgdjEwHhcNMDcxMDE4 +MTIwMDUwWhcNMzIxMDE4MTIwMDUwWjA3MRQwEgYDVQQKDAtUZWxpYVNvbmVyYTEfMB0GA1UEAwwW +VGVsaWFTb25lcmEgUm9vdCBDQSB2MTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMK+ +6yfwIaPzaSZVfp3FVRaRXP3vIb9TgHot0pGMYzHw7CTww6XScnwQbfQ3t+XmfHnqjLWCi65ItqwA +3GV17CpNX8GH9SBlK4GoRz6JI5UwFpB/6FcHSOcZrr9FZ7E3GwYq/t75rH2D+1665I+XZ75Ljo1k +B1c4VWk0Nj0TSO9P4tNmHqTPGrdeNjPUtAa9GAH9d4RQAEX1jF3oI7x+/jXh7VB7qTCNGdMJjmhn +Xb88lxhTuylixcpecsHHltTbLaC0H2kD7OriUPEMPPCs81Mt8Bz17Ww5OXOAFshSsCPN4D7c3TxH +oLs1iuKYaIu+5b9y7tL6pe0S7fyYGKkmdtwoSxAgHNN/Fnct7W+A90m7UwW7XWjH1Mh1Fj+JWov3 +F0fUTPHSiXk+TT2YqGHeOh7S+F4D4MHJHIzTjU3TlTazN19jY5szFPAtJmtTfImMMsJu7D0hADnJ +oWjiUIMusDor8zagrC/kb2HCUQk5PotTubtn2txTuXZZNp1D5SDgPTJghSJRt8czu90VL6R4pgd7 +gUY2BIbdeTXHlSw7sKMXNeVzH7RcWe/a6hBle3rQf5+ztCo3O3CLm1u5K7fsslESl1MpWtTwEhDc +TwK7EpIvYtQ/aUN8Ddb8WHUBiJ1YFkveupD/RwGJBmr2X7KQarMCpgKIv7NHfirZ1fpoeDVNAgMB +AAGjPzA9MA8GA1UdEwEB/wQFMAMBAf8wCwYDVR0PBAQDAgEGMB0GA1UdDgQWBBTwj1k4ALP1j5qW +DNXr+nuqF+gTEjANBgkqhkiG9w0BAQUFAAOCAgEAvuRcYk4k9AwI//DTDGjkk0kiP0Qnb7tt3oNm +zqjMDfz1mgbldxSR651Be5kqhOX//CHBXfDkH1e3damhXwIm/9fH907eT/j3HEbAek9ALCI18Bmx +0GtnLLCo4MBANzX2hFxc469CeP6nyQ1Q6g2EdvZR74NTxnr/DlZJLo961gzmJ1TjTQpgcmLNkQfW +pb/ImWvtxBnmq0wROMVvMeJuScg/doAmAyYp4Db29iBT4xdwNBedY2gea+zDTYa4EzAvXUYNR0PV +G6pZDrlcjQZIrXSHX8f8MVRBE+LHIQ6e4B4N4cB7Q4WQxYpYxmUKeFfyxiMPAdkgS94P+5KFdSpc +c41teyWRyu5FrgZLAMzTsVlQ2jqIOylDRl6XK1TOU2+NSueW+r9xDkKLfP0ooNBIytrEgUy7onOT +JsjrDNYmiLbAJM+7vVvrdX3pCI6GMyx5dwlppYn8s3CQh3aP0yK7Qs69cwsgJirQmz1wHiRszYd2 +qReWt88NkvuOGKmYSdGe/mBEciG5Ge3C9THxOUiIkCR1VBatzvT4aRRkOfujuLpwQMcnHL/EVlP6 +Y2XQ8xwOFvVrhlhNGNTkDY6lnVuR3HYkUD/GKvvZt5y11ubQ2egZixVxSK236thZiNSQvxaz2ems +WWFUyBy6ysHK4bkgTI86k4mloMy/0/Z1pHWWbVY= +-----END CERTIFICATE----- + +E-Tugra Certification Authority +=============================== +-----BEGIN CERTIFICATE----- +MIIGSzCCBDOgAwIBAgIIamg+nFGby1MwDQYJKoZIhvcNAQELBQAwgbIxCzAJBgNVBAYTAlRSMQ8w +DQYDVQQHDAZBbmthcmExQDA+BgNVBAoMN0UtVHXEn3JhIEVCRyBCaWxpxZ9pbSBUZWtub2xvamls +ZXJpIHZlIEhpem1ldGxlcmkgQS7Fni4xJjAkBgNVBAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBN +ZXJrZXppMSgwJgYDVQQDDB9FLVR1Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTEzMDMw +NTEyMDk0OFoXDTIzMDMwMzEyMDk0OFowgbIxCzAJBgNVBAYTAlRSMQ8wDQYDVQQHDAZBbmthcmEx +QDA+BgNVBAoMN0UtVHXEn3JhIEVCRyBCaWxpxZ9pbSBUZWtub2xvamlsZXJpIHZlIEhpem1ldGxl +cmkgQS7Fni4xJjAkBgNVBAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBNZXJrZXppMSgwJgYDVQQD +DB9FLVR1Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0BAQEFAAOCAg8A +MIICCgKCAgEA4vU/kwVRHoViVF56C/UYB4Oufq9899SKa6VjQzm5S/fDxmSJPZQuVIBSOTkHS0vd +hQd2h8y/L5VMzH2nPbxHD5hw+IyFHnSOkm0bQNGZDbt1bsipa5rAhDGvykPL6ys06I+XawGb1Q5K +CKpbknSFQ9OArqGIW66z6l7LFpp3RMih9lRozt6Plyu6W0ACDGQXwLWTzeHxE2bODHnv0ZEoq1+g +ElIwcxmOj+GMB6LDu0rw6h8VqO4lzKRG+Bsi77MOQ7osJLjFLFzUHPhdZL3Dk14opz8n8Y4e0ypQ +BaNV2cvnOVPAmJ6MVGKLJrD3fY185MaeZkJVgkfnsliNZvcHfC425lAcP9tDJMW/hkd5s3kc91r0 +E+xs+D/iWR+V7kI+ua2oMoVJl0b+SzGPWsutdEcf6ZG33ygEIqDUD13ieU/qbIWGvaimzuT6w+Gz +rt48Ue7LE3wBf4QOXVGUnhMMti6lTPk5cDZvlsouDERVxcr6XQKj39ZkjFqzAQqptQpHF//vkUAq +jqFGOjGY5RH8zLtJVor8udBhmm9lbObDyz51Sf6Pp+KJxWfXnUYTTjF2OySznhFlhqt/7x3U+Lzn +rFpct1pHXFXOVbQicVtbC/DP3KBhZOqp12gKY6fgDT+gr9Oq0n7vUaDmUStVkhUXU8u3Zg5mTPj5 +dUyQ5xJwx0UCAwEAAaNjMGEwHQYDVR0OBBYEFC7j27JJ0JxUeVz6Jyr+zE7S6E5UMA8GA1UdEwEB +/wQFMAMBAf8wHwYDVR0jBBgwFoAULuPbsknQnFR5XPonKv7MTtLoTlQwDgYDVR0PAQH/BAQDAgEG +MA0GCSqGSIb3DQEBCwUAA4ICAQAFNzr0TbdF4kV1JI+2d1LoHNgQk2Xz8lkGpD4eKexd0dCrfOAK +kEh47U6YA5n+KGCRHTAduGN8qOY1tfrTYXbm1gdLymmasoR6d5NFFxWfJNCYExL/u6Au/U5Mh/jO +XKqYGwXgAEZKgoClM4so3O0409/lPun++1ndYYRP0lSWE2ETPo+Aab6TR7U1Q9Jauz1c77NCR807 +VRMGsAnb/WP2OogKmW9+4c4bU2pEZiNRCHu8W1Ki/QY3OEBhj0qWuJA3+GbHeJAAFS6LrVE1Uweo +a2iu+U48BybNCAVwzDk/dr2l02cmAYamU9JgO3xDf1WKvJUawSg5TB9D0pH0clmKuVb8P7Sd2nCc +dlqMQ1DujjByTd//SffGqWfZbawCEeI6FiWnWAjLb1NBnEg4R2gz0dfHj9R0IdTDBZB6/86WiLEV +KV0jq9BgoRJP3vQXzTLlyb/IQ639Lo7xr+L0mPoSHyDYwKcMhcWQ9DstliaxLL5Mq+ux0orJ23gT +Dx4JnW2PAJ8C2sH6H3p6CcRK5ogql5+Ji/03X186zjhZhkuvcQu02PJwT58yE+Owp1fl2tpDy4Q0 +8ijE6m30Ku/Ba3ba+367hTzSU8JNvnHhRdH9I2cNE3X7z2VnIp2usAnRCf8dNL/+I5c30jn6PQ0G +C7TbO6Orb1wdtn7os4I07QZcJA== +-----END CERTIFICATE----- + +T-TeleSec GlobalRoot Class 2 +============================ +-----BEGIN CERTIFICATE----- +MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoM +IlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBU +cnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDIwHhcNMDgx +MDAxMTA0MDE0WhcNMzMxMDAxMjM1OTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lz +dGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBD +ZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDIwggEiMA0GCSqGSIb3 +DQEBAQUAA4IBDwAwggEKAoIBAQCqX9obX+hzkeXaXPSi5kfl82hVYAUdAqSzm1nzHoqvNK38DcLZ +SBnuaY/JIPwhqgcZ7bBcrGXHX+0CfHt8LRvWurmAwhiCFoT6ZrAIxlQjgeTNuUk/9k9uN0goOA/F +vudocP05l03Sx5iRUKrERLMjfTlH6VJi1hKTXrcxlkIF+3anHqP1wvzpesVsqXFP6st4vGCvx970 +2cu+fjOlbpSD8DT6IavqjnKgP6TeMFvvhk1qlVtDRKgQFRzlAVfFmPHmBiiRqiDFt1MmUUOyCxGV +WOHAD3bZwI18gfNycJ5v/hqO2V81xrJvNHy+SE/iWjnX2J14np+GPgNeGYtEotXHAgMBAAGjQjBA +MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS/WSA2AHmgoCJrjNXy +YdK4LMuCSjANBgkqhkiG9w0BAQsFAAOCAQEAMQOiYQsfdOhyNsZt+U2e+iKo4YFWz827n+qrkRk4 +r6p8FU3ztqONpfSO9kSpp+ghla0+AGIWiPACuvxhI+YzmzB6azZie60EI4RYZeLbK4rnJVM3YlNf +vNoBYimipidx5joifsFvHZVwIEoHNN/q/xWA5brXethbdXwFeilHfkCoMRN3zUA7tFFHei4R40cR +3p1m0IvVVGb6g1XqfMIpiRvpb7PO4gWEyS8+eIVibslfwXhjdFjASBgMmTnrpMwatXlajRWc2BQN +9noHV8cigwUtPJslJj0Ys6lDfMjIq2SPDqO/nBudMNva0Bkuqjzx+zOAduTNrRlPBSeOE6Fuwg== +-----END CERTIFICATE----- + +Atos TrustedRoot 2011 +===================== +-----BEGIN CERTIFICATE----- +MIIDdzCCAl+gAwIBAgIIXDPLYixfszIwDQYJKoZIhvcNAQELBQAwPDEeMBwGA1UEAwwVQXRvcyBU +cnVzdGVkUm9vdCAyMDExMQ0wCwYDVQQKDARBdG9zMQswCQYDVQQGEwJERTAeFw0xMTA3MDcxNDU4 +MzBaFw0zMDEyMzEyMzU5NTlaMDwxHjAcBgNVBAMMFUF0b3MgVHJ1c3RlZFJvb3QgMjAxMTENMAsG +A1UECgwEQXRvczELMAkGA1UEBhMCREUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCV +hTuXbyo7LjvPpvMpNb7PGKw+qtn4TaA+Gke5vJrf8v7MPkfoepbCJI419KkM/IL9bcFyYie96mvr +54rMVD6QUM+A1JX76LWC1BTFtqlVJVfbsVD2sGBkWXppzwO3bw2+yj5vdHLqqjAqc2K+SZFhyBH+ +DgMq92og3AIVDV4VavzjgsG1xZ1kCWyjWZgHJ8cblithdHFsQ/H3NYkQ4J7sVaE3IqKHBAUsR320 +HLliKWYoyrfhk/WklAOZuXCFteZI6o1Q/NnezG8HDt0Lcp2AMBYHlT8oDv3FdU9T1nSatCQujgKR +z3bFmx5VdJx4IbHwLfELn8LVlhgf8FQieowHAgMBAAGjfTB7MB0GA1UdDgQWBBSnpQaxLKYJYO7R +l+lwrrw7GWzbITAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFKelBrEspglg7tGX6XCuvDsZ +bNshMBgGA1UdIAQRMA8wDQYLKwYBBAGwLQMEAQEwDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEB +CwUAA4IBAQAmdzTblEiGKkGdLD4GkGDEjKwLVLgfuXvTBznk+j57sj1O7Z8jvZfza1zv7v1Apt+h +k6EKhqzvINB5Ab149xnYJDE0BAGmuhWawyfc2E8PzBhj/5kPDpFrdRbhIfzYJsdHt6bPWHJxfrrh +TZVHO8mvbaG0weyJ9rQPOLXiZNwlz6bb65pcmaHFCN795trV1lpFDMS3wrUU77QR/w4VtfX128a9 +61qn8FYiqTxlVMYVqL2Gns2Dlmh6cYGJ4Qvh6hEbaAjMaZ7snkGeRDImeuKHCnE96+RapNLbxc3G +3mB/ufNPRJLvKrcYPqcZ2Qt9sTdBQrC6YB3y/gkRsPCHe6ed +-----END CERTIFICATE----- + +QuoVadis Root CA 1 G3 +===================== +-----BEGIN CERTIFICATE----- +MIIFYDCCA0igAwIBAgIUeFhfLq0sGUvjNwc1NBMotZbUZZMwDQYJKoZIhvcNAQELBQAwSDELMAkG +A1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAcBgNVBAMTFVF1b1ZhZGlzIFJv +b3QgQ0EgMSBHMzAeFw0xMjAxMTIxNzI3NDRaFw00MjAxMTIxNzI3NDRaMEgxCzAJBgNVBAYTAkJN +MRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMR4wHAYDVQQDExVRdW9WYWRpcyBSb290IENBIDEg +RzMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCgvlAQjunybEC0BJyFuTHK3C3kEakE +PBtVwedYMB0ktMPvhd6MLOHBPd+C5k+tR4ds7FtJwUrVu4/sh6x/gpqG7D0DmVIB0jWerNrwU8lm +PNSsAgHaJNM7qAJGr6Qc4/hzWHa39g6QDbXwz8z6+cZM5cOGMAqNF34168Xfuw6cwI2H44g4hWf6 +Pser4BOcBRiYz5P1sZK0/CPTz9XEJ0ngnjybCKOLXSoh4Pw5qlPafX7PGglTvF0FBM+hSo+LdoIN +ofjSxxR3W5A2B4GbPgb6Ul5jxaYA/qXpUhtStZI5cgMJYr2wYBZupt0lwgNm3fME0UDiTouG9G/l +g6AnhF4EwfWQvTA9xO+oabw4m6SkltFi2mnAAZauy8RRNOoMqv8hjlmPSlzkYZqn0ukqeI1RPToV +7qJZjqlc3sX5kCLliEVx3ZGZbHqfPT2YfF72vhZooF6uCyP8Wg+qInYtyaEQHeTTRCOQiJ/GKubX +9ZqzWB4vMIkIG1SitZgj7Ah3HJVdYdHLiZxfokqRmu8hqkkWCKi9YSgxyXSthfbZxbGL0eUQMk1f +iyA6PEkfM4VZDdvLCXVDaXP7a3F98N/ETH3Goy7IlXnLc6KOTk0k+17kBL5yG6YnLUlamXrXXAkg +t3+UuU/xDRxeiEIbEbfnkduebPRq34wGmAOtzCjvpUfzUwIDAQABo0IwQDAPBgNVHRMBAf8EBTAD +AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUo5fW816iEOGrRZ88F2Q87gFwnMwwDQYJKoZI +hvcNAQELBQADggIBABj6W3X8PnrHX3fHyt/PX8MSxEBd1DKquGrX1RUVRpgjpeaQWxiZTOOtQqOC +MTaIzen7xASWSIsBx40Bz1szBpZGZnQdT+3Btrm0DWHMY37XLneMlhwqI2hrhVd2cDMT/uFPpiN3 +GPoajOi9ZcnPP/TJF9zrx7zABC4tRi9pZsMbj/7sPtPKlL92CiUNqXsCHKnQO18LwIE6PWThv6ct +Tr1NxNgpxiIY0MWscgKCP6o6ojoilzHdCGPDdRS5YCgtW2jgFqlmgiNR9etT2DGbe+m3nUvriBbP ++V04ikkwj+3x6xn0dxoxGE1nVGwvb2X52z3sIexe9PSLymBlVNFxZPT5pqOBMzYzcfCkeF9OrYMh +3jRJjehZrJ3ydlo28hP0r+AJx2EqbPfgna67hkooby7utHnNkDPDs3b69fBsnQGQ+p6Q9pxyz0fa +wx/kNSBT8lTR32GDpgLiJTjehTItXnOQUl1CxM49S+H5GYQd1aJQzEH7QRTDvdbJWqNjZgKAvQU6 +O0ec7AAmTPWIUb+oI38YB7AL7YsmoWTTYUrrXJ/es69nA7Mf3W1daWhpq1467HxpvMc7hU6eFbm0 +FU/DlXpY18ls6Wy58yljXrQs8C097Vpl4KlbQMJImYFtnh8GKjwStIsPm6Ik8KaN1nrgS7ZklmOV +hMJKzRwuJIczYOXD +-----END CERTIFICATE----- + +QuoVadis Root CA 2 G3 +===================== +-----BEGIN CERTIFICATE----- +MIIFYDCCA0igAwIBAgIURFc0JFuBiZs18s64KztbpybwdSgwDQYJKoZIhvcNAQELBQAwSDELMAkG +A1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAcBgNVBAMTFVF1b1ZhZGlzIFJv +b3QgQ0EgMiBHMzAeFw0xMjAxMTIxODU5MzJaFw00MjAxMTIxODU5MzJaMEgxCzAJBgNVBAYTAkJN +MRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMR4wHAYDVQQDExVRdW9WYWRpcyBSb290IENBIDIg +RzMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQChriWyARjcV4g/Ruv5r+LrI3HimtFh +ZiFfqq8nUeVuGxbULX1QsFN3vXg6YOJkApt8hpvWGo6t/x8Vf9WVHhLL5hSEBMHfNrMWn4rjyduY +NM7YMxcoRvynyfDStNVNCXJJ+fKH46nafaF9a7I6JaltUkSs+L5u+9ymc5GQYaYDFCDy54ejiK2t +oIz/pgslUiXnFgHVy7g1gQyjO/Dh4fxaXc6AcW34Sas+O7q414AB+6XrW7PFXmAqMaCvN+ggOp+o +MiwMzAkd056OXbxMmO7FGmh77FOm6RQ1o9/NgJ8MSPsc9PG/Srj61YxxSscfrf5BmrODXfKEVu+l +V0POKa2Mq1W/xPtbAd0jIaFYAI7D0GoT7RPjEiuA3GfmlbLNHiJuKvhB1PLKFAeNilUSxmn1uIZo +L1NesNKqIcGY5jDjZ1XHm26sGahVpkUG0CM62+tlXSoREfA7T8pt9DTEceT/AFr2XK4jYIVz8eQQ +sSWu1ZK7E8EM4DnatDlXtas1qnIhO4M15zHfeiFuuDIIfR0ykRVKYnLP43ehvNURG3YBZwjgQQvD +6xVu+KQZ2aKrr+InUlYrAoosFCT5v0ICvybIxo/gbjh9Uy3l7ZizlWNof/k19N+IxWA1ksB8aRxh +lRbQ694Lrz4EEEVlWFA4r0jyWbYW8jwNkALGcC4BrTwV1wIDAQABo0IwQDAPBgNVHRMBAf8EBTAD +AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQU7edvdlq/YOxJW8ald7tyFnGbxD0wDQYJKoZI +hvcNAQELBQADggIBAJHfgD9DCX5xwvfrs4iP4VGyvD11+ShdyLyZm3tdquXK4Qr36LLTn91nMX66 +AarHakE7kNQIXLJgapDwyM4DYvmL7ftuKtwGTTwpD4kWilhMSA/ohGHqPHKmd+RCroijQ1h5fq7K +pVMNqT1wvSAZYaRsOPxDMuHBR//47PERIjKWnML2W2mWeyAMQ0GaW/ZZGYjeVYg3UQt4XAoeo0L9 +x52ID8DyeAIkVJOviYeIyUqAHerQbj5hLja7NQ4nlv1mNDthcnPxFlxHBlRJAHpYErAK74X9sbgz +dWqTHBLmYF5vHX/JHyPLhGGfHoJE+V+tYlUkmlKY7VHnoX6XOuYvHxHaU4AshZ6rNRDbIl9qxV6X +U/IyAgkwo1jwDQHVcsaxfGl7w/U2Rcxhbl5MlMVerugOXou/983g7aEOGzPuVBj+D77vfoRrQ+Nw +mNtddbINWQeFFSM51vHfqSYP1kjHs6Yi9TM3WpVHn3u6GBVv/9YUZINJ0gpnIdsPNWNgKCLjsZWD +zYWm3S8P52dSbrsvhXz1SnPnxT7AvSESBT/8twNJAlvIJebiVDj1eYeMHVOyToV7BjjHLPj4sHKN +JeV3UvQDHEimUF+IIDBu8oJDqz2XhOdT+yHBTw8imoa4WSr2Rz0ZiC3oheGe7IUIarFsNMkd7Egr +O3jtZsSOeWmD3n+M +-----END CERTIFICATE----- + +QuoVadis Root CA 3 G3 +===================== +-----BEGIN CERTIFICATE----- +MIIFYDCCA0igAwIBAgIULvWbAiin23r/1aOp7r0DoM8Sah0wDQYJKoZIhvcNAQELBQAwSDELMAkG +A1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAcBgNVBAMTFVF1b1ZhZGlzIFJv +b3QgQ0EgMyBHMzAeFw0xMjAxMTIyMDI2MzJaFw00MjAxMTIyMDI2MzJaMEgxCzAJBgNVBAYTAkJN +MRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMR4wHAYDVQQDExVRdW9WYWRpcyBSb290IENBIDMg +RzMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCzyw4QZ47qFJenMioKVjZ/aEzHs286 +IxSR/xl/pcqs7rN2nXrpixurazHb+gtTTK/FpRp5PIpM/6zfJd5O2YIyC0TeytuMrKNuFoM7pmRL +Mon7FhY4futD4tN0SsJiCnMK3UmzV9KwCoWdcTzeo8vAMvMBOSBDGzXRU7Ox7sWTaYI+FrUoRqHe +6okJ7UO4BUaKhvVZR74bbwEhELn9qdIoyhA5CcoTNs+cra1AdHkrAj80//ogaX3T7mH1urPnMNA3 +I4ZyYUUpSFlob3emLoG+B01vr87ERRORFHAGjx+f+IdpsQ7vw4kZ6+ocYfx6bIrc1gMLnia6Et3U +VDmrJqMz6nWB2i3ND0/kA9HvFZcba5DFApCTZgIhsUfei5pKgLlVj7WiL8DWM2fafsSntARE60f7 +5li59wzweyuxwHApw0BiLTtIadwjPEjrewl5qW3aqDCYz4ByA4imW0aucnl8CAMhZa634RylsSqi +Md5mBPfAdOhx3v89WcyWJhKLhZVXGqtrdQtEPREoPHtht+KPZ0/l7DxMYIBpVzgeAVuNVejH38DM +dyM0SXV89pgR6y3e7UEuFAUCf+D+IOs15xGsIs5XPd7JMG0QA4XN8f+MFrXBsj6IbGB/kE+V9/Yt +rQE5BwT6dYB9v0lQ7e/JxHwc64B+27bQ3RP+ydOc17KXqQIDAQABo0IwQDAPBgNVHRMBAf8EBTAD +AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUxhfQvKjqAkPyGwaZXSuQILnXnOQwDQYJKoZI +hvcNAQELBQADggIBADRh2Va1EodVTd2jNTFGu6QHcrxfYWLopfsLN7E8trP6KZ1/AvWkyaiTt3px +KGmPc+FSkNrVvjrlt3ZqVoAh313m6Tqe5T72omnHKgqwGEfcIHB9UqM+WXzBusnIFUBhynLWcKzS +t/Ac5IYp8M7vaGPQtSCKFWGafoaYtMnCdvvMujAWzKNhxnQT5WvvoxXqA/4Ti2Tk08HS6IT7SdEQ +TXlm66r99I0xHnAUrdzeZxNMgRVhvLfZkXdxGYFgu/BYpbWcC/ePIlUnwEsBbTuZDdQdm2NnL9Du +DcpmvJRPpq3t/O5jrFc/ZSXPsoaP0Aj/uHYUbt7lJ+yreLVTubY/6CD50qi+YUbKh4yE8/nxoGib +Ih6BJpsQBJFxwAYf3KDTuVan45gtf4Od34wrnDKOMpTwATwiKp9Dwi7DmDkHOHv8XgBCH/MyJnmD +hPbl8MFREsALHgQjDFSlTC9JxUrRtm5gDWv8a4uFJGS3iQ6rJUdbPM9+Sb3H6QrG2vd+DhcI00iX +0HGS8A85PjRqHH3Y8iKuu2n0M7SmSFXRDw4m6Oy2Cy2nhTXN/VnIn9HNPlopNLk9hM6xZdRZkZFW +dSHBd575euFgndOtBBj0fOtek49TSiIp+EgrPk2GrFt/ywaZWWDYWGWVjUTR939+J399roD1B0y2 +PpxxVJkES/1Y+Zj0 +-----END CERTIFICATE----- + +DigiCert Assured ID Root G2 +=========================== +-----BEGIN CERTIFICATE----- +MIIDljCCAn6gAwIBAgIQC5McOtY5Z+pnI7/Dr5r0SzANBgkqhkiG9w0BAQsFADBlMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQw +IgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzIwHhcNMTMwODAxMTIwMDAwWhcNMzgw +MTE1MTIwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQL +ExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzIw +ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDZ5ygvUj82ckmIkzTz+GoeMVSAn61UQbVH +35ao1K+ALbkKz3X9iaV9JPrjIgwrvJUXCzO/GU1BBpAAvQxNEP4HteccbiJVMWWXvdMX0h5i89vq +bFCMP4QMls+3ywPgym2hFEwbid3tALBSfK+RbLE4E9HpEgjAALAcKxHad3A2m67OeYfcgnDmCXRw +VWmvo2ifv922ebPynXApVfSr/5Vh88lAbx3RvpO704gqu52/clpWcTs/1PPRCv4o76Pu2ZmvA9OP +YLfykqGxvYmJHzDNw6YuYjOuFgJ3RFrngQo8p0Quebg/BLxcoIfhG69Rjs3sLPr4/m3wOnyqi+Rn +lTGNAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBTO +w0q5mVXyuNtgv6l+vVa1lzan1jANBgkqhkiG9w0BAQsFAAOCAQEAyqVVjOPIQW5pJ6d1Ee88hjZv +0p3GeDgdaZaikmkuOGybfQTUiaWxMTeKySHMq2zNixya1r9I0jJmwYrA8y8678Dj1JGG0VDjA9tz +d29KOVPt3ibHtX2vK0LRdWLjSisCx1BL4GnilmwORGYQRI+tBev4eaymG+g3NJ1TyWGqolKvSnAW +hsI6yLETcDbYz+70CjTVW0z9B5yiutkBclzzTcHdDrEcDcRjvq30FPuJ7KJBDkzMyFdA0G4Dqs0M +jomZmWzwPDCvON9vvKO+KSAnq3T/EyJ43pdSVR6DtVQgA+6uwE9W3jfMw3+qBCe703e4YtsXfJwo +IhNzbM8m9Yop5w== +-----END CERTIFICATE----- + +DigiCert Assured ID Root G3 +=========================== +-----BEGIN CERTIFICATE----- +MIICRjCCAc2gAwIBAgIQC6Fa+h3foLVJRK/NJKBs7DAKBggqhkjOPQQDAzBlMQswCQYDVQQGEwJV +UzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQwIgYD +VQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzMwHhcNMTMwODAxMTIwMDAwWhcNMzgwMTE1 +MTIwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzMwdjAQ +BgcqhkjOPQIBBgUrgQQAIgNiAAQZ57ysRGXtzbg/WPuNsVepRC0FFfLvC/8QdJ+1YlJfZn4f5dwb +RXkLzMZTCp2NXQLZqVneAlr2lSoOjThKiknGvMYDOAdfVdp+CW7if17QRSAPWXYQ1qAk8C3eNvJs +KTmjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBTL0L2p4ZgF +UaFNN6KDec6NHSrkhDAKBggqhkjOPQQDAwNnADBkAjAlpIFFAmsSS3V0T8gj43DydXLefInwz5Fy +YZ5eEJJZVrmDxxDnOOlYJjZ91eQ0hjkCMHw2U/Aw5WJjOpnitqM7mzT6HtoQknFekROn3aRukswy +1vUhZscv6pZjamVFkpUBtA== +-----END CERTIFICATE----- + +DigiCert Global Root G2 +======================= +-----BEGIN CERTIFICATE----- +MIIDjjCCAnagAwIBAgIQAzrx5qcRqaC7KGSxHQn65TANBgkqhkiG9w0BAQsFADBhMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAw +HgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBHMjAeFw0xMzA4MDExMjAwMDBaFw0zODAxMTUx +MjAwMDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3 +dy5kaWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEcyMIIBIjANBgkq +hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuzfNNNx7a8myaJCtSnX/RrohCgiN9RlUyfuI2/Ou8jqJ +kTx65qsGGmvPrC3oXgkkRLpimn7Wo6h+4FR1IAWsULecYxpsMNzaHxmx1x7e/dfgy5SDN67sH0NO +3Xss0r0upS/kqbitOtSZpLYl6ZtrAGCSYP9PIUkY92eQq2EGnI/yuum06ZIya7XzV+hdG82MHauV +BJVJ8zUtluNJbd134/tJS7SsVQepj5WztCO7TG1F8PapspUwtP1MVYwnSlcUfIKdzXOS0xZKBgyM +UNGPHgm+F6HmIcr9g+UQvIOlCsRnKPZzFBQ9RnbDhxSJITRNrw9FDKZJobq7nMWxM4MphQIDAQAB +o0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUTiJUIBiV5uNu +5g/6+rkS7QYXjzkwDQYJKoZIhvcNAQELBQADggEBAGBnKJRvDkhj6zHd6mcY1Yl9PMWLSn/pvtsr +F9+wX3N3KjITOYFnQoQj8kVnNeyIv/iPsGEMNKSuIEyExtv4NeF22d+mQrvHRAiGfzZ0JFrabA0U +WTW98kndth/Jsw1HKj2ZL7tcu7XUIOGZX1NGFdtom/DzMNU+MeKNhJ7jitralj41E6Vf8PlwUHBH +QRFXGU7Aj64GxJUTFy8bJZ918rGOmaFvE7FBcf6IKshPECBV1/MUReXgRPTqh5Uykw7+U0b6LJ3/ +iyK5S9kJRaTepLiaWN0bfVKfjllDiIGknibVb63dDcY3fe0Dkhvld1927jyNxF1WW6LZZm6zNTfl +MrY= +-----END CERTIFICATE----- + +DigiCert Global Root G3 +======================= +-----BEGIN CERTIFICATE----- +MIICPzCCAcWgAwIBAgIQBVVWvPJepDU1w6QP1atFcjAKBggqhkjOPQQDAzBhMQswCQYDVQQGEwJV +UzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAwHgYD +VQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBHMzAeFw0xMzA4MDExMjAwMDBaFw0zODAxMTUxMjAw +MDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5k +aWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEczMHYwEAYHKoZIzj0C +AQYFK4EEACIDYgAE3afZu4q4C/sLfyHS8L6+c/MzXRq8NOrexpu80JX28MzQC7phW1FGfp4tn+6O +YwwX7Adw9c+ELkCDnOg/QW07rdOkFFk2eJ0DQ+4QE2xy3q6Ip6FrtUPOZ9wj/wMco+I+o0IwQDAP +BgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUs9tIpPmhxdiuNkHMEWNp +Yim8S8YwCgYIKoZIzj0EAwMDaAAwZQIxAK288mw/EkrRLTnDCgmXc/SINoyIJ7vmiI1Qhadj+Z4y +3maTD/HMsQmP3Wyr+mt/oAIwOWZbwmSNuJ5Q3KjVSaLtx9zRSX8XAbjIho9OjIgrqJqpisXRAL34 +VOKa5Vt8sycX +-----END CERTIFICATE----- + +DigiCert Trusted Root G4 +======================== +-----BEGIN CERTIFICATE----- +MIIFkDCCA3igAwIBAgIQBZsbV56OITLiOQe9p3d1XDANBgkqhkiG9w0BAQwFADBiMQswCQYDVQQG +EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSEw +HwYDVQQDExhEaWdpQ2VydCBUcnVzdGVkIFJvb3QgRzQwHhcNMTMwODAxMTIwMDAwWhcNMzgwMTE1 +MTIwMDAwWjBiMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 +d3cuZGlnaWNlcnQuY29tMSEwHwYDVQQDExhEaWdpQ2VydCBUcnVzdGVkIFJvb3QgRzQwggIiMA0G +CSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC/5pBzaN675F1KPDAiMGkz7MKnJS7JIT3yithZwuEp +pz1Yq3aaza57G4QNxDAf8xukOBbrVsaXbR2rsnnyyhHS5F/WBTxSD1Ifxp4VpX6+n6lXFllVcq9o +k3DCsrp1mWpzMpTREEQQLt+C8weE5nQ7bXHiLQwb7iDVySAdYyktzuxeTsiT+CFhmzTrBcZe7Fsa +vOvJz82sNEBfsXpm7nfISKhmV1efVFiODCu3T6cw2Vbuyntd463JT17lNecxy9qTXtyOj4DatpGY +QJB5w3jHtrHEtWoYOAMQjdjUN6QuBX2I9YI+EJFwq1WCQTLX2wRzKm6RAXwhTNS8rhsDdV14Ztk6 +MUSaM0C/CNdaSaTC5qmgZ92kJ7yhTzm1EVgX9yRcRo9k98FpiHaYdj1ZXUJ2h4mXaXpI8OCiEhtm +mnTK3kse5w5jrubU75KSOp493ADkRSWJtppEGSt+wJS00mFt6zPZxd9LBADMfRyVw4/3IbKyEbe7 +f/LVjHAsQWCqsWMYRJUadmJ+9oCw++hkpjPRiQfhvbfmQ6QYuKZ3AeEPlAwhHbJUKSWJbOUOUlFH +dL4mrLZBdd56rF+NP8m800ERElvlEFDrMcXKchYiCd98THU/Y+whX8QgUWtvsauGi0/C1kVfnSD8 +oR7FwI+isX4KJpn15GkvmB0t9dmpsh3lGwIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1Ud +DwEB/wQEAwIBhjAdBgNVHQ4EFgQU7NfjgtJxXWRM3y5nP+e6mK4cD08wDQYJKoZIhvcNAQEMBQAD +ggIBALth2X2pbL4XxJEbw6GiAI3jZGgPVs93rnD5/ZpKmbnJeFwMDF/k5hQpVgs2SV1EY+CtnJYY +ZhsjDT156W1r1lT40jzBQ0CuHVD1UvyQO7uYmWlrx8GnqGikJ9yd+SeuMIW59mdNOj6PWTkiU0Tr +yF0Dyu1Qen1iIQqAyHNm0aAFYF/opbSnr6j3bTWcfFqK1qI4mfN4i/RN0iAL3gTujJtHgXINwBQy +7zBZLq7gcfJW5GqXb5JQbZaNaHqasjYUegbyJLkJEVDXCLG4iXqEI2FCKeWjzaIgQdfRnGTZ6iah +ixTXTBmyUEFxPT9NcCOGDErcgdLMMpSEDQgJlxxPwO5rIHQw0uA5NBCFIRUBCOhVMt5xSdkoF1BN +5r5N0XWs0Mr7QbhDparTwwVETyw2m+L64kW4I1NsBm9nVX9GtUw/bihaeSbSpKhil9Ie4u1Ki7wb +/UdKDd9nZn6yW0HQO+T0O/QEY+nvwlQAUaCKKsnOeMzV6ocEGLPOr0mIr/OSmbaz5mEP0oUA51Aa +5BuVnRmhuZyxm7EAHu/QD09CbMkKvO5D+jpxpchNJqU1/YldvIViHTLSoCtU7ZpXwdv6EM8Zt4tK +G48BtieVU+i2iW1bvGjUI+iLUaJW+fCmgKDWHrO8Dw9TdSmq6hN35N6MgSGtBxBHEa2HPQfRdbzP +82Z+ +-----END CERTIFICATE----- + +WoSign +====== +-----BEGIN CERTIFICATE----- +MIIFdjCCA16gAwIBAgIQXmjWEXGUY1BWAGjzPsnFkTANBgkqhkiG9w0BAQUFADBVMQswCQYDVQQG +EwJDTjEaMBgGA1UEChMRV29TaWduIENBIExpbWl0ZWQxKjAoBgNVBAMTIUNlcnRpZmljYXRpb24g +QXV0aG9yaXR5IG9mIFdvU2lnbjAeFw0wOTA4MDgwMTAwMDFaFw0zOTA4MDgwMTAwMDFaMFUxCzAJ +BgNVBAYTAkNOMRowGAYDVQQKExFXb1NpZ24gQ0EgTGltaXRlZDEqMCgGA1UEAxMhQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkgb2YgV29TaWduMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA +vcqNrLiRFVaXe2tcesLea9mhsMMQI/qnobLMMfo+2aYpbxY94Gv4uEBf2zmoAHqLoE1UfcIiePyO +CbiohdfMlZdLdNiefvAA5A6JrkkoRBoQmTIPJYhTpA2zDxIIFgsDcSccf+Hb0v1naMQFXQoOXXDX +2JegvFNBmpGN9J42Znp+VsGQX+axaCA2pIwkLCxHC1l2ZjC1vt7tj/id07sBMOby8w7gLJKA84X5 +KIq0VC6a7fd2/BVoFutKbOsuEo/Uz/4Mx1wdC34FMr5esAkqQtXJTpCzWQ27en7N1QhatH/YHGkR ++ScPewavVIMYe+HdVHpRaG53/Ma/UkpmRqGyZxq7o093oL5d//xWC0Nyd5DKnvnyOfUNqfTq1+ez +EC8wQjchzDBwyYaYD8xYTYO7feUapTeNtqwylwA6Y3EkHp43xP901DfA4v6IRmAR3Qg/UDaruHqk +lWJqbrDKaiFaafPz+x1wOZXzp26mgYmhiMU7ccqjUu6Du/2gd/Tkb+dC221KmYo0SLwX3OSACCK2 +8jHAPwQ+658geda4BmRkAjHXqc1S+4RFaQkAKtxVi8QGRkvASh0JWzko/amrzgD5LkhLJuYwTKVY +yrREgk/nkR4zw7CT/xH8gdLKH3Ep3XZPkiWvHYG3Dy+MwwbMLyejSuQOmbp8HkUff6oZRZb9/D0C +AwEAAaNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFOFmzw7R +8bNLtwYgFP6HEtX2/vs+MA0GCSqGSIb3DQEBBQUAA4ICAQCoy3JAsnbBfnv8rWTjMnvMPLZdRtP1 +LOJwXcgu2AZ9mNELIaCJWSQBnfmvCX0KI4I01fx8cpm5o9dU9OpScA7F9dY74ToJMuYhOZO9sxXq +T2r09Ys/L3yNWC7F4TmgPsc9SnOeQHrAK2GpZ8nzJLmzbVUsWh2eJXLOC62qx1ViC777Y7NhRCOj +y+EaDveaBk3e1CNOIZZbOVtXHS9dCF4Jef98l7VNg64N1uajeeAz0JmWAjCnPv/So0M/BVoG6kQC +2nz4SNAzqfkHx5Xh9T71XXG68pWpdIhhWeO/yloTunK0jF02h+mmxTwTv97QRCbut+wucPrXnbes +5cVAWubXbHssw1abR80LzvobtCHXt2a49CUwi1wNuepnsvRtrtWhnk/Yn+knArAdBtaP4/tIEp9/ +EaEQPkxROpaw0RPxx9gmrjrKkcRpnd8BKWRRb2jaFOwIQZeQjdCygPLPwj2/kWjFgGcexGATVdVh +mVd8upUPYUk6ynW8yQqTP2cOEvIo4jEbwFcW3wh8GcF+Dx+FHgo2fFt+J7x6v+Db9NpSvd4MVHAx +kUOVyLzwPt0JfjBkUO1/AaQzZ01oT74V77D2AhGiGxMlOtzCWfHjXEa7ZywCRuoeSKbmW9m1vFGi +kpbbqsY3Iqb+zCB0oy2pLmvLwIIRIbWTee5Ehr7XHuQe+w== +-----END CERTIFICATE----- + +WoSign China +============ +-----BEGIN CERTIFICATE----- +MIIFWDCCA0CgAwIBAgIQUHBrzdgT/BtOOzNy0hFIjTANBgkqhkiG9w0BAQsFADBGMQswCQYDVQQG +EwJDTjEaMBgGA1UEChMRV29TaWduIENBIExpbWl0ZWQxGzAZBgNVBAMMEkNBIOayg+mAmuagueiv +geS5pjAeFw0wOTA4MDgwMTAwMDFaFw0zOTA4MDgwMTAwMDFaMEYxCzAJBgNVBAYTAkNOMRowGAYD +VQQKExFXb1NpZ24gQ0EgTGltaXRlZDEbMBkGA1UEAwwSQ0Eg5rKD6YCa5qC56K+B5LmmMIICIjAN +BgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA0EkhHiX8h8EqwqzbdoYGTufQdDTc7WU1/FDWiD+k +8H/rD195L4mx/bxjWDeTmzj4t1up+thxx7S8gJeNbEvxUNUqKaqoGXqW5pWOdO2XCld19AXbbQs5 +uQF/qvbW2mzmBeCkTVL829B0txGMe41P/4eDrv8FAxNXUDf+jJZSEExfv5RxadmWPgxDT74wwJ85 +dE8GRV2j1lY5aAfMh09Qd5Nx2UQIsYo06Yms25tO4dnkUkWMLhQfkWsZHWgpLFbE4h4TV2TwYeO5 +Ed+w4VegG63XX9Gv2ystP9Bojg/qnw+LNVgbExz03jWhCl3W6t8Sb8D7aQdGctyB9gQjF+BNdeFy +b7Ao65vh4YOhn0pdr8yb+gIgthhid5E7o9Vlrdx8kHccREGkSovrlXLp9glk3Kgtn3R46MGiCWOc +76DbT52VqyBPt7D3h1ymoOQ3OMdc4zUPLK2jgKLsLl3Az+2LBcLmc272idX10kaO6m1jGx6KyX2m ++Jzr5dVjhU1zZmkR/sgO9MHHZklTfuQZa/HpelmjbX7FF+Ynxu8b22/8DU0GAbQOXDBGVWCvOGU6 +yke6rCzMRh+yRpY/8+0mBe53oWprfi1tWFxK1I5nuPHa1UaKJ/kR8slC/k7e3x9cxKSGhxYzoacX +GKUN5AXlK8IrC6KVkLn9YDxOiT7nnO4fuwECAwEAAaNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1Ud +EwEB/wQFMAMBAf8wHQYDVR0OBBYEFOBNv9ybQV0T6GTwp+kVpOGBwboxMA0GCSqGSIb3DQEBCwUA +A4ICAQBqinA4WbbaixjIvirTthnVZil6Xc1bL3McJk6jfW+rtylNpumlEYOnOXOvEESS5iVdT2H6 +yAa+Tkvv/vMx/sZ8cApBWNromUuWyXi8mHwCKe0JgOYKOoICKuLJL8hWGSbueBwj/feTZU7n85iY +r83d2Z5AiDEoOqsuC7CsDCT6eiaY8xJhEPRdF/d+4niXVOKM6Cm6jBAyvd0zaziGfjk9DgNyp115 +j0WKWa5bIW4xRtVZjc8VX90xJc/bYNaBRHIpAlf2ltTW/+op2znFuCyKGo3Oy+dCMYYFaA6eFN0A +kLppRQjbbpCBhqcqBT/mhDn4t/lXX0ykeVoQDF7Va/81XwVRHmyjdanPUIPTfPRm94KNPQx96N97 +qA4bLJyuQHCH2u2nFoJavjVsIE4iYdm8UXrNemHcSxH5/mc0zy4EZmFcV5cjjPOGG0jfKq+nwf/Y +jj4Du9gqsPoUJbJRa4ZDhS4HIxaAjUz7tGM7zMN07RujHv41D198HRaG9Q7DlfEvr10lO1Hm13ZB +ONFLAzkopR6RctR9q5czxNM+4Gm2KHmgCY0c0f9BckgG/Jou5yD5m6Leie2uPAmvylezkolwQOQv +T8Jwg0DXJCxr5wkf09XHwQj02w47HAcLQxGEIYbpgNR12KvxAmLBsX5VYc8T1yaw15zLKYs4SgsO +kI26oQ== +-----END CERTIFICATE----- + +COMODO RSA Certification Authority +================================== +-----BEGIN CERTIFICATE----- +MIIF2DCCA8CgAwIBAgIQTKr5yttjb+Af907YWwOGnTANBgkqhkiG9w0BAQwFADCBhTELMAkGA1UE +BhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgG +A1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlv +biBBdXRob3JpdHkwHhcNMTAwMTE5MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMC +R0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UE +ChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlvbiBB +dXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCR6FSS0gpWsawNJN3Fz0Rn +dJkrN6N9I3AAcbxT38T6KhKPS38QVr2fcHK3YX/JSw8Xpz3jsARh7v8Rl8f0hj4K+j5c+ZPmNHrZ +FGvnnLOFoIJ6dq9xkNfs/Q36nGz637CC9BR++b7Epi9Pf5l/tfxnQ3K9DADWietrLNPtj5gcFKt+ +5eNu/Nio5JIk2kNrYrhV/erBvGy2i/MOjZrkm2xpmfh4SDBF1a3hDTxFYPwyllEnvGfDyi62a+pG +x8cgoLEfZd5ICLqkTqnyg0Y3hOvozIFIQ2dOciqbXL1MGyiKXCJ7tKuY2e7gUYPDCUZObT6Z+pUX +2nwzV0E8jVHtC7ZcryxjGt9XyD+86V3Em69FmeKjWiS0uqlWPc9vqv9JWL7wqP/0uK3pN/u6uPQL +OvnoQ0IeidiEyxPx2bvhiWC4jChWrBQdnArncevPDt09qZahSL0896+1DSJMwBGB7FY79tOi4lu3 +sgQiUpWAk2nojkxl8ZEDLXB0AuqLZxUpaVICu9ffUGpVRr+goyhhf3DQw6KqLCGqR84onAZFdr+C +GCe01a60y1Dma/RMhnEw6abfFobg2P9A3fvQQoh/ozM6LlweQRGBY84YcWsr7KaKtzFcOmpH4MN5 +WdYgGq/yapiqcrxXStJLnbsQ/LBMQeXtHT1eKJ2czL+zUdqnR+WEUwIDAQABo0IwQDAdBgNVHQ4E +FgQUu69+Aj36pvE8hI6t7jiY7NkyMtQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8w +DQYJKoZIhvcNAQEMBQADggIBAArx1UaEt65Ru2yyTUEUAJNMnMvlwFTPoCWOAvn9sKIN9SCYPBMt +rFaisNZ+EZLpLrqeLppysb0ZRGxhNaKatBYSaVqM4dc+pBroLwP0rmEdEBsqpIt6xf4FpuHA1sj+ +nq6PK7o9mfjYcwlYRm6mnPTXJ9OV2jeDchzTc+CiR5kDOF3VSXkAKRzH7JsgHAckaVd4sjn8OoSg +tZx8jb8uk2IntznaFxiuvTwJaP+EmzzV1gsD41eeFPfR60/IvYcjt7ZJQ3mFXLrrkguhxuhoqEwW +sRqZCuhTLJK7oQkYdQxlqHvLI7cawiiFwxv/0Cti76R7CZGYZ4wUAc1oBmpjIXUDgIiKboHGhfKp +pC3n9KUkEEeDys30jXlYsQab5xoq2Z0B15R97QNKyvDb6KkBPvVWmckejkk9u+UJueBPSZI9FoJA +zMxZxuY67RIuaTxslbH9qh17f4a+Hg4yRvv7E491f0yLS0Zj/gA0QHDBw7mh3aZw4gSzQbzpgJHq +ZJx64SIDqZxubw5lT2yHh17zbqD5daWbQOhTsiedSrnAdyGN/4fy3ryM7xfft0kL0fJuMAsaDk52 +7RH89elWsn2/x20Kk4yl0MC2Hb46TpSi125sC8KKfPog88Tk5c0NqMuRkrF8hey1FGlmDoLnzc7I +LaZRfyHBNVOFBkpdn627G190 +-----END CERTIFICATE----- + +USERTrust RSA Certification Authority +===================================== +-----BEGIN CERTIFICATE----- +MIIF3jCCA8agAwIBAgIQAf1tMPyjylGoG7xkDjUDLTANBgkqhkiG9w0BAQwFADCBiDELMAkGA1UE +BhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQK +ExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkwHhcNMTAwMjAxMDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBiDELMAkGA1UE +BhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQK +ExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNh +dGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCAEmUXNg7D2wiz +0KxXDXbtzSfTTK1Qg2HiqiBNCS1kCdzOiZ/MPans9s/B3PHTsdZ7NygRK0faOca8Ohm0X6a9fZ2j +Y0K2dvKpOyuR+OJv0OwWIJAJPuLodMkYtJHUYmTbf6MG8YgYapAiPLz+E/CHFHv25B+O1ORRxhFn +RghRy4YUVD+8M/5+bJz/Fp0YvVGONaanZshyZ9shZrHUm3gDwFA66Mzw3LyeTP6vBZY1H1dat//O ++T23LLb2VN3I5xI6Ta5MirdcmrS3ID3KfyI0rn47aGYBROcBTkZTmzNg95S+UzeQc0PzMsNT79uq +/nROacdrjGCT3sTHDN/hMq7MkztReJVni+49Vv4M0GkPGw/zJSZrM233bkf6c0Plfg6lZrEpfDKE +Y1WJxA3Bk1QwGROs0303p+tdOmw1XNtB1xLaqUkL39iAigmTYo61Zs8liM2EuLE/pDkP2QKe6xJM +lXzzawWpXhaDzLhn4ugTncxbgtNMs+1b/97lc6wjOy0AvzVVdAlJ2ElYGn+SNuZRkg7zJn0cTRe8 +yexDJtC/QV9AqURE9JnnV4eeUB9XVKg+/XRjL7FQZQnmWEIuQxpMtPAlR1n6BB6T1CZGSlCBst6+ +eLf8ZxXhyVeEHg9j1uliutZfVS7qXMYoCAQlObgOK6nyTJccBz8NUvXt7y+CDwIDAQABo0IwQDAd +BgNVHQ4EFgQUU3m/WqorSs9UgOHYm8Cd8rIDZsswDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF +MAMBAf8wDQYJKoZIhvcNAQEMBQADggIBAFzUfA3P9wF9QZllDHPFUp/L+M+ZBn8b2kMVn54CVVeW +FPFSPCeHlCjtHzoBN6J2/FNQwISbxmtOuowhT6KOVWKR82kV2LyI48SqC/3vqOlLVSoGIG1VeCkZ +7l8wXEskEVX/JJpuXior7gtNn3/3ATiUFJVDBwn7YKnuHKsSjKCaXqeYalltiz8I+8jRRa8YFWSQ +Eg9zKC7F4iRO/Fjs8PRF/iKz6y+O0tlFYQXBl2+odnKPi4w2r78NBc5xjeambx9spnFixdjQg3IM +8WcRiQycE0xyNN+81XHfqnHd4blsjDwSXWXavVcStkNr/+XeTWYRUc+ZruwXtuhxkYzeSf7dNXGi +FSeUHM9h4ya7b6NnJSFd5t0dCy5oGzuCr+yDZ4XUmFF0sbmZgIn/f3gZXHlKYC6SQK5MNyosycdi +yA5d9zZbyuAlJQG03RoHnHcAP9Dc1ew91Pq7P8yF1m9/qS3fuQL39ZeatTXaw2ewh0qpKJ4jjv9c +J2vhsE/zB+4ALtRZh8tSQZXq9EfX7mRBVXyNWQKV3WKdwrnuWih0hKWbt5DHDAff9Yk2dDLWKMGw +sAvgnEzDHNb842m1R0aBL6KCq9NjRHDEjf8tM7qtj3u1cIiuPhnPQCjY/MiQu12ZIvVS5ljFH4gx +Q+6IHdfGjjxDah2nGN59PRbxYvnKkKj9 +-----END CERTIFICATE----- + +USERTrust ECC Certification Authority +===================================== +-----BEGIN CERTIFICATE----- +MIICjzCCAhWgAwIBAgIQXIuZxVqUxdJxVt7NiYDMJjAKBggqhkjOPQQDAzCBiDELMAkGA1UEBhMC +VVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQKExVU +aGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBFQ0MgQ2VydGlmaWNhdGlv +biBBdXRob3JpdHkwHhcNMTAwMjAxMDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBiDELMAkGA1UEBhMC +VVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQKExVU +aGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBFQ0MgQ2VydGlmaWNhdGlv +biBBdXRob3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQarFRaqfloI+d61SRvU8Za2EurxtW2 +0eZzca7dnNYMYf3boIkDuAUU7FfO7l0/4iGzzvfUinngo4N+LZfQYcTxmdwlkWOrfzCjtHDix6Ez +nPO/LlxTsV+zfTJ/ijTjeXmjQjBAMB0GA1UdDgQWBBQ64QmG1M8ZwpZ2dEl23OA1xmNjmjAOBgNV +HQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjA2Z6EWCNzklwBB +HU6+4WMBzzuqQhFkoJ2UOQIReVx7Hfpkue4WQrO/isIJxOzksU0CMQDpKmFHjFJKS04YcPbWRNZu +9YO6bVi9JNlWSOrvxKJGgYhqOkbRqZtNyWHa0V1Xahg= +-----END CERTIFICATE----- + +GlobalSign ECC Root CA - R4 +=========================== +-----BEGIN CERTIFICATE----- +MIIB4TCCAYegAwIBAgIRKjikHJYKBN5CsiilC+g0mAIwCgYIKoZIzj0EAwIwUDEkMCIGA1UECxMb +R2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI0MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQD +EwpHbG9iYWxTaWduMB4XDTEyMTExMzAwMDAwMFoXDTM4MDExOTAzMTQwN1owUDEkMCIGA1UECxMb +R2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI0MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQD +EwpHbG9iYWxTaWduMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEuMZ5049sJQ6fLjkZHAOkrprl +OQcJFspjsbmG+IpXwVfOQvpzofdlQv8ewQCybnMO/8ch5RikqtlxP6jUuc6MHaNCMEAwDgYDVR0P +AQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFFSwe61FuOJAf/sKbvu+M8k8o4TV +MAoGCCqGSM49BAMCA0gAMEUCIQDckqGgE6bPA7DmxCGXkPoUVy0D7O48027KqGx2vKLeuwIgJ6iF +JzWbVsaj8kfSt24bAgAXqmemFZHe+pTsewv4n4Q= +-----END CERTIFICATE----- + +GlobalSign ECC Root CA - R5 +=========================== +-----BEGIN CERTIFICATE----- +MIICHjCCAaSgAwIBAgIRYFlJ4CYuu1X5CneKcflK2GwwCgYIKoZIzj0EAwMwUDEkMCIGA1UECxMb +R2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI1MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQD +EwpHbG9iYWxTaWduMB4XDTEyMTExMzAwMDAwMFoXDTM4MDExOTAzMTQwN1owUDEkMCIGA1UECxMb +R2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI1MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQD +EwpHbG9iYWxTaWduMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAER0UOlvt9Xb/pOdEh+J8LttV7HpI6 +SFkc8GIxLcB6KP4ap1yztsyX50XUWPrRd21DosCHZTQKH3rd6zwzocWdTaRvQZU4f8kehOvRnkmS +h5SHDDqFSmafnVmTTZdhBoZKo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAd +BgNVHQ4EFgQUPeYpSJvqB8ohREom3m7e0oPQn1kwCgYIKoZIzj0EAwMDaAAwZQIxAOVpEslu28Yx +uglB4Zf4+/2a4n0Sye18ZNPLBSWLVtmg515dTguDnFt2KaAJJiFqYgIwcdK1j1zqO+F4CYWodZI7 +yFz9SO8NdCKoCOJuxUnOxwy8p2Fp8fc74SrL+SvzZpA3 +-----END CERTIFICATE----- + +Staat der Nederlanden Root CA - G3 +================================== +-----BEGIN CERTIFICATE----- +MIIFdDCCA1ygAwIBAgIEAJiiOTANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJOTDEeMBwGA1UE +CgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSswKQYDVQQDDCJTdGFhdCBkZXIgTmVkZXJsYW5kZW4g +Um9vdCBDQSAtIEczMB4XDTEzMTExNDExMjg0MloXDTI4MTExMzIzMDAwMFowWjELMAkGA1UEBhMC +TkwxHjAcBgNVBAoMFVN0YWF0IGRlciBOZWRlcmxhbmRlbjErMCkGA1UEAwwiU3RhYXQgZGVyIE5l +ZGVybGFuZGVuIFJvb3QgQ0EgLSBHMzCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAL4y +olQPcPssXFnrbMSkUeiFKrPMSjTysF/zDsccPVMeiAho2G89rcKezIJnByeHaHE6n3WWIkYFsO2t +x1ueKt6c/DrGlaf1F2cY5y9JCAxcz+bMNO14+1Cx3Gsy8KL+tjzk7FqXxz8ecAgwoNzFs21v0IJy +EavSgWhZghe3eJJg+szeP4TrjTgzkApyI/o1zCZxMdFyKJLZWyNtZrVtB0LrpjPOktvA9mxjeM3K +Tj215VKb8b475lRgsGYeCasH/lSJEULR9yS6YHgamPfJEf0WwTUaVHXvQ9Plrk7O53vDxk5hUUur +mkVLoR9BvUhTFXFkC4az5S6+zqQbwSmEorXLCCN2QyIkHxcE1G6cxvx/K2Ya7Irl1s9N9WMJtxU5 +1nus6+N86U78dULI7ViVDAZCopz35HCz33JvWjdAidiFpNfxC95DGdRKWCyMijmev4SH8RY7Ngzp +07TKbBlBUgmhHbBqv4LvcFEhMtwFdozL92TkA1CvjJFnq8Xy7ljY3r735zHPbMk7ccHViLVlvMDo +FxcHErVc0qsgk7TmgoNwNsXNo42ti+yjwUOH5kPiNL6VizXtBznaqB16nzaeErAMZRKQFWDZJkBE +41ZgpRDUajz9QdwOWke275dhdU/Z/seyHdTtXUmzqWrLZoQT1Vyg3N9udwbRcXXIV2+vD3dbAgMB +AAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRUrfrHkleu +yjWcLhL75LpdINyUVzANBgkqhkiG9w0BAQsFAAOCAgEAMJmdBTLIXg47mAE6iqTnB/d6+Oea31BD +U5cqPco8R5gu4RV78ZLzYdqQJRZlwJ9UXQ4DO1t3ApyEtg2YXzTdO2PCwyiBwpwpLiniyMMB8jPq +KqrMCQj3ZWfGzd/TtiunvczRDnBfuCPRy5FOCvTIeuXZYzbB1N/8Ipf3YF3qKS9Ysr1YvY2WTxB1 +v0h7PVGHoTx0IsL8B3+A3MSs/mrBcDCw6Y5p4ixpgZQJut3+TcCDjJRYwEYgr5wfAvg1VUkvRtTA +8KCWAg8zxXHzniN9lLf9OtMJgwYh/WA9rjLA0u6NpvDntIJ8CsxwyXmA+P5M9zWEGYox+wrZ13+b +8KKaa8MFSu1BYBQw0aoRQm7TIwIEC8Zl3d1Sd9qBa7Ko+gE4uZbqKmxnl4mUnrzhVNXkanjvSr0r +mj1AfsbAddJu+2gw7OyLnflJNZoaLNmzlTnVHpL3prllL+U9bTpITAjc5CgSKL59NVzq4BZ+Extq +1z7XnvwtdbLBFNUjA9tbbws+eC8N3jONFrdI54OagQ97wUNNVQQXOEpR1VmiiXTTn74eS9fGbbeI +JG9gkaSChVtWQbzQRKtqE77RLFi3EjNYsjdj3BP1lB0/QFH1T/U67cjF68IeHRaVesd+QnGTbksV +tzDfqu1XhUisHWrdOWnk4Xl4vs4Fv6EM94B7IWcnMFk= +-----END CERTIFICATE----- + +Staat der Nederlanden EV Root CA +================================ +-----BEGIN CERTIFICATE----- +MIIFcDCCA1igAwIBAgIEAJiWjTANBgkqhkiG9w0BAQsFADBYMQswCQYDVQQGEwJOTDEeMBwGA1UE +CgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSkwJwYDVQQDDCBTdGFhdCBkZXIgTmVkZXJsYW5kZW4g +RVYgUm9vdCBDQTAeFw0xMDEyMDgxMTE5MjlaFw0yMjEyMDgxMTEwMjhaMFgxCzAJBgNVBAYTAk5M +MR4wHAYDVQQKDBVTdGFhdCBkZXIgTmVkZXJsYW5kZW4xKTAnBgNVBAMMIFN0YWF0IGRlciBOZWRl +cmxhbmRlbiBFViBSb290IENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA48d+ifkk +SzrSM4M1LGns3Amk41GoJSt5uAg94JG6hIXGhaTK5skuU6TJJB79VWZxXSzFYGgEt9nCUiY4iKTW +O0Cmws0/zZiTs1QUWJZV1VD+hq2kY39ch/aO5ieSZxeSAgMs3NZmdO3dZ//BYY1jTw+bbRcwJu+r +0h8QoPnFfxZpgQNH7R5ojXKhTbImxrpsX23Wr9GxE46prfNeaXUmGD5BKyF/7otdBwadQ8QpCiv8 +Kj6GyzyDOvnJDdrFmeK8eEEzduG/L13lpJhQDBXd4Pqcfzho0LKmeqfRMb1+ilgnQ7O6M5HTp5gV +XJrm0w912fxBmJc+qiXbj5IusHsMX/FjqTf5m3VpTCgmJdrV8hJwRVXj33NeN/UhbJCONVrJ0yPr +08C+eKxCKFhmpUZtcALXEPlLVPxdhkqHz3/KRawRWrUgUY0viEeXOcDPusBCAUCZSCELa6fS/ZbV +0b5GnUngC6agIk440ME8MLxwjyx1zNDFjFE7PZQIZCZhfbnDZY8UnCHQqv0XcgOPvZuM5l5Tnrmd +74K74bzickFbIZTTRTeU0d8JOV3nI6qaHcptqAqGhYqCvkIH1vI4gnPah1vlPNOePqc7nvQDs/nx +fRN0Av+7oeX6AHkcpmZBiFxgV6YuCcS6/ZrPpx9Aw7vMWgpVSzs4dlG4Y4uElBbmVvMCAwEAAaNC +MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFP6rAJCYniT8qcwa +ivsnuL8wbqg7MA0GCSqGSIb3DQEBCwUAA4ICAQDPdyxuVr5Os7aEAJSrR8kN0nbHhp8dB9O2tLsI +eK9p0gtJ3jPFrK3CiAJ9Brc1AsFgyb/E6JTe1NOpEyVa/m6irn0F3H3zbPB+po3u2dfOWBfoqSmu +c0iH55vKbimhZF8ZE/euBhD/UcabTVUlT5OZEAFTdfETzsemQUHSv4ilf0X8rLiltTMMgsT7B/Zq +5SWEXwbKwYY5EdtYzXc7LMJMD16a4/CrPmEbUCTCwPTxGfARKbalGAKb12NMcIxHowNDXLldRqAN +b/9Zjr7dn3LDWyvfjFvO5QxGbJKyCqNMVEIYFRIYvdr8unRu/8G2oGTYqV9Vrp9canaW2HNnh/tN +f1zuacpzEPuKqf2evTY4SUmH9A4U8OmHuD+nT3pajnnUk+S7aFKErGzp85hwVXIy+TSrK0m1zSBi +5Dp6Z2Orltxtrpfs/J92VoguZs9btsmksNcFuuEnL5O7Jiqik7Ab846+HUCjuTaPPoIaGl6I6lD4 +WeKDRikL40Rc4ZW2aZCaFG+XroHPaO+Zmr615+F/+PoTRxZMzG0IQOeLeG9QgkRQP2YGiqtDhFZK +DyAthg710tvSeopLzaXoTvFeJiUBWSOgftL2fiFX1ye8FVdMpEbB4IMeDExNH08GGeL5qPQ6gqGy +eUN51q1veieQA6TqJIc/2b3Z6fJfUEkc7uzXLg== +-----END CERTIFICATE----- + +IdenTrust Commercial Root CA 1 +============================== +-----BEGIN CERTIFICATE----- +MIIFYDCCA0igAwIBAgIQCgFCgAAAAUUjyES1AAAAAjANBgkqhkiG9w0BAQsFADBKMQswCQYDVQQG +EwJVUzESMBAGA1UEChMJSWRlblRydXN0MScwJQYDVQQDEx5JZGVuVHJ1c3QgQ29tbWVyY2lhbCBS +b290IENBIDEwHhcNMTQwMTE2MTgxMjIzWhcNMzQwMTE2MTgxMjIzWjBKMQswCQYDVQQGEwJVUzES +MBAGA1UEChMJSWRlblRydXN0MScwJQYDVQQDEx5JZGVuVHJ1c3QgQ29tbWVyY2lhbCBSb290IENB +IDEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCnUBneP5k91DNG8W9RYYKyqU+PZ4ld +hNlT3Qwo2dfw/66VQ3KZ+bVdfIrBQuExUHTRgQ18zZshq0PirK1ehm7zCYofWjK9ouuU+ehcCuz/ +mNKvcbO0U59Oh++SvL3sTzIwiEsXXlfEU8L2ApeN2WIrvyQfYo3fw7gpS0l4PJNgiCL8mdo2yMKi +1CxUAGc1bnO/AljwpN3lsKImesrgNqUZFvX9t++uP0D1bVoE/c40yiTcdCMbXTMTEl3EASX2MN0C +XZ/g1Ue9tOsbobtJSdifWwLziuQkkORiT0/Br4sOdBeo0XKIanoBScy0RnnGF7HamB4HWfp1IYVl +3ZBWzvurpWCdxJ35UrCLvYf5jysjCiN2O/cz4ckA82n5S6LgTrx+kzmEB/dEcH7+B1rlsazRGMzy +NeVJSQjKVsk9+w8YfYs7wRPCTY/JTw436R+hDmrfYi7LNQZReSzIJTj0+kuniVyc0uMNOYZKdHzV +WYfCP04MXFL0PfdSgvHqo6z9STQaKPNBiDoT7uje/5kdX7rL6B7yuVBgwDHTc+XvvqDtMwt0viAg +xGds8AgDelWAf0ZOlqf0Hj7h9tgJ4TNkK2PXMl6f+cB7D3hvl7yTmvmcEpB4eoCHFddydJxVdHix +uuFucAS6T6C6aMN7/zHwcz09lCqxC0EOoP5NiGVreTO01wIDAQABo0IwQDAOBgNVHQ8BAf8EBAMC +AQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU7UQZwNPwBovupHu+QucmVMiONnYwDQYJKoZI +hvcNAQELBQADggIBAA2ukDL2pkt8RHYZYR4nKM1eVO8lvOMIkPkp165oCOGUAFjvLi5+U1KMtlwH +6oi6mYtQlNeCgN9hCQCTrQ0U5s7B8jeUeLBfnLOic7iPBZM4zY0+sLj7wM+x8uwtLRvM7Kqas6pg +ghstO8OEPVeKlh6cdbjTMM1gCIOQ045U8U1mwF10A0Cj7oV+wh93nAbowacYXVKV7cndJZ5t+qnt +ozo00Fl72u1Q8zW/7esUTTHHYPTa8Yec4kjixsU3+wYQ+nVZZjFHKdp2mhzpgq7vmrlR94gjmmmV +YjzlVYA211QC//G5Xc7UI2/YRYRKW2XviQzdFKcgyxilJbQN+QHwotL0AMh0jqEqSI5l2xPE4iUX +feu+h1sXIFRRk0pTAwvsXcoz7WL9RccvW9xYoIA55vrX/hMUpu09lEpCdNTDd1lzzY9GvlU47/ro +kTLql1gEIt44w8y8bckzOmoKaT+gyOpyj4xjhiO9bTyWnpXgSUyqorkqG5w2gXjtw+hG4iZZRHUe +2XWJUc0QhJ1hYMtd+ZciTY6Y5uN/9lu7rs3KSoFrXgvzUeF0K+l+J6fZmUlO+KWA2yUPHGNiiskz +Z2s8EIPGrd6ozRaOjfAHN3Gf8qv8QfXBi+wAN10J5U6A7/qxXDgGpRtK4dw4LTzcqx+QGtVKnO7R +cGzM7vRX+Bi6hG6H +-----END CERTIFICATE----- + +IdenTrust Public Sector Root CA 1 +================================= +-----BEGIN CERTIFICATE----- +MIIFZjCCA06gAwIBAgIQCgFCgAAAAUUjz0Z8AAAAAjANBgkqhkiG9w0BAQsFADBNMQswCQYDVQQG +EwJVUzESMBAGA1UEChMJSWRlblRydXN0MSowKAYDVQQDEyFJZGVuVHJ1c3QgUHVibGljIFNlY3Rv +ciBSb290IENBIDEwHhcNMTQwMTE2MTc1MzMyWhcNMzQwMTE2MTc1MzMyWjBNMQswCQYDVQQGEwJV +UzESMBAGA1UEChMJSWRlblRydXN0MSowKAYDVQQDEyFJZGVuVHJ1c3QgUHVibGljIFNlY3RvciBS +b290IENBIDEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2IpT8pEiv6EdrCvsnduTy +P4o7ekosMSqMjbCpwzFrqHd2hCa2rIFCDQjrVVi7evi8ZX3yoG2LqEfpYnYeEe4IFNGyRBb06tD6 +Hi9e28tzQa68ALBKK0CyrOE7S8ItneShm+waOh7wCLPQ5CQ1B5+ctMlSbdsHyo+1W/CD80/HLaXI +rcuVIKQxKFdYWuSNG5qrng0M8gozOSI5Cpcu81N3uURF/YTLNiCBWS2ab21ISGHKTN9T0a9SvESf +qy9rg3LvdYDaBjMbXcjaY8ZNzaxmMc3R3j6HEDbhuaR672BQssvKplbgN6+rNBM5Jeg5ZuSYeqoS +mJxZZoY+rfGwyj4GD3vwEUs3oERte8uojHH01bWRNszwFcYr3lEXsZdMUD2xlVl8BX0tIdUAvwFn +ol57plzy9yLxkA2T26pEUWbMfXYD62qoKjgZl3YNa4ph+bz27nb9cCvdKTz4Ch5bQhyLVi9VGxyh +LrXHFub4qjySjmm2AcG1hp2JDws4lFTo6tyePSW8Uybt1as5qsVATFSrsrTZ2fjXctscvG29ZV/v +iDUqZi/u9rNl8DONfJhBaUYPQxxp+pu10GFqzcpL2UyQRqsVWaFHVCkugyhfHMKiq3IXAAaOReyL +4jM9f9oZRORicsPfIsbyVtTdX5Vy7W1f90gDW/3FKqD2cyOEEBsB5wIDAQABo0IwQDAOBgNVHQ8B +Af8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU43HgntinQtnbcZFrlJPrw6PRFKMw +DQYJKoZIhvcNAQELBQADggIBAEf63QqwEZE4rU1d9+UOl1QZgkiHVIyqZJnYWv6IAcVYpZmxI1Qj +t2odIFflAWJBF9MJ23XLblSQdf4an4EKwt3X9wnQW3IV5B4Jaj0z8yGa5hV+rVHVDRDtfULAj+7A +mgjVQdZcDiFpboBhDhXAuM/FSRJSzL46zNQuOAXeNf0fb7iAaJg9TaDKQGXSc3z1i9kKlT/YPyNt +GtEqJBnZhbMX73huqVjRI9PHE+1yJX9dsXNw0H8GlwmEKYBhHfpe/3OsoOOJuBxxFcbeMX8S3OFt +m6/n6J91eEyrRjuazr8FGF1NFTwWmhlQBJqymm9li1JfPFgEKCXAZmExfrngdbkaqIHWchezxQMx +NRF4eKLg6TCMf4DfWN88uieW4oA0beOY02QnrEh+KHdcxiVhJfiFDGX6xDIvpZgF5PgLZxYWxoK4 +Mhn5+bl53B/N66+rDt0b20XkeucC4pVd/GnwU2lhlXV5C15V5jgclKlZM57IcXR5f1GJtshquDDI +ajjDbp7hNxbqBWJMWxJH7ae0s1hWx0nzfxJoCTFx8G34Tkf71oXuxVhAGaQdp/lLQzfcaFpPz+vC +ZHTetBXZ9FRUGi8c15dxVJCO2SCdUyt/q4/i6jC8UDfv8Ue1fXwsBOxonbRJRBD0ckscZOf85muQ +3Wl9af0AVqW3rLatt8o+Ae+c +-----END CERTIFICATE----- + +Entrust Root Certification Authority - G2 +========================================= +-----BEGIN CERTIFICATE----- +MIIEPjCCAyagAwIBAgIESlOMKDANBgkqhkiG9w0BAQsFADCBvjELMAkGA1UEBhMCVVMxFjAUBgNV +BAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVy +bXMxOTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ug +b25seTEyMDAGA1UEAxMpRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzIw +HhcNMDkwNzA3MTcyNTU0WhcNMzAxMjA3MTc1NTU0WjCBvjELMAkGA1UEBhMCVVMxFjAUBgNVBAoT +DUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVybXMx +OTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25s +eTEyMDAGA1UEAxMpRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzIwggEi +MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC6hLZy254Ma+KZ6TABp3bqMriVQRrJ2mFOWHLP +/vaCeb9zYQYKpSfYs1/TRU4cctZOMvJyig/3gxnQaoCAAEUesMfnmr8SVycco2gvCoe9amsOXmXz +HHfV1IWNcCG0szLni6LVhjkCsbjSR87kyUnEO6fe+1R9V77w6G7CebI6C1XiUJgWMhNcL3hWwcKU +s/Ja5CeanyTXxuzQmyWC48zCxEXFjJd6BmsqEZ+pCm5IO2/b1BEZQvePB7/1U1+cPvQXLOZprE4y +TGJ36rfo5bs0vBmLrpxR57d+tVOxMyLlbc9wPBr64ptntoP0jaWvYkxN4FisZDQSA/i2jZRjJKRx +AgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqciZ6 +0B7vfec7aVHUbI2fkBJmqzANBgkqhkiG9w0BAQsFAAOCAQEAeZ8dlsa2eT8ijYfThwMEYGprmi5Z +iXMRrEPR9RP/jTkrwPK9T3CMqS/qF8QLVJ7UG5aYMzyorWKiAHarWWluBh1+xLlEjZivEtRh2woZ +Rkfz6/djwUAFQKXSt/S1mja/qYh2iARVBCuch38aNzx+LaUa2NSJXsq9rD1s2G2v1fN2D807iDgi +nWyTmsQ9v4IbZT+mD12q/OWyFcq1rca8PdCE6OoGcrBNOTJ4vz4RnAuknZoh8/CbCzB428Hch0P+ +vGOaysXCHMnHjf87ElgI5rY97HosTvuDls4MPGmHVHOkc8KT/1EQrBVUAdj8BbGJoX90g5pJ19xO +e4pIb4tF9g== +-----END CERTIFICATE----- + +Entrust Root Certification Authority - EC1 +========================================== +-----BEGIN CERTIFICATE----- +MIIC+TCCAoCgAwIBAgINAKaLeSkAAAAAUNCR+TAKBggqhkjOPQQDAzCBvzELMAkGA1UEBhMCVVMx +FjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVn +YWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDEyIEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXpl +ZCB1c2Ugb25seTEzMDEGA1UEAxMqRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5 +IC0gRUMxMB4XDTEyMTIxODE1MjUzNloXDTM3MTIxODE1NTUzNlowgb8xCzAJBgNVBAYTAlVTMRYw +FAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9TZWUgd3d3LmVudHJ1c3QubmV0L2xlZ2Fs +LXRlcm1zMTkwNwYDVQQLEzAoYykgMjAxMiBFbnRydXN0LCBJbmMuIC0gZm9yIGF1dGhvcml6ZWQg +dXNlIG9ubHkxMzAxBgNVBAMTKkVudHJ1c3QgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAt +IEVDMTB2MBAGByqGSM49AgEGBSuBBAAiA2IABIQTydC6bUF74mzQ61VfZgIaJPRbiWlH47jCffHy +AsWfoPZb1YsGGYZPUxBtByQnoaD41UcZYUx9ypMn6nQM72+WCf5j7HBdNq1nd67JnXxVRDqiY1Ef +9eNi1KlHBz7MIKNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE +FLdj5xrdjekIplWDpOBqUEFlEUJJMAoGCCqGSM49BAMDA2cAMGQCMGF52OVCR98crlOZF7ZvHH3h +vxGU0QOIdeSNiaSKd0bebWHvAvX7td/M/k7//qnmpwIwW5nXhTcGtXsI/esni0qU+eH6p44mCOh8 +kmhtc9hvJqwhAriZtyZBWyVgrtBIGu4G +-----END CERTIFICATE----- + +CFCA EV ROOT +============ +-----BEGIN CERTIFICATE----- +MIIFjTCCA3WgAwIBAgIEGErM1jANBgkqhkiG9w0BAQsFADBWMQswCQYDVQQGEwJDTjEwMC4GA1UE +CgwnQ2hpbmEgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRUwEwYDVQQDDAxDRkNB +IEVWIFJPT1QwHhcNMTIwODA4MDMwNzAxWhcNMjkxMjMxMDMwNzAxWjBWMQswCQYDVQQGEwJDTjEw +MC4GA1UECgwnQ2hpbmEgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRUwEwYDVQQD +DAxDRkNBIEVWIFJPT1QwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDXXWvNED8fBVnV +BU03sQ7smCuOFR36k0sXgiFxEFLXUWRwFsJVaU2OFW2fvwwbwuCjZ9YMrM8irq93VCpLTIpTUnrD +7i7es3ElweldPe6hL6P3KjzJIx1qqx2hp/Hz7KDVRM8Vz3IvHWOX6Jn5/ZOkVIBMUtRSqy5J35DN +uF++P96hyk0g1CXohClTt7GIH//62pCfCqktQT+x8Rgp7hZZLDRJGqgG16iI0gNyejLi6mhNbiyW +ZXvKWfry4t3uMCz7zEasxGPrb382KzRzEpR/38wmnvFyXVBlWY9ps4deMm/DGIq1lY+wejfeWkU7 +xzbh72fROdOXW3NiGUgthxwG+3SYIElz8AXSG7Ggo7cbcNOIabla1jj0Ytwli3i/+Oh+uFzJlU9f +py25IGvPa931DfSCt/SyZi4QKPaXWnuWFo8BGS1sbn85WAZkgwGDg8NNkt0yxoekN+kWzqotaK8K +gWU6cMGbrU1tVMoqLUuFG7OA5nBFDWteNfB/O7ic5ARwiRIlk9oKmSJgamNgTnYGmE69g60dWIol +hdLHZR4tjsbftsbhf4oEIRUpdPA+nJCdDC7xij5aqgwJHsfVPKPtl8MeNPo4+QgO48BdK4PRVmrJ +tqhUUy54Mmc9gn900PvhtgVguXDbjgv5E1hvcWAQUhC5wUEJ73IfZzF4/5YFjQIDAQABo2MwYTAf +BgNVHSMEGDAWgBTj/i39KNALtbq2osS/BqoFjJP7LzAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB +/wQEAwIBBjAdBgNVHQ4EFgQU4/4t/SjQC7W6tqLEvwaqBYyT+y8wDQYJKoZIhvcNAQELBQADggIB +ACXGumvrh8vegjmWPfBEp2uEcwPenStPuiB/vHiyz5ewG5zz13ku9Ui20vsXiObTej/tUxPQ4i9q +ecsAIyjmHjdXNYmEwnZPNDatZ8POQQaIxffu2Bq41gt/UP+TqhdLjOztUmCypAbqTuv0axn96/Ua +4CUqmtzHQTb3yHQFhDmVOdYLO6Qn+gjYXB74BGBSESgoA//vU2YApUo0FmZ8/Qmkrp5nGm9BC2sG +E5uPhnEFtC+NiWYzKXZUmhH4J/qyP5Hgzg0b8zAarb8iXRvTvyUFTeGSGn+ZnzxEk8rUQElsgIfX +BDrDMlI1Dlb4pd19xIsNER9Tyx6yF7Zod1rg1MvIB671Oi6ON7fQAUtDKXeMOZePglr4UeWJoBjn +aH9dCi77o0cOPaYjesYBx4/IXr9tgFa+iiS6M+qf4TIRnvHST4D2G0CvOJ4RUHlzEhLN5mydLIhy +PDCBBpEi6lmt2hkuIsKNuYyH4Ga8cyNfIWRjgEj1oDwYPZTISEEdQLpe/v5WOaHIz16eGWRGENoX +kbcFgKyLmZJ956LYBws2J+dIeWCKw9cTXPhyQN9Ky8+ZAAoACxGV2lZFA4gKn2fQ1XmxqI1AbQ3C +ekD6819kR5LLU7m7Wc5P/dAVUwHY3+vZ5nbv0CO7O6l5s9UCKc2Jo5YPSjXnTkLAdc0Hz+Ys63su +-----END CERTIFICATE----- + +TÜRKTRUST Elektronik Sertifika Hizmet Sağlayıcısı H5 +==================================================== +-----BEGIN CERTIFICATE----- +MIIEJzCCAw+gAwIBAgIHAI4X/iQggTANBgkqhkiG9w0BAQsFADCBsTELMAkGA1UEBhMCVFIxDzAN +BgNVBAcMBkFua2FyYTFNMEsGA1UECgxEVMOcUktUUlVTVCBCaWxnaSDEsGxldGnFn2ltIHZlIEJp +bGnFn2ltIEfDvHZlbmxpxJ9pIEhpem1ldGxlcmkgQS7Fni4xQjBABgNVBAMMOVTDnFJLVFJVU1Qg +RWxla3Ryb25payBTZXJ0aWZpa2EgSGl6bWV0IFNhxJ9sYXnEsWPEsXPEsSBINTAeFw0xMzA0MzAw +ODA3MDFaFw0yMzA0MjgwODA3MDFaMIGxMQswCQYDVQQGEwJUUjEPMA0GA1UEBwwGQW5rYXJhMU0w +SwYDVQQKDERUw5xSS1RSVVNUIEJpbGdpIMSwbGV0acWfaW0gdmUgQmlsacWfaW0gR8O8dmVubGnE +n2kgSGl6bWV0bGVyaSBBLsWeLjFCMEAGA1UEAww5VMOcUktUUlVTVCBFbGVrdHJvbmlrIFNlcnRp +ZmlrYSBIaXptZXQgU2HEn2xhecSxY8Sxc8SxIEg1MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB +CgKCAQEApCUZ4WWe60ghUEoI5RHwWrom/4NZzkQqL/7hzmAD/I0Dpe3/a6i6zDQGn1k19uwsu537 +jVJp45wnEFPzpALFp/kRGml1bsMdi9GYjZOHp3GXDSHHmflS0yxjXVW86B8BSLlg/kJK9siArs1m +ep5Fimh34khon6La8eHBEJ/rPCmBp+EyCNSgBbGM+42WAA4+Jd9ThiI7/PS98wl+d+yG6w8z5UNP +9FR1bSmZLmZaQ9/LXMrI5Tjxfjs1nQ/0xVqhzPMggCTTV+wVunUlm+hkS7M0hO8EuPbJbKoCPrZV +4jI3X/xml1/N1p7HIL9Nxqw/dV8c7TKcfGkAaZHjIxhT6QIDAQABo0IwQDAdBgNVHQ4EFgQUVpkH +HtOsDGlktAxQR95DLL4gwPswDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZI +hvcNAQELBQADggEBAJ5FdnsXSDLyOIspve6WSk6BGLFRRyDN0GSxDsnZAdkJzsiZ3GglE9Rc8qPo +BP5yCccLqh0lVX6Wmle3usURehnmp349hQ71+S4pL+f5bFgWV1Al9j4uPqrtd3GqqpmWRgqujuwq +URawXs3qZwQcWDD1YIq9pr1N5Za0/EKJAWv2cMhQOQwt1WbZyNKzMrcbGW3LM/nfpeYVhDfwwvJl +lpKQd/Ct9JDpEXjXk4nAPQu6KfTomZ1yju2dL+6SfaHx/126M2CFYv4HAqGEVka+lgqaE9chTLd8 +B59OTj+RdPsnnRHM3eaxynFNExc5JsUpISuTKWqW+qtB4Uu2NQvAmxU= +-----END CERTIFICATE----- + +Certinomis - Root CA +==================== +-----BEGIN CERTIFICATE----- +MIIFkjCCA3qgAwIBAgIBATANBgkqhkiG9w0BAQsFADBaMQswCQYDVQQGEwJGUjETMBEGA1UEChMK +Q2VydGlub21pczEXMBUGA1UECxMOMDAwMiA0MzM5OTg5MDMxHTAbBgNVBAMTFENlcnRpbm9taXMg +LSBSb290IENBMB4XDTEzMTAyMTA5MTcxOFoXDTMzMTAyMTA5MTcxOFowWjELMAkGA1UEBhMCRlIx +EzARBgNVBAoTCkNlcnRpbm9taXMxFzAVBgNVBAsTDjAwMDIgNDMzOTk4OTAzMR0wGwYDVQQDExRD +ZXJ0aW5vbWlzIC0gUm9vdCBDQTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANTMCQos +P5L2fxSeC5yaah1AMGT9qt8OHgZbn1CF6s2Nq0Nn3rD6foCWnoR4kkjW4znuzuRZWJflLieY6pOo +d5tK8O90gC3rMB+12ceAnGInkYjwSond3IjmFPnVAy//ldu9n+ws+hQVWZUKxkd8aRi5pwP5ynap +z8dvtF4F/u7BUrJ1Mofs7SlmO/NKFoL21prbcpjp3vDFTKWrteoB4owuZH9kb/2jJZOLyKIOSY00 +8B/sWEUuNKqEUL3nskoTuLAPrjhdsKkb5nPJWqHZZkCqqU2mNAKthH6yI8H7KsZn9DS2sJVqM09x +RLWtwHkziOC/7aOgFLScCbAK42C++PhmiM1b8XcF4LVzbsF9Ri6OSyemzTUK/eVNfaoqoynHWmgE +6OXWk6RiwsXm9E/G+Z8ajYJJGYrKWUM66A0ywfRMEwNvbqY/kXPLynNvEiCL7sCCeN5LLsJJwx3t +FvYk9CcbXFcx3FXuqB5vbKziRcxXV4p1VxngtViZSTYxPDMBbRZKzbgqg4SGm/lg0h9tkQPTYKbV +PZrdd5A9NaSfD171UkRpucC63M9933zZxKyGIjK8e2uR73r4F2iw4lNVYC2vPsKD2NkJK/DAZNuH +i5HMkesE/Xa0lZrmFAYb1TQdvtj/dBxThZngWVJKYe2InmtJiUZ+IFrZ50rlau7SZRFDAgMBAAGj +YzBhMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTvkUz1pcMw6C8I +6tNxIqSSaHh02TAfBgNVHSMEGDAWgBTvkUz1pcMw6C8I6tNxIqSSaHh02TANBgkqhkiG9w0BAQsF +AAOCAgEAfj1U2iJdGlg+O1QnurrMyOMaauo++RLrVl89UM7g6kgmJs95Vn6RHJk/0KGRHCwPT5iV +WVO90CLYiF2cN/z7ZMF4jIuaYAnq1fohX9B0ZedQxb8uuQsLrbWwF6YSjNRieOpWauwK0kDDPAUw +Pk2Ut59KA9N9J0u2/kTO+hkzGm2kQtHdzMjI1xZSg081lLMSVX3l4kLr5JyTCcBMWwerx20RoFAX +lCOotQqSD7J6wWAsOMwaplv/8gzjqh8c3LigkyfeY+N/IZ865Z764BNqdeuWXGKRlI5nU7aJ+BIJ +y29SWwNyhlCVCNSNh4YVH5Uk2KRvms6knZtt0rJ2BobGVgjF6wnaNsIbW0G+YSrjcOa4pvi2WsS9 +Iff/ql+hbHY5ZtbqTFXhADObE5hjyW/QASAJN1LnDE8+zbz1X5YnpyACleAu6AdBBR8Vbtaw5Bng +DwKTACdyxYvRVB9dSsNAl35VpnzBMwQUAR1JIGkLGZOdblgi90AMRgwjY/M50n92Uaf0yKHxDHYi +I0ZSKS3io0EHVmmY0gUJvGnHWmHNj4FgFU2A3ZDifcRQ8ow7bkrHxuaAKzyBvBGAFhAn1/DNP3nM +cyrDflOR1m749fPH0FFNjkulW+YZFzvWgQncItzujrnEj1PhZ7szuIgVRs/taTX/dQ1G885x4cVr +hkIGuUE= +-----END CERTIFICATE----- + +OISTE WISeKey Global Root GB CA +=============================== +-----BEGIN CERTIFICATE----- +MIIDtTCCAp2gAwIBAgIQdrEgUnTwhYdGs/gjGvbCwDANBgkqhkiG9w0BAQsFADBtMQswCQYDVQQG +EwJDSDEQMA4GA1UEChMHV0lTZUtleTEiMCAGA1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNl +ZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBHbG9iYWwgUm9vdCBHQiBDQTAeFw0xNDEyMDExNTAw +MzJaFw0zOTEyMDExNTEwMzFaMG0xCzAJBgNVBAYTAkNIMRAwDgYDVQQKEwdXSVNlS2V5MSIwIAYD +VQQLExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBXSVNlS2V5IEds +b2JhbCBSb290IEdCIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2Be3HEokKtaX +scriHvt9OO+Y9bI5mE4nuBFde9IllIiCFSZqGzG7qFshISvYD06fWvGxWuR51jIjK+FTzJlFXHtP +rby/h0oLS5daqPZI7H17Dc0hBt+eFf1Biki3IPShehtX1F1Q/7pn2COZH8g/497/b1t3sWtuuMlk +9+HKQUYOKXHQuSP8yYFfTvdv37+ErXNku7dCjmn21HYdfp2nuFeKUWdy19SouJVUQHMD9ur06/4o +Qnc/nSMbsrY9gBQHTC5P99UKFg29ZkM3fiNDecNAhvVMKdqOmq0NpQSHiB6F4+lT1ZvIiwNjeOvg +GUpuuy9rM2RYk61pv48b74JIxwIDAQABo1EwTzALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB +/zAdBgNVHQ4EFgQUNQ/INmNe4qPs+TtmFc5RUuORmj0wEAYJKwYBBAGCNxUBBAMCAQAwDQYJKoZI +hvcNAQELBQADggEBAEBM+4eymYGQfp3FsLAmzYh7KzKNbrghcViXfa43FK8+5/ea4n32cZiZBKpD +dHij40lhPnOMTZTg+XHEthYOU3gf1qKHLwI5gSk8rxWYITD+KJAAjNHhy/peyP34EEY7onhCkRd0 +VQreUGdNZtGn//3ZwLWoo4rOZvUPQ82nK1d7Y0Zqqi5S2PTt4W2tKZB4SLrhI6qjiey1q5bAtEui +HZeeevJuQHHfaPFlTc58Bd9TZaml8LGXBHAVRgOY1NK/VLSgWH1Sb9pWJmLU2NuJMW8c8CLC02Ic +Nc1MaRVUGpCY3useX8p3x8uOPUNpnJpY0CQ73xtAln41rYHHTnG6iBM= +-----END CERTIFICATE----- + +Certification Authority of WoSign G2 +==================================== +-----BEGIN CERTIFICATE----- +MIIDfDCCAmSgAwIBAgIQayXaioidfLwPBbOxemFFRDANBgkqhkiG9w0BAQsFADBYMQswCQYDVQQG +EwJDTjEaMBgGA1UEChMRV29TaWduIENBIExpbWl0ZWQxLTArBgNVBAMTJENlcnRpZmljYXRpb24g +QXV0aG9yaXR5IG9mIFdvU2lnbiBHMjAeFw0xNDExMDgwMDU4NThaFw00NDExMDgwMDU4NThaMFgx +CzAJBgNVBAYTAkNOMRowGAYDVQQKExFXb1NpZ24gQ0EgTGltaXRlZDEtMCsGA1UEAxMkQ2VydGlm +aWNhdGlvbiBBdXRob3JpdHkgb2YgV29TaWduIEcyMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB +CgKCAQEAvsXEoCKASU+/2YcRxlPhuw+9YH+v9oIOH9ywjj2X4FA8jzrvZjtFB5sg+OPXJYY1kBai +XW8wGQiHC38Gsp1ij96vkqVg1CuAmlI/9ZqD6TRay9nVYlzmDuDfBpgOgHzKtB0TiGsOqCR3A9Du +W/PKaZE1OVbFbeP3PU9ekzgkyhjpJMuSA93MHD0JcOQg5PGurLtzaaNjOg9FD6FKmsLRY6zLEPg9 +5k4ot+vElbGs/V6r+kHLXZ1L3PR8du9nfwB6jdKgGlxNIuG12t12s9R23164i5jIFFTMaxeSt+BK +v0mUYQs4kI9dJGwlezt52eJ+na2fmKEG/HgUYFf47oB3sQIDAQABo0IwQDAOBgNVHQ8BAf8EBAMC +AQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU+mCp62XF3RYUCE4MD42b4Pdkr2cwDQYJKoZI +hvcNAQELBQADggEBAFfDejaCnI2Y4qtAqkePx6db7XznPWZaOzG73/MWM5H8fHulwqZm46qwtyeY +P0nXYGdnPzZPSsvxFPpahygc7Y9BMsaV+X3avXtbwrAh449G3CE4Q3RM+zD4F3LBMvzIkRfEzFg3 +TgvMWvchNSiDbGAtROtSjFA9tWwS1/oJu2yySrHFieT801LYYRf+epSEj3m2M1m6D8QL4nCgS3gu ++sif/a+RZQp4OBXllxcU3fngLDT4ONCEIgDAFFEYKwLcMFrw6AF8NTojrwjkr6qOKEJJLvD1mTS+ +7Q9LGOHSJDy7XUe3IfKN0QqZjuNuPq1w4I+5ysxugTH2e5x6eeRncRg= +-----END CERTIFICATE----- + +CA WoSign ECC Root +================== +-----BEGIN CERTIFICATE----- +MIICCTCCAY+gAwIBAgIQaEpYcIBr8I8C+vbe6LCQkDAKBggqhkjOPQQDAzBGMQswCQYDVQQGEwJD +TjEaMBgGA1UEChMRV29TaWduIENBIExpbWl0ZWQxGzAZBgNVBAMTEkNBIFdvU2lnbiBFQ0MgUm9v +dDAeFw0xNDExMDgwMDU4NThaFw00NDExMDgwMDU4NThaMEYxCzAJBgNVBAYTAkNOMRowGAYDVQQK +ExFXb1NpZ24gQ0EgTGltaXRlZDEbMBkGA1UEAxMSQ0EgV29TaWduIEVDQyBSb290MHYwEAYHKoZI +zj0CAQYFK4EEACIDYgAE4f2OuEMkq5Z7hcK6C62N4DrjJLnSsb6IOsq/Srj57ywvr1FQPEd1bPiU +t5v8KB7FVMxjnRZLU8HnIKvNrCXSf4/CwVqCXjCLelTOA7WRf6qU0NGKSMyCBSah1VES1ns2o0Iw +QDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUqv3VWqP2h4syhf3R +MluARZPzA7gwCgYIKoZIzj0EAwMDaAAwZQIxAOSkhLCB1T2wdKyUpOgOPQB0TKGXa/kNUTyh2Tv0 +Daupn75OcsqF1NnstTJFGG+rrQIwfcf3aWMvoeGY7xMQ0Xk/0f7qO3/eVvSQsRUR2LIiFdAvwyYu +a/GRspBl9JrmkO5K +-----END CERTIFICATE----- + +SZAFIR ROOT CA2 +=============== +-----BEGIN CERTIFICATE----- +MIIDcjCCAlqgAwIBAgIUPopdB+xV0jLVt+O2XwHrLdzk1uQwDQYJKoZIhvcNAQELBQAwUTELMAkG +A1UEBhMCUEwxKDAmBgNVBAoMH0tyYWpvd2EgSXpiYSBSb3psaWN6ZW5pb3dhIFMuQS4xGDAWBgNV +BAMMD1NaQUZJUiBST09UIENBMjAeFw0xNTEwMTkwNzQzMzBaFw0zNTEwMTkwNzQzMzBaMFExCzAJ +BgNVBAYTAlBMMSgwJgYDVQQKDB9LcmFqb3dhIEl6YmEgUm96bGljemVuaW93YSBTLkEuMRgwFgYD +VQQDDA9TWkFGSVIgUk9PVCBDQTIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC3vD5Q +qEvNQLXOYeeWyrSh2gwisPq1e3YAd4wLz32ohswmUeQgPYUM1ljj5/QqGJ3a0a4m7utT3PSQ1hNK +DJA8w/Ta0o4NkjrcsbH/ON7Dui1fgLkCvUqdGw+0w8LBZwPd3BucPbOw3gAeqDRHu5rr/gsUvTaE +2g0gv/pby6kWIK05YO4vdbbnl5z5Pv1+TW9NL++IDWr63fE9biCloBK0TXC5ztdyO4mTp4CEHCdJ +ckm1/zuVnsHMyAHs6A6KCpbns6aH5db5BSsNl0BwPLqsdVqc1U2dAgrSS5tmS0YHF2Wtn2yIANwi +ieDhZNRnvDF5YTy7ykHNXGoAyDw4jlivAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0P +AQH/BAQDAgEGMB0GA1UdDgQWBBQuFqlKGLXLzPVvUPMjX/hd56zwyDANBgkqhkiG9w0BAQsFAAOC +AQEAtXP4A9xZWx126aMqe5Aosk3AM0+qmrHUuOQn/6mWmc5G4G18TKI4pAZw8PRBEew/R40/cof5 +O/2kbytTAOD/OblqBw7rHRz2onKQy4I9EYKL0rufKq8h5mOGnXkZ7/e7DDWQw4rtTw/1zBLZpD67 +oPwglV9PJi8RI4NOdQcPv5vRtB3pEAT+ymCPoky4rc/hkA/NrgrHXXu3UNLUYfrVFdvXn4dRVOul +4+vJhaAlIDf7js4MNIThPIGyd05DpYhfhmehPea0XGG2Ptv+tyjFogeutcrKjSoS75ftwjCkySp6 ++/NNIxuZMzSgLvWpCz/UXeHPhJ/iGcJfitYgHuNztw== +-----END CERTIFICATE----- + +Certum Trusted Network CA 2 +=========================== +-----BEGIN CERTIFICATE----- +MIIF0jCCA7qgAwIBAgIQIdbQSk8lD8kyN/yqXhKN6TANBgkqhkiG9w0BAQ0FADCBgDELMAkGA1UE +BhMCUEwxIjAgBgNVBAoTGVVuaXpldG8gVGVjaG5vbG9naWVzIFMuQS4xJzAlBgNVBAsTHkNlcnR1 +bSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEkMCIGA1UEAxMbQ2VydHVtIFRydXN0ZWQgTmV0d29y +ayBDQSAyMCIYDzIwMTExMDA2MDgzOTU2WhgPMjA0NjEwMDYwODM5NTZaMIGAMQswCQYDVQQGEwJQ +TDEiMCAGA1UEChMZVW5pemV0byBUZWNobm9sb2dpZXMgUy5BLjEnMCUGA1UECxMeQ2VydHVtIENl +cnRpZmljYXRpb24gQXV0aG9yaXR5MSQwIgYDVQQDExtDZXJ0dW0gVHJ1c3RlZCBOZXR3b3JrIENB +IDIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC9+Xj45tWADGSdhhuWZGc/IjoedQF9 +7/tcZ4zJzFxrqZHmuULlIEub2pt7uZld2ZuAS9eEQCsn0+i6MLs+CRqnSZXvK0AkwpfHp+6bJe+o +CgCXhVqqndwpyeI1B+twTUrWwbNWuKFBOJvR+zF/j+Bf4bE/D44WSWDXBo0Y+aomEKsq09DRZ40b +Rr5HMNUuctHFY9rnY3lEfktjJImGLjQ/KUxSiyqnwOKRKIm5wFv5HdnnJ63/mgKXwcZQkpsCLL2p +uTRZCr+ESv/f/rOf69me4Jgj7KZrdxYq28ytOxykh9xGc14ZYmhFV+SQgkK7QtbwYeDBoz1mo130 +GO6IyY0XRSmZMnUCMe4pJshrAua1YkV/NxVaI2iJ1D7eTiew8EAMvE0Xy02isx7QBlrd9pPPV3WZ +9fqGGmd4s7+W/jTcvedSVuWz5XV710GRBdxdaeOVDUO5/IOWOZV7bIBaTxNyxtd9KXpEulKkKtVB +Rgkg/iKgtlswjbyJDNXXcPiHUv3a76xRLgezTv7QCdpw75j6VuZt27VXS9zlLCUVyJ4ueE742pye +hizKV/Ma5ciSixqClnrDvFASadgOWkaLOusm+iPJtrCBvkIApPjW/jAux9JG9uWOdf3yzLnQh1vM +BhBgu4M1t15n3kfsmUjxpKEV/q2MYo45VU85FrmxY53/twIDAQABo0IwQDAPBgNVHRMBAf8EBTAD +AQH/MB0GA1UdDgQWBBS2oVQ5AsOgP46KvPrU+Bym0ToO/TAOBgNVHQ8BAf8EBAMCAQYwDQYJKoZI +hvcNAQENBQADggIBAHGlDs7k6b8/ONWJWsQCYftMxRQXLYtPU2sQF/xlhMcQSZDe28cmk4gmb3DW +Al45oPePq5a1pRNcgRRtDoGCERuKTsZPpd1iHkTfCVn0W3cLN+mLIMb4Ck4uWBzrM9DPhmDJ2vuA +L55MYIR4PSFk1vtBHxgP58l1cb29XN40hz5BsA72udY/CROWFC/emh1auVbONTqwX3BNXuMp8SMo +clm2q8KMZiYcdywmdjWLKKdpoPk79SPdhRB0yZADVpHnr7pH1BKXESLjokmUbOe3lEu6LaTaM4tM +pkT/WjzGHWTYtTHkpjx6qFcL2+1hGsvxznN3Y6SHb0xRONbkX8eftoEq5IVIeVheO/jbAoJnwTnb +w3RLPTYe+SmTiGhbqEQZIfCn6IENLOiTNrQ3ssqwGyZ6miUfmpqAnksqP/ujmv5zMnHCnsZy4Ypo +J/HkD7TETKVhk/iXEAcqMCWpuchxuO9ozC1+9eB+D4Kob7a6bINDd82Kkhehnlt4Fj1F4jNy3eFm +ypnTycUm/Q1oBEauttmbjL4ZvrHG8hnjXALKLNhvSgfZyTXaQHXyxKcZb55CEJh15pWLYLztxRLX +is7VmFxWlgPF7ncGNf/P5O4/E2Hu29othfDNrp2yGAlFw5Khchf8R7agCyzxxN5DaAhqXzvwdmP7 +zAYspsbiDrW5viSP +-----END CERTIFICATE----- + +Hellenic Academic and Research Institutions RootCA 2015 +======================================================= +-----BEGIN CERTIFICATE----- +MIIGCzCCA/OgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBpjELMAkGA1UEBhMCR1IxDzANBgNVBAcT +BkF0aGVuczFEMEIGA1UEChM7SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNoIEluc3RpdHV0 +aW9ucyBDZXJ0LiBBdXRob3JpdHkxQDA+BgNVBAMTN0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNl +YXJjaCBJbnN0aXR1dGlvbnMgUm9vdENBIDIwMTUwHhcNMTUwNzA3MTAxMTIxWhcNNDAwNjMwMTAx +MTIxWjCBpjELMAkGA1UEBhMCR1IxDzANBgNVBAcTBkF0aGVuczFEMEIGA1UEChM7SGVsbGVuaWMg +QWNhZGVtaWMgYW5kIFJlc2VhcmNoIEluc3RpdHV0aW9ucyBDZXJ0LiBBdXRob3JpdHkxQDA+BgNV +BAMTN0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgUm9vdENBIDIw +MTUwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDC+Kk/G4n8PDwEXT2QNrCROnk8Zlrv +bTkBSRq0t89/TSNTt5AA4xMqKKYx8ZEA4yjsriFBzh/a/X0SWwGDD7mwX5nh8hKDgE0GPt+sr+eh +iGsxr/CL0BgzuNtFajT0AoAkKAoCFZVedioNmToUW/bLy1O8E00BiDeUJRtCvCLYjqOWXjrZMts+ +6PAQZe104S+nfK8nNLspfZu2zwnI5dMK/IhlZXQK3HMcXM1AsRzUtoSMTFDPaI6oWa7CJ06CojXd +FPQf/7J31Ycvqm59JCfnxssm5uX+Zwdj2EUN3TpZZTlYepKZcj2chF6IIbjV9Cz82XBST3i4vTwr +i5WY9bPRaM8gFH5MXF/ni+X1NYEZN9cRCLdmvtNKzoNXADrDgfgXy5I2XdGj2HUb4Ysn6npIQf1F +GQatJ5lOwXBH3bWfgVMS5bGMSF0xQxfjjMZ6Y5ZLKTBOhE5iGV48zpeQpX8B653g+IuJ3SWYPZK2 +fu/Z8VFRfS0myGlZYeCsargqNhEEelC9MoS+L9xy1dcdFkfkR2YgP/SWxa+OAXqlD3pk9Q0Yh9mu +iNX6hME6wGkoLfINaFGq46V3xqSQDqE3izEjR8EJCOtu93ib14L8hCCZSRm2Ekax+0VVFqmjZayc +Bw/qa9wfLgZy7IaIEuQt218FL+TwA9MmM+eAws1CoRc0CwIDAQABo0IwQDAPBgNVHRMBAf8EBTAD +AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUcRVnyMjJvXVdctA4GGqd83EkVAswDQYJKoZI +hvcNAQELBQADggIBAHW7bVRLqhBYRjTyYtcWNl0IXtVsyIe9tC5G8jH4fOpCtZMWVdyhDBKg2mF+ +D1hYc2Ryx+hFjtyp8iY/xnmMsVMIM4GwVhO+5lFc2JsKT0ucVlMC6U/2DWDqTUJV6HwbISHTGzrM +d/K4kPFox/la/vot9L/J9UUbzjgQKjeKeaO04wlshYaT/4mWJ3iBj2fjRnRUjtkNaeJK9E10A/+y +d+2VZ5fkscWrv2oj6NSU4kQoYsRL4vDY4ilrGnB+JGGTe08DMiUNRSQrlrRGar9KC/eaj8GsGsVn +82800vpzY4zvFrCopEYq+OsS7HK07/grfoxSwIuEVPkvPuNVqNxmsdnhX9izjFk0WaSrT2y7Hxjb +davYy5LNlDhhDgcGH0tGEPEVvo2FXDtKK4F5D7Rpn0lQl033DlZdwJVqwjbDG2jJ9SrcR5q+ss7F +Jej6A7na+RZukYT1HCjI/CbM1xyQVqdfbzoEvM14iQuODy+jqk+iGxI9FghAD/FGTNeqewjBCvVt +J94Cj8rDtSvK6evIIVM4pcw72Hc3MKJP2W/R8kCtQXoXxdZKNYm3QdV8hn9VTYNKpXMgwDqvkPGa +JI7ZjnHKe7iG2rKPmT4dEw0SEe7Uq/DpFXYC5ODfqiAeW2GFZECpkJcNrVPSWh2HagCXZWK0vm9q +p/UsQu0yrbYhnr68 +-----END CERTIFICATE----- + +Hellenic Academic and Research Institutions ECC RootCA 2015 +=========================================================== +-----BEGIN CERTIFICATE----- +MIICwzCCAkqgAwIBAgIBADAKBggqhkjOPQQDAjCBqjELMAkGA1UEBhMCR1IxDzANBgNVBAcTBkF0 +aGVuczFEMEIGA1UEChM7SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNoIEluc3RpdHV0aW9u +cyBDZXJ0LiBBdXRob3JpdHkxRDBCBgNVBAMTO0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJj +aCBJbnN0aXR1dGlvbnMgRUNDIFJvb3RDQSAyMDE1MB4XDTE1MDcwNzEwMzcxMloXDTQwMDYzMDEw +MzcxMlowgaoxCzAJBgNVBAYTAkdSMQ8wDQYDVQQHEwZBdGhlbnMxRDBCBgNVBAoTO0hlbGxlbmlj +IEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgQ2VydC4gQXV0aG9yaXR5MUQwQgYD +VQQDEztIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25zIEVDQyBSb290 +Q0EgMjAxNTB2MBAGByqGSM49AgEGBSuBBAAiA2IABJKgQehLgoRc4vgxEZmGZE4JJS+dQS8KrjVP +dJWyUWRrjWvmP3CV8AVER6ZyOFB2lQJajq4onvktTpnvLEhvTCUp6NFxW98dwXU3tNf6e3pCnGoK +Vlp8aQuqgAkkbH7BRqNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0O +BBYEFLQiC4KZJAEOnLvkDv2/+5cgk5kqMAoGCCqGSM49BAMCA2cAMGQCMGfOFmI4oqxiRaeplSTA +GiecMjvAwNW6qef4BENThe5SId6d9SWDPp5YSy/XZxMOIQIwBeF1Ad5o7SofTUwJCA3sS61kFyjn +dc5FZXIhF8siQQ6ME5g4mlRtm8rifOoCWCKR +-----END CERTIFICATE----- + +Certplus Root CA G1 +=================== +-----BEGIN CERTIFICATE----- +MIIFazCCA1OgAwIBAgISESBVg+QtPlRWhS2DN7cs3EYRMA0GCSqGSIb3DQEBDQUAMD4xCzAJBgNV +BAYTAkZSMREwDwYDVQQKDAhDZXJ0cGx1czEcMBoGA1UEAwwTQ2VydHBsdXMgUm9vdCBDQSBHMTAe +Fw0xNDA1MjYwMDAwMDBaFw0zODAxMTUwMDAwMDBaMD4xCzAJBgNVBAYTAkZSMREwDwYDVQQKDAhD +ZXJ0cGx1czEcMBoGA1UEAwwTQ2VydHBsdXMgUm9vdCBDQSBHMTCCAiIwDQYJKoZIhvcNAQEBBQAD +ggIPADCCAgoCggIBANpQh7bauKk+nWT6VjOaVj0W5QOVsjQcmm1iBdTYj+eJZJ+622SLZOZ5KmHN +r49aiZFluVj8tANfkT8tEBXgfs+8/H9DZ6itXjYj2JizTfNDnjl8KvzsiNWI7nC9hRYt6kuJPKNx +Qv4c/dMcLRC4hlTqQ7jbxofaqK6AJc96Jh2qkbBIb6613p7Y1/oA/caP0FG7Yn2ksYyy/yARujVj +BYZHYEMzkPZHogNPlk2dT8Hq6pyi/jQu3rfKG3akt62f6ajUeD94/vI4CTYd0hYCyOwqaK/1jpTv +LRN6HkJKHRUxrgwEV/xhc/MxVoYxgKDEEW4wduOU8F8ExKyHcomYxZ3MVwia9Az8fXoFOvpHgDm2 +z4QTd28n6v+WZxcIbekN1iNQMLAVdBM+5S//Ds3EC0pd8NgAM0lm66EYfFkuPSi5YXHLtaW6uOrc +4nBvCGrch2c0798wct3zyT8j/zXhviEpIDCB5BmlIOklynMxdCm+4kLV87ImZsdo/Rmz5yCTmehd +4F6H50boJZwKKSTUzViGUkAksnsPmBIgJPaQbEfIDbsYIC7Z/fyL8inqh3SV4EJQeIQEQWGw9CEj +jy3LKCHyamz0GqbFFLQ3ZU+V/YDI+HLlJWvEYLF7bY5KinPOWftwenMGE9nTdDckQQoRb5fc5+R+ +ob0V8rqHDz1oihYHAgMBAAGjYzBhMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0G +A1UdDgQWBBSowcCbkahDFXxdBie0KlHYlwuBsTAfBgNVHSMEGDAWgBSowcCbkahDFXxdBie0KlHY +lwuBsTANBgkqhkiG9w0BAQ0FAAOCAgEAnFZvAX7RvUz1isbwJh/k4DgYzDLDKTudQSk0YcbX8ACh +66Ryj5QXvBMsdbRX7gp8CXrc1cqh0DQT+Hern+X+2B50ioUHj3/MeXrKls3N/U/7/SMNkPX0XtPG +YX2eEeAC7gkE2Qfdpoq3DIMku4NQkv5gdRE+2J2winq14J2by5BSS7CTKtQ+FjPlnsZlFT5kOwQ/ +2wyPX1wdaR+v8+khjPPvl/aatxm2hHSco1S1cE5j2FddUyGbQJJD+tZ3VTNPZNX70Cxqjm0lpu+F +6ALEUz65noe8zDUa3qHpimOHZR4RKttjd5cUvpoUmRGywO6wT/gUITJDT5+rosuoD6o7BlXGEilX +CNQ314cnrUlZp5GrRHpejXDbl85IULFzk/bwg2D5zfHhMf1bfHEhYxQUqq/F3pN+aLHsIqKqkHWe +tUNy6mSjhEv9DKgma3GX7lZjZuhCVPnHHd/Qj1vfyDBviP4NxDMcU6ij/UgQ8uQKTuEVV/xuZDDC +VRHc6qnNSlSsKWNEz0pAoNZoWRsz+e86i9sgktxChL8Bq4fA1SCC28a5g4VCXA9DO2pJNdWY9BW/ ++mGBDAkgGNLQFwzLSABQ6XaCjGTXOqAHVcweMcDvOrRl++O/QmueD6i9a5jc2NvLi6Td11n0bt3+ +qsOR0C5CB8AMTVPNJLFMWx5R9N/pkvo= +-----END CERTIFICATE----- + +Certplus Root CA G2 +=================== +-----BEGIN CERTIFICATE----- +MIICHDCCAaKgAwIBAgISESDZkc6uo+jF5//pAq/Pc7xVMAoGCCqGSM49BAMDMD4xCzAJBgNVBAYT +AkZSMREwDwYDVQQKDAhDZXJ0cGx1czEcMBoGA1UEAwwTQ2VydHBsdXMgUm9vdCBDQSBHMjAeFw0x +NDA1MjYwMDAwMDBaFw0zODAxMTUwMDAwMDBaMD4xCzAJBgNVBAYTAkZSMREwDwYDVQQKDAhDZXJ0 +cGx1czEcMBoGA1UEAwwTQ2VydHBsdXMgUm9vdCBDQSBHMjB2MBAGByqGSM49AgEGBSuBBAAiA2IA +BM0PW1aC3/BFGtat93nwHcmsltaeTpwftEIRyoa/bfuFo8XlGVzX7qY/aWfYeOKmycTbLXku54uN +Am8xIk0G42ByRZ0OQneezs/lf4WbGOT8zC5y0xaTTsqZY1yhBSpsBqNjMGEwDgYDVR0PAQH/BAQD +AgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNqDYwJ5jtpMxjwjFNiPwyCrKGBZMB8GA1Ud +IwQYMBaAFNqDYwJ5jtpMxjwjFNiPwyCrKGBZMAoGCCqGSM49BAMDA2gAMGUCMHD+sAvZ94OX7PNV +HdTcswYO/jOYnYs5kGuUIe22113WTNchp+e/IQ8rzfcq3IUHnQIxAIYUFuXcsGXCwI4Un78kFmjl +vPl5adytRSv3tjFzzAalU5ORGpOucGpnutee5WEaXw== +-----END CERTIFICATE----- + +OpenTrust Root CA G1 +==================== +-----BEGIN CERTIFICATE----- +MIIFbzCCA1egAwIBAgISESCzkFU5fX82bWTCp59rY45nMA0GCSqGSIb3DQEBCwUAMEAxCzAJBgNV +BAYTAkZSMRIwEAYDVQQKDAlPcGVuVHJ1c3QxHTAbBgNVBAMMFE9wZW5UcnVzdCBSb290IENBIEcx +MB4XDTE0MDUyNjA4NDU1MFoXDTM4MDExNTAwMDAwMFowQDELMAkGA1UEBhMCRlIxEjAQBgNVBAoM +CU9wZW5UcnVzdDEdMBsGA1UEAwwUT3BlblRydXN0IFJvb3QgQ0EgRzEwggIiMA0GCSqGSIb3DQEB +AQUAA4ICDwAwggIKAoICAQD4eUbalsUwXopxAy1wpLuwxQjczeY1wICkES3d5oeuXT2R0odsN7fa +Yp6bwiTXj/HbpqbfRm9RpnHLPhsxZ2L3EVs0J9V5ToybWL0iEA1cJwzdMOWo010hOHQX/uMftk87 +ay3bfWAfjH1MBcLrARYVmBSO0ZB3Ij/swjm4eTrwSSTilZHcYTSSjFR077F9jAHiOH3BX2pfJLKO +YheteSCtqx234LSWSE9mQxAGFiQD4eCcjsZGT44ameGPuY4zbGneWK2gDqdkVBFpRGZPTBKnjix9 +xNRbxQA0MMHZmf4yzgeEtE7NCv82TWLxp2NX5Ntqp66/K7nJ5rInieV+mhxNaMbBGN4zK1FGSxyO +9z0M+Yo0FMT7MzUj8czxKselu7Cizv5Ta01BG2Yospb6p64KTrk5M0ScdMGTHPjgniQlQ/GbI4Kq +3ywgsNw2TgOzfALU5nsaqocTvz6hdLubDuHAk5/XpGbKuxs74zD0M1mKB3IDVedzagMxbm+WG+Oi +n6+Sx+31QrclTDsTBM8clq8cIqPQqwWyTBIjUtz9GVsnnB47ev1CI9sjgBPwvFEVVJSmdz7QdFG9 +URQIOTfLHzSpMJ1ShC5VkLG631UAC9hWLbFJSXKAqWLXwPYYEQRVzXR7z2FwefR7LFxckvzluFqr +TJOVoSfupb7PcSNCupt2LQIDAQABo2MwYTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB +/zAdBgNVHQ4EFgQUl0YhVyE12jZVx/PxN3DlCPaTKbYwHwYDVR0jBBgwFoAUl0YhVyE12jZVx/Px +N3DlCPaTKbYwDQYJKoZIhvcNAQELBQADggIBAB3dAmB84DWn5ph76kTOZ0BP8pNuZtQ5iSas000E +PLuHIT839HEl2ku6q5aCgZG27dmxpGWX4m9kWaSW7mDKHyP7Rbr/jyTwyqkxf3kfgLMtMrpkZ2Cv +uVnN35pJ06iCsfmYlIrM4LvgBBuZYLFGZdwIorJGnkSI6pN+VxbSFXJfLkur1J1juONI5f6ELlgK +n0Md/rcYkoZDSw6cMoYsYPXpSOqV7XAp8dUv/TW0V8/bhUiZucJvbI/NeJWsZCj9VrDDb8O+WVLh +X4SPgPL0DTatdrOjteFkdjpY3H1PXlZs5VVZV6Xf8YpmMIzUUmI4d7S+KNfKNsSbBfD4Fdvb8e80 +nR14SohWZ25g/4/Ii+GOvUKpMwpZQhISKvqxnUOOBZuZ2mKtVzazHbYNeS2WuOvyDEsMpZTGMKcm +GS3tTAZQMPH9WD25SxdfGbRqhFS0OE85og2WaMMolP3tLR9Ka0OWLpABEPs4poEL0L9109S5zvE/ +bw4cHjdx5RiHdRk/ULlepEU0rbDK5uUTdg8xFKmOLZTW1YVNcxVPS/KyPu1svf0OnWZzsD2097+o +4BGkxK51CUpjAEggpsadCwmKtODmzj7HPiY46SvepghJAwSQiumPv+i2tCqjI40cHLI5kqiPAlxA +OXXUc0ECd97N4EOH1uS6SsNsEn/+KuYj1oxx +-----END CERTIFICATE----- + +OpenTrust Root CA G2 +==================== +-----BEGIN CERTIFICATE----- +MIIFbzCCA1egAwIBAgISESChaRu/vbm9UpaPI+hIvyYRMA0GCSqGSIb3DQEBDQUAMEAxCzAJBgNV +BAYTAkZSMRIwEAYDVQQKDAlPcGVuVHJ1c3QxHTAbBgNVBAMMFE9wZW5UcnVzdCBSb290IENBIEcy +MB4XDTE0MDUyNjAwMDAwMFoXDTM4MDExNTAwMDAwMFowQDELMAkGA1UEBhMCRlIxEjAQBgNVBAoM +CU9wZW5UcnVzdDEdMBsGA1UEAwwUT3BlblRydXN0IFJvb3QgQ0EgRzIwggIiMA0GCSqGSIb3DQEB +AQUAA4ICDwAwggIKAoICAQDMtlelM5QQgTJT32F+D3Y5z1zCU3UdSXqWON2ic2rxb95eolq5cSG+ +Ntmh/LzubKh8NBpxGuga2F8ORAbtp+Dz0mEL4DKiltE48MLaARf85KxP6O6JHnSrT78eCbY2albz +4e6WiWYkBuTNQjpK3eCasMSCRbP+yatcfD7J6xcvDH1urqWPyKwlCm/61UWY0jUJ9gNDlP7ZvyCV +eYCYitmJNbtRG6Q3ffyZO6v/v6wNj0OxmXsWEH4db0fEFY8ElggGQgT4hNYdvJGmQr5J1WqIP7wt +UdGejeBSzFfdNTVY27SPJIjki9/ca1TSgSuyzpJLHB9G+h3Ykst2Z7UJmQnlrBcUVXDGPKBWCgOz +3GIZ38i1MH/1PCZ1Eb3XG7OHngevZXHloM8apwkQHZOJZlvoPGIytbU6bumFAYueQ4xncyhZW+vj +3CzMpSZyYhK05pyDRPZRpOLAeiRXyg6lPzq1O4vldu5w5pLeFlwoW5cZJ5L+epJUzpM5ChaHvGOz +9bGTXOBut9Dq+WIyiET7vycotjCVXRIouZW+j1MY5aIYFuJWpLIsEPUdN6b4t/bQWVyJ98LVtZR0 +0dX+G7bw5tYee9I8y6jj9RjzIR9u701oBnstXW5DiabA+aC/gh7PU3+06yzbXfZqfUAkBXKJOAGT +y3HCOV0GEfZvePg3DTmEJwIDAQABo2MwYTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB +/zAdBgNVHQ4EFgQUajn6QiL35okATV59M4PLuG53hq8wHwYDVR0jBBgwFoAUajn6QiL35okATV59 +M4PLuG53hq8wDQYJKoZIhvcNAQENBQADggIBAJjLq0A85TMCl38th6aP1F5Kr7ge57tx+4BkJamz +Gj5oXScmp7oq4fBXgwpkTx4idBvpkF/wrM//T2h6OKQQbA2xx6R3gBi2oihEdqc0nXGEL8pZ0keI +mUEiyTCYYW49qKgFbdEfwFFEVn8nNQLdXpgKQuswv42hm1GqO+qTRmTFAHneIWv2V6CG1wZy7HBG +S4tz3aAhdT7cHcCP009zHIXZ/n9iyJVvttN7jLpTwm+bREx50B1ws9efAvSyB7DH5fitIw6mVskp +EndI2S9G/Tvw/HRwkqWOOAgfZDC2t0v7NqwQjqBSM2OdAzVWxWm9xiNaJ5T2pBL4LTM8oValX9YZ +6e18CL13zSdkzJTaTkZQh+D5wVOAHrut+0dSixv9ovneDiK3PTNZbNTe9ZUGMg1RGUFcPk8G97kr +gCf2o6p6fAbhQ8MTOWIaNr3gKC6UAuQpLmBVrkA9sHSSXvAgZJY/X0VdiLWK2gKgW0VU3jg9CcCo +SmVGFvyqv1ROTVu+OEO3KMqLM6oaJbolXCkvW0pujOotnCr2BXbgd5eAiN1nE28daCSLT7d0geX0 +YJ96Vdc+N9oWaz53rK4YcJUIeSkDiv7BO7M/Gg+kO14fWKGVyasvc0rQLW6aWQ9VGHgtPFGml4vm +u7JwqkwR3v98KzfUetF3NI/n+UL3PIEMS1IK +-----END CERTIFICATE----- + +OpenTrust Root CA G3 +==================== +-----BEGIN CERTIFICATE----- +MIICITCCAaagAwIBAgISESDm+Ez8JLC+BUCs2oMbNGA/MAoGCCqGSM49BAMDMEAxCzAJBgNVBAYT +AkZSMRIwEAYDVQQKDAlPcGVuVHJ1c3QxHTAbBgNVBAMMFE9wZW5UcnVzdCBSb290IENBIEczMB4X +DTE0MDUyNjAwMDAwMFoXDTM4MDExNTAwMDAwMFowQDELMAkGA1UEBhMCRlIxEjAQBgNVBAoMCU9w +ZW5UcnVzdDEdMBsGA1UEAwwUT3BlblRydXN0IFJvb3QgQ0EgRzMwdjAQBgcqhkjOPQIBBgUrgQQA +IgNiAARK7liuTcpm3gY6oxH84Bjwbhy6LTAMidnW7ptzg6kjFYwvWYpa3RTqnVkrQ7cG7DK2uu5B +ta1doYXM6h0UZqNnfkbilPPntlahFVmhTzeXuSIevRHr9LIfXsMUmuXZl5mjYzBhMA4GA1UdDwEB +/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRHd8MUi2I5DMlv4VBN0BBY3JWIbTAf +BgNVHSMEGDAWgBRHd8MUi2I5DMlv4VBN0BBY3JWIbTAKBggqhkjOPQQDAwNpADBmAjEAj6jcnboM +BBf6Fek9LykBl7+BFjNAk2z8+e2AcG+qj9uEwov1NcoG3GRvaBbhj5G5AjEA2Euly8LQCGzpGPta +3U1fJAuwACEl74+nBCZx4nxp5V2a+EEfOzmTk51V6s2N8fvB +-----END CERTIFICATE----- + +ISRG Root X1 +============ +-----BEGIN CERTIFICATE----- +MIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAwTzELMAkGA1UE +BhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2VhcmNoIEdyb3VwMRUwEwYDVQQD +EwxJU1JHIFJvb3QgWDEwHhcNMTUwNjA0MTEwNDM4WhcNMzUwNjA0MTEwNDM4WjBPMQswCQYDVQQG +EwJVUzEpMCcGA1UEChMgSW50ZXJuZXQgU2VjdXJpdHkgUmVzZWFyY2ggR3JvdXAxFTATBgNVBAMT +DElTUkcgUm9vdCBYMTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAK3oJHP0FDfzm54r +Vygch77ct984kIxuPOZXoHj3dcKi/vVqbvYATyjb3miGbESTtrFj/RQSa78f0uoxmyF+0TM8ukj1 +3Xnfs7j/EvEhmkvBioZxaUpmZmyPfjxwv60pIgbz5MDmgK7iS4+3mX6UA5/TR5d8mUgjU+g4rk8K +b4Mu0UlXjIB0ttov0DiNewNwIRt18jA8+o+u3dpjq+sWT8KOEUt+zwvo/7V3LvSye0rgTBIlDHCN +Aymg4VMk7BPZ7hm/ELNKjD+Jo2FR3qyHB5T0Y3HsLuJvW5iB4YlcNHlsdu87kGJ55tukmi8mxdAQ +4Q7e2RCOFvu396j3x+UCB5iPNgiV5+I3lg02dZ77DnKxHZu8A/lJBdiB3QW0KtZB6awBdpUKD9jf +1b0SHzUvKBds0pjBqAlkd25HN7rOrFleaJ1/ctaJxQZBKT5ZPt0m9STJEadao0xAH0ahmbWnOlFu +hjuefXKnEgV4We0+UXgVCwOPjdAvBbI+e0ocS3MFEvzG6uBQE3xDk3SzynTnjh8BCNAw1FtxNrQH +usEwMFxIt4I7mKZ9YIqioymCzLq9gwQbooMDQaHWBfEbwrbwqHyGO0aoSCqI3Haadr8faqU9GY/r +OPNk3sgrDQoo//fb4hVC1CLQJ13hef4Y53CIrU7m2Ys6xt0nUW7/vGT1M0NPAgMBAAGjQjBAMA4G +A1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBR5tFnme7bl5AFzgAiIyBpY +9umbbjANBgkqhkiG9w0BAQsFAAOCAgEAVR9YqbyyqFDQDLHYGmkgJykIrGF1XIpu+ILlaS/V9lZL +ubhzEFnTIZd+50xx+7LSYK05qAvqFyFWhfFQDlnrzuBZ6brJFe+GnY+EgPbk6ZGQ3BebYhtF8GaV +0nxvwuo77x/Py9auJ/GpsMiu/X1+mvoiBOv/2X/qkSsisRcOj/KKNFtY2PwByVS5uCbMiogziUwt +hDyC3+6WVwW6LLv3xLfHTjuCvjHIInNzktHCgKQ5ORAzI4JMPJ+GslWYHb4phowim57iaztXOoJw +TdwJx4nLCgdNbOhdjsnvzqvHu7UrTkXWStAmzOVyyghqpZXjFaH3pO3JLF+l+/+sKAIuvtd7u+Nx +e5AW0wdeRlN8NwdCjNPElpzVmbUq4JUagEiuTDkHzsxHpFKVK7q4+63SM1N95R1NbdWhscdCb+ZA +JzVcoyi3B43njTOQ5yOf+1CceWxG1bQVs5ZufpsMljq4Ui0/1lvh+wjChP4kqKOJ2qxq4RgqsahD +YVvTH9w7jXbyLeiNdd8XM2w9U/t7y0Ff/9yi0GE44Za4rF2LN9d11TPAmRGunUHBcnWEvgJBQl9n +JEiU0Zsnvgc/ubhPgXRR4Xq37Z0j4r7g1SgEEzwxA57demyPxgcYxn/eR44/KJ4EBs+lVDR3veyJ +m+kXQ99b21/+jh5Xos1AnX5iItreGCc= +-----END CERTIFICATE----- + +AC RAIZ FNMT-RCM +================ +-----BEGIN CERTIFICATE----- +MIIFgzCCA2ugAwIBAgIPXZONMGc2yAYdGsdUhGkHMA0GCSqGSIb3DQEBCwUAMDsxCzAJBgNVBAYT +AkVTMREwDwYDVQQKDAhGTk1ULVJDTTEZMBcGA1UECwwQQUMgUkFJWiBGTk1ULVJDTTAeFw0wODEw +MjkxNTU5NTZaFw0zMDAxMDEwMDAwMDBaMDsxCzAJBgNVBAYTAkVTMREwDwYDVQQKDAhGTk1ULVJD +TTEZMBcGA1UECwwQQUMgUkFJWiBGTk1ULVJDTTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoC +ggIBALpxgHpMhm5/yBNtwMZ9HACXjywMI7sQmkCpGreHiPibVmr75nuOi5KOpyVdWRHbNi63URcf +qQgfBBckWKo3Shjf5TnUV/3XwSyRAZHiItQDwFj8d0fsjz50Q7qsNI1NOHZnjrDIbzAzWHFctPVr +btQBULgTfmxKo0nRIBnuvMApGGWn3v7v3QqQIecaZ5JCEJhfTzC8PhxFtBDXaEAUwED653cXeuYL +j2VbPNmaUtu1vZ5Gzz3rkQUCwJaydkxNEJY7kvqcfw+Z374jNUUeAlz+taibmSXaXvMiwzn15Cou +08YfxGyqxRxqAQVKL9LFwag0Jl1mpdICIfkYtwb1TplvqKtMUejPUBjFd8g5CSxJkjKZqLsXF3mw +WsXmo8RZZUc1g16p6DULmbvkzSDGm0oGObVo/CK67lWMK07q87Hj/LaZmtVC+nFNCM+HHmpxffnT +tOmlcYF7wk5HlqX2doWjKI/pgG6BU6VtX7hI+cL5NqYuSf+4lsKMB7ObiFj86xsc3i1w4peSMKGJ +47xVqCfWS+2QrYv6YyVZLag13cqXM7zlzced0ezvXg5KkAYmY6252TUtB7p2ZSysV4999AeU14EC +ll2jB0nVetBX+RvnU0Z1qrB5QstocQjpYL05ac70r8NWQMetUqIJ5G+GR4of6ygnXYMgrwTJbFaa +i0b1AgMBAAGjgYMwgYAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYE +FPd9xf3E6Jobd2Sn9R2gzL+HYJptMD4GA1UdIAQ3MDUwMwYEVR0gADArMCkGCCsGAQUFBwIBFh1o +dHRwOi8vd3d3LmNlcnQuZm5tdC5lcy9kcGNzLzANBgkqhkiG9w0BAQsFAAOCAgEAB5BK3/MjTvDD +nFFlm5wioooMhfNzKWtN/gHiqQxjAb8EZ6WdmF/9ARP67Jpi6Yb+tmLSbkyU+8B1RXxlDPiyN8+s +D8+Nb/kZ94/sHvJwnvDKuO+3/3Y3dlv2bojzr2IyIpMNOmqOFGYMLVN0V2Ue1bLdI4E7pWYjJ2cJ +j+F3qkPNZVEI7VFY/uY5+ctHhKQV8Xa7pO6kO8Rf77IzlhEYt8llvhjho6Tc+hj507wTmzl6NLrT +Qfv6MooqtyuGC2mDOL7Nii4LcK2NJpLuHvUBKwrZ1pebbuCoGRw6IYsMHkCtA+fdZn71uSANA+iW ++YJF1DngoABd15jmfZ5nc8OaKveri6E6FO80vFIOiZiaBECEHX5FaZNXzuvO+FB8TxxuBEOb+dY7 +Ixjp6o7RTUaN8Tvkasq6+yO3m/qZASlaWFot4/nUbQ4mrcFuNLwy+AwF+mWj2zs3gyLp1txyM/1d +8iC9djwj2ij3+RvrWWTV3F9yfiD8zYm1kGdNYno/Tq0dwzn+evQoFt9B9kiABdcPUXmsEKvU7ANm +5mqwujGSQkBqvjrTcuFqN1W8rB2Vt2lh8kORdOag0wokRqEIr9baRRmW1FMdW4R58MD3R++Lj8UG +rp1MYp3/RgT408m2ECVAdf4WqslKYIYvuu8wd+RU4riEmViAqhOLUTpPSPaLtrM= +-----END CERTIFICATE----- + +Amazon Root CA 1 +================ +-----BEGIN CERTIFICATE----- +MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsFADA5MQswCQYD +VQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24gUm9vdCBDQSAxMB4XDTE1 +MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpv +bjEZMBcGA1UEAxMQQW1hem9uIFJvb3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC +ggEBALJ4gHHKeNXjca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgH +FzZM9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qwIFAGbHrQ +gLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6VOujw5H5SNz/0egwLX0t +dHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L93FcXmn/6pUCyziKrlA4b9v7LWIbxcce +VOF34GfID5yHI9Y/QCB/IIDEgEw+OyQmjgSubJrIqg0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB +/zAOBgNVHQ8BAf8EBAMCAYYwHQYDVR0OBBYEFIQYzIU07LwMlJQuCFmcx7IQTgoIMA0GCSqGSIb3 +DQEBCwUAA4IBAQCY8jdaQZChGsV2USggNiMOruYou6r4lK5IpDB/G/wkjUu0yKGX9rbxenDIU5PM +CCjjmCXPI6T53iHTfIUJrU6adTrCC2qJeHZERxhlbI1Bjjt/msv0tadQ1wUsN+gDS63pYaACbvXy +8MWy7Vu33PqUXHeeE6V/Uq2V8viTO96LXFvKWlJbYK8U90vvo/ufQJVtMVT8QtPHRh8jrdkPSHCa +2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2 +xJNDd2ZhwLnoQdeXeGADbkpyrqXRfboQnoZsG4q5WTP468SQvvG5 +-----END CERTIFICATE----- + +Amazon Root CA 2 +================ +-----BEGIN CERTIFICATE----- +MIIFQTCCAymgAwIBAgITBmyf0pY1hp8KD+WGePhbJruKNzANBgkqhkiG9w0BAQwFADA5MQswCQYD +VQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24gUm9vdCBDQSAyMB4XDTE1 +MDUyNjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpv +bjEZMBcGA1UEAxMQQW1hem9uIFJvb3QgQ0EgMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoC +ggIBAK2Wny2cSkxKgXlRmeyKy2tgURO8TW0G/LAIjd0ZEGrHJgw12MBvIITplLGbhQPDW9tK6Mj4 +kHbZW0/jTOgGNk3Mmqw9DJArktQGGWCsN0R5hYGCrVo34A3MnaZMUnbqQ523BNFQ9lXg1dKmSYXp +N+nKfq5clU1Imj+uIFptiJXZNLhSGkOQsL9sBbm2eLfq0OQ6PBJTYv9K8nu+NQWpEjTj82R0Yiw9 +AElaKP4yRLuH3WUnAnE72kr3H9rN9yFVkE8P7K6C4Z9r2UXTu/Bfh+08LDmG2j/e7HJV63mjrdvd +fLC6HM783k81ds8P+HgfajZRRidhW+mez/CiVX18JYpvL7TFz4QuK/0NURBs+18bvBt+xa47mAEx +kv8LV/SasrlX6avvDXbR8O70zoan4G7ptGmh32n2M8ZpLpcTnqWHsFcQgTfJU7O7f/aS0ZzQGPSS +btqDT6ZjmUyl+17vIWR6IF9sZIUVyzfpYgwLKhbcAS4y2j5L9Z469hdAlO+ekQiG+r5jqFoz7Mt0 +Q5X5bGlSNscpb/xVA1wf+5+9R+vnSUeVC06JIglJ4PVhHvG/LopyboBZ/1c6+XUyo05f7O0oYtlN +c/LMgRdg7c3r3NunysV+Ar3yVAhU/bQtCSwXVEqY0VThUWcI0u1ufm8/0i2BWSlmy5A5lREedCf+ +3euvAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBSw +DPBMMPQFWAJI/TPlUq9LhONmUjANBgkqhkiG9w0BAQwFAAOCAgEAqqiAjw54o+Ci1M3m9Zh6O+oA +A7CXDpO8Wqj2LIxyh6mx/H9z/WNxeKWHWc8w4Q0QshNabYL1auaAn6AFC2jkR2vHat+2/XcycuUY ++gn0oJMsXdKMdYV2ZZAMA3m3MSNjrXiDCYZohMr/+c8mmpJ5581LxedhpxfL86kSk5Nrp+gvU5LE +YFiwzAJRGFuFjWJZY7attN6a+yb3ACfAXVU3dJnJUH/jWS5E4ywl7uxMMne0nxrpS10gxdr9HIcW +xkPo1LsmmkVwXqkLN1PiRnsn/eBG8om3zEK2yygmbtmlyTrIQRNg91CMFa6ybRoVGld45pIq2WWQ +gj9sAq+uEjonljYE1x2igGOpm/HlurR8FLBOybEfdF849lHqm/osohHUqS0nGkWxr7JOcQ3AWEbW +aQbLU8uz/mtBzUF+fUwPfHJ5elnNXkoOrJupmHN5fLT0zLm4BwyydFy4x2+IoZCn9Kr5v2c69BoV +Yh63n749sSmvZ6ES8lgQGVMDMBu4Gon2nL2XA46jCfMdiyHxtN/kHNGfZQIG6lzWE7OE76KlXIx3 +KadowGuuQNKotOrN8I1LOJwZmhsoVLiJkO/KdYE+HvJkJMcYr07/R54H9jVlpNMKVv/1F2Rs76gi +JUmTtt8AF9pYfl3uxRuw0dFfIRDH+fO6AgonB8Xx1sfT4PsJYGw= +-----END CERTIFICATE----- + +Amazon Root CA 3 +================ +-----BEGIN CERTIFICATE----- +MIIBtjCCAVugAwIBAgITBmyf1XSXNmY/Owua2eiedgPySjAKBggqhkjOPQQDAjA5MQswCQYDVQQG +EwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24gUm9vdCBDQSAzMB4XDTE1MDUy +NjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZ +MBcGA1UEAxMQQW1hem9uIFJvb3QgQ0EgMzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABCmXp8ZB +f8ANm+gBG1bG8lKlui2yEujSLtf6ycXYqm0fc4E7O5hrOXwzpcVOho6AF2hiRVd9RFgdszflZwjr +Zt6jQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBSrttvXBp43 +rDCGB5Fwx5zEGbF4wDAKBggqhkjOPQQDAgNJADBGAiEA4IWSoxe3jfkrBqWTrBqYaGFy+uGh0Psc +eGCmQ5nFuMQCIQCcAu/xlJyzlvnrxir4tiz+OpAUFteMYyRIHN8wfdVoOw== +-----END CERTIFICATE----- + +Amazon Root CA 4 +================ +-----BEGIN CERTIFICATE----- +MIIB8jCCAXigAwIBAgITBmyf18G7EEwpQ+Vxe3ssyBrBDjAKBggqhkjOPQQDAzA5MQswCQYDVQQG +EwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24gUm9vdCBDQSA0MB4XDTE1MDUy +NjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZ +MBcGA1UEAxMQQW1hem9uIFJvb3QgQ0EgNDB2MBAGByqGSM49AgEGBSuBBAAiA2IABNKrijdPo1MN +/sGKe0uoe0ZLY7Bi9i0b2whxIdIA6GO9mif78DluXeo9pcmBqqNbIJhFXRbb/egQbeOc4OO9X4Ri +83BkM6DLJC9wuoihKqB1+IGuYgbEgds5bimwHvouXKNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNV +HQ8BAf8EBAMCAYYwHQYDVR0OBBYEFNPsxzplbszh2naaVvuc84ZtV+WBMAoGCCqGSM49BAMDA2gA +MGUCMDqLIfG9fhGt0O9Yli/W651+kI0rz2ZVwyzjKKlwCkcO8DdZEv8tmZQoTipPNU0zWgIxAOp1 +AE47xDqUEpHJWEadIRNyp4iciuRMStuW1KyLa2tJElMzrdfkviT8tQp21KW8EA== +-----END CERTIFICATE----- + +LuxTrust Global Root 2 +====================== +-----BEGIN CERTIFICATE----- +MIIFwzCCA6ugAwIBAgIUCn6m30tEntpqJIWe5rgV0xZ/u7EwDQYJKoZIhvcNAQELBQAwRjELMAkG +A1UEBhMCTFUxFjAUBgNVBAoMDUx1eFRydXN0IFMuQS4xHzAdBgNVBAMMFkx1eFRydXN0IEdsb2Jh +bCBSb290IDIwHhcNMTUwMzA1MTMyMTU3WhcNMzUwMzA1MTMyMTU3WjBGMQswCQYDVQQGEwJMVTEW +MBQGA1UECgwNTHV4VHJ1c3QgUy5BLjEfMB0GA1UEAwwWTHV4VHJ1c3QgR2xvYmFsIFJvb3QgMjCC +AiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANeFl78RmOnwYoNMPIf5U2o3C/IPPIfOb9wm +Kb3FibrJgz337spbxm1Jc7TJRqMbNBM/wYlFV/TZsfs2ZUv7COJIcRHIbjuend+JZTemhfY7RBi2 +xjcwYkSSl2l9QjAk5A0MiWtj3sXh306pFGxT4GHO9hcvHTy95iJMHZP1EMShduxq3sVs35a0VkBC +wGKSMKEtFZSg0iAGCW5qbeXrt77U8PEVfIvmTroTzEsnXpk8F12PgX8zPU/TPxvsXD/wPEx1bvKm +1Z3aLQdjAsZy6ZS8TEmVT4hSyNvoaYL4zDRbIvCGp4m9SAptZoFtyMhk+wHh9OHe2Z7d21vUKpkm +FRseTJIpgp7VkoGSQXAZ96Tlk0u8d2cx3Rz9MXANF5kM+Qw5GSoXtTBxVdUPrljhPS80m8+f9niF +wpN6cj5mj5wWEWCPnolvZ77gR1o7DJpni89Gxq44o/KnvObWhWszJHAiS8sIm7vI+AIpHb4gDEa/ +a4ebsypmQjVGbKq6rfmYe+lQVRQxv7HaLe2ArWgk+2mr2HETMOZns4dA/Yl+8kPREd8vZS9kzl8U +ubG/Mb2HeFpZZYiq/FkySIbWTLkpS5XTdvN3JW1CHDiDTf2jX5t/Lax5Gw5CMZdjpPuKadUiDTSQ +MC6otOBttpSsvItO13D8xTiOZCXhTTmQzsmHhFhxAgMBAAGjgagwgaUwDwYDVR0TAQH/BAUwAwEB +/zBCBgNVHSAEOzA5MDcGByuBKwEBAQowLDAqBggrBgEFBQcCARYeaHR0cHM6Ly9yZXBvc2l0b3J5 +Lmx1eHRydXN0Lmx1MA4GA1UdDwEB/wQEAwIBBjAfBgNVHSMEGDAWgBT/GCh2+UgFLKGu8SsbK7JT ++Et8szAdBgNVHQ4EFgQU/xgodvlIBSyhrvErGyuyU/hLfLMwDQYJKoZIhvcNAQELBQADggIBAGoZ +FO1uecEsh9QNcH7X9njJCwROxLHOk3D+sFTAMs2ZMGQXvw/l4jP9BzZAcg4atmpZ1gDlaCDdLnIN +H2pkMSCEfUmmWjfrRcmF9dTHF5kH5ptV5AzoqbTOjFu1EVzPig4N1qx3gf4ynCSecs5U89BvolbW +7MM3LGVYvlcAGvI1+ut7MV3CwRI9loGIlonBWVx65n9wNOeD4rHh4bhY79SV5GCc8JaXcozrhAIu +ZY+kt9J/Z93I055cqqmkoCUUBpvsT34tC38ddfEz2O3OuHVtPlu5mB0xDVbYQw8wkbIEa91WvpWA +VWe+2M2D2RjuLg+GLZKecBPs3lHJQ3gCpU3I+V/EkVhGFndadKpAvAefMLmx9xIX3eP/JEAdemrR +TxgKqpAd60Ae36EeRJIQmvKN4dFLRp7oRUKX6kWZ8+xm1QL68qZKJKrezrnK+T+Tb/mjuuqlPpmt +/f97mfVl7vBZKGfXkJWkE4SphMHozs51k2MavDzq1WQfLSoSOcbDWjLtR5EWDrw4wVDej8oqkDQc +7kGUnF4ZLvhFSZl0kbAEb+MEWrGrKqv+x9CWttrhSmQGbmBNvUJO/3jaJMobtNeWOWyu8Q6qp31I +iyBMz2TWuJdGsE7RKlY6oJO9r4Ak4Ap+58rVyuiFVdw2KuGUaJPHZnJED4AhMmwlxyOAgwrr +-----END CERTIFICATE----- + +TUBITAK Kamu SM SSL Kok Sertifikasi - Surum 1 +============================================= +-----BEGIN CERTIFICATE----- +MIIEYzCCA0ugAwIBAgIBATANBgkqhkiG9w0BAQsFADCB0jELMAkGA1UEBhMCVFIxGDAWBgNVBAcT +D0dlYnplIC0gS29jYWVsaTFCMEAGA1UEChM5VHVya2l5ZSBCaWxpbXNlbCB2ZSBUZWtub2xvamlr +IEFyYXN0aXJtYSBLdXJ1bXUgLSBUVUJJVEFLMS0wKwYDVQQLEyRLYW11IFNlcnRpZmlrYXN5b24g +TWVya2V6aSAtIEthbXUgU00xNjA0BgNVBAMTLVRVQklUQUsgS2FtdSBTTSBTU0wgS29rIFNlcnRp +ZmlrYXNpIC0gU3VydW0gMTAeFw0xMzExMjUwODI1NTVaFw00MzEwMjUwODI1NTVaMIHSMQswCQYD +VQQGEwJUUjEYMBYGA1UEBxMPR2ViemUgLSBLb2NhZWxpMUIwQAYDVQQKEzlUdXJraXllIEJpbGlt +c2VsIHZlIFRla25vbG9qaWsgQXJhc3Rpcm1hIEt1cnVtdSAtIFRVQklUQUsxLTArBgNVBAsTJEth +bXUgU2VydGlmaWthc3lvbiBNZXJrZXppIC0gS2FtdSBTTTE2MDQGA1UEAxMtVFVCSVRBSyBLYW11 +IFNNIFNTTCBLb2sgU2VydGlmaWthc2kgLSBTdXJ1bSAxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A +MIIBCgKCAQEAr3UwM6q7a9OZLBI3hNmNe5eA027n/5tQlT6QlVZC1xl8JoSNkvoBHToP4mQ4t4y8 +6Ij5iySrLqP1N+RAjhgleYN1Hzv/bKjFxlb4tO2KRKOrbEz8HdDc72i9z+SqzvBV96I01INrN3wc +wv61A+xXzry0tcXtAA9TNypN9E8Mg/uGz8v+jE69h/mniyFXnHrfA2eJLJ2XYacQuFWQfw4tJzh0 +3+f92k4S400VIgLI4OD8D62K18lUUMw7D8oWgITQUVbDjlZ/iSIzL+aFCr2lqBs23tPcLG07xxO9 +WSMs5uWk99gL7eqQQESolbuT1dCANLZGeA4fAJNG4e7p+exPFwIDAQABo0IwQDAdBgNVHQ4EFgQU +ZT/HiobGPN08VFw1+DrtUgxHV8gwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJ +KoZIhvcNAQELBQADggEBACo/4fEyjq7hmFxLXs9rHmoJ0iKpEsdeV31zVmSAhHqT5Am5EM2fKifh +AHe+SMg1qIGf5LgsyX8OsNJLN13qudULXjS99HMpw+0mFZx+CFOKWI3QSyjfwbPfIPP54+M638yc +lNhOT8NrF7f3cuitZjO1JVOr4PhMqZ398g26rrnZqsZr+ZO7rqu4lzwDGrpDxpa5RXI4s6ehlj2R +e37AIVNMh+3yC1SVUZPVIqUNivGTDj5UDrDYyU7c8jEyVupk+eq1nRZmQnLzf9OxMUP8pI4X8W0j +q5Rm+K37DwhuJi1/FwcJsoz7UMCflo3Ptv0AnVoUmr8CRPXBwp8iXqIPoeM= +-----END CERTIFICATE----- diff --git a/app/api/Stripe/HttpClient/data/test.png b/app/api/Stripe/HttpClient/data/test.png new file mode 100755 index 0000000..1914264 Binary files /dev/null and b/app/api/Stripe/HttpClient/data/test.png differ diff --git a/app/api/Stripe/Invoice.php b/app/api/Stripe/Invoice.php new file mode 100755 index 0000000..14d7728 --- /dev/null +++ b/app/api/Stripe/Invoice.php @@ -0,0 +1,261 @@ +invoice + * items, and proration adjustments that may be caused by subscription + * upgrades/downgrades (if necessary). + * + * If your invoice is configured to be billed through automatic charges, Stripe + * automatically finalizes your invoice and attempts payment. Note that finalizing + * the invoice, when + * automatic, does not happen immediately as the invoice is created. Stripe + * waits until one hour after the last webhook was successfully sent (or the last + * webhook timed out after failing). If you (and the platforms you may have + * connected to) have no webhooks configured, Stripe waits one hour after creation + * to finalize the invoice. + * + * If your invoice is configured to be billed by sending an email, then based on + * your email + * settings, Stripe will email the invoice to your customer and await payment. + * These emails can contain a link to a hosted page to pay the invoice. + * + * Stripe applies any customer credit on the account before determining the amount + * due for the invoice (i.e., the amount that will be actually charged). If the + * amount due for the invoice is less than Stripe's minimum allowed + * charge per currency, the invoice is automatically marked paid, and we add + * the amount due to the customer's credit balance which is applied to the next + * invoice. + * + * More details on the customer's credit balance are here. + * + * Related guide: Send + * Invoices to Customers. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|string $account_country The country of the business associated with this invoice, most often the business creating the invoice. + * @property null|string $account_name The public name of the business associated with this invoice, most often the business creating the invoice. + * @property null|(string|\Stripe\TaxId)[] $account_tax_ids The account tax IDs associated with the invoice. Only editable when the invoice is a draft. + * @property int $amount_due Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the amount_due may be 0. If there is a positive starting_balance for the invoice (the customer owes money), the amount_due will also take that into account. The charge that gets generated for the invoice will be for the amount specified in amount_due. + * @property int $amount_paid The amount, in %s, that was paid. + * @property int $amount_remaining The amount remaining, in %s, that is due. + * @property null|int $application_fee_amount The fee in %s that will be applied to the invoice and transferred to the application owner's Stripe account when the invoice is paid. + * @property int $attempt_count Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule. + * @property bool $attempted Whether an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after the invoice.created webhook, for example, so you might not want to display that invoice as unpaid to your users. + * @property bool $auto_advance Controls whether Stripe will perform automatic collection of the invoice. When false, the invoice's state will not automatically advance without an explicit action. + * @property null|string $billing_reason Indicates the reason why the invoice was created. subscription_cycle indicates an invoice created by a subscription advancing into a new period. subscription_create indicates an invoice created due to creating a subscription. subscription_update indicates an invoice created due to updating a subscription. subscription is set for all old invoices to indicate either a change to a subscription or a period advancement. manual is set for all invoices unrelated to a subscription (for example: created via the invoice editor). The upcoming value is reserved for simulated invoices per the upcoming invoice endpoint. subscription_threshold indicates an invoice created due to a billing threshold being reached. + * @property null|string|\Stripe\Charge $charge ID of the latest charge generated for this invoice, if any. + * @property null|string $collection_method Either charge_automatically, or send_invoice. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|\Stripe\StripeObject[] $custom_fields Custom fields displayed on the invoice. + * @property string|\Stripe\Customer $customer The ID of the customer who will be billed. + * @property null|\Stripe\StripeObject $customer_address The customer's address. Until the invoice is finalized, this field will equal customer.address. Once the invoice is finalized, this field will no longer be updated. + * @property null|string $customer_email The customer's email. Until the invoice is finalized, this field will equal customer.email. Once the invoice is finalized, this field will no longer be updated. + * @property null|string $customer_name The customer's name. Until the invoice is finalized, this field will equal customer.name. Once the invoice is finalized, this field will no longer be updated. + * @property null|string $customer_phone The customer's phone number. Until the invoice is finalized, this field will equal customer.phone. Once the invoice is finalized, this field will no longer be updated. + * @property null|\Stripe\StripeObject $customer_shipping The customer's shipping information. Until the invoice is finalized, this field will equal customer.shipping. Once the invoice is finalized, this field will no longer be updated. + * @property null|string $customer_tax_exempt The customer's tax exempt status. Until the invoice is finalized, this field will equal customer.tax_exempt. Once the invoice is finalized, this field will no longer be updated. + * @property null|\Stripe\StripeObject[] $customer_tax_ids The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax IDs as customer.tax_ids. Once the invoice is finalized, this field will no longer be updated. + * @property null|string|\Stripe\PaymentMethod $default_payment_method ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. + * @property null|string|\Stripe\Account|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source $default_source ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source. + * @property \Stripe\TaxRate[] $default_tax_rates The tax rates applied to this invoice, if any. + * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard. + * @property null|\Stripe\Discount $discount Describes the current discount applied to this invoice, if there is one. Not populated if there are multiple discounts. + * @property null|(string|\Stripe\Discount)[] $discounts The discounts applied to the invoice. Line item discounts are applied before invoice discounts. Use expand[]=discounts to expand each discount. + * @property null|int $due_date The date on which payment for this invoice is due. This value will be null for invoices where collection_method=charge_automatically. + * @property null|int $ending_balance Ending customer balance after the invoice is finalized. Invoices are finalized approximately an hour after successful webhook delivery or when payment collection is attempted for the invoice. If the invoice has not been finalized yet, this will be null. + * @property null|string $footer Footer displayed on the invoice. + * @property null|string $hosted_invoice_url The URL for the hosted invoice page, which allows customers to view and pay an invoice. If the invoice has not been finalized yet, this will be null. + * @property null|string $invoice_pdf The link to download the PDF for the invoice. If the invoice has not been finalized yet, this will be null. + * @property null|\Stripe\ErrorObject $last_finalization_error The error encountered during the previous attempt to finalize the invoice. This field is cleared when the invoice is successfully finalized. + * @property \Stripe\Collection $lines The individual line items that make up the invoice. lines is sorted as follows: invoice items in reverse chronological order, followed by the subscription, if any. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|int $next_payment_attempt The time at which payment will next be attempted. This value will be null for invoices where collection_method=send_invoice. + * @property null|string $number A unique, identifying string that appears on emails sent to the customer for this invoice. This starts with the customer's unique invoice_prefix if it is specified. + * @property null|string|\Stripe\Account $on_behalf_of The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the Invoices with Connect documentation for details. + * @property bool $paid Whether payment was successfully collected for this invoice. An invoice can be paid (most commonly) with a charge or with credit from the customer's account balance. + * @property null|string|\Stripe\PaymentIntent $payment_intent The PaymentIntent associated with this invoice. The PaymentIntent is generated when the invoice is finalized, and can then be used to pay the invoice. Note that voiding an invoice will cancel the PaymentIntent. + * @property \Stripe\StripeObject $payment_settings + * @property int $period_end End of the usage period during which invoice items were added to this invoice. + * @property int $period_start Start of the usage period during which invoice items were added to this invoice. + * @property int $post_payment_credit_notes_amount Total amount of all post-payment credit notes issued for this invoice. + * @property int $pre_payment_credit_notes_amount Total amount of all pre-payment credit notes issued for this invoice. + * @property null|string $receipt_number This is the transaction number that appears on email receipts sent for this invoice. + * @property int $starting_balance Starting customer balance before the invoice is finalized. If the invoice has not been finalized yet, this will be the current customer balance. + * @property null|string $statement_descriptor Extra information about an invoice for the customer's credit card statement. + * @property null|string $status The status of the invoice, one of draft, open, paid, uncollectible, or void. Learn more + * @property \Stripe\StripeObject $status_transitions + * @property null|string|\Stripe\Subscription $subscription The subscription that this invoice was prepared for, if any. + * @property int $subscription_proration_date Only set for upcoming invoices that preview prorations. The time used to calculate prorations. + * @property int $subtotal Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or tax is applied. Item discounts are already incorporated + * @property null|int $tax The amount of tax on this invoice. This is the sum of all the tax amounts on this invoice. + * @property \Stripe\StripeObject $threshold_reason + * @property int $total Total after discounts and taxes. + * @property null|\Stripe\StripeObject[] $total_discount_amounts The aggregate amounts calculated per discount across all line items. + * @property \Stripe\StripeObject[] $total_tax_amounts The aggregate amounts calculated per tax rate for all line items. + * @property null|int $webhooks_delivered_at Invoices are automatically paid or sent 1 hour after webhooks are delivered, or until all webhook delivery attempts have been exhausted. This field tracks the time when webhooks for this invoice were successfully delivered. If the invoice had no webhooks to deliver, this will be set while the invoice is being created. + */ +class Invoice extends ApiResource +{ + const OBJECT_NAME = 'invoice'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Delete; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const BILLING_CHARGE_AUTOMATICALLY = 'charge_automatically'; + const BILLING_SEND_INVOICE = 'send_invoice'; + + const BILLING_REASON_MANUAL = 'manual'; + const BILLING_REASON_SUBSCRIPTION = 'subscription'; + const BILLING_REASON_SUBSCRIPTION_CREATE = 'subscription_create'; + const BILLING_REASON_SUBSCRIPTION_CYCLE = 'subscription_cycle'; + const BILLING_REASON_SUBSCRIPTION_THRESHOLD = 'subscription_threshold'; + const BILLING_REASON_SUBSCRIPTION_UPDATE = 'subscription_update'; + const BILLING_REASON_UPCOMING = 'upcoming'; + + const COLLECTION_METHOD_CHARGE_AUTOMATICALLY = 'charge_automatically'; + const COLLECTION_METHOD_SEND_INVOICE = 'send_invoice'; + + const STATUS_DELETED = 'deleted'; + const STATUS_DRAFT = 'draft'; + const STATUS_OPEN = 'open'; + const STATUS_PAID = 'paid'; + const STATUS_UNCOLLECTIBLE = 'uncollectible'; + const STATUS_VOID = 'void'; + + use ApiOperations\NestedResource; + + const PATH_LINES = '/lines'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice the upcoming invoice + */ + public static function upcoming($params = null, $opts = null) + { + $url = static::classUrl() . '/upcoming'; + list($response, $opts) = static::_staticRequest('get', $url, $params, $opts); + $obj = Util\Util::convertToStripeObject($response->json, $opts); + $obj->setLastResponse($response); + + return $obj; + } + + /** + * @param string $id the ID of the invoice on which to retrieve the lines + * @param null|array $params + * @param null|array|string $opts + * + * @throws StripeExceptionApiErrorException if the request fails + * + * @return \Stripe\Collection the list of lines (InvoiceLineItem) + */ + public static function allLines($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_LINES, $params, $opts); + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return Invoice the finalized invoice + */ + public function finalizeInvoice($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/finalize'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return Invoice the uncollectible invoice + */ + public function markUncollectible($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/mark_uncollectible'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return Invoice the paid invoice + */ + public function pay($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/pay'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return Invoice the sent invoice + */ + public function sendInvoice($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/send'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return Invoice the voided invoice + */ + public function voidInvoice($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/void'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/app/api/Stripe/InvoiceItem.php b/app/api/Stripe/InvoiceItem.php new file mode 100755 index 0000000..664d47e --- /dev/null +++ b/app/api/Stripe/InvoiceItem.php @@ -0,0 +1,49 @@ +Subscription + * Invoices. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount Amount (in the currency specified) of the invoice item. This should always be equal to unit_amount * quantity. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property string|\Stripe\Customer $customer The ID of the customer who will be billed when this invoice item is billed. + * @property int $date Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property bool $discountable If true, discounts will apply to this invoice item. Always false for prorations. + * @property null|(string|\Stripe\Discount)[] $discounts The discounts which apply to the invoice item. Item discounts are applied before invoice discounts. Use expand[]=discounts to expand each discount. + * @property null|string|\Stripe\Invoice $invoice The ID of the invoice this invoice item belongs to. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property \Stripe\StripeObject $period + * @property null|\Stripe\Plan $plan If the invoice item is a proration, the plan of the subscription that the proration was computed for. + * @property null|\Stripe\Price $price The price of the invoice item. + * @property bool $proration Whether the invoice item was created automatically as a proration adjustment when the customer switched plans. + * @property int $quantity Quantity of units for the invoice item. If the invoice item is a proration, the quantity of the subscription that the proration was computed for. + * @property null|string|\Stripe\Subscription $subscription The subscription that this invoice item has been created for, if any. + * @property string $subscription_item The subscription item that this invoice item has been created for, if any. + * @property null|\Stripe\TaxRate[] $tax_rates The tax rates which apply to the invoice item. When set, the default_tax_rates on the invoice do not apply to this invoice item. + * @property null|int $unit_amount Unit amount (in the currency specified) of the invoice item. + * @property null|string $unit_amount_decimal Same as unit_amount, but contains a decimal value with at most 12 decimal places. + */ +class InvoiceItem extends ApiResource +{ + const OBJECT_NAME = 'invoiceitem'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Delete; + use ApiOperations\Retrieve; + use ApiOperations\Update; +} diff --git a/app/api/Stripe/InvoiceLineItem.php b/app/api/Stripe/InvoiceLineItem.php new file mode 100755 index 0000000..7a1c9bb --- /dev/null +++ b/app/api/Stripe/InvoiceLineItem.php @@ -0,0 +1,33 @@ +ISO currency code, in lowercase. Must be a supported currency. + * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|\Stripe\StripeObject[] $discount_amounts The amount of discount calculated per discount for this line item. + * @property bool $discountable If true, discounts will apply to this line item. Always false for prorations. + * @property null|(string|\Stripe\Discount)[] $discounts The discounts applied to the invoice line item. Line item discounts are applied before invoice discounts. Use expand[]=discounts to expand each discount. + * @property string $invoice_item The ID of the invoice item associated with this line item if any. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Note that for line items with type=subscription this will reflect the metadata of the subscription that caused the line item to be created. + * @property \Stripe\StripeObject $period + * @property null|\Stripe\Plan $plan The plan of the subscription, if the line item is a subscription or a proration. + * @property null|\Stripe\Price $price The price of the line item. + * @property bool $proration Whether this is a proration. + * @property null|int $quantity The quantity of the subscription, if the line item is a subscription or a proration. + * @property null|string $subscription The subscription that the invoice item pertains to, if any. + * @property string $subscription_item The subscription item that generated this invoice item. Left empty if the line item is not an explicit result of a subscription. + * @property \Stripe\StripeObject[] $tax_amounts The amount of tax calculated per tax rate for this line item + * @property \Stripe\TaxRate[] $tax_rates The tax rates which apply to the line item. + * @property string $type A string identifying the type of the source of this line item, either an invoiceitem or a subscription. + */ +class InvoiceLineItem extends ApiResource +{ + const OBJECT_NAME = 'line_item'; +} diff --git a/app/api/Stripe/Issuing/Authorization.php b/app/api/Stripe/Issuing/Authorization.php new file mode 100755 index 0000000..f9032b6 --- /dev/null +++ b/app/api/Stripe/Issuing/Authorization.php @@ -0,0 +1,81 @@ +issued card is used to + * make a purchase, an Issuing Authorization object is created. Authorizations + * must be approved for the purchase to be completed successfully. + * + * Related guide: Issued Card + * Authorizations. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount The total amount that was authorized or rejected. This amount is in the card's currency and in the smallest currency unit. + * @property null|\Stripe\StripeObject $amount_details Detailed breakdown of amount components. These amounts are denominated in currency and in the smallest currency unit. + * @property bool $approved Whether the authorization has been approved. + * @property string $authorization_method How the card details were provided. + * @property \Stripe\BalanceTransaction[] $balance_transactions List of balance transactions associated with this authorization. + * @property \Stripe\Issuing\Card $card You can create physical or virtual cards that are issued to cardholders. + * @property null|string|\Stripe\Issuing\Cardholder $cardholder The cardholder to whom this authorization belongs. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property int $merchant_amount The total amount that was authorized or rejected. This amount is in the merchant_currency and in the smallest currency unit. + * @property string $merchant_currency The currency that was presented to the cardholder for the authorization. Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property \Stripe\StripeObject $merchant_data + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|\Stripe\StripeObject $pending_request The pending authorization request. This field will only be non-null during an issuing_authorization.request webhook. + * @property \Stripe\StripeObject[] $request_history History of every time pending_request was approved/denied, either by you directly or by Stripe (e.g. based on your spending_controls). If the merchant changes the authorization by performing an incremental authorization, you can look at this field to see the previous requests for the authorization. + * @property string $status The current status of the authorization in its lifecycle. + * @property \Stripe\Issuing\Transaction[] $transactions List of transactions associated with this authorization. + * @property \Stripe\StripeObject $verification_data + * @property null|string $wallet What, if any, digital wallet was used for this authorization. One of apple_pay, google_pay, or samsung_pay. + */ +class Authorization extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'issuing.authorization'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return Authorization the approved authorization + */ + public function approve($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/approve'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return Authorization the declined authorization + */ + public function decline($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/decline'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/app/api/Stripe/Issuing/Card.php b/app/api/Stripe/Issuing/Card.php new file mode 100755 index 0000000..80ce3b6 --- /dev/null +++ b/app/api/Stripe/Issuing/Card.php @@ -0,0 +1,59 @@ +create physical or + * virtual cards that are issued to cardholders. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property string $brand The brand of the card. + * @property null|string $cancellation_reason The reason why the card was canceled. + * @property \Stripe\Issuing\Cardholder $cardholder

An Issuing Cardholder object represents an individual or business entity who is issued cards.

Related guide: How to create a Cardholder

+ * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property string $cvc The card's CVC. For security reasons, this is only available for virtual cards, and will be omitted unless you explicitly request it with the expand parameter. Additionally, it's only available via the "Retrieve a card" endpoint, not via "List all cards" or any other endpoint. + * @property int $exp_month The expiration month of the card. + * @property int $exp_year The expiration year of the card. + * @property string $last4 The last 4 digits of the card number. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property string $number The full unredacted card number. For security reasons, this is only available for virtual cards, and will be omitted unless you explicitly request it with the expand parameter. Additionally, it's only available via the "Retrieve a card" endpoint, not via "List all cards" or any other endpoint. + * @property null|string|\Stripe\Issuing\Card $replaced_by The latest card that replaces this card, if any. + * @property null|string|\Stripe\Issuing\Card $replacement_for The card this card replaces, if any. + * @property null|string $replacement_reason The reason why the previous card needed to be replaced. + * @property null|\Stripe\StripeObject $shipping Where and how the card will be shipped. + * @property \Stripe\StripeObject $spending_controls + * @property string $status Whether authorizations can be approved on this card. + * @property string $type The type of the card. + */ +class Card extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'issuing.card'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\CardDetails the card details associated with that issuing card + */ + public function details($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/details'; + list($response, $opts) = $this->_request('get', $url, $params, $opts); + $obj = \Stripe\Util\Util::convertToStripeObject($response, $opts); + $obj->setLastResponse($response); + + return $obj; + } +} diff --git a/app/api/Stripe/Issuing/CardDetails.php b/app/api/Stripe/Issuing/CardDetails.php new file mode 100755 index 0000000..2097a55 --- /dev/null +++ b/app/api/Stripe/Issuing/CardDetails.php @@ -0,0 +1,19 @@ +Cardholder object represents an individual or business + * entity who is issued cards. + * + * Related guide: How to create a + * Cardholder + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property \Stripe\StripeObject $billing + * @property null|\Stripe\StripeObject $company Additional information about a company cardholder. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string $email The cardholder's email address. + * @property null|\Stripe\StripeObject $individual Additional information about an individual cardholder. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property string $name The cardholder's name. This will be printed on cards issued to them. + * @property null|string $phone_number The cardholder's phone number. + * @property \Stripe\StripeObject $requirements + * @property null|\Stripe\StripeObject $spending_controls Rules that control spending across this cardholder's cards. Refer to our documentation for more details. + * @property string $status Specifies whether to permit authorizations on this cardholder's cards. + * @property string $type One of individual or company. + */ +class Cardholder extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'issuing.cardholder'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; +} diff --git a/app/api/Stripe/Issuing/Dispute.php b/app/api/Stripe/Issuing/Dispute.php new file mode 100755 index 0000000..795e58d --- /dev/null +++ b/app/api/Stripe/Issuing/Dispute.php @@ -0,0 +1,53 @@ +card issuer, you can dispute + * transactions that the cardholder does not recognize, suspects to be fraudulent, + * or has other issues with. + * + * Related guide: Disputing + * Transactions + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount Disputed amount. Usually the amount of the transaction, but can differ (usually because of currency fluctuation). + * @property null|\Stripe\BalanceTransaction[] $balance_transactions List of balance transactions associated with the dispute. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency The currency the transaction was made in. + * @property \Stripe\StripeObject $evidence + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property string $status Current status of the dispute. + * @property string|\Stripe\Issuing\Transaction $transaction The transaction being disputed. + */ +class Dispute extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'issuing.dispute'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return Dispute the submited dispute + */ + public function submit($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/submit'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/app/api/Stripe/Issuing/Transaction.php b/app/api/Stripe/Issuing/Transaction.php new file mode 100755 index 0000000..6270508 --- /dev/null +++ b/app/api/Stripe/Issuing/Transaction.php @@ -0,0 +1,43 @@ +issued card that + * results in funds entering or leaving your Stripe account, such as a completed + * purchase or refund, is represented by an Issuing Transaction + * object. + * + * Related guide: Issued Card + * Transactions. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount The transaction amount, which will be reflected in your balance. This amount is in your currency and in the smallest currency unit. + * @property null|\Stripe\StripeObject $amount_details Detailed breakdown of amount components. These amounts are denominated in currency and in the smallest currency unit. + * @property null|string|\Stripe\Issuing\Authorization $authorization The Authorization object that led to this transaction. + * @property null|string|\Stripe\BalanceTransaction $balance_transaction ID of the balance transaction associated with this transaction. + * @property string|\Stripe\Issuing\Card $card The card used to make this transaction. + * @property null|string|\Stripe\Issuing\Cardholder $cardholder The cardholder to whom this transaction belongs. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string|\Stripe\Issuing\Dispute $dispute If you've disputed the transaction, the ID of the dispute. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property int $merchant_amount The amount that the merchant will receive, denominated in merchant_currency and in the smallest currency unit. It will be different from amount if the merchant is taking payment in a different currency. + * @property string $merchant_currency The currency with which the merchant is taking payment. + * @property \Stripe\StripeObject $merchant_data + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|\Stripe\StripeObject $purchase_details Additional purchase information that is optionally provided by the merchant. + * @property string $type The nature of the transaction. + */ +class Transaction extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'issuing.transaction'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; +} diff --git a/app/api/Stripe/LineItem.php b/app/api/Stripe/LineItem.php new file mode 100755 index 0000000..80c2a61 --- /dev/null +++ b/app/api/Stripe/LineItem.php @@ -0,0 +1,26 @@ +ISO currency code, in lowercase. Must be a supported currency. + * @property string $description An arbitrary string attached to the object. Often useful for displaying to users. Defaults to product name. + * @property \Stripe\StripeObject[] $discounts The discounts applied to the line item. + * @property null|\Stripe\Price $price The price used to generate the line item. + * @property null|int $quantity The quantity of products being purchased. + * @property \Stripe\StripeObject[] $taxes The taxes applied to the line item. + */ +class LineItem extends ApiResource +{ + const OBJECT_NAME = 'item'; + + use ApiOperations\All; +} diff --git a/app/api/Stripe/LoginLink.php b/app/api/Stripe/LoginLink.php new file mode 100755 index 0000000..a016fca --- /dev/null +++ b/app/api/Stripe/LoginLink.php @@ -0,0 +1,15 @@ +true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $multi_use + * @property string|\Stripe\PaymentMethod $payment_method ID of the payment method associated with this mandate. + * @property \Stripe\StripeObject $payment_method_details + * @property \Stripe\StripeObject $single_use + * @property string $status The status of the mandate, which indicates whether it can be used to initiate a payment. + * @property string $type The type of the mandate. + */ +class Mandate extends ApiResource +{ + const OBJECT_NAME = 'mandate'; + + use ApiOperations\Retrieve; +} diff --git a/app/api/Stripe/OAuth.php b/app/api/Stripe/OAuth.php new file mode 100755 index 0000000..71deeae --- /dev/null +++ b/app/api/Stripe/OAuth.php @@ -0,0 +1,101 @@ +request( + 'post', + '/oauth/token', + $params, + null + ); + + return Util\Util::convertToStripeObject($response->json, $opts); + } + + /** + * Disconnects an account from your platform. + * + * @param null|array $params + * @param null|array $opts + * + * @throws \Stripe\Exception\OAuth\OAuthErrorException if the request fails + * + * @return StripeObject object containing the response from the API + */ + public static function deauthorize($params = null, $opts = null) + { + $params = $params ?: []; + $base = ($opts && \array_key_exists('connect_base', $opts)) ? $opts['connect_base'] : Stripe::$connectBase; + $requestor = new ApiRequestor(null, $base); + $params['client_id'] = self::_getClientId($params); + list($response, $apiKey) = $requestor->request( + 'post', + '/oauth/deauthorize', + $params, + null + ); + + return Util\Util::convertToStripeObject($response->json, $opts); + } + + private static function _getClientId($params = null) + { + $clientId = ($params && \array_key_exists('client_id', $params)) ? $params['client_id'] : null; + if (null === $clientId) { + $clientId = Stripe::getClientId(); + } + if (null === $clientId) { + $msg = 'No client_id provided. (HINT: set your client_id using ' + . '"Stripe::setClientId()". You can find your client_ids ' + . 'in your Stripe dashboard at ' + . 'https://dashboard.stripe.com/account/applications/settings, ' + . 'after registering your account as a platform. See ' + . 'https://stripe.com/docs/connect/standard-accounts for details, ' + . 'or email support@stripe.com if you have any questions.'; + + throw new Exception\AuthenticationException($msg); + } + + return $clientId; + } +} diff --git a/app/api/Stripe/OAuthErrorObject.php b/app/api/Stripe/OAuthErrorObject.php new file mode 100755 index 0000000..945cb66 --- /dev/null +++ b/app/api/Stripe/OAuthErrorObject.php @@ -0,0 +1,31 @@ + null, + 'error_description' => null, + ], $values); + parent::refreshFrom($values, $opts, $partial); + } +} diff --git a/app/api/Stripe/Order.php b/app/api/Stripe/Order.php new file mode 100755 index 0000000..7d664e2 --- /dev/null +++ b/app/api/Stripe/Order.php @@ -0,0 +1,81 @@ +products. You can + * create, retrieve, and pay individual orders, as well as list all orders. Orders + * are identified by a unique, random ID. + * + * Related guide: Tax, Shipping, and + * Inventory. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount for the order. + * @property null|int $amount_returned The total amount that was returned to the customer. + * @property null|string $application ID of the Connect Application that created the order. + * @property null|int $application_fee A fee in cents that will be applied to the order and transferred to the application owner’s Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees documentation. + * @property null|string|\Stripe\Charge $charge The ID of the payment used to pay for the order. Present if the order status is paid, fulfilled, or refunded. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string|\Stripe\Customer $customer The customer used for the order. + * @property null|string $email The email address of the customer placing the order. + * @property string $external_coupon_code External coupon code to load for this order. + * @property \Stripe\OrderItem[] $items List of items constituting the order. An order can have up to 25 items. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|\Stripe\Collection $returns A list of returns that have taken place for this order. + * @property null|string $selected_shipping_method The shipping method that is currently selected for this order, if any. If present, it is equal to one of the ids of shipping methods in the shipping_methods array. At order creation time, if there are multiple shipping methods, Stripe will automatically selected the first method. + * @property null|\Stripe\StripeObject $shipping The shipping address for the order. Present if the order is for goods to be shipped. + * @property null|\Stripe\StripeObject[] $shipping_methods A list of supported shipping methods for this order. The desired shipping method can be specified either by updating the order, or when paying it. + * @property string $status Current order status. One of created, paid, canceled, fulfilled, or returned. More details in the Orders Guide. + * @property null|\Stripe\StripeObject $status_transitions The timestamps at which the order status was updated. + * @property null|int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch. + * @property string $upstream_id The user's order ID if it is different from the Stripe order ID. + */ +class Order extends ApiResource +{ + const OBJECT_NAME = 'order'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\OrderReturn the newly created return + */ + public function returnOrder($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/returns'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + + return Util\Util::convertToStripeObject($response, $opts); + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return Order the paid order + */ + public function pay($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/pay'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/app/api/Stripe/OrderItem.php b/app/api/Stripe/OrderItem.php new file mode 100755 index 0000000..48c558d --- /dev/null +++ b/app/api/Stripe/OrderItem.php @@ -0,0 +1,19 @@ +order items. Returns always + * belong to an order, and may optionally contain a refund. + * + * Related guide: Handling + * Returns. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount for the returned line item. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property \Stripe\OrderItem[] $items The items included in this order return. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|string|\Stripe\Order $order The order that this return includes items from. + * @property null|string|\Stripe\Refund $refund The ID of the refund issued for this return. + */ +class OrderReturn extends ApiResource +{ + const OBJECT_NAME = 'order_return'; + + use ApiOperations\All; + use ApiOperations\Retrieve; +} diff --git a/app/api/Stripe/PaymentIntent.php b/app/api/Stripe/PaymentIntent.php new file mode 100755 index 0000000..67bf35e --- /dev/null +++ b/app/api/Stripe/PaymentIntent.php @@ -0,0 +1,125 @@ +multiple + * statuses throughout its lifetime as it interfaces with Stripe.js to perform + * authentication flows and ultimately creates at most one successful charge. + * + * Related guide: Payment Intents API. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the smallest currency unit (e.g., 100 cents to charge $1.00 or 100 to charge ¥100, a zero-decimal currency). The minimum amount is $0.50 US or equivalent in charge currency. The amount value supports up to eight digits (e.g., a value of 99999999 for a USD charge of $999,999.99). + * @property int $amount_capturable Amount that can be captured from this PaymentIntent. + * @property int $amount_received Amount that was collected by this PaymentIntent. + * @property null|string|\Stripe\StripeObject $application ID of the Connect application that created the PaymentIntent. + * @property null|int $application_fee_amount The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents use case for connected accounts. + * @property null|int $canceled_at Populated when status is canceled, this is the time at which the PaymentIntent was canceled. Measured in seconds since the Unix epoch. + * @property null|string $cancellation_reason Reason for cancellation of this PaymentIntent, either user-provided (duplicate, fraudulent, requested_by_customer, or abandoned) or generated by Stripe internally (failed_invoice, void_invoice, or automatic). + * @property string $capture_method Controls when the funds will be captured from the customer's account. + * @property \Stripe\Collection $charges Charges that were created by this PaymentIntent, if any. + * @property null|string $client_secret

The client secret of this PaymentIntent. Used for client-side retrieval using a publishable key.

The client secret can be used to complete a payment from your frontend. It should not be stored, logged, embedded in URLs, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.

Refer to our docs to accept a payment and learn about how client_secret should be handled.

+ * @property string $confirmation_method + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string|\Stripe\Customer $customer

ID of the Customer this PaymentIntent belongs to, if one exists.

Payment methods attached to other Customers cannot be used with this PaymentIntent.

If present in combination with setup_future_usage, this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete.

+ * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|string|\Stripe\Invoice $invoice ID of the invoice that created this PaymentIntent, if it exists. + * @property null|\Stripe\ErrorObject $last_payment_error The payment error encountered in the previous PaymentIntent confirmation. It will be cleared if the PaymentIntent is later updated for any reason. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. For more information, see the documentation. + * @property null|\Stripe\StripeObject $next_action If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source. + * @property null|string|\Stripe\Account $on_behalf_of The account (if any) for which the funds of the PaymentIntent are intended. See the PaymentIntents use case for connected accounts for details. + * @property null|string|\Stripe\PaymentMethod $payment_method ID of the payment method used in this PaymentIntent. + * @property null|\Stripe\StripeObject $payment_method_options Payment-method-specific configuration for this PaymentIntent. + * @property string[] $payment_method_types The list of payment method types (e.g. card) that this PaymentIntent is allowed to use. + * @property null|string $receipt_email Email address that the receipt for the resulting payment will be sent to. If receipt_email is specified for a payment in live mode, a receipt will be sent regardless of your email settings. + * @property null|string|\Stripe\Review $review ID of the review associated with this PaymentIntent, if any. + * @property null|string $setup_future_usage

Indicates that you intend to make future payments with this PaymentIntent's payment method.

Providing this parameter will attach the payment method to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be attached to a Customer after the transaction completes.

When processing card payments, Stripe also uses setup_future_usage to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA.

+ * @property null|\Stripe\StripeObject $shipping Shipping information for this PaymentIntent. + * @property null|string|\Stripe\Account|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source $source This is a legacy field that will be removed in the future. It is the ID of the Source object that is associated with this PaymentIntent, if one was supplied. + * @property null|string $statement_descriptor For non-card charges, you can use this value as the complete description that appears on your customers’ statements. Must contain at least one letter, maximum 22 characters. + * @property null|string $statement_descriptor_suffix Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that’s set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. + * @property string $status Status of this PaymentIntent, one of requires_payment_method, requires_confirmation, requires_action, processing, requires_capture, canceled, or succeeded. Read more about each PaymentIntent status. + * @property null|\Stripe\StripeObject $transfer_data The data with which to automatically create a Transfer when the payment is finalized. See the PaymentIntents use case for connected accounts for details. + * @property null|string $transfer_group A string that identifies the resulting payment as part of a group. See the PaymentIntents use case for connected accounts for details. + */ +class PaymentIntent extends ApiResource +{ + const OBJECT_NAME = 'payment_intent'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const STATUS_CANCELED = 'canceled'; + const STATUS_PROCESSING = 'processing'; + const STATUS_REQUIRES_ACTION = 'requires_action'; + const STATUS_REQUIRES_CAPTURE = 'requires_capture'; + const STATUS_REQUIRES_CONFIRMATION = 'requires_confirmation'; + const STATUS_REQUIRES_PAYMENT_METHOD = 'requires_payment_method'; + const STATUS_SUCCEEDED = 'succeeded'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return PaymentIntent the canceled payment intent + */ + public function cancel($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/cancel'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return PaymentIntent the captured payment intent + */ + public function capture($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/capture'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return PaymentIntent the confirmed payment intent + */ + public function confirm($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/confirm'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/app/api/Stripe/PaymentMethod.php b/app/api/Stripe/PaymentMethod.php new file mode 100755 index 0000000..f77e7bd --- /dev/null +++ b/app/api/Stripe/PaymentMethod.php @@ -0,0 +1,87 @@ +PaymentIntents to + * collect payments or saved to Customer objects to store instrument details for + * future payments. + * + * Related guides: Payment Methods and + * More Payment + * Scenarios. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property \Stripe\StripeObject $afterpay_clearpay + * @property \Stripe\StripeObject $alipay + * @property \Stripe\StripeObject $au_becs_debit + * @property \Stripe\StripeObject $bacs_debit + * @property \Stripe\StripeObject $bancontact + * @property \Stripe\StripeObject $billing_details + * @property \Stripe\StripeObject $card + * @property \Stripe\StripeObject $card_present + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string|\Stripe\Customer $customer The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer. + * @property \Stripe\StripeObject $eps + * @property \Stripe\StripeObject $fpx + * @property \Stripe\StripeObject $giropay + * @property \Stripe\StripeObject $grabpay + * @property \Stripe\StripeObject $ideal + * @property \Stripe\StripeObject $interac_present + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property \Stripe\StripeObject $oxxo + * @property \Stripe\StripeObject $p24 + * @property \Stripe\StripeObject $sepa_debit + * @property \Stripe\StripeObject $sofort + * @property string $type The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. + */ +class PaymentMethod extends ApiResource +{ + const OBJECT_NAME = 'payment_method'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return PaymentMethod the attached payment method + */ + public function attach($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/attach'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return PaymentMethod the detached payment method + */ + public function detach($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/detach'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/app/api/Stripe/Payout.php b/app/api/Stripe/Payout.php new file mode 100755 index 0000000..336042b --- /dev/null +++ b/app/api/Stripe/Payout.php @@ -0,0 +1,108 @@ +Payout object is created when you receive funds from Stripe, or + * when you initiate a payout to either a bank account or debit card of a connected Stripe account. You + * can retrieve individual payouts, as well as list all payouts. Payouts are made + * on varying schedules, + * depending on your country and industry. + * + * Related guide: Receiving Payouts. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount Amount (in %s) to be transferred to your bank account or debit card. + * @property int $arrival_date Date the payout is expected to arrive in the bank. This factors in delays like weekends or bank holidays. + * @property bool $automatic Returns true if the payout was created by an automated payout schedule, and false if it was requested manually. + * @property null|string|\Stripe\BalanceTransaction $balance_transaction ID of the balance transaction that describes the impact of this payout on your account balance. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|string|\Stripe\BankAccount|\Stripe\Card $destination ID of the bank account or card the payout was sent to. + * @property null|string|\Stripe\BalanceTransaction $failure_balance_transaction If the payout failed or was canceled, this will be the ID of the balance transaction that reversed the initial balance transaction, and puts the funds from the failed payout back in your balance. + * @property null|string $failure_code Error code explaining reason for payout failure if available. See Types of payout failures for a list of failure codes. + * @property null|string $failure_message Message to user further explaining reason for payout failure if available. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property string $method The method used to send this payout, which can be standard or instant. instant is only supported for payouts to debit cards. (See Instant payouts for marketplaces for more information.) + * @property null|string|\Stripe\Payout $original_payout If the payout reverses another, this is the ID of the original payout. + * @property null|string|\Stripe\Payout $reversed_by If the payout was reversed, this is the ID of the payout that reverses this payout. + * @property string $source_type The source balance this payout came from. One of card, fpx, or bank_account. + * @property null|string $statement_descriptor Extra information about a payout to be displayed on the user's bank statement. + * @property string $status Current status of the payout: paid, pending, in_transit, canceled or failed. A payout is pending until it is submitted to the bank, when it becomes in_transit. The status then changes to paid if the transaction goes through, or to failed or canceled (within 5 business days). Some failed payouts may initially show as paid but then change to failed. + * @property string $type Can be bank_account or card. + */ +class Payout extends ApiResource +{ + const OBJECT_NAME = 'payout'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const FAILURE_ACCOUNT_CLOSED = 'account_closed'; + const FAILURE_ACCOUNT_FROZEN = 'account_frozen'; + const FAILURE_BANK_ACCOUNT_RESTRICTED = 'bank_account_restricted'; + const FAILURE_BANK_OWNERSHIP_CHANGED = 'bank_ownership_changed'; + const FAILURE_COULD_NOT_PROCESS = 'could_not_process'; + const FAILURE_DEBIT_NOT_AUTHORIZED = 'debit_not_authorized'; + const FAILURE_DECLINED = 'declined'; + const FAILURE_INCORRECT_ACCOUNT_HOLDER_NAME = 'incorrect_account_holder_name'; + const FAILURE_INSUFFICIENT_FUNDS = 'insufficient_funds'; + const FAILURE_INVALID_ACCOUNT_NUMBER = 'invalid_account_number'; + const FAILURE_INVALID_CURRENCY = 'invalid_currency'; + const FAILURE_NO_ACCOUNT = 'no_account'; + const FAILURE_UNSUPPORTED_CARD = 'unsupported_card'; + + const METHOD_INSTANT = 'instant'; + const METHOD_STANDARD = 'standard'; + + const STATUS_CANCELED = 'canceled'; + const STATUS_FAILED = 'failed'; + const STATUS_IN_TRANSIT = 'in_transit'; + const STATUS_PAID = 'paid'; + const STATUS_PENDING = 'pending'; + + const TYPE_BANK_ACCOUNT = 'bank_account'; + const TYPE_CARD = 'card'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return Payout the canceled payout + */ + public function cancel($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/cancel'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return Payout the reversed payout + */ + public function reverse($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/reverse'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/app/api/Stripe/Person.php b/app/api/Stripe/Person.php new file mode 100755 index 0000000..aac6faf --- /dev/null +++ b/app/api/Stripe/Person.php @@ -0,0 +1,120 @@ +Standard onboarding + * or Express onboarding + * documentation for information about platform pre-filling and account + * onboarding steps. + * + * Related guide: Handling + * Identity Verification with the API. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property string $account The account the person is associated with. + * @property \Stripe\StripeObject $address + * @property null|\Stripe\StripeObject $address_kana The Kana variation of the person's address (Japan only). + * @property null|\Stripe\StripeObject $address_kanji The Kanji variation of the person's address (Japan only). + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property \Stripe\StripeObject $dob + * @property null|string $email The person's email address. + * @property null|string $first_name The person's first name. + * @property null|string $first_name_kana The Kana variation of the person's first name (Japan only). + * @property null|string $first_name_kanji The Kanji variation of the person's first name (Japan only). + * @property null|string $gender The person's gender (International regulations require either "male" or "female"). + * @property bool $id_number_provided Whether the person's id_number was provided. + * @property null|string $last_name The person's last name. + * @property null|string $last_name_kana The Kana variation of the person's last name (Japan only). + * @property null|string $last_name_kanji The Kanji variation of the person's last name (Japan only). + * @property null|string $maiden_name The person's maiden name. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|string $nationality The country where the person is a national. + * @property null|string $phone The person's phone number. + * @property string $political_exposure Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. + * @property \Stripe\StripeObject $relationship + * @property null|\Stripe\StripeObject $requirements Information about the requirements for this person, including what information needs to be collected, and by when. + * @property bool $ssn_last_4_provided Whether the last four digits of the person's Social Security number have been provided (U.S. only). + * @property \Stripe\StripeObject $verification + */ +class Person extends ApiResource +{ + const OBJECT_NAME = 'person'; + + use ApiOperations\Delete; + use ApiOperations\Update; + + const GENDER_FEMALE = 'female'; + const GENDER_MALE = 'male'; + + const POLITICAL_EXPOSURE_EXISTING = 'existing'; + const POLITICAL_EXPOSURE_NONE = 'none'; + + const VERIFICATION_STATUS_PENDING = 'pending'; + const VERIFICATION_STATUS_UNVERIFIED = 'unverified'; + const VERIFICATION_STATUS_VERIFIED = 'verified'; + + /** + * @return string the API URL for this Stripe account reversal + */ + public function instanceUrl() + { + $id = $this['id']; + $account = $this['account']; + if (!$id) { + throw new Exception\UnexpectedValueException( + 'Could not determine which URL to request: ' . + "class instance has invalid ID: {$id}", + null + ); + } + $id = Util\Util::utf8($id); + $account = Util\Util::utf8($account); + + $base = Account::classUrl(); + $accountExtn = \urlencode($account); + $extn = \urlencode($id); + + return "{$base}/{$accountExtn}/persons/{$extn}"; + } + + /** + * @param array|string $_id + * @param null|array|string $_opts + * + * @throws \Stripe\Exception\BadMethodCallException + */ + public static function retrieve($_id, $_opts = null) + { + $msg = 'Persons cannot be retrieved without an account ID. Retrieve ' . + "a person using `Account::retrievePerson('account_id', " . + "'person_id')`."; + + throw new Exception\BadMethodCallException($msg); + } + + /** + * @param string $_id + * @param null|array $_params + * @param null|array|string $_options + * + * @throws \Stripe\Exception\BadMethodCallException + */ + public static function update($_id, $_params = null, $_options = null) + { + $msg = 'Persons cannot be updated without an account ID. Update ' . + "a person using `Account::updatePerson('account_id', " . + "'person_id', \$updateParams)`."; + + throw new Exception\BadMethodCallException($msg); + } +} diff --git a/app/api/Stripe/Plan.php b/app/api/Stripe/Plan.php new file mode 100755 index 0000000..4a4133b --- /dev/null +++ b/app/api/Stripe/Plan.php @@ -0,0 +1,57 @@ +Prices API. It replaces the Plans + * API and is backwards compatible to simplify your migration. + * + * Plans define the base price, currency, and billing cycle for recurring purchases + * of products. Products help + * you track inventory or provisioning, and plans help you track pricing. Different + * physical goods or levels of service should be represented by products, and + * pricing options should be represented by plans. This approach lets you change + * prices without having to change your provisioning scheme. + * + * For example, you might have a single "gold" product that has plans for + * $10/month, $100/year, €9/month, and €90/year. + * + * Related guides: Set up + * a subscription and more about products and prices. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property bool $active Whether the plan can be used for new purchases. + * @property null|string $aggregate_usage Specifies a usage aggregation strategy for plans of usage_type=metered. Allowed values are sum for summing up all usage during a period, last_during_period for using the last usage record reported within a period, last_ever for using the last usage record ever (across period bounds) or max which uses the usage record with the maximum reported usage during a period. Defaults to sum. + * @property null|int $amount The unit amount in %s to be charged, represented as a whole integer if possible. Only set if billing_scheme=per_unit. + * @property null|string $amount_decimal The unit amount in %s to be charged, represented as a decimal string with at most 12 decimal places. Only set if billing_scheme=per_unit. + * @property string $billing_scheme Describes how to compute the price per period. Either per_unit or tiered. per_unit indicates that the fixed amount (specified in amount) will be charged per unit in quantity (for plans with usage_type=licensed), or per unit of total usage (for plans with usage_type=metered). tiered indicates that the unit pricing will be computed using a tiering strategy as defined using the tiers and tiers_mode attributes. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property string $interval The frequency at which a subscription is billed. One of day, week, month or year. + * @property int $interval_count The number of intervals (specified in the interval attribute) between subscription billings. For example, interval=month and interval_count=3 bills every 3 months. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|string $nickname A brief description of the plan, hidden from customers. + * @property null|string|\Stripe\Product $product The product whose pricing this plan determines. + * @property \Stripe\StripeObject[] $tiers Each element represents a pricing tier. This parameter requires billing_scheme to be set to tiered. See also the documentation for billing_scheme. + * @property null|string $tiers_mode Defines if the tiering price should be graduated or volume based. In volume-based tiering, the maximum quantity within a period determines the per unit price. In graduated tiering, pricing can change as the quantity grows. + * @property null|\Stripe\StripeObject $transform_usage Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with tiers. + * @property null|int $trial_period_days Default number of trial days when subscribing a customer to this plan using trial_from_plan=true. + * @property string $usage_type Configures how the quantity per period should be determined. Can be either metered or licensed. licensed automatically bills the quantity set when adding it to a subscription. metered aggregates the total usage based on usage records. Defaults to licensed. + */ +class Plan extends ApiResource +{ + const OBJECT_NAME = 'plan'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Delete; + use ApiOperations\Retrieve; + use ApiOperations\Update; +} diff --git a/app/api/Stripe/Price.php b/app/api/Stripe/Price.php new file mode 100755 index 0000000..d7eaa9b --- /dev/null +++ b/app/api/Stripe/Price.php @@ -0,0 +1,62 @@ +Products help you track + * inventory or provisioning, and prices help you track payment terms. Different + * physical goods or levels of service should be represented by products, and + * pricing options should be represented by prices. This approach lets you change + * prices without having to change your provisioning scheme. + * + * For example, you might have a single "gold" product that has prices + * for $10/month, $100/year, and €9 once. + * + * Related guides: Set up + * a subscription, create an invoice, + * and more about products + * and prices. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property bool $active Whether the price can be used for new purchases. + * @property string $billing_scheme Describes how to compute the price per period. Either per_unit or tiered. per_unit indicates that the fixed amount (specified in unit_amount or unit_amount_decimal) will be charged per unit in quantity (for prices with usage_type=licensed), or per unit of total usage (for prices with usage_type=metered). tiered indicates that the unit pricing will be computed using a tiering strategy as defined using the tiers and tiers_mode attributes. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|string $lookup_key A lookup key used to retrieve prices dynamically from a static string. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|string $nickname A brief description of the plan, hidden from customers. + * @property string|\Stripe\Product $product The ID of the product this price is associated with. + * @property null|\Stripe\StripeObject $recurring The recurring components of a price such as interval and usage_type. + * @property \Stripe\StripeObject[] $tiers Each element represents a pricing tier. This parameter requires billing_scheme to be set to tiered. See also the documentation for billing_scheme. + * @property null|string $tiers_mode Defines if the tiering price should be graduated or volume based. In volume-based tiering, the maximum quantity within a period determines the per unit price. In graduated tiering, pricing can change as the quantity grows. + * @property null|\Stripe\StripeObject $transform_quantity Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with tiers. + * @property string $type One of one_time or recurring depending on whether the price is for a one-time purchase or a recurring (subscription) purchase. + * @property null|int $unit_amount The unit amount in %s to be charged, represented as a whole integer if possible. Only set if billing_scheme=per_unit. + * @property null|string $unit_amount_decimal The unit amount in %s to be charged, represented as a decimal string with at most 12 decimal places. Only set if billing_scheme=per_unit. + */ +class Price extends ApiResource +{ + const OBJECT_NAME = 'price'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const BILLING_SCHEME_PER_UNIT = 'per_unit'; + const BILLING_SCHEME_TIERED = 'tiered'; + + const TIERS_MODE_GRADUATED = 'graduated'; + const TIERS_MODE_VOLUME = 'volume'; + + const TYPE_ONE_TIME = 'one_time'; + const TYPE_RECURRING = 'recurring'; +} diff --git a/app/api/Stripe/Product.php b/app/api/Stripe/Product.php new file mode 100755 index 0000000..fffdbf5 --- /dev/null +++ b/app/api/Stripe/Product.php @@ -0,0 +1,53 @@ +Prices to + * configure pricing in Checkout and Subscriptions. + * + * Related guides: Set up + * a subscription or accept one-time + * payments with Checkout and more about Products and Prices + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property bool $active Whether the product is currently available for purchase. + * @property null|string[] $attributes A list of up to 5 attributes that each SKU can provide values for (e.g., ["color", "size"]). + * @property null|string $caption A short one-line description of the product, meant to be displayable to the customer. Only applicable to products of type=good. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string[] $deactivate_on An array of connect application identifiers that cannot purchase this product. Only applicable to products of type=good. + * @property null|string $description The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. + * @property string[] $images A list of up to 8 URLs of images for this product, meant to be displayable to the customer. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property string $name The product's name, meant to be displayable to the customer. Whenever this product is sold via a subscription, name will show up on associated invoice line item descriptions. + * @property null|\Stripe\StripeObject $package_dimensions The dimensions of this product for shipping purposes. A SKU associated with this product can override this value by having its own package_dimensions. Only applicable to products of type=good. + * @property null|bool $shippable Whether this product is a shipped good. Only applicable to products of type=good. + * @property null|string $statement_descriptor Extra information about a product which will appear on your customer's credit card statement. In the case that multiple products are billed at once, the first statement descriptor will be used. + * @property string $type The type of the product. The product is either of type good, which is eligible for use with Orders and SKUs, or service, which is eligible for use with Subscriptions and Plans. + * @property null|string $unit_label A label that represents units of this product in Stripe and on customers’ receipts and invoices. When set, this will be included in associated invoice line item descriptions. + * @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch. + * @property null|string $url A URL of a publicly-accessible webpage for this product. Only applicable to products of type=good. + */ +class Product extends ApiResource +{ + const OBJECT_NAME = 'product'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Delete; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const TYPE_GOOD = 'good'; + const TYPE_SERVICE = 'service'; +} diff --git a/app/api/Stripe/PromotionCode.php b/app/api/Stripe/PromotionCode.php new file mode 100755 index 0000000..29bf65b --- /dev/null +++ b/app/api/Stripe/PromotionCode.php @@ -0,0 +1,33 @@ +invoices or orders. Coupons do not work with conventional one-off charges. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string|\Stripe\Customer $customer The customer that this promotion code can be used by. + * @property null|int $expires_at Date at which the promotion code can no longer be redeemed. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|int $max_redemptions Maximum number of times this promotion code can be redeemed. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property \Stripe\StripeObject $restrictions + * @property int $times_redeemed Number of times this promotion code has been used. + */ +class PromotionCode extends ApiResource +{ + const OBJECT_NAME = 'promotion_code'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; +} diff --git a/app/api/Stripe/Radar/EarlyFraudWarning.php b/app/api/Stripe/Radar/EarlyFraudWarning.php new file mode 100755 index 0000000..d428ac2 --- /dev/null +++ b/app/api/Stripe/Radar/EarlyFraudWarning.php @@ -0,0 +1,37 @@ +Early + * Fraud Warnings. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property bool $actionable An EFW is actionable if it has not received a dispute and has not been fully refunded. You may wish to proactively refund a charge that receives an EFW, in order to avoid receiving a dispute later. + * @property string|\Stripe\Charge $charge ID of the charge this early fraud warning is for, optionally expanded. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $fraud_type The type of fraud labelled by the issuer. One of card_never_received, fraudulent_card_application, made_with_counterfeit_card, made_with_lost_card, made_with_stolen_card, misc, unauthorized_use_of_card. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + */ +class EarlyFraudWarning extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'radar.early_fraud_warning'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Retrieve; + + const FRAUD_TYPE_CARD_NEVER_RECEIVED = 'card_never_received'; + const FRAUD_TYPE_FRAUDULENT_CARD_APPLICATION = 'fraudulent_card_application'; + const FRAUD_TYPE_MADE_WITH_COUNTERFEIT_CARD = 'made_with_counterfeit_card'; + const FRAUD_TYPE_MADE_WITH_LOST_CARD = 'made_with_lost_card'; + const FRAUD_TYPE_MADE_WITH_STOLEN_CARD = 'made_with_stolen_card'; + const FRAUD_TYPE_MISC = 'misc'; + const FRAUD_TYPE_UNAUTHORIZED_USE_OF_CARD = 'unauthorized_use_of_card'; +} diff --git a/app/api/Stripe/Radar/ValueList.php b/app/api/Stripe/Radar/ValueList.php new file mode 100755 index 0000000..e3425ed --- /dev/null +++ b/app/api/Stripe/Radar/ValueList.php @@ -0,0 +1,35 @@ +Default Stripe + * Lists. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property string $alias The name of the value list for use in rules. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $created_by The name or email address of the user who created this value list. + * @property string $item_type The type of items in the value list. One of card_fingerprint, card_bin, email, ip_address, country, string, or case_sensitive_string. + * @property \Stripe\Collection $list_items List of items contained within this value list. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property string $name The name of the value list. + */ +class ValueList extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'radar.value_list'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Delete; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; +} diff --git a/app/api/Stripe/Radar/ValueListItem.php b/app/api/Stripe/Radar/ValueListItem.php new file mode 100755 index 0000000..42c830d --- /dev/null +++ b/app/api/Stripe/Radar/ValueListItem.php @@ -0,0 +1,31 @@ +Managing List + * Items. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $created_by The name or email address of the user who added this item to the value list. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property string $value The value of the item. + * @property string $value_list The identifier of the value list this item belongs to. + */ +class ValueListItem extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'radar.value_list_item'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Delete; + use \Stripe\ApiOperations\Retrieve; +} diff --git a/app/api/Stripe/Recipient.php b/app/api/Stripe/Recipient.php new file mode 100755 index 0000000..5041cfd --- /dev/null +++ b/app/api/Stripe/Recipient.php @@ -0,0 +1,44 @@ +Recipient objects, you can transfer money from your Stripe + * account to a third-party bank account or debit card. The API allows you to + * create, delete, and update your recipients. You can retrieve individual + * recipients as well as a list of all your recipients. + * + * Recipient objects have been deprecated in favor of Connect, specifically Connect's much + * more powerful Account objects. + * Stripe accounts that don't already use recipients can no longer begin doing so. + * Please use Account objects instead. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|\Stripe\BankAccount $active_account Hash describing the current account on the recipient, if there is one. + * @property null|\Stripe\Collection $cards + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string|\Stripe\Card $default_card The default card to use for creating transfers to this recipient. + * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|string $email + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|string|\Stripe\Account $migrated_to The ID of the Custom account this recipient was migrated to. If set, the recipient can no longer be updated, nor can transfers be made to it: use the Custom account instead. + * @property null|string $name Full, legal name of the recipient. + * @property string|\Stripe\Account $rolled_back_from + * @property string $type Type of the recipient, one of individual or corporation. + * @property bool $verified Whether the recipient has been verified. This field is non-standard, and maybe removed in the future + */ +class Recipient extends ApiResource +{ + const OBJECT_NAME = 'recipient'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Delete; + use ApiOperations\Retrieve; + use ApiOperations\Update; +} diff --git a/app/api/Stripe/RecipientTransfer.php b/app/api/Stripe/RecipientTransfer.php new file mode 100755 index 0000000..c92c611 --- /dev/null +++ b/app/api/Stripe/RecipientTransfer.php @@ -0,0 +1,36 @@ +Refund objects allow you to refund a charge that has previously + * been created but not yet refunded. Funds will be refunded to the credit or debit + * card that was originally charged. + * + * Related guide: Refunds. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount Amount, in %s. + * @property null|string|\Stripe\BalanceTransaction $balance_transaction Balance transaction that describes the impact on your account balance. + * @property null|string|\Stripe\Charge $charge ID of the charge that was refunded. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property string $description An arbitrary string attached to the object. Often useful for displaying to users. (Available on non-card refunds only) + * @property string|\Stripe\BalanceTransaction $failure_balance_transaction If the refund failed, this balance transaction describes the adjustment made on your account balance that reverses the initial balance transaction. + * @property string $failure_reason If the refund failed, the reason for refund failure if known. Possible values are lost_or_stolen_card, expired_or_canceled_card, or unknown. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|string|\Stripe\PaymentIntent $payment_intent ID of the PaymentIntent that was refunded. + * @property null|string $reason Reason for the refund, either user-provided (duplicate, fraudulent, or requested_by_customer) or generated by Stripe internally (expired_uncaptured_charge). + * @property null|string $receipt_number This is the transaction number that appears on email receipts sent for this refund. + * @property null|string|\Stripe\TransferReversal $source_transfer_reversal The transfer reversal that is associated with the refund. Only present if the charge came from another Stripe account. See the Connect documentation for details. + * @property null|string $status Status of the refund. For credit card refunds, this can be pending, succeeded, or failed. For other types of refunds, it can be pending, succeeded, failed, or canceled. Refer to our refunds documentation for more details. + * @property null|string|\Stripe\TransferReversal $transfer_reversal If the accompanying transfer was reversed, the transfer reversal object. Only applicable if the charge was created using the destination parameter. + */ +class Refund extends ApiResource +{ + const OBJECT_NAME = 'refund'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const FAILURE_REASON_EXPIRED_OR_CANCELED_CARD = 'expired_or_canceled_card'; + const FAILURE_REASON_LOST_OR_STOLEN_CARD = 'lost_or_stolen_card'; + const FAILURE_REASON_UNKNOWN = 'unknown'; + + const REASON_DUPLICATE = 'duplicate'; + const REASON_FRAUDULENT = 'fraudulent'; + const REASON_REQUESTED_BY_CUSTOMER = 'requested_by_customer'; + + const STATUS_CANCELED = 'canceled'; + const STATUS_FAILED = 'failed'; + const STATUS_PENDING = 'pending'; + const STATUS_SUCCEEDED = 'succeeded'; + + /** + * @deprecated use FAILURE_REASON_EXPIRED_OR_CANCELED_CARD instead + */ + const FAILURE_REASON = 'expired_or_canceled_card'; +} diff --git a/app/api/Stripe/Reporting/ReportRun.php b/app/api/Stripe/Reporting/ReportRun.php new file mode 100755 index 0000000..6bdd1c1 --- /dev/null +++ b/app/api/Stripe/Reporting/ReportRun.php @@ -0,0 +1,37 @@ +API Access to + * Reports. + * + * Note that reports can only be run based on your live-mode data (not test-mode + * data), and thus related requests must be made with a live-mode API key. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string $error If something should go wrong during the run, a message about the failure (populated when status=failed). + * @property bool $livemode Always true: reports can only be run on live-mode data. + * @property \Stripe\StripeObject $parameters + * @property string $report_type The ID of the report type to run, such as "balance.summary.1". + * @property null|\Stripe\File $result The file object representing the result of the report run (populated when status=succeeded). + * @property string $status Status of this report run. This will be pending when the run is initially created. When the run finishes, this will be set to succeeded and the result field will be populated. Rarely, we may encounter an error, at which point this will be set to failed and the error field will be populated. + * @property null|int $succeeded_at Timestamp at which this run successfully finished (populated when status=succeeded). Measured in seconds since the Unix epoch. + */ +class ReportRun extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'reporting.report_run'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Retrieve; +} diff --git a/app/api/Stripe/Reporting/ReportType.php b/app/api/Stripe/Reporting/ReportType.php new file mode 100755 index 0000000..99f0c52 --- /dev/null +++ b/app/api/Stripe/Reporting/ReportType.php @@ -0,0 +1,34 @@ +API Access to Reports + * documentation for those Report Type IDs, along with required and optional + * parameters. + * + * Note that reports can only be run based on your live-mode data (not test-mode + * data), and thus related requests must be made with a live-mode API key. + * + * @property string $id The ID of the Report Type, such as balance.summary.1. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $data_available_end Most recent time for which this Report Type is available. Measured in seconds since the Unix epoch. + * @property int $data_available_start Earliest time for which this Report Type is available. Measured in seconds since the Unix epoch. + * @property null|string[] $default_columns List of column names that are included by default when this Report Type gets run. (If the Report Type doesn't support the columns parameter, this will be null.) + * @property string $name Human-readable name of the Report Type + * @property int $updated When this Report Type was latest updated. Measured in seconds since the Unix epoch. + * @property int $version Version of the Report Type. Different versions report with the same ID will have the same purpose, but may take different run parameters or have different result schemas. + */ +class ReportType extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'reporting.report_type'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Retrieve; +} diff --git a/app/api/Stripe/RequestTelemetry.php b/app/api/Stripe/RequestTelemetry.php new file mode 100755 index 0000000..00832a7 --- /dev/null +++ b/app/api/Stripe/RequestTelemetry.php @@ -0,0 +1,26 @@ +requestId = $requestId; + $this->requestDuration = $requestDuration; + } +} diff --git a/app/api/Stripe/Review.php b/app/api/Stripe/Review.php new file mode 100755 index 0000000..7f23b9f --- /dev/null +++ b/app/api/Stripe/Review.php @@ -0,0 +1,66 @@ +Radar and reviewing payments here. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|string $billing_zip The ZIP or postal code of the card used, if applicable. + * @property null|string|\Stripe\Charge $charge The charge associated with this review. + * @property null|string $closed_reason The reason the review was closed, or null if it has not yet been closed. One of approved, refunded, refunded_as_fraud, or disputed. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string $ip_address The IP address where the payment originated. + * @property null|\Stripe\StripeObject $ip_address_location Information related to the location of the payment. Note that this information is an approximation and attempts to locate the nearest population center - it should not be used to determine a specific address. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property bool $open If true, the review needs action. + * @property string $opened_reason The reason the review was opened. One of rule or manual. + * @property string|\Stripe\PaymentIntent $payment_intent The PaymentIntent ID associated with this review, if one exists. + * @property string $reason The reason the review is currently open or closed. One of rule, manual, approved, refunded, refunded_as_fraud, or disputed. + * @property null|\Stripe\StripeObject $session Information related to the browsing session of the user who initiated the payment. + */ +class Review extends ApiResource +{ + const OBJECT_NAME = 'review'; + + use ApiOperations\All; + use ApiOperations\Retrieve; + + /** + * Possible string representations of the current, the opening or the closure reason of the review. + * Not all of these enumeration apply to all of the ´reason´ fields. Please consult the Review object to + * determine where these are apply. + * + * @see https://stripe.com/docs/api/radar/reviews/object + */ + const REASON_APPROVED = 'approved'; + const REASON_DISPUTED = 'disputed'; + const REASON_MANUAL = 'manual'; + const REASON_REFUNDED = 'refunded'; + const REASON_REFUNDED_AS_FRAUD = 'refunded_as_fraud'; + const REASON_RULE = 'rule'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return Review the approved review + */ + public function approve($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/approve'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/app/api/Stripe/SKU.php b/app/api/Stripe/SKU.php new file mode 100755 index 0000000..6c03061 --- /dev/null +++ b/app/api/Stripe/SKU.php @@ -0,0 +1,44 @@ +stock keeping units. + * SKUs describe specific product variations, taking into account any combination + * of: attributes, currency, and cost. For example, a product may be a T-shirt, + * whereas a specific SKU represents the size: large, color: + * red version of that shirt. + * + * Can also be used to manage inventory. + * + * Related guide: Tax, Shipping, and + * Inventory. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property bool $active Whether the SKU is available for purchase. + * @property \Stripe\StripeObject $attributes A dictionary of attributes and values for the attributes defined by the product. If, for example, a product's attributes are ["size", "gender"], a valid SKU has the following dictionary of attributes: {"size": "Medium", "gender": "Unisex"}. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string $image The URL of an image for this SKU, meant to be displayable to the customer. + * @property \Stripe\StripeObject $inventory + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|\Stripe\StripeObject $package_dimensions The dimensions of this SKU for shipping purposes. + * @property int $price The cost of the item as a positive integer in the smallest currency unit (that is, 100 cents to charge $1.00, or 100 to charge ¥100, Japanese Yen being a zero-decimal currency). + * @property string|\Stripe\Product $product The ID of the product this SKU is associated with. The product must be currently active. + * @property int $updated Time at which the object was last updated. Measured in seconds since the Unix epoch. + */ +class SKU extends ApiResource +{ + const OBJECT_NAME = 'sku'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Delete; + use ApiOperations\Retrieve; + use ApiOperations\Update; +} diff --git a/app/api/Stripe/Service/AbstractService.php b/app/api/Stripe/Service/AbstractService.php new file mode 100755 index 0000000..6e2c330 --- /dev/null +++ b/app/api/Stripe/Service/AbstractService.php @@ -0,0 +1,79 @@ +client = $client; + } + + /** + * Gets the client used by this service to send requests. + * + * @return \Stripe\StripeClientInterface + */ + public function getClient() + { + return $this->client; + } + + /** + * Translate null values to empty strings. For service methods, + * we interpret null as a request to unset the field, which + * corresponds to sending an empty string for the field to the + * API. + * + * @param null|array $params + */ + private static function formatParams($params) + { + if (null === $params) { + return null; + } + \array_walk_recursive($params, function (&$value, $key) { + if (null === $value) { + $value = ''; + } + }); + + return $params; + } + + protected function request($method, $path, $params, $opts) + { + return $this->getClient()->request($method, $path, static::formatParams($params), $opts); + } + + protected function requestCollection($method, $path, $params, $opts) + { + return $this->getClient()->requestCollection($method, $path, static::formatParams($params), $opts); + } + + protected function buildPath($basePath, ...$ids) + { + foreach ($ids as $id) { + if (null === $id || '' === \trim($id)) { + $msg = 'The resource ID cannot be null or whitespace.'; + + throw new \Stripe\Exception\InvalidArgumentException($msg); + } + } + + return \sprintf($basePath, ...\array_map('\urlencode', $ids)); + } +} diff --git a/app/api/Stripe/Service/AbstractServiceFactory.php b/app/api/Stripe/Service/AbstractServiceFactory.php new file mode 100755 index 0000000..f11f5f3 --- /dev/null +++ b/app/api/Stripe/Service/AbstractServiceFactory.php @@ -0,0 +1,59 @@ + */ + private $services; + + /** + * @param \Stripe\StripeClientInterface $client + */ + public function __construct($client) + { + $this->client = $client; + $this->services = []; + } + + /** + * @param string $name + * + * @return null|string + */ + abstract protected function getServiceClass($name); + + /** + * @param string $name + * + * @return null|AbstractService|AbstractServiceFactory + */ + public function __get($name) + { + $serviceClass = $this->getServiceClass($name); + if (null !== $serviceClass) { + if (!\array_key_exists($name, $this->services)) { + $this->services[$name] = new $serviceClass($this->client); + } + + return $this->services[$name]; + } + + \trigger_error('Undefined property: ' . static::class . '::$' . $name); + + return null; + } +} diff --git a/app/api/Stripe/Service/AccountLinkService.php b/app/api/Stripe/Service/AccountLinkService.php new file mode 100755 index 0000000..46894b9 --- /dev/null +++ b/app/api/Stripe/Service/AccountLinkService.php @@ -0,0 +1,25 @@ +request('post', '/v1/account_links', $params, $opts); + } +} diff --git a/app/api/Stripe/Service/AccountService.php b/app/api/Stripe/Service/AccountService.php new file mode 100755 index 0000000..2b5b188 --- /dev/null +++ b/app/api/Stripe/Service/AccountService.php @@ -0,0 +1,381 @@ +Connect. If you’re not a platform, the list is empty. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/accounts', $params, $opts); + } + + /** + * Returns a list of capabilities associated with the account. The capabilities are + * returned sorted by creation date, with the most recent capability appearing + * first. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function allCapabilities($parentId, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/accounts/%s/capabilities', $parentId), $params, $opts); + } + + /** + * List external accounts for an account. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function allExternalAccounts($parentId, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/accounts/%s/external_accounts', $parentId), $params, $opts); + } + + /** + * Returns a list of people associated with the account’s legal entity. The people + * are returned sorted by creation date, with the most recent people appearing + * first. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function allPersons($parentId, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/accounts/%s/persons', $parentId), $params, $opts); + } + + /** + * With Connect, you can create Stripe accounts for + * your users. To do this, you’ll first need to register your + * platform. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Account + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/accounts', $params, $opts); + } + + /** + * Create an external account for a given account. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BankAccount|\Stripe\Card + */ + public function createExternalAccount($parentId, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/accounts/%s/external_accounts', $parentId), $params, $opts); + } + + /** + * Creates a single-use login link for an Express account to access their Stripe + * dashboard. + * + * You may only create login links for Express accounts connected to your + * platform. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\LoginLink + */ + public function createLoginLink($parentId, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/accounts/%s/login_links', $parentId), $params, $opts); + } + + /** + * Creates a new person. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Person + */ + public function createPerson($parentId, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/accounts/%s/persons', $parentId), $params, $opts); + } + + /** + * With Connect, you can delete Custom or Express + * accounts you manage. + * + * Accounts created using test-mode keys can be deleted at any time. Accounts + * created using live-mode keys can only be deleted once all balances are zero. + * + * If you want to delete your own account, use the account information tab in your + * account settings instead. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Account + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/accounts/%s', $id), $params, $opts); + } + + /** + * Delete a specified external account for a given account. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BankAccount|\Stripe\Card + */ + public function deleteExternalAccount($parentId, $id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/accounts/%s/external_accounts/%s', $parentId, $id), $params, $opts); + } + + /** + * Deletes an existing person’s relationship to the account’s legal entity. Any + * person with a relationship for an account can be deleted through the API, except + * if the person is the account_opener. If your integration is using + * the executive parameter, you cannot delete the only verified + * executive on file. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Person + */ + public function deletePerson($parentId, $id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/accounts/%s/persons/%s', $parentId, $id), $params, $opts); + } + + /** + * With Connect, you may flag accounts as suspicious. + * + * Test-mode Custom and Express accounts can be rejected at any time. Accounts + * created using live-mode keys may only be rejected once all balances are zero. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Account + */ + public function reject($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/accounts/%s/reject', $id), $params, $opts); + } + + /** + * Retrieves information about the specified Account Capability. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Capability + */ + public function retrieveCapability($parentId, $id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/accounts/%s/capabilities/%s', $parentId, $id), $params, $opts); + } + + /** + * Retrieve a specified external account for a given account. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BankAccount|\Stripe\Card + */ + public function retrieveExternalAccount($parentId, $id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/accounts/%s/external_accounts/%s', $parentId, $id), $params, $opts); + } + + /** + * Retrieves an existing person. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Person + */ + public function retrievePerson($parentId, $id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/accounts/%s/persons/%s', $parentId, $id), $params, $opts); + } + + /** + * Updates a connected Express or Custom + * account by setting the values of the parameters passed. Any parameters not + * provided are left unchanged. Most parameters can be changed only for Custom + * accounts. (These are marked Custom Only below.) Parameters + * marked Custom and Express are supported by both account types. + * + * To update your own account, use the Dashboard. Refer to our Connect documentation to learn more + * about updating accounts. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Account + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/accounts/%s', $id), $params, $opts); + } + + /** + * Updates an existing Account Capability. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Capability + */ + public function updateCapability($parentId, $id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/accounts/%s/capabilities/%s', $parentId, $id), $params, $opts); + } + + /** + * Updates the metadata, account holder name, and account holder type of a bank + * account belonging to a Custom + * account, and optionally sets it as the default for its currency. Other bank + * account details are not editable by design. + * + * You can re-enable a disabled bank account by performing an update call without + * providing any arguments or changes. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BankAccount|\Stripe\Card + */ + public function updateExternalAccount($parentId, $id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/accounts/%s/external_accounts/%s', $parentId, $id), $params, $opts); + } + + /** + * Updates an existing person. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Person + */ + public function updatePerson($parentId, $id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/accounts/%s/persons/%s', $parentId, $id), $params, $opts); + } + + /** + * Retrieves the details of an account. + * + * @param null|string $id + * @param null|array $params + * @param null|array|StripeUtilRequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Account + */ + public function retrieve($id = null, $params = null, $opts = null) + { + if (null === $id) { + return $this->request('get', '/v1/account', $params, $opts); + } + + return $this->request('get', $this->buildPath('/v1/accounts/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/ApplePayDomainService.php b/app/api/Stripe/Service/ApplePayDomainService.php new file mode 100755 index 0000000..6957149 --- /dev/null +++ b/app/api/Stripe/Service/ApplePayDomainService.php @@ -0,0 +1,70 @@ +requestCollection('get', '/v1/apple_pay/domains', $params, $opts); + } + + /** + * Create an apple pay domain. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ApplePayDomain + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/apple_pay/domains', $params, $opts); + } + + /** + * Delete an apple pay domain. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ApplePayDomain + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/apple_pay/domains/%s', $id), $params, $opts); + } + + /** + * Retrieve an apple pay domain. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ApplePayDomain + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/apple_pay/domains/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/ApplicationFeeService.php b/app/api/Stripe/Service/ApplicationFeeService.php new file mode 100755 index 0000000..9224084 --- /dev/null +++ b/app/api/Stripe/Service/ApplicationFeeService.php @@ -0,0 +1,125 @@ +requestCollection('get', '/v1/application_fees', $params, $opts); + } + + /** + * You can see a list of the refunds belonging to a specific application fee. Note + * that the 10 most recent refunds are always available by default on the + * application fee object. If you need more than those 10, you can use this API + * method and the limit and starting_after parameters to + * page through additional refunds. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function allRefunds($parentId, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/application_fees/%s/refunds', $parentId), $params, $opts); + } + + /** + * Refunds an application fee that has previously been collected but not yet + * refunded. Funds will be refunded to the Stripe account from which the fee was + * originally collected. + * + * You can optionally refund only part of an application fee. You can do so + * multiple times, until the entire fee has been refunded. + * + * Once entirely refunded, an application fee can’t be refunded again. This method + * will raise an error when called on an already-refunded application fee, or when + * trying to refund more money than is left on an application fee. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ApplicationFeeRefund + */ + public function createRefund($parentId, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/application_fees/%s/refunds', $parentId), $params, $opts); + } + + /** + * Retrieves the details of an application fee that your account has collected. The + * same information is returned when refunding the application fee. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ApplicationFee + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/application_fees/%s', $id), $params, $opts); + } + + /** + * By default, you can see the 10 most recent refunds stored directly on the + * application fee object, but you can also retrieve details about a specific + * refund stored on the application fee. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ApplicationFeeRefund + */ + public function retrieveRefund($parentId, $id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/application_fees/%s/refunds/%s', $parentId, $id), $params, $opts); + } + + /** + * Updates the specified application fee refund by setting the values of the + * parameters passed. Any parameters not provided will be left unchanged. + * + * This request only accepts metadata as an argument. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ApplicationFeeRefund + */ + public function updateRefund($parentId, $id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/application_fees/%s/refunds/%s', $parentId, $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/BalanceService.php b/app/api/Stripe/Service/BalanceService.php new file mode 100755 index 0000000..b76c455 --- /dev/null +++ b/app/api/Stripe/Service/BalanceService.php @@ -0,0 +1,26 @@ +Accounting + * for negative balances. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Balance + */ + public function retrieve($params = null, $opts = null) + { + return $this->request('get', '/v1/balance', $params, $opts); + } +} diff --git a/app/api/Stripe/Service/BalanceTransactionService.php b/app/api/Stripe/Service/BalanceTransactionService.php new file mode 100755 index 0000000..900abbd --- /dev/null +++ b/app/api/Stripe/Service/BalanceTransactionService.php @@ -0,0 +1,47 @@ +/v1/balance/history. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/balance_transactions', $params, $opts); + } + + /** + * Retrieves the balance transaction with the given ID. + * + * Note that this endpoint previously used the path + * /v1/balance/history/:id. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BalanceTransaction + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/balance_transactions/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/BillingPortal/BillingPortalServiceFactory.php b/app/api/Stripe/Service/BillingPortal/BillingPortalServiceFactory.php new file mode 100755 index 0000000..9d1df0f --- /dev/null +++ b/app/api/Stripe/Service/BillingPortal/BillingPortalServiceFactory.php @@ -0,0 +1,27 @@ + + */ + private static $classMap = [ + 'configurations' => ConfigurationService::class, + 'sessions' => SessionService::class, + ]; + + protected function getServiceClass($name) + { + return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; + } +} diff --git a/app/api/Stripe/Service/BillingPortal/ConfigurationService.php b/app/api/Stripe/Service/BillingPortal/ConfigurationService.php new file mode 100755 index 0000000..f9569f1 --- /dev/null +++ b/app/api/Stripe/Service/BillingPortal/ConfigurationService.php @@ -0,0 +1,73 @@ +requestCollection('get', '/v1/billing_portal/configurations', $params, $opts); + } + + /** + * Creates a configuration that describes the functionality and behavior of a + * PortalSession. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BillingPortal\Configuration + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/billing_portal/configurations', $params, $opts); + } + + /** + * Retrieves a configuration that describes the functionality of the customer + * portal. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BillingPortal\Configuration + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/billing_portal/configurations/%s', $id), $params, $opts); + } + + /** + * Updates a configuration that describes the functionality of the customer portal. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\BillingPortal\Configuration + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/billing_portal/configurations/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/BillingPortal/SessionService.php b/app/api/Stripe/Service/BillingPortal/SessionService.php new file mode 100755 index 0000000..e508c2a --- /dev/null +++ b/app/api/Stripe/Service/BillingPortal/SessionService.php @@ -0,0 +1,23 @@ +request('post', '/v1/billing_portal/sessions', $params, $opts); + } +} diff --git a/app/api/Stripe/Service/ChargeService.php b/app/api/Stripe/Service/ChargeService.php new file mode 100755 index 0000000..c1ed47e --- /dev/null +++ b/app/api/Stripe/Service/ChargeService.php @@ -0,0 +1,101 @@ +requestCollection('get', '/v1/charges', $params, $opts); + } + + /** + * Capture the payment of an existing, uncaptured, charge. This is the second half + * of the two-step payment flow, where first you created a + * charge with the capture option set to false. + * + * Uncaptured payments expire exactly seven days after they are created. If they + * are not captured by that point in time, they will be marked as refunded and will + * no longer be capturable. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Charge + */ + public function capture($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/charges/%s/capture', $id), $params, $opts); + } + + /** + * To charge a credit card or other payment source, you create a + * Charge object. If your API key is in test mode, the supplied + * payment source (e.g., card) won’t actually be charged, although everything else + * will occur as if in live mode. (Stripe assumes that the charge would have + * completed successfully). + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Charge + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/charges', $params, $opts); + } + + /** + * Retrieves the details of a charge that has previously been created. Supply the + * unique charge ID that was returned from your previous request, and Stripe will + * return the corresponding charge information. The same information is returned + * when creating or refunding the charge. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Charge + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/charges/%s', $id), $params, $opts); + } + + /** + * Updates the specified charge by setting the values of the parameters passed. Any + * parameters not provided will be left unchanged. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Charge + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/charges/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/Checkout/CheckoutServiceFactory.php b/app/api/Stripe/Service/Checkout/CheckoutServiceFactory.php new file mode 100755 index 0000000..26a5ee8 --- /dev/null +++ b/app/api/Stripe/Service/Checkout/CheckoutServiceFactory.php @@ -0,0 +1,25 @@ + + */ + private static $classMap = [ + 'sessions' => SessionService::class, + ]; + + protected function getServiceClass($name) + { + return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; + } +} diff --git a/app/api/Stripe/Service/Checkout/SessionService.php b/app/api/Stripe/Service/Checkout/SessionService.php new file mode 100755 index 0000000..f00e0a5 --- /dev/null +++ b/app/api/Stripe/Service/Checkout/SessionService.php @@ -0,0 +1,73 @@ +requestCollection('get', '/v1/checkout/sessions', $params, $opts); + } + + /** + * When retrieving a Checkout Session, there is an includable + * line_items property containing the first handful of those + * items. There is also a URL where you can retrieve the full (paginated) list of + * line items. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function allLineItems($parentId, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/checkout/sessions/%s/line_items', $parentId), $params, $opts); + } + + /** + * Creates a Session object. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Checkout\Session + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/checkout/sessions', $params, $opts); + } + + /** + * Retrieves a Session object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Checkout\Session + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/checkout/sessions/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/CoreServiceFactory.php b/app/api/Stripe/Service/CoreServiceFactory.php new file mode 100755 index 0000000..7cede5d --- /dev/null +++ b/app/api/Stripe/Service/CoreServiceFactory.php @@ -0,0 +1,125 @@ + + */ + private static $classMap = [ + 'accountLinks' => AccountLinkService::class, + 'accounts' => AccountService::class, + 'applePayDomains' => ApplePayDomainService::class, + 'applicationFees' => ApplicationFeeService::class, + 'balance' => BalanceService::class, + 'balanceTransactions' => BalanceTransactionService::class, + 'billingPortal' => BillingPortal\BillingPortalServiceFactory::class, + 'charges' => ChargeService::class, + 'checkout' => Checkout\CheckoutServiceFactory::class, + 'countrySpecs' => CountrySpecService::class, + 'coupons' => CouponService::class, + 'creditNotes' => CreditNoteService::class, + 'customers' => CustomerService::class, + 'disputes' => DisputeService::class, + 'ephemeralKeys' => EphemeralKeyService::class, + 'events' => EventService::class, + 'exchangeRates' => ExchangeRateService::class, + 'fileLinks' => FileLinkService::class, + 'files' => FileService::class, + 'invoiceItems' => InvoiceItemService::class, + 'invoices' => InvoiceService::class, + 'issuing' => Issuing\IssuingServiceFactory::class, + 'mandates' => MandateService::class, + 'oauth' => OAuthService::class, + 'orderReturns' => OrderReturnService::class, + 'orders' => OrderService::class, + 'paymentIntents' => PaymentIntentService::class, + 'paymentMethods' => PaymentMethodService::class, + 'payouts' => PayoutService::class, + 'plans' => PlanService::class, + 'prices' => PriceService::class, + 'products' => ProductService::class, + 'promotionCodes' => PromotionCodeService::class, + 'radar' => Radar\RadarServiceFactory::class, + 'refunds' => RefundService::class, + 'reporting' => Reporting\ReportingServiceFactory::class, + 'reviews' => ReviewService::class, + 'setupAttempts' => SetupAttemptService::class, + 'setupIntents' => SetupIntentService::class, + 'sigma' => Sigma\SigmaServiceFactory::class, + 'skus' => SkuService::class, + 'sources' => SourceService::class, + 'subscriptionItems' => SubscriptionItemService::class, + 'subscriptions' => SubscriptionService::class, + 'subscriptionSchedules' => SubscriptionScheduleService::class, + 'taxRates' => TaxRateService::class, + 'terminal' => Terminal\TerminalServiceFactory::class, + 'tokens' => TokenService::class, + 'topups' => TopupService::class, + 'transfers' => TransferService::class, + 'webhookEndpoints' => WebhookEndpointService::class, + ]; + + protected function getServiceClass($name) + { + return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; + } +} diff --git a/app/api/Stripe/Service/CountrySpecService.php b/app/api/Stripe/Service/CountrySpecService.php new file mode 100755 index 0000000..ed62198 --- /dev/null +++ b/app/api/Stripe/Service/CountrySpecService.php @@ -0,0 +1,39 @@ +requestCollection('get', '/v1/country_specs', $params, $opts); + } + + /** + * Returns a Country Spec for a given Country code. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CountrySpec + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/country_specs/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/CouponService.php b/app/api/Stripe/Service/CouponService.php new file mode 100755 index 0000000..ae492a4 --- /dev/null +++ b/app/api/Stripe/Service/CouponService.php @@ -0,0 +1,104 @@ +requestCollection('get', '/v1/coupons', $params, $opts); + } + + /** + * You can create coupons easily via the coupon management page of the + * Stripe dashboard. Coupon creation is also accessible via the API if you need to + * create coupons on the fly. + * + * A coupon has either a percent_off or an amount_off and + * currency. If you set an amount_off, that amount will + * be subtracted from any invoice’s subtotal. For example, an invoice with a + * subtotal of 100 will have a final total of + * 0 if a coupon with an amount_off of + * 200 is applied to it and an invoice with a subtotal of + * 300 will have a final total of 100 if + * a coupon with an amount_off of 200 is applied to + * it. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Coupon + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/coupons', $params, $opts); + } + + /** + * You can delete coupons via the coupon management page of the + * Stripe dashboard. However, deleting a coupon does not affect any customers who + * have already applied the coupon; it means that new customers can’t redeem the + * coupon. You can also delete coupons via the API. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Coupon + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/coupons/%s', $id), $params, $opts); + } + + /** + * Retrieves the coupon with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Coupon + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/coupons/%s', $id), $params, $opts); + } + + /** + * Updates the metadata of a coupon. Other coupon details (currency, duration, + * amount_off) are, by design, not editable. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Coupon + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/coupons/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/CreditNoteService.php b/app/api/Stripe/Service/CreditNoteService.php new file mode 100755 index 0000000..fc8d898 --- /dev/null +++ b/app/api/Stripe/Service/CreditNoteService.php @@ -0,0 +1,156 @@ +requestCollection('get', '/v1/credit_notes', $params, $opts); + } + + /** + * When retrieving a credit note, you’ll get a lines property + * containing the the first handful of those items. There is also a URL where you + * can retrieve the full (paginated) list of line items. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function allLines($parentId, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/credit_notes/%s/lines', $parentId), $params, $opts); + } + + /** + * Issue a credit note to adjust the amount of a finalized invoice. For a + * status=open invoice, a credit note reduces its + * amount_due. For a status=paid invoice, a credit note + * does not affect its amount_due. Instead, it can result in any + * combination of the following:. + * + *
  • Refund: create a new refund (using refund_amount) or link + * an existing refund (using refund).
  • Customer balance + * credit: credit the customer’s balance (using credit_amount) which + * will be automatically applied to their next invoice when it’s finalized.
  • + *
  • Outside of Stripe credit: record the amount that is or will be credited + * outside of Stripe (using out_of_band_amount).
+ * + * For post-payment credit notes the sum of the refund, credit and outside of + * Stripe amounts must equal the credit note total. + * + * You may issue multiple credit notes for an invoice. Each credit note will + * increment the invoice’s pre_payment_credit_notes_amount or + * post_payment_credit_notes_amount depending on its + * status at the time of credit note creation. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CreditNote + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/credit_notes', $params, $opts); + } + + /** + * Get a preview of a credit note without creating it. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CreditNote + */ + public function preview($params = null, $opts = null) + { + return $this->request('get', '/v1/credit_notes/preview', $params, $opts); + } + + /** + * When retrieving a credit note preview, you’ll get a lines + * property containing the first handful of those items. This URL you can retrieve + * the full (paginated) list of line items. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CreditNote + */ + public function previewLines($params = null, $opts = null) + { + return $this->request('get', '/v1/credit_notes/preview/lines', $params, $opts); + } + + /** + * Retrieves the credit note object with the given identifier. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CreditNote + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/credit_notes/%s', $id), $params, $opts); + } + + /** + * Updates an existing credit note. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CreditNote + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/credit_notes/%s', $id), $params, $opts); + } + + /** + * Marks a credit note as void. Learn more about voiding credit notes. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CreditNote + */ + public function voidCreditNote($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/credit_notes/%s/void', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/CustomerService.php b/app/api/Stripe/Service/CustomerService.php new file mode 100755 index 0000000..af4f098 --- /dev/null +++ b/app/api/Stripe/Service/CustomerService.php @@ -0,0 +1,353 @@ +requestCollection('get', '/v1/customers', $params, $opts); + } + + /** + * Returns a list of transactions that updated the customer’s balances. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function allBalanceTransactions($parentId, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/customers/%s/balance_transactions', $parentId), $params, $opts); + } + + /** + * List sources for a specified customer. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function allSources($parentId, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/customers/%s/sources', $parentId), $params, $opts); + } + + /** + * Returns a list of tax IDs for a customer. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function allTaxIds($parentId, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/customers/%s/tax_ids', $parentId), $params, $opts); + } + + /** + * Creates a new customer object. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Customer + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/customers', $params, $opts); + } + + /** + * Creates an immutable transaction that updates the customer’s credit balance. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CustomerBalanceTransaction + */ + public function createBalanceTransaction($parentId, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/customers/%s/balance_transactions', $parentId), $params, $opts); + } + + /** + * When you create a new credit card, you must specify a customer or recipient on + * which to create it. + * + * If the card’s owner has no default card, then the new card will become the + * default. However, if the owner already has a default, then it will not change. + * To change the default, you should update the + * customer to have a new default_source. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source + */ + public function createSource($parentId, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/customers/%s/sources', $parentId), $params, $opts); + } + + /** + * Creates a new TaxID object for a customer. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TaxId + */ + public function createTaxId($parentId, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/customers/%s/tax_ids', $parentId), $params, $opts); + } + + /** + * Permanently deletes a customer. It cannot be undone. Also immediately cancels + * any active subscriptions on the customer. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Customer + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/customers/%s', $id), $params, $opts); + } + + /** + * Removes the currently applied discount on a customer. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Customer + */ + public function deleteDiscount($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/customers/%s/discount', $id), $params, $opts); + } + + /** + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source + */ + public function deleteSource($parentId, $id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/customers/%s/sources/%s', $parentId, $id), $params, $opts); + } + + /** + * Deletes an existing TaxID object. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TaxId + */ + public function deleteTaxId($parentId, $id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/customers/%s/tax_ids/%s', $parentId, $id), $params, $opts); + } + + /** + * Retrieves the details of an existing customer. You need only supply the unique + * customer identifier that was returned upon customer creation. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Customer + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/customers/%s', $id), $params, $opts); + } + + /** + * Retrieves a specific customer balance transaction that updated the customer’s balances. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CustomerBalanceTransaction + */ + public function retrieveBalanceTransaction($parentId, $id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/customers/%s/balance_transactions/%s', $parentId, $id), $params, $opts); + } + + /** + * Retrieve a specified source for a given customer. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source + */ + public function retrieveSource($parentId, $id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/customers/%s/sources/%s', $parentId, $id), $params, $opts); + } + + /** + * Retrieves the TaxID object with the given identifier. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TaxId + */ + public function retrieveTaxId($parentId, $id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/customers/%s/tax_ids/%s', $parentId, $id), $params, $opts); + } + + /** + * Updates the specified customer by setting the values of the parameters passed. + * Any parameters not provided will be left unchanged. For example, if you pass the + * source parameter, that becomes the customer’s active source + * (e.g., a card) to be used for all charges in the future. When you update a + * customer to a new valid card source by passing the source + * parameter: for each of the customer’s current subscriptions, if the subscription + * bills automatically and is in the past_due state, then the latest + * open invoice for the subscription with automatic collection enabled will be + * retried. This retry will not count as an automatic retry, and will not affect + * the next regularly scheduled payment for the invoice. Changing the + * default_source for a customer will not trigger this behavior. + * + * This request accepts mostly the same arguments as the customer creation call. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Customer + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/customers/%s', $id), $params, $opts); + } + + /** + * Most credit balance transaction fields are immutable, but you may update its + * description and metadata. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\CustomerBalanceTransaction + */ + public function updateBalanceTransaction($parentId, $id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/customers/%s/balance_transactions/%s', $parentId, $id), $params, $opts); + } + + /** + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source + */ + public function updateSource($parentId, $id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/customers/%s/sources/%s', $parentId, $id), $params, $opts); + } + + /** + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source + */ + public function verifySource($parentId, $id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/customers/%s/sources/%s/verify', $parentId, $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/DisputeService.php b/app/api/Stripe/Service/DisputeService.php new file mode 100755 index 0000000..6b14c20 --- /dev/null +++ b/app/api/Stripe/Service/DisputeService.php @@ -0,0 +1,83 @@ +requestCollection('get', '/v1/disputes', $params, $opts); + } + + /** + * Closing the dispute for a charge indicates that you do not have any evidence to + * submit and are essentially dismissing the dispute, acknowledging it as lost. + * + * The status of the dispute will change from needs_response to + * lost. Closing a dispute is irreversible. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Dispute + */ + public function close($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/disputes/%s/close', $id), $params, $opts); + } + + /** + * Retrieves the dispute with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Dispute + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/disputes/%s', $id), $params, $opts); + } + + /** + * When you get a dispute, contacting your customer is always the best first step. + * If that doesn’t work, you can submit evidence to help us resolve the dispute in + * your favor. You can do this in your dashboard, but if you prefer, + * you can use the API to submit evidence programmatically. + * + * Depending on your dispute type, different evidence fields will give you a better + * chance of winning your dispute. To figure out which evidence fields to provide, + * see our guide to dispute types. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Dispute + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/disputes/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/EphemeralKeyService.php b/app/api/Stripe/Service/EphemeralKeyService.php new file mode 100755 index 0000000..1305234 --- /dev/null +++ b/app/api/Stripe/Service/EphemeralKeyService.php @@ -0,0 +1,43 @@ +request('delete', $this->buildPath('/v1/ephemeral_keys/%s', $id), $params, $opts); + } + + /** + * Creates a short-lived API key for a given resource. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\EphemeralKey + */ + public function create($params = null, $opts = null) + { + if (!$opts || !isset($opts['stripe_version'])) { + throw new \Stripe\Exception\InvalidArgumentException('stripe_version must be specified to create an ephemeral key'); + } + + return $this->request('post', '/v1/ephemeral_keys', $params, $opts); + } +} diff --git a/app/api/Stripe/Service/EventService.php b/app/api/Stripe/Service/EventService.php new file mode 100755 index 0000000..8fe6f73 --- /dev/null +++ b/app/api/Stripe/Service/EventService.php @@ -0,0 +1,44 @@ +event object api_version + * attribute (not according to your current Stripe API version or + * Stripe-Version header). + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/events', $params, $opts); + } + + /** + * Retrieves the details of an event. Supply the unique identifier of the event, + * which you might have received in a webhook. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Event + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/events/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/ExchangeRateService.php b/app/api/Stripe/Service/ExchangeRateService.php new file mode 100755 index 0000000..7fcc80f --- /dev/null +++ b/app/api/Stripe/Service/ExchangeRateService.php @@ -0,0 +1,41 @@ +requestCollection('get', '/v1/exchange_rates', $params, $opts); + } + + /** + * Retrieves the exchange rates from the given currency to every supported + * currency. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\ExchangeRate + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/exchange_rates/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/FileLinkService.php b/app/api/Stripe/Service/FileLinkService.php new file mode 100755 index 0000000..e248187 --- /dev/null +++ b/app/api/Stripe/Service/FileLinkService.php @@ -0,0 +1,70 @@ +requestCollection('get', '/v1/file_links', $params, $opts); + } + + /** + * Creates a new file link object. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\FileLink + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/file_links', $params, $opts); + } + + /** + * Retrieves the file link with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\FileLink + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/file_links/%s', $id), $params, $opts); + } + + /** + * Updates an existing file link object. Expired links can no longer be updated. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\FileLink + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/file_links/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/FileService.php b/app/api/Stripe/Service/FileService.php new file mode 100755 index 0000000..ad12776 --- /dev/null +++ b/app/api/Stripe/Service/FileService.php @@ -0,0 +1,66 @@ +requestCollection('get', '/v1/files', $params, $opts); + } + + /** + * Retrieves the details of an existing file object. Supply the unique file ID from + * a file, and Stripe will return the corresponding file object. To access file + * contents, see the File Upload + * Guide. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\File + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/files/%s', $id), $params, $opts); + } + + /** + * Create a file. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @return \Stripe\File + */ + public function create($params = null, $opts = null) + { + $opts = \Stripe\Util\RequestOptions::parse($opts); + if (!isset($opts->apiBase)) { + $opts->apiBase = $this->getClient()->getFilesBase(); + } + + // Manually flatten params, otherwise curl's multipart encoder will + // choke on nested null|arrays. + $flatParams = \array_column(\Stripe\Util\Util::flattenParams($params), 1, 0); + + return $this->request('post', '/v1/files', $flatParams, $opts); + } +} diff --git a/app/api/Stripe/Service/InvoiceItemService.php b/app/api/Stripe/Service/InvoiceItemService.php new file mode 100755 index 0000000..53ce507 --- /dev/null +++ b/app/api/Stripe/Service/InvoiceItemService.php @@ -0,0 +1,93 @@ +requestCollection('get', '/v1/invoiceitems', $params, $opts); + } + + /** + * Creates an item to be added to a draft invoice (up to 250 items per invoice). If + * no invoice is specified, the item will be on the next invoice created for the + * customer specified. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\InvoiceItem + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/invoiceitems', $params, $opts); + } + + /** + * Deletes an invoice item, removing it from an invoice. Deleting invoice items is + * only possible when they’re not attached to invoices, or if it’s attached to a + * draft invoice. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\InvoiceItem + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/invoiceitems/%s', $id), $params, $opts); + } + + /** + * Retrieves the invoice item with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\InvoiceItem + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/invoiceitems/%s', $id), $params, $opts); + } + + /** + * Updates the amount or description of an invoice item on an upcoming invoice. + * Updating an invoice item is only possible before the invoice it’s attached to is + * closed. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\InvoiceItem + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/invoiceitems/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/InvoiceService.php b/app/api/Stripe/Service/InvoiceService.php new file mode 100755 index 0000000..c443712 --- /dev/null +++ b/app/api/Stripe/Service/InvoiceService.php @@ -0,0 +1,272 @@ +requestCollection('get', '/v1/invoices', $params, $opts); + } + + /** + * When retrieving an invoice, you’ll get a lines property + * containing the total count of line items and the first handful of those items. + * There is also a URL where you can retrieve the full (paginated) list of line + * items. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function allLines($parentId, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/invoices/%s/lines', $parentId), $params, $opts); + } + + /** + * This endpoint creates a draft invoice for a given customer. The draft invoice + * created pulls in all pending invoice items on that customer, including + * prorations. The invoice remains a draft until you finalize the invoice, which allows you to pay or send the invoice to + * your customers. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/invoices', $params, $opts); + } + + /** + * Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to + * delete invoices that are no longer in a draft state will fail; once an invoice + * has been finalized or if an invoice is for a subscription, it must be voided. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/invoices/%s', $id), $params, $opts); + } + + /** + * Stripe automatically finalizes drafts before sending and attempting payment on + * invoices. However, if you’d like to finalize a draft invoice manually, you can + * do so using this method. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice + */ + public function finalizeInvoice($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/invoices/%s/finalize', $id), $params, $opts); + } + + /** + * Marking an invoice as uncollectible is useful for keeping track of bad debts + * that can be written off for accounting purposes. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice + */ + public function markUncollectible($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/invoices/%s/mark_uncollectible', $id), $params, $opts); + } + + /** + * Stripe automatically creates and then attempts to collect payment on invoices + * for customers on subscriptions according to your subscriptions + * settings. However, if you’d like to attempt payment on an invoice out of the + * normal collection schedule or for some other reason, you can do so. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice + */ + public function pay($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/invoices/%s/pay', $id), $params, $opts); + } + + /** + * Retrieves the invoice with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/invoices/%s', $id), $params, $opts); + } + + /** + * Stripe will automatically send invoices to customers according to your subscriptions + * settings. However, if you’d like to manually send an invoice to your + * customer out of the normal schedule, you can do so. When sending invoices that + * have already been paid, there will be no reference to the payment in the email. + * + * Requests made in test-mode result in no emails being sent, despite sending an + * invoice.sent event. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice + */ + public function sendInvoice($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/invoices/%s/send', $id), $params, $opts); + } + + /** + * At any time, you can preview the upcoming invoice for a customer. This will show + * you all the charges that are pending, including subscription renewal charges, + * invoice item charges, etc. It will also show you any discounts that are + * applicable to the invoice. + * + * Note that when you are viewing an upcoming invoice, you are simply viewing a + * preview – the invoice has not yet been created. As such, the upcoming invoice + * will not show up in invoice listing calls, and you cannot use the API to pay or + * edit the invoice. If you want to change the amount that your customer will be + * billed, you can add, remove, or update pending invoice items, or update the + * customer’s discount. + * + * You can preview the effects of updating a subscription, including a preview of + * what proration will take place. To ensure that the actual proration is + * calculated exactly the same as the previewed proration, you should pass a + * proration_date parameter when doing the actual subscription update. + * The value passed in should be the same as the + * subscription_proration_date returned on the upcoming invoice + * resource. The recommended way to get only the prorations being previewed is to + * consider only proration line items where period[start] is equal to + * the subscription_proration_date on the upcoming invoice resource. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice + */ + public function upcoming($params = null, $opts = null) + { + return $this->request('get', '/v1/invoices/upcoming', $params, $opts); + } + + /** + * When retrieving an upcoming invoice, you’ll get a lines + * property containing the total count of line items and the first handful of those + * items. There is also a URL where you can retrieve the full (paginated) list of + * line items. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice + */ + public function upcomingLines($params = null, $opts = null) + { + return $this->request('get', '/v1/invoices/upcoming/lines', $params, $opts); + } + + /** + * Draft invoices are fully editable. Once an invoice is finalized, monetary values, + * as well as collection_method, become uneditable. + * + * If you would like to stop the Stripe Billing engine from automatically + * finalizing, reattempting payments on, sending reminders for, or automatically reconciling + * invoices, pass auto_advance=false. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/invoices/%s', $id), $params, $opts); + } + + /** + * Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is + * similar to deletion, however it only applies to + * finalized invoices and maintains a papertrail where the invoice can still be + * found. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Invoice + */ + public function voidInvoice($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/invoices/%s/void', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/Issuing/AuthorizationService.php b/app/api/Stripe/Service/Issuing/AuthorizationService.php new file mode 100755 index 0000000..2bd84d7 --- /dev/null +++ b/app/api/Stripe/Service/Issuing/AuthorizationService.php @@ -0,0 +1,97 @@ +Authorization objects. The objects are + * sorted in descending order by creation date, with the most recently created + * object appearing first. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/issuing/authorizations', $params, $opts); + } + + /** + * Approves a pending Issuing Authorization object. This request + * should be made within the timeout window of the real-time + * authorization flow. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Authorization + */ + public function approve($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/issuing/authorizations/%s/approve', $id), $params, $opts); + } + + /** + * Declines a pending Issuing Authorization object. This request + * should be made within the timeout window of the real time + * authorization flow. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Authorization + */ + public function decline($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/issuing/authorizations/%s/decline', $id), $params, $opts); + } + + /** + * Retrieves an Issuing Authorization object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Authorization + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/issuing/authorizations/%s', $id), $params, $opts); + } + + /** + * Updates the specified Issuing Authorization object by setting the + * values of the parameters passed. Any parameters not provided will be left + * unchanged. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Authorization + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/issuing/authorizations/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/Issuing/CardService.php b/app/api/Stripe/Service/Issuing/CardService.php new file mode 100755 index 0000000..cae2e20 --- /dev/null +++ b/app/api/Stripe/Service/Issuing/CardService.php @@ -0,0 +1,73 @@ +Card objects. The objects are sorted in + * descending order by creation date, with the most recently created object + * appearing first. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/issuing/cards', $params, $opts); + } + + /** + * Creates an Issuing Card object. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Card + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/issuing/cards', $params, $opts); + } + + /** + * Retrieves an Issuing Card object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Card + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/issuing/cards/%s', $id), $params, $opts); + } + + /** + * Updates the specified Issuing Card object by setting the values of + * the parameters passed. Any parameters not provided will be left unchanged. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Card + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/issuing/cards/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/Issuing/CardholderService.php b/app/api/Stripe/Service/Issuing/CardholderService.php new file mode 100755 index 0000000..14494fb --- /dev/null +++ b/app/api/Stripe/Service/Issuing/CardholderService.php @@ -0,0 +1,74 @@ +Cardholder objects. The objects are + * sorted in descending order by creation date, with the most recently created + * object appearing first. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/issuing/cardholders', $params, $opts); + } + + /** + * Creates a new Issuing Cardholder object that can be issued cards. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Cardholder + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/issuing/cardholders', $params, $opts); + } + + /** + * Retrieves an Issuing Cardholder object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Cardholder + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/issuing/cardholders/%s', $id), $params, $opts); + } + + /** + * Updates the specified Issuing Cardholder object by setting the + * values of the parameters passed. Any parameters not provided will be left + * unchanged. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Cardholder + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/issuing/cardholders/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/Issuing/DisputeService.php b/app/api/Stripe/Service/Issuing/DisputeService.php new file mode 100755 index 0000000..6ead76d --- /dev/null +++ b/app/api/Stripe/Service/Issuing/DisputeService.php @@ -0,0 +1,99 @@ +Dispute objects. The objects are sorted + * in descending order by creation date, with the most recently created object + * appearing first. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/issuing/disputes', $params, $opts); + } + + /** + * Creates an Issuing Dispute object. Individual pieces of evidence + * within the evidence object are optional at this point. Stripe only + * validates that required evidence is present during submission. Refer to Dispute + * reasons and evidence for more details about evidence requirements. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Dispute + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/issuing/disputes', $params, $opts); + } + + /** + * Retrieves an Issuing Dispute object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Dispute + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/issuing/disputes/%s', $id), $params, $opts); + } + + /** + * Submits an Issuing Dispute to the card network. Stripe validates + * that all evidence fields required for the dispute’s reason are present. For more + * details, see Dispute + * reasons and evidence. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Dispute + */ + public function submit($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/issuing/disputes/%s/submit', $id), $params, $opts); + } + + /** + * Updates the specified Issuing Dispute object by setting the values + * of the parameters passed. Any parameters not provided will be left unchanged. + * Properties on the evidence object can be unset by passing in an + * empty string. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Dispute + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/issuing/disputes/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/Issuing/IssuingServiceFactory.php b/app/api/Stripe/Service/Issuing/IssuingServiceFactory.php new file mode 100755 index 0000000..89f2c8c --- /dev/null +++ b/app/api/Stripe/Service/Issuing/IssuingServiceFactory.php @@ -0,0 +1,33 @@ + + */ + private static $classMap = [ + 'authorizations' => AuthorizationService::class, + 'cardholders' => CardholderService::class, + 'cards' => CardService::class, + 'disputes' => DisputeService::class, + 'transactions' => TransactionService::class, + ]; + + protected function getServiceClass($name) + { + return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; + } +} diff --git a/app/api/Stripe/Service/Issuing/TransactionService.php b/app/api/Stripe/Service/Issuing/TransactionService.php new file mode 100755 index 0000000..199ecf8 --- /dev/null +++ b/app/api/Stripe/Service/Issuing/TransactionService.php @@ -0,0 +1,59 @@ +Transaction objects. The objects are + * sorted in descending order by creation date, with the most recently created + * object appearing first. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/issuing/transactions', $params, $opts); + } + + /** + * Retrieves an Issuing Transaction object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Transaction + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/issuing/transactions/%s', $id), $params, $opts); + } + + /** + * Updates the specified Issuing Transaction object by setting the + * values of the parameters passed. Any parameters not provided will be left + * unchanged. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Issuing\Transaction + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/issuing/transactions/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/MandateService.php b/app/api/Stripe/Service/MandateService.php new file mode 100755 index 0000000..21f6e02 --- /dev/null +++ b/app/api/Stripe/Service/MandateService.php @@ -0,0 +1,24 @@ +request('get', $this->buildPath('/v1/mandates/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/OAuthService.php b/app/api/Stripe/Service/OAuthService.php new file mode 100755 index 0000000..9ad4383 --- /dev/null +++ b/app/api/Stripe/Service/OAuthService.php @@ -0,0 +1,150 @@ +_parseOpts($opts); + $opts->apiBase = $this->_getBase($opts); + + return $this->request($method, $path, $params, $opts); + } + + /** + * Generates a URL to Stripe's OAuth form. + * + * @param null|array $params + * @param null|array $opts + * + * @return string the URL to Stripe's OAuth form + */ + public function authorizeUrl($params = null, $opts = null) + { + $params = $params ?: []; + + $opts = $this->_parseOpts($opts); + $base = $this->_getBase($opts); + + $params['client_id'] = $this->_getClientId($params); + if (!\array_key_exists('response_type', $params)) { + $params['response_type'] = 'code'; + } + $query = \Stripe\Util\Util::encodeParameters($params); + + return $base . '/oauth/authorize?' . $query; + } + + /** + * Use an authoriztion code to connect an account to your platform and + * fetch the user's credentials. + * + * @param null|array $params + * @param null|array $opts + * + * @throws \Stripe\Exception\OAuth\OAuthErrorException if the request fails + * + * @return \Stripe\StripeObject object containing the response from the API + */ + public function token($params = null, $opts = null) + { + $params = $params ?: []; + $params['client_secret'] = $this->_getClientSecret($params); + + return $this->requestConnect('post', '/oauth/token', $params, $opts); + } + + /** + * Disconnects an account from your platform. + * + * @param null|array $params + * @param null|array $opts + * + * @throws \Stripe\Exception\OAuth\OAuthErrorException if the request fails + * + * @return \Stripe\StripeObject object containing the response from the API + */ + public function deauthorize($params = null, $opts = null) + { + $params = $params ?: []; + $params['client_id'] = $this->_getClientId($params); + + return $this->requestConnect('post', '/oauth/deauthorize', $params, $opts); + } + + private function _getClientId($params = null) + { + $clientId = ($params && \array_key_exists('client_id', $params)) ? $params['client_id'] : null; + + if (null === $clientId) { + $clientId = $this->client->getClientId(); + } + if (null === $clientId) { + $msg = 'No client_id provided. (HINT: set your client_id using ' + . '`new \Stripe\StripeClient([clientId => + ])`)". You can find your client_ids ' + . 'in your Stripe dashboard at ' + . 'https://dashboard.stripe.com/account/applications/settings, ' + . 'after registering your account as a platform. See ' + . 'https://stripe.com/docs/connect/standard-accounts for details, ' + . 'or email support@stripe.com if you have any questions.'; + + throw new \Stripe\Exception\AuthenticationException($msg); + } + + return $clientId; + } + + private function _getClientSecret($params = null) + { + if (\array_key_exists('client_secret', $params)) { + return $params['client_secret']; + } + + return $this->client->getApiKey(); + } + + /** + * @param array|\Stripe\Util\RequestOptions $opts the special modifiers of the request + * + * @throws \Stripe\Exception\InvalidArgumentException + * + * @return \Stripe\Util\RequestOptions + */ + private function _parseOpts($opts) + { + if (\is_array($opts)) { + if (\array_key_exists('connect_base', $opts)) { + // Throw an exception for the convenience of anybody migrating to + // \Stripe\Service\OAuthService from \Stripe\OAuth, where `connect_base` + // was the name of the parameter that behaves as `api_base` does here. + throw new \Stripe\Exception\InvalidArgumentException('Use `api_base`, not `connect_base`'); + } + } + + return \Stripe\Util\RequestOptions::parse($opts); + } + + /** + * @param \Stripe\Util\RequestOptions $opts + * + * @return string + */ + private function _getBase($opts) + { + return isset($opts->apiBase) ? + $opts->apiBase : + $this->client->getConnectBase(); + } +} diff --git a/app/api/Stripe/Service/OrderReturnService.php b/app/api/Stripe/Service/OrderReturnService.php new file mode 100755 index 0000000..8509674 --- /dev/null +++ b/app/api/Stripe/Service/OrderReturnService.php @@ -0,0 +1,42 @@ +requestCollection('get', '/v1/order_returns', $params, $opts); + } + + /** + * Retrieves the details of an existing order return. Supply the unique order ID + * from either an order return creation request or the order return list, and + * Stripe will return the corresponding order information. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\OrderReturn + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/order_returns/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/OrderService.php b/app/api/Stripe/Service/OrderService.php new file mode 100755 index 0000000..fa9f126 --- /dev/null +++ b/app/api/Stripe/Service/OrderService.php @@ -0,0 +1,109 @@ +requestCollection('get', '/v1/orders', $params, $opts); + } + + /** + * Creates a new order object. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Order + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/orders', $params, $opts); + } + + /** + * Pay an order by providing a source to create a payment. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Order + */ + public function pay($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/orders/%s/pay', $id), $params, $opts); + } + + /** + * Retrieves the details of an existing order. Supply the unique order ID from + * either an order creation request or the order list, and Stripe will return the + * corresponding order information. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Order + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/orders/%s', $id), $params, $opts); + } + + /** + * Return all or part of an order. The order must have a status of + * paid or fulfilled before it can be returned. Once all + * items have been returned, the order will become canceled or + * returned depending on which status the order started in. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Order + */ + public function returnOrder($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/orders/%s/returns', $id), $params, $opts); + } + + /** + * Updates the specific order by setting the values of the parameters passed. Any + * parameters not provided will be left unchanged. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Order + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/orders/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/PaymentIntentService.php b/app/api/Stripe/Service/PaymentIntentService.php new file mode 100755 index 0000000..091ee85 --- /dev/null +++ b/app/api/Stripe/Service/PaymentIntentService.php @@ -0,0 +1,181 @@ +requestCollection('get', '/v1/payment_intents', $params, $opts); + } + + /** + * A PaymentIntent object can be canceled when it is in one of these statuses: + * requires_payment_method, requires_capture, + * requires_confirmation, or requires_action. + * + * Once canceled, no additional charges will be made by the PaymentIntent and any + * operations on the PaymentIntent will fail with an error. For PaymentIntents with + * status=’requires_capture’, the remaining + * amount_capturable will automatically be refunded. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentIntent + */ + public function cancel($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payment_intents/%s/cancel', $id), $params, $opts); + } + + /** + * Capture the funds of an existing uncaptured PaymentIntent when its status is + * requires_capture. + * + * Uncaptured PaymentIntents will be canceled exactly seven days after they are + * created. + * + * Learn more about separate authorization + * and capture. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentIntent + */ + public function capture($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payment_intents/%s/capture', $id), $params, $opts); + } + + /** + * Confirm that your customer intends to pay with current or provided payment + * method. Upon confirmation, the PaymentIntent will attempt to initiate a payment. + * + * If the selected payment method requires additional authentication steps, the + * PaymentIntent will transition to the requires_action status and + * suggest additional actions via next_action. If payment fails, the + * PaymentIntent will transition to the requires_payment_method + * status. If payment succeeds, the PaymentIntent will transition to the + * succeeded status (or requires_capture, if + * capture_method is set to manual). + * + * If the confirmation_method is automatic, payment may + * be attempted using our client SDKs and + * the PaymentIntent’s client_secret. After + * next_actions are handled by the client, no additional confirmation + * is required to complete the payment. + * + * If the confirmation_method is manual, all payment + * attempts must be initiated using a secret key. If any actions are required for + * the payment, the PaymentIntent will return to the + * requires_confirmation state after those actions are completed. Your + * server needs to then explicitly re-confirm the PaymentIntent to initiate the + * next payment attempt. Read the expanded documentation to + * learn more about manual confirmation. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentIntent + */ + public function confirm($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payment_intents/%s/confirm', $id), $params, $opts); + } + + /** + * Creates a PaymentIntent object. + * + * After the PaymentIntent is created, attach a payment method and confirm to continue the payment. + * You can read more about the different payment flows available via the Payment + * Intents API here. + * + * When confirm=true is used during creation, it is equivalent to + * creating and confirming the PaymentIntent in the same call. You may use any + * parameters available in the confirm + * API when confirm=true is supplied. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentIntent + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/payment_intents', $params, $opts); + } + + /** + * Retrieves the details of a PaymentIntent that has previously been created. + * + * Client-side retrieval using a publishable key is allowed when the + * client_secret is provided in the query string. + * + * When retrieved with a publishable key, only a subset of properties will be + * returned. Please refer to the payment + * intent object reference for more details. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentIntent + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/payment_intents/%s', $id), $params, $opts); + } + + /** + * Updates properties on a PaymentIntent object without confirming. + * + * Depending on which properties you update, you may need to confirm the + * PaymentIntent again. For example, updating the payment_method will + * always require you to confirm the PaymentIntent again. If you prefer to update + * and confirm at the same time, we recommend updating properties via the confirm API instead. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentIntent + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payment_intents/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/PaymentMethodService.php b/app/api/Stripe/Service/PaymentMethodService.php new file mode 100755 index 0000000..fcda1c9 --- /dev/null +++ b/app/api/Stripe/Service/PaymentMethodService.php @@ -0,0 +1,121 @@ +requestCollection('get', '/v1/payment_methods', $params, $opts); + } + + /** + * Attaches a PaymentMethod object to a Customer. + * + * To attach a new PaymentMethod to a customer for future payments, we recommend + * you use a SetupIntent or a PaymentIntent + * with setup_future_usage. + * These approaches will perform any necessary steps to ensure that the + * PaymentMethod can be used in a future payment. Using the + * /v1/payment_methods/:id/attach endpoint does not ensure that future + * payments can be made with the attached PaymentMethod. See Optimizing cards for future + * payments for more information about setting up future payments. + * + * To use this PaymentMethod as the default for invoice or subscription payments, + * set invoice_settings.default_payment_method, + * on the Customer to the PaymentMethod’s ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentMethod + */ + public function attach($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payment_methods/%s/attach', $id), $params, $opts); + } + + /** + * Creates a PaymentMethod object. Read the Stripe.js + * reference to learn how to create PaymentMethods via Stripe.js. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentMethod + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/payment_methods', $params, $opts); + } + + /** + * Detaches a PaymentMethod object from a Customer. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentMethod + */ + public function detach($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payment_methods/%s/detach', $id), $params, $opts); + } + + /** + * Retrieves a PaymentMethod object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentMethod + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/payment_methods/%s', $id), $params, $opts); + } + + /** + * Updates a PaymentMethod object. A PaymentMethod must be attached a customer to + * be updated. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PaymentMethod + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payment_methods/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/PayoutService.php b/app/api/Stripe/Service/PayoutService.php new file mode 100755 index 0000000..35414d0 --- /dev/null +++ b/app/api/Stripe/Service/PayoutService.php @@ -0,0 +1,127 @@ +requestCollection('get', '/v1/payouts', $params, $opts); + } + + /** + * A previously created payout can be canceled if it has not yet been paid out. + * Funds will be refunded to your available balance. You may not cancel automatic + * Stripe payouts. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Payout + */ + public function cancel($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payouts/%s/cancel', $id), $params, $opts); + } + + /** + * To send funds to your own bank account, you create a new payout object. Your Stripe balance must be able to cover the payout amount, or + * you’ll receive an “Insufficient Funds” error. + * + * If your API key is in test mode, money won’t actually be sent, though everything + * else will occur as if in live mode. + * + * If you are creating a manual payout on a Stripe account that uses multiple + * payment source types, you’ll need to specify the source type balance that the + * payout should draw from. The balance object + * details available and pending amounts by source type. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Payout + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/payouts', $params, $opts); + } + + /** + * Retrieves the details of an existing payout. Supply the unique payout ID from + * either a payout creation request or the payout list, and Stripe will return the + * corresponding payout information. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Payout + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/payouts/%s', $id), $params, $opts); + } + + /** + * Reverses a payout by debiting the destination bank account. Only payouts for + * connected accounts to US bank accounts may be reversed at this time. If the + * payout is in the pending status, + * /v1/payouts/:id/cancel should be used instead. + * + * By requesting a reversal via /v1/payouts/:id/reverse, you confirm + * that the authorized signatory of the selected bank account has authorized the + * debit on the bank account and that no other authorization is required. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Payout + */ + public function reverse($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payouts/%s/reverse', $id), $params, $opts); + } + + /** + * Updates the specified payout by setting the values of the parameters passed. Any + * parameters not provided will be left unchanged. This request accepts only the + * metadata as arguments. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Payout + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/payouts/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/PlanService.php b/app/api/Stripe/Service/PlanService.php new file mode 100755 index 0000000..4685ad8 --- /dev/null +++ b/app/api/Stripe/Service/PlanService.php @@ -0,0 +1,91 @@ +requestCollection('get', '/v1/plans', $params, $opts); + } + + /** + * You can now model subscriptions more flexibly using the Prices + * API. It replaces the Plans API and is backwards compatible to simplify your + * migration. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Plan + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/plans', $params, $opts); + } + + /** + * Deleting plans means new subscribers can’t be added. Existing subscribers aren’t + * affected. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Plan + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/plans/%s', $id), $params, $opts); + } + + /** + * Retrieves the plan with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Plan + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/plans/%s', $id), $params, $opts); + } + + /** + * Updates the specified plan by setting the values of the parameters passed. Any + * parameters not provided are left unchanged. By design, you cannot change a + * plan’s ID, amount, currency, or billing cycle. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Plan + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/plans/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/PriceService.php b/app/api/Stripe/Service/PriceService.php new file mode 100755 index 0000000..2a62a31 --- /dev/null +++ b/app/api/Stripe/Service/PriceService.php @@ -0,0 +1,72 @@ +requestCollection('get', '/v1/prices', $params, $opts); + } + + /** + * Creates a new price for an existing product. The price can be recurring or + * one-time. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Price + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/prices', $params, $opts); + } + + /** + * Retrieves the price with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Price + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/prices/%s', $id), $params, $opts); + } + + /** + * Updates the specified price by setting the values of the parameters passed. Any + * parameters not provided are left unchanged. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Price + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/prices/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/ProductService.php b/app/api/Stripe/Service/ProductService.php new file mode 100755 index 0000000..3ca3b6d --- /dev/null +++ b/app/api/Stripe/Service/ProductService.php @@ -0,0 +1,92 @@ +requestCollection('get', '/v1/products', $params, $opts); + } + + /** + * Creates a new product object. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Product + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/products', $params, $opts); + } + + /** + * Delete a product. Deleting a product is only possible if it has no prices + * associated with it. Additionally, deleting a product with type=good + * is only possible if it has no SKUs associated with it. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Product + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/products/%s', $id), $params, $opts); + } + + /** + * Retrieves the details of an existing product. Supply the unique product ID from + * either a product creation request or the product list, and Stripe will return + * the corresponding product information. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Product + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/products/%s', $id), $params, $opts); + } + + /** + * Updates the specific product by setting the values of the parameters passed. Any + * parameters not provided will be left unchanged. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Product + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/products/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/PromotionCodeService.php b/app/api/Stripe/Service/PromotionCodeService.php new file mode 100755 index 0000000..b53fa93 --- /dev/null +++ b/app/api/Stripe/Service/PromotionCodeService.php @@ -0,0 +1,72 @@ +requestCollection('get', '/v1/promotion_codes', $params, $opts); + } + + /** + * A promotion code points to a coupon. You can optionally restrict the code to a + * specific customer, redemption limit, and expiration date. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PromotionCode + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/promotion_codes', $params, $opts); + } + + /** + * Retrieves the promotion code with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PromotionCode + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/promotion_codes/%s', $id), $params, $opts); + } + + /** + * Updates the specified promotion code by setting the values of the parameters + * passed. Most fields are, by design, not editable. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\PromotionCode + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/promotion_codes/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/Radar/EarlyFraudWarningService.php b/app/api/Stripe/Service/Radar/EarlyFraudWarningService.php new file mode 100755 index 0000000..fbc437f --- /dev/null +++ b/app/api/Stripe/Service/Radar/EarlyFraudWarningService.php @@ -0,0 +1,43 @@ +requestCollection('get', '/v1/radar/early_fraud_warnings', $params, $opts); + } + + /** + * Retrieves the details of an early fraud warning that has previously been + * created. + * + * Please refer to the early fraud + * warning object reference for more details. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Radar\EarlyFraudWarning + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/radar/early_fraud_warnings/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/Radar/RadarServiceFactory.php b/app/api/Stripe/Service/Radar/RadarServiceFactory.php new file mode 100755 index 0000000..157a767 --- /dev/null +++ b/app/api/Stripe/Service/Radar/RadarServiceFactory.php @@ -0,0 +1,29 @@ + + */ + private static $classMap = [ + 'earlyFraudWarnings' => EarlyFraudWarningService::class, + 'valueListItems' => ValueListItemService::class, + 'valueLists' => ValueListService::class, + ]; + + protected function getServiceClass($name) + { + return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; + } +} diff --git a/app/api/Stripe/Service/Radar/ValueListItemService.php b/app/api/Stripe/Service/Radar/ValueListItemService.php new file mode 100755 index 0000000..ed925f8 --- /dev/null +++ b/app/api/Stripe/Service/Radar/ValueListItemService.php @@ -0,0 +1,74 @@ +ValueListItem objects. The objects are sorted in + * descending order by creation date, with the most recently created object + * appearing first. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/radar/value_list_items', $params, $opts); + } + + /** + * Creates a new ValueListItem object, which is added to the specified + * parent value list. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Radar\ValueListItem + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/radar/value_list_items', $params, $opts); + } + + /** + * Deletes a ValueListItem object, removing it from its parent value + * list. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Radar\ValueListItem + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/radar/value_list_items/%s', $id), $params, $opts); + } + + /** + * Retrieves a ValueListItem object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Radar\ValueListItem + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/radar/value_list_items/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/Radar/ValueListService.php b/app/api/Stripe/Service/Radar/ValueListService.php new file mode 100755 index 0000000..2684184 --- /dev/null +++ b/app/api/Stripe/Service/Radar/ValueListService.php @@ -0,0 +1,93 @@ +ValueList objects. The objects are sorted in + * descending order by creation date, with the most recently created object + * appearing first. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/radar/value_lists', $params, $opts); + } + + /** + * Creates a new ValueList object, which can then be referenced in + * rules. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Radar\ValueList + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/radar/value_lists', $params, $opts); + } + + /** + * Deletes a ValueList object, also deleting any items contained + * within the value list. To be deleted, a value list must not be referenced in any + * rules. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Radar\ValueList + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/radar/value_lists/%s', $id), $params, $opts); + } + + /** + * Retrieves a ValueList object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Radar\ValueList + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/radar/value_lists/%s', $id), $params, $opts); + } + + /** + * Updates a ValueList object by setting the values of the parameters + * passed. Any parameters not provided will be left unchanged. Note that + * item_type is immutable. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Radar\ValueList + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/radar/value_lists/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/RefundService.php b/app/api/Stripe/Service/RefundService.php new file mode 100755 index 0000000..3617def --- /dev/null +++ b/app/api/Stripe/Service/RefundService.php @@ -0,0 +1,76 @@ +requestCollection('get', '/v1/refunds', $params, $opts); + } + + /** + * Create a refund. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Refund + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/refunds', $params, $opts); + } + + /** + * Retrieves the details of an existing refund. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Refund + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/refunds/%s', $id), $params, $opts); + } + + /** + * Updates the specified refund by setting the values of the parameters passed. Any + * parameters not provided will be left unchanged. + * + * This request only accepts metadata as an argument. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Refund + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/refunds/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/Reporting/ReportRunService.php b/app/api/Stripe/Service/Reporting/ReportRunService.php new file mode 100755 index 0000000..428e09a --- /dev/null +++ b/app/api/Stripe/Service/Reporting/ReportRunService.php @@ -0,0 +1,57 @@ +live-mode API key.). + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/reporting/report_runs', $params, $opts); + } + + /** + * Creates a new object and begin running the report. (Requires a live-mode API key.). + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Reporting\ReportRun + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/reporting/report_runs', $params, $opts); + } + + /** + * Retrieves the details of an existing Report Run. (Requires a live-mode API key.). + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Reporting\ReportRun + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/reporting/report_runs/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/Reporting/ReportTypeService.php b/app/api/Stripe/Service/Reporting/ReportTypeService.php new file mode 100755 index 0000000..b6956c2 --- /dev/null +++ b/app/api/Stripe/Service/Reporting/ReportTypeService.php @@ -0,0 +1,41 @@ +live-mode API key.). + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/reporting/report_types', $params, $opts); + } + + /** + * Retrieves the details of a Report Type. (Requires a live-mode API key.). + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Reporting\ReportType + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/reporting/report_types/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/Reporting/ReportingServiceFactory.php b/app/api/Stripe/Service/Reporting/ReportingServiceFactory.php new file mode 100755 index 0000000..72a6278 --- /dev/null +++ b/app/api/Stripe/Service/Reporting/ReportingServiceFactory.php @@ -0,0 +1,27 @@ + + */ + private static $classMap = [ + 'reportRuns' => ReportRunService::class, + 'reportTypes' => ReportTypeService::class, + ]; + + protected function getServiceClass($name) + { + return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; + } +} diff --git a/app/api/Stripe/Service/ReviewService.php b/app/api/Stripe/Service/ReviewService.php new file mode 100755 index 0000000..d424996 --- /dev/null +++ b/app/api/Stripe/Service/ReviewService.php @@ -0,0 +1,58 @@ +Review objects that have open set to + * true. The objects are sorted in descending order by creation date, + * with the most recently created object appearing first. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/reviews', $params, $opts); + } + + /** + * Approves a Review object, closing it and removing it from the list + * of reviews. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Review + */ + public function approve($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/reviews/%s/approve', $id), $params, $opts); + } + + /** + * Retrieves a Review object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Review + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/reviews/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/SetupAttemptService.php b/app/api/Stripe/Service/SetupAttemptService.php new file mode 100755 index 0000000..1b924f3 --- /dev/null +++ b/app/api/Stripe/Service/SetupAttemptService.php @@ -0,0 +1,23 @@ +requestCollection('get', '/v1/setup_attempts', $params, $opts); + } +} diff --git a/app/api/Stripe/Service/SetupIntentService.php b/app/api/Stripe/Service/SetupIntentService.php new file mode 100755 index 0000000..69a0ad7 --- /dev/null +++ b/app/api/Stripe/Service/SetupIntentService.php @@ -0,0 +1,127 @@ +requestCollection('get', '/v1/setup_intents', $params, $opts); + } + + /** + * A SetupIntent object can be canceled when it is in one of these statuses: + * requires_payment_method, requires_confirmation, or + * requires_action. + * + * Once canceled, setup is abandoned and any operations on the SetupIntent will + * fail with an error. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SetupIntent + */ + public function cancel($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/setup_intents/%s/cancel', $id), $params, $opts); + } + + /** + * Confirm that your customer intends to set up the current or provided payment + * method. For example, you would confirm a SetupIntent when a customer hits the + * “Save” button on a payment method management page on your website. + * + * If the selected payment method does not require any additional steps from the + * customer, the SetupIntent will transition to the succeeded status. + * + * Otherwise, it will transition to the requires_action status and + * suggest additional actions via next_action. If setup fails, the + * SetupIntent will transition to the requires_payment_method status. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SetupIntent + */ + public function confirm($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/setup_intents/%s/confirm', $id), $params, $opts); + } + + /** + * Creates a SetupIntent object. + * + * After the SetupIntent is created, attach a payment method and confirm to collect any required + * permissions to charge the payment method later. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SetupIntent + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/setup_intents', $params, $opts); + } + + /** + * Retrieves the details of a SetupIntent that has previously been created. + * + * Client-side retrieval using a publishable key is allowed when the + * client_secret is provided in the query string. + * + * When retrieved with a publishable key, only a subset of properties will be + * returned. Please refer to the SetupIntent + * object reference for more details. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SetupIntent + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/setup_intents/%s', $id), $params, $opts); + } + + /** + * Updates a SetupIntent object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SetupIntent + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/setup_intents/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/Sigma/ScheduledQueryRunService.php b/app/api/Stripe/Service/Sigma/ScheduledQueryRunService.php new file mode 100755 index 0000000..1c2ae7e --- /dev/null +++ b/app/api/Stripe/Service/Sigma/ScheduledQueryRunService.php @@ -0,0 +1,39 @@ +requestCollection('get', '/v1/sigma/scheduled_query_runs', $params, $opts); + } + + /** + * Retrieves the details of an scheduled query run. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Sigma\ScheduledQueryRun + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/sigma/scheduled_query_runs/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/Sigma/SigmaServiceFactory.php b/app/api/Stripe/Service/Sigma/SigmaServiceFactory.php new file mode 100755 index 0000000..c9d83c3 --- /dev/null +++ b/app/api/Stripe/Service/Sigma/SigmaServiceFactory.php @@ -0,0 +1,25 @@ + + */ + private static $classMap = [ + 'scheduledQueryRuns' => ScheduledQueryRunService::class, + ]; + + protected function getServiceClass($name) + { + return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; + } +} diff --git a/app/api/Stripe/Service/SkuService.php b/app/api/Stripe/Service/SkuService.php new file mode 100755 index 0000000..839b16a --- /dev/null +++ b/app/api/Stripe/Service/SkuService.php @@ -0,0 +1,95 @@ +requestCollection('get', '/v1/skus', $params, $opts); + } + + /** + * Creates a new SKU associated with a product. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SKU + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/skus', $params, $opts); + } + + /** + * Delete a SKU. Deleting a SKU is only possible until it has been used in an + * order. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SKU + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/skus/%s', $id), $params, $opts); + } + + /** + * Retrieves the details of an existing SKU. Supply the unique SKU identifier from + * either a SKU creation request or from the product, and Stripe will return the + * corresponding SKU information. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SKU + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/skus/%s', $id), $params, $opts); + } + + /** + * Updates the specific SKU by setting the values of the parameters passed. Any + * parameters not provided will be left unchanged. + * + * Note that a SKU’s attributes are not editable. Instead, you would + * need to deactivate the existing SKU and create a new one with the new attribute + * values. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SKU + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/skus/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/SourceService.php b/app/api/Stripe/Service/SourceService.php new file mode 100755 index 0000000..dcf7788 --- /dev/null +++ b/app/api/Stripe/Service/SourceService.php @@ -0,0 +1,110 @@ +request('get', $this->buildPath('/v1/sources/%s/source_transactions', $id), $params, $opts); + } + + /** + * Creates a new source object. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Source + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/sources', $params, $opts); + } + + /** + * Delete a specified source for a given customer. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Source + */ + public function detach($parentId, $id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/customers/%s/sources/%s', $parentId, $id), $params, $opts); + } + + /** + * Retrieves an existing source object. Supply the unique source ID from a source + * creation request and Stripe will return the corresponding up-to-date source + * object information. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Source + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/sources/%s', $id), $params, $opts); + } + + /** + * Updates the specified source by setting the values of the parameters passed. Any + * parameters not provided will be left unchanged. + * + * This request accepts the metadata and owner as + * arguments. It is also possible to update type specific information for selected + * payment methods. Please refer to our payment method + * guides for more detail. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Source + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/sources/%s', $id), $params, $opts); + } + + /** + * Verify a given source. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Source + */ + public function verify($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/sources/%s/verify', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/SubscriptionItemService.php b/app/api/Stripe/Service/SubscriptionItemService.php new file mode 100755 index 0000000..01996bd --- /dev/null +++ b/app/api/Stripe/Service/SubscriptionItemService.php @@ -0,0 +1,151 @@ +requestCollection('get', '/v1/subscription_items', $params, $opts); + } + + /** + * For the specified subscription item, returns a list of summary objects. Each + * object in the list provides usage information that’s been summarized from + * multiple usage records and over a subscription billing period (e.g., 15 usage + * records in the month of September). + * + * The list is sorted in reverse-chronological order (newest first). The first list + * item represents the most current usage period that hasn’t ended yet. Since new + * usage records can still be added, the returned summary information for the + * subscription item’s ID should be seen as unstable until the subscription billing + * period ends. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function allUsageRecordSummaries($parentId, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/subscription_items/%s/usage_record_summaries', $parentId), $params, $opts); + } + + /** + * Adds a new item to an existing subscription. No existing items will be changed + * or replaced. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SubscriptionItem + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/subscription_items', $params, $opts); + } + + /** + * Creates a usage record for a specified subscription item and date, and fills it + * with a quantity. + * + * Usage records provide quantity information that Stripe uses to + * track how much a customer is using your service. With usage information and the + * pricing model set up by the metered + * billing plan, Stripe helps you send accurate invoices to your customers. + * + * The default calculation for usage is to add up all the quantity + * values of the usage records within a billing period. You can change this default + * behavior with the billing plan’s aggregate_usage parameter. When + * there is more than one usage record with the same timestamp, Stripe adds the + * quantity values together. In most cases, this is the desired + * resolution, however, you can change this behavior with the action + * parameter. + * + * The default pricing model for metered billing is per-unit pricing. + * For finer granularity, you can configure metered billing to have a tiered pricing + * model. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\UsageRecord + */ + public function createUsageRecord($parentId, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/subscription_items/%s/usage_records', $parentId), $params, $opts); + } + + /** + * Deletes an item from the subscription. Removing a subscription item from a + * subscription will not cancel the subscription. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SubscriptionItem + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/subscription_items/%s', $id), $params, $opts); + } + + /** + * Retrieves the subscription item with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SubscriptionItem + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/subscription_items/%s', $id), $params, $opts); + } + + /** + * Updates the plan or quantity of an item on a current subscription. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SubscriptionItem + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/subscription_items/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/SubscriptionScheduleService.php b/app/api/Stripe/Service/SubscriptionScheduleService.php new file mode 100755 index 0000000..3f88136 --- /dev/null +++ b/app/api/Stripe/Service/SubscriptionScheduleService.php @@ -0,0 +1,113 @@ +requestCollection('get', '/v1/subscription_schedules', $params, $opts); + } + + /** + * Cancels a subscription schedule and its associated subscription immediately (if + * the subscription schedule has an active subscription). A subscription schedule + * can only be canceled if its status is not_started or + * active. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SubscriptionSchedule + */ + public function cancel($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/subscription_schedules/%s/cancel', $id), $params, $opts); + } + + /** + * Creates a new subscription schedule object. Each customer can have up to 500 + * active or scheduled subscriptions. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SubscriptionSchedule + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/subscription_schedules', $params, $opts); + } + + /** + * Releases the subscription schedule immediately, which will stop scheduling of + * its phases, but leave any existing subscription in place. A schedule can only be + * released if its status is not_started or active. If + * the subscription schedule is currently associated with a subscription, releasing + * it will remove its subscription property and set the subscription’s + * ID to the released_subscription property. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SubscriptionSchedule + */ + public function release($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/subscription_schedules/%s/release', $id), $params, $opts); + } + + /** + * Retrieves the details of an existing subscription schedule. You only need to + * supply the unique subscription schedule identifier that was returned upon + * subscription schedule creation. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SubscriptionSchedule + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/subscription_schedules/%s', $id), $params, $opts); + } + + /** + * Updates an existing subscription schedule. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\SubscriptionSchedule + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/subscription_schedules/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/SubscriptionService.php b/app/api/Stripe/Service/SubscriptionService.php new file mode 100755 index 0000000..bee794f --- /dev/null +++ b/app/api/Stripe/Service/SubscriptionService.php @@ -0,0 +1,124 @@ +status=canceled. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/subscriptions', $params, $opts); + } + + /** + * Cancels a customer’s subscription immediately. The customer will not be charged + * again for the subscription. + * + * Note, however, that any pending invoice items that you’ve created will still be + * charged for at the end of the period, unless manually deleted. If you’ve set the subscription to cancel + * at the end of the period, any pending prorations will also be left in place and + * collected at the end of the period. But if the subscription is set to cancel + * immediately, pending prorations will be removed. + * + * By default, upon subscription cancellation, Stripe will stop automatic + * collection of all finalized invoices for the customer. This is intended to + * prevent unexpected payment attempts after the customer has canceled a + * subscription. However, you can resume automatic collection of the invoices + * manually after subscription cancellation to have us proceed. Or, you could check + * for unpaid invoices before allowing the customer to cancel the subscription at + * all. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Subscription + */ + public function cancel($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/subscriptions/%s', $id), $params, $opts); + } + + /** + * Creates a new subscription on an existing customer. Each customer can have up to + * 500 active or scheduled subscriptions. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Subscription + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/subscriptions', $params, $opts); + } + + /** + * Removes the currently applied discount on a subscription. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Subscription + */ + public function deleteDiscount($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/subscriptions/%s/discount', $id), $params, $opts); + } + + /** + * Retrieves the subscription with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Subscription + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/subscriptions/%s', $id), $params, $opts); + } + + /** + * Updates an existing subscription on a customer to match the specified + * parameters. When changing plans or quantities, we will optionally prorate the + * price we charge next month to make up for any price changes. To preview how the + * proration will be calculated, use the upcoming + * invoice endpoint. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Subscription + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/subscriptions/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/TaxRateService.php b/app/api/Stripe/Service/TaxRateService.php new file mode 100755 index 0000000..02cd6f0 --- /dev/null +++ b/app/api/Stripe/Service/TaxRateService.php @@ -0,0 +1,71 @@ +requestCollection('get', '/v1/tax_rates', $params, $opts); + } + + /** + * Creates a new tax rate. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TaxRate + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/tax_rates', $params, $opts); + } + + /** + * Retrieves a tax rate with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TaxRate + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/tax_rates/%s', $id), $params, $opts); + } + + /** + * Updates an existing tax rate. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TaxRate + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/tax_rates/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/Terminal/ConnectionTokenService.php b/app/api/Stripe/Service/Terminal/ConnectionTokenService.php new file mode 100755 index 0000000..db2ef9a --- /dev/null +++ b/app/api/Stripe/Service/Terminal/ConnectionTokenService.php @@ -0,0 +1,25 @@ +request('post', '/v1/terminal/connection_tokens', $params, $opts); + } +} diff --git a/app/api/Stripe/Service/Terminal/LocationService.php b/app/api/Stripe/Service/Terminal/LocationService.php new file mode 100755 index 0000000..9f43ce7 --- /dev/null +++ b/app/api/Stripe/Service/Terminal/LocationService.php @@ -0,0 +1,87 @@ +Location objects. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/terminal/locations', $params, $opts); + } + + /** + * Creates a new Location object. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Location + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/terminal/locations', $params, $opts); + } + + /** + * Deletes a Location object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Location + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/terminal/locations/%s', $id), $params, $opts); + } + + /** + * Retrieves a Location object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Location + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/terminal/locations/%s', $id), $params, $opts); + } + + /** + * Updates a Location object by setting the values of the parameters + * passed. Any parameters not provided will be left unchanged. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Location + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/terminal/locations/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/Terminal/ReaderService.php b/app/api/Stripe/Service/Terminal/ReaderService.php new file mode 100755 index 0000000..65f7ad8 --- /dev/null +++ b/app/api/Stripe/Service/Terminal/ReaderService.php @@ -0,0 +1,87 @@ +Reader objects. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function all($params = null, $opts = null) + { + return $this->requestCollection('get', '/v1/terminal/readers', $params, $opts); + } + + /** + * Creates a new Reader object. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Reader + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/terminal/readers', $params, $opts); + } + + /** + * Deletes a Reader object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Reader + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/terminal/readers/%s', $id), $params, $opts); + } + + /** + * Retrieves a Reader object. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Reader + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/terminal/readers/%s', $id), $params, $opts); + } + + /** + * Updates a Reader object by setting the values of the parameters + * passed. Any parameters not provided will be left unchanged. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Terminal\Reader + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/terminal/readers/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/Terminal/TerminalServiceFactory.php b/app/api/Stripe/Service/Terminal/TerminalServiceFactory.php new file mode 100755 index 0000000..f040941 --- /dev/null +++ b/app/api/Stripe/Service/Terminal/TerminalServiceFactory.php @@ -0,0 +1,29 @@ + + */ + private static $classMap = [ + 'connectionTokens' => ConnectionTokenService::class, + 'locations' => LocationService::class, + 'readers' => ReaderService::class, + ]; + + protected function getServiceClass($name) + { + return \array_key_exists($name, self::$classMap) ? self::$classMap[$name] : null; + } +} diff --git a/app/api/Stripe/Service/TokenService.php b/app/api/Stripe/Service/TokenService.php new file mode 100755 index 0000000..be8adfd --- /dev/null +++ b/app/api/Stripe/Service/TokenService.php @@ -0,0 +1,42 @@ +Custom + * account. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Token + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/tokens', $params, $opts); + } + + /** + * Retrieves the token with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Token + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/tokens/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/TopupService.php b/app/api/Stripe/Service/TopupService.php new file mode 100755 index 0000000..d1efc15 --- /dev/null +++ b/app/api/Stripe/Service/TopupService.php @@ -0,0 +1,89 @@ +requestCollection('get', '/v1/topups', $params, $opts); + } + + /** + * Cancels a top-up. Only pending top-ups can be canceled. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Topup + */ + public function cancel($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/topups/%s/cancel', $id), $params, $opts); + } + + /** + * Top up the balance of an account. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Topup + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/topups', $params, $opts); + } + + /** + * Retrieves the details of a top-up that has previously been created. Supply the + * unique top-up ID that was returned from your previous request, and Stripe will + * return the corresponding top-up information. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Topup + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/topups/%s', $id), $params, $opts); + } + + /** + * Updates the metadata of a top-up. Other top-up details are not editable by + * design. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Topup + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/topups/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/TransferService.php b/app/api/Stripe/Service/TransferService.php new file mode 100755 index 0000000..4c3baf5 --- /dev/null +++ b/app/api/Stripe/Service/TransferService.php @@ -0,0 +1,175 @@ +requestCollection('get', '/v1/transfers', $params, $opts); + } + + /** + * You can see a list of the reversals belonging to a specific transfer. Note that + * the 10 most recent reversals are always available by default on the transfer + * object. If you need more than those 10, you can use this API method and the + * limit and starting_after parameters to page through + * additional reversals. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection + */ + public function allReversals($parentId, $params = null, $opts = null) + { + return $this->requestCollection('get', $this->buildPath('/v1/transfers/%s/reversals', $parentId), $params, $opts); + } + + /** + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Transfer + */ + public function cancel($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/transfers/%s/cancel', $id), $params, $opts); + } + + /** + * To send funds from your Stripe account to a connected account, you create a new + * transfer object. Your Stripe balance must be able to + * cover the transfer amount, or you’ll receive an “Insufficient Funds” error. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Transfer + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/transfers', $params, $opts); + } + + /** + * When you create a new reversal, you must specify a transfer to create it on. + * + * When reversing transfers, you can optionally reverse part of the transfer. You + * can do so as many times as you wish until the entire transfer has been reversed. + * + * Once entirely reversed, a transfer can’t be reversed again. This method will + * return an error when called on an already-reversed transfer, or when trying to + * reverse more money than is left on a transfer. + * + * @param string $parentId + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TransferReversal + */ + public function createReversal($parentId, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/transfers/%s/reversals', $parentId), $params, $opts); + } + + /** + * Retrieves the details of an existing transfer. Supply the unique transfer ID + * from either a transfer creation request or the transfer list, and Stripe will + * return the corresponding transfer information. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Transfer + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/transfers/%s', $id), $params, $opts); + } + + /** + * By default, you can see the 10 most recent reversals stored directly on the + * transfer object, but you can also retrieve details about a specific reversal + * stored on the transfer. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TransferReversal + */ + public function retrieveReversal($parentId, $id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/transfers/%s/reversals/%s', $parentId, $id), $params, $opts); + } + + /** + * Updates the specified transfer by setting the values of the parameters passed. + * Any parameters not provided will be left unchanged. + * + * This request accepts only metadata as an argument. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Transfer + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/transfers/%s', $id), $params, $opts); + } + + /** + * Updates the specified reversal by setting the values of the parameters passed. + * Any parameters not provided will be left unchanged. + * + * This request only accepts metadata and description as arguments. + * + * @param string $parentId + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TransferReversal + */ + public function updateReversal($parentId, $id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/transfers/%s/reversals/%s', $parentId, $id), $params, $opts); + } +} diff --git a/app/api/Stripe/Service/WebhookEndpointService.php b/app/api/Stripe/Service/WebhookEndpointService.php new file mode 100755 index 0000000..936bc64 --- /dev/null +++ b/app/api/Stripe/Service/WebhookEndpointService.php @@ -0,0 +1,97 @@ +requestCollection('get', '/v1/webhook_endpoints', $params, $opts); + } + + /** + * A webhook endpoint must have a url and a list of + * enabled_events. You may optionally specify the Boolean + * connect parameter. If set to true, then a Connect webhook endpoint + * that notifies the specified url about events from all connected + * accounts is created; otherwise an account webhook endpoint that notifies the + * specified url only about events from your account is created. You + * can also create webhook endpoints in the webhooks settings + * section of the Dashboard. + * + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\WebhookEndpoint + */ + public function create($params = null, $opts = null) + { + return $this->request('post', '/v1/webhook_endpoints', $params, $opts); + } + + /** + * You can also delete webhook endpoints via the webhook endpoint + * management page of the Stripe dashboard. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\WebhookEndpoint + */ + public function delete($id, $params = null, $opts = null) + { + return $this->request('delete', $this->buildPath('/v1/webhook_endpoints/%s', $id), $params, $opts); + } + + /** + * Retrieves the webhook endpoint with the given ID. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\WebhookEndpoint + */ + public function retrieve($id, $params = null, $opts = null) + { + return $this->request('get', $this->buildPath('/v1/webhook_endpoints/%s', $id), $params, $opts); + } + + /** + * Updates the webhook endpoint. You may edit the url, the list of + * enabled_events, and the status of your endpoint. + * + * @param string $id + * @param null|array $params + * @param null|array|\Stripe\Util\RequestOptions $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\WebhookEndpoint + */ + public function update($id, $params = null, $opts = null) + { + return $this->request('post', $this->buildPath('/v1/webhook_endpoints/%s', $id), $params, $opts); + } +} diff --git a/app/api/Stripe/SetupAttempt.php b/app/api/Stripe/SetupAttempt.php new file mode 100755 index 0000000..9280237 --- /dev/null +++ b/app/api/Stripe/SetupAttempt.php @@ -0,0 +1,32 @@ +application on the SetupIntent at the time of this confirmation. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string|\Stripe\Customer $customer The value of customer on the SetupIntent at the time of this confirmation. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|string|\Stripe\Account $on_behalf_of The value of on_behalf_of on the SetupIntent at the time of this confirmation. + * @property string|\Stripe\PaymentMethod $payment_method ID of the payment method used with this SetupAttempt. + * @property \Stripe\StripeObject $payment_method_details + * @property null|\Stripe\ErrorObject $setup_error The error encountered during this attempt to confirm the SetupIntent, if any. + * @property string|\Stripe\SetupIntent $setup_intent ID of the SetupIntent that this attempt belongs to. + * @property string $status Status of this SetupAttempt, one of requires_confirmation, requires_action, processing, succeeded, failed, or abandoned. + * @property string $usage The value of usage on the SetupIntent at the time of this confirmation, one of off_session or on_session. + */ +class SetupAttempt extends ApiResource +{ + const OBJECT_NAME = 'setup_attempt'; + + use ApiOperations\All; +} diff --git a/app/api/Stripe/SetupIntent.php b/app/api/Stripe/SetupIntent.php new file mode 100755 index 0000000..21389e3 --- /dev/null +++ b/app/api/Stripe/SetupIntent.php @@ -0,0 +1,114 @@ +PaymentIntents to drive + * the payment flow. + * + * Create a SetupIntent as soon as you're ready to collect your customer's payment + * credentials. Do not maintain long-lived, unconfirmed SetupIntents as they may no + * longer be valid. The SetupIntent then transitions through multiple statuses as + * it guides you through the setup process. + * + * Successful SetupIntents result in payment credentials that are optimized for + * future payments. For example, cardholders in certain regions may need to be + * run through Strong Customer + * Authentication at the time of payment method collection in order to + * streamline later off-session payments. + * If the SetupIntent is used with a Customer, + * upon success, it will automatically attach the resulting payment method to that + * Customer. We recommend using SetupIntents or setup_future_usage + * on PaymentIntents to save payment methods in order to prevent saving invalid or + * unoptimized payment methods. + * + * By using SetupIntents, you ensure that your customers experience the minimum set + * of required friction, even as regulations change over time. + * + * Related guide: Setup + * Intents API. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|string|\Stripe\StripeObject $application ID of the Connect application that created the SetupIntent. + * @property null|string $cancellation_reason Reason for cancellation of this SetupIntent, one of abandoned, requested_by_customer, or duplicate. + * @property null|string $client_secret

The client secret of this SetupIntent. Used for client-side retrieval using a publishable key.

The client secret can be used to complete payment setup from your frontend. It should not be stored, logged, embedded in URLs, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret.

+ * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string|\Stripe\Customer $customer

ID of the Customer this SetupIntent belongs to, if one exists.

If present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent.

+ * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|\Stripe\ErrorObject $last_setup_error The error encountered in the previous SetupIntent confirmation. + * @property null|string|\Stripe\SetupAttempt $latest_attempt The most recent SetupAttempt for this SetupIntent. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|string|\Stripe\Mandate $mandate ID of the multi use Mandate generated by the SetupIntent. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|\Stripe\StripeObject $next_action If present, this property tells you what actions you need to take in order for your customer to continue payment setup. + * @property null|string|\Stripe\Account $on_behalf_of The account (if any) for which the setup is intended. + * @property null|string|\Stripe\PaymentMethod $payment_method ID of the payment method used with this SetupIntent. + * @property null|\Stripe\StripeObject $payment_method_options Payment-method-specific configuration for this SetupIntent. + * @property string[] $payment_method_types The list of payment method types (e.g. card) that this SetupIntent is allowed to set up. + * @property null|string|\Stripe\Mandate $single_use_mandate ID of the single_use Mandate generated by the SetupIntent. + * @property string $status Status of this SetupIntent, one of requires_payment_method, requires_confirmation, requires_action, processing, canceled, or succeeded. + * @property string $usage

Indicates how the payment method is intended to be used in the future.

Use on_session if you intend to only reuse the payment method when the customer is in your checkout flow. Use off_session if your customer may or may not be in your checkout flow. If not provided, this value defaults to off_session.

+ */ +class SetupIntent extends ApiResource +{ + const OBJECT_NAME = 'setup_intent'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const STATUS_CANCELED = 'canceled'; + const STATUS_PROCESSING = 'processing'; + const STATUS_REQUIRES_ACTION = 'requires_action'; + const STATUS_REQUIRES_CONFIRMATION = 'requires_confirmation'; + const STATUS_REQUIRES_PAYMENT_METHOD = 'requires_payment_method'; + const STATUS_SUCCEEDED = 'succeeded'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return SetupIntent the canceled setup intent + */ + public function cancel($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/cancel'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return SetupIntent the confirmed setup intent + */ + public function confirm($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/confirm'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/app/api/Stripe/Sigma/ScheduledQueryRun.php b/app/api/Stripe/Sigma/ScheduledQueryRun.php new file mode 100755 index 0000000..60ad038 --- /dev/null +++ b/app/api/Stripe/Sigma/ScheduledQueryRun.php @@ -0,0 +1,37 @@ +scheduled + * a Sigma query, you'll receive a + * sigma.scheduled_query_run.created webhook each time the query runs. + * The webhook contains a ScheduledQueryRun object, which you can use + * to retrieve the query results. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property int $data_load_time When the query was run, Sigma contained a snapshot of your Stripe data at this time. + * @property \Stripe\StripeObject $error + * @property null|\Stripe\File $file The file object representing the results of the query. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property int $result_available_until Time at which the result expires and is no longer available for download. + * @property string $sql SQL for the query. + * @property string $status The query's execution status, which will be completed for successful runs, and canceled, failed, or timed_out otherwise. + * @property string $title Title of the query. + */ +class ScheduledQueryRun extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'scheduled_query_run'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Retrieve; + + public static function classUrl() + { + return '/v1/sigma/scheduled_query_runs'; + } +} diff --git a/app/api/Stripe/SingletonApiResource.php b/app/api/Stripe/SingletonApiResource.php new file mode 100755 index 0000000..952c7b7 --- /dev/null +++ b/app/api/Stripe/SingletonApiResource.php @@ -0,0 +1,38 @@ +refresh(); + + return $instance; + } + + /** + * @return string the endpoint associated with this singleton class + */ + public static function classUrl() + { + // Replace dots with slashes for namespaced resources, e.g. if the object's name is + // "foo.bar", then its URL will be "/v1/foo/bar". + $base = \str_replace('.', '/', static::OBJECT_NAME); + + return "/v1/{$base}"; + } + + /** + * @return string the endpoint associated with this singleton API resource + */ + public function instanceUrl() + { + return static::classUrl(); + } +} diff --git a/app/api/Stripe/Source.php b/app/api/Stripe/Source.php new file mode 100755 index 0000000..95c217d --- /dev/null +++ b/app/api/Stripe/Source.php @@ -0,0 +1,168 @@ +Source objects allow you to accept a variety of payment methods. + * They represent a customer's payment instrument, and can be used with the Stripe + * API just like a Card object: once chargeable, they can be charged, + * or can be attached to customers. + * + * Related guides: Sources API and Sources & Customers. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property \Stripe\StripeObject $ach_credit_transfer + * @property \Stripe\StripeObject $ach_debit + * @property \Stripe\StripeObject $acss_debit + * @property \Stripe\StripeObject $alipay + * @property null|int $amount A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount associated with the source. This is the amount for which the source will be chargeable once ready. Required for single_use sources. + * @property \Stripe\StripeObject $au_becs_debit + * @property \Stripe\StripeObject $bancontact + * @property \Stripe\StripeObject $card + * @property \Stripe\StripeObject $card_present + * @property string $client_secret The client secret of the source. Used for client-side retrieval using a publishable key. + * @property \Stripe\StripeObject $code_verification + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string $currency Three-letter ISO code for the currency associated with the source. This is the currency for which the source will be chargeable once ready. Required for single_use sources. + * @property string $customer The ID of the customer to which this source is attached. This will not be present when the source has not been attached to a customer. + * @property \Stripe\StripeObject $eps + * @property string $flow The authentication flow of the source. flow is one of redirect, receiver, code_verification, none. + * @property \Stripe\StripeObject $giropay + * @property \Stripe\StripeObject $ideal + * @property \Stripe\StripeObject $klarna + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property \Stripe\StripeObject $multibanco + * @property null|\Stripe\StripeObject $owner Information about the owner of the payment instrument that may be used or required by particular source types. + * @property \Stripe\StripeObject $p24 + * @property \Stripe\StripeObject $receiver + * @property \Stripe\StripeObject $redirect + * @property \Stripe\StripeObject $sepa_credit_transfer + * @property \Stripe\StripeObject $sepa_debit + * @property \Stripe\StripeObject $sofort + * @property \Stripe\StripeObject $source_order + * @property null|string $statement_descriptor Extra information about a source. This will appear on your customer's statement every time you charge the source. + * @property string $status The status of the source, one of canceled, chargeable, consumed, failed, or pending. Only chargeable sources can be used to create a charge. + * @property \Stripe\StripeObject $three_d_secure + * @property string $type The type of the source. The type is a payment method, one of ach_credit_transfer, ach_debit, alipay, bancontact, card, card_present, eps, giropay, ideal, multibanco, klarna, p24, sepa_debit, sofort, three_d_secure, or wechat. An additional hash is included on the source with a name matching this value. It contains additional information specific to the payment method used. + * @property null|string $usage Either reusable or single_use. Whether this source should be reusable or not. Some source types may or may not be reusable by construction, while others may leave the option at creation. If an incompatible value is passed, an error will be returned. + * @property \Stripe\StripeObject $wechat + */ +class Source extends ApiResource +{ + const OBJECT_NAME = 'source'; + + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const FLOW_CODE_VERIFICATION = 'code_verification'; + const FLOW_NONE = 'none'; + const FLOW_RECEIVER = 'receiver'; + const FLOW_REDIRECT = 'redirect'; + + const STATUS_CANCELED = 'canceled'; + const STATUS_CHARGEABLE = 'chargeable'; + const STATUS_CONSUMED = 'consumed'; + const STATUS_FAILED = 'failed'; + const STATUS_PENDING = 'pending'; + + const USAGE_REUSABLE = 'reusable'; + const USAGE_SINGLE_USE = 'single_use'; + + use ApiOperations\NestedResource; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\UnexpectedValueException if the source is not attached to a customer + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Source the detached source + */ + public function detach($params = null, $opts = null) + { + self::_validateParams($params); + + $id = $this['id']; + if (!$id) { + $class = static::class; + $msg = "Could not determine which URL to request: {$class} instance " + . "has invalid ID: {$id}"; + + throw new Exception\UnexpectedValueException($msg, null); + } + + if ($this['customer']) { + $base = Customer::classUrl(); + $parentExtn = \urlencode(Util\Util::utf8($this['customer'])); + $extn = \urlencode(Util\Util::utf8($id)); + $url = "{$base}/{$parentExtn}/sources/{$extn}"; + + list($response, $opts) = $this->_request('delete', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + $message = 'This source object does not appear to be currently attached ' + . 'to a customer object.'; + + throw new Exception\UnexpectedValueException($message); + } + + /** + * @deprecated sourceTransactions is deprecated. Please use Source::allSourceTransactions instead. + * + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection the list of source transactions + */ + public function sourceTransactions($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/source_transactions'; + list($response, $opts) = $this->_request('get', $url, $params, $opts); + $obj = \Stripe\Util\Util::convertToStripeObject($response, $opts); + $obj->setLastResponse($response); + + return $obj; + } + + /** + * @param string $id + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection the list of source transactions + */ + public static function allSourceTransactions($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, '/source_transactions', $params, $opts); + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return Source the verified source + */ + public function verify($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/verify'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/app/api/Stripe/SourceTransaction.php b/app/api/Stripe/SourceTransaction.php new file mode 100755 index 0000000..6fb2aa1 --- /dev/null +++ b/app/api/Stripe/SourceTransaction.php @@ -0,0 +1,20 @@ +coreServiceFactory) { + $this->coreServiceFactory = new \Stripe\Service\CoreServiceFactory($this); + } + + return $this->coreServiceFactory->__get($name); + } +} diff --git a/app/api/Stripe/StripeClientInterface.php b/app/api/Stripe/StripeClientInterface.php new file mode 100755 index 0000000..f4c95bf --- /dev/null +++ b/app/api/Stripe/StripeClientInterface.php @@ -0,0 +1,56 @@ + "old_value"] + * + * If we update the object with `metadata[new]=new_value`, the server side + * object now has *both* fields: + * + * metadata = ["old" => "old_value", "new" => "new_value"] + * + * This is okay in itself because usually users will want to treat it as + * additive: + * + * $obj->metadata["new"] = "new_value"; + * $obj->save(); + * + * However, in other cases, they may want to replace the entire existing + * contents: + * + * $obj->metadata = ["new" => "new_value"]; + * $obj->save(); + * + * This is where things get a little bit tricky because in order to clear + * any old keys that may have existed, we actually have to send an explicit + * empty string to the server. So the operation above would have to send + * this form to get the intended behavior: + * + * metadata[old]=&metadata[new]=new_value + * + * This method allows us to track which parameters are considered additive, + * and lets us behave correctly where appropriate when serializing + * parameters to be sent. + * + * @return Util\Set Set of additive parameters + */ + public static function getAdditiveParams() + { + static $additiveParams = null; + if (null === $additiveParams) { + // Set `metadata` as additive so that when it's set directly we remember + // to clear keys that may have been previously set by sending empty + // values for them. + // + // It's possible that not every object has `metadata`, but having this + // option set when there is no `metadata` field is not harmful. + $additiveParams = new Util\Set([ + 'metadata', + ]); + } + + return $additiveParams; + } + + public function __construct($id = null, $opts = null) + { + list($id, $this->_retrieveOptions) = Util\Util::normalizeId($id); + $this->_opts = Util\RequestOptions::parse($opts); + $this->_originalValues = []; + $this->_values = []; + $this->_unsavedValues = new Util\Set(); + $this->_transientValues = new Util\Set(); + if (null !== $id) { + $this->_values['id'] = $id; + } + } + + // Standard accessor magic methods + public function __set($k, $v) + { + if (static::getPermanentAttributes()->includes($k)) { + throw new Exception\InvalidArgumentException( + "Cannot set {$k} on this object. HINT: you can't set: " . + \implode(', ', static::getPermanentAttributes()->toArray()) + ); + } + + if ('' === $v) { + throw new Exception\InvalidArgumentException( + 'You cannot set \'' . $k . '\'to an empty string. ' + . 'We interpret empty strings as NULL in requests. ' + . 'You may set obj->' . $k . ' = NULL to delete the property' + ); + } + + $this->_values[$k] = Util\Util::convertToStripeObject($v, $this->_opts); + $this->dirtyValue($this->_values[$k]); + $this->_unsavedValues->add($k); + } + + public function __isset($k) + { + return isset($this->_values[$k]); + } + + public function __unset($k) + { + unset($this->_values[$k]); + $this->_transientValues->add($k); + $this->_unsavedValues->discard($k); + } + + public function &__get($k) + { + // function should return a reference, using $nullval to return a reference to null + $nullval = null; + if (!empty($this->_values) && \array_key_exists($k, $this->_values)) { + return $this->_values[$k]; + } + if (!empty($this->_transientValues) && $this->_transientValues->includes($k)) { + $class = static::class; + $attrs = \implode(', ', \array_keys($this->_values)); + $message = "Stripe Notice: Undefined property of {$class} instance: {$k}. " + . "HINT: The {$k} attribute was set in the past, however. " + . 'It was then wiped when refreshing the object ' + . "with the result returned by Stripe's API, " + . 'probably as a result of a save(). The attributes currently ' + . "available on this object are: {$attrs}"; + Stripe::getLogger()->error($message); + + return $nullval; + } + $class = static::class; + Stripe::getLogger()->error("Stripe Notice: Undefined property of {$class} instance: {$k}"); + + return $nullval; + } + + // Magic method for var_dump output. Only works with PHP >= 5.6 + public function __debugInfo() + { + return $this->_values; + } + + // ArrayAccess methods + #[\ReturnTypeWillChange] + public function offsetSet($k, $v) + { + $this->{$k} = $v; + } + + #[\ReturnTypeWillChange] + public function offsetExists($k) + { + return \array_key_exists($k, $this->_values); + } + + #[\ReturnTypeWillChange] + public function offsetUnset($k) + { + unset($this->{$k}); + } + + #[\ReturnTypeWillChange] + public function offsetGet($k) + { + return \array_key_exists($k, $this->_values) ? $this->_values[$k] : null; + } + + // Countable method + #[\ReturnTypeWillChange] + public function count() + { + return \count($this->_values); + } + + public function keys() + { + return \array_keys($this->_values); + } + + public function values() + { + return \array_values($this->_values); + } + + /** + * This unfortunately needs to be public to be used in Util\Util. + * + * @param array $values + * @param null|array|string|Util\RequestOptions $opts + * + * @return static the object constructed from the given values + */ + public static function constructFrom($values, $opts = null) + { + $obj = new static(isset($values['id']) ? $values['id'] : null); + $obj->refreshFrom($values, $opts); + + return $obj; + } + + /** + * Refreshes this object using the provided values. + * + * @param array $values + * @param null|array|string|Util\RequestOptions $opts + * @param bool $partial defaults to false + */ + public function refreshFrom($values, $opts, $partial = false) + { + $this->_opts = Util\RequestOptions::parse($opts); + + $this->_originalValues = self::deepCopy($values); + + if ($values instanceof StripeObject) { + $values = $values->toArray(); + } + + // Wipe old state before setting new. This is useful for e.g. updating a + // customer, where there is no persistent card parameter. Mark those values + // which don't persist as transient + if ($partial) { + $removed = new Util\Set(); + } else { + $removed = new Util\Set(\array_diff(\array_keys($this->_values), \array_keys($values))); + } + + foreach ($removed->toArray() as $k) { + unset($this->{$k}); + } + + $this->updateAttributes($values, $opts, false); + foreach ($values as $k => $v) { + $this->_transientValues->discard($k); + $this->_unsavedValues->discard($k); + } + } + + /** + * Mass assigns attributes on the model. + * + * @param array $values + * @param null|array|string|Util\RequestOptions $opts + * @param bool $dirty defaults to true + */ + public function updateAttributes($values, $opts = null, $dirty = true) + { + foreach ($values as $k => $v) { + // Special-case metadata to always be cast as a StripeObject + // This is necessary in case metadata is empty, as PHP arrays do + // not differentiate between lists and hashes, and we consider + // empty arrays to be lists. + if (('metadata' === $k) && (\is_array($v))) { + $this->_values[$k] = StripeObject::constructFrom($v, $opts); + } else { + $this->_values[$k] = Util\Util::convertToStripeObject($v, $opts); + } + if ($dirty) { + $this->dirtyValue($this->_values[$k]); + } + $this->_unsavedValues->add($k); + } + } + + /** + * @param bool $force defaults to false + * + * @return array a recursive mapping of attributes to values for this object, + * including the proper value for deleted attributes + */ + public function serializeParameters($force = false) + { + $updateParams = []; + + foreach ($this->_values as $k => $v) { + // There are a few reasons that we may want to add in a parameter for + // update: + // + // 1. The `$force` option has been set. + // 2. We know that it was modified. + // 3. Its value is a StripeObject. A StripeObject may contain modified + // values within in that its parent StripeObject doesn't know about. + // + $original = \array_key_exists($k, $this->_originalValues) ? $this->_originalValues[$k] : null; + $unsaved = $this->_unsavedValues->includes($k); + if ($force || $unsaved || $v instanceof StripeObject) { + $updateParams[$k] = $this->serializeParamsValue( + $this->_values[$k], + $original, + $unsaved, + $force, + $k + ); + } + } + + // a `null` that makes it out of `serializeParamsValue` signals an empty + // value that we shouldn't appear in the serialized form of the object + return \array_filter( + $updateParams, + function ($v) { + return null !== $v; + } + ); + } + + public function serializeParamsValue($value, $original, $unsaved, $force, $key = null) + { + // The logic here is that essentially any object embedded in another + // object that had a `type` is actually an API resource of a different + // type that's been included in the response. These other resources must + // be updated from their proper endpoints, and therefore they are not + // included when serializing even if they've been modified. + // + // There are _some_ known exceptions though. + // + // For example, if the value is unsaved (meaning the user has set it), and + // it looks like the API resource is persisted with an ID, then we include + // the object so that parameters are serialized with a reference to its + // ID. + // + // Another example is that on save API calls it's sometimes desirable to + // update a customer's default source by setting a new card (or other) + // object with `->source=` and then saving the customer. The + // `saveWithParent` flag to override the default behavior allows us to + // handle these exceptions. + // + // We throw an error if a property was set explicitly but we can't do + // anything with it because the integration is probably not working as the + // user intended it to. + if (null === $value) { + return ''; + } + if (($value instanceof ApiResource) && (!$value->saveWithParent)) { + if (!$unsaved) { + return null; + } + if (isset($value->id)) { + return $value; + } + + throw new Exception\InvalidArgumentException( + "Cannot save property `{$key}` containing an API resource of type " . + \get_class($value) . ". It doesn't appear to be persisted and is " . + 'not marked as `saveWithParent`.' + ); + } + if (\is_array($value)) { + if (Util\Util::isList($value)) { + // Sequential array, i.e. a list + $update = []; + foreach ($value as $v) { + $update[] = $this->serializeParamsValue($v, null, true, $force); + } + // This prevents an array that's unchanged from being resent. + if ($update !== $this->serializeParamsValue($original, null, true, $force, $key)) { + return $update; + } + } else { + // Associative array, i.e. a map + return Util\Util::convertToStripeObject($value, $this->_opts)->serializeParameters(); + } + } elseif ($value instanceof StripeObject) { + $update = $value->serializeParameters($force); + if ($original && $unsaved && $key && static::getAdditiveParams()->includes($key)) { + $update = \array_merge(self::emptyValues($original), $update); + } + + return $update; + } else { + return $value; + } + } + + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return $this->toArray(); + } + + /** + * Returns an associative array with the key and values composing the + * Stripe object. + * + * @return array the associative array + */ + public function toArray() + { + $maybeToArray = function ($value) { + if (null === $value) { + return null; + } + + return \is_object($value) && \method_exists($value, 'toArray') ? $value->toArray() : $value; + }; + + return \array_reduce(\array_keys($this->_values), function ($acc, $k) use ($maybeToArray) { + if ('_' === \substr((string) $k, 0, 1)) { + return $acc; + } + $v = $this->_values[$k]; + if (Util\Util::isList($v)) { + $acc[$k] = \array_map($maybeToArray, $v); + } else { + $acc[$k] = $maybeToArray($v); + } + + return $acc; + }, []); + } + + /** + * Returns a pretty JSON representation of the Stripe object. + * + * @return string the JSON representation of the Stripe object + */ + public function toJSON() + { + return \json_encode($this->toArray(), \JSON_PRETTY_PRINT); + } + + public function __toString() + { + $class = static::class; + + return $class . ' JSON: ' . $this->toJSON(); + } + + /** + * Sets all keys within the StripeObject as unsaved so that they will be + * included with an update when `serializeParameters` is called. This + * method is also recursive, so any StripeObjects contained as values or + * which are values in a tenant array are also marked as dirty. + */ + public function dirty() + { + $this->_unsavedValues = new Util\Set(\array_keys($this->_values)); + foreach ($this->_values as $k => $v) { + $this->dirtyValue($v); + } + } + + protected function dirtyValue($value) + { + if (\is_array($value)) { + foreach ($value as $v) { + $this->dirtyValue($v); + } + } elseif ($value instanceof StripeObject) { + $value->dirty(); + } + } + + /** + * Produces a deep copy of the given object including support for arrays + * and StripeObjects. + * + * @param mixed $obj + */ + protected static function deepCopy($obj) + { + if (\is_array($obj)) { + $copy = []; + foreach ($obj as $k => $v) { + $copy[$k] = self::deepCopy($v); + } + + return $copy; + } + if ($obj instanceof StripeObject) { + return $obj::constructFrom( + self::deepCopy($obj->_values), + clone $obj->_opts + ); + } + + return $obj; + } + + /** + * Returns a hash of empty values for all the values that are in the given + * StripeObject. + * + * @param mixed $obj + */ + public static function emptyValues($obj) + { + if (\is_array($obj)) { + $values = $obj; + } elseif ($obj instanceof StripeObject) { + $values = $obj->_values; + } else { + throw new Exception\InvalidArgumentException( + 'empty_values got unexpected object type: ' . \get_class($obj) + ); + } + + return \array_fill_keys(\array_keys($values), ''); + } + + /** + * @return null|ApiResponse The last response from the Stripe API + */ + public function getLastResponse() + { + return $this->_lastResponse; + } + + /** + * Sets the last response from the Stripe API. + * + * @param ApiResponse $resp + */ + public function setLastResponse($resp) + { + $this->_lastResponse = $resp; + } + + /** + * Indicates whether or not the resource has been deleted on the server. + * Note that some, but not all, resources can indicate whether they have + * been deleted. + * + * @return bool whether the resource is deleted + */ + public function isDeleted() + { + return isset($this->_values['deleted']) ? $this->_values['deleted'] : false; + } +} diff --git a/app/api/Stripe/Subscription.php b/app/api/Stripe/Subscription.php new file mode 100755 index 0000000..94b7253 --- /dev/null +++ b/app/api/Stripe/Subscription.php @@ -0,0 +1,116 @@ +Creating + * Subscriptions. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|float $application_fee_percent A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice subtotal that will be transferred to the application owner's Stripe account. + * @property int $billing_cycle_anchor Determines the date of the first full invoice, and, for plans with month or year intervals, the day of the month for subsequent invoices. + * @property null|\Stripe\StripeObject $billing_thresholds Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period + * @property null|int $cancel_at A date in the future at which the subscription will automatically get canceled + * @property bool $cancel_at_period_end If the subscription has been canceled with the at_period_end flag set to true, cancel_at_period_end on the subscription will be true. You can use this attribute to determine whether a subscription that has a status of active is scheduled to be canceled at the end of the current period. + * @property null|int $canceled_at If the subscription has been canceled, the date of that cancellation. If the subscription was canceled with cancel_at_period_end, canceled_at will reflect the time of the most recent update request, not the end of the subscription period when the subscription is automatically moved to a canceled state. + * @property null|string $collection_method Either charge_automatically, or send_invoice. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property int $current_period_end End of the current period that the subscription has been invoiced for. At the end of this period, a new invoice will be created. + * @property int $current_period_start Start of the current period that the subscription has been invoiced for. + * @property string|\Stripe\Customer $customer ID of the customer who owns the subscription. + * @property null|int $days_until_due Number of days a customer has to pay invoices generated by this subscription. This value will be null for subscriptions where collection_method=charge_automatically. + * @property null|string|\Stripe\PaymentMethod $default_payment_method ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over default_source. If neither are set, invoices will use the customer's invoice_settings.default_payment_method or default_source. + * @property null|string|\Stripe\Account|\Stripe\AlipayAccount|\Stripe\BankAccount|\Stripe\BitcoinReceiver|\Stripe\Card|\Stripe\Source $default_source ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If default_payment_method is also set, default_payment_method will take precedence. If neither are set, invoices will use the customer's invoice_settings.default_payment_method or default_source. + * @property null|\Stripe\TaxRate[] $default_tax_rates The tax rates that will apply to any subscription item that does not have tax_rates set. Invoices created will have their default_tax_rates populated from the subscription. + * @property null|\Stripe\Discount $discount Describes the current discount applied to this subscription, if there is one. When billing, a discount applied to a subscription overrides a discount applied on a customer-wide basis. + * @property null|int $ended_at If the subscription has ended, the date the subscription ended. + * @property \Stripe\Collection $items List of subscription items, each with an attached price. + * @property null|string|\Stripe\Invoice $latest_invoice The most recent invoice this subscription has generated. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|int $next_pending_invoice_item_invoice Specifies the approximate timestamp on which any pending invoice items will be billed according to the schedule provided at pending_invoice_item_interval. + * @property null|\Stripe\StripeObject $pause_collection If specified, payment collection for this subscription will be paused. + * @property null|\Stripe\StripeObject $pending_invoice_item_interval Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling Create an invoice for the given subscription at the specified interval. + * @property null|string|\Stripe\SetupIntent $pending_setup_intent You can use this SetupIntent to collect user authentication when creating a subscription without immediate payment or updating a subscription's payment method, allowing you to optimize for off-session payments. Learn more in the SCA Migration Guide. + * @property null|\Stripe\StripeObject $pending_update If specified, pending updates that will be applied to the subscription once the latest_invoice has been paid. + * @property null|string|\Stripe\SubscriptionSchedule $schedule The schedule attached to the subscription + * @property int $start_date Date when the subscription was first created. The date might differ from the created date due to backdating. + * @property string $status

Possible values are incomplete, incomplete_expired, trialing, active, past_due, canceled, or unpaid.

For collection_method=charge_automatically a subscription moves into incomplete if the initial payment attempt fails. A subscription in this state can only have metadata and default_source updated. Once the first invoice is paid, the subscription moves into an active state. If the first invoice is not paid within 23 hours, the subscription transitions to incomplete_expired. This is a terminal state, the open invoice will be voided and no further invoices will be generated.

A subscription that is currently in a trial period is trialing and moves to active when the trial period is over.

If subscription collection_method=charge_automatically it becomes past_due when payment to renew it fails and canceled or unpaid (depending on your subscriptions settings) when Stripe has exhausted all payment retry attempts.

If subscription collection_method=send_invoice it becomes past_due when its invoice is not paid by the due date, and canceled or unpaid if it is still not paid by an additional deadline after that. Note that when a subscription has a status of unpaid, no subsequent invoices will be attempted (invoices will be created, but then immediately automatically closed). After receiving updated payment information from a customer, you may choose to reopen and pay their closed invoices.

+ * @property null|int $trial_end If the subscription has a trial, the end of that trial. + * @property null|int $trial_start If the subscription has a trial, the beginning of that trial. + */ +class Subscription extends ApiResource +{ + const OBJECT_NAME = 'subscription'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const PAYMENT_BEHAVIOR_ALLOW_INCOMPLETE = 'allow_incomplete'; + const PAYMENT_BEHAVIOR_ERROR_IF_INCOMPLETE = 'error_if_incomplete'; + const PAYMENT_BEHAVIOR_PENDING_IF_INCOMPLETE = 'pending_if_incomplete'; + + const PRORATION_BEHAVIOR_ALWAYS_INVOICE = 'always_invoice'; + const PRORATION_BEHAVIOR_CREATE_PRORATIONS = 'create_prorations'; + const PRORATION_BEHAVIOR_NONE = 'none'; + + const STATUS_ACTIVE = 'active'; + const STATUS_CANCELED = 'canceled'; + const STATUS_INCOMPLETE = 'incomplete'; + const STATUS_INCOMPLETE_EXPIRED = 'incomplete_expired'; + const STATUS_PAST_DUE = 'past_due'; + const STATUS_TRIALING = 'trialing'; + const STATUS_UNPAID = 'unpaid'; + + use ApiOperations\Delete { + delete as protected _delete; + } + + public static function getSavedNestedResources() + { + static $savedNestedResources = null; + if (null === $savedNestedResources) { + $savedNestedResources = new Util\Set([ + 'source', + ]); + } + + return $savedNestedResources; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Subscription the deleted subscription + */ + public function cancel($params = null, $opts = null) + { + return $this->_delete($params, $opts); + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Subscription the updated subscription + */ + public function deleteDiscount($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/discount'; + list($response, $opts) = $this->_request('delete', $url, $params, $opts); + $this->refreshFrom(['discount' => null], $opts, true); + } +} diff --git a/app/api/Stripe/SubscriptionItem.php b/app/api/Stripe/SubscriptionItem.php new file mode 100755 index 0000000..d85ed1c --- /dev/null +++ b/app/api/Stripe/SubscriptionItem.php @@ -0,0 +1,84 @@ +key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property \Stripe\Plan $plan

You can now model subscriptions more flexibly using the Prices API. It replaces the Plans API and is backwards compatible to simplify your migration.

Plans define the base price, currency, and billing cycle for recurring purchases of products. Products help you track inventory or provisioning, and plans help you track pricing. Different physical goods or levels of service should be represented by products, and pricing options should be represented by plans. This approach lets you change prices without having to change your provisioning scheme.

For example, you might have a single "gold" product that has plans for $10/month, $100/year, €9/month, and €90/year.

Related guides: Set up a subscription and more about products and prices.

+ * @property \Stripe\Price $price

Prices define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of products. Products help you track inventory or provisioning, and prices help you track payment terms. Different physical goods or levels of service should be represented by products, and pricing options should be represented by prices. This approach lets you change prices without having to change your provisioning scheme.

For example, you might have a single "gold" product that has prices for $10/month, $100/year, and €9 once.

Related guides: Set up a subscription, create an invoice, and more about products and prices.

+ * @property int $quantity The quantity of the plan to which the customer should be subscribed. + * @property string $subscription The subscription this subscription_item belongs to. + * @property null|\Stripe\TaxRate[] $tax_rates The tax rates which apply to this subscription_item. When set, the default_tax_rates on the subscription do not apply to this subscription_item. + */ +class SubscriptionItem extends ApiResource +{ + const OBJECT_NAME = 'subscription_item'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Delete; + use ApiOperations\NestedResource; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const PATH_USAGE_RECORDS = '/usage_records'; + + /** + * @param null|string $id the ID of the subscription item on which to create the usage record + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\UsageRecord + */ + public static function createUsageRecord($id, $params = null, $opts = null) + { + return self::_createNestedResource($id, static::PATH_USAGE_RECORDS, $params, $opts); + } + + /** + * @deprecated usageRecordSummaries is deprecated. Please use SubscriptionItem::allUsageRecordSummaries instead. + * + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection the list of usage record summaries + */ + public function usageRecordSummaries($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/usage_record_summaries'; + list($response, $opts) = $this->_request('get', $url, $params, $opts); + $obj = \Stripe\Util\Util::convertToStripeObject($response, $opts); + $obj->setLastResponse($response); + + return $obj; + } + + const PATH_USAGE_RECORD_SUMMARIES = '/usage_record_summaries'; + + /** + * @param string $id the ID of the subscription item on which to retrieve the usage record summaries + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection the list of usage record summaries + */ + public static function allUsageRecordSummaries($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_USAGE_RECORD_SUMMARIES, $params, $opts); + } +} diff --git a/app/api/Stripe/SubscriptionSchedule.php b/app/api/Stripe/SubscriptionSchedule.php new file mode 100755 index 0000000..3d34a86 --- /dev/null +++ b/app/api/Stripe/SubscriptionSchedule.php @@ -0,0 +1,74 @@ +Subscription + * Schedules. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|int $canceled_at Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch. + * @property null|int $completed_at Time at which the subscription schedule was completed. Measured in seconds since the Unix epoch. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|\Stripe\StripeObject $current_phase Object representing the start and end dates for the current phase of the subscription schedule, if it is active. + * @property string|\Stripe\Customer $customer ID of the customer who owns the subscription schedule. + * @property \Stripe\StripeObject $default_settings + * @property string $end_behavior Behavior of the subscription schedule and underlying subscription when it ends. Possible values are release and cancel. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property \Stripe\StripeObject[] $phases Configuration for the subscription schedule's phases. + * @property null|int $released_at Time at which the subscription schedule was released. Measured in seconds since the Unix epoch. + * @property null|string $released_subscription ID of the subscription once managed by the subscription schedule (if it is released). + * @property string $status The present status of the subscription schedule. Possible values are not_started, active, completed, released, and canceled. You can read more about the different states in our behavior guide. + * @property null|string|\Stripe\Subscription $subscription ID of the subscription managed by the subscription schedule. + */ +class SubscriptionSchedule extends ApiResource +{ + const OBJECT_NAME = 'subscription_schedule'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return SubscriptionSchedule the canceled subscription schedule + */ + public function cancel($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/cancel'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return SubscriptionSchedule the released subscription schedule + */ + public function release($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/release'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/app/api/Stripe/TaxId.php b/app/api/Stripe/TaxId.php new file mode 100755 index 0000000..ee3439a --- /dev/null +++ b/app/api/Stripe/TaxId.php @@ -0,0 +1,107 @@ +customer. A customer's tax IDs + * are displayed on invoices and credit notes issued for the customer. + * + * Related guide: Customer + * Tax Identification Numbers. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|string $country Two-letter ISO code representing the country of the tax ID. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string|\Stripe\Customer $customer ID of the customer. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property string $type Type of the tax ID, one of ae_trn, au_abn, br_cnpj, br_cpf, ca_bn, ca_qst, ch_vat, cl_tin, es_cif, eu_vat, gb_vat, hk_br, id_npwp, in_gst, jp_cn, jp_rn, kr_brn, li_uid, mx_rfc, my_frp, my_itn, my_sst, no_vat, nz_gst, ru_inn, ru_kpp, sa_vat, sg_gst, sg_uen, th_vat, tw_vat, us_ein, or za_vat. Note that some legacy tax IDs have type unknown + * @property string $value Value of the tax ID. + * @property null|\Stripe\StripeObject $verification Tax ID verification information. + */ +class TaxId extends ApiResource +{ + const OBJECT_NAME = 'tax_id'; + + use ApiOperations\Delete; + + const TYPE_AE_TRN = 'ae_trn'; + const TYPE_AU_ABN = 'au_abn'; + const TYPE_BR_CNPJ = 'br_cnpj'; + const TYPE_BR_CPF = 'br_cpf'; + const TYPE_CA_BN = 'ca_bn'; + const TYPE_CA_QST = 'ca_qst'; + const TYPE_CH_VAT = 'ch_vat'; + const TYPE_CL_TIN = 'cl_tin'; + const TYPE_ES_CIF = 'es_cif'; + const TYPE_EU_VAT = 'eu_vat'; + const TYPE_GB_VAT = 'gb_vat'; + const TYPE_HK_BR = 'hk_br'; + const TYPE_ID_NPWP = 'id_npwp'; + const TYPE_IN_GST = 'in_gst'; + const TYPE_JP_CN = 'jp_cn'; + const TYPE_JP_RN = 'jp_rn'; + const TYPE_KR_BRN = 'kr_brn'; + const TYPE_LI_UID = 'li_uid'; + const TYPE_MX_RFC = 'mx_rfc'; + const TYPE_MY_FRP = 'my_frp'; + const TYPE_MY_ITN = 'my_itn'; + const TYPE_MY_SST = 'my_sst'; + const TYPE_NO_VAT = 'no_vat'; + const TYPE_NZ_GST = 'nz_gst'; + const TYPE_RU_INN = 'ru_inn'; + const TYPE_RU_KPP = 'ru_kpp'; + const TYPE_SA_VAT = 'sa_vat'; + const TYPE_SG_GST = 'sg_gst'; + const TYPE_SG_UEN = 'sg_uen'; + const TYPE_TH_VAT = 'th_vat'; + const TYPE_TW_VAT = 'tw_vat'; + const TYPE_UNKNOWN = 'unknown'; + const TYPE_US_EIN = 'us_ein'; + const TYPE_ZA_VAT = 'za_vat'; + + const VERIFICATION_STATUS_PENDING = 'pending'; + const VERIFICATION_STATUS_UNAVAILABLE = 'unavailable'; + const VERIFICATION_STATUS_UNVERIFIED = 'unverified'; + const VERIFICATION_STATUS_VERIFIED = 'verified'; + + /** + * @return string the API URL for this tax id + */ + public function instanceUrl() + { + $id = $this['id']; + $customer = $this['customer']; + if (!$id) { + throw new Exception\UnexpectedValueException( + "Could not determine which URL to request: class instance has invalid ID: {$id}" + ); + } + $id = Util\Util::utf8($id); + $customer = Util\Util::utf8($customer); + + $base = Customer::classUrl(); + $customerExtn = \urlencode($customer); + $extn = \urlencode($id); + + return "{$base}/{$customerExtn}/tax_ids/{$extn}"; + } + + /** + * @param array|string $_id + * @param null|array|string $_opts + * + * @throws \Stripe\Exception\BadMethodCallException + */ + public static function retrieve($_id, $_opts = null) + { + $msg = 'Tax IDs cannot be retrieved without a customer ID. Retrieve ' . + "a tax ID using `Customer::retrieveTaxId('customer_id', " . + "'tax_id_id')`."; + + throw new Exception\BadMethodCallException($msg); + } +} diff --git a/app/api/Stripe/TaxRate.php b/app/api/Stripe/TaxRate.php new file mode 100755 index 0000000..66f6089 --- /dev/null +++ b/app/api/Stripe/TaxRate.php @@ -0,0 +1,40 @@ +invoices, subscriptions and + * Checkout + * Sessions to collect tax. + * + * Related guide: Tax + * Rates. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property bool $active Defaults to true. When set to false, this tax rate cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set. + * @property null|string $country Two-letter country code (ISO 3166-1 alpha-2). + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string $description An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. + * @property string $display_name The display name of the tax rates as it will appear to your customer on their receipt email, PDF, and the hosted invoice page. + * @property bool $inclusive This specifies if the tax rate is inclusive or exclusive. + * @property null|string $jurisdiction The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer’s invoice. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property float $percentage This represents the tax rate percent out of 100. + * @property null|string $state ISO 3166-2 subdivision code, without country prefix. For example, "NY" for New York, United States. + */ +class TaxRate extends ApiResource +{ + const OBJECT_NAME = 'tax_rate'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; +} diff --git a/app/api/Stripe/Terminal/ConnectionToken.php b/app/api/Stripe/Terminal/ConnectionToken.php new file mode 100755 index 0000000..5010257 --- /dev/null +++ b/app/api/Stripe/Terminal/ConnectionToken.php @@ -0,0 +1,23 @@ +Fleet + * Management. + * + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property string $location The id of the location that this connection token is scoped to. + * @property string $secret Your application should pass this token to the Stripe Terminal SDK. + */ +class ConnectionToken extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'terminal.connection_token'; + + use \Stripe\ApiOperations\Create; +} diff --git a/app/api/Stripe/Terminal/Location.php b/app/api/Stripe/Terminal/Location.php new file mode 100755 index 0000000..4519814 --- /dev/null +++ b/app/api/Stripe/Terminal/Location.php @@ -0,0 +1,30 @@ +Fleet + * Management. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property \Stripe\StripeObject $address + * @property string $display_name The display name of the location. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + */ +class Location extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'terminal.location'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Delete; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; +} diff --git a/app/api/Stripe/Terminal/Reader.php b/app/api/Stripe/Terminal/Reader.php new file mode 100755 index 0000000..8aaf1ca --- /dev/null +++ b/app/api/Stripe/Terminal/Reader.php @@ -0,0 +1,35 @@ +Connecting to a + * Reader. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|string $device_sw_version The current software version of the reader. + * @property string $device_type Type of reader, one of bbpos_chipper2x or verifone_P400. + * @property null|string $ip_address The local IP address of the reader. + * @property string $label Custom label given to the reader for easier identification. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|string $location The location identifier of the reader. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property string $serial_number Serial number of the reader. + * @property null|string $status The networking status of the reader. + */ +class Reader extends \Stripe\ApiResource +{ + const OBJECT_NAME = 'terminal.reader'; + + use \Stripe\ApiOperations\All; + use \Stripe\ApiOperations\Create; + use \Stripe\ApiOperations\Delete; + use \Stripe\ApiOperations\Retrieve; + use \Stripe\ApiOperations\Update; +} diff --git a/app/api/Stripe/ThreeDSecure.php b/app/api/Stripe/ThreeDSecure.php new file mode 100755 index 0000000..2a00db3 --- /dev/null +++ b/app/api/Stripe/ThreeDSecure.php @@ -0,0 +1,37 @@ +3D + * Secure object. Once the object has been created, you can use it to + * authenticate the cardholder and create a charge. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount Amount of the charge that you will create when authentication completes. + * @property bool $authenticated True if the cardholder went through the authentication flow and their bank indicated that authentication succeeded. + * @property \Stripe\Card $card

You can store multiple cards on a customer in order to charge the customer later. You can also store multiple debit cards on a recipient in order to transfer to those cards later.

Related guide: Card Payments with Sources.

+ * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property null|string $redirect_url If present, this is the URL that you should send the cardholder to for authentication. If you are going to use Stripe.js to display the authentication page in an iframe, you should use the value "_callback". + * @property string $status Possible values are redirect_pending, succeeded, or failed. When the cardholder can be authenticated, the object starts with status redirect_pending. When liability will be shifted to the cardholder's bank (either because the cardholder was successfully authenticated, or because the bank has not implemented 3D Secure, the object wlil be in status succeeded. failed indicates that authentication was attempted unsuccessfully. + */ +class ThreeDSecure extends ApiResource +{ + const OBJECT_NAME = 'three_d_secure'; + + use ApiOperations\Create; + use ApiOperations\Retrieve; + + /** + * @return string the endpoint URL for the given class + */ + public static function classUrl() + { + return '/v1/3d_secure'; + } +} diff --git a/app/api/Stripe/Token.php b/app/api/Stripe/Token.php new file mode 100755 index 0000000..6956ae8 --- /dev/null +++ b/app/api/Stripe/Token.php @@ -0,0 +1,57 @@ +recommended payments integrations to + * perform this process client-side. This ensures that no sensitive card data + * touches your server, and allows your integration to operate in a PCI-compliant + * way. + * + * If you cannot use client-side tokenization, you can also create tokens using the + * API with either your publishable or secret API key. Keep in mind that if your + * integration uses this method, you are responsible for any PCI compliance that + * may be required, and you must keep your secret API key safe. Unlike with + * client-side tokenization, your customer's information is not sent directly to + * Stripe, so we cannot determine how it is handled or stored. + * + * Tokens cannot be stored or used more than once. To store card or bank account + * information for later use, you can create Customer objects or Custom accounts. Note + * that Radar, our integrated solution + * for automatic fraud protection, supports only integrations that use client-side + * tokenization. + * + * Related guide: Accept + * a payment + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property \Stripe\BankAccount $bank_account

These bank accounts are payment methods on Customer objects.

On the other hand External Accounts are transfer destinations on Account objects for Custom accounts. They can be bank accounts or debit cards as well, and are documented in the links above.

Related guide: Bank Debits and Transfers.

+ * @property \Stripe\Card $card

You can store multiple cards on a customer in order to charge the customer later. You can also store multiple debit cards on a recipient in order to transfer to those cards later.

Related guide: Card Payments with Sources.

+ * @property null|string $client_ip IP address of the client that generated the token. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property string $type Type of the token: account, bank_account, card, or pii. + * @property bool $used Whether this token has already been used (tokens can be used only once). + */ +class Token extends ApiResource +{ + const OBJECT_NAME = 'token'; + + use ApiOperations\Create; + use ApiOperations\Retrieve; + + const TYPE_ACCOUNT = 'account'; + const TYPE_BANK_ACCOUNT = 'bank_account'; + const TYPE_CARD = 'card'; + const TYPE_PII = 'pii'; +} diff --git a/app/api/Stripe/Topup.php b/app/api/Stripe/Topup.php new file mode 100755 index 0000000..4782173 --- /dev/null +++ b/app/api/Stripe/Topup.php @@ -0,0 +1,63 @@ +Topping Up your + * Platform Account. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount Amount transferred. + * @property null|string|\Stripe\BalanceTransaction $balance_transaction ID of the balance transaction that describes the impact of this top-up on your account balance. May not be specified depending on status of top-up. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|int $expected_availability_date Date the funds are expected to arrive in your Stripe account for payouts. This factors in delays like weekends or bank holidays. May not be specified depending on status of top-up. + * @property null|string $failure_code Error code explaining reason for top-up failure if available (see the errors section for a list of codes). + * @property null|string $failure_message Message to user further explaining reason for top-up failure if available. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property \Stripe\Source $source

Source objects allow you to accept a variety of payment methods. They represent a customer's payment instrument, and can be used with the Stripe API just like a Card object: once chargeable, they can be charged, or can be attached to customers.

Related guides: Sources API and Sources & Customers.

+ * @property null|string $statement_descriptor Extra information about a top-up. This will appear on your source's bank statement. It must contain at least one letter. + * @property string $status The status of the top-up is either canceled, failed, pending, reversed, or succeeded. + * @property null|string $transfer_group A string that identifies this top-up as part of a group. + */ +class Topup extends ApiResource +{ + const OBJECT_NAME = 'topup'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const STATUS_CANCELED = 'canceled'; + const STATUS_FAILED = 'failed'; + const STATUS_PENDING = 'pending'; + const STATUS_REVERSED = 'reversed'; + const STATUS_SUCCEEDED = 'succeeded'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return Topup the canceled topup + */ + public function cancel($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/cancel'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } +} diff --git a/app/api/Stripe/Transfer.php b/app/api/Stripe/Transfer.php new file mode 100755 index 0000000..5d720dd --- /dev/null +++ b/app/api/Stripe/Transfer.php @@ -0,0 +1,130 @@ +Transfer object is created when you move funds between Stripe + * accounts as part of Connect. + * + * Before April 6, 2017, transfers also represented movement of funds from a Stripe + * account to a card or bank account. This behavior has since been split out into a + * Payout object, with + * corresponding payout endpoints. For more information, read about the transfer/payout split. + * + * Related guide: Creating Separate + * Charges and Transfers. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount Amount in %s to be transferred. + * @property int $amount_reversed Amount in %s reversed (can be less than the amount attribute on the transfer if a partial reversal was issued). + * @property null|string|\Stripe\BalanceTransaction $balance_transaction Balance transaction that describes the impact of this transfer on your account balance. + * @property int $created Time that this record of the transfer was first created. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string $description An arbitrary string attached to the object. Often useful for displaying to users. + * @property null|string|\Stripe\Account $destination ID of the Stripe account the transfer was sent to. + * @property string|\Stripe\Charge $destination_payment If the destination is a Stripe account, this will be the ID of the payment that the destination account received for the transfer. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property \Stripe\Collection $reversals A list of reversals that have been applied to the transfer. + * @property bool $reversed Whether the transfer has been fully reversed. If the transfer is only partially reversed, this attribute will still be false. + * @property null|string|\Stripe\Charge $source_transaction ID of the charge or payment that was used to fund the transfer. If null, the transfer was funded from the available balance. + * @property null|string $source_type The source balance this transfer came from. One of card, fpx, or bank_account. + * @property null|string $transfer_group A string that identifies this transaction as part of a group. See the Connect documentation for details. + */ +class Transfer extends ApiResource +{ + const OBJECT_NAME = 'transfer'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\NestedResource; + use ApiOperations\Retrieve; + use ApiOperations\Update; + + const SOURCE_TYPE_ALIPAY_ACCOUNT = 'alipay_account'; + const SOURCE_TYPE_BANK_ACCOUNT = 'bank_account'; + const SOURCE_TYPE_CARD = 'card'; + const SOURCE_TYPE_FINANCING = 'financing'; + + /** + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return Transfer the canceled transfer + */ + public function cancel($params = null, $opts = null) + { + $url = $this->instanceUrl() . '/cancel'; + list($response, $opts) = $this->_request('post', $url, $params, $opts); + $this->refreshFrom($response, $opts); + + return $this; + } + + const PATH_REVERSALS = '/reversals'; + + /** + * @param string $id the ID of the transfer on which to retrieve the transfer reversals + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\Collection the list of transfer reversals + */ + public static function allReversals($id, $params = null, $opts = null) + { + return self::_allNestedResources($id, static::PATH_REVERSALS, $params, $opts); + } + + /** + * @param string $id the ID of the transfer on which to create the transfer reversal + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TransferReversal + */ + public static function createReversal($id, $params = null, $opts = null) + { + return self::_createNestedResource($id, static::PATH_REVERSALS, $params, $opts); + } + + /** + * @param string $id the ID of the transfer to which the transfer reversal belongs + * @param string $reversalId the ID of the transfer reversal to retrieve + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TransferReversal + */ + public static function retrieveReversal($id, $reversalId, $params = null, $opts = null) + { + return self::_retrieveNestedResource($id, static::PATH_REVERSALS, $reversalId, $params, $opts); + } + + /** + * @param string $id the ID of the transfer to which the transfer reversal belongs + * @param string $reversalId the ID of the transfer reversal to update + * @param null|array $params + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return \Stripe\TransferReversal + */ + public static function updateReversal($id, $reversalId, $params = null, $opts = null) + { + return self::_updateNestedResource($id, static::PATH_REVERSALS, $reversalId, $params, $opts); + } +} diff --git a/app/api/Stripe/TransferReversal.php b/app/api/Stripe/TransferReversal.php new file mode 100755 index 0000000..a2be682 --- /dev/null +++ b/app/api/Stripe/TransferReversal.php @@ -0,0 +1,79 @@ +Stripe Connect platforms can + * reverse transfers made to a connected account, either entirely or partially, and + * can also specify whether to refund any related application fees. Transfer + * reversals add to the platform's balance and subtract from the destination + * account's balance. + * + * Reversing a transfer that was made for a destination charge is allowed only + * up to the amount of the charge. It is possible to reverse a transfer_group + * transfer only if the destination account has enough balance to cover the + * reversal. + * + * Related guide: Reversing + * Transfers. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property int $amount Amount, in %s. + * @property null|string|\Stripe\BalanceTransaction $balance_transaction Balance transaction that describes the impact on your account balance. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property string $currency Three-letter ISO currency code, in lowercase. Must be a supported currency. + * @property null|string|\Stripe\Refund $destination_payment_refund Linked payment refund for the transfer reversal. + * @property null|\Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property null|string|\Stripe\Refund $source_refund ID of the refund responsible for the transfer reversal. + * @property string|\Stripe\Transfer $transfer ID of the transfer that was reversed. + */ +class TransferReversal extends ApiResource +{ + const OBJECT_NAME = 'transfer_reversal'; + + use ApiOperations\Update { + save as protected _save; + } + + /** + * @return string the API URL for this Stripe transfer reversal + */ + public function instanceUrl() + { + $id = $this['id']; + $transfer = $this['transfer']; + if (!$id) { + throw new Exception\UnexpectedValueException( + 'Could not determine which URL to request: ' . + "class instance has invalid ID: {$id}", + null + ); + } + $id = Util\Util::utf8($id); + $transfer = Util\Util::utf8($transfer); + + $base = Transfer::classUrl(); + $transferExtn = \urlencode($transfer); + $extn = \urlencode($id); + + return "{$base}/{$transferExtn}/reversals/{$extn}"; + } + + /** + * @param null|array|string $opts + * + * @throws \Stripe\Exception\ApiErrorException if the request fails + * + * @return TransferReversal the saved reversal + */ + public function save($opts = null) + { + return $this->_save($opts); + } +} diff --git a/app/api/Stripe/UsageRecord.php b/app/api/Stripe/UsageRecord.php new file mode 100755 index 0000000..355c796 --- /dev/null +++ b/app/api/Stripe/UsageRecord.php @@ -0,0 +1,25 @@ +Metered + * Billing. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property int $quantity The usage quantity for the specified date. + * @property string $subscription_item The ID of the subscription item this usage record contains data for. + * @property int $timestamp The timestamp when this usage occurred. + */ +class UsageRecord extends ApiResource +{ + const OBJECT_NAME = 'usage_record'; +} diff --git a/app/api/Stripe/UsageRecordSummary.php b/app/api/Stripe/UsageRecordSummary.php new file mode 100755 index 0000000..d56d5d3 --- /dev/null +++ b/app/api/Stripe/UsageRecordSummary.php @@ -0,0 +1,19 @@ +true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $period + * @property string $subscription_item The ID of the subscription item this summary is describing. + * @property int $total_usage The total usage within this usage period. + */ +class UsageRecordSummary extends ApiResource +{ + const OBJECT_NAME = 'usage_record_summary'; +} diff --git a/app/api/Stripe/Util/CaseInsensitiveArray.php b/app/api/Stripe/Util/CaseInsensitiveArray.php new file mode 100755 index 0000000..f7d269f --- /dev/null +++ b/app/api/Stripe/Util/CaseInsensitiveArray.php @@ -0,0 +1,78 @@ +container = \array_change_key_case($initial_array, \CASE_LOWER); + } + + #[\ReturnTypeWillChange] + public function count() + { + return \count($this->container); + } + + #[\ReturnTypeWillChange] + public function getIterator() + { + return new \ArrayIterator($this->container); + } + + #[\ReturnTypeWillChange] + public function offsetSet($offset, $value) + { + $offset = static::maybeLowercase($offset); + if (null === $offset) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + #[\ReturnTypeWillChange] + public function offsetExists($offset) + { + $offset = static::maybeLowercase($offset); + + return isset($this->container[$offset]); + } + + #[\ReturnTypeWillChange] + public function offsetUnset($offset) + { + $offset = static::maybeLowercase($offset); + unset($this->container[$offset]); + } + + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + $offset = static::maybeLowercase($offset); + + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + private static function maybeLowercase($v) + { + if (\is_string($v)) { + return \strtolower($v); + } + + return $v; + } +} diff --git a/app/api/Stripe/Util/DefaultLogger.php b/app/api/Stripe/Util/DefaultLogger.php new file mode 100755 index 0000000..b749702 --- /dev/null +++ b/app/api/Stripe/Util/DefaultLogger.php @@ -0,0 +1,29 @@ + 0) { + throw new \Stripe\Exception\BadMethodCallException('DefaultLogger does not currently implement context. Please implement if you need it.'); + } + + if (null === $this->destination) { + \error_log($message, $this->messageType); + } else { + \error_log($message, $this->messageType, $this->destination); + } + } +} diff --git a/app/api/Stripe/Util/LoggerInterface.php b/app/api/Stripe/Util/LoggerInterface.php new file mode 100755 index 0000000..c9b7be2 --- /dev/null +++ b/app/api/Stripe/Util/LoggerInterface.php @@ -0,0 +1,34 @@ + \Stripe\Account::class, + \Stripe\AccountLink::OBJECT_NAME => \Stripe\AccountLink::class, + \Stripe\AlipayAccount::OBJECT_NAME => \Stripe\AlipayAccount::class, + \Stripe\ApplePayDomain::OBJECT_NAME => \Stripe\ApplePayDomain::class, + \Stripe\ApplicationFee::OBJECT_NAME => \Stripe\ApplicationFee::class, + \Stripe\ApplicationFeeRefund::OBJECT_NAME => \Stripe\ApplicationFeeRefund::class, + \Stripe\Balance::OBJECT_NAME => \Stripe\Balance::class, + \Stripe\BalanceTransaction::OBJECT_NAME => \Stripe\BalanceTransaction::class, + \Stripe\BankAccount::OBJECT_NAME => \Stripe\BankAccount::class, + \Stripe\BillingPortal\Configuration::OBJECT_NAME => \Stripe\BillingPortal\Configuration::class, + \Stripe\BillingPortal\Session::OBJECT_NAME => \Stripe\BillingPortal\Session::class, + \Stripe\BitcoinReceiver::OBJECT_NAME => \Stripe\BitcoinReceiver::class, + \Stripe\BitcoinTransaction::OBJECT_NAME => \Stripe\BitcoinTransaction::class, + \Stripe\Capability::OBJECT_NAME => \Stripe\Capability::class, + \Stripe\Card::OBJECT_NAME => \Stripe\Card::class, + \Stripe\Charge::OBJECT_NAME => \Stripe\Charge::class, + \Stripe\Checkout\Session::OBJECT_NAME => \Stripe\Checkout\Session::class, + \Stripe\Collection::OBJECT_NAME => \Stripe\Collection::class, + \Stripe\CountrySpec::OBJECT_NAME => \Stripe\CountrySpec::class, + \Stripe\Coupon::OBJECT_NAME => \Stripe\Coupon::class, + \Stripe\CreditNote::OBJECT_NAME => \Stripe\CreditNote::class, + \Stripe\CreditNoteLineItem::OBJECT_NAME => \Stripe\CreditNoteLineItem::class, + \Stripe\Customer::OBJECT_NAME => \Stripe\Customer::class, + \Stripe\CustomerBalanceTransaction::OBJECT_NAME => \Stripe\CustomerBalanceTransaction::class, + \Stripe\Discount::OBJECT_NAME => \Stripe\Discount::class, + \Stripe\Dispute::OBJECT_NAME => \Stripe\Dispute::class, + \Stripe\EphemeralKey::OBJECT_NAME => \Stripe\EphemeralKey::class, + \Stripe\Event::OBJECT_NAME => \Stripe\Event::class, + \Stripe\ExchangeRate::OBJECT_NAME => \Stripe\ExchangeRate::class, + \Stripe\File::OBJECT_NAME => \Stripe\File::class, + \Stripe\File::OBJECT_NAME_ALT => \Stripe\File::class, + \Stripe\FileLink::OBJECT_NAME => \Stripe\FileLink::class, + \Stripe\Invoice::OBJECT_NAME => \Stripe\Invoice::class, + \Stripe\InvoiceItem::OBJECT_NAME => \Stripe\InvoiceItem::class, + \Stripe\InvoiceLineItem::OBJECT_NAME => \Stripe\InvoiceLineItem::class, + \Stripe\Issuing\Authorization::OBJECT_NAME => \Stripe\Issuing\Authorization::class, + \Stripe\Issuing\Card::OBJECT_NAME => \Stripe\Issuing\Card::class, + \Stripe\Issuing\CardDetails::OBJECT_NAME => \Stripe\Issuing\CardDetails::class, + \Stripe\Issuing\Cardholder::OBJECT_NAME => \Stripe\Issuing\Cardholder::class, + \Stripe\Issuing\Dispute::OBJECT_NAME => \Stripe\Issuing\Dispute::class, + \Stripe\Issuing\Transaction::OBJECT_NAME => \Stripe\Issuing\Transaction::class, + \Stripe\LineItem::OBJECT_NAME => \Stripe\LineItem::class, + \Stripe\LoginLink::OBJECT_NAME => \Stripe\LoginLink::class, + \Stripe\Mandate::OBJECT_NAME => \Stripe\Mandate::class, + \Stripe\Order::OBJECT_NAME => \Stripe\Order::class, + \Stripe\OrderItem::OBJECT_NAME => \Stripe\OrderItem::class, + \Stripe\OrderReturn::OBJECT_NAME => \Stripe\OrderReturn::class, + \Stripe\PaymentIntent::OBJECT_NAME => \Stripe\PaymentIntent::class, + \Stripe\PaymentMethod::OBJECT_NAME => \Stripe\PaymentMethod::class, + \Stripe\Payout::OBJECT_NAME => \Stripe\Payout::class, + \Stripe\Person::OBJECT_NAME => \Stripe\Person::class, + \Stripe\Plan::OBJECT_NAME => \Stripe\Plan::class, + \Stripe\Price::OBJECT_NAME => \Stripe\Price::class, + \Stripe\Product::OBJECT_NAME => \Stripe\Product::class, + \Stripe\PromotionCode::OBJECT_NAME => \Stripe\PromotionCode::class, + \Stripe\Radar\EarlyFraudWarning::OBJECT_NAME => \Stripe\Radar\EarlyFraudWarning::class, + \Stripe\Radar\ValueList::OBJECT_NAME => \Stripe\Radar\ValueList::class, + \Stripe\Radar\ValueListItem::OBJECT_NAME => \Stripe\Radar\ValueListItem::class, + \Stripe\Recipient::OBJECT_NAME => \Stripe\Recipient::class, + \Stripe\RecipientTransfer::OBJECT_NAME => \Stripe\RecipientTransfer::class, + \Stripe\Refund::OBJECT_NAME => \Stripe\Refund::class, + \Stripe\Reporting\ReportRun::OBJECT_NAME => \Stripe\Reporting\ReportRun::class, + \Stripe\Reporting\ReportType::OBJECT_NAME => \Stripe\Reporting\ReportType::class, + \Stripe\Review::OBJECT_NAME => \Stripe\Review::class, + \Stripe\SetupAttempt::OBJECT_NAME => \Stripe\SetupAttempt::class, + \Stripe\SetupIntent::OBJECT_NAME => \Stripe\SetupIntent::class, + \Stripe\Sigma\ScheduledQueryRun::OBJECT_NAME => \Stripe\Sigma\ScheduledQueryRun::class, + \Stripe\SKU::OBJECT_NAME => \Stripe\SKU::class, + \Stripe\Source::OBJECT_NAME => \Stripe\Source::class, + \Stripe\SourceTransaction::OBJECT_NAME => \Stripe\SourceTransaction::class, + \Stripe\Subscription::OBJECT_NAME => \Stripe\Subscription::class, + \Stripe\SubscriptionItem::OBJECT_NAME => \Stripe\SubscriptionItem::class, + \Stripe\SubscriptionSchedule::OBJECT_NAME => \Stripe\SubscriptionSchedule::class, + \Stripe\TaxId::OBJECT_NAME => \Stripe\TaxId::class, + \Stripe\TaxRate::OBJECT_NAME => \Stripe\TaxRate::class, + \Stripe\Terminal\ConnectionToken::OBJECT_NAME => \Stripe\Terminal\ConnectionToken::class, + \Stripe\Terminal\Location::OBJECT_NAME => \Stripe\Terminal\Location::class, + \Stripe\Terminal\Reader::OBJECT_NAME => \Stripe\Terminal\Reader::class, + \Stripe\ThreeDSecure::OBJECT_NAME => \Stripe\ThreeDSecure::class, + \Stripe\Token::OBJECT_NAME => \Stripe\Token::class, + \Stripe\Topup::OBJECT_NAME => \Stripe\Topup::class, + \Stripe\Transfer::OBJECT_NAME => \Stripe\Transfer::class, + \Stripe\TransferReversal::OBJECT_NAME => \Stripe\TransferReversal::class, + \Stripe\UsageRecord::OBJECT_NAME => \Stripe\UsageRecord::class, + \Stripe\UsageRecordSummary::OBJECT_NAME => \Stripe\UsageRecordSummary::class, + \Stripe\WebhookEndpoint::OBJECT_NAME => \Stripe\WebhookEndpoint::class, + ]; +} diff --git a/app/api/Stripe/Util/RandomGenerator.php b/app/api/Stripe/Util/RandomGenerator.php new file mode 100755 index 0000000..6a29213 --- /dev/null +++ b/app/api/Stripe/Util/RandomGenerator.php @@ -0,0 +1,36 @@ + a list of headers that should be persisted across requests + */ + public static $HEADERS_TO_PERSIST = [ + 'Stripe-Account', + 'Stripe-Version', + ]; + + /** @var array */ + public $headers; + + /** @var null|string */ + public $apiKey; + + /** @var null|string */ + public $apiBase; + + /** + * @param null|string $key + * @param array $headers + * @param null|string $base + */ + public function __construct($key = null, $headers = [], $base = null) + { + $this->apiKey = $key; + $this->headers = $headers; + $this->apiBase = $base; + } + + /** + * @return array + */ + public function __debugInfo() + { + return [ + 'apiKey' => $this->redactedApiKey(), + 'headers' => $this->headers, + 'apiBase' => $this->apiBase, + ]; + } + + /** + * Unpacks an options array and merges it into the existing RequestOptions + * object. + * + * @param null|array|RequestOptions|string $options a key => value array + * @param bool $strict when true, forbid string form and arbitrary keys in array form + * + * @return RequestOptions + */ + public function merge($options, $strict = false) + { + $other_options = self::parse($options, $strict); + if (null === $other_options->apiKey) { + $other_options->apiKey = $this->apiKey; + } + if (null === $other_options->apiBase) { + $other_options->apiBase = $this->apiBase; + } + $other_options->headers = \array_merge($this->headers, $other_options->headers); + + return $other_options; + } + + /** + * Discards all headers that we don't want to persist across requests. + */ + public function discardNonPersistentHeaders() + { + foreach ($this->headers as $k => $v) { + if (!\in_array($k, self::$HEADERS_TO_PERSIST, true)) { + unset($this->headers[$k]); + } + } + } + + /** + * Unpacks an options array into an RequestOptions object. + * + * @param null|array|RequestOptions|string $options a key => value array + * @param bool $strict when true, forbid string form and arbitrary keys in array form + * + * @throws \Stripe\Exception\InvalidArgumentException + * + * @return RequestOptions + */ + public static function parse($options, $strict = false) + { + if ($options instanceof self) { + return $options; + } + + if (null === $options) { + return new RequestOptions(null, [], null); + } + + if (\is_string($options)) { + if ($strict) { + $message = 'Do not pass a string for request options. If you want to set the ' + . 'API key, pass an array like ["api_key" => ] instead.'; + + throw new \Stripe\Exception\InvalidArgumentException($message); + } + + return new RequestOptions($options, [], null); + } + + if (\is_array($options)) { + $headers = []; + $key = null; + $base = null; + + if (\array_key_exists('api_key', $options)) { + $key = $options['api_key']; + unset($options['api_key']); + } + if (\array_key_exists('idempotency_key', $options)) { + $headers['Idempotency-Key'] = $options['idempotency_key']; + unset($options['idempotency_key']); + } + if (\array_key_exists('stripe_account', $options)) { + $headers['Stripe-Account'] = $options['stripe_account']; + unset($options['stripe_account']); + } + if (\array_key_exists('stripe_version', $options)) { + $headers['Stripe-Version'] = $options['stripe_version']; + unset($options['stripe_version']); + } + if (\array_key_exists('api_base', $options)) { + $base = $options['api_base']; + unset($options['api_base']); + } + + if ($strict && !empty($options)) { + $message = 'Got unexpected keys in options array: ' . \implode(', ', \array_keys($options)); + + throw new \Stripe\Exception\InvalidArgumentException($message); + } + + return new RequestOptions($key, $headers, $base); + } + + $message = 'The second argument to Stripe API method calls is an ' + . 'optional per-request apiKey, which must be a string, or ' + . 'per-request options, which must be an array. (HINT: you can set ' + . 'a global apiKey by "Stripe::setApiKey()")'; + + throw new \Stripe\Exception\InvalidArgumentException($message); + } + + private function redactedApiKey() + { + $pieces = \explode('_', $this->apiKey, 3); + $last = \array_pop($pieces); + $redactedLast = \strlen($last) > 4 + ? (\str_repeat('*', \strlen($last) - 4) . \substr($last, -4)) + : $last; + $pieces[] = $redactedLast; + + return \implode('_', $pieces); + } +} diff --git a/app/api/Stripe/Util/Set.php b/app/api/Stripe/Util/Set.php new file mode 100755 index 0000000..8b7a087 --- /dev/null +++ b/app/api/Stripe/Util/Set.php @@ -0,0 +1,45 @@ +_elts = []; + foreach ($members as $item) { + $this->_elts[$item] = true; + } + } + + public function includes($elt) + { + return isset($this->_elts[$elt]); + } + + public function add($elt) + { + $this->_elts[$elt] = true; + } + + public function discard($elt) + { + unset($this->_elts[$elt]); + } + + public function toArray() + { + return \array_keys($this->_elts); + } + + #[\ReturnTypeWillChange] + public function getIterator() + { + return new ArrayIterator($this->toArray()); + } +} diff --git a/app/api/Stripe/Util/Util.php b/app/api/Stripe/Util/Util.php new file mode 100755 index 0000000..602f466 --- /dev/null +++ b/app/api/Stripe/Util/Util.php @@ -0,0 +1,265 @@ +id; + } + if (static::isList($h)) { + $results = []; + foreach ($h as $v) { + $results[] = static::objectsToIds($v); + } + + return $results; + } + if (\is_array($h)) { + $results = []; + foreach ($h as $k => $v) { + if (null === $v) { + continue; + } + $results[$k] = static::objectsToIds($v); + } + + return $results; + } + + return $h; + } + + /** + * @param array $params + * + * @return string + */ + public static function encodeParameters($params) + { + $flattenedParams = self::flattenParams($params); + $pieces = []; + foreach ($flattenedParams as $param) { + list($k, $v) = $param; + $pieces[] = self::urlEncode($k) . '=' . self::urlEncode($v); + } + + return \implode('&', $pieces); + } + + /** + * @param array $params + * @param null|string $parentKey + * + * @return array + */ + public static function flattenParams($params, $parentKey = null) + { + $result = []; + + foreach ($params as $key => $value) { + $calculatedKey = $parentKey ? "{$parentKey}[{$key}]" : $key; + + if (self::isList($value)) { + $result = \array_merge($result, self::flattenParamsList($value, $calculatedKey)); + } elseif (\is_array($value)) { + $result = \array_merge($result, self::flattenParams($value, $calculatedKey)); + } else { + \array_push($result, [$calculatedKey, $value]); + } + } + + return $result; + } + + /** + * @param array $value + * @param string $calculatedKey + * + * @return array + */ + public static function flattenParamsList($value, $calculatedKey) + { + $result = []; + + foreach ($value as $i => $elem) { + if (self::isList($elem)) { + $result = \array_merge($result, self::flattenParamsList($elem, $calculatedKey)); + } elseif (\is_array($elem)) { + $result = \array_merge($result, self::flattenParams($elem, "{$calculatedKey}[{$i}]")); + } else { + \array_push($result, ["{$calculatedKey}[{$i}]", $elem]); + } + } + + return $result; + } + + /** + * @param string $key a string to URL-encode + * + * @return string the URL-encoded string + */ + public static function urlEncode($key) + { + $s = \urlencode((string) $key); + + // Don't use strict form encoding by changing the square bracket control + // characters back to their literals. This is fine by the server, and + // makes these parameter strings easier to read. + $s = \str_replace('%5B', '[', $s); + + return \str_replace('%5D', ']', $s); + } + + public static function normalizeId($id) + { + if (\is_array($id)) { + $params = $id; + $id = $params['id']; + unset($params['id']); + } else { + $params = []; + } + + return [$id, $params]; + } + + /** + * Returns UNIX timestamp in milliseconds. + * + * @return int current time in millis + */ + public static function currentTimeMillis() + { + return (int) \round(\microtime(true) * 1000); + } +} diff --git a/app/api/Stripe/Webhook.php b/app/api/Stripe/Webhook.php new file mode 100755 index 0000000..67d2799 --- /dev/null +++ b/app/api/Stripe/Webhook.php @@ -0,0 +1,42 @@ +webhook + * endpoints via the API to be notified about events that happen in your Stripe + * account or connected accounts. + * + * Most users configure webhooks from the dashboard, which provides a + * user interface for registering and testing your webhook endpoints. + * + * Related guide: Setting up + * Webhooks. + * + * @property string $id Unique identifier for the object. + * @property string $object String representing the object's type. Objects of the same type share the same value. + * @property null|string $api_version The API version events are rendered as for this webhook endpoint. + * @property null|string $application The ID of the associated Connect application. + * @property int $created Time at which the object was created. Measured in seconds since the Unix epoch. + * @property null|string $description An optional description of what the webhook is used for. + * @property string[] $enabled_events The list of events to enable for this endpoint. ['*'] indicates that all events are enabled, except those that require explicit selection. + * @property bool $livemode Has the value true if the object exists in live mode or the value false if the object exists in test mode. + * @property \Stripe\StripeObject $metadata Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. + * @property string $secret The endpoint's secret, used to generate webhook signatures. Only returned at creation. + * @property string $status The status of the webhook. It can be enabled or disabled. + * @property string $url The URL of the webhook endpoint. + */ +class WebhookEndpoint extends ApiResource +{ + const OBJECT_NAME = 'webhook_endpoint'; + + use ApiOperations\All; + use ApiOperations\Create; + use ApiOperations\Delete; + use ApiOperations\Retrieve; + use ApiOperations\Update; +} diff --git a/app/api/Stripe/WebhookSignature.php b/app/api/Stripe/WebhookSignature.php new file mode 100755 index 0000000..bfd1dde --- /dev/null +++ b/app/api/Stripe/WebhookSignature.php @@ -0,0 +1,140 @@ + 0) && (\abs(\time() - $timestamp) > $tolerance)) { + throw Exception\SignatureVerificationException::factory( + 'Timestamp outside the tolerance zone', + $payload, + $header + ); + } + + return true; + } + + /** + * Extracts the timestamp in a signature header. + * + * @param string $header the signature header + * + * @return int the timestamp contained in the header, or -1 if no valid + * timestamp is found + */ + private static function getTimestamp($header) + { + $items = \explode(',', $header); + + foreach ($items as $item) { + $itemParts = \explode('=', $item, 2); + if ('t' === $itemParts[0]) { + if (!\is_numeric($itemParts[1])) { + return -1; + } + + return (int) ($itemParts[1]); + } + } + + return -1; + } + + /** + * Extracts the signatures matching a given scheme in a signature header. + * + * @param string $header the signature header + * @param string $scheme the signature scheme to look for + * + * @return array the list of signatures matching the provided scheme + */ + private static function getSignatures($header, $scheme) + { + $signatures = []; + $items = \explode(',', $header); + + foreach ($items as $item) { + $itemParts = \explode('=', $item, 2); + if (\trim($itemParts[0]) === $scheme) { + $signatures[] = $itemParts[1]; + } + } + + return $signatures; + } + + /** + * Computes the signature for a given payload and secret. + * + * The current scheme used by Stripe ("v1") is HMAC/SHA-256. + * + * @param string $payload the payload to sign + * @param string $secret the secret used to generate the signature + * + * @return string the signature as a string + */ + private static function computeSignature($payload, $secret) + { + return \hash_hmac('sha256', $payload, $secret); + } +} diff --git a/app/api/Stripe/autoload.php b/app/api/Stripe/autoload.php new file mode 100755 index 0000000..79b7671 --- /dev/null +++ b/app/api/Stripe/autoload.php @@ -0,0 +1,22 @@ + diff --git a/app/api/TFPDF/font/courierb.php b/app/api/TFPDF/font/courierb.php new file mode 100755 index 0000000..3fc69a5 --- /dev/null +++ b/app/api/TFPDF/font/courierb.php @@ -0,0 +1,8 @@ + diff --git a/app/api/TFPDF/font/courierbi.php b/app/api/TFPDF/font/courierbi.php new file mode 100755 index 0000000..a49f2ae --- /dev/null +++ b/app/api/TFPDF/font/courierbi.php @@ -0,0 +1,8 @@ + diff --git a/app/api/TFPDF/font/courieri.php b/app/api/TFPDF/font/courieri.php new file mode 100755 index 0000000..9c1c2cf --- /dev/null +++ b/app/api/TFPDF/font/courieri.php @@ -0,0 +1,8 @@ + diff --git a/app/api/TFPDF/font/helvetica.php b/app/api/TFPDF/font/helvetica.php new file mode 100755 index 0000000..7e20c3a --- /dev/null +++ b/app/api/TFPDF/font/helvetica.php @@ -0,0 +1,19 @@ +278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278, + chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584, + ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667, + 'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944, + 'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833, + 'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>222,chr(131)=>556, + chr(132)=>333,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>222,chr(146)=>222,chr(147)=>333,chr(148)=>333,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, + chr(154)=>500,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>260,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333, + chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>556,chr(182)=>537,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667, + chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>500,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>556,chr(241)=>556, + chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>584,chr(248)=>611,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500); +?> diff --git a/app/api/TFPDF/font/helveticab.php b/app/api/TFPDF/font/helveticab.php new file mode 100755 index 0000000..452e0ac --- /dev/null +++ b/app/api/TFPDF/font/helveticab.php @@ -0,0 +1,19 @@ +278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278, + chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584, + ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722, + 'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944, + 'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889, + 'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>278,chr(131)=>556, + chr(132)=>500,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>278,chr(146)=>278,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, + chr(154)=>556,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>280,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333, + chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>611,chr(182)=>556,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722, + chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>611,chr(241)=>611, + chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>584,chr(248)=>611,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>611,chr(255)=>556); +?> diff --git a/app/api/TFPDF/font/helveticabi.php b/app/api/TFPDF/font/helveticabi.php new file mode 100755 index 0000000..ea5c56f --- /dev/null +++ b/app/api/TFPDF/font/helveticabi.php @@ -0,0 +1,19 @@ +278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278, + chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>333,'"'=>474,'#'=>556,'$'=>556,'%'=>889,'&'=>722,'\''=>238,'('=>333,')'=>333,'*'=>389,'+'=>584, + ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>333,';'=>333,'<'=>584,'='=>584,'>'=>584,'?'=>611,'@'=>975,'A'=>722, + 'B'=>722,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>556,'K'=>722,'L'=>611,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944, + 'X'=>667,'Y'=>667,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>584,'_'=>556,'`'=>333,'a'=>556,'b'=>611,'c'=>556,'d'=>611,'e'=>556,'f'=>333,'g'=>611,'h'=>611,'i'=>278,'j'=>278,'k'=>556,'l'=>278,'m'=>889, + 'n'=>611,'o'=>611,'p'=>611,'q'=>611,'r'=>389,'s'=>556,'t'=>333,'u'=>611,'v'=>556,'w'=>778,'x'=>556,'y'=>556,'z'=>500,'{'=>389,'|'=>280,'}'=>389,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>278,chr(131)=>556, + chr(132)=>500,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>278,chr(146)=>278,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, + chr(154)=>556,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>280,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333, + chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>611,chr(182)=>556,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722, + chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>556,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>611,chr(241)=>611, + chr(242)=>611,chr(243)=>611,chr(244)=>611,chr(245)=>611,chr(246)=>611,chr(247)=>584,chr(248)=>611,chr(249)=>611,chr(250)=>611,chr(251)=>611,chr(252)=>611,chr(253)=>556,chr(254)=>611,chr(255)=>556); +?> diff --git a/app/api/TFPDF/font/helveticai.php b/app/api/TFPDF/font/helveticai.php new file mode 100755 index 0000000..e3c638a --- /dev/null +++ b/app/api/TFPDF/font/helveticai.php @@ -0,0 +1,19 @@ +278,chr(1)=>278,chr(2)=>278,chr(3)=>278,chr(4)=>278,chr(5)=>278,chr(6)=>278,chr(7)=>278,chr(8)=>278,chr(9)=>278,chr(10)=>278,chr(11)=>278,chr(12)=>278,chr(13)=>278,chr(14)=>278,chr(15)=>278,chr(16)=>278,chr(17)=>278,chr(18)=>278,chr(19)=>278,chr(20)=>278,chr(21)=>278, + chr(22)=>278,chr(23)=>278,chr(24)=>278,chr(25)=>278,chr(26)=>278,chr(27)=>278,chr(28)=>278,chr(29)=>278,chr(30)=>278,chr(31)=>278,' '=>278,'!'=>278,'"'=>355,'#'=>556,'$'=>556,'%'=>889,'&'=>667,'\''=>191,'('=>333,')'=>333,'*'=>389,'+'=>584, + ','=>278,'-'=>333,'.'=>278,'/'=>278,'0'=>556,'1'=>556,'2'=>556,'3'=>556,'4'=>556,'5'=>556,'6'=>556,'7'=>556,'8'=>556,'9'=>556,':'=>278,';'=>278,'<'=>584,'='=>584,'>'=>584,'?'=>556,'@'=>1015,'A'=>667, + 'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>722,'I'=>278,'J'=>500,'K'=>667,'L'=>556,'M'=>833,'N'=>722,'O'=>778,'P'=>667,'Q'=>778,'R'=>722,'S'=>667,'T'=>611,'U'=>722,'V'=>667,'W'=>944, + 'X'=>667,'Y'=>667,'Z'=>611,'['=>278,'\\'=>278,']'=>278,'^'=>469,'_'=>556,'`'=>333,'a'=>556,'b'=>556,'c'=>500,'d'=>556,'e'=>556,'f'=>278,'g'=>556,'h'=>556,'i'=>222,'j'=>222,'k'=>500,'l'=>222,'m'=>833, + 'n'=>556,'o'=>556,'p'=>556,'q'=>556,'r'=>333,'s'=>500,'t'=>278,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>500,'{'=>334,'|'=>260,'}'=>334,'~'=>584,chr(127)=>350,chr(128)=>556,chr(129)=>350,chr(130)=>222,chr(131)=>556, + chr(132)=>333,chr(133)=>1000,chr(134)=>556,chr(135)=>556,chr(136)=>333,chr(137)=>1000,chr(138)=>667,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>222,chr(146)=>222,chr(147)=>333,chr(148)=>333,chr(149)=>350,chr(150)=>556,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, + chr(154)=>500,chr(155)=>333,chr(156)=>944,chr(157)=>350,chr(158)=>500,chr(159)=>667,chr(160)=>278,chr(161)=>333,chr(162)=>556,chr(163)=>556,chr(164)=>556,chr(165)=>556,chr(166)=>260,chr(167)=>556,chr(168)=>333,chr(169)=>737,chr(170)=>370,chr(171)=>556,chr(172)=>584,chr(173)=>333,chr(174)=>737,chr(175)=>333, + chr(176)=>400,chr(177)=>584,chr(178)=>333,chr(179)=>333,chr(180)=>333,chr(181)=>556,chr(182)=>537,chr(183)=>278,chr(184)=>333,chr(185)=>333,chr(186)=>365,chr(187)=>556,chr(188)=>834,chr(189)=>834,chr(190)=>834,chr(191)=>611,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667, + chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>278,chr(205)=>278,chr(206)=>278,chr(207)=>278,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>584,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>667,chr(222)=>667,chr(223)=>611,chr(224)=>556,chr(225)=>556,chr(226)=>556,chr(227)=>556,chr(228)=>556,chr(229)=>556,chr(230)=>889,chr(231)=>500,chr(232)=>556,chr(233)=>556,chr(234)=>556,chr(235)=>556,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>556,chr(241)=>556, + chr(242)=>556,chr(243)=>556,chr(244)=>556,chr(245)=>556,chr(246)=>556,chr(247)=>584,chr(248)=>611,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500); +?> diff --git a/app/api/TFPDF/font/symbol.php b/app/api/TFPDF/font/symbol.php new file mode 100755 index 0000000..b980b07 --- /dev/null +++ b/app/api/TFPDF/font/symbol.php @@ -0,0 +1,19 @@ +250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250, + chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>713,'#'=>500,'$'=>549,'%'=>833,'&'=>778,'\''=>439,'('=>333,')'=>333,'*'=>500,'+'=>549, + ','=>250,'-'=>549,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>278,';'=>278,'<'=>549,'='=>549,'>'=>549,'?'=>444,'@'=>549,'A'=>722, + 'B'=>667,'C'=>722,'D'=>612,'E'=>611,'F'=>763,'G'=>603,'H'=>722,'I'=>333,'J'=>631,'K'=>722,'L'=>686,'M'=>889,'N'=>722,'O'=>722,'P'=>768,'Q'=>741,'R'=>556,'S'=>592,'T'=>611,'U'=>690,'V'=>439,'W'=>768, + 'X'=>645,'Y'=>795,'Z'=>611,'['=>333,'\\'=>863,']'=>333,'^'=>658,'_'=>500,'`'=>500,'a'=>631,'b'=>549,'c'=>549,'d'=>494,'e'=>439,'f'=>521,'g'=>411,'h'=>603,'i'=>329,'j'=>603,'k'=>549,'l'=>549,'m'=>576, + 'n'=>521,'o'=>549,'p'=>549,'q'=>521,'r'=>549,'s'=>603,'t'=>439,'u'=>576,'v'=>713,'w'=>686,'x'=>493,'y'=>686,'z'=>494,'{'=>480,'|'=>200,'}'=>480,'~'=>549,chr(127)=>0,chr(128)=>0,chr(129)=>0,chr(130)=>0,chr(131)=>0, + chr(132)=>0,chr(133)=>0,chr(134)=>0,chr(135)=>0,chr(136)=>0,chr(137)=>0,chr(138)=>0,chr(139)=>0,chr(140)=>0,chr(141)=>0,chr(142)=>0,chr(143)=>0,chr(144)=>0,chr(145)=>0,chr(146)=>0,chr(147)=>0,chr(148)=>0,chr(149)=>0,chr(150)=>0,chr(151)=>0,chr(152)=>0,chr(153)=>0, + chr(154)=>0,chr(155)=>0,chr(156)=>0,chr(157)=>0,chr(158)=>0,chr(159)=>0,chr(160)=>750,chr(161)=>620,chr(162)=>247,chr(163)=>549,chr(164)=>167,chr(165)=>713,chr(166)=>500,chr(167)=>753,chr(168)=>753,chr(169)=>753,chr(170)=>753,chr(171)=>1042,chr(172)=>987,chr(173)=>603,chr(174)=>987,chr(175)=>603, + chr(176)=>400,chr(177)=>549,chr(178)=>411,chr(179)=>549,chr(180)=>549,chr(181)=>713,chr(182)=>494,chr(183)=>460,chr(184)=>549,chr(185)=>549,chr(186)=>549,chr(187)=>549,chr(188)=>1000,chr(189)=>603,chr(190)=>1000,chr(191)=>658,chr(192)=>823,chr(193)=>686,chr(194)=>795,chr(195)=>987,chr(196)=>768,chr(197)=>768, + chr(198)=>823,chr(199)=>768,chr(200)=>768,chr(201)=>713,chr(202)=>713,chr(203)=>713,chr(204)=>713,chr(205)=>713,chr(206)=>713,chr(207)=>713,chr(208)=>768,chr(209)=>713,chr(210)=>790,chr(211)=>790,chr(212)=>890,chr(213)=>823,chr(214)=>549,chr(215)=>250,chr(216)=>713,chr(217)=>603,chr(218)=>603,chr(219)=>1042, + chr(220)=>987,chr(221)=>603,chr(222)=>987,chr(223)=>603,chr(224)=>494,chr(225)=>329,chr(226)=>790,chr(227)=>790,chr(228)=>786,chr(229)=>713,chr(230)=>384,chr(231)=>384,chr(232)=>384,chr(233)=>384,chr(234)=>384,chr(235)=>384,chr(236)=>494,chr(237)=>494,chr(238)=>494,chr(239)=>494,chr(240)=>0,chr(241)=>329, + chr(242)=>274,chr(243)=>686,chr(244)=>686,chr(245)=>686,chr(246)=>384,chr(247)=>384,chr(248)=>384,chr(249)=>384,chr(250)=>384,chr(251)=>384,chr(252)=>494,chr(253)=>494,chr(254)=>494,chr(255)=>0); +?> diff --git a/app/api/TFPDF/font/times.php b/app/api/TFPDF/font/times.php new file mode 100755 index 0000000..d3ea808 --- /dev/null +++ b/app/api/TFPDF/font/times.php @@ -0,0 +1,19 @@ +250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250, + chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>408,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>180,'('=>333,')'=>333,'*'=>500,'+'=>564, + ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>278,';'=>278,'<'=>564,'='=>564,'>'=>564,'?'=>444,'@'=>921,'A'=>722, + 'B'=>667,'C'=>667,'D'=>722,'E'=>611,'F'=>556,'G'=>722,'H'=>722,'I'=>333,'J'=>389,'K'=>722,'L'=>611,'M'=>889,'N'=>722,'O'=>722,'P'=>556,'Q'=>722,'R'=>667,'S'=>556,'T'=>611,'U'=>722,'V'=>722,'W'=>944, + 'X'=>722,'Y'=>722,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>469,'_'=>500,'`'=>333,'a'=>444,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>333,'g'=>500,'h'=>500,'i'=>278,'j'=>278,'k'=>500,'l'=>278,'m'=>778, + 'n'=>500,'o'=>500,'p'=>500,'q'=>500,'r'=>333,'s'=>389,'t'=>278,'u'=>500,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>444,'{'=>480,'|'=>200,'}'=>480,'~'=>541,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500, + chr(132)=>444,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>889,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>444,chr(148)=>444,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>980, + chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>444,chr(159)=>722,chr(160)=>250,chr(161)=>333,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>200,chr(167)=>500,chr(168)=>333,chr(169)=>760,chr(170)=>276,chr(171)=>500,chr(172)=>564,chr(173)=>333,chr(174)=>760,chr(175)=>333, + chr(176)=>400,chr(177)=>564,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>500,chr(182)=>453,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>310,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>444,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722, + chr(198)=>889,chr(199)=>667,chr(200)=>611,chr(201)=>611,chr(202)=>611,chr(203)=>611,chr(204)=>333,chr(205)=>333,chr(206)=>333,chr(207)=>333,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>564,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>722,chr(222)=>556,chr(223)=>500,chr(224)=>444,chr(225)=>444,chr(226)=>444,chr(227)=>444,chr(228)=>444,chr(229)=>444,chr(230)=>667,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>500, + chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>564,chr(248)=>500,chr(249)=>500,chr(250)=>500,chr(251)=>500,chr(252)=>500,chr(253)=>500,chr(254)=>500,chr(255)=>500); +?> diff --git a/app/api/TFPDF/font/timesb.php b/app/api/TFPDF/font/timesb.php new file mode 100755 index 0000000..1c198f0 --- /dev/null +++ b/app/api/TFPDF/font/timesb.php @@ -0,0 +1,19 @@ +250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250, + chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>555,'#'=>500,'$'=>500,'%'=>1000,'&'=>833,'\''=>278,'('=>333,')'=>333,'*'=>500,'+'=>570, + ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>570,'='=>570,'>'=>570,'?'=>500,'@'=>930,'A'=>722, + 'B'=>667,'C'=>722,'D'=>722,'E'=>667,'F'=>611,'G'=>778,'H'=>778,'I'=>389,'J'=>500,'K'=>778,'L'=>667,'M'=>944,'N'=>722,'O'=>778,'P'=>611,'Q'=>778,'R'=>722,'S'=>556,'T'=>667,'U'=>722,'V'=>722,'W'=>1000, + 'X'=>722,'Y'=>722,'Z'=>667,'['=>333,'\\'=>278,']'=>333,'^'=>581,'_'=>500,'`'=>333,'a'=>500,'b'=>556,'c'=>444,'d'=>556,'e'=>444,'f'=>333,'g'=>500,'h'=>556,'i'=>278,'j'=>333,'k'=>556,'l'=>278,'m'=>833, + 'n'=>556,'o'=>500,'p'=>556,'q'=>556,'r'=>444,'s'=>389,'t'=>333,'u'=>556,'v'=>500,'w'=>722,'x'=>500,'y'=>500,'z'=>444,'{'=>394,'|'=>220,'}'=>394,'~'=>520,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500, + chr(132)=>500,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>1000,chr(141)=>350,chr(142)=>667,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, + chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>444,chr(159)=>722,chr(160)=>250,chr(161)=>333,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>220,chr(167)=>500,chr(168)=>333,chr(169)=>747,chr(170)=>300,chr(171)=>500,chr(172)=>570,chr(173)=>333,chr(174)=>747,chr(175)=>333, + chr(176)=>400,chr(177)=>570,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>556,chr(182)=>540,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>330,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>722,chr(193)=>722,chr(194)=>722,chr(195)=>722,chr(196)=>722,chr(197)=>722, + chr(198)=>1000,chr(199)=>722,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>389,chr(205)=>389,chr(206)=>389,chr(207)=>389,chr(208)=>722,chr(209)=>722,chr(210)=>778,chr(211)=>778,chr(212)=>778,chr(213)=>778,chr(214)=>778,chr(215)=>570,chr(216)=>778,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>722,chr(222)=>611,chr(223)=>556,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>722,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>556, + chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>570,chr(248)=>500,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>500,chr(254)=>556,chr(255)=>500); +?> diff --git a/app/api/TFPDF/font/timesbi.php b/app/api/TFPDF/font/timesbi.php new file mode 100755 index 0000000..a6034b2 --- /dev/null +++ b/app/api/TFPDF/font/timesbi.php @@ -0,0 +1,19 @@ +250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250, + chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>389,'"'=>555,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>278,'('=>333,')'=>333,'*'=>500,'+'=>570, + ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>570,'='=>570,'>'=>570,'?'=>500,'@'=>832,'A'=>667, + 'B'=>667,'C'=>667,'D'=>722,'E'=>667,'F'=>667,'G'=>722,'H'=>778,'I'=>389,'J'=>500,'K'=>667,'L'=>611,'M'=>889,'N'=>722,'O'=>722,'P'=>611,'Q'=>722,'R'=>667,'S'=>556,'T'=>611,'U'=>722,'V'=>667,'W'=>889, + 'X'=>667,'Y'=>611,'Z'=>611,'['=>333,'\\'=>278,']'=>333,'^'=>570,'_'=>500,'`'=>333,'a'=>500,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>333,'g'=>500,'h'=>556,'i'=>278,'j'=>278,'k'=>500,'l'=>278,'m'=>778, + 'n'=>556,'o'=>500,'p'=>500,'q'=>500,'r'=>389,'s'=>389,'t'=>278,'u'=>556,'v'=>444,'w'=>667,'x'=>500,'y'=>444,'z'=>389,'{'=>348,'|'=>220,'}'=>348,'~'=>570,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500, + chr(132)=>500,chr(133)=>1000,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>556,chr(139)=>333,chr(140)=>944,chr(141)=>350,chr(142)=>611,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>500,chr(148)=>500,chr(149)=>350,chr(150)=>500,chr(151)=>1000,chr(152)=>333,chr(153)=>1000, + chr(154)=>389,chr(155)=>333,chr(156)=>722,chr(157)=>350,chr(158)=>389,chr(159)=>611,chr(160)=>250,chr(161)=>389,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>220,chr(167)=>500,chr(168)=>333,chr(169)=>747,chr(170)=>266,chr(171)=>500,chr(172)=>606,chr(173)=>333,chr(174)=>747,chr(175)=>333, + chr(176)=>400,chr(177)=>570,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>576,chr(182)=>500,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>300,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>667,chr(193)=>667,chr(194)=>667,chr(195)=>667,chr(196)=>667,chr(197)=>667, + chr(198)=>944,chr(199)=>667,chr(200)=>667,chr(201)=>667,chr(202)=>667,chr(203)=>667,chr(204)=>389,chr(205)=>389,chr(206)=>389,chr(207)=>389,chr(208)=>722,chr(209)=>722,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>570,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>611,chr(222)=>611,chr(223)=>500,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>722,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>556, + chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>570,chr(248)=>500,chr(249)=>556,chr(250)=>556,chr(251)=>556,chr(252)=>556,chr(253)=>444,chr(254)=>500,chr(255)=>444); +?> diff --git a/app/api/TFPDF/font/timesi.php b/app/api/TFPDF/font/timesi.php new file mode 100755 index 0000000..bd9e0d9 --- /dev/null +++ b/app/api/TFPDF/font/timesi.php @@ -0,0 +1,19 @@ +250,chr(1)=>250,chr(2)=>250,chr(3)=>250,chr(4)=>250,chr(5)=>250,chr(6)=>250,chr(7)=>250,chr(8)=>250,chr(9)=>250,chr(10)=>250,chr(11)=>250,chr(12)=>250,chr(13)=>250,chr(14)=>250,chr(15)=>250,chr(16)=>250,chr(17)=>250,chr(18)=>250,chr(19)=>250,chr(20)=>250,chr(21)=>250, + chr(22)=>250,chr(23)=>250,chr(24)=>250,chr(25)=>250,chr(26)=>250,chr(27)=>250,chr(28)=>250,chr(29)=>250,chr(30)=>250,chr(31)=>250,' '=>250,'!'=>333,'"'=>420,'#'=>500,'$'=>500,'%'=>833,'&'=>778,'\''=>214,'('=>333,')'=>333,'*'=>500,'+'=>675, + ','=>250,'-'=>333,'.'=>250,'/'=>278,'0'=>500,'1'=>500,'2'=>500,'3'=>500,'4'=>500,'5'=>500,'6'=>500,'7'=>500,'8'=>500,'9'=>500,':'=>333,';'=>333,'<'=>675,'='=>675,'>'=>675,'?'=>500,'@'=>920,'A'=>611, + 'B'=>611,'C'=>667,'D'=>722,'E'=>611,'F'=>611,'G'=>722,'H'=>722,'I'=>333,'J'=>444,'K'=>667,'L'=>556,'M'=>833,'N'=>667,'O'=>722,'P'=>611,'Q'=>722,'R'=>611,'S'=>500,'T'=>556,'U'=>722,'V'=>611,'W'=>833, + 'X'=>611,'Y'=>556,'Z'=>556,'['=>389,'\\'=>278,']'=>389,'^'=>422,'_'=>500,'`'=>333,'a'=>500,'b'=>500,'c'=>444,'d'=>500,'e'=>444,'f'=>278,'g'=>500,'h'=>500,'i'=>278,'j'=>278,'k'=>444,'l'=>278,'m'=>722, + 'n'=>500,'o'=>500,'p'=>500,'q'=>500,'r'=>389,'s'=>389,'t'=>278,'u'=>500,'v'=>444,'w'=>667,'x'=>444,'y'=>444,'z'=>389,'{'=>400,'|'=>275,'}'=>400,'~'=>541,chr(127)=>350,chr(128)=>500,chr(129)=>350,chr(130)=>333,chr(131)=>500, + chr(132)=>556,chr(133)=>889,chr(134)=>500,chr(135)=>500,chr(136)=>333,chr(137)=>1000,chr(138)=>500,chr(139)=>333,chr(140)=>944,chr(141)=>350,chr(142)=>556,chr(143)=>350,chr(144)=>350,chr(145)=>333,chr(146)=>333,chr(147)=>556,chr(148)=>556,chr(149)=>350,chr(150)=>500,chr(151)=>889,chr(152)=>333,chr(153)=>980, + chr(154)=>389,chr(155)=>333,chr(156)=>667,chr(157)=>350,chr(158)=>389,chr(159)=>556,chr(160)=>250,chr(161)=>389,chr(162)=>500,chr(163)=>500,chr(164)=>500,chr(165)=>500,chr(166)=>275,chr(167)=>500,chr(168)=>333,chr(169)=>760,chr(170)=>276,chr(171)=>500,chr(172)=>675,chr(173)=>333,chr(174)=>760,chr(175)=>333, + chr(176)=>400,chr(177)=>675,chr(178)=>300,chr(179)=>300,chr(180)=>333,chr(181)=>500,chr(182)=>523,chr(183)=>250,chr(184)=>333,chr(185)=>300,chr(186)=>310,chr(187)=>500,chr(188)=>750,chr(189)=>750,chr(190)=>750,chr(191)=>500,chr(192)=>611,chr(193)=>611,chr(194)=>611,chr(195)=>611,chr(196)=>611,chr(197)=>611, + chr(198)=>889,chr(199)=>667,chr(200)=>611,chr(201)=>611,chr(202)=>611,chr(203)=>611,chr(204)=>333,chr(205)=>333,chr(206)=>333,chr(207)=>333,chr(208)=>722,chr(209)=>667,chr(210)=>722,chr(211)=>722,chr(212)=>722,chr(213)=>722,chr(214)=>722,chr(215)=>675,chr(216)=>722,chr(217)=>722,chr(218)=>722,chr(219)=>722, + chr(220)=>722,chr(221)=>556,chr(222)=>611,chr(223)=>500,chr(224)=>500,chr(225)=>500,chr(226)=>500,chr(227)=>500,chr(228)=>500,chr(229)=>500,chr(230)=>667,chr(231)=>444,chr(232)=>444,chr(233)=>444,chr(234)=>444,chr(235)=>444,chr(236)=>278,chr(237)=>278,chr(238)=>278,chr(239)=>278,chr(240)=>500,chr(241)=>500, + chr(242)=>500,chr(243)=>500,chr(244)=>500,chr(245)=>500,chr(246)=>500,chr(247)=>675,chr(248)=>500,chr(249)=>500,chr(250)=>500,chr(251)=>500,chr(252)=>500,chr(253)=>444,chr(254)=>500,chr(255)=>444); +?> diff --git a/app/api/TFPDF/font/unifont/DejaVuSans.ttf b/app/api/TFPDF/font/unifont/DejaVuSans.ttf new file mode 100755 index 0000000..27cff47 Binary files /dev/null and b/app/api/TFPDF/font/unifont/DejaVuSans.ttf differ diff --git a/app/api/TFPDF/font/unifont/DejaVuSansCondensed-Bold.ttf b/app/api/TFPDF/font/unifont/DejaVuSansCondensed-Bold.ttf new file mode 100755 index 0000000..9edd89c Binary files /dev/null and b/app/api/TFPDF/font/unifont/DejaVuSansCondensed-Bold.ttf differ diff --git a/app/api/TFPDF/font/unifont/DejaVuSansCondensed.ttf b/app/api/TFPDF/font/unifont/DejaVuSansCondensed.ttf new file mode 100755 index 0000000..826e619 Binary files /dev/null and b/app/api/TFPDF/font/unifont/DejaVuSansCondensed.ttf differ diff --git a/app/api/TFPDF/font/unifont/ttfonts.php b/app/api/TFPDF/font/unifont/ttfonts.php new file mode 100755 index 0000000..a7fe6c5 --- /dev/null +++ b/app/api/TFPDF/font/unifont/ttfonts.php @@ -0,0 +1,1083 @@ + +* License: LGPL +* Copyright (c) Ian Back, 2010 +* This header must be retained in any redistribution or +* modification of the file. +* +*/ + +// Define the value used in the "head" table of a created TTF file +// 0x74727565 "true" for Mac +// 0x00010000 for Windows +// Either seems to work for a font embedded in a PDF file +// when read by Adobe Reader on a Windows PC(!) +define("_TTF_MAC_HEADER", false); + + +// TrueType Font Glyph operators +define("GF_WORDS",(1 << 0)); +define("GF_SCALE",(1 << 3)); +define("GF_MORE",(1 << 5)); +define("GF_XYSCALE",(1 << 6)); +define("GF_TWOBYTWO",(1 << 7)); + + + +class TTFontFile { + + var $maxUni; + var $_pos; + var $numTables; + var $searchRange; + var $entrySelector; + var $rangeShift; + var $tables; + var $otables; + var $filename; + var $fh; + var $hmetrics; + var $glyphPos; + var $charToGlyph; + var $ascent; + var $descent; + var $name; + var $familyName; + var $styleName; + var $fullName; + var $uniqueFontID; + var $unitsPerEm; + var $bbox; + var $capHeight; + var $stemV; + var $italicAngle; + var $flags; + var $underlinePosition; + var $underlineThickness; + var $charWidths; + var $defaultWidth; + var $maxStrLenRead; + + function __construct() { + $this->maxStrLenRead = 200000; // Maximum size of glyf table to read in as string (otherwise reads each glyph from file) + } + + + function getMetrics($file) { + $this->filename = $file; + $this->fh = fopen($file,'rb') or die('Can\'t open file ' . $file); + $this->_pos = 0; + $this->charWidths = ''; + $this->glyphPos = []; + $this->charToGlyph = []; + $this->tables = []; + $this->otables = []; + $this->ascent = 0; + $this->descent = 0; + $this->TTCFonts = []; + $this->version = $version = $this->read_ulong(); + if ($version==0x4F54544F) + die("Postscript outlines are not supported"); + if ($version==0x74746366) + die("ERROR - TrueType Fonts Collections not supported"); + if (!in_array($version, array(0x00010000,0x74727565))) + die("Not a TrueType font: version=".$version); + $this->readTableDirectory(); + $this->extractInfo(); + fclose($this->fh); + } + + + function readTableDirectory() { + $this->numTables = $this->read_ushort(); + $this->searchRange = $this->read_ushort(); + $this->entrySelector = $this->read_ushort(); + $this->rangeShift = $this->read_ushort(); + $this->tables = []; + for ($i=0;$i<$this->numTables;$i++) { + $record = []; + $record['tag'] = $this->read_tag(); + $record['checksum'] = array($this->read_ushort(),$this->read_ushort()); + $record['offset'] = $this->read_ulong(); + $record['length'] = $this->read_ulong(); + $this->tables[$record['tag']] = $record; + } + } + + + function sub32($x, $y) { + $xlo = $x[1]; + $xhi = $x[0]; + $ylo = $y[1]; + $yhi = $y[0]; + if ($ylo > $xlo) { $xlo += 1 << 16; $yhi += 1; } + $reslo = $xlo-$ylo; + if ($yhi > $xhi) { $xhi += 1 << 16; } + $reshi = $xhi-$yhi; + $reshi = $reshi & 0xFFFF; + return array($reshi, $reslo); + } + + function calcChecksum($data) { + if (strlen($data) % 4) { $data .= str_repeat("\0",(4-(strlen($data) % 4))); } + $hi=0x0000; + $lo=0x0000; + for($i=0;$i> 16; + $lo = $lo & 0xFFFF; + $hi = $hi & 0xFFFF; + } + return array($hi, $lo); + } + + function get_table_pos($tag) { + $offset = $this->tables[$tag]['offset']; + $length = $this->tables[$tag]['length']; + return array($offset, $length); + } + + function seek($pos) { + $this->_pos = $pos; + fseek($this->fh,$this->_pos); + } + + function skip($delta) { + $this->_pos = $this->_pos + $delta; + fseek($this->fh,$this->_pos); + } + + function seek_table($tag, $offset_in_table = 0) { + $tpos = $this->get_table_pos($tag); + $this->_pos = $tpos[0] + $offset_in_table; + fseek($this->fh, $this->_pos); + return $this->_pos; + } + + function read_tag() { + $this->_pos += 4; + return fread($this->fh,4); + } + + function read_short() { + $this->_pos += 2; + $s = fread($this->fh,2); + $a = (ord($s[0])<<8) + ord($s[1]); + if ($a & (1 << 15) ) { $a = ($a - (1 << 16)) ; } + return $a; + } + + function unpack_short($s) { + $a = (ord($s[0])<<8) + ord($s[1]); + if ($a & (1 << 15) ) { + $a = ($a - (1 << 16)); + } + return $a; + } + + function read_ushort() { + $this->_pos += 2; + $s = fread($this->fh,2); + return (ord($s[0])<<8) + ord($s[1]); + } + + function read_ulong() { + $this->_pos += 4; + $s = fread($this->fh,4); + // if large uInt32 as an integer, PHP converts it to -ve + return (ord($s[0])*16777216) + (ord($s[1])<<16) + (ord($s[2])<<8) + ord($s[3]); // 16777216 = 1<<24 + } + + function get_ushort($pos) { + fseek($this->fh,$pos); + $s = fread($this->fh,2); + return (ord($s[0])<<8) + ord($s[1]); + } + + function get_ulong($pos) { + fseek($this->fh,$pos); + $s = fread($this->fh,4); + // iF large uInt32 as an integer, PHP converts it to -ve + return (ord($s[0])*16777216) + (ord($s[1])<<16) + (ord($s[2])<<8) + ord($s[3]); // 16777216 = 1<<24 + } + + function pack_short($val) { + if ($val<0) { + $val = abs($val); + $val = ~$val; + $val += 1; + } + return pack("n",$val); + } + + function splice($stream, $offset, $value) { + return substr($stream,0,$offset) . $value . substr($stream,$offset+strlen($value)); + } + + function _set_ushort($stream, $offset, $value) { + $up = pack("n", $value); + return $this->splice($stream, $offset, $up); + } + + function _set_short($stream, $offset, $val) { + if ($val<0) { + $val = abs($val); + $val = ~$val; + $val += 1; + } + $up = pack("n",$val); + return $this->splice($stream, $offset, $up); + } + + function get_chunk($pos, $length) { + fseek($this->fh,$pos); + if ($length <1) { return ''; } + return (fread($this->fh,$length)); + } + + function get_table($tag) { + list($pos, $length) = $this->get_table_pos($tag); + if ($length == 0) { die('Truetype font ('.$this->filename.'): error reading table: '.$tag); } + fseek($this->fh,$pos); + return (fread($this->fh,$length)); + } + + function add($tag, $data) { + if ($tag == 'head') { + $data = $this->splice($data, 8, "\0\0\0\0"); + } + $this->otables[$tag] = $data; + } + + + +///////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////////////////// + +///////////////////////////////////////////////////////////////////////////////////////// + + function extractInfo() { + /////////////////////////////////// + // name - Naming table + /////////////////////////////////// + $this->sFamilyClass = 0; + $this->sFamilySubClass = 0; + + $name_offset = $this->seek_table("name"); + $format = $this->read_ushort(); + if ($format != 0) + die("Unknown name table format ".$format); + $numRecords = $this->read_ushort(); + $string_data_offset = $name_offset + $this->read_ushort(); + $names = array(1=>'',2=>'',3=>'',4=>'',6=>''); + $K = array_keys($names); + $nameCount = count($names); + for ($i=0;$i<$numRecords; $i++) { + $platformId = $this->read_ushort(); + $encodingId = $this->read_ushort(); + $languageId = $this->read_ushort(); + $nameId = $this->read_ushort(); + $length = $this->read_ushort(); + $offset = $this->read_ushort(); + if (!in_array($nameId,$K)) continue; + $N = ''; + if ($platformId == 3 && $encodingId == 1 && $languageId == 0x409) { // Microsoft, Unicode, US English, PS Name + $opos = $this->_pos; + $this->seek($string_data_offset + $offset); + if ($length % 2 != 0) + die("PostScript name is UTF-16BE string of odd length"); + $length /= 2; + $N = ''; + while ($length > 0) { + $char = $this->read_ushort(); + $N .= (chr($char)); + $length -= 1; + } + $this->_pos = $opos; + $this->seek($opos); + } + else if ($platformId == 1 && $encodingId == 0 && $languageId == 0) { // Macintosh, Roman, English, PS Name + $opos = $this->_pos; + $N = $this->get_chunk($string_data_offset + $offset, $length); + $this->_pos = $opos; + $this->seek($opos); + } + if ($N && $names[$nameId]=='') { + $names[$nameId] = $N; + $nameCount -= 1; + if ($nameCount==0) break; + } + } + if ($names[6]) + $psName = $names[6]; + else if ($names[4]) + $psName = preg_replace('/ /','-',$names[4]); + else if ($names[1]) + $psName = preg_replace('/ /','-',$names[1]); + else + $psName = ''; + if (!$psName) + die("Could not find PostScript font name"); + $this->name = $psName; + if ($names[1]) { $this->familyName = $names[1]; } else { $this->familyName = $psName; } + if ($names[2]) { $this->styleName = $names[2]; } else { $this->styleName = 'Regular'; } + if ($names[4]) { $this->fullName = $names[4]; } else { $this->fullName = $psName; } + if ($names[3]) { $this->uniqueFontID = $names[3]; } else { $this->uniqueFontID = $psName; } + if ($names[6]) { $this->fullName = $names[6]; } + + /////////////////////////////////// + // head - Font header table + /////////////////////////////////// + $this->seek_table("head"); + $this->skip(18); + $this->unitsPerEm = $unitsPerEm = $this->read_ushort(); + $scale = 1000 / $unitsPerEm; + $this->skip(16); + $xMin = $this->read_short(); + $yMin = $this->read_short(); + $xMax = $this->read_short(); + $yMax = $this->read_short(); + $this->bbox = array(($xMin*$scale), ($yMin*$scale), ($xMax*$scale), ($yMax*$scale)); + $this->skip(3*2); + $indexToLocFormat = $this->read_ushort(); + $glyphDataFormat = $this->read_ushort(); + if ($glyphDataFormat != 0) + die('Unknown glyph data format '.$glyphDataFormat); + + /////////////////////////////////// + // hhea metrics table + /////////////////////////////////// + // ttf2t1 seems to use this value rather than the one in OS/2 - so put in for compatibility + if (isset($this->tables["hhea"])) { + $this->seek_table("hhea"); + $this->skip(4); + $hheaAscender = $this->read_short(); + $hheaDescender = $this->read_short(); + $this->ascent = ($hheaAscender *$scale); + $this->descent = ($hheaDescender *$scale); + } + + /////////////////////////////////// + // OS/2 - OS/2 and Windows metrics table + /////////////////////////////////// + if (isset($this->tables["OS/2"])) { + $this->seek_table("OS/2"); + $version = $this->read_ushort(); + $this->skip(2); + $usWeightClass = $this->read_ushort(); + $this->skip(2); + $fsType = $this->read_ushort(); + if ($fsType == 0x0002 || ($fsType & 0x0300) != 0) { + die('ERROR - Font file '.$this->filename.' cannot be embedded due to copyright restrictions.'); + $this->restrictedUse = true; + } + $this->skip(20); + $sF = $this->read_short(); + $this->sFamilyClass = ($sF >> 8); + $this->sFamilySubClass = ($sF & 0xFF); + $this->_pos += 10; //PANOSE = 10 byte length + $panose = fread($this->fh,10); + $this->skip(26); + $sTypoAscender = $this->read_short(); + $sTypoDescender = $this->read_short(); + if (!$this->ascent) $this->ascent = ($sTypoAscender*$scale); + if (!$this->descent) $this->descent = ($sTypoDescender*$scale); + if ($version > 1) { + $this->skip(16); + $sCapHeight = $this->read_short(); + $this->capHeight = ($sCapHeight*$scale); + } + else { + $this->capHeight = $this->ascent; + } + } + else { + $usWeightClass = 500; + if (!$this->ascent) $this->ascent = ($yMax*$scale); + if (!$this->descent) $this->descent = ($yMin*$scale); + $this->capHeight = $this->ascent; + } + $this->stemV = 50 + intval(pow(($usWeightClass / 65.0),2)); + + /////////////////////////////////// + // post - PostScript table + /////////////////////////////////// + $this->seek_table("post"); + $this->skip(4); + $this->italicAngle = $this->read_short() + $this->read_ushort() / 65536.0; + $this->underlinePosition = $this->read_short() * $scale; + $this->underlineThickness = $this->read_short() * $scale; + $isFixedPitch = $this->read_ulong(); + + $this->flags = 4; + + if ($this->italicAngle!= 0) + $this->flags = $this->flags | 64; + if ($usWeightClass >= 600) + $this->flags = $this->flags | 262144; + if ($isFixedPitch) + $this->flags = $this->flags | 1; + + /////////////////////////////////// + // hhea - Horizontal header table + /////////////////////////////////// + $this->seek_table("hhea"); + $this->skip(32); + $metricDataFormat = $this->read_ushort(); + if ($metricDataFormat != 0) + die('Unknown horizontal metric data format '.$metricDataFormat); + $numberOfHMetrics = $this->read_ushort(); + if ($numberOfHMetrics == 0) + die('Number of horizontal metrics is 0'); + + /////////////////////////////////// + // maxp - Maximum profile table + /////////////////////////////////// + $this->seek_table("maxp"); + $this->skip(4); + $numGlyphs = $this->read_ushort(); + + + /////////////////////////////////// + // cmap - Character to glyph index mapping table + /////////////////////////////////// + $cmap_offset = $this->seek_table("cmap"); + $this->skip(2); + $cmapTableCount = $this->read_ushort(); + $unicode_cmap_offset = 0; + for ($i=0;$i<$cmapTableCount;$i++) { + $platformID = $this->read_ushort(); + $encodingID = $this->read_ushort(); + $offset = $this->read_ulong(); + $save_pos = $this->_pos; + if (($platformID == 3 && $encodingID == 1) || $platformID == 0) { // Microsoft, Unicode + $format = $this->get_ushort($cmap_offset + $offset); + if ($format == 4) { + if (!$unicode_cmap_offset) $unicode_cmap_offset = $cmap_offset + $offset; + break; + } + } + $this->seek($save_pos ); + } + if (!$unicode_cmap_offset) + die('Font ('.$this->filename .') does not have cmap for Unicode (platform 3, encoding 1, format 4, or platform 0, any encoding, format 4)'); + + + $glyphToChar = []; + $charToGlyph = []; + $this->getCMAP4($unicode_cmap_offset, $glyphToChar, $charToGlyph ); + + /////////////////////////////////// + // hmtx - Horizontal metrics table + /////////////////////////////////// + $this->getHMTX($numberOfHMetrics, $numGlyphs, $glyphToChar, $scale); + + } + + +///////////////////////////////////////////////////////////////////////////////////////// +///////////////////////////////////////////////////////////////////////////////////////// + + + function makeSubset($file, &$subset) { + $this->filename = $file; + $this->fh = fopen($file ,'rb') or die('Can\'t open file ' . $file); + $this->_pos = 0; + $this->charWidths = ''; + $this->glyphPos = []; + $this->charToGlyph = []; + $this->tables = []; + $this->otables = []; + $this->ascent = 0; + $this->descent = 0; + $this->skip(4); + $this->maxUni = 0; + $this->readTableDirectory(); + + + /////////////////////////////////// + // head - Font header table + /////////////////////////////////// + $this->seek_table("head"); + $this->skip(50); + $indexToLocFormat = $this->read_ushort(); + $glyphDataFormat = $this->read_ushort(); + + /////////////////////////////////// + // hhea - Horizontal header table + /////////////////////////////////// + $this->seek_table("hhea"); + $this->skip(32); + $metricDataFormat = $this->read_ushort(); + $orignHmetrics = $numberOfHMetrics = $this->read_ushort(); + + /////////////////////////////////// + // maxp - Maximum profile table + /////////////////////////////////// + $this->seek_table("maxp"); + $this->skip(4); + $numGlyphs = $this->read_ushort(); + + + /////////////////////////////////// + // cmap - Character to glyph index mapping table + /////////////////////////////////// + $cmap_offset = $this->seek_table("cmap"); + $this->skip(2); + $cmapTableCount = $this->read_ushort(); + $unicode_cmap_offset = 0; + for ($i=0;$i<$cmapTableCount;$i++) { + $platformID = $this->read_ushort(); + $encodingID = $this->read_ushort(); + $offset = $this->read_ulong(); + $save_pos = $this->_pos; + if (($platformID == 3 && $encodingID == 1) || $platformID == 0) { // Microsoft, Unicode + $format = $this->get_ushort($cmap_offset + $offset); + if ($format == 4) { + $unicode_cmap_offset = $cmap_offset + $offset; + break; + } + } + $this->seek($save_pos ); + } + + if (!$unicode_cmap_offset) + die('Font ('.$this->filename .') does not have cmap for Unicode (platform 3, encoding 1, format 4, or platform 0, any encoding, format 4)'); + + + $glyphToChar = []; + $charToGlyph = []; + $this->getCMAP4($unicode_cmap_offset, $glyphToChar, $charToGlyph ); + + $this->charToGlyph = $charToGlyph; + + /////////////////////////////////// + // hmtx - Horizontal metrics table + /////////////////////////////////// + $scale = 1; // not used + $this->getHMTX($numberOfHMetrics, $numGlyphs, $glyphToChar, $scale); + + /////////////////////////////////// + // loca - Index to location + /////////////////////////////////// + $this->getLOCA($indexToLocFormat, $numGlyphs); + + $subsetglyphs = array(0=>0); + $subsetCharToGlyph = []; + foreach($subset AS $code) { + if (isset($this->charToGlyph[$code])) { + $subsetglyphs[$this->charToGlyph[$code]] = $code; // Old Glyph ID => Unicode + $subsetCharToGlyph[$code] = $this->charToGlyph[$code]; // Unicode to old GlyphID + + } + $this->maxUni = max($this->maxUni, $code); + } + + list($start,$dummy) = $this->get_table_pos('glyf'); + + $glyphSet = []; + ksort($subsetglyphs); + $n = 0; + $fsLastCharIndex = 0; // maximum Unicode index (character code) in this font, according to the cmap subtable for platform ID 3 and platform- specific encoding ID 0 or 1. + foreach($subsetglyphs AS $originalGlyphIdx => $uni) { + $fsLastCharIndex = max($fsLastCharIndex, $uni); + $glyphSet[$originalGlyphIdx] = $n; // old glyphID to new glyphID + $n++; + } + + ksort($subsetCharToGlyph); + foreach($subsetCharToGlyph AS $uni => $originalGlyphIdx) { + $codeToGlyph[$uni] = $glyphSet[$originalGlyphIdx] ; + } + $this->codeToGlyph = $codeToGlyph; + + ksort($subsetglyphs); + foreach($subsetglyphs AS $originalGlyphIdx => $uni) { + $this->getGlyphs($originalGlyphIdx, $start, $glyphSet, $subsetglyphs); + } + + $numGlyphs = $numberOfHMetrics = count($subsetglyphs ); + + //tables copied from the original + $tags = array ('name'); + foreach($tags AS $tag) { $this->add($tag, $this->get_table($tag)); } + $tags = array ('cvt ', 'fpgm', 'prep', 'gasp'); + foreach($tags AS $tag) { + if (isset($this->tables[$tag])) { $this->add($tag, $this->get_table($tag)); } + } + + // post - PostScript + $opost = $this->get_table('post'); + $post = "\x00\x03\x00\x00" . substr($opost,4,12) . "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"; + $this->add('post', $post); + + // Sort CID2GID map into segments of contiguous codes + ksort($codeToGlyph); + unset($codeToGlyph[0]); + //unset($codeToGlyph[65535]); + $rangeid = 0; + $range = []; + $prevcid = -2; + $prevglidx = -1; + // for each character + foreach ($codeToGlyph as $cid => $glidx) { + if ($cid == ($prevcid + 1) && $glidx == ($prevglidx + 1)) { + $range[$rangeid][] = $glidx; + } else { + // new range + $rangeid = $cid; + $range[$rangeid] = []; + $range[$rangeid][] = $glidx; + } + $prevcid = $cid; + $prevglidx = $glidx; + } + + // cmap - Character to glyph mapping - Format 4 (MS / ) + $segCount = count($range) + 1; // + 1 Last segment has missing character 0xFFFF + $searchRange = 1; + $entrySelector = 0; + while ($searchRange * 2 <= $segCount ) { + $searchRange = $searchRange * 2; + $entrySelector = $entrySelector + 1; + } + $searchRange = $searchRange * 2; + $rangeShift = $segCount * 2 - $searchRange; + $length = 16 + (8*$segCount ) + ($numGlyphs+1); + $cmap = array(0, 1, // Index : version, number of encoding subtables + 3, 1, // Encoding Subtable : platform (MS=3), encoding (Unicode) + 0, 12, // Encoding Subtable : offset (hi,lo) + 4, $length, 0, // Format 4 Mapping subtable: format, length, language + $segCount*2, + $searchRange, + $entrySelector, + $rangeShift); + + // endCode(s) + foreach($range AS $start=>$subrange) { + $endCode = $start + (count($subrange)-1); + $cmap[] = $endCode; // endCode(s) + } + $cmap[] = 0xFFFF; // endCode of last Segment + $cmap[] = 0; // reservedPad + + // startCode(s) + foreach($range AS $start=>$subrange) { + $cmap[] = $start; // startCode(s) + } + $cmap[] = 0xFFFF; // startCode of last Segment + // idDelta(s) + foreach($range AS $start=>$subrange) { + $idDelta = -($start-$subrange[0]); + $n += count($subrange); + $cmap[] = $idDelta; // idDelta(s) + } + $cmap[] = 1; // idDelta of last Segment + // idRangeOffset(s) + foreach($range AS $subrange) { + $cmap[] = 0; // idRangeOffset[segCount] Offset in bytes to glyph indexArray, or 0 + + } + $cmap[] = 0; // idRangeOffset of last Segment + foreach($range AS $subrange) { + foreach($subrange AS $glidx) { + $cmap[] = $glidx; + } + } + $cmap[] = 0; // Mapping for last character + $cmapstr = ''; + foreach($cmap AS $cm) { $cmapstr .= pack("n",$cm); } + $this->add('cmap', $cmapstr); + + + // glyf - Glyph data + list($glyfOffset,$glyfLength) = $this->get_table_pos('glyf'); + if ($glyfLength < $this->maxStrLenRead) { + $glyphData = $this->get_table('glyf'); + } + + $offsets = []; + $glyf = ''; + $pos = 0; + + $hmtxstr = ''; + $xMinT = 0; + $yMinT = 0; + $xMaxT = 0; + $yMaxT = 0; + $advanceWidthMax = 0; + $minLeftSideBearing = 0; + $minRightSideBearing = 0; + $xMaxExtent = 0; + $maxPoints = 0; // points in non-compound glyph + $maxContours = 0; // contours in non-compound glyph + $maxComponentPoints = 0; // points in compound glyph + $maxComponentContours = 0; // contours in compound glyph + $maxComponentElements = 0; // number of glyphs referenced at top level + $maxComponentDepth = 0; // levels of recursion, set to 0 if font has only simple glyphs + $this->glyphdata = []; + + foreach($subsetglyphs AS $originalGlyphIdx => $uni) { + // hmtx - Horizontal Metrics + $hm = $this->getHMetric($orignHmetrics, $originalGlyphIdx); + $hmtxstr .= $hm; + + $offsets[] = $pos; + $glyphPos = $this->glyphPos[$originalGlyphIdx]; + $glyphLen = $this->glyphPos[$originalGlyphIdx + 1] - $glyphPos; + if ($glyfLength < $this->maxStrLenRead) { + $data = substr($glyphData,$glyphPos,$glyphLen); + } + else { + if ($glyphLen > 0) $data = $this->get_chunk($glyfOffset+$glyphPos,$glyphLen); + else $data = ''; + } + + if ($glyphLen > 0) { + $up = unpack("n", substr($data,0,2)); + } + + if ($glyphLen > 2 && ($up[1] & (1 << 15)) ) { // If number of contours <= -1 i.e. composiste glyph + $pos_in_glyph = 10; + $flags = GF_MORE; + $nComponentElements = 0; + while ($flags & GF_MORE) { + $nComponentElements += 1; // number of glyphs referenced at top level + $up = unpack("n", substr($data,$pos_in_glyph,2)); + $flags = $up[1]; + $up = unpack("n", substr($data,$pos_in_glyph+2,2)); + $glyphIdx = $up[1]; + $this->glyphdata[$originalGlyphIdx]['compGlyphs'][] = $glyphIdx; + $data = $this->_set_ushort($data, $pos_in_glyph + 2, $glyphSet[$glyphIdx]); + $pos_in_glyph += 4; + if ($flags & GF_WORDS) { $pos_in_glyph += 4; } + else { $pos_in_glyph += 2; } + if ($flags & GF_SCALE) { $pos_in_glyph += 2; } + else if ($flags & GF_XYSCALE) { $pos_in_glyph += 4; } + else if ($flags & GF_TWOBYTWO) { $pos_in_glyph += 8; } + } + $maxComponentElements = max($maxComponentElements, $nComponentElements); + } + + $glyf .= $data; + $pos += $glyphLen; + if ($pos % 4 != 0) { + $padding = 4 - ($pos % 4); + $glyf .= str_repeat("\0",$padding); + $pos += $padding; + } + } + + $offsets[] = $pos; + $this->add('glyf', $glyf); + + // hmtx - Horizontal Metrics + $this->add('hmtx', $hmtxstr); + + // loca - Index to location + $locastr = ''; + if ((($pos + 1) >> 1) > 0xFFFF) { + $indexToLocFormat = 1; // long format + foreach($offsets AS $offset) { $locastr .= pack("N",$offset); } + } + else { + $indexToLocFormat = 0; // short format + foreach($offsets AS $offset) { $locastr .= pack("n",($offset/2)); } + } + $this->add('loca', $locastr); + + // head - Font header + $head = $this->get_table('head'); + $head = $this->_set_ushort($head, 50, $indexToLocFormat); + $this->add('head', $head); + + + // hhea - Horizontal Header + $hhea = $this->get_table('hhea'); + $hhea = $this->_set_ushort($hhea, 34, $numberOfHMetrics); + $this->add('hhea', $hhea); + + // maxp - Maximum Profile + $maxp = $this->get_table('maxp'); + $maxp = $this->_set_ushort($maxp, 4, $numGlyphs); + $this->add('maxp', $maxp); + + + // OS/2 - OS/2 + $os2 = $this->get_table('OS/2'); + $this->add('OS/2', $os2 ); + + fclose($this->fh); + + // Put the TTF file together + $stm = ''; + $this->endTTFile($stm); + return $stm ; + } + + ////////////////////////////////////////////////////////////////////////////////// + // Recursively get composite glyph data + function getGlyphData($originalGlyphIdx, &$maxdepth, &$depth, &$points, &$contours) { + $depth++; + $maxdepth = max($maxdepth, $depth); + if (count($this->glyphdata[$originalGlyphIdx]['compGlyphs'])) { + foreach($this->glyphdata[$originalGlyphIdx]['compGlyphs'] AS $glyphIdx) { + $this->getGlyphData($glyphIdx, $maxdepth, $depth, $points, $contours); + } + } + else if (($this->glyphdata[$originalGlyphIdx]['nContours'] > 0) && $depth > 0) { // simple + $contours += $this->glyphdata[$originalGlyphIdx]['nContours']; + $points += $this->glyphdata[$originalGlyphIdx]['nPoints']; + } + $depth--; + } + + + ////////////////////////////////////////////////////////////////////////////////// + // Recursively get composite glyphs + function getGlyphs($originalGlyphIdx, &$start, &$glyphSet, &$subsetglyphs) { + $glyphPos = $this->glyphPos[$originalGlyphIdx]; + $glyphLen = $this->glyphPos[$originalGlyphIdx + 1] - $glyphPos; + if (!$glyphLen) { + return; + } + $this->seek($start + $glyphPos); + $numberOfContours = $this->read_short(); + if ($numberOfContours < 0) { + $this->skip(8); + $flags = GF_MORE; + while ($flags & GF_MORE) { + $flags = $this->read_ushort(); + $glyphIdx = $this->read_ushort(); + if (!isset($glyphSet[$glyphIdx])) { + $glyphSet[$glyphIdx] = count($subsetglyphs); // old glyphID to new glyphID + $subsetglyphs[$glyphIdx] = true; + } + $savepos = ftell($this->fh); + $this->getGlyphs($glyphIdx, $start, $glyphSet, $subsetglyphs); + $this->seek($savepos); + if ($flags & GF_WORDS) + $this->skip(4); + else + $this->skip(2); + if ($flags & GF_SCALE) + $this->skip(2); + else if ($flags & GF_XYSCALE) + $this->skip(4); + else if ($flags & GF_TWOBYTWO) + $this->skip(8); + } + } + } + + ////////////////////////////////////////////////////////////////////////////////// + + function getHMTX($numberOfHMetrics, $numGlyphs, &$glyphToChar, $scale) { + $start = $this->seek_table("hmtx"); + $aw = 0; + $this->charWidths = str_pad('', 256*256*2, "\x00"); + $nCharWidths = 0; + if (($numberOfHMetrics*4) < $this->maxStrLenRead) { + $data = $this->get_chunk($start,($numberOfHMetrics*4)); + $arr = unpack("n*", $data); + } + else { $this->seek($start); } + for( $glyph=0; $glyph<$numberOfHMetrics; $glyph++) { + + if (($numberOfHMetrics*4) < $this->maxStrLenRead) { + $aw = $arr[($glyph*2)+1]; + } + else { + $aw = $this->read_ushort(); + $lsb = $this->read_ushort(); + } + if (isset($glyphToChar[$glyph]) || $glyph == 0) { + + if ($aw >= (1 << 15) ) { $aw = 0; } // 1.03 Some (arabic) fonts have -ve values for width + // although should be unsigned value - comes out as e.g. 65108 (intended -50) + if ($glyph == 0) { + $this->defaultWidth = $scale*$aw; + continue; + } + foreach($glyphToChar[$glyph] AS $char) { + if ($char != 0 && $char != 65535) { + $w = intval(round($scale*$aw)); + if ($w == 0) { $w = 65535; } + if ($char < 196608) { + $this->charWidths[$char*2] = chr($w >> 8); + $this->charWidths[$char*2 + 1] = chr($w & 0xFF); + $nCharWidths++; + } + } + } + } + } + $data = $this->get_chunk(($start+$numberOfHMetrics*4),($numGlyphs*2)); + $arr = unpack("n*", $data); + $diff = $numGlyphs-$numberOfHMetrics; + for( $pos=0; $pos<$diff; $pos++) { + $glyph = $pos + $numberOfHMetrics; + if (isset($glyphToChar[$glyph])) { + foreach($glyphToChar[$glyph] AS $char) { + if ($char != 0 && $char != 65535) { + $w = intval(round($scale*$aw)); + if ($w == 0) { $w = 65535; } + if ($char < 196608) { + $this->charWidths[$char*2] = chr($w >> 8); + $this->charWidths[$char*2 + 1] = chr($w & 0xFF); + $nCharWidths++; + } + } + } + } + } + // NB 65535 is a set width of 0 + // First bytes define number of chars in font + $this->charWidths[0] = chr($nCharWidths >> 8); + $this->charWidths[1] = chr($nCharWidths & 0xFF); + } + + function getHMetric($numberOfHMetrics, $gid) { + $start = $this->seek_table("hmtx"); + if ($gid < $numberOfHMetrics) { + $this->seek($start+($gid*4)); + $hm = fread($this->fh,4); + } + else { + $this->seek($start+(($numberOfHMetrics-1)*4)); + $hm = fread($this->fh,2); + $this->seek($start+($numberOfHMetrics*2)+($gid*2)); + $hm .= fread($this->fh,2); + } + return $hm; + } + + function getLOCA($indexToLocFormat, $numGlyphs) { + $start = $this->seek_table('loca'); + $this->glyphPos = []; + if ($indexToLocFormat == 0) { + $data = $this->get_chunk($start,($numGlyphs*2)+2); + $arr = unpack("n*", $data); + for ($n=0; $n<=$numGlyphs; $n++) { + $this->glyphPos[] = ($arr[$n+1] * 2); + } + } + else if ($indexToLocFormat == 1) { + $data = $this->get_chunk($start,($numGlyphs*4)+4); + $arr = unpack("N*", $data); + for ($n=0; $n<=$numGlyphs; $n++) { + $this->glyphPos[] = ($arr[$n+1]); + } + } + else + die('Unknown location table format '.$indexToLocFormat); + } + + + // CMAP Format 4 + function getCMAP4($unicode_cmap_offset, &$glyphToChar, &$charToGlyph ) { + $this->maxUniChar = 0; + $this->seek($unicode_cmap_offset + 2); + $length = $this->read_ushort(); + $limit = $unicode_cmap_offset + $length; + $this->skip(2); + + $segCount = $this->read_ushort() / 2; + $this->skip(6); + $endCount = []; + for($i=0; $i<$segCount; $i++) { $endCount[] = $this->read_ushort(); } + $this->skip(2); + $startCount = []; + for($i=0; $i<$segCount; $i++) { $startCount[] = $this->read_ushort(); } + $idDelta = []; + for($i=0; $i<$segCount; $i++) { $idDelta[] = $this->read_short(); } // ???? was unsigned short + $idRangeOffset_start = $this->_pos; + $idRangeOffset = []; + for($i=0; $i<$segCount; $i++) { $idRangeOffset[] = $this->read_ushort(); } + + for ($n=0;$n<$segCount;$n++) { + $endpoint = ($endCount[$n] + 1); + for ($unichar=$startCount[$n];$unichar<$endpoint;$unichar++) { + if ($idRangeOffset[$n] == 0) + $glyph = ($unichar + $idDelta[$n]) & 0xFFFF; + else { + $offset = ($unichar - $startCount[$n]) * 2 + $idRangeOffset[$n]; + $offset = $idRangeOffset_start + 2 * $n + $offset; + if ($offset >= $limit) + $glyph = 0; + else { + $glyph = $this->get_ushort($offset); + if ($glyph != 0) + $glyph = ($glyph + $idDelta[$n]) & 0xFFFF; + } + } + $charToGlyph[$unichar] = $glyph; + if ($unichar < 196608) { $this->maxUniChar = max($unichar,$this->maxUniChar); } + $glyphToChar[$glyph][] = $unichar; + } + } + } + + + // Put the TTF file together + function endTTFile(&$stm) { + $stm = ''; + $numTables = count($this->otables); + $searchRange = 1; + $entrySelector = 0; + while ($searchRange * 2 <= $numTables) { + $searchRange = $searchRange * 2; + $entrySelector = $entrySelector + 1; + } + $searchRange = $searchRange * 16; + $rangeShift = $numTables * 16 - $searchRange; + + // Header + if (_TTF_MAC_HEADER) { + $stm .= (pack("Nnnnn", 0x74727565, $numTables, $searchRange, $entrySelector, $rangeShift)); // Mac + } + else { + $stm .= (pack("Nnnnn", 0x00010000, $numTables, $searchRange, $entrySelector, $rangeShift)); // Windows + } + + // Table directory + $tables = $this->otables; + + ksort ($tables); + $offset = 12 + $numTables * 16; + foreach ($tables AS $tag=>$data) { + if ($tag == 'head') { $head_start = $offset; } + $stm .= $tag; + $checksum = $this->calcChecksum($data); + $stm .= pack("nn", $checksum[0],$checksum[1]); + $stm .= pack("NN", $offset, strlen($data)); + $paddedLength = (strlen($data)+3)&~3; + $offset = $offset + $paddedLength; + } + + // Table data + foreach ($tables AS $tag=>$data) { + $data .= "\0\0\0"; + $stm .= substr($data,0,(strlen($data)&~3)); + } + + $checksum = $this->calcChecksum($stm); + $checksum = $this->sub32(array(0xB1B0,0xAFBA), $checksum); + $chk = pack("nn", $checksum[0],$checksum[1]); + $stm = $this->splice($stm,($head_start + 8),$chk); + return $stm ; + } +} \ No newline at end of file diff --git a/app/api/TFPDF/font/zapfdingbats.php b/app/api/TFPDF/font/zapfdingbats.php new file mode 100755 index 0000000..afef4d3 --- /dev/null +++ b/app/api/TFPDF/font/zapfdingbats.php @@ -0,0 +1,19 @@ +0,chr(1)=>0,chr(2)=>0,chr(3)=>0,chr(4)=>0,chr(5)=>0,chr(6)=>0,chr(7)=>0,chr(8)=>0,chr(9)=>0,chr(10)=>0,chr(11)=>0,chr(12)=>0,chr(13)=>0,chr(14)=>0,chr(15)=>0,chr(16)=>0,chr(17)=>0,chr(18)=>0,chr(19)=>0,chr(20)=>0,chr(21)=>0, + chr(22)=>0,chr(23)=>0,chr(24)=>0,chr(25)=>0,chr(26)=>0,chr(27)=>0,chr(28)=>0,chr(29)=>0,chr(30)=>0,chr(31)=>0,' '=>278,'!'=>974,'"'=>961,'#'=>974,'$'=>980,'%'=>719,'&'=>789,'\''=>790,'('=>791,')'=>690,'*'=>960,'+'=>939, + ','=>549,'-'=>855,'.'=>911,'/'=>933,'0'=>911,'1'=>945,'2'=>974,'3'=>755,'4'=>846,'5'=>762,'6'=>761,'7'=>571,'8'=>677,'9'=>763,':'=>760,';'=>759,'<'=>754,'='=>494,'>'=>552,'?'=>537,'@'=>577,'A'=>692, + 'B'=>786,'C'=>788,'D'=>788,'E'=>790,'F'=>793,'G'=>794,'H'=>816,'I'=>823,'J'=>789,'K'=>841,'L'=>823,'M'=>833,'N'=>816,'O'=>831,'P'=>923,'Q'=>744,'R'=>723,'S'=>749,'T'=>790,'U'=>792,'V'=>695,'W'=>776, + 'X'=>768,'Y'=>792,'Z'=>759,'['=>707,'\\'=>708,']'=>682,'^'=>701,'_'=>826,'`'=>815,'a'=>789,'b'=>789,'c'=>707,'d'=>687,'e'=>696,'f'=>689,'g'=>786,'h'=>787,'i'=>713,'j'=>791,'k'=>785,'l'=>791,'m'=>873, + 'n'=>761,'o'=>762,'p'=>762,'q'=>759,'r'=>759,'s'=>892,'t'=>892,'u'=>788,'v'=>784,'w'=>438,'x'=>138,'y'=>277,'z'=>415,'{'=>392,'|'=>392,'}'=>668,'~'=>668,chr(127)=>0,chr(128)=>390,chr(129)=>390,chr(130)=>317,chr(131)=>317, + chr(132)=>276,chr(133)=>276,chr(134)=>509,chr(135)=>509,chr(136)=>410,chr(137)=>410,chr(138)=>234,chr(139)=>234,chr(140)=>334,chr(141)=>334,chr(142)=>0,chr(143)=>0,chr(144)=>0,chr(145)=>0,chr(146)=>0,chr(147)=>0,chr(148)=>0,chr(149)=>0,chr(150)=>0,chr(151)=>0,chr(152)=>0,chr(153)=>0, + chr(154)=>0,chr(155)=>0,chr(156)=>0,chr(157)=>0,chr(158)=>0,chr(159)=>0,chr(160)=>0,chr(161)=>732,chr(162)=>544,chr(163)=>544,chr(164)=>910,chr(165)=>667,chr(166)=>760,chr(167)=>760,chr(168)=>776,chr(169)=>595,chr(170)=>694,chr(171)=>626,chr(172)=>788,chr(173)=>788,chr(174)=>788,chr(175)=>788, + chr(176)=>788,chr(177)=>788,chr(178)=>788,chr(179)=>788,chr(180)=>788,chr(181)=>788,chr(182)=>788,chr(183)=>788,chr(184)=>788,chr(185)=>788,chr(186)=>788,chr(187)=>788,chr(188)=>788,chr(189)=>788,chr(190)=>788,chr(191)=>788,chr(192)=>788,chr(193)=>788,chr(194)=>788,chr(195)=>788,chr(196)=>788,chr(197)=>788, + chr(198)=>788,chr(199)=>788,chr(200)=>788,chr(201)=>788,chr(202)=>788,chr(203)=>788,chr(204)=>788,chr(205)=>788,chr(206)=>788,chr(207)=>788,chr(208)=>788,chr(209)=>788,chr(210)=>788,chr(211)=>788,chr(212)=>894,chr(213)=>838,chr(214)=>1016,chr(215)=>458,chr(216)=>748,chr(217)=>924,chr(218)=>748,chr(219)=>918, + chr(220)=>927,chr(221)=>928,chr(222)=>928,chr(223)=>834,chr(224)=>873,chr(225)=>828,chr(226)=>924,chr(227)=>924,chr(228)=>917,chr(229)=>930,chr(230)=>931,chr(231)=>463,chr(232)=>883,chr(233)=>836,chr(234)=>836,chr(235)=>867,chr(236)=>867,chr(237)=>696,chr(238)=>696,chr(239)=>874,chr(240)=>0,chr(241)=>874, + chr(242)=>760,chr(243)=>946,chr(244)=>771,chr(245)=>865,chr(246)=>771,chr(247)=>888,chr(248)=>967,chr(249)=>888,chr(250)=>831,chr(251)=>873,chr(252)=>927,chr(253)=>970,chr(254)=>918,chr(255)=>0); +?> diff --git a/app/api/TFPDF/tfpdf.php b/app/api/TFPDF/tfpdf.php new file mode 100755 index 0000000..4de86b2 --- /dev/null +++ b/app/api/TFPDF/tfpdf.php @@ -0,0 +1,2378 @@ + * +* Tycho Veltmeijer (versions 1.30+) * +* License: LGPL * +*******************************************************************************/ + +define('tFPDF_VERSION','1.32'); + +class tFPDF +{ +protected $unifontSubset; +protected $page; // current page number +protected $n; // current object number +protected $offsets; // array of object offsets +protected $buffer; // buffer holding in-memory PDF +protected $pages; // array containing pages +protected $state; // current document state +protected $compress; // compression flag +protected $k; // scale factor (number of points in user unit) +protected $DefOrientation; // default orientation +protected $CurOrientation; // current orientation +protected $StdPageSizes; // standard page sizes +protected $DefPageSize; // default page size +protected $CurPageSize; // current page size +protected $CurRotation; // current page rotation +protected $PageInfo; // page-related data +protected $wPt, $hPt; // dimensions of current page in points +protected $w, $h; // dimensions of current page in user unit +protected $lMargin; // left margin +protected $tMargin; // top margin +protected $rMargin; // right margin +protected $bMargin; // page break margin +protected $cMargin; // cell margin +protected $x, $y; // current position in user unit +protected $lasth; // height of last printed cell +protected $LineWidth; // line width in user unit +protected $fontpath; // path containing fonts +protected $CoreFonts; // array of core font names +protected $fonts; // array of used fonts +protected $FontFiles; // array of font files +protected $encodings; // array of encodings +protected $cmaps; // array of ToUnicode CMaps +protected $FontFamily; // current font family +protected $FontStyle; // current font style +protected $underline; // underlining flag +protected $CurrentFont; // current font info +protected $FontSizePt; // current font size in points +protected $FontSize; // current font size in user unit +protected $DrawColor; // commands for drawing color +protected $FillColor; // commands for filling color +protected $TextColor; // commands for text color +protected $ColorFlag; // indicates whether fill and text colors are different +protected $WithAlpha; // indicates whether alpha channel is used +protected $ws; // word spacing +protected $images; // array of used images +protected $PageLinks; // array of links in pages +protected $links; // array of internal links +protected $AutoPageBreak; // automatic page breaking +protected $PageBreakTrigger; // threshold used to trigger page breaks +protected $InHeader; // flag set when processing header +protected $InFooter; // flag set when processing footer +protected $AliasNbPages; // alias for total number of pages +protected $ZoomMode; // zoom display mode +protected $LayoutMode; // layout display mode +protected $metadata; // document properties +protected $PDFVersion; // PDF version number + +/******************************************************************************* +* Public methods * +*******************************************************************************/ + +function __construct($orientation='P', $unit='mm', $size='A4') +{ + // Some checks + $this->_dochecks(); + // Initialization of properties + $this->state = 0; + $this->page = 0; + $this->n = 2; + $this->buffer = ''; + $this->pages = []; + $this->PageInfo = []; + $this->fonts = []; + $this->FontFiles = []; + $this->encodings = []; + $this->cmaps = []; + $this->images = []; + $this->links = []; + $this->InHeader = false; + $this->InFooter = false; + $this->lasth = 0; + $this->FontFamily = ''; + $this->FontStyle = ''; + $this->FontSizePt = 12; + $this->underline = false; + $this->DrawColor = '0 G'; + $this->FillColor = '0 g'; + $this->TextColor = '0 g'; + $this->ColorFlag = false; + $this->WithAlpha = false; + $this->ws = 0; + // Font path + if(defined('FPDF_FONTPATH')) + { + $this->fontpath = FPDF_FONTPATH; + if(substr($this->fontpath,-1)!='/' && substr($this->fontpath,-1)!='\\') + $this->fontpath .= '/'; + } + elseif(is_dir(dirname(__FILE__).'/font')) + $this->fontpath = dirname(__FILE__).'/font/'; + else + $this->fontpath = ''; + // Core fonts + $this->CoreFonts = array('courier', 'helvetica', 'times', 'symbol', 'zapfdingbats'); + // Scale factor + if($unit=='pt') + $this->k = 1; + elseif($unit=='mm') + $this->k = 72/25.4; + elseif($unit=='cm') + $this->k = 72/2.54; + elseif($unit=='in') + $this->k = 72; + else + $this->Error('Incorrect unit: '.$unit); + // Page sizes + $this->StdPageSizes = array('a3'=>array(841.89,1190.55), 'a4'=>array(595.28,841.89), 'a5'=>array(420.94,595.28), + 'letter'=>array(612,792), 'legal'=>array(612,1008)); + $size = $this->_getpagesize($size); + $this->DefPageSize = $size; + $this->CurPageSize = $size; + // Page orientation + $orientation = strtolower($orientation); + if($orientation=='p' || $orientation=='portrait') + { + $this->DefOrientation = 'P'; + $this->w = $size[0]; + $this->h = $size[1]; + } + elseif($orientation=='l' || $orientation=='landscape') + { + $this->DefOrientation = 'L'; + $this->w = $size[1]; + $this->h = $size[0]; + } + else + $this->Error('Incorrect orientation: '.$orientation); + $this->CurOrientation = $this->DefOrientation; + $this->wPt = $this->w*$this->k; + $this->hPt = $this->h*$this->k; + // Page rotation + $this->CurRotation = 0; + // Page margins (1 cm) + $margin = 28.35/$this->k; + $this->SetMargins($margin,$margin); + // Interior cell margin (1 mm) + $this->cMargin = $margin/10; + // Line width (0.2 mm) + $this->LineWidth = .567/$this->k; + // Automatic page break + $this->SetAutoPageBreak(true,2*$margin); + // Default display mode + $this->SetDisplayMode('default'); + // Enable compression + $this->SetCompression(true); + // Set default PDF version number + $this->PDFVersion = '1.3'; +} + +function SetMargins($left, $top, $right=null) +{ + // Set left, top and right margins + $this->lMargin = $left; + $this->tMargin = $top; + if($right===null) + $right = $left; + $this->rMargin = $right; +} + +function SetLeftMargin($margin) +{ + // Set left margin + $this->lMargin = $margin; + if($this->page>0 && $this->x<$margin) + $this->x = $margin; +} + +function SetTopMargin($margin) +{ + // Set top margin + $this->tMargin = $margin; +} + +function SetRightMargin($margin) +{ + // Set right margin + $this->rMargin = $margin; +} + +function SetAutoPageBreak($auto, $margin=0) +{ + // Set auto page break mode and triggering margin + $this->AutoPageBreak = $auto; + $this->bMargin = $margin; + $this->PageBreakTrigger = $this->h-$margin; +} + +function SetDisplayMode($zoom, $layout='default') +{ + // Set display mode in viewer + if($zoom=='fullpage' || $zoom=='fullwidth' || $zoom=='real' || $zoom=='default' || !is_string($zoom)) + $this->ZoomMode = $zoom; + else + $this->Error('Incorrect zoom display mode: '.$zoom); + if($layout=='single' || $layout=='continuous' || $layout=='two' || $layout=='default') + $this->LayoutMode = $layout; + else + $this->Error('Incorrect layout display mode: '.$layout); +} + +function SetCompression($compress) +{ + // Set page compression + if(function_exists('gzcompress')) + $this->compress = $compress; + else + $this->compress = false; +} + +function SetTitle($title, $isUTF8=false) +{ + // Title of document + $this->metadata['Title'] = $isUTF8 ? $title : utf8_encode($title); +} + +function SetAuthor($author, $isUTF8=false) +{ + // Author of document + $this->metadata['Author'] = $isUTF8 ? $author : utf8_encode($author); +} + +function SetSubject($subject, $isUTF8=false) +{ + // Subject of document + $this->metadata['Subject'] = $isUTF8 ? $subject : utf8_encode($subject); +} + +function SetKeywords($keywords, $isUTF8=false) +{ + // Keywords of document + $this->metadata['Keywords'] = $isUTF8 ? $keywords : utf8_encode($keywords); +} + +function SetCreator($creator, $isUTF8=false) +{ + // Creator of document + $this->metadata['Creator'] = $isUTF8 ? $creator : utf8_encode($creator); +} + +function AliasNbPages($alias='{nb}') +{ + // Define an alias for total number of pages + $this->AliasNbPages = $alias; +} + +function Error($msg) +{ + // Fatal error + throw new Exception('FPDF error: '.$msg); +} + +function Close() +{ + // Terminate document + if($this->state==3) + return; + if($this->page==0) + $this->AddPage(); + // Page footer + $this->InFooter = true; + $this->Footer(); + $this->InFooter = false; + // Close page + $this->_endpage(); + // Close document + $this->_enddoc(); +} + +function AddPage($orientation='', $size='', $rotation=0) +{ + // Start a new page + if($this->state==3) + $this->Error('The document is closed'); + $family = $this->FontFamily; + $style = $this->FontStyle.($this->underline ? 'U' : ''); + $fontsize = $this->FontSizePt; + $lw = $this->LineWidth; + $dc = $this->DrawColor; + $fc = $this->FillColor; + $tc = $this->TextColor; + $cf = $this->ColorFlag; + if($this->page>0) + { + // Page footer + $this->InFooter = true; + $this->Footer(); + $this->InFooter = false; + // Close page + $this->_endpage(); + } + // Start new page + $this->_beginpage($orientation,$size,$rotation); + // Set line cap style to square + $this->_out('2 J'); + // Set line width + $this->LineWidth = $lw; + $this->_out(sprintf('%.2F w',$lw*$this->k)); + // Set font + if($family) + $this->SetFont($family,$style,$fontsize); + // Set colors + $this->DrawColor = $dc; + if($dc!='0 G') + $this->_out($dc); + $this->FillColor = $fc; + if($fc!='0 g') + $this->_out($fc); + $this->TextColor = $tc; + $this->ColorFlag = $cf; + // Page header + $this->InHeader = true; + $this->Header(); + $this->InHeader = false; + // Restore line width + if($this->LineWidth!=$lw) + { + $this->LineWidth = $lw; + $this->_out(sprintf('%.2F w',$lw*$this->k)); + } + // Restore font + if($family) + $this->SetFont($family,$style,$fontsize); + // Restore colors + if($this->DrawColor!=$dc) + { + $this->DrawColor = $dc; + $this->_out($dc); + } + if($this->FillColor!=$fc) + { + $this->FillColor = $fc; + $this->_out($fc); + } + $this->TextColor = $tc; + $this->ColorFlag = $cf; +} + +function Header() +{ + // To be implemented in your own inherited class +} + +function Footer() +{ + // To be implemented in your own inherited class +} + +function PageNo() +{ + // Get current page number + return $this->page; +} + +function SetDrawColor($r, $g=null, $b=null) +{ + // Set color for all stroking operations + if(($r==0 && $g==0 && $b==0) || $g===null) + $this->DrawColor = sprintf('%.3F G',$r/255); + else + $this->DrawColor = sprintf('%.3F %.3F %.3F RG',$r/255,$g/255,$b/255); + if($this->page>0) + $this->_out($this->DrawColor); +} + +function SetFillColor($r, $g=null, $b=null) +{ + // Set color for all filling operations + if(($r==0 && $g==0 && $b==0) || $g===null) + $this->FillColor = sprintf('%.3F g',$r/255); + else + $this->FillColor = sprintf('%.3F %.3F %.3F rg',$r/255,$g/255,$b/255); + $this->ColorFlag = ($this->FillColor!=$this->TextColor); + if($this->page>0) + $this->_out($this->FillColor); +} + +function SetTextColor($r, $g=null, $b=null) +{ + // Set color for text + if(($r==0 && $g==0 && $b==0) || $g===null) + $this->TextColor = sprintf('%.3F g',$r/255); + else + $this->TextColor = sprintf('%.3F %.3F %.3F rg',$r/255,$g/255,$b/255); + $this->ColorFlag = ($this->FillColor!=$this->TextColor); +} + +function GetStringWidth($s) +{ + // Get width of a string in the current font + $s = (string)$s; + $cw = &$this->CurrentFont['cw']; + $w=0; + if ($this->unifontSubset) { + $unicode = $this->UTF8StringToArray($s); + foreach($unicode as $char) { + if (isset($cw[2*$char])) { $w += (ord($cw[2*$char])<<8) + ord($cw[2*$char+1]); } + else if($char>0 && $char<128 && isset($cw[chr($char)])) { $w += $cw[chr($char)]; } + else if(isset($this->CurrentFont['desc']['MissingWidth'])) { $w += $this->CurrentFont['desc']['MissingWidth']; } + else if(isset($this->CurrentFont['MissingWidth'])) { $w += $this->CurrentFont['MissingWidth']; } + else { $w += 500; } + } + } + else { + $l = strlen($s); + for($i=0;$i<$l;$i++) + $w += $cw[$s[$i]]; + } + return $w*$this->FontSize/1000; +} + +function SetLineWidth($width) +{ + // Set line width + $this->LineWidth = $width; + if($this->page>0) + $this->_out(sprintf('%.2F w',$width*$this->k)); +} + +function Line($x1, $y1, $x2, $y2) +{ + // Draw a line + $this->_out(sprintf('%.2F %.2F m %.2F %.2F l S',$x1*$this->k,($this->h-$y1)*$this->k,$x2*$this->k,($this->h-$y2)*$this->k)); +} + +function Rect($x, $y, $w, $h, $style='') +{ + // Draw a rectangle + if($style=='F') + $op = 'f'; + elseif($style=='FD' || $style=='DF') + $op = 'B'; + else + $op = 'S'; + $this->_out(sprintf('%.2F %.2F %.2F %.2F re %s',$x*$this->k,($this->h-$y)*$this->k,$w*$this->k,-$h*$this->k,$op)); +} + +function AddFont($family, $style='', $file='', $uni=false) +{ + // Add a TrueType, OpenType or Type1 font + $family = strtolower($family); + $style = strtoupper($style); + if($style=='IB') + $style = 'BI'; + if($file=='') { + if ($uni) { + $file = str_replace(' ','',$family).strtolower($style).'.ttf'; + } + else { + $file = str_replace(' ','',$family).strtolower($style).'.php'; + } + } + $fontkey = $family.$style; + if(isset($this->fonts[$fontkey])) + return; + if ($uni) { + if (defined("_SYSTEM_TTFONTS") && file_exists(_SYSTEM_TTFONTS.$file )) { $ttffilename = _SYSTEM_TTFONTS.$file ; } + else { $ttffilename = $this->fontpath.'unifont/'.$file ; } + $unifilename = $this->fontpath.'unifont/'.strtolower(substr($file ,0,(strpos($file ,'.')))); + $name = ''; + $originalsize = 0; + $ttfstat = stat($ttffilename); + if (file_exists($unifilename.'.mtx.php')) { + include($unifilename.'.mtx.php'); + } + if (!isset($type) || !isset($name) || $originalsize != $ttfstat['size']) { + $ttffile = $ttffilename; + require_once($this->fontpath.'unifont/ttfonts.php'); + $ttf = new TTFontFile(); + $ttf->getMetrics($ttffile); + $cw = $ttf->charWidths; + $name = preg_replace('/[ ()]/','',$ttf->fullName); + + $desc= array('Ascent'=>round($ttf->ascent), + 'Descent'=>round($ttf->descent), + 'CapHeight'=>round($ttf->capHeight), + 'Flags'=>$ttf->flags, + 'FontBBox'=>'['.round($ttf->bbox[0])." ".round($ttf->bbox[1])." ".round($ttf->bbox[2])." ".round($ttf->bbox[3]).']', + 'ItalicAngle'=>$ttf->italicAngle, + 'StemV'=>round($ttf->stemV), + 'MissingWidth'=>round($ttf->defaultWidth)); + $up = round($ttf->underlinePosition); + $ut = round($ttf->underlineThickness); + $originalsize = $ttfstat['size']+0; + $type = 'TTF'; + // Generate metrics .php file + $s='"; + if (is_writable(dirname($this->fontpath.'unifont/'.'x'))) { + $fh = fopen($unifilename.'.mtx.php',"w"); + fwrite($fh,$s,strlen($s)); + fclose($fh); + $fh = fopen($unifilename.'.cw.dat',"wb"); + fwrite($fh,$cw,strlen($cw)); + fclose($fh); + @unlink($unifilename.'.cw127.php'); + } + unset($ttf); + } + else { + $cw = @file_get_contents($unifilename.'.cw.dat'); + } + $i = count($this->fonts)+1; + if(!empty($this->AliasNbPages)) + $sbarr = range(0,57); + else + $sbarr = range(0,32); + $this->fonts[$fontkey] = array('i'=>$i, 'type'=>$type, 'name'=>$name, 'desc'=>$desc, 'up'=>$up, 'ut'=>$ut, 'cw'=>$cw, 'ttffile'=>$ttffile, 'fontkey'=>$fontkey, 'subset'=>$sbarr, 'unifilename'=>$unifilename); + + $this->FontFiles[$fontkey]=array('length1'=>$originalsize, 'type'=>"TTF", 'ttffile'=>$ttffile); + $this->FontFiles[$file]=array('type'=>"TTF"); + unset($cw); + } + else { + $info = $this->_loadfont($file); + $info['i'] = count($this->fonts)+1; + if(!empty($info['file'])) + { + // Embedded font + if($info['type']=='TrueType') + $this->FontFiles[$info['file']] = array('length1'=>$info['originalsize']); + else + $this->FontFiles[$info['file']] = array('length1'=>$info['size1'], 'length2'=>$info['size2']); + } + $this->fonts[$fontkey] = $info; + } +} + +function SetFont($family, $style='', $size=0) +{ + // Select a font; size given in points + if($family=='') + $family = $this->FontFamily; + else + $family = strtolower($family); + $style = strtoupper($style); + if(strpos($style,'U')!==false) + { + $this->underline = true; + $style = str_replace('U','',$style); + } + else + $this->underline = false; + if($style=='IB') + $style = 'BI'; + if($size==0) + $size = $this->FontSizePt; + // Test if font is already selected + if($this->FontFamily==$family && $this->FontStyle==$style && $this->FontSizePt==$size) + return; + + // Test if font is already loaded + $fontkey = $family.$style; + if(!isset($this->fonts[$fontkey])) + { + // Test if one of the core fonts + if($family=='arial') + $family = 'helvetica'; + if(in_array($family,$this->CoreFonts)) + { + if($family=='symbol' || $family=='zapfdingbats') + $style = ''; + $fontkey = $family.$style; + if(!isset($this->fonts[$fontkey])) + $this->AddFont($family,$style); + } + else + $this->Error('Undefined font: '.$family.' '.$style); + } + // Select it + $this->FontFamily = $family; + $this->FontStyle = $style; + $this->FontSizePt = $size; + $this->FontSize = $size/$this->k; + $this->CurrentFont = &$this->fonts[$fontkey]; + if ($this->fonts[$fontkey]['type']=='TTF') { $this->unifontSubset = true; } + else { $this->unifontSubset = false; } + if($this->page>0) + $this->_out(sprintf('BT /F%d %.2F Tf ET',$this->CurrentFont['i'],$this->FontSizePt)); +} + +function SetFontSize($size) +{ + // Set font size in points + if($this->FontSizePt==$size) + return; + $this->FontSizePt = $size; + $this->FontSize = $size/$this->k; + if($this->page>0) + $this->_out(sprintf('BT /F%d %.2F Tf ET',$this->CurrentFont['i'],$this->FontSizePt)); +} + +function AddLink() +{ + // Create a new internal link + $n = count($this->links)+1; + $this->links[$n] = array(0, 0); + return $n; +} + +function SetLink($link, $y=0, $page=-1) +{ + // Set destination of internal link + if($y==-1) + $y = $this->y; + if($page==-1) + $page = $this->page; + $this->links[$link] = array($page, $y); +} + +function Link($x, $y, $w, $h, $link) +{ + // Put a link on the page + $this->PageLinks[$this->page][] = array($x*$this->k, $this->hPt-$y*$this->k, $w*$this->k, $h*$this->k, $link); +} + +function Text($x, $y, $txt) +{ + // Output a string + $txt = (string)$txt; + if(!isset($this->CurrentFont)) + $this->Error('No font has been set'); + if ($this->unifontSubset) + { + $txt2 = '('.$this->_escape($this->UTF8ToUTF16BE($txt, false)).')'; + foreach($this->UTF8StringToArray($txt) as $uni) + $this->CurrentFont['subset'][$uni] = $uni; + } + else + $txt2 = '('.$this->_escape($txt).')'; + $s = sprintf('BT %.2F %.2F Td %s Tj ET',$x*$this->k,($this->h-$y)*$this->k,$txt2); + if($this->underline && $txt!='') + $s .= ' '.$this->_dounderline($x,$y,$txt); + if($this->ColorFlag) + $s = 'q '.$this->TextColor.' '.$s.' Q'; + $this->_out($s); +} + +function AcceptPageBreak() +{ + // Accept automatic page break or not + return $this->AutoPageBreak; +} + +function Cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='') +{ + // Output a cell + $txt = (string)$txt; + $k = $this->k; + if($this->y+$h>$this->PageBreakTrigger && !$this->InHeader && !$this->InFooter && $this->AcceptPageBreak()) + { + // Automatic page break + $x = $this->x; + $ws = $this->ws; + if($ws>0) + { + $this->ws = 0; + $this->_out('0 Tw'); + } + $this->AddPage($this->CurOrientation,$this->CurPageSize,$this->CurRotation); + $this->x = $x; + if($ws>0) + { + $this->ws = $ws; + $this->_out(sprintf('%.3F Tw',$ws*$k)); + } + } + if($w==0) + $w = $this->w-$this->rMargin-$this->x; + $s = ''; + if($fill || $border==1) + { + if($fill) + $op = ($border==1) ? 'B' : 'f'; + else + $op = 'S'; + $s = sprintf('%.2F %.2F %.2F %.2F re %s ',$this->x*$k,($this->h-$this->y)*$k,$w*$k,-$h*$k,$op); + } + if(is_string($border)) + { + $x = $this->x; + $y = $this->y; + if(strpos($border,'L')!==false) + $s .= sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-$y)*$k,$x*$k,($this->h-($y+$h))*$k); + if(strpos($border,'T')!==false) + $s .= sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-$y)*$k); + if(strpos($border,'R')!==false) + $s .= sprintf('%.2F %.2F m %.2F %.2F l S ',($x+$w)*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-($y+$h))*$k); + if(strpos($border,'B')!==false) + $s .= sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-($y+$h))*$k,($x+$w)*$k,($this->h-($y+$h))*$k); + } + if($txt!=='') + { + if(!isset($this->CurrentFont)) + $this->Error('No font has been set'); + if($align=='R') + $dx = $w-$this->cMargin-$this->GetStringWidth($txt); + elseif($align=='C') + $dx = ($w-$this->GetStringWidth($txt))/2; + else + $dx = $this->cMargin; + if($this->ColorFlag) + $s .= 'q '.$this->TextColor.' '; + // If multibyte, Tw has no effect - do word spacing using an adjustment before each space + if ($this->ws && $this->unifontSubset) { + foreach($this->UTF8StringToArray($txt) as $uni) + $this->CurrentFont['subset'][$uni] = $uni; + $space = $this->_escape($this->UTF8ToUTF16BE(' ', false)); + $s .= sprintf('BT 0 Tw %.2F %.2F Td [',($this->x+$dx)*$k,($this->h-($this->y+.5*$h+.3*$this->FontSize))*$k); + $t = explode(' ',$txt); + $numt = count($t); + for($i=0;$i<$numt;$i++) { + $tx = $t[$i]; + $tx = '('.$this->_escape($this->UTF8ToUTF16BE($tx, false)).')'; + $s .= sprintf('%s ',$tx); + if (($i+1)<$numt) { + $adj = -($this->ws*$this->k)*1000/$this->FontSizePt; + $s .= sprintf('%d(%s) ',$adj,$space); + } + } + $s .= '] TJ'; + $s .= ' ET'; + } + else { + if ($this->unifontSubset) + { + $txt2 = '('.$this->_escape($this->UTF8ToUTF16BE($txt, false)).')'; + foreach($this->UTF8StringToArray($txt) as $uni) + $this->CurrentFont['subset'][$uni] = $uni; + } + else + $txt2='('.$this->_escape($txt).')'; + $s .= sprintf('BT %.2F %.2F Td %s Tj ET',($this->x+$dx)*$k,($this->h-($this->y+.5*$h+.3*$this->FontSize))*$k,$txt2); + } + if($this->underline) + $s .= ' '.$this->_dounderline($this->x+$dx,$this->y+.5*$h+.3*$this->FontSize,$txt); + if($this->ColorFlag) + $s .= ' Q'; + if($link) + $this->Link($this->x+$dx,$this->y+.5*$h-.5*$this->FontSize,$this->GetStringWidth($txt),$this->FontSize,$link); + } + if($s) + $this->_out($s); + $this->lasth = $h; + if($ln>0) + { + // Go to next line + $this->y += $h; + if($ln==1) + $this->x = $this->lMargin; + } + else + $this->x += $w; +} + +function MultiCell($w, $h, $txt, $border=0, $align='J', $fill=false) +{ + // Output text with automatic or explicit line breaks + if(!isset($this->CurrentFont)) + $this->Error('No font has been set'); + $cw = &$this->CurrentFont['cw']; + if($w==0) + $w = $this->w-$this->rMargin-$this->x; + $wmax = ($w-2*$this->cMargin); + //$wmax = ($w-2*$this->cMargin)*1000/$this->FontSize; + $s = str_replace("\r",'',(string)$txt); + if ($this->unifontSubset) { + $nb=mb_strlen($s, 'utf-8'); + while($nb>0 && mb_substr($s,$nb-1,1,'utf-8')=="\n") $nb--; + } + else { + $nb = strlen($s); + if($nb>0 && $s[$nb-1]=="\n") + $nb--; + } + $b = 0; + if($border) + { + if($border==1) + { + $border = 'LTRB'; + $b = 'LRT'; + $b2 = 'LR'; + } + else + { + $b2 = ''; + if(strpos($border,'L')!==false) + $b2 .= 'L'; + if(strpos($border,'R')!==false) + $b2 .= 'R'; + $b = (strpos($border,'T')!==false) ? $b2.'T' : $b2; + } + } + $sep = -1; + $i = 0; + $j = 0; + $l = 0; + $ns = 0; + $nl = 1; + while($i<$nb) + { + // Get next character + if ($this->unifontSubset) { + $c = mb_substr($s,$i,1,'UTF-8'); + } + else { + $c=$s[$i]; + } + if($c=="\n") + { + // Explicit line break + if($this->ws>0) + { + $this->ws = 0; + $this->_out('0 Tw'); + } + if ($this->unifontSubset) { + $this->Cell($w,$h,mb_substr($s,$j,$i-$j,'UTF-8'),$b,2,$align,$fill); + } + else { + $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill); + } + $i++; + $sep = -1; + $j = $i; + $l = 0; + $ns = 0; + $nl++; + if($border && $nl==2) + $b = $b2; + continue; + } + if($c==' ') + { + $sep = $i; + $ls = $l; + $ns++; + } + + if ($this->unifontSubset) { $l += $this->GetStringWidth($c); } + else { $l += $cw[$c]*$this->FontSize/1000; } + + if($l>$wmax) + { + // Automatic line break + if($sep==-1) + { + if($i==$j) + $i++; + if($this->ws>0) + { + $this->ws = 0; + $this->_out('0 Tw'); + } + if ($this->unifontSubset) { + $this->Cell($w,$h,mb_substr($s,$j,$i-$j,'UTF-8'),$b,2,$align,$fill); + } + else { + $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill); + } + } + else + { + if($align=='J') + { + $this->ws = ($ns>1) ? ($wmax-$ls)/($ns-1) : 0; + $this->_out(sprintf('%.3F Tw',$this->ws*$this->k)); + } + if ($this->unifontSubset) { + $this->Cell($w,$h,mb_substr($s,$j,$sep-$j,'UTF-8'),$b,2,$align,$fill); + } + else { + $this->Cell($w,$h,substr($s,$j,$sep-$j),$b,2,$align,$fill); + } + $i = $sep+1; + } + $sep = -1; + $j = $i; + $l = 0; + $ns = 0; + $nl++; + if($border && $nl==2) + $b = $b2; + } + else + $i++; + } + // Last chunk + if($this->ws>0) + { + $this->ws = 0; + $this->_out('0 Tw'); + } + if($border && strpos($border,'B')!==false) + $b .= 'B'; + if ($this->unifontSubset) { + $this->Cell($w,$h,mb_substr($s,$j,$i-$j,'UTF-8'),$b,2,$align,$fill); + } + else { + $this->Cell($w,$h,substr($s,$j,$i-$j),$b,2,$align,$fill); + } + $this->x = $this->lMargin; +} + +function Write($h, $txt, $link='') +{ + // Output text in flowing mode + if(!isset($this->CurrentFont)) + $this->Error('No font has been set'); + $cw = &$this->CurrentFont['cw']; + $w = $this->w-$this->rMargin-$this->x; + $wmax = ($w-2*$this->cMargin); + $s = str_replace("\r",'',(string)$txt); + if ($this->unifontSubset) { + $nb = mb_strlen($s, 'UTF-8'); + if($nb==1 && $s==" ") { + $this->x += $this->GetStringWidth($s); + return; + } + } + else { + $nb = strlen($s); + } + $sep = -1; + $i = 0; + $j = 0; + $l = 0; + $nl = 1; + while($i<$nb) + { + // Get next character + if ($this->unifontSubset) { + $c = mb_substr($s,$i,1,'UTF-8'); + } + else { + $c = $s[$i]; + } + if($c=="\n") + { + // Explicit line break + if ($this->unifontSubset) { + $this->Cell($w,$h,mb_substr($s,$j,$i-$j,'UTF-8'),0,2,'',false,$link); + } + else { + $this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',false,$link); + } + $i++; + $sep = -1; + $j = $i; + $l = 0; + if($nl==1) + { + $this->x = $this->lMargin; + $w = $this->w-$this->rMargin-$this->x; + $wmax = ($w-2*$this->cMargin); + } + $nl++; + continue; + } + if($c==' ') + $sep = $i; + + if ($this->unifontSubset) { $l += $this->GetStringWidth($c); } + else { $l += $cw[$c]*$this->FontSize/1000; } + + if($l>$wmax) + { + // Automatic line break + if($sep==-1) + { + if($this->x>$this->lMargin) + { + // Move to next line + $this->x = $this->lMargin; + $this->y += $h; + $w = $this->w-$this->rMargin-$this->x; + $wmax = ($w-2*$this->cMargin); + $i++; + $nl++; + continue; + } + if($i==$j) + $i++; + if ($this->unifontSubset) { + $this->Cell($w,$h,mb_substr($s,$j,$i-$j,'UTF-8'),0,2,'',false,$link); + } + else { + $this->Cell($w,$h,substr($s,$j,$i-$j),0,2,'',false,$link); + } + } + else + { + if ($this->unifontSubset) { + $this->Cell($w,$h,mb_substr($s,$j,$sep-$j,'UTF-8'),0,2,'',false,$link); + } + else { + $this->Cell($w,$h,substr($s,$j,$sep-$j),0,2,'',false,$link); + } + $i = $sep+1; + } + $sep = -1; + $j = $i; + $l = 0; + if($nl==1) + { + $this->x = $this->lMargin; + $w = $this->w-$this->rMargin-$this->x; + $wmax = ($w-2*$this->cMargin); + } + $nl++; + } + else + $i++; + } + // Last chunk + if($i!=$j) { + if ($this->unifontSubset) { + $this->Cell($l,$h,mb_substr($s,$j,$i-$j,'UTF-8'),0,0,'',false,$link); + } + else { + $this->Cell($l,$h,substr($s,$j),0,0,'',false,$link); + } + } +} + +function Ln($h=null) +{ + // Line feed; default value is the last cell height + $this->x = $this->lMargin; + if($h===null) + $this->y += $this->lasth; + else + $this->y += $h; +} + +function Image($file, $x=null, $y=null, $w=0, $h=0, $type='', $link='') +{ + // Put an image on the page + if($file=='') + $this->Error('Image file name is empty'); + if(!isset($this->images[$file])) + { + // First use of this image, get info + if($type=='') + { + $pos = strrpos($file,'.'); + if(!$pos) + $this->Error('Image file has no extension and no type was specified: '.$file); + $type = substr($file,$pos+1); + } + $type = strtolower($type); + if($type=='jpeg') + $type = 'jpg'; + $mtd = '_parse'.$type; + if(!method_exists($this,$mtd)) + $this->Error('Unsupported image type: '.$type); + $info = $this->$mtd($file); + $info['i'] = count($this->images)+1; + $this->images[$file] = $info; + } + else + $info = $this->images[$file]; + + // Automatic width and height calculation if needed + if($w==0 && $h==0) + { + // Put image at 96 dpi + $w = -96; + $h = -96; + } + if($w<0) + $w = -$info['w']*72/$w/$this->k; + if($h<0) + $h = -$info['h']*72/$h/$this->k; + if($w==0) + $w = $h*$info['w']/$info['h']; + if($h==0) + $h = $w*$info['h']/$info['w']; + + // Flowing mode + if($y===null) + { + if($this->y+$h>$this->PageBreakTrigger && !$this->InHeader && !$this->InFooter && $this->AcceptPageBreak()) + { + // Automatic page break + $x2 = $this->x; + $this->AddPage($this->CurOrientation,$this->CurPageSize,$this->CurRotation); + $this->x = $x2; + } + $y = $this->y; + $this->y += $h; + } + + if($x===null) + $x = $this->x; + $this->_out(sprintf('q %.2F 0 0 %.2F %.2F %.2F cm /I%d Do Q',$w*$this->k,$h*$this->k,$x*$this->k,($this->h-($y+$h))*$this->k,$info['i'])); + if($link) + $this->Link($x,$y,$w,$h,$link); +} + +function GetPageWidth() +{ + // Get current page width + return $this->w; +} + +function GetPageHeight() +{ + // Get current page height + return $this->h; +} + +function GetX() +{ + // Get x position + return $this->x; +} + +function SetX($x) +{ + // Set x position + if($x>=0) + $this->x = $x; + else + $this->x = $this->w+$x; +} + +function GetY() +{ + // Get y position + return $this->y; +} + +function SetY($y, $resetX=true) +{ + // Set y position and optionally reset x + if($y>=0) + $this->y = $y; + else + $this->y = $this->h+$y; + if($resetX) + $this->x = $this->lMargin; +} + +function SetXY($x, $y) +{ + // Set x and y positions + $this->SetX($x); + $this->SetY($y,false); +} + +function Output($dest='', $name='', $isUTF8=false) +{ + // Output PDF to some destination + $this->Close(); + if(strlen($name)==1 && strlen($dest)!=1) + { + // Fix parameter order + $tmp = $dest; + $dest = $name; + $name = $tmp; + } + if($dest=='') + $dest = 'I'; + if($name=='') + $name = 'doc.pdf'; + switch(strtoupper($dest)) + { + case 'I': + // Send to standard output + $this->_checkoutput(); + if(PHP_SAPI!='cli') + { + // We send to a browser + header('Content-Type: application/pdf'); + header('Content-Disposition: inline; '.$this->_httpencode('filename',$name,$isUTF8)); + header('Cache-Control: private, max-age=0, must-revalidate'); + header('Pragma: public'); + } + echo ($this->buffer); + break; + case 'D': + // Download file + $this->_checkoutput(); + header('Content-Type: application/x-download'); + header('Content-Disposition: attachment; '.$this->_httpencode('filename',$name,$isUTF8)); + header('Cache-Control: private, max-age=0, must-revalidate'); + header('Pragma: public'); + echo ($this->buffer); + break; + case 'F': + // Save to local file + if(!file_put_contents($name,$this->buffer)) + $this->Error('Unable to create output file: '.$name); + break; + case 'S': + // Return as a string + return $this->buffer; + default: + $this->Error('Incorrect output destination: '.$dest); + } + return ''; +} + +/******************************************************************************* +* Protected methods * +*******************************************************************************/ + +protected function _dochecks() +{ + // Check availability of mbstring + if(!function_exists('mb_strlen')) + $this->Error('mbstring extension is not available'); + // Check mbstring overloading + if(ini_get('mbstring.func_overload') & 2) + $this->Error('mbstring overloading must be disabled'); +} + +protected function _checkoutput() +{ + if(PHP_SAPI!='cli') + { + if(headers_sent($file,$line)) + $this->Error("Some data has already been output, can't send PDF file (output started at $file:$line)"); + } + if(ob_get_length()) + { + // The output buffer is not empty + if(preg_match('/^(\xEF\xBB\xBF)?\s*$/',ob_get_contents())) + { + // It contains only a UTF-8 BOM and/or whitespace, let's clean it + ob_clean(); + } + else + $this->Error("Some data has already been output, can't send PDF file"); + } +} + +protected function _getpagesize($size) +{ + if(is_string($size)) + { + $size = strtolower($size); + if(!isset($this->StdPageSizes[$size])) + $this->Error('Unknown page size: '.$size); + $a = $this->StdPageSizes[$size]; + return array($a[0]/$this->k, $a[1]/$this->k); + } + else + { + if($size[0]>$size[1]) + return array($size[1], $size[0]); + else + return $size; + } +} + +protected function _beginpage($orientation, $size, $rotation) +{ + $this->page++; + $this->pages[$this->page] = ''; + $this->state = 2; + $this->x = $this->lMargin; + $this->y = $this->tMargin; + $this->FontFamily = ''; + // Check page size and orientation + if($orientation=='') + $orientation = $this->DefOrientation; + else + $orientation = strtoupper($orientation[0]); + if($size=='') + $size = $this->DefPageSize; + else + $size = $this->_getpagesize($size); + if($orientation!=$this->CurOrientation || $size[0]!=$this->CurPageSize[0] || $size[1]!=$this->CurPageSize[1]) + { + // New size or orientation + if($orientation=='P') + { + $this->w = $size[0]; + $this->h = $size[1]; + } + else + { + $this->w = $size[1]; + $this->h = $size[0]; + } + $this->wPt = $this->w*$this->k; + $this->hPt = $this->h*$this->k; + $this->PageBreakTrigger = $this->h-$this->bMargin; + $this->CurOrientation = $orientation; + $this->CurPageSize = $size; + } + if($orientation!=$this->DefOrientation || $size[0]!=$this->DefPageSize[0] || $size[1]!=$this->DefPageSize[1]) + $this->PageInfo[$this->page]['size'] = array($this->wPt, $this->hPt); + if($rotation!=0) + { + if($rotation%90!=0) + $this->Error('Incorrect rotation value: '.$rotation); + $this->CurRotation = $rotation; + $this->PageInfo[$this->page]['rotation'] = $rotation; + } +} + +protected function _endpage() +{ + $this->state = 1; +} + +protected function _loadfont($font) +{ + // Load a font definition file from the font directory + if(strpos($font,'/')!==false || strpos($font,"\\")!==false) + $this->Error('Incorrect font definition file name: '.$font); + include($this->fontpath.$font); + if(!isset($name)) + $this->Error('Could not include font definition file'); + if(isset($enc)) + $enc = strtolower($enc); + if(!isset($subsetted)) + $subsetted = false; + return get_defined_vars(); +} + +protected function _isascii($s) +{ + // Test if string is ASCII + $nb = strlen($s); + for($i=0;$i<$nb;$i++) + { + if(ord($s[$i])>127) + return false; + } + return true; +} + +protected function _httpencode($param, $value, $isUTF8) +{ + // Encode HTTP header field parameter + if($this->_isascii($value)) + return $param.'="'.$value.'"'; + if(!$isUTF8) + $value = utf8_encode($value); + if(strpos($_SERVER['HTTP_USER_AGENT'],'MSIE')!==false) + return $param.'="'.rawurlencode($value).'"'; + else + return $param."*=UTF-8''".rawurlencode($value); +} + +protected function _UTF8toUTF16($s) +{ + // Convert UTF-8 to UTF-16BE with BOM + $res = "\xFE\xFF"; + $nb = strlen($s); + $i = 0; + while($i<$nb) + { + $c1 = ord($s[$i++]); + if($c1>=224) + { + // 3-byte character + $c2 = ord($s[$i++]); + $c3 = ord($s[$i++]); + $res .= chr((($c1 & 0x0F)<<4) + (($c2 & 0x3C)>>2)); + $res .= chr((($c2 & 0x03)<<6) + ($c3 & 0x3F)); + } + elseif($c1>=192) + { + // 2-byte character + $c2 = ord($s[$i++]); + $res .= chr(($c1 & 0x1C)>>2); + $res .= chr((($c1 & 0x03)<<6) + ($c2 & 0x3F)); + } + else + { + // Single-byte character + $res .= "\0".chr($c1); + } + } + return $res; +} + +protected function _escape($s) +{ + // Escape special characters + if(strpos($s,'(')!==false || strpos($s,')')!==false || strpos($s,'\\')!==false || strpos($s,"\r")!==false) + return str_replace(array('\\','(',')',"\r"), array('\\\\','\\(','\\)','\\r'), $s); + else + return $s; +} + +protected function _textstring($s) +{ + // Format a text string + if(!$this->_isascii($s)) + $s = $this->_UTF8toUTF16($s); + return '('.$this->_escape($s).')'; +} + +protected function _dounderline($x, $y, $txt) +{ + // Underline text + $up = $this->CurrentFont['up']; + $ut = $this->CurrentFont['ut']; + $w = $this->GetStringWidth($txt)+$this->ws*substr_count($txt,' '); + return sprintf('%.2F %.2F %.2F %.2F re f',$x*$this->k,($this->h-($y-$up/1000*$this->FontSize))*$this->k,$w*$this->k,-$ut/1000*$this->FontSizePt); +} + +protected function _parsejpg($file) +{ + // Extract info from a JPEG file + $a = getimagesize($file); + if(!$a) + $this->Error('Missing or incorrect image file: '.$file); + if($a[2]!=2) + $this->Error('Not a JPEG file: '.$file); + if(!isset($a['channels']) || $a['channels']==3) + $colspace = 'DeviceRGB'; + elseif($a['channels']==4) + $colspace = 'DeviceCMYK'; + else + $colspace = 'DeviceGray'; + $bpc = isset($a['bits']) ? $a['bits'] : 8; + $data = file_get_contents($file); + return array('w'=>$a[0], 'h'=>$a[1], 'cs'=>$colspace, 'bpc'=>$bpc, 'f'=>'DCTDecode', 'data'=>$data); +} + +protected function _parsepng($file) +{ + // Extract info from a PNG file + $f = fopen($file,'rb'); + if(!$f) + $this->Error('Can\'t open image file: '.$file); + $info = $this->_parsepngstream($f,$file); + fclose($f); + return $info; +} + +protected function _parsepngstream($f, $file) +{ + // Check signature + if($this->_readstream($f,8)!=chr(137).'PNG'.chr(13).chr(10).chr(26).chr(10)) + $this->Error('Not a PNG file: '.$file); + + // Read header chunk + $this->_readstream($f,4); + if($this->_readstream($f,4)!='IHDR') + $this->Error('Incorrect PNG file: '.$file); + $w = $this->_readint($f); + $h = $this->_readint($f); + $bpc = ord($this->_readstream($f,1)); + if($bpc>8) + $this->Error('16-bit depth not supported: '.$file); + $ct = ord($this->_readstream($f,1)); + if($ct==0 || $ct==4) + $colspace = 'DeviceGray'; + elseif($ct==2 || $ct==6) + $colspace = 'DeviceRGB'; + elseif($ct==3) + $colspace = 'Indexed'; + else + $this->Error('Unknown color type: '.$file); + if(ord($this->_readstream($f,1))!=0) + $this->Error('Unknown compression method: '.$file); + if(ord($this->_readstream($f,1))!=0) + $this->Error('Unknown filter method: '.$file); + if(ord($this->_readstream($f,1))!=0) + $this->Error('Interlacing not supported: '.$file); + $this->_readstream($f,4); + $dp = '/Predictor 15 /Colors '.($colspace=='DeviceRGB' ? 3 : 1).' /BitsPerComponent '.$bpc.' /Columns '.$w; + + // Scan chunks looking for palette, transparency and image data + $pal = ''; + $trns = ''; + $data = ''; + do + { + $n = $this->_readint($f); + $type = $this->_readstream($f,4); + if($type=='PLTE') + { + // Read palette + $pal = $this->_readstream($f,$n); + $this->_readstream($f,4); + } + elseif($type=='tRNS') + { + // Read transparency info + $t = $this->_readstream($f,$n); + if($ct==0) + $trns = array(ord(substr($t,1,1))); + elseif($ct==2) + $trns = array(ord(substr($t,1,1)), ord(substr($t,3,1)), ord(substr($t,5,1))); + else + { + $pos = strpos($t,chr(0)); + if($pos!==false) + $trns = array($pos); + } + $this->_readstream($f,4); + } + elseif($type=='IDAT') + { + // Read image data block + $data .= $this->_readstream($f,$n); + $this->_readstream($f,4); + } + elseif($type=='IEND') + break; + else + $this->_readstream($f,$n+4); + } + while($n); + + if($colspace=='Indexed' && empty($pal)) + $this->Error('Missing palette in '.$file); + $info = array('w'=>$w, 'h'=>$h, 'cs'=>$colspace, 'bpc'=>$bpc, 'f'=>'FlateDecode', 'dp'=>$dp, 'pal'=>$pal, 'trns'=>$trns); + if($ct>=4) + { + // Extract alpha channel + if(!function_exists('gzuncompress')) + $this->Error('Zlib not available, can\'t handle alpha channel: '.$file); + $data = gzuncompress($data); + $color = ''; + $alpha = ''; + if($ct==4) + { + // Gray image + $len = 2*$w; + for($i=0;$i<$h;$i++) + { + $pos = (1+$len)*$i; + $color .= $data[$pos]; + $alpha .= $data[$pos]; + $line = substr($data,$pos+1,$len); + $color .= preg_replace('/(.)./s','$1',$line); + $alpha .= preg_replace('/.(.)/s','$1',$line); + } + } + else + { + // RGB image + $len = 4*$w; + for($i=0;$i<$h;$i++) + { + $pos = (1+$len)*$i; + $color .= $data[$pos]; + $alpha .= $data[$pos]; + $line = substr($data,$pos+1,$len); + $color .= preg_replace('/(.{3})./s','$1',$line); + $alpha .= preg_replace('/.{3}(.)/s','$1',$line); + } + } + unset($data); + $data = gzcompress($color); + $info['smask'] = gzcompress($alpha); + $this->WithAlpha = true; + if($this->PDFVersion<'1.4') + $this->PDFVersion = '1.4'; + } + $info['data'] = $data; + return $info; +} + +protected function _readstream($f, $n) +{ + // Read n bytes from stream + $res = ''; + while($n>0 && !feof($f)) + { + $s = fread($f,$n); + if($s===false) + $this->Error('Error while reading stream'); + $n -= strlen($s); + $res .= $s; + } + if($n>0) + $this->Error('Unexpected end of stream'); + return $res; +} + +protected function _readint($f) +{ + // Read a 4-byte integer from stream + $a = unpack('Ni',$this->_readstream($f,4)); + return $a['i']; +} + +protected function _parsegif($file) +{ + // Extract info from a GIF file (via PNG conversion) + if(!function_exists('imagepng')) + $this->Error('GD extension is required for GIF support'); + if(!function_exists('imagecreatefromgif')) + $this->Error('GD has no GIF read support'); + $im = imagecreatefromgif($file); + if(!$im) + $this->Error('Missing or incorrect image file: '.$file); + imageinterlace($im,0); + ob_start(); + imagepng($im); + $data = ob_get_clean(); + imagedestroy($im); + $f = fopen('php://temp','rb+'); + if(!$f) + $this->Error('Unable to create memory stream'); + fwrite($f,$data); + rewind($f); + $info = $this->_parsepngstream($f,$file); + fclose($f); + return $info; +} + +protected function _out($s) +{ + // Add a line to the document + if($this->state==2) + $this->pages[$this->page] .= $s."\n"; + elseif($this->state==1) + $this->_put($s); + elseif($this->state==0) + $this->Error('No page has been added yet'); + elseif($this->state==3) + $this->Error('The document is closed'); +} + +protected function _put($s) +{ + $this->buffer .= $s."\n"; +} + +protected function _getoffset() +{ + return strlen($this->buffer); +} + +protected function _newobj($n=null) +{ + // Begin a new object + if($n===null) + $n = ++$this->n; + $this->offsets[$n] = $this->_getoffset(); + $this->_put($n.' 0 obj'); +} + +protected function _putstream($data) +{ + $this->_put('stream'); + $this->_put($data); + $this->_put('endstream'); +} + +protected function _putstreamobject($data) +{ + if($this->compress) + { + $entries = '/Filter /FlateDecode '; + $data = gzcompress($data); + } + else + $entries = ''; + $entries .= '/Length '.strlen($data); + $this->_newobj(); + $this->_put('<<'.$entries.'>>'); + $this->_putstream($data); + $this->_put('endobj'); +} + +protected function _putpage($n) +{ + $this->_newobj(); + $this->_put('<_put('/Parent 1 0 R'); + if(isset($this->PageInfo[$n]['size'])) + $this->_put(sprintf('/MediaBox [0 0 %.2F %.2F]',$this->PageInfo[$n]['size'][0],$this->PageInfo[$n]['size'][1])); + if(isset($this->PageInfo[$n]['rotation'])) + $this->_put('/Rotate '.$this->PageInfo[$n]['rotation']); + $this->_put('/Resources 2 0 R'); + if(isset($this->PageLinks[$n])) + { + // Links + $annots = '/Annots ['; + foreach($this->PageLinks[$n] as $pl) + { + $rect = sprintf('%.2F %.2F %.2F %.2F',$pl[0],$pl[1],$pl[0]+$pl[2],$pl[1]-$pl[3]); + $annots .= '<_textstring($pl[4]).'>>>>'; + else + { + $l = $this->links[$pl[4]]; + if(isset($this->PageInfo[$l[0]]['size'])) + $h = $this->PageInfo[$l[0]]['size'][1]; + else + $h = ($this->DefOrientation=='P') ? $this->DefPageSize[1]*$this->k : $this->DefPageSize[0]*$this->k; + $annots .= sprintf('/Dest [%d 0 R /XYZ 0 %.2F null]>>',$this->PageInfo[$l[0]]['n'],$h-$l[1]*$this->k); + } + } + $this->_put($annots.']'); + } + if($this->WithAlpha) + $this->_put('/Group <>'); + $this->_put('/Contents '.($this->n+1).' 0 R>>'); + $this->_put('endobj'); + // Page content + if(!empty($this->AliasNbPages)) { + $alias = $this->UTF8ToUTF16BE($this->AliasNbPages, false); + $r = $this->UTF8ToUTF16BE($this->page, false); + $this->pages[$n] = str_replace($alias,$r,$this->pages[$n]); + // Now repeat for no pages in non-subset fonts + + $this->pages[$n] = str_replace($this->AliasNbPages,$this->page,$this->pages[$n]); + } + $this->_putstreamobject($this->pages[$n]); +} + +protected function _putpages() +{ + $nb = $this->page; + for($n=1;$n<=$nb;$n++) + $this->PageInfo[$n]['n'] = $this->n+1+2*($n-1); + for($n=1;$n<=$nb;$n++) + $this->_putpage($n); + // Pages root + $this->_newobj(1); + $this->_put('<PageInfo[$n]['n'].' 0 R '; + $this->_put($kids.']'); + $this->_put('/Count '.$nb); + if($this->DefOrientation=='P') + { + $w = $this->DefPageSize[0]; + $h = $this->DefPageSize[1]; + } + else + { + $w = $this->DefPageSize[1]; + $h = $this->DefPageSize[0]; + } + $this->_put(sprintf('/MediaBox [0 0 %.2F %.2F]',$w*$this->k,$h*$this->k)); + $this->_put('>>'); + $this->_put('endobj'); +} + +protected function _putfonts() +{ + foreach($this->FontFiles as $file=>$info) + { + if (!isset($info['type']) || $info['type']!='TTF') { + // Font file embedding + $this->_newobj(); + $this->FontFiles[$file]['n'] = $this->n; + $font = file_get_contents($this->fontpath.$file,true); + if(!$font) + $this->Error('Font file not found: '.$file); + $compressed = (substr($file,-2)=='.z'); + if(!$compressed && isset($info['length2'])) + $font = substr($font,6,$info['length1']).substr($font,6+$info['length1']+6,$info['length2']); + $this->_put('<_put('/Filter /FlateDecode'); + $this->_put('/Length1 '.$info['length1']); + if(isset($info['length2'])) + $this->_put('/Length2 '.$info['length2'].' /Length3 0'); + $this->_put('>>'); + $this->_putstream($font); + $this->_put('endobj'); + } + } + foreach($this->fonts as $k=>$font) + { + // Encoding + if(isset($font['diff'])) + { + if(!isset($this->encodings[$font['enc']])) + { + $this->_newobj(); + $this->_put('<>'); + $this->_put('endobj'); + $this->encodings[$font['enc']] = $this->n; + } + } + // ToUnicode CMap + if(isset($font['uv'])) + { + if(isset($font['enc'])) + $cmapkey = $font['enc']; + else + $cmapkey = $font['name']; + if(!isset($this->cmaps[$cmapkey])) + { + $cmap = $this->_tounicodecmap($font['uv']); + $this->_putstreamobject($cmap); + $this->cmaps[$cmapkey] = $this->n; + } + } + // Font object + $type = $font['type']; + $name = $font['name']; + if($type=='Core') + { + // Core font + $this->fonts[$k]['n'] = $this->n+1; + $this->_newobj(); + $this->_put('<_put('/BaseFont /'.$name); + $this->_put('/Subtype /Type1'); + if($name!='Symbol' && $name!='ZapfDingbats') + $this->_put('/Encoding /WinAnsiEncoding'); + if(isset($font['uv'])) + $this->_put('/ToUnicode '.$this->cmaps[$cmapkey].' 0 R'); + $this->_put('>>'); + $this->_put('endobj'); + } + elseif($type=='Type1' || $type=='TrueType') + { + // Additional Type1 or TrueType/OpenType font + if(isset($font['subsetted']) && $font['subsetted']) + $name = 'AAAAAA+'.$name; + $this->fonts[$k]['n'] = $this->n+1; + $this->_newobj(); + $this->_put('<_put('/BaseFont /'.$name); + $this->_put('/Subtype /'.$type); + $this->_put('/FirstChar 32 /LastChar 255'); + $this->_put('/Widths '.($this->n+1).' 0 R'); + $this->_put('/FontDescriptor '.($this->n+2).' 0 R'); + + if($font['enc']) + { + if(isset($font['diff'])) + $this->_put('/Encoding '.$this->encodings[$font['enc']].' 0 R'); + else + $this->_put('/Encoding /WinAnsiEncoding'); + } + + if(isset($font['uv'])) + $this->_put('/ToUnicode '.$this->cmaps[$cmapkey].' 0 R'); + $this->_put('>>'); + $this->_put('endobj'); + // Widths + $this->_newobj(); + $cw = &$font['cw']; + $s = '['; + for($i=32;$i<=255;$i++) + $s .= $cw[chr($i)].' '; + $this->_put($s.']'); + $this->_put('endobj'); + // Descriptor + $this->_newobj(); + $s = '<$v) + $s .= ' /'.$k.' '.$v; + + if(!empty($font['file'])) + $s .= ' /FontFile'.($type=='Type1' ? '' : '2').' '.$this->FontFiles[$font['file']]['n'].' 0 R'; + $this->_put($s.'>>'); + $this->_put('endobj'); + } + // TrueType embedded SUBSETS or FULL + else if ($type=='TTF') { + $this->fonts[$k]['n']=$this->n+1; + require_once($this->fontpath.'unifont/ttfonts.php'); + $ttf = new TTFontFile(); + $fontname = 'MPDFAA'.'+'.$font['name']; + $subset = $font['subset']; + unset($subset[0]); + $ttfontstream = $ttf->makeSubset($font['ttffile'], $subset); + $ttfontsize = strlen($ttfontstream); + $fontstream = gzcompress($ttfontstream); + $codeToGlyph = $ttf->codeToGlyph; + unset($codeToGlyph[0]); + + // Type0 Font + // A composite font - a font composed of other fonts, organized hierarchically + $this->_newobj(); + $this->_put('<_put('/Subtype /Type0'); + $this->_put('/BaseFont /'.$fontname.''); + $this->_put('/Encoding /Identity-H'); + $this->_put('/DescendantFonts ['.($this->n + 1).' 0 R]'); + $this->_put('/ToUnicode '.($this->n + 2).' 0 R'); + $this->_put('>>'); + $this->_put('endobj'); + + // CIDFontType2 + // A CIDFont whose glyph descriptions are based on TrueType font technology + $this->_newobj(); + $this->_put('<_put('/Subtype /CIDFontType2'); + $this->_put('/BaseFont /'.$fontname.''); + $this->_put('/CIDSystemInfo '.($this->n + 2).' 0 R'); + $this->_put('/FontDescriptor '.($this->n + 3).' 0 R'); + if (isset($font['desc']['MissingWidth'])){ + $this->_out('/DW '.$font['desc']['MissingWidth'].''); + } + + $this->_putTTfontwidths($font, $ttf->maxUni); + + $this->_put('/CIDToGIDMap '.($this->n + 4).' 0 R'); + $this->_put('>>'); + $this->_put('endobj'); + + // ToUnicode + $this->_newobj(); + $toUni = "/CIDInit /ProcSet findresource begin\n"; + $toUni .= "12 dict begin\n"; + $toUni .= "begincmap\n"; + $toUni .= "/CIDSystemInfo\n"; + $toUni .= "<_put('<>'); + $this->_putstream($toUni); + $this->_put('endobj'); + + // CIDSystemInfo dictionary + $this->_newobj(); + $this->_put('<_put('/Ordering (UCS)'); + $this->_put('/Supplement 0'); + $this->_put('>>'); + $this->_put('endobj'); + + // Font descriptor + $this->_newobj(); + $this->_put('<_put('/FontName /'.$fontname); + foreach($font['desc'] as $kd=>$v) { + if ($kd == 'Flags') { $v = $v | 4; $v = $v & ~32; } // SYMBOLIC font flag + $this->_out(' /'.$kd.' '.$v); + } + $this->_put('/FontFile2 '.($this->n + 2).' 0 R'); + $this->_put('>>'); + $this->_put('endobj'); + + // Embed CIDToGIDMap + // A specification of the mapping from CIDs to glyph indices + $cidtogidmap = ''; + $cidtogidmap = str_pad('', 256*256*2, "\x00"); + foreach($codeToGlyph as $cc=>$glyph) { + $cidtogidmap[$cc*2] = chr($glyph >> 8); + $cidtogidmap[$cc*2 + 1] = chr($glyph & 0xFF); + } + $cidtogidmap = gzcompress($cidtogidmap); + $this->_newobj(); + $this->_put('<_put('/Filter /FlateDecode'); + $this->_put('>>'); + $this->_putstream($cidtogidmap); + $this->_put('endobj'); + + //Font file + $this->_newobj(); + $this->_put('<_put('/Filter /FlateDecode'); + $this->_put('/Length1 '.$ttfontsize); + $this->_put('>>'); + $this->_putstream($fontstream); + $this->_put('endobj'); + unset($ttf); + } + else + { + // Allow for additional types + $this->fonts[$k]['n'] = $this->n+1; + $mtd = '_put'.strtolower($type); + if(!method_exists($this,$mtd)) + $this->Error('Unsupported font type: '.$type); + $this->$mtd($font); + } + } +} + +protected function _putTTfontwidths(&$font, $maxUni) { + if (file_exists($font['unifilename'].'.cw127.php')) { + include($font['unifilename'].'.cw127.php') ; + $startcid = 128; + } + else { + $rangeid = 0; + $range = []; + $prevcid = -2; + $prevwidth = -1; + $interval = false; + $startcid = 1; + } + $cwlen = $maxUni + 1; + + // for each character + for ($cid=$startcid; $cid<$cwlen; $cid++) { + if ($cid==128 && (!file_exists($font['unifilename'].'.cw127.php'))) { + if (is_writable(dirname($this->fontpath.'unifont/x'))) { + $fh = fopen($font['unifilename'].'.cw127.php',"wb"); + $cw127='"; + fwrite($fh,$cw127,strlen($cw127)); + fclose($fh); + } + } + if ((!isset($font['cw'][$cid*2]) || !isset($font['cw'][$cid*2+1])) || + ($font['cw'][$cid*2] == "\00" && $font['cw'][$cid*2+1] == "\00")) { continue; } + + $width = (ord($font['cw'][$cid*2]) << 8) + ord($font['cw'][$cid*2+1]); + if ($width == 65535) { $width = 0; } + if ($cid > 255 && (!isset($font['subset'][$cid]) || !$font['subset'][$cid])) { continue; } + if (!isset($font['dw']) || (isset($font['dw']) && $width != $font['dw'])) { + if ($cid == ($prevcid + 1)) { + if ($width == $prevwidth) { + if ($width == $range[$rangeid][0]) { + $range[$rangeid][] = $width; + } + else { + array_pop($range[$rangeid]); + // new range + $rangeid = $prevcid; + $range[$rangeid] = []; + $range[$rangeid][] = $prevwidth; + $range[$rangeid][] = $width; + } + $interval = true; + $range[$rangeid]['interval'] = true; + } else { + if ($interval) { + // new range + $rangeid = $cid; + $range[$rangeid] = []; + $range[$rangeid][] = $width; + } + else { $range[$rangeid][] = $width; } + $interval = false; + } + } else { + $rangeid = $cid; + $range[$rangeid] = []; + $range[$rangeid][] = $width; + $interval = false; + } + $prevcid = $cid; + $prevwidth = $width; + } + } + $prevk = -1; + $nextk = -1; + $prevint = false; + foreach ($range as $k => $ws) { + $cws = count($ws); + if (($k == $nextk) AND (!$prevint) AND ((!isset($ws['interval'])) OR ($cws < 4))) { + if (isset($range[$k]['interval'])) { unset($range[$k]['interval']); } + $range[$prevk] = array_merge($range[$prevk], $range[$k]); + unset($range[$k]); + } + else { $prevk = $k; } + $nextk = $k + $cws; + if (isset($ws['interval'])) { + if ($cws > 3) { $prevint = true; } + else { $prevint = false; } + unset($range[$k]['interval']); + --$nextk; + } + else { $prevint = false; } + } + $w = ''; + foreach ($range as $k => $ws) { + if (count(array_count_values($ws)) == 1) { $w .= ' '.$k.' '.($k + count($ws) - 1).' '.$ws[0]; } + else { $w .= ' '.$k.' [ '.implode(' ', $ws).' ]' . "\n"; } + } + $this->_out('/W ['.$w.' ]'); +} + +protected function _tounicodecmap($uv) +{ + $ranges = ''; + $nbr = 0; + $chars = ''; + $nbc = 0; + foreach($uv as $c=>$v) + { + if(is_array($v)) + { + $ranges .= sprintf("<%02X> <%02X> <%04X>\n",$c,$c+$v[1]-1,$v[0]); + $nbr++; + } + else + { + $chars .= sprintf("<%02X> <%04X>\n",$c,$v); + $nbc++; + } + } + $s = "/CIDInit /ProcSet findresource begin\n"; + $s .= "12 dict begin\n"; + $s .= "begincmap\n"; + $s .= "/CIDSystemInfo\n"; + $s .= "<0) + { + $s .= "$nbr beginbfrange\n"; + $s .= $ranges; + $s .= "endbfrange\n"; + } + if($nbc>0) + { + $s .= "$nbc beginbfchar\n"; + $s .= $chars; + $s .= "endbfchar\n"; + } + $s .= "endcmap\n"; + $s .= "CMapName currentdict /CMap defineresource pop\n"; + $s .= "end\n"; + $s .= "end"; + return $s; +} + +protected function _putimages() +{ + foreach(array_keys($this->images) as $file) + { + $this->_putimage($this->images[$file]); + unset($this->images[$file]['data']); + unset($this->images[$file]['smask']); + } +} + +protected function _putimage(&$info) +{ + $this->_newobj(); + $info['n'] = $this->n; + $this->_put('<_put('/Subtype /Image'); + $this->_put('/Width '.$info['w']); + $this->_put('/Height '.$info['h']); + if($info['cs']=='Indexed') + $this->_put('/ColorSpace [/Indexed /DeviceRGB '.(strlen($info['pal'])/3-1).' '.($this->n+1).' 0 R]'); + else + { + $this->_put('/ColorSpace /'.$info['cs']); + if($info['cs']=='DeviceCMYK') + $this->_put('/Decode [1 0 1 0 1 0 1 0]'); + } + $this->_put('/BitsPerComponent '.$info['bpc']); + if(isset($info['f'])) + $this->_put('/Filter /'.$info['f']); + if(isset($info['dp'])) + $this->_put('/DecodeParms <<'.$info['dp'].'>>'); + if(isset($info['trns']) && is_array($info['trns'])) + { + $trns = ''; + for($i=0;$i_put('/Mask ['.$trns.']'); + } + if(isset($info['smask'])) + $this->_put('/SMask '.($this->n+1).' 0 R'); + $this->_put('/Length '.strlen($info['data']).'>>'); + $this->_putstream($info['data']); + $this->_put('endobj'); + // Soft mask + if(isset($info['smask'])) + { + $dp = '/Predictor 15 /Colors 1 /BitsPerComponent 8 /Columns '.$info['w']; + $smask = array('w'=>$info['w'], 'h'=>$info['h'], 'cs'=>'DeviceGray', 'bpc'=>8, 'f'=>$info['f'], 'dp'=>$dp, 'data'=>$info['smask']); + $this->_putimage($smask); + } + // Palette + if($info['cs']=='Indexed') + $this->_putstreamobject($info['pal']); +} + +protected function _putxobjectdict() +{ + foreach($this->images as $image) + $this->_put('/I'.$image['i'].' '.$image['n'].' 0 R'); +} + +protected function _putresourcedict() +{ + $this->_put('/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]'); + $this->_put('/Font <<'); + foreach($this->fonts as $font) + $this->_put('/F'.$font['i'].' '.$font['n'].' 0 R'); + $this->_put('>>'); + $this->_put('/XObject <<'); + $this->_putxobjectdict(); + $this->_put('>>'); +} + +protected function _putresources() +{ + $this->_putfonts(); + $this->_putimages(); + // Resource dictionary + $this->_newobj(2); + $this->_put('<<'); + $this->_putresourcedict(); + $this->_put('>>'); + $this->_put('endobj'); +} + +protected function _putinfo() +{ + $this->metadata['Producer'] = 'tFPDF '.tFPDF_VERSION; + $this->metadata['CreationDate'] = 'D:'.@date('YmdHis'); + foreach($this->metadata as $key=>$value) + $this->_put('/'.$key.' '.$this->_textstring($value)); +} + +protected function _putcatalog() +{ + $n = $this->PageInfo[1]['n']; + $this->_put('/Type /Catalog'); + $this->_put('/Pages 1 0 R'); + if($this->ZoomMode=='fullpage') + $this->_put('/OpenAction ['.$n.' 0 R /Fit]'); + elseif($this->ZoomMode=='fullwidth') + $this->_put('/OpenAction ['.$n.' 0 R /FitH null]'); + elseif($this->ZoomMode=='real') + $this->_put('/OpenAction ['.$n.' 0 R /XYZ null null 1]'); + elseif(!is_string($this->ZoomMode)) + $this->_put('/OpenAction ['.$n.' 0 R /XYZ null null '.sprintf('%.2F',$this->ZoomMode/100).']'); + if($this->LayoutMode=='single') + $this->_put('/PageLayout /SinglePage'); + elseif($this->LayoutMode=='continuous') + $this->_put('/PageLayout /OneColumn'); + elseif($this->LayoutMode=='two') + $this->_put('/PageLayout /TwoColumnLeft'); +} + +protected function _putheader() +{ + $this->_put('%PDF-'.$this->PDFVersion); +} + +protected function _puttrailer() +{ + $this->_put('/Size '.($this->n+1)); + $this->_put('/Root '.$this->n.' 0 R'); + $this->_put('/Info '.($this->n-1).' 0 R'); +} + +protected function _enddoc() +{ + $this->_putheader(); + $this->_putpages(); + $this->_putresources(); + // Info + $this->_newobj(); + $this->_put('<<'); + $this->_putinfo(); + $this->_put('>>'); + $this->_put('endobj'); + // Catalog + $this->_newobj(); + $this->_put('<<'); + $this->_putcatalog(); + $this->_put('>>'); + $this->_put('endobj'); + // Cross-ref + $offset = $this->_getoffset(); + $this->_put('xref'); + $this->_put('0 '.($this->n+1)); + $this->_put('0000000000 65535 f '); + for($i=1;$i<=$this->n;$i++) + $this->_put(sprintf('%010d 00000 n ',$this->offsets[$i])); + // Trailer + $this->_put('trailer'); + $this->_put('<<'); + $this->_puttrailer(); + $this->_put('>>'); + $this->_put('startxref'); + $this->_put($offset); + $this->_put('%%EOF'); + $this->state = 3; +} + +// ********* NEW FUNCTIONS ********* +// Converts UTF-8 strings to UTF16-BE. +protected function UTF8ToUTF16BE($str, $setbom=true) { + $outstr = ""; + if ($setbom) { + $outstr .= "\xFE\xFF"; // Byte Order Mark (BOM) + } + $outstr .= mb_convert_encoding($str, 'UTF-16BE', 'UTF-8'); + return $outstr; +} + +// Converts UTF-8 strings to codepoints array +protected function UTF8StringToArray($str) { + $out = []; + $len = strlen($str); + for ($i = 0; $i < $len; $i++) { + $uni = -1; + $h = ord($str[$i]); + if ( $h <= 0x7F ) + $uni = $h; + elseif ( $h >= 0xC2 ) { + if ( ($h <= 0xDF) && ($i < $len -1) ) + $uni = ($h & 0x1F) << 6 | (ord($str[++$i]) & 0x3F); + elseif ( ($h <= 0xEF) && ($i < $len -2) ) + $uni = ($h & 0x0F) << 12 | (ord($str[++$i]) & 0x3F) << 6 + | (ord($str[++$i]) & 0x3F); + elseif ( ($h <= 0xF4) && ($i < $len -3) ) + $uni = ($h & 0x0F) << 18 | (ord($str[++$i]) & 0x3F) << 12 + | (ord($str[++$i]) & 0x3F) << 6 + | (ord($str[++$i]) & 0x3F); + } + if ($uni >= 0) { + $out[] = $uni; + } + } + return $out; +} + + + +} +?> diff --git a/app/api/Twilio/Base/BaseClient.php b/app/api/Twilio/Base/BaseClient.php new file mode 100755 index 0000000..c7f6033 --- /dev/null +++ b/app/api/Twilio/Base/BaseClient.php @@ -0,0 +1,388 @@ +environment = $environment ?: \getenv(); + + $this->username = $this->getArg($username, self::ENV_ACCOUNT_SID); + $this->password = $this->getArg($password, self::ENV_AUTH_TOKEN); + $this->region = $this->getArg($region, self::ENV_REGION); + $this->edge = $this->getArg(null, self::ENV_EDGE); + $this->logLevel = $this->getArg(null, self::ENV_LOG); + $this->userAgentExtensions = $userAgentExtensions ?: []; + + if (!$this->username || !$this->password) { + throw new ConfigurationException('Credentials are required to create a Client'); + } + + $this->accountSid = $accountSid ?: $this->username; + + if ($httpClient) { + $this->httpClient = $httpClient; + } else { + $this->httpClient = new CurlClient(); + } + } + + /** + * Determines argument value accounting for environment variables. + * + * @param string $arg The constructor argument + * @param string $envVar The environment variable name + * @return ?string Argument value + */ + public function getArg(?string $arg, string $envVar): ?string + { + if ($arg) { + return $arg; + } + + if (\array_key_exists($envVar, $this->environment)) { + return $this->environment[$envVar]; + } + + return null; + } + + /** + * Makes a request to the Twilio API using the configured http client + * Authentication information is automatically added if none is provided + * + * @param string $method HTTP Method + * @param string $uri Fully qualified url + * @param string[] $params Query string parameters + * @param string[] $data POST body data + * @param string[] $headers HTTP Headers + * @param string $username User for Authentication + * @param string $password Password for Authentication + * @param int $timeout Timeout in seconds + * @return \Twilio\Http\Response Response from the Twilio API + */ + public function request( + string $method, + string $uri, + array $params = [], + array $data = [], + array $headers = [], + string $username = null, + string $password = null, + int $timeout = null + ): \Twilio\Http\Response{ + $username = $username ?: $this->username; + $password = $password ?: $this->password; + $logLevel = (getenv('DEBUG_HTTP_TRAFFIC') === 'true' ? 'debug' : $this->getLogLevel()); + + $headers['User-Agent'] = 'twilio-php/' . VersionInfo::string() . + ' (' . php_uname("s") . ' ' . php_uname("m") . ')' . + ' PHP/' . PHP_VERSION; + $headers['Accept-Charset'] = 'utf-8'; + + if ($this->userAgentExtensions) { + $headers['User-Agent'] .= ' ' . implode(' ', $this->userAgentExtensions); + } + + if (!\array_key_exists('Accept', $headers)) { + $headers['Accept'] = 'application/json'; + } + + $uri = $this->buildUri($uri); + + if ($logLevel === 'debug') { + error_log('-- BEGIN Twilio API Request --'); + error_log('Request Method: ' . $method); + $u = parse_url($uri); + if (isset($u['path'])) { + error_log('Request URL: ' . $u['path']); + } + if (isset($u['query']) && strlen($u['query']) > 0) { + error_log('Query Params: ' . $u['query']); + } + error_log('Request Headers: '); + foreach ($headers as $key => $value) { + if (strpos(strtolower($key), 'authorization') === false) { + error_log("$key: $value"); + } + } + error_log('-- END Twilio API Request --'); + } + + $response = $this->getHttpClient()->request( + $method, + $uri, + $params, + $data, + $headers, + $username, + $password, + $timeout + ); + + if ($logLevel === 'debug') { + error_log('Status Code: ' . $response->getStatusCode()); + error_log('Response Headers:'); + $responseHeaders = $response->getHeaders(); + foreach ($responseHeaders as $key => $value) { + error_log("$key: $value"); + } + } + + return $response; + } + + /** + * Build the final request uri + * + * @param string $uri The original request uri + * @return string Request uri + */ + public function buildUri(string $uri): string + { + if ($this->region == null && $this->edge == null) { + return $uri; + } + + $parsedUrl = \parse_url($uri); + $pieces = \explode('.', $parsedUrl['host']); + $product = $pieces[0]; + $domain = \implode('.', \array_slice($pieces, -2)); + $newEdge = $this->edge; + $newRegion = $this->region; + if (count($pieces) == 4) { // product.region.twilio.com + $newRegion = $newRegion ?: $pieces[1]; + } elseif (count($pieces) == 5) { // product.edge.region.twilio.com + $newEdge = $newEdge ?: $pieces[1]; + $newRegion = $newRegion ?: $pieces[2]; + } + + if ($newEdge != null && $newRegion == null) { + $newRegion = self::DEFAULT_REGION; + } + + $parsedUrl['host'] = \implode('.', \array_filter([$product, $newEdge, $newRegion, $domain])); + return RequestValidator::unparse_url($parsedUrl); + } + + /** + * Magic getter to lazy load domains + * + * @param string $name Domain to return + * @return \Twilio\Domain The requested domain + * @throws TwilioException For unknown domains + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown domain ' . $name); + } + + /** + * Magic call to lazy load contexts + * + * @param string $name Context to return + * @param mixed[] $arguments Context to return + * @return \Twilio\InstanceContext The requested context + * @throws TwilioException For unknown contexts + */ + public function __call(string $name, array $arguments) + { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Client ' . $this->getAccountSid() . ']'; + } + + /** + * Validates connection to new SSL certificate endpoint + * + * @param CurlClient $client + * @throws TwilioException if request fails + */ + public function validateSslCertificate(CurlClient $client): void + { + $response = $client->request('GET', 'https://api.twilio.com:8443'); + + if ($response->getStatusCode() < 200 || $response->getStatusCode() > 300) { + throw new TwilioException('Failed to validate SSL certificate'); + } + } + + /** + * @return \Twilio\Rest\Api\V2010\AccountContext Account provided as the + * authenticating account + */ + public function getAccount(): \Twilio\Rest\Api\V2010\AccountContext + { + return $this->api->v2010->account; + } + + /** + * Retrieve the Username + * + * @return string Current Username + */ + public function getUsername(): string + { + return $this->username; + } + + /** + * Retrieve the Password + * + * @return string Current Password + */ + public function getPassword(): string + { + return $this->password; + } + + /** + * Retrieve the AccountSid + * + * @return string Current AccountSid + */ + public function getAccountSid(): string + { + return $this->accountSid; + } + + /** + * Retrieve the Region + * + * @return string Current Region + */ + public function getRegion(): string + { + return $this->region; + } + + /** + * Retrieve the Edge + * + * @return string Current Edge + */ + public function getEdge(): string + { + return $this->edge; + } + + /** + * Set Edge + * + * @param string $uri Edge to use, unsets the Edge when called with no arguments + */ + public function setEdge(string $edge = null): void + { + $this->edge = $this->getArg($edge, self::ENV_EDGE); + } + + /** + * Retrieve the HttpClient + * + * @return HttpClient Current HttpClient + */ + public function getHttpClient(): HttpClient + { + return $this->httpClient; + } + + /** + * Set the HttpClient + * + * @param HttpClient $httpClient HttpClient to use + */ + public function setHttpClient(HttpClient $httpClient): void + { + $this->httpClient = $httpClient; + } + + /** + * Retrieve the log level + * + * @return ?string Current log level + */ + public function getLogLevel(): ?string + { + return $this->logLevel; + } + + /** + * Set log level to debug + * + * @param string $logLevel log level to use + */ + public function setLogLevel(string $logLevel = null): void + { + $this->logLevel = $this->getArg($logLevel, self::ENV_LOG); + } +} diff --git a/app/api/Twilio/Base/PhoneNumberCapabilities.php b/app/api/Twilio/Base/PhoneNumberCapabilities.php new file mode 100755 index 0000000..0344d39 --- /dev/null +++ b/app/api/Twilio/Base/PhoneNumberCapabilities.php @@ -0,0 +1,80 @@ +mms = Values::array_get($capabilities, 'mms', "false"); + $this->sms = Values::array_get($capabilities, 'sms', "false"); + $this->voice = Values::array_get($capabilities, 'voice', "false"); + $this->fax = Values::array_get($capabilities, 'fax', "false"); + } + + /** + * Access the mms + */ + public function getMms(): bool + { + return $this->mms; + } + + /** + * Access the sms + */ + public function getSms(): bool + { + return $this->sms; + } + + /** + * Access the voice + */ + public function getVoice(): bool + { + return $this->voice; + } + + /** + * Access the fax + */ + public function getFax(): bool + { + return $this->fax; + } + + public function __get(string $name) + { + if (\property_exists($this, $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + throw new TwilioException('Unknown subresource ' . $name); + } + + public function __toString(): string + { + return "[Twilio.Base.PhoneNumberCapabilities " . + "( + mms: " . json_encode($this->mms) . ", + sms: " . json_encode($this->sms) . ", + voice: " . json_encode($this->voice) . ", + fax: " . json_encode($this->fax) . " + )]"; + } +} diff --git a/app/api/Twilio/Deserialize.php b/app/api/Twilio/Deserialize.php new file mode 100755 index 0000000..b091f17 --- /dev/null +++ b/app/api/Twilio/Deserialize.php @@ -0,0 +1,51 @@ + 0) { + return new PhoneNumberCapabilities($arr); + } + } + } catch (\Exception $e) { + // no-op + } + + return $arr; + } +} diff --git a/app/api/Twilio/Domain.php b/app/api/Twilio/Domain.php new file mode 100755 index 0000000..1b06aac --- /dev/null +++ b/app/api/Twilio/Domain.php @@ -0,0 +1,82 @@ +client = $client; + $this->baseUrl = ''; + } + + /** + * Translate version relative URIs into absolute URLs + * + * @param string $uri Version relative URI + * @return string Absolute URL for this domain + */ + public function absoluteUrl(string $uri): string { + return \implode('/', [\trim($this->baseUrl, '/'), \trim($uri, '/')]); + } + + /** + * Make an HTTP request to the domain + * + * @param string $method HTTP Method to make the request with + * @param string $uri Relative uri to make a request to + * @param array $params Query string arguments + * @param array $data Post form data + * @param array $headers HTTP headers to send with the request + * @param string $user User to authenticate as + * @param string $password Password + * @param int $timeout Request timeout + * @return Response the response for the request + */ + public function request(string $method, string $uri, + array $params = [], array $data = [], array $headers = [], + string $user = null, string $password = null, + int $timeout = null): Response { + $url = $this->absoluteUrl($uri); + return $this->client->request( + $method, + $url, + $params, + $data, + $headers, + $user, + $password, + $timeout + ); + } + + public function getClient(): Client { + return $this->client; + } + + public function __toString(): string { + return '[Domain]'; + } +} diff --git a/app/api/Twilio/Exceptions/ConfigurationException.php b/app/api/Twilio/Exceptions/ConfigurationException.php new file mode 100755 index 0000000..a94d364 --- /dev/null +++ b/app/api/Twilio/Exceptions/ConfigurationException.php @@ -0,0 +1,9 @@ +statusCode = $statusCode; + $this->moreInfo = $moreInfo; + $this->details = $details; + parent::__construct($message, $code); + } + + /** + * Get the HTTP Status Code of the RestException + * @return int HTTP Status Code + */ + public function getStatusCode(): int { + return $this->statusCode; + } + + /** + * Get more information of the RestException + * @return string More error information + */ + public function getMoreInfo(): string { + return $this->moreInfo; + } + + /** + * Get the details of the RestException + * @return exception details + */ + public function getDetails(): array { + return $this->details; + } +} diff --git a/app/api/Twilio/Exceptions/TwilioException.php b/app/api/Twilio/Exceptions/TwilioException.php new file mode 100755 index 0000000..1df267b --- /dev/null +++ b/app/api/Twilio/Exceptions/TwilioException.php @@ -0,0 +1,9 @@ +curlOptions = $options; + } + + public function request(string $method, string $url, + array $params = [], array $data = [], array $headers = [], + string $user = null, string $password = null, + int $timeout = null): Response { + $options = $this->options($method, $url, $params, $data, $headers, + $user, $password, $timeout); + + $this->lastRequest = $options; + $this->lastResponse = null; + + try { + if (!$curl = \curl_init()) { + throw new EnvironmentException('Unable to initialize cURL'); + } + + if (!\curl_setopt_array($curl, $options)) { + throw new EnvironmentException(\curl_error($curl)); + } + + if (!$response = \curl_exec($curl)) { + throw new EnvironmentException(\curl_error($curl)); + } + + $parts = \explode("\r\n\r\n", $response, 3); + + list($head, $body) = ( + \preg_match('/\AHTTP\/1.\d 100 Continue\Z/', $parts[0]) + || \preg_match('/\AHTTP\/1.\d 200 Connection established\Z/', $parts[0]) + || \preg_match('/\AHTTP\/1.\d 200 Tunnel established\Z/', $parts[0]) + ) + ? array($parts[1], $parts[2]) + : array($parts[0], $parts[1]); + + $statusCode = \curl_getinfo($curl, CURLINFO_HTTP_CODE); + + $responseHeaders = []; + $headerLines = \explode("\r\n", $head); + \array_shift($headerLines); + foreach ($headerLines as $line) { + list($key, $value) = \explode(':', $line, 2); + $responseHeaders[$key] = $value; + } + + \curl_close($curl); + + if (isset($options[CURLOPT_INFILE]) && \is_resource($options[CURLOPT_INFILE])) { + \fclose($options[CURLOPT_INFILE]); + } + + $this->lastResponse = new Response($statusCode, $body, $responseHeaders); + + return $this->lastResponse; + } catch (\ErrorException $e) { + if (isset($curl) && \is_resource($curl)) { + \curl_close($curl); + } + + if (isset($options[CURLOPT_INFILE]) && \is_resource($options[CURLOPT_INFILE])) { + \fclose($options[CURLOPT_INFILE]); + } + + throw $e; + } + } + + public function options(string $method, string $url, + array $params = [], array $data = [], array $headers = [], + string $user = null, string $password = null, + int $timeout = null): array { + $timeout = $timeout ?? self::DEFAULT_TIMEOUT; + $options = $this->curlOptions + [ + CURLOPT_URL => $url, + CURLOPT_HEADER => true, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_INFILESIZE => Null, + CURLOPT_HTTPHEADER => [], + CURLOPT_TIMEOUT => $timeout, + ]; + + foreach ($headers as $key => $value) { + $options[CURLOPT_HTTPHEADER][] = "$key: $value"; + } + + if ($user && $password) { + $options[CURLOPT_HTTPHEADER][] = 'Authorization: Basic ' . \base64_encode("$user:$password"); + } + + $query = $this->buildQuery($params); + if ($query) { + $options[CURLOPT_URL] .= '?' . $query; + } + + switch (\strtolower(\trim($method))) { + case 'get': + $options[CURLOPT_HTTPGET] = true; + break; + case 'post': + $options[CURLOPT_POST] = true; + if ($this->hasFile($data)) { + [$headers, $body] = $this->buildMultipartOptions($data); + $options[CURLOPT_POSTFIELDS] = $body; + $options[CURLOPT_HTTPHEADER] = \array_merge($options[CURLOPT_HTTPHEADER], $headers); + } else { + $options[CURLOPT_POSTFIELDS] = $this->buildQuery($data); + $options[CURLOPT_HTTPHEADER][] = 'Content-Type: application/x-www-form-urlencoded'; + } + + break; + case 'put': + // TODO: PUT doesn't used anywhere and it has strange implementation. Must investigate later + $options[CURLOPT_PUT] = true; + if ($data) { + if ($buffer = \fopen('php://memory', 'w+')) { + $dataString = $this->buildQuery($data); + \fwrite($buffer, $dataString); + \fseek($buffer, 0); + $options[CURLOPT_INFILE] = $buffer; + $options[CURLOPT_INFILESIZE] = \strlen($dataString); + } else { + throw new EnvironmentException('Unable to open a temporary file'); + } + } + break; + case 'head': + $options[CURLOPT_NOBODY] = true; + break; + default: + $options[CURLOPT_CUSTOMREQUEST] = \strtoupper($method); + } + + return $options; + } + + public function buildQuery(?array $params): string { + $parts = []; + $params = $params ?: []; + + foreach ($params as $key => $value) { + if (\is_array($value)) { + foreach ($value as $item) { + $parts[] = \urlencode((string)$key) . '=' . \urlencode((string)$item); + } + } else { + $parts[] = \urlencode((string)$key) . '=' . \urlencode((string)$value); + } + } + + return \implode('&', $parts); + } + + private function hasFile(array $data): bool { + foreach ($data as $value) { + if ($value instanceof File) { + return true; + } + } + + return false; + } + + private function buildMultipartOptions(array $data): array { + $boundary = \uniqid('', true); + $delimiter = "-------------{$boundary}"; + $body = ''; + + foreach ($data as $key => $value) { + if ($value instanceof File) { + $contents = $value->getContents(); + if ($contents === null) { + $chunk = \file_get_contents($value->getFileName()); + $filename = \basename($value->getFileName()); + } elseif (\is_resource($contents)) { + $chunk = ''; + while (!\feof($contents)) { + $chunk .= \fread($contents, 8096); + } + + $filename = $value->getFileName(); + } elseif (\is_string($contents)) { + $chunk = $contents; + $filename = $value->getFileName(); + } else { + throw new \InvalidArgumentException('Unsupported content type'); + } + + $headers = ''; + $contentType = $value->getContentType(); + if ($contentType !== null) { + $headers .= "Content-Type: {$contentType}\r\n"; + } + + $body .= \vsprintf("--%s\r\nContent-Disposition: form-data; name=\"%s\"; filename=\"%s\"\r\n%s\r\n%s\r\n", [ + $delimiter, + $key, + $filename, + $headers, + $chunk, + ]); + } else { + $body .= \vsprintf("--%s\r\nContent-Disposition: form-data; name=\"%s\"\r\n\r\n%s\r\n", [ + $delimiter, + $key, + $value, + ]); + } + } + + $body .= "--{$delimiter}--\r\n"; + + return [ + [ + "Content-Type: multipart/form-data; boundary={$delimiter}", + 'Content-Length: ' . \strlen($body), + ], + $body, + ]; + } +} diff --git a/app/api/Twilio/Http/File.php b/app/api/Twilio/Http/File.php new file mode 100755 index 0000000..0823c80 --- /dev/null +++ b/app/api/Twilio/Http/File.php @@ -0,0 +1,47 @@ +fileName = $fileName; + $this->contents = $contents; + $this->contentType = $contentType; + } + + /** + * @return resource|string|mixed|null + */ + public function getContents() { + return $this->contents; + } + + public function getFileName(): string { + return $this->fileName; + } + + public function getContentType(): ?string { + return $this->contentType; + } +} diff --git a/app/api/Twilio/Http/GuzzleClient.php b/app/api/Twilio/Http/GuzzleClient.php new file mode 100755 index 0000000..7eff5ed --- /dev/null +++ b/app/api/Twilio/Http/GuzzleClient.php @@ -0,0 +1,99 @@ +client = $client; + } + + public function request(string $method, string $url, + array $params = [], array $data = [], array $headers = [], + string $user = null, string $password = null, + int $timeout = null): Response { + try { + $options = [ + 'timeout' => $timeout, + 'auth' => [$user, $password], + 'allow_redirects' => false, + ]; + + if ($params) { + $options['query'] = Query::build($params, PHP_QUERY_RFC1738); + } + + if ($method === 'POST') { + if ($this->hasFile($data)) { + $options['multipart'] = $this->buildMultipartParam($data); + } else { + $options['body'] = Query::build($data, PHP_QUERY_RFC1738); + $headers['Content-Type'] = 'application/x-www-form-urlencoded'; + } + } + + $response = $this->client->send(new Request($method, $url, $headers), $options); + } catch (BadResponseException $exception) { + $response = $exception->getResponse(); + } catch (\Exception $exception) { + throw new HttpException('Unable to complete the HTTP request', 0, $exception); + } + + // Casting the body (stream) to a string performs a rewind, ensuring we return the entire response. + // See https://stackoverflow.com/a/30549372/86696 + return new Response($response->getStatusCode(), (string)$response->getBody(), $response->getHeaders()); + } + + private function hasFile(array $data): bool { + foreach ($data as $value) { + if ($value instanceof File) { + return true; + } + } + + return false; + } + + private function buildMultipartParam(array $data): array { + $multipart = []; + foreach ($data as $key => $value) { + if ($value instanceof File) { + $contents = $value->getContents(); + if ($contents === null) { + $contents = fopen($value->getFileName(), 'rb'); + } + + $chunk = [ + 'name' => $key, + 'contents' => $contents, + 'filename' => $value->getFileName(), + ]; + + if ($value->getContentType() !== null) { + $chunk['headers']['Content-Type'] = $value->getContentType(); + } + } else { + $chunk = [ + 'name' => $key, + 'contents' => $value, + ]; + } + + $multipart[] = $chunk; + } + + return $multipart; + } +} diff --git a/app/api/Twilio/Http/Response.php b/app/api/Twilio/Http/Response.php new file mode 100755 index 0000000..e1b58ae --- /dev/null +++ b/app/api/Twilio/Http/Response.php @@ -0,0 +1,40 @@ +statusCode = $statusCode; + $this->content = $content; + $this->headers = $headers; + } + + /** + * @return mixed + */ + public function getContent() { + return \json_decode($this->content, true); + } + + public function getStatusCode(): int { + return $this->statusCode; + } + + public function getHeaders(): array { + return $this->headers; + } + + public function ok(): bool { + return $this->getStatusCode() < 400; + } + + public function __toString(): string { + return '[Response] HTTP ' . $this->getStatusCode() . ' ' . $this->content; + } +} diff --git a/app/api/Twilio/InstanceContext.php b/app/api/Twilio/InstanceContext.php new file mode 100755 index 0000000..f72a49f --- /dev/null +++ b/app/api/Twilio/InstanceContext.php @@ -0,0 +1,19 @@ +version = $version; + } + + public function __toString(): string { + return '[InstanceContext]'; + } +} diff --git a/app/api/Twilio/InstanceResource.php b/app/api/Twilio/InstanceResource.php new file mode 100755 index 0000000..a356111 --- /dev/null +++ b/app/api/Twilio/InstanceResource.php @@ -0,0 +1,28 @@ +version = $version; + } + + public function toArray(): array { + return $this->properties; + } + + public function __toString(): string { + return '[InstanceResource]'; + } + + public function __isset($name): bool { + return \array_key_exists($name, $this->properties); + } +} diff --git a/app/api/Twilio/Jwt/AccessToken.php b/app/api/Twilio/Jwt/AccessToken.php new file mode 100755 index 0000000..c635fa0 --- /dev/null +++ b/app/api/Twilio/Jwt/AccessToken.php @@ -0,0 +1,169 @@ +signingKeySid = $signingKeySid; + $this->accountSid = $accountSid; + $this->secret = $secret; + $this->ttl = $ttl; + $this->region = $region; + + if ($identity !== null) { + $this->identity = $identity; + } + + $this->grants = []; + $this->customClaims = []; + } + + /** + * Set the identity of this access token + * + * @param string $identity identity of the grant + * + * @return $this updated access token + */ + public function setIdentity(string $identity): self { + $this->identity = $identity; + return $this; + } + + /** + * Returns the identity of the grant + * + * @return string the identity + */ + public function getIdentity(): string { + return $this->identity; + } + + /** + * Set the nbf of this access token + * + * @param int $nbf nbf in epoch seconds of the grant + * + * @return $this updated access token + */ + public function setNbf(int $nbf): self { + $this->nbf = $nbf; + return $this; + } + + /** + * Returns the nbf of the grant + * + * @return int the nbf in epoch seconds + */ + public function getNbf(): int { + return $this->nbf; + } + + /** + * Set the region of this access token + * + * @param string $region Home region of the account sid in this access token + * + * @return $this updated access token + */ + public function setRegion(string $region): self { + $this->region = $region; + return $this; + } + + /** + * Returns the region of this access token + * + * @return string Home region of the account sid in this access token + */ + public function getRegion(): string { + return $this->region; + } + + /** + * Add a grant to the access token + * + * @param Grant $grant to be added + * + * @return $this the updated access token + */ + public function addGrant(Grant $grant): self { + $this->grants[] = $grant; + return $this; + } + + /** + * Allows to set custom claims, which then will be encoded into JWT payload. + * + * @param string $name + * @param string $value + */ + public function addClaim(string $name, string $value): void { + $this->customClaims[$name] = $value; + } + + public function toJWT(string $algorithm = 'HS256'): string { + $header = [ + 'cty' => 'twilio-fpa;v=1', + 'typ' => 'JWT' + ]; + + if ($this->region) { + $header['twr'] = $this->region; + } + + $now = \time(); + + $grants = []; + if ($this->identity) { + $grants['identity'] = $this->identity; + } + + foreach ($this->grants as $grant) { + $payload = $grant->getPayload(); + if (empty($payload)) { + $payload = \json_decode('{}'); + } + + $grants[$grant->getGrantKey()] = $payload; + } + + if (empty($grants)) { + $grants = \json_decode('{}'); + } + + $payload = \array_merge($this->customClaims, [ + 'jti' => $this->signingKeySid . '-' . $now, + 'iss' => $this->signingKeySid, + 'sub' => $this->accountSid, + 'exp' => $now + $this->ttl, + 'grants' => $grants + ]); + + if ($this->nbf !== null) { + $payload['nbf'] = $this->nbf; + } + + return JWT::encode($payload, $this->secret, $algorithm, $header); + } + + public function __toString(): string { + return $this->toJWT(); + } +} diff --git a/app/api/Twilio/Jwt/Client/ScopeURI.php b/app/api/Twilio/Jwt/Client/ScopeURI.php new file mode 100755 index 0000000..f35d258 --- /dev/null +++ b/app/api/Twilio/Jwt/Client/ScopeURI.php @@ -0,0 +1,67 @@ +:? + * + * For example: + * scope:client:incoming?name=jonas + */ +class ScopeURI { + public $service; + public $privilege; + public $params; + + public function __construct(string $service, string $privilege, array $params = []) { + $this->service = $service; + $this->privilege = $privilege; + $this->params = $params; + } + + public function toString(): string { + $uri = "scope:{$this->service}:{$this->privilege}"; + if (\count($this->params)) { + $uri .= '?' . \http_build_query($this->params, '', '&'); + } + return $uri; + } + + /** + * Parse a scope URI into a ScopeURI object + * + * @param string $uri The scope URI + * @return ScopeURI The parsed scope uri + * @throws \UnexpectedValueException + */ + public static function parse(string $uri): ScopeURI { + if (\strpos($uri, 'scope:') !== 0) { + throw new \UnexpectedValueException( + 'Not a scope URI according to scheme'); + } + + $parts = \explode('?', $uri, 1); + $params = null; + + if (\count($parts) > 1) { + \parse_str($parts[1], $params); + } + + $parts = \explode(':', $parts[0], 2); + + if (\count($parts) !== 3) { + throw new \UnexpectedValueException( + 'Not enough parts for scope URI'); + } + + [$scheme, $service, $privilege] = $parts; + return new ScopeURI($service, $privilege, $params); + } +} diff --git a/app/api/Twilio/Jwt/ClientToken.php b/app/api/Twilio/Jwt/ClientToken.php new file mode 100755 index 0000000..03327e0 --- /dev/null +++ b/app/api/Twilio/Jwt/ClientToken.php @@ -0,0 +1,128 @@ +accountSid = $accountSid; + $this->authToken = $authToken; + $this->scopes = []; + $this->clientName = false; + $this->customClaims = []; + } + + /** + * If the user of this token should be allowed to accept incoming + * connections then configure the TwilioCapability through this method and + * specify the client name. + * + * @param string $clientName + * @throws \InvalidArgumentException + */ + public function allowClientIncoming(string $clientName): void { + // clientName must be a non-zero length alphanumeric string + if (\preg_match('/\W/', $clientName)) { + throw new \InvalidArgumentException( + 'Only alphanumeric characters allowed in client name.'); + } + + if ($clientName === '') { + throw new \InvalidArgumentException( + 'Client name must not be a zero length string.'); + } + + $this->clientName = $clientName; + $this->allow('client', 'incoming', ['clientName' => $clientName]); + } + + /** + * Allow the user of this token to make outgoing connections. + * + * @param string $appSid the application to which this token grants access + * @param mixed[] $appParams signed parameters that the user of this token + * cannot overwrite. + */ + public function allowClientOutgoing(string $appSid, array $appParams = []): void { + $this->allow('client', 'outgoing', [ + 'appSid' => $appSid, + 'appParams' => \http_build_query($appParams, '', '&') + ]); + } + + /** + * Allow the user of this token to access their event stream. + * + * @param mixed[] $filters key/value filters to apply to the event stream + */ + public function allowEventStream(array $filters = []): void { + $this->allow('stream', 'subscribe', [ + 'path' => '/2010-04-01/Events', + 'params' => \http_build_query($filters, '', '&'), + ]); + } + + /** + * Allows to set custom claims, which then will be encoded into JWT payload. + * + * @param string $name + * @param string $value + */ + public function addClaim(string $name, string $value): void { + $this->customClaims[$name] = $value; + } + + /** + * Generates a new token based on the credentials and permissions that + * previously has been granted to this token. + * + * @param int $ttl the expiration time of the token (in seconds). Default + * value is 3600 (1hr) + * @return string the newly generated token that is valid for $ttl seconds + */ + public function generateToken(int $ttl = 3600): string { + $payload = \array_merge($this->customClaims, [ + 'scope' => [], + 'iss' => $this->accountSid, + 'exp' => \time() + $ttl, + ]); + $scopeStrings = []; + + foreach ($this->scopes as $scope) { + if ($scope->privilege === 'outgoing' && $this->clientName) { + $scope->params['clientName'] = $this->clientName; + } + $scopeStrings[] = $scope->toString(); + } + + $payload['scope'] = \implode(' ', $scopeStrings); + return JWT::encode($payload, $this->authToken, 'HS256'); + } + + protected function allow(string $service, string $privilege, array $params): void { + $this->scopes[] = new ScopeURI($service, $privilege, $params); + } +} diff --git a/app/api/Twilio/Jwt/Grants/ChatGrant.php b/app/api/Twilio/Jwt/Grants/ChatGrant.php new file mode 100755 index 0000000..af16d2a --- /dev/null +++ b/app/api/Twilio/Jwt/Grants/ChatGrant.php @@ -0,0 +1,128 @@ +serviceSid; + } + + /** + * Set the service sid of this grant + * + * @param string $serviceSid service sid of the grant + * + * @return $this updated grant + */ + public function setServiceSid(string $serviceSid): self { + $this->serviceSid = $serviceSid; + return $this; + } + + /** + * Returns the endpoint id of the grant + * + * @return string the endpoint id + */ + public function getEndpointId(): string { + return $this->endpointId; + } + + /** + * Set the endpoint id of the grant + * + * @param string $endpointId endpoint id of the grant + * + * @return $this updated grant + */ + public function setEndpointId(string $endpointId): self { + $this->endpointId = $endpointId; + return $this; + } + + /** + * Returns the deployment role sid of the grant + * + * @return string the deployment role sid + */ + public function getDeploymentRoleSid(): string { + return $this->deploymentRoleSid; + } + + /** + * Set the role sid of the grant + * + * @param string $deploymentRoleSid role sid of the grant + * + * @return $this updated grant + */ + public function setDeploymentRoleSid(string $deploymentRoleSid): self { + $this->deploymentRoleSid = $deploymentRoleSid; + return $this; + } + + /** + * Returns the push credential sid of the grant + * + * @return string the push credential sid + */ + public function getPushCredentialSid(): string { + return $this->pushCredentialSid; + } + + /** + * Set the credential sid of the grant + * + * @param string $pushCredentialSid push credential sid of the grant + * + * @return $this updated grant + */ + public function setPushCredentialSid(string $pushCredentialSid): self { + $this->pushCredentialSid = $pushCredentialSid; + return $this; + } + + /** + * Returns the grant type + * + * @return string type of the grant + */ + public function getGrantKey(): string { + return 'chat'; + } + + /** + * Returns the grant data + * + * @return array data of the grant + */ + public function getPayload(): array { + $payload = []; + if ($this->serviceSid) { + $payload['service_sid'] = $this->serviceSid; + } + if ($this->endpointId) { + $payload['endpoint_id'] = $this->endpointId; + } + if ($this->deploymentRoleSid) { + $payload['deployment_role_sid'] = $this->deploymentRoleSid; + } + if ($this->pushCredentialSid) { + $payload['push_credential_sid'] = $this->pushCredentialSid; + } + + return $payload; + } +} diff --git a/app/api/Twilio/Jwt/Grants/Grant.php b/app/api/Twilio/Jwt/Grants/Grant.php new file mode 100755 index 0000000..eb20e3e --- /dev/null +++ b/app/api/Twilio/Jwt/Grants/Grant.php @@ -0,0 +1,21 @@ +grant; + } + + /** + * Set the playback grant that will allow access to a stream + * + * @param array $grant playback grant from Twilio API + * @return $this updated grant + */ + public function setGrant(array $grant): self { + $this->grant = $grant; + return $this; + } + + /** + * Returns the grant type + * + * @return string type of the grant + */ + public function getGrantKey(): string { + return 'player'; + } + + /** + * Returns the grant data + * + * @return array data of the grant + */ + public function getPayload(): array { + $payload = []; + if ($this->grant) { + $payload = $this->grant; + } + return $payload; + } +} diff --git a/app/api/Twilio/Jwt/Grants/SyncGrant.php b/app/api/Twilio/Jwt/Grants/SyncGrant.php new file mode 100755 index 0000000..757ea80 --- /dev/null +++ b/app/api/Twilio/Jwt/Grants/SyncGrant.php @@ -0,0 +1,126 @@ +serviceSid; + } + + /** + * Set the service sid of this grant + * + * @param string $serviceSid service sid of the grant + * + * @return $this updated grant + */ + public function setServiceSid(string $serviceSid): self { + $this->serviceSid = $serviceSid; + return $this; + } + + /** + * Returns the endpoint id of the grant + * + * @return string the endpoint id + */ + public function getEndpointId(): string { + return $this->endpointId; + } + + /** + * Set the endpoint id of the grant + * + * @param string $endpointId endpoint id of the grant + * + * @return $this updated grant + */ + public function setEndpointId(string $endpointId): self { + $this->endpointId = $endpointId; + return $this; + } + + /** + * Returns the deployment role sid of the grant + * + * @return string the deployment role sid + */ + public function getDeploymentRoleSid(): string { + return $this->deploymentRoleSid; + } + + /** + * Set the role sid of the grant + * + * @param string $deploymentRoleSid role sid of the grant + * + * @return $this updated grant + */ + public function setDeploymentRoleSid(string $deploymentRoleSid): self { + $this->deploymentRoleSid = $deploymentRoleSid; + return $this; + } + + /** + * Returns the push credential sid of the grant + * + * @return string the push credential sid + */ + public function getPushCredentialSid(): string { + return $this->pushCredentialSid; + } + + /** + * Set the credential sid of the grant + * + * @param string $pushCredentialSid push credential sid of the grant + * + * @return $this updated grant + */ + public function setPushCredentialSid(string $pushCredentialSid): self { + $this->pushCredentialSid = $pushCredentialSid; + return $this; + } + + /** + * Returns the grant type + * + * @return string type of the grant + */ + public function getGrantKey(): string { + return 'data_sync'; + } + + /** + * Returns the grant data + * + * @return array data of the grant + */ + public function getPayload(): array { + $payload = []; + if ($this->serviceSid) { + $payload['service_sid'] = $this->serviceSid; + } + if ($this->endpointId) { + $payload['endpoint_id'] = $this->endpointId; + } + if ($this->deploymentRoleSid) { + $payload['deployment_role_sid'] = $this->deploymentRoleSid; + } + if ($this->pushCredentialSid) { + $payload['push_credential_sid'] = $this->pushCredentialSid; + } + + return $payload; + } +} diff --git a/app/api/Twilio/Jwt/Grants/TaskRouterGrant.php b/app/api/Twilio/Jwt/Grants/TaskRouterGrant.php new file mode 100755 index 0000000..07613cb --- /dev/null +++ b/app/api/Twilio/Jwt/Grants/TaskRouterGrant.php @@ -0,0 +1,101 @@ +workspaceSid; + } + + /** + * Set the workspace sid of this grant + * + * @param string $workspaceSid workspace sid of the grant + * + * @return $this updated grant + */ + public function setWorkspaceSid(string $workspaceSid): self { + $this->workspaceSid = $workspaceSid; + return $this; + } + + /** + * Returns the worker sid + * + * @return string the worker sid + */ + public function getWorkerSid(): string { + return $this->workerSid; + } + + /** + * Set the worker sid of this grant + * + * @param string $workerSid worker sid of the grant + * + * @return $this updated grant + */ + public function setWorkerSid(string $workerSid): self { + $this->workerSid = $workerSid; + return $this; + } + + /** + * Returns the role + * + * @return string the role + */ + public function getRole(): string { + return $this->role; + } + + /** + * Set the role of this grant + * + * @param string $role role of the grant + * + * @return $this updated grant + */ + public function setRole(string $role): self { + $this->role = $role; + return $this; + } + + /** + * Returns the grant type + * + * @return string type of the grant + */ + public function getGrantKey(): string { + return 'task_router'; + } + + /** + * Returns the grant data + * + * @return array data of the grant + */ + public function getPayload(): array { + $payload = []; + if ($this->workspaceSid) { + $payload['workspace_sid'] = $this->workspaceSid; + } + if ($this->workerSid) { + $payload['worker_sid'] = $this->workerSid; + } + if ($this->role) { + $payload['role'] = $this->role; + } + + return $payload; + } +} diff --git a/app/api/Twilio/Jwt/Grants/VideoGrant.php b/app/api/Twilio/Jwt/Grants/VideoGrant.php new file mode 100755 index 0000000..dbf2a38 --- /dev/null +++ b/app/api/Twilio/Jwt/Grants/VideoGrant.php @@ -0,0 +1,52 @@ +room; + } + + /** + * Set the room to allow access to in the grant + * + * @param string $roomSidOrName room sid or name + * @return $this updated grant + */ + public function setRoom(string $roomSidOrName): self { + $this->room = $roomSidOrName; + return $this; + } + + /** + * Returns the grant type + * + * @return string type of the grant + */ + public function getGrantKey(): string { + return 'video'; + } + + /** + * Returns the grant data + * + * @return array data of the grant + */ + public function getPayload(): array { + $payload = []; + if ($this->room) { + $payload['room'] = $this->room; + } + return $payload; + } +} diff --git a/app/api/Twilio/Jwt/Grants/VoiceGrant.php b/app/api/Twilio/Jwt/Grants/VoiceGrant.php new file mode 100755 index 0000000..296774a --- /dev/null +++ b/app/api/Twilio/Jwt/Grants/VoiceGrant.php @@ -0,0 +1,165 @@ +incomingAllow; + } + + /** + * Set whether incoming is allowed + * + * @param bool $incomingAllow whether incoming is allowed + * + * @return $this updated grant + */ + public function setIncomingAllow(bool $incomingAllow): self { + $this->incomingAllow = $incomingAllow; + return $this; + } + + /** + * Returns the outgoing application sid + * + * @return string the outgoing application sid + */ + public function getOutgoingApplicationSid(): string { + return $this->outgoingApplicationSid; + } + + /** + * Set the outgoing application sid of the grant + * + * @param string $outgoingApplicationSid outgoing application sid of grant + * + * @return $this updated grant + */ + public function setOutgoingApplicationSid(string $outgoingApplicationSid): self { + $this->outgoingApplicationSid = $outgoingApplicationSid; + return $this; + } + + /** + * Returns the outgoing application params + * + * @return array the outgoing application params + */ + public function getOutgoingApplicationParams(): array { + return $this->outgoingApplicationParams; + } + + /** + * Set the outgoing application of the the grant + * + * @param string $sid outgoing application sid of the grant + * @param array $params params to pass the the application + * + * @return $this updated grant + */ + public function setOutgoingApplication(string $sid, array $params): self { + $this->outgoingApplicationSid = $sid; + $this->outgoingApplicationParams = $params; + return $this; + } + + /** + * Returns the push credential sid + * + * @return string the push credential sid + */ + public function getPushCredentialSid(): string { + return $this->pushCredentialSid; + } + + /** + * Set the push credential sid + * + * @param string $pushCredentialSid + * + * @return $this updated grant + */ + public function setPushCredentialSid(string $pushCredentialSid): self { + $this->pushCredentialSid = $pushCredentialSid; + return $this; + } + + /** + * Returns the endpoint id + * + * @return string the endpoint id + */ + public function getEndpointId(): string { + return $this->endpointId; + } + + /** + * Set the endpoint id + * + * @param string $endpointId endpoint id + * + * @return $this updated grant + */ + public function setEndpointId(string $endpointId): self { + $this->endpointId = $endpointId; + return $this; + } + + /** + * Returns the grant type + * + * @return string type of the grant + */ + public function getGrantKey(): string { + return 'voice'; + } + + /** + * Returns the grant data + * + * @return array data of the grant + */ + public function getPayload(): array { + $payload = []; + if ($this->incomingAllow === true) { + $incoming = []; + $incoming['allow'] = true; + $payload['incoming'] = $incoming; + } + + if ($this->outgoingApplicationSid) { + $outgoing = []; + $outgoing['application_sid'] = $this->outgoingApplicationSid; + + if ($this->outgoingApplicationParams) { + $outgoing['params'] = $this->outgoingApplicationParams; + } + + $payload['outgoing'] = $outgoing; + } + + if ($this->pushCredentialSid) { + $payload['push_credential_sid'] = $this->pushCredentialSid; + } + + if ($this->endpointId) { + $payload['endpoint_id'] = $this->endpointId; + } + + return $payload; + } +} diff --git a/app/api/Twilio/Jwt/JWT.php b/app/api/Twilio/Jwt/JWT.php new file mode 100755 index 0000000..f9506e9 --- /dev/null +++ b/app/api/Twilio/Jwt/JWT.php @@ -0,0 +1,172 @@ + + */ +class JWT { + /** + * @param string $jwt The JWT + * @param string|null $key The secret key + * @param bool $verify Don't skip verification process + * @return object The JWT's payload as a PHP object + * @throws \DomainException + * @throws \UnexpectedValueException + */ + public static function decode(string $jwt, string $key = null, bool $verify = true) { + $tks = \explode('.', $jwt); + if (\count($tks) !== 3) { + throw new \UnexpectedValueException('Wrong number of segments'); + } + list($headb64, $payloadb64, $cryptob64) = $tks; + if (null === ($header = self::jsonDecode(self::urlsafeB64Decode($headb64))) + ) { + throw new \UnexpectedValueException('Invalid segment encoding'); + } + if (null === $payload = self::jsonDecode(self::urlsafeB64Decode($payloadb64)) + ) { + throw new \UnexpectedValueException('Invalid segment encoding'); + } + $sig = self::urlsafeB64Decode($cryptob64); + if ($verify) { + if (empty($header->alg)) { + throw new \DomainException('Empty algorithm'); + } + + if (!hash_equals($sig, self::sign("$headb64.$payloadb64", $key, $header->alg))) { + throw new \UnexpectedValueException('Signature verification failed'); + } + } + return $payload; + } + + /** + * @param string $jwt The JWT + * @return object The JWT's header as a PHP object + * @throws \UnexpectedValueException + */ + public static function getHeader(string $jwt) { + $tks = \explode('.', $jwt); + if (\count($tks) !== 3) { + throw new \UnexpectedValueException('Wrong number of segments'); + } + list($headb64) = $tks; + if (null === ($header = self::jsonDecode(self::urlsafeB64Decode($headb64))) + ) { + throw new \UnexpectedValueException('Invalid segment encoding'); + } + return $header; + } + + /** + * @param object|array $payload PHP object or array + * @param string $key The secret key + * @param string $algo The signing algorithm + * @param array $additionalHeaders Additional keys/values to add to the header + * + * @return string A JWT + */ + public static function encode($payload, string $key, string $algo = 'HS256', array $additionalHeaders = []): string { + $header = ['typ' => 'JWT', 'alg' => $algo]; + $header += $additionalHeaders; + + $segments = []; + $segments[] = self::urlsafeB64Encode(self::jsonEncode($header)); + $segments[] = self::urlsafeB64Encode(self::jsonEncode($payload)); + $signing_input = \implode('.', $segments); + + $signature = self::sign($signing_input, $key, $algo); + $segments[] = self::urlsafeB64Encode($signature); + + return \implode('.', $segments); + } + + /** + * @param string $msg The message to sign + * @param string $key The secret key + * @param string $method The signing algorithm + * @return string An encrypted message + * @throws \DomainException + */ + public static function sign(string $msg, string $key, string $method = 'HS256'): string { + $methods = [ + 'HS256' => 'sha256', + 'HS384' => 'sha384', + 'HS512' => 'sha512', + ]; + if (empty($methods[$method])) { + throw new \DomainException('Algorithm not supported'); + } + return \hash_hmac($methods[$method], $msg, $key, true); + } + + /** + * @param string $input JSON string + * @return object Object representation of JSON string + * @throws \DomainException + */ + public static function jsonDecode(string $input) { + $obj = \json_decode($input); + if (\function_exists('json_last_error') && $errno = \json_last_error()) { + self::handleJsonError($errno); + } else if ($obj === null && $input !== 'null') { + throw new \DomainException('Null result with non-null input'); + } + return $obj; + } + + /** + * @param object|array $input A PHP object or array + * @return string JSON representation of the PHP object or array + * @throws \DomainException + */ + public static function jsonEncode($input): string { + $json = \json_encode($input); + if (\function_exists('json_last_error') && $errno = \json_last_error()) { + self::handleJsonError($errno); + } else if ($json === 'null' && $input !== null) { + throw new \DomainException('Null result with non-null input'); + } + return $json; + } + + /** + * @param string $input A base64 encoded string + * + * @return string A decoded string + */ + public static function urlsafeB64Decode(string $input): string { + $padLen = 4 - \strlen($input) % 4; + $input .= \str_repeat('=', $padLen); + return \base64_decode(\strtr($input, '-_', '+/')); + } + + /** + * @param string $input Anything really + * + * @return string The base64 encode of what you passed in + */ + public static function urlsafeB64Encode(string $input): string { + return \str_replace('=', '', \strtr(\base64_encode($input), '+/', '-_')); + } + + /** + * @param int $errno An error number from json_last_error() + * + * @throws \DomainException + */ + private static function handleJsonError(int $errno): void { + $messages = [ + JSON_ERROR_DEPTH => 'Maximum stack depth exceeded', + JSON_ERROR_CTRL_CHAR => 'Unexpected control character found', + JSON_ERROR_SYNTAX => 'Syntax error, malformed JSON' + ]; + throw new \DomainException($messages[$errno] ?? 'Unknown JSON error: ' . $errno); + } +} diff --git a/app/api/Twilio/Jwt/TaskRouter/CapabilityToken.php b/app/api/Twilio/Jwt/TaskRouter/CapabilityToken.php new file mode 100755 index 0000000..0ada344 --- /dev/null +++ b/app/api/Twilio/Jwt/TaskRouter/CapabilityToken.php @@ -0,0 +1,161 @@ + + * @license http://creativecommons.org/licenses/MIT/ MIT + */ +class CapabilityToken { + protected $accountSid; + protected $authToken; + private $friendlyName; + /** @var Policy[] $policies */ + private $policies; + + protected $baseUrl = 'https://taskrouter.twilio.com/v1'; + protected $baseWsUrl = 'https://event-bridge.twilio.com/v1/wschannels'; + protected $version = 'v1'; + + protected $workspaceSid; + protected $channelId; + protected $resourceUrl; + + protected $required = ['required' => true]; + protected $optional = ['required' => false]; + + public function __construct(string $accountSid, string $authToken, string $workspaceSid, string $channelId, + string $resourceUrl = null, string $overrideBaseUrl = null, string $overrideBaseWSUrl = null) { + $this->accountSid = $accountSid; + $this->authToken = $authToken; + $this->friendlyName = $channelId; + $this->policies = []; + + $this->workspaceSid = $workspaceSid; + $this->channelId = $channelId; + if (isset($overrideBaseUrl)) { + $this->baseUrl = $overrideBaseUrl; + } + if (isset($overrideBaseWSUrl)) { + $this->baseWsUrl = $overrideBaseWSUrl; + } + $this->baseUrl .= '/Workspaces/' . $workspaceSid; + + $this->validateJWT(); + + if (!isset($resourceUrl)) { + $this->setupResource(); + } + + //add permissions to GET and POST to the event-bridge channel + $this->allow($this->baseWsUrl . '/' . $this->accountSid . '/' . $this->channelId, 'GET', null, null); + $this->allow($this->baseWsUrl . '/' . $this->accountSid . '/' . $this->channelId, 'POST', null, null); + + //add permissions to fetch the instance resource + $this->allow($this->resourceUrl, 'GET', null, null); + } + + protected function setupResource(): void { + } + + public function addPolicyDeconstructed(string $url, string $method, ?array $queryFilter = [], ?array $postFilter = [], bool $allow = true): Policy { + $policy = new Policy($url, $method, $queryFilter, $postFilter, $allow); + $this->policies[] = $policy; + return $policy; + } + + public function allow(string $url, string $method, ?array $queryFilter = [], ?array $postFilter = []): void { + $this->addPolicyDeconstructed($url, $method, $queryFilter, $postFilter, true); + } + + public function deny(string $url, string $method, array $queryFilter = [], array $postFilter = []): void { + $this->addPolicyDeconstructed($url, $method, $queryFilter, $postFilter, false); + } + + private function validateJWT(): void { + if (!isset($this->accountSid) || \strpos($this->accountSid, 'AC') !== 0) { + throw new \Exception('Invalid AccountSid provided: ' . $this->accountSid); + } + if (!isset($this->workspaceSid) || \strpos($this->workspaceSid, 'WS') !== 0) { + throw new \Exception('Invalid WorkspaceSid provided: ' . $this->workspaceSid); + } + if (!isset($this->channelId)) { + throw new \Exception('ChannelId not provided'); + } + $prefix = \substr($this->channelId, 0, 2); + if ($prefix !== 'WS' && $prefix !== 'WK' && $prefix !== 'WQ') { + throw new \Exception("Invalid ChannelId provided: " . $this->channelId); + } + } + + public function allowFetchSubresources(): void { + $method = 'GET'; + $queryFilter = []; + $postFilter = []; + $this->allow($this->resourceUrl . '/**', $method, $queryFilter, $postFilter); + } + + public function allowUpdates(): void { + $method = 'POST'; + $queryFilter = []; + $postFilter = []; + $this->allow($this->resourceUrl, $method, $queryFilter, $postFilter); + } + + public function allowUpdatesSubresources(): void { + $method = 'POST'; + $queryFilter = []; + $postFilter = []; + $this->allow($this->resourceUrl . '/**', $method, $queryFilter, $postFilter); + } + + public function allowDelete(): void { + $method = 'DELETE'; + $queryFilter = []; + $postFilter = []; + $this->allow($this->resourceUrl, $method, $queryFilter, $postFilter); + } + + public function allowDeleteSubresources(): void { + $method = 'DELETE'; + $queryFilter = []; + $postFilter = []; + $this->allow($this->resourceUrl . '/**', $method, $queryFilter, $postFilter); + } + + public function generateToken(int $ttl = 3600, array $extraAttributes = []): string { + $payload = [ + 'version' => $this->version, + 'friendly_name' => $this->friendlyName, + 'iss' => $this->accountSid, + 'exp' => \time() + $ttl, + 'account_sid' => $this->accountSid, + 'channel' => $this->channelId, + 'workspace_sid' => $this->workspaceSid + ]; + + if (\strpos($this->channelId, 'WK') === 0) { + $payload['worker_sid'] = $this->channelId; + } else if (\strpos($this->channelId, 'WQ') === 0) { + $payload['taskqueue_sid'] = $this->channelId; + } + + foreach ($extraAttributes as $key => $value) { + $payload[$key] = $value; + } + + $policyStrings = []; + foreach ($this->policies as $policy) { + $policyStrings[] = $policy->toArray(); + } + + $payload['policies'] = $policyStrings; + return JWT::encode($payload, $this->authToken, 'HS256'); + } +} diff --git a/app/api/Twilio/Jwt/TaskRouter/Policy.php b/app/api/Twilio/Jwt/TaskRouter/Policy.php new file mode 100755 index 0000000..ab81264 --- /dev/null +++ b/app/api/Twilio/Jwt/TaskRouter/Policy.php @@ -0,0 +1,54 @@ + + * @license http://creativecommons.org/licenses/MIT/ MIT + */ +class Policy { + private $url; + private $method; + private $queryFilter; + private $postFilter; + private $allow; + + public function __construct(string $url, string $method, ?array $queryFilter = [], ?array $postFilter = [], bool $allow = true) { + $this->url = $url; + $this->method = $method; + $this->queryFilter = $queryFilter; + $this->postFilter = $postFilter; + $this->allow = $allow; + } + + public function addQueryFilter($queryFilter): void { + $this->queryFilter[] = $queryFilter; + } + + public function addPostFilter($postFilter): void { + $this->postFilter[] = $postFilter; + } + + public function toArray(): array { + $policy_array = ['url' => $this->url, 'method' => $this->method, 'allow' => $this->allow]; + if ($this->queryFilter !== null) { + if (\count($this->queryFilter) > 0) { + $policy_array['query_filter'] = $this->queryFilter; + } else { + $policy_array['query_filter'] = new \stdClass(); + } + } + if ($this->postFilter !== null) { + if (\count($this->postFilter) > 0) { + $policy_array['post_filter'] = $this->postFilter; + } else { + $policy_array['post_filter'] = new \stdClass(); + } + } + return $policy_array; + } +} diff --git a/app/api/Twilio/Jwt/TaskRouter/TaskQueueCapability.php b/app/api/Twilio/Jwt/TaskRouter/TaskQueueCapability.php new file mode 100755 index 0000000..0ed23ef --- /dev/null +++ b/app/api/Twilio/Jwt/TaskRouter/TaskQueueCapability.php @@ -0,0 +1,21 @@ + + * @license http://creativecommons.org/licenses/MIT/ MIT + */ +class TaskQueueCapability extends CapabilityToken { + public function __construct(string $accountSid, string $authToken, string $workspaceSid, string $taskQueueSid, + string $overrideBaseUrl = null, string $overrideBaseWSUrl = null) { + parent::__construct($accountSid, $authToken, $workspaceSid, $taskQueueSid, null, $overrideBaseUrl, $overrideBaseWSUrl); + } + + protected function setupResource(): void { + $this->resourceUrl = $this->baseUrl . '/TaskQueues/' . $this->channelId; + } +} diff --git a/app/api/Twilio/Jwt/TaskRouter/WorkerCapability.php b/app/api/Twilio/Jwt/TaskRouter/WorkerCapability.php new file mode 100755 index 0000000..431f8c2 --- /dev/null +++ b/app/api/Twilio/Jwt/TaskRouter/WorkerCapability.php @@ -0,0 +1,49 @@ + + * @license http://creativecommons.org/licenses/MIT/ MIT + */ +class WorkerCapability extends CapabilityToken { + private $tasksUrl; + private $workerReservationsUrl; + private $activityUrl; + + public function __construct(string $accountSid, string $authToken, string $workspaceSid, string $workerSid, + string $overrideBaseUrl = null, string $overrideBaseWSUrl = null) { + parent::__construct($accountSid, $authToken, $workspaceSid, $workerSid, null, $overrideBaseUrl, $overrideBaseWSUrl); + + $this->tasksUrl = $this->baseUrl . '/Tasks/**'; + $this->activityUrl = $this->baseUrl . '/Activities'; + $this->workerReservationsUrl = $this->resourceUrl . '/Reservations/**'; + + //add permissions to fetch the list of activities, tasks, and worker reservations + $this->allow($this->activityUrl, 'GET', null, null); + $this->allow($this->tasksUrl, 'GET', null, null); + $this->allow($this->workerReservationsUrl, 'GET', null, null); + } + + protected function setupResource(): void { + $this->resourceUrl = $this->baseUrl . '/Workers/' . $this->channelId; + } + + public function allowActivityUpdates(): void { + $method = 'POST'; + $queryFilter = []; + $postFilter = ['ActivitySid' => $this->required]; + $this->allow($this->resourceUrl, $method, $queryFilter, $postFilter); + } + + public function allowReservationUpdates(): void { + $method = 'POST'; + $queryFilter = []; + $postFilter = []; + $this->allow($this->tasksUrl, $method, $queryFilter, $postFilter); + $this->allow($this->workerReservationsUrl, $method, $queryFilter, $postFilter); + } +} diff --git a/app/api/Twilio/Jwt/TaskRouter/WorkspaceCapability.php b/app/api/Twilio/Jwt/TaskRouter/WorkspaceCapability.php new file mode 100755 index 0000000..39eeceb --- /dev/null +++ b/app/api/Twilio/Jwt/TaskRouter/WorkspaceCapability.php @@ -0,0 +1,16 @@ +resourceUrl = $this->baseUrl; + } +} diff --git a/app/api/Twilio/ListResource.php b/app/api/Twilio/ListResource.php new file mode 100755 index 0000000..705f908 --- /dev/null +++ b/app/api/Twilio/ListResource.php @@ -0,0 +1,19 @@ +version = $version; + } + + public function __toString(): string { + return '[ListResource]'; + } +} diff --git a/app/api/Twilio/Options.php b/app/api/Twilio/Options.php new file mode 100755 index 0000000..aa8851d --- /dev/null +++ b/app/api/Twilio/Options.php @@ -0,0 +1,13 @@ +options); + } +} diff --git a/app/api/Twilio/Page.php b/app/api/Twilio/Page.php new file mode 100755 index 0000000..252e388 --- /dev/null +++ b/app/api/Twilio/Page.php @@ -0,0 +1,195 @@ +processResponse($response); + + $this->version = $version; + $this->payload = $payload; + $this->solution = []; + $this->records = new \ArrayIterator($this->loadPage()); + } + + protected function processResponse(Response $response) { + if ($response->getStatusCode() !== 200 && !$this->isPagingEol($response->getContent())) { + $message = '[HTTP ' . $response->getStatusCode() . '] Unable to fetch page'; + $code = $response->getStatusCode(); + + $content = $response->getContent(); + $details = []; + $moreInfo = ''; + + if (\is_array($content)) { + $message .= isset($content['message']) ? ': ' . $content['message'] : ''; + $code = $content['code'] ?? $code; + $moreInfo = $content['more_info'] ?? ''; + $details = $content['details'] ?? [] ; + } + + throw new RestException($message, $code, $response->getStatusCode(), $moreInfo, $details); + } + return $response->getContent(); + } + + protected function isPagingEol(?array $content): bool { + return $content !== null && \array_key_exists('code', $content) && $content['code'] === 20006; + } + + protected function hasMeta(string $key): bool { + return \array_key_exists('meta', $this->payload) && \array_key_exists($key, $this->payload['meta']); + } + + protected function getMeta(string $key, string $default = null): ?string { + return $this->hasMeta($key) ? $this->payload['meta'][$key] : $default; + } + + protected function loadPage(): array { + $key = $this->getMeta('key'); + if ($key) { + return $this->payload[$key]; + } + + $keys = \array_keys($this->payload); + $key = \array_diff($keys, self::$metaKeys); + $key = \array_values($key); + + if (\count($key) === 1) { + return $this->payload[$key[0]]; + } + + // handle end of results error code + if ($this->isPagingEol($this->payload)) { + return []; + } + + throw new DeserializeException('Page Records can not be deserialized'); + } + + public function getPreviousPageUrl(): ?string { + if ($this->hasMeta('previous_page_url')) { + return $this->getMeta('previous_page_url'); + } else if (\array_key_exists('previous_page_uri', $this->payload) && $this->payload['previous_page_uri']) { + return $this->getVersion()->getDomain()->absoluteUrl($this->payload['previous_page_uri']); + } + return null; + } + + public function getNextPageUrl(): ?string { + if ($this->hasMeta('next_page_url')) { + return $this->getMeta('next_page_url'); + } else if (\array_key_exists('next_page_uri', $this->payload) && $this->payload['next_page_uri']) { + return $this->getVersion()->getDomain()->absoluteUrl($this->payload['next_page_uri']); + } + return null; + } + + public function nextPage(): ?Page { + if (!$this->getNextPageUrl()) { + return null; + } + + $response = $this->getVersion()->getDomain()->getClient()->request('GET', $this->getNextPageUrl()); + return new static($this->getVersion(), $response, $this->solution); + } + + public function previousPage(): ?Page { + if (!$this->getPreviousPageUrl()) { + return null; + } + + $response = $this->getVersion()->getDomain()->getClient()->request('GET', $this->getPreviousPageUrl()); + return new static($this->getVersion(), $response, $this->solution); + } + + /** + * (PHP 5 >= 5.0.0)
+ * Return the current element + * @link http://php.net/manual/en/iterator.current.php + * @return mixed Can return any type. + */ + #[\ReturnTypeWillChange] + public function current() { + return $this->buildInstance($this->records->current()); + } + + /** + * (PHP 5 >= 5.0.0)
+ * Move forward to next element + * @link http://php.net/manual/en/iterator.next.php + * @return void Any returned value is ignored. + */ + public function next(): void { + $this->records->next(); + } + + /** + * (PHP 5 >= 5.0.0)
+ * Return the key of the current element + * @link http://php.net/manual/en/iterator.key.php + * @return mixed scalar on success, or null on failure. + */ + #[\ReturnTypeWillChange] + public function key() { + return $this->records->key(); + } + + /** + * (PHP 5 >= 5.0.0)
+ * Checks if current position is valid + * @link http://php.net/manual/en/iterator.valid.php + * @return bool The return value will be casted to boolean and then evaluated. + * Returns true on success or false on failure. + */ + public function valid(): bool { + return $this->records->valid(); + } + + /** + * (PHP 5 >= 5.0.0)
+ * Rewind the Iterator to the first element + * @link http://php.net/manual/en/iterator.rewind.php + * @return void Any returned value is ignored. + */ + public function rewind(): void { + $this->records->rewind(); + } + + + public function getVersion(): Version { + return $this->version; + } + + public function __toString(): string { + return '[Page]'; + } + +} diff --git a/app/api/Twilio/Rest/Accounts.php b/app/api/Twilio/Rest/Accounts.php new file mode 100755 index 0000000..7d539dc --- /dev/null +++ b/app/api/Twilio/Rest/Accounts.php @@ -0,0 +1,47 @@ +authTokenPromotion instead + */ + protected function getAuthTokenPromotion(): \Twilio\Rest\Accounts\V1\AuthTokenPromotionList { + echo "authTokenPromotion is deprecated. Use v1->authTokenPromotion instead."; + return $this->v1->authTokenPromotion; + } + + /** + * @deprecated Use v1->authTokenPromotion() instead. + */ + protected function contextAuthTokenPromotion(): \Twilio\Rest\Accounts\V1\AuthTokenPromotionContext { + echo "authTokenPromotion() is deprecated. Use v1->authTokenPromotion() instead."; + return $this->v1->authTokenPromotion(); + } + + /** + * @deprecated Use v1->credentials instead. + */ + protected function getCredentials(): \Twilio\Rest\Accounts\V1\CredentialList { + echo "credentials is deprecated. Use v1->credentials instead."; + return $this->v1->credentials; + } + + /** + * @deprecated Use v1->secondaryAuthToken instead. + */ + protected function getSecondaryAuthToken(): \Twilio\Rest\Accounts\V1\SecondaryAuthTokenList { + echo "secondaryAuthToken is deprecated. Use v1->secondaryAuthToken instead."; + return $this->v1->secondaryAuthToken; + } + + /** + * @deprecated Use v1->secondaryAuthToken() instead. + */ + protected function contextSecondaryAuthToken(): \Twilio\Rest\Accounts\V1\SecondaryAuthTokenContext { + echo "secondaryAuthToken() is deprecated. Use v1->secondaryAuthToken() instead."; + return $this->v1->secondaryAuthToken(); + } +} \ No newline at end of file diff --git a/app/api/Twilio/Rest/Accounts/V1.php b/app/api/Twilio/Rest/Accounts/V1.php new file mode 100755 index 0000000..036eb9c --- /dev/null +++ b/app/api/Twilio/Rest/Accounts/V1.php @@ -0,0 +1,116 @@ +version = 'v1'; + } + + protected function getAuthTokenPromotion(): AuthTokenPromotionList + { + if (!$this->_authTokenPromotion) { + $this->_authTokenPromotion = new AuthTokenPromotionList($this); + } + return $this->_authTokenPromotion; + } + + protected function getCredentials(): CredentialList + { + if (!$this->_credentials) { + $this->_credentials = new CredentialList($this); + } + return $this->_credentials; + } + + protected function getSecondaryAuthToken(): SecondaryAuthTokenList + { + if (!$this->_secondaryAuthToken) { + $this->_secondaryAuthToken = new SecondaryAuthTokenList($this); + } + return $this->_secondaryAuthToken; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Accounts.V1]'; + } +} diff --git a/app/api/Twilio/Rest/Accounts/V1/AuthTokenPromotionContext.php b/app/api/Twilio/Rest/Accounts/V1/AuthTokenPromotionContext.php new file mode 100755 index 0000000..5681708 --- /dev/null +++ b/app/api/Twilio/Rest/Accounts/V1/AuthTokenPromotionContext.php @@ -0,0 +1,75 @@ +solution = [ + ]; + + $this->uri = '/AuthTokens/Promote'; + } + + /** + * Update the AuthTokenPromotionInstance + * + * @return AuthTokenPromotionInstance Updated AuthTokenPromotionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(): AuthTokenPromotionInstance + { + + $payload = $this->version->update('POST', $this->uri); + + return new AuthTokenPromotionInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Accounts.V1.AuthTokenPromotionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Accounts/V1/AuthTokenPromotionInstance.php b/app/api/Twilio/Rest/Accounts/V1/AuthTokenPromotionInstance.php new file mode 100755 index 0000000..14a1ab1 --- /dev/null +++ b/app/api/Twilio/Rest/Accounts/V1/AuthTokenPromotionInstance.php @@ -0,0 +1,122 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'authToken' => Values::array_get($payload, 'auth_token'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = []; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AuthTokenPromotionContext Context for this AuthTokenPromotionInstance + */ + protected function proxy(): AuthTokenPromotionContext + { + if (!$this->context) { + $this->context = new AuthTokenPromotionContext( + $this->version + ); + } + + return $this->context; + } + + /** + * Update the AuthTokenPromotionInstance + * + * @return AuthTokenPromotionInstance Updated AuthTokenPromotionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(): AuthTokenPromotionInstance + { + + return $this->proxy()->update(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Accounts.V1.AuthTokenPromotionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Accounts/V1/AuthTokenPromotionList.php b/app/api/Twilio/Rest/Accounts/V1/AuthTokenPromotionList.php new file mode 100755 index 0000000..4f12292 --- /dev/null +++ b/app/api/Twilio/Rest/Accounts/V1/AuthTokenPromotionList.php @@ -0,0 +1,61 @@ +solution = [ + ]; + } + + /** + * Constructs a AuthTokenPromotionContext + */ + public function getContext( + + ): AuthTokenPromotionContext + { + return new AuthTokenPromotionContext( + $this->version + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Accounts.V1.AuthTokenPromotionList]'; + } +} diff --git a/app/api/Twilio/Rest/Accounts/V1/AuthTokenPromotionPage.php b/app/api/Twilio/Rest/Accounts/V1/AuthTokenPromotionPage.php new file mode 100755 index 0000000..32a5ee2 --- /dev/null +++ b/app/api/Twilio/Rest/Accounts/V1/AuthTokenPromotionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AuthTokenPromotionInstance \Twilio\Rest\Accounts\V1\AuthTokenPromotionInstance + */ + public function buildInstance(array $payload): AuthTokenPromotionInstance + { + return new AuthTokenPromotionInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Accounts.V1.AuthTokenPromotionPage]'; + } +} diff --git a/app/api/Twilio/Rest/Accounts/V1/Credential/AwsContext.php b/app/api/Twilio/Rest/Accounts/V1/Credential/AwsContext.php new file mode 100755 index 0000000..638861a --- /dev/null +++ b/app/api/Twilio/Rest/Accounts/V1/Credential/AwsContext.php @@ -0,0 +1,123 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Credentials/AWS/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the AwsInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the AwsInstance + * + * @return AwsInstance Fetched AwsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AwsInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new AwsInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the AwsInstance + * + * @param array|Options $options Optional Arguments + * @return AwsInstance Updated AwsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): AwsInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new AwsInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Accounts.V1.AwsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Accounts/V1/Credential/AwsInstance.php b/app/api/Twilio/Rest/Accounts/V1/Credential/AwsInstance.php new file mode 100755 index 0000000..f9bc1cc --- /dev/null +++ b/app/api/Twilio/Rest/Accounts/V1/Credential/AwsInstance.php @@ -0,0 +1,152 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AwsContext Context for this AwsInstance + */ + protected function proxy(): AwsContext + { + if (!$this->context) { + $this->context = new AwsContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the AwsInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the AwsInstance + * + * @return AwsInstance Fetched AwsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AwsInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the AwsInstance + * + * @param array|Options $options Optional Arguments + * @return AwsInstance Updated AwsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): AwsInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Accounts.V1.AwsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Accounts/V1/Credential/AwsList.php b/app/api/Twilio/Rest/Accounts/V1/Credential/AwsList.php new file mode 100755 index 0000000..f77bc4c --- /dev/null +++ b/app/api/Twilio/Rest/Accounts/V1/Credential/AwsList.php @@ -0,0 +1,194 @@ +solution = [ + ]; + + $this->uri = '/Credentials/AWS'; + } + + /** + * Create the AwsInstance + * + * @param string $credentials A string that contains the AWS access credentials in the format `:`. For example, `AKIAIOSFODNN7EXAMPLE:wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY` + * @param array|Options $options Optional Arguments + * @return AwsInstance Created AwsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $credentials, array $options = []): AwsInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Credentials' => + $credentials, + 'FriendlyName' => + $options['friendlyName'], + 'AccountSid' => + $options['accountSid'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new AwsInstance( + $this->version, + $payload + ); + } + + + /** + * Reads AwsInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return AwsInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams AwsInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AwsInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return AwsPage Page of AwsInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AwsPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new AwsPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of AwsInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return AwsPage Page of AwsInstance + */ + public function getPage(string $targetUrl): AwsPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AwsPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AwsContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the AWS resource to delete. + */ + public function getContext( + string $sid + + ): AwsContext + { + return new AwsContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Accounts.V1.AwsList]'; + } +} diff --git a/app/api/Twilio/Rest/Accounts/V1/Credential/AwsOptions.php b/app/api/Twilio/Rest/Accounts/V1/Credential/AwsOptions.php new file mode 100755 index 0000000..ca016b2 --- /dev/null +++ b/app/api/Twilio/Rest/Accounts/V1/Credential/AwsOptions.php @@ -0,0 +1,152 @@ +options['friendlyName'] = $friendlyName; + $this->options['accountSid'] = $accountSid; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The SID of the Subaccount that this Credential should be associated with. Must be a valid Subaccount of the account issuing the request. + * + * @param string $accountSid The SID of the Subaccount that this Credential should be associated with. Must be a valid Subaccount of the account issuing the request. + * @return $this Fluent Builder + */ + public function setAccountSid(string $accountSid): self + { + $this->options['accountSid'] = $accountSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Accounts.V1.CreateAwsOptions ' . $options . ']'; + } +} + + + + +class UpdateAwsOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + */ + public function __construct( + + string $friendlyName = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Accounts.V1.UpdateAwsOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Accounts/V1/Credential/AwsPage.php b/app/api/Twilio/Rest/Accounts/V1/Credential/AwsPage.php new file mode 100755 index 0000000..94483b3 --- /dev/null +++ b/app/api/Twilio/Rest/Accounts/V1/Credential/AwsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AwsInstance \Twilio\Rest\Accounts\V1\Credential\AwsInstance + */ + public function buildInstance(array $payload): AwsInstance + { + return new AwsInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Accounts.V1.AwsPage]'; + } +} diff --git a/app/api/Twilio/Rest/Accounts/V1/Credential/PublicKeyContext.php b/app/api/Twilio/Rest/Accounts/V1/Credential/PublicKeyContext.php new file mode 100755 index 0000000..22867ff --- /dev/null +++ b/app/api/Twilio/Rest/Accounts/V1/Credential/PublicKeyContext.php @@ -0,0 +1,123 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Credentials/PublicKeys/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the PublicKeyInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the PublicKeyInstance + * + * @return PublicKeyInstance Fetched PublicKeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PublicKeyInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new PublicKeyInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the PublicKeyInstance + * + * @param array|Options $options Optional Arguments + * @return PublicKeyInstance Updated PublicKeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): PublicKeyInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new PublicKeyInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Accounts.V1.PublicKeyContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Accounts/V1/Credential/PublicKeyInstance.php b/app/api/Twilio/Rest/Accounts/V1/Credential/PublicKeyInstance.php new file mode 100755 index 0000000..5032fc4 --- /dev/null +++ b/app/api/Twilio/Rest/Accounts/V1/Credential/PublicKeyInstance.php @@ -0,0 +1,152 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return PublicKeyContext Context for this PublicKeyInstance + */ + protected function proxy(): PublicKeyContext + { + if (!$this->context) { + $this->context = new PublicKeyContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the PublicKeyInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the PublicKeyInstance + * + * @return PublicKeyInstance Fetched PublicKeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PublicKeyInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the PublicKeyInstance + * + * @param array|Options $options Optional Arguments + * @return PublicKeyInstance Updated PublicKeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): PublicKeyInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Accounts.V1.PublicKeyInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Accounts/V1/Credential/PublicKeyList.php b/app/api/Twilio/Rest/Accounts/V1/Credential/PublicKeyList.php new file mode 100755 index 0000000..3ab08fa --- /dev/null +++ b/app/api/Twilio/Rest/Accounts/V1/Credential/PublicKeyList.php @@ -0,0 +1,194 @@ +solution = [ + ]; + + $this->uri = '/Credentials/PublicKeys'; + } + + /** + * Create the PublicKeyInstance + * + * @param string $publicKey A URL encoded representation of the public key. For example, `-----BEGIN PUBLIC KEY-----MIIBIjANB.pa9xQIDAQAB-----END PUBLIC KEY-----` + * @param array|Options $options Optional Arguments + * @return PublicKeyInstance Created PublicKeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $publicKey, array $options = []): PublicKeyInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'PublicKey' => + $publicKey, + 'FriendlyName' => + $options['friendlyName'], + 'AccountSid' => + $options['accountSid'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new PublicKeyInstance( + $this->version, + $payload + ); + } + + + /** + * Reads PublicKeyInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return PublicKeyInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams PublicKeyInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of PublicKeyInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return PublicKeyPage Page of PublicKeyInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): PublicKeyPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new PublicKeyPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of PublicKeyInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return PublicKeyPage Page of PublicKeyInstance + */ + public function getPage(string $targetUrl): PublicKeyPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new PublicKeyPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a PublicKeyContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the PublicKey resource to delete. + */ + public function getContext( + string $sid + + ): PublicKeyContext + { + return new PublicKeyContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Accounts.V1.PublicKeyList]'; + } +} diff --git a/app/api/Twilio/Rest/Accounts/V1/Credential/PublicKeyOptions.php b/app/api/Twilio/Rest/Accounts/V1/Credential/PublicKeyOptions.php new file mode 100755 index 0000000..acd9687 --- /dev/null +++ b/app/api/Twilio/Rest/Accounts/V1/Credential/PublicKeyOptions.php @@ -0,0 +1,152 @@ +options['friendlyName'] = $friendlyName; + $this->options['accountSid'] = $accountSid; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The SID of the Subaccount that this Credential should be associated with. Must be a valid Subaccount of the account issuing the request + * + * @param string $accountSid The SID of the Subaccount that this Credential should be associated with. Must be a valid Subaccount of the account issuing the request + * @return $this Fluent Builder + */ + public function setAccountSid(string $accountSid): self + { + $this->options['accountSid'] = $accountSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Accounts.V1.CreatePublicKeyOptions ' . $options . ']'; + } +} + + + + +class UpdatePublicKeyOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + */ + public function __construct( + + string $friendlyName = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Accounts.V1.UpdatePublicKeyOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Accounts/V1/Credential/PublicKeyPage.php b/app/api/Twilio/Rest/Accounts/V1/Credential/PublicKeyPage.php new file mode 100755 index 0000000..3c2c656 --- /dev/null +++ b/app/api/Twilio/Rest/Accounts/V1/Credential/PublicKeyPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PublicKeyInstance \Twilio\Rest\Accounts\V1\Credential\PublicKeyInstance + */ + public function buildInstance(array $payload): PublicKeyInstance + { + return new PublicKeyInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Accounts.V1.PublicKeyPage]'; + } +} diff --git a/app/api/Twilio/Rest/Accounts/V1/CredentialInstance.php b/app/api/Twilio/Rest/Accounts/V1/CredentialInstance.php new file mode 100755 index 0000000..3e4b9b1 --- /dev/null +++ b/app/api/Twilio/Rest/Accounts/V1/CredentialInstance.php @@ -0,0 +1,71 @@ +solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Accounts.V1.CredentialInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Accounts/V1/CredentialList.php b/app/api/Twilio/Rest/Accounts/V1/CredentialList.php new file mode 100755 index 0000000..6b8e6c1 --- /dev/null +++ b/app/api/Twilio/Rest/Accounts/V1/CredentialList.php @@ -0,0 +1,123 @@ +solution = [ + ]; + } + + /** + * Access the aws + */ + protected function getAws(): AwsList + { + if (!$this->_aws) { + $this->_aws = new AwsList( + $this->version + ); + } + return $this->_aws; + } + + /** + * Access the publicKey + */ + protected function getPublicKey(): PublicKeyList + { + if (!$this->_publicKey) { + $this->_publicKey = new PublicKeyList( + $this->version + ); + } + return $this->_publicKey; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name) + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Accounts.V1.CredentialList]'; + } +} diff --git a/app/api/Twilio/Rest/Accounts/V1/CredentialPage.php b/app/api/Twilio/Rest/Accounts/V1/CredentialPage.php new file mode 100755 index 0000000..95adb71 --- /dev/null +++ b/app/api/Twilio/Rest/Accounts/V1/CredentialPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CredentialInstance \Twilio\Rest\Accounts\V1\CredentialInstance + */ + public function buildInstance(array $payload): CredentialInstance + { + return new CredentialInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Accounts.V1.CredentialPage]'; + } +} diff --git a/app/api/Twilio/Rest/Accounts/V1/SecondaryAuthTokenContext.php b/app/api/Twilio/Rest/Accounts/V1/SecondaryAuthTokenContext.php new file mode 100755 index 0000000..f5883be --- /dev/null +++ b/app/api/Twilio/Rest/Accounts/V1/SecondaryAuthTokenContext.php @@ -0,0 +1,88 @@ +solution = [ + ]; + + $this->uri = '/AuthTokens/Secondary'; + } + + /** + * Create the SecondaryAuthTokenInstance + * + * @return SecondaryAuthTokenInstance Created SecondaryAuthTokenInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(): SecondaryAuthTokenInstance + { + + $payload = $this->version->create('POST', $this->uri); + + return new SecondaryAuthTokenInstance( + $this->version, + $payload + ); + } + + + /** + * Delete the SecondaryAuthTokenInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Accounts.V1.SecondaryAuthTokenContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Accounts/V1/SecondaryAuthTokenInstance.php b/app/api/Twilio/Rest/Accounts/V1/SecondaryAuthTokenInstance.php new file mode 100755 index 0000000..c9e8f73 --- /dev/null +++ b/app/api/Twilio/Rest/Accounts/V1/SecondaryAuthTokenInstance.php @@ -0,0 +1,134 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'secondaryAuthToken' => Values::array_get($payload, 'secondary_auth_token'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = []; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SecondaryAuthTokenContext Context for this SecondaryAuthTokenInstance + */ + protected function proxy(): SecondaryAuthTokenContext + { + if (!$this->context) { + $this->context = new SecondaryAuthTokenContext( + $this->version + ); + } + + return $this->context; + } + + /** + * Create the SecondaryAuthTokenInstance + * + * @return SecondaryAuthTokenInstance Created SecondaryAuthTokenInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(): SecondaryAuthTokenInstance + { + + return $this->proxy()->create(); + } + + /** + * Delete the SecondaryAuthTokenInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Accounts.V1.SecondaryAuthTokenInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Accounts/V1/SecondaryAuthTokenList.php b/app/api/Twilio/Rest/Accounts/V1/SecondaryAuthTokenList.php new file mode 100755 index 0000000..c3671ab --- /dev/null +++ b/app/api/Twilio/Rest/Accounts/V1/SecondaryAuthTokenList.php @@ -0,0 +1,61 @@ +solution = [ + ]; + } + + /** + * Constructs a SecondaryAuthTokenContext + */ + public function getContext( + + ): SecondaryAuthTokenContext + { + return new SecondaryAuthTokenContext( + $this->version + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Accounts.V1.SecondaryAuthTokenList]'; + } +} diff --git a/app/api/Twilio/Rest/Accounts/V1/SecondaryAuthTokenPage.php b/app/api/Twilio/Rest/Accounts/V1/SecondaryAuthTokenPage.php new file mode 100755 index 0000000..9e4809b --- /dev/null +++ b/app/api/Twilio/Rest/Accounts/V1/SecondaryAuthTokenPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SecondaryAuthTokenInstance \Twilio\Rest\Accounts\V1\SecondaryAuthTokenInstance + */ + public function buildInstance(array $payload): SecondaryAuthTokenInstance + { + return new SecondaryAuthTokenInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Accounts.V1.SecondaryAuthTokenPage]'; + } +} diff --git a/app/api/Twilio/Rest/AccountsBase.php b/app/api/Twilio/Rest/AccountsBase.php new file mode 100755 index 0000000..87371cb --- /dev/null +++ b/app/api/Twilio/Rest/AccountsBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://accounts.twilio.com'; + } + + + /** + * @return V1 Version v1 of accounts + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Accounts]'; + } +} diff --git a/app/api/Twilio/Rest/Api.php b/app/api/Twilio/Rest/Api.php new file mode 100755 index 0000000..dc589b1 --- /dev/null +++ b/app/api/Twilio/Rest/Api.php @@ -0,0 +1,371 @@ +v2010->account; + } + + protected function getAccounts(): \Twilio\Rest\Api\V2010\AccountList { + return $this->v2010->accounts; + } + + /** + * @param string $sid Fetch by unique Account Sid + */ + protected function contextAccounts(string $sid): \Twilio\Rest\Api\V2010\AccountContext { + return $this->v2010->accounts($sid); + } + + /** + * @deprecated Use account->addresses instead. + */ + protected function getAddresses(): \Twilio\Rest\Api\V2010\Account\AddressList { + echo "addresses is deprecated. Use account->addresses instead."; + return $this->v2010->account->addresses; + } + + /** + * @deprecated Use account->addresses(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextAddresses(string $sid): \Twilio\Rest\Api\V2010\Account\AddressContext { + echo "addresses(\$sid) is deprecated. Use account->addresses(\$sid) instead."; + return $this->v2010->account->addresses($sid); + } + + /** + * @deprecated Use account->applications instead. + */ + protected function getApplications(): \Twilio\Rest\Api\V2010\Account\ApplicationList { + echo "applications is deprecated. Use account->applications instead."; + return $this->v2010->account->applications; + } + + /** + * @deprecated Use account->applications(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextApplications(string $sid): \Twilio\Rest\Api\V2010\Account\ApplicationContext { + echo "applications(\$sid) is deprecated. Use account->applications(\$sid) instead."; + return $this->v2010->account->applications($sid); + } + + /** + * @deprecated Use account->authorizedConnectApps instead. + */ + protected function getAuthorizedConnectApps(): \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppList { + echo "authorizedConnectApps is deprecated. Use account->authorizedConnectApps instead."; + return $this->v2010->account->authorizedConnectApps; + } + + /** + * @deprecated Use account->authorizedConnectApps(\$connectAppSid) instead. + * @param string $connectAppSid The SID of the Connect App to fetch + */ + protected function contextAuthorizedConnectApps(string $connectAppSid): \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppContext { + echo "authorizedConnectApps(\$connectAppSid) is deprecated. Use account->authorizedConnectApps(\$connectAppSid) instead."; + return $this->v2010->account->authorizedConnectApps($connectAppSid); + } + + /** + * @deprecated Use account->availablePhoneNumbers instead. + */ + protected function getAvailablePhoneNumbers(): \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryList { + echo "availablePhoneNumbers is deprecated. Use account->availablePhoneNumbers instead."; + return $this->v2010->account->availablePhoneNumbers; + } + + /** + * @deprecated Use account->availablePhoneNumbers(\$countryCode) instead. + * @param string $countryCode The ISO country code of the country to fetch + * available phone number information about + */ + protected function contextAvailablePhoneNumbers(string $countryCode): \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryContext { + echo "availablePhoneNumbers(\$countryCode) is deprecated. Use account->availablePhoneNumbers(\$countryCode) instead."; + return $this->v2010->account->availablePhoneNumbers($countryCode); + } + + /** + * @deprecated Use account->balance instead. + */ + protected function getBalance(): \Twilio\Rest\Api\V2010\Account\BalanceList { + echo "balance is deprecated. Use account->balance instead."; + return $this->v2010->account->balance; + } + + /** + * @deprecated Use account->calls instead + */ + protected function getCalls(): \Twilio\Rest\Api\V2010\Account\CallList { + echo "calls is deprecated. Use account->calls instead."; + return $this->v2010->account->calls; + } + + /** + * @deprecated Use account->calls(\$sid) instead. + * @param string $sid The SID of the Call resource to fetch + */ + protected function contextCalls(string $sid): \Twilio\Rest\Api\V2010\Account\CallContext { + echo "calls(\$sid) is deprecated. Use account->calls(\$sid) instead."; + return $this->v2010->account->calls($sid); + } + + /** + * @deprecated Use account->conferences instead. + */ + protected function getConferences(): \Twilio\Rest\Api\V2010\Account\ConferenceList { + echo "conferences is deprecated. Use account->conferences instead."; + return $this->v2010->account->conferences; + } + + /** + * @deprecated Use account->conferences(\$sid) instead. + * @param string $sid The unique string that identifies this resource + */ + protected function contextConferences(string $sid): \Twilio\Rest\Api\V2010\Account\ConferenceContext { + echo "conferences(\$sid) is deprecated. Use account->conferences(\$sid) instead."; + return $this->v2010->account->conferences($sid); + } + + /** + * @deprecated Use account->connectApps instead. + */ + protected function getConnectApps(): \Twilio\Rest\Api\V2010\Account\ConnectAppList { + echo "connectApps is deprecated. Use account->connectApps instead."; + return $this->v2010->account->connectApps; + } + + /** + * @deprecated account->connectApps(\$sid) + * @param string $sid The unique string that identifies the resource + */ + protected function contextConnectApps(string $sid): \Twilio\Rest\Api\V2010\Account\ConnectAppContext { + echo "connectApps(\$sid) is deprecated. Use account->connectApps(\$sid) instead."; + return $this->v2010->account->connectApps($sid); + } + + /** + * @deprecated Use account->incomingPhoneNumbers instead + */ + protected function getIncomingPhoneNumbers(): \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList { + echo "incomingPhoneNumbers is deprecated. Use account->incomingPhoneNumbers instead."; + return $this->v2010->account->incomingPhoneNumbers; + } + + /** + * @deprecated Use account->incomingPhoneNumbers(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextIncomingPhoneNumbers(string $sid): \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberContext { + echo "incomingPhoneNumbers(\$sid) is deprecated. Use account->incomingPhoneNumbers(\$sid) instead."; + return $this->v2010->account->incomingPhoneNumbers($sid); + } + + /** + * @deprecated Use account->keys instead. + */ + protected function getKeys(): \Twilio\Rest\Api\V2010\Account\KeyList { + echo "keys is deprecated. Use account->keys instead."; + return $this->v2010->account->keys; + } + + /** + * @deprecated Use account->keys(\$sid) instead + * @param string $sid The unique string that identifies the resource + */ + protected function contextKeys(string $sid): \Twilio\Rest\Api\V2010\Account\KeyContext { + echo "keys(\$sid) is deprecated. Use account->keys(\$sid) instead."; + return $this->v2010->account->keys($sid); + } + + /** + * @deprecated Use account->messages instead. + */ + protected function getMessages(): \Twilio\Rest\Api\V2010\Account\MessageList { + echo "messages is deprecated. Use account->messages instead."; + return $this->v2010->account->messages; + } + + /** + * @deprecated Use account->messages(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextMessages(string $sid): \Twilio\Rest\Api\V2010\Account\MessageContext { + echo "amessages(\$sid) is deprecated. Use account->messages(\$sid) instead."; + return $this->v2010->account->messages($sid); + } + + /** + * @deprecated Use account->newKeys instead. + */ + protected function getNewKeys(): \Twilio\Rest\Api\V2010\Account\NewKeyList { + echo "newKeys is deprecated. Use account->newKeys instead."; + return $this->v2010->account->newKeys; + } + + /** + * @deprecated Use account->newSigningKeys instead. + */ + protected function getNewSigningKeys(): \Twilio\Rest\Api\V2010\Account\NewSigningKeyList { + echo "newSigningKeys is deprecated. Use account->newSigningKeys instead."; + return $this->v2010->account->newSigningKeys; + } + + /** + * @deprecated Use account->notifications instead. + */ + protected function getNotifications(): \Twilio\Rest\Api\V2010\Account\NotificationList { + echo "notifications is deprecated. Use account->notifications instead."; + return $this->v2010->account->notifications; + } + + /** + * @deprecated Use account->notifications(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextNotifications(string $sid): \Twilio\Rest\Api\V2010\Account\NotificationContext { + echo "notifications(\$sid) is deprecated. Use account->notifications(\$sid) instead."; + return $this->v2010->account->notifications($sid); + } + + /** + * @deprecated Use account->outgoingCallerIds instead. + */ + protected function getOutgoingCallerIds(): \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList { + echo "outgoingCallerIds is deprecated. Use account->outgoingCallerIds instead."; + return $this->v2010->account->outgoingCallerIds; + } + + /** + * @deprecated Use account->outgoingCallerIds(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextOutgoingCallerIds(string $sid): \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdContext { + echo "outgoingCallerIds(\$sid) is deprecated. Use account->outgoingCallerIds(\$sid) instead."; + return $this->v2010->account->outgoingCallerIds($sid); + } + + /** + * @deprecated Use account->queues instead. + */ + protected function getQueues(): \Twilio\Rest\Api\V2010\Account\QueueList { + echo "queues is deprecated. Use account->queues instead."; + return $this->v2010->account->queues; + } + + /** + * @deprecated Use account->queues(\$sid) instead. + * @param string $sid The unique string that identifies this resource + */ + protected function contextQueues(string $sid): \Twilio\Rest\Api\V2010\Account\QueueContext { + echo "queues(\$sid) is deprecated. Use account->queues(\$sid) instead."; + return $this->v2010->account->queues($sid); + } + + /** + * @deprecated Use account->recordings instead. + */ + protected function getRecordings(): \Twilio\Rest\Api\V2010\Account\RecordingList { + echo "recordings is deprecated. Use account->recordings instead."; + return $this->v2010->account->recordings; + } + + /** + * @deprecated Use account->recordings(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextRecordings(string $sid): \Twilio\Rest\Api\V2010\Account\RecordingContext { + echo "recordings(\$sid) is deprecated. Use account->recordings(\$sid) instead."; + return $this->v2010->account->recordings($sid); + } + + /** + * @deprecated Use account->signingKeys instead. + */ + protected function getSigningKeys(): \Twilio\Rest\Api\V2010\Account\SigningKeyList { + echo "signingKeys is deprecated. Use account->signingKeys instead."; + return $this->v2010->account->signingKeys; + } + + /** + * @deprecated Use account->signingKeys(\$sid) instead. + * @param string $sid The sid + */ + protected function contextSigningKeys(string $sid): \Twilio\Rest\Api\V2010\Account\SigningKeyContext { + echo "signingKeys(\$sid) is deprecated. Use account->signingKeys(\$sid) instead."; + return $this->v2010->account->signingKeys($sid); + } + + /** + * @deprecated Use account->sip instead. + */ + protected function getSip(): \Twilio\Rest\Api\V2010\Account\SipList { + echo "sip is deprecated. Use account->sip instead."; + return $this->v2010->account->sip; + } + + /** + * @deprecated Use account->shortCodes instead. + */ + protected function getShortCodes(): \Twilio\Rest\Api\V2010\Account\ShortCodeList { + echo "shortCodes is deprecated. Use account->shortCodes instead."; + return $this->v2010->account->shortCodes; + } + + /** + * @deprecated Use account->shortCodes(\$sid) instead. + * @param string $sid The unique string that identifies this resource + */ + protected function contextShortCodes(string $sid): \Twilio\Rest\Api\V2010\Account\ShortCodeContext { + echo "shortCodes(\$sid) is deprecated. Use account->shortCodes(\$sid) instead."; + return $this->v2010->account->shortCodes($sid); + } + + /** + * @deprecated Use account->token instead. + */ + protected function getTokens(): \Twilio\Rest\Api\V2010\Account\TokenList { + echo "tokens is deprecated. Use account->token instead."; + return $this->v2010->account->tokens; + } + + /** + * @deprecated Use account->transcriptions instead. + */ + protected function getTranscriptions(): \Twilio\Rest\Api\V2010\Account\TranscriptionList { + echo "transcriptions is deprecated. Use account->transcriptions instead."; + return $this->v2010->account->transcriptions; + } + + /** + * @deprecated Use account->transcriptions(\$sid) instead + * @param string $sid The unique string that identifies the resource + */ + protected function contextTranscriptions(string $sid): \Twilio\Rest\Api\V2010\Account\TranscriptionContext { + echo "transcriptions(\$sid) is deprecated. Use account->transcriptions(\$sid) instead."; + return $this->v2010->account->transcriptions($sid); + } + + /** + * @deprecated Use account->usage instead. + */ + protected function getUsage(): \Twilio\Rest\Api\V2010\Account\UsageList { + echo "usage is deprecated. Use account->usage instead."; + return $this->v2010->account->usage; + } + + /** + * @deprecated Use account->validationRequests instead. + */ + protected function getValidationRequests(): \Twilio\Rest\Api\V2010\Account\ValidationRequestList { + echo "validationRequests is deprecated. Use account->validationRequests instead."; + return $this->v2010->account->validationRequests; + } +} \ No newline at end of file diff --git a/app/api/Twilio/Rest/Api/V2010.php b/app/api/Twilio/Rest/Api/V2010.php new file mode 100755 index 0000000..a82ad29 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010.php @@ -0,0 +1,309 @@ +version = '2010-04-01'; + } + + protected function getAccounts(): AccountList + { + if (!$this->_accounts) { + $this->_accounts = new AccountList($this); + } + return $this->_accounts; + } + + /** + * @return AccountContext Account provided as the authenticating account + */ + protected function getAccount(): AccountContext + { + if (!$this->_account) { + $this->_account = new AccountContext( + $this, + $this->domain->getClient()->getAccountSid() + ); + } + return $this->_account; + } + + /** + * Setter to override the primary account + * + * @param AccountContext|AccountInstance $account account to use as the primary + * account + */ + public function setAccount($account): void + { + $this->_account = $account; + } + + protected function getRecordings(): \Twilio\Rest\Api\V2010\Account\RecordingList + { + return $this->account->recordings; + } + + protected function getUsage(): \Twilio\Rest\Api\V2010\Account\UsageList + { + return $this->account->usage; + } + + protected function getMessages(): \Twilio\Rest\Api\V2010\Account\MessageList + { + return $this->account->messages; + } + + protected function getKeys(): \Twilio\Rest\Api\V2010\Account\KeyList + { + return $this->account->keys; + } + + protected function getNewKeys(): \Twilio\Rest\Api\V2010\Account\NewKeyList + { + return $this->account->newKeys; + } + + protected function getApplications(): \Twilio\Rest\Api\V2010\Account\ApplicationList + { + return $this->account->applications; + } + + protected function getIncomingPhoneNumbers(): \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList + { + return $this->account->incomingPhoneNumbers; + } + + protected function getConferences(): \Twilio\Rest\Api\V2010\Account\ConferenceList + { + return $this->account->conferences; + } + + protected function getCalls(): \Twilio\Rest\Api\V2010\Account\CallList + { + return $this->account->calls; + } + + protected function getOutgoingCallerIds(): \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList + { + return $this->account->outgoingCallerIds; + } + + protected function getValidationRequests(): \Twilio\Rest\Api\V2010\Account\ValidationRequestList + { + return $this->account->validationRequests; + } + + protected function getTranscriptions(): \Twilio\Rest\Api\V2010\Account\TranscriptionList + { + return $this->account->transcriptions; + } + + protected function getConnectApps(): \Twilio\Rest\Api\V2010\Account\ConnectAppList + { + return $this->account->connectApps; + } + + protected function getAuthorizedConnectApps(): \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppList + { + return $this->account->authorizedConnectApps; + } + + protected function getTokens(): \Twilio\Rest\Api\V2010\Account\TokenList + { + return $this->account->tokens; + } + + protected function getBalance(): \Twilio\Rest\Api\V2010\Account\BalanceList + { + return $this->account->balance; + } + + protected function getSip(): \Twilio\Rest\Api\V2010\Account\SipList + { + return $this->account->sip; + } + + protected function getNotifications(): \Twilio\Rest\Api\V2010\Account\NotificationList + { + return $this->account->notifications; + } + + protected function getAvailablePhoneNumbers(): \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryList + { + return $this->account->availablePhoneNumbers; + } + + protected function getAddresses(): \Twilio\Rest\Api\V2010\Account\AddressList + { + return $this->account->addresses; + } + + protected function getQueues(): \Twilio\Rest\Api\V2010\Account\QueueList + { + return $this->account->queues; + } + + protected function getShortCodes(): \Twilio\Rest\Api\V2010\Account\ShortCodeList + { + return $this->account->shortCodes; + } + + protected function getSigningKeys(): \Twilio\Rest\Api\V2010\Account\SigningKeyList + { + return $this->account->signingKeys; + } + + protected function getNewSigningKeys(): \Twilio\Rest\Api\V2010\Account\NewSigningKeyList + { + return $this->account->newSigningKeys; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberInstance.php new file mode 100755 index 0000000..a5cfecf --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberInstance.php @@ -0,0 +1,133 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'phoneNumber' => Values::array_get($payload, 'phone_number'), + 'voiceUrl' => Values::array_get($payload, 'voice_url'), + 'voiceMethod' => Values::array_get($payload, 'voice_method'), + 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), + 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), + 'voiceCallerIdLookup' => Values::array_get($payload, 'voice_caller_id_lookup'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'), + 'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'), + 'smsMethod' => Values::array_get($payload, 'sms_method'), + 'smsUrl' => Values::array_get($payload, 'sms_url'), + 'addressRequirements' => Values::array_get($payload, 'address_requirements'), + 'capabilities' => Values::array_get($payload, 'capabilities'), + 'statusCallback' => Values::array_get($payload, 'status_callback'), + 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'smsApplicationSid' => Values::array_get($payload, 'sms_application_sid'), + 'voiceApplicationSid' => Values::array_get($payload, 'voice_application_sid'), + 'trunkSid' => Values::array_get($payload, 'trunk_sid'), + 'emergencyStatus' => Values::array_get($payload, 'emergency_status'), + 'emergencyAddressSid' => Values::array_get($payload, 'emergency_address_sid'), + 'uri' => Values::array_get($payload, 'uri'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'addressSid' => $addressSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.DependentPhoneNumberInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberList.php b/app/api/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberList.php new file mode 100755 index 0000000..3e7ba4b --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberList.php @@ -0,0 +1,157 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'addressSid' => + $addressSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Addresses/' . \rawurlencode($addressSid) + .'/DependentPhoneNumbers.json'; + } + + /** + * Reads DependentPhoneNumberInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return DependentPhoneNumberInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams DependentPhoneNumberInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of DependentPhoneNumberInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return DependentPhoneNumberPage Page of DependentPhoneNumberInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): DependentPhoneNumberPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new DependentPhoneNumberPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of DependentPhoneNumberInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return DependentPhoneNumberPage Page of DependentPhoneNumberInstance + */ + public function getPage(string $targetUrl): DependentPhoneNumberPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new DependentPhoneNumberPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.DependentPhoneNumberList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberPage.php new file mode 100755 index 0000000..091edd7 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Address/DependentPhoneNumberPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DependentPhoneNumberInstance \Twilio\Rest\Api\V2010\Account\Address\DependentPhoneNumberInstance + */ + public function buildInstance(array $payload): DependentPhoneNumberInstance + { + return new DependentPhoneNumberInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['addressSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.DependentPhoneNumberPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AddressContext.php b/app/api/Twilio/Rest/Api/V2010/Account/AddressContext.php new file mode 100755 index 0000000..c47a048 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AddressContext.php @@ -0,0 +1,205 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Addresses/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the AddressInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the AddressInstance + * + * @return AddressInstance Fetched AddressInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AddressInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new AddressInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the AddressInstance + * + * @param array|Options $options Optional Arguments + * @return AddressInstance Updated AddressInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): AddressInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'CustomerName' => + $options['customerName'], + 'Street' => + $options['street'], + 'City' => + $options['city'], + 'Region' => + $options['region'], + 'PostalCode' => + $options['postalCode'], + 'EmergencyEnabled' => + Serialize::booleanToString($options['emergencyEnabled']), + 'AutoCorrectAddress' => + Serialize::booleanToString($options['autoCorrectAddress']), + 'StreetSecondary' => + $options['streetSecondary'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new AddressInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the dependentPhoneNumbers + */ + protected function getDependentPhoneNumbers(): DependentPhoneNumberList + { + if (!$this->_dependentPhoneNumbers) { + $this->_dependentPhoneNumbers = new DependentPhoneNumberList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_dependentPhoneNumbers; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AddressContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AddressInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/AddressInstance.php new file mode 100755 index 0000000..7ccd971 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AddressInstance.php @@ -0,0 +1,185 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'city' => Values::array_get($payload, 'city'), + 'customerName' => Values::array_get($payload, 'customer_name'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'isoCountry' => Values::array_get($payload, 'iso_country'), + 'postalCode' => Values::array_get($payload, 'postal_code'), + 'region' => Values::array_get($payload, 'region'), + 'sid' => Values::array_get($payload, 'sid'), + 'street' => Values::array_get($payload, 'street'), + 'uri' => Values::array_get($payload, 'uri'), + 'emergencyEnabled' => Values::array_get($payload, 'emergency_enabled'), + 'validated' => Values::array_get($payload, 'validated'), + 'verified' => Values::array_get($payload, 'verified'), + 'streetSecondary' => Values::array_get($payload, 'street_secondary'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AddressContext Context for this AddressInstance + */ + protected function proxy(): AddressContext + { + if (!$this->context) { + $this->context = new AddressContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the AddressInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the AddressInstance + * + * @return AddressInstance Fetched AddressInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AddressInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the AddressInstance + * + * @param array|Options $options Optional Arguments + * @return AddressInstance Updated AddressInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): AddressInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the dependentPhoneNumbers + */ + protected function getDependentPhoneNumbers(): DependentPhoneNumberList + { + return $this->proxy()->dependentPhoneNumbers; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AddressInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AddressList.php b/app/api/Twilio/Rest/Api/V2010/Account/AddressList.php new file mode 100755 index 0000000..bfa6cd0 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AddressList.php @@ -0,0 +1,232 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Addresses.json'; + } + + /** + * Create the AddressInstance + * + * @param string $customerName The name to associate with the new address. + * @param string $street The number and street address of the new address. + * @param string $city The city of the new address. + * @param string $region The state or region of the new address. + * @param string $postalCode The postal code of the new address. + * @param string $isoCountry The ISO country code of the new address. + * @param array|Options $options Optional Arguments + * @return AddressInstance Created AddressInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $customerName, string $street, string $city, string $region, string $postalCode, string $isoCountry, array $options = []): AddressInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'CustomerName' => + $customerName, + 'Street' => + $street, + 'City' => + $city, + 'Region' => + $region, + 'PostalCode' => + $postalCode, + 'IsoCountry' => + $isoCountry, + 'FriendlyName' => + $options['friendlyName'], + 'EmergencyEnabled' => + Serialize::booleanToString($options['emergencyEnabled']), + 'AutoCorrectAddress' => + Serialize::booleanToString($options['autoCorrectAddress']), + 'StreetSecondary' => + $options['streetSecondary'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new AddressInstance( + $this->version, + $payload, + $this->solution['accountSid'] + ); + } + + + /** + * Reads AddressInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return AddressInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams AddressInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AddressInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return AddressPage Page of AddressInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AddressPage + { + $options = new Values($options); + + $params = Values::of([ + 'CustomerName' => + $options['customerName'], + 'FriendlyName' => + $options['friendlyName'], + 'IsoCountry' => + $options['isoCountry'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new AddressPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of AddressInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return AddressPage Page of AddressInstance + */ + public function getPage(string $targetUrl): AddressPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AddressPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AddressContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Address resource to delete. + */ + public function getContext( + string $sid + + ): AddressContext + { + return new AddressContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AddressList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AddressOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/AddressOptions.php new file mode 100755 index 0000000..0d4e1a9 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AddressOptions.php @@ -0,0 +1,418 @@ +options['friendlyName'] = $friendlyName; + $this->options['emergencyEnabled'] = $emergencyEnabled; + $this->options['autoCorrectAddress'] = $autoCorrectAddress; + $this->options['streetSecondary'] = $streetSecondary; + } + + /** + * A descriptive string that you create to describe the new address. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the new address. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Whether to enable emergency calling on the new address. Can be: `true` or `false`. + * + * @param bool $emergencyEnabled Whether to enable emergency calling on the new address. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setEmergencyEnabled(bool $emergencyEnabled): self + { + $this->options['emergencyEnabled'] = $emergencyEnabled; + return $this; + } + + /** + * Whether we should automatically correct the address. Can be: `true` or `false` and the default is `true`. If empty or `true`, we will correct the address you provide if necessary. If `false`, we won't alter the address you provide. + * + * @param bool $autoCorrectAddress Whether we should automatically correct the address. Can be: `true` or `false` and the default is `true`. If empty or `true`, we will correct the address you provide if necessary. If `false`, we won't alter the address you provide. + * @return $this Fluent Builder + */ + public function setAutoCorrectAddress(bool $autoCorrectAddress): self + { + $this->options['autoCorrectAddress'] = $autoCorrectAddress; + return $this; + } + + /** + * The additional number and street address of the address. + * + * @param string $streetSecondary The additional number and street address of the address. + * @return $this Fluent Builder + */ + public function setStreetSecondary(string $streetSecondary): self + { + $this->options['streetSecondary'] = $streetSecondary; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateAddressOptions ' . $options . ']'; + } +} + + + +class ReadAddressOptions extends Options + { + /** + * @param string $customerName The `customer_name` of the Address resources to read. + * @param string $friendlyName The string that identifies the Address resources to read. + * @param string $isoCountry The ISO country code of the Address resources to read. + */ + public function __construct( + + string $customerName = Values::NONE, + string $friendlyName = Values::NONE, + string $isoCountry = Values::NONE + + ) { + $this->options['customerName'] = $customerName; + $this->options['friendlyName'] = $friendlyName; + $this->options['isoCountry'] = $isoCountry; + } + + /** + * The `customer_name` of the Address resources to read. + * + * @param string $customerName The `customer_name` of the Address resources to read. + * @return $this Fluent Builder + */ + public function setCustomerName(string $customerName): self + { + $this->options['customerName'] = $customerName; + return $this; + } + + /** + * The string that identifies the Address resources to read. + * + * @param string $friendlyName The string that identifies the Address resources to read. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The ISO country code of the Address resources to read. + * + * @param string $isoCountry The ISO country code of the Address resources to read. + * @return $this Fluent Builder + */ + public function setIsoCountry(string $isoCountry): self + { + $this->options['isoCountry'] = $isoCountry; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadAddressOptions ' . $options . ']'; + } +} + +class UpdateAddressOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the address. It can be up to 64 characters long. + * @param string $customerName The name to associate with the address. + * @param string $street The number and street address of the address. + * @param string $city The city of the address. + * @param string $region The state or region of the address. + * @param string $postalCode The postal code of the address. + * @param bool $emergencyEnabled Whether to enable emergency calling on the address. Can be: `true` or `false`. + * @param bool $autoCorrectAddress Whether we should automatically correct the address. Can be: `true` or `false` and the default is `true`. If empty or `true`, we will correct the address you provide if necessary. If `false`, we won't alter the address you provide. + * @param string $streetSecondary The additional number and street address of the address. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $customerName = Values::NONE, + string $street = Values::NONE, + string $city = Values::NONE, + string $region = Values::NONE, + string $postalCode = Values::NONE, + bool $emergencyEnabled = Values::BOOL_NONE, + bool $autoCorrectAddress = Values::BOOL_NONE, + string $streetSecondary = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['customerName'] = $customerName; + $this->options['street'] = $street; + $this->options['city'] = $city; + $this->options['region'] = $region; + $this->options['postalCode'] = $postalCode; + $this->options['emergencyEnabled'] = $emergencyEnabled; + $this->options['autoCorrectAddress'] = $autoCorrectAddress; + $this->options['streetSecondary'] = $streetSecondary; + } + + /** + * A descriptive string that you create to describe the address. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the address. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The name to associate with the address. + * + * @param string $customerName The name to associate with the address. + * @return $this Fluent Builder + */ + public function setCustomerName(string $customerName): self + { + $this->options['customerName'] = $customerName; + return $this; + } + + /** + * The number and street address of the address. + * + * @param string $street The number and street address of the address. + * @return $this Fluent Builder + */ + public function setStreet(string $street): self + { + $this->options['street'] = $street; + return $this; + } + + /** + * The city of the address. + * + * @param string $city The city of the address. + * @return $this Fluent Builder + */ + public function setCity(string $city): self + { + $this->options['city'] = $city; + return $this; + } + + /** + * The state or region of the address. + * + * @param string $region The state or region of the address. + * @return $this Fluent Builder + */ + public function setRegion(string $region): self + { + $this->options['region'] = $region; + return $this; + } + + /** + * The postal code of the address. + * + * @param string $postalCode The postal code of the address. + * @return $this Fluent Builder + */ + public function setPostalCode(string $postalCode): self + { + $this->options['postalCode'] = $postalCode; + return $this; + } + + /** + * Whether to enable emergency calling on the address. Can be: `true` or `false`. + * + * @param bool $emergencyEnabled Whether to enable emergency calling on the address. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setEmergencyEnabled(bool $emergencyEnabled): self + { + $this->options['emergencyEnabled'] = $emergencyEnabled; + return $this; + } + + /** + * Whether we should automatically correct the address. Can be: `true` or `false` and the default is `true`. If empty or `true`, we will correct the address you provide if necessary. If `false`, we won't alter the address you provide. + * + * @param bool $autoCorrectAddress Whether we should automatically correct the address. Can be: `true` or `false` and the default is `true`. If empty or `true`, we will correct the address you provide if necessary. If `false`, we won't alter the address you provide. + * @return $this Fluent Builder + */ + public function setAutoCorrectAddress(bool $autoCorrectAddress): self + { + $this->options['autoCorrectAddress'] = $autoCorrectAddress; + return $this; + } + + /** + * The additional number and street address of the address. + * + * @param string $streetSecondary The additional number and street address of the address. + * @return $this Fluent Builder + */ + public function setStreetSecondary(string $streetSecondary): self + { + $this->options['streetSecondary'] = $streetSecondary; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateAddressOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AddressPage.php b/app/api/Twilio/Rest/Api/V2010/Account/AddressPage.php new file mode 100755 index 0000000..d5ad2f1 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AddressPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AddressInstance \Twilio\Rest\Api\V2010\Account\AddressInstance + */ + public function buildInstance(array $payload): AddressInstance + { + return new AddressInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AddressPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/ApplicationContext.php b/app/api/Twilio/Rest/Api/V2010/Account/ApplicationContext.php new file mode 100755 index 0000000..87b2ae2 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/ApplicationContext.php @@ -0,0 +1,161 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Applications/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the ApplicationInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the ApplicationInstance + * + * @return ApplicationInstance Fetched ApplicationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ApplicationInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ApplicationInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ApplicationInstance + * + * @param array|Options $options Optional Arguments + * @return ApplicationInstance Updated ApplicationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ApplicationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'ApiVersion' => + $options['apiVersion'], + 'VoiceUrl' => + $options['voiceUrl'], + 'VoiceMethod' => + $options['voiceMethod'], + 'VoiceFallbackUrl' => + $options['voiceFallbackUrl'], + 'VoiceFallbackMethod' => + $options['voiceFallbackMethod'], + 'StatusCallback' => + $options['statusCallback'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'VoiceCallerIdLookup' => + Serialize::booleanToString($options['voiceCallerIdLookup']), + 'SmsUrl' => + $options['smsUrl'], + 'SmsMethod' => + $options['smsMethod'], + 'SmsFallbackUrl' => + $options['smsFallbackUrl'], + 'SmsFallbackMethod' => + $options['smsFallbackMethod'], + 'SmsStatusCallback' => + $options['smsStatusCallback'], + 'MessageStatusCallback' => + $options['messageStatusCallback'], + 'PublicApplicationConnectEnabled' => + Serialize::booleanToString($options['publicApplicationConnectEnabled']), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new ApplicationInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.ApplicationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/ApplicationInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/ApplicationInstance.php new file mode 100755 index 0000000..0032270 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/ApplicationInstance.php @@ -0,0 +1,184 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'messageStatusCallback' => Values::array_get($payload, 'message_status_callback'), + 'sid' => Values::array_get($payload, 'sid'), + 'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'), + 'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'), + 'smsMethod' => Values::array_get($payload, 'sms_method'), + 'smsStatusCallback' => Values::array_get($payload, 'sms_status_callback'), + 'smsUrl' => Values::array_get($payload, 'sms_url'), + 'statusCallback' => Values::array_get($payload, 'status_callback'), + 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), + 'uri' => Values::array_get($payload, 'uri'), + 'voiceCallerIdLookup' => Values::array_get($payload, 'voice_caller_id_lookup'), + 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), + 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), + 'voiceMethod' => Values::array_get($payload, 'voice_method'), + 'voiceUrl' => Values::array_get($payload, 'voice_url'), + 'publicApplicationConnectEnabled' => Values::array_get($payload, 'public_application_connect_enabled'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ApplicationContext Context for this ApplicationInstance + */ + protected function proxy(): ApplicationContext + { + if (!$this->context) { + $this->context = new ApplicationContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ApplicationInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ApplicationInstance + * + * @return ApplicationInstance Fetched ApplicationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ApplicationInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ApplicationInstance + * + * @param array|Options $options Optional Arguments + * @return ApplicationInstance Updated ApplicationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ApplicationInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.ApplicationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/ApplicationList.php b/app/api/Twilio/Rest/Api/V2010/Account/ApplicationList.php new file mode 100755 index 0000000..8c74b7e --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/ApplicationList.php @@ -0,0 +1,234 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Applications.json'; + } + + /** + * Create the ApplicationInstance + * + * @param array|Options $options Optional Arguments + * @return ApplicationInstance Created ApplicationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): ApplicationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'ApiVersion' => + $options['apiVersion'], + 'VoiceUrl' => + $options['voiceUrl'], + 'VoiceMethod' => + $options['voiceMethod'], + 'VoiceFallbackUrl' => + $options['voiceFallbackUrl'], + 'VoiceFallbackMethod' => + $options['voiceFallbackMethod'], + 'StatusCallback' => + $options['statusCallback'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'VoiceCallerIdLookup' => + Serialize::booleanToString($options['voiceCallerIdLookup']), + 'SmsUrl' => + $options['smsUrl'], + 'SmsMethod' => + $options['smsMethod'], + 'SmsFallbackUrl' => + $options['smsFallbackUrl'], + 'SmsFallbackMethod' => + $options['smsFallbackMethod'], + 'SmsStatusCallback' => + $options['smsStatusCallback'], + 'MessageStatusCallback' => + $options['messageStatusCallback'], + 'FriendlyName' => + $options['friendlyName'], + 'PublicApplicationConnectEnabled' => + Serialize::booleanToString($options['publicApplicationConnectEnabled']), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new ApplicationInstance( + $this->version, + $payload, + $this->solution['accountSid'] + ); + } + + + /** + * Reads ApplicationInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ApplicationInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams ApplicationInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ApplicationInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ApplicationPage Page of ApplicationInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ApplicationPage + { + $options = new Values($options); + + $params = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ApplicationPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ApplicationInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ApplicationPage Page of ApplicationInstance + */ + public function getPage(string $targetUrl): ApplicationPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ApplicationPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ApplicationContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Application resource to delete. + */ + public function getContext( + string $sid + + ): ApplicationContext + { + return new ApplicationContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.ApplicationList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/ApplicationOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/ApplicationOptions.php new file mode 100755 index 0000000..2e5e82d --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/ApplicationOptions.php @@ -0,0 +1,724 @@ +options['apiVersion'] = $apiVersion; + $this->options['voiceUrl'] = $voiceUrl; + $this->options['voiceMethod'] = $voiceMethod; + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; + $this->options['smsUrl'] = $smsUrl; + $this->options['smsMethod'] = $smsMethod; + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + $this->options['smsStatusCallback'] = $smsStatusCallback; + $this->options['messageStatusCallback'] = $messageStatusCallback; + $this->options['friendlyName'] = $friendlyName; + $this->options['publicApplicationConnectEnabled'] = $publicApplicationConnectEnabled; + } + + /** + * The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. The default value is the account's default API version. + * + * @param string $apiVersion The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. The default value is the account's default API version. + * @return $this Fluent Builder + */ + public function setApiVersion(string $apiVersion): self + { + $this->options['apiVersion'] = $apiVersion; + return $this; + } + + /** + * The URL we should call when the phone number assigned to this application receives a call. + * + * @param string $voiceUrl The URL we should call when the phone number assigned to this application receives a call. + * @return $this Fluent Builder + */ + public function setVoiceUrl(string $voiceUrl): self + { + $this->options['voiceUrl'] = $voiceUrl; + return $this; + } + + /** + * The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. + * + * @param string $voiceMethod The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setVoiceMethod(string $voiceMethod): self + { + $this->options['voiceMethod'] = $voiceMethod; + return $this; + } + + /** + * The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. + * + * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackUrl(string $voiceFallbackUrl): self + { + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + return $this; + } + + /** + * The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. + * + * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackMethod(string $voiceFallbackMethod): self + { + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + return $this; + } + + /** + * The URL we should call using the `status_callback_method` to send status information to your application. + * + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`. + * + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: `true` or `false`. + * + * @param bool $voiceCallerIdLookup Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setVoiceCallerIdLookup(bool $voiceCallerIdLookup): self + { + $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; + return $this; + } + + /** + * The URL we should call when the phone number receives an incoming SMS message. + * + * @param string $smsUrl The URL we should call when the phone number receives an incoming SMS message. + * @return $this Fluent Builder + */ + public function setSmsUrl(string $smsUrl): self + { + $this->options['smsUrl'] = $smsUrl; + return $this; + } + + /** + * The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. + * + * @param string $smsMethod The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setSmsMethod(string $smsMethod): self + { + $this->options['smsMethod'] = $smsMethod; + return $this; + } + + /** + * The URL that we should call when an error occurs while retrieving or executing the TwiML from `sms_url`. + * + * @param string $smsFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML from `sms_url`. + * @return $this Fluent Builder + */ + public function setSmsFallbackUrl(string $smsFallbackUrl): self + { + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + return $this; + } + + /** + * The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. + * + * @param string $smsFallbackMethod The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setSmsFallbackMethod(string $smsFallbackMethod): self + { + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + return $this; + } + + /** + * The URL we should call using a POST method to send status information about SMS messages sent by the application. + * + * @param string $smsStatusCallback The URL we should call using a POST method to send status information about SMS messages sent by the application. + * @return $this Fluent Builder + */ + public function setSmsStatusCallback(string $smsStatusCallback): self + { + $this->options['smsStatusCallback'] = $smsStatusCallback; + return $this; + } + + /** + * The URL we should call using a POST method to send message status information to your application. + * + * @param string $messageStatusCallback The URL we should call using a POST method to send message status information to your application. + * @return $this Fluent Builder + */ + public function setMessageStatusCallback(string $messageStatusCallback): self + { + $this->options['messageStatusCallback'] = $messageStatusCallback; + return $this; + } + + /** + * A descriptive string that you create to describe the new application. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the new application. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: `true` or `false`. + * + * @param bool $publicApplicationConnectEnabled Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setPublicApplicationConnectEnabled(bool $publicApplicationConnectEnabled): self + { + $this->options['publicApplicationConnectEnabled'] = $publicApplicationConnectEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateApplicationOptions ' . $options . ']'; + } +} + + + +class ReadApplicationOptions extends Options + { + /** + * @param string $friendlyName The string that identifies the Application resources to read. + */ + public function __construct( + + string $friendlyName = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + } + + /** + * The string that identifies the Application resources to read. + * + * @param string $friendlyName The string that identifies the Application resources to read. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadApplicationOptions ' . $options . ']'; + } +} + +class UpdateApplicationOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @param string $apiVersion The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. The default value is your account's default API version. + * @param string $voiceUrl The URL we should call when the phone number assigned to this application receives a call. + * @param string $voiceMethod The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. + * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. + * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`. + * @param bool $voiceCallerIdLookup Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: `true` or `false`. + * @param string $smsUrl The URL we should call when the phone number receives an incoming SMS message. + * @param string $smsMethod The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. + * @param string $smsFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML from `sms_url`. + * @param string $smsFallbackMethod The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. + * @param string $smsStatusCallback Same as message_status_callback: The URL we should call using a POST method to send status information about SMS messages sent by the application. Deprecated, included for backwards compatibility. + * @param string $messageStatusCallback The URL we should call using a POST method to send message status information to your application. + * @param bool $publicApplicationConnectEnabled Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: `true` or `false`. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $apiVersion = Values::NONE, + string $voiceUrl = Values::NONE, + string $voiceMethod = Values::NONE, + string $voiceFallbackUrl = Values::NONE, + string $voiceFallbackMethod = Values::NONE, + string $statusCallback = Values::NONE, + string $statusCallbackMethod = Values::NONE, + bool $voiceCallerIdLookup = Values::BOOL_NONE, + string $smsUrl = Values::NONE, + string $smsMethod = Values::NONE, + string $smsFallbackUrl = Values::NONE, + string $smsFallbackMethod = Values::NONE, + string $smsStatusCallback = Values::NONE, + string $messageStatusCallback = Values::NONE, + bool $publicApplicationConnectEnabled = Values::BOOL_NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['apiVersion'] = $apiVersion; + $this->options['voiceUrl'] = $voiceUrl; + $this->options['voiceMethod'] = $voiceMethod; + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; + $this->options['smsUrl'] = $smsUrl; + $this->options['smsMethod'] = $smsMethod; + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + $this->options['smsStatusCallback'] = $smsStatusCallback; + $this->options['messageStatusCallback'] = $messageStatusCallback; + $this->options['publicApplicationConnectEnabled'] = $publicApplicationConnectEnabled; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. The default value is your account's default API version. + * + * @param string $apiVersion The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. The default value is your account's default API version. + * @return $this Fluent Builder + */ + public function setApiVersion(string $apiVersion): self + { + $this->options['apiVersion'] = $apiVersion; + return $this; + } + + /** + * The URL we should call when the phone number assigned to this application receives a call. + * + * @param string $voiceUrl The URL we should call when the phone number assigned to this application receives a call. + * @return $this Fluent Builder + */ + public function setVoiceUrl(string $voiceUrl): self + { + $this->options['voiceUrl'] = $voiceUrl; + return $this; + } + + /** + * The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. + * + * @param string $voiceMethod The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setVoiceMethod(string $voiceMethod): self + { + $this->options['voiceMethod'] = $voiceMethod; + return $this; + } + + /** + * The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. + * + * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackUrl(string $voiceFallbackUrl): self + { + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + return $this; + } + + /** + * The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. + * + * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackMethod(string $voiceFallbackMethod): self + { + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + return $this; + } + + /** + * The URL we should call using the `status_callback_method` to send status information to your application. + * + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`. + * + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: `true` or `false`. + * + * @param bool $voiceCallerIdLookup Whether we should look up the caller's caller-ID name from the CNAM database (additional charges apply). Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setVoiceCallerIdLookup(bool $voiceCallerIdLookup): self + { + $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; + return $this; + } + + /** + * The URL we should call when the phone number receives an incoming SMS message. + * + * @param string $smsUrl The URL we should call when the phone number receives an incoming SMS message. + * @return $this Fluent Builder + */ + public function setSmsUrl(string $smsUrl): self + { + $this->options['smsUrl'] = $smsUrl; + return $this; + } + + /** + * The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. + * + * @param string $smsMethod The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setSmsMethod(string $smsMethod): self + { + $this->options['smsMethod'] = $smsMethod; + return $this; + } + + /** + * The URL that we should call when an error occurs while retrieving or executing the TwiML from `sms_url`. + * + * @param string $smsFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML from `sms_url`. + * @return $this Fluent Builder + */ + public function setSmsFallbackUrl(string $smsFallbackUrl): self + { + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + return $this; + } + + /** + * The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. + * + * @param string $smsFallbackMethod The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setSmsFallbackMethod(string $smsFallbackMethod): self + { + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + return $this; + } + + /** + * Same as message_status_callback: The URL we should call using a POST method to send status information about SMS messages sent by the application. Deprecated, included for backwards compatibility. + * + * @param string $smsStatusCallback Same as message_status_callback: The URL we should call using a POST method to send status information about SMS messages sent by the application. Deprecated, included for backwards compatibility. + * @return $this Fluent Builder + */ + public function setSmsStatusCallback(string $smsStatusCallback): self + { + $this->options['smsStatusCallback'] = $smsStatusCallback; + return $this; + } + + /** + * The URL we should call using a POST method to send message status information to your application. + * + * @param string $messageStatusCallback The URL we should call using a POST method to send message status information to your application. + * @return $this Fluent Builder + */ + public function setMessageStatusCallback(string $messageStatusCallback): self + { + $this->options['messageStatusCallback'] = $messageStatusCallback; + return $this; + } + + /** + * Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: `true` or `false`. + * + * @param bool $publicApplicationConnectEnabled Whether to allow other Twilio accounts to dial this applicaton using Dial verb. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setPublicApplicationConnectEnabled(bool $publicApplicationConnectEnabled): self + { + $this->options['publicApplicationConnectEnabled'] = $publicApplicationConnectEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateApplicationOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/ApplicationPage.php b/app/api/Twilio/Rest/Api/V2010/Account/ApplicationPage.php new file mode 100755 index 0000000..f7c4bf3 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/ApplicationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ApplicationInstance \Twilio\Rest\Api\V2010\Account\ApplicationInstance + */ + public function buildInstance(array $payload): ApplicationInstance + { + return new ApplicationInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.ApplicationPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppContext.php b/app/api/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppContext.php new file mode 100755 index 0000000..60fdbac --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppContext.php @@ -0,0 +1,87 @@ +solution = [ + 'accountSid' => + $accountSid, + 'connectAppSid' => + $connectAppSid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/AuthorizedConnectApps/' . \rawurlencode($connectAppSid) + .'.json'; + } + + /** + * Fetch the AuthorizedConnectAppInstance + * + * @return AuthorizedConnectAppInstance Fetched AuthorizedConnectAppInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AuthorizedConnectAppInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new AuthorizedConnectAppInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['connectAppSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AuthorizedConnectAppContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppInstance.php new file mode 100755 index 0000000..c87dcd3 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppInstance.php @@ -0,0 +1,136 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'connectAppCompanyName' => Values::array_get($payload, 'connect_app_company_name'), + 'connectAppDescription' => Values::array_get($payload, 'connect_app_description'), + 'connectAppFriendlyName' => Values::array_get($payload, 'connect_app_friendly_name'), + 'connectAppHomepageUrl' => Values::array_get($payload, 'connect_app_homepage_url'), + 'connectAppSid' => Values::array_get($payload, 'connect_app_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'permissions' => Values::array_get($payload, 'permissions'), + 'uri' => Values::array_get($payload, 'uri'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'connectAppSid' => $connectAppSid ?: $this->properties['connectAppSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AuthorizedConnectAppContext Context for this AuthorizedConnectAppInstance + */ + protected function proxy(): AuthorizedConnectAppContext + { + if (!$this->context) { + $this->context = new AuthorizedConnectAppContext( + $this->version, + $this->solution['accountSid'], + $this->solution['connectAppSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the AuthorizedConnectAppInstance + * + * @return AuthorizedConnectAppInstance Fetched AuthorizedConnectAppInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AuthorizedConnectAppInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AuthorizedConnectAppInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppList.php b/app/api/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppList.php new file mode 100755 index 0000000..0ba0cee --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppList.php @@ -0,0 +1,168 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/AuthorizedConnectApps.json'; + } + + /** + * Reads AuthorizedConnectAppInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return AuthorizedConnectAppInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams AuthorizedConnectAppInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AuthorizedConnectAppInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return AuthorizedConnectAppPage Page of AuthorizedConnectAppInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AuthorizedConnectAppPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new AuthorizedConnectAppPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of AuthorizedConnectAppInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return AuthorizedConnectAppPage Page of AuthorizedConnectAppInstance + */ + public function getPage(string $targetUrl): AuthorizedConnectAppPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AuthorizedConnectAppPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AuthorizedConnectAppContext + * + * @param string $connectAppSid The SID of the Connect App to fetch. + */ + public function getContext( + string $connectAppSid + + ): AuthorizedConnectAppContext + { + return new AuthorizedConnectAppContext( + $this->version, + $this->solution['accountSid'], + $connectAppSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AuthorizedConnectAppList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppPage.php b/app/api/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppPage.php new file mode 100755 index 0000000..145f876 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AuthorizedConnectAppPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AuthorizedConnectAppInstance \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppInstance + */ + public function buildInstance(array $payload): AuthorizedConnectAppInstance + { + return new AuthorizedConnectAppInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AuthorizedConnectAppPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalInstance.php new file mode 100755 index 0000000..b1751ef --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalInstance.php @@ -0,0 +1,108 @@ +properties = [ + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'phoneNumber' => Values::array_get($payload, 'phone_number'), + 'lata' => Values::array_get($payload, 'lata'), + 'locality' => Values::array_get($payload, 'locality'), + 'rateCenter' => Values::array_get($payload, 'rate_center'), + 'latitude' => Values::array_get($payload, 'latitude'), + 'longitude' => Values::array_get($payload, 'longitude'), + 'region' => Values::array_get($payload, 'region'), + 'postalCode' => Values::array_get($payload, 'postal_code'), + 'isoCountry' => Values::array_get($payload, 'iso_country'), + 'addressRequirements' => Values::array_get($payload, 'address_requirements'), + 'beta' => Values::array_get($payload, 'beta'), + 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), + ]; + + $this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.LocalInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalList.php b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalList.php new file mode 100755 index 0000000..a7e5ec2 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalList.php @@ -0,0 +1,199 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'countryCode' => + $countryCode, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/AvailablePhoneNumbers/' . \rawurlencode($countryCode) + .'/Local.json'; + } + + /** + * Reads LocalInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return LocalInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams LocalInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of LocalInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return LocalPage Page of LocalInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): LocalPage + { + $options = new Values($options); + + $params = Values::of([ + 'AreaCode' => + $options['areaCode'], + 'Contains' => + $options['contains'], + 'SmsEnabled' => + Serialize::booleanToString($options['smsEnabled']), + 'MmsEnabled' => + Serialize::booleanToString($options['mmsEnabled']), + 'VoiceEnabled' => + Serialize::booleanToString($options['voiceEnabled']), + 'ExcludeAllAddressRequired' => + Serialize::booleanToString($options['excludeAllAddressRequired']), + 'ExcludeLocalAddressRequired' => + Serialize::booleanToString($options['excludeLocalAddressRequired']), + 'ExcludeForeignAddressRequired' => + Serialize::booleanToString($options['excludeForeignAddressRequired']), + 'Beta' => + Serialize::booleanToString($options['beta']), + 'NearNumber' => + $options['nearNumber'], + 'NearLatLong' => + $options['nearLatLong'], + 'Distance' => + $options['distance'], + 'InPostalCode' => + $options['inPostalCode'], + 'InRegion' => + $options['inRegion'], + 'InRateCenter' => + $options['inRateCenter'], + 'InLata' => + $options['inLata'], + 'InLocality' => + $options['inLocality'], + 'FaxEnabled' => + Serialize::booleanToString($options['faxEnabled']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new LocalPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of LocalInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return LocalPage Page of LocalInstance + */ + public function getPage(string $targetUrl): LocalPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new LocalPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.LocalList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalOptions.php new file mode 100755 index 0000000..47ac41c --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalOptions.php @@ -0,0 +1,382 @@ +options['areaCode'] = $areaCode; + $this->options['contains'] = $contains; + $this->options['smsEnabled'] = $smsEnabled; + $this->options['mmsEnabled'] = $mmsEnabled; + $this->options['voiceEnabled'] = $voiceEnabled; + $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; + $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; + $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; + $this->options['beta'] = $beta; + $this->options['nearNumber'] = $nearNumber; + $this->options['nearLatLong'] = $nearLatLong; + $this->options['distance'] = $distance; + $this->options['inPostalCode'] = $inPostalCode; + $this->options['inRegion'] = $inRegion; + $this->options['inRateCenter'] = $inRateCenter; + $this->options['inLata'] = $inLata; + $this->options['inLocality'] = $inLocality; + $this->options['faxEnabled'] = $faxEnabled; + } + + /** + * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. + * + * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setAreaCode(int $areaCode): self + { + $this->options['areaCode'] = $areaCode; + return $this; + } + + /** + * The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumberlocal-resource?code-sample=code-find-phone-numbers-by-number-pattern) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumberlocal-resource?code-sample=code-find-phone-numbers-by-character-pattern). If specified, this value must have at least two characters. + * + * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumberlocal-resource?code-sample=code-find-phone-numbers-by-number-pattern) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumberlocal-resource?code-sample=code-find-phone-numbers-by-character-pattern). If specified, this value must have at least two characters. + * @return $this Fluent Builder + */ + public function setContains(string $contains): self + { + $this->options['contains'] = $contains; + return $this; + } + + /** + * Whether the phone numbers can receive text messages. Can be: `true` or `false`. + * + * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setSmsEnabled(bool $smsEnabled): self + { + $this->options['smsEnabled'] = $smsEnabled; + return $this; + } + + /** + * Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. + * + * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setMmsEnabled(bool $mmsEnabled): self + { + $this->options['mmsEnabled'] = $mmsEnabled; + return $this; + } + + /** + * Whether the phone numbers can receive calls. Can be: `true` or `false`. + * + * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setVoiceEnabled(bool $voiceEnabled): self + { + $this->options['voiceEnabled'] = $voiceEnabled; + return $this; + } + + /** + * Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeAllAddressRequired(bool $excludeAllAddressRequired): self + { + $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; + return $this; + } + + /** + * Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeLocalAddressRequired(bool $excludeLocalAddressRequired): self + { + $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; + return $this; + } + + /** + * Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeForeignAddressRequired(bool $excludeForeignAddressRequired): self + { + $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; + return $this; + } + + /** + * Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * + * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * @return $this Fluent Builder + */ + public function setBeta(bool $beta): self + { + $this->options['beta'] = $beta; + return $this; + } + + /** + * Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. + * + * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setNearNumber(string $nearNumber): self + { + $this->options['nearNumber'] = $nearNumber; + return $this; + } + + /** + * Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. + * + * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setNearLatLong(string $nearLatLong): self + { + $this->options['nearLatLong'] = $nearLatLong; + return $this; + } + + /** + * The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. + * + * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setDistance(int $distance): self + { + $this->options['distance'] = $distance; + return $this; + } + + /** + * Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInPostalCode(string $inPostalCode): self + { + $this->options['inPostalCode'] = $inPostalCode; + return $this; + } + + /** + * Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInRegion(string $inRegion): self + { + $this->options['inRegion'] = $inRegion; + return $this; + } + + /** + * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. + * + * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInRateCenter(string $inRateCenter): self + { + $this->options['inRateCenter'] = $inRateCenter; + return $this; + } + + /** + * Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInLata(string $inLata): self + { + $this->options['inLata'] = $inLata; + return $this; + } + + /** + * Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. + * + * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. + * @return $this Fluent Builder + */ + public function setInLocality(string $inLocality): self + { + $this->options['inLocality'] = $inLocality; + return $this; + } + + /** + * Whether the phone numbers can receive faxes. Can be: `true` or `false`. + * + * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setFaxEnabled(bool $faxEnabled): self + { + $this->options['faxEnabled'] = $faxEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadLocalOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalPage.php b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalPage.php new file mode 100755 index 0000000..bd4978c --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/LocalPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return LocalInstance \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\LocalInstance + */ + public function buildInstance(array $payload): LocalInstance + { + return new LocalInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['countryCode']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.LocalPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineInstance.php new file mode 100755 index 0000000..76f2e4d --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineInstance.php @@ -0,0 +1,108 @@ +properties = [ + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'phoneNumber' => Values::array_get($payload, 'phone_number'), + 'lata' => Values::array_get($payload, 'lata'), + 'locality' => Values::array_get($payload, 'locality'), + 'rateCenter' => Values::array_get($payload, 'rate_center'), + 'latitude' => Values::array_get($payload, 'latitude'), + 'longitude' => Values::array_get($payload, 'longitude'), + 'region' => Values::array_get($payload, 'region'), + 'postalCode' => Values::array_get($payload, 'postal_code'), + 'isoCountry' => Values::array_get($payload, 'iso_country'), + 'addressRequirements' => Values::array_get($payload, 'address_requirements'), + 'beta' => Values::array_get($payload, 'beta'), + 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), + ]; + + $this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.MachineToMachineInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineList.php b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineList.php new file mode 100755 index 0000000..857bdd1 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineList.php @@ -0,0 +1,199 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'countryCode' => + $countryCode, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/AvailablePhoneNumbers/' . \rawurlencode($countryCode) + .'/MachineToMachine.json'; + } + + /** + * Reads MachineToMachineInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return MachineToMachineInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams MachineToMachineInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of MachineToMachineInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return MachineToMachinePage Page of MachineToMachineInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MachineToMachinePage + { + $options = new Values($options); + + $params = Values::of([ + 'AreaCode' => + $options['areaCode'], + 'Contains' => + $options['contains'], + 'SmsEnabled' => + Serialize::booleanToString($options['smsEnabled']), + 'MmsEnabled' => + Serialize::booleanToString($options['mmsEnabled']), + 'VoiceEnabled' => + Serialize::booleanToString($options['voiceEnabled']), + 'ExcludeAllAddressRequired' => + Serialize::booleanToString($options['excludeAllAddressRequired']), + 'ExcludeLocalAddressRequired' => + Serialize::booleanToString($options['excludeLocalAddressRequired']), + 'ExcludeForeignAddressRequired' => + Serialize::booleanToString($options['excludeForeignAddressRequired']), + 'Beta' => + Serialize::booleanToString($options['beta']), + 'NearNumber' => + $options['nearNumber'], + 'NearLatLong' => + $options['nearLatLong'], + 'Distance' => + $options['distance'], + 'InPostalCode' => + $options['inPostalCode'], + 'InRegion' => + $options['inRegion'], + 'InRateCenter' => + $options['inRateCenter'], + 'InLata' => + $options['inLata'], + 'InLocality' => + $options['inLocality'], + 'FaxEnabled' => + Serialize::booleanToString($options['faxEnabled']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new MachineToMachinePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of MachineToMachineInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return MachineToMachinePage Page of MachineToMachineInstance + */ + public function getPage(string $targetUrl): MachineToMachinePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new MachineToMachinePage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.MachineToMachineList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineOptions.php new file mode 100755 index 0000000..41c0af1 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachineOptions.php @@ -0,0 +1,382 @@ +options['areaCode'] = $areaCode; + $this->options['contains'] = $contains; + $this->options['smsEnabled'] = $smsEnabled; + $this->options['mmsEnabled'] = $mmsEnabled; + $this->options['voiceEnabled'] = $voiceEnabled; + $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; + $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; + $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; + $this->options['beta'] = $beta; + $this->options['nearNumber'] = $nearNumber; + $this->options['nearLatLong'] = $nearLatLong; + $this->options['distance'] = $distance; + $this->options['inPostalCode'] = $inPostalCode; + $this->options['inRegion'] = $inRegion; + $this->options['inRateCenter'] = $inRateCenter; + $this->options['inLata'] = $inLata; + $this->options['inLocality'] = $inLocality; + $this->options['faxEnabled'] = $faxEnabled; + } + + /** + * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. + * + * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setAreaCode(int $areaCode): self + { + $this->options['areaCode'] = $areaCode; + return $this; + } + + /** + * The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. + * + * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. + * @return $this Fluent Builder + */ + public function setContains(string $contains): self + { + $this->options['contains'] = $contains; + return $this; + } + + /** + * Whether the phone numbers can receive text messages. Can be: `true` or `false`. + * + * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setSmsEnabled(bool $smsEnabled): self + { + $this->options['smsEnabled'] = $smsEnabled; + return $this; + } + + /** + * Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. + * + * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setMmsEnabled(bool $mmsEnabled): self + { + $this->options['mmsEnabled'] = $mmsEnabled; + return $this; + } + + /** + * Whether the phone numbers can receive calls. Can be: `true` or `false`. + * + * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setVoiceEnabled(bool $voiceEnabled): self + { + $this->options['voiceEnabled'] = $voiceEnabled; + return $this; + } + + /** + * Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeAllAddressRequired(bool $excludeAllAddressRequired): self + { + $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; + return $this; + } + + /** + * Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeLocalAddressRequired(bool $excludeLocalAddressRequired): self + { + $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; + return $this; + } + + /** + * Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeForeignAddressRequired(bool $excludeForeignAddressRequired): self + { + $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; + return $this; + } + + /** + * Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * + * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * @return $this Fluent Builder + */ + public function setBeta(bool $beta): self + { + $this->options['beta'] = $beta; + return $this; + } + + /** + * Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. + * + * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setNearNumber(string $nearNumber): self + { + $this->options['nearNumber'] = $nearNumber; + return $this; + } + + /** + * Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. + * + * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setNearLatLong(string $nearLatLong): self + { + $this->options['nearLatLong'] = $nearLatLong; + return $this; + } + + /** + * The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. + * + * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setDistance(int $distance): self + { + $this->options['distance'] = $distance; + return $this; + } + + /** + * Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInPostalCode(string $inPostalCode): self + { + $this->options['inPostalCode'] = $inPostalCode; + return $this; + } + + /** + * Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInRegion(string $inRegion): self + { + $this->options['inRegion'] = $inRegion; + return $this; + } + + /** + * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. + * + * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInRateCenter(string $inRateCenter): self + { + $this->options['inRateCenter'] = $inRateCenter; + return $this; + } + + /** + * Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInLata(string $inLata): self + { + $this->options['inLata'] = $inLata; + return $this; + } + + /** + * Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. + * + * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. + * @return $this Fluent Builder + */ + public function setInLocality(string $inLocality): self + { + $this->options['inLocality'] = $inLocality; + return $this; + } + + /** + * Whether the phone numbers can receive faxes. Can be: `true` or `false`. + * + * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setFaxEnabled(bool $faxEnabled): self + { + $this->options['faxEnabled'] = $faxEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadMachineToMachineOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachinePage.php b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachinePage.php new file mode 100755 index 0000000..c63e931 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MachineToMachinePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MachineToMachineInstance \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\MachineToMachineInstance + */ + public function buildInstance(array $payload): MachineToMachineInstance + { + return new MachineToMachineInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['countryCode']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.MachineToMachinePage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobileInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobileInstance.php new file mode 100755 index 0000000..616afdd --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobileInstance.php @@ -0,0 +1,108 @@ +properties = [ + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'phoneNumber' => Values::array_get($payload, 'phone_number'), + 'lata' => Values::array_get($payload, 'lata'), + 'locality' => Values::array_get($payload, 'locality'), + 'rateCenter' => Values::array_get($payload, 'rate_center'), + 'latitude' => Values::array_get($payload, 'latitude'), + 'longitude' => Values::array_get($payload, 'longitude'), + 'region' => Values::array_get($payload, 'region'), + 'postalCode' => Values::array_get($payload, 'postal_code'), + 'isoCountry' => Values::array_get($payload, 'iso_country'), + 'addressRequirements' => Values::array_get($payload, 'address_requirements'), + 'beta' => Values::array_get($payload, 'beta'), + 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), + ]; + + $this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.MobileInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobileList.php b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobileList.php new file mode 100755 index 0000000..62ab46f --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobileList.php @@ -0,0 +1,199 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'countryCode' => + $countryCode, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/AvailablePhoneNumbers/' . \rawurlencode($countryCode) + .'/Mobile.json'; + } + + /** + * Reads MobileInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return MobileInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams MobileInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of MobileInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return MobilePage Page of MobileInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MobilePage + { + $options = new Values($options); + + $params = Values::of([ + 'AreaCode' => + $options['areaCode'], + 'Contains' => + $options['contains'], + 'SmsEnabled' => + Serialize::booleanToString($options['smsEnabled']), + 'MmsEnabled' => + Serialize::booleanToString($options['mmsEnabled']), + 'VoiceEnabled' => + Serialize::booleanToString($options['voiceEnabled']), + 'ExcludeAllAddressRequired' => + Serialize::booleanToString($options['excludeAllAddressRequired']), + 'ExcludeLocalAddressRequired' => + Serialize::booleanToString($options['excludeLocalAddressRequired']), + 'ExcludeForeignAddressRequired' => + Serialize::booleanToString($options['excludeForeignAddressRequired']), + 'Beta' => + Serialize::booleanToString($options['beta']), + 'NearNumber' => + $options['nearNumber'], + 'NearLatLong' => + $options['nearLatLong'], + 'Distance' => + $options['distance'], + 'InPostalCode' => + $options['inPostalCode'], + 'InRegion' => + $options['inRegion'], + 'InRateCenter' => + $options['inRateCenter'], + 'InLata' => + $options['inLata'], + 'InLocality' => + $options['inLocality'], + 'FaxEnabled' => + Serialize::booleanToString($options['faxEnabled']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new MobilePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of MobileInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return MobilePage Page of MobileInstance + */ + public function getPage(string $targetUrl): MobilePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new MobilePage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.MobileList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobileOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobileOptions.php new file mode 100755 index 0000000..5058498 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobileOptions.php @@ -0,0 +1,382 @@ +options['areaCode'] = $areaCode; + $this->options['contains'] = $contains; + $this->options['smsEnabled'] = $smsEnabled; + $this->options['mmsEnabled'] = $mmsEnabled; + $this->options['voiceEnabled'] = $voiceEnabled; + $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; + $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; + $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; + $this->options['beta'] = $beta; + $this->options['nearNumber'] = $nearNumber; + $this->options['nearLatLong'] = $nearLatLong; + $this->options['distance'] = $distance; + $this->options['inPostalCode'] = $inPostalCode; + $this->options['inRegion'] = $inRegion; + $this->options['inRateCenter'] = $inRateCenter; + $this->options['inLata'] = $inLata; + $this->options['inLocality'] = $inLocality; + $this->options['faxEnabled'] = $faxEnabled; + } + + /** + * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. + * + * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setAreaCode(int $areaCode): self + { + $this->options['areaCode'] = $areaCode; + return $this; + } + + /** + * The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. + * + * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. + * @return $this Fluent Builder + */ + public function setContains(string $contains): self + { + $this->options['contains'] = $contains; + return $this; + } + + /** + * Whether the phone numbers can receive text messages. Can be: `true` or `false`. + * + * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setSmsEnabled(bool $smsEnabled): self + { + $this->options['smsEnabled'] = $smsEnabled; + return $this; + } + + /** + * Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. + * + * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setMmsEnabled(bool $mmsEnabled): self + { + $this->options['mmsEnabled'] = $mmsEnabled; + return $this; + } + + /** + * Whether the phone numbers can receive calls. Can be: `true` or `false`. + * + * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setVoiceEnabled(bool $voiceEnabled): self + { + $this->options['voiceEnabled'] = $voiceEnabled; + return $this; + } + + /** + * Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeAllAddressRequired(bool $excludeAllAddressRequired): self + { + $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; + return $this; + } + + /** + * Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeLocalAddressRequired(bool $excludeLocalAddressRequired): self + { + $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; + return $this; + } + + /** + * Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeForeignAddressRequired(bool $excludeForeignAddressRequired): self + { + $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; + return $this; + } + + /** + * Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * + * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * @return $this Fluent Builder + */ + public function setBeta(bool $beta): self + { + $this->options['beta'] = $beta; + return $this; + } + + /** + * Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. + * + * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setNearNumber(string $nearNumber): self + { + $this->options['nearNumber'] = $nearNumber; + return $this; + } + + /** + * Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. + * + * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setNearLatLong(string $nearLatLong): self + { + $this->options['nearLatLong'] = $nearLatLong; + return $this; + } + + /** + * The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. + * + * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setDistance(int $distance): self + { + $this->options['distance'] = $distance; + return $this; + } + + /** + * Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInPostalCode(string $inPostalCode): self + { + $this->options['inPostalCode'] = $inPostalCode; + return $this; + } + + /** + * Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInRegion(string $inRegion): self + { + $this->options['inRegion'] = $inRegion; + return $this; + } + + /** + * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. + * + * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInRateCenter(string $inRateCenter): self + { + $this->options['inRateCenter'] = $inRateCenter; + return $this; + } + + /** + * Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInLata(string $inLata): self + { + $this->options['inLata'] = $inLata; + return $this; + } + + /** + * Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. + * + * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. + * @return $this Fluent Builder + */ + public function setInLocality(string $inLocality): self + { + $this->options['inLocality'] = $inLocality; + return $this; + } + + /** + * Whether the phone numbers can receive faxes. Can be: `true` or `false`. + * + * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setFaxEnabled(bool $faxEnabled): self + { + $this->options['faxEnabled'] = $faxEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadMobileOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobilePage.php b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobilePage.php new file mode 100755 index 0000000..6ddba1c --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/MobilePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MobileInstance \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\MobileInstance + */ + public function buildInstance(array $payload): MobileInstance + { + return new MobileInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['countryCode']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.MobilePage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalInstance.php new file mode 100755 index 0000000..7f0754f --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalInstance.php @@ -0,0 +1,108 @@ +properties = [ + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'phoneNumber' => Values::array_get($payload, 'phone_number'), + 'lata' => Values::array_get($payload, 'lata'), + 'locality' => Values::array_get($payload, 'locality'), + 'rateCenter' => Values::array_get($payload, 'rate_center'), + 'latitude' => Values::array_get($payload, 'latitude'), + 'longitude' => Values::array_get($payload, 'longitude'), + 'region' => Values::array_get($payload, 'region'), + 'postalCode' => Values::array_get($payload, 'postal_code'), + 'isoCountry' => Values::array_get($payload, 'iso_country'), + 'addressRequirements' => Values::array_get($payload, 'address_requirements'), + 'beta' => Values::array_get($payload, 'beta'), + 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), + ]; + + $this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.NationalInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalList.php b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalList.php new file mode 100755 index 0000000..d127672 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalList.php @@ -0,0 +1,199 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'countryCode' => + $countryCode, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/AvailablePhoneNumbers/' . \rawurlencode($countryCode) + .'/National.json'; + } + + /** + * Reads NationalInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return NationalInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams NationalInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of NationalInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return NationalPage Page of NationalInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): NationalPage + { + $options = new Values($options); + + $params = Values::of([ + 'AreaCode' => + $options['areaCode'], + 'Contains' => + $options['contains'], + 'SmsEnabled' => + Serialize::booleanToString($options['smsEnabled']), + 'MmsEnabled' => + Serialize::booleanToString($options['mmsEnabled']), + 'VoiceEnabled' => + Serialize::booleanToString($options['voiceEnabled']), + 'ExcludeAllAddressRequired' => + Serialize::booleanToString($options['excludeAllAddressRequired']), + 'ExcludeLocalAddressRequired' => + Serialize::booleanToString($options['excludeLocalAddressRequired']), + 'ExcludeForeignAddressRequired' => + Serialize::booleanToString($options['excludeForeignAddressRequired']), + 'Beta' => + Serialize::booleanToString($options['beta']), + 'NearNumber' => + $options['nearNumber'], + 'NearLatLong' => + $options['nearLatLong'], + 'Distance' => + $options['distance'], + 'InPostalCode' => + $options['inPostalCode'], + 'InRegion' => + $options['inRegion'], + 'InRateCenter' => + $options['inRateCenter'], + 'InLata' => + $options['inLata'], + 'InLocality' => + $options['inLocality'], + 'FaxEnabled' => + Serialize::booleanToString($options['faxEnabled']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new NationalPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of NationalInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return NationalPage Page of NationalInstance + */ + public function getPage(string $targetUrl): NationalPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new NationalPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.NationalList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalOptions.php new file mode 100755 index 0000000..772e10a --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalOptions.php @@ -0,0 +1,382 @@ +options['areaCode'] = $areaCode; + $this->options['contains'] = $contains; + $this->options['smsEnabled'] = $smsEnabled; + $this->options['mmsEnabled'] = $mmsEnabled; + $this->options['voiceEnabled'] = $voiceEnabled; + $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; + $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; + $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; + $this->options['beta'] = $beta; + $this->options['nearNumber'] = $nearNumber; + $this->options['nearLatLong'] = $nearLatLong; + $this->options['distance'] = $distance; + $this->options['inPostalCode'] = $inPostalCode; + $this->options['inRegion'] = $inRegion; + $this->options['inRateCenter'] = $inRateCenter; + $this->options['inLata'] = $inLata; + $this->options['inLocality'] = $inLocality; + $this->options['faxEnabled'] = $faxEnabled; + } + + /** + * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. + * + * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setAreaCode(int $areaCode): self + { + $this->options['areaCode'] = $areaCode; + return $this; + } + + /** + * The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. + * + * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. + * @return $this Fluent Builder + */ + public function setContains(string $contains): self + { + $this->options['contains'] = $contains; + return $this; + } + + /** + * Whether the phone numbers can receive text messages. Can be: `true` or `false`. + * + * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setSmsEnabled(bool $smsEnabled): self + { + $this->options['smsEnabled'] = $smsEnabled; + return $this; + } + + /** + * Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. + * + * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setMmsEnabled(bool $mmsEnabled): self + { + $this->options['mmsEnabled'] = $mmsEnabled; + return $this; + } + + /** + * Whether the phone numbers can receive calls. Can be: `true` or `false`. + * + * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setVoiceEnabled(bool $voiceEnabled): self + { + $this->options['voiceEnabled'] = $voiceEnabled; + return $this; + } + + /** + * Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeAllAddressRequired(bool $excludeAllAddressRequired): self + { + $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; + return $this; + } + + /** + * Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeLocalAddressRequired(bool $excludeLocalAddressRequired): self + { + $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; + return $this; + } + + /** + * Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeForeignAddressRequired(bool $excludeForeignAddressRequired): self + { + $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; + return $this; + } + + /** + * Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * + * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * @return $this Fluent Builder + */ + public function setBeta(bool $beta): self + { + $this->options['beta'] = $beta; + return $this; + } + + /** + * Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. + * + * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setNearNumber(string $nearNumber): self + { + $this->options['nearNumber'] = $nearNumber; + return $this; + } + + /** + * Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. + * + * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setNearLatLong(string $nearLatLong): self + { + $this->options['nearLatLong'] = $nearLatLong; + return $this; + } + + /** + * The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. + * + * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setDistance(int $distance): self + { + $this->options['distance'] = $distance; + return $this; + } + + /** + * Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInPostalCode(string $inPostalCode): self + { + $this->options['inPostalCode'] = $inPostalCode; + return $this; + } + + /** + * Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInRegion(string $inRegion): self + { + $this->options['inRegion'] = $inRegion; + return $this; + } + + /** + * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. + * + * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInRateCenter(string $inRateCenter): self + { + $this->options['inRateCenter'] = $inRateCenter; + return $this; + } + + /** + * Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInLata(string $inLata): self + { + $this->options['inLata'] = $inLata; + return $this; + } + + /** + * Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. + * + * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. + * @return $this Fluent Builder + */ + public function setInLocality(string $inLocality): self + { + $this->options['inLocality'] = $inLocality; + return $this; + } + + /** + * Whether the phone numbers can receive faxes. Can be: `true` or `false`. + * + * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setFaxEnabled(bool $faxEnabled): self + { + $this->options['faxEnabled'] = $faxEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadNationalOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalPage.php b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalPage.php new file mode 100755 index 0000000..456b98e --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/NationalPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return NationalInstance \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\NationalInstance + */ + public function buildInstance(array $payload): NationalInstance + { + return new NationalInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['countryCode']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.NationalPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostInstance.php new file mode 100755 index 0000000..5f851ee --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostInstance.php @@ -0,0 +1,108 @@ +properties = [ + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'phoneNumber' => Values::array_get($payload, 'phone_number'), + 'lata' => Values::array_get($payload, 'lata'), + 'locality' => Values::array_get($payload, 'locality'), + 'rateCenter' => Values::array_get($payload, 'rate_center'), + 'latitude' => Values::array_get($payload, 'latitude'), + 'longitude' => Values::array_get($payload, 'longitude'), + 'region' => Values::array_get($payload, 'region'), + 'postalCode' => Values::array_get($payload, 'postal_code'), + 'isoCountry' => Values::array_get($payload, 'iso_country'), + 'addressRequirements' => Values::array_get($payload, 'address_requirements'), + 'beta' => Values::array_get($payload, 'beta'), + 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), + ]; + + $this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.SharedCostInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostList.php b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostList.php new file mode 100755 index 0000000..cf12dfd --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostList.php @@ -0,0 +1,199 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'countryCode' => + $countryCode, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/AvailablePhoneNumbers/' . \rawurlencode($countryCode) + .'/SharedCost.json'; + } + + /** + * Reads SharedCostInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return SharedCostInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams SharedCostInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SharedCostInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return SharedCostPage Page of SharedCostInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SharedCostPage + { + $options = new Values($options); + + $params = Values::of([ + 'AreaCode' => + $options['areaCode'], + 'Contains' => + $options['contains'], + 'SmsEnabled' => + Serialize::booleanToString($options['smsEnabled']), + 'MmsEnabled' => + Serialize::booleanToString($options['mmsEnabled']), + 'VoiceEnabled' => + Serialize::booleanToString($options['voiceEnabled']), + 'ExcludeAllAddressRequired' => + Serialize::booleanToString($options['excludeAllAddressRequired']), + 'ExcludeLocalAddressRequired' => + Serialize::booleanToString($options['excludeLocalAddressRequired']), + 'ExcludeForeignAddressRequired' => + Serialize::booleanToString($options['excludeForeignAddressRequired']), + 'Beta' => + Serialize::booleanToString($options['beta']), + 'NearNumber' => + $options['nearNumber'], + 'NearLatLong' => + $options['nearLatLong'], + 'Distance' => + $options['distance'], + 'InPostalCode' => + $options['inPostalCode'], + 'InRegion' => + $options['inRegion'], + 'InRateCenter' => + $options['inRateCenter'], + 'InLata' => + $options['inLata'], + 'InLocality' => + $options['inLocality'], + 'FaxEnabled' => + Serialize::booleanToString($options['faxEnabled']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SharedCostPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SharedCostInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SharedCostPage Page of SharedCostInstance + */ + public function getPage(string $targetUrl): SharedCostPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SharedCostPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.SharedCostList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostOptions.php new file mode 100755 index 0000000..4fa361d --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostOptions.php @@ -0,0 +1,382 @@ +options['areaCode'] = $areaCode; + $this->options['contains'] = $contains; + $this->options['smsEnabled'] = $smsEnabled; + $this->options['mmsEnabled'] = $mmsEnabled; + $this->options['voiceEnabled'] = $voiceEnabled; + $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; + $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; + $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; + $this->options['beta'] = $beta; + $this->options['nearNumber'] = $nearNumber; + $this->options['nearLatLong'] = $nearLatLong; + $this->options['distance'] = $distance; + $this->options['inPostalCode'] = $inPostalCode; + $this->options['inRegion'] = $inRegion; + $this->options['inRateCenter'] = $inRateCenter; + $this->options['inLata'] = $inLata; + $this->options['inLocality'] = $inLocality; + $this->options['faxEnabled'] = $faxEnabled; + } + + /** + * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. + * + * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setAreaCode(int $areaCode): self + { + $this->options['areaCode'] = $areaCode; + return $this; + } + + /** + * The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. + * + * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. + * @return $this Fluent Builder + */ + public function setContains(string $contains): self + { + $this->options['contains'] = $contains; + return $this; + } + + /** + * Whether the phone numbers can receive text messages. Can be: `true` or `false`. + * + * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setSmsEnabled(bool $smsEnabled): self + { + $this->options['smsEnabled'] = $smsEnabled; + return $this; + } + + /** + * Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. + * + * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setMmsEnabled(bool $mmsEnabled): self + { + $this->options['mmsEnabled'] = $mmsEnabled; + return $this; + } + + /** + * Whether the phone numbers can receive calls. Can be: `true` or `false`. + * + * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setVoiceEnabled(bool $voiceEnabled): self + { + $this->options['voiceEnabled'] = $voiceEnabled; + return $this; + } + + /** + * Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeAllAddressRequired(bool $excludeAllAddressRequired): self + { + $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; + return $this; + } + + /** + * Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeLocalAddressRequired(bool $excludeLocalAddressRequired): self + { + $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; + return $this; + } + + /** + * Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeForeignAddressRequired(bool $excludeForeignAddressRequired): self + { + $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; + return $this; + } + + /** + * Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * + * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * @return $this Fluent Builder + */ + public function setBeta(bool $beta): self + { + $this->options['beta'] = $beta; + return $this; + } + + /** + * Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. + * + * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setNearNumber(string $nearNumber): self + { + $this->options['nearNumber'] = $nearNumber; + return $this; + } + + /** + * Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. + * + * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setNearLatLong(string $nearLatLong): self + { + $this->options['nearLatLong'] = $nearLatLong; + return $this; + } + + /** + * The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. + * + * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setDistance(int $distance): self + { + $this->options['distance'] = $distance; + return $this; + } + + /** + * Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInPostalCode(string $inPostalCode): self + { + $this->options['inPostalCode'] = $inPostalCode; + return $this; + } + + /** + * Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInRegion(string $inRegion): self + { + $this->options['inRegion'] = $inRegion; + return $this; + } + + /** + * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. + * + * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInRateCenter(string $inRateCenter): self + { + $this->options['inRateCenter'] = $inRateCenter; + return $this; + } + + /** + * Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInLata(string $inLata): self + { + $this->options['inLata'] = $inLata; + return $this; + } + + /** + * Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. + * + * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. + * @return $this Fluent Builder + */ + public function setInLocality(string $inLocality): self + { + $this->options['inLocality'] = $inLocality; + return $this; + } + + /** + * Whether the phone numbers can receive faxes. Can be: `true` or `false`. + * + * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setFaxEnabled(bool $faxEnabled): self + { + $this->options['faxEnabled'] = $faxEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadSharedCostOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostPage.php b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostPage.php new file mode 100755 index 0000000..9118086 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/SharedCostPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SharedCostInstance \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\SharedCostInstance + */ + public function buildInstance(array $payload): SharedCostInstance + { + return new SharedCostInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['countryCode']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.SharedCostPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeInstance.php new file mode 100755 index 0000000..259ec9e --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeInstance.php @@ -0,0 +1,108 @@ +properties = [ + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'phoneNumber' => Values::array_get($payload, 'phone_number'), + 'lata' => Values::array_get($payload, 'lata'), + 'locality' => Values::array_get($payload, 'locality'), + 'rateCenter' => Values::array_get($payload, 'rate_center'), + 'latitude' => Values::array_get($payload, 'latitude'), + 'longitude' => Values::array_get($payload, 'longitude'), + 'region' => Values::array_get($payload, 'region'), + 'postalCode' => Values::array_get($payload, 'postal_code'), + 'isoCountry' => Values::array_get($payload, 'iso_country'), + 'addressRequirements' => Values::array_get($payload, 'address_requirements'), + 'beta' => Values::array_get($payload, 'beta'), + 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), + ]; + + $this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.TollFreeInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeList.php b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeList.php new file mode 100755 index 0000000..6a9b913 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeList.php @@ -0,0 +1,199 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'countryCode' => + $countryCode, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/AvailablePhoneNumbers/' . \rawurlencode($countryCode) + .'/TollFree.json'; + } + + /** + * Reads TollFreeInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return TollFreeInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams TollFreeInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of TollFreeInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return TollFreePage Page of TollFreeInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): TollFreePage + { + $options = new Values($options); + + $params = Values::of([ + 'AreaCode' => + $options['areaCode'], + 'Contains' => + $options['contains'], + 'SmsEnabled' => + Serialize::booleanToString($options['smsEnabled']), + 'MmsEnabled' => + Serialize::booleanToString($options['mmsEnabled']), + 'VoiceEnabled' => + Serialize::booleanToString($options['voiceEnabled']), + 'ExcludeAllAddressRequired' => + Serialize::booleanToString($options['excludeAllAddressRequired']), + 'ExcludeLocalAddressRequired' => + Serialize::booleanToString($options['excludeLocalAddressRequired']), + 'ExcludeForeignAddressRequired' => + Serialize::booleanToString($options['excludeForeignAddressRequired']), + 'Beta' => + Serialize::booleanToString($options['beta']), + 'NearNumber' => + $options['nearNumber'], + 'NearLatLong' => + $options['nearLatLong'], + 'Distance' => + $options['distance'], + 'InPostalCode' => + $options['inPostalCode'], + 'InRegion' => + $options['inRegion'], + 'InRateCenter' => + $options['inRateCenter'], + 'InLata' => + $options['inLata'], + 'InLocality' => + $options['inLocality'], + 'FaxEnabled' => + Serialize::booleanToString($options['faxEnabled']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new TollFreePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of TollFreeInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return TollFreePage Page of TollFreeInstance + */ + public function getPage(string $targetUrl): TollFreePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new TollFreePage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.TollFreeList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeOptions.php new file mode 100755 index 0000000..2b1c549 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreeOptions.php @@ -0,0 +1,382 @@ +options['areaCode'] = $areaCode; + $this->options['contains'] = $contains; + $this->options['smsEnabled'] = $smsEnabled; + $this->options['mmsEnabled'] = $mmsEnabled; + $this->options['voiceEnabled'] = $voiceEnabled; + $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; + $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; + $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; + $this->options['beta'] = $beta; + $this->options['nearNumber'] = $nearNumber; + $this->options['nearLatLong'] = $nearLatLong; + $this->options['distance'] = $distance; + $this->options['inPostalCode'] = $inPostalCode; + $this->options['inRegion'] = $inRegion; + $this->options['inRateCenter'] = $inRateCenter; + $this->options['inLata'] = $inLata; + $this->options['inLocality'] = $inLocality; + $this->options['faxEnabled'] = $faxEnabled; + } + + /** + * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. + * + * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setAreaCode(int $areaCode): self + { + $this->options['areaCode'] = $areaCode; + return $this; + } + + /** + * The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. + * + * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. + * @return $this Fluent Builder + */ + public function setContains(string $contains): self + { + $this->options['contains'] = $contains; + return $this; + } + + /** + * Whether the phone numbers can receive text messages. Can be: `true` or `false`. + * + * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setSmsEnabled(bool $smsEnabled): self + { + $this->options['smsEnabled'] = $smsEnabled; + return $this; + } + + /** + * Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. + * + * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setMmsEnabled(bool $mmsEnabled): self + { + $this->options['mmsEnabled'] = $mmsEnabled; + return $this; + } + + /** + * Whether the phone numbers can receive calls. Can be: `true` or `false`. + * + * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setVoiceEnabled(bool $voiceEnabled): self + { + $this->options['voiceEnabled'] = $voiceEnabled; + return $this; + } + + /** + * Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeAllAddressRequired(bool $excludeAllAddressRequired): self + { + $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; + return $this; + } + + /** + * Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeLocalAddressRequired(bool $excludeLocalAddressRequired): self + { + $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; + return $this; + } + + /** + * Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeForeignAddressRequired(bool $excludeForeignAddressRequired): self + { + $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; + return $this; + } + + /** + * Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * + * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * @return $this Fluent Builder + */ + public function setBeta(bool $beta): self + { + $this->options['beta'] = $beta; + return $this; + } + + /** + * Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. + * + * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setNearNumber(string $nearNumber): self + { + $this->options['nearNumber'] = $nearNumber; + return $this; + } + + /** + * Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. + * + * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setNearLatLong(string $nearLatLong): self + { + $this->options['nearLatLong'] = $nearLatLong; + return $this; + } + + /** + * The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. + * + * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setDistance(int $distance): self + { + $this->options['distance'] = $distance; + return $this; + } + + /** + * Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInPostalCode(string $inPostalCode): self + { + $this->options['inPostalCode'] = $inPostalCode; + return $this; + } + + /** + * Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInRegion(string $inRegion): self + { + $this->options['inRegion'] = $inRegion; + return $this; + } + + /** + * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. + * + * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInRateCenter(string $inRateCenter): self + { + $this->options['inRateCenter'] = $inRateCenter; + return $this; + } + + /** + * Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInLata(string $inLata): self + { + $this->options['inLata'] = $inLata; + return $this; + } + + /** + * Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. + * + * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. + * @return $this Fluent Builder + */ + public function setInLocality(string $inLocality): self + { + $this->options['inLocality'] = $inLocality; + return $this; + } + + /** + * Whether the phone numbers can receive faxes. Can be: `true` or `false`. + * + * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setFaxEnabled(bool $faxEnabled): self + { + $this->options['faxEnabled'] = $faxEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadTollFreeOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreePage.php b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreePage.php new file mode 100755 index 0000000..6998267 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/TollFreePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TollFreeInstance \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\TollFreeInstance + */ + public function buildInstance(array $payload): TollFreeInstance + { + return new TollFreeInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['countryCode']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.TollFreePage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipInstance.php new file mode 100755 index 0000000..6d5dca4 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipInstance.php @@ -0,0 +1,108 @@ +properties = [ + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'phoneNumber' => Values::array_get($payload, 'phone_number'), + 'lata' => Values::array_get($payload, 'lata'), + 'locality' => Values::array_get($payload, 'locality'), + 'rateCenter' => Values::array_get($payload, 'rate_center'), + 'latitude' => Values::array_get($payload, 'latitude'), + 'longitude' => Values::array_get($payload, 'longitude'), + 'region' => Values::array_get($payload, 'region'), + 'postalCode' => Values::array_get($payload, 'postal_code'), + 'isoCountry' => Values::array_get($payload, 'iso_country'), + 'addressRequirements' => Values::array_get($payload, 'address_requirements'), + 'beta' => Values::array_get($payload, 'beta'), + 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), + ]; + + $this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.VoipInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipList.php b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipList.php new file mode 100755 index 0000000..8130bf8 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipList.php @@ -0,0 +1,199 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'countryCode' => + $countryCode, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/AvailablePhoneNumbers/' . \rawurlencode($countryCode) + .'/Voip.json'; + } + + /** + * Reads VoipInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return VoipInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams VoipInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of VoipInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return VoipPage Page of VoipInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): VoipPage + { + $options = new Values($options); + + $params = Values::of([ + 'AreaCode' => + $options['areaCode'], + 'Contains' => + $options['contains'], + 'SmsEnabled' => + Serialize::booleanToString($options['smsEnabled']), + 'MmsEnabled' => + Serialize::booleanToString($options['mmsEnabled']), + 'VoiceEnabled' => + Serialize::booleanToString($options['voiceEnabled']), + 'ExcludeAllAddressRequired' => + Serialize::booleanToString($options['excludeAllAddressRequired']), + 'ExcludeLocalAddressRequired' => + Serialize::booleanToString($options['excludeLocalAddressRequired']), + 'ExcludeForeignAddressRequired' => + Serialize::booleanToString($options['excludeForeignAddressRequired']), + 'Beta' => + Serialize::booleanToString($options['beta']), + 'NearNumber' => + $options['nearNumber'], + 'NearLatLong' => + $options['nearLatLong'], + 'Distance' => + $options['distance'], + 'InPostalCode' => + $options['inPostalCode'], + 'InRegion' => + $options['inRegion'], + 'InRateCenter' => + $options['inRateCenter'], + 'InLata' => + $options['inLata'], + 'InLocality' => + $options['inLocality'], + 'FaxEnabled' => + Serialize::booleanToString($options['faxEnabled']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new VoipPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of VoipInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return VoipPage Page of VoipInstance + */ + public function getPage(string $targetUrl): VoipPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new VoipPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.VoipList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipOptions.php new file mode 100755 index 0000000..1b0cf6f --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipOptions.php @@ -0,0 +1,382 @@ +options['areaCode'] = $areaCode; + $this->options['contains'] = $contains; + $this->options['smsEnabled'] = $smsEnabled; + $this->options['mmsEnabled'] = $mmsEnabled; + $this->options['voiceEnabled'] = $voiceEnabled; + $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; + $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; + $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; + $this->options['beta'] = $beta; + $this->options['nearNumber'] = $nearNumber; + $this->options['nearLatLong'] = $nearLatLong; + $this->options['distance'] = $distance; + $this->options['inPostalCode'] = $inPostalCode; + $this->options['inRegion'] = $inRegion; + $this->options['inRateCenter'] = $inRateCenter; + $this->options['inLata'] = $inLata; + $this->options['inLocality'] = $inLocality; + $this->options['faxEnabled'] = $faxEnabled; + } + + /** + * The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. + * + * @param int $areaCode The area code of the phone numbers to read. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setAreaCode(int $areaCode): self + { + $this->options['areaCode'] = $areaCode; + return $this; + } + + /** + * The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. + * + * @param string $contains The pattern on which to match phone numbers. Valid characters are `*`, `0-9`, `a-z`, and `A-Z`. The `*` character matches any single digit. For examples, see [Example 2](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-2) and [Example 3](https://www.twilio.com/docs/phone-numbers/api/availablephonenumber-resource#local-get-basic-example-3). If specified, this value must have at least two characters. + * @return $this Fluent Builder + */ + public function setContains(string $contains): self + { + $this->options['contains'] = $contains; + return $this; + } + + /** + * Whether the phone numbers can receive text messages. Can be: `true` or `false`. + * + * @param bool $smsEnabled Whether the phone numbers can receive text messages. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setSmsEnabled(bool $smsEnabled): self + { + $this->options['smsEnabled'] = $smsEnabled; + return $this; + } + + /** + * Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. + * + * @param bool $mmsEnabled Whether the phone numbers can receive MMS messages. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setMmsEnabled(bool $mmsEnabled): self + { + $this->options['mmsEnabled'] = $mmsEnabled; + return $this; + } + + /** + * Whether the phone numbers can receive calls. Can be: `true` or `false`. + * + * @param bool $voiceEnabled Whether the phone numbers can receive calls. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setVoiceEnabled(bool $voiceEnabled): self + { + $this->options['voiceEnabled'] = $voiceEnabled; + return $this; + } + + /** + * Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeAllAddressRequired Whether to exclude phone numbers that require an [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeAllAddressRequired(bool $excludeAllAddressRequired): self + { + $this->options['excludeAllAddressRequired'] = $excludeAllAddressRequired; + return $this; + } + + /** + * Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeLocalAddressRequired Whether to exclude phone numbers that require a local [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeLocalAddressRequired(bool $excludeLocalAddressRequired): self + { + $this->options['excludeLocalAddressRequired'] = $excludeLocalAddressRequired; + return $this; + } + + /** + * Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * + * @param bool $excludeForeignAddressRequired Whether to exclude phone numbers that require a foreign [Address](https://www.twilio.com/docs/usage/api/address). Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setExcludeForeignAddressRequired(bool $excludeForeignAddressRequired): self + { + $this->options['excludeForeignAddressRequired'] = $excludeForeignAddressRequired; + return $this; + } + + /** + * Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * + * @param bool $beta Whether to read phone numbers that are new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * @return $this Fluent Builder + */ + public function setBeta(bool $beta): self + { + $this->options['beta'] = $beta; + return $this; + } + + /** + * Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. + * + * @param string $nearNumber Given a phone number, find a geographically close number within `distance` miles. Distance defaults to 25 miles. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setNearNumber(string $nearNumber): self + { + $this->options['nearNumber'] = $nearNumber; + return $this; + } + + /** + * Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. + * + * @param string $nearLatLong Given a latitude/longitude pair `lat,long` find geographically close numbers within `distance` miles. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setNearLatLong(string $nearLatLong): self + { + $this->options['nearLatLong'] = $nearLatLong; + return $this; + } + + /** + * The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. + * + * @param int $distance The search radius, in miles, for a `near_` query. Can be up to `500` and the default is `25`. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setDistance(int $distance): self + { + $this->options['distance'] = $distance; + return $this; + } + + /** + * Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inPostalCode Limit results to a particular postal code. Given a phone number, search within the same postal code as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInPostalCode(string $inPostalCode): self + { + $this->options['inPostalCode'] = $inPostalCode; + return $this; + } + + /** + * Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inRegion Limit results to a particular region, state, or province. Given a phone number, search within the same region as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInRegion(string $inRegion): self + { + $this->options['inRegion'] = $inRegion; + return $this; + } + + /** + * Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. + * + * @param string $inRateCenter Limit results to a specific rate center, or given a phone number search within the same rate center as that number. Requires `in_lata` to be set as well. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInRateCenter(string $inRateCenter): self + { + $this->options['inRateCenter'] = $inRateCenter; + return $this; + } + + /** + * Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. + * + * @param string $inLata Limit results to a specific local access and transport area ([LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area)). Given a phone number, search within the same [LATA](https://en.wikipedia.org/wiki/Local_access_and_transport_area) as that number. Applies to only phone numbers in the US and Canada. + * @return $this Fluent Builder + */ + public function setInLata(string $inLata): self + { + $this->options['inLata'] = $inLata; + return $this; + } + + /** + * Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. + * + * @param string $inLocality Limit results to a particular locality or city. Given a phone number, search within the same Locality as that number. + * @return $this Fluent Builder + */ + public function setInLocality(string $inLocality): self + { + $this->options['inLocality'] = $inLocality; + return $this; + } + + /** + * Whether the phone numbers can receive faxes. Can be: `true` or `false`. + * + * @param bool $faxEnabled Whether the phone numbers can receive faxes. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setFaxEnabled(bool $faxEnabled): self + { + $this->options['faxEnabled'] = $faxEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadVoipOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipPage.php b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipPage.php new file mode 100755 index 0000000..b05e86b --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountry/VoipPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return VoipInstance \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountry\VoipInstance + */ + public function buildInstance(array $payload): VoipInstance + { + return new VoipInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['countryCode']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.VoipPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryContext.php b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryContext.php new file mode 100755 index 0000000..e6ec61d --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryContext.php @@ -0,0 +1,259 @@ +solution = [ + 'accountSid' => + $accountSid, + 'countryCode' => + $countryCode, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/AvailablePhoneNumbers/' . \rawurlencode($countryCode) + .'.json'; + } + + /** + * Fetch the AvailablePhoneNumberCountryInstance + * + * @return AvailablePhoneNumberCountryInstance Fetched AvailablePhoneNumberCountryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AvailablePhoneNumberCountryInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new AvailablePhoneNumberCountryInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['countryCode'] + ); + } + + + /** + * Access the voip + */ + protected function getVoip(): VoipList + { + if (!$this->_voip) { + $this->_voip = new VoipList( + $this->version, + $this->solution['accountSid'], + $this->solution['countryCode'] + ); + } + + return $this->_voip; + } + + /** + * Access the national + */ + protected function getNational(): NationalList + { + if (!$this->_national) { + $this->_national = new NationalList( + $this->version, + $this->solution['accountSid'], + $this->solution['countryCode'] + ); + } + + return $this->_national; + } + + /** + * Access the mobile + */ + protected function getMobile(): MobileList + { + if (!$this->_mobile) { + $this->_mobile = new MobileList( + $this->version, + $this->solution['accountSid'], + $this->solution['countryCode'] + ); + } + + return $this->_mobile; + } + + /** + * Access the machineToMachine + */ + protected function getMachineToMachine(): MachineToMachineList + { + if (!$this->_machineToMachine) { + $this->_machineToMachine = new MachineToMachineList( + $this->version, + $this->solution['accountSid'], + $this->solution['countryCode'] + ); + } + + return $this->_machineToMachine; + } + + /** + * Access the tollFree + */ + protected function getTollFree(): TollFreeList + { + if (!$this->_tollFree) { + $this->_tollFree = new TollFreeList( + $this->version, + $this->solution['accountSid'], + $this->solution['countryCode'] + ); + } + + return $this->_tollFree; + } + + /** + * Access the sharedCost + */ + protected function getSharedCost(): SharedCostList + { + if (!$this->_sharedCost) { + $this->_sharedCost = new SharedCostList( + $this->version, + $this->solution['accountSid'], + $this->solution['countryCode'] + ); + } + + return $this->_sharedCost; + } + + /** + * Access the local + */ + protected function getLocal(): LocalList + { + if (!$this->_local) { + $this->_local = new LocalList( + $this->version, + $this->solution['accountSid'], + $this->solution['countryCode'] + ); + } + + return $this->_local; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AvailablePhoneNumberCountryContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryInstance.php new file mode 100755 index 0000000..34b0860 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryInstance.php @@ -0,0 +1,196 @@ +properties = [ + 'countryCode' => Values::array_get($payload, 'country_code'), + 'country' => Values::array_get($payload, 'country'), + 'uri' => Values::array_get($payload, 'uri'), + 'beta' => Values::array_get($payload, 'beta'), + 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'countryCode' => $countryCode ?: $this->properties['countryCode'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AvailablePhoneNumberCountryContext Context for this AvailablePhoneNumberCountryInstance + */ + protected function proxy(): AvailablePhoneNumberCountryContext + { + if (!$this->context) { + $this->context = new AvailablePhoneNumberCountryContext( + $this->version, + $this->solution['accountSid'], + $this->solution['countryCode'] + ); + } + + return $this->context; + } + + /** + * Fetch the AvailablePhoneNumberCountryInstance + * + * @return AvailablePhoneNumberCountryInstance Fetched AvailablePhoneNumberCountryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AvailablePhoneNumberCountryInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the voip + */ + protected function getVoip(): VoipList + { + return $this->proxy()->voip; + } + + /** + * Access the national + */ + protected function getNational(): NationalList + { + return $this->proxy()->national; + } + + /** + * Access the mobile + */ + protected function getMobile(): MobileList + { + return $this->proxy()->mobile; + } + + /** + * Access the machineToMachine + */ + protected function getMachineToMachine(): MachineToMachineList + { + return $this->proxy()->machineToMachine; + } + + /** + * Access the tollFree + */ + protected function getTollFree(): TollFreeList + { + return $this->proxy()->tollFree; + } + + /** + * Access the sharedCost + */ + protected function getSharedCost(): SharedCostList + { + return $this->proxy()->sharedCost; + } + + /** + * Access the local + */ + protected function getLocal(): LocalList + { + return $this->proxy()->local; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AvailablePhoneNumberCountryInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryList.php b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryList.php new file mode 100755 index 0000000..1ee5029 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryList.php @@ -0,0 +1,168 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/AvailablePhoneNumbers.json'; + } + + /** + * Reads AvailablePhoneNumberCountryInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return AvailablePhoneNumberCountryInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams AvailablePhoneNumberCountryInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AvailablePhoneNumberCountryInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return AvailablePhoneNumberCountryPage Page of AvailablePhoneNumberCountryInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AvailablePhoneNumberCountryPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new AvailablePhoneNumberCountryPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of AvailablePhoneNumberCountryInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return AvailablePhoneNumberCountryPage Page of AvailablePhoneNumberCountryInstance + */ + public function getPage(string $targetUrl): AvailablePhoneNumberCountryPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AvailablePhoneNumberCountryPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AvailablePhoneNumberCountryContext + * + * @param string $countryCode The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country to fetch available phone number information about. + */ + public function getContext( + string $countryCode + + ): AvailablePhoneNumberCountryContext + { + return new AvailablePhoneNumberCountryContext( + $this->version, + $this->solution['accountSid'], + $countryCode + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AvailablePhoneNumberCountryList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryPage.php b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryPage.php new file mode 100755 index 0000000..532d67f --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/AvailablePhoneNumberCountryPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AvailablePhoneNumberCountryInstance \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryInstance + */ + public function buildInstance(array $payload): AvailablePhoneNumberCountryInstance + { + return new AvailablePhoneNumberCountryInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AvailablePhoneNumberCountryPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/BalanceInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/BalanceInstance.php new file mode 100755 index 0000000..e136521 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/BalanceInstance.php @@ -0,0 +1,85 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'balance' => Values::array_get($payload, 'balance'), + 'currency' => Values::array_get($payload, 'currency'), + ]; + + $this->solution = ['accountSid' => $accountSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.BalanceInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/BalanceList.php b/app/api/Twilio/Rest/Api/V2010/Account/BalanceList.php new file mode 100755 index 0000000..f696623 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/BalanceList.php @@ -0,0 +1,77 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Balance.json'; + } + + /** + * Fetch the BalanceInstance + * + * @return BalanceInstance Fetched BalanceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BalanceInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new BalanceInstance( + $this->version, + $payload, + $this->solution['accountSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.BalanceList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/BalancePage.php b/app/api/Twilio/Rest/Api/V2010/Account/BalancePage.php new file mode 100755 index 0000000..4bcb550 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/BalancePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return BalanceInstance \Twilio\Rest\Api\V2010\Account\BalanceInstance + */ + public function buildInstance(array $payload): BalanceInstance + { + return new BalanceInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.BalancePage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/EventInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/EventInstance.php new file mode 100755 index 0000000..a71a781 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/EventInstance.php @@ -0,0 +1,84 @@ +properties = [ + 'request' => Values::array_get($payload, 'request'), + 'response' => Values::array_get($payload, 'response'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.EventInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/EventList.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/EventList.php new file mode 100755 index 0000000..a7d3c48 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/EventList.php @@ -0,0 +1,157 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'callSid' => + $callSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Calls/' . \rawurlencode($callSid) + .'/Events.json'; + } + + /** + * Reads EventInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return EventInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams EventInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of EventInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return EventPage Page of EventInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): EventPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new EventPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of EventInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return EventPage Page of EventInstance + */ + public function getPage(string $targetUrl): EventPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new EventPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.EventList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/EventPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/EventPage.php new file mode 100755 index 0000000..939240e --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/EventPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return EventInstance \Twilio\Rest\Api\V2010\Account\Call\EventInstance + */ + public function buildInstance(array $payload): EventInstance + { + return new EventInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['callSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.EventPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/FeedbackContext.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/FeedbackContext.php new file mode 100755 index 0000000..3498ef1 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/FeedbackContext.php @@ -0,0 +1,119 @@ +solution = [ + 'accountSid' => + $accountSid, + 'callSid' => + $callSid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Calls/' . \rawurlencode($callSid) + .'/Feedback.json'; + } + + /** + * Fetch the FeedbackInstance + * + * @return FeedbackInstance Fetched FeedbackInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FeedbackInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new FeedbackInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['callSid'] + ); + } + + + /** + * Update the FeedbackInstance + * + * @param array|Options $options Optional Arguments + * @return FeedbackInstance Updated FeedbackInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): FeedbackInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'QualityScore' => + $options['qualityScore'], + 'Issue' => + $options['issue'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new FeedbackInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['callSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.FeedbackContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/FeedbackInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/FeedbackInstance.php new file mode 100755 index 0000000..9ec3e40 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/FeedbackInstance.php @@ -0,0 +1,142 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'issues' => Values::array_get($payload, 'issues'), + 'qualityScore' => Values::array_get($payload, 'quality_score'), + 'sid' => Values::array_get($payload, 'sid'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return FeedbackContext Context for this FeedbackInstance + */ + protected function proxy(): FeedbackContext + { + if (!$this->context) { + $this->context = new FeedbackContext( + $this->version, + $this->solution['accountSid'], + $this->solution['callSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the FeedbackInstance + * + * @return FeedbackInstance Fetched FeedbackInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FeedbackInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the FeedbackInstance + * + * @param array|Options $options Optional Arguments + * @return FeedbackInstance Updated FeedbackInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): FeedbackInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.FeedbackInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/FeedbackList.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/FeedbackList.php new file mode 100755 index 0000000..04e2375 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/FeedbackList.php @@ -0,0 +1,73 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'callSid' => + $callSid, + + ]; + } + + /** + * Constructs a FeedbackContext + */ + public function getContext( + + ): FeedbackContext + { + return new FeedbackContext( + $this->version, + $this->solution['accountSid'], + $this->solution['callSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.FeedbackList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/FeedbackOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/FeedbackOptions.php new file mode 100755 index 0000000..5603935 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/FeedbackOptions.php @@ -0,0 +1,96 @@ +options['qualityScore'] = $qualityScore; + $this->options['issue'] = $issue; + } + + /** + * The call quality expressed as an integer from `1` to `5` where `1` represents very poor call quality and `5` represents a perfect call. + * + * @param int $qualityScore The call quality expressed as an integer from `1` to `5` where `1` represents very poor call quality and `5` represents a perfect call. + * @return $this Fluent Builder + */ + public function setQualityScore(int $qualityScore): self + { + $this->options['qualityScore'] = $qualityScore; + return $this; + } + + /** + * One or more issues experienced during the call. The issues can be: `imperfect-audio`, `dropped-call`, `incorrect-caller-id`, `post-dial-delay`, `digits-not-captured`, `audio-latency`, `unsolicited-call`, or `one-way-audio`. + * + * @param string $issue One or more issues experienced during the call. The issues can be: `imperfect-audio`, `dropped-call`, `incorrect-caller-id`, `post-dial-delay`, `digits-not-captured`, `audio-latency`, `unsolicited-call`, or `one-way-audio`. + * @return $this Fluent Builder + */ + public function setIssue(array $issue): self + { + $this->options['issue'] = $issue; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateFeedbackOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/FeedbackPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/FeedbackPage.php new file mode 100755 index 0000000..aced4c3 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/FeedbackPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return FeedbackInstance \Twilio\Rest\Api\V2010\Account\Call\FeedbackInstance + */ + public function buildInstance(array $payload): FeedbackInstance + { + return new FeedbackInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['callSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.FeedbackPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryContext.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryContext.php new file mode 100755 index 0000000..f4f9f05 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryContext.php @@ -0,0 +1,100 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Calls/FeedbackSummary/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the FeedbackSummaryInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the FeedbackSummaryInstance + * + * @return FeedbackSummaryInstance Fetched FeedbackSummaryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FeedbackSummaryInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new FeedbackSummaryInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.FeedbackSummaryContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryInstance.php new file mode 100755 index 0000000..4de52fc --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryInstance.php @@ -0,0 +1,156 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'callCount' => Values::array_get($payload, 'call_count'), + 'callFeedbackCount' => Values::array_get($payload, 'call_feedback_count'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), + 'includeSubaccounts' => Values::array_get($payload, 'include_subaccounts'), + 'issues' => Values::array_get($payload, 'issues'), + 'qualityScoreAverage' => Values::array_get($payload, 'quality_score_average'), + 'qualityScoreMedian' => Values::array_get($payload, 'quality_score_median'), + 'qualityScoreStandardDeviation' => Values::array_get($payload, 'quality_score_standard_deviation'), + 'sid' => Values::array_get($payload, 'sid'), + 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), + 'status' => Values::array_get($payload, 'status'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return FeedbackSummaryContext Context for this FeedbackSummaryInstance + */ + protected function proxy(): FeedbackSummaryContext + { + if (!$this->context) { + $this->context = new FeedbackSummaryContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the FeedbackSummaryInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the FeedbackSummaryInstance + * + * @return FeedbackSummaryInstance Fetched FeedbackSummaryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FeedbackSummaryInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.FeedbackSummaryInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryList.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryList.php new file mode 100755 index 0000000..4828f06 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryList.php @@ -0,0 +1,115 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Calls/FeedbackSummary.json'; + } + + /** + * Create the FeedbackSummaryInstance + * + * @param \DateTime $startDate Only include feedback given on or after this date. Format is `YYYY-MM-DD` and specified in UTC. + * @param \DateTime $endDate Only include feedback given on or before this date. Format is `YYYY-MM-DD` and specified in UTC. + * @param array|Options $options Optional Arguments + * @return FeedbackSummaryInstance Created FeedbackSummaryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(\DateTime $startDate, \DateTime $endDate, array $options = []): FeedbackSummaryInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'StartDate' => + Serialize::iso8601Date($startDate), + 'EndDate' => + Serialize::iso8601Date($endDate), + 'IncludeSubaccounts' => + Serialize::booleanToString($options['includeSubaccounts']), + 'StatusCallback' => + $options['statusCallback'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new FeedbackSummaryInstance( + $this->version, + $payload, + $this->solution['accountSid'] + ); + } + + + /** + * Constructs a FeedbackSummaryContext + * + * @param string $sid A 34 character string that uniquely identifies this resource. + */ + public function getContext( + string $sid + + ): FeedbackSummaryContext + { + return new FeedbackSummaryContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.FeedbackSummaryList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryOptions.php new file mode 100755 index 0000000..a81acc1 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryOptions.php @@ -0,0 +1,116 @@ +options['includeSubaccounts'] = $includeSubaccounts; + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + } + + /** + * Whether to also include Feedback resources from all subaccounts. `true` includes feedback from all subaccounts and `false`, the default, includes feedback from only the specified account. + * + * @param bool $includeSubaccounts Whether to also include Feedback resources from all subaccounts. `true` includes feedback from all subaccounts and `false`, the default, includes feedback from only the specified account. + * @return $this Fluent Builder + */ + public function setIncludeSubaccounts(bool $includeSubaccounts): self + { + $this->options['includeSubaccounts'] = $includeSubaccounts; + return $this; + } + + /** + * The URL that we will request when the feedback summary is complete. + * + * @param string $statusCallback The URL that we will request when the feedback summary is complete. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The HTTP method (`GET` or `POST`) we use to make the request to the `StatusCallback` URL. + * + * @param string $statusCallbackMethod The HTTP method (`GET` or `POST`) we use to make the request to the `StatusCallback` URL. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateFeedbackSummaryOptions ' . $options . ']'; + } +} + + + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryPage.php new file mode 100755 index 0000000..0b9982f --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/FeedbackSummaryPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return FeedbackSummaryInstance \Twilio\Rest\Api\V2010\Account\Call\FeedbackSummaryInstance + */ + public function buildInstance(array $payload): FeedbackSummaryInstance + { + return new FeedbackSummaryInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.FeedbackSummaryPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/NotificationContext.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/NotificationContext.php new file mode 100755 index 0000000..57363fe --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/NotificationContext.php @@ -0,0 +1,93 @@ +solution = [ + 'accountSid' => + $accountSid, + 'callSid' => + $callSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Calls/' . \rawurlencode($callSid) + .'/Notifications/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Fetch the NotificationInstance + * + * @return NotificationInstance Fetched NotificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): NotificationInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new NotificationInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['callSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.NotificationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/NotificationInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/NotificationInstance.php new file mode 100755 index 0000000..0a91d38 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/NotificationInstance.php @@ -0,0 +1,152 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'callSid' => Values::array_get($payload, 'call_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'errorCode' => Values::array_get($payload, 'error_code'), + 'log' => Values::array_get($payload, 'log'), + 'messageDate' => Deserialize::dateTime(Values::array_get($payload, 'message_date')), + 'messageText' => Values::array_get($payload, 'message_text'), + 'moreInfo' => Values::array_get($payload, 'more_info'), + 'requestMethod' => Values::array_get($payload, 'request_method'), + 'requestUrl' => Values::array_get($payload, 'request_url'), + 'requestVariables' => Values::array_get($payload, 'request_variables'), + 'responseBody' => Values::array_get($payload, 'response_body'), + 'responseHeaders' => Values::array_get($payload, 'response_headers'), + 'sid' => Values::array_get($payload, 'sid'), + 'uri' => Values::array_get($payload, 'uri'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return NotificationContext Context for this NotificationInstance + */ + protected function proxy(): NotificationContext + { + if (!$this->context) { + $this->context = new NotificationContext( + $this->version, + $this->solution['accountSid'], + $this->solution['callSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the NotificationInstance + * + * @return NotificationInstance Fetched NotificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): NotificationInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.NotificationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/NotificationList.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/NotificationList.php new file mode 100755 index 0000000..3e1c27e --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/NotificationList.php @@ -0,0 +1,189 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'callSid' => + $callSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Calls/' . \rawurlencode($callSid) + .'/Notifications.json'; + } + + /** + * Reads NotificationInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return NotificationInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams NotificationInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of NotificationInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return NotificationPage Page of NotificationInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): NotificationPage + { + $options = new Values($options); + + $params = Values::of([ + 'Log' => + $options['log'], + 'MessageDate<' => + Serialize::iso8601Date($options['messageDateBefore']), + 'MessageDate' => + Serialize::iso8601Date($options['messageDate']), + 'MessageDate>' => + Serialize::iso8601Date($options['messageDateAfter']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new NotificationPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of NotificationInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return NotificationPage Page of NotificationInstance + */ + public function getPage(string $targetUrl): NotificationPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new NotificationPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a NotificationContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Call Notification resource to fetch. + */ + public function getContext( + string $sid + + ): NotificationContext + { + return new NotificationContext( + $this->version, + $this->solution['accountSid'], + $this->solution['callSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.NotificationList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/NotificationOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/NotificationOptions.php new file mode 100755 index 0000000..f7faa2d --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/NotificationOptions.php @@ -0,0 +1,132 @@ +=YYYY-MM-DD` for messages logged at or after midnight on a date. + * @param string $messageDate Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * @param string $messageDateAfter Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * @return ReadNotificationOptions Options builder + */ + public static function read( + + int $log = Values::INT_NONE, + string $messageDateBefore = null, + string $messageDate = null, + string $messageDateAfter = null + + ): ReadNotificationOptions + { + return new ReadNotificationOptions( + $log, + $messageDateBefore, + $messageDate, + $messageDateAfter + ); + } + +} + + +class ReadNotificationOptions extends Options + { + /** + * @param int $log Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read. + * @param string $messageDateBefore Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * @param string $messageDate Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * @param string $messageDateAfter Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + */ + public function __construct( + + int $log = Values::INT_NONE, + string $messageDateBefore = null, + string $messageDate = null, + string $messageDateAfter = null + + ) { + $this->options['log'] = $log; + $this->options['messageDateBefore'] = $messageDateBefore; + $this->options['messageDate'] = $messageDate; + $this->options['messageDateAfter'] = $messageDateAfter; + } + + /** + * Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read. + * + * @param int $log Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read. + * @return $this Fluent Builder + */ + public function setLog(int $log): self + { + $this->options['log'] = $log; + return $this; + } + + /** + * Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * + * @param string $messageDateBefore Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * @return $this Fluent Builder + */ + public function setMessageDateBefore(string $messageDateBefore): self + { + $this->options['messageDateBefore'] = $messageDateBefore; + return $this; + } + + /** + * Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * + * @param string $messageDate Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * @return $this Fluent Builder + */ + public function setMessageDate(string $messageDate): self + { + $this->options['messageDate'] = $messageDate; + return $this; + } + + /** + * Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * + * @param string $messageDateAfter Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * @return $this Fluent Builder + */ + public function setMessageDateAfter(string $messageDateAfter): self + { + $this->options['messageDateAfter'] = $messageDateAfter; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadNotificationOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/NotificationPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/NotificationPage.php new file mode 100755 index 0000000..9b45d12 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/NotificationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return NotificationInstance \Twilio\Rest\Api\V2010\Account\Call\NotificationInstance + */ + public function buildInstance(array $payload): NotificationInstance + { + return new NotificationInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['callSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.NotificationPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/PaymentContext.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/PaymentContext.php new file mode 100755 index 0000000..1c7731b --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/PaymentContext.php @@ -0,0 +1,111 @@ +solution = [ + 'accountSid' => + $accountSid, + 'callSid' => + $callSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Calls/' . \rawurlencode($callSid) + .'/Payments/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Update the PaymentInstance + * + * @param string $idempotencyKey A unique token that will be used to ensure that multiple API calls with the same information do not result in multiple transactions. This should be a unique string value per API call and can be a randomly generated. + * @param string $statusCallback Provide an absolute or relative URL to receive status updates regarding your Pay session. Read more about the [Update](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback-update) and [Complete/Cancel](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback-cancelcomplete) POST requests. + * @param array|Options $options Optional Arguments + * @return PaymentInstance Updated PaymentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $idempotencyKey, string $statusCallback, array $options = []): PaymentInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'IdempotencyKey' => + $idempotencyKey, + 'StatusCallback' => + $statusCallback, + 'Capture' => + $options['capture'], + 'Status' => + $options['status'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new PaymentInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['callSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.PaymentContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/PaymentInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/PaymentInstance.php new file mode 100755 index 0000000..07bc392 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/PaymentInstance.php @@ -0,0 +1,134 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'callSid' => Values::array_get($payload, 'call_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'uri' => Values::array_get($payload, 'uri'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return PaymentContext Context for this PaymentInstance + */ + protected function proxy(): PaymentContext + { + if (!$this->context) { + $this->context = new PaymentContext( + $this->version, + $this->solution['accountSid'], + $this->solution['callSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Update the PaymentInstance + * + * @param string $idempotencyKey A unique token that will be used to ensure that multiple API calls with the same information do not result in multiple transactions. This should be a unique string value per API call and can be a randomly generated. + * @param string $statusCallback Provide an absolute or relative URL to receive status updates regarding your Pay session. Read more about the [Update](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback-update) and [Complete/Cancel](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback-cancelcomplete) POST requests. + * @param array|Options $options Optional Arguments + * @return PaymentInstance Updated PaymentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $idempotencyKey, string $statusCallback, array $options = []): PaymentInstance + { + + return $this->proxy()->update($idempotencyKey, $statusCallback, $options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.PaymentInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/PaymentList.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/PaymentList.php new file mode 100755 index 0000000..1e2b112 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/PaymentList.php @@ -0,0 +1,145 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'callSid' => + $callSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Calls/' . \rawurlencode($callSid) + .'/Payments.json'; + } + + /** + * Create the PaymentInstance + * + * @param string $idempotencyKey A unique token that will be used to ensure that multiple API calls with the same information do not result in multiple transactions. This should be a unique string value per API call and can be a randomly generated. + * @param string $statusCallback Provide an absolute or relative URL to receive status updates regarding your Pay session. Read more about the [expected StatusCallback values](https://www.twilio.com/docs/voice/api/payment-resource#statuscallback) + * @param array|Options $options Optional Arguments + * @return PaymentInstance Created PaymentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $idempotencyKey, string $statusCallback, array $options = []): PaymentInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'IdempotencyKey' => + $idempotencyKey, + 'StatusCallback' => + $statusCallback, + 'BankAccountType' => + $options['bankAccountType'], + 'ChargeAmount' => + $options['chargeAmount'], + 'Currency' => + $options['currency'], + 'Description' => + $options['description'], + 'Input' => + $options['input'], + 'MinPostalCodeLength' => + $options['minPostalCodeLength'], + 'Parameter' => + Serialize::jsonObject($options['parameter']), + 'PaymentConnector' => + $options['paymentConnector'], + 'PaymentMethod' => + $options['paymentMethod'], + 'PostalCode' => + Serialize::booleanToString($options['postalCode']), + 'SecurityCode' => + Serialize::booleanToString($options['securityCode']), + 'Timeout' => + $options['timeout'], + 'TokenType' => + $options['tokenType'], + 'ValidCardTypes' => + $options['validCardTypes'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new PaymentInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['callSid'] + ); + } + + + /** + * Constructs a PaymentContext + * + * @param string $sid The SID of Payments session that needs to be updated. + */ + public function getContext( + string $sid + + ): PaymentContext + { + return new PaymentContext( + $this->version, + $this->solution['accountSid'], + $this->solution['callSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.PaymentList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/PaymentOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/PaymentOptions.php new file mode 100755 index 0000000..32b14be --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/PaymentOptions.php @@ -0,0 +1,370 @@ + Connector. [Read more](https://www.twilio.com/console/voice/pay-connectors). + * @param string $paymentConnector This is the unique name corresponding to the Pay Connector installed in the Twilio Add-ons. Learn more about [ Connectors](https://www.twilio.com/console/voice/pay-connectors). The default value is `Default`. + * @param string $paymentMethod + * @param bool $postalCode Indicates whether the credit card postal code (zip code) is a required piece of payment information that must be provided by the caller. The default is `true`. + * @param bool $securityCode Indicates whether the credit card security code is a required piece of payment information that must be provided by the caller. The default is `true`. + * @param int $timeout The number of seconds that should wait for the caller to press a digit between each subsequent digit, after the first one, before moving on to validate the digits captured. The default is `5`, maximum is `600`. + * @param string $tokenType + * @param string $validCardTypes Credit card types separated by space that Pay should accept. The default value is `visa mastercard amex` + * @return CreatePaymentOptions Options builder + */ + public static function create( + + string $bankAccountType = Values::NONE, + string $chargeAmount = Values::NONE, + string $currency = Values::NONE, + string $description = Values::NONE, + string $input = Values::NONE, + int $minPostalCodeLength = Values::INT_NONE, + array $parameter = Values::ARRAY_NONE, + string $paymentConnector = Values::NONE, + string $paymentMethod = Values::NONE, + bool $postalCode = Values::BOOL_NONE, + bool $securityCode = Values::BOOL_NONE, + int $timeout = Values::INT_NONE, + string $tokenType = Values::NONE, + string $validCardTypes = Values::NONE + + ): CreatePaymentOptions + { + return new CreatePaymentOptions( + $bankAccountType, + $chargeAmount, + $currency, + $description, + $input, + $minPostalCodeLength, + $parameter, + $paymentConnector, + $paymentMethod, + $postalCode, + $securityCode, + $timeout, + $tokenType, + $validCardTypes + ); + } + + /** + * @param string $capture + * @param string $status + * @return UpdatePaymentOptions Options builder + */ + public static function update( + + string $capture = Values::NONE, + string $status = Values::NONE + + ): UpdatePaymentOptions + { + return new UpdatePaymentOptions( + $capture, + $status + ); + } + +} + +class CreatePaymentOptions extends Options + { + /** + * @param string $bankAccountType + * @param string $chargeAmount A positive decimal value less than 1,000,000 to charge against the credit card or bank account. Default currency can be overwritten with `currency` field. Leave blank or set to 0 to tokenize. + * @param string $currency The currency of the `charge_amount`, formatted as [ISO 4127](http://www.iso.org/iso/home/standards/currency_codes.htm) format. The default value is `USD` and all values allowed from the Pay Connector are accepted. + * @param string $description The description can be used to provide more details regarding the transaction. This information is submitted along with the payment details to the Payment Connector which are then posted on the transactions. + * @param string $input A list of inputs that should be accepted. Currently only `dtmf` is supported. All digits captured during a pay session are redacted from the logs. + * @param int $minPostalCodeLength A positive integer that is used to validate the length of the `PostalCode` inputted by the user. User must enter this many digits. + * @param array $parameter A single-level JSON object used to pass custom parameters to payment processors. (Required for ACH payments). The information that has to be included here depends on the Connector. [Read more](https://www.twilio.com/console/voice/pay-connectors). + * @param string $paymentConnector This is the unique name corresponding to the Pay Connector installed in the Twilio Add-ons. Learn more about [ Connectors](https://www.twilio.com/console/voice/pay-connectors). The default value is `Default`. + * @param string $paymentMethod + * @param bool $postalCode Indicates whether the credit card postal code (zip code) is a required piece of payment information that must be provided by the caller. The default is `true`. + * @param bool $securityCode Indicates whether the credit card security code is a required piece of payment information that must be provided by the caller. The default is `true`. + * @param int $timeout The number of seconds that should wait for the caller to press a digit between each subsequent digit, after the first one, before moving on to validate the digits captured. The default is `5`, maximum is `600`. + * @param string $tokenType + * @param string $validCardTypes Credit card types separated by space that Pay should accept. The default value is `visa mastercard amex` + */ + public function __construct( + + string $bankAccountType = Values::NONE, + string $chargeAmount = Values::NONE, + string $currency = Values::NONE, + string $description = Values::NONE, + string $input = Values::NONE, + int $minPostalCodeLength = Values::INT_NONE, + array $parameter = Values::ARRAY_NONE, + string $paymentConnector = Values::NONE, + string $paymentMethod = Values::NONE, + bool $postalCode = Values::BOOL_NONE, + bool $securityCode = Values::BOOL_NONE, + int $timeout = Values::INT_NONE, + string $tokenType = Values::NONE, + string $validCardTypes = Values::NONE + + ) { + $this->options['bankAccountType'] = $bankAccountType; + $this->options['chargeAmount'] = $chargeAmount; + $this->options['currency'] = $currency; + $this->options['description'] = $description; + $this->options['input'] = $input; + $this->options['minPostalCodeLength'] = $minPostalCodeLength; + $this->options['parameter'] = $parameter; + $this->options['paymentConnector'] = $paymentConnector; + $this->options['paymentMethod'] = $paymentMethod; + $this->options['postalCode'] = $postalCode; + $this->options['securityCode'] = $securityCode; + $this->options['timeout'] = $timeout; + $this->options['tokenType'] = $tokenType; + $this->options['validCardTypes'] = $validCardTypes; + } + + /** + * @param string $bankAccountType + * @return $this Fluent Builder + */ + public function setBankAccountType(string $bankAccountType): self + { + $this->options['bankAccountType'] = $bankAccountType; + return $this; + } + + /** + * A positive decimal value less than 1,000,000 to charge against the credit card or bank account. Default currency can be overwritten with `currency` field. Leave blank or set to 0 to tokenize. + * + * @param string $chargeAmount A positive decimal value less than 1,000,000 to charge against the credit card or bank account. Default currency can be overwritten with `currency` field. Leave blank or set to 0 to tokenize. + * @return $this Fluent Builder + */ + public function setChargeAmount(string $chargeAmount): self + { + $this->options['chargeAmount'] = $chargeAmount; + return $this; + } + + /** + * The currency of the `charge_amount`, formatted as [ISO 4127](http://www.iso.org/iso/home/standards/currency_codes.htm) format. The default value is `USD` and all values allowed from the Pay Connector are accepted. + * + * @param string $currency The currency of the `charge_amount`, formatted as [ISO 4127](http://www.iso.org/iso/home/standards/currency_codes.htm) format. The default value is `USD` and all values allowed from the Pay Connector are accepted. + * @return $this Fluent Builder + */ + public function setCurrency(string $currency): self + { + $this->options['currency'] = $currency; + return $this; + } + + /** + * The description can be used to provide more details regarding the transaction. This information is submitted along with the payment details to the Payment Connector which are then posted on the transactions. + * + * @param string $description The description can be used to provide more details regarding the transaction. This information is submitted along with the payment details to the Payment Connector which are then posted on the transactions. + * @return $this Fluent Builder + */ + public function setDescription(string $description): self + { + $this->options['description'] = $description; + return $this; + } + + /** + * A list of inputs that should be accepted. Currently only `dtmf` is supported. All digits captured during a pay session are redacted from the logs. + * + * @param string $input A list of inputs that should be accepted. Currently only `dtmf` is supported. All digits captured during a pay session are redacted from the logs. + * @return $this Fluent Builder + */ + public function setInput(string $input): self + { + $this->options['input'] = $input; + return $this; + } + + /** + * A positive integer that is used to validate the length of the `PostalCode` inputted by the user. User must enter this many digits. + * + * @param int $minPostalCodeLength A positive integer that is used to validate the length of the `PostalCode` inputted by the user. User must enter this many digits. + * @return $this Fluent Builder + */ + public function setMinPostalCodeLength(int $minPostalCodeLength): self + { + $this->options['minPostalCodeLength'] = $minPostalCodeLength; + return $this; + } + + /** + * A single-level JSON object used to pass custom parameters to payment processors. (Required for ACH payments). The information that has to be included here depends on the Connector. [Read more](https://www.twilio.com/console/voice/pay-connectors). + * + * @param array $parameter A single-level JSON object used to pass custom parameters to payment processors. (Required for ACH payments). The information that has to be included here depends on the Connector. [Read more](https://www.twilio.com/console/voice/pay-connectors). + * @return $this Fluent Builder + */ + public function setParameter(array $parameter): self + { + $this->options['parameter'] = $parameter; + return $this; + } + + /** + * This is the unique name corresponding to the Pay Connector installed in the Twilio Add-ons. Learn more about [ Connectors](https://www.twilio.com/console/voice/pay-connectors). The default value is `Default`. + * + * @param string $paymentConnector This is the unique name corresponding to the Pay Connector installed in the Twilio Add-ons. Learn more about [ Connectors](https://www.twilio.com/console/voice/pay-connectors). The default value is `Default`. + * @return $this Fluent Builder + */ + public function setPaymentConnector(string $paymentConnector): self + { + $this->options['paymentConnector'] = $paymentConnector; + return $this; + } + + /** + * @param string $paymentMethod + * @return $this Fluent Builder + */ + public function setPaymentMethod(string $paymentMethod): self + { + $this->options['paymentMethod'] = $paymentMethod; + return $this; + } + + /** + * Indicates whether the credit card postal code (zip code) is a required piece of payment information that must be provided by the caller. The default is `true`. + * + * @param bool $postalCode Indicates whether the credit card postal code (zip code) is a required piece of payment information that must be provided by the caller. The default is `true`. + * @return $this Fluent Builder + */ + public function setPostalCode(bool $postalCode): self + { + $this->options['postalCode'] = $postalCode; + return $this; + } + + /** + * Indicates whether the credit card security code is a required piece of payment information that must be provided by the caller. The default is `true`. + * + * @param bool $securityCode Indicates whether the credit card security code is a required piece of payment information that must be provided by the caller. The default is `true`. + * @return $this Fluent Builder + */ + public function setSecurityCode(bool $securityCode): self + { + $this->options['securityCode'] = $securityCode; + return $this; + } + + /** + * The number of seconds that should wait for the caller to press a digit between each subsequent digit, after the first one, before moving on to validate the digits captured. The default is `5`, maximum is `600`. + * + * @param int $timeout The number of seconds that should wait for the caller to press a digit between each subsequent digit, after the first one, before moving on to validate the digits captured. The default is `5`, maximum is `600`. + * @return $this Fluent Builder + */ + public function setTimeout(int $timeout): self + { + $this->options['timeout'] = $timeout; + return $this; + } + + /** + * @param string $tokenType + * @return $this Fluent Builder + */ + public function setTokenType(string $tokenType): self + { + $this->options['tokenType'] = $tokenType; + return $this; + } + + /** + * Credit card types separated by space that Pay should accept. The default value is `visa mastercard amex` + * + * @param string $validCardTypes Credit card types separated by space that Pay should accept. The default value is `visa mastercard amex` + * @return $this Fluent Builder + */ + public function setValidCardTypes(string $validCardTypes): self + { + $this->options['validCardTypes'] = $validCardTypes; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreatePaymentOptions ' . $options . ']'; + } +} + +class UpdatePaymentOptions extends Options + { + /** + * @param string $capture + * @param string $status + */ + public function __construct( + + string $capture = Values::NONE, + string $status = Values::NONE + + ) { + $this->options['capture'] = $capture; + $this->options['status'] = $status; + } + + /** + * @param string $capture + * @return $this Fluent Builder + */ + public function setCapture(string $capture): self + { + $this->options['capture'] = $capture; + return $this; + } + + /** + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdatePaymentOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/PaymentPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/PaymentPage.php new file mode 100755 index 0000000..425c31e --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/PaymentPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PaymentInstance \Twilio\Rest\Api\V2010\Account\Call\PaymentInstance + */ + public function buildInstance(array $payload): PaymentInstance + { + return new PaymentInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['callSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.PaymentPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/RecordingContext.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/RecordingContext.php new file mode 100755 index 0000000..0ed334e --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/RecordingContext.php @@ -0,0 +1,140 @@ +solution = [ + 'accountSid' => + $accountSid, + 'callSid' => + $callSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Calls/' . \rawurlencode($callSid) + .'/Recordings/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the RecordingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the RecordingInstance + * + * @return RecordingInstance Fetched RecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RecordingInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new RecordingInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['callSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the RecordingInstance + * + * @param string $status + * @param array|Options $options Optional Arguments + * @return RecordingInstance Updated RecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status, array $options = []): RecordingInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Status' => + $status, + 'PauseBehavior' => + $options['pauseBehavior'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new RecordingInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['callSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.RecordingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/RecordingInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/RecordingInstance.php new file mode 100755 index 0000000..deb2b6a --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/RecordingInstance.php @@ -0,0 +1,181 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'callSid' => Values::array_get($payload, 'call_sid'), + 'conferenceSid' => Values::array_get($payload, 'conference_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), + 'duration' => Values::array_get($payload, 'duration'), + 'sid' => Values::array_get($payload, 'sid'), + 'price' => Values::array_get($payload, 'price'), + 'uri' => Values::array_get($payload, 'uri'), + 'encryptionDetails' => Values::array_get($payload, 'encryption_details'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'status' => Values::array_get($payload, 'status'), + 'channels' => Values::array_get($payload, 'channels'), + 'source' => Values::array_get($payload, 'source'), + 'errorCode' => Values::array_get($payload, 'error_code'), + 'track' => Values::array_get($payload, 'track'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return RecordingContext Context for this RecordingInstance + */ + protected function proxy(): RecordingContext + { + if (!$this->context) { + $this->context = new RecordingContext( + $this->version, + $this->solution['accountSid'], + $this->solution['callSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the RecordingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the RecordingInstance + * + * @return RecordingInstance Fetched RecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RecordingInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the RecordingInstance + * + * @param string $status + * @param array|Options $options Optional Arguments + * @return RecordingInstance Updated RecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status, array $options = []): RecordingInstance + { + + return $this->proxy()->update($status, $options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.RecordingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/RecordingList.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/RecordingList.php new file mode 100755 index 0000000..5343b99 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/RecordingList.php @@ -0,0 +1,226 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'callSid' => + $callSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Calls/' . \rawurlencode($callSid) + .'/Recordings.json'; + } + + /** + * Create the RecordingInstance + * + * @param array|Options $options Optional Arguments + * @return RecordingInstance Created RecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): RecordingInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'RecordingStatusCallbackEvent' => + Serialize::map($options['recordingStatusCallbackEvent'], function ($e) { return $e; }), + 'RecordingStatusCallback' => + $options['recordingStatusCallback'], + 'RecordingStatusCallbackMethod' => + $options['recordingStatusCallbackMethod'], + 'Trim' => + $options['trim'], + 'RecordingChannels' => + $options['recordingChannels'], + 'RecordingTrack' => + $options['recordingTrack'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new RecordingInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['callSid'] + ); + } + + + /** + * Reads RecordingInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return RecordingInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams RecordingInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of RecordingInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return RecordingPage Page of RecordingInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): RecordingPage + { + $options = new Values($options); + + $params = Values::of([ + 'DateCreated<' => + Serialize::iso8601Date($options['dateCreatedBefore']), + 'DateCreated' => + Serialize::iso8601Date($options['dateCreated']), + 'DateCreated>' => + Serialize::iso8601Date($options['dateCreatedAfter']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new RecordingPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of RecordingInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return RecordingPage Page of RecordingInstance + */ + public function getPage(string $targetUrl): RecordingPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new RecordingPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a RecordingContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Recording resource to delete. + */ + public function getContext( + string $sid + + ): RecordingContext + { + return new RecordingContext( + $this->version, + $this->solution['accountSid'], + $this->solution['callSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.RecordingList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/RecordingOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/RecordingOptions.php new file mode 100755 index 0000000..8d79840 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/RecordingOptions.php @@ -0,0 +1,310 @@ +=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * @param string $dateCreated The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * @param string $dateCreatedAfter The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * @return ReadRecordingOptions Options builder + */ + public static function read( + + string $dateCreatedBefore = null, + string $dateCreated = null, + string $dateCreatedAfter = null + + ): ReadRecordingOptions + { + return new ReadRecordingOptions( + $dateCreatedBefore, + $dateCreated, + $dateCreatedAfter + ); + } + + /** + * @param string $pauseBehavior Whether to record during a pause. Can be: `skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`. + * @return UpdateRecordingOptions Options builder + */ + public static function update( + + string $pauseBehavior = Values::NONE + + ): UpdateRecordingOptions + { + return new UpdateRecordingOptions( + $pauseBehavior + ); + } + +} + +class CreateRecordingOptions extends Options + { + /** + * @param string[] $recordingStatusCallbackEvent The recording status events on which we should call the `recording_status_callback` URL. Can be: `in-progress`, `completed` and `absent` and the default is `completed`. Separate multiple event values with a space. + * @param string $recordingStatusCallback The URL we should call using the `recording_status_callback_method` on each recording event specified in `recording_status_callback_event`. For more information, see [RecordingStatusCallback parameters](https://www.twilio.com/docs/voice/api/recording#recordingstatuscallback). + * @param string $recordingStatusCallbackMethod The HTTP method we should use to call `recording_status_callback`. Can be: `GET` or `POST` and the default is `POST`. + * @param string $trim Whether to trim any leading and trailing silence in the recording. Can be: `trim-silence` or `do-not-trim` and the default is `do-not-trim`. `trim-silence` trims the silence from the beginning and end of the recording and `do-not-trim` does not. + * @param string $recordingChannels The number of channels used in the recording. Can be: `mono` or `dual` and the default is `mono`. `mono` records all parties of the call into one channel. `dual` records each party of a 2-party call into separate channels. + * @param string $recordingTrack The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is generated from Twilio. `both` records the audio that is received and generated by Twilio. + */ + public function __construct( + + array $recordingStatusCallbackEvent = Values::ARRAY_NONE, + string $recordingStatusCallback = Values::NONE, + string $recordingStatusCallbackMethod = Values::NONE, + string $trim = Values::NONE, + string $recordingChannels = Values::NONE, + string $recordingTrack = Values::NONE + + ) { + $this->options['recordingStatusCallbackEvent'] = $recordingStatusCallbackEvent; + $this->options['recordingStatusCallback'] = $recordingStatusCallback; + $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; + $this->options['trim'] = $trim; + $this->options['recordingChannels'] = $recordingChannels; + $this->options['recordingTrack'] = $recordingTrack; + } + + /** + * The recording status events on which we should call the `recording_status_callback` URL. Can be: `in-progress`, `completed` and `absent` and the default is `completed`. Separate multiple event values with a space. + * + * @param string[] $recordingStatusCallbackEvent The recording status events on which we should call the `recording_status_callback` URL. Can be: `in-progress`, `completed` and `absent` and the default is `completed`. Separate multiple event values with a space. + * @return $this Fluent Builder + */ + public function setRecordingStatusCallbackEvent(array $recordingStatusCallbackEvent): self + { + $this->options['recordingStatusCallbackEvent'] = $recordingStatusCallbackEvent; + return $this; + } + + /** + * The URL we should call using the `recording_status_callback_method` on each recording event specified in `recording_status_callback_event`. For more information, see [RecordingStatusCallback parameters](https://www.twilio.com/docs/voice/api/recording#recordingstatuscallback). + * + * @param string $recordingStatusCallback The URL we should call using the `recording_status_callback_method` on each recording event specified in `recording_status_callback_event`. For more information, see [RecordingStatusCallback parameters](https://www.twilio.com/docs/voice/api/recording#recordingstatuscallback). + * @return $this Fluent Builder + */ + public function setRecordingStatusCallback(string $recordingStatusCallback): self + { + $this->options['recordingStatusCallback'] = $recordingStatusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `recording_status_callback`. Can be: `GET` or `POST` and the default is `POST`. + * + * @param string $recordingStatusCallbackMethod The HTTP method we should use to call `recording_status_callback`. Can be: `GET` or `POST` and the default is `POST`. + * @return $this Fluent Builder + */ + public function setRecordingStatusCallbackMethod(string $recordingStatusCallbackMethod): self + { + $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; + return $this; + } + + /** + * Whether to trim any leading and trailing silence in the recording. Can be: `trim-silence` or `do-not-trim` and the default is `do-not-trim`. `trim-silence` trims the silence from the beginning and end of the recording and `do-not-trim` does not. + * + * @param string $trim Whether to trim any leading and trailing silence in the recording. Can be: `trim-silence` or `do-not-trim` and the default is `do-not-trim`. `trim-silence` trims the silence from the beginning and end of the recording and `do-not-trim` does not. + * @return $this Fluent Builder + */ + public function setTrim(string $trim): self + { + $this->options['trim'] = $trim; + return $this; + } + + /** + * The number of channels used in the recording. Can be: `mono` or `dual` and the default is `mono`. `mono` records all parties of the call into one channel. `dual` records each party of a 2-party call into separate channels. + * + * @param string $recordingChannels The number of channels used in the recording. Can be: `mono` or `dual` and the default is `mono`. `mono` records all parties of the call into one channel. `dual` records each party of a 2-party call into separate channels. + * @return $this Fluent Builder + */ + public function setRecordingChannels(string $recordingChannels): self + { + $this->options['recordingChannels'] = $recordingChannels; + return $this; + } + + /** + * The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is generated from Twilio. `both` records the audio that is received and generated by Twilio. + * + * @param string $recordingTrack The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is generated from Twilio. `both` records the audio that is received and generated by Twilio. + * @return $this Fluent Builder + */ + public function setRecordingTrack(string $recordingTrack): self + { + $this->options['recordingTrack'] = $recordingTrack; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateRecordingOptions ' . $options . ']'; + } +} + + + +class ReadRecordingOptions extends Options + { + /** + * @param string $dateCreatedBefore The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * @param string $dateCreated The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * @param string $dateCreatedAfter The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + */ + public function __construct( + + string $dateCreatedBefore = null, + string $dateCreated = null, + string $dateCreatedAfter = null + + ) { + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + } + + /** + * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * + * @param string $dateCreatedBefore The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * @return $this Fluent Builder + */ + public function setDateCreatedBefore(string $dateCreatedBefore): self + { + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + return $this; + } + + /** + * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * + * @param string $dateCreated The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * @return $this Fluent Builder + */ + public function setDateCreated(string $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * + * @param string $dateCreatedAfter The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * @return $this Fluent Builder + */ + public function setDateCreatedAfter(string $dateCreatedAfter): self + { + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadRecordingOptions ' . $options . ']'; + } +} + +class UpdateRecordingOptions extends Options + { + /** + * @param string $pauseBehavior Whether to record during a pause. Can be: `skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`. + */ + public function __construct( + + string $pauseBehavior = Values::NONE + + ) { + $this->options['pauseBehavior'] = $pauseBehavior; + } + + /** + * Whether to record during a pause. Can be: `skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`. + * + * @param string $pauseBehavior Whether to record during a pause. Can be: `skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`. + * @return $this Fluent Builder + */ + public function setPauseBehavior(string $pauseBehavior): self + { + $this->options['pauseBehavior'] = $pauseBehavior; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateRecordingOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/RecordingPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/RecordingPage.php new file mode 100755 index 0000000..b5d64ba --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/RecordingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RecordingInstance \Twilio\Rest\Api\V2010\Account\Call\RecordingInstance + */ + public function buildInstance(array $payload): RecordingInstance + { + return new RecordingInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['callSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.RecordingPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/SiprecContext.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/SiprecContext.php new file mode 100755 index 0000000..8959b1c --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/SiprecContext.php @@ -0,0 +1,100 @@ +solution = [ + 'accountSid' => + $accountSid, + 'callSid' => + $callSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Calls/' . \rawurlencode($callSid) + .'/Siprec/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Update the SiprecInstance + * + * @param string $status + * @return SiprecInstance Updated SiprecInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status): SiprecInstance + { + + $data = Values::of([ + 'Status' => + $status, + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new SiprecInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['callSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.SiprecContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/SiprecInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/SiprecInstance.php new file mode 100755 index 0000000..d3f132f --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/SiprecInstance.php @@ -0,0 +1,133 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'callSid' => Values::array_get($payload, 'call_sid'), + 'name' => Values::array_get($payload, 'name'), + 'status' => Values::array_get($payload, 'status'), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'uri' => Values::array_get($payload, 'uri'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SiprecContext Context for this SiprecInstance + */ + protected function proxy(): SiprecContext + { + if (!$this->context) { + $this->context = new SiprecContext( + $this->version, + $this->solution['accountSid'], + $this->solution['callSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Update the SiprecInstance + * + * @param string $status + * @return SiprecInstance Updated SiprecInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status): SiprecInstance + { + + return $this->proxy()->update($status); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.SiprecInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/SiprecList.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/SiprecList.php new file mode 100755 index 0000000..ff001b7 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/SiprecList.php @@ -0,0 +1,516 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'callSid' => + $callSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Calls/' . \rawurlencode($callSid) + .'/Siprec.json'; + } + + /** + * Create the SiprecInstance + * + * @param array|Options $options Optional Arguments + * @return SiprecInstance Created SiprecInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): SiprecInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Name' => + $options['name'], + 'ConnectorName' => + $options['connectorName'], + 'Track' => + $options['track'], + 'StatusCallback' => + $options['statusCallback'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'Parameter1.Name' => + $options['parameter1Name'], + 'Parameter1.Value' => + $options['parameter1Value'], + 'Parameter2.Name' => + $options['parameter2Name'], + 'Parameter2.Value' => + $options['parameter2Value'], + 'Parameter3.Name' => + $options['parameter3Name'], + 'Parameter3.Value' => + $options['parameter3Value'], + 'Parameter4.Name' => + $options['parameter4Name'], + 'Parameter4.Value' => + $options['parameter4Value'], + 'Parameter5.Name' => + $options['parameter5Name'], + 'Parameter5.Value' => + $options['parameter5Value'], + 'Parameter6.Name' => + $options['parameter6Name'], + 'Parameter6.Value' => + $options['parameter6Value'], + 'Parameter7.Name' => + $options['parameter7Name'], + 'Parameter7.Value' => + $options['parameter7Value'], + 'Parameter8.Name' => + $options['parameter8Name'], + 'Parameter8.Value' => + $options['parameter8Value'], + 'Parameter9.Name' => + $options['parameter9Name'], + 'Parameter9.Value' => + $options['parameter9Value'], + 'Parameter10.Name' => + $options['parameter10Name'], + 'Parameter10.Value' => + $options['parameter10Value'], + 'Parameter11.Name' => + $options['parameter11Name'], + 'Parameter11.Value' => + $options['parameter11Value'], + 'Parameter12.Name' => + $options['parameter12Name'], + 'Parameter12.Value' => + $options['parameter12Value'], + 'Parameter13.Name' => + $options['parameter13Name'], + 'Parameter13.Value' => + $options['parameter13Value'], + 'Parameter14.Name' => + $options['parameter14Name'], + 'Parameter14.Value' => + $options['parameter14Value'], + 'Parameter15.Name' => + $options['parameter15Name'], + 'Parameter15.Value' => + $options['parameter15Value'], + 'Parameter16.Name' => + $options['parameter16Name'], + 'Parameter16.Value' => + $options['parameter16Value'], + 'Parameter17.Name' => + $options['parameter17Name'], + 'Parameter17.Value' => + $options['parameter17Value'], + 'Parameter18.Name' => + $options['parameter18Name'], + 'Parameter18.Value' => + $options['parameter18Value'], + 'Parameter19.Name' => + $options['parameter19Name'], + 'Parameter19.Value' => + $options['parameter19Value'], + 'Parameter20.Name' => + $options['parameter20Name'], + 'Parameter20.Value' => + $options['parameter20Value'], + 'Parameter21.Name' => + $options['parameter21Name'], + 'Parameter21.Value' => + $options['parameter21Value'], + 'Parameter22.Name' => + $options['parameter22Name'], + 'Parameter22.Value' => + $options['parameter22Value'], + 'Parameter23.Name' => + $options['parameter23Name'], + 'Parameter23.Value' => + $options['parameter23Value'], + 'Parameter24.Name' => + $options['parameter24Name'], + 'Parameter24.Value' => + $options['parameter24Value'], + 'Parameter25.Name' => + $options['parameter25Name'], + 'Parameter25.Value' => + $options['parameter25Value'], + 'Parameter26.Name' => + $options['parameter26Name'], + 'Parameter26.Value' => + $options['parameter26Value'], + 'Parameter27.Name' => + $options['parameter27Name'], + 'Parameter27.Value' => + $options['parameter27Value'], + 'Parameter28.Name' => + $options['parameter28Name'], + 'Parameter28.Value' => + $options['parameter28Value'], + 'Parameter29.Name' => + $options['parameter29Name'], + 'Parameter29.Value' => + $options['parameter29Value'], + 'Parameter30.Name' => + $options['parameter30Name'], + 'Parameter30.Value' => + $options['parameter30Value'], + 'Parameter31.Name' => + $options['parameter31Name'], + 'Parameter31.Value' => + $options['parameter31Value'], + 'Parameter32.Name' => + $options['parameter32Name'], + 'Parameter32.Value' => + $options['parameter32Value'], + 'Parameter33.Name' => + $options['parameter33Name'], + 'Parameter33.Value' => + $options['parameter33Value'], + 'Parameter34.Name' => + $options['parameter34Name'], + 'Parameter34.Value' => + $options['parameter34Value'], + 'Parameter35.Name' => + $options['parameter35Name'], + 'Parameter35.Value' => + $options['parameter35Value'], + 'Parameter36.Name' => + $options['parameter36Name'], + 'Parameter36.Value' => + $options['parameter36Value'], + 'Parameter37.Name' => + $options['parameter37Name'], + 'Parameter37.Value' => + $options['parameter37Value'], + 'Parameter38.Name' => + $options['parameter38Name'], + 'Parameter38.Value' => + $options['parameter38Value'], + 'Parameter39.Name' => + $options['parameter39Name'], + 'Parameter39.Value' => + $options['parameter39Value'], + 'Parameter40.Name' => + $options['parameter40Name'], + 'Parameter40.Value' => + $options['parameter40Value'], + 'Parameter41.Name' => + $options['parameter41Name'], + 'Parameter41.Value' => + $options['parameter41Value'], + 'Parameter42.Name' => + $options['parameter42Name'], + 'Parameter42.Value' => + $options['parameter42Value'], + 'Parameter43.Name' => + $options['parameter43Name'], + 'Parameter43.Value' => + $options['parameter43Value'], + 'Parameter44.Name' => + $options['parameter44Name'], + 'Parameter44.Value' => + $options['parameter44Value'], + 'Parameter45.Name' => + $options['parameter45Name'], + 'Parameter45.Value' => + $options['parameter45Value'], + 'Parameter46.Name' => + $options['parameter46Name'], + 'Parameter46.Value' => + $options['parameter46Value'], + 'Parameter47.Name' => + $options['parameter47Name'], + 'Parameter47.Value' => + $options['parameter47Value'], + 'Parameter48.Name' => + $options['parameter48Name'], + 'Parameter48.Value' => + $options['parameter48Value'], + 'Parameter49.Name' => + $options['parameter49Name'], + 'Parameter49.Value' => + $options['parameter49Value'], + 'Parameter50.Name' => + $options['parameter50Name'], + 'Parameter50.Value' => + $options['parameter50Value'], + 'Parameter51.Name' => + $options['parameter51Name'], + 'Parameter51.Value' => + $options['parameter51Value'], + 'Parameter52.Name' => + $options['parameter52Name'], + 'Parameter52.Value' => + $options['parameter52Value'], + 'Parameter53.Name' => + $options['parameter53Name'], + 'Parameter53.Value' => + $options['parameter53Value'], + 'Parameter54.Name' => + $options['parameter54Name'], + 'Parameter54.Value' => + $options['parameter54Value'], + 'Parameter55.Name' => + $options['parameter55Name'], + 'Parameter55.Value' => + $options['parameter55Value'], + 'Parameter56.Name' => + $options['parameter56Name'], + 'Parameter56.Value' => + $options['parameter56Value'], + 'Parameter57.Name' => + $options['parameter57Name'], + 'Parameter57.Value' => + $options['parameter57Value'], + 'Parameter58.Name' => + $options['parameter58Name'], + 'Parameter58.Value' => + $options['parameter58Value'], + 'Parameter59.Name' => + $options['parameter59Name'], + 'Parameter59.Value' => + $options['parameter59Value'], + 'Parameter60.Name' => + $options['parameter60Name'], + 'Parameter60.Value' => + $options['parameter60Value'], + 'Parameter61.Name' => + $options['parameter61Name'], + 'Parameter61.Value' => + $options['parameter61Value'], + 'Parameter62.Name' => + $options['parameter62Name'], + 'Parameter62.Value' => + $options['parameter62Value'], + 'Parameter63.Name' => + $options['parameter63Name'], + 'Parameter63.Value' => + $options['parameter63Value'], + 'Parameter64.Name' => + $options['parameter64Name'], + 'Parameter64.Value' => + $options['parameter64Value'], + 'Parameter65.Name' => + $options['parameter65Name'], + 'Parameter65.Value' => + $options['parameter65Value'], + 'Parameter66.Name' => + $options['parameter66Name'], + 'Parameter66.Value' => + $options['parameter66Value'], + 'Parameter67.Name' => + $options['parameter67Name'], + 'Parameter67.Value' => + $options['parameter67Value'], + 'Parameter68.Name' => + $options['parameter68Name'], + 'Parameter68.Value' => + $options['parameter68Value'], + 'Parameter69.Name' => + $options['parameter69Name'], + 'Parameter69.Value' => + $options['parameter69Value'], + 'Parameter70.Name' => + $options['parameter70Name'], + 'Parameter70.Value' => + $options['parameter70Value'], + 'Parameter71.Name' => + $options['parameter71Name'], + 'Parameter71.Value' => + $options['parameter71Value'], + 'Parameter72.Name' => + $options['parameter72Name'], + 'Parameter72.Value' => + $options['parameter72Value'], + 'Parameter73.Name' => + $options['parameter73Name'], + 'Parameter73.Value' => + $options['parameter73Value'], + 'Parameter74.Name' => + $options['parameter74Name'], + 'Parameter74.Value' => + $options['parameter74Value'], + 'Parameter75.Name' => + $options['parameter75Name'], + 'Parameter75.Value' => + $options['parameter75Value'], + 'Parameter76.Name' => + $options['parameter76Name'], + 'Parameter76.Value' => + $options['parameter76Value'], + 'Parameter77.Name' => + $options['parameter77Name'], + 'Parameter77.Value' => + $options['parameter77Value'], + 'Parameter78.Name' => + $options['parameter78Name'], + 'Parameter78.Value' => + $options['parameter78Value'], + 'Parameter79.Name' => + $options['parameter79Name'], + 'Parameter79.Value' => + $options['parameter79Value'], + 'Parameter80.Name' => + $options['parameter80Name'], + 'Parameter80.Value' => + $options['parameter80Value'], + 'Parameter81.Name' => + $options['parameter81Name'], + 'Parameter81.Value' => + $options['parameter81Value'], + 'Parameter82.Name' => + $options['parameter82Name'], + 'Parameter82.Value' => + $options['parameter82Value'], + 'Parameter83.Name' => + $options['parameter83Name'], + 'Parameter83.Value' => + $options['parameter83Value'], + 'Parameter84.Name' => + $options['parameter84Name'], + 'Parameter84.Value' => + $options['parameter84Value'], + 'Parameter85.Name' => + $options['parameter85Name'], + 'Parameter85.Value' => + $options['parameter85Value'], + 'Parameter86.Name' => + $options['parameter86Name'], + 'Parameter86.Value' => + $options['parameter86Value'], + 'Parameter87.Name' => + $options['parameter87Name'], + 'Parameter87.Value' => + $options['parameter87Value'], + 'Parameter88.Name' => + $options['parameter88Name'], + 'Parameter88.Value' => + $options['parameter88Value'], + 'Parameter89.Name' => + $options['parameter89Name'], + 'Parameter89.Value' => + $options['parameter89Value'], + 'Parameter90.Name' => + $options['parameter90Name'], + 'Parameter90.Value' => + $options['parameter90Value'], + 'Parameter91.Name' => + $options['parameter91Name'], + 'Parameter91.Value' => + $options['parameter91Value'], + 'Parameter92.Name' => + $options['parameter92Name'], + 'Parameter92.Value' => + $options['parameter92Value'], + 'Parameter93.Name' => + $options['parameter93Name'], + 'Parameter93.Value' => + $options['parameter93Value'], + 'Parameter94.Name' => + $options['parameter94Name'], + 'Parameter94.Value' => + $options['parameter94Value'], + 'Parameter95.Name' => + $options['parameter95Name'], + 'Parameter95.Value' => + $options['parameter95Value'], + 'Parameter96.Name' => + $options['parameter96Name'], + 'Parameter96.Value' => + $options['parameter96Value'], + 'Parameter97.Name' => + $options['parameter97Name'], + 'Parameter97.Value' => + $options['parameter97Value'], + 'Parameter98.Name' => + $options['parameter98Name'], + 'Parameter98.Value' => + $options['parameter98Value'], + 'Parameter99.Name' => + $options['parameter99Name'], + 'Parameter99.Value' => + $options['parameter99Value'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new SiprecInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['callSid'] + ); + } + + + /** + * Constructs a SiprecContext + * + * @param string $sid The SID of the Siprec resource, or the `name` used when creating the resource + */ + public function getContext( + string $sid + + ): SiprecContext + { + return new SiprecContext( + $this->version, + $this->solution['accountSid'], + $this->solution['callSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.SiprecList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/SiprecOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/SiprecOptions.php new file mode 100755 index 0000000..0a8b1ab --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/SiprecOptions.php @@ -0,0 +1,3712 @@ +options['name'] = $name; + $this->options['connectorName'] = $connectorName; + $this->options['track'] = $track; + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['parameter1Name'] = $parameter1Name; + $this->options['parameter1Value'] = $parameter1Value; + $this->options['parameter2Name'] = $parameter2Name; + $this->options['parameter2Value'] = $parameter2Value; + $this->options['parameter3Name'] = $parameter3Name; + $this->options['parameter3Value'] = $parameter3Value; + $this->options['parameter4Name'] = $parameter4Name; + $this->options['parameter4Value'] = $parameter4Value; + $this->options['parameter5Name'] = $parameter5Name; + $this->options['parameter5Value'] = $parameter5Value; + $this->options['parameter6Name'] = $parameter6Name; + $this->options['parameter6Value'] = $parameter6Value; + $this->options['parameter7Name'] = $parameter7Name; + $this->options['parameter7Value'] = $parameter7Value; + $this->options['parameter8Name'] = $parameter8Name; + $this->options['parameter8Value'] = $parameter8Value; + $this->options['parameter9Name'] = $parameter9Name; + $this->options['parameter9Value'] = $parameter9Value; + $this->options['parameter10Name'] = $parameter10Name; + $this->options['parameter10Value'] = $parameter10Value; + $this->options['parameter11Name'] = $parameter11Name; + $this->options['parameter11Value'] = $parameter11Value; + $this->options['parameter12Name'] = $parameter12Name; + $this->options['parameter12Value'] = $parameter12Value; + $this->options['parameter13Name'] = $parameter13Name; + $this->options['parameter13Value'] = $parameter13Value; + $this->options['parameter14Name'] = $parameter14Name; + $this->options['parameter14Value'] = $parameter14Value; + $this->options['parameter15Name'] = $parameter15Name; + $this->options['parameter15Value'] = $parameter15Value; + $this->options['parameter16Name'] = $parameter16Name; + $this->options['parameter16Value'] = $parameter16Value; + $this->options['parameter17Name'] = $parameter17Name; + $this->options['parameter17Value'] = $parameter17Value; + $this->options['parameter18Name'] = $parameter18Name; + $this->options['parameter18Value'] = $parameter18Value; + $this->options['parameter19Name'] = $parameter19Name; + $this->options['parameter19Value'] = $parameter19Value; + $this->options['parameter20Name'] = $parameter20Name; + $this->options['parameter20Value'] = $parameter20Value; + $this->options['parameter21Name'] = $parameter21Name; + $this->options['parameter21Value'] = $parameter21Value; + $this->options['parameter22Name'] = $parameter22Name; + $this->options['parameter22Value'] = $parameter22Value; + $this->options['parameter23Name'] = $parameter23Name; + $this->options['parameter23Value'] = $parameter23Value; + $this->options['parameter24Name'] = $parameter24Name; + $this->options['parameter24Value'] = $parameter24Value; + $this->options['parameter25Name'] = $parameter25Name; + $this->options['parameter25Value'] = $parameter25Value; + $this->options['parameter26Name'] = $parameter26Name; + $this->options['parameter26Value'] = $parameter26Value; + $this->options['parameter27Name'] = $parameter27Name; + $this->options['parameter27Value'] = $parameter27Value; + $this->options['parameter28Name'] = $parameter28Name; + $this->options['parameter28Value'] = $parameter28Value; + $this->options['parameter29Name'] = $parameter29Name; + $this->options['parameter29Value'] = $parameter29Value; + $this->options['parameter30Name'] = $parameter30Name; + $this->options['parameter30Value'] = $parameter30Value; + $this->options['parameter31Name'] = $parameter31Name; + $this->options['parameter31Value'] = $parameter31Value; + $this->options['parameter32Name'] = $parameter32Name; + $this->options['parameter32Value'] = $parameter32Value; + $this->options['parameter33Name'] = $parameter33Name; + $this->options['parameter33Value'] = $parameter33Value; + $this->options['parameter34Name'] = $parameter34Name; + $this->options['parameter34Value'] = $parameter34Value; + $this->options['parameter35Name'] = $parameter35Name; + $this->options['parameter35Value'] = $parameter35Value; + $this->options['parameter36Name'] = $parameter36Name; + $this->options['parameter36Value'] = $parameter36Value; + $this->options['parameter37Name'] = $parameter37Name; + $this->options['parameter37Value'] = $parameter37Value; + $this->options['parameter38Name'] = $parameter38Name; + $this->options['parameter38Value'] = $parameter38Value; + $this->options['parameter39Name'] = $parameter39Name; + $this->options['parameter39Value'] = $parameter39Value; + $this->options['parameter40Name'] = $parameter40Name; + $this->options['parameter40Value'] = $parameter40Value; + $this->options['parameter41Name'] = $parameter41Name; + $this->options['parameter41Value'] = $parameter41Value; + $this->options['parameter42Name'] = $parameter42Name; + $this->options['parameter42Value'] = $parameter42Value; + $this->options['parameter43Name'] = $parameter43Name; + $this->options['parameter43Value'] = $parameter43Value; + $this->options['parameter44Name'] = $parameter44Name; + $this->options['parameter44Value'] = $parameter44Value; + $this->options['parameter45Name'] = $parameter45Name; + $this->options['parameter45Value'] = $parameter45Value; + $this->options['parameter46Name'] = $parameter46Name; + $this->options['parameter46Value'] = $parameter46Value; + $this->options['parameter47Name'] = $parameter47Name; + $this->options['parameter47Value'] = $parameter47Value; + $this->options['parameter48Name'] = $parameter48Name; + $this->options['parameter48Value'] = $parameter48Value; + $this->options['parameter49Name'] = $parameter49Name; + $this->options['parameter49Value'] = $parameter49Value; + $this->options['parameter50Name'] = $parameter50Name; + $this->options['parameter50Value'] = $parameter50Value; + $this->options['parameter51Name'] = $parameter51Name; + $this->options['parameter51Value'] = $parameter51Value; + $this->options['parameter52Name'] = $parameter52Name; + $this->options['parameter52Value'] = $parameter52Value; + $this->options['parameter53Name'] = $parameter53Name; + $this->options['parameter53Value'] = $parameter53Value; + $this->options['parameter54Name'] = $parameter54Name; + $this->options['parameter54Value'] = $parameter54Value; + $this->options['parameter55Name'] = $parameter55Name; + $this->options['parameter55Value'] = $parameter55Value; + $this->options['parameter56Name'] = $parameter56Name; + $this->options['parameter56Value'] = $parameter56Value; + $this->options['parameter57Name'] = $parameter57Name; + $this->options['parameter57Value'] = $parameter57Value; + $this->options['parameter58Name'] = $parameter58Name; + $this->options['parameter58Value'] = $parameter58Value; + $this->options['parameter59Name'] = $parameter59Name; + $this->options['parameter59Value'] = $parameter59Value; + $this->options['parameter60Name'] = $parameter60Name; + $this->options['parameter60Value'] = $parameter60Value; + $this->options['parameter61Name'] = $parameter61Name; + $this->options['parameter61Value'] = $parameter61Value; + $this->options['parameter62Name'] = $parameter62Name; + $this->options['parameter62Value'] = $parameter62Value; + $this->options['parameter63Name'] = $parameter63Name; + $this->options['parameter63Value'] = $parameter63Value; + $this->options['parameter64Name'] = $parameter64Name; + $this->options['parameter64Value'] = $parameter64Value; + $this->options['parameter65Name'] = $parameter65Name; + $this->options['parameter65Value'] = $parameter65Value; + $this->options['parameter66Name'] = $parameter66Name; + $this->options['parameter66Value'] = $parameter66Value; + $this->options['parameter67Name'] = $parameter67Name; + $this->options['parameter67Value'] = $parameter67Value; + $this->options['parameter68Name'] = $parameter68Name; + $this->options['parameter68Value'] = $parameter68Value; + $this->options['parameter69Name'] = $parameter69Name; + $this->options['parameter69Value'] = $parameter69Value; + $this->options['parameter70Name'] = $parameter70Name; + $this->options['parameter70Value'] = $parameter70Value; + $this->options['parameter71Name'] = $parameter71Name; + $this->options['parameter71Value'] = $parameter71Value; + $this->options['parameter72Name'] = $parameter72Name; + $this->options['parameter72Value'] = $parameter72Value; + $this->options['parameter73Name'] = $parameter73Name; + $this->options['parameter73Value'] = $parameter73Value; + $this->options['parameter74Name'] = $parameter74Name; + $this->options['parameter74Value'] = $parameter74Value; + $this->options['parameter75Name'] = $parameter75Name; + $this->options['parameter75Value'] = $parameter75Value; + $this->options['parameter76Name'] = $parameter76Name; + $this->options['parameter76Value'] = $parameter76Value; + $this->options['parameter77Name'] = $parameter77Name; + $this->options['parameter77Value'] = $parameter77Value; + $this->options['parameter78Name'] = $parameter78Name; + $this->options['parameter78Value'] = $parameter78Value; + $this->options['parameter79Name'] = $parameter79Name; + $this->options['parameter79Value'] = $parameter79Value; + $this->options['parameter80Name'] = $parameter80Name; + $this->options['parameter80Value'] = $parameter80Value; + $this->options['parameter81Name'] = $parameter81Name; + $this->options['parameter81Value'] = $parameter81Value; + $this->options['parameter82Name'] = $parameter82Name; + $this->options['parameter82Value'] = $parameter82Value; + $this->options['parameter83Name'] = $parameter83Name; + $this->options['parameter83Value'] = $parameter83Value; + $this->options['parameter84Name'] = $parameter84Name; + $this->options['parameter84Value'] = $parameter84Value; + $this->options['parameter85Name'] = $parameter85Name; + $this->options['parameter85Value'] = $parameter85Value; + $this->options['parameter86Name'] = $parameter86Name; + $this->options['parameter86Value'] = $parameter86Value; + $this->options['parameter87Name'] = $parameter87Name; + $this->options['parameter87Value'] = $parameter87Value; + $this->options['parameter88Name'] = $parameter88Name; + $this->options['parameter88Value'] = $parameter88Value; + $this->options['parameter89Name'] = $parameter89Name; + $this->options['parameter89Value'] = $parameter89Value; + $this->options['parameter90Name'] = $parameter90Name; + $this->options['parameter90Value'] = $parameter90Value; + $this->options['parameter91Name'] = $parameter91Name; + $this->options['parameter91Value'] = $parameter91Value; + $this->options['parameter92Name'] = $parameter92Name; + $this->options['parameter92Value'] = $parameter92Value; + $this->options['parameter93Name'] = $parameter93Name; + $this->options['parameter93Value'] = $parameter93Value; + $this->options['parameter94Name'] = $parameter94Name; + $this->options['parameter94Value'] = $parameter94Value; + $this->options['parameter95Name'] = $parameter95Name; + $this->options['parameter95Value'] = $parameter95Value; + $this->options['parameter96Name'] = $parameter96Name; + $this->options['parameter96Value'] = $parameter96Value; + $this->options['parameter97Name'] = $parameter97Name; + $this->options['parameter97Value'] = $parameter97Value; + $this->options['parameter98Name'] = $parameter98Name; + $this->options['parameter98Value'] = $parameter98Value; + $this->options['parameter99Name'] = $parameter99Name; + $this->options['parameter99Value'] = $parameter99Value; + } + + /** + * The user-specified name of this Siprec, if one was given when the Siprec was created. This may be used to stop the Siprec. + * + * @param string $name The user-specified name of this Siprec, if one was given when the Siprec was created. This may be used to stop the Siprec. + * @return $this Fluent Builder + */ + public function setName(string $name): self + { + $this->options['name'] = $name; + return $this; + } + + /** + * Unique name used when configuring the connector via Marketplace Add-on. + * + * @param string $connectorName Unique name used when configuring the connector via Marketplace Add-on. + * @return $this Fluent Builder + */ + public function setConnectorName(string $connectorName): self + { + $this->options['connectorName'] = $connectorName; + return $this; + } + + /** + * @param string $track + * @return $this Fluent Builder + */ + public function setTrack(string $track): self + { + $this->options['track'] = $track; + return $this; + } + + /** + * Absolute URL of the status callback. + * + * @param string $statusCallback Absolute URL of the status callback. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The http method for the status_callback (one of GET, POST). + * + * @param string $statusCallbackMethod The http method for the status_callback (one of GET, POST). + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter1Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter1Name(string $parameter1Name): self + { + $this->options['parameter1Name'] = $parameter1Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter1Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter1Value(string $parameter1Value): self + { + $this->options['parameter1Value'] = $parameter1Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter2Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter2Name(string $parameter2Name): self + { + $this->options['parameter2Name'] = $parameter2Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter2Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter2Value(string $parameter2Value): self + { + $this->options['parameter2Value'] = $parameter2Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter3Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter3Name(string $parameter3Name): self + { + $this->options['parameter3Name'] = $parameter3Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter3Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter3Value(string $parameter3Value): self + { + $this->options['parameter3Value'] = $parameter3Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter4Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter4Name(string $parameter4Name): self + { + $this->options['parameter4Name'] = $parameter4Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter4Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter4Value(string $parameter4Value): self + { + $this->options['parameter4Value'] = $parameter4Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter5Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter5Name(string $parameter5Name): self + { + $this->options['parameter5Name'] = $parameter5Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter5Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter5Value(string $parameter5Value): self + { + $this->options['parameter5Value'] = $parameter5Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter6Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter6Name(string $parameter6Name): self + { + $this->options['parameter6Name'] = $parameter6Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter6Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter6Value(string $parameter6Value): self + { + $this->options['parameter6Value'] = $parameter6Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter7Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter7Name(string $parameter7Name): self + { + $this->options['parameter7Name'] = $parameter7Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter7Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter7Value(string $parameter7Value): self + { + $this->options['parameter7Value'] = $parameter7Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter8Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter8Name(string $parameter8Name): self + { + $this->options['parameter8Name'] = $parameter8Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter8Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter8Value(string $parameter8Value): self + { + $this->options['parameter8Value'] = $parameter8Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter9Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter9Name(string $parameter9Name): self + { + $this->options['parameter9Name'] = $parameter9Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter9Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter9Value(string $parameter9Value): self + { + $this->options['parameter9Value'] = $parameter9Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter10Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter10Name(string $parameter10Name): self + { + $this->options['parameter10Name'] = $parameter10Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter10Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter10Value(string $parameter10Value): self + { + $this->options['parameter10Value'] = $parameter10Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter11Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter11Name(string $parameter11Name): self + { + $this->options['parameter11Name'] = $parameter11Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter11Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter11Value(string $parameter11Value): self + { + $this->options['parameter11Value'] = $parameter11Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter12Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter12Name(string $parameter12Name): self + { + $this->options['parameter12Name'] = $parameter12Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter12Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter12Value(string $parameter12Value): self + { + $this->options['parameter12Value'] = $parameter12Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter13Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter13Name(string $parameter13Name): self + { + $this->options['parameter13Name'] = $parameter13Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter13Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter13Value(string $parameter13Value): self + { + $this->options['parameter13Value'] = $parameter13Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter14Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter14Name(string $parameter14Name): self + { + $this->options['parameter14Name'] = $parameter14Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter14Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter14Value(string $parameter14Value): self + { + $this->options['parameter14Value'] = $parameter14Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter15Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter15Name(string $parameter15Name): self + { + $this->options['parameter15Name'] = $parameter15Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter15Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter15Value(string $parameter15Value): self + { + $this->options['parameter15Value'] = $parameter15Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter16Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter16Name(string $parameter16Name): self + { + $this->options['parameter16Name'] = $parameter16Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter16Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter16Value(string $parameter16Value): self + { + $this->options['parameter16Value'] = $parameter16Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter17Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter17Name(string $parameter17Name): self + { + $this->options['parameter17Name'] = $parameter17Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter17Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter17Value(string $parameter17Value): self + { + $this->options['parameter17Value'] = $parameter17Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter18Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter18Name(string $parameter18Name): self + { + $this->options['parameter18Name'] = $parameter18Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter18Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter18Value(string $parameter18Value): self + { + $this->options['parameter18Value'] = $parameter18Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter19Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter19Name(string $parameter19Name): self + { + $this->options['parameter19Name'] = $parameter19Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter19Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter19Value(string $parameter19Value): self + { + $this->options['parameter19Value'] = $parameter19Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter20Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter20Name(string $parameter20Name): self + { + $this->options['parameter20Name'] = $parameter20Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter20Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter20Value(string $parameter20Value): self + { + $this->options['parameter20Value'] = $parameter20Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter21Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter21Name(string $parameter21Name): self + { + $this->options['parameter21Name'] = $parameter21Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter21Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter21Value(string $parameter21Value): self + { + $this->options['parameter21Value'] = $parameter21Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter22Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter22Name(string $parameter22Name): self + { + $this->options['parameter22Name'] = $parameter22Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter22Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter22Value(string $parameter22Value): self + { + $this->options['parameter22Value'] = $parameter22Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter23Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter23Name(string $parameter23Name): self + { + $this->options['parameter23Name'] = $parameter23Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter23Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter23Value(string $parameter23Value): self + { + $this->options['parameter23Value'] = $parameter23Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter24Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter24Name(string $parameter24Name): self + { + $this->options['parameter24Name'] = $parameter24Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter24Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter24Value(string $parameter24Value): self + { + $this->options['parameter24Value'] = $parameter24Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter25Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter25Name(string $parameter25Name): self + { + $this->options['parameter25Name'] = $parameter25Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter25Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter25Value(string $parameter25Value): self + { + $this->options['parameter25Value'] = $parameter25Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter26Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter26Name(string $parameter26Name): self + { + $this->options['parameter26Name'] = $parameter26Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter26Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter26Value(string $parameter26Value): self + { + $this->options['parameter26Value'] = $parameter26Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter27Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter27Name(string $parameter27Name): self + { + $this->options['parameter27Name'] = $parameter27Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter27Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter27Value(string $parameter27Value): self + { + $this->options['parameter27Value'] = $parameter27Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter28Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter28Name(string $parameter28Name): self + { + $this->options['parameter28Name'] = $parameter28Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter28Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter28Value(string $parameter28Value): self + { + $this->options['parameter28Value'] = $parameter28Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter29Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter29Name(string $parameter29Name): self + { + $this->options['parameter29Name'] = $parameter29Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter29Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter29Value(string $parameter29Value): self + { + $this->options['parameter29Value'] = $parameter29Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter30Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter30Name(string $parameter30Name): self + { + $this->options['parameter30Name'] = $parameter30Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter30Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter30Value(string $parameter30Value): self + { + $this->options['parameter30Value'] = $parameter30Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter31Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter31Name(string $parameter31Name): self + { + $this->options['parameter31Name'] = $parameter31Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter31Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter31Value(string $parameter31Value): self + { + $this->options['parameter31Value'] = $parameter31Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter32Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter32Name(string $parameter32Name): self + { + $this->options['parameter32Name'] = $parameter32Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter32Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter32Value(string $parameter32Value): self + { + $this->options['parameter32Value'] = $parameter32Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter33Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter33Name(string $parameter33Name): self + { + $this->options['parameter33Name'] = $parameter33Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter33Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter33Value(string $parameter33Value): self + { + $this->options['parameter33Value'] = $parameter33Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter34Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter34Name(string $parameter34Name): self + { + $this->options['parameter34Name'] = $parameter34Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter34Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter34Value(string $parameter34Value): self + { + $this->options['parameter34Value'] = $parameter34Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter35Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter35Name(string $parameter35Name): self + { + $this->options['parameter35Name'] = $parameter35Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter35Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter35Value(string $parameter35Value): self + { + $this->options['parameter35Value'] = $parameter35Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter36Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter36Name(string $parameter36Name): self + { + $this->options['parameter36Name'] = $parameter36Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter36Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter36Value(string $parameter36Value): self + { + $this->options['parameter36Value'] = $parameter36Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter37Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter37Name(string $parameter37Name): self + { + $this->options['parameter37Name'] = $parameter37Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter37Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter37Value(string $parameter37Value): self + { + $this->options['parameter37Value'] = $parameter37Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter38Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter38Name(string $parameter38Name): self + { + $this->options['parameter38Name'] = $parameter38Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter38Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter38Value(string $parameter38Value): self + { + $this->options['parameter38Value'] = $parameter38Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter39Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter39Name(string $parameter39Name): self + { + $this->options['parameter39Name'] = $parameter39Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter39Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter39Value(string $parameter39Value): self + { + $this->options['parameter39Value'] = $parameter39Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter40Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter40Name(string $parameter40Name): self + { + $this->options['parameter40Name'] = $parameter40Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter40Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter40Value(string $parameter40Value): self + { + $this->options['parameter40Value'] = $parameter40Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter41Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter41Name(string $parameter41Name): self + { + $this->options['parameter41Name'] = $parameter41Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter41Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter41Value(string $parameter41Value): self + { + $this->options['parameter41Value'] = $parameter41Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter42Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter42Name(string $parameter42Name): self + { + $this->options['parameter42Name'] = $parameter42Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter42Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter42Value(string $parameter42Value): self + { + $this->options['parameter42Value'] = $parameter42Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter43Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter43Name(string $parameter43Name): self + { + $this->options['parameter43Name'] = $parameter43Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter43Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter43Value(string $parameter43Value): self + { + $this->options['parameter43Value'] = $parameter43Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter44Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter44Name(string $parameter44Name): self + { + $this->options['parameter44Name'] = $parameter44Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter44Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter44Value(string $parameter44Value): self + { + $this->options['parameter44Value'] = $parameter44Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter45Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter45Name(string $parameter45Name): self + { + $this->options['parameter45Name'] = $parameter45Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter45Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter45Value(string $parameter45Value): self + { + $this->options['parameter45Value'] = $parameter45Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter46Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter46Name(string $parameter46Name): self + { + $this->options['parameter46Name'] = $parameter46Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter46Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter46Value(string $parameter46Value): self + { + $this->options['parameter46Value'] = $parameter46Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter47Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter47Name(string $parameter47Name): self + { + $this->options['parameter47Name'] = $parameter47Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter47Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter47Value(string $parameter47Value): self + { + $this->options['parameter47Value'] = $parameter47Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter48Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter48Name(string $parameter48Name): self + { + $this->options['parameter48Name'] = $parameter48Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter48Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter48Value(string $parameter48Value): self + { + $this->options['parameter48Value'] = $parameter48Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter49Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter49Name(string $parameter49Name): self + { + $this->options['parameter49Name'] = $parameter49Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter49Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter49Value(string $parameter49Value): self + { + $this->options['parameter49Value'] = $parameter49Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter50Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter50Name(string $parameter50Name): self + { + $this->options['parameter50Name'] = $parameter50Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter50Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter50Value(string $parameter50Value): self + { + $this->options['parameter50Value'] = $parameter50Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter51Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter51Name(string $parameter51Name): self + { + $this->options['parameter51Name'] = $parameter51Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter51Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter51Value(string $parameter51Value): self + { + $this->options['parameter51Value'] = $parameter51Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter52Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter52Name(string $parameter52Name): self + { + $this->options['parameter52Name'] = $parameter52Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter52Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter52Value(string $parameter52Value): self + { + $this->options['parameter52Value'] = $parameter52Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter53Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter53Name(string $parameter53Name): self + { + $this->options['parameter53Name'] = $parameter53Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter53Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter53Value(string $parameter53Value): self + { + $this->options['parameter53Value'] = $parameter53Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter54Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter54Name(string $parameter54Name): self + { + $this->options['parameter54Name'] = $parameter54Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter54Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter54Value(string $parameter54Value): self + { + $this->options['parameter54Value'] = $parameter54Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter55Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter55Name(string $parameter55Name): self + { + $this->options['parameter55Name'] = $parameter55Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter55Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter55Value(string $parameter55Value): self + { + $this->options['parameter55Value'] = $parameter55Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter56Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter56Name(string $parameter56Name): self + { + $this->options['parameter56Name'] = $parameter56Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter56Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter56Value(string $parameter56Value): self + { + $this->options['parameter56Value'] = $parameter56Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter57Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter57Name(string $parameter57Name): self + { + $this->options['parameter57Name'] = $parameter57Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter57Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter57Value(string $parameter57Value): self + { + $this->options['parameter57Value'] = $parameter57Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter58Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter58Name(string $parameter58Name): self + { + $this->options['parameter58Name'] = $parameter58Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter58Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter58Value(string $parameter58Value): self + { + $this->options['parameter58Value'] = $parameter58Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter59Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter59Name(string $parameter59Name): self + { + $this->options['parameter59Name'] = $parameter59Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter59Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter59Value(string $parameter59Value): self + { + $this->options['parameter59Value'] = $parameter59Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter60Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter60Name(string $parameter60Name): self + { + $this->options['parameter60Name'] = $parameter60Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter60Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter60Value(string $parameter60Value): self + { + $this->options['parameter60Value'] = $parameter60Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter61Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter61Name(string $parameter61Name): self + { + $this->options['parameter61Name'] = $parameter61Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter61Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter61Value(string $parameter61Value): self + { + $this->options['parameter61Value'] = $parameter61Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter62Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter62Name(string $parameter62Name): self + { + $this->options['parameter62Name'] = $parameter62Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter62Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter62Value(string $parameter62Value): self + { + $this->options['parameter62Value'] = $parameter62Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter63Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter63Name(string $parameter63Name): self + { + $this->options['parameter63Name'] = $parameter63Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter63Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter63Value(string $parameter63Value): self + { + $this->options['parameter63Value'] = $parameter63Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter64Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter64Name(string $parameter64Name): self + { + $this->options['parameter64Name'] = $parameter64Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter64Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter64Value(string $parameter64Value): self + { + $this->options['parameter64Value'] = $parameter64Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter65Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter65Name(string $parameter65Name): self + { + $this->options['parameter65Name'] = $parameter65Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter65Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter65Value(string $parameter65Value): self + { + $this->options['parameter65Value'] = $parameter65Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter66Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter66Name(string $parameter66Name): self + { + $this->options['parameter66Name'] = $parameter66Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter66Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter66Value(string $parameter66Value): self + { + $this->options['parameter66Value'] = $parameter66Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter67Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter67Name(string $parameter67Name): self + { + $this->options['parameter67Name'] = $parameter67Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter67Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter67Value(string $parameter67Value): self + { + $this->options['parameter67Value'] = $parameter67Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter68Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter68Name(string $parameter68Name): self + { + $this->options['parameter68Name'] = $parameter68Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter68Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter68Value(string $parameter68Value): self + { + $this->options['parameter68Value'] = $parameter68Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter69Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter69Name(string $parameter69Name): self + { + $this->options['parameter69Name'] = $parameter69Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter69Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter69Value(string $parameter69Value): self + { + $this->options['parameter69Value'] = $parameter69Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter70Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter70Name(string $parameter70Name): self + { + $this->options['parameter70Name'] = $parameter70Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter70Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter70Value(string $parameter70Value): self + { + $this->options['parameter70Value'] = $parameter70Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter71Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter71Name(string $parameter71Name): self + { + $this->options['parameter71Name'] = $parameter71Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter71Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter71Value(string $parameter71Value): self + { + $this->options['parameter71Value'] = $parameter71Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter72Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter72Name(string $parameter72Name): self + { + $this->options['parameter72Name'] = $parameter72Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter72Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter72Value(string $parameter72Value): self + { + $this->options['parameter72Value'] = $parameter72Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter73Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter73Name(string $parameter73Name): self + { + $this->options['parameter73Name'] = $parameter73Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter73Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter73Value(string $parameter73Value): self + { + $this->options['parameter73Value'] = $parameter73Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter74Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter74Name(string $parameter74Name): self + { + $this->options['parameter74Name'] = $parameter74Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter74Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter74Value(string $parameter74Value): self + { + $this->options['parameter74Value'] = $parameter74Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter75Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter75Name(string $parameter75Name): self + { + $this->options['parameter75Name'] = $parameter75Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter75Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter75Value(string $parameter75Value): self + { + $this->options['parameter75Value'] = $parameter75Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter76Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter76Name(string $parameter76Name): self + { + $this->options['parameter76Name'] = $parameter76Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter76Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter76Value(string $parameter76Value): self + { + $this->options['parameter76Value'] = $parameter76Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter77Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter77Name(string $parameter77Name): self + { + $this->options['parameter77Name'] = $parameter77Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter77Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter77Value(string $parameter77Value): self + { + $this->options['parameter77Value'] = $parameter77Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter78Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter78Name(string $parameter78Name): self + { + $this->options['parameter78Name'] = $parameter78Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter78Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter78Value(string $parameter78Value): self + { + $this->options['parameter78Value'] = $parameter78Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter79Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter79Name(string $parameter79Name): self + { + $this->options['parameter79Name'] = $parameter79Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter79Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter79Value(string $parameter79Value): self + { + $this->options['parameter79Value'] = $parameter79Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter80Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter80Name(string $parameter80Name): self + { + $this->options['parameter80Name'] = $parameter80Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter80Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter80Value(string $parameter80Value): self + { + $this->options['parameter80Value'] = $parameter80Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter81Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter81Name(string $parameter81Name): self + { + $this->options['parameter81Name'] = $parameter81Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter81Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter81Value(string $parameter81Value): self + { + $this->options['parameter81Value'] = $parameter81Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter82Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter82Name(string $parameter82Name): self + { + $this->options['parameter82Name'] = $parameter82Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter82Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter82Value(string $parameter82Value): self + { + $this->options['parameter82Value'] = $parameter82Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter83Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter83Name(string $parameter83Name): self + { + $this->options['parameter83Name'] = $parameter83Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter83Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter83Value(string $parameter83Value): self + { + $this->options['parameter83Value'] = $parameter83Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter84Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter84Name(string $parameter84Name): self + { + $this->options['parameter84Name'] = $parameter84Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter84Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter84Value(string $parameter84Value): self + { + $this->options['parameter84Value'] = $parameter84Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter85Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter85Name(string $parameter85Name): self + { + $this->options['parameter85Name'] = $parameter85Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter85Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter85Value(string $parameter85Value): self + { + $this->options['parameter85Value'] = $parameter85Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter86Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter86Name(string $parameter86Name): self + { + $this->options['parameter86Name'] = $parameter86Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter86Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter86Value(string $parameter86Value): self + { + $this->options['parameter86Value'] = $parameter86Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter87Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter87Name(string $parameter87Name): self + { + $this->options['parameter87Name'] = $parameter87Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter87Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter87Value(string $parameter87Value): self + { + $this->options['parameter87Value'] = $parameter87Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter88Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter88Name(string $parameter88Name): self + { + $this->options['parameter88Name'] = $parameter88Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter88Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter88Value(string $parameter88Value): self + { + $this->options['parameter88Value'] = $parameter88Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter89Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter89Name(string $parameter89Name): self + { + $this->options['parameter89Name'] = $parameter89Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter89Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter89Value(string $parameter89Value): self + { + $this->options['parameter89Value'] = $parameter89Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter90Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter90Name(string $parameter90Name): self + { + $this->options['parameter90Name'] = $parameter90Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter90Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter90Value(string $parameter90Value): self + { + $this->options['parameter90Value'] = $parameter90Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter91Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter91Name(string $parameter91Name): self + { + $this->options['parameter91Name'] = $parameter91Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter91Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter91Value(string $parameter91Value): self + { + $this->options['parameter91Value'] = $parameter91Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter92Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter92Name(string $parameter92Name): self + { + $this->options['parameter92Name'] = $parameter92Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter92Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter92Value(string $parameter92Value): self + { + $this->options['parameter92Value'] = $parameter92Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter93Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter93Name(string $parameter93Name): self + { + $this->options['parameter93Name'] = $parameter93Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter93Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter93Value(string $parameter93Value): self + { + $this->options['parameter93Value'] = $parameter93Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter94Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter94Name(string $parameter94Name): self + { + $this->options['parameter94Name'] = $parameter94Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter94Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter94Value(string $parameter94Value): self + { + $this->options['parameter94Value'] = $parameter94Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter95Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter95Name(string $parameter95Name): self + { + $this->options['parameter95Name'] = $parameter95Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter95Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter95Value(string $parameter95Value): self + { + $this->options['parameter95Value'] = $parameter95Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter96Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter96Name(string $parameter96Name): self + { + $this->options['parameter96Name'] = $parameter96Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter96Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter96Value(string $parameter96Value): self + { + $this->options['parameter96Value'] = $parameter96Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter97Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter97Name(string $parameter97Name): self + { + $this->options['parameter97Name'] = $parameter97Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter97Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter97Value(string $parameter97Value): self + { + $this->options['parameter97Value'] = $parameter97Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter98Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter98Name(string $parameter98Name): self + { + $this->options['parameter98Name'] = $parameter98Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter98Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter98Value(string $parameter98Value): self + { + $this->options['parameter98Value'] = $parameter98Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter99Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter99Name(string $parameter99Name): self + { + $this->options['parameter99Name'] = $parameter99Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter99Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter99Value(string $parameter99Value): self + { + $this->options['parameter99Value'] = $parameter99Value; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateSiprecOptions ' . $options . ']'; + } +} + + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/SiprecPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/SiprecPage.php new file mode 100755 index 0000000..6416ce4 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/SiprecPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SiprecInstance \Twilio\Rest\Api\V2010\Account\Call\SiprecInstance + */ + public function buildInstance(array $payload): SiprecInstance + { + return new SiprecInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['callSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.SiprecPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/StreamContext.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/StreamContext.php new file mode 100755 index 0000000..3c0f04d --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/StreamContext.php @@ -0,0 +1,101 @@ +solution = [ + 'accountSid' => + $accountSid, + 'callSid' => + $callSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Calls/' . \rawurlencode($callSid) + .'/Streams/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Update the StreamInstance + * + * @param string $status + * @return StreamInstance Updated StreamInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status): StreamInstance + { + + $data = Values::of([ + 'Status' => + $status, + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new StreamInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['callSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.StreamContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/StreamInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/StreamInstance.php new file mode 100755 index 0000000..a202fb4 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/StreamInstance.php @@ -0,0 +1,134 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'callSid' => Values::array_get($payload, 'call_sid'), + 'name' => Values::array_get($payload, 'name'), + 'status' => Values::array_get($payload, 'status'), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'uri' => Values::array_get($payload, 'uri'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return StreamContext Context for this StreamInstance + */ + protected function proxy(): StreamContext + { + if (!$this->context) { + $this->context = new StreamContext( + $this->version, + $this->solution['accountSid'], + $this->solution['callSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Update the StreamInstance + * + * @param string $status + * @return StreamInstance Updated StreamInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status): StreamInstance + { + + return $this->proxy()->update($status); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.StreamInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/StreamList.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/StreamList.php new file mode 100755 index 0000000..279d0f7 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/StreamList.php @@ -0,0 +1,518 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'callSid' => + $callSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Calls/' . \rawurlencode($callSid) + .'/Streams.json'; + } + + /** + * Create the StreamInstance + * + * @param string $url Relative or absolute url where WebSocket connection will be established. + * @param array|Options $options Optional Arguments + * @return StreamInstance Created StreamInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $url, array $options = []): StreamInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Url' => + $url, + 'Name' => + $options['name'], + 'Track' => + $options['track'], + 'StatusCallback' => + $options['statusCallback'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'Parameter1.Name' => + $options['parameter1Name'], + 'Parameter1.Value' => + $options['parameter1Value'], + 'Parameter2.Name' => + $options['parameter2Name'], + 'Parameter2.Value' => + $options['parameter2Value'], + 'Parameter3.Name' => + $options['parameter3Name'], + 'Parameter3.Value' => + $options['parameter3Value'], + 'Parameter4.Name' => + $options['parameter4Name'], + 'Parameter4.Value' => + $options['parameter4Value'], + 'Parameter5.Name' => + $options['parameter5Name'], + 'Parameter5.Value' => + $options['parameter5Value'], + 'Parameter6.Name' => + $options['parameter6Name'], + 'Parameter6.Value' => + $options['parameter6Value'], + 'Parameter7.Name' => + $options['parameter7Name'], + 'Parameter7.Value' => + $options['parameter7Value'], + 'Parameter8.Name' => + $options['parameter8Name'], + 'Parameter8.Value' => + $options['parameter8Value'], + 'Parameter9.Name' => + $options['parameter9Name'], + 'Parameter9.Value' => + $options['parameter9Value'], + 'Parameter10.Name' => + $options['parameter10Name'], + 'Parameter10.Value' => + $options['parameter10Value'], + 'Parameter11.Name' => + $options['parameter11Name'], + 'Parameter11.Value' => + $options['parameter11Value'], + 'Parameter12.Name' => + $options['parameter12Name'], + 'Parameter12.Value' => + $options['parameter12Value'], + 'Parameter13.Name' => + $options['parameter13Name'], + 'Parameter13.Value' => + $options['parameter13Value'], + 'Parameter14.Name' => + $options['parameter14Name'], + 'Parameter14.Value' => + $options['parameter14Value'], + 'Parameter15.Name' => + $options['parameter15Name'], + 'Parameter15.Value' => + $options['parameter15Value'], + 'Parameter16.Name' => + $options['parameter16Name'], + 'Parameter16.Value' => + $options['parameter16Value'], + 'Parameter17.Name' => + $options['parameter17Name'], + 'Parameter17.Value' => + $options['parameter17Value'], + 'Parameter18.Name' => + $options['parameter18Name'], + 'Parameter18.Value' => + $options['parameter18Value'], + 'Parameter19.Name' => + $options['parameter19Name'], + 'Parameter19.Value' => + $options['parameter19Value'], + 'Parameter20.Name' => + $options['parameter20Name'], + 'Parameter20.Value' => + $options['parameter20Value'], + 'Parameter21.Name' => + $options['parameter21Name'], + 'Parameter21.Value' => + $options['parameter21Value'], + 'Parameter22.Name' => + $options['parameter22Name'], + 'Parameter22.Value' => + $options['parameter22Value'], + 'Parameter23.Name' => + $options['parameter23Name'], + 'Parameter23.Value' => + $options['parameter23Value'], + 'Parameter24.Name' => + $options['parameter24Name'], + 'Parameter24.Value' => + $options['parameter24Value'], + 'Parameter25.Name' => + $options['parameter25Name'], + 'Parameter25.Value' => + $options['parameter25Value'], + 'Parameter26.Name' => + $options['parameter26Name'], + 'Parameter26.Value' => + $options['parameter26Value'], + 'Parameter27.Name' => + $options['parameter27Name'], + 'Parameter27.Value' => + $options['parameter27Value'], + 'Parameter28.Name' => + $options['parameter28Name'], + 'Parameter28.Value' => + $options['parameter28Value'], + 'Parameter29.Name' => + $options['parameter29Name'], + 'Parameter29.Value' => + $options['parameter29Value'], + 'Parameter30.Name' => + $options['parameter30Name'], + 'Parameter30.Value' => + $options['parameter30Value'], + 'Parameter31.Name' => + $options['parameter31Name'], + 'Parameter31.Value' => + $options['parameter31Value'], + 'Parameter32.Name' => + $options['parameter32Name'], + 'Parameter32.Value' => + $options['parameter32Value'], + 'Parameter33.Name' => + $options['parameter33Name'], + 'Parameter33.Value' => + $options['parameter33Value'], + 'Parameter34.Name' => + $options['parameter34Name'], + 'Parameter34.Value' => + $options['parameter34Value'], + 'Parameter35.Name' => + $options['parameter35Name'], + 'Parameter35.Value' => + $options['parameter35Value'], + 'Parameter36.Name' => + $options['parameter36Name'], + 'Parameter36.Value' => + $options['parameter36Value'], + 'Parameter37.Name' => + $options['parameter37Name'], + 'Parameter37.Value' => + $options['parameter37Value'], + 'Parameter38.Name' => + $options['parameter38Name'], + 'Parameter38.Value' => + $options['parameter38Value'], + 'Parameter39.Name' => + $options['parameter39Name'], + 'Parameter39.Value' => + $options['parameter39Value'], + 'Parameter40.Name' => + $options['parameter40Name'], + 'Parameter40.Value' => + $options['parameter40Value'], + 'Parameter41.Name' => + $options['parameter41Name'], + 'Parameter41.Value' => + $options['parameter41Value'], + 'Parameter42.Name' => + $options['parameter42Name'], + 'Parameter42.Value' => + $options['parameter42Value'], + 'Parameter43.Name' => + $options['parameter43Name'], + 'Parameter43.Value' => + $options['parameter43Value'], + 'Parameter44.Name' => + $options['parameter44Name'], + 'Parameter44.Value' => + $options['parameter44Value'], + 'Parameter45.Name' => + $options['parameter45Name'], + 'Parameter45.Value' => + $options['parameter45Value'], + 'Parameter46.Name' => + $options['parameter46Name'], + 'Parameter46.Value' => + $options['parameter46Value'], + 'Parameter47.Name' => + $options['parameter47Name'], + 'Parameter47.Value' => + $options['parameter47Value'], + 'Parameter48.Name' => + $options['parameter48Name'], + 'Parameter48.Value' => + $options['parameter48Value'], + 'Parameter49.Name' => + $options['parameter49Name'], + 'Parameter49.Value' => + $options['parameter49Value'], + 'Parameter50.Name' => + $options['parameter50Name'], + 'Parameter50.Value' => + $options['parameter50Value'], + 'Parameter51.Name' => + $options['parameter51Name'], + 'Parameter51.Value' => + $options['parameter51Value'], + 'Parameter52.Name' => + $options['parameter52Name'], + 'Parameter52.Value' => + $options['parameter52Value'], + 'Parameter53.Name' => + $options['parameter53Name'], + 'Parameter53.Value' => + $options['parameter53Value'], + 'Parameter54.Name' => + $options['parameter54Name'], + 'Parameter54.Value' => + $options['parameter54Value'], + 'Parameter55.Name' => + $options['parameter55Name'], + 'Parameter55.Value' => + $options['parameter55Value'], + 'Parameter56.Name' => + $options['parameter56Name'], + 'Parameter56.Value' => + $options['parameter56Value'], + 'Parameter57.Name' => + $options['parameter57Name'], + 'Parameter57.Value' => + $options['parameter57Value'], + 'Parameter58.Name' => + $options['parameter58Name'], + 'Parameter58.Value' => + $options['parameter58Value'], + 'Parameter59.Name' => + $options['parameter59Name'], + 'Parameter59.Value' => + $options['parameter59Value'], + 'Parameter60.Name' => + $options['parameter60Name'], + 'Parameter60.Value' => + $options['parameter60Value'], + 'Parameter61.Name' => + $options['parameter61Name'], + 'Parameter61.Value' => + $options['parameter61Value'], + 'Parameter62.Name' => + $options['parameter62Name'], + 'Parameter62.Value' => + $options['parameter62Value'], + 'Parameter63.Name' => + $options['parameter63Name'], + 'Parameter63.Value' => + $options['parameter63Value'], + 'Parameter64.Name' => + $options['parameter64Name'], + 'Parameter64.Value' => + $options['parameter64Value'], + 'Parameter65.Name' => + $options['parameter65Name'], + 'Parameter65.Value' => + $options['parameter65Value'], + 'Parameter66.Name' => + $options['parameter66Name'], + 'Parameter66.Value' => + $options['parameter66Value'], + 'Parameter67.Name' => + $options['parameter67Name'], + 'Parameter67.Value' => + $options['parameter67Value'], + 'Parameter68.Name' => + $options['parameter68Name'], + 'Parameter68.Value' => + $options['parameter68Value'], + 'Parameter69.Name' => + $options['parameter69Name'], + 'Parameter69.Value' => + $options['parameter69Value'], + 'Parameter70.Name' => + $options['parameter70Name'], + 'Parameter70.Value' => + $options['parameter70Value'], + 'Parameter71.Name' => + $options['parameter71Name'], + 'Parameter71.Value' => + $options['parameter71Value'], + 'Parameter72.Name' => + $options['parameter72Name'], + 'Parameter72.Value' => + $options['parameter72Value'], + 'Parameter73.Name' => + $options['parameter73Name'], + 'Parameter73.Value' => + $options['parameter73Value'], + 'Parameter74.Name' => + $options['parameter74Name'], + 'Parameter74.Value' => + $options['parameter74Value'], + 'Parameter75.Name' => + $options['parameter75Name'], + 'Parameter75.Value' => + $options['parameter75Value'], + 'Parameter76.Name' => + $options['parameter76Name'], + 'Parameter76.Value' => + $options['parameter76Value'], + 'Parameter77.Name' => + $options['parameter77Name'], + 'Parameter77.Value' => + $options['parameter77Value'], + 'Parameter78.Name' => + $options['parameter78Name'], + 'Parameter78.Value' => + $options['parameter78Value'], + 'Parameter79.Name' => + $options['parameter79Name'], + 'Parameter79.Value' => + $options['parameter79Value'], + 'Parameter80.Name' => + $options['parameter80Name'], + 'Parameter80.Value' => + $options['parameter80Value'], + 'Parameter81.Name' => + $options['parameter81Name'], + 'Parameter81.Value' => + $options['parameter81Value'], + 'Parameter82.Name' => + $options['parameter82Name'], + 'Parameter82.Value' => + $options['parameter82Value'], + 'Parameter83.Name' => + $options['parameter83Name'], + 'Parameter83.Value' => + $options['parameter83Value'], + 'Parameter84.Name' => + $options['parameter84Name'], + 'Parameter84.Value' => + $options['parameter84Value'], + 'Parameter85.Name' => + $options['parameter85Name'], + 'Parameter85.Value' => + $options['parameter85Value'], + 'Parameter86.Name' => + $options['parameter86Name'], + 'Parameter86.Value' => + $options['parameter86Value'], + 'Parameter87.Name' => + $options['parameter87Name'], + 'Parameter87.Value' => + $options['parameter87Value'], + 'Parameter88.Name' => + $options['parameter88Name'], + 'Parameter88.Value' => + $options['parameter88Value'], + 'Parameter89.Name' => + $options['parameter89Name'], + 'Parameter89.Value' => + $options['parameter89Value'], + 'Parameter90.Name' => + $options['parameter90Name'], + 'Parameter90.Value' => + $options['parameter90Value'], + 'Parameter91.Name' => + $options['parameter91Name'], + 'Parameter91.Value' => + $options['parameter91Value'], + 'Parameter92.Name' => + $options['parameter92Name'], + 'Parameter92.Value' => + $options['parameter92Value'], + 'Parameter93.Name' => + $options['parameter93Name'], + 'Parameter93.Value' => + $options['parameter93Value'], + 'Parameter94.Name' => + $options['parameter94Name'], + 'Parameter94.Value' => + $options['parameter94Value'], + 'Parameter95.Name' => + $options['parameter95Name'], + 'Parameter95.Value' => + $options['parameter95Value'], + 'Parameter96.Name' => + $options['parameter96Name'], + 'Parameter96.Value' => + $options['parameter96Value'], + 'Parameter97.Name' => + $options['parameter97Name'], + 'Parameter97.Value' => + $options['parameter97Value'], + 'Parameter98.Name' => + $options['parameter98Name'], + 'Parameter98.Value' => + $options['parameter98Value'], + 'Parameter99.Name' => + $options['parameter99Name'], + 'Parameter99.Value' => + $options['parameter99Value'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new StreamInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['callSid'] + ); + } + + + /** + * Constructs a StreamContext + * + * @param string $sid The SID of the Stream resource, or the `name` used when creating the resource + */ + public function getContext( + string $sid + + ): StreamContext + { + return new StreamContext( + $this->version, + $this->solution['accountSid'], + $this->solution['callSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.StreamList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/StreamOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/StreamOptions.php new file mode 100755 index 0000000..852734e --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/StreamOptions.php @@ -0,0 +1,3695 @@ +options['name'] = $name; + $this->options['track'] = $track; + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['parameter1Name'] = $parameter1Name; + $this->options['parameter1Value'] = $parameter1Value; + $this->options['parameter2Name'] = $parameter2Name; + $this->options['parameter2Value'] = $parameter2Value; + $this->options['parameter3Name'] = $parameter3Name; + $this->options['parameter3Value'] = $parameter3Value; + $this->options['parameter4Name'] = $parameter4Name; + $this->options['parameter4Value'] = $parameter4Value; + $this->options['parameter5Name'] = $parameter5Name; + $this->options['parameter5Value'] = $parameter5Value; + $this->options['parameter6Name'] = $parameter6Name; + $this->options['parameter6Value'] = $parameter6Value; + $this->options['parameter7Name'] = $parameter7Name; + $this->options['parameter7Value'] = $parameter7Value; + $this->options['parameter8Name'] = $parameter8Name; + $this->options['parameter8Value'] = $parameter8Value; + $this->options['parameter9Name'] = $parameter9Name; + $this->options['parameter9Value'] = $parameter9Value; + $this->options['parameter10Name'] = $parameter10Name; + $this->options['parameter10Value'] = $parameter10Value; + $this->options['parameter11Name'] = $parameter11Name; + $this->options['parameter11Value'] = $parameter11Value; + $this->options['parameter12Name'] = $parameter12Name; + $this->options['parameter12Value'] = $parameter12Value; + $this->options['parameter13Name'] = $parameter13Name; + $this->options['parameter13Value'] = $parameter13Value; + $this->options['parameter14Name'] = $parameter14Name; + $this->options['parameter14Value'] = $parameter14Value; + $this->options['parameter15Name'] = $parameter15Name; + $this->options['parameter15Value'] = $parameter15Value; + $this->options['parameter16Name'] = $parameter16Name; + $this->options['parameter16Value'] = $parameter16Value; + $this->options['parameter17Name'] = $parameter17Name; + $this->options['parameter17Value'] = $parameter17Value; + $this->options['parameter18Name'] = $parameter18Name; + $this->options['parameter18Value'] = $parameter18Value; + $this->options['parameter19Name'] = $parameter19Name; + $this->options['parameter19Value'] = $parameter19Value; + $this->options['parameter20Name'] = $parameter20Name; + $this->options['parameter20Value'] = $parameter20Value; + $this->options['parameter21Name'] = $parameter21Name; + $this->options['parameter21Value'] = $parameter21Value; + $this->options['parameter22Name'] = $parameter22Name; + $this->options['parameter22Value'] = $parameter22Value; + $this->options['parameter23Name'] = $parameter23Name; + $this->options['parameter23Value'] = $parameter23Value; + $this->options['parameter24Name'] = $parameter24Name; + $this->options['parameter24Value'] = $parameter24Value; + $this->options['parameter25Name'] = $parameter25Name; + $this->options['parameter25Value'] = $parameter25Value; + $this->options['parameter26Name'] = $parameter26Name; + $this->options['parameter26Value'] = $parameter26Value; + $this->options['parameter27Name'] = $parameter27Name; + $this->options['parameter27Value'] = $parameter27Value; + $this->options['parameter28Name'] = $parameter28Name; + $this->options['parameter28Value'] = $parameter28Value; + $this->options['parameter29Name'] = $parameter29Name; + $this->options['parameter29Value'] = $parameter29Value; + $this->options['parameter30Name'] = $parameter30Name; + $this->options['parameter30Value'] = $parameter30Value; + $this->options['parameter31Name'] = $parameter31Name; + $this->options['parameter31Value'] = $parameter31Value; + $this->options['parameter32Name'] = $parameter32Name; + $this->options['parameter32Value'] = $parameter32Value; + $this->options['parameter33Name'] = $parameter33Name; + $this->options['parameter33Value'] = $parameter33Value; + $this->options['parameter34Name'] = $parameter34Name; + $this->options['parameter34Value'] = $parameter34Value; + $this->options['parameter35Name'] = $parameter35Name; + $this->options['parameter35Value'] = $parameter35Value; + $this->options['parameter36Name'] = $parameter36Name; + $this->options['parameter36Value'] = $parameter36Value; + $this->options['parameter37Name'] = $parameter37Name; + $this->options['parameter37Value'] = $parameter37Value; + $this->options['parameter38Name'] = $parameter38Name; + $this->options['parameter38Value'] = $parameter38Value; + $this->options['parameter39Name'] = $parameter39Name; + $this->options['parameter39Value'] = $parameter39Value; + $this->options['parameter40Name'] = $parameter40Name; + $this->options['parameter40Value'] = $parameter40Value; + $this->options['parameter41Name'] = $parameter41Name; + $this->options['parameter41Value'] = $parameter41Value; + $this->options['parameter42Name'] = $parameter42Name; + $this->options['parameter42Value'] = $parameter42Value; + $this->options['parameter43Name'] = $parameter43Name; + $this->options['parameter43Value'] = $parameter43Value; + $this->options['parameter44Name'] = $parameter44Name; + $this->options['parameter44Value'] = $parameter44Value; + $this->options['parameter45Name'] = $parameter45Name; + $this->options['parameter45Value'] = $parameter45Value; + $this->options['parameter46Name'] = $parameter46Name; + $this->options['parameter46Value'] = $parameter46Value; + $this->options['parameter47Name'] = $parameter47Name; + $this->options['parameter47Value'] = $parameter47Value; + $this->options['parameter48Name'] = $parameter48Name; + $this->options['parameter48Value'] = $parameter48Value; + $this->options['parameter49Name'] = $parameter49Name; + $this->options['parameter49Value'] = $parameter49Value; + $this->options['parameter50Name'] = $parameter50Name; + $this->options['parameter50Value'] = $parameter50Value; + $this->options['parameter51Name'] = $parameter51Name; + $this->options['parameter51Value'] = $parameter51Value; + $this->options['parameter52Name'] = $parameter52Name; + $this->options['parameter52Value'] = $parameter52Value; + $this->options['parameter53Name'] = $parameter53Name; + $this->options['parameter53Value'] = $parameter53Value; + $this->options['parameter54Name'] = $parameter54Name; + $this->options['parameter54Value'] = $parameter54Value; + $this->options['parameter55Name'] = $parameter55Name; + $this->options['parameter55Value'] = $parameter55Value; + $this->options['parameter56Name'] = $parameter56Name; + $this->options['parameter56Value'] = $parameter56Value; + $this->options['parameter57Name'] = $parameter57Name; + $this->options['parameter57Value'] = $parameter57Value; + $this->options['parameter58Name'] = $parameter58Name; + $this->options['parameter58Value'] = $parameter58Value; + $this->options['parameter59Name'] = $parameter59Name; + $this->options['parameter59Value'] = $parameter59Value; + $this->options['parameter60Name'] = $parameter60Name; + $this->options['parameter60Value'] = $parameter60Value; + $this->options['parameter61Name'] = $parameter61Name; + $this->options['parameter61Value'] = $parameter61Value; + $this->options['parameter62Name'] = $parameter62Name; + $this->options['parameter62Value'] = $parameter62Value; + $this->options['parameter63Name'] = $parameter63Name; + $this->options['parameter63Value'] = $parameter63Value; + $this->options['parameter64Name'] = $parameter64Name; + $this->options['parameter64Value'] = $parameter64Value; + $this->options['parameter65Name'] = $parameter65Name; + $this->options['parameter65Value'] = $parameter65Value; + $this->options['parameter66Name'] = $parameter66Name; + $this->options['parameter66Value'] = $parameter66Value; + $this->options['parameter67Name'] = $parameter67Name; + $this->options['parameter67Value'] = $parameter67Value; + $this->options['parameter68Name'] = $parameter68Name; + $this->options['parameter68Value'] = $parameter68Value; + $this->options['parameter69Name'] = $parameter69Name; + $this->options['parameter69Value'] = $parameter69Value; + $this->options['parameter70Name'] = $parameter70Name; + $this->options['parameter70Value'] = $parameter70Value; + $this->options['parameter71Name'] = $parameter71Name; + $this->options['parameter71Value'] = $parameter71Value; + $this->options['parameter72Name'] = $parameter72Name; + $this->options['parameter72Value'] = $parameter72Value; + $this->options['parameter73Name'] = $parameter73Name; + $this->options['parameter73Value'] = $parameter73Value; + $this->options['parameter74Name'] = $parameter74Name; + $this->options['parameter74Value'] = $parameter74Value; + $this->options['parameter75Name'] = $parameter75Name; + $this->options['parameter75Value'] = $parameter75Value; + $this->options['parameter76Name'] = $parameter76Name; + $this->options['parameter76Value'] = $parameter76Value; + $this->options['parameter77Name'] = $parameter77Name; + $this->options['parameter77Value'] = $parameter77Value; + $this->options['parameter78Name'] = $parameter78Name; + $this->options['parameter78Value'] = $parameter78Value; + $this->options['parameter79Name'] = $parameter79Name; + $this->options['parameter79Value'] = $parameter79Value; + $this->options['parameter80Name'] = $parameter80Name; + $this->options['parameter80Value'] = $parameter80Value; + $this->options['parameter81Name'] = $parameter81Name; + $this->options['parameter81Value'] = $parameter81Value; + $this->options['parameter82Name'] = $parameter82Name; + $this->options['parameter82Value'] = $parameter82Value; + $this->options['parameter83Name'] = $parameter83Name; + $this->options['parameter83Value'] = $parameter83Value; + $this->options['parameter84Name'] = $parameter84Name; + $this->options['parameter84Value'] = $parameter84Value; + $this->options['parameter85Name'] = $parameter85Name; + $this->options['parameter85Value'] = $parameter85Value; + $this->options['parameter86Name'] = $parameter86Name; + $this->options['parameter86Value'] = $parameter86Value; + $this->options['parameter87Name'] = $parameter87Name; + $this->options['parameter87Value'] = $parameter87Value; + $this->options['parameter88Name'] = $parameter88Name; + $this->options['parameter88Value'] = $parameter88Value; + $this->options['parameter89Name'] = $parameter89Name; + $this->options['parameter89Value'] = $parameter89Value; + $this->options['parameter90Name'] = $parameter90Name; + $this->options['parameter90Value'] = $parameter90Value; + $this->options['parameter91Name'] = $parameter91Name; + $this->options['parameter91Value'] = $parameter91Value; + $this->options['parameter92Name'] = $parameter92Name; + $this->options['parameter92Value'] = $parameter92Value; + $this->options['parameter93Name'] = $parameter93Name; + $this->options['parameter93Value'] = $parameter93Value; + $this->options['parameter94Name'] = $parameter94Name; + $this->options['parameter94Value'] = $parameter94Value; + $this->options['parameter95Name'] = $parameter95Name; + $this->options['parameter95Value'] = $parameter95Value; + $this->options['parameter96Name'] = $parameter96Name; + $this->options['parameter96Value'] = $parameter96Value; + $this->options['parameter97Name'] = $parameter97Name; + $this->options['parameter97Value'] = $parameter97Value; + $this->options['parameter98Name'] = $parameter98Name; + $this->options['parameter98Value'] = $parameter98Value; + $this->options['parameter99Name'] = $parameter99Name; + $this->options['parameter99Value'] = $parameter99Value; + } + + /** + * The user-specified name of this Stream, if one was given when the Stream was created. This may be used to stop the Stream. + * + * @param string $name The user-specified name of this Stream, if one was given when the Stream was created. This may be used to stop the Stream. + * @return $this Fluent Builder + */ + public function setName(string $name): self + { + $this->options['name'] = $name; + return $this; + } + + /** + * @param string $track + * @return $this Fluent Builder + */ + public function setTrack(string $track): self + { + $this->options['track'] = $track; + return $this; + } + + /** + * Absolute URL of the status callback. + * + * @param string $statusCallback Absolute URL of the status callback. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The http method for the status_callback (one of GET, POST). + * + * @param string $statusCallbackMethod The http method for the status_callback (one of GET, POST). + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter1Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter1Name(string $parameter1Name): self + { + $this->options['parameter1Name'] = $parameter1Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter1Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter1Value(string $parameter1Value): self + { + $this->options['parameter1Value'] = $parameter1Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter2Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter2Name(string $parameter2Name): self + { + $this->options['parameter2Name'] = $parameter2Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter2Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter2Value(string $parameter2Value): self + { + $this->options['parameter2Value'] = $parameter2Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter3Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter3Name(string $parameter3Name): self + { + $this->options['parameter3Name'] = $parameter3Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter3Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter3Value(string $parameter3Value): self + { + $this->options['parameter3Value'] = $parameter3Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter4Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter4Name(string $parameter4Name): self + { + $this->options['parameter4Name'] = $parameter4Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter4Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter4Value(string $parameter4Value): self + { + $this->options['parameter4Value'] = $parameter4Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter5Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter5Name(string $parameter5Name): self + { + $this->options['parameter5Name'] = $parameter5Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter5Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter5Value(string $parameter5Value): self + { + $this->options['parameter5Value'] = $parameter5Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter6Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter6Name(string $parameter6Name): self + { + $this->options['parameter6Name'] = $parameter6Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter6Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter6Value(string $parameter6Value): self + { + $this->options['parameter6Value'] = $parameter6Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter7Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter7Name(string $parameter7Name): self + { + $this->options['parameter7Name'] = $parameter7Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter7Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter7Value(string $parameter7Value): self + { + $this->options['parameter7Value'] = $parameter7Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter8Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter8Name(string $parameter8Name): self + { + $this->options['parameter8Name'] = $parameter8Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter8Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter8Value(string $parameter8Value): self + { + $this->options['parameter8Value'] = $parameter8Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter9Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter9Name(string $parameter9Name): self + { + $this->options['parameter9Name'] = $parameter9Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter9Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter9Value(string $parameter9Value): self + { + $this->options['parameter9Value'] = $parameter9Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter10Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter10Name(string $parameter10Name): self + { + $this->options['parameter10Name'] = $parameter10Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter10Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter10Value(string $parameter10Value): self + { + $this->options['parameter10Value'] = $parameter10Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter11Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter11Name(string $parameter11Name): self + { + $this->options['parameter11Name'] = $parameter11Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter11Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter11Value(string $parameter11Value): self + { + $this->options['parameter11Value'] = $parameter11Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter12Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter12Name(string $parameter12Name): self + { + $this->options['parameter12Name'] = $parameter12Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter12Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter12Value(string $parameter12Value): self + { + $this->options['parameter12Value'] = $parameter12Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter13Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter13Name(string $parameter13Name): self + { + $this->options['parameter13Name'] = $parameter13Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter13Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter13Value(string $parameter13Value): self + { + $this->options['parameter13Value'] = $parameter13Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter14Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter14Name(string $parameter14Name): self + { + $this->options['parameter14Name'] = $parameter14Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter14Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter14Value(string $parameter14Value): self + { + $this->options['parameter14Value'] = $parameter14Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter15Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter15Name(string $parameter15Name): self + { + $this->options['parameter15Name'] = $parameter15Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter15Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter15Value(string $parameter15Value): self + { + $this->options['parameter15Value'] = $parameter15Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter16Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter16Name(string $parameter16Name): self + { + $this->options['parameter16Name'] = $parameter16Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter16Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter16Value(string $parameter16Value): self + { + $this->options['parameter16Value'] = $parameter16Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter17Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter17Name(string $parameter17Name): self + { + $this->options['parameter17Name'] = $parameter17Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter17Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter17Value(string $parameter17Value): self + { + $this->options['parameter17Value'] = $parameter17Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter18Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter18Name(string $parameter18Name): self + { + $this->options['parameter18Name'] = $parameter18Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter18Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter18Value(string $parameter18Value): self + { + $this->options['parameter18Value'] = $parameter18Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter19Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter19Name(string $parameter19Name): self + { + $this->options['parameter19Name'] = $parameter19Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter19Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter19Value(string $parameter19Value): self + { + $this->options['parameter19Value'] = $parameter19Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter20Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter20Name(string $parameter20Name): self + { + $this->options['parameter20Name'] = $parameter20Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter20Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter20Value(string $parameter20Value): self + { + $this->options['parameter20Value'] = $parameter20Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter21Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter21Name(string $parameter21Name): self + { + $this->options['parameter21Name'] = $parameter21Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter21Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter21Value(string $parameter21Value): self + { + $this->options['parameter21Value'] = $parameter21Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter22Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter22Name(string $parameter22Name): self + { + $this->options['parameter22Name'] = $parameter22Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter22Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter22Value(string $parameter22Value): self + { + $this->options['parameter22Value'] = $parameter22Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter23Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter23Name(string $parameter23Name): self + { + $this->options['parameter23Name'] = $parameter23Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter23Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter23Value(string $parameter23Value): self + { + $this->options['parameter23Value'] = $parameter23Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter24Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter24Name(string $parameter24Name): self + { + $this->options['parameter24Name'] = $parameter24Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter24Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter24Value(string $parameter24Value): self + { + $this->options['parameter24Value'] = $parameter24Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter25Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter25Name(string $parameter25Name): self + { + $this->options['parameter25Name'] = $parameter25Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter25Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter25Value(string $parameter25Value): self + { + $this->options['parameter25Value'] = $parameter25Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter26Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter26Name(string $parameter26Name): self + { + $this->options['parameter26Name'] = $parameter26Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter26Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter26Value(string $parameter26Value): self + { + $this->options['parameter26Value'] = $parameter26Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter27Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter27Name(string $parameter27Name): self + { + $this->options['parameter27Name'] = $parameter27Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter27Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter27Value(string $parameter27Value): self + { + $this->options['parameter27Value'] = $parameter27Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter28Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter28Name(string $parameter28Name): self + { + $this->options['parameter28Name'] = $parameter28Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter28Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter28Value(string $parameter28Value): self + { + $this->options['parameter28Value'] = $parameter28Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter29Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter29Name(string $parameter29Name): self + { + $this->options['parameter29Name'] = $parameter29Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter29Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter29Value(string $parameter29Value): self + { + $this->options['parameter29Value'] = $parameter29Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter30Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter30Name(string $parameter30Name): self + { + $this->options['parameter30Name'] = $parameter30Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter30Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter30Value(string $parameter30Value): self + { + $this->options['parameter30Value'] = $parameter30Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter31Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter31Name(string $parameter31Name): self + { + $this->options['parameter31Name'] = $parameter31Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter31Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter31Value(string $parameter31Value): self + { + $this->options['parameter31Value'] = $parameter31Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter32Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter32Name(string $parameter32Name): self + { + $this->options['parameter32Name'] = $parameter32Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter32Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter32Value(string $parameter32Value): self + { + $this->options['parameter32Value'] = $parameter32Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter33Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter33Name(string $parameter33Name): self + { + $this->options['parameter33Name'] = $parameter33Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter33Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter33Value(string $parameter33Value): self + { + $this->options['parameter33Value'] = $parameter33Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter34Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter34Name(string $parameter34Name): self + { + $this->options['parameter34Name'] = $parameter34Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter34Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter34Value(string $parameter34Value): self + { + $this->options['parameter34Value'] = $parameter34Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter35Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter35Name(string $parameter35Name): self + { + $this->options['parameter35Name'] = $parameter35Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter35Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter35Value(string $parameter35Value): self + { + $this->options['parameter35Value'] = $parameter35Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter36Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter36Name(string $parameter36Name): self + { + $this->options['parameter36Name'] = $parameter36Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter36Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter36Value(string $parameter36Value): self + { + $this->options['parameter36Value'] = $parameter36Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter37Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter37Name(string $parameter37Name): self + { + $this->options['parameter37Name'] = $parameter37Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter37Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter37Value(string $parameter37Value): self + { + $this->options['parameter37Value'] = $parameter37Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter38Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter38Name(string $parameter38Name): self + { + $this->options['parameter38Name'] = $parameter38Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter38Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter38Value(string $parameter38Value): self + { + $this->options['parameter38Value'] = $parameter38Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter39Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter39Name(string $parameter39Name): self + { + $this->options['parameter39Name'] = $parameter39Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter39Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter39Value(string $parameter39Value): self + { + $this->options['parameter39Value'] = $parameter39Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter40Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter40Name(string $parameter40Name): self + { + $this->options['parameter40Name'] = $parameter40Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter40Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter40Value(string $parameter40Value): self + { + $this->options['parameter40Value'] = $parameter40Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter41Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter41Name(string $parameter41Name): self + { + $this->options['parameter41Name'] = $parameter41Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter41Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter41Value(string $parameter41Value): self + { + $this->options['parameter41Value'] = $parameter41Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter42Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter42Name(string $parameter42Name): self + { + $this->options['parameter42Name'] = $parameter42Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter42Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter42Value(string $parameter42Value): self + { + $this->options['parameter42Value'] = $parameter42Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter43Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter43Name(string $parameter43Name): self + { + $this->options['parameter43Name'] = $parameter43Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter43Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter43Value(string $parameter43Value): self + { + $this->options['parameter43Value'] = $parameter43Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter44Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter44Name(string $parameter44Name): self + { + $this->options['parameter44Name'] = $parameter44Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter44Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter44Value(string $parameter44Value): self + { + $this->options['parameter44Value'] = $parameter44Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter45Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter45Name(string $parameter45Name): self + { + $this->options['parameter45Name'] = $parameter45Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter45Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter45Value(string $parameter45Value): self + { + $this->options['parameter45Value'] = $parameter45Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter46Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter46Name(string $parameter46Name): self + { + $this->options['parameter46Name'] = $parameter46Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter46Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter46Value(string $parameter46Value): self + { + $this->options['parameter46Value'] = $parameter46Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter47Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter47Name(string $parameter47Name): self + { + $this->options['parameter47Name'] = $parameter47Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter47Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter47Value(string $parameter47Value): self + { + $this->options['parameter47Value'] = $parameter47Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter48Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter48Name(string $parameter48Name): self + { + $this->options['parameter48Name'] = $parameter48Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter48Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter48Value(string $parameter48Value): self + { + $this->options['parameter48Value'] = $parameter48Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter49Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter49Name(string $parameter49Name): self + { + $this->options['parameter49Name'] = $parameter49Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter49Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter49Value(string $parameter49Value): self + { + $this->options['parameter49Value'] = $parameter49Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter50Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter50Name(string $parameter50Name): self + { + $this->options['parameter50Name'] = $parameter50Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter50Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter50Value(string $parameter50Value): self + { + $this->options['parameter50Value'] = $parameter50Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter51Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter51Name(string $parameter51Name): self + { + $this->options['parameter51Name'] = $parameter51Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter51Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter51Value(string $parameter51Value): self + { + $this->options['parameter51Value'] = $parameter51Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter52Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter52Name(string $parameter52Name): self + { + $this->options['parameter52Name'] = $parameter52Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter52Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter52Value(string $parameter52Value): self + { + $this->options['parameter52Value'] = $parameter52Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter53Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter53Name(string $parameter53Name): self + { + $this->options['parameter53Name'] = $parameter53Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter53Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter53Value(string $parameter53Value): self + { + $this->options['parameter53Value'] = $parameter53Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter54Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter54Name(string $parameter54Name): self + { + $this->options['parameter54Name'] = $parameter54Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter54Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter54Value(string $parameter54Value): self + { + $this->options['parameter54Value'] = $parameter54Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter55Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter55Name(string $parameter55Name): self + { + $this->options['parameter55Name'] = $parameter55Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter55Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter55Value(string $parameter55Value): self + { + $this->options['parameter55Value'] = $parameter55Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter56Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter56Name(string $parameter56Name): self + { + $this->options['parameter56Name'] = $parameter56Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter56Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter56Value(string $parameter56Value): self + { + $this->options['parameter56Value'] = $parameter56Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter57Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter57Name(string $parameter57Name): self + { + $this->options['parameter57Name'] = $parameter57Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter57Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter57Value(string $parameter57Value): self + { + $this->options['parameter57Value'] = $parameter57Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter58Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter58Name(string $parameter58Name): self + { + $this->options['parameter58Name'] = $parameter58Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter58Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter58Value(string $parameter58Value): self + { + $this->options['parameter58Value'] = $parameter58Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter59Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter59Name(string $parameter59Name): self + { + $this->options['parameter59Name'] = $parameter59Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter59Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter59Value(string $parameter59Value): self + { + $this->options['parameter59Value'] = $parameter59Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter60Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter60Name(string $parameter60Name): self + { + $this->options['parameter60Name'] = $parameter60Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter60Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter60Value(string $parameter60Value): self + { + $this->options['parameter60Value'] = $parameter60Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter61Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter61Name(string $parameter61Name): self + { + $this->options['parameter61Name'] = $parameter61Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter61Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter61Value(string $parameter61Value): self + { + $this->options['parameter61Value'] = $parameter61Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter62Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter62Name(string $parameter62Name): self + { + $this->options['parameter62Name'] = $parameter62Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter62Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter62Value(string $parameter62Value): self + { + $this->options['parameter62Value'] = $parameter62Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter63Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter63Name(string $parameter63Name): self + { + $this->options['parameter63Name'] = $parameter63Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter63Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter63Value(string $parameter63Value): self + { + $this->options['parameter63Value'] = $parameter63Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter64Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter64Name(string $parameter64Name): self + { + $this->options['parameter64Name'] = $parameter64Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter64Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter64Value(string $parameter64Value): self + { + $this->options['parameter64Value'] = $parameter64Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter65Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter65Name(string $parameter65Name): self + { + $this->options['parameter65Name'] = $parameter65Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter65Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter65Value(string $parameter65Value): self + { + $this->options['parameter65Value'] = $parameter65Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter66Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter66Name(string $parameter66Name): self + { + $this->options['parameter66Name'] = $parameter66Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter66Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter66Value(string $parameter66Value): self + { + $this->options['parameter66Value'] = $parameter66Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter67Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter67Name(string $parameter67Name): self + { + $this->options['parameter67Name'] = $parameter67Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter67Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter67Value(string $parameter67Value): self + { + $this->options['parameter67Value'] = $parameter67Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter68Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter68Name(string $parameter68Name): self + { + $this->options['parameter68Name'] = $parameter68Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter68Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter68Value(string $parameter68Value): self + { + $this->options['parameter68Value'] = $parameter68Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter69Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter69Name(string $parameter69Name): self + { + $this->options['parameter69Name'] = $parameter69Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter69Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter69Value(string $parameter69Value): self + { + $this->options['parameter69Value'] = $parameter69Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter70Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter70Name(string $parameter70Name): self + { + $this->options['parameter70Name'] = $parameter70Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter70Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter70Value(string $parameter70Value): self + { + $this->options['parameter70Value'] = $parameter70Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter71Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter71Name(string $parameter71Name): self + { + $this->options['parameter71Name'] = $parameter71Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter71Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter71Value(string $parameter71Value): self + { + $this->options['parameter71Value'] = $parameter71Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter72Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter72Name(string $parameter72Name): self + { + $this->options['parameter72Name'] = $parameter72Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter72Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter72Value(string $parameter72Value): self + { + $this->options['parameter72Value'] = $parameter72Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter73Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter73Name(string $parameter73Name): self + { + $this->options['parameter73Name'] = $parameter73Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter73Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter73Value(string $parameter73Value): self + { + $this->options['parameter73Value'] = $parameter73Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter74Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter74Name(string $parameter74Name): self + { + $this->options['parameter74Name'] = $parameter74Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter74Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter74Value(string $parameter74Value): self + { + $this->options['parameter74Value'] = $parameter74Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter75Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter75Name(string $parameter75Name): self + { + $this->options['parameter75Name'] = $parameter75Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter75Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter75Value(string $parameter75Value): self + { + $this->options['parameter75Value'] = $parameter75Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter76Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter76Name(string $parameter76Name): self + { + $this->options['parameter76Name'] = $parameter76Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter76Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter76Value(string $parameter76Value): self + { + $this->options['parameter76Value'] = $parameter76Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter77Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter77Name(string $parameter77Name): self + { + $this->options['parameter77Name'] = $parameter77Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter77Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter77Value(string $parameter77Value): self + { + $this->options['parameter77Value'] = $parameter77Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter78Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter78Name(string $parameter78Name): self + { + $this->options['parameter78Name'] = $parameter78Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter78Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter78Value(string $parameter78Value): self + { + $this->options['parameter78Value'] = $parameter78Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter79Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter79Name(string $parameter79Name): self + { + $this->options['parameter79Name'] = $parameter79Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter79Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter79Value(string $parameter79Value): self + { + $this->options['parameter79Value'] = $parameter79Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter80Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter80Name(string $parameter80Name): self + { + $this->options['parameter80Name'] = $parameter80Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter80Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter80Value(string $parameter80Value): self + { + $this->options['parameter80Value'] = $parameter80Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter81Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter81Name(string $parameter81Name): self + { + $this->options['parameter81Name'] = $parameter81Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter81Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter81Value(string $parameter81Value): self + { + $this->options['parameter81Value'] = $parameter81Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter82Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter82Name(string $parameter82Name): self + { + $this->options['parameter82Name'] = $parameter82Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter82Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter82Value(string $parameter82Value): self + { + $this->options['parameter82Value'] = $parameter82Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter83Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter83Name(string $parameter83Name): self + { + $this->options['parameter83Name'] = $parameter83Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter83Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter83Value(string $parameter83Value): self + { + $this->options['parameter83Value'] = $parameter83Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter84Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter84Name(string $parameter84Name): self + { + $this->options['parameter84Name'] = $parameter84Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter84Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter84Value(string $parameter84Value): self + { + $this->options['parameter84Value'] = $parameter84Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter85Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter85Name(string $parameter85Name): self + { + $this->options['parameter85Name'] = $parameter85Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter85Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter85Value(string $parameter85Value): self + { + $this->options['parameter85Value'] = $parameter85Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter86Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter86Name(string $parameter86Name): self + { + $this->options['parameter86Name'] = $parameter86Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter86Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter86Value(string $parameter86Value): self + { + $this->options['parameter86Value'] = $parameter86Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter87Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter87Name(string $parameter87Name): self + { + $this->options['parameter87Name'] = $parameter87Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter87Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter87Value(string $parameter87Value): self + { + $this->options['parameter87Value'] = $parameter87Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter88Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter88Name(string $parameter88Name): self + { + $this->options['parameter88Name'] = $parameter88Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter88Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter88Value(string $parameter88Value): self + { + $this->options['parameter88Value'] = $parameter88Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter89Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter89Name(string $parameter89Name): self + { + $this->options['parameter89Name'] = $parameter89Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter89Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter89Value(string $parameter89Value): self + { + $this->options['parameter89Value'] = $parameter89Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter90Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter90Name(string $parameter90Name): self + { + $this->options['parameter90Name'] = $parameter90Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter90Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter90Value(string $parameter90Value): self + { + $this->options['parameter90Value'] = $parameter90Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter91Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter91Name(string $parameter91Name): self + { + $this->options['parameter91Name'] = $parameter91Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter91Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter91Value(string $parameter91Value): self + { + $this->options['parameter91Value'] = $parameter91Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter92Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter92Name(string $parameter92Name): self + { + $this->options['parameter92Name'] = $parameter92Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter92Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter92Value(string $parameter92Value): self + { + $this->options['parameter92Value'] = $parameter92Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter93Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter93Name(string $parameter93Name): self + { + $this->options['parameter93Name'] = $parameter93Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter93Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter93Value(string $parameter93Value): self + { + $this->options['parameter93Value'] = $parameter93Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter94Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter94Name(string $parameter94Name): self + { + $this->options['parameter94Name'] = $parameter94Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter94Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter94Value(string $parameter94Value): self + { + $this->options['parameter94Value'] = $parameter94Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter95Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter95Name(string $parameter95Name): self + { + $this->options['parameter95Name'] = $parameter95Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter95Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter95Value(string $parameter95Value): self + { + $this->options['parameter95Value'] = $parameter95Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter96Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter96Name(string $parameter96Name): self + { + $this->options['parameter96Name'] = $parameter96Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter96Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter96Value(string $parameter96Value): self + { + $this->options['parameter96Value'] = $parameter96Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter97Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter97Name(string $parameter97Name): self + { + $this->options['parameter97Name'] = $parameter97Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter97Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter97Value(string $parameter97Value): self + { + $this->options['parameter97Value'] = $parameter97Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter98Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter98Name(string $parameter98Name): self + { + $this->options['parameter98Name'] = $parameter98Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter98Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter98Value(string $parameter98Value): self + { + $this->options['parameter98Value'] = $parameter98Value; + return $this; + } + + /** + * Parameter name + * + * @param string $parameter99Name Parameter name + * @return $this Fluent Builder + */ + public function setParameter99Name(string $parameter99Name): self + { + $this->options['parameter99Name'] = $parameter99Name; + return $this; + } + + /** + * Parameter value + * + * @param string $parameter99Value Parameter value + * @return $this Fluent Builder + */ + public function setParameter99Value(string $parameter99Value): self + { + $this->options['parameter99Value'] = $parameter99Value; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateStreamOptions ' . $options . ']'; + } +} + + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/StreamPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/StreamPage.php new file mode 100755 index 0000000..13c727a --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/StreamPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return StreamInstance \Twilio\Rest\Api\V2010\Account\Call\StreamInstance + */ + public function buildInstance(array $payload): StreamInstance + { + return new StreamInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['callSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.StreamPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageInstance.php new file mode 100755 index 0000000..dce699c --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageInstance.php @@ -0,0 +1,89 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'callSid' => Values::array_get($payload, 'call_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + ]; + + $this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.UserDefinedMessageInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageList.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageList.php new file mode 100755 index 0000000..fae4d6a --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageList.php @@ -0,0 +1,97 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'callSid' => + $callSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Calls/' . \rawurlencode($callSid) + .'/UserDefinedMessages.json'; + } + + /** + * Create the UserDefinedMessageInstance + * + * @param string $content The User Defined Message in the form of URL-encoded JSON string. + * @param array|Options $options Optional Arguments + * @return UserDefinedMessageInstance Created UserDefinedMessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $content, array $options = []): UserDefinedMessageInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Content' => + $content, + 'IdempotencyKey' => + $options['idempotencyKey'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new UserDefinedMessageInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['callSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.UserDefinedMessageList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageOptions.php new file mode 100755 index 0000000..e3a2f93 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageOptions.php @@ -0,0 +1,76 @@ +options['idempotencyKey'] = $idempotencyKey; + } + + /** + * A unique string value to identify API call. This should be a unique string value per API call and can be a randomly generated. + * + * @param string $idempotencyKey A unique string value to identify API call. This should be a unique string value per API call and can be a randomly generated. + * @return $this Fluent Builder + */ + public function setIdempotencyKey(string $idempotencyKey): self + { + $this->options['idempotencyKey'] = $idempotencyKey; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateUserDefinedMessageOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessagePage.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessagePage.php new file mode 100755 index 0000000..af2843c --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessagePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UserDefinedMessageInstance \Twilio\Rest\Api\V2010\Account\Call\UserDefinedMessageInstance + */ + public function buildInstance(array $payload): UserDefinedMessageInstance + { + return new UserDefinedMessageInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['callSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.UserDefinedMessagePage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionContext.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionContext.php new file mode 100755 index 0000000..d16e2d6 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionContext.php @@ -0,0 +1,85 @@ +solution = [ + 'accountSid' => + $accountSid, + 'callSid' => + $callSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Calls/' . \rawurlencode($callSid) + .'/UserDefinedMessageSubscriptions/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the UserDefinedMessageSubscriptionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.UserDefinedMessageSubscriptionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionInstance.php new file mode 100755 index 0000000..8a4e55f --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionInstance.php @@ -0,0 +1,128 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'callSid' => Values::array_get($payload, 'call_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'uri' => Values::array_get($payload, 'uri'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'callSid' => $callSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return UserDefinedMessageSubscriptionContext Context for this UserDefinedMessageSubscriptionInstance + */ + protected function proxy(): UserDefinedMessageSubscriptionContext + { + if (!$this->context) { + $this->context = new UserDefinedMessageSubscriptionContext( + $this->version, + $this->solution['accountSid'], + $this->solution['callSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the UserDefinedMessageSubscriptionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.UserDefinedMessageSubscriptionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionList.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionList.php new file mode 100755 index 0000000..acaf4e8 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionList.php @@ -0,0 +1,117 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'callSid' => + $callSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Calls/' . \rawurlencode($callSid) + .'/UserDefinedMessageSubscriptions.json'; + } + + /** + * Create the UserDefinedMessageSubscriptionInstance + * + * @param string $callback The URL we should call using the `method` to send user defined events to your application. URLs must contain a valid hostname (underscores are not permitted). + * @param array|Options $options Optional Arguments + * @return UserDefinedMessageSubscriptionInstance Created UserDefinedMessageSubscriptionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $callback, array $options = []): UserDefinedMessageSubscriptionInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Callback' => + $callback, + 'IdempotencyKey' => + $options['idempotencyKey'], + 'Method' => + $options['method'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new UserDefinedMessageSubscriptionInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['callSid'] + ); + } + + + /** + * Constructs a UserDefinedMessageSubscriptionContext + * + * @param string $sid The SID that uniquely identifies this User Defined Message Subscription. + */ + public function getContext( + string $sid + + ): UserDefinedMessageSubscriptionContext + { + return new UserDefinedMessageSubscriptionContext( + $this->version, + $this->solution['accountSid'], + $this->solution['callSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.UserDefinedMessageSubscriptionList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionOptions.php new file mode 100755 index 0000000..c6fa403 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionOptions.php @@ -0,0 +1,96 @@ +options['idempotencyKey'] = $idempotencyKey; + $this->options['method'] = $method; + } + + /** + * A unique string value to identify API call. This should be a unique string value per API call and can be a randomly generated. + * + * @param string $idempotencyKey A unique string value to identify API call. This should be a unique string value per API call and can be a randomly generated. + * @return $this Fluent Builder + */ + public function setIdempotencyKey(string $idempotencyKey): self + { + $this->options['idempotencyKey'] = $idempotencyKey; + return $this; + } + + /** + * The HTTP method Twilio will use when requesting the above `Url`. Either `GET` or `POST`. Default is `POST`. + * + * @param string $method The HTTP method Twilio will use when requesting the above `Url`. Either `GET` or `POST`. Default is `POST`. + * @return $this Fluent Builder + */ + public function setMethod(string $method): self + { + $this->options['method'] = $method; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateUserDefinedMessageSubscriptionOptions ' . $options . ']'; + } +} + + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionPage.php new file mode 100755 index 0000000..d1532cb --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Call/UserDefinedMessageSubscriptionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UserDefinedMessageSubscriptionInstance \Twilio\Rest\Api\V2010\Account\Call\UserDefinedMessageSubscriptionInstance + */ + public function buildInstance(array $payload): UserDefinedMessageSubscriptionInstance + { + return new UserDefinedMessageSubscriptionInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['callSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.UserDefinedMessageSubscriptionPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/CallContext.php b/app/api/Twilio/Rest/Api/V2010/Account/CallContext.php new file mode 100755 index 0000000..0b77154 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/CallContext.php @@ -0,0 +1,363 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Calls/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the CallInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the CallInstance + * + * @return CallInstance Fetched CallInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CallInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new CallInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the CallInstance + * + * @param array|Options $options Optional Arguments + * @return CallInstance Updated CallInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CallInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Url' => + $options['url'], + 'Method' => + $options['method'], + 'Status' => + $options['status'], + 'FallbackUrl' => + $options['fallbackUrl'], + 'FallbackMethod' => + $options['fallbackMethod'], + 'StatusCallback' => + $options['statusCallback'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'Twiml' => + $options['twiml'], + 'TimeLimit' => + $options['timeLimit'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new CallInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the recordings + */ + protected function getRecordings(): RecordingList + { + if (!$this->_recordings) { + $this->_recordings = new RecordingList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_recordings; + } + + /** + * Access the userDefinedMessageSubscriptions + */ + protected function getUserDefinedMessageSubscriptions(): UserDefinedMessageSubscriptionList + { + if (!$this->_userDefinedMessageSubscriptions) { + $this->_userDefinedMessageSubscriptions = new UserDefinedMessageSubscriptionList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_userDefinedMessageSubscriptions; + } + + /** + * Access the events + */ + protected function getEvents(): EventList + { + if (!$this->_events) { + $this->_events = new EventList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_events; + } + + /** + * Access the notifications + */ + protected function getNotifications(): NotificationList + { + if (!$this->_notifications) { + $this->_notifications = new NotificationList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_notifications; + } + + /** + * Access the userDefinedMessages + */ + protected function getUserDefinedMessages(): UserDefinedMessageList + { + if (!$this->_userDefinedMessages) { + $this->_userDefinedMessages = new UserDefinedMessageList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_userDefinedMessages; + } + + /** + * Access the siprec + */ + protected function getSiprec(): SiprecList + { + if (!$this->_siprec) { + $this->_siprec = new SiprecList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_siprec; + } + + /** + * Access the streams + */ + protected function getStreams(): StreamList + { + if (!$this->_streams) { + $this->_streams = new StreamList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_streams; + } + + /** + * Access the payments + */ + protected function getPayments(): PaymentList + { + if (!$this->_payments) { + $this->_payments = new PaymentList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_payments; + } + + /** + * Access the feedback + */ + protected function getFeedback(): FeedbackList + { + if (!$this->_feedback) { + $this->_feedback = new FeedbackList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_feedback; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.CallContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/CallInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/CallInstance.php new file mode 100755 index 0000000..3f05dfd --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/CallInstance.php @@ -0,0 +1,285 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'parentCallSid' => Values::array_get($payload, 'parent_call_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'to' => Values::array_get($payload, 'to'), + 'toFormatted' => Values::array_get($payload, 'to_formatted'), + 'from' => Values::array_get($payload, 'from'), + 'fromFormatted' => Values::array_get($payload, 'from_formatted'), + 'phoneNumberSid' => Values::array_get($payload, 'phone_number_sid'), + 'status' => Values::array_get($payload, 'status'), + 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), + 'endTime' => Deserialize::dateTime(Values::array_get($payload, 'end_time')), + 'duration' => Values::array_get($payload, 'duration'), + 'price' => Values::array_get($payload, 'price'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'direction' => Values::array_get($payload, 'direction'), + 'answeredBy' => Values::array_get($payload, 'answered_by'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'forwardedFrom' => Values::array_get($payload, 'forwarded_from'), + 'groupSid' => Values::array_get($payload, 'group_sid'), + 'callerName' => Values::array_get($payload, 'caller_name'), + 'queueTime' => Values::array_get($payload, 'queue_time'), + 'trunkSid' => Values::array_get($payload, 'trunk_sid'), + 'uri' => Values::array_get($payload, 'uri'), + 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CallContext Context for this CallInstance + */ + protected function proxy(): CallContext + { + if (!$this->context) { + $this->context = new CallContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the CallInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the CallInstance + * + * @return CallInstance Fetched CallInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CallInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the CallInstance + * + * @param array|Options $options Optional Arguments + * @return CallInstance Updated CallInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CallInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the recordings + */ + protected function getRecordings(): RecordingList + { + return $this->proxy()->recordings; + } + + /** + * Access the userDefinedMessageSubscriptions + */ + protected function getUserDefinedMessageSubscriptions(): UserDefinedMessageSubscriptionList + { + return $this->proxy()->userDefinedMessageSubscriptions; + } + + /** + * Access the events + */ + protected function getEvents(): EventList + { + return $this->proxy()->events; + } + + /** + * Access the notifications + */ + protected function getNotifications(): NotificationList + { + return $this->proxy()->notifications; + } + + /** + * Access the userDefinedMessages + */ + protected function getUserDefinedMessages(): UserDefinedMessageList + { + return $this->proxy()->userDefinedMessages; + } + + /** + * Access the siprec + */ + protected function getSiprec(): SiprecList + { + return $this->proxy()->siprec; + } + + /** + * Access the streams + */ + protected function getStreams(): StreamList + { + return $this->proxy()->streams; + } + + /** + * Access the payments + */ + protected function getPayments(): PaymentList + { + return $this->proxy()->payments; + } + + /** + * Access the feedback + */ + protected function getFeedback(): FeedbackList + { + return $this->proxy()->feedback; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.CallInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/CallList.php b/app/api/Twilio/Rest/Api/V2010/Account/CallList.php new file mode 100755 index 0000000..679445b --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/CallList.php @@ -0,0 +1,349 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Calls.json'; + } + + /** + * Create the CallInstance + * + * @param string $to The phone number, SIP address, or client identifier to call. + * @param string $from The phone number or client identifier to use as the caller id. If using a phone number, it must be a Twilio number or a Verified [outgoing caller id](https://www.twilio.com/docs/voice/api/outgoing-caller-ids) for your account. If the `to` parameter is a phone number, `From` must also be a phone number. + * @param array|Options $options Optional Arguments + * @return CallInstance Created CallInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $to, string $from, array $options = []): CallInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'To' => + $to, + 'From' => + $from, + 'Method' => + $options['method'], + 'FallbackUrl' => + $options['fallbackUrl'], + 'FallbackMethod' => + $options['fallbackMethod'], + 'StatusCallback' => + $options['statusCallback'], + 'StatusCallbackEvent' => + Serialize::map($options['statusCallbackEvent'], function ($e) { return $e; }), + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'SendDigits' => + $options['sendDigits'], + 'Timeout' => + $options['timeout'], + 'Record' => + Serialize::booleanToString($options['record']), + 'RecordingChannels' => + $options['recordingChannels'], + 'RecordingStatusCallback' => + $options['recordingStatusCallback'], + 'RecordingStatusCallbackMethod' => + $options['recordingStatusCallbackMethod'], + 'SipAuthUsername' => + $options['sipAuthUsername'], + 'SipAuthPassword' => + $options['sipAuthPassword'], + 'MachineDetection' => + $options['machineDetection'], + 'MachineDetectionTimeout' => + $options['machineDetectionTimeout'], + 'RecordingStatusCallbackEvent' => + Serialize::map($options['recordingStatusCallbackEvent'], function ($e) { return $e; }), + 'Trim' => + $options['trim'], + 'CallerId' => + $options['callerId'], + 'MachineDetectionSpeechThreshold' => + $options['machineDetectionSpeechThreshold'], + 'MachineDetectionSpeechEndThreshold' => + $options['machineDetectionSpeechEndThreshold'], + 'MachineDetectionSilenceTimeout' => + $options['machineDetectionSilenceTimeout'], + 'AsyncAmd' => + $options['asyncAmd'], + 'AsyncAmdStatusCallback' => + $options['asyncAmdStatusCallback'], + 'AsyncAmdStatusCallbackMethod' => + $options['asyncAmdStatusCallbackMethod'], + 'Byoc' => + $options['byoc'], + 'CallReason' => + $options['callReason'], + 'CallToken' => + $options['callToken'], + 'RecordingTrack' => + $options['recordingTrack'], + 'TimeLimit' => + $options['timeLimit'], + 'Url' => + $options['url'], + 'Twiml' => + $options['twiml'], + 'ApplicationSid' => + $options['applicationSid'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new CallInstance( + $this->version, + $payload, + $this->solution['accountSid'] + ); + } + + + /** + * Reads CallInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return CallInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams CallInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CallInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return CallPage Page of CallInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CallPage + { + $options = new Values($options); + + $params = Values::of([ + 'To' => + $options['to'], + 'From' => + $options['from'], + 'ParentCallSid' => + $options['parentCallSid'], + 'Status' => + $options['status'], + 'StartTime<' => + Serialize::iso8601DateTime($options['startTimeBefore']), + 'StartTime' => + Serialize::iso8601DateTime($options['startTime']), + 'StartTime>' => + Serialize::iso8601DateTime($options['startTimeAfter']), + 'EndTime<' => + Serialize::iso8601DateTime($options['endTimeBefore']), + 'EndTime' => + Serialize::iso8601DateTime($options['endTime']), + 'EndTime>' => + Serialize::iso8601DateTime($options['endTimeAfter']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new CallPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of CallInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return CallPage Page of CallInstance + */ + public function getPage(string $targetUrl): CallPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CallPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CallContext + * + * @param string $sid The Twilio-provided Call SID that uniquely identifies the Call resource to delete + */ + public function getContext( + string $sid + + ): CallContext + { + return new CallContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Access the feedbackSummaries + */ + protected function getFeedbackSummaries(): FeedbackSummaryList + { + if (!$this->_feedbackSummaries) { + $this->_feedbackSummaries = new FeedbackSummaryList( + $this->version, + $this->solution['accountSid'] + ); + } + return $this->_feedbackSummaries; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name) + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.CallList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/CallOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/CallOptions.php new file mode 100755 index 0000000..2d81c8f --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/CallOptions.php @@ -0,0 +1,1064 @@ +=YYYY-MM-DD` to read calls that started on or after midnight of this date. + * @param string $startTime Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + * @param string $startTimeAfter Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + * @param string $endTimeBefore Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + * @param string $endTime Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + * @param string $endTimeAfter Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + * @return ReadCallOptions Options builder + */ + public static function read( + + string $to = Values::NONE, + string $from = Values::NONE, + string $parentCallSid = Values::NONE, + string $status = Values::NONE, + string $startTimeBefore = null, + string $startTime = null, + string $startTimeAfter = null, + string $endTimeBefore = null, + string $endTime = null, + string $endTimeAfter = null + + ): ReadCallOptions + { + return new ReadCallOptions( + $to, + $from, + $parentCallSid, + $status, + $startTimeBefore, + $startTime, + $startTimeAfter, + $endTimeBefore, + $endTime, + $endTimeAfter + ); + } + + /** + * @param string $url The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls). + * @param string $method The HTTP method we should use when calling the `url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * @param string $status + * @param string $fallbackUrl The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored. + * @param string $fallbackMethod The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). + * @param string $statusCallbackMethod The HTTP method we should use when requesting the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * @param string $twiml TwiML instructions for the call Twilio will use without fetching Twiml from url. Twiml and url parameters are mutually exclusive + * @param int $timeLimit The maximum duration of the call in seconds. Constraints depend on account and configuration. + * @return UpdateCallOptions Options builder + */ + public static function update( + + string $url = Values::NONE, + string $method = Values::NONE, + string $status = Values::NONE, + string $fallbackUrl = Values::NONE, + string $fallbackMethod = Values::NONE, + string $statusCallback = Values::NONE, + string $statusCallbackMethod = Values::NONE, + string $twiml = Values::NONE, + int $timeLimit = Values::INT_NONE + + ): UpdateCallOptions + { + return new UpdateCallOptions( + $url, + $method, + $status, + $fallbackUrl, + $fallbackMethod, + $statusCallback, + $statusCallbackMethod, + $twiml, + $timeLimit + ); + } + +} + +class CreateCallOptions extends Options + { + /** + * @param string $url The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls). + * @param string $twiml TwiML instructions for the call Twilio will use without fetching Twiml from url parameter. If both `twiml` and `url` are provided then `twiml` parameter will be ignored. Max 4000 characters. + * @param string $applicationSid The SID of the Application resource that will handle the call, if the call will be handled by an application. + * @param string $method The HTTP method we should use when calling the `url` parameter's value. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * @param string $fallbackUrl The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored. + * @param string $fallbackMethod The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). + * @param string[] $statusCallbackEvent The call progress events that we will send to the `status_callback` URL. Can be: `initiated`, `ringing`, `answered`, and `completed`. If no event is specified, we send the `completed` status. If you want to receive multiple events, specify each one in a separate `status_callback_event` parameter. See the code sample for [monitoring call progress](https://www.twilio.com/docs/voice/api/call-resource?code-sample=code-create-a-call-resource-and-specify-a-statuscallbackevent&code-sdk-version=json). If an `application_sid` is present, this parameter is ignored. + * @param string $statusCallbackMethod The HTTP method we should use when calling the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * @param string $sendDigits A string of keys to dial after connecting to the number, maximum of 32 digits. Valid digits in the string include: any digit (`0`-`9`), '`#`', '`*`' and '`w`', to insert a half second pause. For example, if you connected to a company phone number and wanted to pause for one second, and then dial extension 1234 followed by the pound key, the value of this parameter would be `ww1234#`. Remember to URL-encode this string, since the '`#`' character has special meaning in a URL. If both `SendDigits` and `MachineDetection` parameters are provided, then `MachineDetection` will be ignored. + * @param int $timeout The integer number of seconds that we should allow the phone to ring before assuming there is no answer. The default is `60` seconds and the maximum is `600` seconds. For some call flows, we will add a 5-second buffer to the timeout value you provide. For this reason, a timeout value of 10 seconds could result in an actual timeout closer to 15 seconds. You can set this to a short time, such as `15` seconds, to hang up before reaching an answering machine or voicemail. + * @param bool $record Whether to record the call. Can be `true` to record the phone call, or `false` to not. The default is `false`. The `recording_url` is sent to the `status_callback` URL. + * @param string $recordingChannels The number of channels in the final recording. Can be: `mono` or `dual`. The default is `mono`. `mono` records both legs of the call in a single channel of the recording file. `dual` records each leg to a separate channel of the recording file. The first channel of a dual-channel recording contains the parent call and the second channel contains the child call. + * @param string $recordingStatusCallback The URL that we call when the recording is available to be accessed. + * @param string $recordingStatusCallbackMethod The HTTP method we should use when calling the `recording_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. + * @param string $sipAuthUsername The username used to authenticate the caller making a SIP call. + * @param string $sipAuthPassword The password required to authenticate the user account specified in `sip_auth_username`. + * @param string $machineDetection Whether to detect if a human, answering machine, or fax has picked up the call. Can be: `Enable` or `DetectMessageEnd`. Use `Enable` if you would like us to return `AnsweredBy` as soon as the called party is identified. Use `DetectMessageEnd`, if you would like to leave a message on an answering machine. If `send_digits` is provided, this parameter is ignored. For more information, see [Answering Machine Detection](https://www.twilio.com/docs/voice/answering-machine-detection). + * @param int $machineDetectionTimeout The number of seconds that we should attempt to detect an answering machine before timing out and sending a voice request with `AnsweredBy` of `unknown`. The default timeout is 30 seconds. + * @param string[] $recordingStatusCallbackEvent The recording status events that will trigger calls to the URL specified in `recording_status_callback`. Can be: `in-progress`, `completed` and `absent`. Defaults to `completed`. Separate multiple values with a space. + * @param string $trim Whether to trim any leading and trailing silence from the recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`. + * @param string $callerId The phone number, SIP address, or Client identifier that made this call. Phone numbers are in [E.164 format](https://wwnw.twilio.com/docs/glossary/what-e164) (e.g., +16175551212). SIP addresses are formatted as `name@company.com`. + * @param int $machineDetectionSpeechThreshold The number of milliseconds that is used as the measuring stick for the length of the speech activity, where durations lower than this value will be interpreted as a human and longer than this value as a machine. Possible Values: 1000-6000. Default: 2400. + * @param int $machineDetectionSpeechEndThreshold The number of milliseconds of silence after speech activity at which point the speech activity is considered complete. Possible Values: 500-5000. Default: 1200. + * @param int $machineDetectionSilenceTimeout The number of milliseconds of initial silence after which an `unknown` AnsweredBy result will be returned. Possible Values: 2000-10000. Default: 5000. + * @param string $asyncAmd Select whether to perform answering machine detection in the background. Default, blocks the execution of the call until Answering Machine Detection is completed. Can be: `true` or `false`. + * @param string $asyncAmdStatusCallback The URL that we should call using the `async_amd_status_callback_method` to notify customer application whether the call was answered by human, machine or fax. + * @param string $asyncAmdStatusCallbackMethod The HTTP method we should use when calling the `async_amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. + * @param string $byoc The SID of a BYOC (Bring Your Own Carrier) trunk to route this call with. Note that `byoc` is only meaningful when `to` is a phone number; it will otherwise be ignored. (Beta) + * @param string $callReason The Reason for the outgoing call. Use it to specify the purpose of the call that is presented on the called party's phone. (Branded Calls Beta) + * @param string $callToken A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call's call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call. + * @param string $recordingTrack The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is generated from Twilio. `both` records the audio that is received and generated by Twilio. + * @param int $timeLimit The maximum duration of the call in seconds. Constraints depend on account and configuration. + */ + public function __construct( + + string $url = Values::NONE, + string $twiml = Values::NONE, + string $applicationSid = Values::NONE, + string $method = Values::NONE, + string $fallbackUrl = Values::NONE, + string $fallbackMethod = Values::NONE, + string $statusCallback = Values::NONE, + array $statusCallbackEvent = Values::ARRAY_NONE, + string $statusCallbackMethod = Values::NONE, + string $sendDigits = Values::NONE, + int $timeout = Values::INT_NONE, + bool $record = Values::BOOL_NONE, + string $recordingChannels = Values::NONE, + string $recordingStatusCallback = Values::NONE, + string $recordingStatusCallbackMethod = Values::NONE, + string $sipAuthUsername = Values::NONE, + string $sipAuthPassword = Values::NONE, + string $machineDetection = Values::NONE, + int $machineDetectionTimeout = Values::INT_NONE, + array $recordingStatusCallbackEvent = Values::ARRAY_NONE, + string $trim = Values::NONE, + string $callerId = Values::NONE, + int $machineDetectionSpeechThreshold = Values::INT_NONE, + int $machineDetectionSpeechEndThreshold = Values::INT_NONE, + int $machineDetectionSilenceTimeout = Values::INT_NONE, + string $asyncAmd = Values::NONE, + string $asyncAmdStatusCallback = Values::NONE, + string $asyncAmdStatusCallbackMethod = Values::NONE, + string $byoc = Values::NONE, + string $callReason = Values::NONE, + string $callToken = Values::NONE, + string $recordingTrack = Values::NONE, + int $timeLimit = Values::INT_NONE + + ) { + $this->options['url'] = $url; + $this->options['twiml'] = $twiml; + $this->options['applicationSid'] = $applicationSid; + $this->options['method'] = $method; + $this->options['fallbackUrl'] = $fallbackUrl; + $this->options['fallbackMethod'] = $fallbackMethod; + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackEvent'] = $statusCallbackEvent; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['sendDigits'] = $sendDigits; + $this->options['timeout'] = $timeout; + $this->options['record'] = $record; + $this->options['recordingChannels'] = $recordingChannels; + $this->options['recordingStatusCallback'] = $recordingStatusCallback; + $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; + $this->options['sipAuthUsername'] = $sipAuthUsername; + $this->options['sipAuthPassword'] = $sipAuthPassword; + $this->options['machineDetection'] = $machineDetection; + $this->options['machineDetectionTimeout'] = $machineDetectionTimeout; + $this->options['recordingStatusCallbackEvent'] = $recordingStatusCallbackEvent; + $this->options['trim'] = $trim; + $this->options['callerId'] = $callerId; + $this->options['machineDetectionSpeechThreshold'] = $machineDetectionSpeechThreshold; + $this->options['machineDetectionSpeechEndThreshold'] = $machineDetectionSpeechEndThreshold; + $this->options['machineDetectionSilenceTimeout'] = $machineDetectionSilenceTimeout; + $this->options['asyncAmd'] = $asyncAmd; + $this->options['asyncAmdStatusCallback'] = $asyncAmdStatusCallback; + $this->options['asyncAmdStatusCallbackMethod'] = $asyncAmdStatusCallbackMethod; + $this->options['byoc'] = $byoc; + $this->options['callReason'] = $callReason; + $this->options['callToken'] = $callToken; + $this->options['recordingTrack'] = $recordingTrack; + $this->options['timeLimit'] = $timeLimit; + } + + /** + * The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls). + * + * @param string $url The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls). + * @return $this Fluent Builder + */ + public function setUrl(string $url): self + { + $this->options['url'] = $url; + return $this; + } + + /** + * TwiML instructions for the call Twilio will use without fetching Twiml from url parameter. If both `twiml` and `url` are provided then `twiml` parameter will be ignored. Max 4000 characters. + * + * @param string $twiml TwiML instructions for the call Twilio will use without fetching Twiml from url parameter. If both `twiml` and `url` are provided then `twiml` parameter will be ignored. Max 4000 characters. + * @return $this Fluent Builder + */ + public function setTwiml(string $twiml): self + { + $this->options['twiml'] = $twiml; + return $this; + } + + /** + * The SID of the Application resource that will handle the call, if the call will be handled by an application. + * + * @param string $applicationSid The SID of the Application resource that will handle the call, if the call will be handled by an application. + * @return $this Fluent Builder + */ + public function setApplicationSid(string $applicationSid): self + { + $this->options['applicationSid'] = $applicationSid; + return $this; + } + + /** + * The HTTP method we should use when calling the `url` parameter's value. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * + * @param string $method The HTTP method we should use when calling the `url` parameter's value. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * @return $this Fluent Builder + */ + public function setMethod(string $method): self + { + $this->options['method'] = $method; + return $this; + } + + /** + * The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored. + * + * @param string $fallbackUrl The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored. + * @return $this Fluent Builder + */ + public function setFallbackUrl(string $fallbackUrl): self + { + $this->options['fallbackUrl'] = $fallbackUrl; + return $this; + } + + /** + * The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * + * @param string $fallbackMethod The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * @return $this Fluent Builder + */ + public function setFallbackMethod(string $fallbackMethod): self + { + $this->options['fallbackMethod'] = $fallbackMethod; + return $this; + } + + /** + * The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). + * + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The call progress events that we will send to the `status_callback` URL. Can be: `initiated`, `ringing`, `answered`, and `completed`. If no event is specified, we send the `completed` status. If you want to receive multiple events, specify each one in a separate `status_callback_event` parameter. See the code sample for [monitoring call progress](https://www.twilio.com/docs/voice/api/call-resource?code-sample=code-create-a-call-resource-and-specify-a-statuscallbackevent&code-sdk-version=json). If an `application_sid` is present, this parameter is ignored. + * + * @param string[] $statusCallbackEvent The call progress events that we will send to the `status_callback` URL. Can be: `initiated`, `ringing`, `answered`, and `completed`. If no event is specified, we send the `completed` status. If you want to receive multiple events, specify each one in a separate `status_callback_event` parameter. See the code sample for [monitoring call progress](https://www.twilio.com/docs/voice/api/call-resource?code-sample=code-create-a-call-resource-and-specify-a-statuscallbackevent&code-sdk-version=json). If an `application_sid` is present, this parameter is ignored. + * @return $this Fluent Builder + */ + public function setStatusCallbackEvent(array $statusCallbackEvent): self + { + $this->options['statusCallbackEvent'] = $statusCallbackEvent; + return $this; + } + + /** + * The HTTP method we should use when calling the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * + * @param string $statusCallbackMethod The HTTP method we should use when calling the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * A string of keys to dial after connecting to the number, maximum of 32 digits. Valid digits in the string include: any digit (`0`-`9`), '`#`', '`*`' and '`w`', to insert a half second pause. For example, if you connected to a company phone number and wanted to pause for one second, and then dial extension 1234 followed by the pound key, the value of this parameter would be `ww1234#`. Remember to URL-encode this string, since the '`#`' character has special meaning in a URL. If both `SendDigits` and `MachineDetection` parameters are provided, then `MachineDetection` will be ignored. + * + * @param string $sendDigits A string of keys to dial after connecting to the number, maximum of 32 digits. Valid digits in the string include: any digit (`0`-`9`), '`#`', '`*`' and '`w`', to insert a half second pause. For example, if you connected to a company phone number and wanted to pause for one second, and then dial extension 1234 followed by the pound key, the value of this parameter would be `ww1234#`. Remember to URL-encode this string, since the '`#`' character has special meaning in a URL. If both `SendDigits` and `MachineDetection` parameters are provided, then `MachineDetection` will be ignored. + * @return $this Fluent Builder + */ + public function setSendDigits(string $sendDigits): self + { + $this->options['sendDigits'] = $sendDigits; + return $this; + } + + /** + * The integer number of seconds that we should allow the phone to ring before assuming there is no answer. The default is `60` seconds and the maximum is `600` seconds. For some call flows, we will add a 5-second buffer to the timeout value you provide. For this reason, a timeout value of 10 seconds could result in an actual timeout closer to 15 seconds. You can set this to a short time, such as `15` seconds, to hang up before reaching an answering machine or voicemail. + * + * @param int $timeout The integer number of seconds that we should allow the phone to ring before assuming there is no answer. The default is `60` seconds and the maximum is `600` seconds. For some call flows, we will add a 5-second buffer to the timeout value you provide. For this reason, a timeout value of 10 seconds could result in an actual timeout closer to 15 seconds. You can set this to a short time, such as `15` seconds, to hang up before reaching an answering machine or voicemail. + * @return $this Fluent Builder + */ + public function setTimeout(int $timeout): self + { + $this->options['timeout'] = $timeout; + return $this; + } + + /** + * Whether to record the call. Can be `true` to record the phone call, or `false` to not. The default is `false`. The `recording_url` is sent to the `status_callback` URL. + * + * @param bool $record Whether to record the call. Can be `true` to record the phone call, or `false` to not. The default is `false`. The `recording_url` is sent to the `status_callback` URL. + * @return $this Fluent Builder + */ + public function setRecord(bool $record): self + { + $this->options['record'] = $record; + return $this; + } + + /** + * The number of channels in the final recording. Can be: `mono` or `dual`. The default is `mono`. `mono` records both legs of the call in a single channel of the recording file. `dual` records each leg to a separate channel of the recording file. The first channel of a dual-channel recording contains the parent call and the second channel contains the child call. + * + * @param string $recordingChannels The number of channels in the final recording. Can be: `mono` or `dual`. The default is `mono`. `mono` records both legs of the call in a single channel of the recording file. `dual` records each leg to a separate channel of the recording file. The first channel of a dual-channel recording contains the parent call and the second channel contains the child call. + * @return $this Fluent Builder + */ + public function setRecordingChannels(string $recordingChannels): self + { + $this->options['recordingChannels'] = $recordingChannels; + return $this; + } + + /** + * The URL that we call when the recording is available to be accessed. + * + * @param string $recordingStatusCallback The URL that we call when the recording is available to be accessed. + * @return $this Fluent Builder + */ + public function setRecordingStatusCallback(string $recordingStatusCallback): self + { + $this->options['recordingStatusCallback'] = $recordingStatusCallback; + return $this; + } + + /** + * The HTTP method we should use when calling the `recording_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. + * + * @param string $recordingStatusCallbackMethod The HTTP method we should use when calling the `recording_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. + * @return $this Fluent Builder + */ + public function setRecordingStatusCallbackMethod(string $recordingStatusCallbackMethod): self + { + $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; + return $this; + } + + /** + * The username used to authenticate the caller making a SIP call. + * + * @param string $sipAuthUsername The username used to authenticate the caller making a SIP call. + * @return $this Fluent Builder + */ + public function setSipAuthUsername(string $sipAuthUsername): self + { + $this->options['sipAuthUsername'] = $sipAuthUsername; + return $this; + } + + /** + * The password required to authenticate the user account specified in `sip_auth_username`. + * + * @param string $sipAuthPassword The password required to authenticate the user account specified in `sip_auth_username`. + * @return $this Fluent Builder + */ + public function setSipAuthPassword(string $sipAuthPassword): self + { + $this->options['sipAuthPassword'] = $sipAuthPassword; + return $this; + } + + /** + * Whether to detect if a human, answering machine, or fax has picked up the call. Can be: `Enable` or `DetectMessageEnd`. Use `Enable` if you would like us to return `AnsweredBy` as soon as the called party is identified. Use `DetectMessageEnd`, if you would like to leave a message on an answering machine. If `send_digits` is provided, this parameter is ignored. For more information, see [Answering Machine Detection](https://www.twilio.com/docs/voice/answering-machine-detection). + * + * @param string $machineDetection Whether to detect if a human, answering machine, or fax has picked up the call. Can be: `Enable` or `DetectMessageEnd`. Use `Enable` if you would like us to return `AnsweredBy` as soon as the called party is identified. Use `DetectMessageEnd`, if you would like to leave a message on an answering machine. If `send_digits` is provided, this parameter is ignored. For more information, see [Answering Machine Detection](https://www.twilio.com/docs/voice/answering-machine-detection). + * @return $this Fluent Builder + */ + public function setMachineDetection(string $machineDetection): self + { + $this->options['machineDetection'] = $machineDetection; + return $this; + } + + /** + * The number of seconds that we should attempt to detect an answering machine before timing out and sending a voice request with `AnsweredBy` of `unknown`. The default timeout is 30 seconds. + * + * @param int $machineDetectionTimeout The number of seconds that we should attempt to detect an answering machine before timing out and sending a voice request with `AnsweredBy` of `unknown`. The default timeout is 30 seconds. + * @return $this Fluent Builder + */ + public function setMachineDetectionTimeout(int $machineDetectionTimeout): self + { + $this->options['machineDetectionTimeout'] = $machineDetectionTimeout; + return $this; + } + + /** + * The recording status events that will trigger calls to the URL specified in `recording_status_callback`. Can be: `in-progress`, `completed` and `absent`. Defaults to `completed`. Separate multiple values with a space. + * + * @param string[] $recordingStatusCallbackEvent The recording status events that will trigger calls to the URL specified in `recording_status_callback`. Can be: `in-progress`, `completed` and `absent`. Defaults to `completed`. Separate multiple values with a space. + * @return $this Fluent Builder + */ + public function setRecordingStatusCallbackEvent(array $recordingStatusCallbackEvent): self + { + $this->options['recordingStatusCallbackEvent'] = $recordingStatusCallbackEvent; + return $this; + } + + /** + * Whether to trim any leading and trailing silence from the recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`. + * + * @param string $trim Whether to trim any leading and trailing silence from the recording. Can be: `trim-silence` or `do-not-trim` and the default is `trim-silence`. + * @return $this Fluent Builder + */ + public function setTrim(string $trim): self + { + $this->options['trim'] = $trim; + return $this; + } + + /** + * The phone number, SIP address, or Client identifier that made this call. Phone numbers are in [E.164 format](https://wwnw.twilio.com/docs/glossary/what-e164) (e.g., +16175551212). SIP addresses are formatted as `name@company.com`. + * + * @param string $callerId The phone number, SIP address, or Client identifier that made this call. Phone numbers are in [E.164 format](https://wwnw.twilio.com/docs/glossary/what-e164) (e.g., +16175551212). SIP addresses are formatted as `name@company.com`. + * @return $this Fluent Builder + */ + public function setCallerId(string $callerId): self + { + $this->options['callerId'] = $callerId; + return $this; + } + + /** + * The number of milliseconds that is used as the measuring stick for the length of the speech activity, where durations lower than this value will be interpreted as a human and longer than this value as a machine. Possible Values: 1000-6000. Default: 2400. + * + * @param int $machineDetectionSpeechThreshold The number of milliseconds that is used as the measuring stick for the length of the speech activity, where durations lower than this value will be interpreted as a human and longer than this value as a machine. Possible Values: 1000-6000. Default: 2400. + * @return $this Fluent Builder + */ + public function setMachineDetectionSpeechThreshold(int $machineDetectionSpeechThreshold): self + { + $this->options['machineDetectionSpeechThreshold'] = $machineDetectionSpeechThreshold; + return $this; + } + + /** + * The number of milliseconds of silence after speech activity at which point the speech activity is considered complete. Possible Values: 500-5000. Default: 1200. + * + * @param int $machineDetectionSpeechEndThreshold The number of milliseconds of silence after speech activity at which point the speech activity is considered complete. Possible Values: 500-5000. Default: 1200. + * @return $this Fluent Builder + */ + public function setMachineDetectionSpeechEndThreshold(int $machineDetectionSpeechEndThreshold): self + { + $this->options['machineDetectionSpeechEndThreshold'] = $machineDetectionSpeechEndThreshold; + return $this; + } + + /** + * The number of milliseconds of initial silence after which an `unknown` AnsweredBy result will be returned. Possible Values: 2000-10000. Default: 5000. + * + * @param int $machineDetectionSilenceTimeout The number of milliseconds of initial silence after which an `unknown` AnsweredBy result will be returned. Possible Values: 2000-10000. Default: 5000. + * @return $this Fluent Builder + */ + public function setMachineDetectionSilenceTimeout(int $machineDetectionSilenceTimeout): self + { + $this->options['machineDetectionSilenceTimeout'] = $machineDetectionSilenceTimeout; + return $this; + } + + /** + * Select whether to perform answering machine detection in the background. Default, blocks the execution of the call until Answering Machine Detection is completed. Can be: `true` or `false`. + * + * @param string $asyncAmd Select whether to perform answering machine detection in the background. Default, blocks the execution of the call until Answering Machine Detection is completed. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setAsyncAmd(string $asyncAmd): self + { + $this->options['asyncAmd'] = $asyncAmd; + return $this; + } + + /** + * The URL that we should call using the `async_amd_status_callback_method` to notify customer application whether the call was answered by human, machine or fax. + * + * @param string $asyncAmdStatusCallback The URL that we should call using the `async_amd_status_callback_method` to notify customer application whether the call was answered by human, machine or fax. + * @return $this Fluent Builder + */ + public function setAsyncAmdStatusCallback(string $asyncAmdStatusCallback): self + { + $this->options['asyncAmdStatusCallback'] = $asyncAmdStatusCallback; + return $this; + } + + /** + * The HTTP method we should use when calling the `async_amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. + * + * @param string $asyncAmdStatusCallbackMethod The HTTP method we should use when calling the `async_amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. + * @return $this Fluent Builder + */ + public function setAsyncAmdStatusCallbackMethod(string $asyncAmdStatusCallbackMethod): self + { + $this->options['asyncAmdStatusCallbackMethod'] = $asyncAmdStatusCallbackMethod; + return $this; + } + + /** + * The SID of a BYOC (Bring Your Own Carrier) trunk to route this call with. Note that `byoc` is only meaningful when `to` is a phone number; it will otherwise be ignored. (Beta) + * + * @param string $byoc The SID of a BYOC (Bring Your Own Carrier) trunk to route this call with. Note that `byoc` is only meaningful when `to` is a phone number; it will otherwise be ignored. (Beta) + * @return $this Fluent Builder + */ + public function setByoc(string $byoc): self + { + $this->options['byoc'] = $byoc; + return $this; + } + + /** + * The Reason for the outgoing call. Use it to specify the purpose of the call that is presented on the called party's phone. (Branded Calls Beta) + * + * @param string $callReason The Reason for the outgoing call. Use it to specify the purpose of the call that is presented on the called party's phone. (Branded Calls Beta) + * @return $this Fluent Builder + */ + public function setCallReason(string $callReason): self + { + $this->options['callReason'] = $callReason; + return $this; + } + + /** + * A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call's call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call. + * + * @param string $callToken A token string needed to invoke a forwarded call. A call_token is generated when an incoming call is received on a Twilio number. Pass an incoming call's call_token value to a forwarded call via the call_token parameter when creating a new call. A forwarded call should bear the same CallerID of the original incoming call. + * @return $this Fluent Builder + */ + public function setCallToken(string $callToken): self + { + $this->options['callToken'] = $callToken; + return $this; + } + + /** + * The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is generated from Twilio. `both` records the audio that is received and generated by Twilio. + * + * @param string $recordingTrack The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is generated from Twilio. `both` records the audio that is received and generated by Twilio. + * @return $this Fluent Builder + */ + public function setRecordingTrack(string $recordingTrack): self + { + $this->options['recordingTrack'] = $recordingTrack; + return $this; + } + + /** + * The maximum duration of the call in seconds. Constraints depend on account and configuration. + * + * @param int $timeLimit The maximum duration of the call in seconds. Constraints depend on account and configuration. + * @return $this Fluent Builder + */ + public function setTimeLimit(int $timeLimit): self + { + $this->options['timeLimit'] = $timeLimit; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateCallOptions ' . $options . ']'; + } +} + + + +class ReadCallOptions extends Options + { + /** + * @param string $to Only show calls made to this phone number, SIP address, Client identifier or SIM SID. + * @param string $from Only include calls from this phone number, SIP address, Client identifier or SIM SID. + * @param string $parentCallSid Only include calls spawned by calls with this SID. + * @param string $status The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. + * @param string $startTimeBefore Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + * @param string $startTime Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + * @param string $startTimeAfter Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + * @param string $endTimeBefore Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + * @param string $endTime Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + * @param string $endTimeAfter Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + */ + public function __construct( + + string $to = Values::NONE, + string $from = Values::NONE, + string $parentCallSid = Values::NONE, + string $status = Values::NONE, + string $startTimeBefore = null, + string $startTime = null, + string $startTimeAfter = null, + string $endTimeBefore = null, + string $endTime = null, + string $endTimeAfter = null + + ) { + $this->options['to'] = $to; + $this->options['from'] = $from; + $this->options['parentCallSid'] = $parentCallSid; + $this->options['status'] = $status; + $this->options['startTimeBefore'] = $startTimeBefore; + $this->options['startTime'] = $startTime; + $this->options['startTimeAfter'] = $startTimeAfter; + $this->options['endTimeBefore'] = $endTimeBefore; + $this->options['endTime'] = $endTime; + $this->options['endTimeAfter'] = $endTimeAfter; + } + + /** + * Only show calls made to this phone number, SIP address, Client identifier or SIM SID. + * + * @param string $to Only show calls made to this phone number, SIP address, Client identifier or SIM SID. + * @return $this Fluent Builder + */ + public function setTo(string $to): self + { + $this->options['to'] = $to; + return $this; + } + + /** + * Only include calls from this phone number, SIP address, Client identifier or SIM SID. + * + * @param string $from Only include calls from this phone number, SIP address, Client identifier or SIM SID. + * @return $this Fluent Builder + */ + public function setFrom(string $from): self + { + $this->options['from'] = $from; + return $this; + } + + /** + * Only include calls spawned by calls with this SID. + * + * @param string $parentCallSid Only include calls spawned by calls with this SID. + * @return $this Fluent Builder + */ + public function setParentCallSid(string $parentCallSid): self + { + $this->options['parentCallSid'] = $parentCallSid; + return $this; + } + + /** + * The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. + * + * @param string $status The status of the calls to include. Can be: `queued`, `ringing`, `in-progress`, `canceled`, `completed`, `failed`, `busy`, or `no-answer`. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + * + * @param string $startTimeBefore Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + * @return $this Fluent Builder + */ + public function setStartTimeBefore(string $startTimeBefore): self + { + $this->options['startTimeBefore'] = $startTimeBefore; + return $this; + } + + /** + * Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + * + * @param string $startTime Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + * @return $this Fluent Builder + */ + public function setStartTime(string $startTime): self + { + $this->options['startTime'] = $startTime; + return $this; + } + + /** + * Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + * + * @param string $startTimeAfter Only include calls that started on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that started on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read calls that started on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read calls that started on or after midnight of this date. + * @return $this Fluent Builder + */ + public function setStartTimeAfter(string $startTimeAfter): self + { + $this->options['startTimeAfter'] = $startTimeAfter; + return $this; + } + + /** + * Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + * + * @param string $endTimeBefore Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + * @return $this Fluent Builder + */ + public function setEndTimeBefore(string $endTimeBefore): self + { + $this->options['endTimeBefore'] = $endTimeBefore; + return $this; + } + + /** + * Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + * + * @param string $endTime Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + * @return $this Fluent Builder + */ + public function setEndTime(string $endTime): self + { + $this->options['endTime'] = $endTime; + return $this; + } + + /** + * Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + * + * @param string $endTimeAfter Only include calls that ended on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read only calls that ended on this date. You can also specify an inequality, such as `EndTime<=YYYY-MM-DD`, to read calls that ended on or before midnight of this date, and `EndTime>=YYYY-MM-DD` to read calls that ended on or after midnight of this date. + * @return $this Fluent Builder + */ + public function setEndTimeAfter(string $endTimeAfter): self + { + $this->options['endTimeAfter'] = $endTimeAfter; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadCallOptions ' . $options . ']'; + } +} + +class UpdateCallOptions extends Options + { + /** + * @param string $url The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls). + * @param string $method The HTTP method we should use when calling the `url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * @param string $status + * @param string $fallbackUrl The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored. + * @param string $fallbackMethod The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). + * @param string $statusCallbackMethod The HTTP method we should use when requesting the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * @param string $twiml TwiML instructions for the call Twilio will use without fetching Twiml from url. Twiml and url parameters are mutually exclusive + * @param int $timeLimit The maximum duration of the call in seconds. Constraints depend on account and configuration. + */ + public function __construct( + + string $url = Values::NONE, + string $method = Values::NONE, + string $status = Values::NONE, + string $fallbackUrl = Values::NONE, + string $fallbackMethod = Values::NONE, + string $statusCallback = Values::NONE, + string $statusCallbackMethod = Values::NONE, + string $twiml = Values::NONE, + int $timeLimit = Values::INT_NONE + + ) { + $this->options['url'] = $url; + $this->options['method'] = $method; + $this->options['status'] = $status; + $this->options['fallbackUrl'] = $fallbackUrl; + $this->options['fallbackMethod'] = $fallbackMethod; + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['twiml'] = $twiml; + $this->options['timeLimit'] = $timeLimit; + } + + /** + * The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls). + * + * @param string $url The absolute URL that returns the TwiML instructions for the call. We will call this URL using the `method` when the call connects. For more information, see the [Url Parameter](https://www.twilio.com/docs/voice/make-calls#specify-a-url-parameter) section in [Making Calls](https://www.twilio.com/docs/voice/make-calls). + * @return $this Fluent Builder + */ + public function setUrl(string $url): self + { + $this->options['url'] = $url; + return $this; + } + + /** + * The HTTP method we should use when calling the `url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * + * @param string $method The HTTP method we should use when calling the `url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * @return $this Fluent Builder + */ + public function setMethod(string $method): self + { + $this->options['method'] = $method; + return $this; + } + + /** + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored. + * + * @param string $fallbackUrl The URL that we call using the `fallback_method` if an error occurs when requesting or executing the TwiML at `url`. If an `application_sid` parameter is present, this parameter is ignored. + * @return $this Fluent Builder + */ + public function setFallbackUrl(string $fallbackUrl): self + { + $this->options['fallbackUrl'] = $fallbackUrl; + return $this; + } + + /** + * The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * + * @param string $fallbackMethod The HTTP method that we should use to request the `fallback_url`. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * @return $this Fluent Builder + */ + public function setFallbackMethod(string $fallbackMethod): self + { + $this->options['fallbackMethod'] = $fallbackMethod; + return $this; + } + + /** + * The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). + * + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. If no `status_callback_event` is specified, we will send the `completed` status. If an `application_sid` parameter is present, this parameter is ignored. URLs must contain a valid hostname (underscores are not permitted). + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The HTTP method we should use when requesting the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * + * @param string $statusCallbackMethod The HTTP method we should use when requesting the `status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. If an `application_sid` parameter is present, this parameter is ignored. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * TwiML instructions for the call Twilio will use without fetching Twiml from url. Twiml and url parameters are mutually exclusive + * + * @param string $twiml TwiML instructions for the call Twilio will use without fetching Twiml from url. Twiml and url parameters are mutually exclusive + * @return $this Fluent Builder + */ + public function setTwiml(string $twiml): self + { + $this->options['twiml'] = $twiml; + return $this; + } + + /** + * The maximum duration of the call in seconds. Constraints depend on account and configuration. + * + * @param int $timeLimit The maximum duration of the call in seconds. Constraints depend on account and configuration. + * @return $this Fluent Builder + */ + public function setTimeLimit(int $timeLimit): self + { + $this->options['timeLimit'] = $timeLimit; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateCallOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/CallPage.php b/app/api/Twilio/Rest/Api/V2010/Account/CallPage.php new file mode 100755 index 0000000..a550268 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/CallPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CallInstance \Twilio\Rest\Api\V2010\Account\CallInstance + */ + public function buildInstance(array $payload): CallInstance + { + return new CallInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.CallPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Conference/ParticipantContext.php b/app/api/Twilio/Rest/Api/V2010/Account/Conference/ParticipantContext.php new file mode 100755 index 0000000..9382af4 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Conference/ParticipantContext.php @@ -0,0 +1,160 @@ +solution = [ + 'accountSid' => + $accountSid, + 'conferenceSid' => + $conferenceSid, + 'callSid' => + $callSid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Conferences/' . \rawurlencode($conferenceSid) + .'/Participants/' . \rawurlencode($callSid) + .'.json'; + } + + /** + * Delete the ParticipantInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the ParticipantInstance + * + * @return ParticipantInstance Fetched ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ParticipantInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ParticipantInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['conferenceSid'], + $this->solution['callSid'] + ); + } + + + /** + * Update the ParticipantInstance + * + * @param array|Options $options Optional Arguments + * @return ParticipantInstance Updated ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ParticipantInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Muted' => + Serialize::booleanToString($options['muted']), + 'Hold' => + Serialize::booleanToString($options['hold']), + 'HoldUrl' => + $options['holdUrl'], + 'HoldMethod' => + $options['holdMethod'], + 'AnnounceUrl' => + $options['announceUrl'], + 'AnnounceMethod' => + $options['announceMethod'], + 'WaitUrl' => + $options['waitUrl'], + 'WaitMethod' => + $options['waitMethod'], + 'BeepOnExit' => + Serialize::booleanToString($options['beepOnExit']), + 'EndConferenceOnExit' => + Serialize::booleanToString($options['endConferenceOnExit']), + 'Coaching' => + Serialize::booleanToString($options['coaching']), + 'CallSidToCoach' => + $options['callSidToCoach'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new ParticipantInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['conferenceSid'], + $this->solution['callSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.ParticipantContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Conference/ParticipantInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Conference/ParticipantInstance.php new file mode 100755 index 0000000..e736215 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Conference/ParticipantInstance.php @@ -0,0 +1,172 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'callSid' => Values::array_get($payload, 'call_sid'), + 'label' => Values::array_get($payload, 'label'), + 'callSidToCoach' => Values::array_get($payload, 'call_sid_to_coach'), + 'coaching' => Values::array_get($payload, 'coaching'), + 'conferenceSid' => Values::array_get($payload, 'conference_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'endConferenceOnExit' => Values::array_get($payload, 'end_conference_on_exit'), + 'muted' => Values::array_get($payload, 'muted'), + 'hold' => Values::array_get($payload, 'hold'), + 'startConferenceOnEnter' => Values::array_get($payload, 'start_conference_on_enter'), + 'status' => Values::array_get($payload, 'status'), + 'uri' => Values::array_get($payload, 'uri'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'conferenceSid' => $conferenceSid, 'callSid' => $callSid ?: $this->properties['callSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ParticipantContext Context for this ParticipantInstance + */ + protected function proxy(): ParticipantContext + { + if (!$this->context) { + $this->context = new ParticipantContext( + $this->version, + $this->solution['accountSid'], + $this->solution['conferenceSid'], + $this->solution['callSid'] + ); + } + + return $this->context; + } + + /** + * Delete the ParticipantInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ParticipantInstance + * + * @return ParticipantInstance Fetched ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ParticipantInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ParticipantInstance + * + * @param array|Options $options Optional Arguments + * @return ParticipantInstance Updated ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ParticipantInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.ParticipantInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Conference/ParticipantList.php b/app/api/Twilio/Rest/Api/V2010/Account/Conference/ParticipantList.php new file mode 100755 index 0000000..d7dfcab --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Conference/ParticipantList.php @@ -0,0 +1,308 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'conferenceSid' => + $conferenceSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Conferences/' . \rawurlencode($conferenceSid) + .'/Participants.json'; + } + + /** + * Create the ParticipantInstance + * + * @param string $from The phone number, Client identifier, or username portion of SIP address that made this call. Phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). Client identifiers are formatted `client:name`. If using a phone number, it must be a Twilio number or a Verified [outgoing caller id](https://www.twilio.com/docs/voice/api/outgoing-caller-ids) for your account. If the `to` parameter is a phone number, `from` must also be a phone number. If `to` is sip address, this value of `from` should be a username portion to be used to populate the P-Asserted-Identity header that is passed to the SIP endpoint. + * @param string $to The phone number, SIP address, or Client identifier that received this call. Phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). SIP addresses are formatted as `sip:name@company.com`. Client identifiers are formatted `client:name`. [Custom parameters](https://www.twilio.com/docs/voice/api/conference-participant-resource#custom-parameters) may also be specified. + * @param array|Options $options Optional Arguments + * @return ParticipantInstance Created ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $from, string $to, array $options = []): ParticipantInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'From' => + $from, + 'To' => + $to, + 'StatusCallback' => + $options['statusCallback'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'StatusCallbackEvent' => + Serialize::map($options['statusCallbackEvent'], function ($e) { return $e; }), + 'Label' => + $options['label'], + 'Timeout' => + $options['timeout'], + 'Record' => + Serialize::booleanToString($options['record']), + 'Muted' => + Serialize::booleanToString($options['muted']), + 'Beep' => + $options['beep'], + 'StartConferenceOnEnter' => + Serialize::booleanToString($options['startConferenceOnEnter']), + 'EndConferenceOnExit' => + Serialize::booleanToString($options['endConferenceOnExit']), + 'WaitUrl' => + $options['waitUrl'], + 'WaitMethod' => + $options['waitMethod'], + 'EarlyMedia' => + Serialize::booleanToString($options['earlyMedia']), + 'MaxParticipants' => + $options['maxParticipants'], + 'ConferenceRecord' => + $options['conferenceRecord'], + 'ConferenceTrim' => + $options['conferenceTrim'], + 'ConferenceStatusCallback' => + $options['conferenceStatusCallback'], + 'ConferenceStatusCallbackMethod' => + $options['conferenceStatusCallbackMethod'], + 'ConferenceStatusCallbackEvent' => + Serialize::map($options['conferenceStatusCallbackEvent'], function ($e) { return $e; }), + 'RecordingChannels' => + $options['recordingChannels'], + 'RecordingStatusCallback' => + $options['recordingStatusCallback'], + 'RecordingStatusCallbackMethod' => + $options['recordingStatusCallbackMethod'], + 'SipAuthUsername' => + $options['sipAuthUsername'], + 'SipAuthPassword' => + $options['sipAuthPassword'], + 'Region' => + $options['region'], + 'ConferenceRecordingStatusCallback' => + $options['conferenceRecordingStatusCallback'], + 'ConferenceRecordingStatusCallbackMethod' => + $options['conferenceRecordingStatusCallbackMethod'], + 'RecordingStatusCallbackEvent' => + Serialize::map($options['recordingStatusCallbackEvent'], function ($e) { return $e; }), + 'ConferenceRecordingStatusCallbackEvent' => + Serialize::map($options['conferenceRecordingStatusCallbackEvent'], function ($e) { return $e; }), + 'Coaching' => + Serialize::booleanToString($options['coaching']), + 'CallSidToCoach' => + $options['callSidToCoach'], + 'JitterBufferSize' => + $options['jitterBufferSize'], + 'Byoc' => + $options['byoc'], + 'CallerId' => + $options['callerId'], + 'CallReason' => + $options['callReason'], + 'RecordingTrack' => + $options['recordingTrack'], + 'TimeLimit' => + $options['timeLimit'], + 'MachineDetection' => + $options['machineDetection'], + 'MachineDetectionTimeout' => + $options['machineDetectionTimeout'], + 'MachineDetectionSpeechThreshold' => + $options['machineDetectionSpeechThreshold'], + 'MachineDetectionSpeechEndThreshold' => + $options['machineDetectionSpeechEndThreshold'], + 'MachineDetectionSilenceTimeout' => + $options['machineDetectionSilenceTimeout'], + 'AmdStatusCallback' => + $options['amdStatusCallback'], + 'AmdStatusCallbackMethod' => + $options['amdStatusCallbackMethod'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new ParticipantInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['conferenceSid'] + ); + } + + + /** + * Reads ParticipantInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ParticipantInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams ParticipantInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ParticipantInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ParticipantPage Page of ParticipantInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ParticipantPage + { + $options = new Values($options); + + $params = Values::of([ + 'Muted' => + Serialize::booleanToString($options['muted']), + 'Hold' => + Serialize::booleanToString($options['hold']), + 'Coaching' => + Serialize::booleanToString($options['coaching']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ParticipantPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ParticipantInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ParticipantPage Page of ParticipantInstance + */ + public function getPage(string $targetUrl): ParticipantPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ParticipantPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ParticipantContext + * + * @param string $callSid The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID or label of the participant to delete. Non URL safe characters in a label must be percent encoded, for example, a space character is represented as %20. + */ + public function getContext( + string $callSid + + ): ParticipantContext + { + return new ParticipantContext( + $this->version, + $this->solution['accountSid'], + $this->solution['conferenceSid'], + $callSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.ParticipantList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Conference/ParticipantOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/Conference/ParticipantOptions.php new file mode 100755 index 0000000..2c6f9e4 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Conference/ParticipantOptions.php @@ -0,0 +1,1192 @@ +`, ``, ``, or `` verbs. + * @param string $holdMethod The HTTP method we should use to call `hold_url`. Can be: `GET` or `POST` and the default is `GET`. + * @param string $announceUrl The URL we call using the `announce_method` for an announcement to the participant. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. + * @param string $announceMethod The HTTP method we should use to call `announce_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @param string $waitUrl The URL we call using the `wait_method` for the music to play while participants are waiting for the conference to start. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). + * @param string $waitMethod The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. + * @param bool $beepOnExit Whether to play a notification beep to the conference when the participant exits. Can be: `true` or `false`. + * @param bool $endConferenceOnExit Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. + * @param bool $coaching Whether the participant is coaching another call. Can be: `true` or `false`. If not present, defaults to `false` unless `call_sid_to_coach` is defined. If `true`, `call_sid_to_coach` must be defined. + * @param string $callSidToCoach The SID of the participant who is being `coached`. The participant being coached is the only participant who can hear the participant who is `coaching`. + * @return UpdateParticipantOptions Options builder + */ + public static function update( + + bool $muted = Values::BOOL_NONE, + bool $hold = Values::BOOL_NONE, + string $holdUrl = Values::NONE, + string $holdMethod = Values::NONE, + string $announceUrl = Values::NONE, + string $announceMethod = Values::NONE, + string $waitUrl = Values::NONE, + string $waitMethod = Values::NONE, + bool $beepOnExit = Values::BOOL_NONE, + bool $endConferenceOnExit = Values::BOOL_NONE, + bool $coaching = Values::BOOL_NONE, + string $callSidToCoach = Values::NONE + + ): UpdateParticipantOptions + { + return new UpdateParticipantOptions( + $muted, + $hold, + $holdUrl, + $holdMethod, + $announceUrl, + $announceMethod, + $waitUrl, + $waitMethod, + $beepOnExit, + $endConferenceOnExit, + $coaching, + $callSidToCoach + ); + } + +} + +class CreateParticipantOptions extends Options + { + /** + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` and `POST` and defaults to `POST`. + * @param string[] $statusCallbackEvent The conference state changes that should generate a call to `status_callback`. Can be: `initiated`, `ringing`, `answered`, and `completed`. Separate multiple values with a space. The default value is `completed`. + * @param string $label A label for this participant. If one is supplied, it may subsequently be used to fetch, update or delete the participant. + * @param int $timeout The number of seconds that we should allow the phone to ring before assuming there is no answer. Can be an integer between `5` and `600`, inclusive. The default value is `60`. We always add a 5-second timeout buffer to outgoing calls, so value of 10 would result in an actual timeout that was closer to 15 seconds. + * @param bool $record Whether to record the participant and their conferences, including the time between conferences. Can be `true` or `false` and the default is `false`. + * @param bool $muted Whether the agent is muted in the conference. Can be `true` or `false` and the default is `false`. + * @param string $beep Whether to play a notification beep to the conference when the participant joins. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. + * @param bool $startConferenceOnEnter Whether to start the conference when the participant joins, if it has not already started. Can be: `true` or `false` and the default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. + * @param bool $endConferenceOnExit Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. + * @param string $waitUrl The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). + * @param string $waitMethod The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. + * @param bool $earlyMedia Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. Can be: `true` or `false` and defaults to `true`. + * @param int $maxParticipants The maximum number of participants in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. + * @param string $conferenceRecord Whether to record the conference the participant is joining. Can be: `true`, `false`, `record-from-start`, and `do-not-record`. The default value is `false`. + * @param string $conferenceTrim Whether to trim leading and trailing silence from your recorded conference audio files. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`. + * @param string $conferenceStatusCallback The URL we should call using the `conference_status_callback_method` when the conference events in `conference_status_callback_event` occur. Only the value set by the first participant to join the conference is used. Subsequent `conference_status_callback` values are ignored. + * @param string $conferenceStatusCallbackMethod The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @param string[] $conferenceStatusCallbackEvent The conference state changes that should generate a call to `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, `hold`, `modify`, `speaker`, and `announcement`. Separate multiple values with a space. Defaults to `start end`. + * @param string $recordingChannels The recording channels for the final recording. Can be: `mono` or `dual` and the default is `mono`. + * @param string $recordingStatusCallback The URL that we should call using the `recording_status_callback_method` when the recording status changes. + * @param string $recordingStatusCallbackMethod The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @param string $sipAuthUsername The SIP username used for authentication. + * @param string $sipAuthPassword The SIP password for authentication. + * @param string $region The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. + * @param string $conferenceRecordingStatusCallback The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. + * @param string $conferenceRecordingStatusCallbackMethod The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @param string[] $recordingStatusCallbackEvent The recording state changes that should generate a call to `recording_status_callback`. Can be: `started`, `in-progress`, `paused`, `resumed`, `stopped`, `completed`, `failed`, and `absent`. Separate multiple values with a space, ex: `'in-progress completed failed'`. + * @param string[] $conferenceRecordingStatusCallbackEvent The conference recording state changes that generate a call to `conference_recording_status_callback`. Can be: `in-progress`, `completed`, `failed`, and `absent`. Separate multiple values with a space, ex: `'in-progress completed failed'` + * @param bool $coaching Whether the participant is coaching another call. Can be: `true` or `false`. If not present, defaults to `false` unless `call_sid_to_coach` is defined. If `true`, `call_sid_to_coach` must be defined. + * @param string $callSidToCoach The SID of the participant who is being `coached`. The participant being coached is the only participant who can hear the participant who is `coaching`. + * @param string $jitterBufferSize Jitter buffer size for the connecting participant. Twilio will use this setting to apply Jitter Buffer before participant's audio is mixed into the conference. Can be: `off`, `small`, `medium`, and `large`. Default to `large`. + * @param string $byoc The SID of a BYOC (Bring Your Own Carrier) trunk to route this call with. Note that `byoc` is only meaningful when `to` is a phone number; it will otherwise be ignored. (Beta) + * @param string $callerId The phone number, Client identifier, or username portion of SIP address that made this call. Phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). Client identifiers are formatted `client:name`. If using a phone number, it must be a Twilio number or a Verified [outgoing caller id](https://www.twilio.com/docs/voice/api/outgoing-caller-ids) for your account. If the `to` parameter is a phone number, `callerId` must also be a phone number. If `to` is sip address, this value of `callerId` should be a username portion to be used to populate the From header that is passed to the SIP endpoint. + * @param string $callReason The Reason for the outgoing call. Use it to specify the purpose of the call that is presented on the called party's phone. (Branded Calls Beta) + * @param string $recordingTrack The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is sent from Twilio. `both` records the audio that is received and sent by Twilio. + * @param int $timeLimit The maximum duration of the call in seconds. Constraints depend on account and configuration. + * @param string $machineDetection Whether to detect if a human, answering machine, or fax has picked up the call. Can be: `Enable` or `DetectMessageEnd`. Use `Enable` if you would like us to return `AnsweredBy` as soon as the called party is identified. Use `DetectMessageEnd`, if you would like to leave a message on an answering machine. If `send_digits` is provided, this parameter is ignored. For more information, see [Answering Machine Detection](https://www.twilio.com/docs/voice/answering-machine-detection). + * @param int $machineDetectionTimeout The number of seconds that we should attempt to detect an answering machine before timing out and sending a voice request with `AnsweredBy` of `unknown`. The default timeout is 30 seconds. + * @param int $machineDetectionSpeechThreshold The number of milliseconds that is used as the measuring stick for the length of the speech activity, where durations lower than this value will be interpreted as a human and longer than this value as a machine. Possible Values: 1000-6000. Default: 2400. + * @param int $machineDetectionSpeechEndThreshold The number of milliseconds of silence after speech activity at which point the speech activity is considered complete. Possible Values: 500-5000. Default: 1200. + * @param int $machineDetectionSilenceTimeout The number of milliseconds of initial silence after which an `unknown` AnsweredBy result will be returned. Possible Values: 2000-10000. Default: 5000. + * @param string $amdStatusCallback The URL that we should call using the `amd_status_callback_method` to notify customer application whether the call was answered by human, machine or fax. + * @param string $amdStatusCallbackMethod The HTTP method we should use when calling the `amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. + */ + public function __construct( + + string $statusCallback = Values::NONE, + string $statusCallbackMethod = Values::NONE, + array $statusCallbackEvent = Values::ARRAY_NONE, + string $label = Values::NONE, + int $timeout = Values::INT_NONE, + bool $record = Values::BOOL_NONE, + bool $muted = Values::BOOL_NONE, + string $beep = Values::NONE, + bool $startConferenceOnEnter = Values::BOOL_NONE, + bool $endConferenceOnExit = Values::BOOL_NONE, + string $waitUrl = Values::NONE, + string $waitMethod = Values::NONE, + bool $earlyMedia = Values::BOOL_NONE, + int $maxParticipants = Values::INT_NONE, + string $conferenceRecord = Values::NONE, + string $conferenceTrim = Values::NONE, + string $conferenceStatusCallback = Values::NONE, + string $conferenceStatusCallbackMethod = Values::NONE, + array $conferenceStatusCallbackEvent = Values::ARRAY_NONE, + string $recordingChannels = Values::NONE, + string $recordingStatusCallback = Values::NONE, + string $recordingStatusCallbackMethod = Values::NONE, + string $sipAuthUsername = Values::NONE, + string $sipAuthPassword = Values::NONE, + string $region = Values::NONE, + string $conferenceRecordingStatusCallback = Values::NONE, + string $conferenceRecordingStatusCallbackMethod = Values::NONE, + array $recordingStatusCallbackEvent = Values::ARRAY_NONE, + array $conferenceRecordingStatusCallbackEvent = Values::ARRAY_NONE, + bool $coaching = Values::BOOL_NONE, + string $callSidToCoach = Values::NONE, + string $jitterBufferSize = Values::NONE, + string $byoc = Values::NONE, + string $callerId = Values::NONE, + string $callReason = Values::NONE, + string $recordingTrack = Values::NONE, + int $timeLimit = Values::INT_NONE, + string $machineDetection = Values::NONE, + int $machineDetectionTimeout = Values::INT_NONE, + int $machineDetectionSpeechThreshold = Values::INT_NONE, + int $machineDetectionSpeechEndThreshold = Values::INT_NONE, + int $machineDetectionSilenceTimeout = Values::INT_NONE, + string $amdStatusCallback = Values::NONE, + string $amdStatusCallbackMethod = Values::NONE + + ) { + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['statusCallbackEvent'] = $statusCallbackEvent; + $this->options['label'] = $label; + $this->options['timeout'] = $timeout; + $this->options['record'] = $record; + $this->options['muted'] = $muted; + $this->options['beep'] = $beep; + $this->options['startConferenceOnEnter'] = $startConferenceOnEnter; + $this->options['endConferenceOnExit'] = $endConferenceOnExit; + $this->options['waitUrl'] = $waitUrl; + $this->options['waitMethod'] = $waitMethod; + $this->options['earlyMedia'] = $earlyMedia; + $this->options['maxParticipants'] = $maxParticipants; + $this->options['conferenceRecord'] = $conferenceRecord; + $this->options['conferenceTrim'] = $conferenceTrim; + $this->options['conferenceStatusCallback'] = $conferenceStatusCallback; + $this->options['conferenceStatusCallbackMethod'] = $conferenceStatusCallbackMethod; + $this->options['conferenceStatusCallbackEvent'] = $conferenceStatusCallbackEvent; + $this->options['recordingChannels'] = $recordingChannels; + $this->options['recordingStatusCallback'] = $recordingStatusCallback; + $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; + $this->options['sipAuthUsername'] = $sipAuthUsername; + $this->options['sipAuthPassword'] = $sipAuthPassword; + $this->options['region'] = $region; + $this->options['conferenceRecordingStatusCallback'] = $conferenceRecordingStatusCallback; + $this->options['conferenceRecordingStatusCallbackMethod'] = $conferenceRecordingStatusCallbackMethod; + $this->options['recordingStatusCallbackEvent'] = $recordingStatusCallbackEvent; + $this->options['conferenceRecordingStatusCallbackEvent'] = $conferenceRecordingStatusCallbackEvent; + $this->options['coaching'] = $coaching; + $this->options['callSidToCoach'] = $callSidToCoach; + $this->options['jitterBufferSize'] = $jitterBufferSize; + $this->options['byoc'] = $byoc; + $this->options['callerId'] = $callerId; + $this->options['callReason'] = $callReason; + $this->options['recordingTrack'] = $recordingTrack; + $this->options['timeLimit'] = $timeLimit; + $this->options['machineDetection'] = $machineDetection; + $this->options['machineDetectionTimeout'] = $machineDetectionTimeout; + $this->options['machineDetectionSpeechThreshold'] = $machineDetectionSpeechThreshold; + $this->options['machineDetectionSpeechEndThreshold'] = $machineDetectionSpeechEndThreshold; + $this->options['machineDetectionSilenceTimeout'] = $machineDetectionSilenceTimeout; + $this->options['amdStatusCallback'] = $amdStatusCallback; + $this->options['amdStatusCallbackMethod'] = $amdStatusCallbackMethod; + } + + /** + * The URL we should call using the `status_callback_method` to send status information to your application. + * + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `status_callback`. Can be: `GET` and `POST` and defaults to `POST`. + * + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` and `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * The conference state changes that should generate a call to `status_callback`. Can be: `initiated`, `ringing`, `answered`, and `completed`. Separate multiple values with a space. The default value is `completed`. + * + * @param string[] $statusCallbackEvent The conference state changes that should generate a call to `status_callback`. Can be: `initiated`, `ringing`, `answered`, and `completed`. Separate multiple values with a space. The default value is `completed`. + * @return $this Fluent Builder + */ + public function setStatusCallbackEvent(array $statusCallbackEvent): self + { + $this->options['statusCallbackEvent'] = $statusCallbackEvent; + return $this; + } + + /** + * A label for this participant. If one is supplied, it may subsequently be used to fetch, update or delete the participant. + * + * @param string $label A label for this participant. If one is supplied, it may subsequently be used to fetch, update or delete the participant. + * @return $this Fluent Builder + */ + public function setLabel(string $label): self + { + $this->options['label'] = $label; + return $this; + } + + /** + * The number of seconds that we should allow the phone to ring before assuming there is no answer. Can be an integer between `5` and `600`, inclusive. The default value is `60`. We always add a 5-second timeout buffer to outgoing calls, so value of 10 would result in an actual timeout that was closer to 15 seconds. + * + * @param int $timeout The number of seconds that we should allow the phone to ring before assuming there is no answer. Can be an integer between `5` and `600`, inclusive. The default value is `60`. We always add a 5-second timeout buffer to outgoing calls, so value of 10 would result in an actual timeout that was closer to 15 seconds. + * @return $this Fluent Builder + */ + public function setTimeout(int $timeout): self + { + $this->options['timeout'] = $timeout; + return $this; + } + + /** + * Whether to record the participant and their conferences, including the time between conferences. Can be `true` or `false` and the default is `false`. + * + * @param bool $record Whether to record the participant and their conferences, including the time between conferences. Can be `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setRecord(bool $record): self + { + $this->options['record'] = $record; + return $this; + } + + /** + * Whether the agent is muted in the conference. Can be `true` or `false` and the default is `false`. + * + * @param bool $muted Whether the agent is muted in the conference. Can be `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setMuted(bool $muted): self + { + $this->options['muted'] = $muted; + return $this; + } + + /** + * Whether to play a notification beep to the conference when the participant joins. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. + * + * @param string $beep Whether to play a notification beep to the conference when the participant joins. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. + * @return $this Fluent Builder + */ + public function setBeep(string $beep): self + { + $this->options['beep'] = $beep; + return $this; + } + + /** + * Whether to start the conference when the participant joins, if it has not already started. Can be: `true` or `false` and the default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. + * + * @param bool $startConferenceOnEnter Whether to start the conference when the participant joins, if it has not already started. Can be: `true` or `false` and the default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. + * @return $this Fluent Builder + */ + public function setStartConferenceOnEnter(bool $startConferenceOnEnter): self + { + $this->options['startConferenceOnEnter'] = $startConferenceOnEnter; + return $this; + } + + /** + * Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. + * + * @param bool $endConferenceOnExit Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. + * @return $this Fluent Builder + */ + public function setEndConferenceOnExit(bool $endConferenceOnExit): self + { + $this->options['endConferenceOnExit'] = $endConferenceOnExit; + return $this; + } + + /** + * The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). + * + * @param string $waitUrl The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). + * @return $this Fluent Builder + */ + public function setWaitUrl(string $waitUrl): self + { + $this->options['waitUrl'] = $waitUrl; + return $this; + } + + /** + * The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. + * + * @param string $waitMethod The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. + * @return $this Fluent Builder + */ + public function setWaitMethod(string $waitMethod): self + { + $this->options['waitMethod'] = $waitMethod; + return $this; + } + + /** + * Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. Can be: `true` or `false` and defaults to `true`. + * + * @param bool $earlyMedia Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. Can be: `true` or `false` and defaults to `true`. + * @return $this Fluent Builder + */ + public function setEarlyMedia(bool $earlyMedia): self + { + $this->options['earlyMedia'] = $earlyMedia; + return $this; + } + + /** + * The maximum number of participants in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. + * + * @param int $maxParticipants The maximum number of participants in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. + * @return $this Fluent Builder + */ + public function setMaxParticipants(int $maxParticipants): self + { + $this->options['maxParticipants'] = $maxParticipants; + return $this; + } + + /** + * Whether to record the conference the participant is joining. Can be: `true`, `false`, `record-from-start`, and `do-not-record`. The default value is `false`. + * + * @param string $conferenceRecord Whether to record the conference the participant is joining. Can be: `true`, `false`, `record-from-start`, and `do-not-record`. The default value is `false`. + * @return $this Fluent Builder + */ + public function setConferenceRecord(string $conferenceRecord): self + { + $this->options['conferenceRecord'] = $conferenceRecord; + return $this; + } + + /** + * Whether to trim leading and trailing silence from your recorded conference audio files. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`. + * + * @param string $conferenceTrim Whether to trim leading and trailing silence from your recorded conference audio files. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`. + * @return $this Fluent Builder + */ + public function setConferenceTrim(string $conferenceTrim): self + { + $this->options['conferenceTrim'] = $conferenceTrim; + return $this; + } + + /** + * The URL we should call using the `conference_status_callback_method` when the conference events in `conference_status_callback_event` occur. Only the value set by the first participant to join the conference is used. Subsequent `conference_status_callback` values are ignored. + * + * @param string $conferenceStatusCallback The URL we should call using the `conference_status_callback_method` when the conference events in `conference_status_callback_event` occur. Only the value set by the first participant to join the conference is used. Subsequent `conference_status_callback` values are ignored. + * @return $this Fluent Builder + */ + public function setConferenceStatusCallback(string $conferenceStatusCallback): self + { + $this->options['conferenceStatusCallback'] = $conferenceStatusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $conferenceStatusCallbackMethod The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setConferenceStatusCallbackMethod(string $conferenceStatusCallbackMethod): self + { + $this->options['conferenceStatusCallbackMethod'] = $conferenceStatusCallbackMethod; + return $this; + } + + /** + * The conference state changes that should generate a call to `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, `hold`, `modify`, `speaker`, and `announcement`. Separate multiple values with a space. Defaults to `start end`. + * + * @param string[] $conferenceStatusCallbackEvent The conference state changes that should generate a call to `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, `hold`, `modify`, `speaker`, and `announcement`. Separate multiple values with a space. Defaults to `start end`. + * @return $this Fluent Builder + */ + public function setConferenceStatusCallbackEvent(array $conferenceStatusCallbackEvent): self + { + $this->options['conferenceStatusCallbackEvent'] = $conferenceStatusCallbackEvent; + return $this; + } + + /** + * The recording channels for the final recording. Can be: `mono` or `dual` and the default is `mono`. + * + * @param string $recordingChannels The recording channels for the final recording. Can be: `mono` or `dual` and the default is `mono`. + * @return $this Fluent Builder + */ + public function setRecordingChannels(string $recordingChannels): self + { + $this->options['recordingChannels'] = $recordingChannels; + return $this; + } + + /** + * The URL that we should call using the `recording_status_callback_method` when the recording status changes. + * + * @param string $recordingStatusCallback The URL that we should call using the `recording_status_callback_method` when the recording status changes. + * @return $this Fluent Builder + */ + public function setRecordingStatusCallback(string $recordingStatusCallback): self + { + $this->options['recordingStatusCallback'] = $recordingStatusCallback; + return $this; + } + + /** + * The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $recordingStatusCallbackMethod The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setRecordingStatusCallbackMethod(string $recordingStatusCallbackMethod): self + { + $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; + return $this; + } + + /** + * The SIP username used for authentication. + * + * @param string $sipAuthUsername The SIP username used for authentication. + * @return $this Fluent Builder + */ + public function setSipAuthUsername(string $sipAuthUsername): self + { + $this->options['sipAuthUsername'] = $sipAuthUsername; + return $this; + } + + /** + * The SIP password for authentication. + * + * @param string $sipAuthPassword The SIP password for authentication. + * @return $this Fluent Builder + */ + public function setSipAuthPassword(string $sipAuthPassword): self + { + $this->options['sipAuthPassword'] = $sipAuthPassword; + return $this; + } + + /** + * The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. + * + * @param string $region The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. + * @return $this Fluent Builder + */ + public function setRegion(string $region): self + { + $this->options['region'] = $region; + return $this; + } + + /** + * The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. + * + * @param string $conferenceRecordingStatusCallback The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. + * @return $this Fluent Builder + */ + public function setConferenceRecordingStatusCallback(string $conferenceRecordingStatusCallback): self + { + $this->options['conferenceRecordingStatusCallback'] = $conferenceRecordingStatusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $conferenceRecordingStatusCallbackMethod The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setConferenceRecordingStatusCallbackMethod(string $conferenceRecordingStatusCallbackMethod): self + { + $this->options['conferenceRecordingStatusCallbackMethod'] = $conferenceRecordingStatusCallbackMethod; + return $this; + } + + /** + * The recording state changes that should generate a call to `recording_status_callback`. Can be: `started`, `in-progress`, `paused`, `resumed`, `stopped`, `completed`, `failed`, and `absent`. Separate multiple values with a space, ex: `'in-progress completed failed'`. + * + * @param string[] $recordingStatusCallbackEvent The recording state changes that should generate a call to `recording_status_callback`. Can be: `started`, `in-progress`, `paused`, `resumed`, `stopped`, `completed`, `failed`, and `absent`. Separate multiple values with a space, ex: `'in-progress completed failed'`. + * @return $this Fluent Builder + */ + public function setRecordingStatusCallbackEvent(array $recordingStatusCallbackEvent): self + { + $this->options['recordingStatusCallbackEvent'] = $recordingStatusCallbackEvent; + return $this; + } + + /** + * The conference recording state changes that generate a call to `conference_recording_status_callback`. Can be: `in-progress`, `completed`, `failed`, and `absent`. Separate multiple values with a space, ex: `'in-progress completed failed'` + * + * @param string[] $conferenceRecordingStatusCallbackEvent The conference recording state changes that generate a call to `conference_recording_status_callback`. Can be: `in-progress`, `completed`, `failed`, and `absent`. Separate multiple values with a space, ex: `'in-progress completed failed'` + * @return $this Fluent Builder + */ + public function setConferenceRecordingStatusCallbackEvent(array $conferenceRecordingStatusCallbackEvent): self + { + $this->options['conferenceRecordingStatusCallbackEvent'] = $conferenceRecordingStatusCallbackEvent; + return $this; + } + + /** + * Whether the participant is coaching another call. Can be: `true` or `false`. If not present, defaults to `false` unless `call_sid_to_coach` is defined. If `true`, `call_sid_to_coach` must be defined. + * + * @param bool $coaching Whether the participant is coaching another call. Can be: `true` or `false`. If not present, defaults to `false` unless `call_sid_to_coach` is defined. If `true`, `call_sid_to_coach` must be defined. + * @return $this Fluent Builder + */ + public function setCoaching(bool $coaching): self + { + $this->options['coaching'] = $coaching; + return $this; + } + + /** + * The SID of the participant who is being `coached`. The participant being coached is the only participant who can hear the participant who is `coaching`. + * + * @param string $callSidToCoach The SID of the participant who is being `coached`. The participant being coached is the only participant who can hear the participant who is `coaching`. + * @return $this Fluent Builder + */ + public function setCallSidToCoach(string $callSidToCoach): self + { + $this->options['callSidToCoach'] = $callSidToCoach; + return $this; + } + + /** + * Jitter buffer size for the connecting participant. Twilio will use this setting to apply Jitter Buffer before participant's audio is mixed into the conference. Can be: `off`, `small`, `medium`, and `large`. Default to `large`. + * + * @param string $jitterBufferSize Jitter buffer size for the connecting participant. Twilio will use this setting to apply Jitter Buffer before participant's audio is mixed into the conference. Can be: `off`, `small`, `medium`, and `large`. Default to `large`. + * @return $this Fluent Builder + */ + public function setJitterBufferSize(string $jitterBufferSize): self + { + $this->options['jitterBufferSize'] = $jitterBufferSize; + return $this; + } + + /** + * The SID of a BYOC (Bring Your Own Carrier) trunk to route this call with. Note that `byoc` is only meaningful when `to` is a phone number; it will otherwise be ignored. (Beta) + * + * @param string $byoc The SID of a BYOC (Bring Your Own Carrier) trunk to route this call with. Note that `byoc` is only meaningful when `to` is a phone number; it will otherwise be ignored. (Beta) + * @return $this Fluent Builder + */ + public function setByoc(string $byoc): self + { + $this->options['byoc'] = $byoc; + return $this; + } + + /** + * The phone number, Client identifier, or username portion of SIP address that made this call. Phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). Client identifiers are formatted `client:name`. If using a phone number, it must be a Twilio number or a Verified [outgoing caller id](https://www.twilio.com/docs/voice/api/outgoing-caller-ids) for your account. If the `to` parameter is a phone number, `callerId` must also be a phone number. If `to` is sip address, this value of `callerId` should be a username portion to be used to populate the From header that is passed to the SIP endpoint. + * + * @param string $callerId The phone number, Client identifier, or username portion of SIP address that made this call. Phone numbers are in [E.164](https://www.twilio.com/docs/glossary/what-e164) format (e.g., +16175551212). Client identifiers are formatted `client:name`. If using a phone number, it must be a Twilio number or a Verified [outgoing caller id](https://www.twilio.com/docs/voice/api/outgoing-caller-ids) for your account. If the `to` parameter is a phone number, `callerId` must also be a phone number. If `to` is sip address, this value of `callerId` should be a username portion to be used to populate the From header that is passed to the SIP endpoint. + * @return $this Fluent Builder + */ + public function setCallerId(string $callerId): self + { + $this->options['callerId'] = $callerId; + return $this; + } + + /** + * The Reason for the outgoing call. Use it to specify the purpose of the call that is presented on the called party's phone. (Branded Calls Beta) + * + * @param string $callReason The Reason for the outgoing call. Use it to specify the purpose of the call that is presented on the called party's phone. (Branded Calls Beta) + * @return $this Fluent Builder + */ + public function setCallReason(string $callReason): self + { + $this->options['callReason'] = $callReason; + return $this; + } + + /** + * The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is sent from Twilio. `both` records the audio that is received and sent by Twilio. + * + * @param string $recordingTrack The audio track to record for the call. Can be: `inbound`, `outbound` or `both`. The default is `both`. `inbound` records the audio that is received by Twilio. `outbound` records the audio that is sent from Twilio. `both` records the audio that is received and sent by Twilio. + * @return $this Fluent Builder + */ + public function setRecordingTrack(string $recordingTrack): self + { + $this->options['recordingTrack'] = $recordingTrack; + return $this; + } + + /** + * The maximum duration of the call in seconds. Constraints depend on account and configuration. + * + * @param int $timeLimit The maximum duration of the call in seconds. Constraints depend on account and configuration. + * @return $this Fluent Builder + */ + public function setTimeLimit(int $timeLimit): self + { + $this->options['timeLimit'] = $timeLimit; + return $this; + } + + /** + * Whether to detect if a human, answering machine, or fax has picked up the call. Can be: `Enable` or `DetectMessageEnd`. Use `Enable` if you would like us to return `AnsweredBy` as soon as the called party is identified. Use `DetectMessageEnd`, if you would like to leave a message on an answering machine. If `send_digits` is provided, this parameter is ignored. For more information, see [Answering Machine Detection](https://www.twilio.com/docs/voice/answering-machine-detection). + * + * @param string $machineDetection Whether to detect if a human, answering machine, or fax has picked up the call. Can be: `Enable` or `DetectMessageEnd`. Use `Enable` if you would like us to return `AnsweredBy` as soon as the called party is identified. Use `DetectMessageEnd`, if you would like to leave a message on an answering machine. If `send_digits` is provided, this parameter is ignored. For more information, see [Answering Machine Detection](https://www.twilio.com/docs/voice/answering-machine-detection). + * @return $this Fluent Builder + */ + public function setMachineDetection(string $machineDetection): self + { + $this->options['machineDetection'] = $machineDetection; + return $this; + } + + /** + * The number of seconds that we should attempt to detect an answering machine before timing out and sending a voice request with `AnsweredBy` of `unknown`. The default timeout is 30 seconds. + * + * @param int $machineDetectionTimeout The number of seconds that we should attempt to detect an answering machine before timing out and sending a voice request with `AnsweredBy` of `unknown`. The default timeout is 30 seconds. + * @return $this Fluent Builder + */ + public function setMachineDetectionTimeout(int $machineDetectionTimeout): self + { + $this->options['machineDetectionTimeout'] = $machineDetectionTimeout; + return $this; + } + + /** + * The number of milliseconds that is used as the measuring stick for the length of the speech activity, where durations lower than this value will be interpreted as a human and longer than this value as a machine. Possible Values: 1000-6000. Default: 2400. + * + * @param int $machineDetectionSpeechThreshold The number of milliseconds that is used as the measuring stick for the length of the speech activity, where durations lower than this value will be interpreted as a human and longer than this value as a machine. Possible Values: 1000-6000. Default: 2400. + * @return $this Fluent Builder + */ + public function setMachineDetectionSpeechThreshold(int $machineDetectionSpeechThreshold): self + { + $this->options['machineDetectionSpeechThreshold'] = $machineDetectionSpeechThreshold; + return $this; + } + + /** + * The number of milliseconds of silence after speech activity at which point the speech activity is considered complete. Possible Values: 500-5000. Default: 1200. + * + * @param int $machineDetectionSpeechEndThreshold The number of milliseconds of silence after speech activity at which point the speech activity is considered complete. Possible Values: 500-5000. Default: 1200. + * @return $this Fluent Builder + */ + public function setMachineDetectionSpeechEndThreshold(int $machineDetectionSpeechEndThreshold): self + { + $this->options['machineDetectionSpeechEndThreshold'] = $machineDetectionSpeechEndThreshold; + return $this; + } + + /** + * The number of milliseconds of initial silence after which an `unknown` AnsweredBy result will be returned. Possible Values: 2000-10000. Default: 5000. + * + * @param int $machineDetectionSilenceTimeout The number of milliseconds of initial silence after which an `unknown` AnsweredBy result will be returned. Possible Values: 2000-10000. Default: 5000. + * @return $this Fluent Builder + */ + public function setMachineDetectionSilenceTimeout(int $machineDetectionSilenceTimeout): self + { + $this->options['machineDetectionSilenceTimeout'] = $machineDetectionSilenceTimeout; + return $this; + } + + /** + * The URL that we should call using the `amd_status_callback_method` to notify customer application whether the call was answered by human, machine or fax. + * + * @param string $amdStatusCallback The URL that we should call using the `amd_status_callback_method` to notify customer application whether the call was answered by human, machine or fax. + * @return $this Fluent Builder + */ + public function setAmdStatusCallback(string $amdStatusCallback): self + { + $this->options['amdStatusCallback'] = $amdStatusCallback; + return $this; + } + + /** + * The HTTP method we should use when calling the `amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. + * + * @param string $amdStatusCallbackMethod The HTTP method we should use when calling the `amd_status_callback` URL. Can be: `GET` or `POST` and the default is `POST`. + * @return $this Fluent Builder + */ + public function setAmdStatusCallbackMethod(string $amdStatusCallbackMethod): self + { + $this->options['amdStatusCallbackMethod'] = $amdStatusCallbackMethod; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateParticipantOptions ' . $options . ']'; + } +} + + + +class ReadParticipantOptions extends Options + { + /** + * @param bool $muted Whether to return only participants that are muted. Can be: `true` or `false`. + * @param bool $hold Whether to return only participants that are on hold. Can be: `true` or `false`. + * @param bool $coaching Whether to return only participants who are coaching another call. Can be: `true` or `false`. + */ + public function __construct( + + bool $muted = Values::BOOL_NONE, + bool $hold = Values::BOOL_NONE, + bool $coaching = Values::BOOL_NONE + + ) { + $this->options['muted'] = $muted; + $this->options['hold'] = $hold; + $this->options['coaching'] = $coaching; + } + + /** + * Whether to return only participants that are muted. Can be: `true` or `false`. + * + * @param bool $muted Whether to return only participants that are muted. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setMuted(bool $muted): self + { + $this->options['muted'] = $muted; + return $this; + } + + /** + * Whether to return only participants that are on hold. Can be: `true` or `false`. + * + * @param bool $hold Whether to return only participants that are on hold. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setHold(bool $hold): self + { + $this->options['hold'] = $hold; + return $this; + } + + /** + * Whether to return only participants who are coaching another call. Can be: `true` or `false`. + * + * @param bool $coaching Whether to return only participants who are coaching another call. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setCoaching(bool $coaching): self + { + $this->options['coaching'] = $coaching; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadParticipantOptions ' . $options . ']'; + } +} + +class UpdateParticipantOptions extends Options + { + /** + * @param bool $muted Whether the participant should be muted. Can be `true` or `false`. `true` will mute the participant, and `false` will un-mute them. Anything value other than `true` or `false` is interpreted as `false`. + * @param bool $hold Whether the participant should be on hold. Can be: `true` or `false`. `true` puts the participant on hold, and `false` lets them rejoin the conference. + * @param string $holdUrl The URL we call using the `hold_method` for music that plays when the participant is on hold. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. + * @param string $holdMethod The HTTP method we should use to call `hold_url`. Can be: `GET` or `POST` and the default is `GET`. + * @param string $announceUrl The URL we call using the `announce_method` for an announcement to the participant. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. + * @param string $announceMethod The HTTP method we should use to call `announce_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @param string $waitUrl The URL we call using the `wait_method` for the music to play while participants are waiting for the conference to start. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). + * @param string $waitMethod The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. + * @param bool $beepOnExit Whether to play a notification beep to the conference when the participant exits. Can be: `true` or `false`. + * @param bool $endConferenceOnExit Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. + * @param bool $coaching Whether the participant is coaching another call. Can be: `true` or `false`. If not present, defaults to `false` unless `call_sid_to_coach` is defined. If `true`, `call_sid_to_coach` must be defined. + * @param string $callSidToCoach The SID of the participant who is being `coached`. The participant being coached is the only participant who can hear the participant who is `coaching`. + */ + public function __construct( + + bool $muted = Values::BOOL_NONE, + bool $hold = Values::BOOL_NONE, + string $holdUrl = Values::NONE, + string $holdMethod = Values::NONE, + string $announceUrl = Values::NONE, + string $announceMethod = Values::NONE, + string $waitUrl = Values::NONE, + string $waitMethod = Values::NONE, + bool $beepOnExit = Values::BOOL_NONE, + bool $endConferenceOnExit = Values::BOOL_NONE, + bool $coaching = Values::BOOL_NONE, + string $callSidToCoach = Values::NONE + + ) { + $this->options['muted'] = $muted; + $this->options['hold'] = $hold; + $this->options['holdUrl'] = $holdUrl; + $this->options['holdMethod'] = $holdMethod; + $this->options['announceUrl'] = $announceUrl; + $this->options['announceMethod'] = $announceMethod; + $this->options['waitUrl'] = $waitUrl; + $this->options['waitMethod'] = $waitMethod; + $this->options['beepOnExit'] = $beepOnExit; + $this->options['endConferenceOnExit'] = $endConferenceOnExit; + $this->options['coaching'] = $coaching; + $this->options['callSidToCoach'] = $callSidToCoach; + } + + /** + * Whether the participant should be muted. Can be `true` or `false`. `true` will mute the participant, and `false` will un-mute them. Anything value other than `true` or `false` is interpreted as `false`. + * + * @param bool $muted Whether the participant should be muted. Can be `true` or `false`. `true` will mute the participant, and `false` will un-mute them. Anything value other than `true` or `false` is interpreted as `false`. + * @return $this Fluent Builder + */ + public function setMuted(bool $muted): self + { + $this->options['muted'] = $muted; + return $this; + } + + /** + * Whether the participant should be on hold. Can be: `true` or `false`. `true` puts the participant on hold, and `false` lets them rejoin the conference. + * + * @param bool $hold Whether the participant should be on hold. Can be: `true` or `false`. `true` puts the participant on hold, and `false` lets them rejoin the conference. + * @return $this Fluent Builder + */ + public function setHold(bool $hold): self + { + $this->options['hold'] = $hold; + return $this; + } + + /** + * The URL we call using the `hold_method` for music that plays when the participant is on hold. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. + * + * @param string $holdUrl The URL we call using the `hold_method` for music that plays when the participant is on hold. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. + * @return $this Fluent Builder + */ + public function setHoldUrl(string $holdUrl): self + { + $this->options['holdUrl'] = $holdUrl; + return $this; + } + + /** + * The HTTP method we should use to call `hold_url`. Can be: `GET` or `POST` and the default is `GET`. + * + * @param string $holdMethod The HTTP method we should use to call `hold_url`. Can be: `GET` or `POST` and the default is `GET`. + * @return $this Fluent Builder + */ + public function setHoldMethod(string $holdMethod): self + { + $this->options['holdMethod'] = $holdMethod; + return $this; + } + + /** + * The URL we call using the `announce_method` for an announcement to the participant. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. + * + * @param string $announceUrl The URL we call using the `announce_method` for an announcement to the participant. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. + * @return $this Fluent Builder + */ + public function setAnnounceUrl(string $announceUrl): self + { + $this->options['announceUrl'] = $announceUrl; + return $this; + } + + /** + * The HTTP method we should use to call `announce_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $announceMethod The HTTP method we should use to call `announce_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setAnnounceMethod(string $announceMethod): self + { + $this->options['announceMethod'] = $announceMethod; + return $this; + } + + /** + * The URL we call using the `wait_method` for the music to play while participants are waiting for the conference to start. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). + * + * @param string $waitUrl The URL we call using the `wait_method` for the music to play while participants are waiting for the conference to start. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). + * @return $this Fluent Builder + */ + public function setWaitUrl(string $waitUrl): self + { + $this->options['waitUrl'] = $waitUrl; + return $this; + } + + /** + * The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. + * + * @param string $waitMethod The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. + * @return $this Fluent Builder + */ + public function setWaitMethod(string $waitMethod): self + { + $this->options['waitMethod'] = $waitMethod; + return $this; + } + + /** + * Whether to play a notification beep to the conference when the participant exits. Can be: `true` or `false`. + * + * @param bool $beepOnExit Whether to play a notification beep to the conference when the participant exits. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setBeepOnExit(bool $beepOnExit): self + { + $this->options['beepOnExit'] = $beepOnExit; + return $this; + } + + /** + * Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. + * + * @param bool $endConferenceOnExit Whether to end the conference when the participant leaves. Can be: `true` or `false` and defaults to `false`. + * @return $this Fluent Builder + */ + public function setEndConferenceOnExit(bool $endConferenceOnExit): self + { + $this->options['endConferenceOnExit'] = $endConferenceOnExit; + return $this; + } + + /** + * Whether the participant is coaching another call. Can be: `true` or `false`. If not present, defaults to `false` unless `call_sid_to_coach` is defined. If `true`, `call_sid_to_coach` must be defined. + * + * @param bool $coaching Whether the participant is coaching another call. Can be: `true` or `false`. If not present, defaults to `false` unless `call_sid_to_coach` is defined. If `true`, `call_sid_to_coach` must be defined. + * @return $this Fluent Builder + */ + public function setCoaching(bool $coaching): self + { + $this->options['coaching'] = $coaching; + return $this; + } + + /** + * The SID of the participant who is being `coached`. The participant being coached is the only participant who can hear the participant who is `coaching`. + * + * @param string $callSidToCoach The SID of the participant who is being `coached`. The participant being coached is the only participant who can hear the participant who is `coaching`. + * @return $this Fluent Builder + */ + public function setCallSidToCoach(string $callSidToCoach): self + { + $this->options['callSidToCoach'] = $callSidToCoach; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateParticipantOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Conference/ParticipantPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Conference/ParticipantPage.php new file mode 100755 index 0000000..ed8028b --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Conference/ParticipantPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ParticipantInstance \Twilio\Rest\Api\V2010\Account\Conference\ParticipantInstance + */ + public function buildInstance(array $payload): ParticipantInstance + { + return new ParticipantInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['conferenceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.ParticipantPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Conference/RecordingContext.php b/app/api/Twilio/Rest/Api/V2010/Account/Conference/RecordingContext.php new file mode 100755 index 0000000..a531ad1 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Conference/RecordingContext.php @@ -0,0 +1,140 @@ +solution = [ + 'accountSid' => + $accountSid, + 'conferenceSid' => + $conferenceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Conferences/' . \rawurlencode($conferenceSid) + .'/Recordings/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the RecordingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the RecordingInstance + * + * @return RecordingInstance Fetched RecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RecordingInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new RecordingInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['conferenceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the RecordingInstance + * + * @param string $status + * @param array|Options $options Optional Arguments + * @return RecordingInstance Updated RecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status, array $options = []): RecordingInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Status' => + $status, + 'PauseBehavior' => + $options['pauseBehavior'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new RecordingInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['conferenceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.RecordingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Conference/RecordingInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Conference/RecordingInstance.php new file mode 100755 index 0000000..2d9f443 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Conference/RecordingInstance.php @@ -0,0 +1,179 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'callSid' => Values::array_get($payload, 'call_sid'), + 'conferenceSid' => Values::array_get($payload, 'conference_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), + 'duration' => Values::array_get($payload, 'duration'), + 'sid' => Values::array_get($payload, 'sid'), + 'price' => Values::array_get($payload, 'price'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'status' => Values::array_get($payload, 'status'), + 'channels' => Values::array_get($payload, 'channels'), + 'source' => Values::array_get($payload, 'source'), + 'errorCode' => Values::array_get($payload, 'error_code'), + 'encryptionDetails' => Values::array_get($payload, 'encryption_details'), + 'uri' => Values::array_get($payload, 'uri'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'conferenceSid' => $conferenceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return RecordingContext Context for this RecordingInstance + */ + protected function proxy(): RecordingContext + { + if (!$this->context) { + $this->context = new RecordingContext( + $this->version, + $this->solution['accountSid'], + $this->solution['conferenceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the RecordingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the RecordingInstance + * + * @return RecordingInstance Fetched RecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RecordingInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the RecordingInstance + * + * @param string $status + * @param array|Options $options Optional Arguments + * @return RecordingInstance Updated RecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status, array $options = []): RecordingInstance + { + + return $this->proxy()->update($status, $options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.RecordingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Conference/RecordingList.php b/app/api/Twilio/Rest/Api/V2010/Account/Conference/RecordingList.php new file mode 100755 index 0000000..210164c --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Conference/RecordingList.php @@ -0,0 +1,187 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'conferenceSid' => + $conferenceSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Conferences/' . \rawurlencode($conferenceSid) + .'/Recordings.json'; + } + + /** + * Reads RecordingInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return RecordingInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams RecordingInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of RecordingInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return RecordingPage Page of RecordingInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): RecordingPage + { + $options = new Values($options); + + $params = Values::of([ + 'DateCreated<' => + Serialize::iso8601Date($options['dateCreatedBefore']), + 'DateCreated' => + Serialize::iso8601Date($options['dateCreated']), + 'DateCreated>' => + Serialize::iso8601Date($options['dateCreatedAfter']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new RecordingPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of RecordingInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return RecordingPage Page of RecordingInstance + */ + public function getPage(string $targetUrl): RecordingPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new RecordingPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a RecordingContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Conference Recording resource to delete. + */ + public function getContext( + string $sid + + ): RecordingContext + { + return new RecordingContext( + $this->version, + $this->solution['accountSid'], + $this->solution['conferenceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.RecordingList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Conference/RecordingOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/Conference/RecordingOptions.php new file mode 100755 index 0000000..b70a14c --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Conference/RecordingOptions.php @@ -0,0 +1,168 @@ +=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * @param string $dateCreated The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * @param string $dateCreatedAfter The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * @return ReadRecordingOptions Options builder + */ + public static function read( + + string $dateCreatedBefore = null, + string $dateCreated = null, + string $dateCreatedAfter = null + + ): ReadRecordingOptions + { + return new ReadRecordingOptions( + $dateCreatedBefore, + $dateCreated, + $dateCreatedAfter + ); + } + + /** + * @param string $pauseBehavior Whether to record during a pause. Can be: `skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`. + * @return UpdateRecordingOptions Options builder + */ + public static function update( + + string $pauseBehavior = Values::NONE + + ): UpdateRecordingOptions + { + return new UpdateRecordingOptions( + $pauseBehavior + ); + } + +} + + + +class ReadRecordingOptions extends Options + { + /** + * @param string $dateCreatedBefore The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * @param string $dateCreated The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * @param string $dateCreatedAfter The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + */ + public function __construct( + + string $dateCreatedBefore = null, + string $dateCreated = null, + string $dateCreatedAfter = null + + ) { + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + } + + /** + * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * + * @param string $dateCreatedBefore The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * @return $this Fluent Builder + */ + public function setDateCreatedBefore(string $dateCreatedBefore): self + { + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + return $this; + } + + /** + * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * + * @param string $dateCreated The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * @return $this Fluent Builder + */ + public function setDateCreated(string $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * + * @param string $dateCreatedAfter The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. You can also specify inequality: `DateCreated<=YYYY-MM-DD` will return recordings generated at or before midnight on a given date, and `DateCreated>=YYYY-MM-DD` returns recordings generated at or after midnight on a date. + * @return $this Fluent Builder + */ + public function setDateCreatedAfter(string $dateCreatedAfter): self + { + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadRecordingOptions ' . $options . ']'; + } +} + +class UpdateRecordingOptions extends Options + { + /** + * @param string $pauseBehavior Whether to record during a pause. Can be: `skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`. + */ + public function __construct( + + string $pauseBehavior = Values::NONE + + ) { + $this->options['pauseBehavior'] = $pauseBehavior; + } + + /** + * Whether to record during a pause. Can be: `skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`. + * + * @param string $pauseBehavior Whether to record during a pause. Can be: `skip` or `silence` and the default is `silence`. `skip` does not record during the pause period, while `silence` will replace the actual audio of the call with silence during the pause period. This parameter only applies when setting `status` is set to `paused`. + * @return $this Fluent Builder + */ + public function setPauseBehavior(string $pauseBehavior): self + { + $this->options['pauseBehavior'] = $pauseBehavior; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateRecordingOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Conference/RecordingPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Conference/RecordingPage.php new file mode 100755 index 0000000..33cb649 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Conference/RecordingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RecordingInstance \Twilio\Rest\Api\V2010\Account\Conference\RecordingInstance + */ + public function buildInstance(array $payload): RecordingInstance + { + return new RecordingInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['conferenceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.RecordingPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/ConferenceContext.php b/app/api/Twilio/Rest/Api/V2010/Account/ConferenceContext.php new file mode 100755 index 0000000..5492842 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/ConferenceContext.php @@ -0,0 +1,200 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Conferences/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Fetch the ConferenceInstance + * + * @return ConferenceInstance Fetched ConferenceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ConferenceInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ConferenceInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ConferenceInstance + * + * @param array|Options $options Optional Arguments + * @return ConferenceInstance Updated ConferenceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ConferenceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Status' => + $options['status'], + 'AnnounceUrl' => + $options['announceUrl'], + 'AnnounceMethod' => + $options['announceMethod'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new ConferenceInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the participants + */ + protected function getParticipants(): ParticipantList + { + if (!$this->_participants) { + $this->_participants = new ParticipantList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_participants; + } + + /** + * Access the recordings + */ + protected function getRecordings(): RecordingList + { + if (!$this->_recordings) { + $this->_recordings = new RecordingList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_recordings; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.ConferenceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/ConferenceInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/ConferenceInstance.php new file mode 100755 index 0000000..d0be268 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/ConferenceInstance.php @@ -0,0 +1,175 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'region' => Values::array_get($payload, 'region'), + 'sid' => Values::array_get($payload, 'sid'), + 'status' => Values::array_get($payload, 'status'), + 'uri' => Values::array_get($payload, 'uri'), + 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), + 'reasonConferenceEnded' => Values::array_get($payload, 'reason_conference_ended'), + 'callSidEndingConference' => Values::array_get($payload, 'call_sid_ending_conference'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ConferenceContext Context for this ConferenceInstance + */ + protected function proxy(): ConferenceContext + { + if (!$this->context) { + $this->context = new ConferenceContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the ConferenceInstance + * + * @return ConferenceInstance Fetched ConferenceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ConferenceInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ConferenceInstance + * + * @param array|Options $options Optional Arguments + * @return ConferenceInstance Updated ConferenceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ConferenceInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the participants + */ + protected function getParticipants(): ParticipantList + { + return $this->proxy()->participants; + } + + /** + * Access the recordings + */ + protected function getRecordings(): RecordingList + { + return $this->proxy()->recordings; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.ConferenceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/ConferenceList.php b/app/api/Twilio/Rest/Api/V2010/Account/ConferenceList.php new file mode 100755 index 0000000..8999037 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/ConferenceList.php @@ -0,0 +1,190 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Conferences.json'; + } + + /** + * Reads ConferenceInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ConferenceInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams ConferenceInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ConferenceInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ConferencePage Page of ConferenceInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ConferencePage + { + $options = new Values($options); + + $params = Values::of([ + 'DateCreated<' => + Serialize::iso8601Date($options['dateCreatedBefore']), + 'DateCreated' => + Serialize::iso8601Date($options['dateCreated']), + 'DateCreated>' => + Serialize::iso8601Date($options['dateCreatedAfter']), + 'DateUpdated<' => + Serialize::iso8601Date($options['dateUpdatedBefore']), + 'DateUpdated' => + Serialize::iso8601Date($options['dateUpdated']), + 'DateUpdated>' => + Serialize::iso8601Date($options['dateUpdatedAfter']), + 'FriendlyName' => + $options['friendlyName'], + 'Status' => + $options['status'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ConferencePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ConferenceInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ConferencePage Page of ConferenceInstance + */ + public function getPage(string $targetUrl): ConferencePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ConferencePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ConferenceContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Conference resource to fetch + */ + public function getContext( + string $sid + + ): ConferenceContext + { + return new ConferenceContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.ConferenceList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/ConferenceOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/ConferenceOptions.php new file mode 100755 index 0000000..9aa5bd9 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/ConferenceOptions.php @@ -0,0 +1,290 @@ +=YYYY-MM-DD`. + * @param string $dateCreated The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. + * @param string $dateCreatedAfter The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. + * @param string $dateUpdatedBefore The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. + * @param string $dateUpdated The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. + * @param string $dateUpdatedAfter The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. + * @param string $friendlyName The string that identifies the Conference resources to read. + * @param string $status The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. + * @return ReadConferenceOptions Options builder + */ + public static function read( + + string $dateCreatedBefore = null, + string $dateCreated = null, + string $dateCreatedAfter = null, + string $dateUpdatedBefore = null, + string $dateUpdated = null, + string $dateUpdatedAfter = null, + string $friendlyName = Values::NONE, + string $status = Values::NONE + + ): ReadConferenceOptions + { + return new ReadConferenceOptions( + $dateCreatedBefore, + $dateCreated, + $dateCreatedAfter, + $dateUpdatedBefore, + $dateUpdated, + $dateUpdatedAfter, + $friendlyName, + $status + ); + } + + /** + * @param string $status + * @param string $announceUrl The URL we should call to announce something into the conference. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. + * @param string $announceMethod The HTTP method used to call `announce_url`. Can be: `GET` or `POST` and the default is `POST` + * @return UpdateConferenceOptions Options builder + */ + public static function update( + + string $status = Values::NONE, + string $announceUrl = Values::NONE, + string $announceMethod = Values::NONE + + ): UpdateConferenceOptions + { + return new UpdateConferenceOptions( + $status, + $announceUrl, + $announceMethod + ); + } + +} + + +class ReadConferenceOptions extends Options + { + /** + * @param string $dateCreatedBefore The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. + * @param string $dateCreated The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. + * @param string $dateCreatedAfter The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. + * @param string $dateUpdatedBefore The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. + * @param string $dateUpdated The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. + * @param string $dateUpdatedAfter The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. + * @param string $friendlyName The string that identifies the Conference resources to read. + * @param string $status The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. + */ + public function __construct( + + string $dateCreatedBefore = null, + string $dateCreated = null, + string $dateCreatedAfter = null, + string $dateUpdatedBefore = null, + string $dateUpdated = null, + string $dateUpdatedAfter = null, + string $friendlyName = Values::NONE, + string $status = Values::NONE + + ) { + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + $this->options['dateUpdatedBefore'] = $dateUpdatedBefore; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['dateUpdatedAfter'] = $dateUpdatedAfter; + $this->options['friendlyName'] = $friendlyName; + $this->options['status'] = $status; + } + + /** + * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. + * + * @param string $dateCreatedBefore The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. + * @return $this Fluent Builder + */ + public function setDateCreatedBefore(string $dateCreatedBefore): self + { + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + return $this; + } + + /** + * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. + * + * @param string $dateCreated The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. + * @return $this Fluent Builder + */ + public function setDateCreated(string $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. + * + * @param string $dateCreatedAfter The `date_created` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that started on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that started on or after midnight on a date, use `>=YYYY-MM-DD`. + * @return $this Fluent Builder + */ + public function setDateCreatedAfter(string $dateCreatedAfter): self + { + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + return $this; + } + + /** + * The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. + * + * @param string $dateUpdatedBefore The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. + * @return $this Fluent Builder + */ + public function setDateUpdatedBefore(string $dateUpdatedBefore): self + { + $this->options['dateUpdatedBefore'] = $dateUpdatedBefore; + return $this; + } + + /** + * The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. + * + * @param string $dateUpdated The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. + * @return $this Fluent Builder + */ + public function setDateUpdated(string $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. + * + * @param string $dateUpdatedAfter The `date_updated` value, specified as `YYYY-MM-DD`, of the resources to read. To read conferences that were last updated on or before midnight on a date, use `<=YYYY-MM-DD`, and to specify conferences that were last updated on or after midnight on a given date, use `>=YYYY-MM-DD`. + * @return $this Fluent Builder + */ + public function setDateUpdatedAfter(string $dateUpdatedAfter): self + { + $this->options['dateUpdatedAfter'] = $dateUpdatedAfter; + return $this; + } + + /** + * The string that identifies the Conference resources to read. + * + * @param string $friendlyName The string that identifies the Conference resources to read. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. + * + * @param string $status The status of the resources to read. Can be: `init`, `in-progress`, or `completed`. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadConferenceOptions ' . $options . ']'; + } +} + +class UpdateConferenceOptions extends Options + { + /** + * @param string $status + * @param string $announceUrl The URL we should call to announce something into the conference. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. + * @param string $announceMethod The HTTP method used to call `announce_url`. Can be: `GET` or `POST` and the default is `POST` + */ + public function __construct( + + string $status = Values::NONE, + string $announceUrl = Values::NONE, + string $announceMethod = Values::NONE + + ) { + $this->options['status'] = $status; + $this->options['announceUrl'] = $announceUrl; + $this->options['announceMethod'] = $announceMethod; + } + + /** + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * The URL we should call to announce something into the conference. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. + * + * @param string $announceUrl The URL we should call to announce something into the conference. The URL may return an MP3 file, a WAV file, or a TwiML document that contains ``, ``, ``, or `` verbs. + * @return $this Fluent Builder + */ + public function setAnnounceUrl(string $announceUrl): self + { + $this->options['announceUrl'] = $announceUrl; + return $this; + } + + /** + * The HTTP method used to call `announce_url`. Can be: `GET` or `POST` and the default is `POST` + * + * @param string $announceMethod The HTTP method used to call `announce_url`. Can be: `GET` or `POST` and the default is `POST` + * @return $this Fluent Builder + */ + public function setAnnounceMethod(string $announceMethod): self + { + $this->options['announceMethod'] = $announceMethod; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateConferenceOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/ConferencePage.php b/app/api/Twilio/Rest/Api/V2010/Account/ConferencePage.php new file mode 100755 index 0000000..91ab421 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/ConferencePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ConferenceInstance \Twilio\Rest\Api\V2010\Account\ConferenceInstance + */ + public function buildInstance(array $payload): ConferenceInstance + { + return new ConferenceInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.ConferencePage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/ConnectAppContext.php b/app/api/Twilio/Rest/Api/V2010/Account/ConnectAppContext.php new file mode 100755 index 0000000..825e990 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/ConnectAppContext.php @@ -0,0 +1,144 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/ConnectApps/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the ConnectAppInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the ConnectAppInstance + * + * @return ConnectAppInstance Fetched ConnectAppInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ConnectAppInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ConnectAppInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ConnectAppInstance + * + * @param array|Options $options Optional Arguments + * @return ConnectAppInstance Updated ConnectAppInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ConnectAppInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'AuthorizeRedirectUrl' => + $options['authorizeRedirectUrl'], + 'CompanyName' => + $options['companyName'], + 'DeauthorizeCallbackMethod' => + $options['deauthorizeCallbackMethod'], + 'DeauthorizeCallbackUrl' => + $options['deauthorizeCallbackUrl'], + 'Description' => + $options['description'], + 'FriendlyName' => + $options['friendlyName'], + 'HomepageUrl' => + $options['homepageUrl'], + 'Permissions' => + $options['permissions'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new ConnectAppInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.ConnectAppContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/ConnectAppInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/ConnectAppInstance.php new file mode 100755 index 0000000..05e64fa --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/ConnectAppInstance.php @@ -0,0 +1,163 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'authorizeRedirectUrl' => Values::array_get($payload, 'authorize_redirect_url'), + 'companyName' => Values::array_get($payload, 'company_name'), + 'deauthorizeCallbackMethod' => Values::array_get($payload, 'deauthorize_callback_method'), + 'deauthorizeCallbackUrl' => Values::array_get($payload, 'deauthorize_callback_url'), + 'description' => Values::array_get($payload, 'description'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'homepageUrl' => Values::array_get($payload, 'homepage_url'), + 'permissions' => Values::array_get($payload, 'permissions'), + 'sid' => Values::array_get($payload, 'sid'), + 'uri' => Values::array_get($payload, 'uri'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ConnectAppContext Context for this ConnectAppInstance + */ + protected function proxy(): ConnectAppContext + { + if (!$this->context) { + $this->context = new ConnectAppContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ConnectAppInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ConnectAppInstance + * + * @return ConnectAppInstance Fetched ConnectAppInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ConnectAppInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ConnectAppInstance + * + * @param array|Options $options Optional Arguments + * @return ConnectAppInstance Updated ConnectAppInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ConnectAppInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.ConnectAppInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/ConnectAppList.php b/app/api/Twilio/Rest/Api/V2010/Account/ConnectAppList.php new file mode 100755 index 0000000..809ce5d --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/ConnectAppList.php @@ -0,0 +1,168 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/ConnectApps.json'; + } + + /** + * Reads ConnectAppInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ConnectAppInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ConnectAppInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ConnectAppInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ConnectAppPage Page of ConnectAppInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ConnectAppPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ConnectAppPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ConnectAppInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ConnectAppPage Page of ConnectAppInstance + */ + public function getPage(string $targetUrl): ConnectAppPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ConnectAppPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ConnectAppContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the ConnectApp resource to fetch. + */ + public function getContext( + string $sid + + ): ConnectAppContext + { + return new ConnectAppContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.ConnectAppList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/ConnectAppOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/ConnectAppOptions.php new file mode 100755 index 0000000..6100931 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/ConnectAppOptions.php @@ -0,0 +1,208 @@ +options['authorizeRedirectUrl'] = $authorizeRedirectUrl; + $this->options['companyName'] = $companyName; + $this->options['deauthorizeCallbackMethod'] = $deauthorizeCallbackMethod; + $this->options['deauthorizeCallbackUrl'] = $deauthorizeCallbackUrl; + $this->options['description'] = $description; + $this->options['friendlyName'] = $friendlyName; + $this->options['homepageUrl'] = $homepageUrl; + $this->options['permissions'] = $permissions; + } + + /** + * The URL to redirect the user to after we authenticate the user and obtain authorization to access the Connect App. + * + * @param string $authorizeRedirectUrl The URL to redirect the user to after we authenticate the user and obtain authorization to access the Connect App. + * @return $this Fluent Builder + */ + public function setAuthorizeRedirectUrl(string $authorizeRedirectUrl): self + { + $this->options['authorizeRedirectUrl'] = $authorizeRedirectUrl; + return $this; + } + + /** + * The company name to set for the Connect App. + * + * @param string $companyName The company name to set for the Connect App. + * @return $this Fluent Builder + */ + public function setCompanyName(string $companyName): self + { + $this->options['companyName'] = $companyName; + return $this; + } + + /** + * The HTTP method to use when calling `deauthorize_callback_url`. + * + * @param string $deauthorizeCallbackMethod The HTTP method to use when calling `deauthorize_callback_url`. + * @return $this Fluent Builder + */ + public function setDeauthorizeCallbackMethod(string $deauthorizeCallbackMethod): self + { + $this->options['deauthorizeCallbackMethod'] = $deauthorizeCallbackMethod; + return $this; + } + + /** + * The URL to call using the `deauthorize_callback_method` to de-authorize the Connect App. + * + * @param string $deauthorizeCallbackUrl The URL to call using the `deauthorize_callback_method` to de-authorize the Connect App. + * @return $this Fluent Builder + */ + public function setDeauthorizeCallbackUrl(string $deauthorizeCallbackUrl): self + { + $this->options['deauthorizeCallbackUrl'] = $deauthorizeCallbackUrl; + return $this; + } + + /** + * A description of the Connect App. + * + * @param string $description A description of the Connect App. + * @return $this Fluent Builder + */ + public function setDescription(string $description): self + { + $this->options['description'] = $description; + return $this; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * A public URL where users can obtain more information about this Connect App. + * + * @param string $homepageUrl A public URL where users can obtain more information about this Connect App. + * @return $this Fluent Builder + */ + public function setHomepageUrl(string $homepageUrl): self + { + $this->options['homepageUrl'] = $homepageUrl; + return $this; + } + + /** + * A comma-separated list of the permissions you will request from the users of this ConnectApp. Can include: `get-all` and `post-all`. + * + * @param string $permissions A comma-separated list of the permissions you will request from the users of this ConnectApp. Can include: `get-all` and `post-all`. + * @return $this Fluent Builder + */ + public function setPermissions(array $permissions): self + { + $this->options['permissions'] = $permissions; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateConnectAppOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/ConnectAppPage.php b/app/api/Twilio/Rest/Api/V2010/Account/ConnectAppPage.php new file mode 100755 index 0000000..3609d0f --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/ConnectAppPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ConnectAppInstance \Twilio\Rest\Api\V2010\Account\ConnectAppInstance + */ + public function buildInstance(array $payload): ConnectAppInstance + { + return new ConnectAppInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.ConnectAppPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionContext.php b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionContext.php new file mode 100755 index 0000000..242165e --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionContext.php @@ -0,0 +1,99 @@ +solution = [ + 'accountSid' => + $accountSid, + 'resourceSid' => + $resourceSid, + 'assignedAddOnSid' => + $assignedAddOnSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/IncomingPhoneNumbers/' . \rawurlencode($resourceSid) + .'/AssignedAddOns/' . \rawurlencode($assignedAddOnSid) + .'/Extensions/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Fetch the AssignedAddOnExtensionInstance + * + * @return AssignedAddOnExtensionInstance Fetched AssignedAddOnExtensionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AssignedAddOnExtensionInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new AssignedAddOnExtensionInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['resourceSid'], + $this->solution['assignedAddOnSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AssignedAddOnExtensionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionInstance.php new file mode 100755 index 0000000..a3a0b91 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionInstance.php @@ -0,0 +1,137 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'resourceSid' => Values::array_get($payload, 'resource_sid'), + 'assignedAddOnSid' => Values::array_get($payload, 'assigned_add_on_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'productName' => Values::array_get($payload, 'product_name'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'uri' => Values::array_get($payload, 'uri'), + 'enabled' => Values::array_get($payload, 'enabled'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'resourceSid' => $resourceSid, 'assignedAddOnSid' => $assignedAddOnSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AssignedAddOnExtensionContext Context for this AssignedAddOnExtensionInstance + */ + protected function proxy(): AssignedAddOnExtensionContext + { + if (!$this->context) { + $this->context = new AssignedAddOnExtensionContext( + $this->version, + $this->solution['accountSid'], + $this->solution['resourceSid'], + $this->solution['assignedAddOnSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the AssignedAddOnExtensionInstance + * + * @return AssignedAddOnExtensionInstance Fetched AssignedAddOnExtensionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AssignedAddOnExtensionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AssignedAddOnExtensionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionList.php b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionList.php new file mode 100755 index 0000000..d3df69e --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionList.php @@ -0,0 +1,182 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'resourceSid' => + $resourceSid, + + 'assignedAddOnSid' => + $assignedAddOnSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/IncomingPhoneNumbers/' . \rawurlencode($resourceSid) + .'/AssignedAddOns/' . \rawurlencode($assignedAddOnSid) + .'/Extensions.json'; + } + + /** + * Reads AssignedAddOnExtensionInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return AssignedAddOnExtensionInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams AssignedAddOnExtensionInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AssignedAddOnExtensionInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return AssignedAddOnExtensionPage Page of AssignedAddOnExtensionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AssignedAddOnExtensionPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new AssignedAddOnExtensionPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of AssignedAddOnExtensionInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return AssignedAddOnExtensionPage Page of AssignedAddOnExtensionInstance + */ + public function getPage(string $targetUrl): AssignedAddOnExtensionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AssignedAddOnExtensionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AssignedAddOnExtensionContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the resource to fetch. + */ + public function getContext( + string $sid + + ): AssignedAddOnExtensionContext + { + return new AssignedAddOnExtensionContext( + $this->version, + $this->solution['accountSid'], + $this->solution['resourceSid'], + $this->solution['assignedAddOnSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AssignedAddOnExtensionList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionPage.php b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionPage.php new file mode 100755 index 0000000..a5bc22f --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOn/AssignedAddOnExtensionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AssignedAddOnExtensionInstance \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOn\AssignedAddOnExtensionInstance + */ + public function buildInstance(array $payload): AssignedAddOnExtensionInstance + { + return new AssignedAddOnExtensionInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['resourceSid'], $this->solution['assignedAddOnSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AssignedAddOnExtensionPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnContext.php b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnContext.php new file mode 100755 index 0000000..afe4807 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnContext.php @@ -0,0 +1,166 @@ +solution = [ + 'accountSid' => + $accountSid, + 'resourceSid' => + $resourceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/IncomingPhoneNumbers/' . \rawurlencode($resourceSid) + .'/AssignedAddOns/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the AssignedAddOnInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the AssignedAddOnInstance + * + * @return AssignedAddOnInstance Fetched AssignedAddOnInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AssignedAddOnInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new AssignedAddOnInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['resourceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the extensions + */ + protected function getExtensions(): AssignedAddOnExtensionList + { + if (!$this->_extensions) { + $this->_extensions = new AssignedAddOnExtensionList( + $this->version, + $this->solution['accountSid'], + $this->solution['resourceSid'], + $this->solution['sid'] + ); + } + + return $this->_extensions; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AssignedAddOnContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnInstance.php new file mode 100755 index 0000000..93b913f --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnInstance.php @@ -0,0 +1,163 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'resourceSid' => Values::array_get($payload, 'resource_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'description' => Values::array_get($payload, 'description'), + 'configuration' => Values::array_get($payload, 'configuration'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'uri' => Values::array_get($payload, 'uri'), + 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'resourceSid' => $resourceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AssignedAddOnContext Context for this AssignedAddOnInstance + */ + protected function proxy(): AssignedAddOnContext + { + if (!$this->context) { + $this->context = new AssignedAddOnContext( + $this->version, + $this->solution['accountSid'], + $this->solution['resourceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the AssignedAddOnInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the AssignedAddOnInstance + * + * @return AssignedAddOnInstance Fetched AssignedAddOnInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AssignedAddOnInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the extensions + */ + protected function getExtensions(): AssignedAddOnExtensionList + { + return $this->proxy()->extensions; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AssignedAddOnInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnList.php b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnList.php new file mode 100755 index 0000000..c60bb90 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnList.php @@ -0,0 +1,202 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'resourceSid' => + $resourceSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/IncomingPhoneNumbers/' . \rawurlencode($resourceSid) + .'/AssignedAddOns.json'; + } + + /** + * Create the AssignedAddOnInstance + * + * @param string $installedAddOnSid The SID that identifies the Add-on installation. + * @return AssignedAddOnInstance Created AssignedAddOnInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $installedAddOnSid): AssignedAddOnInstance + { + + $data = Values::of([ + 'InstalledAddOnSid' => + $installedAddOnSid, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new AssignedAddOnInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['resourceSid'] + ); + } + + + /** + * Reads AssignedAddOnInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return AssignedAddOnInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams AssignedAddOnInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AssignedAddOnInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return AssignedAddOnPage Page of AssignedAddOnInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AssignedAddOnPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new AssignedAddOnPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of AssignedAddOnInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return AssignedAddOnPage Page of AssignedAddOnInstance + */ + public function getPage(string $targetUrl): AssignedAddOnPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AssignedAddOnPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AssignedAddOnContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the resource to delete. + */ + public function getContext( + string $sid + + ): AssignedAddOnContext + { + return new AssignedAddOnContext( + $this->version, + $this->solution['accountSid'], + $this->solution['resourceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AssignedAddOnList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnPage.php b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnPage.php new file mode 100755 index 0000000..bca2870 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/AssignedAddOnPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AssignedAddOnInstance \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\AssignedAddOnInstance + */ + public function buildInstance(array $payload): AssignedAddOnInstance + { + return new AssignedAddOnInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['resourceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AssignedAddOnPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalInstance.php new file mode 100755 index 0000000..0d78653 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalInstance.php @@ -0,0 +1,149 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'addressSid' => Values::array_get($payload, 'address_sid'), + 'addressRequirements' => Values::array_get($payload, 'address_requirements'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'beta' => Values::array_get($payload, 'beta'), + 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'identitySid' => Values::array_get($payload, 'identity_sid'), + 'phoneNumber' => Values::array_get($payload, 'phone_number'), + 'origin' => Values::array_get($payload, 'origin'), + 'sid' => Values::array_get($payload, 'sid'), + 'smsApplicationSid' => Values::array_get($payload, 'sms_application_sid'), + 'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'), + 'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'), + 'smsMethod' => Values::array_get($payload, 'sms_method'), + 'smsUrl' => Values::array_get($payload, 'sms_url'), + 'statusCallback' => Values::array_get($payload, 'status_callback'), + 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), + 'trunkSid' => Values::array_get($payload, 'trunk_sid'), + 'uri' => Values::array_get($payload, 'uri'), + 'voiceReceiveMode' => Values::array_get($payload, 'voice_receive_mode'), + 'voiceApplicationSid' => Values::array_get($payload, 'voice_application_sid'), + 'voiceCallerIdLookup' => Values::array_get($payload, 'voice_caller_id_lookup'), + 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), + 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), + 'voiceMethod' => Values::array_get($payload, 'voice_method'), + 'voiceUrl' => Values::array_get($payload, 'voice_url'), + 'emergencyStatus' => Values::array_get($payload, 'emergency_status'), + 'emergencyAddressSid' => Values::array_get($payload, 'emergency_address_sid'), + 'emergencyAddressStatus' => Values::array_get($payload, 'emergency_address_status'), + 'bundleSid' => Values::array_get($payload, 'bundle_sid'), + 'status' => Values::array_get($payload, 'status'), + ]; + + $this->solution = ['accountSid' => $accountSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.LocalInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalList.php b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalList.php new file mode 100755 index 0000000..6f6b84c --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalList.php @@ -0,0 +1,238 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/IncomingPhoneNumbers/Local.json'; + } + + /** + * Create the LocalInstance + * + * @param string $phoneNumber The phone number to purchase specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234. + * @param array|Options $options Optional Arguments + * @return LocalInstance Created LocalInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $phoneNumber, array $options = []): LocalInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'PhoneNumber' => + $phoneNumber, + 'ApiVersion' => + $options['apiVersion'], + 'FriendlyName' => + $options['friendlyName'], + 'SmsApplicationSid' => + $options['smsApplicationSid'], + 'SmsFallbackMethod' => + $options['smsFallbackMethod'], + 'SmsFallbackUrl' => + $options['smsFallbackUrl'], + 'SmsMethod' => + $options['smsMethod'], + 'SmsUrl' => + $options['smsUrl'], + 'StatusCallback' => + $options['statusCallback'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'VoiceApplicationSid' => + $options['voiceApplicationSid'], + 'VoiceCallerIdLookup' => + Serialize::booleanToString($options['voiceCallerIdLookup']), + 'VoiceFallbackMethod' => + $options['voiceFallbackMethod'], + 'VoiceFallbackUrl' => + $options['voiceFallbackUrl'], + 'VoiceMethod' => + $options['voiceMethod'], + 'VoiceUrl' => + $options['voiceUrl'], + 'IdentitySid' => + $options['identitySid'], + 'AddressSid' => + $options['addressSid'], + 'EmergencyStatus' => + $options['emergencyStatus'], + 'EmergencyAddressSid' => + $options['emergencyAddressSid'], + 'TrunkSid' => + $options['trunkSid'], + 'VoiceReceiveMode' => + $options['voiceReceiveMode'], + 'BundleSid' => + $options['bundleSid'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new LocalInstance( + $this->version, + $payload, + $this->solution['accountSid'] + ); + } + + + /** + * Reads LocalInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return LocalInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams LocalInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of LocalInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return LocalPage Page of LocalInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): LocalPage + { + $options = new Values($options); + + $params = Values::of([ + 'Beta' => + Serialize::booleanToString($options['beta']), + 'FriendlyName' => + $options['friendlyName'], + 'PhoneNumber' => + $options['phoneNumber'], + 'Origin' => + $options['origin'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new LocalPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of LocalInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return LocalPage Page of LocalInstance + */ + public function getPage(string $targetUrl): LocalPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new LocalPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.LocalList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalOptions.php new file mode 100755 index 0000000..6e385c1 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalOptions.php @@ -0,0 +1,556 @@ +options['apiVersion'] = $apiVersion; + $this->options['friendlyName'] = $friendlyName; + $this->options['smsApplicationSid'] = $smsApplicationSid; + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + $this->options['smsMethod'] = $smsMethod; + $this->options['smsUrl'] = $smsUrl; + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['voiceApplicationSid'] = $voiceApplicationSid; + $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + $this->options['voiceMethod'] = $voiceMethod; + $this->options['voiceUrl'] = $voiceUrl; + $this->options['identitySid'] = $identitySid; + $this->options['addressSid'] = $addressSid; + $this->options['emergencyStatus'] = $emergencyStatus; + $this->options['emergencyAddressSid'] = $emergencyAddressSid; + $this->options['trunkSid'] = $trunkSid; + $this->options['voiceReceiveMode'] = $voiceReceiveMode; + $this->options['bundleSid'] = $bundleSid; + } + + /** + * The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. + * + * @param string $apiVersion The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. + * @return $this Fluent Builder + */ + public function setApiVersion(string $apiVersion): self + { + $this->options['apiVersion'] = $apiVersion; + return $this; + } + + /** + * A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. + * + * @param string $friendlyName A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. + * + * @param string $smsApplicationSid The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. + * @return $this Fluent Builder + */ + public function setSmsApplicationSid(string $smsApplicationSid): self + { + $this->options['smsApplicationSid'] = $smsApplicationSid; + return $this; + } + + /** + * The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $smsFallbackMethod The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setSmsFallbackMethod(string $smsFallbackMethod): self + { + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + return $this; + } + + /** + * The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. + * + * @param string $smsFallbackUrl The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. + * @return $this Fluent Builder + */ + public function setSmsFallbackUrl(string $smsFallbackUrl): self + { + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + return $this; + } + + /** + * The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $smsMethod The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setSmsMethod(string $smsMethod): self + { + $this->options['smsMethod'] = $smsMethod; + return $this; + } + + /** + * The URL we should call when the new phone number receives an incoming SMS message. + * + * @param string $smsUrl The URL we should call when the new phone number receives an incoming SMS message. + * @return $this Fluent Builder + */ + public function setSmsUrl(string $smsUrl): self + { + $this->options['smsUrl'] = $smsUrl; + return $this; + } + + /** + * The URL we should call using the `status_callback_method` to send status information to your application. + * + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. + * + * @param string $voiceApplicationSid The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. + * @return $this Fluent Builder + */ + public function setVoiceApplicationSid(string $voiceApplicationSid): self + { + $this->options['voiceApplicationSid'] = $voiceApplicationSid; + return $this; + } + + /** + * Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. + * + * @param bool $voiceCallerIdLookup Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. + * @return $this Fluent Builder + */ + public function setVoiceCallerIdLookup(bool $voiceCallerIdLookup): self + { + $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; + return $this; + } + + /** + * The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $voiceFallbackMethod The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackMethod(string $voiceFallbackMethod): self + { + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + return $this; + } + + /** + * The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. + * + * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackUrl(string $voiceFallbackUrl): self + { + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + return $this; + } + + /** + * The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $voiceMethod The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setVoiceMethod(string $voiceMethod): self + { + $this->options['voiceMethod'] = $voiceMethod; + return $this; + } + + /** + * The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. + * + * @param string $voiceUrl The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. + * @return $this Fluent Builder + */ + public function setVoiceUrl(string $voiceUrl): self + { + $this->options['voiceUrl'] = $voiceUrl; + return $this; + } + + /** + * The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations. + * + * @param string $identitySid The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations. + * @return $this Fluent Builder + */ + public function setIdentitySid(string $identitySid): self + { + $this->options['identitySid'] = $identitySid; + return $this; + } + + /** + * The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. + * + * @param string $addressSid The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. + * @return $this Fluent Builder + */ + public function setAddressSid(string $addressSid): self + { + $this->options['addressSid'] = $addressSid; + return $this; + } + + /** + * @param string $emergencyStatus + * @return $this Fluent Builder + */ + public function setEmergencyStatus(string $emergencyStatus): self + { + $this->options['emergencyStatus'] = $emergencyStatus; + return $this; + } + + /** + * The SID of the emergency address configuration to use for emergency calling from the new phone number. + * + * @param string $emergencyAddressSid The SID of the emergency address configuration to use for emergency calling from the new phone number. + * @return $this Fluent Builder + */ + public function setEmergencyAddressSid(string $emergencyAddressSid): self + { + $this->options['emergencyAddressSid'] = $emergencyAddressSid; + return $this; + } + + /** + * The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. + * + * @param string $trunkSid The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. + * @return $this Fluent Builder + */ + public function setTrunkSid(string $trunkSid): self + { + $this->options['trunkSid'] = $trunkSid; + return $this; + } + + /** + * @param string $voiceReceiveMode + * @return $this Fluent Builder + */ + public function setVoiceReceiveMode(string $voiceReceiveMode): self + { + $this->options['voiceReceiveMode'] = $voiceReceiveMode; + return $this; + } + + /** + * The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. + * + * @param string $bundleSid The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. + * @return $this Fluent Builder + */ + public function setBundleSid(string $bundleSid): self + { + $this->options['bundleSid'] = $bundleSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateLocalOptions ' . $options . ']'; + } +} + +class ReadLocalOptions extends Options + { + /** + * @param bool $beta Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * @param string $friendlyName A string that identifies the resources to read. + * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. + * @param string $origin Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. + */ + public function __construct( + + bool $beta = Values::BOOL_NONE, + string $friendlyName = Values::NONE, + string $phoneNumber = Values::NONE, + string $origin = Values::NONE + + ) { + $this->options['beta'] = $beta; + $this->options['friendlyName'] = $friendlyName; + $this->options['phoneNumber'] = $phoneNumber; + $this->options['origin'] = $origin; + } + + /** + * Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * + * @param bool $beta Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * @return $this Fluent Builder + */ + public function setBeta(bool $beta): self + { + $this->options['beta'] = $beta; + return $this; + } + + /** + * A string that identifies the resources to read. + * + * @param string $friendlyName A string that identifies the resources to read. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. + * + * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. + * @return $this Fluent Builder + */ + public function setPhoneNumber(string $phoneNumber): self + { + $this->options['phoneNumber'] = $phoneNumber; + return $this; + } + + /** + * Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. + * + * @param string $origin Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. + * @return $this Fluent Builder + */ + public function setOrigin(string $origin): self + { + $this->options['origin'] = $origin; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadLocalOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalPage.php b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalPage.php new file mode 100755 index 0000000..278b0b6 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/LocalPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return LocalInstance \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\LocalInstance + */ + public function buildInstance(array $payload): LocalInstance + { + return new LocalInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.LocalPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobileInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobileInstance.php new file mode 100755 index 0000000..d1a63dd --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobileInstance.php @@ -0,0 +1,149 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'addressSid' => Values::array_get($payload, 'address_sid'), + 'addressRequirements' => Values::array_get($payload, 'address_requirements'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'beta' => Values::array_get($payload, 'beta'), + 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'identitySid' => Values::array_get($payload, 'identity_sid'), + 'phoneNumber' => Values::array_get($payload, 'phone_number'), + 'origin' => Values::array_get($payload, 'origin'), + 'sid' => Values::array_get($payload, 'sid'), + 'smsApplicationSid' => Values::array_get($payload, 'sms_application_sid'), + 'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'), + 'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'), + 'smsMethod' => Values::array_get($payload, 'sms_method'), + 'smsUrl' => Values::array_get($payload, 'sms_url'), + 'statusCallback' => Values::array_get($payload, 'status_callback'), + 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), + 'trunkSid' => Values::array_get($payload, 'trunk_sid'), + 'uri' => Values::array_get($payload, 'uri'), + 'voiceReceiveMode' => Values::array_get($payload, 'voice_receive_mode'), + 'voiceApplicationSid' => Values::array_get($payload, 'voice_application_sid'), + 'voiceCallerIdLookup' => Values::array_get($payload, 'voice_caller_id_lookup'), + 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), + 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), + 'voiceMethod' => Values::array_get($payload, 'voice_method'), + 'voiceUrl' => Values::array_get($payload, 'voice_url'), + 'emergencyStatus' => Values::array_get($payload, 'emergency_status'), + 'emergencyAddressSid' => Values::array_get($payload, 'emergency_address_sid'), + 'emergencyAddressStatus' => Values::array_get($payload, 'emergency_address_status'), + 'bundleSid' => Values::array_get($payload, 'bundle_sid'), + 'status' => Values::array_get($payload, 'status'), + ]; + + $this->solution = ['accountSid' => $accountSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.MobileInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobileList.php b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobileList.php new file mode 100755 index 0000000..10bde33 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobileList.php @@ -0,0 +1,238 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/IncomingPhoneNumbers/Mobile.json'; + } + + /** + * Create the MobileInstance + * + * @param string $phoneNumber The phone number to purchase specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234. + * @param array|Options $options Optional Arguments + * @return MobileInstance Created MobileInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $phoneNumber, array $options = []): MobileInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'PhoneNumber' => + $phoneNumber, + 'ApiVersion' => + $options['apiVersion'], + 'FriendlyName' => + $options['friendlyName'], + 'SmsApplicationSid' => + $options['smsApplicationSid'], + 'SmsFallbackMethod' => + $options['smsFallbackMethod'], + 'SmsFallbackUrl' => + $options['smsFallbackUrl'], + 'SmsMethod' => + $options['smsMethod'], + 'SmsUrl' => + $options['smsUrl'], + 'StatusCallback' => + $options['statusCallback'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'VoiceApplicationSid' => + $options['voiceApplicationSid'], + 'VoiceCallerIdLookup' => + Serialize::booleanToString($options['voiceCallerIdLookup']), + 'VoiceFallbackMethod' => + $options['voiceFallbackMethod'], + 'VoiceFallbackUrl' => + $options['voiceFallbackUrl'], + 'VoiceMethod' => + $options['voiceMethod'], + 'VoiceUrl' => + $options['voiceUrl'], + 'IdentitySid' => + $options['identitySid'], + 'AddressSid' => + $options['addressSid'], + 'EmergencyStatus' => + $options['emergencyStatus'], + 'EmergencyAddressSid' => + $options['emergencyAddressSid'], + 'TrunkSid' => + $options['trunkSid'], + 'VoiceReceiveMode' => + $options['voiceReceiveMode'], + 'BundleSid' => + $options['bundleSid'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new MobileInstance( + $this->version, + $payload, + $this->solution['accountSid'] + ); + } + + + /** + * Reads MobileInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return MobileInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams MobileInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of MobileInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return MobilePage Page of MobileInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MobilePage + { + $options = new Values($options); + + $params = Values::of([ + 'Beta' => + Serialize::booleanToString($options['beta']), + 'FriendlyName' => + $options['friendlyName'], + 'PhoneNumber' => + $options['phoneNumber'], + 'Origin' => + $options['origin'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new MobilePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of MobileInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return MobilePage Page of MobileInstance + */ + public function getPage(string $targetUrl): MobilePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new MobilePage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.MobileList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobileOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobileOptions.php new file mode 100755 index 0000000..e0cc36e --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobileOptions.php @@ -0,0 +1,556 @@ +options['apiVersion'] = $apiVersion; + $this->options['friendlyName'] = $friendlyName; + $this->options['smsApplicationSid'] = $smsApplicationSid; + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + $this->options['smsMethod'] = $smsMethod; + $this->options['smsUrl'] = $smsUrl; + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['voiceApplicationSid'] = $voiceApplicationSid; + $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + $this->options['voiceMethod'] = $voiceMethod; + $this->options['voiceUrl'] = $voiceUrl; + $this->options['identitySid'] = $identitySid; + $this->options['addressSid'] = $addressSid; + $this->options['emergencyStatus'] = $emergencyStatus; + $this->options['emergencyAddressSid'] = $emergencyAddressSid; + $this->options['trunkSid'] = $trunkSid; + $this->options['voiceReceiveMode'] = $voiceReceiveMode; + $this->options['bundleSid'] = $bundleSid; + } + + /** + * The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. + * + * @param string $apiVersion The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. + * @return $this Fluent Builder + */ + public function setApiVersion(string $apiVersion): self + { + $this->options['apiVersion'] = $apiVersion; + return $this; + } + + /** + * A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, the is a formatted version of the phone number. + * + * @param string $friendlyName A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, the is a formatted version of the phone number. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those of the application. + * + * @param string $smsApplicationSid The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those of the application. + * @return $this Fluent Builder + */ + public function setSmsApplicationSid(string $smsApplicationSid): self + { + $this->options['smsApplicationSid'] = $smsApplicationSid; + return $this; + } + + /** + * The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $smsFallbackMethod The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setSmsFallbackMethod(string $smsFallbackMethod): self + { + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + return $this; + } + + /** + * The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. + * + * @param string $smsFallbackUrl The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. + * @return $this Fluent Builder + */ + public function setSmsFallbackUrl(string $smsFallbackUrl): self + { + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + return $this; + } + + /** + * The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $smsMethod The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setSmsMethod(string $smsMethod): self + { + $this->options['smsMethod'] = $smsMethod; + return $this; + } + + /** + * The URL we should call when the new phone number receives an incoming SMS message. + * + * @param string $smsUrl The URL we should call when the new phone number receives an incoming SMS message. + * @return $this Fluent Builder + */ + public function setSmsUrl(string $smsUrl): self + { + $this->options['smsUrl'] = $smsUrl; + return $this; + } + + /** + * The URL we should call using the `status_callback_method` to send status information to your application. + * + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. + * + * @param string $voiceApplicationSid The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. + * @return $this Fluent Builder + */ + public function setVoiceApplicationSid(string $voiceApplicationSid): self + { + $this->options['voiceApplicationSid'] = $voiceApplicationSid; + return $this; + } + + /** + * Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. + * + * @param bool $voiceCallerIdLookup Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. + * @return $this Fluent Builder + */ + public function setVoiceCallerIdLookup(bool $voiceCallerIdLookup): self + { + $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; + return $this; + } + + /** + * The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $voiceFallbackMethod The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackMethod(string $voiceFallbackMethod): self + { + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + return $this; + } + + /** + * The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. + * + * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackUrl(string $voiceFallbackUrl): self + { + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + return $this; + } + + /** + * The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $voiceMethod The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setVoiceMethod(string $voiceMethod): self + { + $this->options['voiceMethod'] = $voiceMethod; + return $this; + } + + /** + * The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. + * + * @param string $voiceUrl The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. + * @return $this Fluent Builder + */ + public function setVoiceUrl(string $voiceUrl): self + { + $this->options['voiceUrl'] = $voiceUrl; + return $this; + } + + /** + * The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations. + * + * @param string $identitySid The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations. + * @return $this Fluent Builder + */ + public function setIdentitySid(string $identitySid): self + { + $this->options['identitySid'] = $identitySid; + return $this; + } + + /** + * The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. + * + * @param string $addressSid The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. + * @return $this Fluent Builder + */ + public function setAddressSid(string $addressSid): self + { + $this->options['addressSid'] = $addressSid; + return $this; + } + + /** + * @param string $emergencyStatus + * @return $this Fluent Builder + */ + public function setEmergencyStatus(string $emergencyStatus): self + { + $this->options['emergencyStatus'] = $emergencyStatus; + return $this; + } + + /** + * The SID of the emergency address configuration to use for emergency calling from the new phone number. + * + * @param string $emergencyAddressSid The SID of the emergency address configuration to use for emergency calling from the new phone number. + * @return $this Fluent Builder + */ + public function setEmergencyAddressSid(string $emergencyAddressSid): self + { + $this->options['emergencyAddressSid'] = $emergencyAddressSid; + return $this; + } + + /** + * The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. + * + * @param string $trunkSid The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. + * @return $this Fluent Builder + */ + public function setTrunkSid(string $trunkSid): self + { + $this->options['trunkSid'] = $trunkSid; + return $this; + } + + /** + * @param string $voiceReceiveMode + * @return $this Fluent Builder + */ + public function setVoiceReceiveMode(string $voiceReceiveMode): self + { + $this->options['voiceReceiveMode'] = $voiceReceiveMode; + return $this; + } + + /** + * The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. + * + * @param string $bundleSid The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. + * @return $this Fluent Builder + */ + public function setBundleSid(string $bundleSid): self + { + $this->options['bundleSid'] = $bundleSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateMobileOptions ' . $options . ']'; + } +} + +class ReadMobileOptions extends Options + { + /** + * @param bool $beta Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * @param string $friendlyName A string that identifies the resources to read. + * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. + * @param string $origin Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. + */ + public function __construct( + + bool $beta = Values::BOOL_NONE, + string $friendlyName = Values::NONE, + string $phoneNumber = Values::NONE, + string $origin = Values::NONE + + ) { + $this->options['beta'] = $beta; + $this->options['friendlyName'] = $friendlyName; + $this->options['phoneNumber'] = $phoneNumber; + $this->options['origin'] = $origin; + } + + /** + * Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * + * @param bool $beta Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * @return $this Fluent Builder + */ + public function setBeta(bool $beta): self + { + $this->options['beta'] = $beta; + return $this; + } + + /** + * A string that identifies the resources to read. + * + * @param string $friendlyName A string that identifies the resources to read. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. + * + * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. + * @return $this Fluent Builder + */ + public function setPhoneNumber(string $phoneNumber): self + { + $this->options['phoneNumber'] = $phoneNumber; + return $this; + } + + /** + * Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. + * + * @param string $origin Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. + * @return $this Fluent Builder + */ + public function setOrigin(string $origin): self + { + $this->options['origin'] = $origin; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadMobileOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobilePage.php b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobilePage.php new file mode 100755 index 0000000..3037fbd --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/MobilePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MobileInstance \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\MobileInstance + */ + public function buildInstance(array $payload): MobileInstance + { + return new MobileInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.MobilePage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreeInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreeInstance.php new file mode 100755 index 0000000..e3be2d3 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreeInstance.php @@ -0,0 +1,149 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'addressSid' => Values::array_get($payload, 'address_sid'), + 'addressRequirements' => Values::array_get($payload, 'address_requirements'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'beta' => Values::array_get($payload, 'beta'), + 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'identitySid' => Values::array_get($payload, 'identity_sid'), + 'phoneNumber' => Values::array_get($payload, 'phone_number'), + 'origin' => Values::array_get($payload, 'origin'), + 'sid' => Values::array_get($payload, 'sid'), + 'smsApplicationSid' => Values::array_get($payload, 'sms_application_sid'), + 'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'), + 'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'), + 'smsMethod' => Values::array_get($payload, 'sms_method'), + 'smsUrl' => Values::array_get($payload, 'sms_url'), + 'statusCallback' => Values::array_get($payload, 'status_callback'), + 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), + 'trunkSid' => Values::array_get($payload, 'trunk_sid'), + 'uri' => Values::array_get($payload, 'uri'), + 'voiceReceiveMode' => Values::array_get($payload, 'voice_receive_mode'), + 'voiceApplicationSid' => Values::array_get($payload, 'voice_application_sid'), + 'voiceCallerIdLookup' => Values::array_get($payload, 'voice_caller_id_lookup'), + 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), + 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), + 'voiceMethod' => Values::array_get($payload, 'voice_method'), + 'voiceUrl' => Values::array_get($payload, 'voice_url'), + 'emergencyStatus' => Values::array_get($payload, 'emergency_status'), + 'emergencyAddressSid' => Values::array_get($payload, 'emergency_address_sid'), + 'emergencyAddressStatus' => Values::array_get($payload, 'emergency_address_status'), + 'bundleSid' => Values::array_get($payload, 'bundle_sid'), + 'status' => Values::array_get($payload, 'status'), + ]; + + $this->solution = ['accountSid' => $accountSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.TollFreeInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreeList.php b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreeList.php new file mode 100755 index 0000000..802d9a3 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreeList.php @@ -0,0 +1,238 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/IncomingPhoneNumbers/TollFree.json'; + } + + /** + * Create the TollFreeInstance + * + * @param string $phoneNumber The phone number to purchase specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234. + * @param array|Options $options Optional Arguments + * @return TollFreeInstance Created TollFreeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $phoneNumber, array $options = []): TollFreeInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'PhoneNumber' => + $phoneNumber, + 'ApiVersion' => + $options['apiVersion'], + 'FriendlyName' => + $options['friendlyName'], + 'SmsApplicationSid' => + $options['smsApplicationSid'], + 'SmsFallbackMethod' => + $options['smsFallbackMethod'], + 'SmsFallbackUrl' => + $options['smsFallbackUrl'], + 'SmsMethod' => + $options['smsMethod'], + 'SmsUrl' => + $options['smsUrl'], + 'StatusCallback' => + $options['statusCallback'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'VoiceApplicationSid' => + $options['voiceApplicationSid'], + 'VoiceCallerIdLookup' => + Serialize::booleanToString($options['voiceCallerIdLookup']), + 'VoiceFallbackMethod' => + $options['voiceFallbackMethod'], + 'VoiceFallbackUrl' => + $options['voiceFallbackUrl'], + 'VoiceMethod' => + $options['voiceMethod'], + 'VoiceUrl' => + $options['voiceUrl'], + 'IdentitySid' => + $options['identitySid'], + 'AddressSid' => + $options['addressSid'], + 'EmergencyStatus' => + $options['emergencyStatus'], + 'EmergencyAddressSid' => + $options['emergencyAddressSid'], + 'TrunkSid' => + $options['trunkSid'], + 'VoiceReceiveMode' => + $options['voiceReceiveMode'], + 'BundleSid' => + $options['bundleSid'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new TollFreeInstance( + $this->version, + $payload, + $this->solution['accountSid'] + ); + } + + + /** + * Reads TollFreeInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return TollFreeInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams TollFreeInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of TollFreeInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return TollFreePage Page of TollFreeInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): TollFreePage + { + $options = new Values($options); + + $params = Values::of([ + 'Beta' => + Serialize::booleanToString($options['beta']), + 'FriendlyName' => + $options['friendlyName'], + 'PhoneNumber' => + $options['phoneNumber'], + 'Origin' => + $options['origin'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new TollFreePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of TollFreeInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return TollFreePage Page of TollFreeInstance + */ + public function getPage(string $targetUrl): TollFreePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new TollFreePage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.TollFreeList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreeOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreeOptions.php new file mode 100755 index 0000000..cc36402 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreeOptions.php @@ -0,0 +1,556 @@ +options['apiVersion'] = $apiVersion; + $this->options['friendlyName'] = $friendlyName; + $this->options['smsApplicationSid'] = $smsApplicationSid; + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + $this->options['smsMethod'] = $smsMethod; + $this->options['smsUrl'] = $smsUrl; + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['voiceApplicationSid'] = $voiceApplicationSid; + $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + $this->options['voiceMethod'] = $voiceMethod; + $this->options['voiceUrl'] = $voiceUrl; + $this->options['identitySid'] = $identitySid; + $this->options['addressSid'] = $addressSid; + $this->options['emergencyStatus'] = $emergencyStatus; + $this->options['emergencyAddressSid'] = $emergencyAddressSid; + $this->options['trunkSid'] = $trunkSid; + $this->options['voiceReceiveMode'] = $voiceReceiveMode; + $this->options['bundleSid'] = $bundleSid; + } + + /** + * The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. + * + * @param string $apiVersion The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. + * @return $this Fluent Builder + */ + public function setApiVersion(string $apiVersion): self + { + $this->options['apiVersion'] = $apiVersion; + return $this; + } + + /** + * A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. + * + * @param string $friendlyName A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all `sms_*_url` values and use those of the application. + * + * @param string $smsApplicationSid The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all `sms_*_url` values and use those of the application. + * @return $this Fluent Builder + */ + public function setSmsApplicationSid(string $smsApplicationSid): self + { + $this->options['smsApplicationSid'] = $smsApplicationSid; + return $this; + } + + /** + * The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $smsFallbackMethod The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setSmsFallbackMethod(string $smsFallbackMethod): self + { + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + return $this; + } + + /** + * The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. + * + * @param string $smsFallbackUrl The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. + * @return $this Fluent Builder + */ + public function setSmsFallbackUrl(string $smsFallbackUrl): self + { + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + return $this; + } + + /** + * The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $smsMethod The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setSmsMethod(string $smsMethod): self + { + $this->options['smsMethod'] = $smsMethod; + return $this; + } + + /** + * The URL we should call when the new phone number receives an incoming SMS message. + * + * @param string $smsUrl The URL we should call when the new phone number receives an incoming SMS message. + * @return $this Fluent Builder + */ + public function setSmsUrl(string $smsUrl): self + { + $this->options['smsUrl'] = $smsUrl; + return $this; + } + + /** + * The URL we should call using the `status_callback_method` to send status information to your application. + * + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. + * + * @param string $voiceApplicationSid The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. + * @return $this Fluent Builder + */ + public function setVoiceApplicationSid(string $voiceApplicationSid): self + { + $this->options['voiceApplicationSid'] = $voiceApplicationSid; + return $this; + } + + /** + * Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. + * + * @param bool $voiceCallerIdLookup Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. + * @return $this Fluent Builder + */ + public function setVoiceCallerIdLookup(bool $voiceCallerIdLookup): self + { + $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; + return $this; + } + + /** + * The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $voiceFallbackMethod The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackMethod(string $voiceFallbackMethod): self + { + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + return $this; + } + + /** + * The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. + * + * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackUrl(string $voiceFallbackUrl): self + { + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + return $this; + } + + /** + * The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $voiceMethod The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setVoiceMethod(string $voiceMethod): self + { + $this->options['voiceMethod'] = $voiceMethod; + return $this; + } + + /** + * The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. + * + * @param string $voiceUrl The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. + * @return $this Fluent Builder + */ + public function setVoiceUrl(string $voiceUrl): self + { + $this->options['voiceUrl'] = $voiceUrl; + return $this; + } + + /** + * The SID of the Identity resource that we should associate with the new phone number. Some regions require an Identity to meet local regulations. + * + * @param string $identitySid The SID of the Identity resource that we should associate with the new phone number. Some regions require an Identity to meet local regulations. + * @return $this Fluent Builder + */ + public function setIdentitySid(string $identitySid): self + { + $this->options['identitySid'] = $identitySid; + return $this; + } + + /** + * The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. + * + * @param string $addressSid The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. + * @return $this Fluent Builder + */ + public function setAddressSid(string $addressSid): self + { + $this->options['addressSid'] = $addressSid; + return $this; + } + + /** + * @param string $emergencyStatus + * @return $this Fluent Builder + */ + public function setEmergencyStatus(string $emergencyStatus): self + { + $this->options['emergencyStatus'] = $emergencyStatus; + return $this; + } + + /** + * The SID of the emergency address configuration to use for emergency calling from the new phone number. + * + * @param string $emergencyAddressSid The SID of the emergency address configuration to use for emergency calling from the new phone number. + * @return $this Fluent Builder + */ + public function setEmergencyAddressSid(string $emergencyAddressSid): self + { + $this->options['emergencyAddressSid'] = $emergencyAddressSid; + return $this; + } + + /** + * The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. + * + * @param string $trunkSid The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. + * @return $this Fluent Builder + */ + public function setTrunkSid(string $trunkSid): self + { + $this->options['trunkSid'] = $trunkSid; + return $this; + } + + /** + * @param string $voiceReceiveMode + * @return $this Fluent Builder + */ + public function setVoiceReceiveMode(string $voiceReceiveMode): self + { + $this->options['voiceReceiveMode'] = $voiceReceiveMode; + return $this; + } + + /** + * The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. + * + * @param string $bundleSid The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. + * @return $this Fluent Builder + */ + public function setBundleSid(string $bundleSid): self + { + $this->options['bundleSid'] = $bundleSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateTollFreeOptions ' . $options . ']'; + } +} + +class ReadTollFreeOptions extends Options + { + /** + * @param bool $beta Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * @param string $friendlyName A string that identifies the resources to read. + * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. + * @param string $origin Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. + */ + public function __construct( + + bool $beta = Values::BOOL_NONE, + string $friendlyName = Values::NONE, + string $phoneNumber = Values::NONE, + string $origin = Values::NONE + + ) { + $this->options['beta'] = $beta; + $this->options['friendlyName'] = $friendlyName; + $this->options['phoneNumber'] = $phoneNumber; + $this->options['origin'] = $origin; + } + + /** + * Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * + * @param bool $beta Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * @return $this Fluent Builder + */ + public function setBeta(bool $beta): self + { + $this->options['beta'] = $beta; + return $this; + } + + /** + * A string that identifies the resources to read. + * + * @param string $friendlyName A string that identifies the resources to read. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. + * + * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. + * @return $this Fluent Builder + */ + public function setPhoneNumber(string $phoneNumber): self + { + $this->options['phoneNumber'] = $phoneNumber; + return $this; + } + + /** + * Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. + * + * @param string $origin Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. + * @return $this Fluent Builder + */ + public function setOrigin(string $origin): self + { + $this->options['origin'] = $origin; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadTollFreeOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreePage.php b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreePage.php new file mode 100755 index 0000000..9559f85 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumber/TollFreePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TollFreeInstance \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumber\TollFreeInstance + */ + public function buildInstance(array $payload): TollFreeInstance + { + return new TollFreeInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.TollFreePage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberContext.php b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberContext.php new file mode 100755 index 0000000..891f73a --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberContext.php @@ -0,0 +1,234 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/IncomingPhoneNumbers/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the IncomingPhoneNumberInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the IncomingPhoneNumberInstance + * + * @return IncomingPhoneNumberInstance Fetched IncomingPhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): IncomingPhoneNumberInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new IncomingPhoneNumberInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the IncomingPhoneNumberInstance + * + * @param array|Options $options Optional Arguments + * @return IncomingPhoneNumberInstance Updated IncomingPhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): IncomingPhoneNumberInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'AccountSid' => + $options['accountSid'], + 'ApiVersion' => + $options['apiVersion'], + 'FriendlyName' => + $options['friendlyName'], + 'SmsApplicationSid' => + $options['smsApplicationSid'], + 'SmsFallbackMethod' => + $options['smsFallbackMethod'], + 'SmsFallbackUrl' => + $options['smsFallbackUrl'], + 'SmsMethod' => + $options['smsMethod'], + 'SmsUrl' => + $options['smsUrl'], + 'StatusCallback' => + $options['statusCallback'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'VoiceApplicationSid' => + $options['voiceApplicationSid'], + 'VoiceCallerIdLookup' => + Serialize::booleanToString($options['voiceCallerIdLookup']), + 'VoiceFallbackMethod' => + $options['voiceFallbackMethod'], + 'VoiceFallbackUrl' => + $options['voiceFallbackUrl'], + 'VoiceMethod' => + $options['voiceMethod'], + 'VoiceUrl' => + $options['voiceUrl'], + 'EmergencyStatus' => + $options['emergencyStatus'], + 'EmergencyAddressSid' => + $options['emergencyAddressSid'], + 'TrunkSid' => + $options['trunkSid'], + 'VoiceReceiveMode' => + $options['voiceReceiveMode'], + 'IdentitySid' => + $options['identitySid'], + 'AddressSid' => + $options['addressSid'], + 'BundleSid' => + $options['bundleSid'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new IncomingPhoneNumberInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the assignedAddOns + */ + protected function getAssignedAddOns(): AssignedAddOnList + { + if (!$this->_assignedAddOns) { + $this->_assignedAddOns = new AssignedAddOnList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_assignedAddOns; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.IncomingPhoneNumberContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberInstance.php new file mode 100755 index 0000000..5bcc665 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberInstance.php @@ -0,0 +1,222 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'addressSid' => Values::array_get($payload, 'address_sid'), + 'addressRequirements' => Values::array_get($payload, 'address_requirements'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'beta' => Values::array_get($payload, 'beta'), + 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'identitySid' => Values::array_get($payload, 'identity_sid'), + 'phoneNumber' => Values::array_get($payload, 'phone_number'), + 'origin' => Values::array_get($payload, 'origin'), + 'sid' => Values::array_get($payload, 'sid'), + 'smsApplicationSid' => Values::array_get($payload, 'sms_application_sid'), + 'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'), + 'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'), + 'smsMethod' => Values::array_get($payload, 'sms_method'), + 'smsUrl' => Values::array_get($payload, 'sms_url'), + 'statusCallback' => Values::array_get($payload, 'status_callback'), + 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), + 'trunkSid' => Values::array_get($payload, 'trunk_sid'), + 'uri' => Values::array_get($payload, 'uri'), + 'voiceReceiveMode' => Values::array_get($payload, 'voice_receive_mode'), + 'voiceApplicationSid' => Values::array_get($payload, 'voice_application_sid'), + 'voiceCallerIdLookup' => Values::array_get($payload, 'voice_caller_id_lookup'), + 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), + 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), + 'voiceMethod' => Values::array_get($payload, 'voice_method'), + 'voiceUrl' => Values::array_get($payload, 'voice_url'), + 'emergencyStatus' => Values::array_get($payload, 'emergency_status'), + 'emergencyAddressSid' => Values::array_get($payload, 'emergency_address_sid'), + 'emergencyAddressStatus' => Values::array_get($payload, 'emergency_address_status'), + 'bundleSid' => Values::array_get($payload, 'bundle_sid'), + 'status' => Values::array_get($payload, 'status'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return IncomingPhoneNumberContext Context for this IncomingPhoneNumberInstance + */ + protected function proxy(): IncomingPhoneNumberContext + { + if (!$this->context) { + $this->context = new IncomingPhoneNumberContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the IncomingPhoneNumberInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the IncomingPhoneNumberInstance + * + * @return IncomingPhoneNumberInstance Fetched IncomingPhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): IncomingPhoneNumberInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the IncomingPhoneNumberInstance + * + * @param array|Options $options Optional Arguments + * @return IncomingPhoneNumberInstance Updated IncomingPhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): IncomingPhoneNumberInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the assignedAddOns + */ + protected function getAssignedAddOns(): AssignedAddOnList + { + return $this->proxy()->assignedAddOns; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.IncomingPhoneNumberInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberList.php b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberList.php new file mode 100755 index 0000000..2d646c8 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberList.php @@ -0,0 +1,346 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/IncomingPhoneNumbers.json'; + } + + /** + * Create the IncomingPhoneNumberInstance + * + * @param array|Options $options Optional Arguments + * @return IncomingPhoneNumberInstance Created IncomingPhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): IncomingPhoneNumberInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'ApiVersion' => + $options['apiVersion'], + 'FriendlyName' => + $options['friendlyName'], + 'SmsApplicationSid' => + $options['smsApplicationSid'], + 'SmsFallbackMethod' => + $options['smsFallbackMethod'], + 'SmsFallbackUrl' => + $options['smsFallbackUrl'], + 'SmsMethod' => + $options['smsMethod'], + 'SmsUrl' => + $options['smsUrl'], + 'StatusCallback' => + $options['statusCallback'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'VoiceApplicationSid' => + $options['voiceApplicationSid'], + 'VoiceCallerIdLookup' => + Serialize::booleanToString($options['voiceCallerIdLookup']), + 'VoiceFallbackMethod' => + $options['voiceFallbackMethod'], + 'VoiceFallbackUrl' => + $options['voiceFallbackUrl'], + 'VoiceMethod' => + $options['voiceMethod'], + 'VoiceUrl' => + $options['voiceUrl'], + 'EmergencyStatus' => + $options['emergencyStatus'], + 'EmergencyAddressSid' => + $options['emergencyAddressSid'], + 'TrunkSid' => + $options['trunkSid'], + 'IdentitySid' => + $options['identitySid'], + 'AddressSid' => + $options['addressSid'], + 'VoiceReceiveMode' => + $options['voiceReceiveMode'], + 'BundleSid' => + $options['bundleSid'], + 'PhoneNumber' => + $options['phoneNumber'], + 'AreaCode' => + $options['areaCode'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new IncomingPhoneNumberInstance( + $this->version, + $payload, + $this->solution['accountSid'] + ); + } + + + /** + * Reads IncomingPhoneNumberInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return IncomingPhoneNumberInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams IncomingPhoneNumberInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of IncomingPhoneNumberInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return IncomingPhoneNumberPage Page of IncomingPhoneNumberInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): IncomingPhoneNumberPage + { + $options = new Values($options); + + $params = Values::of([ + 'Beta' => + Serialize::booleanToString($options['beta']), + 'FriendlyName' => + $options['friendlyName'], + 'PhoneNumber' => + $options['phoneNumber'], + 'Origin' => + $options['origin'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new IncomingPhoneNumberPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of IncomingPhoneNumberInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return IncomingPhoneNumberPage Page of IncomingPhoneNumberInstance + */ + public function getPage(string $targetUrl): IncomingPhoneNumberPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new IncomingPhoneNumberPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a IncomingPhoneNumberContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the IncomingPhoneNumber resource to delete. + */ + public function getContext( + string $sid + + ): IncomingPhoneNumberContext + { + return new IncomingPhoneNumberContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Access the tollFree + */ + protected function getTollFree(): TollFreeList + { + if (!$this->_tollFree) { + $this->_tollFree = new TollFreeList( + $this->version, + $this->solution['accountSid'] + ); + } + return $this->_tollFree; + } + + /** + * Access the local + */ + protected function getLocal(): LocalList + { + if (!$this->_local) { + $this->_local = new LocalList( + $this->version, + $this->solution['accountSid'] + ); + } + return $this->_local; + } + + /** + * Access the mobile + */ + protected function getMobile(): MobileList + { + if (!$this->_mobile) { + $this->_mobile = new MobileList( + $this->version, + $this->solution['accountSid'] + ); + } + return $this->_mobile; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name) + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.IncomingPhoneNumberList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberOptions.php new file mode 100755 index 0000000..b2bc365 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberOptions.php @@ -0,0 +1,1040 @@ +options['phoneNumber'] = $phoneNumber; + $this->options['areaCode'] = $areaCode; + $this->options['apiVersion'] = $apiVersion; + $this->options['friendlyName'] = $friendlyName; + $this->options['smsApplicationSid'] = $smsApplicationSid; + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + $this->options['smsMethod'] = $smsMethod; + $this->options['smsUrl'] = $smsUrl; + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['voiceApplicationSid'] = $voiceApplicationSid; + $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + $this->options['voiceMethod'] = $voiceMethod; + $this->options['voiceUrl'] = $voiceUrl; + $this->options['emergencyStatus'] = $emergencyStatus; + $this->options['emergencyAddressSid'] = $emergencyAddressSid; + $this->options['trunkSid'] = $trunkSid; + $this->options['identitySid'] = $identitySid; + $this->options['addressSid'] = $addressSid; + $this->options['voiceReceiveMode'] = $voiceReceiveMode; + $this->options['bundleSid'] = $bundleSid; + } + + /** + * The phone number to purchase specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234. + * + * @param string $phoneNumber The phone number to purchase specified in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234. + * @return $this Fluent Builder + */ + public function setPhoneNumber(string $phoneNumber): self + { + $this->options['phoneNumber'] = $phoneNumber; + return $this; + } + + /** + * The desired area code for your new incoming phone number. Can be any three-digit, US or Canada area code. We will provision an available phone number within this area code for you. **You must provide an `area_code` or a `phone_number`.** (US and Canada only). + * + * @param string $areaCode The desired area code for your new incoming phone number. Can be any three-digit, US or Canada area code. We will provision an available phone number within this area code for you. **You must provide an `area_code` or a `phone_number`.** (US and Canada only). + * @return $this Fluent Builder + */ + public function setAreaCode(string $areaCode): self + { + $this->options['areaCode'] = $areaCode; + return $this; + } + + /** + * The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. + * + * @param string $apiVersion The API version to use for incoming calls made to the new phone number. The default is `2010-04-01`. + * @return $this Fluent Builder + */ + public function setApiVersion(string $apiVersion): self + { + $this->options['apiVersion'] = $apiVersion; + return $this; + } + + /** + * A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the new phone number. + * + * @param string $friendlyName A descriptive string that you created to describe the new phone number. It can be up to 64 characters long. By default, this is a formatted version of the new phone number. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. + * + * @param string $smsApplicationSid The SID of the application that should handle SMS messages sent to the new phone number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. + * @return $this Fluent Builder + */ + public function setSmsApplicationSid(string $smsApplicationSid): self + { + $this->options['smsApplicationSid'] = $smsApplicationSid; + return $this; + } + + /** + * The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $smsFallbackMethod The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setSmsFallbackMethod(string $smsFallbackMethod): self + { + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + return $this; + } + + /** + * The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. + * + * @param string $smsFallbackUrl The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. + * @return $this Fluent Builder + */ + public function setSmsFallbackUrl(string $smsFallbackUrl): self + { + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + return $this; + } + + /** + * The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $smsMethod The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setSmsMethod(string $smsMethod): self + { + $this->options['smsMethod'] = $smsMethod; + return $this; + } + + /** + * The URL we should call when the new phone number receives an incoming SMS message. + * + * @param string $smsUrl The URL we should call when the new phone number receives an incoming SMS message. + * @return $this Fluent Builder + */ + public function setSmsUrl(string $smsUrl): self + { + $this->options['smsUrl'] = $smsUrl; + return $this; + } + + /** + * The URL we should call using the `status_callback_method` to send status information to your application. + * + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. + * + * @param string $voiceApplicationSid The SID of the application we should use to handle calls to the new phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. + * @return $this Fluent Builder + */ + public function setVoiceApplicationSid(string $voiceApplicationSid): self + { + $this->options['voiceApplicationSid'] = $voiceApplicationSid; + return $this; + } + + /** + * Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. + * + * @param bool $voiceCallerIdLookup Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. + * @return $this Fluent Builder + */ + public function setVoiceCallerIdLookup(bool $voiceCallerIdLookup): self + { + $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; + return $this; + } + + /** + * The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $voiceFallbackMethod The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackMethod(string $voiceFallbackMethod): self + { + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + return $this; + } + + /** + * The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. + * + * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackUrl(string $voiceFallbackUrl): self + { + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + return $this; + } + + /** + * The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $voiceMethod The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setVoiceMethod(string $voiceMethod): self + { + $this->options['voiceMethod'] = $voiceMethod; + return $this; + } + + /** + * The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. + * + * @param string $voiceUrl The URL that we should call to answer a call to the new phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. + * @return $this Fluent Builder + */ + public function setVoiceUrl(string $voiceUrl): self + { + $this->options['voiceUrl'] = $voiceUrl; + return $this; + } + + /** + * @param string $emergencyStatus + * @return $this Fluent Builder + */ + public function setEmergencyStatus(string $emergencyStatus): self + { + $this->options['emergencyStatus'] = $emergencyStatus; + return $this; + } + + /** + * The SID of the emergency address configuration to use for emergency calling from the new phone number. + * + * @param string $emergencyAddressSid The SID of the emergency address configuration to use for emergency calling from the new phone number. + * @return $this Fluent Builder + */ + public function setEmergencyAddressSid(string $emergencyAddressSid): self + { + $this->options['emergencyAddressSid'] = $emergencyAddressSid; + return $this; + } + + /** + * The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. + * + * @param string $trunkSid The SID of the Trunk we should use to handle calls to the new phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. + * @return $this Fluent Builder + */ + public function setTrunkSid(string $trunkSid): self + { + $this->options['trunkSid'] = $trunkSid; + return $this; + } + + /** + * The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations. + * + * @param string $identitySid The SID of the Identity resource that we should associate with the new phone number. Some regions require an identity to meet local regulations. + * @return $this Fluent Builder + */ + public function setIdentitySid(string $identitySid): self + { + $this->options['identitySid'] = $identitySid; + return $this; + } + + /** + * The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. + * + * @param string $addressSid The SID of the Address resource we should associate with the new phone number. Some regions require addresses to meet local regulations. + * @return $this Fluent Builder + */ + public function setAddressSid(string $addressSid): self + { + $this->options['addressSid'] = $addressSid; + return $this; + } + + /** + * @param string $voiceReceiveMode + * @return $this Fluent Builder + */ + public function setVoiceReceiveMode(string $voiceReceiveMode): self + { + $this->options['voiceReceiveMode'] = $voiceReceiveMode; + return $this; + } + + /** + * The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. + * + * @param string $bundleSid The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. + * @return $this Fluent Builder + */ + public function setBundleSid(string $bundleSid): self + { + $this->options['bundleSid'] = $bundleSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateIncomingPhoneNumberOptions ' . $options . ']'; + } +} + + + +class ReadIncomingPhoneNumberOptions extends Options + { + /** + * @param bool $beta Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * @param string $friendlyName A string that identifies the IncomingPhoneNumber resources to read. + * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. + * @param string $origin Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. + */ + public function __construct( + + bool $beta = Values::BOOL_NONE, + string $friendlyName = Values::NONE, + string $phoneNumber = Values::NONE, + string $origin = Values::NONE + + ) { + $this->options['beta'] = $beta; + $this->options['friendlyName'] = $friendlyName; + $this->options['phoneNumber'] = $phoneNumber; + $this->options['origin'] = $origin; + } + + /** + * Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * + * @param bool $beta Whether to include phone numbers new to the Twilio platform. Can be: `true` or `false` and the default is `true`. + * @return $this Fluent Builder + */ + public function setBeta(bool $beta): self + { + $this->options['beta'] = $beta; + return $this; + } + + /** + * A string that identifies the IncomingPhoneNumber resources to read. + * + * @param string $friendlyName A string that identifies the IncomingPhoneNumber resources to read. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. + * + * @param string $phoneNumber The phone numbers of the IncomingPhoneNumber resources to read. You can specify partial numbers and use '*' as a wildcard for any digit. + * @return $this Fluent Builder + */ + public function setPhoneNumber(string $phoneNumber): self + { + $this->options['phoneNumber'] = $phoneNumber; + return $this; + } + + /** + * Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. + * + * @param string $origin Whether to include phone numbers based on their origin. Can be: `twilio` or `hosted`. By default, phone numbers of all origin are included. + * @return $this Fluent Builder + */ + public function setOrigin(string $origin): self + { + $this->options['origin'] = $origin; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadIncomingPhoneNumberOptions ' . $options . ']'; + } +} + +class UpdateIncomingPhoneNumberOptions extends Options + { + /** + * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IncomingPhoneNumber resource to update. For more information, see [Exchanging Numbers Between Subaccounts](https://www.twilio.com/docs/iam/api/subaccounts#exchanging-numbers). + * @param string $apiVersion The API version to use for incoming calls made to the phone number. The default is `2010-04-01`. + * @param string $friendlyName A descriptive string that you created to describe this phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. + * @param string $smsApplicationSid The SID of the application that should handle SMS messages sent to the number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. + * @param string $smsFallbackMethod The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @param string $smsFallbackUrl The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. + * @param string $smsMethod The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @param string $smsUrl The URL we should call when the phone number receives an incoming SMS message. + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @param string $voiceApplicationSid The SID of the application we should use to handle phone calls to the phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. + * @param bool $voiceCallerIdLookup Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. + * @param string $voiceFallbackMethod The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. + * @param string $voiceMethod The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @param string $voiceUrl The URL that we should call to answer a call to the phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. + * @param string $emergencyStatus + * @param string $emergencyAddressSid The SID of the emergency address configuration to use for emergency calling from this phone number. + * @param string $trunkSid The SID of the Trunk we should use to handle phone calls to the phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. + * @param string $voiceReceiveMode + * @param string $identitySid The SID of the Identity resource that we should associate with the phone number. Some regions require an identity to meet local regulations. + * @param string $addressSid The SID of the Address resource we should associate with the phone number. Some regions require addresses to meet local regulations. + * @param string $bundleSid The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. + */ + public function __construct( + + string $accountSid = Values::NONE, + string $apiVersion = Values::NONE, + string $friendlyName = Values::NONE, + string $smsApplicationSid = Values::NONE, + string $smsFallbackMethod = Values::NONE, + string $smsFallbackUrl = Values::NONE, + string $smsMethod = Values::NONE, + string $smsUrl = Values::NONE, + string $statusCallback = Values::NONE, + string $statusCallbackMethod = Values::NONE, + string $voiceApplicationSid = Values::NONE, + bool $voiceCallerIdLookup = Values::BOOL_NONE, + string $voiceFallbackMethod = Values::NONE, + string $voiceFallbackUrl = Values::NONE, + string $voiceMethod = Values::NONE, + string $voiceUrl = Values::NONE, + string $emergencyStatus = Values::NONE, + string $emergencyAddressSid = Values::NONE, + string $trunkSid = Values::NONE, + string $voiceReceiveMode = Values::NONE, + string $identitySid = Values::NONE, + string $addressSid = Values::NONE, + string $bundleSid = Values::NONE + + ) { + $this->options['accountSid'] = $accountSid; + $this->options['apiVersion'] = $apiVersion; + $this->options['friendlyName'] = $friendlyName; + $this->options['smsApplicationSid'] = $smsApplicationSid; + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + $this->options['smsMethod'] = $smsMethod; + $this->options['smsUrl'] = $smsUrl; + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['voiceApplicationSid'] = $voiceApplicationSid; + $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + $this->options['voiceMethod'] = $voiceMethod; + $this->options['voiceUrl'] = $voiceUrl; + $this->options['emergencyStatus'] = $emergencyStatus; + $this->options['emergencyAddressSid'] = $emergencyAddressSid; + $this->options['trunkSid'] = $trunkSid; + $this->options['voiceReceiveMode'] = $voiceReceiveMode; + $this->options['identitySid'] = $identitySid; + $this->options['addressSid'] = $addressSid; + $this->options['bundleSid'] = $bundleSid; + } + + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IncomingPhoneNumber resource to update. For more information, see [Exchanging Numbers Between Subaccounts](https://www.twilio.com/docs/iam/api/subaccounts#exchanging-numbers). + * + * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) that created the IncomingPhoneNumber resource to update. For more information, see [Exchanging Numbers Between Subaccounts](https://www.twilio.com/docs/iam/api/subaccounts#exchanging-numbers). + * @return $this Fluent Builder + */ + public function setAccountSid(string $accountSid): self + { + $this->options['accountSid'] = $accountSid; + return $this; + } + + /** + * The API version to use for incoming calls made to the phone number. The default is `2010-04-01`. + * + * @param string $apiVersion The API version to use for incoming calls made to the phone number. The default is `2010-04-01`. + * @return $this Fluent Builder + */ + public function setApiVersion(string $apiVersion): self + { + $this->options['apiVersion'] = $apiVersion; + return $this; + } + + /** + * A descriptive string that you created to describe this phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. + * + * @param string $friendlyName A descriptive string that you created to describe this phone number. It can be up to 64 characters long. By default, this is a formatted version of the phone number. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The SID of the application that should handle SMS messages sent to the number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. + * + * @param string $smsApplicationSid The SID of the application that should handle SMS messages sent to the number. If an `sms_application_sid` is present, we ignore all of the `sms_*_url` urls and use those set on the application. + * @return $this Fluent Builder + */ + public function setSmsApplicationSid(string $smsApplicationSid): self + { + $this->options['smsApplicationSid'] = $smsApplicationSid; + return $this; + } + + /** + * The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $smsFallbackMethod The HTTP method that we should use to call `sms_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setSmsFallbackMethod(string $smsFallbackMethod): self + { + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + return $this; + } + + /** + * The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. + * + * @param string $smsFallbackUrl The URL that we should call when an error occurs while requesting or executing the TwiML defined by `sms_url`. + * @return $this Fluent Builder + */ + public function setSmsFallbackUrl(string $smsFallbackUrl): self + { + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + return $this; + } + + /** + * The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $smsMethod The HTTP method that we should use to call `sms_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setSmsMethod(string $smsMethod): self + { + $this->options['smsMethod'] = $smsMethod; + return $this; + } + + /** + * The URL we should call when the phone number receives an incoming SMS message. + * + * @param string $smsUrl The URL we should call when the phone number receives an incoming SMS message. + * @return $this Fluent Builder + */ + public function setSmsUrl(string $smsUrl): self + { + $this->options['smsUrl'] = $smsUrl; + return $this; + } + + /** + * The URL we should call using the `status_callback_method` to send status information to your application. + * + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * The SID of the application we should use to handle phone calls to the phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. + * + * @param string $voiceApplicationSid The SID of the application we should use to handle phone calls to the phone number. If a `voice_application_sid` is present, we ignore all of the voice urls and use only those set on the application. Setting a `voice_application_sid` will automatically delete your `trunk_sid` and vice versa. + * @return $this Fluent Builder + */ + public function setVoiceApplicationSid(string $voiceApplicationSid): self + { + $this->options['voiceApplicationSid'] = $voiceApplicationSid; + return $this; + } + + /** + * Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. + * + * @param bool $voiceCallerIdLookup Whether to lookup the caller's name from the CNAM database and post it to your app. Can be: `true` or `false` and defaults to `false`. + * @return $this Fluent Builder + */ + public function setVoiceCallerIdLookup(bool $voiceCallerIdLookup): self + { + $this->options['voiceCallerIdLookup'] = $voiceCallerIdLookup; + return $this; + } + + /** + * The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $voiceFallbackMethod The HTTP method that we should use to call `voice_fallback_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackMethod(string $voiceFallbackMethod): self + { + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + return $this; + } + + /** + * The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. + * + * @param string $voiceFallbackUrl The URL that we should call when an error occurs retrieving or executing the TwiML requested by `url`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackUrl(string $voiceFallbackUrl): self + { + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + return $this; + } + + /** + * The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $voiceMethod The HTTP method that we should use to call `voice_url`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setVoiceMethod(string $voiceMethod): self + { + $this->options['voiceMethod'] = $voiceMethod; + return $this; + } + + /** + * The URL that we should call to answer a call to the phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. + * + * @param string $voiceUrl The URL that we should call to answer a call to the phone number. The `voice_url` will not be called if a `voice_application_sid` or a `trunk_sid` is set. + * @return $this Fluent Builder + */ + public function setVoiceUrl(string $voiceUrl): self + { + $this->options['voiceUrl'] = $voiceUrl; + return $this; + } + + /** + * @param string $emergencyStatus + * @return $this Fluent Builder + */ + public function setEmergencyStatus(string $emergencyStatus): self + { + $this->options['emergencyStatus'] = $emergencyStatus; + return $this; + } + + /** + * The SID of the emergency address configuration to use for emergency calling from this phone number. + * + * @param string $emergencyAddressSid The SID of the emergency address configuration to use for emergency calling from this phone number. + * @return $this Fluent Builder + */ + public function setEmergencyAddressSid(string $emergencyAddressSid): self + { + $this->options['emergencyAddressSid'] = $emergencyAddressSid; + return $this; + } + + /** + * The SID of the Trunk we should use to handle phone calls to the phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. + * + * @param string $trunkSid The SID of the Trunk we should use to handle phone calls to the phone number. If a `trunk_sid` is present, we ignore all of the voice urls and voice applications and use only those set on the Trunk. Setting a `trunk_sid` will automatically delete your `voice_application_sid` and vice versa. + * @return $this Fluent Builder + */ + public function setTrunkSid(string $trunkSid): self + { + $this->options['trunkSid'] = $trunkSid; + return $this; + } + + /** + * @param string $voiceReceiveMode + * @return $this Fluent Builder + */ + public function setVoiceReceiveMode(string $voiceReceiveMode): self + { + $this->options['voiceReceiveMode'] = $voiceReceiveMode; + return $this; + } + + /** + * The SID of the Identity resource that we should associate with the phone number. Some regions require an identity to meet local regulations. + * + * @param string $identitySid The SID of the Identity resource that we should associate with the phone number. Some regions require an identity to meet local regulations. + * @return $this Fluent Builder + */ + public function setIdentitySid(string $identitySid): self + { + $this->options['identitySid'] = $identitySid; + return $this; + } + + /** + * The SID of the Address resource we should associate with the phone number. Some regions require addresses to meet local regulations. + * + * @param string $addressSid The SID of the Address resource we should associate with the phone number. Some regions require addresses to meet local regulations. + * @return $this Fluent Builder + */ + public function setAddressSid(string $addressSid): self + { + $this->options['addressSid'] = $addressSid; + return $this; + } + + /** + * The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. + * + * @param string $bundleSid The SID of the Bundle resource that you associate with the phone number. Some regions require a Bundle to meet local Regulations. + * @return $this Fluent Builder + */ + public function setBundleSid(string $bundleSid): self + { + $this->options['bundleSid'] = $bundleSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateIncomingPhoneNumberOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberPage.php b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberPage.php new file mode 100755 index 0000000..48beab9 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/IncomingPhoneNumberPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return IncomingPhoneNumberInstance \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberInstance + */ + public function buildInstance(array $payload): IncomingPhoneNumberInstance + { + return new IncomingPhoneNumberInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.IncomingPhoneNumberPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/KeyContext.php b/app/api/Twilio/Rest/Api/V2010/Account/KeyContext.php new file mode 100755 index 0000000..6ffd21c --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/KeyContext.php @@ -0,0 +1,130 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Keys/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the KeyInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the KeyInstance + * + * @return KeyInstance Fetched KeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): KeyInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new KeyInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the KeyInstance + * + * @param array|Options $options Optional Arguments + * @return KeyInstance Updated KeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): KeyInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new KeyInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.KeyContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/KeyInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/KeyInstance.php new file mode 100755 index 0000000..2328d1a --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/KeyInstance.php @@ -0,0 +1,150 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + ]; + + $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return KeyContext Context for this KeyInstance + */ + protected function proxy(): KeyContext + { + if (!$this->context) { + $this->context = new KeyContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the KeyInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the KeyInstance + * + * @return KeyInstance Fetched KeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): KeyInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the KeyInstance + * + * @param array|Options $options Optional Arguments + * @return KeyInstance Updated KeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): KeyInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.KeyInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/KeyList.php b/app/api/Twilio/Rest/Api/V2010/Account/KeyList.php new file mode 100755 index 0000000..82d7412 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/KeyList.php @@ -0,0 +1,168 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Keys.json'; + } + + /** + * Reads KeyInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return KeyInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams KeyInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of KeyInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return KeyPage Page of KeyInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): KeyPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new KeyPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of KeyInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return KeyPage Page of KeyInstance + */ + public function getPage(string $targetUrl): KeyPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new KeyPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a KeyContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Key resource to delete. + */ + public function getContext( + string $sid + + ): KeyContext + { + return new KeyContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.KeyList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/KeyOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/KeyOptions.php new file mode 100755 index 0000000..def1c76 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/KeyOptions.php @@ -0,0 +1,82 @@ +options['friendlyName'] = $friendlyName; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateKeyOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/KeyPage.php b/app/api/Twilio/Rest/Api/V2010/Account/KeyPage.php new file mode 100755 index 0000000..868e632 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/KeyPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return KeyInstance \Twilio\Rest\Api\V2010\Account\KeyInstance + */ + public function buildInstance(array $payload): KeyInstance + { + return new KeyInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.KeyPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Message/FeedbackInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Message/FeedbackInstance.php new file mode 100755 index 0000000..403888d --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Message/FeedbackInstance.php @@ -0,0 +1,93 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'messageSid' => Values::array_get($payload, 'message_sid'), + 'outcome' => Values::array_get($payload, 'outcome'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'uri' => Values::array_get($payload, 'uri'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'messageSid' => $messageSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.FeedbackInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Message/FeedbackList.php b/app/api/Twilio/Rest/Api/V2010/Account/Message/FeedbackList.php new file mode 100755 index 0000000..68df509 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Message/FeedbackList.php @@ -0,0 +1,94 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'messageSid' => + $messageSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Messages/' . \rawurlencode($messageSid) + .'/Feedback.json'; + } + + /** + * Create the FeedbackInstance + * + * @param array|Options $options Optional Arguments + * @return FeedbackInstance Created FeedbackInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): FeedbackInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Outcome' => + $options['outcome'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new FeedbackInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['messageSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.FeedbackList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Message/FeedbackOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/Message/FeedbackOptions.php new file mode 100755 index 0000000..ab46991 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Message/FeedbackOptions.php @@ -0,0 +1,74 @@ +options['outcome'] = $outcome; + } + + /** + * @param string $outcome + * @return $this Fluent Builder + */ + public function setOutcome(string $outcome): self + { + $this->options['outcome'] = $outcome; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateFeedbackOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Message/FeedbackPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Message/FeedbackPage.php new file mode 100755 index 0000000..d421539 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Message/FeedbackPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return FeedbackInstance \Twilio\Rest\Api\V2010\Account\Message\FeedbackInstance + */ + public function buildInstance(array $payload): FeedbackInstance + { + return new FeedbackInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['messageSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.FeedbackPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Message/MediaContext.php b/app/api/Twilio/Rest/Api/V2010/Account/Message/MediaContext.php new file mode 100755 index 0000000..7694889 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Message/MediaContext.php @@ -0,0 +1,106 @@ +solution = [ + 'accountSid' => + $accountSid, + 'messageSid' => + $messageSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Messages/' . \rawurlencode($messageSid) + .'/Media/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the MediaInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the MediaInstance + * + * @return MediaInstance Fetched MediaInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MediaInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new MediaInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['messageSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.MediaContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Message/MediaInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Message/MediaInstance.php new file mode 100755 index 0000000..b0d9f46 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Message/MediaInstance.php @@ -0,0 +1,144 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'contentType' => Values::array_get($payload, 'content_type'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'parentSid' => Values::array_get($payload, 'parent_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'uri' => Values::array_get($payload, 'uri'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'messageSid' => $messageSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return MediaContext Context for this MediaInstance + */ + protected function proxy(): MediaContext + { + if (!$this->context) { + $this->context = new MediaContext( + $this->version, + $this->solution['accountSid'], + $this->solution['messageSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the MediaInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the MediaInstance + * + * @return MediaInstance Fetched MediaInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MediaInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.MediaInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Message/MediaList.php b/app/api/Twilio/Rest/Api/V2010/Account/Message/MediaList.php new file mode 100755 index 0000000..712d89f --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Message/MediaList.php @@ -0,0 +1,187 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'messageSid' => + $messageSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Messages/' . \rawurlencode($messageSid) + .'/Media.json'; + } + + /** + * Reads MediaInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return MediaInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams MediaInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of MediaInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return MediaPage Page of MediaInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MediaPage + { + $options = new Values($options); + + $params = Values::of([ + 'DateCreated<' => + Serialize::iso8601DateTime($options['dateCreatedBefore']), + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateCreated>' => + Serialize::iso8601DateTime($options['dateCreatedAfter']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new MediaPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of MediaInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return MediaPage Page of MediaInstance + */ + public function getPage(string $targetUrl): MediaPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new MediaPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a MediaContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Media resource to delete + */ + public function getContext( + string $sid + + ): MediaContext + { + return new MediaContext( + $this->version, + $this->solution['accountSid'], + $this->solution['messageSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.MediaList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Message/MediaOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/Message/MediaOptions.php new file mode 100755 index 0000000..ea3ac40 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Message/MediaOptions.php @@ -0,0 +1,116 @@ +=YYYY-MM-DD` to read media that was created on or after midnight of this date. + * @param string $dateCreated Only include media that was created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read media that was created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read media that was created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read media that was created on or after midnight of this date. + * @param string $dateCreatedAfter Only include media that was created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read media that was created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read media that was created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read media that was created on or after midnight of this date. + * @return ReadMediaOptions Options builder + */ + public static function read( + + string $dateCreatedBefore = null, + string $dateCreated = null, + string $dateCreatedAfter = null + + ): ReadMediaOptions + { + return new ReadMediaOptions( + $dateCreatedBefore, + $dateCreated, + $dateCreatedAfter + ); + } + +} + + + +class ReadMediaOptions extends Options + { + /** + * @param string $dateCreatedBefore Only include media that was created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read media that was created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read media that was created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read media that was created on or after midnight of this date. + * @param string $dateCreated Only include media that was created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read media that was created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read media that was created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read media that was created on or after midnight of this date. + * @param string $dateCreatedAfter Only include media that was created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read media that was created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read media that was created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read media that was created on or after midnight of this date. + */ + public function __construct( + + string $dateCreatedBefore = null, + string $dateCreated = null, + string $dateCreatedAfter = null + + ) { + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + } + + /** + * Only include media that was created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read media that was created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read media that was created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read media that was created on or after midnight of this date. + * + * @param string $dateCreatedBefore Only include media that was created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read media that was created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read media that was created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read media that was created on or after midnight of this date. + * @return $this Fluent Builder + */ + public function setDateCreatedBefore(string $dateCreatedBefore): self + { + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + return $this; + } + + /** + * Only include media that was created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read media that was created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read media that was created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read media that was created on or after midnight of this date. + * + * @param string $dateCreated Only include media that was created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read media that was created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read media that was created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read media that was created on or after midnight of this date. + * @return $this Fluent Builder + */ + public function setDateCreated(string $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * Only include media that was created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read media that was created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read media that was created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read media that was created on or after midnight of this date. + * + * @param string $dateCreatedAfter Only include media that was created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read media that was created on this date. You can also specify an inequality, such as `StartTime<=YYYY-MM-DD`, to read media that was created on or before midnight of this date, and `StartTime>=YYYY-MM-DD` to read media that was created on or after midnight of this date. + * @return $this Fluent Builder + */ + public function setDateCreatedAfter(string $dateCreatedAfter): self + { + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadMediaOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Message/MediaPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Message/MediaPage.php new file mode 100755 index 0000000..660208a --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Message/MediaPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MediaInstance \Twilio\Rest\Api\V2010\Account\Message\MediaInstance + */ + public function buildInstance(array $payload): MediaInstance + { + return new MediaInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['messageSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.MediaPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/MessageContext.php b/app/api/Twilio/Rest/Api/V2010/Account/MessageContext.php new file mode 100755 index 0000000..c87d1cf --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/MessageContext.php @@ -0,0 +1,210 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Messages/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the MessageInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the MessageInstance + * + * @return MessageInstance Fetched MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MessageInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new MessageInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return MessageInstance Updated MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MessageInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Body' => + $options['body'], + 'Status' => + $options['status'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new MessageInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the feedback + */ + protected function getFeedback(): FeedbackList + { + if (!$this->_feedback) { + $this->_feedback = new FeedbackList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_feedback; + } + + /** + * Access the media + */ + protected function getMedia(): MediaList + { + if (!$this->_media) { + $this->_media = new MediaList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_media; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.MessageContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/MessageInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/MessageInstance.php new file mode 100755 index 0000000..446c168 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/MessageInstance.php @@ -0,0 +1,203 @@ +properties = [ + 'body' => Values::array_get($payload, 'body'), + 'numSegments' => Values::array_get($payload, 'num_segments'), + 'direction' => Values::array_get($payload, 'direction'), + 'from' => Values::array_get($payload, 'from'), + 'to' => Values::array_get($payload, 'to'), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'price' => Values::array_get($payload, 'price'), + 'errorMessage' => Values::array_get($payload, 'error_message'), + 'uri' => Values::array_get($payload, 'uri'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'numMedia' => Values::array_get($payload, 'num_media'), + 'status' => Values::array_get($payload, 'status'), + 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'dateSent' => Deserialize::dateTime(Values::array_get($payload, 'date_sent')), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'errorCode' => Values::array_get($payload, 'error_code'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return MessageContext Context for this MessageInstance + */ + protected function proxy(): MessageContext + { + if (!$this->context) { + $this->context = new MessageContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the MessageInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the MessageInstance + * + * @return MessageInstance Fetched MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MessageInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return MessageInstance Updated MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MessageInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the feedback + */ + protected function getFeedback(): FeedbackList + { + return $this->proxy()->feedback; + } + + /** + * Access the media + */ + protected function getMedia(): MediaList + { + return $this->proxy()->media; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.MessageInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/MessageList.php b/app/api/Twilio/Rest/Api/V2010/Account/MessageList.php new file mode 100755 index 0000000..a8eb107 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/MessageList.php @@ -0,0 +1,255 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Messages.json'; + } + + /** + * Create the MessageInstance + * + * @param string $to The destination phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format for SMS/MMS or [Channel user address](https://www.twilio.com/docs/sms/channels#channel-addresses) for other 3rd-party channels. + * @param array|Options $options Optional Arguments + * @return MessageInstance Created MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $to, array $options = []): MessageInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'To' => + $to, + 'StatusCallback' => + $options['statusCallback'], + 'ApplicationSid' => + $options['applicationSid'], + 'MaxPrice' => + $options['maxPrice'], + 'ProvideFeedback' => + Serialize::booleanToString($options['provideFeedback']), + 'Attempt' => + $options['attempt'], + 'ValidityPeriod' => + $options['validityPeriod'], + 'ForceDelivery' => + Serialize::booleanToString($options['forceDelivery']), + 'ContentRetention' => + $options['contentRetention'], + 'AddressRetention' => + $options['addressRetention'], + 'SmartEncoded' => + Serialize::booleanToString($options['smartEncoded']), + 'PersistentAction' => + Serialize::map($options['persistentAction'], function ($e) { return $e; }), + 'ShortenUrls' => + Serialize::booleanToString($options['shortenUrls']), + 'ScheduleType' => + $options['scheduleType'], + 'SendAt' => + Serialize::iso8601DateTime($options['sendAt']), + 'SendAsMms' => + Serialize::booleanToString($options['sendAsMms']), + 'ContentSid' => + $options['contentSid'], + 'ContentVariables' => + $options['contentVariables'], + 'From' => + $options['from'], + 'MessagingServiceSid' => + $options['messagingServiceSid'], + 'Body' => + $options['body'], + 'MediaUrl' => + Serialize::map($options['mediaUrl'], function ($e) { return $e; }), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new MessageInstance( + $this->version, + $payload, + $this->solution['accountSid'] + ); + } + + + /** + * Reads MessageInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return MessageInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams MessageInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of MessageInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return MessagePage Page of MessageInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MessagePage + { + $options = new Values($options); + + $params = Values::of([ + 'To' => + $options['to'], + 'From' => + $options['from'], + 'DateSent<' => + Serialize::iso8601DateTime($options['dateSentBefore']), + 'DateSent' => + Serialize::iso8601DateTime($options['dateSent']), + 'DateSent>' => + Serialize::iso8601DateTime($options['dateSentAfter']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new MessagePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of MessageInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return MessagePage Page of MessageInstance + */ + public function getPage(string $targetUrl): MessagePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new MessagePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a MessageContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Message resource to delete. + */ + public function getContext( + string $sid + + ): MessageContext + { + return new MessageContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.MessageList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/MessageOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/MessageOptions.php new file mode 100755 index 0000000..efcf433 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/MessageOptions.php @@ -0,0 +1,626 @@ +=YYYY-MM-DD` to read messages sent on or after midnight on a date. + * @param string $dateSent The date of the messages to show. Specify a date as `YYYY-MM-DD` in GMT to read only messages sent on this date. For example: `2009-07-06`. You can also specify an inequality, such as `DateSent<=YYYY-MM-DD`, to read messages sent on or before midnight on a date, and `DateSent>=YYYY-MM-DD` to read messages sent on or after midnight on a date. + * @param string $dateSentAfter The date of the messages to show. Specify a date as `YYYY-MM-DD` in GMT to read only messages sent on this date. For example: `2009-07-06`. You can also specify an inequality, such as `DateSent<=YYYY-MM-DD`, to read messages sent on or before midnight on a date, and `DateSent>=YYYY-MM-DD` to read messages sent on or after midnight on a date. + * @return ReadMessageOptions Options builder + */ + public static function read( + + string $to = Values::NONE, + string $from = Values::NONE, + string $dateSentBefore = null, + string $dateSent = null, + string $dateSentAfter = null + + ): ReadMessageOptions + { + return new ReadMessageOptions( + $to, + $from, + $dateSentBefore, + $dateSent, + $dateSentAfter + ); + } + + /** + * @param string $body The text of the message you want to send. Can be up to 1,600 characters long. + * @param string $status + * @return UpdateMessageOptions Options builder + */ + public static function update( + + string $body = Values::NONE, + string $status = Values::NONE + + ): UpdateMessageOptions + { + return new UpdateMessageOptions( + $body, + $status + ); + } + +} + +class CreateMessageOptions extends Options + { + /** + * @param string $from A Twilio phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, an [alphanumeric sender ID](https://www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), or a [Channel Endpoint address](https://www.twilio.com/docs/sms/channels#channel-addresses) that is enabled for the type of message you want to send. Phone numbers or [short codes](https://www.twilio.com/docs/sms/api/short-code) purchased from Twilio also work here. You cannot, for example, spoof messages from a private cell phone number. If you are using `messaging_service_sid`, this parameter must be empty. + * @param string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/sms/services#send-a-message-with-copilot) you want to associate with the Message. Set this parameter to use the [Messaging Service Settings and Copilot Features](https://www.twilio.com/console/sms/services) you have configured and leave the `from` parameter empty. When only this parameter is set, Twilio will use your enabled Copilot Features to select the `from` phone number for delivery. + * @param string $body The text of the message you want to send. Can be up to 1,600 characters in length. + * @param string[] $mediaUrl The URL of the media to send with the message. The media can be of type `gif`, `png`, and `jpeg` and will be formatted correctly on the recipient's device. The media size limit is 5MB for supported file types (JPEG, PNG, GIF) and 500KB for [other types](https://www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message body, provide multiple `media_url` parameters in the POST request. You can include up to 10 `media_url` parameters per message. You can send images in an SMS message in only the US and Canada. + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. If specified, we POST these message status changes to the URL: `queued`, `failed`, `sent`, `delivered`, or `undelivered`. Twilio will POST its [standard request parameters](https://www.twilio.com/docs/sms/twiml#request-parameters) as well as some additional parameters including `MessageSid`, `MessageStatus`, and `ErrorCode`. If you include this parameter with the `messaging_service_sid`, we use this URL instead of the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/sms/services/api). URLs must contain a valid hostname and underscores are not allowed. + * @param string $applicationSid The SID of the application that should receive message status. We POST a `message_sid` parameter and a `message_status` parameter with a value of `sent` or `failed` to the [application](https://www.twilio.com/docs/usage/api/applications)'s `message_status_callback`. If a `status_callback` parameter is also passed, it will be ignored and the application's `message_status_callback` parameter will be used. + * @param string $maxPrice The maximum total price in US dollars that you will pay for the message to be delivered. Can be a decimal value that has up to 4 decimal places. All messages are queued for delivery and the message cost is checked before the message is sent. If the cost exceeds `max_price`, the message will fail and a status of `Failed` is sent to the status callback. If `MaxPrice` is not set, the message cost is not checked. + * @param bool $provideFeedback Whether to confirm delivery of the message. Set this value to `true` if you are sending messages that have a trackable user action and you intend to confirm delivery of the message using the [Message Feedback API](https://www.twilio.com/docs/sms/api/message-feedback-resource). This parameter is `false` by default. + * @param int $attempt Total number of attempts made ( including this ) to send out the message regardless of the provider used + * @param int $validityPeriod How long in seconds the message can remain in our outgoing message queue. After this period elapses, the message fails and we call your status callback. Can be between 1 and the default value of 14,400 seconds. After a message has been accepted by a carrier, however, we cannot guarantee that the message will not be queued after this period. We recommend that this value be at least 5 seconds. + * @param bool $forceDelivery Reserved + * @param string $contentRetention + * @param string $addressRetention + * @param bool $smartEncoded Whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be: `true` or `false`. + * @param string[] $persistentAction Rich actions for Channels Messages. + * @param bool $shortenUrls Determines the usage of Click Tracking. Setting it to `true` will instruct Twilio to replace all links in the Message with a shortened version based on the associated Domain Sid and track clicks on them. If this parameter is not set on an API call, we will use the value set on the Messaging Service. If this parameter is not set and the value is not configured on the Messaging Service used this will default to `false`. + * @param string $scheduleType + * @param \DateTime $sendAt The time that Twilio will send the message. Must be in ISO 8601 format. + * @param bool $sendAsMms If set to True, Twilio will deliver the message as a single MMS message, regardless of the presence of media. + * @param string $contentSid The SID of the Content object returned at Content API content create time (https://www.twilio.com/docs/content-api/create-and-send-your-first-content-api-template#create-a-template). If this parameter is not specified, then the Content API will not be utilized. + * @param string $contentVariables Key-value pairs of variable names to substitution values, used alongside a content_sid. If not specified, Content API will default to the default variables defined at create time. + */ + public function __construct( + + string $from = Values::NONE, + string $messagingServiceSid = Values::NONE, + string $body = Values::NONE, + array $mediaUrl = Values::ARRAY_NONE, + string $statusCallback = Values::NONE, + string $applicationSid = Values::NONE, + string $maxPrice = Values::NONE, + bool $provideFeedback = Values::BOOL_NONE, + int $attempt = Values::INT_NONE, + int $validityPeriod = Values::INT_NONE, + bool $forceDelivery = Values::BOOL_NONE, + string $contentRetention = Values::NONE, + string $addressRetention = Values::NONE, + bool $smartEncoded = Values::BOOL_NONE, + array $persistentAction = Values::ARRAY_NONE, + bool $shortenUrls = Values::BOOL_NONE, + string $scheduleType = Values::NONE, + \DateTime $sendAt = null, + bool $sendAsMms = Values::BOOL_NONE, + string $contentSid = Values::NONE, + string $contentVariables = Values::NONE + + ) { + $this->options['from'] = $from; + $this->options['messagingServiceSid'] = $messagingServiceSid; + $this->options['body'] = $body; + $this->options['mediaUrl'] = $mediaUrl; + $this->options['statusCallback'] = $statusCallback; + $this->options['applicationSid'] = $applicationSid; + $this->options['maxPrice'] = $maxPrice; + $this->options['provideFeedback'] = $provideFeedback; + $this->options['attempt'] = $attempt; + $this->options['validityPeriod'] = $validityPeriod; + $this->options['forceDelivery'] = $forceDelivery; + $this->options['contentRetention'] = $contentRetention; + $this->options['addressRetention'] = $addressRetention; + $this->options['smartEncoded'] = $smartEncoded; + $this->options['persistentAction'] = $persistentAction; + $this->options['shortenUrls'] = $shortenUrls; + $this->options['scheduleType'] = $scheduleType; + $this->options['sendAt'] = $sendAt; + $this->options['sendAsMms'] = $sendAsMms; + $this->options['contentSid'] = $contentSid; + $this->options['contentVariables'] = $contentVariables; + } + + /** + * A Twilio phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, an [alphanumeric sender ID](https://www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), or a [Channel Endpoint address](https://www.twilio.com/docs/sms/channels#channel-addresses) that is enabled for the type of message you want to send. Phone numbers or [short codes](https://www.twilio.com/docs/sms/api/short-code) purchased from Twilio also work here. You cannot, for example, spoof messages from a private cell phone number. If you are using `messaging_service_sid`, this parameter must be empty. + * + * @param string $from A Twilio phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, an [alphanumeric sender ID](https://www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), or a [Channel Endpoint address](https://www.twilio.com/docs/sms/channels#channel-addresses) that is enabled for the type of message you want to send. Phone numbers or [short codes](https://www.twilio.com/docs/sms/api/short-code) purchased from Twilio also work here. You cannot, for example, spoof messages from a private cell phone number. If you are using `messaging_service_sid`, this parameter must be empty. + * @return $this Fluent Builder + */ + public function setFrom(string $from): self + { + $this->options['from'] = $from; + return $this; + } + + /** + * The SID of the [Messaging Service](https://www.twilio.com/docs/sms/services#send-a-message-with-copilot) you want to associate with the Message. Set this parameter to use the [Messaging Service Settings and Copilot Features](https://www.twilio.com/console/sms/services) you have configured and leave the `from` parameter empty. When only this parameter is set, Twilio will use your enabled Copilot Features to select the `from` phone number for delivery. + * + * @param string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/sms/services#send-a-message-with-copilot) you want to associate with the Message. Set this parameter to use the [Messaging Service Settings and Copilot Features](https://www.twilio.com/console/sms/services) you have configured and leave the `from` parameter empty. When only this parameter is set, Twilio will use your enabled Copilot Features to select the `from` phone number for delivery. + * @return $this Fluent Builder + */ + public function setMessagingServiceSid(string $messagingServiceSid): self + { + $this->options['messagingServiceSid'] = $messagingServiceSid; + return $this; + } + + /** + * The text of the message you want to send. Can be up to 1,600 characters in length. + * + * @param string $body The text of the message you want to send. Can be up to 1,600 characters in length. + * @return $this Fluent Builder + */ + public function setBody(string $body): self + { + $this->options['body'] = $body; + return $this; + } + + /** + * The URL of the media to send with the message. The media can be of type `gif`, `png`, and `jpeg` and will be formatted correctly on the recipient's device. The media size limit is 5MB for supported file types (JPEG, PNG, GIF) and 500KB for [other types](https://www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message body, provide multiple `media_url` parameters in the POST request. You can include up to 10 `media_url` parameters per message. You can send images in an SMS message in only the US and Canada. + * + * @param string[] $mediaUrl The URL of the media to send with the message. The media can be of type `gif`, `png`, and `jpeg` and will be formatted correctly on the recipient's device. The media size limit is 5MB for supported file types (JPEG, PNG, GIF) and 500KB for [other types](https://www.twilio.com/docs/sms/accepted-mime-types) of accepted media. To send more than one image in the message body, provide multiple `media_url` parameters in the POST request. You can include up to 10 `media_url` parameters per message. You can send images in an SMS message in only the US and Canada. + * @return $this Fluent Builder + */ + public function setMediaUrl(array $mediaUrl): self + { + $this->options['mediaUrl'] = $mediaUrl; + return $this; + } + + /** + * The URL we should call using the `status_callback_method` to send status information to your application. If specified, we POST these message status changes to the URL: `queued`, `failed`, `sent`, `delivered`, or `undelivered`. Twilio will POST its [standard request parameters](https://www.twilio.com/docs/sms/twiml#request-parameters) as well as some additional parameters including `MessageSid`, `MessageStatus`, and `ErrorCode`. If you include this parameter with the `messaging_service_sid`, we use this URL instead of the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/sms/services/api). URLs must contain a valid hostname and underscores are not allowed. + * + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. If specified, we POST these message status changes to the URL: `queued`, `failed`, `sent`, `delivered`, or `undelivered`. Twilio will POST its [standard request parameters](https://www.twilio.com/docs/sms/twiml#request-parameters) as well as some additional parameters including `MessageSid`, `MessageStatus`, and `ErrorCode`. If you include this parameter with the `messaging_service_sid`, we use this URL instead of the Status Callback URL of the [Messaging Service](https://www.twilio.com/docs/sms/services/api). URLs must contain a valid hostname and underscores are not allowed. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The SID of the application that should receive message status. We POST a `message_sid` parameter and a `message_status` parameter with a value of `sent` or `failed` to the [application](https://www.twilio.com/docs/usage/api/applications)'s `message_status_callback`. If a `status_callback` parameter is also passed, it will be ignored and the application's `message_status_callback` parameter will be used. + * + * @param string $applicationSid The SID of the application that should receive message status. We POST a `message_sid` parameter and a `message_status` parameter with a value of `sent` or `failed` to the [application](https://www.twilio.com/docs/usage/api/applications)'s `message_status_callback`. If a `status_callback` parameter is also passed, it will be ignored and the application's `message_status_callback` parameter will be used. + * @return $this Fluent Builder + */ + public function setApplicationSid(string $applicationSid): self + { + $this->options['applicationSid'] = $applicationSid; + return $this; + } + + /** + * The maximum total price in US dollars that you will pay for the message to be delivered. Can be a decimal value that has up to 4 decimal places. All messages are queued for delivery and the message cost is checked before the message is sent. If the cost exceeds `max_price`, the message will fail and a status of `Failed` is sent to the status callback. If `MaxPrice` is not set, the message cost is not checked. + * + * @param string $maxPrice The maximum total price in US dollars that you will pay for the message to be delivered. Can be a decimal value that has up to 4 decimal places. All messages are queued for delivery and the message cost is checked before the message is sent. If the cost exceeds `max_price`, the message will fail and a status of `Failed` is sent to the status callback. If `MaxPrice` is not set, the message cost is not checked. + * @return $this Fluent Builder + */ + public function setMaxPrice(string $maxPrice): self + { + $this->options['maxPrice'] = $maxPrice; + return $this; + } + + /** + * Whether to confirm delivery of the message. Set this value to `true` if you are sending messages that have a trackable user action and you intend to confirm delivery of the message using the [Message Feedback API](https://www.twilio.com/docs/sms/api/message-feedback-resource). This parameter is `false` by default. + * + * @param bool $provideFeedback Whether to confirm delivery of the message. Set this value to `true` if you are sending messages that have a trackable user action and you intend to confirm delivery of the message using the [Message Feedback API](https://www.twilio.com/docs/sms/api/message-feedback-resource). This parameter is `false` by default. + * @return $this Fluent Builder + */ + public function setProvideFeedback(bool $provideFeedback): self + { + $this->options['provideFeedback'] = $provideFeedback; + return $this; + } + + /** + * Total number of attempts made ( including this ) to send out the message regardless of the provider used + * + * @param int $attempt Total number of attempts made ( including this ) to send out the message regardless of the provider used + * @return $this Fluent Builder + */ + public function setAttempt(int $attempt): self + { + $this->options['attempt'] = $attempt; + return $this; + } + + /** + * How long in seconds the message can remain in our outgoing message queue. After this period elapses, the message fails and we call your status callback. Can be between 1 and the default value of 14,400 seconds. After a message has been accepted by a carrier, however, we cannot guarantee that the message will not be queued after this period. We recommend that this value be at least 5 seconds. + * + * @param int $validityPeriod How long in seconds the message can remain in our outgoing message queue. After this period elapses, the message fails and we call your status callback. Can be between 1 and the default value of 14,400 seconds. After a message has been accepted by a carrier, however, we cannot guarantee that the message will not be queued after this period. We recommend that this value be at least 5 seconds. + * @return $this Fluent Builder + */ + public function setValidityPeriod(int $validityPeriod): self + { + $this->options['validityPeriod'] = $validityPeriod; + return $this; + } + + /** + * Reserved + * + * @param bool $forceDelivery Reserved + * @return $this Fluent Builder + */ + public function setForceDelivery(bool $forceDelivery): self + { + $this->options['forceDelivery'] = $forceDelivery; + return $this; + } + + /** + * @param string $contentRetention + * @return $this Fluent Builder + */ + public function setContentRetention(string $contentRetention): self + { + $this->options['contentRetention'] = $contentRetention; + return $this; + } + + /** + * @param string $addressRetention + * @return $this Fluent Builder + */ + public function setAddressRetention(string $addressRetention): self + { + $this->options['addressRetention'] = $addressRetention; + return $this; + } + + /** + * Whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be: `true` or `false`. + * + * @param bool $smartEncoded Whether to detect Unicode characters that have a similar GSM-7 character and replace them. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setSmartEncoded(bool $smartEncoded): self + { + $this->options['smartEncoded'] = $smartEncoded; + return $this; + } + + /** + * Rich actions for Channels Messages. + * + * @param string[] $persistentAction Rich actions for Channels Messages. + * @return $this Fluent Builder + */ + public function setPersistentAction(array $persistentAction): self + { + $this->options['persistentAction'] = $persistentAction; + return $this; + } + + /** + * Determines the usage of Click Tracking. Setting it to `true` will instruct Twilio to replace all links in the Message with a shortened version based on the associated Domain Sid and track clicks on them. If this parameter is not set on an API call, we will use the value set on the Messaging Service. If this parameter is not set and the value is not configured on the Messaging Service used this will default to `false`. + * + * @param bool $shortenUrls Determines the usage of Click Tracking. Setting it to `true` will instruct Twilio to replace all links in the Message with a shortened version based on the associated Domain Sid and track clicks on them. If this parameter is not set on an API call, we will use the value set on the Messaging Service. If this parameter is not set and the value is not configured on the Messaging Service used this will default to `false`. + * @return $this Fluent Builder + */ + public function setShortenUrls(bool $shortenUrls): self + { + $this->options['shortenUrls'] = $shortenUrls; + return $this; + } + + /** + * @param string $scheduleType + * @return $this Fluent Builder + */ + public function setScheduleType(string $scheduleType): self + { + $this->options['scheduleType'] = $scheduleType; + return $this; + } + + /** + * The time that Twilio will send the message. Must be in ISO 8601 format. + * + * @param \DateTime $sendAt The time that Twilio will send the message. Must be in ISO 8601 format. + * @return $this Fluent Builder + */ + public function setSendAt(\DateTime $sendAt): self + { + $this->options['sendAt'] = $sendAt; + return $this; + } + + /** + * If set to True, Twilio will deliver the message as a single MMS message, regardless of the presence of media. + * + * @param bool $sendAsMms If set to True, Twilio will deliver the message as a single MMS message, regardless of the presence of media. + * @return $this Fluent Builder + */ + public function setSendAsMms(bool $sendAsMms): self + { + $this->options['sendAsMms'] = $sendAsMms; + return $this; + } + + /** + * The SID of the Content object returned at Content API content create time (https://www.twilio.com/docs/content-api/create-and-send-your-first-content-api-template#create-a-template). If this parameter is not specified, then the Content API will not be utilized. + * + * @param string $contentSid The SID of the Content object returned at Content API content create time (https://www.twilio.com/docs/content-api/create-and-send-your-first-content-api-template#create-a-template). If this parameter is not specified, then the Content API will not be utilized. + * @return $this Fluent Builder + */ + public function setContentSid(string $contentSid): self + { + $this->options['contentSid'] = $contentSid; + return $this; + } + + /** + * Key-value pairs of variable names to substitution values, used alongside a content_sid. If not specified, Content API will default to the default variables defined at create time. + * + * @param string $contentVariables Key-value pairs of variable names to substitution values, used alongside a content_sid. If not specified, Content API will default to the default variables defined at create time. + * @return $this Fluent Builder + */ + public function setContentVariables(string $contentVariables): self + { + $this->options['contentVariables'] = $contentVariables; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateMessageOptions ' . $options . ']'; + } +} + + + +class ReadMessageOptions extends Options + { + /** + * @param string $to Read messages sent to only this phone number. + * @param string $from Read messages sent from only this phone number or alphanumeric sender ID. + * @param string $dateSentBefore The date of the messages to show. Specify a date as `YYYY-MM-DD` in GMT to read only messages sent on this date. For example: `2009-07-06`. You can also specify an inequality, such as `DateSent<=YYYY-MM-DD`, to read messages sent on or before midnight on a date, and `DateSent>=YYYY-MM-DD` to read messages sent on or after midnight on a date. + * @param string $dateSent The date of the messages to show. Specify a date as `YYYY-MM-DD` in GMT to read only messages sent on this date. For example: `2009-07-06`. You can also specify an inequality, such as `DateSent<=YYYY-MM-DD`, to read messages sent on or before midnight on a date, and `DateSent>=YYYY-MM-DD` to read messages sent on or after midnight on a date. + * @param string $dateSentAfter The date of the messages to show. Specify a date as `YYYY-MM-DD` in GMT to read only messages sent on this date. For example: `2009-07-06`. You can also specify an inequality, such as `DateSent<=YYYY-MM-DD`, to read messages sent on or before midnight on a date, and `DateSent>=YYYY-MM-DD` to read messages sent on or after midnight on a date. + */ + public function __construct( + + string $to = Values::NONE, + string $from = Values::NONE, + string $dateSentBefore = null, + string $dateSent = null, + string $dateSentAfter = null + + ) { + $this->options['to'] = $to; + $this->options['from'] = $from; + $this->options['dateSentBefore'] = $dateSentBefore; + $this->options['dateSent'] = $dateSent; + $this->options['dateSentAfter'] = $dateSentAfter; + } + + /** + * Read messages sent to only this phone number. + * + * @param string $to Read messages sent to only this phone number. + * @return $this Fluent Builder + */ + public function setTo(string $to): self + { + $this->options['to'] = $to; + return $this; + } + + /** + * Read messages sent from only this phone number or alphanumeric sender ID. + * + * @param string $from Read messages sent from only this phone number or alphanumeric sender ID. + * @return $this Fluent Builder + */ + public function setFrom(string $from): self + { + $this->options['from'] = $from; + return $this; + } + + /** + * The date of the messages to show. Specify a date as `YYYY-MM-DD` in GMT to read only messages sent on this date. For example: `2009-07-06`. You can also specify an inequality, such as `DateSent<=YYYY-MM-DD`, to read messages sent on or before midnight on a date, and `DateSent>=YYYY-MM-DD` to read messages sent on or after midnight on a date. + * + * @param string $dateSentBefore The date of the messages to show. Specify a date as `YYYY-MM-DD` in GMT to read only messages sent on this date. For example: `2009-07-06`. You can also specify an inequality, such as `DateSent<=YYYY-MM-DD`, to read messages sent on or before midnight on a date, and `DateSent>=YYYY-MM-DD` to read messages sent on or after midnight on a date. + * @return $this Fluent Builder + */ + public function setDateSentBefore(string $dateSentBefore): self + { + $this->options['dateSentBefore'] = $dateSentBefore; + return $this; + } + + /** + * The date of the messages to show. Specify a date as `YYYY-MM-DD` in GMT to read only messages sent on this date. For example: `2009-07-06`. You can also specify an inequality, such as `DateSent<=YYYY-MM-DD`, to read messages sent on or before midnight on a date, and `DateSent>=YYYY-MM-DD` to read messages sent on or after midnight on a date. + * + * @param string $dateSent The date of the messages to show. Specify a date as `YYYY-MM-DD` in GMT to read only messages sent on this date. For example: `2009-07-06`. You can also specify an inequality, such as `DateSent<=YYYY-MM-DD`, to read messages sent on or before midnight on a date, and `DateSent>=YYYY-MM-DD` to read messages sent on or after midnight on a date. + * @return $this Fluent Builder + */ + public function setDateSent(string $dateSent): self + { + $this->options['dateSent'] = $dateSent; + return $this; + } + + /** + * The date of the messages to show. Specify a date as `YYYY-MM-DD` in GMT to read only messages sent on this date. For example: `2009-07-06`. You can also specify an inequality, such as `DateSent<=YYYY-MM-DD`, to read messages sent on or before midnight on a date, and `DateSent>=YYYY-MM-DD` to read messages sent on or after midnight on a date. + * + * @param string $dateSentAfter The date of the messages to show. Specify a date as `YYYY-MM-DD` in GMT to read only messages sent on this date. For example: `2009-07-06`. You can also specify an inequality, such as `DateSent<=YYYY-MM-DD`, to read messages sent on or before midnight on a date, and `DateSent>=YYYY-MM-DD` to read messages sent on or after midnight on a date. + * @return $this Fluent Builder + */ + public function setDateSentAfter(string $dateSentAfter): self + { + $this->options['dateSentAfter'] = $dateSentAfter; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadMessageOptions ' . $options . ']'; + } +} + +class UpdateMessageOptions extends Options + { + /** + * @param string $body The text of the message you want to send. Can be up to 1,600 characters long. + * @param string $status + */ + public function __construct( + + string $body = Values::NONE, + string $status = Values::NONE + + ) { + $this->options['body'] = $body; + $this->options['status'] = $status; + } + + /** + * The text of the message you want to send. Can be up to 1,600 characters long. + * + * @param string $body The text of the message you want to send. Can be up to 1,600 characters long. + * @return $this Fluent Builder + */ + public function setBody(string $body): self + { + $this->options['body'] = $body; + return $this; + } + + /** + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateMessageOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/MessagePage.php b/app/api/Twilio/Rest/Api/V2010/Account/MessagePage.php new file mode 100755 index 0000000..586d5ab --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/MessagePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MessageInstance \Twilio\Rest\Api\V2010\Account\MessageInstance + */ + public function buildInstance(array $payload): MessageInstance + { + return new MessageInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.MessagePage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/NewKeyInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/NewKeyInstance.php new file mode 100755 index 0000000..295fd35 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/NewKeyInstance.php @@ -0,0 +1,90 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'secret' => Values::array_get($payload, 'secret'), + ]; + + $this->solution = ['accountSid' => $accountSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.NewKeyInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/NewKeyList.php b/app/api/Twilio/Rest/Api/V2010/Account/NewKeyList.php new file mode 100755 index 0000000..e86d660 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/NewKeyList.php @@ -0,0 +1,87 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Keys.json'; + } + + /** + * Create the NewKeyInstance + * + * @param array|Options $options Optional Arguments + * @return NewKeyInstance Created NewKeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): NewKeyInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new NewKeyInstance( + $this->version, + $payload, + $this->solution['accountSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.NewKeyList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/NewKeyOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/NewKeyOptions.php new file mode 100755 index 0000000..6dd16cc --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/NewKeyOptions.php @@ -0,0 +1,76 @@ +options['friendlyName'] = $friendlyName; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateNewKeyOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/NewKeyPage.php b/app/api/Twilio/Rest/Api/V2010/Account/NewKeyPage.php new file mode 100755 index 0000000..6d98b79 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/NewKeyPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return NewKeyInstance \Twilio\Rest\Api\V2010\Account\NewKeyInstance + */ + public function buildInstance(array $payload): NewKeyInstance + { + return new NewKeyInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.NewKeyPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/NewSigningKeyInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/NewSigningKeyInstance.php new file mode 100755 index 0000000..d9d3787 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/NewSigningKeyInstance.php @@ -0,0 +1,90 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'secret' => Values::array_get($payload, 'secret'), + ]; + + $this->solution = ['accountSid' => $accountSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.NewSigningKeyInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/NewSigningKeyList.php b/app/api/Twilio/Rest/Api/V2010/Account/NewSigningKeyList.php new file mode 100755 index 0000000..aaba19c --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/NewSigningKeyList.php @@ -0,0 +1,87 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SigningKeys.json'; + } + + /** + * Create the NewSigningKeyInstance + * + * @param array|Options $options Optional Arguments + * @return NewSigningKeyInstance Created NewSigningKeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): NewSigningKeyInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new NewSigningKeyInstance( + $this->version, + $payload, + $this->solution['accountSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.NewSigningKeyList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/NewSigningKeyOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/NewSigningKeyOptions.php new file mode 100755 index 0000000..90d19b0 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/NewSigningKeyOptions.php @@ -0,0 +1,76 @@ +options['friendlyName'] = $friendlyName; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateNewSigningKeyOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/NewSigningKeyPage.php b/app/api/Twilio/Rest/Api/V2010/Account/NewSigningKeyPage.php new file mode 100755 index 0000000..c45007f --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/NewSigningKeyPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return NewSigningKeyInstance \Twilio\Rest\Api\V2010\Account\NewSigningKeyInstance + */ + public function buildInstance(array $payload): NewSigningKeyInstance + { + return new NewSigningKeyInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.NewSigningKeyPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/NotificationContext.php b/app/api/Twilio/Rest/Api/V2010/Account/NotificationContext.php new file mode 100755 index 0000000..717b37f --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/NotificationContext.php @@ -0,0 +1,87 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Notifications/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Fetch the NotificationInstance + * + * @return NotificationInstance Fetched NotificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): NotificationInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new NotificationInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.NotificationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/NotificationInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/NotificationInstance.php new file mode 100755 index 0000000..3ef2f7f --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/NotificationInstance.php @@ -0,0 +1,150 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'callSid' => Values::array_get($payload, 'call_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'errorCode' => Values::array_get($payload, 'error_code'), + 'log' => Values::array_get($payload, 'log'), + 'messageDate' => Deserialize::dateTime(Values::array_get($payload, 'message_date')), + 'messageText' => Values::array_get($payload, 'message_text'), + 'moreInfo' => Values::array_get($payload, 'more_info'), + 'requestMethod' => Values::array_get($payload, 'request_method'), + 'requestUrl' => Values::array_get($payload, 'request_url'), + 'requestVariables' => Values::array_get($payload, 'request_variables'), + 'responseBody' => Values::array_get($payload, 'response_body'), + 'responseHeaders' => Values::array_get($payload, 'response_headers'), + 'sid' => Values::array_get($payload, 'sid'), + 'uri' => Values::array_get($payload, 'uri'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return NotificationContext Context for this NotificationInstance + */ + protected function proxy(): NotificationContext + { + if (!$this->context) { + $this->context = new NotificationContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the NotificationInstance + * + * @return NotificationInstance Fetched NotificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): NotificationInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.NotificationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/NotificationList.php b/app/api/Twilio/Rest/Api/V2010/Account/NotificationList.php new file mode 100755 index 0000000..a5e0cf1 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/NotificationList.php @@ -0,0 +1,182 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Notifications.json'; + } + + /** + * Reads NotificationInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return NotificationInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams NotificationInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of NotificationInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return NotificationPage Page of NotificationInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): NotificationPage + { + $options = new Values($options); + + $params = Values::of([ + 'Log' => + $options['log'], + 'MessageDate<' => + Serialize::iso8601Date($options['messageDateBefore']), + 'MessageDate' => + Serialize::iso8601Date($options['messageDate']), + 'MessageDate>' => + Serialize::iso8601Date($options['messageDateAfter']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new NotificationPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of NotificationInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return NotificationPage Page of NotificationInstance + */ + public function getPage(string $targetUrl): NotificationPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new NotificationPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a NotificationContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Notification resource to fetch. + */ + public function getContext( + string $sid + + ): NotificationContext + { + return new NotificationContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.NotificationList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/NotificationOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/NotificationOptions.php new file mode 100755 index 0000000..4079dd1 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/NotificationOptions.php @@ -0,0 +1,132 @@ +=YYYY-MM-DD` for messages logged at or after midnight on a date. + * @param string $messageDate Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * @param string $messageDateAfter Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * @return ReadNotificationOptions Options builder + */ + public static function read( + + int $log = Values::INT_NONE, + string $messageDateBefore = null, + string $messageDate = null, + string $messageDateAfter = null + + ): ReadNotificationOptions + { + return new ReadNotificationOptions( + $log, + $messageDateBefore, + $messageDate, + $messageDateAfter + ); + } + +} + + +class ReadNotificationOptions extends Options + { + /** + * @param int $log Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read. + * @param string $messageDateBefore Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * @param string $messageDate Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * @param string $messageDateAfter Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + */ + public function __construct( + + int $log = Values::INT_NONE, + string $messageDateBefore = null, + string $messageDate = null, + string $messageDateAfter = null + + ) { + $this->options['log'] = $log; + $this->options['messageDateBefore'] = $messageDateBefore; + $this->options['messageDate'] = $messageDate; + $this->options['messageDateAfter'] = $messageDateAfter; + } + + /** + * Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read. + * + * @param int $log Only read notifications of the specified log level. Can be: `0` to read only ERROR notifications or `1` to read only WARNING notifications. By default, all notifications are read. + * @return $this Fluent Builder + */ + public function setLog(int $log): self + { + $this->options['log'] = $log; + return $this; + } + + /** + * Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * + * @param string $messageDateBefore Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * @return $this Fluent Builder + */ + public function setMessageDateBefore(string $messageDateBefore): self + { + $this->options['messageDateBefore'] = $messageDateBefore; + return $this; + } + + /** + * Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * + * @param string $messageDate Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * @return $this Fluent Builder + */ + public function setMessageDate(string $messageDate): self + { + $this->options['messageDate'] = $messageDate; + return $this; + } + + /** + * Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * + * @param string $messageDateAfter Only show notifications for the specified date, formatted as `YYYY-MM-DD`. You can also specify an inequality, such as `<=YYYY-MM-DD` for messages logged at or before midnight on a date, or `>=YYYY-MM-DD` for messages logged at or after midnight on a date. + * @return $this Fluent Builder + */ + public function setMessageDateAfter(string $messageDateAfter): self + { + $this->options['messageDateAfter'] = $messageDateAfter; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadNotificationOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/NotificationPage.php b/app/api/Twilio/Rest/Api/V2010/Account/NotificationPage.php new file mode 100755 index 0000000..589848c --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/NotificationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return NotificationInstance \Twilio\Rest\Api\V2010\Account\NotificationInstance + */ + public function buildInstance(array $payload): NotificationInstance + { + return new NotificationInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.NotificationPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdContext.php b/app/api/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdContext.php new file mode 100755 index 0000000..e20a2d8 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdContext.php @@ -0,0 +1,130 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/OutgoingCallerIds/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the OutgoingCallerIdInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the OutgoingCallerIdInstance + * + * @return OutgoingCallerIdInstance Fetched OutgoingCallerIdInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): OutgoingCallerIdInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new OutgoingCallerIdInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the OutgoingCallerIdInstance + * + * @param array|Options $options Optional Arguments + * @return OutgoingCallerIdInstance Updated OutgoingCallerIdInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): OutgoingCallerIdInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new OutgoingCallerIdInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.OutgoingCallerIdContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdInstance.php new file mode 100755 index 0000000..b60efe2 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdInstance.php @@ -0,0 +1,156 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'phoneNumber' => Values::array_get($payload, 'phone_number'), + 'uri' => Values::array_get($payload, 'uri'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return OutgoingCallerIdContext Context for this OutgoingCallerIdInstance + */ + protected function proxy(): OutgoingCallerIdContext + { + if (!$this->context) { + $this->context = new OutgoingCallerIdContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the OutgoingCallerIdInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the OutgoingCallerIdInstance + * + * @return OutgoingCallerIdInstance Fetched OutgoingCallerIdInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): OutgoingCallerIdInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the OutgoingCallerIdInstance + * + * @param array|Options $options Optional Arguments + * @return OutgoingCallerIdInstance Updated OutgoingCallerIdInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): OutgoingCallerIdInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.OutgoingCallerIdInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdList.php b/app/api/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdList.php new file mode 100755 index 0000000..c5360d4 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdList.php @@ -0,0 +1,177 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/OutgoingCallerIds.json'; + } + + /** + * Reads OutgoingCallerIdInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return OutgoingCallerIdInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams OutgoingCallerIdInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of OutgoingCallerIdInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return OutgoingCallerIdPage Page of OutgoingCallerIdInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): OutgoingCallerIdPage + { + $options = new Values($options); + + $params = Values::of([ + 'PhoneNumber' => + $options['phoneNumber'], + 'FriendlyName' => + $options['friendlyName'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new OutgoingCallerIdPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of OutgoingCallerIdInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return OutgoingCallerIdPage Page of OutgoingCallerIdInstance + */ + public function getPage(string $targetUrl): OutgoingCallerIdPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new OutgoingCallerIdPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a OutgoingCallerIdContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the OutgoingCallerId resource to delete. + */ + public function getContext( + string $sid + + ): OutgoingCallerIdContext + { + return new OutgoingCallerIdContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.OutgoingCallerIdList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdOptions.php new file mode 100755 index 0000000..e254044 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdOptions.php @@ -0,0 +1,150 @@ +options['phoneNumber'] = $phoneNumber; + $this->options['friendlyName'] = $friendlyName; + } + + /** + * The phone number of the OutgoingCallerId resources to read. + * + * @param string $phoneNumber The phone number of the OutgoingCallerId resources to read. + * @return $this Fluent Builder + */ + public function setPhoneNumber(string $phoneNumber): self + { + $this->options['phoneNumber'] = $phoneNumber; + return $this; + } + + /** + * The string that identifies the OutgoingCallerId resources to read. + * + * @param string $friendlyName The string that identifies the OutgoingCallerId resources to read. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadOutgoingCallerIdOptions ' . $options . ']'; + } +} + +class UpdateOutgoingCallerIdOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + */ + public function __construct( + + string $friendlyName = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateOutgoingCallerIdOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdPage.php b/app/api/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdPage.php new file mode 100755 index 0000000..ed144d5 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/OutgoingCallerIdPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return OutgoingCallerIdInstance \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdInstance + */ + public function buildInstance(array $payload): OutgoingCallerIdInstance + { + return new OutgoingCallerIdInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.OutgoingCallerIdPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Queue/MemberContext.php b/app/api/Twilio/Rest/Api/V2010/Account/Queue/MemberContext.php new file mode 100755 index 0000000..89d0f0e --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Queue/MemberContext.php @@ -0,0 +1,127 @@ +solution = [ + 'accountSid' => + $accountSid, + 'queueSid' => + $queueSid, + 'callSid' => + $callSid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Queues/' . \rawurlencode($queueSid) + .'/Members/' . \rawurlencode($callSid) + .'.json'; + } + + /** + * Fetch the MemberInstance + * + * @return MemberInstance Fetched MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MemberInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new MemberInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['queueSid'], + $this->solution['callSid'] + ); + } + + + /** + * Update the MemberInstance + * + * @param string $url The absolute URL of the Queue resource. + * @param array|Options $options Optional Arguments + * @return MemberInstance Updated MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $url, array $options = []): MemberInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Url' => + $url, + 'Method' => + $options['method'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new MemberInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['queueSid'], + $this->solution['callSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.MemberContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Queue/MemberInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Queue/MemberInstance.php new file mode 100755 index 0000000..e3c3664 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Queue/MemberInstance.php @@ -0,0 +1,145 @@ +properties = [ + 'callSid' => Values::array_get($payload, 'call_sid'), + 'dateEnqueued' => Deserialize::dateTime(Values::array_get($payload, 'date_enqueued')), + 'position' => Values::array_get($payload, 'position'), + 'uri' => Values::array_get($payload, 'uri'), + 'waitTime' => Values::array_get($payload, 'wait_time'), + 'queueSid' => Values::array_get($payload, 'queue_sid'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'queueSid' => $queueSid, 'callSid' => $callSid ?: $this->properties['callSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return MemberContext Context for this MemberInstance + */ + protected function proxy(): MemberContext + { + if (!$this->context) { + $this->context = new MemberContext( + $this->version, + $this->solution['accountSid'], + $this->solution['queueSid'], + $this->solution['callSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the MemberInstance + * + * @return MemberInstance Fetched MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MemberInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the MemberInstance + * + * @param string $url The absolute URL of the Queue resource. + * @param array|Options $options Optional Arguments + * @return MemberInstance Updated MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $url, array $options = []): MemberInstance + { + + return $this->proxy()->update($url, $options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.MemberInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Queue/MemberList.php b/app/api/Twilio/Rest/Api/V2010/Account/Queue/MemberList.php new file mode 100755 index 0000000..74d82ca --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Queue/MemberList.php @@ -0,0 +1,175 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'queueSid' => + $queueSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Queues/' . \rawurlencode($queueSid) + .'/Members.json'; + } + + /** + * Reads MemberInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return MemberInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams MemberInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of MemberInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return MemberPage Page of MemberInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MemberPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new MemberPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of MemberInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return MemberPage Page of MemberInstance + */ + public function getPage(string $targetUrl): MemberPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new MemberPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a MemberContext + * + * @param string $callSid The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resource(s) to fetch. + */ + public function getContext( + string $callSid + + ): MemberContext + { + return new MemberContext( + $this->version, + $this->solution['accountSid'], + $this->solution['queueSid'], + $callSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.MemberList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Queue/MemberOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/Queue/MemberOptions.php new file mode 100755 index 0000000..d6e30c8 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Queue/MemberOptions.php @@ -0,0 +1,80 @@ +options['method'] = $method; + } + + /** + * How to pass the update request data. Can be `GET` or `POST` and the default is `POST`. `POST` sends the data as encoded form data and `GET` sends the data as query parameters. + * + * @param string $method How to pass the update request data. Can be `GET` or `POST` and the default is `POST`. `POST` sends the data as encoded form data and `GET` sends the data as query parameters. + * @return $this Fluent Builder + */ + public function setMethod(string $method): self + { + $this->options['method'] = $method; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateMemberOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Queue/MemberPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Queue/MemberPage.php new file mode 100755 index 0000000..36a324b --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Queue/MemberPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MemberInstance \Twilio\Rest\Api\V2010\Account\Queue\MemberInstance + */ + public function buildInstance(array $payload): MemberInstance + { + return new MemberInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['queueSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.MemberPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/QueueContext.php b/app/api/Twilio/Rest/Api/V2010/Account/QueueContext.php new file mode 100755 index 0000000..c9d20a6 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/QueueContext.php @@ -0,0 +1,191 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Queues/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the QueueInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the QueueInstance + * + * @return QueueInstance Fetched QueueInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): QueueInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new QueueInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the QueueInstance + * + * @param array|Options $options Optional Arguments + * @return QueueInstance Updated QueueInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): QueueInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'MaxSize' => + $options['maxSize'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new QueueInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the members + */ + protected function getMembers(): MemberList + { + if (!$this->_members) { + $this->_members = new MemberList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_members; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.QueueContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/QueueInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/QueueInstance.php new file mode 100755 index 0000000..43f1ca7 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/QueueInstance.php @@ -0,0 +1,171 @@ +properties = [ + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'currentSize' => Values::array_get($payload, 'current_size'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'uri' => Values::array_get($payload, 'uri'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'averageWaitTime' => Values::array_get($payload, 'average_wait_time'), + 'sid' => Values::array_get($payload, 'sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'maxSize' => Values::array_get($payload, 'max_size'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return QueueContext Context for this QueueInstance + */ + protected function proxy(): QueueContext + { + if (!$this->context) { + $this->context = new QueueContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the QueueInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the QueueInstance + * + * @return QueueInstance Fetched QueueInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): QueueInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the QueueInstance + * + * @param array|Options $options Optional Arguments + * @return QueueInstance Updated QueueInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): QueueInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the members + */ + protected function getMembers(): MemberList + { + return $this->proxy()->members; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.QueueInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/QueueList.php b/app/api/Twilio/Rest/Api/V2010/Account/QueueList.php new file mode 100755 index 0000000..2cb8d14 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/QueueList.php @@ -0,0 +1,200 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Queues.json'; + } + + /** + * Create the QueueInstance + * + * @param string $friendlyName A descriptive string that you created to describe this resource. It can be up to 64 characters long. + * @param array|Options $options Optional Arguments + * @return QueueInstance Created QueueInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, array $options = []): QueueInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'MaxSize' => + $options['maxSize'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new QueueInstance( + $this->version, + $payload, + $this->solution['accountSid'] + ); + } + + + /** + * Reads QueueInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return QueueInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams QueueInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of QueueInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return QueuePage Page of QueueInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): QueuePage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new QueuePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of QueueInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return QueuePage Page of QueueInstance + */ + public function getPage(string $targetUrl): QueuePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new QueuePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a QueueContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Queue resource to delete + */ + public function getContext( + string $sid + + ): QueueContext + { + return new QueueContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.QueueList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/QueueOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/QueueOptions.php new file mode 100755 index 0000000..6f7b91e --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/QueueOptions.php @@ -0,0 +1,152 @@ +options['maxSize'] = $maxSize; + } + + /** + * The maximum number of calls allowed to be in the queue. The default is 1000. The maximum is 5000. + * + * @param int $maxSize The maximum number of calls allowed to be in the queue. The default is 1000. The maximum is 5000. + * @return $this Fluent Builder + */ + public function setMaxSize(int $maxSize): self + { + $this->options['maxSize'] = $maxSize; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateQueueOptions ' . $options . ']'; + } +} + + + + +class UpdateQueueOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you created to describe this resource. It can be up to 64 characters long. + * @param int $maxSize The maximum number of calls allowed to be in the queue. The default is 1000. The maximum is 5000. + */ + public function __construct( + + string $friendlyName = Values::NONE, + int $maxSize = Values::INT_NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['maxSize'] = $maxSize; + } + + /** + * A descriptive string that you created to describe this resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you created to describe this resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The maximum number of calls allowed to be in the queue. The default is 1000. The maximum is 5000. + * + * @param int $maxSize The maximum number of calls allowed to be in the queue. The default is 1000. The maximum is 5000. + * @return $this Fluent Builder + */ + public function setMaxSize(int $maxSize): self + { + $this->options['maxSize'] = $maxSize; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateQueueOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/QueuePage.php b/app/api/Twilio/Rest/Api/V2010/Account/QueuePage.php new file mode 100755 index 0000000..8b1761c --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/QueuePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return QueueInstance \Twilio\Rest\Api\V2010\Account\QueueInstance + */ + public function buildInstance(array $payload): QueueInstance + { + return new QueueInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.QueuePage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadContext.php b/app/api/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadContext.php new file mode 100755 index 0000000..60c8ff8 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadContext.php @@ -0,0 +1,112 @@ +solution = [ + 'accountSid' => + $accountSid, + 'referenceSid' => + $referenceSid, + 'addOnResultSid' => + $addOnResultSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Recordings/' . \rawurlencode($referenceSid) + .'/AddOnResults/' . \rawurlencode($addOnResultSid) + .'/Payloads/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the PayloadInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the PayloadInstance + * + * @return PayloadInstance Fetched PayloadInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PayloadInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new PayloadInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['referenceSid'], + $this->solution['addOnResultSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.PayloadContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadInstance.php new file mode 100755 index 0000000..df55bbb --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadInstance.php @@ -0,0 +1,154 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'addOnResultSid' => Values::array_get($payload, 'add_on_result_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'label' => Values::array_get($payload, 'label'), + 'addOnSid' => Values::array_get($payload, 'add_on_sid'), + 'addOnConfigurationSid' => Values::array_get($payload, 'add_on_configuration_sid'), + 'contentType' => Values::array_get($payload, 'content_type'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'referenceSid' => Values::array_get($payload, 'reference_sid'), + 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'referenceSid' => $referenceSid, 'addOnResultSid' => $addOnResultSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return PayloadContext Context for this PayloadInstance + */ + protected function proxy(): PayloadContext + { + if (!$this->context) { + $this->context = new PayloadContext( + $this->version, + $this->solution['accountSid'], + $this->solution['referenceSid'], + $this->solution['addOnResultSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the PayloadInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the PayloadInstance + * + * @return PayloadInstance Fetched PayloadInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PayloadInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.PayloadInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadList.php b/app/api/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadList.php new file mode 100755 index 0000000..d2bf128 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadList.php @@ -0,0 +1,182 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'referenceSid' => + $referenceSid, + + 'addOnResultSid' => + $addOnResultSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Recordings/' . \rawurlencode($referenceSid) + .'/AddOnResults/' . \rawurlencode($addOnResultSid) + .'/Payloads.json'; + } + + /** + * Reads PayloadInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return PayloadInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams PayloadInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of PayloadInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return PayloadPage Page of PayloadInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): PayloadPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new PayloadPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of PayloadInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return PayloadPage Page of PayloadInstance + */ + public function getPage(string $targetUrl): PayloadPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new PayloadPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a PayloadContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Recording AddOnResult Payload resource to delete. + */ + public function getContext( + string $sid + + ): PayloadContext + { + return new PayloadContext( + $this->version, + $this->solution['accountSid'], + $this->solution['referenceSid'], + $this->solution['addOnResultSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.PayloadList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadPage.php new file mode 100755 index 0000000..c263e0f --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Recording/AddOnResult/PayloadPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PayloadInstance \Twilio\Rest\Api\V2010\Account\Recording\AddOnResult\PayloadInstance + */ + public function buildInstance(array $payload): PayloadInstance + { + return new PayloadInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['referenceSid'], $this->solution['addOnResultSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.PayloadPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultContext.php b/app/api/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultContext.php new file mode 100755 index 0000000..afc244c --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultContext.php @@ -0,0 +1,166 @@ +solution = [ + 'accountSid' => + $accountSid, + 'referenceSid' => + $referenceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Recordings/' . \rawurlencode($referenceSid) + .'/AddOnResults/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the AddOnResultInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the AddOnResultInstance + * + * @return AddOnResultInstance Fetched AddOnResultInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AddOnResultInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new AddOnResultInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['referenceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the payloads + */ + protected function getPayloads(): PayloadList + { + if (!$this->_payloads) { + $this->_payloads = new PayloadList( + $this->version, + $this->solution['accountSid'], + $this->solution['referenceSid'], + $this->solution['sid'] + ); + } + + return $this->_payloads; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AddOnResultContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultInstance.php new file mode 100755 index 0000000..61361fd --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultInstance.php @@ -0,0 +1,161 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'status' => Values::array_get($payload, 'status'), + 'addOnSid' => Values::array_get($payload, 'add_on_sid'), + 'addOnConfigurationSid' => Values::array_get($payload, 'add_on_configuration_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'dateCompleted' => Deserialize::dateTime(Values::array_get($payload, 'date_completed')), + 'referenceSid' => Values::array_get($payload, 'reference_sid'), + 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'referenceSid' => $referenceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AddOnResultContext Context for this AddOnResultInstance + */ + protected function proxy(): AddOnResultContext + { + if (!$this->context) { + $this->context = new AddOnResultContext( + $this->version, + $this->solution['accountSid'], + $this->solution['referenceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the AddOnResultInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the AddOnResultInstance + * + * @return AddOnResultInstance Fetched AddOnResultInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AddOnResultInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the payloads + */ + protected function getPayloads(): PayloadList + { + return $this->proxy()->payloads; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AddOnResultInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultList.php b/app/api/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultList.php new file mode 100755 index 0000000..c20fc6c --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultList.php @@ -0,0 +1,175 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'referenceSid' => + $referenceSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Recordings/' . \rawurlencode($referenceSid) + .'/AddOnResults.json'; + } + + /** + * Reads AddOnResultInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return AddOnResultInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams AddOnResultInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AddOnResultInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return AddOnResultPage Page of AddOnResultInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AddOnResultPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new AddOnResultPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of AddOnResultInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return AddOnResultPage Page of AddOnResultInstance + */ + public function getPage(string $targetUrl): AddOnResultPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AddOnResultPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AddOnResultContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Recording AddOnResult resource to delete. + */ + public function getContext( + string $sid + + ): AddOnResultContext + { + return new AddOnResultContext( + $this->version, + $this->solution['accountSid'], + $this->solution['referenceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AddOnResultList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultPage.php new file mode 100755 index 0000000..f8dac75 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Recording/AddOnResultPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AddOnResultInstance \Twilio\Rest\Api\V2010\Account\Recording\AddOnResultInstance + */ + public function buildInstance(array $payload): AddOnResultInstance + { + return new AddOnResultInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['referenceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AddOnResultPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionContext.php b/app/api/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionContext.php new file mode 100755 index 0000000..b68250c --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionContext.php @@ -0,0 +1,106 @@ +solution = [ + 'accountSid' => + $accountSid, + 'recordingSid' => + $recordingSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Recordings/' . \rawurlencode($recordingSid) + .'/Transcriptions/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the TranscriptionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the TranscriptionInstance + * + * @return TranscriptionInstance Fetched TranscriptionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TranscriptionInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new TranscriptionInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['recordingSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.TranscriptionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionInstance.php new file mode 100755 index 0000000..703d2b6 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionInstance.php @@ -0,0 +1,156 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'duration' => Values::array_get($payload, 'duration'), + 'price' => Values::array_get($payload, 'price'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'recordingSid' => Values::array_get($payload, 'recording_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'status' => Values::array_get($payload, 'status'), + 'transcriptionText' => Values::array_get($payload, 'transcription_text'), + 'type' => Values::array_get($payload, 'type'), + 'uri' => Values::array_get($payload, 'uri'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'recordingSid' => $recordingSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return TranscriptionContext Context for this TranscriptionInstance + */ + protected function proxy(): TranscriptionContext + { + if (!$this->context) { + $this->context = new TranscriptionContext( + $this->version, + $this->solution['accountSid'], + $this->solution['recordingSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the TranscriptionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the TranscriptionInstance + * + * @return TranscriptionInstance Fetched TranscriptionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TranscriptionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.TranscriptionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionList.php b/app/api/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionList.php new file mode 100755 index 0000000..5a90f9e --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionList.php @@ -0,0 +1,175 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'recordingSid' => + $recordingSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Recordings/' . \rawurlencode($recordingSid) + .'/Transcriptions.json'; + } + + /** + * Reads TranscriptionInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return TranscriptionInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams TranscriptionInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of TranscriptionInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return TranscriptionPage Page of TranscriptionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): TranscriptionPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new TranscriptionPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of TranscriptionInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return TranscriptionPage Page of TranscriptionInstance + */ + public function getPage(string $targetUrl): TranscriptionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new TranscriptionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a TranscriptionContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Transcription resource to delete. + */ + public function getContext( + string $sid + + ): TranscriptionContext + { + return new TranscriptionContext( + $this->version, + $this->solution['accountSid'], + $this->solution['recordingSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.TranscriptionList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionPage.php new file mode 100755 index 0000000..7fb4907 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Recording/TranscriptionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TranscriptionInstance \Twilio\Rest\Api\V2010\Account\Recording\TranscriptionInstance + */ + public function buildInstance(array $payload): TranscriptionInstance + { + return new TranscriptionInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['recordingSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.TranscriptionPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/RecordingContext.php b/app/api/Twilio/Rest/Api/V2010/Account/RecordingContext.php new file mode 100755 index 0000000..07a1cdf --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/RecordingContext.php @@ -0,0 +1,190 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Recordings/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the RecordingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the RecordingInstance + * + * @param array|Options $options Optional Arguments + * @return RecordingInstance Fetched RecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): RecordingInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'IncludeSoftDeleted' => + Serialize::booleanToString($options['includeSoftDeleted']), + ]); + + $payload = $this->version->fetch('GET', $this->uri, $params); + + return new RecordingInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the addOnResults + */ + protected function getAddOnResults(): AddOnResultList + { + if (!$this->_addOnResults) { + $this->_addOnResults = new AddOnResultList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_addOnResults; + } + + /** + * Access the transcriptions + */ + protected function getTranscriptions(): TranscriptionList + { + if (!$this->_transcriptions) { + $this->_transcriptions = new TranscriptionList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_transcriptions; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.RecordingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/RecordingInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/RecordingInstance.php new file mode 100755 index 0000000..8f31930 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/RecordingInstance.php @@ -0,0 +1,189 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'callSid' => Values::array_get($payload, 'call_sid'), + 'conferenceSid' => Values::array_get($payload, 'conference_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), + 'duration' => Values::array_get($payload, 'duration'), + 'sid' => Values::array_get($payload, 'sid'), + 'price' => Values::array_get($payload, 'price'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'status' => Values::array_get($payload, 'status'), + 'channels' => Values::array_get($payload, 'channels'), + 'source' => Values::array_get($payload, 'source'), + 'errorCode' => Values::array_get($payload, 'error_code'), + 'uri' => Values::array_get($payload, 'uri'), + 'encryptionDetails' => Values::array_get($payload, 'encryption_details'), + 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), + 'mediaUrl' => Values::array_get($payload, 'media_url'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return RecordingContext Context for this RecordingInstance + */ + protected function proxy(): RecordingContext + { + if (!$this->context) { + $this->context = new RecordingContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the RecordingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the RecordingInstance + * + * @param array|Options $options Optional Arguments + * @return RecordingInstance Fetched RecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): RecordingInstance + { + + return $this->proxy()->fetch($options); + } + + /** + * Access the addOnResults + */ + protected function getAddOnResults(): AddOnResultList + { + return $this->proxy()->addOnResults; + } + + /** + * Access the transcriptions + */ + protected function getTranscriptions(): TranscriptionList + { + return $this->proxy()->transcriptions; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.RecordingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/RecordingList.php b/app/api/Twilio/Rest/Api/V2010/Account/RecordingList.php new file mode 100755 index 0000000..c9b63bc --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/RecordingList.php @@ -0,0 +1,186 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Recordings.json'; + } + + /** + * Reads RecordingInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return RecordingInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams RecordingInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of RecordingInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return RecordingPage Page of RecordingInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): RecordingPage + { + $options = new Values($options); + + $params = Values::of([ + 'DateCreated<' => + Serialize::iso8601DateTime($options['dateCreatedBefore']), + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateCreated>' => + Serialize::iso8601DateTime($options['dateCreatedAfter']), + 'CallSid' => + $options['callSid'], + 'ConferenceSid' => + $options['conferenceSid'], + 'IncludeSoftDeleted' => + Serialize::booleanToString($options['includeSoftDeleted']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new RecordingPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of RecordingInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return RecordingPage Page of RecordingInstance + */ + public function getPage(string $targetUrl): RecordingPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new RecordingPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a RecordingContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Recording resource to delete. + */ + public function getContext( + string $sid + + ): RecordingContext + { + return new RecordingContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.RecordingList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/RecordingOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/RecordingOptions.php new file mode 100755 index 0000000..0a07b79 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/RecordingOptions.php @@ -0,0 +1,220 @@ +=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. + * @param string $dateCreated Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. + * @param string $dateCreatedAfter Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. + * @param string $callSid The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resources to read. + * @param string $conferenceSid The Conference SID that identifies the conference associated with the recording to read. + * @param bool $includeSoftDeleted A boolean parameter indicating whether to retrieve soft deleted recordings or not. Recordings metadata are kept after deletion for a retention period of 40 days. + * @return ReadRecordingOptions Options builder + */ + public static function read( + + string $dateCreatedBefore = null, + string $dateCreated = null, + string $dateCreatedAfter = null, + string $callSid = Values::NONE, + string $conferenceSid = Values::NONE, + bool $includeSoftDeleted = Values::BOOL_NONE + + ): ReadRecordingOptions + { + return new ReadRecordingOptions( + $dateCreatedBefore, + $dateCreated, + $dateCreatedAfter, + $callSid, + $conferenceSid, + $includeSoftDeleted + ); + } + +} + + +class FetchRecordingOptions extends Options + { + /** + * @param bool $includeSoftDeleted A boolean parameter indicating whether to retrieve soft deleted recordings or not. Recordings metadata are kept after deletion for a retention period of 40 days. + */ + public function __construct( + + bool $includeSoftDeleted = Values::BOOL_NONE + + ) { + $this->options['includeSoftDeleted'] = $includeSoftDeleted; + } + + /** + * A boolean parameter indicating whether to retrieve soft deleted recordings or not. Recordings metadata are kept after deletion for a retention period of 40 days. + * + * @param bool $includeSoftDeleted A boolean parameter indicating whether to retrieve soft deleted recordings or not. Recordings metadata are kept after deletion for a retention period of 40 days. + * @return $this Fluent Builder + */ + public function setIncludeSoftDeleted(bool $includeSoftDeleted): self + { + $this->options['includeSoftDeleted'] = $includeSoftDeleted; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.FetchRecordingOptions ' . $options . ']'; + } +} + +class ReadRecordingOptions extends Options + { + /** + * @param string $dateCreatedBefore Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. + * @param string $dateCreated Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. + * @param string $dateCreatedAfter Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. + * @param string $callSid The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resources to read. + * @param string $conferenceSid The Conference SID that identifies the conference associated with the recording to read. + * @param bool $includeSoftDeleted A boolean parameter indicating whether to retrieve soft deleted recordings or not. Recordings metadata are kept after deletion for a retention period of 40 days. + */ + public function __construct( + + string $dateCreatedBefore = null, + string $dateCreated = null, + string $dateCreatedAfter = null, + string $callSid = Values::NONE, + string $conferenceSid = Values::NONE, + bool $includeSoftDeleted = Values::BOOL_NONE + + ) { + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + $this->options['callSid'] = $callSid; + $this->options['conferenceSid'] = $conferenceSid; + $this->options['includeSoftDeleted'] = $includeSoftDeleted; + } + + /** + * Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. + * + * @param string $dateCreatedBefore Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. + * @return $this Fluent Builder + */ + public function setDateCreatedBefore(string $dateCreatedBefore): self + { + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + return $this; + } + + /** + * Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. + * + * @param string $dateCreated Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. + * @return $this Fluent Builder + */ + public function setDateCreated(string $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. + * + * @param string $dateCreatedAfter Only include recordings that were created on this date. Specify a date as `YYYY-MM-DD` in GMT, for example: `2009-07-06`, to read recordings that were created on this date. You can also specify an inequality, such as `DateCreated<=YYYY-MM-DD`, to read recordings that were created on or before midnight of this date, and `DateCreated>=YYYY-MM-DD` to read recordings that were created on or after midnight of this date. + * @return $this Fluent Builder + */ + public function setDateCreatedAfter(string $dateCreatedAfter): self + { + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + return $this; + } + + /** + * The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resources to read. + * + * @param string $callSid The [Call](https://www.twilio.com/docs/voice/api/call-resource) SID of the resources to read. + * @return $this Fluent Builder + */ + public function setCallSid(string $callSid): self + { + $this->options['callSid'] = $callSid; + return $this; + } + + /** + * The Conference SID that identifies the conference associated with the recording to read. + * + * @param string $conferenceSid The Conference SID that identifies the conference associated with the recording to read. + * @return $this Fluent Builder + */ + public function setConferenceSid(string $conferenceSid): self + { + $this->options['conferenceSid'] = $conferenceSid; + return $this; + } + + /** + * A boolean parameter indicating whether to retrieve soft deleted recordings or not. Recordings metadata are kept after deletion for a retention period of 40 days. + * + * @param bool $includeSoftDeleted A boolean parameter indicating whether to retrieve soft deleted recordings or not. Recordings metadata are kept after deletion for a retention period of 40 days. + * @return $this Fluent Builder + */ + public function setIncludeSoftDeleted(bool $includeSoftDeleted): self + { + $this->options['includeSoftDeleted'] = $includeSoftDeleted; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadRecordingOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/RecordingPage.php b/app/api/Twilio/Rest/Api/V2010/Account/RecordingPage.php new file mode 100755 index 0000000..58fa81a --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/RecordingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RecordingInstance \Twilio\Rest\Api\V2010\Account\RecordingInstance + */ + public function buildInstance(array $payload): RecordingInstance + { + return new RecordingInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.RecordingPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/ShortCodeContext.php b/app/api/Twilio/Rest/Api/V2010/Account/ShortCodeContext.php new file mode 100755 index 0000000..b5d2426 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/ShortCodeContext.php @@ -0,0 +1,127 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SMS/ShortCodes/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Fetch the ShortCodeInstance + * + * @return ShortCodeInstance Fetched ShortCodeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ShortCodeInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ShortCodeInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ShortCodeInstance + * + * @param array|Options $options Optional Arguments + * @return ShortCodeInstance Updated ShortCodeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ShortCodeInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'ApiVersion' => + $options['apiVersion'], + 'SmsUrl' => + $options['smsUrl'], + 'SmsMethod' => + $options['smsMethod'], + 'SmsFallbackUrl' => + $options['smsFallbackUrl'], + 'SmsFallbackMethod' => + $options['smsFallbackMethod'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new ShortCodeInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.ShortCodeContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/ShortCodeInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/ShortCodeInstance.php new file mode 100755 index 0000000..21ce09e --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/ShortCodeInstance.php @@ -0,0 +1,154 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'shortCode' => Values::array_get($payload, 'short_code'), + 'sid' => Values::array_get($payload, 'sid'), + 'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'), + 'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'), + 'smsMethod' => Values::array_get($payload, 'sms_method'), + 'smsUrl' => Values::array_get($payload, 'sms_url'), + 'uri' => Values::array_get($payload, 'uri'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ShortCodeContext Context for this ShortCodeInstance + */ + protected function proxy(): ShortCodeContext + { + if (!$this->context) { + $this->context = new ShortCodeContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the ShortCodeInstance + * + * @return ShortCodeInstance Fetched ShortCodeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ShortCodeInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ShortCodeInstance + * + * @param array|Options $options Optional Arguments + * @return ShortCodeInstance Updated ShortCodeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ShortCodeInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.ShortCodeInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/ShortCodeList.php b/app/api/Twilio/Rest/Api/V2010/Account/ShortCodeList.php new file mode 100755 index 0000000..7fa1f6d --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/ShortCodeList.php @@ -0,0 +1,177 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SMS/ShortCodes.json'; + } + + /** + * Reads ShortCodeInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ShortCodeInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams ShortCodeInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ShortCodeInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ShortCodePage Page of ShortCodeInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ShortCodePage + { + $options = new Values($options); + + $params = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'ShortCode' => + $options['shortCode'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ShortCodePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ShortCodeInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ShortCodePage Page of ShortCodeInstance + */ + public function getPage(string $targetUrl): ShortCodePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ShortCodePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ShortCodeContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the ShortCode resource to fetch + */ + public function getContext( + string $sid + + ): ShortCodeContext + { + return new ShortCodeContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.ShortCodeList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/ShortCodeOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/ShortCodeOptions.php new file mode 100755 index 0000000..2941908 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/ShortCodeOptions.php @@ -0,0 +1,238 @@ +options['friendlyName'] = $friendlyName; + $this->options['shortCode'] = $shortCode; + } + + /** + * The string that identifies the ShortCode resources to read. + * + * @param string $friendlyName The string that identifies the ShortCode resources to read. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Only show the ShortCode resources that match this pattern. You can specify partial numbers and use '*' as a wildcard for any digit. + * + * @param string $shortCode Only show the ShortCode resources that match this pattern. You can specify partial numbers and use '*' as a wildcard for any digit. + * @return $this Fluent Builder + */ + public function setShortCode(string $shortCode): self + { + $this->options['shortCode'] = $shortCode; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadShortCodeOptions ' . $options . ']'; + } +} + +class UpdateShortCodeOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you created to describe this resource. It can be up to 64 characters long. By default, the `FriendlyName` is the short code. + * @param string $apiVersion The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. + * @param string $smsUrl The URL we should call when receiving an incoming SMS message to this short code. + * @param string $smsMethod The HTTP method we should use when calling the `sms_url`. Can be: `GET` or `POST`. + * @param string $smsFallbackUrl The URL that we should call if an error occurs while retrieving or executing the TwiML from `sms_url`. + * @param string $smsFallbackMethod The HTTP method that we should use to call the `sms_fallback_url`. Can be: `GET` or `POST`. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $apiVersion = Values::NONE, + string $smsUrl = Values::NONE, + string $smsMethod = Values::NONE, + string $smsFallbackUrl = Values::NONE, + string $smsFallbackMethod = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['apiVersion'] = $apiVersion; + $this->options['smsUrl'] = $smsUrl; + $this->options['smsMethod'] = $smsMethod; + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + } + + /** + * A descriptive string that you created to describe this resource. It can be up to 64 characters long. By default, the `FriendlyName` is the short code. + * + * @param string $friendlyName A descriptive string that you created to describe this resource. It can be up to 64 characters long. By default, the `FriendlyName` is the short code. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. + * + * @param string $apiVersion The API version to use to start a new TwiML session. Can be: `2010-04-01` or `2008-08-01`. + * @return $this Fluent Builder + */ + public function setApiVersion(string $apiVersion): self + { + $this->options['apiVersion'] = $apiVersion; + return $this; + } + + /** + * The URL we should call when receiving an incoming SMS message to this short code. + * + * @param string $smsUrl The URL we should call when receiving an incoming SMS message to this short code. + * @return $this Fluent Builder + */ + public function setSmsUrl(string $smsUrl): self + { + $this->options['smsUrl'] = $smsUrl; + return $this; + } + + /** + * The HTTP method we should use when calling the `sms_url`. Can be: `GET` or `POST`. + * + * @param string $smsMethod The HTTP method we should use when calling the `sms_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setSmsMethod(string $smsMethod): self + { + $this->options['smsMethod'] = $smsMethod; + return $this; + } + + /** + * The URL that we should call if an error occurs while retrieving or executing the TwiML from `sms_url`. + * + * @param string $smsFallbackUrl The URL that we should call if an error occurs while retrieving or executing the TwiML from `sms_url`. + * @return $this Fluent Builder + */ + public function setSmsFallbackUrl(string $smsFallbackUrl): self + { + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + return $this; + } + + /** + * The HTTP method that we should use to call the `sms_fallback_url`. Can be: `GET` or `POST`. + * + * @param string $smsFallbackMethod The HTTP method that we should use to call the `sms_fallback_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setSmsFallbackMethod(string $smsFallbackMethod): self + { + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateShortCodeOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/ShortCodePage.php b/app/api/Twilio/Rest/Api/V2010/Account/ShortCodePage.php new file mode 100755 index 0000000..de392a6 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/ShortCodePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ShortCodeInstance \Twilio\Rest\Api\V2010\Account\ShortCodeInstance + */ + public function buildInstance(array $payload): ShortCodeInstance + { + return new ShortCodeInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.ShortCodePage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/SigningKeyContext.php b/app/api/Twilio/Rest/Api/V2010/Account/SigningKeyContext.php new file mode 100755 index 0000000..11548d5 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/SigningKeyContext.php @@ -0,0 +1,130 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SigningKeys/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the SigningKeyInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the SigningKeyInstance + * + * @return SigningKeyInstance Fetched SigningKeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SigningKeyInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new SigningKeyInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the SigningKeyInstance + * + * @param array|Options $options Optional Arguments + * @return SigningKeyInstance Updated SigningKeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SigningKeyInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new SigningKeyInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.SigningKeyContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/SigningKeyInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/SigningKeyInstance.php new file mode 100755 index 0000000..4185fed --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/SigningKeyInstance.php @@ -0,0 +1,150 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + ]; + + $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SigningKeyContext Context for this SigningKeyInstance + */ + protected function proxy(): SigningKeyContext + { + if (!$this->context) { + $this->context = new SigningKeyContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the SigningKeyInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SigningKeyInstance + * + * @return SigningKeyInstance Fetched SigningKeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SigningKeyInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SigningKeyInstance + * + * @param array|Options $options Optional Arguments + * @return SigningKeyInstance Updated SigningKeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SigningKeyInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.SigningKeyInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/SigningKeyList.php b/app/api/Twilio/Rest/Api/V2010/Account/SigningKeyList.php new file mode 100755 index 0000000..25ffb8a --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/SigningKeyList.php @@ -0,0 +1,168 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SigningKeys.json'; + } + + /** + * Reads SigningKeyInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return SigningKeyInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams SigningKeyInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SigningKeyInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return SigningKeyPage Page of SigningKeyInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SigningKeyPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SigningKeyPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SigningKeyInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SigningKeyPage Page of SigningKeyInstance + */ + public function getPage(string $targetUrl): SigningKeyPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SigningKeyPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SigningKeyContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): SigningKeyContext + { + return new SigningKeyContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.SigningKeyList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/SigningKeyOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/SigningKeyOptions.php new file mode 100755 index 0000000..3cefd6f --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/SigningKeyOptions.php @@ -0,0 +1,82 @@ +options['friendlyName'] = $friendlyName; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateSigningKeyOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/SigningKeyPage.php b/app/api/Twilio/Rest/Api/V2010/Account/SigningKeyPage.php new file mode 100755 index 0000000..5214464 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/SigningKeyPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SigningKeyInstance \Twilio\Rest\Api\V2010\Account\SigningKeyInstance + */ + public function buildInstance(array $payload): SigningKeyInstance + { + return new SigningKeyInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.SigningKeyPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialContext.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialContext.php new file mode 100755 index 0000000..fe61eb2 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialContext.php @@ -0,0 +1,137 @@ +solution = [ + 'accountSid' => + $accountSid, + 'credentialListSid' => + $credentialListSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/CredentialLists/' . \rawurlencode($credentialListSid) + .'/Credentials/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the CredentialInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the CredentialInstance + * + * @return CredentialInstance Fetched CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new CredentialInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['credentialListSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the CredentialInstance + * + * @param array|Options $options Optional Arguments + * @return CredentialInstance Updated CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CredentialInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Password' => + $options['password'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new CredentialInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['credentialListSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.CredentialContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialInstance.php new file mode 100755 index 0000000..10d36dc --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialInstance.php @@ -0,0 +1,158 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'credentialListSid' => Values::array_get($payload, 'credential_list_sid'), + 'username' => Values::array_get($payload, 'username'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'uri' => Values::array_get($payload, 'uri'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'credentialListSid' => $credentialListSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CredentialContext Context for this CredentialInstance + */ + protected function proxy(): CredentialContext + { + if (!$this->context) { + $this->context = new CredentialContext( + $this->version, + $this->solution['accountSid'], + $this->solution['credentialListSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the CredentialInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the CredentialInstance + * + * @return CredentialInstance Fetched CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the CredentialInstance + * + * @param array|Options $options Optional Arguments + * @return CredentialInstance Updated CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CredentialInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.CredentialInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialList.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialList.php new file mode 100755 index 0000000..a9f4242 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialList.php @@ -0,0 +1,205 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'credentialListSid' => + $credentialListSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/CredentialLists/' . \rawurlencode($credentialListSid) + .'/Credentials.json'; + } + + /** + * Create the CredentialInstance + * + * @param string $username The username that will be passed when authenticating SIP requests. The username should be sent in response to Twilio's challenge of the initial INVITE. It can be up to 32 characters long. + * @param string $password The password that the username will use when authenticating SIP requests. The password must be a minimum of 12 characters, contain at least 1 digit, and have mixed case. (eg `IWasAtSignal2018`) + * @return CredentialInstance Created CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $username, string $password): CredentialInstance + { + + $data = Values::of([ + 'Username' => + $username, + 'Password' => + $password, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new CredentialInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['credentialListSid'] + ); + } + + + /** + * Reads CredentialInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return CredentialInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams CredentialInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CredentialInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return CredentialPage Page of CredentialInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CredentialPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new CredentialPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of CredentialInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return CredentialPage Page of CredentialInstance + */ + public function getPage(string $targetUrl): CredentialPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CredentialPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CredentialContext + * + * @param string $sid The unique id that identifies the resource to delete. + */ + public function getContext( + string $sid + + ): CredentialContext + { + return new CredentialContext( + $this->version, + $this->solution['accountSid'], + $this->solution['credentialListSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.CredentialList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialOptions.php new file mode 100755 index 0000000..c7a0406 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialOptions.php @@ -0,0 +1,84 @@ +options['password'] = $password; + } + + /** + * The password that the username will use when authenticating SIP requests. The password must be a minimum of 12 characters, contain at least 1 digit, and have mixed case. (eg `IWasAtSignal2018`) + * + * @param string $password The password that the username will use when authenticating SIP requests. The password must be a minimum of 12 characters, contain at least 1 digit, and have mixed case. (eg `IWasAtSignal2018`) + * @return $this Fluent Builder + */ + public function setPassword(string $password): self + { + $this->options['password'] = $password; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateCredentialOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialPage.php new file mode 100755 index 0000000..7163c3c --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/CredentialList/CredentialPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CredentialInstance \Twilio\Rest\Api\V2010\Account\Sip\CredentialList\CredentialInstance + */ + public function buildInstance(array $payload): CredentialInstance + { + return new CredentialInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['credentialListSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.CredentialPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/CredentialListContext.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/CredentialListContext.php new file mode 100755 index 0000000..add270b --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/CredentialListContext.php @@ -0,0 +1,186 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/CredentialLists/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the CredentialListInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the CredentialListInstance + * + * @return CredentialListInstance Fetched CredentialListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialListInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new CredentialListInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the CredentialListInstance + * + * @param string $friendlyName A human readable descriptive text for a CredentialList, up to 64 characters long. + * @return CredentialListInstance Updated CredentialListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $friendlyName): CredentialListInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new CredentialListInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the credentials + */ + protected function getCredentials(): CredentialList + { + if (!$this->_credentials) { + $this->_credentials = new CredentialList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_credentials; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.CredentialListContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/CredentialListInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/CredentialListInstance.php new file mode 100755 index 0000000..09a4681 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/CredentialListInstance.php @@ -0,0 +1,166 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'sid' => Values::array_get($payload, 'sid'), + 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), + 'uri' => Values::array_get($payload, 'uri'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CredentialListContext Context for this CredentialListInstance + */ + protected function proxy(): CredentialListContext + { + if (!$this->context) { + $this->context = new CredentialListContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the CredentialListInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the CredentialListInstance + * + * @return CredentialListInstance Fetched CredentialListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialListInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the CredentialListInstance + * + * @param string $friendlyName A human readable descriptive text for a CredentialList, up to 64 characters long. + * @return CredentialListInstance Updated CredentialListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $friendlyName): CredentialListInstance + { + + return $this->proxy()->update($friendlyName); + } + + /** + * Access the credentials + */ + protected function getCredentials(): CredentialList + { + return $this->proxy()->credentials; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.CredentialListInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/CredentialListList.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/CredentialListList.php new file mode 100755 index 0000000..58068f9 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/CredentialListList.php @@ -0,0 +1,195 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/CredentialLists.json'; + } + + /** + * Create the CredentialListInstance + * + * @param string $friendlyName A human readable descriptive text that describes the CredentialList, up to 64 characters long. + * @return CredentialListInstance Created CredentialListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName): CredentialListInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new CredentialListInstance( + $this->version, + $payload, + $this->solution['accountSid'] + ); + } + + + /** + * Reads CredentialListInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return CredentialListInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams CredentialListInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CredentialListInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return CredentialListPage Page of CredentialListInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CredentialListPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new CredentialListPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of CredentialListInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return CredentialListPage Page of CredentialListInstance + */ + public function getPage(string $targetUrl): CredentialListPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CredentialListPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CredentialListContext + * + * @param string $sid The credential list Sid that uniquely identifies this resource + */ + public function getContext( + string $sid + + ): CredentialListContext + { + return new CredentialListContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.CredentialListList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/CredentialListPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/CredentialListPage.php new file mode 100755 index 0000000..ed0ea58 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/CredentialListPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CredentialListInstance \Twilio\Rest\Api\V2010\Account\Sip\CredentialListInstance + */ + public function buildInstance(array $payload): CredentialListInstance + { + return new CredentialListInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.CredentialListPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingContext.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingContext.php new file mode 100755 index 0000000..1724842 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingContext.php @@ -0,0 +1,106 @@ +solution = [ + 'accountSid' => + $accountSid, + 'domainSid' => + $domainSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/Domains/' . \rawurlencode($domainSid) + .'/Auth/Calls/CredentialListMappings/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the AuthCallsCredentialListMappingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the AuthCallsCredentialListMappingInstance + * + * @return AuthCallsCredentialListMappingInstance Fetched AuthCallsCredentialListMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AuthCallsCredentialListMappingInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new AuthCallsCredentialListMappingInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['domainSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AuthCallsCredentialListMappingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingInstance.php new file mode 100755 index 0000000..1a54b4b --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingInstance.php @@ -0,0 +1,140 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'sid' => Values::array_get($payload, 'sid'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AuthCallsCredentialListMappingContext Context for this AuthCallsCredentialListMappingInstance + */ + protected function proxy(): AuthCallsCredentialListMappingContext + { + if (!$this->context) { + $this->context = new AuthCallsCredentialListMappingContext( + $this->version, + $this->solution['accountSid'], + $this->solution['domainSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the AuthCallsCredentialListMappingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the AuthCallsCredentialListMappingInstance + * + * @return AuthCallsCredentialListMappingInstance Fetched AuthCallsCredentialListMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AuthCallsCredentialListMappingInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AuthCallsCredentialListMappingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingList.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingList.php new file mode 100755 index 0000000..c485b4f --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingList.php @@ -0,0 +1,202 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'domainSid' => + $domainSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/Domains/' . \rawurlencode($domainSid) + .'/Auth/Calls/CredentialListMappings.json'; + } + + /** + * Create the AuthCallsCredentialListMappingInstance + * + * @param string $credentialListSid The SID of the CredentialList resource to map to the SIP domain. + * @return AuthCallsCredentialListMappingInstance Created AuthCallsCredentialListMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $credentialListSid): AuthCallsCredentialListMappingInstance + { + + $data = Values::of([ + 'CredentialListSid' => + $credentialListSid, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new AuthCallsCredentialListMappingInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['domainSid'] + ); + } + + + /** + * Reads AuthCallsCredentialListMappingInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return AuthCallsCredentialListMappingInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams AuthCallsCredentialListMappingInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AuthCallsCredentialListMappingInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return AuthCallsCredentialListMappingPage Page of AuthCallsCredentialListMappingInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AuthCallsCredentialListMappingPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new AuthCallsCredentialListMappingPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of AuthCallsCredentialListMappingInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return AuthCallsCredentialListMappingPage Page of AuthCallsCredentialListMappingInstance + */ + public function getPage(string $targetUrl): AuthCallsCredentialListMappingPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AuthCallsCredentialListMappingPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AuthCallsCredentialListMappingContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the CredentialListMapping resource to delete. + */ + public function getContext( + string $sid + + ): AuthCallsCredentialListMappingContext + { + return new AuthCallsCredentialListMappingContext( + $this->version, + $this->solution['accountSid'], + $this->solution['domainSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AuthCallsCredentialListMappingList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingPage.php new file mode 100755 index 0000000..0d02779 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsCredentialListMappingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AuthCallsCredentialListMappingInstance \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls\AuthCallsCredentialListMappingInstance + */ + public function buildInstance(array $payload): AuthCallsCredentialListMappingInstance + { + return new AuthCallsCredentialListMappingInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AuthCallsCredentialListMappingPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingContext.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingContext.php new file mode 100755 index 0000000..75b2ad3 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingContext.php @@ -0,0 +1,106 @@ +solution = [ + 'accountSid' => + $accountSid, + 'domainSid' => + $domainSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/Domains/' . \rawurlencode($domainSid) + .'/Auth/Calls/IpAccessControlListMappings/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the AuthCallsIpAccessControlListMappingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the AuthCallsIpAccessControlListMappingInstance + * + * @return AuthCallsIpAccessControlListMappingInstance Fetched AuthCallsIpAccessControlListMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AuthCallsIpAccessControlListMappingInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new AuthCallsIpAccessControlListMappingInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['domainSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AuthCallsIpAccessControlListMappingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingInstance.php new file mode 100755 index 0000000..b04f7d3 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingInstance.php @@ -0,0 +1,140 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'sid' => Values::array_get($payload, 'sid'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AuthCallsIpAccessControlListMappingContext Context for this AuthCallsIpAccessControlListMappingInstance + */ + protected function proxy(): AuthCallsIpAccessControlListMappingContext + { + if (!$this->context) { + $this->context = new AuthCallsIpAccessControlListMappingContext( + $this->version, + $this->solution['accountSid'], + $this->solution['domainSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the AuthCallsIpAccessControlListMappingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the AuthCallsIpAccessControlListMappingInstance + * + * @return AuthCallsIpAccessControlListMappingInstance Fetched AuthCallsIpAccessControlListMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AuthCallsIpAccessControlListMappingInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AuthCallsIpAccessControlListMappingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingList.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingList.php new file mode 100755 index 0000000..8c95b11 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingList.php @@ -0,0 +1,202 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'domainSid' => + $domainSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/Domains/' . \rawurlencode($domainSid) + .'/Auth/Calls/IpAccessControlListMappings.json'; + } + + /** + * Create the AuthCallsIpAccessControlListMappingInstance + * + * @param string $ipAccessControlListSid The SID of the IpAccessControlList resource to map to the SIP domain. + * @return AuthCallsIpAccessControlListMappingInstance Created AuthCallsIpAccessControlListMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $ipAccessControlListSid): AuthCallsIpAccessControlListMappingInstance + { + + $data = Values::of([ + 'IpAccessControlListSid' => + $ipAccessControlListSid, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new AuthCallsIpAccessControlListMappingInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['domainSid'] + ); + } + + + /** + * Reads AuthCallsIpAccessControlListMappingInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return AuthCallsIpAccessControlListMappingInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams AuthCallsIpAccessControlListMappingInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AuthCallsIpAccessControlListMappingInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return AuthCallsIpAccessControlListMappingPage Page of AuthCallsIpAccessControlListMappingInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AuthCallsIpAccessControlListMappingPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new AuthCallsIpAccessControlListMappingPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of AuthCallsIpAccessControlListMappingInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return AuthCallsIpAccessControlListMappingPage Page of AuthCallsIpAccessControlListMappingInstance + */ + public function getPage(string $targetUrl): AuthCallsIpAccessControlListMappingPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AuthCallsIpAccessControlListMappingPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AuthCallsIpAccessControlListMappingContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the IpAccessControlListMapping resource to delete. + */ + public function getContext( + string $sid + + ): AuthCallsIpAccessControlListMappingContext + { + return new AuthCallsIpAccessControlListMappingContext( + $this->version, + $this->solution['accountSid'], + $this->solution['domainSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AuthCallsIpAccessControlListMappingList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingPage.php new file mode 100755 index 0000000..e11b6c2 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCalls/AuthCallsIpAccessControlListMappingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AuthCallsIpAccessControlListMappingInstance \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCalls\AuthCallsIpAccessControlListMappingInstance + */ + public function buildInstance(array $payload): AuthCallsIpAccessControlListMappingInstance + { + return new AuthCallsIpAccessControlListMappingInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AuthCallsIpAccessControlListMappingPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCallsInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCallsInstance.php new file mode 100755 index 0000000..ef34028 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCallsInstance.php @@ -0,0 +1,73 @@ +solution = ['accountSid' => $accountSid, 'domainSid' => $domainSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AuthTypeCallsInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCallsList.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCallsList.php new file mode 100755 index 0000000..2081a64 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCallsList.php @@ -0,0 +1,137 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'domainSid' => + $domainSid, + + ]; + } + + /** + * Access the ipAccessControlListMappings + */ + protected function getIpAccessControlListMappings(): AuthCallsIpAccessControlListMappingList + { + if (!$this->_ipAccessControlListMappings) { + $this->_ipAccessControlListMappings = new AuthCallsIpAccessControlListMappingList( + $this->version, + $this->solution['accountSid'], + $this->solution['domainSid'] + ); + } + return $this->_ipAccessControlListMappings; + } + + /** + * Access the credentialListMappings + */ + protected function getCredentialListMappings(): AuthCallsCredentialListMappingList + { + if (!$this->_credentialListMappings) { + $this->_credentialListMappings = new AuthCallsCredentialListMappingList( + $this->version, + $this->solution['accountSid'], + $this->solution['domainSid'] + ); + } + return $this->_credentialListMappings; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name) + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AuthTypeCallsList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCallsPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCallsPage.php new file mode 100755 index 0000000..19b68b7 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeCallsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AuthTypeCallsInstance \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeCallsInstance + */ + public function buildInstance(array $payload): AuthTypeCallsInstance + { + return new AuthTypeCallsInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AuthTypeCallsPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingContext.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingContext.php new file mode 100755 index 0000000..282753f --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingContext.php @@ -0,0 +1,106 @@ +solution = [ + 'accountSid' => + $accountSid, + 'domainSid' => + $domainSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/Domains/' . \rawurlencode($domainSid) + .'/Auth/Registrations/CredentialListMappings/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the AuthRegistrationsCredentialListMappingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the AuthRegistrationsCredentialListMappingInstance + * + * @return AuthRegistrationsCredentialListMappingInstance Fetched AuthRegistrationsCredentialListMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AuthRegistrationsCredentialListMappingInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new AuthRegistrationsCredentialListMappingInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['domainSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AuthRegistrationsCredentialListMappingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingInstance.php new file mode 100755 index 0000000..90506eb --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingInstance.php @@ -0,0 +1,140 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'sid' => Values::array_get($payload, 'sid'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AuthRegistrationsCredentialListMappingContext Context for this AuthRegistrationsCredentialListMappingInstance + */ + protected function proxy(): AuthRegistrationsCredentialListMappingContext + { + if (!$this->context) { + $this->context = new AuthRegistrationsCredentialListMappingContext( + $this->version, + $this->solution['accountSid'], + $this->solution['domainSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the AuthRegistrationsCredentialListMappingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the AuthRegistrationsCredentialListMappingInstance + * + * @return AuthRegistrationsCredentialListMappingInstance Fetched AuthRegistrationsCredentialListMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AuthRegistrationsCredentialListMappingInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AuthRegistrationsCredentialListMappingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingList.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingList.php new file mode 100755 index 0000000..f918c84 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingList.php @@ -0,0 +1,202 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'domainSid' => + $domainSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/Domains/' . \rawurlencode($domainSid) + .'/Auth/Registrations/CredentialListMappings.json'; + } + + /** + * Create the AuthRegistrationsCredentialListMappingInstance + * + * @param string $credentialListSid The SID of the CredentialList resource to map to the SIP domain. + * @return AuthRegistrationsCredentialListMappingInstance Created AuthRegistrationsCredentialListMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $credentialListSid): AuthRegistrationsCredentialListMappingInstance + { + + $data = Values::of([ + 'CredentialListSid' => + $credentialListSid, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new AuthRegistrationsCredentialListMappingInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['domainSid'] + ); + } + + + /** + * Reads AuthRegistrationsCredentialListMappingInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return AuthRegistrationsCredentialListMappingInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams AuthRegistrationsCredentialListMappingInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AuthRegistrationsCredentialListMappingInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return AuthRegistrationsCredentialListMappingPage Page of AuthRegistrationsCredentialListMappingInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AuthRegistrationsCredentialListMappingPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new AuthRegistrationsCredentialListMappingPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of AuthRegistrationsCredentialListMappingInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return AuthRegistrationsCredentialListMappingPage Page of AuthRegistrationsCredentialListMappingInstance + */ + public function getPage(string $targetUrl): AuthRegistrationsCredentialListMappingPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AuthRegistrationsCredentialListMappingPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AuthRegistrationsCredentialListMappingContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the CredentialListMapping resource to delete. + */ + public function getContext( + string $sid + + ): AuthRegistrationsCredentialListMappingContext + { + return new AuthRegistrationsCredentialListMappingContext( + $this->version, + $this->solution['accountSid'], + $this->solution['domainSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AuthRegistrationsCredentialListMappingList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingPage.php new file mode 100755 index 0000000..07204d2 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrations/AuthRegistrationsCredentialListMappingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AuthRegistrationsCredentialListMappingInstance \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeRegistrations\AuthRegistrationsCredentialListMappingInstance + */ + public function buildInstance(array $payload): AuthRegistrationsCredentialListMappingInstance + { + return new AuthRegistrationsCredentialListMappingInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AuthRegistrationsCredentialListMappingPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrationsInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrationsInstance.php new file mode 100755 index 0000000..d1ee75a --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrationsInstance.php @@ -0,0 +1,73 @@ +solution = ['accountSid' => $accountSid, 'domainSid' => $domainSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AuthTypeRegistrationsInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrationsList.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrationsList.php new file mode 100755 index 0000000..7eda124 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrationsList.php @@ -0,0 +1,118 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'domainSid' => + $domainSid, + + ]; + } + + /** + * Access the credentialListMappings + */ + protected function getCredentialListMappings(): AuthRegistrationsCredentialListMappingList + { + if (!$this->_credentialListMappings) { + $this->_credentialListMappings = new AuthRegistrationsCredentialListMappingList( + $this->version, + $this->solution['accountSid'], + $this->solution['domainSid'] + ); + } + return $this->_credentialListMappings; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name) + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AuthTypeRegistrationsList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrationsPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrationsPage.php new file mode 100755 index 0000000..f91b0a3 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypes/AuthTypeRegistrationsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AuthTypeRegistrationsInstance \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypes\AuthTypeRegistrationsInstance + */ + public function buildInstance(array $payload): AuthTypeRegistrationsInstance + { + return new AuthTypeRegistrationsInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AuthTypeRegistrationsPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypesInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypesInstance.php new file mode 100755 index 0000000..c78ea44 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypesInstance.php @@ -0,0 +1,73 @@ +solution = ['accountSid' => $accountSid, 'domainSid' => $domainSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AuthTypesInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypesList.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypesList.php new file mode 100755 index 0000000..95ff60e --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypesList.php @@ -0,0 +1,135 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'domainSid' => + $domainSid, + + ]; + } + + /** + * Access the calls + */ + protected function getCalls(): AuthTypeCallsList + { + if (!$this->_calls) { + $this->_calls = new AuthTypeCallsList( + $this->version, + $this->solution['accountSid'], + $this->solution['domainSid'] + ); + } + return $this->_calls; + } + + /** + * Access the registrations + */ + protected function getRegistrations(): AuthTypeRegistrationsList + { + if (!$this->_registrations) { + $this->_registrations = new AuthTypeRegistrationsList( + $this->version, + $this->solution['accountSid'], + $this->solution['domainSid'] + ); + } + return $this->_registrations; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name) + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AuthTypesList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypesPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypesPage.php new file mode 100755 index 0000000..45d6cdc --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/AuthTypesPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AuthTypesInstance \Twilio\Rest\Api\V2010\Account\Sip\Domain\AuthTypesInstance + */ + public function buildInstance(array $payload): AuthTypesInstance + { + return new AuthTypesInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AuthTypesPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingContext.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingContext.php new file mode 100755 index 0000000..1cfd0f3 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingContext.php @@ -0,0 +1,106 @@ +solution = [ + 'accountSid' => + $accountSid, + 'domainSid' => + $domainSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/Domains/' . \rawurlencode($domainSid) + .'/CredentialListMappings/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the CredentialListMappingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the CredentialListMappingInstance + * + * @return CredentialListMappingInstance Fetched CredentialListMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialListMappingInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new CredentialListMappingInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['domainSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.CredentialListMappingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingInstance.php new file mode 100755 index 0000000..4e16335 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingInstance.php @@ -0,0 +1,144 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'domainSid' => Values::array_get($payload, 'domain_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'sid' => Values::array_get($payload, 'sid'), + 'uri' => Values::array_get($payload, 'uri'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CredentialListMappingContext Context for this CredentialListMappingInstance + */ + protected function proxy(): CredentialListMappingContext + { + if (!$this->context) { + $this->context = new CredentialListMappingContext( + $this->version, + $this->solution['accountSid'], + $this->solution['domainSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the CredentialListMappingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the CredentialListMappingInstance + * + * @return CredentialListMappingInstance Fetched CredentialListMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialListMappingInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.CredentialListMappingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingList.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingList.php new file mode 100755 index 0000000..05b8ccb --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingList.php @@ -0,0 +1,202 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'domainSid' => + $domainSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/Domains/' . \rawurlencode($domainSid) + .'/CredentialListMappings.json'; + } + + /** + * Create the CredentialListMappingInstance + * + * @param string $credentialListSid A 34 character string that uniquely identifies the CredentialList resource to map to the SIP domain. + * @return CredentialListMappingInstance Created CredentialListMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $credentialListSid): CredentialListMappingInstance + { + + $data = Values::of([ + 'CredentialListSid' => + $credentialListSid, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new CredentialListMappingInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['domainSid'] + ); + } + + + /** + * Reads CredentialListMappingInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return CredentialListMappingInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams CredentialListMappingInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CredentialListMappingInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return CredentialListMappingPage Page of CredentialListMappingInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CredentialListMappingPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new CredentialListMappingPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of CredentialListMappingInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return CredentialListMappingPage Page of CredentialListMappingInstance + */ + public function getPage(string $targetUrl): CredentialListMappingPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CredentialListMappingPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CredentialListMappingContext + * + * @param string $sid A 34 character string that uniquely identifies the resource to delete. + */ + public function getContext( + string $sid + + ): CredentialListMappingContext + { + return new CredentialListMappingContext( + $this->version, + $this->solution['accountSid'], + $this->solution['domainSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.CredentialListMappingList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingPage.php new file mode 100755 index 0000000..e056ab1 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/CredentialListMappingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CredentialListMappingInstance \Twilio\Rest\Api\V2010\Account\Sip\Domain\CredentialListMappingInstance + */ + public function buildInstance(array $payload): CredentialListMappingInstance + { + return new CredentialListMappingInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.CredentialListMappingPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingContext.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingContext.php new file mode 100755 index 0000000..3a9d265 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingContext.php @@ -0,0 +1,106 @@ +solution = [ + 'accountSid' => + $accountSid, + 'domainSid' => + $domainSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/Domains/' . \rawurlencode($domainSid) + .'/IpAccessControlListMappings/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the IpAccessControlListMappingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the IpAccessControlListMappingInstance + * + * @return IpAccessControlListMappingInstance Fetched IpAccessControlListMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): IpAccessControlListMappingInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new IpAccessControlListMappingInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['domainSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.IpAccessControlListMappingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingInstance.php new file mode 100755 index 0000000..0814e52 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingInstance.php @@ -0,0 +1,144 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'domainSid' => Values::array_get($payload, 'domain_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'sid' => Values::array_get($payload, 'sid'), + 'uri' => Values::array_get($payload, 'uri'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'domainSid' => $domainSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return IpAccessControlListMappingContext Context for this IpAccessControlListMappingInstance + */ + protected function proxy(): IpAccessControlListMappingContext + { + if (!$this->context) { + $this->context = new IpAccessControlListMappingContext( + $this->version, + $this->solution['accountSid'], + $this->solution['domainSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the IpAccessControlListMappingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the IpAccessControlListMappingInstance + * + * @return IpAccessControlListMappingInstance Fetched IpAccessControlListMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): IpAccessControlListMappingInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.IpAccessControlListMappingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingList.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingList.php new file mode 100755 index 0000000..92af8bc --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingList.php @@ -0,0 +1,202 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'domainSid' => + $domainSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/Domains/' . \rawurlencode($domainSid) + .'/IpAccessControlListMappings.json'; + } + + /** + * Create the IpAccessControlListMappingInstance + * + * @param string $ipAccessControlListSid The unique id of the IP access control list to map to the SIP domain. + * @return IpAccessControlListMappingInstance Created IpAccessControlListMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $ipAccessControlListSid): IpAccessControlListMappingInstance + { + + $data = Values::of([ + 'IpAccessControlListSid' => + $ipAccessControlListSid, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new IpAccessControlListMappingInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['domainSid'] + ); + } + + + /** + * Reads IpAccessControlListMappingInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return IpAccessControlListMappingInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams IpAccessControlListMappingInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of IpAccessControlListMappingInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return IpAccessControlListMappingPage Page of IpAccessControlListMappingInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): IpAccessControlListMappingPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new IpAccessControlListMappingPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of IpAccessControlListMappingInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return IpAccessControlListMappingPage Page of IpAccessControlListMappingInstance + */ + public function getPage(string $targetUrl): IpAccessControlListMappingPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new IpAccessControlListMappingPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a IpAccessControlListMappingContext + * + * @param string $sid A 34 character string that uniquely identifies the resource to delete. + */ + public function getContext( + string $sid + + ): IpAccessControlListMappingContext + { + return new IpAccessControlListMappingContext( + $this->version, + $this->solution['accountSid'], + $this->solution['domainSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.IpAccessControlListMappingList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingPage.php new file mode 100755 index 0000000..f59703f --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/Domain/IpAccessControlListMappingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return IpAccessControlListMappingInstance \Twilio\Rest\Api\V2010\Account\Sip\Domain\IpAccessControlListMappingInstance + */ + public function buildInstance(array $payload): IpAccessControlListMappingInstance + { + return new IpAccessControlListMappingInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['domainSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.IpAccessControlListMappingPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/DomainContext.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/DomainContext.php new file mode 100755 index 0000000..f30e40e --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/DomainContext.php @@ -0,0 +1,253 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/Domains/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the DomainInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the DomainInstance + * + * @return DomainInstance Fetched DomainInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DomainInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new DomainInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the DomainInstance + * + * @param array|Options $options Optional Arguments + * @return DomainInstance Updated DomainInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): DomainInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'VoiceFallbackMethod' => + $options['voiceFallbackMethod'], + 'VoiceFallbackUrl' => + $options['voiceFallbackUrl'], + 'VoiceMethod' => + $options['voiceMethod'], + 'VoiceStatusCallbackMethod' => + $options['voiceStatusCallbackMethod'], + 'VoiceStatusCallbackUrl' => + $options['voiceStatusCallbackUrl'], + 'VoiceUrl' => + $options['voiceUrl'], + 'SipRegistration' => + Serialize::booleanToString($options['sipRegistration']), + 'DomainName' => + $options['domainName'], + 'EmergencyCallingEnabled' => + Serialize::booleanToString($options['emergencyCallingEnabled']), + 'Secure' => + Serialize::booleanToString($options['secure']), + 'ByocTrunkSid' => + $options['byocTrunkSid'], + 'EmergencyCallerSid' => + $options['emergencyCallerSid'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new DomainInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the credentialListMappings + */ + protected function getCredentialListMappings(): CredentialListMappingList + { + if (!$this->_credentialListMappings) { + $this->_credentialListMappings = new CredentialListMappingList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_credentialListMappings; + } + + /** + * Access the ipAccessControlListMappings + */ + protected function getIpAccessControlListMappings(): IpAccessControlListMappingList + { + if (!$this->_ipAccessControlListMappings) { + $this->_ipAccessControlListMappings = new IpAccessControlListMappingList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_ipAccessControlListMappings; + } + + /** + * Access the auth + */ + protected function getAuth(): AuthTypesList + { + if (!$this->_auth) { + $this->_auth = new AuthTypesList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_auth; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.DomainContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/DomainInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/DomainInstance.php new file mode 100755 index 0000000..13d6555 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/DomainInstance.php @@ -0,0 +1,215 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'authType' => Values::array_get($payload, 'auth_type'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'domainName' => Values::array_get($payload, 'domain_name'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'sid' => Values::array_get($payload, 'sid'), + 'uri' => Values::array_get($payload, 'uri'), + 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), + 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), + 'voiceMethod' => Values::array_get($payload, 'voice_method'), + 'voiceStatusCallbackMethod' => Values::array_get($payload, 'voice_status_callback_method'), + 'voiceStatusCallbackUrl' => Values::array_get($payload, 'voice_status_callback_url'), + 'voiceUrl' => Values::array_get($payload, 'voice_url'), + 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), + 'sipRegistration' => Values::array_get($payload, 'sip_registration'), + 'emergencyCallingEnabled' => Values::array_get($payload, 'emergency_calling_enabled'), + 'secure' => Values::array_get($payload, 'secure'), + 'byocTrunkSid' => Values::array_get($payload, 'byoc_trunk_sid'), + 'emergencyCallerSid' => Values::array_get($payload, 'emergency_caller_sid'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return DomainContext Context for this DomainInstance + */ + protected function proxy(): DomainContext + { + if (!$this->context) { + $this->context = new DomainContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the DomainInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the DomainInstance + * + * @return DomainInstance Fetched DomainInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DomainInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the DomainInstance + * + * @param array|Options $options Optional Arguments + * @return DomainInstance Updated DomainInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): DomainInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the credentialListMappings + */ + protected function getCredentialListMappings(): CredentialListMappingList + { + return $this->proxy()->credentialListMappings; + } + + /** + * Access the ipAccessControlListMappings + */ + protected function getIpAccessControlListMappings(): IpAccessControlListMappingList + { + return $this->proxy()->ipAccessControlListMappings; + } + + /** + * Access the auth + */ + protected function getAuth(): AuthTypesList + { + return $this->proxy()->auth; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.DomainInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/DomainList.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/DomainList.php new file mode 100755 index 0000000..08c917e --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/DomainList.php @@ -0,0 +1,223 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/Domains.json'; + } + + /** + * Create the DomainInstance + * + * @param string $domainName The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and \\\"-\\\" and must end with `sip.twilio.com`. + * @param array|Options $options Optional Arguments + * @return DomainInstance Created DomainInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $domainName, array $options = []): DomainInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'DomainName' => + $domainName, + 'FriendlyName' => + $options['friendlyName'], + 'VoiceUrl' => + $options['voiceUrl'], + 'VoiceMethod' => + $options['voiceMethod'], + 'VoiceFallbackUrl' => + $options['voiceFallbackUrl'], + 'VoiceFallbackMethod' => + $options['voiceFallbackMethod'], + 'VoiceStatusCallbackUrl' => + $options['voiceStatusCallbackUrl'], + 'VoiceStatusCallbackMethod' => + $options['voiceStatusCallbackMethod'], + 'SipRegistration' => + Serialize::booleanToString($options['sipRegistration']), + 'EmergencyCallingEnabled' => + Serialize::booleanToString($options['emergencyCallingEnabled']), + 'Secure' => + Serialize::booleanToString($options['secure']), + 'ByocTrunkSid' => + $options['byocTrunkSid'], + 'EmergencyCallerSid' => + $options['emergencyCallerSid'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new DomainInstance( + $this->version, + $payload, + $this->solution['accountSid'] + ); + } + + + /** + * Reads DomainInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return DomainInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams DomainInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of DomainInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return DomainPage Page of DomainInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): DomainPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new DomainPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of DomainInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return DomainPage Page of DomainInstance + */ + public function getPage(string $targetUrl): DomainPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new DomainPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a DomainContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the SipDomain resource to delete. + */ + public function getContext( + string $sid + + ): DomainContext + { + return new DomainContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.DomainList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/DomainOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/DomainOptions.php new file mode 100755 index 0000000..0fed9e5 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/DomainOptions.php @@ -0,0 +1,548 @@ +options['friendlyName'] = $friendlyName; + $this->options['voiceUrl'] = $voiceUrl; + $this->options['voiceMethod'] = $voiceMethod; + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + $this->options['voiceStatusCallbackUrl'] = $voiceStatusCallbackUrl; + $this->options['voiceStatusCallbackMethod'] = $voiceStatusCallbackMethod; + $this->options['sipRegistration'] = $sipRegistration; + $this->options['emergencyCallingEnabled'] = $emergencyCallingEnabled; + $this->options['secure'] = $secure; + $this->options['byocTrunkSid'] = $byocTrunkSid; + $this->options['emergencyCallerSid'] = $emergencyCallerSid; + } + + /** + * A descriptive string that you created to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you created to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The URL we should when the domain receives a call. + * + * @param string $voiceUrl The URL we should when the domain receives a call. + * @return $this Fluent Builder + */ + public function setVoiceUrl(string $voiceUrl): self + { + $this->options['voiceUrl'] = $voiceUrl; + return $this; + } + + /** + * The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. + * + * @param string $voiceMethod The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setVoiceMethod(string $voiceMethod): self + { + $this->options['voiceMethod'] = $voiceMethod; + return $this; + } + + /** + * The URL that we should call when an error occurs while retrieving or executing the TwiML from `voice_url`. + * + * @param string $voiceFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML from `voice_url`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackUrl(string $voiceFallbackUrl): self + { + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + return $this; + } + + /** + * The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. + * + * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackMethod(string $voiceFallbackMethod): self + { + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + return $this; + } + + /** + * The URL that we should call to pass status parameters (such as call ended) to your application. + * + * @param string $voiceStatusCallbackUrl The URL that we should call to pass status parameters (such as call ended) to your application. + * @return $this Fluent Builder + */ + public function setVoiceStatusCallbackUrl(string $voiceStatusCallbackUrl): self + { + $this->options['voiceStatusCallbackUrl'] = $voiceStatusCallbackUrl; + return $this; + } + + /** + * The HTTP method we should use to call `voice_status_callback_url`. Can be: `GET` or `POST`. + * + * @param string $voiceStatusCallbackMethod The HTTP method we should use to call `voice_status_callback_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setVoiceStatusCallbackMethod(string $voiceStatusCallbackMethod): self + { + $this->options['voiceStatusCallbackMethod'] = $voiceStatusCallbackMethod; + return $this; + } + + /** + * Whether to allow SIP Endpoints to register with the domain to receive calls. Can be `true` or `false`. `true` allows SIP Endpoints to register with the domain to receive calls, `false` does not. + * + * @param bool $sipRegistration Whether to allow SIP Endpoints to register with the domain to receive calls. Can be `true` or `false`. `true` allows SIP Endpoints to register with the domain to receive calls, `false` does not. + * @return $this Fluent Builder + */ + public function setSipRegistration(bool $sipRegistration): self + { + $this->options['sipRegistration'] = $sipRegistration; + return $this; + } + + /** + * Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses. + * + * @param bool $emergencyCallingEnabled Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses. + * @return $this Fluent Builder + */ + public function setEmergencyCallingEnabled(bool $emergencyCallingEnabled): self + { + $this->options['emergencyCallingEnabled'] = $emergencyCallingEnabled; + return $this; + } + + /** + * Whether secure SIP is enabled for the domain. If enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls to this sip domain. + * + * @param bool $secure Whether secure SIP is enabled for the domain. If enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls to this sip domain. + * @return $this Fluent Builder + */ + public function setSecure(bool $secure): self + { + $this->options['secure'] = $secure; + return $this; + } + + /** + * The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with. + * + * @param string $byocTrunkSid The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with. + * @return $this Fluent Builder + */ + public function setByocTrunkSid(string $byocTrunkSid): self + { + $this->options['byocTrunkSid'] = $byocTrunkSid; + return $this; + } + + /** + * Whether an emergency caller sid is configured for the domain. If present, this phone number will be used as the callback for the emergency call. + * + * @param string $emergencyCallerSid Whether an emergency caller sid is configured for the domain. If present, this phone number will be used as the callback for the emergency call. + * @return $this Fluent Builder + */ + public function setEmergencyCallerSid(string $emergencyCallerSid): self + { + $this->options['emergencyCallerSid'] = $emergencyCallerSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateDomainOptions ' . $options . ']'; + } +} + + + + +class UpdateDomainOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you created to describe the resource. It can be up to 64 characters long. + * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. + * @param string $voiceFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML requested by `voice_url`. + * @param string $voiceMethod The HTTP method we should use to call `voice_url` + * @param string $voiceStatusCallbackMethod The HTTP method we should use to call `voice_status_callback_url`. Can be: `GET` or `POST`. + * @param string $voiceStatusCallbackUrl The URL that we should call to pass status parameters (such as call ended) to your application. + * @param string $voiceUrl The URL we should call when the domain receives a call. + * @param bool $sipRegistration Whether to allow SIP Endpoints to register with the domain to receive calls. Can be `true` or `false`. `true` allows SIP Endpoints to register with the domain to receive calls, `false` does not. + * @param string $domainName The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and \\\"-\\\" and must end with `sip.twilio.com`. + * @param bool $emergencyCallingEnabled Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses. + * @param bool $secure Whether secure SIP is enabled for the domain. If enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls to this sip domain. + * @param string $byocTrunkSid The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with. + * @param string $emergencyCallerSid Whether an emergency caller sid is configured for the domain. If present, this phone number will be used as the callback for the emergency call. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $voiceFallbackMethod = Values::NONE, + string $voiceFallbackUrl = Values::NONE, + string $voiceMethod = Values::NONE, + string $voiceStatusCallbackMethod = Values::NONE, + string $voiceStatusCallbackUrl = Values::NONE, + string $voiceUrl = Values::NONE, + bool $sipRegistration = Values::BOOL_NONE, + string $domainName = Values::NONE, + bool $emergencyCallingEnabled = Values::BOOL_NONE, + bool $secure = Values::BOOL_NONE, + string $byocTrunkSid = Values::NONE, + string $emergencyCallerSid = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + $this->options['voiceMethod'] = $voiceMethod; + $this->options['voiceStatusCallbackMethod'] = $voiceStatusCallbackMethod; + $this->options['voiceStatusCallbackUrl'] = $voiceStatusCallbackUrl; + $this->options['voiceUrl'] = $voiceUrl; + $this->options['sipRegistration'] = $sipRegistration; + $this->options['domainName'] = $domainName; + $this->options['emergencyCallingEnabled'] = $emergencyCallingEnabled; + $this->options['secure'] = $secure; + $this->options['byocTrunkSid'] = $byocTrunkSid; + $this->options['emergencyCallerSid'] = $emergencyCallerSid; + } + + /** + * A descriptive string that you created to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you created to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. + * + * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackMethod(string $voiceFallbackMethod): self + { + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + return $this; + } + + /** + * The URL that we should call when an error occurs while retrieving or executing the TwiML requested by `voice_url`. + * + * @param string $voiceFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML requested by `voice_url`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackUrl(string $voiceFallbackUrl): self + { + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + return $this; + } + + /** + * The HTTP method we should use to call `voice_url` + * + * @param string $voiceMethod The HTTP method we should use to call `voice_url` + * @return $this Fluent Builder + */ + public function setVoiceMethod(string $voiceMethod): self + { + $this->options['voiceMethod'] = $voiceMethod; + return $this; + } + + /** + * The HTTP method we should use to call `voice_status_callback_url`. Can be: `GET` or `POST`. + * + * @param string $voiceStatusCallbackMethod The HTTP method we should use to call `voice_status_callback_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setVoiceStatusCallbackMethod(string $voiceStatusCallbackMethod): self + { + $this->options['voiceStatusCallbackMethod'] = $voiceStatusCallbackMethod; + return $this; + } + + /** + * The URL that we should call to pass status parameters (such as call ended) to your application. + * + * @param string $voiceStatusCallbackUrl The URL that we should call to pass status parameters (such as call ended) to your application. + * @return $this Fluent Builder + */ + public function setVoiceStatusCallbackUrl(string $voiceStatusCallbackUrl): self + { + $this->options['voiceStatusCallbackUrl'] = $voiceStatusCallbackUrl; + return $this; + } + + /** + * The URL we should call when the domain receives a call. + * + * @param string $voiceUrl The URL we should call when the domain receives a call. + * @return $this Fluent Builder + */ + public function setVoiceUrl(string $voiceUrl): self + { + $this->options['voiceUrl'] = $voiceUrl; + return $this; + } + + /** + * Whether to allow SIP Endpoints to register with the domain to receive calls. Can be `true` or `false`. `true` allows SIP Endpoints to register with the domain to receive calls, `false` does not. + * + * @param bool $sipRegistration Whether to allow SIP Endpoints to register with the domain to receive calls. Can be `true` or `false`. `true` allows SIP Endpoints to register with the domain to receive calls, `false` does not. + * @return $this Fluent Builder + */ + public function setSipRegistration(bool $sipRegistration): self + { + $this->options['sipRegistration'] = $sipRegistration; + return $this; + } + + /** + * The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and \\\"-\\\" and must end with `sip.twilio.com`. + * + * @param string $domainName The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and \\\"-\\\" and must end with `sip.twilio.com`. + * @return $this Fluent Builder + */ + public function setDomainName(string $domainName): self + { + $this->options['domainName'] = $domainName; + return $this; + } + + /** + * Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses. + * + * @param bool $emergencyCallingEnabled Whether emergency calling is enabled for the domain. If enabled, allows emergency calls on the domain from phone numbers with validated addresses. + * @return $this Fluent Builder + */ + public function setEmergencyCallingEnabled(bool $emergencyCallingEnabled): self + { + $this->options['emergencyCallingEnabled'] = $emergencyCallingEnabled; + return $this; + } + + /** + * Whether secure SIP is enabled for the domain. If enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls to this sip domain. + * + * @param bool $secure Whether secure SIP is enabled for the domain. If enabled, TLS will be enforced and SRTP will be negotiated on all incoming calls to this sip domain. + * @return $this Fluent Builder + */ + public function setSecure(bool $secure): self + { + $this->options['secure'] = $secure; + return $this; + } + + /** + * The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with. + * + * @param string $byocTrunkSid The SID of the BYOC Trunk(Bring Your Own Carrier) resource that the Sip Domain will be associated with. + * @return $this Fluent Builder + */ + public function setByocTrunkSid(string $byocTrunkSid): self + { + $this->options['byocTrunkSid'] = $byocTrunkSid; + return $this; + } + + /** + * Whether an emergency caller sid is configured for the domain. If present, this phone number will be used as the callback for the emergency call. + * + * @param string $emergencyCallerSid Whether an emergency caller sid is configured for the domain. If present, this phone number will be used as the callback for the emergency call. + * @return $this Fluent Builder + */ + public function setEmergencyCallerSid(string $emergencyCallerSid): self + { + $this->options['emergencyCallerSid'] = $emergencyCallerSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateDomainOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/DomainPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/DomainPage.php new file mode 100755 index 0000000..ae4cdb2 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/DomainPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DomainInstance \Twilio\Rest\Api\V2010\Account\Sip\DomainInstance + */ + public function buildInstance(array $payload): DomainInstance + { + return new DomainInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.DomainPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressContext.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressContext.php new file mode 100755 index 0000000..99bbf45 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressContext.php @@ -0,0 +1,141 @@ +solution = [ + 'accountSid' => + $accountSid, + 'ipAccessControlListSid' => + $ipAccessControlListSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/IpAccessControlLists/' . \rawurlencode($ipAccessControlListSid) + .'/IpAddresses/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the IpAddressInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the IpAddressInstance + * + * @return IpAddressInstance Fetched IpAddressInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): IpAddressInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new IpAddressInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['ipAccessControlListSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the IpAddressInstance + * + * @param array|Options $options Optional Arguments + * @return IpAddressInstance Updated IpAddressInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): IpAddressInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'IpAddress' => + $options['ipAddress'], + 'FriendlyName' => + $options['friendlyName'], + 'CidrPrefixLength' => + $options['cidrPrefixLength'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new IpAddressInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['ipAccessControlListSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.IpAddressContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressInstance.php new file mode 100755 index 0000000..fd18a90 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressInstance.php @@ -0,0 +1,162 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'ipAddress' => Values::array_get($payload, 'ip_address'), + 'cidrPrefixLength' => Values::array_get($payload, 'cidr_prefix_length'), + 'ipAccessControlListSid' => Values::array_get($payload, 'ip_access_control_list_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'uri' => Values::array_get($payload, 'uri'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'ipAccessControlListSid' => $ipAccessControlListSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return IpAddressContext Context for this IpAddressInstance + */ + protected function proxy(): IpAddressContext + { + if (!$this->context) { + $this->context = new IpAddressContext( + $this->version, + $this->solution['accountSid'], + $this->solution['ipAccessControlListSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the IpAddressInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the IpAddressInstance + * + * @return IpAddressInstance Fetched IpAddressInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): IpAddressInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the IpAddressInstance + * + * @param array|Options $options Optional Arguments + * @return IpAddressInstance Updated IpAddressInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): IpAddressInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.IpAddressInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressList.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressList.php new file mode 100755 index 0000000..2c58c7e --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressList.php @@ -0,0 +1,211 @@ +solution = [ + 'accountSid' => + $accountSid, + + 'ipAccessControlListSid' => + $ipAccessControlListSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/IpAccessControlLists/' . \rawurlencode($ipAccessControlListSid) + .'/IpAddresses.json'; + } + + /** + * Create the IpAddressInstance + * + * @param string $friendlyName A human readable descriptive text for this resource, up to 255 characters long. + * @param string $ipAddress An IP address in dotted decimal notation from which you want to accept traffic. Any SIP requests from this IP address will be allowed by Twilio. IPv4 only supported today. + * @param array|Options $options Optional Arguments + * @return IpAddressInstance Created IpAddressInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $ipAddress, array $options = []): IpAddressInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'IpAddress' => + $ipAddress, + 'CidrPrefixLength' => + $options['cidrPrefixLength'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new IpAddressInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['ipAccessControlListSid'] + ); + } + + + /** + * Reads IpAddressInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return IpAddressInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams IpAddressInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of IpAddressInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return IpAddressPage Page of IpAddressInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): IpAddressPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new IpAddressPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of IpAddressInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return IpAddressPage Page of IpAddressInstance + */ + public function getPage(string $targetUrl): IpAddressPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new IpAddressPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a IpAddressContext + * + * @param string $sid A 34 character string that uniquely identifies the resource to delete. + */ + public function getContext( + string $sid + + ): IpAddressContext + { + return new IpAddressContext( + $this->version, + $this->solution['accountSid'], + $this->solution['ipAccessControlListSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.IpAddressList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressOptions.php new file mode 100755 index 0000000..f02a1a4 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressOptions.php @@ -0,0 +1,170 @@ +options['cidrPrefixLength'] = $cidrPrefixLength; + } + + /** + * An integer representing the length of the CIDR prefix to use with this IP address when accepting traffic. By default the entire IP address is used. + * + * @param int $cidrPrefixLength An integer representing the length of the CIDR prefix to use with this IP address when accepting traffic. By default the entire IP address is used. + * @return $this Fluent Builder + */ + public function setCidrPrefixLength(int $cidrPrefixLength): self + { + $this->options['cidrPrefixLength'] = $cidrPrefixLength; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateIpAddressOptions ' . $options . ']'; + } +} + + + + +class UpdateIpAddressOptions extends Options + { + /** + * @param string $ipAddress An IP address in dotted decimal notation from which you want to accept traffic. Any SIP requests from this IP address will be allowed by Twilio. IPv4 only supported today. + * @param string $friendlyName A human readable descriptive text for this resource, up to 255 characters long. + * @param int $cidrPrefixLength An integer representing the length of the CIDR prefix to use with this IP address when accepting traffic. By default the entire IP address is used. + */ + public function __construct( + + string $ipAddress = Values::NONE, + string $friendlyName = Values::NONE, + int $cidrPrefixLength = Values::INT_NONE + + ) { + $this->options['ipAddress'] = $ipAddress; + $this->options['friendlyName'] = $friendlyName; + $this->options['cidrPrefixLength'] = $cidrPrefixLength; + } + + /** + * An IP address in dotted decimal notation from which you want to accept traffic. Any SIP requests from this IP address will be allowed by Twilio. IPv4 only supported today. + * + * @param string $ipAddress An IP address in dotted decimal notation from which you want to accept traffic. Any SIP requests from this IP address will be allowed by Twilio. IPv4 only supported today. + * @return $this Fluent Builder + */ + public function setIpAddress(string $ipAddress): self + { + $this->options['ipAddress'] = $ipAddress; + return $this; + } + + /** + * A human readable descriptive text for this resource, up to 255 characters long. + * + * @param string $friendlyName A human readable descriptive text for this resource, up to 255 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * An integer representing the length of the CIDR prefix to use with this IP address when accepting traffic. By default the entire IP address is used. + * + * @param int $cidrPrefixLength An integer representing the length of the CIDR prefix to use with this IP address when accepting traffic. By default the entire IP address is used. + * @return $this Fluent Builder + */ + public function setCidrPrefixLength(int $cidrPrefixLength): self + { + $this->options['cidrPrefixLength'] = $cidrPrefixLength; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateIpAddressOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressPage.php new file mode 100755 index 0000000..c7821b0 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlList/IpAddressPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return IpAddressInstance \Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlList\IpAddressInstance + */ + public function buildInstance(array $payload): IpAddressInstance + { + return new IpAddressInstance($this->version, $payload, $this->solution['accountSid'], $this->solution['ipAccessControlListSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.IpAddressPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListContext.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListContext.php new file mode 100755 index 0000000..1b56bbe --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListContext.php @@ -0,0 +1,186 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/IpAccessControlLists/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the IpAccessControlListInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the IpAccessControlListInstance + * + * @return IpAccessControlListInstance Fetched IpAccessControlListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): IpAccessControlListInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new IpAccessControlListInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the IpAccessControlListInstance + * + * @param string $friendlyName A human readable descriptive text, up to 255 characters long. + * @return IpAccessControlListInstance Updated IpAccessControlListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $friendlyName): IpAccessControlListInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new IpAccessControlListInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the ipAddresses + */ + protected function getIpAddresses(): IpAddressList + { + if (!$this->_ipAddresses) { + $this->_ipAddresses = new IpAddressList( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->_ipAddresses; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.IpAccessControlListContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListInstance.php new file mode 100755 index 0000000..045ef68 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListInstance.php @@ -0,0 +1,166 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), + 'uri' => Values::array_get($payload, 'uri'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return IpAccessControlListContext Context for this IpAccessControlListInstance + */ + protected function proxy(): IpAccessControlListContext + { + if (!$this->context) { + $this->context = new IpAccessControlListContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the IpAccessControlListInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the IpAccessControlListInstance + * + * @return IpAccessControlListInstance Fetched IpAccessControlListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): IpAccessControlListInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the IpAccessControlListInstance + * + * @param string $friendlyName A human readable descriptive text, up to 255 characters long. + * @return IpAccessControlListInstance Updated IpAccessControlListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $friendlyName): IpAccessControlListInstance + { + + return $this->proxy()->update($friendlyName); + } + + /** + * Access the ipAddresses + */ + protected function getIpAddresses(): IpAddressList + { + return $this->proxy()->ipAddresses; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.IpAccessControlListInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListList.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListList.php new file mode 100755 index 0000000..c8b1edc --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListList.php @@ -0,0 +1,194 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/SIP/IpAccessControlLists.json'; + } + + /** + * Create the IpAccessControlListInstance + * + * @param string $friendlyName A human readable descriptive text that describes the IpAccessControlList, up to 255 characters long. + * @return IpAccessControlListInstance Created IpAccessControlListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName): IpAccessControlListInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new IpAccessControlListInstance( + $this->version, + $payload, + $this->solution['accountSid'] + ); + } + + + /** + * Reads IpAccessControlListInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return IpAccessControlListInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams IpAccessControlListInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of IpAccessControlListInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return IpAccessControlListPage Page of IpAccessControlListInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): IpAccessControlListPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new IpAccessControlListPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of IpAccessControlListInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return IpAccessControlListPage Page of IpAccessControlListInstance + */ + public function getPage(string $targetUrl): IpAccessControlListPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new IpAccessControlListPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a IpAccessControlListContext + * + * @param string $sid A 34 character string that uniquely identifies the resource to delete. + */ + public function getContext( + string $sid + + ): IpAccessControlListContext + { + return new IpAccessControlListContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.IpAccessControlListList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListPage.php new file mode 100755 index 0000000..3a0088e --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Sip/IpAccessControlListPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return IpAccessControlListInstance \Twilio\Rest\Api\V2010\Account\Sip\IpAccessControlListInstance + */ + public function buildInstance(array $payload): IpAccessControlListInstance + { + return new IpAccessControlListInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.IpAccessControlListPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/SipInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/SipInstance.php new file mode 100755 index 0000000..efaf940 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/SipInstance.php @@ -0,0 +1,72 @@ +solution = ['accountSid' => $accountSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.SipInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/SipList.php b/app/api/Twilio/Rest/Api/V2010/Account/SipList.php new file mode 100755 index 0000000..221a19f --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/SipList.php @@ -0,0 +1,148 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + } + + /** + * Access the domains + */ + protected function getDomains(): DomainList + { + if (!$this->_domains) { + $this->_domains = new DomainList( + $this->version, + $this->solution['accountSid'] + ); + } + return $this->_domains; + } + + /** + * Access the credentialLists + */ + protected function getCredentialLists(): CredentialListList + { + if (!$this->_credentialLists) { + $this->_credentialLists = new CredentialListList( + $this->version, + $this->solution['accountSid'] + ); + } + return $this->_credentialLists; + } + + /** + * Access the ipAccessControlLists + */ + protected function getIpAccessControlLists(): IpAccessControlListList + { + if (!$this->_ipAccessControlLists) { + $this->_ipAccessControlLists = new IpAccessControlListList( + $this->version, + $this->solution['accountSid'] + ); + } + return $this->_ipAccessControlLists; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name) + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.SipList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/SipPage.php b/app/api/Twilio/Rest/Api/V2010/Account/SipPage.php new file mode 100755 index 0000000..0a13bcc --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/SipPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SipInstance \Twilio\Rest\Api\V2010\Account\SipInstance + */ + public function buildInstance(array $payload): SipInstance + { + return new SipInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.SipPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/TokenInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/TokenInstance.php new file mode 100755 index 0000000..071d02e --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/TokenInstance.php @@ -0,0 +1,94 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'iceServers' => Values::array_get($payload, 'ice_servers'), + 'password' => Values::array_get($payload, 'password'), + 'ttl' => Values::array_get($payload, 'ttl'), + 'username' => Values::array_get($payload, 'username'), + ]; + + $this->solution = ['accountSid' => $accountSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.TokenInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/TokenList.php b/app/api/Twilio/Rest/Api/V2010/Account/TokenList.php new file mode 100755 index 0000000..3e2c7f7 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/TokenList.php @@ -0,0 +1,87 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Tokens.json'; + } + + /** + * Create the TokenInstance + * + * @param array|Options $options Optional Arguments + * @return TokenInstance Created TokenInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): TokenInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Ttl' => + $options['ttl'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new TokenInstance( + $this->version, + $payload, + $this->solution['accountSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.TokenList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/TokenOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/TokenOptions.php new file mode 100755 index 0000000..b483446 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/TokenOptions.php @@ -0,0 +1,76 @@ +options['ttl'] = $ttl; + } + + /** + * The duration in seconds for which the generated credentials are valid. The default value is 86400 (24 hours). + * + * @param int $ttl The duration in seconds for which the generated credentials are valid. The default value is 86400 (24 hours). + * @return $this Fluent Builder + */ + public function setTtl(int $ttl): self + { + $this->options['ttl'] = $ttl; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateTokenOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/TokenPage.php b/app/api/Twilio/Rest/Api/V2010/Account/TokenPage.php new file mode 100755 index 0000000..04b988a --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/TokenPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TokenInstance \Twilio\Rest\Api\V2010\Account\TokenInstance + */ + public function buildInstance(array $payload): TokenInstance + { + return new TokenInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.TokenPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/TranscriptionContext.php b/app/api/Twilio/Rest/Api/V2010/Account/TranscriptionContext.php new file mode 100755 index 0000000..7ba341b --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/TranscriptionContext.php @@ -0,0 +1,100 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Transcriptions/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the TranscriptionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the TranscriptionInstance + * + * @return TranscriptionInstance Fetched TranscriptionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TranscriptionInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new TranscriptionInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.TranscriptionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/TranscriptionInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/TranscriptionInstance.php new file mode 100755 index 0000000..e1c0513 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/TranscriptionInstance.php @@ -0,0 +1,154 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'duration' => Values::array_get($payload, 'duration'), + 'price' => Values::array_get($payload, 'price'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'recordingSid' => Values::array_get($payload, 'recording_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'status' => Values::array_get($payload, 'status'), + 'transcriptionText' => Values::array_get($payload, 'transcription_text'), + 'type' => Values::array_get($payload, 'type'), + 'uri' => Values::array_get($payload, 'uri'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return TranscriptionContext Context for this TranscriptionInstance + */ + protected function proxy(): TranscriptionContext + { + if (!$this->context) { + $this->context = new TranscriptionContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the TranscriptionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the TranscriptionInstance + * + * @return TranscriptionInstance Fetched TranscriptionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TranscriptionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.TranscriptionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/TranscriptionList.php b/app/api/Twilio/Rest/Api/V2010/Account/TranscriptionList.php new file mode 100755 index 0000000..e548a13 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/TranscriptionList.php @@ -0,0 +1,168 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Transcriptions.json'; + } + + /** + * Reads TranscriptionInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return TranscriptionInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams TranscriptionInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of TranscriptionInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return TranscriptionPage Page of TranscriptionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): TranscriptionPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new TranscriptionPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of TranscriptionInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return TranscriptionPage Page of TranscriptionInstance + */ + public function getPage(string $targetUrl): TranscriptionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new TranscriptionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a TranscriptionContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Transcription resource to delete. + */ + public function getContext( + string $sid + + ): TranscriptionContext + { + return new TranscriptionContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.TranscriptionList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/TranscriptionPage.php b/app/api/Twilio/Rest/Api/V2010/Account/TranscriptionPage.php new file mode 100755 index 0000000..eda5be9 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/TranscriptionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TranscriptionInstance \Twilio\Rest\Api\V2010\Account\TranscriptionInstance + */ + public function buildInstance(array $payload): TranscriptionInstance + { + return new TranscriptionInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.TranscriptionPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimeInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimeInstance.php new file mode 100755 index 0000000..f393a90 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimeInstance.php @@ -0,0 +1,110 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'asOf' => Values::array_get($payload, 'as_of'), + 'category' => Values::array_get($payload, 'category'), + 'count' => Values::array_get($payload, 'count'), + 'countUnit' => Values::array_get($payload, 'count_unit'), + 'description' => Values::array_get($payload, 'description'), + 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), + 'price' => Values::array_get($payload, 'price'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), + 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), + 'uri' => Values::array_get($payload, 'uri'), + 'usage' => Values::array_get($payload, 'usage'), + 'usageUnit' => Values::array_get($payload, 'usage_unit'), + ]; + + $this->solution = ['accountSid' => $accountSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AllTimeInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimeList.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimeList.php new file mode 100755 index 0000000..10d8083 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimeList.php @@ -0,0 +1,165 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Usage/Records/AllTime.json'; + } + + /** + * Reads AllTimeInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return AllTimeInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams AllTimeInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AllTimeInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return AllTimePage Page of AllTimeInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AllTimePage + { + $options = new Values($options); + + $params = Values::of([ + 'Category' => + $options['category'], + 'StartDate' => + Serialize::iso8601Date($options['startDate']), + 'EndDate' => + Serialize::iso8601Date($options['endDate']), + 'IncludeSubaccounts' => + Serialize::booleanToString($options['includeSubaccounts']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new AllTimePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of AllTimeInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return AllTimePage Page of AllTimeInstance + */ + public function getPage(string $targetUrl): AllTimePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AllTimePage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AllTimeList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimeOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimeOptions.php new file mode 100755 index 0000000..a0c210f --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimeOptions.php @@ -0,0 +1,130 @@ +options['category'] = $category; + $this->options['startDate'] = $startDate; + $this->options['endDate'] = $endDate; + $this->options['includeSubaccounts'] = $includeSubaccounts; + } + + /** + * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. + * + * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. + * @return $this Fluent Builder + */ + public function setCategory(string $category): self + { + $this->options['category'] = $category; + return $this; + } + + /** + * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. + * + * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. + * + * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. + * + * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. + * @return $this Fluent Builder + */ + public function setIncludeSubaccounts(bool $includeSubaccounts): self + { + $this->options['includeSubaccounts'] = $includeSubaccounts; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadAllTimeOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimePage.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimePage.php new file mode 100755 index 0000000..b4888b2 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/AllTimePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AllTimeInstance \Twilio\Rest\Api\V2010\Account\Usage\Record\AllTimeInstance + */ + public function buildInstance(array $payload): AllTimeInstance + { + return new AllTimeInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AllTimePage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyInstance.php new file mode 100755 index 0000000..33ee0b6 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyInstance.php @@ -0,0 +1,110 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'asOf' => Values::array_get($payload, 'as_of'), + 'category' => Values::array_get($payload, 'category'), + 'count' => Values::array_get($payload, 'count'), + 'countUnit' => Values::array_get($payload, 'count_unit'), + 'description' => Values::array_get($payload, 'description'), + 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), + 'price' => Values::array_get($payload, 'price'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), + 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), + 'uri' => Values::array_get($payload, 'uri'), + 'usage' => Values::array_get($payload, 'usage'), + 'usageUnit' => Values::array_get($payload, 'usage_unit'), + ]; + + $this->solution = ['accountSid' => $accountSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.DailyInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyList.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyList.php new file mode 100755 index 0000000..9bde082 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyList.php @@ -0,0 +1,165 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Usage/Records/Daily.json'; + } + + /** + * Reads DailyInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return DailyInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams DailyInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of DailyInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return DailyPage Page of DailyInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): DailyPage + { + $options = new Values($options); + + $params = Values::of([ + 'Category' => + $options['category'], + 'StartDate' => + Serialize::iso8601Date($options['startDate']), + 'EndDate' => + Serialize::iso8601Date($options['endDate']), + 'IncludeSubaccounts' => + Serialize::booleanToString($options['includeSubaccounts']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new DailyPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of DailyInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return DailyPage Page of DailyInstance + */ + public function getPage(string $targetUrl): DailyPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new DailyPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.DailyList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyOptions.php new file mode 100755 index 0000000..cc0d8d6 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyOptions.php @@ -0,0 +1,130 @@ +options['category'] = $category; + $this->options['startDate'] = $startDate; + $this->options['endDate'] = $endDate; + $this->options['includeSubaccounts'] = $includeSubaccounts; + } + + /** + * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. + * + * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. + * @return $this Fluent Builder + */ + public function setCategory(string $category): self + { + $this->options['category'] = $category; + return $this; + } + + /** + * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. + * + * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. + * + * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. + * + * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. + * @return $this Fluent Builder + */ + public function setIncludeSubaccounts(bool $includeSubaccounts): self + { + $this->options['includeSubaccounts'] = $includeSubaccounts; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadDailyOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyPage.php new file mode 100755 index 0000000..a400572 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/DailyPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DailyInstance \Twilio\Rest\Api\V2010\Account\Usage\Record\DailyInstance + */ + public function buildInstance(array $payload): DailyInstance + { + return new DailyInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.DailyPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthInstance.php new file mode 100755 index 0000000..f5c1c26 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthInstance.php @@ -0,0 +1,110 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'asOf' => Values::array_get($payload, 'as_of'), + 'category' => Values::array_get($payload, 'category'), + 'count' => Values::array_get($payload, 'count'), + 'countUnit' => Values::array_get($payload, 'count_unit'), + 'description' => Values::array_get($payload, 'description'), + 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), + 'price' => Values::array_get($payload, 'price'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), + 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), + 'uri' => Values::array_get($payload, 'uri'), + 'usage' => Values::array_get($payload, 'usage'), + 'usageUnit' => Values::array_get($payload, 'usage_unit'), + ]; + + $this->solution = ['accountSid' => $accountSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.LastMonthInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthList.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthList.php new file mode 100755 index 0000000..49a9f61 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthList.php @@ -0,0 +1,165 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Usage/Records/LastMonth.json'; + } + + /** + * Reads LastMonthInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return LastMonthInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams LastMonthInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of LastMonthInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return LastMonthPage Page of LastMonthInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): LastMonthPage + { + $options = new Values($options); + + $params = Values::of([ + 'Category' => + $options['category'], + 'StartDate' => + Serialize::iso8601Date($options['startDate']), + 'EndDate' => + Serialize::iso8601Date($options['endDate']), + 'IncludeSubaccounts' => + Serialize::booleanToString($options['includeSubaccounts']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new LastMonthPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of LastMonthInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return LastMonthPage Page of LastMonthInstance + */ + public function getPage(string $targetUrl): LastMonthPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new LastMonthPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.LastMonthList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthOptions.php new file mode 100755 index 0000000..c014b4a --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthOptions.php @@ -0,0 +1,130 @@ +options['category'] = $category; + $this->options['startDate'] = $startDate; + $this->options['endDate'] = $endDate; + $this->options['includeSubaccounts'] = $includeSubaccounts; + } + + /** + * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. + * + * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. + * @return $this Fluent Builder + */ + public function setCategory(string $category): self + { + $this->options['category'] = $category; + return $this; + } + + /** + * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. + * + * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. + * + * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. + * + * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. + * @return $this Fluent Builder + */ + public function setIncludeSubaccounts(bool $includeSubaccounts): self + { + $this->options['includeSubaccounts'] = $includeSubaccounts; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadLastMonthOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthPage.php new file mode 100755 index 0000000..b32dd94 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/LastMonthPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return LastMonthInstance \Twilio\Rest\Api\V2010\Account\Usage\Record\LastMonthInstance + */ + public function buildInstance(array $payload): LastMonthInstance + { + return new LastMonthInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.LastMonthPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyInstance.php new file mode 100755 index 0000000..8c5b742 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyInstance.php @@ -0,0 +1,110 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'asOf' => Values::array_get($payload, 'as_of'), + 'category' => Values::array_get($payload, 'category'), + 'count' => Values::array_get($payload, 'count'), + 'countUnit' => Values::array_get($payload, 'count_unit'), + 'description' => Values::array_get($payload, 'description'), + 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), + 'price' => Values::array_get($payload, 'price'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), + 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), + 'uri' => Values::array_get($payload, 'uri'), + 'usage' => Values::array_get($payload, 'usage'), + 'usageUnit' => Values::array_get($payload, 'usage_unit'), + ]; + + $this->solution = ['accountSid' => $accountSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.MonthlyInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyList.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyList.php new file mode 100755 index 0000000..0cef114 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyList.php @@ -0,0 +1,165 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Usage/Records/Monthly.json'; + } + + /** + * Reads MonthlyInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return MonthlyInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams MonthlyInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of MonthlyInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return MonthlyPage Page of MonthlyInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MonthlyPage + { + $options = new Values($options); + + $params = Values::of([ + 'Category' => + $options['category'], + 'StartDate' => + Serialize::iso8601Date($options['startDate']), + 'EndDate' => + Serialize::iso8601Date($options['endDate']), + 'IncludeSubaccounts' => + Serialize::booleanToString($options['includeSubaccounts']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new MonthlyPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of MonthlyInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return MonthlyPage Page of MonthlyInstance + */ + public function getPage(string $targetUrl): MonthlyPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new MonthlyPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.MonthlyList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyOptions.php new file mode 100755 index 0000000..4fa256d --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyOptions.php @@ -0,0 +1,130 @@ +options['category'] = $category; + $this->options['startDate'] = $startDate; + $this->options['endDate'] = $endDate; + $this->options['includeSubaccounts'] = $includeSubaccounts; + } + + /** + * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. + * + * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. + * @return $this Fluent Builder + */ + public function setCategory(string $category): self + { + $this->options['category'] = $category; + return $this; + } + + /** + * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. + * + * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. + * + * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. + * + * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. + * @return $this Fluent Builder + */ + public function setIncludeSubaccounts(bool $includeSubaccounts): self + { + $this->options['includeSubaccounts'] = $includeSubaccounts; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadMonthlyOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyPage.php new file mode 100755 index 0000000..9b48474 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/MonthlyPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MonthlyInstance \Twilio\Rest\Api\V2010\Account\Usage\Record\MonthlyInstance + */ + public function buildInstance(array $payload): MonthlyInstance + { + return new MonthlyInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.MonthlyPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthInstance.php new file mode 100755 index 0000000..5e3a501 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthInstance.php @@ -0,0 +1,110 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'asOf' => Values::array_get($payload, 'as_of'), + 'category' => Values::array_get($payload, 'category'), + 'count' => Values::array_get($payload, 'count'), + 'countUnit' => Values::array_get($payload, 'count_unit'), + 'description' => Values::array_get($payload, 'description'), + 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), + 'price' => Values::array_get($payload, 'price'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), + 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), + 'uri' => Values::array_get($payload, 'uri'), + 'usage' => Values::array_get($payload, 'usage'), + 'usageUnit' => Values::array_get($payload, 'usage_unit'), + ]; + + $this->solution = ['accountSid' => $accountSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.ThisMonthInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthList.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthList.php new file mode 100755 index 0000000..5b96e65 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthList.php @@ -0,0 +1,165 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Usage/Records/ThisMonth.json'; + } + + /** + * Reads ThisMonthInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ThisMonthInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams ThisMonthInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ThisMonthInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ThisMonthPage Page of ThisMonthInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ThisMonthPage + { + $options = new Values($options); + + $params = Values::of([ + 'Category' => + $options['category'], + 'StartDate' => + Serialize::iso8601Date($options['startDate']), + 'EndDate' => + Serialize::iso8601Date($options['endDate']), + 'IncludeSubaccounts' => + Serialize::booleanToString($options['includeSubaccounts']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ThisMonthPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ThisMonthInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ThisMonthPage Page of ThisMonthInstance + */ + public function getPage(string $targetUrl): ThisMonthPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ThisMonthPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.ThisMonthList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthOptions.php new file mode 100755 index 0000000..2d60fc0 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthOptions.php @@ -0,0 +1,130 @@ +options['category'] = $category; + $this->options['startDate'] = $startDate; + $this->options['endDate'] = $endDate; + $this->options['includeSubaccounts'] = $includeSubaccounts; + } + + /** + * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. + * + * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. + * @return $this Fluent Builder + */ + public function setCategory(string $category): self + { + $this->options['category'] = $category; + return $this; + } + + /** + * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. + * + * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. + * + * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. + * + * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. + * @return $this Fluent Builder + */ + public function setIncludeSubaccounts(bool $includeSubaccounts): self + { + $this->options['includeSubaccounts'] = $includeSubaccounts; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadThisMonthOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthPage.php new file mode 100755 index 0000000..ec84c9f --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/ThisMonthPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ThisMonthInstance \Twilio\Rest\Api\V2010\Account\Usage\Record\ThisMonthInstance + */ + public function buildInstance(array $payload): ThisMonthInstance + { + return new ThisMonthInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.ThisMonthPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayInstance.php new file mode 100755 index 0000000..3201646 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayInstance.php @@ -0,0 +1,110 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'asOf' => Values::array_get($payload, 'as_of'), + 'category' => Values::array_get($payload, 'category'), + 'count' => Values::array_get($payload, 'count'), + 'countUnit' => Values::array_get($payload, 'count_unit'), + 'description' => Values::array_get($payload, 'description'), + 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), + 'price' => Values::array_get($payload, 'price'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), + 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), + 'uri' => Values::array_get($payload, 'uri'), + 'usage' => Values::array_get($payload, 'usage'), + 'usageUnit' => Values::array_get($payload, 'usage_unit'), + ]; + + $this->solution = ['accountSid' => $accountSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.TodayInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayList.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayList.php new file mode 100755 index 0000000..e228d6c --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayList.php @@ -0,0 +1,165 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Usage/Records/Today.json'; + } + + /** + * Reads TodayInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return TodayInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams TodayInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of TodayInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return TodayPage Page of TodayInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): TodayPage + { + $options = new Values($options); + + $params = Values::of([ + 'Category' => + $options['category'], + 'StartDate' => + Serialize::iso8601Date($options['startDate']), + 'EndDate' => + Serialize::iso8601Date($options['endDate']), + 'IncludeSubaccounts' => + Serialize::booleanToString($options['includeSubaccounts']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new TodayPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of TodayInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return TodayPage Page of TodayInstance + */ + public function getPage(string $targetUrl): TodayPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new TodayPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.TodayList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayOptions.php new file mode 100755 index 0000000..8948c33 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayOptions.php @@ -0,0 +1,130 @@ +options['category'] = $category; + $this->options['startDate'] = $startDate; + $this->options['endDate'] = $endDate; + $this->options['includeSubaccounts'] = $includeSubaccounts; + } + + /** + * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. + * + * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. + * @return $this Fluent Builder + */ + public function setCategory(string $category): self + { + $this->options['category'] = $category; + return $this; + } + + /** + * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. + * + * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. + * + * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. + * + * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. + * @return $this Fluent Builder + */ + public function setIncludeSubaccounts(bool $includeSubaccounts): self + { + $this->options['includeSubaccounts'] = $includeSubaccounts; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadTodayOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayPage.php new file mode 100755 index 0000000..f242499 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/TodayPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TodayInstance \Twilio\Rest\Api\V2010\Account\Usage\Record\TodayInstance + */ + public function buildInstance(array $payload): TodayInstance + { + return new TodayInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.TodayPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyInstance.php new file mode 100755 index 0000000..dc1e34e --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyInstance.php @@ -0,0 +1,110 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'asOf' => Values::array_get($payload, 'as_of'), + 'category' => Values::array_get($payload, 'category'), + 'count' => Values::array_get($payload, 'count'), + 'countUnit' => Values::array_get($payload, 'count_unit'), + 'description' => Values::array_get($payload, 'description'), + 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), + 'price' => Values::array_get($payload, 'price'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), + 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), + 'uri' => Values::array_get($payload, 'uri'), + 'usage' => Values::array_get($payload, 'usage'), + 'usageUnit' => Values::array_get($payload, 'usage_unit'), + ]; + + $this->solution = ['accountSid' => $accountSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.YearlyInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyList.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyList.php new file mode 100755 index 0000000..d79b627 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyList.php @@ -0,0 +1,165 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Usage/Records/Yearly.json'; + } + + /** + * Reads YearlyInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return YearlyInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams YearlyInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of YearlyInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return YearlyPage Page of YearlyInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): YearlyPage + { + $options = new Values($options); + + $params = Values::of([ + 'Category' => + $options['category'], + 'StartDate' => + Serialize::iso8601Date($options['startDate']), + 'EndDate' => + Serialize::iso8601Date($options['endDate']), + 'IncludeSubaccounts' => + Serialize::booleanToString($options['includeSubaccounts']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new YearlyPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of YearlyInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return YearlyPage Page of YearlyInstance + */ + public function getPage(string $targetUrl): YearlyPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new YearlyPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.YearlyList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyOptions.php new file mode 100755 index 0000000..4867d81 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyOptions.php @@ -0,0 +1,130 @@ +options['category'] = $category; + $this->options['startDate'] = $startDate; + $this->options['endDate'] = $endDate; + $this->options['includeSubaccounts'] = $includeSubaccounts; + } + + /** + * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. + * + * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. + * @return $this Fluent Builder + */ + public function setCategory(string $category): self + { + $this->options['category'] = $category; + return $this; + } + + /** + * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. + * + * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. + * + * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. + * + * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. + * @return $this Fluent Builder + */ + public function setIncludeSubaccounts(bool $includeSubaccounts): self + { + $this->options['includeSubaccounts'] = $includeSubaccounts; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadYearlyOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyPage.php new file mode 100755 index 0000000..cb084b9 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/YearlyPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return YearlyInstance \Twilio\Rest\Api\V2010\Account\Usage\Record\YearlyInstance + */ + public function buildInstance(array $payload): YearlyInstance + { + return new YearlyInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.YearlyPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayInstance.php new file mode 100755 index 0000000..54bfab2 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayInstance.php @@ -0,0 +1,110 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'asOf' => Values::array_get($payload, 'as_of'), + 'category' => Values::array_get($payload, 'category'), + 'count' => Values::array_get($payload, 'count'), + 'countUnit' => Values::array_get($payload, 'count_unit'), + 'description' => Values::array_get($payload, 'description'), + 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), + 'price' => Values::array_get($payload, 'price'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), + 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), + 'uri' => Values::array_get($payload, 'uri'), + 'usage' => Values::array_get($payload, 'usage'), + 'usageUnit' => Values::array_get($payload, 'usage_unit'), + ]; + + $this->solution = ['accountSid' => $accountSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.YesterdayInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayList.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayList.php new file mode 100755 index 0000000..3565074 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayList.php @@ -0,0 +1,165 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Usage/Records/Yesterday.json'; + } + + /** + * Reads YesterdayInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return YesterdayInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams YesterdayInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of YesterdayInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return YesterdayPage Page of YesterdayInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): YesterdayPage + { + $options = new Values($options); + + $params = Values::of([ + 'Category' => + $options['category'], + 'StartDate' => + Serialize::iso8601Date($options['startDate']), + 'EndDate' => + Serialize::iso8601Date($options['endDate']), + 'IncludeSubaccounts' => + Serialize::booleanToString($options['includeSubaccounts']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new YesterdayPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of YesterdayInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return YesterdayPage Page of YesterdayInstance + */ + public function getPage(string $targetUrl): YesterdayPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new YesterdayPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.YesterdayList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayOptions.php new file mode 100755 index 0000000..fd3a3f6 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayOptions.php @@ -0,0 +1,130 @@ +options['category'] = $category; + $this->options['startDate'] = $startDate; + $this->options['endDate'] = $endDate; + $this->options['includeSubaccounts'] = $includeSubaccounts; + } + + /** + * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. + * + * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. + * @return $this Fluent Builder + */ + public function setCategory(string $category): self + { + $this->options['category'] = $category; + return $this; + } + + /** + * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. + * + * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. + * + * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. + * + * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. + * @return $this Fluent Builder + */ + public function setIncludeSubaccounts(bool $includeSubaccounts): self + { + $this->options['includeSubaccounts'] = $includeSubaccounts; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadYesterdayOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayPage.php new file mode 100755 index 0000000..60bc4cd --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/Record/YesterdayPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return YesterdayInstance \Twilio\Rest\Api\V2010\Account\Usage\Record\YesterdayInstance + */ + public function buildInstance(array $payload): YesterdayInstance + { + return new YesterdayInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.YesterdayPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/RecordInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/RecordInstance.php new file mode 100755 index 0000000..30a99ef --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/RecordInstance.php @@ -0,0 +1,110 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'asOf' => Values::array_get($payload, 'as_of'), + 'category' => Values::array_get($payload, 'category'), + 'count' => Values::array_get($payload, 'count'), + 'countUnit' => Values::array_get($payload, 'count_unit'), + 'description' => Values::array_get($payload, 'description'), + 'endDate' => Deserialize::dateTime(Values::array_get($payload, 'end_date')), + 'price' => Values::array_get($payload, 'price'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'startDate' => Deserialize::dateTime(Values::array_get($payload, 'start_date')), + 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), + 'uri' => Values::array_get($payload, 'uri'), + 'usage' => Values::array_get($payload, 'usage'), + 'usageUnit' => Values::array_get($payload, 'usage_unit'), + ]; + + $this->solution = ['accountSid' => $accountSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.RecordInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/RecordList.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/RecordList.php new file mode 100755 index 0000000..37e6fa1 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/RecordList.php @@ -0,0 +1,341 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Usage/Records.json'; + } + + /** + * Reads RecordInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return RecordInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams RecordInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of RecordInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return RecordPage Page of RecordInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): RecordPage + { + $options = new Values($options); + + $params = Values::of([ + 'Category' => + $options['category'], + 'StartDate' => + Serialize::iso8601Date($options['startDate']), + 'EndDate' => + Serialize::iso8601Date($options['endDate']), + 'IncludeSubaccounts' => + Serialize::booleanToString($options['includeSubaccounts']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new RecordPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of RecordInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return RecordPage Page of RecordInstance + */ + public function getPage(string $targetUrl): RecordPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new RecordPage($this->version, $response, $this->solution); + } + + + /** + * Access the lastMonth + */ + protected function getLastMonth(): LastMonthList + { + if (!$this->_lastMonth) { + $this->_lastMonth = new LastMonthList( + $this->version, + $this->solution['accountSid'] + ); + } + return $this->_lastMonth; + } + + /** + * Access the today + */ + protected function getToday(): TodayList + { + if (!$this->_today) { + $this->_today = new TodayList( + $this->version, + $this->solution['accountSid'] + ); + } + return $this->_today; + } + + /** + * Access the yearly + */ + protected function getYearly(): YearlyList + { + if (!$this->_yearly) { + $this->_yearly = new YearlyList( + $this->version, + $this->solution['accountSid'] + ); + } + return $this->_yearly; + } + + /** + * Access the thisMonth + */ + protected function getThisMonth(): ThisMonthList + { + if (!$this->_thisMonth) { + $this->_thisMonth = new ThisMonthList( + $this->version, + $this->solution['accountSid'] + ); + } + return $this->_thisMonth; + } + + /** + * Access the daily + */ + protected function getDaily(): DailyList + { + if (!$this->_daily) { + $this->_daily = new DailyList( + $this->version, + $this->solution['accountSid'] + ); + } + return $this->_daily; + } + + /** + * Access the allTime + */ + protected function getAllTime(): AllTimeList + { + if (!$this->_allTime) { + $this->_allTime = new AllTimeList( + $this->version, + $this->solution['accountSid'] + ); + } + return $this->_allTime; + } + + /** + * Access the yesterday + */ + protected function getYesterday(): YesterdayList + { + if (!$this->_yesterday) { + $this->_yesterday = new YesterdayList( + $this->version, + $this->solution['accountSid'] + ); + } + return $this->_yesterday; + } + + /** + * Access the monthly + */ + protected function getMonthly(): MonthlyList + { + if (!$this->_monthly) { + $this->_monthly = new MonthlyList( + $this->version, + $this->solution['accountSid'] + ); + } + return $this->_monthly; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name) + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.RecordList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/RecordOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/RecordOptions.php new file mode 100755 index 0000000..9ba15b3 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/RecordOptions.php @@ -0,0 +1,130 @@ +options['category'] = $category; + $this->options['startDate'] = $startDate; + $this->options['endDate'] = $endDate; + $this->options['includeSubaccounts'] = $includeSubaccounts; + } + + /** + * The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. + * + * @param string $category The [usage category](https://www.twilio.com/docs/usage/api/usage-record#usage-categories) of the UsageRecord resources to read. Only UsageRecord resources in the specified category are retrieved. + * @return $this Fluent Builder + */ + public function setCategory(string $category): self + { + $this->options['category'] = $category; + return $this; + } + + /** + * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. + * + * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `-30days`, which will set the start date to be 30 days before the current date. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. + * + * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. You can also specify offsets from the current date, such as: `+30days`, which will set the end date to 30 days from the current date. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. + * + * @param bool $includeSubaccounts Whether to include usage from the master account and all its subaccounts. Can be: `true` (the default) to include usage from the master account and all subaccounts or `false` to retrieve usage from only the specified account. + * @return $this Fluent Builder + */ + public function setIncludeSubaccounts(bool $includeSubaccounts): self + { + $this->options['includeSubaccounts'] = $includeSubaccounts; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadRecordOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/RecordPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/RecordPage.php new file mode 100755 index 0000000..5a277fa --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/RecordPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RecordInstance \Twilio\Rest\Api\V2010\Account\Usage\RecordInstance + */ + public function buildInstance(array $payload): RecordInstance + { + return new RecordInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.RecordPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/TriggerContext.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/TriggerContext.php new file mode 100755 index 0000000..2dcf201 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/TriggerContext.php @@ -0,0 +1,134 @@ +solution = [ + 'accountSid' => + $accountSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Usage/Triggers/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Delete the TriggerInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the TriggerInstance + * + * @return TriggerInstance Fetched TriggerInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TriggerInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new TriggerInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the TriggerInstance + * + * @param array|Options $options Optional Arguments + * @return TriggerInstance Updated TriggerInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TriggerInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'CallbackMethod' => + $options['callbackMethod'], + 'CallbackUrl' => + $options['callbackUrl'], + 'FriendlyName' => + $options['friendlyName'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new TriggerInstance( + $this->version, + $payload, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.TriggerContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/TriggerInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/TriggerInstance.php new file mode 100755 index 0000000..b8291c7 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/TriggerInstance.php @@ -0,0 +1,174 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'callbackMethod' => Values::array_get($payload, 'callback_method'), + 'callbackUrl' => Values::array_get($payload, 'callback_url'), + 'currentValue' => Values::array_get($payload, 'current_value'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateFired' => Deserialize::dateTime(Values::array_get($payload, 'date_fired')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'recurring' => Values::array_get($payload, 'recurring'), + 'sid' => Values::array_get($payload, 'sid'), + 'triggerBy' => Values::array_get($payload, 'trigger_by'), + 'triggerValue' => Values::array_get($payload, 'trigger_value'), + 'uri' => Values::array_get($payload, 'uri'), + 'usageCategory' => Values::array_get($payload, 'usage_category'), + 'usageRecordUri' => Values::array_get($payload, 'usage_record_uri'), + ]; + + $this->solution = ['accountSid' => $accountSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return TriggerContext Context for this TriggerInstance + */ + protected function proxy(): TriggerContext + { + if (!$this->context) { + $this->context = new TriggerContext( + $this->version, + $this->solution['accountSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the TriggerInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the TriggerInstance + * + * @return TriggerInstance Fetched TriggerInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TriggerInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the TriggerInstance + * + * @param array|Options $options Optional Arguments + * @return TriggerInstance Updated TriggerInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TriggerInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.TriggerInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/TriggerList.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/TriggerList.php new file mode 100755 index 0000000..86e7c2e --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/TriggerList.php @@ -0,0 +1,222 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/Usage/Triggers.json'; + } + + /** + * Create the TriggerInstance + * + * @param string $callbackUrl The URL we should call using `callback_method` when the trigger fires. + * @param string $triggerValue The usage value at which the trigger should fire. For convenience, you can use an offset value such as `+30` to specify a trigger_value that is 30 units more than the current usage value. Be sure to urlencode a `+` as `%2B`. + * @param string $usageCategory + * @param array|Options $options Optional Arguments + * @return TriggerInstance Created TriggerInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $callbackUrl, string $triggerValue, string $usageCategory, array $options = []): TriggerInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'CallbackUrl' => + $callbackUrl, + 'TriggerValue' => + $triggerValue, + 'UsageCategory' => + $usageCategory, + 'CallbackMethod' => + $options['callbackMethod'], + 'FriendlyName' => + $options['friendlyName'], + 'Recurring' => + $options['recurring'], + 'TriggerBy' => + $options['triggerBy'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new TriggerInstance( + $this->version, + $payload, + $this->solution['accountSid'] + ); + } + + + /** + * Reads TriggerInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return TriggerInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams TriggerInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of TriggerInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return TriggerPage Page of TriggerInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): TriggerPage + { + $options = new Values($options); + + $params = Values::of([ + 'Recurring' => + $options['recurring'], + 'TriggerBy' => + $options['triggerBy'], + 'UsageCategory' => + $options['usageCategory'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new TriggerPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of TriggerInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return TriggerPage Page of TriggerInstance + */ + public function getPage(string $targetUrl): TriggerPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new TriggerPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a TriggerContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the UsageTrigger resource to delete. + */ + public function getContext( + string $sid + + ): TriggerContext + { + return new TriggerContext( + $this->version, + $this->solution['accountSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.TriggerList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/TriggerOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/TriggerOptions.php new file mode 100755 index 0000000..a29b275 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/TriggerOptions.php @@ -0,0 +1,306 @@ +options['callbackMethod'] = $callbackMethod; + $this->options['friendlyName'] = $friendlyName; + $this->options['recurring'] = $recurring; + $this->options['triggerBy'] = $triggerBy; + } + + /** + * The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is `POST`. + * + * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is `POST`. + * @return $this Fluent Builder + */ + public function setCallbackMethod(string $callbackMethod): self + { + $this->options['callbackMethod'] = $callbackMethod; + return $this; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * @param string $recurring + * @return $this Fluent Builder + */ + public function setRecurring(string $recurring): self + { + $this->options['recurring'] = $recurring; + return $this; + } + + /** + * @param string $triggerBy + * @return $this Fluent Builder + */ + public function setTriggerBy(string $triggerBy): self + { + $this->options['triggerBy'] = $triggerBy; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateTriggerOptions ' . $options . ']'; + } +} + + + +class ReadTriggerOptions extends Options + { + /** + * @param string $recurring The frequency of recurring UsageTriggers to read. Can be: `daily`, `monthly`, or `yearly` to read recurring UsageTriggers. An empty value or a value of `alltime` reads non-recurring UsageTriggers. + * @param string $triggerBy The trigger field of the UsageTriggers to read. Can be: `count`, `usage`, or `price` as described in the [UsageRecords documentation](https://www.twilio.com/docs/usage/api/usage-record#usage-count-price). + * @param string $usageCategory The usage category of the UsageTriggers to read. Must be a supported [usage categories](https://www.twilio.com/docs/usage/api/usage-record#usage-categories). + */ + public function __construct( + + string $recurring = Values::NONE, + string $triggerBy = Values::NONE, + string $usageCategory = Values::NONE + + ) { + $this->options['recurring'] = $recurring; + $this->options['triggerBy'] = $triggerBy; + $this->options['usageCategory'] = $usageCategory; + } + + /** + * The frequency of recurring UsageTriggers to read. Can be: `daily`, `monthly`, or `yearly` to read recurring UsageTriggers. An empty value or a value of `alltime` reads non-recurring UsageTriggers. + * + * @param string $recurring The frequency of recurring UsageTriggers to read. Can be: `daily`, `monthly`, or `yearly` to read recurring UsageTriggers. An empty value or a value of `alltime` reads non-recurring UsageTriggers. + * @return $this Fluent Builder + */ + public function setRecurring(string $recurring): self + { + $this->options['recurring'] = $recurring; + return $this; + } + + /** + * The trigger field of the UsageTriggers to read. Can be: `count`, `usage`, or `price` as described in the [UsageRecords documentation](https://www.twilio.com/docs/usage/api/usage-record#usage-count-price). + * + * @param string $triggerBy The trigger field of the UsageTriggers to read. Can be: `count`, `usage`, or `price` as described in the [UsageRecords documentation](https://www.twilio.com/docs/usage/api/usage-record#usage-count-price). + * @return $this Fluent Builder + */ + public function setTriggerBy(string $triggerBy): self + { + $this->options['triggerBy'] = $triggerBy; + return $this; + } + + /** + * The usage category of the UsageTriggers to read. Must be a supported [usage categories](https://www.twilio.com/docs/usage/api/usage-record#usage-categories). + * + * @param string $usageCategory The usage category of the UsageTriggers to read. Must be a supported [usage categories](https://www.twilio.com/docs/usage/api/usage-record#usage-categories). + * @return $this Fluent Builder + */ + public function setUsageCategory(string $usageCategory): self + { + $this->options['usageCategory'] = $usageCategory; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadTriggerOptions ' . $options . ']'; + } +} + +class UpdateTriggerOptions extends Options + { + /** + * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is `POST`. + * @param string $callbackUrl The URL we should call using `callback_method` when the trigger fires. + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + */ + public function __construct( + + string $callbackMethod = Values::NONE, + string $callbackUrl = Values::NONE, + string $friendlyName = Values::NONE + + ) { + $this->options['callbackMethod'] = $callbackMethod; + $this->options['callbackUrl'] = $callbackUrl; + $this->options['friendlyName'] = $friendlyName; + } + + /** + * The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is `POST`. + * + * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is `POST`. + * @return $this Fluent Builder + */ + public function setCallbackMethod(string $callbackMethod): self + { + $this->options['callbackMethod'] = $callbackMethod; + return $this; + } + + /** + * The URL we should call using `callback_method` when the trigger fires. + * + * @param string $callbackUrl The URL we should call using `callback_method` when the trigger fires. + * @return $this Fluent Builder + */ + public function setCallbackUrl(string $callbackUrl): self + { + $this->options['callbackUrl'] = $callbackUrl; + return $this; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateTriggerOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/Usage/TriggerPage.php b/app/api/Twilio/Rest/Api/V2010/Account/Usage/TriggerPage.php new file mode 100755 index 0000000..9d26280 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/Usage/TriggerPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TriggerInstance \Twilio\Rest\Api\V2010\Account\Usage\TriggerInstance + */ + public function buildInstance(array $payload): TriggerInstance + { + return new TriggerInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.TriggerPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/UsageInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/UsageInstance.php new file mode 100755 index 0000000..764a99f --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/UsageInstance.php @@ -0,0 +1,72 @@ +solution = ['accountSid' => $accountSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.UsageInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/UsageList.php b/app/api/Twilio/Rest/Api/V2010/Account/UsageList.php new file mode 100755 index 0000000..cb7c5c0 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/UsageList.php @@ -0,0 +1,129 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + } + + /** + * Access the records + */ + protected function getRecords(): RecordList + { + if (!$this->_records) { + $this->_records = new RecordList( + $this->version, + $this->solution['accountSid'] + ); + } + return $this->_records; + } + + /** + * Access the triggers + */ + protected function getTriggers(): TriggerList + { + if (!$this->_triggers) { + $this->_triggers = new TriggerList( + $this->version, + $this->solution['accountSid'] + ); + } + return $this->_triggers; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name) + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.UsageList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/UsagePage.php b/app/api/Twilio/Rest/Api/V2010/Account/UsagePage.php new file mode 100755 index 0000000..44a32e6 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/UsagePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UsageInstance \Twilio\Rest\Api\V2010\Account\UsageInstance + */ + public function buildInstance(array $payload): UsageInstance + { + return new UsageInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.UsagePage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/ValidationRequestInstance.php b/app/api/Twilio/Rest/Api/V2010/Account/ValidationRequestInstance.php new file mode 100755 index 0000000..dbcb86f --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/ValidationRequestInstance.php @@ -0,0 +1,89 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'callSid' => Values::array_get($payload, 'call_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'phoneNumber' => Values::array_get($payload, 'phone_number'), + 'validationCode' => Values::array_get($payload, 'validation_code'), + ]; + + $this->solution = ['accountSid' => $accountSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.ValidationRequestInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/ValidationRequestList.php b/app/api/Twilio/Rest/Api/V2010/Account/ValidationRequestList.php new file mode 100755 index 0000000..8e9dde2 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/ValidationRequestList.php @@ -0,0 +1,98 @@ +solution = [ + 'accountSid' => + $accountSid, + + ]; + + $this->uri = '/Accounts/' . \rawurlencode($accountSid) + .'/OutgoingCallerIds.json'; + } + + /** + * Create the ValidationRequestInstance + * + * @param string $phoneNumber The phone number to verify in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. + * @param array|Options $options Optional Arguments + * @return ValidationRequestInstance Created ValidationRequestInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $phoneNumber, array $options = []): ValidationRequestInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'PhoneNumber' => + $phoneNumber, + 'FriendlyName' => + $options['friendlyName'], + 'CallDelay' => + $options['callDelay'], + 'Extension' => + $options['extension'], + 'StatusCallback' => + $options['statusCallback'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new ValidationRequestInstance( + $this->version, + $payload, + $this->solution['accountSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.ValidationRequestList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/Account/ValidationRequestOptions.php b/app/api/Twilio/Rest/Api/V2010/Account/ValidationRequestOptions.php new file mode 100755 index 0000000..646db22 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/ValidationRequestOptions.php @@ -0,0 +1,148 @@ +options['friendlyName'] = $friendlyName; + $this->options['callDelay'] = $callDelay; + $this->options['extension'] = $extension; + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + } + + /** + * A descriptive string that you create to describe the new caller ID resource. It can be up to 64 characters long. The default value is a formatted version of the phone number. + * + * @param string $friendlyName A descriptive string that you create to describe the new caller ID resource. It can be up to 64 characters long. The default value is a formatted version of the phone number. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The number of seconds to delay before initiating the verification call. Can be an integer between `0` and `60`, inclusive. The default is `0`. + * + * @param int $callDelay The number of seconds to delay before initiating the verification call. Can be an integer between `0` and `60`, inclusive. The default is `0`. + * @return $this Fluent Builder + */ + public function setCallDelay(int $callDelay): self + { + $this->options['callDelay'] = $callDelay; + return $this; + } + + /** + * The digits to dial after connecting the verification call. + * + * @param string $extension The digits to dial after connecting the verification call. + * @return $this Fluent Builder + */ + public function setExtension(string $extension): self + { + $this->options['extension'] = $extension; + return $this; + } + + /** + * The URL we should call using the `status_callback_method` to send status information about the verification process to your application. + * + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information about the verification process to your application. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`, and the default is `POST`. + * + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `GET` or `POST`, and the default is `POST`. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateValidationRequestOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/Account/ValidationRequestPage.php b/app/api/Twilio/Rest/Api/V2010/Account/ValidationRequestPage.php new file mode 100755 index 0000000..18d8053 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/Account/ValidationRequestPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ValidationRequestInstance \Twilio\Rest\Api\V2010\Account\ValidationRequestInstance + */ + public function buildInstance(array $payload): ValidationRequestInstance + { + return new ValidationRequestInstance($this->version, $payload, $this->solution['accountSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.ValidationRequestPage]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/AccountContext.php b/app/api/Twilio/Rest/Api/V2010/AccountContext.php new file mode 100755 index 0000000..14df4b6 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/AccountContext.php @@ -0,0 +1,600 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Accounts/' . \rawurlencode($sid) + .'.json'; + } + + /** + * Fetch the AccountInstance + * + * @return AccountInstance Fetched AccountInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AccountInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new AccountInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the AccountInstance + * + * @param array|Options $options Optional Arguments + * @return AccountInstance Updated AccountInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): AccountInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'Status' => + $options['status'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new AccountInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the recordings + */ + protected function getRecordings(): RecordingList + { + if (!$this->_recordings) { + $this->_recordings = new RecordingList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_recordings; + } + + /** + * Access the usage + */ + protected function getUsage(): UsageList + { + if (!$this->_usage) { + $this->_usage = new UsageList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_usage; + } + + /** + * Access the messages + */ + protected function getMessages(): MessageList + { + if (!$this->_messages) { + $this->_messages = new MessageList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_messages; + } + + /** + * Access the keys + */ + protected function getKeys(): KeyList + { + if (!$this->_keys) { + $this->_keys = new KeyList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_keys; + } + + /** + * Access the newKeys + */ + protected function getNewKeys(): NewKeyList + { + if (!$this->_newKeys) { + $this->_newKeys = new NewKeyList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_newKeys; + } + + /** + * Access the applications + */ + protected function getApplications(): ApplicationList + { + if (!$this->_applications) { + $this->_applications = new ApplicationList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_applications; + } + + /** + * Access the incomingPhoneNumbers + */ + protected function getIncomingPhoneNumbers(): IncomingPhoneNumberList + { + if (!$this->_incomingPhoneNumbers) { + $this->_incomingPhoneNumbers = new IncomingPhoneNumberList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_incomingPhoneNumbers; + } + + /** + * Access the conferences + */ + protected function getConferences(): ConferenceList + { + if (!$this->_conferences) { + $this->_conferences = new ConferenceList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_conferences; + } + + /** + * Access the calls + */ + protected function getCalls(): CallList + { + if (!$this->_calls) { + $this->_calls = new CallList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_calls; + } + + /** + * Access the outgoingCallerIds + */ + protected function getOutgoingCallerIds(): OutgoingCallerIdList + { + if (!$this->_outgoingCallerIds) { + $this->_outgoingCallerIds = new OutgoingCallerIdList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_outgoingCallerIds; + } + + /** + * Access the validationRequests + */ + protected function getValidationRequests(): ValidationRequestList + { + if (!$this->_validationRequests) { + $this->_validationRequests = new ValidationRequestList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_validationRequests; + } + + /** + * Access the transcriptions + */ + protected function getTranscriptions(): TranscriptionList + { + if (!$this->_transcriptions) { + $this->_transcriptions = new TranscriptionList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_transcriptions; + } + + /** + * Access the connectApps + */ + protected function getConnectApps(): ConnectAppList + { + if (!$this->_connectApps) { + $this->_connectApps = new ConnectAppList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_connectApps; + } + + /** + * Access the authorizedConnectApps + */ + protected function getAuthorizedConnectApps(): AuthorizedConnectAppList + { + if (!$this->_authorizedConnectApps) { + $this->_authorizedConnectApps = new AuthorizedConnectAppList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_authorizedConnectApps; + } + + /** + * Access the tokens + */ + protected function getTokens(): TokenList + { + if (!$this->_tokens) { + $this->_tokens = new TokenList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_tokens; + } + + /** + * Access the balance + */ + protected function getBalance(): BalanceList + { + if (!$this->_balance) { + $this->_balance = new BalanceList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_balance; + } + + /** + * Access the sip + */ + protected function getSip(): SipList + { + if (!$this->_sip) { + $this->_sip = new SipList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_sip; + } + + /** + * Access the notifications + */ + protected function getNotifications(): NotificationList + { + if (!$this->_notifications) { + $this->_notifications = new NotificationList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_notifications; + } + + /** + * Access the availablePhoneNumbers + */ + protected function getAvailablePhoneNumbers(): AvailablePhoneNumberCountryList + { + if (!$this->_availablePhoneNumbers) { + $this->_availablePhoneNumbers = new AvailablePhoneNumberCountryList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_availablePhoneNumbers; + } + + /** + * Access the addresses + */ + protected function getAddresses(): AddressList + { + if (!$this->_addresses) { + $this->_addresses = new AddressList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_addresses; + } + + /** + * Access the queues + */ + protected function getQueues(): QueueList + { + if (!$this->_queues) { + $this->_queues = new QueueList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_queues; + } + + /** + * Access the shortCodes + */ + protected function getShortCodes(): ShortCodeList + { + if (!$this->_shortCodes) { + $this->_shortCodes = new ShortCodeList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_shortCodes; + } + + /** + * Access the signingKeys + */ + protected function getSigningKeys(): SigningKeyList + { + if (!$this->_signingKeys) { + $this->_signingKeys = new SigningKeyList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_signingKeys; + } + + /** + * Access the newSigningKeys + */ + protected function getNewSigningKeys(): NewSigningKeyList + { + if (!$this->_newSigningKeys) { + $this->_newSigningKeys = new NewSigningKeyList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_newSigningKeys; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AccountContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/AccountInstance.php b/app/api/Twilio/Rest/Api/V2010/AccountInstance.php new file mode 100755 index 0000000..61fb912 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/AccountInstance.php @@ -0,0 +1,389 @@ +properties = [ + 'authToken' => Values::array_get($payload, 'auth_token'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'ownerAccountSid' => Values::array_get($payload, 'owner_account_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'status' => Values::array_get($payload, 'status'), + 'subresourceUris' => Values::array_get($payload, 'subresource_uris'), + 'type' => Values::array_get($payload, 'type'), + 'uri' => Values::array_get($payload, 'uri'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AccountContext Context for this AccountInstance + */ + protected function proxy(): AccountContext + { + if (!$this->context) { + $this->context = new AccountContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the AccountInstance + * + * @return AccountInstance Fetched AccountInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AccountInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the AccountInstance + * + * @param array|Options $options Optional Arguments + * @return AccountInstance Updated AccountInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): AccountInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the recordings + */ + protected function getRecordings(): RecordingList + { + return $this->proxy()->recordings; + } + + /** + * Access the usage + */ + protected function getUsage(): UsageList + { + return $this->proxy()->usage; + } + + /** + * Access the messages + */ + protected function getMessages(): MessageList + { + return $this->proxy()->messages; + } + + /** + * Access the keys + */ + protected function getKeys(): KeyList + { + return $this->proxy()->keys; + } + + /** + * Access the newKeys + */ + protected function getNewKeys(): NewKeyList + { + return $this->proxy()->newKeys; + } + + /** + * Access the applications + */ + protected function getApplications(): ApplicationList + { + return $this->proxy()->applications; + } + + /** + * Access the incomingPhoneNumbers + */ + protected function getIncomingPhoneNumbers(): IncomingPhoneNumberList + { + return $this->proxy()->incomingPhoneNumbers; + } + + /** + * Access the conferences + */ + protected function getConferences(): ConferenceList + { + return $this->proxy()->conferences; + } + + /** + * Access the calls + */ + protected function getCalls(): CallList + { + return $this->proxy()->calls; + } + + /** + * Access the outgoingCallerIds + */ + protected function getOutgoingCallerIds(): OutgoingCallerIdList + { + return $this->proxy()->outgoingCallerIds; + } + + /** + * Access the validationRequests + */ + protected function getValidationRequests(): ValidationRequestList + { + return $this->proxy()->validationRequests; + } + + /** + * Access the transcriptions + */ + protected function getTranscriptions(): TranscriptionList + { + return $this->proxy()->transcriptions; + } + + /** + * Access the connectApps + */ + protected function getConnectApps(): ConnectAppList + { + return $this->proxy()->connectApps; + } + + /** + * Access the authorizedConnectApps + */ + protected function getAuthorizedConnectApps(): AuthorizedConnectAppList + { + return $this->proxy()->authorizedConnectApps; + } + + /** + * Access the tokens + */ + protected function getTokens(): TokenList + { + return $this->proxy()->tokens; + } + + /** + * Access the balance + */ + protected function getBalance(): BalanceList + { + return $this->proxy()->balance; + } + + /** + * Access the sip + */ + protected function getSip(): SipList + { + return $this->proxy()->sip; + } + + /** + * Access the notifications + */ + protected function getNotifications(): NotificationList + { + return $this->proxy()->notifications; + } + + /** + * Access the availablePhoneNumbers + */ + protected function getAvailablePhoneNumbers(): AvailablePhoneNumberCountryList + { + return $this->proxy()->availablePhoneNumbers; + } + + /** + * Access the addresses + */ + protected function getAddresses(): AddressList + { + return $this->proxy()->addresses; + } + + /** + * Access the queues + */ + protected function getQueues(): QueueList + { + return $this->proxy()->queues; + } + + /** + * Access the shortCodes + */ + protected function getShortCodes(): ShortCodeList + { + return $this->proxy()->shortCodes; + } + + /** + * Access the signingKeys + */ + protected function getSigningKeys(): SigningKeyList + { + return $this->proxy()->signingKeys; + } + + /** + * Access the newSigningKeys + */ + protected function getNewSigningKeys(): NewSigningKeyList + { + return $this->proxy()->newSigningKeys; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Api.V2010.AccountInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/AccountList.php b/app/api/Twilio/Rest/Api/V2010/AccountList.php new file mode 100755 index 0000000..7ec16fe --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/AccountList.php @@ -0,0 +1,197 @@ +solution = [ + ]; + + $this->uri = '/Accounts.json'; + } + + /** + * Create the AccountInstance + * + * @param array|Options $options Optional Arguments + * @return AccountInstance Created AccountInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): AccountInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new AccountInstance( + $this->version, + $payload + ); + } + + + /** + * Reads AccountInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return AccountInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams AccountInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AccountInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return AccountPage Page of AccountInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AccountPage + { + $options = new Values($options); + + $params = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'Status' => + $options['status'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new AccountPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of AccountInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return AccountPage Page of AccountInstance + */ + public function getPage(string $targetUrl): AccountPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AccountPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AccountContext + * + * @param string $sid The Account Sid that uniquely identifies the account to fetch + */ + public function getContext( + string $sid + + ): AccountContext + { + return new AccountContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AccountList]'; + } +} diff --git a/app/api/Twilio/Rest/Api/V2010/AccountOptions.php b/app/api/Twilio/Rest/Api/V2010/AccountOptions.php new file mode 100755 index 0000000..3a0e732 --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/AccountOptions.php @@ -0,0 +1,216 @@ +options['friendlyName'] = $friendlyName; + } + + /** + * A human readable description of the account to create, defaults to `SubAccount Created at {YYYY-MM-DD HH:MM meridian}` + * + * @param string $friendlyName A human readable description of the account to create, defaults to `SubAccount Created at {YYYY-MM-DD HH:MM meridian}` + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.CreateAccountOptions ' . $options . ']'; + } +} + + +class ReadAccountOptions extends Options + { + /** + * @param string $friendlyName Only return the Account resources with friendly names that exactly match this name. + * @param string $status Only return Account resources with the given status. Can be `closed`, `suspended` or `active`. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $status = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['status'] = $status; + } + + /** + * Only return the Account resources with friendly names that exactly match this name. + * + * @param string $friendlyName Only return the Account resources with friendly names that exactly match this name. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Only return Account resources with the given status. Can be `closed`, `suspended` or `active`. + * + * @param string $status Only return Account resources with the given status. Can be `closed`, `suspended` or `active`. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.ReadAccountOptions ' . $options . ']'; + } +} + +class UpdateAccountOptions extends Options + { + /** + * @param string $friendlyName Update the human-readable description of this Account + * @param string $status + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $status = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['status'] = $status; + } + + /** + * Update the human-readable description of this Account + * + * @param string $friendlyName Update the human-readable description of this Account + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Api.V2010.UpdateAccountOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Api/V2010/AccountPage.php b/app/api/Twilio/Rest/Api/V2010/AccountPage.php new file mode 100755 index 0000000..d32da9f --- /dev/null +++ b/app/api/Twilio/Rest/Api/V2010/AccountPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AccountInstance \Twilio\Rest\Api\V2010\AccountInstance + */ + public function buildInstance(array $payload): AccountInstance + { + return new AccountInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Api.V2010.AccountPage]'; + } +} diff --git a/app/api/Twilio/Rest/ApiBase.php b/app/api/Twilio/Rest/ApiBase.php new file mode 100755 index 0000000..a71839c --- /dev/null +++ b/app/api/Twilio/Rest/ApiBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://api.twilio.com'; + } + + + /** + * @return V2010 Version v2010 of api + */ + protected function getV2010(): V2010 { + if (!$this->_v2010) { + $this->_v2010 = new V2010($this); + } + return $this->_v2010; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Api]'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot.php b/app/api/Twilio/Rest/Autopilot.php new file mode 100755 index 0000000..1703075 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot.php @@ -0,0 +1,32 @@ +assistants instead. + */ + protected function getAssistants(): \Twilio\Rest\Autopilot\V1\AssistantList { + echo "assistants is deprecated. Use v1->assistants instead."; + return $this->v1->assistants; + } + + /** + * @deprecated Use v1->assistants(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextAssistants(string $sid): \Twilio\Rest\Autopilot\V1\AssistantContext { + echo "assistants(\$sid) is deprecated. Use v1->assistants(\$sid) instead."; + return $this->v1->assistants($sid); + } + + /** + * @deprecated Use v1->restoreAssistant instead + */ + protected function getRestoreAssistant(): \Twilio\Rest\Autopilot\V1\RestoreAssistantList { + echo "restoreAssistant is deprecated. Use v1->restoreAssistant instead."; + return $this->v1->restoreAssistant; + } +} \ No newline at end of file diff --git a/app/api/Twilio/Rest/Autopilot/V1.php b/app/api/Twilio/Rest/Autopilot/V1.php new file mode 100755 index 0000000..c2d7668 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1.php @@ -0,0 +1,106 @@ +version = 'v1'; + } + + protected function getAssistants(): AssistantList + { + if (!$this->_assistants) { + $this->_assistants = new AssistantList($this); + } + return $this->_assistants; + } + + protected function getRestoreAssistant(): RestoreAssistantList + { + if (!$this->_restoreAssistant) { + $this->_restoreAssistant = new RestoreAssistantList($this); + } + return $this->_restoreAssistant; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Autopilot.V1]'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/DefaultsContext.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/DefaultsContext.php new file mode 100755 index 0000000..0f3fb5d --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/DefaultsContext.php @@ -0,0 +1,111 @@ +solution = [ + 'assistantSid' => + $assistantSid, + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/Defaults'; + } + + /** + * Fetch the DefaultsInstance + * + * @return DefaultsInstance Fetched DefaultsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DefaultsInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new DefaultsInstance( + $this->version, + $payload, + $this->solution['assistantSid'] + ); + } + + + /** + * Update the DefaultsInstance + * + * @param array|Options $options Optional Arguments + * @return DefaultsInstance Updated DefaultsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): DefaultsInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Defaults' => + Serialize::jsonObject($options['defaults']), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new DefaultsInstance( + $this->version, + $payload, + $this->solution['assistantSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Autopilot.V1.DefaultsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/DefaultsInstance.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/DefaultsInstance.php new file mode 100755 index 0000000..98c0708 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/DefaultsInstance.php @@ -0,0 +1,135 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'assistantSid' => Values::array_get($payload, 'assistant_sid'), + 'url' => Values::array_get($payload, 'url'), + 'data' => Values::array_get($payload, 'data'), + ]; + + $this->solution = ['assistantSid' => $assistantSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return DefaultsContext Context for this DefaultsInstance + */ + protected function proxy(): DefaultsContext + { + if (!$this->context) { + $this->context = new DefaultsContext( + $this->version, + $this->solution['assistantSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the DefaultsInstance + * + * @return DefaultsInstance Fetched DefaultsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DefaultsInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the DefaultsInstance + * + * @param array|Options $options Optional Arguments + * @return DefaultsInstance Updated DefaultsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): DefaultsInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Autopilot.V1.DefaultsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/DefaultsList.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/DefaultsList.php new file mode 100755 index 0000000..5447b17 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/DefaultsList.php @@ -0,0 +1,67 @@ +solution = [ + 'assistantSid' => + $assistantSid, + + ]; + } + + /** + * Constructs a DefaultsContext + */ + public function getContext( + + ): DefaultsContext + { + return new DefaultsContext( + $this->version, + $this->solution['assistantSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Autopilot.V1.DefaultsList]'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/DefaultsOptions.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/DefaultsOptions.php new file mode 100755 index 0000000..65b265a --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/DefaultsOptions.php @@ -0,0 +1,78 @@ +options['defaults'] = $defaults; + } + + /** + * A JSON string that describes the default task links for the `assistant_initiation`, `collect`, and `fallback` situations. + * + * @param array $defaults A JSON string that describes the default task links for the `assistant_initiation`, `collect`, and `fallback` situations. + * @return $this Fluent Builder + */ + public function setDefaults(array $defaults): self + { + $this->options['defaults'] = $defaults; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Autopilot.V1.UpdateDefaultsOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/DefaultsPage.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/DefaultsPage.php new file mode 100755 index 0000000..a4e4124 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/DefaultsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DefaultsInstance \Twilio\Rest\Autopilot\V1\Assistant\DefaultsInstance + */ + public function buildInstance(array $payload): DefaultsInstance + { + return new DefaultsInstance($this->version, $payload, $this->solution['assistantSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Autopilot.V1.DefaultsPage]'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/DialogueContext.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/DialogueContext.php new file mode 100755 index 0000000..044a851 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/DialogueContext.php @@ -0,0 +1,87 @@ +solution = [ + 'assistantSid' => + $assistantSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/Dialogues/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the DialogueInstance + * + * @return DialogueInstance Fetched DialogueInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DialogueInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new DialogueInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Autopilot.V1.DialogueContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/DialogueInstance.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/DialogueInstance.php new file mode 100755 index 0000000..215dd06 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/DialogueInstance.php @@ -0,0 +1,125 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'assistantSid' => Values::array_get($payload, 'assistant_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'data' => Values::array_get($payload, 'data'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['assistantSid' => $assistantSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return DialogueContext Context for this DialogueInstance + */ + protected function proxy(): DialogueContext + { + if (!$this->context) { + $this->context = new DialogueContext( + $this->version, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the DialogueInstance + * + * @return DialogueInstance Fetched DialogueInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DialogueInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Autopilot.V1.DialogueInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/DialogueList.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/DialogueList.php new file mode 100755 index 0000000..4fe4fab --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/DialogueList.php @@ -0,0 +1,71 @@ +solution = [ + 'assistantSid' => + $assistantSid, + + ]; + } + + /** + * Constructs a DialogueContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Dialogue resource to fetch. + */ + public function getContext( + string $sid + + ): DialogueContext + { + return new DialogueContext( + $this->version, + $this->solution['assistantSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Autopilot.V1.DialogueList]'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/DialoguePage.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/DialoguePage.php new file mode 100755 index 0000000..6bddc1b --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/DialoguePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DialogueInstance \Twilio\Rest\Autopilot\V1\Assistant\DialogueInstance + */ + public function buildInstance(array $payload): DialogueInstance + { + return new DialogueInstance($this->version, $payload, $this->solution['assistantSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Autopilot.V1.DialoguePage]'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/FieldType/FieldValueContext.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/FieldType/FieldValueContext.php new file mode 100755 index 0000000..3821d37 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/FieldType/FieldValueContext.php @@ -0,0 +1,106 @@ +solution = [ + 'assistantSid' => + $assistantSid, + 'fieldTypeSid' => + $fieldTypeSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/FieldTypes/' . \rawurlencode($fieldTypeSid) + .'/FieldValues/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the FieldValueInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the FieldValueInstance + * + * @return FieldValueInstance Fetched FieldValueInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FieldValueInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new FieldValueInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['fieldTypeSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Autopilot.V1.FieldValueContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/FieldType/FieldValueInstance.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/FieldType/FieldValueInstance.php new file mode 100755 index 0000000..0d81714 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/FieldType/FieldValueInstance.php @@ -0,0 +1,150 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'fieldTypeSid' => Values::array_get($payload, 'field_type_sid'), + 'language' => Values::array_get($payload, 'language'), + 'assistantSid' => Values::array_get($payload, 'assistant_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'value' => Values::array_get($payload, 'value'), + 'url' => Values::array_get($payload, 'url'), + 'synonymOf' => Values::array_get($payload, 'synonym_of'), + ]; + + $this->solution = ['assistantSid' => $assistantSid, 'fieldTypeSid' => $fieldTypeSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return FieldValueContext Context for this FieldValueInstance + */ + protected function proxy(): FieldValueContext + { + if (!$this->context) { + $this->context = new FieldValueContext( + $this->version, + $this->solution['assistantSid'], + $this->solution['fieldTypeSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the FieldValueInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the FieldValueInstance + * + * @return FieldValueInstance Fetched FieldValueInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FieldValueInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Autopilot.V1.FieldValueInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/FieldType/FieldValueList.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/FieldType/FieldValueList.php new file mode 100755 index 0000000..6999337 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/FieldType/FieldValueList.php @@ -0,0 +1,217 @@ +solution = [ + 'assistantSid' => + $assistantSid, + + 'fieldTypeSid' => + $fieldTypeSid, + + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/FieldTypes/' . \rawurlencode($fieldTypeSid) + .'/FieldValues'; + } + + /** + * Create the FieldValueInstance + * + * @param string $language The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) tag that specifies the language of the value. Currently supported tags: `en-US` + * @param string $value The Field Value data. + * @param array|Options $options Optional Arguments + * @return FieldValueInstance Created FieldValueInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $language, string $value, array $options = []): FieldValueInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Language' => + $language, + 'Value' => + $value, + 'SynonymOf' => + $options['synonymOf'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new FieldValueInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['fieldTypeSid'] + ); + } + + + /** + * Reads FieldValueInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return FieldValueInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams FieldValueInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of FieldValueInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return FieldValuePage Page of FieldValueInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): FieldValuePage + { + $options = new Values($options); + + $params = Values::of([ + 'Language' => + $options['language'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new FieldValuePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of FieldValueInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return FieldValuePage Page of FieldValueInstance + */ + public function getPage(string $targetUrl): FieldValuePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new FieldValuePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a FieldValueContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the FieldValue resource to delete. + */ + public function getContext( + string $sid + + ): FieldValueContext + { + return new FieldValueContext( + $this->version, + $this->solution['assistantSid'], + $this->solution['fieldTypeSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Autopilot.V1.FieldValueList]'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/FieldType/FieldValueOptions.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/FieldType/FieldValueOptions.php new file mode 100755 index 0000000..5e07fa3 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/FieldType/FieldValueOptions.php @@ -0,0 +1,132 @@ +options['synonymOf'] = $synonymOf; + } + + /** + * The string value that indicates which word the field value is a synonym of. + * + * @param string $synonymOf The string value that indicates which word the field value is a synonym of. + * @return $this Fluent Builder + */ + public function setSynonymOf(string $synonymOf): self + { + $this->options['synonymOf'] = $synonymOf; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Autopilot.V1.CreateFieldValueOptions ' . $options . ']'; + } +} + + + +class ReadFieldValueOptions extends Options + { + /** + * @param string $language The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) tag that specifies the language of the value. Currently supported tags: `en-US` + */ + public function __construct( + + string $language = Values::NONE + + ) { + $this->options['language'] = $language; + } + + /** + * The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) tag that specifies the language of the value. Currently supported tags: `en-US` + * + * @param string $language The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) tag that specifies the language of the value. Currently supported tags: `en-US` + * @return $this Fluent Builder + */ + public function setLanguage(string $language): self + { + $this->options['language'] = $language; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Autopilot.V1.ReadFieldValueOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/FieldType/FieldValuePage.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/FieldType/FieldValuePage.php new file mode 100755 index 0000000..672ff12 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/FieldType/FieldValuePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return FieldValueInstance \Twilio\Rest\Autopilot\V1\Assistant\FieldType\FieldValueInstance + */ + public function buildInstance(array $payload): FieldValueInstance + { + return new FieldValueInstance($this->version, $payload, $this->solution['assistantSid'], $this->solution['fieldTypeSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Autopilot.V1.FieldValuePage]'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/FieldTypeContext.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/FieldTypeContext.php new file mode 100755 index 0000000..a5178d7 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/FieldTypeContext.php @@ -0,0 +1,191 @@ +solution = [ + 'assistantSid' => + $assistantSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/FieldTypes/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the FieldTypeInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the FieldTypeInstance + * + * @return FieldTypeInstance Fetched FieldTypeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FieldTypeInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new FieldTypeInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the FieldTypeInstance + * + * @param array|Options $options Optional Arguments + * @return FieldTypeInstance Updated FieldTypeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): FieldTypeInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'UniqueName' => + $options['uniqueName'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new FieldTypeInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the fieldValues + */ + protected function getFieldValues(): FieldValueList + { + if (!$this->_fieldValues) { + $this->_fieldValues = new FieldValueList( + $this->version, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + return $this->_fieldValues; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Autopilot.V1.FieldTypeContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/FieldTypeInstance.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/FieldTypeInstance.php new file mode 100755 index 0000000..d32479b --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/FieldTypeInstance.php @@ -0,0 +1,171 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'links' => Values::array_get($payload, 'links'), + 'assistantSid' => Values::array_get($payload, 'assistant_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['assistantSid' => $assistantSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return FieldTypeContext Context for this FieldTypeInstance + */ + protected function proxy(): FieldTypeContext + { + if (!$this->context) { + $this->context = new FieldTypeContext( + $this->version, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the FieldTypeInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the FieldTypeInstance + * + * @return FieldTypeInstance Fetched FieldTypeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FieldTypeInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the FieldTypeInstance + * + * @param array|Options $options Optional Arguments + * @return FieldTypeInstance Updated FieldTypeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): FieldTypeInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the fieldValues + */ + protected function getFieldValues(): FieldValueList + { + return $this->proxy()->fieldValues; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Autopilot.V1.FieldTypeInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/FieldTypeList.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/FieldTypeList.php new file mode 100755 index 0000000..3dc5f01 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/FieldTypeList.php @@ -0,0 +1,200 @@ +solution = [ + 'assistantSid' => + $assistantSid, + + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/FieldTypes'; + } + + /** + * Create the FieldTypeInstance + * + * @param string $uniqueName An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. + * @param array|Options $options Optional Arguments + * @return FieldTypeInstance Created FieldTypeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $uniqueName, array $options = []): FieldTypeInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $uniqueName, + 'FriendlyName' => + $options['friendlyName'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new FieldTypeInstance( + $this->version, + $payload, + $this->solution['assistantSid'] + ); + } + + + /** + * Reads FieldTypeInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return FieldTypeInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams FieldTypeInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of FieldTypeInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return FieldTypePage Page of FieldTypeInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): FieldTypePage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new FieldTypePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of FieldTypeInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return FieldTypePage Page of FieldTypeInstance + */ + public function getPage(string $targetUrl): FieldTypePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new FieldTypePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a FieldTypeContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the FieldType resource to delete. + */ + public function getContext( + string $sid + + ): FieldTypeContext + { + return new FieldTypeContext( + $this->version, + $this->solution['assistantSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Autopilot.V1.FieldTypeList]'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/FieldTypeOptions.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/FieldTypeOptions.php new file mode 100755 index 0000000..315cd38 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/FieldTypeOptions.php @@ -0,0 +1,152 @@ +options['friendlyName'] = $friendlyName; + } + + /** + * A descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Autopilot.V1.CreateFieldTypeOptions ' . $options . ']'; + } +} + + + + +class UpdateFieldTypeOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $uniqueName = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['uniqueName'] = $uniqueName; + } + + /** + * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Autopilot.V1.UpdateFieldTypeOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/FieldTypePage.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/FieldTypePage.php new file mode 100755 index 0000000..cc606dd --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/FieldTypePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return FieldTypeInstance \Twilio\Rest\Autopilot\V1\Assistant\FieldTypeInstance + */ + public function buildInstance(array $payload): FieldTypeInstance + { + return new FieldTypeInstance($this->version, $payload, $this->solution['assistantSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Autopilot.V1.FieldTypePage]'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/ModelBuildContext.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/ModelBuildContext.php new file mode 100755 index 0000000..83a198f --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/ModelBuildContext.php @@ -0,0 +1,130 @@ +solution = [ + 'assistantSid' => + $assistantSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/ModelBuilds/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ModelBuildInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the ModelBuildInstance + * + * @return ModelBuildInstance Fetched ModelBuildInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ModelBuildInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ModelBuildInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ModelBuildInstance + * + * @param array|Options $options Optional Arguments + * @return ModelBuildInstance Updated ModelBuildInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ModelBuildInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new ModelBuildInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Autopilot.V1.ModelBuildContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/ModelBuildInstance.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/ModelBuildInstance.php new file mode 100755 index 0000000..0cbab3d --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/ModelBuildInstance.php @@ -0,0 +1,162 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'assistantSid' => Values::array_get($payload, 'assistant_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'status' => Values::array_get($payload, 'status'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'url' => Values::array_get($payload, 'url'), + 'buildDuration' => Values::array_get($payload, 'build_duration'), + 'errorCode' => Values::array_get($payload, 'error_code'), + ]; + + $this->solution = ['assistantSid' => $assistantSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ModelBuildContext Context for this ModelBuildInstance + */ + protected function proxy(): ModelBuildContext + { + if (!$this->context) { + $this->context = new ModelBuildContext( + $this->version, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ModelBuildInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ModelBuildInstance + * + * @return ModelBuildInstance Fetched ModelBuildInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ModelBuildInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ModelBuildInstance + * + * @param array|Options $options Optional Arguments + * @return ModelBuildInstance Updated ModelBuildInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ModelBuildInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Autopilot.V1.ModelBuildInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/ModelBuildList.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/ModelBuildList.php new file mode 100755 index 0000000..abdac56 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/ModelBuildList.php @@ -0,0 +1,199 @@ +solution = [ + 'assistantSid' => + $assistantSid, + + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/ModelBuilds'; + } + + /** + * Create the ModelBuildInstance + * + * @param array|Options $options Optional Arguments + * @return ModelBuildInstance Created ModelBuildInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): ModelBuildInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'StatusCallback' => + $options['statusCallback'], + 'UniqueName' => + $options['uniqueName'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new ModelBuildInstance( + $this->version, + $payload, + $this->solution['assistantSid'] + ); + } + + + /** + * Reads ModelBuildInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ModelBuildInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ModelBuildInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ModelBuildInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ModelBuildPage Page of ModelBuildInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ModelBuildPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ModelBuildPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ModelBuildInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ModelBuildPage Page of ModelBuildInstance + */ + public function getPage(string $targetUrl): ModelBuildPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ModelBuildPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ModelBuildContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the ModelBuild resource to delete. + */ + public function getContext( + string $sid + + ): ModelBuildContext + { + return new ModelBuildContext( + $this->version, + $this->solution['assistantSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Autopilot.V1.ModelBuildList]'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/ModelBuildOptions.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/ModelBuildOptions.php new file mode 100755 index 0000000..d393ea8 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/ModelBuildOptions.php @@ -0,0 +1,152 @@ +options['statusCallback'] = $statusCallback; + $this->options['uniqueName'] = $uniqueName; + } + + /** + * The URL we should call using a POST method to send status information to your application. + * + * @param string $statusCallback The URL we should call using a POST method to send status information to your application. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * An application-defined string that uniquely identifies the new resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. + * + * @param string $uniqueName An application-defined string that uniquely identifies the new resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Autopilot.V1.CreateModelBuildOptions ' . $options . ']'; + } +} + + + + +class UpdateModelBuildOptions extends Options + { + /** + * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. + */ + public function __construct( + + string $uniqueName = Values::NONE + + ) { + $this->options['uniqueName'] = $uniqueName; + } + + /** + * An application-defined string that uniquely identifies the resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Autopilot.V1.UpdateModelBuildOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/ModelBuildPage.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/ModelBuildPage.php new file mode 100755 index 0000000..67d22b0 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/ModelBuildPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ModelBuildInstance \Twilio\Rest\Autopilot\V1\Assistant\ModelBuildInstance + */ + public function buildInstance(array $payload): ModelBuildInstance + { + return new ModelBuildInstance($this->version, $payload, $this->solution['assistantSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Autopilot.V1.ModelBuildPage]'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/QueryContext.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/QueryContext.php new file mode 100755 index 0000000..7be16da --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/QueryContext.php @@ -0,0 +1,132 @@ +solution = [ + 'assistantSid' => + $assistantSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/Queries/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the QueryInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the QueryInstance + * + * @return QueryInstance Fetched QueryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): QueryInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new QueryInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the QueryInstance + * + * @param array|Options $options Optional Arguments + * @return QueryInstance Updated QueryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): QueryInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'SampleSid' => + $options['sampleSid'], + 'Status' => + $options['status'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new QueryInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Autopilot.V1.QueryContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/QueryInstance.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/QueryInstance.php new file mode 100755 index 0000000..f963499 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/QueryInstance.php @@ -0,0 +1,170 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'results' => Values::array_get($payload, 'results'), + 'language' => Values::array_get($payload, 'language'), + 'modelBuildSid' => Values::array_get($payload, 'model_build_sid'), + 'query' => Values::array_get($payload, 'query'), + 'sampleSid' => Values::array_get($payload, 'sample_sid'), + 'assistantSid' => Values::array_get($payload, 'assistant_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'status' => Values::array_get($payload, 'status'), + 'url' => Values::array_get($payload, 'url'), + 'sourceChannel' => Values::array_get($payload, 'source_channel'), + 'dialogueSid' => Values::array_get($payload, 'dialogue_sid'), + ]; + + $this->solution = ['assistantSid' => $assistantSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return QueryContext Context for this QueryInstance + */ + protected function proxy(): QueryContext + { + if (!$this->context) { + $this->context = new QueryContext( + $this->version, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the QueryInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the QueryInstance + * + * @return QueryInstance Fetched QueryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): QueryInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the QueryInstance + * + * @param array|Options $options Optional Arguments + * @return QueryInstance Updated QueryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): QueryInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Autopilot.V1.QueryInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/QueryList.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/QueryList.php new file mode 100755 index 0000000..0e0b2e9 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/QueryList.php @@ -0,0 +1,217 @@ +solution = [ + 'assistantSid' => + $assistantSid, + + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/Queries'; + } + + /** + * Create the QueryInstance + * + * @param string $language The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the new query. For example: `en-US`. + * @param string $query The end-user's natural language input. It can be up to 2048 characters long. + * @param array|Options $options Optional Arguments + * @return QueryInstance Created QueryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $language, string $query, array $options = []): QueryInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Language' => + $language, + 'Query' => + $query, + 'Tasks' => + $options['tasks'], + 'ModelBuild' => + $options['modelBuild'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new QueryInstance( + $this->version, + $payload, + $this->solution['assistantSid'] + ); + } + + + /** + * Reads QueryInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return QueryInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams QueryInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of QueryInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return QueryPage Page of QueryInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): QueryPage + { + $options = new Values($options); + + $params = Values::of([ + 'Language' => + $options['language'], + 'ModelBuild' => + $options['modelBuild'], + 'Status' => + $options['status'], + 'DialogueSid' => + $options['dialogueSid'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new QueryPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of QueryInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return QueryPage Page of QueryInstance + */ + public function getPage(string $targetUrl): QueryPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new QueryPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a QueryContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Query resource to delete. + */ + public function getContext( + string $sid + + ): QueryContext + { + return new QueryContext( + $this->version, + $this->solution['assistantSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Autopilot.V1.QueryList]'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/QueryOptions.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/QueryOptions.php new file mode 100755 index 0000000..3058e09 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/QueryOptions.php @@ -0,0 +1,274 @@ +options['tasks'] = $tasks; + $this->options['modelBuild'] = $modelBuild; + } + + /** + * The list of tasks to limit the new query to. Tasks are expressed as a comma-separated list of task `unique_name` values. For example, `task-unique_name-1, task-unique_name-2`. Listing specific tasks is useful to constrain the paths that a user can take. + * + * @param string $tasks The list of tasks to limit the new query to. Tasks are expressed as a comma-separated list of task `unique_name` values. For example, `task-unique_name-1, task-unique_name-2`. Listing specific tasks is useful to constrain the paths that a user can take. + * @return $this Fluent Builder + */ + public function setTasks(string $tasks): self + { + $this->options['tasks'] = $tasks; + return $this; + } + + /** + * The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried. + * + * @param string $modelBuild The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried. + * @return $this Fluent Builder + */ + public function setModelBuild(string $modelBuild): self + { + $this->options['modelBuild'] = $modelBuild; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Autopilot.V1.CreateQueryOptions ' . $options . ']'; + } +} + + + +class ReadQueryOptions extends Options + { + /** + * @param string $language The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used by the Query resources to read. For example: `en-US`. + * @param string $modelBuild The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried. + * @param string $status The status of the resources to read. Can be: `pending-review`, `reviewed`, or `discarded` + * @param string $dialogueSid The SID of the [Dialogue](https://www.twilio.com/docs/autopilot/api/dialogue). + */ + public function __construct( + + string $language = Values::NONE, + string $modelBuild = Values::NONE, + string $status = Values::NONE, + string $dialogueSid = Values::NONE + + ) { + $this->options['language'] = $language; + $this->options['modelBuild'] = $modelBuild; + $this->options['status'] = $status; + $this->options['dialogueSid'] = $dialogueSid; + } + + /** + * The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used by the Query resources to read. For example: `en-US`. + * + * @param string $language The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used by the Query resources to read. For example: `en-US`. + * @return $this Fluent Builder + */ + public function setLanguage(string $language): self + { + $this->options['language'] = $language; + return $this; + } + + /** + * The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried. + * + * @param string $modelBuild The SID or unique name of the [Model Build](https://www.twilio.com/docs/autopilot/api/model-build) to be queried. + * @return $this Fluent Builder + */ + public function setModelBuild(string $modelBuild): self + { + $this->options['modelBuild'] = $modelBuild; + return $this; + } + + /** + * The status of the resources to read. Can be: `pending-review`, `reviewed`, or `discarded` + * + * @param string $status The status of the resources to read. Can be: `pending-review`, `reviewed`, or `discarded` + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * The SID of the [Dialogue](https://www.twilio.com/docs/autopilot/api/dialogue). + * + * @param string $dialogueSid The SID of the [Dialogue](https://www.twilio.com/docs/autopilot/api/dialogue). + * @return $this Fluent Builder + */ + public function setDialogueSid(string $dialogueSid): self + { + $this->options['dialogueSid'] = $dialogueSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Autopilot.V1.ReadQueryOptions ' . $options . ']'; + } +} + +class UpdateQueryOptions extends Options + { + /** + * @param string $sampleSid The SID of an optional reference to the [Sample](https://www.twilio.com/docs/autopilot/api/task-sample) created from the query. + * @param string $status The new status of the resource. Can be: `pending-review`, `reviewed`, or `discarded` + */ + public function __construct( + + string $sampleSid = Values::NONE, + string $status = Values::NONE + + ) { + $this->options['sampleSid'] = $sampleSid; + $this->options['status'] = $status; + } + + /** + * The SID of an optional reference to the [Sample](https://www.twilio.com/docs/autopilot/api/task-sample) created from the query. + * + * @param string $sampleSid The SID of an optional reference to the [Sample](https://www.twilio.com/docs/autopilot/api/task-sample) created from the query. + * @return $this Fluent Builder + */ + public function setSampleSid(string $sampleSid): self + { + $this->options['sampleSid'] = $sampleSid; + return $this; + } + + /** + * The new status of the resource. Can be: `pending-review`, `reviewed`, or `discarded` + * + * @param string $status The new status of the resource. Can be: `pending-review`, `reviewed`, or `discarded` + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Autopilot.V1.UpdateQueryOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/QueryPage.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/QueryPage.php new file mode 100755 index 0000000..ce49235 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/QueryPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return QueryInstance \Twilio\Rest\Autopilot\V1\Assistant\QueryInstance + */ + public function buildInstance(array $payload): QueryInstance + { + return new QueryInstance($this->version, $payload, $this->solution['assistantSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Autopilot.V1.QueryPage]'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/StyleSheetContext.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/StyleSheetContext.php new file mode 100755 index 0000000..951bde5 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/StyleSheetContext.php @@ -0,0 +1,111 @@ +solution = [ + 'assistantSid' => + $assistantSid, + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/StyleSheet'; + } + + /** + * Fetch the StyleSheetInstance + * + * @return StyleSheetInstance Fetched StyleSheetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): StyleSheetInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new StyleSheetInstance( + $this->version, + $payload, + $this->solution['assistantSid'] + ); + } + + + /** + * Update the StyleSheetInstance + * + * @param array|Options $options Optional Arguments + * @return StyleSheetInstance Updated StyleSheetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): StyleSheetInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'StyleSheet' => + Serialize::jsonObject($options['styleSheet']), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new StyleSheetInstance( + $this->version, + $payload, + $this->solution['assistantSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Autopilot.V1.StyleSheetContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/StyleSheetInstance.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/StyleSheetInstance.php new file mode 100755 index 0000000..b2b24d1 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/StyleSheetInstance.php @@ -0,0 +1,135 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'assistantSid' => Values::array_get($payload, 'assistant_sid'), + 'url' => Values::array_get($payload, 'url'), + 'data' => Values::array_get($payload, 'data'), + ]; + + $this->solution = ['assistantSid' => $assistantSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return StyleSheetContext Context for this StyleSheetInstance + */ + protected function proxy(): StyleSheetContext + { + if (!$this->context) { + $this->context = new StyleSheetContext( + $this->version, + $this->solution['assistantSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the StyleSheetInstance + * + * @return StyleSheetInstance Fetched StyleSheetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): StyleSheetInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the StyleSheetInstance + * + * @param array|Options $options Optional Arguments + * @return StyleSheetInstance Updated StyleSheetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): StyleSheetInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Autopilot.V1.StyleSheetInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/StyleSheetList.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/StyleSheetList.php new file mode 100755 index 0000000..7a5e9c2 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/StyleSheetList.php @@ -0,0 +1,67 @@ +solution = [ + 'assistantSid' => + $assistantSid, + + ]; + } + + /** + * Constructs a StyleSheetContext + */ + public function getContext( + + ): StyleSheetContext + { + return new StyleSheetContext( + $this->version, + $this->solution['assistantSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Autopilot.V1.StyleSheetList]'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/StyleSheetOptions.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/StyleSheetOptions.php new file mode 100755 index 0000000..65254cb --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/StyleSheetOptions.php @@ -0,0 +1,78 @@ +options['styleSheet'] = $styleSheet; + } + + /** + * The JSON string that describes the style sheet object. + * + * @param array $styleSheet The JSON string that describes the style sheet object. + * @return $this Fluent Builder + */ + public function setStyleSheet(array $styleSheet): self + { + $this->options['styleSheet'] = $styleSheet; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Autopilot.V1.UpdateStyleSheetOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/StyleSheetPage.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/StyleSheetPage.php new file mode 100755 index 0000000..a0217a0 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/StyleSheetPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return StyleSheetInstance \Twilio\Rest\Autopilot\V1\Assistant\StyleSheetInstance + */ + public function buildInstance(array $payload): StyleSheetInstance + { + return new StyleSheetInstance($this->version, $payload, $this->solution['assistantSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Autopilot.V1.StyleSheetPage]'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/FieldContext.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/FieldContext.php new file mode 100755 index 0000000..8f4d925 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/FieldContext.php @@ -0,0 +1,106 @@ +solution = [ + 'assistantSid' => + $assistantSid, + 'taskSid' => + $taskSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/Tasks/' . \rawurlencode($taskSid) + .'/Fields/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the FieldInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the FieldInstance + * + * @return FieldInstance Fetched FieldInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FieldInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new FieldInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['taskSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Autopilot.V1.FieldContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/FieldInstance.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/FieldInstance.php new file mode 100755 index 0000000..abb6e47 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/FieldInstance.php @@ -0,0 +1,148 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'fieldType' => Values::array_get($payload, 'field_type'), + 'taskSid' => Values::array_get($payload, 'task_sid'), + 'assistantSid' => Values::array_get($payload, 'assistant_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['assistantSid' => $assistantSid, 'taskSid' => $taskSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return FieldContext Context for this FieldInstance + */ + protected function proxy(): FieldContext + { + if (!$this->context) { + $this->context = new FieldContext( + $this->version, + $this->solution['assistantSid'], + $this->solution['taskSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the FieldInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the FieldInstance + * + * @return FieldInstance Fetched FieldInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FieldInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Autopilot.V1.FieldInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/FieldList.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/FieldList.php new file mode 100755 index 0000000..cfc5921 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/FieldList.php @@ -0,0 +1,205 @@ +solution = [ + 'assistantSid' => + $assistantSid, + + 'taskSid' => + $taskSid, + + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/Tasks/' . \rawurlencode($taskSid) + .'/Fields'; + } + + /** + * Create the FieldInstance + * + * @param string $fieldType The Field Type of the new field. Can be: a [Built-in Field Type](https://www.twilio.com/docs/autopilot/built-in-field-types), the `unique_name`, or the `sid` of a custom Field Type. + * @param string $uniqueName An application-defined string that uniquely identifies the new resource. This value must be a unique string of no more than 64 characters. It can be used as an alternative to the `sid` in the URL path to address the resource. + * @return FieldInstance Created FieldInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $fieldType, string $uniqueName): FieldInstance + { + + $data = Values::of([ + 'FieldType' => + $fieldType, + 'UniqueName' => + $uniqueName, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new FieldInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['taskSid'] + ); + } + + + /** + * Reads FieldInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return FieldInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams FieldInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of FieldInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return FieldPage Page of FieldInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): FieldPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new FieldPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of FieldInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return FieldPage Page of FieldInstance + */ + public function getPage(string $targetUrl): FieldPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new FieldPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a FieldContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Field resource to delete. + */ + public function getContext( + string $sid + + ): FieldContext + { + return new FieldContext( + $this->version, + $this->solution['assistantSid'], + $this->solution['taskSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Autopilot.V1.FieldList]'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/FieldPage.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/FieldPage.php new file mode 100755 index 0000000..93c4a53 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/FieldPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return FieldInstance \Twilio\Rest\Autopilot\V1\Assistant\Task\FieldInstance + */ + public function buildInstance(array $payload): FieldInstance + { + return new FieldInstance($this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Autopilot.V1.FieldPage]'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/SampleContext.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/SampleContext.php new file mode 100755 index 0000000..f66c142 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/SampleContext.php @@ -0,0 +1,141 @@ +solution = [ + 'assistantSid' => + $assistantSid, + 'taskSid' => + $taskSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/Tasks/' . \rawurlencode($taskSid) + .'/Samples/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the SampleInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the SampleInstance + * + * @return SampleInstance Fetched SampleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SampleInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new SampleInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['taskSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the SampleInstance + * + * @param array|Options $options Optional Arguments + * @return SampleInstance Updated SampleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SampleInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Language' => + $options['language'], + 'TaggedText' => + $options['taggedText'], + 'SourceChannel' => + $options['sourceChannel'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new SampleInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['taskSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Autopilot.V1.SampleContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/SampleInstance.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/SampleInstance.php new file mode 100755 index 0000000..8307879 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/SampleInstance.php @@ -0,0 +1,164 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'taskSid' => Values::array_get($payload, 'task_sid'), + 'language' => Values::array_get($payload, 'language'), + 'assistantSid' => Values::array_get($payload, 'assistant_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'taggedText' => Values::array_get($payload, 'tagged_text'), + 'url' => Values::array_get($payload, 'url'), + 'sourceChannel' => Values::array_get($payload, 'source_channel'), + ]; + + $this->solution = ['assistantSid' => $assistantSid, 'taskSid' => $taskSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SampleContext Context for this SampleInstance + */ + protected function proxy(): SampleContext + { + if (!$this->context) { + $this->context = new SampleContext( + $this->version, + $this->solution['assistantSid'], + $this->solution['taskSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the SampleInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SampleInstance + * + * @return SampleInstance Fetched SampleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SampleInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SampleInstance + * + * @param array|Options $options Optional Arguments + * @return SampleInstance Updated SampleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SampleInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Autopilot.V1.SampleInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/SampleList.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/SampleList.php new file mode 100755 index 0000000..8490058 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/SampleList.php @@ -0,0 +1,217 @@ +solution = [ + 'assistantSid' => + $assistantSid, + + 'taskSid' => + $taskSid, + + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/Tasks/' . \rawurlencode($taskSid) + .'/Samples'; + } + + /** + * Create the SampleInstance + * + * @param string $language The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the new sample. For example: `en-US`. + * @param string $taggedText The text example of how end users might express the task. The sample can contain [Field tag blocks](https://www.twilio.com/docs/autopilot/api/task-sample#field-tagging). + * @param array|Options $options Optional Arguments + * @return SampleInstance Created SampleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $language, string $taggedText, array $options = []): SampleInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Language' => + $language, + 'TaggedText' => + $taggedText, + 'SourceChannel' => + $options['sourceChannel'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new SampleInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['taskSid'] + ); + } + + + /** + * Reads SampleInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return SampleInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams SampleInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SampleInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return SamplePage Page of SampleInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SamplePage + { + $options = new Values($options); + + $params = Values::of([ + 'Language' => + $options['language'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SamplePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SampleInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SamplePage Page of SampleInstance + */ + public function getPage(string $targetUrl): SamplePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SamplePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SampleContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Sample resource to delete. + */ + public function getContext( + string $sid + + ): SampleContext + { + return new SampleContext( + $this->version, + $this->solution['assistantSid'], + $this->solution['taskSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Autopilot.V1.SampleList]'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/SampleOptions.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/SampleOptions.php new file mode 100755 index 0000000..5e31f2b --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/SampleOptions.php @@ -0,0 +1,220 @@ +options['sourceChannel'] = $sourceChannel; + } + + /** + * The communication channel from which the new sample was captured. Can be: `voice`, `sms`, `chat`, `alexa`, `google-assistant`, `slack`, or null if not included. + * + * @param string $sourceChannel The communication channel from which the new sample was captured. Can be: `voice`, `sms`, `chat`, `alexa`, `google-assistant`, `slack`, or null if not included. + * @return $this Fluent Builder + */ + public function setSourceChannel(string $sourceChannel): self + { + $this->options['sourceChannel'] = $sourceChannel; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Autopilot.V1.CreateSampleOptions ' . $options . ']'; + } +} + + + +class ReadSampleOptions extends Options + { + /** + * @param string $language The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. + */ + public function __construct( + + string $language = Values::NONE + + ) { + $this->options['language'] = $language; + } + + /** + * The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. + * + * @param string $language The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. + * @return $this Fluent Builder + */ + public function setLanguage(string $language): self + { + $this->options['language'] = $language; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Autopilot.V1.ReadSampleOptions ' . $options . ']'; + } +} + +class UpdateSampleOptions extends Options + { + /** + * @param string $language The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. + * @param string $taggedText The text example of how end users might express the task. The sample can contain [Field tag blocks](https://www.twilio.com/docs/autopilot/api/task-sample#field-tagging). + * @param string $sourceChannel The communication channel from which the sample was captured. Can be: `voice`, `sms`, `chat`, `alexa`, `google-assistant`, `slack`, or null if not included. + */ + public function __construct( + + string $language = Values::NONE, + string $taggedText = Values::NONE, + string $sourceChannel = Values::NONE + + ) { + $this->options['language'] = $language; + $this->options['taggedText'] = $taggedText; + $this->options['sourceChannel'] = $sourceChannel; + } + + /** + * The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. + * + * @param string $language The [ISO language-country](https://docs.oracle.com/cd/E13214_01/wli/docs92/xref/xqisocodes.html) string that specifies the language used for the sample. For example: `en-US`. + * @return $this Fluent Builder + */ + public function setLanguage(string $language): self + { + $this->options['language'] = $language; + return $this; + } + + /** + * The text example of how end users might express the task. The sample can contain [Field tag blocks](https://www.twilio.com/docs/autopilot/api/task-sample#field-tagging). + * + * @param string $taggedText The text example of how end users might express the task. The sample can contain [Field tag blocks](https://www.twilio.com/docs/autopilot/api/task-sample#field-tagging). + * @return $this Fluent Builder + */ + public function setTaggedText(string $taggedText): self + { + $this->options['taggedText'] = $taggedText; + return $this; + } + + /** + * The communication channel from which the sample was captured. Can be: `voice`, `sms`, `chat`, `alexa`, `google-assistant`, `slack`, or null if not included. + * + * @param string $sourceChannel The communication channel from which the sample was captured. Can be: `voice`, `sms`, `chat`, `alexa`, `google-assistant`, `slack`, or null if not included. + * @return $this Fluent Builder + */ + public function setSourceChannel(string $sourceChannel): self + { + $this->options['sourceChannel'] = $sourceChannel; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Autopilot.V1.UpdateSampleOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/SamplePage.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/SamplePage.php new file mode 100755 index 0000000..747fa56 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/SamplePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SampleInstance \Twilio\Rest\Autopilot\V1\Assistant\Task\SampleInstance + */ + public function buildInstance(array $payload): SampleInstance + { + return new SampleInstance($this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Autopilot.V1.SamplePage]'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskActionsContext.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskActionsContext.php new file mode 100755 index 0000000..7a266f9 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskActionsContext.php @@ -0,0 +1,118 @@ +solution = [ + 'assistantSid' => + $assistantSid, + 'taskSid' => + $taskSid, + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/Tasks/' . \rawurlencode($taskSid) + .'/Actions'; + } + + /** + * Fetch the TaskActionsInstance + * + * @return TaskActionsInstance Fetched TaskActionsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TaskActionsInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new TaskActionsInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['taskSid'] + ); + } + + + /** + * Update the TaskActionsInstance + * + * @param array|Options $options Optional Arguments + * @return TaskActionsInstance Updated TaskActionsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TaskActionsInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Actions' => + Serialize::jsonObject($options['actions']), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new TaskActionsInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['taskSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Autopilot.V1.TaskActionsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskActionsInstance.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskActionsInstance.php new file mode 100755 index 0000000..3878dea --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskActionsInstance.php @@ -0,0 +1,139 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'assistantSid' => Values::array_get($payload, 'assistant_sid'), + 'taskSid' => Values::array_get($payload, 'task_sid'), + 'url' => Values::array_get($payload, 'url'), + 'data' => Values::array_get($payload, 'data'), + ]; + + $this->solution = ['assistantSid' => $assistantSid, 'taskSid' => $taskSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return TaskActionsContext Context for this TaskActionsInstance + */ + protected function proxy(): TaskActionsContext + { + if (!$this->context) { + $this->context = new TaskActionsContext( + $this->version, + $this->solution['assistantSid'], + $this->solution['taskSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the TaskActionsInstance + * + * @return TaskActionsInstance Fetched TaskActionsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TaskActionsInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the TaskActionsInstance + * + * @param array|Options $options Optional Arguments + * @return TaskActionsInstance Updated TaskActionsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TaskActionsInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Autopilot.V1.TaskActionsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskActionsList.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskActionsList.php new file mode 100755 index 0000000..8c6973a --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskActionsList.php @@ -0,0 +1,73 @@ +solution = [ + 'assistantSid' => + $assistantSid, + + 'taskSid' => + $taskSid, + + ]; + } + + /** + * Constructs a TaskActionsContext + */ + public function getContext( + + ): TaskActionsContext + { + return new TaskActionsContext( + $this->version, + $this->solution['assistantSid'], + $this->solution['taskSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Autopilot.V1.TaskActionsList]'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskActionsOptions.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskActionsOptions.php new file mode 100755 index 0000000..2773d0c --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskActionsOptions.php @@ -0,0 +1,78 @@ +options['actions'] = $actions; + } + + /** + * The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. + * + * @param array $actions The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. + * @return $this Fluent Builder + */ + public function setActions(array $actions): self + { + $this->options['actions'] = $actions; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Autopilot.V1.UpdateTaskActionsOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskActionsPage.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskActionsPage.php new file mode 100755 index 0000000..2c9c8ad --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskActionsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TaskActionsInstance \Twilio\Rest\Autopilot\V1\Assistant\Task\TaskActionsInstance + */ + public function buildInstance(array $payload): TaskActionsInstance + { + return new TaskActionsInstance($this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Autopilot.V1.TaskActionsPage]'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskStatisticsContext.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskStatisticsContext.php new file mode 100755 index 0000000..203206d --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskStatisticsContext.php @@ -0,0 +1,87 @@ +solution = [ + 'assistantSid' => + $assistantSid, + 'taskSid' => + $taskSid, + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/Tasks/' . \rawurlencode($taskSid) + .'/Statistics'; + } + + /** + * Fetch the TaskStatisticsInstance + * + * @return TaskStatisticsInstance Fetched TaskStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TaskStatisticsInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new TaskStatisticsInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['taskSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Autopilot.V1.TaskStatisticsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskStatisticsInstance.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskStatisticsInstance.php new file mode 100755 index 0000000..840e221 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskStatisticsInstance.php @@ -0,0 +1,127 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'assistantSid' => Values::array_get($payload, 'assistant_sid'), + 'taskSid' => Values::array_get($payload, 'task_sid'), + 'samplesCount' => Values::array_get($payload, 'samples_count'), + 'fieldsCount' => Values::array_get($payload, 'fields_count'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['assistantSid' => $assistantSid, 'taskSid' => $taskSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return TaskStatisticsContext Context for this TaskStatisticsInstance + */ + protected function proxy(): TaskStatisticsContext + { + if (!$this->context) { + $this->context = new TaskStatisticsContext( + $this->version, + $this->solution['assistantSid'], + $this->solution['taskSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the TaskStatisticsInstance + * + * @return TaskStatisticsInstance Fetched TaskStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TaskStatisticsInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Autopilot.V1.TaskStatisticsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskStatisticsList.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskStatisticsList.php new file mode 100755 index 0000000..0bbd5bc --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskStatisticsList.php @@ -0,0 +1,73 @@ +solution = [ + 'assistantSid' => + $assistantSid, + + 'taskSid' => + $taskSid, + + ]; + } + + /** + * Constructs a TaskStatisticsContext + */ + public function getContext( + + ): TaskStatisticsContext + { + return new TaskStatisticsContext( + $this->version, + $this->solution['assistantSid'], + $this->solution['taskSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Autopilot.V1.TaskStatisticsList]'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskStatisticsPage.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskStatisticsPage.php new file mode 100755 index 0000000..e9eabc2 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/Task/TaskStatisticsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TaskStatisticsInstance \Twilio\Rest\Autopilot\V1\Assistant\Task\TaskStatisticsInstance + */ + public function buildInstance(array $payload): TaskStatisticsInstance + { + return new TaskStatisticsInstance($this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Autopilot.V1.TaskStatisticsPage]'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/TaskContext.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/TaskContext.php new file mode 100755 index 0000000..355f9d0 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/TaskContext.php @@ -0,0 +1,256 @@ +solution = [ + 'assistantSid' => + $assistantSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/Tasks/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the TaskInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the TaskInstance + * + * @return TaskInstance Fetched TaskInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TaskInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new TaskInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the TaskInstance + * + * @param array|Options $options Optional Arguments + * @return TaskInstance Updated TaskInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TaskInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'UniqueName' => + $options['uniqueName'], + 'Actions' => + Serialize::jsonObject($options['actions']), + 'ActionsUrl' => + $options['actionsUrl'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new TaskInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the samples + */ + protected function getSamples(): SampleList + { + if (!$this->_samples) { + $this->_samples = new SampleList( + $this->version, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + return $this->_samples; + } + + /** + * Access the fields + */ + protected function getFields(): FieldList + { + if (!$this->_fields) { + $this->_fields = new FieldList( + $this->version, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + return $this->_fields; + } + + /** + * Access the taskActions + */ + protected function getTaskActions(): TaskActionsList + { + if (!$this->_taskActions) { + $this->_taskActions = new TaskActionsList( + $this->version, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + return $this->_taskActions; + } + + /** + * Access the statistics + */ + protected function getStatistics(): TaskStatisticsList + { + if (!$this->_statistics) { + $this->_statistics = new TaskStatisticsList( + $this->version, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + return $this->_statistics; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Autopilot.V1.TaskContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/TaskInstance.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/TaskInstance.php new file mode 100755 index 0000000..f61fb47 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/TaskInstance.php @@ -0,0 +1,203 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'links' => Values::array_get($payload, 'links'), + 'assistantSid' => Values::array_get($payload, 'assistant_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'actionsUrl' => Values::array_get($payload, 'actions_url'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['assistantSid' => $assistantSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return TaskContext Context for this TaskInstance + */ + protected function proxy(): TaskContext + { + if (!$this->context) { + $this->context = new TaskContext( + $this->version, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the TaskInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the TaskInstance + * + * @return TaskInstance Fetched TaskInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TaskInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the TaskInstance + * + * @param array|Options $options Optional Arguments + * @return TaskInstance Updated TaskInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TaskInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the samples + */ + protected function getSamples(): SampleList + { + return $this->proxy()->samples; + } + + /** + * Access the fields + */ + protected function getFields(): FieldList + { + return $this->proxy()->fields; + } + + /** + * Access the taskActions + */ + protected function getTaskActions(): TaskActionsList + { + return $this->proxy()->taskActions; + } + + /** + * Access the statistics + */ + protected function getStatistics(): TaskStatisticsList + { + return $this->proxy()->statistics; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Autopilot.V1.TaskInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/TaskList.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/TaskList.php new file mode 100755 index 0000000..f608767 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/TaskList.php @@ -0,0 +1,205 @@ +solution = [ + 'assistantSid' => + $assistantSid, + + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/Tasks'; + } + + /** + * Create the TaskInstance + * + * @param string $uniqueName An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length. + * @param array|Options $options Optional Arguments + * @return TaskInstance Created TaskInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $uniqueName, array $options = []): TaskInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $uniqueName, + 'FriendlyName' => + $options['friendlyName'], + 'Actions' => + Serialize::jsonObject($options['actions']), + 'ActionsUrl' => + $options['actionsUrl'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new TaskInstance( + $this->version, + $payload, + $this->solution['assistantSid'] + ); + } + + + /** + * Reads TaskInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return TaskInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams TaskInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of TaskInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return TaskPage Page of TaskInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): TaskPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new TaskPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of TaskInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return TaskPage Page of TaskInstance + */ + public function getPage(string $targetUrl): TaskPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new TaskPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a TaskContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Task resource to delete. + */ + public function getContext( + string $sid + + ): TaskContext + { + return new TaskContext( + $this->version, + $this->solution['assistantSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Autopilot.V1.TaskList]'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/TaskOptions.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/TaskOptions.php new file mode 100755 index 0000000..d67d568 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/TaskOptions.php @@ -0,0 +1,224 @@ +options['friendlyName'] = $friendlyName; + $this->options['actions'] = $actions; + $this->options['actionsUrl'] = $actionsUrl; + } + + /** + * A descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. It is optional and not unique. + * + * @param array $actions The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. It is optional and not unique. + * @return $this Fluent Builder + */ + public function setActions(array $actions): self + { + $this->options['actions'] = $actions; + return $this; + } + + /** + * The URL from which the Assistant can fetch actions. + * + * @param string $actionsUrl The URL from which the Assistant can fetch actions. + * @return $this Fluent Builder + */ + public function setActionsUrl(string $actionsUrl): self + { + $this->options['actionsUrl'] = $actionsUrl; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Autopilot.V1.CreateTaskOptions ' . $options . ']'; + } +} + + + + +class UpdateTaskOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be 64 characters or less in length and be unique. It can be used as an alternative to the `sid` in the URL path to address the resource. + * @param array $actions The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. + * @param string $actionsUrl The URL from which the Assistant can fetch actions. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $uniqueName = Values::NONE, + array $actions = Values::ARRAY_NONE, + string $actionsUrl = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['uniqueName'] = $uniqueName; + $this->options['actions'] = $actions; + $this->options['actionsUrl'] = $actionsUrl; + } + + /** + * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * An application-defined string that uniquely identifies the resource. This value must be 64 characters or less in length and be unique. It can be used as an alternative to the `sid` in the URL path to address the resource. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be 64 characters or less in length and be unique. It can be used as an alternative to the `sid` in the URL path to address the resource. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. + * + * @param array $actions The JSON string that specifies the [actions](https://www.twilio.com/docs/autopilot/actions) that instruct the Assistant on how to perform the task. + * @return $this Fluent Builder + */ + public function setActions(array $actions): self + { + $this->options['actions'] = $actions; + return $this; + } + + /** + * The URL from which the Assistant can fetch actions. + * + * @param string $actionsUrl The URL from which the Assistant can fetch actions. + * @return $this Fluent Builder + */ + public function setActionsUrl(string $actionsUrl): self + { + $this->options['actionsUrl'] = $actionsUrl; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Autopilot.V1.UpdateTaskOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/TaskPage.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/TaskPage.php new file mode 100755 index 0000000..9806bdb --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/TaskPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TaskInstance \Twilio\Rest\Autopilot\V1\Assistant\TaskInstance + */ + public function buildInstance(array $payload): TaskInstance + { + return new TaskInstance($this->version, $payload, $this->solution['assistantSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Autopilot.V1.TaskPage]'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/WebhookContext.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/WebhookContext.php new file mode 100755 index 0000000..0e9ab4f --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/WebhookContext.php @@ -0,0 +1,136 @@ +solution = [ + 'assistantSid' => + $assistantSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/Webhooks/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the WebhookInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the WebhookInstance + * + * @return WebhookInstance Fetched WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WebhookInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new WebhookInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the WebhookInstance + * + * @param array|Options $options Optional Arguments + * @return WebhookInstance Updated WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WebhookInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + 'Events' => + $options['events'], + 'WebhookUrl' => + $options['webhookUrl'], + 'WebhookMethod' => + $options['webhookMethod'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new WebhookInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Autopilot.V1.WebhookContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/WebhookInstance.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/WebhookInstance.php new file mode 100755 index 0000000..2f800da --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/WebhookInstance.php @@ -0,0 +1,162 @@ +properties = [ + 'url' => Values::array_get($payload, 'url'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'assistantSid' => Values::array_get($payload, 'assistant_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'events' => Values::array_get($payload, 'events'), + 'webhookUrl' => Values::array_get($payload, 'webhook_url'), + 'webhookMethod' => Values::array_get($payload, 'webhook_method'), + ]; + + $this->solution = ['assistantSid' => $assistantSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return WebhookContext Context for this WebhookInstance + */ + protected function proxy(): WebhookContext + { + if (!$this->context) { + $this->context = new WebhookContext( + $this->version, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the WebhookInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the WebhookInstance + * + * @return WebhookInstance Fetched WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WebhookInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the WebhookInstance + * + * @param array|Options $options Optional Arguments + * @return WebhookInstance Updated WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WebhookInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Autopilot.V1.WebhookInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/WebhookList.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/WebhookList.php new file mode 100755 index 0000000..723a408 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/WebhookList.php @@ -0,0 +1,206 @@ +solution = [ + 'assistantSid' => + $assistantSid, + + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/Webhooks'; + } + + /** + * Create the WebhookInstance + * + * @param string $uniqueName An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length. + * @param string $events The list of space-separated events that this Webhook will subscribe to. + * @param string $webhookUrl The URL associated with this Webhook. + * @param array|Options $options Optional Arguments + * @return WebhookInstance Created WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $uniqueName, string $events, string $webhookUrl, array $options = []): WebhookInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $uniqueName, + 'Events' => + $events, + 'WebhookUrl' => + $webhookUrl, + 'WebhookMethod' => + $options['webhookMethod'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new WebhookInstance( + $this->version, + $payload, + $this->solution['assistantSid'] + ); + } + + + /** + * Reads WebhookInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return WebhookInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams WebhookInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of WebhookInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return WebhookPage Page of WebhookInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): WebhookPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new WebhookPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of WebhookInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return WebhookPage Page of WebhookInstance + */ + public function getPage(string $targetUrl): WebhookPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new WebhookPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a WebhookContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Webhook resource to delete. + */ + public function getContext( + string $sid + + ): WebhookContext + { + return new WebhookContext( + $this->version, + $this->solution['assistantSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Autopilot.V1.WebhookList]'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/WebhookOptions.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/WebhookOptions.php new file mode 100755 index 0000000..94fa4f1 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/WebhookOptions.php @@ -0,0 +1,188 @@ +options['webhookMethod'] = $webhookMethod; + } + + /** + * The method to be used when calling the webhook's URL. + * + * @param string $webhookMethod The method to be used when calling the webhook's URL. + * @return $this Fluent Builder + */ + public function setWebhookMethod(string $webhookMethod): self + { + $this->options['webhookMethod'] = $webhookMethod; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Autopilot.V1.CreateWebhookOptions ' . $options . ']'; + } +} + + + + +class UpdateWebhookOptions extends Options + { + /** + * @param string $uniqueName An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length. + * @param string $events The list of space-separated events that this Webhook will subscribe to. + * @param string $webhookUrl The URL associated with this Webhook. + * @param string $webhookMethod The method to be used when calling the webhook's URL. + */ + public function __construct( + + string $uniqueName = Values::NONE, + string $events = Values::NONE, + string $webhookUrl = Values::NONE, + string $webhookMethod = Values::NONE + + ) { + $this->options['uniqueName'] = $uniqueName; + $this->options['events'] = $events; + $this->options['webhookUrl'] = $webhookUrl; + $this->options['webhookMethod'] = $webhookMethod; + } + + /** + * An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length. + * + * @param string $uniqueName An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. This value must be unique and 64 characters or less in length. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * The list of space-separated events that this Webhook will subscribe to. + * + * @param string $events The list of space-separated events that this Webhook will subscribe to. + * @return $this Fluent Builder + */ + public function setEvents(string $events): self + { + $this->options['events'] = $events; + return $this; + } + + /** + * The URL associated with this Webhook. + * + * @param string $webhookUrl The URL associated with this Webhook. + * @return $this Fluent Builder + */ + public function setWebhookUrl(string $webhookUrl): self + { + $this->options['webhookUrl'] = $webhookUrl; + return $this; + } + + /** + * The method to be used when calling the webhook's URL. + * + * @param string $webhookMethod The method to be used when calling the webhook's URL. + * @return $this Fluent Builder + */ + public function setWebhookMethod(string $webhookMethod): self + { + $this->options['webhookMethod'] = $webhookMethod; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Autopilot.V1.UpdateWebhookOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Autopilot/V1/Assistant/WebhookPage.php b/app/api/Twilio/Rest/Autopilot/V1/Assistant/WebhookPage.php new file mode 100755 index 0000000..17fe67f --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/Assistant/WebhookPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WebhookInstance \Twilio\Rest\Autopilot\V1\Assistant\WebhookInstance + */ + public function buildInstance(array $payload): WebhookInstance + { + return new WebhookInstance($this->version, $payload, $this->solution['assistantSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Autopilot.V1.WebhookPage]'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/AssistantContext.php b/app/api/Twilio/Rest/Autopilot/V1/AssistantContext.php new file mode 100755 index 0000000..1727cb6 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/AssistantContext.php @@ -0,0 +1,329 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Assistants/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the AssistantInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the AssistantInstance + * + * @return AssistantInstance Fetched AssistantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AssistantInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new AssistantInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the AssistantInstance + * + * @param array|Options $options Optional Arguments + * @return AssistantInstance Updated AssistantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): AssistantInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'LogQueries' => + Serialize::booleanToString($options['logQueries']), + 'UniqueName' => + $options['uniqueName'], + 'CallbackUrl' => + $options['callbackUrl'], + 'CallbackEvents' => + $options['callbackEvents'], + 'StyleSheet' => + Serialize::jsonObject($options['styleSheet']), + 'Defaults' => + Serialize::jsonObject($options['defaults']), + 'DevelopmentStage' => + $options['developmentStage'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new AssistantInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the fieldTypes + */ + protected function getFieldTypes(): FieldTypeList + { + if (!$this->_fieldTypes) { + $this->_fieldTypes = new FieldTypeList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_fieldTypes; + } + + /** + * Access the modelBuilds + */ + protected function getModelBuilds(): ModelBuildList + { + if (!$this->_modelBuilds) { + $this->_modelBuilds = new ModelBuildList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_modelBuilds; + } + + /** + * Access the queries + */ + protected function getQueries(): QueryList + { + if (!$this->_queries) { + $this->_queries = new QueryList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_queries; + } + + /** + * Access the webhooks + */ + protected function getWebhooks(): WebhookList + { + if (!$this->_webhooks) { + $this->_webhooks = new WebhookList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_webhooks; + } + + /** + * Access the tasks + */ + protected function getTasks(): TaskList + { + if (!$this->_tasks) { + $this->_tasks = new TaskList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_tasks; + } + + /** + * Access the defaults + */ + protected function getDefaults(): DefaultsList + { + if (!$this->_defaults) { + $this->_defaults = new DefaultsList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_defaults; + } + + /** + * Access the styleSheet + */ + protected function getStyleSheet(): StyleSheetList + { + if (!$this->_styleSheet) { + $this->_styleSheet = new StyleSheetList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_styleSheet; + } + + /** + * Access the dialogues + */ + protected function getDialogues(): DialogueList + { + if (!$this->_dialogues) { + $this->_dialogues = new DialogueList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_dialogues; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Autopilot.V1.AssistantContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/AssistantInstance.php b/app/api/Twilio/Rest/Autopilot/V1/AssistantInstance.php new file mode 100755 index 0000000..8baae71 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/AssistantInstance.php @@ -0,0 +1,249 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'latestModelBuildSid' => Values::array_get($payload, 'latest_model_build_sid'), + 'links' => Values::array_get($payload, 'links'), + 'logQueries' => Values::array_get($payload, 'log_queries'), + 'developmentStage' => Values::array_get($payload, 'development_stage'), + 'needsModelBuild' => Values::array_get($payload, 'needs_model_build'), + 'sid' => Values::array_get($payload, 'sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'url' => Values::array_get($payload, 'url'), + 'callbackUrl' => Values::array_get($payload, 'callback_url'), + 'callbackEvents' => Values::array_get($payload, 'callback_events'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AssistantContext Context for this AssistantInstance + */ + protected function proxy(): AssistantContext + { + if (!$this->context) { + $this->context = new AssistantContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the AssistantInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the AssistantInstance + * + * @return AssistantInstance Fetched AssistantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AssistantInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the AssistantInstance + * + * @param array|Options $options Optional Arguments + * @return AssistantInstance Updated AssistantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): AssistantInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the fieldTypes + */ + protected function getFieldTypes(): FieldTypeList + { + return $this->proxy()->fieldTypes; + } + + /** + * Access the modelBuilds + */ + protected function getModelBuilds(): ModelBuildList + { + return $this->proxy()->modelBuilds; + } + + /** + * Access the queries + */ + protected function getQueries(): QueryList + { + return $this->proxy()->queries; + } + + /** + * Access the webhooks + */ + protected function getWebhooks(): WebhookList + { + return $this->proxy()->webhooks; + } + + /** + * Access the tasks + */ + protected function getTasks(): TaskList + { + return $this->proxy()->tasks; + } + + /** + * Access the defaults + */ + protected function getDefaults(): DefaultsList + { + return $this->proxy()->defaults; + } + + /** + * Access the styleSheet + */ + protected function getStyleSheet(): StyleSheetList + { + return $this->proxy()->styleSheet; + } + + /** + * Access the dialogues + */ + protected function getDialogues(): DialogueList + { + return $this->proxy()->dialogues; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Autopilot.V1.AssistantInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Autopilot/V1/AssistantList.php b/app/api/Twilio/Rest/Autopilot/V1/AssistantList.php new file mode 100755 index 0000000..fa80759 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/AssistantList.php @@ -0,0 +1,202 @@ +solution = [ + ]; + + $this->uri = '/Assistants'; + } + + /** + * Create the AssistantInstance + * + * @param array|Options $options Optional Arguments + * @return AssistantInstance Created AssistantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): AssistantInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'LogQueries' => + Serialize::booleanToString($options['logQueries']), + 'UniqueName' => + $options['uniqueName'], + 'CallbackUrl' => + $options['callbackUrl'], + 'CallbackEvents' => + $options['callbackEvents'], + 'StyleSheet' => + Serialize::jsonObject($options['styleSheet']), + 'Defaults' => + Serialize::jsonObject($options['defaults']), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new AssistantInstance( + $this->version, + $payload + ); + } + + + /** + * Reads AssistantInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return AssistantInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams AssistantInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AssistantInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return AssistantPage Page of AssistantInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AssistantPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new AssistantPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of AssistantInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return AssistantPage Page of AssistantInstance + */ + public function getPage(string $targetUrl): AssistantPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AssistantPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AssistantContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Assistant resource to delete. + */ + public function getContext( + string $sid + + ): AssistantContext + { + return new AssistantContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Autopilot.V1.AssistantList]'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/AssistantOptions.php b/app/api/Twilio/Rest/Autopilot/V1/AssistantOptions.php new file mode 100755 index 0000000..2e0ac5f --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/AssistantOptions.php @@ -0,0 +1,368 @@ +options['friendlyName'] = $friendlyName; + $this->options['logQueries'] = $logQueries; + $this->options['uniqueName'] = $uniqueName; + $this->options['callbackUrl'] = $callbackUrl; + $this->options['callbackEvents'] = $callbackEvents; + $this->options['styleSheet'] = $styleSheet; + $this->options['defaults'] = $defaults; + } + + /** + * A descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the new resource. It is not unique and can be up to 255 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Whether queries should be logged and kept after training. Can be: `true` or `false` and defaults to `true`. If `true`, queries are stored for 30 days, and then deleted. If `false`, no queries are stored. + * + * @param bool $logQueries Whether queries should be logged and kept after training. Can be: `true` or `false` and defaults to `true`. If `true`, queries are stored for 30 days, and then deleted. If `false`, no queries are stored. + * @return $this Fluent Builder + */ + public function setLogQueries(bool $logQueries): self + { + $this->options['logQueries'] = $logQueries; + return $this; + } + + /** + * An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. + * + * @param string $uniqueName An application-defined string that uniquely identifies the new resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * Reserved. + * + * @param string $callbackUrl Reserved. + * @return $this Fluent Builder + */ + public function setCallbackUrl(string $callbackUrl): self + { + $this->options['callbackUrl'] = $callbackUrl; + return $this; + } + + /** + * Reserved. + * + * @param string $callbackEvents Reserved. + * @return $this Fluent Builder + */ + public function setCallbackEvents(string $callbackEvents): self + { + $this->options['callbackEvents'] = $callbackEvents; + return $this; + } + + /** + * The JSON string that defines the Assistant's [style sheet](https://www.twilio.com/docs/autopilot/api/assistant/stylesheet) + * + * @param array $styleSheet The JSON string that defines the Assistant's [style sheet](https://www.twilio.com/docs/autopilot/api/assistant/stylesheet) + * @return $this Fluent Builder + */ + public function setStyleSheet(array $styleSheet): self + { + $this->options['styleSheet'] = $styleSheet; + return $this; + } + + /** + * A JSON object that defines the Assistant's [default tasks](https://www.twilio.com/docs/autopilot/api/assistant/defaults) for various scenarios, including initiation actions and fallback tasks. + * + * @param array $defaults A JSON object that defines the Assistant's [default tasks](https://www.twilio.com/docs/autopilot/api/assistant/defaults) for various scenarios, including initiation actions and fallback tasks. + * @return $this Fluent Builder + */ + public function setDefaults(array $defaults): self + { + $this->options['defaults'] = $defaults; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Autopilot.V1.CreateAssistantOptions ' . $options . ']'; + } +} + + + + +class UpdateAssistantOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * @param bool $logQueries Whether queries should be logged and kept after training. Can be: `true` or `false` and defaults to `true`. If `true`, queries are stored for 30 days, and then deleted. If `false`, no queries are stored. + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. + * @param string $callbackUrl Reserved. + * @param string $callbackEvents Reserved. + * @param array $styleSheet The JSON string that defines the Assistant's [style sheet](https://www.twilio.com/docs/autopilot/api/assistant/stylesheet) + * @param array $defaults A JSON object that defines the Assistant's [default tasks](https://www.twilio.com/docs/autopilot/api/assistant/defaults) for various scenarios, including initiation actions and fallback tasks. + * @param string $developmentStage A string describing the state of the assistant. + */ + public function __construct( + + string $friendlyName = Values::NONE, + bool $logQueries = Values::BOOL_NONE, + string $uniqueName = Values::NONE, + string $callbackUrl = Values::NONE, + string $callbackEvents = Values::NONE, + array $styleSheet = Values::ARRAY_NONE, + array $defaults = Values::ARRAY_NONE, + string $developmentStage = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['logQueries'] = $logQueries; + $this->options['uniqueName'] = $uniqueName; + $this->options['callbackUrl'] = $callbackUrl; + $this->options['callbackEvents'] = $callbackEvents; + $this->options['styleSheet'] = $styleSheet; + $this->options['defaults'] = $defaults; + $this->options['developmentStage'] = $developmentStage; + } + + /** + * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Whether queries should be logged and kept after training. Can be: `true` or `false` and defaults to `true`. If `true`, queries are stored for 30 days, and then deleted. If `false`, no queries are stored. + * + * @param bool $logQueries Whether queries should be logged and kept after training. Can be: `true` or `false` and defaults to `true`. If `true`, queries are stored for 30 days, and then deleted. If `false`, no queries are stored. + * @return $this Fluent Builder + */ + public function setLogQueries(bool $logQueries): self + { + $this->options['logQueries'] = $logQueries; + return $this; + } + + /** + * An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. The first 64 characters must be unique. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * Reserved. + * + * @param string $callbackUrl Reserved. + * @return $this Fluent Builder + */ + public function setCallbackUrl(string $callbackUrl): self + { + $this->options['callbackUrl'] = $callbackUrl; + return $this; + } + + /** + * Reserved. + * + * @param string $callbackEvents Reserved. + * @return $this Fluent Builder + */ + public function setCallbackEvents(string $callbackEvents): self + { + $this->options['callbackEvents'] = $callbackEvents; + return $this; + } + + /** + * The JSON string that defines the Assistant's [style sheet](https://www.twilio.com/docs/autopilot/api/assistant/stylesheet) + * + * @param array $styleSheet The JSON string that defines the Assistant's [style sheet](https://www.twilio.com/docs/autopilot/api/assistant/stylesheet) + * @return $this Fluent Builder + */ + public function setStyleSheet(array $styleSheet): self + { + $this->options['styleSheet'] = $styleSheet; + return $this; + } + + /** + * A JSON object that defines the Assistant's [default tasks](https://www.twilio.com/docs/autopilot/api/assistant/defaults) for various scenarios, including initiation actions and fallback tasks. + * + * @param array $defaults A JSON object that defines the Assistant's [default tasks](https://www.twilio.com/docs/autopilot/api/assistant/defaults) for various scenarios, including initiation actions and fallback tasks. + * @return $this Fluent Builder + */ + public function setDefaults(array $defaults): self + { + $this->options['defaults'] = $defaults; + return $this; + } + + /** + * A string describing the state of the assistant. + * + * @param string $developmentStage A string describing the state of the assistant. + * @return $this Fluent Builder + */ + public function setDevelopmentStage(string $developmentStage): self + { + $this->options['developmentStage'] = $developmentStage; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Autopilot.V1.UpdateAssistantOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Autopilot/V1/AssistantPage.php b/app/api/Twilio/Rest/Autopilot/V1/AssistantPage.php new file mode 100755 index 0000000..569b1d4 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/AssistantPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AssistantInstance \Twilio\Rest\Autopilot\V1\AssistantInstance + */ + public function buildInstance(array $payload): AssistantInstance + { + return new AssistantInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Autopilot.V1.AssistantPage]'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/RestoreAssistantInstance.php b/app/api/Twilio/Rest/Autopilot/V1/RestoreAssistantInstance.php new file mode 100755 index 0000000..cc8ca29 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/RestoreAssistantInstance.php @@ -0,0 +1,103 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'needsModelBuild' => Values::array_get($payload, 'needs_model_build'), + 'latestModelBuildSid' => Values::array_get($payload, 'latest_model_build_sid'), + 'logQueries' => Values::array_get($payload, 'log_queries'), + 'developmentStage' => Values::array_get($payload, 'development_stage'), + 'callbackUrl' => Values::array_get($payload, 'callback_url'), + 'callbackEvents' => Values::array_get($payload, 'callback_events'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Autopilot.V1.RestoreAssistantInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Autopilot/V1/RestoreAssistantList.php b/app/api/Twilio/Rest/Autopilot/V1/RestoreAssistantList.php new file mode 100755 index 0000000..3604ea1 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/RestoreAssistantList.php @@ -0,0 +1,77 @@ +solution = [ + ]; + + $this->uri = '/Assistants/Restore'; + } + + /** + * Update the RestoreAssistantInstance + * + * @param string $assistant The Twilio-provided string that uniquely identifies the Assistant resource to restore. + * @return RestoreAssistantInstance Updated RestoreAssistantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $assistant): RestoreAssistantInstance + { + + $data = Values::of([ + 'Assistant' => + $assistant, + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new RestoreAssistantInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Autopilot.V1.RestoreAssistantList]'; + } +} diff --git a/app/api/Twilio/Rest/Autopilot/V1/RestoreAssistantPage.php b/app/api/Twilio/Rest/Autopilot/V1/RestoreAssistantPage.php new file mode 100755 index 0000000..a0f9687 --- /dev/null +++ b/app/api/Twilio/Rest/Autopilot/V1/RestoreAssistantPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RestoreAssistantInstance \Twilio\Rest\Autopilot\V1\RestoreAssistantInstance + */ + public function buildInstance(array $payload): RestoreAssistantInstance + { + return new RestoreAssistantInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Autopilot.V1.RestoreAssistantPage]'; + } +} diff --git a/app/api/Twilio/Rest/AutopilotBase.php b/app/api/Twilio/Rest/AutopilotBase.php new file mode 100755 index 0000000..df3d3b7 --- /dev/null +++ b/app/api/Twilio/Rest/AutopilotBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://autopilot.twilio.com'; + } + + + /** + * @return V1 Version v1 of autopilot + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Autopilot]'; + } +} diff --git a/app/api/Twilio/Rest/Bulkexports.php b/app/api/Twilio/Rest/Bulkexports.php new file mode 100755 index 0000000..2a54d8a --- /dev/null +++ b/app/api/Twilio/Rest/Bulkexports.php @@ -0,0 +1,44 @@ +exports instead. + */ + protected function getExports(): \Twilio\Rest\Bulkexports\V1\ExportList { + echo "exports is deprecated. Use v1->exports instead."; + return $this->v1->exports; + } + + /** + * @deprecated Use v1->exports(\$resourceType) instead. + * @param string $resourceType The type of communication – Messages, Calls, + * Conferences, and Participants + */ + protected function contextExports(string $resourceType): \Twilio\Rest\Bulkexports\V1\ExportContext { + echo "exports(\$resourceType) is deprecated. Use v1->exports(\$resourceType) instead."; + return $this->v1->exports($resourceType); + } + + /** + * @deprecated Use v1->exportConfiguration instead. + */ + protected function getExportConfiguration(): \Twilio\Rest\Bulkexports\V1\ExportConfigurationList { + echo "exportConfiguration is deprecated. Use v1->exportConfiguration instead."; + return $this->v1->exportConfiguration; + } + + /** + * @deprecated Use v1->exportConfiguration(\$resourceType) instead. + * @param string $resourceType The type of communication – Messages, Calls, + * Conferences, and Participants + */ + protected function contextExportConfiguration(string $resourceType): \Twilio\Rest\Bulkexports\V1\ExportConfigurationContext { + echo "rexportConfiguration(\$resourceType) is deprecated. Use v1->exportConfiguration(\$resourceType) instead."; + return $this->v1->exportConfiguration($resourceType); + } +} \ No newline at end of file diff --git a/app/api/Twilio/Rest/Bulkexports/V1.php b/app/api/Twilio/Rest/Bulkexports/V1.php new file mode 100755 index 0000000..c855eba --- /dev/null +++ b/app/api/Twilio/Rest/Bulkexports/V1.php @@ -0,0 +1,106 @@ +version = 'v1'; + } + + protected function getExports(): ExportList + { + if (!$this->_exports) { + $this->_exports = new ExportList($this); + } + return $this->_exports; + } + + protected function getExportConfiguration(): ExportConfigurationList + { + if (!$this->_exportConfiguration) { + $this->_exportConfiguration = new ExportConfigurationList($this); + } + return $this->_exportConfiguration; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Bulkexports.V1]'; + } +} diff --git a/app/api/Twilio/Rest/Bulkexports/V1/Export/DayContext.php b/app/api/Twilio/Rest/Bulkexports/V1/Export/DayContext.php new file mode 100755 index 0000000..8c3adf0 --- /dev/null +++ b/app/api/Twilio/Rest/Bulkexports/V1/Export/DayContext.php @@ -0,0 +1,87 @@ +solution = [ + 'resourceType' => + $resourceType, + 'day' => + $day, + ]; + + $this->uri = '/Exports/' . \rawurlencode($resourceType) + .'/Days/' . \rawurlencode($day) + .''; + } + + /** + * Fetch the DayInstance + * + * @return DayInstance Fetched DayInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DayInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new DayInstance( + $this->version, + $payload, + $this->solution['resourceType'], + $this->solution['day'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Bulkexports.V1.DayContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Bulkexports/V1/Export/DayInstance.php b/app/api/Twilio/Rest/Bulkexports/V1/Export/DayInstance.php new file mode 100755 index 0000000..365da72 --- /dev/null +++ b/app/api/Twilio/Rest/Bulkexports/V1/Export/DayInstance.php @@ -0,0 +1,127 @@ +properties = [ + 'redirectTo' => Values::array_get($payload, 'redirect_to'), + 'day' => Values::array_get($payload, 'day'), + 'size' => Values::array_get($payload, 'size'), + 'createDate' => Values::array_get($payload, 'create_date'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'resourceType' => Values::array_get($payload, 'resource_type'), + ]; + + $this->solution = ['resourceType' => $resourceType, 'day' => $day ?: $this->properties['day'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return DayContext Context for this DayInstance + */ + protected function proxy(): DayContext + { + if (!$this->context) { + $this->context = new DayContext( + $this->version, + $this->solution['resourceType'], + $this->solution['day'] + ); + } + + return $this->context; + } + + /** + * Fetch the DayInstance + * + * @return DayInstance Fetched DayInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DayInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Bulkexports.V1.DayInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Bulkexports/V1/Export/DayList.php b/app/api/Twilio/Rest/Bulkexports/V1/Export/DayList.php new file mode 100755 index 0000000..1cf172f --- /dev/null +++ b/app/api/Twilio/Rest/Bulkexports/V1/Export/DayList.php @@ -0,0 +1,168 @@ +solution = [ + 'resourceType' => + $resourceType, + + ]; + + $this->uri = '/Exports/' . \rawurlencode($resourceType) + .'/Days'; + } + + /** + * Reads DayInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return DayInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams DayInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of DayInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return DayPage Page of DayInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): DayPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new DayPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of DayInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return DayPage Page of DayInstance + */ + public function getPage(string $targetUrl): DayPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new DayPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a DayContext + * + * @param string $day The ISO 8601 format date of the resources in the file, for a UTC day + */ + public function getContext( + string $day + + ): DayContext + { + return new DayContext( + $this->version, + $this->solution['resourceType'], + $day + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Bulkexports.V1.DayList]'; + } +} diff --git a/app/api/Twilio/Rest/Bulkexports/V1/Export/DayPage.php b/app/api/Twilio/Rest/Bulkexports/V1/Export/DayPage.php new file mode 100755 index 0000000..e4e760f --- /dev/null +++ b/app/api/Twilio/Rest/Bulkexports/V1/Export/DayPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DayInstance \Twilio\Rest\Bulkexports\V1\Export\DayInstance + */ + public function buildInstance(array $payload): DayInstance + { + return new DayInstance($this->version, $payload, $this->solution['resourceType']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Bulkexports.V1.DayPage]'; + } +} diff --git a/app/api/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobInstance.php b/app/api/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobInstance.php new file mode 100755 index 0000000..91b63e6 --- /dev/null +++ b/app/api/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobInstance.php @@ -0,0 +1,101 @@ +properties = [ + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'resourceType' => Values::array_get($payload, 'resource_type'), + 'startDay' => Values::array_get($payload, 'start_day'), + 'endDay' => Values::array_get($payload, 'end_day'), + 'webhookUrl' => Values::array_get($payload, 'webhook_url'), + 'webhookMethod' => Values::array_get($payload, 'webhook_method'), + 'email' => Values::array_get($payload, 'email'), + 'jobSid' => Values::array_get($payload, 'job_sid'), + 'details' => Values::array_get($payload, 'details'), + 'jobQueuePosition' => Values::array_get($payload, 'job_queue_position'), + 'estimatedCompletionTime' => Values::array_get($payload, 'estimated_completion_time'), + ]; + + $this->solution = ['resourceType' => $resourceType, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Bulkexports.V1.ExportCustomJobInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobList.php b/app/api/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobList.php new file mode 100755 index 0000000..a91e68b --- /dev/null +++ b/app/api/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobList.php @@ -0,0 +1,193 @@ +solution = [ + 'resourceType' => + $resourceType, + + ]; + + $this->uri = '/Exports/' . \rawurlencode($resourceType) + .'/Jobs'; + } + + /** + * Create the ExportCustomJobInstance + * + * @param string $startDay The start day for the custom export specified as a string in the format of yyyy-mm-dd + * @param string $endDay The end day for the custom export specified as a string in the format of yyyy-mm-dd. End day is inclusive and must be 2 days earlier than the current UTC day. + * @param string $friendlyName The friendly name specified when creating the job + * @param array|Options $options Optional Arguments + * @return ExportCustomJobInstance Created ExportCustomJobInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $startDay, string $endDay, string $friendlyName, array $options = []): ExportCustomJobInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'StartDay' => + $startDay, + 'EndDay' => + $endDay, + 'FriendlyName' => + $friendlyName, + 'WebhookUrl' => + $options['webhookUrl'], + 'WebhookMethod' => + $options['webhookMethod'], + 'Email' => + $options['email'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new ExportCustomJobInstance( + $this->version, + $payload, + $this->solution['resourceType'] + ); + } + + + /** + * Reads ExportCustomJobInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ExportCustomJobInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ExportCustomJobInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ExportCustomJobInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ExportCustomJobPage Page of ExportCustomJobInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ExportCustomJobPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ExportCustomJobPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ExportCustomJobInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ExportCustomJobPage Page of ExportCustomJobInstance + */ + public function getPage(string $targetUrl): ExportCustomJobPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ExportCustomJobPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Bulkexports.V1.ExportCustomJobList]'; + } +} diff --git a/app/api/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobOptions.php b/app/api/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobOptions.php new file mode 100755 index 0000000..a89635d --- /dev/null +++ b/app/api/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobOptions.php @@ -0,0 +1,114 @@ +options['webhookUrl'] = $webhookUrl; + $this->options['webhookMethod'] = $webhookMethod; + $this->options['email'] = $email; + } + + /** + * The optional webhook url called on completion of the job. If this is supplied, `WebhookMethod` must also be supplied. If you set neither webhook nor email, you will have to check your job's status manually. + * + * @param string $webhookUrl The optional webhook url called on completion of the job. If this is supplied, `WebhookMethod` must also be supplied. If you set neither webhook nor email, you will have to check your job's status manually. + * @return $this Fluent Builder + */ + public function setWebhookUrl(string $webhookUrl): self + { + $this->options['webhookUrl'] = $webhookUrl; + return $this; + } + + /** + * This is the method used to call the webhook on completion of the job. If this is supplied, `WebhookUrl` must also be supplied. + * + * @param string $webhookMethod This is the method used to call the webhook on completion of the job. If this is supplied, `WebhookUrl` must also be supplied. + * @return $this Fluent Builder + */ + public function setWebhookMethod(string $webhookMethod): self + { + $this->options['webhookMethod'] = $webhookMethod; + return $this; + } + + /** + * The optional email to send the completion notification to. You can set both webhook, and email, or one or the other. If you set neither, the job will run but you will have to query to determine your job's status. + * + * @param string $email The optional email to send the completion notification to. You can set both webhook, and email, or one or the other. If you set neither, the job will run but you will have to query to determine your job's status. + * @return $this Fluent Builder + */ + public function setEmail(string $email): self + { + $this->options['email'] = $email; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Bulkexports.V1.CreateExportCustomJobOptions ' . $options . ']'; + } +} + + diff --git a/app/api/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobPage.php b/app/api/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobPage.php new file mode 100755 index 0000000..3ec8241 --- /dev/null +++ b/app/api/Twilio/Rest/Bulkexports/V1/Export/ExportCustomJobPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ExportCustomJobInstance \Twilio\Rest\Bulkexports\V1\Export\ExportCustomJobInstance + */ + public function buildInstance(array $payload): ExportCustomJobInstance + { + return new ExportCustomJobInstance($this->version, $payload, $this->solution['resourceType']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Bulkexports.V1.ExportCustomJobPage]'; + } +} diff --git a/app/api/Twilio/Rest/Bulkexports/V1/Export/JobContext.php b/app/api/Twilio/Rest/Bulkexports/V1/Export/JobContext.php new file mode 100755 index 0000000..153f6f0 --- /dev/null +++ b/app/api/Twilio/Rest/Bulkexports/V1/Export/JobContext.php @@ -0,0 +1,94 @@ +solution = [ + 'jobSid' => + $jobSid, + ]; + + $this->uri = '/Exports/Jobs/' . \rawurlencode($jobSid) + .''; + } + + /** + * Delete the JobInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the JobInstance + * + * @return JobInstance Fetched JobInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): JobInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new JobInstance( + $this->version, + $payload, + $this->solution['jobSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Bulkexports.V1.JobContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Bulkexports/V1/Export/JobInstance.php b/app/api/Twilio/Rest/Bulkexports/V1/Export/JobInstance.php new file mode 100755 index 0000000..9cdba57 --- /dev/null +++ b/app/api/Twilio/Rest/Bulkexports/V1/Export/JobInstance.php @@ -0,0 +1,149 @@ +properties = [ + 'resourceType' => Values::array_get($payload, 'resource_type'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'details' => Values::array_get($payload, 'details'), + 'startDay' => Values::array_get($payload, 'start_day'), + 'endDay' => Values::array_get($payload, 'end_day'), + 'jobSid' => Values::array_get($payload, 'job_sid'), + 'webhookUrl' => Values::array_get($payload, 'webhook_url'), + 'webhookMethod' => Values::array_get($payload, 'webhook_method'), + 'email' => Values::array_get($payload, 'email'), + 'url' => Values::array_get($payload, 'url'), + 'jobQueuePosition' => Values::array_get($payload, 'job_queue_position'), + 'estimatedCompletionTime' => Values::array_get($payload, 'estimated_completion_time'), + ]; + + $this->solution = ['jobSid' => $jobSid ?: $this->properties['jobSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return JobContext Context for this JobInstance + */ + protected function proxy(): JobContext + { + if (!$this->context) { + $this->context = new JobContext( + $this->version, + $this->solution['jobSid'] + ); + } + + return $this->context; + } + + /** + * Delete the JobInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the JobInstance + * + * @return JobInstance Fetched JobInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): JobInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Bulkexports.V1.JobInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Bulkexports/V1/Export/JobList.php b/app/api/Twilio/Rest/Bulkexports/V1/Export/JobList.php new file mode 100755 index 0000000..ce412d3 --- /dev/null +++ b/app/api/Twilio/Rest/Bulkexports/V1/Export/JobList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a JobContext + * + * @param string $jobSid The unique string that that we created to identify the Bulk Export job + */ + public function getContext( + string $jobSid + + ): JobContext + { + return new JobContext( + $this->version, + $jobSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Bulkexports.V1.JobList]'; + } +} diff --git a/app/api/Twilio/Rest/Bulkexports/V1/Export/JobPage.php b/app/api/Twilio/Rest/Bulkexports/V1/Export/JobPage.php new file mode 100755 index 0000000..c52caeb --- /dev/null +++ b/app/api/Twilio/Rest/Bulkexports/V1/Export/JobPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return JobInstance \Twilio\Rest\Bulkexports\V1\Export\JobInstance + */ + public function buildInstance(array $payload): JobInstance + { + return new JobInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Bulkexports.V1.JobPage]'; + } +} diff --git a/app/api/Twilio/Rest/Bulkexports/V1/ExportConfigurationContext.php b/app/api/Twilio/Rest/Bulkexports/V1/ExportConfigurationContext.php new file mode 100755 index 0000000..637ac20 --- /dev/null +++ b/app/api/Twilio/Rest/Bulkexports/V1/ExportConfigurationContext.php @@ -0,0 +1,115 @@ +solution = [ + 'resourceType' => + $resourceType, + ]; + + $this->uri = '/Exports/' . \rawurlencode($resourceType) + .'/Configuration'; + } + + /** + * Fetch the ExportConfigurationInstance + * + * @return ExportConfigurationInstance Fetched ExportConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExportConfigurationInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ExportConfigurationInstance( + $this->version, + $payload, + $this->solution['resourceType'] + ); + } + + + /** + * Update the ExportConfigurationInstance + * + * @param array|Options $options Optional Arguments + * @return ExportConfigurationInstance Updated ExportConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ExportConfigurationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Enabled' => + Serialize::booleanToString($options['enabled']), + 'WebhookUrl' => + $options['webhookUrl'], + 'WebhookMethod' => + $options['webhookMethod'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new ExportConfigurationInstance( + $this->version, + $payload, + $this->solution['resourceType'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Bulkexports.V1.ExportConfigurationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Bulkexports/V1/ExportConfigurationInstance.php b/app/api/Twilio/Rest/Bulkexports/V1/ExportConfigurationInstance.php new file mode 100755 index 0000000..acc9447 --- /dev/null +++ b/app/api/Twilio/Rest/Bulkexports/V1/ExportConfigurationInstance.php @@ -0,0 +1,137 @@ +properties = [ + 'enabled' => Values::array_get($payload, 'enabled'), + 'webhookUrl' => Values::array_get($payload, 'webhook_url'), + 'webhookMethod' => Values::array_get($payload, 'webhook_method'), + 'resourceType' => Values::array_get($payload, 'resource_type'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['resourceType' => $resourceType ?: $this->properties['resourceType'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ExportConfigurationContext Context for this ExportConfigurationInstance + */ + protected function proxy(): ExportConfigurationContext + { + if (!$this->context) { + $this->context = new ExportConfigurationContext( + $this->version, + $this->solution['resourceType'] + ); + } + + return $this->context; + } + + /** + * Fetch the ExportConfigurationInstance + * + * @return ExportConfigurationInstance Fetched ExportConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExportConfigurationInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ExportConfigurationInstance + * + * @param array|Options $options Optional Arguments + * @return ExportConfigurationInstance Updated ExportConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ExportConfigurationInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Bulkexports.V1.ExportConfigurationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Bulkexports/V1/ExportConfigurationList.php b/app/api/Twilio/Rest/Bulkexports/V1/ExportConfigurationList.php new file mode 100755 index 0000000..5aa9469 --- /dev/null +++ b/app/api/Twilio/Rest/Bulkexports/V1/ExportConfigurationList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a ExportConfigurationContext + * + * @param string $resourceType The type of communication – Messages, Calls, Conferences, and Participants + */ + public function getContext( + string $resourceType + + ): ExportConfigurationContext + { + return new ExportConfigurationContext( + $this->version, + $resourceType + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Bulkexports.V1.ExportConfigurationList]'; + } +} diff --git a/app/api/Twilio/Rest/Bulkexports/V1/ExportConfigurationOptions.php b/app/api/Twilio/Rest/Bulkexports/V1/ExportConfigurationOptions.php new file mode 100755 index 0000000..b70db77 --- /dev/null +++ b/app/api/Twilio/Rest/Bulkexports/V1/ExportConfigurationOptions.php @@ -0,0 +1,114 @@ +options['enabled'] = $enabled; + $this->options['webhookUrl'] = $webhookUrl; + $this->options['webhookMethod'] = $webhookMethod; + } + + /** + * If true, Twilio will automatically generate every day's file when the day is over. + * + * @param bool $enabled If true, Twilio will automatically generate every day's file when the day is over. + * @return $this Fluent Builder + */ + public function setEnabled(bool $enabled): self + { + $this->options['enabled'] = $enabled; + return $this; + } + + /** + * Stores the URL destination for the method specified in webhook_method. + * + * @param string $webhookUrl Stores the URL destination for the method specified in webhook_method. + * @return $this Fluent Builder + */ + public function setWebhookUrl(string $webhookUrl): self + { + $this->options['webhookUrl'] = $webhookUrl; + return $this; + } + + /** + * Sets whether Twilio should call a webhook URL when the automatic generation is complete, using GET or POST. The actual destination is set in the webhook_url + * + * @param string $webhookMethod Sets whether Twilio should call a webhook URL when the automatic generation is complete, using GET or POST. The actual destination is set in the webhook_url + * @return $this Fluent Builder + */ + public function setWebhookMethod(string $webhookMethod): self + { + $this->options['webhookMethod'] = $webhookMethod; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Bulkexports.V1.UpdateExportConfigurationOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Bulkexports/V1/ExportConfigurationPage.php b/app/api/Twilio/Rest/Bulkexports/V1/ExportConfigurationPage.php new file mode 100755 index 0000000..8cb9b3c --- /dev/null +++ b/app/api/Twilio/Rest/Bulkexports/V1/ExportConfigurationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ExportConfigurationInstance \Twilio\Rest\Bulkexports\V1\ExportConfigurationInstance + */ + public function buildInstance(array $payload): ExportConfigurationInstance + { + return new ExportConfigurationInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Bulkexports.V1.ExportConfigurationPage]'; + } +} diff --git a/app/api/Twilio/Rest/Bulkexports/V1/ExportContext.php b/app/api/Twilio/Rest/Bulkexports/V1/ExportContext.php new file mode 100755 index 0000000..cac8082 --- /dev/null +++ b/app/api/Twilio/Rest/Bulkexports/V1/ExportContext.php @@ -0,0 +1,157 @@ +solution = [ + 'resourceType' => + $resourceType, + ]; + + $this->uri = '/Exports/' . \rawurlencode($resourceType) + .''; + } + + /** + * Fetch the ExportInstance + * + * @return ExportInstance Fetched ExportInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExportInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ExportInstance( + $this->version, + $payload, + $this->solution['resourceType'] + ); + } + + + /** + * Access the exportCustomJobs + */ + protected function getExportCustomJobs(): ExportCustomJobList + { + if (!$this->_exportCustomJobs) { + $this->_exportCustomJobs = new ExportCustomJobList( + $this->version, + $this->solution['resourceType'] + ); + } + + return $this->_exportCustomJobs; + } + + /** + * Access the days + */ + protected function getDays(): DayList + { + if (!$this->_days) { + $this->_days = new DayList( + $this->version, + $this->solution['resourceType'] + ); + } + + return $this->_days; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Bulkexports.V1.ExportContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Bulkexports/V1/ExportInstance.php b/app/api/Twilio/Rest/Bulkexports/V1/ExportInstance.php new file mode 100755 index 0000000..29f2228 --- /dev/null +++ b/app/api/Twilio/Rest/Bulkexports/V1/ExportInstance.php @@ -0,0 +1,140 @@ +properties = [ + 'resourceType' => Values::array_get($payload, 'resource_type'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['resourceType' => $resourceType ?: $this->properties['resourceType'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ExportContext Context for this ExportInstance + */ + protected function proxy(): ExportContext + { + if (!$this->context) { + $this->context = new ExportContext( + $this->version, + $this->solution['resourceType'] + ); + } + + return $this->context; + } + + /** + * Fetch the ExportInstance + * + * @return ExportInstance Fetched ExportInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExportInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the exportCustomJobs + */ + protected function getExportCustomJobs(): ExportCustomJobList + { + return $this->proxy()->exportCustomJobs; + } + + /** + * Access the days + */ + protected function getDays(): DayList + { + return $this->proxy()->days; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Bulkexports.V1.ExportInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Bulkexports/V1/ExportList.php b/app/api/Twilio/Rest/Bulkexports/V1/ExportList.php new file mode 100755 index 0000000..fea8ea6 --- /dev/null +++ b/app/api/Twilio/Rest/Bulkexports/V1/ExportList.php @@ -0,0 +1,122 @@ +solution = [ + ]; + } + + /** + * Constructs a ExportContext + * + * @param string $resourceType The type of communication – Messages, Calls, Conferences, and Participants + */ + public function getContext( + string $resourceType + + ): ExportContext + { + return new ExportContext( + $this->version, + $resourceType + ); + } + + /** + * Access the jobs + */ + protected function getJobs(): JobList + { + if (!$this->_jobs) { + $this->_jobs = new JobList( + $this->version + ); + } + return $this->_jobs; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name) + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Bulkexports.V1.ExportList]'; + } +} diff --git a/app/api/Twilio/Rest/Bulkexports/V1/ExportPage.php b/app/api/Twilio/Rest/Bulkexports/V1/ExportPage.php new file mode 100755 index 0000000..a5ff770 --- /dev/null +++ b/app/api/Twilio/Rest/Bulkexports/V1/ExportPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ExportInstance \Twilio\Rest\Bulkexports\V1\ExportInstance + */ + public function buildInstance(array $payload): ExportInstance + { + return new ExportInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Bulkexports.V1.ExportPage]'; + } +} diff --git a/app/api/Twilio/Rest/BulkexportsBase.php b/app/api/Twilio/Rest/BulkexportsBase.php new file mode 100755 index 0000000..19505ab --- /dev/null +++ b/app/api/Twilio/Rest/BulkexportsBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://bulkexports.twilio.com'; + } + + + /** + * @return V1 Version v1 of bulkexports + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Bulkexports]'; + } +} diff --git a/app/api/Twilio/Rest/Chat.php b/app/api/Twilio/Rest/Chat.php new file mode 100755 index 0000000..0d88cc0 --- /dev/null +++ b/app/api/Twilio/Rest/Chat.php @@ -0,0 +1,60 @@ +credentials instead. + */ + protected function getCredentials(): \Twilio\Rest\Chat\V2\CredentialList { + echo "credentials is deprecated. Use v2->credentials instead."; + return $this->v2->credentials; + } + + /** + * @deprecated Use v2->credentials(\$sid) instead. + * @param string $sid The SID of the Credential resource to fetch + */ + protected function contextCredentials(string $sid): \Twilio\Rest\Chat\V2\CredentialContext { + echo "credentials(\$sid) is deprecated. Use v2->credentials(\$sid) instead."; + return $this->v2->credentials($sid); + } + + /** + * @deprecated Use v2->services instead. + */ + protected function getServices(): \Twilio\Rest\Chat\V2\ServiceList { + echo "services is deprecated. Use v2->services instead."; + return $this->v2->services; + } + + /** + * @deprecated Use v2->services(\$sid) instead. + * @param string $sid The SID of the Service resource to fetch + */ + protected function contextServices(string $sid): \Twilio\Rest\Chat\V2\ServiceContext { + echo "services(\$sid) is deprecated. Use v2->services(\$sid) instead."; + return $this->v2->services($sid); + } + + /** + * @deprecated Use v3->channels instead. + */ + protected function getChannels(): \Twilio\Rest\Chat\V3\ChannelList { + echo "channels is deprecated. Use v3->channels instead."; + return $this->v3->channels; + } + + /** + * @deprecated Use v3->channels(\$serviceSid, \$sid) instead. + * @param string $serviceSid Service Sid. + * @param string $sid A string that uniquely identifies this Channel. + */ + protected function contextChannels(string $serviceSid, string $sid): \Twilio\Rest\Chat\V3\ChannelContext { + echo "channels(\$serviceSid, \$sid) is deprecated. Use v3->channels(\$serviceSid, \$sid) instead."; + return $this->v3->channels($serviceSid, $sid); + } +} \ No newline at end of file diff --git a/app/api/Twilio/Rest/Chat/V1.php b/app/api/Twilio/Rest/Chat/V1.php new file mode 100755 index 0000000..c66fa2b --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1.php @@ -0,0 +1,107 @@ +version = 'v1'; + } + + protected function getCredentials(): CredentialList + { + if (!$this->_credentials) { + $this->_credentials = new CredentialList($this); + } + return $this->_credentials; + } + + protected function getServices(): ServiceList + { + if (!$this->_services) { + $this->_services = new ServiceList($this); + } + return $this->_services; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V1]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V1/CredentialContext.php b/app/api/Twilio/Rest/Chat/V1/CredentialContext.php new file mode 100755 index 0000000..b0b6e4e --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/CredentialContext.php @@ -0,0 +1,134 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Credentials/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the CredentialInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the CredentialInstance + * + * @return CredentialInstance Fetched CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new CredentialInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the CredentialInstance + * + * @param array|Options $options Optional Arguments + * @return CredentialInstance Updated CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CredentialInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'Certificate' => + $options['certificate'], + 'PrivateKey' => + $options['privateKey'], + 'Sandbox' => + Serialize::booleanToString($options['sandbox']), + 'ApiKey' => + $options['apiKey'], + 'Secret' => + $options['secret'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new CredentialInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V1.CredentialContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V1/CredentialInstance.php b/app/api/Twilio/Rest/Chat/V1/CredentialInstance.php new file mode 100755 index 0000000..59a2b6a --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/CredentialInstance.php @@ -0,0 +1,156 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'type' => Values::array_get($payload, 'type'), + 'sandbox' => Values::array_get($payload, 'sandbox'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CredentialContext Context for this CredentialInstance + */ + protected function proxy(): CredentialContext + { + if (!$this->context) { + $this->context = new CredentialContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the CredentialInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the CredentialInstance + * + * @return CredentialInstance Fetched CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the CredentialInstance + * + * @param array|Options $options Optional Arguments + * @return CredentialInstance Updated CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CredentialInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V1.CredentialInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V1/CredentialList.php b/app/api/Twilio/Rest/Chat/V1/CredentialList.php new file mode 100755 index 0000000..5721d21 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/CredentialList.php @@ -0,0 +1,203 @@ +solution = [ + ]; + + $this->uri = '/Credentials'; + } + + /** + * Create the CredentialInstance + * + * @param string $type + * @param array|Options $options Optional Arguments + * @return CredentialInstance Created CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $type, array $options = []): CredentialInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Type' => + $type, + 'FriendlyName' => + $options['friendlyName'], + 'Certificate' => + $options['certificate'], + 'PrivateKey' => + $options['privateKey'], + 'Sandbox' => + Serialize::booleanToString($options['sandbox']), + 'ApiKey' => + $options['apiKey'], + 'Secret' => + $options['secret'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new CredentialInstance( + $this->version, + $payload + ); + } + + + /** + * Reads CredentialInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return CredentialInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams CredentialInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CredentialInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return CredentialPage Page of CredentialInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CredentialPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new CredentialPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of CredentialInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return CredentialPage Page of CredentialInstance + */ + public function getPage(string $targetUrl): CredentialPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CredentialPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CredentialContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Credential resource to delete. + */ + public function getContext( + string $sid + + ): CredentialContext + { + return new CredentialContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V1.CredentialList]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V1/CredentialOptions.php b/app/api/Twilio/Rest/Chat/V1/CredentialOptions.php new file mode 100755 index 0000000..6321fc9 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/CredentialOptions.php @@ -0,0 +1,314 @@ +options['friendlyName'] = $friendlyName; + $this->options['certificate'] = $certificate; + $this->options['privateKey'] = $privateKey; + $this->options['sandbox'] = $sandbox; + $this->options['apiKey'] = $apiKey; + $this->options['secret'] = $secret; + } + + /** + * A descriptive string that you create to describe the new resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A== -----END CERTIFICATE-----` + * + * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A== -----END CERTIFICATE-----` + * @return $this Fluent Builder + */ + public function setCertificate(string $certificate): self + { + $this->options['certificate'] = $certificate; + return $this; + } + + /** + * [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR. -----END RSA PRIVATE KEY-----` + * + * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR. -----END RSA PRIVATE KEY-----` + * @return $this Fluent Builder + */ + public function setPrivateKey(string $privateKey): self + { + $this->options['privateKey'] = $privateKey; + return $this; + } + + /** + * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * + * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * @return $this Fluent Builder + */ + public function setSandbox(bool $sandbox): self + { + $this->options['sandbox'] = $sandbox; + return $this; + } + + /** + * [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. + * + * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. + * @return $this Fluent Builder + */ + public function setApiKey(string $apiKey): self + { + $this->options['apiKey'] = $apiKey; + return $this; + } + + /** + * [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. + * + * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. + * @return $this Fluent Builder + */ + public function setSecret(string $secret): self + { + $this->options['secret'] = $secret; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V1.CreateCredentialOptions ' . $options . ']'; + } +} + + + + +class UpdateCredentialOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A== -----END CERTIFICATE-----` + * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR. -----END RSA PRIVATE KEY-----` + * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. + * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $certificate = Values::NONE, + string $privateKey = Values::NONE, + bool $sandbox = Values::BOOL_NONE, + string $apiKey = Values::NONE, + string $secret = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['certificate'] = $certificate; + $this->options['privateKey'] = $privateKey; + $this->options['sandbox'] = $sandbox; + $this->options['apiKey'] = $apiKey; + $this->options['secret'] = $secret; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A== -----END CERTIFICATE-----` + * + * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A== -----END CERTIFICATE-----` + * @return $this Fluent Builder + */ + public function setCertificate(string $certificate): self + { + $this->options['certificate'] = $certificate; + return $this; + } + + /** + * [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR. -----END RSA PRIVATE KEY-----` + * + * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR. -----END RSA PRIVATE KEY-----` + * @return $this Fluent Builder + */ + public function setPrivateKey(string $privateKey): self + { + $this->options['privateKey'] = $privateKey; + return $this; + } + + /** + * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * + * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * @return $this Fluent Builder + */ + public function setSandbox(bool $sandbox): self + { + $this->options['sandbox'] = $sandbox; + return $this; + } + + /** + * [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. + * + * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. + * @return $this Fluent Builder + */ + public function setApiKey(string $apiKey): self + { + $this->options['apiKey'] = $apiKey; + return $this; + } + + /** + * [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. + * + * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. + * @return $this Fluent Builder + */ + public function setSecret(string $secret): self + { + $this->options['secret'] = $secret; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V1.UpdateCredentialOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V1/CredentialPage.php b/app/api/Twilio/Rest/Chat/V1/CredentialPage.php new file mode 100755 index 0000000..2f3d37d --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/CredentialPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CredentialInstance \Twilio\Rest\Chat\V1\CredentialInstance + */ + public function buildInstance(array $payload): CredentialInstance + { + return new CredentialInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V1.CredentialPage]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V1/Service/Channel/InviteContext.php b/app/api/Twilio/Rest/Chat/V1/Service/Channel/InviteContext.php new file mode 100755 index 0000000..0d61846 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/Service/Channel/InviteContext.php @@ -0,0 +1,106 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'channelSid' => + $channelSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Invites/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the InviteInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the InviteInstance + * + * @return InviteInstance Fetched InviteInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InviteInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new InviteInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V1.InviteContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V1/Service/Channel/InviteInstance.php b/app/api/Twilio/Rest/Chat/V1/Service/Channel/InviteInstance.php new file mode 100755 index 0000000..4fd6b80 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/Service/Channel/InviteInstance.php @@ -0,0 +1,150 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'channelSid' => Values::array_get($payload, 'channel_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'roleSid' => Values::array_get($payload, 'role_sid'), + 'createdBy' => Values::array_get($payload, 'created_by'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return InviteContext Context for this InviteInstance + */ + protected function proxy(): InviteContext + { + if (!$this->context) { + $this->context = new InviteContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the InviteInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the InviteInstance + * + * @return InviteInstance Fetched InviteInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InviteInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V1.InviteInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V1/Service/Channel/InviteList.php b/app/api/Twilio/Rest/Chat/V1/Service/Channel/InviteList.php new file mode 100755 index 0000000..bce5816 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/Service/Channel/InviteList.php @@ -0,0 +1,215 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'channelSid' => + $channelSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Invites'; + } + + /** + * Create the InviteInstance + * + * @param string $identity The `identity` value that uniquely identifies the new resource's [User](https://www.twilio.com/docs/api/chat/rest/v1/user) within the [Service](https://www.twilio.com/docs/api/chat/rest/v1/service). See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more info. + * @param array|Options $options Optional Arguments + * @return InviteInstance Created InviteInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $identity, array $options = []): InviteInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Identity' => + $identity, + 'RoleSid' => + $options['roleSid'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new InviteInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'] + ); + } + + + /** + * Reads InviteInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return InviteInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams InviteInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of InviteInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return InvitePage Page of InviteInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): InvitePage + { + $options = new Values($options); + + $params = Values::of([ + 'Identity' => + Serialize::map($options['identity'], function ($e) { return $e; }), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new InvitePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of InviteInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return InvitePage Page of InviteInstance + */ + public function getPage(string $targetUrl): InvitePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new InvitePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a InviteContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Invite resource to delete. + */ + public function getContext( + string $sid + + ): InviteContext + { + return new InviteContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V1.InviteList]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V1/Service/Channel/InviteOptions.php b/app/api/Twilio/Rest/Chat/V1/Service/Channel/InviteOptions.php new file mode 100755 index 0000000..ae9a994 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/Service/Channel/InviteOptions.php @@ -0,0 +1,132 @@ +options['roleSid'] = $roleSid; + } + + /** + * The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to the new member. + * + * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to the new member. + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V1.CreateInviteOptions ' . $options . ']'; + } +} + + + +class ReadInviteOptions extends Options + { + /** + * @param string[] $identity The [User](https://www.twilio.com/docs/api/chat/rest/v1/user)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. + */ + public function __construct( + + array $identity = Values::ARRAY_NONE + + ) { + $this->options['identity'] = $identity; + } + + /** + * The [User](https://www.twilio.com/docs/api/chat/rest/v1/user)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. + * + * @param string[] $identity The [User](https://www.twilio.com/docs/api/chat/rest/v1/user)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. + * @return $this Fluent Builder + */ + public function setIdentity(array $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V1.ReadInviteOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V1/Service/Channel/InvitePage.php b/app/api/Twilio/Rest/Chat/V1/Service/Channel/InvitePage.php new file mode 100755 index 0000000..bb2a9de --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/Service/Channel/InvitePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InviteInstance \Twilio\Rest\Chat\V1\Service\Channel\InviteInstance + */ + public function buildInstance(array $payload): InviteInstance + { + return new InviteInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V1.InvitePage]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V1/Service/Channel/MemberContext.php b/app/api/Twilio/Rest/Chat/V1/Service/Channel/MemberContext.php new file mode 100755 index 0000000..d3bbdd6 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/Service/Channel/MemberContext.php @@ -0,0 +1,139 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'channelSid' => + $channelSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Members/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the MemberInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the MemberInstance + * + * @return MemberInstance Fetched MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MemberInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new MemberInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the MemberInstance + * + * @param array|Options $options Optional Arguments + * @return MemberInstance Updated MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MemberInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'RoleSid' => + $options['roleSid'], + 'LastConsumedMessageIndex' => + $options['lastConsumedMessageIndex'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new MemberInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V1.MemberContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V1/Service/Channel/MemberInstance.php b/app/api/Twilio/Rest/Chat/V1/Service/Channel/MemberInstance.php new file mode 100755 index 0000000..e684b44 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/Service/Channel/MemberInstance.php @@ -0,0 +1,166 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'channelSid' => Values::array_get($payload, 'channel_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'roleSid' => Values::array_get($payload, 'role_sid'), + 'lastConsumedMessageIndex' => Values::array_get($payload, 'last_consumed_message_index'), + 'lastConsumptionTimestamp' => Deserialize::dateTime(Values::array_get($payload, 'last_consumption_timestamp')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return MemberContext Context for this MemberInstance + */ + protected function proxy(): MemberContext + { + if (!$this->context) { + $this->context = new MemberContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the MemberInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the MemberInstance + * + * @return MemberInstance Fetched MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MemberInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the MemberInstance + * + * @param array|Options $options Optional Arguments + * @return MemberInstance Updated MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MemberInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V1.MemberInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V1/Service/Channel/MemberList.php b/app/api/Twilio/Rest/Chat/V1/Service/Channel/MemberList.php new file mode 100755 index 0000000..9215dd0 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/Service/Channel/MemberList.php @@ -0,0 +1,215 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'channelSid' => + $channelSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Members'; + } + + /** + * Create the MemberInstance + * + * @param string $identity The `identity` value that uniquely identifies the new resource's [User](https://www.twilio.com/docs/api/chat/rest/v1/user) within the [Service](https://www.twilio.com/docs/api/chat/rest/services). See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. + * @param array|Options $options Optional Arguments + * @return MemberInstance Created MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $identity, array $options = []): MemberInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Identity' => + $identity, + 'RoleSid' => + $options['roleSid'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new MemberInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'] + ); + } + + + /** + * Reads MemberInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return MemberInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams MemberInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of MemberInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return MemberPage Page of MemberInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MemberPage + { + $options = new Values($options); + + $params = Values::of([ + 'Identity' => + Serialize::map($options['identity'], function ($e) { return $e; }), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new MemberPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of MemberInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return MemberPage Page of MemberInstance + */ + public function getPage(string $targetUrl): MemberPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new MemberPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a MemberContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Member resource to delete. + */ + public function getContext( + string $sid + + ): MemberContext + { + return new MemberContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V1.MemberList]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V1/Service/Channel/MemberOptions.php b/app/api/Twilio/Rest/Chat/V1/Service/Channel/MemberOptions.php new file mode 100755 index 0000000..c121d76 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/Service/Channel/MemberOptions.php @@ -0,0 +1,202 @@ +options['roleSid'] = $roleSid; + } + + /** + * The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/api/services). + * + * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/api/services). + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V1.CreateMemberOptions ' . $options . ']'; + } +} + + + +class ReadMemberOptions extends Options + { + /** + * @param string[] $identity The [User](https://www.twilio.com/docs/api/chat/rest/v1/user)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. + */ + public function __construct( + + array $identity = Values::ARRAY_NONE + + ) { + $this->options['identity'] = $identity; + } + + /** + * The [User](https://www.twilio.com/docs/api/chat/rest/v1/user)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. + * + * @param string[] $identity The [User](https://www.twilio.com/docs/api/chat/rest/v1/user)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/api/chat/guides/create-tokens) for more details. + * @return $this Fluent Builder + */ + public function setIdentity(array $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V1.ReadMemberOptions ' . $options . ']'; + } +} + +class UpdateMemberOptions extends Options + { + /** + * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/api/services). + * @param int $lastConsumedMessageIndex The index of the last [Message](https://www.twilio.com/docs/api/chat/rest/messages) that the Member has read within the [Channel](https://www.twilio.com/docs/api/chat/rest/channels). + */ + public function __construct( + + string $roleSid = Values::NONE, + int $lastConsumedMessageIndex = Values::INT_NONE + + ) { + $this->options['roleSid'] = $roleSid; + $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; + } + + /** + * The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/api/services). + * + * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/api/services). + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * The index of the last [Message](https://www.twilio.com/docs/api/chat/rest/messages) that the Member has read within the [Channel](https://www.twilio.com/docs/api/chat/rest/channels). + * + * @param int $lastConsumedMessageIndex The index of the last [Message](https://www.twilio.com/docs/api/chat/rest/messages) that the Member has read within the [Channel](https://www.twilio.com/docs/api/chat/rest/channels). + * @return $this Fluent Builder + */ + public function setLastConsumedMessageIndex(int $lastConsumedMessageIndex): self + { + $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V1.UpdateMemberOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V1/Service/Channel/MemberPage.php b/app/api/Twilio/Rest/Chat/V1/Service/Channel/MemberPage.php new file mode 100755 index 0000000..aaf9e41 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/Service/Channel/MemberPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MemberInstance \Twilio\Rest\Chat\V1\Service\Channel\MemberInstance + */ + public function buildInstance(array $payload): MemberInstance + { + return new MemberInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V1.MemberPage]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V1/Service/Channel/MessageContext.php b/app/api/Twilio/Rest/Chat/V1/Service/Channel/MessageContext.php new file mode 100755 index 0000000..6a85a50 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/Service/Channel/MessageContext.php @@ -0,0 +1,139 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'channelSid' => + $channelSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Messages/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the MessageInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the MessageInstance + * + * @return MessageInstance Fetched MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MessageInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new MessageInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return MessageInstance Updated MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MessageInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Body' => + $options['body'], + 'Attributes' => + $options['attributes'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new MessageInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V1.MessageContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V1/Service/Channel/MessageInstance.php b/app/api/Twilio/Rest/Chat/V1/Service/Channel/MessageInstance.php new file mode 100755 index 0000000..39c3f0d --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/Service/Channel/MessageInstance.php @@ -0,0 +1,170 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'to' => Values::array_get($payload, 'to'), + 'channelSid' => Values::array_get($payload, 'channel_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'wasEdited' => Values::array_get($payload, 'was_edited'), + 'from' => Values::array_get($payload, 'from'), + 'body' => Values::array_get($payload, 'body'), + 'index' => Values::array_get($payload, 'index'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return MessageContext Context for this MessageInstance + */ + protected function proxy(): MessageContext + { + if (!$this->context) { + $this->context = new MessageContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the MessageInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the MessageInstance + * + * @return MessageInstance Fetched MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MessageInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return MessageInstance Updated MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MessageInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V1.MessageInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V1/Service/Channel/MessageList.php b/app/api/Twilio/Rest/Chat/V1/Service/Channel/MessageList.php new file mode 100755 index 0000000..62c73c1 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/Service/Channel/MessageList.php @@ -0,0 +1,216 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'channelSid' => + $channelSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Messages'; + } + + /** + * Create the MessageInstance + * + * @param string $body The message to send to the channel. Can also be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. + * @param array|Options $options Optional Arguments + * @return MessageInstance Created MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $body, array $options = []): MessageInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Body' => + $body, + 'From' => + $options['from'], + 'Attributes' => + $options['attributes'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new MessageInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'] + ); + } + + + /** + * Reads MessageInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return MessageInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams MessageInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of MessageInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return MessagePage Page of MessageInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MessagePage + { + $options = new Values($options); + + $params = Values::of([ + 'Order' => + $options['order'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new MessagePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of MessageInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return MessagePage Page of MessageInstance + */ + public function getPage(string $targetUrl): MessagePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new MessagePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a MessageContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Message resource to delete. + */ + public function getContext( + string $sid + + ): MessageContext + { + return new MessageContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V1.MessageList]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V1/Service/Channel/MessageOptions.php b/app/api/Twilio/Rest/Chat/V1/Service/Channel/MessageOptions.php new file mode 100755 index 0000000..9f3ad45 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/Service/Channel/MessageOptions.php @@ -0,0 +1,220 @@ +options['from'] = $from; + $this->options['attributes'] = $attributes; + } + + /** + * The [identity](https://www.twilio.com/docs/api/chat/guides/identity) of the new message's author. The default value is `system`. + * + * @param string $from The [identity](https://www.twilio.com/docs/api/chat/guides/identity) of the new message's author. The default value is `system`. + * @return $this Fluent Builder + */ + public function setFrom(string $from): self + { + $this->options['from'] = $from; + return $this; + } + + /** + * A valid JSON string that contains application-specific data. + * + * @param string $attributes A valid JSON string that contains application-specific data. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V1.CreateMessageOptions ' . $options . ']'; + } +} + + + +class ReadMessageOptions extends Options + { + /** + * @param string $order The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending) with `asc` as the default. + */ + public function __construct( + + string $order = Values::NONE + + ) { + $this->options['order'] = $order; + } + + /** + * The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending) with `asc` as the default. + * + * @param string $order The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending) with `asc` as the default. + * @return $this Fluent Builder + */ + public function setOrder(string $order): self + { + $this->options['order'] = $order; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V1.ReadMessageOptions ' . $options . ']'; + } +} + +class UpdateMessageOptions extends Options + { + /** + * @param string $body The message to send to the channel. Can also be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. + * @param string $attributes A valid JSON string that contains application-specific data. + */ + public function __construct( + + string $body = Values::NONE, + string $attributes = Values::NONE + + ) { + $this->options['body'] = $body; + $this->options['attributes'] = $attributes; + } + + /** + * The message to send to the channel. Can also be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. + * + * @param string $body The message to send to the channel. Can also be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. + * @return $this Fluent Builder + */ + public function setBody(string $body): self + { + $this->options['body'] = $body; + return $this; + } + + /** + * A valid JSON string that contains application-specific data. + * + * @param string $attributes A valid JSON string that contains application-specific data. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V1.UpdateMessageOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V1/Service/Channel/MessagePage.php b/app/api/Twilio/Rest/Chat/V1/Service/Channel/MessagePage.php new file mode 100755 index 0000000..d2d0b71 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/Service/Channel/MessagePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MessageInstance \Twilio\Rest\Chat\V1\Service\Channel\MessageInstance + */ + public function buildInstance(array $payload): MessageInstance + { + return new MessageInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V1.MessagePage]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V1/Service/ChannelContext.php b/app/api/Twilio/Rest/Chat/V1/Service/ChannelContext.php new file mode 100755 index 0000000..9a7f3d4 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/Service/ChannelContext.php @@ -0,0 +1,233 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ChannelInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the ChannelInstance + * + * @return ChannelInstance Fetched ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ChannelInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ChannelInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ChannelInstance + * + * @param array|Options $options Optional Arguments + * @return ChannelInstance Updated ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ChannelInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'UniqueName' => + $options['uniqueName'], + 'Attributes' => + $options['attributes'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new ChannelInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the members + */ + protected function getMembers(): MemberList + { + if (!$this->_members) { + $this->_members = new MemberList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_members; + } + + /** + * Access the invites + */ + protected function getInvites(): InviteList + { + if (!$this->_invites) { + $this->_invites = new InviteList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_invites; + } + + /** + * Access the messages + */ + protected function getMessages(): MessageList + { + if (!$this->_messages) { + $this->_messages = new MessageList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_messages; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V1.ChannelContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V1/Service/ChannelInstance.php b/app/api/Twilio/Rest/Chat/V1/Service/ChannelInstance.php new file mode 100755 index 0000000..2efb669 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/Service/ChannelInstance.php @@ -0,0 +1,201 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'type' => Values::array_get($payload, 'type'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'createdBy' => Values::array_get($payload, 'created_by'), + 'membersCount' => Values::array_get($payload, 'members_count'), + 'messagesCount' => Values::array_get($payload, 'messages_count'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ChannelContext Context for this ChannelInstance + */ + protected function proxy(): ChannelContext + { + if (!$this->context) { + $this->context = new ChannelContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ChannelInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ChannelInstance + * + * @return ChannelInstance Fetched ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ChannelInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ChannelInstance + * + * @param array|Options $options Optional Arguments + * @return ChannelInstance Updated ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ChannelInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the members + */ + protected function getMembers(): MemberList + { + return $this->proxy()->members; + } + + /** + * Access the invites + */ + protected function getInvites(): InviteList + { + return $this->proxy()->invites; + } + + /** + * Access the messages + */ + protected function getMessages(): MessageList + { + return $this->proxy()->messages; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V1.ChannelInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V1/Service/ChannelList.php b/app/api/Twilio/Rest/Chat/V1/Service/ChannelList.php new file mode 100755 index 0000000..a2bf36f --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/Service/ChannelList.php @@ -0,0 +1,209 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels'; + } + + /** + * Create the ChannelInstance + * + * @param array|Options $options Optional Arguments + * @return ChannelInstance Created ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): ChannelInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'UniqueName' => + $options['uniqueName'], + 'Attributes' => + $options['attributes'], + 'Type' => + $options['type'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new ChannelInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads ChannelInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ChannelInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams ChannelInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ChannelInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ChannelPage Page of ChannelInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ChannelPage + { + $options = new Values($options); + + $params = Values::of([ + 'Type' => + $options['type'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ChannelPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ChannelInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ChannelPage Page of ChannelInstance + */ + public function getPage(string $targetUrl): ChannelPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ChannelPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ChannelContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Channel resource to delete. + */ + public function getContext( + string $sid + + ): ChannelContext + { + return new ChannelContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V1.ChannelList]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V1/Service/ChannelOptions.php b/app/api/Twilio/Rest/Chat/V1/Service/ChannelOptions.php new file mode 100755 index 0000000..a35988a --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/Service/ChannelOptions.php @@ -0,0 +1,272 @@ +options['friendlyName'] = $friendlyName; + $this->options['uniqueName'] = $uniqueName; + $this->options['attributes'] = $attributes; + $this->options['type'] = $type; + } + + /** + * A descriptive string that you create to describe the new resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * A valid JSON string that contains application-specific data. + * + * @param string $attributes A valid JSON string that contains application-specific data. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * @param string $type + * @return $this Fluent Builder + */ + public function setType(string $type): self + { + $this->options['type'] = $type; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V1.CreateChannelOptions ' . $options . ']'; + } +} + + + +class ReadChannelOptions extends Options + { + /** + * @param string $type The visibility of the Channels to read. Can be: `public` or `private` and defaults to `public`. + */ + public function __construct( + + array $type = Values::ARRAY_NONE + + ) { + $this->options['type'] = $type; + } + + /** + * The visibility of the Channels to read. Can be: `public` or `private` and defaults to `public`. + * + * @param string $type The visibility of the Channels to read. Can be: `public` or `private` and defaults to `public`. + * @return $this Fluent Builder + */ + public function setType(array $type): self + { + $this->options['type'] = $type; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V1.ReadChannelOptions ' . $options . ']'; + } +} + +class UpdateChannelOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. + * @param string $attributes A valid JSON string that contains application-specific data. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $uniqueName = Values::NONE, + string $attributes = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['uniqueName'] = $uniqueName; + $this->options['attributes'] = $attributes; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * A valid JSON string that contains application-specific data. + * + * @param string $attributes A valid JSON string that contains application-specific data. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V1.UpdateChannelOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V1/Service/ChannelPage.php b/app/api/Twilio/Rest/Chat/V1/Service/ChannelPage.php new file mode 100755 index 0000000..0430959 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/Service/ChannelPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ChannelInstance \Twilio\Rest\Chat\V1\Service\ChannelInstance + */ + public function buildInstance(array $payload): ChannelInstance + { + return new ChannelInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V1.ChannelPage]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V1/Service/RoleContext.php b/app/api/Twilio/Rest/Chat/V1/Service/RoleContext.php new file mode 100755 index 0000000..470f43c --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/Service/RoleContext.php @@ -0,0 +1,128 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Roles/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the RoleInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the RoleInstance + * + * @return RoleInstance Fetched RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RoleInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new RoleInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the RoleInstance + * + * @param string[] $permission A permission that you grant to the role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. The values for this parameter depend on the role's `type` and are described in the documentation. + * @return RoleInstance Updated RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $permission): RoleInstance + { + + $data = Values::of([ + 'Permission' => + Serialize::map($permission,function ($e) { return $e; }), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new RoleInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V1.RoleContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V1/Service/RoleInstance.php b/app/api/Twilio/Rest/Chat/V1/Service/RoleInstance.php new file mode 100755 index 0000000..2645a1a --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/Service/RoleInstance.php @@ -0,0 +1,159 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'type' => Values::array_get($payload, 'type'), + 'permissions' => Values::array_get($payload, 'permissions'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return RoleContext Context for this RoleInstance + */ + protected function proxy(): RoleContext + { + if (!$this->context) { + $this->context = new RoleContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the RoleInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the RoleInstance + * + * @return RoleInstance Fetched RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RoleInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the RoleInstance + * + * @param string[] $permission A permission that you grant to the role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. The values for this parameter depend on the role's `type` and are described in the documentation. + * @return RoleInstance Updated RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $permission): RoleInstance + { + + return $this->proxy()->update($permission); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V1.RoleInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V1/Service/RoleList.php b/app/api/Twilio/Rest/Chat/V1/Service/RoleList.php new file mode 100755 index 0000000..0da4a53 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/Service/RoleList.php @@ -0,0 +1,201 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Roles'; + } + + /** + * Create the RoleInstance + * + * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. + * @param string $type + * @param string[] $permission A permission that you grant to the new role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. The values for this parameter depend on the role's `type` and are described in the documentation. + * @return RoleInstance Created RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $type, array $permission): RoleInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Type' => + $type, + 'Permission' => + Serialize::map($permission,function ($e) { return $e; }), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new RoleInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads RoleInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return RoleInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams RoleInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of RoleInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return RolePage Page of RoleInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): RolePage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new RolePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of RoleInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return RolePage Page of RoleInstance + */ + public function getPage(string $targetUrl): RolePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new RolePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a RoleContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Role resource to delete. + */ + public function getContext( + string $sid + + ): RoleContext + { + return new RoleContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V1.RoleList]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V1/Service/RolePage.php b/app/api/Twilio/Rest/Chat/V1/Service/RolePage.php new file mode 100755 index 0000000..b2794b9 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/Service/RolePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RoleInstance \Twilio\Rest\Chat\V1\Service\RoleInstance + */ + public function buildInstance(array $payload): RoleInstance + { + return new RoleInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V1.RolePage]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V1/Service/User/UserChannelInstance.php b/app/api/Twilio/Rest/Chat/V1/Service/User/UserChannelInstance.php new file mode 100755 index 0000000..e9b13b9 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/Service/User/UserChannelInstance.php @@ -0,0 +1,96 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'channelSid' => Values::array_get($payload, 'channel_sid'), + 'memberSid' => Values::array_get($payload, 'member_sid'), + 'status' => Values::array_get($payload, 'status'), + 'lastConsumedMessageIndex' => Values::array_get($payload, 'last_consumed_message_index'), + 'unreadMessagesCount' => Values::array_get($payload, 'unread_messages_count'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'userSid' => $userSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V1.UserChannelInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V1/Service/User/UserChannelList.php b/app/api/Twilio/Rest/Chat/V1/Service/User/UserChannelList.php new file mode 100755 index 0000000..ade01dc --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/Service/User/UserChannelList.php @@ -0,0 +1,157 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'userSid' => + $userSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Users/' . \rawurlencode($userSid) + .'/Channels'; + } + + /** + * Reads UserChannelInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return UserChannelInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams UserChannelInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of UserChannelInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return UserChannelPage Page of UserChannelInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): UserChannelPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new UserChannelPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of UserChannelInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return UserChannelPage Page of UserChannelInstance + */ + public function getPage(string $targetUrl): UserChannelPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new UserChannelPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V1.UserChannelList]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V1/Service/User/UserChannelPage.php b/app/api/Twilio/Rest/Chat/V1/Service/User/UserChannelPage.php new file mode 100755 index 0000000..73619ca --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/Service/User/UserChannelPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UserChannelInstance \Twilio\Rest\Chat\V1\Service\User\UserChannelInstance + */ + public function buildInstance(array $payload): UserChannelInstance + { + return new UserChannelInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V1.UserChannelPage]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V1/Service/UserContext.php b/app/api/Twilio/Rest/Chat/V1/Service/UserContext.php new file mode 100755 index 0000000..cbbce6b --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/Service/UserContext.php @@ -0,0 +1,192 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Users/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the UserInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the UserInstance + * + * @return UserInstance Fetched UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new UserInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the UserInstance + * + * @param array|Options $options Optional Arguments + * @return UserInstance Updated UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'RoleSid' => + $options['roleSid'], + 'Attributes' => + $options['attributes'], + 'FriendlyName' => + $options['friendlyName'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new UserInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the userChannels + */ + protected function getUserChannels(): UserChannelList + { + if (!$this->_userChannels) { + $this->_userChannels = new UserChannelList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_userChannels; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V1.UserContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V1/Service/UserInstance.php b/app/api/Twilio/Rest/Chat/V1/Service/UserInstance.php new file mode 100755 index 0000000..b73d05b --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/Service/UserInstance.php @@ -0,0 +1,181 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'roleSid' => Values::array_get($payload, 'role_sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'isOnline' => Values::array_get($payload, 'is_online'), + 'isNotifiable' => Values::array_get($payload, 'is_notifiable'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'joinedChannelsCount' => Values::array_get($payload, 'joined_channels_count'), + 'links' => Values::array_get($payload, 'links'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return UserContext Context for this UserInstance + */ + protected function proxy(): UserContext + { + if (!$this->context) { + $this->context = new UserContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the UserInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the UserInstance + * + * @return UserInstance Fetched UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the UserInstance + * + * @param array|Options $options Optional Arguments + * @return UserInstance Updated UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the userChannels + */ + protected function getUserChannels(): UserChannelList + { + return $this->proxy()->userChannels; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V1.UserInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V1/Service/UserList.php b/app/api/Twilio/Rest/Chat/V1/Service/UserList.php new file mode 100755 index 0000000..adc7eb3 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/Service/UserList.php @@ -0,0 +1,204 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Users'; + } + + /** + * Create the UserInstance + * + * @param string $identity The `identity` value that uniquely identifies the new resource's [User](https://www.twilio.com/docs/api/chat/rest/v1/user) within the [Service](https://www.twilio.com/docs/api/chat/rest/v1/service). This value is often a username or email address. See the Identity documentation for more details. + * @param array|Options $options Optional Arguments + * @return UserInstance Created UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $identity, array $options = []): UserInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Identity' => + $identity, + 'RoleSid' => + $options['roleSid'], + 'Attributes' => + $options['attributes'], + 'FriendlyName' => + $options['friendlyName'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new UserInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads UserInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return UserInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams UserInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of UserInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return UserPage Page of UserInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): UserPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new UserPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of UserInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return UserPage Page of UserInstance + */ + public function getPage(string $targetUrl): UserPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new UserPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a UserContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the User resource to delete. + */ + public function getContext( + string $sid + + ): UserContext + { + return new UserContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V1.UserList]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V1/Service/UserOptions.php b/app/api/Twilio/Rest/Chat/V1/Service/UserOptions.php new file mode 100755 index 0000000..ffed2a8 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/Service/UserOptions.php @@ -0,0 +1,206 @@ +options['roleSid'] = $roleSid; + $this->options['attributes'] = $attributes; + $this->options['friendlyName'] = $friendlyName; + } + + /** + * The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to the new User. + * + * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to the new User. + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * A valid JSON string that contains application-specific data. + * + * @param string $attributes A valid JSON string that contains application-specific data. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * A descriptive string that you create to describe the new resource. This value is often used for display purposes. + * + * @param string $friendlyName A descriptive string that you create to describe the new resource. This value is often used for display purposes. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V1.CreateUserOptions ' . $options . ']'; + } +} + + + + +class UpdateUserOptions extends Options + { + /** + * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to this user. + * @param string $attributes A valid JSON string that contains application-specific data. + * @param string $friendlyName A descriptive string that you create to describe the resource. It is often used for display purposes. + */ + public function __construct( + + string $roleSid = Values::NONE, + string $attributes = Values::NONE, + string $friendlyName = Values::NONE + + ) { + $this->options['roleSid'] = $roleSid; + $this->options['attributes'] = $attributes; + $this->options['friendlyName'] = $friendlyName; + } + + /** + * The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to this user. + * + * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/api/chat/rest/roles) assigned to this user. + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * A valid JSON string that contains application-specific data. + * + * @param string $attributes A valid JSON string that contains application-specific data. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * A descriptive string that you create to describe the resource. It is often used for display purposes. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It is often used for display purposes. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V1.UpdateUserOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V1/Service/UserPage.php b/app/api/Twilio/Rest/Chat/V1/Service/UserPage.php new file mode 100755 index 0000000..f437e70 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/Service/UserPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UserInstance \Twilio\Rest\Chat\V1\Service\UserInstance + */ + public function buildInstance(array $payload): UserInstance + { + return new UserInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V1.UserPage]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V1/ServiceContext.php b/app/api/Twilio/Rest/Chat/V1/ServiceContext.php new file mode 100755 index 0000000..ffd7f7b --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/ServiceContext.php @@ -0,0 +1,326 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'DefaultServiceRoleSid' => + $options['defaultServiceRoleSid'], + 'DefaultChannelRoleSid' => + $options['defaultChannelRoleSid'], + 'DefaultChannelCreatorRoleSid' => + $options['defaultChannelCreatorRoleSid'], + 'ReadStatusEnabled' => + Serialize::booleanToString($options['readStatusEnabled']), + 'ReachabilityEnabled' => + Serialize::booleanToString($options['reachabilityEnabled']), + 'TypingIndicatorTimeout' => + $options['typingIndicatorTimeout'], + 'ConsumptionReportInterval' => + $options['consumptionReportInterval'], + 'Notifications.NewMessage.Enabled' => + Serialize::booleanToString($options['notificationsNewMessageEnabled']), + 'Notifications.NewMessage.Template' => + $options['notificationsNewMessageTemplate'], + 'Notifications.AddedToChannel.Enabled' => + Serialize::booleanToString($options['notificationsAddedToChannelEnabled']), + 'Notifications.AddedToChannel.Template' => + $options['notificationsAddedToChannelTemplate'], + 'Notifications.RemovedFromChannel.Enabled' => + Serialize::booleanToString($options['notificationsRemovedFromChannelEnabled']), + 'Notifications.RemovedFromChannel.Template' => + $options['notificationsRemovedFromChannelTemplate'], + 'Notifications.InvitedToChannel.Enabled' => + Serialize::booleanToString($options['notificationsInvitedToChannelEnabled']), + 'Notifications.InvitedToChannel.Template' => + $options['notificationsInvitedToChannelTemplate'], + 'PreWebhookUrl' => + $options['preWebhookUrl'], + 'PostWebhookUrl' => + $options['postWebhookUrl'], + 'WebhookMethod' => + $options['webhookMethod'], + 'WebhookFilters' => + Serialize::map($options['webhookFilters'], function ($e) { return $e; }), + 'Webhooks.OnMessageSend.Url' => + $options['webhooksOnMessageSendUrl'], + 'Webhooks.OnMessageSend.Method' => + $options['webhooksOnMessageSendMethod'], + 'Webhooks.OnMessageUpdate.Url' => + $options['webhooksOnMessageUpdateUrl'], + 'Webhooks.OnMessageUpdate.Method' => + $options['webhooksOnMessageUpdateMethod'], + 'Webhooks.OnMessageRemove.Url' => + $options['webhooksOnMessageRemoveUrl'], + 'Webhooks.OnMessageRemove.Method' => + $options['webhooksOnMessageRemoveMethod'], + 'Webhooks.OnChannelAdd.Url' => + $options['webhooksOnChannelAddUrl'], + 'Webhooks.OnChannelAdd.Method' => + $options['webhooksOnChannelAddMethod'], + 'Webhooks.OnChannelDestroy.Url' => + $options['webhooksOnChannelDestroyUrl'], + 'Webhooks.OnChannelDestroy.Method' => + $options['webhooksOnChannelDestroyMethod'], + 'Webhooks.OnChannelUpdate.Url' => + $options['webhooksOnChannelUpdateUrl'], + 'Webhooks.OnChannelUpdate.Method' => + $options['webhooksOnChannelUpdateMethod'], + 'Webhooks.OnMemberAdd.Url' => + $options['webhooksOnMemberAddUrl'], + 'Webhooks.OnMemberAdd.Method' => + $options['webhooksOnMemberAddMethod'], + 'Webhooks.OnMemberRemove.Url' => + $options['webhooksOnMemberRemoveUrl'], + 'Webhooks.OnMemberRemove.Method' => + $options['webhooksOnMemberRemoveMethod'], + 'Webhooks.OnMessageSent.Url' => + $options['webhooksOnMessageSentUrl'], + 'Webhooks.OnMessageSent.Method' => + $options['webhooksOnMessageSentMethod'], + 'Webhooks.OnMessageUpdated.Url' => + $options['webhooksOnMessageUpdatedUrl'], + 'Webhooks.OnMessageUpdated.Method' => + $options['webhooksOnMessageUpdatedMethod'], + 'Webhooks.OnMessageRemoved.Url' => + $options['webhooksOnMessageRemovedUrl'], + 'Webhooks.OnMessageRemoved.Method' => + $options['webhooksOnMessageRemovedMethod'], + 'Webhooks.OnChannelAdded.Url' => + $options['webhooksOnChannelAddedUrl'], + 'Webhooks.OnChannelAdded.Method' => + $options['webhooksOnChannelAddedMethod'], + 'Webhooks.OnChannelDestroyed.Url' => + $options['webhooksOnChannelDestroyedUrl'], + 'Webhooks.OnChannelDestroyed.Method' => + $options['webhooksOnChannelDestroyedMethod'], + 'Webhooks.OnChannelUpdated.Url' => + $options['webhooksOnChannelUpdatedUrl'], + 'Webhooks.OnChannelUpdated.Method' => + $options['webhooksOnChannelUpdatedMethod'], + 'Webhooks.OnMemberAdded.Url' => + $options['webhooksOnMemberAddedUrl'], + 'Webhooks.OnMemberAdded.Method' => + $options['webhooksOnMemberAddedMethod'], + 'Webhooks.OnMemberRemoved.Url' => + $options['webhooksOnMemberRemovedUrl'], + 'Webhooks.OnMemberRemoved.Method' => + $options['webhooksOnMemberRemovedMethod'], + 'Limits.ChannelMembers' => + $options['limitsChannelMembers'], + 'Limits.UserChannels' => + $options['limitsUserChannels'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the channels + */ + protected function getChannels(): ChannelList + { + if (!$this->_channels) { + $this->_channels = new ChannelList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_channels; + } + + /** + * Access the roles + */ + protected function getRoles(): RoleList + { + if (!$this->_roles) { + $this->_roles = new RoleList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_roles; + } + + /** + * Access the users + */ + protected function getUsers(): UserList + { + if (!$this->_users) { + $this->_users = new UserList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_users; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V1.ServiceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V1/ServiceInstance.php b/app/api/Twilio/Rest/Chat/V1/ServiceInstance.php new file mode 100755 index 0000000..4c485a2 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/ServiceInstance.php @@ -0,0 +1,213 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'defaultServiceRoleSid' => Values::array_get($payload, 'default_service_role_sid'), + 'defaultChannelRoleSid' => Values::array_get($payload, 'default_channel_role_sid'), + 'defaultChannelCreatorRoleSid' => Values::array_get($payload, 'default_channel_creator_role_sid'), + 'readStatusEnabled' => Values::array_get($payload, 'read_status_enabled'), + 'reachabilityEnabled' => Values::array_get($payload, 'reachability_enabled'), + 'typingIndicatorTimeout' => Values::array_get($payload, 'typing_indicator_timeout'), + 'consumptionReportInterval' => Values::array_get($payload, 'consumption_report_interval'), + 'limits' => Values::array_get($payload, 'limits'), + 'webhooks' => Values::array_get($payload, 'webhooks'), + 'preWebhookUrl' => Values::array_get($payload, 'pre_webhook_url'), + 'postWebhookUrl' => Values::array_get($payload, 'post_webhook_url'), + 'webhookMethod' => Values::array_get($payload, 'webhook_method'), + 'webhookFilters' => Values::array_get($payload, 'webhook_filters'), + 'notifications' => Values::array_get($payload, 'notifications'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ServiceContext Context for this ServiceInstance + */ + protected function proxy(): ServiceContext + { + if (!$this->context) { + $this->context = new ServiceContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the channels + */ + protected function getChannels(): ChannelList + { + return $this->proxy()->channels; + } + + /** + * Access the roles + */ + protected function getRoles(): RoleList + { + return $this->proxy()->roles; + } + + /** + * Access the users + */ + protected function getUsers(): UserList + { + return $this->proxy()->users; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V1.ServiceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V1/ServiceList.php b/app/api/Twilio/Rest/Chat/V1/ServiceList.php new file mode 100755 index 0000000..0f4b709 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/ServiceList.php @@ -0,0 +1,186 @@ +solution = [ + ]; + + $this->uri = '/Services'; + } + + /** + * Create the ServiceInstance + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return ServiceInstance Created ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName): ServiceInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new ServiceInstance( + $this->version, + $payload + ); + } + + + /** + * Reads ServiceInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ServiceInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ServiceInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ServiceInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ServicePage Page of ServiceInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ServicePage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ServicePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ServiceInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ServicePage Page of ServiceInstance + */ + public function getPage(string $targetUrl): ServicePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ServicePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ServiceContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Service resource to delete. + */ + public function getContext( + string $sid + + ): ServiceContext + { + return new ServiceContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V1.ServiceList]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V1/ServiceOptions.php b/app/api/Twilio/Rest/Chat/V1/ServiceOptions.php new file mode 100755 index 0000000..a725180 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/ServiceOptions.php @@ -0,0 +1,1038 @@ +options['friendlyName'] = $friendlyName; + $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; + $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; + $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; + $this->options['readStatusEnabled'] = $readStatusEnabled; + $this->options['reachabilityEnabled'] = $reachabilityEnabled; + $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; + $this->options['consumptionReportInterval'] = $consumptionReportInterval; + $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; + $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; + $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; + $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; + $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; + $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; + $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; + $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; + $this->options['preWebhookUrl'] = $preWebhookUrl; + $this->options['postWebhookUrl'] = $postWebhookUrl; + $this->options['webhookMethod'] = $webhookMethod; + $this->options['webhookFilters'] = $webhookFilters; + $this->options['webhooksOnMessageSendUrl'] = $webhooksOnMessageSendUrl; + $this->options['webhooksOnMessageSendMethod'] = $webhooksOnMessageSendMethod; + $this->options['webhooksOnMessageUpdateUrl'] = $webhooksOnMessageUpdateUrl; + $this->options['webhooksOnMessageUpdateMethod'] = $webhooksOnMessageUpdateMethod; + $this->options['webhooksOnMessageRemoveUrl'] = $webhooksOnMessageRemoveUrl; + $this->options['webhooksOnMessageRemoveMethod'] = $webhooksOnMessageRemoveMethod; + $this->options['webhooksOnChannelAddUrl'] = $webhooksOnChannelAddUrl; + $this->options['webhooksOnChannelAddMethod'] = $webhooksOnChannelAddMethod; + $this->options['webhooksOnChannelDestroyUrl'] = $webhooksOnChannelDestroyUrl; + $this->options['webhooksOnChannelDestroyMethod'] = $webhooksOnChannelDestroyMethod; + $this->options['webhooksOnChannelUpdateUrl'] = $webhooksOnChannelUpdateUrl; + $this->options['webhooksOnChannelUpdateMethod'] = $webhooksOnChannelUpdateMethod; + $this->options['webhooksOnMemberAddUrl'] = $webhooksOnMemberAddUrl; + $this->options['webhooksOnMemberAddMethod'] = $webhooksOnMemberAddMethod; + $this->options['webhooksOnMemberRemoveUrl'] = $webhooksOnMemberRemoveUrl; + $this->options['webhooksOnMemberRemoveMethod'] = $webhooksOnMemberRemoveMethod; + $this->options['webhooksOnMessageSentUrl'] = $webhooksOnMessageSentUrl; + $this->options['webhooksOnMessageSentMethod'] = $webhooksOnMessageSentMethod; + $this->options['webhooksOnMessageUpdatedUrl'] = $webhooksOnMessageUpdatedUrl; + $this->options['webhooksOnMessageUpdatedMethod'] = $webhooksOnMessageUpdatedMethod; + $this->options['webhooksOnMessageRemovedUrl'] = $webhooksOnMessageRemovedUrl; + $this->options['webhooksOnMessageRemovedMethod'] = $webhooksOnMessageRemovedMethod; + $this->options['webhooksOnChannelAddedUrl'] = $webhooksOnChannelAddedUrl; + $this->options['webhooksOnChannelAddedMethod'] = $webhooksOnChannelAddedMethod; + $this->options['webhooksOnChannelDestroyedUrl'] = $webhooksOnChannelDestroyedUrl; + $this->options['webhooksOnChannelDestroyedMethod'] = $webhooksOnChannelDestroyedMethod; + $this->options['webhooksOnChannelUpdatedUrl'] = $webhooksOnChannelUpdatedUrl; + $this->options['webhooksOnChannelUpdatedMethod'] = $webhooksOnChannelUpdatedMethod; + $this->options['webhooksOnMemberAddedUrl'] = $webhooksOnMemberAddedUrl; + $this->options['webhooksOnMemberAddedMethod'] = $webhooksOnMemberAddedMethod; + $this->options['webhooksOnMemberRemovedUrl'] = $webhooksOnMemberRemovedUrl; + $this->options['webhooksOnMemberRemovedMethod'] = $webhooksOnMemberRemovedMethod; + $this->options['limitsChannelMembers'] = $limitsChannelMembers; + $this->options['limitsUserChannels'] = $limitsUserChannels; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The service role assigned to users when they are added to the service. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. + * + * @param string $defaultServiceRoleSid The service role assigned to users when they are added to the service. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. + * @return $this Fluent Builder + */ + public function setDefaultServiceRoleSid(string $defaultServiceRoleSid): self + { + $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; + return $this; + } + + /** + * The channel role assigned to users when they are added to a channel. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. + * + * @param string $defaultChannelRoleSid The channel role assigned to users when they are added to a channel. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. + * @return $this Fluent Builder + */ + public function setDefaultChannelRoleSid(string $defaultChannelRoleSid): self + { + $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; + return $this; + } + + /** + * The channel role assigned to a channel creator when they join a new channel. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. + * + * @param string $defaultChannelCreatorRoleSid The channel role assigned to a channel creator when they join a new channel. See the [Roles endpoint](https://www.twilio.com/docs/chat/api/roles) for more details. + * @return $this Fluent Builder + */ + public function setDefaultChannelCreatorRoleSid(string $defaultChannelCreatorRoleSid): self + { + $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; + return $this; + } + + /** + * Whether to enable the [Message Consumption Horizon](https://www.twilio.com/docs/chat/consumption-horizon) feature. The default is `true`. + * + * @param bool $readStatusEnabled Whether to enable the [Message Consumption Horizon](https://www.twilio.com/docs/chat/consumption-horizon) feature. The default is `true`. + * @return $this Fluent Builder + */ + public function setReadStatusEnabled(bool $readStatusEnabled): self + { + $this->options['readStatusEnabled'] = $readStatusEnabled; + return $this; + } + + /** + * Whether to enable the [Reachability Indicator](https://www.twilio.com/docs/chat/reachability-indicator) for this Service instance. The default is `false`. + * + * @param bool $reachabilityEnabled Whether to enable the [Reachability Indicator](https://www.twilio.com/docs/chat/reachability-indicator) for this Service instance. The default is `false`. + * @return $this Fluent Builder + */ + public function setReachabilityEnabled(bool $reachabilityEnabled): self + { + $this->options['reachabilityEnabled'] = $reachabilityEnabled; + return $this; + } + + /** + * How long in seconds after a `started typing` event until clients should assume that user is no longer typing, even if no `ended typing` message was received. The default is 5 seconds. + * + * @param int $typingIndicatorTimeout How long in seconds after a `started typing` event until clients should assume that user is no longer typing, even if no `ended typing` message was received. The default is 5 seconds. + * @return $this Fluent Builder + */ + public function setTypingIndicatorTimeout(int $typingIndicatorTimeout): self + { + $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; + return $this; + } + + /** + * DEPRECATED. The interval in seconds between consumption reports submission batches from client endpoints. + * + * @param int $consumptionReportInterval DEPRECATED. The interval in seconds between consumption reports submission batches from client endpoints. + * @return $this Fluent Builder + */ + public function setConsumptionReportInterval(int $consumptionReportInterval): self + { + $this->options['consumptionReportInterval'] = $consumptionReportInterval; + return $this; + } + + /** + * Whether to send a notification when a new message is added to a channel. Can be: `true` or `false` and the default is `false`. + * + * @param bool $notificationsNewMessageEnabled Whether to send a notification when a new message is added to a channel. Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setNotificationsNewMessageEnabled(bool $notificationsNewMessageEnabled): self + { + $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; + return $this; + } + + /** + * The template to use to create the notification text displayed when a new message is added to a channel and `notifications.new_message.enabled` is `true`. + * + * @param string $notificationsNewMessageTemplate The template to use to create the notification text displayed when a new message is added to a channel and `notifications.new_message.enabled` is `true`. + * @return $this Fluent Builder + */ + public function setNotificationsNewMessageTemplate(string $notificationsNewMessageTemplate): self + { + $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; + return $this; + } + + /** + * Whether to send a notification when a member is added to a channel. Can be: `true` or `false` and the default is `false`. + * + * @param bool $notificationsAddedToChannelEnabled Whether to send a notification when a member is added to a channel. Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setNotificationsAddedToChannelEnabled(bool $notificationsAddedToChannelEnabled): self + { + $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; + return $this; + } + + /** + * The template to use to create the notification text displayed when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. + * + * @param string $notificationsAddedToChannelTemplate The template to use to create the notification text displayed when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. + * @return $this Fluent Builder + */ + public function setNotificationsAddedToChannelTemplate(string $notificationsAddedToChannelTemplate): self + { + $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; + return $this; + } + + /** + * Whether to send a notification to a user when they are removed from a channel. Can be: `true` or `false` and the default is `false`. + * + * @param bool $notificationsRemovedFromChannelEnabled Whether to send a notification to a user when they are removed from a channel. Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setNotificationsRemovedFromChannelEnabled(bool $notificationsRemovedFromChannelEnabled): self + { + $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; + return $this; + } + + /** + * The template to use to create the notification text displayed to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. + * + * @param string $notificationsRemovedFromChannelTemplate The template to use to create the notification text displayed to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. + * @return $this Fluent Builder + */ + public function setNotificationsRemovedFromChannelTemplate(string $notificationsRemovedFromChannelTemplate): self + { + $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; + return $this; + } + + /** + * Whether to send a notification when a user is invited to a channel. Can be: `true` or `false` and the default is `false`. + * + * @param bool $notificationsInvitedToChannelEnabled Whether to send a notification when a user is invited to a channel. Can be: `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setNotificationsInvitedToChannelEnabled(bool $notificationsInvitedToChannelEnabled): self + { + $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; + return $this; + } + + /** + * The template to use to create the notification text displayed when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. + * + * @param string $notificationsInvitedToChannelTemplate The template to use to create the notification text displayed when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. + * @return $this Fluent Builder + */ + public function setNotificationsInvitedToChannelTemplate(string $notificationsInvitedToChannelTemplate): self + { + $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; + return $this; + } + + /** + * The URL for pre-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/api/chat/webhooks) for more details. + * + * @param string $preWebhookUrl The URL for pre-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/api/chat/webhooks) for more details. + * @return $this Fluent Builder + */ + public function setPreWebhookUrl(string $preWebhookUrl): self + { + $this->options['preWebhookUrl'] = $preWebhookUrl; + return $this; + } + + /** + * The URL for post-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/api/chat/webhooks) for more details. + * + * @param string $postWebhookUrl The URL for post-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/api/chat/webhooks) for more details. + * @return $this Fluent Builder + */ + public function setPostWebhookUrl(string $postWebhookUrl): self + { + $this->options['postWebhookUrl'] = $postWebhookUrl; + return $this; + } + + /** + * The HTTP method to use for calls to the `pre_webhook_url` and `post_webhook_url` webhooks. Can be: `POST` or `GET` and the default is `POST`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. + * + * @param string $webhookMethod The HTTP method to use for calls to the `pre_webhook_url` and `post_webhook_url` webhooks. Can be: `POST` or `GET` and the default is `POST`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. + * @return $this Fluent Builder + */ + public function setWebhookMethod(string $webhookMethod): self + { + $this->options['webhookMethod'] = $webhookMethod; + return $this; + } + + /** + * The list of WebHook events that are enabled for this Service instance. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. + * + * @param string[] $webhookFilters The list of WebHook events that are enabled for this Service instance. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. + * @return $this Fluent Builder + */ + public function setWebhookFilters(array $webhookFilters): self + { + $this->options['webhookFilters'] = $webhookFilters; + return $this; + } + + /** + * The URL of the webhook to call in response to the `on_message_send` event using the `webhooks.on_message_send.method` HTTP method. + * + * @param string $webhooksOnMessageSendUrl The URL of the webhook to call in response to the `on_message_send` event using the `webhooks.on_message_send.method` HTTP method. + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageSendUrl(string $webhooksOnMessageSendUrl): self + { + $this->options['webhooksOnMessageSendUrl'] = $webhooksOnMessageSendUrl; + return $this; + } + + /** + * The HTTP method to use when calling the `webhooks.on_message_send.url`. + * + * @param string $webhooksOnMessageSendMethod The HTTP method to use when calling the `webhooks.on_message_send.url`. + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageSendMethod(string $webhooksOnMessageSendMethod): self + { + $this->options['webhooksOnMessageSendMethod'] = $webhooksOnMessageSendMethod; + return $this; + } + + /** + * The URL of the webhook to call in response to the `on_message_update` event using the `webhooks.on_message_update.method` HTTP method. + * + * @param string $webhooksOnMessageUpdateUrl The URL of the webhook to call in response to the `on_message_update` event using the `webhooks.on_message_update.method` HTTP method. + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageUpdateUrl(string $webhooksOnMessageUpdateUrl): self + { + $this->options['webhooksOnMessageUpdateUrl'] = $webhooksOnMessageUpdateUrl; + return $this; + } + + /** + * The HTTP method to use when calling the `webhooks.on_message_update.url`. + * + * @param string $webhooksOnMessageUpdateMethod The HTTP method to use when calling the `webhooks.on_message_update.url`. + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageUpdateMethod(string $webhooksOnMessageUpdateMethod): self + { + $this->options['webhooksOnMessageUpdateMethod'] = $webhooksOnMessageUpdateMethod; + return $this; + } + + /** + * The URL of the webhook to call in response to the `on_message_remove` event using the `webhooks.on_message_remove.method` HTTP method. + * + * @param string $webhooksOnMessageRemoveUrl The URL of the webhook to call in response to the `on_message_remove` event using the `webhooks.on_message_remove.method` HTTP method. + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageRemoveUrl(string $webhooksOnMessageRemoveUrl): self + { + $this->options['webhooksOnMessageRemoveUrl'] = $webhooksOnMessageRemoveUrl; + return $this; + } + + /** + * The HTTP method to use when calling the `webhooks.on_message_remove.url`. + * + * @param string $webhooksOnMessageRemoveMethod The HTTP method to use when calling the `webhooks.on_message_remove.url`. + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageRemoveMethod(string $webhooksOnMessageRemoveMethod): self + { + $this->options['webhooksOnMessageRemoveMethod'] = $webhooksOnMessageRemoveMethod; + return $this; + } + + /** + * The URL of the webhook to call in response to the `on_channel_add` event using the `webhooks.on_channel_add.method` HTTP method. + * + * @param string $webhooksOnChannelAddUrl The URL of the webhook to call in response to the `on_channel_add` event using the `webhooks.on_channel_add.method` HTTP method. + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelAddUrl(string $webhooksOnChannelAddUrl): self + { + $this->options['webhooksOnChannelAddUrl'] = $webhooksOnChannelAddUrl; + return $this; + } + + /** + * The HTTP method to use when calling the `webhooks.on_channel_add.url`. + * + * @param string $webhooksOnChannelAddMethod The HTTP method to use when calling the `webhooks.on_channel_add.url`. + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelAddMethod(string $webhooksOnChannelAddMethod): self + { + $this->options['webhooksOnChannelAddMethod'] = $webhooksOnChannelAddMethod; + return $this; + } + + /** + * The URL of the webhook to call in response to the `on_channel_destroy` event using the `webhooks.on_channel_destroy.method` HTTP method. + * + * @param string $webhooksOnChannelDestroyUrl The URL of the webhook to call in response to the `on_channel_destroy` event using the `webhooks.on_channel_destroy.method` HTTP method. + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelDestroyUrl(string $webhooksOnChannelDestroyUrl): self + { + $this->options['webhooksOnChannelDestroyUrl'] = $webhooksOnChannelDestroyUrl; + return $this; + } + + /** + * The HTTP method to use when calling the `webhooks.on_channel_destroy.url`. + * + * @param string $webhooksOnChannelDestroyMethod The HTTP method to use when calling the `webhooks.on_channel_destroy.url`. + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelDestroyMethod(string $webhooksOnChannelDestroyMethod): self + { + $this->options['webhooksOnChannelDestroyMethod'] = $webhooksOnChannelDestroyMethod; + return $this; + } + + /** + * The URL of the webhook to call in response to the `on_channel_update` event using the `webhooks.on_channel_update.method` HTTP method. + * + * @param string $webhooksOnChannelUpdateUrl The URL of the webhook to call in response to the `on_channel_update` event using the `webhooks.on_channel_update.method` HTTP method. + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelUpdateUrl(string $webhooksOnChannelUpdateUrl): self + { + $this->options['webhooksOnChannelUpdateUrl'] = $webhooksOnChannelUpdateUrl; + return $this; + } + + /** + * The HTTP method to use when calling the `webhooks.on_channel_update.url`. + * + * @param string $webhooksOnChannelUpdateMethod The HTTP method to use when calling the `webhooks.on_channel_update.url`. + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelUpdateMethod(string $webhooksOnChannelUpdateMethod): self + { + $this->options['webhooksOnChannelUpdateMethod'] = $webhooksOnChannelUpdateMethod; + return $this; + } + + /** + * The URL of the webhook to call in response to the `on_member_add` event using the `webhooks.on_member_add.method` HTTP method. + * + * @param string $webhooksOnMemberAddUrl The URL of the webhook to call in response to the `on_member_add` event using the `webhooks.on_member_add.method` HTTP method. + * @return $this Fluent Builder + */ + public function setWebhooksOnMemberAddUrl(string $webhooksOnMemberAddUrl): self + { + $this->options['webhooksOnMemberAddUrl'] = $webhooksOnMemberAddUrl; + return $this; + } + + /** + * The HTTP method to use when calling the `webhooks.on_member_add.url`. + * + * @param string $webhooksOnMemberAddMethod The HTTP method to use when calling the `webhooks.on_member_add.url`. + * @return $this Fluent Builder + */ + public function setWebhooksOnMemberAddMethod(string $webhooksOnMemberAddMethod): self + { + $this->options['webhooksOnMemberAddMethod'] = $webhooksOnMemberAddMethod; + return $this; + } + + /** + * The URL of the webhook to call in response to the `on_member_remove` event using the `webhooks.on_member_remove.method` HTTP method. + * + * @param string $webhooksOnMemberRemoveUrl The URL of the webhook to call in response to the `on_member_remove` event using the `webhooks.on_member_remove.method` HTTP method. + * @return $this Fluent Builder + */ + public function setWebhooksOnMemberRemoveUrl(string $webhooksOnMemberRemoveUrl): self + { + $this->options['webhooksOnMemberRemoveUrl'] = $webhooksOnMemberRemoveUrl; + return $this; + } + + /** + * The HTTP method to use when calling the `webhooks.on_member_remove.url`. + * + * @param string $webhooksOnMemberRemoveMethod The HTTP method to use when calling the `webhooks.on_member_remove.url`. + * @return $this Fluent Builder + */ + public function setWebhooksOnMemberRemoveMethod(string $webhooksOnMemberRemoveMethod): self + { + $this->options['webhooksOnMemberRemoveMethod'] = $webhooksOnMemberRemoveMethod; + return $this; + } + + /** + * The URL of the webhook to call in response to the `on_message_sent` event using the `webhooks.on_message_sent.method` HTTP method. + * + * @param string $webhooksOnMessageSentUrl The URL of the webhook to call in response to the `on_message_sent` event using the `webhooks.on_message_sent.method` HTTP method. + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageSentUrl(string $webhooksOnMessageSentUrl): self + { + $this->options['webhooksOnMessageSentUrl'] = $webhooksOnMessageSentUrl; + return $this; + } + + /** + * The URL of the webhook to call in response to the `on_message_sent` event`. + * + * @param string $webhooksOnMessageSentMethod The URL of the webhook to call in response to the `on_message_sent` event`. + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageSentMethod(string $webhooksOnMessageSentMethod): self + { + $this->options['webhooksOnMessageSentMethod'] = $webhooksOnMessageSentMethod; + return $this; + } + + /** + * The URL of the webhook to call in response to the `on_message_updated` event using the `webhooks.on_message_updated.method` HTTP method. + * + * @param string $webhooksOnMessageUpdatedUrl The URL of the webhook to call in response to the `on_message_updated` event using the `webhooks.on_message_updated.method` HTTP method. + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageUpdatedUrl(string $webhooksOnMessageUpdatedUrl): self + { + $this->options['webhooksOnMessageUpdatedUrl'] = $webhooksOnMessageUpdatedUrl; + return $this; + } + + /** + * The HTTP method to use when calling the `webhooks.on_message_updated.url`. + * + * @param string $webhooksOnMessageUpdatedMethod The HTTP method to use when calling the `webhooks.on_message_updated.url`. + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageUpdatedMethod(string $webhooksOnMessageUpdatedMethod): self + { + $this->options['webhooksOnMessageUpdatedMethod'] = $webhooksOnMessageUpdatedMethod; + return $this; + } + + /** + * The URL of the webhook to call in response to the `on_message_removed` event using the `webhooks.on_message_removed.method` HTTP method. + * + * @param string $webhooksOnMessageRemovedUrl The URL of the webhook to call in response to the `on_message_removed` event using the `webhooks.on_message_removed.method` HTTP method. + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageRemovedUrl(string $webhooksOnMessageRemovedUrl): self + { + $this->options['webhooksOnMessageRemovedUrl'] = $webhooksOnMessageRemovedUrl; + return $this; + } + + /** + * The HTTP method to use when calling the `webhooks.on_message_removed.url`. + * + * @param string $webhooksOnMessageRemovedMethod The HTTP method to use when calling the `webhooks.on_message_removed.url`. + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageRemovedMethod(string $webhooksOnMessageRemovedMethod): self + { + $this->options['webhooksOnMessageRemovedMethod'] = $webhooksOnMessageRemovedMethod; + return $this; + } + + /** + * The URL of the webhook to call in response to the `on_channel_added` event using the `webhooks.on_channel_added.method` HTTP method. + * + * @param string $webhooksOnChannelAddedUrl The URL of the webhook to call in response to the `on_channel_added` event using the `webhooks.on_channel_added.method` HTTP method. + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelAddedUrl(string $webhooksOnChannelAddedUrl): self + { + $this->options['webhooksOnChannelAddedUrl'] = $webhooksOnChannelAddedUrl; + return $this; + } + + /** + * The URL of the webhook to call in response to the `on_channel_added` event`. + * + * @param string $webhooksOnChannelAddedMethod The URL of the webhook to call in response to the `on_channel_added` event`. + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelAddedMethod(string $webhooksOnChannelAddedMethod): self + { + $this->options['webhooksOnChannelAddedMethod'] = $webhooksOnChannelAddedMethod; + return $this; + } + + /** + * The URL of the webhook to call in response to the `on_channel_added` event using the `webhooks.on_channel_destroyed.method` HTTP method. + * + * @param string $webhooksOnChannelDestroyedUrl The URL of the webhook to call in response to the `on_channel_added` event using the `webhooks.on_channel_destroyed.method` HTTP method. + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelDestroyedUrl(string $webhooksOnChannelDestroyedUrl): self + { + $this->options['webhooksOnChannelDestroyedUrl'] = $webhooksOnChannelDestroyedUrl; + return $this; + } + + /** + * The HTTP method to use when calling the `webhooks.on_channel_destroyed.url`. + * + * @param string $webhooksOnChannelDestroyedMethod The HTTP method to use when calling the `webhooks.on_channel_destroyed.url`. + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelDestroyedMethod(string $webhooksOnChannelDestroyedMethod): self + { + $this->options['webhooksOnChannelDestroyedMethod'] = $webhooksOnChannelDestroyedMethod; + return $this; + } + + /** + * The URL of the webhook to call in response to the `on_channel_updated` event using the `webhooks.on_channel_updated.method` HTTP method. + * + * @param string $webhooksOnChannelUpdatedUrl The URL of the webhook to call in response to the `on_channel_updated` event using the `webhooks.on_channel_updated.method` HTTP method. + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelUpdatedUrl(string $webhooksOnChannelUpdatedUrl): self + { + $this->options['webhooksOnChannelUpdatedUrl'] = $webhooksOnChannelUpdatedUrl; + return $this; + } + + /** + * The HTTP method to use when calling the `webhooks.on_channel_updated.url`. + * + * @param string $webhooksOnChannelUpdatedMethod The HTTP method to use when calling the `webhooks.on_channel_updated.url`. + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelUpdatedMethod(string $webhooksOnChannelUpdatedMethod): self + { + $this->options['webhooksOnChannelUpdatedMethod'] = $webhooksOnChannelUpdatedMethod; + return $this; + } + + /** + * The URL of the webhook to call in response to the `on_channel_updated` event using the `webhooks.on_channel_updated.method` HTTP method. + * + * @param string $webhooksOnMemberAddedUrl The URL of the webhook to call in response to the `on_channel_updated` event using the `webhooks.on_channel_updated.method` HTTP method. + * @return $this Fluent Builder + */ + public function setWebhooksOnMemberAddedUrl(string $webhooksOnMemberAddedUrl): self + { + $this->options['webhooksOnMemberAddedUrl'] = $webhooksOnMemberAddedUrl; + return $this; + } + + /** + * The HTTP method to use when calling the `webhooks.on_channel_updated.url`. + * + * @param string $webhooksOnMemberAddedMethod The HTTP method to use when calling the `webhooks.on_channel_updated.url`. + * @return $this Fluent Builder + */ + public function setWebhooksOnMemberAddedMethod(string $webhooksOnMemberAddedMethod): self + { + $this->options['webhooksOnMemberAddedMethod'] = $webhooksOnMemberAddedMethod; + return $this; + } + + /** + * The URL of the webhook to call in response to the `on_member_removed` event using the `webhooks.on_member_removed.method` HTTP method. + * + * @param string $webhooksOnMemberRemovedUrl The URL of the webhook to call in response to the `on_member_removed` event using the `webhooks.on_member_removed.method` HTTP method. + * @return $this Fluent Builder + */ + public function setWebhooksOnMemberRemovedUrl(string $webhooksOnMemberRemovedUrl): self + { + $this->options['webhooksOnMemberRemovedUrl'] = $webhooksOnMemberRemovedUrl; + return $this; + } + + /** + * The HTTP method to use when calling the `webhooks.on_member_removed.url`. + * + * @param string $webhooksOnMemberRemovedMethod The HTTP method to use when calling the `webhooks.on_member_removed.url`. + * @return $this Fluent Builder + */ + public function setWebhooksOnMemberRemovedMethod(string $webhooksOnMemberRemovedMethod): self + { + $this->options['webhooksOnMemberRemovedMethod'] = $webhooksOnMemberRemovedMethod; + return $this; + } + + /** + * The maximum number of Members that can be added to Channels within this Service. Can be up to 1,000. + * + * @param int $limitsChannelMembers The maximum number of Members that can be added to Channels within this Service. Can be up to 1,000. + * @return $this Fluent Builder + */ + public function setLimitsChannelMembers(int $limitsChannelMembers): self + { + $this->options['limitsChannelMembers'] = $limitsChannelMembers; + return $this; + } + + /** + * The maximum number of Channels Users can be a Member of within this Service. Can be up to 1,000. + * + * @param int $limitsUserChannels The maximum number of Channels Users can be a Member of within this Service. Can be up to 1,000. + * @return $this Fluent Builder + */ + public function setLimitsUserChannels(int $limitsUserChannels): self + { + $this->options['limitsUserChannels'] = $limitsUserChannels; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V1.UpdateServiceOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V1/ServicePage.php b/app/api/Twilio/Rest/Chat/V1/ServicePage.php new file mode 100755 index 0000000..c343a3f --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V1/ServicePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ServiceInstance \Twilio\Rest\Chat\V1\ServiceInstance + */ + public function buildInstance(array $payload): ServiceInstance + { + return new ServiceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V1.ServicePage]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V2.php b/app/api/Twilio/Rest/Chat/V2.php new file mode 100755 index 0000000..4f7f028 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2.php @@ -0,0 +1,107 @@ +version = 'v2'; + } + + protected function getCredentials(): CredentialList + { + if (!$this->_credentials) { + $this->_credentials = new CredentialList($this); + } + return $this->_credentials; + } + + protected function getServices(): ServiceList + { + if (!$this->_services) { + $this->_services = new ServiceList($this); + } + return $this->_services; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V2/.openapi-generator-ignore b/app/api/Twilio/Rest/Chat/V2/.openapi-generator-ignore new file mode 100755 index 0000000..2d4b99e --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/app/api/Twilio/Rest/Chat/V2/CredentialContext.php b/app/api/Twilio/Rest/Chat/V2/CredentialContext.php new file mode 100755 index 0000000..7d153a7 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/CredentialContext.php @@ -0,0 +1,134 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Credentials/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the CredentialInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the CredentialInstance + * + * @return CredentialInstance Fetched CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new CredentialInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the CredentialInstance + * + * @param array|Options $options Optional Arguments + * @return CredentialInstance Updated CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CredentialInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'Certificate' => + $options['certificate'], + 'PrivateKey' => + $options['privateKey'], + 'Sandbox' => + Serialize::booleanToString($options['sandbox']), + 'ApiKey' => + $options['apiKey'], + 'Secret' => + $options['secret'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new CredentialInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.CredentialContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V2/CredentialInstance.php b/app/api/Twilio/Rest/Chat/V2/CredentialInstance.php new file mode 100755 index 0000000..c674d71 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/CredentialInstance.php @@ -0,0 +1,156 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'type' => Values::array_get($payload, 'type'), + 'sandbox' => Values::array_get($payload, 'sandbox'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CredentialContext Context for this CredentialInstance + */ + protected function proxy(): CredentialContext + { + if (!$this->context) { + $this->context = new CredentialContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the CredentialInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the CredentialInstance + * + * @return CredentialInstance Fetched CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the CredentialInstance + * + * @param array|Options $options Optional Arguments + * @return CredentialInstance Updated CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CredentialInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.CredentialInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V2/CredentialList.php b/app/api/Twilio/Rest/Chat/V2/CredentialList.php new file mode 100755 index 0000000..9ed846c --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/CredentialList.php @@ -0,0 +1,203 @@ +solution = [ + ]; + + $this->uri = '/Credentials'; + } + + /** + * Create the CredentialInstance + * + * @param string $type + * @param array|Options $options Optional Arguments + * @return CredentialInstance Created CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $type, array $options = []): CredentialInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Type' => + $type, + 'FriendlyName' => + $options['friendlyName'], + 'Certificate' => + $options['certificate'], + 'PrivateKey' => + $options['privateKey'], + 'Sandbox' => + Serialize::booleanToString($options['sandbox']), + 'ApiKey' => + $options['apiKey'], + 'Secret' => + $options['secret'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new CredentialInstance( + $this->version, + $payload + ); + } + + + /** + * Reads CredentialInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return CredentialInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams CredentialInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CredentialInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return CredentialPage Page of CredentialInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CredentialPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new CredentialPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of CredentialInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return CredentialPage Page of CredentialInstance + */ + public function getPage(string $targetUrl): CredentialPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CredentialPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CredentialContext + * + * @param string $sid The SID of the Credential resource to delete. + */ + public function getContext( + string $sid + + ): CredentialContext + { + return new CredentialContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.CredentialList]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V2/CredentialOptions.php b/app/api/Twilio/Rest/Chat/V2/CredentialOptions.php new file mode 100755 index 0000000..1faba9d --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/CredentialOptions.php @@ -0,0 +1,314 @@ +options['friendlyName'] = $friendlyName; + $this->options['certificate'] = $certificate; + $this->options['privateKey'] = $privateKey; + $this->options['sandbox'] = $sandbox; + $this->options['apiKey'] = $apiKey; + $this->options['secret'] = $secret; + } + + /** + * A descriptive string that you create to describe the new resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----` + * + * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----` + * @return $this Fluent Builder + */ + public function setCertificate(string $certificate): self + { + $this->options['certificate'] = $certificate; + return $this; + } + + /** + * [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----` + * + * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----` + * @return $this Fluent Builder + */ + public function setPrivateKey(string $privateKey): self + { + $this->options['privateKey'] = $privateKey; + return $this; + } + + /** + * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * + * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * @return $this Fluent Builder + */ + public function setSandbox(bool $sandbox): self + { + $this->options['sandbox'] = $sandbox; + return $this; + } + + /** + * [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. + * + * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. + * @return $this Fluent Builder + */ + public function setApiKey(string $apiKey): self + { + $this->options['apiKey'] = $apiKey; + return $this; + } + + /** + * [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. + * + * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. + * @return $this Fluent Builder + */ + public function setSecret(string $secret): self + { + $this->options['secret'] = $secret; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.CreateCredentialOptions ' . $options . ']'; + } +} + + + + +class UpdateCredentialOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----` + * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----` + * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. + * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $certificate = Values::NONE, + string $privateKey = Values::NONE, + bool $sandbox = Values::BOOL_NONE, + string $apiKey = Values::NONE, + string $secret = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['certificate'] = $certificate; + $this->options['privateKey'] = $privateKey; + $this->options['sandbox'] = $sandbox; + $this->options['apiKey'] = $apiKey; + $this->options['secret'] = $secret; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----` + * + * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----` + * @return $this Fluent Builder + */ + public function setCertificate(string $certificate): self + { + $this->options['certificate'] = $certificate; + return $this; + } + + /** + * [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----` + * + * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----` + * @return $this Fluent Builder + */ + public function setPrivateKey(string $privateKey): self + { + $this->options['privateKey'] = $privateKey; + return $this; + } + + /** + * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * + * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * @return $this Fluent Builder + */ + public function setSandbox(bool $sandbox): self + { + $this->options['sandbox'] = $sandbox; + return $this; + } + + /** + * [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. + * + * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. + * @return $this Fluent Builder + */ + public function setApiKey(string $apiKey): self + { + $this->options['apiKey'] = $apiKey; + return $this; + } + + /** + * [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. + * + * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. + * @return $this Fluent Builder + */ + public function setSecret(string $secret): self + { + $this->options['secret'] = $secret; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.UpdateCredentialOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V2/CredentialPage.php b/app/api/Twilio/Rest/Chat/V2/CredentialPage.php new file mode 100755 index 0000000..2752b58 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/CredentialPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CredentialInstance \Twilio\Rest\Chat\V2\CredentialInstance + */ + public function buildInstance(array $payload): CredentialInstance + { + return new CredentialInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.CredentialPage]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V2/Service/BindingContext.php b/app/api/Twilio/Rest/Chat/V2/Service/BindingContext.php new file mode 100755 index 0000000..56b8212 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/BindingContext.php @@ -0,0 +1,100 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Bindings/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the BindingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the BindingInstance + * + * @return BindingInstance Fetched BindingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BindingInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new BindingInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.BindingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V2/Service/BindingInstance.php b/app/api/Twilio/Rest/Chat/V2/Service/BindingInstance.php new file mode 100755 index 0000000..f71f056 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/BindingInstance.php @@ -0,0 +1,152 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'endpoint' => Values::array_get($payload, 'endpoint'), + 'identity' => Values::array_get($payload, 'identity'), + 'credentialSid' => Values::array_get($payload, 'credential_sid'), + 'bindingType' => Values::array_get($payload, 'binding_type'), + 'messageTypes' => Values::array_get($payload, 'message_types'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return BindingContext Context for this BindingInstance + */ + protected function proxy(): BindingContext + { + if (!$this->context) { + $this->context = new BindingContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the BindingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the BindingInstance + * + * @return BindingInstance Fetched BindingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BindingInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.BindingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V2/Service/BindingList.php b/app/api/Twilio/Rest/Chat/V2/Service/BindingList.php new file mode 100755 index 0000000..cbd8a20 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/BindingList.php @@ -0,0 +1,178 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Bindings'; + } + + /** + * Reads BindingInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return BindingInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams BindingInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of BindingInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return BindingPage Page of BindingInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): BindingPage + { + $options = new Values($options); + + $params = Values::of([ + 'BindingType' => + $options['bindingType'], + 'Identity' => + Serialize::map($options['identity'], function ($e) { return $e; }), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new BindingPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of BindingInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return BindingPage Page of BindingInstance + */ + public function getPage(string $targetUrl): BindingPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new BindingPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a BindingContext + * + * @param string $sid The SID of the Binding resource to delete. + */ + public function getContext( + string $sid + + ): BindingContext + { + return new BindingContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.BindingList]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V2/Service/BindingOptions.php b/app/api/Twilio/Rest/Chat/V2/Service/BindingOptions.php new file mode 100755 index 0000000..fd7ea4b --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/BindingOptions.php @@ -0,0 +1,98 @@ +options['bindingType'] = $bindingType; + $this->options['identity'] = $identity; + } + + /** + * The push technology used by the Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. + * + * @param string $bindingType The push technology used by the Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. + * @return $this Fluent Builder + */ + public function setBindingType(array $bindingType): self + { + $this->options['bindingType'] = $bindingType; + return $this; + } + + /** + * The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. + * + * @param string[] $identity The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. + * @return $this Fluent Builder + */ + public function setIdentity(array $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.ReadBindingOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V2/Service/BindingPage.php b/app/api/Twilio/Rest/Chat/V2/Service/BindingPage.php new file mode 100755 index 0000000..cfc73bd --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/BindingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return BindingInstance \Twilio\Rest\Chat\V2\Service\BindingInstance + */ + public function buildInstance(array $payload): BindingInstance + { + return new BindingInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.BindingPage]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V2/Service/Channel/InviteContext.php b/app/api/Twilio/Rest/Chat/V2/Service/Channel/InviteContext.php new file mode 100755 index 0000000..032b3e0 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/Channel/InviteContext.php @@ -0,0 +1,106 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'channelSid' => + $channelSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Invites/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the InviteInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the InviteInstance + * + * @return InviteInstance Fetched InviteInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InviteInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new InviteInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.InviteContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V2/Service/Channel/InviteInstance.php b/app/api/Twilio/Rest/Chat/V2/Service/Channel/InviteInstance.php new file mode 100755 index 0000000..996f068 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/Channel/InviteInstance.php @@ -0,0 +1,150 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'channelSid' => Values::array_get($payload, 'channel_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'roleSid' => Values::array_get($payload, 'role_sid'), + 'createdBy' => Values::array_get($payload, 'created_by'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return InviteContext Context for this InviteInstance + */ + protected function proxy(): InviteContext + { + if (!$this->context) { + $this->context = new InviteContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the InviteInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the InviteInstance + * + * @return InviteInstance Fetched InviteInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InviteInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.InviteInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V2/Service/Channel/InviteList.php b/app/api/Twilio/Rest/Chat/V2/Service/Channel/InviteList.php new file mode 100755 index 0000000..f532d89 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/Channel/InviteList.php @@ -0,0 +1,215 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'channelSid' => + $channelSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Invites'; + } + + /** + * Create the InviteInstance + * + * @param string $identity The `identity` value that uniquely identifies the new resource's [User](https://www.twilio.com/docs/chat/rest/user-resource) within the [Service](https://www.twilio.com/docs/chat/rest/service-resource). See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more info. + * @param array|Options $options Optional Arguments + * @return InviteInstance Created InviteInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $identity, array $options = []): InviteInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Identity' => + $identity, + 'RoleSid' => + $options['roleSid'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new InviteInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'] + ); + } + + + /** + * Reads InviteInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return InviteInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams InviteInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of InviteInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return InvitePage Page of InviteInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): InvitePage + { + $options = new Values($options); + + $params = Values::of([ + 'Identity' => + Serialize::map($options['identity'], function ($e) { return $e; }), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new InvitePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of InviteInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return InvitePage Page of InviteInstance + */ + public function getPage(string $targetUrl): InvitePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new InvitePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a InviteContext + * + * @param string $sid The SID of the Invite resource to delete. + */ + public function getContext( + string $sid + + ): InviteContext + { + return new InviteContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.InviteList]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V2/Service/Channel/InviteOptions.php b/app/api/Twilio/Rest/Chat/V2/Service/Channel/InviteOptions.php new file mode 100755 index 0000000..44ca444 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/Channel/InviteOptions.php @@ -0,0 +1,132 @@ +options['roleSid'] = $roleSid; + } + + /** + * The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) assigned to the new member. + * + * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) assigned to the new member. + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.CreateInviteOptions ' . $options . ']'; + } +} + + + +class ReadInviteOptions extends Options + { + /** + * @param string[] $identity The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. + */ + public function __construct( + + array $identity = Values::ARRAY_NONE + + ) { + $this->options['identity'] = $identity; + } + + /** + * The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. + * + * @param string[] $identity The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. + * @return $this Fluent Builder + */ + public function setIdentity(array $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.ReadInviteOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V2/Service/Channel/InvitePage.php b/app/api/Twilio/Rest/Chat/V2/Service/Channel/InvitePage.php new file mode 100755 index 0000000..3b1baa6 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/Channel/InvitePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InviteInstance \Twilio\Rest\Chat\V2\Service\Channel\InviteInstance + */ + public function buildInstance(array $payload): InviteInstance + { + return new InviteInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.InvitePage]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V2/Service/Channel/MemberContext.php b/app/api/Twilio/Rest/Chat/V2/Service/Channel/MemberContext.php new file mode 100755 index 0000000..90212e7 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/Channel/MemberContext.php @@ -0,0 +1,155 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'channelSid' => + $channelSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Members/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the MemberInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the MemberInstance + * + * @return MemberInstance Fetched MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MemberInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new MemberInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the MemberInstance + * + * @param array|Options $options Optional Arguments + * @return MemberInstance Updated MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MemberInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'RoleSid' => + $options['roleSid'], + 'LastConsumedMessageIndex' => + $options['lastConsumedMessageIndex'], + 'LastConsumptionTimestamp' => + Serialize::iso8601DateTime($options['lastConsumptionTimestamp']), + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'Attributes' => + $options['attributes'], + ]); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new MemberInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.MemberContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V2/Service/Channel/MemberInstance.php b/app/api/Twilio/Rest/Chat/V2/Service/Channel/MemberInstance.php new file mode 100755 index 0000000..7c6f19b --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/Channel/MemberInstance.php @@ -0,0 +1,169 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'channelSid' => Values::array_get($payload, 'channel_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'roleSid' => Values::array_get($payload, 'role_sid'), + 'lastConsumedMessageIndex' => Values::array_get($payload, 'last_consumed_message_index'), + 'lastConsumptionTimestamp' => Deserialize::dateTime(Values::array_get($payload, 'last_consumption_timestamp')), + 'url' => Values::array_get($payload, 'url'), + 'attributes' => Values::array_get($payload, 'attributes'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return MemberContext Context for this MemberInstance + */ + protected function proxy(): MemberContext + { + if (!$this->context) { + $this->context = new MemberContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the MemberInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the MemberInstance + * + * @return MemberInstance Fetched MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MemberInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the MemberInstance + * + * @param array|Options $options Optional Arguments + * @return MemberInstance Updated MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MemberInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.MemberInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V2/Service/Channel/MemberList.php b/app/api/Twilio/Rest/Chat/V2/Service/Channel/MemberList.php new file mode 100755 index 0000000..0e70ed1 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/Channel/MemberList.php @@ -0,0 +1,227 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'channelSid' => + $channelSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Members'; + } + + /** + * Create the MemberInstance + * + * @param string $identity The `identity` value that uniquely identifies the new resource's [User](https://www.twilio.com/docs/chat/rest/user-resource) within the [Service](https://www.twilio.com/docs/chat/rest/service-resource). See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more info. + * @param array|Options $options Optional Arguments + * @return MemberInstance Created MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $identity, array $options = []): MemberInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Identity' => + $identity, + 'RoleSid' => + $options['roleSid'], + 'LastConsumedMessageIndex' => + $options['lastConsumedMessageIndex'], + 'LastConsumptionTimestamp' => + Serialize::iso8601DateTime($options['lastConsumptionTimestamp']), + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'Attributes' => + $options['attributes'], + ]); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new MemberInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'] + ); + } + + + /** + * Reads MemberInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return MemberInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams MemberInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of MemberInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return MemberPage Page of MemberInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MemberPage + { + $options = new Values($options); + + $params = Values::of([ + 'Identity' => + Serialize::map($options['identity'], function ($e) { return $e; }), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new MemberPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of MemberInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return MemberPage Page of MemberInstance + */ + public function getPage(string $targetUrl): MemberPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new MemberPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a MemberContext + * + * @param string $sid The SID of the Member resource to delete. This value can be either the Member's `sid` or its `identity` value. + */ + public function getContext( + string $sid + + ): MemberContext + { + return new MemberContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.MemberList]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V2/Service/Channel/MemberOptions.php b/app/api/Twilio/Rest/Chat/V2/Service/Channel/MemberOptions.php new file mode 100755 index 0000000..9680a49 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/Channel/MemberOptions.php @@ -0,0 +1,450 @@ +options['roleSid'] = $roleSid; + $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; + $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['attributes'] = $attributes; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/rest/service-resource). + * + * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/rest/service-resource). + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) in the [Channel](https://www.twilio.com/docs/chat/channels) that the Member has read. This parameter should only be used when recreating a Member from a backup/separate source. + * + * @param int $lastConsumedMessageIndex The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) in the [Channel](https://www.twilio.com/docs/chat/channels) that the Member has read. This parameter should only be used when recreating a Member from a backup/separate source. + * @return $this Fluent Builder + */ + public function setLastConsumedMessageIndex(int $lastConsumedMessageIndex): self + { + $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; + return $this; + } + + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). + * + * @param \DateTime $lastConsumptionTimestamp The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). + * @return $this Fluent Builder + */ + public function setLastConsumptionTimestamp(\DateTime $lastConsumptionTimestamp): self + { + $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; + return $this; + } + + /** + * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this parameter should only be used when a Member is being recreated from a backup/separate source. + * + * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this parameter should only be used when a Member is being recreated from a backup/separate source. + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. The default value is `null`. Note that this parameter should only be used when a Member is being recreated from a backup/separate source and where a Member was previously updated. + * + * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. The default value is `null`. Note that this parameter should only be used when a Member is being recreated from a backup/separate source and where a Member was previously updated. + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * A valid JSON string that contains application-specific data. + * + * @param string $attributes A valid JSON string that contains application-specific data. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.CreateMemberOptions ' . $options . ']'; + } +} + +class DeleteMemberOptions extends Options + { + /** + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.DeleteMemberOptions ' . $options . ']'; + } +} + + +class ReadMemberOptions extends Options + { + /** + * @param string[] $identity The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the Member resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. + */ + public function __construct( + + array $identity = Values::ARRAY_NONE + + ) { + $this->options['identity'] = $identity; + } + + /** + * The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the Member resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. + * + * @param string[] $identity The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the Member resources to read. See [access tokens](https://www.twilio.com/docs/chat/create-tokens) for more details. + * @return $this Fluent Builder + */ + public function setIdentity(array $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.ReadMemberOptions ' . $options . ']'; + } +} + +class UpdateMemberOptions extends Options + { + /** + * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/rest/service-resource). + * @param int $lastConsumedMessageIndex The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) that the Member has read within the [Channel](https://www.twilio.com/docs/chat/channels). + * @param \DateTime $lastConsumptionTimestamp The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). + * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this parameter should only be used when a Member is being recreated from a backup/separate source. + * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. + * @param string $attributes A valid JSON string that contains application-specific data. + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $roleSid = Values::NONE, + int $lastConsumedMessageIndex = Values::INT_NONE, + \DateTime $lastConsumptionTimestamp = null, + \DateTime $dateCreated = null, + \DateTime $dateUpdated = null, + string $attributes = Values::NONE, + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['roleSid'] = $roleSid; + $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; + $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['attributes'] = $attributes; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/rest/service-resource). + * + * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the member. The default roles are those specified on the [Service](https://www.twilio.com/docs/chat/rest/service-resource). + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) that the Member has read within the [Channel](https://www.twilio.com/docs/chat/channels). + * + * @param int $lastConsumedMessageIndex The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) that the Member has read within the [Channel](https://www.twilio.com/docs/chat/channels). + * @return $this Fluent Builder + */ + public function setLastConsumedMessageIndex(int $lastConsumedMessageIndex): self + { + $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; + return $this; + } + + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). + * + * @param \DateTime $lastConsumptionTimestamp The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). + * @return $this Fluent Builder + */ + public function setLastConsumptionTimestamp(\DateTime $lastConsumptionTimestamp): self + { + $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; + return $this; + } + + /** + * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this parameter should only be used when a Member is being recreated from a backup/separate source. + * + * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this parameter should only be used when a Member is being recreated from a backup/separate source. + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. + * + * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * A valid JSON string that contains application-specific data. + * + * @param string $attributes A valid JSON string that contains application-specific data. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.UpdateMemberOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V2/Service/Channel/MemberPage.php b/app/api/Twilio/Rest/Chat/V2/Service/Channel/MemberPage.php new file mode 100755 index 0000000..5d1400c --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/Channel/MemberPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MemberInstance \Twilio\Rest\Chat\V2\Service\Channel\MemberInstance + */ + public function buildInstance(array $payload): MemberInstance + { + return new MemberInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.MemberPage]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V2/Service/Channel/MessageContext.php b/app/api/Twilio/Rest/Chat/V2/Service/Channel/MessageContext.php new file mode 100755 index 0000000..5e97b56 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/Channel/MessageContext.php @@ -0,0 +1,155 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'channelSid' => + $channelSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Messages/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the MessageInstance + * + * @return MessageInstance Fetched MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MessageInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new MessageInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return MessageInstance Updated MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MessageInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Body' => + $options['body'], + 'Attributes' => + $options['attributes'], + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'LastUpdatedBy' => + $options['lastUpdatedBy'], + 'From' => + $options['from'], + ]); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new MessageInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.MessageContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V2/Service/Channel/MessageInstance.php b/app/api/Twilio/Rest/Chat/V2/Service/Channel/MessageInstance.php new file mode 100755 index 0000000..81493f9 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/Channel/MessageInstance.php @@ -0,0 +1,177 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'to' => Values::array_get($payload, 'to'), + 'channelSid' => Values::array_get($payload, 'channel_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'lastUpdatedBy' => Values::array_get($payload, 'last_updated_by'), + 'wasEdited' => Values::array_get($payload, 'was_edited'), + 'from' => Values::array_get($payload, 'from'), + 'body' => Values::array_get($payload, 'body'), + 'index' => Values::array_get($payload, 'index'), + 'type' => Values::array_get($payload, 'type'), + 'media' => Values::array_get($payload, 'media'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return MessageContext Context for this MessageInstance + */ + protected function proxy(): MessageContext + { + if (!$this->context) { + $this->context = new MessageContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the MessageInstance + * + * @return MessageInstance Fetched MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MessageInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return MessageInstance Updated MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MessageInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.MessageInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V2/Service/Channel/MessageList.php b/app/api/Twilio/Rest/Chat/V2/Service/Channel/MessageList.php new file mode 100755 index 0000000..9e371e5 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/Channel/MessageList.php @@ -0,0 +1,226 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'channelSid' => + $channelSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Messages'; + } + + /** + * Create the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return MessageInstance Created MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): MessageInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'From' => + $options['from'], + 'Attributes' => + $options['attributes'], + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'LastUpdatedBy' => + $options['lastUpdatedBy'], + 'Body' => + $options['body'], + 'MediaSid' => + $options['mediaSid'], + ]); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new MessageInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'] + ); + } + + + /** + * Reads MessageInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return MessageInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams MessageInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of MessageInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return MessagePage Page of MessageInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MessagePage + { + $options = new Values($options); + + $params = Values::of([ + 'Order' => + $options['order'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new MessagePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of MessageInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return MessagePage Page of MessageInstance + */ + public function getPage(string $targetUrl): MessagePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new MessagePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a MessageContext + * + * @param string $sid The SID of the Message resource to delete. + */ + public function getContext( + string $sid + + ): MessageContext + { + return new MessageContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.MessageList]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V2/Service/Channel/MessageOptions.php b/app/api/Twilio/Rest/Chat/V2/Service/Channel/MessageOptions.php new file mode 100755 index 0000000..f816ad3 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/Channel/MessageOptions.php @@ -0,0 +1,468 @@ +options['from'] = $from; + $this->options['attributes'] = $attributes; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['lastUpdatedBy'] = $lastUpdatedBy; + $this->options['body'] = $body; + $this->options['mediaSid'] = $mediaSid; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The [Identity](https://www.twilio.com/docs/chat/identity) of the new message's author. The default value is `system`. + * + * @param string $from The [Identity](https://www.twilio.com/docs/chat/identity) of the new message's author. The default value is `system`. + * @return $this Fluent Builder + */ + public function setFrom(string $from): self + { + $this->options['from'] = $from; + return $this; + } + + /** + * A valid JSON string that contains application-specific data. + * + * @param string $attributes A valid JSON string that contains application-specific data. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. This parameter should only be used when a Chat's history is being recreated from a backup/separate source. + * + * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. This parameter should only be used when a Chat's history is being recreated from a backup/separate source. + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. + * + * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * The [Identity](https://www.twilio.com/docs/chat/identity) of the User who last updated the Message, if applicable. + * + * @param string $lastUpdatedBy The [Identity](https://www.twilio.com/docs/chat/identity) of the User who last updated the Message, if applicable. + * @return $this Fluent Builder + */ + public function setLastUpdatedBy(string $lastUpdatedBy): self + { + $this->options['lastUpdatedBy'] = $lastUpdatedBy; + return $this; + } + + /** + * The message to send to the channel. Can be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. + * + * @param string $body The message to send to the channel. Can be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. + * @return $this Fluent Builder + */ + public function setBody(string $body): self + { + $this->options['body'] = $body; + return $this; + } + + /** + * The SID of the [Media](https://www.twilio.com/docs/chat/rest/media) to attach to the new Message. + * + * @param string $mediaSid The SID of the [Media](https://www.twilio.com/docs/chat/rest/media) to attach to the new Message. + * @return $this Fluent Builder + */ + public function setMediaSid(string $mediaSid): self + { + $this->options['mediaSid'] = $mediaSid; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.CreateMessageOptions ' . $options . ']'; + } +} + +class DeleteMessageOptions extends Options + { + /** + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.DeleteMessageOptions ' . $options . ']'; + } +} + + +class ReadMessageOptions extends Options + { + /** + * @param string $order The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending) with `asc` as the default. + */ + public function __construct( + + string $order = Values::NONE + + ) { + $this->options['order'] = $order; + } + + /** + * The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending) with `asc` as the default. + * + * @param string $order The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending) with `asc` as the default. + * @return $this Fluent Builder + */ + public function setOrder(string $order): self + { + $this->options['order'] = $order; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.ReadMessageOptions ' . $options . ']'; + } +} + +class UpdateMessageOptions extends Options + { + /** + * @param string $body The message to send to the channel. Can be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. + * @param string $attributes A valid JSON string that contains application-specific data. + * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. This parameter should only be used when a Chat's history is being recreated from a backup/separate source. + * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. + * @param string $lastUpdatedBy The [Identity](https://www.twilio.com/docs/chat/identity) of the User who last updated the Message, if applicable. + * @param string $from The [Identity](https://www.twilio.com/docs/chat/identity) of the message's author. + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $body = Values::NONE, + string $attributes = Values::NONE, + \DateTime $dateCreated = null, + \DateTime $dateUpdated = null, + string $lastUpdatedBy = Values::NONE, + string $from = Values::NONE, + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['body'] = $body; + $this->options['attributes'] = $attributes; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['lastUpdatedBy'] = $lastUpdatedBy; + $this->options['from'] = $from; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The message to send to the channel. Can be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. + * + * @param string $body The message to send to the channel. Can be an empty string or `null`, which sets the value as an empty string. You can send structured data in the body by serializing it as a string. + * @return $this Fluent Builder + */ + public function setBody(string $body): self + { + $this->options['body'] = $body; + return $this; + } + + /** + * A valid JSON string that contains application-specific data. + * + * @param string $attributes A valid JSON string that contains application-specific data. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. This parameter should only be used when a Chat's history is being recreated from a backup/separate source. + * + * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. This parameter should only be used when a Chat's history is being recreated from a backup/separate source. + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. + * + * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * The [Identity](https://www.twilio.com/docs/chat/identity) of the User who last updated the Message, if applicable. + * + * @param string $lastUpdatedBy The [Identity](https://www.twilio.com/docs/chat/identity) of the User who last updated the Message, if applicable. + * @return $this Fluent Builder + */ + public function setLastUpdatedBy(string $lastUpdatedBy): self + { + $this->options['lastUpdatedBy'] = $lastUpdatedBy; + return $this; + } + + /** + * The [Identity](https://www.twilio.com/docs/chat/identity) of the message's author. + * + * @param string $from The [Identity](https://www.twilio.com/docs/chat/identity) of the message's author. + * @return $this Fluent Builder + */ + public function setFrom(string $from): self + { + $this->options['from'] = $from; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.UpdateMessageOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V2/Service/Channel/MessagePage.php b/app/api/Twilio/Rest/Chat/V2/Service/Channel/MessagePage.php new file mode 100755 index 0000000..8103077 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/Channel/MessagePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MessageInstance \Twilio\Rest\Chat\V2\Service\Channel\MessageInstance + */ + public function buildInstance(array $payload): MessageInstance + { + return new MessageInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.MessagePage]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V2/Service/Channel/WebhookContext.php b/app/api/Twilio/Rest/Chat/V2/Service/Channel/WebhookContext.php new file mode 100755 index 0000000..4d2efaa --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/Channel/WebhookContext.php @@ -0,0 +1,148 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'channelSid' => + $channelSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Webhooks/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the WebhookInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the WebhookInstance + * + * @return WebhookInstance Fetched WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WebhookInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new WebhookInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the WebhookInstance + * + * @param array|Options $options Optional Arguments + * @return WebhookInstance Updated WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WebhookInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Configuration.Url' => + $options['configurationUrl'], + 'Configuration.Method' => + $options['configurationMethod'], + 'Configuration.Filters' => + Serialize::map($options['configurationFilters'], function ($e) { return $e; }), + 'Configuration.Triggers' => + Serialize::map($options['configurationTriggers'], function ($e) { return $e; }), + 'Configuration.FlowSid' => + $options['configurationFlowSid'], + 'Configuration.RetryCount' => + $options['configurationRetryCount'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new WebhookInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.WebhookContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V2/Service/Channel/WebhookInstance.php b/app/api/Twilio/Rest/Chat/V2/Service/Channel/WebhookInstance.php new file mode 100755 index 0000000..3c5ac97 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/Channel/WebhookInstance.php @@ -0,0 +1,162 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'channelSid' => Values::array_get($payload, 'channel_sid'), + 'type' => Values::array_get($payload, 'type'), + 'url' => Values::array_get($payload, 'url'), + 'configuration' => Values::array_get($payload, 'configuration'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return WebhookContext Context for this WebhookInstance + */ + protected function proxy(): WebhookContext + { + if (!$this->context) { + $this->context = new WebhookContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the WebhookInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the WebhookInstance + * + * @return WebhookInstance Fetched WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WebhookInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the WebhookInstance + * + * @param array|Options $options Optional Arguments + * @return WebhookInstance Updated WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WebhookInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.WebhookInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V2/Service/Channel/WebhookList.php b/app/api/Twilio/Rest/Chat/V2/Service/Channel/WebhookList.php new file mode 100755 index 0000000..5c51518 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/Channel/WebhookList.php @@ -0,0 +1,219 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'channelSid' => + $channelSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Webhooks'; + } + + /** + * Create the WebhookInstance + * + * @param string $type + * @param array|Options $options Optional Arguments + * @return WebhookInstance Created WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $type, array $options = []): WebhookInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Type' => + $type, + 'Configuration.Url' => + $options['configurationUrl'], + 'Configuration.Method' => + $options['configurationMethod'], + 'Configuration.Filters' => + Serialize::map($options['configurationFilters'], function ($e) { return $e; }), + 'Configuration.Triggers' => + Serialize::map($options['configurationTriggers'], function ($e) { return $e; }), + 'Configuration.FlowSid' => + $options['configurationFlowSid'], + 'Configuration.RetryCount' => + $options['configurationRetryCount'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new WebhookInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'] + ); + } + + + /** + * Reads WebhookInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return WebhookInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams WebhookInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of WebhookInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return WebhookPage Page of WebhookInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): WebhookPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new WebhookPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of WebhookInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return WebhookPage Page of WebhookInstance + */ + public function getPage(string $targetUrl): WebhookPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new WebhookPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a WebhookContext + * + * @param string $sid The SID of the Channel Webhook resource to delete. + */ + public function getContext( + string $sid + + ): WebhookContext + { + return new WebhookContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.WebhookList]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V2/Service/Channel/WebhookOptions.php b/app/api/Twilio/Rest/Chat/V2/Service/Channel/WebhookOptions.php new file mode 100755 index 0000000..058a651 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/Channel/WebhookOptions.php @@ -0,0 +1,310 @@ +options['configurationUrl'] = $configurationUrl; + $this->options['configurationMethod'] = $configurationMethod; + $this->options['configurationFilters'] = $configurationFilters; + $this->options['configurationTriggers'] = $configurationTriggers; + $this->options['configurationFlowSid'] = $configurationFlowSid; + $this->options['configurationRetryCount'] = $configurationRetryCount; + } + + /** + * The URL of the webhook to call using the `configuration.method`. + * + * @param string $configurationUrl The URL of the webhook to call using the `configuration.method`. + * @return $this Fluent Builder + */ + public function setConfigurationUrl(string $configurationUrl): self + { + $this->options['configurationUrl'] = $configurationUrl; + return $this; + } + + /** + * @param string $configurationMethod + * @return $this Fluent Builder + */ + public function setConfigurationMethod(string $configurationMethod): self + { + $this->options['configurationMethod'] = $configurationMethod; + return $this; + } + + /** + * The events that cause us to call the Channel Webhook. Used when `type` is `webhook`. This parameter takes only one event. To specify more than one event, repeat this parameter for each event. For the list of possible events, see [Webhook Event Triggers](https://www.twilio.com/docs/chat/webhook-events#webhook-event-trigger). + * + * @param string[] $configurationFilters The events that cause us to call the Channel Webhook. Used when `type` is `webhook`. This parameter takes only one event. To specify more than one event, repeat this parameter for each event. For the list of possible events, see [Webhook Event Triggers](https://www.twilio.com/docs/chat/webhook-events#webhook-event-trigger). + * @return $this Fluent Builder + */ + public function setConfigurationFilters(array $configurationFilters): self + { + $this->options['configurationFilters'] = $configurationFilters; + return $this; + } + + /** + * A string that will cause us to call the webhook when it is present in a message body. This parameter takes only one trigger string. To specify more than one, repeat this parameter for each trigger string up to a total of 5 trigger strings. Used only when `type` = `trigger`. + * + * @param string[] $configurationTriggers A string that will cause us to call the webhook when it is present in a message body. This parameter takes only one trigger string. To specify more than one, repeat this parameter for each trigger string up to a total of 5 trigger strings. Used only when `type` = `trigger`. + * @return $this Fluent Builder + */ + public function setConfigurationTriggers(array $configurationTriggers): self + { + $this->options['configurationTriggers'] = $configurationTriggers; + return $this; + } + + /** + * The SID of the Studio [Flow](https://www.twilio.com/docs/studio/rest-api/flow) to call when an event in `configuration.filters` occurs. Used only when `type` is `studio`. + * + * @param string $configurationFlowSid The SID of the Studio [Flow](https://www.twilio.com/docs/studio/rest-api/flow) to call when an event in `configuration.filters` occurs. Used only when `type` is `studio`. + * @return $this Fluent Builder + */ + public function setConfigurationFlowSid(string $configurationFlowSid): self + { + $this->options['configurationFlowSid'] = $configurationFlowSid; + return $this; + } + + /** + * The number of times to retry the webhook if the first attempt fails. Can be an integer between 0 and 3, inclusive, and the default is 0. + * + * @param int $configurationRetryCount The number of times to retry the webhook if the first attempt fails. Can be an integer between 0 and 3, inclusive, and the default is 0. + * @return $this Fluent Builder + */ + public function setConfigurationRetryCount(int $configurationRetryCount): self + { + $this->options['configurationRetryCount'] = $configurationRetryCount; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.CreateWebhookOptions ' . $options . ']'; + } +} + + + + +class UpdateWebhookOptions extends Options + { + /** + * @param string $configurationUrl The URL of the webhook to call using the `configuration.method`. + * @param string $configurationMethod + * @param string[] $configurationFilters The events that cause us to call the Channel Webhook. Used when `type` is `webhook`. This parameter takes only one event. To specify more than one event, repeat this parameter for each event. For the list of possible events, see [Webhook Event Triggers](https://www.twilio.com/docs/chat/webhook-events#webhook-event-trigger). + * @param string[] $configurationTriggers A string that will cause us to call the webhook when it is present in a message body. This parameter takes only one trigger string. To specify more than one, repeat this parameter for each trigger string up to a total of 5 trigger strings. Used only when `type` = `trigger`. + * @param string $configurationFlowSid The SID of the Studio [Flow](https://www.twilio.com/docs/studio/rest-api/flow) to call when an event in `configuration.filters` occurs. Used only when `type` = `studio`. + * @param int $configurationRetryCount The number of times to retry the webhook if the first attempt fails. Can be an integer between 0 and 3, inclusive, and the default is 0. + */ + public function __construct( + + string $configurationUrl = Values::NONE, + string $configurationMethod = Values::NONE, + array $configurationFilters = Values::ARRAY_NONE, + array $configurationTriggers = Values::ARRAY_NONE, + string $configurationFlowSid = Values::NONE, + int $configurationRetryCount = Values::INT_NONE + + ) { + $this->options['configurationUrl'] = $configurationUrl; + $this->options['configurationMethod'] = $configurationMethod; + $this->options['configurationFilters'] = $configurationFilters; + $this->options['configurationTriggers'] = $configurationTriggers; + $this->options['configurationFlowSid'] = $configurationFlowSid; + $this->options['configurationRetryCount'] = $configurationRetryCount; + } + + /** + * The URL of the webhook to call using the `configuration.method`. + * + * @param string $configurationUrl The URL of the webhook to call using the `configuration.method`. + * @return $this Fluent Builder + */ + public function setConfigurationUrl(string $configurationUrl): self + { + $this->options['configurationUrl'] = $configurationUrl; + return $this; + } + + /** + * @param string $configurationMethod + * @return $this Fluent Builder + */ + public function setConfigurationMethod(string $configurationMethod): self + { + $this->options['configurationMethod'] = $configurationMethod; + return $this; + } + + /** + * The events that cause us to call the Channel Webhook. Used when `type` is `webhook`. This parameter takes only one event. To specify more than one event, repeat this parameter for each event. For the list of possible events, see [Webhook Event Triggers](https://www.twilio.com/docs/chat/webhook-events#webhook-event-trigger). + * + * @param string[] $configurationFilters The events that cause us to call the Channel Webhook. Used when `type` is `webhook`. This parameter takes only one event. To specify more than one event, repeat this parameter for each event. For the list of possible events, see [Webhook Event Triggers](https://www.twilio.com/docs/chat/webhook-events#webhook-event-trigger). + * @return $this Fluent Builder + */ + public function setConfigurationFilters(array $configurationFilters): self + { + $this->options['configurationFilters'] = $configurationFilters; + return $this; + } + + /** + * A string that will cause us to call the webhook when it is present in a message body. This parameter takes only one trigger string. To specify more than one, repeat this parameter for each trigger string up to a total of 5 trigger strings. Used only when `type` = `trigger`. + * + * @param string[] $configurationTriggers A string that will cause us to call the webhook when it is present in a message body. This parameter takes only one trigger string. To specify more than one, repeat this parameter for each trigger string up to a total of 5 trigger strings. Used only when `type` = `trigger`. + * @return $this Fluent Builder + */ + public function setConfigurationTriggers(array $configurationTriggers): self + { + $this->options['configurationTriggers'] = $configurationTriggers; + return $this; + } + + /** + * The SID of the Studio [Flow](https://www.twilio.com/docs/studio/rest-api/flow) to call when an event in `configuration.filters` occurs. Used only when `type` = `studio`. + * + * @param string $configurationFlowSid The SID of the Studio [Flow](https://www.twilio.com/docs/studio/rest-api/flow) to call when an event in `configuration.filters` occurs. Used only when `type` = `studio`. + * @return $this Fluent Builder + */ + public function setConfigurationFlowSid(string $configurationFlowSid): self + { + $this->options['configurationFlowSid'] = $configurationFlowSid; + return $this; + } + + /** + * The number of times to retry the webhook if the first attempt fails. Can be an integer between 0 and 3, inclusive, and the default is 0. + * + * @param int $configurationRetryCount The number of times to retry the webhook if the first attempt fails. Can be an integer between 0 and 3, inclusive, and the default is 0. + * @return $this Fluent Builder + */ + public function setConfigurationRetryCount(int $configurationRetryCount): self + { + $this->options['configurationRetryCount'] = $configurationRetryCount; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.UpdateWebhookOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V2/Service/Channel/WebhookPage.php b/app/api/Twilio/Rest/Chat/V2/Service/Channel/WebhookPage.php new file mode 100755 index 0000000..76343a5 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/Channel/WebhookPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WebhookInstance \Twilio\Rest\Chat\V2\Service\Channel\WebhookInstance + */ + public function buildInstance(array $payload): WebhookInstance + { + return new WebhookInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.WebhookPage]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V2/Service/ChannelContext.php b/app/api/Twilio/Rest/Chat/V2/Service/ChannelContext.php new file mode 100755 index 0000000..38e4afd --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/ChannelContext.php @@ -0,0 +1,267 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ChannelInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ChannelInstance + * + * @return ChannelInstance Fetched ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ChannelInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ChannelInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ChannelInstance + * + * @param array|Options $options Optional Arguments + * @return ChannelInstance Updated ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ChannelInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'UniqueName' => + $options['uniqueName'], + 'Attributes' => + $options['attributes'], + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'CreatedBy' => + $options['createdBy'], + ]); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ChannelInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the members + */ + protected function getMembers(): MemberList + { + if (!$this->_members) { + $this->_members = new MemberList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_members; + } + + /** + * Access the invites + */ + protected function getInvites(): InviteList + { + if (!$this->_invites) { + $this->_invites = new InviteList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_invites; + } + + /** + * Access the webhooks + */ + protected function getWebhooks(): WebhookList + { + if (!$this->_webhooks) { + $this->_webhooks = new WebhookList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_webhooks; + } + + /** + * Access the messages + */ + protected function getMessages(): MessageList + { + if (!$this->_messages) { + $this->_messages = new MessageList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_messages; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.ChannelContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V2/Service/ChannelInstance.php b/app/api/Twilio/Rest/Chat/V2/Service/ChannelInstance.php new file mode 100755 index 0000000..6a1bdea --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/ChannelInstance.php @@ -0,0 +1,212 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'type' => Values::array_get($payload, 'type'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'createdBy' => Values::array_get($payload, 'created_by'), + 'membersCount' => Values::array_get($payload, 'members_count'), + 'messagesCount' => Values::array_get($payload, 'messages_count'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ChannelContext Context for this ChannelInstance + */ + protected function proxy(): ChannelContext + { + if (!$this->context) { + $this->context = new ChannelContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ChannelInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the ChannelInstance + * + * @return ChannelInstance Fetched ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ChannelInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ChannelInstance + * + * @param array|Options $options Optional Arguments + * @return ChannelInstance Updated ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ChannelInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the members + */ + protected function getMembers(): MemberList + { + return $this->proxy()->members; + } + + /** + * Access the invites + */ + protected function getInvites(): InviteList + { + return $this->proxy()->invites; + } + + /** + * Access the webhooks + */ + protected function getWebhooks(): WebhookList + { + return $this->proxy()->webhooks; + } + + /** + * Access the messages + */ + protected function getMessages(): MessageList + { + return $this->proxy()->messages; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.ChannelInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V2/Service/ChannelList.php b/app/api/Twilio/Rest/Chat/V2/Service/ChannelList.php new file mode 100755 index 0000000..dac1be5 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/ChannelList.php @@ -0,0 +1,218 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels'; + } + + /** + * Create the ChannelInstance + * + * @param array|Options $options Optional Arguments + * @return ChannelInstance Created ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): ChannelInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'UniqueName' => + $options['uniqueName'], + 'Attributes' => + $options['attributes'], + 'Type' => + $options['type'], + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'CreatedBy' => + $options['createdBy'], + ]); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ChannelInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads ChannelInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ChannelInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams ChannelInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ChannelInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ChannelPage Page of ChannelInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ChannelPage + { + $options = new Values($options); + + $params = Values::of([ + 'Type' => + $options['type'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ChannelPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ChannelInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ChannelPage Page of ChannelInstance + */ + public function getPage(string $targetUrl): ChannelPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ChannelPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ChannelContext + * + * @param string $sid The SID of the Channel resource to delete. This value can be either the `sid` or the `unique_name` of the Channel resource to delete. + */ + public function getContext( + string $sid + + ): ChannelContext + { + return new ChannelContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.ChannelList]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V2/Service/ChannelOptions.php b/app/api/Twilio/Rest/Chat/V2/Service/ChannelOptions.php new file mode 100755 index 0000000..2bab80a --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/ChannelOptions.php @@ -0,0 +1,466 @@ +options['friendlyName'] = $friendlyName; + $this->options['uniqueName'] = $uniqueName; + $this->options['attributes'] = $attributes; + $this->options['type'] = $type; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['createdBy'] = $createdBy; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * A descriptive string that you create to describe the new resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the Channel resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the Channel resource's `sid` in the URL. This value must be 64 characters or less in length and be unique within the Service. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * A valid JSON string that contains application-specific data. + * + * @param string $attributes A valid JSON string that contains application-specific data. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * @param string $type + * @return $this Fluent Builder + */ + public function setType(string $type): self + { + $this->options['type'] = $type; + return $this; + } + + /** + * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this should only be used in cases where a Channel is being recreated from a backup/separate source. + * + * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this should only be used in cases where a Channel is being recreated from a backup/separate source. + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. The default value is `null`. Note that this parameter should only be used in cases where a Channel is being recreated from a backup/separate source and where a Message was previously updated. + * + * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. The default value is `null`. Note that this parameter should only be used in cases where a Channel is being recreated from a backup/separate source and where a Message was previously updated. + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * The `identity` of the User that created the channel. Default is: `system`. + * + * @param string $createdBy The `identity` of the User that created the channel. Default is: `system`. + * @return $this Fluent Builder + */ + public function setCreatedBy(string $createdBy): self + { + $this->options['createdBy'] = $createdBy; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.CreateChannelOptions ' . $options . ']'; + } +} + +class DeleteChannelOptions extends Options + { + /** + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.DeleteChannelOptions ' . $options . ']'; + } +} + + +class ReadChannelOptions extends Options + { + /** + * @param string $type The visibility of the Channels to read. Can be: `public` or `private` and defaults to `public`. + */ + public function __construct( + + array $type = Values::ARRAY_NONE + + ) { + $this->options['type'] = $type; + } + + /** + * The visibility of the Channels to read. Can be: `public` or `private` and defaults to `public`. + * + * @param string $type The visibility of the Channels to read. Can be: `public` or `private` and defaults to `public`. + * @return $this Fluent Builder + */ + public function setType(array $type): self + { + $this->options['type'] = $type; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.ReadChannelOptions ' . $options . ']'; + } +} + +class UpdateChannelOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 256 characters long. + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 256 characters or less in length and unique within the Service. + * @param string $attributes A valid JSON string that contains application-specific data. + * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this should only be used in cases where a Channel is being recreated from a backup/separate source. + * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. + * @param string $createdBy The `identity` of the User that created the channel. Default is: `system`. + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $uniqueName = Values::NONE, + string $attributes = Values::NONE, + \DateTime $dateCreated = null, + \DateTime $dateUpdated = null, + string $createdBy = Values::NONE, + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['uniqueName'] = $uniqueName; + $this->options['attributes'] = $attributes; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['createdBy'] = $createdBy; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 256 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 256 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 256 characters or less in length and unique within the Service. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. This value must be 256 characters or less in length and unique within the Service. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * A valid JSON string that contains application-specific data. + * + * @param string $attributes A valid JSON string that contains application-specific data. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this should only be used in cases where a Channel is being recreated from a backup/separate source. + * + * @param \DateTime $dateCreated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was created. The default value is the current time set by the Chat service. Note that this should only be used in cases where a Channel is being recreated from a backup/separate source. + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. + * + * @param \DateTime $dateUpdated The date, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format, to assign to the resource as the date it was last updated. + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * The `identity` of the User that created the channel. Default is: `system`. + * + * @param string $createdBy The `identity` of the User that created the channel. Default is: `system`. + * @return $this Fluent Builder + */ + public function setCreatedBy(string $createdBy): self + { + $this->options['createdBy'] = $createdBy; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.UpdateChannelOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V2/Service/ChannelPage.php b/app/api/Twilio/Rest/Chat/V2/Service/ChannelPage.php new file mode 100755 index 0000000..3d205d3 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/ChannelPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ChannelInstance \Twilio\Rest\Chat\V2\Service\ChannelInstance + */ + public function buildInstance(array $payload): ChannelInstance + { + return new ChannelInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.ChannelPage]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V2/Service/RoleContext.php b/app/api/Twilio/Rest/Chat/V2/Service/RoleContext.php new file mode 100755 index 0000000..4049317 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/RoleContext.php @@ -0,0 +1,128 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Roles/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the RoleInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the RoleInstance + * + * @return RoleInstance Fetched RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RoleInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new RoleInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the RoleInstance + * + * @param string[] $permission A permission that you grant to the role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. Note that the update action replaces all previously assigned permissions with those defined in the update action. To remove a permission, do not include it in the subsequent update action. The values for this parameter depend on the role's `type`. + * @return RoleInstance Updated RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $permission): RoleInstance + { + + $data = Values::of([ + 'Permission' => + Serialize::map($permission,function ($e) { return $e; }), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new RoleInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.RoleContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V2/Service/RoleInstance.php b/app/api/Twilio/Rest/Chat/V2/Service/RoleInstance.php new file mode 100755 index 0000000..2fb61b4 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/RoleInstance.php @@ -0,0 +1,159 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'type' => Values::array_get($payload, 'type'), + 'permissions' => Values::array_get($payload, 'permissions'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return RoleContext Context for this RoleInstance + */ + protected function proxy(): RoleContext + { + if (!$this->context) { + $this->context = new RoleContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the RoleInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the RoleInstance + * + * @return RoleInstance Fetched RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RoleInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the RoleInstance + * + * @param string[] $permission A permission that you grant to the role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. Note that the update action replaces all previously assigned permissions with those defined in the update action. To remove a permission, do not include it in the subsequent update action. The values for this parameter depend on the role's `type`. + * @return RoleInstance Updated RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $permission): RoleInstance + { + + return $this->proxy()->update($permission); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.RoleInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V2/Service/RoleList.php b/app/api/Twilio/Rest/Chat/V2/Service/RoleList.php new file mode 100755 index 0000000..7ebe42e --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/RoleList.php @@ -0,0 +1,201 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Roles'; + } + + /** + * Create the RoleInstance + * + * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. + * @param string $type + * @param string[] $permission A permission that you grant to the new role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. The values for this parameter depend on the role's `type`. + * @return RoleInstance Created RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $type, array $permission): RoleInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Type' => + $type, + 'Permission' => + Serialize::map($permission,function ($e) { return $e; }), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new RoleInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads RoleInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return RoleInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams RoleInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of RoleInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return RolePage Page of RoleInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): RolePage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new RolePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of RoleInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return RolePage Page of RoleInstance + */ + public function getPage(string $targetUrl): RolePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new RolePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a RoleContext + * + * @param string $sid The SID of the Role resource to delete. + */ + public function getContext( + string $sid + + ): RoleContext + { + return new RoleContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.RoleList]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V2/Service/RolePage.php b/app/api/Twilio/Rest/Chat/V2/Service/RolePage.php new file mode 100755 index 0000000..1e6a250 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/RolePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RoleInstance \Twilio\Rest\Chat\V2\Service\RoleInstance + */ + public function buildInstance(array $payload): RoleInstance + { + return new RoleInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.RolePage]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V2/Service/User/UserBindingContext.php b/app/api/Twilio/Rest/Chat/V2/Service/User/UserBindingContext.php new file mode 100755 index 0000000..634f2d9 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/User/UserBindingContext.php @@ -0,0 +1,106 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'userSid' => + $userSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Users/' . \rawurlencode($userSid) + .'/Bindings/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the UserBindingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the UserBindingInstance + * + * @return UserBindingInstance Fetched UserBindingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserBindingInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new UserBindingInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['userSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.UserBindingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V2/Service/User/UserBindingInstance.php b/app/api/Twilio/Rest/Chat/V2/Service/User/UserBindingInstance.php new file mode 100755 index 0000000..a0f0196 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/User/UserBindingInstance.php @@ -0,0 +1,154 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'endpoint' => Values::array_get($payload, 'endpoint'), + 'identity' => Values::array_get($payload, 'identity'), + 'userSid' => Values::array_get($payload, 'user_sid'), + 'credentialSid' => Values::array_get($payload, 'credential_sid'), + 'bindingType' => Values::array_get($payload, 'binding_type'), + 'messageTypes' => Values::array_get($payload, 'message_types'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'userSid' => $userSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return UserBindingContext Context for this UserBindingInstance + */ + protected function proxy(): UserBindingContext + { + if (!$this->context) { + $this->context = new UserBindingContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['userSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the UserBindingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the UserBindingInstance + * + * @return UserBindingInstance Fetched UserBindingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserBindingInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.UserBindingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V2/Service/User/UserBindingList.php b/app/api/Twilio/Rest/Chat/V2/Service/User/UserBindingList.php new file mode 100755 index 0000000..7eb60b0 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/User/UserBindingList.php @@ -0,0 +1,182 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'userSid' => + $userSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Users/' . \rawurlencode($userSid) + .'/Bindings'; + } + + /** + * Reads UserBindingInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return UserBindingInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams UserBindingInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of UserBindingInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return UserBindingPage Page of UserBindingInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): UserBindingPage + { + $options = new Values($options); + + $params = Values::of([ + 'BindingType' => + $options['bindingType'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new UserBindingPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of UserBindingInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return UserBindingPage Page of UserBindingInstance + */ + public function getPage(string $targetUrl): UserBindingPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new UserBindingPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a UserBindingContext + * + * @param string $sid The SID of the User Binding resource to delete. + */ + public function getContext( + string $sid + + ): UserBindingContext + { + return new UserBindingContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['userSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.UserBindingList]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V2/Service/User/UserBindingOptions.php b/app/api/Twilio/Rest/Chat/V2/Service/User/UserBindingOptions.php new file mode 100755 index 0000000..5362eaf --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/User/UserBindingOptions.php @@ -0,0 +1,80 @@ +options['bindingType'] = $bindingType; + } + + /** + * The push technology used by the User Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. + * + * @param string $bindingType The push technology used by the User Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. + * @return $this Fluent Builder + */ + public function setBindingType(array $bindingType): self + { + $this->options['bindingType'] = $bindingType; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.ReadUserBindingOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V2/Service/User/UserBindingPage.php b/app/api/Twilio/Rest/Chat/V2/Service/User/UserBindingPage.php new file mode 100755 index 0000000..a257b04 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/User/UserBindingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UserBindingInstance \Twilio\Rest\Chat\V2\Service\User\UserBindingInstance + */ + public function buildInstance(array $payload): UserBindingInstance + { + return new UserBindingInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.UserBindingPage]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V2/Service/User/UserChannelContext.php b/app/api/Twilio/Rest/Chat/V2/Service/User/UserChannelContext.php new file mode 100755 index 0000000..7c82060 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/User/UserChannelContext.php @@ -0,0 +1,147 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'userSid' => + $userSid, + 'channelSid' => + $channelSid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Users/' . \rawurlencode($userSid) + .'/Channels/' . \rawurlencode($channelSid) + .''; + } + + /** + * Delete the UserChannelInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the UserChannelInstance + * + * @return UserChannelInstance Fetched UserChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserChannelInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new UserChannelInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['userSid'], + $this->solution['channelSid'] + ); + } + + + /** + * Update the UserChannelInstance + * + * @param array|Options $options Optional Arguments + * @return UserChannelInstance Updated UserChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserChannelInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'NotificationLevel' => + $options['notificationLevel'], + 'LastConsumedMessageIndex' => + $options['lastConsumedMessageIndex'], + 'LastConsumptionTimestamp' => + Serialize::iso8601DateTime($options['lastConsumptionTimestamp']), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new UserChannelInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['userSid'], + $this->solution['channelSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.UserChannelContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V2/Service/User/UserChannelInstance.php b/app/api/Twilio/Rest/Chat/V2/Service/User/UserChannelInstance.php new file mode 100755 index 0000000..11cc1b3 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/User/UserChannelInstance.php @@ -0,0 +1,166 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'channelSid' => Values::array_get($payload, 'channel_sid'), + 'userSid' => Values::array_get($payload, 'user_sid'), + 'memberSid' => Values::array_get($payload, 'member_sid'), + 'status' => Values::array_get($payload, 'status'), + 'lastConsumedMessageIndex' => Values::array_get($payload, 'last_consumed_message_index'), + 'unreadMessagesCount' => Values::array_get($payload, 'unread_messages_count'), + 'links' => Values::array_get($payload, 'links'), + 'url' => Values::array_get($payload, 'url'), + 'notificationLevel' => Values::array_get($payload, 'notification_level'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'userSid' => $userSid, 'channelSid' => $channelSid ?: $this->properties['channelSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return UserChannelContext Context for this UserChannelInstance + */ + protected function proxy(): UserChannelContext + { + if (!$this->context) { + $this->context = new UserChannelContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['userSid'], + $this->solution['channelSid'] + ); + } + + return $this->context; + } + + /** + * Delete the UserChannelInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the UserChannelInstance + * + * @return UserChannelInstance Fetched UserChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserChannelInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the UserChannelInstance + * + * @param array|Options $options Optional Arguments + * @return UserChannelInstance Updated UserChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserChannelInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.UserChannelInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V2/Service/User/UserChannelList.php b/app/api/Twilio/Rest/Chat/V2/Service/User/UserChannelList.php new file mode 100755 index 0000000..cb4110f --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/User/UserChannelList.php @@ -0,0 +1,175 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'userSid' => + $userSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Users/' . \rawurlencode($userSid) + .'/Channels'; + } + + /** + * Reads UserChannelInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return UserChannelInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams UserChannelInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of UserChannelInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return UserChannelPage Page of UserChannelInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): UserChannelPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new UserChannelPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of UserChannelInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return UserChannelPage Page of UserChannelInstance + */ + public function getPage(string $targetUrl): UserChannelPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new UserChannelPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a UserChannelContext + * + * @param string $channelSid The SID of the [Channel](https://www.twilio.com/docs/api/chat/rest/channels) the resource belongs to. + */ + public function getContext( + string $channelSid + + ): UserChannelContext + { + return new UserChannelContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['userSid'], + $channelSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.UserChannelList]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V2/Service/User/UserChannelOptions.php b/app/api/Twilio/Rest/Chat/V2/Service/User/UserChannelOptions.php new file mode 100755 index 0000000..0d6b137 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/User/UserChannelOptions.php @@ -0,0 +1,166 @@ +options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.DeleteUserChannelOptions ' . $options . ']'; + } +} + + + +class UpdateUserChannelOptions extends Options + { + /** + * @param string $notificationLevel + * @param int $lastConsumedMessageIndex The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) in the [Channel](https://www.twilio.com/docs/chat/channels) that the Member has read. + * @param \DateTime $lastConsumptionTimestamp The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). + */ + public function __construct( + + string $notificationLevel = Values::NONE, + int $lastConsumedMessageIndex = Values::INT_NONE, + \DateTime $lastConsumptionTimestamp = null + + ) { + $this->options['notificationLevel'] = $notificationLevel; + $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; + $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; + } + + /** + * @param string $notificationLevel + * @return $this Fluent Builder + */ + public function setNotificationLevel(string $notificationLevel): self + { + $this->options['notificationLevel'] = $notificationLevel; + return $this; + } + + /** + * The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) in the [Channel](https://www.twilio.com/docs/chat/channels) that the Member has read. + * + * @param int $lastConsumedMessageIndex The index of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) in the [Channel](https://www.twilio.com/docs/chat/channels) that the Member has read. + * @return $this Fluent Builder + */ + public function setLastConsumedMessageIndex(int $lastConsumedMessageIndex): self + { + $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; + return $this; + } + + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). + * + * @param \DateTime $lastConsumptionTimestamp The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp of the last [Message](https://www.twilio.com/docs/chat/rest/message-resource) read event for the Member within the [Channel](https://www.twilio.com/docs/chat/channels). + * @return $this Fluent Builder + */ + public function setLastConsumptionTimestamp(\DateTime $lastConsumptionTimestamp): self + { + $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.UpdateUserChannelOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V2/Service/User/UserChannelPage.php b/app/api/Twilio/Rest/Chat/V2/Service/User/UserChannelPage.php new file mode 100755 index 0000000..cb71685 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/User/UserChannelPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UserChannelInstance \Twilio\Rest\Chat\V2\Service\User\UserChannelInstance + */ + public function buildInstance(array $payload): UserChannelInstance + { + return new UserChannelInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.UserChannelPage]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V2/Service/UserContext.php b/app/api/Twilio/Rest/Chat/V2/Service/UserContext.php new file mode 100755 index 0000000..41de285 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/UserContext.php @@ -0,0 +1,215 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Users/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the UserInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the UserInstance + * + * @return UserInstance Fetched UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new UserInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the UserInstance + * + * @param array|Options $options Optional Arguments + * @return UserInstance Updated UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'RoleSid' => + $options['roleSid'], + 'Attributes' => + $options['attributes'], + 'FriendlyName' => + $options['friendlyName'], + ]); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new UserInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the userBindings + */ + protected function getUserBindings(): UserBindingList + { + if (!$this->_userBindings) { + $this->_userBindings = new UserBindingList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_userBindings; + } + + /** + * Access the userChannels + */ + protected function getUserChannels(): UserChannelList + { + if (!$this->_userChannels) { + $this->_userChannels = new UserChannelList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_userChannels; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.UserContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V2/Service/UserInstance.php b/app/api/Twilio/Rest/Chat/V2/Service/UserInstance.php new file mode 100755 index 0000000..d8164e7 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/UserInstance.php @@ -0,0 +1,191 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'roleSid' => Values::array_get($payload, 'role_sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'isOnline' => Values::array_get($payload, 'is_online'), + 'isNotifiable' => Values::array_get($payload, 'is_notifiable'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'joinedChannelsCount' => Values::array_get($payload, 'joined_channels_count'), + 'links' => Values::array_get($payload, 'links'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return UserContext Context for this UserInstance + */ + protected function proxy(): UserContext + { + if (!$this->context) { + $this->context = new UserContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the UserInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the UserInstance + * + * @return UserInstance Fetched UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the UserInstance + * + * @param array|Options $options Optional Arguments + * @return UserInstance Updated UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the userBindings + */ + protected function getUserBindings(): UserBindingList + { + return $this->proxy()->userBindings; + } + + /** + * Access the userChannels + */ + protected function getUserChannels(): UserChannelList + { + return $this->proxy()->userChannels; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.UserInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V2/Service/UserList.php b/app/api/Twilio/Rest/Chat/V2/Service/UserList.php new file mode 100755 index 0000000..8667af9 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/UserList.php @@ -0,0 +1,206 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Users'; + } + + /** + * Create the UserInstance + * + * @param string $identity The `identity` value that uniquely identifies the new resource's [User](https://www.twilio.com/docs/chat/rest/user-resource) within the [Service](https://www.twilio.com/docs/chat/rest/service-resource). This value is often a username or email address. See the Identity documentation for more info. + * @param array|Options $options Optional Arguments + * @return UserInstance Created UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $identity, array $options = []): UserInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Identity' => + $identity, + 'RoleSid' => + $options['roleSid'], + 'Attributes' => + $options['attributes'], + 'FriendlyName' => + $options['friendlyName'], + ]); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new UserInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads UserInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return UserInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams UserInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of UserInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return UserPage Page of UserInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): UserPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new UserPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of UserInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return UserPage Page of UserInstance + */ + public function getPage(string $targetUrl): UserPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new UserPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a UserContext + * + * @param string $sid The SID of the User resource to delete. This value can be either the `sid` or the `identity` of the User resource to delete. + */ + public function getContext( + string $sid + + ): UserContext + { + return new UserContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.UserList]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V2/Service/UserOptions.php b/app/api/Twilio/Rest/Chat/V2/Service/UserOptions.php new file mode 100755 index 0000000..512142a --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/UserOptions.php @@ -0,0 +1,242 @@ +options['roleSid'] = $roleSid; + $this->options['attributes'] = $attributes; + $this->options['friendlyName'] = $friendlyName; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the new User. + * + * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the new User. + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * A valid JSON string that contains application-specific data. + * + * @param string $attributes A valid JSON string that contains application-specific data. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * A descriptive string that you create to describe the new resource. This value is often used for display purposes. + * + * @param string $friendlyName A descriptive string that you create to describe the new resource. This value is often used for display purposes. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.CreateUserOptions ' . $options . ']'; + } +} + + + + +class UpdateUserOptions extends Options + { + /** + * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the User. + * @param string $attributes A valid JSON string that contains application-specific data. + * @param string $friendlyName A descriptive string that you create to describe the resource. It is often used for display purposes. + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $roleSid = Values::NONE, + string $attributes = Values::NONE, + string $friendlyName = Values::NONE, + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['roleSid'] = $roleSid; + $this->options['attributes'] = $attributes; + $this->options['friendlyName'] = $friendlyName; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the User. + * + * @param string $roleSid The SID of the [Role](https://www.twilio.com/docs/chat/rest/role-resource) to assign to the User. + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * A valid JSON string that contains application-specific data. + * + * @param string $attributes A valid JSON string that contains application-specific data. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * A descriptive string that you create to describe the resource. It is often used for display purposes. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It is often used for display purposes. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.UpdateUserOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V2/Service/UserPage.php b/app/api/Twilio/Rest/Chat/V2/Service/UserPage.php new file mode 100755 index 0000000..1a0709c --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/Service/UserPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UserInstance \Twilio\Rest\Chat\V2\Service\UserInstance + */ + public function buildInstance(array $payload): UserInstance + { + return new UserInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.UserPage]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V2/ServiceContext.php b/app/api/Twilio/Rest/Chat/V2/ServiceContext.php new file mode 100755 index 0000000..dcbfab9 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/ServiceContext.php @@ -0,0 +1,299 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'DefaultServiceRoleSid' => + $options['defaultServiceRoleSid'], + 'DefaultChannelRoleSid' => + $options['defaultChannelRoleSid'], + 'DefaultChannelCreatorRoleSid' => + $options['defaultChannelCreatorRoleSid'], + 'ReadStatusEnabled' => + Serialize::booleanToString($options['readStatusEnabled']), + 'ReachabilityEnabled' => + Serialize::booleanToString($options['reachabilityEnabled']), + 'TypingIndicatorTimeout' => + $options['typingIndicatorTimeout'], + 'ConsumptionReportInterval' => + $options['consumptionReportInterval'], + 'Notifications.NewMessage.Enabled' => + Serialize::booleanToString($options['notificationsNewMessageEnabled']), + 'Notifications.NewMessage.Template' => + $options['notificationsNewMessageTemplate'], + 'Notifications.NewMessage.Sound' => + $options['notificationsNewMessageSound'], + 'Notifications.NewMessage.BadgeCountEnabled' => + Serialize::booleanToString($options['notificationsNewMessageBadgeCountEnabled']), + 'Notifications.AddedToChannel.Enabled' => + Serialize::booleanToString($options['notificationsAddedToChannelEnabled']), + 'Notifications.AddedToChannel.Template' => + $options['notificationsAddedToChannelTemplate'], + 'Notifications.AddedToChannel.Sound' => + $options['notificationsAddedToChannelSound'], + 'Notifications.RemovedFromChannel.Enabled' => + Serialize::booleanToString($options['notificationsRemovedFromChannelEnabled']), + 'Notifications.RemovedFromChannel.Template' => + $options['notificationsRemovedFromChannelTemplate'], + 'Notifications.RemovedFromChannel.Sound' => + $options['notificationsRemovedFromChannelSound'], + 'Notifications.InvitedToChannel.Enabled' => + Serialize::booleanToString($options['notificationsInvitedToChannelEnabled']), + 'Notifications.InvitedToChannel.Template' => + $options['notificationsInvitedToChannelTemplate'], + 'Notifications.InvitedToChannel.Sound' => + $options['notificationsInvitedToChannelSound'], + 'PreWebhookUrl' => + $options['preWebhookUrl'], + 'PostWebhookUrl' => + $options['postWebhookUrl'], + 'WebhookMethod' => + $options['webhookMethod'], + 'WebhookFilters' => + Serialize::map($options['webhookFilters'], function ($e) { return $e; }), + 'Limits.ChannelMembers' => + $options['limitsChannelMembers'], + 'Limits.UserChannels' => + $options['limitsUserChannels'], + 'Media.CompatibilityMessage' => + $options['mediaCompatibilityMessage'], + 'PreWebhookRetryCount' => + $options['preWebhookRetryCount'], + 'PostWebhookRetryCount' => + $options['postWebhookRetryCount'], + 'Notifications.LogEnabled' => + Serialize::booleanToString($options['notificationsLogEnabled']), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the channels + */ + protected function getChannels(): ChannelList + { + if (!$this->_channels) { + $this->_channels = new ChannelList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_channels; + } + + /** + * Access the bindings + */ + protected function getBindings(): BindingList + { + if (!$this->_bindings) { + $this->_bindings = new BindingList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_bindings; + } + + /** + * Access the roles + */ + protected function getRoles(): RoleList + { + if (!$this->_roles) { + $this->_roles = new RoleList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_roles; + } + + /** + * Access the users + */ + protected function getUsers(): UserList + { + if (!$this->_users) { + $this->_users = new UserList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_users; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.ServiceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V2/ServiceInstance.php b/app/api/Twilio/Rest/Chat/V2/ServiceInstance.php new file mode 100755 index 0000000..9a81246 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/ServiceInstance.php @@ -0,0 +1,227 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'defaultServiceRoleSid' => Values::array_get($payload, 'default_service_role_sid'), + 'defaultChannelRoleSid' => Values::array_get($payload, 'default_channel_role_sid'), + 'defaultChannelCreatorRoleSid' => Values::array_get($payload, 'default_channel_creator_role_sid'), + 'readStatusEnabled' => Values::array_get($payload, 'read_status_enabled'), + 'reachabilityEnabled' => Values::array_get($payload, 'reachability_enabled'), + 'typingIndicatorTimeout' => Values::array_get($payload, 'typing_indicator_timeout'), + 'consumptionReportInterval' => Values::array_get($payload, 'consumption_report_interval'), + 'limits' => Values::array_get($payload, 'limits'), + 'preWebhookUrl' => Values::array_get($payload, 'pre_webhook_url'), + 'postWebhookUrl' => Values::array_get($payload, 'post_webhook_url'), + 'webhookMethod' => Values::array_get($payload, 'webhook_method'), + 'webhookFilters' => Values::array_get($payload, 'webhook_filters'), + 'preWebhookRetryCount' => Values::array_get($payload, 'pre_webhook_retry_count'), + 'postWebhookRetryCount' => Values::array_get($payload, 'post_webhook_retry_count'), + 'notifications' => Values::array_get($payload, 'notifications'), + 'media' => Values::array_get($payload, 'media'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ServiceContext Context for this ServiceInstance + */ + protected function proxy(): ServiceContext + { + if (!$this->context) { + $this->context = new ServiceContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the channels + */ + protected function getChannels(): ChannelList + { + return $this->proxy()->channels; + } + + /** + * Access the bindings + */ + protected function getBindings(): BindingList + { + return $this->proxy()->bindings; + } + + /** + * Access the roles + */ + protected function getRoles(): RoleList + { + return $this->proxy()->roles; + } + + /** + * Access the users + */ + protected function getUsers(): UserList + { + return $this->proxy()->users; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V2.ServiceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V2/ServiceList.php b/app/api/Twilio/Rest/Chat/V2/ServiceList.php new file mode 100755 index 0000000..4c591cf --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/ServiceList.php @@ -0,0 +1,186 @@ +solution = [ + ]; + + $this->uri = '/Services'; + } + + /** + * Create the ServiceInstance + * + * @param string $friendlyName A descriptive string that you create to describe the new resource. + * @return ServiceInstance Created ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName): ServiceInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new ServiceInstance( + $this->version, + $payload + ); + } + + + /** + * Reads ServiceInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ServiceInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ServiceInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ServiceInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ServicePage Page of ServiceInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ServicePage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ServicePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ServiceInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ServicePage Page of ServiceInstance + */ + public function getPage(string $targetUrl): ServicePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ServicePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ServiceContext + * + * @param string $sid The SID of the Service resource to delete. + */ + public function getContext( + string $sid + + ): ServiceContext + { + return new ServiceContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.ServiceList]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V2/ServiceOptions.php b/app/api/Twilio/Rest/Chat/V2/ServiceOptions.php new file mode 100755 index 0000000..7e2d454 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/ServiceOptions.php @@ -0,0 +1,624 @@ +options['friendlyName'] = $friendlyName; + $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; + $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; + $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; + $this->options['readStatusEnabled'] = $readStatusEnabled; + $this->options['reachabilityEnabled'] = $reachabilityEnabled; + $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; + $this->options['consumptionReportInterval'] = $consumptionReportInterval; + $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; + $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; + $this->options['notificationsNewMessageSound'] = $notificationsNewMessageSound; + $this->options['notificationsNewMessageBadgeCountEnabled'] = $notificationsNewMessageBadgeCountEnabled; + $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; + $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; + $this->options['notificationsAddedToChannelSound'] = $notificationsAddedToChannelSound; + $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; + $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; + $this->options['notificationsRemovedFromChannelSound'] = $notificationsRemovedFromChannelSound; + $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; + $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; + $this->options['notificationsInvitedToChannelSound'] = $notificationsInvitedToChannelSound; + $this->options['preWebhookUrl'] = $preWebhookUrl; + $this->options['postWebhookUrl'] = $postWebhookUrl; + $this->options['webhookMethod'] = $webhookMethod; + $this->options['webhookFilters'] = $webhookFilters; + $this->options['limitsChannelMembers'] = $limitsChannelMembers; + $this->options['limitsUserChannels'] = $limitsUserChannels; + $this->options['mediaCompatibilityMessage'] = $mediaCompatibilityMessage; + $this->options['preWebhookRetryCount'] = $preWebhookRetryCount; + $this->options['postWebhookRetryCount'] = $postWebhookRetryCount; + $this->options['notificationsLogEnabled'] = $notificationsLogEnabled; + } + + /** + * A descriptive string that you create to describe the resource. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The service role assigned to users when they are added to the service. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. + * + * @param string $defaultServiceRoleSid The service role assigned to users when they are added to the service. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. + * @return $this Fluent Builder + */ + public function setDefaultServiceRoleSid(string $defaultServiceRoleSid): self + { + $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; + return $this; + } + + /** + * The channel role assigned to users when they are added to a channel. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. + * + * @param string $defaultChannelRoleSid The channel role assigned to users when they are added to a channel. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. + * @return $this Fluent Builder + */ + public function setDefaultChannelRoleSid(string $defaultChannelRoleSid): self + { + $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; + return $this; + } + + /** + * The channel role assigned to a channel creator when they join a new channel. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. + * + * @param string $defaultChannelCreatorRoleSid The channel role assigned to a channel creator when they join a new channel. See the [Role resource](https://www.twilio.com/docs/chat/rest/role-resource) for more info about roles. + * @return $this Fluent Builder + */ + public function setDefaultChannelCreatorRoleSid(string $defaultChannelCreatorRoleSid): self + { + $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; + return $this; + } + + /** + * Whether to enable the [Message Consumption Horizon](https://www.twilio.com/docs/chat/consumption-horizon) feature. The default is `true`. + * + * @param bool $readStatusEnabled Whether to enable the [Message Consumption Horizon](https://www.twilio.com/docs/chat/consumption-horizon) feature. The default is `true`. + * @return $this Fluent Builder + */ + public function setReadStatusEnabled(bool $readStatusEnabled): self + { + $this->options['readStatusEnabled'] = $readStatusEnabled; + return $this; + } + + /** + * Whether to enable the [Reachability Indicator](https://www.twilio.com/docs/chat/reachability-indicator) for this Service instance. The default is `false`. + * + * @param bool $reachabilityEnabled Whether to enable the [Reachability Indicator](https://www.twilio.com/docs/chat/reachability-indicator) for this Service instance. The default is `false`. + * @return $this Fluent Builder + */ + public function setReachabilityEnabled(bool $reachabilityEnabled): self + { + $this->options['reachabilityEnabled'] = $reachabilityEnabled; + return $this; + } + + /** + * How long in seconds after a `started typing` event until clients should assume that user is no longer typing, even if no `ended typing` message was received. The default is 5 seconds. + * + * @param int $typingIndicatorTimeout How long in seconds after a `started typing` event until clients should assume that user is no longer typing, even if no `ended typing` message was received. The default is 5 seconds. + * @return $this Fluent Builder + */ + public function setTypingIndicatorTimeout(int $typingIndicatorTimeout): self + { + $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; + return $this; + } + + /** + * DEPRECATED. The interval in seconds between consumption reports submission batches from client endpoints. + * + * @param int $consumptionReportInterval DEPRECATED. The interval in seconds between consumption reports submission batches from client endpoints. + * @return $this Fluent Builder + */ + public function setConsumptionReportInterval(int $consumptionReportInterval): self + { + $this->options['consumptionReportInterval'] = $consumptionReportInterval; + return $this; + } + + /** + * Whether to send a notification when a new message is added to a channel. The default is `false`. + * + * @param bool $notificationsNewMessageEnabled Whether to send a notification when a new message is added to a channel. The default is `false`. + * @return $this Fluent Builder + */ + public function setNotificationsNewMessageEnabled(bool $notificationsNewMessageEnabled): self + { + $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; + return $this; + } + + /** + * The template to use to create the notification text displayed when a new message is added to a channel and `notifications.new_message.enabled` is `true`. + * + * @param string $notificationsNewMessageTemplate The template to use to create the notification text displayed when a new message is added to a channel and `notifications.new_message.enabled` is `true`. + * @return $this Fluent Builder + */ + public function setNotificationsNewMessageTemplate(string $notificationsNewMessageTemplate): self + { + $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; + return $this; + } + + /** + * The name of the sound to play when a new message is added to a channel and `notifications.new_message.enabled` is `true`. + * + * @param string $notificationsNewMessageSound The name of the sound to play when a new message is added to a channel and `notifications.new_message.enabled` is `true`. + * @return $this Fluent Builder + */ + public function setNotificationsNewMessageSound(string $notificationsNewMessageSound): self + { + $this->options['notificationsNewMessageSound'] = $notificationsNewMessageSound; + return $this; + } + + /** + * Whether the new message badge is enabled. The default is `false`. + * + * @param bool $notificationsNewMessageBadgeCountEnabled Whether the new message badge is enabled. The default is `false`. + * @return $this Fluent Builder + */ + public function setNotificationsNewMessageBadgeCountEnabled(bool $notificationsNewMessageBadgeCountEnabled): self + { + $this->options['notificationsNewMessageBadgeCountEnabled'] = $notificationsNewMessageBadgeCountEnabled; + return $this; + } + + /** + * Whether to send a notification when a member is added to a channel. The default is `false`. + * + * @param bool $notificationsAddedToChannelEnabled Whether to send a notification when a member is added to a channel. The default is `false`. + * @return $this Fluent Builder + */ + public function setNotificationsAddedToChannelEnabled(bool $notificationsAddedToChannelEnabled): self + { + $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; + return $this; + } + + /** + * The template to use to create the notification text displayed when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. + * + * @param string $notificationsAddedToChannelTemplate The template to use to create the notification text displayed when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. + * @return $this Fluent Builder + */ + public function setNotificationsAddedToChannelTemplate(string $notificationsAddedToChannelTemplate): self + { + $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; + return $this; + } + + /** + * The name of the sound to play when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. + * + * @param string $notificationsAddedToChannelSound The name of the sound to play when a member is added to a channel and `notifications.added_to_channel.enabled` is `true`. + * @return $this Fluent Builder + */ + public function setNotificationsAddedToChannelSound(string $notificationsAddedToChannelSound): self + { + $this->options['notificationsAddedToChannelSound'] = $notificationsAddedToChannelSound; + return $this; + } + + /** + * Whether to send a notification to a user when they are removed from a channel. The default is `false`. + * + * @param bool $notificationsRemovedFromChannelEnabled Whether to send a notification to a user when they are removed from a channel. The default is `false`. + * @return $this Fluent Builder + */ + public function setNotificationsRemovedFromChannelEnabled(bool $notificationsRemovedFromChannelEnabled): self + { + $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; + return $this; + } + + /** + * The template to use to create the notification text displayed to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. + * + * @param string $notificationsRemovedFromChannelTemplate The template to use to create the notification text displayed to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. + * @return $this Fluent Builder + */ + public function setNotificationsRemovedFromChannelTemplate(string $notificationsRemovedFromChannelTemplate): self + { + $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; + return $this; + } + + /** + * The name of the sound to play to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. + * + * @param string $notificationsRemovedFromChannelSound The name of the sound to play to a user when they are removed from a channel and `notifications.removed_from_channel.enabled` is `true`. + * @return $this Fluent Builder + */ + public function setNotificationsRemovedFromChannelSound(string $notificationsRemovedFromChannelSound): self + { + $this->options['notificationsRemovedFromChannelSound'] = $notificationsRemovedFromChannelSound; + return $this; + } + + /** + * Whether to send a notification when a user is invited to a channel. The default is `false`. + * + * @param bool $notificationsInvitedToChannelEnabled Whether to send a notification when a user is invited to a channel. The default is `false`. + * @return $this Fluent Builder + */ + public function setNotificationsInvitedToChannelEnabled(bool $notificationsInvitedToChannelEnabled): self + { + $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; + return $this; + } + + /** + * The template to use to create the notification text displayed when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. + * + * @param string $notificationsInvitedToChannelTemplate The template to use to create the notification text displayed when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. + * @return $this Fluent Builder + */ + public function setNotificationsInvitedToChannelTemplate(string $notificationsInvitedToChannelTemplate): self + { + $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; + return $this; + } + + /** + * The name of the sound to play when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. + * + * @param string $notificationsInvitedToChannelSound The name of the sound to play when a user is invited to a channel and `notifications.invited_to_channel.enabled` is `true`. + * @return $this Fluent Builder + */ + public function setNotificationsInvitedToChannelSound(string $notificationsInvitedToChannelSound): self + { + $this->options['notificationsInvitedToChannelSound'] = $notificationsInvitedToChannelSound; + return $this; + } + + /** + * The URL for pre-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. + * + * @param string $preWebhookUrl The URL for pre-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. + * @return $this Fluent Builder + */ + public function setPreWebhookUrl(string $preWebhookUrl): self + { + $this->options['preWebhookUrl'] = $preWebhookUrl; + return $this; + } + + /** + * The URL for post-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. + * + * @param string $postWebhookUrl The URL for post-event webhooks, which are called by using the `webhook_method`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. + * @return $this Fluent Builder + */ + public function setPostWebhookUrl(string $postWebhookUrl): self + { + $this->options['postWebhookUrl'] = $postWebhookUrl; + return $this; + } + + /** + * The HTTP method to use for calls to the `pre_webhook_url` and `post_webhook_url` webhooks. Can be: `POST` or `GET` and the default is `POST`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. + * + * @param string $webhookMethod The HTTP method to use for calls to the `pre_webhook_url` and `post_webhook_url` webhooks. Can be: `POST` or `GET` and the default is `POST`. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. + * @return $this Fluent Builder + */ + public function setWebhookMethod(string $webhookMethod): self + { + $this->options['webhookMethod'] = $webhookMethod; + return $this; + } + + /** + * The list of webhook events that are enabled for this Service instance. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. + * + * @param string[] $webhookFilters The list of webhook events that are enabled for this Service instance. See [Webhook Events](https://www.twilio.com/docs/chat/webhook-events) for more details. + * @return $this Fluent Builder + */ + public function setWebhookFilters(array $webhookFilters): self + { + $this->options['webhookFilters'] = $webhookFilters; + return $this; + } + + /** + * The maximum number of Members that can be added to Channels within this Service. Can be up to 1,000. + * + * @param int $limitsChannelMembers The maximum number of Members that can be added to Channels within this Service. Can be up to 1,000. + * @return $this Fluent Builder + */ + public function setLimitsChannelMembers(int $limitsChannelMembers): self + { + $this->options['limitsChannelMembers'] = $limitsChannelMembers; + return $this; + } + + /** + * The maximum number of Channels Users can be a Member of within this Service. Can be up to 1,000. + * + * @param int $limitsUserChannels The maximum number of Channels Users can be a Member of within this Service. Can be up to 1,000. + * @return $this Fluent Builder + */ + public function setLimitsUserChannels(int $limitsUserChannels): self + { + $this->options['limitsUserChannels'] = $limitsUserChannels; + return $this; + } + + /** + * The message to send when a media message has no text. Can be used as placeholder message. + * + * @param string $mediaCompatibilityMessage The message to send when a media message has no text. Can be used as placeholder message. + * @return $this Fluent Builder + */ + public function setMediaCompatibilityMessage(string $mediaCompatibilityMessage): self + { + $this->options['mediaCompatibilityMessage'] = $mediaCompatibilityMessage; + return $this; + } + + /** + * The number of times to retry a call to the `pre_webhook_url` if the request times out (after 5 seconds) or it receives a 429, 503, or 504 HTTP response. Default retry count is 0 times, which means the call won't be retried. + * + * @param int $preWebhookRetryCount The number of times to retry a call to the `pre_webhook_url` if the request times out (after 5 seconds) or it receives a 429, 503, or 504 HTTP response. Default retry count is 0 times, which means the call won't be retried. + * @return $this Fluent Builder + */ + public function setPreWebhookRetryCount(int $preWebhookRetryCount): self + { + $this->options['preWebhookRetryCount'] = $preWebhookRetryCount; + return $this; + } + + /** + * The number of times to retry a call to the `post_webhook_url` if the request times out (after 5 seconds) or it receives a 429, 503, or 504 HTTP response. The default is 0, which means the call won't be retried. + * + * @param int $postWebhookRetryCount The number of times to retry a call to the `post_webhook_url` if the request times out (after 5 seconds) or it receives a 429, 503, or 504 HTTP response. The default is 0, which means the call won't be retried. + * @return $this Fluent Builder + */ + public function setPostWebhookRetryCount(int $postWebhookRetryCount): self + { + $this->options['postWebhookRetryCount'] = $postWebhookRetryCount; + return $this; + } + + /** + * Whether to log notifications. The default is `false`. + * + * @param bool $notificationsLogEnabled Whether to log notifications. The default is `false`. + * @return $this Fluent Builder + */ + public function setNotificationsLogEnabled(bool $notificationsLogEnabled): self + { + $this->options['notificationsLogEnabled'] = $notificationsLogEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V2.UpdateServiceOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V2/ServicePage.php b/app/api/Twilio/Rest/Chat/V2/ServicePage.php new file mode 100755 index 0000000..7fc14cf --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V2/ServicePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ServiceInstance \Twilio\Rest\Chat\V2\ServiceInstance + */ + public function buildInstance(array $payload): ServiceInstance + { + return new ServiceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V2.ServicePage]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V3.php b/app/api/Twilio/Rest/Chat/V3.php new file mode 100755 index 0000000..82638ac --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V3.php @@ -0,0 +1,95 @@ +version = 'v3'; + } + + protected function getChannels(): ChannelList + { + if (!$this->_channels) { + $this->_channels = new ChannelList($this); + } + return $this->_channels; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V3]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V3/.openapi-generator-ignore b/app/api/Twilio/Rest/Chat/V3/.openapi-generator-ignore new file mode 100755 index 0000000..2d4b99e --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V3/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/app/api/Twilio/Rest/Chat/V3/ChannelContext.php b/app/api/Twilio/Rest/Chat/V3/ChannelContext.php new file mode 100755 index 0000000..8a7e6f8 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V3/ChannelContext.php @@ -0,0 +1,101 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($sid) + .''; + } + + /** + * Update the ChannelInstance + * + * @param array|Options $options Optional Arguments + * @return ChannelInstance Updated ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ChannelInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Type' => + $options['type'], + 'MessagingServiceSid' => + $options['messagingServiceSid'], + ]); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ChannelInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V3.ChannelContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V3/ChannelInstance.php b/app/api/Twilio/Rest/Chat/V3/ChannelInstance.php new file mode 100755 index 0000000..a8e3395 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V3/ChannelInstance.php @@ -0,0 +1,146 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'type' => Values::array_get($payload, 'type'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'createdBy' => Values::array_get($payload, 'created_by'), + 'membersCount' => Values::array_get($payload, 'members_count'), + 'messagesCount' => Values::array_get($payload, 'messages_count'), + 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid ?: $this->properties['serviceSid'], 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ChannelContext Context for this ChannelInstance + */ + protected function proxy(): ChannelContext + { + if (!$this->context) { + $this->context = new ChannelContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Update the ChannelInstance + * + * @param array|Options $options Optional Arguments + * @return ChannelInstance Updated ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ChannelInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Chat.V3.ChannelInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V3/ChannelList.php b/app/api/Twilio/Rest/Chat/V3/ChannelList.php new file mode 100755 index 0000000..2530c44 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V3/ChannelList.php @@ -0,0 +1,69 @@ +solution = [ + ]; + } + + /** + * Constructs a ChannelContext + * + * @param string $serviceSid The unique SID identifier of the Service. + * + * @param string $sid A 34 character string that uniquely identifies this Channel. + */ + public function getContext( + string $serviceSid + , string $sid + + ): ChannelContext + { + return new ChannelContext( + $this->version, + $serviceSid, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V3.ChannelList]'; + } +} diff --git a/app/api/Twilio/Rest/Chat/V3/ChannelOptions.php b/app/api/Twilio/Rest/Chat/V3/ChannelOptions.php new file mode 100755 index 0000000..20db784 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V3/ChannelOptions.php @@ -0,0 +1,110 @@ +options['type'] = $type; + $this->options['messagingServiceSid'] = $messagingServiceSid; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * @param string $type + * @return $this Fluent Builder + */ + public function setType(string $type): self + { + $this->options['type'] = $type; + return $this; + } + + /** + * The unique ID of the [Messaging Service](https://www.twilio.com/docs/sms/services/api) this channel belongs to. + * + * @param string $messagingServiceSid The unique ID of the [Messaging Service](https://www.twilio.com/docs/sms/services/api) this channel belongs to. + * @return $this Fluent Builder + */ + public function setMessagingServiceSid(string $messagingServiceSid): self + { + $this->options['messagingServiceSid'] = $messagingServiceSid; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Chat.V3.UpdateChannelOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Chat/V3/ChannelPage.php b/app/api/Twilio/Rest/Chat/V3/ChannelPage.php new file mode 100755 index 0000000..60bb740 --- /dev/null +++ b/app/api/Twilio/Rest/Chat/V3/ChannelPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ChannelInstance \Twilio\Rest\Chat\V3\ChannelInstance + */ + public function buildInstance(array $payload): ChannelInstance + { + return new ChannelInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Chat.V3.ChannelPage]'; + } +} diff --git a/app/api/Twilio/Rest/ChatBase.php b/app/api/Twilio/Rest/ChatBase.php new file mode 100755 index 0000000..2d2e105 --- /dev/null +++ b/app/api/Twilio/Rest/ChatBase.php @@ -0,0 +1,114 @@ +baseUrl = 'https://chat.twilio.com'; + } + + + /** + * @return V1 Version v1 of chat + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * @return V2 Version v2 of chat + */ + protected function getV2(): V2 { + if (!$this->_v2) { + $this->_v2 = new V2($this); + } + return $this->_v2; + } + + /** + * @return V3 Version v3 of chat + */ + protected function getV3(): V3 { + if (!$this->_v3) { + $this->_v3 = new V3($this); + } + return $this->_v3; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Chat]'; + } +} diff --git a/app/api/Twilio/Rest/Client.php b/app/api/Twilio/Rest/Client.php new file mode 100755 index 0000000..b6c74e1 --- /dev/null +++ b/app/api/Twilio/Rest/Client.php @@ -0,0 +1,695 @@ +_accounts) { + $this->_accounts = new Accounts($this); + } + return $this->_accounts; + } + /** + * Access the Api Twilio Domain + * + * @return Api Api Twilio Domain + */ + protected function getApi(): Api { + if (!$this->_api) { + $this->_api = new Api($this); + } + return $this->_api; + } + /** + * Access the Autopilot Twilio Domain + * + * @return Autopilot Autopilot Twilio Domain + */ + protected function getAutopilot(): Autopilot { + if (!$this->_autopilot) { + $this->_autopilot = new Autopilot($this); + } + return $this->_autopilot; + } + /** + * Access the Bulkexports Twilio Domain + * + * @return Bulkexports Bulkexports Twilio Domain + */ + protected function getBulkexports(): Bulkexports { + if (!$this->_bulkexports) { + $this->_bulkexports = new Bulkexports($this); + } + return $this->_bulkexports; + } + /** + * Access the Chat Twilio Domain + * + * @return Chat Chat Twilio Domain + */ + protected function getChat(): Chat { + if (!$this->_chat) { + $this->_chat = new Chat($this); + } + return $this->_chat; + } + /** + * Access the Content Twilio Domain + * + * @return Content Content Twilio Domain + */ + protected function getContent(): Content { + if (!$this->_content) { + $this->_content = new Content($this); + } + return $this->_content; + } + /** + * Access the Conversations Twilio Domain + * + * @return Conversations Conversations Twilio Domain + */ + protected function getConversations(): Conversations { + if (!$this->_conversations) { + $this->_conversations = new Conversations($this); + } + return $this->_conversations; + } + /** + * Access the Events Twilio Domain + * + * @return Events Events Twilio Domain + */ + protected function getEvents(): Events { + if (!$this->_events) { + $this->_events = new Events($this); + } + return $this->_events; + } + /** + * Access the FlexApi Twilio Domain + * + * @return FlexApi FlexApi Twilio Domain + */ + protected function getFlexApi(): FlexApi { + if (!$this->_flexApi) { + $this->_flexApi = new FlexApi($this); + } + return $this->_flexApi; + } + /** + * Access the FrontlineApi Twilio Domain + * + * @return FrontlineApi FrontlineApi Twilio Domain + */ + protected function getFrontlineApi(): FrontlineApi { + if (!$this->_frontlineApi) { + $this->_frontlineApi = new FrontlineApi($this); + } + return $this->_frontlineApi; + } + /** + * Access the Insights Twilio Domain + * + * @return Insights Insights Twilio Domain + */ + protected function getInsights(): Insights { + if (!$this->_insights) { + $this->_insights = new Insights($this); + } + return $this->_insights; + } + /** + * Access the IpMessaging Twilio Domain + * + * @return IpMessaging IpMessaging Twilio Domain + */ + protected function getIpMessaging(): IpMessaging { + if (!$this->_ipMessaging) { + $this->_ipMessaging = new IpMessaging($this); + } + return $this->_ipMessaging; + } + /** + * Access the Lookups Twilio Domain + * + * @return Lookups Lookups Twilio Domain + */ + protected function getLookups(): Lookups { + if (!$this->_lookups) { + $this->_lookups = new Lookups($this); + } + return $this->_lookups; + } + /** + * Access the Media Twilio Domain + * + * @return Media Media Twilio Domain + */ + protected function getMedia(): Media { + if (!$this->_media) { + $this->_media = new Media($this); + } + return $this->_media; + } + /** + * Access the Messaging Twilio Domain + * + * @return Messaging Messaging Twilio Domain + */ + protected function getMessaging(): Messaging { + if (!$this->_messaging) { + $this->_messaging = new Messaging($this); + } + return $this->_messaging; + } + /** + * Access the Microvisor Twilio Domain + * + * @return Microvisor Microvisor Twilio Domain + */ + protected function getMicrovisor(): Microvisor { + if (!$this->_microvisor) { + $this->_microvisor = new Microvisor($this); + } + return $this->_microvisor; + } + /** + * Access the Monitor Twilio Domain + * + * @return Monitor Monitor Twilio Domain + */ + protected function getMonitor(): Monitor { + if (!$this->_monitor) { + $this->_monitor = new Monitor($this); + } + return $this->_monitor; + } + /** + * Access the Notify Twilio Domain + * + * @return Notify Notify Twilio Domain + */ + protected function getNotify(): Notify { + if (!$this->_notify) { + $this->_notify = new Notify($this); + } + return $this->_notify; + } + /** + * Access the Numbers Twilio Domain + * + * @return Numbers Numbers Twilio Domain + */ + protected function getNumbers(): Numbers { + if (!$this->_numbers) { + $this->_numbers = new Numbers($this); + } + return $this->_numbers; + } + /** + * Access the Oauth Twilio Domain + * + * @return Oauth Oauth Twilio Domain + */ + protected function getOauth(): Oauth { + if (!$this->_oauth) { + $this->_oauth = new Oauth($this); + } + return $this->_oauth; + } + /** + * Access the Preview Twilio Domain + * + * @return Preview Preview Twilio Domain + */ + protected function getPreview(): Preview { + if (!$this->_preview) { + $this->_preview = new Preview($this); + } + return $this->_preview; + } + /** + * Access the Pricing Twilio Domain + * + * @return Pricing Pricing Twilio Domain + */ + protected function getPricing(): Pricing { + if (!$this->_pricing) { + $this->_pricing = new Pricing($this); + } + return $this->_pricing; + } + /** + * Access the Proxy Twilio Domain + * + * @return Proxy Proxy Twilio Domain + */ + protected function getProxy(): Proxy { + if (!$this->_proxy) { + $this->_proxy = new Proxy($this); + } + return $this->_proxy; + } + /** + * Access the Routes Twilio Domain + * + * @return Routes Routes Twilio Domain + */ + protected function getRoutes(): Routes { + if (!$this->_routes) { + $this->_routes = new Routes($this); + } + return $this->_routes; + } + /** + * Access the Serverless Twilio Domain + * + * @return Serverless Serverless Twilio Domain + */ + protected function getServerless(): Serverless { + if (!$this->_serverless) { + $this->_serverless = new Serverless($this); + } + return $this->_serverless; + } + /** + * Access the Studio Twilio Domain + * + * @return Studio Studio Twilio Domain + */ + protected function getStudio(): Studio { + if (!$this->_studio) { + $this->_studio = new Studio($this); + } + return $this->_studio; + } + /** + * Access the Supersim Twilio Domain + * + * @return Supersim Supersim Twilio Domain + */ + protected function getSupersim(): Supersim { + if (!$this->_supersim) { + $this->_supersim = new Supersim($this); + } + return $this->_supersim; + } + /** + * Access the Sync Twilio Domain + * + * @return Sync Sync Twilio Domain + */ + protected function getSync(): Sync { + if (!$this->_sync) { + $this->_sync = new Sync($this); + } + return $this->_sync; + } + /** + * Access the Taskrouter Twilio Domain + * + * @return Taskrouter Taskrouter Twilio Domain + */ + protected function getTaskrouter(): Taskrouter { + if (!$this->_taskrouter) { + $this->_taskrouter = new Taskrouter($this); + } + return $this->_taskrouter; + } + /** + * Access the Trunking Twilio Domain + * + * @return Trunking Trunking Twilio Domain + */ + protected function getTrunking(): Trunking { + if (!$this->_trunking) { + $this->_trunking = new Trunking($this); + } + return $this->_trunking; + } + /** + * Access the Trusthub Twilio Domain + * + * @return Trusthub Trusthub Twilio Domain + */ + protected function getTrusthub(): Trusthub { + if (!$this->_trusthub) { + $this->_trusthub = new Trusthub($this); + } + return $this->_trusthub; + } + /** + * Access the Verify Twilio Domain + * + * @return Verify Verify Twilio Domain + */ + protected function getVerify(): Verify { + if (!$this->_verify) { + $this->_verify = new Verify($this); + } + return $this->_verify; + } + /** + * Access the Video Twilio Domain + * + * @return Video Video Twilio Domain + */ + protected function getVideo(): Video { + if (!$this->_video) { + $this->_video = new Video($this); + } + return $this->_video; + } + /** + * Access the Voice Twilio Domain + * + * @return Voice Voice Twilio Domain + */ + protected function getVoice(): Voice { + if (!$this->_voice) { + $this->_voice = new Voice($this); + } + return $this->_voice; + } + /** + * Access the Wireless Twilio Domain + * + * @return Wireless Wireless Twilio Domain + */ + protected function getWireless(): Wireless { + if (!$this->_wireless) { + $this->_wireless = new Wireless($this); + } + return $this->_wireless; + } + protected function getAddresses(): \Twilio\Rest\Api\V2010\Account\AddressList { + return $this->api->v2010->account->addresses; + } + /** + * @param string $sid The Twilio-provided string that uniquely identifies the Address resource to fetch. + */ + protected function contextAddresses(string $sid): \Twilio\Rest\Api\V2010\Account\AddressContext { + return $this->api->v2010->account->addresses($sid); + } + protected function getApplications(): \Twilio\Rest\Api\V2010\Account\ApplicationList { + return $this->api->v2010->account->applications; + } + /** + * @param string $sid The Twilio-provided string that uniquely identifies the Application resource to fetch. + */ + protected function contextApplications(string $sid): \Twilio\Rest\Api\V2010\Account\ApplicationContext { + return $this->api->v2010->account->applications($sid); + } + protected function getAuthorizedConnectApps(): \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppList { + return $this->api->v2010->account->authorizedConnectApps; + } + /** + * @param string $connectAppSid The SID of the Connect App to fetch. + */ + protected function contextAuthorizedConnectApps(string $connectAppSid): \Twilio\Rest\Api\V2010\Account\AuthorizedConnectAppContext { + return $this->api->v2010->account->authorizedConnectApps($connectAppSid); + } + protected function getAvailablePhoneNumbers(): \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryList { + return $this->api->v2010->account->availablePhoneNumbers; + } + /** + * @param string $countryCode The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country to fetch available phone number information about. + */ + protected function contextAvailablePhoneNumbers(string $countryCode): \Twilio\Rest\Api\V2010\Account\AvailablePhoneNumberCountryContext { + return $this->api->v2010->account->availablePhoneNumbers($countryCode); + } + protected function getBalance(): \Twilio\Rest\Api\V2010\Account\BalanceList { + return $this->api->v2010->account->balance; + } + protected function getCalls(): \Twilio\Rest\Api\V2010\Account\CallList { + return $this->api->v2010->account->calls; + } + /** + * @param string $sid The SID of the Call resource to fetch. + */ + protected function contextCalls(string $sid): \Twilio\Rest\Api\V2010\Account\CallContext { + return $this->api->v2010->account->calls($sid); + } + protected function getConferences(): \Twilio\Rest\Api\V2010\Account\ConferenceList { + return $this->api->v2010->account->conferences; + } + /** + * @param string $sid The Twilio-provided string that uniquely identifies the Conference resource to fetch + */ + protected function contextConferences(string $sid): \Twilio\Rest\Api\V2010\Account\ConferenceContext { + return $this->api->v2010->account->conferences($sid); + } + protected function getConnectApps(): \Twilio\Rest\Api\V2010\Account\ConnectAppList { + return $this->api->v2010->account->connectApps; + } + /** + * @param string $sid The Twilio-provided string that uniquely identifies the ConnectApp resource to fetch. + */ + protected function contextConnectApps(string $sid): \Twilio\Rest\Api\V2010\Account\ConnectAppContext { + return $this->api->v2010->account->connectApps($sid); + } + protected function getIncomingPhoneNumbers(): \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberList { + return $this->api->v2010->account->incomingPhoneNumbers; + } + /** + * @param string $sid The Twilio-provided string that uniquely identifies the IncomingPhoneNumber resource to fetch. + */ + protected function contextIncomingPhoneNumbers(string $sid): \Twilio\Rest\Api\V2010\Account\IncomingPhoneNumberContext { + return $this->api->v2010->account->incomingPhoneNumbers($sid); + } + protected function getKeys(): \Twilio\Rest\Api\V2010\Account\KeyList { + return $this->api->v2010->account->keys; + } + /** + * @param string $sid The Twilio-provided string that uniquely identifies the Key resource to fetch. + */ + protected function contextKeys(string $sid): \Twilio\Rest\Api\V2010\Account\KeyContext { + return $this->api->v2010->account->keys($sid); + } + protected function getMessages(): \Twilio\Rest\Api\V2010\Account\MessageList { + return $this->api->v2010->account->messages; + } + /** + * @param string $sid The Twilio-provided string that uniquely identifies the Message resource to fetch. + */ + protected function contextMessages(string $sid): \Twilio\Rest\Api\V2010\Account\MessageContext { + return $this->api->v2010->account->messages($sid); + } + protected function getNewKeys(): \Twilio\Rest\Api\V2010\Account\NewKeyList { + return $this->api->v2010->account->newKeys; + } + protected function getNewSigningKeys(): \Twilio\Rest\Api\V2010\Account\NewSigningKeyList { + return $this->api->v2010->account->newSigningKeys; + } + protected function getNotifications(): \Twilio\Rest\Api\V2010\Account\NotificationList { + return $this->api->v2010->account->notifications; + } + /** + * @param string $sid The Twilio-provided string that uniquely identifies the Notification resource to fetch. + */ + protected function contextNotifications(string $sid): \Twilio\Rest\Api\V2010\Account\NotificationContext { + return $this->api->v2010->account->notifications($sid); + } + protected function getOutgoingCallerIds(): \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdList { + return $this->api->v2010->account->outgoingCallerIds; + } + /** + * @param string $sid The Twilio-provided string that uniquely identifies the OutgoingCallerId resource to fetch. + */ + protected function contextOutgoingCallerIds(string $sid): \Twilio\Rest\Api\V2010\Account\OutgoingCallerIdContext { + return $this->api->v2010->account->outgoingCallerIds($sid); + } + protected function getQueues(): \Twilio\Rest\Api\V2010\Account\QueueList { + return $this->api->v2010->account->queues; + } + /** + * @param string $sid The Twilio-provided string that uniquely identifies the Queue resource to fetch + */ + protected function contextQueues(string $sid): \Twilio\Rest\Api\V2010\Account\QueueContext { + return $this->api->v2010->account->queues($sid); + } + protected function getRecordings(): \Twilio\Rest\Api\V2010\Account\RecordingList { + return $this->api->v2010->account->recordings; + } + /** + * @param string $sid The Twilio-provided string that uniquely identifies the Recording resource to fetch. + */ + protected function contextRecordings(string $sid): \Twilio\Rest\Api\V2010\Account\RecordingContext { + return $this->api->v2010->account->recordings($sid); + } + protected function getShortCodes(): \Twilio\Rest\Api\V2010\Account\ShortCodeList { + return $this->api->v2010->account->shortCodes; + } + /** + * @param string $sid The Twilio-provided string that uniquely identifies the ShortCode resource to fetch + */ + protected function contextShortCodes(string $sid): \Twilio\Rest\Api\V2010\Account\ShortCodeContext { + return $this->api->v2010->account->shortCodes($sid); + } + protected function getSigningKeys(): \Twilio\Rest\Api\V2010\Account\SigningKeyList { + return $this->api->v2010->account->signingKeys; + } + /** + * @param string $sid The sid + */ + protected function contextSigningKeys(string $sid): \Twilio\Rest\Api\V2010\Account\SigningKeyContext { + return $this->api->v2010->account->signingKeys($sid); + } + protected function getSip(): \Twilio\Rest\Api\V2010\Account\SipList { + return $this->api->v2010->account->sip; + } + protected function getTokens(): \Twilio\Rest\Api\V2010\Account\TokenList { + return $this->api->v2010->account->tokens; + } + protected function getTranscriptions(): \Twilio\Rest\Api\V2010\Account\TranscriptionList { + return $this->api->v2010->account->transcriptions; + } + /** + * @param string $sid The Twilio-provided string that uniquely identifies the Transcription resource to fetch. + */ + protected function contextTranscriptions(string $sid): \Twilio\Rest\Api\V2010\Account\TranscriptionContext { + return $this->api->v2010->account->transcriptions($sid); + } + protected function getUsage(): \Twilio\Rest\Api\V2010\Account\UsageList { + return $this->api->v2010->account->usage; + } + protected function getValidationRequests(): \Twilio\Rest\Api\V2010\Account\ValidationRequestList { + return $this->api->v2010->account->validationRequests; + } +} diff --git a/app/api/Twilio/Rest/Content.php b/app/api/Twilio/Rest/Content.php new file mode 100755 index 0000000..37d747c --- /dev/null +++ b/app/api/Twilio/Rest/Content.php @@ -0,0 +1,25 @@ +contents instead. + */ + protected function getContents(): \Twilio\Rest\Content\V1\ContentList { + echo "contents is deprecated. Use v1->contents instead."; + return $this->v1->contents; + } + + /** + * @deprecated Use v1->contents(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextContents(string $sid): \Twilio\Rest\Content\V1\ContentContext { + echo "contents(\$sid) is deprecated. Use v1->contents(\$sid) instead."; + return $this->v1->contents($sid); + } +} \ No newline at end of file diff --git a/app/api/Twilio/Rest/Content/V1.php b/app/api/Twilio/Rest/Content/V1.php new file mode 100755 index 0000000..ed8c25a --- /dev/null +++ b/app/api/Twilio/Rest/Content/V1.php @@ -0,0 +1,117 @@ +version = 'v1'; + } + + protected function getContents(): ContentList + { + if (!$this->_contents) { + $this->_contents = new ContentList($this); + } + return $this->_contents; + } + + protected function getContentAndApprovals(): ContentAndApprovalsList + { + if (!$this->_contentAndApprovals) { + $this->_contentAndApprovals = new ContentAndApprovalsList($this); + } + return $this->_contentAndApprovals; + } + + protected function getLegacyContents(): LegacyContentList + { + if (!$this->_legacyContents) { + $this->_legacyContents = new LegacyContentList($this); + } + return $this->_legacyContents; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Content.V1]'; + } +} diff --git a/app/api/Twilio/Rest/Content/V1/Content/ApprovalFetchContext.php b/app/api/Twilio/Rest/Content/V1/Content/ApprovalFetchContext.php new file mode 100755 index 0000000..44d43e9 --- /dev/null +++ b/app/api/Twilio/Rest/Content/V1/Content/ApprovalFetchContext.php @@ -0,0 +1,81 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Content/' . \rawurlencode($sid) + .'/ApprovalRequests'; + } + + /** + * Fetch the ApprovalFetchInstance + * + * @return ApprovalFetchInstance Fetched ApprovalFetchInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ApprovalFetchInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ApprovalFetchInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Content.V1.ApprovalFetchContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Content/V1/Content/ApprovalFetchInstance.php b/app/api/Twilio/Rest/Content/V1/Content/ApprovalFetchInstance.php new file mode 100755 index 0000000..ef07f0f --- /dev/null +++ b/app/api/Twilio/Rest/Content/V1/Content/ApprovalFetchInstance.php @@ -0,0 +1,121 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'whatsapp' => Values::array_get($payload, 'whatsapp'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ApprovalFetchContext Context for this ApprovalFetchInstance + */ + protected function proxy(): ApprovalFetchContext + { + if (!$this->context) { + $this->context = new ApprovalFetchContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the ApprovalFetchInstance + * + * @return ApprovalFetchInstance Fetched ApprovalFetchInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ApprovalFetchInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Content.V1.ApprovalFetchInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Content/V1/Content/ApprovalFetchList.php b/app/api/Twilio/Rest/Content/V1/Content/ApprovalFetchList.php new file mode 100755 index 0000000..c27a001 --- /dev/null +++ b/app/api/Twilio/Rest/Content/V1/Content/ApprovalFetchList.php @@ -0,0 +1,67 @@ +solution = [ + 'sid' => + $sid, + + ]; + } + + /** + * Constructs a ApprovalFetchContext + */ + public function getContext( + + ): ApprovalFetchContext + { + return new ApprovalFetchContext( + $this->version, + $this->solution['sid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Content.V1.ApprovalFetchList]'; + } +} diff --git a/app/api/Twilio/Rest/Content/V1/Content/ApprovalFetchPage.php b/app/api/Twilio/Rest/Content/V1/Content/ApprovalFetchPage.php new file mode 100755 index 0000000..fdf6a60 --- /dev/null +++ b/app/api/Twilio/Rest/Content/V1/Content/ApprovalFetchPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ApprovalFetchInstance \Twilio\Rest\Content\V1\Content\ApprovalFetchInstance + */ + public function buildInstance(array $payload): ApprovalFetchInstance + { + return new ApprovalFetchInstance($this->version, $payload, $this->solution['sid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Content.V1.ApprovalFetchPage]'; + } +} diff --git a/app/api/Twilio/Rest/Content/V1/ContentAndApprovalsInstance.php b/app/api/Twilio/Rest/Content/V1/ContentAndApprovalsInstance.php new file mode 100755 index 0000000..dc49ba8 --- /dev/null +++ b/app/api/Twilio/Rest/Content/V1/ContentAndApprovalsInstance.php @@ -0,0 +1,97 @@ +properties = [ + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'language' => Values::array_get($payload, 'language'), + 'variables' => Values::array_get($payload, 'variables'), + 'types' => Values::array_get($payload, 'types'), + 'approvalRequests' => Values::array_get($payload, 'approval_requests'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Content.V1.ContentAndApprovalsInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Content/V1/ContentAndApprovalsList.php b/app/api/Twilio/Rest/Content/V1/ContentAndApprovalsList.php new file mode 100755 index 0000000..7ff5573 --- /dev/null +++ b/app/api/Twilio/Rest/Content/V1/ContentAndApprovalsList.php @@ -0,0 +1,145 @@ +solution = [ + ]; + + $this->uri = '/ContentAndApprovals'; + } + + /** + * Reads ContentAndApprovalsInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ContentAndApprovalsInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ContentAndApprovalsInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ContentAndApprovalsInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ContentAndApprovalsPage Page of ContentAndApprovalsInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ContentAndApprovalsPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ContentAndApprovalsPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ContentAndApprovalsInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ContentAndApprovalsPage Page of ContentAndApprovalsInstance + */ + public function getPage(string $targetUrl): ContentAndApprovalsPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ContentAndApprovalsPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Content.V1.ContentAndApprovalsList]'; + } +} diff --git a/app/api/Twilio/Rest/Content/V1/ContentAndApprovalsPage.php b/app/api/Twilio/Rest/Content/V1/ContentAndApprovalsPage.php new file mode 100755 index 0000000..c8e7b7f --- /dev/null +++ b/app/api/Twilio/Rest/Content/V1/ContentAndApprovalsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ContentAndApprovalsInstance \Twilio\Rest\Content\V1\ContentAndApprovalsInstance + */ + public function buildInstance(array $payload): ContentAndApprovalsInstance + { + return new ContentAndApprovalsInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Content.V1.ContentAndApprovalsPage]'; + } +} diff --git a/app/api/Twilio/Rest/Content/V1/ContentContext.php b/app/api/Twilio/Rest/Content/V1/ContentContext.php new file mode 100755 index 0000000..ca48ab6 --- /dev/null +++ b/app/api/Twilio/Rest/Content/V1/ContentContext.php @@ -0,0 +1,152 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Content/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ContentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the ContentInstance + * + * @return ContentInstance Fetched ContentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ContentInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ContentInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the approvalFetch + */ + protected function getApprovalFetch(): ApprovalFetchList + { + if (!$this->_approvalFetch) { + $this->_approvalFetch = new ApprovalFetchList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_approvalFetch; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Content.V1.ContentContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Content/V1/ContentInstance.php b/app/api/Twilio/Rest/Content/V1/ContentInstance.php new file mode 100755 index 0000000..f20d535 --- /dev/null +++ b/app/api/Twilio/Rest/Content/V1/ContentInstance.php @@ -0,0 +1,157 @@ +properties = [ + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'language' => Values::array_get($payload, 'language'), + 'variables' => Values::array_get($payload, 'variables'), + 'types' => Values::array_get($payload, 'types'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ContentContext Context for this ContentInstance + */ + protected function proxy(): ContentContext + { + if (!$this->context) { + $this->context = new ContentContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ContentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ContentInstance + * + * @return ContentInstance Fetched ContentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ContentInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the approvalFetch + */ + protected function getApprovalFetch(): ApprovalFetchList + { + return $this->proxy()->approvalFetch; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Content.V1.ContentInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Content/V1/ContentList.php b/app/api/Twilio/Rest/Content/V1/ContentList.php new file mode 100755 index 0000000..64f527a --- /dev/null +++ b/app/api/Twilio/Rest/Content/V1/ContentList.php @@ -0,0 +1,161 @@ +solution = [ + ]; + + $this->uri = '/Content'; + } + + /** + * Reads ContentInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ContentInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ContentInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ContentInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ContentPage Page of ContentInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ContentPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ContentPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ContentInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ContentPage Page of ContentInstance + */ + public function getPage(string $targetUrl): ContentPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ContentPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ContentContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Content resource to fetch. + */ + public function getContext( + string $sid + + ): ContentContext + { + return new ContentContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Content.V1.ContentList]'; + } +} diff --git a/app/api/Twilio/Rest/Content/V1/ContentPage.php b/app/api/Twilio/Rest/Content/V1/ContentPage.php new file mode 100755 index 0000000..4eb8e83 --- /dev/null +++ b/app/api/Twilio/Rest/Content/V1/ContentPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ContentInstance \Twilio\Rest\Content\V1\ContentInstance + */ + public function buildInstance(array $payload): ContentInstance + { + return new ContentInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Content.V1.ContentPage]'; + } +} diff --git a/app/api/Twilio/Rest/Content/V1/LegacyContentInstance.php b/app/api/Twilio/Rest/Content/V1/LegacyContentInstance.php new file mode 100755 index 0000000..e9730e3 --- /dev/null +++ b/app/api/Twilio/Rest/Content/V1/LegacyContentInstance.php @@ -0,0 +1,101 @@ +properties = [ + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'language' => Values::array_get($payload, 'language'), + 'variables' => Values::array_get($payload, 'variables'), + 'types' => Values::array_get($payload, 'types'), + 'legacyTemplateName' => Values::array_get($payload, 'legacy_template_name'), + 'legacyBody' => Values::array_get($payload, 'legacy_body'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Content.V1.LegacyContentInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Content/V1/LegacyContentList.php b/app/api/Twilio/Rest/Content/V1/LegacyContentList.php new file mode 100755 index 0000000..99bbc9d --- /dev/null +++ b/app/api/Twilio/Rest/Content/V1/LegacyContentList.php @@ -0,0 +1,145 @@ +solution = [ + ]; + + $this->uri = '/LegacyContent'; + } + + /** + * Reads LegacyContentInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return LegacyContentInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams LegacyContentInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of LegacyContentInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return LegacyContentPage Page of LegacyContentInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): LegacyContentPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new LegacyContentPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of LegacyContentInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return LegacyContentPage Page of LegacyContentInstance + */ + public function getPage(string $targetUrl): LegacyContentPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new LegacyContentPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Content.V1.LegacyContentList]'; + } +} diff --git a/app/api/Twilio/Rest/Content/V1/LegacyContentPage.php b/app/api/Twilio/Rest/Content/V1/LegacyContentPage.php new file mode 100755 index 0000000..f1c1f84 --- /dev/null +++ b/app/api/Twilio/Rest/Content/V1/LegacyContentPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return LegacyContentInstance \Twilio\Rest\Content\V1\LegacyContentInstance + */ + public function buildInstance(array $payload): LegacyContentInstance + { + return new LegacyContentInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Content.V1.LegacyContentPage]'; + } +} diff --git a/app/api/Twilio/Rest/ContentBase.php b/app/api/Twilio/Rest/ContentBase.php new file mode 100755 index 0000000..21cda50 --- /dev/null +++ b/app/api/Twilio/Rest/ContentBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://content.twilio.com'; + } + + + /** + * @return V1 Version v1 of content + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Content]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations.php b/app/api/Twilio/Rest/Conversations.php new file mode 100755 index 0000000..9f5cb20 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations.php @@ -0,0 +1,137 @@ +configuration instead. + */ + protected function getConfiguration(): \Twilio\Rest\Conversations\V1\ConfigurationList { + echo "configuration is deprecated. Use v1->configuration instead."; + return $this->v1->configuration; + } + + /** + * @deprecated Use v1->configuration() instead. + */ + protected function contextConfiguration(): \Twilio\Rest\Conversations\V1\ConfigurationContext { + echo "configuration() is deprecated. Use v1->configuration() instead."; + return $this->v1->configuration(); + } + + /** + * @deprecated Use v1->addressConfigurations instead. + */ + protected function getAddressConfigurations(): \Twilio\Rest\Conversations\V1\AddressConfigurationList { + echo "addressConfigurations is deprecated. Use v1->addressConfigurations instead."; + return $this->v1->addressConfigurations; + } + + /** + * @deprecated Use v1->addressConfigurations(\$sid) instead. + * @param string $sid The SID or Address of the Configuration. + */ + protected function contextAddressConfigurations(string $sid): \Twilio\Rest\Conversations\V1\AddressConfigurationContext { + echo "addressConfigurations(\$sid) is deprecated. Use v1->addressConfigurations(\$sid) instead."; + return $this->v1->addressConfigurations($sid); + } + + /** + * @deprecated Use v1->conversations instead. + */ + protected function getConversations(): \Twilio\Rest\Conversations\V1\ConversationList { + echo "conversations is deprecated. Use v1->conversations instead."; + return $this->v1->conversations; + } + + /** + * @deprecated Use v1->conversations(\$sid) instead. + * @param string $sid A 34 character string that uniquely identifies this + * resource. + */ + protected function contextConversations(string $sid): \Twilio\Rest\Conversations\V1\ConversationContext { + echo "conversations(\$sid) is deprecated. Use v1->conversations(\$sid) instead."; + return $this->v1->conversations($sid); + } + + /** + * @deprecated Use v1->credentials instead. + */ + protected function getCredentials(): \Twilio\Rest\Conversations\V1\CredentialList { + echo "credentials is deprecated. Use v1->credentials instead."; + return $this->v1->credentials; + } + + /** + * @deprecated Use v1->credentials(\$sid) instead. + * @param string $sid A 34 character string that uniquely identifies this + * resource. + */ + protected function contextCredentials(string $sid): \Twilio\Rest\Conversations\V1\CredentialContext { + echo "credentials(\$sid) is deprecated. Use v1->credentials(\$sid) instead."; + return $this->v1->credentials($sid); + } + + /** + * @deprecated Use v1->participantConversations instead. + */ + protected function getParticipantConversations(): \Twilio\Rest\Conversations\V1\ParticipantConversationList { + echo "participantConversations is deprecated. Use v1->participantConversations instead."; + return $this->v1->participantConversations; + } + + /** + * @deprecated Use v1->roles instead. + */ + protected function getRoles(): \Twilio\Rest\Conversations\V1\RoleList { + echo "roles is deprecated. Use v1->roles instead."; + return $this->v1->roles; + } + + /** + * @deprecated Use v1->roles(\$sid) instead. + * @param string $sid The SID of the Role resource to fetch + */ + protected function contextRoles(string $sid): \Twilio\Rest\Conversations\V1\RoleContext { + echo "roles(\$sid) is deprecated. Use v1->roles(\$sid) instead."; + return $this->v1->roles($sid); + } + + /** + * @deprecated Use v1->services instead. + */ + protected function getServices(): \Twilio\Rest\Conversations\V1\ServiceList { + echo "services is deprecated. Use v1->services instead."; + return $this->v1->services; + } + + /** + * @deprecated Use v1->services(\$sid) instead. + * @param string $sid A 34 character string that uniquely identifies this + * resource. + */ + protected function contextServices(string $sid): \Twilio\Rest\Conversations\V1\ServiceContext { + echo "services(\$sid) is deprecated. Use v1->services(\$sid) instead."; + return $this->v1->services($sid); + } + + /** + * @deprecated Use v1->users instead. + */ + protected function getUsers(): \Twilio\Rest\Conversations\V1\UserList { + echo "users is deprecated. Use v1->users instead."; + return $this->v1->users; + } + + /** + * @deprecated Use v1->users(\$sid) instead. + * @param string $sid The SID of the User resource to fetch + */ + protected function contextUsers(string $sid): \Twilio\Rest\Conversations\V1\UserContext { + echo "users(\$sid) is deprecated. Use v1->users(\$sid) instead."; + return $this->v1->users($sid); + } +} \ No newline at end of file diff --git a/app/api/Twilio/Rest/Conversations/V1.php b/app/api/Twilio/Rest/Conversations/V1.php new file mode 100755 index 0000000..20534e4 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1.php @@ -0,0 +1,177 @@ +version = 'v1'; + } + + protected function getAddressConfigurations(): AddressConfigurationList + { + if (!$this->_addressConfigurations) { + $this->_addressConfigurations = new AddressConfigurationList($this); + } + return $this->_addressConfigurations; + } + + protected function getConfiguration(): ConfigurationList + { + if (!$this->_configuration) { + $this->_configuration = new ConfigurationList($this); + } + return $this->_configuration; + } + + protected function getConversations(): ConversationList + { + if (!$this->_conversations) { + $this->_conversations = new ConversationList($this); + } + return $this->_conversations; + } + + protected function getCredentials(): CredentialList + { + if (!$this->_credentials) { + $this->_credentials = new CredentialList($this); + } + return $this->_credentials; + } + + protected function getParticipantConversations(): ParticipantConversationList + { + if (!$this->_participantConversations) { + $this->_participantConversations = new ParticipantConversationList($this); + } + return $this->_participantConversations; + } + + protected function getRoles(): RoleList + { + if (!$this->_roles) { + $this->_roles = new RoleList($this); + } + return $this->_roles; + } + + protected function getServices(): ServiceList + { + if (!$this->_services) { + $this->_services = new ServiceList($this); + } + return $this->_services; + } + + protected function getUsers(): UserList + { + if (!$this->_users) { + $this->_users = new UserList($this); + } + return $this->_users; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/AddressConfigurationContext.php b/app/api/Twilio/Rest/Conversations/V1/AddressConfigurationContext.php new file mode 100755 index 0000000..55ae9e7 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/AddressConfigurationContext.php @@ -0,0 +1,140 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Configuration/Addresses/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the AddressConfigurationInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the AddressConfigurationInstance + * + * @return AddressConfigurationInstance Fetched AddressConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AddressConfigurationInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new AddressConfigurationInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the AddressConfigurationInstance + * + * @param array|Options $options Optional Arguments + * @return AddressConfigurationInstance Updated AddressConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): AddressConfigurationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'AutoCreation.Enabled' => + Serialize::booleanToString($options['autoCreationEnabled']), + 'AutoCreation.Type' => + $options['autoCreationType'], + 'AutoCreation.ConversationServiceSid' => + $options['autoCreationConversationServiceSid'], + 'AutoCreation.WebhookUrl' => + $options['autoCreationWebhookUrl'], + 'AutoCreation.WebhookMethod' => + $options['autoCreationWebhookMethod'], + 'AutoCreation.WebhookFilters' => + Serialize::map($options['autoCreationWebhookFilters'], function ($e) { return $e; }), + 'AutoCreation.StudioFlowSid' => + $options['autoCreationStudioFlowSid'], + 'AutoCreation.StudioRetryCount' => + $options['autoCreationStudioRetryCount'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new AddressConfigurationInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.AddressConfigurationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/AddressConfigurationInstance.php b/app/api/Twilio/Rest/Conversations/V1/AddressConfigurationInstance.php new file mode 100755 index 0000000..cecc092 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/AddressConfigurationInstance.php @@ -0,0 +1,158 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'type' => Values::array_get($payload, 'type'), + 'address' => Values::array_get($payload, 'address'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'autoCreation' => Values::array_get($payload, 'auto_creation'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AddressConfigurationContext Context for this AddressConfigurationInstance + */ + protected function proxy(): AddressConfigurationContext + { + if (!$this->context) { + $this->context = new AddressConfigurationContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the AddressConfigurationInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the AddressConfigurationInstance + * + * @return AddressConfigurationInstance Fetched AddressConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AddressConfigurationInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the AddressConfigurationInstance + * + * @param array|Options $options Optional Arguments + * @return AddressConfigurationInstance Updated AddressConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): AddressConfigurationInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.AddressConfigurationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/AddressConfigurationList.php b/app/api/Twilio/Rest/Conversations/V1/AddressConfigurationList.php new file mode 100755 index 0000000..5950dae --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/AddressConfigurationList.php @@ -0,0 +1,218 @@ +solution = [ + ]; + + $this->uri = '/Configuration/Addresses'; + } + + /** + * Create the AddressConfigurationInstance + * + * @param string $type + * @param string $address The unique address to be configured. The address can be a whatsapp address or phone number + * @param array|Options $options Optional Arguments + * @return AddressConfigurationInstance Created AddressConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $type, string $address, array $options = []): AddressConfigurationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Type' => + $type, + 'Address' => + $address, + 'FriendlyName' => + $options['friendlyName'], + 'AutoCreation.Enabled' => + Serialize::booleanToString($options['autoCreationEnabled']), + 'AutoCreation.Type' => + $options['autoCreationType'], + 'AutoCreation.ConversationServiceSid' => + $options['autoCreationConversationServiceSid'], + 'AutoCreation.WebhookUrl' => + $options['autoCreationWebhookUrl'], + 'AutoCreation.WebhookMethod' => + $options['autoCreationWebhookMethod'], + 'AutoCreation.WebhookFilters' => + Serialize::map($options['autoCreationWebhookFilters'], function ($e) { return $e; }), + 'AutoCreation.StudioFlowSid' => + $options['autoCreationStudioFlowSid'], + 'AutoCreation.StudioRetryCount' => + $options['autoCreationStudioRetryCount'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new AddressConfigurationInstance( + $this->version, + $payload + ); + } + + + /** + * Reads AddressConfigurationInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return AddressConfigurationInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams AddressConfigurationInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AddressConfigurationInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return AddressConfigurationPage Page of AddressConfigurationInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AddressConfigurationPage + { + $options = new Values($options); + + $params = Values::of([ + 'Type' => + $options['type'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new AddressConfigurationPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of AddressConfigurationInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return AddressConfigurationPage Page of AddressConfigurationInstance + */ + public function getPage(string $targetUrl): AddressConfigurationPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AddressConfigurationPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AddressConfigurationContext + * + * @param string $sid The SID of the Address Configuration resource. This value can be either the `sid` or the `address` of the configuration + */ + public function getContext( + string $sid + + ): AddressConfigurationContext + { + return new AddressConfigurationContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.AddressConfigurationList]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/AddressConfigurationOptions.php b/app/api/Twilio/Rest/Conversations/V1/AddressConfigurationOptions.php new file mode 100755 index 0000000..3e51210 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/AddressConfigurationOptions.php @@ -0,0 +1,464 @@ +options['friendlyName'] = $friendlyName; + $this->options['autoCreationEnabled'] = $autoCreationEnabled; + $this->options['autoCreationType'] = $autoCreationType; + $this->options['autoCreationConversationServiceSid'] = $autoCreationConversationServiceSid; + $this->options['autoCreationWebhookUrl'] = $autoCreationWebhookUrl; + $this->options['autoCreationWebhookMethod'] = $autoCreationWebhookMethod; + $this->options['autoCreationWebhookFilters'] = $autoCreationWebhookFilters; + $this->options['autoCreationStudioFlowSid'] = $autoCreationStudioFlowSid; + $this->options['autoCreationStudioRetryCount'] = $autoCreationStudioRetryCount; + } + + /** + * The human-readable name of this configuration, limited to 256 characters. Optional. + * + * @param string $friendlyName The human-readable name of this configuration, limited to 256 characters. Optional. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Enable/Disable auto-creating conversations for messages to this address + * + * @param bool $autoCreationEnabled Enable/Disable auto-creating conversations for messages to this address + * @return $this Fluent Builder + */ + public function setAutoCreationEnabled(bool $autoCreationEnabled): self + { + $this->options['autoCreationEnabled'] = $autoCreationEnabled; + return $this; + } + + /** + * @param string $autoCreationType + * @return $this Fluent Builder + */ + public function setAutoCreationType(string $autoCreationType): self + { + $this->options['autoCreationType'] = $autoCreationType; + return $this; + } + + /** + * Conversation Service for the auto-created conversation. If not set, the conversation is created in the default service. + * + * @param string $autoCreationConversationServiceSid Conversation Service for the auto-created conversation. If not set, the conversation is created in the default service. + * @return $this Fluent Builder + */ + public function setAutoCreationConversationServiceSid(string $autoCreationConversationServiceSid): self + { + $this->options['autoCreationConversationServiceSid'] = $autoCreationConversationServiceSid; + return $this; + } + + /** + * For type `webhook`, the url for the webhook request. + * + * @param string $autoCreationWebhookUrl For type `webhook`, the url for the webhook request. + * @return $this Fluent Builder + */ + public function setAutoCreationWebhookUrl(string $autoCreationWebhookUrl): self + { + $this->options['autoCreationWebhookUrl'] = $autoCreationWebhookUrl; + return $this; + } + + /** + * @param string $autoCreationWebhookMethod + * @return $this Fluent Builder + */ + public function setAutoCreationWebhookMethod(string $autoCreationWebhookMethod): self + { + $this->options['autoCreationWebhookMethod'] = $autoCreationWebhookMethod; + return $this; + } + + /** + * The list of events, firing webhook event for this Conversation. Values can be any of the following: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationStateUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onDeliveryUpdated` + * + * @param string[] $autoCreationWebhookFilters The list of events, firing webhook event for this Conversation. Values can be any of the following: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationStateUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onDeliveryUpdated` + * @return $this Fluent Builder + */ + public function setAutoCreationWebhookFilters(array $autoCreationWebhookFilters): self + { + $this->options['autoCreationWebhookFilters'] = $autoCreationWebhookFilters; + return $this; + } + + /** + * For type `studio`, the studio flow SID where the webhook should be sent to. + * + * @param string $autoCreationStudioFlowSid For type `studio`, the studio flow SID where the webhook should be sent to. + * @return $this Fluent Builder + */ + public function setAutoCreationStudioFlowSid(string $autoCreationStudioFlowSid): self + { + $this->options['autoCreationStudioFlowSid'] = $autoCreationStudioFlowSid; + return $this; + } + + /** + * For type `studio`, number of times to retry the webhook request + * + * @param int $autoCreationStudioRetryCount For type `studio`, number of times to retry the webhook request + * @return $this Fluent Builder + */ + public function setAutoCreationStudioRetryCount(int $autoCreationStudioRetryCount): self + { + $this->options['autoCreationStudioRetryCount'] = $autoCreationStudioRetryCount; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.CreateAddressConfigurationOptions ' . $options . ']'; + } +} + + + +class ReadAddressConfigurationOptions extends Options + { + /** + * @param string $type Filter the address configurations by its type. This value can be one of: `whatsapp`, `sms`. + */ + public function __construct( + + string $type = Values::NONE + + ) { + $this->options['type'] = $type; + } + + /** + * Filter the address configurations by its type. This value can be one of: `whatsapp`, `sms`. + * + * @param string $type Filter the address configurations by its type. This value can be one of: `whatsapp`, `sms`. + * @return $this Fluent Builder + */ + public function setType(string $type): self + { + $this->options['type'] = $type; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.ReadAddressConfigurationOptions ' . $options . ']'; + } +} + +class UpdateAddressConfigurationOptions extends Options + { + /** + * @param string $friendlyName The human-readable name of this configuration, limited to 256 characters. Optional. + * @param bool $autoCreationEnabled Enable/Disable auto-creating conversations for messages to this address + * @param string $autoCreationType + * @param string $autoCreationConversationServiceSid Conversation Service for the auto-created conversation. If not set, the conversation is created in the default service. + * @param string $autoCreationWebhookUrl For type `webhook`, the url for the webhook request. + * @param string $autoCreationWebhookMethod + * @param string[] $autoCreationWebhookFilters The list of events, firing webhook event for this Conversation. Values can be any of the following: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationStateUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onDeliveryUpdated` + * @param string $autoCreationStudioFlowSid For type `studio`, the studio flow SID where the webhook should be sent to. + * @param int $autoCreationStudioRetryCount For type `studio`, number of times to retry the webhook request + */ + public function __construct( + + string $friendlyName = Values::NONE, + bool $autoCreationEnabled = Values::BOOL_NONE, + string $autoCreationType = Values::NONE, + string $autoCreationConversationServiceSid = Values::NONE, + string $autoCreationWebhookUrl = Values::NONE, + string $autoCreationWebhookMethod = Values::NONE, + array $autoCreationWebhookFilters = Values::ARRAY_NONE, + string $autoCreationStudioFlowSid = Values::NONE, + int $autoCreationStudioRetryCount = Values::INT_NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['autoCreationEnabled'] = $autoCreationEnabled; + $this->options['autoCreationType'] = $autoCreationType; + $this->options['autoCreationConversationServiceSid'] = $autoCreationConversationServiceSid; + $this->options['autoCreationWebhookUrl'] = $autoCreationWebhookUrl; + $this->options['autoCreationWebhookMethod'] = $autoCreationWebhookMethod; + $this->options['autoCreationWebhookFilters'] = $autoCreationWebhookFilters; + $this->options['autoCreationStudioFlowSid'] = $autoCreationStudioFlowSid; + $this->options['autoCreationStudioRetryCount'] = $autoCreationStudioRetryCount; + } + + /** + * The human-readable name of this configuration, limited to 256 characters. Optional. + * + * @param string $friendlyName The human-readable name of this configuration, limited to 256 characters. Optional. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Enable/Disable auto-creating conversations for messages to this address + * + * @param bool $autoCreationEnabled Enable/Disable auto-creating conversations for messages to this address + * @return $this Fluent Builder + */ + public function setAutoCreationEnabled(bool $autoCreationEnabled): self + { + $this->options['autoCreationEnabled'] = $autoCreationEnabled; + return $this; + } + + /** + * @param string $autoCreationType + * @return $this Fluent Builder + */ + public function setAutoCreationType(string $autoCreationType): self + { + $this->options['autoCreationType'] = $autoCreationType; + return $this; + } + + /** + * Conversation Service for the auto-created conversation. If not set, the conversation is created in the default service. + * + * @param string $autoCreationConversationServiceSid Conversation Service for the auto-created conversation. If not set, the conversation is created in the default service. + * @return $this Fluent Builder + */ + public function setAutoCreationConversationServiceSid(string $autoCreationConversationServiceSid): self + { + $this->options['autoCreationConversationServiceSid'] = $autoCreationConversationServiceSid; + return $this; + } + + /** + * For type `webhook`, the url for the webhook request. + * + * @param string $autoCreationWebhookUrl For type `webhook`, the url for the webhook request. + * @return $this Fluent Builder + */ + public function setAutoCreationWebhookUrl(string $autoCreationWebhookUrl): self + { + $this->options['autoCreationWebhookUrl'] = $autoCreationWebhookUrl; + return $this; + } + + /** + * @param string $autoCreationWebhookMethod + * @return $this Fluent Builder + */ + public function setAutoCreationWebhookMethod(string $autoCreationWebhookMethod): self + { + $this->options['autoCreationWebhookMethod'] = $autoCreationWebhookMethod; + return $this; + } + + /** + * The list of events, firing webhook event for this Conversation. Values can be any of the following: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationStateUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onDeliveryUpdated` + * + * @param string[] $autoCreationWebhookFilters The list of events, firing webhook event for this Conversation. Values can be any of the following: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationStateUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved`, `onDeliveryUpdated` + * @return $this Fluent Builder + */ + public function setAutoCreationWebhookFilters(array $autoCreationWebhookFilters): self + { + $this->options['autoCreationWebhookFilters'] = $autoCreationWebhookFilters; + return $this; + } + + /** + * For type `studio`, the studio flow SID where the webhook should be sent to. + * + * @param string $autoCreationStudioFlowSid For type `studio`, the studio flow SID where the webhook should be sent to. + * @return $this Fluent Builder + */ + public function setAutoCreationStudioFlowSid(string $autoCreationStudioFlowSid): self + { + $this->options['autoCreationStudioFlowSid'] = $autoCreationStudioFlowSid; + return $this; + } + + /** + * For type `studio`, number of times to retry the webhook request + * + * @param int $autoCreationStudioRetryCount For type `studio`, number of times to retry the webhook request + * @return $this Fluent Builder + */ + public function setAutoCreationStudioRetryCount(int $autoCreationStudioRetryCount): self + { + $this->options['autoCreationStudioRetryCount'] = $autoCreationStudioRetryCount; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.UpdateAddressConfigurationOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/AddressConfigurationPage.php b/app/api/Twilio/Rest/Conversations/V1/AddressConfigurationPage.php new file mode 100755 index 0000000..29e1a81 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/AddressConfigurationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AddressConfigurationInstance \Twilio\Rest\Conversations\V1\AddressConfigurationInstance + */ + public function buildInstance(array $payload): AddressConfigurationInstance + { + return new AddressConfigurationInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.AddressConfigurationPage]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Configuration/WebhookContext.php b/app/api/Twilio/Rest/Conversations/V1/Configuration/WebhookContext.php new file mode 100755 index 0000000..fb24e4a --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Configuration/WebhookContext.php @@ -0,0 +1,112 @@ +solution = [ + ]; + + $this->uri = '/Configuration/Webhooks'; + } + + /** + * Fetch the WebhookInstance + * + * @return WebhookInstance Fetched WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WebhookInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new WebhookInstance( + $this->version, + $payload + ); + } + + + /** + * Update the WebhookInstance + * + * @param array|Options $options Optional Arguments + * @return WebhookInstance Updated WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WebhookInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Method' => + $options['method'], + 'Filters' => + Serialize::map($options['filters'], function ($e) { return $e; }), + 'PreWebhookUrl' => + $options['preWebhookUrl'], + 'PostWebhookUrl' => + $options['postWebhookUrl'], + 'Target' => + $options['target'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new WebhookInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.WebhookContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Configuration/WebhookInstance.php b/app/api/Twilio/Rest/Conversations/V1/Configuration/WebhookInstance.php new file mode 100755 index 0000000..f25efc4 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Configuration/WebhookInstance.php @@ -0,0 +1,139 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'method' => Values::array_get($payload, 'method'), + 'filters' => Values::array_get($payload, 'filters'), + 'preWebhookUrl' => Values::array_get($payload, 'pre_webhook_url'), + 'postWebhookUrl' => Values::array_get($payload, 'post_webhook_url'), + 'target' => Values::array_get($payload, 'target'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = []; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return WebhookContext Context for this WebhookInstance + */ + protected function proxy(): WebhookContext + { + if (!$this->context) { + $this->context = new WebhookContext( + $this->version + ); + } + + return $this->context; + } + + /** + * Fetch the WebhookInstance + * + * @return WebhookInstance Fetched WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WebhookInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the WebhookInstance + * + * @param array|Options $options Optional Arguments + * @return WebhookInstance Updated WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WebhookInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.WebhookInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/Configuration/WebhookList.php b/app/api/Twilio/Rest/Conversations/V1/Configuration/WebhookList.php new file mode 100755 index 0000000..4c8fdbf --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Configuration/WebhookList.php @@ -0,0 +1,61 @@ +solution = [ + ]; + } + + /** + * Constructs a WebhookContext + */ + public function getContext( + + ): WebhookContext + { + return new WebhookContext( + $this->version + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.WebhookList]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Configuration/WebhookOptions.php b/app/api/Twilio/Rest/Conversations/V1/Configuration/WebhookOptions.php new file mode 100755 index 0000000..0a3bfa7 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Configuration/WebhookOptions.php @@ -0,0 +1,148 @@ +options['method'] = $method; + $this->options['filters'] = $filters; + $this->options['preWebhookUrl'] = $preWebhookUrl; + $this->options['postWebhookUrl'] = $postWebhookUrl; + $this->options['target'] = $target; + } + + /** + * The HTTP method to be used when sending a webhook request. + * + * @param string $method The HTTP method to be used when sending a webhook request. + * @return $this Fluent Builder + */ + public function setMethod(string $method): self + { + $this->options['method'] = $method; + return $this; + } + + /** + * The list of webhook event triggers that are enabled for this Service: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved` + * + * @param string[] $filters The list of webhook event triggers that are enabled for this Service: `onMessageAdded`, `onMessageUpdated`, `onMessageRemoved`, `onConversationUpdated`, `onConversationRemoved`, `onParticipantAdded`, `onParticipantUpdated`, `onParticipantRemoved` + * @return $this Fluent Builder + */ + public function setFilters(array $filters): self + { + $this->options['filters'] = $filters; + return $this; + } + + /** + * The absolute url the pre-event webhook request should be sent to. + * + * @param string $preWebhookUrl The absolute url the pre-event webhook request should be sent to. + * @return $this Fluent Builder + */ + public function setPreWebhookUrl(string $preWebhookUrl): self + { + $this->options['preWebhookUrl'] = $preWebhookUrl; + return $this; + } + + /** + * The absolute url the post-event webhook request should be sent to. + * + * @param string $postWebhookUrl The absolute url the post-event webhook request should be sent to. + * @return $this Fluent Builder + */ + public function setPostWebhookUrl(string $postWebhookUrl): self + { + $this->options['postWebhookUrl'] = $postWebhookUrl; + return $this; + } + + /** + * @param string $target + * @return $this Fluent Builder + */ + public function setTarget(string $target): self + { + $this->options['target'] = $target; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.UpdateWebhookOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/Configuration/WebhookPage.php b/app/api/Twilio/Rest/Conversations/V1/Configuration/WebhookPage.php new file mode 100755 index 0000000..475bd4f --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Configuration/WebhookPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WebhookInstance \Twilio\Rest\Conversations\V1\Configuration\WebhookInstance + */ + public function buildInstance(array $payload): WebhookInstance + { + return new WebhookInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.WebhookPage]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/ConfigurationContext.php b/app/api/Twilio/Rest/Conversations/V1/ConfigurationContext.php new file mode 100755 index 0000000..223c8c9 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/ConfigurationContext.php @@ -0,0 +1,109 @@ +solution = [ + ]; + + $this->uri = '/Configuration'; + } + + /** + * Fetch the ConfigurationInstance + * + * @return ConfigurationInstance Fetched ConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ConfigurationInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ConfigurationInstance( + $this->version, + $payload + ); + } + + + /** + * Update the ConfigurationInstance + * + * @param array|Options $options Optional Arguments + * @return ConfigurationInstance Updated ConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ConfigurationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'DefaultChatServiceSid' => + $options['defaultChatServiceSid'], + 'DefaultMessagingServiceSid' => + $options['defaultMessagingServiceSid'], + 'DefaultInactiveTimer' => + $options['defaultInactiveTimer'], + 'DefaultClosedTimer' => + $options['defaultClosedTimer'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new ConfigurationInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.ConfigurationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/ConfigurationInstance.php b/app/api/Twilio/Rest/Conversations/V1/ConfigurationInstance.php new file mode 100755 index 0000000..babdb1c --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/ConfigurationInstance.php @@ -0,0 +1,139 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'defaultChatServiceSid' => Values::array_get($payload, 'default_chat_service_sid'), + 'defaultMessagingServiceSid' => Values::array_get($payload, 'default_messaging_service_sid'), + 'defaultInactiveTimer' => Values::array_get($payload, 'default_inactive_timer'), + 'defaultClosedTimer' => Values::array_get($payload, 'default_closed_timer'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = []; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ConfigurationContext Context for this ConfigurationInstance + */ + protected function proxy(): ConfigurationContext + { + if (!$this->context) { + $this->context = new ConfigurationContext( + $this->version + ); + } + + return $this->context; + } + + /** + * Fetch the ConfigurationInstance + * + * @return ConfigurationInstance Fetched ConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ConfigurationInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ConfigurationInstance + * + * @param array|Options $options Optional Arguments + * @return ConfigurationInstance Updated ConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ConfigurationInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.ConfigurationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/ConfigurationList.php b/app/api/Twilio/Rest/Conversations/V1/ConfigurationList.php new file mode 100755 index 0000000..1be87e1 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/ConfigurationList.php @@ -0,0 +1,118 @@ +solution = [ + ]; + } + + /** + * Constructs a ConfigurationContext + */ + public function getContext( + + ): ConfigurationContext + { + return new ConfigurationContext( + $this->version + ); + } + + /** + * Access the webhooks + */ + protected function getWebhooks(): WebhookList + { + if (!$this->_webhooks) { + $this->_webhooks = new WebhookList( + $this->version + ); + } + return $this->_webhooks; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name) + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.ConfigurationList]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/ConfigurationOptions.php b/app/api/Twilio/Rest/Conversations/V1/ConfigurationOptions.php new file mode 100755 index 0000000..7b16265 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/ConfigurationOptions.php @@ -0,0 +1,132 @@ +options['defaultChatServiceSid'] = $defaultChatServiceSid; + $this->options['defaultMessagingServiceSid'] = $defaultMessagingServiceSid; + $this->options['defaultInactiveTimer'] = $defaultInactiveTimer; + $this->options['defaultClosedTimer'] = $defaultClosedTimer; + } + + /** + * The SID of the default [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) to use when creating a conversation. + * + * @param string $defaultChatServiceSid The SID of the default [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource) to use when creating a conversation. + * @return $this Fluent Builder + */ + public function setDefaultChatServiceSid(string $defaultChatServiceSid): self + { + $this->options['defaultChatServiceSid'] = $defaultChatServiceSid; + return $this; + } + + /** + * The SID of the default [Messaging Service](https://www.twilio.com/docs/sms/services/api) to use when creating a conversation. + * + * @param string $defaultMessagingServiceSid The SID of the default [Messaging Service](https://www.twilio.com/docs/sms/services/api) to use when creating a conversation. + * @return $this Fluent Builder + */ + public function setDefaultMessagingServiceSid(string $defaultMessagingServiceSid): self + { + $this->options['defaultMessagingServiceSid'] = $defaultMessagingServiceSid; + return $this; + } + + /** + * Default ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. + * + * @param string $defaultInactiveTimer Default ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. + * @return $this Fluent Builder + */ + public function setDefaultInactiveTimer(string $defaultInactiveTimer): self + { + $this->options['defaultInactiveTimer'] = $defaultInactiveTimer; + return $this; + } + + /** + * Default ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. + * + * @param string $defaultClosedTimer Default ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. + * @return $this Fluent Builder + */ + public function setDefaultClosedTimer(string $defaultClosedTimer): self + { + $this->options['defaultClosedTimer'] = $defaultClosedTimer; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.UpdateConfigurationOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/ConfigurationPage.php b/app/api/Twilio/Rest/Conversations/V1/ConfigurationPage.php new file mode 100755 index 0000000..8a70af3 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/ConfigurationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ConfigurationInstance \Twilio\Rest\Conversations\V1\ConfigurationInstance + */ + public function buildInstance(array $payload): ConfigurationInstance + { + return new ConfigurationInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.ConfigurationPage]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptContext.php b/app/api/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptContext.php new file mode 100755 index 0000000..3943330 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptContext.php @@ -0,0 +1,93 @@ +solution = [ + 'conversationSid' => + $conversationSid, + 'messageSid' => + $messageSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Conversations/' . \rawurlencode($conversationSid) + .'/Messages/' . \rawurlencode($messageSid) + .'/Receipts/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the DeliveryReceiptInstance + * + * @return DeliveryReceiptInstance Fetched DeliveryReceiptInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DeliveryReceiptInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new DeliveryReceiptInstance( + $this->version, + $payload, + $this->solution['conversationSid'], + $this->solution['messageSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.DeliveryReceiptContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptInstance.php b/app/api/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptInstance.php new file mode 100755 index 0000000..f72d783 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptInstance.php @@ -0,0 +1,140 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'conversationSid' => Values::array_get($payload, 'conversation_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'messageSid' => Values::array_get($payload, 'message_sid'), + 'channelMessageSid' => Values::array_get($payload, 'channel_message_sid'), + 'participantSid' => Values::array_get($payload, 'participant_sid'), + 'status' => Values::array_get($payload, 'status'), + 'errorCode' => Values::array_get($payload, 'error_code'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['conversationSid' => $conversationSid, 'messageSid' => $messageSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return DeliveryReceiptContext Context for this DeliveryReceiptInstance + */ + protected function proxy(): DeliveryReceiptContext + { + if (!$this->context) { + $this->context = new DeliveryReceiptContext( + $this->version, + $this->solution['conversationSid'], + $this->solution['messageSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the DeliveryReceiptInstance + * + * @return DeliveryReceiptInstance Fetched DeliveryReceiptInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DeliveryReceiptInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.DeliveryReceiptInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptList.php b/app/api/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptList.php new file mode 100755 index 0000000..9bd7f2e --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptList.php @@ -0,0 +1,175 @@ +solution = [ + 'conversationSid' => + $conversationSid, + + 'messageSid' => + $messageSid, + + ]; + + $this->uri = '/Conversations/' . \rawurlencode($conversationSid) + .'/Messages/' . \rawurlencode($messageSid) + .'/Receipts'; + } + + /** + * Reads DeliveryReceiptInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return DeliveryReceiptInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams DeliveryReceiptInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of DeliveryReceiptInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return DeliveryReceiptPage Page of DeliveryReceiptInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): DeliveryReceiptPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new DeliveryReceiptPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of DeliveryReceiptInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return DeliveryReceiptPage Page of DeliveryReceiptInstance + */ + public function getPage(string $targetUrl): DeliveryReceiptPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new DeliveryReceiptPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a DeliveryReceiptContext + * + * @param string $sid A 34 character string that uniquely identifies this resource. + */ + public function getContext( + string $sid + + ): DeliveryReceiptContext + { + return new DeliveryReceiptContext( + $this->version, + $this->solution['conversationSid'], + $this->solution['messageSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.DeliveryReceiptList]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptPage.php b/app/api/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptPage.php new file mode 100755 index 0000000..d79c53c --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Conversation/Message/DeliveryReceiptPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DeliveryReceiptInstance \Twilio\Rest\Conversations\V1\Conversation\Message\DeliveryReceiptInstance + */ + public function buildInstance(array $payload): DeliveryReceiptInstance + { + return new DeliveryReceiptInstance($this->version, $payload, $this->solution['conversationSid'], $this->solution['messageSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.DeliveryReceiptPage]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Conversation/MessageContext.php b/app/api/Twilio/Rest/Conversations/V1/Conversation/MessageContext.php new file mode 100755 index 0000000..44b9073 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Conversation/MessageContext.php @@ -0,0 +1,205 @@ +solution = [ + 'conversationSid' => + $conversationSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Conversations/' . \rawurlencode($conversationSid) + .'/Messages/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the MessageInstance + * + * @return MessageInstance Fetched MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MessageInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new MessageInstance( + $this->version, + $payload, + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return MessageInstance Updated MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MessageInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Author' => + $options['author'], + 'Body' => + $options['body'], + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'Attributes' => + $options['attributes'], + ]); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new MessageInstance( + $this->version, + $payload, + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the deliveryReceipts + */ + protected function getDeliveryReceipts(): DeliveryReceiptList + { + if (!$this->_deliveryReceipts) { + $this->_deliveryReceipts = new DeliveryReceiptList( + $this->version, + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + return $this->_deliveryReceipts; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.MessageContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Conversation/MessageInstance.php b/app/api/Twilio/Rest/Conversations/V1/Conversation/MessageInstance.php new file mode 100755 index 0000000..a06cbf0 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Conversation/MessageInstance.php @@ -0,0 +1,184 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'conversationSid' => Values::array_get($payload, 'conversation_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'index' => Values::array_get($payload, 'index'), + 'author' => Values::array_get($payload, 'author'), + 'body' => Values::array_get($payload, 'body'), + 'media' => Values::array_get($payload, 'media'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'participantSid' => Values::array_get($payload, 'participant_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'delivery' => Values::array_get($payload, 'delivery'), + 'links' => Values::array_get($payload, 'links'), + 'contentSid' => Values::array_get($payload, 'content_sid'), + ]; + + $this->solution = ['conversationSid' => $conversationSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return MessageContext Context for this MessageInstance + */ + protected function proxy(): MessageContext + { + if (!$this->context) { + $this->context = new MessageContext( + $this->version, + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the MessageInstance + * + * @return MessageInstance Fetched MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MessageInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return MessageInstance Updated MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MessageInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the deliveryReceipts + */ + protected function getDeliveryReceipts(): DeliveryReceiptList + { + return $this->proxy()->deliveryReceipts; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.MessageInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/Conversation/MessageList.php b/app/api/Twilio/Rest/Conversations/V1/Conversation/MessageList.php new file mode 100755 index 0000000..4a97f13 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Conversation/MessageList.php @@ -0,0 +1,220 @@ +solution = [ + 'conversationSid' => + $conversationSid, + + ]; + + $this->uri = '/Conversations/' . \rawurlencode($conversationSid) + .'/Messages'; + } + + /** + * Create the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return MessageInstance Created MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): MessageInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Author' => + $options['author'], + 'Body' => + $options['body'], + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'Attributes' => + $options['attributes'], + 'MediaSid' => + $options['mediaSid'], + 'ContentSid' => + $options['contentSid'], + 'ContentVariables' => + $options['contentVariables'], + ]); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new MessageInstance( + $this->version, + $payload, + $this->solution['conversationSid'] + ); + } + + + /** + * Reads MessageInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return MessageInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams MessageInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of MessageInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return MessagePage Page of MessageInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MessagePage + { + $options = new Values($options); + + $params = Values::of([ + 'Order' => + $options['order'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new MessagePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of MessageInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return MessagePage Page of MessageInstance + */ + public function getPage(string $targetUrl): MessagePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new MessagePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a MessageContext + * + * @param string $sid A 34 character string that uniquely identifies this resource. + */ + public function getContext( + string $sid + + ): MessageContext + { + return new MessageContext( + $this->version, + $this->solution['conversationSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.MessageList]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Conversation/MessageOptions.php b/app/api/Twilio/Rest/Conversations/V1/Conversation/MessageOptions.php new file mode 100755 index 0000000..33fc515 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Conversation/MessageOptions.php @@ -0,0 +1,468 @@ +options['author'] = $author; + $this->options['body'] = $body; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['attributes'] = $attributes; + $this->options['mediaSid'] = $mediaSid; + $this->options['contentSid'] = $contentSid; + $this->options['contentVariables'] = $contentVariables; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The channel specific identifier of the message's author. Defaults to `system`. + * + * @param string $author The channel specific identifier of the message's author. Defaults to `system`. + * @return $this Fluent Builder + */ + public function setAuthor(string $author): self + { + $this->options['author'] = $author; + return $this; + } + + /** + * The content of the message, can be up to 1,600 characters long. + * + * @param string $body The content of the message, can be up to 1,600 characters long. + * @return $this Fluent Builder + */ + public function setBody(string $body): self + { + $this->options['body'] = $body; + return $this; + } + + /** + * The date that this resource was created. + * + * @param \DateTime $dateCreated The date that this resource was created. + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The date that this resource was last updated. `null` if the message has not been edited. + * + * @param \DateTime $dateUpdated The date that this resource was last updated. `null` if the message has not been edited. + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * + * @param string $attributes A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The Media SID to be attached to the new Message. + * + * @param string $mediaSid The Media SID to be attached to the new Message. + * @return $this Fluent Builder + */ + public function setMediaSid(string $mediaSid): self + { + $this->options['mediaSid'] = $mediaSid; + return $this; + } + + /** + * The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content-api) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. + * + * @param string $contentSid The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content-api) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. + * @return $this Fluent Builder + */ + public function setContentSid(string $contentSid): self + { + $this->options['contentSid'] = $contentSid; + return $this; + } + + /** + * A structurally valid JSON string that contains values to resolve Rich Content template variables. + * + * @param string $contentVariables A structurally valid JSON string that contains values to resolve Rich Content template variables. + * @return $this Fluent Builder + */ + public function setContentVariables(string $contentVariables): self + { + $this->options['contentVariables'] = $contentVariables; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.CreateMessageOptions ' . $options . ']'; + } +} + +class DeleteMessageOptions extends Options + { + /** + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.DeleteMessageOptions ' . $options . ']'; + } +} + + +class ReadMessageOptions extends Options + { + /** + * @param string $order The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending), with `asc` as the default. + */ + public function __construct( + + string $order = Values::NONE + + ) { + $this->options['order'] = $order; + } + + /** + * The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending), with `asc` as the default. + * + * @param string $order The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending), with `asc` as the default. + * @return $this Fluent Builder + */ + public function setOrder(string $order): self + { + $this->options['order'] = $order; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.ReadMessageOptions ' . $options . ']'; + } +} + +class UpdateMessageOptions extends Options + { + /** + * @param string $author The channel specific identifier of the message's author. Defaults to `system`. + * @param string $body The content of the message, can be up to 1,600 characters long. + * @param \DateTime $dateCreated The date that this resource was created. + * @param \DateTime $dateUpdated The date that this resource was last updated. `null` if the message has not been edited. + * @param string $attributes A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $author = Values::NONE, + string $body = Values::NONE, + \DateTime $dateCreated = null, + \DateTime $dateUpdated = null, + string $attributes = Values::NONE, + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['author'] = $author; + $this->options['body'] = $body; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['attributes'] = $attributes; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The channel specific identifier of the message's author. Defaults to `system`. + * + * @param string $author The channel specific identifier of the message's author. Defaults to `system`. + * @return $this Fluent Builder + */ + public function setAuthor(string $author): self + { + $this->options['author'] = $author; + return $this; + } + + /** + * The content of the message, can be up to 1,600 characters long. + * + * @param string $body The content of the message, can be up to 1,600 characters long. + * @return $this Fluent Builder + */ + public function setBody(string $body): self + { + $this->options['body'] = $body; + return $this; + } + + /** + * The date that this resource was created. + * + * @param \DateTime $dateCreated The date that this resource was created. + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The date that this resource was last updated. `null` if the message has not been edited. + * + * @param \DateTime $dateUpdated The date that this resource was last updated. `null` if the message has not been edited. + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * + * @param string $attributes A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.UpdateMessageOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/Conversation/MessagePage.php b/app/api/Twilio/Rest/Conversations/V1/Conversation/MessagePage.php new file mode 100755 index 0000000..54c2235 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Conversation/MessagePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MessageInstance \Twilio\Rest\Conversations\V1\Conversation\MessageInstance + */ + public function buildInstance(array $payload): MessageInstance + { + return new MessageInstance($this->version, $payload, $this->solution['conversationSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.MessagePage]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Conversation/ParticipantContext.php b/app/api/Twilio/Rest/Conversations/V1/Conversation/ParticipantContext.php new file mode 100755 index 0000000..b1277f1 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Conversation/ParticipantContext.php @@ -0,0 +1,154 @@ +solution = [ + 'conversationSid' => + $conversationSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Conversations/' . \rawurlencode($conversationSid) + .'/Participants/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ParticipantInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ParticipantInstance + * + * @return ParticipantInstance Fetched ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ParticipantInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ParticipantInstance( + $this->version, + $payload, + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ParticipantInstance + * + * @param array|Options $options Optional Arguments + * @return ParticipantInstance Updated ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ParticipantInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'Attributes' => + $options['attributes'], + 'RoleSid' => + $options['roleSid'], + 'MessagingBinding.ProxyAddress' => + $options['messagingBindingProxyAddress'], + 'MessagingBinding.ProjectedAddress' => + $options['messagingBindingProjectedAddress'], + 'Identity' => + $options['identity'], + 'LastReadMessageIndex' => + $options['lastReadMessageIndex'], + 'LastReadTimestamp' => + $options['lastReadTimestamp'], + ]); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ParticipantInstance( + $this->version, + $payload, + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.ParticipantContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Conversation/ParticipantInstance.php b/app/api/Twilio/Rest/Conversations/V1/Conversation/ParticipantInstance.php new file mode 100755 index 0000000..e60698b --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Conversation/ParticipantInstance.php @@ -0,0 +1,167 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'conversationSid' => Values::array_get($payload, 'conversation_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'messagingBinding' => Values::array_get($payload, 'messaging_binding'), + 'roleSid' => Values::array_get($payload, 'role_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'lastReadMessageIndex' => Values::array_get($payload, 'last_read_message_index'), + 'lastReadTimestamp' => Values::array_get($payload, 'last_read_timestamp'), + ]; + + $this->solution = ['conversationSid' => $conversationSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ParticipantContext Context for this ParticipantInstance + */ + protected function proxy(): ParticipantContext + { + if (!$this->context) { + $this->context = new ParticipantContext( + $this->version, + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ParticipantInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the ParticipantInstance + * + * @return ParticipantInstance Fetched ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ParticipantInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ParticipantInstance + * + * @param array|Options $options Optional Arguments + * @return ParticipantInstance Updated ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ParticipantInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.ParticipantInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/Conversation/ParticipantList.php b/app/api/Twilio/Rest/Conversations/V1/Conversation/ParticipantList.php new file mode 100755 index 0000000..ebc55d8 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Conversation/ParticipantList.php @@ -0,0 +1,214 @@ +solution = [ + 'conversationSid' => + $conversationSid, + + ]; + + $this->uri = '/Conversations/' . \rawurlencode($conversationSid) + .'/Participants'; + } + + /** + * Create the ParticipantInstance + * + * @param array|Options $options Optional Arguments + * @return ParticipantInstance Created ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): ParticipantInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Identity' => + $options['identity'], + 'MessagingBinding.Address' => + $options['messagingBindingAddress'], + 'MessagingBinding.ProxyAddress' => + $options['messagingBindingProxyAddress'], + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'Attributes' => + $options['attributes'], + 'MessagingBinding.ProjectedAddress' => + $options['messagingBindingProjectedAddress'], + 'RoleSid' => + $options['roleSid'], + ]); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ParticipantInstance( + $this->version, + $payload, + $this->solution['conversationSid'] + ); + } + + + /** + * Reads ParticipantInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ParticipantInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ParticipantInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ParticipantInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ParticipantPage Page of ParticipantInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ParticipantPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ParticipantPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ParticipantInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ParticipantPage Page of ParticipantInstance + */ + public function getPage(string $targetUrl): ParticipantPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ParticipantPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ParticipantContext + * + * @param string $sid A 34 character string that uniquely identifies this resource. + */ + public function getContext( + string $sid + + ): ParticipantContext + { + return new ParticipantContext( + $this->version, + $this->solution['conversationSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.ParticipantList]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Conversation/ParticipantOptions.php b/app/api/Twilio/Rest/Conversations/V1/Conversation/ParticipantOptions.php new file mode 100755 index 0000000..5728a80 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Conversation/ParticipantOptions.php @@ -0,0 +1,490 @@ +options['identity'] = $identity; + $this->options['messagingBindingAddress'] = $messagingBindingAddress; + $this->options['messagingBindingProxyAddress'] = $messagingBindingProxyAddress; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['attributes'] = $attributes; + $this->options['messagingBindingProjectedAddress'] = $messagingBindingProjectedAddress; + $this->options['roleSid'] = $roleSid; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. + * + * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. + * @return $this Fluent Builder + */ + public function setIdentity(string $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * The address of the participant's device, e.g. a phone or WhatsApp number. Together with the Proxy address, this determines a participant uniquely. This field (with proxy_address) is only null when the participant is interacting from an SDK endpoint (see the 'identity' field). + * + * @param string $messagingBindingAddress The address of the participant's device, e.g. a phone or WhatsApp number. Together with the Proxy address, this determines a participant uniquely. This field (with proxy_address) is only null when the participant is interacting from an SDK endpoint (see the 'identity' field). + * @return $this Fluent Builder + */ + public function setMessagingBindingAddress(string $messagingBindingAddress): self + { + $this->options['messagingBindingAddress'] = $messagingBindingAddress; + return $this; + } + + /** + * The address of the Twilio phone number (or WhatsApp number) that the participant is in contact with. This field, together with participant address, is only null when the participant is interacting from an SDK endpoint (see the 'identity' field). + * + * @param string $messagingBindingProxyAddress The address of the Twilio phone number (or WhatsApp number) that the participant is in contact with. This field, together with participant address, is only null when the participant is interacting from an SDK endpoint (see the 'identity' field). + * @return $this Fluent Builder + */ + public function setMessagingBindingProxyAddress(string $messagingBindingProxyAddress): self + { + $this->options['messagingBindingProxyAddress'] = $messagingBindingProxyAddress; + return $this; + } + + /** + * The date that this resource was created. + * + * @param \DateTime $dateCreated The date that this resource was created. + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The date that this resource was last updated. + * + * @param \DateTime $dateUpdated The date that this resource was last updated. + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * + * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The address of the Twilio phone number that is used in Group MMS. Communication mask for the Conversation participant with Identity. + * + * @param string $messagingBindingProjectedAddress The address of the Twilio phone number that is used in Group MMS. Communication mask for the Conversation participant with Identity. + * @return $this Fluent Builder + */ + public function setMessagingBindingProjectedAddress(string $messagingBindingProjectedAddress): self + { + $this->options['messagingBindingProjectedAddress'] = $messagingBindingProjectedAddress; + return $this; + } + + /** + * The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. + * + * @param string $roleSid The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.CreateParticipantOptions ' . $options . ']'; + } +} + +class DeleteParticipantOptions extends Options + { + /** + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.DeleteParticipantOptions ' . $options . ']'; + } +} + + + +class UpdateParticipantOptions extends Options + { + /** + * @param \DateTime $dateCreated The date that this resource was created. + * @param \DateTime $dateUpdated The date that this resource was last updated. + * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * @param string $roleSid The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. + * @param string $messagingBindingProxyAddress The address of the Twilio phone number that the participant is in contact with. 'null' value will remove it. + * @param string $messagingBindingProjectedAddress The address of the Twilio phone number that is used in Group MMS. 'null' value will remove it. + * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. + * @param int $lastReadMessageIndex Index of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. + * @param string $lastReadTimestamp Timestamp of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + \DateTime $dateCreated = null, + \DateTime $dateUpdated = null, + string $attributes = Values::NONE, + string $roleSid = Values::NONE, + string $messagingBindingProxyAddress = Values::NONE, + string $messagingBindingProjectedAddress = Values::NONE, + string $identity = Values::NONE, + int $lastReadMessageIndex = Values::INT_NONE, + string $lastReadTimestamp = Values::NONE, + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['attributes'] = $attributes; + $this->options['roleSid'] = $roleSid; + $this->options['messagingBindingProxyAddress'] = $messagingBindingProxyAddress; + $this->options['messagingBindingProjectedAddress'] = $messagingBindingProjectedAddress; + $this->options['identity'] = $identity; + $this->options['lastReadMessageIndex'] = $lastReadMessageIndex; + $this->options['lastReadTimestamp'] = $lastReadTimestamp; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The date that this resource was created. + * + * @param \DateTime $dateCreated The date that this resource was created. + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The date that this resource was last updated. + * + * @param \DateTime $dateUpdated The date that this resource was last updated. + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * + * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. + * + * @param string $roleSid The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * The address of the Twilio phone number that the participant is in contact with. 'null' value will remove it. + * + * @param string $messagingBindingProxyAddress The address of the Twilio phone number that the participant is in contact with. 'null' value will remove it. + * @return $this Fluent Builder + */ + public function setMessagingBindingProxyAddress(string $messagingBindingProxyAddress): self + { + $this->options['messagingBindingProxyAddress'] = $messagingBindingProxyAddress; + return $this; + } + + /** + * The address of the Twilio phone number that is used in Group MMS. 'null' value will remove it. + * + * @param string $messagingBindingProjectedAddress The address of the Twilio phone number that is used in Group MMS. 'null' value will remove it. + * @return $this Fluent Builder + */ + public function setMessagingBindingProjectedAddress(string $messagingBindingProjectedAddress): self + { + $this->options['messagingBindingProjectedAddress'] = $messagingBindingProjectedAddress; + return $this; + } + + /** + * A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. + * + * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. + * @return $this Fluent Builder + */ + public function setIdentity(string $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * Index of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. + * + * @param int $lastReadMessageIndex Index of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. + * @return $this Fluent Builder + */ + public function setLastReadMessageIndex(int $lastReadMessageIndex): self + { + $this->options['lastReadMessageIndex'] = $lastReadMessageIndex; + return $this; + } + + /** + * Timestamp of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. + * + * @param string $lastReadTimestamp Timestamp of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. + * @return $this Fluent Builder + */ + public function setLastReadTimestamp(string $lastReadTimestamp): self + { + $this->options['lastReadTimestamp'] = $lastReadTimestamp; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.UpdateParticipantOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/Conversation/ParticipantPage.php b/app/api/Twilio/Rest/Conversations/V1/Conversation/ParticipantPage.php new file mode 100755 index 0000000..843ef14 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Conversation/ParticipantPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ParticipantInstance \Twilio\Rest\Conversations\V1\Conversation\ParticipantInstance + */ + public function buildInstance(array $payload): ParticipantInstance + { + return new ParticipantInstance($this->version, $payload, $this->solution['conversationSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.ParticipantPage]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Conversation/WebhookContext.php b/app/api/Twilio/Rest/Conversations/V1/Conversation/WebhookContext.php new file mode 100755 index 0000000..51078ad --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Conversation/WebhookContext.php @@ -0,0 +1,139 @@ +solution = [ + 'conversationSid' => + $conversationSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Conversations/' . \rawurlencode($conversationSid) + .'/Webhooks/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the WebhookInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the WebhookInstance + * + * @return WebhookInstance Fetched WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WebhookInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new WebhookInstance( + $this->version, + $payload, + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the WebhookInstance + * + * @param array|Options $options Optional Arguments + * @return WebhookInstance Updated WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WebhookInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Configuration.Url' => + $options['configurationUrl'], + 'Configuration.Method' => + $options['configurationMethod'], + 'Configuration.Filters' => + Serialize::map($options['configurationFilters'], function ($e) { return $e; }), + 'Configuration.Triggers' => + Serialize::map($options['configurationTriggers'], function ($e) { return $e; }), + 'Configuration.FlowSid' => + $options['configurationFlowSid'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new WebhookInstance( + $this->version, + $payload, + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.WebhookContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Conversation/WebhookInstance.php b/app/api/Twilio/Rest/Conversations/V1/Conversation/WebhookInstance.php new file mode 100755 index 0000000..6be9963 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Conversation/WebhookInstance.php @@ -0,0 +1,158 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'conversationSid' => Values::array_get($payload, 'conversation_sid'), + 'target' => Values::array_get($payload, 'target'), + 'url' => Values::array_get($payload, 'url'), + 'configuration' => Values::array_get($payload, 'configuration'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + ]; + + $this->solution = ['conversationSid' => $conversationSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return WebhookContext Context for this WebhookInstance + */ + protected function proxy(): WebhookContext + { + if (!$this->context) { + $this->context = new WebhookContext( + $this->version, + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the WebhookInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the WebhookInstance + * + * @return WebhookInstance Fetched WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WebhookInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the WebhookInstance + * + * @param array|Options $options Optional Arguments + * @return WebhookInstance Updated WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WebhookInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.WebhookInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/Conversation/WebhookList.php b/app/api/Twilio/Rest/Conversations/V1/Conversation/WebhookList.php new file mode 100755 index 0000000..261ce1d --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Conversation/WebhookList.php @@ -0,0 +1,211 @@ +solution = [ + 'conversationSid' => + $conversationSid, + + ]; + + $this->uri = '/Conversations/' . \rawurlencode($conversationSid) + .'/Webhooks'; + } + + /** + * Create the WebhookInstance + * + * @param string $target + * @param array|Options $options Optional Arguments + * @return WebhookInstance Created WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $target, array $options = []): WebhookInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Target' => + $target, + 'Configuration.Url' => + $options['configurationUrl'], + 'Configuration.Method' => + $options['configurationMethod'], + 'Configuration.Filters' => + Serialize::map($options['configurationFilters'], function ($e) { return $e; }), + 'Configuration.Triggers' => + Serialize::map($options['configurationTriggers'], function ($e) { return $e; }), + 'Configuration.FlowSid' => + $options['configurationFlowSid'], + 'Configuration.ReplayAfter' => + $options['configurationReplayAfter'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new WebhookInstance( + $this->version, + $payload, + $this->solution['conversationSid'] + ); + } + + + /** + * Reads WebhookInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return WebhookInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams WebhookInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of WebhookInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return WebhookPage Page of WebhookInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): WebhookPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new WebhookPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of WebhookInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return WebhookPage Page of WebhookInstance + */ + public function getPage(string $targetUrl): WebhookPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new WebhookPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a WebhookContext + * + * @param string $sid A 34 character string that uniquely identifies this resource. + */ + public function getContext( + string $sid + + ): WebhookContext + { + return new WebhookContext( + $this->version, + $this->solution['conversationSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.WebhookList]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Conversation/WebhookOptions.php b/app/api/Twilio/Rest/Conversations/V1/Conversation/WebhookOptions.php new file mode 100755 index 0000000..9a24d33 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Conversation/WebhookOptions.php @@ -0,0 +1,292 @@ +options['configurationUrl'] = $configurationUrl; + $this->options['configurationMethod'] = $configurationMethod; + $this->options['configurationFilters'] = $configurationFilters; + $this->options['configurationTriggers'] = $configurationTriggers; + $this->options['configurationFlowSid'] = $configurationFlowSid; + $this->options['configurationReplayAfter'] = $configurationReplayAfter; + } + + /** + * The absolute url the webhook request should be sent to. + * + * @param string $configurationUrl The absolute url the webhook request should be sent to. + * @return $this Fluent Builder + */ + public function setConfigurationUrl(string $configurationUrl): self + { + $this->options['configurationUrl'] = $configurationUrl; + return $this; + } + + /** + * @param string $configurationMethod + * @return $this Fluent Builder + */ + public function setConfigurationMethod(string $configurationMethod): self + { + $this->options['configurationMethod'] = $configurationMethod; + return $this; + } + + /** + * The list of events, firing webhook event for this Conversation. + * + * @param string[] $configurationFilters The list of events, firing webhook event for this Conversation. + * @return $this Fluent Builder + */ + public function setConfigurationFilters(array $configurationFilters): self + { + $this->options['configurationFilters'] = $configurationFilters; + return $this; + } + + /** + * The list of keywords, firing webhook event for this Conversation. + * + * @param string[] $configurationTriggers The list of keywords, firing webhook event for this Conversation. + * @return $this Fluent Builder + */ + public function setConfigurationTriggers(array $configurationTriggers): self + { + $this->options['configurationTriggers'] = $configurationTriggers; + return $this; + } + + /** + * The studio flow SID, where the webhook should be sent to. + * + * @param string $configurationFlowSid The studio flow SID, where the webhook should be sent to. + * @return $this Fluent Builder + */ + public function setConfigurationFlowSid(string $configurationFlowSid): self + { + $this->options['configurationFlowSid'] = $configurationFlowSid; + return $this; + } + + /** + * The message index for which and it's successors the webhook will be replayed. Not set by default + * + * @param int $configurationReplayAfter The message index for which and it's successors the webhook will be replayed. Not set by default + * @return $this Fluent Builder + */ + public function setConfigurationReplayAfter(int $configurationReplayAfter): self + { + $this->options['configurationReplayAfter'] = $configurationReplayAfter; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.CreateWebhookOptions ' . $options . ']'; + } +} + + + + +class UpdateWebhookOptions extends Options + { + /** + * @param string $configurationUrl The absolute url the webhook request should be sent to. + * @param string $configurationMethod + * @param string[] $configurationFilters The list of events, firing webhook event for this Conversation. + * @param string[] $configurationTriggers The list of keywords, firing webhook event for this Conversation. + * @param string $configurationFlowSid The studio flow SID, where the webhook should be sent to. + */ + public function __construct( + + string $configurationUrl = Values::NONE, + string $configurationMethod = Values::NONE, + array $configurationFilters = Values::ARRAY_NONE, + array $configurationTriggers = Values::ARRAY_NONE, + string $configurationFlowSid = Values::NONE + + ) { + $this->options['configurationUrl'] = $configurationUrl; + $this->options['configurationMethod'] = $configurationMethod; + $this->options['configurationFilters'] = $configurationFilters; + $this->options['configurationTriggers'] = $configurationTriggers; + $this->options['configurationFlowSid'] = $configurationFlowSid; + } + + /** + * The absolute url the webhook request should be sent to. + * + * @param string $configurationUrl The absolute url the webhook request should be sent to. + * @return $this Fluent Builder + */ + public function setConfigurationUrl(string $configurationUrl): self + { + $this->options['configurationUrl'] = $configurationUrl; + return $this; + } + + /** + * @param string $configurationMethod + * @return $this Fluent Builder + */ + public function setConfigurationMethod(string $configurationMethod): self + { + $this->options['configurationMethod'] = $configurationMethod; + return $this; + } + + /** + * The list of events, firing webhook event for this Conversation. + * + * @param string[] $configurationFilters The list of events, firing webhook event for this Conversation. + * @return $this Fluent Builder + */ + public function setConfigurationFilters(array $configurationFilters): self + { + $this->options['configurationFilters'] = $configurationFilters; + return $this; + } + + /** + * The list of keywords, firing webhook event for this Conversation. + * + * @param string[] $configurationTriggers The list of keywords, firing webhook event for this Conversation. + * @return $this Fluent Builder + */ + public function setConfigurationTriggers(array $configurationTriggers): self + { + $this->options['configurationTriggers'] = $configurationTriggers; + return $this; + } + + /** + * The studio flow SID, where the webhook should be sent to. + * + * @param string $configurationFlowSid The studio flow SID, where the webhook should be sent to. + * @return $this Fluent Builder + */ + public function setConfigurationFlowSid(string $configurationFlowSid): self + { + $this->options['configurationFlowSid'] = $configurationFlowSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.UpdateWebhookOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/Conversation/WebhookPage.php b/app/api/Twilio/Rest/Conversations/V1/Conversation/WebhookPage.php new file mode 100755 index 0000000..5c79106 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Conversation/WebhookPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WebhookInstance \Twilio\Rest\Conversations\V1\Conversation\WebhookInstance + */ + public function buildInstance(array $payload): WebhookInstance + { + return new WebhookInstance($this->version, $payload, $this->solution['conversationSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.WebhookPage]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/ConversationContext.php b/app/api/Twilio/Rest/Conversations/V1/ConversationContext.php new file mode 100755 index 0000000..afced2c --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/ConversationContext.php @@ -0,0 +1,243 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Conversations/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ConversationInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ConversationInstance + * + * @return ConversationInstance Fetched ConversationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ConversationInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ConversationInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the ConversationInstance + * + * @param array|Options $options Optional Arguments + * @return ConversationInstance Updated ConversationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ConversationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'Attributes' => + $options['attributes'], + 'MessagingServiceSid' => + $options['messagingServiceSid'], + 'State' => + $options['state'], + 'Timers.Inactive' => + $options['timersInactive'], + 'Timers.Closed' => + $options['timersClosed'], + 'UniqueName' => + $options['uniqueName'], + ]); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ConversationInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the participants + */ + protected function getParticipants(): ParticipantList + { + if (!$this->_participants) { + $this->_participants = new ParticipantList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_participants; + } + + /** + * Access the webhooks + */ + protected function getWebhooks(): WebhookList + { + if (!$this->_webhooks) { + $this->_webhooks = new WebhookList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_webhooks; + } + + /** + * Access the messages + */ + protected function getMessages(): MessageList + { + if (!$this->_messages) { + $this->_messages = new MessageList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_messages; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.ConversationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/ConversationInstance.php b/app/api/Twilio/Rest/Conversations/V1/ConversationInstance.php new file mode 100755 index 0000000..c4a4c1d --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/ConversationInstance.php @@ -0,0 +1,200 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), + 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'state' => Values::array_get($payload, 'state'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'timers' => Values::array_get($payload, 'timers'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + 'bindings' => Values::array_get($payload, 'bindings'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ConversationContext Context for this ConversationInstance + */ + protected function proxy(): ConversationContext + { + if (!$this->context) { + $this->context = new ConversationContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ConversationInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the ConversationInstance + * + * @return ConversationInstance Fetched ConversationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ConversationInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ConversationInstance + * + * @param array|Options $options Optional Arguments + * @return ConversationInstance Updated ConversationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ConversationInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the participants + */ + protected function getParticipants(): ParticipantList + { + return $this->proxy()->participants; + } + + /** + * Access the webhooks + */ + protected function getWebhooks(): WebhookList + { + return $this->proxy()->webhooks; + } + + /** + * Access the messages + */ + protected function getMessages(): MessageList + { + return $this->proxy()->messages; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.ConversationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/ConversationList.php b/app/api/Twilio/Rest/Conversations/V1/ConversationList.php new file mode 100755 index 0000000..1e51d0e --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/ConversationList.php @@ -0,0 +1,218 @@ +solution = [ + ]; + + $this->uri = '/Conversations'; + } + + /** + * Create the ConversationInstance + * + * @param array|Options $options Optional Arguments + * @return ConversationInstance Created ConversationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): ConversationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'UniqueName' => + $options['uniqueName'], + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'MessagingServiceSid' => + $options['messagingServiceSid'], + 'Attributes' => + $options['attributes'], + 'State' => + $options['state'], + 'Timers.Inactive' => + $options['timersInactive'], + 'Timers.Closed' => + $options['timersClosed'], + ]); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ConversationInstance( + $this->version, + $payload + ); + } + + + /** + * Reads ConversationInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ConversationInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams ConversationInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ConversationInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ConversationPage Page of ConversationInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ConversationPage + { + $options = new Values($options); + + $params = Values::of([ + 'StartDate' => + $options['startDate'], + 'EndDate' => + $options['endDate'], + 'State' => + $options['state'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ConversationPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ConversationInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ConversationPage Page of ConversationInstance + */ + public function getPage(string $targetUrl): ConversationPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ConversationPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ConversationContext + * + * @param string $sid A 34 character string that uniquely identifies this resource. Can also be the `unique_name` of the Conversation. + */ + public function getContext( + string $sid + + ): ConversationContext + { + return new ConversationContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.ConversationList]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/ConversationOptions.php b/app/api/Twilio/Rest/Conversations/V1/ConversationOptions.php new file mode 100755 index 0000000..efe901d --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/ConversationOptions.php @@ -0,0 +1,590 @@ +options['friendlyName'] = $friendlyName; + $this->options['uniqueName'] = $uniqueName; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['messagingServiceSid'] = $messagingServiceSid; + $this->options['attributes'] = $attributes; + $this->options['state'] = $state; + $this->options['timersInactive'] = $timersInactive; + $this->options['timersClosed'] = $timersClosed; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The human-readable name of this conversation, limited to 256 characters. Optional. + * + * @param string $friendlyName The human-readable name of this conversation, limited to 256 characters. Optional. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * The date that this resource was created. + * + * @param \DateTime $dateCreated The date that this resource was created. + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The date that this resource was last updated. + * + * @param \DateTime $dateUpdated The date that this resource was last updated. + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * The unique ID of the [Messaging Service](https://www.twilio.com/docs/sms/services/api) this conversation belongs to. + * + * @param string $messagingServiceSid The unique ID of the [Messaging Service](https://www.twilio.com/docs/sms/services/api) this conversation belongs to. + * @return $this Fluent Builder + */ + public function setMessagingServiceSid(string $messagingServiceSid): self + { + $this->options['messagingServiceSid'] = $messagingServiceSid; + return $this; + } + + /** + * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * + * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * @param string $state + * @return $this Fluent Builder + */ + public function setState(string $state): self + { + $this->options['state'] = $state; + return $this; + } + + /** + * ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. + * + * @param string $timersInactive ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. + * @return $this Fluent Builder + */ + public function setTimersInactive(string $timersInactive): self + { + $this->options['timersInactive'] = $timersInactive; + return $this; + } + + /** + * ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. + * + * @param string $timersClosed ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. + * @return $this Fluent Builder + */ + public function setTimersClosed(string $timersClosed): self + { + $this->options['timersClosed'] = $timersClosed; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.CreateConversationOptions ' . $options . ']'; + } +} + +class DeleteConversationOptions extends Options + { + /** + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.DeleteConversationOptions ' . $options . ']'; + } +} + + +class ReadConversationOptions extends Options + { + /** + * @param string $startDate Start date in ISO8601 format for sorting and filtering list of Conversations. + * @param string $endDate End date in ISO8601 format for sorting and filtering list of Conversations. + * @param string $state State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` + */ + public function __construct( + + string $startDate = Values::NONE, + string $endDate = Values::NONE, + string $state = Values::NONE + + ) { + $this->options['startDate'] = $startDate; + $this->options['endDate'] = $endDate; + $this->options['state'] = $state; + } + + /** + * Start date in ISO8601 format for sorting and filtering list of Conversations. + * + * @param string $startDate Start date in ISO8601 format for sorting and filtering list of Conversations. + * @return $this Fluent Builder + */ + public function setStartDate(string $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * End date in ISO8601 format for sorting and filtering list of Conversations. + * + * @param string $endDate End date in ISO8601 format for sorting and filtering list of Conversations. + * @return $this Fluent Builder + */ + public function setEndDate(string $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` + * + * @param string $state State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` + * @return $this Fluent Builder + */ + public function setState(string $state): self + { + $this->options['state'] = $state; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.ReadConversationOptions ' . $options . ']'; + } +} + +class UpdateConversationOptions extends Options + { + /** + * @param string $friendlyName The human-readable name of this conversation, limited to 256 characters. Optional. + * @param \DateTime $dateCreated The date that this resource was created. + * @param \DateTime $dateUpdated The date that this resource was last updated. + * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * @param string $messagingServiceSid The unique ID of the [Messaging Service](https://www.twilio.com/docs/sms/services/api) this conversation belongs to. + * @param string $state + * @param string $timersInactive ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. + * @param string $timersClosed ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $friendlyName = Values::NONE, + \DateTime $dateCreated = null, + \DateTime $dateUpdated = null, + string $attributes = Values::NONE, + string $messagingServiceSid = Values::NONE, + string $state = Values::NONE, + string $timersInactive = Values::NONE, + string $timersClosed = Values::NONE, + string $uniqueName = Values::NONE, + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['attributes'] = $attributes; + $this->options['messagingServiceSid'] = $messagingServiceSid; + $this->options['state'] = $state; + $this->options['timersInactive'] = $timersInactive; + $this->options['timersClosed'] = $timersClosed; + $this->options['uniqueName'] = $uniqueName; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The human-readable name of this conversation, limited to 256 characters. Optional. + * + * @param string $friendlyName The human-readable name of this conversation, limited to 256 characters. Optional. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The date that this resource was created. + * + * @param \DateTime $dateCreated The date that this resource was created. + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The date that this resource was last updated. + * + * @param \DateTime $dateUpdated The date that this resource was last updated. + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * + * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The unique ID of the [Messaging Service](https://www.twilio.com/docs/sms/services/api) this conversation belongs to. + * + * @param string $messagingServiceSid The unique ID of the [Messaging Service](https://www.twilio.com/docs/sms/services/api) this conversation belongs to. + * @return $this Fluent Builder + */ + public function setMessagingServiceSid(string $messagingServiceSid): self + { + $this->options['messagingServiceSid'] = $messagingServiceSid; + return $this; + } + + /** + * @param string $state + * @return $this Fluent Builder + */ + public function setState(string $state): self + { + $this->options['state'] = $state; + return $this; + } + + /** + * ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. + * + * @param string $timersInactive ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. + * @return $this Fluent Builder + */ + public function setTimersInactive(string $timersInactive): self + { + $this->options['timersInactive'] = $timersInactive; + return $this; + } + + /** + * ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. + * + * @param string $timersClosed ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. + * @return $this Fluent Builder + */ + public function setTimersClosed(string $timersClosed): self + { + $this->options['timersClosed'] = $timersClosed; + return $this; + } + + /** + * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.UpdateConversationOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/ConversationPage.php b/app/api/Twilio/Rest/Conversations/V1/ConversationPage.php new file mode 100755 index 0000000..66ac13d --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/ConversationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ConversationInstance \Twilio\Rest\Conversations\V1\ConversationInstance + */ + public function buildInstance(array $payload): ConversationInstance + { + return new ConversationInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.ConversationPage]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/CredentialContext.php b/app/api/Twilio/Rest/Conversations/V1/CredentialContext.php new file mode 100755 index 0000000..1895569 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/CredentialContext.php @@ -0,0 +1,136 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Credentials/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the CredentialInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the CredentialInstance + * + * @return CredentialInstance Fetched CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new CredentialInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the CredentialInstance + * + * @param array|Options $options Optional Arguments + * @return CredentialInstance Updated CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CredentialInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Type' => + $options['type'], + 'FriendlyName' => + $options['friendlyName'], + 'Certificate' => + $options['certificate'], + 'PrivateKey' => + $options['privateKey'], + 'Sandbox' => + Serialize::booleanToString($options['sandbox']), + 'ApiKey' => + $options['apiKey'], + 'Secret' => + $options['secret'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new CredentialInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.CredentialContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/CredentialInstance.php b/app/api/Twilio/Rest/Conversations/V1/CredentialInstance.php new file mode 100755 index 0000000..affca12 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/CredentialInstance.php @@ -0,0 +1,156 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'type' => Values::array_get($payload, 'type'), + 'sandbox' => Values::array_get($payload, 'sandbox'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CredentialContext Context for this CredentialInstance + */ + protected function proxy(): CredentialContext + { + if (!$this->context) { + $this->context = new CredentialContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the CredentialInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the CredentialInstance + * + * @return CredentialInstance Fetched CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the CredentialInstance + * + * @param array|Options $options Optional Arguments + * @return CredentialInstance Updated CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CredentialInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.CredentialInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/CredentialList.php b/app/api/Twilio/Rest/Conversations/V1/CredentialList.php new file mode 100755 index 0000000..82c9d46 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/CredentialList.php @@ -0,0 +1,203 @@ +solution = [ + ]; + + $this->uri = '/Credentials'; + } + + /** + * Create the CredentialInstance + * + * @param string $type + * @param array|Options $options Optional Arguments + * @return CredentialInstance Created CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $type, array $options = []): CredentialInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Type' => + $type, + 'FriendlyName' => + $options['friendlyName'], + 'Certificate' => + $options['certificate'], + 'PrivateKey' => + $options['privateKey'], + 'Sandbox' => + Serialize::booleanToString($options['sandbox']), + 'ApiKey' => + $options['apiKey'], + 'Secret' => + $options['secret'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new CredentialInstance( + $this->version, + $payload + ); + } + + + /** + * Reads CredentialInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return CredentialInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams CredentialInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CredentialInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return CredentialPage Page of CredentialInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CredentialPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new CredentialPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of CredentialInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return CredentialPage Page of CredentialInstance + */ + public function getPage(string $targetUrl): CredentialPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CredentialPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CredentialContext + * + * @param string $sid A 34 character string that uniquely identifies this resource. + */ + public function getContext( + string $sid + + ): CredentialContext + { + return new CredentialContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.CredentialList]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/CredentialOptions.php b/app/api/Twilio/Rest/Conversations/V1/CredentialOptions.php new file mode 100755 index 0000000..468124c --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/CredentialOptions.php @@ -0,0 +1,330 @@ +options['friendlyName'] = $friendlyName; + $this->options['certificate'] = $certificate; + $this->options['privateKey'] = $privateKey; + $this->options['sandbox'] = $sandbox; + $this->options['apiKey'] = $apiKey; + $this->options['secret'] = $secret; + } + + /** + * A descriptive string that you create to describe the new resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----`. + * + * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----`. + * @return $this Fluent Builder + */ + public function setCertificate(string $certificate): self + { + $this->options['certificate'] = $certificate; + return $this; + } + + /** + * [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----`. + * + * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----`. + * @return $this Fluent Builder + */ + public function setPrivateKey(string $privateKey): self + { + $this->options['privateKey'] = $privateKey; + return $this; + } + + /** + * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * + * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * @return $this Fluent Builder + */ + public function setSandbox(bool $sandbox): self + { + $this->options['sandbox'] = $sandbox; + return $this; + } + + /** + * [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. + * + * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. + * @return $this Fluent Builder + */ + public function setApiKey(string $apiKey): self + { + $this->options['apiKey'] = $apiKey; + return $this; + } + + /** + * [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. + * + * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. + * @return $this Fluent Builder + */ + public function setSecret(string $secret): self + { + $this->options['secret'] = $secret; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.CreateCredentialOptions ' . $options . ']'; + } +} + + + + +class UpdateCredentialOptions extends Options + { + /** + * @param string $type + * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. + * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----`. + * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----`. + * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. + * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. + */ + public function __construct( + + string $type = Values::NONE, + string $friendlyName = Values::NONE, + string $certificate = Values::NONE, + string $privateKey = Values::NONE, + bool $sandbox = Values::BOOL_NONE, + string $apiKey = Values::NONE, + string $secret = Values::NONE + + ) { + $this->options['type'] = $type; + $this->options['friendlyName'] = $friendlyName; + $this->options['certificate'] = $certificate; + $this->options['privateKey'] = $privateKey; + $this->options['sandbox'] = $sandbox; + $this->options['apiKey'] = $apiKey; + $this->options['secret'] = $secret; + } + + /** + * @param string $type + * @return $this Fluent Builder + */ + public function setType(string $type): self + { + $this->options['type'] = $type; + return $this; + } + + /** + * A descriptive string that you create to describe the new resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----`. + * + * @param string $certificate [APN only] The URL encoded representation of the certificate. For example, `-----BEGIN CERTIFICATE----- MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEF.....A== -----END CERTIFICATE-----`. + * @return $this Fluent Builder + */ + public function setCertificate(string $certificate): self + { + $this->options['certificate'] = $certificate; + return $this; + } + + /** + * [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----`. + * + * @param string $privateKey [APN only] The URL encoded representation of the private key. For example, `-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fG... -----END RSA PRIVATE KEY-----`. + * @return $this Fluent Builder + */ + public function setPrivateKey(string $privateKey): self + { + $this->options['privateKey'] = $privateKey; + return $this; + } + + /** + * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * + * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * @return $this Fluent Builder + */ + public function setSandbox(bool $sandbox): self + { + $this->options['sandbox'] = $sandbox; + return $this; + } + + /** + * [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. + * + * @param string $apiKey [GCM only] The API key for the project that was obtained from the Google Developer console for your GCM Service application credential. + * @return $this Fluent Builder + */ + public function setApiKey(string $apiKey): self + { + $this->options['apiKey'] = $apiKey; + return $this; + } + + /** + * [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. + * + * @param string $secret [FCM only] The **Server key** of your project from the Firebase console, found under Settings / Cloud messaging. + * @return $this Fluent Builder + */ + public function setSecret(string $secret): self + { + $this->options['secret'] = $secret; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.UpdateCredentialOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/CredentialPage.php b/app/api/Twilio/Rest/Conversations/V1/CredentialPage.php new file mode 100755 index 0000000..f13db25 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/CredentialPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CredentialInstance \Twilio\Rest\Conversations\V1\CredentialInstance + */ + public function buildInstance(array $payload): CredentialInstance + { + return new CredentialInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.CredentialPage]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/ParticipantConversationInstance.php b/app/api/Twilio/Rest/Conversations/V1/ParticipantConversationInstance.php new file mode 100755 index 0000000..8e4aae4 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/ParticipantConversationInstance.php @@ -0,0 +1,111 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), + 'participantSid' => Values::array_get($payload, 'participant_sid'), + 'participantUserSid' => Values::array_get($payload, 'participant_user_sid'), + 'participantIdentity' => Values::array_get($payload, 'participant_identity'), + 'participantMessagingBinding' => Values::array_get($payload, 'participant_messaging_binding'), + 'conversationSid' => Values::array_get($payload, 'conversation_sid'), + 'conversationUniqueName' => Values::array_get($payload, 'conversation_unique_name'), + 'conversationFriendlyName' => Values::array_get($payload, 'conversation_friendly_name'), + 'conversationAttributes' => Values::array_get($payload, 'conversation_attributes'), + 'conversationDateCreated' => Deserialize::dateTime(Values::array_get($payload, 'conversation_date_created')), + 'conversationDateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'conversation_date_updated')), + 'conversationCreatedBy' => Values::array_get($payload, 'conversation_created_by'), + 'conversationState' => Values::array_get($payload, 'conversation_state'), + 'conversationTimers' => Values::array_get($payload, 'conversation_timers'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.ParticipantConversationInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/ParticipantConversationList.php b/app/api/Twilio/Rest/Conversations/V1/ParticipantConversationList.php new file mode 100755 index 0000000..23e42db --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/ParticipantConversationList.php @@ -0,0 +1,154 @@ +solution = [ + ]; + + $this->uri = '/ParticipantConversations'; + } + + /** + * Reads ParticipantConversationInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ParticipantConversationInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams ParticipantConversationInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ParticipantConversationInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ParticipantConversationPage Page of ParticipantConversationInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ParticipantConversationPage + { + $options = new Values($options); + + $params = Values::of([ + 'Identity' => + $options['identity'], + 'Address' => + $options['address'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ParticipantConversationPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ParticipantConversationInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ParticipantConversationPage Page of ParticipantConversationInstance + */ + public function getPage(string $targetUrl): ParticipantConversationPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ParticipantConversationPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.ParticipantConversationList]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/ParticipantConversationOptions.php b/app/api/Twilio/Rest/Conversations/V1/ParticipantConversationOptions.php new file mode 100755 index 0000000..72820b0 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/ParticipantConversationOptions.php @@ -0,0 +1,94 @@ +options['identity'] = $identity; + $this->options['address'] = $address; + } + + /** + * A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. + * + * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. + * @return $this Fluent Builder + */ + public function setIdentity(string $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * A unique string identifier for the conversation participant who's not a Conversation User. This parameter could be found in messaging_binding.address field of Participant resource. It should be url-encoded. + * + * @param string $address A unique string identifier for the conversation participant who's not a Conversation User. This parameter could be found in messaging_binding.address field of Participant resource. It should be url-encoded. + * @return $this Fluent Builder + */ + public function setAddress(string $address): self + { + $this->options['address'] = $address; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.ReadParticipantConversationOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/ParticipantConversationPage.php b/app/api/Twilio/Rest/Conversations/V1/ParticipantConversationPage.php new file mode 100755 index 0000000..9eb96ee --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/ParticipantConversationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ParticipantConversationInstance \Twilio\Rest\Conversations\V1\ParticipantConversationInstance + */ + public function buildInstance(array $payload): ParticipantConversationInstance + { + return new ParticipantConversationInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.ParticipantConversationPage]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/RoleContext.php b/app/api/Twilio/Rest/Conversations/V1/RoleContext.php new file mode 100755 index 0000000..138c542 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/RoleContext.php @@ -0,0 +1,121 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Roles/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the RoleInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the RoleInstance + * + * @return RoleInstance Fetched RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RoleInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new RoleInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the RoleInstance + * + * @param string[] $permission A permission that you grant to the role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. Note that the update action replaces all previously assigned permissions with those defined in the update action. To remove a permission, do not include it in the subsequent update action. The values for this parameter depend on the role's `type`. + * @return RoleInstance Updated RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $permission): RoleInstance + { + + $data = Values::of([ + 'Permission' => + Serialize::map($permission,function ($e) { return $e; }), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new RoleInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.RoleContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/RoleInstance.php b/app/api/Twilio/Rest/Conversations/V1/RoleInstance.php new file mode 100755 index 0000000..a6d81e6 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/RoleInstance.php @@ -0,0 +1,157 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'type' => Values::array_get($payload, 'type'), + 'permissions' => Values::array_get($payload, 'permissions'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return RoleContext Context for this RoleInstance + */ + protected function proxy(): RoleContext + { + if (!$this->context) { + $this->context = new RoleContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the RoleInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the RoleInstance + * + * @return RoleInstance Fetched RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RoleInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the RoleInstance + * + * @param string[] $permission A permission that you grant to the role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. Note that the update action replaces all previously assigned permissions with those defined in the update action. To remove a permission, do not include it in the subsequent update action. The values for this parameter depend on the role's `type`. + * @return RoleInstance Updated RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $permission): RoleInstance + { + + return $this->proxy()->update($permission); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.RoleInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/RoleList.php b/app/api/Twilio/Rest/Conversations/V1/RoleList.php new file mode 100755 index 0000000..24d4513 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/RoleList.php @@ -0,0 +1,193 @@ +solution = [ + ]; + + $this->uri = '/Roles'; + } + + /** + * Create the RoleInstance + * + * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. + * @param string $type + * @param string[] $permission A permission that you grant to the new role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. The values for this parameter depend on the role's `type`. + * @return RoleInstance Created RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $type, array $permission): RoleInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Type' => + $type, + 'Permission' => + Serialize::map($permission,function ($e) { return $e; }), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new RoleInstance( + $this->version, + $payload + ); + } + + + /** + * Reads RoleInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return RoleInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams RoleInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of RoleInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return RolePage Page of RoleInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): RolePage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new RolePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of RoleInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return RolePage Page of RoleInstance + */ + public function getPage(string $targetUrl): RolePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new RolePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a RoleContext + * + * @param string $sid The SID of the Role resource to delete. + */ + public function getContext( + string $sid + + ): RoleContext + { + return new RoleContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.RoleList]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/RolePage.php b/app/api/Twilio/Rest/Conversations/V1/RolePage.php new file mode 100755 index 0000000..a77813f --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/RolePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RoleInstance \Twilio\Rest\Conversations\V1\RoleInstance + */ + public function buildInstance(array $payload): RoleInstance + { + return new RoleInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.RolePage]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/BindingContext.php b/app/api/Twilio/Rest/Conversations/V1/Service/BindingContext.php new file mode 100755 index 0000000..fbc3b23 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/BindingContext.php @@ -0,0 +1,100 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Bindings/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the BindingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the BindingInstance + * + * @return BindingInstance Fetched BindingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BindingInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new BindingInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.BindingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/BindingInstance.php b/app/api/Twilio/Rest/Conversations/V1/Service/BindingInstance.php new file mode 100755 index 0000000..8e9a20d --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/BindingInstance.php @@ -0,0 +1,150 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), + 'credentialSid' => Values::array_get($payload, 'credential_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'endpoint' => Values::array_get($payload, 'endpoint'), + 'identity' => Values::array_get($payload, 'identity'), + 'bindingType' => Values::array_get($payload, 'binding_type'), + 'messageTypes' => Values::array_get($payload, 'message_types'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['chatServiceSid' => $chatServiceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return BindingContext Context for this BindingInstance + */ + protected function proxy(): BindingContext + { + if (!$this->context) { + $this->context = new BindingContext( + $this->version, + $this->solution['chatServiceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the BindingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the BindingInstance + * + * @return BindingInstance Fetched BindingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BindingInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.BindingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/BindingList.php b/app/api/Twilio/Rest/Conversations/V1/Service/BindingList.php new file mode 100755 index 0000000..3e85bc8 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/BindingList.php @@ -0,0 +1,178 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Bindings'; + } + + /** + * Reads BindingInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return BindingInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams BindingInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of BindingInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return BindingPage Page of BindingInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): BindingPage + { + $options = new Values($options); + + $params = Values::of([ + 'BindingType' => + $options['bindingType'], + 'Identity' => + Serialize::map($options['identity'], function ($e) { return $e; }), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new BindingPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of BindingInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return BindingPage Page of BindingInstance + */ + public function getPage(string $targetUrl): BindingPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new BindingPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a BindingContext + * + * @param string $sid The SID of the Binding resource to delete. + */ + public function getContext( + string $sid + + ): BindingContext + { + return new BindingContext( + $this->version, + $this->solution['chatServiceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.BindingList]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/BindingOptions.php b/app/api/Twilio/Rest/Conversations/V1/Service/BindingOptions.php new file mode 100755 index 0000000..ae88aa4 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/BindingOptions.php @@ -0,0 +1,98 @@ +options['bindingType'] = $bindingType; + $this->options['identity'] = $identity; + } + + /** + * The push technology used by the Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. + * + * @param string $bindingType The push technology used by the Binding resources to read. Can be: `apn`, `gcm`, or `fcm`. See [push notification configuration](https://www.twilio.com/docs/chat/push-notification-configuration) for more info. + * @return $this Fluent Builder + */ + public function setBindingType(array $bindingType): self + { + $this->options['bindingType'] = $bindingType; + return $this; + } + + /** + * The identity of a [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource) this binding belongs to. See [access tokens](https://www.twilio.com/docs/conversations/create-tokens) for more details. + * + * @param string[] $identity The identity of a [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource) this binding belongs to. See [access tokens](https://www.twilio.com/docs/conversations/create-tokens) for more details. + * @return $this Fluent Builder + */ + public function setIdentity(array $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.ReadBindingOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/BindingPage.php b/app/api/Twilio/Rest/Conversations/V1/Service/BindingPage.php new file mode 100755 index 0000000..24193eb --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/BindingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return BindingInstance \Twilio\Rest\Conversations\V1\Service\BindingInstance + */ + public function buildInstance(array $payload): BindingInstance + { + return new BindingInstance($this->version, $payload, $this->solution['chatServiceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.BindingPage]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationContext.php b/app/api/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationContext.php new file mode 100755 index 0000000..941ce2a --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationContext.php @@ -0,0 +1,135 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Configuration/Notifications'; + } + + /** + * Fetch the NotificationInstance + * + * @return NotificationInstance Fetched NotificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): NotificationInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new NotificationInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'] + ); + } + + + /** + * Update the NotificationInstance + * + * @param array|Options $options Optional Arguments + * @return NotificationInstance Updated NotificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): NotificationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'LogEnabled' => + Serialize::booleanToString($options['logEnabled']), + 'NewMessage.Enabled' => + Serialize::booleanToString($options['newMessageEnabled']), + 'NewMessage.Template' => + $options['newMessageTemplate'], + 'NewMessage.Sound' => + $options['newMessageSound'], + 'NewMessage.BadgeCountEnabled' => + Serialize::booleanToString($options['newMessageBadgeCountEnabled']), + 'AddedToConversation.Enabled' => + Serialize::booleanToString($options['addedToConversationEnabled']), + 'AddedToConversation.Template' => + $options['addedToConversationTemplate'], + 'AddedToConversation.Sound' => + $options['addedToConversationSound'], + 'RemovedFromConversation.Enabled' => + Serialize::booleanToString($options['removedFromConversationEnabled']), + 'RemovedFromConversation.Template' => + $options['removedFromConversationTemplate'], + 'RemovedFromConversation.Sound' => + $options['removedFromConversationSound'], + 'NewMessage.WithMedia.Enabled' => + Serialize::booleanToString($options['newMessageWithMediaEnabled']), + 'NewMessage.WithMedia.Template' => + $options['newMessageWithMediaTemplate'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new NotificationInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.NotificationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationInstance.php b/app/api/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationInstance.php new file mode 100755 index 0000000..0467920 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationInstance.php @@ -0,0 +1,141 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), + 'newMessage' => Values::array_get($payload, 'new_message'), + 'addedToConversation' => Values::array_get($payload, 'added_to_conversation'), + 'removedFromConversation' => Values::array_get($payload, 'removed_from_conversation'), + 'logEnabled' => Values::array_get($payload, 'log_enabled'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['chatServiceSid' => $chatServiceSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return NotificationContext Context for this NotificationInstance + */ + protected function proxy(): NotificationContext + { + if (!$this->context) { + $this->context = new NotificationContext( + $this->version, + $this->solution['chatServiceSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the NotificationInstance + * + * @return NotificationInstance Fetched NotificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): NotificationInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the NotificationInstance + * + * @param array|Options $options Optional Arguments + * @return NotificationInstance Updated NotificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): NotificationInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.NotificationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationList.php b/app/api/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationList.php new file mode 100755 index 0000000..00e9fcf --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationList.php @@ -0,0 +1,67 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + + ]; + } + + /** + * Constructs a NotificationContext + */ + public function getContext( + + ): NotificationContext + { + return new NotificationContext( + $this->version, + $this->solution['chatServiceSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.NotificationList]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationOptions.php b/app/api/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationOptions.php new file mode 100755 index 0000000..1d8ebb1 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationOptions.php @@ -0,0 +1,294 @@ +options['logEnabled'] = $logEnabled; + $this->options['newMessageEnabled'] = $newMessageEnabled; + $this->options['newMessageTemplate'] = $newMessageTemplate; + $this->options['newMessageSound'] = $newMessageSound; + $this->options['newMessageBadgeCountEnabled'] = $newMessageBadgeCountEnabled; + $this->options['addedToConversationEnabled'] = $addedToConversationEnabled; + $this->options['addedToConversationTemplate'] = $addedToConversationTemplate; + $this->options['addedToConversationSound'] = $addedToConversationSound; + $this->options['removedFromConversationEnabled'] = $removedFromConversationEnabled; + $this->options['removedFromConversationTemplate'] = $removedFromConversationTemplate; + $this->options['removedFromConversationSound'] = $removedFromConversationSound; + $this->options['newMessageWithMediaEnabled'] = $newMessageWithMediaEnabled; + $this->options['newMessageWithMediaTemplate'] = $newMessageWithMediaTemplate; + } + + /** + * Weather the notification logging is enabled. + * + * @param bool $logEnabled Weather the notification logging is enabled. + * @return $this Fluent Builder + */ + public function setLogEnabled(bool $logEnabled): self + { + $this->options['logEnabled'] = $logEnabled; + return $this; + } + + /** + * Whether to send a notification when a new message is added to a conversation. The default is `false`. + * + * @param bool $newMessageEnabled Whether to send a notification when a new message is added to a conversation. The default is `false`. + * @return $this Fluent Builder + */ + public function setNewMessageEnabled(bool $newMessageEnabled): self + { + $this->options['newMessageEnabled'] = $newMessageEnabled; + return $this; + } + + /** + * The template to use to create the notification text displayed when a new message is added to a conversation and `new_message.enabled` is `true`. + * + * @param string $newMessageTemplate The template to use to create the notification text displayed when a new message is added to a conversation and `new_message.enabled` is `true`. + * @return $this Fluent Builder + */ + public function setNewMessageTemplate(string $newMessageTemplate): self + { + $this->options['newMessageTemplate'] = $newMessageTemplate; + return $this; + } + + /** + * The name of the sound to play when a new message is added to a conversation and `new_message.enabled` is `true`. + * + * @param string $newMessageSound The name of the sound to play when a new message is added to a conversation and `new_message.enabled` is `true`. + * @return $this Fluent Builder + */ + public function setNewMessageSound(string $newMessageSound): self + { + $this->options['newMessageSound'] = $newMessageSound; + return $this; + } + + /** + * Whether the new message badge is enabled. The default is `false`. + * + * @param bool $newMessageBadgeCountEnabled Whether the new message badge is enabled. The default is `false`. + * @return $this Fluent Builder + */ + public function setNewMessageBadgeCountEnabled(bool $newMessageBadgeCountEnabled): self + { + $this->options['newMessageBadgeCountEnabled'] = $newMessageBadgeCountEnabled; + return $this; + } + + /** + * Whether to send a notification when a participant is added to a conversation. The default is `false`. + * + * @param bool $addedToConversationEnabled Whether to send a notification when a participant is added to a conversation. The default is `false`. + * @return $this Fluent Builder + */ + public function setAddedToConversationEnabled(bool $addedToConversationEnabled): self + { + $this->options['addedToConversationEnabled'] = $addedToConversationEnabled; + return $this; + } + + /** + * The template to use to create the notification text displayed when a participant is added to a conversation and `added_to_conversation.enabled` is `true`. + * + * @param string $addedToConversationTemplate The template to use to create the notification text displayed when a participant is added to a conversation and `added_to_conversation.enabled` is `true`. + * @return $this Fluent Builder + */ + public function setAddedToConversationTemplate(string $addedToConversationTemplate): self + { + $this->options['addedToConversationTemplate'] = $addedToConversationTemplate; + return $this; + } + + /** + * The name of the sound to play when a participant is added to a conversation and `added_to_conversation.enabled` is `true`. + * + * @param string $addedToConversationSound The name of the sound to play when a participant is added to a conversation and `added_to_conversation.enabled` is `true`. + * @return $this Fluent Builder + */ + public function setAddedToConversationSound(string $addedToConversationSound): self + { + $this->options['addedToConversationSound'] = $addedToConversationSound; + return $this; + } + + /** + * Whether to send a notification to a user when they are removed from a conversation. The default is `false`. + * + * @param bool $removedFromConversationEnabled Whether to send a notification to a user when they are removed from a conversation. The default is `false`. + * @return $this Fluent Builder + */ + public function setRemovedFromConversationEnabled(bool $removedFromConversationEnabled): self + { + $this->options['removedFromConversationEnabled'] = $removedFromConversationEnabled; + return $this; + } + + /** + * The template to use to create the notification text displayed to a user when they are removed from a conversation and `removed_from_conversation.enabled` is `true`. + * + * @param string $removedFromConversationTemplate The template to use to create the notification text displayed to a user when they are removed from a conversation and `removed_from_conversation.enabled` is `true`. + * @return $this Fluent Builder + */ + public function setRemovedFromConversationTemplate(string $removedFromConversationTemplate): self + { + $this->options['removedFromConversationTemplate'] = $removedFromConversationTemplate; + return $this; + } + + /** + * The name of the sound to play to a user when they are removed from a conversation and `removed_from_conversation.enabled` is `true`. + * + * @param string $removedFromConversationSound The name of the sound to play to a user when they are removed from a conversation and `removed_from_conversation.enabled` is `true`. + * @return $this Fluent Builder + */ + public function setRemovedFromConversationSound(string $removedFromConversationSound): self + { + $this->options['removedFromConversationSound'] = $removedFromConversationSound; + return $this; + } + + /** + * Whether to send a notification when a new message with media/file attachments is added to a conversation. The default is `false`. + * + * @param bool $newMessageWithMediaEnabled Whether to send a notification when a new message with media/file attachments is added to a conversation. The default is `false`. + * @return $this Fluent Builder + */ + public function setNewMessageWithMediaEnabled(bool $newMessageWithMediaEnabled): self + { + $this->options['newMessageWithMediaEnabled'] = $newMessageWithMediaEnabled; + return $this; + } + + /** + * The template to use to create the notification text displayed when a new message with media/file attachments is added to a conversation and `new_message.attachments.enabled` is `true`. + * + * @param string $newMessageWithMediaTemplate The template to use to create the notification text displayed when a new message with media/file attachments is added to a conversation and `new_message.attachments.enabled` is `true`. + * @return $this Fluent Builder + */ + public function setNewMessageWithMediaTemplate(string $newMessageWithMediaTemplate): self + { + $this->options['newMessageWithMediaTemplate'] = $newMessageWithMediaTemplate; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.UpdateNotificationOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationPage.php b/app/api/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationPage.php new file mode 100755 index 0000000..031ac82 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/Configuration/NotificationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return NotificationInstance \Twilio\Rest\Conversations\V1\Service\Configuration\NotificationInstance + */ + public function buildInstance(array $payload): NotificationInstance + { + return new NotificationInstance($this->version, $payload, $this->solution['chatServiceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.NotificationPage]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookContext.php b/app/api/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookContext.php new file mode 100755 index 0000000..e95bcf2 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookContext.php @@ -0,0 +1,117 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Configuration/Webhooks'; + } + + /** + * Fetch the WebhookInstance + * + * @return WebhookInstance Fetched WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WebhookInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new WebhookInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'] + ); + } + + + /** + * Update the WebhookInstance + * + * @param array|Options $options Optional Arguments + * @return WebhookInstance Updated WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WebhookInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'PreWebhookUrl' => + $options['preWebhookUrl'], + 'PostWebhookUrl' => + $options['postWebhookUrl'], + 'Filters' => + Serialize::map($options['filters'], function ($e) { return $e; }), + 'Method' => + $options['method'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new WebhookInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.WebhookContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookInstance.php b/app/api/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookInstance.php new file mode 100755 index 0000000..ed316bf --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookInstance.php @@ -0,0 +1,141 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), + 'preWebhookUrl' => Values::array_get($payload, 'pre_webhook_url'), + 'postWebhookUrl' => Values::array_get($payload, 'post_webhook_url'), + 'filters' => Values::array_get($payload, 'filters'), + 'method' => Values::array_get($payload, 'method'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['chatServiceSid' => $chatServiceSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return WebhookContext Context for this WebhookInstance + */ + protected function proxy(): WebhookContext + { + if (!$this->context) { + $this->context = new WebhookContext( + $this->version, + $this->solution['chatServiceSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the WebhookInstance + * + * @return WebhookInstance Fetched WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WebhookInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the WebhookInstance + * + * @param array|Options $options Optional Arguments + * @return WebhookInstance Updated WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WebhookInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.WebhookInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookList.php b/app/api/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookList.php new file mode 100755 index 0000000..8fb622a --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookList.php @@ -0,0 +1,67 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + + ]; + } + + /** + * Constructs a WebhookContext + */ + public function getContext( + + ): WebhookContext + { + return new WebhookContext( + $this->version, + $this->solution['chatServiceSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.WebhookList]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookOptions.php b/app/api/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookOptions.php new file mode 100755 index 0000000..3933b3c --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookOptions.php @@ -0,0 +1,132 @@ +options['preWebhookUrl'] = $preWebhookUrl; + $this->options['postWebhookUrl'] = $postWebhookUrl; + $this->options['filters'] = $filters; + $this->options['method'] = $method; + } + + /** + * The absolute url the pre-event webhook request should be sent to. + * + * @param string $preWebhookUrl The absolute url the pre-event webhook request should be sent to. + * @return $this Fluent Builder + */ + public function setPreWebhookUrl(string $preWebhookUrl): self + { + $this->options['preWebhookUrl'] = $preWebhookUrl; + return $this; + } + + /** + * The absolute url the post-event webhook request should be sent to. + * + * @param string $postWebhookUrl The absolute url the post-event webhook request should be sent to. + * @return $this Fluent Builder + */ + public function setPostWebhookUrl(string $postWebhookUrl): self + { + $this->options['postWebhookUrl'] = $postWebhookUrl; + return $this; + } + + /** + * The list of events that your configured webhook targets will receive. Events not configured here will not fire. Possible values are `onParticipantAdd`, `onParticipantAdded`, `onDeliveryUpdated`, `onConversationUpdated`, `onConversationRemove`, `onParticipantRemove`, `onConversationUpdate`, `onMessageAdd`, `onMessageRemoved`, `onParticipantUpdated`, `onConversationAdded`, `onMessageAdded`, `onConversationAdd`, `onConversationRemoved`, `onParticipantUpdate`, `onMessageRemove`, `onMessageUpdated`, `onParticipantRemoved`, `onMessageUpdate` or `onConversationStateUpdated`. + * + * @param string[] $filters The list of events that your configured webhook targets will receive. Events not configured here will not fire. Possible values are `onParticipantAdd`, `onParticipantAdded`, `onDeliveryUpdated`, `onConversationUpdated`, `onConversationRemove`, `onParticipantRemove`, `onConversationUpdate`, `onMessageAdd`, `onMessageRemoved`, `onParticipantUpdated`, `onConversationAdded`, `onMessageAdded`, `onConversationAdd`, `onConversationRemoved`, `onParticipantUpdate`, `onMessageRemove`, `onMessageUpdated`, `onParticipantRemoved`, `onMessageUpdate` or `onConversationStateUpdated`. + * @return $this Fluent Builder + */ + public function setFilters(array $filters): self + { + $this->options['filters'] = $filters; + return $this; + } + + /** + * The HTTP method to be used when sending a webhook request. One of `GET` or `POST`. + * + * @param string $method The HTTP method to be used when sending a webhook request. One of `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setMethod(string $method): self + { + $this->options['method'] = $method; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.UpdateWebhookOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookPage.php b/app/api/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookPage.php new file mode 100755 index 0000000..6a60ce3 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/Configuration/WebhookPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WebhookInstance \Twilio\Rest\Conversations\V1\Service\Configuration\WebhookInstance + */ + public function buildInstance(array $payload): WebhookInstance + { + return new WebhookInstance($this->version, $payload, $this->solution['chatServiceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.WebhookPage]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/ConfigurationContext.php b/app/api/Twilio/Rest/Conversations/V1/Service/ConfigurationContext.php new file mode 100755 index 0000000..171a35a --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/ConfigurationContext.php @@ -0,0 +1,117 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Configuration'; + } + + /** + * Fetch the ConfigurationInstance + * + * @return ConfigurationInstance Fetched ConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ConfigurationInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ConfigurationInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'] + ); + } + + + /** + * Update the ConfigurationInstance + * + * @param array|Options $options Optional Arguments + * @return ConfigurationInstance Updated ConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ConfigurationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'DefaultConversationCreatorRoleSid' => + $options['defaultConversationCreatorRoleSid'], + 'DefaultConversationRoleSid' => + $options['defaultConversationRoleSid'], + 'DefaultChatServiceRoleSid' => + $options['defaultChatServiceRoleSid'], + 'ReachabilityEnabled' => + Serialize::booleanToString($options['reachabilityEnabled']), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new ConfigurationInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.ConfigurationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/ConfigurationInstance.php b/app/api/Twilio/Rest/Conversations/V1/Service/ConfigurationInstance.php new file mode 100755 index 0000000..e548d45 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/ConfigurationInstance.php @@ -0,0 +1,141 @@ +properties = [ + 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), + 'defaultConversationCreatorRoleSid' => Values::array_get($payload, 'default_conversation_creator_role_sid'), + 'defaultConversationRoleSid' => Values::array_get($payload, 'default_conversation_role_sid'), + 'defaultChatServiceRoleSid' => Values::array_get($payload, 'default_chat_service_role_sid'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + 'reachabilityEnabled' => Values::array_get($payload, 'reachability_enabled'), + ]; + + $this->solution = ['chatServiceSid' => $chatServiceSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ConfigurationContext Context for this ConfigurationInstance + */ + protected function proxy(): ConfigurationContext + { + if (!$this->context) { + $this->context = new ConfigurationContext( + $this->version, + $this->solution['chatServiceSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the ConfigurationInstance + * + * @return ConfigurationInstance Fetched ConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ConfigurationInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ConfigurationInstance + * + * @param array|Options $options Optional Arguments + * @return ConfigurationInstance Updated ConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ConfigurationInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.ConfigurationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/ConfigurationList.php b/app/api/Twilio/Rest/Conversations/V1/Service/ConfigurationList.php new file mode 100755 index 0000000..45063ca --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/ConfigurationList.php @@ -0,0 +1,143 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + + ]; + } + + /** + * Constructs a ConfigurationContext + */ + public function getContext( + + ): ConfigurationContext + { + return new ConfigurationContext( + $this->version, + $this->solution['chatServiceSid'] + ); + } + + /** + * Access the notifications + */ + protected function getNotifications(): NotificationList + { + if (!$this->_notifications) { + $this->_notifications = new NotificationList( + $this->version, + $this->solution['chatServiceSid'] + ); + } + return $this->_notifications; + } + + /** + * Access the webhooks + */ + protected function getWebhooks(): WebhookList + { + if (!$this->_webhooks) { + $this->_webhooks = new WebhookList( + $this->version, + $this->solution['chatServiceSid'] + ); + } + return $this->_webhooks; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name) + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.ConfigurationList]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/ConfigurationOptions.php b/app/api/Twilio/Rest/Conversations/V1/Service/ConfigurationOptions.php new file mode 100755 index 0000000..ef3986b --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/ConfigurationOptions.php @@ -0,0 +1,132 @@ +options['defaultConversationCreatorRoleSid'] = $defaultConversationCreatorRoleSid; + $this->options['defaultConversationRoleSid'] = $defaultConversationRoleSid; + $this->options['defaultChatServiceRoleSid'] = $defaultChatServiceRoleSid; + $this->options['reachabilityEnabled'] = $reachabilityEnabled; + } + + /** + * The conversation-level role assigned to a conversation creator when they join a new conversation. See the [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. + * + * @param string $defaultConversationCreatorRoleSid The conversation-level role assigned to a conversation creator when they join a new conversation. See the [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. + * @return $this Fluent Builder + */ + public function setDefaultConversationCreatorRoleSid(string $defaultConversationCreatorRoleSid): self + { + $this->options['defaultConversationCreatorRoleSid'] = $defaultConversationCreatorRoleSid; + return $this; + } + + /** + * The conversation-level role assigned to users when they are added to a conversation. See the [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. + * + * @param string $defaultConversationRoleSid The conversation-level role assigned to users when they are added to a conversation. See the [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. + * @return $this Fluent Builder + */ + public function setDefaultConversationRoleSid(string $defaultConversationRoleSid): self + { + $this->options['defaultConversationRoleSid'] = $defaultConversationRoleSid; + return $this; + } + + /** + * The service-level role assigned to users when they are added to the service. See the [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. + * + * @param string $defaultChatServiceRoleSid The service-level role assigned to users when they are added to the service. See the [Conversation Role](https://www.twilio.com/docs/conversations/api/role-resource) for more info about roles. + * @return $this Fluent Builder + */ + public function setDefaultChatServiceRoleSid(string $defaultChatServiceRoleSid): self + { + $this->options['defaultChatServiceRoleSid'] = $defaultChatServiceRoleSid; + return $this; + } + + /** + * Whether the [Reachability Indicator](https://www.twilio.com/docs/chat/reachability-indicator) is enabled for this Conversations Service. The default is `false`. + * + * @param bool $reachabilityEnabled Whether the [Reachability Indicator](https://www.twilio.com/docs/chat/reachability-indicator) is enabled for this Conversations Service. The default is `false`. + * @return $this Fluent Builder + */ + public function setReachabilityEnabled(bool $reachabilityEnabled): self + { + $this->options['reachabilityEnabled'] = $reachabilityEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.UpdateConfigurationOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/ConfigurationPage.php b/app/api/Twilio/Rest/Conversations/V1/Service/ConfigurationPage.php new file mode 100755 index 0000000..bb7f2f0 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/ConfigurationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ConfigurationInstance \Twilio\Rest\Conversations\V1\Service\ConfigurationInstance + */ + public function buildInstance(array $payload): ConfigurationInstance + { + return new ConfigurationInstance($this->version, $payload, $this->solution['chatServiceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.ConfigurationPage]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptContext.php b/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptContext.php new file mode 100755 index 0000000..e647a35 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptContext.php @@ -0,0 +1,99 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + 'conversationSid' => + $conversationSid, + 'messageSid' => + $messageSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Conversations/' . \rawurlencode($conversationSid) + .'/Messages/' . \rawurlencode($messageSid) + .'/Receipts/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the DeliveryReceiptInstance + * + * @return DeliveryReceiptInstance Fetched DeliveryReceiptInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DeliveryReceiptInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new DeliveryReceiptInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'], + $this->solution['conversationSid'], + $this->solution['messageSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.DeliveryReceiptContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptInstance.php b/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptInstance.php new file mode 100755 index 0000000..67c779b --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptInstance.php @@ -0,0 +1,144 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), + 'conversationSid' => Values::array_get($payload, 'conversation_sid'), + 'messageSid' => Values::array_get($payload, 'message_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'channelMessageSid' => Values::array_get($payload, 'channel_message_sid'), + 'participantSid' => Values::array_get($payload, 'participant_sid'), + 'status' => Values::array_get($payload, 'status'), + 'errorCode' => Values::array_get($payload, 'error_code'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['chatServiceSid' => $chatServiceSid, 'conversationSid' => $conversationSid, 'messageSid' => $messageSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return DeliveryReceiptContext Context for this DeliveryReceiptInstance + */ + protected function proxy(): DeliveryReceiptContext + { + if (!$this->context) { + $this->context = new DeliveryReceiptContext( + $this->version, + $this->solution['chatServiceSid'], + $this->solution['conversationSid'], + $this->solution['messageSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the DeliveryReceiptInstance + * + * @return DeliveryReceiptInstance Fetched DeliveryReceiptInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DeliveryReceiptInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.DeliveryReceiptInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptList.php b/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptList.php new file mode 100755 index 0000000..cfe20fc --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptList.php @@ -0,0 +1,182 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + + 'conversationSid' => + $conversationSid, + + 'messageSid' => + $messageSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Conversations/' . \rawurlencode($conversationSid) + .'/Messages/' . \rawurlencode($messageSid) + .'/Receipts'; + } + + /** + * Reads DeliveryReceiptInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return DeliveryReceiptInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams DeliveryReceiptInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of DeliveryReceiptInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return DeliveryReceiptPage Page of DeliveryReceiptInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): DeliveryReceiptPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new DeliveryReceiptPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of DeliveryReceiptInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return DeliveryReceiptPage Page of DeliveryReceiptInstance + */ + public function getPage(string $targetUrl): DeliveryReceiptPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new DeliveryReceiptPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a DeliveryReceiptContext + * + * @param string $sid A 34 character string that uniquely identifies this resource. + */ + public function getContext( + string $sid + + ): DeliveryReceiptContext + { + return new DeliveryReceiptContext( + $this->version, + $this->solution['chatServiceSid'], + $this->solution['conversationSid'], + $this->solution['messageSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.DeliveryReceiptList]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptPage.php b/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptPage.php new file mode 100755 index 0000000..de25204 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/Message/DeliveryReceiptPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DeliveryReceiptInstance \Twilio\Rest\Conversations\V1\Service\Conversation\Message\DeliveryReceiptInstance + */ + public function buildInstance(array $payload): DeliveryReceiptInstance + { + return new DeliveryReceiptInstance($this->version, $payload, $this->solution['chatServiceSid'], $this->solution['conversationSid'], $this->solution['messageSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.DeliveryReceiptPage]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/MessageContext.php b/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/MessageContext.php new file mode 100755 index 0000000..d416ff9 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/MessageContext.php @@ -0,0 +1,213 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + 'conversationSid' => + $conversationSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Conversations/' . \rawurlencode($conversationSid) + .'/Messages/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the MessageInstance + * + * @return MessageInstance Fetched MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MessageInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new MessageInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'], + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return MessageInstance Updated MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MessageInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Author' => + $options['author'], + 'Body' => + $options['body'], + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'Attributes' => + $options['attributes'], + ]); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new MessageInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'], + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the deliveryReceipts + */ + protected function getDeliveryReceipts(): DeliveryReceiptList + { + if (!$this->_deliveryReceipts) { + $this->_deliveryReceipts = new DeliveryReceiptList( + $this->version, + $this->solution['chatServiceSid'], + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + return $this->_deliveryReceipts; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.MessageContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/MessageInstance.php b/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/MessageInstance.php new file mode 100755 index 0000000..650110e --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/MessageInstance.php @@ -0,0 +1,188 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), + 'conversationSid' => Values::array_get($payload, 'conversation_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'index' => Values::array_get($payload, 'index'), + 'author' => Values::array_get($payload, 'author'), + 'body' => Values::array_get($payload, 'body'), + 'media' => Values::array_get($payload, 'media'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'participantSid' => Values::array_get($payload, 'participant_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'delivery' => Values::array_get($payload, 'delivery'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + 'contentSid' => Values::array_get($payload, 'content_sid'), + ]; + + $this->solution = ['chatServiceSid' => $chatServiceSid, 'conversationSid' => $conversationSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return MessageContext Context for this MessageInstance + */ + protected function proxy(): MessageContext + { + if (!$this->context) { + $this->context = new MessageContext( + $this->version, + $this->solution['chatServiceSid'], + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the MessageInstance + * + * @return MessageInstance Fetched MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MessageInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return MessageInstance Updated MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MessageInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the deliveryReceipts + */ + protected function getDeliveryReceipts(): DeliveryReceiptList + { + return $this->proxy()->deliveryReceipts; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.MessageInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/MessageList.php b/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/MessageList.php new file mode 100755 index 0000000..df2e9c5 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/MessageList.php @@ -0,0 +1,228 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + + 'conversationSid' => + $conversationSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Conversations/' . \rawurlencode($conversationSid) + .'/Messages'; + } + + /** + * Create the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return MessageInstance Created MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): MessageInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Author' => + $options['author'], + 'Body' => + $options['body'], + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'Attributes' => + $options['attributes'], + 'MediaSid' => + $options['mediaSid'], + 'ContentSid' => + $options['contentSid'], + 'ContentVariables' => + $options['contentVariables'], + ]); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new MessageInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'], + $this->solution['conversationSid'] + ); + } + + + /** + * Reads MessageInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return MessageInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams MessageInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of MessageInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return MessagePage Page of MessageInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MessagePage + { + $options = new Values($options); + + $params = Values::of([ + 'Order' => + $options['order'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new MessagePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of MessageInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return MessagePage Page of MessageInstance + */ + public function getPage(string $targetUrl): MessagePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new MessagePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a MessageContext + * + * @param string $sid A 34 character string that uniquely identifies this resource. + */ + public function getContext( + string $sid + + ): MessageContext + { + return new MessageContext( + $this->version, + $this->solution['chatServiceSid'], + $this->solution['conversationSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.MessageList]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/MessageOptions.php b/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/MessageOptions.php new file mode 100755 index 0000000..6e12a1e --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/MessageOptions.php @@ -0,0 +1,468 @@ +options['author'] = $author; + $this->options['body'] = $body; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['attributes'] = $attributes; + $this->options['mediaSid'] = $mediaSid; + $this->options['contentSid'] = $contentSid; + $this->options['contentVariables'] = $contentVariables; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The channel specific identifier of the message's author. Defaults to `system`. + * + * @param string $author The channel specific identifier of the message's author. Defaults to `system`. + * @return $this Fluent Builder + */ + public function setAuthor(string $author): self + { + $this->options['author'] = $author; + return $this; + } + + /** + * The content of the message, can be up to 1,600 characters long. + * + * @param string $body The content of the message, can be up to 1,600 characters long. + * @return $this Fluent Builder + */ + public function setBody(string $body): self + { + $this->options['body'] = $body; + return $this; + } + + /** + * The date that this resource was created. + * + * @param \DateTime $dateCreated The date that this resource was created. + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The date that this resource was last updated. `null` if the message has not been edited. + * + * @param \DateTime $dateUpdated The date that this resource was last updated. `null` if the message has not been edited. + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * + * @param string $attributes A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The Media SID to be attached to the new Message. + * + * @param string $mediaSid The Media SID to be attached to the new Message. + * @return $this Fluent Builder + */ + public function setMediaSid(string $mediaSid): self + { + $this->options['mediaSid'] = $mediaSid; + return $this; + } + + /** + * The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content-api) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. + * + * @param string $contentSid The unique ID of the multi-channel [Rich Content](https://www.twilio.com/docs/content-api) template, required for template-generated messages. **Note** that if this field is set, `Body` and `MediaSid` parameters are ignored. + * @return $this Fluent Builder + */ + public function setContentSid(string $contentSid): self + { + $this->options['contentSid'] = $contentSid; + return $this; + } + + /** + * A structurally valid JSON string that contains values to resolve Rich Content template variables. + * + * @param string $contentVariables A structurally valid JSON string that contains values to resolve Rich Content template variables. + * @return $this Fluent Builder + */ + public function setContentVariables(string $contentVariables): self + { + $this->options['contentVariables'] = $contentVariables; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.CreateMessageOptions ' . $options . ']'; + } +} + +class DeleteMessageOptions extends Options + { + /** + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.DeleteMessageOptions ' . $options . ']'; + } +} + + +class ReadMessageOptions extends Options + { + /** + * @param string $order The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending), with `asc` as the default. + */ + public function __construct( + + string $order = Values::NONE + + ) { + $this->options['order'] = $order; + } + + /** + * The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending), with `asc` as the default. + * + * @param string $order The sort order of the returned messages. Can be: `asc` (ascending) or `desc` (descending), with `asc` as the default. + * @return $this Fluent Builder + */ + public function setOrder(string $order): self + { + $this->options['order'] = $order; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.ReadMessageOptions ' . $options . ']'; + } +} + +class UpdateMessageOptions extends Options + { + /** + * @param string $author The channel specific identifier of the message's author. Defaults to `system`. + * @param string $body The content of the message, can be up to 1,600 characters long. + * @param \DateTime $dateCreated The date that this resource was created. + * @param \DateTime $dateUpdated The date that this resource was last updated. `null` if the message has not been edited. + * @param string $attributes A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $author = Values::NONE, + string $body = Values::NONE, + \DateTime $dateCreated = null, + \DateTime $dateUpdated = null, + string $attributes = Values::NONE, + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['author'] = $author; + $this->options['body'] = $body; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['attributes'] = $attributes; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The channel specific identifier of the message's author. Defaults to `system`. + * + * @param string $author The channel specific identifier of the message's author. Defaults to `system`. + * @return $this Fluent Builder + */ + public function setAuthor(string $author): self + { + $this->options['author'] = $author; + return $this; + } + + /** + * The content of the message, can be up to 1,600 characters long. + * + * @param string $body The content of the message, can be up to 1,600 characters long. + * @return $this Fluent Builder + */ + public function setBody(string $body): self + { + $this->options['body'] = $body; + return $this; + } + + /** + * The date that this resource was created. + * + * @param \DateTime $dateCreated The date that this resource was created. + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The date that this resource was last updated. `null` if the message has not been edited. + * + * @param \DateTime $dateUpdated The date that this resource was last updated. `null` if the message has not been edited. + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * + * @param string $attributes A string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.UpdateMessageOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/MessagePage.php b/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/MessagePage.php new file mode 100755 index 0000000..d123fc0 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/MessagePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MessageInstance \Twilio\Rest\Conversations\V1\Service\Conversation\MessageInstance + */ + public function buildInstance(array $payload): MessageInstance + { + return new MessageInstance($this->version, $payload, $this->solution['chatServiceSid'], $this->solution['conversationSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.MessagePage]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantContext.php b/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantContext.php new file mode 100755 index 0000000..16abb8c --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantContext.php @@ -0,0 +1,161 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + 'conversationSid' => + $conversationSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Conversations/' . \rawurlencode($conversationSid) + .'/Participants/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ParticipantInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ParticipantInstance + * + * @return ParticipantInstance Fetched ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ParticipantInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ParticipantInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'], + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ParticipantInstance + * + * @param array|Options $options Optional Arguments + * @return ParticipantInstance Updated ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ParticipantInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'Identity' => + $options['identity'], + 'Attributes' => + $options['attributes'], + 'RoleSid' => + $options['roleSid'], + 'MessagingBinding.ProxyAddress' => + $options['messagingBindingProxyAddress'], + 'MessagingBinding.ProjectedAddress' => + $options['messagingBindingProjectedAddress'], + 'LastReadMessageIndex' => + $options['lastReadMessageIndex'], + 'LastReadTimestamp' => + $options['lastReadTimestamp'], + ]); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ParticipantInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'], + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.ParticipantContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantInstance.php b/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantInstance.php new file mode 100755 index 0000000..2286f6e --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantInstance.php @@ -0,0 +1,171 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), + 'conversationSid' => Values::array_get($payload, 'conversation_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'messagingBinding' => Values::array_get($payload, 'messaging_binding'), + 'roleSid' => Values::array_get($payload, 'role_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'lastReadMessageIndex' => Values::array_get($payload, 'last_read_message_index'), + 'lastReadTimestamp' => Values::array_get($payload, 'last_read_timestamp'), + ]; + + $this->solution = ['chatServiceSid' => $chatServiceSid, 'conversationSid' => $conversationSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ParticipantContext Context for this ParticipantInstance + */ + protected function proxy(): ParticipantContext + { + if (!$this->context) { + $this->context = new ParticipantContext( + $this->version, + $this->solution['chatServiceSid'], + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ParticipantInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the ParticipantInstance + * + * @return ParticipantInstance Fetched ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ParticipantInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ParticipantInstance + * + * @param array|Options $options Optional Arguments + * @return ParticipantInstance Updated ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ParticipantInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.ParticipantInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantList.php b/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantList.php new file mode 100755 index 0000000..88e221c --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantList.php @@ -0,0 +1,222 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + + 'conversationSid' => + $conversationSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Conversations/' . \rawurlencode($conversationSid) + .'/Participants'; + } + + /** + * Create the ParticipantInstance + * + * @param array|Options $options Optional Arguments + * @return ParticipantInstance Created ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): ParticipantInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Identity' => + $options['identity'], + 'MessagingBinding.Address' => + $options['messagingBindingAddress'], + 'MessagingBinding.ProxyAddress' => + $options['messagingBindingProxyAddress'], + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'Attributes' => + $options['attributes'], + 'MessagingBinding.ProjectedAddress' => + $options['messagingBindingProjectedAddress'], + 'RoleSid' => + $options['roleSid'], + ]); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ParticipantInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'], + $this->solution['conversationSid'] + ); + } + + + /** + * Reads ParticipantInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ParticipantInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ParticipantInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ParticipantInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ParticipantPage Page of ParticipantInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ParticipantPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ParticipantPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ParticipantInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ParticipantPage Page of ParticipantInstance + */ + public function getPage(string $targetUrl): ParticipantPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ParticipantPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ParticipantContext + * + * @param string $sid A 34 character string that uniquely identifies this resource. + */ + public function getContext( + string $sid + + ): ParticipantContext + { + return new ParticipantContext( + $this->version, + $this->solution['chatServiceSid'], + $this->solution['conversationSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.ParticipantList]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantOptions.php b/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantOptions.php new file mode 100755 index 0000000..9c77a27 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantOptions.php @@ -0,0 +1,490 @@ +options['identity'] = $identity; + $this->options['messagingBindingAddress'] = $messagingBindingAddress; + $this->options['messagingBindingProxyAddress'] = $messagingBindingProxyAddress; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['attributes'] = $attributes; + $this->options['messagingBindingProjectedAddress'] = $messagingBindingProjectedAddress; + $this->options['roleSid'] = $roleSid; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversation SDK to communicate. Limited to 256 characters. + * + * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversation SDK to communicate. Limited to 256 characters. + * @return $this Fluent Builder + */ + public function setIdentity(string $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * The address of the participant's device, e.g. a phone or WhatsApp number. Together with the Proxy address, this determines a participant uniquely. This field (with proxy_address) is only null when the participant is interacting from an SDK endpoint (see the 'identity' field). + * + * @param string $messagingBindingAddress The address of the participant's device, e.g. a phone or WhatsApp number. Together with the Proxy address, this determines a participant uniquely. This field (with proxy_address) is only null when the participant is interacting from an SDK endpoint (see the 'identity' field). + * @return $this Fluent Builder + */ + public function setMessagingBindingAddress(string $messagingBindingAddress): self + { + $this->options['messagingBindingAddress'] = $messagingBindingAddress; + return $this; + } + + /** + * The address of the Twilio phone number (or WhatsApp number) that the participant is in contact with. This field, together with participant address, is only null when the participant is interacting from an SDK endpoint (see the 'identity' field). + * + * @param string $messagingBindingProxyAddress The address of the Twilio phone number (or WhatsApp number) that the participant is in contact with. This field, together with participant address, is only null when the participant is interacting from an SDK endpoint (see the 'identity' field). + * @return $this Fluent Builder + */ + public function setMessagingBindingProxyAddress(string $messagingBindingProxyAddress): self + { + $this->options['messagingBindingProxyAddress'] = $messagingBindingProxyAddress; + return $this; + } + + /** + * The date that this resource was created. + * + * @param \DateTime $dateCreated The date that this resource was created. + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The date that this resource was last updated. + * + * @param \DateTime $dateUpdated The date that this resource was last updated. + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * + * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The address of the Twilio phone number that is used in Group MMS. Communication mask for the Conversation participant with Identity. + * + * @param string $messagingBindingProjectedAddress The address of the Twilio phone number that is used in Group MMS. Communication mask for the Conversation participant with Identity. + * @return $this Fluent Builder + */ + public function setMessagingBindingProjectedAddress(string $messagingBindingProjectedAddress): self + { + $this->options['messagingBindingProjectedAddress'] = $messagingBindingProjectedAddress; + return $this; + } + + /** + * The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. + * + * @param string $roleSid The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.CreateParticipantOptions ' . $options . ']'; + } +} + +class DeleteParticipantOptions extends Options + { + /** + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.DeleteParticipantOptions ' . $options . ']'; + } +} + + + +class UpdateParticipantOptions extends Options + { + /** + * @param \DateTime $dateCreated The date that this resource was created. + * @param \DateTime $dateUpdated The date that this resource was last updated. + * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversation SDK to communicate. Limited to 256 characters. + * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * @param string $roleSid The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. + * @param string $messagingBindingProxyAddress The address of the Twilio phone number that the participant is in contact with. 'null' value will remove it. + * @param string $messagingBindingProjectedAddress The address of the Twilio phone number that is used in Group MMS. 'null' value will remove it. + * @param int $lastReadMessageIndex Index of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. + * @param string $lastReadTimestamp Timestamp of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + \DateTime $dateCreated = null, + \DateTime $dateUpdated = null, + string $identity = Values::NONE, + string $attributes = Values::NONE, + string $roleSid = Values::NONE, + string $messagingBindingProxyAddress = Values::NONE, + string $messagingBindingProjectedAddress = Values::NONE, + int $lastReadMessageIndex = Values::INT_NONE, + string $lastReadTimestamp = Values::NONE, + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['identity'] = $identity; + $this->options['attributes'] = $attributes; + $this->options['roleSid'] = $roleSid; + $this->options['messagingBindingProxyAddress'] = $messagingBindingProxyAddress; + $this->options['messagingBindingProjectedAddress'] = $messagingBindingProjectedAddress; + $this->options['lastReadMessageIndex'] = $lastReadMessageIndex; + $this->options['lastReadTimestamp'] = $lastReadTimestamp; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The date that this resource was created. + * + * @param \DateTime $dateCreated The date that this resource was created. + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The date that this resource was last updated. + * + * @param \DateTime $dateUpdated The date that this resource was last updated. + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversation SDK to communicate. Limited to 256 characters. + * + * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversation SDK to communicate. Limited to 256 characters. + * @return $this Fluent Builder + */ + public function setIdentity(string $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * + * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. + * + * @param string $roleSid The SID of a conversation-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the participant. + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * The address of the Twilio phone number that the participant is in contact with. 'null' value will remove it. + * + * @param string $messagingBindingProxyAddress The address of the Twilio phone number that the participant is in contact with. 'null' value will remove it. + * @return $this Fluent Builder + */ + public function setMessagingBindingProxyAddress(string $messagingBindingProxyAddress): self + { + $this->options['messagingBindingProxyAddress'] = $messagingBindingProxyAddress; + return $this; + } + + /** + * The address of the Twilio phone number that is used in Group MMS. 'null' value will remove it. + * + * @param string $messagingBindingProjectedAddress The address of the Twilio phone number that is used in Group MMS. 'null' value will remove it. + * @return $this Fluent Builder + */ + public function setMessagingBindingProjectedAddress(string $messagingBindingProjectedAddress): self + { + $this->options['messagingBindingProjectedAddress'] = $messagingBindingProjectedAddress; + return $this; + } + + /** + * Index of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. + * + * @param int $lastReadMessageIndex Index of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. + * @return $this Fluent Builder + */ + public function setLastReadMessageIndex(int $lastReadMessageIndex): self + { + $this->options['lastReadMessageIndex'] = $lastReadMessageIndex; + return $this; + } + + /** + * Timestamp of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. + * + * @param string $lastReadTimestamp Timestamp of last “read” message in the [Conversation](https://www.twilio.com/docs/conversations/api/conversation-resource) for the Participant. + * @return $this Fluent Builder + */ + public function setLastReadTimestamp(string $lastReadTimestamp): self + { + $this->options['lastReadTimestamp'] = $lastReadTimestamp; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.UpdateParticipantOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantPage.php b/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantPage.php new file mode 100755 index 0000000..c180e50 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/ParticipantPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ParticipantInstance \Twilio\Rest\Conversations\V1\Service\Conversation\ParticipantInstance + */ + public function buildInstance(array $payload): ParticipantInstance + { + return new ParticipantInstance($this->version, $payload, $this->solution['chatServiceSid'], $this->solution['conversationSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.ParticipantPage]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookContext.php b/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookContext.php new file mode 100755 index 0000000..c0b9c8f --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookContext.php @@ -0,0 +1,146 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + 'conversationSid' => + $conversationSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Conversations/' . \rawurlencode($conversationSid) + .'/Webhooks/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the WebhookInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the WebhookInstance + * + * @return WebhookInstance Fetched WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WebhookInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new WebhookInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'], + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the WebhookInstance + * + * @param array|Options $options Optional Arguments + * @return WebhookInstance Updated WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WebhookInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Configuration.Url' => + $options['configurationUrl'], + 'Configuration.Method' => + $options['configurationMethod'], + 'Configuration.Filters' => + Serialize::map($options['configurationFilters'], function ($e) { return $e; }), + 'Configuration.Triggers' => + Serialize::map($options['configurationTriggers'], function ($e) { return $e; }), + 'Configuration.FlowSid' => + $options['configurationFlowSid'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new WebhookInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'], + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.WebhookContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookInstance.php b/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookInstance.php new file mode 100755 index 0000000..137306e --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookInstance.php @@ -0,0 +1,162 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), + 'conversationSid' => Values::array_get($payload, 'conversation_sid'), + 'target' => Values::array_get($payload, 'target'), + 'url' => Values::array_get($payload, 'url'), + 'configuration' => Values::array_get($payload, 'configuration'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + ]; + + $this->solution = ['chatServiceSid' => $chatServiceSid, 'conversationSid' => $conversationSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return WebhookContext Context for this WebhookInstance + */ + protected function proxy(): WebhookContext + { + if (!$this->context) { + $this->context = new WebhookContext( + $this->version, + $this->solution['chatServiceSid'], + $this->solution['conversationSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the WebhookInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the WebhookInstance + * + * @return WebhookInstance Fetched WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WebhookInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the WebhookInstance + * + * @param array|Options $options Optional Arguments + * @return WebhookInstance Updated WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WebhookInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.WebhookInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookList.php b/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookList.php new file mode 100755 index 0000000..004f642 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookList.php @@ -0,0 +1,219 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + + 'conversationSid' => + $conversationSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Conversations/' . \rawurlencode($conversationSid) + .'/Webhooks'; + } + + /** + * Create the WebhookInstance + * + * @param string $target + * @param array|Options $options Optional Arguments + * @return WebhookInstance Created WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $target, array $options = []): WebhookInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Target' => + $target, + 'Configuration.Url' => + $options['configurationUrl'], + 'Configuration.Method' => + $options['configurationMethod'], + 'Configuration.Filters' => + Serialize::map($options['configurationFilters'], function ($e) { return $e; }), + 'Configuration.Triggers' => + Serialize::map($options['configurationTriggers'], function ($e) { return $e; }), + 'Configuration.FlowSid' => + $options['configurationFlowSid'], + 'Configuration.ReplayAfter' => + $options['configurationReplayAfter'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new WebhookInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'], + $this->solution['conversationSid'] + ); + } + + + /** + * Reads WebhookInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return WebhookInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams WebhookInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of WebhookInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return WebhookPage Page of WebhookInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): WebhookPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new WebhookPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of WebhookInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return WebhookPage Page of WebhookInstance + */ + public function getPage(string $targetUrl): WebhookPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new WebhookPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a WebhookContext + * + * @param string $sid A 34 character string that uniquely identifies this resource. + */ + public function getContext( + string $sid + + ): WebhookContext + { + return new WebhookContext( + $this->version, + $this->solution['chatServiceSid'], + $this->solution['conversationSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.WebhookList]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookOptions.php b/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookOptions.php new file mode 100755 index 0000000..26305af --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookOptions.php @@ -0,0 +1,292 @@ +options['configurationUrl'] = $configurationUrl; + $this->options['configurationMethod'] = $configurationMethod; + $this->options['configurationFilters'] = $configurationFilters; + $this->options['configurationTriggers'] = $configurationTriggers; + $this->options['configurationFlowSid'] = $configurationFlowSid; + $this->options['configurationReplayAfter'] = $configurationReplayAfter; + } + + /** + * The absolute url the webhook request should be sent to. + * + * @param string $configurationUrl The absolute url the webhook request should be sent to. + * @return $this Fluent Builder + */ + public function setConfigurationUrl(string $configurationUrl): self + { + $this->options['configurationUrl'] = $configurationUrl; + return $this; + } + + /** + * @param string $configurationMethod + * @return $this Fluent Builder + */ + public function setConfigurationMethod(string $configurationMethod): self + { + $this->options['configurationMethod'] = $configurationMethod; + return $this; + } + + /** + * The list of events, firing webhook event for this Conversation. + * + * @param string[] $configurationFilters The list of events, firing webhook event for this Conversation. + * @return $this Fluent Builder + */ + public function setConfigurationFilters(array $configurationFilters): self + { + $this->options['configurationFilters'] = $configurationFilters; + return $this; + } + + /** + * The list of keywords, firing webhook event for this Conversation. + * + * @param string[] $configurationTriggers The list of keywords, firing webhook event for this Conversation. + * @return $this Fluent Builder + */ + public function setConfigurationTriggers(array $configurationTriggers): self + { + $this->options['configurationTriggers'] = $configurationTriggers; + return $this; + } + + /** + * The studio flow SID, where the webhook should be sent to. + * + * @param string $configurationFlowSid The studio flow SID, where the webhook should be sent to. + * @return $this Fluent Builder + */ + public function setConfigurationFlowSid(string $configurationFlowSid): self + { + $this->options['configurationFlowSid'] = $configurationFlowSid; + return $this; + } + + /** + * The message index for which and it's successors the webhook will be replayed. Not set by default + * + * @param int $configurationReplayAfter The message index for which and it's successors the webhook will be replayed. Not set by default + * @return $this Fluent Builder + */ + public function setConfigurationReplayAfter(int $configurationReplayAfter): self + { + $this->options['configurationReplayAfter'] = $configurationReplayAfter; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.CreateWebhookOptions ' . $options . ']'; + } +} + + + + +class UpdateWebhookOptions extends Options + { + /** + * @param string $configurationUrl The absolute url the webhook request should be sent to. + * @param string $configurationMethod + * @param string[] $configurationFilters The list of events, firing webhook event for this Conversation. + * @param string[] $configurationTriggers The list of keywords, firing webhook event for this Conversation. + * @param string $configurationFlowSid The studio flow SID, where the webhook should be sent to. + */ + public function __construct( + + string $configurationUrl = Values::NONE, + string $configurationMethod = Values::NONE, + array $configurationFilters = Values::ARRAY_NONE, + array $configurationTriggers = Values::ARRAY_NONE, + string $configurationFlowSid = Values::NONE + + ) { + $this->options['configurationUrl'] = $configurationUrl; + $this->options['configurationMethod'] = $configurationMethod; + $this->options['configurationFilters'] = $configurationFilters; + $this->options['configurationTriggers'] = $configurationTriggers; + $this->options['configurationFlowSid'] = $configurationFlowSid; + } + + /** + * The absolute url the webhook request should be sent to. + * + * @param string $configurationUrl The absolute url the webhook request should be sent to. + * @return $this Fluent Builder + */ + public function setConfigurationUrl(string $configurationUrl): self + { + $this->options['configurationUrl'] = $configurationUrl; + return $this; + } + + /** + * @param string $configurationMethod + * @return $this Fluent Builder + */ + public function setConfigurationMethod(string $configurationMethod): self + { + $this->options['configurationMethod'] = $configurationMethod; + return $this; + } + + /** + * The list of events, firing webhook event for this Conversation. + * + * @param string[] $configurationFilters The list of events, firing webhook event for this Conversation. + * @return $this Fluent Builder + */ + public function setConfigurationFilters(array $configurationFilters): self + { + $this->options['configurationFilters'] = $configurationFilters; + return $this; + } + + /** + * The list of keywords, firing webhook event for this Conversation. + * + * @param string[] $configurationTriggers The list of keywords, firing webhook event for this Conversation. + * @return $this Fluent Builder + */ + public function setConfigurationTriggers(array $configurationTriggers): self + { + $this->options['configurationTriggers'] = $configurationTriggers; + return $this; + } + + /** + * The studio flow SID, where the webhook should be sent to. + * + * @param string $configurationFlowSid The studio flow SID, where the webhook should be sent to. + * @return $this Fluent Builder + */ + public function setConfigurationFlowSid(string $configurationFlowSid): self + { + $this->options['configurationFlowSid'] = $configurationFlowSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.UpdateWebhookOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookPage.php b/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookPage.php new file mode 100755 index 0000000..c03be0a --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/Conversation/WebhookPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WebhookInstance \Twilio\Rest\Conversations\V1\Service\Conversation\WebhookInstance + */ + public function buildInstance(array $payload): WebhookInstance + { + return new WebhookInstance($this->version, $payload, $this->solution['chatServiceSid'], $this->solution['conversationSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.WebhookPage]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/ConversationContext.php b/app/api/Twilio/Rest/Conversations/V1/Service/ConversationContext.php new file mode 100755 index 0000000..e60c4b1 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/ConversationContext.php @@ -0,0 +1,253 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Conversations/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ConversationInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ConversationInstance + * + * @return ConversationInstance Fetched ConversationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ConversationInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ConversationInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ConversationInstance + * + * @param array|Options $options Optional Arguments + * @return ConversationInstance Updated ConversationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ConversationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'Attributes' => + $options['attributes'], + 'MessagingServiceSid' => + $options['messagingServiceSid'], + 'State' => + $options['state'], + 'Timers.Inactive' => + $options['timersInactive'], + 'Timers.Closed' => + $options['timersClosed'], + 'UniqueName' => + $options['uniqueName'], + ]); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ConversationInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the webhooks + */ + protected function getWebhooks(): WebhookList + { + if (!$this->_webhooks) { + $this->_webhooks = new WebhookList( + $this->version, + $this->solution['chatServiceSid'], + $this->solution['sid'] + ); + } + + return $this->_webhooks; + } + + /** + * Access the participants + */ + protected function getParticipants(): ParticipantList + { + if (!$this->_participants) { + $this->_participants = new ParticipantList( + $this->version, + $this->solution['chatServiceSid'], + $this->solution['sid'] + ); + } + + return $this->_participants; + } + + /** + * Access the messages + */ + protected function getMessages(): MessageList + { + if (!$this->_messages) { + $this->_messages = new MessageList( + $this->version, + $this->solution['chatServiceSid'], + $this->solution['sid'] + ); + } + + return $this->_messages; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.ConversationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/ConversationInstance.php b/app/api/Twilio/Rest/Conversations/V1/Service/ConversationInstance.php new file mode 100755 index 0000000..3c2a980 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/ConversationInstance.php @@ -0,0 +1,202 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), + 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'state' => Values::array_get($payload, 'state'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'timers' => Values::array_get($payload, 'timers'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + 'bindings' => Values::array_get($payload, 'bindings'), + ]; + + $this->solution = ['chatServiceSid' => $chatServiceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ConversationContext Context for this ConversationInstance + */ + protected function proxy(): ConversationContext + { + if (!$this->context) { + $this->context = new ConversationContext( + $this->version, + $this->solution['chatServiceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ConversationInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the ConversationInstance + * + * @return ConversationInstance Fetched ConversationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ConversationInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ConversationInstance + * + * @param array|Options $options Optional Arguments + * @return ConversationInstance Updated ConversationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ConversationInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the webhooks + */ + protected function getWebhooks(): WebhookList + { + return $this->proxy()->webhooks; + } + + /** + * Access the participants + */ + protected function getParticipants(): ParticipantList + { + return $this->proxy()->participants; + } + + /** + * Access the messages + */ + protected function getMessages(): MessageList + { + return $this->proxy()->messages; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.ConversationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/ConversationList.php b/app/api/Twilio/Rest/Conversations/V1/Service/ConversationList.php new file mode 100755 index 0000000..eba357a --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/ConversationList.php @@ -0,0 +1,226 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Conversations'; + } + + /** + * Create the ConversationInstance + * + * @param array|Options $options Optional Arguments + * @return ConversationInstance Created ConversationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): ConversationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'UniqueName' => + $options['uniqueName'], + 'Attributes' => + $options['attributes'], + 'MessagingServiceSid' => + $options['messagingServiceSid'], + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'State' => + $options['state'], + 'Timers.Inactive' => + $options['timersInactive'], + 'Timers.Closed' => + $options['timersClosed'], + ]); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ConversationInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'] + ); + } + + + /** + * Reads ConversationInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ConversationInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams ConversationInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ConversationInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ConversationPage Page of ConversationInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ConversationPage + { + $options = new Values($options); + + $params = Values::of([ + 'StartDate' => + $options['startDate'], + 'EndDate' => + $options['endDate'], + 'State' => + $options['state'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ConversationPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ConversationInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ConversationPage Page of ConversationInstance + */ + public function getPage(string $targetUrl): ConversationPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ConversationPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ConversationContext + * + * @param string $sid A 34 character string that uniquely identifies this resource. Can also be the `unique_name` of the Conversation. + */ + public function getContext( + string $sid + + ): ConversationContext + { + return new ConversationContext( + $this->version, + $this->solution['chatServiceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.ConversationList]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/ConversationOptions.php b/app/api/Twilio/Rest/Conversations/V1/Service/ConversationOptions.php new file mode 100755 index 0000000..8c47fe5 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/ConversationOptions.php @@ -0,0 +1,590 @@ +options['friendlyName'] = $friendlyName; + $this->options['uniqueName'] = $uniqueName; + $this->options['attributes'] = $attributes; + $this->options['messagingServiceSid'] = $messagingServiceSid; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['state'] = $state; + $this->options['timersInactive'] = $timersInactive; + $this->options['timersClosed'] = $timersClosed; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The human-readable name of this conversation, limited to 256 characters. Optional. + * + * @param string $friendlyName The human-readable name of this conversation, limited to 256 characters. Optional. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * + * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The unique ID of the [Messaging Service](https://www.twilio.com/docs/sms/services/api) this conversation belongs to. + * + * @param string $messagingServiceSid The unique ID of the [Messaging Service](https://www.twilio.com/docs/sms/services/api) this conversation belongs to. + * @return $this Fluent Builder + */ + public function setMessagingServiceSid(string $messagingServiceSid): self + { + $this->options['messagingServiceSid'] = $messagingServiceSid; + return $this; + } + + /** + * The date that this resource was created. + * + * @param \DateTime $dateCreated The date that this resource was created. + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The date that this resource was last updated. + * + * @param \DateTime $dateUpdated The date that this resource was last updated. + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * @param string $state + * @return $this Fluent Builder + */ + public function setState(string $state): self + { + $this->options['state'] = $state; + return $this; + } + + /** + * ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. + * + * @param string $timersInactive ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. + * @return $this Fluent Builder + */ + public function setTimersInactive(string $timersInactive): self + { + $this->options['timersInactive'] = $timersInactive; + return $this; + } + + /** + * ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. + * + * @param string $timersClosed ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. + * @return $this Fluent Builder + */ + public function setTimersClosed(string $timersClosed): self + { + $this->options['timersClosed'] = $timersClosed; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.CreateConversationOptions ' . $options . ']'; + } +} + +class DeleteConversationOptions extends Options + { + /** + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.DeleteConversationOptions ' . $options . ']'; + } +} + + +class ReadConversationOptions extends Options + { + /** + * @param string $startDate Start date in ISO8601 format for sorting and filtering list of Conversations. + * @param string $endDate End date in ISO8601 format for sorting and filtering list of Conversations. + * @param string $state State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` + */ + public function __construct( + + string $startDate = Values::NONE, + string $endDate = Values::NONE, + string $state = Values::NONE + + ) { + $this->options['startDate'] = $startDate; + $this->options['endDate'] = $endDate; + $this->options['state'] = $state; + } + + /** + * Start date in ISO8601 format for sorting and filtering list of Conversations. + * + * @param string $startDate Start date in ISO8601 format for sorting and filtering list of Conversations. + * @return $this Fluent Builder + */ + public function setStartDate(string $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * End date in ISO8601 format for sorting and filtering list of Conversations. + * + * @param string $endDate End date in ISO8601 format for sorting and filtering list of Conversations. + * @return $this Fluent Builder + */ + public function setEndDate(string $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` + * + * @param string $state State for sorting and filtering list of Conversations. Can be `active`, `inactive` or `closed` + * @return $this Fluent Builder + */ + public function setState(string $state): self + { + $this->options['state'] = $state; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.ReadConversationOptions ' . $options . ']'; + } +} + +class UpdateConversationOptions extends Options + { + /** + * @param string $friendlyName The human-readable name of this conversation, limited to 256 characters. Optional. + * @param \DateTime $dateCreated The date that this resource was created. + * @param \DateTime $dateUpdated The date that this resource was last updated. + * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * @param string $messagingServiceSid The unique ID of the [Messaging Service](https://www.twilio.com/docs/sms/services/api) this conversation belongs to. + * @param string $state + * @param string $timersInactive ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. + * @param string $timersClosed ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $friendlyName = Values::NONE, + \DateTime $dateCreated = null, + \DateTime $dateUpdated = null, + string $attributes = Values::NONE, + string $messagingServiceSid = Values::NONE, + string $state = Values::NONE, + string $timersInactive = Values::NONE, + string $timersClosed = Values::NONE, + string $uniqueName = Values::NONE, + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['attributes'] = $attributes; + $this->options['messagingServiceSid'] = $messagingServiceSid; + $this->options['state'] = $state; + $this->options['timersInactive'] = $timersInactive; + $this->options['timersClosed'] = $timersClosed; + $this->options['uniqueName'] = $uniqueName; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The human-readable name of this conversation, limited to 256 characters. Optional. + * + * @param string $friendlyName The human-readable name of this conversation, limited to 256 characters. Optional. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The date that this resource was created. + * + * @param \DateTime $dateCreated The date that this resource was created. + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * The date that this resource was last updated. + * + * @param \DateTime $dateUpdated The date that this resource was last updated. + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * + * @param string $attributes An optional string metadata field you can use to store any data you wish. The string value must contain structurally valid JSON if specified. **Note** that if the attributes are not set \\\"{}\\\" will be returned. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The unique ID of the [Messaging Service](https://www.twilio.com/docs/sms/services/api) this conversation belongs to. + * + * @param string $messagingServiceSid The unique ID of the [Messaging Service](https://www.twilio.com/docs/sms/services/api) this conversation belongs to. + * @return $this Fluent Builder + */ + public function setMessagingServiceSid(string $messagingServiceSid): self + { + $this->options['messagingServiceSid'] = $messagingServiceSid; + return $this; + } + + /** + * @param string $state + * @return $this Fluent Builder + */ + public function setState(string $state): self + { + $this->options['state'] = $state; + return $this; + } + + /** + * ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. + * + * @param string $timersInactive ISO8601 duration when conversation will be switched to `inactive` state. Minimum value for this timer is 1 minute. + * @return $this Fluent Builder + */ + public function setTimersInactive(string $timersInactive): self + { + $this->options['timersInactive'] = $timersInactive; + return $this; + } + + /** + * ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. + * + * @param string $timersClosed ISO8601 duration when conversation will be switched to `closed` state. Minimum value for this timer is 10 minutes. + * @return $this Fluent Builder + */ + public function setTimersClosed(string $timersClosed): self + { + $this->options['timersClosed'] = $timersClosed; + return $this; + } + + /** + * An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used to address the resource in place of the resource's `sid` in the URL. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.UpdateConversationOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/ConversationPage.php b/app/api/Twilio/Rest/Conversations/V1/Service/ConversationPage.php new file mode 100755 index 0000000..f8bf706 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/ConversationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ConversationInstance \Twilio\Rest\Conversations\V1\Service\ConversationInstance + */ + public function buildInstance(array $payload): ConversationInstance + { + return new ConversationInstance($this->version, $payload, $this->solution['chatServiceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.ConversationPage]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/ParticipantConversationInstance.php b/app/api/Twilio/Rest/Conversations/V1/Service/ParticipantConversationInstance.php new file mode 100755 index 0000000..ec9a825 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/ParticipantConversationInstance.php @@ -0,0 +1,112 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), + 'participantSid' => Values::array_get($payload, 'participant_sid'), + 'participantUserSid' => Values::array_get($payload, 'participant_user_sid'), + 'participantIdentity' => Values::array_get($payload, 'participant_identity'), + 'participantMessagingBinding' => Values::array_get($payload, 'participant_messaging_binding'), + 'conversationSid' => Values::array_get($payload, 'conversation_sid'), + 'conversationUniqueName' => Values::array_get($payload, 'conversation_unique_name'), + 'conversationFriendlyName' => Values::array_get($payload, 'conversation_friendly_name'), + 'conversationAttributes' => Values::array_get($payload, 'conversation_attributes'), + 'conversationDateCreated' => Deserialize::dateTime(Values::array_get($payload, 'conversation_date_created')), + 'conversationDateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'conversation_date_updated')), + 'conversationCreatedBy' => Values::array_get($payload, 'conversation_created_by'), + 'conversationState' => Values::array_get($payload, 'conversation_state'), + 'conversationTimers' => Values::array_get($payload, 'conversation_timers'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['chatServiceSid' => $chatServiceSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.ParticipantConversationInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/ParticipantConversationList.php b/app/api/Twilio/Rest/Conversations/V1/Service/ParticipantConversationList.php new file mode 100755 index 0000000..ec507bb --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/ParticipantConversationList.php @@ -0,0 +1,160 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/ParticipantConversations'; + } + + /** + * Reads ParticipantConversationInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ParticipantConversationInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams ParticipantConversationInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ParticipantConversationInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ParticipantConversationPage Page of ParticipantConversationInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ParticipantConversationPage + { + $options = new Values($options); + + $params = Values::of([ + 'Identity' => + $options['identity'], + 'Address' => + $options['address'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ParticipantConversationPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ParticipantConversationInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ParticipantConversationPage Page of ParticipantConversationInstance + */ + public function getPage(string $targetUrl): ParticipantConversationPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ParticipantConversationPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.ParticipantConversationList]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/ParticipantConversationOptions.php b/app/api/Twilio/Rest/Conversations/V1/Service/ParticipantConversationOptions.php new file mode 100755 index 0000000..63cf694 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/ParticipantConversationOptions.php @@ -0,0 +1,94 @@ +options['identity'] = $identity; + $this->options['address'] = $address; + } + + /** + * A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. + * + * @param string $identity A unique string identifier for the conversation participant as [Conversation User](https://www.twilio.com/docs/conversations/api/user-resource). This parameter is non-null if (and only if) the participant is using the Conversations SDK to communicate. Limited to 256 characters. + * @return $this Fluent Builder + */ + public function setIdentity(string $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * A unique string identifier for the conversation participant who's not a Conversation User. This parameter could be found in messaging_binding.address field of Participant resource. It should be url-encoded. + * + * @param string $address A unique string identifier for the conversation participant who's not a Conversation User. This parameter could be found in messaging_binding.address field of Participant resource. It should be url-encoded. + * @return $this Fluent Builder + */ + public function setAddress(string $address): self + { + $this->options['address'] = $address; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.ReadParticipantConversationOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/ParticipantConversationPage.php b/app/api/Twilio/Rest/Conversations/V1/Service/ParticipantConversationPage.php new file mode 100755 index 0000000..c6f5103 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/ParticipantConversationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ParticipantConversationInstance \Twilio\Rest\Conversations\V1\Service\ParticipantConversationInstance + */ + public function buildInstance(array $payload): ParticipantConversationInstance + { + return new ParticipantConversationInstance($this->version, $payload, $this->solution['chatServiceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.ParticipantConversationPage]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/RoleContext.php b/app/api/Twilio/Rest/Conversations/V1/Service/RoleContext.php new file mode 100755 index 0000000..9cf0eee --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/RoleContext.php @@ -0,0 +1,128 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Roles/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the RoleInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the RoleInstance + * + * @return RoleInstance Fetched RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RoleInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new RoleInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the RoleInstance + * + * @param string[] $permission A permission that you grant to the role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. Note that the update action replaces all previously assigned permissions with those defined in the update action. To remove a permission, do not include it in the subsequent update action. The values for this parameter depend on the role's `type`. + * @return RoleInstance Updated RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $permission): RoleInstance + { + + $data = Values::of([ + 'Permission' => + Serialize::map($permission,function ($e) { return $e; }), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new RoleInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.RoleContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/RoleInstance.php b/app/api/Twilio/Rest/Conversations/V1/Service/RoleInstance.php new file mode 100755 index 0000000..80f1a87 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/RoleInstance.php @@ -0,0 +1,159 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'type' => Values::array_get($payload, 'type'), + 'permissions' => Values::array_get($payload, 'permissions'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['chatServiceSid' => $chatServiceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return RoleContext Context for this RoleInstance + */ + protected function proxy(): RoleContext + { + if (!$this->context) { + $this->context = new RoleContext( + $this->version, + $this->solution['chatServiceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the RoleInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the RoleInstance + * + * @return RoleInstance Fetched RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RoleInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the RoleInstance + * + * @param string[] $permission A permission that you grant to the role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. Note that the update action replaces all previously assigned permissions with those defined in the update action. To remove a permission, do not include it in the subsequent update action. The values for this parameter depend on the role's `type`. + * @return RoleInstance Updated RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $permission): RoleInstance + { + + return $this->proxy()->update($permission); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.RoleInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/RoleList.php b/app/api/Twilio/Rest/Conversations/V1/Service/RoleList.php new file mode 100755 index 0000000..0d8ff00 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/RoleList.php @@ -0,0 +1,201 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Roles'; + } + + /** + * Create the RoleInstance + * + * @param string $friendlyName A descriptive string that you create to describe the new resource. It can be up to 64 characters long. + * @param string $type + * @param string[] $permission A permission that you grant to the new role. Only one permission can be granted per parameter. To assign more than one permission, repeat this parameter for each permission value. The values for this parameter depend on the role's `type`. + * @return RoleInstance Created RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $type, array $permission): RoleInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Type' => + $type, + 'Permission' => + Serialize::map($permission,function ($e) { return $e; }), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new RoleInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'] + ); + } + + + /** + * Reads RoleInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return RoleInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams RoleInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of RoleInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return RolePage Page of RoleInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): RolePage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new RolePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of RoleInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return RolePage Page of RoleInstance + */ + public function getPage(string $targetUrl): RolePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new RolePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a RoleContext + * + * @param string $sid The SID of the Role resource to delete. + */ + public function getContext( + string $sid + + ): RoleContext + { + return new RoleContext( + $this->version, + $this->solution['chatServiceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.RoleList]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/RolePage.php b/app/api/Twilio/Rest/Conversations/V1/Service/RolePage.php new file mode 100755 index 0000000..74a0040 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/RolePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RoleInstance \Twilio\Rest\Conversations\V1\Service\RoleInstance + */ + public function buildInstance(array $payload): RoleInstance + { + return new RoleInstance($this->version, $payload, $this->solution['chatServiceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.RolePage]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/User/UserConversationContext.php b/app/api/Twilio/Rest/Conversations/V1/Service/User/UserConversationContext.php new file mode 100755 index 0000000..0ec5339 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/User/UserConversationContext.php @@ -0,0 +1,142 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + 'userSid' => + $userSid, + 'conversationSid' => + $conversationSid, + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Users/' . \rawurlencode($userSid) + .'/Conversations/' . \rawurlencode($conversationSid) + .''; + } + + /** + * Delete the UserConversationInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the UserConversationInstance + * + * @return UserConversationInstance Fetched UserConversationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserConversationInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new UserConversationInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'], + $this->solution['userSid'], + $this->solution['conversationSid'] + ); + } + + + /** + * Update the UserConversationInstance + * + * @param array|Options $options Optional Arguments + * @return UserConversationInstance Updated UserConversationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserConversationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'NotificationLevel' => + $options['notificationLevel'], + 'LastReadTimestamp' => + Serialize::iso8601DateTime($options['lastReadTimestamp']), + 'LastReadMessageIndex' => + $options['lastReadMessageIndex'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new UserConversationInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'], + $this->solution['userSid'], + $this->solution['conversationSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.UserConversationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/User/UserConversationInstance.php b/app/api/Twilio/Rest/Conversations/V1/Service/User/UserConversationInstance.php new file mode 100755 index 0000000..07dcc45 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/User/UserConversationInstance.php @@ -0,0 +1,180 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), + 'conversationSid' => Values::array_get($payload, 'conversation_sid'), + 'unreadMessagesCount' => Values::array_get($payload, 'unread_messages_count'), + 'lastReadMessageIndex' => Values::array_get($payload, 'last_read_message_index'), + 'participantSid' => Values::array_get($payload, 'participant_sid'), + 'userSid' => Values::array_get($payload, 'user_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'conversationState' => Values::array_get($payload, 'conversation_state'), + 'timers' => Values::array_get($payload, 'timers'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'createdBy' => Values::array_get($payload, 'created_by'), + 'notificationLevel' => Values::array_get($payload, 'notification_level'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['chatServiceSid' => $chatServiceSid, 'userSid' => $userSid, 'conversationSid' => $conversationSid ?: $this->properties['conversationSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return UserConversationContext Context for this UserConversationInstance + */ + protected function proxy(): UserConversationContext + { + if (!$this->context) { + $this->context = new UserConversationContext( + $this->version, + $this->solution['chatServiceSid'], + $this->solution['userSid'], + $this->solution['conversationSid'] + ); + } + + return $this->context; + } + + /** + * Delete the UserConversationInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the UserConversationInstance + * + * @return UserConversationInstance Fetched UserConversationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserConversationInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the UserConversationInstance + * + * @param array|Options $options Optional Arguments + * @return UserConversationInstance Updated UserConversationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserConversationInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.UserConversationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/User/UserConversationList.php b/app/api/Twilio/Rest/Conversations/V1/Service/User/UserConversationList.php new file mode 100755 index 0000000..2c0373c --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/User/UserConversationList.php @@ -0,0 +1,175 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + + 'userSid' => + $userSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Users/' . \rawurlencode($userSid) + .'/Conversations'; + } + + /** + * Reads UserConversationInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return UserConversationInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams UserConversationInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of UserConversationInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return UserConversationPage Page of UserConversationInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): UserConversationPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new UserConversationPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of UserConversationInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return UserConversationPage Page of UserConversationInstance + */ + public function getPage(string $targetUrl): UserConversationPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new UserConversationPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a UserConversationContext + * + * @param string $conversationSid The unique SID identifier of the Conversation. This value can be either the `sid` or the `unique_name` of the [Conversation resource](https://www.twilio.com/docs/conversations/api/conversation-resource). + */ + public function getContext( + string $conversationSid + + ): UserConversationContext + { + return new UserConversationContext( + $this->version, + $this->solution['chatServiceSid'], + $this->solution['userSid'], + $conversationSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.UserConversationList]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/User/UserConversationOptions.php b/app/api/Twilio/Rest/Conversations/V1/Service/User/UserConversationOptions.php new file mode 100755 index 0000000..e0c1728 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/User/UserConversationOptions.php @@ -0,0 +1,116 @@ +options['notificationLevel'] = $notificationLevel; + $this->options['lastReadTimestamp'] = $lastReadTimestamp; + $this->options['lastReadMessageIndex'] = $lastReadMessageIndex; + } + + /** + * @param string $notificationLevel + * @return $this Fluent Builder + */ + public function setNotificationLevel(string $notificationLevel): self + { + $this->options['notificationLevel'] = $notificationLevel; + return $this; + } + + /** + * The date of the last message read in conversation by the user, given in ISO 8601 format. + * + * @param \DateTime $lastReadTimestamp The date of the last message read in conversation by the user, given in ISO 8601 format. + * @return $this Fluent Builder + */ + public function setLastReadTimestamp(\DateTime $lastReadTimestamp): self + { + $this->options['lastReadTimestamp'] = $lastReadTimestamp; + return $this; + } + + /** + * The index of the last Message in the Conversation that the Participant has read. + * + * @param int $lastReadMessageIndex The index of the last Message in the Conversation that the Participant has read. + * @return $this Fluent Builder + */ + public function setLastReadMessageIndex(int $lastReadMessageIndex): self + { + $this->options['lastReadMessageIndex'] = $lastReadMessageIndex; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.UpdateUserConversationOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/User/UserConversationPage.php b/app/api/Twilio/Rest/Conversations/V1/Service/User/UserConversationPage.php new file mode 100755 index 0000000..4622748 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/User/UserConversationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UserConversationInstance \Twilio\Rest\Conversations\V1\Service\User\UserConversationInstance + */ + public function buildInstance(array $payload): UserConversationInstance + { + return new UserConversationInstance($this->version, $payload, $this->solution['chatServiceSid'], $this->solution['userSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.UserConversationPage]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/UserContext.php b/app/api/Twilio/Rest/Conversations/V1/Service/UserContext.php new file mode 100755 index 0000000..4ab011b --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/UserContext.php @@ -0,0 +1,200 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Users/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the UserInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the UserInstance + * + * @return UserInstance Fetched UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new UserInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the UserInstance + * + * @param array|Options $options Optional Arguments + * @return UserInstance Updated UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'Attributes' => + $options['attributes'], + 'RoleSid' => + $options['roleSid'], + ]); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new UserInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the userConversations + */ + protected function getUserConversations(): UserConversationList + { + if (!$this->_userConversations) { + $this->_userConversations = new UserConversationList( + $this->version, + $this->solution['chatServiceSid'], + $this->solution['sid'] + ); + } + + return $this->_userConversations; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.UserContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/UserInstance.php b/app/api/Twilio/Rest/Conversations/V1/Service/UserInstance.php new file mode 100755 index 0000000..6796c65 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/UserInstance.php @@ -0,0 +1,180 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), + 'roleSid' => Values::array_get($payload, 'role_sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'isOnline' => Values::array_get($payload, 'is_online'), + 'isNotifiable' => Values::array_get($payload, 'is_notifiable'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['chatServiceSid' => $chatServiceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return UserContext Context for this UserInstance + */ + protected function proxy(): UserContext + { + if (!$this->context) { + $this->context = new UserContext( + $this->version, + $this->solution['chatServiceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the UserInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the UserInstance + * + * @return UserInstance Fetched UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the UserInstance + * + * @param array|Options $options Optional Arguments + * @return UserInstance Updated UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the userConversations + */ + protected function getUserConversations(): UserConversationList + { + return $this->proxy()->userConversations; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.UserInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/UserList.php b/app/api/Twilio/Rest/Conversations/V1/Service/UserList.php new file mode 100755 index 0000000..7213877 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/UserList.php @@ -0,0 +1,206 @@ +solution = [ + 'chatServiceSid' => + $chatServiceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($chatServiceSid) + .'/Users'; + } + + /** + * Create the UserInstance + * + * @param string $identity The application-defined string that uniquely identifies the resource's User within the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource). This value is often a username or an email address, and is case-sensitive. + * @param array|Options $options Optional Arguments + * @return UserInstance Created UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $identity, array $options = []): UserInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Identity' => + $identity, + 'FriendlyName' => + $options['friendlyName'], + 'Attributes' => + $options['attributes'], + 'RoleSid' => + $options['roleSid'], + ]); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new UserInstance( + $this->version, + $payload, + $this->solution['chatServiceSid'] + ); + } + + + /** + * Reads UserInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return UserInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams UserInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of UserInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return UserPage Page of UserInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): UserPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new UserPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of UserInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return UserPage Page of UserInstance + */ + public function getPage(string $targetUrl): UserPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new UserPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a UserContext + * + * @param string $sid The SID of the User resource to delete. This value can be either the `sid` or the `identity` of the User resource to delete. + */ + public function getContext( + string $sid + + ): UserContext + { + return new UserContext( + $this->version, + $this->solution['chatServiceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.UserList]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/UserOptions.php b/app/api/Twilio/Rest/Conversations/V1/Service/UserOptions.php new file mode 100755 index 0000000..20ae2d5 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/UserOptions.php @@ -0,0 +1,292 @@ +options['friendlyName'] = $friendlyName; + $this->options['attributes'] = $attributes; + $this->options['roleSid'] = $roleSid; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The string that you assigned to describe the resource. + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. + * + * @param string $attributes The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. + * + * @param string $roleSid The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.CreateUserOptions ' . $options . ']'; + } +} + +class DeleteUserOptions extends Options + { + /** + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.DeleteUserOptions ' . $options . ']'; + } +} + + + +class UpdateUserOptions extends Options + { + /** + * @param string $friendlyName The string that you assigned to describe the resource. + * @param string $attributes The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. + * @param string $roleSid The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $attributes = Values::NONE, + string $roleSid = Values::NONE, + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['attributes'] = $attributes; + $this->options['roleSid'] = $roleSid; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The string that you assigned to describe the resource. + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. + * + * @param string $attributes The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. + * + * @param string $roleSid The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.UpdateUserOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/Service/UserPage.php b/app/api/Twilio/Rest/Conversations/V1/Service/UserPage.php new file mode 100755 index 0000000..e0d52f5 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/Service/UserPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UserInstance \Twilio\Rest\Conversations\V1\Service\UserInstance + */ + public function buildInstance(array $payload): UserInstance + { + return new UserInstance($this->version, $payload, $this->solution['chatServiceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.UserPage]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/ServiceContext.php b/app/api/Twilio/Rest/Conversations/V1/ServiceContext.php new file mode 100755 index 0000000..1872e35 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/ServiceContext.php @@ -0,0 +1,246 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the users + */ + protected function getUsers(): UserList + { + if (!$this->_users) { + $this->_users = new UserList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_users; + } + + /** + * Access the bindings + */ + protected function getBindings(): BindingList + { + if (!$this->_bindings) { + $this->_bindings = new BindingList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_bindings; + } + + /** + * Access the participantConversations + */ + protected function getParticipantConversations(): ParticipantConversationList + { + if (!$this->_participantConversations) { + $this->_participantConversations = new ParticipantConversationList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_participantConversations; + } + + /** + * Access the conversations + */ + protected function getConversations(): ConversationList + { + if (!$this->_conversations) { + $this->_conversations = new ConversationList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_conversations; + } + + /** + * Access the roles + */ + protected function getRoles(): RoleList + { + if (!$this->_roles) { + $this->_roles = new RoleList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_roles; + } + + /** + * Access the configuration + */ + protected function getConfiguration(): ConfigurationList + { + if (!$this->_configuration) { + $this->_configuration = new ConfigurationList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_configuration; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.ServiceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/ServiceInstance.php b/app/api/Twilio/Rest/Conversations/V1/ServiceInstance.php new file mode 100755 index 0000000..7fbd715 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/ServiceInstance.php @@ -0,0 +1,201 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ServiceContext Context for this ServiceInstance + */ + protected function proxy(): ServiceContext + { + if (!$this->context) { + $this->context = new ServiceContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the users + */ + protected function getUsers(): UserList + { + return $this->proxy()->users; + } + + /** + * Access the bindings + */ + protected function getBindings(): BindingList + { + return $this->proxy()->bindings; + } + + /** + * Access the participantConversations + */ + protected function getParticipantConversations(): ParticipantConversationList + { + return $this->proxy()->participantConversations; + } + + /** + * Access the conversations + */ + protected function getConversations(): ConversationList + { + return $this->proxy()->conversations; + } + + /** + * Access the roles + */ + protected function getRoles(): RoleList + { + return $this->proxy()->roles; + } + + /** + * Access the configuration + */ + protected function getConfiguration(): ConfigurationList + { + return $this->proxy()->configuration; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.ServiceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/ServiceList.php b/app/api/Twilio/Rest/Conversations/V1/ServiceList.php new file mode 100755 index 0000000..5b291a9 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/ServiceList.php @@ -0,0 +1,186 @@ +solution = [ + ]; + + $this->uri = '/Services'; + } + + /** + * Create the ServiceInstance + * + * @param string $friendlyName The human-readable name of this service, limited to 256 characters. Optional. + * @return ServiceInstance Created ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName): ServiceInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new ServiceInstance( + $this->version, + $payload + ); + } + + + /** + * Reads ServiceInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ServiceInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ServiceInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ServiceInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ServicePage Page of ServiceInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ServicePage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ServicePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ServiceInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ServicePage Page of ServiceInstance + */ + public function getPage(string $targetUrl): ServicePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ServicePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ServiceContext + * + * @param string $sid A 34 character string that uniquely identifies this resource. + */ + public function getContext( + string $sid + + ): ServiceContext + { + return new ServiceContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.ServiceList]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/ServicePage.php b/app/api/Twilio/Rest/Conversations/V1/ServicePage.php new file mode 100755 index 0000000..38b4558 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/ServicePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ServiceInstance \Twilio\Rest\Conversations\V1\ServiceInstance + */ + public function buildInstance(array $payload): ServiceInstance + { + return new ServiceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.ServicePage]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/User/UserConversationContext.php b/app/api/Twilio/Rest/Conversations/V1/User/UserConversationContext.php new file mode 100755 index 0000000..24bf39d --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/User/UserConversationContext.php @@ -0,0 +1,135 @@ +solution = [ + 'userSid' => + $userSid, + 'conversationSid' => + $conversationSid, + ]; + + $this->uri = '/Users/' . \rawurlencode($userSid) + .'/Conversations/' . \rawurlencode($conversationSid) + .''; + } + + /** + * Delete the UserConversationInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the UserConversationInstance + * + * @return UserConversationInstance Fetched UserConversationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserConversationInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new UserConversationInstance( + $this->version, + $payload, + $this->solution['userSid'], + $this->solution['conversationSid'] + ); + } + + + /** + * Update the UserConversationInstance + * + * @param array|Options $options Optional Arguments + * @return UserConversationInstance Updated UserConversationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserConversationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'NotificationLevel' => + $options['notificationLevel'], + 'LastReadTimestamp' => + Serialize::iso8601DateTime($options['lastReadTimestamp']), + 'LastReadMessageIndex' => + $options['lastReadMessageIndex'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new UserConversationInstance( + $this->version, + $payload, + $this->solution['userSid'], + $this->solution['conversationSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.UserConversationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/User/UserConversationInstance.php b/app/api/Twilio/Rest/Conversations/V1/User/UserConversationInstance.php new file mode 100755 index 0000000..ab73746 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/User/UserConversationInstance.php @@ -0,0 +1,178 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), + 'conversationSid' => Values::array_get($payload, 'conversation_sid'), + 'unreadMessagesCount' => Values::array_get($payload, 'unread_messages_count'), + 'lastReadMessageIndex' => Values::array_get($payload, 'last_read_message_index'), + 'participantSid' => Values::array_get($payload, 'participant_sid'), + 'userSid' => Values::array_get($payload, 'user_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'conversationState' => Values::array_get($payload, 'conversation_state'), + 'timers' => Values::array_get($payload, 'timers'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'createdBy' => Values::array_get($payload, 'created_by'), + 'notificationLevel' => Values::array_get($payload, 'notification_level'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['userSid' => $userSid, 'conversationSid' => $conversationSid ?: $this->properties['conversationSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return UserConversationContext Context for this UserConversationInstance + */ + protected function proxy(): UserConversationContext + { + if (!$this->context) { + $this->context = new UserConversationContext( + $this->version, + $this->solution['userSid'], + $this->solution['conversationSid'] + ); + } + + return $this->context; + } + + /** + * Delete the UserConversationInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the UserConversationInstance + * + * @return UserConversationInstance Fetched UserConversationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserConversationInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the UserConversationInstance + * + * @param array|Options $options Optional Arguments + * @return UserConversationInstance Updated UserConversationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserConversationInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.UserConversationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/User/UserConversationList.php b/app/api/Twilio/Rest/Conversations/V1/User/UserConversationList.php new file mode 100755 index 0000000..546261e --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/User/UserConversationList.php @@ -0,0 +1,168 @@ +solution = [ + 'userSid' => + $userSid, + + ]; + + $this->uri = '/Users/' . \rawurlencode($userSid) + .'/Conversations'; + } + + /** + * Reads UserConversationInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return UserConversationInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams UserConversationInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of UserConversationInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return UserConversationPage Page of UserConversationInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): UserConversationPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new UserConversationPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of UserConversationInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return UserConversationPage Page of UserConversationInstance + */ + public function getPage(string $targetUrl): UserConversationPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new UserConversationPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a UserConversationContext + * + * @param string $conversationSid The unique SID identifier of the Conversation. This value can be either the `sid` or the `unique_name` of the [Conversation resource](https://www.twilio.com/docs/conversations/api/conversation-resource). + */ + public function getContext( + string $conversationSid + + ): UserConversationContext + { + return new UserConversationContext( + $this->version, + $this->solution['userSid'], + $conversationSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.UserConversationList]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/User/UserConversationOptions.php b/app/api/Twilio/Rest/Conversations/V1/User/UserConversationOptions.php new file mode 100755 index 0000000..2b6a85a --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/User/UserConversationOptions.php @@ -0,0 +1,116 @@ +options['notificationLevel'] = $notificationLevel; + $this->options['lastReadTimestamp'] = $lastReadTimestamp; + $this->options['lastReadMessageIndex'] = $lastReadMessageIndex; + } + + /** + * @param string $notificationLevel + * @return $this Fluent Builder + */ + public function setNotificationLevel(string $notificationLevel): self + { + $this->options['notificationLevel'] = $notificationLevel; + return $this; + } + + /** + * The date of the last message read in conversation by the user, given in ISO 8601 format. + * + * @param \DateTime $lastReadTimestamp The date of the last message read in conversation by the user, given in ISO 8601 format. + * @return $this Fluent Builder + */ + public function setLastReadTimestamp(\DateTime $lastReadTimestamp): self + { + $this->options['lastReadTimestamp'] = $lastReadTimestamp; + return $this; + } + + /** + * The index of the last Message in the Conversation that the Participant has read. + * + * @param int $lastReadMessageIndex The index of the last Message in the Conversation that the Participant has read. + * @return $this Fluent Builder + */ + public function setLastReadMessageIndex(int $lastReadMessageIndex): self + { + $this->options['lastReadMessageIndex'] = $lastReadMessageIndex; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.UpdateUserConversationOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/User/UserConversationPage.php b/app/api/Twilio/Rest/Conversations/V1/User/UserConversationPage.php new file mode 100755 index 0000000..b0fd1ff --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/User/UserConversationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UserConversationInstance \Twilio\Rest\Conversations\V1\User\UserConversationInstance + */ + public function buildInstance(array $payload): UserConversationInstance + { + return new UserConversationInstance($this->version, $payload, $this->solution['userSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.UserConversationPage]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/UserContext.php b/app/api/Twilio/Rest/Conversations/V1/UserContext.php new file mode 100755 index 0000000..172d3c6 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/UserContext.php @@ -0,0 +1,192 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Users/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the UserInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the UserInstance + * + * @return UserInstance Fetched UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new UserInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the UserInstance + * + * @param array|Options $options Optional Arguments + * @return UserInstance Updated UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'Attributes' => + $options['attributes'], + 'RoleSid' => + $options['roleSid'], + ]); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new UserInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the userConversations + */ + protected function getUserConversations(): UserConversationList + { + if (!$this->_userConversations) { + $this->_userConversations = new UserConversationList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_userConversations; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.UserContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/UserInstance.php b/app/api/Twilio/Rest/Conversations/V1/UserInstance.php new file mode 100755 index 0000000..756498f --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/UserInstance.php @@ -0,0 +1,178 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), + 'roleSid' => Values::array_get($payload, 'role_sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'isOnline' => Values::array_get($payload, 'is_online'), + 'isNotifiable' => Values::array_get($payload, 'is_notifiable'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return UserContext Context for this UserInstance + */ + protected function proxy(): UserContext + { + if (!$this->context) { + $this->context = new UserContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the UserInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the UserInstance + * + * @return UserInstance Fetched UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the UserInstance + * + * @param array|Options $options Optional Arguments + * @return UserInstance Updated UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the userConversations + */ + protected function getUserConversations(): UserConversationList + { + return $this->proxy()->userConversations; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Conversations.V1.UserInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/UserList.php b/app/api/Twilio/Rest/Conversations/V1/UserList.php new file mode 100755 index 0000000..7baca06 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/UserList.php @@ -0,0 +1,198 @@ +solution = [ + ]; + + $this->uri = '/Users'; + } + + /** + * Create the UserInstance + * + * @param string $identity The application-defined string that uniquely identifies the resource's User within the [Conversation Service](https://www.twilio.com/docs/conversations/api/service-resource). This value is often a username or an email address, and is case-sensitive. + * @param array|Options $options Optional Arguments + * @return UserInstance Created UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $identity, array $options = []): UserInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Identity' => + $identity, + 'FriendlyName' => + $options['friendlyName'], + 'Attributes' => + $options['attributes'], + 'RoleSid' => + $options['roleSid'], + ]); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new UserInstance( + $this->version, + $payload + ); + } + + + /** + * Reads UserInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return UserInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams UserInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of UserInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return UserPage Page of UserInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): UserPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new UserPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of UserInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return UserPage Page of UserInstance + */ + public function getPage(string $targetUrl): UserPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new UserPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a UserContext + * + * @param string $sid The SID of the User resource to delete. This value can be either the `sid` or the `identity` of the User resource to delete. + */ + public function getContext( + string $sid + + ): UserContext + { + return new UserContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.UserList]'; + } +} diff --git a/app/api/Twilio/Rest/Conversations/V1/UserOptions.php b/app/api/Twilio/Rest/Conversations/V1/UserOptions.php new file mode 100755 index 0000000..af05ebb --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/UserOptions.php @@ -0,0 +1,292 @@ +options['friendlyName'] = $friendlyName; + $this->options['attributes'] = $attributes; + $this->options['roleSid'] = $roleSid; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The string that you assigned to describe the resource. + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. + * + * @param string $attributes The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. + * + * @param string $roleSid The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.CreateUserOptions ' . $options . ']'; + } +} + +class DeleteUserOptions extends Options + { + /** + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.DeleteUserOptions ' . $options . ']'; + } +} + + + +class UpdateUserOptions extends Options + { + /** + * @param string $friendlyName The string that you assigned to describe the resource. + * @param string $attributes The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. + * @param string $roleSid The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $attributes = Values::NONE, + string $roleSid = Values::NONE, + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['attributes'] = $attributes; + $this->options['roleSid'] = $roleSid; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The string that you assigned to describe the resource. + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. + * + * @param string $attributes The JSON Object string that stores application-specific data. If attributes have not been set, `{}` is returned. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. + * + * @param string $roleSid The SID of a service-level [Role](https://www.twilio.com/docs/conversations/api/role-resource) to assign to the user. + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Conversations.V1.UpdateUserOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Conversations/V1/UserPage.php b/app/api/Twilio/Rest/Conversations/V1/UserPage.php new file mode 100755 index 0000000..dc08985 --- /dev/null +++ b/app/api/Twilio/Rest/Conversations/V1/UserPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UserInstance \Twilio\Rest\Conversations\V1\UserInstance + */ + public function buildInstance(array $payload): UserInstance + { + return new UserInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Conversations.V1.UserPage]'; + } +} diff --git a/app/api/Twilio/Rest/ConversationsBase.php b/app/api/Twilio/Rest/ConversationsBase.php new file mode 100755 index 0000000..fb80aa5 --- /dev/null +++ b/app/api/Twilio/Rest/ConversationsBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://conversations.twilio.com'; + } + + + /** + * @return V1 Version v1 of conversations + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Conversations]'; + } +} diff --git a/app/api/Twilio/Rest/Events.php b/app/api/Twilio/Rest/Events.php new file mode 100755 index 0000000..8a2d68b --- /dev/null +++ b/app/api/Twilio/Rest/Events.php @@ -0,0 +1,76 @@ +eventTypes instead. + */ + protected function getEventTypes(): \Twilio\Rest\Events\V1\EventTypeList { + echo "eventTypes is deprecated. Use v1->eventTypes instead."; + return $this->v1->eventTypes; + } + + /** + * @deprecated Use v1->eventTypes(\$type) instead. + * @param string $type A string that uniquely identifies this Event Type. + */ + protected function contextEventTypes(string $type): \Twilio\Rest\Events\V1\EventTypeContext { + echo "eventTypes(\$type) is deprecated. Use v1->eventTypes(\$type) instead."; + return $this->v1->eventTypes($type); + } + + /** + * @deprecated Use v1->schemas instead. + */ + protected function getSchemas(): \Twilio\Rest\Events\V1\SchemaList { + echo "schemas is deprecated. Use v1->schemas instead."; + return $this->v1->schemas; + } + + /** + * @deprecated Use v1->schemas(\$id) instead. + * @param string $id The unique identifier of the schema. + */ + protected function contextSchemas(string $id): \Twilio\Rest\Events\V1\SchemaContext { + echo "schemas(\$id) is deprecated. Use v1->schemas(\$id) instead."; + return $this->v1->schemas($id); + } + + /** + * @deprecated Use v1->sinks instead. + */ + protected function getSinks(): \Twilio\Rest\Events\V1\SinkList { + echo "sinks is deprecated. Use v1->sinks instead."; + return $this->v1->sinks; + } + + /** + * @deprecated Use v1->sinks(\$sid) instead + * @param string $sid A string that uniquely identifies this Sink. + */ + protected function contextSinks(string $sid): \Twilio\Rest\Events\V1\SinkContext { + echo "sinks(\$sid) is deprecated. Use v1->sinks(\$sid) instead."; + return $this->v1->sinks($sid); + } + + /** + * @deprecated Use v1->subscriptions instead. + */ + protected function getSubscriptions(): \Twilio\Rest\Events\V1\SubscriptionList { + echo "subscriptions is deprecated. Use v1->subscriptions instead."; + return $this->v1->subscriptions; + } + + /** + * @deprecated Use v1->subscriptions(\$sid) instead. + * @param string $sid A string that uniquely identifies this Subscription. + */ + protected function contextSubscriptions(string $sid): \Twilio\Rest\Events\V1\SubscriptionContext { + echo "subscriptions(\$sid) is deprecated. Use v1->subscriptions(\$sid) instead."; + return $this->v1->subscriptions($sid); + } +} \ No newline at end of file diff --git a/app/api/Twilio/Rest/Events/V1.php b/app/api/Twilio/Rest/Events/V1.php new file mode 100755 index 0000000..194793a --- /dev/null +++ b/app/api/Twilio/Rest/Events/V1.php @@ -0,0 +1,131 @@ +version = 'v1'; + } + + protected function getEventTypes(): EventTypeList + { + if (!$this->_eventTypes) { + $this->_eventTypes = new EventTypeList($this); + } + return $this->_eventTypes; + } + + protected function getSchemas(): SchemaList + { + if (!$this->_schemas) { + $this->_schemas = new SchemaList($this); + } + return $this->_schemas; + } + + protected function getSinks(): SinkList + { + if (!$this->_sinks) { + $this->_sinks = new SinkList($this); + } + return $this->_sinks; + } + + protected function getSubscriptions(): SubscriptionList + { + if (!$this->_subscriptions) { + $this->_subscriptions = new SubscriptionList($this); + } + return $this->_subscriptions; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Events.V1]'; + } +} diff --git a/app/api/Twilio/Rest/Events/V1/EventTypeContext.php b/app/api/Twilio/Rest/Events/V1/EventTypeContext.php new file mode 100755 index 0000000..91e213e --- /dev/null +++ b/app/api/Twilio/Rest/Events/V1/EventTypeContext.php @@ -0,0 +1,81 @@ +solution = [ + 'type' => + $type, + ]; + + $this->uri = '/Types/' . \rawurlencode($type) + .''; + } + + /** + * Fetch the EventTypeInstance + * + * @return EventTypeInstance Fetched EventTypeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EventTypeInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new EventTypeInstance( + $this->version, + $payload, + $this->solution['type'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Events.V1.EventTypeContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Events/V1/EventTypeInstance.php b/app/api/Twilio/Rest/Events/V1/EventTypeInstance.php new file mode 100755 index 0000000..6e8a7a0 --- /dev/null +++ b/app/api/Twilio/Rest/Events/V1/EventTypeInstance.php @@ -0,0 +1,128 @@ +properties = [ + 'type' => Values::array_get($payload, 'type'), + 'schemaId' => Values::array_get($payload, 'schema_id'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'description' => Values::array_get($payload, 'description'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['type' => $type ?: $this->properties['type'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return EventTypeContext Context for this EventTypeInstance + */ + protected function proxy(): EventTypeContext + { + if (!$this->context) { + $this->context = new EventTypeContext( + $this->version, + $this->solution['type'] + ); + } + + return $this->context; + } + + /** + * Fetch the EventTypeInstance + * + * @return EventTypeInstance Fetched EventTypeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EventTypeInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Events.V1.EventTypeInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Events/V1/EventTypeList.php b/app/api/Twilio/Rest/Events/V1/EventTypeList.php new file mode 100755 index 0000000..e39c0fa --- /dev/null +++ b/app/api/Twilio/Rest/Events/V1/EventTypeList.php @@ -0,0 +1,168 @@ +solution = [ + ]; + + $this->uri = '/Types'; + } + + /** + * Reads EventTypeInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return EventTypeInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams EventTypeInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of EventTypeInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return EventTypePage Page of EventTypeInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): EventTypePage + { + $options = new Values($options); + + $params = Values::of([ + 'SchemaId' => + $options['schemaId'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new EventTypePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of EventTypeInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return EventTypePage Page of EventTypeInstance + */ + public function getPage(string $targetUrl): EventTypePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new EventTypePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a EventTypeContext + * + * @param string $type A string that uniquely identifies this Event Type. + */ + public function getContext( + string $type + + ): EventTypeContext + { + return new EventTypeContext( + $this->version, + $type + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Events.V1.EventTypeList]'; + } +} diff --git a/app/api/Twilio/Rest/Events/V1/EventTypeOptions.php b/app/api/Twilio/Rest/Events/V1/EventTypeOptions.php new file mode 100755 index 0000000..defde2e --- /dev/null +++ b/app/api/Twilio/Rest/Events/V1/EventTypeOptions.php @@ -0,0 +1,78 @@ +options['schemaId'] = $schemaId; + } + + /** + * A string parameter filtering the results to return only the Event Types using a given schema. + * + * @param string $schemaId A string parameter filtering the results to return only the Event Types using a given schema. + * @return $this Fluent Builder + */ + public function setSchemaId(string $schemaId): self + { + $this->options['schemaId'] = $schemaId; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Events.V1.ReadEventTypeOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Events/V1/EventTypePage.php b/app/api/Twilio/Rest/Events/V1/EventTypePage.php new file mode 100755 index 0000000..407377d --- /dev/null +++ b/app/api/Twilio/Rest/Events/V1/EventTypePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return EventTypeInstance \Twilio\Rest\Events\V1\EventTypeInstance + */ + public function buildInstance(array $payload): EventTypeInstance + { + return new EventTypeInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Events.V1.EventTypePage]'; + } +} diff --git a/app/api/Twilio/Rest/Events/V1/Schema/SchemaVersionContext.php b/app/api/Twilio/Rest/Events/V1/Schema/SchemaVersionContext.php new file mode 100755 index 0000000..6ae1e09 --- /dev/null +++ b/app/api/Twilio/Rest/Events/V1/Schema/SchemaVersionContext.php @@ -0,0 +1,87 @@ +solution = [ + 'id' => + $id, + 'schemaVersion' => + $schemaVersion, + ]; + + $this->uri = '/Schemas/' . \rawurlencode($id) + .'/Versions/' . \rawurlencode($schemaVersion) + .''; + } + + /** + * Fetch the SchemaVersionInstance + * + * @return SchemaVersionInstance Fetched SchemaVersionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SchemaVersionInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new SchemaVersionInstance( + $this->version, + $payload, + $this->solution['id'], + $this->solution['schemaVersion'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Events.V1.SchemaVersionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Events/V1/Schema/SchemaVersionInstance.php b/app/api/Twilio/Rest/Events/V1/Schema/SchemaVersionInstance.php new file mode 100755 index 0000000..7842e69 --- /dev/null +++ b/app/api/Twilio/Rest/Events/V1/Schema/SchemaVersionInstance.php @@ -0,0 +1,126 @@ +properties = [ + 'id' => Values::array_get($payload, 'id'), + 'schemaVersion' => Values::array_get($payload, 'schema_version'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'url' => Values::array_get($payload, 'url'), + 'raw' => Values::array_get($payload, 'raw'), + ]; + + $this->solution = ['id' => $id, 'schemaVersion' => $schemaVersion ?: $this->properties['schemaVersion'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SchemaVersionContext Context for this SchemaVersionInstance + */ + protected function proxy(): SchemaVersionContext + { + if (!$this->context) { + $this->context = new SchemaVersionContext( + $this->version, + $this->solution['id'], + $this->solution['schemaVersion'] + ); + } + + return $this->context; + } + + /** + * Fetch the SchemaVersionInstance + * + * @return SchemaVersionInstance Fetched SchemaVersionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SchemaVersionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Events.V1.SchemaVersionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Events/V1/Schema/SchemaVersionList.php b/app/api/Twilio/Rest/Events/V1/Schema/SchemaVersionList.php new file mode 100755 index 0000000..8c5ac8b --- /dev/null +++ b/app/api/Twilio/Rest/Events/V1/Schema/SchemaVersionList.php @@ -0,0 +1,168 @@ +solution = [ + 'id' => + $id, + + ]; + + $this->uri = '/Schemas/' . \rawurlencode($id) + .'/Versions'; + } + + /** + * Reads SchemaVersionInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return SchemaVersionInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams SchemaVersionInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SchemaVersionInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return SchemaVersionPage Page of SchemaVersionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SchemaVersionPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SchemaVersionPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SchemaVersionInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SchemaVersionPage Page of SchemaVersionInstance + */ + public function getPage(string $targetUrl): SchemaVersionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SchemaVersionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SchemaVersionContext + * + * @param int $schemaVersion The version of the schema + */ + public function getContext( + int $schemaVersion + + ): SchemaVersionContext + { + return new SchemaVersionContext( + $this->version, + $this->solution['id'], + $schemaVersion + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Events.V1.SchemaVersionList]'; + } +} diff --git a/app/api/Twilio/Rest/Events/V1/Schema/SchemaVersionPage.php b/app/api/Twilio/Rest/Events/V1/Schema/SchemaVersionPage.php new file mode 100755 index 0000000..0735412 --- /dev/null +++ b/app/api/Twilio/Rest/Events/V1/Schema/SchemaVersionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SchemaVersionInstance \Twilio\Rest\Events\V1\Schema\SchemaVersionInstance + */ + public function buildInstance(array $payload): SchemaVersionInstance + { + return new SchemaVersionInstance($this->version, $payload, $this->solution['id']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Events.V1.SchemaVersionPage]'; + } +} diff --git a/app/api/Twilio/Rest/Events/V1/SchemaContext.php b/app/api/Twilio/Rest/Events/V1/SchemaContext.php new file mode 100755 index 0000000..e1a9fa0 --- /dev/null +++ b/app/api/Twilio/Rest/Events/V1/SchemaContext.php @@ -0,0 +1,139 @@ +solution = [ + 'id' => + $id, + ]; + + $this->uri = '/Schemas/' . \rawurlencode($id) + .''; + } + + /** + * Fetch the SchemaInstance + * + * @return SchemaInstance Fetched SchemaInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SchemaInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new SchemaInstance( + $this->version, + $payload, + $this->solution['id'] + ); + } + + + /** + * Access the versions + */ + protected function getVersions(): SchemaVersionList + { + if (!$this->_versions) { + $this->_versions = new SchemaVersionList( + $this->version, + $this->solution['id'] + ); + } + + return $this->_versions; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Events.V1.SchemaContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Events/V1/SchemaInstance.php b/app/api/Twilio/Rest/Events/V1/SchemaInstance.php new file mode 100755 index 0000000..a0a3850 --- /dev/null +++ b/app/api/Twilio/Rest/Events/V1/SchemaInstance.php @@ -0,0 +1,135 @@ +properties = [ + 'id' => Values::array_get($payload, 'id'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + 'latestVersionDateCreated' => Deserialize::dateTime(Values::array_get($payload, 'latest_version_date_created')), + 'latestVersion' => Values::array_get($payload, 'latest_version'), + ]; + + $this->solution = ['id' => $id ?: $this->properties['id'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SchemaContext Context for this SchemaInstance + */ + protected function proxy(): SchemaContext + { + if (!$this->context) { + $this->context = new SchemaContext( + $this->version, + $this->solution['id'] + ); + } + + return $this->context; + } + + /** + * Fetch the SchemaInstance + * + * @return SchemaInstance Fetched SchemaInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SchemaInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the versions + */ + protected function getVersions(): SchemaVersionList + { + return $this->proxy()->versions; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Events.V1.SchemaInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Events/V1/SchemaList.php b/app/api/Twilio/Rest/Events/V1/SchemaList.php new file mode 100755 index 0000000..49adcf6 --- /dev/null +++ b/app/api/Twilio/Rest/Events/V1/SchemaList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a SchemaContext + * + * @param string $id The unique identifier of the schema. Each schema can have multiple versions, that share the same id. + */ + public function getContext( + string $id + + ): SchemaContext + { + return new SchemaContext( + $this->version, + $id + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Events.V1.SchemaList]'; + } +} diff --git a/app/api/Twilio/Rest/Events/V1/SchemaPage.php b/app/api/Twilio/Rest/Events/V1/SchemaPage.php new file mode 100755 index 0000000..d37fb29 --- /dev/null +++ b/app/api/Twilio/Rest/Events/V1/SchemaPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SchemaInstance \Twilio\Rest\Events\V1\SchemaInstance + */ + public function buildInstance(array $payload): SchemaInstance + { + return new SchemaInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Events.V1.SchemaPage]'; + } +} diff --git a/app/api/Twilio/Rest/Events/V1/Sink/SinkTestInstance.php b/app/api/Twilio/Rest/Events/V1/Sink/SinkTestInstance.php new file mode 100755 index 0000000..bf9d439 --- /dev/null +++ b/app/api/Twilio/Rest/Events/V1/Sink/SinkTestInstance.php @@ -0,0 +1,81 @@ +properties = [ + 'result' => Values::array_get($payload, 'result'), + ]; + + $this->solution = ['sid' => $sid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Events.V1.SinkTestInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Events/V1/Sink/SinkTestList.php b/app/api/Twilio/Rest/Events/V1/Sink/SinkTestList.php new file mode 100755 index 0000000..0fcfd87 --- /dev/null +++ b/app/api/Twilio/Rest/Events/V1/Sink/SinkTestList.php @@ -0,0 +1,77 @@ +solution = [ + 'sid' => + $sid, + + ]; + + $this->uri = '/Sinks/' . \rawurlencode($sid) + .'/Test'; + } + + /** + * Create the SinkTestInstance + * + * @return SinkTestInstance Created SinkTestInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(): SinkTestInstance + { + + $payload = $this->version->create('POST', $this->uri); + + return new SinkTestInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Events.V1.SinkTestList]'; + } +} diff --git a/app/api/Twilio/Rest/Events/V1/Sink/SinkTestPage.php b/app/api/Twilio/Rest/Events/V1/Sink/SinkTestPage.php new file mode 100755 index 0000000..bbd5bfe --- /dev/null +++ b/app/api/Twilio/Rest/Events/V1/Sink/SinkTestPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SinkTestInstance \Twilio\Rest\Events\V1\Sink\SinkTestInstance + */ + public function buildInstance(array $payload): SinkTestInstance + { + return new SinkTestInstance($this->version, $payload, $this->solution['sid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Events.V1.SinkTestPage]'; + } +} diff --git a/app/api/Twilio/Rest/Events/V1/Sink/SinkValidateInstance.php b/app/api/Twilio/Rest/Events/V1/Sink/SinkValidateInstance.php new file mode 100755 index 0000000..528dd4a --- /dev/null +++ b/app/api/Twilio/Rest/Events/V1/Sink/SinkValidateInstance.php @@ -0,0 +1,81 @@ +properties = [ + 'result' => Values::array_get($payload, 'result'), + ]; + + $this->solution = ['sid' => $sid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Events.V1.SinkValidateInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Events/V1/Sink/SinkValidateList.php b/app/api/Twilio/Rest/Events/V1/Sink/SinkValidateList.php new file mode 100755 index 0000000..e5f063a --- /dev/null +++ b/app/api/Twilio/Rest/Events/V1/Sink/SinkValidateList.php @@ -0,0 +1,84 @@ +solution = [ + 'sid' => + $sid, + + ]; + + $this->uri = '/Sinks/' . \rawurlencode($sid) + .'/Validate'; + } + + /** + * Create the SinkValidateInstance + * + * @param string $testId A 34 character string that uniquely identifies the test event for a Sink being validated. + * @return SinkValidateInstance Created SinkValidateInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $testId): SinkValidateInstance + { + + $data = Values::of([ + 'TestId' => + $testId, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new SinkValidateInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Events.V1.SinkValidateList]'; + } +} diff --git a/app/api/Twilio/Rest/Events/V1/Sink/SinkValidatePage.php b/app/api/Twilio/Rest/Events/V1/Sink/SinkValidatePage.php new file mode 100755 index 0000000..10f335e --- /dev/null +++ b/app/api/Twilio/Rest/Events/V1/Sink/SinkValidatePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SinkValidateInstance \Twilio\Rest\Events\V1\Sink\SinkValidateInstance + */ + public function buildInstance(array $payload): SinkValidateInstance + { + return new SinkValidateInstance($this->version, $payload, $this->solution['sid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Events.V1.SinkValidatePage]'; + } +} diff --git a/app/api/Twilio/Rest/Events/V1/SinkContext.php b/app/api/Twilio/Rest/Events/V1/SinkContext.php new file mode 100755 index 0000000..e48365d --- /dev/null +++ b/app/api/Twilio/Rest/Events/V1/SinkContext.php @@ -0,0 +1,195 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Sinks/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the SinkInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the SinkInstance + * + * @return SinkInstance Fetched SinkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SinkInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new SinkInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the SinkInstance + * + * @param string $description A human readable description for the Sink **This value should not contain PII.** + * @return SinkInstance Updated SinkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $description): SinkInstance + { + + $data = Values::of([ + 'Description' => + $description, + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new SinkInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the sinkTest + */ + protected function getSinkTest(): SinkTestList + { + if (!$this->_sinkTest) { + $this->_sinkTest = new SinkTestList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_sinkTest; + } + + /** + * Access the sinkValidate + */ + protected function getSinkValidate(): SinkValidateList + { + if (!$this->_sinkValidate) { + $this->_sinkValidate = new SinkValidateList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_sinkValidate; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Events.V1.SinkContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Events/V1/SinkInstance.php b/app/api/Twilio/Rest/Events/V1/SinkInstance.php new file mode 100755 index 0000000..0edd82b --- /dev/null +++ b/app/api/Twilio/Rest/Events/V1/SinkInstance.php @@ -0,0 +1,178 @@ +properties = [ + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'description' => Values::array_get($payload, 'description'), + 'sid' => Values::array_get($payload, 'sid'), + 'sinkConfiguration' => Values::array_get($payload, 'sink_configuration'), + 'sinkType' => Values::array_get($payload, 'sink_type'), + 'status' => Values::array_get($payload, 'status'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SinkContext Context for this SinkInstance + */ + protected function proxy(): SinkContext + { + if (!$this->context) { + $this->context = new SinkContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the SinkInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SinkInstance + * + * @return SinkInstance Fetched SinkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SinkInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SinkInstance + * + * @param string $description A human readable description for the Sink **This value should not contain PII.** + * @return SinkInstance Updated SinkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $description): SinkInstance + { + + return $this->proxy()->update($description); + } + + /** + * Access the sinkTest + */ + protected function getSinkTest(): SinkTestList + { + return $this->proxy()->sinkTest; + } + + /** + * Access the sinkValidate + */ + protected function getSinkValidate(): SinkValidateList + { + return $this->proxy()->sinkValidate; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Events.V1.SinkInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Events/V1/SinkList.php b/app/api/Twilio/Rest/Events/V1/SinkList.php new file mode 100755 index 0000000..922d61e --- /dev/null +++ b/app/api/Twilio/Rest/Events/V1/SinkList.php @@ -0,0 +1,202 @@ +solution = [ + ]; + + $this->uri = '/Sinks'; + } + + /** + * Create the SinkInstance + * + * @param string $description A human readable description for the Sink **This value should not contain PII.** + * @param array $sinkConfiguration The information required for Twilio to connect to the provided Sink encoded as JSON. + * @param string $sinkType + * @return SinkInstance Created SinkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $description, array $sinkConfiguration, string $sinkType): SinkInstance + { + + $data = Values::of([ + 'Description' => + $description, + 'SinkConfiguration' => + Serialize::jsonObject($sinkConfiguration), + 'SinkType' => + $sinkType, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new SinkInstance( + $this->version, + $payload + ); + } + + + /** + * Reads SinkInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return SinkInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams SinkInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SinkInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return SinkPage Page of SinkInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SinkPage + { + $options = new Values($options); + + $params = Values::of([ + 'InUse' => + Serialize::booleanToString($options['inUse']), + 'Status' => + $options['status'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SinkPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SinkInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SinkPage Page of SinkInstance + */ + public function getPage(string $targetUrl): SinkPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SinkPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SinkContext + * + * @param string $sid A 34 character string that uniquely identifies this Sink. + */ + public function getContext( + string $sid + + ): SinkContext + { + return new SinkContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Events.V1.SinkList]'; + } +} diff --git a/app/api/Twilio/Rest/Events/V1/SinkOptions.php b/app/api/Twilio/Rest/Events/V1/SinkOptions.php new file mode 100755 index 0000000..944fdc3 --- /dev/null +++ b/app/api/Twilio/Rest/Events/V1/SinkOptions.php @@ -0,0 +1,102 @@ +options['inUse'] = $inUse; + $this->options['status'] = $status; + } + + /** + * A boolean query parameter filtering the results to return sinks used/not used by a subscription. + * + * @param bool $inUse A boolean query parameter filtering the results to return sinks used/not used by a subscription. + * @return $this Fluent Builder + */ + public function setInUse(bool $inUse): self + { + $this->options['inUse'] = $inUse; + return $this; + } + + /** + * A String query parameter filtering the results by status `initialized`, `validating`, `active` or `failed`. + * + * @param string $status A String query parameter filtering the results by status `initialized`, `validating`, `active` or `failed`. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Events.V1.ReadSinkOptions ' . $options . ']'; + } +} + + diff --git a/app/api/Twilio/Rest/Events/V1/SinkPage.php b/app/api/Twilio/Rest/Events/V1/SinkPage.php new file mode 100755 index 0000000..87edc23 --- /dev/null +++ b/app/api/Twilio/Rest/Events/V1/SinkPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SinkInstance \Twilio\Rest\Events\V1\SinkInstance + */ + public function buildInstance(array $payload): SinkInstance + { + return new SinkInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Events.V1.SinkPage]'; + } +} diff --git a/app/api/Twilio/Rest/Events/V1/Subscription/SubscribedEventContext.php b/app/api/Twilio/Rest/Events/V1/Subscription/SubscribedEventContext.php new file mode 100755 index 0000000..540552f --- /dev/null +++ b/app/api/Twilio/Rest/Events/V1/Subscription/SubscribedEventContext.php @@ -0,0 +1,130 @@ +solution = [ + 'subscriptionSid' => + $subscriptionSid, + 'type' => + $type, + ]; + + $this->uri = '/Subscriptions/' . \rawurlencode($subscriptionSid) + .'/SubscribedEvents/' . \rawurlencode($type) + .''; + } + + /** + * Delete the SubscribedEventInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the SubscribedEventInstance + * + * @return SubscribedEventInstance Fetched SubscribedEventInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SubscribedEventInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new SubscribedEventInstance( + $this->version, + $payload, + $this->solution['subscriptionSid'], + $this->solution['type'] + ); + } + + + /** + * Update the SubscribedEventInstance + * + * @param array|Options $options Optional Arguments + * @return SubscribedEventInstance Updated SubscribedEventInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SubscribedEventInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'SchemaVersion' => + $options['schemaVersion'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new SubscribedEventInstance( + $this->version, + $payload, + $this->solution['subscriptionSid'], + $this->solution['type'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Events.V1.SubscribedEventContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Events/V1/Subscription/SubscribedEventInstance.php b/app/api/Twilio/Rest/Events/V1/Subscription/SubscribedEventInstance.php new file mode 100755 index 0000000..15b68b8 --- /dev/null +++ b/app/api/Twilio/Rest/Events/V1/Subscription/SubscribedEventInstance.php @@ -0,0 +1,151 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'type' => Values::array_get($payload, 'type'), + 'schemaVersion' => Values::array_get($payload, 'schema_version'), + 'subscriptionSid' => Values::array_get($payload, 'subscription_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['subscriptionSid' => $subscriptionSid, 'type' => $type ?: $this->properties['type'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SubscribedEventContext Context for this SubscribedEventInstance + */ + protected function proxy(): SubscribedEventContext + { + if (!$this->context) { + $this->context = new SubscribedEventContext( + $this->version, + $this->solution['subscriptionSid'], + $this->solution['type'] + ); + } + + return $this->context; + } + + /** + * Delete the SubscribedEventInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SubscribedEventInstance + * + * @return SubscribedEventInstance Fetched SubscribedEventInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SubscribedEventInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SubscribedEventInstance + * + * @param array|Options $options Optional Arguments + * @return SubscribedEventInstance Updated SubscribedEventInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SubscribedEventInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Events.V1.SubscribedEventInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Events/V1/Subscription/SubscribedEventList.php b/app/api/Twilio/Rest/Events/V1/Subscription/SubscribedEventList.php new file mode 100755 index 0000000..de6db0f --- /dev/null +++ b/app/api/Twilio/Rest/Events/V1/Subscription/SubscribedEventList.php @@ -0,0 +1,200 @@ +solution = [ + 'subscriptionSid' => + $subscriptionSid, + + ]; + + $this->uri = '/Subscriptions/' . \rawurlencode($subscriptionSid) + .'/SubscribedEvents'; + } + + /** + * Create the SubscribedEventInstance + * + * @param string $type Type of event being subscribed to. + * @param array|Options $options Optional Arguments + * @return SubscribedEventInstance Created SubscribedEventInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $type, array $options = []): SubscribedEventInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Type' => + $type, + 'SchemaVersion' => + $options['schemaVersion'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new SubscribedEventInstance( + $this->version, + $payload, + $this->solution['subscriptionSid'] + ); + } + + + /** + * Reads SubscribedEventInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return SubscribedEventInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams SubscribedEventInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SubscribedEventInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return SubscribedEventPage Page of SubscribedEventInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SubscribedEventPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SubscribedEventPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SubscribedEventInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SubscribedEventPage Page of SubscribedEventInstance + */ + public function getPage(string $targetUrl): SubscribedEventPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SubscribedEventPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SubscribedEventContext + * + * @param string $type Type of event being subscribed to. + */ + public function getContext( + string $type + + ): SubscribedEventContext + { + return new SubscribedEventContext( + $this->version, + $this->solution['subscriptionSid'], + $type + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Events.V1.SubscribedEventList]'; + } +} diff --git a/app/api/Twilio/Rest/Events/V1/Subscription/SubscribedEventOptions.php b/app/api/Twilio/Rest/Events/V1/Subscription/SubscribedEventOptions.php new file mode 100755 index 0000000..04c7215 --- /dev/null +++ b/app/api/Twilio/Rest/Events/V1/Subscription/SubscribedEventOptions.php @@ -0,0 +1,134 @@ +options['schemaVersion'] = $schemaVersion; + } + + /** + * The schema version that the subscription should use. + * + * @param int $schemaVersion The schema version that the subscription should use. + * @return $this Fluent Builder + */ + public function setSchemaVersion(int $schemaVersion): self + { + $this->options['schemaVersion'] = $schemaVersion; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Events.V1.CreateSubscribedEventOptions ' . $options . ']'; + } +} + + + + +class UpdateSubscribedEventOptions extends Options + { + /** + * @param int $schemaVersion The schema version that the subscription should use. + */ + public function __construct( + + int $schemaVersion = Values::INT_NONE + + ) { + $this->options['schemaVersion'] = $schemaVersion; + } + + /** + * The schema version that the subscription should use. + * + * @param int $schemaVersion The schema version that the subscription should use. + * @return $this Fluent Builder + */ + public function setSchemaVersion(int $schemaVersion): self + { + $this->options['schemaVersion'] = $schemaVersion; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Events.V1.UpdateSubscribedEventOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Events/V1/Subscription/SubscribedEventPage.php b/app/api/Twilio/Rest/Events/V1/Subscription/SubscribedEventPage.php new file mode 100755 index 0000000..5ffe691 --- /dev/null +++ b/app/api/Twilio/Rest/Events/V1/Subscription/SubscribedEventPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SubscribedEventInstance \Twilio\Rest\Events\V1\Subscription\SubscribedEventInstance + */ + public function buildInstance(array $payload): SubscribedEventInstance + { + return new SubscribedEventInstance($this->version, $payload, $this->solution['subscriptionSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Events.V1.SubscribedEventPage]'; + } +} diff --git a/app/api/Twilio/Rest/Events/V1/SubscriptionContext.php b/app/api/Twilio/Rest/Events/V1/SubscriptionContext.php new file mode 100755 index 0000000..23e2427 --- /dev/null +++ b/app/api/Twilio/Rest/Events/V1/SubscriptionContext.php @@ -0,0 +1,183 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Subscriptions/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the SubscriptionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the SubscriptionInstance + * + * @return SubscriptionInstance Fetched SubscriptionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SubscriptionInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new SubscriptionInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the SubscriptionInstance + * + * @param array|Options $options Optional Arguments + * @return SubscriptionInstance Updated SubscriptionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SubscriptionInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Description' => + $options['description'], + 'SinkSid' => + $options['sinkSid'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new SubscriptionInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the subscribedEvents + */ + protected function getSubscribedEvents(): SubscribedEventList + { + if (!$this->_subscribedEvents) { + $this->_subscribedEvents = new SubscribedEventList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_subscribedEvents; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Events.V1.SubscriptionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Events/V1/SubscriptionInstance.php b/app/api/Twilio/Rest/Events/V1/SubscriptionInstance.php new file mode 100755 index 0000000..6afd8a5 --- /dev/null +++ b/app/api/Twilio/Rest/Events/V1/SubscriptionInstance.php @@ -0,0 +1,167 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'description' => Values::array_get($payload, 'description'), + 'sinkSid' => Values::array_get($payload, 'sink_sid'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SubscriptionContext Context for this SubscriptionInstance + */ + protected function proxy(): SubscriptionContext + { + if (!$this->context) { + $this->context = new SubscriptionContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the SubscriptionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SubscriptionInstance + * + * @return SubscriptionInstance Fetched SubscriptionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SubscriptionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SubscriptionInstance + * + * @param array|Options $options Optional Arguments + * @return SubscriptionInstance Updated SubscriptionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SubscriptionInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the subscribedEvents + */ + protected function getSubscribedEvents(): SubscribedEventList + { + return $this->proxy()->subscribedEvents; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Events.V1.SubscriptionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Events/V1/SubscriptionList.php b/app/api/Twilio/Rest/Events/V1/SubscriptionList.php new file mode 100755 index 0000000..44214d7 --- /dev/null +++ b/app/api/Twilio/Rest/Events/V1/SubscriptionList.php @@ -0,0 +1,200 @@ +solution = [ + ]; + + $this->uri = '/Subscriptions'; + } + + /** + * Create the SubscriptionInstance + * + * @param string $description A human readable description for the Subscription **This value should not contain PII.** + * @param string $sinkSid The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. + * @param array[] $types An array of objects containing the subscribed Event Types + * @return SubscriptionInstance Created SubscriptionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $description, string $sinkSid, array $types): SubscriptionInstance + { + + $data = Values::of([ + 'Description' => + $description, + 'SinkSid' => + $sinkSid, + 'Types' => + Serialize::map($types,function ($e) { return Serialize::jsonObject($e); }), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new SubscriptionInstance( + $this->version, + $payload + ); + } + + + /** + * Reads SubscriptionInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return SubscriptionInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams SubscriptionInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SubscriptionInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return SubscriptionPage Page of SubscriptionInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SubscriptionPage + { + $options = new Values($options); + + $params = Values::of([ + 'SinkSid' => + $options['sinkSid'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SubscriptionPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SubscriptionInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SubscriptionPage Page of SubscriptionInstance + */ + public function getPage(string $targetUrl): SubscriptionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SubscriptionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SubscriptionContext + * + * @param string $sid A 34 character string that uniquely identifies this Subscription. + */ + public function getContext( + string $sid + + ): SubscriptionContext + { + return new SubscriptionContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Events.V1.SubscriptionList]'; + } +} diff --git a/app/api/Twilio/Rest/Events/V1/SubscriptionOptions.php b/app/api/Twilio/Rest/Events/V1/SubscriptionOptions.php new file mode 100755 index 0000000..4eaf325 --- /dev/null +++ b/app/api/Twilio/Rest/Events/V1/SubscriptionOptions.php @@ -0,0 +1,152 @@ +options['sinkSid'] = $sinkSid; + } + + /** + * The SID of the sink that the list of Subscriptions should be filtered by. + * + * @param string $sinkSid The SID of the sink that the list of Subscriptions should be filtered by. + * @return $this Fluent Builder + */ + public function setSinkSid(string $sinkSid): self + { + $this->options['sinkSid'] = $sinkSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Events.V1.ReadSubscriptionOptions ' . $options . ']'; + } +} + +class UpdateSubscriptionOptions extends Options + { + /** + * @param string $description A human readable description for the Subscription. + * @param string $sinkSid The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. + */ + public function __construct( + + string $description = Values::NONE, + string $sinkSid = Values::NONE + + ) { + $this->options['description'] = $description; + $this->options['sinkSid'] = $sinkSid; + } + + /** + * A human readable description for the Subscription. + * + * @param string $description A human readable description for the Subscription. + * @return $this Fluent Builder + */ + public function setDescription(string $description): self + { + $this->options['description'] = $description; + return $this; + } + + /** + * The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. + * + * @param string $sinkSid The SID of the sink that events selected by this subscription should be sent to. Sink must be active for the subscription to be created. + * @return $this Fluent Builder + */ + public function setSinkSid(string $sinkSid): self + { + $this->options['sinkSid'] = $sinkSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Events.V1.UpdateSubscriptionOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Events/V1/SubscriptionPage.php b/app/api/Twilio/Rest/Events/V1/SubscriptionPage.php new file mode 100755 index 0000000..fe7d211 --- /dev/null +++ b/app/api/Twilio/Rest/Events/V1/SubscriptionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SubscriptionInstance \Twilio\Rest\Events\V1\SubscriptionInstance + */ + public function buildInstance(array $payload): SubscriptionInstance + { + return new SubscriptionInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Events.V1.SubscriptionPage]'; + } +} diff --git a/app/api/Twilio/Rest/EventsBase.php b/app/api/Twilio/Rest/EventsBase.php new file mode 100755 index 0000000..98388a2 --- /dev/null +++ b/app/api/Twilio/Rest/EventsBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://events.twilio.com'; + } + + + /** + * @return V1 Version v1 of events + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Events]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi.php b/app/api/Twilio/Rest/FlexApi.php new file mode 100755 index 0000000..0feb53b --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi.php @@ -0,0 +1,118 @@ +assessments instead. + */ + protected function getAssessments(): \Twilio\Rest\FlexApi\V1\AssessmentsList { + echo "assessments is deprecated. Use v1->assessments instead."; + return $this->v1->assessments; + } + + /** + * @deprecated Use v1->assessments() instead. + */ + protected function contextAssessments(): \Twilio\Rest\FlexApi\V1\AssessmentsContext { + echo "assessments() is deprecated. Use v1->assessments() instead."; + return $this->v1->assessments(); + } + + /** + * @deprecated Use v1->channel instead. + */ + protected function getChannel(): \Twilio\Rest\FlexApi\V1\ChannelList { + echo "channel is deprecated. Use v1->channel instead."; + return $this->v1->channel; + } + + /** + * @deprecated Use v1->channel(\$sid) instead. + * @param string $sid The SID that identifies the Flex chat channel resource to + * fetch + */ + protected function contextChannel(string $sid): \Twilio\Rest\FlexApi\V1\ChannelContext { + echo "channel(\$sid) is deprecated. Use v1->channel(\$sid) instead."; + return $this->v1->channel($sid); + } + + /** + * @deprecated Use v1->configuration instead. + */ + protected function getConfiguration(): \Twilio\Rest\FlexApi\V1\ConfigurationList { + echo "configuration is deprecated. Use v1->configuration instead."; + return $this->v1->configuration; + } + + /** + * @deprecated Use v1->configuration() instead. + */ + protected function contextConfiguration(): \Twilio\Rest\FlexApi\V1\ConfigurationContext { + echo "configuration() is deprecated. Use v1->configuration() instead."; + return $this->v1->configuration(); + } + + /** + * @deprecated Use v1->flexFlow instead. + */ + protected function getFlexFlow(): \Twilio\Rest\FlexApi\V1\FlexFlowList { + echo "flexFlow is deprecated. Use v1->flexFlow instead."; + return $this->v1->flexFlow; + } + + /** + * @deprecated Use v1->flexFlow(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextFlexFlow(string $sid): \Twilio\Rest\FlexApi\V1\FlexFlowContext { + echo "flexFlow(\$sid) is deprecated. Use v1->flexFlow(\$sid) instead."; + return $this->v1->flexFlow($sid); + } + + /** + * @deprecated Use v1->interaction instead. + */ + protected function getInteraction(): \Twilio\Rest\FlexApi\V1\InteractionList { + echo "interaction is deprecated. Use v1->interaction instead."; + return $this->v1->interaction; + } + + /** + * @deprecated Use v1->interaction(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextInteraction(string $sid): \Twilio\Rest\FlexApi\V1\InteractionContext { + echo "interaction(\$sid) is deprecated. Use v1->interaction(\$sid) instead."; + return $this->v1->interaction($sid); + } + + /** + * @deprecated Use v1->webChannel instead. + */ + protected function getWebChannel(): \Twilio\Rest\FlexApi\V1\WebChannelList { + echo "webChannel is deprecated. Use v1->webChannel instead."; + return $this->v1->webChannel; + } + + /** + * @deprecated Use v1->webChannel(\$sid) instead. + * @param string $sid The SID of the WebChannel resource to fetch + */ + protected function contextWebChannel(string $sid): \Twilio\Rest\FlexApi\V1\WebChannelContext { + echo "webChannel(\$sid) is deprecated. Use v1->webChannel(\$sid) instead."; + return $this->v1->webChannel($sid); + } + + /** + * @deprecated Use v2->webChannels instead. + */ + protected function getWebChannels(): \Twilio\Rest\FlexApi\V2\WebChannelsList { + echo "webChannels is deprecated. Use v2->webChannels instead."; + return $this->v2->webChannels; + } +} \ No newline at end of file diff --git a/app/api/Twilio/Rest/FlexApi/V1.php b/app/api/Twilio/Rest/FlexApi/V1.php new file mode 100755 index 0000000..791688d --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1.php @@ -0,0 +1,268 @@ +version = 'v1'; + } + + protected function getAssessments(): AssessmentsList + { + if (!$this->_assessments) { + $this->_assessments = new AssessmentsList($this); + } + return $this->_assessments; + } + + protected function getChannel(): ChannelList + { + if (!$this->_channel) { + $this->_channel = new ChannelList($this); + } + return $this->_channel; + } + + protected function getConfiguration(): ConfigurationList + { + if (!$this->_configuration) { + $this->_configuration = new ConfigurationList($this); + } + return $this->_configuration; + } + + protected function getFlexFlow(): FlexFlowList + { + if (!$this->_flexFlow) { + $this->_flexFlow = new FlexFlowList($this); + } + return $this->_flexFlow; + } + + protected function getInsightsAssessmentsComment(): InsightsAssessmentsCommentList + { + if (!$this->_insightsAssessmentsComment) { + $this->_insightsAssessmentsComment = new InsightsAssessmentsCommentList($this); + } + return $this->_insightsAssessmentsComment; + } + + protected function getInsightsConversations(): InsightsConversationsList + { + if (!$this->_insightsConversations) { + $this->_insightsConversations = new InsightsConversationsList($this); + } + return $this->_insightsConversations; + } + + protected function getInsightsQuestionnaires(): InsightsQuestionnairesList + { + if (!$this->_insightsQuestionnaires) { + $this->_insightsQuestionnaires = new InsightsQuestionnairesList($this); + } + return $this->_insightsQuestionnaires; + } + + protected function getInsightsQuestionnairesCategory(): InsightsQuestionnairesCategoryList + { + if (!$this->_insightsQuestionnairesCategory) { + $this->_insightsQuestionnairesCategory = new InsightsQuestionnairesCategoryList($this); + } + return $this->_insightsQuestionnairesCategory; + } + + protected function getInsightsQuestionnairesQuestion(): InsightsQuestionnairesQuestionList + { + if (!$this->_insightsQuestionnairesQuestion) { + $this->_insightsQuestionnairesQuestion = new InsightsQuestionnairesQuestionList($this); + } + return $this->_insightsQuestionnairesQuestion; + } + + protected function getInsightsSegments(): InsightsSegmentsList + { + if (!$this->_insightsSegments) { + $this->_insightsSegments = new InsightsSegmentsList($this); + } + return $this->_insightsSegments; + } + + protected function getInsightsSession(): InsightsSessionList + { + if (!$this->_insightsSession) { + $this->_insightsSession = new InsightsSessionList($this); + } + return $this->_insightsSession; + } + + protected function getInsightsSettingsAnswerSets(): InsightsSettingsAnswerSetsList + { + if (!$this->_insightsSettingsAnswerSets) { + $this->_insightsSettingsAnswerSets = new InsightsSettingsAnswerSetsList($this); + } + return $this->_insightsSettingsAnswerSets; + } + + protected function getInsightsSettingsComment(): InsightsSettingsCommentList + { + if (!$this->_insightsSettingsComment) { + $this->_insightsSettingsComment = new InsightsSettingsCommentList($this); + } + return $this->_insightsSettingsComment; + } + + protected function getInsightsUserRoles(): InsightsUserRolesList + { + if (!$this->_insightsUserRoles) { + $this->_insightsUserRoles = new InsightsUserRolesList($this); + } + return $this->_insightsUserRoles; + } + + protected function getInteraction(): InteractionList + { + if (!$this->_interaction) { + $this->_interaction = new InteractionList($this); + } + return $this->_interaction; + } + + protected function getWebChannel(): WebChannelList + { + if (!$this->_webChannel) { + $this->_webChannel = new WebChannelList($this); + } + return $this->_webChannel; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/AssessmentsContext.php b/app/api/Twilio/Rest/FlexApi/V1/AssessmentsContext.php new file mode 100755 index 0000000..2316faf --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/AssessmentsContext.php @@ -0,0 +1,100 @@ +solution = [ + 'assessmentId' => + $assessmentId, + ]; + + $this->uri = '/Insights/QM/Assessments/' . \rawurlencode($assessmentId) + .''; + } + + /** + * Update the AssessmentsInstance + * + * @param string $offset The offset of the conversation + * @param string $answerText The answer text selected by user + * @param string $answerId The id of the answer selected by user + * @param array|Options $options Optional Arguments + * @return AssessmentsInstance Updated AssessmentsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $offset, string $answerText, string $answerId, array $options = []): AssessmentsInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Offset' => + $offset, + 'AnswerText' => + $answerText, + 'AnswerId' => + $answerId, + ]); + + $headers = Values::of(['Token' => $options['token']]); + + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new AssessmentsInstance( + $this->version, + $payload, + $this->solution['assessmentId'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.AssessmentsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/AssessmentsInstance.php b/app/api/Twilio/Rest/FlexApi/V1/AssessmentsInstance.php new file mode 100755 index 0000000..8953046 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/AssessmentsInstance.php @@ -0,0 +1,146 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'assessmentId' => Values::array_get($payload, 'assessment_id'), + 'offset' => Values::array_get($payload, 'offset'), + 'report' => Values::array_get($payload, 'report'), + 'weight' => Values::array_get($payload, 'weight'), + 'agentId' => Values::array_get($payload, 'agent_id'), + 'segmentId' => Values::array_get($payload, 'segment_id'), + 'userName' => Values::array_get($payload, 'user_name'), + 'userEmail' => Values::array_get($payload, 'user_email'), + 'answerText' => Values::array_get($payload, 'answer_text'), + 'answerId' => Values::array_get($payload, 'answer_id'), + 'assessment' => Values::array_get($payload, 'assessment'), + 'timestamp' => Values::array_get($payload, 'timestamp'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['assessmentId' => $assessmentId ?: $this->properties['assessmentId'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AssessmentsContext Context for this AssessmentsInstance + */ + protected function proxy(): AssessmentsContext + { + if (!$this->context) { + $this->context = new AssessmentsContext( + $this->version, + $this->solution['assessmentId'] + ); + } + + return $this->context; + } + + /** + * Update the AssessmentsInstance + * + * @param string $offset The offset of the conversation + * @param string $answerText The answer text selected by user + * @param string $answerId The id of the answer selected by user + * @param array|Options $options Optional Arguments + * @return AssessmentsInstance Updated AssessmentsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $offset, string $answerText, string $answerId, array $options = []): AssessmentsInstance + { + + return $this->proxy()->update($offset, $answerText, $answerId, $options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.AssessmentsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/FlexApi/V1/AssessmentsList.php b/app/api/Twilio/Rest/FlexApi/V1/AssessmentsList.php new file mode 100755 index 0000000..8b4f840 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/AssessmentsList.php @@ -0,0 +1,233 @@ +solution = [ + ]; + + $this->uri = '/Insights/QM/Assessments'; + } + + /** + * Create the AssessmentsInstance + * + * @param string $categoryId The id of the category + * @param string $categoryName The name of the category + * @param string $segmentId Segment Id of the conversation + * @param string $userName Name of the user assessing conversation + * @param string $userEmail Email of the user assessing conversation + * @param string $agentId The id of the Agent + * @param string $offset The offset of the conversation. + * @param string $metricId The question Id selected for assessment + * @param string $metricName The question name of the assessment + * @param string $answerText The answer text selected by user + * @param string $answerId The id of the answer selected by user + * @param string $questionnaireId Questionnaire Id of the associated question + * @param array|Options $options Optional Arguments + * @return AssessmentsInstance Created AssessmentsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $categoryId, string $categoryName, string $segmentId, string $userName, string $userEmail, string $agentId, string $offset, string $metricId, string $metricName, string $answerText, string $answerId, string $questionnaireId, array $options = []): AssessmentsInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'CategoryId' => + $categoryId, + 'CategoryName' => + $categoryName, + 'SegmentId' => + $segmentId, + 'UserName' => + $userName, + 'UserEmail' => + $userEmail, + 'AgentId' => + $agentId, + 'Offset' => + $offset, + 'MetricId' => + $metricId, + 'MetricName' => + $metricName, + 'AnswerText' => + $answerText, + 'AnswerId' => + $answerId, + 'QuestionnaireId' => + $questionnaireId, + ]); + + $headers = Values::of(['Token' => $options['token']]); + + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new AssessmentsInstance( + $this->version, + $payload + ); + } + + + /** + * Reads AssessmentsInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return AssessmentsInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams AssessmentsInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AssessmentsInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return AssessmentsPage Page of AssessmentsInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AssessmentsPage + { + $options = new Values($options); + + $params = Values::of([ + 'SegmentId' => + $options['segmentId'], + 'Token' => + $options['token'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new AssessmentsPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of AssessmentsInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return AssessmentsPage Page of AssessmentsInstance + */ + public function getPage(string $targetUrl): AssessmentsPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AssessmentsPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AssessmentsContext + * + * @param string $assessmentId The id of the assessment to be modified + */ + public function getContext( + string $assessmentId + + ): AssessmentsContext + { + return new AssessmentsContext( + $this->version, + $assessmentId + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.AssessmentsList]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/AssessmentsOptions.php b/app/api/Twilio/Rest/FlexApi/V1/AssessmentsOptions.php new file mode 100755 index 0000000..48caa08 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/AssessmentsOptions.php @@ -0,0 +1,198 @@ +options['token'] = $token; + } + + /** + * The Token HTTP request header + * + * @param string $token The Token HTTP request header + * @return $this Fluent Builder + */ + public function setToken(string $token): self + { + $this->options['token'] = $token; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.CreateAssessmentsOptions ' . $options . ']'; + } +} + +class ReadAssessmentsOptions extends Options + { + /** + * @param string $segmentId The id of the segment. + * @param string $token The Token HTTP request header + */ + public function __construct( + + string $segmentId = Values::NONE, + string $token = Values::NONE + + ) { + $this->options['segmentId'] = $segmentId; + $this->options['token'] = $token; + } + + /** + * The id of the segment. + * + * @param string $segmentId The id of the segment. + * @return $this Fluent Builder + */ + public function setSegmentId(string $segmentId): self + { + $this->options['segmentId'] = $segmentId; + return $this; + } + + /** + * The Token HTTP request header + * + * @param string $token The Token HTTP request header + * @return $this Fluent Builder + */ + public function setToken(string $token): self + { + $this->options['token'] = $token; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.ReadAssessmentsOptions ' . $options . ']'; + } +} + +class UpdateAssessmentsOptions extends Options + { + /** + * @param string $token The Token HTTP request header + */ + public function __construct( + + string $token = Values::NONE + + ) { + $this->options['token'] = $token; + } + + /** + * The Token HTTP request header + * + * @param string $token The Token HTTP request header + * @return $this Fluent Builder + */ + public function setToken(string $token): self + { + $this->options['token'] = $token; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.UpdateAssessmentsOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/FlexApi/V1/AssessmentsPage.php b/app/api/Twilio/Rest/FlexApi/V1/AssessmentsPage.php new file mode 100755 index 0000000..dbe0931 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/AssessmentsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AssessmentsInstance \Twilio\Rest\FlexApi\V1\AssessmentsInstance + */ + public function buildInstance(array $payload): AssessmentsInstance + { + return new AssessmentsInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.AssessmentsPage]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/ChannelContext.php b/app/api/Twilio/Rest/FlexApi/V1/ChannelContext.php new file mode 100755 index 0000000..279dba5 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/ChannelContext.php @@ -0,0 +1,94 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Channels/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ChannelInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the ChannelInstance + * + * @return ChannelInstance Fetched ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ChannelInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ChannelInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.ChannelContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/ChannelInstance.php b/app/api/Twilio/Rest/FlexApi/V1/ChannelInstance.php new file mode 100755 index 0000000..a5d0767 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/ChannelInstance.php @@ -0,0 +1,142 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'flexFlowSid' => Values::array_get($payload, 'flex_flow_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'userSid' => Values::array_get($payload, 'user_sid'), + 'taskSid' => Values::array_get($payload, 'task_sid'), + 'url' => Values::array_get($payload, 'url'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ChannelContext Context for this ChannelInstance + */ + protected function proxy(): ChannelContext + { + if (!$this->context) { + $this->context = new ChannelContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ChannelInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ChannelInstance + * + * @return ChannelInstance Fetched ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ChannelInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.ChannelInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/FlexApi/V1/ChannelList.php b/app/api/Twilio/Rest/FlexApi/V1/ChannelList.php new file mode 100755 index 0000000..9f50190 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/ChannelList.php @@ -0,0 +1,212 @@ +solution = [ + ]; + + $this->uri = '/Channels'; + } + + /** + * Create the ChannelInstance + * + * @param string $flexFlowSid The SID of the Flex Flow. + * @param string $identity The `identity` value that uniquely identifies the new resource's chat User. + * @param string $chatUserFriendlyName The chat participant's friendly name. + * @param string $chatFriendlyName The chat channel's friendly name. + * @param array|Options $options Optional Arguments + * @return ChannelInstance Created ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $flexFlowSid, string $identity, string $chatUserFriendlyName, string $chatFriendlyName, array $options = []): ChannelInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FlexFlowSid' => + $flexFlowSid, + 'Identity' => + $identity, + 'ChatUserFriendlyName' => + $chatUserFriendlyName, + 'ChatFriendlyName' => + $chatFriendlyName, + 'Target' => + $options['target'], + 'ChatUniqueName' => + $options['chatUniqueName'], + 'PreEngagementData' => + $options['preEngagementData'], + 'TaskSid' => + $options['taskSid'], + 'TaskAttributes' => + $options['taskAttributes'], + 'LongLived' => + Serialize::booleanToString($options['longLived']), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new ChannelInstance( + $this->version, + $payload + ); + } + + + /** + * Reads ChannelInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ChannelInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ChannelInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ChannelInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ChannelPage Page of ChannelInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ChannelPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ChannelPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ChannelInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ChannelPage Page of ChannelInstance + */ + public function getPage(string $targetUrl): ChannelPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ChannelPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ChannelContext + * + * @param string $sid The SID of the Flex chat channel resource to delete. + */ + public function getContext( + string $sid + + ): ChannelContext + { + return new ChannelContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.ChannelList]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/ChannelOptions.php b/app/api/Twilio/Rest/FlexApi/V1/ChannelOptions.php new file mode 100755 index 0000000..f314839 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/ChannelOptions.php @@ -0,0 +1,172 @@ +options['target'] = $target; + $this->options['chatUniqueName'] = $chatUniqueName; + $this->options['preEngagementData'] = $preEngagementData; + $this->options['taskSid'] = $taskSid; + $this->options['taskAttributes'] = $taskAttributes; + $this->options['longLived'] = $longLived; + } + + /** + * The Target Contact Identity, for example the phone number of an SMS. + * + * @param string $target The Target Contact Identity, for example the phone number of an SMS. + * @return $this Fluent Builder + */ + public function setTarget(string $target): self + { + $this->options['target'] = $target; + return $this; + } + + /** + * The chat channel's unique name. + * + * @param string $chatUniqueName The chat channel's unique name. + * @return $this Fluent Builder + */ + public function setChatUniqueName(string $chatUniqueName): self + { + $this->options['chatUniqueName'] = $chatUniqueName; + return $this; + } + + /** + * The pre-engagement data. + * + * @param string $preEngagementData The pre-engagement data. + * @return $this Fluent Builder + */ + public function setPreEngagementData(string $preEngagementData): self + { + $this->options['preEngagementData'] = $preEngagementData; + return $this; + } + + /** + * The SID of the TaskRouter Task. Only valid when integration type is `task`. `null` for integration types `studio` & `external` + * + * @param string $taskSid The SID of the TaskRouter Task. Only valid when integration type is `task`. `null` for integration types `studio` & `external` + * @return $this Fluent Builder + */ + public function setTaskSid(string $taskSid): self + { + $this->options['taskSid'] = $taskSid; + return $this; + } + + /** + * The Task attributes to be added for the TaskRouter Task. + * + * @param string $taskAttributes The Task attributes to be added for the TaskRouter Task. + * @return $this Fluent Builder + */ + public function setTaskAttributes(string $taskAttributes): self + { + $this->options['taskAttributes'] = $taskAttributes; + return $this; + } + + /** + * Whether to create the channel as long-lived. + * + * @param bool $longLived Whether to create the channel as long-lived. + * @return $this Fluent Builder + */ + public function setLongLived(bool $longLived): self + { + $this->options['longLived'] = $longLived; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.CreateChannelOptions ' . $options . ']'; + } +} + + + + diff --git a/app/api/Twilio/Rest/FlexApi/V1/ChannelPage.php b/app/api/Twilio/Rest/FlexApi/V1/ChannelPage.php new file mode 100755 index 0000000..14be074 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/ChannelPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ChannelInstance \Twilio\Rest\FlexApi\V1\ChannelInstance + */ + public function buildInstance(array $payload): ChannelInstance + { + return new ChannelInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.ChannelPage]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/ConfigurationContext.php b/app/api/Twilio/Rest/FlexApi/V1/ConfigurationContext.php new file mode 100755 index 0000000..04b2ff2 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/ConfigurationContext.php @@ -0,0 +1,85 @@ +solution = [ + ]; + + $this->uri = '/Configuration'; + } + + /** + * Fetch the ConfigurationInstance + * + * @param array|Options $options Optional Arguments + * @return ConfigurationInstance Fetched ConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): ConfigurationInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'UiVersion' => + $options['uiVersion'], + ]); + + $payload = $this->version->fetch('GET', $this->uri, $params); + + return new ConfigurationInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.ConfigurationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/ConfigurationInstance.php b/app/api/Twilio/Rest/FlexApi/V1/ConfigurationInstance.php new file mode 100755 index 0000000..796fb93 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/ConfigurationInstance.php @@ -0,0 +1,204 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'attributes' => Values::array_get($payload, 'attributes'), + 'status' => Values::array_get($payload, 'status'), + 'taskrouterWorkspaceSid' => Values::array_get($payload, 'taskrouter_workspace_sid'), + 'taskrouterTargetWorkflowSid' => Values::array_get($payload, 'taskrouter_target_workflow_sid'), + 'taskrouterTargetTaskqueueSid' => Values::array_get($payload, 'taskrouter_target_taskqueue_sid'), + 'taskrouterTaskqueues' => Values::array_get($payload, 'taskrouter_taskqueues'), + 'taskrouterSkills' => Values::array_get($payload, 'taskrouter_skills'), + 'taskrouterWorkerChannels' => Values::array_get($payload, 'taskrouter_worker_channels'), + 'taskrouterWorkerAttributes' => Values::array_get($payload, 'taskrouter_worker_attributes'), + 'taskrouterOfflineActivitySid' => Values::array_get($payload, 'taskrouter_offline_activity_sid'), + 'runtimeDomain' => Values::array_get($payload, 'runtime_domain'), + 'messagingServiceInstanceSid' => Values::array_get($payload, 'messaging_service_instance_sid'), + 'chatServiceInstanceSid' => Values::array_get($payload, 'chat_service_instance_sid'), + 'flexServiceInstanceSid' => Values::array_get($payload, 'flex_service_instance_sid'), + 'uiLanguage' => Values::array_get($payload, 'ui_language'), + 'uiAttributes' => Values::array_get($payload, 'ui_attributes'), + 'uiDependencies' => Values::array_get($payload, 'ui_dependencies'), + 'uiVersion' => Values::array_get($payload, 'ui_version'), + 'serviceVersion' => Values::array_get($payload, 'service_version'), + 'callRecordingEnabled' => Values::array_get($payload, 'call_recording_enabled'), + 'callRecordingWebhookUrl' => Values::array_get($payload, 'call_recording_webhook_url'), + 'crmEnabled' => Values::array_get($payload, 'crm_enabled'), + 'crmType' => Values::array_get($payload, 'crm_type'), + 'crmCallbackUrl' => Values::array_get($payload, 'crm_callback_url'), + 'crmFallbackUrl' => Values::array_get($payload, 'crm_fallback_url'), + 'crmAttributes' => Values::array_get($payload, 'crm_attributes'), + 'publicAttributes' => Values::array_get($payload, 'public_attributes'), + 'pluginServiceEnabled' => Values::array_get($payload, 'plugin_service_enabled'), + 'pluginServiceAttributes' => Values::array_get($payload, 'plugin_service_attributes'), + 'integrations' => Values::array_get($payload, 'integrations'), + 'outboundCallFlows' => Values::array_get($payload, 'outbound_call_flows'), + 'serverlessServiceSids' => Values::array_get($payload, 'serverless_service_sids'), + 'queueStatsConfiguration' => Values::array_get($payload, 'queue_stats_configuration'), + 'notifications' => Values::array_get($payload, 'notifications'), + 'markdown' => Values::array_get($payload, 'markdown'), + 'url' => Values::array_get($payload, 'url'), + 'flexInsightsHr' => Values::array_get($payload, 'flex_insights_hr'), + 'flexInsightsDrilldown' => Values::array_get($payload, 'flex_insights_drilldown'), + 'flexUrl' => Values::array_get($payload, 'flex_url'), + 'channelConfigs' => Values::array_get($payload, 'channel_configs'), + 'debuggerIntegration' => Values::array_get($payload, 'debugger_integration'), + 'flexUiStatusReport' => Values::array_get($payload, 'flex_ui_status_report'), + ]; + + $this->solution = []; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ConfigurationContext Context for this ConfigurationInstance + */ + protected function proxy(): ConfigurationContext + { + if (!$this->context) { + $this->context = new ConfigurationContext( + $this->version + ); + } + + return $this->context; + } + + /** + * Fetch the ConfigurationInstance + * + * @param array|Options $options Optional Arguments + * @return ConfigurationInstance Fetched ConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): ConfigurationInstance + { + + return $this->proxy()->fetch($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.ConfigurationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/FlexApi/V1/ConfigurationList.php b/app/api/Twilio/Rest/FlexApi/V1/ConfigurationList.php new file mode 100755 index 0000000..cee952e --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/ConfigurationList.php @@ -0,0 +1,61 @@ +solution = [ + ]; + } + + /** + * Constructs a ConfigurationContext + */ + public function getContext( + + ): ConfigurationContext + { + return new ConfigurationContext( + $this->version + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.ConfigurationList]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/ConfigurationOptions.php b/app/api/Twilio/Rest/FlexApi/V1/ConfigurationOptions.php new file mode 100755 index 0000000..00c5537 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/ConfigurationOptions.php @@ -0,0 +1,76 @@ +options['uiVersion'] = $uiVersion; + } + + /** + * The Pinned UI version of the Configuration resource to fetch. + * + * @param string $uiVersion The Pinned UI version of the Configuration resource to fetch. + * @return $this Fluent Builder + */ + public function setUiVersion(string $uiVersion): self + { + $this->options['uiVersion'] = $uiVersion; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.FetchConfigurationOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/FlexApi/V1/ConfigurationPage.php b/app/api/Twilio/Rest/FlexApi/V1/ConfigurationPage.php new file mode 100755 index 0000000..530f24e --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/ConfigurationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ConfigurationInstance \Twilio\Rest\FlexApi\V1\ConfigurationInstance + */ + public function buildInstance(array $payload): ConfigurationInstance + { + return new ConfigurationInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.ConfigurationPage]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/FlexFlowContext.php b/app/api/Twilio/Rest/FlexApi/V1/FlexFlowContext.php new file mode 100755 index 0000000..4e90ec4 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/FlexFlowContext.php @@ -0,0 +1,156 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/FlexFlows/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the FlexFlowInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the FlexFlowInstance + * + * @return FlexFlowInstance Fetched FlexFlowInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FlexFlowInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new FlexFlowInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the FlexFlowInstance + * + * @param array|Options $options Optional Arguments + * @return FlexFlowInstance Updated FlexFlowInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): FlexFlowInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'ChatServiceSid' => + $options['chatServiceSid'], + 'ChannelType' => + $options['channelType'], + 'ContactIdentity' => + $options['contactIdentity'], + 'Enabled' => + Serialize::booleanToString($options['enabled']), + 'IntegrationType' => + $options['integrationType'], + 'Integration.FlowSid' => + $options['integrationFlowSid'], + 'Integration.Url' => + $options['integrationUrl'], + 'Integration.WorkspaceSid' => + $options['integrationWorkspaceSid'], + 'Integration.WorkflowSid' => + $options['integrationWorkflowSid'], + 'Integration.Channel' => + $options['integrationChannel'], + 'Integration.Timeout' => + $options['integrationTimeout'], + 'Integration.Priority' => + $options['integrationPriority'], + 'Integration.CreationOnMessage' => + Serialize::booleanToString($options['integrationCreationOnMessage']), + 'LongLived' => + Serialize::booleanToString($options['longLived']), + 'JanitorEnabled' => + Serialize::booleanToString($options['janitorEnabled']), + 'Integration.RetryCount' => + $options['integrationRetryCount'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new FlexFlowInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.FlexFlowContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/FlexFlowInstance.php b/app/api/Twilio/Rest/FlexApi/V1/FlexFlowInstance.php new file mode 100755 index 0000000..9d613fc --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/FlexFlowInstance.php @@ -0,0 +1,168 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'sid' => Values::array_get($payload, 'sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'chatServiceSid' => Values::array_get($payload, 'chat_service_sid'), + 'channelType' => Values::array_get($payload, 'channel_type'), + 'contactIdentity' => Values::array_get($payload, 'contact_identity'), + 'enabled' => Values::array_get($payload, 'enabled'), + 'integrationType' => Values::array_get($payload, 'integration_type'), + 'integration' => Values::array_get($payload, 'integration'), + 'longLived' => Values::array_get($payload, 'long_lived'), + 'janitorEnabled' => Values::array_get($payload, 'janitor_enabled'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return FlexFlowContext Context for this FlexFlowInstance + */ + protected function proxy(): FlexFlowContext + { + if (!$this->context) { + $this->context = new FlexFlowContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the FlexFlowInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the FlexFlowInstance + * + * @return FlexFlowInstance Fetched FlexFlowInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FlexFlowInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the FlexFlowInstance + * + * @param array|Options $options Optional Arguments + * @return FlexFlowInstance Updated FlexFlowInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): FlexFlowInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.FlexFlowInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/FlexApi/V1/FlexFlowList.php b/app/api/Twilio/Rest/FlexApi/V1/FlexFlowList.php new file mode 100755 index 0000000..6fad68c --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/FlexFlowList.php @@ -0,0 +1,231 @@ +solution = [ + ]; + + $this->uri = '/FlexFlows'; + } + + /** + * Create the FlexFlowInstance + * + * @param string $friendlyName A descriptive string that you create to describe the Flex Flow resource. + * @param string $chatServiceSid The SID of the chat service. + * @param string $channelType + * @param array|Options $options Optional Arguments + * @return FlexFlowInstance Created FlexFlowInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $chatServiceSid, string $channelType, array $options = []): FlexFlowInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'ChatServiceSid' => + $chatServiceSid, + 'ChannelType' => + $channelType, + 'ContactIdentity' => + $options['contactIdentity'], + 'Enabled' => + Serialize::booleanToString($options['enabled']), + 'IntegrationType' => + $options['integrationType'], + 'Integration.FlowSid' => + $options['integrationFlowSid'], + 'Integration.Url' => + $options['integrationUrl'], + 'Integration.WorkspaceSid' => + $options['integrationWorkspaceSid'], + 'Integration.WorkflowSid' => + $options['integrationWorkflowSid'], + 'Integration.Channel' => + $options['integrationChannel'], + 'Integration.Timeout' => + $options['integrationTimeout'], + 'Integration.Priority' => + $options['integrationPriority'], + 'Integration.CreationOnMessage' => + Serialize::booleanToString($options['integrationCreationOnMessage']), + 'LongLived' => + Serialize::booleanToString($options['longLived']), + 'JanitorEnabled' => + Serialize::booleanToString($options['janitorEnabled']), + 'Integration.RetryCount' => + $options['integrationRetryCount'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new FlexFlowInstance( + $this->version, + $payload + ); + } + + + /** + * Reads FlexFlowInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return FlexFlowInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams FlexFlowInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of FlexFlowInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return FlexFlowPage Page of FlexFlowInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): FlexFlowPage + { + $options = new Values($options); + + $params = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new FlexFlowPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of FlexFlowInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return FlexFlowPage Page of FlexFlowInstance + */ + public function getPage(string $targetUrl): FlexFlowPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new FlexFlowPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a FlexFlowContext + * + * @param string $sid The SID of the Flex Flow resource to delete. + */ + public function getContext( + string $sid + + ): FlexFlowContext + { + return new FlexFlowContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.FlexFlowList]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/FlexFlowOptions.php b/app/api/Twilio/Rest/FlexApi/V1/FlexFlowOptions.php new file mode 100755 index 0000000..423f891 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/FlexFlowOptions.php @@ -0,0 +1,700 @@ +options['contactIdentity'] = $contactIdentity; + $this->options['enabled'] = $enabled; + $this->options['integrationType'] = $integrationType; + $this->options['integrationFlowSid'] = $integrationFlowSid; + $this->options['integrationUrl'] = $integrationUrl; + $this->options['integrationWorkspaceSid'] = $integrationWorkspaceSid; + $this->options['integrationWorkflowSid'] = $integrationWorkflowSid; + $this->options['integrationChannel'] = $integrationChannel; + $this->options['integrationTimeout'] = $integrationTimeout; + $this->options['integrationPriority'] = $integrationPriority; + $this->options['integrationCreationOnMessage'] = $integrationCreationOnMessage; + $this->options['longLived'] = $longLived; + $this->options['janitorEnabled'] = $janitorEnabled; + $this->options['integrationRetryCount'] = $integrationRetryCount; + } + + /** + * The channel contact's Identity. + * + * @param string $contactIdentity The channel contact's Identity. + * @return $this Fluent Builder + */ + public function setContactIdentity(string $contactIdentity): self + { + $this->options['contactIdentity'] = $contactIdentity; + return $this; + } + + /** + * Whether the new Flex Flow is enabled. + * + * @param bool $enabled Whether the new Flex Flow is enabled. + * @return $this Fluent Builder + */ + public function setEnabled(bool $enabled): self + { + $this->options['enabled'] = $enabled; + return $this; + } + + /** + * @param string $integrationType + * @return $this Fluent Builder + */ + public function setIntegrationType(string $integrationType): self + { + $this->options['integrationType'] = $integrationType; + return $this; + } + + /** + * The SID of the Studio Flow. Required when `integrationType` is `studio`. + * + * @param string $integrationFlowSid The SID of the Studio Flow. Required when `integrationType` is `studio`. + * @return $this Fluent Builder + */ + public function setIntegrationFlowSid(string $integrationFlowSid): self + { + $this->options['integrationFlowSid'] = $integrationFlowSid; + return $this; + } + + /** + * The URL of the external webhook. Required when `integrationType` is `external`. + * + * @param string $integrationUrl The URL of the external webhook. Required when `integrationType` is `external`. + * @return $this Fluent Builder + */ + public function setIntegrationUrl(string $integrationUrl): self + { + $this->options['integrationUrl'] = $integrationUrl; + return $this; + } + + /** + * The Workspace SID for a new Task. Required when `integrationType` is `task`. + * + * @param string $integrationWorkspaceSid The Workspace SID for a new Task. Required when `integrationType` is `task`. + * @return $this Fluent Builder + */ + public function setIntegrationWorkspaceSid(string $integrationWorkspaceSid): self + { + $this->options['integrationWorkspaceSid'] = $integrationWorkspaceSid; + return $this; + } + + /** + * The Workflow SID for a new Task. Required when `integrationType` is `task`. + * + * @param string $integrationWorkflowSid The Workflow SID for a new Task. Required when `integrationType` is `task`. + * @return $this Fluent Builder + */ + public function setIntegrationWorkflowSid(string $integrationWorkflowSid): self + { + $this->options['integrationWorkflowSid'] = $integrationWorkflowSid; + return $this; + } + + /** + * The Task Channel SID (TCXXXX) or unique name (e.g., `sms`) to use for the Task that will be created. Applicable and required when `integrationType` is `task`. The default value is `default`. + * + * @param string $integrationChannel The Task Channel SID (TCXXXX) or unique name (e.g., `sms`) to use for the Task that will be created. Applicable and required when `integrationType` is `task`. The default value is `default`. + * @return $this Fluent Builder + */ + public function setIntegrationChannel(string $integrationChannel): self + { + $this->options['integrationChannel'] = $integrationChannel; + return $this; + } + + /** + * The Task timeout in seconds for a new Task. Default is 86,400 seconds (24 hours). Optional when `integrationType` is `task`, not applicable otherwise. + * + * @param int $integrationTimeout The Task timeout in seconds for a new Task. Default is 86,400 seconds (24 hours). Optional when `integrationType` is `task`, not applicable otherwise. + * @return $this Fluent Builder + */ + public function setIntegrationTimeout(int $integrationTimeout): self + { + $this->options['integrationTimeout'] = $integrationTimeout; + return $this; + } + + /** + * The Task priority of a new Task. The default priority is 0. Optional when `integrationType` is `task`, not applicable otherwise. + * + * @param int $integrationPriority The Task priority of a new Task. The default priority is 0. Optional when `integrationType` is `task`, not applicable otherwise. + * @return $this Fluent Builder + */ + public function setIntegrationPriority(int $integrationPriority): self + { + $this->options['integrationPriority'] = $integrationPriority; + return $this; + } + + /** + * In the context of outbound messaging, defines whether to create a Task immediately (and therefore reserve the conversation to current agent), or delay Task creation until the customer sends the first response. Set to false to create immediately, true to delay Task creation. This setting is only applicable for outbound messaging. + * + * @param bool $integrationCreationOnMessage In the context of outbound messaging, defines whether to create a Task immediately (and therefore reserve the conversation to current agent), or delay Task creation until the customer sends the first response. Set to false to create immediately, true to delay Task creation. This setting is only applicable for outbound messaging. + * @return $this Fluent Builder + */ + public function setIntegrationCreationOnMessage(bool $integrationCreationOnMessage): self + { + $this->options['integrationCreationOnMessage'] = $integrationCreationOnMessage; + return $this; + } + + /** + * When enabled, Flex will keep the chat channel active so that it may be used for subsequent interactions with a contact identity. Defaults to `false`. + * + * @param bool $longLived When enabled, Flex will keep the chat channel active so that it may be used for subsequent interactions with a contact identity. Defaults to `false`. + * @return $this Fluent Builder + */ + public function setLongLived(bool $longLived): self + { + $this->options['longLived'] = $longLived; + return $this; + } + + /** + * When enabled, the Messaging Channel Janitor will remove active Proxy sessions if the associated Task is deleted outside of the Flex UI. Defaults to `false`. + * + * @param bool $janitorEnabled When enabled, the Messaging Channel Janitor will remove active Proxy sessions if the associated Task is deleted outside of the Flex UI. Defaults to `false`. + * @return $this Fluent Builder + */ + public function setJanitorEnabled(bool $janitorEnabled): self + { + $this->options['janitorEnabled'] = $janitorEnabled; + return $this; + } + + /** + * The number of times to retry the Studio Flow or webhook in case of failure. Takes integer values from 0 to 3 with the default being 3. Optional when `integrationType` is `studio` or `external`, not applicable otherwise. + * + * @param int $integrationRetryCount The number of times to retry the Studio Flow or webhook in case of failure. Takes integer values from 0 to 3 with the default being 3. Optional when `integrationType` is `studio` or `external`, not applicable otherwise. + * @return $this Fluent Builder + */ + public function setIntegrationRetryCount(int $integrationRetryCount): self + { + $this->options['integrationRetryCount'] = $integrationRetryCount; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.CreateFlexFlowOptions ' . $options . ']'; + } +} + + + +class ReadFlexFlowOptions extends Options + { + /** + * @param string $friendlyName The `friendly_name` of the Flex Flow resources to read. + */ + public function __construct( + + string $friendlyName = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + } + + /** + * The `friendly_name` of the Flex Flow resources to read. + * + * @param string $friendlyName The `friendly_name` of the Flex Flow resources to read. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.ReadFlexFlowOptions ' . $options . ']'; + } +} + +class UpdateFlexFlowOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the Flex Flow resource. + * @param string $chatServiceSid The SID of the chat service. + * @param string $channelType + * @param string $contactIdentity The channel contact's Identity. + * @param bool $enabled Whether the new Flex Flow is enabled. + * @param string $integrationType + * @param string $integrationFlowSid The SID of the Studio Flow. Required when `integrationType` is `studio`. + * @param string $integrationUrl The URL of the external webhook. Required when `integrationType` is `external`. + * @param string $integrationWorkspaceSid The Workspace SID for a new Task. Required when `integrationType` is `task`. + * @param string $integrationWorkflowSid The Workflow SID for a new Task. Required when `integrationType` is `task`. + * @param string $integrationChannel The Task Channel SID (TCXXXX) or unique name (e.g., `sms`) to use for the Task that will be created. Applicable and required when `integrationType` is `task`. The default value is `default`. + * @param int $integrationTimeout The Task timeout in seconds for a new Task. Default is 86,400 seconds (24 hours). Optional when `integrationType` is `task`, not applicable otherwise. + * @param int $integrationPriority The Task priority of a new Task. The default priority is 0. Optional when `integrationType` is `task`, not applicable otherwise. + * @param bool $integrationCreationOnMessage In the context of outbound messaging, defines whether to create a Task immediately (and therefore reserve the conversation to current agent), or delay Task creation until the customer sends the first response. Set to false to create immediately, true to delay Task creation. This setting is only applicable for outbound messaging. + * @param bool $longLived When enabled, Flex will keep the chat channel active so that it may be used for subsequent interactions with a contact identity. Defaults to `false`. + * @param bool $janitorEnabled When enabled, the Messaging Channel Janitor will remove active Proxy sessions if the associated Task is deleted outside of the Flex UI. Defaults to `false`. + * @param int $integrationRetryCount The number of times to retry the Studio Flow or webhook in case of failure. Takes integer values from 0 to 3 with the default being 3. Optional when `integrationType` is `studio` or `external`, not applicable otherwise. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $chatServiceSid = Values::NONE, + string $channelType = Values::NONE, + string $contactIdentity = Values::NONE, + bool $enabled = Values::BOOL_NONE, + string $integrationType = Values::NONE, + string $integrationFlowSid = Values::NONE, + string $integrationUrl = Values::NONE, + string $integrationWorkspaceSid = Values::NONE, + string $integrationWorkflowSid = Values::NONE, + string $integrationChannel = Values::NONE, + int $integrationTimeout = Values::INT_NONE, + int $integrationPriority = Values::INT_NONE, + bool $integrationCreationOnMessage = Values::BOOL_NONE, + bool $longLived = Values::BOOL_NONE, + bool $janitorEnabled = Values::BOOL_NONE, + int $integrationRetryCount = Values::INT_NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['chatServiceSid'] = $chatServiceSid; + $this->options['channelType'] = $channelType; + $this->options['contactIdentity'] = $contactIdentity; + $this->options['enabled'] = $enabled; + $this->options['integrationType'] = $integrationType; + $this->options['integrationFlowSid'] = $integrationFlowSid; + $this->options['integrationUrl'] = $integrationUrl; + $this->options['integrationWorkspaceSid'] = $integrationWorkspaceSid; + $this->options['integrationWorkflowSid'] = $integrationWorkflowSid; + $this->options['integrationChannel'] = $integrationChannel; + $this->options['integrationTimeout'] = $integrationTimeout; + $this->options['integrationPriority'] = $integrationPriority; + $this->options['integrationCreationOnMessage'] = $integrationCreationOnMessage; + $this->options['longLived'] = $longLived; + $this->options['janitorEnabled'] = $janitorEnabled; + $this->options['integrationRetryCount'] = $integrationRetryCount; + } + + /** + * A descriptive string that you create to describe the Flex Flow resource. + * + * @param string $friendlyName A descriptive string that you create to describe the Flex Flow resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The SID of the chat service. + * + * @param string $chatServiceSid The SID of the chat service. + * @return $this Fluent Builder + */ + public function setChatServiceSid(string $chatServiceSid): self + { + $this->options['chatServiceSid'] = $chatServiceSid; + return $this; + } + + /** + * @param string $channelType + * @return $this Fluent Builder + */ + public function setChannelType(string $channelType): self + { + $this->options['channelType'] = $channelType; + return $this; + } + + /** + * The channel contact's Identity. + * + * @param string $contactIdentity The channel contact's Identity. + * @return $this Fluent Builder + */ + public function setContactIdentity(string $contactIdentity): self + { + $this->options['contactIdentity'] = $contactIdentity; + return $this; + } + + /** + * Whether the new Flex Flow is enabled. + * + * @param bool $enabled Whether the new Flex Flow is enabled. + * @return $this Fluent Builder + */ + public function setEnabled(bool $enabled): self + { + $this->options['enabled'] = $enabled; + return $this; + } + + /** + * @param string $integrationType + * @return $this Fluent Builder + */ + public function setIntegrationType(string $integrationType): self + { + $this->options['integrationType'] = $integrationType; + return $this; + } + + /** + * The SID of the Studio Flow. Required when `integrationType` is `studio`. + * + * @param string $integrationFlowSid The SID of the Studio Flow. Required when `integrationType` is `studio`. + * @return $this Fluent Builder + */ + public function setIntegrationFlowSid(string $integrationFlowSid): self + { + $this->options['integrationFlowSid'] = $integrationFlowSid; + return $this; + } + + /** + * The URL of the external webhook. Required when `integrationType` is `external`. + * + * @param string $integrationUrl The URL of the external webhook. Required when `integrationType` is `external`. + * @return $this Fluent Builder + */ + public function setIntegrationUrl(string $integrationUrl): self + { + $this->options['integrationUrl'] = $integrationUrl; + return $this; + } + + /** + * The Workspace SID for a new Task. Required when `integrationType` is `task`. + * + * @param string $integrationWorkspaceSid The Workspace SID for a new Task. Required when `integrationType` is `task`. + * @return $this Fluent Builder + */ + public function setIntegrationWorkspaceSid(string $integrationWorkspaceSid): self + { + $this->options['integrationWorkspaceSid'] = $integrationWorkspaceSid; + return $this; + } + + /** + * The Workflow SID for a new Task. Required when `integrationType` is `task`. + * + * @param string $integrationWorkflowSid The Workflow SID for a new Task. Required when `integrationType` is `task`. + * @return $this Fluent Builder + */ + public function setIntegrationWorkflowSid(string $integrationWorkflowSid): self + { + $this->options['integrationWorkflowSid'] = $integrationWorkflowSid; + return $this; + } + + /** + * The Task Channel SID (TCXXXX) or unique name (e.g., `sms`) to use for the Task that will be created. Applicable and required when `integrationType` is `task`. The default value is `default`. + * + * @param string $integrationChannel The Task Channel SID (TCXXXX) or unique name (e.g., `sms`) to use for the Task that will be created. Applicable and required when `integrationType` is `task`. The default value is `default`. + * @return $this Fluent Builder + */ + public function setIntegrationChannel(string $integrationChannel): self + { + $this->options['integrationChannel'] = $integrationChannel; + return $this; + } + + /** + * The Task timeout in seconds for a new Task. Default is 86,400 seconds (24 hours). Optional when `integrationType` is `task`, not applicable otherwise. + * + * @param int $integrationTimeout The Task timeout in seconds for a new Task. Default is 86,400 seconds (24 hours). Optional when `integrationType` is `task`, not applicable otherwise. + * @return $this Fluent Builder + */ + public function setIntegrationTimeout(int $integrationTimeout): self + { + $this->options['integrationTimeout'] = $integrationTimeout; + return $this; + } + + /** + * The Task priority of a new Task. The default priority is 0. Optional when `integrationType` is `task`, not applicable otherwise. + * + * @param int $integrationPriority The Task priority of a new Task. The default priority is 0. Optional when `integrationType` is `task`, not applicable otherwise. + * @return $this Fluent Builder + */ + public function setIntegrationPriority(int $integrationPriority): self + { + $this->options['integrationPriority'] = $integrationPriority; + return $this; + } + + /** + * In the context of outbound messaging, defines whether to create a Task immediately (and therefore reserve the conversation to current agent), or delay Task creation until the customer sends the first response. Set to false to create immediately, true to delay Task creation. This setting is only applicable for outbound messaging. + * + * @param bool $integrationCreationOnMessage In the context of outbound messaging, defines whether to create a Task immediately (and therefore reserve the conversation to current agent), or delay Task creation until the customer sends the first response. Set to false to create immediately, true to delay Task creation. This setting is only applicable for outbound messaging. + * @return $this Fluent Builder + */ + public function setIntegrationCreationOnMessage(bool $integrationCreationOnMessage): self + { + $this->options['integrationCreationOnMessage'] = $integrationCreationOnMessage; + return $this; + } + + /** + * When enabled, Flex will keep the chat channel active so that it may be used for subsequent interactions with a contact identity. Defaults to `false`. + * + * @param bool $longLived When enabled, Flex will keep the chat channel active so that it may be used for subsequent interactions with a contact identity. Defaults to `false`. + * @return $this Fluent Builder + */ + public function setLongLived(bool $longLived): self + { + $this->options['longLived'] = $longLived; + return $this; + } + + /** + * When enabled, the Messaging Channel Janitor will remove active Proxy sessions if the associated Task is deleted outside of the Flex UI. Defaults to `false`. + * + * @param bool $janitorEnabled When enabled, the Messaging Channel Janitor will remove active Proxy sessions if the associated Task is deleted outside of the Flex UI. Defaults to `false`. + * @return $this Fluent Builder + */ + public function setJanitorEnabled(bool $janitorEnabled): self + { + $this->options['janitorEnabled'] = $janitorEnabled; + return $this; + } + + /** + * The number of times to retry the Studio Flow or webhook in case of failure. Takes integer values from 0 to 3 with the default being 3. Optional when `integrationType` is `studio` or `external`, not applicable otherwise. + * + * @param int $integrationRetryCount The number of times to retry the Studio Flow or webhook in case of failure. Takes integer values from 0 to 3 with the default being 3. Optional when `integrationType` is `studio` or `external`, not applicable otherwise. + * @return $this Fluent Builder + */ + public function setIntegrationRetryCount(int $integrationRetryCount): self + { + $this->options['integrationRetryCount'] = $integrationRetryCount; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.UpdateFlexFlowOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/FlexApi/V1/FlexFlowPage.php b/app/api/Twilio/Rest/FlexApi/V1/FlexFlowPage.php new file mode 100755 index 0000000..55fbc49 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/FlexFlowPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return FlexFlowInstance \Twilio\Rest\FlexApi\V1\FlexFlowInstance + */ + public function buildInstance(array $payload): FlexFlowInstance + { + return new FlexFlowInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.FlexFlowPage]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsAssessmentsCommentInstance.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsAssessmentsCommentInstance.php new file mode 100755 index 0000000..c60ba33 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsAssessmentsCommentInstance.php @@ -0,0 +1,102 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'assessmentId' => Values::array_get($payload, 'assessment_id'), + 'comment' => Values::array_get($payload, 'comment'), + 'offset' => Values::array_get($payload, 'offset'), + 'report' => Values::array_get($payload, 'report'), + 'weight' => Values::array_get($payload, 'weight'), + 'agentId' => Values::array_get($payload, 'agent_id'), + 'segmentId' => Values::array_get($payload, 'segment_id'), + 'userName' => Values::array_get($payload, 'user_name'), + 'userEmail' => Values::array_get($payload, 'user_email'), + 'timestamp' => Values::array_get($payload, 'timestamp'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsAssessmentsCommentInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsAssessmentsCommentList.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsAssessmentsCommentList.php new file mode 100755 index 0000000..b36ce16 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsAssessmentsCommentList.php @@ -0,0 +1,207 @@ +solution = [ + ]; + + $this->uri = '/Insights/QM/Assessments/Comments'; + } + + /** + * Create the InsightsAssessmentsCommentInstance + * + * @param string $categoryId The ID of the category + * @param string $categoryName The name of the category + * @param string $comment The Assessment comment. + * @param string $segmentId The id of the segment. + * @param string $userName The name of the user. + * @param string $userEmail The email id of the user. + * @param string $agentId The id of the agent. + * @param string $offset The offset + * @param array|Options $options Optional Arguments + * @return InsightsAssessmentsCommentInstance Created InsightsAssessmentsCommentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $categoryId, string $categoryName, string $comment, string $segmentId, string $userName, string $userEmail, string $agentId, string $offset, array $options = []): InsightsAssessmentsCommentInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'CategoryId' => + $categoryId, + 'CategoryName' => + $categoryName, + 'Comment' => + $comment, + 'SegmentId' => + $segmentId, + 'UserName' => + $userName, + 'UserEmail' => + $userEmail, + 'AgentId' => + $agentId, + 'Offset' => + $offset, + ]); + + $headers = Values::of(['Token' => $options['token']]); + + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new InsightsAssessmentsCommentInstance( + $this->version, + $payload + ); + } + + + /** + * Reads InsightsAssessmentsCommentInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return InsightsAssessmentsCommentInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams InsightsAssessmentsCommentInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of InsightsAssessmentsCommentInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return InsightsAssessmentsCommentPage Page of InsightsAssessmentsCommentInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): InsightsAssessmentsCommentPage + { + $options = new Values($options); + + $params = Values::of([ + 'SegmentId' => + $options['segmentId'], + 'AgentId' => + $options['agentId'], + 'Token' => + $options['token'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new InsightsAssessmentsCommentPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of InsightsAssessmentsCommentInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return InsightsAssessmentsCommentPage Page of InsightsAssessmentsCommentInstance + */ + public function getPage(string $targetUrl): InsightsAssessmentsCommentPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new InsightsAssessmentsCommentPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsAssessmentsCommentList]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsAssessmentsCommentOptions.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsAssessmentsCommentOptions.php new file mode 100755 index 0000000..7a52ca2 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsAssessmentsCommentOptions.php @@ -0,0 +1,164 @@ +options['token'] = $token; + } + + /** + * The Token HTTP request header + * + * @param string $token The Token HTTP request header + * @return $this Fluent Builder + */ + public function setToken(string $token): self + { + $this->options['token'] = $token; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.CreateInsightsAssessmentsCommentOptions ' . $options . ']'; + } +} + +class ReadInsightsAssessmentsCommentOptions extends Options + { + /** + * @param string $segmentId The id of the segment. + * @param string $agentId The id of the agent. + * @param string $token The Token HTTP request header + */ + public function __construct( + + string $segmentId = Values::NONE, + string $agentId = Values::NONE, + string $token = Values::NONE + + ) { + $this->options['segmentId'] = $segmentId; + $this->options['agentId'] = $agentId; + $this->options['token'] = $token; + } + + /** + * The id of the segment. + * + * @param string $segmentId The id of the segment. + * @return $this Fluent Builder + */ + public function setSegmentId(string $segmentId): self + { + $this->options['segmentId'] = $segmentId; + return $this; + } + + /** + * The id of the agent. + * + * @param string $agentId The id of the agent. + * @return $this Fluent Builder + */ + public function setAgentId(string $agentId): self + { + $this->options['agentId'] = $agentId; + return $this; + } + + /** + * The Token HTTP request header + * + * @param string $token The Token HTTP request header + * @return $this Fluent Builder + */ + public function setToken(string $token): self + { + $this->options['token'] = $token; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.ReadInsightsAssessmentsCommentOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsAssessmentsCommentPage.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsAssessmentsCommentPage.php new file mode 100755 index 0000000..e4a7618 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsAssessmentsCommentPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InsightsAssessmentsCommentInstance \Twilio\Rest\FlexApi\V1\InsightsAssessmentsCommentInstance + */ + public function buildInstance(array $payload): InsightsAssessmentsCommentInstance + { + return new InsightsAssessmentsCommentInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsAssessmentsCommentPage]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsConversationsInstance.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsConversationsInstance.php new file mode 100755 index 0000000..ab121a2 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsConversationsInstance.php @@ -0,0 +1,86 @@ +properties = [ + 'accountId' => Values::array_get($payload, 'account_id'), + 'conversationId' => Values::array_get($payload, 'conversation_id'), + 'segmentCount' => Values::array_get($payload, 'segment_count'), + 'segments' => Values::array_get($payload, 'segments'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsConversationsInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsConversationsList.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsConversationsList.php new file mode 100755 index 0000000..69a09f2 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsConversationsList.php @@ -0,0 +1,154 @@ +solution = [ + ]; + + $this->uri = '/Insights/Conversations'; + } + + /** + * Reads InsightsConversationsInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return InsightsConversationsInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams InsightsConversationsInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of InsightsConversationsInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return InsightsConversationsPage Page of InsightsConversationsInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): InsightsConversationsPage + { + $options = new Values($options); + + $params = Values::of([ + 'SegmentId' => + $options['segmentId'], + 'Token' => + $options['token'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new InsightsConversationsPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of InsightsConversationsInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return InsightsConversationsPage Page of InsightsConversationsInstance + */ + public function getPage(string $targetUrl): InsightsConversationsPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new InsightsConversationsPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsConversationsList]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsConversationsOptions.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsConversationsOptions.php new file mode 100755 index 0000000..96de182 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsConversationsOptions.php @@ -0,0 +1,94 @@ +options['segmentId'] = $segmentId; + $this->options['token'] = $token; + } + + /** + * Unique Id of the segment for which conversation details needs to be fetched + * + * @param string $segmentId Unique Id of the segment for which conversation details needs to be fetched + * @return $this Fluent Builder + */ + public function setSegmentId(string $segmentId): self + { + $this->options['segmentId'] = $segmentId; + return $this; + } + + /** + * The Token HTTP request header + * + * @param string $token The Token HTTP request header + * @return $this Fluent Builder + */ + public function setToken(string $token): self + { + $this->options['token'] = $token; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.ReadInsightsConversationsOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsConversationsPage.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsConversationsPage.php new file mode 100755 index 0000000..7dc82b3 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsConversationsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InsightsConversationsInstance \Twilio\Rest\FlexApi\V1\InsightsConversationsInstance + */ + public function buildInstance(array $payload): InsightsConversationsInstance + { + return new InsightsConversationsInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsConversationsPage]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesCategoryContext.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesCategoryContext.php new file mode 100755 index 0000000..70d832b --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesCategoryContext.php @@ -0,0 +1,112 @@ +solution = [ + 'categoryId' => + $categoryId, + ]; + + $this->uri = '/Insights/QM/Categories/' . \rawurlencode($categoryId) + .''; + } + + /** + * Delete the InsightsQuestionnairesCategoryInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['Token' => $options['token']]); + + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Update the InsightsQuestionnairesCategoryInstance + * + * @param string $name The name of this category. + * @param array|Options $options Optional Arguments + * @return InsightsQuestionnairesCategoryInstance Updated InsightsQuestionnairesCategoryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $name, array $options = []): InsightsQuestionnairesCategoryInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Name' => + $name, + ]); + + $headers = Values::of(['Token' => $options['token']]); + + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new InsightsQuestionnairesCategoryInstance( + $this->version, + $payload, + $this->solution['categoryId'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.InsightsQuestionnairesCategoryContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesCategoryInstance.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesCategoryInstance.php new file mode 100755 index 0000000..5d477aa --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesCategoryInstance.php @@ -0,0 +1,137 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'categoryId' => Values::array_get($payload, 'category_id'), + 'name' => Values::array_get($payload, 'name'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['categoryId' => $categoryId ?: $this->properties['categoryId'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return InsightsQuestionnairesCategoryContext Context for this InsightsQuestionnairesCategoryInstance + */ + protected function proxy(): InsightsQuestionnairesCategoryContext + { + if (!$this->context) { + $this->context = new InsightsQuestionnairesCategoryContext( + $this->version, + $this->solution['categoryId'] + ); + } + + return $this->context; + } + + /** + * Delete the InsightsQuestionnairesCategoryInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Update the InsightsQuestionnairesCategoryInstance + * + * @param string $name The name of this category. + * @param array|Options $options Optional Arguments + * @return InsightsQuestionnairesCategoryInstance Updated InsightsQuestionnairesCategoryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $name, array $options = []): InsightsQuestionnairesCategoryInstance + { + + return $this->proxy()->update($name, $options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.InsightsQuestionnairesCategoryInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesCategoryList.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesCategoryList.php new file mode 100755 index 0000000..03639e9 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesCategoryList.php @@ -0,0 +1,194 @@ +solution = [ + ]; + + $this->uri = '/Insights/QM/Categories'; + } + + /** + * Create the InsightsQuestionnairesCategoryInstance + * + * @param string $name The name of this category. + * @param array|Options $options Optional Arguments + * @return InsightsQuestionnairesCategoryInstance Created InsightsQuestionnairesCategoryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $name, array $options = []): InsightsQuestionnairesCategoryInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Name' => + $name, + ]); + + $headers = Values::of(['Token' => $options['token']]); + + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new InsightsQuestionnairesCategoryInstance( + $this->version, + $payload + ); + } + + + /** + * Reads InsightsQuestionnairesCategoryInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return InsightsQuestionnairesCategoryInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams InsightsQuestionnairesCategoryInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of InsightsQuestionnairesCategoryInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return InsightsQuestionnairesCategoryPage Page of InsightsQuestionnairesCategoryInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): InsightsQuestionnairesCategoryPage + { + + $params = Values::of([ + 'Token' => + $options['token'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new InsightsQuestionnairesCategoryPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of InsightsQuestionnairesCategoryInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return InsightsQuestionnairesCategoryPage Page of InsightsQuestionnairesCategoryInstance + */ + public function getPage(string $targetUrl): InsightsQuestionnairesCategoryPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new InsightsQuestionnairesCategoryPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a InsightsQuestionnairesCategoryContext + * + * @param string $categoryId The ID of the category to be deleted + */ + public function getContext( + string $categoryId + + ): InsightsQuestionnairesCategoryContext + { + return new InsightsQuestionnairesCategoryContext( + $this->version, + $categoryId + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsQuestionnairesCategoryList]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesCategoryOptions.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesCategoryOptions.php new file mode 100755 index 0000000..427562e --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesCategoryOptions.php @@ -0,0 +1,232 @@ +options['token'] = $token; + } + + /** + * The Token HTTP request header + * + * @param string $token The Token HTTP request header + * @return $this Fluent Builder + */ + public function setToken(string $token): self + { + $this->options['token'] = $token; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.CreateInsightsQuestionnairesCategoryOptions ' . $options . ']'; + } +} + +class DeleteInsightsQuestionnairesCategoryOptions extends Options + { + /** + * @param string $token The Token HTTP request header + */ + public function __construct( + + string $token = Values::NONE + + ) { + $this->options['token'] = $token; + } + + /** + * The Token HTTP request header + * + * @param string $token The Token HTTP request header + * @return $this Fluent Builder + */ + public function setToken(string $token): self + { + $this->options['token'] = $token; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.DeleteInsightsQuestionnairesCategoryOptions ' . $options . ']'; + } +} + +class ReadInsightsQuestionnairesCategoryOptions extends Options + { + /** + * @param string $token The Token HTTP request header + */ + public function __construct( + + string $token = Values::NONE + + ) { + $this->options['token'] = $token; + } + + /** + * The Token HTTP request header + * + * @param string $token The Token HTTP request header + * @return $this Fluent Builder + */ + public function setToken(string $token): self + { + $this->options['token'] = $token; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.ReadInsightsQuestionnairesCategoryOptions ' . $options . ']'; + } +} + +class UpdateInsightsQuestionnairesCategoryOptions extends Options + { + /** + * @param string $token The Token HTTP request header + */ + public function __construct( + + string $token = Values::NONE + + ) { + $this->options['token'] = $token; + } + + /** + * The Token HTTP request header + * + * @param string $token The Token HTTP request header + * @return $this Fluent Builder + */ + public function setToken(string $token): self + { + $this->options['token'] = $token; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.UpdateInsightsQuestionnairesCategoryOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesCategoryPage.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesCategoryPage.php new file mode 100755 index 0000000..bdc1793 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesCategoryPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InsightsQuestionnairesCategoryInstance \Twilio\Rest\FlexApi\V1\InsightsQuestionnairesCategoryInstance + */ + public function buildInstance(array $payload): InsightsQuestionnairesCategoryInstance + { + return new InsightsQuestionnairesCategoryInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsQuestionnairesCategoryPage]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesContext.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesContext.php new file mode 100755 index 0000000..cb17beb --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesContext.php @@ -0,0 +1,143 @@ +solution = [ + 'id' => + $id, + ]; + + $this->uri = '/Insights/QM/Questionnaires/' . \rawurlencode($id) + .''; + } + + /** + * Delete the InsightsQuestionnairesInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['Token' => $options['token']]); + + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the InsightsQuestionnairesInstance + * + * @param array|Options $options Optional Arguments + * @return InsightsQuestionnairesInstance Fetched InsightsQuestionnairesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): InsightsQuestionnairesInstance + { + + $options = new Values($options); + + $headers = Values::of(['Token' => $options['token']]); + + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new InsightsQuestionnairesInstance( + $this->version, + $payload, + $this->solution['id'] + ); + } + + + /** + * Update the InsightsQuestionnairesInstance + * + * @param bool $active The flag to enable or disable questionnaire + * @param array|Options $options Optional Arguments + * @return InsightsQuestionnairesInstance Updated InsightsQuestionnairesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $active, array $options = []): InsightsQuestionnairesInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Active' => + Serialize::booleanToString($active), + 'Name' => + $options['name'], + 'Description' => + $options['description'], + 'QuestionIds' => + Serialize::map($options['questionIds'], function ($e) { return $e; }), + ]); + + $headers = Values::of(['Token' => $options['token']]); + + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new InsightsQuestionnairesInstance( + $this->version, + $payload, + $this->solution['id'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.InsightsQuestionnairesContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesInstance.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesInstance.php new file mode 100755 index 0000000..f9ab4e7 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesInstance.php @@ -0,0 +1,156 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'id' => Values::array_get($payload, 'id'), + 'name' => Values::array_get($payload, 'name'), + 'description' => Values::array_get($payload, 'description'), + 'active' => Values::array_get($payload, 'active'), + 'questions' => Values::array_get($payload, 'questions'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['id' => $id ?: $this->properties['id'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return InsightsQuestionnairesContext Context for this InsightsQuestionnairesInstance + */ + protected function proxy(): InsightsQuestionnairesContext + { + if (!$this->context) { + $this->context = new InsightsQuestionnairesContext( + $this->version, + $this->solution['id'] + ); + } + + return $this->context; + } + + /** + * Delete the InsightsQuestionnairesInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the InsightsQuestionnairesInstance + * + * @param array|Options $options Optional Arguments + * @return InsightsQuestionnairesInstance Fetched InsightsQuestionnairesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): InsightsQuestionnairesInstance + { + + return $this->proxy()->fetch($options); + } + + /** + * Update the InsightsQuestionnairesInstance + * + * @param bool $active The flag to enable or disable questionnaire + * @param array|Options $options Optional Arguments + * @return InsightsQuestionnairesInstance Updated InsightsQuestionnairesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $active, array $options = []): InsightsQuestionnairesInstance + { + + return $this->proxy()->update($active, $options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.InsightsQuestionnairesInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesList.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesList.php new file mode 100755 index 0000000..7d9ba32 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesList.php @@ -0,0 +1,207 @@ +solution = [ + ]; + + $this->uri = '/Insights/QM/Questionnaires'; + } + + /** + * Create the InsightsQuestionnairesInstance + * + * @param string $name The name of this questionnaire + * @param array|Options $options Optional Arguments + * @return InsightsQuestionnairesInstance Created InsightsQuestionnairesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $name, array $options = []): InsightsQuestionnairesInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Name' => + $name, + 'Description' => + $options['description'], + 'Active' => + Serialize::booleanToString($options['active']), + 'QuestionIds' => + Serialize::map($options['questionIds'], function ($e) { return $e; }), + ]); + + $headers = Values::of(['Token' => $options['token']]); + + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new InsightsQuestionnairesInstance( + $this->version, + $payload + ); + } + + + /** + * Reads InsightsQuestionnairesInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return InsightsQuestionnairesInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams InsightsQuestionnairesInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of InsightsQuestionnairesInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return InsightsQuestionnairesPage Page of InsightsQuestionnairesInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): InsightsQuestionnairesPage + { + $options = new Values($options); + + $params = Values::of([ + 'IncludeInactive' => + Serialize::booleanToString($options['includeInactive']), + 'Token' => + $options['token'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new InsightsQuestionnairesPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of InsightsQuestionnairesInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return InsightsQuestionnairesPage Page of InsightsQuestionnairesInstance + */ + public function getPage(string $targetUrl): InsightsQuestionnairesPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new InsightsQuestionnairesPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a InsightsQuestionnairesContext + * + * @param string $id The unique ID of the questionnaire + */ + public function getContext( + string $id + + ): InsightsQuestionnairesContext + { + return new InsightsQuestionnairesContext( + $this->version, + $id + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsQuestionnairesList]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesOptions.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesOptions.php new file mode 100755 index 0000000..af0386f --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesOptions.php @@ -0,0 +1,410 @@ +options['description'] = $description; + $this->options['active'] = $active; + $this->options['questionIds'] = $questionIds; + $this->options['token'] = $token; + } + + /** + * The description of this questionnaire + * + * @param string $description The description of this questionnaire + * @return $this Fluent Builder + */ + public function setDescription(string $description): self + { + $this->options['description'] = $description; + return $this; + } + + /** + * The flag to enable or disable questionnaire + * + * @param bool $active The flag to enable or disable questionnaire + * @return $this Fluent Builder + */ + public function setActive(bool $active): self + { + $this->options['active'] = $active; + return $this; + } + + /** + * The list of questions ids under a questionnaire + * + * @param string[] $questionIds The list of questions ids under a questionnaire + * @return $this Fluent Builder + */ + public function setQuestionIds(array $questionIds): self + { + $this->options['questionIds'] = $questionIds; + return $this; + } + + /** + * The Token HTTP request header + * + * @param string $token The Token HTTP request header + * @return $this Fluent Builder + */ + public function setToken(string $token): self + { + $this->options['token'] = $token; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.CreateInsightsQuestionnairesOptions ' . $options . ']'; + } +} + +class DeleteInsightsQuestionnairesOptions extends Options + { + /** + * @param string $token The Token HTTP request header + */ + public function __construct( + + string $token = Values::NONE + + ) { + $this->options['token'] = $token; + } + + /** + * The Token HTTP request header + * + * @param string $token The Token HTTP request header + * @return $this Fluent Builder + */ + public function setToken(string $token): self + { + $this->options['token'] = $token; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.DeleteInsightsQuestionnairesOptions ' . $options . ']'; + } +} + +class FetchInsightsQuestionnairesOptions extends Options + { + /** + * @param string $token The Token HTTP request header + */ + public function __construct( + + string $token = Values::NONE + + ) { + $this->options['token'] = $token; + } + + /** + * The Token HTTP request header + * + * @param string $token The Token HTTP request header + * @return $this Fluent Builder + */ + public function setToken(string $token): self + { + $this->options['token'] = $token; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.FetchInsightsQuestionnairesOptions ' . $options . ']'; + } +} + +class ReadInsightsQuestionnairesOptions extends Options + { + /** + * @param bool $includeInactive Flag indicating whether to include inactive questionnaires or not + * @param string $token The Token HTTP request header + */ + public function __construct( + + bool $includeInactive = Values::BOOL_NONE, + string $token = Values::NONE + + ) { + $this->options['includeInactive'] = $includeInactive; + $this->options['token'] = $token; + } + + /** + * Flag indicating whether to include inactive questionnaires or not + * + * @param bool $includeInactive Flag indicating whether to include inactive questionnaires or not + * @return $this Fluent Builder + */ + public function setIncludeInactive(bool $includeInactive): self + { + $this->options['includeInactive'] = $includeInactive; + return $this; + } + + /** + * The Token HTTP request header + * + * @param string $token The Token HTTP request header + * @return $this Fluent Builder + */ + public function setToken(string $token): self + { + $this->options['token'] = $token; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.ReadInsightsQuestionnairesOptions ' . $options . ']'; + } +} + +class UpdateInsightsQuestionnairesOptions extends Options + { + /** + * @param string $name The name of this questionnaire + * @param string $description The description of this questionnaire + * @param string[] $questionIds The list of questions ids under a questionnaire + * @param string $token The Token HTTP request header + */ + public function __construct( + + string $name = Values::NONE, + string $description = Values::NONE, + array $questionIds = Values::ARRAY_NONE, + string $token = Values::NONE + + ) { + $this->options['name'] = $name; + $this->options['description'] = $description; + $this->options['questionIds'] = $questionIds; + $this->options['token'] = $token; + } + + /** + * The name of this questionnaire + * + * @param string $name The name of this questionnaire + * @return $this Fluent Builder + */ + public function setName(string $name): self + { + $this->options['name'] = $name; + return $this; + } + + /** + * The description of this questionnaire + * + * @param string $description The description of this questionnaire + * @return $this Fluent Builder + */ + public function setDescription(string $description): self + { + $this->options['description'] = $description; + return $this; + } + + /** + * The list of questions ids under a questionnaire + * + * @param string[] $questionIds The list of questions ids under a questionnaire + * @return $this Fluent Builder + */ + public function setQuestionIds(array $questionIds): self + { + $this->options['questionIds'] = $questionIds; + return $this; + } + + /** + * The Token HTTP request header + * + * @param string $token The Token HTTP request header + * @return $this Fluent Builder + */ + public function setToken(string $token): self + { + $this->options['token'] = $token; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.UpdateInsightsQuestionnairesOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesPage.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesPage.php new file mode 100755 index 0000000..c60d8e3 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InsightsQuestionnairesInstance \Twilio\Rest\FlexApi\V1\InsightsQuestionnairesInstance + */ + public function buildInstance(array $payload): InsightsQuestionnairesInstance + { + return new InsightsQuestionnairesInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsQuestionnairesPage]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesQuestionContext.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesQuestionContext.php new file mode 100755 index 0000000..e9d4859 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesQuestionContext.php @@ -0,0 +1,121 @@ +solution = [ + 'questionId' => + $questionId, + ]; + + $this->uri = '/Insights/QM/Questions/' . \rawurlencode($questionId) + .''; + } + + /** + * Delete the InsightsQuestionnairesQuestionInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['Token' => $options['token']]); + + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Update the InsightsQuestionnairesQuestionInstance + * + * @param bool $allowNa The flag to enable for disable NA for answer. + * @param array|Options $options Optional Arguments + * @return InsightsQuestionnairesQuestionInstance Updated InsightsQuestionnairesQuestionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $allowNa, array $options = []): InsightsQuestionnairesQuestionInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'AllowNa' => + Serialize::booleanToString($allowNa), + 'CategoryId' => + $options['categoryId'], + 'Question' => + $options['question'], + 'Description' => + $options['description'], + 'AnswerSetId' => + $options['answerSetId'], + ]); + + $headers = Values::of(['Token' => $options['token']]); + + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new InsightsQuestionnairesQuestionInstance( + $this->version, + $payload, + $this->solution['questionId'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.InsightsQuestionnairesQuestionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesQuestionInstance.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesQuestionInstance.php new file mode 100755 index 0000000..105a065 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesQuestionInstance.php @@ -0,0 +1,149 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'questionId' => Values::array_get($payload, 'question_id'), + 'question' => Values::array_get($payload, 'question'), + 'description' => Values::array_get($payload, 'description'), + 'category' => Values::array_get($payload, 'category'), + 'answerSetId' => Values::array_get($payload, 'answer_set_id'), + 'allowNa' => Values::array_get($payload, 'allow_na'), + 'usage' => Values::array_get($payload, 'usage'), + 'answerSet' => Values::array_get($payload, 'answer_set'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['questionId' => $questionId ?: $this->properties['questionId'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return InsightsQuestionnairesQuestionContext Context for this InsightsQuestionnairesQuestionInstance + */ + protected function proxy(): InsightsQuestionnairesQuestionContext + { + if (!$this->context) { + $this->context = new InsightsQuestionnairesQuestionContext( + $this->version, + $this->solution['questionId'] + ); + } + + return $this->context; + } + + /** + * Delete the InsightsQuestionnairesQuestionInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Update the InsightsQuestionnairesQuestionInstance + * + * @param bool $allowNa The flag to enable for disable NA for answer. + * @param array|Options $options Optional Arguments + * @return InsightsQuestionnairesQuestionInstance Updated InsightsQuestionnairesQuestionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $allowNa, array $options = []): InsightsQuestionnairesQuestionInstance + { + + return $this->proxy()->update($allowNa, $options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.InsightsQuestionnairesQuestionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesQuestionList.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesQuestionList.php new file mode 100755 index 0000000..65b8fe1 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesQuestionList.php @@ -0,0 +1,212 @@ +solution = [ + ]; + + $this->uri = '/Insights/QM/Questions'; + } + + /** + * Create the InsightsQuestionnairesQuestionInstance + * + * @param string $categoryId The ID of the category + * @param string $question The question. + * @param string $answerSetId The answer_set for the question. + * @param bool $allowNa The flag to enable for disable NA for answer. + * @param array|Options $options Optional Arguments + * @return InsightsQuestionnairesQuestionInstance Created InsightsQuestionnairesQuestionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $categoryId, string $question, string $answerSetId, bool $allowNa, array $options = []): InsightsQuestionnairesQuestionInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'CategoryId' => + $categoryId, + 'Question' => + $question, + 'AnswerSetId' => + $answerSetId, + 'AllowNa' => + Serialize::booleanToString($allowNa), + 'Description' => + $options['description'], + ]); + + $headers = Values::of(['Token' => $options['token']]); + + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new InsightsQuestionnairesQuestionInstance( + $this->version, + $payload + ); + } + + + /** + * Reads InsightsQuestionnairesQuestionInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return InsightsQuestionnairesQuestionInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams InsightsQuestionnairesQuestionInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of InsightsQuestionnairesQuestionInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return InsightsQuestionnairesQuestionPage Page of InsightsQuestionnairesQuestionInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): InsightsQuestionnairesQuestionPage + { + $options = new Values($options); + + $params = Values::of([ + 'CategoryId' => + Serialize::map($options['categoryId'], function ($e) { return $e; }), + 'Token' => + $options['token'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new InsightsQuestionnairesQuestionPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of InsightsQuestionnairesQuestionInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return InsightsQuestionnairesQuestionPage Page of InsightsQuestionnairesQuestionInstance + */ + public function getPage(string $targetUrl): InsightsQuestionnairesQuestionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new InsightsQuestionnairesQuestionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a InsightsQuestionnairesQuestionContext + * + * @param string $questionId The unique ID of the question + */ + public function getContext( + string $questionId + + ): InsightsQuestionnairesQuestionContext + { + return new InsightsQuestionnairesQuestionContext( + $this->version, + $questionId + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsQuestionnairesQuestionList]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesQuestionOptions.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesQuestionOptions.php new file mode 100755 index 0000000..7686a99 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesQuestionOptions.php @@ -0,0 +1,340 @@ +options['description'] = $description; + $this->options['token'] = $token; + } + + /** + * The description for the question. + * + * @param string $description The description for the question. + * @return $this Fluent Builder + */ + public function setDescription(string $description): self + { + $this->options['description'] = $description; + return $this; + } + + /** + * The Token HTTP request header + * + * @param string $token The Token HTTP request header + * @return $this Fluent Builder + */ + public function setToken(string $token): self + { + $this->options['token'] = $token; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.CreateInsightsQuestionnairesQuestionOptions ' . $options . ']'; + } +} + +class DeleteInsightsQuestionnairesQuestionOptions extends Options + { + /** + * @param string $token The Token HTTP request header + */ + public function __construct( + + string $token = Values::NONE + + ) { + $this->options['token'] = $token; + } + + /** + * The Token HTTP request header + * + * @param string $token The Token HTTP request header + * @return $this Fluent Builder + */ + public function setToken(string $token): self + { + $this->options['token'] = $token; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.DeleteInsightsQuestionnairesQuestionOptions ' . $options . ']'; + } +} + +class ReadInsightsQuestionnairesQuestionOptions extends Options + { + /** + * @param string[] $categoryId The list of category IDs + * @param string $token The Token HTTP request header + */ + public function __construct( + + array $categoryId = Values::ARRAY_NONE, + string $token = Values::NONE + + ) { + $this->options['categoryId'] = $categoryId; + $this->options['token'] = $token; + } + + /** + * The list of category IDs + * + * @param string[] $categoryId The list of category IDs + * @return $this Fluent Builder + */ + public function setCategoryId(array $categoryId): self + { + $this->options['categoryId'] = $categoryId; + return $this; + } + + /** + * The Token HTTP request header + * + * @param string $token The Token HTTP request header + * @return $this Fluent Builder + */ + public function setToken(string $token): self + { + $this->options['token'] = $token; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.ReadInsightsQuestionnairesQuestionOptions ' . $options . ']'; + } +} + +class UpdateInsightsQuestionnairesQuestionOptions extends Options + { + /** + * @param string $categoryId The ID of the category + * @param string $question The question. + * @param string $description The description for the question. + * @param string $answerSetId The answer_set for the question. + * @param string $token The Token HTTP request header + */ + public function __construct( + + string $categoryId = Values::NONE, + string $question = Values::NONE, + string $description = Values::NONE, + string $answerSetId = Values::NONE, + string $token = Values::NONE + + ) { + $this->options['categoryId'] = $categoryId; + $this->options['question'] = $question; + $this->options['description'] = $description; + $this->options['answerSetId'] = $answerSetId; + $this->options['token'] = $token; + } + + /** + * The ID of the category + * + * @param string $categoryId The ID of the category + * @return $this Fluent Builder + */ + public function setCategoryId(string $categoryId): self + { + $this->options['categoryId'] = $categoryId; + return $this; + } + + /** + * The question. + * + * @param string $question The question. + * @return $this Fluent Builder + */ + public function setQuestion(string $question): self + { + $this->options['question'] = $question; + return $this; + } + + /** + * The description for the question. + * + * @param string $description The description for the question. + * @return $this Fluent Builder + */ + public function setDescription(string $description): self + { + $this->options['description'] = $description; + return $this; + } + + /** + * The answer_set for the question. + * + * @param string $answerSetId The answer_set for the question. + * @return $this Fluent Builder + */ + public function setAnswerSetId(string $answerSetId): self + { + $this->options['answerSetId'] = $answerSetId; + return $this; + } + + /** + * The Token HTTP request header + * + * @param string $token The Token HTTP request header + * @return $this Fluent Builder + */ + public function setToken(string $token): self + { + $this->options['token'] = $token; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.UpdateInsightsQuestionnairesQuestionOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesQuestionPage.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesQuestionPage.php new file mode 100755 index 0000000..25819bb --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsQuestionnairesQuestionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InsightsQuestionnairesQuestionInstance \Twilio\Rest\FlexApi\V1\InsightsQuestionnairesQuestionInstance + */ + public function buildInstance(array $payload): InsightsQuestionnairesQuestionInstance + { + return new InsightsQuestionnairesQuestionInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsQuestionnairesQuestionPage]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsSegmentsContext.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsSegmentsContext.php new file mode 100755 index 0000000..1f88688 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsSegmentsContext.php @@ -0,0 +1,88 @@ +solution = [ + 'segmentId' => + $segmentId, + ]; + + $this->uri = '/Insights/Segments/' . \rawurlencode($segmentId) + .''; + } + + /** + * Fetch the InsightsSegmentsInstance + * + * @param array|Options $options Optional Arguments + * @return InsightsSegmentsInstance Fetched InsightsSegmentsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): InsightsSegmentsInstance + { + + $options = new Values($options); + + $headers = Values::of(['Token' => $options['token']]); + + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new InsightsSegmentsInstance( + $this->version, + $payload, + $this->solution['segmentId'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.InsightsSegmentsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsSegmentsInstance.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsSegmentsInstance.php new file mode 100755 index 0000000..ffbe0a8 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsSegmentsInstance.php @@ -0,0 +1,159 @@ +properties = [ + 'segmentId' => Values::array_get($payload, 'segment_id'), + 'externalId' => Values::array_get($payload, 'external_id'), + 'queue' => Values::array_get($payload, 'queue'), + 'externalContact' => Values::array_get($payload, 'external_contact'), + 'externalSegmentLinkId' => Values::array_get($payload, 'external_segment_link_id'), + 'date' => Values::array_get($payload, 'date'), + 'accountId' => Values::array_get($payload, 'account_id'), + 'externalSegmentLink' => Values::array_get($payload, 'external_segment_link'), + 'agentId' => Values::array_get($payload, 'agent_id'), + 'agentPhone' => Values::array_get($payload, 'agent_phone'), + 'agentName' => Values::array_get($payload, 'agent_name'), + 'agentTeamName' => Values::array_get($payload, 'agent_team_name'), + 'agentTeamNameInHierarchy' => Values::array_get($payload, 'agent_team_name_in_hierarchy'), + 'agentLink' => Values::array_get($payload, 'agent_link'), + 'customerPhone' => Values::array_get($payload, 'customer_phone'), + 'customerName' => Values::array_get($payload, 'customer_name'), + 'customerLink' => Values::array_get($payload, 'customer_link'), + 'segmentRecordingOffset' => Values::array_get($payload, 'segment_recording_offset'), + 'media' => Values::array_get($payload, 'media'), + 'assessmentType' => Values::array_get($payload, 'assessment_type'), + 'assessmentPercentage' => Values::array_get($payload, 'assessment_percentage'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['segmentId' => $segmentId ?: $this->properties['segmentId'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return InsightsSegmentsContext Context for this InsightsSegmentsInstance + */ + protected function proxy(): InsightsSegmentsContext + { + if (!$this->context) { + $this->context = new InsightsSegmentsContext( + $this->version, + $this->solution['segmentId'] + ); + } + + return $this->context; + } + + /** + * Fetch the InsightsSegmentsInstance + * + * @param array|Options $options Optional Arguments + * @return InsightsSegmentsInstance Fetched InsightsSegmentsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): InsightsSegmentsInstance + { + + return $this->proxy()->fetch($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.InsightsSegmentsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsSegmentsList.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsSegmentsList.php new file mode 100755 index 0000000..625a74c --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsSegmentsList.php @@ -0,0 +1,171 @@ +solution = [ + ]; + + $this->uri = '/Insights/Segments'; + } + + /** + * Reads InsightsSegmentsInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return InsightsSegmentsInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams InsightsSegmentsInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of InsightsSegmentsInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return InsightsSegmentsPage Page of InsightsSegmentsInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): InsightsSegmentsPage + { + $options = new Values($options); + + $params = Values::of([ + 'ReservationId' => + Serialize::map($options['reservationId'], function ($e) { return $e; }), + 'Token' => + $options['token'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new InsightsSegmentsPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of InsightsSegmentsInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return InsightsSegmentsPage Page of InsightsSegmentsInstance + */ + public function getPage(string $targetUrl): InsightsSegmentsPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new InsightsSegmentsPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a InsightsSegmentsContext + * + * @param string $segmentId To unique id of the segment + */ + public function getContext( + string $segmentId + + ): InsightsSegmentsContext + { + return new InsightsSegmentsContext( + $this->version, + $segmentId + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsSegmentsList]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsSegmentsOptions.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsSegmentsOptions.php new file mode 100755 index 0000000..fbed69d --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsSegmentsOptions.php @@ -0,0 +1,146 @@ +options['token'] = $token; + } + + /** + * The Token HTTP request header + * + * @param string $token The Token HTTP request header + * @return $this Fluent Builder + */ + public function setToken(string $token): self + { + $this->options['token'] = $token; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.FetchInsightsSegmentsOptions ' . $options . ']'; + } +} + +class ReadInsightsSegmentsOptions extends Options + { + /** + * @param string[] $reservationId The list of reservation Ids + * @param string $token The Token HTTP request header + */ + public function __construct( + + array $reservationId = Values::ARRAY_NONE, + string $token = Values::NONE + + ) { + $this->options['reservationId'] = $reservationId; + $this->options['token'] = $token; + } + + /** + * The list of reservation Ids + * + * @param string[] $reservationId The list of reservation Ids + * @return $this Fluent Builder + */ + public function setReservationId(array $reservationId): self + { + $this->options['reservationId'] = $reservationId; + return $this; + } + + /** + * The Token HTTP request header + * + * @param string $token The Token HTTP request header + * @return $this Fluent Builder + */ + public function setToken(string $token): self + { + $this->options['token'] = $token; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.ReadInsightsSegmentsOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsSegmentsPage.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsSegmentsPage.php new file mode 100755 index 0000000..baae31f --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsSegmentsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InsightsSegmentsInstance \Twilio\Rest\FlexApi\V1\InsightsSegmentsInstance + */ + public function buildInstance(array $payload): InsightsSegmentsInstance + { + return new InsightsSegmentsInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsSegmentsPage]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsSessionContext.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsSessionContext.php new file mode 100755 index 0000000..fa3363f --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsSessionContext.php @@ -0,0 +1,82 @@ +solution = [ + ]; + + $this->uri = '/Insights/Session'; + } + + /** + * Create the InsightsSessionInstance + * + * @param array|Options $options Optional Arguments + * @return InsightsSessionInstance Created InsightsSessionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): InsightsSessionInstance + { + + $options = new Values($options); + + $headers = Values::of(['Authorization' => $options['authorization']]); + + $payload = $this->version->create('POST', $this->uri, [], [], $headers); + + return new InsightsSessionInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.InsightsSessionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsSessionInstance.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsSessionInstance.php new file mode 100755 index 0000000..4ce88b2 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsSessionInstance.php @@ -0,0 +1,123 @@ +properties = [ + 'workspaceId' => Values::array_get($payload, 'workspace_id'), + 'sessionExpiry' => Values::array_get($payload, 'session_expiry'), + 'sessionId' => Values::array_get($payload, 'session_id'), + 'baseUrl' => Values::array_get($payload, 'base_url'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = []; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return InsightsSessionContext Context for this InsightsSessionInstance + */ + protected function proxy(): InsightsSessionContext + { + if (!$this->context) { + $this->context = new InsightsSessionContext( + $this->version + ); + } + + return $this->context; + } + + /** + * Create the InsightsSessionInstance + * + * @param array|Options $options Optional Arguments + * @return InsightsSessionInstance Created InsightsSessionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): InsightsSessionInstance + { + + return $this->proxy()->create($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.InsightsSessionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsSessionList.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsSessionList.php new file mode 100755 index 0000000..5ac93d1 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsSessionList.php @@ -0,0 +1,61 @@ +solution = [ + ]; + } + + /** + * Constructs a InsightsSessionContext + */ + public function getContext( + + ): InsightsSessionContext + { + return new InsightsSessionContext( + $this->version + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsSessionList]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsSessionOptions.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsSessionOptions.php new file mode 100755 index 0000000..46087bf --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsSessionOptions.php @@ -0,0 +1,76 @@ +options['authorization'] = $authorization; + } + + /** + * The Authorization HTTP request header + * + * @param string $authorization The Authorization HTTP request header + * @return $this Fluent Builder + */ + public function setAuthorization(string $authorization): self + { + $this->options['authorization'] = $authorization; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.CreateInsightsSessionOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsSessionPage.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsSessionPage.php new file mode 100755 index 0000000..468107a --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsSessionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InsightsSessionInstance \Twilio\Rest\FlexApi\V1\InsightsSessionInstance + */ + public function buildInstance(array $payload): InsightsSessionInstance + { + return new InsightsSessionInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsSessionPage]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsSettingsAnswerSetsInstance.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsSettingsAnswerSetsInstance.php new file mode 100755 index 0000000..b810f15 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsSettingsAnswerSetsInstance.php @@ -0,0 +1,88 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'answerSets' => Values::array_get($payload, 'answer_sets'), + 'answerSetCategories' => Values::array_get($payload, 'answer_set_categories'), + 'notApplicable' => Values::array_get($payload, 'not_applicable'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsSettingsAnswerSetsInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsSettingsAnswerSetsList.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsSettingsAnswerSetsList.php new file mode 100755 index 0000000..4842eaa --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsSettingsAnswerSetsList.php @@ -0,0 +1,77 @@ +solution = [ + ]; + + $this->uri = '/Insights/QM/Settings/AnswerSets'; + } + + /** + * Fetch the InsightsSettingsAnswerSetsInstance + * + * @param array|Options $options Optional Arguments + * @return InsightsSettingsAnswerSetsInstance Fetched InsightsSettingsAnswerSetsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): InsightsSettingsAnswerSetsInstance + { + + $options = new Values($options); + + $headers = Values::of(['Token' => $options['token']]); + + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new InsightsSettingsAnswerSetsInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsSettingsAnswerSetsList]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsSettingsAnswerSetsOptions.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsSettingsAnswerSetsOptions.php new file mode 100755 index 0000000..06c9688 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsSettingsAnswerSetsOptions.php @@ -0,0 +1,76 @@ +options['token'] = $token; + } + + /** + * The Token HTTP request header + * + * @param string $token The Token HTTP request header + * @return $this Fluent Builder + */ + public function setToken(string $token): self + { + $this->options['token'] = $token; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.FetchInsightsSettingsAnswerSetsOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsSettingsAnswerSetsPage.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsSettingsAnswerSetsPage.php new file mode 100755 index 0000000..3eec3c3 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsSettingsAnswerSetsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InsightsSettingsAnswerSetsInstance \Twilio\Rest\FlexApi\V1\InsightsSettingsAnswerSetsInstance + */ + public function buildInstance(array $payload): InsightsSettingsAnswerSetsInstance + { + return new InsightsSettingsAnswerSetsInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsSettingsAnswerSetsPage]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsSettingsCommentInstance.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsSettingsCommentInstance.php new file mode 100755 index 0000000..0b32fb2 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsSettingsCommentInstance.php @@ -0,0 +1,84 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'comments' => Values::array_get($payload, 'comments'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsSettingsCommentInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsSettingsCommentList.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsSettingsCommentList.php new file mode 100755 index 0000000..0da084e --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsSettingsCommentList.php @@ -0,0 +1,77 @@ +solution = [ + ]; + + $this->uri = '/Insights/QM/Settings/CommentTags'; + } + + /** + * Fetch the InsightsSettingsCommentInstance + * + * @param array|Options $options Optional Arguments + * @return InsightsSettingsCommentInstance Fetched InsightsSettingsCommentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): InsightsSettingsCommentInstance + { + + $options = new Values($options); + + $headers = Values::of(['Token' => $options['token']]); + + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new InsightsSettingsCommentInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsSettingsCommentList]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsSettingsCommentOptions.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsSettingsCommentOptions.php new file mode 100755 index 0000000..3fbb5a0 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsSettingsCommentOptions.php @@ -0,0 +1,76 @@ +options['token'] = $token; + } + + /** + * The Token HTTP request header + * + * @param string $token The Token HTTP request header + * @return $this Fluent Builder + */ + public function setToken(string $token): self + { + $this->options['token'] = $token; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.FetchInsightsSettingsCommentOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsSettingsCommentPage.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsSettingsCommentPage.php new file mode 100755 index 0000000..4529e4e --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsSettingsCommentPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InsightsSettingsCommentInstance \Twilio\Rest\FlexApi\V1\InsightsSettingsCommentInstance + */ + public function buildInstance(array $payload): InsightsSettingsCommentInstance + { + return new InsightsSettingsCommentInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsSettingsCommentPage]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsUserRolesContext.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsUserRolesContext.php new file mode 100755 index 0000000..1ce45d1 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsUserRolesContext.php @@ -0,0 +1,82 @@ +solution = [ + ]; + + $this->uri = '/Insights/UserRoles'; + } + + /** + * Fetch the InsightsUserRolesInstance + * + * @param array|Options $options Optional Arguments + * @return InsightsUserRolesInstance Fetched InsightsUserRolesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): InsightsUserRolesInstance + { + + $options = new Values($options); + + $headers = Values::of(['Authorization' => $options['authorization']]); + + $payload = $this->version->fetch('GET', $this->uri, [], [], $headers); + + return new InsightsUserRolesInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.InsightsUserRolesContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsUserRolesInstance.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsUserRolesInstance.php new file mode 100755 index 0000000..c4b0eba --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsUserRolesInstance.php @@ -0,0 +1,117 @@ +properties = [ + 'roles' => Values::array_get($payload, 'roles'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = []; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return InsightsUserRolesContext Context for this InsightsUserRolesInstance + */ + protected function proxy(): InsightsUserRolesContext + { + if (!$this->context) { + $this->context = new InsightsUserRolesContext( + $this->version + ); + } + + return $this->context; + } + + /** + * Fetch the InsightsUserRolesInstance + * + * @param array|Options $options Optional Arguments + * @return InsightsUserRolesInstance Fetched InsightsUserRolesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): InsightsUserRolesInstance + { + + return $this->proxy()->fetch($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.InsightsUserRolesInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsUserRolesList.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsUserRolesList.php new file mode 100755 index 0000000..9b42ac2 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsUserRolesList.php @@ -0,0 +1,61 @@ +solution = [ + ]; + } + + /** + * Constructs a InsightsUserRolesContext + */ + public function getContext( + + ): InsightsUserRolesContext + { + return new InsightsUserRolesContext( + $this->version + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsUserRolesList]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsUserRolesOptions.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsUserRolesOptions.php new file mode 100755 index 0000000..288d6c6 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsUserRolesOptions.php @@ -0,0 +1,76 @@ +options['authorization'] = $authorization; + } + + /** + * The Authorization HTTP request header + * + * @param string $authorization The Authorization HTTP request header + * @return $this Fluent Builder + */ + public function setAuthorization(string $authorization): self + { + $this->options['authorization'] = $authorization; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.FetchInsightsUserRolesOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/FlexApi/V1/InsightsUserRolesPage.php b/app/api/Twilio/Rest/FlexApi/V1/InsightsUserRolesPage.php new file mode 100755 index 0000000..85ca36c --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InsightsUserRolesPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InsightsUserRolesInstance \Twilio\Rest\FlexApi\V1\InsightsUserRolesInstance + */ + public function buildInstance(array $payload): InsightsUserRolesInstance + { + return new InsightsUserRolesInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InsightsUserRolesPage]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelInviteInstance.php b/app/api/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelInviteInstance.php new file mode 100755 index 0000000..450ea52 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelInviteInstance.php @@ -0,0 +1,90 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'interactionSid' => Values::array_get($payload, 'interaction_sid'), + 'channelSid' => Values::array_get($payload, 'channel_sid'), + 'routing' => Values::array_get($payload, 'routing'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['interactionSid' => $interactionSid, 'channelSid' => $channelSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InteractionChannelInviteInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelInviteList.php b/app/api/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelInviteList.php new file mode 100755 index 0000000..055c5cb --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelInviteList.php @@ -0,0 +1,185 @@ +solution = [ + 'interactionSid' => + $interactionSid, + + 'channelSid' => + $channelSid, + + ]; + + $this->uri = '/Interactions/' . \rawurlencode($interactionSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Invites'; + } + + /** + * Create the InteractionChannelInviteInstance + * + * @param array $routing The Interaction's routing logic. + * @return InteractionChannelInviteInstance Created InteractionChannelInviteInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $routing): InteractionChannelInviteInstance + { + + $data = Values::of([ + 'Routing' => + Serialize::jsonObject($routing), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new InteractionChannelInviteInstance( + $this->version, + $payload, + $this->solution['interactionSid'], + $this->solution['channelSid'] + ); + } + + + /** + * Reads InteractionChannelInviteInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return InteractionChannelInviteInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams InteractionChannelInviteInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of InteractionChannelInviteInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return InteractionChannelInvitePage Page of InteractionChannelInviteInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): InteractionChannelInvitePage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new InteractionChannelInvitePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of InteractionChannelInviteInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return InteractionChannelInvitePage Page of InteractionChannelInviteInstance + */ + public function getPage(string $targetUrl): InteractionChannelInvitePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new InteractionChannelInvitePage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InteractionChannelInviteList]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelInvitePage.php b/app/api/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelInvitePage.php new file mode 100755 index 0000000..fedcbd1 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelInvitePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InteractionChannelInviteInstance \Twilio\Rest\FlexApi\V1\Interaction\InteractionChannel\InteractionChannelInviteInstance + */ + public function buildInstance(array $payload): InteractionChannelInviteInstance + { + return new InteractionChannelInviteInstance($this->version, $payload, $this->solution['interactionSid'], $this->solution['channelSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InteractionChannelInvitePage]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantContext.php b/app/api/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantContext.php new file mode 100755 index 0000000..461896a --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantContext.php @@ -0,0 +1,100 @@ +solution = [ + 'interactionSid' => + $interactionSid, + 'channelSid' => + $channelSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Interactions/' . \rawurlencode($interactionSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Participants/' . \rawurlencode($sid) + .''; + } + + /** + * Update the InteractionChannelParticipantInstance + * + * @param string $status + * @return InteractionChannelParticipantInstance Updated InteractionChannelParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status): InteractionChannelParticipantInstance + { + + $data = Values::of([ + 'Status' => + $status, + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new InteractionChannelParticipantInstance( + $this->version, + $payload, + $this->solution['interactionSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.InteractionChannelParticipantContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantInstance.php b/app/api/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantInstance.php new file mode 100755 index 0000000..cb6a30a --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantInstance.php @@ -0,0 +1,128 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'type' => Values::array_get($payload, 'type'), + 'interactionSid' => Values::array_get($payload, 'interaction_sid'), + 'channelSid' => Values::array_get($payload, 'channel_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['interactionSid' => $interactionSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return InteractionChannelParticipantContext Context for this InteractionChannelParticipantInstance + */ + protected function proxy(): InteractionChannelParticipantContext + { + if (!$this->context) { + $this->context = new InteractionChannelParticipantContext( + $this->version, + $this->solution['interactionSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Update the InteractionChannelParticipantInstance + * + * @param string $status + * @return InteractionChannelParticipantInstance Updated InteractionChannelParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status): InteractionChannelParticipantInstance + { + + return $this->proxy()->update($status); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.InteractionChannelParticipantInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantList.php b/app/api/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantList.php new file mode 100755 index 0000000..1d04029 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantList.php @@ -0,0 +1,206 @@ +solution = [ + 'interactionSid' => + $interactionSid, + + 'channelSid' => + $channelSid, + + ]; + + $this->uri = '/Interactions/' . \rawurlencode($interactionSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Participants'; + } + + /** + * Create the InteractionChannelParticipantInstance + * + * @param string $type + * @param array $mediaProperties JSON representing the Media Properties for the new Participant. + * @return InteractionChannelParticipantInstance Created InteractionChannelParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $type, array $mediaProperties): InteractionChannelParticipantInstance + { + + $data = Values::of([ + 'Type' => + $type, + 'MediaProperties' => + Serialize::jsonObject($mediaProperties), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new InteractionChannelParticipantInstance( + $this->version, + $payload, + $this->solution['interactionSid'], + $this->solution['channelSid'] + ); + } + + + /** + * Reads InteractionChannelParticipantInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return InteractionChannelParticipantInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams InteractionChannelParticipantInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of InteractionChannelParticipantInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return InteractionChannelParticipantPage Page of InteractionChannelParticipantInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): InteractionChannelParticipantPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new InteractionChannelParticipantPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of InteractionChannelParticipantInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return InteractionChannelParticipantPage Page of InteractionChannelParticipantInstance + */ + public function getPage(string $targetUrl): InteractionChannelParticipantPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new InteractionChannelParticipantPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a InteractionChannelParticipantContext + * + * @param string $sid The unique string created by Twilio to identify an Interaction Channel resource. + */ + public function getContext( + string $sid + + ): InteractionChannelParticipantContext + { + return new InteractionChannelParticipantContext( + $this->version, + $this->solution['interactionSid'], + $this->solution['channelSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InteractionChannelParticipantList]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantPage.php b/app/api/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantPage.php new file mode 100755 index 0000000..74539f5 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannel/InteractionChannelParticipantPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InteractionChannelParticipantInstance \Twilio\Rest\FlexApi\V1\Interaction\InteractionChannel\InteractionChannelParticipantInstance + */ + public function buildInstance(array $payload): InteractionChannelParticipantInstance + { + return new InteractionChannelParticipantInstance($this->version, $payload, $this->solution['interactionSid'], $this->solution['channelSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InteractionChannelParticipantPage]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelContext.php b/app/api/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelContext.php new file mode 100755 index 0000000..7ac1599 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelContext.php @@ -0,0 +1,199 @@ +solution = [ + 'interactionSid' => + $interactionSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Interactions/' . \rawurlencode($interactionSid) + .'/Channels/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the InteractionChannelInstance + * + * @return InteractionChannelInstance Fetched InteractionChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InteractionChannelInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new InteractionChannelInstance( + $this->version, + $payload, + $this->solution['interactionSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the InteractionChannelInstance + * + * @param string $status + * @param array|Options $options Optional Arguments + * @return InteractionChannelInstance Updated InteractionChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status, array $options = []): InteractionChannelInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Status' => + $status, + 'Routing' => + Serialize::jsonObject($options['routing']), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new InteractionChannelInstance( + $this->version, + $payload, + $this->solution['interactionSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the participants + */ + protected function getParticipants(): InteractionChannelParticipantList + { + if (!$this->_participants) { + $this->_participants = new InteractionChannelParticipantList( + $this->version, + $this->solution['interactionSid'], + $this->solution['sid'] + ); + } + + return $this->_participants; + } + + /** + * Access the invites + */ + protected function getInvites(): InteractionChannelInviteList + { + if (!$this->_invites) { + $this->_invites = new InteractionChannelInviteList( + $this->version, + $this->solution['interactionSid'], + $this->solution['sid'] + ); + } + + return $this->_invites; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.InteractionChannelContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelInstance.php b/app/api/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelInstance.php new file mode 100755 index 0000000..ea8bc42 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelInstance.php @@ -0,0 +1,167 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'interactionSid' => Values::array_get($payload, 'interaction_sid'), + 'type' => Values::array_get($payload, 'type'), + 'status' => Values::array_get($payload, 'status'), + 'errorCode' => Values::array_get($payload, 'error_code'), + 'errorMessage' => Values::array_get($payload, 'error_message'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['interactionSid' => $interactionSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return InteractionChannelContext Context for this InteractionChannelInstance + */ + protected function proxy(): InteractionChannelContext + { + if (!$this->context) { + $this->context = new InteractionChannelContext( + $this->version, + $this->solution['interactionSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the InteractionChannelInstance + * + * @return InteractionChannelInstance Fetched InteractionChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InteractionChannelInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the InteractionChannelInstance + * + * @param string $status + * @param array|Options $options Optional Arguments + * @return InteractionChannelInstance Updated InteractionChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status, array $options = []): InteractionChannelInstance + { + + return $this->proxy()->update($status, $options); + } + + /** + * Access the participants + */ + protected function getParticipants(): InteractionChannelParticipantList + { + return $this->proxy()->participants; + } + + /** + * Access the invites + */ + protected function getInvites(): InteractionChannelInviteList + { + return $this->proxy()->invites; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.InteractionChannelInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelList.php b/app/api/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelList.php new file mode 100755 index 0000000..b18966d --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelList.php @@ -0,0 +1,168 @@ +solution = [ + 'interactionSid' => + $interactionSid, + + ]; + + $this->uri = '/Interactions/' . \rawurlencode($interactionSid) + .'/Channels'; + } + + /** + * Reads InteractionChannelInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return InteractionChannelInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams InteractionChannelInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of InteractionChannelInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return InteractionChannelPage Page of InteractionChannelInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): InteractionChannelPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new InteractionChannelPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of InteractionChannelInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return InteractionChannelPage Page of InteractionChannelInstance + */ + public function getPage(string $targetUrl): InteractionChannelPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new InteractionChannelPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a InteractionChannelContext + * + * @param string $sid The unique string created by Twilio to identify an Interaction Channel resource, prefixed with UO. + */ + public function getContext( + string $sid + + ): InteractionChannelContext + { + return new InteractionChannelContext( + $this->version, + $this->solution['interactionSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InteractionChannelList]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelOptions.php b/app/api/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelOptions.php new file mode 100755 index 0000000..062c274 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelOptions.php @@ -0,0 +1,80 @@ +options['routing'] = $routing; + } + + /** + * Optional. The state of associated tasks. If not specified, all tasks will be set to `wrapping`. + * + * @param array $routing Optional. The state of associated tasks. If not specified, all tasks will be set to `wrapping`. + * @return $this Fluent Builder + */ + public function setRouting(array $routing): self + { + $this->options['routing'] = $routing; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.UpdateInteractionChannelOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelPage.php b/app/api/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelPage.php new file mode 100755 index 0000000..cd2255e --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/Interaction/InteractionChannelPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InteractionChannelInstance \Twilio\Rest\FlexApi\V1\Interaction\InteractionChannelInstance + */ + public function buildInstance(array $payload): InteractionChannelInstance + { + return new InteractionChannelInstance($this->version, $payload, $this->solution['interactionSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InteractionChannelPage]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/InteractionContext.php b/app/api/Twilio/Rest/FlexApi/V1/InteractionContext.php new file mode 100755 index 0000000..bcc89f1 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InteractionContext.php @@ -0,0 +1,139 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Interactions/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the InteractionInstance + * + * @return InteractionInstance Fetched InteractionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InteractionInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new InteractionInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the channels + */ + protected function getChannels(): InteractionChannelList + { + if (!$this->_channels) { + $this->_channels = new InteractionChannelList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_channels; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.InteractionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/InteractionInstance.php b/app/api/Twilio/Rest/FlexApi/V1/InteractionInstance.php new file mode 100755 index 0000000..71b20ab --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InteractionInstance.php @@ -0,0 +1,134 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'channel' => Values::array_get($payload, 'channel'), + 'routing' => Values::array_get($payload, 'routing'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return InteractionContext Context for this InteractionInstance + */ + protected function proxy(): InteractionContext + { + if (!$this->context) { + $this->context = new InteractionContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the InteractionInstance + * + * @return InteractionInstance Fetched InteractionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InteractionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the channels + */ + protected function getChannels(): InteractionChannelList + { + return $this->proxy()->channels; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.InteractionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/FlexApi/V1/InteractionList.php b/app/api/Twilio/Rest/FlexApi/V1/InteractionList.php new file mode 100755 index 0000000..92253b1 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InteractionList.php @@ -0,0 +1,97 @@ +solution = [ + ]; + + $this->uri = '/Interactions'; + } + + /** + * Create the InteractionInstance + * + * @param array $channel The Interaction's channel. + * @param array $routing The Interaction's routing logic. + * @return InteractionInstance Created InteractionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $channel, array $routing): InteractionInstance + { + + $data = Values::of([ + 'Channel' => + Serialize::jsonObject($channel), + 'Routing' => + Serialize::jsonObject($routing), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new InteractionInstance( + $this->version, + $payload + ); + } + + + /** + * Constructs a InteractionContext + * + * @param string $sid The SID of the Interaction resource to fetch. + */ + public function getContext( + string $sid + + ): InteractionContext + { + return new InteractionContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InteractionList]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/InteractionPage.php b/app/api/Twilio/Rest/FlexApi/V1/InteractionPage.php new file mode 100755 index 0000000..9c79fd3 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/InteractionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InteractionInstance \Twilio\Rest\FlexApi\V1\InteractionInstance + */ + public function buildInstance(array $payload): InteractionInstance + { + return new InteractionInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.InteractionPage]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/WebChannelContext.php b/app/api/Twilio/Rest/FlexApi/V1/WebChannelContext.php new file mode 100755 index 0000000..adf25f7 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/WebChannelContext.php @@ -0,0 +1,125 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/WebChannels/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the WebChannelInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the WebChannelInstance + * + * @return WebChannelInstance Fetched WebChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WebChannelInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new WebChannelInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the WebChannelInstance + * + * @param array|Options $options Optional Arguments + * @return WebChannelInstance Updated WebChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WebChannelInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'ChatStatus' => + $options['chatStatus'], + 'PostEngagementData' => + $options['postEngagementData'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new WebChannelInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.WebChannelContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/WebChannelInstance.php b/app/api/Twilio/Rest/FlexApi/V1/WebChannelInstance.php new file mode 100755 index 0000000..7d3d41b --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/WebChannelInstance.php @@ -0,0 +1,152 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'flexFlowSid' => Values::array_get($payload, 'flex_flow_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'url' => Values::array_get($payload, 'url'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return WebChannelContext Context for this WebChannelInstance + */ + protected function proxy(): WebChannelContext + { + if (!$this->context) { + $this->context = new WebChannelContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the WebChannelInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the WebChannelInstance + * + * @return WebChannelInstance Fetched WebChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WebChannelInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the WebChannelInstance + * + * @param array|Options $options Optional Arguments + * @return WebChannelInstance Updated WebChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WebChannelInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FlexApi.V1.WebChannelInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/FlexApi/V1/WebChannelList.php b/app/api/Twilio/Rest/FlexApi/V1/WebChannelList.php new file mode 100755 index 0000000..b7e992e --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/WebChannelList.php @@ -0,0 +1,203 @@ +solution = [ + ]; + + $this->uri = '/WebChannels'; + } + + /** + * Create the WebChannelInstance + * + * @param string $flexFlowSid The SID of the Flex Flow. + * @param string $identity The chat identity. + * @param string $customerFriendlyName The chat participant's friendly name. + * @param string $chatFriendlyName The chat channel's friendly name. + * @param array|Options $options Optional Arguments + * @return WebChannelInstance Created WebChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $flexFlowSid, string $identity, string $customerFriendlyName, string $chatFriendlyName, array $options = []): WebChannelInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FlexFlowSid' => + $flexFlowSid, + 'Identity' => + $identity, + 'CustomerFriendlyName' => + $customerFriendlyName, + 'ChatFriendlyName' => + $chatFriendlyName, + 'ChatUniqueName' => + $options['chatUniqueName'], + 'PreEngagementData' => + $options['preEngagementData'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new WebChannelInstance( + $this->version, + $payload + ); + } + + + /** + * Reads WebChannelInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return WebChannelInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams WebChannelInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of WebChannelInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return WebChannelPage Page of WebChannelInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): WebChannelPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new WebChannelPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of WebChannelInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return WebChannelPage Page of WebChannelInstance + */ + public function getPage(string $targetUrl): WebChannelPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new WebChannelPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a WebChannelContext + * + * @param string $sid The SID of the WebChannel resource to delete. + */ + public function getContext( + string $sid + + ): WebChannelContext + { + return new WebChannelContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.WebChannelList]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V1/WebChannelOptions.php b/app/api/Twilio/Rest/FlexApi/V1/WebChannelOptions.php new file mode 100755 index 0000000..8c01d4a --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/WebChannelOptions.php @@ -0,0 +1,168 @@ +options['chatUniqueName'] = $chatUniqueName; + $this->options['preEngagementData'] = $preEngagementData; + } + + /** + * The chat channel's unique name. + * + * @param string $chatUniqueName The chat channel's unique name. + * @return $this Fluent Builder + */ + public function setChatUniqueName(string $chatUniqueName): self + { + $this->options['chatUniqueName'] = $chatUniqueName; + return $this; + } + + /** + * The pre-engagement data. + * + * @param string $preEngagementData The pre-engagement data. + * @return $this Fluent Builder + */ + public function setPreEngagementData(string $preEngagementData): self + { + $this->options['preEngagementData'] = $preEngagementData; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.CreateWebChannelOptions ' . $options . ']'; + } +} + + + + +class UpdateWebChannelOptions extends Options + { + /** + * @param string $chatStatus + * @param string $postEngagementData The post-engagement data. + */ + public function __construct( + + string $chatStatus = Values::NONE, + string $postEngagementData = Values::NONE + + ) { + $this->options['chatStatus'] = $chatStatus; + $this->options['postEngagementData'] = $postEngagementData; + } + + /** + * @param string $chatStatus + * @return $this Fluent Builder + */ + public function setChatStatus(string $chatStatus): self + { + $this->options['chatStatus'] = $chatStatus; + return $this; + } + + /** + * The post-engagement data. + * + * @param string $postEngagementData The post-engagement data. + * @return $this Fluent Builder + */ + public function setPostEngagementData(string $postEngagementData): self + { + $this->options['postEngagementData'] = $postEngagementData; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V1.UpdateWebChannelOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/FlexApi/V1/WebChannelPage.php b/app/api/Twilio/Rest/FlexApi/V1/WebChannelPage.php new file mode 100755 index 0000000..db3304d --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V1/WebChannelPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WebChannelInstance \Twilio\Rest\FlexApi\V1\WebChannelInstance + */ + public function buildInstance(array $payload): WebChannelInstance + { + return new WebChannelInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V1.WebChannelPage]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V2.php b/app/api/Twilio/Rest/FlexApi/V2.php new file mode 100755 index 0000000..9ddacb8 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V2.php @@ -0,0 +1,94 @@ +version = 'v2'; + } + + protected function getWebChannels(): WebChannelsList + { + if (!$this->_webChannels) { + $this->_webChannels = new WebChannelsList($this); + } + return $this->_webChannels; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V2]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V2/WebChannelsInstance.php b/app/api/Twilio/Rest/FlexApi/V2/WebChannelsInstance.php new file mode 100755 index 0000000..d7f5250 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V2/WebChannelsInstance.php @@ -0,0 +1,82 @@ +properties = [ + 'conversationSid' => Values::array_get($payload, 'conversation_sid'), + 'identity' => Values::array_get($payload, 'identity'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V2.WebChannelsInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/FlexApi/V2/WebChannelsList.php b/app/api/Twilio/Rest/FlexApi/V2/WebChannelsList.php new file mode 100755 index 0000000..e0a785e --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V2/WebChannelsList.php @@ -0,0 +1,87 @@ +solution = [ + ]; + + $this->uri = '/WebChats'; + } + + /** + * Create the WebChannelsInstance + * + * @param string $addressSid The SID of the Conversations Address. See [Address Configuration Resource](https://www.twilio.com/docs/conversations/api/address-configuration-resource) for configuration details. When a conversation is created on the Flex backend, the callback URL will be set to the corresponding Studio Flow SID or webhook URL in your address configuration. + * @param array|Options $options Optional Arguments + * @return WebChannelsInstance Created WebChannelsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $addressSid, array $options = []): WebChannelsInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'AddressSid' => + $addressSid, + 'ChatFriendlyName' => + $options['chatFriendlyName'], + 'CustomerFriendlyName' => + $options['customerFriendlyName'], + 'PreEngagementData' => + $options['preEngagementData'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new WebChannelsInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V2.WebChannelsList]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApi/V2/WebChannelsOptions.php b/app/api/Twilio/Rest/FlexApi/V2/WebChannelsOptions.php new file mode 100755 index 0000000..fc31760 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V2/WebChannelsOptions.php @@ -0,0 +1,112 @@ +options['chatFriendlyName'] = $chatFriendlyName; + $this->options['customerFriendlyName'] = $customerFriendlyName; + $this->options['preEngagementData'] = $preEngagementData; + } + + /** + * The Conversation's friendly name. See the [Conversation resource](https://www.twilio.com/docs/conversations/api/conversation-resource) for an example. + * + * @param string $chatFriendlyName The Conversation's friendly name. See the [Conversation resource](https://www.twilio.com/docs/conversations/api/conversation-resource) for an example. + * @return $this Fluent Builder + */ + public function setChatFriendlyName(string $chatFriendlyName): self + { + $this->options['chatFriendlyName'] = $chatFriendlyName; + return $this; + } + + /** + * The Conversation participant's friendly name. See the [Conversation Participant Resource](https://www.twilio.com/docs/conversations/api/conversation-participant-resource) for an example. + * + * @param string $customerFriendlyName The Conversation participant's friendly name. See the [Conversation Participant Resource](https://www.twilio.com/docs/conversations/api/conversation-participant-resource) for an example. + * @return $this Fluent Builder + */ + public function setCustomerFriendlyName(string $customerFriendlyName): self + { + $this->options['customerFriendlyName'] = $customerFriendlyName; + return $this; + } + + /** + * The pre-engagement data. + * + * @param string $preEngagementData The pre-engagement data. + * @return $this Fluent Builder + */ + public function setPreEngagementData(string $preEngagementData): self + { + $this->options['preEngagementData'] = $preEngagementData; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FlexApi.V2.CreateWebChannelsOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/FlexApi/V2/WebChannelsPage.php b/app/api/Twilio/Rest/FlexApi/V2/WebChannelsPage.php new file mode 100755 index 0000000..273096d --- /dev/null +++ b/app/api/Twilio/Rest/FlexApi/V2/WebChannelsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WebChannelsInstance \Twilio\Rest\FlexApi\V2\WebChannelsInstance + */ + public function buildInstance(array $payload): WebChannelsInstance + { + return new WebChannelsInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FlexApi.V2.WebChannelsPage]'; + } +} diff --git a/app/api/Twilio/Rest/FlexApiBase.php b/app/api/Twilio/Rest/FlexApiBase.php new file mode 100755 index 0000000..20978b6 --- /dev/null +++ b/app/api/Twilio/Rest/FlexApiBase.php @@ -0,0 +1,101 @@ +baseUrl = 'https://flex-api.twilio.com'; + } + + + /** + * @return V1 Version v1 of flex-api + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * @return V2 Version v2 of flex-api + */ + protected function getV2(): V2 { + if (!$this->_v2) { + $this->_v2 = new V2($this); + } + return $this->_v2; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.FlexApi]'; + } +} diff --git a/app/api/Twilio/Rest/FrontlineApi.php b/app/api/Twilio/Rest/FrontlineApi.php new file mode 100755 index 0000000..24a80f5 --- /dev/null +++ b/app/api/Twilio/Rest/FrontlineApi.php @@ -0,0 +1,25 @@ +users instead. + */ + protected function getUsers(): \Twilio\Rest\FrontlineApi\V1\UserList { + echo "users is deprecated. Use v1->users instead."; + return $this->v1->users; + } + + /** + * @deprecated Use v1->users(\$sid) instead. + * @param string $sid The SID of the User resource to fetch + */ + protected function contextUsers(string $sid): \Twilio\Rest\FrontlineApi\V1\UserContext { + echo "users(\$sid) is deprecated. Use v1->users(\$sid) instead."; + return $this->v1->users($sid); + } +} \ No newline at end of file diff --git a/app/api/Twilio/Rest/FrontlineApi/V1.php b/app/api/Twilio/Rest/FrontlineApi/V1.php new file mode 100755 index 0000000..afc4e4f --- /dev/null +++ b/app/api/Twilio/Rest/FrontlineApi/V1.php @@ -0,0 +1,95 @@ +version = 'v1'; + } + + protected function getUsers(): UserList + { + if (!$this->_users) { + $this->_users = new UserList($this); + } + return $this->_users; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FrontlineApi.V1]'; + } +} diff --git a/app/api/Twilio/Rest/FrontlineApi/V1/UserContext.php b/app/api/Twilio/Rest/FrontlineApi/V1/UserContext.php new file mode 100755 index 0000000..c66ef22 --- /dev/null +++ b/app/api/Twilio/Rest/FrontlineApi/V1/UserContext.php @@ -0,0 +1,117 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Users/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the UserInstance + * + * @return UserInstance Fetched UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new UserInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the UserInstance + * + * @param array|Options $options Optional Arguments + * @return UserInstance Updated UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'Avatar' => + $options['avatar'], + 'State' => + $options['state'], + 'IsAvailable' => + Serialize::booleanToString($options['isAvailable']), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new UserInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FrontlineApi.V1.UserContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/FrontlineApi/V1/UserInstance.php b/app/api/Twilio/Rest/FrontlineApi/V1/UserInstance.php new file mode 100755 index 0000000..1b86cf4 --- /dev/null +++ b/app/api/Twilio/Rest/FrontlineApi/V1/UserInstance.php @@ -0,0 +1,141 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'avatar' => Values::array_get($payload, 'avatar'), + 'state' => Values::array_get($payload, 'state'), + 'isAvailable' => Values::array_get($payload, 'is_available'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return UserContext Context for this UserInstance + */ + protected function proxy(): UserContext + { + if (!$this->context) { + $this->context = new UserContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the UserInstance + * + * @return UserInstance Fetched UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the UserInstance + * + * @param array|Options $options Optional Arguments + * @return UserInstance Updated UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.FrontlineApi.V1.UserInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/FrontlineApi/V1/UserList.php b/app/api/Twilio/Rest/FrontlineApi/V1/UserList.php new file mode 100755 index 0000000..9540bac --- /dev/null +++ b/app/api/Twilio/Rest/FrontlineApi/V1/UserList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a UserContext + * + * @param string $sid The SID of the User resource to fetch. This value can be either the `sid` or the `identity` of the User resource to fetch. + */ + public function getContext( + string $sid + + ): UserContext + { + return new UserContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FrontlineApi.V1.UserList]'; + } +} diff --git a/app/api/Twilio/Rest/FrontlineApi/V1/UserOptions.php b/app/api/Twilio/Rest/FrontlineApi/V1/UserOptions.php new file mode 100755 index 0000000..4626809 --- /dev/null +++ b/app/api/Twilio/Rest/FrontlineApi/V1/UserOptions.php @@ -0,0 +1,130 @@ +options['friendlyName'] = $friendlyName; + $this->options['avatar'] = $avatar; + $this->options['state'] = $state; + $this->options['isAvailable'] = $isAvailable; + } + + /** + * The string that you assigned to describe the User. + * + * @param string $friendlyName The string that you assigned to describe the User. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The avatar URL which will be shown in Frontline application. + * + * @param string $avatar The avatar URL which will be shown in Frontline application. + * @return $this Fluent Builder + */ + public function setAvatar(string $avatar): self + { + $this->options['avatar'] = $avatar; + return $this; + } + + /** + * @param string $state + * @return $this Fluent Builder + */ + public function setState(string $state): self + { + $this->options['state'] = $state; + return $this; + } + + /** + * Whether the User is available for new conversations. Set to `false` to prevent User from receiving new inbound conversations if you are using [Pool Routing](https://www.twilio.com/docs/frontline/handle-incoming-conversations#3-pool-routing). + * + * @param bool $isAvailable Whether the User is available for new conversations. Set to `false` to prevent User from receiving new inbound conversations if you are using [Pool Routing](https://www.twilio.com/docs/frontline/handle-incoming-conversations#3-pool-routing). + * @return $this Fluent Builder + */ + public function setIsAvailable(bool $isAvailable): self + { + $this->options['isAvailable'] = $isAvailable; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.FrontlineApi.V1.UpdateUserOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/FrontlineApi/V1/UserPage.php b/app/api/Twilio/Rest/FrontlineApi/V1/UserPage.php new file mode 100755 index 0000000..a03a8fc --- /dev/null +++ b/app/api/Twilio/Rest/FrontlineApi/V1/UserPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UserInstance \Twilio\Rest\FrontlineApi\V1\UserInstance + */ + public function buildInstance(array $payload): UserInstance + { + return new UserInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.FrontlineApi.V1.UserPage]'; + } +} diff --git a/app/api/Twilio/Rest/FrontlineApiBase.php b/app/api/Twilio/Rest/FrontlineApiBase.php new file mode 100755 index 0000000..bdd5225 --- /dev/null +++ b/app/api/Twilio/Rest/FrontlineApiBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://frontline-api.twilio.com'; + } + + + /** + * @return V1 Version v1 of frontline-api + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.FrontlineApi]'; + } +} diff --git a/app/api/Twilio/Rest/Insights.php b/app/api/Twilio/Rest/Insights.php new file mode 100755 index 0000000..5b1261d --- /dev/null +++ b/app/api/Twilio/Rest/Insights.php @@ -0,0 +1,83 @@ +settings instead. + */ + protected function getSettings(): \Twilio\Rest\Insights\V1\SettingList { + echo "settings is deprecated. Use v1->settings instead."; + return $this->v1->settings; + } + + /** + * @deprecated Use v1->settings() instead. + */ + protected function contextSettings(): \Twilio\Rest\Insights\V1\SettingContext { + echo "settings() is deprecated. Use v1->settings() instead."; + return $this->v1->settings(); + } + + /** + * @deprecated Use v1->calls instead. + */ + protected function getCalls(): \Twilio\Rest\Insights\V1\CallList { + echo "calls is deprecated. Use v1->calls instead."; + return $this->v1->calls; + } + + /** + * @deprecated Use v1->calls(\$sid) instead. + * @param string $sid The sid + */ + protected function contextCalls(string $sid): \Twilio\Rest\Insights\V1\CallContext { + echo "calls(\$sid) is deprecated. Use v1->calls(\$sid) instead."; + return $this->v1->calls($sid); + } + + /** + * @deprecated Use v1->callSummaries instead. + */ + protected function getCallSummaries(): \Twilio\Rest\Insights\V1\CallSummariesList { + echo "callSummaries is deprecated. Use v1->callSummaries instead."; + return $this->v1->callSummaries; + } + + /** + * @deprecated Use v1->conferences instead. + */ + protected function getConferences(): \Twilio\Rest\Insights\V1\ConferenceList { + echo "conferences is deprecated. Use v1->conferences instead."; + return $this->v1->conferences; + } + + /** + * @deprecated Use v1->conferences(\$conferenceSid) instead. + * @param string $conferenceSid Conference SID. + */ + protected function contextConferences(string $conferenceSid): \Twilio\Rest\Insights\V1\ConferenceContext { + echo "conferences(\$conferenceSid) is deprecated. Use v1->conferences(\$conferenceSid) instead."; + return $this->v1->conferences($conferenceSid); + } + + /** + * @deprecated Use v1->rooms instead. + */ + protected function getRooms(): \Twilio\Rest\Insights\V1\RoomList { + echo "rooms is deprecated. Use v1->rooms instead."; + return $this->v1->rooms; + } + + /** + * @deprecated Use v1->rooms(\$roomSid) instead. + * @param string $roomSid The SID of the Room resource. + */ + protected function contextRooms(string $roomSid): \Twilio\Rest\Insights\V1\RoomContext { + echo "rooms(\$roomSid) is deprecated. Use v1->rooms(\$roomSid) instead."; + return $this->v1->rooms($roomSid); + } +} \ No newline at end of file diff --git a/app/api/Twilio/Rest/Insights/V1.php b/app/api/Twilio/Rest/Insights/V1.php new file mode 100755 index 0000000..d75c5d3 --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1.php @@ -0,0 +1,141 @@ +version = 'v1'; + } + + protected function getCalls(): CallList + { + if (!$this->_calls) { + $this->_calls = new CallList($this); + } + return $this->_calls; + } + + protected function getCallSummaries(): CallSummariesList + { + if (!$this->_callSummaries) { + $this->_callSummaries = new CallSummariesList($this); + } + return $this->_callSummaries; + } + + protected function getConferences(): ConferenceList + { + if (!$this->_conferences) { + $this->_conferences = new ConferenceList($this); + } + return $this->_conferences; + } + + protected function getRooms(): RoomList + { + if (!$this->_rooms) { + $this->_rooms = new RoomList($this); + } + return $this->_rooms; + } + + protected function getSettings(): SettingList + { + if (!$this->_settings) { + $this->_settings = new SettingList($this); + } + return $this->_settings; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1]'; + } +} diff --git a/app/api/Twilio/Rest/Insights/V1/Call/AnnotationContext.php b/app/api/Twilio/Rest/Insights/V1/Call/AnnotationContext.php new file mode 100755 index 0000000..1563932 --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/Call/AnnotationContext.php @@ -0,0 +1,123 @@ +solution = [ + 'callSid' => + $callSid, + ]; + + $this->uri = '/Voice/' . \rawurlencode($callSid) + .'/Annotation'; + } + + /** + * Fetch the AnnotationInstance + * + * @return AnnotationInstance Fetched AnnotationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AnnotationInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new AnnotationInstance( + $this->version, + $payload, + $this->solution['callSid'] + ); + } + + + /** + * Update the AnnotationInstance + * + * @param array|Options $options Optional Arguments + * @return AnnotationInstance Updated AnnotationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): AnnotationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'AnsweredBy' => + $options['answeredBy'], + 'ConnectivityIssue' => + $options['connectivityIssue'], + 'QualityIssues' => + $options['qualityIssues'], + 'Spam' => + Serialize::booleanToString($options['spam']), + 'CallScore' => + $options['callScore'], + 'Comment' => + $options['comment'], + 'Incident' => + $options['incident'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new AnnotationInstance( + $this->version, + $payload, + $this->solution['callSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Insights.V1.AnnotationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Insights/V1/Call/AnnotationInstance.php b/app/api/Twilio/Rest/Insights/V1/Call/AnnotationInstance.php new file mode 100755 index 0000000..6fc3e63 --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/Call/AnnotationInstance.php @@ -0,0 +1,147 @@ +properties = [ + 'callSid' => Values::array_get($payload, 'call_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'answeredBy' => Values::array_get($payload, 'answered_by'), + 'connectivityIssue' => Values::array_get($payload, 'connectivity_issue'), + 'qualityIssues' => Values::array_get($payload, 'quality_issues'), + 'spam' => Values::array_get($payload, 'spam'), + 'callScore' => Values::array_get($payload, 'call_score'), + 'comment' => Values::array_get($payload, 'comment'), + 'incident' => Values::array_get($payload, 'incident'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['callSid' => $callSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AnnotationContext Context for this AnnotationInstance + */ + protected function proxy(): AnnotationContext + { + if (!$this->context) { + $this->context = new AnnotationContext( + $this->version, + $this->solution['callSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the AnnotationInstance + * + * @return AnnotationInstance Fetched AnnotationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AnnotationInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the AnnotationInstance + * + * @param array|Options $options Optional Arguments + * @return AnnotationInstance Updated AnnotationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): AnnotationInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Insights.V1.AnnotationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Insights/V1/Call/AnnotationList.php b/app/api/Twilio/Rest/Insights/V1/Call/AnnotationList.php new file mode 100755 index 0000000..7f4b7d0 --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/Call/AnnotationList.php @@ -0,0 +1,67 @@ +solution = [ + 'callSid' => + $callSid, + + ]; + } + + /** + * Constructs a AnnotationContext + */ + public function getContext( + + ): AnnotationContext + { + return new AnnotationContext( + $this->version, + $this->solution['callSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.AnnotationList]'; + } +} diff --git a/app/api/Twilio/Rest/Insights/V1/Call/AnnotationOptions.php b/app/api/Twilio/Rest/Insights/V1/Call/AnnotationOptions.php new file mode 100755 index 0000000..3c83864 --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/Call/AnnotationOptions.php @@ -0,0 +1,182 @@ +options['answeredBy'] = $answeredBy; + $this->options['connectivityIssue'] = $connectivityIssue; + $this->options['qualityIssues'] = $qualityIssues; + $this->options['spam'] = $spam; + $this->options['callScore'] = $callScore; + $this->options['comment'] = $comment; + $this->options['incident'] = $incident; + } + + /** + * @param string $answeredBy + * @return $this Fluent Builder + */ + public function setAnsweredBy(string $answeredBy): self + { + $this->options['answeredBy'] = $answeredBy; + return $this; + } + + /** + * @param string $connectivityIssue + * @return $this Fluent Builder + */ + public function setConnectivityIssue(string $connectivityIssue): self + { + $this->options['connectivityIssue'] = $connectivityIssue; + return $this; + } + + /** + * Specify if the call had any subjective quality issues. Possible values, one or more of: no_quality_issue, low_volume, choppy_robotic, echo, dtmf, latency, owa, static_noise. Use comma separated values to indicate multiple quality issues for the same call + * + * @param string $qualityIssues Specify if the call had any subjective quality issues. Possible values, one or more of: no_quality_issue, low_volume, choppy_robotic, echo, dtmf, latency, owa, static_noise. Use comma separated values to indicate multiple quality issues for the same call + * @return $this Fluent Builder + */ + public function setQualityIssues(string $qualityIssues): self + { + $this->options['qualityIssues'] = $qualityIssues; + return $this; + } + + /** + * Specify if the call was a spam call. Use this to provide feedback on whether calls placed from your account were marked as spam, or if inbound calls received by your account were unwanted spam. Is of type Boolean: true, false. Use true if the call was a spam call. + * + * @param bool $spam Specify if the call was a spam call. Use this to provide feedback on whether calls placed from your account were marked as spam, or if inbound calls received by your account were unwanted spam. Is of type Boolean: true, false. Use true if the call was a spam call. + * @return $this Fluent Builder + */ + public function setSpam(bool $spam): self + { + $this->options['spam'] = $spam; + return $this; + } + + /** + * Specify the call score. This is of type integer. Use a range of 1-5 to indicate the call experience score, with the following mapping as a reference for rating the call [5: Excellent, 4: Good, 3 : Fair, 2 : Poor, 1: Bad]. + * + * @param int $callScore Specify the call score. This is of type integer. Use a range of 1-5 to indicate the call experience score, with the following mapping as a reference for rating the call [5: Excellent, 4: Good, 3 : Fair, 2 : Poor, 1: Bad]. + * @return $this Fluent Builder + */ + public function setCallScore(int $callScore): self + { + $this->options['callScore'] = $callScore; + return $this; + } + + /** + * Specify any comments pertaining to the call. This of type string with a max limit of 100 characters. Twilio does not treat this field as PII, so don’t put any PII in here. + * + * @param string $comment Specify any comments pertaining to the call. This of type string with a max limit of 100 characters. Twilio does not treat this field as PII, so don’t put any PII in here. + * @return $this Fluent Builder + */ + public function setComment(string $comment): self + { + $this->options['comment'] = $comment; + return $this; + } + + /** + * Associate this call with an incident or support ticket. This is of type string with a max limit of 100 characters. Twilio does not treat this field as PII, so don’t put any PII in here. + * + * @param string $incident Associate this call with an incident or support ticket. This is of type string with a max limit of 100 characters. Twilio does not treat this field as PII, so don’t put any PII in here. + * @return $this Fluent Builder + */ + public function setIncident(string $incident): self + { + $this->options['incident'] = $incident; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Insights.V1.UpdateAnnotationOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Insights/V1/Call/AnnotationPage.php b/app/api/Twilio/Rest/Insights/V1/Call/AnnotationPage.php new file mode 100755 index 0000000..9d28798 --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/Call/AnnotationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AnnotationInstance \Twilio\Rest\Insights\V1\Call\AnnotationInstance + */ + public function buildInstance(array $payload): AnnotationInstance + { + return new AnnotationInstance($this->version, $payload, $this->solution['callSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.AnnotationPage]'; + } +} diff --git a/app/api/Twilio/Rest/Insights/V1/Call/CallSummaryContext.php b/app/api/Twilio/Rest/Insights/V1/Call/CallSummaryContext.php new file mode 100755 index 0000000..ff88a98 --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/Call/CallSummaryContext.php @@ -0,0 +1,91 @@ +solution = [ + 'callSid' => + $callSid, + ]; + + $this->uri = '/Voice/' . \rawurlencode($callSid) + .'/Summary'; + } + + /** + * Fetch the CallSummaryInstance + * + * @param array|Options $options Optional Arguments + * @return CallSummaryInstance Fetched CallSummaryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): CallSummaryInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'ProcessingState' => + $options['processingState'], + ]); + + $payload = $this->version->fetch('GET', $this->uri, $params); + + return new CallSummaryInstance( + $this->version, + $payload, + $this->solution['callSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Insights.V1.CallSummaryContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Insights/V1/Call/CallSummaryInstance.php b/app/api/Twilio/Rest/Insights/V1/Call/CallSummaryInstance.php new file mode 100755 index 0000000..0aba4e0 --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/Call/CallSummaryInstance.php @@ -0,0 +1,162 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'callSid' => Values::array_get($payload, 'call_sid'), + 'callType' => Values::array_get($payload, 'call_type'), + 'callState' => Values::array_get($payload, 'call_state'), + 'answeredBy' => Values::array_get($payload, 'answered_by'), + 'processingState' => Values::array_get($payload, 'processing_state'), + 'createdTime' => Deserialize::dateTime(Values::array_get($payload, 'created_time')), + 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), + 'endTime' => Deserialize::dateTime(Values::array_get($payload, 'end_time')), + 'duration' => Values::array_get($payload, 'duration'), + 'connectDuration' => Values::array_get($payload, 'connect_duration'), + 'from' => Values::array_get($payload, 'from'), + 'to' => Values::array_get($payload, 'to'), + 'carrierEdge' => Values::array_get($payload, 'carrier_edge'), + 'clientEdge' => Values::array_get($payload, 'client_edge'), + 'sdkEdge' => Values::array_get($payload, 'sdk_edge'), + 'sipEdge' => Values::array_get($payload, 'sip_edge'), + 'tags' => Values::array_get($payload, 'tags'), + 'url' => Values::array_get($payload, 'url'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'properties' => Values::array_get($payload, 'properties'), + 'trust' => Values::array_get($payload, 'trust'), + 'annotation' => Values::array_get($payload, 'annotation'), + ]; + + $this->solution = ['callSid' => $callSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CallSummaryContext Context for this CallSummaryInstance + */ + protected function proxy(): CallSummaryContext + { + if (!$this->context) { + $this->context = new CallSummaryContext( + $this->version, + $this->solution['callSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the CallSummaryInstance + * + * @param array|Options $options Optional Arguments + * @return CallSummaryInstance Fetched CallSummaryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): CallSummaryInstance + { + + return $this->proxy()->fetch($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Insights.V1.CallSummaryInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Insights/V1/Call/CallSummaryList.php b/app/api/Twilio/Rest/Insights/V1/Call/CallSummaryList.php new file mode 100755 index 0000000..15d24a2 --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/Call/CallSummaryList.php @@ -0,0 +1,67 @@ +solution = [ + 'callSid' => + $callSid, + + ]; + } + + /** + * Constructs a CallSummaryContext + */ + public function getContext( + + ): CallSummaryContext + { + return new CallSummaryContext( + $this->version, + $this->solution['callSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.CallSummaryList]'; + } +} diff --git a/app/api/Twilio/Rest/Insights/V1/Call/CallSummaryOptions.php b/app/api/Twilio/Rest/Insights/V1/Call/CallSummaryOptions.php new file mode 100755 index 0000000..3de57d9 --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/Call/CallSummaryOptions.php @@ -0,0 +1,76 @@ +options['processingState'] = $processingState; + } + + /** + * + * + * @param string $processingState + * @return $this Fluent Builder + */ + public function setProcessingState(string $processingState): self + { + $this->options['processingState'] = $processingState; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Insights.V1.FetchCallSummaryOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Insights/V1/Call/CallSummaryPage.php b/app/api/Twilio/Rest/Insights/V1/Call/CallSummaryPage.php new file mode 100755 index 0000000..6c44c2c --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/Call/CallSummaryPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CallSummaryInstance \Twilio\Rest\Insights\V1\Call\CallSummaryInstance + */ + public function buildInstance(array $payload): CallSummaryInstance + { + return new CallSummaryInstance($this->version, $payload, $this->solution['callSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.CallSummaryPage]'; + } +} diff --git a/app/api/Twilio/Rest/Insights/V1/Call/EventInstance.php b/app/api/Twilio/Rest/Insights/V1/Call/EventInstance.php new file mode 100755 index 0000000..5559186 --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/Call/EventInstance.php @@ -0,0 +1,101 @@ +properties = [ + 'timestamp' => Values::array_get($payload, 'timestamp'), + 'callSid' => Values::array_get($payload, 'call_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'edge' => Values::array_get($payload, 'edge'), + 'group' => Values::array_get($payload, 'group'), + 'level' => Values::array_get($payload, 'level'), + 'name' => Values::array_get($payload, 'name'), + 'carrierEdge' => Values::array_get($payload, 'carrier_edge'), + 'sipEdge' => Values::array_get($payload, 'sip_edge'), + 'sdkEdge' => Values::array_get($payload, 'sdk_edge'), + 'clientEdge' => Values::array_get($payload, 'client_edge'), + ]; + + $this->solution = ['callSid' => $callSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.EventInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Insights/V1/Call/EventList.php b/app/api/Twilio/Rest/Insights/V1/Call/EventList.php new file mode 100755 index 0000000..475f447 --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/Call/EventList.php @@ -0,0 +1,158 @@ +solution = [ + 'callSid' => + $callSid, + + ]; + + $this->uri = '/Voice/' . \rawurlencode($callSid) + .'/Events'; + } + + /** + * Reads EventInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return EventInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams EventInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of EventInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return EventPage Page of EventInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): EventPage + { + $options = new Values($options); + + $params = Values::of([ + 'Edge' => + $options['edge'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new EventPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of EventInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return EventPage Page of EventInstance + */ + public function getPage(string $targetUrl): EventPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new EventPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.EventList]'; + } +} diff --git a/app/api/Twilio/Rest/Insights/V1/Call/EventOptions.php b/app/api/Twilio/Rest/Insights/V1/Call/EventOptions.php new file mode 100755 index 0000000..d38f365 --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/Call/EventOptions.php @@ -0,0 +1,76 @@ +options['edge'] = $edge; + } + + /** + * + * + * @param string $edge + * @return $this Fluent Builder + */ + public function setEdge(string $edge): self + { + $this->options['edge'] = $edge; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Insights.V1.ReadEventOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Insights/V1/Call/EventPage.php b/app/api/Twilio/Rest/Insights/V1/Call/EventPage.php new file mode 100755 index 0000000..f9d3683 --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/Call/EventPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return EventInstance \Twilio\Rest\Insights\V1\Call\EventInstance + */ + public function buildInstance(array $payload): EventInstance + { + return new EventInstance($this->version, $payload, $this->solution['callSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.EventPage]'; + } +} diff --git a/app/api/Twilio/Rest/Insights/V1/Call/MetricInstance.php b/app/api/Twilio/Rest/Insights/V1/Call/MetricInstance.php new file mode 100755 index 0000000..2f3429c --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/Call/MetricInstance.php @@ -0,0 +1,97 @@ +properties = [ + 'timestamp' => Values::array_get($payload, 'timestamp'), + 'callSid' => Values::array_get($payload, 'call_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'edge' => Values::array_get($payload, 'edge'), + 'direction' => Values::array_get($payload, 'direction'), + 'carrierEdge' => Values::array_get($payload, 'carrier_edge'), + 'sipEdge' => Values::array_get($payload, 'sip_edge'), + 'sdkEdge' => Values::array_get($payload, 'sdk_edge'), + 'clientEdge' => Values::array_get($payload, 'client_edge'), + ]; + + $this->solution = ['callSid' => $callSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.MetricInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Insights/V1/Call/MetricList.php b/app/api/Twilio/Rest/Insights/V1/Call/MetricList.php new file mode 100755 index 0000000..1bb6799 --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/Call/MetricList.php @@ -0,0 +1,160 @@ +solution = [ + 'callSid' => + $callSid, + + ]; + + $this->uri = '/Voice/' . \rawurlencode($callSid) + .'/Metrics'; + } + + /** + * Reads MetricInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return MetricInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams MetricInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of MetricInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return MetricPage Page of MetricInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MetricPage + { + $options = new Values($options); + + $params = Values::of([ + 'Edge' => + $options['edge'], + 'Direction' => + $options['direction'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new MetricPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of MetricInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return MetricPage Page of MetricInstance + */ + public function getPage(string $targetUrl): MetricPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new MetricPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.MetricList]'; + } +} diff --git a/app/api/Twilio/Rest/Insights/V1/Call/MetricOptions.php b/app/api/Twilio/Rest/Insights/V1/Call/MetricOptions.php new file mode 100755 index 0000000..7784838 --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/Call/MetricOptions.php @@ -0,0 +1,94 @@ +options['edge'] = $edge; + $this->options['direction'] = $direction; + } + + /** + * + * + * @param string $edge + * @return $this Fluent Builder + */ + public function setEdge(string $edge): self + { + $this->options['edge'] = $edge; + return $this; + } + + /** + * + * + * @param string $direction + * @return $this Fluent Builder + */ + public function setDirection(string $direction): self + { + $this->options['direction'] = $direction; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Insights.V1.ReadMetricOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Insights/V1/Call/MetricPage.php b/app/api/Twilio/Rest/Insights/V1/Call/MetricPage.php new file mode 100755 index 0000000..d2ce864 --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/Call/MetricPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MetricInstance \Twilio\Rest\Insights\V1\Call\MetricInstance + */ + public function buildInstance(array $payload): MetricInstance + { + return new MetricInstance($this->version, $payload, $this->solution['callSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.MetricPage]'; + } +} diff --git a/app/api/Twilio/Rest/Insights/V1/CallContext.php b/app/api/Twilio/Rest/Insights/V1/CallContext.php new file mode 100755 index 0000000..bd18f84 --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/CallContext.php @@ -0,0 +1,194 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Voice/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the CallInstance + * + * @return CallInstance Fetched CallInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CallInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new CallInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the metrics + */ + protected function getMetrics(): MetricList + { + if (!$this->_metrics) { + $this->_metrics = new MetricList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_metrics; + } + + /** + * Access the events + */ + protected function getEvents(): EventList + { + if (!$this->_events) { + $this->_events = new EventList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_events; + } + + /** + * Access the summary + */ + protected function getSummary(): CallSummaryList + { + if (!$this->_summary) { + $this->_summary = new CallSummaryList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_summary; + } + + /** + * Access the annotation + */ + protected function getAnnotation(): AnnotationList + { + if (!$this->_annotation) { + $this->_annotation = new AnnotationList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_annotation; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Insights.V1.CallContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Insights/V1/CallInstance.php b/app/api/Twilio/Rest/Insights/V1/CallInstance.php new file mode 100755 index 0000000..74b6c60 --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/CallInstance.php @@ -0,0 +1,160 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CallContext Context for this CallInstance + */ + protected function proxy(): CallContext + { + if (!$this->context) { + $this->context = new CallContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the CallInstance + * + * @return CallInstance Fetched CallInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CallInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the metrics + */ + protected function getMetrics(): MetricList + { + return $this->proxy()->metrics; + } + + /** + * Access the events + */ + protected function getEvents(): EventList + { + return $this->proxy()->events; + } + + /** + * Access the summary + */ + protected function getSummary(): CallSummaryList + { + return $this->proxy()->summary; + } + + /** + * Access the annotation + */ + protected function getAnnotation(): AnnotationList + { + return $this->proxy()->annotation; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Insights.V1.CallInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Insights/V1/CallList.php b/app/api/Twilio/Rest/Insights/V1/CallList.php new file mode 100755 index 0000000..b162d2c --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/CallList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a CallContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): CallContext + { + return new CallContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.CallList]'; + } +} diff --git a/app/api/Twilio/Rest/Insights/V1/CallPage.php b/app/api/Twilio/Rest/Insights/V1/CallPage.php new file mode 100755 index 0000000..48e5ebe --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/CallPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CallInstance \Twilio\Rest\Insights\V1\CallInstance + */ + public function buildInstance(array $payload): CallInstance + { + return new CallInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.CallPage]'; + } +} diff --git a/app/api/Twilio/Rest/Insights/V1/CallSummariesInstance.php b/app/api/Twilio/Rest/Insights/V1/CallSummariesInstance.php new file mode 100755 index 0000000..a624c03 --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/CallSummariesInstance.php @@ -0,0 +1,123 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'callSid' => Values::array_get($payload, 'call_sid'), + 'answeredBy' => Values::array_get($payload, 'answered_by'), + 'callType' => Values::array_get($payload, 'call_type'), + 'callState' => Values::array_get($payload, 'call_state'), + 'processingState' => Values::array_get($payload, 'processing_state'), + 'createdTime' => Deserialize::dateTime(Values::array_get($payload, 'created_time')), + 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), + 'endTime' => Deserialize::dateTime(Values::array_get($payload, 'end_time')), + 'duration' => Values::array_get($payload, 'duration'), + 'connectDuration' => Values::array_get($payload, 'connect_duration'), + 'from' => Values::array_get($payload, 'from'), + 'to' => Values::array_get($payload, 'to'), + 'carrierEdge' => Values::array_get($payload, 'carrier_edge'), + 'clientEdge' => Values::array_get($payload, 'client_edge'), + 'sdkEdge' => Values::array_get($payload, 'sdk_edge'), + 'sipEdge' => Values::array_get($payload, 'sip_edge'), + 'tags' => Values::array_get($payload, 'tags'), + 'url' => Values::array_get($payload, 'url'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'properties' => Values::array_get($payload, 'properties'), + 'trust' => Values::array_get($payload, 'trust'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.CallSummariesInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Insights/V1/CallSummariesList.php b/app/api/Twilio/Rest/Insights/V1/CallSummariesList.php new file mode 100755 index 0000000..4971ff2 --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/CallSummariesList.php @@ -0,0 +1,189 @@ +solution = [ + ]; + + $this->uri = '/Voice/Summaries'; + } + + /** + * Reads CallSummariesInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return CallSummariesInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams CallSummariesInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CallSummariesInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return CallSummariesPage Page of CallSummariesInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CallSummariesPage + { + $options = new Values($options); + + $params = Values::of([ + 'From' => + $options['from'], + 'To' => + $options['to'], + 'FromCarrier' => + $options['fromCarrier'], + 'ToCarrier' => + $options['toCarrier'], + 'FromCountryCode' => + $options['fromCountryCode'], + 'ToCountryCode' => + $options['toCountryCode'], + 'Branded' => + Serialize::booleanToString($options['branded']), + 'VerifiedCaller' => + Serialize::booleanToString($options['verifiedCaller']), + 'HasTag' => + Serialize::booleanToString($options['hasTag']), + 'StartTime' => + $options['startTime'], + 'EndTime' => + $options['endTime'], + 'CallType' => + $options['callType'], + 'CallState' => + $options['callState'], + 'Direction' => + $options['direction'], + 'ProcessingState' => + $options['processingState'], + 'SortBy' => + $options['sortBy'], + 'Subaccount' => + $options['subaccount'], + 'AbnormalSession' => + Serialize::booleanToString($options['abnormalSession']), + 'AnsweredBy' => + $options['answeredBy'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new CallSummariesPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of CallSummariesInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return CallSummariesPage Page of CallSummariesInstance + */ + public function getPage(string $targetUrl): CallSummariesPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CallSummariesPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.CallSummariesList]'; + } +} diff --git a/app/api/Twilio/Rest/Insights/V1/CallSummariesOptions.php b/app/api/Twilio/Rest/Insights/V1/CallSummariesOptions.php new file mode 100755 index 0000000..4843f63 --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/CallSummariesOptions.php @@ -0,0 +1,400 @@ +options['from'] = $from; + $this->options['to'] = $to; + $this->options['fromCarrier'] = $fromCarrier; + $this->options['toCarrier'] = $toCarrier; + $this->options['fromCountryCode'] = $fromCountryCode; + $this->options['toCountryCode'] = $toCountryCode; + $this->options['branded'] = $branded; + $this->options['verifiedCaller'] = $verifiedCaller; + $this->options['hasTag'] = $hasTag; + $this->options['startTime'] = $startTime; + $this->options['endTime'] = $endTime; + $this->options['callType'] = $callType; + $this->options['callState'] = $callState; + $this->options['direction'] = $direction; + $this->options['processingState'] = $processingState; + $this->options['sortBy'] = $sortBy; + $this->options['subaccount'] = $subaccount; + $this->options['abnormalSession'] = $abnormalSession; + $this->options['answeredBy'] = $answeredBy; + } + + /** + * + * + * @param string $from + * @return $this Fluent Builder + */ + public function setFrom(string $from): self + { + $this->options['from'] = $from; + return $this; + } + + /** + * + * + * @param string $to + * @return $this Fluent Builder + */ + public function setTo(string $to): self + { + $this->options['to'] = $to; + return $this; + } + + /** + * + * + * @param string $fromCarrier + * @return $this Fluent Builder + */ + public function setFromCarrier(string $fromCarrier): self + { + $this->options['fromCarrier'] = $fromCarrier; + return $this; + } + + /** + * + * + * @param string $toCarrier + * @return $this Fluent Builder + */ + public function setToCarrier(string $toCarrier): self + { + $this->options['toCarrier'] = $toCarrier; + return $this; + } + + /** + * + * + * @param string $fromCountryCode + * @return $this Fluent Builder + */ + public function setFromCountryCode(string $fromCountryCode): self + { + $this->options['fromCountryCode'] = $fromCountryCode; + return $this; + } + + /** + * + * + * @param string $toCountryCode + * @return $this Fluent Builder + */ + public function setToCountryCode(string $toCountryCode): self + { + $this->options['toCountryCode'] = $toCountryCode; + return $this; + } + + /** + * + * + * @param bool $branded + * @return $this Fluent Builder + */ + public function setBranded(bool $branded): self + { + $this->options['branded'] = $branded; + return $this; + } + + /** + * + * + * @param bool $verifiedCaller + * @return $this Fluent Builder + */ + public function setVerifiedCaller(bool $verifiedCaller): self + { + $this->options['verifiedCaller'] = $verifiedCaller; + return $this; + } + + /** + * + * + * @param bool $hasTag + * @return $this Fluent Builder + */ + public function setHasTag(bool $hasTag): self + { + $this->options['hasTag'] = $hasTag; + return $this; + } + + /** + * + * + * @param string $startTime + * @return $this Fluent Builder + */ + public function setStartTime(string $startTime): self + { + $this->options['startTime'] = $startTime; + return $this; + } + + /** + * + * + * @param string $endTime + * @return $this Fluent Builder + */ + public function setEndTime(string $endTime): self + { + $this->options['endTime'] = $endTime; + return $this; + } + + /** + * + * + * @param string $callType + * @return $this Fluent Builder + */ + public function setCallType(string $callType): self + { + $this->options['callType'] = $callType; + return $this; + } + + /** + * + * + * @param string $callState + * @return $this Fluent Builder + */ + public function setCallState(string $callState): self + { + $this->options['callState'] = $callState; + return $this; + } + + /** + * + * + * @param string $direction + * @return $this Fluent Builder + */ + public function setDirection(string $direction): self + { + $this->options['direction'] = $direction; + return $this; + } + + /** + * + * + * @param string $processingState + * @return $this Fluent Builder + */ + public function setProcessingState(string $processingState): self + { + $this->options['processingState'] = $processingState; + return $this; + } + + /** + * + * + * @param string $sortBy + * @return $this Fluent Builder + */ + public function setSortBy(string $sortBy): self + { + $this->options['sortBy'] = $sortBy; + return $this; + } + + /** + * + * + * @param string $subaccount + * @return $this Fluent Builder + */ + public function setSubaccount(string $subaccount): self + { + $this->options['subaccount'] = $subaccount; + return $this; + } + + /** + * + * + * @param bool $abnormalSession + * @return $this Fluent Builder + */ + public function setAbnormalSession(bool $abnormalSession): self + { + $this->options['abnormalSession'] = $abnormalSession; + return $this; + } + + /** + * + * + * @param string $answeredBy + * @return $this Fluent Builder + */ + public function setAnsweredBy(string $answeredBy): self + { + $this->options['answeredBy'] = $answeredBy; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Insights.V1.ReadCallSummariesOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Insights/V1/CallSummariesPage.php b/app/api/Twilio/Rest/Insights/V1/CallSummariesPage.php new file mode 100755 index 0000000..798901d --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/CallSummariesPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CallSummariesInstance \Twilio\Rest\Insights\V1\CallSummariesInstance + */ + public function buildInstance(array $payload): CallSummariesInstance + { + return new CallSummariesInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.CallSummariesPage]'; + } +} diff --git a/app/api/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantContext.php b/app/api/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantContext.php new file mode 100755 index 0000000..12434dd --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantContext.php @@ -0,0 +1,99 @@ +solution = [ + 'conferenceSid' => + $conferenceSid, + 'participantSid' => + $participantSid, + ]; + + $this->uri = '/Conferences/' . \rawurlencode($conferenceSid) + .'/Participants/' . \rawurlencode($participantSid) + .''; + } + + /** + * Fetch the ConferenceParticipantInstance + * + * @param array|Options $options Optional Arguments + * @return ConferenceParticipantInstance Fetched ConferenceParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): ConferenceParticipantInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'Events' => + $options['events'], + 'Metrics' => + $options['metrics'], + ]); + + $payload = $this->version->fetch('GET', $this->uri, $params); + + return new ConferenceParticipantInstance( + $this->version, + $payload, + $this->solution['conferenceSid'], + $this->solution['participantSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Insights.V1.ConferenceParticipantContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantInstance.php b/app/api/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantInstance.php new file mode 100755 index 0000000..68f4676 --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantInstance.php @@ -0,0 +1,172 @@ +properties = [ + 'participantSid' => Values::array_get($payload, 'participant_sid'), + 'label' => Values::array_get($payload, 'label'), + 'conferenceSid' => Values::array_get($payload, 'conference_sid'), + 'callSid' => Values::array_get($payload, 'call_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'callDirection' => Values::array_get($payload, 'call_direction'), + 'from' => Values::array_get($payload, 'from'), + 'to' => Values::array_get($payload, 'to'), + 'callStatus' => Values::array_get($payload, 'call_status'), + 'countryCode' => Values::array_get($payload, 'country_code'), + 'isModerator' => Values::array_get($payload, 'is_moderator'), + 'joinTime' => Deserialize::dateTime(Values::array_get($payload, 'join_time')), + 'leaveTime' => Deserialize::dateTime(Values::array_get($payload, 'leave_time')), + 'durationSeconds' => Values::array_get($payload, 'duration_seconds'), + 'outboundQueueLength' => Values::array_get($payload, 'outbound_queue_length'), + 'outboundTimeInQueue' => Values::array_get($payload, 'outbound_time_in_queue'), + 'jitterBufferSize' => Values::array_get($payload, 'jitter_buffer_size'), + 'isCoach' => Values::array_get($payload, 'is_coach'), + 'coachedParticipants' => Values::array_get($payload, 'coached_participants'), + 'participantRegion' => Values::array_get($payload, 'participant_region'), + 'conferenceRegion' => Values::array_get($payload, 'conference_region'), + 'callType' => Values::array_get($payload, 'call_type'), + 'processingState' => Values::array_get($payload, 'processing_state'), + 'properties' => Values::array_get($payload, 'properties'), + 'events' => Values::array_get($payload, 'events'), + 'metrics' => Values::array_get($payload, 'metrics'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['conferenceSid' => $conferenceSid, 'participantSid' => $participantSid ?: $this->properties['participantSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ConferenceParticipantContext Context for this ConferenceParticipantInstance + */ + protected function proxy(): ConferenceParticipantContext + { + if (!$this->context) { + $this->context = new ConferenceParticipantContext( + $this->version, + $this->solution['conferenceSid'], + $this->solution['participantSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the ConferenceParticipantInstance + * + * @param array|Options $options Optional Arguments + * @return ConferenceParticipantInstance Fetched ConferenceParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): ConferenceParticipantInstance + { + + return $this->proxy()->fetch($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Insights.V1.ConferenceParticipantInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantList.php b/app/api/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantList.php new file mode 100755 index 0000000..01dd43e --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantList.php @@ -0,0 +1,179 @@ +solution = [ + 'conferenceSid' => + $conferenceSid, + + ]; + + $this->uri = '/Conferences/' . \rawurlencode($conferenceSid) + .'/Participants'; + } + + /** + * Reads ConferenceParticipantInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ConferenceParticipantInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams ConferenceParticipantInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ConferenceParticipantInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ConferenceParticipantPage Page of ConferenceParticipantInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ConferenceParticipantPage + { + $options = new Values($options); + + $params = Values::of([ + 'ParticipantSid' => + $options['participantSid'], + 'Label' => + $options['label'], + 'Events' => + $options['events'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ConferenceParticipantPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ConferenceParticipantInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ConferenceParticipantPage Page of ConferenceParticipantInstance + */ + public function getPage(string $targetUrl): ConferenceParticipantPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ConferenceParticipantPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ConferenceParticipantContext + * + * @param string $participantSid The unique SID identifier of the Participant. + */ + public function getContext( + string $participantSid + + ): ConferenceParticipantContext + { + return new ConferenceParticipantContext( + $this->version, + $this->solution['conferenceSid'], + $participantSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.ConferenceParticipantList]'; + } +} diff --git a/app/api/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantOptions.php b/app/api/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantOptions.php new file mode 100755 index 0000000..5e2af0b --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantOptions.php @@ -0,0 +1,182 @@ +options['events'] = $events; + $this->options['metrics'] = $metrics; + } + + /** + * Conference events generated by application or participant activity; e.g. `hold`, `mute`, etc. + * + * @param string $events Conference events generated by application or participant activity; e.g. `hold`, `mute`, etc. + * @return $this Fluent Builder + */ + public function setEvents(string $events): self + { + $this->options['events'] = $events; + return $this; + } + + /** + * Object. Contains participant call quality metrics. + * + * @param string $metrics Object. Contains participant call quality metrics. + * @return $this Fluent Builder + */ + public function setMetrics(string $metrics): self + { + $this->options['metrics'] = $metrics; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Insights.V1.FetchConferenceParticipantOptions ' . $options . ']'; + } +} + +class ReadConferenceParticipantOptions extends Options + { + /** + * @param string $participantSid The unique SID identifier of the Participant. + * @param string $label User-specified label for a participant. + * @param string $events Conference events generated by application or participant activity; e.g. `hold`, `mute`, etc. + */ + public function __construct( + + string $participantSid = Values::NONE, + string $label = Values::NONE, + string $events = Values::NONE + + ) { + $this->options['participantSid'] = $participantSid; + $this->options['label'] = $label; + $this->options['events'] = $events; + } + + /** + * The unique SID identifier of the Participant. + * + * @param string $participantSid The unique SID identifier of the Participant. + * @return $this Fluent Builder + */ + public function setParticipantSid(string $participantSid): self + { + $this->options['participantSid'] = $participantSid; + return $this; + } + + /** + * User-specified label for a participant. + * + * @param string $label User-specified label for a participant. + * @return $this Fluent Builder + */ + public function setLabel(string $label): self + { + $this->options['label'] = $label; + return $this; + } + + /** + * Conference events generated by application or participant activity; e.g. `hold`, `mute`, etc. + * + * @param string $events Conference events generated by application or participant activity; e.g. `hold`, `mute`, etc. + * @return $this Fluent Builder + */ + public function setEvents(string $events): self + { + $this->options['events'] = $events; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Insights.V1.ReadConferenceParticipantOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantPage.php b/app/api/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantPage.php new file mode 100755 index 0000000..4be81f1 --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/Conference/ConferenceParticipantPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ConferenceParticipantInstance \Twilio\Rest\Insights\V1\Conference\ConferenceParticipantInstance + */ + public function buildInstance(array $payload): ConferenceParticipantInstance + { + return new ConferenceParticipantInstance($this->version, $payload, $this->solution['conferenceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.ConferenceParticipantPage]'; + } +} diff --git a/app/api/Twilio/Rest/Insights/V1/ConferenceContext.php b/app/api/Twilio/Rest/Insights/V1/ConferenceContext.php new file mode 100755 index 0000000..31df4cd --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/ConferenceContext.php @@ -0,0 +1,139 @@ +solution = [ + 'conferenceSid' => + $conferenceSid, + ]; + + $this->uri = '/Conferences/' . \rawurlencode($conferenceSid) + .''; + } + + /** + * Fetch the ConferenceInstance + * + * @return ConferenceInstance Fetched ConferenceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ConferenceInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ConferenceInstance( + $this->version, + $payload, + $this->solution['conferenceSid'] + ); + } + + + /** + * Access the conferenceParticipants + */ + protected function getConferenceParticipants(): ConferenceParticipantList + { + if (!$this->_conferenceParticipants) { + $this->_conferenceParticipants = new ConferenceParticipantList( + $this->version, + $this->solution['conferenceSid'] + ); + } + + return $this->_conferenceParticipants; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Insights.V1.ConferenceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Insights/V1/ConferenceInstance.php b/app/api/Twilio/Rest/Insights/V1/ConferenceInstance.php new file mode 100755 index 0000000..3e01762 --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/ConferenceInstance.php @@ -0,0 +1,171 @@ +properties = [ + 'conferenceSid' => Values::array_get($payload, 'conference_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'createTime' => Deserialize::dateTime(Values::array_get($payload, 'create_time')), + 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), + 'endTime' => Deserialize::dateTime(Values::array_get($payload, 'end_time')), + 'durationSeconds' => Values::array_get($payload, 'duration_seconds'), + 'connectDurationSeconds' => Values::array_get($payload, 'connect_duration_seconds'), + 'status' => Values::array_get($payload, 'status'), + 'maxParticipants' => Values::array_get($payload, 'max_participants'), + 'maxConcurrentParticipants' => Values::array_get($payload, 'max_concurrent_participants'), + 'uniqueParticipants' => Values::array_get($payload, 'unique_participants'), + 'endReason' => Values::array_get($payload, 'end_reason'), + 'endedBy' => Values::array_get($payload, 'ended_by'), + 'mixerRegion' => Values::array_get($payload, 'mixer_region'), + 'mixerRegionRequested' => Values::array_get($payload, 'mixer_region_requested'), + 'recordingEnabled' => Values::array_get($payload, 'recording_enabled'), + 'detectedIssues' => Values::array_get($payload, 'detected_issues'), + 'tags' => Values::array_get($payload, 'tags'), + 'tagInfo' => Values::array_get($payload, 'tag_info'), + 'processingState' => Values::array_get($payload, 'processing_state'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['conferenceSid' => $conferenceSid ?: $this->properties['conferenceSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ConferenceContext Context for this ConferenceInstance + */ + protected function proxy(): ConferenceContext + { + if (!$this->context) { + $this->context = new ConferenceContext( + $this->version, + $this->solution['conferenceSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the ConferenceInstance + * + * @return ConferenceInstance Fetched ConferenceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ConferenceInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the conferenceParticipants + */ + protected function getConferenceParticipants(): ConferenceParticipantList + { + return $this->proxy()->conferenceParticipants; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Insights.V1.ConferenceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Insights/V1/ConferenceList.php b/app/api/Twilio/Rest/Insights/V1/ConferenceList.php new file mode 100755 index 0000000..4024563 --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/ConferenceList.php @@ -0,0 +1,186 @@ +solution = [ + ]; + + $this->uri = '/Conferences'; + } + + /** + * Reads ConferenceInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ConferenceInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams ConferenceInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ConferenceInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ConferencePage Page of ConferenceInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ConferencePage + { + $options = new Values($options); + + $params = Values::of([ + 'ConferenceSid' => + $options['conferenceSid'], + 'FriendlyName' => + $options['friendlyName'], + 'Status' => + $options['status'], + 'CreatedAfter' => + $options['createdAfter'], + 'CreatedBefore' => + $options['createdBefore'], + 'MixerRegion' => + $options['mixerRegion'], + 'Tags' => + $options['tags'], + 'Subaccount' => + $options['subaccount'], + 'DetectedIssues' => + $options['detectedIssues'], + 'EndReason' => + $options['endReason'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ConferencePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ConferenceInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ConferencePage Page of ConferenceInstance + */ + public function getPage(string $targetUrl): ConferencePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ConferencePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ConferenceContext + * + * @param string $conferenceSid The unique SID identifier of the Conference. + */ + public function getContext( + string $conferenceSid + + ): ConferenceContext + { + return new ConferenceContext( + $this->version, + $conferenceSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.ConferenceList]'; + } +} diff --git a/app/api/Twilio/Rest/Insights/V1/ConferenceOptions.php b/app/api/Twilio/Rest/Insights/V1/ConferenceOptions.php new file mode 100755 index 0000000..edf616a --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/ConferenceOptions.php @@ -0,0 +1,240 @@ +options['conferenceSid'] = $conferenceSid; + $this->options['friendlyName'] = $friendlyName; + $this->options['status'] = $status; + $this->options['createdAfter'] = $createdAfter; + $this->options['createdBefore'] = $createdBefore; + $this->options['mixerRegion'] = $mixerRegion; + $this->options['tags'] = $tags; + $this->options['subaccount'] = $subaccount; + $this->options['detectedIssues'] = $detectedIssues; + $this->options['endReason'] = $endReason; + } + + /** + * The SID of the conference. + * + * @param string $conferenceSid The SID of the conference. + * @return $this Fluent Builder + */ + public function setConferenceSid(string $conferenceSid): self + { + $this->options['conferenceSid'] = $conferenceSid; + return $this; + } + + /** + * Custom label for the conference resource, up to 64 characters. + * + * @param string $friendlyName Custom label for the conference resource, up to 64 characters. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Conference status. + * + * @param string $status Conference status. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Conferences created after the provided timestamp specified in ISO 8601 format + * + * @param string $createdAfter Conferences created after the provided timestamp specified in ISO 8601 format + * @return $this Fluent Builder + */ + public function setCreatedAfter(string $createdAfter): self + { + $this->options['createdAfter'] = $createdAfter; + return $this; + } + + /** + * Conferences created before the provided timestamp specified in ISO 8601 format. + * + * @param string $createdBefore Conferences created before the provided timestamp specified in ISO 8601 format. + * @return $this Fluent Builder + */ + public function setCreatedBefore(string $createdBefore): self + { + $this->options['createdBefore'] = $createdBefore; + return $this; + } + + /** + * Twilio region where the conference media was mixed. + * + * @param string $mixerRegion Twilio region where the conference media was mixed. + * @return $this Fluent Builder + */ + public function setMixerRegion(string $mixerRegion): self + { + $this->options['mixerRegion'] = $mixerRegion; + return $this; + } + + /** + * Tags applied by Twilio for common potential configuration, quality, or performance issues. + * + * @param string $tags Tags applied by Twilio for common potential configuration, quality, or performance issues. + * @return $this Fluent Builder + */ + public function setTags(string $tags): self + { + $this->options['tags'] = $tags; + return $this; + } + + /** + * Account SID for the subaccount whose resources you wish to retrieve. + * + * @param string $subaccount Account SID for the subaccount whose resources you wish to retrieve. + * @return $this Fluent Builder + */ + public function setSubaccount(string $subaccount): self + { + $this->options['subaccount'] = $subaccount; + return $this; + } + + /** + * Potential configuration, behavior, or performance issues detected during the conference. + * + * @param string $detectedIssues Potential configuration, behavior, or performance issues detected during the conference. + * @return $this Fluent Builder + */ + public function setDetectedIssues(string $detectedIssues): self + { + $this->options['detectedIssues'] = $detectedIssues; + return $this; + } + + /** + * Conference end reason; e.g. last participant left, modified by API, etc. + * + * @param string $endReason Conference end reason; e.g. last participant left, modified by API, etc. + * @return $this Fluent Builder + */ + public function setEndReason(string $endReason): self + { + $this->options['endReason'] = $endReason; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Insights.V1.ReadConferenceOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Insights/V1/ConferencePage.php b/app/api/Twilio/Rest/Insights/V1/ConferencePage.php new file mode 100755 index 0000000..6636fee --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/ConferencePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ConferenceInstance \Twilio\Rest\Insights\V1\ConferenceInstance + */ + public function buildInstance(array $payload): ConferenceInstance + { + return new ConferenceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.ConferencePage]'; + } +} diff --git a/app/api/Twilio/Rest/Insights/V1/Room/ParticipantContext.php b/app/api/Twilio/Rest/Insights/V1/Room/ParticipantContext.php new file mode 100755 index 0000000..9723f21 --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/Room/ParticipantContext.php @@ -0,0 +1,87 @@ +solution = [ + 'roomSid' => + $roomSid, + 'participantSid' => + $participantSid, + ]; + + $this->uri = '/Video/Rooms/' . \rawurlencode($roomSid) + .'/Participants/' . \rawurlencode($participantSid) + .''; + } + + /** + * Fetch the ParticipantInstance + * + * @return ParticipantInstance Fetched ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ParticipantInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ParticipantInstance( + $this->version, + $payload, + $this->solution['roomSid'], + $this->solution['participantSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Insights.V1.ParticipantContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Insights/V1/Room/ParticipantInstance.php b/app/api/Twilio/Rest/Insights/V1/Room/ParticipantInstance.php new file mode 100755 index 0000000..8d2f724 --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/Room/ParticipantInstance.php @@ -0,0 +1,150 @@ +properties = [ + 'participantSid' => Values::array_get($payload, 'participant_sid'), + 'participantIdentity' => Values::array_get($payload, 'participant_identity'), + 'joinTime' => Deserialize::dateTime(Values::array_get($payload, 'join_time')), + 'leaveTime' => Deserialize::dateTime(Values::array_get($payload, 'leave_time')), + 'durationSec' => Values::array_get($payload, 'duration_sec'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'roomSid' => Values::array_get($payload, 'room_sid'), + 'status' => Values::array_get($payload, 'status'), + 'codecs' => Values::array_get($payload, 'codecs'), + 'endReason' => Values::array_get($payload, 'end_reason'), + 'errorCode' => Values::array_get($payload, 'error_code'), + 'errorCodeUrl' => Values::array_get($payload, 'error_code_url'), + 'mediaRegion' => Values::array_get($payload, 'media_region'), + 'properties' => Values::array_get($payload, 'properties'), + 'edgeLocation' => Values::array_get($payload, 'edge_location'), + 'publisherInfo' => Values::array_get($payload, 'publisher_info'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['roomSid' => $roomSid, 'participantSid' => $participantSid ?: $this->properties['participantSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ParticipantContext Context for this ParticipantInstance + */ + protected function proxy(): ParticipantContext + { + if (!$this->context) { + $this->context = new ParticipantContext( + $this->version, + $this->solution['roomSid'], + $this->solution['participantSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the ParticipantInstance + * + * @return ParticipantInstance Fetched ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ParticipantInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Insights.V1.ParticipantInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Insights/V1/Room/ParticipantList.php b/app/api/Twilio/Rest/Insights/V1/Room/ParticipantList.php new file mode 100755 index 0000000..aba8b08 --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/Room/ParticipantList.php @@ -0,0 +1,168 @@ +solution = [ + 'roomSid' => + $roomSid, + + ]; + + $this->uri = '/Video/Rooms/' . \rawurlencode($roomSid) + .'/Participants'; + } + + /** + * Reads ParticipantInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ParticipantInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ParticipantInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ParticipantInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ParticipantPage Page of ParticipantInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ParticipantPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ParticipantPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ParticipantInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ParticipantPage Page of ParticipantInstance + */ + public function getPage(string $targetUrl): ParticipantPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ParticipantPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ParticipantContext + * + * @param string $participantSid The SID of the Participant resource. + */ + public function getContext( + string $participantSid + + ): ParticipantContext + { + return new ParticipantContext( + $this->version, + $this->solution['roomSid'], + $participantSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.ParticipantList]'; + } +} diff --git a/app/api/Twilio/Rest/Insights/V1/Room/ParticipantPage.php b/app/api/Twilio/Rest/Insights/V1/Room/ParticipantPage.php new file mode 100755 index 0000000..b04dfa2 --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/Room/ParticipantPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ParticipantInstance \Twilio\Rest\Insights\V1\Room\ParticipantInstance + */ + public function buildInstance(array $payload): ParticipantInstance + { + return new ParticipantInstance($this->version, $payload, $this->solution['roomSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.ParticipantPage]'; + } +} diff --git a/app/api/Twilio/Rest/Insights/V1/RoomContext.php b/app/api/Twilio/Rest/Insights/V1/RoomContext.php new file mode 100755 index 0000000..d26f18f --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/RoomContext.php @@ -0,0 +1,139 @@ +solution = [ + 'roomSid' => + $roomSid, + ]; + + $this->uri = '/Video/Rooms/' . \rawurlencode($roomSid) + .''; + } + + /** + * Fetch the RoomInstance + * + * @return RoomInstance Fetched RoomInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RoomInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new RoomInstance( + $this->version, + $payload, + $this->solution['roomSid'] + ); + } + + + /** + * Access the participants + */ + protected function getParticipants(): ParticipantList + { + if (!$this->_participants) { + $this->_participants = new ParticipantList( + $this->version, + $this->solution['roomSid'] + ); + } + + return $this->_participants; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Insights.V1.RoomContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Insights/V1/RoomInstance.php b/app/api/Twilio/Rest/Insights/V1/RoomInstance.php new file mode 100755 index 0000000..83382a6 --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/RoomInstance.php @@ -0,0 +1,177 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'roomSid' => Values::array_get($payload, 'room_sid'), + 'roomName' => Values::array_get($payload, 'room_name'), + 'createTime' => Deserialize::dateTime(Values::array_get($payload, 'create_time')), + 'endTime' => Deserialize::dateTime(Values::array_get($payload, 'end_time')), + 'roomType' => Values::array_get($payload, 'room_type'), + 'roomStatus' => Values::array_get($payload, 'room_status'), + 'statusCallback' => Values::array_get($payload, 'status_callback'), + 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), + 'createdMethod' => Values::array_get($payload, 'created_method'), + 'endReason' => Values::array_get($payload, 'end_reason'), + 'maxParticipants' => Values::array_get($payload, 'max_participants'), + 'uniqueParticipants' => Values::array_get($payload, 'unique_participants'), + 'uniqueParticipantIdentities' => Values::array_get($payload, 'unique_participant_identities'), + 'concurrentParticipants' => Values::array_get($payload, 'concurrent_participants'), + 'maxConcurrentParticipants' => Values::array_get($payload, 'max_concurrent_participants'), + 'codecs' => Values::array_get($payload, 'codecs'), + 'mediaRegion' => Values::array_get($payload, 'media_region'), + 'durationSec' => Values::array_get($payload, 'duration_sec'), + 'totalParticipantDurationSec' => Values::array_get($payload, 'total_participant_duration_sec'), + 'totalRecordingDurationSec' => Values::array_get($payload, 'total_recording_duration_sec'), + 'processingState' => Values::array_get($payload, 'processing_state'), + 'recordingEnabled' => Values::array_get($payload, 'recording_enabled'), + 'edgeLocation' => Values::array_get($payload, 'edge_location'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['roomSid' => $roomSid ?: $this->properties['roomSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return RoomContext Context for this RoomInstance + */ + protected function proxy(): RoomContext + { + if (!$this->context) { + $this->context = new RoomContext( + $this->version, + $this->solution['roomSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the RoomInstance + * + * @return RoomInstance Fetched RoomInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RoomInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the participants + */ + protected function getParticipants(): ParticipantList + { + return $this->proxy()->participants; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Insights.V1.RoomInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Insights/V1/RoomList.php b/app/api/Twilio/Rest/Insights/V1/RoomList.php new file mode 100755 index 0000000..63d1dff --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/RoomList.php @@ -0,0 +1,177 @@ +solution = [ + ]; + + $this->uri = '/Video/Rooms'; + } + + /** + * Reads RoomInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return RoomInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams RoomInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of RoomInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return RoomPage Page of RoomInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): RoomPage + { + $options = new Values($options); + + $params = Values::of([ + 'RoomType' => + $options['roomType'], + 'Codec' => + $options['codec'], + 'RoomName' => + $options['roomName'], + 'CreatedAfter' => + Serialize::iso8601DateTime($options['createdAfter']), + 'CreatedBefore' => + Serialize::iso8601DateTime($options['createdBefore']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new RoomPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of RoomInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return RoomPage Page of RoomInstance + */ + public function getPage(string $targetUrl): RoomPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new RoomPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a RoomContext + * + * @param string $roomSid The SID of the Room resource. + */ + public function getContext( + string $roomSid + + ): RoomContext + { + return new RoomContext( + $this->version, + $roomSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.RoomList]'; + } +} diff --git a/app/api/Twilio/Rest/Insights/V1/RoomOptions.php b/app/api/Twilio/Rest/Insights/V1/RoomOptions.php new file mode 100755 index 0000000..dfb930a --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/RoomOptions.php @@ -0,0 +1,150 @@ +options['roomType'] = $roomType; + $this->options['codec'] = $codec; + $this->options['roomName'] = $roomName; + $this->options['createdAfter'] = $createdAfter; + $this->options['createdBefore'] = $createdBefore; + } + + /** + * Type of room. Can be `go`, `peer_to_peer`, `group`, or `group_small`. + * + * @param string $roomType Type of room. Can be `go`, `peer_to_peer`, `group`, or `group_small`. + * @return $this Fluent Builder + */ + public function setRoomType(array $roomType): self + { + $this->options['roomType'] = $roomType; + return $this; + } + + /** + * Codecs used by participants in the room. Can be `VP8`, `H264`, or `VP9`. + * + * @param string $codec Codecs used by participants in the room. Can be `VP8`, `H264`, or `VP9`. + * @return $this Fluent Builder + */ + public function setCodec(array $codec): self + { + $this->options['codec'] = $codec; + return $this; + } + + /** + * Room friendly name. + * + * @param string $roomName Room friendly name. + * @return $this Fluent Builder + */ + public function setRoomName(string $roomName): self + { + $this->options['roomName'] = $roomName; + return $this; + } + + /** + * Only read rooms that started on or after this ISO 8601 timestamp. + * + * @param \DateTime $createdAfter Only read rooms that started on or after this ISO 8601 timestamp. + * @return $this Fluent Builder + */ + public function setCreatedAfter(\DateTime $createdAfter): self + { + $this->options['createdAfter'] = $createdAfter; + return $this; + } + + /** + * Only read rooms that started before this ISO 8601 timestamp. + * + * @param \DateTime $createdBefore Only read rooms that started before this ISO 8601 timestamp. + * @return $this Fluent Builder + */ + public function setCreatedBefore(\DateTime $createdBefore): self + { + $this->options['createdBefore'] = $createdBefore; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Insights.V1.ReadRoomOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Insights/V1/RoomPage.php b/app/api/Twilio/Rest/Insights/V1/RoomPage.php new file mode 100755 index 0000000..5ede3bf --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/RoomPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RoomInstance \Twilio\Rest\Insights\V1\RoomInstance + */ + public function buildInstance(array $payload): RoomInstance + { + return new RoomInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.RoomPage]'; + } +} diff --git a/app/api/Twilio/Rest/Insights/V1/SettingContext.php b/app/api/Twilio/Rest/Insights/V1/SettingContext.php new file mode 100755 index 0000000..8e7198c --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/SettingContext.php @@ -0,0 +1,116 @@ +solution = [ + ]; + + $this->uri = '/Voice/Settings'; + } + + /** + * Fetch the SettingInstance + * + * @param array|Options $options Optional Arguments + * @return SettingInstance Fetched SettingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): SettingInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'SubaccountSid' => + $options['subaccountSid'], + ]); + + $payload = $this->version->fetch('GET', $this->uri, $params); + + return new SettingInstance( + $this->version, + $payload + ); + } + + + /** + * Update the SettingInstance + * + * @param array|Options $options Optional Arguments + * @return SettingInstance Updated SettingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SettingInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'AdvancedFeatures' => + Serialize::booleanToString($options['advancedFeatures']), + 'VoiceTrace' => + Serialize::booleanToString($options['voiceTrace']), + 'SubaccountSid' => + $options['subaccountSid'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new SettingInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Insights.V1.SettingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Insights/V1/SettingInstance.php b/app/api/Twilio/Rest/Insights/V1/SettingInstance.php new file mode 100755 index 0000000..3c83ab7 --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/SettingInstance.php @@ -0,0 +1,134 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'advancedFeatures' => Values::array_get($payload, 'advanced_features'), + 'voiceTrace' => Values::array_get($payload, 'voice_trace'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = []; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SettingContext Context for this SettingInstance + */ + protected function proxy(): SettingContext + { + if (!$this->context) { + $this->context = new SettingContext( + $this->version + ); + } + + return $this->context; + } + + /** + * Fetch the SettingInstance + * + * @param array|Options $options Optional Arguments + * @return SettingInstance Fetched SettingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): SettingInstance + { + + return $this->proxy()->fetch($options); + } + + /** + * Update the SettingInstance + * + * @param array|Options $options Optional Arguments + * @return SettingInstance Updated SettingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SettingInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Insights.V1.SettingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Insights/V1/SettingList.php b/app/api/Twilio/Rest/Insights/V1/SettingList.php new file mode 100755 index 0000000..14a58ab --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/SettingList.php @@ -0,0 +1,61 @@ +solution = [ + ]; + } + + /** + * Constructs a SettingContext + */ + public function getContext( + + ): SettingContext + { + return new SettingContext( + $this->version + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.SettingList]'; + } +} diff --git a/app/api/Twilio/Rest/Insights/V1/SettingOptions.php b/app/api/Twilio/Rest/Insights/V1/SettingOptions.php new file mode 100755 index 0000000..1491d5d --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/SettingOptions.php @@ -0,0 +1,164 @@ +options['subaccountSid'] = $subaccountSid; + } + + /** + * + * + * @param string $subaccountSid + * @return $this Fluent Builder + */ + public function setSubaccountSid(string $subaccountSid): self + { + $this->options['subaccountSid'] = $subaccountSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Insights.V1.FetchSettingOptions ' . $options . ']'; + } +} + +class UpdateSettingOptions extends Options + { + /** + * @param bool $advancedFeatures + * @param bool $voiceTrace + * @param string $subaccountSid + */ + public function __construct( + + bool $advancedFeatures = Values::BOOL_NONE, + bool $voiceTrace = Values::BOOL_NONE, + string $subaccountSid = Values::NONE + + ) { + $this->options['advancedFeatures'] = $advancedFeatures; + $this->options['voiceTrace'] = $voiceTrace; + $this->options['subaccountSid'] = $subaccountSid; + } + + /** + * + * + * @param bool $advancedFeatures + * @return $this Fluent Builder + */ + public function setAdvancedFeatures(bool $advancedFeatures): self + { + $this->options['advancedFeatures'] = $advancedFeatures; + return $this; + } + + /** + * + * + * @param bool $voiceTrace + * @return $this Fluent Builder + */ + public function setVoiceTrace(bool $voiceTrace): self + { + $this->options['voiceTrace'] = $voiceTrace; + return $this; + } + + /** + * + * + * @param string $subaccountSid + * @return $this Fluent Builder + */ + public function setSubaccountSid(string $subaccountSid): self + { + $this->options['subaccountSid'] = $subaccountSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Insights.V1.UpdateSettingOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Insights/V1/SettingPage.php b/app/api/Twilio/Rest/Insights/V1/SettingPage.php new file mode 100755 index 0000000..b95986b --- /dev/null +++ b/app/api/Twilio/Rest/Insights/V1/SettingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SettingInstance \Twilio\Rest\Insights\V1\SettingInstance + */ + public function buildInstance(array $payload): SettingInstance + { + return new SettingInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Insights.V1.SettingPage]'; + } +} diff --git a/app/api/Twilio/Rest/InsightsBase.php b/app/api/Twilio/Rest/InsightsBase.php new file mode 100755 index 0000000..59838be --- /dev/null +++ b/app/api/Twilio/Rest/InsightsBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://insights.twilio.com'; + } + + + /** + * @return V1 Version v1 of insights + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Insights]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging.php b/app/api/Twilio/Rest/IpMessaging.php new file mode 100755 index 0000000..40d259b --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging.php @@ -0,0 +1,42 @@ +credentials instead. + */ + protected function getCredentials(): \Twilio\Rest\IpMessaging\V2\CredentialList { + echo "credentials is deprecated. Use v2->credentials instead."; + return $this->v2->credentials; + } + + /** + * @deprecated Use v2->credentials(\$sid) instead. + * @param string $sid The sid + */ + protected function contextCredentials(string $sid): \Twilio\Rest\IpMessaging\V2\CredentialContext { + echo "credentials(\$sid) is deprecated. Use v2->credentials(\$sid) instead."; + return $this->v2->credentials($sid); + } + + /** + * @deprecated Use v2->services instead. + */ + protected function getServices(): \Twilio\Rest\IpMessaging\V2\ServiceList { + echo "services is deprecated. Use v2->services instead."; + return $this->v2->services; + } + + /** + * @deprecated Use v2->services(\$sid) instead. + * @param string $sid The sid + */ + protected function contextServices(string $sid): \Twilio\Rest\IpMessaging\V2\ServiceContext { + echo "services($sid) is deprecated. Use v2->services(\$sid) instead."; + return $this->v2->services($sid); + } +} \ No newline at end of file diff --git a/app/api/Twilio/Rest/IpMessaging/V1.php b/app/api/Twilio/Rest/IpMessaging/V1.php new file mode 100755 index 0000000..dc7506e --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1.php @@ -0,0 +1,107 @@ +version = 'v1'; + } + + protected function getCredentials(): CredentialList + { + if (!$this->_credentials) { + $this->_credentials = new CredentialList($this); + } + return $this->_credentials; + } + + protected function getServices(): ServiceList + { + if (!$this->_services) { + $this->_services = new ServiceList($this); + } + return $this->_services; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V1]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V1/CredentialContext.php b/app/api/Twilio/Rest/IpMessaging/V1/CredentialContext.php new file mode 100755 index 0000000..a254eb4 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/CredentialContext.php @@ -0,0 +1,134 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Credentials/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the CredentialInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the CredentialInstance + * + * @return CredentialInstance Fetched CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new CredentialInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the CredentialInstance + * + * @param array|Options $options Optional Arguments + * @return CredentialInstance Updated CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CredentialInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'Certificate' => + $options['certificate'], + 'PrivateKey' => + $options['privateKey'], + 'Sandbox' => + Serialize::booleanToString($options['sandbox']), + 'ApiKey' => + $options['apiKey'], + 'Secret' => + $options['secret'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new CredentialInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V1.CredentialContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V1/CredentialInstance.php b/app/api/Twilio/Rest/IpMessaging/V1/CredentialInstance.php new file mode 100755 index 0000000..3723a8e --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/CredentialInstance.php @@ -0,0 +1,156 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'type' => Values::array_get($payload, 'type'), + 'sandbox' => Values::array_get($payload, 'sandbox'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CredentialContext Context for this CredentialInstance + */ + protected function proxy(): CredentialContext + { + if (!$this->context) { + $this->context = new CredentialContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the CredentialInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the CredentialInstance + * + * @return CredentialInstance Fetched CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the CredentialInstance + * + * @param array|Options $options Optional Arguments + * @return CredentialInstance Updated CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CredentialInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V1.CredentialInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V1/CredentialList.php b/app/api/Twilio/Rest/IpMessaging/V1/CredentialList.php new file mode 100755 index 0000000..19b1b1b --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/CredentialList.php @@ -0,0 +1,203 @@ +solution = [ + ]; + + $this->uri = '/Credentials'; + } + + /** + * Create the CredentialInstance + * + * @param string $type + * @param array|Options $options Optional Arguments + * @return CredentialInstance Created CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $type, array $options = []): CredentialInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Type' => + $type, + 'FriendlyName' => + $options['friendlyName'], + 'Certificate' => + $options['certificate'], + 'PrivateKey' => + $options['privateKey'], + 'Sandbox' => + Serialize::booleanToString($options['sandbox']), + 'ApiKey' => + $options['apiKey'], + 'Secret' => + $options['secret'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new CredentialInstance( + $this->version, + $payload + ); + } + + + /** + * Reads CredentialInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return CredentialInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams CredentialInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CredentialInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return CredentialPage Page of CredentialInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CredentialPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new CredentialPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of CredentialInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return CredentialPage Page of CredentialInstance + */ + public function getPage(string $targetUrl): CredentialPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CredentialPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CredentialContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): CredentialContext + { + return new CredentialContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V1.CredentialList]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V1/CredentialOptions.php b/app/api/Twilio/Rest/IpMessaging/V1/CredentialOptions.php new file mode 100755 index 0000000..e43d686 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/CredentialOptions.php @@ -0,0 +1,314 @@ +options['friendlyName'] = $friendlyName; + $this->options['certificate'] = $certificate; + $this->options['privateKey'] = $privateKey; + $this->options['sandbox'] = $sandbox; + $this->options['apiKey'] = $apiKey; + $this->options['secret'] = $secret; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * + * + * @param string $certificate + * @return $this Fluent Builder + */ + public function setCertificate(string $certificate): self + { + $this->options['certificate'] = $certificate; + return $this; + } + + /** + * + * + * @param string $privateKey + * @return $this Fluent Builder + */ + public function setPrivateKey(string $privateKey): self + { + $this->options['privateKey'] = $privateKey; + return $this; + } + + /** + * + * + * @param bool $sandbox + * @return $this Fluent Builder + */ + public function setSandbox(bool $sandbox): self + { + $this->options['sandbox'] = $sandbox; + return $this; + } + + /** + * + * + * @param string $apiKey + * @return $this Fluent Builder + */ + public function setApiKey(string $apiKey): self + { + $this->options['apiKey'] = $apiKey; + return $this; + } + + /** + * + * + * @param string $secret + * @return $this Fluent Builder + */ + public function setSecret(string $secret): self + { + $this->options['secret'] = $secret; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V1.CreateCredentialOptions ' . $options . ']'; + } +} + + + + +class UpdateCredentialOptions extends Options + { + /** + * @param string $friendlyName + * @param string $certificate + * @param string $privateKey + * @param bool $sandbox + * @param string $apiKey + * @param string $secret + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $certificate = Values::NONE, + string $privateKey = Values::NONE, + bool $sandbox = Values::BOOL_NONE, + string $apiKey = Values::NONE, + string $secret = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['certificate'] = $certificate; + $this->options['privateKey'] = $privateKey; + $this->options['sandbox'] = $sandbox; + $this->options['apiKey'] = $apiKey; + $this->options['secret'] = $secret; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * + * + * @param string $certificate + * @return $this Fluent Builder + */ + public function setCertificate(string $certificate): self + { + $this->options['certificate'] = $certificate; + return $this; + } + + /** + * + * + * @param string $privateKey + * @return $this Fluent Builder + */ + public function setPrivateKey(string $privateKey): self + { + $this->options['privateKey'] = $privateKey; + return $this; + } + + /** + * + * + * @param bool $sandbox + * @return $this Fluent Builder + */ + public function setSandbox(bool $sandbox): self + { + $this->options['sandbox'] = $sandbox; + return $this; + } + + /** + * + * + * @param string $apiKey + * @return $this Fluent Builder + */ + public function setApiKey(string $apiKey): self + { + $this->options['apiKey'] = $apiKey; + return $this; + } + + /** + * + * + * @param string $secret + * @return $this Fluent Builder + */ + public function setSecret(string $secret): self + { + $this->options['secret'] = $secret; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V1.UpdateCredentialOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V1/CredentialPage.php b/app/api/Twilio/Rest/IpMessaging/V1/CredentialPage.php new file mode 100755 index 0000000..70c5f65 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/CredentialPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CredentialInstance \Twilio\Rest\IpMessaging\V1\CredentialInstance + */ + public function buildInstance(array $payload): CredentialInstance + { + return new CredentialInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V1.CredentialPage]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteContext.php b/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteContext.php new file mode 100755 index 0000000..2fc22dd --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteContext.php @@ -0,0 +1,106 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'channelSid' => + $channelSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Invites/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the InviteInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the InviteInstance + * + * @return InviteInstance Fetched InviteInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InviteInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new InviteInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V1.InviteContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteInstance.php b/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteInstance.php new file mode 100755 index 0000000..8fb31de --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteInstance.php @@ -0,0 +1,150 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'channelSid' => Values::array_get($payload, 'channel_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'roleSid' => Values::array_get($payload, 'role_sid'), + 'createdBy' => Values::array_get($payload, 'created_by'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return InviteContext Context for this InviteInstance + */ + protected function proxy(): InviteContext + { + if (!$this->context) { + $this->context = new InviteContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the InviteInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the InviteInstance + * + * @return InviteInstance Fetched InviteInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InviteInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V1.InviteInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteList.php b/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteList.php new file mode 100755 index 0000000..f0d2648 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteList.php @@ -0,0 +1,215 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'channelSid' => + $channelSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Invites'; + } + + /** + * Create the InviteInstance + * + * @param string $identity + * @param array|Options $options Optional Arguments + * @return InviteInstance Created InviteInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $identity, array $options = []): InviteInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Identity' => + $identity, + 'RoleSid' => + $options['roleSid'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new InviteInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'] + ); + } + + + /** + * Reads InviteInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return InviteInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams InviteInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of InviteInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return InvitePage Page of InviteInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): InvitePage + { + $options = new Values($options); + + $params = Values::of([ + 'Identity' => + Serialize::map($options['identity'], function ($e) { return $e; }), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new InvitePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of InviteInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return InvitePage Page of InviteInstance + */ + public function getPage(string $targetUrl): InvitePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new InvitePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a InviteContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): InviteContext + { + return new InviteContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V1.InviteList]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteOptions.php b/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteOptions.php new file mode 100755 index 0000000..d77d0f8 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/InviteOptions.php @@ -0,0 +1,132 @@ +options['roleSid'] = $roleSid; + } + + /** + * + * + * @param string $roleSid + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V1.CreateInviteOptions ' . $options . ']'; + } +} + + + +class ReadInviteOptions extends Options + { + /** + * @param string[] $identity + */ + public function __construct( + + array $identity = Values::ARRAY_NONE + + ) { + $this->options['identity'] = $identity; + } + + /** + * + * + * @param string[] $identity + * @return $this Fluent Builder + */ + public function setIdentity(array $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V1.ReadInviteOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/InvitePage.php b/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/InvitePage.php new file mode 100755 index 0000000..8fde214 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/InvitePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InviteInstance \Twilio\Rest\IpMessaging\V1\Service\Channel\InviteInstance + */ + public function buildInstance(array $payload): InviteInstance + { + return new InviteInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V1.InvitePage]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberContext.php b/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberContext.php new file mode 100755 index 0000000..59e4b96 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberContext.php @@ -0,0 +1,139 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'channelSid' => + $channelSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Members/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the MemberInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the MemberInstance + * + * @return MemberInstance Fetched MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MemberInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new MemberInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the MemberInstance + * + * @param array|Options $options Optional Arguments + * @return MemberInstance Updated MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MemberInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'RoleSid' => + $options['roleSid'], + 'LastConsumedMessageIndex' => + $options['lastConsumedMessageIndex'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new MemberInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V1.MemberContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberInstance.php b/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberInstance.php new file mode 100755 index 0000000..cf2f2df --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberInstance.php @@ -0,0 +1,166 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'channelSid' => Values::array_get($payload, 'channel_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'roleSid' => Values::array_get($payload, 'role_sid'), + 'lastConsumedMessageIndex' => Values::array_get($payload, 'last_consumed_message_index'), + 'lastConsumptionTimestamp' => Deserialize::dateTime(Values::array_get($payload, 'last_consumption_timestamp')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return MemberContext Context for this MemberInstance + */ + protected function proxy(): MemberContext + { + if (!$this->context) { + $this->context = new MemberContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the MemberInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the MemberInstance + * + * @return MemberInstance Fetched MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MemberInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the MemberInstance + * + * @param array|Options $options Optional Arguments + * @return MemberInstance Updated MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MemberInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V1.MemberInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberList.php b/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberList.php new file mode 100755 index 0000000..67bdece --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberList.php @@ -0,0 +1,215 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'channelSid' => + $channelSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Members'; + } + + /** + * Create the MemberInstance + * + * @param string $identity + * @param array|Options $options Optional Arguments + * @return MemberInstance Created MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $identity, array $options = []): MemberInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Identity' => + $identity, + 'RoleSid' => + $options['roleSid'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new MemberInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'] + ); + } + + + /** + * Reads MemberInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return MemberInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams MemberInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of MemberInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return MemberPage Page of MemberInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MemberPage + { + $options = new Values($options); + + $params = Values::of([ + 'Identity' => + Serialize::map($options['identity'], function ($e) { return $e; }), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new MemberPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of MemberInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return MemberPage Page of MemberInstance + */ + public function getPage(string $targetUrl): MemberPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new MemberPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a MemberContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): MemberContext + { + return new MemberContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V1.MemberList]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberOptions.php b/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberOptions.php new file mode 100755 index 0000000..ba2bf69 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberOptions.php @@ -0,0 +1,202 @@ +options['roleSid'] = $roleSid; + } + + /** + * + * + * @param string $roleSid + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V1.CreateMemberOptions ' . $options . ']'; + } +} + + + +class ReadMemberOptions extends Options + { + /** + * @param string[] $identity + */ + public function __construct( + + array $identity = Values::ARRAY_NONE + + ) { + $this->options['identity'] = $identity; + } + + /** + * + * + * @param string[] $identity + * @return $this Fluent Builder + */ + public function setIdentity(array $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V1.ReadMemberOptions ' . $options . ']'; + } +} + +class UpdateMemberOptions extends Options + { + /** + * @param string $roleSid + * @param int $lastConsumedMessageIndex + */ + public function __construct( + + string $roleSid = Values::NONE, + int $lastConsumedMessageIndex = Values::INT_NONE + + ) { + $this->options['roleSid'] = $roleSid; + $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; + } + + /** + * + * + * @param string $roleSid + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * + * + * @param int $lastConsumedMessageIndex + * @return $this Fluent Builder + */ + public function setLastConsumedMessageIndex(int $lastConsumedMessageIndex): self + { + $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V1.UpdateMemberOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberPage.php b/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberPage.php new file mode 100755 index 0000000..ae17377 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/MemberPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MemberInstance \Twilio\Rest\IpMessaging\V1\Service\Channel\MemberInstance + */ + public function buildInstance(array $payload): MemberInstance + { + return new MemberInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V1.MemberPage]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageContext.php b/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageContext.php new file mode 100755 index 0000000..afeb29f --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageContext.php @@ -0,0 +1,139 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'channelSid' => + $channelSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Messages/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the MessageInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the MessageInstance + * + * @return MessageInstance Fetched MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MessageInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new MessageInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return MessageInstance Updated MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MessageInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Body' => + $options['body'], + 'Attributes' => + $options['attributes'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new MessageInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V1.MessageContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageInstance.php b/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageInstance.php new file mode 100755 index 0000000..3d6cc94 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageInstance.php @@ -0,0 +1,170 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'to' => Values::array_get($payload, 'to'), + 'channelSid' => Values::array_get($payload, 'channel_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'wasEdited' => Values::array_get($payload, 'was_edited'), + 'from' => Values::array_get($payload, 'from'), + 'body' => Values::array_get($payload, 'body'), + 'index' => Values::array_get($payload, 'index'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return MessageContext Context for this MessageInstance + */ + protected function proxy(): MessageContext + { + if (!$this->context) { + $this->context = new MessageContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the MessageInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the MessageInstance + * + * @return MessageInstance Fetched MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MessageInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return MessageInstance Updated MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MessageInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V1.MessageInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageList.php b/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageList.php new file mode 100755 index 0000000..dff81bc --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageList.php @@ -0,0 +1,216 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'channelSid' => + $channelSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Messages'; + } + + /** + * Create the MessageInstance + * + * @param string $body + * @param array|Options $options Optional Arguments + * @return MessageInstance Created MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $body, array $options = []): MessageInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Body' => + $body, + 'From' => + $options['from'], + 'Attributes' => + $options['attributes'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new MessageInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'] + ); + } + + + /** + * Reads MessageInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return MessageInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams MessageInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of MessageInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return MessagePage Page of MessageInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MessagePage + { + $options = new Values($options); + + $params = Values::of([ + 'Order' => + $options['order'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new MessagePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of MessageInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return MessagePage Page of MessageInstance + */ + public function getPage(string $targetUrl): MessagePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new MessagePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a MessageContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): MessageContext + { + return new MessageContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V1.MessageList]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageOptions.php b/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageOptions.php new file mode 100755 index 0000000..ee385c7 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/MessageOptions.php @@ -0,0 +1,220 @@ +options['from'] = $from; + $this->options['attributes'] = $attributes; + } + + /** + * + * + * @param string $from + * @return $this Fluent Builder + */ + public function setFrom(string $from): self + { + $this->options['from'] = $from; + return $this; + } + + /** + * + * + * @param string $attributes + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V1.CreateMessageOptions ' . $options . ']'; + } +} + + + +class ReadMessageOptions extends Options + { + /** + * @param string $order + */ + public function __construct( + + string $order = Values::NONE + + ) { + $this->options['order'] = $order; + } + + /** + * + * + * @param string $order + * @return $this Fluent Builder + */ + public function setOrder(string $order): self + { + $this->options['order'] = $order; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V1.ReadMessageOptions ' . $options . ']'; + } +} + +class UpdateMessageOptions extends Options + { + /** + * @param string $body + * @param string $attributes + */ + public function __construct( + + string $body = Values::NONE, + string $attributes = Values::NONE + + ) { + $this->options['body'] = $body; + $this->options['attributes'] = $attributes; + } + + /** + * + * + * @param string $body + * @return $this Fluent Builder + */ + public function setBody(string $body): self + { + $this->options['body'] = $body; + return $this; + } + + /** + * + * + * @param string $attributes + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V1.UpdateMessageOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/MessagePage.php b/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/MessagePage.php new file mode 100755 index 0000000..51a8be4 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/Service/Channel/MessagePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MessageInstance \Twilio\Rest\IpMessaging\V1\Service\Channel\MessageInstance + */ + public function buildInstance(array $payload): MessageInstance + { + return new MessageInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V1.MessagePage]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V1/Service/ChannelContext.php b/app/api/Twilio/Rest/IpMessaging/V1/Service/ChannelContext.php new file mode 100755 index 0000000..7f52ca7 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/Service/ChannelContext.php @@ -0,0 +1,233 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ChannelInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the ChannelInstance + * + * @return ChannelInstance Fetched ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ChannelInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ChannelInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ChannelInstance + * + * @param array|Options $options Optional Arguments + * @return ChannelInstance Updated ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ChannelInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'UniqueName' => + $options['uniqueName'], + 'Attributes' => + $options['attributes'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new ChannelInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the members + */ + protected function getMembers(): MemberList + { + if (!$this->_members) { + $this->_members = new MemberList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_members; + } + + /** + * Access the invites + */ + protected function getInvites(): InviteList + { + if (!$this->_invites) { + $this->_invites = new InviteList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_invites; + } + + /** + * Access the messages + */ + protected function getMessages(): MessageList + { + if (!$this->_messages) { + $this->_messages = new MessageList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_messages; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V1.ChannelContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V1/Service/ChannelInstance.php b/app/api/Twilio/Rest/IpMessaging/V1/Service/ChannelInstance.php new file mode 100755 index 0000000..841f55e --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/Service/ChannelInstance.php @@ -0,0 +1,201 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'type' => Values::array_get($payload, 'type'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'createdBy' => Values::array_get($payload, 'created_by'), + 'membersCount' => Values::array_get($payload, 'members_count'), + 'messagesCount' => Values::array_get($payload, 'messages_count'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ChannelContext Context for this ChannelInstance + */ + protected function proxy(): ChannelContext + { + if (!$this->context) { + $this->context = new ChannelContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ChannelInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ChannelInstance + * + * @return ChannelInstance Fetched ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ChannelInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ChannelInstance + * + * @param array|Options $options Optional Arguments + * @return ChannelInstance Updated ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ChannelInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the members + */ + protected function getMembers(): MemberList + { + return $this->proxy()->members; + } + + /** + * Access the invites + */ + protected function getInvites(): InviteList + { + return $this->proxy()->invites; + } + + /** + * Access the messages + */ + protected function getMessages(): MessageList + { + return $this->proxy()->messages; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V1.ChannelInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V1/Service/ChannelList.php b/app/api/Twilio/Rest/IpMessaging/V1/Service/ChannelList.php new file mode 100755 index 0000000..b7004c1 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/Service/ChannelList.php @@ -0,0 +1,209 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels'; + } + + /** + * Create the ChannelInstance + * + * @param array|Options $options Optional Arguments + * @return ChannelInstance Created ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): ChannelInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'UniqueName' => + $options['uniqueName'], + 'Attributes' => + $options['attributes'], + 'Type' => + $options['type'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new ChannelInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads ChannelInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ChannelInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams ChannelInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ChannelInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ChannelPage Page of ChannelInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ChannelPage + { + $options = new Values($options); + + $params = Values::of([ + 'Type' => + $options['type'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ChannelPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ChannelInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ChannelPage Page of ChannelInstance + */ + public function getPage(string $targetUrl): ChannelPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ChannelPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ChannelContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): ChannelContext + { + return new ChannelContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V1.ChannelList]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V1/Service/ChannelOptions.php b/app/api/Twilio/Rest/IpMessaging/V1/Service/ChannelOptions.php new file mode 100755 index 0000000..cd14b7e --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/Service/ChannelOptions.php @@ -0,0 +1,272 @@ +options['friendlyName'] = $friendlyName; + $this->options['uniqueName'] = $uniqueName; + $this->options['attributes'] = $attributes; + $this->options['type'] = $type; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * + * + * @param string $uniqueName + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * + * + * @param string $attributes + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * @param string $type + * @return $this Fluent Builder + */ + public function setType(string $type): self + { + $this->options['type'] = $type; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V1.CreateChannelOptions ' . $options . ']'; + } +} + + + +class ReadChannelOptions extends Options + { + /** + * @param string $type + */ + public function __construct( + + array $type = Values::ARRAY_NONE + + ) { + $this->options['type'] = $type; + } + + /** + * + * + * @param string $type + * @return $this Fluent Builder + */ + public function setType(array $type): self + { + $this->options['type'] = $type; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V1.ReadChannelOptions ' . $options . ']'; + } +} + +class UpdateChannelOptions extends Options + { + /** + * @param string $friendlyName + * @param string $uniqueName + * @param string $attributes + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $uniqueName = Values::NONE, + string $attributes = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['uniqueName'] = $uniqueName; + $this->options['attributes'] = $attributes; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * + * + * @param string $uniqueName + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * + * + * @param string $attributes + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V1.UpdateChannelOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V1/Service/ChannelPage.php b/app/api/Twilio/Rest/IpMessaging/V1/Service/ChannelPage.php new file mode 100755 index 0000000..aa5ce99 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/Service/ChannelPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ChannelInstance \Twilio\Rest\IpMessaging\V1\Service\ChannelInstance + */ + public function buildInstance(array $payload): ChannelInstance + { + return new ChannelInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V1.ChannelPage]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V1/Service/RoleContext.php b/app/api/Twilio/Rest/IpMessaging/V1/Service/RoleContext.php new file mode 100755 index 0000000..3808922 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/Service/RoleContext.php @@ -0,0 +1,128 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Roles/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the RoleInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the RoleInstance + * + * @return RoleInstance Fetched RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RoleInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new RoleInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the RoleInstance + * + * @param string[] $permission + * @return RoleInstance Updated RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $permission): RoleInstance + { + + $data = Values::of([ + 'Permission' => + Serialize::map($permission,function ($e) { return $e; }), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new RoleInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V1.RoleContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V1/Service/RoleInstance.php b/app/api/Twilio/Rest/IpMessaging/V1/Service/RoleInstance.php new file mode 100755 index 0000000..6a622db --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/Service/RoleInstance.php @@ -0,0 +1,159 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'type' => Values::array_get($payload, 'type'), + 'permissions' => Values::array_get($payload, 'permissions'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return RoleContext Context for this RoleInstance + */ + protected function proxy(): RoleContext + { + if (!$this->context) { + $this->context = new RoleContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the RoleInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the RoleInstance + * + * @return RoleInstance Fetched RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RoleInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the RoleInstance + * + * @param string[] $permission + * @return RoleInstance Updated RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $permission): RoleInstance + { + + return $this->proxy()->update($permission); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V1.RoleInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V1/Service/RoleList.php b/app/api/Twilio/Rest/IpMessaging/V1/Service/RoleList.php new file mode 100755 index 0000000..0302cc5 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/Service/RoleList.php @@ -0,0 +1,201 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Roles'; + } + + /** + * Create the RoleInstance + * + * @param string $friendlyName + * @param string $type + * @param string[] $permission + * @return RoleInstance Created RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $type, array $permission): RoleInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Type' => + $type, + 'Permission' => + Serialize::map($permission,function ($e) { return $e; }), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new RoleInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads RoleInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return RoleInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams RoleInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of RoleInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return RolePage Page of RoleInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): RolePage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new RolePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of RoleInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return RolePage Page of RoleInstance + */ + public function getPage(string $targetUrl): RolePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new RolePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a RoleContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): RoleContext + { + return new RoleContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V1.RoleList]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V1/Service/RolePage.php b/app/api/Twilio/Rest/IpMessaging/V1/Service/RolePage.php new file mode 100755 index 0000000..e448ee1 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/Service/RolePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RoleInstance \Twilio\Rest\IpMessaging\V1\Service\RoleInstance + */ + public function buildInstance(array $payload): RoleInstance + { + return new RoleInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V1.RolePage]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V1/Service/User/UserChannelInstance.php b/app/api/Twilio/Rest/IpMessaging/V1/Service/User/UserChannelInstance.php new file mode 100755 index 0000000..cff2090 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/Service/User/UserChannelInstance.php @@ -0,0 +1,96 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'channelSid' => Values::array_get($payload, 'channel_sid'), + 'memberSid' => Values::array_get($payload, 'member_sid'), + 'status' => Values::array_get($payload, 'status'), + 'lastConsumedMessageIndex' => Values::array_get($payload, 'last_consumed_message_index'), + 'unreadMessagesCount' => Values::array_get($payload, 'unread_messages_count'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'userSid' => $userSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V1.UserChannelInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V1/Service/User/UserChannelList.php b/app/api/Twilio/Rest/IpMessaging/V1/Service/User/UserChannelList.php new file mode 100755 index 0000000..924918b --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/Service/User/UserChannelList.php @@ -0,0 +1,157 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'userSid' => + $userSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Users/' . \rawurlencode($userSid) + .'/Channels'; + } + + /** + * Reads UserChannelInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return UserChannelInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams UserChannelInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of UserChannelInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return UserChannelPage Page of UserChannelInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): UserChannelPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new UserChannelPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of UserChannelInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return UserChannelPage Page of UserChannelInstance + */ + public function getPage(string $targetUrl): UserChannelPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new UserChannelPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V1.UserChannelList]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V1/Service/User/UserChannelPage.php b/app/api/Twilio/Rest/IpMessaging/V1/Service/User/UserChannelPage.php new file mode 100755 index 0000000..d145b97 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/Service/User/UserChannelPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UserChannelInstance \Twilio\Rest\IpMessaging\V1\Service\User\UserChannelInstance + */ + public function buildInstance(array $payload): UserChannelInstance + { + return new UserChannelInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V1.UserChannelPage]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V1/Service/UserContext.php b/app/api/Twilio/Rest/IpMessaging/V1/Service/UserContext.php new file mode 100755 index 0000000..2cd756c --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/Service/UserContext.php @@ -0,0 +1,192 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Users/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the UserInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the UserInstance + * + * @return UserInstance Fetched UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new UserInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the UserInstance + * + * @param array|Options $options Optional Arguments + * @return UserInstance Updated UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'RoleSid' => + $options['roleSid'], + 'Attributes' => + $options['attributes'], + 'FriendlyName' => + $options['friendlyName'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new UserInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the userChannels + */ + protected function getUserChannels(): UserChannelList + { + if (!$this->_userChannels) { + $this->_userChannels = new UserChannelList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_userChannels; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V1.UserContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V1/Service/UserInstance.php b/app/api/Twilio/Rest/IpMessaging/V1/Service/UserInstance.php new file mode 100755 index 0000000..a2e9303 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/Service/UserInstance.php @@ -0,0 +1,181 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'roleSid' => Values::array_get($payload, 'role_sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'isOnline' => Values::array_get($payload, 'is_online'), + 'isNotifiable' => Values::array_get($payload, 'is_notifiable'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'joinedChannelsCount' => Values::array_get($payload, 'joined_channels_count'), + 'links' => Values::array_get($payload, 'links'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return UserContext Context for this UserInstance + */ + protected function proxy(): UserContext + { + if (!$this->context) { + $this->context = new UserContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the UserInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the UserInstance + * + * @return UserInstance Fetched UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the UserInstance + * + * @param array|Options $options Optional Arguments + * @return UserInstance Updated UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the userChannels + */ + protected function getUserChannels(): UserChannelList + { + return $this->proxy()->userChannels; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V1.UserInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V1/Service/UserList.php b/app/api/Twilio/Rest/IpMessaging/V1/Service/UserList.php new file mode 100755 index 0000000..b0625f5 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/Service/UserList.php @@ -0,0 +1,204 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Users'; + } + + /** + * Create the UserInstance + * + * @param string $identity + * @param array|Options $options Optional Arguments + * @return UserInstance Created UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $identity, array $options = []): UserInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Identity' => + $identity, + 'RoleSid' => + $options['roleSid'], + 'Attributes' => + $options['attributes'], + 'FriendlyName' => + $options['friendlyName'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new UserInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads UserInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return UserInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams UserInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of UserInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return UserPage Page of UserInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): UserPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new UserPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of UserInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return UserPage Page of UserInstance + */ + public function getPage(string $targetUrl): UserPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new UserPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a UserContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): UserContext + { + return new UserContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V1.UserList]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V1/Service/UserOptions.php b/app/api/Twilio/Rest/IpMessaging/V1/Service/UserOptions.php new file mode 100755 index 0000000..07f61aa --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/Service/UserOptions.php @@ -0,0 +1,206 @@ +options['roleSid'] = $roleSid; + $this->options['attributes'] = $attributes; + $this->options['friendlyName'] = $friendlyName; + } + + /** + * + * + * @param string $roleSid + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * + * + * @param string $attributes + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V1.CreateUserOptions ' . $options . ']'; + } +} + + + + +class UpdateUserOptions extends Options + { + /** + * @param string $roleSid + * @param string $attributes + * @param string $friendlyName + */ + public function __construct( + + string $roleSid = Values::NONE, + string $attributes = Values::NONE, + string $friendlyName = Values::NONE + + ) { + $this->options['roleSid'] = $roleSid; + $this->options['attributes'] = $attributes; + $this->options['friendlyName'] = $friendlyName; + } + + /** + * + * + * @param string $roleSid + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * + * + * @param string $attributes + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V1.UpdateUserOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V1/Service/UserPage.php b/app/api/Twilio/Rest/IpMessaging/V1/Service/UserPage.php new file mode 100755 index 0000000..ca2668e --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/Service/UserPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UserInstance \Twilio\Rest\IpMessaging\V1\Service\UserInstance + */ + public function buildInstance(array $payload): UserInstance + { + return new UserInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V1.UserPage]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V1/ServiceContext.php b/app/api/Twilio/Rest/IpMessaging/V1/ServiceContext.php new file mode 100755 index 0000000..634060a --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/ServiceContext.php @@ -0,0 +1,326 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'DefaultServiceRoleSid' => + $options['defaultServiceRoleSid'], + 'DefaultChannelRoleSid' => + $options['defaultChannelRoleSid'], + 'DefaultChannelCreatorRoleSid' => + $options['defaultChannelCreatorRoleSid'], + 'ReadStatusEnabled' => + Serialize::booleanToString($options['readStatusEnabled']), + 'ReachabilityEnabled' => + Serialize::booleanToString($options['reachabilityEnabled']), + 'TypingIndicatorTimeout' => + $options['typingIndicatorTimeout'], + 'ConsumptionReportInterval' => + $options['consumptionReportInterval'], + 'Notifications.NewMessage.Enabled' => + Serialize::booleanToString($options['notificationsNewMessageEnabled']), + 'Notifications.NewMessage.Template' => + $options['notificationsNewMessageTemplate'], + 'Notifications.AddedToChannel.Enabled' => + Serialize::booleanToString($options['notificationsAddedToChannelEnabled']), + 'Notifications.AddedToChannel.Template' => + $options['notificationsAddedToChannelTemplate'], + 'Notifications.RemovedFromChannel.Enabled' => + Serialize::booleanToString($options['notificationsRemovedFromChannelEnabled']), + 'Notifications.RemovedFromChannel.Template' => + $options['notificationsRemovedFromChannelTemplate'], + 'Notifications.InvitedToChannel.Enabled' => + Serialize::booleanToString($options['notificationsInvitedToChannelEnabled']), + 'Notifications.InvitedToChannel.Template' => + $options['notificationsInvitedToChannelTemplate'], + 'PreWebhookUrl' => + $options['preWebhookUrl'], + 'PostWebhookUrl' => + $options['postWebhookUrl'], + 'WebhookMethod' => + $options['webhookMethod'], + 'WebhookFilters' => + Serialize::map($options['webhookFilters'], function ($e) { return $e; }), + 'Webhooks.OnMessageSend.Url' => + $options['webhooksOnMessageSendUrl'], + 'Webhooks.OnMessageSend.Method' => + $options['webhooksOnMessageSendMethod'], + 'Webhooks.OnMessageUpdate.Url' => + $options['webhooksOnMessageUpdateUrl'], + 'Webhooks.OnMessageUpdate.Method' => + $options['webhooksOnMessageUpdateMethod'], + 'Webhooks.OnMessageRemove.Url' => + $options['webhooksOnMessageRemoveUrl'], + 'Webhooks.OnMessageRemove.Method' => + $options['webhooksOnMessageRemoveMethod'], + 'Webhooks.OnChannelAdd.Url' => + $options['webhooksOnChannelAddUrl'], + 'Webhooks.OnChannelAdd.Method' => + $options['webhooksOnChannelAddMethod'], + 'Webhooks.OnChannelDestroy.Url' => + $options['webhooksOnChannelDestroyUrl'], + 'Webhooks.OnChannelDestroy.Method' => + $options['webhooksOnChannelDestroyMethod'], + 'Webhooks.OnChannelUpdate.Url' => + $options['webhooksOnChannelUpdateUrl'], + 'Webhooks.OnChannelUpdate.Method' => + $options['webhooksOnChannelUpdateMethod'], + 'Webhooks.OnMemberAdd.Url' => + $options['webhooksOnMemberAddUrl'], + 'Webhooks.OnMemberAdd.Method' => + $options['webhooksOnMemberAddMethod'], + 'Webhooks.OnMemberRemove.Url' => + $options['webhooksOnMemberRemoveUrl'], + 'Webhooks.OnMemberRemove.Method' => + $options['webhooksOnMemberRemoveMethod'], + 'Webhooks.OnMessageSent.Url' => + $options['webhooksOnMessageSentUrl'], + 'Webhooks.OnMessageSent.Method' => + $options['webhooksOnMessageSentMethod'], + 'Webhooks.OnMessageUpdated.Url' => + $options['webhooksOnMessageUpdatedUrl'], + 'Webhooks.OnMessageUpdated.Method' => + $options['webhooksOnMessageUpdatedMethod'], + 'Webhooks.OnMessageRemoved.Url' => + $options['webhooksOnMessageRemovedUrl'], + 'Webhooks.OnMessageRemoved.Method' => + $options['webhooksOnMessageRemovedMethod'], + 'Webhooks.OnChannelAdded.Url' => + $options['webhooksOnChannelAddedUrl'], + 'Webhooks.OnChannelAdded.Method' => + $options['webhooksOnChannelAddedMethod'], + 'Webhooks.OnChannelDestroyed.Url' => + $options['webhooksOnChannelDestroyedUrl'], + 'Webhooks.OnChannelDestroyed.Method' => + $options['webhooksOnChannelDestroyedMethod'], + 'Webhooks.OnChannelUpdated.Url' => + $options['webhooksOnChannelUpdatedUrl'], + 'Webhooks.OnChannelUpdated.Method' => + $options['webhooksOnChannelUpdatedMethod'], + 'Webhooks.OnMemberAdded.Url' => + $options['webhooksOnMemberAddedUrl'], + 'Webhooks.OnMemberAdded.Method' => + $options['webhooksOnMemberAddedMethod'], + 'Webhooks.OnMemberRemoved.Url' => + $options['webhooksOnMemberRemovedUrl'], + 'Webhooks.OnMemberRemoved.Method' => + $options['webhooksOnMemberRemovedMethod'], + 'Limits.ChannelMembers' => + $options['limitsChannelMembers'], + 'Limits.UserChannels' => + $options['limitsUserChannels'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the channels + */ + protected function getChannels(): ChannelList + { + if (!$this->_channels) { + $this->_channels = new ChannelList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_channels; + } + + /** + * Access the roles + */ + protected function getRoles(): RoleList + { + if (!$this->_roles) { + $this->_roles = new RoleList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_roles; + } + + /** + * Access the users + */ + protected function getUsers(): UserList + { + if (!$this->_users) { + $this->_users = new UserList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_users; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V1.ServiceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V1/ServiceInstance.php b/app/api/Twilio/Rest/IpMessaging/V1/ServiceInstance.php new file mode 100755 index 0000000..9d8b618 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/ServiceInstance.php @@ -0,0 +1,213 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'defaultServiceRoleSid' => Values::array_get($payload, 'default_service_role_sid'), + 'defaultChannelRoleSid' => Values::array_get($payload, 'default_channel_role_sid'), + 'defaultChannelCreatorRoleSid' => Values::array_get($payload, 'default_channel_creator_role_sid'), + 'readStatusEnabled' => Values::array_get($payload, 'read_status_enabled'), + 'reachabilityEnabled' => Values::array_get($payload, 'reachability_enabled'), + 'typingIndicatorTimeout' => Values::array_get($payload, 'typing_indicator_timeout'), + 'consumptionReportInterval' => Values::array_get($payload, 'consumption_report_interval'), + 'limits' => Values::array_get($payload, 'limits'), + 'webhooks' => Values::array_get($payload, 'webhooks'), + 'preWebhookUrl' => Values::array_get($payload, 'pre_webhook_url'), + 'postWebhookUrl' => Values::array_get($payload, 'post_webhook_url'), + 'webhookMethod' => Values::array_get($payload, 'webhook_method'), + 'webhookFilters' => Values::array_get($payload, 'webhook_filters'), + 'notifications' => Values::array_get($payload, 'notifications'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ServiceContext Context for this ServiceInstance + */ + protected function proxy(): ServiceContext + { + if (!$this->context) { + $this->context = new ServiceContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the channels + */ + protected function getChannels(): ChannelList + { + return $this->proxy()->channels; + } + + /** + * Access the roles + */ + protected function getRoles(): RoleList + { + return $this->proxy()->roles; + } + + /** + * Access the users + */ + protected function getUsers(): UserList + { + return $this->proxy()->users; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V1.ServiceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V1/ServiceList.php b/app/api/Twilio/Rest/IpMessaging/V1/ServiceList.php new file mode 100755 index 0000000..361eb3d --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/ServiceList.php @@ -0,0 +1,186 @@ +solution = [ + ]; + + $this->uri = '/Services'; + } + + /** + * Create the ServiceInstance + * + * @param string $friendlyName + * @return ServiceInstance Created ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName): ServiceInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new ServiceInstance( + $this->version, + $payload + ); + } + + + /** + * Reads ServiceInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ServiceInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ServiceInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ServiceInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ServicePage Page of ServiceInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ServicePage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ServicePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ServiceInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ServicePage Page of ServiceInstance + */ + public function getPage(string $targetUrl): ServicePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ServicePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ServiceContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): ServiceContext + { + return new ServiceContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V1.ServiceList]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V1/ServiceOptions.php b/app/api/Twilio/Rest/IpMessaging/V1/ServiceOptions.php new file mode 100755 index 0000000..ca9b2fb --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/ServiceOptions.php @@ -0,0 +1,1038 @@ +options['friendlyName'] = $friendlyName; + $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; + $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; + $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; + $this->options['readStatusEnabled'] = $readStatusEnabled; + $this->options['reachabilityEnabled'] = $reachabilityEnabled; + $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; + $this->options['consumptionReportInterval'] = $consumptionReportInterval; + $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; + $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; + $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; + $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; + $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; + $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; + $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; + $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; + $this->options['preWebhookUrl'] = $preWebhookUrl; + $this->options['postWebhookUrl'] = $postWebhookUrl; + $this->options['webhookMethod'] = $webhookMethod; + $this->options['webhookFilters'] = $webhookFilters; + $this->options['webhooksOnMessageSendUrl'] = $webhooksOnMessageSendUrl; + $this->options['webhooksOnMessageSendMethod'] = $webhooksOnMessageSendMethod; + $this->options['webhooksOnMessageUpdateUrl'] = $webhooksOnMessageUpdateUrl; + $this->options['webhooksOnMessageUpdateMethod'] = $webhooksOnMessageUpdateMethod; + $this->options['webhooksOnMessageRemoveUrl'] = $webhooksOnMessageRemoveUrl; + $this->options['webhooksOnMessageRemoveMethod'] = $webhooksOnMessageRemoveMethod; + $this->options['webhooksOnChannelAddUrl'] = $webhooksOnChannelAddUrl; + $this->options['webhooksOnChannelAddMethod'] = $webhooksOnChannelAddMethod; + $this->options['webhooksOnChannelDestroyUrl'] = $webhooksOnChannelDestroyUrl; + $this->options['webhooksOnChannelDestroyMethod'] = $webhooksOnChannelDestroyMethod; + $this->options['webhooksOnChannelUpdateUrl'] = $webhooksOnChannelUpdateUrl; + $this->options['webhooksOnChannelUpdateMethod'] = $webhooksOnChannelUpdateMethod; + $this->options['webhooksOnMemberAddUrl'] = $webhooksOnMemberAddUrl; + $this->options['webhooksOnMemberAddMethod'] = $webhooksOnMemberAddMethod; + $this->options['webhooksOnMemberRemoveUrl'] = $webhooksOnMemberRemoveUrl; + $this->options['webhooksOnMemberRemoveMethod'] = $webhooksOnMemberRemoveMethod; + $this->options['webhooksOnMessageSentUrl'] = $webhooksOnMessageSentUrl; + $this->options['webhooksOnMessageSentMethod'] = $webhooksOnMessageSentMethod; + $this->options['webhooksOnMessageUpdatedUrl'] = $webhooksOnMessageUpdatedUrl; + $this->options['webhooksOnMessageUpdatedMethod'] = $webhooksOnMessageUpdatedMethod; + $this->options['webhooksOnMessageRemovedUrl'] = $webhooksOnMessageRemovedUrl; + $this->options['webhooksOnMessageRemovedMethod'] = $webhooksOnMessageRemovedMethod; + $this->options['webhooksOnChannelAddedUrl'] = $webhooksOnChannelAddedUrl; + $this->options['webhooksOnChannelAddedMethod'] = $webhooksOnChannelAddedMethod; + $this->options['webhooksOnChannelDestroyedUrl'] = $webhooksOnChannelDestroyedUrl; + $this->options['webhooksOnChannelDestroyedMethod'] = $webhooksOnChannelDestroyedMethod; + $this->options['webhooksOnChannelUpdatedUrl'] = $webhooksOnChannelUpdatedUrl; + $this->options['webhooksOnChannelUpdatedMethod'] = $webhooksOnChannelUpdatedMethod; + $this->options['webhooksOnMemberAddedUrl'] = $webhooksOnMemberAddedUrl; + $this->options['webhooksOnMemberAddedMethod'] = $webhooksOnMemberAddedMethod; + $this->options['webhooksOnMemberRemovedUrl'] = $webhooksOnMemberRemovedUrl; + $this->options['webhooksOnMemberRemovedMethod'] = $webhooksOnMemberRemovedMethod; + $this->options['limitsChannelMembers'] = $limitsChannelMembers; + $this->options['limitsUserChannels'] = $limitsUserChannels; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * + * + * @param string $defaultServiceRoleSid + * @return $this Fluent Builder + */ + public function setDefaultServiceRoleSid(string $defaultServiceRoleSid): self + { + $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; + return $this; + } + + /** + * + * + * @param string $defaultChannelRoleSid + * @return $this Fluent Builder + */ + public function setDefaultChannelRoleSid(string $defaultChannelRoleSid): self + { + $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; + return $this; + } + + /** + * + * + * @param string $defaultChannelCreatorRoleSid + * @return $this Fluent Builder + */ + public function setDefaultChannelCreatorRoleSid(string $defaultChannelCreatorRoleSid): self + { + $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; + return $this; + } + + /** + * + * + * @param bool $readStatusEnabled + * @return $this Fluent Builder + */ + public function setReadStatusEnabled(bool $readStatusEnabled): self + { + $this->options['readStatusEnabled'] = $readStatusEnabled; + return $this; + } + + /** + * + * + * @param bool $reachabilityEnabled + * @return $this Fluent Builder + */ + public function setReachabilityEnabled(bool $reachabilityEnabled): self + { + $this->options['reachabilityEnabled'] = $reachabilityEnabled; + return $this; + } + + /** + * + * + * @param int $typingIndicatorTimeout + * @return $this Fluent Builder + */ + public function setTypingIndicatorTimeout(int $typingIndicatorTimeout): self + { + $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; + return $this; + } + + /** + * + * + * @param int $consumptionReportInterval + * @return $this Fluent Builder + */ + public function setConsumptionReportInterval(int $consumptionReportInterval): self + { + $this->options['consumptionReportInterval'] = $consumptionReportInterval; + return $this; + } + + /** + * + * + * @param bool $notificationsNewMessageEnabled + * @return $this Fluent Builder + */ + public function setNotificationsNewMessageEnabled(bool $notificationsNewMessageEnabled): self + { + $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; + return $this; + } + + /** + * + * + * @param string $notificationsNewMessageTemplate + * @return $this Fluent Builder + */ + public function setNotificationsNewMessageTemplate(string $notificationsNewMessageTemplate): self + { + $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; + return $this; + } + + /** + * + * + * @param bool $notificationsAddedToChannelEnabled + * @return $this Fluent Builder + */ + public function setNotificationsAddedToChannelEnabled(bool $notificationsAddedToChannelEnabled): self + { + $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; + return $this; + } + + /** + * + * + * @param string $notificationsAddedToChannelTemplate + * @return $this Fluent Builder + */ + public function setNotificationsAddedToChannelTemplate(string $notificationsAddedToChannelTemplate): self + { + $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; + return $this; + } + + /** + * + * + * @param bool $notificationsRemovedFromChannelEnabled + * @return $this Fluent Builder + */ + public function setNotificationsRemovedFromChannelEnabled(bool $notificationsRemovedFromChannelEnabled): self + { + $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; + return $this; + } + + /** + * + * + * @param string $notificationsRemovedFromChannelTemplate + * @return $this Fluent Builder + */ + public function setNotificationsRemovedFromChannelTemplate(string $notificationsRemovedFromChannelTemplate): self + { + $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; + return $this; + } + + /** + * + * + * @param bool $notificationsInvitedToChannelEnabled + * @return $this Fluent Builder + */ + public function setNotificationsInvitedToChannelEnabled(bool $notificationsInvitedToChannelEnabled): self + { + $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; + return $this; + } + + /** + * + * + * @param string $notificationsInvitedToChannelTemplate + * @return $this Fluent Builder + */ + public function setNotificationsInvitedToChannelTemplate(string $notificationsInvitedToChannelTemplate): self + { + $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; + return $this; + } + + /** + * + * + * @param string $preWebhookUrl + * @return $this Fluent Builder + */ + public function setPreWebhookUrl(string $preWebhookUrl): self + { + $this->options['preWebhookUrl'] = $preWebhookUrl; + return $this; + } + + /** + * + * + * @param string $postWebhookUrl + * @return $this Fluent Builder + */ + public function setPostWebhookUrl(string $postWebhookUrl): self + { + $this->options['postWebhookUrl'] = $postWebhookUrl; + return $this; + } + + /** + * + * + * @param string $webhookMethod + * @return $this Fluent Builder + */ + public function setWebhookMethod(string $webhookMethod): self + { + $this->options['webhookMethod'] = $webhookMethod; + return $this; + } + + /** + * + * + * @param string[] $webhookFilters + * @return $this Fluent Builder + */ + public function setWebhookFilters(array $webhookFilters): self + { + $this->options['webhookFilters'] = $webhookFilters; + return $this; + } + + /** + * + * + * @param string $webhooksOnMessageSendUrl + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageSendUrl(string $webhooksOnMessageSendUrl): self + { + $this->options['webhooksOnMessageSendUrl'] = $webhooksOnMessageSendUrl; + return $this; + } + + /** + * + * + * @param string $webhooksOnMessageSendMethod + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageSendMethod(string $webhooksOnMessageSendMethod): self + { + $this->options['webhooksOnMessageSendMethod'] = $webhooksOnMessageSendMethod; + return $this; + } + + /** + * + * + * @param string $webhooksOnMessageUpdateUrl + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageUpdateUrl(string $webhooksOnMessageUpdateUrl): self + { + $this->options['webhooksOnMessageUpdateUrl'] = $webhooksOnMessageUpdateUrl; + return $this; + } + + /** + * + * + * @param string $webhooksOnMessageUpdateMethod + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageUpdateMethod(string $webhooksOnMessageUpdateMethod): self + { + $this->options['webhooksOnMessageUpdateMethod'] = $webhooksOnMessageUpdateMethod; + return $this; + } + + /** + * + * + * @param string $webhooksOnMessageRemoveUrl + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageRemoveUrl(string $webhooksOnMessageRemoveUrl): self + { + $this->options['webhooksOnMessageRemoveUrl'] = $webhooksOnMessageRemoveUrl; + return $this; + } + + /** + * + * + * @param string $webhooksOnMessageRemoveMethod + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageRemoveMethod(string $webhooksOnMessageRemoveMethod): self + { + $this->options['webhooksOnMessageRemoveMethod'] = $webhooksOnMessageRemoveMethod; + return $this; + } + + /** + * + * + * @param string $webhooksOnChannelAddUrl + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelAddUrl(string $webhooksOnChannelAddUrl): self + { + $this->options['webhooksOnChannelAddUrl'] = $webhooksOnChannelAddUrl; + return $this; + } + + /** + * + * + * @param string $webhooksOnChannelAddMethod + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelAddMethod(string $webhooksOnChannelAddMethod): self + { + $this->options['webhooksOnChannelAddMethod'] = $webhooksOnChannelAddMethod; + return $this; + } + + /** + * + * + * @param string $webhooksOnChannelDestroyUrl + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelDestroyUrl(string $webhooksOnChannelDestroyUrl): self + { + $this->options['webhooksOnChannelDestroyUrl'] = $webhooksOnChannelDestroyUrl; + return $this; + } + + /** + * + * + * @param string $webhooksOnChannelDestroyMethod + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelDestroyMethod(string $webhooksOnChannelDestroyMethod): self + { + $this->options['webhooksOnChannelDestroyMethod'] = $webhooksOnChannelDestroyMethod; + return $this; + } + + /** + * + * + * @param string $webhooksOnChannelUpdateUrl + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelUpdateUrl(string $webhooksOnChannelUpdateUrl): self + { + $this->options['webhooksOnChannelUpdateUrl'] = $webhooksOnChannelUpdateUrl; + return $this; + } + + /** + * + * + * @param string $webhooksOnChannelUpdateMethod + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelUpdateMethod(string $webhooksOnChannelUpdateMethod): self + { + $this->options['webhooksOnChannelUpdateMethod'] = $webhooksOnChannelUpdateMethod; + return $this; + } + + /** + * + * + * @param string $webhooksOnMemberAddUrl + * @return $this Fluent Builder + */ + public function setWebhooksOnMemberAddUrl(string $webhooksOnMemberAddUrl): self + { + $this->options['webhooksOnMemberAddUrl'] = $webhooksOnMemberAddUrl; + return $this; + } + + /** + * + * + * @param string $webhooksOnMemberAddMethod + * @return $this Fluent Builder + */ + public function setWebhooksOnMemberAddMethod(string $webhooksOnMemberAddMethod): self + { + $this->options['webhooksOnMemberAddMethod'] = $webhooksOnMemberAddMethod; + return $this; + } + + /** + * + * + * @param string $webhooksOnMemberRemoveUrl + * @return $this Fluent Builder + */ + public function setWebhooksOnMemberRemoveUrl(string $webhooksOnMemberRemoveUrl): self + { + $this->options['webhooksOnMemberRemoveUrl'] = $webhooksOnMemberRemoveUrl; + return $this; + } + + /** + * + * + * @param string $webhooksOnMemberRemoveMethod + * @return $this Fluent Builder + */ + public function setWebhooksOnMemberRemoveMethod(string $webhooksOnMemberRemoveMethod): self + { + $this->options['webhooksOnMemberRemoveMethod'] = $webhooksOnMemberRemoveMethod; + return $this; + } + + /** + * + * + * @param string $webhooksOnMessageSentUrl + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageSentUrl(string $webhooksOnMessageSentUrl): self + { + $this->options['webhooksOnMessageSentUrl'] = $webhooksOnMessageSentUrl; + return $this; + } + + /** + * + * + * @param string $webhooksOnMessageSentMethod + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageSentMethod(string $webhooksOnMessageSentMethod): self + { + $this->options['webhooksOnMessageSentMethod'] = $webhooksOnMessageSentMethod; + return $this; + } + + /** + * + * + * @param string $webhooksOnMessageUpdatedUrl + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageUpdatedUrl(string $webhooksOnMessageUpdatedUrl): self + { + $this->options['webhooksOnMessageUpdatedUrl'] = $webhooksOnMessageUpdatedUrl; + return $this; + } + + /** + * + * + * @param string $webhooksOnMessageUpdatedMethod + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageUpdatedMethod(string $webhooksOnMessageUpdatedMethod): self + { + $this->options['webhooksOnMessageUpdatedMethod'] = $webhooksOnMessageUpdatedMethod; + return $this; + } + + /** + * + * + * @param string $webhooksOnMessageRemovedUrl + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageRemovedUrl(string $webhooksOnMessageRemovedUrl): self + { + $this->options['webhooksOnMessageRemovedUrl'] = $webhooksOnMessageRemovedUrl; + return $this; + } + + /** + * + * + * @param string $webhooksOnMessageRemovedMethod + * @return $this Fluent Builder + */ + public function setWebhooksOnMessageRemovedMethod(string $webhooksOnMessageRemovedMethod): self + { + $this->options['webhooksOnMessageRemovedMethod'] = $webhooksOnMessageRemovedMethod; + return $this; + } + + /** + * + * + * @param string $webhooksOnChannelAddedUrl + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelAddedUrl(string $webhooksOnChannelAddedUrl): self + { + $this->options['webhooksOnChannelAddedUrl'] = $webhooksOnChannelAddedUrl; + return $this; + } + + /** + * + * + * @param string $webhooksOnChannelAddedMethod + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelAddedMethod(string $webhooksOnChannelAddedMethod): self + { + $this->options['webhooksOnChannelAddedMethod'] = $webhooksOnChannelAddedMethod; + return $this; + } + + /** + * + * + * @param string $webhooksOnChannelDestroyedUrl + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelDestroyedUrl(string $webhooksOnChannelDestroyedUrl): self + { + $this->options['webhooksOnChannelDestroyedUrl'] = $webhooksOnChannelDestroyedUrl; + return $this; + } + + /** + * + * + * @param string $webhooksOnChannelDestroyedMethod + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelDestroyedMethod(string $webhooksOnChannelDestroyedMethod): self + { + $this->options['webhooksOnChannelDestroyedMethod'] = $webhooksOnChannelDestroyedMethod; + return $this; + } + + /** + * + * + * @param string $webhooksOnChannelUpdatedUrl + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelUpdatedUrl(string $webhooksOnChannelUpdatedUrl): self + { + $this->options['webhooksOnChannelUpdatedUrl'] = $webhooksOnChannelUpdatedUrl; + return $this; + } + + /** + * + * + * @param string $webhooksOnChannelUpdatedMethod + * @return $this Fluent Builder + */ + public function setWebhooksOnChannelUpdatedMethod(string $webhooksOnChannelUpdatedMethod): self + { + $this->options['webhooksOnChannelUpdatedMethod'] = $webhooksOnChannelUpdatedMethod; + return $this; + } + + /** + * + * + * @param string $webhooksOnMemberAddedUrl + * @return $this Fluent Builder + */ + public function setWebhooksOnMemberAddedUrl(string $webhooksOnMemberAddedUrl): self + { + $this->options['webhooksOnMemberAddedUrl'] = $webhooksOnMemberAddedUrl; + return $this; + } + + /** + * + * + * @param string $webhooksOnMemberAddedMethod + * @return $this Fluent Builder + */ + public function setWebhooksOnMemberAddedMethod(string $webhooksOnMemberAddedMethod): self + { + $this->options['webhooksOnMemberAddedMethod'] = $webhooksOnMemberAddedMethod; + return $this; + } + + /** + * + * + * @param string $webhooksOnMemberRemovedUrl + * @return $this Fluent Builder + */ + public function setWebhooksOnMemberRemovedUrl(string $webhooksOnMemberRemovedUrl): self + { + $this->options['webhooksOnMemberRemovedUrl'] = $webhooksOnMemberRemovedUrl; + return $this; + } + + /** + * + * + * @param string $webhooksOnMemberRemovedMethod + * @return $this Fluent Builder + */ + public function setWebhooksOnMemberRemovedMethod(string $webhooksOnMemberRemovedMethod): self + { + $this->options['webhooksOnMemberRemovedMethod'] = $webhooksOnMemberRemovedMethod; + return $this; + } + + /** + * + * + * @param int $limitsChannelMembers + * @return $this Fluent Builder + */ + public function setLimitsChannelMembers(int $limitsChannelMembers): self + { + $this->options['limitsChannelMembers'] = $limitsChannelMembers; + return $this; + } + + /** + * + * + * @param int $limitsUserChannels + * @return $this Fluent Builder + */ + public function setLimitsUserChannels(int $limitsUserChannels): self + { + $this->options['limitsUserChannels'] = $limitsUserChannels; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V1.UpdateServiceOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V1/ServicePage.php b/app/api/Twilio/Rest/IpMessaging/V1/ServicePage.php new file mode 100755 index 0000000..9ce2f22 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V1/ServicePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ServiceInstance \Twilio\Rest\IpMessaging\V1\ServiceInstance + */ + public function buildInstance(array $payload): ServiceInstance + { + return new ServiceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V1.ServicePage]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V2.php b/app/api/Twilio/Rest/IpMessaging/V2.php new file mode 100755 index 0000000..deed5eb --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2.php @@ -0,0 +1,107 @@ +version = 'v2'; + } + + protected function getCredentials(): CredentialList + { + if (!$this->_credentials) { + $this->_credentials = new CredentialList($this); + } + return $this->_credentials; + } + + protected function getServices(): ServiceList + { + if (!$this->_services) { + $this->_services = new ServiceList($this); + } + return $this->_services; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V2/CredentialContext.php b/app/api/Twilio/Rest/IpMessaging/V2/CredentialContext.php new file mode 100755 index 0000000..2889e32 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/CredentialContext.php @@ -0,0 +1,134 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Credentials/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the CredentialInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the CredentialInstance + * + * @return CredentialInstance Fetched CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new CredentialInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the CredentialInstance + * + * @param array|Options $options Optional Arguments + * @return CredentialInstance Updated CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CredentialInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'Certificate' => + $options['certificate'], + 'PrivateKey' => + $options['privateKey'], + 'Sandbox' => + Serialize::booleanToString($options['sandbox']), + 'ApiKey' => + $options['apiKey'], + 'Secret' => + $options['secret'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new CredentialInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.CredentialContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V2/CredentialInstance.php b/app/api/Twilio/Rest/IpMessaging/V2/CredentialInstance.php new file mode 100755 index 0000000..88870be --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/CredentialInstance.php @@ -0,0 +1,156 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'type' => Values::array_get($payload, 'type'), + 'sandbox' => Values::array_get($payload, 'sandbox'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CredentialContext Context for this CredentialInstance + */ + protected function proxy(): CredentialContext + { + if (!$this->context) { + $this->context = new CredentialContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the CredentialInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the CredentialInstance + * + * @return CredentialInstance Fetched CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the CredentialInstance + * + * @param array|Options $options Optional Arguments + * @return CredentialInstance Updated CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CredentialInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.CredentialInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V2/CredentialList.php b/app/api/Twilio/Rest/IpMessaging/V2/CredentialList.php new file mode 100755 index 0000000..63a491d --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/CredentialList.php @@ -0,0 +1,203 @@ +solution = [ + ]; + + $this->uri = '/Credentials'; + } + + /** + * Create the CredentialInstance + * + * @param string $type + * @param array|Options $options Optional Arguments + * @return CredentialInstance Created CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $type, array $options = []): CredentialInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Type' => + $type, + 'FriendlyName' => + $options['friendlyName'], + 'Certificate' => + $options['certificate'], + 'PrivateKey' => + $options['privateKey'], + 'Sandbox' => + Serialize::booleanToString($options['sandbox']), + 'ApiKey' => + $options['apiKey'], + 'Secret' => + $options['secret'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new CredentialInstance( + $this->version, + $payload + ); + } + + + /** + * Reads CredentialInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return CredentialInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams CredentialInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CredentialInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return CredentialPage Page of CredentialInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CredentialPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new CredentialPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of CredentialInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return CredentialPage Page of CredentialInstance + */ + public function getPage(string $targetUrl): CredentialPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CredentialPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CredentialContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): CredentialContext + { + return new CredentialContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.CredentialList]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V2/CredentialOptions.php b/app/api/Twilio/Rest/IpMessaging/V2/CredentialOptions.php new file mode 100755 index 0000000..a3b17da --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/CredentialOptions.php @@ -0,0 +1,314 @@ +options['friendlyName'] = $friendlyName; + $this->options['certificate'] = $certificate; + $this->options['privateKey'] = $privateKey; + $this->options['sandbox'] = $sandbox; + $this->options['apiKey'] = $apiKey; + $this->options['secret'] = $secret; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * + * + * @param string $certificate + * @return $this Fluent Builder + */ + public function setCertificate(string $certificate): self + { + $this->options['certificate'] = $certificate; + return $this; + } + + /** + * + * + * @param string $privateKey + * @return $this Fluent Builder + */ + public function setPrivateKey(string $privateKey): self + { + $this->options['privateKey'] = $privateKey; + return $this; + } + + /** + * + * + * @param bool $sandbox + * @return $this Fluent Builder + */ + public function setSandbox(bool $sandbox): self + { + $this->options['sandbox'] = $sandbox; + return $this; + } + + /** + * + * + * @param string $apiKey + * @return $this Fluent Builder + */ + public function setApiKey(string $apiKey): self + { + $this->options['apiKey'] = $apiKey; + return $this; + } + + /** + * + * + * @param string $secret + * @return $this Fluent Builder + */ + public function setSecret(string $secret): self + { + $this->options['secret'] = $secret; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.CreateCredentialOptions ' . $options . ']'; + } +} + + + + +class UpdateCredentialOptions extends Options + { + /** + * @param string $friendlyName + * @param string $certificate + * @param string $privateKey + * @param bool $sandbox + * @param string $apiKey + * @param string $secret + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $certificate = Values::NONE, + string $privateKey = Values::NONE, + bool $sandbox = Values::BOOL_NONE, + string $apiKey = Values::NONE, + string $secret = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['certificate'] = $certificate; + $this->options['privateKey'] = $privateKey; + $this->options['sandbox'] = $sandbox; + $this->options['apiKey'] = $apiKey; + $this->options['secret'] = $secret; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * + * + * @param string $certificate + * @return $this Fluent Builder + */ + public function setCertificate(string $certificate): self + { + $this->options['certificate'] = $certificate; + return $this; + } + + /** + * + * + * @param string $privateKey + * @return $this Fluent Builder + */ + public function setPrivateKey(string $privateKey): self + { + $this->options['privateKey'] = $privateKey; + return $this; + } + + /** + * + * + * @param bool $sandbox + * @return $this Fluent Builder + */ + public function setSandbox(bool $sandbox): self + { + $this->options['sandbox'] = $sandbox; + return $this; + } + + /** + * + * + * @param string $apiKey + * @return $this Fluent Builder + */ + public function setApiKey(string $apiKey): self + { + $this->options['apiKey'] = $apiKey; + return $this; + } + + /** + * + * + * @param string $secret + * @return $this Fluent Builder + */ + public function setSecret(string $secret): self + { + $this->options['secret'] = $secret; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.UpdateCredentialOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V2/CredentialPage.php b/app/api/Twilio/Rest/IpMessaging/V2/CredentialPage.php new file mode 100755 index 0000000..5fce353 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/CredentialPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CredentialInstance \Twilio\Rest\IpMessaging\V2\CredentialInstance + */ + public function buildInstance(array $payload): CredentialInstance + { + return new CredentialInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.CredentialPage]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/BindingContext.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/BindingContext.php new file mode 100755 index 0000000..004b433 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/BindingContext.php @@ -0,0 +1,100 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Bindings/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the BindingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the BindingInstance + * + * @return BindingInstance Fetched BindingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BindingInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new BindingInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.BindingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/BindingInstance.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/BindingInstance.php new file mode 100755 index 0000000..be10a33 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/BindingInstance.php @@ -0,0 +1,152 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'endpoint' => Values::array_get($payload, 'endpoint'), + 'identity' => Values::array_get($payload, 'identity'), + 'credentialSid' => Values::array_get($payload, 'credential_sid'), + 'bindingType' => Values::array_get($payload, 'binding_type'), + 'messageTypes' => Values::array_get($payload, 'message_types'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return BindingContext Context for this BindingInstance + */ + protected function proxy(): BindingContext + { + if (!$this->context) { + $this->context = new BindingContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the BindingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the BindingInstance + * + * @return BindingInstance Fetched BindingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BindingInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.BindingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/BindingList.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/BindingList.php new file mode 100755 index 0000000..f0dcbd0 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/BindingList.php @@ -0,0 +1,178 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Bindings'; + } + + /** + * Reads BindingInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return BindingInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams BindingInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of BindingInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return BindingPage Page of BindingInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): BindingPage + { + $options = new Values($options); + + $params = Values::of([ + 'BindingType' => + $options['bindingType'], + 'Identity' => + Serialize::map($options['identity'], function ($e) { return $e; }), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new BindingPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of BindingInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return BindingPage Page of BindingInstance + */ + public function getPage(string $targetUrl): BindingPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new BindingPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a BindingContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): BindingContext + { + return new BindingContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.BindingList]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/BindingOptions.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/BindingOptions.php new file mode 100755 index 0000000..ac934fd --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/BindingOptions.php @@ -0,0 +1,98 @@ +options['bindingType'] = $bindingType; + $this->options['identity'] = $identity; + } + + /** + * + * + * @param string $bindingType + * @return $this Fluent Builder + */ + public function setBindingType(array $bindingType): self + { + $this->options['bindingType'] = $bindingType; + return $this; + } + + /** + * + * + * @param string[] $identity + * @return $this Fluent Builder + */ + public function setIdentity(array $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.ReadBindingOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/BindingPage.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/BindingPage.php new file mode 100755 index 0000000..c347d01 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/BindingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return BindingInstance \Twilio\Rest\IpMessaging\V2\Service\BindingInstance + */ + public function buildInstance(array $payload): BindingInstance + { + return new BindingInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.BindingPage]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteContext.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteContext.php new file mode 100755 index 0000000..c7efa2a --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteContext.php @@ -0,0 +1,106 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'channelSid' => + $channelSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Invites/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the InviteInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the InviteInstance + * + * @return InviteInstance Fetched InviteInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InviteInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new InviteInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.InviteContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteInstance.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteInstance.php new file mode 100755 index 0000000..c4e276e --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteInstance.php @@ -0,0 +1,150 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'channelSid' => Values::array_get($payload, 'channel_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'roleSid' => Values::array_get($payload, 'role_sid'), + 'createdBy' => Values::array_get($payload, 'created_by'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return InviteContext Context for this InviteInstance + */ + protected function proxy(): InviteContext + { + if (!$this->context) { + $this->context = new InviteContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the InviteInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the InviteInstance + * + * @return InviteInstance Fetched InviteInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InviteInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.InviteInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteList.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteList.php new file mode 100755 index 0000000..bfee9a2 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteList.php @@ -0,0 +1,215 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'channelSid' => + $channelSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Invites'; + } + + /** + * Create the InviteInstance + * + * @param string $identity + * @param array|Options $options Optional Arguments + * @return InviteInstance Created InviteInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $identity, array $options = []): InviteInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Identity' => + $identity, + 'RoleSid' => + $options['roleSid'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new InviteInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'] + ); + } + + + /** + * Reads InviteInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return InviteInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams InviteInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of InviteInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return InvitePage Page of InviteInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): InvitePage + { + $options = new Values($options); + + $params = Values::of([ + 'Identity' => + Serialize::map($options['identity'], function ($e) { return $e; }), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new InvitePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of InviteInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return InvitePage Page of InviteInstance + */ + public function getPage(string $targetUrl): InvitePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new InvitePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a InviteContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): InviteContext + { + return new InviteContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.InviteList]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteOptions.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteOptions.php new file mode 100755 index 0000000..b36cd8e --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/InviteOptions.php @@ -0,0 +1,132 @@ +options['roleSid'] = $roleSid; + } + + /** + * + * + * @param string $roleSid + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.CreateInviteOptions ' . $options . ']'; + } +} + + + +class ReadInviteOptions extends Options + { + /** + * @param string[] $identity + */ + public function __construct( + + array $identity = Values::ARRAY_NONE + + ) { + $this->options['identity'] = $identity; + } + + /** + * + * + * @param string[] $identity + * @return $this Fluent Builder + */ + public function setIdentity(array $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.ReadInviteOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/InvitePage.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/InvitePage.php new file mode 100755 index 0000000..ced4e9c --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/InvitePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InviteInstance \Twilio\Rest\IpMessaging\V2\Service\Channel\InviteInstance + */ + public function buildInstance(array $payload): InviteInstance + { + return new InviteInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.InvitePage]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberContext.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberContext.php new file mode 100755 index 0000000..6918156 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberContext.php @@ -0,0 +1,155 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'channelSid' => + $channelSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Members/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the MemberInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the MemberInstance + * + * @return MemberInstance Fetched MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MemberInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new MemberInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the MemberInstance + * + * @param array|Options $options Optional Arguments + * @return MemberInstance Updated MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MemberInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'RoleSid' => + $options['roleSid'], + 'LastConsumedMessageIndex' => + $options['lastConsumedMessageIndex'], + 'LastConsumptionTimestamp' => + Serialize::iso8601DateTime($options['lastConsumptionTimestamp']), + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'Attributes' => + $options['attributes'], + ]); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new MemberInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.MemberContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberInstance.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberInstance.php new file mode 100755 index 0000000..a9ee6bd --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberInstance.php @@ -0,0 +1,169 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'channelSid' => Values::array_get($payload, 'channel_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'roleSid' => Values::array_get($payload, 'role_sid'), + 'lastConsumedMessageIndex' => Values::array_get($payload, 'last_consumed_message_index'), + 'lastConsumptionTimestamp' => Deserialize::dateTime(Values::array_get($payload, 'last_consumption_timestamp')), + 'url' => Values::array_get($payload, 'url'), + 'attributes' => Values::array_get($payload, 'attributes'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return MemberContext Context for this MemberInstance + */ + protected function proxy(): MemberContext + { + if (!$this->context) { + $this->context = new MemberContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the MemberInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the MemberInstance + * + * @return MemberInstance Fetched MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MemberInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the MemberInstance + * + * @param array|Options $options Optional Arguments + * @return MemberInstance Updated MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MemberInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.MemberInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberList.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberList.php new file mode 100755 index 0000000..008b123 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberList.php @@ -0,0 +1,227 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'channelSid' => + $channelSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Members'; + } + + /** + * Create the MemberInstance + * + * @param string $identity + * @param array|Options $options Optional Arguments + * @return MemberInstance Created MemberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $identity, array $options = []): MemberInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Identity' => + $identity, + 'RoleSid' => + $options['roleSid'], + 'LastConsumedMessageIndex' => + $options['lastConsumedMessageIndex'], + 'LastConsumptionTimestamp' => + Serialize::iso8601DateTime($options['lastConsumptionTimestamp']), + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'Attributes' => + $options['attributes'], + ]); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new MemberInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'] + ); + } + + + /** + * Reads MemberInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return MemberInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams MemberInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of MemberInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return MemberPage Page of MemberInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MemberPage + { + $options = new Values($options); + + $params = Values::of([ + 'Identity' => + Serialize::map($options['identity'], function ($e) { return $e; }), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new MemberPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of MemberInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return MemberPage Page of MemberInstance + */ + public function getPage(string $targetUrl): MemberPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new MemberPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a MemberContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): MemberContext + { + return new MemberContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.MemberList]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberOptions.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberOptions.php new file mode 100755 index 0000000..1e6dec2 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberOptions.php @@ -0,0 +1,450 @@ +options['roleSid'] = $roleSid; + $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; + $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['attributes'] = $attributes; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * + * + * @param string $roleSid + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * + * + * @param int $lastConsumedMessageIndex + * @return $this Fluent Builder + */ + public function setLastConsumedMessageIndex(int $lastConsumedMessageIndex): self + { + $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; + return $this; + } + + /** + * + * + * @param \DateTime $lastConsumptionTimestamp + * @return $this Fluent Builder + */ + public function setLastConsumptionTimestamp(\DateTime $lastConsumptionTimestamp): self + { + $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; + return $this; + } + + /** + * + * + * @param \DateTime $dateCreated + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * + * + * @param \DateTime $dateUpdated + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * + * + * @param string $attributes + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.CreateMemberOptions ' . $options . ']'; + } +} + +class DeleteMemberOptions extends Options + { + /** + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.DeleteMemberOptions ' . $options . ']'; + } +} + + +class ReadMemberOptions extends Options + { + /** + * @param string[] $identity + */ + public function __construct( + + array $identity = Values::ARRAY_NONE + + ) { + $this->options['identity'] = $identity; + } + + /** + * + * + * @param string[] $identity + * @return $this Fluent Builder + */ + public function setIdentity(array $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.ReadMemberOptions ' . $options . ']'; + } +} + +class UpdateMemberOptions extends Options + { + /** + * @param string $roleSid + * @param int $lastConsumedMessageIndex + * @param \DateTime $lastConsumptionTimestamp + * @param \DateTime $dateCreated + * @param \DateTime $dateUpdated + * @param string $attributes + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $roleSid = Values::NONE, + int $lastConsumedMessageIndex = Values::INT_NONE, + \DateTime $lastConsumptionTimestamp = null, + \DateTime $dateCreated = null, + \DateTime $dateUpdated = null, + string $attributes = Values::NONE, + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['roleSid'] = $roleSid; + $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; + $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['attributes'] = $attributes; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * + * + * @param string $roleSid + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * + * + * @param int $lastConsumedMessageIndex + * @return $this Fluent Builder + */ + public function setLastConsumedMessageIndex(int $lastConsumedMessageIndex): self + { + $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; + return $this; + } + + /** + * + * + * @param \DateTime $lastConsumptionTimestamp + * @return $this Fluent Builder + */ + public function setLastConsumptionTimestamp(\DateTime $lastConsumptionTimestamp): self + { + $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; + return $this; + } + + /** + * + * + * @param \DateTime $dateCreated + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * + * + * @param \DateTime $dateUpdated + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * + * + * @param string $attributes + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.UpdateMemberOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberPage.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberPage.php new file mode 100755 index 0000000..305c78c --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/MemberPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MemberInstance \Twilio\Rest\IpMessaging\V2\Service\Channel\MemberInstance + */ + public function buildInstance(array $payload): MemberInstance + { + return new MemberInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.MemberPage]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageContext.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageContext.php new file mode 100755 index 0000000..2e47ec1 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageContext.php @@ -0,0 +1,155 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'channelSid' => + $channelSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Messages/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the MessageInstance + * + * @return MessageInstance Fetched MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MessageInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new MessageInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return MessageInstance Updated MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MessageInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Body' => + $options['body'], + 'Attributes' => + $options['attributes'], + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'LastUpdatedBy' => + $options['lastUpdatedBy'], + 'From' => + $options['from'], + ]); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new MessageInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.MessageContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageInstance.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageInstance.php new file mode 100755 index 0000000..0d221a7 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageInstance.php @@ -0,0 +1,177 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'to' => Values::array_get($payload, 'to'), + 'channelSid' => Values::array_get($payload, 'channel_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'lastUpdatedBy' => Values::array_get($payload, 'last_updated_by'), + 'wasEdited' => Values::array_get($payload, 'was_edited'), + 'from' => Values::array_get($payload, 'from'), + 'body' => Values::array_get($payload, 'body'), + 'index' => Values::array_get($payload, 'index'), + 'type' => Values::array_get($payload, 'type'), + 'media' => Values::array_get($payload, 'media'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return MessageContext Context for this MessageInstance + */ + protected function proxy(): MessageContext + { + if (!$this->context) { + $this->context = new MessageContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the MessageInstance + * + * @return MessageInstance Fetched MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MessageInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return MessageInstance Updated MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): MessageInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.MessageInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageList.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageList.php new file mode 100755 index 0000000..a9ae551 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageList.php @@ -0,0 +1,226 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'channelSid' => + $channelSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Messages'; + } + + /** + * Create the MessageInstance + * + * @param array|Options $options Optional Arguments + * @return MessageInstance Created MessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): MessageInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'From' => + $options['from'], + 'Attributes' => + $options['attributes'], + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'LastUpdatedBy' => + $options['lastUpdatedBy'], + 'Body' => + $options['body'], + 'MediaSid' => + $options['mediaSid'], + ]); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new MessageInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'] + ); + } + + + /** + * Reads MessageInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return MessageInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams MessageInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of MessageInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return MessagePage Page of MessageInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MessagePage + { + $options = new Values($options); + + $params = Values::of([ + 'Order' => + $options['order'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new MessagePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of MessageInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return MessagePage Page of MessageInstance + */ + public function getPage(string $targetUrl): MessagePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new MessagePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a MessageContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): MessageContext + { + return new MessageContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.MessageList]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageOptions.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageOptions.php new file mode 100755 index 0000000..f139beb --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/MessageOptions.php @@ -0,0 +1,468 @@ +options['from'] = $from; + $this->options['attributes'] = $attributes; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['lastUpdatedBy'] = $lastUpdatedBy; + $this->options['body'] = $body; + $this->options['mediaSid'] = $mediaSid; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * + * + * @param string $from + * @return $this Fluent Builder + */ + public function setFrom(string $from): self + { + $this->options['from'] = $from; + return $this; + } + + /** + * + * + * @param string $attributes + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * + * + * @param \DateTime $dateCreated + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * + * + * @param \DateTime $dateUpdated + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * + * + * @param string $lastUpdatedBy + * @return $this Fluent Builder + */ + public function setLastUpdatedBy(string $lastUpdatedBy): self + { + $this->options['lastUpdatedBy'] = $lastUpdatedBy; + return $this; + } + + /** + * + * + * @param string $body + * @return $this Fluent Builder + */ + public function setBody(string $body): self + { + $this->options['body'] = $body; + return $this; + } + + /** + * + * + * @param string $mediaSid + * @return $this Fluent Builder + */ + public function setMediaSid(string $mediaSid): self + { + $this->options['mediaSid'] = $mediaSid; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.CreateMessageOptions ' . $options . ']'; + } +} + +class DeleteMessageOptions extends Options + { + /** + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.DeleteMessageOptions ' . $options . ']'; + } +} + + +class ReadMessageOptions extends Options + { + /** + * @param string $order + */ + public function __construct( + + string $order = Values::NONE + + ) { + $this->options['order'] = $order; + } + + /** + * + * + * @param string $order + * @return $this Fluent Builder + */ + public function setOrder(string $order): self + { + $this->options['order'] = $order; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.ReadMessageOptions ' . $options . ']'; + } +} + +class UpdateMessageOptions extends Options + { + /** + * @param string $body + * @param string $attributes + * @param \DateTime $dateCreated + * @param \DateTime $dateUpdated + * @param string $lastUpdatedBy + * @param string $from + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $body = Values::NONE, + string $attributes = Values::NONE, + \DateTime $dateCreated = null, + \DateTime $dateUpdated = null, + string $lastUpdatedBy = Values::NONE, + string $from = Values::NONE, + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['body'] = $body; + $this->options['attributes'] = $attributes; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['lastUpdatedBy'] = $lastUpdatedBy; + $this->options['from'] = $from; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * + * + * @param string $body + * @return $this Fluent Builder + */ + public function setBody(string $body): self + { + $this->options['body'] = $body; + return $this; + } + + /** + * + * + * @param string $attributes + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * + * + * @param \DateTime $dateCreated + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * + * + * @param \DateTime $dateUpdated + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * + * + * @param string $lastUpdatedBy + * @return $this Fluent Builder + */ + public function setLastUpdatedBy(string $lastUpdatedBy): self + { + $this->options['lastUpdatedBy'] = $lastUpdatedBy; + return $this; + } + + /** + * + * + * @param string $from + * @return $this Fluent Builder + */ + public function setFrom(string $from): self + { + $this->options['from'] = $from; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.UpdateMessageOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/MessagePage.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/MessagePage.php new file mode 100755 index 0000000..dec49dd --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/MessagePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MessageInstance \Twilio\Rest\IpMessaging\V2\Service\Channel\MessageInstance + */ + public function buildInstance(array $payload): MessageInstance + { + return new MessageInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.MessagePage]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookContext.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookContext.php new file mode 100755 index 0000000..314e218 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookContext.php @@ -0,0 +1,148 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'channelSid' => + $channelSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Webhooks/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the WebhookInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the WebhookInstance + * + * @return WebhookInstance Fetched WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WebhookInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new WebhookInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the WebhookInstance + * + * @param array|Options $options Optional Arguments + * @return WebhookInstance Updated WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WebhookInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Configuration.Url' => + $options['configurationUrl'], + 'Configuration.Method' => + $options['configurationMethod'], + 'Configuration.Filters' => + Serialize::map($options['configurationFilters'], function ($e) { return $e; }), + 'Configuration.Triggers' => + Serialize::map($options['configurationTriggers'], function ($e) { return $e; }), + 'Configuration.FlowSid' => + $options['configurationFlowSid'], + 'Configuration.RetryCount' => + $options['configurationRetryCount'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new WebhookInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.WebhookContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookInstance.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookInstance.php new file mode 100755 index 0000000..961e45c --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookInstance.php @@ -0,0 +1,162 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'channelSid' => Values::array_get($payload, 'channel_sid'), + 'type' => Values::array_get($payload, 'type'), + 'url' => Values::array_get($payload, 'url'), + 'configuration' => Values::array_get($payload, 'configuration'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'channelSid' => $channelSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return WebhookContext Context for this WebhookInstance + */ + protected function proxy(): WebhookContext + { + if (!$this->context) { + $this->context = new WebhookContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the WebhookInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the WebhookInstance + * + * @return WebhookInstance Fetched WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WebhookInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the WebhookInstance + * + * @param array|Options $options Optional Arguments + * @return WebhookInstance Updated WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WebhookInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.WebhookInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookList.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookList.php new file mode 100755 index 0000000..638b7d2 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookList.php @@ -0,0 +1,219 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'channelSid' => + $channelSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($channelSid) + .'/Webhooks'; + } + + /** + * Create the WebhookInstance + * + * @param string $type + * @param array|Options $options Optional Arguments + * @return WebhookInstance Created WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $type, array $options = []): WebhookInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Type' => + $type, + 'Configuration.Url' => + $options['configurationUrl'], + 'Configuration.Method' => + $options['configurationMethod'], + 'Configuration.Filters' => + Serialize::map($options['configurationFilters'], function ($e) { return $e; }), + 'Configuration.Triggers' => + Serialize::map($options['configurationTriggers'], function ($e) { return $e; }), + 'Configuration.FlowSid' => + $options['configurationFlowSid'], + 'Configuration.RetryCount' => + $options['configurationRetryCount'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new WebhookInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['channelSid'] + ); + } + + + /** + * Reads WebhookInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return WebhookInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams WebhookInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of WebhookInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return WebhookPage Page of WebhookInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): WebhookPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new WebhookPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of WebhookInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return WebhookPage Page of WebhookInstance + */ + public function getPage(string $targetUrl): WebhookPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new WebhookPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a WebhookContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): WebhookContext + { + return new WebhookContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['channelSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.WebhookList]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookOptions.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookOptions.php new file mode 100755 index 0000000..ac7cd9b --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookOptions.php @@ -0,0 +1,310 @@ +options['configurationUrl'] = $configurationUrl; + $this->options['configurationMethod'] = $configurationMethod; + $this->options['configurationFilters'] = $configurationFilters; + $this->options['configurationTriggers'] = $configurationTriggers; + $this->options['configurationFlowSid'] = $configurationFlowSid; + $this->options['configurationRetryCount'] = $configurationRetryCount; + } + + /** + * + * + * @param string $configurationUrl + * @return $this Fluent Builder + */ + public function setConfigurationUrl(string $configurationUrl): self + { + $this->options['configurationUrl'] = $configurationUrl; + return $this; + } + + /** + * @param string $configurationMethod + * @return $this Fluent Builder + */ + public function setConfigurationMethod(string $configurationMethod): self + { + $this->options['configurationMethod'] = $configurationMethod; + return $this; + } + + /** + * + * + * @param string[] $configurationFilters + * @return $this Fluent Builder + */ + public function setConfigurationFilters(array $configurationFilters): self + { + $this->options['configurationFilters'] = $configurationFilters; + return $this; + } + + /** + * + * + * @param string[] $configurationTriggers + * @return $this Fluent Builder + */ + public function setConfigurationTriggers(array $configurationTriggers): self + { + $this->options['configurationTriggers'] = $configurationTriggers; + return $this; + } + + /** + * + * + * @param string $configurationFlowSid + * @return $this Fluent Builder + */ + public function setConfigurationFlowSid(string $configurationFlowSid): self + { + $this->options['configurationFlowSid'] = $configurationFlowSid; + return $this; + } + + /** + * + * + * @param int $configurationRetryCount + * @return $this Fluent Builder + */ + public function setConfigurationRetryCount(int $configurationRetryCount): self + { + $this->options['configurationRetryCount'] = $configurationRetryCount; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.CreateWebhookOptions ' . $options . ']'; + } +} + + + + +class UpdateWebhookOptions extends Options + { + /** + * @param string $configurationUrl + * @param string $configurationMethod + * @param string[] $configurationFilters + * @param string[] $configurationTriggers + * @param string $configurationFlowSid + * @param int $configurationRetryCount + */ + public function __construct( + + string $configurationUrl = Values::NONE, + string $configurationMethod = Values::NONE, + array $configurationFilters = Values::ARRAY_NONE, + array $configurationTriggers = Values::ARRAY_NONE, + string $configurationFlowSid = Values::NONE, + int $configurationRetryCount = Values::INT_NONE + + ) { + $this->options['configurationUrl'] = $configurationUrl; + $this->options['configurationMethod'] = $configurationMethod; + $this->options['configurationFilters'] = $configurationFilters; + $this->options['configurationTriggers'] = $configurationTriggers; + $this->options['configurationFlowSid'] = $configurationFlowSid; + $this->options['configurationRetryCount'] = $configurationRetryCount; + } + + /** + * + * + * @param string $configurationUrl + * @return $this Fluent Builder + */ + public function setConfigurationUrl(string $configurationUrl): self + { + $this->options['configurationUrl'] = $configurationUrl; + return $this; + } + + /** + * @param string $configurationMethod + * @return $this Fluent Builder + */ + public function setConfigurationMethod(string $configurationMethod): self + { + $this->options['configurationMethod'] = $configurationMethod; + return $this; + } + + /** + * + * + * @param string[] $configurationFilters + * @return $this Fluent Builder + */ + public function setConfigurationFilters(array $configurationFilters): self + { + $this->options['configurationFilters'] = $configurationFilters; + return $this; + } + + /** + * + * + * @param string[] $configurationTriggers + * @return $this Fluent Builder + */ + public function setConfigurationTriggers(array $configurationTriggers): self + { + $this->options['configurationTriggers'] = $configurationTriggers; + return $this; + } + + /** + * + * + * @param string $configurationFlowSid + * @return $this Fluent Builder + */ + public function setConfigurationFlowSid(string $configurationFlowSid): self + { + $this->options['configurationFlowSid'] = $configurationFlowSid; + return $this; + } + + /** + * + * + * @param int $configurationRetryCount + * @return $this Fluent Builder + */ + public function setConfigurationRetryCount(int $configurationRetryCount): self + { + $this->options['configurationRetryCount'] = $configurationRetryCount; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.UpdateWebhookOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookPage.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookPage.php new file mode 100755 index 0000000..e88351b --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/Channel/WebhookPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WebhookInstance \Twilio\Rest\IpMessaging\V2\Service\Channel\WebhookInstance + */ + public function buildInstance(array $payload): WebhookInstance + { + return new WebhookInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['channelSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.WebhookPage]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/ChannelContext.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/ChannelContext.php new file mode 100755 index 0000000..576465d --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/ChannelContext.php @@ -0,0 +1,267 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ChannelInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the ChannelInstance + * + * @return ChannelInstance Fetched ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ChannelInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ChannelInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ChannelInstance + * + * @param array|Options $options Optional Arguments + * @return ChannelInstance Updated ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ChannelInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'UniqueName' => + $options['uniqueName'], + 'Attributes' => + $options['attributes'], + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'CreatedBy' => + $options['createdBy'], + ]); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ChannelInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the members + */ + protected function getMembers(): MemberList + { + if (!$this->_members) { + $this->_members = new MemberList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_members; + } + + /** + * Access the invites + */ + protected function getInvites(): InviteList + { + if (!$this->_invites) { + $this->_invites = new InviteList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_invites; + } + + /** + * Access the webhooks + */ + protected function getWebhooks(): WebhookList + { + if (!$this->_webhooks) { + $this->_webhooks = new WebhookList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_webhooks; + } + + /** + * Access the messages + */ + protected function getMessages(): MessageList + { + if (!$this->_messages) { + $this->_messages = new MessageList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_messages; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.ChannelContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/ChannelInstance.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/ChannelInstance.php new file mode 100755 index 0000000..1759db4 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/ChannelInstance.php @@ -0,0 +1,212 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'type' => Values::array_get($payload, 'type'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'createdBy' => Values::array_get($payload, 'created_by'), + 'membersCount' => Values::array_get($payload, 'members_count'), + 'messagesCount' => Values::array_get($payload, 'messages_count'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ChannelContext Context for this ChannelInstance + */ + protected function proxy(): ChannelContext + { + if (!$this->context) { + $this->context = new ChannelContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ChannelInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the ChannelInstance + * + * @return ChannelInstance Fetched ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ChannelInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ChannelInstance + * + * @param array|Options $options Optional Arguments + * @return ChannelInstance Updated ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ChannelInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the members + */ + protected function getMembers(): MemberList + { + return $this->proxy()->members; + } + + /** + * Access the invites + */ + protected function getInvites(): InviteList + { + return $this->proxy()->invites; + } + + /** + * Access the webhooks + */ + protected function getWebhooks(): WebhookList + { + return $this->proxy()->webhooks; + } + + /** + * Access the messages + */ + protected function getMessages(): MessageList + { + return $this->proxy()->messages; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.ChannelInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/ChannelList.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/ChannelList.php new file mode 100755 index 0000000..3fa5692 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/ChannelList.php @@ -0,0 +1,218 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Channels'; + } + + /** + * Create the ChannelInstance + * + * @param array|Options $options Optional Arguments + * @return ChannelInstance Created ChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): ChannelInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'UniqueName' => + $options['uniqueName'], + 'Attributes' => + $options['attributes'], + 'Type' => + $options['type'], + 'DateCreated' => + Serialize::iso8601DateTime($options['dateCreated']), + 'DateUpdated' => + Serialize::iso8601DateTime($options['dateUpdated']), + 'CreatedBy' => + $options['createdBy'], + ]); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new ChannelInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads ChannelInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ChannelInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams ChannelInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ChannelInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ChannelPage Page of ChannelInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ChannelPage + { + $options = new Values($options); + + $params = Values::of([ + 'Type' => + $options['type'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ChannelPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ChannelInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ChannelPage Page of ChannelInstance + */ + public function getPage(string $targetUrl): ChannelPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ChannelPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ChannelContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): ChannelContext + { + return new ChannelContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.ChannelList]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/ChannelOptions.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/ChannelOptions.php new file mode 100755 index 0000000..6b54606 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/ChannelOptions.php @@ -0,0 +1,466 @@ +options['friendlyName'] = $friendlyName; + $this->options['uniqueName'] = $uniqueName; + $this->options['attributes'] = $attributes; + $this->options['type'] = $type; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['createdBy'] = $createdBy; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * + * + * @param string $uniqueName + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * + * + * @param string $attributes + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * @param string $type + * @return $this Fluent Builder + */ + public function setType(string $type): self + { + $this->options['type'] = $type; + return $this; + } + + /** + * + * + * @param \DateTime $dateCreated + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * + * + * @param \DateTime $dateUpdated + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * + * + * @param string $createdBy + * @return $this Fluent Builder + */ + public function setCreatedBy(string $createdBy): self + { + $this->options['createdBy'] = $createdBy; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.CreateChannelOptions ' . $options . ']'; + } +} + +class DeleteChannelOptions extends Options + { + /** + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.DeleteChannelOptions ' . $options . ']'; + } +} + + +class ReadChannelOptions extends Options + { + /** + * @param string $type + */ + public function __construct( + + array $type = Values::ARRAY_NONE + + ) { + $this->options['type'] = $type; + } + + /** + * + * + * @param string $type + * @return $this Fluent Builder + */ + public function setType(array $type): self + { + $this->options['type'] = $type; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.ReadChannelOptions ' . $options . ']'; + } +} + +class UpdateChannelOptions extends Options + { + /** + * @param string $friendlyName + * @param string $uniqueName + * @param string $attributes + * @param \DateTime $dateCreated + * @param \DateTime $dateUpdated + * @param string $createdBy + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $uniqueName = Values::NONE, + string $attributes = Values::NONE, + \DateTime $dateCreated = null, + \DateTime $dateUpdated = null, + string $createdBy = Values::NONE, + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['uniqueName'] = $uniqueName; + $this->options['attributes'] = $attributes; + $this->options['dateCreated'] = $dateCreated; + $this->options['dateUpdated'] = $dateUpdated; + $this->options['createdBy'] = $createdBy; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * + * + * @param string $uniqueName + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * + * + * @param string $attributes + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * + * + * @param \DateTime $dateCreated + * @return $this Fluent Builder + */ + public function setDateCreated(\DateTime $dateCreated): self + { + $this->options['dateCreated'] = $dateCreated; + return $this; + } + + /** + * + * + * @param \DateTime $dateUpdated + * @return $this Fluent Builder + */ + public function setDateUpdated(\DateTime $dateUpdated): self + { + $this->options['dateUpdated'] = $dateUpdated; + return $this; + } + + /** + * + * + * @param string $createdBy + * @return $this Fluent Builder + */ + public function setCreatedBy(string $createdBy): self + { + $this->options['createdBy'] = $createdBy; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.UpdateChannelOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/ChannelPage.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/ChannelPage.php new file mode 100755 index 0000000..83066e8 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/ChannelPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ChannelInstance \Twilio\Rest\IpMessaging\V2\Service\ChannelInstance + */ + public function buildInstance(array $payload): ChannelInstance + { + return new ChannelInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.ChannelPage]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/RoleContext.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/RoleContext.php new file mode 100755 index 0000000..2d6b9fc --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/RoleContext.php @@ -0,0 +1,128 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Roles/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the RoleInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the RoleInstance + * + * @return RoleInstance Fetched RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RoleInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new RoleInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the RoleInstance + * + * @param string[] $permission + * @return RoleInstance Updated RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $permission): RoleInstance + { + + $data = Values::of([ + 'Permission' => + Serialize::map($permission,function ($e) { return $e; }), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new RoleInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.RoleContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/RoleInstance.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/RoleInstance.php new file mode 100755 index 0000000..d8a7b6a --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/RoleInstance.php @@ -0,0 +1,159 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'type' => Values::array_get($payload, 'type'), + 'permissions' => Values::array_get($payload, 'permissions'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return RoleContext Context for this RoleInstance + */ + protected function proxy(): RoleContext + { + if (!$this->context) { + $this->context = new RoleContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the RoleInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the RoleInstance + * + * @return RoleInstance Fetched RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RoleInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the RoleInstance + * + * @param string[] $permission + * @return RoleInstance Updated RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $permission): RoleInstance + { + + return $this->proxy()->update($permission); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.RoleInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/RoleList.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/RoleList.php new file mode 100755 index 0000000..3f94839 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/RoleList.php @@ -0,0 +1,201 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Roles'; + } + + /** + * Create the RoleInstance + * + * @param string $friendlyName + * @param string $type + * @param string[] $permission + * @return RoleInstance Created RoleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $type, array $permission): RoleInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Type' => + $type, + 'Permission' => + Serialize::map($permission,function ($e) { return $e; }), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new RoleInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads RoleInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return RoleInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams RoleInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of RoleInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return RolePage Page of RoleInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): RolePage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new RolePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of RoleInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return RolePage Page of RoleInstance + */ + public function getPage(string $targetUrl): RolePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new RolePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a RoleContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): RoleContext + { + return new RoleContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.RoleList]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/RolePage.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/RolePage.php new file mode 100755 index 0000000..3952673 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/RolePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RoleInstance \Twilio\Rest\IpMessaging\V2\Service\RoleInstance + */ + public function buildInstance(array $payload): RoleInstance + { + return new RoleInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.RolePage]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingContext.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingContext.php new file mode 100755 index 0000000..8024927 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingContext.php @@ -0,0 +1,106 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'userSid' => + $userSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Users/' . \rawurlencode($userSid) + .'/Bindings/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the UserBindingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the UserBindingInstance + * + * @return UserBindingInstance Fetched UserBindingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserBindingInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new UserBindingInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['userSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.UserBindingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingInstance.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingInstance.php new file mode 100755 index 0000000..e349f9c --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingInstance.php @@ -0,0 +1,154 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'endpoint' => Values::array_get($payload, 'endpoint'), + 'identity' => Values::array_get($payload, 'identity'), + 'userSid' => Values::array_get($payload, 'user_sid'), + 'credentialSid' => Values::array_get($payload, 'credential_sid'), + 'bindingType' => Values::array_get($payload, 'binding_type'), + 'messageTypes' => Values::array_get($payload, 'message_types'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'userSid' => $userSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return UserBindingContext Context for this UserBindingInstance + */ + protected function proxy(): UserBindingContext + { + if (!$this->context) { + $this->context = new UserBindingContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['userSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the UserBindingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the UserBindingInstance + * + * @return UserBindingInstance Fetched UserBindingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserBindingInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.UserBindingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingList.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingList.php new file mode 100755 index 0000000..efc5929 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingList.php @@ -0,0 +1,182 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'userSid' => + $userSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Users/' . \rawurlencode($userSid) + .'/Bindings'; + } + + /** + * Reads UserBindingInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return UserBindingInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams UserBindingInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of UserBindingInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return UserBindingPage Page of UserBindingInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): UserBindingPage + { + $options = new Values($options); + + $params = Values::of([ + 'BindingType' => + $options['bindingType'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new UserBindingPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of UserBindingInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return UserBindingPage Page of UserBindingInstance + */ + public function getPage(string $targetUrl): UserBindingPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new UserBindingPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a UserBindingContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): UserBindingContext + { + return new UserBindingContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['userSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.UserBindingList]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingOptions.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingOptions.php new file mode 100755 index 0000000..1f4000a --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingOptions.php @@ -0,0 +1,80 @@ +options['bindingType'] = $bindingType; + } + + /** + * + * + * @param string $bindingType + * @return $this Fluent Builder + */ + public function setBindingType(array $bindingType): self + { + $this->options['bindingType'] = $bindingType; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.ReadUserBindingOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingPage.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingPage.php new file mode 100755 index 0000000..f6d4273 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/User/UserBindingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UserBindingInstance \Twilio\Rest\IpMessaging\V2\Service\User\UserBindingInstance + */ + public function buildInstance(array $payload): UserBindingInstance + { + return new UserBindingInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.UserBindingPage]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelContext.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelContext.php new file mode 100755 index 0000000..a233b7d --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelContext.php @@ -0,0 +1,142 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'userSid' => + $userSid, + 'channelSid' => + $channelSid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Users/' . \rawurlencode($userSid) + .'/Channels/' . \rawurlencode($channelSid) + .''; + } + + /** + * Delete the UserChannelInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the UserChannelInstance + * + * @return UserChannelInstance Fetched UserChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserChannelInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new UserChannelInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['userSid'], + $this->solution['channelSid'] + ); + } + + + /** + * Update the UserChannelInstance + * + * @param array|Options $options Optional Arguments + * @return UserChannelInstance Updated UserChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserChannelInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'NotificationLevel' => + $options['notificationLevel'], + 'LastConsumedMessageIndex' => + $options['lastConsumedMessageIndex'], + 'LastConsumptionTimestamp' => + Serialize::iso8601DateTime($options['lastConsumptionTimestamp']), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new UserChannelInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['userSid'], + $this->solution['channelSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.UserChannelContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelInstance.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelInstance.php new file mode 100755 index 0000000..f178cbf --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelInstance.php @@ -0,0 +1,165 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'channelSid' => Values::array_get($payload, 'channel_sid'), + 'userSid' => Values::array_get($payload, 'user_sid'), + 'memberSid' => Values::array_get($payload, 'member_sid'), + 'status' => Values::array_get($payload, 'status'), + 'lastConsumedMessageIndex' => Values::array_get($payload, 'last_consumed_message_index'), + 'unreadMessagesCount' => Values::array_get($payload, 'unread_messages_count'), + 'links' => Values::array_get($payload, 'links'), + 'url' => Values::array_get($payload, 'url'), + 'notificationLevel' => Values::array_get($payload, 'notification_level'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'userSid' => $userSid, 'channelSid' => $channelSid ?: $this->properties['channelSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return UserChannelContext Context for this UserChannelInstance + */ + protected function proxy(): UserChannelContext + { + if (!$this->context) { + $this->context = new UserChannelContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['userSid'], + $this->solution['channelSid'] + ); + } + + return $this->context; + } + + /** + * Delete the UserChannelInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the UserChannelInstance + * + * @return UserChannelInstance Fetched UserChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserChannelInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the UserChannelInstance + * + * @param array|Options $options Optional Arguments + * @return UserChannelInstance Updated UserChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserChannelInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.UserChannelInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelList.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelList.php new file mode 100755 index 0000000..d01c523 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelList.php @@ -0,0 +1,175 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'userSid' => + $userSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Users/' . \rawurlencode($userSid) + .'/Channels'; + } + + /** + * Reads UserChannelInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return UserChannelInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams UserChannelInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of UserChannelInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return UserChannelPage Page of UserChannelInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): UserChannelPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new UserChannelPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of UserChannelInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return UserChannelPage Page of UserChannelInstance + */ + public function getPage(string $targetUrl): UserChannelPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new UserChannelPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a UserChannelContext + * + * @param string $channelSid + */ + public function getContext( + string $channelSid + + ): UserChannelContext + { + return new UserChannelContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['userSid'], + $channelSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.UserChannelList]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelOptions.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelOptions.php new file mode 100755 index 0000000..cf7a337 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelOptions.php @@ -0,0 +1,116 @@ +options['notificationLevel'] = $notificationLevel; + $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; + $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; + } + + /** + * @param string $notificationLevel + * @return $this Fluent Builder + */ + public function setNotificationLevel(string $notificationLevel): self + { + $this->options['notificationLevel'] = $notificationLevel; + return $this; + } + + /** + * + * + * @param int $lastConsumedMessageIndex + * @return $this Fluent Builder + */ + public function setLastConsumedMessageIndex(int $lastConsumedMessageIndex): self + { + $this->options['lastConsumedMessageIndex'] = $lastConsumedMessageIndex; + return $this; + } + + /** + * + * + * @param \DateTime $lastConsumptionTimestamp + * @return $this Fluent Builder + */ + public function setLastConsumptionTimestamp(\DateTime $lastConsumptionTimestamp): self + { + $this->options['lastConsumptionTimestamp'] = $lastConsumptionTimestamp; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.UpdateUserChannelOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelPage.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelPage.php new file mode 100755 index 0000000..ce38b2c --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/User/UserChannelPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UserChannelInstance \Twilio\Rest\IpMessaging\V2\Service\User\UserChannelInstance + */ + public function buildInstance(array $payload): UserChannelInstance + { + return new UserChannelInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['userSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.UserChannelPage]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/UserContext.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/UserContext.php new file mode 100755 index 0000000..ef2e2a8 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/UserContext.php @@ -0,0 +1,215 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Users/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the UserInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the UserInstance + * + * @return UserInstance Fetched UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new UserInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the UserInstance + * + * @param array|Options $options Optional Arguments + * @return UserInstance Updated UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'RoleSid' => + $options['roleSid'], + 'Attributes' => + $options['attributes'], + 'FriendlyName' => + $options['friendlyName'], + ]); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new UserInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the userBindings + */ + protected function getUserBindings(): UserBindingList + { + if (!$this->_userBindings) { + $this->_userBindings = new UserBindingList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_userBindings; + } + + /** + * Access the userChannels + */ + protected function getUserChannels(): UserChannelList + { + if (!$this->_userChannels) { + $this->_userChannels = new UserChannelList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_userChannels; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.UserContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/UserInstance.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/UserInstance.php new file mode 100755 index 0000000..90275cd --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/UserInstance.php @@ -0,0 +1,191 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'roleSid' => Values::array_get($payload, 'role_sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'isOnline' => Values::array_get($payload, 'is_online'), + 'isNotifiable' => Values::array_get($payload, 'is_notifiable'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'joinedChannelsCount' => Values::array_get($payload, 'joined_channels_count'), + 'links' => Values::array_get($payload, 'links'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return UserContext Context for this UserInstance + */ + protected function proxy(): UserContext + { + if (!$this->context) { + $this->context = new UserContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the UserInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the UserInstance + * + * @return UserInstance Fetched UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the UserInstance + * + * @param array|Options $options Optional Arguments + * @return UserInstance Updated UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): UserInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the userBindings + */ + protected function getUserBindings(): UserBindingList + { + return $this->proxy()->userBindings; + } + + /** + * Access the userChannels + */ + protected function getUserChannels(): UserChannelList + { + return $this->proxy()->userChannels; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.UserInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/UserList.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/UserList.php new file mode 100755 index 0000000..ae1f1d6 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/UserList.php @@ -0,0 +1,206 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Users'; + } + + /** + * Create the UserInstance + * + * @param string $identity + * @param array|Options $options Optional Arguments + * @return UserInstance Created UserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $identity, array $options = []): UserInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Identity' => + $identity, + 'RoleSid' => + $options['roleSid'], + 'Attributes' => + $options['attributes'], + 'FriendlyName' => + $options['friendlyName'], + ]); + + $headers = Values::of(['X-Twilio-Webhook-Enabled' => $options['xTwilioWebhookEnabled']]); + + $payload = $this->version->create('POST', $this->uri, [], $data, $headers); + + return new UserInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads UserInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return UserInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams UserInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of UserInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return UserPage Page of UserInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): UserPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new UserPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of UserInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return UserPage Page of UserInstance + */ + public function getPage(string $targetUrl): UserPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new UserPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a UserContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): UserContext + { + return new UserContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.UserList]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/UserOptions.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/UserOptions.php new file mode 100755 index 0000000..3d15e0d --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/UserOptions.php @@ -0,0 +1,242 @@ +options['roleSid'] = $roleSid; + $this->options['attributes'] = $attributes; + $this->options['friendlyName'] = $friendlyName; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * + * + * @param string $roleSid + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * + * + * @param string $attributes + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.CreateUserOptions ' . $options . ']'; + } +} + + + + +class UpdateUserOptions extends Options + { + /** + * @param string $roleSid + * @param string $attributes + * @param string $friendlyName + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + */ + public function __construct( + + string $roleSid = Values::NONE, + string $attributes = Values::NONE, + string $friendlyName = Values::NONE, + string $xTwilioWebhookEnabled = Values::NONE + + ) { + $this->options['roleSid'] = $roleSid; + $this->options['attributes'] = $attributes; + $this->options['friendlyName'] = $friendlyName; + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + } + + /** + * + * + * @param string $roleSid + * @return $this Fluent Builder + */ + public function setRoleSid(string $roleSid): self + { + $this->options['roleSid'] = $roleSid; + return $this; + } + + /** + * + * + * @param string $attributes + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The X-Twilio-Webhook-Enabled HTTP request header + * + * @param string $xTwilioWebhookEnabled The X-Twilio-Webhook-Enabled HTTP request header + * @return $this Fluent Builder + */ + public function setXTwilioWebhookEnabled(string $xTwilioWebhookEnabled): self + { + $this->options['xTwilioWebhookEnabled'] = $xTwilioWebhookEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.UpdateUserOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V2/Service/UserPage.php b/app/api/Twilio/Rest/IpMessaging/V2/Service/UserPage.php new file mode 100755 index 0000000..d938de7 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/Service/UserPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UserInstance \Twilio\Rest\IpMessaging\V2\Service\UserInstance + */ + public function buildInstance(array $payload): UserInstance + { + return new UserInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.UserPage]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V2/ServiceContext.php b/app/api/Twilio/Rest/IpMessaging/V2/ServiceContext.php new file mode 100755 index 0000000..3e43c10 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/ServiceContext.php @@ -0,0 +1,299 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'DefaultServiceRoleSid' => + $options['defaultServiceRoleSid'], + 'DefaultChannelRoleSid' => + $options['defaultChannelRoleSid'], + 'DefaultChannelCreatorRoleSid' => + $options['defaultChannelCreatorRoleSid'], + 'ReadStatusEnabled' => + Serialize::booleanToString($options['readStatusEnabled']), + 'ReachabilityEnabled' => + Serialize::booleanToString($options['reachabilityEnabled']), + 'TypingIndicatorTimeout' => + $options['typingIndicatorTimeout'], + 'ConsumptionReportInterval' => + $options['consumptionReportInterval'], + 'Notifications.NewMessage.Enabled' => + Serialize::booleanToString($options['notificationsNewMessageEnabled']), + 'Notifications.NewMessage.Template' => + $options['notificationsNewMessageTemplate'], + 'Notifications.NewMessage.Sound' => + $options['notificationsNewMessageSound'], + 'Notifications.NewMessage.BadgeCountEnabled' => + Serialize::booleanToString($options['notificationsNewMessageBadgeCountEnabled']), + 'Notifications.AddedToChannel.Enabled' => + Serialize::booleanToString($options['notificationsAddedToChannelEnabled']), + 'Notifications.AddedToChannel.Template' => + $options['notificationsAddedToChannelTemplate'], + 'Notifications.AddedToChannel.Sound' => + $options['notificationsAddedToChannelSound'], + 'Notifications.RemovedFromChannel.Enabled' => + Serialize::booleanToString($options['notificationsRemovedFromChannelEnabled']), + 'Notifications.RemovedFromChannel.Template' => + $options['notificationsRemovedFromChannelTemplate'], + 'Notifications.RemovedFromChannel.Sound' => + $options['notificationsRemovedFromChannelSound'], + 'Notifications.InvitedToChannel.Enabled' => + Serialize::booleanToString($options['notificationsInvitedToChannelEnabled']), + 'Notifications.InvitedToChannel.Template' => + $options['notificationsInvitedToChannelTemplate'], + 'Notifications.InvitedToChannel.Sound' => + $options['notificationsInvitedToChannelSound'], + 'PreWebhookUrl' => + $options['preWebhookUrl'], + 'PostWebhookUrl' => + $options['postWebhookUrl'], + 'WebhookMethod' => + $options['webhookMethod'], + 'WebhookFilters' => + Serialize::map($options['webhookFilters'], function ($e) { return $e; }), + 'Limits.ChannelMembers' => + $options['limitsChannelMembers'], + 'Limits.UserChannels' => + $options['limitsUserChannels'], + 'Media.CompatibilityMessage' => + $options['mediaCompatibilityMessage'], + 'PreWebhookRetryCount' => + $options['preWebhookRetryCount'], + 'PostWebhookRetryCount' => + $options['postWebhookRetryCount'], + 'Notifications.LogEnabled' => + Serialize::booleanToString($options['notificationsLogEnabled']), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the channels + */ + protected function getChannels(): ChannelList + { + if (!$this->_channels) { + $this->_channels = new ChannelList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_channels; + } + + /** + * Access the bindings + */ + protected function getBindings(): BindingList + { + if (!$this->_bindings) { + $this->_bindings = new BindingList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_bindings; + } + + /** + * Access the roles + */ + protected function getRoles(): RoleList + { + if (!$this->_roles) { + $this->_roles = new RoleList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_roles; + } + + /** + * Access the users + */ + protected function getUsers(): UserList + { + if (!$this->_users) { + $this->_users = new UserList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_users; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.ServiceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V2/ServiceInstance.php b/app/api/Twilio/Rest/IpMessaging/V2/ServiceInstance.php new file mode 100755 index 0000000..268d333 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/ServiceInstance.php @@ -0,0 +1,227 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'defaultServiceRoleSid' => Values::array_get($payload, 'default_service_role_sid'), + 'defaultChannelRoleSid' => Values::array_get($payload, 'default_channel_role_sid'), + 'defaultChannelCreatorRoleSid' => Values::array_get($payload, 'default_channel_creator_role_sid'), + 'readStatusEnabled' => Values::array_get($payload, 'read_status_enabled'), + 'reachabilityEnabled' => Values::array_get($payload, 'reachability_enabled'), + 'typingIndicatorTimeout' => Values::array_get($payload, 'typing_indicator_timeout'), + 'consumptionReportInterval' => Values::array_get($payload, 'consumption_report_interval'), + 'limits' => Values::array_get($payload, 'limits'), + 'preWebhookUrl' => Values::array_get($payload, 'pre_webhook_url'), + 'postWebhookUrl' => Values::array_get($payload, 'post_webhook_url'), + 'webhookMethod' => Values::array_get($payload, 'webhook_method'), + 'webhookFilters' => Values::array_get($payload, 'webhook_filters'), + 'preWebhookRetryCount' => Values::array_get($payload, 'pre_webhook_retry_count'), + 'postWebhookRetryCount' => Values::array_get($payload, 'post_webhook_retry_count'), + 'notifications' => Values::array_get($payload, 'notifications'), + 'media' => Values::array_get($payload, 'media'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ServiceContext Context for this ServiceInstance + */ + protected function proxy(): ServiceContext + { + if (!$this->context) { + $this->context = new ServiceContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the channels + */ + protected function getChannels(): ChannelList + { + return $this->proxy()->channels; + } + + /** + * Access the bindings + */ + protected function getBindings(): BindingList + { + return $this->proxy()->bindings; + } + + /** + * Access the roles + */ + protected function getRoles(): RoleList + { + return $this->proxy()->roles; + } + + /** + * Access the users + */ + protected function getUsers(): UserList + { + return $this->proxy()->users; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.IpMessaging.V2.ServiceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V2/ServiceList.php b/app/api/Twilio/Rest/IpMessaging/V2/ServiceList.php new file mode 100755 index 0000000..3755d8a --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/ServiceList.php @@ -0,0 +1,186 @@ +solution = [ + ]; + + $this->uri = '/Services'; + } + + /** + * Create the ServiceInstance + * + * @param string $friendlyName + * @return ServiceInstance Created ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName): ServiceInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new ServiceInstance( + $this->version, + $payload + ); + } + + + /** + * Reads ServiceInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ServiceInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ServiceInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ServiceInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ServicePage Page of ServiceInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ServicePage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ServicePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ServiceInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ServicePage Page of ServiceInstance + */ + public function getPage(string $targetUrl): ServicePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ServicePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ServiceContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): ServiceContext + { + return new ServiceContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.ServiceList]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessaging/V2/ServiceOptions.php b/app/api/Twilio/Rest/IpMessaging/V2/ServiceOptions.php new file mode 100755 index 0000000..f153d4b --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/ServiceOptions.php @@ -0,0 +1,624 @@ +options['friendlyName'] = $friendlyName; + $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; + $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; + $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; + $this->options['readStatusEnabled'] = $readStatusEnabled; + $this->options['reachabilityEnabled'] = $reachabilityEnabled; + $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; + $this->options['consumptionReportInterval'] = $consumptionReportInterval; + $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; + $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; + $this->options['notificationsNewMessageSound'] = $notificationsNewMessageSound; + $this->options['notificationsNewMessageBadgeCountEnabled'] = $notificationsNewMessageBadgeCountEnabled; + $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; + $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; + $this->options['notificationsAddedToChannelSound'] = $notificationsAddedToChannelSound; + $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; + $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; + $this->options['notificationsRemovedFromChannelSound'] = $notificationsRemovedFromChannelSound; + $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; + $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; + $this->options['notificationsInvitedToChannelSound'] = $notificationsInvitedToChannelSound; + $this->options['preWebhookUrl'] = $preWebhookUrl; + $this->options['postWebhookUrl'] = $postWebhookUrl; + $this->options['webhookMethod'] = $webhookMethod; + $this->options['webhookFilters'] = $webhookFilters; + $this->options['limitsChannelMembers'] = $limitsChannelMembers; + $this->options['limitsUserChannels'] = $limitsUserChannels; + $this->options['mediaCompatibilityMessage'] = $mediaCompatibilityMessage; + $this->options['preWebhookRetryCount'] = $preWebhookRetryCount; + $this->options['postWebhookRetryCount'] = $postWebhookRetryCount; + $this->options['notificationsLogEnabled'] = $notificationsLogEnabled; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * + * + * @param string $defaultServiceRoleSid + * @return $this Fluent Builder + */ + public function setDefaultServiceRoleSid(string $defaultServiceRoleSid): self + { + $this->options['defaultServiceRoleSid'] = $defaultServiceRoleSid; + return $this; + } + + /** + * + * + * @param string $defaultChannelRoleSid + * @return $this Fluent Builder + */ + public function setDefaultChannelRoleSid(string $defaultChannelRoleSid): self + { + $this->options['defaultChannelRoleSid'] = $defaultChannelRoleSid; + return $this; + } + + /** + * + * + * @param string $defaultChannelCreatorRoleSid + * @return $this Fluent Builder + */ + public function setDefaultChannelCreatorRoleSid(string $defaultChannelCreatorRoleSid): self + { + $this->options['defaultChannelCreatorRoleSid'] = $defaultChannelCreatorRoleSid; + return $this; + } + + /** + * + * + * @param bool $readStatusEnabled + * @return $this Fluent Builder + */ + public function setReadStatusEnabled(bool $readStatusEnabled): self + { + $this->options['readStatusEnabled'] = $readStatusEnabled; + return $this; + } + + /** + * + * + * @param bool $reachabilityEnabled + * @return $this Fluent Builder + */ + public function setReachabilityEnabled(bool $reachabilityEnabled): self + { + $this->options['reachabilityEnabled'] = $reachabilityEnabled; + return $this; + } + + /** + * + * + * @param int $typingIndicatorTimeout + * @return $this Fluent Builder + */ + public function setTypingIndicatorTimeout(int $typingIndicatorTimeout): self + { + $this->options['typingIndicatorTimeout'] = $typingIndicatorTimeout; + return $this; + } + + /** + * + * + * @param int $consumptionReportInterval + * @return $this Fluent Builder + */ + public function setConsumptionReportInterval(int $consumptionReportInterval): self + { + $this->options['consumptionReportInterval'] = $consumptionReportInterval; + return $this; + } + + /** + * + * + * @param bool $notificationsNewMessageEnabled + * @return $this Fluent Builder + */ + public function setNotificationsNewMessageEnabled(bool $notificationsNewMessageEnabled): self + { + $this->options['notificationsNewMessageEnabled'] = $notificationsNewMessageEnabled; + return $this; + } + + /** + * + * + * @param string $notificationsNewMessageTemplate + * @return $this Fluent Builder + */ + public function setNotificationsNewMessageTemplate(string $notificationsNewMessageTemplate): self + { + $this->options['notificationsNewMessageTemplate'] = $notificationsNewMessageTemplate; + return $this; + } + + /** + * + * + * @param string $notificationsNewMessageSound + * @return $this Fluent Builder + */ + public function setNotificationsNewMessageSound(string $notificationsNewMessageSound): self + { + $this->options['notificationsNewMessageSound'] = $notificationsNewMessageSound; + return $this; + } + + /** + * + * + * @param bool $notificationsNewMessageBadgeCountEnabled + * @return $this Fluent Builder + */ + public function setNotificationsNewMessageBadgeCountEnabled(bool $notificationsNewMessageBadgeCountEnabled): self + { + $this->options['notificationsNewMessageBadgeCountEnabled'] = $notificationsNewMessageBadgeCountEnabled; + return $this; + } + + /** + * + * + * @param bool $notificationsAddedToChannelEnabled + * @return $this Fluent Builder + */ + public function setNotificationsAddedToChannelEnabled(bool $notificationsAddedToChannelEnabled): self + { + $this->options['notificationsAddedToChannelEnabled'] = $notificationsAddedToChannelEnabled; + return $this; + } + + /** + * + * + * @param string $notificationsAddedToChannelTemplate + * @return $this Fluent Builder + */ + public function setNotificationsAddedToChannelTemplate(string $notificationsAddedToChannelTemplate): self + { + $this->options['notificationsAddedToChannelTemplate'] = $notificationsAddedToChannelTemplate; + return $this; + } + + /** + * + * + * @param string $notificationsAddedToChannelSound + * @return $this Fluent Builder + */ + public function setNotificationsAddedToChannelSound(string $notificationsAddedToChannelSound): self + { + $this->options['notificationsAddedToChannelSound'] = $notificationsAddedToChannelSound; + return $this; + } + + /** + * + * + * @param bool $notificationsRemovedFromChannelEnabled + * @return $this Fluent Builder + */ + public function setNotificationsRemovedFromChannelEnabled(bool $notificationsRemovedFromChannelEnabled): self + { + $this->options['notificationsRemovedFromChannelEnabled'] = $notificationsRemovedFromChannelEnabled; + return $this; + } + + /** + * + * + * @param string $notificationsRemovedFromChannelTemplate + * @return $this Fluent Builder + */ + public function setNotificationsRemovedFromChannelTemplate(string $notificationsRemovedFromChannelTemplate): self + { + $this->options['notificationsRemovedFromChannelTemplate'] = $notificationsRemovedFromChannelTemplate; + return $this; + } + + /** + * + * + * @param string $notificationsRemovedFromChannelSound + * @return $this Fluent Builder + */ + public function setNotificationsRemovedFromChannelSound(string $notificationsRemovedFromChannelSound): self + { + $this->options['notificationsRemovedFromChannelSound'] = $notificationsRemovedFromChannelSound; + return $this; + } + + /** + * + * + * @param bool $notificationsInvitedToChannelEnabled + * @return $this Fluent Builder + */ + public function setNotificationsInvitedToChannelEnabled(bool $notificationsInvitedToChannelEnabled): self + { + $this->options['notificationsInvitedToChannelEnabled'] = $notificationsInvitedToChannelEnabled; + return $this; + } + + /** + * + * + * @param string $notificationsInvitedToChannelTemplate + * @return $this Fluent Builder + */ + public function setNotificationsInvitedToChannelTemplate(string $notificationsInvitedToChannelTemplate): self + { + $this->options['notificationsInvitedToChannelTemplate'] = $notificationsInvitedToChannelTemplate; + return $this; + } + + /** + * + * + * @param string $notificationsInvitedToChannelSound + * @return $this Fluent Builder + */ + public function setNotificationsInvitedToChannelSound(string $notificationsInvitedToChannelSound): self + { + $this->options['notificationsInvitedToChannelSound'] = $notificationsInvitedToChannelSound; + return $this; + } + + /** + * + * + * @param string $preWebhookUrl + * @return $this Fluent Builder + */ + public function setPreWebhookUrl(string $preWebhookUrl): self + { + $this->options['preWebhookUrl'] = $preWebhookUrl; + return $this; + } + + /** + * + * + * @param string $postWebhookUrl + * @return $this Fluent Builder + */ + public function setPostWebhookUrl(string $postWebhookUrl): self + { + $this->options['postWebhookUrl'] = $postWebhookUrl; + return $this; + } + + /** + * + * + * @param string $webhookMethod + * @return $this Fluent Builder + */ + public function setWebhookMethod(string $webhookMethod): self + { + $this->options['webhookMethod'] = $webhookMethod; + return $this; + } + + /** + * + * + * @param string[] $webhookFilters + * @return $this Fluent Builder + */ + public function setWebhookFilters(array $webhookFilters): self + { + $this->options['webhookFilters'] = $webhookFilters; + return $this; + } + + /** + * + * + * @param int $limitsChannelMembers + * @return $this Fluent Builder + */ + public function setLimitsChannelMembers(int $limitsChannelMembers): self + { + $this->options['limitsChannelMembers'] = $limitsChannelMembers; + return $this; + } + + /** + * + * + * @param int $limitsUserChannels + * @return $this Fluent Builder + */ + public function setLimitsUserChannels(int $limitsUserChannels): self + { + $this->options['limitsUserChannels'] = $limitsUserChannels; + return $this; + } + + /** + * + * + * @param string $mediaCompatibilityMessage + * @return $this Fluent Builder + */ + public function setMediaCompatibilityMessage(string $mediaCompatibilityMessage): self + { + $this->options['mediaCompatibilityMessage'] = $mediaCompatibilityMessage; + return $this; + } + + /** + * + * + * @param int $preWebhookRetryCount + * @return $this Fluent Builder + */ + public function setPreWebhookRetryCount(int $preWebhookRetryCount): self + { + $this->options['preWebhookRetryCount'] = $preWebhookRetryCount; + return $this; + } + + /** + * + * + * @param int $postWebhookRetryCount + * @return $this Fluent Builder + */ + public function setPostWebhookRetryCount(int $postWebhookRetryCount): self + { + $this->options['postWebhookRetryCount'] = $postWebhookRetryCount; + return $this; + } + + /** + * + * + * @param bool $notificationsLogEnabled + * @return $this Fluent Builder + */ + public function setNotificationsLogEnabled(bool $notificationsLogEnabled): self + { + $this->options['notificationsLogEnabled'] = $notificationsLogEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.IpMessaging.V2.UpdateServiceOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/IpMessaging/V2/ServicePage.php b/app/api/Twilio/Rest/IpMessaging/V2/ServicePage.php new file mode 100755 index 0000000..3c72d5e --- /dev/null +++ b/app/api/Twilio/Rest/IpMessaging/V2/ServicePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ServiceInstance \Twilio\Rest\IpMessaging\V2\ServiceInstance + */ + public function buildInstance(array $payload): ServiceInstance + { + return new ServiceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.IpMessaging.V2.ServicePage]'; + } +} diff --git a/app/api/Twilio/Rest/IpMessagingBase.php b/app/api/Twilio/Rest/IpMessagingBase.php new file mode 100755 index 0000000..2e1b8e5 --- /dev/null +++ b/app/api/Twilio/Rest/IpMessagingBase.php @@ -0,0 +1,101 @@ +baseUrl = 'https://ip-messaging.twilio.com'; + } + + + /** + * @return V1 Version v1 of ip-messaging + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * @return V2 Version v2 of ip-messaging + */ + protected function getV2(): V2 { + if (!$this->_v2) { + $this->_v2 = new V2($this); + } + return $this->_v2; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.IpMessaging]'; + } +} diff --git a/app/api/Twilio/Rest/Lookups.php b/app/api/Twilio/Rest/Lookups.php new file mode 100755 index 0000000..e16afa1 --- /dev/null +++ b/app/api/Twilio/Rest/Lookups.php @@ -0,0 +1,25 @@ +phoneNumbers instead. + */ + protected function getPhoneNumbers(): \Twilio\Rest\Lookups\V1\PhoneNumberList { + echo "phoneNumbers is deprecated. Use v1->phoneNumbers instead."; + return $this->v1->phoneNumbers; + } + + /** + * @deprecated Use v1->phoneNumbers(\$phoneNumber) instead. + * @param string $phoneNumber The phone number to fetch in E.164 format + */ + protected function contextPhoneNumbers(string $phoneNumber): \Twilio\Rest\Lookups\V1\PhoneNumberContext { + echo "phoneNumbers(\$phoneNumber) is deprecated. Use v1->phoneNumbers(\$phoneNumber) instead."; + return $this->v1->phoneNumbers($phoneNumber); + } +} \ No newline at end of file diff --git a/app/api/Twilio/Rest/Lookups/V1.php b/app/api/Twilio/Rest/Lookups/V1.php new file mode 100755 index 0000000..27d6350 --- /dev/null +++ b/app/api/Twilio/Rest/Lookups/V1.php @@ -0,0 +1,95 @@ +version = 'v1'; + } + + protected function getPhoneNumbers(): PhoneNumberList + { + if (!$this->_phoneNumbers) { + $this->_phoneNumbers = new PhoneNumberList($this); + } + return $this->_phoneNumbers; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Lookups.V1]'; + } +} diff --git a/app/api/Twilio/Rest/Lookups/V1/PhoneNumberContext.php b/app/api/Twilio/Rest/Lookups/V1/PhoneNumberContext.php new file mode 100755 index 0000000..66845b4 --- /dev/null +++ b/app/api/Twilio/Rest/Lookups/V1/PhoneNumberContext.php @@ -0,0 +1,97 @@ +solution = [ + 'phoneNumber' => + $phoneNumber, + ]; + + $this->uri = '/PhoneNumbers/' . \rawurlencode($phoneNumber) + .''; + } + + /** + * Fetch the PhoneNumberInstance + * + * @param array|Options $options Optional Arguments + * @return PhoneNumberInstance Fetched PhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): PhoneNumberInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'CountryCode' => + $options['countryCode'], + 'Type' => + Serialize::map($options['type'], function ($e) { return $e; }), + 'AddOns' => + Serialize::map($options['addOns'], function ($e) { return $e; }), + ]); + $params = \array_merge($params, Serialize::prefixedCollapsibleMap($options['addOnsData'], 'AddOns')); + + $payload = $this->version->fetch('GET', $this->uri, $params); + + return new PhoneNumberInstance( + $this->version, + $payload, + $this->solution['phoneNumber'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Lookups.V1.PhoneNumberContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Lookups/V1/PhoneNumberInstance.php b/app/api/Twilio/Rest/Lookups/V1/PhoneNumberInstance.php new file mode 100755 index 0000000..e59be9c --- /dev/null +++ b/app/api/Twilio/Rest/Lookups/V1/PhoneNumberInstance.php @@ -0,0 +1,129 @@ +properties = [ + 'callerName' => Values::array_get($payload, 'caller_name'), + 'countryCode' => Values::array_get($payload, 'country_code'), + 'phoneNumber' => Values::array_get($payload, 'phone_number'), + 'nationalFormat' => Values::array_get($payload, 'national_format'), + 'carrier' => Values::array_get($payload, 'carrier'), + 'addOns' => Values::array_get($payload, 'add_ons'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['phoneNumber' => $phoneNumber ?: $this->properties['phoneNumber'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return PhoneNumberContext Context for this PhoneNumberInstance + */ + protected function proxy(): PhoneNumberContext + { + if (!$this->context) { + $this->context = new PhoneNumberContext( + $this->version, + $this->solution['phoneNumber'] + ); + } + + return $this->context; + } + + /** + * Fetch the PhoneNumberInstance + * + * @param array|Options $options Optional Arguments + * @return PhoneNumberInstance Fetched PhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): PhoneNumberInstance + { + + return $this->proxy()->fetch($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Lookups.V1.PhoneNumberInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Lookups/V1/PhoneNumberList.php b/app/api/Twilio/Rest/Lookups/V1/PhoneNumberList.php new file mode 100755 index 0000000..5919089 --- /dev/null +++ b/app/api/Twilio/Rest/Lookups/V1/PhoneNumberList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a PhoneNumberContext + * + * @param string $phoneNumber The phone number to lookup in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, which consists of a + followed by the country code and subscriber number. + */ + public function getContext( + string $phoneNumber + + ): PhoneNumberContext + { + return new PhoneNumberContext( + $this->version, + $phoneNumber + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Lookups.V1.PhoneNumberList]'; + } +} diff --git a/app/api/Twilio/Rest/Lookups/V1/PhoneNumberOptions.php b/app/api/Twilio/Rest/Lookups/V1/PhoneNumberOptions.php new file mode 100755 index 0000000..0a02749 --- /dev/null +++ b/app/api/Twilio/Rest/Lookups/V1/PhoneNumberOptions.php @@ -0,0 +1,130 @@ +options['countryCode'] = $countryCode; + $this->options['type'] = $type; + $this->options['addOns'] = $addOns; + $this->options['addOnsData'] = $addOnsData; + } + + /** + * The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the phone number to fetch. This is used to specify the country when the phone number is provided in a national format. + * + * @param string $countryCode The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the phone number to fetch. This is used to specify the country when the phone number is provided in a national format. + * @return $this Fluent Builder + */ + public function setCountryCode(string $countryCode): self + { + $this->options['countryCode'] = $countryCode; + return $this; + } + + /** + * The type of information to return. Can be: `carrier` or `caller-name`. The default is null. Carrier information costs $0.005 per phone number looked up. Caller Name information is currently available only in the US and costs $0.01 per phone number looked up. To retrieve both types on information, specify this parameter twice; once with `carrier` and once with `caller-name` as the value. + * + * @param string[] $type The type of information to return. Can be: `carrier` or `caller-name`. The default is null. Carrier information costs $0.005 per phone number looked up. Caller Name information is currently available only in the US and costs $0.01 per phone number looked up. To retrieve both types on information, specify this parameter twice; once with `carrier` and once with `caller-name` as the value. + * @return $this Fluent Builder + */ + public function setType(array $type): self + { + $this->options['type'] = $type; + return $this; + } + + /** + * The `unique_name` of an Add-on you would like to invoke. Can be the `unique_name` of an Add-on that is installed on your account. You can specify multiple instances of this parameter to invoke multiple Add-ons. For more information about Add-ons, see the [Add-ons documentation](https://www.twilio.com/docs/add-ons). + * + * @param string[] $addOns The `unique_name` of an Add-on you would like to invoke. Can be the `unique_name` of an Add-on that is installed on your account. You can specify multiple instances of this parameter to invoke multiple Add-ons. For more information about Add-ons, see the [Add-ons documentation](https://www.twilio.com/docs/add-ons). + * @return $this Fluent Builder + */ + public function setAddOns(array $addOns): self + { + $this->options['addOns'] = $addOns; + return $this; + } + + /** + * Data specific to the add-on you would like to invoke. The content and format of this value depends on the add-on. + * + * @param string $addOnsData Data specific to the add-on you would like to invoke. The content and format of this value depends on the add-on. + * @return $this Fluent Builder + */ + public function setAddOnsData(string $addOnsData): self + { + $this->options['addOnsData'] = $addOnsData; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Lookups.V1.FetchPhoneNumberOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Lookups/V1/PhoneNumberPage.php b/app/api/Twilio/Rest/Lookups/V1/PhoneNumberPage.php new file mode 100755 index 0000000..a2954c4 --- /dev/null +++ b/app/api/Twilio/Rest/Lookups/V1/PhoneNumberPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PhoneNumberInstance \Twilio\Rest\Lookups\V1\PhoneNumberInstance + */ + public function buildInstance(array $payload): PhoneNumberInstance + { + return new PhoneNumberInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Lookups.V1.PhoneNumberPage]'; + } +} diff --git a/app/api/Twilio/Rest/Lookups/V2.php b/app/api/Twilio/Rest/Lookups/V2.php new file mode 100755 index 0000000..cec6204 --- /dev/null +++ b/app/api/Twilio/Rest/Lookups/V2.php @@ -0,0 +1,95 @@ +version = 'v2'; + } + + protected function getPhoneNumbers(): PhoneNumberList + { + if (!$this->_phoneNumbers) { + $this->_phoneNumbers = new PhoneNumberList($this); + } + return $this->_phoneNumbers; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Lookups.V2]'; + } +} diff --git a/app/api/Twilio/Rest/Lookups/V2/PhoneNumberContext.php b/app/api/Twilio/Rest/Lookups/V2/PhoneNumberContext.php new file mode 100755 index 0000000..e2ced22 --- /dev/null +++ b/app/api/Twilio/Rest/Lookups/V2/PhoneNumberContext.php @@ -0,0 +1,113 @@ +solution = [ + 'phoneNumber' => + $phoneNumber, + ]; + + $this->uri = '/PhoneNumbers/' . \rawurlencode($phoneNumber) + .''; + } + + /** + * Fetch the PhoneNumberInstance + * + * @param array|Options $options Optional Arguments + * @return PhoneNumberInstance Fetched PhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): PhoneNumberInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'Fields' => + $options['fields'], + 'CountryCode' => + $options['countryCode'], + 'FirstName' => + $options['firstName'], + 'LastName' => + $options['lastName'], + 'AddressLine1' => + $options['addressLine1'], + 'AddressLine2' => + $options['addressLine2'], + 'City' => + $options['city'], + 'State' => + $options['state'], + 'PostalCode' => + $options['postalCode'], + 'AddressCountryCode' => + $options['addressCountryCode'], + 'NationalId' => + $options['nationalId'], + 'DateOfBirth' => + $options['dateOfBirth'], + ]); + + $payload = $this->version->fetch('GET', $this->uri, $params); + + return new PhoneNumberInstance( + $this->version, + $payload, + $this->solution['phoneNumber'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Lookups.V2.PhoneNumberContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Lookups/V2/PhoneNumberInstance.php b/app/api/Twilio/Rest/Lookups/V2/PhoneNumberInstance.php new file mode 100755 index 0000000..2be5ea8 --- /dev/null +++ b/app/api/Twilio/Rest/Lookups/V2/PhoneNumberInstance.php @@ -0,0 +1,143 @@ +properties = [ + 'callingCountryCode' => Values::array_get($payload, 'calling_country_code'), + 'countryCode' => Values::array_get($payload, 'country_code'), + 'phoneNumber' => Values::array_get($payload, 'phone_number'), + 'nationalFormat' => Values::array_get($payload, 'national_format'), + 'valid' => Values::array_get($payload, 'valid'), + 'validationErrors' => Values::array_get($payload, 'validation_errors'), + 'callerName' => Values::array_get($payload, 'caller_name'), + 'simSwap' => Values::array_get($payload, 'sim_swap'), + 'callForwarding' => Values::array_get($payload, 'call_forwarding'), + 'liveActivity' => Values::array_get($payload, 'live_activity'), + 'lineTypeIntelligence' => Values::array_get($payload, 'line_type_intelligence'), + 'identityMatch' => Values::array_get($payload, 'identity_match'), + 'smsPumpingRisk' => Values::array_get($payload, 'sms_pumping_risk'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['phoneNumber' => $phoneNumber ?: $this->properties['phoneNumber'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return PhoneNumberContext Context for this PhoneNumberInstance + */ + protected function proxy(): PhoneNumberContext + { + if (!$this->context) { + $this->context = new PhoneNumberContext( + $this->version, + $this->solution['phoneNumber'] + ); + } + + return $this->context; + } + + /** + * Fetch the PhoneNumberInstance + * + * @param array|Options $options Optional Arguments + * @return PhoneNumberInstance Fetched PhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): PhoneNumberInstance + { + + return $this->proxy()->fetch($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Lookups.V2.PhoneNumberInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Lookups/V2/PhoneNumberList.php b/app/api/Twilio/Rest/Lookups/V2/PhoneNumberList.php new file mode 100755 index 0000000..1a4c3e1 --- /dev/null +++ b/app/api/Twilio/Rest/Lookups/V2/PhoneNumberList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a PhoneNumberContext + * + * @param string $phoneNumber The phone number to lookup in E.164 or national format. Default country code is +1 (North America). + */ + public function getContext( + string $phoneNumber + + ): PhoneNumberContext + { + return new PhoneNumberContext( + $this->version, + $phoneNumber + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Lookups.V2.PhoneNumberList]'; + } +} diff --git a/app/api/Twilio/Rest/Lookups/V2/PhoneNumberOptions.php b/app/api/Twilio/Rest/Lookups/V2/PhoneNumberOptions.php new file mode 100755 index 0000000..364cda7 --- /dev/null +++ b/app/api/Twilio/Rest/Lookups/V2/PhoneNumberOptions.php @@ -0,0 +1,274 @@ +options['fields'] = $fields; + $this->options['countryCode'] = $countryCode; + $this->options['firstName'] = $firstName; + $this->options['lastName'] = $lastName; + $this->options['addressLine1'] = $addressLine1; + $this->options['addressLine2'] = $addressLine2; + $this->options['city'] = $city; + $this->options['state'] = $state; + $this->options['postalCode'] = $postalCode; + $this->options['addressCountryCode'] = $addressCountryCode; + $this->options['nationalId'] = $nationalId; + $this->options['dateOfBirth'] = $dateOfBirth; + } + + /** + * A comma-separated list of fields to return. Possible values are caller_name, sim_swap, call_forwarding, live_activity, line_type_intelligence, identity_match. + * + * @param string $fields A comma-separated list of fields to return. Possible values are caller_name, sim_swap, call_forwarding, live_activity, line_type_intelligence, identity_match. + * @return $this Fluent Builder + */ + public function setFields(string $fields): self + { + $this->options['fields'] = $fields; + return $this; + } + + /** + * The [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) used if the phone number provided is in national format. + * + * @param string $countryCode The [country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) used if the phone number provided is in national format. + * @return $this Fluent Builder + */ + public function setCountryCode(string $countryCode): self + { + $this->options['countryCode'] = $countryCode; + return $this; + } + + /** + * User’s first name. This query parameter is only used (optionally) for identity_match package requests. + * + * @param string $firstName User’s first name. This query parameter is only used (optionally) for identity_match package requests. + * @return $this Fluent Builder + */ + public function setFirstName(string $firstName): self + { + $this->options['firstName'] = $firstName; + return $this; + } + + /** + * User’s last name. This query parameter is only used (optionally) for identity_match package requests. + * + * @param string $lastName User’s last name. This query parameter is only used (optionally) for identity_match package requests. + * @return $this Fluent Builder + */ + public function setLastName(string $lastName): self + { + $this->options['lastName'] = $lastName; + return $this; + } + + /** + * User’s first address line. This query parameter is only used (optionally) for identity_match package requests. + * + * @param string $addressLine1 User’s first address line. This query parameter is only used (optionally) for identity_match package requests. + * @return $this Fluent Builder + */ + public function setAddressLine1(string $addressLine1): self + { + $this->options['addressLine1'] = $addressLine1; + return $this; + } + + /** + * User’s second address line. This query parameter is only used (optionally) for identity_match package requests. + * + * @param string $addressLine2 User’s second address line. This query parameter is only used (optionally) for identity_match package requests. + * @return $this Fluent Builder + */ + public function setAddressLine2(string $addressLine2): self + { + $this->options['addressLine2'] = $addressLine2; + return $this; + } + + /** + * User’s city. This query parameter is only used (optionally) for identity_match package requests. + * + * @param string $city User’s city. This query parameter is only used (optionally) for identity_match package requests. + * @return $this Fluent Builder + */ + public function setCity(string $city): self + { + $this->options['city'] = $city; + return $this; + } + + /** + * User’s country subdivision, such as state, province, or locality. This query parameter is only used (optionally) for identity_match package requests. + * + * @param string $state User’s country subdivision, such as state, province, or locality. This query parameter is only used (optionally) for identity_match package requests. + * @return $this Fluent Builder + */ + public function setState(string $state): self + { + $this->options['state'] = $state; + return $this; + } + + /** + * User’s postal zip code. This query parameter is only used (optionally) for identity_match package requests. + * + * @param string $postalCode User’s postal zip code. This query parameter is only used (optionally) for identity_match package requests. + * @return $this Fluent Builder + */ + public function setPostalCode(string $postalCode): self + { + $this->options['postalCode'] = $postalCode; + return $this; + } + + /** + * User’s country, up to two characters. This query parameter is only used (optionally) for identity_match package requests. + * + * @param string $addressCountryCode User’s country, up to two characters. This query parameter is only used (optionally) for identity_match package requests. + * @return $this Fluent Builder + */ + public function setAddressCountryCode(string $addressCountryCode): self + { + $this->options['addressCountryCode'] = $addressCountryCode; + return $this; + } + + /** + * User’s national ID, such as SSN or Passport ID. This query parameter is only used (optionally) for identity_match package requests. + * + * @param string $nationalId User’s national ID, such as SSN or Passport ID. This query parameter is only used (optionally) for identity_match package requests. + * @return $this Fluent Builder + */ + public function setNationalId(string $nationalId): self + { + $this->options['nationalId'] = $nationalId; + return $this; + } + + /** + * User’s date of birth, in YYYYMMDD format. This query parameter is only used (optionally) for identity_match package requests. + * + * @param string $dateOfBirth User’s date of birth, in YYYYMMDD format. This query parameter is only used (optionally) for identity_match package requests. + * @return $this Fluent Builder + */ + public function setDateOfBirth(string $dateOfBirth): self + { + $this->options['dateOfBirth'] = $dateOfBirth; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Lookups.V2.FetchPhoneNumberOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Lookups/V2/PhoneNumberPage.php b/app/api/Twilio/Rest/Lookups/V2/PhoneNumberPage.php new file mode 100755 index 0000000..ae8e3c2 --- /dev/null +++ b/app/api/Twilio/Rest/Lookups/V2/PhoneNumberPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PhoneNumberInstance \Twilio\Rest\Lookups\V2\PhoneNumberInstance + */ + public function buildInstance(array $payload): PhoneNumberInstance + { + return new PhoneNumberInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Lookups.V2.PhoneNumberPage]'; + } +} diff --git a/app/api/Twilio/Rest/LookupsBase.php b/app/api/Twilio/Rest/LookupsBase.php new file mode 100755 index 0000000..2b3cc59 --- /dev/null +++ b/app/api/Twilio/Rest/LookupsBase.php @@ -0,0 +1,101 @@ +baseUrl = 'https://lookups.twilio.com'; + } + + + /** + * @return V1 Version v1 of lookups + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * @return V2 Version v2 of lookups + */ + protected function getV2(): V2 { + if (!$this->_v2) { + $this->_v2 = new V2($this); + } + return $this->_v2; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Lookups]'; + } +} diff --git a/app/api/Twilio/Rest/Media.php b/app/api/Twilio/Rest/Media.php new file mode 100755 index 0000000..c7b7362 --- /dev/null +++ b/app/api/Twilio/Rest/Media.php @@ -0,0 +1,59 @@ +mediaProcessor instead. + */ + protected function getMediaProcessor(): \Twilio\Rest\Media\V1\MediaProcessorList { + echo "mediaProcessor is deprecated. Use v1->mediaProcessor instead."; + return $this->v1->mediaProcessor; + } + + /** + * @deprecated Use v1->mediaProcessor(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextMediaProcessor(string $sid): \Twilio\Rest\Media\V1\MediaProcessorContext { + echo "mediaProcessor(\$sid) is deprecated. Use v1->mediaProcessor(\$sid) instead."; + return $this->v1->mediaProcessor($sid); + } + + /** + * @deprecated Use v1->mediaRecording instead. + */ + protected function getMediaRecording(): \Twilio\Rest\Media\V1\MediaRecordingList { + echo "mediaRecording is deprecated. Use v1->mediaRecording instead."; + return $this->v1->mediaRecording; + } + + /** + * @deprecated Use v1->mediaRecording(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextMediaRecording(string $sid): \Twilio\Rest\Media\V1\MediaRecordingContext { + echo "mediaRecording(\$sid) is deprecated. Use v1->mediaRecording(\$sid) instead."; + return $this->v1->mediaRecording($sid); + } + + /** + * @deprecated Use v1->playerStreamer instead. + */ + protected function getPlayerStreamer(): \Twilio\Rest\Media\V1\PlayerStreamerList { + echo "playerStreamer is deprecated. Use v1->playerStreamer instead."; + return $this->v1->playerStreamer; + } + + /** + * @deprecated Use v1->playerStreamer(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextPlayerStreamer(string $sid): \Twilio\Rest\Media\V1\PlayerStreamerContext { + echo "playerStreamer(\$sid) is deprecated. Use v1->playerStreamer(\$sid) instead."; + return $this->v1->playerStreamer($sid); + } +} \ No newline at end of file diff --git a/app/api/Twilio/Rest/Media/V1.php b/app/api/Twilio/Rest/Media/V1.php new file mode 100755 index 0000000..8c8d0d3 --- /dev/null +++ b/app/api/Twilio/Rest/Media/V1.php @@ -0,0 +1,119 @@ +version = 'v1'; + } + + protected function getMediaProcessor(): MediaProcessorList + { + if (!$this->_mediaProcessor) { + $this->_mediaProcessor = new MediaProcessorList($this); + } + return $this->_mediaProcessor; + } + + protected function getMediaRecording(): MediaRecordingList + { + if (!$this->_mediaRecording) { + $this->_mediaRecording = new MediaRecordingList($this); + } + return $this->_mediaRecording; + } + + protected function getPlayerStreamer(): PlayerStreamerList + { + if (!$this->_playerStreamer) { + $this->_playerStreamer = new PlayerStreamerList($this); + } + return $this->_playerStreamer; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Media.V1]'; + } +} diff --git a/app/api/Twilio/Rest/Media/V1/MediaProcessorContext.php b/app/api/Twilio/Rest/Media/V1/MediaProcessorContext.php new file mode 100755 index 0000000..64ae9ec --- /dev/null +++ b/app/api/Twilio/Rest/Media/V1/MediaProcessorContext.php @@ -0,0 +1,107 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/MediaProcessors/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the MediaProcessorInstance + * + * @return MediaProcessorInstance Fetched MediaProcessorInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MediaProcessorInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new MediaProcessorInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the MediaProcessorInstance + * + * @param string $status + * @return MediaProcessorInstance Updated MediaProcessorInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status): MediaProcessorInstance + { + + $data = Values::of([ + 'Status' => + $status, + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new MediaProcessorInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Media.V1.MediaProcessorContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Media/V1/MediaProcessorInstance.php b/app/api/Twilio/Rest/Media/V1/MediaProcessorInstance.php new file mode 100755 index 0000000..2eb2ce7 --- /dev/null +++ b/app/api/Twilio/Rest/Media/V1/MediaProcessorInstance.php @@ -0,0 +1,151 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'extension' => Values::array_get($payload, 'extension'), + 'extensionContext' => Values::array_get($payload, 'extension_context'), + 'status' => Values::array_get($payload, 'status'), + 'url' => Values::array_get($payload, 'url'), + 'endedReason' => Values::array_get($payload, 'ended_reason'), + 'statusCallback' => Values::array_get($payload, 'status_callback'), + 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), + 'maxDuration' => Values::array_get($payload, 'max_duration'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return MediaProcessorContext Context for this MediaProcessorInstance + */ + protected function proxy(): MediaProcessorContext + { + if (!$this->context) { + $this->context = new MediaProcessorContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the MediaProcessorInstance + * + * @return MediaProcessorInstance Fetched MediaProcessorInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MediaProcessorInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the MediaProcessorInstance + * + * @param string $status + * @return MediaProcessorInstance Updated MediaProcessorInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status): MediaProcessorInstance + { + + return $this->proxy()->update($status); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Media.V1.MediaProcessorInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Media/V1/MediaProcessorList.php b/app/api/Twilio/Rest/Media/V1/MediaProcessorList.php new file mode 100755 index 0000000..f5ef159 --- /dev/null +++ b/app/api/Twilio/Rest/Media/V1/MediaProcessorList.php @@ -0,0 +1,210 @@ +solution = [ + ]; + + $this->uri = '/MediaProcessors'; + } + + /** + * Create the MediaProcessorInstance + * + * @param string $extension The [Media Extension](/docs/live/api/media-extensions-overview) name or URL. Ex: `video-composer-v2` + * @param string $extensionContext The context of the Media Extension, represented as a JSON dictionary. See the documentation for the specific [Media Extension](/docs/live/api/media-extensions-overview) you are using for more information about the context to send. + * @param array|Options $options Optional Arguments + * @return MediaProcessorInstance Created MediaProcessorInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $extension, string $extensionContext, array $options = []): MediaProcessorInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Extension' => + $extension, + 'ExtensionContext' => + $extensionContext, + 'ExtensionEnvironment' => + Serialize::jsonObject($options['extensionEnvironment']), + 'StatusCallback' => + $options['statusCallback'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'MaxDuration' => + $options['maxDuration'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new MediaProcessorInstance( + $this->version, + $payload + ); + } + + + /** + * Reads MediaProcessorInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return MediaProcessorInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams MediaProcessorInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of MediaProcessorInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return MediaProcessorPage Page of MediaProcessorInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MediaProcessorPage + { + $options = new Values($options); + + $params = Values::of([ + 'Order' => + $options['order'], + 'Status' => + $options['status'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new MediaProcessorPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of MediaProcessorInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return MediaProcessorPage Page of MediaProcessorInstance + */ + public function getPage(string $targetUrl): MediaProcessorPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new MediaProcessorPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a MediaProcessorContext + * + * @param string $sid The SID of the MediaProcessor resource to fetch. + */ + public function getContext( + string $sid + + ): MediaProcessorContext + { + return new MediaProcessorContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Media.V1.MediaProcessorList]'; + } +} diff --git a/app/api/Twilio/Rest/Media/V1/MediaProcessorOptions.php b/app/api/Twilio/Rest/Media/V1/MediaProcessorOptions.php new file mode 100755 index 0000000..0cbf5c3 --- /dev/null +++ b/app/api/Twilio/Rest/Media/V1/MediaProcessorOptions.php @@ -0,0 +1,204 @@ +options['extensionEnvironment'] = $extensionEnvironment; + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['maxDuration'] = $maxDuration; + } + + /** + * User-defined environment variables for the Media Extension, represented as a JSON dictionary of key/value strings. See the documentation for the specific [Media Extension](/docs/live/api/media-extensions-overview) you are using for more information about whether you need to provide this. + * + * @param array $extensionEnvironment User-defined environment variables for the Media Extension, represented as a JSON dictionary of key/value strings. See the documentation for the specific [Media Extension](/docs/live/api/media-extensions-overview) you are using for more information about whether you need to provide this. + * @return $this Fluent Builder + */ + public function setExtensionEnvironment(array $extensionEnvironment): self + { + $this->options['extensionEnvironment'] = $extensionEnvironment; + return $this; + } + + /** + * The URL to which Twilio will send asynchronous webhook requests for every MediaProcessor event. See [Status Callbacks](/docs/live/status-callbacks) for details. + * + * @param string $statusCallback The URL to which Twilio will send asynchronous webhook requests for every MediaProcessor event. See [Status Callbacks](/docs/live/status-callbacks) for details. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The HTTP method Twilio should use to call the `status_callback` URL. Can be `POST` or `GET` and the default is `POST`. + * + * @param string $statusCallbackMethod The HTTP method Twilio should use to call the `status_callback` URL. Can be `POST` or `GET` and the default is `POST`. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * The maximum time, in seconds, that the MediaProcessor can run before automatically ends. The default value is 300 seconds, and the maximum value is 90000 seconds. Once this maximum duration is reached, Twilio will end the MediaProcessor, regardless of whether media is still streaming. + * + * @param int $maxDuration The maximum time, in seconds, that the MediaProcessor can run before automatically ends. The default value is 300 seconds, and the maximum value is 90000 seconds. Once this maximum duration is reached, Twilio will end the MediaProcessor, regardless of whether media is still streaming. + * @return $this Fluent Builder + */ + public function setMaxDuration(int $maxDuration): self + { + $this->options['maxDuration'] = $maxDuration; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Media.V1.CreateMediaProcessorOptions ' . $options . ']'; + } +} + + +class ReadMediaProcessorOptions extends Options + { + /** + * @param string $order The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. + * @param string $status Status to filter by, with possible values `started`, `ended` or `failed`. + */ + public function __construct( + + string $order = Values::NONE, + string $status = Values::NONE + + ) { + $this->options['order'] = $order; + $this->options['status'] = $status; + } + + /** + * The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. + * + * @param string $order The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. + * @return $this Fluent Builder + */ + public function setOrder(string $order): self + { + $this->options['order'] = $order; + return $this; + } + + /** + * Status to filter by, with possible values `started`, `ended` or `failed`. + * + * @param string $status Status to filter by, with possible values `started`, `ended` or `failed`. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Media.V1.ReadMediaProcessorOptions ' . $options . ']'; + } +} + + diff --git a/app/api/Twilio/Rest/Media/V1/MediaProcessorPage.php b/app/api/Twilio/Rest/Media/V1/MediaProcessorPage.php new file mode 100755 index 0000000..e1e74a4 --- /dev/null +++ b/app/api/Twilio/Rest/Media/V1/MediaProcessorPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MediaProcessorInstance \Twilio\Rest\Media\V1\MediaProcessorInstance + */ + public function buildInstance(array $payload): MediaProcessorInstance + { + return new MediaProcessorInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Media.V1.MediaProcessorPage]'; + } +} diff --git a/app/api/Twilio/Rest/Media/V1/MediaRecordingContext.php b/app/api/Twilio/Rest/Media/V1/MediaRecordingContext.php new file mode 100755 index 0000000..5185bfc --- /dev/null +++ b/app/api/Twilio/Rest/Media/V1/MediaRecordingContext.php @@ -0,0 +1,94 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/MediaRecordings/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the MediaRecordingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the MediaRecordingInstance + * + * @return MediaRecordingInstance Fetched MediaRecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MediaRecordingInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new MediaRecordingInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Media.V1.MediaRecordingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Media/V1/MediaRecordingInstance.php b/app/api/Twilio/Rest/Media/V1/MediaRecordingInstance.php new file mode 100755 index 0000000..c1623d1 --- /dev/null +++ b/app/api/Twilio/Rest/Media/V1/MediaRecordingInstance.php @@ -0,0 +1,156 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'duration' => Values::array_get($payload, 'duration'), + 'format' => Values::array_get($payload, 'format'), + 'links' => Values::array_get($payload, 'links'), + 'processorSid' => Values::array_get($payload, 'processor_sid'), + 'resolution' => Values::array_get($payload, 'resolution'), + 'sourceSid' => Values::array_get($payload, 'source_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'mediaSize' => Values::array_get($payload, 'media_size'), + 'status' => Values::array_get($payload, 'status'), + 'statusCallback' => Values::array_get($payload, 'status_callback'), + 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return MediaRecordingContext Context for this MediaRecordingInstance + */ + protected function proxy(): MediaRecordingContext + { + if (!$this->context) { + $this->context = new MediaRecordingContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the MediaRecordingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the MediaRecordingInstance + * + * @return MediaRecordingInstance Fetched MediaRecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MediaRecordingInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Media.V1.MediaRecordingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Media/V1/MediaRecordingList.php b/app/api/Twilio/Rest/Media/V1/MediaRecordingList.php new file mode 100755 index 0000000..ffc73d6 --- /dev/null +++ b/app/api/Twilio/Rest/Media/V1/MediaRecordingList.php @@ -0,0 +1,174 @@ +solution = [ + ]; + + $this->uri = '/MediaRecordings'; + } + + /** + * Reads MediaRecordingInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return MediaRecordingInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams MediaRecordingInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of MediaRecordingInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return MediaRecordingPage Page of MediaRecordingInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MediaRecordingPage + { + $options = new Values($options); + + $params = Values::of([ + 'Order' => + $options['order'], + 'Status' => + $options['status'], + 'ProcessorSid' => + $options['processorSid'], + 'SourceSid' => + $options['sourceSid'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new MediaRecordingPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of MediaRecordingInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return MediaRecordingPage Page of MediaRecordingInstance + */ + public function getPage(string $targetUrl): MediaRecordingPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new MediaRecordingPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a MediaRecordingContext + * + * @param string $sid The SID of the MediaRecording resource to delete. + */ + public function getContext( + string $sid + + ): MediaRecordingContext + { + return new MediaRecordingContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Media.V1.MediaRecordingList]'; + } +} diff --git a/app/api/Twilio/Rest/Media/V1/MediaRecordingOptions.php b/app/api/Twilio/Rest/Media/V1/MediaRecordingOptions.php new file mode 100755 index 0000000..6dcbf38 --- /dev/null +++ b/app/api/Twilio/Rest/Media/V1/MediaRecordingOptions.php @@ -0,0 +1,134 @@ +options['order'] = $order; + $this->options['status'] = $status; + $this->options['processorSid'] = $processorSid; + $this->options['sourceSid'] = $sourceSid; + } + + /** + * The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. + * + * @param string $order The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. + * @return $this Fluent Builder + */ + public function setOrder(string $order): self + { + $this->options['order'] = $order; + return $this; + } + + /** + * Status to filter by, with possible values `processing`, `completed`, `deleted`, or `failed`. + * + * @param string $status Status to filter by, with possible values `processing`, `completed`, `deleted`, or `failed`. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * SID of a MediaProcessor to filter by. + * + * @param string $processorSid SID of a MediaProcessor to filter by. + * @return $this Fluent Builder + */ + public function setProcessorSid(string $processorSid): self + { + $this->options['processorSid'] = $processorSid; + return $this; + } + + /** + * SID of a MediaRecording source to filter by. + * + * @param string $sourceSid SID of a MediaRecording source to filter by. + * @return $this Fluent Builder + */ + public function setSourceSid(string $sourceSid): self + { + $this->options['sourceSid'] = $sourceSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Media.V1.ReadMediaRecordingOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Media/V1/MediaRecordingPage.php b/app/api/Twilio/Rest/Media/V1/MediaRecordingPage.php new file mode 100755 index 0000000..338286c --- /dev/null +++ b/app/api/Twilio/Rest/Media/V1/MediaRecordingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MediaRecordingInstance \Twilio\Rest\Media\V1\MediaRecordingInstance + */ + public function buildInstance(array $payload): MediaRecordingInstance + { + return new MediaRecordingInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Media.V1.MediaRecordingPage]'; + } +} diff --git a/app/api/Twilio/Rest/Media/V1/PlayerStreamer/PlaybackGrantContext.php b/app/api/Twilio/Rest/Media/V1/PlayerStreamer/PlaybackGrantContext.php new file mode 100755 index 0000000..e4c0a30 --- /dev/null +++ b/app/api/Twilio/Rest/Media/V1/PlayerStreamer/PlaybackGrantContext.php @@ -0,0 +1,112 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/PlayerStreamers/' . \rawurlencode($sid) + .'/PlaybackGrant'; + } + + /** + * Create the PlaybackGrantInstance + * + * @param array|Options $options Optional Arguments + * @return PlaybackGrantInstance Created PlaybackGrantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): PlaybackGrantInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Ttl' => + $options['ttl'], + 'AccessControlAllowOrigin' => + $options['accessControlAllowOrigin'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new PlaybackGrantInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Fetch the PlaybackGrantInstance + * + * @return PlaybackGrantInstance Fetched PlaybackGrantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PlaybackGrantInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new PlaybackGrantInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Media.V1.PlaybackGrantContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Media/V1/PlayerStreamer/PlaybackGrantInstance.php b/app/api/Twilio/Rest/Media/V1/PlayerStreamer/PlaybackGrantInstance.php new file mode 100755 index 0000000..f0b2983 --- /dev/null +++ b/app/api/Twilio/Rest/Media/V1/PlayerStreamer/PlaybackGrantInstance.php @@ -0,0 +1,138 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'url' => Values::array_get($payload, 'url'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'grant' => Values::array_get($payload, 'grant'), + ]; + + $this->solution = ['sid' => $sid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return PlaybackGrantContext Context for this PlaybackGrantInstance + */ + protected function proxy(): PlaybackGrantContext + { + if (!$this->context) { + $this->context = new PlaybackGrantContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Create the PlaybackGrantInstance + * + * @param array|Options $options Optional Arguments + * @return PlaybackGrantInstance Created PlaybackGrantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): PlaybackGrantInstance + { + + return $this->proxy()->create($options); + } + + /** + * Fetch the PlaybackGrantInstance + * + * @return PlaybackGrantInstance Fetched PlaybackGrantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PlaybackGrantInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Media.V1.PlaybackGrantInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Media/V1/PlayerStreamer/PlaybackGrantList.php b/app/api/Twilio/Rest/Media/V1/PlayerStreamer/PlaybackGrantList.php new file mode 100755 index 0000000..97ce6f6 --- /dev/null +++ b/app/api/Twilio/Rest/Media/V1/PlayerStreamer/PlaybackGrantList.php @@ -0,0 +1,67 @@ +solution = [ + 'sid' => + $sid, + + ]; + } + + /** + * Constructs a PlaybackGrantContext + */ + public function getContext( + + ): PlaybackGrantContext + { + return new PlaybackGrantContext( + $this->version, + $this->solution['sid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Media.V1.PlaybackGrantList]'; + } +} diff --git a/app/api/Twilio/Rest/Media/V1/PlayerStreamer/PlaybackGrantOptions.php b/app/api/Twilio/Rest/Media/V1/PlayerStreamer/PlaybackGrantOptions.php new file mode 100755 index 0000000..35f6fc0 --- /dev/null +++ b/app/api/Twilio/Rest/Media/V1/PlayerStreamer/PlaybackGrantOptions.php @@ -0,0 +1,96 @@ +options['ttl'] = $ttl; + $this->options['accessControlAllowOrigin'] = $accessControlAllowOrigin; + } + + /** + * The time to live of the PlaybackGrant. Default value is 15 seconds. Maximum value is 60 seconds. + * + * @param int $ttl The time to live of the PlaybackGrant. Default value is 15 seconds. Maximum value is 60 seconds. + * @return $this Fluent Builder + */ + public function setTtl(int $ttl): self + { + $this->options['ttl'] = $ttl; + return $this; + } + + /** + * The full origin URL where the livestream can be streamed. If this is not provided, it can be streamed from any domain. + * + * @param string $accessControlAllowOrigin The full origin URL where the livestream can be streamed. If this is not provided, it can be streamed from any domain. + * @return $this Fluent Builder + */ + public function setAccessControlAllowOrigin(string $accessControlAllowOrigin): self + { + $this->options['accessControlAllowOrigin'] = $accessControlAllowOrigin; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Media.V1.CreatePlaybackGrantOptions ' . $options . ']'; + } +} + + diff --git a/app/api/Twilio/Rest/Media/V1/PlayerStreamer/PlaybackGrantPage.php b/app/api/Twilio/Rest/Media/V1/PlayerStreamer/PlaybackGrantPage.php new file mode 100755 index 0000000..78186b3 --- /dev/null +++ b/app/api/Twilio/Rest/Media/V1/PlayerStreamer/PlaybackGrantPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PlaybackGrantInstance \Twilio\Rest\Media\V1\PlayerStreamer\PlaybackGrantInstance + */ + public function buildInstance(array $payload): PlaybackGrantInstance + { + return new PlaybackGrantInstance($this->version, $payload, $this->solution['sid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Media.V1.PlaybackGrantPage]'; + } +} diff --git a/app/api/Twilio/Rest/Media/V1/PlayerStreamerContext.php b/app/api/Twilio/Rest/Media/V1/PlayerStreamerContext.php new file mode 100755 index 0000000..cb18f35 --- /dev/null +++ b/app/api/Twilio/Rest/Media/V1/PlayerStreamerContext.php @@ -0,0 +1,165 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/PlayerStreamers/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the PlayerStreamerInstance + * + * @return PlayerStreamerInstance Fetched PlayerStreamerInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PlayerStreamerInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new PlayerStreamerInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the PlayerStreamerInstance + * + * @param string $status + * @return PlayerStreamerInstance Updated PlayerStreamerInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status): PlayerStreamerInstance + { + + $data = Values::of([ + 'Status' => + $status, + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new PlayerStreamerInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the playbackGrant + */ + protected function getPlaybackGrant(): PlaybackGrantList + { + if (!$this->_playbackGrant) { + $this->_playbackGrant = new PlaybackGrantList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_playbackGrant; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Media.V1.PlayerStreamerContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Media/V1/PlayerStreamerInstance.php b/app/api/Twilio/Rest/Media/V1/PlayerStreamerInstance.php new file mode 100755 index 0000000..d0a515b --- /dev/null +++ b/app/api/Twilio/Rest/Media/V1/PlayerStreamerInstance.php @@ -0,0 +1,162 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'video' => Values::array_get($payload, 'video'), + 'links' => Values::array_get($payload, 'links'), + 'sid' => Values::array_get($payload, 'sid'), + 'status' => Values::array_get($payload, 'status'), + 'url' => Values::array_get($payload, 'url'), + 'statusCallback' => Values::array_get($payload, 'status_callback'), + 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), + 'endedReason' => Values::array_get($payload, 'ended_reason'), + 'maxDuration' => Values::array_get($payload, 'max_duration'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return PlayerStreamerContext Context for this PlayerStreamerInstance + */ + protected function proxy(): PlayerStreamerContext + { + if (!$this->context) { + $this->context = new PlayerStreamerContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the PlayerStreamerInstance + * + * @return PlayerStreamerInstance Fetched PlayerStreamerInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PlayerStreamerInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the PlayerStreamerInstance + * + * @param string $status + * @return PlayerStreamerInstance Updated PlayerStreamerInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status): PlayerStreamerInstance + { + + return $this->proxy()->update($status); + } + + /** + * Access the playbackGrant + */ + protected function getPlaybackGrant(): PlaybackGrantList + { + return $this->proxy()->playbackGrant; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Media.V1.PlayerStreamerInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Media/V1/PlayerStreamerList.php b/app/api/Twilio/Rest/Media/V1/PlayerStreamerList.php new file mode 100755 index 0000000..92b34fa --- /dev/null +++ b/app/api/Twilio/Rest/Media/V1/PlayerStreamerList.php @@ -0,0 +1,204 @@ +solution = [ + ]; + + $this->uri = '/PlayerStreamers'; + } + + /** + * Create the PlayerStreamerInstance + * + * @param array|Options $options Optional Arguments + * @return PlayerStreamerInstance Created PlayerStreamerInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): PlayerStreamerInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Video' => + Serialize::booleanToString($options['video']), + 'StatusCallback' => + $options['statusCallback'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'MaxDuration' => + $options['maxDuration'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new PlayerStreamerInstance( + $this->version, + $payload + ); + } + + + /** + * Reads PlayerStreamerInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return PlayerStreamerInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams PlayerStreamerInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of PlayerStreamerInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return PlayerStreamerPage Page of PlayerStreamerInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): PlayerStreamerPage + { + $options = new Values($options); + + $params = Values::of([ + 'Order' => + $options['order'], + 'Status' => + $options['status'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new PlayerStreamerPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of PlayerStreamerInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return PlayerStreamerPage Page of PlayerStreamerInstance + */ + public function getPage(string $targetUrl): PlayerStreamerPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new PlayerStreamerPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a PlayerStreamerContext + * + * @param string $sid The SID of the PlayerStreamer resource to fetch. + */ + public function getContext( + string $sid + + ): PlayerStreamerContext + { + return new PlayerStreamerContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Media.V1.PlayerStreamerList]'; + } +} diff --git a/app/api/Twilio/Rest/Media/V1/PlayerStreamerOptions.php b/app/api/Twilio/Rest/Media/V1/PlayerStreamerOptions.php new file mode 100755 index 0000000..0348334 --- /dev/null +++ b/app/api/Twilio/Rest/Media/V1/PlayerStreamerOptions.php @@ -0,0 +1,204 @@ +options['video'] = $video; + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['maxDuration'] = $maxDuration; + } + + /** + * Specifies whether the PlayerStreamer is configured to stream video. Defaults to `true`. + * + * @param bool $video Specifies whether the PlayerStreamer is configured to stream video. Defaults to `true`. + * @return $this Fluent Builder + */ + public function setVideo(bool $video): self + { + $this->options['video'] = $video; + return $this; + } + + /** + * The URL to which Twilio will send asynchronous webhook requests for every PlayerStreamer event. See [Status Callbacks](/docs/live/status-callbacks) for more details. + * + * @param string $statusCallback The URL to which Twilio will send asynchronous webhook requests for every PlayerStreamer event. See [Status Callbacks](/docs/live/status-callbacks) for more details. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The HTTP method Twilio should use to call the `status_callback` URL. Can be `POST` or `GET` and the default is `POST`. + * + * @param string $statusCallbackMethod The HTTP method Twilio should use to call the `status_callback` URL. Can be `POST` or `GET` and the default is `POST`. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * The maximum time, in seconds, that the PlayerStreamer is active (`created` or `started`) before automatically ends. The default value is 300 seconds, and the maximum value is 90000 seconds. Once this maximum duration is reached, Twilio will end the PlayerStreamer, regardless of whether media is still streaming. + * + * @param int $maxDuration The maximum time, in seconds, that the PlayerStreamer is active (`created` or `started`) before automatically ends. The default value is 300 seconds, and the maximum value is 90000 seconds. Once this maximum duration is reached, Twilio will end the PlayerStreamer, regardless of whether media is still streaming. + * @return $this Fluent Builder + */ + public function setMaxDuration(int $maxDuration): self + { + $this->options['maxDuration'] = $maxDuration; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Media.V1.CreatePlayerStreamerOptions ' . $options . ']'; + } +} + + +class ReadPlayerStreamerOptions extends Options + { + /** + * @param string $order The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. + * @param string $status Status to filter by, with possible values `created`, `started`, `ended`, or `failed`. + */ + public function __construct( + + string $order = Values::NONE, + string $status = Values::NONE + + ) { + $this->options['order'] = $order; + $this->options['status'] = $status; + } + + /** + * The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. + * + * @param string $order The sort order of the list by `date_created`. Can be: `asc` (ascending) or `desc` (descending) with `desc` as the default. + * @return $this Fluent Builder + */ + public function setOrder(string $order): self + { + $this->options['order'] = $order; + return $this; + } + + /** + * Status to filter by, with possible values `created`, `started`, `ended`, or `failed`. + * + * @param string $status Status to filter by, with possible values `created`, `started`, `ended`, or `failed`. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Media.V1.ReadPlayerStreamerOptions ' . $options . ']'; + } +} + + diff --git a/app/api/Twilio/Rest/Media/V1/PlayerStreamerPage.php b/app/api/Twilio/Rest/Media/V1/PlayerStreamerPage.php new file mode 100755 index 0000000..76cdc6a --- /dev/null +++ b/app/api/Twilio/Rest/Media/V1/PlayerStreamerPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PlayerStreamerInstance \Twilio\Rest\Media\V1\PlayerStreamerInstance + */ + public function buildInstance(array $payload): PlayerStreamerInstance + { + return new PlayerStreamerInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Media.V1.PlayerStreamerPage]'; + } +} diff --git a/app/api/Twilio/Rest/MediaBase.php b/app/api/Twilio/Rest/MediaBase.php new file mode 100755 index 0000000..00b0c3c --- /dev/null +++ b/app/api/Twilio/Rest/MediaBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://media.twilio.com'; + } + + + /** + * @return V1 Version v1 of media + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Media]'; + } +} diff --git a/app/api/Twilio/Rest/Messaging.php b/app/api/Twilio/Rest/Messaging.php new file mode 100755 index 0000000..5d14e38 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging.php @@ -0,0 +1,126 @@ +brandRegistrations instead."; + return $this->v1->brandRegistrations; + } + + /** + * @deprecated + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextBrandRegistrations(string $sid): \Twilio\Rest\Messaging\V1\BrandRegistrationContext { + echo "brandRegistrations(\$sid) is deprecated. Use v1->brandRegistrations(\$sid) instead."; + return $this->v1->brandRegistrations($sid); + } + + /** + * @deprecated + */ + protected function getDeactivations(): \Twilio\Rest\Messaging\V1\DeactivationsList { + echo "deactivations is deprecated. Use v1->deactivations instead."; + return $this->v1->deactivations; + } + + /** + * @deprecated Use v1->deactivations() instead. + */ + protected function contextDeactivations(): \Twilio\Rest\Messaging\V1\DeactivationsContext { + echo "deactivations() is deprecated. Use v1->deactivations() instead."; + return $this->v1->deactivations(); + } + + /** + * @deprecated Use v1->domainCerts instead. + */ + protected function getDomainCerts(): \Twilio\Rest\Messaging\V1\DomainCertsList { + echo "domainCerts is deprecated. Use v1->domainCerts instead."; + return $this->v1->domainCerts; + } + + /** + * @deprecated Use v1->domainCerts(\$domainSid) instead. + * @param string $domainSid Unique string used to identify the domain that this + * certificate should be associated with. + */ + protected function contextDomainCerts(string $domainSid): \Twilio\Rest\Messaging\V1\DomainCertsContext { + echo "domainCerts(\$domainSid) is deprecated. Use v1->domainCerts(\$domainSid) instead."; + return $this->v1->domainCerts($domainSid); + } + + /** + * @deprecated Use v1->domainConfig instead. + */ + protected function getDomainConfig(): \Twilio\Rest\Messaging\V1\DomainConfigList { + echo "domainConfig is deprecated. Use v1->domainConfig instead."; + return $this->v1->domainConfig; + } + + /** + * @deprecated Use v1->domainConfig(\$domainSid) instead. + * @param string $domainSid Unique string used to identify the domain that this + * config should be associated with. + */ + protected function contextDomainConfig(string $domainSid): \Twilio\Rest\Messaging\V1\DomainConfigContext { + echo "domainConfig(\$domainSid) is deprecated. Use v1->domainConfig(\$domainSid) instead."; + return $this->v1->domainConfig($domainSid); + } + + /** + * @deprecated Use v1->externalCampaign instead. + */ + protected function getExternalCampaign(): \Twilio\Rest\Messaging\V1\ExternalCampaignList { + echo "externalCampaign is deprecated. Use v1->externalCampaign instead."; + return $this->v1->externalCampaign; + } + + /** + * @deprecated Use v1->services instead. + */ + protected function getServices(): \Twilio\Rest\Messaging\V1\ServiceList { + echo "services is deprecated. Use v1->services instead."; + return $this->v1->services; + } + + /** + * @deprecated Use v1->services(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextServices(string $sid): \Twilio\Rest\Messaging\V1\ServiceContext { + echo "services(\$sid) is deprecated. Use v1->services(\$sid) instead."; + return $this->v1->services($sid); + } + + /** + * @deprecated Use v1->tollfreeVerifications instead. + */ + protected function getTollfreeVerifications(): \Twilio\Rest\Messaging\V1\TollfreeVerificationList { + echo "tollfreeVerifications is deprecated. Use v1->tollfreeVerifications instead."; + return $this->v1->tollfreeVerifications; + } + + /** + * @deprecated Use v1->tollfreeVerifications(\$sid) instead. + * @param string $sid Tollfree Verification Sid + */ + protected function contextTollfreeVerifications(string $sid): \Twilio\Rest\Messaging\V1\TollfreeVerificationContext { + echo "tollfreeVerifications(\$sid) is deprecated. Use v1->tollfreeVerifications(\$sid) instead."; + return $this->v1->tollfreeVerifications($sid); + } + + /** + * @deprecated Use v1->usecases instead. + */ + protected function getUsecases(): \Twilio\Rest\Messaging\V1\UsecaseList { + echo "usecases is deprecated. Use v1->usecases instead."; + return $this->v1->usecases; + } +} \ No newline at end of file diff --git a/app/api/Twilio/Rest/Messaging/V1.php b/app/api/Twilio/Rest/Messaging/V1.php new file mode 100755 index 0000000..3537242 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1.php @@ -0,0 +1,197 @@ +version = 'v1'; + } + + protected function getBrandRegistrations(): BrandRegistrationList + { + if (!$this->_brandRegistrations) { + $this->_brandRegistrations = new BrandRegistrationList($this); + } + return $this->_brandRegistrations; + } + + protected function getDeactivations(): DeactivationsList + { + if (!$this->_deactivations) { + $this->_deactivations = new DeactivationsList($this); + } + return $this->_deactivations; + } + + protected function getDomainCerts(): DomainCertsList + { + if (!$this->_domainCerts) { + $this->_domainCerts = new DomainCertsList($this); + } + return $this->_domainCerts; + } + + protected function getDomainConfig(): DomainConfigList + { + if (!$this->_domainConfig) { + $this->_domainConfig = new DomainConfigList($this); + } + return $this->_domainConfig; + } + + protected function getDomainConfigMessagingService(): DomainConfigMessagingServiceList + { + if (!$this->_domainConfigMessagingService) { + $this->_domainConfigMessagingService = new DomainConfigMessagingServiceList($this); + } + return $this->_domainConfigMessagingService; + } + + protected function getExternalCampaign(): ExternalCampaignList + { + if (!$this->_externalCampaign) { + $this->_externalCampaign = new ExternalCampaignList($this); + } + return $this->_externalCampaign; + } + + protected function getLinkshorteningMessagingService(): LinkshorteningMessagingServiceList + { + if (!$this->_linkshorteningMessagingService) { + $this->_linkshorteningMessagingService = new LinkshorteningMessagingServiceList($this); + } + return $this->_linkshorteningMessagingService; + } + + protected function getServices(): ServiceList + { + if (!$this->_services) { + $this->_services = new ServiceList($this); + } + return $this->_services; + } + + protected function getTollfreeVerifications(): TollfreeVerificationList + { + if (!$this->_tollfreeVerifications) { + $this->_tollfreeVerifications = new TollfreeVerificationList($this); + } + return $this->_tollfreeVerifications; + } + + protected function getUsecases(): UsecaseList + { + if (!$this->_usecases) { + $this->_usecases = new UsecaseList($this); + } + return $this->_usecases; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1]'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/BrandRegistration/BrandRegistrationOtpInstance.php b/app/api/Twilio/Rest/Messaging/V1/BrandRegistration/BrandRegistrationOtpInstance.php new file mode 100755 index 0000000..c51ea30 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/BrandRegistration/BrandRegistrationOtpInstance.php @@ -0,0 +1,83 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'brandRegistrationSid' => Values::array_get($payload, 'brand_registration_sid'), + ]; + + $this->solution = ['brandRegistrationSid' => $brandRegistrationSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.BrandRegistrationOtpInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Messaging/V1/BrandRegistration/BrandRegistrationOtpList.php b/app/api/Twilio/Rest/Messaging/V1/BrandRegistration/BrandRegistrationOtpList.php new file mode 100755 index 0000000..71f95ac --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/BrandRegistration/BrandRegistrationOtpList.php @@ -0,0 +1,77 @@ +solution = [ + 'brandRegistrationSid' => + $brandRegistrationSid, + + ]; + + $this->uri = '/a2p/BrandRegistrations/' . \rawurlencode($brandRegistrationSid) + .'/SmsOtp'; + } + + /** + * Create the BrandRegistrationOtpInstance + * + * @return BrandRegistrationOtpInstance Created BrandRegistrationOtpInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(): BrandRegistrationOtpInstance + { + + $payload = $this->version->create('POST', $this->uri); + + return new BrandRegistrationOtpInstance( + $this->version, + $payload, + $this->solution['brandRegistrationSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.BrandRegistrationOtpList]'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/BrandRegistration/BrandRegistrationOtpPage.php b/app/api/Twilio/Rest/Messaging/V1/BrandRegistration/BrandRegistrationOtpPage.php new file mode 100755 index 0000000..00c495b --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/BrandRegistration/BrandRegistrationOtpPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return BrandRegistrationOtpInstance \Twilio\Rest\Messaging\V1\BrandRegistration\BrandRegistrationOtpInstance + */ + public function buildInstance(array $payload): BrandRegistrationOtpInstance + { + return new BrandRegistrationOtpInstance($this->version, $payload, $this->solution['brandRegistrationSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.BrandRegistrationOtpPage]'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingContext.php b/app/api/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingContext.php new file mode 100755 index 0000000..41794e3 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingContext.php @@ -0,0 +1,87 @@ +solution = [ + 'brandSid' => + $brandSid, + 'brandVettingSid' => + $brandVettingSid, + ]; + + $this->uri = '/a2p/BrandRegistrations/' . \rawurlencode($brandSid) + .'/Vettings/' . \rawurlencode($brandVettingSid) + .''; + } + + /** + * Fetch the BrandVettingInstance + * + * @return BrandVettingInstance Fetched BrandVettingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BrandVettingInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new BrandVettingInstance( + $this->version, + $payload, + $this->solution['brandSid'], + $this->solution['brandVettingSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.BrandVettingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingInstance.php b/app/api/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingInstance.php new file mode 100755 index 0000000..a1ab914 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingInstance.php @@ -0,0 +1,136 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'brandSid' => Values::array_get($payload, 'brand_sid'), + 'brandVettingSid' => Values::array_get($payload, 'brand_vetting_sid'), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'vettingId' => Values::array_get($payload, 'vetting_id'), + 'vettingClass' => Values::array_get($payload, 'vetting_class'), + 'vettingStatus' => Values::array_get($payload, 'vetting_status'), + 'vettingProvider' => Values::array_get($payload, 'vetting_provider'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['brandSid' => $brandSid, 'brandVettingSid' => $brandVettingSid ?: $this->properties['brandVettingSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return BrandVettingContext Context for this BrandVettingInstance + */ + protected function proxy(): BrandVettingContext + { + if (!$this->context) { + $this->context = new BrandVettingContext( + $this->version, + $this->solution['brandSid'], + $this->solution['brandVettingSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the BrandVettingInstance + * + * @return BrandVettingInstance Fetched BrandVettingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BrandVettingInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.BrandVettingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingList.php b/app/api/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingList.php new file mode 100755 index 0000000..b323f7d --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingList.php @@ -0,0 +1,206 @@ +solution = [ + 'brandSid' => + $brandSid, + + ]; + + $this->uri = '/a2p/BrandRegistrations/' . \rawurlencode($brandSid) + .'/Vettings'; + } + + /** + * Create the BrandVettingInstance + * + * @param string $vettingProvider + * @param array|Options $options Optional Arguments + * @return BrandVettingInstance Created BrandVettingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $vettingProvider, array $options = []): BrandVettingInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'VettingProvider' => + $vettingProvider, + 'VettingId' => + $options['vettingId'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new BrandVettingInstance( + $this->version, + $payload, + $this->solution['brandSid'] + ); + } + + + /** + * Reads BrandVettingInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return BrandVettingInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams BrandVettingInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of BrandVettingInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return BrandVettingPage Page of BrandVettingInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): BrandVettingPage + { + $options = new Values($options); + + $params = Values::of([ + 'VettingProvider' => + $options['vettingProvider'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new BrandVettingPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of BrandVettingInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return BrandVettingPage Page of BrandVettingInstance + */ + public function getPage(string $targetUrl): BrandVettingPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new BrandVettingPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a BrandVettingContext + * + * @param string $brandVettingSid The Twilio SID of the third-party vetting record. + */ + public function getContext( + string $brandVettingSid + + ): BrandVettingContext + { + return new BrandVettingContext( + $this->version, + $this->solution['brandSid'], + $brandVettingSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.BrandVettingList]'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingOptions.php b/app/api/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingOptions.php new file mode 100755 index 0000000..405f9b6 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingOptions.php @@ -0,0 +1,130 @@ +options['vettingId'] = $vettingId; + } + + /** + * The unique ID of the vetting + * + * @param string $vettingId The unique ID of the vetting + * @return $this Fluent Builder + */ + public function setVettingId(string $vettingId): self + { + $this->options['vettingId'] = $vettingId; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Messaging.V1.CreateBrandVettingOptions ' . $options . ']'; + } +} + + +class ReadBrandVettingOptions extends Options + { + /** + * @param string $vettingProvider The third-party provider of the vettings to read + */ + public function __construct( + + string $vettingProvider = Values::NONE + + ) { + $this->options['vettingProvider'] = $vettingProvider; + } + + /** + * The third-party provider of the vettings to read + * + * @param string $vettingProvider The third-party provider of the vettings to read + * @return $this Fluent Builder + */ + public function setVettingProvider(string $vettingProvider): self + { + $this->options['vettingProvider'] = $vettingProvider; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Messaging.V1.ReadBrandVettingOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingPage.php b/app/api/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingPage.php new file mode 100755 index 0000000..aafad15 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/BrandRegistration/BrandVettingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return BrandVettingInstance \Twilio\Rest\Messaging\V1\BrandRegistration\BrandVettingInstance + */ + public function buildInstance(array $payload): BrandVettingInstance + { + return new BrandVettingInstance($this->version, $payload, $this->solution['brandSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.BrandVettingPage]'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/BrandRegistrationContext.php b/app/api/Twilio/Rest/Messaging/V1/BrandRegistrationContext.php new file mode 100755 index 0000000..d016a66 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/BrandRegistrationContext.php @@ -0,0 +1,176 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/a2p/BrandRegistrations/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the BrandRegistrationInstance + * + * @return BrandRegistrationInstance Fetched BrandRegistrationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BrandRegistrationInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new BrandRegistrationInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the BrandRegistrationInstance + * + * @return BrandRegistrationInstance Updated BrandRegistrationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(): BrandRegistrationInstance + { + + $payload = $this->version->update('POST', $this->uri); + + return new BrandRegistrationInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the brandRegistrationOtps + */ + protected function getBrandRegistrationOtps(): BrandRegistrationOtpList + { + if (!$this->_brandRegistrationOtps) { + $this->_brandRegistrationOtps = new BrandRegistrationOtpList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_brandRegistrationOtps; + } + + /** + * Access the brandVettings + */ + protected function getBrandVettings(): BrandVettingList + { + if (!$this->_brandVettings) { + $this->_brandVettings = new BrandVettingList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_brandVettings; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.BrandRegistrationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/BrandRegistrationInstance.php b/app/api/Twilio/Rest/Messaging/V1/BrandRegistrationInstance.php new file mode 100755 index 0000000..f42b472 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/BrandRegistrationInstance.php @@ -0,0 +1,187 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'customerProfileBundleSid' => Values::array_get($payload, 'customer_profile_bundle_sid'), + 'a2PProfileBundleSid' => Values::array_get($payload, 'a2p_profile_bundle_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'brandType' => Values::array_get($payload, 'brand_type'), + 'status' => Values::array_get($payload, 'status'), + 'tcrId' => Values::array_get($payload, 'tcr_id'), + 'failureReason' => Values::array_get($payload, 'failure_reason'), + 'url' => Values::array_get($payload, 'url'), + 'brandScore' => Values::array_get($payload, 'brand_score'), + 'brandFeedback' => Values::array_get($payload, 'brand_feedback'), + 'identityStatus' => Values::array_get($payload, 'identity_status'), + 'russell3000' => Values::array_get($payload, 'russell_3000'), + 'governmentEntity' => Values::array_get($payload, 'government_entity'), + 'taxExemptStatus' => Values::array_get($payload, 'tax_exempt_status'), + 'skipAutomaticSecVet' => Values::array_get($payload, 'skip_automatic_sec_vet'), + 'mock' => Values::array_get($payload, 'mock'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return BrandRegistrationContext Context for this BrandRegistrationInstance + */ + protected function proxy(): BrandRegistrationContext + { + if (!$this->context) { + $this->context = new BrandRegistrationContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the BrandRegistrationInstance + * + * @return BrandRegistrationInstance Fetched BrandRegistrationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BrandRegistrationInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the BrandRegistrationInstance + * + * @return BrandRegistrationInstance Updated BrandRegistrationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(): BrandRegistrationInstance + { + + return $this->proxy()->update(); + } + + /** + * Access the brandRegistrationOtps + */ + protected function getBrandRegistrationOtps(): BrandRegistrationOtpList + { + return $this->proxy()->brandRegistrationOtps; + } + + /** + * Access the brandVettings + */ + protected function getBrandVettings(): BrandVettingList + { + return $this->proxy()->brandVettings; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.BrandRegistrationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Messaging/V1/BrandRegistrationList.php b/app/api/Twilio/Rest/Messaging/V1/BrandRegistrationList.php new file mode 100755 index 0000000..fa7f720 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/BrandRegistrationList.php @@ -0,0 +1,200 @@ +solution = [ + ]; + + $this->uri = '/a2p/BrandRegistrations'; + } + + /** + * Create the BrandRegistrationInstance + * + * @param string $customerProfileBundleSid Customer Profile Bundle Sid. + * @param string $a2PProfileBundleSid A2P Messaging Profile Bundle Sid. + * @param array|Options $options Optional Arguments + * @return BrandRegistrationInstance Created BrandRegistrationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $customerProfileBundleSid, string $a2PProfileBundleSid, array $options = []): BrandRegistrationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'CustomerProfileBundleSid' => + $customerProfileBundleSid, + 'A2PProfileBundleSid' => + $a2PProfileBundleSid, + 'BrandType' => + $options['brandType'], + 'Mock' => + Serialize::booleanToString($options['mock']), + 'SkipAutomaticSecVet' => + Serialize::booleanToString($options['skipAutomaticSecVet']), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new BrandRegistrationInstance( + $this->version, + $payload + ); + } + + + /** + * Reads BrandRegistrationInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return BrandRegistrationInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams BrandRegistrationInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of BrandRegistrationInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return BrandRegistrationPage Page of BrandRegistrationInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): BrandRegistrationPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new BrandRegistrationPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of BrandRegistrationInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return BrandRegistrationPage Page of BrandRegistrationInstance + */ + public function getPage(string $targetUrl): BrandRegistrationPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new BrandRegistrationPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a BrandRegistrationContext + * + * @param string $sid The SID of the Brand Registration resource to fetch. + */ + public function getContext( + string $sid + + ): BrandRegistrationContext + { + return new BrandRegistrationContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.BrandRegistrationList]'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/BrandRegistrationOptions.php b/app/api/Twilio/Rest/Messaging/V1/BrandRegistrationOptions.php new file mode 100755 index 0000000..6981621 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/BrandRegistrationOptions.php @@ -0,0 +1,118 @@ +options['brandType'] = $brandType; + $this->options['mock'] = $mock; + $this->options['skipAutomaticSecVet'] = $skipAutomaticSecVet; + } + + /** + * Type of brand being created. One of: \\\"STANDARD\\\", \\\"SOLE_PROPRIETOR\\\". SOLE_PROPRIETOR is for low volume, SOLE_PROPRIETOR use cases. STANDARD is for all other use cases. + * + * @param string $brandType Type of brand being created. One of: \\\"STANDARD\\\", \\\"SOLE_PROPRIETOR\\\". SOLE_PROPRIETOR is for low volume, SOLE_PROPRIETOR use cases. STANDARD is for all other use cases. + * @return $this Fluent Builder + */ + public function setBrandType(string $brandType): self + { + $this->options['brandType'] = $brandType; + return $this; + } + + /** + * A boolean that specifies whether brand should be a mock or not. If true, brand will be registered as a mock brand. Defaults to false if no value is provided. + * + * @param bool $mock A boolean that specifies whether brand should be a mock or not. If true, brand will be registered as a mock brand. Defaults to false if no value is provided. + * @return $this Fluent Builder + */ + public function setMock(bool $mock): self + { + $this->options['mock'] = $mock; + return $this; + } + + /** + * A flag to disable automatic secondary vetting for brands which it would otherwise be done. + * + * @param bool $skipAutomaticSecVet A flag to disable automatic secondary vetting for brands which it would otherwise be done. + * @return $this Fluent Builder + */ + public function setSkipAutomaticSecVet(bool $skipAutomaticSecVet): self + { + $this->options['skipAutomaticSecVet'] = $skipAutomaticSecVet; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Messaging.V1.CreateBrandRegistrationOptions ' . $options . ']'; + } +} + + + + diff --git a/app/api/Twilio/Rest/Messaging/V1/BrandRegistrationPage.php b/app/api/Twilio/Rest/Messaging/V1/BrandRegistrationPage.php new file mode 100755 index 0000000..ad731ea --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/BrandRegistrationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return BrandRegistrationInstance \Twilio\Rest\Messaging\V1\BrandRegistrationInstance + */ + public function buildInstance(array $payload): BrandRegistrationInstance + { + return new BrandRegistrationInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.BrandRegistrationPage]'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/DeactivationsContext.php b/app/api/Twilio/Rest/Messaging/V1/DeactivationsContext.php new file mode 100755 index 0000000..d96639d --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/DeactivationsContext.php @@ -0,0 +1,86 @@ +solution = [ + ]; + + $this->uri = '/Deactivations'; + } + + /** + * Fetch the DeactivationsInstance + * + * @param array|Options $options Optional Arguments + * @return DeactivationsInstance Fetched DeactivationsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): DeactivationsInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'Date' => + Serialize::iso8601Date($options['date']), + ]); + + $payload = $this->version->fetch('GET', $this->uri, $params); + + return new DeactivationsInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.DeactivationsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/DeactivationsInstance.php b/app/api/Twilio/Rest/Messaging/V1/DeactivationsInstance.php new file mode 100755 index 0000000..67e3ebe --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/DeactivationsInstance.php @@ -0,0 +1,115 @@ +properties = [ + 'redirectTo' => Values::array_get($payload, 'redirect_to'), + ]; + + $this->solution = []; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return DeactivationsContext Context for this DeactivationsInstance + */ + protected function proxy(): DeactivationsContext + { + if (!$this->context) { + $this->context = new DeactivationsContext( + $this->version + ); + } + + return $this->context; + } + + /** + * Fetch the DeactivationsInstance + * + * @param array|Options $options Optional Arguments + * @return DeactivationsInstance Fetched DeactivationsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): DeactivationsInstance + { + + return $this->proxy()->fetch($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.DeactivationsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Messaging/V1/DeactivationsList.php b/app/api/Twilio/Rest/Messaging/V1/DeactivationsList.php new file mode 100755 index 0000000..f7d8cf3 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/DeactivationsList.php @@ -0,0 +1,61 @@ +solution = [ + ]; + } + + /** + * Constructs a DeactivationsContext + */ + public function getContext( + + ): DeactivationsContext + { + return new DeactivationsContext( + $this->version + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.DeactivationsList]'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/DeactivationsOptions.php b/app/api/Twilio/Rest/Messaging/V1/DeactivationsOptions.php new file mode 100755 index 0000000..e4343d8 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/DeactivationsOptions.php @@ -0,0 +1,76 @@ +options['date'] = $date; + } + + /** + * The request will return a list of all United States Phone Numbers that were deactivated on the day specified by this parameter. This date should be specified in YYYY-MM-DD format. + * + * @param \DateTime $date The request will return a list of all United States Phone Numbers that were deactivated on the day specified by this parameter. This date should be specified in YYYY-MM-DD format. + * @return $this Fluent Builder + */ + public function setDate(\DateTime $date): self + { + $this->options['date'] = $date; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Messaging.V1.FetchDeactivationsOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Messaging/V1/DeactivationsPage.php b/app/api/Twilio/Rest/Messaging/V1/DeactivationsPage.php new file mode 100755 index 0000000..9b28de3 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/DeactivationsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DeactivationsInstance \Twilio\Rest\Messaging\V1\DeactivationsInstance + */ + public function buildInstance(array $payload): DeactivationsInstance + { + return new DeactivationsInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.DeactivationsPage]'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/DomainCertsContext.php b/app/api/Twilio/Rest/Messaging/V1/DomainCertsContext.php new file mode 100755 index 0000000..867499d --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/DomainCertsContext.php @@ -0,0 +1,120 @@ +solution = [ + 'domainSid' => + $domainSid, + ]; + + $this->uri = '/LinkShortening/Domains/' . \rawurlencode($domainSid) + .'/Certificate'; + } + + /** + * Delete the DomainCertsInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the DomainCertsInstance + * + * @return DomainCertsInstance Fetched DomainCertsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DomainCertsInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new DomainCertsInstance( + $this->version, + $payload, + $this->solution['domainSid'] + ); + } + + + /** + * Update the DomainCertsInstance + * + * @param string $tlsCert Contains the full TLS certificate and private for this domain in PEM format: https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail. Twilio uses this information to process HTTPS traffic sent to your domain. + * @return DomainCertsInstance Updated DomainCertsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $tlsCert): DomainCertsInstance + { + + $data = Values::of([ + 'TlsCert' => + $tlsCert, + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new DomainCertsInstance( + $this->version, + $payload, + $this->solution['domainSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.DomainCertsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/DomainCertsInstance.php b/app/api/Twilio/Rest/Messaging/V1/DomainCertsInstance.php new file mode 100755 index 0000000..a50e9d8 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/DomainCertsInstance.php @@ -0,0 +1,155 @@ +properties = [ + 'domainSid' => Values::array_get($payload, 'domain_sid'), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'dateExpires' => Deserialize::dateTime(Values::array_get($payload, 'date_expires')), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'domainName' => Values::array_get($payload, 'domain_name'), + 'certificateSid' => Values::array_get($payload, 'certificate_sid'), + 'url' => Values::array_get($payload, 'url'), + 'certInValidation' => Values::array_get($payload, 'cert_in_validation'), + ]; + + $this->solution = ['domainSid' => $domainSid ?: $this->properties['domainSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return DomainCertsContext Context for this DomainCertsInstance + */ + protected function proxy(): DomainCertsContext + { + if (!$this->context) { + $this->context = new DomainCertsContext( + $this->version, + $this->solution['domainSid'] + ); + } + + return $this->context; + } + + /** + * Delete the DomainCertsInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the DomainCertsInstance + * + * @return DomainCertsInstance Fetched DomainCertsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DomainCertsInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the DomainCertsInstance + * + * @param string $tlsCert Contains the full TLS certificate and private for this domain in PEM format: https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail. Twilio uses this information to process HTTPS traffic sent to your domain. + * @return DomainCertsInstance Updated DomainCertsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $tlsCert): DomainCertsInstance + { + + return $this->proxy()->update($tlsCert); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.DomainCertsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Messaging/V1/DomainCertsList.php b/app/api/Twilio/Rest/Messaging/V1/DomainCertsList.php new file mode 100755 index 0000000..1f98176 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/DomainCertsList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a DomainCertsContext + * + * @param string $domainSid Unique string used to identify the domain that this certificate should be associated with. + */ + public function getContext( + string $domainSid + + ): DomainCertsContext + { + return new DomainCertsContext( + $this->version, + $domainSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.DomainCertsList]'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/DomainCertsPage.php b/app/api/Twilio/Rest/Messaging/V1/DomainCertsPage.php new file mode 100755 index 0000000..1593c04 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/DomainCertsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DomainCertsInstance \Twilio\Rest\Messaging\V1\DomainCertsInstance + */ + public function buildInstance(array $payload): DomainCertsInstance + { + return new DomainCertsInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.DomainCertsPage]'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/DomainConfigContext.php b/app/api/Twilio/Rest/Messaging/V1/DomainConfigContext.php new file mode 100755 index 0000000..59bce36 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/DomainConfigContext.php @@ -0,0 +1,118 @@ +solution = [ + 'domainSid' => + $domainSid, + ]; + + $this->uri = '/LinkShortening/Domains/' . \rawurlencode($domainSid) + .'/Config'; + } + + /** + * Fetch the DomainConfigInstance + * + * @return DomainConfigInstance Fetched DomainConfigInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DomainConfigInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new DomainConfigInstance( + $this->version, + $payload, + $this->solution['domainSid'] + ); + } + + + /** + * Update the DomainConfigInstance + * + * @param string[] $messagingServiceSids A list of messagingServiceSids (with prefix MG) + * @param array|Options $options Optional Arguments + * @return DomainConfigInstance Updated DomainConfigInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $messagingServiceSids, array $options = []): DomainConfigInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'MessagingServiceSids' => + Serialize::map($messagingServiceSids,function ($e) { return $e; }), + 'FallbackUrl' => + $options['fallbackUrl'], + 'CallbackUrl' => + $options['callbackUrl'], + 'MessagingServiceSidsAction' => + $options['messagingServiceSidsAction'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new DomainConfigInstance( + $this->version, + $payload, + $this->solution['domainSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.DomainConfigContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/DomainConfigInstance.php b/app/api/Twilio/Rest/Messaging/V1/DomainConfigInstance.php new file mode 100755 index 0000000..46526a4 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/DomainConfigInstance.php @@ -0,0 +1,145 @@ +properties = [ + 'domainSid' => Values::array_get($payload, 'domain_sid'), + 'configSid' => Values::array_get($payload, 'config_sid'), + 'messagingServiceSids' => Values::array_get($payload, 'messaging_service_sids'), + 'fallbackUrl' => Values::array_get($payload, 'fallback_url'), + 'callbackUrl' => Values::array_get($payload, 'callback_url'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['domainSid' => $domainSid ?: $this->properties['domainSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return DomainConfigContext Context for this DomainConfigInstance + */ + protected function proxy(): DomainConfigContext + { + if (!$this->context) { + $this->context = new DomainConfigContext( + $this->version, + $this->solution['domainSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the DomainConfigInstance + * + * @return DomainConfigInstance Fetched DomainConfigInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DomainConfigInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the DomainConfigInstance + * + * @param string[] $messagingServiceSids A list of messagingServiceSids (with prefix MG) + * @param array|Options $options Optional Arguments + * @return DomainConfigInstance Updated DomainConfigInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $messagingServiceSids, array $options = []): DomainConfigInstance + { + + return $this->proxy()->update($messagingServiceSids, $options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.DomainConfigInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Messaging/V1/DomainConfigList.php b/app/api/Twilio/Rest/Messaging/V1/DomainConfigList.php new file mode 100755 index 0000000..78f17a1 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/DomainConfigList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a DomainConfigContext + * + * @param string $domainSid Unique string used to identify the domain that this config should be associated with. + */ + public function getContext( + string $domainSid + + ): DomainConfigContext + { + return new DomainConfigContext( + $this->version, + $domainSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.DomainConfigList]'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/DomainConfigMessagingServiceContext.php b/app/api/Twilio/Rest/Messaging/V1/DomainConfigMessagingServiceContext.php new file mode 100755 index 0000000..0727c15 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/DomainConfigMessagingServiceContext.php @@ -0,0 +1,81 @@ +solution = [ + 'messagingServiceSid' => + $messagingServiceSid, + ]; + + $this->uri = '/LinkShortening/MessagingService/' . \rawurlencode($messagingServiceSid) + .'/DomainConfig'; + } + + /** + * Fetch the DomainConfigMessagingServiceInstance + * + * @return DomainConfigMessagingServiceInstance Fetched DomainConfigMessagingServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DomainConfigMessagingServiceInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new DomainConfigMessagingServiceInstance( + $this->version, + $payload, + $this->solution['messagingServiceSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.DomainConfigMessagingServiceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/DomainConfigMessagingServiceInstance.php b/app/api/Twilio/Rest/Messaging/V1/DomainConfigMessagingServiceInstance.php new file mode 100755 index 0000000..2a92eb5 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/DomainConfigMessagingServiceInstance.php @@ -0,0 +1,130 @@ +properties = [ + 'domainSid' => Values::array_get($payload, 'domain_sid'), + 'configSid' => Values::array_get($payload, 'config_sid'), + 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), + 'fallbackUrl' => Values::array_get($payload, 'fallback_url'), + 'callbackUrl' => Values::array_get($payload, 'callback_url'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['messagingServiceSid' => $messagingServiceSid ?: $this->properties['messagingServiceSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return DomainConfigMessagingServiceContext Context for this DomainConfigMessagingServiceInstance + */ + protected function proxy(): DomainConfigMessagingServiceContext + { + if (!$this->context) { + $this->context = new DomainConfigMessagingServiceContext( + $this->version, + $this->solution['messagingServiceSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the DomainConfigMessagingServiceInstance + * + * @return DomainConfigMessagingServiceInstance Fetched DomainConfigMessagingServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DomainConfigMessagingServiceInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.DomainConfigMessagingServiceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Messaging/V1/DomainConfigMessagingServiceList.php b/app/api/Twilio/Rest/Messaging/V1/DomainConfigMessagingServiceList.php new file mode 100755 index 0000000..3bf6c57 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/DomainConfigMessagingServiceList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a DomainConfigMessagingServiceContext + * + * @param string $messagingServiceSid Unique string used to identify the Messaging service that this domain should be associated with. + */ + public function getContext( + string $messagingServiceSid + + ): DomainConfigMessagingServiceContext + { + return new DomainConfigMessagingServiceContext( + $this->version, + $messagingServiceSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.DomainConfigMessagingServiceList]'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/DomainConfigMessagingServicePage.php b/app/api/Twilio/Rest/Messaging/V1/DomainConfigMessagingServicePage.php new file mode 100755 index 0000000..f52bfba --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/DomainConfigMessagingServicePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DomainConfigMessagingServiceInstance \Twilio\Rest\Messaging\V1\DomainConfigMessagingServiceInstance + */ + public function buildInstance(array $payload): DomainConfigMessagingServiceInstance + { + return new DomainConfigMessagingServiceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.DomainConfigMessagingServicePage]'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/DomainConfigOptions.php b/app/api/Twilio/Rest/Messaging/V1/DomainConfigOptions.php new file mode 100755 index 0000000..ca3fbdd --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/DomainConfigOptions.php @@ -0,0 +1,114 @@ +options['fallbackUrl'] = $fallbackUrl; + $this->options['callbackUrl'] = $callbackUrl; + $this->options['messagingServiceSidsAction'] = $messagingServiceSidsAction; + } + + /** + * Any requests we receive to this domain that do not match an existing shortened message will be redirected to the fallback url. These will likely be either expired messages, random misdirected traffic, or intentional scraping. + * + * @param string $fallbackUrl Any requests we receive to this domain that do not match an existing shortened message will be redirected to the fallback url. These will likely be either expired messages, random misdirected traffic, or intentional scraping. + * @return $this Fluent Builder + */ + public function setFallbackUrl(string $fallbackUrl): self + { + $this->options['fallbackUrl'] = $fallbackUrl; + return $this; + } + + /** + * URL to receive click events to your webhook whenever the recipients click on the shortened links + * + * @param string $callbackUrl URL to receive click events to your webhook whenever the recipients click on the shortened links + * @return $this Fluent Builder + */ + public function setCallbackUrl(string $callbackUrl): self + { + $this->options['callbackUrl'] = $callbackUrl; + return $this; + } + + /** + * An action type for messaging_service_sids operation (ADD, DELETE, REPLACE) + * + * @param string $messagingServiceSidsAction An action type for messaging_service_sids operation (ADD, DELETE, REPLACE) + * @return $this Fluent Builder + */ + public function setMessagingServiceSidsAction(string $messagingServiceSidsAction): self + { + $this->options['messagingServiceSidsAction'] = $messagingServiceSidsAction; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Messaging.V1.UpdateDomainConfigOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Messaging/V1/DomainConfigPage.php b/app/api/Twilio/Rest/Messaging/V1/DomainConfigPage.php new file mode 100755 index 0000000..21c1d1c --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/DomainConfigPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DomainConfigInstance \Twilio\Rest\Messaging\V1\DomainConfigInstance + */ + public function buildInstance(array $payload): DomainConfigInstance + { + return new DomainConfigInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.DomainConfigPage]'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/ExternalCampaignInstance.php b/app/api/Twilio/Rest/Messaging/V1/ExternalCampaignInstance.php new file mode 100755 index 0000000..4c173d7 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/ExternalCampaignInstance.php @@ -0,0 +1,89 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'campaignId' => Values::array_get($payload, 'campaign_id'), + 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.ExternalCampaignInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Messaging/V1/ExternalCampaignList.php b/app/api/Twilio/Rest/Messaging/V1/ExternalCampaignList.php new file mode 100755 index 0000000..45101ab --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/ExternalCampaignList.php @@ -0,0 +1,80 @@ +solution = [ + ]; + + $this->uri = '/Services/PreregisteredUsa2p'; + } + + /** + * Create the ExternalCampaignInstance + * + * @param string $campaignId ID of the preregistered campaign. + * @param string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/messaging/services/api) that the resource is associated with. + * @return ExternalCampaignInstance Created ExternalCampaignInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $campaignId, string $messagingServiceSid): ExternalCampaignInstance + { + + $data = Values::of([ + 'CampaignId' => + $campaignId, + 'MessagingServiceSid' => + $messagingServiceSid, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new ExternalCampaignInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.ExternalCampaignList]'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/ExternalCampaignPage.php b/app/api/Twilio/Rest/Messaging/V1/ExternalCampaignPage.php new file mode 100755 index 0000000..3f692c6 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/ExternalCampaignPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ExternalCampaignInstance \Twilio\Rest\Messaging\V1\ExternalCampaignInstance + */ + public function buildInstance(array $payload): ExternalCampaignInstance + { + return new ExternalCampaignInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.ExternalCampaignPage]'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceContext.php b/app/api/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceContext.php new file mode 100755 index 0000000..3bce3c0 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceContext.php @@ -0,0 +1,100 @@ +solution = [ + 'domainSid' => + $domainSid, + 'messagingServiceSid' => + $messagingServiceSid, + ]; + + $this->uri = '/LinkShortening/Domains/' . \rawurlencode($domainSid) + .'/MessagingServices/' . \rawurlencode($messagingServiceSid) + .''; + } + + /** + * Create the LinkshorteningMessagingServiceInstance + * + * @return LinkshorteningMessagingServiceInstance Created LinkshorteningMessagingServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(): LinkshorteningMessagingServiceInstance + { + + $payload = $this->version->create('POST', $this->uri); + + return new LinkshorteningMessagingServiceInstance( + $this->version, + $payload, + $this->solution['domainSid'], + $this->solution['messagingServiceSid'] + ); + } + + + /** + * Delete the LinkshorteningMessagingServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.LinkshorteningMessagingServiceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceInstance.php b/app/api/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceInstance.php new file mode 100755 index 0000000..562cb01 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceInstance.php @@ -0,0 +1,133 @@ +properties = [ + 'domainSid' => Values::array_get($payload, 'domain_sid'), + 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['domainSid' => $domainSid ?: $this->properties['domainSid'], 'messagingServiceSid' => $messagingServiceSid ?: $this->properties['messagingServiceSid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return LinkshorteningMessagingServiceContext Context for this LinkshorteningMessagingServiceInstance + */ + protected function proxy(): LinkshorteningMessagingServiceContext + { + if (!$this->context) { + $this->context = new LinkshorteningMessagingServiceContext( + $this->version, + $this->solution['domainSid'], + $this->solution['messagingServiceSid'] + ); + } + + return $this->context; + } + + /** + * Create the LinkshorteningMessagingServiceInstance + * + * @return LinkshorteningMessagingServiceInstance Created LinkshorteningMessagingServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(): LinkshorteningMessagingServiceInstance + { + + return $this->proxy()->create(); + } + + /** + * Delete the LinkshorteningMessagingServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.LinkshorteningMessagingServiceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceList.php b/app/api/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceList.php new file mode 100755 index 0000000..7197e41 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServiceList.php @@ -0,0 +1,69 @@ +solution = [ + ]; + } + + /** + * Constructs a LinkshorteningMessagingServiceContext + * + * @param string $domainSid The domain SID to associate with a messaging service. With URL shortening enabled, links in messages sent with the associated messaging service will be shortened to the provided domain + * + * @param string $messagingServiceSid A messaging service SID to associate with a domain. With URL shortening enabled, links in messages sent with the provided messaging service will be shortened to the associated domain + */ + public function getContext( + string $domainSid + , string $messagingServiceSid + + ): LinkshorteningMessagingServiceContext + { + return new LinkshorteningMessagingServiceContext( + $this->version, + $domainSid, + $messagingServiceSid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.LinkshorteningMessagingServiceList]'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServicePage.php b/app/api/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServicePage.php new file mode 100755 index 0000000..1ff415e --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/LinkshorteningMessagingServicePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return LinkshorteningMessagingServiceInstance \Twilio\Rest\Messaging\V1\LinkshorteningMessagingServiceInstance + */ + public function buildInstance(array $payload): LinkshorteningMessagingServiceInstance + { + return new LinkshorteningMessagingServiceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.LinkshorteningMessagingServicePage]'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/Service/AlphaSenderContext.php b/app/api/Twilio/Rest/Messaging/V1/Service/AlphaSenderContext.php new file mode 100755 index 0000000..479359c --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/Service/AlphaSenderContext.php @@ -0,0 +1,100 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/AlphaSenders/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the AlphaSenderInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the AlphaSenderInstance + * + * @return AlphaSenderInstance Fetched AlphaSenderInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AlphaSenderInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new AlphaSenderInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.AlphaSenderContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/Service/AlphaSenderInstance.php b/app/api/Twilio/Rest/Messaging/V1/Service/AlphaSenderInstance.php new file mode 100755 index 0000000..0b62a4e --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/Service/AlphaSenderInstance.php @@ -0,0 +1,144 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'alphaSender' => Values::array_get($payload, 'alpha_sender'), + 'capabilities' => Values::array_get($payload, 'capabilities'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AlphaSenderContext Context for this AlphaSenderInstance + */ + protected function proxy(): AlphaSenderContext + { + if (!$this->context) { + $this->context = new AlphaSenderContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the AlphaSenderInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the AlphaSenderInstance + * + * @return AlphaSenderInstance Fetched AlphaSenderInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AlphaSenderInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.AlphaSenderInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Messaging/V1/Service/AlphaSenderList.php b/app/api/Twilio/Rest/Messaging/V1/Service/AlphaSenderList.php new file mode 100755 index 0000000..8d6ba2c --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/Service/AlphaSenderList.php @@ -0,0 +1,194 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/AlphaSenders'; + } + + /** + * Create the AlphaSenderInstance + * + * @param string $alphaSender The Alphanumeric Sender ID string. Can be up to 11 characters long. Valid characters are A-Z, a-z, 0-9, space, hyphen `-`, plus `+`, underscore `_` and ampersand `&`. This value cannot contain only numbers. + * @return AlphaSenderInstance Created AlphaSenderInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $alphaSender): AlphaSenderInstance + { + + $data = Values::of([ + 'AlphaSender' => + $alphaSender, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new AlphaSenderInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads AlphaSenderInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return AlphaSenderInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams AlphaSenderInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AlphaSenderInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return AlphaSenderPage Page of AlphaSenderInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AlphaSenderPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new AlphaSenderPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of AlphaSenderInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return AlphaSenderPage Page of AlphaSenderInstance + */ + public function getPage(string $targetUrl): AlphaSenderPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AlphaSenderPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AlphaSenderContext + * + * @param string $sid The SID of the AlphaSender resource to delete. + */ + public function getContext( + string $sid + + ): AlphaSenderContext + { + return new AlphaSenderContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.AlphaSenderList]'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/Service/AlphaSenderPage.php b/app/api/Twilio/Rest/Messaging/V1/Service/AlphaSenderPage.php new file mode 100755 index 0000000..aa5b53e --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/Service/AlphaSenderPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AlphaSenderInstance \Twilio\Rest\Messaging\V1\Service\AlphaSenderInstance + */ + public function buildInstance(array $payload): AlphaSenderInstance + { + return new AlphaSenderInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.AlphaSenderPage]'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/Service/PhoneNumberContext.php b/app/api/Twilio/Rest/Messaging/V1/Service/PhoneNumberContext.php new file mode 100755 index 0000000..5d69cf6 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/Service/PhoneNumberContext.php @@ -0,0 +1,100 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/PhoneNumbers/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the PhoneNumberInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the PhoneNumberInstance + * + * @return PhoneNumberInstance Fetched PhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PhoneNumberInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new PhoneNumberInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.PhoneNumberContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/Service/PhoneNumberInstance.php b/app/api/Twilio/Rest/Messaging/V1/Service/PhoneNumberInstance.php new file mode 100755 index 0000000..f3c7245 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/Service/PhoneNumberInstance.php @@ -0,0 +1,146 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'phoneNumber' => Values::array_get($payload, 'phone_number'), + 'countryCode' => Values::array_get($payload, 'country_code'), + 'capabilities' => Values::array_get($payload, 'capabilities'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return PhoneNumberContext Context for this PhoneNumberInstance + */ + protected function proxy(): PhoneNumberContext + { + if (!$this->context) { + $this->context = new PhoneNumberContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the PhoneNumberInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the PhoneNumberInstance + * + * @return PhoneNumberInstance Fetched PhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PhoneNumberInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.PhoneNumberInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Messaging/V1/Service/PhoneNumberList.php b/app/api/Twilio/Rest/Messaging/V1/Service/PhoneNumberList.php new file mode 100755 index 0000000..0b592bc --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/Service/PhoneNumberList.php @@ -0,0 +1,194 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/PhoneNumbers'; + } + + /** + * Create the PhoneNumberInstance + * + * @param string $phoneNumberSid The SID of the Phone Number being added to the Service. + * @return PhoneNumberInstance Created PhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $phoneNumberSid): PhoneNumberInstance + { + + $data = Values::of([ + 'PhoneNumberSid' => + $phoneNumberSid, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new PhoneNumberInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads PhoneNumberInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return PhoneNumberInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams PhoneNumberInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of PhoneNumberInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return PhoneNumberPage Page of PhoneNumberInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): PhoneNumberPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new PhoneNumberPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of PhoneNumberInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return PhoneNumberPage Page of PhoneNumberInstance + */ + public function getPage(string $targetUrl): PhoneNumberPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new PhoneNumberPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a PhoneNumberContext + * + * @param string $sid The SID of the PhoneNumber resource to delete. + */ + public function getContext( + string $sid + + ): PhoneNumberContext + { + return new PhoneNumberContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.PhoneNumberList]'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/Service/PhoneNumberPage.php b/app/api/Twilio/Rest/Messaging/V1/Service/PhoneNumberPage.php new file mode 100755 index 0000000..7642291 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/Service/PhoneNumberPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PhoneNumberInstance \Twilio\Rest\Messaging\V1\Service\PhoneNumberInstance + */ + public function buildInstance(array $payload): PhoneNumberInstance + { + return new PhoneNumberInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.PhoneNumberPage]'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/Service/ShortCodeContext.php b/app/api/Twilio/Rest/Messaging/V1/Service/ShortCodeContext.php new file mode 100755 index 0000000..cbcbfaa --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/Service/ShortCodeContext.php @@ -0,0 +1,100 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/ShortCodes/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ShortCodeInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the ShortCodeInstance + * + * @return ShortCodeInstance Fetched ShortCodeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ShortCodeInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ShortCodeInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.ShortCodeContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/Service/ShortCodeInstance.php b/app/api/Twilio/Rest/Messaging/V1/Service/ShortCodeInstance.php new file mode 100755 index 0000000..65ba3b1 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/Service/ShortCodeInstance.php @@ -0,0 +1,146 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'shortCode' => Values::array_get($payload, 'short_code'), + 'countryCode' => Values::array_get($payload, 'country_code'), + 'capabilities' => Values::array_get($payload, 'capabilities'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ShortCodeContext Context for this ShortCodeInstance + */ + protected function proxy(): ShortCodeContext + { + if (!$this->context) { + $this->context = new ShortCodeContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ShortCodeInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ShortCodeInstance + * + * @return ShortCodeInstance Fetched ShortCodeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ShortCodeInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.ShortCodeInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Messaging/V1/Service/ShortCodeList.php b/app/api/Twilio/Rest/Messaging/V1/Service/ShortCodeList.php new file mode 100755 index 0000000..7076a1f --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/Service/ShortCodeList.php @@ -0,0 +1,194 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/ShortCodes'; + } + + /** + * Create the ShortCodeInstance + * + * @param string $shortCodeSid The SID of the ShortCode resource being added to the Service. + * @return ShortCodeInstance Created ShortCodeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $shortCodeSid): ShortCodeInstance + { + + $data = Values::of([ + 'ShortCodeSid' => + $shortCodeSid, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new ShortCodeInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads ShortCodeInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ShortCodeInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ShortCodeInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ShortCodeInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ShortCodePage Page of ShortCodeInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ShortCodePage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ShortCodePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ShortCodeInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ShortCodePage Page of ShortCodeInstance + */ + public function getPage(string $targetUrl): ShortCodePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ShortCodePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ShortCodeContext + * + * @param string $sid The SID of the ShortCode resource to delete. + */ + public function getContext( + string $sid + + ): ShortCodeContext + { + return new ShortCodeContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.ShortCodeList]'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/Service/ShortCodePage.php b/app/api/Twilio/Rest/Messaging/V1/Service/ShortCodePage.php new file mode 100755 index 0000000..7fa3179 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/Service/ShortCodePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ShortCodeInstance \Twilio\Rest\Messaging\V1\Service\ShortCodeInstance + */ + public function buildInstance(array $payload): ShortCodeInstance + { + return new ShortCodeInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.ShortCodePage]'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/Service/UsAppToPersonContext.php b/app/api/Twilio/Rest/Messaging/V1/Service/UsAppToPersonContext.php new file mode 100755 index 0000000..4a256b6 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/Service/UsAppToPersonContext.php @@ -0,0 +1,100 @@ +solution = [ + 'messagingServiceSid' => + $messagingServiceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($messagingServiceSid) + .'/Compliance/Usa2p/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the UsAppToPersonInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the UsAppToPersonInstance + * + * @return UsAppToPersonInstance Fetched UsAppToPersonInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UsAppToPersonInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new UsAppToPersonInstance( + $this->version, + $payload, + $this->solution['messagingServiceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.UsAppToPersonContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/Service/UsAppToPersonInstance.php b/app/api/Twilio/Rest/Messaging/V1/Service/UsAppToPersonInstance.php new file mode 100755 index 0000000..244679b --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/Service/UsAppToPersonInstance.php @@ -0,0 +1,176 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'brandRegistrationSid' => Values::array_get($payload, 'brand_registration_sid'), + 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), + 'description' => Values::array_get($payload, 'description'), + 'messageSamples' => Values::array_get($payload, 'message_samples'), + 'usAppToPersonUsecase' => Values::array_get($payload, 'us_app_to_person_usecase'), + 'hasEmbeddedLinks' => Values::array_get($payload, 'has_embedded_links'), + 'hasEmbeddedPhone' => Values::array_get($payload, 'has_embedded_phone'), + 'campaignStatus' => Values::array_get($payload, 'campaign_status'), + 'campaignId' => Values::array_get($payload, 'campaign_id'), + 'isExternallyRegistered' => Values::array_get($payload, 'is_externally_registered'), + 'rateLimits' => Values::array_get($payload, 'rate_limits'), + 'messageFlow' => Values::array_get($payload, 'message_flow'), + 'optInMessage' => Values::array_get($payload, 'opt_in_message'), + 'optOutMessage' => Values::array_get($payload, 'opt_out_message'), + 'helpMessage' => Values::array_get($payload, 'help_message'), + 'optInKeywords' => Values::array_get($payload, 'opt_in_keywords'), + 'optOutKeywords' => Values::array_get($payload, 'opt_out_keywords'), + 'helpKeywords' => Values::array_get($payload, 'help_keywords'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'mock' => Values::array_get($payload, 'mock'), + ]; + + $this->solution = ['messagingServiceSid' => $messagingServiceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return UsAppToPersonContext Context for this UsAppToPersonInstance + */ + protected function proxy(): UsAppToPersonContext + { + if (!$this->context) { + $this->context = new UsAppToPersonContext( + $this->version, + $this->solution['messagingServiceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the UsAppToPersonInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the UsAppToPersonInstance + * + * @return UsAppToPersonInstance Fetched UsAppToPersonInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UsAppToPersonInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.UsAppToPersonInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Messaging/V1/Service/UsAppToPersonList.php b/app/api/Twilio/Rest/Messaging/V1/Service/UsAppToPersonList.php new file mode 100755 index 0000000..c3d6b61 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/Service/UsAppToPersonList.php @@ -0,0 +1,229 @@ +solution = [ + 'messagingServiceSid' => + $messagingServiceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($messagingServiceSid) + .'/Compliance/Usa2p'; + } + + /** + * Create the UsAppToPersonInstance + * + * @param string $brandRegistrationSid A2P Brand Registration SID + * @param string $description A short description of what this SMS campaign does. Min length: 40 characters. Max length: 4096 characters. + * @param string $messageFlow Required for all Campaigns. Details around how a consumer opts-in to their campaign, therefore giving consent to receive their messages. If multiple opt-in methods can be used for the same campaign, they must all be listed. 40 character minimum. 2048 character maximum. + * @param string[] $messageSamples Message samples, at least 1 and up to 5 sample messages (at least 2 for sole proprietor), >=20 chars, <=1024 chars each. + * @param string $usAppToPersonUsecase A2P Campaign Use Case. Examples: [ 2FA, EMERGENCY, MARKETING..] + * @param bool $hasEmbeddedLinks Indicates that this SMS campaign will send messages that contain links. + * @param bool $hasEmbeddedPhone Indicates that this SMS campaign will send messages that contain phone numbers. + * @param array|Options $options Optional Arguments + * @return UsAppToPersonInstance Created UsAppToPersonInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $brandRegistrationSid, string $description, string $messageFlow, array $messageSamples, string $usAppToPersonUsecase, bool $hasEmbeddedLinks, bool $hasEmbeddedPhone, array $options = []): UsAppToPersonInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'BrandRegistrationSid' => + $brandRegistrationSid, + 'Description' => + $description, + 'MessageFlow' => + $messageFlow, + 'MessageSamples' => + Serialize::map($messageSamples,function ($e) { return $e; }), + 'UsAppToPersonUsecase' => + $usAppToPersonUsecase, + 'HasEmbeddedLinks' => + Serialize::booleanToString($hasEmbeddedLinks), + 'HasEmbeddedPhone' => + Serialize::booleanToString($hasEmbeddedPhone), + 'OptInMessage' => + $options['optInMessage'], + 'OptOutMessage' => + $options['optOutMessage'], + 'HelpMessage' => + $options['helpMessage'], + 'OptInKeywords' => + Serialize::map($options['optInKeywords'], function ($e) { return $e; }), + 'OptOutKeywords' => + Serialize::map($options['optOutKeywords'], function ($e) { return $e; }), + 'HelpKeywords' => + Serialize::map($options['helpKeywords'], function ($e) { return $e; }), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new UsAppToPersonInstance( + $this->version, + $payload, + $this->solution['messagingServiceSid'] + ); + } + + + /** + * Reads UsAppToPersonInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return UsAppToPersonInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams UsAppToPersonInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of UsAppToPersonInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return UsAppToPersonPage Page of UsAppToPersonInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): UsAppToPersonPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new UsAppToPersonPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of UsAppToPersonInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return UsAppToPersonPage Page of UsAppToPersonInstance + */ + public function getPage(string $targetUrl): UsAppToPersonPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new UsAppToPersonPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a UsAppToPersonContext + * + * @param string $sid The SID of the US A2P Compliance resource to delete `QE2c6890da8086d771620e9b13fadeba0b`. + */ + public function getContext( + string $sid + + ): UsAppToPersonContext + { + return new UsAppToPersonContext( + $this->version, + $this->solution['messagingServiceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.UsAppToPersonList]'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/Service/UsAppToPersonOptions.php b/app/api/Twilio/Rest/Messaging/V1/Service/UsAppToPersonOptions.php new file mode 100755 index 0000000..9ac2155 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/Service/UsAppToPersonOptions.php @@ -0,0 +1,172 @@ +options['optInMessage'] = $optInMessage; + $this->options['optOutMessage'] = $optOutMessage; + $this->options['helpMessage'] = $helpMessage; + $this->options['optInKeywords'] = $optInKeywords; + $this->options['optOutKeywords'] = $optOutKeywords; + $this->options['helpKeywords'] = $helpKeywords; + } + + /** + * If end users can text in a keyword to start receiving messages from this campaign, the auto-reply messages sent to the end users must be provided. The opt-in response should include the Brand name, confirmation of opt-in enrollment to a recurring message campaign, how to get help, and clear description of how to opt-out. This field is required if end users can text in a keyword to start receiving messages from this campaign. 20 character minimum. 320 character maximum. + * + * @param string $optInMessage If end users can text in a keyword to start receiving messages from this campaign, the auto-reply messages sent to the end users must be provided. The opt-in response should include the Brand name, confirmation of opt-in enrollment to a recurring message campaign, how to get help, and clear description of how to opt-out. This field is required if end users can text in a keyword to start receiving messages from this campaign. 20 character minimum. 320 character maximum. + * @return $this Fluent Builder + */ + public function setOptInMessage(string $optInMessage): self + { + $this->options['optInMessage'] = $optInMessage; + return $this; + } + + /** + * Upon receiving the opt-out keywords from the end users, Twilio customers are expected to send back an auto-generated response, which must provide acknowledgment of the opt-out request and confirmation that no further messages will be sent. It is also recommended that these opt-out messages include the brand name. This field is required if managing opt out keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). 20 character minimum. 320 character maximum. + * + * @param string $optOutMessage Upon receiving the opt-out keywords from the end users, Twilio customers are expected to send back an auto-generated response, which must provide acknowledgment of the opt-out request and confirmation that no further messages will be sent. It is also recommended that these opt-out messages include the brand name. This field is required if managing opt out keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). 20 character minimum. 320 character maximum. + * @return $this Fluent Builder + */ + public function setOptOutMessage(string $optOutMessage): self + { + $this->options['optOutMessage'] = $optOutMessage; + return $this; + } + + /** + * When customers receive the help keywords from their end users, Twilio customers are expected to send back an auto-generated response; this may include the brand name and additional support contact information. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). 20 character minimum. 320 character maximum. + * + * @param string $helpMessage When customers receive the help keywords from their end users, Twilio customers are expected to send back an auto-generated response; this may include the brand name and additional support contact information. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). 20 character minimum. 320 character maximum. + * @return $this Fluent Builder + */ + public function setHelpMessage(string $helpMessage): self + { + $this->options['helpMessage'] = $helpMessage; + return $this; + } + + /** + * If end users can text in a keyword to start receiving messages from this campaign, those keywords must be provided. This field is required if end users can text in a keyword to start receiving messages from this campaign. Values must be alphanumeric. 255 character maximum. + * + * @param string[] $optInKeywords If end users can text in a keyword to start receiving messages from this campaign, those keywords must be provided. This field is required if end users can text in a keyword to start receiving messages from this campaign. Values must be alphanumeric. 255 character maximum. + * @return $this Fluent Builder + */ + public function setOptInKeywords(array $optInKeywords): self + { + $this->options['optInKeywords'] = $optInKeywords; + return $this; + } + + /** + * End users should be able to text in a keyword to stop receiving messages from this campaign. Those keywords must be provided. This field is required if managing opt out keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. + * + * @param string[] $optOutKeywords End users should be able to text in a keyword to stop receiving messages from this campaign. Those keywords must be provided. This field is required if managing opt out keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. + * @return $this Fluent Builder + */ + public function setOptOutKeywords(array $optOutKeywords): self + { + $this->options['optOutKeywords'] = $optOutKeywords; + return $this; + } + + /** + * End users should be able to text in a keyword to receive help. Those keywords must be provided as part of the campaign registration request. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. + * + * @param string[] $helpKeywords End users should be able to text in a keyword to receive help. Those keywords must be provided as part of the campaign registration request. This field is required if managing help keywords yourself (i.e. not using Twilio's Default or Advanced Opt Out features). Values must be alphanumeric. 255 character maximum. + * @return $this Fluent Builder + */ + public function setHelpKeywords(array $helpKeywords): self + { + $this->options['helpKeywords'] = $helpKeywords; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Messaging.V1.CreateUsAppToPersonOptions ' . $options . ']'; + } +} + + + + diff --git a/app/api/Twilio/Rest/Messaging/V1/Service/UsAppToPersonPage.php b/app/api/Twilio/Rest/Messaging/V1/Service/UsAppToPersonPage.php new file mode 100755 index 0000000..f7fcada --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/Service/UsAppToPersonPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UsAppToPersonInstance \Twilio\Rest\Messaging\V1\Service\UsAppToPersonInstance + */ + public function buildInstance(array $payload): UsAppToPersonInstance + { + return new UsAppToPersonInstance($this->version, $payload, $this->solution['messagingServiceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.UsAppToPersonPage]'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecaseInstance.php b/app/api/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecaseInstance.php new file mode 100755 index 0000000..5ebcbfc --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecaseInstance.php @@ -0,0 +1,81 @@ +properties = [ + 'usAppToPersonUsecases' => Values::array_get($payload, 'us_app_to_person_usecases'), + ]; + + $this->solution = ['messagingServiceSid' => $messagingServiceSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.UsAppToPersonUsecaseInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecaseList.php b/app/api/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecaseList.php new file mode 100755 index 0000000..0e83425 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecaseList.php @@ -0,0 +1,87 @@ +solution = [ + 'messagingServiceSid' => + $messagingServiceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($messagingServiceSid) + .'/Compliance/Usa2p/Usecases'; + } + + /** + * Fetch the UsAppToPersonUsecaseInstance + * + * @param array|Options $options Optional Arguments + * @return UsAppToPersonUsecaseInstance Fetched UsAppToPersonUsecaseInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): UsAppToPersonUsecaseInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'BrandRegistrationSid' => + $options['brandRegistrationSid'], + ]); + + $payload = $this->version->fetch('GET', $this->uri, $params); + + return new UsAppToPersonUsecaseInstance( + $this->version, + $payload, + $this->solution['messagingServiceSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.UsAppToPersonUsecaseList]'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecaseOptions.php b/app/api/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecaseOptions.php new file mode 100755 index 0000000..3d59b21 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecaseOptions.php @@ -0,0 +1,76 @@ +options['brandRegistrationSid'] = $brandRegistrationSid; + } + + /** + * The unique string to identify the A2P brand. + * + * @param string $brandRegistrationSid The unique string to identify the A2P brand. + * @return $this Fluent Builder + */ + public function setBrandRegistrationSid(string $brandRegistrationSid): self + { + $this->options['brandRegistrationSid'] = $brandRegistrationSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Messaging.V1.FetchUsAppToPersonUsecaseOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecasePage.php b/app/api/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecasePage.php new file mode 100755 index 0000000..3dff3d7 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/Service/UsAppToPersonUsecasePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UsAppToPersonUsecaseInstance \Twilio\Rest\Messaging\V1\Service\UsAppToPersonUsecaseInstance + */ + public function buildInstance(array $payload): UsAppToPersonUsecaseInstance + { + return new UsAppToPersonUsecaseInstance($this->version, $payload, $this->solution['messagingServiceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.UsAppToPersonUsecasePage]'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/ServiceContext.php b/app/api/Twilio/Rest/Messaging/V1/ServiceContext.php new file mode 100755 index 0000000..0fe8a16 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/ServiceContext.php @@ -0,0 +1,287 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'InboundRequestUrl' => + $options['inboundRequestUrl'], + 'InboundMethod' => + $options['inboundMethod'], + 'FallbackUrl' => + $options['fallbackUrl'], + 'FallbackMethod' => + $options['fallbackMethod'], + 'StatusCallback' => + $options['statusCallback'], + 'StickySender' => + Serialize::booleanToString($options['stickySender']), + 'MmsConverter' => + Serialize::booleanToString($options['mmsConverter']), + 'SmartEncoding' => + Serialize::booleanToString($options['smartEncoding']), + 'ScanMessageContent' => + $options['scanMessageContent'], + 'FallbackToLongCode' => + Serialize::booleanToString($options['fallbackToLongCode']), + 'AreaCodeGeomatch' => + Serialize::booleanToString($options['areaCodeGeomatch']), + 'ValidityPeriod' => + $options['validityPeriod'], + 'SynchronousValidation' => + Serialize::booleanToString($options['synchronousValidation']), + 'Usecase' => + $options['usecase'], + 'UseInboundWebhookOnNumber' => + Serialize::booleanToString($options['useInboundWebhookOnNumber']), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the alphaSenders + */ + protected function getAlphaSenders(): AlphaSenderList + { + if (!$this->_alphaSenders) { + $this->_alphaSenders = new AlphaSenderList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_alphaSenders; + } + + /** + * Access the phoneNumbers + */ + protected function getPhoneNumbers(): PhoneNumberList + { + if (!$this->_phoneNumbers) { + $this->_phoneNumbers = new PhoneNumberList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_phoneNumbers; + } + + /** + * Access the usAppToPersonUsecases + */ + protected function getUsAppToPersonUsecases(): UsAppToPersonUsecaseList + { + if (!$this->_usAppToPersonUsecases) { + $this->_usAppToPersonUsecases = new UsAppToPersonUsecaseList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_usAppToPersonUsecases; + } + + /** + * Access the shortCodes + */ + protected function getShortCodes(): ShortCodeList + { + if (!$this->_shortCodes) { + $this->_shortCodes = new ShortCodeList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_shortCodes; + } + + /** + * Access the usAppToPerson + */ + protected function getUsAppToPerson(): UsAppToPersonList + { + if (!$this->_usAppToPerson) { + $this->_usAppToPerson = new UsAppToPersonList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_usAppToPerson; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.ServiceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/ServiceInstance.php b/app/api/Twilio/Rest/Messaging/V1/ServiceInstance.php new file mode 100755 index 0000000..79fcec3 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/ServiceInstance.php @@ -0,0 +1,237 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'inboundRequestUrl' => Values::array_get($payload, 'inbound_request_url'), + 'inboundMethod' => Values::array_get($payload, 'inbound_method'), + 'fallbackUrl' => Values::array_get($payload, 'fallback_url'), + 'fallbackMethod' => Values::array_get($payload, 'fallback_method'), + 'statusCallback' => Values::array_get($payload, 'status_callback'), + 'stickySender' => Values::array_get($payload, 'sticky_sender'), + 'mmsConverter' => Values::array_get($payload, 'mms_converter'), + 'smartEncoding' => Values::array_get($payload, 'smart_encoding'), + 'scanMessageContent' => Values::array_get($payload, 'scan_message_content'), + 'fallbackToLongCode' => Values::array_get($payload, 'fallback_to_long_code'), + 'areaCodeGeomatch' => Values::array_get($payload, 'area_code_geomatch'), + 'synchronousValidation' => Values::array_get($payload, 'synchronous_validation'), + 'validityPeriod' => Values::array_get($payload, 'validity_period'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + 'usecase' => Values::array_get($payload, 'usecase'), + 'usAppToPersonRegistered' => Values::array_get($payload, 'us_app_to_person_registered'), + 'useInboundWebhookOnNumber' => Values::array_get($payload, 'use_inbound_webhook_on_number'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ServiceContext Context for this ServiceInstance + */ + protected function proxy(): ServiceContext + { + if (!$this->context) { + $this->context = new ServiceContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the alphaSenders + */ + protected function getAlphaSenders(): AlphaSenderList + { + return $this->proxy()->alphaSenders; + } + + /** + * Access the phoneNumbers + */ + protected function getPhoneNumbers(): PhoneNumberList + { + return $this->proxy()->phoneNumbers; + } + + /** + * Access the usAppToPersonUsecases + */ + protected function getUsAppToPersonUsecases(): UsAppToPersonUsecaseList + { + return $this->proxy()->usAppToPersonUsecases; + } + + /** + * Access the shortCodes + */ + protected function getShortCodes(): ShortCodeList + { + return $this->proxy()->shortCodes; + } + + /** + * Access the usAppToPerson + */ + protected function getUsAppToPerson(): UsAppToPersonList + { + return $this->proxy()->usAppToPerson; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.ServiceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Messaging/V1/ServiceList.php b/app/api/Twilio/Rest/Messaging/V1/ServiceList.php new file mode 100755 index 0000000..b7425d4 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/ServiceList.php @@ -0,0 +1,221 @@ +solution = [ + ]; + + $this->uri = '/Services'; + } + + /** + * Create the ServiceInstance + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @param array|Options $options Optional Arguments + * @return ServiceInstance Created ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, array $options = []): ServiceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'InboundRequestUrl' => + $options['inboundRequestUrl'], + 'InboundMethod' => + $options['inboundMethod'], + 'FallbackUrl' => + $options['fallbackUrl'], + 'FallbackMethod' => + $options['fallbackMethod'], + 'StatusCallback' => + $options['statusCallback'], + 'StickySender' => + Serialize::booleanToString($options['stickySender']), + 'MmsConverter' => + Serialize::booleanToString($options['mmsConverter']), + 'SmartEncoding' => + Serialize::booleanToString($options['smartEncoding']), + 'ScanMessageContent' => + $options['scanMessageContent'], + 'FallbackToLongCode' => + Serialize::booleanToString($options['fallbackToLongCode']), + 'AreaCodeGeomatch' => + Serialize::booleanToString($options['areaCodeGeomatch']), + 'ValidityPeriod' => + $options['validityPeriod'], + 'SynchronousValidation' => + Serialize::booleanToString($options['synchronousValidation']), + 'Usecase' => + $options['usecase'], + 'UseInboundWebhookOnNumber' => + Serialize::booleanToString($options['useInboundWebhookOnNumber']), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new ServiceInstance( + $this->version, + $payload + ); + } + + + /** + * Reads ServiceInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ServiceInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ServiceInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ServiceInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ServicePage Page of ServiceInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ServicePage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ServicePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ServiceInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ServicePage Page of ServiceInstance + */ + public function getPage(string $targetUrl): ServicePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ServicePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ServiceContext + * + * @param string $sid The SID of the Service resource to delete. + */ + public function getContext( + string $sid + + ): ServiceContext + { + return new ServiceContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.ServiceList]'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/ServiceOptions.php b/app/api/Twilio/Rest/Messaging/V1/ServiceOptions.php new file mode 100755 index 0000000..fb75d13 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/ServiceOptions.php @@ -0,0 +1,652 @@ +options['inboundRequestUrl'] = $inboundRequestUrl; + $this->options['inboundMethod'] = $inboundMethod; + $this->options['fallbackUrl'] = $fallbackUrl; + $this->options['fallbackMethod'] = $fallbackMethod; + $this->options['statusCallback'] = $statusCallback; + $this->options['stickySender'] = $stickySender; + $this->options['mmsConverter'] = $mmsConverter; + $this->options['smartEncoding'] = $smartEncoding; + $this->options['scanMessageContent'] = $scanMessageContent; + $this->options['fallbackToLongCode'] = $fallbackToLongCode; + $this->options['areaCodeGeomatch'] = $areaCodeGeomatch; + $this->options['validityPeriod'] = $validityPeriod; + $this->options['synchronousValidation'] = $synchronousValidation; + $this->options['usecase'] = $usecase; + $this->options['useInboundWebhookOnNumber'] = $useInboundWebhookOnNumber; + } + + /** + * The URL we call using `inbound_method` when a message is received by any phone number or short code in the Service. When this property is `null`, receiving inbound messages is disabled. All messages sent to the Twilio phone number or short code will not be logged and received on the Account. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `inbound_request_url` defined for the Messaging Service. + * + * @param string $inboundRequestUrl The URL we call using `inbound_method` when a message is received by any phone number or short code in the Service. When this property is `null`, receiving inbound messages is disabled. All messages sent to the Twilio phone number or short code will not be logged and received on the Account. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `inbound_request_url` defined for the Messaging Service. + * @return $this Fluent Builder + */ + public function setInboundRequestUrl(string $inboundRequestUrl): self + { + $this->options['inboundRequestUrl'] = $inboundRequestUrl; + return $this; + } + + /** + * The HTTP method we should use to call `inbound_request_url`. Can be `GET` or `POST` and the default is `POST`. + * + * @param string $inboundMethod The HTTP method we should use to call `inbound_request_url`. Can be `GET` or `POST` and the default is `POST`. + * @return $this Fluent Builder + */ + public function setInboundMethod(string $inboundMethod): self + { + $this->options['inboundMethod'] = $inboundMethod; + return $this; + } + + /** + * The URL that we call using `fallback_method` if an error occurs while retrieving or executing the TwiML from the Inbound Request URL. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `fallback_url` defined for the Messaging Service. + * + * @param string $fallbackUrl The URL that we call using `fallback_method` if an error occurs while retrieving or executing the TwiML from the Inbound Request URL. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `fallback_url` defined for the Messaging Service. + * @return $this Fluent Builder + */ + public function setFallbackUrl(string $fallbackUrl): self + { + $this->options['fallbackUrl'] = $fallbackUrl; + return $this; + } + + /** + * The HTTP method we should use to call `fallback_url`. Can be: `GET` or `POST`. + * + * @param string $fallbackMethod The HTTP method we should use to call `fallback_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setFallbackMethod(string $fallbackMethod): self + { + $this->options['fallbackMethod'] = $fallbackMethod; + return $this; + } + + /** + * The URL we should call to [pass status updates](https://www.twilio.com/docs/sms/api/message-resource#message-status-values) about message delivery. + * + * @param string $statusCallback The URL we should call to [pass status updates](https://www.twilio.com/docs/sms/api/message-resource#message-status-values) about message delivery. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * Whether to enable [Sticky Sender](https://www.twilio.com/docs/sms/services#sticky-sender) on the Service instance. + * + * @param bool $stickySender Whether to enable [Sticky Sender](https://www.twilio.com/docs/sms/services#sticky-sender) on the Service instance. + * @return $this Fluent Builder + */ + public function setStickySender(bool $stickySender): self + { + $this->options['stickySender'] = $stickySender; + return $this; + } + + /** + * Whether to enable the [MMS Converter](https://www.twilio.com/docs/sms/services#mms-converter) for messages sent through the Service instance. + * + * @param bool $mmsConverter Whether to enable the [MMS Converter](https://www.twilio.com/docs/sms/services#mms-converter) for messages sent through the Service instance. + * @return $this Fluent Builder + */ + public function setMmsConverter(bool $mmsConverter): self + { + $this->options['mmsConverter'] = $mmsConverter; + return $this; + } + + /** + * Whether to enable [Smart Encoding](https://www.twilio.com/docs/sms/services#smart-encoding) for messages sent through the Service instance. + * + * @param bool $smartEncoding Whether to enable [Smart Encoding](https://www.twilio.com/docs/sms/services#smart-encoding) for messages sent through the Service instance. + * @return $this Fluent Builder + */ + public function setSmartEncoding(bool $smartEncoding): self + { + $this->options['smartEncoding'] = $smartEncoding; + return $this; + } + + /** + * @param string $scanMessageContent + * @return $this Fluent Builder + */ + public function setScanMessageContent(string $scanMessageContent): self + { + $this->options['scanMessageContent'] = $scanMessageContent; + return $this; + } + + /** + * Whether to enable [Fallback to Long Code](https://www.twilio.com/docs/sms/services#fallback-to-long-code) for messages sent through the Service instance. + * + * @param bool $fallbackToLongCode Whether to enable [Fallback to Long Code](https://www.twilio.com/docs/sms/services#fallback-to-long-code) for messages sent through the Service instance. + * @return $this Fluent Builder + */ + public function setFallbackToLongCode(bool $fallbackToLongCode): self + { + $this->options['fallbackToLongCode'] = $fallbackToLongCode; + return $this; + } + + /** + * Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/sms/services#area-code-geomatch) on the Service Instance. + * + * @param bool $areaCodeGeomatch Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/sms/services#area-code-geomatch) on the Service Instance. + * @return $this Fluent Builder + */ + public function setAreaCodeGeomatch(bool $areaCodeGeomatch): self + { + $this->options['areaCodeGeomatch'] = $areaCodeGeomatch; + return $this; + } + + /** + * How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. + * + * @param int $validityPeriod How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. + * @return $this Fluent Builder + */ + public function setValidityPeriod(int $validityPeriod): self + { + $this->options['validityPeriod'] = $validityPeriod; + return $this; + } + + /** + * Reserved. + * + * @param bool $synchronousValidation Reserved. + * @return $this Fluent Builder + */ + public function setSynchronousValidation(bool $synchronousValidation): self + { + $this->options['synchronousValidation'] = $synchronousValidation; + return $this; + } + + /** + * A string that describes the scenario in which the Messaging Service will be used. Examples: [notification, marketing, verification, poll ..]. + * + * @param string $usecase A string that describes the scenario in which the Messaging Service will be used. Examples: [notification, marketing, verification, poll ..]. + * @return $this Fluent Builder + */ + public function setUsecase(string $usecase): self + { + $this->options['usecase'] = $usecase; + return $this; + } + + /** + * A boolean value that indicates either the webhook url configured on the phone number will be used or `inbound_request_url`/`fallback_url` url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the `inbound_request_url`/`fallback_url` defined for the Messaging Service. + * + * @param bool $useInboundWebhookOnNumber A boolean value that indicates either the webhook url configured on the phone number will be used or `inbound_request_url`/`fallback_url` url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the `inbound_request_url`/`fallback_url` defined for the Messaging Service. + * @return $this Fluent Builder + */ + public function setUseInboundWebhookOnNumber(bool $useInboundWebhookOnNumber): self + { + $this->options['useInboundWebhookOnNumber'] = $useInboundWebhookOnNumber; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Messaging.V1.CreateServiceOptions ' . $options . ']'; + } +} + + + + +class UpdateServiceOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @param string $inboundRequestUrl The URL we call using `inbound_method` when a message is received by any phone number or short code in the Service. When this property is `null`, receiving inbound messages is disabled. All messages sent to the Twilio phone number or short code will not be logged and received on the Account. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `inbound_request_url` defined for the Messaging Service. + * @param string $inboundMethod The HTTP method we should use to call `inbound_request_url`. Can be `GET` or `POST` and the default is `POST`. + * @param string $fallbackUrl The URL that we call using `fallback_method` if an error occurs while retrieving or executing the TwiML from the Inbound Request URL. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `fallback_url` defined for the Messaging Service. + * @param string $fallbackMethod The HTTP method we should use to call `fallback_url`. Can be: `GET` or `POST`. + * @param string $statusCallback The URL we should call to [pass status updates](https://www.twilio.com/docs/sms/api/message-resource#message-status-values) about message delivery. + * @param bool $stickySender Whether to enable [Sticky Sender](https://www.twilio.com/docs/sms/services#sticky-sender) on the Service instance. + * @param bool $mmsConverter Whether to enable the [MMS Converter](https://www.twilio.com/docs/sms/services#mms-converter) for messages sent through the Service instance. + * @param bool $smartEncoding Whether to enable [Smart Encoding](https://www.twilio.com/docs/sms/services#smart-encoding) for messages sent through the Service instance. + * @param string $scanMessageContent + * @param bool $fallbackToLongCode Whether to enable [Fallback to Long Code](https://www.twilio.com/docs/sms/services#fallback-to-long-code) for messages sent through the Service instance. + * @param bool $areaCodeGeomatch Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/sms/services#area-code-geomatch) on the Service Instance. + * @param int $validityPeriod How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. + * @param bool $synchronousValidation Reserved. + * @param string $usecase A string that describes the scenario in which the Messaging Service will be used. Examples: [notification, marketing, verification, poll ..] + * @param bool $useInboundWebhookOnNumber A boolean value that indicates either the webhook url configured on the phone number will be used or `inbound_request_url`/`fallback_url` url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the `inbound_request_url`/`fallback_url` defined for the Messaging Service. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $inboundRequestUrl = Values::NONE, + string $inboundMethod = Values::NONE, + string $fallbackUrl = Values::NONE, + string $fallbackMethod = Values::NONE, + string $statusCallback = Values::NONE, + bool $stickySender = Values::BOOL_NONE, + bool $mmsConverter = Values::BOOL_NONE, + bool $smartEncoding = Values::BOOL_NONE, + string $scanMessageContent = Values::NONE, + bool $fallbackToLongCode = Values::BOOL_NONE, + bool $areaCodeGeomatch = Values::BOOL_NONE, + int $validityPeriod = Values::INT_NONE, + bool $synchronousValidation = Values::BOOL_NONE, + string $usecase = Values::NONE, + bool $useInboundWebhookOnNumber = Values::BOOL_NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['inboundRequestUrl'] = $inboundRequestUrl; + $this->options['inboundMethod'] = $inboundMethod; + $this->options['fallbackUrl'] = $fallbackUrl; + $this->options['fallbackMethod'] = $fallbackMethod; + $this->options['statusCallback'] = $statusCallback; + $this->options['stickySender'] = $stickySender; + $this->options['mmsConverter'] = $mmsConverter; + $this->options['smartEncoding'] = $smartEncoding; + $this->options['scanMessageContent'] = $scanMessageContent; + $this->options['fallbackToLongCode'] = $fallbackToLongCode; + $this->options['areaCodeGeomatch'] = $areaCodeGeomatch; + $this->options['validityPeriod'] = $validityPeriod; + $this->options['synchronousValidation'] = $synchronousValidation; + $this->options['usecase'] = $usecase; + $this->options['useInboundWebhookOnNumber'] = $useInboundWebhookOnNumber; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The URL we call using `inbound_method` when a message is received by any phone number or short code in the Service. When this property is `null`, receiving inbound messages is disabled. All messages sent to the Twilio phone number or short code will not be logged and received on the Account. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `inbound_request_url` defined for the Messaging Service. + * + * @param string $inboundRequestUrl The URL we call using `inbound_method` when a message is received by any phone number or short code in the Service. When this property is `null`, receiving inbound messages is disabled. All messages sent to the Twilio phone number or short code will not be logged and received on the Account. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `inbound_request_url` defined for the Messaging Service. + * @return $this Fluent Builder + */ + public function setInboundRequestUrl(string $inboundRequestUrl): self + { + $this->options['inboundRequestUrl'] = $inboundRequestUrl; + return $this; + } + + /** + * The HTTP method we should use to call `inbound_request_url`. Can be `GET` or `POST` and the default is `POST`. + * + * @param string $inboundMethod The HTTP method we should use to call `inbound_request_url`. Can be `GET` or `POST` and the default is `POST`. + * @return $this Fluent Builder + */ + public function setInboundMethod(string $inboundMethod): self + { + $this->options['inboundMethod'] = $inboundMethod; + return $this; + } + + /** + * The URL that we call using `fallback_method` if an error occurs while retrieving or executing the TwiML from the Inbound Request URL. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `fallback_url` defined for the Messaging Service. + * + * @param string $fallbackUrl The URL that we call using `fallback_method` if an error occurs while retrieving or executing the TwiML from the Inbound Request URL. If the `use_inbound_webhook_on_number` field is enabled then the webhook url defined on the phone number will override the `fallback_url` defined for the Messaging Service. + * @return $this Fluent Builder + */ + public function setFallbackUrl(string $fallbackUrl): self + { + $this->options['fallbackUrl'] = $fallbackUrl; + return $this; + } + + /** + * The HTTP method we should use to call `fallback_url`. Can be: `GET` or `POST`. + * + * @param string $fallbackMethod The HTTP method we should use to call `fallback_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setFallbackMethod(string $fallbackMethod): self + { + $this->options['fallbackMethod'] = $fallbackMethod; + return $this; + } + + /** + * The URL we should call to [pass status updates](https://www.twilio.com/docs/sms/api/message-resource#message-status-values) about message delivery. + * + * @param string $statusCallback The URL we should call to [pass status updates](https://www.twilio.com/docs/sms/api/message-resource#message-status-values) about message delivery. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * Whether to enable [Sticky Sender](https://www.twilio.com/docs/sms/services#sticky-sender) on the Service instance. + * + * @param bool $stickySender Whether to enable [Sticky Sender](https://www.twilio.com/docs/sms/services#sticky-sender) on the Service instance. + * @return $this Fluent Builder + */ + public function setStickySender(bool $stickySender): self + { + $this->options['stickySender'] = $stickySender; + return $this; + } + + /** + * Whether to enable the [MMS Converter](https://www.twilio.com/docs/sms/services#mms-converter) for messages sent through the Service instance. + * + * @param bool $mmsConverter Whether to enable the [MMS Converter](https://www.twilio.com/docs/sms/services#mms-converter) for messages sent through the Service instance. + * @return $this Fluent Builder + */ + public function setMmsConverter(bool $mmsConverter): self + { + $this->options['mmsConverter'] = $mmsConverter; + return $this; + } + + /** + * Whether to enable [Smart Encoding](https://www.twilio.com/docs/sms/services#smart-encoding) for messages sent through the Service instance. + * + * @param bool $smartEncoding Whether to enable [Smart Encoding](https://www.twilio.com/docs/sms/services#smart-encoding) for messages sent through the Service instance. + * @return $this Fluent Builder + */ + public function setSmartEncoding(bool $smartEncoding): self + { + $this->options['smartEncoding'] = $smartEncoding; + return $this; + } + + /** + * @param string $scanMessageContent + * @return $this Fluent Builder + */ + public function setScanMessageContent(string $scanMessageContent): self + { + $this->options['scanMessageContent'] = $scanMessageContent; + return $this; + } + + /** + * Whether to enable [Fallback to Long Code](https://www.twilio.com/docs/sms/services#fallback-to-long-code) for messages sent through the Service instance. + * + * @param bool $fallbackToLongCode Whether to enable [Fallback to Long Code](https://www.twilio.com/docs/sms/services#fallback-to-long-code) for messages sent through the Service instance. + * @return $this Fluent Builder + */ + public function setFallbackToLongCode(bool $fallbackToLongCode): self + { + $this->options['fallbackToLongCode'] = $fallbackToLongCode; + return $this; + } + + /** + * Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/sms/services#area-code-geomatch) on the Service Instance. + * + * @param bool $areaCodeGeomatch Whether to enable [Area Code Geomatch](https://www.twilio.com/docs/sms/services#area-code-geomatch) on the Service Instance. + * @return $this Fluent Builder + */ + public function setAreaCodeGeomatch(bool $areaCodeGeomatch): self + { + $this->options['areaCodeGeomatch'] = $areaCodeGeomatch; + return $this; + } + + /** + * How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. + * + * @param int $validityPeriod How long, in seconds, messages sent from the Service are valid. Can be an integer from `1` to `14,400`. + * @return $this Fluent Builder + */ + public function setValidityPeriod(int $validityPeriod): self + { + $this->options['validityPeriod'] = $validityPeriod; + return $this; + } + + /** + * Reserved. + * + * @param bool $synchronousValidation Reserved. + * @return $this Fluent Builder + */ + public function setSynchronousValidation(bool $synchronousValidation): self + { + $this->options['synchronousValidation'] = $synchronousValidation; + return $this; + } + + /** + * A string that describes the scenario in which the Messaging Service will be used. Examples: [notification, marketing, verification, poll ..] + * + * @param string $usecase A string that describes the scenario in which the Messaging Service will be used. Examples: [notification, marketing, verification, poll ..] + * @return $this Fluent Builder + */ + public function setUsecase(string $usecase): self + { + $this->options['usecase'] = $usecase; + return $this; + } + + /** + * A boolean value that indicates either the webhook url configured on the phone number will be used or `inbound_request_url`/`fallback_url` url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the `inbound_request_url`/`fallback_url` defined for the Messaging Service. + * + * @param bool $useInboundWebhookOnNumber A boolean value that indicates either the webhook url configured on the phone number will be used or `inbound_request_url`/`fallback_url` url will be called when a message is received from the phone number. If this field is enabled then the webhook url defined on the phone number will override the `inbound_request_url`/`fallback_url` defined for the Messaging Service. + * @return $this Fluent Builder + */ + public function setUseInboundWebhookOnNumber(bool $useInboundWebhookOnNumber): self + { + $this->options['useInboundWebhookOnNumber'] = $useInboundWebhookOnNumber; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Messaging.V1.UpdateServiceOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Messaging/V1/ServicePage.php b/app/api/Twilio/Rest/Messaging/V1/ServicePage.php new file mode 100755 index 0000000..d888989 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/ServicePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ServiceInstance \Twilio\Rest\Messaging\V1\ServiceInstance + */ + public function buildInstance(array $payload): ServiceInstance + { + return new ServiceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.ServicePage]'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/TollfreeVerificationContext.php b/app/api/Twilio/Rest/Messaging/V1/TollfreeVerificationContext.php new file mode 100755 index 0000000..ab8a107 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/TollfreeVerificationContext.php @@ -0,0 +1,149 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Tollfree/Verifications/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the TollfreeVerificationInstance + * + * @return TollfreeVerificationInstance Fetched TollfreeVerificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TollfreeVerificationInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new TollfreeVerificationInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the TollfreeVerificationInstance + * + * @param array|Options $options Optional Arguments + * @return TollfreeVerificationInstance Updated TollfreeVerificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TollfreeVerificationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'BusinessName' => + $options['businessName'], + 'BusinessWebsite' => + $options['businessWebsite'], + 'NotificationEmail' => + $options['notificationEmail'], + 'UseCaseCategories' => + Serialize::map($options['useCaseCategories'], function ($e) { return $e; }), + 'UseCaseSummary' => + $options['useCaseSummary'], + 'ProductionMessageSample' => + $options['productionMessageSample'], + 'OptInImageUrls' => + Serialize::map($options['optInImageUrls'], function ($e) { return $e; }), + 'OptInType' => + $options['optInType'], + 'MessageVolume' => + $options['messageVolume'], + 'BusinessStreetAddress' => + $options['businessStreetAddress'], + 'BusinessStreetAddress2' => + $options['businessStreetAddress2'], + 'BusinessCity' => + $options['businessCity'], + 'BusinessStateProvinceRegion' => + $options['businessStateProvinceRegion'], + 'BusinessPostalCode' => + $options['businessPostalCode'], + 'BusinessCountry' => + $options['businessCountry'], + 'AdditionalInformation' => + $options['additionalInformation'], + 'BusinessContactFirstName' => + $options['businessContactFirstName'], + 'BusinessContactLastName' => + $options['businessContactLastName'], + 'BusinessContactEmail' => + $options['businessContactEmail'], + 'BusinessContactPhone' => + $options['businessContactPhone'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new TollfreeVerificationInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.TollfreeVerificationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/TollfreeVerificationInstance.php b/app/api/Twilio/Rest/Messaging/V1/TollfreeVerificationInstance.php new file mode 100755 index 0000000..1763c03 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/TollfreeVerificationInstance.php @@ -0,0 +1,192 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'customerProfileSid' => Values::array_get($payload, 'customer_profile_sid'), + 'trustProductSid' => Values::array_get($payload, 'trust_product_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'regulatedItemSid' => Values::array_get($payload, 'regulated_item_sid'), + 'businessName' => Values::array_get($payload, 'business_name'), + 'businessStreetAddress' => Values::array_get($payload, 'business_street_address'), + 'businessStreetAddress2' => Values::array_get($payload, 'business_street_address2'), + 'businessCity' => Values::array_get($payload, 'business_city'), + 'businessStateProvinceRegion' => Values::array_get($payload, 'business_state_province_region'), + 'businessPostalCode' => Values::array_get($payload, 'business_postal_code'), + 'businessCountry' => Values::array_get($payload, 'business_country'), + 'businessWebsite' => Values::array_get($payload, 'business_website'), + 'businessContactFirstName' => Values::array_get($payload, 'business_contact_first_name'), + 'businessContactLastName' => Values::array_get($payload, 'business_contact_last_name'), + 'businessContactEmail' => Values::array_get($payload, 'business_contact_email'), + 'businessContactPhone' => Values::array_get($payload, 'business_contact_phone'), + 'notificationEmail' => Values::array_get($payload, 'notification_email'), + 'useCaseCategories' => Values::array_get($payload, 'use_case_categories'), + 'useCaseSummary' => Values::array_get($payload, 'use_case_summary'), + 'productionMessageSample' => Values::array_get($payload, 'production_message_sample'), + 'optInImageUrls' => Values::array_get($payload, 'opt_in_image_urls'), + 'optInType' => Values::array_get($payload, 'opt_in_type'), + 'messageVolume' => Values::array_get($payload, 'message_volume'), + 'additionalInformation' => Values::array_get($payload, 'additional_information'), + 'tollfreePhoneNumberSid' => Values::array_get($payload, 'tollfree_phone_number_sid'), + 'status' => Values::array_get($payload, 'status'), + 'url' => Values::array_get($payload, 'url'), + 'resourceLinks' => Values::array_get($payload, 'resource_links'), + 'externalReferenceId' => Values::array_get($payload, 'external_reference_id'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return TollfreeVerificationContext Context for this TollfreeVerificationInstance + */ + protected function proxy(): TollfreeVerificationContext + { + if (!$this->context) { + $this->context = new TollfreeVerificationContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the TollfreeVerificationInstance + * + * @return TollfreeVerificationInstance Fetched TollfreeVerificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TollfreeVerificationInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the TollfreeVerificationInstance + * + * @param array|Options $options Optional Arguments + * @return TollfreeVerificationInstance Updated TollfreeVerificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TollfreeVerificationInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Messaging.V1.TollfreeVerificationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Messaging/V1/TollfreeVerificationList.php b/app/api/Twilio/Rest/Messaging/V1/TollfreeVerificationList.php new file mode 100755 index 0000000..971327f --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/TollfreeVerificationList.php @@ -0,0 +1,252 @@ +solution = [ + ]; + + $this->uri = '/Tollfree/Verifications'; + } + + /** + * Create the TollfreeVerificationInstance + * + * @param string $businessName The name of the business or organization using the Tollfree number. + * @param string $businessWebsite The website of the business or organization using the Tollfree number. + * @param string $notificationEmail The email address to receive the notification about the verification result. . + * @param string[] $useCaseCategories The category of the use case for the Tollfree Number. List as many are applicable.. + * @param string $useCaseSummary Use this to further explain how messaging is used by the business or organization. + * @param string $productionMessageSample An example of message content, i.e. a sample message. + * @param string[] $optInImageUrls Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. + * @param string $optInType + * @param string $messageVolume Estimate monthly volume of messages from the Tollfree Number. + * @param string $tollfreePhoneNumberSid The SID of the Phone Number associated with the Tollfree Verification. + * @param array|Options $options Optional Arguments + * @return TollfreeVerificationInstance Created TollfreeVerificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $businessName, string $businessWebsite, string $notificationEmail, array $useCaseCategories, string $useCaseSummary, string $productionMessageSample, array $optInImageUrls, string $optInType, string $messageVolume, string $tollfreePhoneNumberSid, array $options = []): TollfreeVerificationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'BusinessName' => + $businessName, + 'BusinessWebsite' => + $businessWebsite, + 'NotificationEmail' => + $notificationEmail, + 'UseCaseCategories' => + Serialize::map($useCaseCategories,function ($e) { return $e; }), + 'UseCaseSummary' => + $useCaseSummary, + 'ProductionMessageSample' => + $productionMessageSample, + 'OptInImageUrls' => + Serialize::map($optInImageUrls,function ($e) { return $e; }), + 'OptInType' => + $optInType, + 'MessageVolume' => + $messageVolume, + 'TollfreePhoneNumberSid' => + $tollfreePhoneNumberSid, + 'CustomerProfileSid' => + $options['customerProfileSid'], + 'BusinessStreetAddress' => + $options['businessStreetAddress'], + 'BusinessStreetAddress2' => + $options['businessStreetAddress2'], + 'BusinessCity' => + $options['businessCity'], + 'BusinessStateProvinceRegion' => + $options['businessStateProvinceRegion'], + 'BusinessPostalCode' => + $options['businessPostalCode'], + 'BusinessCountry' => + $options['businessCountry'], + 'AdditionalInformation' => + $options['additionalInformation'], + 'BusinessContactFirstName' => + $options['businessContactFirstName'], + 'BusinessContactLastName' => + $options['businessContactLastName'], + 'BusinessContactEmail' => + $options['businessContactEmail'], + 'BusinessContactPhone' => + $options['businessContactPhone'], + 'ExternalReferenceId' => + $options['externalReferenceId'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new TollfreeVerificationInstance( + $this->version, + $payload + ); + } + + + /** + * Reads TollfreeVerificationInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return TollfreeVerificationInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams TollfreeVerificationInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of TollfreeVerificationInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return TollfreeVerificationPage Page of TollfreeVerificationInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): TollfreeVerificationPage + { + $options = new Values($options); + + $params = Values::of([ + 'TollfreePhoneNumberSid' => + $options['tollfreePhoneNumberSid'], + 'Status' => + $options['status'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new TollfreeVerificationPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of TollfreeVerificationInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return TollfreeVerificationPage Page of TollfreeVerificationInstance + */ + public function getPage(string $targetUrl): TollfreeVerificationPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new TollfreeVerificationPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a TollfreeVerificationContext + * + * @param string $sid The unique string to identify Tollfree Verification. + */ + public function getContext( + string $sid + + ): TollfreeVerificationContext + { + return new TollfreeVerificationContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.TollfreeVerificationList]'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/TollfreeVerificationOptions.php b/app/api/Twilio/Rest/Messaging/V1/TollfreeVerificationOptions.php new file mode 100755 index 0000000..53e2279 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/TollfreeVerificationOptions.php @@ -0,0 +1,756 @@ +options['customerProfileSid'] = $customerProfileSid; + $this->options['businessStreetAddress'] = $businessStreetAddress; + $this->options['businessStreetAddress2'] = $businessStreetAddress2; + $this->options['businessCity'] = $businessCity; + $this->options['businessStateProvinceRegion'] = $businessStateProvinceRegion; + $this->options['businessPostalCode'] = $businessPostalCode; + $this->options['businessCountry'] = $businessCountry; + $this->options['additionalInformation'] = $additionalInformation; + $this->options['businessContactFirstName'] = $businessContactFirstName; + $this->options['businessContactLastName'] = $businessContactLastName; + $this->options['businessContactEmail'] = $businessContactEmail; + $this->options['businessContactPhone'] = $businessContactPhone; + $this->options['externalReferenceId'] = $externalReferenceId; + } + + /** + * Customer's Profile Bundle BundleSid. + * + * @param string $customerProfileSid Customer's Profile Bundle BundleSid. + * @return $this Fluent Builder + */ + public function setCustomerProfileSid(string $customerProfileSid): self + { + $this->options['customerProfileSid'] = $customerProfileSid; + return $this; + } + + /** + * The address of the business or organization using the Tollfree number. + * + * @param string $businessStreetAddress The address of the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessStreetAddress(string $businessStreetAddress): self + { + $this->options['businessStreetAddress'] = $businessStreetAddress; + return $this; + } + + /** + * The address of the business or organization using the Tollfree number. + * + * @param string $businessStreetAddress2 The address of the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessStreetAddress2(string $businessStreetAddress2): self + { + $this->options['businessStreetAddress2'] = $businessStreetAddress2; + return $this; + } + + /** + * The city of the business or organization using the Tollfree number. + * + * @param string $businessCity The city of the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessCity(string $businessCity): self + { + $this->options['businessCity'] = $businessCity; + return $this; + } + + /** + * The state/province/region of the business or organization using the Tollfree number. + * + * @param string $businessStateProvinceRegion The state/province/region of the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessStateProvinceRegion(string $businessStateProvinceRegion): self + { + $this->options['businessStateProvinceRegion'] = $businessStateProvinceRegion; + return $this; + } + + /** + * The postal code of the business or organization using the Tollfree number. + * + * @param string $businessPostalCode The postal code of the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessPostalCode(string $businessPostalCode): self + { + $this->options['businessPostalCode'] = $businessPostalCode; + return $this; + } + + /** + * The country of the business or organization using the Tollfree number. + * + * @param string $businessCountry The country of the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessCountry(string $businessCountry): self + { + $this->options['businessCountry'] = $businessCountry; + return $this; + } + + /** + * Additional information to be provided for verification. + * + * @param string $additionalInformation Additional information to be provided for verification. + * @return $this Fluent Builder + */ + public function setAdditionalInformation(string $additionalInformation): self + { + $this->options['additionalInformation'] = $additionalInformation; + return $this; + } + + /** + * The first name of the contact for the business or organization using the Tollfree number. + * + * @param string $businessContactFirstName The first name of the contact for the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessContactFirstName(string $businessContactFirstName): self + { + $this->options['businessContactFirstName'] = $businessContactFirstName; + return $this; + } + + /** + * The last name of the contact for the business or organization using the Tollfree number. + * + * @param string $businessContactLastName The last name of the contact for the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessContactLastName(string $businessContactLastName): self + { + $this->options['businessContactLastName'] = $businessContactLastName; + return $this; + } + + /** + * The email address of the contact for the business or organization using the Tollfree number. + * + * @param string $businessContactEmail The email address of the contact for the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessContactEmail(string $businessContactEmail): self + { + $this->options['businessContactEmail'] = $businessContactEmail; + return $this; + } + + /** + * The phone number of the contact for the business or organization using the Tollfree number. + * + * @param string $businessContactPhone The phone number of the contact for the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessContactPhone(string $businessContactPhone): self + { + $this->options['businessContactPhone'] = $businessContactPhone; + return $this; + } + + /** + * An optional external reference ID supplied by customer and echoed back on status retrieval. + * + * @param string $externalReferenceId An optional external reference ID supplied by customer and echoed back on status retrieval. + * @return $this Fluent Builder + */ + public function setExternalReferenceId(string $externalReferenceId): self + { + $this->options['externalReferenceId'] = $externalReferenceId; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Messaging.V1.CreateTollfreeVerificationOptions ' . $options . ']'; + } +} + + +class ReadTollfreeVerificationOptions extends Options + { + /** + * @param string $tollfreePhoneNumberSid The SID of the Phone Number associated with the Tollfree Verification. + * @param string $status The compliance status of the Tollfree Verification record. + */ + public function __construct( + + string $tollfreePhoneNumberSid = Values::NONE, + string $status = Values::NONE + + ) { + $this->options['tollfreePhoneNumberSid'] = $tollfreePhoneNumberSid; + $this->options['status'] = $status; + } + + /** + * The SID of the Phone Number associated with the Tollfree Verification. + * + * @param string $tollfreePhoneNumberSid The SID of the Phone Number associated with the Tollfree Verification. + * @return $this Fluent Builder + */ + public function setTollfreePhoneNumberSid(string $tollfreePhoneNumberSid): self + { + $this->options['tollfreePhoneNumberSid'] = $tollfreePhoneNumberSid; + return $this; + } + + /** + * The compliance status of the Tollfree Verification record. + * + * @param string $status The compliance status of the Tollfree Verification record. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Messaging.V1.ReadTollfreeVerificationOptions ' . $options . ']'; + } +} + +class UpdateTollfreeVerificationOptions extends Options + { + /** + * @param string $businessName The name of the business or organization using the Tollfree number. + * @param string $businessWebsite The website of the business or organization using the Tollfree number. + * @param string $notificationEmail The email address to receive the notification about the verification result. . + * @param string[] $useCaseCategories The category of the use case for the Tollfree Number. List as many are applicable.. + * @param string $useCaseSummary Use this to further explain how messaging is used by the business or organization. + * @param string $productionMessageSample An example of message content, i.e. a sample message. + * @param string[] $optInImageUrls Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. + * @param string $optInType + * @param string $messageVolume Estimate monthly volume of messages from the Tollfree Number. + * @param string $businessStreetAddress The address of the business or organization using the Tollfree number. + * @param string $businessStreetAddress2 The address of the business or organization using the Tollfree number. + * @param string $businessCity The city of the business or organization using the Tollfree number. + * @param string $businessStateProvinceRegion The state/province/region of the business or organization using the Tollfree number. + * @param string $businessPostalCode The postal code of the business or organization using the Tollfree number. + * @param string $businessCountry The country of the business or organization using the Tollfree number. + * @param string $additionalInformation Additional information to be provided for verification. + * @param string $businessContactFirstName The first name of the contact for the business or organization using the Tollfree number. + * @param string $businessContactLastName The last name of the contact for the business or organization using the Tollfree number. + * @param string $businessContactEmail The email address of the contact for the business or organization using the Tollfree number. + * @param string $businessContactPhone The phone number of the contact for the business or organization using the Tollfree number. + */ + public function __construct( + + string $businessName = Values::NONE, + string $businessWebsite = Values::NONE, + string $notificationEmail = Values::NONE, + array $useCaseCategories = Values::ARRAY_NONE, + string $useCaseSummary = Values::NONE, + string $productionMessageSample = Values::NONE, + array $optInImageUrls = Values::ARRAY_NONE, + string $optInType = Values::NONE, + string $messageVolume = Values::NONE, + string $businessStreetAddress = Values::NONE, + string $businessStreetAddress2 = Values::NONE, + string $businessCity = Values::NONE, + string $businessStateProvinceRegion = Values::NONE, + string $businessPostalCode = Values::NONE, + string $businessCountry = Values::NONE, + string $additionalInformation = Values::NONE, + string $businessContactFirstName = Values::NONE, + string $businessContactLastName = Values::NONE, + string $businessContactEmail = Values::NONE, + string $businessContactPhone = Values::NONE + + ) { + $this->options['businessName'] = $businessName; + $this->options['businessWebsite'] = $businessWebsite; + $this->options['notificationEmail'] = $notificationEmail; + $this->options['useCaseCategories'] = $useCaseCategories; + $this->options['useCaseSummary'] = $useCaseSummary; + $this->options['productionMessageSample'] = $productionMessageSample; + $this->options['optInImageUrls'] = $optInImageUrls; + $this->options['optInType'] = $optInType; + $this->options['messageVolume'] = $messageVolume; + $this->options['businessStreetAddress'] = $businessStreetAddress; + $this->options['businessStreetAddress2'] = $businessStreetAddress2; + $this->options['businessCity'] = $businessCity; + $this->options['businessStateProvinceRegion'] = $businessStateProvinceRegion; + $this->options['businessPostalCode'] = $businessPostalCode; + $this->options['businessCountry'] = $businessCountry; + $this->options['additionalInformation'] = $additionalInformation; + $this->options['businessContactFirstName'] = $businessContactFirstName; + $this->options['businessContactLastName'] = $businessContactLastName; + $this->options['businessContactEmail'] = $businessContactEmail; + $this->options['businessContactPhone'] = $businessContactPhone; + } + + /** + * The name of the business or organization using the Tollfree number. + * + * @param string $businessName The name of the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessName(string $businessName): self + { + $this->options['businessName'] = $businessName; + return $this; + } + + /** + * The website of the business or organization using the Tollfree number. + * + * @param string $businessWebsite The website of the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessWebsite(string $businessWebsite): self + { + $this->options['businessWebsite'] = $businessWebsite; + return $this; + } + + /** + * The email address to receive the notification about the verification result. . + * + * @param string $notificationEmail The email address to receive the notification about the verification result. . + * @return $this Fluent Builder + */ + public function setNotificationEmail(string $notificationEmail): self + { + $this->options['notificationEmail'] = $notificationEmail; + return $this; + } + + /** + * The category of the use case for the Tollfree Number. List as many are applicable.. + * + * @param string[] $useCaseCategories The category of the use case for the Tollfree Number. List as many are applicable.. + * @return $this Fluent Builder + */ + public function setUseCaseCategories(array $useCaseCategories): self + { + $this->options['useCaseCategories'] = $useCaseCategories; + return $this; + } + + /** + * Use this to further explain how messaging is used by the business or organization. + * + * @param string $useCaseSummary Use this to further explain how messaging is used by the business or organization. + * @return $this Fluent Builder + */ + public function setUseCaseSummary(string $useCaseSummary): self + { + $this->options['useCaseSummary'] = $useCaseSummary; + return $this; + } + + /** + * An example of message content, i.e. a sample message. + * + * @param string $productionMessageSample An example of message content, i.e. a sample message. + * @return $this Fluent Builder + */ + public function setProductionMessageSample(string $productionMessageSample): self + { + $this->options['productionMessageSample'] = $productionMessageSample; + return $this; + } + + /** + * Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. + * + * @param string[] $optInImageUrls Link to an image that shows the opt-in workflow. Multiple images allowed and must be a publicly hosted URL. + * @return $this Fluent Builder + */ + public function setOptInImageUrls(array $optInImageUrls): self + { + $this->options['optInImageUrls'] = $optInImageUrls; + return $this; + } + + /** + * @param string $optInType + * @return $this Fluent Builder + */ + public function setOptInType(string $optInType): self + { + $this->options['optInType'] = $optInType; + return $this; + } + + /** + * Estimate monthly volume of messages from the Tollfree Number. + * + * @param string $messageVolume Estimate monthly volume of messages from the Tollfree Number. + * @return $this Fluent Builder + */ + public function setMessageVolume(string $messageVolume): self + { + $this->options['messageVolume'] = $messageVolume; + return $this; + } + + /** + * The address of the business or organization using the Tollfree number. + * + * @param string $businessStreetAddress The address of the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessStreetAddress(string $businessStreetAddress): self + { + $this->options['businessStreetAddress'] = $businessStreetAddress; + return $this; + } + + /** + * The address of the business or organization using the Tollfree number. + * + * @param string $businessStreetAddress2 The address of the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessStreetAddress2(string $businessStreetAddress2): self + { + $this->options['businessStreetAddress2'] = $businessStreetAddress2; + return $this; + } + + /** + * The city of the business or organization using the Tollfree number. + * + * @param string $businessCity The city of the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessCity(string $businessCity): self + { + $this->options['businessCity'] = $businessCity; + return $this; + } + + /** + * The state/province/region of the business or organization using the Tollfree number. + * + * @param string $businessStateProvinceRegion The state/province/region of the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessStateProvinceRegion(string $businessStateProvinceRegion): self + { + $this->options['businessStateProvinceRegion'] = $businessStateProvinceRegion; + return $this; + } + + /** + * The postal code of the business or organization using the Tollfree number. + * + * @param string $businessPostalCode The postal code of the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessPostalCode(string $businessPostalCode): self + { + $this->options['businessPostalCode'] = $businessPostalCode; + return $this; + } + + /** + * The country of the business or organization using the Tollfree number. + * + * @param string $businessCountry The country of the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessCountry(string $businessCountry): self + { + $this->options['businessCountry'] = $businessCountry; + return $this; + } + + /** + * Additional information to be provided for verification. + * + * @param string $additionalInformation Additional information to be provided for verification. + * @return $this Fluent Builder + */ + public function setAdditionalInformation(string $additionalInformation): self + { + $this->options['additionalInformation'] = $additionalInformation; + return $this; + } + + /** + * The first name of the contact for the business or organization using the Tollfree number. + * + * @param string $businessContactFirstName The first name of the contact for the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessContactFirstName(string $businessContactFirstName): self + { + $this->options['businessContactFirstName'] = $businessContactFirstName; + return $this; + } + + /** + * The last name of the contact for the business or organization using the Tollfree number. + * + * @param string $businessContactLastName The last name of the contact for the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessContactLastName(string $businessContactLastName): self + { + $this->options['businessContactLastName'] = $businessContactLastName; + return $this; + } + + /** + * The email address of the contact for the business or organization using the Tollfree number. + * + * @param string $businessContactEmail The email address of the contact for the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessContactEmail(string $businessContactEmail): self + { + $this->options['businessContactEmail'] = $businessContactEmail; + return $this; + } + + /** + * The phone number of the contact for the business or organization using the Tollfree number. + * + * @param string $businessContactPhone The phone number of the contact for the business or organization using the Tollfree number. + * @return $this Fluent Builder + */ + public function setBusinessContactPhone(string $businessContactPhone): self + { + $this->options['businessContactPhone'] = $businessContactPhone; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Messaging.V1.UpdateTollfreeVerificationOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Messaging/V1/TollfreeVerificationPage.php b/app/api/Twilio/Rest/Messaging/V1/TollfreeVerificationPage.php new file mode 100755 index 0000000..19636ce --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/TollfreeVerificationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TollfreeVerificationInstance \Twilio\Rest\Messaging\V1\TollfreeVerificationInstance + */ + public function buildInstance(array $payload): TollfreeVerificationInstance + { + return new TollfreeVerificationInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.TollfreeVerificationPage]'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/UsecaseInstance.php b/app/api/Twilio/Rest/Messaging/V1/UsecaseInstance.php new file mode 100755 index 0000000..6043e61 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/UsecaseInstance.php @@ -0,0 +1,80 @@ +properties = [ + 'usecases' => Values::array_get($payload, 'usecases'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.UsecaseInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Messaging/V1/UsecaseList.php b/app/api/Twilio/Rest/Messaging/V1/UsecaseList.php new file mode 100755 index 0000000..61dc995 --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/UsecaseList.php @@ -0,0 +1,70 @@ +solution = [ + ]; + + $this->uri = '/Services/Usecases'; + } + + /** + * Fetch the UsecaseInstance + * + * @return UsecaseInstance Fetched UsecaseInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UsecaseInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new UsecaseInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.UsecaseList]'; + } +} diff --git a/app/api/Twilio/Rest/Messaging/V1/UsecasePage.php b/app/api/Twilio/Rest/Messaging/V1/UsecasePage.php new file mode 100755 index 0000000..a1a893d --- /dev/null +++ b/app/api/Twilio/Rest/Messaging/V1/UsecasePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UsecaseInstance \Twilio\Rest\Messaging\V1\UsecaseInstance + */ + public function buildInstance(array $payload): UsecaseInstance + { + return new UsecaseInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Messaging.V1.UsecasePage]'; + } +} diff --git a/app/api/Twilio/Rest/MessagingBase.php b/app/api/Twilio/Rest/MessagingBase.php new file mode 100755 index 0000000..b8318ec --- /dev/null +++ b/app/api/Twilio/Rest/MessagingBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://messaging.twilio.com'; + } + + + /** + * @return V1 Version v1 of messaging + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Messaging]'; + } +} diff --git a/app/api/Twilio/Rest/Microvisor.php b/app/api/Twilio/Rest/Microvisor.php new file mode 100755 index 0000000..6d5e56e --- /dev/null +++ b/app/api/Twilio/Rest/Microvisor.php @@ -0,0 +1,42 @@ +apps instead. + */ + protected function getApps(): \Twilio\Rest\Microvisor\V1\AppList { + echo "apps is deprecated. Use v1->apps instead."; + return $this->v1->apps; + } + + /** + * @deprecated Use v1->apps(\$sid) instead. + * @param string $sid A string that uniquely identifies this App. + */ + protected function contextApps(string $sid): \Twilio\Rest\Microvisor\V1\AppContext { + echo "apps(\$sid) is deprecated. Use v1->apps(\$sid) instead."; + return $this->v1->apps($sid); + } + + /** + * @deprecated Use v1->devices instead. + */ + protected function getDevices(): \Twilio\Rest\Microvisor\V1\DeviceList { + echo "devices is deprecated. Use v1->devices instead."; + return $this->v1->devices; + } + + /** + * @deprecated Use v1->devices(\$sid) instead. + * @param string $sid A string that uniquely identifies this Device. + */ + protected function contextDevices(string $sid): \Twilio\Rest\Microvisor\V1\DeviceContext { + echo "devices(\$sid) is deprecated. Use v1->devices(\$sid) instead."; + return $this->v1->devices($sid); + } +} \ No newline at end of file diff --git a/app/api/Twilio/Rest/Microvisor/V1.php b/app/api/Twilio/Rest/Microvisor/V1.php new file mode 100755 index 0000000..2de63bb --- /dev/null +++ b/app/api/Twilio/Rest/Microvisor/V1.php @@ -0,0 +1,131 @@ +version = 'v1'; + } + + protected function getAccountConfigs(): AccountConfigList + { + if (!$this->_accountConfigs) { + $this->_accountConfigs = new AccountConfigList($this); + } + return $this->_accountConfigs; + } + + protected function getAccountSecrets(): AccountSecretList + { + if (!$this->_accountSecrets) { + $this->_accountSecrets = new AccountSecretList($this); + } + return $this->_accountSecrets; + } + + protected function getApps(): AppList + { + if (!$this->_apps) { + $this->_apps = new AppList($this); + } + return $this->_apps; + } + + protected function getDevices(): DeviceList + { + if (!$this->_devices) { + $this->_devices = new DeviceList($this); + } + return $this->_devices; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Microvisor.V1]'; + } +} diff --git a/app/api/Twilio/Rest/Microvisor/V1/AccountConfigContext.php b/app/api/Twilio/Rest/Microvisor/V1/AccountConfigContext.php new file mode 100755 index 0000000..92cd96f --- /dev/null +++ b/app/api/Twilio/Rest/Microvisor/V1/AccountConfigContext.php @@ -0,0 +1,120 @@ +solution = [ + 'key' => + $key, + ]; + + $this->uri = '/Configs/' . \rawurlencode($key) + .''; + } + + /** + * Delete the AccountConfigInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the AccountConfigInstance + * + * @return AccountConfigInstance Fetched AccountConfigInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AccountConfigInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new AccountConfigInstance( + $this->version, + $payload, + $this->solution['key'] + ); + } + + + /** + * Update the AccountConfigInstance + * + * @param string $value The config value; up to 4096 characters. + * @return AccountConfigInstance Updated AccountConfigInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $value): AccountConfigInstance + { + + $data = Values::of([ + 'Value' => + $value, + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new AccountConfigInstance( + $this->version, + $payload, + $this->solution['key'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Microvisor.V1.AccountConfigContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Microvisor/V1/AccountConfigInstance.php b/app/api/Twilio/Rest/Microvisor/V1/AccountConfigInstance.php new file mode 100755 index 0000000..bd58b93 --- /dev/null +++ b/app/api/Twilio/Rest/Microvisor/V1/AccountConfigInstance.php @@ -0,0 +1,147 @@ +properties = [ + 'key' => Values::array_get($payload, 'key'), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'value' => Values::array_get($payload, 'value'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['key' => $key ?: $this->properties['key'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AccountConfigContext Context for this AccountConfigInstance + */ + protected function proxy(): AccountConfigContext + { + if (!$this->context) { + $this->context = new AccountConfigContext( + $this->version, + $this->solution['key'] + ); + } + + return $this->context; + } + + /** + * Delete the AccountConfigInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the AccountConfigInstance + * + * @return AccountConfigInstance Fetched AccountConfigInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AccountConfigInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the AccountConfigInstance + * + * @param string $value The config value; up to 4096 characters. + * @return AccountConfigInstance Updated AccountConfigInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $value): AccountConfigInstance + { + + return $this->proxy()->update($value); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Microvisor.V1.AccountConfigInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Microvisor/V1/AccountConfigList.php b/app/api/Twilio/Rest/Microvisor/V1/AccountConfigList.php new file mode 100755 index 0000000..1a81b85 --- /dev/null +++ b/app/api/Twilio/Rest/Microvisor/V1/AccountConfigList.php @@ -0,0 +1,189 @@ +solution = [ + ]; + + $this->uri = '/Configs'; + } + + /** + * Create the AccountConfigInstance + * + * @param string $key The config key; up to 100 characters. + * @param string $value The config value; up to 4096 characters. + * @return AccountConfigInstance Created AccountConfigInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $key, string $value): AccountConfigInstance + { + + $data = Values::of([ + 'Key' => + $key, + 'Value' => + $value, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new AccountConfigInstance( + $this->version, + $payload + ); + } + + + /** + * Reads AccountConfigInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return AccountConfigInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams AccountConfigInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AccountConfigInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return AccountConfigPage Page of AccountConfigInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AccountConfigPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new AccountConfigPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of AccountConfigInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return AccountConfigPage Page of AccountConfigInstance + */ + public function getPage(string $targetUrl): AccountConfigPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AccountConfigPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AccountConfigContext + * + * @param string $key The config key; up to 100 characters. + */ + public function getContext( + string $key + + ): AccountConfigContext + { + return new AccountConfigContext( + $this->version, + $key + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Microvisor.V1.AccountConfigList]'; + } +} diff --git a/app/api/Twilio/Rest/Microvisor/V1/AccountConfigPage.php b/app/api/Twilio/Rest/Microvisor/V1/AccountConfigPage.php new file mode 100755 index 0000000..d01e97d --- /dev/null +++ b/app/api/Twilio/Rest/Microvisor/V1/AccountConfigPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AccountConfigInstance \Twilio\Rest\Microvisor\V1\AccountConfigInstance + */ + public function buildInstance(array $payload): AccountConfigInstance + { + return new AccountConfigInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Microvisor.V1.AccountConfigPage]'; + } +} diff --git a/app/api/Twilio/Rest/Microvisor/V1/AccountSecretContext.php b/app/api/Twilio/Rest/Microvisor/V1/AccountSecretContext.php new file mode 100755 index 0000000..b7c5d74 --- /dev/null +++ b/app/api/Twilio/Rest/Microvisor/V1/AccountSecretContext.php @@ -0,0 +1,120 @@ +solution = [ + 'key' => + $key, + ]; + + $this->uri = '/Secrets/' . \rawurlencode($key) + .''; + } + + /** + * Delete the AccountSecretInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the AccountSecretInstance + * + * @return AccountSecretInstance Fetched AccountSecretInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AccountSecretInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new AccountSecretInstance( + $this->version, + $payload, + $this->solution['key'] + ); + } + + + /** + * Update the AccountSecretInstance + * + * @param string $value The secret value; up to 4096 characters. + * @return AccountSecretInstance Updated AccountSecretInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $value): AccountSecretInstance + { + + $data = Values::of([ + 'Value' => + $value, + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new AccountSecretInstance( + $this->version, + $payload, + $this->solution['key'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Microvisor.V1.AccountSecretContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Microvisor/V1/AccountSecretInstance.php b/app/api/Twilio/Rest/Microvisor/V1/AccountSecretInstance.php new file mode 100755 index 0000000..34621e9 --- /dev/null +++ b/app/api/Twilio/Rest/Microvisor/V1/AccountSecretInstance.php @@ -0,0 +1,145 @@ +properties = [ + 'key' => Values::array_get($payload, 'key'), + 'dateRotated' => Deserialize::dateTime(Values::array_get($payload, 'date_rotated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['key' => $key ?: $this->properties['key'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AccountSecretContext Context for this AccountSecretInstance + */ + protected function proxy(): AccountSecretContext + { + if (!$this->context) { + $this->context = new AccountSecretContext( + $this->version, + $this->solution['key'] + ); + } + + return $this->context; + } + + /** + * Delete the AccountSecretInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the AccountSecretInstance + * + * @return AccountSecretInstance Fetched AccountSecretInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AccountSecretInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the AccountSecretInstance + * + * @param string $value The secret value; up to 4096 characters. + * @return AccountSecretInstance Updated AccountSecretInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $value): AccountSecretInstance + { + + return $this->proxy()->update($value); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Microvisor.V1.AccountSecretInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Microvisor/V1/AccountSecretList.php b/app/api/Twilio/Rest/Microvisor/V1/AccountSecretList.php new file mode 100755 index 0000000..60361f6 --- /dev/null +++ b/app/api/Twilio/Rest/Microvisor/V1/AccountSecretList.php @@ -0,0 +1,189 @@ +solution = [ + ]; + + $this->uri = '/Secrets'; + } + + /** + * Create the AccountSecretInstance + * + * @param string $key The secret key; up to 100 characters. + * @param string $value The secret value; up to 4096 characters. + * @return AccountSecretInstance Created AccountSecretInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $key, string $value): AccountSecretInstance + { + + $data = Values::of([ + 'Key' => + $key, + 'Value' => + $value, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new AccountSecretInstance( + $this->version, + $payload + ); + } + + + /** + * Reads AccountSecretInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return AccountSecretInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams AccountSecretInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AccountSecretInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return AccountSecretPage Page of AccountSecretInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AccountSecretPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new AccountSecretPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of AccountSecretInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return AccountSecretPage Page of AccountSecretInstance + */ + public function getPage(string $targetUrl): AccountSecretPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AccountSecretPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AccountSecretContext + * + * @param string $key The secret key; up to 100 characters. + */ + public function getContext( + string $key + + ): AccountSecretContext + { + return new AccountSecretContext( + $this->version, + $key + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Microvisor.V1.AccountSecretList]'; + } +} diff --git a/app/api/Twilio/Rest/Microvisor/V1/AccountSecretPage.php b/app/api/Twilio/Rest/Microvisor/V1/AccountSecretPage.php new file mode 100755 index 0000000..9ee7c0d --- /dev/null +++ b/app/api/Twilio/Rest/Microvisor/V1/AccountSecretPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AccountSecretInstance \Twilio\Rest\Microvisor\V1\AccountSecretInstance + */ + public function buildInstance(array $payload): AccountSecretInstance + { + return new AccountSecretInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Microvisor.V1.AccountSecretPage]'; + } +} diff --git a/app/api/Twilio/Rest/Microvisor/V1/App/AppManifestContext.php b/app/api/Twilio/Rest/Microvisor/V1/App/AppManifestContext.php new file mode 100755 index 0000000..a527c5e --- /dev/null +++ b/app/api/Twilio/Rest/Microvisor/V1/App/AppManifestContext.php @@ -0,0 +1,81 @@ +solution = [ + 'appSid' => + $appSid, + ]; + + $this->uri = '/Apps/' . \rawurlencode($appSid) + .'/Manifest'; + } + + /** + * Fetch the AppManifestInstance + * + * @return AppManifestInstance Fetched AppManifestInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AppManifestInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new AppManifestInstance( + $this->version, + $payload, + $this->solution['appSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Microvisor.V1.AppManifestContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Microvisor/V1/App/AppManifestInstance.php b/app/api/Twilio/Rest/Microvisor/V1/App/AppManifestInstance.php new file mode 100755 index 0000000..b0c82a9 --- /dev/null +++ b/app/api/Twilio/Rest/Microvisor/V1/App/AppManifestInstance.php @@ -0,0 +1,121 @@ +properties = [ + 'appSid' => Values::array_get($payload, 'app_sid'), + 'hash' => Values::array_get($payload, 'hash'), + 'encodedBytes' => Values::array_get($payload, 'encoded_bytes'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['appSid' => $appSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AppManifestContext Context for this AppManifestInstance + */ + protected function proxy(): AppManifestContext + { + if (!$this->context) { + $this->context = new AppManifestContext( + $this->version, + $this->solution['appSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the AppManifestInstance + * + * @return AppManifestInstance Fetched AppManifestInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AppManifestInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Microvisor.V1.AppManifestInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Microvisor/V1/App/AppManifestList.php b/app/api/Twilio/Rest/Microvisor/V1/App/AppManifestList.php new file mode 100755 index 0000000..aac719c --- /dev/null +++ b/app/api/Twilio/Rest/Microvisor/V1/App/AppManifestList.php @@ -0,0 +1,67 @@ +solution = [ + 'appSid' => + $appSid, + + ]; + } + + /** + * Constructs a AppManifestContext + */ + public function getContext( + + ): AppManifestContext + { + return new AppManifestContext( + $this->version, + $this->solution['appSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Microvisor.V1.AppManifestList]'; + } +} diff --git a/app/api/Twilio/Rest/Microvisor/V1/App/AppManifestPage.php b/app/api/Twilio/Rest/Microvisor/V1/App/AppManifestPage.php new file mode 100755 index 0000000..6cde952 --- /dev/null +++ b/app/api/Twilio/Rest/Microvisor/V1/App/AppManifestPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AppManifestInstance \Twilio\Rest\Microvisor\V1\App\AppManifestInstance + */ + public function buildInstance(array $payload): AppManifestInstance + { + return new AppManifestInstance($this->version, $payload, $this->solution['appSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Microvisor.V1.AppManifestPage]'; + } +} diff --git a/app/api/Twilio/Rest/Microvisor/V1/AppContext.php b/app/api/Twilio/Rest/Microvisor/V1/AppContext.php new file mode 100755 index 0000000..6b19438 --- /dev/null +++ b/app/api/Twilio/Rest/Microvisor/V1/AppContext.php @@ -0,0 +1,152 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Apps/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the AppInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the AppInstance + * + * @return AppInstance Fetched AppInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AppInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new AppInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the appManifests + */ + protected function getAppManifests(): AppManifestList + { + if (!$this->_appManifests) { + $this->_appManifests = new AppManifestList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_appManifests; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Microvisor.V1.AppContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Microvisor/V1/AppInstance.php b/app/api/Twilio/Rest/Microvisor/V1/AppInstance.php new file mode 100755 index 0000000..97c1b1a --- /dev/null +++ b/app/api/Twilio/Rest/Microvisor/V1/AppInstance.php @@ -0,0 +1,153 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'hash' => Values::array_get($payload, 'hash'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AppContext Context for this AppInstance + */ + protected function proxy(): AppContext + { + if (!$this->context) { + $this->context = new AppContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the AppInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the AppInstance + * + * @return AppInstance Fetched AppInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AppInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the appManifests + */ + protected function getAppManifests(): AppManifestList + { + return $this->proxy()->appManifests; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Microvisor.V1.AppInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Microvisor/V1/AppList.php b/app/api/Twilio/Rest/Microvisor/V1/AppList.php new file mode 100755 index 0000000..1952ae0 --- /dev/null +++ b/app/api/Twilio/Rest/Microvisor/V1/AppList.php @@ -0,0 +1,161 @@ +solution = [ + ]; + + $this->uri = '/Apps'; + } + + /** + * Reads AppInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return AppInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams AppInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AppInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return AppPage Page of AppInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AppPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new AppPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of AppInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return AppPage Page of AppInstance + */ + public function getPage(string $targetUrl): AppPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AppPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AppContext + * + * @param string $sid A 34-character string that uniquely identifies this App. + */ + public function getContext( + string $sid + + ): AppContext + { + return new AppContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Microvisor.V1.AppList]'; + } +} diff --git a/app/api/Twilio/Rest/Microvisor/V1/AppPage.php b/app/api/Twilio/Rest/Microvisor/V1/AppPage.php new file mode 100755 index 0000000..269864f --- /dev/null +++ b/app/api/Twilio/Rest/Microvisor/V1/AppPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AppInstance \Twilio\Rest\Microvisor\V1\AppInstance + */ + public function buildInstance(array $payload): AppInstance + { + return new AppInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Microvisor.V1.AppPage]'; + } +} diff --git a/app/api/Twilio/Rest/Microvisor/V1/Device/DeviceConfigContext.php b/app/api/Twilio/Rest/Microvisor/V1/Device/DeviceConfigContext.php new file mode 100755 index 0000000..e6be918 --- /dev/null +++ b/app/api/Twilio/Rest/Microvisor/V1/Device/DeviceConfigContext.php @@ -0,0 +1,127 @@ +solution = [ + 'deviceSid' => + $deviceSid, + 'key' => + $key, + ]; + + $this->uri = '/Devices/' . \rawurlencode($deviceSid) + .'/Configs/' . \rawurlencode($key) + .''; + } + + /** + * Delete the DeviceConfigInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the DeviceConfigInstance + * + * @return DeviceConfigInstance Fetched DeviceConfigInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DeviceConfigInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new DeviceConfigInstance( + $this->version, + $payload, + $this->solution['deviceSid'], + $this->solution['key'] + ); + } + + + /** + * Update the DeviceConfigInstance + * + * @param string $value The config value; up to 4096 characters. + * @return DeviceConfigInstance Updated DeviceConfigInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $value): DeviceConfigInstance + { + + $data = Values::of([ + 'Value' => + $value, + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new DeviceConfigInstance( + $this->version, + $payload, + $this->solution['deviceSid'], + $this->solution['key'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Microvisor.V1.DeviceConfigContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Microvisor/V1/Device/DeviceConfigInstance.php b/app/api/Twilio/Rest/Microvisor/V1/Device/DeviceConfigInstance.php new file mode 100755 index 0000000..34dc439 --- /dev/null +++ b/app/api/Twilio/Rest/Microvisor/V1/Device/DeviceConfigInstance.php @@ -0,0 +1,151 @@ +properties = [ + 'deviceSid' => Values::array_get($payload, 'device_sid'), + 'key' => Values::array_get($payload, 'key'), + 'value' => Values::array_get($payload, 'value'), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['deviceSid' => $deviceSid, 'key' => $key ?: $this->properties['key'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return DeviceConfigContext Context for this DeviceConfigInstance + */ + protected function proxy(): DeviceConfigContext + { + if (!$this->context) { + $this->context = new DeviceConfigContext( + $this->version, + $this->solution['deviceSid'], + $this->solution['key'] + ); + } + + return $this->context; + } + + /** + * Delete the DeviceConfigInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the DeviceConfigInstance + * + * @return DeviceConfigInstance Fetched DeviceConfigInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DeviceConfigInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the DeviceConfigInstance + * + * @param string $value The config value; up to 4096 characters. + * @return DeviceConfigInstance Updated DeviceConfigInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $value): DeviceConfigInstance + { + + return $this->proxy()->update($value); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Microvisor.V1.DeviceConfigInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Microvisor/V1/Device/DeviceConfigList.php b/app/api/Twilio/Rest/Microvisor/V1/Device/DeviceConfigList.php new file mode 100755 index 0000000..71e6716 --- /dev/null +++ b/app/api/Twilio/Rest/Microvisor/V1/Device/DeviceConfigList.php @@ -0,0 +1,197 @@ +solution = [ + 'deviceSid' => + $deviceSid, + + ]; + + $this->uri = '/Devices/' . \rawurlencode($deviceSid) + .'/Configs'; + } + + /** + * Create the DeviceConfigInstance + * + * @param string $key The config key; up to 100 characters. + * @param string $value The config value; up to 4096 characters. + * @return DeviceConfigInstance Created DeviceConfigInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $key, string $value): DeviceConfigInstance + { + + $data = Values::of([ + 'Key' => + $key, + 'Value' => + $value, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new DeviceConfigInstance( + $this->version, + $payload, + $this->solution['deviceSid'] + ); + } + + + /** + * Reads DeviceConfigInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return DeviceConfigInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams DeviceConfigInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of DeviceConfigInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return DeviceConfigPage Page of DeviceConfigInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): DeviceConfigPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new DeviceConfigPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of DeviceConfigInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return DeviceConfigPage Page of DeviceConfigInstance + */ + public function getPage(string $targetUrl): DeviceConfigPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new DeviceConfigPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a DeviceConfigContext + * + * @param string $key The config key; up to 100 characters. + */ + public function getContext( + string $key + + ): DeviceConfigContext + { + return new DeviceConfigContext( + $this->version, + $this->solution['deviceSid'], + $key + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Microvisor.V1.DeviceConfigList]'; + } +} diff --git a/app/api/Twilio/Rest/Microvisor/V1/Device/DeviceConfigPage.php b/app/api/Twilio/Rest/Microvisor/V1/Device/DeviceConfigPage.php new file mode 100755 index 0000000..07a0273 --- /dev/null +++ b/app/api/Twilio/Rest/Microvisor/V1/Device/DeviceConfigPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DeviceConfigInstance \Twilio\Rest\Microvisor\V1\Device\DeviceConfigInstance + */ + public function buildInstance(array $payload): DeviceConfigInstance + { + return new DeviceConfigInstance($this->version, $payload, $this->solution['deviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Microvisor.V1.DeviceConfigPage]'; + } +} diff --git a/app/api/Twilio/Rest/Microvisor/V1/Device/DeviceSecretContext.php b/app/api/Twilio/Rest/Microvisor/V1/Device/DeviceSecretContext.php new file mode 100755 index 0000000..2f6be31 --- /dev/null +++ b/app/api/Twilio/Rest/Microvisor/V1/Device/DeviceSecretContext.php @@ -0,0 +1,127 @@ +solution = [ + 'deviceSid' => + $deviceSid, + 'key' => + $key, + ]; + + $this->uri = '/Devices/' . \rawurlencode($deviceSid) + .'/Secrets/' . \rawurlencode($key) + .''; + } + + /** + * Delete the DeviceSecretInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the DeviceSecretInstance + * + * @return DeviceSecretInstance Fetched DeviceSecretInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DeviceSecretInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new DeviceSecretInstance( + $this->version, + $payload, + $this->solution['deviceSid'], + $this->solution['key'] + ); + } + + + /** + * Update the DeviceSecretInstance + * + * @param string $value The secret value; up to 4096 characters. + * @return DeviceSecretInstance Updated DeviceSecretInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $value): DeviceSecretInstance + { + + $data = Values::of([ + 'Value' => + $value, + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new DeviceSecretInstance( + $this->version, + $payload, + $this->solution['deviceSid'], + $this->solution['key'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Microvisor.V1.DeviceSecretContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Microvisor/V1/Device/DeviceSecretInstance.php b/app/api/Twilio/Rest/Microvisor/V1/Device/DeviceSecretInstance.php new file mode 100755 index 0000000..eb22836 --- /dev/null +++ b/app/api/Twilio/Rest/Microvisor/V1/Device/DeviceSecretInstance.php @@ -0,0 +1,149 @@ +properties = [ + 'deviceSid' => Values::array_get($payload, 'device_sid'), + 'key' => Values::array_get($payload, 'key'), + 'dateRotated' => Deserialize::dateTime(Values::array_get($payload, 'date_rotated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['deviceSid' => $deviceSid, 'key' => $key ?: $this->properties['key'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return DeviceSecretContext Context for this DeviceSecretInstance + */ + protected function proxy(): DeviceSecretContext + { + if (!$this->context) { + $this->context = new DeviceSecretContext( + $this->version, + $this->solution['deviceSid'], + $this->solution['key'] + ); + } + + return $this->context; + } + + /** + * Delete the DeviceSecretInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the DeviceSecretInstance + * + * @return DeviceSecretInstance Fetched DeviceSecretInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DeviceSecretInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the DeviceSecretInstance + * + * @param string $value The secret value; up to 4096 characters. + * @return DeviceSecretInstance Updated DeviceSecretInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $value): DeviceSecretInstance + { + + return $this->proxy()->update($value); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Microvisor.V1.DeviceSecretInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Microvisor/V1/Device/DeviceSecretList.php b/app/api/Twilio/Rest/Microvisor/V1/Device/DeviceSecretList.php new file mode 100755 index 0000000..784e85e --- /dev/null +++ b/app/api/Twilio/Rest/Microvisor/V1/Device/DeviceSecretList.php @@ -0,0 +1,197 @@ +solution = [ + 'deviceSid' => + $deviceSid, + + ]; + + $this->uri = '/Devices/' . \rawurlencode($deviceSid) + .'/Secrets'; + } + + /** + * Create the DeviceSecretInstance + * + * @param string $key The secret key; up to 100 characters. + * @param string $value The secret value; up to 4096 characters. + * @return DeviceSecretInstance Created DeviceSecretInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $key, string $value): DeviceSecretInstance + { + + $data = Values::of([ + 'Key' => + $key, + 'Value' => + $value, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new DeviceSecretInstance( + $this->version, + $payload, + $this->solution['deviceSid'] + ); + } + + + /** + * Reads DeviceSecretInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return DeviceSecretInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams DeviceSecretInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of DeviceSecretInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return DeviceSecretPage Page of DeviceSecretInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): DeviceSecretPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new DeviceSecretPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of DeviceSecretInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return DeviceSecretPage Page of DeviceSecretInstance + */ + public function getPage(string $targetUrl): DeviceSecretPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new DeviceSecretPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a DeviceSecretContext + * + * @param string $key The secret key; up to 100 characters. + */ + public function getContext( + string $key + + ): DeviceSecretContext + { + return new DeviceSecretContext( + $this->version, + $this->solution['deviceSid'], + $key + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Microvisor.V1.DeviceSecretList]'; + } +} diff --git a/app/api/Twilio/Rest/Microvisor/V1/Device/DeviceSecretPage.php b/app/api/Twilio/Rest/Microvisor/V1/Device/DeviceSecretPage.php new file mode 100755 index 0000000..f840fd7 --- /dev/null +++ b/app/api/Twilio/Rest/Microvisor/V1/Device/DeviceSecretPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DeviceSecretInstance \Twilio\Rest\Microvisor\V1\Device\DeviceSecretInstance + */ + public function buildInstance(array $payload): DeviceSecretInstance + { + return new DeviceSecretInstance($this->version, $payload, $this->solution['deviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Microvisor.V1.DeviceSecretPage]'; + } +} diff --git a/app/api/Twilio/Rest/Microvisor/V1/DeviceContext.php b/app/api/Twilio/Rest/Microvisor/V1/DeviceContext.php new file mode 100755 index 0000000..d594021 --- /dev/null +++ b/app/api/Twilio/Rest/Microvisor/V1/DeviceContext.php @@ -0,0 +1,192 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Devices/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the DeviceInstance + * + * @return DeviceInstance Fetched DeviceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DeviceInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new DeviceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the DeviceInstance + * + * @param array|Options $options Optional Arguments + * @return DeviceInstance Updated DeviceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): DeviceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + 'TargetApp' => + $options['targetApp'], + 'LoggingEnabled' => + Serialize::booleanToString($options['loggingEnabled']), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new DeviceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the deviceConfigs + */ + protected function getDeviceConfigs(): DeviceConfigList + { + if (!$this->_deviceConfigs) { + $this->_deviceConfigs = new DeviceConfigList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_deviceConfigs; + } + + /** + * Access the deviceSecrets + */ + protected function getDeviceSecrets(): DeviceSecretList + { + if (!$this->_deviceSecrets) { + $this->_deviceSecrets = new DeviceSecretList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_deviceSecrets; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Microvisor.V1.DeviceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Microvisor/V1/DeviceInstance.php b/app/api/Twilio/Rest/Microvisor/V1/DeviceInstance.php new file mode 100755 index 0000000..71fad0b --- /dev/null +++ b/app/api/Twilio/Rest/Microvisor/V1/DeviceInstance.php @@ -0,0 +1,167 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'app' => Values::array_get($payload, 'app'), + 'logging' => Values::array_get($payload, 'logging'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return DeviceContext Context for this DeviceInstance + */ + protected function proxy(): DeviceContext + { + if (!$this->context) { + $this->context = new DeviceContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the DeviceInstance + * + * @return DeviceInstance Fetched DeviceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DeviceInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the DeviceInstance + * + * @param array|Options $options Optional Arguments + * @return DeviceInstance Updated DeviceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): DeviceInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the deviceConfigs + */ + protected function getDeviceConfigs(): DeviceConfigList + { + return $this->proxy()->deviceConfigs; + } + + /** + * Access the deviceSecrets + */ + protected function getDeviceSecrets(): DeviceSecretList + { + return $this->proxy()->deviceSecrets; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Microvisor.V1.DeviceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Microvisor/V1/DeviceList.php b/app/api/Twilio/Rest/Microvisor/V1/DeviceList.php new file mode 100755 index 0000000..5ab4067 --- /dev/null +++ b/app/api/Twilio/Rest/Microvisor/V1/DeviceList.php @@ -0,0 +1,161 @@ +solution = [ + ]; + + $this->uri = '/Devices'; + } + + /** + * Reads DeviceInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return DeviceInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams DeviceInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of DeviceInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return DevicePage Page of DeviceInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): DevicePage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new DevicePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of DeviceInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return DevicePage Page of DeviceInstance + */ + public function getPage(string $targetUrl): DevicePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new DevicePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a DeviceContext + * + * @param string $sid A 34-character string that uniquely identifies this Device. + */ + public function getContext( + string $sid + + ): DeviceContext + { + return new DeviceContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Microvisor.V1.DeviceList]'; + } +} diff --git a/app/api/Twilio/Rest/Microvisor/V1/DeviceOptions.php b/app/api/Twilio/Rest/Microvisor/V1/DeviceOptions.php new file mode 100755 index 0000000..03010f8 --- /dev/null +++ b/app/api/Twilio/Rest/Microvisor/V1/DeviceOptions.php @@ -0,0 +1,116 @@ +options['uniqueName'] = $uniqueName; + $this->options['targetApp'] = $targetApp; + $this->options['loggingEnabled'] = $loggingEnabled; + } + + /** + * A unique and addressable name to be assigned to this Device by the developer. It may be used in place of the Device SID. + * + * @param string $uniqueName A unique and addressable name to be assigned to this Device by the developer. It may be used in place of the Device SID. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * The SID or unique name of the App to be targeted to the Device. + * + * @param string $targetApp The SID or unique name of the App to be targeted to the Device. + * @return $this Fluent Builder + */ + public function setTargetApp(string $targetApp): self + { + $this->options['targetApp'] = $targetApp; + return $this; + } + + /** + * A Boolean flag specifying whether to enable application logging. Logs will be enabled or extended for 24 hours. + * + * @param bool $loggingEnabled A Boolean flag specifying whether to enable application logging. Logs will be enabled or extended for 24 hours. + * @return $this Fluent Builder + */ + public function setLoggingEnabled(bool $loggingEnabled): self + { + $this->options['loggingEnabled'] = $loggingEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Microvisor.V1.UpdateDeviceOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Microvisor/V1/DevicePage.php b/app/api/Twilio/Rest/Microvisor/V1/DevicePage.php new file mode 100755 index 0000000..0c12eb5 --- /dev/null +++ b/app/api/Twilio/Rest/Microvisor/V1/DevicePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DeviceInstance \Twilio\Rest\Microvisor\V1\DeviceInstance + */ + public function buildInstance(array $payload): DeviceInstance + { + return new DeviceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Microvisor.V1.DevicePage]'; + } +} diff --git a/app/api/Twilio/Rest/MicrovisorBase.php b/app/api/Twilio/Rest/MicrovisorBase.php new file mode 100755 index 0000000..e998f18 --- /dev/null +++ b/app/api/Twilio/Rest/MicrovisorBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://microvisor.twilio.com'; + } + + + /** + * @return V1 Version v1 of microvisor + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Microvisor]'; + } +} diff --git a/app/api/Twilio/Rest/Monitor.php b/app/api/Twilio/Rest/Monitor.php new file mode 100755 index 0000000..f9631d6 --- /dev/null +++ b/app/api/Twilio/Rest/Monitor.php @@ -0,0 +1,41 @@ +alerts instead. + */ + protected function getAlerts(): \Twilio\Rest\Monitor\V1\AlertList { + echo "alerts is deprecated. Use v1->alerts instead."; + return $this->v1->alerts; + } + + /** + * @deprecated Use v1->alerts(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextAlerts(string $sid): \Twilio\Rest\Monitor\V1\AlertContext { + echo "alerts(\$sid) is deprecated. Use v1->alerts(\$sid) instead."; + return $this->v1->alerts($sid); + } + + /** + * @deprecated Use v1->events instead. + */ + protected function getEvents(): \Twilio\Rest\Monitor\V1\EventList { + echo "events is deprecated. Use v1->events instead."; + return $this->v1->events; + } + + /** + * @deprecated Use v1->events(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextEvents(string $sid): \Twilio\Rest\Monitor\V1\EventContext { + echo "events(\$sid) is deprecated. Use v1->events(\$sid) instead."; + return $this->v1->events($sid); + } +} \ No newline at end of file diff --git a/app/api/Twilio/Rest/Monitor/V1.php b/app/api/Twilio/Rest/Monitor/V1.php new file mode 100755 index 0000000..68a13a5 --- /dev/null +++ b/app/api/Twilio/Rest/Monitor/V1.php @@ -0,0 +1,107 @@ +version = 'v1'; + } + + protected function getAlerts(): AlertList + { + if (!$this->_alerts) { + $this->_alerts = new AlertList($this); + } + return $this->_alerts; + } + + protected function getEvents(): EventList + { + if (!$this->_events) { + $this->_events = new EventList($this); + } + return $this->_events; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Monitor.V1]'; + } +} diff --git a/app/api/Twilio/Rest/Monitor/V1/AlertContext.php b/app/api/Twilio/Rest/Monitor/V1/AlertContext.php new file mode 100755 index 0000000..ab0c6ec --- /dev/null +++ b/app/api/Twilio/Rest/Monitor/V1/AlertContext.php @@ -0,0 +1,81 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Alerts/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the AlertInstance + * + * @return AlertInstance Fetched AlertInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AlertInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new AlertInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Monitor.V1.AlertContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Monitor/V1/AlertInstance.php b/app/api/Twilio/Rest/Monitor/V1/AlertInstance.php new file mode 100755 index 0000000..455b321 --- /dev/null +++ b/app/api/Twilio/Rest/Monitor/V1/AlertInstance.php @@ -0,0 +1,152 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'alertText' => Values::array_get($payload, 'alert_text'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateGenerated' => Deserialize::dateTime(Values::array_get($payload, 'date_generated')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'errorCode' => Values::array_get($payload, 'error_code'), + 'logLevel' => Values::array_get($payload, 'log_level'), + 'moreInfo' => Values::array_get($payload, 'more_info'), + 'requestMethod' => Values::array_get($payload, 'request_method'), + 'requestUrl' => Values::array_get($payload, 'request_url'), + 'requestVariables' => Values::array_get($payload, 'request_variables'), + 'resourceSid' => Values::array_get($payload, 'resource_sid'), + 'responseBody' => Values::array_get($payload, 'response_body'), + 'responseHeaders' => Values::array_get($payload, 'response_headers'), + 'sid' => Values::array_get($payload, 'sid'), + 'url' => Values::array_get($payload, 'url'), + 'requestHeaders' => Values::array_get($payload, 'request_headers'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AlertContext Context for this AlertInstance + */ + protected function proxy(): AlertContext + { + if (!$this->context) { + $this->context = new AlertContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the AlertInstance + * + * @return AlertInstance Fetched AlertInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AlertInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Monitor.V1.AlertInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Monitor/V1/AlertList.php b/app/api/Twilio/Rest/Monitor/V1/AlertList.php new file mode 100755 index 0000000..1b67bed --- /dev/null +++ b/app/api/Twilio/Rest/Monitor/V1/AlertList.php @@ -0,0 +1,173 @@ +solution = [ + ]; + + $this->uri = '/Alerts'; + } + + /** + * Reads AlertInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return AlertInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams AlertInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AlertInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return AlertPage Page of AlertInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AlertPage + { + $options = new Values($options); + + $params = Values::of([ + 'LogLevel' => + $options['logLevel'], + 'StartDate' => + Serialize::iso8601DateTime($options['startDate']), + 'EndDate' => + Serialize::iso8601DateTime($options['endDate']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new AlertPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of AlertInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return AlertPage Page of AlertInstance + */ + public function getPage(string $targetUrl): AlertPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AlertPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AlertContext + * + * @param string $sid The SID of the Alert resource to fetch. + */ + public function getContext( + string $sid + + ): AlertContext + { + return new AlertContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Monitor.V1.AlertList]'; + } +} diff --git a/app/api/Twilio/Rest/Monitor/V1/AlertOptions.php b/app/api/Twilio/Rest/Monitor/V1/AlertOptions.php new file mode 100755 index 0000000..ac48e87 --- /dev/null +++ b/app/api/Twilio/Rest/Monitor/V1/AlertOptions.php @@ -0,0 +1,114 @@ +options['logLevel'] = $logLevel; + $this->options['startDate'] = $startDate; + $this->options['endDate'] = $endDate; + } + + /** + * Only show alerts for this log-level. Can be: `error`, `warning`, `notice`, or `debug`. + * + * @param string $logLevel Only show alerts for this log-level. Can be: `error`, `warning`, `notice`, or `debug`. + * @return $this Fluent Builder + */ + public function setLogLevel(string $logLevel): self + { + $this->options['logLevel'] = $logLevel; + return $this; + } + + /** + * Only include alerts that occurred on or after this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported. + * + * @param \DateTime $startDate Only include alerts that occurred on or after this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only include alerts that occurred on or before this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported. + * + * @param \DateTime $endDate Only include alerts that occurred on or before this date and time. Specify the date and time in GMT and format as `YYYY-MM-DD` or `YYYY-MM-DDThh:mm:ssZ`. Queries for alerts older than 30 days are not supported. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Monitor.V1.ReadAlertOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Monitor/V1/AlertPage.php b/app/api/Twilio/Rest/Monitor/V1/AlertPage.php new file mode 100755 index 0000000..c89356c --- /dev/null +++ b/app/api/Twilio/Rest/Monitor/V1/AlertPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AlertInstance \Twilio\Rest\Monitor\V1\AlertInstance + */ + public function buildInstance(array $payload): AlertInstance + { + return new AlertInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Monitor.V1.AlertPage]'; + } +} diff --git a/app/api/Twilio/Rest/Monitor/V1/EventContext.php b/app/api/Twilio/Rest/Monitor/V1/EventContext.php new file mode 100755 index 0000000..d4b1d6b --- /dev/null +++ b/app/api/Twilio/Rest/Monitor/V1/EventContext.php @@ -0,0 +1,81 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Events/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the EventInstance + * + * @return EventInstance Fetched EventInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EventInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new EventInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Monitor.V1.EventContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Monitor/V1/EventInstance.php b/app/api/Twilio/Rest/Monitor/V1/EventInstance.php new file mode 100755 index 0000000..36ca6d0 --- /dev/null +++ b/app/api/Twilio/Rest/Monitor/V1/EventInstance.php @@ -0,0 +1,142 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'actorSid' => Values::array_get($payload, 'actor_sid'), + 'actorType' => Values::array_get($payload, 'actor_type'), + 'description' => Values::array_get($payload, 'description'), + 'eventData' => Values::array_get($payload, 'event_data'), + 'eventDate' => Deserialize::dateTime(Values::array_get($payload, 'event_date')), + 'eventType' => Values::array_get($payload, 'event_type'), + 'resourceSid' => Values::array_get($payload, 'resource_sid'), + 'resourceType' => Values::array_get($payload, 'resource_type'), + 'sid' => Values::array_get($payload, 'sid'), + 'source' => Values::array_get($payload, 'source'), + 'sourceIpAddress' => Values::array_get($payload, 'source_ip_address'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return EventContext Context for this EventInstance + */ + protected function proxy(): EventContext + { + if (!$this->context) { + $this->context = new EventContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the EventInstance + * + * @return EventInstance Fetched EventInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EventInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Monitor.V1.EventInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Monitor/V1/EventList.php b/app/api/Twilio/Rest/Monitor/V1/EventList.php new file mode 100755 index 0000000..872d107 --- /dev/null +++ b/app/api/Twilio/Rest/Monitor/V1/EventList.php @@ -0,0 +1,179 @@ +solution = [ + ]; + + $this->uri = '/Events'; + } + + /** + * Reads EventInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return EventInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams EventInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of EventInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return EventPage Page of EventInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): EventPage + { + $options = new Values($options); + + $params = Values::of([ + 'ActorSid' => + $options['actorSid'], + 'EventType' => + $options['eventType'], + 'ResourceSid' => + $options['resourceSid'], + 'SourceIpAddress' => + $options['sourceIpAddress'], + 'StartDate' => + Serialize::iso8601DateTime($options['startDate']), + 'EndDate' => + Serialize::iso8601DateTime($options['endDate']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new EventPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of EventInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return EventPage Page of EventInstance + */ + public function getPage(string $targetUrl): EventPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new EventPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a EventContext + * + * @param string $sid The SID of the Event resource to fetch. + */ + public function getContext( + string $sid + + ): EventContext + { + return new EventContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Monitor.V1.EventList]'; + } +} diff --git a/app/api/Twilio/Rest/Monitor/V1/EventOptions.php b/app/api/Twilio/Rest/Monitor/V1/EventOptions.php new file mode 100755 index 0000000..bf89c00 --- /dev/null +++ b/app/api/Twilio/Rest/Monitor/V1/EventOptions.php @@ -0,0 +1,168 @@ +options['actorSid'] = $actorSid; + $this->options['eventType'] = $eventType; + $this->options['resourceSid'] = $resourceSid; + $this->options['sourceIpAddress'] = $sourceIpAddress; + $this->options['startDate'] = $startDate; + $this->options['endDate'] = $endDate; + } + + /** + * Only include events initiated by this Actor. Useful for auditing actions taken by specific users or API credentials. + * + * @param string $actorSid Only include events initiated by this Actor. Useful for auditing actions taken by specific users or API credentials. + * @return $this Fluent Builder + */ + public function setActorSid(string $actorSid): self + { + $this->options['actorSid'] = $actorSid; + return $this; + } + + /** + * Only include events of this [Event Type](https://www.twilio.com/docs/usage/monitor-events#event-types). + * + * @param string $eventType Only include events of this [Event Type](https://www.twilio.com/docs/usage/monitor-events#event-types). + * @return $this Fluent Builder + */ + public function setEventType(string $eventType): self + { + $this->options['eventType'] = $eventType; + return $this; + } + + /** + * Only include events that refer to this resource. Useful for discovering the history of a specific resource. + * + * @param string $resourceSid Only include events that refer to this resource. Useful for discovering the history of a specific resource. + * @return $this Fluent Builder + */ + public function setResourceSid(string $resourceSid): self + { + $this->options['resourceSid'] = $resourceSid; + return $this; + } + + /** + * Only include events that originated from this IP address. Useful for tracking suspicious activity originating from the API or the Twilio Console. + * + * @param string $sourceIpAddress Only include events that originated from this IP address. Useful for tracking suspicious activity originating from the API or the Twilio Console. + * @return $this Fluent Builder + */ + public function setSourceIpAddress(string $sourceIpAddress): self + { + $this->options['sourceIpAddress'] = $sourceIpAddress; + return $this; + } + + /** + * Only include events that occurred on or after this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * + * @param \DateTime $startDate Only include events that occurred on or after this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only include events that occurred on or before this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * + * @param \DateTime $endDate Only include events that occurred on or before this date. Specify the date in GMT and [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Monitor.V1.ReadEventOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Monitor/V1/EventPage.php b/app/api/Twilio/Rest/Monitor/V1/EventPage.php new file mode 100755 index 0000000..ff4c717 --- /dev/null +++ b/app/api/Twilio/Rest/Monitor/V1/EventPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return EventInstance \Twilio\Rest\Monitor\V1\EventInstance + */ + public function buildInstance(array $payload): EventInstance + { + return new EventInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Monitor.V1.EventPage]'; + } +} diff --git a/app/api/Twilio/Rest/MonitorBase.php b/app/api/Twilio/Rest/MonitorBase.php new file mode 100755 index 0000000..4f9f9a9 --- /dev/null +++ b/app/api/Twilio/Rest/MonitorBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://monitor.twilio.com'; + } + + + /** + * @return V1 Version v1 of monitor + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Monitor]'; + } +} diff --git a/app/api/Twilio/Rest/Notify.php b/app/api/Twilio/Rest/Notify.php new file mode 100755 index 0000000..e109165 --- /dev/null +++ b/app/api/Twilio/Rest/Notify.php @@ -0,0 +1,41 @@ +credentials instead. + */ + protected function getCredentials(): \Twilio\Rest\Notify\V1\CredentialList { + echo "credentials is deprecated. Use v1->credentials instead."; + return $this->v1->credentials; + } + + /** + * @deprecated Use v1->credentials(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextCredentials(string $sid): \Twilio\Rest\Notify\V1\CredentialContext { + echo "credentials(\$sid) is deprecated. Use v1->credentials(\$sid) instead."; + return $this->v1->credentials($sid); + } + + /** + * @deprecated Use v1->services instead. + */ + protected function getServices(): \Twilio\Rest\Notify\V1\ServiceList { + echo "services is deprecated. Use v1->services instead."; + return $this->v1->services; + } + + /** + * @deprecated Use v1->services(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextServices(string $sid): \Twilio\Rest\Notify\V1\ServiceContext { + echo "services(\$sid) is deprecated. Use v1->services(\$sid) instead."; + return $this->v1->services($sid); + } +} \ No newline at end of file diff --git a/app/api/Twilio/Rest/Notify/V1.php b/app/api/Twilio/Rest/Notify/V1.php new file mode 100755 index 0000000..051e8f2 --- /dev/null +++ b/app/api/Twilio/Rest/Notify/V1.php @@ -0,0 +1,107 @@ +version = 'v1'; + } + + protected function getCredentials(): CredentialList + { + if (!$this->_credentials) { + $this->_credentials = new CredentialList($this); + } + return $this->_credentials; + } + + protected function getServices(): ServiceList + { + if (!$this->_services) { + $this->_services = new ServiceList($this); + } + return $this->_services; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Notify.V1]'; + } +} diff --git a/app/api/Twilio/Rest/Notify/V1/CredentialContext.php b/app/api/Twilio/Rest/Notify/V1/CredentialContext.php new file mode 100755 index 0000000..f93b90a --- /dev/null +++ b/app/api/Twilio/Rest/Notify/V1/CredentialContext.php @@ -0,0 +1,134 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Credentials/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the CredentialInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the CredentialInstance + * + * @return CredentialInstance Fetched CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new CredentialInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the CredentialInstance + * + * @param array|Options $options Optional Arguments + * @return CredentialInstance Updated CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CredentialInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'Certificate' => + $options['certificate'], + 'PrivateKey' => + $options['privateKey'], + 'Sandbox' => + Serialize::booleanToString($options['sandbox']), + 'ApiKey' => + $options['apiKey'], + 'Secret' => + $options['secret'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new CredentialInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Notify.V1.CredentialContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Notify/V1/CredentialInstance.php b/app/api/Twilio/Rest/Notify/V1/CredentialInstance.php new file mode 100755 index 0000000..a2f0e9b --- /dev/null +++ b/app/api/Twilio/Rest/Notify/V1/CredentialInstance.php @@ -0,0 +1,156 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'type' => Values::array_get($payload, 'type'), + 'sandbox' => Values::array_get($payload, 'sandbox'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CredentialContext Context for this CredentialInstance + */ + protected function proxy(): CredentialContext + { + if (!$this->context) { + $this->context = new CredentialContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the CredentialInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the CredentialInstance + * + * @return CredentialInstance Fetched CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the CredentialInstance + * + * @param array|Options $options Optional Arguments + * @return CredentialInstance Updated CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CredentialInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Notify.V1.CredentialInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Notify/V1/CredentialList.php b/app/api/Twilio/Rest/Notify/V1/CredentialList.php new file mode 100755 index 0000000..5d453ec --- /dev/null +++ b/app/api/Twilio/Rest/Notify/V1/CredentialList.php @@ -0,0 +1,203 @@ +solution = [ + ]; + + $this->uri = '/Credentials'; + } + + /** + * Create the CredentialInstance + * + * @param string $type + * @param array|Options $options Optional Arguments + * @return CredentialInstance Created CredentialInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $type, array $options = []): CredentialInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Type' => + $type, + 'FriendlyName' => + $options['friendlyName'], + 'Certificate' => + $options['certificate'], + 'PrivateKey' => + $options['privateKey'], + 'Sandbox' => + Serialize::booleanToString($options['sandbox']), + 'ApiKey' => + $options['apiKey'], + 'Secret' => + $options['secret'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new CredentialInstance( + $this->version, + $payload + ); + } + + + /** + * Reads CredentialInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return CredentialInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams CredentialInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CredentialInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return CredentialPage Page of CredentialInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CredentialPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new CredentialPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of CredentialInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return CredentialPage Page of CredentialInstance + */ + public function getPage(string $targetUrl): CredentialPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CredentialPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CredentialContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Credential resource to delete. + */ + public function getContext( + string $sid + + ): CredentialContext + { + return new CredentialContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Notify.V1.CredentialList]'; + } +} diff --git a/app/api/Twilio/Rest/Notify/V1/CredentialOptions.php b/app/api/Twilio/Rest/Notify/V1/CredentialOptions.php new file mode 100755 index 0000000..542b6ad --- /dev/null +++ b/app/api/Twilio/Rest/Notify/V1/CredentialOptions.php @@ -0,0 +1,314 @@ +options['friendlyName'] = $friendlyName; + $this->options['certificate'] = $certificate; + $this->options['privateKey'] = $privateKey; + $this->options['sandbox'] = $sandbox; + $this->options['apiKey'] = $apiKey; + $this->options['secret'] = $secret; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * [APN only] The URL-encoded representation of the certificate. Strip everything outside of the headers, e.g. `-----BEGIN CERTIFICATE-----MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A==-----END CERTIFICATE-----` + * + * @param string $certificate [APN only] The URL-encoded representation of the certificate. Strip everything outside of the headers, e.g. `-----BEGIN CERTIFICATE-----MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A==-----END CERTIFICATE-----` + * @return $this Fluent Builder + */ + public function setCertificate(string $certificate): self + { + $this->options['certificate'] = $certificate; + return $this; + } + + /** + * [APN only] The URL-encoded representation of the private key. Strip everything outside of the headers, e.g. `-----BEGIN RSA PRIVATE KEY-----MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR\\\\n.-----END RSA PRIVATE KEY-----` + * + * @param string $privateKey [APN only] The URL-encoded representation of the private key. Strip everything outside of the headers, e.g. `-----BEGIN RSA PRIVATE KEY-----MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR\\\\n.-----END RSA PRIVATE KEY-----` + * @return $this Fluent Builder + */ + public function setPrivateKey(string $privateKey): self + { + $this->options['privateKey'] = $privateKey; + return $this; + } + + /** + * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * + * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * @return $this Fluent Builder + */ + public function setSandbox(bool $sandbox): self + { + $this->options['sandbox'] = $sandbox; + return $this; + } + + /** + * [GCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging. + * + * @param string $apiKey [GCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging. + * @return $this Fluent Builder + */ + public function setApiKey(string $apiKey): self + { + $this->options['apiKey'] = $apiKey; + return $this; + } + + /** + * [FCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging. + * + * @param string $secret [FCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging. + * @return $this Fluent Builder + */ + public function setSecret(string $secret): self + { + $this->options['secret'] = $secret; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Notify.V1.CreateCredentialOptions ' . $options . ']'; + } +} + + + + +class UpdateCredentialOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @param string $certificate [APN only] The URL-encoded representation of the certificate. Strip everything outside of the headers, e.g. `-----BEGIN CERTIFICATE-----MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A==-----END CERTIFICATE-----` + * @param string $privateKey [APN only] The URL-encoded representation of the private key. Strip everything outside of the headers, e.g. `-----BEGIN RSA PRIVATE KEY-----MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR\\\\n.-----END RSA PRIVATE KEY-----` + * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * @param string $apiKey [GCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging. + * @param string $secret [FCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $certificate = Values::NONE, + string $privateKey = Values::NONE, + bool $sandbox = Values::BOOL_NONE, + string $apiKey = Values::NONE, + string $secret = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['certificate'] = $certificate; + $this->options['privateKey'] = $privateKey; + $this->options['sandbox'] = $sandbox; + $this->options['apiKey'] = $apiKey; + $this->options['secret'] = $secret; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * [APN only] The URL-encoded representation of the certificate. Strip everything outside of the headers, e.g. `-----BEGIN CERTIFICATE-----MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A==-----END CERTIFICATE-----` + * + * @param string $certificate [APN only] The URL-encoded representation of the certificate. Strip everything outside of the headers, e.g. `-----BEGIN CERTIFICATE-----MIIFnTCCBIWgAwIBAgIIAjy9H849+E8wDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV.....A==-----END CERTIFICATE-----` + * @return $this Fluent Builder + */ + public function setCertificate(string $certificate): self + { + $this->options['certificate'] = $certificate; + return $this; + } + + /** + * [APN only] The URL-encoded representation of the private key. Strip everything outside of the headers, e.g. `-----BEGIN RSA PRIVATE KEY-----MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR\\\\n.-----END RSA PRIVATE KEY-----` + * + * @param string $privateKey [APN only] The URL-encoded representation of the private key. Strip everything outside of the headers, e.g. `-----BEGIN RSA PRIVATE KEY-----MIIEpQIBAAKCAQEAuyf/lNrH9ck8DmNyo3fGgvCI1l9s+cmBY3WIz+cUDqmxiieR\\\\n.-----END RSA PRIVATE KEY-----` + * @return $this Fluent Builder + */ + public function setPrivateKey(string $privateKey): self + { + $this->options['privateKey'] = $privateKey; + return $this; + } + + /** + * [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * + * @param bool $sandbox [APN only] Whether to send the credential to sandbox APNs. Can be `true` to send to sandbox APNs or `false` to send to production. + * @return $this Fluent Builder + */ + public function setSandbox(bool $sandbox): self + { + $this->options['sandbox'] = $sandbox; + return $this; + } + + /** + * [GCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging. + * + * @param string $apiKey [GCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging. + * @return $this Fluent Builder + */ + public function setApiKey(string $apiKey): self + { + $this->options['apiKey'] = $apiKey; + return $this; + } + + /** + * [FCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging. + * + * @param string $secret [FCM only] The `Server key` of your project from Firebase console under Settings / Cloud messaging. + * @return $this Fluent Builder + */ + public function setSecret(string $secret): self + { + $this->options['secret'] = $secret; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Notify.V1.UpdateCredentialOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Notify/V1/CredentialPage.php b/app/api/Twilio/Rest/Notify/V1/CredentialPage.php new file mode 100755 index 0000000..29ac769 --- /dev/null +++ b/app/api/Twilio/Rest/Notify/V1/CredentialPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CredentialInstance \Twilio\Rest\Notify\V1\CredentialInstance + */ + public function buildInstance(array $payload): CredentialInstance + { + return new CredentialInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Notify.V1.CredentialPage]'; + } +} diff --git a/app/api/Twilio/Rest/Notify/V1/Service/BindingContext.php b/app/api/Twilio/Rest/Notify/V1/Service/BindingContext.php new file mode 100755 index 0000000..4873bfc --- /dev/null +++ b/app/api/Twilio/Rest/Notify/V1/Service/BindingContext.php @@ -0,0 +1,100 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Bindings/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the BindingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the BindingInstance + * + * @return BindingInstance Fetched BindingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BindingInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new BindingInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Notify.V1.BindingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Notify/V1/Service/BindingInstance.php b/app/api/Twilio/Rest/Notify/V1/Service/BindingInstance.php new file mode 100755 index 0000000..89f3231 --- /dev/null +++ b/app/api/Twilio/Rest/Notify/V1/Service/BindingInstance.php @@ -0,0 +1,156 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'credentialSid' => Values::array_get($payload, 'credential_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'notificationProtocolVersion' => Values::array_get($payload, 'notification_protocol_version'), + 'endpoint' => Values::array_get($payload, 'endpoint'), + 'identity' => Values::array_get($payload, 'identity'), + 'bindingType' => Values::array_get($payload, 'binding_type'), + 'address' => Values::array_get($payload, 'address'), + 'tags' => Values::array_get($payload, 'tags'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return BindingContext Context for this BindingInstance + */ + protected function proxy(): BindingContext + { + if (!$this->context) { + $this->context = new BindingContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the BindingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the BindingInstance + * + * @return BindingInstance Fetched BindingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BindingInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Notify.V1.BindingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Notify/V1/Service/BindingList.php b/app/api/Twilio/Rest/Notify/V1/Service/BindingList.php new file mode 100755 index 0000000..5a24029 --- /dev/null +++ b/app/api/Twilio/Rest/Notify/V1/Service/BindingList.php @@ -0,0 +1,225 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Bindings'; + } + + /** + * Create the BindingInstance + * + * @param string $identity The `identity` value that uniquely identifies the new resource's [User](https://www.twilio.com/docs/chat/rest/user-resource) within the [Service](https://www.twilio.com/docs/notify/api/service-resource). Up to 20 Bindings can be created for the same Identity in a given Service. + * @param string $bindingType + * @param string $address The channel-specific address. For APNS, the device token. For FCM and GCM, the registration token. For SMS, a phone number in E.164 format. For Facebook Messenger, the Messenger ID of the user or a phone number in E.164 format. + * @param array|Options $options Optional Arguments + * @return BindingInstance Created BindingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $identity, string $bindingType, string $address, array $options = []): BindingInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Identity' => + $identity, + 'BindingType' => + $bindingType, + 'Address' => + $address, + 'Tag' => + Serialize::map($options['tag'], function ($e) { return $e; }), + 'NotificationProtocolVersion' => + $options['notificationProtocolVersion'], + 'CredentialSid' => + $options['credentialSid'], + 'Endpoint' => + $options['endpoint'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new BindingInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads BindingInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return BindingInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams BindingInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of BindingInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return BindingPage Page of BindingInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): BindingPage + { + $options = new Values($options); + + $params = Values::of([ + 'StartDate' => + Serialize::iso8601Date($options['startDate']), + 'EndDate' => + Serialize::iso8601Date($options['endDate']), + 'Identity' => + Serialize::map($options['identity'], function ($e) { return $e; }), + 'Tag' => + Serialize::map($options['tag'], function ($e) { return $e; }), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new BindingPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of BindingInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return BindingPage Page of BindingInstance + */ + public function getPage(string $targetUrl): BindingPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new BindingPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a BindingContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Binding resource to delete. + */ + public function getContext( + string $sid + + ): BindingContext + { + return new BindingContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Notify.V1.BindingList]'; + } +} diff --git a/app/api/Twilio/Rest/Notify/V1/Service/BindingOptions.php b/app/api/Twilio/Rest/Notify/V1/Service/BindingOptions.php new file mode 100755 index 0000000..93a9562 --- /dev/null +++ b/app/api/Twilio/Rest/Notify/V1/Service/BindingOptions.php @@ -0,0 +1,240 @@ +options['tag'] = $tag; + $this->options['notificationProtocolVersion'] = $notificationProtocolVersion; + $this->options['credentialSid'] = $credentialSid; + $this->options['endpoint'] = $endpoint; + } + + /** + * A tag that can be used to select the Bindings to notify. Repeat this parameter to specify more than one tag, up to a total of 20 tags. + * + * @param string[] $tag A tag that can be used to select the Bindings to notify. Repeat this parameter to specify more than one tag, up to a total of 20 tags. + * @return $this Fluent Builder + */ + public function setTag(array $tag): self + { + $this->options['tag'] = $tag; + return $this; + } + + /** + * The protocol version to use to send the notification. This defaults to the value of `default_xxxx_notification_protocol_version` for the protocol in the [Service](https://www.twilio.com/docs/notify/api/service-resource). The current version is `\\\"3\\\"` for `apn`, `fcm`, and `gcm` type Bindings. The parameter is not applicable to `sms` and `facebook-messenger` type Bindings as the data format is fixed. + * + * @param string $notificationProtocolVersion The protocol version to use to send the notification. This defaults to the value of `default_xxxx_notification_protocol_version` for the protocol in the [Service](https://www.twilio.com/docs/notify/api/service-resource). The current version is `\\\"3\\\"` for `apn`, `fcm`, and `gcm` type Bindings. The parameter is not applicable to `sms` and `facebook-messenger` type Bindings as the data format is fixed. + * @return $this Fluent Builder + */ + public function setNotificationProtocolVersion(string $notificationProtocolVersion): self + { + $this->options['notificationProtocolVersion'] = $notificationProtocolVersion; + return $this; + } + + /** + * The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) resource to be used to send notifications to this Binding. If present, this overrides the Credential specified in the Service resource. Applies to only `apn`, `fcm`, and `gcm` type Bindings. + * + * @param string $credentialSid The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) resource to be used to send notifications to this Binding. If present, this overrides the Credential specified in the Service resource. Applies to only `apn`, `fcm`, and `gcm` type Bindings. + * @return $this Fluent Builder + */ + public function setCredentialSid(string $credentialSid): self + { + $this->options['credentialSid'] = $credentialSid; + return $this; + } + + /** + * Deprecated. + * + * @param string $endpoint Deprecated. + * @return $this Fluent Builder + */ + public function setEndpoint(string $endpoint): self + { + $this->options['endpoint'] = $endpoint; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Notify.V1.CreateBindingOptions ' . $options . ']'; + } +} + + + +class ReadBindingOptions extends Options + { + /** + * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. + * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. + * @param string[] $identity The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. + * @param string[] $tag Only list Bindings that have all of the specified Tags. The following implicit tags are available: `all`, `apn`, `fcm`, `gcm`, `sms`, `facebook-messenger`. Up to 5 tags are allowed. + */ + public function __construct( + + \DateTime $startDate = null, + \DateTime $endDate = null, + array $identity = Values::ARRAY_NONE, + array $tag = Values::ARRAY_NONE + + ) { + $this->options['startDate'] = $startDate; + $this->options['endDate'] = $endDate; + $this->options['identity'] = $identity; + $this->options['tag'] = $tag; + } + + /** + * Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. + * + * @param \DateTime $startDate Only include usage that has occurred on or after this date. Specify the date in GMT and format as `YYYY-MM-DD`. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. + * + * @param \DateTime $endDate Only include usage that occurred on or before this date. Specify the date in GMT and format as `YYYY-MM-DD`. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. + * + * @param string[] $identity The [User](https://www.twilio.com/docs/chat/rest/user-resource)'s `identity` value of the resources to read. + * @return $this Fluent Builder + */ + public function setIdentity(array $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * Only list Bindings that have all of the specified Tags. The following implicit tags are available: `all`, `apn`, `fcm`, `gcm`, `sms`, `facebook-messenger`. Up to 5 tags are allowed. + * + * @param string[] $tag Only list Bindings that have all of the specified Tags. The following implicit tags are available: `all`, `apn`, `fcm`, `gcm`, `sms`, `facebook-messenger`. Up to 5 tags are allowed. + * @return $this Fluent Builder + */ + public function setTag(array $tag): self + { + $this->options['tag'] = $tag; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Notify.V1.ReadBindingOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Notify/V1/Service/BindingPage.php b/app/api/Twilio/Rest/Notify/V1/Service/BindingPage.php new file mode 100755 index 0000000..8417265 --- /dev/null +++ b/app/api/Twilio/Rest/Notify/V1/Service/BindingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return BindingInstance \Twilio\Rest\Notify\V1\Service\BindingInstance + */ + public function buildInstance(array $payload): BindingInstance + { + return new BindingInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Notify.V1.BindingPage]'; + } +} diff --git a/app/api/Twilio/Rest/Notify/V1/Service/NotificationInstance.php b/app/api/Twilio/Rest/Notify/V1/Service/NotificationInstance.php new file mode 100755 index 0000000..22c13f8 --- /dev/null +++ b/app/api/Twilio/Rest/Notify/V1/Service/NotificationInstance.php @@ -0,0 +1,120 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'identities' => Values::array_get($payload, 'identities'), + 'tags' => Values::array_get($payload, 'tags'), + 'segments' => Values::array_get($payload, 'segments'), + 'priority' => Values::array_get($payload, 'priority'), + 'ttl' => Values::array_get($payload, 'ttl'), + 'title' => Values::array_get($payload, 'title'), + 'body' => Values::array_get($payload, 'body'), + 'sound' => Values::array_get($payload, 'sound'), + 'action' => Values::array_get($payload, 'action'), + 'data' => Values::array_get($payload, 'data'), + 'apn' => Values::array_get($payload, 'apn'), + 'gcm' => Values::array_get($payload, 'gcm'), + 'fcm' => Values::array_get($payload, 'fcm'), + 'sms' => Values::array_get($payload, 'sms'), + 'facebookMessenger' => Values::array_get($payload, 'facebook_messenger'), + 'alexa' => Values::array_get($payload, 'alexa'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Notify.V1.NotificationInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Notify/V1/Service/NotificationList.php b/app/api/Twilio/Rest/Notify/V1/Service/NotificationList.php new file mode 100755 index 0000000..5651e55 --- /dev/null +++ b/app/api/Twilio/Rest/Notify/V1/Service/NotificationList.php @@ -0,0 +1,122 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Notifications'; + } + + /** + * Create the NotificationInstance + * + * @param array|Options $options Optional Arguments + * @return NotificationInstance Created NotificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): NotificationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Body' => + $options['body'], + 'Priority' => + $options['priority'], + 'Ttl' => + $options['ttl'], + 'Title' => + $options['title'], + 'Sound' => + $options['sound'], + 'Action' => + $options['action'], + 'Data' => + Serialize::jsonObject($options['data']), + 'Apn' => + Serialize::jsonObject($options['apn']), + 'Gcm' => + Serialize::jsonObject($options['gcm']), + 'Sms' => + Serialize::jsonObject($options['sms']), + 'FacebookMessenger' => + Serialize::jsonObject($options['facebookMessenger']), + 'Fcm' => + Serialize::jsonObject($options['fcm']), + 'Segment' => + Serialize::map($options['segment'], function ($e) { return $e; }), + 'Alexa' => + Serialize::jsonObject($options['alexa']), + 'ToBinding' => + Serialize::map($options['toBinding'], function ($e) { return $e; }), + 'DeliveryCallbackUrl' => + $options['deliveryCallbackUrl'], + 'Identity' => + Serialize::map($options['identity'], function ($e) { return $e; }), + 'Tag' => + Serialize::map($options['tag'], function ($e) { return $e; }), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new NotificationInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Notify.V1.NotificationList]'; + } +} diff --git a/app/api/Twilio/Rest/Notify/V1/Service/NotificationOptions.php b/app/api/Twilio/Rest/Notify/V1/Service/NotificationOptions.php new file mode 100755 index 0000000..da569d6 --- /dev/null +++ b/app/api/Twilio/Rest/Notify/V1/Service/NotificationOptions.php @@ -0,0 +1,380 @@ +options['identity'] = $identity; + $this->options['tag'] = $tag; + $this->options['body'] = $body; + $this->options['priority'] = $priority; + $this->options['ttl'] = $ttl; + $this->options['title'] = $title; + $this->options['sound'] = $sound; + $this->options['action'] = $action; + $this->options['data'] = $data; + $this->options['apn'] = $apn; + $this->options['gcm'] = $gcm; + $this->options['sms'] = $sms; + $this->options['facebookMessenger'] = $facebookMessenger; + $this->options['fcm'] = $fcm; + $this->options['segment'] = $segment; + $this->options['alexa'] = $alexa; + $this->options['toBinding'] = $toBinding; + $this->options['deliveryCallbackUrl'] = $deliveryCallbackUrl; + } + + /** + * The `identity` value that uniquely identifies the new resource's [User](https://www.twilio.com/docs/chat/rest/user-resource) within the [Service](https://www.twilio.com/docs/notify/api/service-resource). Delivery will be attempted only to Bindings with an Identity in this list. No more than 20 items are allowed in this list. + * + * @param string[] $identity The `identity` value that uniquely identifies the new resource's [User](https://www.twilio.com/docs/chat/rest/user-resource) within the [Service](https://www.twilio.com/docs/notify/api/service-resource). Delivery will be attempted only to Bindings with an Identity in this list. No more than 20 items are allowed in this list. + * @return $this Fluent Builder + */ + public function setIdentity(array $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * A tag that selects the Bindings to notify. Repeat this parameter to specify more than one tag, up to a total of 5 tags. The implicit tag `all` is available to notify all Bindings in a Service instance. Similarly, the implicit tags `apn`, `fcm`, `gcm`, `sms` and `facebook-messenger` are available to notify all Bindings in a specific channel. + * + * @param string[] $tag A tag that selects the Bindings to notify. Repeat this parameter to specify more than one tag, up to a total of 5 tags. The implicit tag `all` is available to notify all Bindings in a Service instance. Similarly, the implicit tags `apn`, `fcm`, `gcm`, `sms` and `facebook-messenger` are available to notify all Bindings in a specific channel. + * @return $this Fluent Builder + */ + public function setTag(array $tag): self + { + $this->options['tag'] = $tag; + return $this; + } + + /** + * The notification text. For FCM and GCM, translates to `data.twi_body`. For APNS, translates to `aps.alert.body`. For SMS, translates to `body`. SMS requires either this `body` value, or `media_urls` attribute defined in the `sms` parameter of the notification. + * + * @param string $body The notification text. For FCM and GCM, translates to `data.twi_body`. For APNS, translates to `aps.alert.body`. For SMS, translates to `body`. SMS requires either this `body` value, or `media_urls` attribute defined in the `sms` parameter of the notification. + * @return $this Fluent Builder + */ + public function setBody(string $body): self + { + $this->options['body'] = $body; + return $this; + } + + /** + * @param string $priority + * @return $this Fluent Builder + */ + public function setPriority(string $priority): self + { + $this->options['priority'] = $priority; + return $this; + } + + /** + * How long, in seconds, the notification is valid. Can be an integer between 0 and 2,419,200, which is 4 weeks, the default and the maximum supported time to live (TTL). Delivery should be attempted if the device is offline until the TTL elapses. Zero means that the notification delivery is attempted immediately, only once, and is not stored for future delivery. SMS does not support this property. + * + * @param int $ttl How long, in seconds, the notification is valid. Can be an integer between 0 and 2,419,200, which is 4 weeks, the default and the maximum supported time to live (TTL). Delivery should be attempted if the device is offline until the TTL elapses. Zero means that the notification delivery is attempted immediately, only once, and is not stored for future delivery. SMS does not support this property. + * @return $this Fluent Builder + */ + public function setTtl(int $ttl): self + { + $this->options['ttl'] = $ttl; + return $this; + } + + /** + * The notification title. For FCM and GCM, this translates to the `data.twi_title` value. For APNS, this translates to the `aps.alert.title` value. SMS does not support this property. This field is not visible on iOS phones and tablets but appears on Apple Watch and Android devices. + * + * @param string $title The notification title. For FCM and GCM, this translates to the `data.twi_title` value. For APNS, this translates to the `aps.alert.title` value. SMS does not support this property. This field is not visible on iOS phones and tablets but appears on Apple Watch and Android devices. + * @return $this Fluent Builder + */ + public function setTitle(string $title): self + { + $this->options['title'] = $title; + return $this; + } + + /** + * The name of the sound to be played for the notification. For FCM and GCM, this Translates to `data.twi_sound`. For APNS, this translates to `aps.sound`. SMS does not support this property. + * + * @param string $sound The name of the sound to be played for the notification. For FCM and GCM, this Translates to `data.twi_sound`. For APNS, this translates to `aps.sound`. SMS does not support this property. + * @return $this Fluent Builder + */ + public function setSound(string $sound): self + { + $this->options['sound'] = $sound; + return $this; + } + + /** + * The actions to display for the notification. For APNS, translates to the `aps.category` value. For GCM, translates to the `data.twi_action` value. For SMS, this parameter is not supported and is omitted from deliveries to those channels. + * + * @param string $action The actions to display for the notification. For APNS, translates to the `aps.category` value. For GCM, translates to the `data.twi_action` value. For SMS, this parameter is not supported and is omitted from deliveries to those channels. + * @return $this Fluent Builder + */ + public function setAction(string $action): self + { + $this->options['action'] = $action; + return $this; + } + + /** + * The custom key-value pairs of the notification's payload. For FCM and GCM, this value translates to `data` in the FCM and GCM payloads. FCM and GCM [reserve certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref) that cannot be used in those channels. For APNS, attributes of `data` are inserted into the APNS payload as custom properties outside of the `aps` dictionary. In all channels, we reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed and are rejected as 400 Bad request with no delivery attempted. For SMS, this parameter is not supported and is omitted from deliveries to those channels. + * + * @param array $data The custom key-value pairs of the notification's payload. For FCM and GCM, this value translates to `data` in the FCM and GCM payloads. FCM and GCM [reserve certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref) that cannot be used in those channels. For APNS, attributes of `data` are inserted into the APNS payload as custom properties outside of the `aps` dictionary. In all channels, we reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed and are rejected as 400 Bad request with no delivery attempted. For SMS, this parameter is not supported and is omitted from deliveries to those channels. + * @return $this Fluent Builder + */ + public function setData(array $data): self + { + $this->options['data'] = $data; + return $this; + } + + /** + * The APNS-specific payload that overrides corresponding attributes in the generic payload for APNS Bindings. This property maps to the APNS `Payload` item, therefore the `aps` key must be used to change standard attributes. Adds custom key-value pairs to the root of the dictionary. See the [APNS documentation](https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html) for more details. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. + * + * @param array $apn The APNS-specific payload that overrides corresponding attributes in the generic payload for APNS Bindings. This property maps to the APNS `Payload` item, therefore the `aps` key must be used to change standard attributes. Adds custom key-value pairs to the root of the dictionary. See the [APNS documentation](https://developer.apple.com/library/content/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/CommunicatingwithAPNs.html) for more details. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. + * @return $this Fluent Builder + */ + public function setApn(array $apn): self + { + $this->options['apn'] = $apn; + return $this; + } + + /** + * The GCM-specific payload that overrides corresponding attributes in the generic payload for GCM Bindings. This property maps to the root JSON dictionary. See the [GCM documentation](https://firebase.google.com/docs/cloud-messaging/http-server-ref) for more details. Target parameters `to`, `registration_ids`, and `notification_key` are not allowed. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. GCM also [reserves certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref). + * + * @param array $gcm The GCM-specific payload that overrides corresponding attributes in the generic payload for GCM Bindings. This property maps to the root JSON dictionary. See the [GCM documentation](https://firebase.google.com/docs/cloud-messaging/http-server-ref) for more details. Target parameters `to`, `registration_ids`, and `notification_key` are not allowed. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. GCM also [reserves certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref). + * @return $this Fluent Builder + */ + public function setGcm(array $gcm): self + { + $this->options['gcm'] = $gcm; + return $this; + } + + /** + * The SMS-specific payload that overrides corresponding attributes in the generic payload for SMS Bindings. Each attribute in this value maps to the corresponding `form` parameter of the Twilio [Message](https://www.twilio.com/docs/sms/send-messages) resource. These parameters of the Message resource are supported in snake case format: `body`, `media_urls`, `status_callback`, and `max_price`. The `status_callback` parameter overrides the corresponding parameter in the messaging service, if configured. The `media_urls` property expects a JSON array. + * + * @param array $sms The SMS-specific payload that overrides corresponding attributes in the generic payload for SMS Bindings. Each attribute in this value maps to the corresponding `form` parameter of the Twilio [Message](https://www.twilio.com/docs/sms/send-messages) resource. These parameters of the Message resource are supported in snake case format: `body`, `media_urls`, `status_callback`, and `max_price`. The `status_callback` parameter overrides the corresponding parameter in the messaging service, if configured. The `media_urls` property expects a JSON array. + * @return $this Fluent Builder + */ + public function setSms(array $sms): self + { + $this->options['sms'] = $sms; + return $this; + } + + /** + * Deprecated. + * + * @param array $facebookMessenger Deprecated. + * @return $this Fluent Builder + */ + public function setFacebookMessenger(array $facebookMessenger): self + { + $this->options['facebookMessenger'] = $facebookMessenger; + return $this; + } + + /** + * The FCM-specific payload that overrides corresponding attributes in the generic payload for FCM Bindings. This property maps to the root JSON dictionary. See the [FCM documentation](https://firebase.google.com/docs/cloud-messaging/http-server-ref#downstream) for more details. Target parameters `to`, `registration_ids`, `condition`, and `notification_key` are not allowed in this parameter. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. FCM also [reserves certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref), which cannot be used in that channel. + * + * @param array $fcm The FCM-specific payload that overrides corresponding attributes in the generic payload for FCM Bindings. This property maps to the root JSON dictionary. See the [FCM documentation](https://firebase.google.com/docs/cloud-messaging/http-server-ref#downstream) for more details. Target parameters `to`, `registration_ids`, `condition`, and `notification_key` are not allowed in this parameter. We reserve keys that start with `twi_` for future use. Custom keys that start with `twi_` are not allowed. FCM also [reserves certain keys](https://firebase.google.com/docs/cloud-messaging/http-server-ref), which cannot be used in that channel. + * @return $this Fluent Builder + */ + public function setFcm(array $fcm): self + { + $this->options['fcm'] = $fcm; + return $this; + } + + /** + * The Segment resource is deprecated. Use the `tag` parameter, instead. + * + * @param string[] $segment The Segment resource is deprecated. Use the `tag` parameter, instead. + * @return $this Fluent Builder + */ + public function setSegment(array $segment): self + { + $this->options['segment'] = $segment; + return $this; + } + + /** + * Deprecated. + * + * @param array $alexa Deprecated. + * @return $this Fluent Builder + */ + public function setAlexa(array $alexa): self + { + $this->options['alexa'] = $alexa; + return $this; + } + + /** + * The destination address specified as a JSON string. Multiple `to_binding` parameters can be included but the total size of the request entity should not exceed 1MB. This is typically sufficient for 10,000 phone numbers. + * + * @param string[] $toBinding The destination address specified as a JSON string. Multiple `to_binding` parameters can be included but the total size of the request entity should not exceed 1MB. This is typically sufficient for 10,000 phone numbers. + * @return $this Fluent Builder + */ + public function setToBinding(array $toBinding): self + { + $this->options['toBinding'] = $toBinding; + return $this; + } + + /** + * URL to send webhooks. + * + * @param string $deliveryCallbackUrl URL to send webhooks. + * @return $this Fluent Builder + */ + public function setDeliveryCallbackUrl(string $deliveryCallbackUrl): self + { + $this->options['deliveryCallbackUrl'] = $deliveryCallbackUrl; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Notify.V1.CreateNotificationOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Notify/V1/Service/NotificationPage.php b/app/api/Twilio/Rest/Notify/V1/Service/NotificationPage.php new file mode 100755 index 0000000..272007c --- /dev/null +++ b/app/api/Twilio/Rest/Notify/V1/Service/NotificationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return NotificationInstance \Twilio\Rest\Notify\V1\Service\NotificationInstance + */ + public function buildInstance(array $payload): NotificationInstance + { + return new NotificationInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Notify.V1.NotificationPage]'; + } +} diff --git a/app/api/Twilio/Rest/Notify/V1/ServiceContext.php b/app/api/Twilio/Rest/Notify/V1/ServiceContext.php new file mode 100755 index 0000000..fdab62c --- /dev/null +++ b/app/api/Twilio/Rest/Notify/V1/ServiceContext.php @@ -0,0 +1,226 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'ApnCredentialSid' => + $options['apnCredentialSid'], + 'GcmCredentialSid' => + $options['gcmCredentialSid'], + 'MessagingServiceSid' => + $options['messagingServiceSid'], + 'FacebookMessengerPageId' => + $options['facebookMessengerPageId'], + 'DefaultApnNotificationProtocolVersion' => + $options['defaultApnNotificationProtocolVersion'], + 'DefaultGcmNotificationProtocolVersion' => + $options['defaultGcmNotificationProtocolVersion'], + 'FcmCredentialSid' => + $options['fcmCredentialSid'], + 'DefaultFcmNotificationProtocolVersion' => + $options['defaultFcmNotificationProtocolVersion'], + 'LogEnabled' => + Serialize::booleanToString($options['logEnabled']), + 'AlexaSkillId' => + $options['alexaSkillId'], + 'DefaultAlexaNotificationProtocolVersion' => + $options['defaultAlexaNotificationProtocolVersion'], + 'DeliveryCallbackUrl' => + $options['deliveryCallbackUrl'], + 'DeliveryCallbackEnabled' => + Serialize::booleanToString($options['deliveryCallbackEnabled']), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the notifications + */ + protected function getNotifications(): NotificationList + { + if (!$this->_notifications) { + $this->_notifications = new NotificationList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_notifications; + } + + /** + * Access the bindings + */ + protected function getBindings(): BindingList + { + if (!$this->_bindings) { + $this->_bindings = new BindingList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_bindings; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Notify.V1.ServiceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Notify/V1/ServiceInstance.php b/app/api/Twilio/Rest/Notify/V1/ServiceInstance.php new file mode 100755 index 0000000..d856dd9 --- /dev/null +++ b/app/api/Twilio/Rest/Notify/V1/ServiceInstance.php @@ -0,0 +1,201 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'apnCredentialSid' => Values::array_get($payload, 'apn_credential_sid'), + 'gcmCredentialSid' => Values::array_get($payload, 'gcm_credential_sid'), + 'fcmCredentialSid' => Values::array_get($payload, 'fcm_credential_sid'), + 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), + 'facebookMessengerPageId' => Values::array_get($payload, 'facebook_messenger_page_id'), + 'defaultApnNotificationProtocolVersion' => Values::array_get($payload, 'default_apn_notification_protocol_version'), + 'defaultGcmNotificationProtocolVersion' => Values::array_get($payload, 'default_gcm_notification_protocol_version'), + 'defaultFcmNotificationProtocolVersion' => Values::array_get($payload, 'default_fcm_notification_protocol_version'), + 'logEnabled' => Values::array_get($payload, 'log_enabled'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + 'alexaSkillId' => Values::array_get($payload, 'alexa_skill_id'), + 'defaultAlexaNotificationProtocolVersion' => Values::array_get($payload, 'default_alexa_notification_protocol_version'), + 'deliveryCallbackUrl' => Values::array_get($payload, 'delivery_callback_url'), + 'deliveryCallbackEnabled' => Values::array_get($payload, 'delivery_callback_enabled'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ServiceContext Context for this ServiceInstance + */ + protected function proxy(): ServiceContext + { + if (!$this->context) { + $this->context = new ServiceContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the notifications + */ + protected function getNotifications(): NotificationList + { + return $this->proxy()->notifications; + } + + /** + * Access the bindings + */ + protected function getBindings(): BindingList + { + return $this->proxy()->bindings; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Notify.V1.ServiceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Notify/V1/ServiceList.php b/app/api/Twilio/Rest/Notify/V1/ServiceList.php new file mode 100755 index 0000000..c007e8a --- /dev/null +++ b/app/api/Twilio/Rest/Notify/V1/ServiceList.php @@ -0,0 +1,222 @@ +solution = [ + ]; + + $this->uri = '/Services'; + } + + /** + * Create the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Created ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): ServiceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'ApnCredentialSid' => + $options['apnCredentialSid'], + 'GcmCredentialSid' => + $options['gcmCredentialSid'], + 'MessagingServiceSid' => + $options['messagingServiceSid'], + 'FacebookMessengerPageId' => + $options['facebookMessengerPageId'], + 'DefaultApnNotificationProtocolVersion' => + $options['defaultApnNotificationProtocolVersion'], + 'DefaultGcmNotificationProtocolVersion' => + $options['defaultGcmNotificationProtocolVersion'], + 'FcmCredentialSid' => + $options['fcmCredentialSid'], + 'DefaultFcmNotificationProtocolVersion' => + $options['defaultFcmNotificationProtocolVersion'], + 'LogEnabled' => + Serialize::booleanToString($options['logEnabled']), + 'AlexaSkillId' => + $options['alexaSkillId'], + 'DefaultAlexaNotificationProtocolVersion' => + $options['defaultAlexaNotificationProtocolVersion'], + 'DeliveryCallbackUrl' => + $options['deliveryCallbackUrl'], + 'DeliveryCallbackEnabled' => + Serialize::booleanToString($options['deliveryCallbackEnabled']), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new ServiceInstance( + $this->version, + $payload + ); + } + + + /** + * Reads ServiceInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ServiceInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams ServiceInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ServiceInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ServicePage Page of ServiceInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ServicePage + { + $options = new Values($options); + + $params = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ServicePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ServiceInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ServicePage Page of ServiceInstance + */ + public function getPage(string $targetUrl): ServicePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ServicePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ServiceContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Service resource to delete. + */ + public function getContext( + string $sid + + ): ServiceContext + { + return new ServiceContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Notify.V1.ServiceList]'; + } +} diff --git a/app/api/Twilio/Rest/Notify/V1/ServiceOptions.php b/app/api/Twilio/Rest/Notify/V1/ServiceOptions.php new file mode 100755 index 0000000..7b7e687 --- /dev/null +++ b/app/api/Twilio/Rest/Notify/V1/ServiceOptions.php @@ -0,0 +1,652 @@ +options['friendlyName'] = $friendlyName; + $this->options['apnCredentialSid'] = $apnCredentialSid; + $this->options['gcmCredentialSid'] = $gcmCredentialSid; + $this->options['messagingServiceSid'] = $messagingServiceSid; + $this->options['facebookMessengerPageId'] = $facebookMessengerPageId; + $this->options['defaultApnNotificationProtocolVersion'] = $defaultApnNotificationProtocolVersion; + $this->options['defaultGcmNotificationProtocolVersion'] = $defaultGcmNotificationProtocolVersion; + $this->options['fcmCredentialSid'] = $fcmCredentialSid; + $this->options['defaultFcmNotificationProtocolVersion'] = $defaultFcmNotificationProtocolVersion; + $this->options['logEnabled'] = $logEnabled; + $this->options['alexaSkillId'] = $alexaSkillId; + $this->options['defaultAlexaNotificationProtocolVersion'] = $defaultAlexaNotificationProtocolVersion; + $this->options['deliveryCallbackUrl'] = $deliveryCallbackUrl; + $this->options['deliveryCallbackEnabled'] = $deliveryCallbackEnabled; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. + * + * @param string $apnCredentialSid The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. + * @return $this Fluent Builder + */ + public function setApnCredentialSid(string $apnCredentialSid): self + { + $this->options['apnCredentialSid'] = $apnCredentialSid; + return $this; + } + + /** + * The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. + * + * @param string $gcmCredentialSid The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. + * @return $this Fluent Builder + */ + public function setGcmCredentialSid(string $gcmCredentialSid): self + { + $this->options['gcmCredentialSid'] = $gcmCredentialSid; + return $this; + } + + /** + * The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. + * + * @param string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. + * @return $this Fluent Builder + */ + public function setMessagingServiceSid(string $messagingServiceSid): self + { + $this->options['messagingServiceSid'] = $messagingServiceSid; + return $this; + } + + /** + * Deprecated. + * + * @param string $facebookMessengerPageId Deprecated. + * @return $this Fluent Builder + */ + public function setFacebookMessengerPageId(string $facebookMessengerPageId): self + { + $this->options['facebookMessengerPageId'] = $facebookMessengerPageId; + return $this; + } + + /** + * The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. + * + * @param string $defaultApnNotificationProtocolVersion The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. + * @return $this Fluent Builder + */ + public function setDefaultApnNotificationProtocolVersion(string $defaultApnNotificationProtocolVersion): self + { + $this->options['defaultApnNotificationProtocolVersion'] = $defaultApnNotificationProtocolVersion; + return $this; + } + + /** + * The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. + * + * @param string $defaultGcmNotificationProtocolVersion The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. + * @return $this Fluent Builder + */ + public function setDefaultGcmNotificationProtocolVersion(string $defaultGcmNotificationProtocolVersion): self + { + $this->options['defaultGcmNotificationProtocolVersion'] = $defaultGcmNotificationProtocolVersion; + return $this; + } + + /** + * The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for FCM Bindings. + * + * @param string $fcmCredentialSid The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for FCM Bindings. + * @return $this Fluent Builder + */ + public function setFcmCredentialSid(string $fcmCredentialSid): self + { + $this->options['fcmCredentialSid'] = $fcmCredentialSid; + return $this; + } + + /** + * The protocol version to use for sending FCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. + * + * @param string $defaultFcmNotificationProtocolVersion The protocol version to use for sending FCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. + * @return $this Fluent Builder + */ + public function setDefaultFcmNotificationProtocolVersion(string $defaultFcmNotificationProtocolVersion): self + { + $this->options['defaultFcmNotificationProtocolVersion'] = $defaultFcmNotificationProtocolVersion; + return $this; + } + + /** + * Whether to log notifications. Can be: `true` or `false` and the default is `true`. + * + * @param bool $logEnabled Whether to log notifications. Can be: `true` or `false` and the default is `true`. + * @return $this Fluent Builder + */ + public function setLogEnabled(bool $logEnabled): self + { + $this->options['logEnabled'] = $logEnabled; + return $this; + } + + /** + * Deprecated. + * + * @param string $alexaSkillId Deprecated. + * @return $this Fluent Builder + */ + public function setAlexaSkillId(string $alexaSkillId): self + { + $this->options['alexaSkillId'] = $alexaSkillId; + return $this; + } + + /** + * Deprecated. + * + * @param string $defaultAlexaNotificationProtocolVersion Deprecated. + * @return $this Fluent Builder + */ + public function setDefaultAlexaNotificationProtocolVersion(string $defaultAlexaNotificationProtocolVersion): self + { + $this->options['defaultAlexaNotificationProtocolVersion'] = $defaultAlexaNotificationProtocolVersion; + return $this; + } + + /** + * URL to send delivery status callback. + * + * @param string $deliveryCallbackUrl URL to send delivery status callback. + * @return $this Fluent Builder + */ + public function setDeliveryCallbackUrl(string $deliveryCallbackUrl): self + { + $this->options['deliveryCallbackUrl'] = $deliveryCallbackUrl; + return $this; + } + + /** + * Callback configuration that enables delivery callbacks, default false + * + * @param bool $deliveryCallbackEnabled Callback configuration that enables delivery callbacks, default false + * @return $this Fluent Builder + */ + public function setDeliveryCallbackEnabled(bool $deliveryCallbackEnabled): self + { + $this->options['deliveryCallbackEnabled'] = $deliveryCallbackEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Notify.V1.CreateServiceOptions ' . $options . ']'; + } +} + + + +class ReadServiceOptions extends Options + { + /** + * @param string $friendlyName The string that identifies the Service resources to read. + */ + public function __construct( + + string $friendlyName = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + } + + /** + * The string that identifies the Service resources to read. + * + * @param string $friendlyName The string that identifies the Service resources to read. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Notify.V1.ReadServiceOptions ' . $options . ']'; + } +} + +class UpdateServiceOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @param string $apnCredentialSid The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. + * @param string $gcmCredentialSid The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. + * @param string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. + * @param string $facebookMessengerPageId Deprecated. + * @param string $defaultApnNotificationProtocolVersion The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. + * @param string $defaultGcmNotificationProtocolVersion The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. + * @param string $fcmCredentialSid The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for FCM Bindings. + * @param string $defaultFcmNotificationProtocolVersion The protocol version to use for sending FCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. + * @param bool $logEnabled Whether to log notifications. Can be: `true` or `false` and the default is `true`. + * @param string $alexaSkillId Deprecated. + * @param string $defaultAlexaNotificationProtocolVersion Deprecated. + * @param string $deliveryCallbackUrl URL to send delivery status callback. + * @param bool $deliveryCallbackEnabled Callback configuration that enables delivery callbacks, default false + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $apnCredentialSid = Values::NONE, + string $gcmCredentialSid = Values::NONE, + string $messagingServiceSid = Values::NONE, + string $facebookMessengerPageId = Values::NONE, + string $defaultApnNotificationProtocolVersion = Values::NONE, + string $defaultGcmNotificationProtocolVersion = Values::NONE, + string $fcmCredentialSid = Values::NONE, + string $defaultFcmNotificationProtocolVersion = Values::NONE, + bool $logEnabled = Values::BOOL_NONE, + string $alexaSkillId = Values::NONE, + string $defaultAlexaNotificationProtocolVersion = Values::NONE, + string $deliveryCallbackUrl = Values::NONE, + bool $deliveryCallbackEnabled = Values::BOOL_NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['apnCredentialSid'] = $apnCredentialSid; + $this->options['gcmCredentialSid'] = $gcmCredentialSid; + $this->options['messagingServiceSid'] = $messagingServiceSid; + $this->options['facebookMessengerPageId'] = $facebookMessengerPageId; + $this->options['defaultApnNotificationProtocolVersion'] = $defaultApnNotificationProtocolVersion; + $this->options['defaultGcmNotificationProtocolVersion'] = $defaultGcmNotificationProtocolVersion; + $this->options['fcmCredentialSid'] = $fcmCredentialSid; + $this->options['defaultFcmNotificationProtocolVersion'] = $defaultFcmNotificationProtocolVersion; + $this->options['logEnabled'] = $logEnabled; + $this->options['alexaSkillId'] = $alexaSkillId; + $this->options['defaultAlexaNotificationProtocolVersion'] = $defaultAlexaNotificationProtocolVersion; + $this->options['deliveryCallbackUrl'] = $deliveryCallbackUrl; + $this->options['deliveryCallbackEnabled'] = $deliveryCallbackEnabled; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. + * + * @param string $apnCredentialSid The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for APN Bindings. + * @return $this Fluent Builder + */ + public function setApnCredentialSid(string $apnCredentialSid): self + { + $this->options['apnCredentialSid'] = $apnCredentialSid; + return $this; + } + + /** + * The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. + * + * @param string $gcmCredentialSid The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for GCM Bindings. + * @return $this Fluent Builder + */ + public function setGcmCredentialSid(string $gcmCredentialSid): self + { + $this->options['gcmCredentialSid'] = $gcmCredentialSid; + return $this; + } + + /** + * The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. + * + * @param string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/sms/send-messages#messaging-services) to use for SMS Bindings. This parameter must be set in order to send SMS notifications. + * @return $this Fluent Builder + */ + public function setMessagingServiceSid(string $messagingServiceSid): self + { + $this->options['messagingServiceSid'] = $messagingServiceSid; + return $this; + } + + /** + * Deprecated. + * + * @param string $facebookMessengerPageId Deprecated. + * @return $this Fluent Builder + */ + public function setFacebookMessengerPageId(string $facebookMessengerPageId): self + { + $this->options['facebookMessengerPageId'] = $facebookMessengerPageId; + return $this; + } + + /** + * The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. + * + * @param string $defaultApnNotificationProtocolVersion The protocol version to use for sending APNS notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. + * @return $this Fluent Builder + */ + public function setDefaultApnNotificationProtocolVersion(string $defaultApnNotificationProtocolVersion): self + { + $this->options['defaultApnNotificationProtocolVersion'] = $defaultApnNotificationProtocolVersion; + return $this; + } + + /** + * The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. + * + * @param string $defaultGcmNotificationProtocolVersion The protocol version to use for sending GCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. + * @return $this Fluent Builder + */ + public function setDefaultGcmNotificationProtocolVersion(string $defaultGcmNotificationProtocolVersion): self + { + $this->options['defaultGcmNotificationProtocolVersion'] = $defaultGcmNotificationProtocolVersion; + return $this; + } + + /** + * The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for FCM Bindings. + * + * @param string $fcmCredentialSid The SID of the [Credential](https://www.twilio.com/docs/notify/api/credential-resource) to use for FCM Bindings. + * @return $this Fluent Builder + */ + public function setFcmCredentialSid(string $fcmCredentialSid): self + { + $this->options['fcmCredentialSid'] = $fcmCredentialSid; + return $this; + } + + /** + * The protocol version to use for sending FCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. + * + * @param string $defaultFcmNotificationProtocolVersion The protocol version to use for sending FCM notifications. Can be overridden on a Binding by Binding basis when creating a [Binding](https://www.twilio.com/docs/notify/api/binding-resource) resource. + * @return $this Fluent Builder + */ + public function setDefaultFcmNotificationProtocolVersion(string $defaultFcmNotificationProtocolVersion): self + { + $this->options['defaultFcmNotificationProtocolVersion'] = $defaultFcmNotificationProtocolVersion; + return $this; + } + + /** + * Whether to log notifications. Can be: `true` or `false` and the default is `true`. + * + * @param bool $logEnabled Whether to log notifications. Can be: `true` or `false` and the default is `true`. + * @return $this Fluent Builder + */ + public function setLogEnabled(bool $logEnabled): self + { + $this->options['logEnabled'] = $logEnabled; + return $this; + } + + /** + * Deprecated. + * + * @param string $alexaSkillId Deprecated. + * @return $this Fluent Builder + */ + public function setAlexaSkillId(string $alexaSkillId): self + { + $this->options['alexaSkillId'] = $alexaSkillId; + return $this; + } + + /** + * Deprecated. + * + * @param string $defaultAlexaNotificationProtocolVersion Deprecated. + * @return $this Fluent Builder + */ + public function setDefaultAlexaNotificationProtocolVersion(string $defaultAlexaNotificationProtocolVersion): self + { + $this->options['defaultAlexaNotificationProtocolVersion'] = $defaultAlexaNotificationProtocolVersion; + return $this; + } + + /** + * URL to send delivery status callback. + * + * @param string $deliveryCallbackUrl URL to send delivery status callback. + * @return $this Fluent Builder + */ + public function setDeliveryCallbackUrl(string $deliveryCallbackUrl): self + { + $this->options['deliveryCallbackUrl'] = $deliveryCallbackUrl; + return $this; + } + + /** + * Callback configuration that enables delivery callbacks, default false + * + * @param bool $deliveryCallbackEnabled Callback configuration that enables delivery callbacks, default false + * @return $this Fluent Builder + */ + public function setDeliveryCallbackEnabled(bool $deliveryCallbackEnabled): self + { + $this->options['deliveryCallbackEnabled'] = $deliveryCallbackEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Notify.V1.UpdateServiceOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Notify/V1/ServicePage.php b/app/api/Twilio/Rest/Notify/V1/ServicePage.php new file mode 100755 index 0000000..42befbd --- /dev/null +++ b/app/api/Twilio/Rest/Notify/V1/ServicePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ServiceInstance \Twilio\Rest\Notify\V1\ServiceInstance + */ + public function buildInstance(array $payload): ServiceInstance + { + return new ServiceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Notify.V1.ServicePage]'; + } +} diff --git a/app/api/Twilio/Rest/NotifyBase.php b/app/api/Twilio/Rest/NotifyBase.php new file mode 100755 index 0000000..d58b14c --- /dev/null +++ b/app/api/Twilio/Rest/NotifyBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://notify.twilio.com'; + } + + + /** + * @return V1 Version v1 of notify + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Notify]'; + } +} diff --git a/app/api/Twilio/Rest/Numbers.php b/app/api/Twilio/Rest/Numbers.php new file mode 100755 index 0000000..a27c291 --- /dev/null +++ b/app/api/Twilio/Rest/Numbers.php @@ -0,0 +1,16 @@ +regulatoryCompliance instead. + */ + protected function getRegulatoryCompliance(): \Twilio\Rest\Numbers\V2\RegulatoryComplianceList { + echo "regulatoryCompliance is deprecated. Use v2->regulatoryCompliance instead."; + return $this->v2->regulatoryCompliance; + } + +} \ No newline at end of file diff --git a/app/api/Twilio/Rest/Numbers/V2.php b/app/api/Twilio/Rest/Numbers/V2.php new file mode 100755 index 0000000..2de1d88 --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2.php @@ -0,0 +1,94 @@ +version = 'v2'; + } + + protected function getRegulatoryCompliance(): RegulatoryComplianceList + { + if (!$this->_regulatoryCompliance) { + $this->_regulatoryCompliance = new RegulatoryComplianceList($this); + } + return $this->_regulatoryCompliance; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2]'; + } +} diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyInstance.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyInstance.php new file mode 100755 index 0000000..38243ac --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyInstance.php @@ -0,0 +1,100 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'regulationSid' => Values::array_get($payload, 'regulation_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'status' => Values::array_get($payload, 'status'), + 'validUntil' => Deserialize::dateTime(Values::array_get($payload, 'valid_until')), + 'email' => Values::array_get($payload, 'email'), + 'statusCallback' => Values::array_get($payload, 'status_callback'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + ]; + + $this->solution = ['bundleSid' => $bundleSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.BundleCopyInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyList.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyList.php new file mode 100755 index 0000000..e9245b6 --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyList.php @@ -0,0 +1,180 @@ +solution = [ + 'bundleSid' => + $bundleSid, + + ]; + + $this->uri = '/RegulatoryCompliance/Bundles/' . \rawurlencode($bundleSid) + .'/Copies'; + } + + /** + * Create the BundleCopyInstance + * + * @param array|Options $options Optional Arguments + * @return BundleCopyInstance Created BundleCopyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): BundleCopyInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new BundleCopyInstance( + $this->version, + $payload, + $this->solution['bundleSid'] + ); + } + + + /** + * Reads BundleCopyInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return BundleCopyInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams BundleCopyInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of BundleCopyInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return BundleCopyPage Page of BundleCopyInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): BundleCopyPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new BundleCopyPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of BundleCopyInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return BundleCopyPage Page of BundleCopyInstance + */ + public function getPage(string $targetUrl): BundleCopyPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new BundleCopyPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.BundleCopyList]'; + } +} diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyOptions.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyOptions.php new file mode 100755 index 0000000..7d889e0 --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyOptions.php @@ -0,0 +1,78 @@ +options['friendlyName'] = $friendlyName; + } + + /** + * The string that you assigned to describe the copied bundle. + * + * @param string $friendlyName The string that you assigned to describe the copied bundle. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Numbers.V2.CreateBundleCopyOptions ' . $options . ']'; + } +} + + diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyPage.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyPage.php new file mode 100755 index 0000000..c68b526 --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/BundleCopyPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return BundleCopyInstance \Twilio\Rest\Numbers\V2\RegulatoryCompliance\Bundle\BundleCopyInstance + */ + public function buildInstance(array $payload): BundleCopyInstance + { + return new BundleCopyInstance($this->version, $payload, $this->solution['bundleSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.BundleCopyPage]'; + } +} diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationContext.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationContext.php new file mode 100755 index 0000000..aa94064 --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationContext.php @@ -0,0 +1,87 @@ +solution = [ + 'bundleSid' => + $bundleSid, + 'sid' => + $sid, + ]; + + $this->uri = '/RegulatoryCompliance/Bundles/' . \rawurlencode($bundleSid) + .'/Evaluations/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the EvaluationInstance + * + * @return EvaluationInstance Fetched EvaluationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EvaluationInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new EvaluationInstance( + $this->version, + $payload, + $this->solution['bundleSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V2.EvaluationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationInstance.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationInstance.php new file mode 100755 index 0000000..53642b3 --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationInstance.php @@ -0,0 +1,132 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'regulationSid' => Values::array_get($payload, 'regulation_sid'), + 'bundleSid' => Values::array_get($payload, 'bundle_sid'), + 'status' => Values::array_get($payload, 'status'), + 'results' => Values::array_get($payload, 'results'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['bundleSid' => $bundleSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return EvaluationContext Context for this EvaluationInstance + */ + protected function proxy(): EvaluationContext + { + if (!$this->context) { + $this->context = new EvaluationContext( + $this->version, + $this->solution['bundleSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the EvaluationInstance + * + * @return EvaluationInstance Fetched EvaluationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EvaluationInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V2.EvaluationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationList.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationList.php new file mode 100755 index 0000000..9c318c9 --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationList.php @@ -0,0 +1,188 @@ +solution = [ + 'bundleSid' => + $bundleSid, + + ]; + + $this->uri = '/RegulatoryCompliance/Bundles/' . \rawurlencode($bundleSid) + .'/Evaluations'; + } + + /** + * Create the EvaluationInstance + * + * @return EvaluationInstance Created EvaluationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(): EvaluationInstance + { + + $payload = $this->version->create('POST', $this->uri); + + return new EvaluationInstance( + $this->version, + $payload, + $this->solution['bundleSid'] + ); + } + + + /** + * Reads EvaluationInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return EvaluationInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams EvaluationInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of EvaluationInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return EvaluationPage Page of EvaluationInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): EvaluationPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new EvaluationPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of EvaluationInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return EvaluationPage Page of EvaluationInstance + */ + public function getPage(string $targetUrl): EvaluationPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new EvaluationPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a EvaluationContext + * + * @param string $sid The unique string that identifies the Evaluation resource. + */ + public function getContext( + string $sid + + ): EvaluationContext + { + return new EvaluationContext( + $this->version, + $this->solution['bundleSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.EvaluationList]'; + } +} diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationPage.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationPage.php new file mode 100755 index 0000000..38b2093 --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/EvaluationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return EvaluationInstance \Twilio\Rest\Numbers\V2\RegulatoryCompliance\Bundle\EvaluationInstance + */ + public function buildInstance(array $payload): EvaluationInstance + { + return new EvaluationInstance($this->version, $payload, $this->solution['bundleSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.EvaluationPage]'; + } +} diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentContext.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentContext.php new file mode 100755 index 0000000..23ca7ef --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentContext.php @@ -0,0 +1,100 @@ +solution = [ + 'bundleSid' => + $bundleSid, + 'sid' => + $sid, + ]; + + $this->uri = '/RegulatoryCompliance/Bundles/' . \rawurlencode($bundleSid) + .'/ItemAssignments/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ItemAssignmentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the ItemAssignmentInstance + * + * @return ItemAssignmentInstance Fetched ItemAssignmentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ItemAssignmentInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ItemAssignmentInstance( + $this->version, + $payload, + $this->solution['bundleSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V2.ItemAssignmentContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentInstance.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentInstance.php new file mode 100755 index 0000000..8d4df41 --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentInstance.php @@ -0,0 +1,140 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'bundleSid' => Values::array_get($payload, 'bundle_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'objectSid' => Values::array_get($payload, 'object_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['bundleSid' => $bundleSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ItemAssignmentContext Context for this ItemAssignmentInstance + */ + protected function proxy(): ItemAssignmentContext + { + if (!$this->context) { + $this->context = new ItemAssignmentContext( + $this->version, + $this->solution['bundleSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ItemAssignmentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ItemAssignmentInstance + * + * @return ItemAssignmentInstance Fetched ItemAssignmentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ItemAssignmentInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V2.ItemAssignmentInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentList.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentList.php new file mode 100755 index 0000000..7f464f0 --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentList.php @@ -0,0 +1,194 @@ +solution = [ + 'bundleSid' => + $bundleSid, + + ]; + + $this->uri = '/RegulatoryCompliance/Bundles/' . \rawurlencode($bundleSid) + .'/ItemAssignments'; + } + + /** + * Create the ItemAssignmentInstance + * + * @param string $objectSid The SID of an object bag that holds information of the different items. + * @return ItemAssignmentInstance Created ItemAssignmentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $objectSid): ItemAssignmentInstance + { + + $data = Values::of([ + 'ObjectSid' => + $objectSid, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new ItemAssignmentInstance( + $this->version, + $payload, + $this->solution['bundleSid'] + ); + } + + + /** + * Reads ItemAssignmentInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ItemAssignmentInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ItemAssignmentInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ItemAssignmentInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ItemAssignmentPage Page of ItemAssignmentInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ItemAssignmentPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ItemAssignmentPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ItemAssignmentInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ItemAssignmentPage Page of ItemAssignmentInstance + */ + public function getPage(string $targetUrl): ItemAssignmentPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ItemAssignmentPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ItemAssignmentContext + * + * @param string $sid The unique string that we created to identify the Identity resource. + */ + public function getContext( + string $sid + + ): ItemAssignmentContext + { + return new ItemAssignmentContext( + $this->version, + $this->solution['bundleSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.ItemAssignmentList]'; + } +} diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentPage.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentPage.php new file mode 100755 index 0000000..7866eaa --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ItemAssignmentPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ItemAssignmentInstance \Twilio\Rest\Numbers\V2\RegulatoryCompliance\Bundle\ItemAssignmentInstance + */ + public function buildInstance(array $payload): ItemAssignmentInstance + { + return new ItemAssignmentInstance($this->version, $payload, $this->solution['bundleSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.ItemAssignmentPage]'; + } +} diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ReplaceItemsInstance.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ReplaceItemsInstance.php new file mode 100755 index 0000000..6dc5153 --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ReplaceItemsInstance.php @@ -0,0 +1,100 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'regulationSid' => Values::array_get($payload, 'regulation_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'status' => Values::array_get($payload, 'status'), + 'validUntil' => Deserialize::dateTime(Values::array_get($payload, 'valid_until')), + 'email' => Values::array_get($payload, 'email'), + 'statusCallback' => Values::array_get($payload, 'status_callback'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + ]; + + $this->solution = ['bundleSid' => $bundleSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.ReplaceItemsInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ReplaceItemsList.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ReplaceItemsList.php new file mode 100755 index 0000000..fe68f05 --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ReplaceItemsList.php @@ -0,0 +1,84 @@ +solution = [ + 'bundleSid' => + $bundleSid, + + ]; + + $this->uri = '/RegulatoryCompliance/Bundles/' . \rawurlencode($bundleSid) + .'/ReplaceItems'; + } + + /** + * Create the ReplaceItemsInstance + * + * @param string $fromBundleSid The source bundle sid to copy the item assignments from. + * @return ReplaceItemsInstance Created ReplaceItemsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $fromBundleSid): ReplaceItemsInstance + { + + $data = Values::of([ + 'FromBundleSid' => + $fromBundleSid, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new ReplaceItemsInstance( + $this->version, + $payload, + $this->solution['bundleSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.ReplaceItemsList]'; + } +} diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ReplaceItemsPage.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ReplaceItemsPage.php new file mode 100755 index 0000000..8efde21 --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/Bundle/ReplaceItemsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ReplaceItemsInstance \Twilio\Rest\Numbers\V2\RegulatoryCompliance\Bundle\ReplaceItemsInstance + */ + public function buildInstance(array $payload): ReplaceItemsInstance + { + return new ReplaceItemsInstance($this->version, $payload, $this->solution['bundleSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.ReplaceItemsPage]'; + } +} diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleContext.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleContext.php new file mode 100755 index 0000000..55acdfe --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleContext.php @@ -0,0 +1,242 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/RegulatoryCompliance/Bundles/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the BundleInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the BundleInstance + * + * @return BundleInstance Fetched BundleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BundleInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new BundleInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the BundleInstance + * + * @param array|Options $options Optional Arguments + * @return BundleInstance Updated BundleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): BundleInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Status' => + $options['status'], + 'StatusCallback' => + $options['statusCallback'], + 'FriendlyName' => + $options['friendlyName'], + 'Email' => + $options['email'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new BundleInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the bundleCopies + */ + protected function getBundleCopies(): BundleCopyList + { + if (!$this->_bundleCopies) { + $this->_bundleCopies = new BundleCopyList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_bundleCopies; + } + + /** + * Access the replaceItems + */ + protected function getReplaceItems(): ReplaceItemsList + { + if (!$this->_replaceItems) { + $this->_replaceItems = new ReplaceItemsList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_replaceItems; + } + + /** + * Access the evaluations + */ + protected function getEvaluations(): EvaluationList + { + if (!$this->_evaluations) { + $this->_evaluations = new EvaluationList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_evaluations; + } + + /** + * Access the itemAssignments + */ + protected function getItemAssignments(): ItemAssignmentList + { + if (!$this->_itemAssignments) { + $this->_itemAssignments = new ItemAssignmentList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_itemAssignments; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V2.BundleContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleInstance.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleInstance.php new file mode 100755 index 0000000..cb0fd45 --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleInstance.php @@ -0,0 +1,205 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'regulationSid' => Values::array_get($payload, 'regulation_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'status' => Values::array_get($payload, 'status'), + 'validUntil' => Deserialize::dateTime(Values::array_get($payload, 'valid_until')), + 'email' => Values::array_get($payload, 'email'), + 'statusCallback' => Values::array_get($payload, 'status_callback'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return BundleContext Context for this BundleInstance + */ + protected function proxy(): BundleContext + { + if (!$this->context) { + $this->context = new BundleContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the BundleInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the BundleInstance + * + * @return BundleInstance Fetched BundleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BundleInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the BundleInstance + * + * @param array|Options $options Optional Arguments + * @return BundleInstance Updated BundleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): BundleInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the bundleCopies + */ + protected function getBundleCopies(): BundleCopyList + { + return $this->proxy()->bundleCopies; + } + + /** + * Access the replaceItems + */ + protected function getReplaceItems(): ReplaceItemsList + { + return $this->proxy()->replaceItems; + } + + /** + * Access the evaluations + */ + protected function getEvaluations(): EvaluationList + { + return $this->proxy()->evaluations; + } + + /** + * Access the itemAssignments + */ + protected function getItemAssignments(): ItemAssignmentList + { + return $this->proxy()->itemAssignments; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V2.BundleInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleList.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleList.php new file mode 100755 index 0000000..4379f08 --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleList.php @@ -0,0 +1,230 @@ +solution = [ + ]; + + $this->uri = '/RegulatoryCompliance/Bundles'; + } + + /** + * Create the BundleInstance + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @param string $email The email address that will receive updates when the Bundle resource changes status. + * @param array|Options $options Optional Arguments + * @return BundleInstance Created BundleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $email, array $options = []): BundleInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Email' => + $email, + 'StatusCallback' => + $options['statusCallback'], + 'RegulationSid' => + $options['regulationSid'], + 'IsoCountry' => + $options['isoCountry'], + 'EndUserType' => + $options['endUserType'], + 'NumberType' => + $options['numberType'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new BundleInstance( + $this->version, + $payload + ); + } + + + /** + * Reads BundleInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return BundleInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams BundleInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of BundleInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return BundlePage Page of BundleInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): BundlePage + { + $options = new Values($options); + + $params = Values::of([ + 'Status' => + $options['status'], + 'FriendlyName' => + $options['friendlyName'], + 'RegulationSid' => + $options['regulationSid'], + 'IsoCountry' => + $options['isoCountry'], + 'NumberType' => + $options['numberType'], + 'HasValidUntilDate' => + Serialize::booleanToString($options['hasValidUntilDate']), + 'SortBy' => + $options['sortBy'], + 'SortDirection' => + $options['sortDirection'], + 'ValidUntilDate<' => + Serialize::iso8601DateTime($options['validUntilDateBefore']), + 'ValidUntilDate' => + Serialize::iso8601DateTime($options['validUntilDate']), + 'ValidUntilDate>' => + Serialize::iso8601DateTime($options['validUntilDateAfter']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new BundlePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of BundleInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return BundlePage Page of BundleInstance + */ + public function getPage(string $targetUrl): BundlePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new BundlePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a BundleContext + * + * @param string $sid The unique string that we created to identify the Bundle resource. + */ + public function getContext( + string $sid + + ): BundleContext + { + return new BundleContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.BundleList]'; + } +} diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleOptions.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleOptions.php new file mode 100755 index 0000000..17a2c08 --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundleOptions.php @@ -0,0 +1,486 @@ +=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. + * @param string $validUntilDate Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. + * @param string $validUntilDateAfter Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. + * @return ReadBundleOptions Options builder + */ + public static function read( + + string $status = Values::NONE, + string $friendlyName = Values::NONE, + string $regulationSid = Values::NONE, + string $isoCountry = Values::NONE, + string $numberType = Values::NONE, + bool $hasValidUntilDate = Values::BOOL_NONE, + string $sortBy = Values::NONE, + string $sortDirection = Values::NONE, + string $validUntilDateBefore = null, + string $validUntilDate = null, + string $validUntilDateAfter = null + + ): ReadBundleOptions + { + return new ReadBundleOptions( + $status, + $friendlyName, + $regulationSid, + $isoCountry, + $numberType, + $hasValidUntilDate, + $sortBy, + $sortDirection, + $validUntilDateBefore, + $validUntilDate, + $validUntilDateAfter + ); + } + + /** + * @param string $status + * @param string $statusCallback The URL we call to inform your application of status changes. + * @param string $friendlyName The string that you assigned to describe the resource. + * @param string $email The email address that will receive updates when the Bundle resource changes status. + * @return UpdateBundleOptions Options builder + */ + public static function update( + + string $status = Values::NONE, + string $statusCallback = Values::NONE, + string $friendlyName = Values::NONE, + string $email = Values::NONE + + ): UpdateBundleOptions + { + return new UpdateBundleOptions( + $status, + $statusCallback, + $friendlyName, + $email + ); + } + +} + +class CreateBundleOptions extends Options + { + /** + * @param string $statusCallback The URL we call to inform your application of status changes. + * @param string $regulationSid The unique string of a regulation that is associated to the Bundle resource. + * @param string $isoCountry The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle's phone number country ownership request. + * @param string $endUserType + * @param string $numberType The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `toll free`. + */ + public function __construct( + + string $statusCallback = Values::NONE, + string $regulationSid = Values::NONE, + string $isoCountry = Values::NONE, + string $endUserType = Values::NONE, + string $numberType = Values::NONE + + ) { + $this->options['statusCallback'] = $statusCallback; + $this->options['regulationSid'] = $regulationSid; + $this->options['isoCountry'] = $isoCountry; + $this->options['endUserType'] = $endUserType; + $this->options['numberType'] = $numberType; + } + + /** + * The URL we call to inform your application of status changes. + * + * @param string $statusCallback The URL we call to inform your application of status changes. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The unique string of a regulation that is associated to the Bundle resource. + * + * @param string $regulationSid The unique string of a regulation that is associated to the Bundle resource. + * @return $this Fluent Builder + */ + public function setRegulationSid(string $regulationSid): self + { + $this->options['regulationSid'] = $regulationSid; + return $this; + } + + /** + * The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle's phone number country ownership request. + * + * @param string $isoCountry The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle's phone number country ownership request. + * @return $this Fluent Builder + */ + public function setIsoCountry(string $isoCountry): self + { + $this->options['isoCountry'] = $isoCountry; + return $this; + } + + /** + * @param string $endUserType + * @return $this Fluent Builder + */ + public function setEndUserType(string $endUserType): self + { + $this->options['endUserType'] = $endUserType; + return $this; + } + + /** + * The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `toll free`. + * + * @param string $numberType The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `toll free`. + * @return $this Fluent Builder + */ + public function setNumberType(string $numberType): self + { + $this->options['numberType'] = $numberType; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Numbers.V2.CreateBundleOptions ' . $options . ']'; + } +} + + + +class ReadBundleOptions extends Options + { + /** + * @param string $status The verification status of the Bundle resource. Please refer to [Bundle Statuses](https://www.twilio.com/docs/phone-numbers/regulatory/api/bundles#bundle-statuses) for more details. + * @param string $friendlyName The string that you assigned to describe the resource. The column can contain 255 variable characters. + * @param string $regulationSid The unique string of a [Regulation resource](https://www.twilio.com/docs/phone-numbers/regulatory/api/regulations) that is associated to the Bundle resource. + * @param string $isoCountry The 2-digit [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle's phone number country ownership request. + * @param string $numberType The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `tollfree`. + * @param bool $hasValidUntilDate Indicates that the Bundle is a valid Bundle until a specified expiration date. + * @param string $sortBy Can be `valid-until` or `date-updated`. Defaults to `date-created`. + * @param string $sortDirection Default is `DESC`. Can be `ASC` or `DESC`. + * @param string $validUntilDateBefore Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. + * @param string $validUntilDate Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. + * @param string $validUntilDateAfter Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. + */ + public function __construct( + + string $status = Values::NONE, + string $friendlyName = Values::NONE, + string $regulationSid = Values::NONE, + string $isoCountry = Values::NONE, + string $numberType = Values::NONE, + bool $hasValidUntilDate = Values::BOOL_NONE, + string $sortBy = Values::NONE, + string $sortDirection = Values::NONE, + string $validUntilDateBefore = null, + string $validUntilDate = null, + string $validUntilDateAfter = null + + ) { + $this->options['status'] = $status; + $this->options['friendlyName'] = $friendlyName; + $this->options['regulationSid'] = $regulationSid; + $this->options['isoCountry'] = $isoCountry; + $this->options['numberType'] = $numberType; + $this->options['hasValidUntilDate'] = $hasValidUntilDate; + $this->options['sortBy'] = $sortBy; + $this->options['sortDirection'] = $sortDirection; + $this->options['validUntilDateBefore'] = $validUntilDateBefore; + $this->options['validUntilDate'] = $validUntilDate; + $this->options['validUntilDateAfter'] = $validUntilDateAfter; + } + + /** + * The verification status of the Bundle resource. Please refer to [Bundle Statuses](https://www.twilio.com/docs/phone-numbers/regulatory/api/bundles#bundle-statuses) for more details. + * + * @param string $status The verification status of the Bundle resource. Please refer to [Bundle Statuses](https://www.twilio.com/docs/phone-numbers/regulatory/api/bundles#bundle-statuses) for more details. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * The string that you assigned to describe the resource. The column can contain 255 variable characters. + * + * @param string $friendlyName The string that you assigned to describe the resource. The column can contain 255 variable characters. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The unique string of a [Regulation resource](https://www.twilio.com/docs/phone-numbers/regulatory/api/regulations) that is associated to the Bundle resource. + * + * @param string $regulationSid The unique string of a [Regulation resource](https://www.twilio.com/docs/phone-numbers/regulatory/api/regulations) that is associated to the Bundle resource. + * @return $this Fluent Builder + */ + public function setRegulationSid(string $regulationSid): self + { + $this->options['regulationSid'] = $regulationSid; + return $this; + } + + /** + * The 2-digit [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle's phone number country ownership request. + * + * @param string $isoCountry The 2-digit [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Bundle's phone number country ownership request. + * @return $this Fluent Builder + */ + public function setIsoCountry(string $isoCountry): self + { + $this->options['isoCountry'] = $isoCountry; + return $this; + } + + /** + * The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `tollfree`. + * + * @param string $numberType The type of phone number of the Bundle's ownership request. Can be `local`, `mobile`, `national`, or `tollfree`. + * @return $this Fluent Builder + */ + public function setNumberType(string $numberType): self + { + $this->options['numberType'] = $numberType; + return $this; + } + + /** + * Indicates that the Bundle is a valid Bundle until a specified expiration date. + * + * @param bool $hasValidUntilDate Indicates that the Bundle is a valid Bundle until a specified expiration date. + * @return $this Fluent Builder + */ + public function setHasValidUntilDate(bool $hasValidUntilDate): self + { + $this->options['hasValidUntilDate'] = $hasValidUntilDate; + return $this; + } + + /** + * Can be `valid-until` or `date-updated`. Defaults to `date-created`. + * + * @param string $sortBy Can be `valid-until` or `date-updated`. Defaults to `date-created`. + * @return $this Fluent Builder + */ + public function setSortBy(string $sortBy): self + { + $this->options['sortBy'] = $sortBy; + return $this; + } + + /** + * Default is `DESC`. Can be `ASC` or `DESC`. + * + * @param string $sortDirection Default is `DESC`. Can be `ASC` or `DESC`. + * @return $this Fluent Builder + */ + public function setSortDirection(string $sortDirection): self + { + $this->options['sortDirection'] = $sortDirection; + return $this; + } + + /** + * Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. + * + * @param string $validUntilDateBefore Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. + * @return $this Fluent Builder + */ + public function setValidUntilDateBefore(string $validUntilDateBefore): self + { + $this->options['validUntilDateBefore'] = $validUntilDateBefore; + return $this; + } + + /** + * Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. + * + * @param string $validUntilDate Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. + * @return $this Fluent Builder + */ + public function setValidUntilDate(string $validUntilDate): self + { + $this->options['validUntilDate'] = $validUntilDate; + return $this; + } + + /** + * Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. + * + * @param string $validUntilDateAfter Date to filter Bundles having their `valid_until_date` before or after the specified date. Can be `ValidUntilDate>=` or `ValidUntilDate<=`. Both can be used in conjunction as well. [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) is the acceptable date format. + * @return $this Fluent Builder + */ + public function setValidUntilDateAfter(string $validUntilDateAfter): self + { + $this->options['validUntilDateAfter'] = $validUntilDateAfter; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Numbers.V2.ReadBundleOptions ' . $options . ']'; + } +} + +class UpdateBundleOptions extends Options + { + /** + * @param string $status + * @param string $statusCallback The URL we call to inform your application of status changes. + * @param string $friendlyName The string that you assigned to describe the resource. + * @param string $email The email address that will receive updates when the Bundle resource changes status. + */ + public function __construct( + + string $status = Values::NONE, + string $statusCallback = Values::NONE, + string $friendlyName = Values::NONE, + string $email = Values::NONE + + ) { + $this->options['status'] = $status; + $this->options['statusCallback'] = $statusCallback; + $this->options['friendlyName'] = $friendlyName; + $this->options['email'] = $email; + } + + /** + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * The URL we call to inform your application of status changes. + * + * @param string $statusCallback The URL we call to inform your application of status changes. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The string that you assigned to describe the resource. + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The email address that will receive updates when the Bundle resource changes status. + * + * @param string $email The email address that will receive updates when the Bundle resource changes status. + * @return $this Fluent Builder + */ + public function setEmail(string $email): self + { + $this->options['email'] = $email; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Numbers.V2.UpdateBundleOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundlePage.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundlePage.php new file mode 100755 index 0000000..55d0f6b --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/BundlePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return BundleInstance \Twilio\Rest\Numbers\V2\RegulatoryCompliance\BundleInstance + */ + public function buildInstance(array $payload): BundleInstance + { + return new BundleInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.BundlePage]'; + } +} diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserContext.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserContext.php new file mode 100755 index 0000000..e237793 --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserContext.php @@ -0,0 +1,126 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/RegulatoryCompliance/EndUsers/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the EndUserInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the EndUserInstance + * + * @return EndUserInstance Fetched EndUserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EndUserInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new EndUserInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the EndUserInstance + * + * @param array|Options $options Optional Arguments + * @return EndUserInstance Updated EndUserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): EndUserInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'Attributes' => + Serialize::jsonObject($options['attributes']), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new EndUserInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V2.EndUserContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserInstance.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserInstance.php new file mode 100755 index 0000000..002d136 --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserInstance.php @@ -0,0 +1,156 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'type' => Values::array_get($payload, 'type'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return EndUserContext Context for this EndUserInstance + */ + protected function proxy(): EndUserContext + { + if (!$this->context) { + $this->context = new EndUserContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the EndUserInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the EndUserInstance + * + * @return EndUserInstance Fetched EndUserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EndUserInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the EndUserInstance + * + * @param array|Options $options Optional Arguments + * @return EndUserInstance Updated EndUserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): EndUserInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V2.EndUserInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserList.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserList.php new file mode 100755 index 0000000..64ce128 --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserList.php @@ -0,0 +1,196 @@ +solution = [ + ]; + + $this->uri = '/RegulatoryCompliance/EndUsers'; + } + + /** + * Create the EndUserInstance + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @param string $type + * @param array|Options $options Optional Arguments + * @return EndUserInstance Created EndUserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $type, array $options = []): EndUserInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Type' => + $type, + 'Attributes' => + Serialize::jsonObject($options['attributes']), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new EndUserInstance( + $this->version, + $payload + ); + } + + + /** + * Reads EndUserInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return EndUserInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams EndUserInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of EndUserInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return EndUserPage Page of EndUserInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): EndUserPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new EndUserPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of EndUserInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return EndUserPage Page of EndUserInstance + */ + public function getPage(string $targetUrl): EndUserPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new EndUserPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a EndUserContext + * + * @param string $sid The unique string created by Twilio to identify the End User resource. + */ + public function getContext( + string $sid + + ): EndUserContext + { + return new EndUserContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.EndUserList]'; + } +} diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserOptions.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserOptions.php new file mode 100755 index 0000000..e4e2f24 --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserOptions.php @@ -0,0 +1,152 @@ +options['attributes'] = $attributes; + } + + /** + * The set of parameters that are the attributes of the End User resource which are derived End User Types. + * + * @param array $attributes The set of parameters that are the attributes of the End User resource which are derived End User Types. + * @return $this Fluent Builder + */ + public function setAttributes(array $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Numbers.V2.CreateEndUserOptions ' . $options . ']'; + } +} + + + + +class UpdateEndUserOptions extends Options + { + /** + * @param string $friendlyName The string that you assigned to describe the resource. + * @param array $attributes The set of parameters that are the attributes of the End User resource which are derived End User Types. + */ + public function __construct( + + string $friendlyName = Values::NONE, + array $attributes = Values::ARRAY_NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['attributes'] = $attributes; + } + + /** + * The string that you assigned to describe the resource. + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The set of parameters that are the attributes of the End User resource which are derived End User Types. + * + * @param array $attributes The set of parameters that are the attributes of the End User resource which are derived End User Types. + * @return $this Fluent Builder + */ + public function setAttributes(array $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Numbers.V2.UpdateEndUserOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserPage.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserPage.php new file mode 100755 index 0000000..8f4639c --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return EndUserInstance \Twilio\Rest\Numbers\V2\RegulatoryCompliance\EndUserInstance + */ + public function buildInstance(array $payload): EndUserInstance + { + return new EndUserInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.EndUserPage]'; + } +} diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypeContext.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypeContext.php new file mode 100755 index 0000000..066ebf2 --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypeContext.php @@ -0,0 +1,81 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/RegulatoryCompliance/EndUserTypes/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the EndUserTypeInstance + * + * @return EndUserTypeInstance Fetched EndUserTypeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EndUserTypeInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new EndUserTypeInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V2.EndUserTypeContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypeInstance.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypeInstance.php new file mode 100755 index 0000000..ab5e46c --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypeInstance.php @@ -0,0 +1,123 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'machineName' => Values::array_get($payload, 'machine_name'), + 'fields' => Values::array_get($payload, 'fields'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return EndUserTypeContext Context for this EndUserTypeInstance + */ + protected function proxy(): EndUserTypeContext + { + if (!$this->context) { + $this->context = new EndUserTypeContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the EndUserTypeInstance + * + * @return EndUserTypeInstance Fetched EndUserTypeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EndUserTypeInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V2.EndUserTypeInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypeList.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypeList.php new file mode 100755 index 0000000..74e4d36 --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypeList.php @@ -0,0 +1,161 @@ +solution = [ + ]; + + $this->uri = '/RegulatoryCompliance/EndUserTypes'; + } + + /** + * Reads EndUserTypeInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return EndUserTypeInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams EndUserTypeInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of EndUserTypeInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return EndUserTypePage Page of EndUserTypeInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): EndUserTypePage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new EndUserTypePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of EndUserTypeInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return EndUserTypePage Page of EndUserTypeInstance + */ + public function getPage(string $targetUrl): EndUserTypePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new EndUserTypePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a EndUserTypeContext + * + * @param string $sid The unique string that identifies the End-User Type resource. + */ + public function getContext( + string $sid + + ): EndUserTypeContext + { + return new EndUserTypeContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.EndUserTypeList]'; + } +} diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypePage.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypePage.php new file mode 100755 index 0000000..63d64b7 --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/EndUserTypePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return EndUserTypeInstance \Twilio\Rest\Numbers\V2\RegulatoryCompliance\EndUserTypeInstance + */ + public function buildInstance(array $payload): EndUserTypeInstance + { + return new EndUserTypeInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.EndUserTypePage]'; + } +} diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationContext.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationContext.php new file mode 100755 index 0000000..049e1c7 --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationContext.php @@ -0,0 +1,81 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/RegulatoryCompliance/Regulations/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the RegulationInstance + * + * @return RegulationInstance Fetched RegulationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RegulationInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new RegulationInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V2.RegulationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationInstance.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationInstance.php new file mode 100755 index 0000000..d2bafee --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationInstance.php @@ -0,0 +1,127 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'isoCountry' => Values::array_get($payload, 'iso_country'), + 'numberType' => Values::array_get($payload, 'number_type'), + 'endUserType' => Values::array_get($payload, 'end_user_type'), + 'requirements' => Values::array_get($payload, 'requirements'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return RegulationContext Context for this RegulationInstance + */ + protected function proxy(): RegulationContext + { + if (!$this->context) { + $this->context = new RegulationContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the RegulationInstance + * + * @return RegulationInstance Fetched RegulationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RegulationInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V2.RegulationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationList.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationList.php new file mode 100755 index 0000000..f41cad7 --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationList.php @@ -0,0 +1,172 @@ +solution = [ + ]; + + $this->uri = '/RegulatoryCompliance/Regulations'; + } + + /** + * Reads RegulationInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return RegulationInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams RegulationInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of RegulationInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return RegulationPage Page of RegulationInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): RegulationPage + { + $options = new Values($options); + + $params = Values::of([ + 'EndUserType' => + $options['endUserType'], + 'IsoCountry' => + $options['isoCountry'], + 'NumberType' => + $options['numberType'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new RegulationPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of RegulationInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return RegulationPage Page of RegulationInstance + */ + public function getPage(string $targetUrl): RegulationPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new RegulationPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a RegulationContext + * + * @param string $sid The unique string that identifies the Regulation resource. + */ + public function getContext( + string $sid + + ): RegulationContext + { + return new RegulationContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.RegulationList]'; + } +} diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationOptions.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationOptions.php new file mode 100755 index 0000000..386f654 --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationOptions.php @@ -0,0 +1,114 @@ +options['endUserType'] = $endUserType; + $this->options['isoCountry'] = $isoCountry; + $this->options['numberType'] = $numberType; + } + + /** + * The type of End User the regulation requires - can be `individual` or `business`. + * + * @param string $endUserType The type of End User the regulation requires - can be `individual` or `business`. + * @return $this Fluent Builder + */ + public function setEndUserType(string $endUserType): self + { + $this->options['endUserType'] = $endUserType; + return $this; + } + + /** + * The ISO country code of the phone number's country. + * + * @param string $isoCountry The ISO country code of the phone number's country. + * @return $this Fluent Builder + */ + public function setIsoCountry(string $isoCountry): self + { + $this->options['isoCountry'] = $isoCountry; + return $this; + } + + /** + * The type of phone number that the regulatory requiremnt is restricting. + * + * @param string $numberType The type of phone number that the regulatory requiremnt is restricting. + * @return $this Fluent Builder + */ + public function setNumberType(string $numberType): self + { + $this->options['numberType'] = $numberType; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Numbers.V2.ReadRegulationOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationPage.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationPage.php new file mode 100755 index 0000000..e19c056 --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/RegulationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RegulationInstance \Twilio\Rest\Numbers\V2\RegulatoryCompliance\RegulationInstance + */ + public function buildInstance(array $payload): RegulationInstance + { + return new RegulationInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.RegulationPage]'; + } +} diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentContext.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentContext.php new file mode 100755 index 0000000..558313a --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentContext.php @@ -0,0 +1,126 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/RegulatoryCompliance/SupportingDocuments/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the SupportingDocumentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the SupportingDocumentInstance + * + * @return SupportingDocumentInstance Fetched SupportingDocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SupportingDocumentInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new SupportingDocumentInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the SupportingDocumentInstance + * + * @param array|Options $options Optional Arguments + * @return SupportingDocumentInstance Updated SupportingDocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SupportingDocumentInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'Attributes' => + Serialize::jsonObject($options['attributes']), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new SupportingDocumentInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V2.SupportingDocumentContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentInstance.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentInstance.php new file mode 100755 index 0000000..334b330 --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentInstance.php @@ -0,0 +1,162 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'mimeType' => Values::array_get($payload, 'mime_type'), + 'status' => Values::array_get($payload, 'status'), + 'failureReason' => Values::array_get($payload, 'failure_reason'), + 'type' => Values::array_get($payload, 'type'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SupportingDocumentContext Context for this SupportingDocumentInstance + */ + protected function proxy(): SupportingDocumentContext + { + if (!$this->context) { + $this->context = new SupportingDocumentContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the SupportingDocumentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SupportingDocumentInstance + * + * @return SupportingDocumentInstance Fetched SupportingDocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SupportingDocumentInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SupportingDocumentInstance + * + * @param array|Options $options Optional Arguments + * @return SupportingDocumentInstance Updated SupportingDocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SupportingDocumentInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V2.SupportingDocumentInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentList.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentList.php new file mode 100755 index 0000000..d59150f --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentList.php @@ -0,0 +1,196 @@ +solution = [ + ]; + + $this->uri = '/RegulatoryCompliance/SupportingDocuments'; + } + + /** + * Create the SupportingDocumentInstance + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @param string $type The type of the Supporting Document. + * @param array|Options $options Optional Arguments + * @return SupportingDocumentInstance Created SupportingDocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $type, array $options = []): SupportingDocumentInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Type' => + $type, + 'Attributes' => + Serialize::jsonObject($options['attributes']), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new SupportingDocumentInstance( + $this->version, + $payload + ); + } + + + /** + * Reads SupportingDocumentInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return SupportingDocumentInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams SupportingDocumentInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SupportingDocumentInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return SupportingDocumentPage Page of SupportingDocumentInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SupportingDocumentPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SupportingDocumentPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SupportingDocumentInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SupportingDocumentPage Page of SupportingDocumentInstance + */ + public function getPage(string $targetUrl): SupportingDocumentPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SupportingDocumentPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SupportingDocumentContext + * + * @param string $sid The unique string created by Twilio to identify the Supporting Document resource. + */ + public function getContext( + string $sid + + ): SupportingDocumentContext + { + return new SupportingDocumentContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.SupportingDocumentList]'; + } +} diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentOptions.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentOptions.php new file mode 100755 index 0000000..935b34c --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentOptions.php @@ -0,0 +1,152 @@ +options['attributes'] = $attributes; + } + + /** + * The set of parameters that are the attributes of the Supporting Documents resource which are derived Supporting Document Types. + * + * @param array $attributes The set of parameters that are the attributes of the Supporting Documents resource which are derived Supporting Document Types. + * @return $this Fluent Builder + */ + public function setAttributes(array $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Numbers.V2.CreateSupportingDocumentOptions ' . $options . ']'; + } +} + + + + +class UpdateSupportingDocumentOptions extends Options + { + /** + * @param string $friendlyName The string that you assigned to describe the resource. + * @param array $attributes The set of parameters that are the attributes of the Supporting Document resource which are derived Supporting Document Types. + */ + public function __construct( + + string $friendlyName = Values::NONE, + array $attributes = Values::ARRAY_NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['attributes'] = $attributes; + } + + /** + * The string that you assigned to describe the resource. + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The set of parameters that are the attributes of the Supporting Document resource which are derived Supporting Document Types. + * + * @param array $attributes The set of parameters that are the attributes of the Supporting Document resource which are derived Supporting Document Types. + * @return $this Fluent Builder + */ + public function setAttributes(array $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Numbers.V2.UpdateSupportingDocumentOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentPage.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentPage.php new file mode 100755 index 0000000..ad54c83 --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SupportingDocumentInstance \Twilio\Rest\Numbers\V2\RegulatoryCompliance\SupportingDocumentInstance + */ + public function buildInstance(array $payload): SupportingDocumentInstance + { + return new SupportingDocumentInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.SupportingDocumentPage]'; + } +} diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypeContext.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypeContext.php new file mode 100755 index 0000000..c55a4b3 --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypeContext.php @@ -0,0 +1,81 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/RegulatoryCompliance/SupportingDocumentTypes/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the SupportingDocumentTypeInstance + * + * @return SupportingDocumentTypeInstance Fetched SupportingDocumentTypeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SupportingDocumentTypeInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new SupportingDocumentTypeInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V2.SupportingDocumentTypeContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypeInstance.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypeInstance.php new file mode 100755 index 0000000..32c5ef6 --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypeInstance.php @@ -0,0 +1,123 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'machineName' => Values::array_get($payload, 'machine_name'), + 'fields' => Values::array_get($payload, 'fields'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SupportingDocumentTypeContext Context for this SupportingDocumentTypeInstance + */ + protected function proxy(): SupportingDocumentTypeContext + { + if (!$this->context) { + $this->context = new SupportingDocumentTypeContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the SupportingDocumentTypeInstance + * + * @return SupportingDocumentTypeInstance Fetched SupportingDocumentTypeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SupportingDocumentTypeInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Numbers.V2.SupportingDocumentTypeInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypeList.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypeList.php new file mode 100755 index 0000000..88073a2 --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypeList.php @@ -0,0 +1,161 @@ +solution = [ + ]; + + $this->uri = '/RegulatoryCompliance/SupportingDocumentTypes'; + } + + /** + * Reads SupportingDocumentTypeInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return SupportingDocumentTypeInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams SupportingDocumentTypeInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SupportingDocumentTypeInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return SupportingDocumentTypePage Page of SupportingDocumentTypeInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SupportingDocumentTypePage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SupportingDocumentTypePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SupportingDocumentTypeInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SupportingDocumentTypePage Page of SupportingDocumentTypeInstance + */ + public function getPage(string $targetUrl): SupportingDocumentTypePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SupportingDocumentTypePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SupportingDocumentTypeContext + * + * @param string $sid The unique string that identifies the Supporting Document Type resource. + */ + public function getContext( + string $sid + + ): SupportingDocumentTypeContext + { + return new SupportingDocumentTypeContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.SupportingDocumentTypeList]'; + } +} diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypePage.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypePage.php new file mode 100755 index 0000000..ff4f1ea --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliance/SupportingDocumentTypePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SupportingDocumentTypeInstance \Twilio\Rest\Numbers\V2\RegulatoryCompliance\SupportingDocumentTypeInstance + */ + public function buildInstance(array $payload): SupportingDocumentTypeInstance + { + return new SupportingDocumentTypeInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.SupportingDocumentTypePage]'; + } +} diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryComplianceInstance.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryComplianceInstance.php new file mode 100755 index 0000000..c2d5854 --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryComplianceInstance.php @@ -0,0 +1,71 @@ +solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.RegulatoryComplianceInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryComplianceList.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryComplianceList.php new file mode 100755 index 0000000..e8df117 --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryComplianceList.php @@ -0,0 +1,191 @@ +solution = [ + ]; + } + + /** + * Access the bundles + */ + protected function getBundles(): BundleList + { + if (!$this->_bundles) { + $this->_bundles = new BundleList( + $this->version + ); + } + return $this->_bundles; + } + + /** + * Access the regulations + */ + protected function getRegulations(): RegulationList + { + if (!$this->_regulations) { + $this->_regulations = new RegulationList( + $this->version + ); + } + return $this->_regulations; + } + + /** + * Access the endUserTypes + */ + protected function getEndUserTypes(): EndUserTypeList + { + if (!$this->_endUserTypes) { + $this->_endUserTypes = new EndUserTypeList( + $this->version + ); + } + return $this->_endUserTypes; + } + + /** + * Access the endUsers + */ + protected function getEndUsers(): EndUserList + { + if (!$this->_endUsers) { + $this->_endUsers = new EndUserList( + $this->version + ); + } + return $this->_endUsers; + } + + /** + * Access the supportingDocumentTypes + */ + protected function getSupportingDocumentTypes(): SupportingDocumentTypeList + { + if (!$this->_supportingDocumentTypes) { + $this->_supportingDocumentTypes = new SupportingDocumentTypeList( + $this->version + ); + } + return $this->_supportingDocumentTypes; + } + + /** + * Access the supportingDocuments + */ + protected function getSupportingDocuments(): SupportingDocumentList + { + if (!$this->_supportingDocuments) { + $this->_supportingDocuments = new SupportingDocumentList( + $this->version + ); + } + return $this->_supportingDocuments; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name) + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.RegulatoryComplianceList]'; + } +} diff --git a/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliancePage.php b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliancePage.php new file mode 100755 index 0000000..b406a1f --- /dev/null +++ b/app/api/Twilio/Rest/Numbers/V2/RegulatoryCompliancePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RegulatoryComplianceInstance \Twilio\Rest\Numbers\V2\RegulatoryComplianceInstance + */ + public function buildInstance(array $payload): RegulatoryComplianceInstance + { + return new RegulatoryComplianceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Numbers.V2.RegulatoryCompliancePage]'; + } +} diff --git a/app/api/Twilio/Rest/NumbersBase.php b/app/api/Twilio/Rest/NumbersBase.php new file mode 100755 index 0000000..365ded2 --- /dev/null +++ b/app/api/Twilio/Rest/NumbersBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://numbers.twilio.com'; + } + + + /** + * @return V2 Version v2 of numbers + */ + protected function getV2(): V2 { + if (!$this->_v2) { + $this->_v2 = new V2($this); + } + return $this->_v2; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Numbers]'; + } +} diff --git a/app/api/Twilio/Rest/Oauth.php b/app/api/Twilio/Rest/Oauth.php new file mode 100755 index 0000000..a1c8830 --- /dev/null +++ b/app/api/Twilio/Rest/Oauth.php @@ -0,0 +1,71 @@ +oauth instead. + */ + protected function getOauth(): \Twilio\Rest\Oauth\V1\OauthList { + echo "oauth is deprecated. Use v1->oauth instead."; + return $this->v1->oauth; + } + + /** + * @deprecated Use v1->oauth() instead. + */ + protected function contextOauth(): \Twilio\Rest\Oauth\V1\OauthContext { + echo "oauth() is deprecated. Use v1->oauth() instead."; + return $this->v1->oauth(); + } + + /** + * @deprecated Use v1->deviceCode instead. + */ + protected function getDeviceCode(): \Twilio\Rest\Oauth\V1\DeviceCodeList { + echo "deviceCode is deprecated. Use v1->deviceCode instead."; + return $this->v1->deviceCode; + } + + /** + * @deprecated Use v1->openidDiscovery instead. + */ + protected function getOpenidDiscovery(): \Twilio\Rest\Oauth\V1\OpenidDiscoveryList { + echo "openidDiscovery is deprecated. Use v1->openidDiscovery instead."; + return $this->v1->openidDiscovery; + } + + /** + * @deprecated Use v1->openidDiscovery() instead. + */ + protected function contextOpenidDiscovery(): \Twilio\Rest\Oauth\V1\OpenidDiscoveryContext { + echo "openidDiscovery() is deprecated. Use v1->openidDiscovery() instead."; + return $this->v1->openidDiscovery(); + } + + /** + * @deprecated Use v1->token instead. + */ + protected function getToken(): \Twilio\Rest\Oauth\V1\TokenList { + echo "token is deprecated. Use v1->token instead."; + return $this->v1->token; + } + + /** + * @deprecated Use v1->userInfo instead. + */ + protected function getUserInfo(): \Twilio\Rest\Oauth\V1\UserInfoList { + echo "userInfo is deprecated. Use v1->userInfo instead."; + return $this->v1->userInfo; + } + + /** + * @deprecated Use v1->userInfo() instead. + */ + protected function contextUserInfo(): \Twilio\Rest\Oauth\V1\UserInfoContext { + echo "userInfo() is deprecated. Use v1->userInfo() instead."; + return $this->v1->userInfo(); + } +} \ No newline at end of file diff --git a/app/api/Twilio/Rest/Oauth/V1.php b/app/api/Twilio/Rest/Oauth/V1.php new file mode 100755 index 0000000..a4d1db6 --- /dev/null +++ b/app/api/Twilio/Rest/Oauth/V1.php @@ -0,0 +1,138 @@ +version = 'v1'; + } + + protected function getDeviceCode(): DeviceCodeList + { + if (!$this->_deviceCode) { + $this->_deviceCode = new DeviceCodeList($this); + } + return $this->_deviceCode; + } + + protected function getOauth(): OauthList + { + if (!$this->_oauth) { + $this->_oauth = new OauthList($this); + } + return $this->_oauth; + } + + protected function getOpenidDiscovery(): OpenidDiscoveryList + { + if (!$this->_openidDiscovery) { + $this->_openidDiscovery = new OpenidDiscoveryList($this); + } + return $this->_openidDiscovery; + } + + protected function getToken(): TokenList + { + if (!$this->_token) { + $this->_token = new TokenList($this); + } + return $this->_token; + } + + protected function getUserInfo(): UserInfoList + { + if (!$this->_userInfo) { + $this->_userInfo = new UserInfoList($this); + } + return $this->_userInfo; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Oauth.V1]'; + } +} diff --git a/app/api/Twilio/Rest/Oauth/V1/DeviceCodeInstance.php b/app/api/Twilio/Rest/Oauth/V1/DeviceCodeInstance.php new file mode 100755 index 0000000..e938a83 --- /dev/null +++ b/app/api/Twilio/Rest/Oauth/V1/DeviceCodeInstance.php @@ -0,0 +1,90 @@ +properties = [ + 'deviceCode' => Values::array_get($payload, 'device_code'), + 'userCode' => Values::array_get($payload, 'user_code'), + 'verificationUri' => Values::array_get($payload, 'verification_uri'), + 'verificationUriComplete' => Values::array_get($payload, 'verification_uri_complete'), + 'expiresIn' => Values::array_get($payload, 'expires_in'), + 'interval' => Values::array_get($payload, 'interval'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Oauth.V1.DeviceCodeInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Oauth/V1/DeviceCodeList.php b/app/api/Twilio/Rest/Oauth/V1/DeviceCodeList.php new file mode 100755 index 0000000..606a677 --- /dev/null +++ b/app/api/Twilio/Rest/Oauth/V1/DeviceCodeList.php @@ -0,0 +1,87 @@ +solution = [ + ]; + + $this->uri = '/device/code'; + } + + /** + * Create the DeviceCodeInstance + * + * @param string $clientSid A 34 character string that uniquely identifies this OAuth App. + * @param string[] $scopes An Array of scopes for authorization request + * @param array|Options $options Optional Arguments + * @return DeviceCodeInstance Created DeviceCodeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $clientSid, array $scopes, array $options = []): DeviceCodeInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'ClientSid' => + $clientSid, + 'Scopes' => + Serialize::map($scopes,function ($e) { return $e; }), + 'Audiences' => + Serialize::map($options['audiences'], function ($e) { return $e; }), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new DeviceCodeInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Oauth.V1.DeviceCodeList]'; + } +} diff --git a/app/api/Twilio/Rest/Oauth/V1/DeviceCodeOptions.php b/app/api/Twilio/Rest/Oauth/V1/DeviceCodeOptions.php new file mode 100755 index 0000000..8d52d79 --- /dev/null +++ b/app/api/Twilio/Rest/Oauth/V1/DeviceCodeOptions.php @@ -0,0 +1,76 @@ +options['audiences'] = $audiences; + } + + /** + * An array of intended audiences for token requests + * + * @param string[] $audiences An array of intended audiences for token requests + * @return $this Fluent Builder + */ + public function setAudiences(array $audiences): self + { + $this->options['audiences'] = $audiences; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Oauth.V1.CreateDeviceCodeOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Oauth/V1/DeviceCodePage.php b/app/api/Twilio/Rest/Oauth/V1/DeviceCodePage.php new file mode 100755 index 0000000..b9f21bf --- /dev/null +++ b/app/api/Twilio/Rest/Oauth/V1/DeviceCodePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DeviceCodeInstance \Twilio\Rest\Oauth\V1\DeviceCodeInstance + */ + public function buildInstance(array $payload): DeviceCodeInstance + { + return new DeviceCodeInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Oauth.V1.DeviceCodePage]'; + } +} diff --git a/app/api/Twilio/Rest/Oauth/V1/OauthContext.php b/app/api/Twilio/Rest/Oauth/V1/OauthContext.php new file mode 100755 index 0000000..402cd93 --- /dev/null +++ b/app/api/Twilio/Rest/Oauth/V1/OauthContext.php @@ -0,0 +1,75 @@ +solution = [ + ]; + + $this->uri = '/certs'; + } + + /** + * Fetch the OauthInstance + * + * @return OauthInstance Fetched OauthInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): OauthInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new OauthInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Oauth.V1.OauthContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Oauth/V1/OauthInstance.php b/app/api/Twilio/Rest/Oauth/V1/OauthInstance.php new file mode 100755 index 0000000..cbf3f66 --- /dev/null +++ b/app/api/Twilio/Rest/Oauth/V1/OauthInstance.php @@ -0,0 +1,115 @@ +properties = [ + 'keys' => Values::array_get($payload, 'keys'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = []; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return OauthContext Context for this OauthInstance + */ + protected function proxy(): OauthContext + { + if (!$this->context) { + $this->context = new OauthContext( + $this->version + ); + } + + return $this->context; + } + + /** + * Fetch the OauthInstance + * + * @return OauthInstance Fetched OauthInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): OauthInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Oauth.V1.OauthInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Oauth/V1/OauthList.php b/app/api/Twilio/Rest/Oauth/V1/OauthList.php new file mode 100755 index 0000000..ca0a893 --- /dev/null +++ b/app/api/Twilio/Rest/Oauth/V1/OauthList.php @@ -0,0 +1,61 @@ +solution = [ + ]; + } + + /** + * Constructs a OauthContext + */ + public function getContext( + + ): OauthContext + { + return new OauthContext( + $this->version + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Oauth.V1.OauthList]'; + } +} diff --git a/app/api/Twilio/Rest/Oauth/V1/OauthPage.php b/app/api/Twilio/Rest/Oauth/V1/OauthPage.php new file mode 100755 index 0000000..ac426e8 --- /dev/null +++ b/app/api/Twilio/Rest/Oauth/V1/OauthPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return OauthInstance \Twilio\Rest\Oauth\V1\OauthInstance + */ + public function buildInstance(array $payload): OauthInstance + { + return new OauthInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Oauth.V1.OauthPage]'; + } +} diff --git a/app/api/Twilio/Rest/Oauth/V1/OpenidDiscoveryContext.php b/app/api/Twilio/Rest/Oauth/V1/OpenidDiscoveryContext.php new file mode 100755 index 0000000..f2fbbd0 --- /dev/null +++ b/app/api/Twilio/Rest/Oauth/V1/OpenidDiscoveryContext.php @@ -0,0 +1,75 @@ +solution = [ + ]; + + $this->uri = '/.well-known/openid-configuration'; + } + + /** + * Fetch the OpenidDiscoveryInstance + * + * @return OpenidDiscoveryInstance Fetched OpenidDiscoveryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): OpenidDiscoveryInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new OpenidDiscoveryInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Oauth.V1.OpenidDiscoveryContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Oauth/V1/OpenidDiscoveryInstance.php b/app/api/Twilio/Rest/Oauth/V1/OpenidDiscoveryInstance.php new file mode 100755 index 0000000..6d4a2e0 --- /dev/null +++ b/app/api/Twilio/Rest/Oauth/V1/OpenidDiscoveryInstance.php @@ -0,0 +1,137 @@ +properties = [ + 'issuer' => Values::array_get($payload, 'issuer'), + 'authorizationEndpoint' => Values::array_get($payload, 'authorization_endpoint'), + 'deviceAuthorizationEndpoint' => Values::array_get($payload, 'device_authorization_endpoint'), + 'tokenEndpoint' => Values::array_get($payload, 'token_endpoint'), + 'userinfoEndpoint' => Values::array_get($payload, 'userinfo_endpoint'), + 'revocationEndpoint' => Values::array_get($payload, 'revocation_endpoint'), + 'jwkUri' => Values::array_get($payload, 'jwk_uri'), + 'responseTypeSupported' => Values::array_get($payload, 'response_type_supported'), + 'subjectTypeSupported' => Values::array_get($payload, 'subject_type_supported'), + 'idTokenSigningAlgValuesSupported' => Values::array_get($payload, 'id_token_signing_alg_values_supported'), + 'scopesSupported' => Values::array_get($payload, 'scopes_supported'), + 'claimsSupported' => Values::array_get($payload, 'claims_supported'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = []; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return OpenidDiscoveryContext Context for this OpenidDiscoveryInstance + */ + protected function proxy(): OpenidDiscoveryContext + { + if (!$this->context) { + $this->context = new OpenidDiscoveryContext( + $this->version + ); + } + + return $this->context; + } + + /** + * Fetch the OpenidDiscoveryInstance + * + * @return OpenidDiscoveryInstance Fetched OpenidDiscoveryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): OpenidDiscoveryInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Oauth.V1.OpenidDiscoveryInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Oauth/V1/OpenidDiscoveryList.php b/app/api/Twilio/Rest/Oauth/V1/OpenidDiscoveryList.php new file mode 100755 index 0000000..64302d0 --- /dev/null +++ b/app/api/Twilio/Rest/Oauth/V1/OpenidDiscoveryList.php @@ -0,0 +1,61 @@ +solution = [ + ]; + } + + /** + * Constructs a OpenidDiscoveryContext + */ + public function getContext( + + ): OpenidDiscoveryContext + { + return new OpenidDiscoveryContext( + $this->version + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Oauth.V1.OpenidDiscoveryList]'; + } +} diff --git a/app/api/Twilio/Rest/Oauth/V1/OpenidDiscoveryPage.php b/app/api/Twilio/Rest/Oauth/V1/OpenidDiscoveryPage.php new file mode 100755 index 0000000..637a2c1 --- /dev/null +++ b/app/api/Twilio/Rest/Oauth/V1/OpenidDiscoveryPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return OpenidDiscoveryInstance \Twilio\Rest\Oauth\V1\OpenidDiscoveryInstance + */ + public function buildInstance(array $payload): OpenidDiscoveryInstance + { + return new OpenidDiscoveryInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Oauth.V1.OpenidDiscoveryPage]'; + } +} diff --git a/app/api/Twilio/Rest/Oauth/V1/TokenInstance.php b/app/api/Twilio/Rest/Oauth/V1/TokenInstance.php new file mode 100755 index 0000000..cfc0157 --- /dev/null +++ b/app/api/Twilio/Rest/Oauth/V1/TokenInstance.php @@ -0,0 +1,89 @@ +properties = [ + 'accessToken' => Values::array_get($payload, 'access_token'), + 'refreshToken' => Values::array_get($payload, 'refresh_token'), + 'idToken' => Values::array_get($payload, 'id_token'), + 'refreshTokenExpiresAt' => Deserialize::dateTime(Values::array_get($payload, 'refresh_token_expires_at')), + 'accessTokenExpiresAt' => Deserialize::dateTime(Values::array_get($payload, 'access_token_expires_at')), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Oauth.V1.TokenInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Oauth/V1/TokenList.php b/app/api/Twilio/Rest/Oauth/V1/TokenList.php new file mode 100755 index 0000000..a67f1ee --- /dev/null +++ b/app/api/Twilio/Rest/Oauth/V1/TokenList.php @@ -0,0 +1,96 @@ +solution = [ + ]; + + $this->uri = '/token'; + } + + /** + * Create the TokenInstance + * + * @param string $grantType Grant type is a credential representing resource owner's authorization which can be used by client to obtain access token. + * @param string $clientSid A 34 character string that uniquely identifies this OAuth App. + * @param array|Options $options Optional Arguments + * @return TokenInstance Created TokenInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $grantType, string $clientSid, array $options = []): TokenInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'GrantType' => + $grantType, + 'ClientSid' => + $clientSid, + 'ClientSecret' => + $options['clientSecret'], + 'Code' => + $options['code'], + 'CodeVerifier' => + $options['codeVerifier'], + 'DeviceCode' => + $options['deviceCode'], + 'RefreshToken' => + $options['refreshToken'], + 'DeviceId' => + $options['deviceId'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new TokenInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Oauth.V1.TokenList]'; + } +} diff --git a/app/api/Twilio/Rest/Oauth/V1/TokenOptions.php b/app/api/Twilio/Rest/Oauth/V1/TokenOptions.php new file mode 100755 index 0000000..a35e105 --- /dev/null +++ b/app/api/Twilio/Rest/Oauth/V1/TokenOptions.php @@ -0,0 +1,166 @@ +options['clientSecret'] = $clientSecret; + $this->options['code'] = $code; + $this->options['codeVerifier'] = $codeVerifier; + $this->options['deviceCode'] = $deviceCode; + $this->options['refreshToken'] = $refreshToken; + $this->options['deviceId'] = $deviceId; + } + + /** + * The credential for confidential OAuth App. + * + * @param string $clientSecret The credential for confidential OAuth App. + * @return $this Fluent Builder + */ + public function setClientSecret(string $clientSecret): self + { + $this->options['clientSecret'] = $clientSecret; + return $this; + } + + /** + * JWT token related to the authorization code grant type. + * + * @param string $code JWT token related to the authorization code grant type. + * @return $this Fluent Builder + */ + public function setCode(string $code): self + { + $this->options['code'] = $code; + return $this; + } + + /** + * A code which is generation cryptographically. + * + * @param string $codeVerifier A code which is generation cryptographically. + * @return $this Fluent Builder + */ + public function setCodeVerifier(string $codeVerifier): self + { + $this->options['codeVerifier'] = $codeVerifier; + return $this; + } + + /** + * JWT token related to the device code grant type. + * + * @param string $deviceCode JWT token related to the device code grant type. + * @return $this Fluent Builder + */ + public function setDeviceCode(string $deviceCode): self + { + $this->options['deviceCode'] = $deviceCode; + return $this; + } + + /** + * JWT token related to the refresh token grant type. + * + * @param string $refreshToken JWT token related to the refresh token grant type. + * @return $this Fluent Builder + */ + public function setRefreshToken(string $refreshToken): self + { + $this->options['refreshToken'] = $refreshToken; + return $this; + } + + /** + * The Id of the device associated with the token (refresh token). + * + * @param string $deviceId The Id of the device associated with the token (refresh token). + * @return $this Fluent Builder + */ + public function setDeviceId(string $deviceId): self + { + $this->options['deviceId'] = $deviceId; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Oauth.V1.CreateTokenOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Oauth/V1/TokenPage.php b/app/api/Twilio/Rest/Oauth/V1/TokenPage.php new file mode 100755 index 0000000..74f37e6 --- /dev/null +++ b/app/api/Twilio/Rest/Oauth/V1/TokenPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TokenInstance \Twilio\Rest\Oauth\V1\TokenInstance + */ + public function buildInstance(array $payload): TokenInstance + { + return new TokenInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Oauth.V1.TokenPage]'; + } +} diff --git a/app/api/Twilio/Rest/Oauth/V1/UserInfoContext.php b/app/api/Twilio/Rest/Oauth/V1/UserInfoContext.php new file mode 100755 index 0000000..db19eea --- /dev/null +++ b/app/api/Twilio/Rest/Oauth/V1/UserInfoContext.php @@ -0,0 +1,75 @@ +solution = [ + ]; + + $this->uri = '/userinfo'; + } + + /** + * Fetch the UserInfoInstance + * + * @return UserInfoInstance Fetched UserInfoInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserInfoInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new UserInfoInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Oauth.V1.UserInfoContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Oauth/V1/UserInfoInstance.php b/app/api/Twilio/Rest/Oauth/V1/UserInfoInstance.php new file mode 100755 index 0000000..265598c --- /dev/null +++ b/app/api/Twilio/Rest/Oauth/V1/UserInfoInstance.php @@ -0,0 +1,123 @@ +properties = [ + 'userSid' => Values::array_get($payload, 'user_sid'), + 'firstName' => Values::array_get($payload, 'first_name'), + 'lastName' => Values::array_get($payload, 'last_name'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'email' => Values::array_get($payload, 'email'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = []; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return UserInfoContext Context for this UserInfoInstance + */ + protected function proxy(): UserInfoContext + { + if (!$this->context) { + $this->context = new UserInfoContext( + $this->version + ); + } + + return $this->context; + } + + /** + * Fetch the UserInfoInstance + * + * @return UserInfoInstance Fetched UserInfoInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): UserInfoInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Oauth.V1.UserInfoInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Oauth/V1/UserInfoList.php b/app/api/Twilio/Rest/Oauth/V1/UserInfoList.php new file mode 100755 index 0000000..cd79d32 --- /dev/null +++ b/app/api/Twilio/Rest/Oauth/V1/UserInfoList.php @@ -0,0 +1,61 @@ +solution = [ + ]; + } + + /** + * Constructs a UserInfoContext + */ + public function getContext( + + ): UserInfoContext + { + return new UserInfoContext( + $this->version + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Oauth.V1.UserInfoList]'; + } +} diff --git a/app/api/Twilio/Rest/Oauth/V1/UserInfoPage.php b/app/api/Twilio/Rest/Oauth/V1/UserInfoPage.php new file mode 100755 index 0000000..b6697b4 --- /dev/null +++ b/app/api/Twilio/Rest/Oauth/V1/UserInfoPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UserInfoInstance \Twilio\Rest\Oauth\V1\UserInfoInstance + */ + public function buildInstance(array $payload): UserInfoInstance + { + return new UserInfoInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Oauth.V1.UserInfoPage]'; + } +} diff --git a/app/api/Twilio/Rest/OauthBase.php b/app/api/Twilio/Rest/OauthBase.php new file mode 100755 index 0000000..381384c --- /dev/null +++ b/app/api/Twilio/Rest/OauthBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://oauth.twilio.com'; + } + + + /** + * @return V1 Version v1 of oauth + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Oauth]'; + } +} diff --git a/app/api/Twilio/Rest/Preview.php b/app/api/Twilio/Rest/Preview.php new file mode 100755 index 0000000..8611ee0 --- /dev/null +++ b/app/api/Twilio/Rest/Preview.php @@ -0,0 +1,178 @@ +fleets instead. + */ + protected function getFleets(): \Twilio\Rest\Preview\DeployedDevices\FleetList { + echo "fleets is deprecated. Use deployedDevices->fleets instead."; + return $this->deployedDevices->fleets; + } + + /** + * @deprecated Use deployedDevices->fleets(\$sid) instead. + * @param string $sid A string that uniquely identifies the Fleet. + */ + protected function contextFleets(string $sid): \Twilio\Rest\Preview\DeployedDevices\FleetContext { + echo "fleets(\$sid) is deprecated. Use deployedDevices->fleets(\$sid) instead."; + return $this->deployedDevices->fleets($sid); + } + + /** + * @deprecated Use hostedNumbers->authorizationDocuments instead. + */ + protected function getAuthorizationDocuments(): \Twilio\Rest\Preview\HostedNumbers\AuthorizationDocumentList { + echo "authorizationDocuments is deprecated. Use hostedNumbers->authorizationDocuments instead."; + return $this->hostedNumbers->authorizationDocuments; + } + + /** + * @deprecated Use hostedNumbers->authorizationDocuments(\$sid) instead. + * @param string $sid AuthorizationDocument sid. + */ + protected function contextAuthorizationDocuments(string $sid): \Twilio\Rest\Preview\HostedNumbers\AuthorizationDocumentContext { + echo "authorizationDocuments(\$sid) is deprecated. Use hostedNumbers->authorizationDocuments(\$sid) instead."; + return $this->hostedNumbers->authorizationDocuments($sid); + } + + /** + * @deprecated Use hostedNumbers->hostedNumberOrders instead. + */ + protected function getHostedNumberOrders(): \Twilio\Rest\Preview\HostedNumbers\HostedNumberOrderList { + echo "hostedNumberOrders is deprecated. Use hostedNumbers->hostedNumberOrders instead."; + return $this->hostedNumbers->hostedNumberOrders; + } + + /** + * @deprecated Use hostedNumbers->hostedNumberOrders(\$sid) instead + * @param string $sid HostedNumberOrder sid. + */ + protected function contextHostedNumberOrders(string $sid): \Twilio\Rest\Preview\HostedNumbers\HostedNumberOrderContext { + echo "hostedNumberOrders(\$sid) is deprecated. Use hostedNumbers->hostedNumberOrders(\$sid) instead."; + return $this->hostedNumbers->hostedNumberOrders($sid); + } + + /** + * @deprecated Use marketplace->availableAddOns instead. + */ + protected function getAvailableAddOns(): \Twilio\Rest\Preview\Marketplace\AvailableAddOnList { + echo "availableAddOns is deprecated. Use marketplace->availableAddOns instead."; + return $this->marketplace->availableAddOns; + } + + /** + * @deprecated Use marketplace->availableAddOns(\$sid) instead. + * @param string $sid The SID of the AvailableAddOn resource to fetch + */ + protected function contextAvailableAddOns(string $sid): \Twilio\Rest\Preview\Marketplace\AvailableAddOnContext { + echo "availableAddOns(\$sid) is deprecated. Use marketplace->availableAddOns(\$sid) instead."; + return $this->marketplace->availableAddOns($sid); + } + + /** + * @deprecated Use marketplace->installedAddOns instead. + */ + protected function getInstalledAddOns(): \Twilio\Rest\Preview\Marketplace\InstalledAddOnList { + echo "installedAddOns is deprecated. Use marketplace->installedAddOns instead."; + return $this->marketplace->installedAddOns; + } + + /** + * @deprecated Use marketplace->installedAddOns(\$sid) instead. + * @param string $sid The SID of the InstalledAddOn resource to fetch + */ + protected function contextInstalledAddOns(string $sid): \Twilio\Rest\Preview\Marketplace\InstalledAddOnContext { + echo "installedAddOns(\$sid) is deprecated. Use marketplace->installedAddOns(\$sid) instead."; + return $this->marketplace->installedAddOns($sid); + } + + /** + * @deprecated Use sync->services instead. + */ + protected function getServices(): \Twilio\Rest\Preview\Sync\ServiceList { + echo "services is deprecated. Use sync->services instead."; + return $this->sync->services; + } + + /** + * @deprecated Use sync->services(\$sid) instead. + * @param string $sid The sid + */ + protected function contextServices(string $sid): \Twilio\Rest\Preview\Sync\ServiceContext { + echo "services(\$sid) is deprecated. Use sync->services(\$sid) instead."; + return $this->sync->services($sid); + } + + /** + * @deprecated Use understand->assistants instead. + */ + protected function getAssistants(): \Twilio\Rest\Preview\Understand\AssistantList { + echo "assistants is deprecated. Use understand->assistants instead."; + return $this->understand->assistants; + } + + /** + * @deprecated Use understand->assistants(\$sid) instead. + * @param string $sid A 34 character string that uniquely identifies this + * resource. + */ + protected function contextAssistants(string $sid): \Twilio\Rest\Preview\Understand\AssistantContext { + echo "assistants(\$sid) is deprecated. Use understand->assistants(\$sid) instead."; + return $this->understand->assistants($sid); + } + + /** + * @deprecated Use wireless->commands instead. + */ + protected function getCommands(): \Twilio\Rest\Preview\Wireless\CommandList { + echo "commands is deprecated. Use wireless->commands instead."; + return $this->wireless->commands; + } + + /** + * @deprecated Use wireless->commands(\$sid) instead. + * @param string $sid The sid + */ + protected function contextCommands(string $sid): \Twilio\Rest\Preview\Wireless\CommandContext { + echo "commands(\$sid) is deprecated. Use wireless->commands(\$sid) instead."; + return $this->wireless->commands($sid); + } + + /** + * @deprecated Use wireless->ratePlans instead. + */ + protected function getRatePlans(): \Twilio\Rest\Preview\Wireless\RatePlanList { + echo "ratePlans is deprecated. Use wireless->ratePlans instead."; + return $this->wireless->ratePlans; + } + + /** + * @deprecated Use wireless->ratePlans(\$sid) instead. + * @param string $sid The sid + */ + protected function contextRatePlans(string $sid): \Twilio\Rest\Preview\Wireless\RatePlanContext { + echo "ratePlans(\$sid) is deprecated. Use wireless->ratePlans(\$sid) instead."; + return $this->wireless->ratePlans($sid); + } + + /** + * @deprecated Use wireless->sims instead. + */ + protected function getSims(): \Twilio\Rest\Preview\Wireless\SimList { + echo "sims is deprecated. Use wireless->sims instead."; + return $this->wireless->sims; + } + + /** + * @deprecated Use wireless->sims(\$sid) instead. + * @param string $sid The sid + */ + protected function contextSims(string $sid): \Twilio\Rest\Preview\Wireless\SimContext { + echo "sims(\$sid) is deprecated. Use wireless->sims(\$sid) instead."; + return $this->wireless->sims($sid); + } +} \ No newline at end of file diff --git a/app/api/Twilio/Rest/Preview/DeployedDevices.php b/app/api/Twilio/Rest/Preview/DeployedDevices.php new file mode 100755 index 0000000..8c6907e --- /dev/null +++ b/app/api/Twilio/Rest/Preview/DeployedDevices.php @@ -0,0 +1,95 @@ +version = 'DeployedDevices'; + } + + protected function getFleets(): FleetList + { + if (!$this->_fleets) { + $this->_fleets = new FleetList($this); + } + return $this->_fleets; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.DeployedDevices]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateContext.php b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateContext.php new file mode 100755 index 0000000..40ede4e --- /dev/null +++ b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateContext.php @@ -0,0 +1,132 @@ +solution = [ + 'fleetSid' => + $fleetSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Fleets/' . \rawurlencode($fleetSid) + .'/Certificates/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the CertificateInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the CertificateInstance + * + * @return CertificateInstance Fetched CertificateInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CertificateInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new CertificateInstance( + $this->version, + $payload, + $this->solution['fleetSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the CertificateInstance + * + * @param array|Options $options Optional Arguments + * @return CertificateInstance Updated CertificateInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CertificateInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'DeviceSid' => + $options['deviceSid'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new CertificateInstance( + $this->version, + $payload, + $this->solution['fleetSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.DeployedDevices.CertificateContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateInstance.php b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateInstance.php new file mode 100755 index 0000000..8e5805c --- /dev/null +++ b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateInstance.php @@ -0,0 +1,160 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'url' => Values::array_get($payload, 'url'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'fleetSid' => Values::array_get($payload, 'fleet_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'deviceSid' => Values::array_get($payload, 'device_sid'), + 'thumbprint' => Values::array_get($payload, 'thumbprint'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + ]; + + $this->solution = ['fleetSid' => $fleetSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CertificateContext Context for this CertificateInstance + */ + protected function proxy(): CertificateContext + { + if (!$this->context) { + $this->context = new CertificateContext( + $this->version, + $this->solution['fleetSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the CertificateInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the CertificateInstance + * + * @return CertificateInstance Fetched CertificateInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CertificateInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the CertificateInstance + * + * @param array|Options $options Optional Arguments + * @return CertificateInstance Updated CertificateInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CertificateInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.DeployedDevices.CertificateInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateList.php b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateList.php new file mode 100755 index 0000000..e650cf1 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateList.php @@ -0,0 +1,208 @@ +solution = [ + 'fleetSid' => + $fleetSid, + + ]; + + $this->uri = '/Fleets/' . \rawurlencode($fleetSid) + .'/Certificates'; + } + + /** + * Create the CertificateInstance + * + * @param string $certificateData Provides a URL encoded representation of the public certificate in PEM format. + * @param array|Options $options Optional Arguments + * @return CertificateInstance Created CertificateInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $certificateData, array $options = []): CertificateInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'CertificateData' => + $certificateData, + 'FriendlyName' => + $options['friendlyName'], + 'DeviceSid' => + $options['deviceSid'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new CertificateInstance( + $this->version, + $payload, + $this->solution['fleetSid'] + ); + } + + + /** + * Reads CertificateInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return CertificateInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams CertificateInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CertificateInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return CertificatePage Page of CertificateInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CertificatePage + { + $options = new Values($options); + + $params = Values::of([ + 'DeviceSid' => + $options['deviceSid'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new CertificatePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of CertificateInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return CertificatePage Page of CertificateInstance + */ + public function getPage(string $targetUrl): CertificatePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CertificatePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CertificateContext + * + * @param string $sid Provides a 34 character string that uniquely identifies the requested Certificate credential resource. + */ + public function getContext( + string $sid + + ): CertificateContext + { + return new CertificateContext( + $this->version, + $this->solution['fleetSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.DeployedDevices.CertificateList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateOptions.php b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateOptions.php new file mode 100755 index 0000000..a649a3f --- /dev/null +++ b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificateOptions.php @@ -0,0 +1,220 @@ +options['friendlyName'] = $friendlyName; + $this->options['deviceSid'] = $deviceSid; + } + + /** + * Provides a human readable descriptive text for this Certificate credential, up to 256 characters long. + * + * @param string $friendlyName Provides a human readable descriptive text for this Certificate credential, up to 256 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provides the unique string identifier of an existing Device to become authenticated with this Certificate credential. + * + * @param string $deviceSid Provides the unique string identifier of an existing Device to become authenticated with this Certificate credential. + * @return $this Fluent Builder + */ + public function setDeviceSid(string $deviceSid): self + { + $this->options['deviceSid'] = $deviceSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.DeployedDevices.CreateCertificateOptions ' . $options . ']'; + } +} + + + +class ReadCertificateOptions extends Options + { + /** + * @param string $deviceSid Filters the resulting list of Certificates by a unique string identifier of an authenticated Device. + */ + public function __construct( + + string $deviceSid = Values::NONE + + ) { + $this->options['deviceSid'] = $deviceSid; + } + + /** + * Filters the resulting list of Certificates by a unique string identifier of an authenticated Device. + * + * @param string $deviceSid Filters the resulting list of Certificates by a unique string identifier of an authenticated Device. + * @return $this Fluent Builder + */ + public function setDeviceSid(string $deviceSid): self + { + $this->options['deviceSid'] = $deviceSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.DeployedDevices.ReadCertificateOptions ' . $options . ']'; + } +} + +class UpdateCertificateOptions extends Options + { + /** + * @param string $friendlyName Provides a human readable descriptive text for this Certificate credential, up to 256 characters long. + * @param string $deviceSid Provides the unique string identifier of an existing Device to become authenticated with this Certificate credential. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $deviceSid = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['deviceSid'] = $deviceSid; + } + + /** + * Provides a human readable descriptive text for this Certificate credential, up to 256 characters long. + * + * @param string $friendlyName Provides a human readable descriptive text for this Certificate credential, up to 256 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provides the unique string identifier of an existing Device to become authenticated with this Certificate credential. + * + * @param string $deviceSid Provides the unique string identifier of an existing Device to become authenticated with this Certificate credential. + * @return $this Fluent Builder + */ + public function setDeviceSid(string $deviceSid): self + { + $this->options['deviceSid'] = $deviceSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.DeployedDevices.UpdateCertificateOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificatePage.php b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificatePage.php new file mode 100755 index 0000000..05e2401 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/CertificatePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CertificateInstance \Twilio\Rest\Preview\DeployedDevices\Fleet\CertificateInstance + */ + public function buildInstance(array $payload): CertificateInstance + { + return new CertificateInstance($this->version, $payload, $this->solution['fleetSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.DeployedDevices.CertificatePage]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentContext.php b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentContext.php new file mode 100755 index 0000000..d6ee46b --- /dev/null +++ b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentContext.php @@ -0,0 +1,132 @@ +solution = [ + 'fleetSid' => + $fleetSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Fleets/' . \rawurlencode($fleetSid) + .'/Deployments/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the DeploymentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the DeploymentInstance + * + * @return DeploymentInstance Fetched DeploymentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DeploymentInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new DeploymentInstance( + $this->version, + $payload, + $this->solution['fleetSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the DeploymentInstance + * + * @param array|Options $options Optional Arguments + * @return DeploymentInstance Updated DeploymentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): DeploymentInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'SyncServiceSid' => + $options['syncServiceSid'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new DeploymentInstance( + $this->version, + $payload, + $this->solution['fleetSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.DeployedDevices.DeploymentContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentInstance.php b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentInstance.php new file mode 100755 index 0000000..855eb8b --- /dev/null +++ b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentInstance.php @@ -0,0 +1,158 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'url' => Values::array_get($payload, 'url'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'fleetSid' => Values::array_get($payload, 'fleet_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'syncServiceSid' => Values::array_get($payload, 'sync_service_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + ]; + + $this->solution = ['fleetSid' => $fleetSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return DeploymentContext Context for this DeploymentInstance + */ + protected function proxy(): DeploymentContext + { + if (!$this->context) { + $this->context = new DeploymentContext( + $this->version, + $this->solution['fleetSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the DeploymentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the DeploymentInstance + * + * @return DeploymentInstance Fetched DeploymentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DeploymentInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the DeploymentInstance + * + * @param array|Options $options Optional Arguments + * @return DeploymentInstance Updated DeploymentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): DeploymentInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.DeployedDevices.DeploymentInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentList.php b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentList.php new file mode 100755 index 0000000..bfc6b56 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentList.php @@ -0,0 +1,199 @@ +solution = [ + 'fleetSid' => + $fleetSid, + + ]; + + $this->uri = '/Fleets/' . \rawurlencode($fleetSid) + .'/Deployments'; + } + + /** + * Create the DeploymentInstance + * + * @param array|Options $options Optional Arguments + * @return DeploymentInstance Created DeploymentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): DeploymentInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'SyncServiceSid' => + $options['syncServiceSid'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new DeploymentInstance( + $this->version, + $payload, + $this->solution['fleetSid'] + ); + } + + + /** + * Reads DeploymentInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return DeploymentInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams DeploymentInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of DeploymentInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return DeploymentPage Page of DeploymentInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): DeploymentPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new DeploymentPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of DeploymentInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return DeploymentPage Page of DeploymentInstance + */ + public function getPage(string $targetUrl): DeploymentPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new DeploymentPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a DeploymentContext + * + * @param string $sid Provides a 34 character string that uniquely identifies the requested Deployment resource. + */ + public function getContext( + string $sid + + ): DeploymentContext + { + return new DeploymentContext( + $this->version, + $this->solution['fleetSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.DeployedDevices.DeploymentList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentOptions.php b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentOptions.php new file mode 100755 index 0000000..f8e2b0a --- /dev/null +++ b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentOptions.php @@ -0,0 +1,170 @@ +options['friendlyName'] = $friendlyName; + $this->options['syncServiceSid'] = $syncServiceSid; + } + + /** + * Provides a human readable descriptive text for this Deployment, up to 256 characters long. + * + * @param string $friendlyName Provides a human readable descriptive text for this Deployment, up to 256 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provides the unique string identifier of the Twilio Sync service instance that will be linked to and accessible by this Deployment. + * + * @param string $syncServiceSid Provides the unique string identifier of the Twilio Sync service instance that will be linked to and accessible by this Deployment. + * @return $this Fluent Builder + */ + public function setSyncServiceSid(string $syncServiceSid): self + { + $this->options['syncServiceSid'] = $syncServiceSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.DeployedDevices.CreateDeploymentOptions ' . $options . ']'; + } +} + + + + +class UpdateDeploymentOptions extends Options + { + /** + * @param string $friendlyName Provides a human readable descriptive text for this Deployment, up to 64 characters long + * @param string $syncServiceSid Provides the unique string identifier of the Twilio Sync service instance that will be linked to and accessible by this Deployment. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $syncServiceSid = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['syncServiceSid'] = $syncServiceSid; + } + + /** + * Provides a human readable descriptive text for this Deployment, up to 64 characters long + * + * @param string $friendlyName Provides a human readable descriptive text for this Deployment, up to 64 characters long + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provides the unique string identifier of the Twilio Sync service instance that will be linked to and accessible by this Deployment. + * + * @param string $syncServiceSid Provides the unique string identifier of the Twilio Sync service instance that will be linked to and accessible by this Deployment. + * @return $this Fluent Builder + */ + public function setSyncServiceSid(string $syncServiceSid): self + { + $this->options['syncServiceSid'] = $syncServiceSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.DeployedDevices.UpdateDeploymentOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentPage.php b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentPage.php new file mode 100755 index 0000000..2c027b8 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/DeploymentPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DeploymentInstance \Twilio\Rest\Preview\DeployedDevices\Fleet\DeploymentInstance + */ + public function buildInstance(array $payload): DeploymentInstance + { + return new DeploymentInstance($this->version, $payload, $this->solution['fleetSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.DeployedDevices.DeploymentPage]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceContext.php b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceContext.php new file mode 100755 index 0000000..e588ced --- /dev/null +++ b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceContext.php @@ -0,0 +1,137 @@ +solution = [ + 'fleetSid' => + $fleetSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Fleets/' . \rawurlencode($fleetSid) + .'/Devices/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the DeviceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the DeviceInstance + * + * @return DeviceInstance Fetched DeviceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DeviceInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new DeviceInstance( + $this->version, + $payload, + $this->solution['fleetSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the DeviceInstance + * + * @param array|Options $options Optional Arguments + * @return DeviceInstance Updated DeviceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): DeviceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'Identity' => + $options['identity'], + 'DeploymentSid' => + $options['deploymentSid'], + 'Enabled' => + Serialize::booleanToString($options['enabled']), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new DeviceInstance( + $this->version, + $payload, + $this->solution['fleetSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.DeployedDevices.DeviceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceInstance.php b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceInstance.php new file mode 100755 index 0000000..6049823 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceInstance.php @@ -0,0 +1,166 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'url' => Values::array_get($payload, 'url'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'fleetSid' => Values::array_get($payload, 'fleet_sid'), + 'enabled' => Values::array_get($payload, 'enabled'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'deploymentSid' => Values::array_get($payload, 'deployment_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'dateAuthenticated' => Deserialize::dateTime(Values::array_get($payload, 'date_authenticated')), + ]; + + $this->solution = ['fleetSid' => $fleetSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return DeviceContext Context for this DeviceInstance + */ + protected function proxy(): DeviceContext + { + if (!$this->context) { + $this->context = new DeviceContext( + $this->version, + $this->solution['fleetSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the DeviceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the DeviceInstance + * + * @return DeviceInstance Fetched DeviceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DeviceInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the DeviceInstance + * + * @param array|Options $options Optional Arguments + * @return DeviceInstance Updated DeviceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): DeviceInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.DeployedDevices.DeviceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceList.php b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceList.php new file mode 100755 index 0000000..d0b11d7 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceList.php @@ -0,0 +1,212 @@ +solution = [ + 'fleetSid' => + $fleetSid, + + ]; + + $this->uri = '/Fleets/' . \rawurlencode($fleetSid) + .'/Devices'; + } + + /** + * Create the DeviceInstance + * + * @param array|Options $options Optional Arguments + * @return DeviceInstance Created DeviceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): DeviceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + 'FriendlyName' => + $options['friendlyName'], + 'Identity' => + $options['identity'], + 'DeploymentSid' => + $options['deploymentSid'], + 'Enabled' => + Serialize::booleanToString($options['enabled']), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new DeviceInstance( + $this->version, + $payload, + $this->solution['fleetSid'] + ); + } + + + /** + * Reads DeviceInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return DeviceInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams DeviceInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of DeviceInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return DevicePage Page of DeviceInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): DevicePage + { + $options = new Values($options); + + $params = Values::of([ + 'DeploymentSid' => + $options['deploymentSid'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new DevicePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of DeviceInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return DevicePage Page of DeviceInstance + */ + public function getPage(string $targetUrl): DevicePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new DevicePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a DeviceContext + * + * @param string $sid Provides a 34 character string that uniquely identifies the requested Device resource. + */ + public function getContext( + string $sid + + ): DeviceContext + { + return new DeviceContext( + $this->version, + $this->solution['fleetSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.DeployedDevices.DeviceList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceOptions.php b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceOptions.php new file mode 100755 index 0000000..9f4d7e2 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/DeviceOptions.php @@ -0,0 +1,310 @@ +options['uniqueName'] = $uniqueName; + $this->options['friendlyName'] = $friendlyName; + $this->options['identity'] = $identity; + $this->options['deploymentSid'] = $deploymentSid; + $this->options['enabled'] = $enabled; + } + + /** + * Provides a unique and addressable name to be assigned to this Device, to be used in addition to SID, up to 128 characters long. + * + * @param string $uniqueName Provides a unique and addressable name to be assigned to this Device, to be used in addition to SID, up to 128 characters long. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * Provides a human readable descriptive text to be assigned to this Device, up to 256 characters long. + * + * @param string $friendlyName Provides a human readable descriptive text to be assigned to this Device, up to 256 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provides an arbitrary string identifier representing a human user to be associated with this Device, up to 256 characters long. + * + * @param string $identity Provides an arbitrary string identifier representing a human user to be associated with this Device, up to 256 characters long. + * @return $this Fluent Builder + */ + public function setIdentity(string $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * Specifies the unique string identifier of the Deployment group that this Device is going to be associated with. + * + * @param string $deploymentSid Specifies the unique string identifier of the Deployment group that this Device is going to be associated with. + * @return $this Fluent Builder + */ + public function setDeploymentSid(string $deploymentSid): self + { + $this->options['deploymentSid'] = $deploymentSid; + return $this; + } + + /** + * + * + * @param bool $enabled + * @return $this Fluent Builder + */ + public function setEnabled(bool $enabled): self + { + $this->options['enabled'] = $enabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.DeployedDevices.CreateDeviceOptions ' . $options . ']'; + } +} + + + +class ReadDeviceOptions extends Options + { + /** + * @param string $deploymentSid Filters the resulting list of Devices by a unique string identifier of the Deployment they are associated with. + */ + public function __construct( + + string $deploymentSid = Values::NONE + + ) { + $this->options['deploymentSid'] = $deploymentSid; + } + + /** + * Filters the resulting list of Devices by a unique string identifier of the Deployment they are associated with. + * + * @param string $deploymentSid Filters the resulting list of Devices by a unique string identifier of the Deployment they are associated with. + * @return $this Fluent Builder + */ + public function setDeploymentSid(string $deploymentSid): self + { + $this->options['deploymentSid'] = $deploymentSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.DeployedDevices.ReadDeviceOptions ' . $options . ']'; + } +} + +class UpdateDeviceOptions extends Options + { + /** + * @param string $friendlyName Provides a human readable descriptive text to be assigned to this Device, up to 256 characters long. + * @param string $identity Provides an arbitrary string identifier representing a human user to be associated with this Device, up to 256 characters long. + * @param string $deploymentSid Specifies the unique string identifier of the Deployment group that this Device is going to be associated with. + * @param bool $enabled + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $identity = Values::NONE, + string $deploymentSid = Values::NONE, + bool $enabled = Values::BOOL_NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['identity'] = $identity; + $this->options['deploymentSid'] = $deploymentSid; + $this->options['enabled'] = $enabled; + } + + /** + * Provides a human readable descriptive text to be assigned to this Device, up to 256 characters long. + * + * @param string $friendlyName Provides a human readable descriptive text to be assigned to this Device, up to 256 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provides an arbitrary string identifier representing a human user to be associated with this Device, up to 256 characters long. + * + * @param string $identity Provides an arbitrary string identifier representing a human user to be associated with this Device, up to 256 characters long. + * @return $this Fluent Builder + */ + public function setIdentity(string $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * Specifies the unique string identifier of the Deployment group that this Device is going to be associated with. + * + * @param string $deploymentSid Specifies the unique string identifier of the Deployment group that this Device is going to be associated with. + * @return $this Fluent Builder + */ + public function setDeploymentSid(string $deploymentSid): self + { + $this->options['deploymentSid'] = $deploymentSid; + return $this; + } + + /** + * + * + * @param bool $enabled + * @return $this Fluent Builder + */ + public function setEnabled(bool $enabled): self + { + $this->options['enabled'] = $enabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.DeployedDevices.UpdateDeviceOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/DevicePage.php b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/DevicePage.php new file mode 100755 index 0000000..e5831bb --- /dev/null +++ b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/DevicePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DeviceInstance \Twilio\Rest\Preview\DeployedDevices\Fleet\DeviceInstance + */ + public function buildInstance(array $payload): DeviceInstance + { + return new DeviceInstance($this->version, $payload, $this->solution['fleetSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.DeployedDevices.DevicePage]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyContext.php b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyContext.php new file mode 100755 index 0000000..7dc4c1e --- /dev/null +++ b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyContext.php @@ -0,0 +1,132 @@ +solution = [ + 'fleetSid' => + $fleetSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Fleets/' . \rawurlencode($fleetSid) + .'/Keys/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the KeyInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the KeyInstance + * + * @return KeyInstance Fetched KeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): KeyInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new KeyInstance( + $this->version, + $payload, + $this->solution['fleetSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the KeyInstance + * + * @param array|Options $options Optional Arguments + * @return KeyInstance Updated KeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): KeyInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'DeviceSid' => + $options['deviceSid'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new KeyInstance( + $this->version, + $payload, + $this->solution['fleetSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.DeployedDevices.KeyContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyInstance.php b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyInstance.php new file mode 100755 index 0000000..a339e82 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyInstance.php @@ -0,0 +1,160 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'url' => Values::array_get($payload, 'url'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'fleetSid' => Values::array_get($payload, 'fleet_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'deviceSid' => Values::array_get($payload, 'device_sid'), + 'secret' => Values::array_get($payload, 'secret'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + ]; + + $this->solution = ['fleetSid' => $fleetSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return KeyContext Context for this KeyInstance + */ + protected function proxy(): KeyContext + { + if (!$this->context) { + $this->context = new KeyContext( + $this->version, + $this->solution['fleetSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the KeyInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the KeyInstance + * + * @return KeyInstance Fetched KeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): KeyInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the KeyInstance + * + * @param array|Options $options Optional Arguments + * @return KeyInstance Updated KeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): KeyInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.DeployedDevices.KeyInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyList.php b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyList.php new file mode 100755 index 0000000..c3cc577 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyList.php @@ -0,0 +1,205 @@ +solution = [ + 'fleetSid' => + $fleetSid, + + ]; + + $this->uri = '/Fleets/' . \rawurlencode($fleetSid) + .'/Keys'; + } + + /** + * Create the KeyInstance + * + * @param array|Options $options Optional Arguments + * @return KeyInstance Created KeyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): KeyInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'DeviceSid' => + $options['deviceSid'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new KeyInstance( + $this->version, + $payload, + $this->solution['fleetSid'] + ); + } + + + /** + * Reads KeyInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return KeyInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams KeyInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of KeyInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return KeyPage Page of KeyInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): KeyPage + { + $options = new Values($options); + + $params = Values::of([ + 'DeviceSid' => + $options['deviceSid'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new KeyPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of KeyInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return KeyPage Page of KeyInstance + */ + public function getPage(string $targetUrl): KeyPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new KeyPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a KeyContext + * + * @param string $sid Provides a 34 character string that uniquely identifies the requested Key credential resource. + */ + public function getContext( + string $sid + + ): KeyContext + { + return new KeyContext( + $this->version, + $this->solution['fleetSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.DeployedDevices.KeyList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyOptions.php b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyOptions.php new file mode 100755 index 0000000..effaecf --- /dev/null +++ b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyOptions.php @@ -0,0 +1,220 @@ +options['friendlyName'] = $friendlyName; + $this->options['deviceSid'] = $deviceSid; + } + + /** + * Provides a human readable descriptive text for this Key credential, up to 256 characters long. + * + * @param string $friendlyName Provides a human readable descriptive text for this Key credential, up to 256 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provides the unique string identifier of an existing Device to become authenticated with this Key credential. + * + * @param string $deviceSid Provides the unique string identifier of an existing Device to become authenticated with this Key credential. + * @return $this Fluent Builder + */ + public function setDeviceSid(string $deviceSid): self + { + $this->options['deviceSid'] = $deviceSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.DeployedDevices.CreateKeyOptions ' . $options . ']'; + } +} + + + +class ReadKeyOptions extends Options + { + /** + * @param string $deviceSid Filters the resulting list of Keys by a unique string identifier of an authenticated Device. + */ + public function __construct( + + string $deviceSid = Values::NONE + + ) { + $this->options['deviceSid'] = $deviceSid; + } + + /** + * Filters the resulting list of Keys by a unique string identifier of an authenticated Device. + * + * @param string $deviceSid Filters the resulting list of Keys by a unique string identifier of an authenticated Device. + * @return $this Fluent Builder + */ + public function setDeviceSid(string $deviceSid): self + { + $this->options['deviceSid'] = $deviceSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.DeployedDevices.ReadKeyOptions ' . $options . ']'; + } +} + +class UpdateKeyOptions extends Options + { + /** + * @param string $friendlyName Provides a human readable descriptive text for this Key credential, up to 256 characters long. + * @param string $deviceSid Provides the unique string identifier of an existing Device to become authenticated with this Key credential. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $deviceSid = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['deviceSid'] = $deviceSid; + } + + /** + * Provides a human readable descriptive text for this Key credential, up to 256 characters long. + * + * @param string $friendlyName Provides a human readable descriptive text for this Key credential, up to 256 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provides the unique string identifier of an existing Device to become authenticated with this Key credential. + * + * @param string $deviceSid Provides the unique string identifier of an existing Device to become authenticated with this Key credential. + * @return $this Fluent Builder + */ + public function setDeviceSid(string $deviceSid): self + { + $this->options['deviceSid'] = $deviceSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.DeployedDevices.UpdateKeyOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyPage.php b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyPage.php new file mode 100755 index 0000000..3456222 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/DeployedDevices/Fleet/KeyPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return KeyInstance \Twilio\Rest\Preview\DeployedDevices\Fleet\KeyInstance + */ + public function buildInstance(array $payload): KeyInstance + { + return new KeyInstance($this->version, $payload, $this->solution['fleetSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.DeployedDevices.KeyPage]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/DeployedDevices/FleetContext.php b/app/api/Twilio/Rest/Preview/DeployedDevices/FleetContext.php new file mode 100755 index 0000000..b5c4f2b --- /dev/null +++ b/app/api/Twilio/Rest/Preview/DeployedDevices/FleetContext.php @@ -0,0 +1,240 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Fleets/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the FleetInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the FleetInstance + * + * @return FleetInstance Fetched FleetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FleetInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new FleetInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the FleetInstance + * + * @param array|Options $options Optional Arguments + * @return FleetInstance Updated FleetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): FleetInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'DefaultDeploymentSid' => + $options['defaultDeploymentSid'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new FleetInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the certificates + */ + protected function getCertificates(): CertificateList + { + if (!$this->_certificates) { + $this->_certificates = new CertificateList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_certificates; + } + + /** + * Access the devices + */ + protected function getDevices(): DeviceList + { + if (!$this->_devices) { + $this->_devices = new DeviceList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_devices; + } + + /** + * Access the keys + */ + protected function getKeys(): KeyList + { + if (!$this->_keys) { + $this->_keys = new KeyList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_keys; + } + + /** + * Access the deployments + */ + protected function getDeployments(): DeploymentList + { + if (!$this->_deployments) { + $this->_deployments = new DeploymentList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_deployments; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.DeployedDevices.FleetContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Preview/DeployedDevices/FleetInstance.php b/app/api/Twilio/Rest/Preview/DeployedDevices/FleetInstance.php new file mode 100755 index 0000000..349a1ff --- /dev/null +++ b/app/api/Twilio/Rest/Preview/DeployedDevices/FleetInstance.php @@ -0,0 +1,199 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'url' => Values::array_get($payload, 'url'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'defaultDeploymentSid' => Values::array_get($payload, 'default_deployment_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return FleetContext Context for this FleetInstance + */ + protected function proxy(): FleetContext + { + if (!$this->context) { + $this->context = new FleetContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the FleetInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the FleetInstance + * + * @return FleetInstance Fetched FleetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FleetInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the FleetInstance + * + * @param array|Options $options Optional Arguments + * @return FleetInstance Updated FleetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): FleetInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the certificates + */ + protected function getCertificates(): CertificateList + { + return $this->proxy()->certificates; + } + + /** + * Access the devices + */ + protected function getDevices(): DeviceList + { + return $this->proxy()->devices; + } + + /** + * Access the keys + */ + protected function getKeys(): KeyList + { + return $this->proxy()->keys; + } + + /** + * Access the deployments + */ + protected function getDeployments(): DeploymentList + { + return $this->proxy()->deployments; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.DeployedDevices.FleetInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/DeployedDevices/FleetList.php b/app/api/Twilio/Rest/Preview/DeployedDevices/FleetList.php new file mode 100755 index 0000000..eb4b995 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/DeployedDevices/FleetList.php @@ -0,0 +1,189 @@ +solution = [ + ]; + + $this->uri = '/Fleets'; + } + + /** + * Create the FleetInstance + * + * @param array|Options $options Optional Arguments + * @return FleetInstance Created FleetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): FleetInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new FleetInstance( + $this->version, + $payload + ); + } + + + /** + * Reads FleetInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return FleetInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams FleetInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of FleetInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return FleetPage Page of FleetInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): FleetPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new FleetPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of FleetInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return FleetPage Page of FleetInstance + */ + public function getPage(string $targetUrl): FleetPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new FleetPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a FleetContext + * + * @param string $sid Provides a 34 character string that uniquely identifies the requested Fleet resource. + */ + public function getContext( + string $sid + + ): FleetContext + { + return new FleetContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.DeployedDevices.FleetList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/DeployedDevices/FleetOptions.php b/app/api/Twilio/Rest/Preview/DeployedDevices/FleetOptions.php new file mode 100755 index 0000000..92d7e5d --- /dev/null +++ b/app/api/Twilio/Rest/Preview/DeployedDevices/FleetOptions.php @@ -0,0 +1,152 @@ +options['friendlyName'] = $friendlyName; + } + + /** + * Provides a human readable descriptive text for this Fleet, up to 256 characters long. + * + * @param string $friendlyName Provides a human readable descriptive text for this Fleet, up to 256 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.DeployedDevices.CreateFleetOptions ' . $options . ']'; + } +} + + + + +class UpdateFleetOptions extends Options + { + /** + * @param string $friendlyName Provides a human readable descriptive text for this Fleet, up to 256 characters long. + * @param string $defaultDeploymentSid Provides a string identifier of a Deployment that is going to be used as a default one for this Fleet. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $defaultDeploymentSid = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['defaultDeploymentSid'] = $defaultDeploymentSid; + } + + /** + * Provides a human readable descriptive text for this Fleet, up to 256 characters long. + * + * @param string $friendlyName Provides a human readable descriptive text for this Fleet, up to 256 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provides a string identifier of a Deployment that is going to be used as a default one for this Fleet. + * + * @param string $defaultDeploymentSid Provides a string identifier of a Deployment that is going to be used as a default one for this Fleet. + * @return $this Fluent Builder + */ + public function setDefaultDeploymentSid(string $defaultDeploymentSid): self + { + $this->options['defaultDeploymentSid'] = $defaultDeploymentSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.DeployedDevices.UpdateFleetOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/DeployedDevices/FleetPage.php b/app/api/Twilio/Rest/Preview/DeployedDevices/FleetPage.php new file mode 100755 index 0000000..a187aa5 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/DeployedDevices/FleetPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return FleetInstance \Twilio\Rest\Preview\DeployedDevices\FleetInstance + */ + public function buildInstance(array $payload): FleetInstance + { + return new FleetInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.DeployedDevices.FleetPage]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/HostedNumbers.php b/app/api/Twilio/Rest/Preview/HostedNumbers.php new file mode 100755 index 0000000..19e1bd3 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/HostedNumbers.php @@ -0,0 +1,107 @@ +version = 'HostedNumbers'; + } + + protected function getAuthorizationDocuments(): AuthorizationDocumentList + { + if (!$this->_authorizationDocuments) { + $this->_authorizationDocuments = new AuthorizationDocumentList($this); + } + return $this->_authorizationDocuments; + } + + protected function getHostedNumberOrders(): HostedNumberOrderList + { + if (!$this->_hostedNumberOrders) { + $this->_hostedNumberOrders = new HostedNumberOrderList($this); + } + return $this->_hostedNumberOrders; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.HostedNumbers]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderInstance.php b/app/api/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderInstance.php new file mode 100755 index 0000000..cb085a8 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderInstance.php @@ -0,0 +1,125 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'incomingPhoneNumberSid' => Values::array_get($payload, 'incoming_phone_number_sid'), + 'addressSid' => Values::array_get($payload, 'address_sid'), + 'signingDocumentSid' => Values::array_get($payload, 'signing_document_sid'), + 'phoneNumber' => Values::array_get($payload, 'phone_number'), + 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'status' => Values::array_get($payload, 'status'), + 'failureReason' => Values::array_get($payload, 'failure_reason'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'verificationAttempts' => Values::array_get($payload, 'verification_attempts'), + 'email' => Values::array_get($payload, 'email'), + 'ccEmails' => Values::array_get($payload, 'cc_emails'), + 'verificationType' => Values::array_get($payload, 'verification_type'), + 'verificationDocumentSid' => Values::array_get($payload, 'verification_document_sid'), + 'extension' => Values::array_get($payload, 'extension'), + 'callDelay' => Values::array_get($payload, 'call_delay'), + 'verificationCode' => Values::array_get($payload, 'verification_code'), + 'verificationCallSids' => Values::array_get($payload, 'verification_call_sids'), + ]; + + $this->solution = ['signingDocumentSid' => $signingDocumentSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.HostedNumbers.DependentHostedNumberOrderInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderList.php b/app/api/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderList.php new file mode 100755 index 0000000..5512f90 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderList.php @@ -0,0 +1,166 @@ +solution = [ + 'signingDocumentSid' => + $signingDocumentSid, + + ]; + + $this->uri = '/AuthorizationDocuments/' . \rawurlencode($signingDocumentSid) + .'/DependentHostedNumberOrders'; + } + + /** + * Reads DependentHostedNumberOrderInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return DependentHostedNumberOrderInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams DependentHostedNumberOrderInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of DependentHostedNumberOrderInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return DependentHostedNumberOrderPage Page of DependentHostedNumberOrderInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): DependentHostedNumberOrderPage + { + $options = new Values($options); + + $params = Values::of([ + 'Status' => + $options['status'], + 'PhoneNumber' => + $options['phoneNumber'], + 'IncomingPhoneNumberSid' => + $options['incomingPhoneNumberSid'], + 'FriendlyName' => + $options['friendlyName'], + 'UniqueName' => + $options['uniqueName'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new DependentHostedNumberOrderPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of DependentHostedNumberOrderInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return DependentHostedNumberOrderPage Page of DependentHostedNumberOrderInstance + */ + public function getPage(string $targetUrl): DependentHostedNumberOrderPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new DependentHostedNumberOrderPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.HostedNumbers.DependentHostedNumberOrderList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderOptions.php b/app/api/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderOptions.php new file mode 100755 index 0000000..5b04b97 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderOptions.php @@ -0,0 +1,148 @@ +options['status'] = $status; + $this->options['phoneNumber'] = $phoneNumber; + $this->options['incomingPhoneNumberSid'] = $incomingPhoneNumberSid; + $this->options['friendlyName'] = $friendlyName; + $this->options['uniqueName'] = $uniqueName; + } + + /** + * Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/api/phone-numbers/hosted-number-authorization-documents#status-values) for more information on each of these statuses. + * + * @param string $status Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/api/phone-numbers/hosted-number-authorization-documents#status-values) for more information on each of these statuses. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * An E164 formatted phone number hosted by this HostedNumberOrder. + * + * @param string $phoneNumber An E164 formatted phone number hosted by this HostedNumberOrder. + * @return $this Fluent Builder + */ + public function setPhoneNumber(string $phoneNumber): self + { + $this->options['phoneNumber'] = $phoneNumber; + return $this; + } + + /** + * A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. + * + * @param string $incomingPhoneNumberSid A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. + * @return $this Fluent Builder + */ + public function setIncomingPhoneNumberSid(string $incomingPhoneNumberSid): self + { + $this->options['incomingPhoneNumberSid'] = $incomingPhoneNumberSid; + return $this; + } + + /** + * A human readable description of this resource, up to 64 characters. + * + * @param string $friendlyName A human readable description of this resource, up to 64 characters. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. + * + * @param string $uniqueName Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.HostedNumbers.ReadDependentHostedNumberOrderOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderPage.php b/app/api/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderPage.php new file mode 100755 index 0000000..fa42291 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocument/DependentHostedNumberOrderPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DependentHostedNumberOrderInstance \Twilio\Rest\Preview\HostedNumbers\AuthorizationDocument\DependentHostedNumberOrderInstance + */ + public function buildInstance(array $payload): DependentHostedNumberOrderInstance + { + return new DependentHostedNumberOrderInstance($this->version, $payload, $this->solution['signingDocumentSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.HostedNumbers.DependentHostedNumberOrderPage]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentContext.php b/app/api/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentContext.php new file mode 100755 index 0000000..87a6754 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentContext.php @@ -0,0 +1,180 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/AuthorizationDocuments/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the AuthorizationDocumentInstance + * + * @return AuthorizationDocumentInstance Fetched AuthorizationDocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AuthorizationDocumentInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new AuthorizationDocumentInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the AuthorizationDocumentInstance + * + * @param array|Options $options Optional Arguments + * @return AuthorizationDocumentInstance Updated AuthorizationDocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): AuthorizationDocumentInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'HostedNumberOrderSids' => + Serialize::map($options['hostedNumberOrderSids'], function ($e) { return $e; }), + 'AddressSid' => + $options['addressSid'], + 'Email' => + $options['email'], + 'CcEmails' => + Serialize::map($options['ccEmails'], function ($e) { return $e; }), + 'Status' => + $options['status'], + 'ContactTitle' => + $options['contactTitle'], + 'ContactPhoneNumber' => + $options['contactPhoneNumber'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new AuthorizationDocumentInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the dependentHostedNumberOrders + */ + protected function getDependentHostedNumberOrders(): DependentHostedNumberOrderList + { + if (!$this->_dependentHostedNumberOrders) { + $this->_dependentHostedNumberOrders = new DependentHostedNumberOrderList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_dependentHostedNumberOrders; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.HostedNumbers.AuthorizationDocumentContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentInstance.php b/app/api/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentInstance.php new file mode 100755 index 0000000..85dbe4e --- /dev/null +++ b/app/api/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentInstance.php @@ -0,0 +1,157 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'addressSid' => Values::array_get($payload, 'address_sid'), + 'status' => Values::array_get($payload, 'status'), + 'email' => Values::array_get($payload, 'email'), + 'ccEmails' => Values::array_get($payload, 'cc_emails'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AuthorizationDocumentContext Context for this AuthorizationDocumentInstance + */ + protected function proxy(): AuthorizationDocumentContext + { + if (!$this->context) { + $this->context = new AuthorizationDocumentContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the AuthorizationDocumentInstance + * + * @return AuthorizationDocumentInstance Fetched AuthorizationDocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AuthorizationDocumentInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the AuthorizationDocumentInstance + * + * @param array|Options $options Optional Arguments + * @return AuthorizationDocumentInstance Updated AuthorizationDocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): AuthorizationDocumentInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the dependentHostedNumberOrders + */ + protected function getDependentHostedNumberOrders(): DependentHostedNumberOrderList + { + return $this->proxy()->dependentHostedNumberOrders; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.HostedNumbers.AuthorizationDocumentInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentList.php b/app/api/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentList.php new file mode 100755 index 0000000..74ca1f7 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentList.php @@ -0,0 +1,213 @@ +solution = [ + ]; + + $this->uri = '/AuthorizationDocuments'; + } + + /** + * Create the AuthorizationDocumentInstance + * + * @param string[] $hostedNumberOrderSids A list of HostedNumberOrder sids that this AuthorizationDocument will authorize for hosting phone number capabilities on Twilio's platform. + * @param string $addressSid A 34 character string that uniquely identifies the Address resource that is associated with this AuthorizationDocument. + * @param string $email Email that this AuthorizationDocument will be sent to for signing. + * @param string $contactTitle The title of the person authorized to sign the Authorization Document for this phone number. + * @param string $contactPhoneNumber The contact phone number of the person authorized to sign the Authorization Document. + * @param array|Options $options Optional Arguments + * @return AuthorizationDocumentInstance Created AuthorizationDocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $hostedNumberOrderSids, string $addressSid, string $email, string $contactTitle, string $contactPhoneNumber, array $options = []): AuthorizationDocumentInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'HostedNumberOrderSids' => + Serialize::map($hostedNumberOrderSids,function ($e) { return $e; }), + 'AddressSid' => + $addressSid, + 'Email' => + $email, + 'ContactTitle' => + $contactTitle, + 'ContactPhoneNumber' => + $contactPhoneNumber, + 'CcEmails' => + Serialize::map($options['ccEmails'], function ($e) { return $e; }), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new AuthorizationDocumentInstance( + $this->version, + $payload + ); + } + + + /** + * Reads AuthorizationDocumentInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return AuthorizationDocumentInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams AuthorizationDocumentInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AuthorizationDocumentInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return AuthorizationDocumentPage Page of AuthorizationDocumentInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AuthorizationDocumentPage + { + $options = new Values($options); + + $params = Values::of([ + 'Email' => + $options['email'], + 'Status' => + $options['status'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new AuthorizationDocumentPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of AuthorizationDocumentInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return AuthorizationDocumentPage Page of AuthorizationDocumentInstance + */ + public function getPage(string $targetUrl): AuthorizationDocumentPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AuthorizationDocumentPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AuthorizationDocumentContext + * + * @param string $sid A 34 character string that uniquely identifies this AuthorizationDocument. + */ + public function getContext( + string $sid + + ): AuthorizationDocumentContext + { + return new AuthorizationDocumentContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.HostedNumbers.AuthorizationDocumentList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentOptions.php b/app/api/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentOptions.php new file mode 100755 index 0000000..f0c7e93 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentOptions.php @@ -0,0 +1,306 @@ +options['ccEmails'] = $ccEmails; + } + + /** + * Email recipients who will be informed when an Authorization Document has been sent and signed. + * + * @param string[] $ccEmails Email recipients who will be informed when an Authorization Document has been sent and signed. + * @return $this Fluent Builder + */ + public function setCcEmails(array $ccEmails): self + { + $this->options['ccEmails'] = $ccEmails; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.HostedNumbers.CreateAuthorizationDocumentOptions ' . $options . ']'; + } +} + + +class ReadAuthorizationDocumentOptions extends Options + { + /** + * @param string $email Email that this AuthorizationDocument will be sent to for signing. + * @param string $status Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/api/phone-numbers/hosted-number-authorization-documents#status-values) for more information on each of these statuses. + */ + public function __construct( + + string $email = Values::NONE, + string $status = Values::NONE + + ) { + $this->options['email'] = $email; + $this->options['status'] = $status; + } + + /** + * Email that this AuthorizationDocument will be sent to for signing. + * + * @param string $email Email that this AuthorizationDocument will be sent to for signing. + * @return $this Fluent Builder + */ + public function setEmail(string $email): self + { + $this->options['email'] = $email; + return $this; + } + + /** + * Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/api/phone-numbers/hosted-number-authorization-documents#status-values) for more information on each of these statuses. + * + * @param string $status Status of an instance resource. It can hold one of the values: 1. opened 2. signing, 3. signed LOA, 4. canceled, 5. failed. See the section entitled [Status Values](https://www.twilio.com/docs/api/phone-numbers/hosted-number-authorization-documents#status-values) for more information on each of these statuses. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.HostedNumbers.ReadAuthorizationDocumentOptions ' . $options . ']'; + } +} + +class UpdateAuthorizationDocumentOptions extends Options + { + /** + * @param string[] $hostedNumberOrderSids A list of HostedNumberOrder sids that this AuthorizationDocument will authorize for hosting phone number capabilities on Twilio's platform. + * @param string $addressSid A 34 character string that uniquely identifies the Address resource that is associated with this AuthorizationDocument. + * @param string $email Email that this AuthorizationDocument will be sent to for signing. + * @param string[] $ccEmails Email recipients who will be informed when an Authorization Document has been sent and signed + * @param string $status + * @param string $contactTitle The title of the person authorized to sign the Authorization Document for this phone number. + * @param string $contactPhoneNumber The contact phone number of the person authorized to sign the Authorization Document. + */ + public function __construct( + + array $hostedNumberOrderSids = Values::ARRAY_NONE, + string $addressSid = Values::NONE, + string $email = Values::NONE, + array $ccEmails = Values::ARRAY_NONE, + string $status = Values::NONE, + string $contactTitle = Values::NONE, + string $contactPhoneNumber = Values::NONE + + ) { + $this->options['hostedNumberOrderSids'] = $hostedNumberOrderSids; + $this->options['addressSid'] = $addressSid; + $this->options['email'] = $email; + $this->options['ccEmails'] = $ccEmails; + $this->options['status'] = $status; + $this->options['contactTitle'] = $contactTitle; + $this->options['contactPhoneNumber'] = $contactPhoneNumber; + } + + /** + * A list of HostedNumberOrder sids that this AuthorizationDocument will authorize for hosting phone number capabilities on Twilio's platform. + * + * @param string[] $hostedNumberOrderSids A list of HostedNumberOrder sids that this AuthorizationDocument will authorize for hosting phone number capabilities on Twilio's platform. + * @return $this Fluent Builder + */ + public function setHostedNumberOrderSids(array $hostedNumberOrderSids): self + { + $this->options['hostedNumberOrderSids'] = $hostedNumberOrderSids; + return $this; + } + + /** + * A 34 character string that uniquely identifies the Address resource that is associated with this AuthorizationDocument. + * + * @param string $addressSid A 34 character string that uniquely identifies the Address resource that is associated with this AuthorizationDocument. + * @return $this Fluent Builder + */ + public function setAddressSid(string $addressSid): self + { + $this->options['addressSid'] = $addressSid; + return $this; + } + + /** + * Email that this AuthorizationDocument will be sent to for signing. + * + * @param string $email Email that this AuthorizationDocument will be sent to for signing. + * @return $this Fluent Builder + */ + public function setEmail(string $email): self + { + $this->options['email'] = $email; + return $this; + } + + /** + * Email recipients who will be informed when an Authorization Document has been sent and signed + * + * @param string[] $ccEmails Email recipients who will be informed when an Authorization Document has been sent and signed + * @return $this Fluent Builder + */ + public function setCcEmails(array $ccEmails): self + { + $this->options['ccEmails'] = $ccEmails; + return $this; + } + + /** + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * The title of the person authorized to sign the Authorization Document for this phone number. + * + * @param string $contactTitle The title of the person authorized to sign the Authorization Document for this phone number. + * @return $this Fluent Builder + */ + public function setContactTitle(string $contactTitle): self + { + $this->options['contactTitle'] = $contactTitle; + return $this; + } + + /** + * The contact phone number of the person authorized to sign the Authorization Document. + * + * @param string $contactPhoneNumber The contact phone number of the person authorized to sign the Authorization Document. + * @return $this Fluent Builder + */ + public function setContactPhoneNumber(string $contactPhoneNumber): self + { + $this->options['contactPhoneNumber'] = $contactPhoneNumber; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.HostedNumbers.UpdateAuthorizationDocumentOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentPage.php b/app/api/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentPage.php new file mode 100755 index 0000000..39a5af8 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/HostedNumbers/AuthorizationDocumentPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AuthorizationDocumentInstance \Twilio\Rest\Preview\HostedNumbers\AuthorizationDocumentInstance + */ + public function buildInstance(array $payload): AuthorizationDocumentInstance + { + return new AuthorizationDocumentInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.HostedNumbers.AuthorizationDocumentPage]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderContext.php b/app/api/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderContext.php new file mode 100755 index 0000000..752b309 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderContext.php @@ -0,0 +1,142 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/HostedNumberOrders/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the HostedNumberOrderInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the HostedNumberOrderInstance + * + * @return HostedNumberOrderInstance Fetched HostedNumberOrderInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): HostedNumberOrderInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new HostedNumberOrderInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the HostedNumberOrderInstance + * + * @param array|Options $options Optional Arguments + * @return HostedNumberOrderInstance Updated HostedNumberOrderInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): HostedNumberOrderInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'UniqueName' => + $options['uniqueName'], + 'Email' => + $options['email'], + 'CcEmails' => + Serialize::map($options['ccEmails'], function ($e) { return $e; }), + 'Status' => + $options['status'], + 'VerificationCode' => + $options['verificationCode'], + 'VerificationType' => + $options['verificationType'], + 'VerificationDocumentSid' => + $options['verificationDocumentSid'], + 'Extension' => + $options['extension'], + 'CallDelay' => + $options['callDelay'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new HostedNumberOrderInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.HostedNumbers.HostedNumberOrderContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderInstance.php b/app/api/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderInstance.php new file mode 100755 index 0000000..489e068 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderInstance.php @@ -0,0 +1,187 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'incomingPhoneNumberSid' => Values::array_get($payload, 'incoming_phone_number_sid'), + 'addressSid' => Values::array_get($payload, 'address_sid'), + 'signingDocumentSid' => Values::array_get($payload, 'signing_document_sid'), + 'phoneNumber' => Values::array_get($payload, 'phone_number'), + 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'status' => Values::array_get($payload, 'status'), + 'failureReason' => Values::array_get($payload, 'failure_reason'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'verificationAttempts' => Values::array_get($payload, 'verification_attempts'), + 'email' => Values::array_get($payload, 'email'), + 'ccEmails' => Values::array_get($payload, 'cc_emails'), + 'url' => Values::array_get($payload, 'url'), + 'verificationType' => Values::array_get($payload, 'verification_type'), + 'verificationDocumentSid' => Values::array_get($payload, 'verification_document_sid'), + 'extension' => Values::array_get($payload, 'extension'), + 'callDelay' => Values::array_get($payload, 'call_delay'), + 'verificationCode' => Values::array_get($payload, 'verification_code'), + 'verificationCallSids' => Values::array_get($payload, 'verification_call_sids'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return HostedNumberOrderContext Context for this HostedNumberOrderInstance + */ + protected function proxy(): HostedNumberOrderContext + { + if (!$this->context) { + $this->context = new HostedNumberOrderContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the HostedNumberOrderInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the HostedNumberOrderInstance + * + * @return HostedNumberOrderInstance Fetched HostedNumberOrderInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): HostedNumberOrderInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the HostedNumberOrderInstance + * + * @param array|Options $options Optional Arguments + * @return HostedNumberOrderInstance Updated HostedNumberOrderInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): HostedNumberOrderInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.HostedNumbers.HostedNumberOrderInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderList.php b/app/api/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderList.php new file mode 100755 index 0000000..bd68626 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderList.php @@ -0,0 +1,238 @@ +solution = [ + ]; + + $this->uri = '/HostedNumberOrders'; + } + + /** + * Create the HostedNumberOrderInstance + * + * @param string $phoneNumber The number to host in [+E.164](https://en.wikipedia.org/wiki/E.164) format + * @param bool $smsCapability Used to specify that the SMS capability will be hosted on Twilio's platform. + * @param array|Options $options Optional Arguments + * @return HostedNumberOrderInstance Created HostedNumberOrderInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $phoneNumber, bool $smsCapability, array $options = []): HostedNumberOrderInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'PhoneNumber' => + $phoneNumber, + 'SmsCapability' => + Serialize::booleanToString($smsCapability), + 'AccountSid' => + $options['accountSid'], + 'FriendlyName' => + $options['friendlyName'], + 'UniqueName' => + $options['uniqueName'], + 'CcEmails' => + Serialize::map($options['ccEmails'], function ($e) { return $e; }), + 'SmsUrl' => + $options['smsUrl'], + 'SmsMethod' => + $options['smsMethod'], + 'SmsFallbackUrl' => + $options['smsFallbackUrl'], + 'SmsFallbackMethod' => + $options['smsFallbackMethod'], + 'StatusCallbackUrl' => + $options['statusCallbackUrl'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'SmsApplicationSid' => + $options['smsApplicationSid'], + 'AddressSid' => + $options['addressSid'], + 'Email' => + $options['email'], + 'VerificationType' => + $options['verificationType'], + 'VerificationDocumentSid' => + $options['verificationDocumentSid'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new HostedNumberOrderInstance( + $this->version, + $payload + ); + } + + + /** + * Reads HostedNumberOrderInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return HostedNumberOrderInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams HostedNumberOrderInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of HostedNumberOrderInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return HostedNumberOrderPage Page of HostedNumberOrderInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): HostedNumberOrderPage + { + $options = new Values($options); + + $params = Values::of([ + 'Status' => + $options['status'], + 'PhoneNumber' => + $options['phoneNumber'], + 'IncomingPhoneNumberSid' => + $options['incomingPhoneNumberSid'], + 'FriendlyName' => + $options['friendlyName'], + 'UniqueName' => + $options['uniqueName'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new HostedNumberOrderPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of HostedNumberOrderInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return HostedNumberOrderPage Page of HostedNumberOrderInstance + */ + public function getPage(string $targetUrl): HostedNumberOrderPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new HostedNumberOrderPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a HostedNumberOrderContext + * + * @param string $sid A 34 character string that uniquely identifies this HostedNumberOrder. + */ + public function getContext( + string $sid + + ): HostedNumberOrderContext + { + return new HostedNumberOrderContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.HostedNumbers.HostedNumberOrderList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderOptions.php b/app/api/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderOptions.php new file mode 100755 index 0000000..e2113f6 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderOptions.php @@ -0,0 +1,664 @@ +options['accountSid'] = $accountSid; + $this->options['friendlyName'] = $friendlyName; + $this->options['uniqueName'] = $uniqueName; + $this->options['ccEmails'] = $ccEmails; + $this->options['smsUrl'] = $smsUrl; + $this->options['smsMethod'] = $smsMethod; + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + $this->options['statusCallbackUrl'] = $statusCallbackUrl; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['smsApplicationSid'] = $smsApplicationSid; + $this->options['addressSid'] = $addressSid; + $this->options['email'] = $email; + $this->options['verificationType'] = $verificationType; + $this->options['verificationDocumentSid'] = $verificationDocumentSid; + } + + /** + * This defaults to the AccountSid of the authorization the user is using. This can be provided to specify a subaccount to add the HostedNumberOrder to. + * + * @param string $accountSid This defaults to the AccountSid of the authorization the user is using. This can be provided to specify a subaccount to add the HostedNumberOrder to. + * @return $this Fluent Builder + */ + public function setAccountSid(string $accountSid): self + { + $this->options['accountSid'] = $accountSid; + return $this; + } + + /** + * A 64 character string that is a human readable text that describes this resource. + * + * @param string $friendlyName A 64 character string that is a human readable text that describes this resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Optional. Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. + * + * @param string $uniqueName Optional. Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * Optional. A list of emails that the LOA document for this HostedNumberOrder will be carbon copied to. + * + * @param string[] $ccEmails Optional. A list of emails that the LOA document for this HostedNumberOrder will be carbon copied to. + * @return $this Fluent Builder + */ + public function setCcEmails(array $ccEmails): self + { + $this->options['ccEmails'] = $ccEmails; + return $this; + } + + /** + * The URL that Twilio should request when somebody sends an SMS to the phone number. This will be copied onto the IncomingPhoneNumber resource. + * + * @param string $smsUrl The URL that Twilio should request when somebody sends an SMS to the phone number. This will be copied onto the IncomingPhoneNumber resource. + * @return $this Fluent Builder + */ + public function setSmsUrl(string $smsUrl): self + { + $this->options['smsUrl'] = $smsUrl; + return $this; + } + + /** + * The HTTP method that should be used to request the SmsUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. + * + * @param string $smsMethod The HTTP method that should be used to request the SmsUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. + * @return $this Fluent Builder + */ + public function setSmsMethod(string $smsMethod): self + { + $this->options['smsMethod'] = $smsMethod; + return $this; + } + + /** + * A URL that Twilio will request if an error occurs requesting or executing the TwiML defined by SmsUrl. This will be copied onto the IncomingPhoneNumber resource. + * + * @param string $smsFallbackUrl A URL that Twilio will request if an error occurs requesting or executing the TwiML defined by SmsUrl. This will be copied onto the IncomingPhoneNumber resource. + * @return $this Fluent Builder + */ + public function setSmsFallbackUrl(string $smsFallbackUrl): self + { + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + return $this; + } + + /** + * The HTTP method that should be used to request the SmsFallbackUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. + * + * @param string $smsFallbackMethod The HTTP method that should be used to request the SmsFallbackUrl. Must be either `GET` or `POST`. This will be copied onto the IncomingPhoneNumber resource. + * @return $this Fluent Builder + */ + public function setSmsFallbackMethod(string $smsFallbackMethod): self + { + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + return $this; + } + + /** + * Optional. The Status Callback URL attached to the IncomingPhoneNumber resource. + * + * @param string $statusCallbackUrl Optional. The Status Callback URL attached to the IncomingPhoneNumber resource. + * @return $this Fluent Builder + */ + public function setStatusCallbackUrl(string $statusCallbackUrl): self + { + $this->options['statusCallbackUrl'] = $statusCallbackUrl; + return $this; + } + + /** + * Optional. The Status Callback Method attached to the IncomingPhoneNumber resource. + * + * @param string $statusCallbackMethod Optional. The Status Callback Method attached to the IncomingPhoneNumber resource. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * Optional. The 34 character sid of the application Twilio should use to handle SMS messages sent to this number. If a `SmsApplicationSid` is present, Twilio will ignore all of the SMS urls above and use those set on the application. + * + * @param string $smsApplicationSid Optional. The 34 character sid of the application Twilio should use to handle SMS messages sent to this number. If a `SmsApplicationSid` is present, Twilio will ignore all of the SMS urls above and use those set on the application. + * @return $this Fluent Builder + */ + public function setSmsApplicationSid(string $smsApplicationSid): self + { + $this->options['smsApplicationSid'] = $smsApplicationSid; + return $this; + } + + /** + * Optional. A 34 character string that uniquely identifies the Address resource that represents the address of the owner of this phone number. + * + * @param string $addressSid Optional. A 34 character string that uniquely identifies the Address resource that represents the address of the owner of this phone number. + * @return $this Fluent Builder + */ + public function setAddressSid(string $addressSid): self + { + $this->options['addressSid'] = $addressSid; + return $this; + } + + /** + * Optional. Email of the owner of this phone number that is being hosted. + * + * @param string $email Optional. Email of the owner of this phone number that is being hosted. + * @return $this Fluent Builder + */ + public function setEmail(string $email): self + { + $this->options['email'] = $email; + return $this; + } + + /** + * @param string $verificationType + * @return $this Fluent Builder + */ + public function setVerificationType(string $verificationType): self + { + $this->options['verificationType'] = $verificationType; + return $this; + } + + /** + * Optional. The unique sid identifier of the Identity Document that represents the document for verifying ownership of the number to be hosted. Required when VerificationType is phone-bill. + * + * @param string $verificationDocumentSid Optional. The unique sid identifier of the Identity Document that represents the document for verifying ownership of the number to be hosted. Required when VerificationType is phone-bill. + * @return $this Fluent Builder + */ + public function setVerificationDocumentSid(string $verificationDocumentSid): self + { + $this->options['verificationDocumentSid'] = $verificationDocumentSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.HostedNumbers.CreateHostedNumberOrderOptions ' . $options . ']'; + } +} + + + +class ReadHostedNumberOrderOptions extends Options + { + /** + * @param string $status The Status of this HostedNumberOrder. One of `received`, `pending-verification`, `verified`, `pending-loa`, `carrier-processing`, `testing`, `completed`, `failed`, or `action-required`. + * @param string $phoneNumber An E164 formatted phone number hosted by this HostedNumberOrder. + * @param string $incomingPhoneNumberSid A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. + * @param string $friendlyName A human readable description of this resource, up to 64 characters. + * @param string $uniqueName Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. + */ + public function __construct( + + string $status = Values::NONE, + string $phoneNumber = Values::NONE, + string $incomingPhoneNumberSid = Values::NONE, + string $friendlyName = Values::NONE, + string $uniqueName = Values::NONE + + ) { + $this->options['status'] = $status; + $this->options['phoneNumber'] = $phoneNumber; + $this->options['incomingPhoneNumberSid'] = $incomingPhoneNumberSid; + $this->options['friendlyName'] = $friendlyName; + $this->options['uniqueName'] = $uniqueName; + } + + /** + * The Status of this HostedNumberOrder. One of `received`, `pending-verification`, `verified`, `pending-loa`, `carrier-processing`, `testing`, `completed`, `failed`, or `action-required`. + * + * @param string $status The Status of this HostedNumberOrder. One of `received`, `pending-verification`, `verified`, `pending-loa`, `carrier-processing`, `testing`, `completed`, `failed`, or `action-required`. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * An E164 formatted phone number hosted by this HostedNumberOrder. + * + * @param string $phoneNumber An E164 formatted phone number hosted by this HostedNumberOrder. + * @return $this Fluent Builder + */ + public function setPhoneNumber(string $phoneNumber): self + { + $this->options['phoneNumber'] = $phoneNumber; + return $this; + } + + /** + * A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. + * + * @param string $incomingPhoneNumberSid A 34 character string that uniquely identifies the IncomingPhoneNumber resource created by this HostedNumberOrder. + * @return $this Fluent Builder + */ + public function setIncomingPhoneNumberSid(string $incomingPhoneNumberSid): self + { + $this->options['incomingPhoneNumberSid'] = $incomingPhoneNumberSid; + return $this; + } + + /** + * A human readable description of this resource, up to 64 characters. + * + * @param string $friendlyName A human readable description of this resource, up to 64 characters. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. + * + * @param string $uniqueName Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.HostedNumbers.ReadHostedNumberOrderOptions ' . $options . ']'; + } +} + +class UpdateHostedNumberOrderOptions extends Options + { + /** + * @param string $friendlyName A 64 character string that is a human readable text that describes this resource. + * @param string $uniqueName Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. + * @param string $email Email of the owner of this phone number that is being hosted. + * @param string[] $ccEmails Optional. A list of emails that LOA document for this HostedNumberOrder will be carbon copied to. + * @param string $status + * @param string $verificationCode A verification code that is given to the user via a phone call to the phone number that is being hosted. + * @param string $verificationType + * @param string $verificationDocumentSid Optional. The unique sid identifier of the Identity Document that represents the document for verifying ownership of the number to be hosted. Required when VerificationType is phone-bill. + * @param string $extension Digits to dial after connecting the verification call. + * @param int $callDelay The number of seconds, between 0 and 60, to delay before initiating the verification call. Defaults to 0. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $uniqueName = Values::NONE, + string $email = Values::NONE, + array $ccEmails = Values::ARRAY_NONE, + string $status = Values::NONE, + string $verificationCode = Values::NONE, + string $verificationType = Values::NONE, + string $verificationDocumentSid = Values::NONE, + string $extension = Values::NONE, + int $callDelay = Values::INT_NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['uniqueName'] = $uniqueName; + $this->options['email'] = $email; + $this->options['ccEmails'] = $ccEmails; + $this->options['status'] = $status; + $this->options['verificationCode'] = $verificationCode; + $this->options['verificationType'] = $verificationType; + $this->options['verificationDocumentSid'] = $verificationDocumentSid; + $this->options['extension'] = $extension; + $this->options['callDelay'] = $callDelay; + } + + /** + * A 64 character string that is a human readable text that describes this resource. + * + * @param string $friendlyName A 64 character string that is a human readable text that describes this resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. + * + * @param string $uniqueName Provides a unique and addressable name to be assigned to this HostedNumberOrder, assigned by the developer, to be optionally used in addition to SID. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * Email of the owner of this phone number that is being hosted. + * + * @param string $email Email of the owner of this phone number that is being hosted. + * @return $this Fluent Builder + */ + public function setEmail(string $email): self + { + $this->options['email'] = $email; + return $this; + } + + /** + * Optional. A list of emails that LOA document for this HostedNumberOrder will be carbon copied to. + * + * @param string[] $ccEmails Optional. A list of emails that LOA document for this HostedNumberOrder will be carbon copied to. + * @return $this Fluent Builder + */ + public function setCcEmails(array $ccEmails): self + { + $this->options['ccEmails'] = $ccEmails; + return $this; + } + + /** + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * A verification code that is given to the user via a phone call to the phone number that is being hosted. + * + * @param string $verificationCode A verification code that is given to the user via a phone call to the phone number that is being hosted. + * @return $this Fluent Builder + */ + public function setVerificationCode(string $verificationCode): self + { + $this->options['verificationCode'] = $verificationCode; + return $this; + } + + /** + * @param string $verificationType + * @return $this Fluent Builder + */ + public function setVerificationType(string $verificationType): self + { + $this->options['verificationType'] = $verificationType; + return $this; + } + + /** + * Optional. The unique sid identifier of the Identity Document that represents the document for verifying ownership of the number to be hosted. Required when VerificationType is phone-bill. + * + * @param string $verificationDocumentSid Optional. The unique sid identifier of the Identity Document that represents the document for verifying ownership of the number to be hosted. Required when VerificationType is phone-bill. + * @return $this Fluent Builder + */ + public function setVerificationDocumentSid(string $verificationDocumentSid): self + { + $this->options['verificationDocumentSid'] = $verificationDocumentSid; + return $this; + } + + /** + * Digits to dial after connecting the verification call. + * + * @param string $extension Digits to dial after connecting the verification call. + * @return $this Fluent Builder + */ + public function setExtension(string $extension): self + { + $this->options['extension'] = $extension; + return $this; + } + + /** + * The number of seconds, between 0 and 60, to delay before initiating the verification call. Defaults to 0. + * + * @param int $callDelay The number of seconds, between 0 and 60, to delay before initiating the verification call. Defaults to 0. + * @return $this Fluent Builder + */ + public function setCallDelay(int $callDelay): self + { + $this->options['callDelay'] = $callDelay; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.HostedNumbers.UpdateHostedNumberOrderOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderPage.php b/app/api/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderPage.php new file mode 100755 index 0000000..0a7bd87 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/HostedNumbers/HostedNumberOrderPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return HostedNumberOrderInstance \Twilio\Rest\Preview\HostedNumbers\HostedNumberOrderInstance + */ + public function buildInstance(array $payload): HostedNumberOrderInstance + { + return new HostedNumberOrderInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.HostedNumbers.HostedNumberOrderPage]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Marketplace.php b/app/api/Twilio/Rest/Preview/Marketplace.php new file mode 100755 index 0000000..e4e9689 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Marketplace.php @@ -0,0 +1,107 @@ +version = 'marketplace'; + } + + protected function getAvailableAddOns(): AvailableAddOnList + { + if (!$this->_availableAddOns) { + $this->_availableAddOns = new AvailableAddOnList($this); + } + return $this->_availableAddOns; + } + + protected function getInstalledAddOns(): InstalledAddOnList + { + if (!$this->_installedAddOns) { + $this->_installedAddOns = new InstalledAddOnList($this); + } + return $this->_installedAddOns; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Marketplace]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionContext.php b/app/api/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionContext.php new file mode 100755 index 0000000..035d39c --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionContext.php @@ -0,0 +1,87 @@ +solution = [ + 'availableAddOnSid' => + $availableAddOnSid, + 'sid' => + $sid, + ]; + + $this->uri = '/AvailableAddOns/' . \rawurlencode($availableAddOnSid) + .'/Extensions/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the AvailableAddOnExtensionInstance + * + * @return AvailableAddOnExtensionInstance Fetched AvailableAddOnExtensionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AvailableAddOnExtensionInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new AvailableAddOnExtensionInstance( + $this->version, + $payload, + $this->solution['availableAddOnSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Marketplace.AvailableAddOnExtensionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionInstance.php b/app/api/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionInstance.php new file mode 100755 index 0000000..568b24c --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionInstance.php @@ -0,0 +1,127 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'availableAddOnSid' => Values::array_get($payload, 'available_add_on_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'productName' => Values::array_get($payload, 'product_name'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['availableAddOnSid' => $availableAddOnSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AvailableAddOnExtensionContext Context for this AvailableAddOnExtensionInstance + */ + protected function proxy(): AvailableAddOnExtensionContext + { + if (!$this->context) { + $this->context = new AvailableAddOnExtensionContext( + $this->version, + $this->solution['availableAddOnSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the AvailableAddOnExtensionInstance + * + * @return AvailableAddOnExtensionInstance Fetched AvailableAddOnExtensionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AvailableAddOnExtensionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Marketplace.AvailableAddOnExtensionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionList.php b/app/api/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionList.php new file mode 100755 index 0000000..3199859 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionList.php @@ -0,0 +1,168 @@ +solution = [ + 'availableAddOnSid' => + $availableAddOnSid, + + ]; + + $this->uri = '/AvailableAddOns/' . \rawurlencode($availableAddOnSid) + .'/Extensions'; + } + + /** + * Reads AvailableAddOnExtensionInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return AvailableAddOnExtensionInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams AvailableAddOnExtensionInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AvailableAddOnExtensionInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return AvailableAddOnExtensionPage Page of AvailableAddOnExtensionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AvailableAddOnExtensionPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new AvailableAddOnExtensionPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of AvailableAddOnExtensionInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return AvailableAddOnExtensionPage Page of AvailableAddOnExtensionInstance + */ + public function getPage(string $targetUrl): AvailableAddOnExtensionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AvailableAddOnExtensionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AvailableAddOnExtensionContext + * + * @param string $sid The SID of the AvailableAddOn Extension resource to fetch. + */ + public function getContext( + string $sid + + ): AvailableAddOnExtensionContext + { + return new AvailableAddOnExtensionContext( + $this->version, + $this->solution['availableAddOnSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Marketplace.AvailableAddOnExtensionList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionPage.php b/app/api/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionPage.php new file mode 100755 index 0000000..6637620 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Marketplace/AvailableAddOn/AvailableAddOnExtensionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AvailableAddOnExtensionInstance \Twilio\Rest\Preview\Marketplace\AvailableAddOn\AvailableAddOnExtensionInstance + */ + public function buildInstance(array $payload): AvailableAddOnExtensionInstance + { + return new AvailableAddOnExtensionInstance($this->version, $payload, $this->solution['availableAddOnSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Marketplace.AvailableAddOnExtensionPage]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Marketplace/AvailableAddOnContext.php b/app/api/Twilio/Rest/Preview/Marketplace/AvailableAddOnContext.php new file mode 100755 index 0000000..3d010a5 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Marketplace/AvailableAddOnContext.php @@ -0,0 +1,139 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/AvailableAddOns/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the AvailableAddOnInstance + * + * @return AvailableAddOnInstance Fetched AvailableAddOnInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AvailableAddOnInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new AvailableAddOnInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the extensions + */ + protected function getExtensions(): AvailableAddOnExtensionList + { + if (!$this->_extensions) { + $this->_extensions = new AvailableAddOnExtensionList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_extensions; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Marketplace.AvailableAddOnContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Marketplace/AvailableAddOnInstance.php b/app/api/Twilio/Rest/Preview/Marketplace/AvailableAddOnInstance.php new file mode 100755 index 0000000..4bc33ef --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Marketplace/AvailableAddOnInstance.php @@ -0,0 +1,138 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'description' => Values::array_get($payload, 'description'), + 'pricingType' => Values::array_get($payload, 'pricing_type'), + 'configurationSchema' => Values::array_get($payload, 'configuration_schema'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AvailableAddOnContext Context for this AvailableAddOnInstance + */ + protected function proxy(): AvailableAddOnContext + { + if (!$this->context) { + $this->context = new AvailableAddOnContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the AvailableAddOnInstance + * + * @return AvailableAddOnInstance Fetched AvailableAddOnInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AvailableAddOnInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the extensions + */ + protected function getExtensions(): AvailableAddOnExtensionList + { + return $this->proxy()->extensions; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Marketplace.AvailableAddOnInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Marketplace/AvailableAddOnList.php b/app/api/Twilio/Rest/Preview/Marketplace/AvailableAddOnList.php new file mode 100755 index 0000000..703dd78 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Marketplace/AvailableAddOnList.php @@ -0,0 +1,161 @@ +solution = [ + ]; + + $this->uri = '/AvailableAddOns'; + } + + /** + * Reads AvailableAddOnInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return AvailableAddOnInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams AvailableAddOnInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AvailableAddOnInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return AvailableAddOnPage Page of AvailableAddOnInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AvailableAddOnPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new AvailableAddOnPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of AvailableAddOnInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return AvailableAddOnPage Page of AvailableAddOnInstance + */ + public function getPage(string $targetUrl): AvailableAddOnPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AvailableAddOnPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AvailableAddOnContext + * + * @param string $sid The SID of the AvailableAddOn resource to fetch. + */ + public function getContext( + string $sid + + ): AvailableAddOnContext + { + return new AvailableAddOnContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Marketplace.AvailableAddOnList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Marketplace/AvailableAddOnPage.php b/app/api/Twilio/Rest/Preview/Marketplace/AvailableAddOnPage.php new file mode 100755 index 0000000..9f41e71 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Marketplace/AvailableAddOnPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AvailableAddOnInstance \Twilio\Rest\Preview\Marketplace\AvailableAddOnInstance + */ + public function buildInstance(array $payload): AvailableAddOnInstance + { + return new AvailableAddOnInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Marketplace.AvailableAddOnPage]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionContext.php b/app/api/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionContext.php new file mode 100755 index 0000000..7c909cb --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionContext.php @@ -0,0 +1,115 @@ +solution = [ + 'installedAddOnSid' => + $installedAddOnSid, + 'sid' => + $sid, + ]; + + $this->uri = '/InstalledAddOns/' . \rawurlencode($installedAddOnSid) + .'/Extensions/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the InstalledAddOnExtensionInstance + * + * @return InstalledAddOnExtensionInstance Fetched InstalledAddOnExtensionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InstalledAddOnExtensionInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new InstalledAddOnExtensionInstance( + $this->version, + $payload, + $this->solution['installedAddOnSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the InstalledAddOnExtensionInstance + * + * @param bool $enabled Whether the Extension should be invoked. + * @return InstalledAddOnExtensionInstance Updated InstalledAddOnExtensionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $enabled): InstalledAddOnExtensionInstance + { + + $data = Values::of([ + 'Enabled' => + Serialize::booleanToString($enabled), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new InstalledAddOnExtensionInstance( + $this->version, + $payload, + $this->solution['installedAddOnSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Marketplace.InstalledAddOnExtensionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionInstance.php b/app/api/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionInstance.php new file mode 100755 index 0000000..143ee8f --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionInstance.php @@ -0,0 +1,142 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'installedAddOnSid' => Values::array_get($payload, 'installed_add_on_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'productName' => Values::array_get($payload, 'product_name'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'enabled' => Values::array_get($payload, 'enabled'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['installedAddOnSid' => $installedAddOnSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return InstalledAddOnExtensionContext Context for this InstalledAddOnExtensionInstance + */ + protected function proxy(): InstalledAddOnExtensionContext + { + if (!$this->context) { + $this->context = new InstalledAddOnExtensionContext( + $this->version, + $this->solution['installedAddOnSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the InstalledAddOnExtensionInstance + * + * @return InstalledAddOnExtensionInstance Fetched InstalledAddOnExtensionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InstalledAddOnExtensionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the InstalledAddOnExtensionInstance + * + * @param bool $enabled Whether the Extension should be invoked. + * @return InstalledAddOnExtensionInstance Updated InstalledAddOnExtensionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $enabled): InstalledAddOnExtensionInstance + { + + return $this->proxy()->update($enabled); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Marketplace.InstalledAddOnExtensionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionList.php b/app/api/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionList.php new file mode 100755 index 0000000..c705dbe --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionList.php @@ -0,0 +1,168 @@ +solution = [ + 'installedAddOnSid' => + $installedAddOnSid, + + ]; + + $this->uri = '/InstalledAddOns/' . \rawurlencode($installedAddOnSid) + .'/Extensions'; + } + + /** + * Reads InstalledAddOnExtensionInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return InstalledAddOnExtensionInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams InstalledAddOnExtensionInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of InstalledAddOnExtensionInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return InstalledAddOnExtensionPage Page of InstalledAddOnExtensionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): InstalledAddOnExtensionPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new InstalledAddOnExtensionPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of InstalledAddOnExtensionInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return InstalledAddOnExtensionPage Page of InstalledAddOnExtensionInstance + */ + public function getPage(string $targetUrl): InstalledAddOnExtensionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new InstalledAddOnExtensionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a InstalledAddOnExtensionContext + * + * @param string $sid The SID of the InstalledAddOn Extension resource to fetch. + */ + public function getContext( + string $sid + + ): InstalledAddOnExtensionContext + { + return new InstalledAddOnExtensionContext( + $this->version, + $this->solution['installedAddOnSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Marketplace.InstalledAddOnExtensionList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionPage.php b/app/api/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionPage.php new file mode 100755 index 0000000..c41f99d --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Marketplace/InstalledAddOn/InstalledAddOnExtensionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InstalledAddOnExtensionInstance \Twilio\Rest\Preview\Marketplace\InstalledAddOn\InstalledAddOnExtensionInstance + */ + public function buildInstance(array $payload): InstalledAddOnExtensionInstance + { + return new InstalledAddOnExtensionInstance($this->version, $payload, $this->solution['installedAddOnSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Marketplace.InstalledAddOnExtensionPage]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Marketplace/InstalledAddOnContext.php b/app/api/Twilio/Rest/Preview/Marketplace/InstalledAddOnContext.php new file mode 100755 index 0000000..6399a53 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Marketplace/InstalledAddOnContext.php @@ -0,0 +1,184 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/InstalledAddOns/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the InstalledAddOnInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the InstalledAddOnInstance + * + * @return InstalledAddOnInstance Fetched InstalledAddOnInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InstalledAddOnInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new InstalledAddOnInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the InstalledAddOnInstance + * + * @param array|Options $options Optional Arguments + * @return InstalledAddOnInstance Updated InstalledAddOnInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): InstalledAddOnInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Configuration' => + Serialize::jsonObject($options['configuration']), + 'UniqueName' => + $options['uniqueName'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new InstalledAddOnInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the extensions + */ + protected function getExtensions(): InstalledAddOnExtensionList + { + if (!$this->_extensions) { + $this->_extensions = new InstalledAddOnExtensionList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_extensions; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Marketplace.InstalledAddOnContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Marketplace/InstalledAddOnInstance.php b/app/api/Twilio/Rest/Preview/Marketplace/InstalledAddOnInstance.php new file mode 100755 index 0000000..2d225de --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Marketplace/InstalledAddOnInstance.php @@ -0,0 +1,171 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'description' => Values::array_get($payload, 'description'), + 'configuration' => Values::array_get($payload, 'configuration'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return InstalledAddOnContext Context for this InstalledAddOnInstance + */ + protected function proxy(): InstalledAddOnContext + { + if (!$this->context) { + $this->context = new InstalledAddOnContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the InstalledAddOnInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the InstalledAddOnInstance + * + * @return InstalledAddOnInstance Fetched InstalledAddOnInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InstalledAddOnInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the InstalledAddOnInstance + * + * @param array|Options $options Optional Arguments + * @return InstalledAddOnInstance Updated InstalledAddOnInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): InstalledAddOnInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the extensions + */ + protected function getExtensions(): InstalledAddOnExtensionList + { + return $this->proxy()->extensions; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Marketplace.InstalledAddOnInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Marketplace/InstalledAddOnList.php b/app/api/Twilio/Rest/Preview/Marketplace/InstalledAddOnList.php new file mode 100755 index 0000000..ef18cd1 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Marketplace/InstalledAddOnList.php @@ -0,0 +1,198 @@ +solution = [ + ]; + + $this->uri = '/InstalledAddOns'; + } + + /** + * Create the InstalledAddOnInstance + * + * @param string $availableAddOnSid The SID of the AvaliableAddOn to install. + * @param bool $acceptTermsOfService Whether the Terms of Service were accepted. + * @param array|Options $options Optional Arguments + * @return InstalledAddOnInstance Created InstalledAddOnInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $availableAddOnSid, bool $acceptTermsOfService, array $options = []): InstalledAddOnInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'AvailableAddOnSid' => + $availableAddOnSid, + 'AcceptTermsOfService' => + Serialize::booleanToString($acceptTermsOfService), + 'Configuration' => + Serialize::jsonObject($options['configuration']), + 'UniqueName' => + $options['uniqueName'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new InstalledAddOnInstance( + $this->version, + $payload + ); + } + + + /** + * Reads InstalledAddOnInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return InstalledAddOnInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams InstalledAddOnInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of InstalledAddOnInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return InstalledAddOnPage Page of InstalledAddOnInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): InstalledAddOnPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new InstalledAddOnPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of InstalledAddOnInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return InstalledAddOnPage Page of InstalledAddOnInstance + */ + public function getPage(string $targetUrl): InstalledAddOnPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new InstalledAddOnPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a InstalledAddOnContext + * + * @param string $sid The SID of the InstalledAddOn resource to delete. + */ + public function getContext( + string $sid + + ): InstalledAddOnContext + { + return new InstalledAddOnContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Marketplace.InstalledAddOnList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Marketplace/InstalledAddOnOptions.php b/app/api/Twilio/Rest/Preview/Marketplace/InstalledAddOnOptions.php new file mode 100755 index 0000000..018f23e --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Marketplace/InstalledAddOnOptions.php @@ -0,0 +1,170 @@ +options['configuration'] = $configuration; + $this->options['uniqueName'] = $uniqueName; + } + + /** + * The JSON object that represents the configuration of the new Add-on being installed. + * + * @param array $configuration The JSON object that represents the configuration of the new Add-on being installed. + * @return $this Fluent Builder + */ + public function setConfiguration(array $configuration): self + { + $this->options['configuration'] = $configuration; + return $this; + } + + /** + * An application-defined string that uniquely identifies the resource. This value must be unique within the Account. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be unique within the Account. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Marketplace.CreateInstalledAddOnOptions ' . $options . ']'; + } +} + + + + +class UpdateInstalledAddOnOptions extends Options + { + /** + * @param array $configuration Valid JSON object that conform to the configuration schema exposed by the associated AvailableAddOn resource. This is only required by Add-ons that need to be configured + * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be unique within the Account. + */ + public function __construct( + + array $configuration = Values::ARRAY_NONE, + string $uniqueName = Values::NONE + + ) { + $this->options['configuration'] = $configuration; + $this->options['uniqueName'] = $uniqueName; + } + + /** + * Valid JSON object that conform to the configuration schema exposed by the associated AvailableAddOn resource. This is only required by Add-ons that need to be configured + * + * @param array $configuration Valid JSON object that conform to the configuration schema exposed by the associated AvailableAddOn resource. This is only required by Add-ons that need to be configured + * @return $this Fluent Builder + */ + public function setConfiguration(array $configuration): self + { + $this->options['configuration'] = $configuration; + return $this; + } + + /** + * An application-defined string that uniquely identifies the resource. This value must be unique within the Account. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be unique within the Account. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Marketplace.UpdateInstalledAddOnOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Marketplace/InstalledAddOnPage.php b/app/api/Twilio/Rest/Preview/Marketplace/InstalledAddOnPage.php new file mode 100755 index 0000000..9b8cd39 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Marketplace/InstalledAddOnPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InstalledAddOnInstance \Twilio\Rest\Preview\Marketplace\InstalledAddOnInstance + */ + public function buildInstance(array $payload): InstalledAddOnInstance + { + return new InstalledAddOnInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Marketplace.InstalledAddOnPage]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Sync.php b/app/api/Twilio/Rest/Preview/Sync.php new file mode 100755 index 0000000..b2efcfe --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync.php @@ -0,0 +1,95 @@ +version = 'Sync'; + } + + protected function getServices(): ServiceList + { + if (!$this->_services) { + $this->_services = new ServiceList($this); + } + return $this->_services; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Sync]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionContext.php b/app/api/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionContext.php new file mode 100755 index 0000000..06848dc --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionContext.php @@ -0,0 +1,141 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'documentSid' => + $documentSid, + 'identity' => + $identity, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Documents/' . \rawurlencode($documentSid) + .'/Permissions/' . \rawurlencode($identity) + .''; + } + + /** + * Delete the DocumentPermissionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the DocumentPermissionInstance + * + * @return DocumentPermissionInstance Fetched DocumentPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DocumentPermissionInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new DocumentPermissionInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['documentSid'], + $this->solution['identity'] + ); + } + + + /** + * Update the DocumentPermissionInstance + * + * @param bool $read Boolean flag specifying whether the identity can read the Sync Document. + * @param bool $write Boolean flag specifying whether the identity can update the Sync Document. + * @param bool $manage Boolean flag specifying whether the identity can delete the Sync Document. + * @return DocumentPermissionInstance Updated DocumentPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $read, bool $write, bool $manage): DocumentPermissionInstance + { + + $data = Values::of([ + 'Read' => + Serialize::booleanToString($read), + 'Write' => + Serialize::booleanToString($write), + 'Manage' => + Serialize::booleanToString($manage), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new DocumentPermissionInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['documentSid'], + $this->solution['identity'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Sync.DocumentPermissionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionInstance.php b/app/api/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionInstance.php new file mode 100755 index 0000000..cc92dc6 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionInstance.php @@ -0,0 +1,160 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'documentSid' => Values::array_get($payload, 'document_sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'read' => Values::array_get($payload, 'read'), + 'write' => Values::array_get($payload, 'write'), + 'manage' => Values::array_get($payload, 'manage'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'documentSid' => $documentSid, 'identity' => $identity ?: $this->properties['identity'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return DocumentPermissionContext Context for this DocumentPermissionInstance + */ + protected function proxy(): DocumentPermissionContext + { + if (!$this->context) { + $this->context = new DocumentPermissionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['documentSid'], + $this->solution['identity'] + ); + } + + return $this->context; + } + + /** + * Delete the DocumentPermissionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the DocumentPermissionInstance + * + * @return DocumentPermissionInstance Fetched DocumentPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DocumentPermissionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the DocumentPermissionInstance + * + * @param bool $read Boolean flag specifying whether the identity can read the Sync Document. + * @param bool $write Boolean flag specifying whether the identity can update the Sync Document. + * @param bool $manage Boolean flag specifying whether the identity can delete the Sync Document. + * @return DocumentPermissionInstance Updated DocumentPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $read, bool $write, bool $manage): DocumentPermissionInstance + { + + return $this->proxy()->update($read, $write, $manage); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Sync.DocumentPermissionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionList.php b/app/api/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionList.php new file mode 100755 index 0000000..8bf0e92 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionList.php @@ -0,0 +1,175 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'documentSid' => + $documentSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Documents/' . \rawurlencode($documentSid) + .'/Permissions'; + } + + /** + * Reads DocumentPermissionInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return DocumentPermissionInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams DocumentPermissionInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of DocumentPermissionInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return DocumentPermissionPage Page of DocumentPermissionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): DocumentPermissionPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new DocumentPermissionPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of DocumentPermissionInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return DocumentPermissionPage Page of DocumentPermissionInstance + */ + public function getPage(string $targetUrl): DocumentPermissionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new DocumentPermissionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a DocumentPermissionContext + * + * @param string $identity Arbitrary string identifier representing a user associated with an FPA token, assigned by the developer. + */ + public function getContext( + string $identity + + ): DocumentPermissionContext + { + return new DocumentPermissionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['documentSid'], + $identity + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Sync.DocumentPermissionList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionPage.php b/app/api/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionPage.php new file mode 100755 index 0000000..6e1409f --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/Service/Document/DocumentPermissionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DocumentPermissionInstance \Twilio\Rest\Preview\Sync\Service\Document\DocumentPermissionInstance + */ + public function buildInstance(array $payload): DocumentPermissionInstance + { + return new DocumentPermissionInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['documentSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Sync.DocumentPermissionPage]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Sync/Service/DocumentContext.php b/app/api/Twilio/Rest/Preview/Sync/Service/DocumentContext.php new file mode 100755 index 0000000..28b16e1 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/Service/DocumentContext.php @@ -0,0 +1,193 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Documents/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the DocumentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the DocumentInstance + * + * @return DocumentInstance Fetched DocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DocumentInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new DocumentInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the DocumentInstance + * + * @param array $data + * @param array|Options $options Optional Arguments + * @return DocumentInstance Updated DocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $data, array $options = []): DocumentInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Data' => + Serialize::jsonObject($data), + ]); + + $headers = Values::of(['If-Match' => $options['ifMatch']]); + + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new DocumentInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the documentPermissions + */ + protected function getDocumentPermissions(): DocumentPermissionList + { + if (!$this->_documentPermissions) { + $this->_documentPermissions = new DocumentPermissionList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_documentPermissions; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Sync.DocumentContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Sync/Service/DocumentInstance.php b/app/api/Twilio/Rest/Preview/Sync/Service/DocumentInstance.php new file mode 100755 index 0000000..6b8c930 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/Service/DocumentInstance.php @@ -0,0 +1,176 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + 'revision' => Values::array_get($payload, 'revision'), + 'data' => Values::array_get($payload, 'data'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'createdBy' => Values::array_get($payload, 'created_by'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return DocumentContext Context for this DocumentInstance + */ + protected function proxy(): DocumentContext + { + if (!$this->context) { + $this->context = new DocumentContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the DocumentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the DocumentInstance + * + * @return DocumentInstance Fetched DocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DocumentInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the DocumentInstance + * + * @param array $data + * @param array|Options $options Optional Arguments + * @return DocumentInstance Updated DocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $data, array $options = []): DocumentInstance + { + + return $this->proxy()->update($data, $options); + } + + /** + * Access the documentPermissions + */ + protected function getDocumentPermissions(): DocumentPermissionList + { + return $this->proxy()->documentPermissions; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Sync.DocumentInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Sync/Service/DocumentList.php b/app/api/Twilio/Rest/Preview/Sync/Service/DocumentList.php new file mode 100755 index 0000000..dbdf228 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/Service/DocumentList.php @@ -0,0 +1,200 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Documents'; + } + + /** + * Create the DocumentInstance + * + * @param array|Options $options Optional Arguments + * @return DocumentInstance Created DocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): DocumentInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + 'Data' => + Serialize::jsonObject($options['data']), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new DocumentInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads DocumentInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return DocumentInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams DocumentInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of DocumentInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return DocumentPage Page of DocumentInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): DocumentPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new DocumentPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of DocumentInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return DocumentPage Page of DocumentInstance + */ + public function getPage(string $targetUrl): DocumentPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new DocumentPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a DocumentContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): DocumentContext + { + return new DocumentContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Sync.DocumentList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Sync/Service/DocumentOptions.php b/app/api/Twilio/Rest/Preview/Sync/Service/DocumentOptions.php new file mode 100755 index 0000000..a4bed4b --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/Service/DocumentOptions.php @@ -0,0 +1,152 @@ +options['uniqueName'] = $uniqueName; + $this->options['data'] = $data; + } + + /** + * + * + * @param string $uniqueName + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * + * + * @param array $data + * @return $this Fluent Builder + */ + public function setData(array $data): self + { + $this->options['data'] = $data; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Sync.CreateDocumentOptions ' . $options . ']'; + } +} + + + + +class UpdateDocumentOptions extends Options + { + /** + * @param string $ifMatch The If-Match HTTP request header + */ + public function __construct( + + string $ifMatch = Values::NONE + + ) { + $this->options['ifMatch'] = $ifMatch; + } + + /** + * The If-Match HTTP request header + * + * @param string $ifMatch The If-Match HTTP request header + * @return $this Fluent Builder + */ + public function setIfMatch(string $ifMatch): self + { + $this->options['ifMatch'] = $ifMatch; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Sync.UpdateDocumentOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Sync/Service/DocumentPage.php b/app/api/Twilio/Rest/Preview/Sync/Service/DocumentPage.php new file mode 100755 index 0000000..eed3804 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/Service/DocumentPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DocumentInstance \Twilio\Rest\Preview\Sync\Service\DocumentInstance + */ + public function buildInstance(array $payload): DocumentInstance + { + return new DocumentInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Sync.DocumentPage]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemContext.php b/app/api/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemContext.php new file mode 100755 index 0000000..2d04e4f --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemContext.php @@ -0,0 +1,146 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'listSid' => + $listSid, + 'index' => + $index, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Lists/' . \rawurlencode($listSid) + .'/Items/' . \rawurlencode($index) + .''; + } + + /** + * Delete the SyncListItemInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['If-Match' => $options['ifMatch']]); + + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the SyncListItemInstance + * + * @return SyncListItemInstance Fetched SyncListItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncListItemInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new SyncListItemInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['listSid'], + $this->solution['index'] + ); + } + + + /** + * Update the SyncListItemInstance + * + * @param array $data + * @param array|Options $options Optional Arguments + * @return SyncListItemInstance Updated SyncListItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $data, array $options = []): SyncListItemInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Data' => + Serialize::jsonObject($data), + ]); + + $headers = Values::of(['If-Match' => $options['ifMatch']]); + + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new SyncListItemInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['listSid'], + $this->solution['index'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Sync.SyncListItemContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemInstance.php b/app/api/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemInstance.php new file mode 100755 index 0000000..37ef8a6 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemInstance.php @@ -0,0 +1,166 @@ +properties = [ + 'index' => Values::array_get($payload, 'index'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'listSid' => Values::array_get($payload, 'list_sid'), + 'url' => Values::array_get($payload, 'url'), + 'revision' => Values::array_get($payload, 'revision'), + 'data' => Values::array_get($payload, 'data'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'createdBy' => Values::array_get($payload, 'created_by'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'listSid' => $listSid, 'index' => $index ?: $this->properties['index'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SyncListItemContext Context for this SyncListItemInstance + */ + protected function proxy(): SyncListItemContext + { + if (!$this->context) { + $this->context = new SyncListItemContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['listSid'], + $this->solution['index'] + ); + } + + return $this->context; + } + + /** + * Delete the SyncListItemInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the SyncListItemInstance + * + * @return SyncListItemInstance Fetched SyncListItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncListItemInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SyncListItemInstance + * + * @param array $data + * @param array|Options $options Optional Arguments + * @return SyncListItemInstance Updated SyncListItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $data, array $options = []): SyncListItemInstance + { + + return $this->proxy()->update($data, $options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Sync.SyncListItemInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemList.php b/app/api/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemList.php new file mode 100755 index 0000000..e2dc1dc --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemList.php @@ -0,0 +1,214 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'listSid' => + $listSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Lists/' . \rawurlencode($listSid) + .'/Items'; + } + + /** + * Create the SyncListItemInstance + * + * @param array $data + * @return SyncListItemInstance Created SyncListItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $data): SyncListItemInstance + { + + $data = Values::of([ + 'Data' => + Serialize::jsonObject($data), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new SyncListItemInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['listSid'] + ); + } + + + /** + * Reads SyncListItemInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return SyncListItemInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams SyncListItemInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SyncListItemInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return SyncListItemPage Page of SyncListItemInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SyncListItemPage + { + $options = new Values($options); + + $params = Values::of([ + 'Order' => + $options['order'], + 'From' => + $options['from'], + 'Bounds' => + $options['bounds'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SyncListItemPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SyncListItemInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SyncListItemPage Page of SyncListItemInstance + */ + public function getPage(string $targetUrl): SyncListItemPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SyncListItemPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SyncListItemContext + * + * @param int $index + */ + public function getContext( + int $index + + ): SyncListItemContext + { + return new SyncListItemContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['listSid'], + $index + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Sync.SyncListItemList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemOptions.php b/app/api/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemOptions.php new file mode 100755 index 0000000..b08546f --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemOptions.php @@ -0,0 +1,220 @@ +options['ifMatch'] = $ifMatch; + } + + /** + * The If-Match HTTP request header + * + * @param string $ifMatch The If-Match HTTP request header + * @return $this Fluent Builder + */ + public function setIfMatch(string $ifMatch): self + { + $this->options['ifMatch'] = $ifMatch; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Sync.DeleteSyncListItemOptions ' . $options . ']'; + } +} + + +class ReadSyncListItemOptions extends Options + { + /** + * @param string $order + * @param string $from + * @param string $bounds + */ + public function __construct( + + string $order = Values::NONE, + string $from = Values::NONE, + string $bounds = Values::NONE + + ) { + $this->options['order'] = $order; + $this->options['from'] = $from; + $this->options['bounds'] = $bounds; + } + + /** + * + * + * @param string $order + * @return $this Fluent Builder + */ + public function setOrder(string $order): self + { + $this->options['order'] = $order; + return $this; + } + + /** + * + * + * @param string $from + * @return $this Fluent Builder + */ + public function setFrom(string $from): self + { + $this->options['from'] = $from; + return $this; + } + + /** + * + * + * @param string $bounds + * @return $this Fluent Builder + */ + public function setBounds(string $bounds): self + { + $this->options['bounds'] = $bounds; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Sync.ReadSyncListItemOptions ' . $options . ']'; + } +} + +class UpdateSyncListItemOptions extends Options + { + /** + * @param string $ifMatch The If-Match HTTP request header + */ + public function __construct( + + string $ifMatch = Values::NONE + + ) { + $this->options['ifMatch'] = $ifMatch; + } + + /** + * The If-Match HTTP request header + * + * @param string $ifMatch The If-Match HTTP request header + * @return $this Fluent Builder + */ + public function setIfMatch(string $ifMatch): self + { + $this->options['ifMatch'] = $ifMatch; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Sync.UpdateSyncListItemOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemPage.php b/app/api/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemPage.php new file mode 100755 index 0000000..5d1579d --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListItemPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SyncListItemInstance \Twilio\Rest\Preview\Sync\Service\SyncList\SyncListItemInstance + */ + public function buildInstance(array $payload): SyncListItemInstance + { + return new SyncListItemInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Sync.SyncListItemPage]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionContext.php b/app/api/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionContext.php new file mode 100755 index 0000000..e7b0520 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionContext.php @@ -0,0 +1,141 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'listSid' => + $listSid, + 'identity' => + $identity, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Lists/' . \rawurlencode($listSid) + .'/Permissions/' . \rawurlencode($identity) + .''; + } + + /** + * Delete the SyncListPermissionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the SyncListPermissionInstance + * + * @return SyncListPermissionInstance Fetched SyncListPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncListPermissionInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new SyncListPermissionInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['listSid'], + $this->solution['identity'] + ); + } + + + /** + * Update the SyncListPermissionInstance + * + * @param bool $read Boolean flag specifying whether the identity can read the Sync List. + * @param bool $write Boolean flag specifying whether the identity can create, update and delete Items of the Sync List. + * @param bool $manage Boolean flag specifying whether the identity can delete the Sync List. + * @return SyncListPermissionInstance Updated SyncListPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $read, bool $write, bool $manage): SyncListPermissionInstance + { + + $data = Values::of([ + 'Read' => + Serialize::booleanToString($read), + 'Write' => + Serialize::booleanToString($write), + 'Manage' => + Serialize::booleanToString($manage), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new SyncListPermissionInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['listSid'], + $this->solution['identity'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Sync.SyncListPermissionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionInstance.php b/app/api/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionInstance.php new file mode 100755 index 0000000..b765197 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionInstance.php @@ -0,0 +1,160 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'listSid' => Values::array_get($payload, 'list_sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'read' => Values::array_get($payload, 'read'), + 'write' => Values::array_get($payload, 'write'), + 'manage' => Values::array_get($payload, 'manage'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'listSid' => $listSid, 'identity' => $identity ?: $this->properties['identity'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SyncListPermissionContext Context for this SyncListPermissionInstance + */ + protected function proxy(): SyncListPermissionContext + { + if (!$this->context) { + $this->context = new SyncListPermissionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['listSid'], + $this->solution['identity'] + ); + } + + return $this->context; + } + + /** + * Delete the SyncListPermissionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SyncListPermissionInstance + * + * @return SyncListPermissionInstance Fetched SyncListPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncListPermissionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SyncListPermissionInstance + * + * @param bool $read Boolean flag specifying whether the identity can read the Sync List. + * @param bool $write Boolean flag specifying whether the identity can create, update and delete Items of the Sync List. + * @param bool $manage Boolean flag specifying whether the identity can delete the Sync List. + * @return SyncListPermissionInstance Updated SyncListPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $read, bool $write, bool $manage): SyncListPermissionInstance + { + + return $this->proxy()->update($read, $write, $manage); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Sync.SyncListPermissionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionList.php b/app/api/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionList.php new file mode 100755 index 0000000..f99ca08 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionList.php @@ -0,0 +1,175 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'listSid' => + $listSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Lists/' . \rawurlencode($listSid) + .'/Permissions'; + } + + /** + * Reads SyncListPermissionInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return SyncListPermissionInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams SyncListPermissionInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SyncListPermissionInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return SyncListPermissionPage Page of SyncListPermissionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SyncListPermissionPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SyncListPermissionPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SyncListPermissionInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SyncListPermissionPage Page of SyncListPermissionInstance + */ + public function getPage(string $targetUrl): SyncListPermissionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SyncListPermissionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SyncListPermissionContext + * + * @param string $identity Arbitrary string identifier representing a user associated with an FPA token, assigned by the developer. + */ + public function getContext( + string $identity + + ): SyncListPermissionContext + { + return new SyncListPermissionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['listSid'], + $identity + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Sync.SyncListPermissionList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionPage.php b/app/api/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionPage.php new file mode 100755 index 0000000..50c4447 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/Service/SyncList/SyncListPermissionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SyncListPermissionInstance \Twilio\Rest\Preview\Sync\Service\SyncList\SyncListPermissionInstance + */ + public function buildInstance(array $payload): SyncListPermissionInstance + { + return new SyncListPermissionInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Sync.SyncListPermissionPage]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Sync/Service/SyncListContext.php b/app/api/Twilio/Rest/Preview/Sync/Service/SyncListContext.php new file mode 100755 index 0000000..14bd953 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/Service/SyncListContext.php @@ -0,0 +1,179 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Lists/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the SyncListInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the SyncListInstance + * + * @return SyncListInstance Fetched SyncListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncListInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new SyncListInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the syncListPermissions + */ + protected function getSyncListPermissions(): SyncListPermissionList + { + if (!$this->_syncListPermissions) { + $this->_syncListPermissions = new SyncListPermissionList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_syncListPermissions; + } + + /** + * Access the syncListItems + */ + protected function getSyncListItems(): SyncListItemList + { + if (!$this->_syncListItems) { + $this->_syncListItems = new SyncListItemList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_syncListItems; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Sync.SyncListContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Sync/Service/SyncListInstance.php b/app/api/Twilio/Rest/Preview/Sync/Service/SyncListInstance.php new file mode 100755 index 0000000..daef219 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/Service/SyncListInstance.php @@ -0,0 +1,169 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + 'revision' => Values::array_get($payload, 'revision'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'createdBy' => Values::array_get($payload, 'created_by'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SyncListContext Context for this SyncListInstance + */ + protected function proxy(): SyncListContext + { + if (!$this->context) { + $this->context = new SyncListContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the SyncListInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SyncListInstance + * + * @return SyncListInstance Fetched SyncListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncListInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the syncListPermissions + */ + protected function getSyncListPermissions(): SyncListPermissionList + { + return $this->proxy()->syncListPermissions; + } + + /** + * Access the syncListItems + */ + protected function getSyncListItems(): SyncListItemList + { + return $this->proxy()->syncListItems; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Sync.SyncListInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Sync/Service/SyncListList.php b/app/api/Twilio/Rest/Preview/Sync/Service/SyncListList.php new file mode 100755 index 0000000..339097d --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/Service/SyncListList.php @@ -0,0 +1,197 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Lists'; + } + + /** + * Create the SyncListInstance + * + * @param array|Options $options Optional Arguments + * @return SyncListInstance Created SyncListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): SyncListInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new SyncListInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads SyncListInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return SyncListInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams SyncListInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SyncListInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return SyncListPage Page of SyncListInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SyncListPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SyncListPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SyncListInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SyncListPage Page of SyncListInstance + */ + public function getPage(string $targetUrl): SyncListPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SyncListPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SyncListContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): SyncListContext + { + return new SyncListContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Sync.SyncListList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Sync/Service/SyncListOptions.php b/app/api/Twilio/Rest/Preview/Sync/Service/SyncListOptions.php new file mode 100755 index 0000000..cd3d4b1 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/Service/SyncListOptions.php @@ -0,0 +1,82 @@ +options['uniqueName'] = $uniqueName; + } + + /** + * + * + * @param string $uniqueName + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Sync.CreateSyncListOptions ' . $options . ']'; + } +} + + + + diff --git a/app/api/Twilio/Rest/Preview/Sync/Service/SyncListPage.php b/app/api/Twilio/Rest/Preview/Sync/Service/SyncListPage.php new file mode 100755 index 0000000..4153c9f --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/Service/SyncListPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SyncListInstance \Twilio\Rest\Preview\Sync\Service\SyncListInstance + */ + public function buildInstance(array $payload): SyncListInstance + { + return new SyncListInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Sync.SyncListPage]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemContext.php b/app/api/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemContext.php new file mode 100755 index 0000000..f4fb940 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemContext.php @@ -0,0 +1,146 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'mapSid' => + $mapSid, + 'key' => + $key, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Maps/' . \rawurlencode($mapSid) + .'/Items/' . \rawurlencode($key) + .''; + } + + /** + * Delete the SyncMapItemInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['If-Match' => $options['ifMatch']]); + + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the SyncMapItemInstance + * + * @return SyncMapItemInstance Fetched SyncMapItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncMapItemInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new SyncMapItemInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['mapSid'], + $this->solution['key'] + ); + } + + + /** + * Update the SyncMapItemInstance + * + * @param array $data + * @param array|Options $options Optional Arguments + * @return SyncMapItemInstance Updated SyncMapItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $data, array $options = []): SyncMapItemInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Data' => + Serialize::jsonObject($data), + ]); + + $headers = Values::of(['If-Match' => $options['ifMatch']]); + + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new SyncMapItemInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['mapSid'], + $this->solution['key'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Sync.SyncMapItemContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemInstance.php b/app/api/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemInstance.php new file mode 100755 index 0000000..79139e8 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemInstance.php @@ -0,0 +1,166 @@ +properties = [ + 'key' => Values::array_get($payload, 'key'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'mapSid' => Values::array_get($payload, 'map_sid'), + 'url' => Values::array_get($payload, 'url'), + 'revision' => Values::array_get($payload, 'revision'), + 'data' => Values::array_get($payload, 'data'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'createdBy' => Values::array_get($payload, 'created_by'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'mapSid' => $mapSid, 'key' => $key ?: $this->properties['key'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SyncMapItemContext Context for this SyncMapItemInstance + */ + protected function proxy(): SyncMapItemContext + { + if (!$this->context) { + $this->context = new SyncMapItemContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['mapSid'], + $this->solution['key'] + ); + } + + return $this->context; + } + + /** + * Delete the SyncMapItemInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the SyncMapItemInstance + * + * @return SyncMapItemInstance Fetched SyncMapItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncMapItemInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SyncMapItemInstance + * + * @param array $data + * @param array|Options $options Optional Arguments + * @return SyncMapItemInstance Updated SyncMapItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $data, array $options = []): SyncMapItemInstance + { + + return $this->proxy()->update($data, $options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Sync.SyncMapItemInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemList.php b/app/api/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemList.php new file mode 100755 index 0000000..bbe64c7 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemList.php @@ -0,0 +1,217 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'mapSid' => + $mapSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Maps/' . \rawurlencode($mapSid) + .'/Items'; + } + + /** + * Create the SyncMapItemInstance + * + * @param string $key + * @param array $data + * @return SyncMapItemInstance Created SyncMapItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $key, array $data): SyncMapItemInstance + { + + $data = Values::of([ + 'Key' => + $key, + 'Data' => + Serialize::jsonObject($data), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new SyncMapItemInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['mapSid'] + ); + } + + + /** + * Reads SyncMapItemInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return SyncMapItemInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams SyncMapItemInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SyncMapItemInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return SyncMapItemPage Page of SyncMapItemInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SyncMapItemPage + { + $options = new Values($options); + + $params = Values::of([ + 'Order' => + $options['order'], + 'From' => + $options['from'], + 'Bounds' => + $options['bounds'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SyncMapItemPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SyncMapItemInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SyncMapItemPage Page of SyncMapItemInstance + */ + public function getPage(string $targetUrl): SyncMapItemPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SyncMapItemPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SyncMapItemContext + * + * @param string $key + */ + public function getContext( + string $key + + ): SyncMapItemContext + { + return new SyncMapItemContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['mapSid'], + $key + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Sync.SyncMapItemList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemOptions.php b/app/api/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemOptions.php new file mode 100755 index 0000000..7b7d061 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemOptions.php @@ -0,0 +1,220 @@ +options['ifMatch'] = $ifMatch; + } + + /** + * The If-Match HTTP request header + * + * @param string $ifMatch The If-Match HTTP request header + * @return $this Fluent Builder + */ + public function setIfMatch(string $ifMatch): self + { + $this->options['ifMatch'] = $ifMatch; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Sync.DeleteSyncMapItemOptions ' . $options . ']'; + } +} + + +class ReadSyncMapItemOptions extends Options + { + /** + * @param string $order + * @param string $from + * @param string $bounds + */ + public function __construct( + + string $order = Values::NONE, + string $from = Values::NONE, + string $bounds = Values::NONE + + ) { + $this->options['order'] = $order; + $this->options['from'] = $from; + $this->options['bounds'] = $bounds; + } + + /** + * + * + * @param string $order + * @return $this Fluent Builder + */ + public function setOrder(string $order): self + { + $this->options['order'] = $order; + return $this; + } + + /** + * + * + * @param string $from + * @return $this Fluent Builder + */ + public function setFrom(string $from): self + { + $this->options['from'] = $from; + return $this; + } + + /** + * + * + * @param string $bounds + * @return $this Fluent Builder + */ + public function setBounds(string $bounds): self + { + $this->options['bounds'] = $bounds; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Sync.ReadSyncMapItemOptions ' . $options . ']'; + } +} + +class UpdateSyncMapItemOptions extends Options + { + /** + * @param string $ifMatch The If-Match HTTP request header + */ + public function __construct( + + string $ifMatch = Values::NONE + + ) { + $this->options['ifMatch'] = $ifMatch; + } + + /** + * The If-Match HTTP request header + * + * @param string $ifMatch The If-Match HTTP request header + * @return $this Fluent Builder + */ + public function setIfMatch(string $ifMatch): self + { + $this->options['ifMatch'] = $ifMatch; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Sync.UpdateSyncMapItemOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemPage.php b/app/api/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemPage.php new file mode 100755 index 0000000..07b803e --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapItemPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SyncMapItemInstance \Twilio\Rest\Preview\Sync\Service\SyncMap\SyncMapItemInstance + */ + public function buildInstance(array $payload): SyncMapItemInstance + { + return new SyncMapItemInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Sync.SyncMapItemPage]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionContext.php b/app/api/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionContext.php new file mode 100755 index 0000000..ba722d9 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionContext.php @@ -0,0 +1,141 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'mapSid' => + $mapSid, + 'identity' => + $identity, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Maps/' . \rawurlencode($mapSid) + .'/Permissions/' . \rawurlencode($identity) + .''; + } + + /** + * Delete the SyncMapPermissionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the SyncMapPermissionInstance + * + * @return SyncMapPermissionInstance Fetched SyncMapPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncMapPermissionInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new SyncMapPermissionInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['mapSid'], + $this->solution['identity'] + ); + } + + + /** + * Update the SyncMapPermissionInstance + * + * @param bool $read Boolean flag specifying whether the identity can read the Sync Map. + * @param bool $write Boolean flag specifying whether the identity can create, update and delete Items of the Sync Map. + * @param bool $manage Boolean flag specifying whether the identity can delete the Sync Map. + * @return SyncMapPermissionInstance Updated SyncMapPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $read, bool $write, bool $manage): SyncMapPermissionInstance + { + + $data = Values::of([ + 'Read' => + Serialize::booleanToString($read), + 'Write' => + Serialize::booleanToString($write), + 'Manage' => + Serialize::booleanToString($manage), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new SyncMapPermissionInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['mapSid'], + $this->solution['identity'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Sync.SyncMapPermissionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionInstance.php b/app/api/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionInstance.php new file mode 100755 index 0000000..11ae120 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionInstance.php @@ -0,0 +1,160 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'mapSid' => Values::array_get($payload, 'map_sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'read' => Values::array_get($payload, 'read'), + 'write' => Values::array_get($payload, 'write'), + 'manage' => Values::array_get($payload, 'manage'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'mapSid' => $mapSid, 'identity' => $identity ?: $this->properties['identity'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SyncMapPermissionContext Context for this SyncMapPermissionInstance + */ + protected function proxy(): SyncMapPermissionContext + { + if (!$this->context) { + $this->context = new SyncMapPermissionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['mapSid'], + $this->solution['identity'] + ); + } + + return $this->context; + } + + /** + * Delete the SyncMapPermissionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SyncMapPermissionInstance + * + * @return SyncMapPermissionInstance Fetched SyncMapPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncMapPermissionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SyncMapPermissionInstance + * + * @param bool $read Boolean flag specifying whether the identity can read the Sync Map. + * @param bool $write Boolean flag specifying whether the identity can create, update and delete Items of the Sync Map. + * @param bool $manage Boolean flag specifying whether the identity can delete the Sync Map. + * @return SyncMapPermissionInstance Updated SyncMapPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $read, bool $write, bool $manage): SyncMapPermissionInstance + { + + return $this->proxy()->update($read, $write, $manage); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Sync.SyncMapPermissionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionList.php b/app/api/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionList.php new file mode 100755 index 0000000..1f5b8bc --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionList.php @@ -0,0 +1,175 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'mapSid' => + $mapSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Maps/' . \rawurlencode($mapSid) + .'/Permissions'; + } + + /** + * Reads SyncMapPermissionInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return SyncMapPermissionInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams SyncMapPermissionInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SyncMapPermissionInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return SyncMapPermissionPage Page of SyncMapPermissionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SyncMapPermissionPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SyncMapPermissionPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SyncMapPermissionInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SyncMapPermissionPage Page of SyncMapPermissionInstance + */ + public function getPage(string $targetUrl): SyncMapPermissionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SyncMapPermissionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SyncMapPermissionContext + * + * @param string $identity Arbitrary string identifier representing a user associated with an FPA token, assigned by the developer. + */ + public function getContext( + string $identity + + ): SyncMapPermissionContext + { + return new SyncMapPermissionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['mapSid'], + $identity + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Sync.SyncMapPermissionList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionPage.php b/app/api/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionPage.php new file mode 100755 index 0000000..32b9a5e --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/Service/SyncMap/SyncMapPermissionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SyncMapPermissionInstance \Twilio\Rest\Preview\Sync\Service\SyncMap\SyncMapPermissionInstance + */ + public function buildInstance(array $payload): SyncMapPermissionInstance + { + return new SyncMapPermissionInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Sync.SyncMapPermissionPage]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Sync/Service/SyncMapContext.php b/app/api/Twilio/Rest/Preview/Sync/Service/SyncMapContext.php new file mode 100755 index 0000000..e35ed57 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/Service/SyncMapContext.php @@ -0,0 +1,179 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Maps/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the SyncMapInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the SyncMapInstance + * + * @return SyncMapInstance Fetched SyncMapInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncMapInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new SyncMapInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the syncMapItems + */ + protected function getSyncMapItems(): SyncMapItemList + { + if (!$this->_syncMapItems) { + $this->_syncMapItems = new SyncMapItemList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_syncMapItems; + } + + /** + * Access the syncMapPermissions + */ + protected function getSyncMapPermissions(): SyncMapPermissionList + { + if (!$this->_syncMapPermissions) { + $this->_syncMapPermissions = new SyncMapPermissionList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_syncMapPermissions; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Sync.SyncMapContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Sync/Service/SyncMapInstance.php b/app/api/Twilio/Rest/Preview/Sync/Service/SyncMapInstance.php new file mode 100755 index 0000000..9ef6196 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/Service/SyncMapInstance.php @@ -0,0 +1,169 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + 'revision' => Values::array_get($payload, 'revision'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'createdBy' => Values::array_get($payload, 'created_by'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SyncMapContext Context for this SyncMapInstance + */ + protected function proxy(): SyncMapContext + { + if (!$this->context) { + $this->context = new SyncMapContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the SyncMapInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SyncMapInstance + * + * @return SyncMapInstance Fetched SyncMapInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncMapInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the syncMapItems + */ + protected function getSyncMapItems(): SyncMapItemList + { + return $this->proxy()->syncMapItems; + } + + /** + * Access the syncMapPermissions + */ + protected function getSyncMapPermissions(): SyncMapPermissionList + { + return $this->proxy()->syncMapPermissions; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Sync.SyncMapInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Sync/Service/SyncMapList.php b/app/api/Twilio/Rest/Preview/Sync/Service/SyncMapList.php new file mode 100755 index 0000000..7702661 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/Service/SyncMapList.php @@ -0,0 +1,197 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Maps'; + } + + /** + * Create the SyncMapInstance + * + * @param array|Options $options Optional Arguments + * @return SyncMapInstance Created SyncMapInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): SyncMapInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new SyncMapInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads SyncMapInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return SyncMapInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams SyncMapInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SyncMapInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return SyncMapPage Page of SyncMapInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SyncMapPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SyncMapPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SyncMapInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SyncMapPage Page of SyncMapInstance + */ + public function getPage(string $targetUrl): SyncMapPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SyncMapPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SyncMapContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): SyncMapContext + { + return new SyncMapContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Sync.SyncMapList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Sync/Service/SyncMapOptions.php b/app/api/Twilio/Rest/Preview/Sync/Service/SyncMapOptions.php new file mode 100755 index 0000000..4980d2c --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/Service/SyncMapOptions.php @@ -0,0 +1,82 @@ +options['uniqueName'] = $uniqueName; + } + + /** + * + * + * @param string $uniqueName + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Sync.CreateSyncMapOptions ' . $options . ']'; + } +} + + + + diff --git a/app/api/Twilio/Rest/Preview/Sync/Service/SyncMapPage.php b/app/api/Twilio/Rest/Preview/Sync/Service/SyncMapPage.php new file mode 100755 index 0000000..9bab77f --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/Service/SyncMapPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SyncMapInstance \Twilio\Rest\Preview\Sync\Service\SyncMapInstance + */ + public function buildInstance(array $payload): SyncMapInstance + { + return new SyncMapInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Sync.SyncMapPage]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Sync/ServiceContext.php b/app/api/Twilio/Rest/Preview/Sync/ServiceContext.php new file mode 100755 index 0000000..d9e0d9a --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/ServiceContext.php @@ -0,0 +1,226 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'WebhookUrl' => + $options['webhookUrl'], + 'FriendlyName' => + $options['friendlyName'], + 'ReachabilityWebhooksEnabled' => + Serialize::booleanToString($options['reachabilityWebhooksEnabled']), + 'AclEnabled' => + Serialize::booleanToString($options['aclEnabled']), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the syncLists + */ + protected function getSyncLists(): SyncListList + { + if (!$this->_syncLists) { + $this->_syncLists = new SyncListList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_syncLists; + } + + /** + * Access the documents + */ + protected function getDocuments(): DocumentList + { + if (!$this->_documents) { + $this->_documents = new DocumentList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_documents; + } + + /** + * Access the syncMaps + */ + protected function getSyncMaps(): SyncMapList + { + if (!$this->_syncMaps) { + $this->_syncMaps = new SyncMapList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_syncMaps; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Sync.ServiceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Sync/ServiceInstance.php b/app/api/Twilio/Rest/Preview/Sync/ServiceInstance.php new file mode 100755 index 0000000..f03f563 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/ServiceInstance.php @@ -0,0 +1,191 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'webhookUrl' => Values::array_get($payload, 'webhook_url'), + 'reachabilityWebhooksEnabled' => Values::array_get($payload, 'reachability_webhooks_enabled'), + 'aclEnabled' => Values::array_get($payload, 'acl_enabled'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ServiceContext Context for this ServiceInstance + */ + protected function proxy(): ServiceContext + { + if (!$this->context) { + $this->context = new ServiceContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the syncLists + */ + protected function getSyncLists(): SyncListList + { + return $this->proxy()->syncLists; + } + + /** + * Access the documents + */ + protected function getDocuments(): DocumentList + { + return $this->proxy()->documents; + } + + /** + * Access the syncMaps + */ + protected function getSyncMaps(): SyncMapList + { + return $this->proxy()->syncMaps; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Sync.ServiceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Sync/ServiceList.php b/app/api/Twilio/Rest/Preview/Sync/ServiceList.php new file mode 100755 index 0000000..a3bea4a --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/ServiceList.php @@ -0,0 +1,196 @@ +solution = [ + ]; + + $this->uri = '/Services'; + } + + /** + * Create the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Created ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): ServiceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'WebhookUrl' => + $options['webhookUrl'], + 'ReachabilityWebhooksEnabled' => + Serialize::booleanToString($options['reachabilityWebhooksEnabled']), + 'AclEnabled' => + Serialize::booleanToString($options['aclEnabled']), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new ServiceInstance( + $this->version, + $payload + ); + } + + + /** + * Reads ServiceInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ServiceInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ServiceInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ServiceInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ServicePage Page of ServiceInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ServicePage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ServicePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ServiceInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ServicePage Page of ServiceInstance + */ + public function getPage(string $targetUrl): ServicePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ServicePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ServiceContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): ServiceContext + { + return new ServiceContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Sync.ServiceList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Sync/ServiceOptions.php b/app/api/Twilio/Rest/Preview/Sync/ServiceOptions.php new file mode 100755 index 0000000..b637e22 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/ServiceOptions.php @@ -0,0 +1,242 @@ +options['friendlyName'] = $friendlyName; + $this->options['webhookUrl'] = $webhookUrl; + $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; + $this->options['aclEnabled'] = $aclEnabled; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * + * + * @param string $webhookUrl + * @return $this Fluent Builder + */ + public function setWebhookUrl(string $webhookUrl): self + { + $this->options['webhookUrl'] = $webhookUrl; + return $this; + } + + /** + * + * + * @param bool $reachabilityWebhooksEnabled + * @return $this Fluent Builder + */ + public function setReachabilityWebhooksEnabled(bool $reachabilityWebhooksEnabled): self + { + $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; + return $this; + } + + /** + * + * + * @param bool $aclEnabled + * @return $this Fluent Builder + */ + public function setAclEnabled(bool $aclEnabled): self + { + $this->options['aclEnabled'] = $aclEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Sync.CreateServiceOptions ' . $options . ']'; + } +} + + + + +class UpdateServiceOptions extends Options + { + /** + * @param string $webhookUrl + * @param string $friendlyName + * @param bool $reachabilityWebhooksEnabled + * @param bool $aclEnabled + */ + public function __construct( + + string $webhookUrl = Values::NONE, + string $friendlyName = Values::NONE, + bool $reachabilityWebhooksEnabled = Values::BOOL_NONE, + bool $aclEnabled = Values::BOOL_NONE + + ) { + $this->options['webhookUrl'] = $webhookUrl; + $this->options['friendlyName'] = $friendlyName; + $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; + $this->options['aclEnabled'] = $aclEnabled; + } + + /** + * + * + * @param string $webhookUrl + * @return $this Fluent Builder + */ + public function setWebhookUrl(string $webhookUrl): self + { + $this->options['webhookUrl'] = $webhookUrl; + return $this; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * + * + * @param bool $reachabilityWebhooksEnabled + * @return $this Fluent Builder + */ + public function setReachabilityWebhooksEnabled(bool $reachabilityWebhooksEnabled): self + { + $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; + return $this; + } + + /** + * + * + * @param bool $aclEnabled + * @return $this Fluent Builder + */ + public function setAclEnabled(bool $aclEnabled): self + { + $this->options['aclEnabled'] = $aclEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Sync.UpdateServiceOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Sync/ServicePage.php b/app/api/Twilio/Rest/Preview/Sync/ServicePage.php new file mode 100755 index 0000000..686ae87 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Sync/ServicePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ServiceInstance \Twilio\Rest\Preview\Sync\ServiceInstance + */ + public function buildInstance(array $payload): ServiceInstance + { + return new ServiceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Sync.ServicePage]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand.php b/app/api/Twilio/Rest/Preview/Understand.php new file mode 100755 index 0000000..b7256dd --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand.php @@ -0,0 +1,95 @@ +version = 'understand'; + } + + protected function getAssistants(): AssistantList + { + if (!$this->_assistants) { + $this->_assistants = new AssistantList($this); + } + return $this->_assistants; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Understand]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/AssistantFallbackActionsContext.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/AssistantFallbackActionsContext.php new file mode 100755 index 0000000..02cafbb --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/AssistantFallbackActionsContext.php @@ -0,0 +1,111 @@ +solution = [ + 'assistantSid' => + $assistantSid, + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/FallbackActions'; + } + + /** + * Fetch the AssistantFallbackActionsInstance + * + * @return AssistantFallbackActionsInstance Fetched AssistantFallbackActionsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AssistantFallbackActionsInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new AssistantFallbackActionsInstance( + $this->version, + $payload, + $this->solution['assistantSid'] + ); + } + + + /** + * Update the AssistantFallbackActionsInstance + * + * @param array|Options $options Optional Arguments + * @return AssistantFallbackActionsInstance Updated AssistantFallbackActionsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): AssistantFallbackActionsInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FallbackActions' => + Serialize::jsonObject($options['fallbackActions']), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new AssistantFallbackActionsInstance( + $this->version, + $payload, + $this->solution['assistantSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Understand.AssistantFallbackActionsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/AssistantFallbackActionsInstance.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/AssistantFallbackActionsInstance.php new file mode 100755 index 0000000..5f5ea64 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/AssistantFallbackActionsInstance.php @@ -0,0 +1,135 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'assistantSid' => Values::array_get($payload, 'assistant_sid'), + 'url' => Values::array_get($payload, 'url'), + 'data' => Values::array_get($payload, 'data'), + ]; + + $this->solution = ['assistantSid' => $assistantSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AssistantFallbackActionsContext Context for this AssistantFallbackActionsInstance + */ + protected function proxy(): AssistantFallbackActionsContext + { + if (!$this->context) { + $this->context = new AssistantFallbackActionsContext( + $this->version, + $this->solution['assistantSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the AssistantFallbackActionsInstance + * + * @return AssistantFallbackActionsInstance Fetched AssistantFallbackActionsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AssistantFallbackActionsInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the AssistantFallbackActionsInstance + * + * @param array|Options $options Optional Arguments + * @return AssistantFallbackActionsInstance Updated AssistantFallbackActionsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): AssistantFallbackActionsInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Understand.AssistantFallbackActionsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/AssistantFallbackActionsList.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/AssistantFallbackActionsList.php new file mode 100755 index 0000000..2e3e47f --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/AssistantFallbackActionsList.php @@ -0,0 +1,67 @@ +solution = [ + 'assistantSid' => + $assistantSid, + + ]; + } + + /** + * Constructs a AssistantFallbackActionsContext + */ + public function getContext( + + ): AssistantFallbackActionsContext + { + return new AssistantFallbackActionsContext( + $this->version, + $this->solution['assistantSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Understand.AssistantFallbackActionsList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/AssistantFallbackActionsOptions.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/AssistantFallbackActionsOptions.php new file mode 100755 index 0000000..dbb57aa --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/AssistantFallbackActionsOptions.php @@ -0,0 +1,78 @@ +options['fallbackActions'] = $fallbackActions; + } + + /** + * + * + * @param array $fallbackActions + * @return $this Fluent Builder + */ + public function setFallbackActions(array $fallbackActions): self + { + $this->options['fallbackActions'] = $fallbackActions; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Understand.UpdateAssistantFallbackActionsOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/AssistantFallbackActionsPage.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/AssistantFallbackActionsPage.php new file mode 100755 index 0000000..c7cf2ae --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/AssistantFallbackActionsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AssistantFallbackActionsInstance \Twilio\Rest\Preview\Understand\Assistant\AssistantFallbackActionsInstance + */ + public function buildInstance(array $payload): AssistantFallbackActionsInstance + { + return new AssistantFallbackActionsInstance($this->version, $payload, $this->solution['assistantSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Understand.AssistantFallbackActionsPage]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/AssistantInitiationActionsContext.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/AssistantInitiationActionsContext.php new file mode 100755 index 0000000..c879e19 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/AssistantInitiationActionsContext.php @@ -0,0 +1,111 @@ +solution = [ + 'assistantSid' => + $assistantSid, + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/InitiationActions'; + } + + /** + * Fetch the AssistantInitiationActionsInstance + * + * @return AssistantInitiationActionsInstance Fetched AssistantInitiationActionsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AssistantInitiationActionsInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new AssistantInitiationActionsInstance( + $this->version, + $payload, + $this->solution['assistantSid'] + ); + } + + + /** + * Update the AssistantInitiationActionsInstance + * + * @param array|Options $options Optional Arguments + * @return AssistantInitiationActionsInstance Updated AssistantInitiationActionsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): AssistantInitiationActionsInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'InitiationActions' => + Serialize::jsonObject($options['initiationActions']), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new AssistantInitiationActionsInstance( + $this->version, + $payload, + $this->solution['assistantSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Understand.AssistantInitiationActionsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/AssistantInitiationActionsInstance.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/AssistantInitiationActionsInstance.php new file mode 100755 index 0000000..10ff3b7 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/AssistantInitiationActionsInstance.php @@ -0,0 +1,135 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'assistantSid' => Values::array_get($payload, 'assistant_sid'), + 'url' => Values::array_get($payload, 'url'), + 'data' => Values::array_get($payload, 'data'), + ]; + + $this->solution = ['assistantSid' => $assistantSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AssistantInitiationActionsContext Context for this AssistantInitiationActionsInstance + */ + protected function proxy(): AssistantInitiationActionsContext + { + if (!$this->context) { + $this->context = new AssistantInitiationActionsContext( + $this->version, + $this->solution['assistantSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the AssistantInitiationActionsInstance + * + * @return AssistantInitiationActionsInstance Fetched AssistantInitiationActionsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AssistantInitiationActionsInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the AssistantInitiationActionsInstance + * + * @param array|Options $options Optional Arguments + * @return AssistantInitiationActionsInstance Updated AssistantInitiationActionsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): AssistantInitiationActionsInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Understand.AssistantInitiationActionsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/AssistantInitiationActionsList.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/AssistantInitiationActionsList.php new file mode 100755 index 0000000..35cbbe8 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/AssistantInitiationActionsList.php @@ -0,0 +1,67 @@ +solution = [ + 'assistantSid' => + $assistantSid, + + ]; + } + + /** + * Constructs a AssistantInitiationActionsContext + */ + public function getContext( + + ): AssistantInitiationActionsContext + { + return new AssistantInitiationActionsContext( + $this->version, + $this->solution['assistantSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Understand.AssistantInitiationActionsList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/AssistantInitiationActionsOptions.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/AssistantInitiationActionsOptions.php new file mode 100755 index 0000000..9830b36 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/AssistantInitiationActionsOptions.php @@ -0,0 +1,78 @@ +options['initiationActions'] = $initiationActions; + } + + /** + * + * + * @param array $initiationActions + * @return $this Fluent Builder + */ + public function setInitiationActions(array $initiationActions): self + { + $this->options['initiationActions'] = $initiationActions; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Understand.UpdateAssistantInitiationActionsOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/AssistantInitiationActionsPage.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/AssistantInitiationActionsPage.php new file mode 100755 index 0000000..c2bdb17 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/AssistantInitiationActionsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AssistantInitiationActionsInstance \Twilio\Rest\Preview\Understand\Assistant\AssistantInitiationActionsInstance + */ + public function buildInstance(array $payload): AssistantInitiationActionsInstance + { + return new AssistantInitiationActionsInstance($this->version, $payload, $this->solution['assistantSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Understand.AssistantInitiationActionsPage]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/DialogueContext.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/DialogueContext.php new file mode 100755 index 0000000..8b2914f --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/DialogueContext.php @@ -0,0 +1,87 @@ +solution = [ + 'assistantSid' => + $assistantSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/Dialogues/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the DialogueInstance + * + * @return DialogueInstance Fetched DialogueInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DialogueInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new DialogueInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Understand.DialogueContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/DialogueInstance.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/DialogueInstance.php new file mode 100755 index 0000000..eb25262 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/DialogueInstance.php @@ -0,0 +1,125 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'assistantSid' => Values::array_get($payload, 'assistant_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'data' => Values::array_get($payload, 'data'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['assistantSid' => $assistantSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return DialogueContext Context for this DialogueInstance + */ + protected function proxy(): DialogueContext + { + if (!$this->context) { + $this->context = new DialogueContext( + $this->version, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the DialogueInstance + * + * @return DialogueInstance Fetched DialogueInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DialogueInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Understand.DialogueInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/DialogueList.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/DialogueList.php new file mode 100755 index 0000000..b33b21a --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/DialogueList.php @@ -0,0 +1,71 @@ +solution = [ + 'assistantSid' => + $assistantSid, + + ]; + } + + /** + * Constructs a DialogueContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): DialogueContext + { + return new DialogueContext( + $this->version, + $this->solution['assistantSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Understand.DialogueList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/DialoguePage.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/DialoguePage.php new file mode 100755 index 0000000..966e2d7 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/DialoguePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DialogueInstance \Twilio\Rest\Preview\Understand\Assistant\DialogueInstance + */ + public function buildInstance(array $payload): DialogueInstance + { + return new DialogueInstance($this->version, $payload, $this->solution['assistantSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Understand.DialoguePage]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/FieldType/FieldValueContext.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/FieldType/FieldValueContext.php new file mode 100755 index 0000000..c472385 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/FieldType/FieldValueContext.php @@ -0,0 +1,106 @@ +solution = [ + 'assistantSid' => + $assistantSid, + 'fieldTypeSid' => + $fieldTypeSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/FieldTypes/' . \rawurlencode($fieldTypeSid) + .'/FieldValues/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the FieldValueInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the FieldValueInstance + * + * @return FieldValueInstance Fetched FieldValueInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FieldValueInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new FieldValueInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['fieldTypeSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Understand.FieldValueContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/FieldType/FieldValueInstance.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/FieldType/FieldValueInstance.php new file mode 100755 index 0000000..abbb9ba --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/FieldType/FieldValueInstance.php @@ -0,0 +1,150 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'fieldTypeSid' => Values::array_get($payload, 'field_type_sid'), + 'language' => Values::array_get($payload, 'language'), + 'assistantSid' => Values::array_get($payload, 'assistant_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'value' => Values::array_get($payload, 'value'), + 'url' => Values::array_get($payload, 'url'), + 'synonymOf' => Values::array_get($payload, 'synonym_of'), + ]; + + $this->solution = ['assistantSid' => $assistantSid, 'fieldTypeSid' => $fieldTypeSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return FieldValueContext Context for this FieldValueInstance + */ + protected function proxy(): FieldValueContext + { + if (!$this->context) { + $this->context = new FieldValueContext( + $this->version, + $this->solution['assistantSid'], + $this->solution['fieldTypeSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the FieldValueInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the FieldValueInstance + * + * @return FieldValueInstance Fetched FieldValueInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FieldValueInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Understand.FieldValueInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/FieldType/FieldValueList.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/FieldType/FieldValueList.php new file mode 100755 index 0000000..999cfbf --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/FieldType/FieldValueList.php @@ -0,0 +1,217 @@ +solution = [ + 'assistantSid' => + $assistantSid, + + 'fieldTypeSid' => + $fieldTypeSid, + + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/FieldTypes/' . \rawurlencode($fieldTypeSid) + .'/FieldValues'; + } + + /** + * Create the FieldValueInstance + * + * @param string $language An ISO language-country string of the value. + * @param string $value A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. + * @param array|Options $options Optional Arguments + * @return FieldValueInstance Created FieldValueInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $language, string $value, array $options = []): FieldValueInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Language' => + $language, + 'Value' => + $value, + 'SynonymOf' => + $options['synonymOf'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new FieldValueInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['fieldTypeSid'] + ); + } + + + /** + * Reads FieldValueInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return FieldValueInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams FieldValueInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of FieldValueInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return FieldValuePage Page of FieldValueInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): FieldValuePage + { + $options = new Values($options); + + $params = Values::of([ + 'Language' => + $options['language'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new FieldValuePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of FieldValueInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return FieldValuePage Page of FieldValueInstance + */ + public function getPage(string $targetUrl): FieldValuePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new FieldValuePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a FieldValueContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): FieldValueContext + { + return new FieldValueContext( + $this->version, + $this->solution['assistantSid'], + $this->solution['fieldTypeSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Understand.FieldValueList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/FieldType/FieldValueOptions.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/FieldType/FieldValueOptions.php new file mode 100755 index 0000000..2015c7f --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/FieldType/FieldValueOptions.php @@ -0,0 +1,132 @@ +options['synonymOf'] = $synonymOf; + } + + /** + * A value that indicates this field value is a synonym of. Empty if the value is not a synonym. + * + * @param string $synonymOf A value that indicates this field value is a synonym of. Empty if the value is not a synonym. + * @return $this Fluent Builder + */ + public function setSynonymOf(string $synonymOf): self + { + $this->options['synonymOf'] = $synonymOf; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Understand.CreateFieldValueOptions ' . $options . ']'; + } +} + + + +class ReadFieldValueOptions extends Options + { + /** + * @param string $language An ISO language-country string of the value. For example: *en-US* + */ + public function __construct( + + string $language = Values::NONE + + ) { + $this->options['language'] = $language; + } + + /** + * An ISO language-country string of the value. For example: *en-US* + * + * @param string $language An ISO language-country string of the value. For example: *en-US* + * @return $this Fluent Builder + */ + public function setLanguage(string $language): self + { + $this->options['language'] = $language; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Understand.ReadFieldValueOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/FieldType/FieldValuePage.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/FieldType/FieldValuePage.php new file mode 100755 index 0000000..49e78e1 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/FieldType/FieldValuePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return FieldValueInstance \Twilio\Rest\Preview\Understand\Assistant\FieldType\FieldValueInstance + */ + public function buildInstance(array $payload): FieldValueInstance + { + return new FieldValueInstance($this->version, $payload, $this->solution['assistantSid'], $this->solution['fieldTypeSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Understand.FieldValuePage]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/FieldTypeContext.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/FieldTypeContext.php new file mode 100755 index 0000000..a02bceb --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/FieldTypeContext.php @@ -0,0 +1,191 @@ +solution = [ + 'assistantSid' => + $assistantSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/FieldTypes/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the FieldTypeInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the FieldTypeInstance + * + * @return FieldTypeInstance Fetched FieldTypeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FieldTypeInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new FieldTypeInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the FieldTypeInstance + * + * @param array|Options $options Optional Arguments + * @return FieldTypeInstance Updated FieldTypeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): FieldTypeInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'UniqueName' => + $options['uniqueName'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new FieldTypeInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the fieldValues + */ + protected function getFieldValues(): FieldValueList + { + if (!$this->_fieldValues) { + $this->_fieldValues = new FieldValueList( + $this->version, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + return $this->_fieldValues; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Understand.FieldTypeContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/FieldTypeInstance.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/FieldTypeInstance.php new file mode 100755 index 0000000..a153fd6 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/FieldTypeInstance.php @@ -0,0 +1,171 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'links' => Values::array_get($payload, 'links'), + 'assistantSid' => Values::array_get($payload, 'assistant_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['assistantSid' => $assistantSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return FieldTypeContext Context for this FieldTypeInstance + */ + protected function proxy(): FieldTypeContext + { + if (!$this->context) { + $this->context = new FieldTypeContext( + $this->version, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the FieldTypeInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the FieldTypeInstance + * + * @return FieldTypeInstance Fetched FieldTypeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FieldTypeInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the FieldTypeInstance + * + * @param array|Options $options Optional Arguments + * @return FieldTypeInstance Updated FieldTypeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): FieldTypeInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the fieldValues + */ + protected function getFieldValues(): FieldValueList + { + return $this->proxy()->fieldValues; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Understand.FieldTypeInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/FieldTypeList.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/FieldTypeList.php new file mode 100755 index 0000000..24e9c6e --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/FieldTypeList.php @@ -0,0 +1,200 @@ +solution = [ + 'assistantSid' => + $assistantSid, + + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/FieldTypes'; + } + + /** + * Create the FieldTypeInstance + * + * @param string $uniqueName A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. + * @param array|Options $options Optional Arguments + * @return FieldTypeInstance Created FieldTypeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $uniqueName, array $options = []): FieldTypeInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $uniqueName, + 'FriendlyName' => + $options['friendlyName'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new FieldTypeInstance( + $this->version, + $payload, + $this->solution['assistantSid'] + ); + } + + + /** + * Reads FieldTypeInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return FieldTypeInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams FieldTypeInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of FieldTypeInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return FieldTypePage Page of FieldTypeInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): FieldTypePage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new FieldTypePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of FieldTypeInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return FieldTypePage Page of FieldTypeInstance + */ + public function getPage(string $targetUrl): FieldTypePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new FieldTypePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a FieldTypeContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): FieldTypeContext + { + return new FieldTypeContext( + $this->version, + $this->solution['assistantSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Understand.FieldTypeList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/FieldTypeOptions.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/FieldTypeOptions.php new file mode 100755 index 0000000..10120dc --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/FieldTypeOptions.php @@ -0,0 +1,152 @@ +options['friendlyName'] = $friendlyName; + } + + /** + * A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. + * + * @param string $friendlyName A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Understand.CreateFieldTypeOptions ' . $options . ']'; + } +} + + + + +class UpdateFieldTypeOptions extends Options + { + /** + * @param string $friendlyName A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. + * @param string $uniqueName A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $uniqueName = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['uniqueName'] = $uniqueName; + } + + /** + * A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. + * + * @param string $friendlyName A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. + * + * @param string $uniqueName A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Understand.UpdateFieldTypeOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/FieldTypePage.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/FieldTypePage.php new file mode 100755 index 0000000..cc9359a --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/FieldTypePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return FieldTypeInstance \Twilio\Rest\Preview\Understand\Assistant\FieldTypeInstance + */ + public function buildInstance(array $payload): FieldTypeInstance + { + return new FieldTypeInstance($this->version, $payload, $this->solution['assistantSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Understand.FieldTypePage]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/ModelBuildContext.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/ModelBuildContext.php new file mode 100755 index 0000000..2a038ee --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/ModelBuildContext.php @@ -0,0 +1,130 @@ +solution = [ + 'assistantSid' => + $assistantSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/ModelBuilds/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ModelBuildInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the ModelBuildInstance + * + * @return ModelBuildInstance Fetched ModelBuildInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ModelBuildInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ModelBuildInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ModelBuildInstance + * + * @param array|Options $options Optional Arguments + * @return ModelBuildInstance Updated ModelBuildInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ModelBuildInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new ModelBuildInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Understand.ModelBuildContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/ModelBuildInstance.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/ModelBuildInstance.php new file mode 100755 index 0000000..bb04db3 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/ModelBuildInstance.php @@ -0,0 +1,162 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'assistantSid' => Values::array_get($payload, 'assistant_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'status' => Values::array_get($payload, 'status'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'url' => Values::array_get($payload, 'url'), + 'buildDuration' => Values::array_get($payload, 'build_duration'), + 'errorCode' => Values::array_get($payload, 'error_code'), + ]; + + $this->solution = ['assistantSid' => $assistantSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ModelBuildContext Context for this ModelBuildInstance + */ + protected function proxy(): ModelBuildContext + { + if (!$this->context) { + $this->context = new ModelBuildContext( + $this->version, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ModelBuildInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ModelBuildInstance + * + * @return ModelBuildInstance Fetched ModelBuildInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ModelBuildInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ModelBuildInstance + * + * @param array|Options $options Optional Arguments + * @return ModelBuildInstance Updated ModelBuildInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ModelBuildInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Understand.ModelBuildInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/ModelBuildList.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/ModelBuildList.php new file mode 100755 index 0000000..4928181 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/ModelBuildList.php @@ -0,0 +1,199 @@ +solution = [ + 'assistantSid' => + $assistantSid, + + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/ModelBuilds'; + } + + /** + * Create the ModelBuildInstance + * + * @param array|Options $options Optional Arguments + * @return ModelBuildInstance Created ModelBuildInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): ModelBuildInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'StatusCallback' => + $options['statusCallback'], + 'UniqueName' => + $options['uniqueName'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new ModelBuildInstance( + $this->version, + $payload, + $this->solution['assistantSid'] + ); + } + + + /** + * Reads ModelBuildInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ModelBuildInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ModelBuildInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ModelBuildInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ModelBuildPage Page of ModelBuildInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ModelBuildPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ModelBuildPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ModelBuildInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ModelBuildPage Page of ModelBuildInstance + */ + public function getPage(string $targetUrl): ModelBuildPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ModelBuildPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ModelBuildContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): ModelBuildContext + { + return new ModelBuildContext( + $this->version, + $this->solution['assistantSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Understand.ModelBuildList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/ModelBuildOptions.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/ModelBuildOptions.php new file mode 100755 index 0000000..908560f --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/ModelBuildOptions.php @@ -0,0 +1,152 @@ +options['statusCallback'] = $statusCallback; + $this->options['uniqueName'] = $uniqueName; + } + + /** + * + * + * @param string $statusCallback + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. For example: v0.1 + * + * @param string $uniqueName A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. For example: v0.1 + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Understand.CreateModelBuildOptions ' . $options . ']'; + } +} + + + + +class UpdateModelBuildOptions extends Options + { + /** + * @param string $uniqueName A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. For example: v0.1 + */ + public function __construct( + + string $uniqueName = Values::NONE + + ) { + $this->options['uniqueName'] = $uniqueName; + } + + /** + * A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. For example: v0.1 + * + * @param string $uniqueName A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. For example: v0.1 + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Understand.UpdateModelBuildOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/ModelBuildPage.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/ModelBuildPage.php new file mode 100755 index 0000000..80529d7 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/ModelBuildPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ModelBuildInstance \Twilio\Rest\Preview\Understand\Assistant\ModelBuildInstance + */ + public function buildInstance(array $payload): ModelBuildInstance + { + return new ModelBuildInstance($this->version, $payload, $this->solution['assistantSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Understand.ModelBuildPage]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/QueryContext.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/QueryContext.php new file mode 100755 index 0000000..b1b2c3d --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/QueryContext.php @@ -0,0 +1,132 @@ +solution = [ + 'assistantSid' => + $assistantSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/Queries/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the QueryInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the QueryInstance + * + * @return QueryInstance Fetched QueryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): QueryInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new QueryInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the QueryInstance + * + * @param array|Options $options Optional Arguments + * @return QueryInstance Updated QueryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): QueryInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'SampleSid' => + $options['sampleSid'], + 'Status' => + $options['status'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new QueryInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Understand.QueryContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/QueryInstance.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/QueryInstance.php new file mode 100755 index 0000000..c1faf9e --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/QueryInstance.php @@ -0,0 +1,168 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'results' => Values::array_get($payload, 'results'), + 'language' => Values::array_get($payload, 'language'), + 'modelBuildSid' => Values::array_get($payload, 'model_build_sid'), + 'query' => Values::array_get($payload, 'query'), + 'sampleSid' => Values::array_get($payload, 'sample_sid'), + 'assistantSid' => Values::array_get($payload, 'assistant_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'status' => Values::array_get($payload, 'status'), + 'url' => Values::array_get($payload, 'url'), + 'sourceChannel' => Values::array_get($payload, 'source_channel'), + ]; + + $this->solution = ['assistantSid' => $assistantSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return QueryContext Context for this QueryInstance + */ + protected function proxy(): QueryContext + { + if (!$this->context) { + $this->context = new QueryContext( + $this->version, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the QueryInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the QueryInstance + * + * @return QueryInstance Fetched QueryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): QueryInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the QueryInstance + * + * @param array|Options $options Optional Arguments + * @return QueryInstance Updated QueryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): QueryInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Understand.QueryInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/QueryList.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/QueryList.php new file mode 100755 index 0000000..3894c7a --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/QueryList.php @@ -0,0 +1,217 @@ +solution = [ + 'assistantSid' => + $assistantSid, + + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/Queries'; + } + + /** + * Create the QueryInstance + * + * @param string $language An ISO language-country string of the sample. + * @param string $query A user-provided string that uniquely identifies this resource as an alternative to the sid. It can be up to 2048 characters long. + * @param array|Options $options Optional Arguments + * @return QueryInstance Created QueryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $language, string $query, array $options = []): QueryInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Language' => + $language, + 'Query' => + $query, + 'Tasks' => + $options['tasks'], + 'ModelBuild' => + $options['modelBuild'], + 'Field' => + $options['field'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new QueryInstance( + $this->version, + $payload, + $this->solution['assistantSid'] + ); + } + + + /** + * Reads QueryInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return QueryInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams QueryInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of QueryInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return QueryPage Page of QueryInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): QueryPage + { + $options = new Values($options); + + $params = Values::of([ + 'Language' => + $options['language'], + 'ModelBuild' => + $options['modelBuild'], + 'Status' => + $options['status'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new QueryPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of QueryInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return QueryPage Page of QueryInstance + */ + public function getPage(string $targetUrl): QueryPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new QueryPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a QueryContext + * + * @param string $sid A 34 character string that uniquely identifies this resource. + */ + public function getContext( + string $sid + + ): QueryContext + { + return new QueryContext( + $this->version, + $this->solution['assistantSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Understand.QueryList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/QueryOptions.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/QueryOptions.php new file mode 100755 index 0000000..44d2714 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/QueryOptions.php @@ -0,0 +1,274 @@ +options['tasks'] = $tasks; + $this->options['modelBuild'] = $modelBuild; + $this->options['field'] = $field; + } + + /** + * Constraints the query to a set of tasks. Useful when you need to constrain the paths the user can take. Tasks should be comma separated *task-unique-name-1*, *task-unique-name-2* + * + * @param string $tasks Constraints the query to a set of tasks. Useful when you need to constrain the paths the user can take. Tasks should be comma separated *task-unique-name-1*, *task-unique-name-2* + * @return $this Fluent Builder + */ + public function setTasks(string $tasks): self + { + $this->options['tasks'] = $tasks; + return $this; + } + + /** + * The Model Build Sid or unique name of the Model Build to be queried. + * + * @param string $modelBuild The Model Build Sid or unique name of the Model Build to be queried. + * @return $this Fluent Builder + */ + public function setModelBuild(string $modelBuild): self + { + $this->options['modelBuild'] = $modelBuild; + return $this; + } + + /** + * Constraints the query to a given Field with an task. Useful when you know the Field you are expecting. It accepts one field in the format *task-unique-name-1*:*field-unique-name* + * + * @param string $field Constraints the query to a given Field with an task. Useful when you know the Field you are expecting. It accepts one field in the format *task-unique-name-1*:*field-unique-name* + * @return $this Fluent Builder + */ + public function setField(string $field): self + { + $this->options['field'] = $field; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Understand.CreateQueryOptions ' . $options . ']'; + } +} + + + +class ReadQueryOptions extends Options + { + /** + * @param string $language An ISO language-country string of the sample. + * @param string $modelBuild The Model Build Sid or unique name of the Model Build to be queried. + * @param string $status A string that described the query status. The values can be: pending_review, reviewed, discarded + */ + public function __construct( + + string $language = Values::NONE, + string $modelBuild = Values::NONE, + string $status = Values::NONE + + ) { + $this->options['language'] = $language; + $this->options['modelBuild'] = $modelBuild; + $this->options['status'] = $status; + } + + /** + * An ISO language-country string of the sample. + * + * @param string $language An ISO language-country string of the sample. + * @return $this Fluent Builder + */ + public function setLanguage(string $language): self + { + $this->options['language'] = $language; + return $this; + } + + /** + * The Model Build Sid or unique name of the Model Build to be queried. + * + * @param string $modelBuild The Model Build Sid or unique name of the Model Build to be queried. + * @return $this Fluent Builder + */ + public function setModelBuild(string $modelBuild): self + { + $this->options['modelBuild'] = $modelBuild; + return $this; + } + + /** + * A string that described the query status. The values can be: pending_review, reviewed, discarded + * + * @param string $status A string that described the query status. The values can be: pending_review, reviewed, discarded + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Understand.ReadQueryOptions ' . $options . ']'; + } +} + +class UpdateQueryOptions extends Options + { + /** + * @param string $sampleSid An optional reference to the Sample created from this query. + * @param string $status A string that described the query status. The values can be: pending_review, reviewed, discarded + */ + public function __construct( + + string $sampleSid = Values::NONE, + string $status = Values::NONE + + ) { + $this->options['sampleSid'] = $sampleSid; + $this->options['status'] = $status; + } + + /** + * An optional reference to the Sample created from this query. + * + * @param string $sampleSid An optional reference to the Sample created from this query. + * @return $this Fluent Builder + */ + public function setSampleSid(string $sampleSid): self + { + $this->options['sampleSid'] = $sampleSid; + return $this; + } + + /** + * A string that described the query status. The values can be: pending_review, reviewed, discarded + * + * @param string $status A string that described the query status. The values can be: pending_review, reviewed, discarded + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Understand.UpdateQueryOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/QueryPage.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/QueryPage.php new file mode 100755 index 0000000..22f7012 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/QueryPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return QueryInstance \Twilio\Rest\Preview\Understand\Assistant\QueryInstance + */ + public function buildInstance(array $payload): QueryInstance + { + return new QueryInstance($this->version, $payload, $this->solution['assistantSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Understand.QueryPage]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/StyleSheetContext.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/StyleSheetContext.php new file mode 100755 index 0000000..3280c70 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/StyleSheetContext.php @@ -0,0 +1,111 @@ +solution = [ + 'assistantSid' => + $assistantSid, + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/StyleSheet'; + } + + /** + * Fetch the StyleSheetInstance + * + * @return StyleSheetInstance Fetched StyleSheetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): StyleSheetInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new StyleSheetInstance( + $this->version, + $payload, + $this->solution['assistantSid'] + ); + } + + + /** + * Update the StyleSheetInstance + * + * @param array|Options $options Optional Arguments + * @return StyleSheetInstance Updated StyleSheetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): StyleSheetInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'StyleSheet' => + Serialize::jsonObject($options['styleSheet']), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new StyleSheetInstance( + $this->version, + $payload, + $this->solution['assistantSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Understand.StyleSheetContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/StyleSheetInstance.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/StyleSheetInstance.php new file mode 100755 index 0000000..034c99c --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/StyleSheetInstance.php @@ -0,0 +1,135 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'assistantSid' => Values::array_get($payload, 'assistant_sid'), + 'url' => Values::array_get($payload, 'url'), + 'data' => Values::array_get($payload, 'data'), + ]; + + $this->solution = ['assistantSid' => $assistantSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return StyleSheetContext Context for this StyleSheetInstance + */ + protected function proxy(): StyleSheetContext + { + if (!$this->context) { + $this->context = new StyleSheetContext( + $this->version, + $this->solution['assistantSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the StyleSheetInstance + * + * @return StyleSheetInstance Fetched StyleSheetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): StyleSheetInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the StyleSheetInstance + * + * @param array|Options $options Optional Arguments + * @return StyleSheetInstance Updated StyleSheetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): StyleSheetInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Understand.StyleSheetInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/StyleSheetList.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/StyleSheetList.php new file mode 100755 index 0000000..3945724 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/StyleSheetList.php @@ -0,0 +1,67 @@ +solution = [ + 'assistantSid' => + $assistantSid, + + ]; + } + + /** + * Constructs a StyleSheetContext + */ + public function getContext( + + ): StyleSheetContext + { + return new StyleSheetContext( + $this->version, + $this->solution['assistantSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Understand.StyleSheetList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/StyleSheetOptions.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/StyleSheetOptions.php new file mode 100755 index 0000000..997e07f --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/StyleSheetOptions.php @@ -0,0 +1,78 @@ +options['styleSheet'] = $styleSheet; + } + + /** + * The JSON Style sheet string + * + * @param array $styleSheet The JSON Style sheet string + * @return $this Fluent Builder + */ + public function setStyleSheet(array $styleSheet): self + { + $this->options['styleSheet'] = $styleSheet; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Understand.UpdateStyleSheetOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/StyleSheetPage.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/StyleSheetPage.php new file mode 100755 index 0000000..7965e85 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/StyleSheetPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return StyleSheetInstance \Twilio\Rest\Preview\Understand\Assistant\StyleSheetInstance + */ + public function buildInstance(array $payload): StyleSheetInstance + { + return new StyleSheetInstance($this->version, $payload, $this->solution['assistantSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Understand.StyleSheetPage]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/FieldContext.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/FieldContext.php new file mode 100755 index 0000000..73b9a9e --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/FieldContext.php @@ -0,0 +1,106 @@ +solution = [ + 'assistantSid' => + $assistantSid, + 'taskSid' => + $taskSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/Tasks/' . \rawurlencode($taskSid) + .'/Fields/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the FieldInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the FieldInstance + * + * @return FieldInstance Fetched FieldInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FieldInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new FieldInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['taskSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Understand.FieldContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/FieldInstance.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/FieldInstance.php new file mode 100755 index 0000000..c077e82 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/FieldInstance.php @@ -0,0 +1,148 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'fieldType' => Values::array_get($payload, 'field_type'), + 'taskSid' => Values::array_get($payload, 'task_sid'), + 'assistantSid' => Values::array_get($payload, 'assistant_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['assistantSid' => $assistantSid, 'taskSid' => $taskSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return FieldContext Context for this FieldInstance + */ + protected function proxy(): FieldContext + { + if (!$this->context) { + $this->context = new FieldContext( + $this->version, + $this->solution['assistantSid'], + $this->solution['taskSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the FieldInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the FieldInstance + * + * @return FieldInstance Fetched FieldInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FieldInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Understand.FieldInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/FieldList.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/FieldList.php new file mode 100755 index 0000000..d7f9fd8 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/FieldList.php @@ -0,0 +1,205 @@ +solution = [ + 'assistantSid' => + $assistantSid, + + 'taskSid' => + $taskSid, + + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/Tasks/' . \rawurlencode($taskSid) + .'/Fields'; + } + + /** + * Create the FieldInstance + * + * @param string $fieldType The unique name or sid of the FieldType. It can be any [Built-in Field Type](https://www.twilio.com/docs/assistant/api/built-in-field-types) or the unique_name or the Field Type sid of a custom Field Type. + * @param string $uniqueName A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. + * @return FieldInstance Created FieldInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $fieldType, string $uniqueName): FieldInstance + { + + $data = Values::of([ + 'FieldType' => + $fieldType, + 'UniqueName' => + $uniqueName, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new FieldInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['taskSid'] + ); + } + + + /** + * Reads FieldInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return FieldInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams FieldInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of FieldInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return FieldPage Page of FieldInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): FieldPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new FieldPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of FieldInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return FieldPage Page of FieldInstance + */ + public function getPage(string $targetUrl): FieldPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new FieldPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a FieldContext + * + * @param string $sid A 34 character string that uniquely identifies this resource. + */ + public function getContext( + string $sid + + ): FieldContext + { + return new FieldContext( + $this->version, + $this->solution['assistantSid'], + $this->solution['taskSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Understand.FieldList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/FieldPage.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/FieldPage.php new file mode 100755 index 0000000..b50d7f6 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/FieldPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return FieldInstance \Twilio\Rest\Preview\Understand\Assistant\Task\FieldInstance + */ + public function buildInstance(array $payload): FieldInstance + { + return new FieldInstance($this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Understand.FieldPage]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/SampleContext.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/SampleContext.php new file mode 100755 index 0000000..c4a62f1 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/SampleContext.php @@ -0,0 +1,141 @@ +solution = [ + 'assistantSid' => + $assistantSid, + 'taskSid' => + $taskSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/Tasks/' . \rawurlencode($taskSid) + .'/Samples/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the SampleInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the SampleInstance + * + * @return SampleInstance Fetched SampleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SampleInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new SampleInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['taskSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the SampleInstance + * + * @param array|Options $options Optional Arguments + * @return SampleInstance Updated SampleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SampleInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Language' => + $options['language'], + 'TaggedText' => + $options['taggedText'], + 'SourceChannel' => + $options['sourceChannel'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new SampleInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['taskSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Understand.SampleContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/SampleInstance.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/SampleInstance.php new file mode 100755 index 0000000..fdf20e5 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/SampleInstance.php @@ -0,0 +1,164 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'taskSid' => Values::array_get($payload, 'task_sid'), + 'language' => Values::array_get($payload, 'language'), + 'assistantSid' => Values::array_get($payload, 'assistant_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'taggedText' => Values::array_get($payload, 'tagged_text'), + 'url' => Values::array_get($payload, 'url'), + 'sourceChannel' => Values::array_get($payload, 'source_channel'), + ]; + + $this->solution = ['assistantSid' => $assistantSid, 'taskSid' => $taskSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SampleContext Context for this SampleInstance + */ + protected function proxy(): SampleContext + { + if (!$this->context) { + $this->context = new SampleContext( + $this->version, + $this->solution['assistantSid'], + $this->solution['taskSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the SampleInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SampleInstance + * + * @return SampleInstance Fetched SampleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SampleInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SampleInstance + * + * @param array|Options $options Optional Arguments + * @return SampleInstance Updated SampleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SampleInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Understand.SampleInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/SampleList.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/SampleList.php new file mode 100755 index 0000000..e1ac32a --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/SampleList.php @@ -0,0 +1,217 @@ +solution = [ + 'assistantSid' => + $assistantSid, + + 'taskSid' => + $taskSid, + + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/Tasks/' . \rawurlencode($taskSid) + .'/Samples'; + } + + /** + * Create the SampleInstance + * + * @param string $language An ISO language-country string of the sample. + * @param string $taggedText The text example of how end-users may express this task. The sample may contain Field tag blocks. + * @param array|Options $options Optional Arguments + * @return SampleInstance Created SampleInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $language, string $taggedText, array $options = []): SampleInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Language' => + $language, + 'TaggedText' => + $taggedText, + 'SourceChannel' => + $options['sourceChannel'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new SampleInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['taskSid'] + ); + } + + + /** + * Reads SampleInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return SampleInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams SampleInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SampleInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return SamplePage Page of SampleInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SamplePage + { + $options = new Values($options); + + $params = Values::of([ + 'Language' => + $options['language'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SamplePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SampleInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SamplePage Page of SampleInstance + */ + public function getPage(string $targetUrl): SamplePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SamplePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SampleContext + * + * @param string $sid A 34 character string that uniquely identifies this resource. + */ + public function getContext( + string $sid + + ): SampleContext + { + return new SampleContext( + $this->version, + $this->solution['assistantSid'], + $this->solution['taskSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Understand.SampleList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/SampleOptions.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/SampleOptions.php new file mode 100755 index 0000000..ee0e6b4 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/SampleOptions.php @@ -0,0 +1,220 @@ +options['sourceChannel'] = $sourceChannel; + } + + /** + * The communication channel the sample was captured. It can be: *voice*, *sms*, *chat*, *alexa*, *google-assistant*, or *slack*. If not included the value will be null + * + * @param string $sourceChannel The communication channel the sample was captured. It can be: *voice*, *sms*, *chat*, *alexa*, *google-assistant*, or *slack*. If not included the value will be null + * @return $this Fluent Builder + */ + public function setSourceChannel(string $sourceChannel): self + { + $this->options['sourceChannel'] = $sourceChannel; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Understand.CreateSampleOptions ' . $options . ']'; + } +} + + + +class ReadSampleOptions extends Options + { + /** + * @param string $language An ISO language-country string of the sample. + */ + public function __construct( + + string $language = Values::NONE + + ) { + $this->options['language'] = $language; + } + + /** + * An ISO language-country string of the sample. + * + * @param string $language An ISO language-country string of the sample. + * @return $this Fluent Builder + */ + public function setLanguage(string $language): self + { + $this->options['language'] = $language; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Understand.ReadSampleOptions ' . $options . ']'; + } +} + +class UpdateSampleOptions extends Options + { + /** + * @param string $language An ISO language-country string of the sample. + * @param string $taggedText The text example of how end-users may express this task. The sample may contain Field tag blocks. + * @param string $sourceChannel The communication channel the sample was captured. It can be: *voice*, *sms*, *chat*, *alexa*, *google-assistant*, or *slack*. If not included the value will be null + */ + public function __construct( + + string $language = Values::NONE, + string $taggedText = Values::NONE, + string $sourceChannel = Values::NONE + + ) { + $this->options['language'] = $language; + $this->options['taggedText'] = $taggedText; + $this->options['sourceChannel'] = $sourceChannel; + } + + /** + * An ISO language-country string of the sample. + * + * @param string $language An ISO language-country string of the sample. + * @return $this Fluent Builder + */ + public function setLanguage(string $language): self + { + $this->options['language'] = $language; + return $this; + } + + /** + * The text example of how end-users may express this task. The sample may contain Field tag blocks. + * + * @param string $taggedText The text example of how end-users may express this task. The sample may contain Field tag blocks. + * @return $this Fluent Builder + */ + public function setTaggedText(string $taggedText): self + { + $this->options['taggedText'] = $taggedText; + return $this; + } + + /** + * The communication channel the sample was captured. It can be: *voice*, *sms*, *chat*, *alexa*, *google-assistant*, or *slack*. If not included the value will be null + * + * @param string $sourceChannel The communication channel the sample was captured. It can be: *voice*, *sms*, *chat*, *alexa*, *google-assistant*, or *slack*. If not included the value will be null + * @return $this Fluent Builder + */ + public function setSourceChannel(string $sourceChannel): self + { + $this->options['sourceChannel'] = $sourceChannel; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Understand.UpdateSampleOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/SamplePage.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/SamplePage.php new file mode 100755 index 0000000..bf03113 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/SamplePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SampleInstance \Twilio\Rest\Preview\Understand\Assistant\Task\SampleInstance + */ + public function buildInstance(array $payload): SampleInstance + { + return new SampleInstance($this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Understand.SamplePage]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/TaskActionsContext.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/TaskActionsContext.php new file mode 100755 index 0000000..91e1656 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/TaskActionsContext.php @@ -0,0 +1,118 @@ +solution = [ + 'assistantSid' => + $assistantSid, + 'taskSid' => + $taskSid, + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/Tasks/' . \rawurlencode($taskSid) + .'/Actions'; + } + + /** + * Fetch the TaskActionsInstance + * + * @return TaskActionsInstance Fetched TaskActionsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TaskActionsInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new TaskActionsInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['taskSid'] + ); + } + + + /** + * Update the TaskActionsInstance + * + * @param array|Options $options Optional Arguments + * @return TaskActionsInstance Updated TaskActionsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TaskActionsInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Actions' => + Serialize::jsonObject($options['actions']), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new TaskActionsInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['taskSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Understand.TaskActionsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/TaskActionsInstance.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/TaskActionsInstance.php new file mode 100755 index 0000000..fa919e3 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/TaskActionsInstance.php @@ -0,0 +1,139 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'assistantSid' => Values::array_get($payload, 'assistant_sid'), + 'taskSid' => Values::array_get($payload, 'task_sid'), + 'url' => Values::array_get($payload, 'url'), + 'data' => Values::array_get($payload, 'data'), + ]; + + $this->solution = ['assistantSid' => $assistantSid, 'taskSid' => $taskSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return TaskActionsContext Context for this TaskActionsInstance + */ + protected function proxy(): TaskActionsContext + { + if (!$this->context) { + $this->context = new TaskActionsContext( + $this->version, + $this->solution['assistantSid'], + $this->solution['taskSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the TaskActionsInstance + * + * @return TaskActionsInstance Fetched TaskActionsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TaskActionsInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the TaskActionsInstance + * + * @param array|Options $options Optional Arguments + * @return TaskActionsInstance Updated TaskActionsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TaskActionsInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Understand.TaskActionsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/TaskActionsList.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/TaskActionsList.php new file mode 100755 index 0000000..2309bee --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/TaskActionsList.php @@ -0,0 +1,73 @@ +solution = [ + 'assistantSid' => + $assistantSid, + + 'taskSid' => + $taskSid, + + ]; + } + + /** + * Constructs a TaskActionsContext + */ + public function getContext( + + ): TaskActionsContext + { + return new TaskActionsContext( + $this->version, + $this->solution['assistantSid'], + $this->solution['taskSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Understand.TaskActionsList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/TaskActionsOptions.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/TaskActionsOptions.php new file mode 100755 index 0000000..3926115 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/TaskActionsOptions.php @@ -0,0 +1,78 @@ +options['actions'] = $actions; + } + + /** + * The JSON actions that instruct the Assistant how to perform this task. + * + * @param array $actions The JSON actions that instruct the Assistant how to perform this task. + * @return $this Fluent Builder + */ + public function setActions(array $actions): self + { + $this->options['actions'] = $actions; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Understand.UpdateTaskActionsOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/TaskActionsPage.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/TaskActionsPage.php new file mode 100755 index 0000000..71ada3c --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/TaskActionsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TaskActionsInstance \Twilio\Rest\Preview\Understand\Assistant\Task\TaskActionsInstance + */ + public function buildInstance(array $payload): TaskActionsInstance + { + return new TaskActionsInstance($this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Understand.TaskActionsPage]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/TaskStatisticsContext.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/TaskStatisticsContext.php new file mode 100755 index 0000000..76c4f05 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/TaskStatisticsContext.php @@ -0,0 +1,87 @@ +solution = [ + 'assistantSid' => + $assistantSid, + 'taskSid' => + $taskSid, + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/Tasks/' . \rawurlencode($taskSid) + .'/Statistics'; + } + + /** + * Fetch the TaskStatisticsInstance + * + * @return TaskStatisticsInstance Fetched TaskStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TaskStatisticsInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new TaskStatisticsInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['taskSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Understand.TaskStatisticsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/TaskStatisticsInstance.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/TaskStatisticsInstance.php new file mode 100755 index 0000000..c04c9d4 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/TaskStatisticsInstance.php @@ -0,0 +1,127 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'assistantSid' => Values::array_get($payload, 'assistant_sid'), + 'taskSid' => Values::array_get($payload, 'task_sid'), + 'samplesCount' => Values::array_get($payload, 'samples_count'), + 'fieldsCount' => Values::array_get($payload, 'fields_count'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['assistantSid' => $assistantSid, 'taskSid' => $taskSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return TaskStatisticsContext Context for this TaskStatisticsInstance + */ + protected function proxy(): TaskStatisticsContext + { + if (!$this->context) { + $this->context = new TaskStatisticsContext( + $this->version, + $this->solution['assistantSid'], + $this->solution['taskSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the TaskStatisticsInstance + * + * @return TaskStatisticsInstance Fetched TaskStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TaskStatisticsInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Understand.TaskStatisticsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/TaskStatisticsList.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/TaskStatisticsList.php new file mode 100755 index 0000000..1bbfb71 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/TaskStatisticsList.php @@ -0,0 +1,73 @@ +solution = [ + 'assistantSid' => + $assistantSid, + + 'taskSid' => + $taskSid, + + ]; + } + + /** + * Constructs a TaskStatisticsContext + */ + public function getContext( + + ): TaskStatisticsContext + { + return new TaskStatisticsContext( + $this->version, + $this->solution['assistantSid'], + $this->solution['taskSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Understand.TaskStatisticsList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/TaskStatisticsPage.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/TaskStatisticsPage.php new file mode 100755 index 0000000..1c4c664 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/Task/TaskStatisticsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TaskStatisticsInstance \Twilio\Rest\Preview\Understand\Assistant\Task\TaskStatisticsInstance + */ + public function buildInstance(array $payload): TaskStatisticsInstance + { + return new TaskStatisticsInstance($this->version, $payload, $this->solution['assistantSid'], $this->solution['taskSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Understand.TaskStatisticsPage]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/TaskContext.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/TaskContext.php new file mode 100755 index 0000000..b8f5831 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/TaskContext.php @@ -0,0 +1,256 @@ +solution = [ + 'assistantSid' => + $assistantSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/Tasks/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the TaskInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the TaskInstance + * + * @return TaskInstance Fetched TaskInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TaskInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new TaskInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the TaskInstance + * + * @param array|Options $options Optional Arguments + * @return TaskInstance Updated TaskInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TaskInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'UniqueName' => + $options['uniqueName'], + 'Actions' => + Serialize::jsonObject($options['actions']), + 'ActionsUrl' => + $options['actionsUrl'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new TaskInstance( + $this->version, + $payload, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the samples + */ + protected function getSamples(): SampleList + { + if (!$this->_samples) { + $this->_samples = new SampleList( + $this->version, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + return $this->_samples; + } + + /** + * Access the fields + */ + protected function getFields(): FieldList + { + if (!$this->_fields) { + $this->_fields = new FieldList( + $this->version, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + return $this->_fields; + } + + /** + * Access the taskActions + */ + protected function getTaskActions(): TaskActionsList + { + if (!$this->_taskActions) { + $this->_taskActions = new TaskActionsList( + $this->version, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + return $this->_taskActions; + } + + /** + * Access the statistics + */ + protected function getStatistics(): TaskStatisticsList + { + if (!$this->_statistics) { + $this->_statistics = new TaskStatisticsList( + $this->version, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + return $this->_statistics; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Understand.TaskContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/TaskInstance.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/TaskInstance.php new file mode 100755 index 0000000..cd45cde --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/TaskInstance.php @@ -0,0 +1,203 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'links' => Values::array_get($payload, 'links'), + 'assistantSid' => Values::array_get($payload, 'assistant_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'actionsUrl' => Values::array_get($payload, 'actions_url'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['assistantSid' => $assistantSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return TaskContext Context for this TaskInstance + */ + protected function proxy(): TaskContext + { + if (!$this->context) { + $this->context = new TaskContext( + $this->version, + $this->solution['assistantSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the TaskInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the TaskInstance + * + * @return TaskInstance Fetched TaskInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TaskInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the TaskInstance + * + * @param array|Options $options Optional Arguments + * @return TaskInstance Updated TaskInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TaskInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the samples + */ + protected function getSamples(): SampleList + { + return $this->proxy()->samples; + } + + /** + * Access the fields + */ + protected function getFields(): FieldList + { + return $this->proxy()->fields; + } + + /** + * Access the taskActions + */ + protected function getTaskActions(): TaskActionsList + { + return $this->proxy()->taskActions; + } + + /** + * Access the statistics + */ + protected function getStatistics(): TaskStatisticsList + { + return $this->proxy()->statistics; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Understand.TaskInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/TaskList.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/TaskList.php new file mode 100755 index 0000000..e3680cb --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/TaskList.php @@ -0,0 +1,205 @@ +solution = [ + 'assistantSid' => + $assistantSid, + + ]; + + $this->uri = '/Assistants/' . \rawurlencode($assistantSid) + .'/Tasks'; + } + + /** + * Create the TaskInstance + * + * @param string $uniqueName A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. + * @param array|Options $options Optional Arguments + * @return TaskInstance Created TaskInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $uniqueName, array $options = []): TaskInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $uniqueName, + 'FriendlyName' => + $options['friendlyName'], + 'Actions' => + Serialize::jsonObject($options['actions']), + 'ActionsUrl' => + $options['actionsUrl'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new TaskInstance( + $this->version, + $payload, + $this->solution['assistantSid'] + ); + } + + + /** + * Reads TaskInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return TaskInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams TaskInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of TaskInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return TaskPage Page of TaskInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): TaskPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new TaskPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of TaskInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return TaskPage Page of TaskInstance + */ + public function getPage(string $targetUrl): TaskPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new TaskPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a TaskContext + * + * @param string $sid A 34 character string that uniquely identifies this resource. + */ + public function getContext( + string $sid + + ): TaskContext + { + return new TaskContext( + $this->version, + $this->solution['assistantSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Understand.TaskList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/TaskOptions.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/TaskOptions.php new file mode 100755 index 0000000..06ad740 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/TaskOptions.php @@ -0,0 +1,224 @@ +options['friendlyName'] = $friendlyName; + $this->options['actions'] = $actions; + $this->options['actionsUrl'] = $actionsUrl; + } + + /** + * A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. + * + * @param string $friendlyName A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * A user-provided JSON object encoded as a string to specify the actions for this task. It is optional and non-unique. + * + * @param array $actions A user-provided JSON object encoded as a string to specify the actions for this task. It is optional and non-unique. + * @return $this Fluent Builder + */ + public function setActions(array $actions): self + { + $this->options['actions'] = $actions; + return $this; + } + + /** + * User-provided HTTP endpoint where from the assistant fetches actions + * + * @param string $actionsUrl User-provided HTTP endpoint where from the assistant fetches actions + * @return $this Fluent Builder + */ + public function setActionsUrl(string $actionsUrl): self + { + $this->options['actionsUrl'] = $actionsUrl; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Understand.CreateTaskOptions ' . $options . ']'; + } +} + + + + +class UpdateTaskOptions extends Options + { + /** + * @param string $friendlyName A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. + * @param string $uniqueName A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. + * @param array $actions A user-provided JSON object encoded as a string to specify the actions for this task. It is optional and non-unique. + * @param string $actionsUrl User-provided HTTP endpoint where from the assistant fetches actions + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $uniqueName = Values::NONE, + array $actions = Values::ARRAY_NONE, + string $actionsUrl = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['uniqueName'] = $uniqueName; + $this->options['actions'] = $actions; + $this->options['actionsUrl'] = $actionsUrl; + } + + /** + * A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. + * + * @param string $friendlyName A user-provided string that identifies this resource. It is non-unique and can up to 255 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. + * + * @param string $uniqueName A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * A user-provided JSON object encoded as a string to specify the actions for this task. It is optional and non-unique. + * + * @param array $actions A user-provided JSON object encoded as a string to specify the actions for this task. It is optional and non-unique. + * @return $this Fluent Builder + */ + public function setActions(array $actions): self + { + $this->options['actions'] = $actions; + return $this; + } + + /** + * User-provided HTTP endpoint where from the assistant fetches actions + * + * @param string $actionsUrl User-provided HTTP endpoint where from the assistant fetches actions + * @return $this Fluent Builder + */ + public function setActionsUrl(string $actionsUrl): self + { + $this->options['actionsUrl'] = $actionsUrl; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Understand.UpdateTaskOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Understand/Assistant/TaskPage.php b/app/api/Twilio/Rest/Preview/Understand/Assistant/TaskPage.php new file mode 100755 index 0000000..34fcff3 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/Assistant/TaskPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TaskInstance \Twilio\Rest\Preview\Understand\Assistant\TaskInstance + */ + public function buildInstance(array $payload): TaskInstance + { + return new TaskInstance($this->version, $payload, $this->solution['assistantSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Understand.TaskPage]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/AssistantContext.php b/app/api/Twilio/Rest/Preview/Understand/AssistantContext.php new file mode 100755 index 0000000..898887b --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/AssistantContext.php @@ -0,0 +1,329 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Assistants/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the AssistantInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the AssistantInstance + * + * @return AssistantInstance Fetched AssistantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AssistantInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new AssistantInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the AssistantInstance + * + * @param array|Options $options Optional Arguments + * @return AssistantInstance Updated AssistantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): AssistantInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'LogQueries' => + Serialize::booleanToString($options['logQueries']), + 'UniqueName' => + $options['uniqueName'], + 'CallbackUrl' => + $options['callbackUrl'], + 'CallbackEvents' => + $options['callbackEvents'], + 'FallbackActions' => + Serialize::jsonObject($options['fallbackActions']), + 'InitiationActions' => + Serialize::jsonObject($options['initiationActions']), + 'StyleSheet' => + Serialize::jsonObject($options['styleSheet']), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new AssistantInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the fieldTypes + */ + protected function getFieldTypes(): FieldTypeList + { + if (!$this->_fieldTypes) { + $this->_fieldTypes = new FieldTypeList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_fieldTypes; + } + + /** + * Access the queries + */ + protected function getQueries(): QueryList + { + if (!$this->_queries) { + $this->_queries = new QueryList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_queries; + } + + /** + * Access the tasks + */ + protected function getTasks(): TaskList + { + if (!$this->_tasks) { + $this->_tasks = new TaskList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_tasks; + } + + /** + * Access the modelBuilds + */ + protected function getModelBuilds(): ModelBuildList + { + if (!$this->_modelBuilds) { + $this->_modelBuilds = new ModelBuildList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_modelBuilds; + } + + /** + * Access the assistantFallbackActions + */ + protected function getAssistantFallbackActions(): AssistantFallbackActionsList + { + if (!$this->_assistantFallbackActions) { + $this->_assistantFallbackActions = new AssistantFallbackActionsList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_assistantFallbackActions; + } + + /** + * Access the assistantInitiationActions + */ + protected function getAssistantInitiationActions(): AssistantInitiationActionsList + { + if (!$this->_assistantInitiationActions) { + $this->_assistantInitiationActions = new AssistantInitiationActionsList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_assistantInitiationActions; + } + + /** + * Access the styleSheet + */ + protected function getStyleSheet(): StyleSheetList + { + if (!$this->_styleSheet) { + $this->_styleSheet = new StyleSheetList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_styleSheet; + } + + /** + * Access the dialogues + */ + protected function getDialogues(): DialogueList + { + if (!$this->_dialogues) { + $this->_dialogues = new DialogueList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_dialogues; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Understand.AssistantContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/AssistantInstance.php b/app/api/Twilio/Rest/Preview/Understand/AssistantInstance.php new file mode 100755 index 0000000..30fd7d2 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/AssistantInstance.php @@ -0,0 +1,245 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'latestModelBuildSid' => Values::array_get($payload, 'latest_model_build_sid'), + 'links' => Values::array_get($payload, 'links'), + 'logQueries' => Values::array_get($payload, 'log_queries'), + 'sid' => Values::array_get($payload, 'sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'url' => Values::array_get($payload, 'url'), + 'callbackUrl' => Values::array_get($payload, 'callback_url'), + 'callbackEvents' => Values::array_get($payload, 'callback_events'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AssistantContext Context for this AssistantInstance + */ + protected function proxy(): AssistantContext + { + if (!$this->context) { + $this->context = new AssistantContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the AssistantInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the AssistantInstance + * + * @return AssistantInstance Fetched AssistantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AssistantInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the AssistantInstance + * + * @param array|Options $options Optional Arguments + * @return AssistantInstance Updated AssistantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): AssistantInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the fieldTypes + */ + protected function getFieldTypes(): FieldTypeList + { + return $this->proxy()->fieldTypes; + } + + /** + * Access the queries + */ + protected function getQueries(): QueryList + { + return $this->proxy()->queries; + } + + /** + * Access the tasks + */ + protected function getTasks(): TaskList + { + return $this->proxy()->tasks; + } + + /** + * Access the modelBuilds + */ + protected function getModelBuilds(): ModelBuildList + { + return $this->proxy()->modelBuilds; + } + + /** + * Access the assistantFallbackActions + */ + protected function getAssistantFallbackActions(): AssistantFallbackActionsList + { + return $this->proxy()->assistantFallbackActions; + } + + /** + * Access the assistantInitiationActions + */ + protected function getAssistantInitiationActions(): AssistantInitiationActionsList + { + return $this->proxy()->assistantInitiationActions; + } + + /** + * Access the styleSheet + */ + protected function getStyleSheet(): StyleSheetList + { + return $this->proxy()->styleSheet; + } + + /** + * Access the dialogues + */ + protected function getDialogues(): DialogueList + { + return $this->proxy()->dialogues; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Understand.AssistantInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Understand/AssistantList.php b/app/api/Twilio/Rest/Preview/Understand/AssistantList.php new file mode 100755 index 0000000..386a7bb --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/AssistantList.php @@ -0,0 +1,204 @@ +solution = [ + ]; + + $this->uri = '/Assistants'; + } + + /** + * Create the AssistantInstance + * + * @param array|Options $options Optional Arguments + * @return AssistantInstance Created AssistantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): AssistantInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'LogQueries' => + Serialize::booleanToString($options['logQueries']), + 'UniqueName' => + $options['uniqueName'], + 'CallbackUrl' => + $options['callbackUrl'], + 'CallbackEvents' => + $options['callbackEvents'], + 'FallbackActions' => + Serialize::jsonObject($options['fallbackActions']), + 'InitiationActions' => + Serialize::jsonObject($options['initiationActions']), + 'StyleSheet' => + Serialize::jsonObject($options['styleSheet']), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new AssistantInstance( + $this->version, + $payload + ); + } + + + /** + * Reads AssistantInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return AssistantInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams AssistantInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AssistantInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return AssistantPage Page of AssistantInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AssistantPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new AssistantPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of AssistantInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return AssistantPage Page of AssistantInstance + */ + public function getPage(string $targetUrl): AssistantPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AssistantPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AssistantContext + * + * @param string $sid A 34 character string that uniquely identifies this resource. + */ + public function getContext( + string $sid + + ): AssistantContext + { + return new AssistantContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Understand.AssistantList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Understand/AssistantOptions.php b/app/api/Twilio/Rest/Preview/Understand/AssistantOptions.php new file mode 100755 index 0000000..caa13f9 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/AssistantOptions.php @@ -0,0 +1,386 @@ +options['friendlyName'] = $friendlyName; + $this->options['logQueries'] = $logQueries; + $this->options['uniqueName'] = $uniqueName; + $this->options['callbackUrl'] = $callbackUrl; + $this->options['callbackEvents'] = $callbackEvents; + $this->options['fallbackActions'] = $fallbackActions; + $this->options['initiationActions'] = $initiationActions; + $this->options['styleSheet'] = $styleSheet; + } + + /** + * A text description for the Assistant. It is non-unique and can up to 255 characters long. + * + * @param string $friendlyName A text description for the Assistant. It is non-unique and can up to 255 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. Defaults to true if no value is provided. + * + * @param bool $logQueries A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. Defaults to true if no value is provided. + * @return $this Fluent Builder + */ + public function setLogQueries(bool $logQueries): self + { + $this->options['logQueries'] = $logQueries; + return $this; + } + + /** + * A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. + * + * @param string $uniqueName A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * A user-provided URL to send event callbacks to. + * + * @param string $callbackUrl A user-provided URL to send event callbacks to. + * @return $this Fluent Builder + */ + public function setCallbackUrl(string $callbackUrl): self + { + $this->options['callbackUrl'] = $callbackUrl; + return $this; + } + + /** + * Space-separated list of callback events that will trigger callbacks. + * + * @param string $callbackEvents Space-separated list of callback events that will trigger callbacks. + * @return $this Fluent Builder + */ + public function setCallbackEvents(string $callbackEvents): self + { + $this->options['callbackEvents'] = $callbackEvents; + return $this; + } + + /** + * The JSON actions to be executed when the user's input is not recognized as matching any Task. + * + * @param array $fallbackActions The JSON actions to be executed when the user's input is not recognized as matching any Task. + * @return $this Fluent Builder + */ + public function setFallbackActions(array $fallbackActions): self + { + $this->options['fallbackActions'] = $fallbackActions; + return $this; + } + + /** + * The JSON actions to be executed on inbound phone calls when the Assistant has to say something first. + * + * @param array $initiationActions The JSON actions to be executed on inbound phone calls when the Assistant has to say something first. + * @return $this Fluent Builder + */ + public function setInitiationActions(array $initiationActions): self + { + $this->options['initiationActions'] = $initiationActions; + return $this; + } + + /** + * The JSON object that holds the style sheet for the assistant + * + * @param array $styleSheet The JSON object that holds the style sheet for the assistant + * @return $this Fluent Builder + */ + public function setStyleSheet(array $styleSheet): self + { + $this->options['styleSheet'] = $styleSheet; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Understand.CreateAssistantOptions ' . $options . ']'; + } +} + + + + +class UpdateAssistantOptions extends Options + { + /** + * @param string $friendlyName A text description for the Assistant. It is non-unique and can up to 255 characters long. + * @param bool $logQueries A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. Defaults to true if no value is provided. + * @param string $uniqueName A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. + * @param string $callbackUrl A user-provided URL to send event callbacks to. + * @param string $callbackEvents Space-separated list of callback events that will trigger callbacks. + * @param array $fallbackActions The JSON actions to be executed when the user's input is not recognized as matching any Task. + * @param array $initiationActions The JSON actions to be executed on inbound phone calls when the Assistant has to say something first. + * @param array $styleSheet The JSON object that holds the style sheet for the assistant + */ + public function __construct( + + string $friendlyName = Values::NONE, + bool $logQueries = Values::BOOL_NONE, + string $uniqueName = Values::NONE, + string $callbackUrl = Values::NONE, + string $callbackEvents = Values::NONE, + array $fallbackActions = Values::ARRAY_NONE, + array $initiationActions = Values::ARRAY_NONE, + array $styleSheet = Values::ARRAY_NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['logQueries'] = $logQueries; + $this->options['uniqueName'] = $uniqueName; + $this->options['callbackUrl'] = $callbackUrl; + $this->options['callbackEvents'] = $callbackEvents; + $this->options['fallbackActions'] = $fallbackActions; + $this->options['initiationActions'] = $initiationActions; + $this->options['styleSheet'] = $styleSheet; + } + + /** + * A text description for the Assistant. It is non-unique and can up to 255 characters long. + * + * @param string $friendlyName A text description for the Assistant. It is non-unique and can up to 255 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. Defaults to true if no value is provided. + * + * @param bool $logQueries A boolean that specifies whether queries should be logged for 30 days further training. If false, no queries will be stored, if true, queries will be stored for 30 days and deleted thereafter. Defaults to true if no value is provided. + * @return $this Fluent Builder + */ + public function setLogQueries(bool $logQueries): self + { + $this->options['logQueries'] = $logQueries; + return $this; + } + + /** + * A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. + * + * @param string $uniqueName A user-provided string that uniquely identifies this resource as an alternative to the sid. Unique up to 64 characters long. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * A user-provided URL to send event callbacks to. + * + * @param string $callbackUrl A user-provided URL to send event callbacks to. + * @return $this Fluent Builder + */ + public function setCallbackUrl(string $callbackUrl): self + { + $this->options['callbackUrl'] = $callbackUrl; + return $this; + } + + /** + * Space-separated list of callback events that will trigger callbacks. + * + * @param string $callbackEvents Space-separated list of callback events that will trigger callbacks. + * @return $this Fluent Builder + */ + public function setCallbackEvents(string $callbackEvents): self + { + $this->options['callbackEvents'] = $callbackEvents; + return $this; + } + + /** + * The JSON actions to be executed when the user's input is not recognized as matching any Task. + * + * @param array $fallbackActions The JSON actions to be executed when the user's input is not recognized as matching any Task. + * @return $this Fluent Builder + */ + public function setFallbackActions(array $fallbackActions): self + { + $this->options['fallbackActions'] = $fallbackActions; + return $this; + } + + /** + * The JSON actions to be executed on inbound phone calls when the Assistant has to say something first. + * + * @param array $initiationActions The JSON actions to be executed on inbound phone calls when the Assistant has to say something first. + * @return $this Fluent Builder + */ + public function setInitiationActions(array $initiationActions): self + { + $this->options['initiationActions'] = $initiationActions; + return $this; + } + + /** + * The JSON object that holds the style sheet for the assistant + * + * @param array $styleSheet The JSON object that holds the style sheet for the assistant + * @return $this Fluent Builder + */ + public function setStyleSheet(array $styleSheet): self + { + $this->options['styleSheet'] = $styleSheet; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Understand.UpdateAssistantOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Understand/AssistantPage.php b/app/api/Twilio/Rest/Preview/Understand/AssistantPage.php new file mode 100755 index 0000000..ea84175 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Understand/AssistantPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AssistantInstance \Twilio\Rest\Preview\Understand\AssistantInstance + */ + public function buildInstance(array $payload): AssistantInstance + { + return new AssistantInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Understand.AssistantPage]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Wireless.php b/app/api/Twilio/Rest/Preview/Wireless.php new file mode 100755 index 0000000..46f6642 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Wireless.php @@ -0,0 +1,119 @@ +version = 'wireless'; + } + + protected function getCommands(): CommandList + { + if (!$this->_commands) { + $this->_commands = new CommandList($this); + } + return $this->_commands; + } + + protected function getRatePlans(): RatePlanList + { + if (!$this->_ratePlans) { + $this->_ratePlans = new RatePlanList($this); + } + return $this->_ratePlans; + } + + protected function getSims(): SimList + { + if (!$this->_sims) { + $this->_sims = new SimList($this); + } + return $this->_sims; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Wireless]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Wireless/CommandContext.php b/app/api/Twilio/Rest/Preview/Wireless/CommandContext.php new file mode 100755 index 0000000..55fb017 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Wireless/CommandContext.php @@ -0,0 +1,81 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Commands/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the CommandInstance + * + * @return CommandInstance Fetched CommandInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CommandInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new CommandInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Wireless.CommandContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Wireless/CommandInstance.php b/app/api/Twilio/Rest/Preview/Wireless/CommandInstance.php new file mode 100755 index 0000000..037e16e --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Wireless/CommandInstance.php @@ -0,0 +1,136 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'deviceSid' => Values::array_get($payload, 'device_sid'), + 'simSid' => Values::array_get($payload, 'sim_sid'), + 'command' => Values::array_get($payload, 'command'), + 'commandMode' => Values::array_get($payload, 'command_mode'), + 'status' => Values::array_get($payload, 'status'), + 'direction' => Values::array_get($payload, 'direction'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CommandContext Context for this CommandInstance + */ + protected function proxy(): CommandContext + { + if (!$this->context) { + $this->context = new CommandContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the CommandInstance + * + * @return CommandInstance Fetched CommandInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CommandInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Wireless.CommandInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Wireless/CommandList.php b/app/api/Twilio/Rest/Preview/Wireless/CommandList.php new file mode 100755 index 0000000..365d9ce --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Wireless/CommandList.php @@ -0,0 +1,214 @@ +solution = [ + ]; + + $this->uri = '/Commands'; + } + + /** + * Create the CommandInstance + * + * @param string $command + * @param array|Options $options Optional Arguments + * @return CommandInstance Created CommandInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $command, array $options = []): CommandInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Command' => + $command, + 'Device' => + $options['device'], + 'Sim' => + $options['sim'], + 'CallbackMethod' => + $options['callbackMethod'], + 'CallbackUrl' => + $options['callbackUrl'], + 'CommandMode' => + $options['commandMode'], + 'IncludeSid' => + $options['includeSid'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new CommandInstance( + $this->version, + $payload + ); + } + + + /** + * Reads CommandInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return CommandInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams CommandInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CommandInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return CommandPage Page of CommandInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CommandPage + { + $options = new Values($options); + + $params = Values::of([ + 'Device' => + $options['device'], + 'Sim' => + $options['sim'], + 'Status' => + $options['status'], + 'Direction' => + $options['direction'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new CommandPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of CommandInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return CommandPage Page of CommandInstance + */ + public function getPage(string $targetUrl): CommandPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CommandPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CommandContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): CommandContext + { + return new CommandContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Wireless.CommandList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Wireless/CommandOptions.php b/app/api/Twilio/Rest/Preview/Wireless/CommandOptions.php new file mode 100755 index 0000000..747d156 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Wireless/CommandOptions.php @@ -0,0 +1,274 @@ +options['device'] = $device; + $this->options['sim'] = $sim; + $this->options['callbackMethod'] = $callbackMethod; + $this->options['callbackUrl'] = $callbackUrl; + $this->options['commandMode'] = $commandMode; + $this->options['includeSid'] = $includeSid; + } + + /** + * + * + * @param string $device + * @return $this Fluent Builder + */ + public function setDevice(string $device): self + { + $this->options['device'] = $device; + return $this; + } + + /** + * + * + * @param string $sim + * @return $this Fluent Builder + */ + public function setSim(string $sim): self + { + $this->options['sim'] = $sim; + return $this; + } + + /** + * + * + * @param string $callbackMethod + * @return $this Fluent Builder + */ + public function setCallbackMethod(string $callbackMethod): self + { + $this->options['callbackMethod'] = $callbackMethod; + return $this; + } + + /** + * + * + * @param string $callbackUrl + * @return $this Fluent Builder + */ + public function setCallbackUrl(string $callbackUrl): self + { + $this->options['callbackUrl'] = $callbackUrl; + return $this; + } + + /** + * + * + * @param string $commandMode + * @return $this Fluent Builder + */ + public function setCommandMode(string $commandMode): self + { + $this->options['commandMode'] = $commandMode; + return $this; + } + + /** + * + * + * @param string $includeSid + * @return $this Fluent Builder + */ + public function setIncludeSid(string $includeSid): self + { + $this->options['includeSid'] = $includeSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Wireless.CreateCommandOptions ' . $options . ']'; + } +} + + +class ReadCommandOptions extends Options + { + /** + * @param string $device + * @param string $sim + * @param string $status + * @param string $direction + */ + public function __construct( + + string $device = Values::NONE, + string $sim = Values::NONE, + string $status = Values::NONE, + string $direction = Values::NONE + + ) { + $this->options['device'] = $device; + $this->options['sim'] = $sim; + $this->options['status'] = $status; + $this->options['direction'] = $direction; + } + + /** + * + * + * @param string $device + * @return $this Fluent Builder + */ + public function setDevice(string $device): self + { + $this->options['device'] = $device; + return $this; + } + + /** + * + * + * @param string $sim + * @return $this Fluent Builder + */ + public function setSim(string $sim): self + { + $this->options['sim'] = $sim; + return $this; + } + + /** + * + * + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * + * + * @param string $direction + * @return $this Fluent Builder + */ + public function setDirection(string $direction): self + { + $this->options['direction'] = $direction; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Wireless.ReadCommandOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Wireless/CommandPage.php b/app/api/Twilio/Rest/Preview/Wireless/CommandPage.php new file mode 100755 index 0000000..fe0522c --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Wireless/CommandPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CommandInstance \Twilio\Rest\Preview\Wireless\CommandInstance + */ + public function buildInstance(array $payload): CommandInstance + { + return new CommandInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Wireless.CommandPage]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Wireless/RatePlanContext.php b/app/api/Twilio/Rest/Preview/Wireless/RatePlanContext.php new file mode 100755 index 0000000..7d3f34d --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Wireless/RatePlanContext.php @@ -0,0 +1,125 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/RatePlans/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the RatePlanInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the RatePlanInstance + * + * @return RatePlanInstance Fetched RatePlanInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RatePlanInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new RatePlanInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the RatePlanInstance + * + * @param array|Options $options Optional Arguments + * @return RatePlanInstance Updated RatePlanInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): RatePlanInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + 'FriendlyName' => + $options['friendlyName'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new RatePlanInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Wireless.RatePlanContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Wireless/RatePlanInstance.php b/app/api/Twilio/Rest/Preview/Wireless/RatePlanInstance.php new file mode 100755 index 0000000..54be0e1 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Wireless/RatePlanInstance.php @@ -0,0 +1,168 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'dataEnabled' => Values::array_get($payload, 'data_enabled'), + 'dataMetering' => Values::array_get($payload, 'data_metering'), + 'dataLimit' => Values::array_get($payload, 'data_limit'), + 'messagingEnabled' => Values::array_get($payload, 'messaging_enabled'), + 'voiceEnabled' => Values::array_get($payload, 'voice_enabled'), + 'nationalRoamingEnabled' => Values::array_get($payload, 'national_roaming_enabled'), + 'internationalRoaming' => Values::array_get($payload, 'international_roaming'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return RatePlanContext Context for this RatePlanInstance + */ + protected function proxy(): RatePlanContext + { + if (!$this->context) { + $this->context = new RatePlanContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the RatePlanInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the RatePlanInstance + * + * @return RatePlanInstance Fetched RatePlanInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RatePlanInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the RatePlanInstance + * + * @param array|Options $options Optional Arguments + * @return RatePlanInstance Updated RatePlanInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): RatePlanInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Wireless.RatePlanInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Wireless/RatePlanList.php b/app/api/Twilio/Rest/Preview/Wireless/RatePlanList.php new file mode 100755 index 0000000..20fcec0 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Wireless/RatePlanList.php @@ -0,0 +1,208 @@ +solution = [ + ]; + + $this->uri = '/RatePlans'; + } + + /** + * Create the RatePlanInstance + * + * @param array|Options $options Optional Arguments + * @return RatePlanInstance Created RatePlanInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): RatePlanInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + 'FriendlyName' => + $options['friendlyName'], + 'DataEnabled' => + Serialize::booleanToString($options['dataEnabled']), + 'DataLimit' => + $options['dataLimit'], + 'DataMetering' => + $options['dataMetering'], + 'MessagingEnabled' => + Serialize::booleanToString($options['messagingEnabled']), + 'VoiceEnabled' => + Serialize::booleanToString($options['voiceEnabled']), + 'CommandsEnabled' => + Serialize::booleanToString($options['commandsEnabled']), + 'NationalRoamingEnabled' => + Serialize::booleanToString($options['nationalRoamingEnabled']), + 'InternationalRoaming' => + Serialize::map($options['internationalRoaming'], function ($e) { return $e; }), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new RatePlanInstance( + $this->version, + $payload + ); + } + + + /** + * Reads RatePlanInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return RatePlanInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams RatePlanInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of RatePlanInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return RatePlanPage Page of RatePlanInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): RatePlanPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new RatePlanPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of RatePlanInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return RatePlanPage Page of RatePlanInstance + */ + public function getPage(string $targetUrl): RatePlanPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new RatePlanPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a RatePlanContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): RatePlanContext + { + return new RatePlanContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Wireless.RatePlanList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Wireless/RatePlanOptions.php b/app/api/Twilio/Rest/Preview/Wireless/RatePlanOptions.php new file mode 100755 index 0000000..7021e46 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Wireless/RatePlanOptions.php @@ -0,0 +1,314 @@ +options['uniqueName'] = $uniqueName; + $this->options['friendlyName'] = $friendlyName; + $this->options['dataEnabled'] = $dataEnabled; + $this->options['dataLimit'] = $dataLimit; + $this->options['dataMetering'] = $dataMetering; + $this->options['messagingEnabled'] = $messagingEnabled; + $this->options['voiceEnabled'] = $voiceEnabled; + $this->options['commandsEnabled'] = $commandsEnabled; + $this->options['nationalRoamingEnabled'] = $nationalRoamingEnabled; + $this->options['internationalRoaming'] = $internationalRoaming; + } + + /** + * + * + * @param string $uniqueName + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * + * + * @param bool $dataEnabled + * @return $this Fluent Builder + */ + public function setDataEnabled(bool $dataEnabled): self + { + $this->options['dataEnabled'] = $dataEnabled; + return $this; + } + + /** + * + * + * @param int $dataLimit + * @return $this Fluent Builder + */ + public function setDataLimit(int $dataLimit): self + { + $this->options['dataLimit'] = $dataLimit; + return $this; + } + + /** + * + * + * @param string $dataMetering + * @return $this Fluent Builder + */ + public function setDataMetering(string $dataMetering): self + { + $this->options['dataMetering'] = $dataMetering; + return $this; + } + + /** + * + * + * @param bool $messagingEnabled + * @return $this Fluent Builder + */ + public function setMessagingEnabled(bool $messagingEnabled): self + { + $this->options['messagingEnabled'] = $messagingEnabled; + return $this; + } + + /** + * + * + * @param bool $voiceEnabled + * @return $this Fluent Builder + */ + public function setVoiceEnabled(bool $voiceEnabled): self + { + $this->options['voiceEnabled'] = $voiceEnabled; + return $this; + } + + /** + * + * + * @param bool $commandsEnabled + * @return $this Fluent Builder + */ + public function setCommandsEnabled(bool $commandsEnabled): self + { + $this->options['commandsEnabled'] = $commandsEnabled; + return $this; + } + + /** + * + * + * @param bool $nationalRoamingEnabled + * @return $this Fluent Builder + */ + public function setNationalRoamingEnabled(bool $nationalRoamingEnabled): self + { + $this->options['nationalRoamingEnabled'] = $nationalRoamingEnabled; + return $this; + } + + /** + * + * + * @param string[] $internationalRoaming + * @return $this Fluent Builder + */ + public function setInternationalRoaming(array $internationalRoaming): self + { + $this->options['internationalRoaming'] = $internationalRoaming; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Wireless.CreateRatePlanOptions ' . $options . ']'; + } +} + + + + +class UpdateRatePlanOptions extends Options + { + /** + * @param string $uniqueName + * @param string $friendlyName + */ + public function __construct( + + string $uniqueName = Values::NONE, + string $friendlyName = Values::NONE + + ) { + $this->options['uniqueName'] = $uniqueName; + $this->options['friendlyName'] = $friendlyName; + } + + /** + * + * + * @param string $uniqueName + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Wireless.UpdateRatePlanOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Wireless/RatePlanPage.php b/app/api/Twilio/Rest/Preview/Wireless/RatePlanPage.php new file mode 100755 index 0000000..724d10c --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Wireless/RatePlanPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RatePlanInstance \Twilio\Rest\Preview\Wireless\RatePlanInstance + */ + public function buildInstance(array $payload): RatePlanInstance + { + return new RatePlanInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Wireless.RatePlanPage]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Wireless/Sim/UsageContext.php b/app/api/Twilio/Rest/Preview/Wireless/Sim/UsageContext.php new file mode 100755 index 0000000..4278736 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Wireless/Sim/UsageContext.php @@ -0,0 +1,93 @@ +solution = [ + 'simSid' => + $simSid, + ]; + + $this->uri = '/Sims/' . \rawurlencode($simSid) + .'/Usage'; + } + + /** + * Fetch the UsageInstance + * + * @param array|Options $options Optional Arguments + * @return UsageInstance Fetched UsageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): UsageInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'End' => + $options['end'], + 'Start' => + $options['start'], + ]); + + $payload = $this->version->fetch('GET', $this->uri, $params); + + return new UsageInstance( + $this->version, + $payload, + $this->solution['simSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Wireless.UsageContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Wireless/Sim/UsageInstance.php b/app/api/Twilio/Rest/Preview/Wireless/Sim/UsageInstance.php new file mode 100755 index 0000000..7ec8118 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Wireless/Sim/UsageInstance.php @@ -0,0 +1,133 @@ +properties = [ + 'simSid' => Values::array_get($payload, 'sim_sid'), + 'simUniqueName' => Values::array_get($payload, 'sim_unique_name'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'period' => Values::array_get($payload, 'period'), + 'commandsUsage' => Values::array_get($payload, 'commands_usage'), + 'commandsCosts' => Values::array_get($payload, 'commands_costs'), + 'dataUsage' => Values::array_get($payload, 'data_usage'), + 'dataCosts' => Values::array_get($payload, 'data_costs'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['simSid' => $simSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return UsageContext Context for this UsageInstance + */ + protected function proxy(): UsageContext + { + if (!$this->context) { + $this->context = new UsageContext( + $this->version, + $this->solution['simSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the UsageInstance + * + * @param array|Options $options Optional Arguments + * @return UsageInstance Fetched UsageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): UsageInstance + { + + return $this->proxy()->fetch($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Wireless.UsageInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Wireless/Sim/UsageList.php b/app/api/Twilio/Rest/Preview/Wireless/Sim/UsageList.php new file mode 100755 index 0000000..aa86e33 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Wireless/Sim/UsageList.php @@ -0,0 +1,67 @@ +solution = [ + 'simSid' => + $simSid, + + ]; + } + + /** + * Constructs a UsageContext + */ + public function getContext( + + ): UsageContext + { + return new UsageContext( + $this->version, + $this->solution['simSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Wireless.UsageList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Wireless/Sim/UsageOptions.php b/app/api/Twilio/Rest/Preview/Wireless/Sim/UsageOptions.php new file mode 100755 index 0000000..4f0fb2d --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Wireless/Sim/UsageOptions.php @@ -0,0 +1,94 @@ +options['end'] = $end; + $this->options['start'] = $start; + } + + /** + * + * + * @param string $end + * @return $this Fluent Builder + */ + public function setEnd(string $end): self + { + $this->options['end'] = $end; + return $this; + } + + /** + * + * + * @param string $start + * @return $this Fluent Builder + */ + public function setStart(string $start): self + { + $this->options['start'] = $start; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Wireless.FetchUsageOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Wireless/Sim/UsagePage.php b/app/api/Twilio/Rest/Preview/Wireless/Sim/UsagePage.php new file mode 100755 index 0000000..8e777a7 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Wireless/Sim/UsagePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UsageInstance \Twilio\Rest\Preview\Wireless\Sim\UsageInstance + */ + public function buildInstance(array $payload): UsageInstance + { + return new UsageInstance($this->version, $payload, $this->solution['simSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Wireless.UsagePage]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Wireless/SimContext.php b/app/api/Twilio/Rest/Preview/Wireless/SimContext.php new file mode 100755 index 0000000..22e33f0 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Wireless/SimContext.php @@ -0,0 +1,198 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Sims/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the SimInstance + * + * @return SimInstance Fetched SimInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SimInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new SimInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the SimInstance + * + * @param array|Options $options Optional Arguments + * @return SimInstance Updated SimInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SimInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + 'CallbackMethod' => + $options['callbackMethod'], + 'CallbackUrl' => + $options['callbackUrl'], + 'FriendlyName' => + $options['friendlyName'], + 'RatePlan' => + $options['ratePlan'], + 'Status' => + $options['status'], + 'CommandsCallbackMethod' => + $options['commandsCallbackMethod'], + 'CommandsCallbackUrl' => + $options['commandsCallbackUrl'], + 'SmsFallbackMethod' => + $options['smsFallbackMethod'], + 'SmsFallbackUrl' => + $options['smsFallbackUrl'], + 'SmsMethod' => + $options['smsMethod'], + 'SmsUrl' => + $options['smsUrl'], + 'VoiceFallbackMethod' => + $options['voiceFallbackMethod'], + 'VoiceFallbackUrl' => + $options['voiceFallbackUrl'], + 'VoiceMethod' => + $options['voiceMethod'], + 'VoiceUrl' => + $options['voiceUrl'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new SimInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the usage + */ + protected function getUsage(): UsageList + { + if (!$this->_usage) { + $this->_usage = new UsageList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_usage; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Wireless.SimContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Wireless/SimInstance.php b/app/api/Twilio/Rest/Preview/Wireless/SimInstance.php new file mode 100755 index 0000000..f527688 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Wireless/SimInstance.php @@ -0,0 +1,183 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'ratePlanSid' => Values::array_get($payload, 'rate_plan_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'iccid' => Values::array_get($payload, 'iccid'), + 'eId' => Values::array_get($payload, 'e_id'), + 'status' => Values::array_get($payload, 'status'), + 'commandsCallbackUrl' => Values::array_get($payload, 'commands_callback_url'), + 'commandsCallbackMethod' => Values::array_get($payload, 'commands_callback_method'), + 'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'), + 'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'), + 'smsMethod' => Values::array_get($payload, 'sms_method'), + 'smsUrl' => Values::array_get($payload, 'sms_url'), + 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), + 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), + 'voiceMethod' => Values::array_get($payload, 'voice_method'), + 'voiceUrl' => Values::array_get($payload, 'voice_url'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SimContext Context for this SimInstance + */ + protected function proxy(): SimContext + { + if (!$this->context) { + $this->context = new SimContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the SimInstance + * + * @return SimInstance Fetched SimInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SimInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SimInstance + * + * @param array|Options $options Optional Arguments + * @return SimInstance Updated SimInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SimInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the usage + */ + protected function getUsage(): UsageList + { + return $this->proxy()->usage; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Preview.Wireless.SimInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Wireless/SimList.php b/app/api/Twilio/Rest/Preview/Wireless/SimList.php new file mode 100755 index 0000000..935b2f3 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Wireless/SimList.php @@ -0,0 +1,176 @@ +solution = [ + ]; + + $this->uri = '/Sims'; + } + + /** + * Reads SimInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return SimInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams SimInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SimInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return SimPage Page of SimInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SimPage + { + $options = new Values($options); + + $params = Values::of([ + 'Status' => + $options['status'], + 'Iccid' => + $options['iccid'], + 'RatePlan' => + $options['ratePlan'], + 'EId' => + $options['eId'], + 'SimRegistrationCode' => + $options['simRegistrationCode'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SimPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SimInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SimPage Page of SimInstance + */ + public function getPage(string $targetUrl): SimPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SimPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SimContext + * + * @param string $sid + */ + public function getContext( + string $sid + + ): SimContext + { + return new SimContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Wireless.SimList]'; + } +} diff --git a/app/api/Twilio/Rest/Preview/Wireless/SimOptions.php b/app/api/Twilio/Rest/Preview/Wireless/SimOptions.php new file mode 100755 index 0000000..49532ff --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Wireless/SimOptions.php @@ -0,0 +1,472 @@ +options['status'] = $status; + $this->options['iccid'] = $iccid; + $this->options['ratePlan'] = $ratePlan; + $this->options['eId'] = $eId; + $this->options['simRegistrationCode'] = $simRegistrationCode; + } + + /** + * + * + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * + * + * @param string $iccid + * @return $this Fluent Builder + */ + public function setIccid(string $iccid): self + { + $this->options['iccid'] = $iccid; + return $this; + } + + /** + * + * + * @param string $ratePlan + * @return $this Fluent Builder + */ + public function setRatePlan(string $ratePlan): self + { + $this->options['ratePlan'] = $ratePlan; + return $this; + } + + /** + * + * + * @param string $eId + * @return $this Fluent Builder + */ + public function setEId(string $eId): self + { + $this->options['eId'] = $eId; + return $this; + } + + /** + * + * + * @param string $simRegistrationCode + * @return $this Fluent Builder + */ + public function setSimRegistrationCode(string $simRegistrationCode): self + { + $this->options['simRegistrationCode'] = $simRegistrationCode; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Wireless.ReadSimOptions ' . $options . ']'; + } +} + +class UpdateSimOptions extends Options + { + /** + * @param string $uniqueName + * @param string $callbackMethod + * @param string $callbackUrl + * @param string $friendlyName + * @param string $ratePlan + * @param string $status + * @param string $commandsCallbackMethod + * @param string $commandsCallbackUrl + * @param string $smsFallbackMethod + * @param string $smsFallbackUrl + * @param string $smsMethod + * @param string $smsUrl + * @param string $voiceFallbackMethod + * @param string $voiceFallbackUrl + * @param string $voiceMethod + * @param string $voiceUrl + */ + public function __construct( + + string $uniqueName = Values::NONE, + string $callbackMethod = Values::NONE, + string $callbackUrl = Values::NONE, + string $friendlyName = Values::NONE, + string $ratePlan = Values::NONE, + string $status = Values::NONE, + string $commandsCallbackMethod = Values::NONE, + string $commandsCallbackUrl = Values::NONE, + string $smsFallbackMethod = Values::NONE, + string $smsFallbackUrl = Values::NONE, + string $smsMethod = Values::NONE, + string $smsUrl = Values::NONE, + string $voiceFallbackMethod = Values::NONE, + string $voiceFallbackUrl = Values::NONE, + string $voiceMethod = Values::NONE, + string $voiceUrl = Values::NONE + + ) { + $this->options['uniqueName'] = $uniqueName; + $this->options['callbackMethod'] = $callbackMethod; + $this->options['callbackUrl'] = $callbackUrl; + $this->options['friendlyName'] = $friendlyName; + $this->options['ratePlan'] = $ratePlan; + $this->options['status'] = $status; + $this->options['commandsCallbackMethod'] = $commandsCallbackMethod; + $this->options['commandsCallbackUrl'] = $commandsCallbackUrl; + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + $this->options['smsMethod'] = $smsMethod; + $this->options['smsUrl'] = $smsUrl; + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + $this->options['voiceMethod'] = $voiceMethod; + $this->options['voiceUrl'] = $voiceUrl; + } + + /** + * + * + * @param string $uniqueName + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * + * + * @param string $callbackMethod + * @return $this Fluent Builder + */ + public function setCallbackMethod(string $callbackMethod): self + { + $this->options['callbackMethod'] = $callbackMethod; + return $this; + } + + /** + * + * + * @param string $callbackUrl + * @return $this Fluent Builder + */ + public function setCallbackUrl(string $callbackUrl): self + { + $this->options['callbackUrl'] = $callbackUrl; + return $this; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * + * + * @param string $ratePlan + * @return $this Fluent Builder + */ + public function setRatePlan(string $ratePlan): self + { + $this->options['ratePlan'] = $ratePlan; + return $this; + } + + /** + * + * + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * + * + * @param string $commandsCallbackMethod + * @return $this Fluent Builder + */ + public function setCommandsCallbackMethod(string $commandsCallbackMethod): self + { + $this->options['commandsCallbackMethod'] = $commandsCallbackMethod; + return $this; + } + + /** + * + * + * @param string $commandsCallbackUrl + * @return $this Fluent Builder + */ + public function setCommandsCallbackUrl(string $commandsCallbackUrl): self + { + $this->options['commandsCallbackUrl'] = $commandsCallbackUrl; + return $this; + } + + /** + * + * + * @param string $smsFallbackMethod + * @return $this Fluent Builder + */ + public function setSmsFallbackMethod(string $smsFallbackMethod): self + { + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + return $this; + } + + /** + * + * + * @param string $smsFallbackUrl + * @return $this Fluent Builder + */ + public function setSmsFallbackUrl(string $smsFallbackUrl): self + { + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + return $this; + } + + /** + * + * + * @param string $smsMethod + * @return $this Fluent Builder + */ + public function setSmsMethod(string $smsMethod): self + { + $this->options['smsMethod'] = $smsMethod; + return $this; + } + + /** + * + * + * @param string $smsUrl + * @return $this Fluent Builder + */ + public function setSmsUrl(string $smsUrl): self + { + $this->options['smsUrl'] = $smsUrl; + return $this; + } + + /** + * + * + * @param string $voiceFallbackMethod + * @return $this Fluent Builder + */ + public function setVoiceFallbackMethod(string $voiceFallbackMethod): self + { + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + return $this; + } + + /** + * + * + * @param string $voiceFallbackUrl + * @return $this Fluent Builder + */ + public function setVoiceFallbackUrl(string $voiceFallbackUrl): self + { + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + return $this; + } + + /** + * + * + * @param string $voiceMethod + * @return $this Fluent Builder + */ + public function setVoiceMethod(string $voiceMethod): self + { + $this->options['voiceMethod'] = $voiceMethod; + return $this; + } + + /** + * + * + * @param string $voiceUrl + * @return $this Fluent Builder + */ + public function setVoiceUrl(string $voiceUrl): self + { + $this->options['voiceUrl'] = $voiceUrl; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Preview.Wireless.UpdateSimOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Preview/Wireless/SimPage.php b/app/api/Twilio/Rest/Preview/Wireless/SimPage.php new file mode 100755 index 0000000..b2ce025 --- /dev/null +++ b/app/api/Twilio/Rest/Preview/Wireless/SimPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SimInstance \Twilio\Rest\Preview\Wireless\SimInstance + */ + public function buildInstance(array $payload): SimInstance + { + return new SimInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Preview.Wireless.SimPage]'; + } +} diff --git a/app/api/Twilio/Rest/PreviewBase.php b/app/api/Twilio/Rest/PreviewBase.php new file mode 100755 index 0000000..3e747f0 --- /dev/null +++ b/app/api/Twilio/Rest/PreviewBase.php @@ -0,0 +1,153 @@ +baseUrl = 'https://preview.twilio.com'; + } + + + /** + * @return DeployedDevices Version deployedDevices of preview + */ + protected function getDeployedDevices(): DeployedDevices { + if (!$this->_deployedDevices) { + $this->_deployedDevices = new DeployedDevices($this); + } + return $this->_deployedDevices; + } + + /** + * @return HostedNumbers Version hostedNumbers of preview + */ + protected function getHostedNumbers(): HostedNumbers { + if (!$this->_hostedNumbers) { + $this->_hostedNumbers = new HostedNumbers($this); + } + return $this->_hostedNumbers; + } + + /** + * @return Sync Version sync of preview + */ + protected function getSync(): Sync { + if (!$this->_sync) { + $this->_sync = new Sync($this); + } + return $this->_sync; + } + + /** + * @return Marketplace Version marketplace of preview + */ + protected function getMarketplace(): Marketplace { + if (!$this->_marketplace) { + $this->_marketplace = new Marketplace($this); + } + return $this->_marketplace; + } + + /** + * @return Understand Version understand of preview + */ + protected function getUnderstand(): Understand { + if (!$this->_understand) { + $this->_understand = new Understand($this); + } + return $this->_understand; + } + + /** + * @return Wireless Version wireless of preview + */ + protected function getWireless(): Wireless { + if (!$this->_wireless) { + $this->_wireless = new Wireless($this); + } + return $this->_wireless; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Preview]'; + } +} diff --git a/app/api/Twilio/Rest/Pricing.php b/app/api/Twilio/Rest/Pricing.php new file mode 100755 index 0000000..de239d3 --- /dev/null +++ b/app/api/Twilio/Rest/Pricing.php @@ -0,0 +1,68 @@ +messaging instead. + */ + protected function getMessaging(): \Twilio\Rest\Pricing\V1\MessagingList { + echo "messaging is deprecated. Use v1->messaging instead."; + return $this->v1->messaging; + } + + /** + * @deprecated Use v1->phoneNumbers instead. + */ + protected function getPhoneNumbers(): \Twilio\Rest\Pricing\V1\PhoneNumberList { + echo "phoneNumbers is deprecated. Use v1->phoneNumbers instead."; + return $this->v1->phoneNumbers; + } + + /** + * @deprecated Use v2->voice instead. + */ + protected function getVoice(): \Twilio\Rest\Pricing\V2\VoiceList { + echo "voice is deprecated. Use v2->voice instead."; + return $this->v2->voice; + } + + /** + * @deprecated Use v2->countries instead. + */ + protected function getCountries(): \Twilio\Rest\Pricing\V2\CountryList { + echo "countries is deprecated. Use v2->countries instead."; + return $this->v2->countries; + } + + /** + * @deprecated Use v2->countries(\$isoCountry) instead. + * @param string $isoCountry The ISO country code of the pricing information to + * fetch + */ + protected function contextCountries(string $isoCountry): \Twilio\Rest\Pricing\V2\CountryContext { + echo "countries(\$isoCountry) is deprecated. Use v2->countries(\$isoCountry) instead."; + return $this->v2->countries($isoCountry); + } + + /** + * @deprecated Use v2->numbers instead. + */ + protected function getNumbers(): \Twilio\Rest\Pricing\V2\NumberList { + echo "numbers is deprecated. Use v2->numbers instead."; + return $this->v2->numbers; + } + + /** + * @deprecated Use v2->numbers(\$destinationNumber) instead. + * @param string $destinationNumber The destination number for which to fetch + * pricing information + */ + protected function contextNumbers(string $destinationNumber): \Twilio\Rest\Pricing\V2\NumberContext { + echo "numbers(\$destinationNumber) is deprecated. Use v2->numbers(\$destinationNumber) instead."; + return $this->v2->numbers($destinationNumber); + } +} \ No newline at end of file diff --git a/app/api/Twilio/Rest/Pricing/V1.php b/app/api/Twilio/Rest/Pricing/V1.php new file mode 100755 index 0000000..7597112 --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V1.php @@ -0,0 +1,116 @@ +version = 'v1'; + } + + protected function getMessaging(): MessagingList + { + if (!$this->_messaging) { + $this->_messaging = new MessagingList($this); + } + return $this->_messaging; + } + + protected function getPhoneNumbers(): PhoneNumberList + { + if (!$this->_phoneNumbers) { + $this->_phoneNumbers = new PhoneNumberList($this); + } + return $this->_phoneNumbers; + } + + protected function getVoice(): VoiceList + { + if (!$this->_voice) { + $this->_voice = new VoiceList($this); + } + return $this->_voice; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V1]'; + } +} diff --git a/app/api/Twilio/Rest/Pricing/V1/Messaging/CountryContext.php b/app/api/Twilio/Rest/Pricing/V1/Messaging/CountryContext.php new file mode 100755 index 0000000..4fc32fd --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V1/Messaging/CountryContext.php @@ -0,0 +1,81 @@ +solution = [ + 'isoCountry' => + $isoCountry, + ]; + + $this->uri = '/Messaging/Countries/' . \rawurlencode($isoCountry) + .''; + } + + /** + * Fetch the CountryInstance + * + * @return CountryInstance Fetched CountryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CountryInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new CountryInstance( + $this->version, + $payload, + $this->solution['isoCountry'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Pricing.V1.CountryContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Pricing/V1/Messaging/CountryInstance.php b/app/api/Twilio/Rest/Pricing/V1/Messaging/CountryInstance.php new file mode 100755 index 0000000..426fe02 --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V1/Messaging/CountryInstance.php @@ -0,0 +1,125 @@ +properties = [ + 'country' => Values::array_get($payload, 'country'), + 'isoCountry' => Values::array_get($payload, 'iso_country'), + 'outboundSmsPrices' => Values::array_get($payload, 'outbound_sms_prices'), + 'inboundSmsPrices' => Values::array_get($payload, 'inbound_sms_prices'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['isoCountry' => $isoCountry ?: $this->properties['isoCountry'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CountryContext Context for this CountryInstance + */ + protected function proxy(): CountryContext + { + if (!$this->context) { + $this->context = new CountryContext( + $this->version, + $this->solution['isoCountry'] + ); + } + + return $this->context; + } + + /** + * Fetch the CountryInstance + * + * @return CountryInstance Fetched CountryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CountryInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Pricing.V1.CountryInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Pricing/V1/Messaging/CountryList.php b/app/api/Twilio/Rest/Pricing/V1/Messaging/CountryList.php new file mode 100755 index 0000000..9bcb868 --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V1/Messaging/CountryList.php @@ -0,0 +1,161 @@ +solution = [ + ]; + + $this->uri = '/Messaging/Countries'; + } + + /** + * Reads CountryInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return CountryInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams CountryInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CountryInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return CountryPage Page of CountryInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CountryPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new CountryPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of CountryInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return CountryPage Page of CountryInstance + */ + public function getPage(string $targetUrl): CountryPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CountryPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CountryContext + * + * @param string $isoCountry The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the pricing information to fetch. + */ + public function getContext( + string $isoCountry + + ): CountryContext + { + return new CountryContext( + $this->version, + $isoCountry + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V1.CountryList]'; + } +} diff --git a/app/api/Twilio/Rest/Pricing/V1/Messaging/CountryPage.php b/app/api/Twilio/Rest/Pricing/V1/Messaging/CountryPage.php new file mode 100755 index 0000000..a9b4034 --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V1/Messaging/CountryPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CountryInstance \Twilio\Rest\Pricing\V1\Messaging\CountryInstance + */ + public function buildInstance(array $payload): CountryInstance + { + return new CountryInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V1.CountryPage]'; + } +} diff --git a/app/api/Twilio/Rest/Pricing/V1/MessagingInstance.php b/app/api/Twilio/Rest/Pricing/V1/MessagingInstance.php new file mode 100755 index 0000000..6daaf96 --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V1/MessagingInstance.php @@ -0,0 +1,71 @@ +solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V1.MessagingInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Pricing/V1/MessagingList.php b/app/api/Twilio/Rest/Pricing/V1/MessagingList.php new file mode 100755 index 0000000..ba9b0d8 --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V1/MessagingList.php @@ -0,0 +1,106 @@ +solution = [ + ]; + } + + /** + * Access the countries + */ + protected function getCountries(): CountryList + { + if (!$this->_countries) { + $this->_countries = new CountryList( + $this->version + ); + } + return $this->_countries; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name) + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V1.MessagingList]'; + } +} diff --git a/app/api/Twilio/Rest/Pricing/V1/MessagingPage.php b/app/api/Twilio/Rest/Pricing/V1/MessagingPage.php new file mode 100755 index 0000000..3be5737 --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V1/MessagingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MessagingInstance \Twilio\Rest\Pricing\V1\MessagingInstance + */ + public function buildInstance(array $payload): MessagingInstance + { + return new MessagingInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V1.MessagingPage]'; + } +} diff --git a/app/api/Twilio/Rest/Pricing/V1/PhoneNumber/CountryContext.php b/app/api/Twilio/Rest/Pricing/V1/PhoneNumber/CountryContext.php new file mode 100755 index 0000000..b16cf50 --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V1/PhoneNumber/CountryContext.php @@ -0,0 +1,81 @@ +solution = [ + 'isoCountry' => + $isoCountry, + ]; + + $this->uri = '/PhoneNumbers/Countries/' . \rawurlencode($isoCountry) + .''; + } + + /** + * Fetch the CountryInstance + * + * @return CountryInstance Fetched CountryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CountryInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new CountryInstance( + $this->version, + $payload, + $this->solution['isoCountry'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Pricing.V1.CountryContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Pricing/V1/PhoneNumber/CountryInstance.php b/app/api/Twilio/Rest/Pricing/V1/PhoneNumber/CountryInstance.php new file mode 100755 index 0000000..4a34b65 --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V1/PhoneNumber/CountryInstance.php @@ -0,0 +1,123 @@ +properties = [ + 'country' => Values::array_get($payload, 'country'), + 'isoCountry' => Values::array_get($payload, 'iso_country'), + 'phoneNumberPrices' => Values::array_get($payload, 'phone_number_prices'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['isoCountry' => $isoCountry ?: $this->properties['isoCountry'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CountryContext Context for this CountryInstance + */ + protected function proxy(): CountryContext + { + if (!$this->context) { + $this->context = new CountryContext( + $this->version, + $this->solution['isoCountry'] + ); + } + + return $this->context; + } + + /** + * Fetch the CountryInstance + * + * @return CountryInstance Fetched CountryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CountryInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Pricing.V1.CountryInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Pricing/V1/PhoneNumber/CountryList.php b/app/api/Twilio/Rest/Pricing/V1/PhoneNumber/CountryList.php new file mode 100755 index 0000000..60ca5cf --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V1/PhoneNumber/CountryList.php @@ -0,0 +1,161 @@ +solution = [ + ]; + + $this->uri = '/PhoneNumbers/Countries'; + } + + /** + * Reads CountryInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return CountryInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams CountryInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CountryInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return CountryPage Page of CountryInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CountryPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new CountryPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of CountryInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return CountryPage Page of CountryInstance + */ + public function getPage(string $targetUrl): CountryPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CountryPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CountryContext + * + * @param string $isoCountry The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the pricing information to fetch. + */ + public function getContext( + string $isoCountry + + ): CountryContext + { + return new CountryContext( + $this->version, + $isoCountry + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V1.CountryList]'; + } +} diff --git a/app/api/Twilio/Rest/Pricing/V1/PhoneNumber/CountryPage.php b/app/api/Twilio/Rest/Pricing/V1/PhoneNumber/CountryPage.php new file mode 100755 index 0000000..91bc5d8 --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V1/PhoneNumber/CountryPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CountryInstance \Twilio\Rest\Pricing\V1\PhoneNumber\CountryInstance + */ + public function buildInstance(array $payload): CountryInstance + { + return new CountryInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V1.CountryPage]'; + } +} diff --git a/app/api/Twilio/Rest/Pricing/V1/PhoneNumberInstance.php b/app/api/Twilio/Rest/Pricing/V1/PhoneNumberInstance.php new file mode 100755 index 0000000..2f64415 --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V1/PhoneNumberInstance.php @@ -0,0 +1,71 @@ +solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V1.PhoneNumberInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Pricing/V1/PhoneNumberList.php b/app/api/Twilio/Rest/Pricing/V1/PhoneNumberList.php new file mode 100755 index 0000000..fa8d05b --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V1/PhoneNumberList.php @@ -0,0 +1,106 @@ +solution = [ + ]; + } + + /** + * Access the countries + */ + protected function getCountries(): CountryList + { + if (!$this->_countries) { + $this->_countries = new CountryList( + $this->version + ); + } + return $this->_countries; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name) + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V1.PhoneNumberList]'; + } +} diff --git a/app/api/Twilio/Rest/Pricing/V1/PhoneNumberPage.php b/app/api/Twilio/Rest/Pricing/V1/PhoneNumberPage.php new file mode 100755 index 0000000..6571f5b --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V1/PhoneNumberPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PhoneNumberInstance \Twilio\Rest\Pricing\V1\PhoneNumberInstance + */ + public function buildInstance(array $payload): PhoneNumberInstance + { + return new PhoneNumberInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V1.PhoneNumberPage]'; + } +} diff --git a/app/api/Twilio/Rest/Pricing/V1/Voice/CountryContext.php b/app/api/Twilio/Rest/Pricing/V1/Voice/CountryContext.php new file mode 100755 index 0000000..b1c8de0 --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V1/Voice/CountryContext.php @@ -0,0 +1,81 @@ +solution = [ + 'isoCountry' => + $isoCountry, + ]; + + $this->uri = '/Voice/Countries/' . \rawurlencode($isoCountry) + .''; + } + + /** + * Fetch the CountryInstance + * + * @return CountryInstance Fetched CountryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CountryInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new CountryInstance( + $this->version, + $payload, + $this->solution['isoCountry'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Pricing.V1.CountryContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Pricing/V1/Voice/CountryInstance.php b/app/api/Twilio/Rest/Pricing/V1/Voice/CountryInstance.php new file mode 100755 index 0000000..feab23f --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V1/Voice/CountryInstance.php @@ -0,0 +1,125 @@ +properties = [ + 'country' => Values::array_get($payload, 'country'), + 'isoCountry' => Values::array_get($payload, 'iso_country'), + 'outboundPrefixPrices' => Values::array_get($payload, 'outbound_prefix_prices'), + 'inboundCallPrices' => Values::array_get($payload, 'inbound_call_prices'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['isoCountry' => $isoCountry ?: $this->properties['isoCountry'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CountryContext Context for this CountryInstance + */ + protected function proxy(): CountryContext + { + if (!$this->context) { + $this->context = new CountryContext( + $this->version, + $this->solution['isoCountry'] + ); + } + + return $this->context; + } + + /** + * Fetch the CountryInstance + * + * @return CountryInstance Fetched CountryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CountryInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Pricing.V1.CountryInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Pricing/V1/Voice/CountryList.php b/app/api/Twilio/Rest/Pricing/V1/Voice/CountryList.php new file mode 100755 index 0000000..242d495 --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V1/Voice/CountryList.php @@ -0,0 +1,161 @@ +solution = [ + ]; + + $this->uri = '/Voice/Countries'; + } + + /** + * Reads CountryInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return CountryInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams CountryInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CountryInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return CountryPage Page of CountryInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CountryPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new CountryPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of CountryInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return CountryPage Page of CountryInstance + */ + public function getPage(string $targetUrl): CountryPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CountryPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CountryContext + * + * @param string $isoCountry The [ISO country code](http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the pricing information to fetch. + */ + public function getContext( + string $isoCountry + + ): CountryContext + { + return new CountryContext( + $this->version, + $isoCountry + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V1.CountryList]'; + } +} diff --git a/app/api/Twilio/Rest/Pricing/V1/Voice/CountryPage.php b/app/api/Twilio/Rest/Pricing/V1/Voice/CountryPage.php new file mode 100755 index 0000000..ecdbd2a --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V1/Voice/CountryPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CountryInstance \Twilio\Rest\Pricing\V1\Voice\CountryInstance + */ + public function buildInstance(array $payload): CountryInstance + { + return new CountryInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V1.CountryPage]'; + } +} diff --git a/app/api/Twilio/Rest/Pricing/V1/Voice/NumberContext.php b/app/api/Twilio/Rest/Pricing/V1/Voice/NumberContext.php new file mode 100755 index 0000000..e4f9972 --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V1/Voice/NumberContext.php @@ -0,0 +1,81 @@ +solution = [ + 'number' => + $number, + ]; + + $this->uri = '/Voice/Numbers/' . \rawurlencode($number) + .''; + } + + /** + * Fetch the NumberInstance + * + * @return NumberInstance Fetched NumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): NumberInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new NumberInstance( + $this->version, + $payload, + $this->solution['number'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Pricing.V1.NumberContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Pricing/V1/Voice/NumberInstance.php b/app/api/Twilio/Rest/Pricing/V1/Voice/NumberInstance.php new file mode 100755 index 0000000..a23a460 --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V1/Voice/NumberInstance.php @@ -0,0 +1,127 @@ +properties = [ + 'number' => Values::array_get($payload, 'number'), + 'country' => Values::array_get($payload, 'country'), + 'isoCountry' => Values::array_get($payload, 'iso_country'), + 'outboundCallPrice' => Values::array_get($payload, 'outbound_call_price'), + 'inboundCallPrice' => Values::array_get($payload, 'inbound_call_price'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['number' => $number ?: $this->properties['number'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return NumberContext Context for this NumberInstance + */ + protected function proxy(): NumberContext + { + if (!$this->context) { + $this->context = new NumberContext( + $this->version, + $this->solution['number'] + ); + } + + return $this->context; + } + + /** + * Fetch the NumberInstance + * + * @return NumberInstance Fetched NumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): NumberInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Pricing.V1.NumberInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Pricing/V1/Voice/NumberList.php b/app/api/Twilio/Rest/Pricing/V1/Voice/NumberList.php new file mode 100755 index 0000000..cacc324 --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V1/Voice/NumberList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a NumberContext + * + * @param string $number The phone number to fetch. + */ + public function getContext( + string $number + + ): NumberContext + { + return new NumberContext( + $this->version, + $number + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V1.NumberList]'; + } +} diff --git a/app/api/Twilio/Rest/Pricing/V1/Voice/NumberPage.php b/app/api/Twilio/Rest/Pricing/V1/Voice/NumberPage.php new file mode 100755 index 0000000..f29bbfe --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V1/Voice/NumberPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return NumberInstance \Twilio\Rest\Pricing\V1\Voice\NumberInstance + */ + public function buildInstance(array $payload): NumberInstance + { + return new NumberInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V1.NumberPage]'; + } +} diff --git a/app/api/Twilio/Rest/Pricing/V1/VoiceInstance.php b/app/api/Twilio/Rest/Pricing/V1/VoiceInstance.php new file mode 100755 index 0000000..9086d3c --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V1/VoiceInstance.php @@ -0,0 +1,71 @@ +solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V1.VoiceInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Pricing/V1/VoiceList.php b/app/api/Twilio/Rest/Pricing/V1/VoiceList.php new file mode 100755 index 0000000..54609fc --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V1/VoiceList.php @@ -0,0 +1,123 @@ +solution = [ + ]; + } + + /** + * Access the countries + */ + protected function getCountries(): CountryList + { + if (!$this->_countries) { + $this->_countries = new CountryList( + $this->version + ); + } + return $this->_countries; + } + + /** + * Access the numbers + */ + protected function getNumbers(): NumberList + { + if (!$this->_numbers) { + $this->_numbers = new NumberList( + $this->version + ); + } + return $this->_numbers; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name) + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V1.VoiceList]'; + } +} diff --git a/app/api/Twilio/Rest/Pricing/V1/VoicePage.php b/app/api/Twilio/Rest/Pricing/V1/VoicePage.php new file mode 100755 index 0000000..10f58d2 --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V1/VoicePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return VoiceInstance \Twilio\Rest\Pricing\V1\VoiceInstance + */ + public function buildInstance(array $payload): VoiceInstance + { + return new VoiceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V1.VoicePage]'; + } +} diff --git a/app/api/Twilio/Rest/Pricing/V2.php b/app/api/Twilio/Rest/Pricing/V2.php new file mode 100755 index 0000000..049b162 --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V2.php @@ -0,0 +1,118 @@ +version = 'v2'; + } + + protected function getCountries(): CountryList + { + if (!$this->_countries) { + $this->_countries = new CountryList($this); + } + return $this->_countries; + } + + protected function getNumbers(): NumberList + { + if (!$this->_numbers) { + $this->_numbers = new NumberList($this); + } + return $this->_numbers; + } + + protected function getVoice(): VoiceList + { + if (!$this->_voice) { + $this->_voice = new VoiceList($this); + } + return $this->_voice; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V2]'; + } +} diff --git a/app/api/Twilio/Rest/Pricing/V2/CountryContext.php b/app/api/Twilio/Rest/Pricing/V2/CountryContext.php new file mode 100755 index 0000000..8442615 --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V2/CountryContext.php @@ -0,0 +1,81 @@ +solution = [ + 'isoCountry' => + $isoCountry, + ]; + + $this->uri = '/Trunking/Countries/' . \rawurlencode($isoCountry) + .''; + } + + /** + * Fetch the CountryInstance + * + * @return CountryInstance Fetched CountryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CountryInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new CountryInstance( + $this->version, + $payload, + $this->solution['isoCountry'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Pricing.V2.CountryContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Pricing/V2/CountryInstance.php b/app/api/Twilio/Rest/Pricing/V2/CountryInstance.php new file mode 100755 index 0000000..14e1655 --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V2/CountryInstance.php @@ -0,0 +1,125 @@ +properties = [ + 'country' => Values::array_get($payload, 'country'), + 'isoCountry' => Values::array_get($payload, 'iso_country'), + 'terminatingPrefixPrices' => Values::array_get($payload, 'terminating_prefix_prices'), + 'originatingCallPrices' => Values::array_get($payload, 'originating_call_prices'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['isoCountry' => $isoCountry ?: $this->properties['isoCountry'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CountryContext Context for this CountryInstance + */ + protected function proxy(): CountryContext + { + if (!$this->context) { + $this->context = new CountryContext( + $this->version, + $this->solution['isoCountry'] + ); + } + + return $this->context; + } + + /** + * Fetch the CountryInstance + * + * @return CountryInstance Fetched CountryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CountryInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Pricing.V2.CountryInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Pricing/V2/CountryList.php b/app/api/Twilio/Rest/Pricing/V2/CountryList.php new file mode 100755 index 0000000..7a21f4c --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V2/CountryList.php @@ -0,0 +1,161 @@ +solution = [ + ]; + + $this->uri = '/Trunking/Countries'; + } + + /** + * Reads CountryInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return CountryInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams CountryInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CountryInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return CountryPage Page of CountryInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CountryPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new CountryPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of CountryInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return CountryPage Page of CountryInstance + */ + public function getPage(string $targetUrl): CountryPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CountryPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CountryContext + * + * @param string $isoCountry The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the origin-based voice pricing information to fetch. + */ + public function getContext( + string $isoCountry + + ): CountryContext + { + return new CountryContext( + $this->version, + $isoCountry + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V2.CountryList]'; + } +} diff --git a/app/api/Twilio/Rest/Pricing/V2/CountryPage.php b/app/api/Twilio/Rest/Pricing/V2/CountryPage.php new file mode 100755 index 0000000..2a062b3 --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V2/CountryPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CountryInstance \Twilio\Rest\Pricing\V2\CountryInstance + */ + public function buildInstance(array $payload): CountryInstance + { + return new CountryInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V2.CountryPage]'; + } +} diff --git a/app/api/Twilio/Rest/Pricing/V2/NumberContext.php b/app/api/Twilio/Rest/Pricing/V2/NumberContext.php new file mode 100755 index 0000000..7e8c73c --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V2/NumberContext.php @@ -0,0 +1,91 @@ +solution = [ + 'destinationNumber' => + $destinationNumber, + ]; + + $this->uri = '/Trunking/Numbers/' . \rawurlencode($destinationNumber) + .''; + } + + /** + * Fetch the NumberInstance + * + * @param array|Options $options Optional Arguments + * @return NumberInstance Fetched NumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): NumberInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'OriginationNumber' => + $options['originationNumber'], + ]); + + $payload = $this->version->fetch('GET', $this->uri, $params); + + return new NumberInstance( + $this->version, + $payload, + $this->solution['destinationNumber'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Pricing.V2.NumberContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Pricing/V2/NumberInstance.php b/app/api/Twilio/Rest/Pricing/V2/NumberInstance.php new file mode 100755 index 0000000..bbbed66 --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V2/NumberInstance.php @@ -0,0 +1,131 @@ +properties = [ + 'destinationNumber' => Values::array_get($payload, 'destination_number'), + 'originationNumber' => Values::array_get($payload, 'origination_number'), + 'country' => Values::array_get($payload, 'country'), + 'isoCountry' => Values::array_get($payload, 'iso_country'), + 'terminatingPrefixPrices' => Values::array_get($payload, 'terminating_prefix_prices'), + 'originatingCallPrice' => Values::array_get($payload, 'originating_call_price'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['destinationNumber' => $destinationNumber ?: $this->properties['destinationNumber'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return NumberContext Context for this NumberInstance + */ + protected function proxy(): NumberContext + { + if (!$this->context) { + $this->context = new NumberContext( + $this->version, + $this->solution['destinationNumber'] + ); + } + + return $this->context; + } + + /** + * Fetch the NumberInstance + * + * @param array|Options $options Optional Arguments + * @return NumberInstance Fetched NumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): NumberInstance + { + + return $this->proxy()->fetch($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Pricing.V2.NumberInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Pricing/V2/NumberList.php b/app/api/Twilio/Rest/Pricing/V2/NumberList.php new file mode 100755 index 0000000..185a9ab --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V2/NumberList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a NumberContext + * + * @param string $destinationNumber The destination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. + */ + public function getContext( + string $destinationNumber + + ): NumberContext + { + return new NumberContext( + $this->version, + $destinationNumber + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V2.NumberList]'; + } +} diff --git a/app/api/Twilio/Rest/Pricing/V2/NumberOptions.php b/app/api/Twilio/Rest/Pricing/V2/NumberOptions.php new file mode 100755 index 0000000..5f54ff1 --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V2/NumberOptions.php @@ -0,0 +1,76 @@ +options['originationNumber'] = $originationNumber; + } + + /** + * The origination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. + * + * @param string $originationNumber The origination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. + * @return $this Fluent Builder + */ + public function setOriginationNumber(string $originationNumber): self + { + $this->options['originationNumber'] = $originationNumber; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Pricing.V2.FetchNumberOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Pricing/V2/NumberPage.php b/app/api/Twilio/Rest/Pricing/V2/NumberPage.php new file mode 100755 index 0000000..57d41a2 --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V2/NumberPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return NumberInstance \Twilio\Rest\Pricing\V2\NumberInstance + */ + public function buildInstance(array $payload): NumberInstance + { + return new NumberInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V2.NumberPage]'; + } +} diff --git a/app/api/Twilio/Rest/Pricing/V2/Voice/CountryContext.php b/app/api/Twilio/Rest/Pricing/V2/Voice/CountryContext.php new file mode 100755 index 0000000..e093357 --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V2/Voice/CountryContext.php @@ -0,0 +1,81 @@ +solution = [ + 'isoCountry' => + $isoCountry, + ]; + + $this->uri = '/Voice/Countries/' . \rawurlencode($isoCountry) + .''; + } + + /** + * Fetch the CountryInstance + * + * @return CountryInstance Fetched CountryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CountryInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new CountryInstance( + $this->version, + $payload, + $this->solution['isoCountry'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Pricing.V2.CountryContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Pricing/V2/Voice/CountryInstance.php b/app/api/Twilio/Rest/Pricing/V2/Voice/CountryInstance.php new file mode 100755 index 0000000..fb4211f --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V2/Voice/CountryInstance.php @@ -0,0 +1,125 @@ +properties = [ + 'country' => Values::array_get($payload, 'country'), + 'isoCountry' => Values::array_get($payload, 'iso_country'), + 'outboundPrefixPrices' => Values::array_get($payload, 'outbound_prefix_prices'), + 'inboundCallPrices' => Values::array_get($payload, 'inbound_call_prices'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['isoCountry' => $isoCountry ?: $this->properties['isoCountry'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CountryContext Context for this CountryInstance + */ + protected function proxy(): CountryContext + { + if (!$this->context) { + $this->context = new CountryContext( + $this->version, + $this->solution['isoCountry'] + ); + } + + return $this->context; + } + + /** + * Fetch the CountryInstance + * + * @return CountryInstance Fetched CountryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CountryInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Pricing.V2.CountryInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Pricing/V2/Voice/CountryList.php b/app/api/Twilio/Rest/Pricing/V2/Voice/CountryList.php new file mode 100755 index 0000000..462ebc8 --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V2/Voice/CountryList.php @@ -0,0 +1,161 @@ +solution = [ + ]; + + $this->uri = '/Voice/Countries'; + } + + /** + * Reads CountryInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return CountryInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams CountryInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CountryInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return CountryPage Page of CountryInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CountryPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new CountryPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of CountryInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return CountryPage Page of CountryInstance + */ + public function getPage(string $targetUrl): CountryPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CountryPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CountryContext + * + * @param string $isoCountry The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the origin-based voice pricing information to fetch. + */ + public function getContext( + string $isoCountry + + ): CountryContext + { + return new CountryContext( + $this->version, + $isoCountry + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V2.CountryList]'; + } +} diff --git a/app/api/Twilio/Rest/Pricing/V2/Voice/CountryPage.php b/app/api/Twilio/Rest/Pricing/V2/Voice/CountryPage.php new file mode 100755 index 0000000..bd7a461 --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V2/Voice/CountryPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CountryInstance \Twilio\Rest\Pricing\V2\Voice\CountryInstance + */ + public function buildInstance(array $payload): CountryInstance + { + return new CountryInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V2.CountryPage]'; + } +} diff --git a/app/api/Twilio/Rest/Pricing/V2/Voice/NumberContext.php b/app/api/Twilio/Rest/Pricing/V2/Voice/NumberContext.php new file mode 100755 index 0000000..88be2cd --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V2/Voice/NumberContext.php @@ -0,0 +1,91 @@ +solution = [ + 'destinationNumber' => + $destinationNumber, + ]; + + $this->uri = '/Voice/Numbers/' . \rawurlencode($destinationNumber) + .''; + } + + /** + * Fetch the NumberInstance + * + * @param array|Options $options Optional Arguments + * @return NumberInstance Fetched NumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): NumberInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'OriginationNumber' => + $options['originationNumber'], + ]); + + $payload = $this->version->fetch('GET', $this->uri, $params); + + return new NumberInstance( + $this->version, + $payload, + $this->solution['destinationNumber'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Pricing.V2.NumberContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Pricing/V2/Voice/NumberInstance.php b/app/api/Twilio/Rest/Pricing/V2/Voice/NumberInstance.php new file mode 100755 index 0000000..584d63b --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V2/Voice/NumberInstance.php @@ -0,0 +1,131 @@ +properties = [ + 'destinationNumber' => Values::array_get($payload, 'destination_number'), + 'originationNumber' => Values::array_get($payload, 'origination_number'), + 'country' => Values::array_get($payload, 'country'), + 'isoCountry' => Values::array_get($payload, 'iso_country'), + 'outboundCallPrices' => Values::array_get($payload, 'outbound_call_prices'), + 'inboundCallPrice' => Values::array_get($payload, 'inbound_call_price'), + 'priceUnit' => Values::array_get($payload, 'price_unit'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['destinationNumber' => $destinationNumber ?: $this->properties['destinationNumber'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return NumberContext Context for this NumberInstance + */ + protected function proxy(): NumberContext + { + if (!$this->context) { + $this->context = new NumberContext( + $this->version, + $this->solution['destinationNumber'] + ); + } + + return $this->context; + } + + /** + * Fetch the NumberInstance + * + * @param array|Options $options Optional Arguments + * @return NumberInstance Fetched NumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): NumberInstance + { + + return $this->proxy()->fetch($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Pricing.V2.NumberInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Pricing/V2/Voice/NumberList.php b/app/api/Twilio/Rest/Pricing/V2/Voice/NumberList.php new file mode 100755 index 0000000..66d800b --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V2/Voice/NumberList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a NumberContext + * + * @param string $destinationNumber The destination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. + */ + public function getContext( + string $destinationNumber + + ): NumberContext + { + return new NumberContext( + $this->version, + $destinationNumber + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V2.NumberList]'; + } +} diff --git a/app/api/Twilio/Rest/Pricing/V2/Voice/NumberOptions.php b/app/api/Twilio/Rest/Pricing/V2/Voice/NumberOptions.php new file mode 100755 index 0000000..310d180 --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V2/Voice/NumberOptions.php @@ -0,0 +1,76 @@ +options['originationNumber'] = $originationNumber; + } + + /** + * The origination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. + * + * @param string $originationNumber The origination phone number, in [E.164](https://www.twilio.com/docs/glossary/what-e164) format, for which to fetch the origin-based voice pricing information. E.164 format consists of a + followed by the country code and subscriber number. + * @return $this Fluent Builder + */ + public function setOriginationNumber(string $originationNumber): self + { + $this->options['originationNumber'] = $originationNumber; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Pricing.V2.FetchNumberOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Pricing/V2/Voice/NumberPage.php b/app/api/Twilio/Rest/Pricing/V2/Voice/NumberPage.php new file mode 100755 index 0000000..45702eb --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V2/Voice/NumberPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return NumberInstance \Twilio\Rest\Pricing\V2\Voice\NumberInstance + */ + public function buildInstance(array $payload): NumberInstance + { + return new NumberInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V2.NumberPage]'; + } +} diff --git a/app/api/Twilio/Rest/Pricing/V2/VoiceInstance.php b/app/api/Twilio/Rest/Pricing/V2/VoiceInstance.php new file mode 100755 index 0000000..39ab5c0 --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V2/VoiceInstance.php @@ -0,0 +1,71 @@ +solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V2.VoiceInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Pricing/V2/VoiceList.php b/app/api/Twilio/Rest/Pricing/V2/VoiceList.php new file mode 100755 index 0000000..ab6ee94 --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V2/VoiceList.php @@ -0,0 +1,123 @@ +solution = [ + ]; + } + + /** + * Access the countries + */ + protected function getCountries(): CountryList + { + if (!$this->_countries) { + $this->_countries = new CountryList( + $this->version + ); + } + return $this->_countries; + } + + /** + * Access the numbers + */ + protected function getNumbers(): NumberList + { + if (!$this->_numbers) { + $this->_numbers = new NumberList( + $this->version + ); + } + return $this->_numbers; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name) + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V2.VoiceList]'; + } +} diff --git a/app/api/Twilio/Rest/Pricing/V2/VoicePage.php b/app/api/Twilio/Rest/Pricing/V2/VoicePage.php new file mode 100755 index 0000000..3d04135 --- /dev/null +++ b/app/api/Twilio/Rest/Pricing/V2/VoicePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return VoiceInstance \Twilio\Rest\Pricing\V2\VoiceInstance + */ + public function buildInstance(array $payload): VoiceInstance + { + return new VoiceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Pricing.V2.VoicePage]'; + } +} diff --git a/app/api/Twilio/Rest/PricingBase.php b/app/api/Twilio/Rest/PricingBase.php new file mode 100755 index 0000000..a08bd9d --- /dev/null +++ b/app/api/Twilio/Rest/PricingBase.php @@ -0,0 +1,101 @@ +baseUrl = 'https://pricing.twilio.com'; + } + + + /** + * @return V1 Version v1 of pricing + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * @return V2 Version v2 of pricing + */ + protected function getV2(): V2 { + if (!$this->_v2) { + $this->_v2 = new V2($this); + } + return $this->_v2; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Pricing]'; + } +} diff --git a/app/api/Twilio/Rest/Proxy.php b/app/api/Twilio/Rest/Proxy.php new file mode 100755 index 0000000..a7ca292 --- /dev/null +++ b/app/api/Twilio/Rest/Proxy.php @@ -0,0 +1,25 @@ +services instead. + */ + protected function getServices(): \Twilio\Rest\Proxy\V1\ServiceList { + echo "services is deprecated. Use v1->services instead."; + return $this->v1->services; + } + + /** + * @deprecated Use v1->services(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextServices(string $sid): \Twilio\Rest\Proxy\V1\ServiceContext { + echo "services(\$sid) is deprecated. Use v1->services(\$sid) instead."; + return $this->v1->services($sid); + } +} \ No newline at end of file diff --git a/app/api/Twilio/Rest/Proxy/V1.php b/app/api/Twilio/Rest/Proxy/V1.php new file mode 100755 index 0000000..d9c67cd --- /dev/null +++ b/app/api/Twilio/Rest/Proxy/V1.php @@ -0,0 +1,95 @@ +version = 'v1'; + } + + protected function getServices(): ServiceList + { + if (!$this->_services) { + $this->_services = new ServiceList($this); + } + return $this->_services; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Proxy.V1]'; + } +} diff --git a/app/api/Twilio/Rest/Proxy/V1/Service/PhoneNumberContext.php b/app/api/Twilio/Rest/Proxy/V1/Service/PhoneNumberContext.php new file mode 100755 index 0000000..65bd3ea --- /dev/null +++ b/app/api/Twilio/Rest/Proxy/V1/Service/PhoneNumberContext.php @@ -0,0 +1,131 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/PhoneNumbers/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the PhoneNumberInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the PhoneNumberInstance + * + * @return PhoneNumberInstance Fetched PhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PhoneNumberInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new PhoneNumberInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the PhoneNumberInstance + * + * @param array|Options $options Optional Arguments + * @return PhoneNumberInstance Updated PhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): PhoneNumberInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'IsReserved' => + Serialize::booleanToString($options['isReserved']), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new PhoneNumberInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Proxy.V1.PhoneNumberContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Proxy/V1/Service/PhoneNumberInstance.php b/app/api/Twilio/Rest/Proxy/V1/Service/PhoneNumberInstance.php new file mode 100755 index 0000000..764226d --- /dev/null +++ b/app/api/Twilio/Rest/Proxy/V1/Service/PhoneNumberInstance.php @@ -0,0 +1,167 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'phoneNumber' => Values::array_get($payload, 'phone_number'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'isoCountry' => Values::array_get($payload, 'iso_country'), + 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), + 'url' => Values::array_get($payload, 'url'), + 'isReserved' => Values::array_get($payload, 'is_reserved'), + 'inUse' => Values::array_get($payload, 'in_use'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return PhoneNumberContext Context for this PhoneNumberInstance + */ + protected function proxy(): PhoneNumberContext + { + if (!$this->context) { + $this->context = new PhoneNumberContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the PhoneNumberInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the PhoneNumberInstance + * + * @return PhoneNumberInstance Fetched PhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PhoneNumberInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the PhoneNumberInstance + * + * @param array|Options $options Optional Arguments + * @return PhoneNumberInstance Updated PhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): PhoneNumberInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Proxy.V1.PhoneNumberInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Proxy/V1/Service/PhoneNumberList.php b/app/api/Twilio/Rest/Proxy/V1/Service/PhoneNumberList.php new file mode 100755 index 0000000..7a824f8 --- /dev/null +++ b/app/api/Twilio/Rest/Proxy/V1/Service/PhoneNumberList.php @@ -0,0 +1,202 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/PhoneNumbers'; + } + + /** + * Create the PhoneNumberInstance + * + * @param array|Options $options Optional Arguments + * @return PhoneNumberInstance Created PhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): PhoneNumberInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Sid' => + $options['sid'], + 'PhoneNumber' => + $options['phoneNumber'], + 'IsReserved' => + Serialize::booleanToString($options['isReserved']), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new PhoneNumberInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads PhoneNumberInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return PhoneNumberInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams PhoneNumberInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of PhoneNumberInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return PhoneNumberPage Page of PhoneNumberInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): PhoneNumberPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new PhoneNumberPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of PhoneNumberInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return PhoneNumberPage Page of PhoneNumberInstance + */ + public function getPage(string $targetUrl): PhoneNumberPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new PhoneNumberPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a PhoneNumberContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the PhoneNumber resource to delete. + */ + public function getContext( + string $sid + + ): PhoneNumberContext + { + return new PhoneNumberContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Proxy.V1.PhoneNumberList]'; + } +} diff --git a/app/api/Twilio/Rest/Proxy/V1/Service/PhoneNumberOptions.php b/app/api/Twilio/Rest/Proxy/V1/Service/PhoneNumberOptions.php new file mode 100755 index 0000000..d15e852 --- /dev/null +++ b/app/api/Twilio/Rest/Proxy/V1/Service/PhoneNumberOptions.php @@ -0,0 +1,170 @@ +options['sid'] = $sid; + $this->options['phoneNumber'] = $phoneNumber; + $this->options['isReserved'] = $isReserved; + } + + /** + * The SID of a Twilio [IncomingPhoneNumber](https://www.twilio.com/docs/phone-numbers/api/incomingphonenumber-resource) resource that represents the Twilio Number you would like to assign to your Proxy Service. + * + * @param string $sid The SID of a Twilio [IncomingPhoneNumber](https://www.twilio.com/docs/phone-numbers/api/incomingphonenumber-resource) resource that represents the Twilio Number you would like to assign to your Proxy Service. + * @return $this Fluent Builder + */ + public function setSid(string $sid): self + { + $this->options['sid'] = $sid; + return $this; + } + + /** + * The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234. + * + * @param string $phoneNumber The phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) format. E.164 phone numbers consist of a + followed by the country code and subscriber number without punctuation characters. For example, +14155551234. + * @return $this Fluent Builder + */ + public function setPhoneNumber(string $phoneNumber): self + { + $this->options['phoneNumber'] = $phoneNumber; + return $this; + } + + /** + * Whether the new phone number should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information. + * + * @param bool $isReserved Whether the new phone number should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information. + * @return $this Fluent Builder + */ + public function setIsReserved(bool $isReserved): self + { + $this->options['isReserved'] = $isReserved; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Proxy.V1.CreatePhoneNumberOptions ' . $options . ']'; + } +} + + + + +class UpdatePhoneNumberOptions extends Options + { + /** + * @param bool $isReserved Whether the phone number should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information. + */ + public function __construct( + + bool $isReserved = Values::BOOL_NONE + + ) { + $this->options['isReserved'] = $isReserved; + } + + /** + * Whether the phone number should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information. + * + * @param bool $isReserved Whether the phone number should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information. + * @return $this Fluent Builder + */ + public function setIsReserved(bool $isReserved): self + { + $this->options['isReserved'] = $isReserved; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Proxy.V1.UpdatePhoneNumberOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Proxy/V1/Service/PhoneNumberPage.php b/app/api/Twilio/Rest/Proxy/V1/Service/PhoneNumberPage.php new file mode 100755 index 0000000..a062040 --- /dev/null +++ b/app/api/Twilio/Rest/Proxy/V1/Service/PhoneNumberPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PhoneNumberInstance \Twilio\Rest\Proxy\V1\Service\PhoneNumberInstance + */ + public function buildInstance(array $payload): PhoneNumberInstance + { + return new PhoneNumberInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Proxy.V1.PhoneNumberPage]'; + } +} diff --git a/app/api/Twilio/Rest/Proxy/V1/Service/Session/InteractionContext.php b/app/api/Twilio/Rest/Proxy/V1/Service/Session/InteractionContext.php new file mode 100755 index 0000000..15e0d42 --- /dev/null +++ b/app/api/Twilio/Rest/Proxy/V1/Service/Session/InteractionContext.php @@ -0,0 +1,106 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sessionSid' => + $sessionSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Sessions/' . \rawurlencode($sessionSid) + .'/Interactions/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the InteractionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the InteractionInstance + * + * @return InteractionInstance Fetched InteractionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InteractionInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new InteractionInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sessionSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Proxy.V1.InteractionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Proxy/V1/Service/Session/InteractionInstance.php b/app/api/Twilio/Rest/Proxy/V1/Service/Session/InteractionInstance.php new file mode 100755 index 0000000..819b96c --- /dev/null +++ b/app/api/Twilio/Rest/Proxy/V1/Service/Session/InteractionInstance.php @@ -0,0 +1,168 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'sessionSid' => Values::array_get($payload, 'session_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'data' => Values::array_get($payload, 'data'), + 'type' => Values::array_get($payload, 'type'), + 'inboundParticipantSid' => Values::array_get($payload, 'inbound_participant_sid'), + 'inboundResourceSid' => Values::array_get($payload, 'inbound_resource_sid'), + 'inboundResourceStatus' => Values::array_get($payload, 'inbound_resource_status'), + 'inboundResourceType' => Values::array_get($payload, 'inbound_resource_type'), + 'inboundResourceUrl' => Values::array_get($payload, 'inbound_resource_url'), + 'outboundParticipantSid' => Values::array_get($payload, 'outbound_participant_sid'), + 'outboundResourceSid' => Values::array_get($payload, 'outbound_resource_sid'), + 'outboundResourceStatus' => Values::array_get($payload, 'outbound_resource_status'), + 'outboundResourceType' => Values::array_get($payload, 'outbound_resource_type'), + 'outboundResourceUrl' => Values::array_get($payload, 'outbound_resource_url'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sessionSid' => $sessionSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return InteractionContext Context for this InteractionInstance + */ + protected function proxy(): InteractionContext + { + if (!$this->context) { + $this->context = new InteractionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sessionSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the InteractionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the InteractionInstance + * + * @return InteractionInstance Fetched InteractionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): InteractionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Proxy.V1.InteractionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Proxy/V1/Service/Session/InteractionList.php b/app/api/Twilio/Rest/Proxy/V1/Service/Session/InteractionList.php new file mode 100755 index 0000000..25e7f09 --- /dev/null +++ b/app/api/Twilio/Rest/Proxy/V1/Service/Session/InteractionList.php @@ -0,0 +1,175 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'sessionSid' => + $sessionSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Sessions/' . \rawurlencode($sessionSid) + .'/Interactions'; + } + + /** + * Reads InteractionInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return InteractionInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams InteractionInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of InteractionInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return InteractionPage Page of InteractionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): InteractionPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new InteractionPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of InteractionInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return InteractionPage Page of InteractionInstance + */ + public function getPage(string $targetUrl): InteractionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new InteractionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a InteractionContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Interaction resource to delete. + */ + public function getContext( + string $sid + + ): InteractionContext + { + return new InteractionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sessionSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Proxy.V1.InteractionList]'; + } +} diff --git a/app/api/Twilio/Rest/Proxy/V1/Service/Session/InteractionPage.php b/app/api/Twilio/Rest/Proxy/V1/Service/Session/InteractionPage.php new file mode 100755 index 0000000..e5e7971 --- /dev/null +++ b/app/api/Twilio/Rest/Proxy/V1/Service/Session/InteractionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return InteractionInstance \Twilio\Rest\Proxy\V1\Service\Session\InteractionInstance + */ + public function buildInstance(array $payload): InteractionInstance + { + return new InteractionInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['sessionSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Proxy.V1.InteractionPage]'; + } +} diff --git a/app/api/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionContext.php b/app/api/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionContext.php new file mode 100755 index 0000000..15a84f2 --- /dev/null +++ b/app/api/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionContext.php @@ -0,0 +1,99 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sessionSid' => + $sessionSid, + 'participantSid' => + $participantSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Sessions/' . \rawurlencode($sessionSid) + .'/Participants/' . \rawurlencode($participantSid) + .'/MessageInteractions/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the MessageInteractionInstance + * + * @return MessageInteractionInstance Fetched MessageInteractionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MessageInteractionInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new MessageInteractionInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sessionSid'], + $this->solution['participantSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Proxy.V1.MessageInteractionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionInstance.php b/app/api/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionInstance.php new file mode 100755 index 0000000..17207aa --- /dev/null +++ b/app/api/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionInstance.php @@ -0,0 +1,160 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'sessionSid' => Values::array_get($payload, 'session_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'data' => Values::array_get($payload, 'data'), + 'type' => Values::array_get($payload, 'type'), + 'participantSid' => Values::array_get($payload, 'participant_sid'), + 'inboundParticipantSid' => Values::array_get($payload, 'inbound_participant_sid'), + 'inboundResourceSid' => Values::array_get($payload, 'inbound_resource_sid'), + 'inboundResourceStatus' => Values::array_get($payload, 'inbound_resource_status'), + 'inboundResourceType' => Values::array_get($payload, 'inbound_resource_type'), + 'inboundResourceUrl' => Values::array_get($payload, 'inbound_resource_url'), + 'outboundParticipantSid' => Values::array_get($payload, 'outbound_participant_sid'), + 'outboundResourceSid' => Values::array_get($payload, 'outbound_resource_sid'), + 'outboundResourceStatus' => Values::array_get($payload, 'outbound_resource_status'), + 'outboundResourceType' => Values::array_get($payload, 'outbound_resource_type'), + 'outboundResourceUrl' => Values::array_get($payload, 'outbound_resource_url'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sessionSid' => $sessionSid, 'participantSid' => $participantSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return MessageInteractionContext Context for this MessageInteractionInstance + */ + protected function proxy(): MessageInteractionContext + { + if (!$this->context) { + $this->context = new MessageInteractionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sessionSid'], + $this->solution['participantSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the MessageInteractionInstance + * + * @return MessageInteractionInstance Fetched MessageInteractionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MessageInteractionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Proxy.V1.MessageInteractionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionList.php b/app/api/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionList.php new file mode 100755 index 0000000..600b7d4 --- /dev/null +++ b/app/api/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionList.php @@ -0,0 +1,216 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'sessionSid' => + $sessionSid, + + 'participantSid' => + $participantSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Sessions/' . \rawurlencode($sessionSid) + .'/Participants/' . \rawurlencode($participantSid) + .'/MessageInteractions'; + } + + /** + * Create the MessageInteractionInstance + * + * @param array|Options $options Optional Arguments + * @return MessageInteractionInstance Created MessageInteractionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): MessageInteractionInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Body' => + $options['body'], + 'MediaUrl' => + Serialize::map($options['mediaUrl'], function ($e) { return $e; }), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new MessageInteractionInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sessionSid'], + $this->solution['participantSid'] + ); + } + + + /** + * Reads MessageInteractionInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return MessageInteractionInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams MessageInteractionInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of MessageInteractionInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return MessageInteractionPage Page of MessageInteractionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MessageInteractionPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new MessageInteractionPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of MessageInteractionInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return MessageInteractionPage Page of MessageInteractionInstance + */ + public function getPage(string $targetUrl): MessageInteractionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new MessageInteractionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a MessageInteractionContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the MessageInteraction resource to fetch. + */ + public function getContext( + string $sid + + ): MessageInteractionContext + { + return new MessageInteractionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sessionSid'], + $this->solution['participantSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Proxy.V1.MessageInteractionList]'; + } +} diff --git a/app/api/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionOptions.php b/app/api/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionOptions.php new file mode 100755 index 0000000..4d481a0 --- /dev/null +++ b/app/api/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionOptions.php @@ -0,0 +1,98 @@ +options['body'] = $body; + $this->options['mediaUrl'] = $mediaUrl; + } + + /** + * The message to send to the participant + * + * @param string $body The message to send to the participant + * @return $this Fluent Builder + */ + public function setBody(string $body): self + { + $this->options['body'] = $body; + return $this; + } + + /** + * Reserved. Not currently supported. + * + * @param string[] $mediaUrl Reserved. Not currently supported. + * @return $this Fluent Builder + */ + public function setMediaUrl(array $mediaUrl): self + { + $this->options['mediaUrl'] = $mediaUrl; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Proxy.V1.CreateMessageInteractionOptions ' . $options . ']'; + } +} + + + diff --git a/app/api/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionPage.php b/app/api/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionPage.php new file mode 100755 index 0000000..6983b36 --- /dev/null +++ b/app/api/Twilio/Rest/Proxy/V1/Service/Session/Participant/MessageInteractionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MessageInteractionInstance \Twilio\Rest\Proxy\V1\Service\Session\Participant\MessageInteractionInstance + */ + public function buildInstance(array $payload): MessageInteractionInstance + { + return new MessageInteractionInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['sessionSid'], $this->solution['participantSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Proxy.V1.MessageInteractionPage]'; + } +} diff --git a/app/api/Twilio/Rest/Proxy/V1/Service/Session/ParticipantContext.php b/app/api/Twilio/Rest/Proxy/V1/Service/Session/ParticipantContext.php new file mode 100755 index 0000000..3bf84aa --- /dev/null +++ b/app/api/Twilio/Rest/Proxy/V1/Service/Session/ParticipantContext.php @@ -0,0 +1,166 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sessionSid' => + $sessionSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Sessions/' . \rawurlencode($sessionSid) + .'/Participants/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ParticipantInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the ParticipantInstance + * + * @return ParticipantInstance Fetched ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ParticipantInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ParticipantInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sessionSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the messageInteractions + */ + protected function getMessageInteractions(): MessageInteractionList + { + if (!$this->_messageInteractions) { + $this->_messageInteractions = new MessageInteractionList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sessionSid'], + $this->solution['sid'] + ); + } + + return $this->_messageInteractions; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Proxy.V1.ParticipantContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Proxy/V1/Service/Session/ParticipantInstance.php b/app/api/Twilio/Rest/Proxy/V1/Service/Session/ParticipantInstance.php new file mode 100755 index 0000000..e595ad7 --- /dev/null +++ b/app/api/Twilio/Rest/Proxy/V1/Service/Session/ParticipantInstance.php @@ -0,0 +1,167 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'sessionSid' => Values::array_get($payload, 'session_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'identifier' => Values::array_get($payload, 'identifier'), + 'proxyIdentifier' => Values::array_get($payload, 'proxy_identifier'), + 'proxyIdentifierSid' => Values::array_get($payload, 'proxy_identifier_sid'), + 'dateDeleted' => Deserialize::dateTime(Values::array_get($payload, 'date_deleted')), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sessionSid' => $sessionSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ParticipantContext Context for this ParticipantInstance + */ + protected function proxy(): ParticipantContext + { + if (!$this->context) { + $this->context = new ParticipantContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sessionSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ParticipantInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ParticipantInstance + * + * @return ParticipantInstance Fetched ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ParticipantInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the messageInteractions + */ + protected function getMessageInteractions(): MessageInteractionList + { + return $this->proxy()->messageInteractions; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Proxy.V1.ParticipantInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Proxy/V1/Service/Session/ParticipantList.php b/app/api/Twilio/Rest/Proxy/V1/Service/Session/ParticipantList.php new file mode 100755 index 0000000..0740ffb --- /dev/null +++ b/app/api/Twilio/Rest/Proxy/V1/Service/Session/ParticipantList.php @@ -0,0 +1,212 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'sessionSid' => + $sessionSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Sessions/' . \rawurlencode($sessionSid) + .'/Participants'; + } + + /** + * Create the ParticipantInstance + * + * @param string $identifier The phone number of the Participant. + * @param array|Options $options Optional Arguments + * @return ParticipantInstance Created ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $identifier, array $options = []): ParticipantInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Identifier' => + $identifier, + 'FriendlyName' => + $options['friendlyName'], + 'ProxyIdentifier' => + $options['proxyIdentifier'], + 'ProxyIdentifierSid' => + $options['proxyIdentifierSid'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new ParticipantInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sessionSid'] + ); + } + + + /** + * Reads ParticipantInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ParticipantInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ParticipantInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ParticipantInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ParticipantPage Page of ParticipantInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ParticipantPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ParticipantPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ParticipantInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ParticipantPage Page of ParticipantInstance + */ + public function getPage(string $targetUrl): ParticipantPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ParticipantPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ParticipantContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Participant resource to delete. + */ + public function getContext( + string $sid + + ): ParticipantContext + { + return new ParticipantContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sessionSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Proxy.V1.ParticipantList]'; + } +} diff --git a/app/api/Twilio/Rest/Proxy/V1/Service/Session/ParticipantOptions.php b/app/api/Twilio/Rest/Proxy/V1/Service/Session/ParticipantOptions.php new file mode 100755 index 0000000..0f79064 --- /dev/null +++ b/app/api/Twilio/Rest/Proxy/V1/Service/Session/ParticipantOptions.php @@ -0,0 +1,118 @@ +options['friendlyName'] = $friendlyName; + $this->options['proxyIdentifier'] = $proxyIdentifier; + $this->options['proxyIdentifierSid'] = $proxyIdentifierSid; + } + + /** + * The string that you assigned to describe the participant. This value must be 255 characters or fewer. **This value should not have PII.** + * + * @param string $friendlyName The string that you assigned to describe the participant. This value must be 255 characters or fewer. **This value should not have PII.** + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The proxy phone number to use for the Participant. If not specified, Proxy will select a number from the pool. + * + * @param string $proxyIdentifier The proxy phone number to use for the Participant. If not specified, Proxy will select a number from the pool. + * @return $this Fluent Builder + */ + public function setProxyIdentifier(string $proxyIdentifier): self + { + $this->options['proxyIdentifier'] = $proxyIdentifier; + return $this; + } + + /** + * The SID of the Proxy Identifier to assign to the Participant. + * + * @param string $proxyIdentifierSid The SID of the Proxy Identifier to assign to the Participant. + * @return $this Fluent Builder + */ + public function setProxyIdentifierSid(string $proxyIdentifierSid): self + { + $this->options['proxyIdentifierSid'] = $proxyIdentifierSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Proxy.V1.CreateParticipantOptions ' . $options . ']'; + } +} + + + + diff --git a/app/api/Twilio/Rest/Proxy/V1/Service/Session/ParticipantPage.php b/app/api/Twilio/Rest/Proxy/V1/Service/Session/ParticipantPage.php new file mode 100755 index 0000000..bbff61d --- /dev/null +++ b/app/api/Twilio/Rest/Proxy/V1/Service/Session/ParticipantPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ParticipantInstance \Twilio\Rest\Proxy\V1\Service\Session\ParticipantInstance + */ + public function buildInstance(array $payload): ParticipantInstance + { + return new ParticipantInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['sessionSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Proxy.V1.ParticipantPage]'; + } +} diff --git a/app/api/Twilio/Rest/Proxy/V1/Service/SessionContext.php b/app/api/Twilio/Rest/Proxy/V1/Service/SessionContext.php new file mode 100755 index 0000000..4819844 --- /dev/null +++ b/app/api/Twilio/Rest/Proxy/V1/Service/SessionContext.php @@ -0,0 +1,214 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Sessions/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the SessionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the SessionInstance + * + * @return SessionInstance Fetched SessionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SessionInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new SessionInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the SessionInstance + * + * @param array|Options $options Optional Arguments + * @return SessionInstance Updated SessionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SessionInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'DateExpiry' => + Serialize::iso8601DateTime($options['dateExpiry']), + 'Ttl' => + $options['ttl'], + 'Status' => + $options['status'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new SessionInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the participants + */ + protected function getParticipants(): ParticipantList + { + if (!$this->_participants) { + $this->_participants = new ParticipantList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_participants; + } + + /** + * Access the interactions + */ + protected function getInteractions(): InteractionList + { + if (!$this->_interactions) { + $this->_interactions = new InteractionList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_interactions; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Proxy.V1.SessionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Proxy/V1/Service/SessionInstance.php b/app/api/Twilio/Rest/Proxy/V1/Service/SessionInstance.php new file mode 100755 index 0000000..a91fdf9 --- /dev/null +++ b/app/api/Twilio/Rest/Proxy/V1/Service/SessionInstance.php @@ -0,0 +1,195 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateStarted' => Deserialize::dateTime(Values::array_get($payload, 'date_started')), + 'dateEnded' => Deserialize::dateTime(Values::array_get($payload, 'date_ended')), + 'dateLastInteraction' => Deserialize::dateTime(Values::array_get($payload, 'date_last_interaction')), + 'dateExpiry' => Deserialize::dateTime(Values::array_get($payload, 'date_expiry')), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'status' => Values::array_get($payload, 'status'), + 'closedReason' => Values::array_get($payload, 'closed_reason'), + 'ttl' => Values::array_get($payload, 'ttl'), + 'mode' => Values::array_get($payload, 'mode'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SessionContext Context for this SessionInstance + */ + protected function proxy(): SessionContext + { + if (!$this->context) { + $this->context = new SessionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the SessionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SessionInstance + * + * @return SessionInstance Fetched SessionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SessionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SessionInstance + * + * @param array|Options $options Optional Arguments + * @return SessionInstance Updated SessionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SessionInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the participants + */ + protected function getParticipants(): ParticipantList + { + return $this->proxy()->participants; + } + + /** + * Access the interactions + */ + protected function getInteractions(): InteractionList + { + return $this->proxy()->interactions; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Proxy.V1.SessionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Proxy/V1/Service/SessionList.php b/app/api/Twilio/Rest/Proxy/V1/Service/SessionList.php new file mode 100755 index 0000000..06d9a1e --- /dev/null +++ b/app/api/Twilio/Rest/Proxy/V1/Service/SessionList.php @@ -0,0 +1,208 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Sessions'; + } + + /** + * Create the SessionInstance + * + * @param array|Options $options Optional Arguments + * @return SessionInstance Created SessionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): SessionInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + 'DateExpiry' => + Serialize::iso8601DateTime($options['dateExpiry']), + 'Ttl' => + $options['ttl'], + 'Mode' => + $options['mode'], + 'Status' => + $options['status'], + 'Participants' => + Serialize::map($options['participants'], function ($e) { return Serialize::jsonObject($e); }), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new SessionInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads SessionInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return SessionInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams SessionInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SessionInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return SessionPage Page of SessionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SessionPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SessionPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SessionInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SessionPage Page of SessionInstance + */ + public function getPage(string $targetUrl): SessionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SessionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SessionContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Session resource to delete. + */ + public function getContext( + string $sid + + ): SessionContext + { + return new SessionContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Proxy.V1.SessionList]'; + } +} diff --git a/app/api/Twilio/Rest/Proxy/V1/Service/SessionOptions.php b/app/api/Twilio/Rest/Proxy/V1/Service/SessionOptions.php new file mode 100755 index 0000000..7955256 --- /dev/null +++ b/app/api/Twilio/Rest/Proxy/V1/Service/SessionOptions.php @@ -0,0 +1,254 @@ +options['uniqueName'] = $uniqueName; + $this->options['dateExpiry'] = $dateExpiry; + $this->options['ttl'] = $ttl; + $this->options['mode'] = $mode; + $this->options['status'] = $status; + $this->options['participants'] = $participants; + } + + /** + * An application-defined string that uniquely identifies the resource. This value must be 191 characters or fewer in length and be unique. **This value should not have PII.** + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be 191 characters or fewer in length and be unique. **This value should not have PII.** + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date when the Session should expire. If this is value is present, it overrides the `ttl` value. + * + * @param \DateTime $dateExpiry The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date when the Session should expire. If this is value is present, it overrides the `ttl` value. + * @return $this Fluent Builder + */ + public function setDateExpiry(\DateTime $dateExpiry): self + { + $this->options['dateExpiry'] = $dateExpiry; + return $this; + } + + /** + * The time, in seconds, when the session will expire. The time is measured from the last Session create or the Session's last Interaction. + * + * @param int $ttl The time, in seconds, when the session will expire. The time is measured from the last Session create or the Session's last Interaction. + * @return $this Fluent Builder + */ + public function setTtl(int $ttl): self + { + $this->options['ttl'] = $ttl; + return $this; + } + + /** + * @param string $mode + * @return $this Fluent Builder + */ + public function setMode(string $mode): self + { + $this->options['mode'] = $mode; + return $this; + } + + /** + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * The Participant objects to include in the new session. + * + * @param array[] $participants The Participant objects to include in the new session. + * @return $this Fluent Builder + */ + public function setParticipants(array $participants): self + { + $this->options['participants'] = $participants; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Proxy.V1.CreateSessionOptions ' . $options . ']'; + } +} + + + + +class UpdateSessionOptions extends Options + { + /** + * @param \DateTime $dateExpiry The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date when the Session should expire. If this is value is present, it overrides the `ttl` value. + * @param int $ttl The time, in seconds, when the session will expire. The time is measured from the last Session create or the Session's last Interaction. + * @param string $status + */ + public function __construct( + + \DateTime $dateExpiry = null, + int $ttl = Values::INT_NONE, + string $status = Values::NONE + + ) { + $this->options['dateExpiry'] = $dateExpiry; + $this->options['ttl'] = $ttl; + $this->options['status'] = $status; + } + + /** + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date when the Session should expire. If this is value is present, it overrides the `ttl` value. + * + * @param \DateTime $dateExpiry The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date when the Session should expire. If this is value is present, it overrides the `ttl` value. + * @return $this Fluent Builder + */ + public function setDateExpiry(\DateTime $dateExpiry): self + { + $this->options['dateExpiry'] = $dateExpiry; + return $this; + } + + /** + * The time, in seconds, when the session will expire. The time is measured from the last Session create or the Session's last Interaction. + * + * @param int $ttl The time, in seconds, when the session will expire. The time is measured from the last Session create or the Session's last Interaction. + * @return $this Fluent Builder + */ + public function setTtl(int $ttl): self + { + $this->options['ttl'] = $ttl; + return $this; + } + + /** + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Proxy.V1.UpdateSessionOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Proxy/V1/Service/SessionPage.php b/app/api/Twilio/Rest/Proxy/V1/Service/SessionPage.php new file mode 100755 index 0000000..662a318 --- /dev/null +++ b/app/api/Twilio/Rest/Proxy/V1/Service/SessionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SessionInstance \Twilio\Rest\Proxy\V1\Service\SessionInstance + */ + public function buildInstance(array $payload): SessionInstance + { + return new SessionInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Proxy.V1.SessionPage]'; + } +} diff --git a/app/api/Twilio/Rest/Proxy/V1/Service/ShortCodeContext.php b/app/api/Twilio/Rest/Proxy/V1/Service/ShortCodeContext.php new file mode 100755 index 0000000..467f350 --- /dev/null +++ b/app/api/Twilio/Rest/Proxy/V1/Service/ShortCodeContext.php @@ -0,0 +1,131 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/ShortCodes/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ShortCodeInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the ShortCodeInstance + * + * @return ShortCodeInstance Fetched ShortCodeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ShortCodeInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ShortCodeInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ShortCodeInstance + * + * @param array|Options $options Optional Arguments + * @return ShortCodeInstance Updated ShortCodeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ShortCodeInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'IsReserved' => + Serialize::booleanToString($options['isReserved']), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new ShortCodeInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Proxy.V1.ShortCodeContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Proxy/V1/Service/ShortCodeInstance.php b/app/api/Twilio/Rest/Proxy/V1/Service/ShortCodeInstance.php new file mode 100755 index 0000000..ff352b9 --- /dev/null +++ b/app/api/Twilio/Rest/Proxy/V1/Service/ShortCodeInstance.php @@ -0,0 +1,163 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'shortCode' => Values::array_get($payload, 'short_code'), + 'isoCountry' => Values::array_get($payload, 'iso_country'), + 'capabilities' => Deserialize::phoneNumberCapabilities(Values::array_get($payload, 'capabilities')), + 'url' => Values::array_get($payload, 'url'), + 'isReserved' => Values::array_get($payload, 'is_reserved'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ShortCodeContext Context for this ShortCodeInstance + */ + protected function proxy(): ShortCodeContext + { + if (!$this->context) { + $this->context = new ShortCodeContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ShortCodeInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ShortCodeInstance + * + * @return ShortCodeInstance Fetched ShortCodeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ShortCodeInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ShortCodeInstance + * + * @param array|Options $options Optional Arguments + * @return ShortCodeInstance Updated ShortCodeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ShortCodeInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Proxy.V1.ShortCodeInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Proxy/V1/Service/ShortCodeList.php b/app/api/Twilio/Rest/Proxy/V1/Service/ShortCodeList.php new file mode 100755 index 0000000..ffad631 --- /dev/null +++ b/app/api/Twilio/Rest/Proxy/V1/Service/ShortCodeList.php @@ -0,0 +1,194 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/ShortCodes'; + } + + /** + * Create the ShortCodeInstance + * + * @param string $sid The SID of a Twilio [ShortCode](https://www.twilio.com/docs/sms/api/short-code) resource that represents the short code you would like to assign to your Proxy Service. + * @return ShortCodeInstance Created ShortCodeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $sid): ShortCodeInstance + { + + $data = Values::of([ + 'Sid' => + $sid, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new ShortCodeInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads ShortCodeInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ShortCodeInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ShortCodeInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ShortCodeInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ShortCodePage Page of ShortCodeInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ShortCodePage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ShortCodePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ShortCodeInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ShortCodePage Page of ShortCodeInstance + */ + public function getPage(string $targetUrl): ShortCodePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ShortCodePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ShortCodeContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the ShortCode resource to delete. + */ + public function getContext( + string $sid + + ): ShortCodeContext + { + return new ShortCodeContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Proxy.V1.ShortCodeList]'; + } +} diff --git a/app/api/Twilio/Rest/Proxy/V1/Service/ShortCodeOptions.php b/app/api/Twilio/Rest/Proxy/V1/Service/ShortCodeOptions.php new file mode 100755 index 0000000..34d8616 --- /dev/null +++ b/app/api/Twilio/Rest/Proxy/V1/Service/ShortCodeOptions.php @@ -0,0 +1,84 @@ +options['isReserved'] = $isReserved; + } + + /** + * Whether the short code should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information. + * + * @param bool $isReserved Whether the short code should be reserved and not be assigned to a participant using proxy pool logic. See [Reserved Phone Numbers](https://www.twilio.com/docs/proxy/reserved-phone-numbers) for more information. + * @return $this Fluent Builder + */ + public function setIsReserved(bool $isReserved): self + { + $this->options['isReserved'] = $isReserved; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Proxy.V1.UpdateShortCodeOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Proxy/V1/Service/ShortCodePage.php b/app/api/Twilio/Rest/Proxy/V1/Service/ShortCodePage.php new file mode 100755 index 0000000..dc95d1c --- /dev/null +++ b/app/api/Twilio/Rest/Proxy/V1/Service/ShortCodePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ShortCodeInstance \Twilio\Rest\Proxy\V1\Service\ShortCodeInstance + */ + public function buildInstance(array $payload): ShortCodeInstance + { + return new ShortCodeInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Proxy.V1.ShortCodePage]'; + } +} diff --git a/app/api/Twilio/Rest/Proxy/V1/ServiceContext.php b/app/api/Twilio/Rest/Proxy/V1/ServiceContext.php new file mode 100755 index 0000000..6104839 --- /dev/null +++ b/app/api/Twilio/Rest/Proxy/V1/ServiceContext.php @@ -0,0 +1,233 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + 'DefaultTtl' => + $options['defaultTtl'], + 'CallbackUrl' => + $options['callbackUrl'], + 'GeoMatchLevel' => + $options['geoMatchLevel'], + 'NumberSelectionBehavior' => + $options['numberSelectionBehavior'], + 'InterceptCallbackUrl' => + $options['interceptCallbackUrl'], + 'OutOfSessionCallbackUrl' => + $options['outOfSessionCallbackUrl'], + 'ChatInstanceSid' => + $options['chatInstanceSid'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the phoneNumbers + */ + protected function getPhoneNumbers(): PhoneNumberList + { + if (!$this->_phoneNumbers) { + $this->_phoneNumbers = new PhoneNumberList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_phoneNumbers; + } + + /** + * Access the shortCodes + */ + protected function getShortCodes(): ShortCodeList + { + if (!$this->_shortCodes) { + $this->_shortCodes = new ShortCodeList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_shortCodes; + } + + /** + * Access the sessions + */ + protected function getSessions(): SessionList + { + if (!$this->_sessions) { + $this->_sessions = new SessionList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_sessions; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Proxy.V1.ServiceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Proxy/V1/ServiceInstance.php b/app/api/Twilio/Rest/Proxy/V1/ServiceInstance.php new file mode 100755 index 0000000..fc23a50 --- /dev/null +++ b/app/api/Twilio/Rest/Proxy/V1/ServiceInstance.php @@ -0,0 +1,199 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'chatInstanceSid' => Values::array_get($payload, 'chat_instance_sid'), + 'callbackUrl' => Values::array_get($payload, 'callback_url'), + 'defaultTtl' => Values::array_get($payload, 'default_ttl'), + 'numberSelectionBehavior' => Values::array_get($payload, 'number_selection_behavior'), + 'geoMatchLevel' => Values::array_get($payload, 'geo_match_level'), + 'interceptCallbackUrl' => Values::array_get($payload, 'intercept_callback_url'), + 'outOfSessionCallbackUrl' => Values::array_get($payload, 'out_of_session_callback_url'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ServiceContext Context for this ServiceInstance + */ + protected function proxy(): ServiceContext + { + if (!$this->context) { + $this->context = new ServiceContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the phoneNumbers + */ + protected function getPhoneNumbers(): PhoneNumberList + { + return $this->proxy()->phoneNumbers; + } + + /** + * Access the shortCodes + */ + protected function getShortCodes(): ShortCodeList + { + return $this->proxy()->shortCodes; + } + + /** + * Access the sessions + */ + protected function getSessions(): SessionList + { + return $this->proxy()->sessions; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Proxy.V1.ServiceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Proxy/V1/ServiceList.php b/app/api/Twilio/Rest/Proxy/V1/ServiceList.php new file mode 100755 index 0000000..03ac6bf --- /dev/null +++ b/app/api/Twilio/Rest/Proxy/V1/ServiceList.php @@ -0,0 +1,204 @@ +solution = [ + ]; + + $this->uri = '/Services'; + } + + /** + * Create the ServiceInstance + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be 191 characters or fewer in length and be unique. **This value should not have PII.** + * @param array|Options $options Optional Arguments + * @return ServiceInstance Created ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $uniqueName, array $options = []): ServiceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $uniqueName, + 'DefaultTtl' => + $options['defaultTtl'], + 'CallbackUrl' => + $options['callbackUrl'], + 'GeoMatchLevel' => + $options['geoMatchLevel'], + 'NumberSelectionBehavior' => + $options['numberSelectionBehavior'], + 'InterceptCallbackUrl' => + $options['interceptCallbackUrl'], + 'OutOfSessionCallbackUrl' => + $options['outOfSessionCallbackUrl'], + 'ChatInstanceSid' => + $options['chatInstanceSid'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new ServiceInstance( + $this->version, + $payload + ); + } + + + /** + * Reads ServiceInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ServiceInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ServiceInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ServiceInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ServicePage Page of ServiceInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ServicePage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ServicePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ServiceInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ServicePage Page of ServiceInstance + */ + public function getPage(string $targetUrl): ServicePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ServicePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ServiceContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Service resource to delete. + */ + public function getContext( + string $sid + + ): ServiceContext + { + return new ServiceContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Proxy.V1.ServiceList]'; + } +} diff --git a/app/api/Twilio/Rest/Proxy/V1/ServiceOptions.php b/app/api/Twilio/Rest/Proxy/V1/ServiceOptions.php new file mode 100755 index 0000000..d6307b7 --- /dev/null +++ b/app/api/Twilio/Rest/Proxy/V1/ServiceOptions.php @@ -0,0 +1,360 @@ +options['defaultTtl'] = $defaultTtl; + $this->options['callbackUrl'] = $callbackUrl; + $this->options['geoMatchLevel'] = $geoMatchLevel; + $this->options['numberSelectionBehavior'] = $numberSelectionBehavior; + $this->options['interceptCallbackUrl'] = $interceptCallbackUrl; + $this->options['outOfSessionCallbackUrl'] = $outOfSessionCallbackUrl; + $this->options['chatInstanceSid'] = $chatInstanceSid; + } + + /** + * The default `ttl` value to set for Sessions created in the Service. The TTL (time to live) is measured in seconds after the Session's last create or last Interaction. The default value of `0` indicates an unlimited Session length. You can override a Session's default TTL value by setting its `ttl` value. + * + * @param int $defaultTtl The default `ttl` value to set for Sessions created in the Service. The TTL (time to live) is measured in seconds after the Session's last create or last Interaction. The default value of `0` indicates an unlimited Session length. You can override a Session's default TTL value by setting its `ttl` value. + * @return $this Fluent Builder + */ + public function setDefaultTtl(int $defaultTtl): self + { + $this->options['defaultTtl'] = $defaultTtl; + return $this; + } + + /** + * The URL we should call when the interaction status changes. + * + * @param string $callbackUrl The URL we should call when the interaction status changes. + * @return $this Fluent Builder + */ + public function setCallbackUrl(string $callbackUrl): self + { + $this->options['callbackUrl'] = $callbackUrl; + return $this; + } + + /** + * @param string $geoMatchLevel + * @return $this Fluent Builder + */ + public function setGeoMatchLevel(string $geoMatchLevel): self + { + $this->options['geoMatchLevel'] = $geoMatchLevel; + return $this; + } + + /** + * @param string $numberSelectionBehavior + * @return $this Fluent Builder + */ + public function setNumberSelectionBehavior(string $numberSelectionBehavior): self + { + $this->options['numberSelectionBehavior'] = $numberSelectionBehavior; + return $this; + } + + /** + * The URL we call on each interaction. If we receive a 403 status, we block the interaction; otherwise the interaction continues. + * + * @param string $interceptCallbackUrl The URL we call on each interaction. If we receive a 403 status, we block the interaction; otherwise the interaction continues. + * @return $this Fluent Builder + */ + public function setInterceptCallbackUrl(string $interceptCallbackUrl): self + { + $this->options['interceptCallbackUrl'] = $interceptCallbackUrl; + return $this; + } + + /** + * The URL we should call when an inbound call or SMS action occurs on a closed or non-existent Session. If your server (or a Twilio [function](https://www.twilio.com/functions)) responds with valid [TwiML](https://www.twilio.com/docs/voice/twiml), we will process it. This means it is possible, for example, to play a message for a call, send an automated text message response, or redirect a call to another Phone Number. See [Out-of-Session Callback Response Guide](https://www.twilio.com/docs/proxy/out-session-callback-response-guide) for more information. + * + * @param string $outOfSessionCallbackUrl The URL we should call when an inbound call or SMS action occurs on a closed or non-existent Session. If your server (or a Twilio [function](https://www.twilio.com/functions)) responds with valid [TwiML](https://www.twilio.com/docs/voice/twiml), we will process it. This means it is possible, for example, to play a message for a call, send an automated text message response, or redirect a call to another Phone Number. See [Out-of-Session Callback Response Guide](https://www.twilio.com/docs/proxy/out-session-callback-response-guide) for more information. + * @return $this Fluent Builder + */ + public function setOutOfSessionCallbackUrl(string $outOfSessionCallbackUrl): self + { + $this->options['outOfSessionCallbackUrl'] = $outOfSessionCallbackUrl; + return $this; + } + + /** + * The SID of the Chat Service Instance managed by Proxy Service. The Chat Service enables Proxy to forward SMS and channel messages to this chat instance. This is a one-to-one relationship. + * + * @param string $chatInstanceSid The SID of the Chat Service Instance managed by Proxy Service. The Chat Service enables Proxy to forward SMS and channel messages to this chat instance. This is a one-to-one relationship. + * @return $this Fluent Builder + */ + public function setChatInstanceSid(string $chatInstanceSid): self + { + $this->options['chatInstanceSid'] = $chatInstanceSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Proxy.V1.CreateServiceOptions ' . $options . ']'; + } +} + + + + +class UpdateServiceOptions extends Options + { + /** + * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be 191 characters or fewer in length and be unique. **This value should not have PII.** + * @param int $defaultTtl The default `ttl` value to set for Sessions created in the Service. The TTL (time to live) is measured in seconds after the Session's last create or last Interaction. The default value of `0` indicates an unlimited Session length. You can override a Session's default TTL value by setting its `ttl` value. + * @param string $callbackUrl The URL we should call when the interaction status changes. + * @param string $geoMatchLevel + * @param string $numberSelectionBehavior + * @param string $interceptCallbackUrl The URL we call on each interaction. If we receive a 403 status, we block the interaction; otherwise the interaction continues. + * @param string $outOfSessionCallbackUrl The URL we should call when an inbound call or SMS action occurs on a closed or non-existent Session. If your server (or a Twilio [function](https://www.twilio.com/functions)) responds with valid [TwiML](https://www.twilio.com/docs/voice/twiml), we will process it. This means it is possible, for example, to play a message for a call, send an automated text message response, or redirect a call to another Phone Number. See [Out-of-Session Callback Response Guide](https://www.twilio.com/docs/proxy/out-session-callback-response-guide) for more information. + * @param string $chatInstanceSid The SID of the Chat Service Instance managed by Proxy Service. The Chat Service enables Proxy to forward SMS and channel messages to this chat instance. This is a one-to-one relationship. + */ + public function __construct( + + string $uniqueName = Values::NONE, + int $defaultTtl = Values::INT_NONE, + string $callbackUrl = Values::NONE, + string $geoMatchLevel = Values::NONE, + string $numberSelectionBehavior = Values::NONE, + string $interceptCallbackUrl = Values::NONE, + string $outOfSessionCallbackUrl = Values::NONE, + string $chatInstanceSid = Values::NONE + + ) { + $this->options['uniqueName'] = $uniqueName; + $this->options['defaultTtl'] = $defaultTtl; + $this->options['callbackUrl'] = $callbackUrl; + $this->options['geoMatchLevel'] = $geoMatchLevel; + $this->options['numberSelectionBehavior'] = $numberSelectionBehavior; + $this->options['interceptCallbackUrl'] = $interceptCallbackUrl; + $this->options['outOfSessionCallbackUrl'] = $outOfSessionCallbackUrl; + $this->options['chatInstanceSid'] = $chatInstanceSid; + } + + /** + * An application-defined string that uniquely identifies the resource. This value must be 191 characters or fewer in length and be unique. **This value should not have PII.** + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be 191 characters or fewer in length and be unique. **This value should not have PII.** + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * The default `ttl` value to set for Sessions created in the Service. The TTL (time to live) is measured in seconds after the Session's last create or last Interaction. The default value of `0` indicates an unlimited Session length. You can override a Session's default TTL value by setting its `ttl` value. + * + * @param int $defaultTtl The default `ttl` value to set for Sessions created in the Service. The TTL (time to live) is measured in seconds after the Session's last create or last Interaction. The default value of `0` indicates an unlimited Session length. You can override a Session's default TTL value by setting its `ttl` value. + * @return $this Fluent Builder + */ + public function setDefaultTtl(int $defaultTtl): self + { + $this->options['defaultTtl'] = $defaultTtl; + return $this; + } + + /** + * The URL we should call when the interaction status changes. + * + * @param string $callbackUrl The URL we should call when the interaction status changes. + * @return $this Fluent Builder + */ + public function setCallbackUrl(string $callbackUrl): self + { + $this->options['callbackUrl'] = $callbackUrl; + return $this; + } + + /** + * @param string $geoMatchLevel + * @return $this Fluent Builder + */ + public function setGeoMatchLevel(string $geoMatchLevel): self + { + $this->options['geoMatchLevel'] = $geoMatchLevel; + return $this; + } + + /** + * @param string $numberSelectionBehavior + * @return $this Fluent Builder + */ + public function setNumberSelectionBehavior(string $numberSelectionBehavior): self + { + $this->options['numberSelectionBehavior'] = $numberSelectionBehavior; + return $this; + } + + /** + * The URL we call on each interaction. If we receive a 403 status, we block the interaction; otherwise the interaction continues. + * + * @param string $interceptCallbackUrl The URL we call on each interaction. If we receive a 403 status, we block the interaction; otherwise the interaction continues. + * @return $this Fluent Builder + */ + public function setInterceptCallbackUrl(string $interceptCallbackUrl): self + { + $this->options['interceptCallbackUrl'] = $interceptCallbackUrl; + return $this; + } + + /** + * The URL we should call when an inbound call or SMS action occurs on a closed or non-existent Session. If your server (or a Twilio [function](https://www.twilio.com/functions)) responds with valid [TwiML](https://www.twilio.com/docs/voice/twiml), we will process it. This means it is possible, for example, to play a message for a call, send an automated text message response, or redirect a call to another Phone Number. See [Out-of-Session Callback Response Guide](https://www.twilio.com/docs/proxy/out-session-callback-response-guide) for more information. + * + * @param string $outOfSessionCallbackUrl The URL we should call when an inbound call or SMS action occurs on a closed or non-existent Session. If your server (or a Twilio [function](https://www.twilio.com/functions)) responds with valid [TwiML](https://www.twilio.com/docs/voice/twiml), we will process it. This means it is possible, for example, to play a message for a call, send an automated text message response, or redirect a call to another Phone Number. See [Out-of-Session Callback Response Guide](https://www.twilio.com/docs/proxy/out-session-callback-response-guide) for more information. + * @return $this Fluent Builder + */ + public function setOutOfSessionCallbackUrl(string $outOfSessionCallbackUrl): self + { + $this->options['outOfSessionCallbackUrl'] = $outOfSessionCallbackUrl; + return $this; + } + + /** + * The SID of the Chat Service Instance managed by Proxy Service. The Chat Service enables Proxy to forward SMS and channel messages to this chat instance. This is a one-to-one relationship. + * + * @param string $chatInstanceSid The SID of the Chat Service Instance managed by Proxy Service. The Chat Service enables Proxy to forward SMS and channel messages to this chat instance. This is a one-to-one relationship. + * @return $this Fluent Builder + */ + public function setChatInstanceSid(string $chatInstanceSid): self + { + $this->options['chatInstanceSid'] = $chatInstanceSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Proxy.V1.UpdateServiceOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Proxy/V1/ServicePage.php b/app/api/Twilio/Rest/Proxy/V1/ServicePage.php new file mode 100755 index 0000000..cc5ccdb --- /dev/null +++ b/app/api/Twilio/Rest/Proxy/V1/ServicePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ServiceInstance \Twilio\Rest\Proxy\V1\ServiceInstance + */ + public function buildInstance(array $payload): ServiceInstance + { + return new ServiceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Proxy.V1.ServicePage]'; + } +} diff --git a/app/api/Twilio/Rest/ProxyBase.php b/app/api/Twilio/Rest/ProxyBase.php new file mode 100755 index 0000000..ae10d21 --- /dev/null +++ b/app/api/Twilio/Rest/ProxyBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://proxy.twilio.com'; + } + + + /** + * @return V1 Version v1 of proxy + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Proxy]'; + } +} diff --git a/app/api/Twilio/Rest/Routes.php b/app/api/Twilio/Rest/Routes.php new file mode 100755 index 0000000..72bc8f9 --- /dev/null +++ b/app/api/Twilio/Rest/Routes.php @@ -0,0 +1,58 @@ +phoneNumbers instead. + */ + protected function getPhoneNumbers(): \Twilio\Rest\Routes\V2\PhoneNumberList { + echo "phoneNumbers is deprecated. Use v2->phoneNumbers instead."; + return $this->v2->phoneNumbers; + } + + /** + * @deprecated Use v2->phoneNumbers(\$phoneNumber) instead. + * @param string $phoneNumber The phone number + */ + protected function contextPhoneNumbers(string $phoneNumber): \Twilio\Rest\Routes\V2\PhoneNumberContext { + echo "phoneNumbers(\$phoneNumber) is deprecated. Use v2->phoneNumbers(\$phoneNumber) instead."; + return $this->v2->phoneNumbers($phoneNumber); + } + + /** + * @deprecated Use v2->sipDomains instead. + */ + protected function getSipDomains(): \Twilio\Rest\Routes\V2\SipDomainList { + echo "sipDomains is deprecated. Use v2->sipDomains instead."; + return $this->v2->sipDomains; + } + + /** + * @deprecated Use v2->sipDomains(\$sipDomain) instead. + * @param string $sipDomain The sip_domain + */ + protected function contextSipDomains(string $sipDomain): \Twilio\Rest\Routes\V2\SipDomainContext { + echo "sipDomains(\$sipDomain) is deprecated. Use v2->sipDomains(\$sipDomain) instead."; + return $this->v2->sipDomains($sipDomain); + } + + /** + * @deprecated Use v2->trunks instead. + */ + protected function getTrunks(): \Twilio\Rest\Routes\V2\TrunkList { + echo "trunks is deprecated. Use v2->trunks instead."; + return $this->v2->trunks; + } + + /** + * @deprecated Use v2->trunks(\$sipTrunkDomain instead. + * @param string $sipTrunkDomain The SIP Trunk + */ + protected function contextTrunks(string $sipTrunkDomain): \Twilio\Rest\Routes\V2\TrunkContext { + echo "trunks(\$sipTrunkDomain) is deprecated. Use v2->trunks(\$sipTrunkDomain instead."; + return $this->v2->trunks($sipTrunkDomain); + } +} \ No newline at end of file diff --git a/app/api/Twilio/Rest/Routes/V2.php b/app/api/Twilio/Rest/Routes/V2.php new file mode 100755 index 0000000..16a6599 --- /dev/null +++ b/app/api/Twilio/Rest/Routes/V2.php @@ -0,0 +1,119 @@ +version = 'v2'; + } + + protected function getPhoneNumbers(): PhoneNumberList + { + if (!$this->_phoneNumbers) { + $this->_phoneNumbers = new PhoneNumberList($this); + } + return $this->_phoneNumbers; + } + + protected function getSipDomains(): SipDomainList + { + if (!$this->_sipDomains) { + $this->_sipDomains = new SipDomainList($this); + } + return $this->_sipDomains; + } + + protected function getTrunks(): TrunkList + { + if (!$this->_trunks) { + $this->_trunks = new TrunkList($this); + } + return $this->_trunks; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Routes.V2]'; + } +} diff --git a/app/api/Twilio/Rest/Routes/V2/PhoneNumberContext.php b/app/api/Twilio/Rest/Routes/V2/PhoneNumberContext.php new file mode 100755 index 0000000..a0f2854 --- /dev/null +++ b/app/api/Twilio/Rest/Routes/V2/PhoneNumberContext.php @@ -0,0 +1,112 @@ +solution = [ + 'phoneNumber' => + $phoneNumber, + ]; + + $this->uri = '/PhoneNumbers/' . \rawurlencode($phoneNumber) + .''; + } + + /** + * Fetch the PhoneNumberInstance + * + * @return PhoneNumberInstance Fetched PhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PhoneNumberInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new PhoneNumberInstance( + $this->version, + $payload, + $this->solution['phoneNumber'] + ); + } + + + /** + * Update the PhoneNumberInstance + * + * @param array|Options $options Optional Arguments + * @return PhoneNumberInstance Updated PhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): PhoneNumberInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'VoiceRegion' => + $options['voiceRegion'], + 'FriendlyName' => + $options['friendlyName'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new PhoneNumberInstance( + $this->version, + $payload, + $this->solution['phoneNumber'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Routes.V2.PhoneNumberContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Routes/V2/PhoneNumberInstance.php b/app/api/Twilio/Rest/Routes/V2/PhoneNumberInstance.php new file mode 100755 index 0000000..1d5a13a --- /dev/null +++ b/app/api/Twilio/Rest/Routes/V2/PhoneNumberInstance.php @@ -0,0 +1,144 @@ +properties = [ + 'phoneNumber' => Values::array_get($payload, 'phone_number'), + 'url' => Values::array_get($payload, 'url'), + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'voiceRegion' => Values::array_get($payload, 'voice_region'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + ]; + + $this->solution = ['phoneNumber' => $phoneNumber ?: $this->properties['phoneNumber'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return PhoneNumberContext Context for this PhoneNumberInstance + */ + protected function proxy(): PhoneNumberContext + { + if (!$this->context) { + $this->context = new PhoneNumberContext( + $this->version, + $this->solution['phoneNumber'] + ); + } + + return $this->context; + } + + /** + * Fetch the PhoneNumberInstance + * + * @return PhoneNumberInstance Fetched PhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PhoneNumberInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the PhoneNumberInstance + * + * @param array|Options $options Optional Arguments + * @return PhoneNumberInstance Updated PhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): PhoneNumberInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Routes.V2.PhoneNumberInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Routes/V2/PhoneNumberList.php b/app/api/Twilio/Rest/Routes/V2/PhoneNumberList.php new file mode 100755 index 0000000..981b1c8 --- /dev/null +++ b/app/api/Twilio/Rest/Routes/V2/PhoneNumberList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a PhoneNumberContext + * + * @param string $phoneNumber The phone number in E.164 format + */ + public function getContext( + string $phoneNumber + + ): PhoneNumberContext + { + return new PhoneNumberContext( + $this->version, + $phoneNumber + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Routes.V2.PhoneNumberList]'; + } +} diff --git a/app/api/Twilio/Rest/Routes/V2/PhoneNumberOptions.php b/app/api/Twilio/Rest/Routes/V2/PhoneNumberOptions.php new file mode 100755 index 0000000..7bf598c --- /dev/null +++ b/app/api/Twilio/Rest/Routes/V2/PhoneNumberOptions.php @@ -0,0 +1,96 @@ +options['voiceRegion'] = $voiceRegion; + $this->options['friendlyName'] = $friendlyName; + } + + /** + * The Inbound Processing Region used for this phone number for voice + * + * @param string $voiceRegion The Inbound Processing Region used for this phone number for voice + * @return $this Fluent Builder + */ + public function setVoiceRegion(string $voiceRegion): self + { + $this->options['voiceRegion'] = $voiceRegion; + return $this; + } + + /** + * A human readable description of this resource, up to 64 characters. + * + * @param string $friendlyName A human readable description of this resource, up to 64 characters. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Routes.V2.UpdatePhoneNumberOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Routes/V2/PhoneNumberPage.php b/app/api/Twilio/Rest/Routes/V2/PhoneNumberPage.php new file mode 100755 index 0000000..5e5f07f --- /dev/null +++ b/app/api/Twilio/Rest/Routes/V2/PhoneNumberPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PhoneNumberInstance \Twilio\Rest\Routes\V2\PhoneNumberInstance + */ + public function buildInstance(array $payload): PhoneNumberInstance + { + return new PhoneNumberInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Routes.V2.PhoneNumberPage]'; + } +} diff --git a/app/api/Twilio/Rest/Routes/V2/SipDomainContext.php b/app/api/Twilio/Rest/Routes/V2/SipDomainContext.php new file mode 100755 index 0000000..6af829c --- /dev/null +++ b/app/api/Twilio/Rest/Routes/V2/SipDomainContext.php @@ -0,0 +1,112 @@ +solution = [ + 'sipDomain' => + $sipDomain, + ]; + + $this->uri = '/SipDomains/' . \rawurlencode($sipDomain) + .''; + } + + /** + * Fetch the SipDomainInstance + * + * @return SipDomainInstance Fetched SipDomainInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SipDomainInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new SipDomainInstance( + $this->version, + $payload, + $this->solution['sipDomain'] + ); + } + + + /** + * Update the SipDomainInstance + * + * @param array|Options $options Optional Arguments + * @return SipDomainInstance Updated SipDomainInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SipDomainInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'VoiceRegion' => + $options['voiceRegion'], + 'FriendlyName' => + $options['friendlyName'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new SipDomainInstance( + $this->version, + $payload, + $this->solution['sipDomain'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Routes.V2.SipDomainContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Routes/V2/SipDomainInstance.php b/app/api/Twilio/Rest/Routes/V2/SipDomainInstance.php new file mode 100755 index 0000000..e9e63cb --- /dev/null +++ b/app/api/Twilio/Rest/Routes/V2/SipDomainInstance.php @@ -0,0 +1,144 @@ +properties = [ + 'sipDomain' => Values::array_get($payload, 'sip_domain'), + 'url' => Values::array_get($payload, 'url'), + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'voiceRegion' => Values::array_get($payload, 'voice_region'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + ]; + + $this->solution = ['sipDomain' => $sipDomain ?: $this->properties['sipDomain'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SipDomainContext Context for this SipDomainInstance + */ + protected function proxy(): SipDomainContext + { + if (!$this->context) { + $this->context = new SipDomainContext( + $this->version, + $this->solution['sipDomain'] + ); + } + + return $this->context; + } + + /** + * Fetch the SipDomainInstance + * + * @return SipDomainInstance Fetched SipDomainInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SipDomainInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SipDomainInstance + * + * @param array|Options $options Optional Arguments + * @return SipDomainInstance Updated SipDomainInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SipDomainInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Routes.V2.SipDomainInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Routes/V2/SipDomainList.php b/app/api/Twilio/Rest/Routes/V2/SipDomainList.php new file mode 100755 index 0000000..26ac0a2 --- /dev/null +++ b/app/api/Twilio/Rest/Routes/V2/SipDomainList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a SipDomainContext + * + * @param string $sipDomain + */ + public function getContext( + string $sipDomain + + ): SipDomainContext + { + return new SipDomainContext( + $this->version, + $sipDomain + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Routes.V2.SipDomainList]'; + } +} diff --git a/app/api/Twilio/Rest/Routes/V2/SipDomainOptions.php b/app/api/Twilio/Rest/Routes/V2/SipDomainOptions.php new file mode 100755 index 0000000..7022c8f --- /dev/null +++ b/app/api/Twilio/Rest/Routes/V2/SipDomainOptions.php @@ -0,0 +1,96 @@ +options['voiceRegion'] = $voiceRegion; + $this->options['friendlyName'] = $friendlyName; + } + + /** + * + * + * @param string $voiceRegion + * @return $this Fluent Builder + */ + public function setVoiceRegion(string $voiceRegion): self + { + $this->options['voiceRegion'] = $voiceRegion; + return $this; + } + + /** + * + * + * @param string $friendlyName + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Routes.V2.UpdateSipDomainOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Routes/V2/SipDomainPage.php b/app/api/Twilio/Rest/Routes/V2/SipDomainPage.php new file mode 100755 index 0000000..187c5d4 --- /dev/null +++ b/app/api/Twilio/Rest/Routes/V2/SipDomainPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SipDomainInstance \Twilio\Rest\Routes\V2\SipDomainInstance + */ + public function buildInstance(array $payload): SipDomainInstance + { + return new SipDomainInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Routes.V2.SipDomainPage]'; + } +} diff --git a/app/api/Twilio/Rest/Routes/V2/TrunkContext.php b/app/api/Twilio/Rest/Routes/V2/TrunkContext.php new file mode 100755 index 0000000..f700037 --- /dev/null +++ b/app/api/Twilio/Rest/Routes/V2/TrunkContext.php @@ -0,0 +1,112 @@ +solution = [ + 'sipTrunkDomain' => + $sipTrunkDomain, + ]; + + $this->uri = '/Trunks/' . \rawurlencode($sipTrunkDomain) + .''; + } + + /** + * Fetch the TrunkInstance + * + * @return TrunkInstance Fetched TrunkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TrunkInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new TrunkInstance( + $this->version, + $payload, + $this->solution['sipTrunkDomain'] + ); + } + + + /** + * Update the TrunkInstance + * + * @param array|Options $options Optional Arguments + * @return TrunkInstance Updated TrunkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TrunkInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'VoiceRegion' => + $options['voiceRegion'], + 'FriendlyName' => + $options['friendlyName'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new TrunkInstance( + $this->version, + $payload, + $this->solution['sipTrunkDomain'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Routes.V2.TrunkContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Routes/V2/TrunkInstance.php b/app/api/Twilio/Rest/Routes/V2/TrunkInstance.php new file mode 100755 index 0000000..adae534 --- /dev/null +++ b/app/api/Twilio/Rest/Routes/V2/TrunkInstance.php @@ -0,0 +1,144 @@ +properties = [ + 'sipTrunkDomain' => Values::array_get($payload, 'sip_trunk_domain'), + 'url' => Values::array_get($payload, 'url'), + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'voiceRegion' => Values::array_get($payload, 'voice_region'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + ]; + + $this->solution = ['sipTrunkDomain' => $sipTrunkDomain ?: $this->properties['sipTrunkDomain'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return TrunkContext Context for this TrunkInstance + */ + protected function proxy(): TrunkContext + { + if (!$this->context) { + $this->context = new TrunkContext( + $this->version, + $this->solution['sipTrunkDomain'] + ); + } + + return $this->context; + } + + /** + * Fetch the TrunkInstance + * + * @return TrunkInstance Fetched TrunkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TrunkInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the TrunkInstance + * + * @param array|Options $options Optional Arguments + * @return TrunkInstance Updated TrunkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TrunkInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Routes.V2.TrunkInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Routes/V2/TrunkList.php b/app/api/Twilio/Rest/Routes/V2/TrunkList.php new file mode 100755 index 0000000..11eb531 --- /dev/null +++ b/app/api/Twilio/Rest/Routes/V2/TrunkList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a TrunkContext + * + * @param string $sipTrunkDomain The absolute URL of the SIP Trunk + */ + public function getContext( + string $sipTrunkDomain + + ): TrunkContext + { + return new TrunkContext( + $this->version, + $sipTrunkDomain + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Routes.V2.TrunkList]'; + } +} diff --git a/app/api/Twilio/Rest/Routes/V2/TrunkOptions.php b/app/api/Twilio/Rest/Routes/V2/TrunkOptions.php new file mode 100755 index 0000000..e60b30d --- /dev/null +++ b/app/api/Twilio/Rest/Routes/V2/TrunkOptions.php @@ -0,0 +1,96 @@ +options['voiceRegion'] = $voiceRegion; + $this->options['friendlyName'] = $friendlyName; + } + + /** + * The Inbound Processing Region used for this SIP Trunk for voice + * + * @param string $voiceRegion The Inbound Processing Region used for this SIP Trunk for voice + * @return $this Fluent Builder + */ + public function setVoiceRegion(string $voiceRegion): self + { + $this->options['voiceRegion'] = $voiceRegion; + return $this; + } + + /** + * A human readable description of this resource, up to 64 characters. + * + * @param string $friendlyName A human readable description of this resource, up to 64 characters. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Routes.V2.UpdateTrunkOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Routes/V2/TrunkPage.php b/app/api/Twilio/Rest/Routes/V2/TrunkPage.php new file mode 100755 index 0000000..b1bc050 --- /dev/null +++ b/app/api/Twilio/Rest/Routes/V2/TrunkPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TrunkInstance \Twilio\Rest\Routes\V2\TrunkInstance + */ + public function buildInstance(array $payload): TrunkInstance + { + return new TrunkInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Routes.V2.TrunkPage]'; + } +} diff --git a/app/api/Twilio/Rest/RoutesBase.php b/app/api/Twilio/Rest/RoutesBase.php new file mode 100755 index 0000000..8a4c893 --- /dev/null +++ b/app/api/Twilio/Rest/RoutesBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://routes.twilio.com'; + } + + + /** + * @return V2 Version v2 of routes + */ + protected function getV2(): V2 { + if (!$this->_v2) { + $this->_v2 = new V2($this); + } + return $this->_v2; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Routes]'; + } +} diff --git a/app/api/Twilio/Rest/Serverless.php b/app/api/Twilio/Rest/Serverless.php new file mode 100755 index 0000000..f684c62 --- /dev/null +++ b/app/api/Twilio/Rest/Serverless.php @@ -0,0 +1,24 @@ +services instead. + */ + protected function getServices(): \Twilio\Rest\Serverless\V1\ServiceList { + echo "services is deprecated. Use v1->services instead."; + return $this->v1->services; + } + + /** + * @deprecated Use v1->services(\$sid) instead. + * @param string $sid The SID of the Service resource to fetch + */ + protected function contextServices(string $sid): \Twilio\Rest\Serverless\V1\ServiceContext { + echo "services(\$sid) is deprecated. Use v1->services(\$sid) instead."; + return $this->v1->services($sid); + } +} \ No newline at end of file diff --git a/app/api/Twilio/Rest/Serverless/V1.php b/app/api/Twilio/Rest/Serverless/V1.php new file mode 100755 index 0000000..a2f00f1 --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1.php @@ -0,0 +1,95 @@ +version = 'v1'; + } + + protected function getServices(): ServiceList + { + if (!$this->_services) { + $this->_services = new ServiceList($this); + } + return $this->_services; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1]'; + } +} diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionContext.php b/app/api/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionContext.php new file mode 100755 index 0000000..07aac75 --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionContext.php @@ -0,0 +1,93 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'assetSid' => + $assetSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Assets/' . \rawurlencode($assetSid) + .'/Versions/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the AssetVersionInstance + * + * @return AssetVersionInstance Fetched AssetVersionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AssetVersionInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new AssetVersionInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['assetSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.AssetVersionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionInstance.php b/app/api/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionInstance.php new file mode 100755 index 0000000..e4b6993 --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionInstance.php @@ -0,0 +1,134 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'assetSid' => Values::array_get($payload, 'asset_sid'), + 'path' => Values::array_get($payload, 'path'), + 'visibility' => Values::array_get($payload, 'visibility'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'assetSid' => $assetSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AssetVersionContext Context for this AssetVersionInstance + */ + protected function proxy(): AssetVersionContext + { + if (!$this->context) { + $this->context = new AssetVersionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['assetSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the AssetVersionInstance + * + * @return AssetVersionInstance Fetched AssetVersionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AssetVersionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.AssetVersionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionList.php b/app/api/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionList.php new file mode 100755 index 0000000..7e51c49 --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionList.php @@ -0,0 +1,175 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'assetSid' => + $assetSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Assets/' . \rawurlencode($assetSid) + .'/Versions'; + } + + /** + * Reads AssetVersionInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return AssetVersionInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams AssetVersionInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AssetVersionInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return AssetVersionPage Page of AssetVersionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AssetVersionPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new AssetVersionPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of AssetVersionInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return AssetVersionPage Page of AssetVersionInstance + */ + public function getPage(string $targetUrl): AssetVersionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AssetVersionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AssetVersionContext + * + * @param string $sid The SID of the Asset Version resource to fetch. + */ + public function getContext( + string $sid + + ): AssetVersionContext + { + return new AssetVersionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['assetSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.AssetVersionList]'; + } +} diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionPage.php b/app/api/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionPage.php new file mode 100755 index 0000000..83595f3 --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/Asset/AssetVersionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AssetVersionInstance \Twilio\Rest\Serverless\V1\Service\Asset\AssetVersionInstance + */ + public function buildInstance(array $payload): AssetVersionInstance + { + return new AssetVersionInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['assetSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.AssetVersionPage]'; + } +} diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/AssetContext.php b/app/api/Twilio/Rest/Serverless/V1/Service/AssetContext.php new file mode 100755 index 0000000..69282a6 --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/AssetContext.php @@ -0,0 +1,186 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Assets/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the AssetInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the AssetInstance + * + * @return AssetInstance Fetched AssetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AssetInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new AssetInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the AssetInstance + * + * @param string $friendlyName A descriptive string that you create to describe the Asset resource. It can be a maximum of 255 characters. + * @return AssetInstance Updated AssetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $friendlyName): AssetInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new AssetInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the assetVersions + */ + protected function getAssetVersions(): AssetVersionList + { + if (!$this->_assetVersions) { + $this->_assetVersions = new AssetVersionList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_assetVersions; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.AssetContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/AssetInstance.php b/app/api/Twilio/Rest/Serverless/V1/Service/AssetInstance.php new file mode 100755 index 0000000..a06eb7d --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/AssetInstance.php @@ -0,0 +1,168 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AssetContext Context for this AssetInstance + */ + protected function proxy(): AssetContext + { + if (!$this->context) { + $this->context = new AssetContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the AssetInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the AssetInstance + * + * @return AssetInstance Fetched AssetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AssetInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the AssetInstance + * + * @param string $friendlyName A descriptive string that you create to describe the Asset resource. It can be a maximum of 255 characters. + * @return AssetInstance Updated AssetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $friendlyName): AssetInstance + { + + return $this->proxy()->update($friendlyName); + } + + /** + * Access the assetVersions + */ + protected function getAssetVersions(): AssetVersionList + { + return $this->proxy()->assetVersions; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.AssetInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/AssetList.php b/app/api/Twilio/Rest/Serverless/V1/Service/AssetList.php new file mode 100755 index 0000000..e087363 --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/AssetList.php @@ -0,0 +1,194 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Assets'; + } + + /** + * Create the AssetInstance + * + * @param string $friendlyName A descriptive string that you create to describe the Asset resource. It can be a maximum of 255 characters. + * @return AssetInstance Created AssetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName): AssetInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new AssetInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads AssetInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return AssetInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams AssetInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of AssetInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return AssetPage Page of AssetInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): AssetPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new AssetPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of AssetInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return AssetPage Page of AssetInstance + */ + public function getPage(string $targetUrl): AssetPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new AssetPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a AssetContext + * + * @param string $sid The SID that identifies the Asset resource to delete. + */ + public function getContext( + string $sid + + ): AssetContext + { + return new AssetContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.AssetList]'; + } +} diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/AssetPage.php b/app/api/Twilio/Rest/Serverless/V1/Service/AssetPage.php new file mode 100755 index 0000000..dc56904 --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/AssetPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AssetInstance \Twilio\Rest\Serverless\V1\Service\AssetInstance + */ + public function buildInstance(array $payload): AssetInstance + { + return new AssetInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.AssetPage]'; + } +} diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusContext.php b/app/api/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusContext.php new file mode 100755 index 0000000..a228129 --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusContext.php @@ -0,0 +1,87 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Builds/' . \rawurlencode($sid) + .'/Status'; + } + + /** + * Fetch the BuildStatusInstance + * + * @return BuildStatusInstance Fetched BuildStatusInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BuildStatusInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new BuildStatusInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.BuildStatusContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusInstance.php b/app/api/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusInstance.php new file mode 100755 index 0000000..5fd906a --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusInstance.php @@ -0,0 +1,125 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'status' => Values::array_get($payload, 'status'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return BuildStatusContext Context for this BuildStatusInstance + */ + protected function proxy(): BuildStatusContext + { + if (!$this->context) { + $this->context = new BuildStatusContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the BuildStatusInstance + * + * @return BuildStatusInstance Fetched BuildStatusInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BuildStatusInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.BuildStatusInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusList.php b/app/api/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusList.php new file mode 100755 index 0000000..6fa7ec7 --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusList.php @@ -0,0 +1,73 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'sid' => + $sid, + + ]; + } + + /** + * Constructs a BuildStatusContext + */ + public function getContext( + + ): BuildStatusContext + { + return new BuildStatusContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.BuildStatusList]'; + } +} diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusPage.php b/app/api/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusPage.php new file mode 100755 index 0000000..23941b2 --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/Build/BuildStatusPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return BuildStatusInstance \Twilio\Rest\Serverless\V1\Service\Build\BuildStatusInstance + */ + public function buildInstance(array $payload): BuildStatusInstance + { + return new BuildStatusInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['sid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.BuildStatusPage]'; + } +} diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/BuildContext.php b/app/api/Twilio/Rest/Serverless/V1/Service/BuildContext.php new file mode 100755 index 0000000..b24c99f --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/BuildContext.php @@ -0,0 +1,159 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Builds/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the BuildInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the BuildInstance + * + * @return BuildInstance Fetched BuildInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BuildInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new BuildInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the buildStatus + */ + protected function getBuildStatus(): BuildStatusList + { + if (!$this->_buildStatus) { + $this->_buildStatus = new BuildStatusList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_buildStatus; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.BuildContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/BuildInstance.php b/app/api/Twilio/Rest/Serverless/V1/Service/BuildInstance.php new file mode 100755 index 0000000..6c3f137 --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/BuildInstance.php @@ -0,0 +1,163 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'status' => Values::array_get($payload, 'status'), + 'assetVersions' => Values::array_get($payload, 'asset_versions'), + 'functionVersions' => Values::array_get($payload, 'function_versions'), + 'dependencies' => Values::array_get($payload, 'dependencies'), + 'runtime' => Values::array_get($payload, 'runtime'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return BuildContext Context for this BuildInstance + */ + protected function proxy(): BuildContext + { + if (!$this->context) { + $this->context = new BuildContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the BuildInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the BuildInstance + * + * @return BuildInstance Fetched BuildInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BuildInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the buildStatus + */ + protected function getBuildStatus(): BuildStatusList + { + return $this->proxy()->buildStatus; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.BuildInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/BuildList.php b/app/api/Twilio/Rest/Serverless/V1/Service/BuildList.php new file mode 100755 index 0000000..94f26b3 --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/BuildList.php @@ -0,0 +1,204 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Builds'; + } + + /** + * Create the BuildInstance + * + * @param array|Options $options Optional Arguments + * @return BuildInstance Created BuildInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): BuildInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'AssetVersions' => + Serialize::map($options['assetVersions'], function ($e) { return $e; }), + 'FunctionVersions' => + Serialize::map($options['functionVersions'], function ($e) { return $e; }), + 'Dependencies' => + $options['dependencies'], + 'Runtime' => + $options['runtime'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new BuildInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads BuildInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return BuildInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams BuildInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of BuildInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return BuildPage Page of BuildInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): BuildPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new BuildPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of BuildInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return BuildPage Page of BuildInstance + */ + public function getPage(string $targetUrl): BuildPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new BuildPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a BuildContext + * + * @param string $sid The SID of the Build resource to delete. + */ + public function getContext( + string $sid + + ): BuildContext + { + return new BuildContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.BuildList]'; + } +} diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/BuildOptions.php b/app/api/Twilio/Rest/Serverless/V1/Service/BuildOptions.php new file mode 100755 index 0000000..9febd0b --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/BuildOptions.php @@ -0,0 +1,137 @@ +options['assetVersions'] = $assetVersions; + $this->options['functionVersions'] = $functionVersions; + $this->options['dependencies'] = $dependencies; + $this->options['runtime'] = $runtime; + } + + /** + * The list of Asset Version resource SIDs to include in the Build. + * + * @param string[] $assetVersions The list of Asset Version resource SIDs to include in the Build. + * @return $this Fluent Builder + */ + public function setAssetVersions(array $assetVersions): self + { + $this->options['assetVersions'] = $assetVersions; + return $this; + } + + /** + * The list of the Function Version resource SIDs to include in the Build. + * + * @param string[] $functionVersions The list of the Function Version resource SIDs to include in the Build. + * @return $this Fluent Builder + */ + public function setFunctionVersions(array $functionVersions): self + { + $this->options['functionVersions'] = $functionVersions; + return $this; + } + + /** + * A list of objects that describe the Dependencies included in the Build. Each object contains the `name` and `version` of the dependency. + * + * @param string $dependencies A list of objects that describe the Dependencies included in the Build. Each object contains the `name` and `version` of the dependency. + * @return $this Fluent Builder + */ + public function setDependencies(string $dependencies): self + { + $this->options['dependencies'] = $dependencies; + return $this; + } + + /** + * The Runtime version that will be used to run the Build resource when it is deployed. + * + * @param string $runtime The Runtime version that will be used to run the Build resource when it is deployed. + * @return $this Fluent Builder + */ + public function setRuntime(string $runtime): self + { + $this->options['runtime'] = $runtime; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Serverless.V1.CreateBuildOptions ' . $options . ']'; + } +} + + + + diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/BuildPage.php b/app/api/Twilio/Rest/Serverless/V1/Service/BuildPage.php new file mode 100755 index 0000000..492571f --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/BuildPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return BuildInstance \Twilio\Rest\Serverless\V1\Service\BuildInstance + */ + public function buildInstance(array $payload): BuildInstance + { + return new BuildInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.BuildPage]'; + } +} diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentContext.php b/app/api/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentContext.php new file mode 100755 index 0000000..e04784a --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentContext.php @@ -0,0 +1,93 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'environmentSid' => + $environmentSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Environments/' . \rawurlencode($environmentSid) + .'/Deployments/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the DeploymentInstance + * + * @return DeploymentInstance Fetched DeploymentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DeploymentInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new DeploymentInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['environmentSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.DeploymentContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentInstance.php b/app/api/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentInstance.php new file mode 100755 index 0000000..39ea005 --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentInstance.php @@ -0,0 +1,134 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'environmentSid' => Values::array_get($payload, 'environment_sid'), + 'buildSid' => Values::array_get($payload, 'build_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'environmentSid' => $environmentSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return DeploymentContext Context for this DeploymentInstance + */ + protected function proxy(): DeploymentContext + { + if (!$this->context) { + $this->context = new DeploymentContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['environmentSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the DeploymentInstance + * + * @return DeploymentInstance Fetched DeploymentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DeploymentInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.DeploymentInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentList.php b/app/api/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentList.php new file mode 100755 index 0000000..31c2ed4 --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentList.php @@ -0,0 +1,205 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'environmentSid' => + $environmentSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Environments/' . \rawurlencode($environmentSid) + .'/Deployments'; + } + + /** + * Create the DeploymentInstance + * + * @param array|Options $options Optional Arguments + * @return DeploymentInstance Created DeploymentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): DeploymentInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'BuildSid' => + $options['buildSid'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new DeploymentInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['environmentSid'] + ); + } + + + /** + * Reads DeploymentInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return DeploymentInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams DeploymentInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of DeploymentInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return DeploymentPage Page of DeploymentInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): DeploymentPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new DeploymentPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of DeploymentInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return DeploymentPage Page of DeploymentInstance + */ + public function getPage(string $targetUrl): DeploymentPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new DeploymentPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a DeploymentContext + * + * @param string $sid The SID that identifies the Deployment resource to fetch. + */ + public function getContext( + string $sid + + ): DeploymentContext + { + return new DeploymentContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['environmentSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.DeploymentList]'; + } +} diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentOptions.php b/app/api/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentOptions.php new file mode 100755 index 0000000..6342f53 --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentOptions.php @@ -0,0 +1,80 @@ +options['buildSid'] = $buildSid; + } + + /** + * The SID of the Build for the Deployment. + * + * @param string $buildSid The SID of the Build for the Deployment. + * @return $this Fluent Builder + */ + public function setBuildSid(string $buildSid): self + { + $this->options['buildSid'] = $buildSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Serverless.V1.CreateDeploymentOptions ' . $options . ']'; + } +} + + + diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentPage.php b/app/api/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentPage.php new file mode 100755 index 0000000..ae93053 --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/Environment/DeploymentPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DeploymentInstance \Twilio\Rest\Serverless\V1\Service\Environment\DeploymentInstance + */ + public function buildInstance(array $payload): DeploymentInstance + { + return new DeploymentInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['environmentSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.DeploymentPage]'; + } +} diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/Environment/LogContext.php b/app/api/Twilio/Rest/Serverless/V1/Service/Environment/LogContext.php new file mode 100755 index 0000000..5521948 --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/Environment/LogContext.php @@ -0,0 +1,93 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'environmentSid' => + $environmentSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Environments/' . \rawurlencode($environmentSid) + .'/Logs/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the LogInstance + * + * @return LogInstance Fetched LogInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): LogInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new LogInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['environmentSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.LogContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/Environment/LogInstance.php b/app/api/Twilio/Rest/Serverless/V1/Service/Environment/LogInstance.php new file mode 100755 index 0000000..c340688 --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/Environment/LogInstance.php @@ -0,0 +1,142 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'environmentSid' => Values::array_get($payload, 'environment_sid'), + 'buildSid' => Values::array_get($payload, 'build_sid'), + 'deploymentSid' => Values::array_get($payload, 'deployment_sid'), + 'functionSid' => Values::array_get($payload, 'function_sid'), + 'requestSid' => Values::array_get($payload, 'request_sid'), + 'level' => Values::array_get($payload, 'level'), + 'message' => Values::array_get($payload, 'message'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'environmentSid' => $environmentSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return LogContext Context for this LogInstance + */ + protected function proxy(): LogContext + { + if (!$this->context) { + $this->context = new LogContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['environmentSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the LogInstance + * + * @return LogInstance Fetched LogInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): LogInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.LogInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/Environment/LogList.php b/app/api/Twilio/Rest/Serverless/V1/Service/Environment/LogList.php new file mode 100755 index 0000000..cf5ef6e --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/Environment/LogList.php @@ -0,0 +1,187 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'environmentSid' => + $environmentSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Environments/' . \rawurlencode($environmentSid) + .'/Logs'; + } + + /** + * Reads LogInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return LogInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams LogInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of LogInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return LogPage Page of LogInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): LogPage + { + $options = new Values($options); + + $params = Values::of([ + 'FunctionSid' => + $options['functionSid'], + 'StartDate' => + Serialize::iso8601DateTime($options['startDate']), + 'EndDate' => + Serialize::iso8601DateTime($options['endDate']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new LogPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of LogInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return LogPage Page of LogInstance + */ + public function getPage(string $targetUrl): LogPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new LogPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a LogContext + * + * @param string $sid The SID of the Log resource to fetch. + */ + public function getContext( + string $sid + + ): LogContext + { + return new LogContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['environmentSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.LogList]'; + } +} diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/Environment/LogOptions.php b/app/api/Twilio/Rest/Serverless/V1/Service/Environment/LogOptions.php new file mode 100755 index 0000000..f650b0c --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/Environment/LogOptions.php @@ -0,0 +1,114 @@ +options['functionSid'] = $functionSid; + $this->options['startDate'] = $startDate; + $this->options['endDate'] = $endDate; + } + + /** + * The SID of the function whose invocation produced the Log resources to read. + * + * @param string $functionSid The SID of the function whose invocation produced the Log resources to read. + * @return $this Fluent Builder + */ + public function setFunctionSid(string $functionSid): self + { + $this->options['functionSid'] = $functionSid; + return $this; + } + + /** + * The date/time (in GMT, ISO 8601) after which the Log resources must have been created. Defaults to 1 day prior to current date/time. + * + * @param \DateTime $startDate The date/time (in GMT, ISO 8601) after which the Log resources must have been created. Defaults to 1 day prior to current date/time. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * The date/time (in GMT, ISO 8601) before which the Log resources must have been created. Defaults to current date/time. + * + * @param \DateTime $endDate The date/time (in GMT, ISO 8601) before which the Log resources must have been created. Defaults to current date/time. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Serverless.V1.ReadLogOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/Environment/LogPage.php b/app/api/Twilio/Rest/Serverless/V1/Service/Environment/LogPage.php new file mode 100755 index 0000000..35a96b3 --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/Environment/LogPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return LogInstance \Twilio\Rest\Serverless\V1\Service\Environment\LogInstance + */ + public function buildInstance(array $payload): LogInstance + { + return new LogInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['environmentSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.LogPage]'; + } +} diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/Environment/VariableContext.php b/app/api/Twilio/Rest/Serverless/V1/Service/Environment/VariableContext.php new file mode 100755 index 0000000..0b1dec6 --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/Environment/VariableContext.php @@ -0,0 +1,139 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'environmentSid' => + $environmentSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Environments/' . \rawurlencode($environmentSid) + .'/Variables/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the VariableInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the VariableInstance + * + * @return VariableInstance Fetched VariableInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): VariableInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new VariableInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['environmentSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the VariableInstance + * + * @param array|Options $options Optional Arguments + * @return VariableInstance Updated VariableInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): VariableInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Key' => + $options['key'], + 'Value' => + $options['value'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new VariableInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['environmentSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.VariableContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/Environment/VariableInstance.php b/app/api/Twilio/Rest/Serverless/V1/Service/Environment/VariableInstance.php new file mode 100755 index 0000000..3fce47b --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/Environment/VariableInstance.php @@ -0,0 +1,162 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'environmentSid' => Values::array_get($payload, 'environment_sid'), + 'key' => Values::array_get($payload, 'key'), + 'value' => Values::array_get($payload, 'value'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'environmentSid' => $environmentSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return VariableContext Context for this VariableInstance + */ + protected function proxy(): VariableContext + { + if (!$this->context) { + $this->context = new VariableContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['environmentSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the VariableInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the VariableInstance + * + * @return VariableInstance Fetched VariableInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): VariableInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the VariableInstance + * + * @param array|Options $options Optional Arguments + * @return VariableInstance Updated VariableInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): VariableInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.VariableInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/Environment/VariableList.php b/app/api/Twilio/Rest/Serverless/V1/Service/Environment/VariableList.php new file mode 100755 index 0000000..f1ca3f5 --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/Environment/VariableList.php @@ -0,0 +1,205 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'environmentSid' => + $environmentSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Environments/' . \rawurlencode($environmentSid) + .'/Variables'; + } + + /** + * Create the VariableInstance + * + * @param string $key A string by which the Variable resource can be referenced. It can be a maximum of 128 characters. + * @param string $value A string that contains the actual value of the Variable. It can be a maximum of 450 bytes in size. + * @return VariableInstance Created VariableInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $key, string $value): VariableInstance + { + + $data = Values::of([ + 'Key' => + $key, + 'Value' => + $value, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new VariableInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['environmentSid'] + ); + } + + + /** + * Reads VariableInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return VariableInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams VariableInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of VariableInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return VariablePage Page of VariableInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): VariablePage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new VariablePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of VariableInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return VariablePage Page of VariableInstance + */ + public function getPage(string $targetUrl): VariablePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new VariablePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a VariableContext + * + * @param string $sid The SID of the Variable resource to delete. + */ + public function getContext( + string $sid + + ): VariableContext + { + return new VariableContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['environmentSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.VariableList]'; + } +} diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/Environment/VariableOptions.php b/app/api/Twilio/Rest/Serverless/V1/Service/Environment/VariableOptions.php new file mode 100755 index 0000000..1a340f6 --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/Environment/VariableOptions.php @@ -0,0 +1,102 @@ +options['key'] = $key; + $this->options['value'] = $value; + } + + /** + * A string by which the Variable resource can be referenced. It can be a maximum of 128 characters. + * + * @param string $key A string by which the Variable resource can be referenced. It can be a maximum of 128 characters. + * @return $this Fluent Builder + */ + public function setKey(string $key): self + { + $this->options['key'] = $key; + return $this; + } + + /** + * A string that contains the actual value of the Variable. It can be a maximum of 450 bytes in size. + * + * @param string $value A string that contains the actual value of the Variable. It can be a maximum of 450 bytes in size. + * @return $this Fluent Builder + */ + public function setValue(string $value): self + { + $this->options['value'] = $value; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Serverless.V1.UpdateVariableOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/Environment/VariablePage.php b/app/api/Twilio/Rest/Serverless/V1/Service/Environment/VariablePage.php new file mode 100755 index 0000000..9983fb3 --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/Environment/VariablePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return VariableInstance \Twilio\Rest\Serverless\V1\Service\Environment\VariableInstance + */ + public function buildInstance(array $payload): VariableInstance + { + return new VariableInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['environmentSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.VariablePage]'; + } +} diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/EnvironmentContext.php b/app/api/Twilio/Rest/Serverless/V1/Service/EnvironmentContext.php new file mode 100755 index 0000000..e28b20e --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/EnvironmentContext.php @@ -0,0 +1,199 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Environments/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the EnvironmentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the EnvironmentInstance + * + * @return EnvironmentInstance Fetched EnvironmentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EnvironmentInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new EnvironmentInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the logs + */ + protected function getLogs(): LogList + { + if (!$this->_logs) { + $this->_logs = new LogList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_logs; + } + + /** + * Access the deployments + */ + protected function getDeployments(): DeploymentList + { + if (!$this->_deployments) { + $this->_deployments = new DeploymentList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_deployments; + } + + /** + * Access the variables + */ + protected function getVariables(): VariableList + { + if (!$this->_variables) { + $this->_variables = new VariableList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_variables; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.EnvironmentContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/EnvironmentInstance.php b/app/api/Twilio/Rest/Serverless/V1/Service/EnvironmentInstance.php new file mode 100755 index 0000000..c97f3e8 --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/EnvironmentInstance.php @@ -0,0 +1,181 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'buildSid' => Values::array_get($payload, 'build_sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'domainSuffix' => Values::array_get($payload, 'domain_suffix'), + 'domainName' => Values::array_get($payload, 'domain_name'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return EnvironmentContext Context for this EnvironmentInstance + */ + protected function proxy(): EnvironmentContext + { + if (!$this->context) { + $this->context = new EnvironmentContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the EnvironmentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the EnvironmentInstance + * + * @return EnvironmentInstance Fetched EnvironmentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EnvironmentInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the logs + */ + protected function getLogs(): LogList + { + return $this->proxy()->logs; + } + + /** + * Access the deployments + */ + protected function getDeployments(): DeploymentList + { + return $this->proxy()->deployments; + } + + /** + * Access the variables + */ + protected function getVariables(): VariableList + { + return $this->proxy()->variables; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.EnvironmentInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/EnvironmentList.php b/app/api/Twilio/Rest/Serverless/V1/Service/EnvironmentList.php new file mode 100755 index 0000000..ed04b52 --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/EnvironmentList.php @@ -0,0 +1,200 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Environments'; + } + + /** + * Create the EnvironmentInstance + * + * @param string $uniqueName A user-defined string that uniquely identifies the Environment resource. It can be a maximum of 100 characters. + * @param array|Options $options Optional Arguments + * @return EnvironmentInstance Created EnvironmentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $uniqueName, array $options = []): EnvironmentInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $uniqueName, + 'DomainSuffix' => + $options['domainSuffix'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new EnvironmentInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads EnvironmentInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return EnvironmentInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams EnvironmentInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of EnvironmentInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return EnvironmentPage Page of EnvironmentInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): EnvironmentPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new EnvironmentPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of EnvironmentInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return EnvironmentPage Page of EnvironmentInstance + */ + public function getPage(string $targetUrl): EnvironmentPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new EnvironmentPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a EnvironmentContext + * + * @param string $sid The SID of the Environment resource to delete. + */ + public function getContext( + string $sid + + ): EnvironmentContext + { + return new EnvironmentContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.EnvironmentList]'; + } +} diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/EnvironmentOptions.php b/app/api/Twilio/Rest/Serverless/V1/Service/EnvironmentOptions.php new file mode 100755 index 0000000..666fae9 --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/EnvironmentOptions.php @@ -0,0 +1,82 @@ +options['domainSuffix'] = $domainSuffix; + } + + /** + * A URL-friendly name that represents the environment and forms part of the domain name. It can be a maximum of 16 characters. + * + * @param string $domainSuffix A URL-friendly name that represents the environment and forms part of the domain name. It can be a maximum of 16 characters. + * @return $this Fluent Builder + */ + public function setDomainSuffix(string $domainSuffix): self + { + $this->options['domainSuffix'] = $domainSuffix; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Serverless.V1.CreateEnvironmentOptions ' . $options . ']'; + } +} + + + + diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/EnvironmentPage.php b/app/api/Twilio/Rest/Serverless/V1/Service/EnvironmentPage.php new file mode 100755 index 0000000..d4a854f --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/EnvironmentPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return EnvironmentInstance \Twilio\Rest\Serverless\V1\Service\EnvironmentInstance + */ + public function buildInstance(array $payload): EnvironmentInstance + { + return new EnvironmentInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.EnvironmentPage]'; + } +} diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/FunctionContext.php b/app/api/Twilio/Rest/Serverless/V1/Service/FunctionContext.php new file mode 100755 index 0000000..75d3742 --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/FunctionContext.php @@ -0,0 +1,186 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Functions/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the FunctionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the FunctionInstance + * + * @return FunctionInstance Fetched FunctionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FunctionInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new FunctionInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the FunctionInstance + * + * @param string $friendlyName A descriptive string that you create to describe the Function resource. It can be a maximum of 255 characters. + * @return FunctionInstance Updated FunctionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $friendlyName): FunctionInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new FunctionInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the functionVersions + */ + protected function getFunctionVersions(): FunctionVersionList + { + if (!$this->_functionVersions) { + $this->_functionVersions = new FunctionVersionList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_functionVersions; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.FunctionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/FunctionInstance.php b/app/api/Twilio/Rest/Serverless/V1/Service/FunctionInstance.php new file mode 100755 index 0000000..f6178fb --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/FunctionInstance.php @@ -0,0 +1,168 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return FunctionContext Context for this FunctionInstance + */ + protected function proxy(): FunctionContext + { + if (!$this->context) { + $this->context = new FunctionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the FunctionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the FunctionInstance + * + * @return FunctionInstance Fetched FunctionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FunctionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the FunctionInstance + * + * @param string $friendlyName A descriptive string that you create to describe the Function resource. It can be a maximum of 255 characters. + * @return FunctionInstance Updated FunctionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $friendlyName): FunctionInstance + { + + return $this->proxy()->update($friendlyName); + } + + /** + * Access the functionVersions + */ + protected function getFunctionVersions(): FunctionVersionList + { + return $this->proxy()->functionVersions; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.FunctionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/FunctionList.php b/app/api/Twilio/Rest/Serverless/V1/Service/FunctionList.php new file mode 100755 index 0000000..4d17693 --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/FunctionList.php @@ -0,0 +1,194 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Functions'; + } + + /** + * Create the FunctionInstance + * + * @param string $friendlyName A descriptive string that you create to describe the Function resource. It can be a maximum of 255 characters. + * @return FunctionInstance Created FunctionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName): FunctionInstance + { + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new FunctionInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads FunctionInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return FunctionInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams FunctionInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of FunctionInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return FunctionPage Page of FunctionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): FunctionPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new FunctionPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of FunctionInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return FunctionPage Page of FunctionInstance + */ + public function getPage(string $targetUrl): FunctionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new FunctionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a FunctionContext + * + * @param string $sid The SID of the Function resource to delete. + */ + public function getContext( + string $sid + + ): FunctionContext + { + return new FunctionContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.FunctionList]'; + } +} diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/FunctionPage.php b/app/api/Twilio/Rest/Serverless/V1/Service/FunctionPage.php new file mode 100755 index 0000000..e27f7fb --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/FunctionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return FunctionInstance \Twilio\Rest\Serverless\V1\Service\FunctionInstance + */ + public function buildInstance(array $payload): FunctionInstance + { + return new FunctionInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.FunctionPage]'; + } +} diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentContext.php b/app/api/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentContext.php new file mode 100755 index 0000000..7e86721 --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentContext.php @@ -0,0 +1,93 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'functionSid' => + $functionSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Functions/' . \rawurlencode($functionSid) + .'/Versions/' . \rawurlencode($sid) + .'/Content'; + } + + /** + * Fetch the FunctionVersionContentInstance + * + * @return FunctionVersionContentInstance Fetched FunctionVersionContentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FunctionVersionContentInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new FunctionVersionContentInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['functionSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.FunctionVersionContentContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentInstance.php b/app/api/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentInstance.php new file mode 100755 index 0000000..8f8af5b --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentInstance.php @@ -0,0 +1,129 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'functionSid' => Values::array_get($payload, 'function_sid'), + 'content' => Values::array_get($payload, 'content'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'functionSid' => $functionSid, 'sid' => $sid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return FunctionVersionContentContext Context for this FunctionVersionContentInstance + */ + protected function proxy(): FunctionVersionContentContext + { + if (!$this->context) { + $this->context = new FunctionVersionContentContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['functionSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the FunctionVersionContentInstance + * + * @return FunctionVersionContentInstance Fetched FunctionVersionContentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FunctionVersionContentInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.FunctionVersionContentInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentList.php b/app/api/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentList.php new file mode 100755 index 0000000..03576cd --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentList.php @@ -0,0 +1,79 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'functionSid' => + $functionSid, + + 'sid' => + $sid, + + ]; + } + + /** + * Constructs a FunctionVersionContentContext + */ + public function getContext( + + ): FunctionVersionContentContext + { + return new FunctionVersionContentContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['functionSid'], + $this->solution['sid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.FunctionVersionContentList]'; + } +} diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentPage.php b/app/api/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentPage.php new file mode 100755 index 0000000..9a0acbb --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersion/FunctionVersionContentPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return FunctionVersionContentInstance \Twilio\Rest\Serverless\V1\Service\TwilioFunction\FunctionVersion\FunctionVersionContentInstance + */ + public function buildInstance(array $payload): FunctionVersionContentInstance + { + return new FunctionVersionContentInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['functionSid'], $this->solution['sid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.FunctionVersionContentPage]'; + } +} diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionContext.php b/app/api/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionContext.php new file mode 100755 index 0000000..b86a086 --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionContext.php @@ -0,0 +1,153 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'functionSid' => + $functionSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Functions/' . \rawurlencode($functionSid) + .'/Versions/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the FunctionVersionInstance + * + * @return FunctionVersionInstance Fetched FunctionVersionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FunctionVersionInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new FunctionVersionInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['functionSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the functionVersionContent + */ + protected function getFunctionVersionContent(): FunctionVersionContentList + { + if (!$this->_functionVersionContent) { + $this->_functionVersionContent = new FunctionVersionContentList( + $this->version, + $this->solution['serviceSid'], + $this->solution['functionSid'], + $this->solution['sid'] + ); + } + + return $this->_functionVersionContent; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.FunctionVersionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionInstance.php b/app/api/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionInstance.php new file mode 100755 index 0000000..ee43bdf --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionInstance.php @@ -0,0 +1,147 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'functionSid' => Values::array_get($payload, 'function_sid'), + 'path' => Values::array_get($payload, 'path'), + 'visibility' => Values::array_get($payload, 'visibility'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'functionSid' => $functionSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return FunctionVersionContext Context for this FunctionVersionInstance + */ + protected function proxy(): FunctionVersionContext + { + if (!$this->context) { + $this->context = new FunctionVersionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['functionSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the FunctionVersionInstance + * + * @return FunctionVersionInstance Fetched FunctionVersionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FunctionVersionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the functionVersionContent + */ + protected function getFunctionVersionContent(): FunctionVersionContentList + { + return $this->proxy()->functionVersionContent; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.FunctionVersionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionList.php b/app/api/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionList.php new file mode 100755 index 0000000..0852da4 --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionList.php @@ -0,0 +1,175 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'functionSid' => + $functionSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Functions/' . \rawurlencode($functionSid) + .'/Versions'; + } + + /** + * Reads FunctionVersionInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return FunctionVersionInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams FunctionVersionInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of FunctionVersionInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return FunctionVersionPage Page of FunctionVersionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): FunctionVersionPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new FunctionVersionPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of FunctionVersionInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return FunctionVersionPage Page of FunctionVersionInstance + */ + public function getPage(string $targetUrl): FunctionVersionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new FunctionVersionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a FunctionVersionContext + * + * @param string $sid The SID of the Function Version resource to fetch. + */ + public function getContext( + string $sid + + ): FunctionVersionContext + { + return new FunctionVersionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['functionSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.FunctionVersionList]'; + } +} diff --git a/app/api/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionPage.php b/app/api/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionPage.php new file mode 100755 index 0000000..218745a --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/Service/TwilioFunction/FunctionVersionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return FunctionVersionInstance \Twilio\Rest\Serverless\V1\Service\TwilioFunction\FunctionVersionInstance + */ + public function buildInstance(array $payload): FunctionVersionInstance + { + return new FunctionVersionInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['functionSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.FunctionVersionPage]'; + } +} diff --git a/app/api/Twilio/Rest/Serverless/V1/ServiceContext.php b/app/api/Twilio/Rest/Serverless/V1/ServiceContext.php new file mode 100755 index 0000000..68985cc --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/ServiceContext.php @@ -0,0 +1,243 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'IncludeCredentials' => + Serialize::booleanToString($options['includeCredentials']), + 'FriendlyName' => + $options['friendlyName'], + 'UiEditable' => + Serialize::booleanToString($options['uiEditable']), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the functions + */ + protected function getFunctions(): FunctionList + { + if (!$this->_functions) { + $this->_functions = new FunctionList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_functions; + } + + /** + * Access the builds + */ + protected function getBuilds(): BuildList + { + if (!$this->_builds) { + $this->_builds = new BuildList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_builds; + } + + /** + * Access the environments + */ + protected function getEnvironments(): EnvironmentList + { + if (!$this->_environments) { + $this->_environments = new EnvironmentList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_environments; + } + + /** + * Access the assets + */ + protected function getAssets(): AssetList + { + if (!$this->_assets) { + $this->_assets = new AssetList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_assets; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.ServiceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Serverless/V1/ServiceInstance.php b/app/api/Twilio/Rest/Serverless/V1/ServiceInstance.php new file mode 100755 index 0000000..44e06a9 --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/ServiceInstance.php @@ -0,0 +1,203 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'includeCredentials' => Values::array_get($payload, 'include_credentials'), + 'uiEditable' => Values::array_get($payload, 'ui_editable'), + 'domainBase' => Values::array_get($payload, 'domain_base'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ServiceContext Context for this ServiceInstance + */ + protected function proxy(): ServiceContext + { + if (!$this->context) { + $this->context = new ServiceContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the functions + */ + protected function getFunctions(): FunctionList + { + return $this->proxy()->functions; + } + + /** + * Access the builds + */ + protected function getBuilds(): BuildList + { + return $this->proxy()->builds; + } + + /** + * Access the environments + */ + protected function getEnvironments(): EnvironmentList + { + return $this->proxy()->environments; + } + + /** + * Access the assets + */ + protected function getAssets(): AssetList + { + return $this->proxy()->assets; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Serverless.V1.ServiceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Serverless/V1/ServiceList.php b/app/api/Twilio/Rest/Serverless/V1/ServiceList.php new file mode 100755 index 0000000..f97a47b --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/ServiceList.php @@ -0,0 +1,198 @@ +solution = [ + ]; + + $this->uri = '/Services'; + } + + /** + * Create the ServiceInstance + * + * @param string $uniqueName A user-defined string that uniquely identifies the Service resource. It can be used as an alternative to the `sid` in the URL path to address the Service resource. This value must be 50 characters or less in length and be unique. + * @param string $friendlyName A descriptive string that you create to describe the Service resource. It can be a maximum of 255 characters. + * @param array|Options $options Optional Arguments + * @return ServiceInstance Created ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $uniqueName, string $friendlyName, array $options = []): ServiceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $uniqueName, + 'FriendlyName' => + $friendlyName, + 'IncludeCredentials' => + Serialize::booleanToString($options['includeCredentials']), + 'UiEditable' => + Serialize::booleanToString($options['uiEditable']), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new ServiceInstance( + $this->version, + $payload + ); + } + + + /** + * Reads ServiceInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ServiceInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ServiceInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ServiceInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ServicePage Page of ServiceInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ServicePage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ServicePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ServiceInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ServicePage Page of ServiceInstance + */ + public function getPage(string $targetUrl): ServicePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ServicePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ServiceContext + * + * @param string $sid The `sid` or `unique_name` of the Service resource to delete. + */ + public function getContext( + string $sid + + ): ServiceContext + { + return new ServiceContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.ServiceList]'; + } +} diff --git a/app/api/Twilio/Rest/Serverless/V1/ServiceOptions.php b/app/api/Twilio/Rest/Serverless/V1/ServiceOptions.php new file mode 100755 index 0000000..8283d99 --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/ServiceOptions.php @@ -0,0 +1,188 @@ +options['includeCredentials'] = $includeCredentials; + $this->options['uiEditable'] = $uiEditable; + } + + /** + * Whether to inject Account credentials into a function invocation context. The default value is `true`. + * + * @param bool $includeCredentials Whether to inject Account credentials into a function invocation context. The default value is `true`. + * @return $this Fluent Builder + */ + public function setIncludeCredentials(bool $includeCredentials): self + { + $this->options['includeCredentials'] = $includeCredentials; + return $this; + } + + /** + * Whether the Service's properties and subresources can be edited via the UI. The default value is `false`. + * + * @param bool $uiEditable Whether the Service's properties and subresources can be edited via the UI. The default value is `false`. + * @return $this Fluent Builder + */ + public function setUiEditable(bool $uiEditable): self + { + $this->options['uiEditable'] = $uiEditable; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Serverless.V1.CreateServiceOptions ' . $options . ']'; + } +} + + + + +class UpdateServiceOptions extends Options + { + /** + * @param bool $includeCredentials Whether to inject Account credentials into a function invocation context. + * @param string $friendlyName A descriptive string that you create to describe the Service resource. It can be a maximum of 255 characters. + * @param bool $uiEditable Whether the Service resource's properties and subresources can be edited via the UI. The default value is `false`. + */ + public function __construct( + + bool $includeCredentials = Values::BOOL_NONE, + string $friendlyName = Values::NONE, + bool $uiEditable = Values::BOOL_NONE + + ) { + $this->options['includeCredentials'] = $includeCredentials; + $this->options['friendlyName'] = $friendlyName; + $this->options['uiEditable'] = $uiEditable; + } + + /** + * Whether to inject Account credentials into a function invocation context. + * + * @param bool $includeCredentials Whether to inject Account credentials into a function invocation context. + * @return $this Fluent Builder + */ + public function setIncludeCredentials(bool $includeCredentials): self + { + $this->options['includeCredentials'] = $includeCredentials; + return $this; + } + + /** + * A descriptive string that you create to describe the Service resource. It can be a maximum of 255 characters. + * + * @param string $friendlyName A descriptive string that you create to describe the Service resource. It can be a maximum of 255 characters. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Whether the Service resource's properties and subresources can be edited via the UI. The default value is `false`. + * + * @param bool $uiEditable Whether the Service resource's properties and subresources can be edited via the UI. The default value is `false`. + * @return $this Fluent Builder + */ + public function setUiEditable(bool $uiEditable): self + { + $this->options['uiEditable'] = $uiEditable; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Serverless.V1.UpdateServiceOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Serverless/V1/ServicePage.php b/app/api/Twilio/Rest/Serverless/V1/ServicePage.php new file mode 100755 index 0000000..ad29d7f --- /dev/null +++ b/app/api/Twilio/Rest/Serverless/V1/ServicePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ServiceInstance \Twilio\Rest\Serverless\V1\ServiceInstance + */ + public function buildInstance(array $payload): ServiceInstance + { + return new ServiceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Serverless.V1.ServicePage]'; + } +} diff --git a/app/api/Twilio/Rest/ServerlessBase.php b/app/api/Twilio/Rest/ServerlessBase.php new file mode 100755 index 0000000..4aa8d51 --- /dev/null +++ b/app/api/Twilio/Rest/ServerlessBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://serverless.twilio.com'; + } + + + /** + * @return V1 Version v1 of serverless + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Serverless]'; + } +} diff --git a/app/api/Twilio/Rest/Studio.php b/app/api/Twilio/Rest/Studio.php new file mode 100755 index 0000000..ddb3f32 --- /dev/null +++ b/app/api/Twilio/Rest/Studio.php @@ -0,0 +1,32 @@ +flows instead. + */ + protected function getFlows(): \Twilio\Rest\Studio\V2\FlowList { + echo "flows is deprecated. Use v2->flows instead."; + return $this->v2->flows; + } + + /** + * @deprecated Use v2->flows(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextFlows(string $sid): \Twilio\Rest\Studio\V2\FlowContext { + echo "flows(\$sid) is deprecated. Use v2->flows(\$sid) instead."; + return $this->v2->flows($sid); + } + + /** + * @deprecated Use v2->flowValidate instead. + */ + protected function getFlowValidate(): \Twilio\Rest\Studio\V2\FlowValidateList { + echo "flowValidate is deprecated. Use v2->flowValidate instead."; + return $this->v2->flowValidate; + } +} \ No newline at end of file diff --git a/app/api/Twilio/Rest/Studio/V1.php b/app/api/Twilio/Rest/Studio/V1.php new file mode 100755 index 0000000..a58c38a --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1.php @@ -0,0 +1,95 @@ +version = 'v1'; + } + + protected function getFlows(): FlowList + { + if (!$this->_flows) { + $this->_flows = new FlowList($this); + } + return $this->_flows; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V1]'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextContext.php b/app/api/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextContext.php new file mode 100755 index 0000000..16b084a --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextContext.php @@ -0,0 +1,87 @@ +solution = [ + 'flowSid' => + $flowSid, + 'engagementSid' => + $engagementSid, + ]; + + $this->uri = '/Flows/' . \rawurlencode($flowSid) + .'/Engagements/' . \rawurlencode($engagementSid) + .'/Context'; + } + + /** + * Fetch the EngagementContextInstance + * + * @return EngagementContextInstance Fetched EngagementContextInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EngagementContextInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new EngagementContextInstance( + $this->version, + $payload, + $this->solution['flowSid'], + $this->solution['engagementSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V1.EngagementContextContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextInstance.php b/app/api/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextInstance.php new file mode 100755 index 0000000..49029d2 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextInstance.php @@ -0,0 +1,125 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'context' => Values::array_get($payload, 'context'), + 'engagementSid' => Values::array_get($payload, 'engagement_sid'), + 'flowSid' => Values::array_get($payload, 'flow_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['flowSid' => $flowSid, 'engagementSid' => $engagementSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return EngagementContextContext Context for this EngagementContextInstance + */ + protected function proxy(): EngagementContextContext + { + if (!$this->context) { + $this->context = new EngagementContextContext( + $this->version, + $this->solution['flowSid'], + $this->solution['engagementSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the EngagementContextInstance + * + * @return EngagementContextInstance Fetched EngagementContextInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EngagementContextInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V1.EngagementContextInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextList.php b/app/api/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextList.php new file mode 100755 index 0000000..770d620 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextList.php @@ -0,0 +1,73 @@ +solution = [ + 'flowSid' => + $flowSid, + + 'engagementSid' => + $engagementSid, + + ]; + } + + /** + * Constructs a EngagementContextContext + */ + public function getContext( + + ): EngagementContextContext + { + return new EngagementContextContext( + $this->version, + $this->solution['flowSid'], + $this->solution['engagementSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V1.EngagementContextList]'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextPage.php b/app/api/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextPage.php new file mode 100755 index 0000000..5becce0 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1/Flow/Engagement/EngagementContextPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return EngagementContextInstance \Twilio\Rest\Studio\V1\Flow\Engagement\EngagementContextInstance + */ + public function buildInstance(array $payload): EngagementContextInstance + { + return new EngagementContextInstance($this->version, $payload, $this->solution['flowSid'], $this->solution['engagementSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V1.EngagementContextPage]'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextContext.php b/app/api/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextContext.php new file mode 100755 index 0000000..4b9d7a3 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextContext.php @@ -0,0 +1,93 @@ +solution = [ + 'flowSid' => + $flowSid, + 'engagementSid' => + $engagementSid, + 'stepSid' => + $stepSid, + ]; + + $this->uri = '/Flows/' . \rawurlencode($flowSid) + .'/Engagements/' . \rawurlencode($engagementSid) + .'/Steps/' . \rawurlencode($stepSid) + .'/Context'; + } + + /** + * Fetch the StepContextInstance + * + * @return StepContextInstance Fetched StepContextInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): StepContextInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new StepContextInstance( + $this->version, + $payload, + $this->solution['flowSid'], + $this->solution['engagementSid'], + $this->solution['stepSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V1.StepContextContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextInstance.php b/app/api/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextInstance.php new file mode 100755 index 0000000..8d57aa1 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextInstance.php @@ -0,0 +1,129 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'context' => Values::array_get($payload, 'context'), + 'engagementSid' => Values::array_get($payload, 'engagement_sid'), + 'flowSid' => Values::array_get($payload, 'flow_sid'), + 'stepSid' => Values::array_get($payload, 'step_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['flowSid' => $flowSid, 'engagementSid' => $engagementSid, 'stepSid' => $stepSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return StepContextContext Context for this StepContextInstance + */ + protected function proxy(): StepContextContext + { + if (!$this->context) { + $this->context = new StepContextContext( + $this->version, + $this->solution['flowSid'], + $this->solution['engagementSid'], + $this->solution['stepSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the StepContextInstance + * + * @return StepContextInstance Fetched StepContextInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): StepContextInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V1.StepContextInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextList.php b/app/api/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextList.php new file mode 100755 index 0000000..5dbb608 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextList.php @@ -0,0 +1,79 @@ +solution = [ + 'flowSid' => + $flowSid, + + 'engagementSid' => + $engagementSid, + + 'stepSid' => + $stepSid, + + ]; + } + + /** + * Constructs a StepContextContext + */ + public function getContext( + + ): StepContextContext + { + return new StepContextContext( + $this->version, + $this->solution['flowSid'], + $this->solution['engagementSid'], + $this->solution['stepSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V1.StepContextList]'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextPage.php b/app/api/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextPage.php new file mode 100755 index 0000000..587d083 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1/Flow/Engagement/Step/StepContextPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return StepContextInstance \Twilio\Rest\Studio\V1\Flow\Engagement\Step\StepContextInstance + */ + public function buildInstance(array $payload): StepContextInstance + { + return new StepContextInstance($this->version, $payload, $this->solution['flowSid'], $this->solution['engagementSid'], $this->solution['stepSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V1.StepContextPage]'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V1/Flow/Engagement/StepContext.php b/app/api/Twilio/Rest/Studio/V1/Flow/Engagement/StepContext.php new file mode 100755 index 0000000..5c58a8a --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1/Flow/Engagement/StepContext.php @@ -0,0 +1,153 @@ +solution = [ + 'flowSid' => + $flowSid, + 'engagementSid' => + $engagementSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Flows/' . \rawurlencode($flowSid) + .'/Engagements/' . \rawurlencode($engagementSid) + .'/Steps/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the StepInstance + * + * @return StepInstance Fetched StepInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): StepInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new StepInstance( + $this->version, + $payload, + $this->solution['flowSid'], + $this->solution['engagementSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the stepContext + */ + protected function getStepContext(): StepContextList + { + if (!$this->_stepContext) { + $this->_stepContext = new StepContextList( + $this->version, + $this->solution['flowSid'], + $this->solution['engagementSid'], + $this->solution['sid'] + ); + } + + return $this->_stepContext; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V1.StepContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V1/Flow/Engagement/StepInstance.php b/app/api/Twilio/Rest/Studio/V1/Flow/Engagement/StepInstance.php new file mode 100755 index 0000000..4d6cabf --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1/Flow/Engagement/StepInstance.php @@ -0,0 +1,153 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'flowSid' => Values::array_get($payload, 'flow_sid'), + 'engagementSid' => Values::array_get($payload, 'engagement_sid'), + 'name' => Values::array_get($payload, 'name'), + 'context' => Values::array_get($payload, 'context'), + 'transitionedFrom' => Values::array_get($payload, 'transitioned_from'), + 'transitionedTo' => Values::array_get($payload, 'transitioned_to'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['flowSid' => $flowSid, 'engagementSid' => $engagementSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return StepContext Context for this StepInstance + */ + protected function proxy(): StepContext + { + if (!$this->context) { + $this->context = new StepContext( + $this->version, + $this->solution['flowSid'], + $this->solution['engagementSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the StepInstance + * + * @return StepInstance Fetched StepInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): StepInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the stepContext + */ + protected function getStepContext(): StepContextList + { + return $this->proxy()->stepContext; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V1.StepInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Studio/V1/Flow/Engagement/StepList.php b/app/api/Twilio/Rest/Studio/V1/Flow/Engagement/StepList.php new file mode 100755 index 0000000..7f52e9c --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1/Flow/Engagement/StepList.php @@ -0,0 +1,175 @@ +solution = [ + 'flowSid' => + $flowSid, + + 'engagementSid' => + $engagementSid, + + ]; + + $this->uri = '/Flows/' . \rawurlencode($flowSid) + .'/Engagements/' . \rawurlencode($engagementSid) + .'/Steps'; + } + + /** + * Reads StepInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return StepInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams StepInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of StepInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return StepPage Page of StepInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): StepPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new StepPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of StepInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return StepPage Page of StepInstance + */ + public function getPage(string $targetUrl): StepPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new StepPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a StepContext + * + * @param string $sid The SID of the Step resource to fetch. + */ + public function getContext( + string $sid + + ): StepContext + { + return new StepContext( + $this->version, + $this->solution['flowSid'], + $this->solution['engagementSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V1.StepList]'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V1/Flow/Engagement/StepPage.php b/app/api/Twilio/Rest/Studio/V1/Flow/Engagement/StepPage.php new file mode 100755 index 0000000..73360c6 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1/Flow/Engagement/StepPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return StepInstance \Twilio\Rest\Studio\V1\Flow\Engagement\StepInstance + */ + public function buildInstance(array $payload): StepInstance + { + return new StepInstance($this->version, $payload, $this->solution['flowSid'], $this->solution['engagementSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V1.StepPage]'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V1/Flow/EngagementContext.php b/app/api/Twilio/Rest/Studio/V1/Flow/EngagementContext.php new file mode 100755 index 0000000..d1066f2 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1/Flow/EngagementContext.php @@ -0,0 +1,179 @@ +solution = [ + 'flowSid' => + $flowSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Flows/' . \rawurlencode($flowSid) + .'/Engagements/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the EngagementInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the EngagementInstance + * + * @return EngagementInstance Fetched EngagementInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EngagementInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new EngagementInstance( + $this->version, + $payload, + $this->solution['flowSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the steps + */ + protected function getSteps(): StepList + { + if (!$this->_steps) { + $this->_steps = new StepList( + $this->version, + $this->solution['flowSid'], + $this->solution['sid'] + ); + } + + return $this->_steps; + } + + /** + * Access the engagementContext + */ + protected function getEngagementContext(): EngagementContextList + { + if (!$this->_engagementContext) { + $this->_engagementContext = new EngagementContextList( + $this->version, + $this->solution['flowSid'], + $this->solution['sid'] + ); + } + + return $this->_engagementContext; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V1.EngagementContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V1/Flow/EngagementInstance.php b/app/api/Twilio/Rest/Studio/V1/Flow/EngagementInstance.php new file mode 100755 index 0000000..a537162 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1/Flow/EngagementInstance.php @@ -0,0 +1,171 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'flowSid' => Values::array_get($payload, 'flow_sid'), + 'contactSid' => Values::array_get($payload, 'contact_sid'), + 'contactChannelAddress' => Values::array_get($payload, 'contact_channel_address'), + 'context' => Values::array_get($payload, 'context'), + 'status' => Values::array_get($payload, 'status'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['flowSid' => $flowSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return EngagementContext Context for this EngagementInstance + */ + protected function proxy(): EngagementContext + { + if (!$this->context) { + $this->context = new EngagementContext( + $this->version, + $this->solution['flowSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the EngagementInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the EngagementInstance + * + * @return EngagementInstance Fetched EngagementInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EngagementInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the steps + */ + protected function getSteps(): StepList + { + return $this->proxy()->steps; + } + + /** + * Access the engagementContext + */ + protected function getEngagementContext(): EngagementContextList + { + return $this->proxy()->engagementContext; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V1.EngagementInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Studio/V1/Flow/EngagementList.php b/app/api/Twilio/Rest/Studio/V1/Flow/EngagementList.php new file mode 100755 index 0000000..6f9706a --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1/Flow/EngagementList.php @@ -0,0 +1,204 @@ +solution = [ + 'flowSid' => + $flowSid, + + ]; + + $this->uri = '/Flows/' . \rawurlencode($flowSid) + .'/Engagements'; + } + + /** + * Create the EngagementInstance + * + * @param string $to The Contact phone number to start a Studio Flow Engagement, available as variable `{{contact.channel.address}}`. + * @param string $from The Twilio phone number to send messages or initiate calls from during the Flow Engagement. Available as variable `{{flow.channel.address}}` + * @param array|Options $options Optional Arguments + * @return EngagementInstance Created EngagementInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $to, string $from, array $options = []): EngagementInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'To' => + $to, + 'From' => + $from, + 'Parameters' => + Serialize::jsonObject($options['parameters']), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new EngagementInstance( + $this->version, + $payload, + $this->solution['flowSid'] + ); + } + + + /** + * Reads EngagementInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return EngagementInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams EngagementInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of EngagementInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return EngagementPage Page of EngagementInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): EngagementPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new EngagementPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of EngagementInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return EngagementPage Page of EngagementInstance + */ + public function getPage(string $targetUrl): EngagementPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new EngagementPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a EngagementContext + * + * @param string $sid The SID of the Engagement resource to delete. + */ + public function getContext( + string $sid + + ): EngagementContext + { + return new EngagementContext( + $this->version, + $this->solution['flowSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V1.EngagementList]'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V1/Flow/EngagementOptions.php b/app/api/Twilio/Rest/Studio/V1/Flow/EngagementOptions.php new file mode 100755 index 0000000..28acbf5 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1/Flow/EngagementOptions.php @@ -0,0 +1,82 @@ +options['parameters'] = $parameters; + } + + /** + * A JSON string we will add to your flow's context and that you can access as variables inside your flow. For example, if you pass in `Parameters={'name':'Zeke'}` then inside a widget you can reference the variable `{{flow.data.name}}` which will return the string 'Zeke'. Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode your JSON string. + * + * @param array $parameters A JSON string we will add to your flow's context and that you can access as variables inside your flow. For example, if you pass in `Parameters={'name':'Zeke'}` then inside a widget you can reference the variable `{{flow.data.name}}` which will return the string 'Zeke'. Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode your JSON string. + * @return $this Fluent Builder + */ + public function setParameters(array $parameters): self + { + $this->options['parameters'] = $parameters; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Studio.V1.CreateEngagementOptions ' . $options . ']'; + } +} + + + + diff --git a/app/api/Twilio/Rest/Studio/V1/Flow/EngagementPage.php b/app/api/Twilio/Rest/Studio/V1/Flow/EngagementPage.php new file mode 100755 index 0000000..627a64b --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1/Flow/EngagementPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return EngagementInstance \Twilio\Rest\Studio\V1\Flow\EngagementInstance + */ + public function buildInstance(array $payload): EngagementInstance + { + return new EngagementInstance($this->version, $payload, $this->solution['flowSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V1.EngagementPage]'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextContext.php b/app/api/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextContext.php new file mode 100755 index 0000000..e27aeab --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextContext.php @@ -0,0 +1,87 @@ +solution = [ + 'flowSid' => + $flowSid, + 'executionSid' => + $executionSid, + ]; + + $this->uri = '/Flows/' . \rawurlencode($flowSid) + .'/Executions/' . \rawurlencode($executionSid) + .'/Context'; + } + + /** + * Fetch the ExecutionContextInstance + * + * @return ExecutionContextInstance Fetched ExecutionContextInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExecutionContextInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ExecutionContextInstance( + $this->version, + $payload, + $this->solution['flowSid'], + $this->solution['executionSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V1.ExecutionContextContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextInstance.php b/app/api/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextInstance.php new file mode 100755 index 0000000..e6b80b7 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextInstance.php @@ -0,0 +1,125 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'context' => Values::array_get($payload, 'context'), + 'flowSid' => Values::array_get($payload, 'flow_sid'), + 'executionSid' => Values::array_get($payload, 'execution_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['flowSid' => $flowSid, 'executionSid' => $executionSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ExecutionContextContext Context for this ExecutionContextInstance + */ + protected function proxy(): ExecutionContextContext + { + if (!$this->context) { + $this->context = new ExecutionContextContext( + $this->version, + $this->solution['flowSid'], + $this->solution['executionSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the ExecutionContextInstance + * + * @return ExecutionContextInstance Fetched ExecutionContextInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExecutionContextInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V1.ExecutionContextInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextList.php b/app/api/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextList.php new file mode 100755 index 0000000..cff0094 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextList.php @@ -0,0 +1,73 @@ +solution = [ + 'flowSid' => + $flowSid, + + 'executionSid' => + $executionSid, + + ]; + } + + /** + * Constructs a ExecutionContextContext + */ + public function getContext( + + ): ExecutionContextContext + { + return new ExecutionContextContext( + $this->version, + $this->solution['flowSid'], + $this->solution['executionSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V1.ExecutionContextList]'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextPage.php b/app/api/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextPage.php new file mode 100755 index 0000000..5f721f4 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionContextPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ExecutionContextInstance \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionContextInstance + */ + public function buildInstance(array $payload): ExecutionContextInstance + { + return new ExecutionContextInstance($this->version, $payload, $this->solution['flowSid'], $this->solution['executionSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V1.ExecutionContextPage]'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextContext.php b/app/api/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextContext.php new file mode 100755 index 0000000..0785945 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextContext.php @@ -0,0 +1,93 @@ +solution = [ + 'flowSid' => + $flowSid, + 'executionSid' => + $executionSid, + 'stepSid' => + $stepSid, + ]; + + $this->uri = '/Flows/' . \rawurlencode($flowSid) + .'/Executions/' . \rawurlencode($executionSid) + .'/Steps/' . \rawurlencode($stepSid) + .'/Context'; + } + + /** + * Fetch the ExecutionStepContextInstance + * + * @return ExecutionStepContextInstance Fetched ExecutionStepContextInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExecutionStepContextInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ExecutionStepContextInstance( + $this->version, + $payload, + $this->solution['flowSid'], + $this->solution['executionSid'], + $this->solution['stepSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V1.ExecutionStepContextContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextInstance.php b/app/api/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextInstance.php new file mode 100755 index 0000000..020e1a8 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextInstance.php @@ -0,0 +1,129 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'context' => Values::array_get($payload, 'context'), + 'executionSid' => Values::array_get($payload, 'execution_sid'), + 'flowSid' => Values::array_get($payload, 'flow_sid'), + 'stepSid' => Values::array_get($payload, 'step_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['flowSid' => $flowSid, 'executionSid' => $executionSid, 'stepSid' => $stepSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ExecutionStepContextContext Context for this ExecutionStepContextInstance + */ + protected function proxy(): ExecutionStepContextContext + { + if (!$this->context) { + $this->context = new ExecutionStepContextContext( + $this->version, + $this->solution['flowSid'], + $this->solution['executionSid'], + $this->solution['stepSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the ExecutionStepContextInstance + * + * @return ExecutionStepContextInstance Fetched ExecutionStepContextInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExecutionStepContextInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V1.ExecutionStepContextInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextList.php b/app/api/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextList.php new file mode 100755 index 0000000..ae0de6b --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextList.php @@ -0,0 +1,79 @@ +solution = [ + 'flowSid' => + $flowSid, + + 'executionSid' => + $executionSid, + + 'stepSid' => + $stepSid, + + ]; + } + + /** + * Constructs a ExecutionStepContextContext + */ + public function getContext( + + ): ExecutionStepContextContext + { + return new ExecutionStepContextContext( + $this->version, + $this->solution['flowSid'], + $this->solution['executionSid'], + $this->solution['stepSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V1.ExecutionStepContextList]'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextPage.php b/app/api/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextPage.php new file mode 100755 index 0000000..2f52038 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStep/ExecutionStepContextPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ExecutionStepContextInstance \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStep\ExecutionStepContextInstance + */ + public function buildInstance(array $payload): ExecutionStepContextInstance + { + return new ExecutionStepContextInstance($this->version, $payload, $this->solution['flowSid'], $this->solution['executionSid'], $this->solution['stepSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V1.ExecutionStepContextPage]'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepContext.php b/app/api/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepContext.php new file mode 100755 index 0000000..4b7a4a5 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepContext.php @@ -0,0 +1,153 @@ +solution = [ + 'flowSid' => + $flowSid, + 'executionSid' => + $executionSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Flows/' . \rawurlencode($flowSid) + .'/Executions/' . \rawurlencode($executionSid) + .'/Steps/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the ExecutionStepInstance + * + * @return ExecutionStepInstance Fetched ExecutionStepInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExecutionStepInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ExecutionStepInstance( + $this->version, + $payload, + $this->solution['flowSid'], + $this->solution['executionSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the stepContext + */ + protected function getStepContext(): ExecutionStepContextList + { + if (!$this->_stepContext) { + $this->_stepContext = new ExecutionStepContextList( + $this->version, + $this->solution['flowSid'], + $this->solution['executionSid'], + $this->solution['sid'] + ); + } + + return $this->_stepContext; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V1.ExecutionStepContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepInstance.php b/app/api/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepInstance.php new file mode 100755 index 0000000..758e153 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepInstance.php @@ -0,0 +1,153 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'flowSid' => Values::array_get($payload, 'flow_sid'), + 'executionSid' => Values::array_get($payload, 'execution_sid'), + 'name' => Values::array_get($payload, 'name'), + 'context' => Values::array_get($payload, 'context'), + 'transitionedFrom' => Values::array_get($payload, 'transitioned_from'), + 'transitionedTo' => Values::array_get($payload, 'transitioned_to'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['flowSid' => $flowSid, 'executionSid' => $executionSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ExecutionStepContext Context for this ExecutionStepInstance + */ + protected function proxy(): ExecutionStepContext + { + if (!$this->context) { + $this->context = new ExecutionStepContext( + $this->version, + $this->solution['flowSid'], + $this->solution['executionSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the ExecutionStepInstance + * + * @return ExecutionStepInstance Fetched ExecutionStepInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExecutionStepInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the stepContext + */ + protected function getStepContext(): ExecutionStepContextList + { + return $this->proxy()->stepContext; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V1.ExecutionStepInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepList.php b/app/api/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepList.php new file mode 100755 index 0000000..8b4dbe9 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepList.php @@ -0,0 +1,175 @@ +solution = [ + 'flowSid' => + $flowSid, + + 'executionSid' => + $executionSid, + + ]; + + $this->uri = '/Flows/' . \rawurlencode($flowSid) + .'/Executions/' . \rawurlencode($executionSid) + .'/Steps'; + } + + /** + * Reads ExecutionStepInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ExecutionStepInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ExecutionStepInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ExecutionStepInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ExecutionStepPage Page of ExecutionStepInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ExecutionStepPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ExecutionStepPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ExecutionStepInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ExecutionStepPage Page of ExecutionStepInstance + */ + public function getPage(string $targetUrl): ExecutionStepPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ExecutionStepPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ExecutionStepContext + * + * @param string $sid The SID of the ExecutionStep resource to fetch. + */ + public function getContext( + string $sid + + ): ExecutionStepContext + { + return new ExecutionStepContext( + $this->version, + $this->solution['flowSid'], + $this->solution['executionSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V1.ExecutionStepList]'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepPage.php b/app/api/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepPage.php new file mode 100755 index 0000000..a8468b0 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1/Flow/Execution/ExecutionStepPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ExecutionStepInstance \Twilio\Rest\Studio\V1\Flow\Execution\ExecutionStepInstance + */ + public function buildInstance(array $payload): ExecutionStepInstance + { + return new ExecutionStepInstance($this->version, $payload, $this->solution['flowSid'], $this->solution['executionSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V1.ExecutionStepPage]'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V1/Flow/ExecutionContext.php b/app/api/Twilio/Rest/Studio/V1/Flow/ExecutionContext.php new file mode 100755 index 0000000..bac9ae7 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1/Flow/ExecutionContext.php @@ -0,0 +1,206 @@ +solution = [ + 'flowSid' => + $flowSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Flows/' . \rawurlencode($flowSid) + .'/Executions/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ExecutionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the ExecutionInstance + * + * @return ExecutionInstance Fetched ExecutionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExecutionInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ExecutionInstance( + $this->version, + $payload, + $this->solution['flowSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ExecutionInstance + * + * @param string $status + * @return ExecutionInstance Updated ExecutionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status): ExecutionInstance + { + + $data = Values::of([ + 'Status' => + $status, + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new ExecutionInstance( + $this->version, + $payload, + $this->solution['flowSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the steps + */ + protected function getSteps(): ExecutionStepList + { + if (!$this->_steps) { + $this->_steps = new ExecutionStepList( + $this->version, + $this->solution['flowSid'], + $this->solution['sid'] + ); + } + + return $this->_steps; + } + + /** + * Access the executionContext + */ + protected function getExecutionContext(): ExecutionContextList + { + if (!$this->_executionContext) { + $this->_executionContext = new ExecutionContextList( + $this->version, + $this->solution['flowSid'], + $this->solution['sid'] + ); + } + + return $this->_executionContext; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V1.ExecutionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V1/Flow/ExecutionInstance.php b/app/api/Twilio/Rest/Studio/V1/Flow/ExecutionInstance.php new file mode 100755 index 0000000..bfe4a4d --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1/Flow/ExecutionInstance.php @@ -0,0 +1,184 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'flowSid' => Values::array_get($payload, 'flow_sid'), + 'contactSid' => Values::array_get($payload, 'contact_sid'), + 'contactChannelAddress' => Values::array_get($payload, 'contact_channel_address'), + 'context' => Values::array_get($payload, 'context'), + 'status' => Values::array_get($payload, 'status'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['flowSid' => $flowSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ExecutionContext Context for this ExecutionInstance + */ + protected function proxy(): ExecutionContext + { + if (!$this->context) { + $this->context = new ExecutionContext( + $this->version, + $this->solution['flowSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ExecutionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ExecutionInstance + * + * @return ExecutionInstance Fetched ExecutionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExecutionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ExecutionInstance + * + * @param string $status + * @return ExecutionInstance Updated ExecutionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status): ExecutionInstance + { + + return $this->proxy()->update($status); + } + + /** + * Access the steps + */ + protected function getSteps(): ExecutionStepList + { + return $this->proxy()->steps; + } + + /** + * Access the executionContext + */ + protected function getExecutionContext(): ExecutionContextList + { + return $this->proxy()->executionContext; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V1.ExecutionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Studio/V1/Flow/ExecutionList.php b/app/api/Twilio/Rest/Studio/V1/Flow/ExecutionList.php new file mode 100755 index 0000000..df47681 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1/Flow/ExecutionList.php @@ -0,0 +1,212 @@ +solution = [ + 'flowSid' => + $flowSid, + + ]; + + $this->uri = '/Flows/' . \rawurlencode($flowSid) + .'/Executions'; + } + + /** + * Create the ExecutionInstance + * + * @param string $to The Contact phone number to start a Studio Flow Execution, available as variable `{{contact.channel.address}}`. + * @param string $from The Twilio phone number to send messages or initiate calls from during the Flow's Execution. Available as variable `{{flow.channel.address}}`. For SMS, this can also be a Messaging Service SID. + * @param array|Options $options Optional Arguments + * @return ExecutionInstance Created ExecutionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $to, string $from, array $options = []): ExecutionInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'To' => + $to, + 'From' => + $from, + 'Parameters' => + Serialize::jsonObject($options['parameters']), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new ExecutionInstance( + $this->version, + $payload, + $this->solution['flowSid'] + ); + } + + + /** + * Reads ExecutionInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ExecutionInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams ExecutionInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ExecutionInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ExecutionPage Page of ExecutionInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ExecutionPage + { + $options = new Values($options); + + $params = Values::of([ + 'DateCreatedFrom' => + Serialize::iso8601DateTime($options['dateCreatedFrom']), + 'DateCreatedTo' => + Serialize::iso8601DateTime($options['dateCreatedTo']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ExecutionPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ExecutionInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ExecutionPage Page of ExecutionInstance + */ + public function getPage(string $targetUrl): ExecutionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ExecutionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ExecutionContext + * + * @param string $sid The SID of the Execution resource to delete. + */ + public function getContext( + string $sid + + ): ExecutionContext + { + return new ExecutionContext( + $this->version, + $this->solution['flowSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V1.ExecutionList]'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V1/Flow/ExecutionOptions.php b/app/api/Twilio/Rest/Studio/V1/Flow/ExecutionOptions.php new file mode 100755 index 0000000..3c685ff --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1/Flow/ExecutionOptions.php @@ -0,0 +1,152 @@ +options['parameters'] = $parameters; + } + + /** + * JSON data that will be added to the Flow's context and that can be accessed as variables inside your Flow. For example, if you pass in `Parameters={\\\"name\\\":\\\"Zeke\\\"}`, a widget in your Flow can reference the variable `{{flow.data.name}}`, which returns \\\"Zeke\\\". Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode the JSON string. + * + * @param array $parameters JSON data that will be added to the Flow's context and that can be accessed as variables inside your Flow. For example, if you pass in `Parameters={\\\"name\\\":\\\"Zeke\\\"}`, a widget in your Flow can reference the variable `{{flow.data.name}}`, which returns \\\"Zeke\\\". Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode the JSON string. + * @return $this Fluent Builder + */ + public function setParameters(array $parameters): self + { + $this->options['parameters'] = $parameters; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Studio.V1.CreateExecutionOptions ' . $options . ']'; + } +} + + + +class ReadExecutionOptions extends Options + { + /** + * @param \DateTime $dateCreatedFrom Only show Execution resources starting on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. + * @param \DateTime $dateCreatedTo Only show Execution resources starting before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. + */ + public function __construct( + + \DateTime $dateCreatedFrom = null, + \DateTime $dateCreatedTo = null + + ) { + $this->options['dateCreatedFrom'] = $dateCreatedFrom; + $this->options['dateCreatedTo'] = $dateCreatedTo; + } + + /** + * Only show Execution resources starting on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. + * + * @param \DateTime $dateCreatedFrom Only show Execution resources starting on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. + * @return $this Fluent Builder + */ + public function setDateCreatedFrom(\DateTime $dateCreatedFrom): self + { + $this->options['dateCreatedFrom'] = $dateCreatedFrom; + return $this; + } + + /** + * Only show Execution resources starting before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. + * + * @param \DateTime $dateCreatedTo Only show Execution resources starting before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. + * @return $this Fluent Builder + */ + public function setDateCreatedTo(\DateTime $dateCreatedTo): self + { + $this->options['dateCreatedTo'] = $dateCreatedTo; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Studio.V1.ReadExecutionOptions ' . $options . ']'; + } +} + + diff --git a/app/api/Twilio/Rest/Studio/V1/Flow/ExecutionPage.php b/app/api/Twilio/Rest/Studio/V1/Flow/ExecutionPage.php new file mode 100755 index 0000000..d2c180c --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1/Flow/ExecutionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ExecutionInstance \Twilio\Rest\Studio\V1\Flow\ExecutionInstance + */ + public function buildInstance(array $payload): ExecutionInstance + { + return new ExecutionInstance($this->version, $payload, $this->solution['flowSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V1.ExecutionPage]'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V1/FlowContext.php b/app/api/Twilio/Rest/Studio/V1/FlowContext.php new file mode 100755 index 0000000..13f011a --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1/FlowContext.php @@ -0,0 +1,171 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Flows/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the FlowInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the FlowInstance + * + * @return FlowInstance Fetched FlowInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FlowInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new FlowInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the engagements + */ + protected function getEngagements(): EngagementList + { + if (!$this->_engagements) { + $this->_engagements = new EngagementList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_engagements; + } + + /** + * Access the executions + */ + protected function getExecutions(): ExecutionList + { + if (!$this->_executions) { + $this->_executions = new ExecutionList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_executions; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V1.FlowContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V1/FlowInstance.php b/app/api/Twilio/Rest/Studio/V1/FlowInstance.php new file mode 100755 index 0000000..89e92e9 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1/FlowInstance.php @@ -0,0 +1,165 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'status' => Values::array_get($payload, 'status'), + 'version' => Values::array_get($payload, 'version'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return FlowContext Context for this FlowInstance + */ + protected function proxy(): FlowContext + { + if (!$this->context) { + $this->context = new FlowContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the FlowInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the FlowInstance + * + * @return FlowInstance Fetched FlowInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FlowInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the engagements + */ + protected function getEngagements(): EngagementList + { + return $this->proxy()->engagements; + } + + /** + * Access the executions + */ + protected function getExecutions(): ExecutionList + { + return $this->proxy()->executions; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V1.FlowInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Studio/V1/FlowList.php b/app/api/Twilio/Rest/Studio/V1/FlowList.php new file mode 100755 index 0000000..600aeb0 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1/FlowList.php @@ -0,0 +1,161 @@ +solution = [ + ]; + + $this->uri = '/Flows'; + } + + /** + * Reads FlowInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return FlowInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams FlowInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of FlowInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return FlowPage Page of FlowInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): FlowPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new FlowPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of FlowInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return FlowPage Page of FlowInstance + */ + public function getPage(string $targetUrl): FlowPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new FlowPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a FlowContext + * + * @param string $sid The SID of the Flow resource to delete. + */ + public function getContext( + string $sid + + ): FlowContext + { + return new FlowContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V1.FlowList]'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V1/FlowPage.php b/app/api/Twilio/Rest/Studio/V1/FlowPage.php new file mode 100755 index 0000000..0636aac --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V1/FlowPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return FlowInstance \Twilio\Rest\Studio\V1\FlowInstance + */ + public function buildInstance(array $payload): FlowInstance + { + return new FlowInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V1.FlowPage]'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V2.php b/app/api/Twilio/Rest/Studio/V2.php new file mode 100755 index 0000000..9fd95c7 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V2.php @@ -0,0 +1,106 @@ +version = 'v2'; + } + + protected function getFlows(): FlowList + { + if (!$this->_flows) { + $this->_flows = new FlowList($this); + } + return $this->_flows; + } + + protected function getFlowValidate(): FlowValidateList + { + if (!$this->_flowValidate) { + $this->_flowValidate = new FlowValidateList($this); + } + return $this->_flowValidate; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V2]'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextContext.php b/app/api/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextContext.php new file mode 100755 index 0000000..db77b12 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextContext.php @@ -0,0 +1,87 @@ +solution = [ + 'flowSid' => + $flowSid, + 'executionSid' => + $executionSid, + ]; + + $this->uri = '/Flows/' . \rawurlencode($flowSid) + .'/Executions/' . \rawurlencode($executionSid) + .'/Context'; + } + + /** + * Fetch the ExecutionContextInstance + * + * @return ExecutionContextInstance Fetched ExecutionContextInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExecutionContextInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ExecutionContextInstance( + $this->version, + $payload, + $this->solution['flowSid'], + $this->solution['executionSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V2.ExecutionContextContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextInstance.php b/app/api/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextInstance.php new file mode 100755 index 0000000..82a65cc --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextInstance.php @@ -0,0 +1,125 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'context' => Values::array_get($payload, 'context'), + 'flowSid' => Values::array_get($payload, 'flow_sid'), + 'executionSid' => Values::array_get($payload, 'execution_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['flowSid' => $flowSid, 'executionSid' => $executionSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ExecutionContextContext Context for this ExecutionContextInstance + */ + protected function proxy(): ExecutionContextContext + { + if (!$this->context) { + $this->context = new ExecutionContextContext( + $this->version, + $this->solution['flowSid'], + $this->solution['executionSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the ExecutionContextInstance + * + * @return ExecutionContextInstance Fetched ExecutionContextInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExecutionContextInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V2.ExecutionContextInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextList.php b/app/api/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextList.php new file mode 100755 index 0000000..1d57ca2 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextList.php @@ -0,0 +1,73 @@ +solution = [ + 'flowSid' => + $flowSid, + + 'executionSid' => + $executionSid, + + ]; + } + + /** + * Constructs a ExecutionContextContext + */ + public function getContext( + + ): ExecutionContextContext + { + return new ExecutionContextContext( + $this->version, + $this->solution['flowSid'], + $this->solution['executionSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V2.ExecutionContextList]'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextPage.php b/app/api/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextPage.php new file mode 100755 index 0000000..2f219f9 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionContextPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ExecutionContextInstance \Twilio\Rest\Studio\V2\Flow\Execution\ExecutionContextInstance + */ + public function buildInstance(array $payload): ExecutionContextInstance + { + return new ExecutionContextInstance($this->version, $payload, $this->solution['flowSid'], $this->solution['executionSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V2.ExecutionContextPage]'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextContext.php b/app/api/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextContext.php new file mode 100755 index 0000000..5382866 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextContext.php @@ -0,0 +1,93 @@ +solution = [ + 'flowSid' => + $flowSid, + 'executionSid' => + $executionSid, + 'stepSid' => + $stepSid, + ]; + + $this->uri = '/Flows/' . \rawurlencode($flowSid) + .'/Executions/' . \rawurlencode($executionSid) + .'/Steps/' . \rawurlencode($stepSid) + .'/Context'; + } + + /** + * Fetch the ExecutionStepContextInstance + * + * @return ExecutionStepContextInstance Fetched ExecutionStepContextInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExecutionStepContextInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ExecutionStepContextInstance( + $this->version, + $payload, + $this->solution['flowSid'], + $this->solution['executionSid'], + $this->solution['stepSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V2.ExecutionStepContextContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextInstance.php b/app/api/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextInstance.php new file mode 100755 index 0000000..f7d3e38 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextInstance.php @@ -0,0 +1,129 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'context' => Values::array_get($payload, 'context'), + 'executionSid' => Values::array_get($payload, 'execution_sid'), + 'flowSid' => Values::array_get($payload, 'flow_sid'), + 'stepSid' => Values::array_get($payload, 'step_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['flowSid' => $flowSid, 'executionSid' => $executionSid, 'stepSid' => $stepSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ExecutionStepContextContext Context for this ExecutionStepContextInstance + */ + protected function proxy(): ExecutionStepContextContext + { + if (!$this->context) { + $this->context = new ExecutionStepContextContext( + $this->version, + $this->solution['flowSid'], + $this->solution['executionSid'], + $this->solution['stepSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the ExecutionStepContextInstance + * + * @return ExecutionStepContextInstance Fetched ExecutionStepContextInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExecutionStepContextInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V2.ExecutionStepContextInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextList.php b/app/api/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextList.php new file mode 100755 index 0000000..1d2686d --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextList.php @@ -0,0 +1,79 @@ +solution = [ + 'flowSid' => + $flowSid, + + 'executionSid' => + $executionSid, + + 'stepSid' => + $stepSid, + + ]; + } + + /** + * Constructs a ExecutionStepContextContext + */ + public function getContext( + + ): ExecutionStepContextContext + { + return new ExecutionStepContextContext( + $this->version, + $this->solution['flowSid'], + $this->solution['executionSid'], + $this->solution['stepSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V2.ExecutionStepContextList]'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextPage.php b/app/api/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextPage.php new file mode 100755 index 0000000..97d4c4f --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStep/ExecutionStepContextPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ExecutionStepContextInstance \Twilio\Rest\Studio\V2\Flow\Execution\ExecutionStep\ExecutionStepContextInstance + */ + public function buildInstance(array $payload): ExecutionStepContextInstance + { + return new ExecutionStepContextInstance($this->version, $payload, $this->solution['flowSid'], $this->solution['executionSid'], $this->solution['stepSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V2.ExecutionStepContextPage]'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepContext.php b/app/api/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepContext.php new file mode 100755 index 0000000..6787aa1 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepContext.php @@ -0,0 +1,153 @@ +solution = [ + 'flowSid' => + $flowSid, + 'executionSid' => + $executionSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Flows/' . \rawurlencode($flowSid) + .'/Executions/' . \rawurlencode($executionSid) + .'/Steps/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the ExecutionStepInstance + * + * @return ExecutionStepInstance Fetched ExecutionStepInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExecutionStepInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ExecutionStepInstance( + $this->version, + $payload, + $this->solution['flowSid'], + $this->solution['executionSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the stepContext + */ + protected function getStepContext(): ExecutionStepContextList + { + if (!$this->_stepContext) { + $this->_stepContext = new ExecutionStepContextList( + $this->version, + $this->solution['flowSid'], + $this->solution['executionSid'], + $this->solution['sid'] + ); + } + + return $this->_stepContext; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V2.ExecutionStepContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepInstance.php b/app/api/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepInstance.php new file mode 100755 index 0000000..fab3406 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepInstance.php @@ -0,0 +1,153 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'flowSid' => Values::array_get($payload, 'flow_sid'), + 'executionSid' => Values::array_get($payload, 'execution_sid'), + 'name' => Values::array_get($payload, 'name'), + 'context' => Values::array_get($payload, 'context'), + 'transitionedFrom' => Values::array_get($payload, 'transitioned_from'), + 'transitionedTo' => Values::array_get($payload, 'transitioned_to'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['flowSid' => $flowSid, 'executionSid' => $executionSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ExecutionStepContext Context for this ExecutionStepInstance + */ + protected function proxy(): ExecutionStepContext + { + if (!$this->context) { + $this->context = new ExecutionStepContext( + $this->version, + $this->solution['flowSid'], + $this->solution['executionSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the ExecutionStepInstance + * + * @return ExecutionStepInstance Fetched ExecutionStepInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExecutionStepInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the stepContext + */ + protected function getStepContext(): ExecutionStepContextList + { + return $this->proxy()->stepContext; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V2.ExecutionStepInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepList.php b/app/api/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepList.php new file mode 100755 index 0000000..f2d7d61 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepList.php @@ -0,0 +1,175 @@ +solution = [ + 'flowSid' => + $flowSid, + + 'executionSid' => + $executionSid, + + ]; + + $this->uri = '/Flows/' . \rawurlencode($flowSid) + .'/Executions/' . \rawurlencode($executionSid) + .'/Steps'; + } + + /** + * Reads ExecutionStepInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ExecutionStepInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ExecutionStepInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ExecutionStepInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ExecutionStepPage Page of ExecutionStepInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ExecutionStepPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ExecutionStepPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ExecutionStepInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ExecutionStepPage Page of ExecutionStepInstance + */ + public function getPage(string $targetUrl): ExecutionStepPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ExecutionStepPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ExecutionStepContext + * + * @param string $sid The SID of the ExecutionStep resource to fetch. + */ + public function getContext( + string $sid + + ): ExecutionStepContext + { + return new ExecutionStepContext( + $this->version, + $this->solution['flowSid'], + $this->solution['executionSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V2.ExecutionStepList]'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepPage.php b/app/api/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepPage.php new file mode 100755 index 0000000..c667097 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V2/Flow/Execution/ExecutionStepPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ExecutionStepInstance \Twilio\Rest\Studio\V2\Flow\Execution\ExecutionStepInstance + */ + public function buildInstance(array $payload): ExecutionStepInstance + { + return new ExecutionStepInstance($this->version, $payload, $this->solution['flowSid'], $this->solution['executionSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V2.ExecutionStepPage]'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V2/Flow/ExecutionContext.php b/app/api/Twilio/Rest/Studio/V2/Flow/ExecutionContext.php new file mode 100755 index 0000000..b1e1559 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V2/Flow/ExecutionContext.php @@ -0,0 +1,206 @@ +solution = [ + 'flowSid' => + $flowSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Flows/' . \rawurlencode($flowSid) + .'/Executions/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ExecutionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the ExecutionInstance + * + * @return ExecutionInstance Fetched ExecutionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExecutionInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ExecutionInstance( + $this->version, + $payload, + $this->solution['flowSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ExecutionInstance + * + * @param string $status + * @return ExecutionInstance Updated ExecutionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status): ExecutionInstance + { + + $data = Values::of([ + 'Status' => + $status, + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new ExecutionInstance( + $this->version, + $payload, + $this->solution['flowSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the steps + */ + protected function getSteps(): ExecutionStepList + { + if (!$this->_steps) { + $this->_steps = new ExecutionStepList( + $this->version, + $this->solution['flowSid'], + $this->solution['sid'] + ); + } + + return $this->_steps; + } + + /** + * Access the executionContext + */ + protected function getExecutionContext(): ExecutionContextList + { + if (!$this->_executionContext) { + $this->_executionContext = new ExecutionContextList( + $this->version, + $this->solution['flowSid'], + $this->solution['sid'] + ); + } + + return $this->_executionContext; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V2.ExecutionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V2/Flow/ExecutionInstance.php b/app/api/Twilio/Rest/Studio/V2/Flow/ExecutionInstance.php new file mode 100755 index 0000000..ce6a7c7 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V2/Flow/ExecutionInstance.php @@ -0,0 +1,182 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'flowSid' => Values::array_get($payload, 'flow_sid'), + 'contactChannelAddress' => Values::array_get($payload, 'contact_channel_address'), + 'context' => Values::array_get($payload, 'context'), + 'status' => Values::array_get($payload, 'status'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['flowSid' => $flowSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ExecutionContext Context for this ExecutionInstance + */ + protected function proxy(): ExecutionContext + { + if (!$this->context) { + $this->context = new ExecutionContext( + $this->version, + $this->solution['flowSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ExecutionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ExecutionInstance + * + * @return ExecutionInstance Fetched ExecutionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ExecutionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ExecutionInstance + * + * @param string $status + * @return ExecutionInstance Updated ExecutionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status): ExecutionInstance + { + + return $this->proxy()->update($status); + } + + /** + * Access the steps + */ + protected function getSteps(): ExecutionStepList + { + return $this->proxy()->steps; + } + + /** + * Access the executionContext + */ + protected function getExecutionContext(): ExecutionContextList + { + return $this->proxy()->executionContext; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V2.ExecutionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Studio/V2/Flow/ExecutionList.php b/app/api/Twilio/Rest/Studio/V2/Flow/ExecutionList.php new file mode 100755 index 0000000..74b8e07 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V2/Flow/ExecutionList.php @@ -0,0 +1,212 @@ +solution = [ + 'flowSid' => + $flowSid, + + ]; + + $this->uri = '/Flows/' . \rawurlencode($flowSid) + .'/Executions'; + } + + /** + * Create the ExecutionInstance + * + * @param string $to The Contact phone number to start a Studio Flow Execution, available as variable `{{contact.channel.address}}`. + * @param string $from The Twilio phone number to send messages or initiate calls from during the Flow's Execution. Available as variable `{{flow.channel.address}}`. For SMS, this can also be a Messaging Service SID. + * @param array|Options $options Optional Arguments + * @return ExecutionInstance Created ExecutionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $to, string $from, array $options = []): ExecutionInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'To' => + $to, + 'From' => + $from, + 'Parameters' => + Serialize::jsonObject($options['parameters']), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new ExecutionInstance( + $this->version, + $payload, + $this->solution['flowSid'] + ); + } + + + /** + * Reads ExecutionInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ExecutionInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams ExecutionInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ExecutionInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ExecutionPage Page of ExecutionInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ExecutionPage + { + $options = new Values($options); + + $params = Values::of([ + 'DateCreatedFrom' => + Serialize::iso8601DateTime($options['dateCreatedFrom']), + 'DateCreatedTo' => + Serialize::iso8601DateTime($options['dateCreatedTo']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ExecutionPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ExecutionInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ExecutionPage Page of ExecutionInstance + */ + public function getPage(string $targetUrl): ExecutionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ExecutionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ExecutionContext + * + * @param string $sid The SID of the Execution resource to delete. + */ + public function getContext( + string $sid + + ): ExecutionContext + { + return new ExecutionContext( + $this->version, + $this->solution['flowSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V2.ExecutionList]'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V2/Flow/ExecutionOptions.php b/app/api/Twilio/Rest/Studio/V2/Flow/ExecutionOptions.php new file mode 100755 index 0000000..d07a5d3 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V2/Flow/ExecutionOptions.php @@ -0,0 +1,152 @@ +options['parameters'] = $parameters; + } + + /** + * JSON data that will be added to the Flow's context and that can be accessed as variables inside your Flow. For example, if you pass in `Parameters={\\\"name\\\":\\\"Zeke\\\"}`, a widget in your Flow can reference the variable `{{flow.data.name}}`, which returns \\\"Zeke\\\". Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode the JSON string. + * + * @param array $parameters JSON data that will be added to the Flow's context and that can be accessed as variables inside your Flow. For example, if you pass in `Parameters={\\\"name\\\":\\\"Zeke\\\"}`, a widget in your Flow can reference the variable `{{flow.data.name}}`, which returns \\\"Zeke\\\". Note: the JSON value must explicitly be passed as a string, not as a hash object. Depending on your particular HTTP library, you may need to add quotes or URL encode the JSON string. + * @return $this Fluent Builder + */ + public function setParameters(array $parameters): self + { + $this->options['parameters'] = $parameters; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Studio.V2.CreateExecutionOptions ' . $options . ']'; + } +} + + + +class ReadExecutionOptions extends Options + { + /** + * @param \DateTime $dateCreatedFrom Only show Execution resources starting on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. + * @param \DateTime $dateCreatedTo Only show Execution resources starting before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. + */ + public function __construct( + + \DateTime $dateCreatedFrom = null, + \DateTime $dateCreatedTo = null + + ) { + $this->options['dateCreatedFrom'] = $dateCreatedFrom; + $this->options['dateCreatedTo'] = $dateCreatedTo; + } + + /** + * Only show Execution resources starting on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. + * + * @param \DateTime $dateCreatedFrom Only show Execution resources starting on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. + * @return $this Fluent Builder + */ + public function setDateCreatedFrom(\DateTime $dateCreatedFrom): self + { + $this->options['dateCreatedFrom'] = $dateCreatedFrom; + return $this; + } + + /** + * Only show Execution resources starting before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. + * + * @param \DateTime $dateCreatedTo Only show Execution resources starting before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time, given as `YYYY-MM-DDThh:mm:ss-hh:mm`. + * @return $this Fluent Builder + */ + public function setDateCreatedTo(\DateTime $dateCreatedTo): self + { + $this->options['dateCreatedTo'] = $dateCreatedTo; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Studio.V2.ReadExecutionOptions ' . $options . ']'; + } +} + + diff --git a/app/api/Twilio/Rest/Studio/V2/Flow/ExecutionPage.php b/app/api/Twilio/Rest/Studio/V2/Flow/ExecutionPage.php new file mode 100755 index 0000000..1429493 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V2/Flow/ExecutionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ExecutionInstance \Twilio\Rest\Studio\V2\Flow\ExecutionInstance + */ + public function buildInstance(array $payload): ExecutionInstance + { + return new ExecutionInstance($this->version, $payload, $this->solution['flowSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V2.ExecutionPage]'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V2/Flow/FlowRevisionContext.php b/app/api/Twilio/Rest/Studio/V2/Flow/FlowRevisionContext.php new file mode 100755 index 0000000..4b8669b --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V2/Flow/FlowRevisionContext.php @@ -0,0 +1,87 @@ +solution = [ + 'sid' => + $sid, + 'revision' => + $revision, + ]; + + $this->uri = '/Flows/' . \rawurlencode($sid) + .'/Revisions/' . \rawurlencode($revision) + .''; + } + + /** + * Fetch the FlowRevisionInstance + * + * @return FlowRevisionInstance Fetched FlowRevisionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FlowRevisionInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new FlowRevisionInstance( + $this->version, + $payload, + $this->solution['sid'], + $this->solution['revision'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V2.FlowRevisionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V2/Flow/FlowRevisionInstance.php b/app/api/Twilio/Rest/Studio/V2/Flow/FlowRevisionInstance.php new file mode 100755 index 0000000..81221df --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V2/Flow/FlowRevisionInstance.php @@ -0,0 +1,140 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'definition' => Values::array_get($payload, 'definition'), + 'status' => Values::array_get($payload, 'status'), + 'revision' => Values::array_get($payload, 'revision'), + 'commitMessage' => Values::array_get($payload, 'commit_message'), + 'valid' => Values::array_get($payload, 'valid'), + 'errors' => Values::array_get($payload, 'errors'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid, 'revision' => $revision ?: $this->properties['revision'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return FlowRevisionContext Context for this FlowRevisionInstance + */ + protected function proxy(): FlowRevisionContext + { + if (!$this->context) { + $this->context = new FlowRevisionContext( + $this->version, + $this->solution['sid'], + $this->solution['revision'] + ); + } + + return $this->context; + } + + /** + * Fetch the FlowRevisionInstance + * + * @return FlowRevisionInstance Fetched FlowRevisionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FlowRevisionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V2.FlowRevisionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Studio/V2/Flow/FlowRevisionList.php b/app/api/Twilio/Rest/Studio/V2/Flow/FlowRevisionList.php new file mode 100755 index 0000000..f721d0f --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V2/Flow/FlowRevisionList.php @@ -0,0 +1,168 @@ +solution = [ + 'sid' => + $sid, + + ]; + + $this->uri = '/Flows/' . \rawurlencode($sid) + .'/Revisions'; + } + + /** + * Reads FlowRevisionInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return FlowRevisionInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams FlowRevisionInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of FlowRevisionInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return FlowRevisionPage Page of FlowRevisionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): FlowRevisionPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new FlowRevisionPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of FlowRevisionInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return FlowRevisionPage Page of FlowRevisionInstance + */ + public function getPage(string $targetUrl): FlowRevisionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new FlowRevisionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a FlowRevisionContext + * + * @param string $revision Specific Revision number or can be `LatestPublished` and `LatestRevision`. + */ + public function getContext( + string $revision + + ): FlowRevisionContext + { + return new FlowRevisionContext( + $this->version, + $this->solution['sid'], + $revision + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V2.FlowRevisionList]'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V2/Flow/FlowRevisionPage.php b/app/api/Twilio/Rest/Studio/V2/Flow/FlowRevisionPage.php new file mode 100755 index 0000000..7379825 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V2/Flow/FlowRevisionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return FlowRevisionInstance \Twilio\Rest\Studio\V2\Flow\FlowRevisionInstance + */ + public function buildInstance(array $payload): FlowRevisionInstance + { + return new FlowRevisionInstance($this->version, $payload, $this->solution['sid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V2.FlowRevisionPage]'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V2/Flow/FlowTestUserContext.php b/app/api/Twilio/Rest/Studio/V2/Flow/FlowTestUserContext.php new file mode 100755 index 0000000..8be3584 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V2/Flow/FlowTestUserContext.php @@ -0,0 +1,108 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Flows/' . \rawurlencode($sid) + .'/TestUsers'; + } + + /** + * Fetch the FlowTestUserInstance + * + * @return FlowTestUserInstance Fetched FlowTestUserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FlowTestUserInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new FlowTestUserInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the FlowTestUserInstance + * + * @param string[] $testUsers List of test user identities that can test draft versions of the flow. + * @return FlowTestUserInstance Updated FlowTestUserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $testUsers): FlowTestUserInstance + { + + $data = Values::of([ + 'TestUsers' => + Serialize::map($testUsers,function ($e) { return $e; }), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new FlowTestUserInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V2.FlowTestUserContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V2/Flow/FlowTestUserInstance.php b/app/api/Twilio/Rest/Studio/V2/Flow/FlowTestUserInstance.php new file mode 100755 index 0000000..f48e9cc --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V2/Flow/FlowTestUserInstance.php @@ -0,0 +1,132 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'testUsers' => Values::array_get($payload, 'test_users'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return FlowTestUserContext Context for this FlowTestUserInstance + */ + protected function proxy(): FlowTestUserContext + { + if (!$this->context) { + $this->context = new FlowTestUserContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the FlowTestUserInstance + * + * @return FlowTestUserInstance Fetched FlowTestUserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FlowTestUserInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the FlowTestUserInstance + * + * @param string[] $testUsers List of test user identities that can test draft versions of the flow. + * @return FlowTestUserInstance Updated FlowTestUserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $testUsers): FlowTestUserInstance + { + + return $this->proxy()->update($testUsers); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V2.FlowTestUserInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Studio/V2/Flow/FlowTestUserList.php b/app/api/Twilio/Rest/Studio/V2/Flow/FlowTestUserList.php new file mode 100755 index 0000000..8be85b3 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V2/Flow/FlowTestUserList.php @@ -0,0 +1,67 @@ +solution = [ + 'sid' => + $sid, + + ]; + } + + /** + * Constructs a FlowTestUserContext + */ + public function getContext( + + ): FlowTestUserContext + { + return new FlowTestUserContext( + $this->version, + $this->solution['sid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V2.FlowTestUserList]'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V2/Flow/FlowTestUserPage.php b/app/api/Twilio/Rest/Studio/V2/Flow/FlowTestUserPage.php new file mode 100755 index 0000000..c505364 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V2/Flow/FlowTestUserPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return FlowTestUserInstance \Twilio\Rest\Studio\V2\Flow\FlowTestUserInstance + */ + public function buildInstance(array $payload): FlowTestUserInstance + { + return new FlowTestUserInstance($this->version, $payload, $this->solution['sid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V2.FlowTestUserPage]'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V2/FlowContext.php b/app/api/Twilio/Rest/Studio/V2/FlowContext.php new file mode 100755 index 0000000..1a145f1 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V2/FlowContext.php @@ -0,0 +1,227 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Flows/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the FlowInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the FlowInstance + * + * @return FlowInstance Fetched FlowInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FlowInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new FlowInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the FlowInstance + * + * @param string $status + * @param array|Options $options Optional Arguments + * @return FlowInstance Updated FlowInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status, array $options = []): FlowInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Status' => + $status, + 'FriendlyName' => + $options['friendlyName'], + 'Definition' => + Serialize::jsonObject($options['definition']), + 'CommitMessage' => + $options['commitMessage'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new FlowInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the executions + */ + protected function getExecutions(): ExecutionList + { + if (!$this->_executions) { + $this->_executions = new ExecutionList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_executions; + } + + /** + * Access the revisions + */ + protected function getRevisions(): FlowRevisionList + { + if (!$this->_revisions) { + $this->_revisions = new FlowRevisionList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_revisions; + } + + /** + * Access the testUsers + */ + protected function getTestUsers(): FlowTestUserList + { + if (!$this->_testUsers) { + $this->_testUsers = new FlowTestUserList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_testUsers; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V2.FlowContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V2/FlowInstance.php b/app/api/Twilio/Rest/Studio/V2/FlowInstance.php new file mode 100755 index 0000000..96443b6 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V2/FlowInstance.php @@ -0,0 +1,202 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'definition' => Values::array_get($payload, 'definition'), + 'status' => Values::array_get($payload, 'status'), + 'revision' => Values::array_get($payload, 'revision'), + 'commitMessage' => Values::array_get($payload, 'commit_message'), + 'valid' => Values::array_get($payload, 'valid'), + 'errors' => Values::array_get($payload, 'errors'), + 'warnings' => Values::array_get($payload, 'warnings'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'webhookUrl' => Values::array_get($payload, 'webhook_url'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return FlowContext Context for this FlowInstance + */ + protected function proxy(): FlowContext + { + if (!$this->context) { + $this->context = new FlowContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the FlowInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the FlowInstance + * + * @return FlowInstance Fetched FlowInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FlowInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the FlowInstance + * + * @param string $status + * @param array|Options $options Optional Arguments + * @return FlowInstance Updated FlowInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status, array $options = []): FlowInstance + { + + return $this->proxy()->update($status, $options); + } + + /** + * Access the executions + */ + protected function getExecutions(): ExecutionList + { + return $this->proxy()->executions; + } + + /** + * Access the revisions + */ + protected function getRevisions(): FlowRevisionList + { + return $this->proxy()->revisions; + } + + /** + * Access the testUsers + */ + protected function getTestUsers(): FlowTestUserList + { + return $this->proxy()->testUsers; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Studio.V2.FlowInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Studio/V2/FlowList.php b/app/api/Twilio/Rest/Studio/V2/FlowList.php new file mode 100755 index 0000000..8385529 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V2/FlowList.php @@ -0,0 +1,199 @@ +solution = [ + ]; + + $this->uri = '/Flows'; + } + + /** + * Create the FlowInstance + * + * @param string $friendlyName The string that you assigned to describe the Flow. + * @param string $status + * @param array $definition JSON representation of flow definition. + * @param array|Options $options Optional Arguments + * @return FlowInstance Created FlowInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $status, array $definition, array $options = []): FlowInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Status' => + $status, + 'Definition' => + Serialize::jsonObject($definition), + 'CommitMessage' => + $options['commitMessage'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new FlowInstance( + $this->version, + $payload + ); + } + + + /** + * Reads FlowInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return FlowInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams FlowInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of FlowInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return FlowPage Page of FlowInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): FlowPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new FlowPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of FlowInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return FlowPage Page of FlowInstance + */ + public function getPage(string $targetUrl): FlowPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new FlowPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a FlowContext + * + * @param string $sid The SID of the Flow resource to delete. + */ + public function getContext( + string $sid + + ): FlowContext + { + return new FlowContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V2.FlowList]'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V2/FlowOptions.php b/app/api/Twilio/Rest/Studio/V2/FlowOptions.php new file mode 100755 index 0000000..c614aa4 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V2/FlowOptions.php @@ -0,0 +1,170 @@ +options['commitMessage'] = $commitMessage; + } + + /** + * Description of change made in the revision. + * + * @param string $commitMessage Description of change made in the revision. + * @return $this Fluent Builder + */ + public function setCommitMessage(string $commitMessage): self + { + $this->options['commitMessage'] = $commitMessage; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Studio.V2.CreateFlowOptions ' . $options . ']'; + } +} + + + + +class UpdateFlowOptions extends Options + { + /** + * @param string $friendlyName The string that you assigned to describe the Flow. + * @param array $definition JSON representation of flow definition. + * @param string $commitMessage Description of change made in the revision. + */ + public function __construct( + + string $friendlyName = Values::NONE, + array $definition = Values::ARRAY_NONE, + string $commitMessage = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['definition'] = $definition; + $this->options['commitMessage'] = $commitMessage; + } + + /** + * The string that you assigned to describe the Flow. + * + * @param string $friendlyName The string that you assigned to describe the Flow. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * JSON representation of flow definition. + * + * @param array $definition JSON representation of flow definition. + * @return $this Fluent Builder + */ + public function setDefinition(array $definition): self + { + $this->options['definition'] = $definition; + return $this; + } + + /** + * Description of change made in the revision. + * + * @param string $commitMessage Description of change made in the revision. + * @return $this Fluent Builder + */ + public function setCommitMessage(string $commitMessage): self + { + $this->options['commitMessage'] = $commitMessage; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Studio.V2.UpdateFlowOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Studio/V2/FlowPage.php b/app/api/Twilio/Rest/Studio/V2/FlowPage.php new file mode 100755 index 0000000..c450212 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V2/FlowPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return FlowInstance \Twilio\Rest\Studio\V2\FlowInstance + */ + public function buildInstance(array $payload): FlowInstance + { + return new FlowInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V2.FlowPage]'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V2/FlowValidateInstance.php b/app/api/Twilio/Rest/Studio/V2/FlowValidateInstance.php new file mode 100755 index 0000000..59bc7bc --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V2/FlowValidateInstance.php @@ -0,0 +1,80 @@ +properties = [ + 'valid' => Values::array_get($payload, 'valid'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V2.FlowValidateInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Studio/V2/FlowValidateList.php b/app/api/Twilio/Rest/Studio/V2/FlowValidateList.php new file mode 100755 index 0000000..89c3bd0 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V2/FlowValidateList.php @@ -0,0 +1,90 @@ +solution = [ + ]; + + $this->uri = '/Flows/Validate'; + } + + /** + * Update the FlowValidateInstance + * + * @param string $friendlyName The string that you assigned to describe the Flow. + * @param string $status + * @param array $definition JSON representation of flow definition. + * @param array|Options $options Optional Arguments + * @return FlowValidateInstance Updated FlowValidateInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $friendlyName, string $status, array $definition, array $options = []): FlowValidateInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Status' => + $status, + 'Definition' => + Serialize::jsonObject($definition), + 'CommitMessage' => + $options['commitMessage'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new FlowValidateInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V2.FlowValidateList]'; + } +} diff --git a/app/api/Twilio/Rest/Studio/V2/FlowValidateOptions.php b/app/api/Twilio/Rest/Studio/V2/FlowValidateOptions.php new file mode 100755 index 0000000..97468b5 --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V2/FlowValidateOptions.php @@ -0,0 +1,76 @@ +options['commitMessage'] = $commitMessage; + } + + /** + * Description of change made in the revision. + * + * @param string $commitMessage Description of change made in the revision. + * @return $this Fluent Builder + */ + public function setCommitMessage(string $commitMessage): self + { + $this->options['commitMessage'] = $commitMessage; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Studio.V2.UpdateFlowValidateOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Studio/V2/FlowValidatePage.php b/app/api/Twilio/Rest/Studio/V2/FlowValidatePage.php new file mode 100755 index 0000000..6f22c6a --- /dev/null +++ b/app/api/Twilio/Rest/Studio/V2/FlowValidatePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return FlowValidateInstance \Twilio\Rest\Studio\V2\FlowValidateInstance + */ + public function buildInstance(array $payload): FlowValidateInstance + { + return new FlowValidateInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Studio.V2.FlowValidatePage]'; + } +} diff --git a/app/api/Twilio/Rest/StudioBase.php b/app/api/Twilio/Rest/StudioBase.php new file mode 100755 index 0000000..2b5da14 --- /dev/null +++ b/app/api/Twilio/Rest/StudioBase.php @@ -0,0 +1,101 @@ +baseUrl = 'https://studio.twilio.com'; + } + + + /** + * @return V1 Version v1 of studio + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * @return V2 Version v2 of studio + */ + protected function getV2(): V2 { + if (!$this->_v2) { + $this->_v2 = new V2($this); + } + return $this->_v2; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Studio]'; + } +} diff --git a/app/api/Twilio/Rest/Supersim.php b/app/api/Twilio/Rest/Supersim.php new file mode 100755 index 0000000..3b08f48 --- /dev/null +++ b/app/api/Twilio/Rest/Supersim.php @@ -0,0 +1,142 @@ +esimProfiles instead. + */ + protected function getEsimProfiles(): \Twilio\Rest\Supersim\V1\EsimProfileList { + echo "esimProfiles is deprecated. Use v1->esimProfiles instead."; + return $this->v1->esimProfiles; + } + + /** + * @deprecated Use v1->esimProfiles(\$sid) instead. + * @param string $sid The SID of the eSIM Profile resource to fetch + */ + protected function contextEsimProfiles(string $sid): \Twilio\Rest\Supersim\V1\EsimProfileContext { + echo "esimProfiles(\$sid) is deprecated. Use v1->esimProfiles(\$sid) instead."; + return $this->v1->esimProfiles($sid); + } + + /** + * @deprecated Use v1->fleets instead. + */ + protected function getFleets(): \Twilio\Rest\Supersim\V1\FleetList { + echo "fleets is deprecated. Use v1->fleets instead."; + return $this->v1->fleets; + } + + /** + * @deprecated Use v1->fleets(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextFleets(string $sid): \Twilio\Rest\Supersim\V1\FleetContext { + echo "fleets(\$sid) is deprecated. Use v1->fleets(\$sid) instead."; + return $this->v1->fleets($sid); + } + + /** + * @deprecated Use v1->ipCommands instead. + */ + protected function getIpCommands(): \Twilio\Rest\Supersim\V1\IpCommandList { + echo "ipCommands is deprecated. Use v1->ipCommands instead."; + return $this->v1->ipCommands; + } + + /** + * @deprecated Use v1->ipCommands(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextIpCommands(string $sid): \Twilio\Rest\Supersim\V1\IpCommandContext { + echo "ipCommands(\$sid) is deprecated. Use v1->ipCommands(\$sid) instead."; + return $this->v1->ipCommands($sid); + } + + /** + * @deprecated Use v1->networks instead. + */ + protected function getNetworks(): \Twilio\Rest\Supersim\V1\NetworkList { + echo "networks is deprecated. Use v1->networks instead."; + return $this->v1->networks; + } + + /** + * @deprecated Use v1->networks(\$sid) instead. + * @param string $sid The SID of the Network resource to fetch + */ + protected function contextNetworks(string $sid): \Twilio\Rest\Supersim\V1\NetworkContext { + echo "networks(\$sid) is deprecated. Use v1->networks(\$sid) instead."; + return $this->v1->networks($sid); + } + + /** + * @deprecated Use v1->networkAccessProfiles instead. + */ + protected function getNetworkAccessProfiles(): \Twilio\Rest\Supersim\V1\NetworkAccessProfileList { + echo "networkAccessProfiles is deprecated. Use v1->networkAccessProfiles instead."; + return $this->v1->networkAccessProfiles; + } + + /** + * @deprecated Use v1->networkAccessProfiles(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextNetworkAccessProfiles(string $sid): \Twilio\Rest\Supersim\V1\NetworkAccessProfileContext { + echo "networkAccessProfiles(\$sid) is deprecated. Use v1->networkAccessProfiles(\$sid) instead."; + return $this->v1->networkAccessProfiles($sid); + } + + /** + * @deprecated Use v1->settingsUpdates instead. + */ + protected function getSettingsUpdates(): \Twilio\Rest\Supersim\V1\SettingsUpdateList { + echo "settingsUpdates is deprecated. Use v1->settingsUpdates instead."; + return $this->v1->settingsUpdates; + } + + /** + * @deprecated Use v1->sims instead. + */ + protected function getSims(): \Twilio\Rest\Supersim\V1\SimList { + echo "sims is deprecated. Use v1->sims instead."; + return $this->v1->sims; + } + + /** + * @deprecated Use v1->sims(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextSims(string $sid): \Twilio\Rest\Supersim\V1\SimContext { + echo "sims(\$sid) is deprecated. Use v1->sims(\$sid) instead."; + return $this->v1->sims($sid); + } + + /** + * @deprecated Use v1->smsCommands instead. + */ + protected function getSmsCommands(): \Twilio\Rest\Supersim\V1\SmsCommandList { + echo "smsCommands is deprecated. Use v1->smsCommands instead."; + return $this->v1->smsCommands; + } + + /** + * @deprecated Use v1->smsCommands(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextSmsCommands(string $sid): \Twilio\Rest\Supersim\V1\SmsCommandContext { + echo "smsCommands(\$sid) is deprecated. Use v1->smsCommands(\$sid) instead."; + return $this->v1->smsCommands($sid); + } + + /** + * @deprecated Use v1->usageRecords instead. + */ + protected function getUsageRecords(): \Twilio\Rest\Supersim\V1\UsageRecordList { + echo "usageRecords is deprecated. Use v1->usageRecords instead."; + return $this->v1->usageRecords; + } +} \ No newline at end of file diff --git a/app/api/Twilio/Rest/Supersim/V1.php b/app/api/Twilio/Rest/Supersim/V1.php new file mode 100755 index 0000000..1d46543 --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1.php @@ -0,0 +1,189 @@ +version = 'v1'; + } + + protected function getEsimProfiles(): EsimProfileList + { + if (!$this->_esimProfiles) { + $this->_esimProfiles = new EsimProfileList($this); + } + return $this->_esimProfiles; + } + + protected function getFleets(): FleetList + { + if (!$this->_fleets) { + $this->_fleets = new FleetList($this); + } + return $this->_fleets; + } + + protected function getIpCommands(): IpCommandList + { + if (!$this->_ipCommands) { + $this->_ipCommands = new IpCommandList($this); + } + return $this->_ipCommands; + } + + protected function getNetworks(): NetworkList + { + if (!$this->_networks) { + $this->_networks = new NetworkList($this); + } + return $this->_networks; + } + + protected function getNetworkAccessProfiles(): NetworkAccessProfileList + { + if (!$this->_networkAccessProfiles) { + $this->_networkAccessProfiles = new NetworkAccessProfileList($this); + } + return $this->_networkAccessProfiles; + } + + protected function getSettingsUpdates(): SettingsUpdateList + { + if (!$this->_settingsUpdates) { + $this->_settingsUpdates = new SettingsUpdateList($this); + } + return $this->_settingsUpdates; + } + + protected function getSims(): SimList + { + if (!$this->_sims) { + $this->_sims = new SimList($this); + } + return $this->_sims; + } + + protected function getSmsCommands(): SmsCommandList + { + if (!$this->_smsCommands) { + $this->_smsCommands = new SmsCommandList($this); + } + return $this->_smsCommands; + } + + protected function getUsageRecords(): UsageRecordList + { + if (!$this->_usageRecords) { + $this->_usageRecords = new UsageRecordList($this); + } + return $this->_usageRecords; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1]'; + } +} diff --git a/app/api/Twilio/Rest/Supersim/V1/EsimProfileContext.php b/app/api/Twilio/Rest/Supersim/V1/EsimProfileContext.php new file mode 100755 index 0000000..30744de --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/EsimProfileContext.php @@ -0,0 +1,81 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/ESimProfiles/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the EsimProfileInstance + * + * @return EsimProfileInstance Fetched EsimProfileInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EsimProfileInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new EsimProfileInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Supersim.V1.EsimProfileContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Supersim/V1/EsimProfileInstance.php b/app/api/Twilio/Rest/Supersim/V1/EsimProfileInstance.php new file mode 100755 index 0000000..7b7c12c --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/EsimProfileInstance.php @@ -0,0 +1,142 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'iccid' => Values::array_get($payload, 'iccid'), + 'simSid' => Values::array_get($payload, 'sim_sid'), + 'status' => Values::array_get($payload, 'status'), + 'eid' => Values::array_get($payload, 'eid'), + 'smdpPlusAddress' => Values::array_get($payload, 'smdp_plus_address'), + 'matchingId' => Values::array_get($payload, 'matching_id'), + 'activationCode' => Values::array_get($payload, 'activation_code'), + 'errorCode' => Values::array_get($payload, 'error_code'), + 'errorMessage' => Values::array_get($payload, 'error_message'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return EsimProfileContext Context for this EsimProfileInstance + */ + protected function proxy(): EsimProfileContext + { + if (!$this->context) { + $this->context = new EsimProfileContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the EsimProfileInstance + * + * @return EsimProfileInstance Fetched EsimProfileInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EsimProfileInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Supersim.V1.EsimProfileInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Supersim/V1/EsimProfileList.php b/app/api/Twilio/Rest/Supersim/V1/EsimProfileList.php new file mode 100755 index 0000000..0ef92b4 --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/EsimProfileList.php @@ -0,0 +1,206 @@ +solution = [ + ]; + + $this->uri = '/ESimProfiles'; + } + + /** + * Create the EsimProfileInstance + * + * @param array|Options $options Optional Arguments + * @return EsimProfileInstance Created EsimProfileInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): EsimProfileInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'CallbackUrl' => + $options['callbackUrl'], + 'CallbackMethod' => + $options['callbackMethod'], + 'GenerateMatchingId' => + Serialize::booleanToString($options['generateMatchingId']), + 'Eid' => + $options['eid'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new EsimProfileInstance( + $this->version, + $payload + ); + } + + + /** + * Reads EsimProfileInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return EsimProfileInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams EsimProfileInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of EsimProfileInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return EsimProfilePage Page of EsimProfileInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): EsimProfilePage + { + $options = new Values($options); + + $params = Values::of([ + 'Eid' => + $options['eid'], + 'SimSid' => + $options['simSid'], + 'Status' => + $options['status'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new EsimProfilePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of EsimProfileInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return EsimProfilePage Page of EsimProfileInstance + */ + public function getPage(string $targetUrl): EsimProfilePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new EsimProfilePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a EsimProfileContext + * + * @param string $sid The SID of the eSIM Profile resource to fetch. + */ + public function getContext( + string $sid + + ): EsimProfileContext + { + return new EsimProfileContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.EsimProfileList]'; + } +} diff --git a/app/api/Twilio/Rest/Supersim/V1/EsimProfileOptions.php b/app/api/Twilio/Rest/Supersim/V1/EsimProfileOptions.php new file mode 100755 index 0000000..585b6f1 --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/EsimProfileOptions.php @@ -0,0 +1,220 @@ +options['callbackUrl'] = $callbackUrl; + $this->options['callbackMethod'] = $callbackMethod; + $this->options['generateMatchingId'] = $generateMatchingId; + $this->options['eid'] = $eid; + } + + /** + * The URL we should call using the `callback_method` when the status of the eSIM Profile changes. At this stage of the eSIM Profile pilot, the a request to the URL will only be called when the ESimProfile resource changes from `reserving` to `available`. + * + * @param string $callbackUrl The URL we should call using the `callback_method` when the status of the eSIM Profile changes. At this stage of the eSIM Profile pilot, the a request to the URL will only be called when the ESimProfile resource changes from `reserving` to `available`. + * @return $this Fluent Builder + */ + public function setCallbackUrl(string $callbackUrl): self + { + $this->options['callbackUrl'] = $callbackUrl; + return $this; + } + + /** + * The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST. + * + * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST. + * @return $this Fluent Builder + */ + public function setCallbackMethod(string $callbackMethod): self + { + $this->options['callbackMethod'] = $callbackMethod; + return $this; + } + + /** + * When set to `true`, a value for `Eid` does not need to be provided. Instead, when the eSIM profile is reserved, a matching ID will be generated and returned via the `matching_id` property. This identifies the specific eSIM profile that can be used by any capable device to claim and download the profile. + * + * @param bool $generateMatchingId When set to `true`, a value for `Eid` does not need to be provided. Instead, when the eSIM profile is reserved, a matching ID will be generated and returned via the `matching_id` property. This identifies the specific eSIM profile that can be used by any capable device to claim and download the profile. + * @return $this Fluent Builder + */ + public function setGenerateMatchingId(bool $generateMatchingId): self + { + $this->options['generateMatchingId'] = $generateMatchingId; + return $this; + } + + /** + * Identifier of the eUICC that will claim the eSIM Profile. + * + * @param string $eid Identifier of the eUICC that will claim the eSIM Profile. + * @return $this Fluent Builder + */ + public function setEid(string $eid): self + { + $this->options['eid'] = $eid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Supersim.V1.CreateEsimProfileOptions ' . $options . ']'; + } +} + + +class ReadEsimProfileOptions extends Options + { + /** + * @param string $eid List the eSIM Profiles that have been associated with an EId. + * @param string $simSid Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/wireless/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. + * @param string $status List the eSIM Profiles that are in a given status. + */ + public function __construct( + + string $eid = Values::NONE, + string $simSid = Values::NONE, + string $status = Values::NONE + + ) { + $this->options['eid'] = $eid; + $this->options['simSid'] = $simSid; + $this->options['status'] = $status; + } + + /** + * List the eSIM Profiles that have been associated with an EId. + * + * @param string $eid List the eSIM Profiles that have been associated with an EId. + * @return $this Fluent Builder + */ + public function setEid(string $eid): self + { + $this->options['eid'] = $eid; + return $this; + } + + /** + * Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/wireless/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. + * + * @param string $simSid Find the eSIM Profile resource related to a [Sim](https://www.twilio.com/docs/wireless/api/sim-resource) resource by providing the SIM SID. Will always return an array with either 1 or 0 records. + * @return $this Fluent Builder + */ + public function setSimSid(string $simSid): self + { + $this->options['simSid'] = $simSid; + return $this; + } + + /** + * List the eSIM Profiles that are in a given status. + * + * @param string $status List the eSIM Profiles that are in a given status. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Supersim.V1.ReadEsimProfileOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Supersim/V1/EsimProfilePage.php b/app/api/Twilio/Rest/Supersim/V1/EsimProfilePage.php new file mode 100755 index 0000000..033c4d9 --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/EsimProfilePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return EsimProfileInstance \Twilio\Rest\Supersim\V1\EsimProfileInstance + */ + public function buildInstance(array $payload): EsimProfileInstance + { + return new EsimProfileInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.EsimProfilePage]'; + } +} diff --git a/app/api/Twilio/Rest/Supersim/V1/FleetContext.php b/app/api/Twilio/Rest/Supersim/V1/FleetContext.php new file mode 100755 index 0000000..cf4d989 --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/FleetContext.php @@ -0,0 +1,122 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Fleets/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the FleetInstance + * + * @return FleetInstance Fetched FleetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FleetInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new FleetInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the FleetInstance + * + * @param array|Options $options Optional Arguments + * @return FleetInstance Updated FleetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): FleetInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + 'NetworkAccessProfile' => + $options['networkAccessProfile'], + 'IpCommandsUrl' => + $options['ipCommandsUrl'], + 'IpCommandsMethod' => + $options['ipCommandsMethod'], + 'SmsCommandsUrl' => + $options['smsCommandsUrl'], + 'SmsCommandsMethod' => + $options['smsCommandsMethod'], + 'DataLimit' => + $options['dataLimit'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new FleetInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Supersim.V1.FleetContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Supersim/V1/FleetInstance.php b/app/api/Twilio/Rest/Supersim/V1/FleetInstance.php new file mode 100755 index 0000000..00b43f6 --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/FleetInstance.php @@ -0,0 +1,158 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'dataEnabled' => Values::array_get($payload, 'data_enabled'), + 'dataLimit' => Values::array_get($payload, 'data_limit'), + 'dataMetering' => Values::array_get($payload, 'data_metering'), + 'smsCommandsEnabled' => Values::array_get($payload, 'sms_commands_enabled'), + 'smsCommandsUrl' => Values::array_get($payload, 'sms_commands_url'), + 'smsCommandsMethod' => Values::array_get($payload, 'sms_commands_method'), + 'networkAccessProfileSid' => Values::array_get($payload, 'network_access_profile_sid'), + 'ipCommandsUrl' => Values::array_get($payload, 'ip_commands_url'), + 'ipCommandsMethod' => Values::array_get($payload, 'ip_commands_method'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return FleetContext Context for this FleetInstance + */ + protected function proxy(): FleetContext + { + if (!$this->context) { + $this->context = new FleetContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the FleetInstance + * + * @return FleetInstance Fetched FleetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FleetInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the FleetInstance + * + * @param array|Options $options Optional Arguments + * @return FleetInstance Updated FleetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): FleetInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Supersim.V1.FleetInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Supersim/V1/FleetList.php b/app/api/Twilio/Rest/Supersim/V1/FleetList.php new file mode 100755 index 0000000..ebb67d7 --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/FleetList.php @@ -0,0 +1,213 @@ +solution = [ + ]; + + $this->uri = '/Fleets'; + } + + /** + * Create the FleetInstance + * + * @param string $networkAccessProfile The SID or unique name of the Network Access Profile that will control which cellular networks the Fleet's SIMs can connect to. + * @param array|Options $options Optional Arguments + * @return FleetInstance Created FleetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $networkAccessProfile, array $options = []): FleetInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'NetworkAccessProfile' => + $networkAccessProfile, + 'UniqueName' => + $options['uniqueName'], + 'DataEnabled' => + Serialize::booleanToString($options['dataEnabled']), + 'DataLimit' => + $options['dataLimit'], + 'IpCommandsUrl' => + $options['ipCommandsUrl'], + 'IpCommandsMethod' => + $options['ipCommandsMethod'], + 'SmsCommandsEnabled' => + Serialize::booleanToString($options['smsCommandsEnabled']), + 'SmsCommandsUrl' => + $options['smsCommandsUrl'], + 'SmsCommandsMethod' => + $options['smsCommandsMethod'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new FleetInstance( + $this->version, + $payload + ); + } + + + /** + * Reads FleetInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return FleetInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams FleetInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of FleetInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return FleetPage Page of FleetInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): FleetPage + { + $options = new Values($options); + + $params = Values::of([ + 'NetworkAccessProfile' => + $options['networkAccessProfile'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new FleetPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of FleetInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return FleetPage Page of FleetInstance + */ + public function getPage(string $targetUrl): FleetPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new FleetPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a FleetContext + * + * @param string $sid The SID of the Fleet resource to fetch. + */ + public function getContext( + string $sid + + ): FleetContext + { + return new FleetContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.FleetList]'; + } +} diff --git a/app/api/Twilio/Rest/Supersim/V1/FleetOptions.php b/app/api/Twilio/Rest/Supersim/V1/FleetOptions.php new file mode 100755 index 0000000..7f9ccf8 --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/FleetOptions.php @@ -0,0 +1,416 @@ +options['uniqueName'] = $uniqueName; + $this->options['dataEnabled'] = $dataEnabled; + $this->options['dataLimit'] = $dataLimit; + $this->options['ipCommandsUrl'] = $ipCommandsUrl; + $this->options['ipCommandsMethod'] = $ipCommandsMethod; + $this->options['smsCommandsEnabled'] = $smsCommandsEnabled; + $this->options['smsCommandsUrl'] = $smsCommandsUrl; + $this->options['smsCommandsMethod'] = $smsCommandsMethod; + } + + /** + * An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * Defines whether SIMs in the Fleet are capable of using 2G/3G/4G/LTE/CAT-M data connectivity. Defaults to `true`. + * + * @param bool $dataEnabled Defines whether SIMs in the Fleet are capable of using 2G/3G/4G/LTE/CAT-M data connectivity. Defaults to `true`. + * @return $this Fluent Builder + */ + public function setDataEnabled(bool $dataEnabled): self + { + $this->options['dataEnabled'] = $dataEnabled; + return $this; + } + + /** + * The total data usage (download and upload combined) in Megabytes that each Super SIM assigned to the Fleet can consume during a billing period (normally one month). Value must be between 1MB (1) and 2TB (2,000,000). Defaults to 1GB (1,000). + * + * @param int $dataLimit The total data usage (download and upload combined) in Megabytes that each Super SIM assigned to the Fleet can consume during a billing period (normally one month). Value must be between 1MB (1) and 2TB (2,000,000). Defaults to 1GB (1,000). + * @return $this Fluent Builder + */ + public function setDataLimit(int $dataLimit): self + { + $this->options['dataLimit'] = $dataLimit; + return $this; + } + + /** + * The URL that will receive a webhook when a Super SIM in the Fleet is used to send an IP Command from your device to a special IP address. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. + * + * @param string $ipCommandsUrl The URL that will receive a webhook when a Super SIM in the Fleet is used to send an IP Command from your device to a special IP address. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. + * @return $this Fluent Builder + */ + public function setIpCommandsUrl(string $ipCommandsUrl): self + { + $this->options['ipCommandsUrl'] = $ipCommandsUrl; + return $this; + } + + /** + * A string representing the HTTP method to use when making a request to `ip_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. + * + * @param string $ipCommandsMethod A string representing the HTTP method to use when making a request to `ip_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. + * @return $this Fluent Builder + */ + public function setIpCommandsMethod(string $ipCommandsMethod): self + { + $this->options['ipCommandsMethod'] = $ipCommandsMethod; + return $this; + } + + /** + * Defines whether SIMs in the Fleet are capable of sending and receiving machine-to-machine SMS via Commands. Defaults to `true`. + * + * @param bool $smsCommandsEnabled Defines whether SIMs in the Fleet are capable of sending and receiving machine-to-machine SMS via Commands. Defaults to `true`. + * @return $this Fluent Builder + */ + public function setSmsCommandsEnabled(bool $smsCommandsEnabled): self + { + $this->options['smsCommandsEnabled'] = $smsCommandsEnabled; + return $this; + } + + /** + * The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the SMS Commands number. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. + * + * @param string $smsCommandsUrl The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the SMS Commands number. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. + * @return $this Fluent Builder + */ + public function setSmsCommandsUrl(string $smsCommandsUrl): self + { + $this->options['smsCommandsUrl'] = $smsCommandsUrl; + return $this; + } + + /** + * A string representing the HTTP method to use when making a request to `sms_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. + * + * @param string $smsCommandsMethod A string representing the HTTP method to use when making a request to `sms_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. + * @return $this Fluent Builder + */ + public function setSmsCommandsMethod(string $smsCommandsMethod): self + { + $this->options['smsCommandsMethod'] = $smsCommandsMethod; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Supersim.V1.CreateFleetOptions ' . $options . ']'; + } +} + + +class ReadFleetOptions extends Options + { + /** + * @param string $networkAccessProfile The SID or unique name of the Network Access Profile that controls which cellular networks the Fleet's SIMs can connect to. + */ + public function __construct( + + string $networkAccessProfile = Values::NONE + + ) { + $this->options['networkAccessProfile'] = $networkAccessProfile; + } + + /** + * The SID or unique name of the Network Access Profile that controls which cellular networks the Fleet's SIMs can connect to. + * + * @param string $networkAccessProfile The SID or unique name of the Network Access Profile that controls which cellular networks the Fleet's SIMs can connect to. + * @return $this Fluent Builder + */ + public function setNetworkAccessProfile(string $networkAccessProfile): self + { + $this->options['networkAccessProfile'] = $networkAccessProfile; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Supersim.V1.ReadFleetOptions ' . $options . ']'; + } +} + +class UpdateFleetOptions extends Options + { + /** + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. + * @param string $networkAccessProfile The SID or unique name of the Network Access Profile that will control which cellular networks the Fleet's SIMs can connect to. + * @param string $ipCommandsUrl The URL that will receive a webhook when a Super SIM in the Fleet is used to send an IP Command from your device to a special IP address. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. + * @param string $ipCommandsMethod A string representing the HTTP method to use when making a request to `ip_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. + * @param string $smsCommandsUrl The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the SMS Commands number. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. + * @param string $smsCommandsMethod A string representing the HTTP method to use when making a request to `sms_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. + * @param int $dataLimit The total data usage (download and upload combined) in Megabytes that each Super SIM assigned to the Fleet can consume during a billing period (normally one month). Value must be between 1MB (1) and 2TB (2,000,000). Defaults to 1GB (1,000). + */ + public function __construct( + + string $uniqueName = Values::NONE, + string $networkAccessProfile = Values::NONE, + string $ipCommandsUrl = Values::NONE, + string $ipCommandsMethod = Values::NONE, + string $smsCommandsUrl = Values::NONE, + string $smsCommandsMethod = Values::NONE, + int $dataLimit = Values::INT_NONE + + ) { + $this->options['uniqueName'] = $uniqueName; + $this->options['networkAccessProfile'] = $networkAccessProfile; + $this->options['ipCommandsUrl'] = $ipCommandsUrl; + $this->options['ipCommandsMethod'] = $ipCommandsMethod; + $this->options['smsCommandsUrl'] = $smsCommandsUrl; + $this->options['smsCommandsMethod'] = $smsCommandsMethod; + $this->options['dataLimit'] = $dataLimit; + } + + /** + * An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * The SID or unique name of the Network Access Profile that will control which cellular networks the Fleet's SIMs can connect to. + * + * @param string $networkAccessProfile The SID or unique name of the Network Access Profile that will control which cellular networks the Fleet's SIMs can connect to. + * @return $this Fluent Builder + */ + public function setNetworkAccessProfile(string $networkAccessProfile): self + { + $this->options['networkAccessProfile'] = $networkAccessProfile; + return $this; + } + + /** + * The URL that will receive a webhook when a Super SIM in the Fleet is used to send an IP Command from your device to a special IP address. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. + * + * @param string $ipCommandsUrl The URL that will receive a webhook when a Super SIM in the Fleet is used to send an IP Command from your device to a special IP address. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. + * @return $this Fluent Builder + */ + public function setIpCommandsUrl(string $ipCommandsUrl): self + { + $this->options['ipCommandsUrl'] = $ipCommandsUrl; + return $this; + } + + /** + * A string representing the HTTP method to use when making a request to `ip_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. + * + * @param string $ipCommandsMethod A string representing the HTTP method to use when making a request to `ip_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. + * @return $this Fluent Builder + */ + public function setIpCommandsMethod(string $ipCommandsMethod): self + { + $this->options['ipCommandsMethod'] = $ipCommandsMethod; + return $this; + } + + /** + * The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the SMS Commands number. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. + * + * @param string $smsCommandsUrl The URL that will receive a webhook when a Super SIM in the Fleet is used to send an SMS from your device to the SMS Commands number. Your server should respond with an HTTP status code in the 200 range; any response body will be ignored. + * @return $this Fluent Builder + */ + public function setSmsCommandsUrl(string $smsCommandsUrl): self + { + $this->options['smsCommandsUrl'] = $smsCommandsUrl; + return $this; + } + + /** + * A string representing the HTTP method to use when making a request to `sms_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. + * + * @param string $smsCommandsMethod A string representing the HTTP method to use when making a request to `sms_commands_url`. Can be one of `POST` or `GET`. Defaults to `POST`. + * @return $this Fluent Builder + */ + public function setSmsCommandsMethod(string $smsCommandsMethod): self + { + $this->options['smsCommandsMethod'] = $smsCommandsMethod; + return $this; + } + + /** + * The total data usage (download and upload combined) in Megabytes that each Super SIM assigned to the Fleet can consume during a billing period (normally one month). Value must be between 1MB (1) and 2TB (2,000,000). Defaults to 1GB (1,000). + * + * @param int $dataLimit The total data usage (download and upload combined) in Megabytes that each Super SIM assigned to the Fleet can consume during a billing period (normally one month). Value must be between 1MB (1) and 2TB (2,000,000). Defaults to 1GB (1,000). + * @return $this Fluent Builder + */ + public function setDataLimit(int $dataLimit): self + { + $this->options['dataLimit'] = $dataLimit; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Supersim.V1.UpdateFleetOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Supersim/V1/FleetPage.php b/app/api/Twilio/Rest/Supersim/V1/FleetPage.php new file mode 100755 index 0000000..81b77b7 --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/FleetPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return FleetInstance \Twilio\Rest\Supersim\V1\FleetInstance + */ + public function buildInstance(array $payload): FleetInstance + { + return new FleetInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.FleetPage]'; + } +} diff --git a/app/api/Twilio/Rest/Supersim/V1/IpCommandContext.php b/app/api/Twilio/Rest/Supersim/V1/IpCommandContext.php new file mode 100755 index 0000000..6a12a35 --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/IpCommandContext.php @@ -0,0 +1,81 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/IpCommands/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the IpCommandInstance + * + * @return IpCommandInstance Fetched IpCommandInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): IpCommandInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new IpCommandInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Supersim.V1.IpCommandContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Supersim/V1/IpCommandInstance.php b/app/api/Twilio/Rest/Supersim/V1/IpCommandInstance.php new file mode 100755 index 0000000..08d61c0 --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/IpCommandInstance.php @@ -0,0 +1,140 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'simSid' => Values::array_get($payload, 'sim_sid'), + 'simIccid' => Values::array_get($payload, 'sim_iccid'), + 'status' => Values::array_get($payload, 'status'), + 'direction' => Values::array_get($payload, 'direction'), + 'deviceIp' => Values::array_get($payload, 'device_ip'), + 'devicePort' => Values::array_get($payload, 'device_port'), + 'payloadType' => Values::array_get($payload, 'payload_type'), + 'payload' => Values::array_get($payload, 'payload'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return IpCommandContext Context for this IpCommandInstance + */ + protected function proxy(): IpCommandContext + { + if (!$this->context) { + $this->context = new IpCommandContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the IpCommandInstance + * + * @return IpCommandInstance Fetched IpCommandInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): IpCommandInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Supersim.V1.IpCommandInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Supersim/V1/IpCommandList.php b/app/api/Twilio/Rest/Supersim/V1/IpCommandList.php new file mode 100755 index 0000000..c371e75 --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/IpCommandList.php @@ -0,0 +1,214 @@ +solution = [ + ]; + + $this->uri = '/IpCommands'; + } + + /** + * Create the IpCommandInstance + * + * @param string $sim The `sid` or `unique_name` of the [Super SIM](https://www.twilio.com/docs/iot/supersim/api/sim-resource) to send the IP Command to. + * @param string $payload The data that will be sent to the device. The payload cannot exceed 1300 bytes. If the PayloadType is set to text, the payload is encoded in UTF-8. If PayloadType is set to binary, the payload is encoded in Base64. + * @param int $devicePort The device port to which the IP Command will be sent. + * @param array|Options $options Optional Arguments + * @return IpCommandInstance Created IpCommandInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $sim, string $payload, int $devicePort, array $options = []): IpCommandInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Sim' => + $sim, + 'Payload' => + $payload, + 'DevicePort' => + $devicePort, + 'PayloadType' => + $options['payloadType'], + 'CallbackUrl' => + $options['callbackUrl'], + 'CallbackMethod' => + $options['callbackMethod'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new IpCommandInstance( + $this->version, + $payload + ); + } + + + /** + * Reads IpCommandInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return IpCommandInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams IpCommandInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of IpCommandInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return IpCommandPage Page of IpCommandInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): IpCommandPage + { + $options = new Values($options); + + $params = Values::of([ + 'Sim' => + $options['sim'], + 'SimIccid' => + $options['simIccid'], + 'Status' => + $options['status'], + 'Direction' => + $options['direction'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new IpCommandPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of IpCommandInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return IpCommandPage Page of IpCommandInstance + */ + public function getPage(string $targetUrl): IpCommandPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new IpCommandPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a IpCommandContext + * + * @param string $sid The SID of the IP Command resource to fetch. + */ + public function getContext( + string $sid + + ): IpCommandContext + { + return new IpCommandContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.IpCommandList]'; + } +} diff --git a/app/api/Twilio/Rest/Supersim/V1/IpCommandOptions.php b/app/api/Twilio/Rest/Supersim/V1/IpCommandOptions.php new file mode 100755 index 0000000..900da96 --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/IpCommandOptions.php @@ -0,0 +1,218 @@ +options['payloadType'] = $payloadType; + $this->options['callbackUrl'] = $callbackUrl; + $this->options['callbackMethod'] = $callbackMethod; + } + + /** + * @param string $payloadType + * @return $this Fluent Builder + */ + public function setPayloadType(string $payloadType): self + { + $this->options['payloadType'] = $payloadType; + return $this; + } + + /** + * The URL we should call using the `callback_method` after we have sent the IP Command. + * + * @param string $callbackUrl The URL we should call using the `callback_method` after we have sent the IP Command. + * @return $this Fluent Builder + */ + public function setCallbackUrl(string $callbackUrl): self + { + $this->options['callbackUrl'] = $callbackUrl; + return $this; + } + + /** + * The HTTP method we should use to call `callback_url`. Can be `GET` or `POST`, and the default is `POST`. + * + * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be `GET` or `POST`, and the default is `POST`. + * @return $this Fluent Builder + */ + public function setCallbackMethod(string $callbackMethod): self + { + $this->options['callbackMethod'] = $callbackMethod; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Supersim.V1.CreateIpCommandOptions ' . $options . ']'; + } +} + + +class ReadIpCommandOptions extends Options + { + /** + * @param string $sim The SID or unique name of the Sim resource that IP Command was sent to or from. + * @param string $simIccid The ICCID of the Sim resource that IP Command was sent to or from. + * @param string $status The status of the IP Command. Can be: `queued`, `sent`, `received` or `failed`. See the [IP Command Status Values](https://www.twilio.com/docs/wireless/api/ipcommand-resource#status-values) for a description of each. + * @param string $direction The direction of the IP Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`. + */ + public function __construct( + + string $sim = Values::NONE, + string $simIccid = Values::NONE, + string $status = Values::NONE, + string $direction = Values::NONE + + ) { + $this->options['sim'] = $sim; + $this->options['simIccid'] = $simIccid; + $this->options['status'] = $status; + $this->options['direction'] = $direction; + } + + /** + * The SID or unique name of the Sim resource that IP Command was sent to or from. + * + * @param string $sim The SID or unique name of the Sim resource that IP Command was sent to or from. + * @return $this Fluent Builder + */ + public function setSim(string $sim): self + { + $this->options['sim'] = $sim; + return $this; + } + + /** + * The ICCID of the Sim resource that IP Command was sent to or from. + * + * @param string $simIccid The ICCID of the Sim resource that IP Command was sent to or from. + * @return $this Fluent Builder + */ + public function setSimIccid(string $simIccid): self + { + $this->options['simIccid'] = $simIccid; + return $this; + } + + /** + * The status of the IP Command. Can be: `queued`, `sent`, `received` or `failed`. See the [IP Command Status Values](https://www.twilio.com/docs/wireless/api/ipcommand-resource#status-values) for a description of each. + * + * @param string $status The status of the IP Command. Can be: `queued`, `sent`, `received` or `failed`. See the [IP Command Status Values](https://www.twilio.com/docs/wireless/api/ipcommand-resource#status-values) for a description of each. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * The direction of the IP Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`. + * + * @param string $direction The direction of the IP Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`. + * @return $this Fluent Builder + */ + public function setDirection(string $direction): self + { + $this->options['direction'] = $direction; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Supersim.V1.ReadIpCommandOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Supersim/V1/IpCommandPage.php b/app/api/Twilio/Rest/Supersim/V1/IpCommandPage.php new file mode 100755 index 0000000..79d5b1f --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/IpCommandPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return IpCommandInstance \Twilio\Rest\Supersim\V1\IpCommandInstance + */ + public function buildInstance(array $payload): IpCommandInstance + { + return new IpCommandInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.IpCommandPage]'; + } +} diff --git a/app/api/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkContext.php b/app/api/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkContext.php new file mode 100755 index 0000000..0c69fb6 --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkContext.php @@ -0,0 +1,100 @@ +solution = [ + 'networkAccessProfileSid' => + $networkAccessProfileSid, + 'sid' => + $sid, + ]; + + $this->uri = '/NetworkAccessProfiles/' . \rawurlencode($networkAccessProfileSid) + .'/Networks/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the NetworkAccessProfileNetworkInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the NetworkAccessProfileNetworkInstance + * + * @return NetworkAccessProfileNetworkInstance Fetched NetworkAccessProfileNetworkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): NetworkAccessProfileNetworkInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new NetworkAccessProfileNetworkInstance( + $this->version, + $payload, + $this->solution['networkAccessProfileSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Supersim.V1.NetworkAccessProfileNetworkContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkInstance.php b/app/api/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkInstance.php new file mode 100755 index 0000000..d19ca8e --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkInstance.php @@ -0,0 +1,139 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'networkAccessProfileSid' => Values::array_get($payload, 'network_access_profile_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'isoCountry' => Values::array_get($payload, 'iso_country'), + 'identifiers' => Values::array_get($payload, 'identifiers'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['networkAccessProfileSid' => $networkAccessProfileSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return NetworkAccessProfileNetworkContext Context for this NetworkAccessProfileNetworkInstance + */ + protected function proxy(): NetworkAccessProfileNetworkContext + { + if (!$this->context) { + $this->context = new NetworkAccessProfileNetworkContext( + $this->version, + $this->solution['networkAccessProfileSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the NetworkAccessProfileNetworkInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the NetworkAccessProfileNetworkInstance + * + * @return NetworkAccessProfileNetworkInstance Fetched NetworkAccessProfileNetworkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): NetworkAccessProfileNetworkInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Supersim.V1.NetworkAccessProfileNetworkInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkList.php b/app/api/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkList.php new file mode 100755 index 0000000..4ab3d9d --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkList.php @@ -0,0 +1,194 @@ +solution = [ + 'networkAccessProfileSid' => + $networkAccessProfileSid, + + ]; + + $this->uri = '/NetworkAccessProfiles/' . \rawurlencode($networkAccessProfileSid) + .'/Networks'; + } + + /** + * Create the NetworkAccessProfileNetworkInstance + * + * @param string $network The SID of the Network resource to be added to the Network Access Profile resource. + * @return NetworkAccessProfileNetworkInstance Created NetworkAccessProfileNetworkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $network): NetworkAccessProfileNetworkInstance + { + + $data = Values::of([ + 'Network' => + $network, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new NetworkAccessProfileNetworkInstance( + $this->version, + $payload, + $this->solution['networkAccessProfileSid'] + ); + } + + + /** + * Reads NetworkAccessProfileNetworkInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return NetworkAccessProfileNetworkInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams NetworkAccessProfileNetworkInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of NetworkAccessProfileNetworkInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return NetworkAccessProfileNetworkPage Page of NetworkAccessProfileNetworkInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): NetworkAccessProfileNetworkPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new NetworkAccessProfileNetworkPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of NetworkAccessProfileNetworkInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return NetworkAccessProfileNetworkPage Page of NetworkAccessProfileNetworkInstance + */ + public function getPage(string $targetUrl): NetworkAccessProfileNetworkPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new NetworkAccessProfileNetworkPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a NetworkAccessProfileNetworkContext + * + * @param string $sid The SID of the Network resource to be removed from the Network Access Profile resource. + */ + public function getContext( + string $sid + + ): NetworkAccessProfileNetworkContext + { + return new NetworkAccessProfileNetworkContext( + $this->version, + $this->solution['networkAccessProfileSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.NetworkAccessProfileNetworkList]'; + } +} diff --git a/app/api/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkPage.php b/app/api/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkPage.php new file mode 100755 index 0000000..1e1e8fd --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/NetworkAccessProfile/NetworkAccessProfileNetworkPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return NetworkAccessProfileNetworkInstance \Twilio\Rest\Supersim\V1\NetworkAccessProfile\NetworkAccessProfileNetworkInstance + */ + public function buildInstance(array $payload): NetworkAccessProfileNetworkInstance + { + return new NetworkAccessProfileNetworkInstance($this->version, $payload, $this->solution['networkAccessProfileSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.NetworkAccessProfileNetworkPage]'; + } +} diff --git a/app/api/Twilio/Rest/Supersim/V1/NetworkAccessProfileContext.php b/app/api/Twilio/Rest/Supersim/V1/NetworkAccessProfileContext.php new file mode 100755 index 0000000..e27298b --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/NetworkAccessProfileContext.php @@ -0,0 +1,168 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/NetworkAccessProfiles/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the NetworkAccessProfileInstance + * + * @return NetworkAccessProfileInstance Fetched NetworkAccessProfileInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): NetworkAccessProfileInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new NetworkAccessProfileInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the NetworkAccessProfileInstance + * + * @param array|Options $options Optional Arguments + * @return NetworkAccessProfileInstance Updated NetworkAccessProfileInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): NetworkAccessProfileInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new NetworkAccessProfileInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the networks + */ + protected function getNetworks(): NetworkAccessProfileNetworkList + { + if (!$this->_networks) { + $this->_networks = new NetworkAccessProfileNetworkList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_networks; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Supersim.V1.NetworkAccessProfileContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Supersim/V1/NetworkAccessProfileInstance.php b/app/api/Twilio/Rest/Supersim/V1/NetworkAccessProfileInstance.php new file mode 100755 index 0000000..e94a7cf --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/NetworkAccessProfileInstance.php @@ -0,0 +1,153 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return NetworkAccessProfileContext Context for this NetworkAccessProfileInstance + */ + protected function proxy(): NetworkAccessProfileContext + { + if (!$this->context) { + $this->context = new NetworkAccessProfileContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the NetworkAccessProfileInstance + * + * @return NetworkAccessProfileInstance Fetched NetworkAccessProfileInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): NetworkAccessProfileInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the NetworkAccessProfileInstance + * + * @param array|Options $options Optional Arguments + * @return NetworkAccessProfileInstance Updated NetworkAccessProfileInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): NetworkAccessProfileInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the networks + */ + protected function getNetworks(): NetworkAccessProfileNetworkList + { + return $this->proxy()->networks; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Supersim.V1.NetworkAccessProfileInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Supersim/V1/NetworkAccessProfileList.php b/app/api/Twilio/Rest/Supersim/V1/NetworkAccessProfileList.php new file mode 100755 index 0000000..daf1ead --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/NetworkAccessProfileList.php @@ -0,0 +1,192 @@ +solution = [ + ]; + + $this->uri = '/NetworkAccessProfiles'; + } + + /** + * Create the NetworkAccessProfileInstance + * + * @param array|Options $options Optional Arguments + * @return NetworkAccessProfileInstance Created NetworkAccessProfileInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): NetworkAccessProfileInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + 'Networks' => + Serialize::map($options['networks'], function ($e) { return $e; }), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new NetworkAccessProfileInstance( + $this->version, + $payload + ); + } + + + /** + * Reads NetworkAccessProfileInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return NetworkAccessProfileInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams NetworkAccessProfileInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of NetworkAccessProfileInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return NetworkAccessProfilePage Page of NetworkAccessProfileInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): NetworkAccessProfilePage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new NetworkAccessProfilePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of NetworkAccessProfileInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return NetworkAccessProfilePage Page of NetworkAccessProfileInstance + */ + public function getPage(string $targetUrl): NetworkAccessProfilePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new NetworkAccessProfilePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a NetworkAccessProfileContext + * + * @param string $sid The SID of the Network Access Profile resource to fetch. + */ + public function getContext( + string $sid + + ): NetworkAccessProfileContext + { + return new NetworkAccessProfileContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.NetworkAccessProfileList]'; + } +} diff --git a/app/api/Twilio/Rest/Supersim/V1/NetworkAccessProfileOptions.php b/app/api/Twilio/Rest/Supersim/V1/NetworkAccessProfileOptions.php new file mode 100755 index 0000000..ff73c3c --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/NetworkAccessProfileOptions.php @@ -0,0 +1,150 @@ +options['uniqueName'] = $uniqueName; + $this->options['networks'] = $networks; + } + + /** + * An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * List of Network SIDs that this Network Access Profile will allow connections to. + * + * @param string[] $networks List of Network SIDs that this Network Access Profile will allow connections to. + * @return $this Fluent Builder + */ + public function setNetworks(array $networks): self + { + $this->options['networks'] = $networks; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Supersim.V1.CreateNetworkAccessProfileOptions ' . $options . ']'; + } +} + + + +class UpdateNetworkAccessProfileOptions extends Options + { + /** + * @param string $uniqueName The new unique name of the Network Access Profile. + */ + public function __construct( + + string $uniqueName = Values::NONE + + ) { + $this->options['uniqueName'] = $uniqueName; + } + + /** + * The new unique name of the Network Access Profile. + * + * @param string $uniqueName The new unique name of the Network Access Profile. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Supersim.V1.UpdateNetworkAccessProfileOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Supersim/V1/NetworkAccessProfilePage.php b/app/api/Twilio/Rest/Supersim/V1/NetworkAccessProfilePage.php new file mode 100755 index 0000000..11358a9 --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/NetworkAccessProfilePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return NetworkAccessProfileInstance \Twilio\Rest\Supersim\V1\NetworkAccessProfileInstance + */ + public function buildInstance(array $payload): NetworkAccessProfileInstance + { + return new NetworkAccessProfileInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.NetworkAccessProfilePage]'; + } +} diff --git a/app/api/Twilio/Rest/Supersim/V1/NetworkContext.php b/app/api/Twilio/Rest/Supersim/V1/NetworkContext.php new file mode 100755 index 0000000..1632421 --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/NetworkContext.php @@ -0,0 +1,81 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Networks/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the NetworkInstance + * + * @return NetworkInstance Fetched NetworkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): NetworkInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new NetworkInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Supersim.V1.NetworkContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Supersim/V1/NetworkInstance.php b/app/api/Twilio/Rest/Supersim/V1/NetworkInstance.php new file mode 100755 index 0000000..874c2bd --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/NetworkInstance.php @@ -0,0 +1,123 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'url' => Values::array_get($payload, 'url'), + 'isoCountry' => Values::array_get($payload, 'iso_country'), + 'identifiers' => Values::array_get($payload, 'identifiers'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return NetworkContext Context for this NetworkInstance + */ + protected function proxy(): NetworkContext + { + if (!$this->context) { + $this->context = new NetworkContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the NetworkInstance + * + * @return NetworkInstance Fetched NetworkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): NetworkInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Supersim.V1.NetworkInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Supersim/V1/NetworkList.php b/app/api/Twilio/Rest/Supersim/V1/NetworkList.php new file mode 100755 index 0000000..bc1674f --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/NetworkList.php @@ -0,0 +1,172 @@ +solution = [ + ]; + + $this->uri = '/Networks'; + } + + /** + * Reads NetworkInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return NetworkInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams NetworkInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of NetworkInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return NetworkPage Page of NetworkInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): NetworkPage + { + $options = new Values($options); + + $params = Values::of([ + 'IsoCountry' => + $options['isoCountry'], + 'Mcc' => + $options['mcc'], + 'Mnc' => + $options['mnc'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new NetworkPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of NetworkInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return NetworkPage Page of NetworkInstance + */ + public function getPage(string $targetUrl): NetworkPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new NetworkPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a NetworkContext + * + * @param string $sid The SID of the Network resource to fetch. + */ + public function getContext( + string $sid + + ): NetworkContext + { + return new NetworkContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.NetworkList]'; + } +} diff --git a/app/api/Twilio/Rest/Supersim/V1/NetworkOptions.php b/app/api/Twilio/Rest/Supersim/V1/NetworkOptions.php new file mode 100755 index 0000000..d6d6b07 --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/NetworkOptions.php @@ -0,0 +1,114 @@ +options['isoCountry'] = $isoCountry; + $this->options['mcc'] = $mcc; + $this->options['mnc'] = $mnc; + } + + /** + * The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Network resources to read. + * + * @param string $isoCountry The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the Network resources to read. + * @return $this Fluent Builder + */ + public function setIsoCountry(string $isoCountry): self + { + $this->options['isoCountry'] = $isoCountry; + return $this; + } + + /** + * The 'mobile country code' of a country. Network resources with this `mcc` in their `identifiers` will be read. + * + * @param string $mcc The 'mobile country code' of a country. Network resources with this `mcc` in their `identifiers` will be read. + * @return $this Fluent Builder + */ + public function setMcc(string $mcc): self + { + $this->options['mcc'] = $mcc; + return $this; + } + + /** + * The 'mobile network code' of a mobile operator network. Network resources with this `mnc` in their `identifiers` will be read. + * + * @param string $mnc The 'mobile network code' of a mobile operator network. Network resources with this `mnc` in their `identifiers` will be read. + * @return $this Fluent Builder + */ + public function setMnc(string $mnc): self + { + $this->options['mnc'] = $mnc; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Supersim.V1.ReadNetworkOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Supersim/V1/NetworkPage.php b/app/api/Twilio/Rest/Supersim/V1/NetworkPage.php new file mode 100755 index 0000000..31ab76f --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/NetworkPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return NetworkInstance \Twilio\Rest\Supersim\V1\NetworkInstance + */ + public function buildInstance(array $payload): NetworkInstance + { + return new NetworkInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.NetworkPage]'; + } +} diff --git a/app/api/Twilio/Rest/Supersim/V1/SettingsUpdateInstance.php b/app/api/Twilio/Rest/Supersim/V1/SettingsUpdateInstance.php new file mode 100755 index 0000000..b36ce32 --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/SettingsUpdateInstance.php @@ -0,0 +1,95 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'iccid' => Values::array_get($payload, 'iccid'), + 'simSid' => Values::array_get($payload, 'sim_sid'), + 'status' => Values::array_get($payload, 'status'), + 'packages' => Values::array_get($payload, 'packages'), + 'dateCompleted' => Deserialize::dateTime(Values::array_get($payload, 'date_completed')), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.SettingsUpdateInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Supersim/V1/SettingsUpdateList.php b/app/api/Twilio/Rest/Supersim/V1/SettingsUpdateList.php new file mode 100755 index 0000000..754e841 --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/SettingsUpdateList.php @@ -0,0 +1,154 @@ +solution = [ + ]; + + $this->uri = '/SettingsUpdates'; + } + + /** + * Reads SettingsUpdateInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return SettingsUpdateInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams SettingsUpdateInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SettingsUpdateInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return SettingsUpdatePage Page of SettingsUpdateInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SettingsUpdatePage + { + $options = new Values($options); + + $params = Values::of([ + 'Sim' => + $options['sim'], + 'Status' => + $options['status'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SettingsUpdatePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SettingsUpdateInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SettingsUpdatePage Page of SettingsUpdateInstance + */ + public function getPage(string $targetUrl): SettingsUpdatePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SettingsUpdatePage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.SettingsUpdateList]'; + } +} diff --git a/app/api/Twilio/Rest/Supersim/V1/SettingsUpdateOptions.php b/app/api/Twilio/Rest/Supersim/V1/SettingsUpdateOptions.php new file mode 100755 index 0000000..facde9f --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/SettingsUpdateOptions.php @@ -0,0 +1,94 @@ +options['sim'] = $sim; + $this->options['status'] = $status; + } + + /** + * Filter the Settings Updates by a Super SIM's SID or UniqueName. + * + * @param string $sim Filter the Settings Updates by a Super SIM's SID or UniqueName. + * @return $this Fluent Builder + */ + public function setSim(string $sim): self + { + $this->options['sim'] = $sim; + return $this; + } + + /** + * Filter the Settings Updates by status. Can be `scheduled`, `in-progress`, `successful`, or `failed`. + * + * @param string $status Filter the Settings Updates by status. Can be `scheduled`, `in-progress`, `successful`, or `failed`. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Supersim.V1.ReadSettingsUpdateOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Supersim/V1/SettingsUpdatePage.php b/app/api/Twilio/Rest/Supersim/V1/SettingsUpdatePage.php new file mode 100755 index 0000000..ba870e6 --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/SettingsUpdatePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SettingsUpdateInstance \Twilio\Rest\Supersim\V1\SettingsUpdateInstance + */ + public function buildInstance(array $payload): SettingsUpdateInstance + { + return new SettingsUpdateInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.SettingsUpdatePage]'; + } +} diff --git a/app/api/Twilio/Rest/Supersim/V1/Sim/BillingPeriodInstance.php b/app/api/Twilio/Rest/Supersim/V1/Sim/BillingPeriodInstance.php new file mode 100755 index 0000000..a0acb1d --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/Sim/BillingPeriodInstance.php @@ -0,0 +1,96 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'simSid' => Values::array_get($payload, 'sim_sid'), + 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), + 'endTime' => Deserialize::dateTime(Values::array_get($payload, 'end_time')), + 'periodType' => Values::array_get($payload, 'period_type'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + ]; + + $this->solution = ['simSid' => $simSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.BillingPeriodInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Supersim/V1/Sim/BillingPeriodList.php b/app/api/Twilio/Rest/Supersim/V1/Sim/BillingPeriodList.php new file mode 100755 index 0000000..b010f86 --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/Sim/BillingPeriodList.php @@ -0,0 +1,151 @@ +solution = [ + 'simSid' => + $simSid, + + ]; + + $this->uri = '/Sims/' . \rawurlencode($simSid) + .'/BillingPeriods'; + } + + /** + * Reads BillingPeriodInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return BillingPeriodInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams BillingPeriodInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of BillingPeriodInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return BillingPeriodPage Page of BillingPeriodInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): BillingPeriodPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new BillingPeriodPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of BillingPeriodInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return BillingPeriodPage Page of BillingPeriodInstance + */ + public function getPage(string $targetUrl): BillingPeriodPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new BillingPeriodPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.BillingPeriodList]'; + } +} diff --git a/app/api/Twilio/Rest/Supersim/V1/Sim/BillingPeriodPage.php b/app/api/Twilio/Rest/Supersim/V1/Sim/BillingPeriodPage.php new file mode 100755 index 0000000..556604d --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/Sim/BillingPeriodPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return BillingPeriodInstance \Twilio\Rest\Supersim\V1\Sim\BillingPeriodInstance + */ + public function buildInstance(array $payload): BillingPeriodInstance + { + return new BillingPeriodInstance($this->version, $payload, $this->solution['simSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.BillingPeriodPage]'; + } +} diff --git a/app/api/Twilio/Rest/Supersim/V1/Sim/SimIpAddressInstance.php b/app/api/Twilio/Rest/Supersim/V1/Sim/SimIpAddressInstance.php new file mode 100755 index 0000000..ffc8f91 --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/Sim/SimIpAddressInstance.php @@ -0,0 +1,83 @@ +properties = [ + 'ipAddress' => Values::array_get($payload, 'ip_address'), + 'ipAddressVersion' => Values::array_get($payload, 'ip_address_version'), + ]; + + $this->solution = ['simSid' => $simSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.SimIpAddressInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Supersim/V1/Sim/SimIpAddressList.php b/app/api/Twilio/Rest/Supersim/V1/Sim/SimIpAddressList.php new file mode 100755 index 0000000..6020815 --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/Sim/SimIpAddressList.php @@ -0,0 +1,151 @@ +solution = [ + 'simSid' => + $simSid, + + ]; + + $this->uri = '/Sims/' . \rawurlencode($simSid) + .'/IpAddresses'; + } + + /** + * Reads SimIpAddressInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return SimIpAddressInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams SimIpAddressInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SimIpAddressInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return SimIpAddressPage Page of SimIpAddressInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SimIpAddressPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SimIpAddressPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SimIpAddressInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SimIpAddressPage Page of SimIpAddressInstance + */ + public function getPage(string $targetUrl): SimIpAddressPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SimIpAddressPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.SimIpAddressList]'; + } +} diff --git a/app/api/Twilio/Rest/Supersim/V1/Sim/SimIpAddressPage.php b/app/api/Twilio/Rest/Supersim/V1/Sim/SimIpAddressPage.php new file mode 100755 index 0000000..9a48651 --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/Sim/SimIpAddressPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SimIpAddressInstance \Twilio\Rest\Supersim\V1\Sim\SimIpAddressInstance + */ + public function buildInstance(array $payload): SimIpAddressInstance + { + return new SimIpAddressInstance($this->version, $payload, $this->solution['simSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.SimIpAddressPage]'; + } +} diff --git a/app/api/Twilio/Rest/Supersim/V1/SimContext.php b/app/api/Twilio/Rest/Supersim/V1/SimContext.php new file mode 100755 index 0000000..c6d3741 --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/SimContext.php @@ -0,0 +1,195 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Sims/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the SimInstance + * + * @return SimInstance Fetched SimInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SimInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new SimInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the SimInstance + * + * @param array|Options $options Optional Arguments + * @return SimInstance Updated SimInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SimInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + 'Status' => + $options['status'], + 'Fleet' => + $options['fleet'], + 'CallbackUrl' => + $options['callbackUrl'], + 'CallbackMethod' => + $options['callbackMethod'], + 'AccountSid' => + $options['accountSid'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new SimInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the billingPeriods + */ + protected function getBillingPeriods(): BillingPeriodList + { + if (!$this->_billingPeriods) { + $this->_billingPeriods = new BillingPeriodList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_billingPeriods; + } + + /** + * Access the simIpAddresses + */ + protected function getSimIpAddresses(): SimIpAddressList + { + if (!$this->_simIpAddresses) { + $this->_simIpAddresses = new SimIpAddressList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_simIpAddresses; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Supersim.V1.SimContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Supersim/V1/SimInstance.php b/app/api/Twilio/Rest/Supersim/V1/SimInstance.php new file mode 100755 index 0000000..0c83afd --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/SimInstance.php @@ -0,0 +1,169 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'iccid' => Values::array_get($payload, 'iccid'), + 'status' => Values::array_get($payload, 'status'), + 'fleetSid' => Values::array_get($payload, 'fleet_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SimContext Context for this SimInstance + */ + protected function proxy(): SimContext + { + if (!$this->context) { + $this->context = new SimContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the SimInstance + * + * @return SimInstance Fetched SimInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SimInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SimInstance + * + * @param array|Options $options Optional Arguments + * @return SimInstance Updated SimInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SimInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the billingPeriods + */ + protected function getBillingPeriods(): BillingPeriodList + { + return $this->proxy()->billingPeriods; + } + + /** + * Access the simIpAddresses + */ + protected function getSimIpAddresses(): SimIpAddressList + { + return $this->proxy()->simIpAddresses; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Supersim.V1.SimInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Supersim/V1/SimList.php b/app/api/Twilio/Rest/Supersim/V1/SimList.php new file mode 100755 index 0000000..150114a --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/SimList.php @@ -0,0 +1,200 @@ +solution = [ + ]; + + $this->uri = '/Sims'; + } + + /** + * Create the SimInstance + * + * @param string $iccid The [ICCID](https://en.wikipedia.org/wiki/Subscriber_identity_module#ICCID) of the Super SIM to be added to your Account. + * @param string $registrationCode The 10-digit code required to claim the Super SIM for your Account. + * @return SimInstance Created SimInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $iccid, string $registrationCode): SimInstance + { + + $data = Values::of([ + 'Iccid' => + $iccid, + 'RegistrationCode' => + $registrationCode, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new SimInstance( + $this->version, + $payload + ); + } + + + /** + * Reads SimInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return SimInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams SimInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SimInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return SimPage Page of SimInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SimPage + { + $options = new Values($options); + + $params = Values::of([ + 'Status' => + $options['status'], + 'Fleet' => + $options['fleet'], + 'Iccid' => + $options['iccid'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SimPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SimInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SimPage Page of SimInstance + */ + public function getPage(string $targetUrl): SimPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SimPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SimContext + * + * @param string $sid The SID of the Sim resource to fetch. + */ + public function getContext( + string $sid + + ): SimContext + { + return new SimContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.SimList]'; + } +} diff --git a/app/api/Twilio/Rest/Supersim/V1/SimOptions.php b/app/api/Twilio/Rest/Supersim/V1/SimOptions.php new file mode 100755 index 0000000..feb14a9 --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/SimOptions.php @@ -0,0 +1,256 @@ +options['status'] = $status; + $this->options['fleet'] = $fleet; + $this->options['iccid'] = $iccid; + } + + /** + * The status of the Sim resources to read. Can be `new`, `ready`, `active`, `inactive`, or `scheduled`. + * + * @param string $status The status of the Sim resources to read. Can be `new`, `ready`, `active`, `inactive`, or `scheduled`. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * The SID or unique name of the Fleet to which a list of Sims are assigned. + * + * @param string $fleet The SID or unique name of the Fleet to which a list of Sims are assigned. + * @return $this Fluent Builder + */ + public function setFleet(string $fleet): self + { + $this->options['fleet'] = $fleet; + return $this; + } + + /** + * The [ICCID](https://en.wikipedia.org/wiki/Subscriber_identity_module#ICCID) associated with a Super SIM to filter the list by. Passing this parameter will always return a list containing zero or one SIMs. + * + * @param string $iccid The [ICCID](https://en.wikipedia.org/wiki/Subscriber_identity_module#ICCID) associated with a Super SIM to filter the list by. Passing this parameter will always return a list containing zero or one SIMs. + * @return $this Fluent Builder + */ + public function setIccid(string $iccid): self + { + $this->options['iccid'] = $iccid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Supersim.V1.ReadSimOptions ' . $options . ']'; + } +} + +class UpdateSimOptions extends Options + { + /** + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. + * @param string $status + * @param string $fleet The SID or unique name of the Fleet to which the SIM resource should be assigned. + * @param string $callbackUrl The URL we should call using the `callback_method` after an asynchronous update has finished. + * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST. + * @param string $accountSid The SID of the Account to which the Sim resource should belong. The Account SID can only be that of the requesting Account or that of a Subaccount of the requesting Account. Only valid when the Sim resource's status is new. + */ + public function __construct( + + string $uniqueName = Values::NONE, + string $status = Values::NONE, + string $fleet = Values::NONE, + string $callbackUrl = Values::NONE, + string $callbackMethod = Values::NONE, + string $accountSid = Values::NONE + + ) { + $this->options['uniqueName'] = $uniqueName; + $this->options['status'] = $status; + $this->options['fleet'] = $fleet; + $this->options['callbackUrl'] = $callbackUrl; + $this->options['callbackMethod'] = $callbackMethod; + $this->options['accountSid'] = $accountSid; + } + + /** + * An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * The SID or unique name of the Fleet to which the SIM resource should be assigned. + * + * @param string $fleet The SID or unique name of the Fleet to which the SIM resource should be assigned. + * @return $this Fluent Builder + */ + public function setFleet(string $fleet): self + { + $this->options['fleet'] = $fleet; + return $this; + } + + /** + * The URL we should call using the `callback_method` after an asynchronous update has finished. + * + * @param string $callbackUrl The URL we should call using the `callback_method` after an asynchronous update has finished. + * @return $this Fluent Builder + */ + public function setCallbackUrl(string $callbackUrl): self + { + $this->options['callbackUrl'] = $callbackUrl; + return $this; + } + + /** + * The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST. + * + * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST. + * @return $this Fluent Builder + */ + public function setCallbackMethod(string $callbackMethod): self + { + $this->options['callbackMethod'] = $callbackMethod; + return $this; + } + + /** + * The SID of the Account to which the Sim resource should belong. The Account SID can only be that of the requesting Account or that of a Subaccount of the requesting Account. Only valid when the Sim resource's status is new. + * + * @param string $accountSid The SID of the Account to which the Sim resource should belong. The Account SID can only be that of the requesting Account or that of a Subaccount of the requesting Account. Only valid when the Sim resource's status is new. + * @return $this Fluent Builder + */ + public function setAccountSid(string $accountSid): self + { + $this->options['accountSid'] = $accountSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Supersim.V1.UpdateSimOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Supersim/V1/SimPage.php b/app/api/Twilio/Rest/Supersim/V1/SimPage.php new file mode 100755 index 0000000..1fa81bf --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/SimPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SimInstance \Twilio\Rest\Supersim\V1\SimInstance + */ + public function buildInstance(array $payload): SimInstance + { + return new SimInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.SimPage]'; + } +} diff --git a/app/api/Twilio/Rest/Supersim/V1/SmsCommandContext.php b/app/api/Twilio/Rest/Supersim/V1/SmsCommandContext.php new file mode 100755 index 0000000..9792fa4 --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/SmsCommandContext.php @@ -0,0 +1,81 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/SmsCommands/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the SmsCommandInstance + * + * @return SmsCommandInstance Fetched SmsCommandInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SmsCommandInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new SmsCommandInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Supersim.V1.SmsCommandContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Supersim/V1/SmsCommandInstance.php b/app/api/Twilio/Rest/Supersim/V1/SmsCommandInstance.php new file mode 100755 index 0000000..3e0dd49 --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/SmsCommandInstance.php @@ -0,0 +1,132 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'simSid' => Values::array_get($payload, 'sim_sid'), + 'payload' => Values::array_get($payload, 'payload'), + 'status' => Values::array_get($payload, 'status'), + 'direction' => Values::array_get($payload, 'direction'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SmsCommandContext Context for this SmsCommandInstance + */ + protected function proxy(): SmsCommandContext + { + if (!$this->context) { + $this->context = new SmsCommandContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the SmsCommandInstance + * + * @return SmsCommandInstance Fetched SmsCommandInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SmsCommandInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Supersim.V1.SmsCommandInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Supersim/V1/SmsCommandList.php b/app/api/Twilio/Rest/Supersim/V1/SmsCommandList.php new file mode 100755 index 0000000..8e556e4 --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/SmsCommandList.php @@ -0,0 +1,207 @@ +solution = [ + ]; + + $this->uri = '/SmsCommands'; + } + + /** + * Create the SmsCommandInstance + * + * @param string $sim The `sid` or `unique_name` of the [SIM](https://www.twilio.com/docs/iot/supersim/api/sim-resource) to send the SMS Command to. + * @param string $payload The message body of the SMS Command. + * @param array|Options $options Optional Arguments + * @return SmsCommandInstance Created SmsCommandInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $sim, string $payload, array $options = []): SmsCommandInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Sim' => + $sim, + 'Payload' => + $payload, + 'CallbackMethod' => + $options['callbackMethod'], + 'CallbackUrl' => + $options['callbackUrl'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new SmsCommandInstance( + $this->version, + $payload + ); + } + + + /** + * Reads SmsCommandInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return SmsCommandInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams SmsCommandInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SmsCommandInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return SmsCommandPage Page of SmsCommandInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SmsCommandPage + { + $options = new Values($options); + + $params = Values::of([ + 'Sim' => + $options['sim'], + 'Status' => + $options['status'], + 'Direction' => + $options['direction'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SmsCommandPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SmsCommandInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SmsCommandPage Page of SmsCommandInstance + */ + public function getPage(string $targetUrl): SmsCommandPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SmsCommandPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SmsCommandContext + * + * @param string $sid The SID of the SMS Command resource to fetch. + */ + public function getContext( + string $sid + + ): SmsCommandContext + { + return new SmsCommandContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.SmsCommandList]'; + } +} diff --git a/app/api/Twilio/Rest/Supersim/V1/SmsCommandOptions.php b/app/api/Twilio/Rest/Supersim/V1/SmsCommandOptions.php new file mode 100755 index 0000000..6dccca5 --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/SmsCommandOptions.php @@ -0,0 +1,184 @@ +options['callbackMethod'] = $callbackMethod; + $this->options['callbackUrl'] = $callbackUrl; + } + + /** + * The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST. + * + * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `GET` or `POST` and the default is POST. + * @return $this Fluent Builder + */ + public function setCallbackMethod(string $callbackMethod): self + { + $this->options['callbackMethod'] = $callbackMethod; + return $this; + } + + /** + * The URL we should call using the `callback_method` after we have sent the command. + * + * @param string $callbackUrl The URL we should call using the `callback_method` after we have sent the command. + * @return $this Fluent Builder + */ + public function setCallbackUrl(string $callbackUrl): self + { + $this->options['callbackUrl'] = $callbackUrl; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Supersim.V1.CreateSmsCommandOptions ' . $options . ']'; + } +} + + +class ReadSmsCommandOptions extends Options + { + /** + * @param string $sim The SID or unique name of the Sim resource that SMS Command was sent to or from. + * @param string $status The status of the SMS Command. Can be: `queued`, `sent`, `delivered`, `received` or `failed`. See the [SMS Command Status Values](https://www.twilio.com/docs/iot/supersim/api/smscommand-resource#status-values) for a description of each. + * @param string $direction The direction of the SMS Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`. + */ + public function __construct( + + string $sim = Values::NONE, + string $status = Values::NONE, + string $direction = Values::NONE + + ) { + $this->options['sim'] = $sim; + $this->options['status'] = $status; + $this->options['direction'] = $direction; + } + + /** + * The SID or unique name of the Sim resource that SMS Command was sent to or from. + * + * @param string $sim The SID or unique name of the Sim resource that SMS Command was sent to or from. + * @return $this Fluent Builder + */ + public function setSim(string $sim): self + { + $this->options['sim'] = $sim; + return $this; + } + + /** + * The status of the SMS Command. Can be: `queued`, `sent`, `delivered`, `received` or `failed`. See the [SMS Command Status Values](https://www.twilio.com/docs/iot/supersim/api/smscommand-resource#status-values) for a description of each. + * + * @param string $status The status of the SMS Command. Can be: `queued`, `sent`, `delivered`, `received` or `failed`. See the [SMS Command Status Values](https://www.twilio.com/docs/iot/supersim/api/smscommand-resource#status-values) for a description of each. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * The direction of the SMS Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`. + * + * @param string $direction The direction of the SMS Command. Can be `to_sim` or `from_sim`. The value of `to_sim` is synonymous with the term `mobile terminated`, and `from_sim` is synonymous with the term `mobile originated`. + * @return $this Fluent Builder + */ + public function setDirection(string $direction): self + { + $this->options['direction'] = $direction; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Supersim.V1.ReadSmsCommandOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Supersim/V1/SmsCommandPage.php b/app/api/Twilio/Rest/Supersim/V1/SmsCommandPage.php new file mode 100755 index 0000000..ac095d8 --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/SmsCommandPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SmsCommandInstance \Twilio\Rest\Supersim\V1\SmsCommandInstance + */ + public function buildInstance(array $payload): SmsCommandInstance + { + return new SmsCommandInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.SmsCommandPage]'; + } +} diff --git a/app/api/Twilio/Rest/Supersim/V1/UsageRecordInstance.php b/app/api/Twilio/Rest/Supersim/V1/UsageRecordInstance.php new file mode 100755 index 0000000..bf72053 --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/UsageRecordInstance.php @@ -0,0 +1,100 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'simSid' => Values::array_get($payload, 'sim_sid'), + 'networkSid' => Values::array_get($payload, 'network_sid'), + 'fleetSid' => Values::array_get($payload, 'fleet_sid'), + 'isoCountry' => Values::array_get($payload, 'iso_country'), + 'period' => Values::array_get($payload, 'period'), + 'dataUpload' => Values::array_get($payload, 'data_upload'), + 'dataDownload' => Values::array_get($payload, 'data_download'), + 'dataTotal' => Values::array_get($payload, 'data_total'), + 'dataTotalBilled' => Values::array_get($payload, 'data_total_billed'), + 'billedUnit' => Values::array_get($payload, 'billed_unit'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.UsageRecordInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Supersim/V1/UsageRecordList.php b/app/api/Twilio/Rest/Supersim/V1/UsageRecordList.php new file mode 100755 index 0000000..f1c7897 --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/UsageRecordList.php @@ -0,0 +1,167 @@ +solution = [ + ]; + + $this->uri = '/UsageRecords'; + } + + /** + * Reads UsageRecordInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return UsageRecordInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams UsageRecordInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of UsageRecordInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return UsageRecordPage Page of UsageRecordInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): UsageRecordPage + { + $options = new Values($options); + + $params = Values::of([ + 'Sim' => + $options['sim'], + 'Fleet' => + $options['fleet'], + 'Network' => + $options['network'], + 'IsoCountry' => + $options['isoCountry'], + 'Group' => + $options['group'], + 'Granularity' => + $options['granularity'], + 'StartTime' => + Serialize::iso8601DateTime($options['startTime']), + 'EndTime' => + Serialize::iso8601DateTime($options['endTime']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new UsageRecordPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of UsageRecordInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return UsageRecordPage Page of UsageRecordInstance + */ + public function getPage(string $targetUrl): UsageRecordPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new UsageRecordPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.UsageRecordList]'; + } +} diff --git a/app/api/Twilio/Rest/Supersim/V1/UsageRecordOptions.php b/app/api/Twilio/Rest/Supersim/V1/UsageRecordOptions.php new file mode 100755 index 0000000..1222c5a --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/UsageRecordOptions.php @@ -0,0 +1,202 @@ +options['sim'] = $sim; + $this->options['fleet'] = $fleet; + $this->options['network'] = $network; + $this->options['isoCountry'] = $isoCountry; + $this->options['group'] = $group; + $this->options['granularity'] = $granularity; + $this->options['startTime'] = $startTime; + $this->options['endTime'] = $endTime; + } + + /** + * SID or unique name of a Sim resource. Only show UsageRecords representing usage incurred by this Super SIM. + * + * @param string $sim SID or unique name of a Sim resource. Only show UsageRecords representing usage incurred by this Super SIM. + * @return $this Fluent Builder + */ + public function setSim(string $sim): self + { + $this->options['sim'] = $sim; + return $this; + } + + /** + * SID or unique name of a Fleet resource. Only show UsageRecords representing usage for Super SIMs belonging to this Fleet resource at the time the usage occurred. + * + * @param string $fleet SID or unique name of a Fleet resource. Only show UsageRecords representing usage for Super SIMs belonging to this Fleet resource at the time the usage occurred. + * @return $this Fluent Builder + */ + public function setFleet(string $fleet): self + { + $this->options['fleet'] = $fleet; + return $this; + } + + /** + * SID of a Network resource. Only show UsageRecords representing usage on this network. + * + * @param string $network SID of a Network resource. Only show UsageRecords representing usage on this network. + * @return $this Fluent Builder + */ + public function setNetwork(string $network): self + { + $this->options['network'] = $network; + return $this; + } + + /** + * Alpha-2 ISO Country Code. Only show UsageRecords representing usage in this country. + * + * @param string $isoCountry Alpha-2 ISO Country Code. Only show UsageRecords representing usage in this country. + * @return $this Fluent Builder + */ + public function setIsoCountry(string $isoCountry): self + { + $this->options['isoCountry'] = $isoCountry; + return $this; + } + + /** + * Dimension over which to aggregate usage records. Can be: `sim`, `fleet`, `network`, `isoCountry`. Default is to not aggregate across any of these dimensions, UsageRecords will be aggregated into the time buckets described by the `Granularity` parameter. + * + * @param string $group Dimension over which to aggregate usage records. Can be: `sim`, `fleet`, `network`, `isoCountry`. Default is to not aggregate across any of these dimensions, UsageRecords will be aggregated into the time buckets described by the `Granularity` parameter. + * @return $this Fluent Builder + */ + public function setGroup(string $group): self + { + $this->options['group'] = $group; + return $this; + } + + /** + * Time-based grouping that UsageRecords should be aggregated by. Can be: `hour`, `day`, or `all`. Default is `all`. `all` returns one UsageRecord that describes the usage for the entire period. + * + * @param string $granularity Time-based grouping that UsageRecords should be aggregated by. Can be: `hour`, `day`, or `all`. Default is `all`. `all` returns one UsageRecord that describes the usage for the entire period. + * @return $this Fluent Builder + */ + public function setGranularity(string $granularity): self + { + $this->options['granularity'] = $granularity; + return $this; + } + + /** + * Only include usage that occurred at or after this time, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Default is one month before the `end_time`. + * + * @param \DateTime $startTime Only include usage that occurred at or after this time, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Default is one month before the `end_time`. + * @return $this Fluent Builder + */ + public function setStartTime(\DateTime $startTime): self + { + $this->options['startTime'] = $startTime; + return $this; + } + + /** + * Only include usage that occurred before this time (exclusive), specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Default is the current time. + * + * @param \DateTime $endTime Only include usage that occurred before this time (exclusive), specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Default is the current time. + * @return $this Fluent Builder + */ + public function setEndTime(\DateTime $endTime): self + { + $this->options['endTime'] = $endTime; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Supersim.V1.ReadUsageRecordOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Supersim/V1/UsageRecordPage.php b/app/api/Twilio/Rest/Supersim/V1/UsageRecordPage.php new file mode 100755 index 0000000..c0ebffa --- /dev/null +++ b/app/api/Twilio/Rest/Supersim/V1/UsageRecordPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UsageRecordInstance \Twilio\Rest\Supersim\V1\UsageRecordInstance + */ + public function buildInstance(array $payload): UsageRecordInstance + { + return new UsageRecordInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Supersim.V1.UsageRecordPage]'; + } +} diff --git a/app/api/Twilio/Rest/SupersimBase.php b/app/api/Twilio/Rest/SupersimBase.php new file mode 100755 index 0000000..ac9d29a --- /dev/null +++ b/app/api/Twilio/Rest/SupersimBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://supersim.twilio.com'; + } + + + /** + * @return V1 Version v1 of supersim + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Supersim]'; + } +} diff --git a/app/api/Twilio/Rest/Sync.php b/app/api/Twilio/Rest/Sync.php new file mode 100755 index 0000000..0cc1d02 --- /dev/null +++ b/app/api/Twilio/Rest/Sync.php @@ -0,0 +1,23 @@ +services instead. + */ + protected function getServices(): \Twilio\Rest\Sync\V1\ServiceList { + echo "services is deprecated. Use v1->services instead."; + return $this->v1->services; + } + + /** + * @deprecated Use v1->services(\$sid) instead. + * @param string $sid The SID of the Service resource to fetch + */ + protected function contextServices(string $sid): \Twilio\Rest\Sync\V1\ServiceContext { + echo "services(\$sid) is deprecated. Use v1->services(\$sid) instead."; + return $this->v1->services($sid); + } +} \ No newline at end of file diff --git a/app/api/Twilio/Rest/Sync/V1.php b/app/api/Twilio/Rest/Sync/V1.php new file mode 100755 index 0000000..118aab9 --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1.php @@ -0,0 +1,95 @@ +version = 'v1'; + } + + protected function getServices(): ServiceList + { + if (!$this->_services) { + $this->_services = new ServiceList($this); + } + return $this->_services; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1]'; + } +} diff --git a/app/api/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionContext.php b/app/api/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionContext.php new file mode 100755 index 0000000..c2ddbf1 --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionContext.php @@ -0,0 +1,141 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'documentSid' => + $documentSid, + 'identity' => + $identity, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Documents/' . \rawurlencode($documentSid) + .'/Permissions/' . \rawurlencode($identity) + .''; + } + + /** + * Delete the DocumentPermissionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the DocumentPermissionInstance + * + * @return DocumentPermissionInstance Fetched DocumentPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DocumentPermissionInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new DocumentPermissionInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['documentSid'], + $this->solution['identity'] + ); + } + + + /** + * Update the DocumentPermissionInstance + * + * @param bool $read Whether the identity can read the Sync Document. Default value is `false`. + * @param bool $write Whether the identity can update the Sync Document. Default value is `false`. + * @param bool $manage Whether the identity can delete the Sync Document. Default value is `false`. + * @return DocumentPermissionInstance Updated DocumentPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $read, bool $write, bool $manage): DocumentPermissionInstance + { + + $data = Values::of([ + 'Read' => + Serialize::booleanToString($read), + 'Write' => + Serialize::booleanToString($write), + 'Manage' => + Serialize::booleanToString($manage), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new DocumentPermissionInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['documentSid'], + $this->solution['identity'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.DocumentPermissionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionInstance.php b/app/api/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionInstance.php new file mode 100755 index 0000000..a23ef54 --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionInstance.php @@ -0,0 +1,160 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'documentSid' => Values::array_get($payload, 'document_sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'read' => Values::array_get($payload, 'read'), + 'write' => Values::array_get($payload, 'write'), + 'manage' => Values::array_get($payload, 'manage'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'documentSid' => $documentSid, 'identity' => $identity ?: $this->properties['identity'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return DocumentPermissionContext Context for this DocumentPermissionInstance + */ + protected function proxy(): DocumentPermissionContext + { + if (!$this->context) { + $this->context = new DocumentPermissionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['documentSid'], + $this->solution['identity'] + ); + } + + return $this->context; + } + + /** + * Delete the DocumentPermissionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the DocumentPermissionInstance + * + * @return DocumentPermissionInstance Fetched DocumentPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DocumentPermissionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the DocumentPermissionInstance + * + * @param bool $read Whether the identity can read the Sync Document. Default value is `false`. + * @param bool $write Whether the identity can update the Sync Document. Default value is `false`. + * @param bool $manage Whether the identity can delete the Sync Document. Default value is `false`. + * @return DocumentPermissionInstance Updated DocumentPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $read, bool $write, bool $manage): DocumentPermissionInstance + { + + return $this->proxy()->update($read, $write, $manage); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.DocumentPermissionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionList.php b/app/api/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionList.php new file mode 100755 index 0000000..0935be7 --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionList.php @@ -0,0 +1,175 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'documentSid' => + $documentSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Documents/' . \rawurlencode($documentSid) + .'/Permissions'; + } + + /** + * Reads DocumentPermissionInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return DocumentPermissionInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams DocumentPermissionInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of DocumentPermissionInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return DocumentPermissionPage Page of DocumentPermissionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): DocumentPermissionPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new DocumentPermissionPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of DocumentPermissionInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return DocumentPermissionPage Page of DocumentPermissionInstance + */ + public function getPage(string $targetUrl): DocumentPermissionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new DocumentPermissionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a DocumentPermissionContext + * + * @param string $identity The application-defined string that uniquely identifies the User's Document Permission resource to delete. + */ + public function getContext( + string $identity + + ): DocumentPermissionContext + { + return new DocumentPermissionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['documentSid'], + $identity + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.DocumentPermissionList]'; + } +} diff --git a/app/api/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionPage.php b/app/api/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionPage.php new file mode 100755 index 0000000..60c02d8 --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/Document/DocumentPermissionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DocumentPermissionInstance \Twilio\Rest\Sync\V1\Service\Document\DocumentPermissionInstance + */ + public function buildInstance(array $payload): DocumentPermissionInstance + { + return new DocumentPermissionInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['documentSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.DocumentPermissionPage]'; + } +} diff --git a/app/api/Twilio/Rest/Sync/V1/Service/DocumentContext.php b/app/api/Twilio/Rest/Sync/V1/Service/DocumentContext.php new file mode 100755 index 0000000..95cef18 --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/DocumentContext.php @@ -0,0 +1,194 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Documents/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the DocumentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the DocumentInstance + * + * @return DocumentInstance Fetched DocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DocumentInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new DocumentInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the DocumentInstance + * + * @param array|Options $options Optional Arguments + * @return DocumentInstance Updated DocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): DocumentInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Data' => + Serialize::jsonObject($options['data']), + 'Ttl' => + $options['ttl'], + ]); + + $headers = Values::of(['If-Match' => $options['ifMatch']]); + + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new DocumentInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the documentPermissions + */ + protected function getDocumentPermissions(): DocumentPermissionList + { + if (!$this->_documentPermissions) { + $this->_documentPermissions = new DocumentPermissionList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_documentPermissions; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.DocumentContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Sync/V1/Service/DocumentInstance.php b/app/api/Twilio/Rest/Sync/V1/Service/DocumentInstance.php new file mode 100755 index 0000000..f878914 --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/DocumentInstance.php @@ -0,0 +1,177 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + 'revision' => Values::array_get($payload, 'revision'), + 'data' => Values::array_get($payload, 'data'), + 'dateExpires' => Deserialize::dateTime(Values::array_get($payload, 'date_expires')), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'createdBy' => Values::array_get($payload, 'created_by'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return DocumentContext Context for this DocumentInstance + */ + protected function proxy(): DocumentContext + { + if (!$this->context) { + $this->context = new DocumentContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the DocumentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the DocumentInstance + * + * @return DocumentInstance Fetched DocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): DocumentInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the DocumentInstance + * + * @param array|Options $options Optional Arguments + * @return DocumentInstance Updated DocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): DocumentInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the documentPermissions + */ + protected function getDocumentPermissions(): DocumentPermissionList + { + return $this->proxy()->documentPermissions; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.DocumentInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Sync/V1/Service/DocumentList.php b/app/api/Twilio/Rest/Sync/V1/Service/DocumentList.php new file mode 100755 index 0000000..1eac8a4 --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/DocumentList.php @@ -0,0 +1,202 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Documents'; + } + + /** + * Create the DocumentInstance + * + * @param array|Options $options Optional Arguments + * @return DocumentInstance Created DocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): DocumentInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + 'Data' => + Serialize::jsonObject($options['data']), + 'Ttl' => + $options['ttl'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new DocumentInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads DocumentInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return DocumentInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams DocumentInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of DocumentInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return DocumentPage Page of DocumentInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): DocumentPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new DocumentPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of DocumentInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return DocumentPage Page of DocumentInstance + */ + public function getPage(string $targetUrl): DocumentPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new DocumentPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a DocumentContext + * + * @param string $sid The SID of the Document resource to delete. Can be the Document resource's `sid` or its `unique_name`. + */ + public function getContext( + string $sid + + ): DocumentContext + { + return new DocumentContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.DocumentList]'; + } +} diff --git a/app/api/Twilio/Rest/Sync/V1/Service/DocumentOptions.php b/app/api/Twilio/Rest/Sync/V1/Service/DocumentOptions.php new file mode 100755 index 0000000..c07dcc9 --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/DocumentOptions.php @@ -0,0 +1,206 @@ +options['uniqueName'] = $uniqueName; + $this->options['data'] = $data; + $this->options['ttl'] = $ttl; + } + + /** + * An application-defined string that uniquely identifies the Sync Document + * + * @param string $uniqueName An application-defined string that uniquely identifies the Sync Document + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * A JSON string that represents an arbitrary, schema-less object that the Sync Document stores. Can be up to 16 KiB in length. + * + * @param array $data A JSON string that represents an arbitrary, schema-less object that the Sync Document stores. Can be up to 16 KiB in length. + * @return $this Fluent Builder + */ + public function setData(array $data): self + { + $this->options['data'] = $data; + return $this; + } + + /** + * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Document expires and is deleted (the Sync Document's time-to-live). + * + * @param int $ttl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Document expires and is deleted (the Sync Document's time-to-live). + * @return $this Fluent Builder + */ + public function setTtl(int $ttl): self + { + $this->options['ttl'] = $ttl; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Sync.V1.CreateDocumentOptions ' . $options . ']'; + } +} + + + + +class UpdateDocumentOptions extends Options + { + /** + * @param array $data A JSON string that represents an arbitrary, schema-less object that the Sync Document stores. Can be up to 16 KiB in length. + * @param int $ttl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Document expires and is deleted (time-to-live). + * @param string $ifMatch The If-Match HTTP request header + */ + public function __construct( + + array $data = Values::ARRAY_NONE, + int $ttl = Values::INT_NONE, + string $ifMatch = Values::NONE + + ) { + $this->options['data'] = $data; + $this->options['ttl'] = $ttl; + $this->options['ifMatch'] = $ifMatch; + } + + /** + * A JSON string that represents an arbitrary, schema-less object that the Sync Document stores. Can be up to 16 KiB in length. + * + * @param array $data A JSON string that represents an arbitrary, schema-less object that the Sync Document stores. Can be up to 16 KiB in length. + * @return $this Fluent Builder + */ + public function setData(array $data): self + { + $this->options['data'] = $data; + return $this; + } + + /** + * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Document expires and is deleted (time-to-live). + * + * @param int $ttl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Document expires and is deleted (time-to-live). + * @return $this Fluent Builder + */ + public function setTtl(int $ttl): self + { + $this->options['ttl'] = $ttl; + return $this; + } + + /** + * The If-Match HTTP request header + * + * @param string $ifMatch The If-Match HTTP request header + * @return $this Fluent Builder + */ + public function setIfMatch(string $ifMatch): self + { + $this->options['ifMatch'] = $ifMatch; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Sync.V1.UpdateDocumentOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Sync/V1/Service/DocumentPage.php b/app/api/Twilio/Rest/Sync/V1/Service/DocumentPage.php new file mode 100755 index 0000000..dc74437 --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/DocumentPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DocumentInstance \Twilio\Rest\Sync\V1\Service\DocumentInstance + */ + public function buildInstance(array $payload): DocumentInstance + { + return new DocumentInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.DocumentPage]'; + } +} diff --git a/app/api/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemContext.php b/app/api/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemContext.php new file mode 100755 index 0000000..205f11a --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemContext.php @@ -0,0 +1,151 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'listSid' => + $listSid, + 'index' => + $index, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Lists/' . \rawurlencode($listSid) + .'/Items/' . \rawurlencode($index) + .''; + } + + /** + * Delete the SyncListItemInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['If-Match' => $options['ifMatch']]); + + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the SyncListItemInstance + * + * @return SyncListItemInstance Fetched SyncListItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncListItemInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new SyncListItemInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['listSid'], + $this->solution['index'] + ); + } + + + /** + * Update the SyncListItemInstance + * + * @param array|Options $options Optional Arguments + * @return SyncListItemInstance Updated SyncListItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SyncListItemInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Data' => + Serialize::jsonObject($options['data']), + 'Ttl' => + $options['ttl'], + 'ItemTtl' => + $options['itemTtl'], + 'CollectionTtl' => + $options['collectionTtl'], + ]); + + $headers = Values::of(['If-Match' => $options['ifMatch']]); + + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new SyncListItemInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['listSid'], + $this->solution['index'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.SyncListItemContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemInstance.php b/app/api/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemInstance.php new file mode 100755 index 0000000..786ccc9 --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemInstance.php @@ -0,0 +1,167 @@ +properties = [ + 'index' => Values::array_get($payload, 'index'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'listSid' => Values::array_get($payload, 'list_sid'), + 'url' => Values::array_get($payload, 'url'), + 'revision' => Values::array_get($payload, 'revision'), + 'data' => Values::array_get($payload, 'data'), + 'dateExpires' => Deserialize::dateTime(Values::array_get($payload, 'date_expires')), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'createdBy' => Values::array_get($payload, 'created_by'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'listSid' => $listSid, 'index' => $index ?: $this->properties['index'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SyncListItemContext Context for this SyncListItemInstance + */ + protected function proxy(): SyncListItemContext + { + if (!$this->context) { + $this->context = new SyncListItemContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['listSid'], + $this->solution['index'] + ); + } + + return $this->context; + } + + /** + * Delete the SyncListItemInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the SyncListItemInstance + * + * @return SyncListItemInstance Fetched SyncListItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncListItemInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SyncListItemInstance + * + * @param array|Options $options Optional Arguments + * @return SyncListItemInstance Updated SyncListItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SyncListItemInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.SyncListItemInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemList.php b/app/api/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemList.php new file mode 100755 index 0000000..c5cd8cb --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemList.php @@ -0,0 +1,223 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'listSid' => + $listSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Lists/' . \rawurlencode($listSid) + .'/Items'; + } + + /** + * Create the SyncListItemInstance + * + * @param array $data A JSON string that represents an arbitrary, schema-less object that the List Item stores. Can be up to 16 KiB in length. + * @param array|Options $options Optional Arguments + * @return SyncListItemInstance Created SyncListItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $data, array $options = []): SyncListItemInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Data' => + Serialize::jsonObject($data), + 'Ttl' => + $options['ttl'], + 'ItemTtl' => + $options['itemTtl'], + 'CollectionTtl' => + $options['collectionTtl'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new SyncListItemInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['listSid'] + ); + } + + + /** + * Reads SyncListItemInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return SyncListItemInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams SyncListItemInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SyncListItemInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return SyncListItemPage Page of SyncListItemInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SyncListItemPage + { + $options = new Values($options); + + $params = Values::of([ + 'Order' => + $options['order'], + 'From' => + $options['from'], + 'Bounds' => + $options['bounds'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SyncListItemPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SyncListItemInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SyncListItemPage Page of SyncListItemInstance + */ + public function getPage(string $targetUrl): SyncListItemPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SyncListItemPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SyncListItemContext + * + * @param int $index The index of the Sync List Item resource to delete. + */ + public function getContext( + int $index + + ): SyncListItemContext + { + return new SyncListItemContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['listSid'], + $index + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.SyncListItemList]'; + } +} diff --git a/app/api/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemOptions.php b/app/api/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemOptions.php new file mode 100755 index 0000000..a58db9d --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemOptions.php @@ -0,0 +1,378 @@ +options['ttl'] = $ttl; + $this->options['itemTtl'] = $itemTtl; + $this->options['collectionTtl'] = $collectionTtl; + } + + /** + * An alias for `item_ttl`. If both parameters are provided, this value is ignored. + * + * @param int $ttl An alias for `item_ttl`. If both parameters are provided, this value is ignored. + * @return $this Fluent Builder + */ + public function setTtl(int $ttl): self + { + $this->options['ttl'] = $ttl; + return $this; + } + + /** + * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item expires (time-to-live) and is deleted. + * + * @param int $itemTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item expires (time-to-live) and is deleted. + * @return $this Fluent Builder + */ + public function setItemTtl(int $itemTtl): self + { + $this->options['itemTtl'] = $itemTtl; + return $this; + } + + /** + * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item's parent Sync List expires (time-to-live) and is deleted. + * + * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item's parent Sync List expires (time-to-live) and is deleted. + * @return $this Fluent Builder + */ + public function setCollectionTtl(int $collectionTtl): self + { + $this->options['collectionTtl'] = $collectionTtl; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Sync.V1.CreateSyncListItemOptions ' . $options . ']'; + } +} + +class DeleteSyncListItemOptions extends Options + { + /** + * @param string $ifMatch If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). + */ + public function __construct( + + string $ifMatch = Values::NONE + + ) { + $this->options['ifMatch'] = $ifMatch; + } + + /** + * If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). + * + * @param string $ifMatch If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). + * @return $this Fluent Builder + */ + public function setIfMatch(string $ifMatch): self + { + $this->options['ifMatch'] = $ifMatch; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Sync.V1.DeleteSyncListItemOptions ' . $options . ']'; + } +} + + +class ReadSyncListItemOptions extends Options + { + /** + * @param string $order How to order the List Items returned by their `index` value. Can be: `asc` (ascending) or `desc` (descending) and the default is ascending. + * @param string $from The `index` of the first Sync List Item resource to read. See also `bounds`. + * @param string $bounds Whether to include the List Item referenced by the `from` parameter. Can be: `inclusive` to include the List Item referenced by the `from` parameter or `exclusive` to start with the next List Item. The default value is `inclusive`. + */ + public function __construct( + + string $order = Values::NONE, + string $from = Values::NONE, + string $bounds = Values::NONE + + ) { + $this->options['order'] = $order; + $this->options['from'] = $from; + $this->options['bounds'] = $bounds; + } + + /** + * How to order the List Items returned by their `index` value. Can be: `asc` (ascending) or `desc` (descending) and the default is ascending. + * + * @param string $order How to order the List Items returned by their `index` value. Can be: `asc` (ascending) or `desc` (descending) and the default is ascending. + * @return $this Fluent Builder + */ + public function setOrder(string $order): self + { + $this->options['order'] = $order; + return $this; + } + + /** + * The `index` of the first Sync List Item resource to read. See also `bounds`. + * + * @param string $from The `index` of the first Sync List Item resource to read. See also `bounds`. + * @return $this Fluent Builder + */ + public function setFrom(string $from): self + { + $this->options['from'] = $from; + return $this; + } + + /** + * Whether to include the List Item referenced by the `from` parameter. Can be: `inclusive` to include the List Item referenced by the `from` parameter or `exclusive` to start with the next List Item. The default value is `inclusive`. + * + * @param string $bounds Whether to include the List Item referenced by the `from` parameter. Can be: `inclusive` to include the List Item referenced by the `from` parameter or `exclusive` to start with the next List Item. The default value is `inclusive`. + * @return $this Fluent Builder + */ + public function setBounds(string $bounds): self + { + $this->options['bounds'] = $bounds; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Sync.V1.ReadSyncListItemOptions ' . $options . ']'; + } +} + +class UpdateSyncListItemOptions extends Options + { + /** + * @param array $data A JSON string that represents an arbitrary, schema-less object that the List Item stores. Can be up to 16 KiB in length. + * @param int $ttl An alias for `item_ttl`. If both parameters are provided, this value is ignored. + * @param int $itemTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item expires (time-to-live) and is deleted. + * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item's parent Sync List expires (time-to-live) and is deleted. This parameter can only be used when the List Item's `data` or `ttl` is updated in the same request. + * @param string $ifMatch If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). + */ + public function __construct( + + array $data = Values::ARRAY_NONE, + int $ttl = Values::INT_NONE, + int $itemTtl = Values::INT_NONE, + int $collectionTtl = Values::INT_NONE, + string $ifMatch = Values::NONE + + ) { + $this->options['data'] = $data; + $this->options['ttl'] = $ttl; + $this->options['itemTtl'] = $itemTtl; + $this->options['collectionTtl'] = $collectionTtl; + $this->options['ifMatch'] = $ifMatch; + } + + /** + * A JSON string that represents an arbitrary, schema-less object that the List Item stores. Can be up to 16 KiB in length. + * + * @param array $data A JSON string that represents an arbitrary, schema-less object that the List Item stores. Can be up to 16 KiB in length. + * @return $this Fluent Builder + */ + public function setData(array $data): self + { + $this->options['data'] = $data; + return $this; + } + + /** + * An alias for `item_ttl`. If both parameters are provided, this value is ignored. + * + * @param int $ttl An alias for `item_ttl`. If both parameters are provided, this value is ignored. + * @return $this Fluent Builder + */ + public function setTtl(int $ttl): self + { + $this->options['ttl'] = $ttl; + return $this; + } + + /** + * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item expires (time-to-live) and is deleted. + * + * @param int $itemTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item expires (time-to-live) and is deleted. + * @return $this Fluent Builder + */ + public function setItemTtl(int $itemTtl): self + { + $this->options['itemTtl'] = $itemTtl; + return $this; + } + + /** + * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item's parent Sync List expires (time-to-live) and is deleted. This parameter can only be used when the List Item's `data` or `ttl` is updated in the same request. + * + * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the List Item's parent Sync List expires (time-to-live) and is deleted. This parameter can only be used when the List Item's `data` or `ttl` is updated in the same request. + * @return $this Fluent Builder + */ + public function setCollectionTtl(int $collectionTtl): self + { + $this->options['collectionTtl'] = $collectionTtl; + return $this; + } + + /** + * If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). + * + * @param string $ifMatch If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). + * @return $this Fluent Builder + */ + public function setIfMatch(string $ifMatch): self + { + $this->options['ifMatch'] = $ifMatch; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Sync.V1.UpdateSyncListItemOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemPage.php b/app/api/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemPage.php new file mode 100755 index 0000000..b9c7450 --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/SyncList/SyncListItemPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SyncListItemInstance \Twilio\Rest\Sync\V1\Service\SyncList\SyncListItemInstance + */ + public function buildInstance(array $payload): SyncListItemInstance + { + return new SyncListItemInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.SyncListItemPage]'; + } +} diff --git a/app/api/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionContext.php b/app/api/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionContext.php new file mode 100755 index 0000000..6343e84 --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionContext.php @@ -0,0 +1,141 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'listSid' => + $listSid, + 'identity' => + $identity, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Lists/' . \rawurlencode($listSid) + .'/Permissions/' . \rawurlencode($identity) + .''; + } + + /** + * Delete the SyncListPermissionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the SyncListPermissionInstance + * + * @return SyncListPermissionInstance Fetched SyncListPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncListPermissionInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new SyncListPermissionInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['listSid'], + $this->solution['identity'] + ); + } + + + /** + * Update the SyncListPermissionInstance + * + * @param bool $read Whether the identity can read the Sync List and its Items. Default value is `false`. + * @param bool $write Whether the identity can create, update, and delete Items in the Sync List. Default value is `false`. + * @param bool $manage Whether the identity can delete the Sync List. Default value is `false`. + * @return SyncListPermissionInstance Updated SyncListPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $read, bool $write, bool $manage): SyncListPermissionInstance + { + + $data = Values::of([ + 'Read' => + Serialize::booleanToString($read), + 'Write' => + Serialize::booleanToString($write), + 'Manage' => + Serialize::booleanToString($manage), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new SyncListPermissionInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['listSid'], + $this->solution['identity'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.SyncListPermissionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionInstance.php b/app/api/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionInstance.php new file mode 100755 index 0000000..32a20c1 --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionInstance.php @@ -0,0 +1,160 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'listSid' => Values::array_get($payload, 'list_sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'read' => Values::array_get($payload, 'read'), + 'write' => Values::array_get($payload, 'write'), + 'manage' => Values::array_get($payload, 'manage'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'listSid' => $listSid, 'identity' => $identity ?: $this->properties['identity'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SyncListPermissionContext Context for this SyncListPermissionInstance + */ + protected function proxy(): SyncListPermissionContext + { + if (!$this->context) { + $this->context = new SyncListPermissionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['listSid'], + $this->solution['identity'] + ); + } + + return $this->context; + } + + /** + * Delete the SyncListPermissionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SyncListPermissionInstance + * + * @return SyncListPermissionInstance Fetched SyncListPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncListPermissionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SyncListPermissionInstance + * + * @param bool $read Whether the identity can read the Sync List and its Items. Default value is `false`. + * @param bool $write Whether the identity can create, update, and delete Items in the Sync List. Default value is `false`. + * @param bool $manage Whether the identity can delete the Sync List. Default value is `false`. + * @return SyncListPermissionInstance Updated SyncListPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $read, bool $write, bool $manage): SyncListPermissionInstance + { + + return $this->proxy()->update($read, $write, $manage); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.SyncListPermissionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionList.php b/app/api/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionList.php new file mode 100755 index 0000000..cc67844 --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionList.php @@ -0,0 +1,175 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'listSid' => + $listSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Lists/' . \rawurlencode($listSid) + .'/Permissions'; + } + + /** + * Reads SyncListPermissionInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return SyncListPermissionInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams SyncListPermissionInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SyncListPermissionInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return SyncListPermissionPage Page of SyncListPermissionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SyncListPermissionPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SyncListPermissionPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SyncListPermissionInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SyncListPermissionPage Page of SyncListPermissionInstance + */ + public function getPage(string $targetUrl): SyncListPermissionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SyncListPermissionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SyncListPermissionContext + * + * @param string $identity The application-defined string that uniquely identifies the User's Sync List Permission resource to delete. + */ + public function getContext( + string $identity + + ): SyncListPermissionContext + { + return new SyncListPermissionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['listSid'], + $identity + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.SyncListPermissionList]'; + } +} diff --git a/app/api/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionPage.php b/app/api/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionPage.php new file mode 100755 index 0000000..e143977 --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/SyncList/SyncListPermissionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SyncListPermissionInstance \Twilio\Rest\Sync\V1\Service\SyncList\SyncListPermissionInstance + */ + public function buildInstance(array $payload): SyncListPermissionInstance + { + return new SyncListPermissionInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['listSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.SyncListPermissionPage]'; + } +} diff --git a/app/api/Twilio/Rest/Sync/V1/Service/SyncListContext.php b/app/api/Twilio/Rest/Sync/V1/Service/SyncListContext.php new file mode 100755 index 0000000..987633a --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/SyncListContext.php @@ -0,0 +1,211 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Lists/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the SyncListInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the SyncListInstance + * + * @return SyncListInstance Fetched SyncListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncListInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new SyncListInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the SyncListInstance + * + * @param array|Options $options Optional Arguments + * @return SyncListInstance Updated SyncListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SyncListInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Ttl' => + $options['ttl'], + 'CollectionTtl' => + $options['collectionTtl'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new SyncListInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the syncListPermissions + */ + protected function getSyncListPermissions(): SyncListPermissionList + { + if (!$this->_syncListPermissions) { + $this->_syncListPermissions = new SyncListPermissionList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_syncListPermissions; + } + + /** + * Access the syncListItems + */ + protected function getSyncListItems(): SyncListItemList + { + if (!$this->_syncListItems) { + $this->_syncListItems = new SyncListItemList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_syncListItems; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.SyncListContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Sync/V1/Service/SyncListInstance.php b/app/api/Twilio/Rest/Sync/V1/Service/SyncListInstance.php new file mode 100755 index 0000000..0925ea0 --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/SyncListInstance.php @@ -0,0 +1,185 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + 'revision' => Values::array_get($payload, 'revision'), + 'dateExpires' => Deserialize::dateTime(Values::array_get($payload, 'date_expires')), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'createdBy' => Values::array_get($payload, 'created_by'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SyncListContext Context for this SyncListInstance + */ + protected function proxy(): SyncListContext + { + if (!$this->context) { + $this->context = new SyncListContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the SyncListInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SyncListInstance + * + * @return SyncListInstance Fetched SyncListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncListInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SyncListInstance + * + * @param array|Options $options Optional Arguments + * @return SyncListInstance Updated SyncListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SyncListInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the syncListPermissions + */ + protected function getSyncListPermissions(): SyncListPermissionList + { + return $this->proxy()->syncListPermissions; + } + + /** + * Access the syncListItems + */ + protected function getSyncListItems(): SyncListItemList + { + return $this->proxy()->syncListItems; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.SyncListInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Sync/V1/Service/SyncListList.php b/app/api/Twilio/Rest/Sync/V1/Service/SyncListList.php new file mode 100755 index 0000000..d86f4bb --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/SyncListList.php @@ -0,0 +1,201 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Lists'; + } + + /** + * Create the SyncListInstance + * + * @param array|Options $options Optional Arguments + * @return SyncListInstance Created SyncListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): SyncListInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + 'Ttl' => + $options['ttl'], + 'CollectionTtl' => + $options['collectionTtl'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new SyncListInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads SyncListInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return SyncListInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams SyncListInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SyncListInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return SyncListPage Page of SyncListInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SyncListPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SyncListPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SyncListInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SyncListPage Page of SyncListInstance + */ + public function getPage(string $targetUrl): SyncListPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SyncListPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SyncListContext + * + * @param string $sid The SID of the Sync List resource to delete. Can be the Sync List resource's `sid` or its `unique_name`. + */ + public function getContext( + string $sid + + ): SyncListContext + { + return new SyncListContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.SyncListList]'; + } +} diff --git a/app/api/Twilio/Rest/Sync/V1/Service/SyncListOptions.php b/app/api/Twilio/Rest/Sync/V1/Service/SyncListOptions.php new file mode 100755 index 0000000..bff4efa --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/SyncListOptions.php @@ -0,0 +1,188 @@ +options['uniqueName'] = $uniqueName; + $this->options['ttl'] = $ttl; + $this->options['collectionTtl'] = $collectionTtl; + } + + /** + * An application-defined string that uniquely identifies the resource. This value must be unique within its Service and it can be up to 320 characters long. The `unique_name` value can be used as an alternative to the `sid` in the URL path to address the resource. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be unique within its Service and it can be up to 320 characters long. The `unique_name` value can be used as an alternative to the `sid` in the URL path to address the resource. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * Alias for collection_ttl. If both are provided, this value is ignored. + * + * @param int $ttl Alias for collection_ttl. If both are provided, this value is ignored. + * @return $this Fluent Builder + */ + public function setTtl(int $ttl): self + { + $this->options['ttl'] = $ttl; + return $this; + } + + /** + * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync List expires (time-to-live) and is deleted. + * + * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync List expires (time-to-live) and is deleted. + * @return $this Fluent Builder + */ + public function setCollectionTtl(int $collectionTtl): self + { + $this->options['collectionTtl'] = $collectionTtl; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Sync.V1.CreateSyncListOptions ' . $options . ']'; + } +} + + + + +class UpdateSyncListOptions extends Options + { + /** + * @param int $ttl An alias for `collection_ttl`. If both are provided, this value is ignored. + * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync List expires (time-to-live) and is deleted. + */ + public function __construct( + + int $ttl = Values::INT_NONE, + int $collectionTtl = Values::INT_NONE + + ) { + $this->options['ttl'] = $ttl; + $this->options['collectionTtl'] = $collectionTtl; + } + + /** + * An alias for `collection_ttl`. If both are provided, this value is ignored. + * + * @param int $ttl An alias for `collection_ttl`. If both are provided, this value is ignored. + * @return $this Fluent Builder + */ + public function setTtl(int $ttl): self + { + $this->options['ttl'] = $ttl; + return $this; + } + + /** + * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync List expires (time-to-live) and is deleted. + * + * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync List expires (time-to-live) and is deleted. + * @return $this Fluent Builder + */ + public function setCollectionTtl(int $collectionTtl): self + { + $this->options['collectionTtl'] = $collectionTtl; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Sync.V1.UpdateSyncListOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Sync/V1/Service/SyncListPage.php b/app/api/Twilio/Rest/Sync/V1/Service/SyncListPage.php new file mode 100755 index 0000000..4876506 --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/SyncListPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SyncListInstance \Twilio\Rest\Sync\V1\Service\SyncListInstance + */ + public function buildInstance(array $payload): SyncListInstance + { + return new SyncListInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.SyncListPage]'; + } +} diff --git a/app/api/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemContext.php b/app/api/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemContext.php new file mode 100755 index 0000000..de01ff6 --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemContext.php @@ -0,0 +1,151 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'mapSid' => + $mapSid, + 'key' => + $key, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Maps/' . \rawurlencode($mapSid) + .'/Items/' . \rawurlencode($key) + .''; + } + + /** + * Delete the SyncMapItemInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['If-Match' => $options['ifMatch']]); + + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the SyncMapItemInstance + * + * @return SyncMapItemInstance Fetched SyncMapItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncMapItemInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new SyncMapItemInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['mapSid'], + $this->solution['key'] + ); + } + + + /** + * Update the SyncMapItemInstance + * + * @param array|Options $options Optional Arguments + * @return SyncMapItemInstance Updated SyncMapItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SyncMapItemInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Data' => + Serialize::jsonObject($options['data']), + 'Ttl' => + $options['ttl'], + 'ItemTtl' => + $options['itemTtl'], + 'CollectionTtl' => + $options['collectionTtl'], + ]); + + $headers = Values::of(['If-Match' => $options['ifMatch']]); + + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new SyncMapItemInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['mapSid'], + $this->solution['key'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.SyncMapItemContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemInstance.php b/app/api/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemInstance.php new file mode 100755 index 0000000..0b80b6c --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemInstance.php @@ -0,0 +1,167 @@ +properties = [ + 'key' => Values::array_get($payload, 'key'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'mapSid' => Values::array_get($payload, 'map_sid'), + 'url' => Values::array_get($payload, 'url'), + 'revision' => Values::array_get($payload, 'revision'), + 'data' => Values::array_get($payload, 'data'), + 'dateExpires' => Deserialize::dateTime(Values::array_get($payload, 'date_expires')), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'createdBy' => Values::array_get($payload, 'created_by'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'mapSid' => $mapSid, 'key' => $key ?: $this->properties['key'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SyncMapItemContext Context for this SyncMapItemInstance + */ + protected function proxy(): SyncMapItemContext + { + if (!$this->context) { + $this->context = new SyncMapItemContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['mapSid'], + $this->solution['key'] + ); + } + + return $this->context; + } + + /** + * Delete the SyncMapItemInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the SyncMapItemInstance + * + * @return SyncMapItemInstance Fetched SyncMapItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncMapItemInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SyncMapItemInstance + * + * @param array|Options $options Optional Arguments + * @return SyncMapItemInstance Updated SyncMapItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SyncMapItemInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.SyncMapItemInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemList.php b/app/api/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemList.php new file mode 100755 index 0000000..533d5f2 --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemList.php @@ -0,0 +1,226 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'mapSid' => + $mapSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Maps/' . \rawurlencode($mapSid) + .'/Items'; + } + + /** + * Create the SyncMapItemInstance + * + * @param string $key The unique, user-defined key for the Map Item. Can be up to 320 characters long. + * @param array $data A JSON string that represents an arbitrary, schema-less object that the Map Item stores. Can be up to 16 KiB in length. + * @param array|Options $options Optional Arguments + * @return SyncMapItemInstance Created SyncMapItemInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $key, array $data, array $options = []): SyncMapItemInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Key' => + $key, + 'Data' => + Serialize::jsonObject($data), + 'Ttl' => + $options['ttl'], + 'ItemTtl' => + $options['itemTtl'], + 'CollectionTtl' => + $options['collectionTtl'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new SyncMapItemInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['mapSid'] + ); + } + + + /** + * Reads SyncMapItemInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return SyncMapItemInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams SyncMapItemInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SyncMapItemInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return SyncMapItemPage Page of SyncMapItemInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SyncMapItemPage + { + $options = new Values($options); + + $params = Values::of([ + 'Order' => + $options['order'], + 'From' => + $options['from'], + 'Bounds' => + $options['bounds'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SyncMapItemPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SyncMapItemInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SyncMapItemPage Page of SyncMapItemInstance + */ + public function getPage(string $targetUrl): SyncMapItemPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SyncMapItemPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SyncMapItemContext + * + * @param string $key The `key` value of the Sync Map Item resource to delete. + */ + public function getContext( + string $key + + ): SyncMapItemContext + { + return new SyncMapItemContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['mapSid'], + $key + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.SyncMapItemList]'; + } +} diff --git a/app/api/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemOptions.php b/app/api/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemOptions.php new file mode 100755 index 0000000..36c841c --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemOptions.php @@ -0,0 +1,378 @@ +options['ttl'] = $ttl; + $this->options['itemTtl'] = $itemTtl; + $this->options['collectionTtl'] = $collectionTtl; + } + + /** + * An alias for `item_ttl`. If both parameters are provided, this value is ignored. + * + * @param int $ttl An alias for `item_ttl`. If both parameters are provided, this value is ignored. + * @return $this Fluent Builder + */ + public function setTtl(int $ttl): self + { + $this->options['ttl'] = $ttl; + return $this; + } + + /** + * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item expires (time-to-live) and is deleted. + * + * @param int $itemTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item expires (time-to-live) and is deleted. + * @return $this Fluent Builder + */ + public function setItemTtl(int $itemTtl): self + { + $this->options['itemTtl'] = $itemTtl; + return $this; + } + + /** + * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item's parent Sync Map expires (time-to-live) and is deleted. + * + * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item's parent Sync Map expires (time-to-live) and is deleted. + * @return $this Fluent Builder + */ + public function setCollectionTtl(int $collectionTtl): self + { + $this->options['collectionTtl'] = $collectionTtl; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Sync.V1.CreateSyncMapItemOptions ' . $options . ']'; + } +} + +class DeleteSyncMapItemOptions extends Options + { + /** + * @param string $ifMatch If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). + */ + public function __construct( + + string $ifMatch = Values::NONE + + ) { + $this->options['ifMatch'] = $ifMatch; + } + + /** + * If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). + * + * @param string $ifMatch If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). + * @return $this Fluent Builder + */ + public function setIfMatch(string $ifMatch): self + { + $this->options['ifMatch'] = $ifMatch; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Sync.V1.DeleteSyncMapItemOptions ' . $options . ']'; + } +} + + +class ReadSyncMapItemOptions extends Options + { + /** + * @param string $order How to order the Map Items returned by their `key` value. Can be: `asc` (ascending) or `desc` (descending) and the default is ascending. Map Items are [ordered lexicographically](https://en.wikipedia.org/wiki/Lexicographical_order) by Item key. + * @param string $from The `key` of the first Sync Map Item resource to read. See also `bounds`. + * @param string $bounds Whether to include the Map Item referenced by the `from` parameter. Can be: `inclusive` to include the Map Item referenced by the `from` parameter or `exclusive` to start with the next Map Item. The default value is `inclusive`. + */ + public function __construct( + + string $order = Values::NONE, + string $from = Values::NONE, + string $bounds = Values::NONE + + ) { + $this->options['order'] = $order; + $this->options['from'] = $from; + $this->options['bounds'] = $bounds; + } + + /** + * How to order the Map Items returned by their `key` value. Can be: `asc` (ascending) or `desc` (descending) and the default is ascending. Map Items are [ordered lexicographically](https://en.wikipedia.org/wiki/Lexicographical_order) by Item key. + * + * @param string $order How to order the Map Items returned by their `key` value. Can be: `asc` (ascending) or `desc` (descending) and the default is ascending. Map Items are [ordered lexicographically](https://en.wikipedia.org/wiki/Lexicographical_order) by Item key. + * @return $this Fluent Builder + */ + public function setOrder(string $order): self + { + $this->options['order'] = $order; + return $this; + } + + /** + * The `key` of the first Sync Map Item resource to read. See also `bounds`. + * + * @param string $from The `key` of the first Sync Map Item resource to read. See also `bounds`. + * @return $this Fluent Builder + */ + public function setFrom(string $from): self + { + $this->options['from'] = $from; + return $this; + } + + /** + * Whether to include the Map Item referenced by the `from` parameter. Can be: `inclusive` to include the Map Item referenced by the `from` parameter or `exclusive` to start with the next Map Item. The default value is `inclusive`. + * + * @param string $bounds Whether to include the Map Item referenced by the `from` parameter. Can be: `inclusive` to include the Map Item referenced by the `from` parameter or `exclusive` to start with the next Map Item. The default value is `inclusive`. + * @return $this Fluent Builder + */ + public function setBounds(string $bounds): self + { + $this->options['bounds'] = $bounds; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Sync.V1.ReadSyncMapItemOptions ' . $options . ']'; + } +} + +class UpdateSyncMapItemOptions extends Options + { + /** + * @param array $data A JSON string that represents an arbitrary, schema-less object that the Map Item stores. Can be up to 16 KiB in length. + * @param int $ttl An alias for `item_ttl`. If both parameters are provided, this value is ignored. + * @param int $itemTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item expires (time-to-live) and is deleted. + * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item's parent Sync Map expires (time-to-live) and is deleted. This parameter can only be used when the Map Item's `data` or `ttl` is updated in the same request. + * @param string $ifMatch If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). + */ + public function __construct( + + array $data = Values::ARRAY_NONE, + int $ttl = Values::INT_NONE, + int $itemTtl = Values::INT_NONE, + int $collectionTtl = Values::INT_NONE, + string $ifMatch = Values::NONE + + ) { + $this->options['data'] = $data; + $this->options['ttl'] = $ttl; + $this->options['itemTtl'] = $itemTtl; + $this->options['collectionTtl'] = $collectionTtl; + $this->options['ifMatch'] = $ifMatch; + } + + /** + * A JSON string that represents an arbitrary, schema-less object that the Map Item stores. Can be up to 16 KiB in length. + * + * @param array $data A JSON string that represents an arbitrary, schema-less object that the Map Item stores. Can be up to 16 KiB in length. + * @return $this Fluent Builder + */ + public function setData(array $data): self + { + $this->options['data'] = $data; + return $this; + } + + /** + * An alias for `item_ttl`. If both parameters are provided, this value is ignored. + * + * @param int $ttl An alias for `item_ttl`. If both parameters are provided, this value is ignored. + * @return $this Fluent Builder + */ + public function setTtl(int $ttl): self + { + $this->options['ttl'] = $ttl; + return $this; + } + + /** + * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item expires (time-to-live) and is deleted. + * + * @param int $itemTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item expires (time-to-live) and is deleted. + * @return $this Fluent Builder + */ + public function setItemTtl(int $itemTtl): self + { + $this->options['itemTtl'] = $itemTtl; + return $this; + } + + /** + * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item's parent Sync Map expires (time-to-live) and is deleted. This parameter can only be used when the Map Item's `data` or `ttl` is updated in the same request. + * + * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Map Item's parent Sync Map expires (time-to-live) and is deleted. This parameter can only be used when the Map Item's `data` or `ttl` is updated in the same request. + * @return $this Fluent Builder + */ + public function setCollectionTtl(int $collectionTtl): self + { + $this->options['collectionTtl'] = $collectionTtl; + return $this; + } + + /** + * If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). + * + * @param string $ifMatch If provided, applies this mutation if (and only if) the “revision” field of this [map item] matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). + * @return $this Fluent Builder + */ + public function setIfMatch(string $ifMatch): self + { + $this->options['ifMatch'] = $ifMatch; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Sync.V1.UpdateSyncMapItemOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemPage.php b/app/api/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemPage.php new file mode 100755 index 0000000..430981a --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapItemPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SyncMapItemInstance \Twilio\Rest\Sync\V1\Service\SyncMap\SyncMapItemInstance + */ + public function buildInstance(array $payload): SyncMapItemInstance + { + return new SyncMapItemInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.SyncMapItemPage]'; + } +} diff --git a/app/api/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionContext.php b/app/api/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionContext.php new file mode 100755 index 0000000..6c693d0 --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionContext.php @@ -0,0 +1,141 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'mapSid' => + $mapSid, + 'identity' => + $identity, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Maps/' . \rawurlencode($mapSid) + .'/Permissions/' . \rawurlencode($identity) + .''; + } + + /** + * Delete the SyncMapPermissionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the SyncMapPermissionInstance + * + * @return SyncMapPermissionInstance Fetched SyncMapPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncMapPermissionInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new SyncMapPermissionInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['mapSid'], + $this->solution['identity'] + ); + } + + + /** + * Update the SyncMapPermissionInstance + * + * @param bool $read Whether the identity can read the Sync Map and its Items. Default value is `false`. + * @param bool $write Whether the identity can create, update, and delete Items in the Sync Map. Default value is `false`. + * @param bool $manage Whether the identity can delete the Sync Map. Default value is `false`. + * @return SyncMapPermissionInstance Updated SyncMapPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $read, bool $write, bool $manage): SyncMapPermissionInstance + { + + $data = Values::of([ + 'Read' => + Serialize::booleanToString($read), + 'Write' => + Serialize::booleanToString($write), + 'Manage' => + Serialize::booleanToString($manage), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new SyncMapPermissionInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['mapSid'], + $this->solution['identity'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.SyncMapPermissionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionInstance.php b/app/api/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionInstance.php new file mode 100755 index 0000000..2dce6de --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionInstance.php @@ -0,0 +1,160 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'mapSid' => Values::array_get($payload, 'map_sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'read' => Values::array_get($payload, 'read'), + 'write' => Values::array_get($payload, 'write'), + 'manage' => Values::array_get($payload, 'manage'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'mapSid' => $mapSid, 'identity' => $identity ?: $this->properties['identity'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SyncMapPermissionContext Context for this SyncMapPermissionInstance + */ + protected function proxy(): SyncMapPermissionContext + { + if (!$this->context) { + $this->context = new SyncMapPermissionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['mapSid'], + $this->solution['identity'] + ); + } + + return $this->context; + } + + /** + * Delete the SyncMapPermissionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SyncMapPermissionInstance + * + * @return SyncMapPermissionInstance Fetched SyncMapPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncMapPermissionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SyncMapPermissionInstance + * + * @param bool $read Whether the identity can read the Sync Map and its Items. Default value is `false`. + * @param bool $write Whether the identity can create, update, and delete Items in the Sync Map. Default value is `false`. + * @param bool $manage Whether the identity can delete the Sync Map. Default value is `false`. + * @return SyncMapPermissionInstance Updated SyncMapPermissionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(bool $read, bool $write, bool $manage): SyncMapPermissionInstance + { + + return $this->proxy()->update($read, $write, $manage); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.SyncMapPermissionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionList.php b/app/api/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionList.php new file mode 100755 index 0000000..85b6cb7 --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionList.php @@ -0,0 +1,175 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'mapSid' => + $mapSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Maps/' . \rawurlencode($mapSid) + .'/Permissions'; + } + + /** + * Reads SyncMapPermissionInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return SyncMapPermissionInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams SyncMapPermissionInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SyncMapPermissionInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return SyncMapPermissionPage Page of SyncMapPermissionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SyncMapPermissionPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SyncMapPermissionPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SyncMapPermissionInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SyncMapPermissionPage Page of SyncMapPermissionInstance + */ + public function getPage(string $targetUrl): SyncMapPermissionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SyncMapPermissionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SyncMapPermissionContext + * + * @param string $identity The application-defined string that uniquely identifies the User's Sync Map Permission resource to delete. + */ + public function getContext( + string $identity + + ): SyncMapPermissionContext + { + return new SyncMapPermissionContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['mapSid'], + $identity + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.SyncMapPermissionList]'; + } +} diff --git a/app/api/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionPage.php b/app/api/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionPage.php new file mode 100755 index 0000000..e737356 --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/SyncMap/SyncMapPermissionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SyncMapPermissionInstance \Twilio\Rest\Sync\V1\Service\SyncMap\SyncMapPermissionInstance + */ + public function buildInstance(array $payload): SyncMapPermissionInstance + { + return new SyncMapPermissionInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['mapSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.SyncMapPermissionPage]'; + } +} diff --git a/app/api/Twilio/Rest/Sync/V1/Service/SyncMapContext.php b/app/api/Twilio/Rest/Sync/V1/Service/SyncMapContext.php new file mode 100755 index 0000000..86e298d --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/SyncMapContext.php @@ -0,0 +1,211 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Maps/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the SyncMapInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the SyncMapInstance + * + * @return SyncMapInstance Fetched SyncMapInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncMapInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new SyncMapInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the SyncMapInstance + * + * @param array|Options $options Optional Arguments + * @return SyncMapInstance Updated SyncMapInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SyncMapInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Ttl' => + $options['ttl'], + 'CollectionTtl' => + $options['collectionTtl'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new SyncMapInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the syncMapItems + */ + protected function getSyncMapItems(): SyncMapItemList + { + if (!$this->_syncMapItems) { + $this->_syncMapItems = new SyncMapItemList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_syncMapItems; + } + + /** + * Access the syncMapPermissions + */ + protected function getSyncMapPermissions(): SyncMapPermissionList + { + if (!$this->_syncMapPermissions) { + $this->_syncMapPermissions = new SyncMapPermissionList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_syncMapPermissions; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.SyncMapContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Sync/V1/Service/SyncMapInstance.php b/app/api/Twilio/Rest/Sync/V1/Service/SyncMapInstance.php new file mode 100755 index 0000000..84c0834 --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/SyncMapInstance.php @@ -0,0 +1,185 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + 'revision' => Values::array_get($payload, 'revision'), + 'dateExpires' => Deserialize::dateTime(Values::array_get($payload, 'date_expires')), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'createdBy' => Values::array_get($payload, 'created_by'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SyncMapContext Context for this SyncMapInstance + */ + protected function proxy(): SyncMapContext + { + if (!$this->context) { + $this->context = new SyncMapContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the SyncMapInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SyncMapInstance + * + * @return SyncMapInstance Fetched SyncMapInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncMapInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SyncMapInstance + * + * @param array|Options $options Optional Arguments + * @return SyncMapInstance Updated SyncMapInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SyncMapInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the syncMapItems + */ + protected function getSyncMapItems(): SyncMapItemList + { + return $this->proxy()->syncMapItems; + } + + /** + * Access the syncMapPermissions + */ + protected function getSyncMapPermissions(): SyncMapPermissionList + { + return $this->proxy()->syncMapPermissions; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.SyncMapInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Sync/V1/Service/SyncMapList.php b/app/api/Twilio/Rest/Sync/V1/Service/SyncMapList.php new file mode 100755 index 0000000..0d516ff --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/SyncMapList.php @@ -0,0 +1,201 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Maps'; + } + + /** + * Create the SyncMapInstance + * + * @param array|Options $options Optional Arguments + * @return SyncMapInstance Created SyncMapInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): SyncMapInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + 'Ttl' => + $options['ttl'], + 'CollectionTtl' => + $options['collectionTtl'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new SyncMapInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads SyncMapInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return SyncMapInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams SyncMapInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SyncMapInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return SyncMapPage Page of SyncMapInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SyncMapPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SyncMapPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SyncMapInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SyncMapPage Page of SyncMapInstance + */ + public function getPage(string $targetUrl): SyncMapPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SyncMapPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SyncMapContext + * + * @param string $sid The SID of the Sync Map resource to delete. Can be the Sync Map's `sid` or its `unique_name`. + */ + public function getContext( + string $sid + + ): SyncMapContext + { + return new SyncMapContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.SyncMapList]'; + } +} diff --git a/app/api/Twilio/Rest/Sync/V1/Service/SyncMapOptions.php b/app/api/Twilio/Rest/Sync/V1/Service/SyncMapOptions.php new file mode 100755 index 0000000..2469f12 --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/SyncMapOptions.php @@ -0,0 +1,188 @@ +options['uniqueName'] = $uniqueName; + $this->options['ttl'] = $ttl; + $this->options['collectionTtl'] = $collectionTtl; + } + + /** + * An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used as an alternative to the `sid` in the URL path to address the resource. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * An alias for `collection_ttl`. If both parameters are provided, this value is ignored. + * + * @param int $ttl An alias for `collection_ttl`. If both parameters are provided, this value is ignored. + * @return $this Fluent Builder + */ + public function setTtl(int $ttl): self + { + $this->options['ttl'] = $ttl; + return $this; + } + + /** + * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Map expires (time-to-live) and is deleted. + * + * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Map expires (time-to-live) and is deleted. + * @return $this Fluent Builder + */ + public function setCollectionTtl(int $collectionTtl): self + { + $this->options['collectionTtl'] = $collectionTtl; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Sync.V1.CreateSyncMapOptions ' . $options . ']'; + } +} + + + + +class UpdateSyncMapOptions extends Options + { + /** + * @param int $ttl An alias for `collection_ttl`. If both parameters are provided, this value is ignored. + * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Map expires (time-to-live) and is deleted. + */ + public function __construct( + + int $ttl = Values::INT_NONE, + int $collectionTtl = Values::INT_NONE + + ) { + $this->options['ttl'] = $ttl; + $this->options['collectionTtl'] = $collectionTtl; + } + + /** + * An alias for `collection_ttl`. If both parameters are provided, this value is ignored. + * + * @param int $ttl An alias for `collection_ttl`. If both parameters are provided, this value is ignored. + * @return $this Fluent Builder + */ + public function setTtl(int $ttl): self + { + $this->options['ttl'] = $ttl; + return $this; + } + + /** + * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Map expires (time-to-live) and is deleted. + * + * @param int $collectionTtl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Sync Map expires (time-to-live) and is deleted. + * @return $this Fluent Builder + */ + public function setCollectionTtl(int $collectionTtl): self + { + $this->options['collectionTtl'] = $collectionTtl; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Sync.V1.UpdateSyncMapOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Sync/V1/Service/SyncMapPage.php b/app/api/Twilio/Rest/Sync/V1/Service/SyncMapPage.php new file mode 100755 index 0000000..e8049fa --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/SyncMapPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SyncMapInstance \Twilio\Rest\Sync\V1\Service\SyncMapInstance + */ + public function buildInstance(array $payload): SyncMapInstance + { + return new SyncMapInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.SyncMapPage]'; + } +} diff --git a/app/api/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessageInstance.php b/app/api/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessageInstance.php new file mode 100755 index 0000000..6eb22bc --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessageInstance.php @@ -0,0 +1,85 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'data' => Values::array_get($payload, 'data'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'streamSid' => $streamSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.StreamMessageInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessageList.php b/app/api/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessageList.php new file mode 100755 index 0000000..dc7b408 --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessageList.php @@ -0,0 +1,93 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'streamSid' => + $streamSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Streams/' . \rawurlencode($streamSid) + .'/Messages'; + } + + /** + * Create the StreamMessageInstance + * + * @param array $data A JSON string that represents an arbitrary, schema-less object that makes up the Stream Message body. Can be up to 4 KiB in length. + * @return StreamMessageInstance Created StreamMessageInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $data): StreamMessageInstance + { + + $data = Values::of([ + 'Data' => + Serialize::jsonObject($data), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new StreamMessageInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['streamSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.StreamMessageList]'; + } +} diff --git a/app/api/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessagePage.php b/app/api/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessagePage.php new file mode 100755 index 0000000..2839d50 --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/SyncStream/StreamMessagePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return StreamMessageInstance \Twilio\Rest\Sync\V1\Service\SyncStream\StreamMessageInstance + */ + public function buildInstance(array $payload): StreamMessageInstance + { + return new StreamMessageInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['streamSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.StreamMessagePage]'; + } +} diff --git a/app/api/Twilio/Rest/Sync/V1/Service/SyncStreamContext.php b/app/api/Twilio/Rest/Sync/V1/Service/SyncStreamContext.php new file mode 100755 index 0000000..d2ba6f4 --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/SyncStreamContext.php @@ -0,0 +1,189 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Streams/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the SyncStreamInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the SyncStreamInstance + * + * @return SyncStreamInstance Fetched SyncStreamInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncStreamInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new SyncStreamInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the SyncStreamInstance + * + * @param array|Options $options Optional Arguments + * @return SyncStreamInstance Updated SyncStreamInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SyncStreamInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Ttl' => + $options['ttl'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new SyncStreamInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the streamMessages + */ + protected function getStreamMessages(): StreamMessageList + { + if (!$this->_streamMessages) { + $this->_streamMessages = new StreamMessageList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_streamMessages; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.SyncStreamContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Sync/V1/Service/SyncStreamInstance.php b/app/api/Twilio/Rest/Sync/V1/Service/SyncStreamInstance.php new file mode 100755 index 0000000..f8ed299 --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/SyncStreamInstance.php @@ -0,0 +1,174 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + 'dateExpires' => Deserialize::dateTime(Values::array_get($payload, 'date_expires')), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'createdBy' => Values::array_get($payload, 'created_by'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SyncStreamContext Context for this SyncStreamInstance + */ + protected function proxy(): SyncStreamContext + { + if (!$this->context) { + $this->context = new SyncStreamContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the SyncStreamInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SyncStreamInstance + * + * @return SyncStreamInstance Fetched SyncStreamInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SyncStreamInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SyncStreamInstance + * + * @param array|Options $options Optional Arguments + * @return SyncStreamInstance Updated SyncStreamInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SyncStreamInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the streamMessages + */ + protected function getStreamMessages(): StreamMessageList + { + return $this->proxy()->streamMessages; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.SyncStreamInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Sync/V1/Service/SyncStreamList.php b/app/api/Twilio/Rest/Sync/V1/Service/SyncStreamList.php new file mode 100755 index 0000000..c1c2653 --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/SyncStreamList.php @@ -0,0 +1,199 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Streams'; + } + + /** + * Create the SyncStreamInstance + * + * @param array|Options $options Optional Arguments + * @return SyncStreamInstance Created SyncStreamInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): SyncStreamInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + 'Ttl' => + $options['ttl'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new SyncStreamInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads SyncStreamInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return SyncStreamInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams SyncStreamInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SyncStreamInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return SyncStreamPage Page of SyncStreamInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SyncStreamPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SyncStreamPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SyncStreamInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SyncStreamPage Page of SyncStreamInstance + */ + public function getPage(string $targetUrl): SyncStreamPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SyncStreamPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SyncStreamContext + * + * @param string $sid The SID of the Stream resource to delete. + */ + public function getContext( + string $sid + + ): SyncStreamContext + { + return new SyncStreamContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.SyncStreamList]'; + } +} diff --git a/app/api/Twilio/Rest/Sync/V1/Service/SyncStreamOptions.php b/app/api/Twilio/Rest/Sync/V1/Service/SyncStreamOptions.php new file mode 100755 index 0000000..ee7d99a --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/SyncStreamOptions.php @@ -0,0 +1,153 @@ +options['uniqueName'] = $uniqueName; + $this->options['ttl'] = $ttl; + } + + /** + * An application-defined string that uniquely identifies the resource. This value must be unique within its Service and it can be up to 320 characters long. The `unique_name` value can be used as an alternative to the `sid` in the URL path to address the resource. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. This value must be unique within its Service and it can be up to 320 characters long. The `unique_name` value can be used as an alternative to the `sid` in the URL path to address the resource. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Stream expires and is deleted (time-to-live). + * + * @param int $ttl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Stream expires and is deleted (time-to-live). + * @return $this Fluent Builder + */ + public function setTtl(int $ttl): self + { + $this->options['ttl'] = $ttl; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Sync.V1.CreateSyncStreamOptions ' . $options . ']'; + } +} + + + + +class UpdateSyncStreamOptions extends Options + { + /** + * @param int $ttl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Stream expires and is deleted (time-to-live). + */ + public function __construct( + + int $ttl = Values::INT_NONE + + ) { + $this->options['ttl'] = $ttl; + } + + /** + * How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Stream expires and is deleted (time-to-live). + * + * @param int $ttl How long, [in seconds](https://www.twilio.com/docs/sync/limits#sync-payload-limits), before the Stream expires and is deleted (time-to-live). + * @return $this Fluent Builder + */ + public function setTtl(int $ttl): self + { + $this->options['ttl'] = $ttl; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Sync.V1.UpdateSyncStreamOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Sync/V1/Service/SyncStreamPage.php b/app/api/Twilio/Rest/Sync/V1/Service/SyncStreamPage.php new file mode 100755 index 0000000..b08b9bb --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/Service/SyncStreamPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SyncStreamInstance \Twilio\Rest\Sync\V1\Service\SyncStreamInstance + */ + public function buildInstance(array $payload): SyncStreamInstance + { + return new SyncStreamInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.SyncStreamPage]'; + } +} diff --git a/app/api/Twilio/Rest/Sync/V1/ServiceContext.php b/app/api/Twilio/Rest/Sync/V1/ServiceContext.php new file mode 100755 index 0000000..08edf7a --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/ServiceContext.php @@ -0,0 +1,251 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'WebhookUrl' => + $options['webhookUrl'], + 'FriendlyName' => + $options['friendlyName'], + 'ReachabilityWebhooksEnabled' => + Serialize::booleanToString($options['reachabilityWebhooksEnabled']), + 'AclEnabled' => + Serialize::booleanToString($options['aclEnabled']), + 'ReachabilityDebouncingEnabled' => + Serialize::booleanToString($options['reachabilityDebouncingEnabled']), + 'ReachabilityDebouncingWindow' => + $options['reachabilityDebouncingWindow'], + 'WebhooksFromRestEnabled' => + Serialize::booleanToString($options['webhooksFromRestEnabled']), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the syncLists + */ + protected function getSyncLists(): SyncListList + { + if (!$this->_syncLists) { + $this->_syncLists = new SyncListList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_syncLists; + } + + /** + * Access the syncStreams + */ + protected function getSyncStreams(): SyncStreamList + { + if (!$this->_syncStreams) { + $this->_syncStreams = new SyncStreamList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_syncStreams; + } + + /** + * Access the documents + */ + protected function getDocuments(): DocumentList + { + if (!$this->_documents) { + $this->_documents = new DocumentList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_documents; + } + + /** + * Access the syncMaps + */ + protected function getSyncMaps(): SyncMapList + { + if (!$this->_syncMaps) { + $this->_syncMaps = new SyncMapList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_syncMaps; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.ServiceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Sync/V1/ServiceInstance.php b/app/api/Twilio/Rest/Sync/V1/ServiceInstance.php new file mode 100755 index 0000000..cb9fdaa --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/ServiceInstance.php @@ -0,0 +1,209 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'webhookUrl' => Values::array_get($payload, 'webhook_url'), + 'webhooksFromRestEnabled' => Values::array_get($payload, 'webhooks_from_rest_enabled'), + 'reachabilityWebhooksEnabled' => Values::array_get($payload, 'reachability_webhooks_enabled'), + 'aclEnabled' => Values::array_get($payload, 'acl_enabled'), + 'reachabilityDebouncingEnabled' => Values::array_get($payload, 'reachability_debouncing_enabled'), + 'reachabilityDebouncingWindow' => Values::array_get($payload, 'reachability_debouncing_window'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ServiceContext Context for this ServiceInstance + */ + protected function proxy(): ServiceContext + { + if (!$this->context) { + $this->context = new ServiceContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the syncLists + */ + protected function getSyncLists(): SyncListList + { + return $this->proxy()->syncLists; + } + + /** + * Access the syncStreams + */ + protected function getSyncStreams(): SyncStreamList + { + return $this->proxy()->syncStreams; + } + + /** + * Access the documents + */ + protected function getDocuments(): DocumentList + { + return $this->proxy()->documents; + } + + /** + * Access the syncMaps + */ + protected function getSyncMaps(): SyncMapList + { + return $this->proxy()->syncMaps; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Sync.V1.ServiceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Sync/V1/ServiceList.php b/app/api/Twilio/Rest/Sync/V1/ServiceList.php new file mode 100755 index 0000000..43fc792 --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/ServiceList.php @@ -0,0 +1,202 @@ +solution = [ + ]; + + $this->uri = '/Services'; + } + + /** + * Create the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Created ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): ServiceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'WebhookUrl' => + $options['webhookUrl'], + 'ReachabilityWebhooksEnabled' => + Serialize::booleanToString($options['reachabilityWebhooksEnabled']), + 'AclEnabled' => + Serialize::booleanToString($options['aclEnabled']), + 'ReachabilityDebouncingEnabled' => + Serialize::booleanToString($options['reachabilityDebouncingEnabled']), + 'ReachabilityDebouncingWindow' => + $options['reachabilityDebouncingWindow'], + 'WebhooksFromRestEnabled' => + Serialize::booleanToString($options['webhooksFromRestEnabled']), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new ServiceInstance( + $this->version, + $payload + ); + } + + + /** + * Reads ServiceInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ServiceInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ServiceInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ServiceInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ServicePage Page of ServiceInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ServicePage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ServicePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ServiceInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ServicePage Page of ServiceInstance + */ + public function getPage(string $targetUrl): ServicePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ServicePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ServiceContext + * + * @param string $sid The SID of the Service resource to delete. + */ + public function getContext( + string $sid + + ): ServiceContext + { + return new ServiceContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.ServiceList]'; + } +} diff --git a/app/api/Twilio/Rest/Sync/V1/ServiceOptions.php b/app/api/Twilio/Rest/Sync/V1/ServiceOptions.php new file mode 100755 index 0000000..e9d0938 --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/ServiceOptions.php @@ -0,0 +1,350 @@ +options['friendlyName'] = $friendlyName; + $this->options['webhookUrl'] = $webhookUrl; + $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; + $this->options['aclEnabled'] = $aclEnabled; + $this->options['reachabilityDebouncingEnabled'] = $reachabilityDebouncingEnabled; + $this->options['reachabilityDebouncingWindow'] = $reachabilityDebouncingWindow; + $this->options['webhooksFromRestEnabled'] = $webhooksFromRestEnabled; + } + + /** + * A string that you assign to describe the resource. + * + * @param string $friendlyName A string that you assign to describe the resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The URL we should call when Sync objects are manipulated. + * + * @param string $webhookUrl The URL we should call when Sync objects are manipulated. + * @return $this Fluent Builder + */ + public function setWebhookUrl(string $webhookUrl): self + { + $this->options['webhookUrl'] = $webhookUrl; + return $this; + } + + /** + * Whether the service instance should call `webhook_url` when client endpoints connect to Sync. The default is `false`. + * + * @param bool $reachabilityWebhooksEnabled Whether the service instance should call `webhook_url` when client endpoints connect to Sync. The default is `false`. + * @return $this Fluent Builder + */ + public function setReachabilityWebhooksEnabled(bool $reachabilityWebhooksEnabled): self + { + $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; + return $this; + } + + /** + * Whether token identities in the Service must be granted access to Sync objects by using the [Permissions](https://www.twilio.com/docs/sync/api/sync-permissions) resource. + * + * @param bool $aclEnabled Whether token identities in the Service must be granted access to Sync objects by using the [Permissions](https://www.twilio.com/docs/sync/api/sync-permissions) resource. + * @return $this Fluent Builder + */ + public function setAclEnabled(bool $aclEnabled): self + { + $this->options['aclEnabled'] = $aclEnabled; + return $this; + } + + /** + * Whether every `endpoint_disconnected` event should occur after a configurable delay. The default is `false`, where the `endpoint_disconnected` event occurs immediately after disconnection. When `true`, intervening reconnections can prevent the `endpoint_disconnected` event. + * + * @param bool $reachabilityDebouncingEnabled Whether every `endpoint_disconnected` event should occur after a configurable delay. The default is `false`, where the `endpoint_disconnected` event occurs immediately after disconnection. When `true`, intervening reconnections can prevent the `endpoint_disconnected` event. + * @return $this Fluent Builder + */ + public function setReachabilityDebouncingEnabled(bool $reachabilityDebouncingEnabled): self + { + $this->options['reachabilityDebouncingEnabled'] = $reachabilityDebouncingEnabled; + return $this; + } + + /** + * The reachability event delay in milliseconds if `reachability_debouncing_enabled` = `true`. Must be between 1,000 and 30,000 and defaults to 5,000. This is the number of milliseconds after the last running client disconnects, and a Sync identity is declared offline, before the `webhook_url` is called if all endpoints remain offline. A reconnection from the same identity by any endpoint during this interval prevents the call to `webhook_url`. + * + * @param int $reachabilityDebouncingWindow The reachability event delay in milliseconds if `reachability_debouncing_enabled` = `true`. Must be between 1,000 and 30,000 and defaults to 5,000. This is the number of milliseconds after the last running client disconnects, and a Sync identity is declared offline, before the `webhook_url` is called if all endpoints remain offline. A reconnection from the same identity by any endpoint during this interval prevents the call to `webhook_url`. + * @return $this Fluent Builder + */ + public function setReachabilityDebouncingWindow(int $reachabilityDebouncingWindow): self + { + $this->options['reachabilityDebouncingWindow'] = $reachabilityDebouncingWindow; + return $this; + } + + /** + * Whether the Service instance should call `webhook_url` when the REST API is used to update Sync objects. The default is `false`. + * + * @param bool $webhooksFromRestEnabled Whether the Service instance should call `webhook_url` when the REST API is used to update Sync objects. The default is `false`. + * @return $this Fluent Builder + */ + public function setWebhooksFromRestEnabled(bool $webhooksFromRestEnabled): self + { + $this->options['webhooksFromRestEnabled'] = $webhooksFromRestEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Sync.V1.CreateServiceOptions ' . $options . ']'; + } +} + + + + +class UpdateServiceOptions extends Options + { + /** + * @param string $webhookUrl The URL we should call when Sync objects are manipulated. + * @param string $friendlyName A string that you assign to describe the resource. + * @param bool $reachabilityWebhooksEnabled Whether the service instance should call `webhook_url` when client endpoints connect to Sync. The default is `false`. + * @param bool $aclEnabled Whether token identities in the Service must be granted access to Sync objects by using the [Permissions](https://www.twilio.com/docs/sync/api/sync-permissions) resource. + * @param bool $reachabilityDebouncingEnabled Whether every `endpoint_disconnected` event should occur after a configurable delay. The default is `false`, where the `endpoint_disconnected` event occurs immediately after disconnection. When `true`, intervening reconnections can prevent the `endpoint_disconnected` event. + * @param int $reachabilityDebouncingWindow The reachability event delay in milliseconds if `reachability_debouncing_enabled` = `true`. Must be between 1,000 and 30,000 and defaults to 5,000. This is the number of milliseconds after the last running client disconnects, and a Sync identity is declared offline, before the webhook is called if all endpoints remain offline. A reconnection from the same identity by any endpoint during this interval prevents the webhook from being called. + * @param bool $webhooksFromRestEnabled Whether the Service instance should call `webhook_url` when the REST API is used to update Sync objects. The default is `false`. + */ + public function __construct( + + string $webhookUrl = Values::NONE, + string $friendlyName = Values::NONE, + bool $reachabilityWebhooksEnabled = Values::BOOL_NONE, + bool $aclEnabled = Values::BOOL_NONE, + bool $reachabilityDebouncingEnabled = Values::BOOL_NONE, + int $reachabilityDebouncingWindow = Values::INT_NONE, + bool $webhooksFromRestEnabled = Values::BOOL_NONE + + ) { + $this->options['webhookUrl'] = $webhookUrl; + $this->options['friendlyName'] = $friendlyName; + $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; + $this->options['aclEnabled'] = $aclEnabled; + $this->options['reachabilityDebouncingEnabled'] = $reachabilityDebouncingEnabled; + $this->options['reachabilityDebouncingWindow'] = $reachabilityDebouncingWindow; + $this->options['webhooksFromRestEnabled'] = $webhooksFromRestEnabled; + } + + /** + * The URL we should call when Sync objects are manipulated. + * + * @param string $webhookUrl The URL we should call when Sync objects are manipulated. + * @return $this Fluent Builder + */ + public function setWebhookUrl(string $webhookUrl): self + { + $this->options['webhookUrl'] = $webhookUrl; + return $this; + } + + /** + * A string that you assign to describe the resource. + * + * @param string $friendlyName A string that you assign to describe the resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Whether the service instance should call `webhook_url` when client endpoints connect to Sync. The default is `false`. + * + * @param bool $reachabilityWebhooksEnabled Whether the service instance should call `webhook_url` when client endpoints connect to Sync. The default is `false`. + * @return $this Fluent Builder + */ + public function setReachabilityWebhooksEnabled(bool $reachabilityWebhooksEnabled): self + { + $this->options['reachabilityWebhooksEnabled'] = $reachabilityWebhooksEnabled; + return $this; + } + + /** + * Whether token identities in the Service must be granted access to Sync objects by using the [Permissions](https://www.twilio.com/docs/sync/api/sync-permissions) resource. + * + * @param bool $aclEnabled Whether token identities in the Service must be granted access to Sync objects by using the [Permissions](https://www.twilio.com/docs/sync/api/sync-permissions) resource. + * @return $this Fluent Builder + */ + public function setAclEnabled(bool $aclEnabled): self + { + $this->options['aclEnabled'] = $aclEnabled; + return $this; + } + + /** + * Whether every `endpoint_disconnected` event should occur after a configurable delay. The default is `false`, where the `endpoint_disconnected` event occurs immediately after disconnection. When `true`, intervening reconnections can prevent the `endpoint_disconnected` event. + * + * @param bool $reachabilityDebouncingEnabled Whether every `endpoint_disconnected` event should occur after a configurable delay. The default is `false`, where the `endpoint_disconnected` event occurs immediately after disconnection. When `true`, intervening reconnections can prevent the `endpoint_disconnected` event. + * @return $this Fluent Builder + */ + public function setReachabilityDebouncingEnabled(bool $reachabilityDebouncingEnabled): self + { + $this->options['reachabilityDebouncingEnabled'] = $reachabilityDebouncingEnabled; + return $this; + } + + /** + * The reachability event delay in milliseconds if `reachability_debouncing_enabled` = `true`. Must be between 1,000 and 30,000 and defaults to 5,000. This is the number of milliseconds after the last running client disconnects, and a Sync identity is declared offline, before the webhook is called if all endpoints remain offline. A reconnection from the same identity by any endpoint during this interval prevents the webhook from being called. + * + * @param int $reachabilityDebouncingWindow The reachability event delay in milliseconds if `reachability_debouncing_enabled` = `true`. Must be between 1,000 and 30,000 and defaults to 5,000. This is the number of milliseconds after the last running client disconnects, and a Sync identity is declared offline, before the webhook is called if all endpoints remain offline. A reconnection from the same identity by any endpoint during this interval prevents the webhook from being called. + * @return $this Fluent Builder + */ + public function setReachabilityDebouncingWindow(int $reachabilityDebouncingWindow): self + { + $this->options['reachabilityDebouncingWindow'] = $reachabilityDebouncingWindow; + return $this; + } + + /** + * Whether the Service instance should call `webhook_url` when the REST API is used to update Sync objects. The default is `false`. + * + * @param bool $webhooksFromRestEnabled Whether the Service instance should call `webhook_url` when the REST API is used to update Sync objects. The default is `false`. + * @return $this Fluent Builder + */ + public function setWebhooksFromRestEnabled(bool $webhooksFromRestEnabled): self + { + $this->options['webhooksFromRestEnabled'] = $webhooksFromRestEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Sync.V1.UpdateServiceOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Sync/V1/ServicePage.php b/app/api/Twilio/Rest/Sync/V1/ServicePage.php new file mode 100755 index 0000000..8e7ca91 --- /dev/null +++ b/app/api/Twilio/Rest/Sync/V1/ServicePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ServiceInstance \Twilio\Rest\Sync\V1\ServiceInstance + */ + public function buildInstance(array $payload): ServiceInstance + { + return new ServiceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Sync.V1.ServicePage]'; + } +} diff --git a/app/api/Twilio/Rest/SyncBase.php b/app/api/Twilio/Rest/SyncBase.php new file mode 100755 index 0000000..ec071ba --- /dev/null +++ b/app/api/Twilio/Rest/SyncBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://sync.twilio.com'; + } + + + /** + * @return V1 Version v1 of sync + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Sync]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter.php b/app/api/Twilio/Rest/Taskrouter.php new file mode 100755 index 0000000..f400c0d --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter.php @@ -0,0 +1,24 @@ +workspaces instead. + */ + protected function getWorkspaces(): \Twilio\Rest\Taskrouter\V1\WorkspaceList { + echo "workspaces is deprecated. Use v1->workspaces instead."; + return $this->v1->workspaces; + } + + /** + * @deprecated Use v1->workspaces(\$sid) instead. + * @param string $sid The SID of the resource to fetch + */ + protected function contextWorkspaces(string $sid): \Twilio\Rest\Taskrouter\V1\WorkspaceContext { + echo "workspaces(\$sid) is deprecated. Use v1->workspaces(\$sid) instead."; + return $this->v1->workspaces($sid); + } +} \ No newline at end of file diff --git a/app/api/Twilio/Rest/Taskrouter/V1.php b/app/api/Twilio/Rest/Taskrouter/V1.php new file mode 100755 index 0000000..0deda2d --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1.php @@ -0,0 +1,95 @@ +version = 'v1'; + } + + protected function getWorkspaces(): WorkspaceList + { + if (!$this->_workspaces) { + $this->_workspaces = new WorkspaceList($this); + } + return $this->_workspaces; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/ActivityContext.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/ActivityContext.php new file mode 100755 index 0000000..213dd36 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/ActivityContext.php @@ -0,0 +1,130 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Activities/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ActivityInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the ActivityInstance + * + * @return ActivityInstance Fetched ActivityInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ActivityInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ActivityInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ActivityInstance + * + * @param array|Options $options Optional Arguments + * @return ActivityInstance Updated ActivityInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ActivityInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new ActivityInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.ActivityContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/ActivityInstance.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/ActivityInstance.php new file mode 100755 index 0000000..783b337 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/ActivityInstance.php @@ -0,0 +1,160 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'available' => Values::array_get($payload, 'available'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'sid' => Values::array_get($payload, 'sid'), + 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['workspaceSid' => $workspaceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ActivityContext Context for this ActivityInstance + */ + protected function proxy(): ActivityContext + { + if (!$this->context) { + $this->context = new ActivityContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ActivityInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ActivityInstance + * + * @return ActivityInstance Fetched ActivityInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ActivityInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ActivityInstance + * + * @param array|Options $options Optional Arguments + * @return ActivityInstance Updated ActivityInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ActivityInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.ActivityInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/ActivityList.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/ActivityList.php new file mode 100755 index 0000000..8b7b021 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/ActivityList.php @@ -0,0 +1,209 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Activities'; + } + + /** + * Create the ActivityInstance + * + * @param string $friendlyName A descriptive string that you create to describe the Activity resource. It can be up to 64 characters long. These names are used to calculate and expose statistics about Workers, and provide visibility into the state of each Worker. Examples of friendly names include: `on-call`, `break`, and `email`. + * @param array|Options $options Optional Arguments + * @return ActivityInstance Created ActivityInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, array $options = []): ActivityInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Available' => + Serialize::booleanToString($options['available']), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new ActivityInstance( + $this->version, + $payload, + $this->solution['workspaceSid'] + ); + } + + + /** + * Reads ActivityInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ActivityInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams ActivityInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ActivityInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ActivityPage Page of ActivityInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ActivityPage + { + $options = new Values($options); + + $params = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'Available' => + $options['available'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ActivityPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ActivityInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ActivityPage Page of ActivityInstance + */ + public function getPage(string $targetUrl): ActivityPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ActivityPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ActivityContext + * + * @param string $sid The SID of the Activity resource to delete. + */ + public function getContext( + string $sid + + ): ActivityContext + { + return new ActivityContext( + $this->version, + $this->solution['workspaceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.ActivityList]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/ActivityOptions.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/ActivityOptions.php new file mode 100755 index 0000000..05924a8 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/ActivityOptions.php @@ -0,0 +1,202 @@ +options['available'] = $available; + } + + /** + * Whether the Worker should be eligible to receive a Task when it occupies the Activity. A value of `true`, `1`, or `yes` specifies the Activity is available. All other values specify that it is not. The value cannot be changed after the Activity is created. + * + * @param bool $available Whether the Worker should be eligible to receive a Task when it occupies the Activity. A value of `true`, `1`, or `yes` specifies the Activity is available. All other values specify that it is not. The value cannot be changed after the Activity is created. + * @return $this Fluent Builder + */ + public function setAvailable(bool $available): self + { + $this->options['available'] = $available; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.CreateActivityOptions ' . $options . ']'; + } +} + + + +class ReadActivityOptions extends Options + { + /** + * @param string $friendlyName The `friendly_name` of the Activity resources to read. + * @param string $available Whether return only Activity resources that are available or unavailable. A value of `true` returns only available activities. Values of '1' or `yes` also indicate `true`. All other values represent `false` and return activities that are unavailable. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $available = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['available'] = $available; + } + + /** + * The `friendly_name` of the Activity resources to read. + * + * @param string $friendlyName The `friendly_name` of the Activity resources to read. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Whether return only Activity resources that are available or unavailable. A value of `true` returns only available activities. Values of '1' or `yes` also indicate `true`. All other values represent `false` and return activities that are unavailable. + * + * @param string $available Whether return only Activity resources that are available or unavailable. A value of `true` returns only available activities. Values of '1' or `yes` also indicate `true`. All other values represent `false` and return activities that are unavailable. + * @return $this Fluent Builder + */ + public function setAvailable(string $available): self + { + $this->options['available'] = $available; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.ReadActivityOptions ' . $options . ']'; + } +} + +class UpdateActivityOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the Activity resource. It can be up to 64 characters long. These names are used to calculate and expose statistics about Workers, and provide visibility into the state of each Worker. Examples of friendly names include: `on-call`, `break`, and `email`. + */ + public function __construct( + + string $friendlyName = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + } + + /** + * A descriptive string that you create to describe the Activity resource. It can be up to 64 characters long. These names are used to calculate and expose statistics about Workers, and provide visibility into the state of each Worker. Examples of friendly names include: `on-call`, `break`, and `email`. + * + * @param string $friendlyName A descriptive string that you create to describe the Activity resource. It can be up to 64 characters long. These names are used to calculate and expose statistics about Workers, and provide visibility into the state of each Worker. Examples of friendly names include: `on-call`, `break`, and `email`. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.UpdateActivityOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/ActivityPage.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/ActivityPage.php new file mode 100755 index 0000000..f2ca3cf --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/ActivityPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ActivityInstance \Twilio\Rest\Taskrouter\V1\Workspace\ActivityInstance + */ + public function buildInstance(array $payload): ActivityInstance + { + return new ActivityInstance($this->version, $payload, $this->solution['workspaceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.ActivityPage]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/EventContext.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/EventContext.php new file mode 100755 index 0000000..f01329a --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/EventContext.php @@ -0,0 +1,87 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Events/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the EventInstance + * + * @return EventInstance Fetched EventInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EventInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new EventInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.EventContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/EventInstance.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/EventInstance.php new file mode 100755 index 0000000..a2b36c6 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/EventInstance.php @@ -0,0 +1,150 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'actorSid' => Values::array_get($payload, 'actor_sid'), + 'actorType' => Values::array_get($payload, 'actor_type'), + 'actorUrl' => Values::array_get($payload, 'actor_url'), + 'description' => Values::array_get($payload, 'description'), + 'eventData' => Values::array_get($payload, 'event_data'), + 'eventDate' => Deserialize::dateTime(Values::array_get($payload, 'event_date')), + 'eventDateMs' => Values::array_get($payload, 'event_date_ms'), + 'eventType' => Values::array_get($payload, 'event_type'), + 'resourceSid' => Values::array_get($payload, 'resource_sid'), + 'resourceType' => Values::array_get($payload, 'resource_type'), + 'resourceUrl' => Values::array_get($payload, 'resource_url'), + 'sid' => Values::array_get($payload, 'sid'), + 'source' => Values::array_get($payload, 'source'), + 'sourceIpAddress' => Values::array_get($payload, 'source_ip_address'), + 'url' => Values::array_get($payload, 'url'), + 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), + ]; + + $this->solution = ['workspaceSid' => $workspaceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return EventContext Context for this EventInstance + */ + protected function proxy(): EventContext + { + if (!$this->context) { + $this->context = new EventContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the EventInstance + * + * @return EventInstance Fetched EventInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EventInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.EventInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/EventList.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/EventList.php new file mode 100755 index 0000000..f371426 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/EventList.php @@ -0,0 +1,196 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Events'; + } + + /** + * Reads EventInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return EventInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams EventInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of EventInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return EventPage Page of EventInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): EventPage + { + $options = new Values($options); + + $params = Values::of([ + 'EndDate' => + Serialize::iso8601DateTime($options['endDate']), + 'EventType' => + $options['eventType'], + 'Minutes' => + $options['minutes'], + 'ReservationSid' => + $options['reservationSid'], + 'StartDate' => + Serialize::iso8601DateTime($options['startDate']), + 'TaskQueueSid' => + $options['taskQueueSid'], + 'TaskSid' => + $options['taskSid'], + 'WorkerSid' => + $options['workerSid'], + 'WorkflowSid' => + $options['workflowSid'], + 'TaskChannel' => + $options['taskChannel'], + 'Sid' => + $options['sid'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new EventPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of EventInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return EventPage Page of EventInstance + */ + public function getPage(string $targetUrl): EventPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new EventPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a EventContext + * + * @param string $sid The SID of the Event resource to fetch. + */ + public function getContext( + string $sid + + ): EventContext + { + return new EventContext( + $this->version, + $this->solution['workspaceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.EventList]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/EventOptions.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/EventOptions.php new file mode 100755 index 0000000..ef9afd4 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/EventOptions.php @@ -0,0 +1,258 @@ +options['endDate'] = $endDate; + $this->options['eventType'] = $eventType; + $this->options['minutes'] = $minutes; + $this->options['reservationSid'] = $reservationSid; + $this->options['startDate'] = $startDate; + $this->options['taskQueueSid'] = $taskQueueSid; + $this->options['taskSid'] = $taskSid; + $this->options['workerSid'] = $workerSid; + $this->options['workflowSid'] = $workflowSid; + $this->options['taskChannel'] = $taskChannel; + $this->options['sid'] = $sid; + } + + /** + * Only include Events that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * + * @param \DateTime $endDate Only include Events that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * The type of Events to read. Returns only Events of the type specified. + * + * @param string $eventType The type of Events to read. Returns only Events of the type specified. + * @return $this Fluent Builder + */ + public function setEventType(string $eventType): self + { + $this->options['eventType'] = $eventType; + return $this; + } + + /** + * The period of events to read in minutes. Returns only Events that occurred since this many minutes in the past. The default is `15` minutes. Task Attributes for Events occuring more 43,200 minutes ago will be redacted. + * + * @param int $minutes The period of events to read in minutes. Returns only Events that occurred since this many minutes in the past. The default is `15` minutes. Task Attributes for Events occuring more 43,200 minutes ago will be redacted. + * @return $this Fluent Builder + */ + public function setMinutes(int $minutes): self + { + $this->options['minutes'] = $minutes; + return $this; + } + + /** + * The SID of the Reservation with the Events to read. Returns only Events that pertain to the specified Reservation. + * + * @param string $reservationSid The SID of the Reservation with the Events to read. Returns only Events that pertain to the specified Reservation. + * @return $this Fluent Builder + */ + public function setReservationSid(string $reservationSid): self + { + $this->options['reservationSid'] = $reservationSid; + return $this; + } + + /** + * Only include Events from on or after this date and time, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Task Attributes for Events older than 30 days will be redacted. + * + * @param \DateTime $startDate Only include Events from on or after this date and time, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. Task Attributes for Events older than 30 days will be redacted. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * The SID of the TaskQueue with the Events to read. Returns only the Events that pertain to the specified TaskQueue. + * + * @param string $taskQueueSid The SID of the TaskQueue with the Events to read. Returns only the Events that pertain to the specified TaskQueue. + * @return $this Fluent Builder + */ + public function setTaskQueueSid(string $taskQueueSid): self + { + $this->options['taskQueueSid'] = $taskQueueSid; + return $this; + } + + /** + * The SID of the Task with the Events to read. Returns only the Events that pertain to the specified Task. + * + * @param string $taskSid The SID of the Task with the Events to read. Returns only the Events that pertain to the specified Task. + * @return $this Fluent Builder + */ + public function setTaskSid(string $taskSid): self + { + $this->options['taskSid'] = $taskSid; + return $this; + } + + /** + * The SID of the Worker with the Events to read. Returns only the Events that pertain to the specified Worker. + * + * @param string $workerSid The SID of the Worker with the Events to read. Returns only the Events that pertain to the specified Worker. + * @return $this Fluent Builder + */ + public function setWorkerSid(string $workerSid): self + { + $this->options['workerSid'] = $workerSid; + return $this; + } + + /** + * The SID of the Workflow with the Events to read. Returns only the Events that pertain to the specified Workflow. + * + * @param string $workflowSid The SID of the Workflow with the Events to read. Returns only the Events that pertain to the specified Workflow. + * @return $this Fluent Builder + */ + public function setWorkflowSid(string $workflowSid): self + { + $this->options['workflowSid'] = $workflowSid; + return $this; + } + + /** + * The TaskChannel with the Events to read. Returns only the Events that pertain to the specified TaskChannel. + * + * @param string $taskChannel The TaskChannel with the Events to read. Returns only the Events that pertain to the specified TaskChannel. + * @return $this Fluent Builder + */ + public function setTaskChannel(string $taskChannel): self + { + $this->options['taskChannel'] = $taskChannel; + return $this; + } + + /** + * The SID of the Event resource to read. + * + * @param string $sid The SID of the Event resource to read. + * @return $this Fluent Builder + */ + public function setSid(string $sid): self + { + $this->options['sid'] = $sid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.ReadEventOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/EventPage.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/EventPage.php new file mode 100755 index 0000000..ab7992e --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/EventPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return EventInstance \Twilio\Rest\Taskrouter\V1\Workspace\EventInstance + */ + public function buildInstance(array $payload): EventInstance + { + return new EventInstance($this->version, $payload, $this->solution['workspaceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.EventPage]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationContext.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationContext.php new file mode 100755 index 0000000..880ec99 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationContext.php @@ -0,0 +1,231 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + 'taskSid' => + $taskSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Tasks/' . \rawurlencode($taskSid) + .'/Reservations/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the ReservationInstance + * + * @return ReservationInstance Fetched ReservationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ReservationInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ReservationInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['taskSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ReservationInstance + * + * @param array|Options $options Optional Arguments + * @return ReservationInstance Updated ReservationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ReservationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'ReservationStatus' => + $options['reservationStatus'], + 'WorkerActivitySid' => + $options['workerActivitySid'], + 'Instruction' => + $options['instruction'], + 'DequeuePostWorkActivitySid' => + $options['dequeuePostWorkActivitySid'], + 'DequeueFrom' => + $options['dequeueFrom'], + 'DequeueRecord' => + $options['dequeueRecord'], + 'DequeueTimeout' => + $options['dequeueTimeout'], + 'DequeueTo' => + $options['dequeueTo'], + 'DequeueStatusCallbackUrl' => + $options['dequeueStatusCallbackUrl'], + 'CallFrom' => + $options['callFrom'], + 'CallRecord' => + $options['callRecord'], + 'CallTimeout' => + $options['callTimeout'], + 'CallTo' => + $options['callTo'], + 'CallUrl' => + $options['callUrl'], + 'CallStatusCallbackUrl' => + $options['callStatusCallbackUrl'], + 'CallAccept' => + Serialize::booleanToString($options['callAccept']), + 'RedirectCallSid' => + $options['redirectCallSid'], + 'RedirectAccept' => + Serialize::booleanToString($options['redirectAccept']), + 'RedirectUrl' => + $options['redirectUrl'], + 'To' => + $options['to'], + 'From' => + $options['from'], + 'StatusCallback' => + $options['statusCallback'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'StatusCallbackEvent' => + $options['statusCallbackEvent'], + 'Timeout' => + $options['timeout'], + 'Record' => + Serialize::booleanToString($options['record']), + 'Muted' => + Serialize::booleanToString($options['muted']), + 'Beep' => + $options['beep'], + 'StartConferenceOnEnter' => + Serialize::booleanToString($options['startConferenceOnEnter']), + 'EndConferenceOnExit' => + Serialize::booleanToString($options['endConferenceOnExit']), + 'WaitUrl' => + $options['waitUrl'], + 'WaitMethod' => + $options['waitMethod'], + 'EarlyMedia' => + Serialize::booleanToString($options['earlyMedia']), + 'MaxParticipants' => + $options['maxParticipants'], + 'ConferenceStatusCallback' => + $options['conferenceStatusCallback'], + 'ConferenceStatusCallbackMethod' => + $options['conferenceStatusCallbackMethod'], + 'ConferenceStatusCallbackEvent' => + $options['conferenceStatusCallbackEvent'], + 'ConferenceRecord' => + $options['conferenceRecord'], + 'ConferenceTrim' => + $options['conferenceTrim'], + 'RecordingChannels' => + $options['recordingChannels'], + 'RecordingStatusCallback' => + $options['recordingStatusCallback'], + 'RecordingStatusCallbackMethod' => + $options['recordingStatusCallbackMethod'], + 'ConferenceRecordingStatusCallback' => + $options['conferenceRecordingStatusCallback'], + 'ConferenceRecordingStatusCallbackMethod' => + $options['conferenceRecordingStatusCallbackMethod'], + 'Region' => + $options['region'], + 'SipAuthUsername' => + $options['sipAuthUsername'], + 'SipAuthPassword' => + $options['sipAuthPassword'], + 'DequeueStatusCallbackEvent' => + Serialize::map($options['dequeueStatusCallbackEvent'], function ($e) { return $e; }), + 'PostWorkActivitySid' => + $options['postWorkActivitySid'], + 'SupervisorMode' => + $options['supervisorMode'], + 'Supervisor' => + $options['supervisor'], + 'EndConferenceOnCustomerExit' => + Serialize::booleanToString($options['endConferenceOnCustomerExit']), + 'BeepOnCustomerEntrance' => + Serialize::booleanToString($options['beepOnCustomerEntrance']), + ]); + + $headers = Values::of(['If-Match' => $options['ifMatch']]); + + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ReservationInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['taskSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.ReservationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationInstance.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationInstance.php new file mode 100755 index 0000000..977719e --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationInstance.php @@ -0,0 +1,154 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'reservationStatus' => Values::array_get($payload, 'reservation_status'), + 'sid' => Values::array_get($payload, 'sid'), + 'taskSid' => Values::array_get($payload, 'task_sid'), + 'workerName' => Values::array_get($payload, 'worker_name'), + 'workerSid' => Values::array_get($payload, 'worker_sid'), + 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['workspaceSid' => $workspaceSid, 'taskSid' => $taskSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ReservationContext Context for this ReservationInstance + */ + protected function proxy(): ReservationContext + { + if (!$this->context) { + $this->context = new ReservationContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['taskSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the ReservationInstance + * + * @return ReservationInstance Fetched ReservationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ReservationInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ReservationInstance + * + * @param array|Options $options Optional Arguments + * @return ReservationInstance Updated ReservationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ReservationInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.ReservationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationList.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationList.php new file mode 100755 index 0000000..e530469 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationList.php @@ -0,0 +1,184 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + 'taskSid' => + $taskSid, + + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Tasks/' . \rawurlencode($taskSid) + .'/Reservations'; + } + + /** + * Reads ReservationInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ReservationInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams ReservationInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ReservationInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ReservationPage Page of ReservationInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ReservationPage + { + $options = new Values($options); + + $params = Values::of([ + 'ReservationStatus' => + $options['reservationStatus'], + 'WorkerSid' => + $options['workerSid'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ReservationPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ReservationInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ReservationPage Page of ReservationInstance + */ + public function getPage(string $targetUrl): ReservationPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ReservationPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ReservationContext + * + * @param string $sid The SID of the TaskReservation resource to fetch. + */ + public function getContext( + string $sid + + ): ReservationContext + { + return new ReservationContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['taskSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.ReservationList]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationOptions.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationOptions.php new file mode 100755 index 0000000..90e3121 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationOptions.php @@ -0,0 +1,1098 @@ +options['reservationStatus'] = $reservationStatus; + $this->options['workerSid'] = $workerSid; + } + + /** + * Returns the list of reservations for a task with a specified ReservationStatus. Can be: `pending`, `accepted`, `rejected`, or `timeout`. + * + * @param string $reservationStatus Returns the list of reservations for a task with a specified ReservationStatus. Can be: `pending`, `accepted`, `rejected`, or `timeout`. + * @return $this Fluent Builder + */ + public function setReservationStatus(string $reservationStatus): self + { + $this->options['reservationStatus'] = $reservationStatus; + return $this; + } + + /** + * The SID of the reserved Worker resource to read. + * + * @param string $workerSid The SID of the reserved Worker resource to read. + * @return $this Fluent Builder + */ + public function setWorkerSid(string $workerSid): self + { + $this->options['workerSid'] = $workerSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.ReadReservationOptions ' . $options . ']'; + } +} + +class UpdateReservationOptions extends Options + { + /** + * @param string $reservationStatus + * @param string $workerActivitySid The new worker activity SID if rejecting a reservation. + * @param string $instruction The assignment instruction for reservation. + * @param string $dequeuePostWorkActivitySid The SID of the Activity resource to start after executing a Dequeue instruction. + * @param string $dequeueFrom The Caller ID of the call to the worker when executing a Dequeue instruction. + * @param string $dequeueRecord Whether to record both legs of a call when executing a Dequeue instruction or which leg to record. + * @param int $dequeueTimeout Timeout for call when executing a Dequeue instruction. + * @param string $dequeueTo The Contact URI of the worker when executing a Dequeue instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. + * @param string $dequeueStatusCallbackUrl The Callback URL for completed call event when executing a Dequeue instruction. + * @param string $callFrom The Caller ID of the outbound call when executing a Call instruction. + * @param string $callRecord Whether to record both legs of a call when executing a Call instruction or which leg to record. + * @param int $callTimeout Timeout for call when executing a Call instruction. + * @param string $callTo The Contact URI of the worker when executing a Call instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. + * @param string $callUrl TwiML URI executed on answering the worker's leg as a result of the Call instruction. + * @param string $callStatusCallbackUrl The URL to call for the completed call event when executing a Call instruction. + * @param bool $callAccept Whether to accept a reservation when executing a Call instruction. + * @param string $redirectCallSid The Call SID of the call parked in the queue when executing a Redirect instruction. + * @param bool $redirectAccept Whether the reservation should be accepted when executing a Redirect instruction. + * @param string $redirectUrl TwiML URI to redirect the call to when executing the Redirect instruction. + * @param string $to The Contact URI of the worker when executing a Conference instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. + * @param string $from The Caller ID of the call to the worker when executing a Conference instruction. + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. + * @param string $statusCallbackEvent The call progress events that we will send to `status_callback`. Can be: `initiated`, `ringing`, `answered`, or `completed`. + * @param int $timeout Timeout for call when executing a Conference instruction. + * @param bool $record Whether to record the participant and their conferences, including the time between conferences. The default is `false`. + * @param bool $muted Whether the agent is muted in the conference. The default is `false`. + * @param string $beep Whether to play a notification beep when the participant joins or when to play a beep. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. + * @param bool $startConferenceOnEnter Whether to start the conference when the participant joins, if it has not already started. The default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. + * @param bool $endConferenceOnExit Whether to end the conference when the agent leaves. + * @param string $waitUrl The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). + * @param string $waitMethod The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. + * @param bool $earlyMedia Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. The default is `true`. + * @param int $maxParticipants The maximum number of participants in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. + * @param string $conferenceStatusCallback The URL we should call using the `conference_status_callback_method` when the conference events in `conference_status_callback_event` occur. Only the value set by the first participant to join the conference is used. Subsequent `conference_status_callback` values are ignored. + * @param string $conferenceStatusCallbackMethod The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @param string $conferenceStatusCallbackEvent The conference status events that we will send to `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, `hold`, `speaker`. + * @param string $conferenceRecord Whether to record the conference the participant is joining or when to record the conference. Can be: `true`, `false`, `record-from-start`, and `do-not-record`. The default value is `false`. + * @param string $conferenceTrim How to trim the leading and trailing silence from your recorded conference audio files. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`. + * @param string $recordingChannels The recording channels for the final recording. Can be: `mono` or `dual` and the default is `mono`. + * @param string $recordingStatusCallback The URL that we should call using the `recording_status_callback_method` when the recording status changes. + * @param string $recordingStatusCallbackMethod The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @param string $conferenceRecordingStatusCallback The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. + * @param string $conferenceRecordingStatusCallbackMethod The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @param string $region The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. + * @param string $sipAuthUsername The SIP username used for authentication. + * @param string $sipAuthPassword The SIP password for authentication. + * @param string[] $dequeueStatusCallbackEvent The Call progress events sent via webhooks as a result of a Dequeue instruction. + * @param string $postWorkActivitySid The new worker activity SID after executing a Conference instruction. + * @param string $supervisorMode + * @param string $supervisor The Supervisor SID/URI when executing the Supervise instruction. + * @param bool $endConferenceOnCustomerExit Whether to end the conference when the customer leaves. + * @param bool $beepOnCustomerEntrance Whether to play a notification beep when the customer joins. + * @param string $ifMatch The If-Match HTTP request header + */ + public function __construct( + + string $reservationStatus = Values::NONE, + string $workerActivitySid = Values::NONE, + string $instruction = Values::NONE, + string $dequeuePostWorkActivitySid = Values::NONE, + string $dequeueFrom = Values::NONE, + string $dequeueRecord = Values::NONE, + int $dequeueTimeout = Values::INT_NONE, + string $dequeueTo = Values::NONE, + string $dequeueStatusCallbackUrl = Values::NONE, + string $callFrom = Values::NONE, + string $callRecord = Values::NONE, + int $callTimeout = Values::INT_NONE, + string $callTo = Values::NONE, + string $callUrl = Values::NONE, + string $callStatusCallbackUrl = Values::NONE, + bool $callAccept = Values::BOOL_NONE, + string $redirectCallSid = Values::NONE, + bool $redirectAccept = Values::BOOL_NONE, + string $redirectUrl = Values::NONE, + string $to = Values::NONE, + string $from = Values::NONE, + string $statusCallback = Values::NONE, + string $statusCallbackMethod = Values::NONE, + array $statusCallbackEvent = Values::ARRAY_NONE, + int $timeout = Values::INT_NONE, + bool $record = Values::BOOL_NONE, + bool $muted = Values::BOOL_NONE, + string $beep = Values::NONE, + bool $startConferenceOnEnter = Values::BOOL_NONE, + bool $endConferenceOnExit = Values::BOOL_NONE, + string $waitUrl = Values::NONE, + string $waitMethod = Values::NONE, + bool $earlyMedia = Values::BOOL_NONE, + int $maxParticipants = Values::INT_NONE, + string $conferenceStatusCallback = Values::NONE, + string $conferenceStatusCallbackMethod = Values::NONE, + array $conferenceStatusCallbackEvent = Values::ARRAY_NONE, + string $conferenceRecord = Values::NONE, + string $conferenceTrim = Values::NONE, + string $recordingChannels = Values::NONE, + string $recordingStatusCallback = Values::NONE, + string $recordingStatusCallbackMethod = Values::NONE, + string $conferenceRecordingStatusCallback = Values::NONE, + string $conferenceRecordingStatusCallbackMethod = Values::NONE, + string $region = Values::NONE, + string $sipAuthUsername = Values::NONE, + string $sipAuthPassword = Values::NONE, + array $dequeueStatusCallbackEvent = Values::ARRAY_NONE, + string $postWorkActivitySid = Values::NONE, + string $supervisorMode = Values::NONE, + string $supervisor = Values::NONE, + bool $endConferenceOnCustomerExit = Values::BOOL_NONE, + bool $beepOnCustomerEntrance = Values::BOOL_NONE, + string $ifMatch = Values::NONE + + ) { + $this->options['reservationStatus'] = $reservationStatus; + $this->options['workerActivitySid'] = $workerActivitySid; + $this->options['instruction'] = $instruction; + $this->options['dequeuePostWorkActivitySid'] = $dequeuePostWorkActivitySid; + $this->options['dequeueFrom'] = $dequeueFrom; + $this->options['dequeueRecord'] = $dequeueRecord; + $this->options['dequeueTimeout'] = $dequeueTimeout; + $this->options['dequeueTo'] = $dequeueTo; + $this->options['dequeueStatusCallbackUrl'] = $dequeueStatusCallbackUrl; + $this->options['callFrom'] = $callFrom; + $this->options['callRecord'] = $callRecord; + $this->options['callTimeout'] = $callTimeout; + $this->options['callTo'] = $callTo; + $this->options['callUrl'] = $callUrl; + $this->options['callStatusCallbackUrl'] = $callStatusCallbackUrl; + $this->options['callAccept'] = $callAccept; + $this->options['redirectCallSid'] = $redirectCallSid; + $this->options['redirectAccept'] = $redirectAccept; + $this->options['redirectUrl'] = $redirectUrl; + $this->options['to'] = $to; + $this->options['from'] = $from; + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['statusCallbackEvent'] = $statusCallbackEvent; + $this->options['timeout'] = $timeout; + $this->options['record'] = $record; + $this->options['muted'] = $muted; + $this->options['beep'] = $beep; + $this->options['startConferenceOnEnter'] = $startConferenceOnEnter; + $this->options['endConferenceOnExit'] = $endConferenceOnExit; + $this->options['waitUrl'] = $waitUrl; + $this->options['waitMethod'] = $waitMethod; + $this->options['earlyMedia'] = $earlyMedia; + $this->options['maxParticipants'] = $maxParticipants; + $this->options['conferenceStatusCallback'] = $conferenceStatusCallback; + $this->options['conferenceStatusCallbackMethod'] = $conferenceStatusCallbackMethod; + $this->options['conferenceStatusCallbackEvent'] = $conferenceStatusCallbackEvent; + $this->options['conferenceRecord'] = $conferenceRecord; + $this->options['conferenceTrim'] = $conferenceTrim; + $this->options['recordingChannels'] = $recordingChannels; + $this->options['recordingStatusCallback'] = $recordingStatusCallback; + $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; + $this->options['conferenceRecordingStatusCallback'] = $conferenceRecordingStatusCallback; + $this->options['conferenceRecordingStatusCallbackMethod'] = $conferenceRecordingStatusCallbackMethod; + $this->options['region'] = $region; + $this->options['sipAuthUsername'] = $sipAuthUsername; + $this->options['sipAuthPassword'] = $sipAuthPassword; + $this->options['dequeueStatusCallbackEvent'] = $dequeueStatusCallbackEvent; + $this->options['postWorkActivitySid'] = $postWorkActivitySid; + $this->options['supervisorMode'] = $supervisorMode; + $this->options['supervisor'] = $supervisor; + $this->options['endConferenceOnCustomerExit'] = $endConferenceOnCustomerExit; + $this->options['beepOnCustomerEntrance'] = $beepOnCustomerEntrance; + $this->options['ifMatch'] = $ifMatch; + } + + /** + * @param string $reservationStatus + * @return $this Fluent Builder + */ + public function setReservationStatus(string $reservationStatus): self + { + $this->options['reservationStatus'] = $reservationStatus; + return $this; + } + + /** + * The new worker activity SID if rejecting a reservation. + * + * @param string $workerActivitySid The new worker activity SID if rejecting a reservation. + * @return $this Fluent Builder + */ + public function setWorkerActivitySid(string $workerActivitySid): self + { + $this->options['workerActivitySid'] = $workerActivitySid; + return $this; + } + + /** + * The assignment instruction for reservation. + * + * @param string $instruction The assignment instruction for reservation. + * @return $this Fluent Builder + */ + public function setInstruction(string $instruction): self + { + $this->options['instruction'] = $instruction; + return $this; + } + + /** + * The SID of the Activity resource to start after executing a Dequeue instruction. + * + * @param string $dequeuePostWorkActivitySid The SID of the Activity resource to start after executing a Dequeue instruction. + * @return $this Fluent Builder + */ + public function setDequeuePostWorkActivitySid(string $dequeuePostWorkActivitySid): self + { + $this->options['dequeuePostWorkActivitySid'] = $dequeuePostWorkActivitySid; + return $this; + } + + /** + * The Caller ID of the call to the worker when executing a Dequeue instruction. + * + * @param string $dequeueFrom The Caller ID of the call to the worker when executing a Dequeue instruction. + * @return $this Fluent Builder + */ + public function setDequeueFrom(string $dequeueFrom): self + { + $this->options['dequeueFrom'] = $dequeueFrom; + return $this; + } + + /** + * Whether to record both legs of a call when executing a Dequeue instruction or which leg to record. + * + * @param string $dequeueRecord Whether to record both legs of a call when executing a Dequeue instruction or which leg to record. + * @return $this Fluent Builder + */ + public function setDequeueRecord(string $dequeueRecord): self + { + $this->options['dequeueRecord'] = $dequeueRecord; + return $this; + } + + /** + * Timeout for call when executing a Dequeue instruction. + * + * @param int $dequeueTimeout Timeout for call when executing a Dequeue instruction. + * @return $this Fluent Builder + */ + public function setDequeueTimeout(int $dequeueTimeout): self + { + $this->options['dequeueTimeout'] = $dequeueTimeout; + return $this; + } + + /** + * The Contact URI of the worker when executing a Dequeue instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. + * + * @param string $dequeueTo The Contact URI of the worker when executing a Dequeue instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. + * @return $this Fluent Builder + */ + public function setDequeueTo(string $dequeueTo): self + { + $this->options['dequeueTo'] = $dequeueTo; + return $this; + } + + /** + * The Callback URL for completed call event when executing a Dequeue instruction. + * + * @param string $dequeueStatusCallbackUrl The Callback URL for completed call event when executing a Dequeue instruction. + * @return $this Fluent Builder + */ + public function setDequeueStatusCallbackUrl(string $dequeueStatusCallbackUrl): self + { + $this->options['dequeueStatusCallbackUrl'] = $dequeueStatusCallbackUrl; + return $this; + } + + /** + * The Caller ID of the outbound call when executing a Call instruction. + * + * @param string $callFrom The Caller ID of the outbound call when executing a Call instruction. + * @return $this Fluent Builder + */ + public function setCallFrom(string $callFrom): self + { + $this->options['callFrom'] = $callFrom; + return $this; + } + + /** + * Whether to record both legs of a call when executing a Call instruction or which leg to record. + * + * @param string $callRecord Whether to record both legs of a call when executing a Call instruction or which leg to record. + * @return $this Fluent Builder + */ + public function setCallRecord(string $callRecord): self + { + $this->options['callRecord'] = $callRecord; + return $this; + } + + /** + * Timeout for call when executing a Call instruction. + * + * @param int $callTimeout Timeout for call when executing a Call instruction. + * @return $this Fluent Builder + */ + public function setCallTimeout(int $callTimeout): self + { + $this->options['callTimeout'] = $callTimeout; + return $this; + } + + /** + * The Contact URI of the worker when executing a Call instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. + * + * @param string $callTo The Contact URI of the worker when executing a Call instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. + * @return $this Fluent Builder + */ + public function setCallTo(string $callTo): self + { + $this->options['callTo'] = $callTo; + return $this; + } + + /** + * TwiML URI executed on answering the worker's leg as a result of the Call instruction. + * + * @param string $callUrl TwiML URI executed on answering the worker's leg as a result of the Call instruction. + * @return $this Fluent Builder + */ + public function setCallUrl(string $callUrl): self + { + $this->options['callUrl'] = $callUrl; + return $this; + } + + /** + * The URL to call for the completed call event when executing a Call instruction. + * + * @param string $callStatusCallbackUrl The URL to call for the completed call event when executing a Call instruction. + * @return $this Fluent Builder + */ + public function setCallStatusCallbackUrl(string $callStatusCallbackUrl): self + { + $this->options['callStatusCallbackUrl'] = $callStatusCallbackUrl; + return $this; + } + + /** + * Whether to accept a reservation when executing a Call instruction. + * + * @param bool $callAccept Whether to accept a reservation when executing a Call instruction. + * @return $this Fluent Builder + */ + public function setCallAccept(bool $callAccept): self + { + $this->options['callAccept'] = $callAccept; + return $this; + } + + /** + * The Call SID of the call parked in the queue when executing a Redirect instruction. + * + * @param string $redirectCallSid The Call SID of the call parked in the queue when executing a Redirect instruction. + * @return $this Fluent Builder + */ + public function setRedirectCallSid(string $redirectCallSid): self + { + $this->options['redirectCallSid'] = $redirectCallSid; + return $this; + } + + /** + * Whether the reservation should be accepted when executing a Redirect instruction. + * + * @param bool $redirectAccept Whether the reservation should be accepted when executing a Redirect instruction. + * @return $this Fluent Builder + */ + public function setRedirectAccept(bool $redirectAccept): self + { + $this->options['redirectAccept'] = $redirectAccept; + return $this; + } + + /** + * TwiML URI to redirect the call to when executing the Redirect instruction. + * + * @param string $redirectUrl TwiML URI to redirect the call to when executing the Redirect instruction. + * @return $this Fluent Builder + */ + public function setRedirectUrl(string $redirectUrl): self + { + $this->options['redirectUrl'] = $redirectUrl; + return $this; + } + + /** + * The Contact URI of the worker when executing a Conference instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. + * + * @param string $to The Contact URI of the worker when executing a Conference instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. + * @return $this Fluent Builder + */ + public function setTo(string $to): self + { + $this->options['to'] = $to; + return $this; + } + + /** + * The Caller ID of the call to the worker when executing a Conference instruction. + * + * @param string $from The Caller ID of the call to the worker when executing a Conference instruction. + * @return $this Fluent Builder + */ + public function setFrom(string $from): self + { + $this->options['from'] = $from; + return $this; + } + + /** + * The URL we should call using the `status_callback_method` to send status information to your application. + * + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. + * + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * The call progress events that we will send to `status_callback`. Can be: `initiated`, `ringing`, `answered`, or `completed`. + * + * @param string $statusCallbackEvent The call progress events that we will send to `status_callback`. Can be: `initiated`, `ringing`, `answered`, or `completed`. + * @return $this Fluent Builder + */ + public function setStatusCallbackEvent(array $statusCallbackEvent): self + { + $this->options['statusCallbackEvent'] = $statusCallbackEvent; + return $this; + } + + /** + * Timeout for call when executing a Conference instruction. + * + * @param int $timeout Timeout for call when executing a Conference instruction. + * @return $this Fluent Builder + */ + public function setTimeout(int $timeout): self + { + $this->options['timeout'] = $timeout; + return $this; + } + + /** + * Whether to record the participant and their conferences, including the time between conferences. The default is `false`. + * + * @param bool $record Whether to record the participant and their conferences, including the time between conferences. The default is `false`. + * @return $this Fluent Builder + */ + public function setRecord(bool $record): self + { + $this->options['record'] = $record; + return $this; + } + + /** + * Whether the agent is muted in the conference. The default is `false`. + * + * @param bool $muted Whether the agent is muted in the conference. The default is `false`. + * @return $this Fluent Builder + */ + public function setMuted(bool $muted): self + { + $this->options['muted'] = $muted; + return $this; + } + + /** + * Whether to play a notification beep when the participant joins or when to play a beep. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. + * + * @param string $beep Whether to play a notification beep when the participant joins or when to play a beep. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. + * @return $this Fluent Builder + */ + public function setBeep(string $beep): self + { + $this->options['beep'] = $beep; + return $this; + } + + /** + * Whether to start the conference when the participant joins, if it has not already started. The default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. + * + * @param bool $startConferenceOnEnter Whether to start the conference when the participant joins, if it has not already started. The default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. + * @return $this Fluent Builder + */ + public function setStartConferenceOnEnter(bool $startConferenceOnEnter): self + { + $this->options['startConferenceOnEnter'] = $startConferenceOnEnter; + return $this; + } + + /** + * Whether to end the conference when the agent leaves. + * + * @param bool $endConferenceOnExit Whether to end the conference when the agent leaves. + * @return $this Fluent Builder + */ + public function setEndConferenceOnExit(bool $endConferenceOnExit): self + { + $this->options['endConferenceOnExit'] = $endConferenceOnExit; + return $this; + } + + /** + * The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). + * + * @param string $waitUrl The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). + * @return $this Fluent Builder + */ + public function setWaitUrl(string $waitUrl): self + { + $this->options['waitUrl'] = $waitUrl; + return $this; + } + + /** + * The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. + * + * @param string $waitMethod The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. + * @return $this Fluent Builder + */ + public function setWaitMethod(string $waitMethod): self + { + $this->options['waitMethod'] = $waitMethod; + return $this; + } + + /** + * Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. The default is `true`. + * + * @param bool $earlyMedia Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. The default is `true`. + * @return $this Fluent Builder + */ + public function setEarlyMedia(bool $earlyMedia): self + { + $this->options['earlyMedia'] = $earlyMedia; + return $this; + } + + /** + * The maximum number of participants in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. + * + * @param int $maxParticipants The maximum number of participants in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. + * @return $this Fluent Builder + */ + public function setMaxParticipants(int $maxParticipants): self + { + $this->options['maxParticipants'] = $maxParticipants; + return $this; + } + + /** + * The URL we should call using the `conference_status_callback_method` when the conference events in `conference_status_callback_event` occur. Only the value set by the first participant to join the conference is used. Subsequent `conference_status_callback` values are ignored. + * + * @param string $conferenceStatusCallback The URL we should call using the `conference_status_callback_method` when the conference events in `conference_status_callback_event` occur. Only the value set by the first participant to join the conference is used. Subsequent `conference_status_callback` values are ignored. + * @return $this Fluent Builder + */ + public function setConferenceStatusCallback(string $conferenceStatusCallback): self + { + $this->options['conferenceStatusCallback'] = $conferenceStatusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $conferenceStatusCallbackMethod The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setConferenceStatusCallbackMethod(string $conferenceStatusCallbackMethod): self + { + $this->options['conferenceStatusCallbackMethod'] = $conferenceStatusCallbackMethod; + return $this; + } + + /** + * The conference status events that we will send to `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, `hold`, `speaker`. + * + * @param string $conferenceStatusCallbackEvent The conference status events that we will send to `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, `hold`, `speaker`. + * @return $this Fluent Builder + */ + public function setConferenceStatusCallbackEvent(array $conferenceStatusCallbackEvent): self + { + $this->options['conferenceStatusCallbackEvent'] = $conferenceStatusCallbackEvent; + return $this; + } + + /** + * Whether to record the conference the participant is joining or when to record the conference. Can be: `true`, `false`, `record-from-start`, and `do-not-record`. The default value is `false`. + * + * @param string $conferenceRecord Whether to record the conference the participant is joining or when to record the conference. Can be: `true`, `false`, `record-from-start`, and `do-not-record`. The default value is `false`. + * @return $this Fluent Builder + */ + public function setConferenceRecord(string $conferenceRecord): self + { + $this->options['conferenceRecord'] = $conferenceRecord; + return $this; + } + + /** + * How to trim the leading and trailing silence from your recorded conference audio files. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`. + * + * @param string $conferenceTrim How to trim the leading and trailing silence from your recorded conference audio files. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`. + * @return $this Fluent Builder + */ + public function setConferenceTrim(string $conferenceTrim): self + { + $this->options['conferenceTrim'] = $conferenceTrim; + return $this; + } + + /** + * The recording channels for the final recording. Can be: `mono` or `dual` and the default is `mono`. + * + * @param string $recordingChannels The recording channels for the final recording. Can be: `mono` or `dual` and the default is `mono`. + * @return $this Fluent Builder + */ + public function setRecordingChannels(string $recordingChannels): self + { + $this->options['recordingChannels'] = $recordingChannels; + return $this; + } + + /** + * The URL that we should call using the `recording_status_callback_method` when the recording status changes. + * + * @param string $recordingStatusCallback The URL that we should call using the `recording_status_callback_method` when the recording status changes. + * @return $this Fluent Builder + */ + public function setRecordingStatusCallback(string $recordingStatusCallback): self + { + $this->options['recordingStatusCallback'] = $recordingStatusCallback; + return $this; + } + + /** + * The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $recordingStatusCallbackMethod The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setRecordingStatusCallbackMethod(string $recordingStatusCallbackMethod): self + { + $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; + return $this; + } + + /** + * The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. + * + * @param string $conferenceRecordingStatusCallback The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. + * @return $this Fluent Builder + */ + public function setConferenceRecordingStatusCallback(string $conferenceRecordingStatusCallback): self + { + $this->options['conferenceRecordingStatusCallback'] = $conferenceRecordingStatusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $conferenceRecordingStatusCallbackMethod The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setConferenceRecordingStatusCallbackMethod(string $conferenceRecordingStatusCallbackMethod): self + { + $this->options['conferenceRecordingStatusCallbackMethod'] = $conferenceRecordingStatusCallbackMethod; + return $this; + } + + /** + * The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. + * + * @param string $region The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. + * @return $this Fluent Builder + */ + public function setRegion(string $region): self + { + $this->options['region'] = $region; + return $this; + } + + /** + * The SIP username used for authentication. + * + * @param string $sipAuthUsername The SIP username used for authentication. + * @return $this Fluent Builder + */ + public function setSipAuthUsername(string $sipAuthUsername): self + { + $this->options['sipAuthUsername'] = $sipAuthUsername; + return $this; + } + + /** + * The SIP password for authentication. + * + * @param string $sipAuthPassword The SIP password for authentication. + * @return $this Fluent Builder + */ + public function setSipAuthPassword(string $sipAuthPassword): self + { + $this->options['sipAuthPassword'] = $sipAuthPassword; + return $this; + } + + /** + * The Call progress events sent via webhooks as a result of a Dequeue instruction. + * + * @param string[] $dequeueStatusCallbackEvent The Call progress events sent via webhooks as a result of a Dequeue instruction. + * @return $this Fluent Builder + */ + public function setDequeueStatusCallbackEvent(array $dequeueStatusCallbackEvent): self + { + $this->options['dequeueStatusCallbackEvent'] = $dequeueStatusCallbackEvent; + return $this; + } + + /** + * The new worker activity SID after executing a Conference instruction. + * + * @param string $postWorkActivitySid The new worker activity SID after executing a Conference instruction. + * @return $this Fluent Builder + */ + public function setPostWorkActivitySid(string $postWorkActivitySid): self + { + $this->options['postWorkActivitySid'] = $postWorkActivitySid; + return $this; + } + + /** + * @param string $supervisorMode + * @return $this Fluent Builder + */ + public function setSupervisorMode(string $supervisorMode): self + { + $this->options['supervisorMode'] = $supervisorMode; + return $this; + } + + /** + * The Supervisor SID/URI when executing the Supervise instruction. + * + * @param string $supervisor The Supervisor SID/URI when executing the Supervise instruction. + * @return $this Fluent Builder + */ + public function setSupervisor(string $supervisor): self + { + $this->options['supervisor'] = $supervisor; + return $this; + } + + /** + * Whether to end the conference when the customer leaves. + * + * @param bool $endConferenceOnCustomerExit Whether to end the conference when the customer leaves. + * @return $this Fluent Builder + */ + public function setEndConferenceOnCustomerExit(bool $endConferenceOnCustomerExit): self + { + $this->options['endConferenceOnCustomerExit'] = $endConferenceOnCustomerExit; + return $this; + } + + /** + * Whether to play a notification beep when the customer joins. + * + * @param bool $beepOnCustomerEntrance Whether to play a notification beep when the customer joins. + * @return $this Fluent Builder + */ + public function setBeepOnCustomerEntrance(bool $beepOnCustomerEntrance): self + { + $this->options['beepOnCustomerEntrance'] = $beepOnCustomerEntrance; + return $this; + } + + /** + * The If-Match HTTP request header + * + * @param string $ifMatch The If-Match HTTP request header + * @return $this Fluent Builder + */ + public function setIfMatch(string $ifMatch): self + { + $this->options['ifMatch'] = $ifMatch; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.UpdateReservationOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationPage.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationPage.php new file mode 100755 index 0000000..e37398b --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Task/ReservationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ReservationInstance \Twilio\Rest\Taskrouter\V1\Workspace\Task\ReservationInstance + */ + public function buildInstance(array $payload): ReservationInstance + { + return new ReservationInstance($this->version, $payload, $this->solution['workspaceSid'], $this->solution['taskSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.ReservationPage]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelContext.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelContext.php new file mode 100755 index 0000000..e6b7626 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelContext.php @@ -0,0 +1,133 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/TaskChannels/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the TaskChannelInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the TaskChannelInstance + * + * @return TaskChannelInstance Fetched TaskChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TaskChannelInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new TaskChannelInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the TaskChannelInstance + * + * @param array|Options $options Optional Arguments + * @return TaskChannelInstance Updated TaskChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TaskChannelInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'ChannelOptimizedRouting' => + Serialize::booleanToString($options['channelOptimizedRouting']), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new TaskChannelInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.TaskChannelContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelInstance.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelInstance.php new file mode 100755 index 0000000..997a57b --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelInstance.php @@ -0,0 +1,162 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'sid' => Values::array_get($payload, 'sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), + 'channelOptimizedRouting' => Values::array_get($payload, 'channel_optimized_routing'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['workspaceSid' => $workspaceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return TaskChannelContext Context for this TaskChannelInstance + */ + protected function proxy(): TaskChannelContext + { + if (!$this->context) { + $this->context = new TaskChannelContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the TaskChannelInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the TaskChannelInstance + * + * @return TaskChannelInstance Fetched TaskChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TaskChannelInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the TaskChannelInstance + * + * @param array|Options $options Optional Arguments + * @return TaskChannelInstance Updated TaskChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TaskChannelInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.TaskChannelInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelList.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelList.php new file mode 100755 index 0000000..6acaeb1 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelList.php @@ -0,0 +1,204 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/TaskChannels'; + } + + /** + * Create the TaskChannelInstance + * + * @param string $friendlyName A descriptive string that you create to describe the Task Channel. It can be up to 64 characters long. + * @param string $uniqueName An application-defined string that uniquely identifies the Task Channel, such as `voice` or `sms`. + * @param array|Options $options Optional Arguments + * @return TaskChannelInstance Created TaskChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $uniqueName, array $options = []): TaskChannelInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'UniqueName' => + $uniqueName, + 'ChannelOptimizedRouting' => + Serialize::booleanToString($options['channelOptimizedRouting']), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new TaskChannelInstance( + $this->version, + $payload, + $this->solution['workspaceSid'] + ); + } + + + /** + * Reads TaskChannelInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return TaskChannelInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams TaskChannelInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of TaskChannelInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return TaskChannelPage Page of TaskChannelInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): TaskChannelPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new TaskChannelPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of TaskChannelInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return TaskChannelPage Page of TaskChannelInstance + */ + public function getPage(string $targetUrl): TaskChannelPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new TaskChannelPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a TaskChannelContext + * + * @param string $sid The SID of the Task Channel resource to delete. + */ + public function getContext( + string $sid + + ): TaskChannelContext + { + return new TaskChannelContext( + $this->version, + $this->solution['workspaceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.TaskChannelList]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelOptions.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelOptions.php new file mode 100755 index 0000000..79bac30 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelOptions.php @@ -0,0 +1,152 @@ +options['channelOptimizedRouting'] = $channelOptimizedRouting; + } + + /** + * Whether the Task Channel should prioritize Workers that have been idle. If `true`, Workers that have been idle the longest are prioritized. + * + * @param bool $channelOptimizedRouting Whether the Task Channel should prioritize Workers that have been idle. If `true`, Workers that have been idle the longest are prioritized. + * @return $this Fluent Builder + */ + public function setChannelOptimizedRouting(bool $channelOptimizedRouting): self + { + $this->options['channelOptimizedRouting'] = $channelOptimizedRouting; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.CreateTaskChannelOptions ' . $options . ']'; + } +} + + + + +class UpdateTaskChannelOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the Task Channel. It can be up to 64 characters long. + * @param bool $channelOptimizedRouting Whether the TaskChannel should prioritize Workers that have been idle. If `true`, Workers that have been idle the longest are prioritized. + */ + public function __construct( + + string $friendlyName = Values::NONE, + bool $channelOptimizedRouting = Values::BOOL_NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['channelOptimizedRouting'] = $channelOptimizedRouting; + } + + /** + * A descriptive string that you create to describe the Task Channel. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the Task Channel. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Whether the TaskChannel should prioritize Workers that have been idle. If `true`, Workers that have been idle the longest are prioritized. + * + * @param bool $channelOptimizedRouting Whether the TaskChannel should prioritize Workers that have been idle. If `true`, Workers that have been idle the longest are prioritized. + * @return $this Fluent Builder + */ + public function setChannelOptimizedRouting(bool $channelOptimizedRouting): self + { + $this->options['channelOptimizedRouting'] = $channelOptimizedRouting; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.UpdateTaskChannelOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelPage.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelPage.php new file mode 100755 index 0000000..280fda6 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskChannelPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TaskChannelInstance \Twilio\Rest\Taskrouter\V1\Workspace\TaskChannelInstance + */ + public function buildInstance(array $payload): TaskChannelInstance + { + return new TaskChannelInstance($this->version, $payload, $this->solution['workspaceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.TaskChannelPage]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskContext.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskContext.php new file mode 100755 index 0000000..1b54f27 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskContext.php @@ -0,0 +1,204 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Tasks/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the TaskInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['If-Match' => $options['ifMatch']]); + + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the TaskInstance + * + * @return TaskInstance Fetched TaskInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TaskInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new TaskInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the TaskInstance + * + * @param array|Options $options Optional Arguments + * @return TaskInstance Updated TaskInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TaskInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Attributes' => + $options['attributes'], + 'AssignmentStatus' => + $options['assignmentStatus'], + 'Reason' => + $options['reason'], + 'Priority' => + $options['priority'], + 'TaskChannel' => + $options['taskChannel'], + ]); + + $headers = Values::of(['If-Match' => $options['ifMatch']]); + + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new TaskInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the reservations + */ + protected function getReservations(): ReservationList + { + if (!$this->_reservations) { + $this->_reservations = new ReservationList( + $this->version, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + return $this->_reservations; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.TaskContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskInstance.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskInstance.php new file mode 100755 index 0000000..35917b4 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskInstance.php @@ -0,0 +1,196 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'age' => Values::array_get($payload, 'age'), + 'assignmentStatus' => Values::array_get($payload, 'assignment_status'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'addons' => Values::array_get($payload, 'addons'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'taskQueueEnteredDate' => Deserialize::dateTime(Values::array_get($payload, 'task_queue_entered_date')), + 'priority' => Values::array_get($payload, 'priority'), + 'reason' => Values::array_get($payload, 'reason'), + 'sid' => Values::array_get($payload, 'sid'), + 'taskQueueSid' => Values::array_get($payload, 'task_queue_sid'), + 'taskQueueFriendlyName' => Values::array_get($payload, 'task_queue_friendly_name'), + 'taskChannelSid' => Values::array_get($payload, 'task_channel_sid'), + 'taskChannelUniqueName' => Values::array_get($payload, 'task_channel_unique_name'), + 'timeout' => Values::array_get($payload, 'timeout'), + 'workflowSid' => Values::array_get($payload, 'workflow_sid'), + 'workflowFriendlyName' => Values::array_get($payload, 'workflow_friendly_name'), + 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['workspaceSid' => $workspaceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return TaskContext Context for this TaskInstance + */ + protected function proxy(): TaskContext + { + if (!$this->context) { + $this->context = new TaskContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the TaskInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the TaskInstance + * + * @return TaskInstance Fetched TaskInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TaskInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the TaskInstance + * + * @param array|Options $options Optional Arguments + * @return TaskInstance Updated TaskInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TaskInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the reservations + */ + protected function getReservations(): ReservationList + { + return $this->proxy()->reservations; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.TaskInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskList.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskList.php new file mode 100755 index 0000000..eae1a4c --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskList.php @@ -0,0 +1,228 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Tasks'; + } + + /** + * Create the TaskInstance + * + * @param array|Options $options Optional Arguments + * @return TaskInstance Created TaskInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): TaskInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Timeout' => + $options['timeout'], + 'Priority' => + $options['priority'], + 'TaskChannel' => + $options['taskChannel'], + 'WorkflowSid' => + $options['workflowSid'], + 'Attributes' => + $options['attributes'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new TaskInstance( + $this->version, + $payload, + $this->solution['workspaceSid'] + ); + } + + + /** + * Reads TaskInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return TaskInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams TaskInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of TaskInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return TaskPage Page of TaskInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): TaskPage + { + $options = new Values($options); + + $params = Values::of([ + 'Priority' => + $options['priority'], + 'AssignmentStatus' => + Serialize::map($options['assignmentStatus'], function ($e) { return $e; }), + 'WorkflowSid' => + $options['workflowSid'], + 'WorkflowName' => + $options['workflowName'], + 'TaskQueueSid' => + $options['taskQueueSid'], + 'TaskQueueName' => + $options['taskQueueName'], + 'EvaluateTaskAttributes' => + $options['evaluateTaskAttributes'], + 'Ordering' => + $options['ordering'], + 'HasAddons' => + Serialize::booleanToString($options['hasAddons']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new TaskPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of TaskInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return TaskPage Page of TaskInstance + */ + public function getPage(string $targetUrl): TaskPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new TaskPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a TaskContext + * + * @param string $sid The SID of the Task resource to delete. + */ + public function getContext( + string $sid + + ): TaskContext + { + return new TaskContext( + $this->version, + $this->solution['workspaceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.TaskList]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskOptions.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskOptions.php new file mode 100755 index 0000000..e8b4af8 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskOptions.php @@ -0,0 +1,538 @@ +options['timeout'] = $timeout; + $this->options['priority'] = $priority; + $this->options['taskChannel'] = $taskChannel; + $this->options['workflowSid'] = $workflowSid; + $this->options['attributes'] = $attributes; + } + + /** + * The amount of time in seconds the new task can live before being assigned. Can be up to a maximum of 2 weeks (1,209,600 seconds). The default value is 24 hours (86,400 seconds). On timeout, the `task.canceled` event will fire with description `Task TTL Exceeded`. + * + * @param int $timeout The amount of time in seconds the new task can live before being assigned. Can be up to a maximum of 2 weeks (1,209,600 seconds). The default value is 24 hours (86,400 seconds). On timeout, the `task.canceled` event will fire with description `Task TTL Exceeded`. + * @return $this Fluent Builder + */ + public function setTimeout(int $timeout): self + { + $this->options['timeout'] = $timeout; + return $this; + } + + /** + * The priority to assign the new task and override the default. When supplied, the new Task will have this priority unless it matches a Workflow Target with a Priority set. When not supplied, the new Task will have the priority of the matching Workflow Target. Value can be 0 to 2^31^ (2,147,483,647). + * + * @param int $priority The priority to assign the new task and override the default. When supplied, the new Task will have this priority unless it matches a Workflow Target with a Priority set. When not supplied, the new Task will have the priority of the matching Workflow Target. Value can be 0 to 2^31^ (2,147,483,647). + * @return $this Fluent Builder + */ + public function setPriority(int $priority): self + { + $this->options['priority'] = $priority; + return $this; + } + + /** + * When MultiTasking is enabled, specify the TaskChannel by passing either its `unique_name` or `sid`. Default value is `default`. + * + * @param string $taskChannel When MultiTasking is enabled, specify the TaskChannel by passing either its `unique_name` or `sid`. Default value is `default`. + * @return $this Fluent Builder + */ + public function setTaskChannel(string $taskChannel): self + { + $this->options['taskChannel'] = $taskChannel; + return $this; + } + + /** + * The SID of the Workflow that you would like to handle routing for the new Task. If there is only one Workflow defined for the Workspace that you are posting the new task to, this parameter is optional. + * + * @param string $workflowSid The SID of the Workflow that you would like to handle routing for the new Task. If there is only one Workflow defined for the Workspace that you are posting the new task to, this parameter is optional. + * @return $this Fluent Builder + */ + public function setWorkflowSid(string $workflowSid): self + { + $this->options['workflowSid'] = $workflowSid; + return $this; + } + + /** + * A URL-encoded JSON string with the attributes of the new task. This value is passed to the Workflow's `assignment_callback_url` when the Task is assigned to a Worker. For example: `{ \\\"task_type\\\": \\\"call\\\", \\\"twilio_call_sid\\\": \\\"CAxxx\\\", \\\"customer_ticket_number\\\": \\\"12345\\\" }`. + * + * @param string $attributes A URL-encoded JSON string with the attributes of the new task. This value is passed to the Workflow's `assignment_callback_url` when the Task is assigned to a Worker. For example: `{ \\\"task_type\\\": \\\"call\\\", \\\"twilio_call_sid\\\": \\\"CAxxx\\\", \\\"customer_ticket_number\\\": \\\"12345\\\" }`. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.CreateTaskOptions ' . $options . ']'; + } +} + +class DeleteTaskOptions extends Options + { + /** + * @param string $ifMatch If provided, deletes this Task if (and only if) the [ETag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) header of the Task matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). + */ + public function __construct( + + string $ifMatch = Values::NONE + + ) { + $this->options['ifMatch'] = $ifMatch; + } + + /** + * If provided, deletes this Task if (and only if) the [ETag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) header of the Task matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). + * + * @param string $ifMatch If provided, deletes this Task if (and only if) the [ETag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) header of the Task matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). + * @return $this Fluent Builder + */ + public function setIfMatch(string $ifMatch): self + { + $this->options['ifMatch'] = $ifMatch; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.DeleteTaskOptions ' . $options . ']'; + } +} + + +class ReadTaskOptions extends Options + { + /** + * @param int $priority The priority value of the Tasks to read. Returns the list of all Tasks in the Workspace with the specified priority. + * @param string[] $assignmentStatus The `assignment_status` of the Tasks you want to read. Can be: `pending`, `reserved`, `assigned`, `canceled`, `wrapping`, or `completed`. Returns all Tasks in the Workspace with the specified `assignment_status`. + * @param string $workflowSid The SID of the Workflow with the Tasks to read. Returns the Tasks controlled by the Workflow identified by this SID. + * @param string $workflowName The friendly name of the Workflow with the Tasks to read. Returns the Tasks controlled by the Workflow identified by this friendly name. + * @param string $taskQueueSid The SID of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this SID. + * @param string $taskQueueName The `friendly_name` of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name. + * @param string $evaluateTaskAttributes The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. + * @param string $ordering How to order the returned Task resources. y default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `Priority` or `DateCreated` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Multiple sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. + * @param bool $hasAddons Whether to read Tasks with addons. If `true`, returns only Tasks with addons. If `false`, returns only Tasks without addons. + */ + public function __construct( + + int $priority = Values::INT_NONE, + array $assignmentStatus = Values::ARRAY_NONE, + string $workflowSid = Values::NONE, + string $workflowName = Values::NONE, + string $taskQueueSid = Values::NONE, + string $taskQueueName = Values::NONE, + string $evaluateTaskAttributes = Values::NONE, + string $ordering = Values::NONE, + bool $hasAddons = Values::BOOL_NONE + + ) { + $this->options['priority'] = $priority; + $this->options['assignmentStatus'] = $assignmentStatus; + $this->options['workflowSid'] = $workflowSid; + $this->options['workflowName'] = $workflowName; + $this->options['taskQueueSid'] = $taskQueueSid; + $this->options['taskQueueName'] = $taskQueueName; + $this->options['evaluateTaskAttributes'] = $evaluateTaskAttributes; + $this->options['ordering'] = $ordering; + $this->options['hasAddons'] = $hasAddons; + } + + /** + * The priority value of the Tasks to read. Returns the list of all Tasks in the Workspace with the specified priority. + * + * @param int $priority The priority value of the Tasks to read. Returns the list of all Tasks in the Workspace with the specified priority. + * @return $this Fluent Builder + */ + public function setPriority(int $priority): self + { + $this->options['priority'] = $priority; + return $this; + } + + /** + * The `assignment_status` of the Tasks you want to read. Can be: `pending`, `reserved`, `assigned`, `canceled`, `wrapping`, or `completed`. Returns all Tasks in the Workspace with the specified `assignment_status`. + * + * @param string[] $assignmentStatus The `assignment_status` of the Tasks you want to read. Can be: `pending`, `reserved`, `assigned`, `canceled`, `wrapping`, or `completed`. Returns all Tasks in the Workspace with the specified `assignment_status`. + * @return $this Fluent Builder + */ + public function setAssignmentStatus(array $assignmentStatus): self + { + $this->options['assignmentStatus'] = $assignmentStatus; + return $this; + } + + /** + * The SID of the Workflow with the Tasks to read. Returns the Tasks controlled by the Workflow identified by this SID. + * + * @param string $workflowSid The SID of the Workflow with the Tasks to read. Returns the Tasks controlled by the Workflow identified by this SID. + * @return $this Fluent Builder + */ + public function setWorkflowSid(string $workflowSid): self + { + $this->options['workflowSid'] = $workflowSid; + return $this; + } + + /** + * The friendly name of the Workflow with the Tasks to read. Returns the Tasks controlled by the Workflow identified by this friendly name. + * + * @param string $workflowName The friendly name of the Workflow with the Tasks to read. Returns the Tasks controlled by the Workflow identified by this friendly name. + * @return $this Fluent Builder + */ + public function setWorkflowName(string $workflowName): self + { + $this->options['workflowName'] = $workflowName; + return $this; + } + + /** + * The SID of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this SID. + * + * @param string $taskQueueSid The SID of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this SID. + * @return $this Fluent Builder + */ + public function setTaskQueueSid(string $taskQueueSid): self + { + $this->options['taskQueueSid'] = $taskQueueSid; + return $this; + } + + /** + * The `friendly_name` of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name. + * + * @param string $taskQueueName The `friendly_name` of the TaskQueue with the Tasks to read. Returns the Tasks waiting in the TaskQueue identified by this friendly name. + * @return $this Fluent Builder + */ + public function setTaskQueueName(string $taskQueueName): self + { + $this->options['taskQueueName'] = $taskQueueName; + return $this; + } + + /** + * The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. + * + * @param string $evaluateTaskAttributes The attributes of the Tasks to read. Returns the Tasks that match the attributes specified in this parameter. + * @return $this Fluent Builder + */ + public function setEvaluateTaskAttributes(string $evaluateTaskAttributes): self + { + $this->options['evaluateTaskAttributes'] = $evaluateTaskAttributes; + return $this; + } + + /** + * How to order the returned Task resources. y default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `Priority` or `DateCreated` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Multiple sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. + * + * @param string $ordering How to order the returned Task resources. y default, Tasks are sorted by ascending DateCreated. This value is specified as: `Attribute:Order`, where `Attribute` can be either `Priority` or `DateCreated` and `Order` can be either `asc` or `desc`. For example, `Priority:desc` returns Tasks ordered in descending order of their Priority. Multiple sort orders can be specified in a comma-separated list such as `Priority:desc,DateCreated:asc`, which returns the Tasks in descending Priority order and ascending DateCreated Order. + * @return $this Fluent Builder + */ + public function setOrdering(string $ordering): self + { + $this->options['ordering'] = $ordering; + return $this; + } + + /** + * Whether to read Tasks with addons. If `true`, returns only Tasks with addons. If `false`, returns only Tasks without addons. + * + * @param bool $hasAddons Whether to read Tasks with addons. If `true`, returns only Tasks with addons. If `false`, returns only Tasks without addons. + * @return $this Fluent Builder + */ + public function setHasAddons(bool $hasAddons): self + { + $this->options['hasAddons'] = $hasAddons; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.ReadTaskOptions ' . $options . ']'; + } +} + +class UpdateTaskOptions extends Options + { + /** + * @param string $attributes The JSON string that describes the custom attributes of the task. + * @param string $assignmentStatus + * @param string $reason The reason that the Task was canceled or completed. This parameter is required only if the Task is canceled or completed. Setting this value queues the task for deletion and logs the reason. + * @param int $priority The Task's new priority value. When supplied, the Task takes on the specified priority unless it matches a Workflow Target with a Priority set. Value can be 0 to 2^31^ (2,147,483,647). + * @param string $taskChannel When MultiTasking is enabled, specify the TaskChannel with the task to update. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * @param string $ifMatch If provided, applies this mutation if (and only if) the [ETag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) header of the Task matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). + */ + public function __construct( + + string $attributes = Values::NONE, + string $assignmentStatus = Values::NONE, + string $reason = Values::NONE, + int $priority = Values::INT_NONE, + string $taskChannel = Values::NONE, + string $ifMatch = Values::NONE + + ) { + $this->options['attributes'] = $attributes; + $this->options['assignmentStatus'] = $assignmentStatus; + $this->options['reason'] = $reason; + $this->options['priority'] = $priority; + $this->options['taskChannel'] = $taskChannel; + $this->options['ifMatch'] = $ifMatch; + } + + /** + * The JSON string that describes the custom attributes of the task. + * + * @param string $attributes The JSON string that describes the custom attributes of the task. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * @param string $assignmentStatus + * @return $this Fluent Builder + */ + public function setAssignmentStatus(string $assignmentStatus): self + { + $this->options['assignmentStatus'] = $assignmentStatus; + return $this; + } + + /** + * The reason that the Task was canceled or completed. This parameter is required only if the Task is canceled or completed. Setting this value queues the task for deletion and logs the reason. + * + * @param string $reason The reason that the Task was canceled or completed. This parameter is required only if the Task is canceled or completed. Setting this value queues the task for deletion and logs the reason. + * @return $this Fluent Builder + */ + public function setReason(string $reason): self + { + $this->options['reason'] = $reason; + return $this; + } + + /** + * The Task's new priority value. When supplied, the Task takes on the specified priority unless it matches a Workflow Target with a Priority set. Value can be 0 to 2^31^ (2,147,483,647). + * + * @param int $priority The Task's new priority value. When supplied, the Task takes on the specified priority unless it matches a Workflow Target with a Priority set. Value can be 0 to 2^31^ (2,147,483,647). + * @return $this Fluent Builder + */ + public function setPriority(int $priority): self + { + $this->options['priority'] = $priority; + return $this; + } + + /** + * When MultiTasking is enabled, specify the TaskChannel with the task to update. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * + * @param string $taskChannel When MultiTasking is enabled, specify the TaskChannel with the task to update. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * @return $this Fluent Builder + */ + public function setTaskChannel(string $taskChannel): self + { + $this->options['taskChannel'] = $taskChannel; + return $this; + } + + /** + * If provided, applies this mutation if (and only if) the [ETag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) header of the Task matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). + * + * @param string $ifMatch If provided, applies this mutation if (and only if) the [ETag](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag) header of the Task matches the provided value. This matches the semantics of (and is implemented with) the HTTP [If-Match header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match). + * @return $this Fluent Builder + */ + public function setIfMatch(string $ifMatch): self + { + $this->options['ifMatch'] = $ifMatch; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.UpdateTaskOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskPage.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskPage.php new file mode 100755 index 0000000..8ed271f --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TaskInstance \Twilio\Rest\Taskrouter\V1\Workspace\TaskInstance + */ + public function buildInstance(array $payload): TaskInstance + { + return new TaskInstance($this->version, $payload, $this->solution['workspaceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.TaskPage]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsContext.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsContext.php new file mode 100755 index 0000000..24c3d27 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsContext.php @@ -0,0 +1,106 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + 'taskQueueSid' => + $taskQueueSid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/TaskQueues/' . \rawurlencode($taskQueueSid) + .'/CumulativeStatistics'; + } + + /** + * Fetch the TaskQueueCumulativeStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return TaskQueueCumulativeStatisticsInstance Fetched TaskQueueCumulativeStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): TaskQueueCumulativeStatisticsInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'EndDate' => + Serialize::iso8601DateTime($options['endDate']), + 'Minutes' => + $options['minutes'], + 'StartDate' => + Serialize::iso8601DateTime($options['startDate']), + 'TaskChannel' => + $options['taskChannel'], + 'SplitByWaitTime' => + $options['splitByWaitTime'], + ]); + + $payload = $this->version->fetch('GET', $this->uri, $params); + + return new TaskQueueCumulativeStatisticsInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['taskQueueSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.TaskQueueCumulativeStatisticsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsInstance.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsInstance.php new file mode 100755 index 0000000..0c107e7 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsInstance.php @@ -0,0 +1,162 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'avgTaskAcceptanceTime' => Values::array_get($payload, 'avg_task_acceptance_time'), + 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), + 'endTime' => Deserialize::dateTime(Values::array_get($payload, 'end_time')), + 'reservationsCreated' => Values::array_get($payload, 'reservations_created'), + 'reservationsAccepted' => Values::array_get($payload, 'reservations_accepted'), + 'reservationsRejected' => Values::array_get($payload, 'reservations_rejected'), + 'reservationsTimedOut' => Values::array_get($payload, 'reservations_timed_out'), + 'reservationsCanceled' => Values::array_get($payload, 'reservations_canceled'), + 'reservationsRescinded' => Values::array_get($payload, 'reservations_rescinded'), + 'splitByWaitTime' => Values::array_get($payload, 'split_by_wait_time'), + 'taskQueueSid' => Values::array_get($payload, 'task_queue_sid'), + 'waitDurationUntilAccepted' => Values::array_get($payload, 'wait_duration_until_accepted'), + 'waitDurationUntilCanceled' => Values::array_get($payload, 'wait_duration_until_canceled'), + 'waitDurationInQueueUntilAccepted' => Values::array_get($payload, 'wait_duration_in_queue_until_accepted'), + 'tasksCanceled' => Values::array_get($payload, 'tasks_canceled'), + 'tasksCompleted' => Values::array_get($payload, 'tasks_completed'), + 'tasksDeleted' => Values::array_get($payload, 'tasks_deleted'), + 'tasksEntered' => Values::array_get($payload, 'tasks_entered'), + 'tasksMoved' => Values::array_get($payload, 'tasks_moved'), + 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['workspaceSid' => $workspaceSid, 'taskQueueSid' => $taskQueueSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return TaskQueueCumulativeStatisticsContext Context for this TaskQueueCumulativeStatisticsInstance + */ + protected function proxy(): TaskQueueCumulativeStatisticsContext + { + if (!$this->context) { + $this->context = new TaskQueueCumulativeStatisticsContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['taskQueueSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the TaskQueueCumulativeStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return TaskQueueCumulativeStatisticsInstance Fetched TaskQueueCumulativeStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): TaskQueueCumulativeStatisticsInstance + { + + return $this->proxy()->fetch($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.TaskQueueCumulativeStatisticsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsList.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsList.php new file mode 100755 index 0000000..02bafef --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsList.php @@ -0,0 +1,73 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + 'taskQueueSid' => + $taskQueueSid, + + ]; + } + + /** + * Constructs a TaskQueueCumulativeStatisticsContext + */ + public function getContext( + + ): TaskQueueCumulativeStatisticsContext + { + return new TaskQueueCumulativeStatisticsContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['taskQueueSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.TaskQueueCumulativeStatisticsList]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsOptions.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsOptions.php new file mode 100755 index 0000000..6f64cbe --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsOptions.php @@ -0,0 +1,148 @@ +options['endDate'] = $endDate; + $this->options['minutes'] = $minutes; + $this->options['startDate'] = $startDate; + $this->options['taskChannel'] = $taskChannel; + $this->options['splitByWaitTime'] = $splitByWaitTime; + } + + /** + * Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * + * @param \DateTime $endDate Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Only calculate statistics since this many minutes in the past. The default is 15 minutes. + * + * @param int $minutes Only calculate statistics since this many minutes in the past. The default is 15 minutes. + * @return $this Fluent Builder + */ + public function setMinutes(int $minutes): self + { + $this->options['minutes'] = $minutes; + return $this; + } + + /** + * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * + * @param \DateTime $startDate Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only calculate cumulative statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * + * @param string $taskChannel Only calculate cumulative statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * @return $this Fluent Builder + */ + public function setTaskChannel(string $taskChannel): self + { + $this->options['taskChannel'] = $taskChannel; + return $this; + } + + /** + * A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. TaskRouter will calculate statistics on up to 10,000 Tasks/Reservations for any given threshold. + * + * @param string $splitByWaitTime A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. TaskRouter will calculate statistics on up to 10,000 Tasks/Reservations for any given threshold. + * @return $this Fluent Builder + */ + public function setSplitByWaitTime(string $splitByWaitTime): self + { + $this->options['splitByWaitTime'] = $splitByWaitTime; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.FetchTaskQueueCumulativeStatisticsOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsPage.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsPage.php new file mode 100755 index 0000000..6eb608a --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueCumulativeStatisticsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TaskQueueCumulativeStatisticsInstance \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueCumulativeStatisticsInstance + */ + public function buildInstance(array $payload): TaskQueueCumulativeStatisticsInstance + { + return new TaskQueueCumulativeStatisticsInstance($this->version, $payload, $this->solution['workspaceSid'], $this->solution['taskQueueSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.TaskQueueCumulativeStatisticsPage]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsContext.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsContext.php new file mode 100755 index 0000000..62a8ad4 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsContext.php @@ -0,0 +1,97 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + 'taskQueueSid' => + $taskQueueSid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/TaskQueues/' . \rawurlencode($taskQueueSid) + .'/RealTimeStatistics'; + } + + /** + * Fetch the TaskQueueRealTimeStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return TaskQueueRealTimeStatisticsInstance Fetched TaskQueueRealTimeStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): TaskQueueRealTimeStatisticsInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'TaskChannel' => + $options['taskChannel'], + ]); + + $payload = $this->version->fetch('GET', $this->uri, $params); + + return new TaskQueueRealTimeStatisticsInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['taskQueueSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.TaskQueueRealTimeStatisticsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsInstance.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsInstance.php new file mode 100755 index 0000000..9f3d621 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsInstance.php @@ -0,0 +1,145 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'activityStatistics' => Values::array_get($payload, 'activity_statistics'), + 'longestTaskWaitingAge' => Values::array_get($payload, 'longest_task_waiting_age'), + 'longestTaskWaitingSid' => Values::array_get($payload, 'longest_task_waiting_sid'), + 'longestRelativeTaskAgeInQueue' => Values::array_get($payload, 'longest_relative_task_age_in_queue'), + 'longestRelativeTaskSidInQueue' => Values::array_get($payload, 'longest_relative_task_sid_in_queue'), + 'taskQueueSid' => Values::array_get($payload, 'task_queue_sid'), + 'tasksByPriority' => Values::array_get($payload, 'tasks_by_priority'), + 'tasksByStatus' => Values::array_get($payload, 'tasks_by_status'), + 'totalAvailableWorkers' => Values::array_get($payload, 'total_available_workers'), + 'totalEligibleWorkers' => Values::array_get($payload, 'total_eligible_workers'), + 'totalTasks' => Values::array_get($payload, 'total_tasks'), + 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['workspaceSid' => $workspaceSid, 'taskQueueSid' => $taskQueueSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return TaskQueueRealTimeStatisticsContext Context for this TaskQueueRealTimeStatisticsInstance + */ + protected function proxy(): TaskQueueRealTimeStatisticsContext + { + if (!$this->context) { + $this->context = new TaskQueueRealTimeStatisticsContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['taskQueueSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the TaskQueueRealTimeStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return TaskQueueRealTimeStatisticsInstance Fetched TaskQueueRealTimeStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): TaskQueueRealTimeStatisticsInstance + { + + return $this->proxy()->fetch($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.TaskQueueRealTimeStatisticsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsList.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsList.php new file mode 100755 index 0000000..450503b --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsList.php @@ -0,0 +1,73 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + 'taskQueueSid' => + $taskQueueSid, + + ]; + } + + /** + * Constructs a TaskQueueRealTimeStatisticsContext + */ + public function getContext( + + ): TaskQueueRealTimeStatisticsContext + { + return new TaskQueueRealTimeStatisticsContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['taskQueueSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.TaskQueueRealTimeStatisticsList]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsOptions.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsOptions.php new file mode 100755 index 0000000..860bb24 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsOptions.php @@ -0,0 +1,76 @@ +options['taskChannel'] = $taskChannel; + } + + /** + * The TaskChannel for which to fetch statistics. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * + * @param string $taskChannel The TaskChannel for which to fetch statistics. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * @return $this Fluent Builder + */ + public function setTaskChannel(string $taskChannel): self + { + $this->options['taskChannel'] = $taskChannel; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.FetchTaskQueueRealTimeStatisticsOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsPage.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsPage.php new file mode 100755 index 0000000..c70debd --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueRealTimeStatisticsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TaskQueueRealTimeStatisticsInstance \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueRealTimeStatisticsInstance + */ + public function buildInstance(array $payload): TaskQueueRealTimeStatisticsInstance + { + return new TaskQueueRealTimeStatisticsInstance($this->version, $payload, $this->solution['workspaceSid'], $this->solution['taskQueueSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.TaskQueueRealTimeStatisticsPage]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsContext.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsContext.php new file mode 100755 index 0000000..c27adcf --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsContext.php @@ -0,0 +1,106 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + 'taskQueueSid' => + $taskQueueSid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/TaskQueues/' . \rawurlencode($taskQueueSid) + .'/Statistics'; + } + + /** + * Fetch the TaskQueueStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return TaskQueueStatisticsInstance Fetched TaskQueueStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): TaskQueueStatisticsInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'EndDate' => + Serialize::iso8601DateTime($options['endDate']), + 'Minutes' => + $options['minutes'], + 'StartDate' => + Serialize::iso8601DateTime($options['startDate']), + 'TaskChannel' => + $options['taskChannel'], + 'SplitByWaitTime' => + $options['splitByWaitTime'], + ]); + + $payload = $this->version->fetch('GET', $this->uri, $params); + + return new TaskQueueStatisticsInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['taskQueueSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.TaskQueueStatisticsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsInstance.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsInstance.php new file mode 100755 index 0000000..246294d --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsInstance.php @@ -0,0 +1,129 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'cumulative' => Values::array_get($payload, 'cumulative'), + 'realtime' => Values::array_get($payload, 'realtime'), + 'taskQueueSid' => Values::array_get($payload, 'task_queue_sid'), + 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['workspaceSid' => $workspaceSid, 'taskQueueSid' => $taskQueueSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return TaskQueueStatisticsContext Context for this TaskQueueStatisticsInstance + */ + protected function proxy(): TaskQueueStatisticsContext + { + if (!$this->context) { + $this->context = new TaskQueueStatisticsContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['taskQueueSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the TaskQueueStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return TaskQueueStatisticsInstance Fetched TaskQueueStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): TaskQueueStatisticsInstance + { + + return $this->proxy()->fetch($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.TaskQueueStatisticsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsList.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsList.php new file mode 100755 index 0000000..95961de --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsList.php @@ -0,0 +1,73 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + 'taskQueueSid' => + $taskQueueSid, + + ]; + } + + /** + * Constructs a TaskQueueStatisticsContext + */ + public function getContext( + + ): TaskQueueStatisticsContext + { + return new TaskQueueStatisticsContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['taskQueueSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.TaskQueueStatisticsList]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsOptions.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsOptions.php new file mode 100755 index 0000000..d345f69 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsOptions.php @@ -0,0 +1,148 @@ +options['endDate'] = $endDate; + $this->options['minutes'] = $minutes; + $this->options['startDate'] = $startDate; + $this->options['taskChannel'] = $taskChannel; + $this->options['splitByWaitTime'] = $splitByWaitTime; + } + + /** + * Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * + * @param \DateTime $endDate Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Only calculate statistics since this many minutes in the past. The default is 15 minutes. + * + * @param int $minutes Only calculate statistics since this many minutes in the past. The default is 15 minutes. + * @return $this Fluent Builder + */ + public function setMinutes(int $minutes): self + { + $this->options['minutes'] = $minutes; + return $this; + } + + /** + * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * + * @param \DateTime $startDate Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only calculate real-time and cumulative statistics for the specified TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * + * @param string $taskChannel Only calculate real-time and cumulative statistics for the specified TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * @return $this Fluent Builder + */ + public function setTaskChannel(string $taskChannel): self + { + $this->options['taskChannel'] = $taskChannel; + return $this; + } + + /** + * A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. + * + * @param string $splitByWaitTime A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. + * @return $this Fluent Builder + */ + public function setSplitByWaitTime(string $splitByWaitTime): self + { + $this->options['splitByWaitTime'] = $splitByWaitTime; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.FetchTaskQueueStatisticsOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsPage.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsPage.php new file mode 100755 index 0000000..1500fdd --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueueStatisticsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TaskQueueStatisticsInstance \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueueStatisticsInstance + */ + public function buildInstance(array $payload): TaskQueueStatisticsInstance + { + return new TaskQueueStatisticsInstance($this->version, $payload, $this->solution['workspaceSid'], $this->solution['taskQueueSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.TaskQueueStatisticsPage]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsInstance.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsInstance.php new file mode 100755 index 0000000..8793fcc --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsInstance.php @@ -0,0 +1,89 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'cumulative' => Values::array_get($payload, 'cumulative'), + 'realtime' => Values::array_get($payload, 'realtime'), + 'taskQueueSid' => Values::array_get($payload, 'task_queue_sid'), + 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), + ]; + + $this->solution = ['workspaceSid' => $workspaceSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.TaskQueuesStatisticsInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsList.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsList.php new file mode 100755 index 0000000..a611422 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsList.php @@ -0,0 +1,169 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/TaskQueues/Statistics'; + } + + /** + * Reads TaskQueuesStatisticsInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return TaskQueuesStatisticsInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams TaskQueuesStatisticsInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of TaskQueuesStatisticsInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return TaskQueuesStatisticsPage Page of TaskQueuesStatisticsInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): TaskQueuesStatisticsPage + { + $options = new Values($options); + + $params = Values::of([ + 'EndDate' => + Serialize::iso8601DateTime($options['endDate']), + 'FriendlyName' => + $options['friendlyName'], + 'Minutes' => + $options['minutes'], + 'StartDate' => + Serialize::iso8601DateTime($options['startDate']), + 'TaskChannel' => + $options['taskChannel'], + 'SplitByWaitTime' => + $options['splitByWaitTime'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new TaskQueuesStatisticsPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of TaskQueuesStatisticsInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return TaskQueuesStatisticsPage Page of TaskQueuesStatisticsInstance + */ + public function getPage(string $targetUrl): TaskQueuesStatisticsPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new TaskQueuesStatisticsPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.TaskQueuesStatisticsList]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsOptions.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsOptions.php new file mode 100755 index 0000000..b68221c --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsOptions.php @@ -0,0 +1,166 @@ +options['endDate'] = $endDate; + $this->options['friendlyName'] = $friendlyName; + $this->options['minutes'] = $minutes; + $this->options['startDate'] = $startDate; + $this->options['taskChannel'] = $taskChannel; + $this->options['splitByWaitTime'] = $splitByWaitTime; + } + + /** + * Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * + * @param \DateTime $endDate Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * The `friendly_name` of the TaskQueue statistics to read. + * + * @param string $friendlyName The `friendly_name` of the TaskQueue statistics to read. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Only calculate statistics since this many minutes in the past. The default is 15 minutes. + * + * @param int $minutes Only calculate statistics since this many minutes in the past. The default is 15 minutes. + * @return $this Fluent Builder + */ + public function setMinutes(int $minutes): self + { + $this->options['minutes'] = $minutes; + return $this; + } + + /** + * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * + * @param \DateTime $startDate Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only calculate statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * + * @param string $taskChannel Only calculate statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * @return $this Fluent Builder + */ + public function setTaskChannel(string $taskChannel): self + { + $this->options['taskChannel'] = $taskChannel; + return $this; + } + + /** + * A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. + * + * @param string $splitByWaitTime A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. + * @return $this Fluent Builder + */ + public function setSplitByWaitTime(string $splitByWaitTime): self + { + $this->options['splitByWaitTime'] = $splitByWaitTime; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.ReadTaskQueuesStatisticsOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsPage.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsPage.php new file mode 100755 index 0000000..8d13bab --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueue/TaskQueuesStatisticsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TaskQueuesStatisticsInstance \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueue\TaskQueuesStatisticsInstance + */ + public function buildInstance(array $payload): TaskQueuesStatisticsInstance + { + return new TaskQueuesStatisticsInstance($this->version, $payload, $this->solution['workspaceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.TaskQueuesStatisticsPage]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueContext.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueContext.php new file mode 100755 index 0000000..5edb53a --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueContext.php @@ -0,0 +1,239 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/TaskQueues/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the TaskQueueInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the TaskQueueInstance + * + * @return TaskQueueInstance Fetched TaskQueueInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TaskQueueInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new TaskQueueInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the TaskQueueInstance + * + * @param array|Options $options Optional Arguments + * @return TaskQueueInstance Updated TaskQueueInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TaskQueueInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'TargetWorkers' => + $options['targetWorkers'], + 'ReservationActivitySid' => + $options['reservationActivitySid'], + 'AssignmentActivitySid' => + $options['assignmentActivitySid'], + 'MaxReservedWorkers' => + $options['maxReservedWorkers'], + 'TaskOrder' => + $options['taskOrder'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new TaskQueueInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the cumulativeStatistics + */ + protected function getCumulativeStatistics(): TaskQueueCumulativeStatisticsList + { + if (!$this->_cumulativeStatistics) { + $this->_cumulativeStatistics = new TaskQueueCumulativeStatisticsList( + $this->version, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + return $this->_cumulativeStatistics; + } + + /** + * Access the statistics + */ + protected function getStatistics(): TaskQueueStatisticsList + { + if (!$this->_statistics) { + $this->_statistics = new TaskQueueStatisticsList( + $this->version, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + return $this->_statistics; + } + + /** + * Access the realTimeStatistics + */ + protected function getRealTimeStatistics(): TaskQueueRealTimeStatisticsList + { + if (!$this->_realTimeStatistics) { + $this->_realTimeStatistics = new TaskQueueRealTimeStatisticsList( + $this->version, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + return $this->_realTimeStatistics; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.TaskQueueContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueInstance.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueInstance.php new file mode 100755 index 0000000..f18ad1a --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueInstance.php @@ -0,0 +1,203 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'assignmentActivitySid' => Values::array_get($payload, 'assignment_activity_sid'), + 'assignmentActivityName' => Values::array_get($payload, 'assignment_activity_name'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'maxReservedWorkers' => Values::array_get($payload, 'max_reserved_workers'), + 'reservationActivitySid' => Values::array_get($payload, 'reservation_activity_sid'), + 'reservationActivityName' => Values::array_get($payload, 'reservation_activity_name'), + 'sid' => Values::array_get($payload, 'sid'), + 'targetWorkers' => Values::array_get($payload, 'target_workers'), + 'taskOrder' => Values::array_get($payload, 'task_order'), + 'url' => Values::array_get($payload, 'url'), + 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['workspaceSid' => $workspaceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return TaskQueueContext Context for this TaskQueueInstance + */ + protected function proxy(): TaskQueueContext + { + if (!$this->context) { + $this->context = new TaskQueueContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the TaskQueueInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the TaskQueueInstance + * + * @return TaskQueueInstance Fetched TaskQueueInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TaskQueueInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the TaskQueueInstance + * + * @param array|Options $options Optional Arguments + * @return TaskQueueInstance Updated TaskQueueInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TaskQueueInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the cumulativeStatistics + */ + protected function getCumulativeStatistics(): TaskQueueCumulativeStatisticsList + { + return $this->proxy()->cumulativeStatistics; + } + + /** + * Access the statistics + */ + protected function getStatistics(): TaskQueueStatisticsList + { + return $this->proxy()->statistics; + } + + /** + * Access the realTimeStatistics + */ + protected function getRealTimeStatistics(): TaskQueueRealTimeStatisticsList + { + return $this->proxy()->realTimeStatistics; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.TaskQueueInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueList.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueList.php new file mode 100755 index 0000000..692634b --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueList.php @@ -0,0 +1,276 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/TaskQueues'; + } + + /** + * Create the TaskQueueInstance + * + * @param string $friendlyName A descriptive string that you create to describe the TaskQueue. For example `Support-Tier 1`, `Sales`, or `Escalation`. + * @param array|Options $options Optional Arguments + * @return TaskQueueInstance Created TaskQueueInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, array $options = []): TaskQueueInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'TargetWorkers' => + $options['targetWorkers'], + 'MaxReservedWorkers' => + $options['maxReservedWorkers'], + 'TaskOrder' => + $options['taskOrder'], + 'ReservationActivitySid' => + $options['reservationActivitySid'], + 'AssignmentActivitySid' => + $options['assignmentActivitySid'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new TaskQueueInstance( + $this->version, + $payload, + $this->solution['workspaceSid'] + ); + } + + + /** + * Reads TaskQueueInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return TaskQueueInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams TaskQueueInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of TaskQueueInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return TaskQueuePage Page of TaskQueueInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): TaskQueuePage + { + $options = new Values($options); + + $params = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'EvaluateWorkerAttributes' => + $options['evaluateWorkerAttributes'], + 'WorkerSid' => + $options['workerSid'], + 'Ordering' => + $options['ordering'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new TaskQueuePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of TaskQueueInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return TaskQueuePage Page of TaskQueueInstance + */ + public function getPage(string $targetUrl): TaskQueuePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new TaskQueuePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a TaskQueueContext + * + * @param string $sid The SID of the TaskQueue resource to delete. + */ + public function getContext( + string $sid + + ): TaskQueueContext + { + return new TaskQueueContext( + $this->version, + $this->solution['workspaceSid'], + $sid + ); + } + + /** + * Access the statistics + */ + protected function getStatistics(): TaskQueuesStatisticsList + { + if (!$this->_statistics) { + $this->_statistics = new TaskQueuesStatisticsList( + $this->version, + $this->solution['workspaceSid'] + ); + } + return $this->_statistics; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name) + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.TaskQueueList]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueOptions.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueOptions.php new file mode 100755 index 0000000..3454c54 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueueOptions.php @@ -0,0 +1,396 @@ +options['targetWorkers'] = $targetWorkers; + $this->options['maxReservedWorkers'] = $maxReservedWorkers; + $this->options['taskOrder'] = $taskOrder; + $this->options['reservationActivitySid'] = $reservationActivitySid; + $this->options['assignmentActivitySid'] = $assignmentActivitySid; + } + + /** + * A string that describes the Worker selection criteria for any Tasks that enter the TaskQueue. For example, `'\\\"language\\\" == \\\"spanish\\\"'`. The default value is `1==1`. If this value is empty, Tasks will wait in the TaskQueue until they are deleted or moved to another TaskQueue. For more information about Worker selection, see [Describing Worker selection criteria](https://www.twilio.com/docs/taskrouter/api/taskqueues#target-workers). + * + * @param string $targetWorkers A string that describes the Worker selection criteria for any Tasks that enter the TaskQueue. For example, `'\\\"language\\\" == \\\"spanish\\\"'`. The default value is `1==1`. If this value is empty, Tasks will wait in the TaskQueue until they are deleted or moved to another TaskQueue. For more information about Worker selection, see [Describing Worker selection criteria](https://www.twilio.com/docs/taskrouter/api/taskqueues#target-workers). + * @return $this Fluent Builder + */ + public function setTargetWorkers(string $targetWorkers): self + { + $this->options['targetWorkers'] = $targetWorkers; + return $this; + } + + /** + * The maximum number of Workers to reserve for the assignment of a Task in the queue. Can be an integer between 1 and 50, inclusive and defaults to 1. + * + * @param int $maxReservedWorkers The maximum number of Workers to reserve for the assignment of a Task in the queue. Can be an integer between 1 and 50, inclusive and defaults to 1. + * @return $this Fluent Builder + */ + public function setMaxReservedWorkers(int $maxReservedWorkers): self + { + $this->options['maxReservedWorkers'] = $maxReservedWorkers; + return $this; + } + + /** + * @param string $taskOrder + * @return $this Fluent Builder + */ + public function setTaskOrder(string $taskOrder): self + { + $this->options['taskOrder'] = $taskOrder; + return $this; + } + + /** + * The SID of the Activity to assign Workers when a task is reserved for them. + * + * @param string $reservationActivitySid The SID of the Activity to assign Workers when a task is reserved for them. + * @return $this Fluent Builder + */ + public function setReservationActivitySid(string $reservationActivitySid): self + { + $this->options['reservationActivitySid'] = $reservationActivitySid; + return $this; + } + + /** + * The SID of the Activity to assign Workers when a task is assigned to them. + * + * @param string $assignmentActivitySid The SID of the Activity to assign Workers when a task is assigned to them. + * @return $this Fluent Builder + */ + public function setAssignmentActivitySid(string $assignmentActivitySid): self + { + $this->options['assignmentActivitySid'] = $assignmentActivitySid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.CreateTaskQueueOptions ' . $options . ']'; + } +} + + + +class ReadTaskQueueOptions extends Options + { + /** + * @param string $friendlyName The `friendly_name` of the TaskQueue resources to read. + * @param string $evaluateWorkerAttributes The attributes of the Workers to read. Returns the TaskQueues with Workers that match the attributes specified in this parameter. + * @param string $workerSid The SID of the Worker with the TaskQueue resources to read. + * @param string $ordering Sorting parameter for TaskQueues + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $evaluateWorkerAttributes = Values::NONE, + string $workerSid = Values::NONE, + string $ordering = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['evaluateWorkerAttributes'] = $evaluateWorkerAttributes; + $this->options['workerSid'] = $workerSid; + $this->options['ordering'] = $ordering; + } + + /** + * The `friendly_name` of the TaskQueue resources to read. + * + * @param string $friendlyName The `friendly_name` of the TaskQueue resources to read. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The attributes of the Workers to read. Returns the TaskQueues with Workers that match the attributes specified in this parameter. + * + * @param string $evaluateWorkerAttributes The attributes of the Workers to read. Returns the TaskQueues with Workers that match the attributes specified in this parameter. + * @return $this Fluent Builder + */ + public function setEvaluateWorkerAttributes(string $evaluateWorkerAttributes): self + { + $this->options['evaluateWorkerAttributes'] = $evaluateWorkerAttributes; + return $this; + } + + /** + * The SID of the Worker with the TaskQueue resources to read. + * + * @param string $workerSid The SID of the Worker with the TaskQueue resources to read. + * @return $this Fluent Builder + */ + public function setWorkerSid(string $workerSid): self + { + $this->options['workerSid'] = $workerSid; + return $this; + } + + /** + * Sorting parameter for TaskQueues + * + * @param string $ordering Sorting parameter for TaskQueues + * @return $this Fluent Builder + */ + public function setOrdering(string $ordering): self + { + $this->options['ordering'] = $ordering; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.ReadTaskQueueOptions ' . $options . ']'; + } +} + +class UpdateTaskQueueOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the TaskQueue. For example `Support-Tier 1`, `Sales`, or `Escalation`. + * @param string $targetWorkers A string describing the Worker selection criteria for any Tasks that enter the TaskQueue. For example '\\\"language\\\" == \\\"spanish\\\"' If no TargetWorkers parameter is provided, Tasks will wait in the queue until they are either deleted or moved to another queue. Additional examples on how to describing Worker selection criteria below. + * @param string $reservationActivitySid The SID of the Activity to assign Workers when a task is reserved for them. + * @param string $assignmentActivitySid The SID of the Activity to assign Workers when a task is assigned for them. + * @param int $maxReservedWorkers The maximum number of Workers to create reservations for the assignment of a task while in the queue. Maximum of 50. + * @param string $taskOrder + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $targetWorkers = Values::NONE, + string $reservationActivitySid = Values::NONE, + string $assignmentActivitySid = Values::NONE, + int $maxReservedWorkers = Values::INT_NONE, + string $taskOrder = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['targetWorkers'] = $targetWorkers; + $this->options['reservationActivitySid'] = $reservationActivitySid; + $this->options['assignmentActivitySid'] = $assignmentActivitySid; + $this->options['maxReservedWorkers'] = $maxReservedWorkers; + $this->options['taskOrder'] = $taskOrder; + } + + /** + * A descriptive string that you create to describe the TaskQueue. For example `Support-Tier 1`, `Sales`, or `Escalation`. + * + * @param string $friendlyName A descriptive string that you create to describe the TaskQueue. For example `Support-Tier 1`, `Sales`, or `Escalation`. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * A string describing the Worker selection criteria for any Tasks that enter the TaskQueue. For example '\\\"language\\\" == \\\"spanish\\\"' If no TargetWorkers parameter is provided, Tasks will wait in the queue until they are either deleted or moved to another queue. Additional examples on how to describing Worker selection criteria below. + * + * @param string $targetWorkers A string describing the Worker selection criteria for any Tasks that enter the TaskQueue. For example '\\\"language\\\" == \\\"spanish\\\"' If no TargetWorkers parameter is provided, Tasks will wait in the queue until they are either deleted or moved to another queue. Additional examples on how to describing Worker selection criteria below. + * @return $this Fluent Builder + */ + public function setTargetWorkers(string $targetWorkers): self + { + $this->options['targetWorkers'] = $targetWorkers; + return $this; + } + + /** + * The SID of the Activity to assign Workers when a task is reserved for them. + * + * @param string $reservationActivitySid The SID of the Activity to assign Workers when a task is reserved for them. + * @return $this Fluent Builder + */ + public function setReservationActivitySid(string $reservationActivitySid): self + { + $this->options['reservationActivitySid'] = $reservationActivitySid; + return $this; + } + + /** + * The SID of the Activity to assign Workers when a task is assigned for them. + * + * @param string $assignmentActivitySid The SID of the Activity to assign Workers when a task is assigned for them. + * @return $this Fluent Builder + */ + public function setAssignmentActivitySid(string $assignmentActivitySid): self + { + $this->options['assignmentActivitySid'] = $assignmentActivitySid; + return $this; + } + + /** + * The maximum number of Workers to create reservations for the assignment of a task while in the queue. Maximum of 50. + * + * @param int $maxReservedWorkers The maximum number of Workers to create reservations for the assignment of a task while in the queue. Maximum of 50. + * @return $this Fluent Builder + */ + public function setMaxReservedWorkers(int $maxReservedWorkers): self + { + $this->options['maxReservedWorkers'] = $maxReservedWorkers; + return $this; + } + + /** + * @param string $taskOrder + * @return $this Fluent Builder + */ + public function setTaskOrder(string $taskOrder): self + { + $this->options['taskOrder'] = $taskOrder; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.UpdateTaskQueueOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueuePage.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueuePage.php new file mode 100755 index 0000000..6289874 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/TaskQueuePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TaskQueueInstance \Twilio\Rest\Taskrouter\V1\Workspace\TaskQueueInstance + */ + public function buildInstance(array $payload): TaskQueueInstance + { + return new TaskQueueInstance($this->version, $payload, $this->solution['workspaceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.TaskQueuePage]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationContext.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationContext.php new file mode 100755 index 0000000..02de6f1 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationContext.php @@ -0,0 +1,227 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + 'workerSid' => + $workerSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Workers/' . \rawurlencode($workerSid) + .'/Reservations/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the ReservationInstance + * + * @return ReservationInstance Fetched ReservationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ReservationInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ReservationInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['workerSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ReservationInstance + * + * @param array|Options $options Optional Arguments + * @return ReservationInstance Updated ReservationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ReservationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'ReservationStatus' => + $options['reservationStatus'], + 'WorkerActivitySid' => + $options['workerActivitySid'], + 'Instruction' => + $options['instruction'], + 'DequeuePostWorkActivitySid' => + $options['dequeuePostWorkActivitySid'], + 'DequeueFrom' => + $options['dequeueFrom'], + 'DequeueRecord' => + $options['dequeueRecord'], + 'DequeueTimeout' => + $options['dequeueTimeout'], + 'DequeueTo' => + $options['dequeueTo'], + 'DequeueStatusCallbackUrl' => + $options['dequeueStatusCallbackUrl'], + 'CallFrom' => + $options['callFrom'], + 'CallRecord' => + $options['callRecord'], + 'CallTimeout' => + $options['callTimeout'], + 'CallTo' => + $options['callTo'], + 'CallUrl' => + $options['callUrl'], + 'CallStatusCallbackUrl' => + $options['callStatusCallbackUrl'], + 'CallAccept' => + Serialize::booleanToString($options['callAccept']), + 'RedirectCallSid' => + $options['redirectCallSid'], + 'RedirectAccept' => + Serialize::booleanToString($options['redirectAccept']), + 'RedirectUrl' => + $options['redirectUrl'], + 'To' => + $options['to'], + 'From' => + $options['from'], + 'StatusCallback' => + $options['statusCallback'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'StatusCallbackEvent' => + $options['statusCallbackEvent'], + 'Timeout' => + $options['timeout'], + 'Record' => + Serialize::booleanToString($options['record']), + 'Muted' => + Serialize::booleanToString($options['muted']), + 'Beep' => + $options['beep'], + 'StartConferenceOnEnter' => + Serialize::booleanToString($options['startConferenceOnEnter']), + 'EndConferenceOnExit' => + Serialize::booleanToString($options['endConferenceOnExit']), + 'WaitUrl' => + $options['waitUrl'], + 'WaitMethod' => + $options['waitMethod'], + 'EarlyMedia' => + Serialize::booleanToString($options['earlyMedia']), + 'MaxParticipants' => + $options['maxParticipants'], + 'ConferenceStatusCallback' => + $options['conferenceStatusCallback'], + 'ConferenceStatusCallbackMethod' => + $options['conferenceStatusCallbackMethod'], + 'ConferenceStatusCallbackEvent' => + $options['conferenceStatusCallbackEvent'], + 'ConferenceRecord' => + $options['conferenceRecord'], + 'ConferenceTrim' => + $options['conferenceTrim'], + 'RecordingChannels' => + $options['recordingChannels'], + 'RecordingStatusCallback' => + $options['recordingStatusCallback'], + 'RecordingStatusCallbackMethod' => + $options['recordingStatusCallbackMethod'], + 'ConferenceRecordingStatusCallback' => + $options['conferenceRecordingStatusCallback'], + 'ConferenceRecordingStatusCallbackMethod' => + $options['conferenceRecordingStatusCallbackMethod'], + 'Region' => + $options['region'], + 'SipAuthUsername' => + $options['sipAuthUsername'], + 'SipAuthPassword' => + $options['sipAuthPassword'], + 'DequeueStatusCallbackEvent' => + Serialize::map($options['dequeueStatusCallbackEvent'], function ($e) { return $e; }), + 'PostWorkActivitySid' => + $options['postWorkActivitySid'], + 'EndConferenceOnCustomerExit' => + Serialize::booleanToString($options['endConferenceOnCustomerExit']), + 'BeepOnCustomerEntrance' => + Serialize::booleanToString($options['beepOnCustomerEntrance']), + ]); + + $headers = Values::of(['If-Match' => $options['ifMatch']]); + + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new ReservationInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['workerSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.ReservationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationInstance.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationInstance.php new file mode 100755 index 0000000..8d41959 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationInstance.php @@ -0,0 +1,154 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'reservationStatus' => Values::array_get($payload, 'reservation_status'), + 'sid' => Values::array_get($payload, 'sid'), + 'taskSid' => Values::array_get($payload, 'task_sid'), + 'workerName' => Values::array_get($payload, 'worker_name'), + 'workerSid' => Values::array_get($payload, 'worker_sid'), + 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['workspaceSid' => $workspaceSid, 'workerSid' => $workerSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ReservationContext Context for this ReservationInstance + */ + protected function proxy(): ReservationContext + { + if (!$this->context) { + $this->context = new ReservationContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['workerSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the ReservationInstance + * + * @return ReservationInstance Fetched ReservationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ReservationInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ReservationInstance + * + * @param array|Options $options Optional Arguments + * @return ReservationInstance Updated ReservationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ReservationInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.ReservationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationList.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationList.php new file mode 100755 index 0000000..e35ce70 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationList.php @@ -0,0 +1,182 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + 'workerSid' => + $workerSid, + + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Workers/' . \rawurlencode($workerSid) + .'/Reservations'; + } + + /** + * Reads ReservationInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ReservationInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams ReservationInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ReservationInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ReservationPage Page of ReservationInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ReservationPage + { + $options = new Values($options); + + $params = Values::of([ + 'ReservationStatus' => + $options['reservationStatus'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ReservationPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ReservationInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ReservationPage Page of ReservationInstance + */ + public function getPage(string $targetUrl): ReservationPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ReservationPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ReservationContext + * + * @param string $sid The SID of the WorkerReservation resource to fetch. + */ + public function getContext( + string $sid + + ): ReservationContext + { + return new ReservationContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['workerSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.ReservationList]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationOptions.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationOptions.php new file mode 100755 index 0000000..0a525e4 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationOptions.php @@ -0,0 +1,1046 @@ +options['reservationStatus'] = $reservationStatus; + } + + /** + * Returns the list of reservations for a worker with a specified ReservationStatus. Can be: `pending`, `accepted`, `rejected`, `timeout`, `canceled`, or `rescinded`. + * + * @param string $reservationStatus Returns the list of reservations for a worker with a specified ReservationStatus. Can be: `pending`, `accepted`, `rejected`, `timeout`, `canceled`, or `rescinded`. + * @return $this Fluent Builder + */ + public function setReservationStatus(string $reservationStatus): self + { + $this->options['reservationStatus'] = $reservationStatus; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.ReadReservationOptions ' . $options . ']'; + } +} + +class UpdateReservationOptions extends Options + { + /** + * @param string $reservationStatus + * @param string $workerActivitySid The new worker activity SID if rejecting a reservation. + * @param string $instruction The assignment instruction for the reservation. + * @param string $dequeuePostWorkActivitySid The SID of the Activity resource to start after executing a Dequeue instruction. + * @param string $dequeueFrom The caller ID of the call to the worker when executing a Dequeue instruction. + * @param string $dequeueRecord Whether to record both legs of a call when executing a Dequeue instruction or which leg to record. + * @param int $dequeueTimeout The timeout for call when executing a Dequeue instruction. + * @param string $dequeueTo The contact URI of the worker when executing a Dequeue instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. + * @param string $dequeueStatusCallbackUrl The callback URL for completed call event when executing a Dequeue instruction. + * @param string $callFrom The Caller ID of the outbound call when executing a Call instruction. + * @param string $callRecord Whether to record both legs of a call when executing a Call instruction. + * @param int $callTimeout The timeout for a call when executing a Call instruction. + * @param string $callTo The contact URI of the worker when executing a Call instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. + * @param string $callUrl TwiML URI executed on answering the worker's leg as a result of the Call instruction. + * @param string $callStatusCallbackUrl The URL to call for the completed call event when executing a Call instruction. + * @param bool $callAccept Whether to accept a reservation when executing a Call instruction. + * @param string $redirectCallSid The Call SID of the call parked in the queue when executing a Redirect instruction. + * @param bool $redirectAccept Whether the reservation should be accepted when executing a Redirect instruction. + * @param string $redirectUrl TwiML URI to redirect the call to when executing the Redirect instruction. + * @param string $to The Contact URI of the worker when executing a Conference instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. + * @param string $from The caller ID of the call to the worker when executing a Conference instruction. + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. + * @param string $statusCallbackEvent The call progress events that we will send to `status_callback`. Can be: `initiated`, `ringing`, `answered`, or `completed`. + * @param int $timeout The timeout for a call when executing a Conference instruction. + * @param bool $record Whether to record the participant and their conferences, including the time between conferences. Can be `true` or `false` and the default is `false`. + * @param bool $muted Whether the agent is muted in the conference. Defaults to `false`. + * @param string $beep Whether to play a notification beep when the participant joins or when to play a beep. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. + * @param bool $startConferenceOnEnter Whether to start the conference when the participant joins, if it has not already started. Can be: `true` or `false` and the default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. + * @param bool $endConferenceOnExit Whether to end the conference when the agent leaves. + * @param string $waitUrl The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). + * @param string $waitMethod The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. + * @param bool $earlyMedia Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. The default is `true`. + * @param int $maxParticipants The maximum number of participants allowed in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. + * @param string $conferenceStatusCallback The URL we should call using the `conference_status_callback_method` when the conference events in `conference_status_callback_event` occur. Only the value set by the first participant to join the conference is used. Subsequent `conference_status_callback` values are ignored. + * @param string $conferenceStatusCallbackMethod The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @param string $conferenceStatusCallbackEvent The conference status events that we will send to `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, `hold`, `speaker`. + * @param string $conferenceRecord Whether to record the conference the participant is joining or when to record the conference. Can be: `true`, `false`, `record-from-start`, and `do-not-record`. The default value is `false`. + * @param string $conferenceTrim Whether to trim leading and trailing silence from your recorded conference audio files. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`. + * @param string $recordingChannels The recording channels for the final recording. Can be: `mono` or `dual` and the default is `mono`. + * @param string $recordingStatusCallback The URL that we should call using the `recording_status_callback_method` when the recording status changes. + * @param string $recordingStatusCallbackMethod The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @param string $conferenceRecordingStatusCallback The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. + * @param string $conferenceRecordingStatusCallbackMethod The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @param string $region The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. + * @param string $sipAuthUsername The SIP username used for authentication. + * @param string $sipAuthPassword The SIP password for authentication. + * @param string[] $dequeueStatusCallbackEvent The call progress events sent via webhooks as a result of a Dequeue instruction. + * @param string $postWorkActivitySid The new worker activity SID after executing a Conference instruction. + * @param bool $endConferenceOnCustomerExit Whether to end the conference when the customer leaves. + * @param bool $beepOnCustomerEntrance Whether to play a notification beep when the customer joins. + * @param string $ifMatch The If-Match HTTP request header + */ + public function __construct( + + string $reservationStatus = Values::NONE, + string $workerActivitySid = Values::NONE, + string $instruction = Values::NONE, + string $dequeuePostWorkActivitySid = Values::NONE, + string $dequeueFrom = Values::NONE, + string $dequeueRecord = Values::NONE, + int $dequeueTimeout = Values::INT_NONE, + string $dequeueTo = Values::NONE, + string $dequeueStatusCallbackUrl = Values::NONE, + string $callFrom = Values::NONE, + string $callRecord = Values::NONE, + int $callTimeout = Values::INT_NONE, + string $callTo = Values::NONE, + string $callUrl = Values::NONE, + string $callStatusCallbackUrl = Values::NONE, + bool $callAccept = Values::BOOL_NONE, + string $redirectCallSid = Values::NONE, + bool $redirectAccept = Values::BOOL_NONE, + string $redirectUrl = Values::NONE, + string $to = Values::NONE, + string $from = Values::NONE, + string $statusCallback = Values::NONE, + string $statusCallbackMethod = Values::NONE, + array $statusCallbackEvent = Values::ARRAY_NONE, + int $timeout = Values::INT_NONE, + bool $record = Values::BOOL_NONE, + bool $muted = Values::BOOL_NONE, + string $beep = Values::NONE, + bool $startConferenceOnEnter = Values::BOOL_NONE, + bool $endConferenceOnExit = Values::BOOL_NONE, + string $waitUrl = Values::NONE, + string $waitMethod = Values::NONE, + bool $earlyMedia = Values::BOOL_NONE, + int $maxParticipants = Values::INT_NONE, + string $conferenceStatusCallback = Values::NONE, + string $conferenceStatusCallbackMethod = Values::NONE, + array $conferenceStatusCallbackEvent = Values::ARRAY_NONE, + string $conferenceRecord = Values::NONE, + string $conferenceTrim = Values::NONE, + string $recordingChannels = Values::NONE, + string $recordingStatusCallback = Values::NONE, + string $recordingStatusCallbackMethod = Values::NONE, + string $conferenceRecordingStatusCallback = Values::NONE, + string $conferenceRecordingStatusCallbackMethod = Values::NONE, + string $region = Values::NONE, + string $sipAuthUsername = Values::NONE, + string $sipAuthPassword = Values::NONE, + array $dequeueStatusCallbackEvent = Values::ARRAY_NONE, + string $postWorkActivitySid = Values::NONE, + bool $endConferenceOnCustomerExit = Values::BOOL_NONE, + bool $beepOnCustomerEntrance = Values::BOOL_NONE, + string $ifMatch = Values::NONE + + ) { + $this->options['reservationStatus'] = $reservationStatus; + $this->options['workerActivitySid'] = $workerActivitySid; + $this->options['instruction'] = $instruction; + $this->options['dequeuePostWorkActivitySid'] = $dequeuePostWorkActivitySid; + $this->options['dequeueFrom'] = $dequeueFrom; + $this->options['dequeueRecord'] = $dequeueRecord; + $this->options['dequeueTimeout'] = $dequeueTimeout; + $this->options['dequeueTo'] = $dequeueTo; + $this->options['dequeueStatusCallbackUrl'] = $dequeueStatusCallbackUrl; + $this->options['callFrom'] = $callFrom; + $this->options['callRecord'] = $callRecord; + $this->options['callTimeout'] = $callTimeout; + $this->options['callTo'] = $callTo; + $this->options['callUrl'] = $callUrl; + $this->options['callStatusCallbackUrl'] = $callStatusCallbackUrl; + $this->options['callAccept'] = $callAccept; + $this->options['redirectCallSid'] = $redirectCallSid; + $this->options['redirectAccept'] = $redirectAccept; + $this->options['redirectUrl'] = $redirectUrl; + $this->options['to'] = $to; + $this->options['from'] = $from; + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['statusCallbackEvent'] = $statusCallbackEvent; + $this->options['timeout'] = $timeout; + $this->options['record'] = $record; + $this->options['muted'] = $muted; + $this->options['beep'] = $beep; + $this->options['startConferenceOnEnter'] = $startConferenceOnEnter; + $this->options['endConferenceOnExit'] = $endConferenceOnExit; + $this->options['waitUrl'] = $waitUrl; + $this->options['waitMethod'] = $waitMethod; + $this->options['earlyMedia'] = $earlyMedia; + $this->options['maxParticipants'] = $maxParticipants; + $this->options['conferenceStatusCallback'] = $conferenceStatusCallback; + $this->options['conferenceStatusCallbackMethod'] = $conferenceStatusCallbackMethod; + $this->options['conferenceStatusCallbackEvent'] = $conferenceStatusCallbackEvent; + $this->options['conferenceRecord'] = $conferenceRecord; + $this->options['conferenceTrim'] = $conferenceTrim; + $this->options['recordingChannels'] = $recordingChannels; + $this->options['recordingStatusCallback'] = $recordingStatusCallback; + $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; + $this->options['conferenceRecordingStatusCallback'] = $conferenceRecordingStatusCallback; + $this->options['conferenceRecordingStatusCallbackMethod'] = $conferenceRecordingStatusCallbackMethod; + $this->options['region'] = $region; + $this->options['sipAuthUsername'] = $sipAuthUsername; + $this->options['sipAuthPassword'] = $sipAuthPassword; + $this->options['dequeueStatusCallbackEvent'] = $dequeueStatusCallbackEvent; + $this->options['postWorkActivitySid'] = $postWorkActivitySid; + $this->options['endConferenceOnCustomerExit'] = $endConferenceOnCustomerExit; + $this->options['beepOnCustomerEntrance'] = $beepOnCustomerEntrance; + $this->options['ifMatch'] = $ifMatch; + } + + /** + * @param string $reservationStatus + * @return $this Fluent Builder + */ + public function setReservationStatus(string $reservationStatus): self + { + $this->options['reservationStatus'] = $reservationStatus; + return $this; + } + + /** + * The new worker activity SID if rejecting a reservation. + * + * @param string $workerActivitySid The new worker activity SID if rejecting a reservation. + * @return $this Fluent Builder + */ + public function setWorkerActivitySid(string $workerActivitySid): self + { + $this->options['workerActivitySid'] = $workerActivitySid; + return $this; + } + + /** + * The assignment instruction for the reservation. + * + * @param string $instruction The assignment instruction for the reservation. + * @return $this Fluent Builder + */ + public function setInstruction(string $instruction): self + { + $this->options['instruction'] = $instruction; + return $this; + } + + /** + * The SID of the Activity resource to start after executing a Dequeue instruction. + * + * @param string $dequeuePostWorkActivitySid The SID of the Activity resource to start after executing a Dequeue instruction. + * @return $this Fluent Builder + */ + public function setDequeuePostWorkActivitySid(string $dequeuePostWorkActivitySid): self + { + $this->options['dequeuePostWorkActivitySid'] = $dequeuePostWorkActivitySid; + return $this; + } + + /** + * The caller ID of the call to the worker when executing a Dequeue instruction. + * + * @param string $dequeueFrom The caller ID of the call to the worker when executing a Dequeue instruction. + * @return $this Fluent Builder + */ + public function setDequeueFrom(string $dequeueFrom): self + { + $this->options['dequeueFrom'] = $dequeueFrom; + return $this; + } + + /** + * Whether to record both legs of a call when executing a Dequeue instruction or which leg to record. + * + * @param string $dequeueRecord Whether to record both legs of a call when executing a Dequeue instruction or which leg to record. + * @return $this Fluent Builder + */ + public function setDequeueRecord(string $dequeueRecord): self + { + $this->options['dequeueRecord'] = $dequeueRecord; + return $this; + } + + /** + * The timeout for call when executing a Dequeue instruction. + * + * @param int $dequeueTimeout The timeout for call when executing a Dequeue instruction. + * @return $this Fluent Builder + */ + public function setDequeueTimeout(int $dequeueTimeout): self + { + $this->options['dequeueTimeout'] = $dequeueTimeout; + return $this; + } + + /** + * The contact URI of the worker when executing a Dequeue instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. + * + * @param string $dequeueTo The contact URI of the worker when executing a Dequeue instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. + * @return $this Fluent Builder + */ + public function setDequeueTo(string $dequeueTo): self + { + $this->options['dequeueTo'] = $dequeueTo; + return $this; + } + + /** + * The callback URL for completed call event when executing a Dequeue instruction. + * + * @param string $dequeueStatusCallbackUrl The callback URL for completed call event when executing a Dequeue instruction. + * @return $this Fluent Builder + */ + public function setDequeueStatusCallbackUrl(string $dequeueStatusCallbackUrl): self + { + $this->options['dequeueStatusCallbackUrl'] = $dequeueStatusCallbackUrl; + return $this; + } + + /** + * The Caller ID of the outbound call when executing a Call instruction. + * + * @param string $callFrom The Caller ID of the outbound call when executing a Call instruction. + * @return $this Fluent Builder + */ + public function setCallFrom(string $callFrom): self + { + $this->options['callFrom'] = $callFrom; + return $this; + } + + /** + * Whether to record both legs of a call when executing a Call instruction. + * + * @param string $callRecord Whether to record both legs of a call when executing a Call instruction. + * @return $this Fluent Builder + */ + public function setCallRecord(string $callRecord): self + { + $this->options['callRecord'] = $callRecord; + return $this; + } + + /** + * The timeout for a call when executing a Call instruction. + * + * @param int $callTimeout The timeout for a call when executing a Call instruction. + * @return $this Fluent Builder + */ + public function setCallTimeout(int $callTimeout): self + { + $this->options['callTimeout'] = $callTimeout; + return $this; + } + + /** + * The contact URI of the worker when executing a Call instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. + * + * @param string $callTo The contact URI of the worker when executing a Call instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. + * @return $this Fluent Builder + */ + public function setCallTo(string $callTo): self + { + $this->options['callTo'] = $callTo; + return $this; + } + + /** + * TwiML URI executed on answering the worker's leg as a result of the Call instruction. + * + * @param string $callUrl TwiML URI executed on answering the worker's leg as a result of the Call instruction. + * @return $this Fluent Builder + */ + public function setCallUrl(string $callUrl): self + { + $this->options['callUrl'] = $callUrl; + return $this; + } + + /** + * The URL to call for the completed call event when executing a Call instruction. + * + * @param string $callStatusCallbackUrl The URL to call for the completed call event when executing a Call instruction. + * @return $this Fluent Builder + */ + public function setCallStatusCallbackUrl(string $callStatusCallbackUrl): self + { + $this->options['callStatusCallbackUrl'] = $callStatusCallbackUrl; + return $this; + } + + /** + * Whether to accept a reservation when executing a Call instruction. + * + * @param bool $callAccept Whether to accept a reservation when executing a Call instruction. + * @return $this Fluent Builder + */ + public function setCallAccept(bool $callAccept): self + { + $this->options['callAccept'] = $callAccept; + return $this; + } + + /** + * The Call SID of the call parked in the queue when executing a Redirect instruction. + * + * @param string $redirectCallSid The Call SID of the call parked in the queue when executing a Redirect instruction. + * @return $this Fluent Builder + */ + public function setRedirectCallSid(string $redirectCallSid): self + { + $this->options['redirectCallSid'] = $redirectCallSid; + return $this; + } + + /** + * Whether the reservation should be accepted when executing a Redirect instruction. + * + * @param bool $redirectAccept Whether the reservation should be accepted when executing a Redirect instruction. + * @return $this Fluent Builder + */ + public function setRedirectAccept(bool $redirectAccept): self + { + $this->options['redirectAccept'] = $redirectAccept; + return $this; + } + + /** + * TwiML URI to redirect the call to when executing the Redirect instruction. + * + * @param string $redirectUrl TwiML URI to redirect the call to when executing the Redirect instruction. + * @return $this Fluent Builder + */ + public function setRedirectUrl(string $redirectUrl): self + { + $this->options['redirectUrl'] = $redirectUrl; + return $this; + } + + /** + * The Contact URI of the worker when executing a Conference instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. + * + * @param string $to The Contact URI of the worker when executing a Conference instruction. Can be the URI of the Twilio Client, the SIP URI for Programmable SIP, or the [E.164](https://www.twilio.com/docs/glossary/what-e164) formatted phone number, depending on the destination. + * @return $this Fluent Builder + */ + public function setTo(string $to): self + { + $this->options['to'] = $to; + return $this; + } + + /** + * The caller ID of the call to the worker when executing a Conference instruction. + * + * @param string $from The caller ID of the call to the worker when executing a Conference instruction. + * @return $this Fluent Builder + */ + public function setFrom(string $from): self + { + $this->options['from'] = $from; + return $this; + } + + /** + * The URL we should call using the `status_callback_method` to send status information to your application. + * + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. + * + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * The call progress events that we will send to `status_callback`. Can be: `initiated`, `ringing`, `answered`, or `completed`. + * + * @param string $statusCallbackEvent The call progress events that we will send to `status_callback`. Can be: `initiated`, `ringing`, `answered`, or `completed`. + * @return $this Fluent Builder + */ + public function setStatusCallbackEvent(array $statusCallbackEvent): self + { + $this->options['statusCallbackEvent'] = $statusCallbackEvent; + return $this; + } + + /** + * The timeout for a call when executing a Conference instruction. + * + * @param int $timeout The timeout for a call when executing a Conference instruction. + * @return $this Fluent Builder + */ + public function setTimeout(int $timeout): self + { + $this->options['timeout'] = $timeout; + return $this; + } + + /** + * Whether to record the participant and their conferences, including the time between conferences. Can be `true` or `false` and the default is `false`. + * + * @param bool $record Whether to record the participant and their conferences, including the time between conferences. Can be `true` or `false` and the default is `false`. + * @return $this Fluent Builder + */ + public function setRecord(bool $record): self + { + $this->options['record'] = $record; + return $this; + } + + /** + * Whether the agent is muted in the conference. Defaults to `false`. + * + * @param bool $muted Whether the agent is muted in the conference. Defaults to `false`. + * @return $this Fluent Builder + */ + public function setMuted(bool $muted): self + { + $this->options['muted'] = $muted; + return $this; + } + + /** + * Whether to play a notification beep when the participant joins or when to play a beep. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. + * + * @param string $beep Whether to play a notification beep when the participant joins or when to play a beep. Can be: `true`, `false`, `onEnter`, or `onExit`. The default value is `true`. + * @return $this Fluent Builder + */ + public function setBeep(string $beep): self + { + $this->options['beep'] = $beep; + return $this; + } + + /** + * Whether to start the conference when the participant joins, if it has not already started. Can be: `true` or `false` and the default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. + * + * @param bool $startConferenceOnEnter Whether to start the conference when the participant joins, if it has not already started. Can be: `true` or `false` and the default is `true`. If `false` and the conference has not started, the participant is muted and hears background music until another participant starts the conference. + * @return $this Fluent Builder + */ + public function setStartConferenceOnEnter(bool $startConferenceOnEnter): self + { + $this->options['startConferenceOnEnter'] = $startConferenceOnEnter; + return $this; + } + + /** + * Whether to end the conference when the agent leaves. + * + * @param bool $endConferenceOnExit Whether to end the conference when the agent leaves. + * @return $this Fluent Builder + */ + public function setEndConferenceOnExit(bool $endConferenceOnExit): self + { + $this->options['endConferenceOnExit'] = $endConferenceOnExit; + return $this; + } + + /** + * The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). + * + * @param string $waitUrl The URL we should call using the `wait_method` for the music to play while participants are waiting for the conference to start. The default value is the URL of our standard hold music. [Learn more about hold music](https://www.twilio.com/labs/twimlets/holdmusic). + * @return $this Fluent Builder + */ + public function setWaitUrl(string $waitUrl): self + { + $this->options['waitUrl'] = $waitUrl; + return $this; + } + + /** + * The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. + * + * @param string $waitMethod The HTTP method we should use to call `wait_url`. Can be `GET` or `POST` and the default is `POST`. When using a static audio file, this should be `GET` so that we can cache the file. + * @return $this Fluent Builder + */ + public function setWaitMethod(string $waitMethod): self + { + $this->options['waitMethod'] = $waitMethod; + return $this; + } + + /** + * Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. The default is `true`. + * + * @param bool $earlyMedia Whether to allow an agent to hear the state of the outbound call, including ringing or disconnect messages. The default is `true`. + * @return $this Fluent Builder + */ + public function setEarlyMedia(bool $earlyMedia): self + { + $this->options['earlyMedia'] = $earlyMedia; + return $this; + } + + /** + * The maximum number of participants allowed in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. + * + * @param int $maxParticipants The maximum number of participants allowed in the conference. Can be a positive integer from `2` to `250`. The default value is `250`. + * @return $this Fluent Builder + */ + public function setMaxParticipants(int $maxParticipants): self + { + $this->options['maxParticipants'] = $maxParticipants; + return $this; + } + + /** + * The URL we should call using the `conference_status_callback_method` when the conference events in `conference_status_callback_event` occur. Only the value set by the first participant to join the conference is used. Subsequent `conference_status_callback` values are ignored. + * + * @param string $conferenceStatusCallback The URL we should call using the `conference_status_callback_method` when the conference events in `conference_status_callback_event` occur. Only the value set by the first participant to join the conference is used. Subsequent `conference_status_callback` values are ignored. + * @return $this Fluent Builder + */ + public function setConferenceStatusCallback(string $conferenceStatusCallback): self + { + $this->options['conferenceStatusCallback'] = $conferenceStatusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $conferenceStatusCallbackMethod The HTTP method we should use to call `conference_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setConferenceStatusCallbackMethod(string $conferenceStatusCallbackMethod): self + { + $this->options['conferenceStatusCallbackMethod'] = $conferenceStatusCallbackMethod; + return $this; + } + + /** + * The conference status events that we will send to `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, `hold`, `speaker`. + * + * @param string $conferenceStatusCallbackEvent The conference status events that we will send to `conference_status_callback`. Can be: `start`, `end`, `join`, `leave`, `mute`, `hold`, `speaker`. + * @return $this Fluent Builder + */ + public function setConferenceStatusCallbackEvent(array $conferenceStatusCallbackEvent): self + { + $this->options['conferenceStatusCallbackEvent'] = $conferenceStatusCallbackEvent; + return $this; + } + + /** + * Whether to record the conference the participant is joining or when to record the conference. Can be: `true`, `false`, `record-from-start`, and `do-not-record`. The default value is `false`. + * + * @param string $conferenceRecord Whether to record the conference the participant is joining or when to record the conference. Can be: `true`, `false`, `record-from-start`, and `do-not-record`. The default value is `false`. + * @return $this Fluent Builder + */ + public function setConferenceRecord(string $conferenceRecord): self + { + $this->options['conferenceRecord'] = $conferenceRecord; + return $this; + } + + /** + * Whether to trim leading and trailing silence from your recorded conference audio files. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`. + * + * @param string $conferenceTrim Whether to trim leading and trailing silence from your recorded conference audio files. Can be: `trim-silence` or `do-not-trim` and defaults to `trim-silence`. + * @return $this Fluent Builder + */ + public function setConferenceTrim(string $conferenceTrim): self + { + $this->options['conferenceTrim'] = $conferenceTrim; + return $this; + } + + /** + * The recording channels for the final recording. Can be: `mono` or `dual` and the default is `mono`. + * + * @param string $recordingChannels The recording channels for the final recording. Can be: `mono` or `dual` and the default is `mono`. + * @return $this Fluent Builder + */ + public function setRecordingChannels(string $recordingChannels): self + { + $this->options['recordingChannels'] = $recordingChannels; + return $this; + } + + /** + * The URL that we should call using the `recording_status_callback_method` when the recording status changes. + * + * @param string $recordingStatusCallback The URL that we should call using the `recording_status_callback_method` when the recording status changes. + * @return $this Fluent Builder + */ + public function setRecordingStatusCallback(string $recordingStatusCallback): self + { + $this->options['recordingStatusCallback'] = $recordingStatusCallback; + return $this; + } + + /** + * The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $recordingStatusCallbackMethod The HTTP method we should use when we call `recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setRecordingStatusCallbackMethod(string $recordingStatusCallbackMethod): self + { + $this->options['recordingStatusCallbackMethod'] = $recordingStatusCallbackMethod; + return $this; + } + + /** + * The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. + * + * @param string $conferenceRecordingStatusCallback The URL we should call using the `conference_recording_status_callback_method` when the conference recording is available. + * @return $this Fluent Builder + */ + public function setConferenceRecordingStatusCallback(string $conferenceRecordingStatusCallback): self + { + $this->options['conferenceRecordingStatusCallback'] = $conferenceRecordingStatusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * + * @param string $conferenceRecordingStatusCallbackMethod The HTTP method we should use to call `conference_recording_status_callback`. Can be: `GET` or `POST` and defaults to `POST`. + * @return $this Fluent Builder + */ + public function setConferenceRecordingStatusCallbackMethod(string $conferenceRecordingStatusCallbackMethod): self + { + $this->options['conferenceRecordingStatusCallbackMethod'] = $conferenceRecordingStatusCallbackMethod; + return $this; + } + + /** + * The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. + * + * @param string $region The [region](https://support.twilio.com/hc/en-us/articles/223132167-How-global-low-latency-routing-and-region-selection-work-for-conferences-and-Client-calls) where we should mix the recorded audio. Can be:`us1`, `ie1`, `de1`, `sg1`, `br1`, `au1`, or `jp1`. + * @return $this Fluent Builder + */ + public function setRegion(string $region): self + { + $this->options['region'] = $region; + return $this; + } + + /** + * The SIP username used for authentication. + * + * @param string $sipAuthUsername The SIP username used for authentication. + * @return $this Fluent Builder + */ + public function setSipAuthUsername(string $sipAuthUsername): self + { + $this->options['sipAuthUsername'] = $sipAuthUsername; + return $this; + } + + /** + * The SIP password for authentication. + * + * @param string $sipAuthPassword The SIP password for authentication. + * @return $this Fluent Builder + */ + public function setSipAuthPassword(string $sipAuthPassword): self + { + $this->options['sipAuthPassword'] = $sipAuthPassword; + return $this; + } + + /** + * The call progress events sent via webhooks as a result of a Dequeue instruction. + * + * @param string[] $dequeueStatusCallbackEvent The call progress events sent via webhooks as a result of a Dequeue instruction. + * @return $this Fluent Builder + */ + public function setDequeueStatusCallbackEvent(array $dequeueStatusCallbackEvent): self + { + $this->options['dequeueStatusCallbackEvent'] = $dequeueStatusCallbackEvent; + return $this; + } + + /** + * The new worker activity SID after executing a Conference instruction. + * + * @param string $postWorkActivitySid The new worker activity SID after executing a Conference instruction. + * @return $this Fluent Builder + */ + public function setPostWorkActivitySid(string $postWorkActivitySid): self + { + $this->options['postWorkActivitySid'] = $postWorkActivitySid; + return $this; + } + + /** + * Whether to end the conference when the customer leaves. + * + * @param bool $endConferenceOnCustomerExit Whether to end the conference when the customer leaves. + * @return $this Fluent Builder + */ + public function setEndConferenceOnCustomerExit(bool $endConferenceOnCustomerExit): self + { + $this->options['endConferenceOnCustomerExit'] = $endConferenceOnCustomerExit; + return $this; + } + + /** + * Whether to play a notification beep when the customer joins. + * + * @param bool $beepOnCustomerEntrance Whether to play a notification beep when the customer joins. + * @return $this Fluent Builder + */ + public function setBeepOnCustomerEntrance(bool $beepOnCustomerEntrance): self + { + $this->options['beepOnCustomerEntrance'] = $beepOnCustomerEntrance; + return $this; + } + + /** + * The If-Match HTTP request header + * + * @param string $ifMatch The If-Match HTTP request header + * @return $this Fluent Builder + */ + public function setIfMatch(string $ifMatch): self + { + $this->options['ifMatch'] = $ifMatch; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.UpdateReservationOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationPage.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationPage.php new file mode 100755 index 0000000..bca0154 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/ReservationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ReservationInstance \Twilio\Rest\Taskrouter\V1\Workspace\Worker\ReservationInstance + */ + public function buildInstance(array $payload): ReservationInstance + { + return new ReservationInstance($this->version, $payload, $this->solution['workspaceSid'], $this->solution['workerSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.ReservationPage]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelContext.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelContext.php new file mode 100755 index 0000000..a3350ce --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelContext.php @@ -0,0 +1,127 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + 'workerSid' => + $workerSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Workers/' . \rawurlencode($workerSid) + .'/Channels/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the WorkerChannelInstance + * + * @return WorkerChannelInstance Fetched WorkerChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WorkerChannelInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new WorkerChannelInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['workerSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the WorkerChannelInstance + * + * @param array|Options $options Optional Arguments + * @return WorkerChannelInstance Updated WorkerChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WorkerChannelInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Capacity' => + $options['capacity'], + 'Available' => + Serialize::booleanToString($options['available']), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new WorkerChannelInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['workerSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkerChannelContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelInstance.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelInstance.php new file mode 100755 index 0000000..f400724 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelInstance.php @@ -0,0 +1,158 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'assignedTasks' => Values::array_get($payload, 'assigned_tasks'), + 'available' => Values::array_get($payload, 'available'), + 'availableCapacityPercentage' => Values::array_get($payload, 'available_capacity_percentage'), + 'configuredCapacity' => Values::array_get($payload, 'configured_capacity'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'sid' => Values::array_get($payload, 'sid'), + 'taskChannelSid' => Values::array_get($payload, 'task_channel_sid'), + 'taskChannelUniqueName' => Values::array_get($payload, 'task_channel_unique_name'), + 'workerSid' => Values::array_get($payload, 'worker_sid'), + 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['workspaceSid' => $workspaceSid, 'workerSid' => $workerSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return WorkerChannelContext Context for this WorkerChannelInstance + */ + protected function proxy(): WorkerChannelContext + { + if (!$this->context) { + $this->context = new WorkerChannelContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['workerSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the WorkerChannelInstance + * + * @return WorkerChannelInstance Fetched WorkerChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WorkerChannelInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the WorkerChannelInstance + * + * @param array|Options $options Optional Arguments + * @return WorkerChannelInstance Updated WorkerChannelInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WorkerChannelInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkerChannelInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelList.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelList.php new file mode 100755 index 0000000..08b20e1 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelList.php @@ -0,0 +1,175 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + 'workerSid' => + $workerSid, + + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Workers/' . \rawurlencode($workerSid) + .'/Channels'; + } + + /** + * Reads WorkerChannelInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return WorkerChannelInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams WorkerChannelInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of WorkerChannelInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return WorkerChannelPage Page of WorkerChannelInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): WorkerChannelPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new WorkerChannelPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of WorkerChannelInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return WorkerChannelPage Page of WorkerChannelInstance + */ + public function getPage(string $targetUrl): WorkerChannelPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new WorkerChannelPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a WorkerChannelContext + * + * @param string $sid The SID of the WorkerChannel to fetch. + */ + public function getContext( + string $sid + + ): WorkerChannelContext + { + return new WorkerChannelContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['workerSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkerChannelList]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelOptions.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelOptions.php new file mode 100755 index 0000000..29a19b3 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelOptions.php @@ -0,0 +1,98 @@ +options['capacity'] = $capacity; + $this->options['available'] = $available; + } + + /** + * The total number of Tasks that the Worker should handle for the TaskChannel type. TaskRouter creates reservations for Tasks of this TaskChannel type up to the specified capacity. If the capacity is 0, no new reservations will be created. + * + * @param int $capacity The total number of Tasks that the Worker should handle for the TaskChannel type. TaskRouter creates reservations for Tasks of this TaskChannel type up to the specified capacity. If the capacity is 0, no new reservations will be created. + * @return $this Fluent Builder + */ + public function setCapacity(int $capacity): self + { + $this->options['capacity'] = $capacity; + return $this; + } + + /** + * Whether the WorkerChannel is available. Set to `false` to prevent the Worker from receiving any new Tasks of this TaskChannel type. + * + * @param bool $available Whether the WorkerChannel is available. Set to `false` to prevent the Worker from receiving any new Tasks of this TaskChannel type. + * @return $this Fluent Builder + */ + public function setAvailable(bool $available): self + { + $this->options['available'] = $available; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.UpdateWorkerChannelOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelPage.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelPage.php new file mode 100755 index 0000000..37c856a --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerChannelPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WorkerChannelInstance \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkerChannelInstance + */ + public function buildInstance(array $payload): WorkerChannelInstance + { + return new WorkerChannelInstance($this->version, $payload, $this->solution['workspaceSid'], $this->solution['workerSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkerChannelPage]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsContext.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsContext.php new file mode 100755 index 0000000..8414888 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsContext.php @@ -0,0 +1,104 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + 'workerSid' => + $workerSid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Workers/' . \rawurlencode($workerSid) + .'/Statistics'; + } + + /** + * Fetch the WorkerStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkerStatisticsInstance Fetched WorkerStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkerStatisticsInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'Minutes' => + $options['minutes'], + 'StartDate' => + Serialize::iso8601DateTime($options['startDate']), + 'EndDate' => + Serialize::iso8601DateTime($options['endDate']), + 'TaskChannel' => + $options['taskChannel'], + ]); + + $payload = $this->version->fetch('GET', $this->uri, $params); + + return new WorkerStatisticsInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['workerSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkerStatisticsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsInstance.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsInstance.php new file mode 100755 index 0000000..3b8370e --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsInstance.php @@ -0,0 +1,127 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'cumulative' => Values::array_get($payload, 'cumulative'), + 'workerSid' => Values::array_get($payload, 'worker_sid'), + 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['workspaceSid' => $workspaceSid, 'workerSid' => $workerSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return WorkerStatisticsContext Context for this WorkerStatisticsInstance + */ + protected function proxy(): WorkerStatisticsContext + { + if (!$this->context) { + $this->context = new WorkerStatisticsContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['workerSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the WorkerStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkerStatisticsInstance Fetched WorkerStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkerStatisticsInstance + { + + return $this->proxy()->fetch($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkerStatisticsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsList.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsList.php new file mode 100755 index 0000000..d265d23 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsList.php @@ -0,0 +1,73 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + 'workerSid' => + $workerSid, + + ]; + } + + /** + * Constructs a WorkerStatisticsContext + */ + public function getContext( + + ): WorkerStatisticsContext + { + return new WorkerStatisticsContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['workerSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkerStatisticsList]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsOptions.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsOptions.php new file mode 100755 index 0000000..aaec078 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsOptions.php @@ -0,0 +1,130 @@ +options['minutes'] = $minutes; + $this->options['startDate'] = $startDate; + $this->options['endDate'] = $endDate; + $this->options['taskChannel'] = $taskChannel; + } + + /** + * Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. + * + * @param int $minutes Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. + * @return $this Fluent Builder + */ + public function setMinutes(int $minutes): self + { + $this->options['minutes'] = $minutes; + return $this; + } + + /** + * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * + * @param \DateTime $startDate Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only include usage that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * + * @param \DateTime $endDate Only include usage that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Only calculate statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * + * @param string $taskChannel Only calculate statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * @return $this Fluent Builder + */ + public function setTaskChannel(string $taskChannel): self + { + $this->options['taskChannel'] = $taskChannel; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.FetchWorkerStatisticsOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsPage.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsPage.php new file mode 100755 index 0000000..8113217 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkerStatisticsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WorkerStatisticsInstance \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkerStatisticsInstance + */ + public function buildInstance(array $payload): WorkerStatisticsInstance + { + return new WorkerStatisticsInstance($this->version, $payload, $this->solution['workspaceSid'], $this->solution['workerSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkerStatisticsPage]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsContext.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsContext.php new file mode 100755 index 0000000..dac4f25 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsContext.php @@ -0,0 +1,98 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Workers/CumulativeStatistics'; + } + + /** + * Fetch the WorkersCumulativeStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkersCumulativeStatisticsInstance Fetched WorkersCumulativeStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkersCumulativeStatisticsInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'EndDate' => + Serialize::iso8601DateTime($options['endDate']), + 'Minutes' => + $options['minutes'], + 'StartDate' => + Serialize::iso8601DateTime($options['startDate']), + 'TaskChannel' => + $options['taskChannel'], + ]); + + $payload = $this->version->fetch('GET', $this->uri, $params); + + return new WorkersCumulativeStatisticsInstance( + $this->version, + $payload, + $this->solution['workspaceSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkersCumulativeStatisticsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsInstance.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsInstance.php new file mode 100755 index 0000000..e52b0e5 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsInstance.php @@ -0,0 +1,140 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), + 'endTime' => Deserialize::dateTime(Values::array_get($payload, 'end_time')), + 'activityDurations' => Values::array_get($payload, 'activity_durations'), + 'reservationsCreated' => Values::array_get($payload, 'reservations_created'), + 'reservationsAccepted' => Values::array_get($payload, 'reservations_accepted'), + 'reservationsRejected' => Values::array_get($payload, 'reservations_rejected'), + 'reservationsTimedOut' => Values::array_get($payload, 'reservations_timed_out'), + 'reservationsCanceled' => Values::array_get($payload, 'reservations_canceled'), + 'reservationsRescinded' => Values::array_get($payload, 'reservations_rescinded'), + 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['workspaceSid' => $workspaceSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return WorkersCumulativeStatisticsContext Context for this WorkersCumulativeStatisticsInstance + */ + protected function proxy(): WorkersCumulativeStatisticsContext + { + if (!$this->context) { + $this->context = new WorkersCumulativeStatisticsContext( + $this->version, + $this->solution['workspaceSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the WorkersCumulativeStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkersCumulativeStatisticsInstance Fetched WorkersCumulativeStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkersCumulativeStatisticsInstance + { + + return $this->proxy()->fetch($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkersCumulativeStatisticsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsList.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsList.php new file mode 100755 index 0000000..703889a --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsList.php @@ -0,0 +1,67 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + ]; + } + + /** + * Constructs a WorkersCumulativeStatisticsContext + */ + public function getContext( + + ): WorkersCumulativeStatisticsContext + { + return new WorkersCumulativeStatisticsContext( + $this->version, + $this->solution['workspaceSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkersCumulativeStatisticsList]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsOptions.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsOptions.php new file mode 100755 index 0000000..e6fcbae --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsOptions.php @@ -0,0 +1,130 @@ +options['endDate'] = $endDate; + $this->options['minutes'] = $minutes; + $this->options['startDate'] = $startDate; + $this->options['taskChannel'] = $taskChannel; + } + + /** + * Only calculate statistics from this date and time and earlier, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * + * @param \DateTime $endDate Only calculate statistics from this date and time and earlier, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. + * + * @param int $minutes Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. + * @return $this Fluent Builder + */ + public function setMinutes(int $minutes): self + { + $this->options['minutes'] = $minutes; + return $this; + } + + /** + * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * + * @param \DateTime $startDate Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only calculate cumulative statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * + * @param string $taskChannel Only calculate cumulative statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * @return $this Fluent Builder + */ + public function setTaskChannel(string $taskChannel): self + { + $this->options['taskChannel'] = $taskChannel; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.FetchWorkersCumulativeStatisticsOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsPage.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsPage.php new file mode 100755 index 0000000..557c297 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersCumulativeStatisticsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WorkersCumulativeStatisticsInstance \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersCumulativeStatisticsInstance + */ + public function buildInstance(array $payload): WorkersCumulativeStatisticsInstance + { + return new WorkersCumulativeStatisticsInstance($this->version, $payload, $this->solution['workspaceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkersCumulativeStatisticsPage]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsContext.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsContext.php new file mode 100755 index 0000000..23cdc38 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsContext.php @@ -0,0 +1,91 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Workers/RealTimeStatistics'; + } + + /** + * Fetch the WorkersRealTimeStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkersRealTimeStatisticsInstance Fetched WorkersRealTimeStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkersRealTimeStatisticsInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'TaskChannel' => + $options['taskChannel'], + ]); + + $payload = $this->version->fetch('GET', $this->uri, $params); + + return new WorkersRealTimeStatisticsInstance( + $this->version, + $payload, + $this->solution['workspaceSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkersRealTimeStatisticsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsInstance.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsInstance.php new file mode 100755 index 0000000..1ce06d8 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsInstance.php @@ -0,0 +1,125 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'activityStatistics' => Values::array_get($payload, 'activity_statistics'), + 'totalWorkers' => Values::array_get($payload, 'total_workers'), + 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['workspaceSid' => $workspaceSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return WorkersRealTimeStatisticsContext Context for this WorkersRealTimeStatisticsInstance + */ + protected function proxy(): WorkersRealTimeStatisticsContext + { + if (!$this->context) { + $this->context = new WorkersRealTimeStatisticsContext( + $this->version, + $this->solution['workspaceSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the WorkersRealTimeStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkersRealTimeStatisticsInstance Fetched WorkersRealTimeStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkersRealTimeStatisticsInstance + { + + return $this->proxy()->fetch($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkersRealTimeStatisticsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsList.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsList.php new file mode 100755 index 0000000..897814a --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsList.php @@ -0,0 +1,67 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + ]; + } + + /** + * Constructs a WorkersRealTimeStatisticsContext + */ + public function getContext( + + ): WorkersRealTimeStatisticsContext + { + return new WorkersRealTimeStatisticsContext( + $this->version, + $this->solution['workspaceSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkersRealTimeStatisticsList]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsOptions.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsOptions.php new file mode 100755 index 0000000..501f31f --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsOptions.php @@ -0,0 +1,76 @@ +options['taskChannel'] = $taskChannel; + } + + /** + * Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * + * @param string $taskChannel Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * @return $this Fluent Builder + */ + public function setTaskChannel(string $taskChannel): self + { + $this->options['taskChannel'] = $taskChannel; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.FetchWorkersRealTimeStatisticsOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsPage.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsPage.php new file mode 100755 index 0000000..e9d5544 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersRealTimeStatisticsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WorkersRealTimeStatisticsInstance \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersRealTimeStatisticsInstance + */ + public function buildInstance(array $payload): WorkersRealTimeStatisticsInstance + { + return new WorkersRealTimeStatisticsInstance($this->version, $payload, $this->solution['workspaceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkersRealTimeStatisticsPage]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsContext.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsContext.php new file mode 100755 index 0000000..908f431 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsContext.php @@ -0,0 +1,104 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Workers/Statistics'; + } + + /** + * Fetch the WorkersStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkersStatisticsInstance Fetched WorkersStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkersStatisticsInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'Minutes' => + $options['minutes'], + 'StartDate' => + Serialize::iso8601DateTime($options['startDate']), + 'EndDate' => + Serialize::iso8601DateTime($options['endDate']), + 'TaskQueueSid' => + $options['taskQueueSid'], + 'TaskQueueName' => + $options['taskQueueName'], + 'FriendlyName' => + $options['friendlyName'], + 'TaskChannel' => + $options['taskChannel'], + ]); + + $payload = $this->version->fetch('GET', $this->uri, $params); + + return new WorkersStatisticsInstance( + $this->version, + $payload, + $this->solution['workspaceSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkersStatisticsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsInstance.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsInstance.php new file mode 100755 index 0000000..92bb182 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsInstance.php @@ -0,0 +1,125 @@ +properties = [ + 'realtime' => Values::array_get($payload, 'realtime'), + 'cumulative' => Values::array_get($payload, 'cumulative'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['workspaceSid' => $workspaceSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return WorkersStatisticsContext Context for this WorkersStatisticsInstance + */ + protected function proxy(): WorkersStatisticsContext + { + if (!$this->context) { + $this->context = new WorkersStatisticsContext( + $this->version, + $this->solution['workspaceSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the WorkersStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkersStatisticsInstance Fetched WorkersStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkersStatisticsInstance + { + + return $this->proxy()->fetch($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkersStatisticsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsList.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsList.php new file mode 100755 index 0000000..2b34279 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsList.php @@ -0,0 +1,67 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + ]; + } + + /** + * Constructs a WorkersStatisticsContext + */ + public function getContext( + + ): WorkersStatisticsContext + { + return new WorkersStatisticsContext( + $this->version, + $this->solution['workspaceSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkersStatisticsList]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsOptions.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsOptions.php new file mode 100755 index 0000000..194b9f3 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsOptions.php @@ -0,0 +1,184 @@ +options['minutes'] = $minutes; + $this->options['startDate'] = $startDate; + $this->options['endDate'] = $endDate; + $this->options['taskQueueSid'] = $taskQueueSid; + $this->options['taskQueueName'] = $taskQueueName; + $this->options['friendlyName'] = $friendlyName; + $this->options['taskChannel'] = $taskChannel; + } + + /** + * Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. + * + * @param int $minutes Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. + * @return $this Fluent Builder + */ + public function setMinutes(int $minutes): self + { + $this->options['minutes'] = $minutes; + return $this; + } + + /** + * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * + * @param \DateTime $startDate Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * + * @param \DateTime $endDate Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * The SID of the TaskQueue for which to fetch Worker statistics. + * + * @param string $taskQueueSid The SID of the TaskQueue for which to fetch Worker statistics. + * @return $this Fluent Builder + */ + public function setTaskQueueSid(string $taskQueueSid): self + { + $this->options['taskQueueSid'] = $taskQueueSid; + return $this; + } + + /** + * The `friendly_name` of the TaskQueue for which to fetch Worker statistics. + * + * @param string $taskQueueName The `friendly_name` of the TaskQueue for which to fetch Worker statistics. + * @return $this Fluent Builder + */ + public function setTaskQueueName(string $taskQueueName): self + { + $this->options['taskQueueName'] = $taskQueueName; + return $this; + } + + /** + * Only include Workers with `friendly_name` values that match this parameter. + * + * @param string $friendlyName Only include Workers with `friendly_name` values that match this parameter. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Only calculate statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * + * @param string $taskChannel Only calculate statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * @return $this Fluent Builder + */ + public function setTaskChannel(string $taskChannel): self + { + $this->options['taskChannel'] = $taskChannel; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.FetchWorkersStatisticsOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsPage.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsPage.php new file mode 100755 index 0000000..cc486ec --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Worker/WorkersStatisticsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WorkersStatisticsInstance \Twilio\Rest\Taskrouter\V1\Workspace\Worker\WorkersStatisticsInstance + */ + public function buildInstance(array $payload): WorkersStatisticsInstance + { + return new WorkersStatisticsInstance($this->version, $payload, $this->solution['workspaceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkersStatisticsPage]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkerContext.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkerContext.php new file mode 100755 index 0000000..fb6e249 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkerContext.php @@ -0,0 +1,283 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Workers/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the WorkerInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + $options = new Values($options); + + $headers = Values::of(['If-Match' => $options['ifMatch']]); + + return $this->version->delete('DELETE', $this->uri, [], [], $headers); + } + + + /** + * Fetch the WorkerInstance + * + * @return WorkerInstance Fetched WorkerInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WorkerInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new WorkerInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the WorkerInstance + * + * @param array|Options $options Optional Arguments + * @return WorkerInstance Updated WorkerInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WorkerInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'ActivitySid' => + $options['activitySid'], + 'Attributes' => + $options['attributes'], + 'FriendlyName' => + $options['friendlyName'], + 'RejectPendingReservations' => + Serialize::booleanToString($options['rejectPendingReservations']), + ]); + + $headers = Values::of(['If-Match' => $options['ifMatch']]); + + $payload = $this->version->update('POST', $this->uri, [], $data, $headers); + + return new WorkerInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the workerChannels + */ + protected function getWorkerChannels(): WorkerChannelList + { + if (!$this->_workerChannels) { + $this->_workerChannels = new WorkerChannelList( + $this->version, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + return $this->_workerChannels; + } + + /** + * Access the reservations + */ + protected function getReservations(): ReservationList + { + if (!$this->_reservations) { + $this->_reservations = new ReservationList( + $this->version, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + return $this->_reservations; + } + + /** + * Access the realTimeStatistics + */ + protected function getRealTimeStatistics(): WorkersRealTimeStatisticsList + { + if (!$this->_realTimeStatistics) { + $this->_realTimeStatistics = new WorkersRealTimeStatisticsList( + $this->version, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + return $this->_realTimeStatistics; + } + + /** + * Access the statistics + */ + protected function getStatistics(): WorkerStatisticsList + { + if (!$this->_statistics) { + $this->_statistics = new WorkerStatisticsList( + $this->version, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + return $this->_statistics; + } + + /** + * Access the cumulativeStatistics + */ + protected function getCumulativeStatistics(): WorkersCumulativeStatisticsList + { + if (!$this->_cumulativeStatistics) { + $this->_cumulativeStatistics = new WorkersCumulativeStatisticsList( + $this->version, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + return $this->_cumulativeStatistics; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkerContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkerInstance.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkerInstance.php new file mode 100755 index 0000000..c28f2fd --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkerInstance.php @@ -0,0 +1,220 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'activityName' => Values::array_get($payload, 'activity_name'), + 'activitySid' => Values::array_get($payload, 'activity_sid'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'available' => Values::array_get($payload, 'available'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateStatusChanged' => Deserialize::dateTime(Values::array_get($payload, 'date_status_changed')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'sid' => Values::array_get($payload, 'sid'), + 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['workspaceSid' => $workspaceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return WorkerContext Context for this WorkerInstance + */ + protected function proxy(): WorkerContext + { + if (!$this->context) { + $this->context = new WorkerContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the WorkerInstance + * + * @param array|Options $options Optional Arguments + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(array $options = []): bool + { + + return $this->proxy()->delete($options); + } + + /** + * Fetch the WorkerInstance + * + * @return WorkerInstance Fetched WorkerInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WorkerInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the WorkerInstance + * + * @param array|Options $options Optional Arguments + * @return WorkerInstance Updated WorkerInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WorkerInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the workerChannels + */ + protected function getWorkerChannels(): WorkerChannelList + { + return $this->proxy()->workerChannels; + } + + /** + * Access the reservations + */ + protected function getReservations(): ReservationList + { + return $this->proxy()->reservations; + } + + /** + * Access the realTimeStatistics + */ + protected function getRealTimeStatistics(): WorkersRealTimeStatisticsList + { + return $this->proxy()->realTimeStatistics; + } + + /** + * Access the statistics + */ + protected function getStatistics(): WorkerStatisticsList + { + return $this->proxy()->statistics; + } + + /** + * Access the cumulativeStatistics + */ + protected function getCumulativeStatistics(): WorkersCumulativeStatisticsList + { + return $this->proxy()->cumulativeStatistics; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkerInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkerList.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkerList.php new file mode 100755 index 0000000..a4ff34c --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkerList.php @@ -0,0 +1,279 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Workers'; + } + + /** + * Create the WorkerInstance + * + * @param string $friendlyName A descriptive string that you create to describe the new Worker. It can be up to 64 characters long. + * @param array|Options $options Optional Arguments + * @return WorkerInstance Created WorkerInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, array $options = []): WorkerInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'ActivitySid' => + $options['activitySid'], + 'Attributes' => + $options['attributes'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new WorkerInstance( + $this->version, + $payload, + $this->solution['workspaceSid'] + ); + } + + + /** + * Reads WorkerInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return WorkerInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams WorkerInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of WorkerInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return WorkerPage Page of WorkerInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): WorkerPage + { + $options = new Values($options); + + $params = Values::of([ + 'ActivityName' => + $options['activityName'], + 'ActivitySid' => + $options['activitySid'], + 'Available' => + $options['available'], + 'FriendlyName' => + $options['friendlyName'], + 'TargetWorkersExpression' => + $options['targetWorkersExpression'], + 'TaskQueueName' => + $options['taskQueueName'], + 'TaskQueueSid' => + $options['taskQueueSid'], + 'Ordering' => + $options['ordering'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new WorkerPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of WorkerInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return WorkerPage Page of WorkerInstance + */ + public function getPage(string $targetUrl): WorkerPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new WorkerPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a WorkerContext + * + * @param string $sid The SID of the Worker resource to delete. + */ + public function getContext( + string $sid + + ): WorkerContext + { + return new WorkerContext( + $this->version, + $this->solution['workspaceSid'], + $sid + ); + } + + /** + * Access the statistics + */ + protected function getStatistics(): WorkersStatisticsList + { + if (!$this->_statistics) { + $this->_statistics = new WorkersStatisticsList( + $this->version, + $this->solution['workspaceSid'] + ); + } + return $this->_statistics; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name) + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkerList]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkerOptions.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkerOptions.php new file mode 100755 index 0000000..9215f28 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkerOptions.php @@ -0,0 +1,450 @@ +options['activitySid'] = $activitySid; + $this->options['attributes'] = $attributes; + } + + /** + * The SID of a valid Activity that will describe the new Worker's initial state. See [Activities](https://www.twilio.com/docs/taskrouter/api/activity) for more information. If not provided, the new Worker's initial state is the `default_activity_sid` configured on the Workspace. + * + * @param string $activitySid The SID of a valid Activity that will describe the new Worker's initial state. See [Activities](https://www.twilio.com/docs/taskrouter/api/activity) for more information. If not provided, the new Worker's initial state is the `default_activity_sid` configured on the Workspace. + * @return $this Fluent Builder + */ + public function setActivitySid(string $activitySid): self + { + $this->options['activitySid'] = $activitySid; + return $this; + } + + /** + * A valid JSON string that describes the new Worker. For example: `{ \\\"email\\\": \\\"Bob@example.com\\\", \\\"phone\\\": \\\"+5095551234\\\" }`. This data is passed to the `assignment_callback_url` when TaskRouter assigns a Task to the Worker. Defaults to {}. + * + * @param string $attributes A valid JSON string that describes the new Worker. For example: `{ \\\"email\\\": \\\"Bob@example.com\\\", \\\"phone\\\": \\\"+5095551234\\\" }`. This data is passed to the `assignment_callback_url` when TaskRouter assigns a Task to the Worker. Defaults to {}. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.CreateWorkerOptions ' . $options . ']'; + } +} + +class DeleteWorkerOptions extends Options + { + /** + * @param string $ifMatch The If-Match HTTP request header + */ + public function __construct( + + string $ifMatch = Values::NONE + + ) { + $this->options['ifMatch'] = $ifMatch; + } + + /** + * The If-Match HTTP request header + * + * @param string $ifMatch The If-Match HTTP request header + * @return $this Fluent Builder + */ + public function setIfMatch(string $ifMatch): self + { + $this->options['ifMatch'] = $ifMatch; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.DeleteWorkerOptions ' . $options . ']'; + } +} + + +class ReadWorkerOptions extends Options + { + /** + * @param string $activityName The `activity_name` of the Worker resources to read. + * @param string $activitySid The `activity_sid` of the Worker resources to read. + * @param string $available Whether to return only Worker resources that are available or unavailable. Can be `true`, `1`, or `yes` to return Worker resources that are available, and `false`, or any value returns the Worker resources that are not available. + * @param string $friendlyName The `friendly_name` of the Worker resources to read. + * @param string $targetWorkersExpression Filter by Workers that would match an expression on a TaskQueue. This is helpful for debugging which Workers would match a potential queue. + * @param string $taskQueueName The `friendly_name` of the TaskQueue that the Workers to read are eligible for. + * @param string $taskQueueSid The SID of the TaskQueue that the Workers to read are eligible for. + * @param string $ordering Sorting parameter for Workers + */ + public function __construct( + + string $activityName = Values::NONE, + string $activitySid = Values::NONE, + string $available = Values::NONE, + string $friendlyName = Values::NONE, + string $targetWorkersExpression = Values::NONE, + string $taskQueueName = Values::NONE, + string $taskQueueSid = Values::NONE, + string $ordering = Values::NONE + + ) { + $this->options['activityName'] = $activityName; + $this->options['activitySid'] = $activitySid; + $this->options['available'] = $available; + $this->options['friendlyName'] = $friendlyName; + $this->options['targetWorkersExpression'] = $targetWorkersExpression; + $this->options['taskQueueName'] = $taskQueueName; + $this->options['taskQueueSid'] = $taskQueueSid; + $this->options['ordering'] = $ordering; + } + + /** + * The `activity_name` of the Worker resources to read. + * + * @param string $activityName The `activity_name` of the Worker resources to read. + * @return $this Fluent Builder + */ + public function setActivityName(string $activityName): self + { + $this->options['activityName'] = $activityName; + return $this; + } + + /** + * The `activity_sid` of the Worker resources to read. + * + * @param string $activitySid The `activity_sid` of the Worker resources to read. + * @return $this Fluent Builder + */ + public function setActivitySid(string $activitySid): self + { + $this->options['activitySid'] = $activitySid; + return $this; + } + + /** + * Whether to return only Worker resources that are available or unavailable. Can be `true`, `1`, or `yes` to return Worker resources that are available, and `false`, or any value returns the Worker resources that are not available. + * + * @param string $available Whether to return only Worker resources that are available or unavailable. Can be `true`, `1`, or `yes` to return Worker resources that are available, and `false`, or any value returns the Worker resources that are not available. + * @return $this Fluent Builder + */ + public function setAvailable(string $available): self + { + $this->options['available'] = $available; + return $this; + } + + /** + * The `friendly_name` of the Worker resources to read. + * + * @param string $friendlyName The `friendly_name` of the Worker resources to read. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Filter by Workers that would match an expression on a TaskQueue. This is helpful for debugging which Workers would match a potential queue. + * + * @param string $targetWorkersExpression Filter by Workers that would match an expression on a TaskQueue. This is helpful for debugging which Workers would match a potential queue. + * @return $this Fluent Builder + */ + public function setTargetWorkersExpression(string $targetWorkersExpression): self + { + $this->options['targetWorkersExpression'] = $targetWorkersExpression; + return $this; + } + + /** + * The `friendly_name` of the TaskQueue that the Workers to read are eligible for. + * + * @param string $taskQueueName The `friendly_name` of the TaskQueue that the Workers to read are eligible for. + * @return $this Fluent Builder + */ + public function setTaskQueueName(string $taskQueueName): self + { + $this->options['taskQueueName'] = $taskQueueName; + return $this; + } + + /** + * The SID of the TaskQueue that the Workers to read are eligible for. + * + * @param string $taskQueueSid The SID of the TaskQueue that the Workers to read are eligible for. + * @return $this Fluent Builder + */ + public function setTaskQueueSid(string $taskQueueSid): self + { + $this->options['taskQueueSid'] = $taskQueueSid; + return $this; + } + + /** + * Sorting parameter for Workers + * + * @param string $ordering Sorting parameter for Workers + * @return $this Fluent Builder + */ + public function setOrdering(string $ordering): self + { + $this->options['ordering'] = $ordering; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.ReadWorkerOptions ' . $options . ']'; + } +} + +class UpdateWorkerOptions extends Options + { + /** + * @param string $activitySid The SID of a valid Activity that will describe the Worker's initial state. See [Activities](https://www.twilio.com/docs/taskrouter/api/activity) for more information. + * @param string $attributes The JSON string that describes the Worker. For example: `{ \\\"email\\\": \\\"Bob@example.com\\\", \\\"phone\\\": \\\"+5095551234\\\" }`. This data is passed to the `assignment_callback_url` when TaskRouter assigns a Task to the Worker. Defaults to {}. + * @param string $friendlyName A descriptive string that you create to describe the Worker. It can be up to 64 characters long. + * @param bool $rejectPendingReservations Whether to reject the Worker's pending reservations. This option is only valid if the Worker's new [Activity](https://www.twilio.com/docs/taskrouter/api/activity) resource has its `availability` property set to `False`. + * @param string $ifMatch The If-Match HTTP request header + */ + public function __construct( + + string $activitySid = Values::NONE, + string $attributes = Values::NONE, + string $friendlyName = Values::NONE, + bool $rejectPendingReservations = Values::BOOL_NONE, + string $ifMatch = Values::NONE + + ) { + $this->options['activitySid'] = $activitySid; + $this->options['attributes'] = $attributes; + $this->options['friendlyName'] = $friendlyName; + $this->options['rejectPendingReservations'] = $rejectPendingReservations; + $this->options['ifMatch'] = $ifMatch; + } + + /** + * The SID of a valid Activity that will describe the Worker's initial state. See [Activities](https://www.twilio.com/docs/taskrouter/api/activity) for more information. + * + * @param string $activitySid The SID of a valid Activity that will describe the Worker's initial state. See [Activities](https://www.twilio.com/docs/taskrouter/api/activity) for more information. + * @return $this Fluent Builder + */ + public function setActivitySid(string $activitySid): self + { + $this->options['activitySid'] = $activitySid; + return $this; + } + + /** + * The JSON string that describes the Worker. For example: `{ \\\"email\\\": \\\"Bob@example.com\\\", \\\"phone\\\": \\\"+5095551234\\\" }`. This data is passed to the `assignment_callback_url` when TaskRouter assigns a Task to the Worker. Defaults to {}. + * + * @param string $attributes The JSON string that describes the Worker. For example: `{ \\\"email\\\": \\\"Bob@example.com\\\", \\\"phone\\\": \\\"+5095551234\\\" }`. This data is passed to the `assignment_callback_url` when TaskRouter assigns a Task to the Worker. Defaults to {}. + * @return $this Fluent Builder + */ + public function setAttributes(string $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * A descriptive string that you create to describe the Worker. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the Worker. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Whether to reject the Worker's pending reservations. This option is only valid if the Worker's new [Activity](https://www.twilio.com/docs/taskrouter/api/activity) resource has its `availability` property set to `False`. + * + * @param bool $rejectPendingReservations Whether to reject the Worker's pending reservations. This option is only valid if the Worker's new [Activity](https://www.twilio.com/docs/taskrouter/api/activity) resource has its `availability` property set to `False`. + * @return $this Fluent Builder + */ + public function setRejectPendingReservations(bool $rejectPendingReservations): self + { + $this->options['rejectPendingReservations'] = $rejectPendingReservations; + return $this; + } + + /** + * The If-Match HTTP request header + * + * @param string $ifMatch The If-Match HTTP request header + * @return $this Fluent Builder + */ + public function setIfMatch(string $ifMatch): self + { + $this->options['ifMatch'] = $ifMatch; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.UpdateWorkerOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkerPage.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkerPage.php new file mode 100755 index 0000000..9c3d05d --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkerPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WorkerInstance \Twilio\Rest\Taskrouter\V1\Workspace\WorkerInstance + */ + public function buildInstance(array $payload): WorkerInstance + { + return new WorkerInstance($this->version, $payload, $this->solution['workspaceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkerPage]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsContext.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsContext.php new file mode 100755 index 0000000..93a00e9 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsContext.php @@ -0,0 +1,106 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + 'workflowSid' => + $workflowSid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Workflows/' . \rawurlencode($workflowSid) + .'/CumulativeStatistics'; + } + + /** + * Fetch the WorkflowCumulativeStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkflowCumulativeStatisticsInstance Fetched WorkflowCumulativeStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkflowCumulativeStatisticsInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'EndDate' => + Serialize::iso8601DateTime($options['endDate']), + 'Minutes' => + $options['minutes'], + 'StartDate' => + Serialize::iso8601DateTime($options['startDate']), + 'TaskChannel' => + $options['taskChannel'], + 'SplitByWaitTime' => + $options['splitByWaitTime'], + ]); + + $payload = $this->version->fetch('GET', $this->uri, $params); + + return new WorkflowCumulativeStatisticsInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['workflowSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkflowCumulativeStatisticsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsInstance.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsInstance.php new file mode 100755 index 0000000..a43b7b5 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsInstance.php @@ -0,0 +1,162 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'avgTaskAcceptanceTime' => Values::array_get($payload, 'avg_task_acceptance_time'), + 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), + 'endTime' => Deserialize::dateTime(Values::array_get($payload, 'end_time')), + 'reservationsCreated' => Values::array_get($payload, 'reservations_created'), + 'reservationsAccepted' => Values::array_get($payload, 'reservations_accepted'), + 'reservationsRejected' => Values::array_get($payload, 'reservations_rejected'), + 'reservationsTimedOut' => Values::array_get($payload, 'reservations_timed_out'), + 'reservationsCanceled' => Values::array_get($payload, 'reservations_canceled'), + 'reservationsRescinded' => Values::array_get($payload, 'reservations_rescinded'), + 'splitByWaitTime' => Values::array_get($payload, 'split_by_wait_time'), + 'waitDurationUntilAccepted' => Values::array_get($payload, 'wait_duration_until_accepted'), + 'waitDurationUntilCanceled' => Values::array_get($payload, 'wait_duration_until_canceled'), + 'tasksCanceled' => Values::array_get($payload, 'tasks_canceled'), + 'tasksCompleted' => Values::array_get($payload, 'tasks_completed'), + 'tasksEntered' => Values::array_get($payload, 'tasks_entered'), + 'tasksDeleted' => Values::array_get($payload, 'tasks_deleted'), + 'tasksMoved' => Values::array_get($payload, 'tasks_moved'), + 'tasksTimedOutInWorkflow' => Values::array_get($payload, 'tasks_timed_out_in_workflow'), + 'workflowSid' => Values::array_get($payload, 'workflow_sid'), + 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['workspaceSid' => $workspaceSid, 'workflowSid' => $workflowSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return WorkflowCumulativeStatisticsContext Context for this WorkflowCumulativeStatisticsInstance + */ + protected function proxy(): WorkflowCumulativeStatisticsContext + { + if (!$this->context) { + $this->context = new WorkflowCumulativeStatisticsContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['workflowSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the WorkflowCumulativeStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkflowCumulativeStatisticsInstance Fetched WorkflowCumulativeStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkflowCumulativeStatisticsInstance + { + + return $this->proxy()->fetch($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkflowCumulativeStatisticsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsList.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsList.php new file mode 100755 index 0000000..a812f6f --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsList.php @@ -0,0 +1,73 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + 'workflowSid' => + $workflowSid, + + ]; + } + + /** + * Constructs a WorkflowCumulativeStatisticsContext + */ + public function getContext( + + ): WorkflowCumulativeStatisticsContext + { + return new WorkflowCumulativeStatisticsContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['workflowSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkflowCumulativeStatisticsList]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsOptions.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsOptions.php new file mode 100755 index 0000000..3f9453a --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsOptions.php @@ -0,0 +1,148 @@ +options['endDate'] = $endDate; + $this->options['minutes'] = $minutes; + $this->options['startDate'] = $startDate; + $this->options['taskChannel'] = $taskChannel; + $this->options['splitByWaitTime'] = $splitByWaitTime; + } + + /** + * Only include usage that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * + * @param \DateTime $endDate Only include usage that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. + * + * @param int $minutes Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. + * @return $this Fluent Builder + */ + public function setMinutes(int $minutes): self + { + $this->options['minutes'] = $minutes; + return $this; + } + + /** + * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * + * @param \DateTime $startDate Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only calculate cumulative statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * + * @param string $taskChannel Only calculate cumulative statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * @return $this Fluent Builder + */ + public function setTaskChannel(string $taskChannel): self + { + $this->options['taskChannel'] = $taskChannel; + return $this; + } + + /** + * A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA. TaskRouter will calculate statistics on up to 10,000 Tasks for any given threshold. + * + * @param string $splitByWaitTime A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA. TaskRouter will calculate statistics on up to 10,000 Tasks for any given threshold. + * @return $this Fluent Builder + */ + public function setSplitByWaitTime(string $splitByWaitTime): self + { + $this->options['splitByWaitTime'] = $splitByWaitTime; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.FetchWorkflowCumulativeStatisticsOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsPage.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsPage.php new file mode 100755 index 0000000..d057169 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowCumulativeStatisticsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WorkflowCumulativeStatisticsInstance \Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowCumulativeStatisticsInstance + */ + public function buildInstance(array $payload): WorkflowCumulativeStatisticsInstance + { + return new WorkflowCumulativeStatisticsInstance($this->version, $payload, $this->solution['workspaceSid'], $this->solution['workflowSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkflowCumulativeStatisticsPage]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsContext.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsContext.php new file mode 100755 index 0000000..d2ea85f --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsContext.php @@ -0,0 +1,97 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + 'workflowSid' => + $workflowSid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Workflows/' . \rawurlencode($workflowSid) + .'/RealTimeStatistics'; + } + + /** + * Fetch the WorkflowRealTimeStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkflowRealTimeStatisticsInstance Fetched WorkflowRealTimeStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkflowRealTimeStatisticsInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'TaskChannel' => + $options['taskChannel'], + ]); + + $payload = $this->version->fetch('GET', $this->uri, $params); + + return new WorkflowRealTimeStatisticsInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['workflowSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkflowRealTimeStatisticsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsInstance.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsInstance.php new file mode 100755 index 0000000..7d3003f --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsInstance.php @@ -0,0 +1,135 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'longestTaskWaitingAge' => Values::array_get($payload, 'longest_task_waiting_age'), + 'longestTaskWaitingSid' => Values::array_get($payload, 'longest_task_waiting_sid'), + 'tasksByPriority' => Values::array_get($payload, 'tasks_by_priority'), + 'tasksByStatus' => Values::array_get($payload, 'tasks_by_status'), + 'totalTasks' => Values::array_get($payload, 'total_tasks'), + 'workflowSid' => Values::array_get($payload, 'workflow_sid'), + 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['workspaceSid' => $workspaceSid, 'workflowSid' => $workflowSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return WorkflowRealTimeStatisticsContext Context for this WorkflowRealTimeStatisticsInstance + */ + protected function proxy(): WorkflowRealTimeStatisticsContext + { + if (!$this->context) { + $this->context = new WorkflowRealTimeStatisticsContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['workflowSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the WorkflowRealTimeStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkflowRealTimeStatisticsInstance Fetched WorkflowRealTimeStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkflowRealTimeStatisticsInstance + { + + return $this->proxy()->fetch($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkflowRealTimeStatisticsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsList.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsList.php new file mode 100755 index 0000000..8bdd417 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsList.php @@ -0,0 +1,73 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + 'workflowSid' => + $workflowSid, + + ]; + } + + /** + * Constructs a WorkflowRealTimeStatisticsContext + */ + public function getContext( + + ): WorkflowRealTimeStatisticsContext + { + return new WorkflowRealTimeStatisticsContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['workflowSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkflowRealTimeStatisticsList]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsOptions.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsOptions.php new file mode 100755 index 0000000..cbd6a3e --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsOptions.php @@ -0,0 +1,76 @@ +options['taskChannel'] = $taskChannel; + } + + /** + * Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * + * @param string $taskChannel Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * @return $this Fluent Builder + */ + public function setTaskChannel(string $taskChannel): self + { + $this->options['taskChannel'] = $taskChannel; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.FetchWorkflowRealTimeStatisticsOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsPage.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsPage.php new file mode 100755 index 0000000..1ea2944 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowRealTimeStatisticsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WorkflowRealTimeStatisticsInstance \Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowRealTimeStatisticsInstance + */ + public function buildInstance(array $payload): WorkflowRealTimeStatisticsInstance + { + return new WorkflowRealTimeStatisticsInstance($this->version, $payload, $this->solution['workspaceSid'], $this->solution['workflowSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkflowRealTimeStatisticsPage]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsContext.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsContext.php new file mode 100755 index 0000000..386f74e --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsContext.php @@ -0,0 +1,106 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + 'workflowSid' => + $workflowSid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Workflows/' . \rawurlencode($workflowSid) + .'/Statistics'; + } + + /** + * Fetch the WorkflowStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkflowStatisticsInstance Fetched WorkflowStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkflowStatisticsInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'Minutes' => + $options['minutes'], + 'StartDate' => + Serialize::iso8601DateTime($options['startDate']), + 'EndDate' => + Serialize::iso8601DateTime($options['endDate']), + 'TaskChannel' => + $options['taskChannel'], + 'SplitByWaitTime' => + $options['splitByWaitTime'], + ]); + + $payload = $this->version->fetch('GET', $this->uri, $params); + + return new WorkflowStatisticsInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['workflowSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkflowStatisticsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsInstance.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsInstance.php new file mode 100755 index 0000000..7159e85 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsInstance.php @@ -0,0 +1,129 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'cumulative' => Values::array_get($payload, 'cumulative'), + 'realtime' => Values::array_get($payload, 'realtime'), + 'workflowSid' => Values::array_get($payload, 'workflow_sid'), + 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['workspaceSid' => $workspaceSid, 'workflowSid' => $workflowSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return WorkflowStatisticsContext Context for this WorkflowStatisticsInstance + */ + protected function proxy(): WorkflowStatisticsContext + { + if (!$this->context) { + $this->context = new WorkflowStatisticsContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['workflowSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the WorkflowStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkflowStatisticsInstance Fetched WorkflowStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkflowStatisticsInstance + { + + return $this->proxy()->fetch($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkflowStatisticsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsList.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsList.php new file mode 100755 index 0000000..72c5d3d --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsList.php @@ -0,0 +1,73 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + 'workflowSid' => + $workflowSid, + + ]; + } + + /** + * Constructs a WorkflowStatisticsContext + */ + public function getContext( + + ): WorkflowStatisticsContext + { + return new WorkflowStatisticsContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['workflowSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkflowStatisticsList]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsOptions.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsOptions.php new file mode 100755 index 0000000..b5f8e12 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsOptions.php @@ -0,0 +1,148 @@ +options['minutes'] = $minutes; + $this->options['startDate'] = $startDate; + $this->options['endDate'] = $endDate; + $this->options['taskChannel'] = $taskChannel; + $this->options['splitByWaitTime'] = $splitByWaitTime; + } + + /** + * Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. + * + * @param int $minutes Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. + * @return $this Fluent Builder + */ + public function setMinutes(int $minutes): self + { + $this->options['minutes'] = $minutes; + return $this; + } + + /** + * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * + * @param \DateTime $startDate Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * + * @param \DateTime $endDate Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * + * @param string $taskChannel Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * @return $this Fluent Builder + */ + public function setTaskChannel(string $taskChannel): self + { + $this->options['taskChannel'] = $taskChannel; + return $this; + } + + /** + * A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA. + * + * @param string $splitByWaitTime A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA. + * @return $this Fluent Builder + */ + public function setSplitByWaitTime(string $splitByWaitTime): self + { + $this->options['splitByWaitTime'] = $splitByWaitTime; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.FetchWorkflowStatisticsOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsPage.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsPage.php new file mode 100755 index 0000000..3d4cedf --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/Workflow/WorkflowStatisticsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WorkflowStatisticsInstance \Twilio\Rest\Taskrouter\V1\Workspace\Workflow\WorkflowStatisticsInstance + */ + public function buildInstance(array $payload): WorkflowStatisticsInstance + { + return new WorkflowStatisticsInstance($this->version, $payload, $this->solution['workspaceSid'], $this->solution['workflowSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkflowStatisticsPage]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowContext.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowContext.php new file mode 100755 index 0000000..baed7ff --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowContext.php @@ -0,0 +1,239 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Workflows/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the WorkflowInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the WorkflowInstance + * + * @return WorkflowInstance Fetched WorkflowInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WorkflowInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new WorkflowInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the WorkflowInstance + * + * @param array|Options $options Optional Arguments + * @return WorkflowInstance Updated WorkflowInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WorkflowInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'AssignmentCallbackUrl' => + $options['assignmentCallbackUrl'], + 'FallbackAssignmentCallbackUrl' => + $options['fallbackAssignmentCallbackUrl'], + 'Configuration' => + $options['configuration'], + 'TaskReservationTimeout' => + $options['taskReservationTimeout'], + 'ReEvaluateTasks' => + $options['reEvaluateTasks'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new WorkflowInstance( + $this->version, + $payload, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the statistics + */ + protected function getStatistics(): WorkflowStatisticsList + { + if (!$this->_statistics) { + $this->_statistics = new WorkflowStatisticsList( + $this->version, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + return $this->_statistics; + } + + /** + * Access the cumulativeStatistics + */ + protected function getCumulativeStatistics(): WorkflowCumulativeStatisticsList + { + if (!$this->_cumulativeStatistics) { + $this->_cumulativeStatistics = new WorkflowCumulativeStatisticsList( + $this->version, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + return $this->_cumulativeStatistics; + } + + /** + * Access the realTimeStatistics + */ + protected function getRealTimeStatistics(): WorkflowRealTimeStatisticsList + { + if (!$this->_realTimeStatistics) { + $this->_realTimeStatistics = new WorkflowRealTimeStatisticsList( + $this->version, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + return $this->_realTimeStatistics; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkflowContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowInstance.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowInstance.php new file mode 100755 index 0000000..f47fdfc --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowInstance.php @@ -0,0 +1,199 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'assignmentCallbackUrl' => Values::array_get($payload, 'assignment_callback_url'), + 'configuration' => Values::array_get($payload, 'configuration'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'documentContentType' => Values::array_get($payload, 'document_content_type'), + 'fallbackAssignmentCallbackUrl' => Values::array_get($payload, 'fallback_assignment_callback_url'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'sid' => Values::array_get($payload, 'sid'), + 'taskReservationTimeout' => Values::array_get($payload, 'task_reservation_timeout'), + 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['workspaceSid' => $workspaceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return WorkflowContext Context for this WorkflowInstance + */ + protected function proxy(): WorkflowContext + { + if (!$this->context) { + $this->context = new WorkflowContext( + $this->version, + $this->solution['workspaceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the WorkflowInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the WorkflowInstance + * + * @return WorkflowInstance Fetched WorkflowInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WorkflowInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the WorkflowInstance + * + * @param array|Options $options Optional Arguments + * @return WorkflowInstance Updated WorkflowInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WorkflowInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the statistics + */ + protected function getStatistics(): WorkflowStatisticsList + { + return $this->proxy()->statistics; + } + + /** + * Access the cumulativeStatistics + */ + protected function getCumulativeStatistics(): WorkflowCumulativeStatisticsList + { + return $this->proxy()->cumulativeStatistics; + } + + /** + * Access the realTimeStatistics + */ + protected function getRealTimeStatistics(): WorkflowRealTimeStatisticsList + { + return $this->proxy()->realTimeStatistics; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkflowInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowList.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowList.php new file mode 100755 index 0000000..8170aa3 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowList.php @@ -0,0 +1,213 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Workflows'; + } + + /** + * Create the WorkflowInstance + * + * @param string $friendlyName A descriptive string that you create to describe the Workflow resource. For example, `Inbound Call Workflow` or `2014 Outbound Campaign`. + * @param string $configuration A JSON string that contains the rules to apply to the Workflow. See [Configuring Workflows](https://www.twilio.com/docs/taskrouter/workflow-configuration) for more information. + * @param array|Options $options Optional Arguments + * @return WorkflowInstance Created WorkflowInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $configuration, array $options = []): WorkflowInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Configuration' => + $configuration, + 'AssignmentCallbackUrl' => + $options['assignmentCallbackUrl'], + 'FallbackAssignmentCallbackUrl' => + $options['fallbackAssignmentCallbackUrl'], + 'TaskReservationTimeout' => + $options['taskReservationTimeout'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new WorkflowInstance( + $this->version, + $payload, + $this->solution['workspaceSid'] + ); + } + + + /** + * Reads WorkflowInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return WorkflowInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams WorkflowInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of WorkflowInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return WorkflowPage Page of WorkflowInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): WorkflowPage + { + $options = new Values($options); + + $params = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new WorkflowPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of WorkflowInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return WorkflowPage Page of WorkflowInstance + */ + public function getPage(string $targetUrl): WorkflowPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new WorkflowPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a WorkflowContext + * + * @param string $sid The SID of the Workflow resource to delete. + */ + public function getContext( + string $sid + + ): WorkflowContext + { + return new WorkflowContext( + $this->version, + $this->solution['workspaceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkflowList]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowOptions.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowOptions.php new file mode 100755 index 0000000..f2db863 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowOptions.php @@ -0,0 +1,310 @@ +options['assignmentCallbackUrl'] = $assignmentCallbackUrl; + $this->options['fallbackAssignmentCallbackUrl'] = $fallbackAssignmentCallbackUrl; + $this->options['taskReservationTimeout'] = $taskReservationTimeout; + } + + /** + * The URL from your application that will process task assignment events. See [Handling Task Assignment Callback](https://www.twilio.com/docs/taskrouter/handle-assignment-callbacks) for more details. + * + * @param string $assignmentCallbackUrl The URL from your application that will process task assignment events. See [Handling Task Assignment Callback](https://www.twilio.com/docs/taskrouter/handle-assignment-callbacks) for more details. + * @return $this Fluent Builder + */ + public function setAssignmentCallbackUrl(string $assignmentCallbackUrl): self + { + $this->options['assignmentCallbackUrl'] = $assignmentCallbackUrl; + return $this; + } + + /** + * The URL that we should call when a call to the `assignment_callback_url` fails. + * + * @param string $fallbackAssignmentCallbackUrl The URL that we should call when a call to the `assignment_callback_url` fails. + * @return $this Fluent Builder + */ + public function setFallbackAssignmentCallbackUrl(string $fallbackAssignmentCallbackUrl): self + { + $this->options['fallbackAssignmentCallbackUrl'] = $fallbackAssignmentCallbackUrl; + return $this; + } + + /** + * How long TaskRouter will wait for a confirmation response from your application after it assigns a Task to a Worker. Can be up to `86,400` (24 hours) and the default is `120`. + * + * @param int $taskReservationTimeout How long TaskRouter will wait for a confirmation response from your application after it assigns a Task to a Worker. Can be up to `86,400` (24 hours) and the default is `120`. + * @return $this Fluent Builder + */ + public function setTaskReservationTimeout(int $taskReservationTimeout): self + { + $this->options['taskReservationTimeout'] = $taskReservationTimeout; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.CreateWorkflowOptions ' . $options . ']'; + } +} + + + +class ReadWorkflowOptions extends Options + { + /** + * @param string $friendlyName The `friendly_name` of the Workflow resources to read. + */ + public function __construct( + + string $friendlyName = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + } + + /** + * The `friendly_name` of the Workflow resources to read. + * + * @param string $friendlyName The `friendly_name` of the Workflow resources to read. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.ReadWorkflowOptions ' . $options . ']'; + } +} + +class UpdateWorkflowOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the Workflow resource. For example, `Inbound Call Workflow` or `2014 Outbound Campaign`. + * @param string $assignmentCallbackUrl The URL from your application that will process task assignment events. See [Handling Task Assignment Callback](https://www.twilio.com/docs/taskrouter/handle-assignment-callbacks) for more details. + * @param string $fallbackAssignmentCallbackUrl The URL that we should call when a call to the `assignment_callback_url` fails. + * @param string $configuration A JSON string that contains the rules to apply to the Workflow. See [Configuring Workflows](https://www.twilio.com/docs/taskrouter/workflow-configuration) for more information. + * @param int $taskReservationTimeout How long TaskRouter will wait for a confirmation response from your application after it assigns a Task to a Worker. Can be up to `86,400` (24 hours) and the default is `120`. + * @param string $reEvaluateTasks Whether or not to re-evaluate Tasks. The default is `false`, which means Tasks in the Workflow will not be processed through the assignment loop again. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $assignmentCallbackUrl = Values::NONE, + string $fallbackAssignmentCallbackUrl = Values::NONE, + string $configuration = Values::NONE, + int $taskReservationTimeout = Values::INT_NONE, + string $reEvaluateTasks = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['assignmentCallbackUrl'] = $assignmentCallbackUrl; + $this->options['fallbackAssignmentCallbackUrl'] = $fallbackAssignmentCallbackUrl; + $this->options['configuration'] = $configuration; + $this->options['taskReservationTimeout'] = $taskReservationTimeout; + $this->options['reEvaluateTasks'] = $reEvaluateTasks; + } + + /** + * A descriptive string that you create to describe the Workflow resource. For example, `Inbound Call Workflow` or `2014 Outbound Campaign`. + * + * @param string $friendlyName A descriptive string that you create to describe the Workflow resource. For example, `Inbound Call Workflow` or `2014 Outbound Campaign`. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The URL from your application that will process task assignment events. See [Handling Task Assignment Callback](https://www.twilio.com/docs/taskrouter/handle-assignment-callbacks) for more details. + * + * @param string $assignmentCallbackUrl The URL from your application that will process task assignment events. See [Handling Task Assignment Callback](https://www.twilio.com/docs/taskrouter/handle-assignment-callbacks) for more details. + * @return $this Fluent Builder + */ + public function setAssignmentCallbackUrl(string $assignmentCallbackUrl): self + { + $this->options['assignmentCallbackUrl'] = $assignmentCallbackUrl; + return $this; + } + + /** + * The URL that we should call when a call to the `assignment_callback_url` fails. + * + * @param string $fallbackAssignmentCallbackUrl The URL that we should call when a call to the `assignment_callback_url` fails. + * @return $this Fluent Builder + */ + public function setFallbackAssignmentCallbackUrl(string $fallbackAssignmentCallbackUrl): self + { + $this->options['fallbackAssignmentCallbackUrl'] = $fallbackAssignmentCallbackUrl; + return $this; + } + + /** + * A JSON string that contains the rules to apply to the Workflow. See [Configuring Workflows](https://www.twilio.com/docs/taskrouter/workflow-configuration) for more information. + * + * @param string $configuration A JSON string that contains the rules to apply to the Workflow. See [Configuring Workflows](https://www.twilio.com/docs/taskrouter/workflow-configuration) for more information. + * @return $this Fluent Builder + */ + public function setConfiguration(string $configuration): self + { + $this->options['configuration'] = $configuration; + return $this; + } + + /** + * How long TaskRouter will wait for a confirmation response from your application after it assigns a Task to a Worker. Can be up to `86,400` (24 hours) and the default is `120`. + * + * @param int $taskReservationTimeout How long TaskRouter will wait for a confirmation response from your application after it assigns a Task to a Worker. Can be up to `86,400` (24 hours) and the default is `120`. + * @return $this Fluent Builder + */ + public function setTaskReservationTimeout(int $taskReservationTimeout): self + { + $this->options['taskReservationTimeout'] = $taskReservationTimeout; + return $this; + } + + /** + * Whether or not to re-evaluate Tasks. The default is `false`, which means Tasks in the Workflow will not be processed through the assignment loop again. + * + * @param string $reEvaluateTasks Whether or not to re-evaluate Tasks. The default is `false`, which means Tasks in the Workflow will not be processed through the assignment loop again. + * @return $this Fluent Builder + */ + public function setReEvaluateTasks(string $reEvaluateTasks): self + { + $this->options['reEvaluateTasks'] = $reEvaluateTasks; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.UpdateWorkflowOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowPage.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowPage.php new file mode 100755 index 0000000..5e4fe44 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkflowPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WorkflowInstance \Twilio\Rest\Taskrouter\V1\Workspace\WorkflowInstance + */ + public function buildInstance(array $payload): WorkflowInstance + { + return new WorkflowInstance($this->version, $payload, $this->solution['workspaceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkflowPage]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsContext.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsContext.php new file mode 100755 index 0000000..d749397 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsContext.php @@ -0,0 +1,100 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/CumulativeStatistics'; + } + + /** + * Fetch the WorkspaceCumulativeStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkspaceCumulativeStatisticsInstance Fetched WorkspaceCumulativeStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkspaceCumulativeStatisticsInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'EndDate' => + Serialize::iso8601DateTime($options['endDate']), + 'Minutes' => + $options['minutes'], + 'StartDate' => + Serialize::iso8601DateTime($options['startDate']), + 'TaskChannel' => + $options['taskChannel'], + 'SplitByWaitTime' => + $options['splitByWaitTime'], + ]); + + $payload = $this->version->fetch('GET', $this->uri, $params); + + return new WorkspaceCumulativeStatisticsInstance( + $this->version, + $payload, + $this->solution['workspaceSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkspaceCumulativeStatisticsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsInstance.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsInstance.php new file mode 100755 index 0000000..b808844 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsInstance.php @@ -0,0 +1,158 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'avgTaskAcceptanceTime' => Values::array_get($payload, 'avg_task_acceptance_time'), + 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), + 'endTime' => Deserialize::dateTime(Values::array_get($payload, 'end_time')), + 'reservationsCreated' => Values::array_get($payload, 'reservations_created'), + 'reservationsAccepted' => Values::array_get($payload, 'reservations_accepted'), + 'reservationsRejected' => Values::array_get($payload, 'reservations_rejected'), + 'reservationsTimedOut' => Values::array_get($payload, 'reservations_timed_out'), + 'reservationsCanceled' => Values::array_get($payload, 'reservations_canceled'), + 'reservationsRescinded' => Values::array_get($payload, 'reservations_rescinded'), + 'splitByWaitTime' => Values::array_get($payload, 'split_by_wait_time'), + 'waitDurationUntilAccepted' => Values::array_get($payload, 'wait_duration_until_accepted'), + 'waitDurationUntilCanceled' => Values::array_get($payload, 'wait_duration_until_canceled'), + 'tasksCanceled' => Values::array_get($payload, 'tasks_canceled'), + 'tasksCompleted' => Values::array_get($payload, 'tasks_completed'), + 'tasksCreated' => Values::array_get($payload, 'tasks_created'), + 'tasksDeleted' => Values::array_get($payload, 'tasks_deleted'), + 'tasksMoved' => Values::array_get($payload, 'tasks_moved'), + 'tasksTimedOutInWorkflow' => Values::array_get($payload, 'tasks_timed_out_in_workflow'), + 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['workspaceSid' => $workspaceSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return WorkspaceCumulativeStatisticsContext Context for this WorkspaceCumulativeStatisticsInstance + */ + protected function proxy(): WorkspaceCumulativeStatisticsContext + { + if (!$this->context) { + $this->context = new WorkspaceCumulativeStatisticsContext( + $this->version, + $this->solution['workspaceSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the WorkspaceCumulativeStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkspaceCumulativeStatisticsInstance Fetched WorkspaceCumulativeStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkspaceCumulativeStatisticsInstance + { + + return $this->proxy()->fetch($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkspaceCumulativeStatisticsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsList.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsList.php new file mode 100755 index 0000000..5d862be --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsList.php @@ -0,0 +1,67 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + ]; + } + + /** + * Constructs a WorkspaceCumulativeStatisticsContext + */ + public function getContext( + + ): WorkspaceCumulativeStatisticsContext + { + return new WorkspaceCumulativeStatisticsContext( + $this->version, + $this->solution['workspaceSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkspaceCumulativeStatisticsList]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsOptions.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsOptions.php new file mode 100755 index 0000000..9591b21 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsOptions.php @@ -0,0 +1,148 @@ +options['endDate'] = $endDate; + $this->options['minutes'] = $minutes; + $this->options['startDate'] = $startDate; + $this->options['taskChannel'] = $taskChannel; + $this->options['splitByWaitTime'] = $splitByWaitTime; + } + + /** + * Only include usage that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * + * @param \DateTime $endDate Only include usage that occurred on or before this date, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. + * + * @param int $minutes Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. + * @return $this Fluent Builder + */ + public function setMinutes(int $minutes): self + { + $this->options['minutes'] = $minutes; + return $this; + } + + /** + * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * + * @param \DateTime $startDate Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only calculate cumulative statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * + * @param string $taskChannel Only calculate cumulative statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * @return $this Fluent Builder + */ + public function setTaskChannel(string $taskChannel): self + { + $this->options['taskChannel'] = $taskChannel; + return $this; + } + + /** + * A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA. TaskRouter will calculate statistics on up to 10,000 Tasks for any given threshold. + * + * @param string $splitByWaitTime A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA. TaskRouter will calculate statistics on up to 10,000 Tasks for any given threshold. + * @return $this Fluent Builder + */ + public function setSplitByWaitTime(string $splitByWaitTime): self + { + $this->options['splitByWaitTime'] = $splitByWaitTime; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.FetchWorkspaceCumulativeStatisticsOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsPage.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsPage.php new file mode 100755 index 0000000..1c2ff4a --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceCumulativeStatisticsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WorkspaceCumulativeStatisticsInstance \Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceCumulativeStatisticsInstance + */ + public function buildInstance(array $payload): WorkspaceCumulativeStatisticsInstance + { + return new WorkspaceCumulativeStatisticsInstance($this->version, $payload, $this->solution['workspaceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkspaceCumulativeStatisticsPage]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsContext.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsContext.php new file mode 100755 index 0000000..7bc048f --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsContext.php @@ -0,0 +1,91 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/RealTimeStatistics'; + } + + /** + * Fetch the WorkspaceRealTimeStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkspaceRealTimeStatisticsInstance Fetched WorkspaceRealTimeStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkspaceRealTimeStatisticsInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'TaskChannel' => + $options['taskChannel'], + ]); + + $payload = $this->version->fetch('GET', $this->uri, $params); + + return new WorkspaceRealTimeStatisticsInstance( + $this->version, + $payload, + $this->solution['workspaceSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkspaceRealTimeStatisticsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsInstance.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsInstance.php new file mode 100755 index 0000000..7bcc89f --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsInstance.php @@ -0,0 +1,135 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'activityStatistics' => Values::array_get($payload, 'activity_statistics'), + 'longestTaskWaitingAge' => Values::array_get($payload, 'longest_task_waiting_age'), + 'longestTaskWaitingSid' => Values::array_get($payload, 'longest_task_waiting_sid'), + 'tasksByPriority' => Values::array_get($payload, 'tasks_by_priority'), + 'tasksByStatus' => Values::array_get($payload, 'tasks_by_status'), + 'totalTasks' => Values::array_get($payload, 'total_tasks'), + 'totalWorkers' => Values::array_get($payload, 'total_workers'), + 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['workspaceSid' => $workspaceSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return WorkspaceRealTimeStatisticsContext Context for this WorkspaceRealTimeStatisticsInstance + */ + protected function proxy(): WorkspaceRealTimeStatisticsContext + { + if (!$this->context) { + $this->context = new WorkspaceRealTimeStatisticsContext( + $this->version, + $this->solution['workspaceSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the WorkspaceRealTimeStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkspaceRealTimeStatisticsInstance Fetched WorkspaceRealTimeStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkspaceRealTimeStatisticsInstance + { + + return $this->proxy()->fetch($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkspaceRealTimeStatisticsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsList.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsList.php new file mode 100755 index 0000000..6a95354 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsList.php @@ -0,0 +1,67 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + ]; + } + + /** + * Constructs a WorkspaceRealTimeStatisticsContext + */ + public function getContext( + + ): WorkspaceRealTimeStatisticsContext + { + return new WorkspaceRealTimeStatisticsContext( + $this->version, + $this->solution['workspaceSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkspaceRealTimeStatisticsList]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsOptions.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsOptions.php new file mode 100755 index 0000000..5458b08 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsOptions.php @@ -0,0 +1,76 @@ +options['taskChannel'] = $taskChannel; + } + + /** + * Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * + * @param string $taskChannel Only calculate real-time statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * @return $this Fluent Builder + */ + public function setTaskChannel(string $taskChannel): self + { + $this->options['taskChannel'] = $taskChannel; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.FetchWorkspaceRealTimeStatisticsOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsPage.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsPage.php new file mode 100755 index 0000000..8e31491 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceRealTimeStatisticsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WorkspaceRealTimeStatisticsInstance \Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceRealTimeStatisticsInstance + */ + public function buildInstance(array $payload): WorkspaceRealTimeStatisticsInstance + { + return new WorkspaceRealTimeStatisticsInstance($this->version, $payload, $this->solution['workspaceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkspaceRealTimeStatisticsPage]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsContext.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsContext.php new file mode 100755 index 0000000..a8bd605 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsContext.php @@ -0,0 +1,100 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($workspaceSid) + .'/Statistics'; + } + + /** + * Fetch the WorkspaceStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkspaceStatisticsInstance Fetched WorkspaceStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkspaceStatisticsInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'Minutes' => + $options['minutes'], + 'StartDate' => + Serialize::iso8601DateTime($options['startDate']), + 'EndDate' => + Serialize::iso8601DateTime($options['endDate']), + 'TaskChannel' => + $options['taskChannel'], + 'SplitByWaitTime' => + $options['splitByWaitTime'], + ]); + + $payload = $this->version->fetch('GET', $this->uri, $params); + + return new WorkspaceStatisticsInstance( + $this->version, + $payload, + $this->solution['workspaceSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkspaceStatisticsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsInstance.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsInstance.php new file mode 100755 index 0000000..7c22d90 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsInstance.php @@ -0,0 +1,125 @@ +properties = [ + 'realtime' => Values::array_get($payload, 'realtime'), + 'cumulative' => Values::array_get($payload, 'cumulative'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'workspaceSid' => Values::array_get($payload, 'workspace_sid'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['workspaceSid' => $workspaceSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return WorkspaceStatisticsContext Context for this WorkspaceStatisticsInstance + */ + protected function proxy(): WorkspaceStatisticsContext + { + if (!$this->context) { + $this->context = new WorkspaceStatisticsContext( + $this->version, + $this->solution['workspaceSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the WorkspaceStatisticsInstance + * + * @param array|Options $options Optional Arguments + * @return WorkspaceStatisticsInstance Fetched WorkspaceStatisticsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): WorkspaceStatisticsInstance + { + + return $this->proxy()->fetch($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkspaceStatisticsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsList.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsList.php new file mode 100755 index 0000000..05016c6 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsList.php @@ -0,0 +1,67 @@ +solution = [ + 'workspaceSid' => + $workspaceSid, + + ]; + } + + /** + * Constructs a WorkspaceStatisticsContext + */ + public function getContext( + + ): WorkspaceStatisticsContext + { + return new WorkspaceStatisticsContext( + $this->version, + $this->solution['workspaceSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkspaceStatisticsList]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsOptions.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsOptions.php new file mode 100755 index 0000000..112ec58 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsOptions.php @@ -0,0 +1,148 @@ +options['minutes'] = $minutes; + $this->options['startDate'] = $startDate; + $this->options['endDate'] = $endDate; + $this->options['taskChannel'] = $taskChannel; + $this->options['splitByWaitTime'] = $splitByWaitTime; + } + + /** + * Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. + * + * @param int $minutes Only calculate statistics since this many minutes in the past. The default 15 minutes. This is helpful for displaying statistics for the last 15 minutes, 240 minutes (4 hours), and 480 minutes (8 hours) to see trends. + * @return $this Fluent Builder + */ + public function setMinutes(int $minutes): self + { + $this->options['minutes'] = $minutes; + return $this; + } + + /** + * Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * + * @param \DateTime $startDate Only calculate statistics from this date and time and later, specified in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. + * @return $this Fluent Builder + */ + public function setStartDate(\DateTime $startDate): self + { + $this->options['startDate'] = $startDate; + return $this; + } + + /** + * Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * + * @param \DateTime $endDate Only calculate statistics from this date and time and earlier, specified in GMT as an [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time. + * @return $this Fluent Builder + */ + public function setEndDate(\DateTime $endDate): self + { + $this->options['endDate'] = $endDate; + return $this; + } + + /** + * Only calculate statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * + * @param string $taskChannel Only calculate statistics on this TaskChannel. Can be the TaskChannel's SID or its `unique_name`, such as `voice`, `sms`, or `default`. + * @return $this Fluent Builder + */ + public function setTaskChannel(string $taskChannel): self + { + $this->options['taskChannel'] = $taskChannel; + return $this; + } + + /** + * A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA. + * + * @param string $splitByWaitTime A comma separated list of values that describes the thresholds, in seconds, to calculate statistics on. For each threshold specified, the number of Tasks canceled and reservations accepted above and below the specified thresholds in seconds are computed. For example, `5,30` would show splits of Tasks that were canceled or accepted before and after 5 seconds and before and after 30 seconds. This can be used to show short abandoned Tasks or Tasks that failed to meet an SLA. + * @return $this Fluent Builder + */ + public function setSplitByWaitTime(string $splitByWaitTime): self + { + $this->options['splitByWaitTime'] = $splitByWaitTime; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.FetchWorkspaceStatisticsOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsPage.php b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsPage.php new file mode 100755 index 0000000..c45edab --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/Workspace/WorkspaceStatisticsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WorkspaceStatisticsInstance \Twilio\Rest\Taskrouter\V1\Workspace\WorkspaceStatisticsInstance + */ + public function buildInstance(array $payload): WorkspaceStatisticsInstance + { + return new WorkspaceStatisticsInstance($this->version, $payload, $this->solution['workspaceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkspaceStatisticsPage]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/WorkspaceContext.php b/app/api/Twilio/Rest/Taskrouter/V1/WorkspaceContext.php new file mode 100755 index 0000000..bade717 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/WorkspaceContext.php @@ -0,0 +1,365 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Workspaces/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the WorkspaceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the WorkspaceInstance + * + * @return WorkspaceInstance Fetched WorkspaceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WorkspaceInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new WorkspaceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the WorkspaceInstance + * + * @param array|Options $options Optional Arguments + * @return WorkspaceInstance Updated WorkspaceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WorkspaceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'DefaultActivitySid' => + $options['defaultActivitySid'], + 'EventCallbackUrl' => + $options['eventCallbackUrl'], + 'EventsFilter' => + $options['eventsFilter'], + 'FriendlyName' => + $options['friendlyName'], + 'MultiTaskEnabled' => + Serialize::booleanToString($options['multiTaskEnabled']), + 'TimeoutActivitySid' => + $options['timeoutActivitySid'], + 'PrioritizeQueueOrder' => + $options['prioritizeQueueOrder'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new WorkspaceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the taskQueues + */ + protected function getTaskQueues(): TaskQueueList + { + if (!$this->_taskQueues) { + $this->_taskQueues = new TaskQueueList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_taskQueues; + } + + /** + * Access the events + */ + protected function getEvents(): EventList + { + if (!$this->_events) { + $this->_events = new EventList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_events; + } + + /** + * Access the taskChannels + */ + protected function getTaskChannels(): TaskChannelList + { + if (!$this->_taskChannels) { + $this->_taskChannels = new TaskChannelList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_taskChannels; + } + + /** + * Access the activities + */ + protected function getActivities(): ActivityList + { + if (!$this->_activities) { + $this->_activities = new ActivityList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_activities; + } + + /** + * Access the workers + */ + protected function getWorkers(): WorkerList + { + if (!$this->_workers) { + $this->_workers = new WorkerList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_workers; + } + + /** + * Access the workflows + */ + protected function getWorkflows(): WorkflowList + { + if (!$this->_workflows) { + $this->_workflows = new WorkflowList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_workflows; + } + + /** + * Access the tasks + */ + protected function getTasks(): TaskList + { + if (!$this->_tasks) { + $this->_tasks = new TaskList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_tasks; + } + + /** + * Access the cumulativeStatistics + */ + protected function getCumulativeStatistics(): WorkspaceCumulativeStatisticsList + { + if (!$this->_cumulativeStatistics) { + $this->_cumulativeStatistics = new WorkspaceCumulativeStatisticsList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_cumulativeStatistics; + } + + /** + * Access the realTimeStatistics + */ + protected function getRealTimeStatistics(): WorkspaceRealTimeStatisticsList + { + if (!$this->_realTimeStatistics) { + $this->_realTimeStatistics = new WorkspaceRealTimeStatisticsList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_realTimeStatistics; + } + + /** + * Access the statistics + */ + protected function getStatistics(): WorkspaceStatisticsList + { + if (!$this->_statistics) { + $this->_statistics = new WorkspaceStatisticsList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_statistics; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkspaceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/WorkspaceInstance.php b/app/api/Twilio/Rest/Taskrouter/V1/WorkspaceInstance.php new file mode 100755 index 0000000..10b6ba3 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/WorkspaceInstance.php @@ -0,0 +1,271 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'defaultActivityName' => Values::array_get($payload, 'default_activity_name'), + 'defaultActivitySid' => Values::array_get($payload, 'default_activity_sid'), + 'eventCallbackUrl' => Values::array_get($payload, 'event_callback_url'), + 'eventsFilter' => Values::array_get($payload, 'events_filter'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'multiTaskEnabled' => Values::array_get($payload, 'multi_task_enabled'), + 'sid' => Values::array_get($payload, 'sid'), + 'timeoutActivityName' => Values::array_get($payload, 'timeout_activity_name'), + 'timeoutActivitySid' => Values::array_get($payload, 'timeout_activity_sid'), + 'prioritizeQueueOrder' => Values::array_get($payload, 'prioritize_queue_order'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return WorkspaceContext Context for this WorkspaceInstance + */ + protected function proxy(): WorkspaceContext + { + if (!$this->context) { + $this->context = new WorkspaceContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the WorkspaceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the WorkspaceInstance + * + * @return WorkspaceInstance Fetched WorkspaceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WorkspaceInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the WorkspaceInstance + * + * @param array|Options $options Optional Arguments + * @return WorkspaceInstance Updated WorkspaceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WorkspaceInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the taskQueues + */ + protected function getTaskQueues(): TaskQueueList + { + return $this->proxy()->taskQueues; + } + + /** + * Access the events + */ + protected function getEvents(): EventList + { + return $this->proxy()->events; + } + + /** + * Access the taskChannels + */ + protected function getTaskChannels(): TaskChannelList + { + return $this->proxy()->taskChannels; + } + + /** + * Access the activities + */ + protected function getActivities(): ActivityList + { + return $this->proxy()->activities; + } + + /** + * Access the workers + */ + protected function getWorkers(): WorkerList + { + return $this->proxy()->workers; + } + + /** + * Access the workflows + */ + protected function getWorkflows(): WorkflowList + { + return $this->proxy()->workflows; + } + + /** + * Access the tasks + */ + protected function getTasks(): TaskList + { + return $this->proxy()->tasks; + } + + /** + * Access the cumulativeStatistics + */ + protected function getCumulativeStatistics(): WorkspaceCumulativeStatisticsList + { + return $this->proxy()->cumulativeStatistics; + } + + /** + * Access the realTimeStatistics + */ + protected function getRealTimeStatistics(): WorkspaceRealTimeStatisticsList + { + return $this->proxy()->realTimeStatistics; + } + + /** + * Access the statistics + */ + protected function getStatistics(): WorkspaceStatisticsList + { + return $this->proxy()->statistics; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Taskrouter.V1.WorkspaceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/WorkspaceList.php b/app/api/Twilio/Rest/Taskrouter/V1/WorkspaceList.php new file mode 100755 index 0000000..0fe8be5 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/WorkspaceList.php @@ -0,0 +1,207 @@ +solution = [ + ]; + + $this->uri = '/Workspaces'; + } + + /** + * Create the WorkspaceInstance + * + * @param string $friendlyName A descriptive string that you create to describe the Workspace resource. It can be up to 64 characters long. For example: `Customer Support` or `2014 Election Campaign`. + * @param array|Options $options Optional Arguments + * @return WorkspaceInstance Created WorkspaceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, array $options = []): WorkspaceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'EventCallbackUrl' => + $options['eventCallbackUrl'], + 'EventsFilter' => + $options['eventsFilter'], + 'MultiTaskEnabled' => + Serialize::booleanToString($options['multiTaskEnabled']), + 'Template' => + $options['template'], + 'PrioritizeQueueOrder' => + $options['prioritizeQueueOrder'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new WorkspaceInstance( + $this->version, + $payload + ); + } + + + /** + * Reads WorkspaceInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return WorkspaceInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams WorkspaceInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of WorkspaceInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return WorkspacePage Page of WorkspaceInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): WorkspacePage + { + $options = new Values($options); + + $params = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new WorkspacePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of WorkspaceInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return WorkspacePage Page of WorkspaceInstance + */ + public function getPage(string $targetUrl): WorkspacePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new WorkspacePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a WorkspaceContext + * + * @param string $sid The SID of the Workspace resource to delete. + */ + public function getContext( + string $sid + + ): WorkspaceContext + { + return new WorkspaceContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkspaceList]'; + } +} diff --git a/app/api/Twilio/Rest/Taskrouter/V1/WorkspaceOptions.php b/app/api/Twilio/Rest/Taskrouter/V1/WorkspaceOptions.php new file mode 100755 index 0000000..0206adb --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/WorkspaceOptions.php @@ -0,0 +1,360 @@ +options['eventCallbackUrl'] = $eventCallbackUrl; + $this->options['eventsFilter'] = $eventsFilter; + $this->options['multiTaskEnabled'] = $multiTaskEnabled; + $this->options['template'] = $template; + $this->options['prioritizeQueueOrder'] = $prioritizeQueueOrder; + } + + /** + * The URL we should call when an event occurs. If provided, the Workspace will publish events to this URL, for example, to collect data for reporting. See [Workspace Events](https://www.twilio.com/docs/taskrouter/api/event) for more information. This parameter supports Twilio's [Webhooks (HTTP callbacks) Connection Overrides](https://www.twilio.com/docs/usage/webhooks/webhooks-connection-overrides). + * + * @param string $eventCallbackUrl The URL we should call when an event occurs. If provided, the Workspace will publish events to this URL, for example, to collect data for reporting. See [Workspace Events](https://www.twilio.com/docs/taskrouter/api/event) for more information. This parameter supports Twilio's [Webhooks (HTTP callbacks) Connection Overrides](https://www.twilio.com/docs/usage/webhooks/webhooks-connection-overrides). + * @return $this Fluent Builder + */ + public function setEventCallbackUrl(string $eventCallbackUrl): self + { + $this->options['eventCallbackUrl'] = $eventCallbackUrl; + return $this; + } + + /** + * The list of Workspace events for which to call event_callback_url. For example, if `EventsFilter=task.created, task.canceled, worker.activity.update`, then TaskRouter will call event_callback_url only when a task is created, canceled, or a Worker activity is updated. + * + * @param string $eventsFilter The list of Workspace events for which to call event_callback_url. For example, if `EventsFilter=task.created, task.canceled, worker.activity.update`, then TaskRouter will call event_callback_url only when a task is created, canceled, or a Worker activity is updated. + * @return $this Fluent Builder + */ + public function setEventsFilter(string $eventsFilter): self + { + $this->options['eventsFilter'] = $eventsFilter; + return $this; + } + + /** + * Whether to enable multi-tasking. Can be: `true` to enable multi-tasking, or `false` to disable it. However, all workspaces should be created as multi-tasking. The default is `true`. Multi-tasking allows Workers to handle multiple Tasks simultaneously. When enabled (`true`), each Worker can receive parallel reservations up to the per-channel maximums defined in the Workers section. In single-tasking mode (legacy mode), each Worker will only receive a new reservation when the previous task is completed. Learn more at [Multitasking](https://www.twilio.com/docs/taskrouter/multitasking). + * + * @param bool $multiTaskEnabled Whether to enable multi-tasking. Can be: `true` to enable multi-tasking, or `false` to disable it. However, all workspaces should be created as multi-tasking. The default is `true`. Multi-tasking allows Workers to handle multiple Tasks simultaneously. When enabled (`true`), each Worker can receive parallel reservations up to the per-channel maximums defined in the Workers section. In single-tasking mode (legacy mode), each Worker will only receive a new reservation when the previous task is completed. Learn more at [Multitasking](https://www.twilio.com/docs/taskrouter/multitasking). + * @return $this Fluent Builder + */ + public function setMultiTaskEnabled(bool $multiTaskEnabled): self + { + $this->options['multiTaskEnabled'] = $multiTaskEnabled; + return $this; + } + + /** + * An available template name. Can be: `NONE` or `FIFO` and the default is `NONE`. Pre-configures the Workspace with the Workflow and Activities specified in the template. `NONE` will create a Workspace with only a set of default activities. `FIFO` will configure TaskRouter with a set of default activities and a single TaskQueue for first-in, first-out distribution, which can be useful when you are getting started with TaskRouter. + * + * @param string $template An available template name. Can be: `NONE` or `FIFO` and the default is `NONE`. Pre-configures the Workspace with the Workflow and Activities specified in the template. `NONE` will create a Workspace with only a set of default activities. `FIFO` will configure TaskRouter with a set of default activities and a single TaskQueue for first-in, first-out distribution, which can be useful when you are getting started with TaskRouter. + * @return $this Fluent Builder + */ + public function setTemplate(string $template): self + { + $this->options['template'] = $template; + return $this; + } + + /** + * @param string $prioritizeQueueOrder + * @return $this Fluent Builder + */ + public function setPrioritizeQueueOrder(string $prioritizeQueueOrder): self + { + $this->options['prioritizeQueueOrder'] = $prioritizeQueueOrder; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.CreateWorkspaceOptions ' . $options . ']'; + } +} + + + +class ReadWorkspaceOptions extends Options + { + /** + * @param string $friendlyName The `friendly_name` of the Workspace resources to read. For example `Customer Support` or `2014 Election Campaign`. + */ + public function __construct( + + string $friendlyName = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + } + + /** + * The `friendly_name` of the Workspace resources to read. For example `Customer Support` or `2014 Election Campaign`. + * + * @param string $friendlyName The `friendly_name` of the Workspace resources to read. For example `Customer Support` or `2014 Election Campaign`. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.ReadWorkspaceOptions ' . $options . ']'; + } +} + +class UpdateWorkspaceOptions extends Options + { + /** + * @param string $defaultActivitySid The SID of the Activity that will be used when new Workers are created in the Workspace. + * @param string $eventCallbackUrl The URL we should call when an event occurs. See [Workspace Events](https://www.twilio.com/docs/taskrouter/api/event) for more information. This parameter supports Twilio's [Webhooks (HTTP callbacks) Connection Overrides](https://www.twilio.com/docs/usage/webhooks/webhooks-connection-overrides). + * @param string $eventsFilter The list of Workspace events for which to call event_callback_url. For example if `EventsFilter=task.created,task.canceled,worker.activity.update`, then TaskRouter will call event_callback_url only when a task is created, canceled, or a Worker activity is updated. + * @param string $friendlyName A descriptive string that you create to describe the Workspace resource. For example: `Sales Call Center` or `Customer Support Team`. + * @param bool $multiTaskEnabled Whether to enable multi-tasking. Can be: `true` to enable multi-tasking, or `false` to disable it. However, all workspaces should be maintained as multi-tasking. There is no default when omitting this parameter. A multi-tasking Workspace can't be updated to single-tasking unless it is not a Flex Project and another (legacy) single-tasking Workspace exists. Multi-tasking allows Workers to handle multiple Tasks simultaneously. In multi-tasking mode, each Worker can receive parallel reservations up to the per-channel maximums defined in the Workers section. In single-tasking mode (legacy mode), each Worker will only receive a new reservation when the previous task is completed. Learn more at [Multitasking](https://www.twilio.com/docs/taskrouter/multitasking). + * @param string $timeoutActivitySid The SID of the Activity that will be assigned to a Worker when a Task reservation times out without a response. + * @param string $prioritizeQueueOrder + */ + public function __construct( + + string $defaultActivitySid = Values::NONE, + string $eventCallbackUrl = Values::NONE, + string $eventsFilter = Values::NONE, + string $friendlyName = Values::NONE, + bool $multiTaskEnabled = Values::BOOL_NONE, + string $timeoutActivitySid = Values::NONE, + string $prioritizeQueueOrder = Values::NONE + + ) { + $this->options['defaultActivitySid'] = $defaultActivitySid; + $this->options['eventCallbackUrl'] = $eventCallbackUrl; + $this->options['eventsFilter'] = $eventsFilter; + $this->options['friendlyName'] = $friendlyName; + $this->options['multiTaskEnabled'] = $multiTaskEnabled; + $this->options['timeoutActivitySid'] = $timeoutActivitySid; + $this->options['prioritizeQueueOrder'] = $prioritizeQueueOrder; + } + + /** + * The SID of the Activity that will be used when new Workers are created in the Workspace. + * + * @param string $defaultActivitySid The SID of the Activity that will be used when new Workers are created in the Workspace. + * @return $this Fluent Builder + */ + public function setDefaultActivitySid(string $defaultActivitySid): self + { + $this->options['defaultActivitySid'] = $defaultActivitySid; + return $this; + } + + /** + * The URL we should call when an event occurs. See [Workspace Events](https://www.twilio.com/docs/taskrouter/api/event) for more information. This parameter supports Twilio's [Webhooks (HTTP callbacks) Connection Overrides](https://www.twilio.com/docs/usage/webhooks/webhooks-connection-overrides). + * + * @param string $eventCallbackUrl The URL we should call when an event occurs. See [Workspace Events](https://www.twilio.com/docs/taskrouter/api/event) for more information. This parameter supports Twilio's [Webhooks (HTTP callbacks) Connection Overrides](https://www.twilio.com/docs/usage/webhooks/webhooks-connection-overrides). + * @return $this Fluent Builder + */ + public function setEventCallbackUrl(string $eventCallbackUrl): self + { + $this->options['eventCallbackUrl'] = $eventCallbackUrl; + return $this; + } + + /** + * The list of Workspace events for which to call event_callback_url. For example if `EventsFilter=task.created,task.canceled,worker.activity.update`, then TaskRouter will call event_callback_url only when a task is created, canceled, or a Worker activity is updated. + * + * @param string $eventsFilter The list of Workspace events for which to call event_callback_url. For example if `EventsFilter=task.created,task.canceled,worker.activity.update`, then TaskRouter will call event_callback_url only when a task is created, canceled, or a Worker activity is updated. + * @return $this Fluent Builder + */ + public function setEventsFilter(string $eventsFilter): self + { + $this->options['eventsFilter'] = $eventsFilter; + return $this; + } + + /** + * A descriptive string that you create to describe the Workspace resource. For example: `Sales Call Center` or `Customer Support Team`. + * + * @param string $friendlyName A descriptive string that you create to describe the Workspace resource. For example: `Sales Call Center` or `Customer Support Team`. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Whether to enable multi-tasking. Can be: `true` to enable multi-tasking, or `false` to disable it. However, all workspaces should be maintained as multi-tasking. There is no default when omitting this parameter. A multi-tasking Workspace can't be updated to single-tasking unless it is not a Flex Project and another (legacy) single-tasking Workspace exists. Multi-tasking allows Workers to handle multiple Tasks simultaneously. In multi-tasking mode, each Worker can receive parallel reservations up to the per-channel maximums defined in the Workers section. In single-tasking mode (legacy mode), each Worker will only receive a new reservation when the previous task is completed. Learn more at [Multitasking](https://www.twilio.com/docs/taskrouter/multitasking). + * + * @param bool $multiTaskEnabled Whether to enable multi-tasking. Can be: `true` to enable multi-tasking, or `false` to disable it. However, all workspaces should be maintained as multi-tasking. There is no default when omitting this parameter. A multi-tasking Workspace can't be updated to single-tasking unless it is not a Flex Project and another (legacy) single-tasking Workspace exists. Multi-tasking allows Workers to handle multiple Tasks simultaneously. In multi-tasking mode, each Worker can receive parallel reservations up to the per-channel maximums defined in the Workers section. In single-tasking mode (legacy mode), each Worker will only receive a new reservation when the previous task is completed. Learn more at [Multitasking](https://www.twilio.com/docs/taskrouter/multitasking). + * @return $this Fluent Builder + */ + public function setMultiTaskEnabled(bool $multiTaskEnabled): self + { + $this->options['multiTaskEnabled'] = $multiTaskEnabled; + return $this; + } + + /** + * The SID of the Activity that will be assigned to a Worker when a Task reservation times out without a response. + * + * @param string $timeoutActivitySid The SID of the Activity that will be assigned to a Worker when a Task reservation times out without a response. + * @return $this Fluent Builder + */ + public function setTimeoutActivitySid(string $timeoutActivitySid): self + { + $this->options['timeoutActivitySid'] = $timeoutActivitySid; + return $this; + } + + /** + * @param string $prioritizeQueueOrder + * @return $this Fluent Builder + */ + public function setPrioritizeQueueOrder(string $prioritizeQueueOrder): self + { + $this->options['prioritizeQueueOrder'] = $prioritizeQueueOrder; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Taskrouter.V1.UpdateWorkspaceOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Taskrouter/V1/WorkspacePage.php b/app/api/Twilio/Rest/Taskrouter/V1/WorkspacePage.php new file mode 100755 index 0000000..b3627c6 --- /dev/null +++ b/app/api/Twilio/Rest/Taskrouter/V1/WorkspacePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WorkspaceInstance \Twilio\Rest\Taskrouter\V1\WorkspaceInstance + */ + public function buildInstance(array $payload): WorkspaceInstance + { + return new WorkspaceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Taskrouter.V1.WorkspacePage]'; + } +} diff --git a/app/api/Twilio/Rest/TaskrouterBase.php b/app/api/Twilio/Rest/TaskrouterBase.php new file mode 100755 index 0000000..00cfe8d --- /dev/null +++ b/app/api/Twilio/Rest/TaskrouterBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://taskrouter.twilio.com'; + } + + + /** + * @return V1 Version v1 of taskrouter + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Taskrouter]'; + } +} diff --git a/app/api/Twilio/Rest/Trunking.php b/app/api/Twilio/Rest/Trunking.php new file mode 100755 index 0000000..da511ea --- /dev/null +++ b/app/api/Twilio/Rest/Trunking.php @@ -0,0 +1,24 @@ +trunks instead. + */ + protected function getTrunks(): \Twilio\Rest\Trunking\V1\TrunkList { + echo "trunks is deprecated. Use v1->trunks instead."; + return $this->v1->trunks; + } + + /** + * @deprecated Use v1->trunks(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextTrunks(string $sid): \Twilio\Rest\Trunking\V1\TrunkContext { + echo "trunks(\$sid) is deprecated. Use v1->trunks(\$sid) instead."; + return $this->v1->trunks($sid); + } +} \ No newline at end of file diff --git a/app/api/Twilio/Rest/Trunking/V1.php b/app/api/Twilio/Rest/Trunking/V1.php new file mode 100755 index 0000000..65e06a6 --- /dev/null +++ b/app/api/Twilio/Rest/Trunking/V1.php @@ -0,0 +1,95 @@ +version = 'v1'; + } + + protected function getTrunks(): TrunkList + { + if (!$this->_trunks) { + $this->_trunks = new TrunkList($this); + } + return $this->_trunks; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trunking.V1]'; + } +} diff --git a/app/api/Twilio/Rest/Trunking/V1/Trunk/CredentialListContext.php b/app/api/Twilio/Rest/Trunking/V1/Trunk/CredentialListContext.php new file mode 100755 index 0000000..857213a --- /dev/null +++ b/app/api/Twilio/Rest/Trunking/V1/Trunk/CredentialListContext.php @@ -0,0 +1,100 @@ +solution = [ + 'trunkSid' => + $trunkSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Trunks/' . \rawurlencode($trunkSid) + .'/CredentialLists/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the CredentialListInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the CredentialListInstance + * + * @return CredentialListInstance Fetched CredentialListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialListInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new CredentialListInstance( + $this->version, + $payload, + $this->solution['trunkSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trunking.V1.CredentialListContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Trunking/V1/Trunk/CredentialListInstance.php b/app/api/Twilio/Rest/Trunking/V1/Trunk/CredentialListInstance.php new file mode 100755 index 0000000..770eca7 --- /dev/null +++ b/app/api/Twilio/Rest/Trunking/V1/Trunk/CredentialListInstance.php @@ -0,0 +1,142 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'trunkSid' => Values::array_get($payload, 'trunk_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['trunkSid' => $trunkSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CredentialListContext Context for this CredentialListInstance + */ + protected function proxy(): CredentialListContext + { + if (!$this->context) { + $this->context = new CredentialListContext( + $this->version, + $this->solution['trunkSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the CredentialListInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the CredentialListInstance + * + * @return CredentialListInstance Fetched CredentialListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CredentialListInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trunking.V1.CredentialListInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Trunking/V1/Trunk/CredentialListList.php b/app/api/Twilio/Rest/Trunking/V1/Trunk/CredentialListList.php new file mode 100755 index 0000000..38c05b7 --- /dev/null +++ b/app/api/Twilio/Rest/Trunking/V1/Trunk/CredentialListList.php @@ -0,0 +1,194 @@ +solution = [ + 'trunkSid' => + $trunkSid, + + ]; + + $this->uri = '/Trunks/' . \rawurlencode($trunkSid) + .'/CredentialLists'; + } + + /** + * Create the CredentialListInstance + * + * @param string $credentialListSid The SID of the [Credential List](https://www.twilio.com/docs/voice/sip/api/sip-credentiallist-resource) that you want to associate with the trunk. Once associated, we will authenticate access to the trunk against this list. + * @return CredentialListInstance Created CredentialListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $credentialListSid): CredentialListInstance + { + + $data = Values::of([ + 'CredentialListSid' => + $credentialListSid, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new CredentialListInstance( + $this->version, + $payload, + $this->solution['trunkSid'] + ); + } + + + /** + * Reads CredentialListInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return CredentialListInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams CredentialListInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CredentialListInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return CredentialListPage Page of CredentialListInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CredentialListPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new CredentialListPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of CredentialListInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return CredentialListPage Page of CredentialListInstance + */ + public function getPage(string $targetUrl): CredentialListPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CredentialListPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CredentialListContext + * + * @param string $sid The unique string that we created to identify the CredentialList resource to delete. + */ + public function getContext( + string $sid + + ): CredentialListContext + { + return new CredentialListContext( + $this->version, + $this->solution['trunkSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trunking.V1.CredentialListList]'; + } +} diff --git a/app/api/Twilio/Rest/Trunking/V1/Trunk/CredentialListPage.php b/app/api/Twilio/Rest/Trunking/V1/Trunk/CredentialListPage.php new file mode 100755 index 0000000..eade2b1 --- /dev/null +++ b/app/api/Twilio/Rest/Trunking/V1/Trunk/CredentialListPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CredentialListInstance \Twilio\Rest\Trunking\V1\Trunk\CredentialListInstance + */ + public function buildInstance(array $payload): CredentialListInstance + { + return new CredentialListInstance($this->version, $payload, $this->solution['trunkSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trunking.V1.CredentialListPage]'; + } +} diff --git a/app/api/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListContext.php b/app/api/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListContext.php new file mode 100755 index 0000000..18e748e --- /dev/null +++ b/app/api/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListContext.php @@ -0,0 +1,100 @@ +solution = [ + 'trunkSid' => + $trunkSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Trunks/' . \rawurlencode($trunkSid) + .'/IpAccessControlLists/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the IpAccessControlListInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the IpAccessControlListInstance + * + * @return IpAccessControlListInstance Fetched IpAccessControlListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): IpAccessControlListInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new IpAccessControlListInstance( + $this->version, + $payload, + $this->solution['trunkSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trunking.V1.IpAccessControlListContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListInstance.php b/app/api/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListInstance.php new file mode 100755 index 0000000..550846b --- /dev/null +++ b/app/api/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListInstance.php @@ -0,0 +1,142 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'trunkSid' => Values::array_get($payload, 'trunk_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['trunkSid' => $trunkSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return IpAccessControlListContext Context for this IpAccessControlListInstance + */ + protected function proxy(): IpAccessControlListContext + { + if (!$this->context) { + $this->context = new IpAccessControlListContext( + $this->version, + $this->solution['trunkSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the IpAccessControlListInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the IpAccessControlListInstance + * + * @return IpAccessControlListInstance Fetched IpAccessControlListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): IpAccessControlListInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trunking.V1.IpAccessControlListInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListList.php b/app/api/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListList.php new file mode 100755 index 0000000..9574e4f --- /dev/null +++ b/app/api/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListList.php @@ -0,0 +1,194 @@ +solution = [ + 'trunkSid' => + $trunkSid, + + ]; + + $this->uri = '/Trunks/' . \rawurlencode($trunkSid) + .'/IpAccessControlLists'; + } + + /** + * Create the IpAccessControlListInstance + * + * @param string $ipAccessControlListSid The SID of the [IP Access Control List](https://www.twilio.com/docs/voice/sip/api/sip-ipaccesscontrollist-resource) that you want to associate with the trunk. + * @return IpAccessControlListInstance Created IpAccessControlListInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $ipAccessControlListSid): IpAccessControlListInstance + { + + $data = Values::of([ + 'IpAccessControlListSid' => + $ipAccessControlListSid, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new IpAccessControlListInstance( + $this->version, + $payload, + $this->solution['trunkSid'] + ); + } + + + /** + * Reads IpAccessControlListInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return IpAccessControlListInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams IpAccessControlListInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of IpAccessControlListInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return IpAccessControlListPage Page of IpAccessControlListInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): IpAccessControlListPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new IpAccessControlListPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of IpAccessControlListInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return IpAccessControlListPage Page of IpAccessControlListInstance + */ + public function getPage(string $targetUrl): IpAccessControlListPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new IpAccessControlListPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a IpAccessControlListContext + * + * @param string $sid The unique string that we created to identify the IpAccessControlList resource to delete. + */ + public function getContext( + string $sid + + ): IpAccessControlListContext + { + return new IpAccessControlListContext( + $this->version, + $this->solution['trunkSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trunking.V1.IpAccessControlListList]'; + } +} diff --git a/app/api/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListPage.php b/app/api/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListPage.php new file mode 100755 index 0000000..7a0559f --- /dev/null +++ b/app/api/Twilio/Rest/Trunking/V1/Trunk/IpAccessControlListPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return IpAccessControlListInstance \Twilio\Rest\Trunking\V1\Trunk\IpAccessControlListInstance + */ + public function buildInstance(array $payload): IpAccessControlListInstance + { + return new IpAccessControlListInstance($this->version, $payload, $this->solution['trunkSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trunking.V1.IpAccessControlListPage]'; + } +} diff --git a/app/api/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlContext.php b/app/api/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlContext.php new file mode 100755 index 0000000..f932b97 --- /dev/null +++ b/app/api/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlContext.php @@ -0,0 +1,139 @@ +solution = [ + 'trunkSid' => + $trunkSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Trunks/' . \rawurlencode($trunkSid) + .'/OriginationUrls/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the OriginationUrlInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the OriginationUrlInstance + * + * @return OriginationUrlInstance Fetched OriginationUrlInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): OriginationUrlInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new OriginationUrlInstance( + $this->version, + $payload, + $this->solution['trunkSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the OriginationUrlInstance + * + * @param array|Options $options Optional Arguments + * @return OriginationUrlInstance Updated OriginationUrlInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): OriginationUrlInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Weight' => + $options['weight'], + 'Priority' => + $options['priority'], + 'Enabled' => + Serialize::booleanToString($options['enabled']), + 'FriendlyName' => + $options['friendlyName'], + 'SipUrl' => + $options['sipUrl'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new OriginationUrlInstance( + $this->version, + $payload, + $this->solution['trunkSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trunking.V1.OriginationUrlContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlInstance.php b/app/api/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlInstance.php new file mode 100755 index 0000000..8efecc3 --- /dev/null +++ b/app/api/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlInstance.php @@ -0,0 +1,164 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'trunkSid' => Values::array_get($payload, 'trunk_sid'), + 'weight' => Values::array_get($payload, 'weight'), + 'enabled' => Values::array_get($payload, 'enabled'), + 'sipUrl' => Values::array_get($payload, 'sip_url'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'priority' => Values::array_get($payload, 'priority'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['trunkSid' => $trunkSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return OriginationUrlContext Context for this OriginationUrlInstance + */ + protected function proxy(): OriginationUrlContext + { + if (!$this->context) { + $this->context = new OriginationUrlContext( + $this->version, + $this->solution['trunkSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the OriginationUrlInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the OriginationUrlInstance + * + * @return OriginationUrlInstance Fetched OriginationUrlInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): OriginationUrlInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the OriginationUrlInstance + * + * @param array|Options $options Optional Arguments + * @return OriginationUrlInstance Updated OriginationUrlInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): OriginationUrlInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trunking.V1.OriginationUrlInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlList.php b/app/api/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlList.php new file mode 100755 index 0000000..cbe9988 --- /dev/null +++ b/app/api/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlList.php @@ -0,0 +1,207 @@ +solution = [ + 'trunkSid' => + $trunkSid, + + ]; + + $this->uri = '/Trunks/' . \rawurlencode($trunkSid) + .'/OriginationUrls'; + } + + /** + * Create the OriginationUrlInstance + * + * @param int $weight The value that determines the relative share of the load the URI should receive compared to other URIs with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. URLs with higher values receive more load than those with lower ones with the same priority. + * @param int $priority The relative importance of the URI. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important URI. + * @param bool $enabled Whether the URL is enabled. The default is `true`. + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @param string $sipUrl The SIP address you want Twilio to route your Origination calls to. This must be a `sip:` schema. + * @return OriginationUrlInstance Created OriginationUrlInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(int $weight, int $priority, bool $enabled, string $friendlyName, string $sipUrl): OriginationUrlInstance + { + + $data = Values::of([ + 'Weight' => + $weight, + 'Priority' => + $priority, + 'Enabled' => + Serialize::booleanToString($enabled), + 'FriendlyName' => + $friendlyName, + 'SipUrl' => + $sipUrl, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new OriginationUrlInstance( + $this->version, + $payload, + $this->solution['trunkSid'] + ); + } + + + /** + * Reads OriginationUrlInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return OriginationUrlInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams OriginationUrlInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of OriginationUrlInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return OriginationUrlPage Page of OriginationUrlInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): OriginationUrlPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new OriginationUrlPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of OriginationUrlInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return OriginationUrlPage Page of OriginationUrlInstance + */ + public function getPage(string $targetUrl): OriginationUrlPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new OriginationUrlPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a OriginationUrlContext + * + * @param string $sid The unique string that we created to identify the OriginationUrl resource to delete. + */ + public function getContext( + string $sid + + ): OriginationUrlContext + { + return new OriginationUrlContext( + $this->version, + $this->solution['trunkSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trunking.V1.OriginationUrlList]'; + } +} diff --git a/app/api/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlOptions.php b/app/api/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlOptions.php new file mode 100755 index 0000000..b9048c5 --- /dev/null +++ b/app/api/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlOptions.php @@ -0,0 +1,156 @@ +options['weight'] = $weight; + $this->options['priority'] = $priority; + $this->options['enabled'] = $enabled; + $this->options['friendlyName'] = $friendlyName; + $this->options['sipUrl'] = $sipUrl; + } + + /** + * The value that determines the relative share of the load the URI should receive compared to other URIs with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. URLs with higher values receive more load than those with lower ones with the same priority. + * + * @param int $weight The value that determines the relative share of the load the URI should receive compared to other URIs with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. URLs with higher values receive more load than those with lower ones with the same priority. + * @return $this Fluent Builder + */ + public function setWeight(int $weight): self + { + $this->options['weight'] = $weight; + return $this; + } + + /** + * The relative importance of the URI. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important URI. + * + * @param int $priority The relative importance of the URI. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important URI. + * @return $this Fluent Builder + */ + public function setPriority(int $priority): self + { + $this->options['priority'] = $priority; + return $this; + } + + /** + * Whether the URL is enabled. The default is `true`. + * + * @param bool $enabled Whether the URL is enabled. The default is `true`. + * @return $this Fluent Builder + */ + public function setEnabled(bool $enabled): self + { + $this->options['enabled'] = $enabled; + return $this; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The SIP address you want Twilio to route your Origination calls to. This must be a `sip:` schema. `sips` is NOT supported. + * + * @param string $sipUrl The SIP address you want Twilio to route your Origination calls to. This must be a `sip:` schema. `sips` is NOT supported. + * @return $this Fluent Builder + */ + public function setSipUrl(string $sipUrl): self + { + $this->options['sipUrl'] = $sipUrl; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trunking.V1.UpdateOriginationUrlOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlPage.php b/app/api/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlPage.php new file mode 100755 index 0000000..85e1229 --- /dev/null +++ b/app/api/Twilio/Rest/Trunking/V1/Trunk/OriginationUrlPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return OriginationUrlInstance \Twilio\Rest\Trunking\V1\Trunk\OriginationUrlInstance + */ + public function buildInstance(array $payload): OriginationUrlInstance + { + return new OriginationUrlInstance($this->version, $payload, $this->solution['trunkSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trunking.V1.OriginationUrlPage]'; + } +} diff --git a/app/api/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberContext.php b/app/api/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberContext.php new file mode 100755 index 0000000..04dba0d --- /dev/null +++ b/app/api/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberContext.php @@ -0,0 +1,100 @@ +solution = [ + 'trunkSid' => + $trunkSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Trunks/' . \rawurlencode($trunkSid) + .'/PhoneNumbers/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the PhoneNumberInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the PhoneNumberInstance + * + * @return PhoneNumberInstance Fetched PhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PhoneNumberInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new PhoneNumberInstance( + $this->version, + $payload, + $this->solution['trunkSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trunking.V1.PhoneNumberContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberInstance.php b/app/api/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberInstance.php new file mode 100755 index 0000000..80fa4a4 --- /dev/null +++ b/app/api/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberInstance.php @@ -0,0 +1,180 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'addressRequirements' => Values::array_get($payload, 'address_requirements'), + 'apiVersion' => Values::array_get($payload, 'api_version'), + 'beta' => Values::array_get($payload, 'beta'), + 'capabilities' => Values::array_get($payload, 'capabilities'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'links' => Values::array_get($payload, 'links'), + 'phoneNumber' => Values::array_get($payload, 'phone_number'), + 'sid' => Values::array_get($payload, 'sid'), + 'smsApplicationSid' => Values::array_get($payload, 'sms_application_sid'), + 'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'), + 'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'), + 'smsMethod' => Values::array_get($payload, 'sms_method'), + 'smsUrl' => Values::array_get($payload, 'sms_url'), + 'statusCallback' => Values::array_get($payload, 'status_callback'), + 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), + 'trunkSid' => Values::array_get($payload, 'trunk_sid'), + 'url' => Values::array_get($payload, 'url'), + 'voiceApplicationSid' => Values::array_get($payload, 'voice_application_sid'), + 'voiceCallerIdLookup' => Values::array_get($payload, 'voice_caller_id_lookup'), + 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), + 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), + 'voiceMethod' => Values::array_get($payload, 'voice_method'), + 'voiceUrl' => Values::array_get($payload, 'voice_url'), + ]; + + $this->solution = ['trunkSid' => $trunkSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return PhoneNumberContext Context for this PhoneNumberInstance + */ + protected function proxy(): PhoneNumberContext + { + if (!$this->context) { + $this->context = new PhoneNumberContext( + $this->version, + $this->solution['trunkSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the PhoneNumberInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the PhoneNumberInstance + * + * @return PhoneNumberInstance Fetched PhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PhoneNumberInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trunking.V1.PhoneNumberInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberList.php b/app/api/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberList.php new file mode 100755 index 0000000..b8c956a --- /dev/null +++ b/app/api/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberList.php @@ -0,0 +1,194 @@ +solution = [ + 'trunkSid' => + $trunkSid, + + ]; + + $this->uri = '/Trunks/' . \rawurlencode($trunkSid) + .'/PhoneNumbers'; + } + + /** + * Create the PhoneNumberInstance + * + * @param string $phoneNumberSid The SID of the [Incoming Phone Number](https://www.twilio.com/docs/phone-numbers/api/incomingphonenumber-resource) that you want to associate with the trunk. + * @return PhoneNumberInstance Created PhoneNumberInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $phoneNumberSid): PhoneNumberInstance + { + + $data = Values::of([ + 'PhoneNumberSid' => + $phoneNumberSid, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new PhoneNumberInstance( + $this->version, + $payload, + $this->solution['trunkSid'] + ); + } + + + /** + * Reads PhoneNumberInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return PhoneNumberInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams PhoneNumberInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of PhoneNumberInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return PhoneNumberPage Page of PhoneNumberInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): PhoneNumberPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new PhoneNumberPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of PhoneNumberInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return PhoneNumberPage Page of PhoneNumberInstance + */ + public function getPage(string $targetUrl): PhoneNumberPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new PhoneNumberPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a PhoneNumberContext + * + * @param string $sid The unique string that we created to identify the PhoneNumber resource to delete. + */ + public function getContext( + string $sid + + ): PhoneNumberContext + { + return new PhoneNumberContext( + $this->version, + $this->solution['trunkSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trunking.V1.PhoneNumberList]'; + } +} diff --git a/app/api/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberPage.php b/app/api/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberPage.php new file mode 100755 index 0000000..6429546 --- /dev/null +++ b/app/api/Twilio/Rest/Trunking/V1/Trunk/PhoneNumberPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PhoneNumberInstance \Twilio\Rest\Trunking\V1\Trunk\PhoneNumberInstance + */ + public function buildInstance(array $payload): PhoneNumberInstance + { + return new PhoneNumberInstance($this->version, $payload, $this->solution['trunkSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trunking.V1.PhoneNumberPage]'; + } +} diff --git a/app/api/Twilio/Rest/Trunking/V1/Trunk/RecordingContext.php b/app/api/Twilio/Rest/Trunking/V1/Trunk/RecordingContext.php new file mode 100755 index 0000000..ccb14ee --- /dev/null +++ b/app/api/Twilio/Rest/Trunking/V1/Trunk/RecordingContext.php @@ -0,0 +1,112 @@ +solution = [ + 'trunkSid' => + $trunkSid, + ]; + + $this->uri = '/Trunks/' . \rawurlencode($trunkSid) + .'/Recording'; + } + + /** + * Fetch the RecordingInstance + * + * @return RecordingInstance Fetched RecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RecordingInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new RecordingInstance( + $this->version, + $payload, + $this->solution['trunkSid'] + ); + } + + + /** + * Update the RecordingInstance + * + * @param array|Options $options Optional Arguments + * @return RecordingInstance Updated RecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): RecordingInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Mode' => + $options['mode'], + 'Trim' => + $options['trim'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new RecordingInstance( + $this->version, + $payload, + $this->solution['trunkSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trunking.V1.RecordingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Trunking/V1/Trunk/RecordingInstance.php b/app/api/Twilio/Rest/Trunking/V1/Trunk/RecordingInstance.php new file mode 100755 index 0000000..dfab9ce --- /dev/null +++ b/app/api/Twilio/Rest/Trunking/V1/Trunk/RecordingInstance.php @@ -0,0 +1,131 @@ +properties = [ + 'mode' => Values::array_get($payload, 'mode'), + 'trim' => Values::array_get($payload, 'trim'), + ]; + + $this->solution = ['trunkSid' => $trunkSid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return RecordingContext Context for this RecordingInstance + */ + protected function proxy(): RecordingContext + { + if (!$this->context) { + $this->context = new RecordingContext( + $this->version, + $this->solution['trunkSid'] + ); + } + + return $this->context; + } + + /** + * Fetch the RecordingInstance + * + * @return RecordingInstance Fetched RecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RecordingInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the RecordingInstance + * + * @param array|Options $options Optional Arguments + * @return RecordingInstance Updated RecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): RecordingInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trunking.V1.RecordingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Trunking/V1/Trunk/RecordingList.php b/app/api/Twilio/Rest/Trunking/V1/Trunk/RecordingList.php new file mode 100755 index 0000000..e1cdd4b --- /dev/null +++ b/app/api/Twilio/Rest/Trunking/V1/Trunk/RecordingList.php @@ -0,0 +1,67 @@ +solution = [ + 'trunkSid' => + $trunkSid, + + ]; + } + + /** + * Constructs a RecordingContext + */ + public function getContext( + + ): RecordingContext + { + return new RecordingContext( + $this->version, + $this->solution['trunkSid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trunking.V1.RecordingList]'; + } +} diff --git a/app/api/Twilio/Rest/Trunking/V1/Trunk/RecordingOptions.php b/app/api/Twilio/Rest/Trunking/V1/Trunk/RecordingOptions.php new file mode 100755 index 0000000..13a8345 --- /dev/null +++ b/app/api/Twilio/Rest/Trunking/V1/Trunk/RecordingOptions.php @@ -0,0 +1,92 @@ +options['mode'] = $mode; + $this->options['trim'] = $trim; + } + + /** + * @param string $mode + * @return $this Fluent Builder + */ + public function setMode(string $mode): self + { + $this->options['mode'] = $mode; + return $this; + } + + /** + * @param string $trim + * @return $this Fluent Builder + */ + public function setTrim(string $trim): self + { + $this->options['trim'] = $trim; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trunking.V1.UpdateRecordingOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Trunking/V1/Trunk/RecordingPage.php b/app/api/Twilio/Rest/Trunking/V1/Trunk/RecordingPage.php new file mode 100755 index 0000000..7ae87e7 --- /dev/null +++ b/app/api/Twilio/Rest/Trunking/V1/Trunk/RecordingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RecordingInstance \Twilio\Rest\Trunking\V1\Trunk\RecordingInstance + */ + public function buildInstance(array $payload): RecordingInstance + { + return new RecordingInstance($this->version, $payload, $this->solution['trunkSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trunking.V1.RecordingPage]'; + } +} diff --git a/app/api/Twilio/Rest/Trunking/V1/TrunkContext.php b/app/api/Twilio/Rest/Trunking/V1/TrunkContext.php new file mode 100755 index 0000000..02f0bcd --- /dev/null +++ b/app/api/Twilio/Rest/Trunking/V1/TrunkContext.php @@ -0,0 +1,272 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Trunks/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the TrunkInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the TrunkInstance + * + * @return TrunkInstance Fetched TrunkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TrunkInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new TrunkInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the TrunkInstance + * + * @param array|Options $options Optional Arguments + * @return TrunkInstance Updated TrunkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TrunkInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'DomainName' => + $options['domainName'], + 'DisasterRecoveryUrl' => + $options['disasterRecoveryUrl'], + 'DisasterRecoveryMethod' => + $options['disasterRecoveryMethod'], + 'TransferMode' => + $options['transferMode'], + 'Secure' => + Serialize::booleanToString($options['secure']), + 'CnamLookupEnabled' => + Serialize::booleanToString($options['cnamLookupEnabled']), + 'TransferCallerId' => + $options['transferCallerId'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new TrunkInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the ipAccessControlLists + */ + protected function getIpAccessControlLists(): IpAccessControlListList + { + if (!$this->_ipAccessControlLists) { + $this->_ipAccessControlLists = new IpAccessControlListList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_ipAccessControlLists; + } + + /** + * Access the phoneNumbers + */ + protected function getPhoneNumbers(): PhoneNumberList + { + if (!$this->_phoneNumbers) { + $this->_phoneNumbers = new PhoneNumberList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_phoneNumbers; + } + + /** + * Access the credentialsLists + */ + protected function getCredentialsLists(): CredentialListList + { + if (!$this->_credentialsLists) { + $this->_credentialsLists = new CredentialListList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_credentialsLists; + } + + /** + * Access the originationUrls + */ + protected function getOriginationUrls(): OriginationUrlList + { + if (!$this->_originationUrls) { + $this->_originationUrls = new OriginationUrlList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_originationUrls; + } + + /** + * Access the recordings + */ + protected function getRecordings(): RecordingList + { + if (!$this->_recordings) { + $this->_recordings = new RecordingList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_recordings; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trunking.V1.TrunkContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Trunking/V1/TrunkInstance.php b/app/api/Twilio/Rest/Trunking/V1/TrunkInstance.php new file mode 100755 index 0000000..6d1a84d --- /dev/null +++ b/app/api/Twilio/Rest/Trunking/V1/TrunkInstance.php @@ -0,0 +1,225 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'domainName' => Values::array_get($payload, 'domain_name'), + 'disasterRecoveryMethod' => Values::array_get($payload, 'disaster_recovery_method'), + 'disasterRecoveryUrl' => Values::array_get($payload, 'disaster_recovery_url'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'secure' => Values::array_get($payload, 'secure'), + 'recording' => Values::array_get($payload, 'recording'), + 'transferMode' => Values::array_get($payload, 'transfer_mode'), + 'transferCallerId' => Values::array_get($payload, 'transfer_caller_id'), + 'cnamLookupEnabled' => Values::array_get($payload, 'cnam_lookup_enabled'), + 'authType' => Values::array_get($payload, 'auth_type'), + 'authTypeSet' => Values::array_get($payload, 'auth_type_set'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'sid' => Values::array_get($payload, 'sid'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return TrunkContext Context for this TrunkInstance + */ + protected function proxy(): TrunkContext + { + if (!$this->context) { + $this->context = new TrunkContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the TrunkInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the TrunkInstance + * + * @return TrunkInstance Fetched TrunkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TrunkInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the TrunkInstance + * + * @param array|Options $options Optional Arguments + * @return TrunkInstance Updated TrunkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TrunkInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the ipAccessControlLists + */ + protected function getIpAccessControlLists(): IpAccessControlListList + { + return $this->proxy()->ipAccessControlLists; + } + + /** + * Access the phoneNumbers + */ + protected function getPhoneNumbers(): PhoneNumberList + { + return $this->proxy()->phoneNumbers; + } + + /** + * Access the credentialsLists + */ + protected function getCredentialsLists(): CredentialListList + { + return $this->proxy()->credentialsLists; + } + + /** + * Access the originationUrls + */ + protected function getOriginationUrls(): OriginationUrlList + { + return $this->proxy()->originationUrls; + } + + /** + * Access the recordings + */ + protected function getRecordings(): RecordingList + { + return $this->proxy()->recordings; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trunking.V1.TrunkInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Trunking/V1/TrunkList.php b/app/api/Twilio/Rest/Trunking/V1/TrunkList.php new file mode 100755 index 0000000..957e56c --- /dev/null +++ b/app/api/Twilio/Rest/Trunking/V1/TrunkList.php @@ -0,0 +1,204 @@ +solution = [ + ]; + + $this->uri = '/Trunks'; + } + + /** + * Create the TrunkInstance + * + * @param array|Options $options Optional Arguments + * @return TrunkInstance Created TrunkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): TrunkInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'DomainName' => + $options['domainName'], + 'DisasterRecoveryUrl' => + $options['disasterRecoveryUrl'], + 'DisasterRecoveryMethod' => + $options['disasterRecoveryMethod'], + 'TransferMode' => + $options['transferMode'], + 'Secure' => + Serialize::booleanToString($options['secure']), + 'CnamLookupEnabled' => + Serialize::booleanToString($options['cnamLookupEnabled']), + 'TransferCallerId' => + $options['transferCallerId'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new TrunkInstance( + $this->version, + $payload + ); + } + + + /** + * Reads TrunkInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return TrunkInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams TrunkInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of TrunkInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return TrunkPage Page of TrunkInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): TrunkPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new TrunkPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of TrunkInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return TrunkPage Page of TrunkInstance + */ + public function getPage(string $targetUrl): TrunkPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new TrunkPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a TrunkContext + * + * @param string $sid The unique string that we created to identify the Trunk resource to delete. + */ + public function getContext( + string $sid + + ): TrunkContext + { + return new TrunkContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trunking.V1.TrunkList]'; + } +} diff --git a/app/api/Twilio/Rest/Trunking/V1/TrunkOptions.php b/app/api/Twilio/Rest/Trunking/V1/TrunkOptions.php new file mode 100755 index 0000000..8fe7508 --- /dev/null +++ b/app/api/Twilio/Rest/Trunking/V1/TrunkOptions.php @@ -0,0 +1,378 @@ +options['friendlyName'] = $friendlyName; + $this->options['domainName'] = $domainName; + $this->options['disasterRecoveryUrl'] = $disasterRecoveryUrl; + $this->options['disasterRecoveryMethod'] = $disasterRecoveryMethod; + $this->options['transferMode'] = $transferMode; + $this->options['secure'] = $secure; + $this->options['cnamLookupEnabled'] = $cnamLookupEnabled; + $this->options['transferCallerId'] = $transferCallerId; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and `-` and must end with `pstn.twilio.com`. See [Termination Settings](https://www.twilio.com/docs/sip-trunking#termination) for more information. + * + * @param string $domainName The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and `-` and must end with `pstn.twilio.com`. See [Termination Settings](https://www.twilio.com/docs/sip-trunking#termination) for more information. + * @return $this Fluent Builder + */ + public function setDomainName(string $domainName): self + { + $this->options['domainName'] = $domainName; + return $this; + } + + /** + * The URL we should call using the `disaster_recovery_method` if an error occurs while sending SIP traffic towards the configured Origination URL. We retrieve TwiML from the URL and execute the instructions like any other normal TwiML call. See [Disaster Recovery](https://www.twilio.com/docs/sip-trunking#disaster-recovery) for more information. + * + * @param string $disasterRecoveryUrl The URL we should call using the `disaster_recovery_method` if an error occurs while sending SIP traffic towards the configured Origination URL. We retrieve TwiML from the URL and execute the instructions like any other normal TwiML call. See [Disaster Recovery](https://www.twilio.com/docs/sip-trunking#disaster-recovery) for more information. + * @return $this Fluent Builder + */ + public function setDisasterRecoveryUrl(string $disasterRecoveryUrl): self + { + $this->options['disasterRecoveryUrl'] = $disasterRecoveryUrl; + return $this; + } + + /** + * The HTTP method we should use to call the `disaster_recovery_url`. Can be: `GET` or `POST`. + * + * @param string $disasterRecoveryMethod The HTTP method we should use to call the `disaster_recovery_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setDisasterRecoveryMethod(string $disasterRecoveryMethod): self + { + $this->options['disasterRecoveryMethod'] = $disasterRecoveryMethod; + return $this; + } + + /** + * @param string $transferMode + * @return $this Fluent Builder + */ + public function setTransferMode(string $transferMode): self + { + $this->options['transferMode'] = $transferMode; + return $this; + } + + /** + * Whether Secure Trunking is enabled for the trunk. If enabled, all calls going through the trunk will be secure using SRTP for media and TLS for signaling. If disabled, then RTP will be used for media. See [Secure Trunking](https://www.twilio.com/docs/sip-trunking#securetrunking) for more information. + * + * @param bool $secure Whether Secure Trunking is enabled for the trunk. If enabled, all calls going through the trunk will be secure using SRTP for media and TLS for signaling. If disabled, then RTP will be used for media. See [Secure Trunking](https://www.twilio.com/docs/sip-trunking#securetrunking) for more information. + * @return $this Fluent Builder + */ + public function setSecure(bool $secure): self + { + $this->options['secure'] = $secure; + return $this; + } + + /** + * Whether Caller ID Name (CNAM) lookup should be enabled for the trunk. If enabled, all inbound calls to the SIP Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. + * + * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup should be enabled for the trunk. If enabled, all inbound calls to the SIP Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. + * @return $this Fluent Builder + */ + public function setCnamLookupEnabled(bool $cnamLookupEnabled): self + { + $this->options['cnamLookupEnabled'] = $cnamLookupEnabled; + return $this; + } + + /** + * @param string $transferCallerId + * @return $this Fluent Builder + */ + public function setTransferCallerId(string $transferCallerId): self + { + $this->options['transferCallerId'] = $transferCallerId; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trunking.V1.CreateTrunkOptions ' . $options . ']'; + } +} + + + + +class UpdateTrunkOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @param string $domainName The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and `-` and must end with `pstn.twilio.com`. See [Termination Settings](https://www.twilio.com/docs/sip-trunking#termination) for more information. + * @param string $disasterRecoveryUrl The URL we should call using the `disaster_recovery_method` if an error occurs while sending SIP traffic towards the configured Origination URL. We retrieve TwiML from the URL and execute the instructions like any other normal TwiML call. See [Disaster Recovery](https://www.twilio.com/docs/sip-trunking#disaster-recovery) for more information. + * @param string $disasterRecoveryMethod The HTTP method we should use to call the `disaster_recovery_url`. Can be: `GET` or `POST`. + * @param string $transferMode + * @param bool $secure Whether Secure Trunking is enabled for the trunk. If enabled, all calls going through the trunk will be secure using SRTP for media and TLS for signaling. If disabled, then RTP will be used for media. See [Secure Trunking](https://www.twilio.com/docs/sip-trunking#securetrunking) for more information. + * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup should be enabled for the trunk. If enabled, all inbound calls to the SIP Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. + * @param string $transferCallerId + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $domainName = Values::NONE, + string $disasterRecoveryUrl = Values::NONE, + string $disasterRecoveryMethod = Values::NONE, + string $transferMode = Values::NONE, + bool $secure = Values::BOOL_NONE, + bool $cnamLookupEnabled = Values::BOOL_NONE, + string $transferCallerId = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['domainName'] = $domainName; + $this->options['disasterRecoveryUrl'] = $disasterRecoveryUrl; + $this->options['disasterRecoveryMethod'] = $disasterRecoveryMethod; + $this->options['transferMode'] = $transferMode; + $this->options['secure'] = $secure; + $this->options['cnamLookupEnabled'] = $cnamLookupEnabled; + $this->options['transferCallerId'] = $transferCallerId; + } + + /** + * A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 64 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and `-` and must end with `pstn.twilio.com`. See [Termination Settings](https://www.twilio.com/docs/sip-trunking#termination) for more information. + * + * @param string $domainName The unique address you reserve on Twilio to which you route your SIP traffic. Domain names can contain letters, digits, and `-` and must end with `pstn.twilio.com`. See [Termination Settings](https://www.twilio.com/docs/sip-trunking#termination) for more information. + * @return $this Fluent Builder + */ + public function setDomainName(string $domainName): self + { + $this->options['domainName'] = $domainName; + return $this; + } + + /** + * The URL we should call using the `disaster_recovery_method` if an error occurs while sending SIP traffic towards the configured Origination URL. We retrieve TwiML from the URL and execute the instructions like any other normal TwiML call. See [Disaster Recovery](https://www.twilio.com/docs/sip-trunking#disaster-recovery) for more information. + * + * @param string $disasterRecoveryUrl The URL we should call using the `disaster_recovery_method` if an error occurs while sending SIP traffic towards the configured Origination URL. We retrieve TwiML from the URL and execute the instructions like any other normal TwiML call. See [Disaster Recovery](https://www.twilio.com/docs/sip-trunking#disaster-recovery) for more information. + * @return $this Fluent Builder + */ + public function setDisasterRecoveryUrl(string $disasterRecoveryUrl): self + { + $this->options['disasterRecoveryUrl'] = $disasterRecoveryUrl; + return $this; + } + + /** + * The HTTP method we should use to call the `disaster_recovery_url`. Can be: `GET` or `POST`. + * + * @param string $disasterRecoveryMethod The HTTP method we should use to call the `disaster_recovery_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setDisasterRecoveryMethod(string $disasterRecoveryMethod): self + { + $this->options['disasterRecoveryMethod'] = $disasterRecoveryMethod; + return $this; + } + + /** + * @param string $transferMode + * @return $this Fluent Builder + */ + public function setTransferMode(string $transferMode): self + { + $this->options['transferMode'] = $transferMode; + return $this; + } + + /** + * Whether Secure Trunking is enabled for the trunk. If enabled, all calls going through the trunk will be secure using SRTP for media and TLS for signaling. If disabled, then RTP will be used for media. See [Secure Trunking](https://www.twilio.com/docs/sip-trunking#securetrunking) for more information. + * + * @param bool $secure Whether Secure Trunking is enabled for the trunk. If enabled, all calls going through the trunk will be secure using SRTP for media and TLS for signaling. If disabled, then RTP will be used for media. See [Secure Trunking](https://www.twilio.com/docs/sip-trunking#securetrunking) for more information. + * @return $this Fluent Builder + */ + public function setSecure(bool $secure): self + { + $this->options['secure'] = $secure; + return $this; + } + + /** + * Whether Caller ID Name (CNAM) lookup should be enabled for the trunk. If enabled, all inbound calls to the SIP Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. + * + * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup should be enabled for the trunk. If enabled, all inbound calls to the SIP Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. + * @return $this Fluent Builder + */ + public function setCnamLookupEnabled(bool $cnamLookupEnabled): self + { + $this->options['cnamLookupEnabled'] = $cnamLookupEnabled; + return $this; + } + + /** + * @param string $transferCallerId + * @return $this Fluent Builder + */ + public function setTransferCallerId(string $transferCallerId): self + { + $this->options['transferCallerId'] = $transferCallerId; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trunking.V1.UpdateTrunkOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Trunking/V1/TrunkPage.php b/app/api/Twilio/Rest/Trunking/V1/TrunkPage.php new file mode 100755 index 0000000..f343093 --- /dev/null +++ b/app/api/Twilio/Rest/Trunking/V1/TrunkPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TrunkInstance \Twilio\Rest\Trunking\V1\TrunkInstance + */ + public function buildInstance(array $payload): TrunkInstance + { + return new TrunkInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trunking.V1.TrunkPage]'; + } +} diff --git a/app/api/Twilio/Rest/TrunkingBase.php b/app/api/Twilio/Rest/TrunkingBase.php new file mode 100755 index 0000000..4e259ef --- /dev/null +++ b/app/api/Twilio/Rest/TrunkingBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://trunking.twilio.com'; + } + + + /** + * @return V1 Version v1 of trunking + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Trunking]'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub.php b/app/api/Twilio/Rest/Trusthub.php new file mode 100755 index 0000000..9adab5b --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub.php @@ -0,0 +1,128 @@ +customerProfiles instead. + */ + protected function getCustomerProfiles(): \Twilio\Rest\Trusthub\V1\CustomerProfilesList { + echo "customerProfiles is deprecated. Use v1->customerProfiles instead."; + return $this->v1->customerProfiles; + } + + /** + * @deprecated Use v1->customerProfiles(\$sid) instead. + * @param string $sid The unique string that identifies the resource. + */ + protected function contextCustomerProfiles(string $sid): \Twilio\Rest\Trusthub\V1\CustomerProfilesContext { + echo "customerProfiles(\$sid) is deprecated. Use v1->customerProfiles(\$sid) instead."; + return $this->v1->customerProfiles($sid); + } + + /** + * @deprecated Use v1->endUsers instead. + */ + protected function getEndUsers(): \Twilio\Rest\Trusthub\V1\EndUserList { + echo "endUsers is deprecated. Use v1->endUsers instead."; + return $this->v1->endUsers; + } + + /** + * @deprecated Use v1->endUsers(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextEndUsers(string $sid): \Twilio\Rest\Trusthub\V1\EndUserContext { + echo "endUsers(\$sid) is deprecated. Use v1->endUsers(\$sid) instead."; + return $this->v1->endUsers($sid); + } + + /** + * @deprecated Use v1->endUserTypes instead. + */ + protected function getEndUserTypes(): \Twilio\Rest\Trusthub\V1\EndUserTypeList { + echo "endUserTypes is deprecated. Use v1->endUserTypes instead."; + return $this->v1->endUserTypes; + } + + /** + * @deprecated Use v1->endUserTypes(\$sid) instead. + * @param string $sid The unique string that identifies the End-User Type + * resource + */ + protected function contextEndUserTypes(string $sid): \Twilio\Rest\Trusthub\V1\EndUserTypeContext { + echo "endUserTypes(\$sid) is deprecated. Use v1->endUserTypes(\$sid) instead."; + return $this->v1->endUserTypes($sid); + } + + /** + * @deprecated Use v1->policies instead. + */ + protected function getPolicies(): \Twilio\Rest\Trusthub\V1\PoliciesList { + echo "policies is deprecated. Use v1->policies instead."; + return $this->v1->policies; + } + + /** + * @deprecated Use v1->policies(\$sid) instead. + * @param string $sid The unique string that identifies the Policy resource + */ + protected function contextPolicies(string $sid): \Twilio\Rest\Trusthub\V1\PoliciesContext { + echo "policies(\$sid) is deprecated. Use v1->policies(\$sid) instead."; + return $this->v1->policies($sid); + } + + /** + * @deprecated Use v1->supportingDocuments instead. + */ + protected function getSupportingDocuments(): \Twilio\Rest\Trusthub\V1\SupportingDocumentList { + echo "supportingDocuments is deprecated. Use v1->supportingDocuments instead."; + return $this->v1->supportingDocuments; + } + + /** + * @deprecated Use v1->supportingDocuments(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextSupportingDocuments(string $sid): \Twilio\Rest\Trusthub\V1\SupportingDocumentContext { + echo "supportingDocuments(\$sid) is deprecated. Use v1->supportingDocuments(\$sid) instead."; + return $this->v1->supportingDocuments($sid); + } + + /** + * @deprecated Use v1->supportingDocumentTypes instead. + */ + protected function getSupportingDocumentTypes(): \Twilio\Rest\Trusthub\V1\SupportingDocumentTypeList { + echo "supportingDocumentTypes is deprecated. Use v1->supportingDocumentTypes instead."; + return $this->v1->supportingDocumentTypes; + } + + /** + * @deprecated Use v1->supportingDocumentTypes(\$sid) instead. + * @param string $sid The unique string that identifies the Supporting Document + * Type resource + */ + protected function contextSupportingDocumentTypes(string $sid): \Twilio\Rest\Trusthub\V1\SupportingDocumentTypeContext { + echo "supportingDocumentTypes(\$sid) is deprecated. Use v1->supportingDocumentTypes(\$sid) instead."; + return $this->v1->supportingDocumentTypes($sid); + } + + /** + * @deprecated Use v1->trustProducts instead. + */ + protected function getTrustProducts(): \Twilio\Rest\Trusthub\V1\TrustProductsList { + echo "trustProducts is deprecated. Use v1->trustProducts instead."; + return $this->v1->trustProducts; + } + + /** + * @deprecated Use v1->trustProducts(\$sid) instead. + * @param string $sid The unique string that identifies the resource. + */ + protected function contextTrustProducts(string $sid): \Twilio\Rest\Trusthub\V1\TrustProductsContext { + echo "trustProducts(\$sid) is deprecated. Use v1->trustProducts(\$sid) instead."; + return $this->v1->trustProducts($sid); + } +} \ No newline at end of file diff --git a/app/api/Twilio/Rest/Trusthub/V1.php b/app/api/Twilio/Rest/Trusthub/V1.php new file mode 100755 index 0000000..cc57aac --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1.php @@ -0,0 +1,167 @@ +version = 'v1'; + } + + protected function getCustomerProfiles(): CustomerProfilesList + { + if (!$this->_customerProfiles) { + $this->_customerProfiles = new CustomerProfilesList($this); + } + return $this->_customerProfiles; + } + + protected function getEndUsers(): EndUserList + { + if (!$this->_endUsers) { + $this->_endUsers = new EndUserList($this); + } + return $this->_endUsers; + } + + protected function getEndUserTypes(): EndUserTypeList + { + if (!$this->_endUserTypes) { + $this->_endUserTypes = new EndUserTypeList($this); + } + return $this->_endUserTypes; + } + + protected function getPolicies(): PoliciesList + { + if (!$this->_policies) { + $this->_policies = new PoliciesList($this); + } + return $this->_policies; + } + + protected function getSupportingDocuments(): SupportingDocumentList + { + if (!$this->_supportingDocuments) { + $this->_supportingDocuments = new SupportingDocumentList($this); + } + return $this->_supportingDocuments; + } + + protected function getSupportingDocumentTypes(): SupportingDocumentTypeList + { + if (!$this->_supportingDocumentTypes) { + $this->_supportingDocumentTypes = new SupportingDocumentTypeList($this); + } + return $this->_supportingDocumentTypes; + } + + protected function getTrustProducts(): TrustProductsList + { + if (!$this->_trustProducts) { + $this->_trustProducts = new TrustProductsList($this); + } + return $this->_trustProducts; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1]'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentContext.php b/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentContext.php new file mode 100755 index 0000000..a2e95bf --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentContext.php @@ -0,0 +1,100 @@ +solution = [ + 'customerProfileSid' => + $customerProfileSid, + 'sid' => + $sid, + ]; + + $this->uri = '/CustomerProfiles/' . \rawurlencode($customerProfileSid) + .'/ChannelEndpointAssignments/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the CustomerProfilesChannelEndpointAssignmentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the CustomerProfilesChannelEndpointAssignmentInstance + * + * @return CustomerProfilesChannelEndpointAssignmentInstance Fetched CustomerProfilesChannelEndpointAssignmentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CustomerProfilesChannelEndpointAssignmentInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new CustomerProfilesChannelEndpointAssignmentInstance( + $this->version, + $payload, + $this->solution['customerProfileSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.CustomerProfilesChannelEndpointAssignmentContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentInstance.php b/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentInstance.php new file mode 100755 index 0000000..33f9efb --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentInstance.php @@ -0,0 +1,142 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'customerProfileSid' => Values::array_get($payload, 'customer_profile_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'channelEndpointType' => Values::array_get($payload, 'channel_endpoint_type'), + 'channelEndpointSid' => Values::array_get($payload, 'channel_endpoint_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['customerProfileSid' => $customerProfileSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CustomerProfilesChannelEndpointAssignmentContext Context for this CustomerProfilesChannelEndpointAssignmentInstance + */ + protected function proxy(): CustomerProfilesChannelEndpointAssignmentContext + { + if (!$this->context) { + $this->context = new CustomerProfilesChannelEndpointAssignmentContext( + $this->version, + $this->solution['customerProfileSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the CustomerProfilesChannelEndpointAssignmentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the CustomerProfilesChannelEndpointAssignmentInstance + * + * @return CustomerProfilesChannelEndpointAssignmentInstance Fetched CustomerProfilesChannelEndpointAssignmentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CustomerProfilesChannelEndpointAssignmentInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.CustomerProfilesChannelEndpointAssignmentInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentList.php b/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentList.php new file mode 100755 index 0000000..f0ebe52 --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentList.php @@ -0,0 +1,206 @@ +solution = [ + 'customerProfileSid' => + $customerProfileSid, + + ]; + + $this->uri = '/CustomerProfiles/' . \rawurlencode($customerProfileSid) + .'/ChannelEndpointAssignments'; + } + + /** + * Create the CustomerProfilesChannelEndpointAssignmentInstance + * + * @param string $channelEndpointType The type of channel endpoint. eg: phone-number + * @param string $channelEndpointSid The SID of an channel endpoint + * @return CustomerProfilesChannelEndpointAssignmentInstance Created CustomerProfilesChannelEndpointAssignmentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $channelEndpointType, string $channelEndpointSid): CustomerProfilesChannelEndpointAssignmentInstance + { + + $data = Values::of([ + 'ChannelEndpointType' => + $channelEndpointType, + 'ChannelEndpointSid' => + $channelEndpointSid, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new CustomerProfilesChannelEndpointAssignmentInstance( + $this->version, + $payload, + $this->solution['customerProfileSid'] + ); + } + + + /** + * Reads CustomerProfilesChannelEndpointAssignmentInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return CustomerProfilesChannelEndpointAssignmentInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams CustomerProfilesChannelEndpointAssignmentInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CustomerProfilesChannelEndpointAssignmentInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return CustomerProfilesChannelEndpointAssignmentPage Page of CustomerProfilesChannelEndpointAssignmentInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CustomerProfilesChannelEndpointAssignmentPage + { + $options = new Values($options); + + $params = Values::of([ + 'ChannelEndpointSid' => + $options['channelEndpointSid'], + 'ChannelEndpointSids' => + $options['channelEndpointSids'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new CustomerProfilesChannelEndpointAssignmentPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of CustomerProfilesChannelEndpointAssignmentInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return CustomerProfilesChannelEndpointAssignmentPage Page of CustomerProfilesChannelEndpointAssignmentInstance + */ + public function getPage(string $targetUrl): CustomerProfilesChannelEndpointAssignmentPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CustomerProfilesChannelEndpointAssignmentPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CustomerProfilesChannelEndpointAssignmentContext + * + * @param string $sid The unique string that we created to identify the resource. + */ + public function getContext( + string $sid + + ): CustomerProfilesChannelEndpointAssignmentContext + { + return new CustomerProfilesChannelEndpointAssignmentContext( + $this->version, + $this->solution['customerProfileSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.CustomerProfilesChannelEndpointAssignmentList]'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentOptions.php b/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentOptions.php new file mode 100755 index 0000000..62a5ab6 --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentOptions.php @@ -0,0 +1,100 @@ +options['channelEndpointSid'] = $channelEndpointSid; + $this->options['channelEndpointSids'] = $channelEndpointSids; + } + + /** + * The SID of an channel endpoint + * + * @param string $channelEndpointSid The SID of an channel endpoint + * @return $this Fluent Builder + */ + public function setChannelEndpointSid(string $channelEndpointSid): self + { + $this->options['channelEndpointSid'] = $channelEndpointSid; + return $this; + } + + /** + * comma separated list of channel endpoint sids + * + * @param string $channelEndpointSids comma separated list of channel endpoint sids + * @return $this Fluent Builder + */ + public function setChannelEndpointSids(string $channelEndpointSids): self + { + $this->options['channelEndpointSids'] = $channelEndpointSids; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trusthub.V1.ReadCustomerProfilesChannelEndpointAssignmentOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentPage.php b/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentPage.php new file mode 100755 index 0000000..e199b3f --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesChannelEndpointAssignmentPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CustomerProfilesChannelEndpointAssignmentInstance \Twilio\Rest\Trusthub\V1\CustomerProfiles\CustomerProfilesChannelEndpointAssignmentInstance + */ + public function buildInstance(array $payload): CustomerProfilesChannelEndpointAssignmentInstance + { + return new CustomerProfilesChannelEndpointAssignmentInstance($this->version, $payload, $this->solution['customerProfileSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.CustomerProfilesChannelEndpointAssignmentPage]'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsContext.php b/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsContext.php new file mode 100755 index 0000000..71521fd --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsContext.php @@ -0,0 +1,100 @@ +solution = [ + 'customerProfileSid' => + $customerProfileSid, + 'sid' => + $sid, + ]; + + $this->uri = '/CustomerProfiles/' . \rawurlencode($customerProfileSid) + .'/EntityAssignments/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the CustomerProfilesEntityAssignmentsInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the CustomerProfilesEntityAssignmentsInstance + * + * @return CustomerProfilesEntityAssignmentsInstance Fetched CustomerProfilesEntityAssignmentsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CustomerProfilesEntityAssignmentsInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new CustomerProfilesEntityAssignmentsInstance( + $this->version, + $payload, + $this->solution['customerProfileSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.CustomerProfilesEntityAssignmentsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsInstance.php b/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsInstance.php new file mode 100755 index 0000000..a230c31 --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsInstance.php @@ -0,0 +1,140 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'customerProfileSid' => Values::array_get($payload, 'customer_profile_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'objectSid' => Values::array_get($payload, 'object_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['customerProfileSid' => $customerProfileSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CustomerProfilesEntityAssignmentsContext Context for this CustomerProfilesEntityAssignmentsInstance + */ + protected function proxy(): CustomerProfilesEntityAssignmentsContext + { + if (!$this->context) { + $this->context = new CustomerProfilesEntityAssignmentsContext( + $this->version, + $this->solution['customerProfileSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the CustomerProfilesEntityAssignmentsInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the CustomerProfilesEntityAssignmentsInstance + * + * @return CustomerProfilesEntityAssignmentsInstance Fetched CustomerProfilesEntityAssignmentsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CustomerProfilesEntityAssignmentsInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.CustomerProfilesEntityAssignmentsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsList.php b/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsList.php new file mode 100755 index 0000000..5db647c --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsList.php @@ -0,0 +1,194 @@ +solution = [ + 'customerProfileSid' => + $customerProfileSid, + + ]; + + $this->uri = '/CustomerProfiles/' . \rawurlencode($customerProfileSid) + .'/EntityAssignments'; + } + + /** + * Create the CustomerProfilesEntityAssignmentsInstance + * + * @param string $objectSid The SID of an object bag that holds information of the different items. + * @return CustomerProfilesEntityAssignmentsInstance Created CustomerProfilesEntityAssignmentsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $objectSid): CustomerProfilesEntityAssignmentsInstance + { + + $data = Values::of([ + 'ObjectSid' => + $objectSid, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new CustomerProfilesEntityAssignmentsInstance( + $this->version, + $payload, + $this->solution['customerProfileSid'] + ); + } + + + /** + * Reads CustomerProfilesEntityAssignmentsInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return CustomerProfilesEntityAssignmentsInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams CustomerProfilesEntityAssignmentsInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CustomerProfilesEntityAssignmentsInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return CustomerProfilesEntityAssignmentsPage Page of CustomerProfilesEntityAssignmentsInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CustomerProfilesEntityAssignmentsPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new CustomerProfilesEntityAssignmentsPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of CustomerProfilesEntityAssignmentsInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return CustomerProfilesEntityAssignmentsPage Page of CustomerProfilesEntityAssignmentsInstance + */ + public function getPage(string $targetUrl): CustomerProfilesEntityAssignmentsPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CustomerProfilesEntityAssignmentsPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CustomerProfilesEntityAssignmentsContext + * + * @param string $sid The unique string that we created to identify the Identity resource. + */ + public function getContext( + string $sid + + ): CustomerProfilesEntityAssignmentsContext + { + return new CustomerProfilesEntityAssignmentsContext( + $this->version, + $this->solution['customerProfileSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.CustomerProfilesEntityAssignmentsList]'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsPage.php b/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsPage.php new file mode 100755 index 0000000..2dddad5 --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEntityAssignmentsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CustomerProfilesEntityAssignmentsInstance \Twilio\Rest\Trusthub\V1\CustomerProfiles\CustomerProfilesEntityAssignmentsInstance + */ + public function buildInstance(array $payload): CustomerProfilesEntityAssignmentsInstance + { + return new CustomerProfilesEntityAssignmentsInstance($this->version, $payload, $this->solution['customerProfileSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.CustomerProfilesEntityAssignmentsPage]'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEvaluationsContext.php b/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEvaluationsContext.php new file mode 100755 index 0000000..cb91172 --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEvaluationsContext.php @@ -0,0 +1,87 @@ +solution = [ + 'customerProfileSid' => + $customerProfileSid, + 'sid' => + $sid, + ]; + + $this->uri = '/CustomerProfiles/' . \rawurlencode($customerProfileSid) + .'/Evaluations/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the CustomerProfilesEvaluationsInstance + * + * @return CustomerProfilesEvaluationsInstance Fetched CustomerProfilesEvaluationsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CustomerProfilesEvaluationsInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new CustomerProfilesEvaluationsInstance( + $this->version, + $payload, + $this->solution['customerProfileSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.CustomerProfilesEvaluationsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEvaluationsInstance.php b/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEvaluationsInstance.php new file mode 100755 index 0000000..8023460 --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEvaluationsInstance.php @@ -0,0 +1,132 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'policySid' => Values::array_get($payload, 'policy_sid'), + 'customerProfileSid' => Values::array_get($payload, 'customer_profile_sid'), + 'status' => Values::array_get($payload, 'status'), + 'results' => Values::array_get($payload, 'results'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['customerProfileSid' => $customerProfileSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CustomerProfilesEvaluationsContext Context for this CustomerProfilesEvaluationsInstance + */ + protected function proxy(): CustomerProfilesEvaluationsContext + { + if (!$this->context) { + $this->context = new CustomerProfilesEvaluationsContext( + $this->version, + $this->solution['customerProfileSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the CustomerProfilesEvaluationsInstance + * + * @return CustomerProfilesEvaluationsInstance Fetched CustomerProfilesEvaluationsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CustomerProfilesEvaluationsInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.CustomerProfilesEvaluationsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEvaluationsList.php b/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEvaluationsList.php new file mode 100755 index 0000000..9f4837e --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEvaluationsList.php @@ -0,0 +1,194 @@ +solution = [ + 'customerProfileSid' => + $customerProfileSid, + + ]; + + $this->uri = '/CustomerProfiles/' . \rawurlencode($customerProfileSid) + .'/Evaluations'; + } + + /** + * Create the CustomerProfilesEvaluationsInstance + * + * @param string $policySid The unique string of a policy that is associated to the customer_profile resource. + * @return CustomerProfilesEvaluationsInstance Created CustomerProfilesEvaluationsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $policySid): CustomerProfilesEvaluationsInstance + { + + $data = Values::of([ + 'PolicySid' => + $policySid, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new CustomerProfilesEvaluationsInstance( + $this->version, + $payload, + $this->solution['customerProfileSid'] + ); + } + + + /** + * Reads CustomerProfilesEvaluationsInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return CustomerProfilesEvaluationsInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams CustomerProfilesEvaluationsInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CustomerProfilesEvaluationsInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return CustomerProfilesEvaluationsPage Page of CustomerProfilesEvaluationsInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CustomerProfilesEvaluationsPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new CustomerProfilesEvaluationsPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of CustomerProfilesEvaluationsInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return CustomerProfilesEvaluationsPage Page of CustomerProfilesEvaluationsInstance + */ + public function getPage(string $targetUrl): CustomerProfilesEvaluationsPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CustomerProfilesEvaluationsPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CustomerProfilesEvaluationsContext + * + * @param string $sid The unique string that identifies the Evaluation resource. + */ + public function getContext( + string $sid + + ): CustomerProfilesEvaluationsContext + { + return new CustomerProfilesEvaluationsContext( + $this->version, + $this->solution['customerProfileSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.CustomerProfilesEvaluationsList]'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEvaluationsPage.php b/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEvaluationsPage.php new file mode 100755 index 0000000..aabef1a --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/CustomerProfiles/CustomerProfilesEvaluationsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CustomerProfilesEvaluationsInstance \Twilio\Rest\Trusthub\V1\CustomerProfiles\CustomerProfilesEvaluationsInstance + */ + public function buildInstance(array $payload): CustomerProfilesEvaluationsInstance + { + return new CustomerProfilesEvaluationsInstance($this->version, $payload, $this->solution['customerProfileSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.CustomerProfilesEvaluationsPage]'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/CustomerProfilesContext.php b/app/api/Twilio/Rest/Trusthub/V1/CustomerProfilesContext.php new file mode 100755 index 0000000..28e4cfb --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/CustomerProfilesContext.php @@ -0,0 +1,225 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/CustomerProfiles/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the CustomerProfilesInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the CustomerProfilesInstance + * + * @return CustomerProfilesInstance Fetched CustomerProfilesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CustomerProfilesInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new CustomerProfilesInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the CustomerProfilesInstance + * + * @param array|Options $options Optional Arguments + * @return CustomerProfilesInstance Updated CustomerProfilesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CustomerProfilesInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Status' => + $options['status'], + 'StatusCallback' => + $options['statusCallback'], + 'FriendlyName' => + $options['friendlyName'], + 'Email' => + $options['email'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new CustomerProfilesInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the customerProfilesChannelEndpointAssignment + */ + protected function getCustomerProfilesChannelEndpointAssignment(): CustomerProfilesChannelEndpointAssignmentList + { + if (!$this->_customerProfilesChannelEndpointAssignment) { + $this->_customerProfilesChannelEndpointAssignment = new CustomerProfilesChannelEndpointAssignmentList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_customerProfilesChannelEndpointAssignment; + } + + /** + * Access the customerProfilesEntityAssignments + */ + protected function getCustomerProfilesEntityAssignments(): CustomerProfilesEntityAssignmentsList + { + if (!$this->_customerProfilesEntityAssignments) { + $this->_customerProfilesEntityAssignments = new CustomerProfilesEntityAssignmentsList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_customerProfilesEntityAssignments; + } + + /** + * Access the customerProfilesEvaluations + */ + protected function getCustomerProfilesEvaluations(): CustomerProfilesEvaluationsList + { + if (!$this->_customerProfilesEvaluations) { + $this->_customerProfilesEvaluations = new CustomerProfilesEvaluationsList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_customerProfilesEvaluations; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.CustomerProfilesContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/CustomerProfilesInstance.php b/app/api/Twilio/Rest/Trusthub/V1/CustomerProfilesInstance.php new file mode 100755 index 0000000..d41e21a --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/CustomerProfilesInstance.php @@ -0,0 +1,195 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'policySid' => Values::array_get($payload, 'policy_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'status' => Values::array_get($payload, 'status'), + 'validUntil' => Deserialize::dateTime(Values::array_get($payload, 'valid_until')), + 'email' => Values::array_get($payload, 'email'), + 'statusCallback' => Values::array_get($payload, 'status_callback'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CustomerProfilesContext Context for this CustomerProfilesInstance + */ + protected function proxy(): CustomerProfilesContext + { + if (!$this->context) { + $this->context = new CustomerProfilesContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the CustomerProfilesInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the CustomerProfilesInstance + * + * @return CustomerProfilesInstance Fetched CustomerProfilesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CustomerProfilesInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the CustomerProfilesInstance + * + * @param array|Options $options Optional Arguments + * @return CustomerProfilesInstance Updated CustomerProfilesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): CustomerProfilesInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the customerProfilesChannelEndpointAssignment + */ + protected function getCustomerProfilesChannelEndpointAssignment(): CustomerProfilesChannelEndpointAssignmentList + { + return $this->proxy()->customerProfilesChannelEndpointAssignment; + } + + /** + * Access the customerProfilesEntityAssignments + */ + protected function getCustomerProfilesEntityAssignments(): CustomerProfilesEntityAssignmentsList + { + return $this->proxy()->customerProfilesEntityAssignments; + } + + /** + * Access the customerProfilesEvaluations + */ + protected function getCustomerProfilesEvaluations(): CustomerProfilesEvaluationsList + { + return $this->proxy()->customerProfilesEvaluations; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.CustomerProfilesInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Trusthub/V1/CustomerProfilesList.php b/app/api/Twilio/Rest/Trusthub/V1/CustomerProfilesList.php new file mode 100755 index 0000000..f48991a --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/CustomerProfilesList.php @@ -0,0 +1,208 @@ +solution = [ + ]; + + $this->uri = '/CustomerProfiles'; + } + + /** + * Create the CustomerProfilesInstance + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @param string $email The email address that will receive updates when the Customer-Profile resource changes status. + * @param string $policySid The unique string of a policy that is associated to the Customer-Profile resource. + * @param array|Options $options Optional Arguments + * @return CustomerProfilesInstance Created CustomerProfilesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $email, string $policySid, array $options = []): CustomerProfilesInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Email' => + $email, + 'PolicySid' => + $policySid, + 'StatusCallback' => + $options['statusCallback'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new CustomerProfilesInstance( + $this->version, + $payload + ); + } + + + /** + * Reads CustomerProfilesInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return CustomerProfilesInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams CustomerProfilesInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CustomerProfilesInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return CustomerProfilesPage Page of CustomerProfilesInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CustomerProfilesPage + { + $options = new Values($options); + + $params = Values::of([ + 'Status' => + $options['status'], + 'FriendlyName' => + $options['friendlyName'], + 'PolicySid' => + $options['policySid'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new CustomerProfilesPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of CustomerProfilesInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return CustomerProfilesPage Page of CustomerProfilesInstance + */ + public function getPage(string $targetUrl): CustomerProfilesPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CustomerProfilesPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CustomerProfilesContext + * + * @param string $sid The unique string that we created to identify the Customer-Profile resource. + */ + public function getContext( + string $sid + + ): CustomerProfilesContext + { + return new CustomerProfilesContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.CustomerProfilesList]'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/CustomerProfilesOptions.php b/app/api/Twilio/Rest/Trusthub/V1/CustomerProfilesOptions.php new file mode 100755 index 0000000..cf2af60 --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/CustomerProfilesOptions.php @@ -0,0 +1,272 @@ +options['statusCallback'] = $statusCallback; + } + + /** + * The URL we call to inform your application of status changes. + * + * @param string $statusCallback The URL we call to inform your application of status changes. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trusthub.V1.CreateCustomerProfilesOptions ' . $options . ']'; + } +} + + + +class ReadCustomerProfilesOptions extends Options + { + /** + * @param string $status The verification status of the Customer-Profile resource. + * @param string $friendlyName The string that you assigned to describe the resource. + * @param string $policySid The unique string of a policy that is associated to the Customer-Profile resource. + */ + public function __construct( + + string $status = Values::NONE, + string $friendlyName = Values::NONE, + string $policySid = Values::NONE + + ) { + $this->options['status'] = $status; + $this->options['friendlyName'] = $friendlyName; + $this->options['policySid'] = $policySid; + } + + /** + * The verification status of the Customer-Profile resource. + * + * @param string $status The verification status of the Customer-Profile resource. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * The string that you assigned to describe the resource. + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The unique string of a policy that is associated to the Customer-Profile resource. + * + * @param string $policySid The unique string of a policy that is associated to the Customer-Profile resource. + * @return $this Fluent Builder + */ + public function setPolicySid(string $policySid): self + { + $this->options['policySid'] = $policySid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trusthub.V1.ReadCustomerProfilesOptions ' . $options . ']'; + } +} + +class UpdateCustomerProfilesOptions extends Options + { + /** + * @param string $status + * @param string $statusCallback The URL we call to inform your application of status changes. + * @param string $friendlyName The string that you assigned to describe the resource. + * @param string $email The email address that will receive updates when the Customer-Profile resource changes status. + */ + public function __construct( + + string $status = Values::NONE, + string $statusCallback = Values::NONE, + string $friendlyName = Values::NONE, + string $email = Values::NONE + + ) { + $this->options['status'] = $status; + $this->options['statusCallback'] = $statusCallback; + $this->options['friendlyName'] = $friendlyName; + $this->options['email'] = $email; + } + + /** + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * The URL we call to inform your application of status changes. + * + * @param string $statusCallback The URL we call to inform your application of status changes. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The string that you assigned to describe the resource. + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The email address that will receive updates when the Customer-Profile resource changes status. + * + * @param string $email The email address that will receive updates when the Customer-Profile resource changes status. + * @return $this Fluent Builder + */ + public function setEmail(string $email): self + { + $this->options['email'] = $email; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trusthub.V1.UpdateCustomerProfilesOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Trusthub/V1/CustomerProfilesPage.php b/app/api/Twilio/Rest/Trusthub/V1/CustomerProfilesPage.php new file mode 100755 index 0000000..d336304 --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/CustomerProfilesPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CustomerProfilesInstance \Twilio\Rest\Trusthub\V1\CustomerProfilesInstance + */ + public function buildInstance(array $payload): CustomerProfilesInstance + { + return new CustomerProfilesInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.CustomerProfilesPage]'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/EndUserContext.php b/app/api/Twilio/Rest/Trusthub/V1/EndUserContext.php new file mode 100755 index 0000000..d14a476 --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/EndUserContext.php @@ -0,0 +1,126 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/EndUsers/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the EndUserInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the EndUserInstance + * + * @return EndUserInstance Fetched EndUserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EndUserInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new EndUserInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the EndUserInstance + * + * @param array|Options $options Optional Arguments + * @return EndUserInstance Updated EndUserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): EndUserInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'Attributes' => + Serialize::jsonObject($options['attributes']), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new EndUserInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.EndUserContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/EndUserInstance.php b/app/api/Twilio/Rest/Trusthub/V1/EndUserInstance.php new file mode 100755 index 0000000..19dda03 --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/EndUserInstance.php @@ -0,0 +1,156 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'type' => Values::array_get($payload, 'type'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return EndUserContext Context for this EndUserInstance + */ + protected function proxy(): EndUserContext + { + if (!$this->context) { + $this->context = new EndUserContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the EndUserInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the EndUserInstance + * + * @return EndUserInstance Fetched EndUserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EndUserInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the EndUserInstance + * + * @param array|Options $options Optional Arguments + * @return EndUserInstance Updated EndUserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): EndUserInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.EndUserInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Trusthub/V1/EndUserList.php b/app/api/Twilio/Rest/Trusthub/V1/EndUserList.php new file mode 100755 index 0000000..61fc1b1 --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/EndUserList.php @@ -0,0 +1,196 @@ +solution = [ + ]; + + $this->uri = '/EndUsers'; + } + + /** + * Create the EndUserInstance + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @param string $type The type of end user of the Bundle resource - can be `individual` or `business`. + * @param array|Options $options Optional Arguments + * @return EndUserInstance Created EndUserInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $type, array $options = []): EndUserInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Type' => + $type, + 'Attributes' => + Serialize::jsonObject($options['attributes']), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new EndUserInstance( + $this->version, + $payload + ); + } + + + /** + * Reads EndUserInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return EndUserInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams EndUserInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of EndUserInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return EndUserPage Page of EndUserInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): EndUserPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new EndUserPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of EndUserInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return EndUserPage Page of EndUserInstance + */ + public function getPage(string $targetUrl): EndUserPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new EndUserPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a EndUserContext + * + * @param string $sid The unique string created by Twilio to identify the End User resource. + */ + public function getContext( + string $sid + + ): EndUserContext + { + return new EndUserContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.EndUserList]'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/EndUserOptions.php b/app/api/Twilio/Rest/Trusthub/V1/EndUserOptions.php new file mode 100755 index 0000000..c6b6df0 --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/EndUserOptions.php @@ -0,0 +1,152 @@ +options['attributes'] = $attributes; + } + + /** + * The set of parameters that are the attributes of the End User resource which are derived End User Types. + * + * @param array $attributes The set of parameters that are the attributes of the End User resource which are derived End User Types. + * @return $this Fluent Builder + */ + public function setAttributes(array $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trusthub.V1.CreateEndUserOptions ' . $options . ']'; + } +} + + + + +class UpdateEndUserOptions extends Options + { + /** + * @param string $friendlyName The string that you assigned to describe the resource. + * @param array $attributes The set of parameters that are the attributes of the End User resource which are derived End User Types. + */ + public function __construct( + + string $friendlyName = Values::NONE, + array $attributes = Values::ARRAY_NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['attributes'] = $attributes; + } + + /** + * The string that you assigned to describe the resource. + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The set of parameters that are the attributes of the End User resource which are derived End User Types. + * + * @param array $attributes The set of parameters that are the attributes of the End User resource which are derived End User Types. + * @return $this Fluent Builder + */ + public function setAttributes(array $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trusthub.V1.UpdateEndUserOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Trusthub/V1/EndUserPage.php b/app/api/Twilio/Rest/Trusthub/V1/EndUserPage.php new file mode 100755 index 0000000..46cbe04 --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/EndUserPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return EndUserInstance \Twilio\Rest\Trusthub\V1\EndUserInstance + */ + public function buildInstance(array $payload): EndUserInstance + { + return new EndUserInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.EndUserPage]'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/EndUserTypeContext.php b/app/api/Twilio/Rest/Trusthub/V1/EndUserTypeContext.php new file mode 100755 index 0000000..f3676c2 --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/EndUserTypeContext.php @@ -0,0 +1,81 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/EndUserTypes/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the EndUserTypeInstance + * + * @return EndUserTypeInstance Fetched EndUserTypeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EndUserTypeInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new EndUserTypeInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.EndUserTypeContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/EndUserTypeInstance.php b/app/api/Twilio/Rest/Trusthub/V1/EndUserTypeInstance.php new file mode 100755 index 0000000..8dbc24e --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/EndUserTypeInstance.php @@ -0,0 +1,123 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'machineName' => Values::array_get($payload, 'machine_name'), + 'fields' => Values::array_get($payload, 'fields'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return EndUserTypeContext Context for this EndUserTypeInstance + */ + protected function proxy(): EndUserTypeContext + { + if (!$this->context) { + $this->context = new EndUserTypeContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the EndUserTypeInstance + * + * @return EndUserTypeInstance Fetched EndUserTypeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EndUserTypeInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.EndUserTypeInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Trusthub/V1/EndUserTypeList.php b/app/api/Twilio/Rest/Trusthub/V1/EndUserTypeList.php new file mode 100755 index 0000000..1a49b4e --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/EndUserTypeList.php @@ -0,0 +1,161 @@ +solution = [ + ]; + + $this->uri = '/EndUserTypes'; + } + + /** + * Reads EndUserTypeInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return EndUserTypeInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams EndUserTypeInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of EndUserTypeInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return EndUserTypePage Page of EndUserTypeInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): EndUserTypePage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new EndUserTypePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of EndUserTypeInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return EndUserTypePage Page of EndUserTypeInstance + */ + public function getPage(string $targetUrl): EndUserTypePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new EndUserTypePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a EndUserTypeContext + * + * @param string $sid The unique string that identifies the End-User Type resource. + */ + public function getContext( + string $sid + + ): EndUserTypeContext + { + return new EndUserTypeContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.EndUserTypeList]'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/EndUserTypePage.php b/app/api/Twilio/Rest/Trusthub/V1/EndUserTypePage.php new file mode 100755 index 0000000..31fd609 --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/EndUserTypePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return EndUserTypeInstance \Twilio\Rest\Trusthub\V1\EndUserTypeInstance + */ + public function buildInstance(array $payload): EndUserTypeInstance + { + return new EndUserTypeInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.EndUserTypePage]'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/PoliciesContext.php b/app/api/Twilio/Rest/Trusthub/V1/PoliciesContext.php new file mode 100755 index 0000000..09a024e --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/PoliciesContext.php @@ -0,0 +1,81 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Policies/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the PoliciesInstance + * + * @return PoliciesInstance Fetched PoliciesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PoliciesInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new PoliciesInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.PoliciesContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/PoliciesInstance.php b/app/api/Twilio/Rest/Trusthub/V1/PoliciesInstance.php new file mode 100755 index 0000000..40794dc --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/PoliciesInstance.php @@ -0,0 +1,121 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'requirements' => Values::array_get($payload, 'requirements'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return PoliciesContext Context for this PoliciesInstance + */ + protected function proxy(): PoliciesContext + { + if (!$this->context) { + $this->context = new PoliciesContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the PoliciesInstance + * + * @return PoliciesInstance Fetched PoliciesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PoliciesInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.PoliciesInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Trusthub/V1/PoliciesList.php b/app/api/Twilio/Rest/Trusthub/V1/PoliciesList.php new file mode 100755 index 0000000..d573eeb --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/PoliciesList.php @@ -0,0 +1,161 @@ +solution = [ + ]; + + $this->uri = '/Policies'; + } + + /** + * Reads PoliciesInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return PoliciesInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams PoliciesInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of PoliciesInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return PoliciesPage Page of PoliciesInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): PoliciesPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new PoliciesPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of PoliciesInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return PoliciesPage Page of PoliciesInstance + */ + public function getPage(string $targetUrl): PoliciesPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new PoliciesPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a PoliciesContext + * + * @param string $sid The unique string that identifies the Policy resource. + */ + public function getContext( + string $sid + + ): PoliciesContext + { + return new PoliciesContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.PoliciesList]'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/PoliciesPage.php b/app/api/Twilio/Rest/Trusthub/V1/PoliciesPage.php new file mode 100755 index 0000000..04274a7 --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/PoliciesPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PoliciesInstance \Twilio\Rest\Trusthub\V1\PoliciesInstance + */ + public function buildInstance(array $payload): PoliciesInstance + { + return new PoliciesInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.PoliciesPage]'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/SupportingDocumentContext.php b/app/api/Twilio/Rest/Trusthub/V1/SupportingDocumentContext.php new file mode 100755 index 0000000..9e6a9ff --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/SupportingDocumentContext.php @@ -0,0 +1,126 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/SupportingDocuments/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the SupportingDocumentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the SupportingDocumentInstance + * + * @return SupportingDocumentInstance Fetched SupportingDocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SupportingDocumentInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new SupportingDocumentInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the SupportingDocumentInstance + * + * @param array|Options $options Optional Arguments + * @return SupportingDocumentInstance Updated SupportingDocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SupportingDocumentInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'Attributes' => + Serialize::jsonObject($options['attributes']), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new SupportingDocumentInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.SupportingDocumentContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/SupportingDocumentInstance.php b/app/api/Twilio/Rest/Trusthub/V1/SupportingDocumentInstance.php new file mode 100755 index 0000000..c62cd27 --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/SupportingDocumentInstance.php @@ -0,0 +1,160 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'mimeType' => Values::array_get($payload, 'mime_type'), + 'status' => Values::array_get($payload, 'status'), + 'type' => Values::array_get($payload, 'type'), + 'attributes' => Values::array_get($payload, 'attributes'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SupportingDocumentContext Context for this SupportingDocumentInstance + */ + protected function proxy(): SupportingDocumentContext + { + if (!$this->context) { + $this->context = new SupportingDocumentContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the SupportingDocumentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SupportingDocumentInstance + * + * @return SupportingDocumentInstance Fetched SupportingDocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SupportingDocumentInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SupportingDocumentInstance + * + * @param array|Options $options Optional Arguments + * @return SupportingDocumentInstance Updated SupportingDocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SupportingDocumentInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.SupportingDocumentInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Trusthub/V1/SupportingDocumentList.php b/app/api/Twilio/Rest/Trusthub/V1/SupportingDocumentList.php new file mode 100755 index 0000000..305ed07 --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/SupportingDocumentList.php @@ -0,0 +1,196 @@ +solution = [ + ]; + + $this->uri = '/SupportingDocuments'; + } + + /** + * Create the SupportingDocumentInstance + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @param string $type The type of the Supporting Document. + * @param array|Options $options Optional Arguments + * @return SupportingDocumentInstance Created SupportingDocumentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $type, array $options = []): SupportingDocumentInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Type' => + $type, + 'Attributes' => + Serialize::jsonObject($options['attributes']), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new SupportingDocumentInstance( + $this->version, + $payload + ); + } + + + /** + * Reads SupportingDocumentInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return SupportingDocumentInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams SupportingDocumentInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SupportingDocumentInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return SupportingDocumentPage Page of SupportingDocumentInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SupportingDocumentPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SupportingDocumentPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SupportingDocumentInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SupportingDocumentPage Page of SupportingDocumentInstance + */ + public function getPage(string $targetUrl): SupportingDocumentPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SupportingDocumentPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SupportingDocumentContext + * + * @param string $sid The unique string created by Twilio to identify the Supporting Document resource. + */ + public function getContext( + string $sid + + ): SupportingDocumentContext + { + return new SupportingDocumentContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.SupportingDocumentList]'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/SupportingDocumentOptions.php b/app/api/Twilio/Rest/Trusthub/V1/SupportingDocumentOptions.php new file mode 100755 index 0000000..e0e55db --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/SupportingDocumentOptions.php @@ -0,0 +1,152 @@ +options['attributes'] = $attributes; + } + + /** + * The set of parameters that are the attributes of the Supporting Documents resource which are derived Supporting Document Types. + * + * @param array $attributes The set of parameters that are the attributes of the Supporting Documents resource which are derived Supporting Document Types. + * @return $this Fluent Builder + */ + public function setAttributes(array $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trusthub.V1.CreateSupportingDocumentOptions ' . $options . ']'; + } +} + + + + +class UpdateSupportingDocumentOptions extends Options + { + /** + * @param string $friendlyName The string that you assigned to describe the resource. + * @param array $attributes The set of parameters that are the attributes of the Supporting Document resource which are derived Supporting Document Types. + */ + public function __construct( + + string $friendlyName = Values::NONE, + array $attributes = Values::ARRAY_NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['attributes'] = $attributes; + } + + /** + * The string that you assigned to describe the resource. + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The set of parameters that are the attributes of the Supporting Document resource which are derived Supporting Document Types. + * + * @param array $attributes The set of parameters that are the attributes of the Supporting Document resource which are derived Supporting Document Types. + * @return $this Fluent Builder + */ + public function setAttributes(array $attributes): self + { + $this->options['attributes'] = $attributes; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trusthub.V1.UpdateSupportingDocumentOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Trusthub/V1/SupportingDocumentPage.php b/app/api/Twilio/Rest/Trusthub/V1/SupportingDocumentPage.php new file mode 100755 index 0000000..11a6299 --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/SupportingDocumentPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SupportingDocumentInstance \Twilio\Rest\Trusthub\V1\SupportingDocumentInstance + */ + public function buildInstance(array $payload): SupportingDocumentInstance + { + return new SupportingDocumentInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.SupportingDocumentPage]'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/SupportingDocumentTypeContext.php b/app/api/Twilio/Rest/Trusthub/V1/SupportingDocumentTypeContext.php new file mode 100755 index 0000000..09b3dec --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/SupportingDocumentTypeContext.php @@ -0,0 +1,81 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/SupportingDocumentTypes/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the SupportingDocumentTypeInstance + * + * @return SupportingDocumentTypeInstance Fetched SupportingDocumentTypeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SupportingDocumentTypeInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new SupportingDocumentTypeInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.SupportingDocumentTypeContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/SupportingDocumentTypeInstance.php b/app/api/Twilio/Rest/Trusthub/V1/SupportingDocumentTypeInstance.php new file mode 100755 index 0000000..f2cc00a --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/SupportingDocumentTypeInstance.php @@ -0,0 +1,123 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'machineName' => Values::array_get($payload, 'machine_name'), + 'fields' => Values::array_get($payload, 'fields'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SupportingDocumentTypeContext Context for this SupportingDocumentTypeInstance + */ + protected function proxy(): SupportingDocumentTypeContext + { + if (!$this->context) { + $this->context = new SupportingDocumentTypeContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the SupportingDocumentTypeInstance + * + * @return SupportingDocumentTypeInstance Fetched SupportingDocumentTypeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SupportingDocumentTypeInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.SupportingDocumentTypeInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Trusthub/V1/SupportingDocumentTypeList.php b/app/api/Twilio/Rest/Trusthub/V1/SupportingDocumentTypeList.php new file mode 100755 index 0000000..2655a2a --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/SupportingDocumentTypeList.php @@ -0,0 +1,161 @@ +solution = [ + ]; + + $this->uri = '/SupportingDocumentTypes'; + } + + /** + * Reads SupportingDocumentTypeInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return SupportingDocumentTypeInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams SupportingDocumentTypeInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SupportingDocumentTypeInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return SupportingDocumentTypePage Page of SupportingDocumentTypeInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SupportingDocumentTypePage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SupportingDocumentTypePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SupportingDocumentTypeInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SupportingDocumentTypePage Page of SupportingDocumentTypeInstance + */ + public function getPage(string $targetUrl): SupportingDocumentTypePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SupportingDocumentTypePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SupportingDocumentTypeContext + * + * @param string $sid The unique string that identifies the Supporting Document Type resource. + */ + public function getContext( + string $sid + + ): SupportingDocumentTypeContext + { + return new SupportingDocumentTypeContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.SupportingDocumentTypeList]'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/SupportingDocumentTypePage.php b/app/api/Twilio/Rest/Trusthub/V1/SupportingDocumentTypePage.php new file mode 100755 index 0000000..34bcdde --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/SupportingDocumentTypePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SupportingDocumentTypeInstance \Twilio\Rest\Trusthub\V1\SupportingDocumentTypeInstance + */ + public function buildInstance(array $payload): SupportingDocumentTypeInstance + { + return new SupportingDocumentTypeInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.SupportingDocumentTypePage]'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentContext.php b/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentContext.php new file mode 100755 index 0000000..53071de --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentContext.php @@ -0,0 +1,100 @@ +solution = [ + 'trustProductSid' => + $trustProductSid, + 'sid' => + $sid, + ]; + + $this->uri = '/TrustProducts/' . \rawurlencode($trustProductSid) + .'/ChannelEndpointAssignments/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the TrustProductsChannelEndpointAssignmentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the TrustProductsChannelEndpointAssignmentInstance + * + * @return TrustProductsChannelEndpointAssignmentInstance Fetched TrustProductsChannelEndpointAssignmentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TrustProductsChannelEndpointAssignmentInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new TrustProductsChannelEndpointAssignmentInstance( + $this->version, + $payload, + $this->solution['trustProductSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.TrustProductsChannelEndpointAssignmentContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentInstance.php b/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentInstance.php new file mode 100755 index 0000000..4431355 --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentInstance.php @@ -0,0 +1,142 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'trustProductSid' => Values::array_get($payload, 'trust_product_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'channelEndpointType' => Values::array_get($payload, 'channel_endpoint_type'), + 'channelEndpointSid' => Values::array_get($payload, 'channel_endpoint_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['trustProductSid' => $trustProductSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return TrustProductsChannelEndpointAssignmentContext Context for this TrustProductsChannelEndpointAssignmentInstance + */ + protected function proxy(): TrustProductsChannelEndpointAssignmentContext + { + if (!$this->context) { + $this->context = new TrustProductsChannelEndpointAssignmentContext( + $this->version, + $this->solution['trustProductSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the TrustProductsChannelEndpointAssignmentInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the TrustProductsChannelEndpointAssignmentInstance + * + * @return TrustProductsChannelEndpointAssignmentInstance Fetched TrustProductsChannelEndpointAssignmentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TrustProductsChannelEndpointAssignmentInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.TrustProductsChannelEndpointAssignmentInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentList.php b/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentList.php new file mode 100755 index 0000000..11f99b0 --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentList.php @@ -0,0 +1,206 @@ +solution = [ + 'trustProductSid' => + $trustProductSid, + + ]; + + $this->uri = '/TrustProducts/' . \rawurlencode($trustProductSid) + .'/ChannelEndpointAssignments'; + } + + /** + * Create the TrustProductsChannelEndpointAssignmentInstance + * + * @param string $channelEndpointType The type of channel endpoint. eg: phone-number + * @param string $channelEndpointSid The SID of an channel endpoint + * @return TrustProductsChannelEndpointAssignmentInstance Created TrustProductsChannelEndpointAssignmentInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $channelEndpointType, string $channelEndpointSid): TrustProductsChannelEndpointAssignmentInstance + { + + $data = Values::of([ + 'ChannelEndpointType' => + $channelEndpointType, + 'ChannelEndpointSid' => + $channelEndpointSid, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new TrustProductsChannelEndpointAssignmentInstance( + $this->version, + $payload, + $this->solution['trustProductSid'] + ); + } + + + /** + * Reads TrustProductsChannelEndpointAssignmentInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return TrustProductsChannelEndpointAssignmentInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams TrustProductsChannelEndpointAssignmentInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of TrustProductsChannelEndpointAssignmentInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return TrustProductsChannelEndpointAssignmentPage Page of TrustProductsChannelEndpointAssignmentInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): TrustProductsChannelEndpointAssignmentPage + { + $options = new Values($options); + + $params = Values::of([ + 'ChannelEndpointSid' => + $options['channelEndpointSid'], + 'ChannelEndpointSids' => + $options['channelEndpointSids'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new TrustProductsChannelEndpointAssignmentPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of TrustProductsChannelEndpointAssignmentInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return TrustProductsChannelEndpointAssignmentPage Page of TrustProductsChannelEndpointAssignmentInstance + */ + public function getPage(string $targetUrl): TrustProductsChannelEndpointAssignmentPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new TrustProductsChannelEndpointAssignmentPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a TrustProductsChannelEndpointAssignmentContext + * + * @param string $sid The unique string that we created to identify the resource. + */ + public function getContext( + string $sid + + ): TrustProductsChannelEndpointAssignmentContext + { + return new TrustProductsChannelEndpointAssignmentContext( + $this->version, + $this->solution['trustProductSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.TrustProductsChannelEndpointAssignmentList]'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentOptions.php b/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentOptions.php new file mode 100755 index 0000000..6dd2dbe --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentOptions.php @@ -0,0 +1,100 @@ +options['channelEndpointSid'] = $channelEndpointSid; + $this->options['channelEndpointSids'] = $channelEndpointSids; + } + + /** + * The SID of an channel endpoint + * + * @param string $channelEndpointSid The SID of an channel endpoint + * @return $this Fluent Builder + */ + public function setChannelEndpointSid(string $channelEndpointSid): self + { + $this->options['channelEndpointSid'] = $channelEndpointSid; + return $this; + } + + /** + * comma separated list of channel endpoint sids + * + * @param string $channelEndpointSids comma separated list of channel endpoint sids + * @return $this Fluent Builder + */ + public function setChannelEndpointSids(string $channelEndpointSids): self + { + $this->options['channelEndpointSids'] = $channelEndpointSids; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trusthub.V1.ReadTrustProductsChannelEndpointAssignmentOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentPage.php b/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentPage.php new file mode 100755 index 0000000..3255334 --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsChannelEndpointAssignmentPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TrustProductsChannelEndpointAssignmentInstance \Twilio\Rest\Trusthub\V1\TrustProducts\TrustProductsChannelEndpointAssignmentInstance + */ + public function buildInstance(array $payload): TrustProductsChannelEndpointAssignmentInstance + { + return new TrustProductsChannelEndpointAssignmentInstance($this->version, $payload, $this->solution['trustProductSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.TrustProductsChannelEndpointAssignmentPage]'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsContext.php b/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsContext.php new file mode 100755 index 0000000..bc5f0c9 --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsContext.php @@ -0,0 +1,100 @@ +solution = [ + 'trustProductSid' => + $trustProductSid, + 'sid' => + $sid, + ]; + + $this->uri = '/TrustProducts/' . \rawurlencode($trustProductSid) + .'/EntityAssignments/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the TrustProductsEntityAssignmentsInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the TrustProductsEntityAssignmentsInstance + * + * @return TrustProductsEntityAssignmentsInstance Fetched TrustProductsEntityAssignmentsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TrustProductsEntityAssignmentsInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new TrustProductsEntityAssignmentsInstance( + $this->version, + $payload, + $this->solution['trustProductSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.TrustProductsEntityAssignmentsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsInstance.php b/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsInstance.php new file mode 100755 index 0000000..1f86e6b --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsInstance.php @@ -0,0 +1,140 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'trustProductSid' => Values::array_get($payload, 'trust_product_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'objectSid' => Values::array_get($payload, 'object_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['trustProductSid' => $trustProductSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return TrustProductsEntityAssignmentsContext Context for this TrustProductsEntityAssignmentsInstance + */ + protected function proxy(): TrustProductsEntityAssignmentsContext + { + if (!$this->context) { + $this->context = new TrustProductsEntityAssignmentsContext( + $this->version, + $this->solution['trustProductSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the TrustProductsEntityAssignmentsInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the TrustProductsEntityAssignmentsInstance + * + * @return TrustProductsEntityAssignmentsInstance Fetched TrustProductsEntityAssignmentsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TrustProductsEntityAssignmentsInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.TrustProductsEntityAssignmentsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsList.php b/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsList.php new file mode 100755 index 0000000..abf5c1e --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsList.php @@ -0,0 +1,194 @@ +solution = [ + 'trustProductSid' => + $trustProductSid, + + ]; + + $this->uri = '/TrustProducts/' . \rawurlencode($trustProductSid) + .'/EntityAssignments'; + } + + /** + * Create the TrustProductsEntityAssignmentsInstance + * + * @param string $objectSid The SID of an object bag that holds information of the different items. + * @return TrustProductsEntityAssignmentsInstance Created TrustProductsEntityAssignmentsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $objectSid): TrustProductsEntityAssignmentsInstance + { + + $data = Values::of([ + 'ObjectSid' => + $objectSid, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new TrustProductsEntityAssignmentsInstance( + $this->version, + $payload, + $this->solution['trustProductSid'] + ); + } + + + /** + * Reads TrustProductsEntityAssignmentsInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return TrustProductsEntityAssignmentsInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams TrustProductsEntityAssignmentsInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of TrustProductsEntityAssignmentsInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return TrustProductsEntityAssignmentsPage Page of TrustProductsEntityAssignmentsInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): TrustProductsEntityAssignmentsPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new TrustProductsEntityAssignmentsPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of TrustProductsEntityAssignmentsInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return TrustProductsEntityAssignmentsPage Page of TrustProductsEntityAssignmentsInstance + */ + public function getPage(string $targetUrl): TrustProductsEntityAssignmentsPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new TrustProductsEntityAssignmentsPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a TrustProductsEntityAssignmentsContext + * + * @param string $sid The unique string that we created to identify the Identity resource. + */ + public function getContext( + string $sid + + ): TrustProductsEntityAssignmentsContext + { + return new TrustProductsEntityAssignmentsContext( + $this->version, + $this->solution['trustProductSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.TrustProductsEntityAssignmentsList]'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsPage.php b/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsPage.php new file mode 100755 index 0000000..516ae3b --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEntityAssignmentsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TrustProductsEntityAssignmentsInstance \Twilio\Rest\Trusthub\V1\TrustProducts\TrustProductsEntityAssignmentsInstance + */ + public function buildInstance(array $payload): TrustProductsEntityAssignmentsInstance + { + return new TrustProductsEntityAssignmentsInstance($this->version, $payload, $this->solution['trustProductSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.TrustProductsEntityAssignmentsPage]'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEvaluationsContext.php b/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEvaluationsContext.php new file mode 100755 index 0000000..36f763c --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEvaluationsContext.php @@ -0,0 +1,87 @@ +solution = [ + 'trustProductSid' => + $trustProductSid, + 'sid' => + $sid, + ]; + + $this->uri = '/TrustProducts/' . \rawurlencode($trustProductSid) + .'/Evaluations/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the TrustProductsEvaluationsInstance + * + * @return TrustProductsEvaluationsInstance Fetched TrustProductsEvaluationsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TrustProductsEvaluationsInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new TrustProductsEvaluationsInstance( + $this->version, + $payload, + $this->solution['trustProductSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.TrustProductsEvaluationsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEvaluationsInstance.php b/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEvaluationsInstance.php new file mode 100755 index 0000000..e9d45dd --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEvaluationsInstance.php @@ -0,0 +1,132 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'policySid' => Values::array_get($payload, 'policy_sid'), + 'trustProductSid' => Values::array_get($payload, 'trust_product_sid'), + 'status' => Values::array_get($payload, 'status'), + 'results' => Values::array_get($payload, 'results'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['trustProductSid' => $trustProductSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return TrustProductsEvaluationsContext Context for this TrustProductsEvaluationsInstance + */ + protected function proxy(): TrustProductsEvaluationsContext + { + if (!$this->context) { + $this->context = new TrustProductsEvaluationsContext( + $this->version, + $this->solution['trustProductSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the TrustProductsEvaluationsInstance + * + * @return TrustProductsEvaluationsInstance Fetched TrustProductsEvaluationsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TrustProductsEvaluationsInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.TrustProductsEvaluationsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEvaluationsList.php b/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEvaluationsList.php new file mode 100755 index 0000000..47d86a1 --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEvaluationsList.php @@ -0,0 +1,194 @@ +solution = [ + 'trustProductSid' => + $trustProductSid, + + ]; + + $this->uri = '/TrustProducts/' . \rawurlencode($trustProductSid) + .'/Evaluations'; + } + + /** + * Create the TrustProductsEvaluationsInstance + * + * @param string $policySid The unique string of a policy that is associated to the customer_profile resource. + * @return TrustProductsEvaluationsInstance Created TrustProductsEvaluationsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $policySid): TrustProductsEvaluationsInstance + { + + $data = Values::of([ + 'PolicySid' => + $policySid, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new TrustProductsEvaluationsInstance( + $this->version, + $payload, + $this->solution['trustProductSid'] + ); + } + + + /** + * Reads TrustProductsEvaluationsInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return TrustProductsEvaluationsInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams TrustProductsEvaluationsInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of TrustProductsEvaluationsInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return TrustProductsEvaluationsPage Page of TrustProductsEvaluationsInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): TrustProductsEvaluationsPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new TrustProductsEvaluationsPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of TrustProductsEvaluationsInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return TrustProductsEvaluationsPage Page of TrustProductsEvaluationsInstance + */ + public function getPage(string $targetUrl): TrustProductsEvaluationsPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new TrustProductsEvaluationsPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a TrustProductsEvaluationsContext + * + * @param string $sid The unique string that identifies the Evaluation resource. + */ + public function getContext( + string $sid + + ): TrustProductsEvaluationsContext + { + return new TrustProductsEvaluationsContext( + $this->version, + $this->solution['trustProductSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.TrustProductsEvaluationsList]'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEvaluationsPage.php b/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEvaluationsPage.php new file mode 100755 index 0000000..66a8c15 --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/TrustProducts/TrustProductsEvaluationsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TrustProductsEvaluationsInstance \Twilio\Rest\Trusthub\V1\TrustProducts\TrustProductsEvaluationsInstance + */ + public function buildInstance(array $payload): TrustProductsEvaluationsInstance + { + return new TrustProductsEvaluationsInstance($this->version, $payload, $this->solution['trustProductSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.TrustProductsEvaluationsPage]'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/TrustProductsContext.php b/app/api/Twilio/Rest/Trusthub/V1/TrustProductsContext.php new file mode 100755 index 0000000..f345fda --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/TrustProductsContext.php @@ -0,0 +1,225 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/TrustProducts/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the TrustProductsInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the TrustProductsInstance + * + * @return TrustProductsInstance Fetched TrustProductsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TrustProductsInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new TrustProductsInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the TrustProductsInstance + * + * @param array|Options $options Optional Arguments + * @return TrustProductsInstance Updated TrustProductsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TrustProductsInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Status' => + $options['status'], + 'StatusCallback' => + $options['statusCallback'], + 'FriendlyName' => + $options['friendlyName'], + 'Email' => + $options['email'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new TrustProductsInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the trustProductsChannelEndpointAssignment + */ + protected function getTrustProductsChannelEndpointAssignment(): TrustProductsChannelEndpointAssignmentList + { + if (!$this->_trustProductsChannelEndpointAssignment) { + $this->_trustProductsChannelEndpointAssignment = new TrustProductsChannelEndpointAssignmentList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_trustProductsChannelEndpointAssignment; + } + + /** + * Access the trustProductsEvaluations + */ + protected function getTrustProductsEvaluations(): TrustProductsEvaluationsList + { + if (!$this->_trustProductsEvaluations) { + $this->_trustProductsEvaluations = new TrustProductsEvaluationsList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_trustProductsEvaluations; + } + + /** + * Access the trustProductsEntityAssignments + */ + protected function getTrustProductsEntityAssignments(): TrustProductsEntityAssignmentsList + { + if (!$this->_trustProductsEntityAssignments) { + $this->_trustProductsEntityAssignments = new TrustProductsEntityAssignmentsList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_trustProductsEntityAssignments; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.TrustProductsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/TrustProductsInstance.php b/app/api/Twilio/Rest/Trusthub/V1/TrustProductsInstance.php new file mode 100755 index 0000000..245928f --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/TrustProductsInstance.php @@ -0,0 +1,195 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'policySid' => Values::array_get($payload, 'policy_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'status' => Values::array_get($payload, 'status'), + 'validUntil' => Deserialize::dateTime(Values::array_get($payload, 'valid_until')), + 'email' => Values::array_get($payload, 'email'), + 'statusCallback' => Values::array_get($payload, 'status_callback'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return TrustProductsContext Context for this TrustProductsInstance + */ + protected function proxy(): TrustProductsContext + { + if (!$this->context) { + $this->context = new TrustProductsContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the TrustProductsInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the TrustProductsInstance + * + * @return TrustProductsInstance Fetched TrustProductsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): TrustProductsInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the TrustProductsInstance + * + * @param array|Options $options Optional Arguments + * @return TrustProductsInstance Updated TrustProductsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): TrustProductsInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the trustProductsChannelEndpointAssignment + */ + protected function getTrustProductsChannelEndpointAssignment(): TrustProductsChannelEndpointAssignmentList + { + return $this->proxy()->trustProductsChannelEndpointAssignment; + } + + /** + * Access the trustProductsEvaluations + */ + protected function getTrustProductsEvaluations(): TrustProductsEvaluationsList + { + return $this->proxy()->trustProductsEvaluations; + } + + /** + * Access the trustProductsEntityAssignments + */ + protected function getTrustProductsEntityAssignments(): TrustProductsEntityAssignmentsList + { + return $this->proxy()->trustProductsEntityAssignments; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Trusthub.V1.TrustProductsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Trusthub/V1/TrustProductsList.php b/app/api/Twilio/Rest/Trusthub/V1/TrustProductsList.php new file mode 100755 index 0000000..84e7b94 --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/TrustProductsList.php @@ -0,0 +1,208 @@ +solution = [ + ]; + + $this->uri = '/TrustProducts'; + } + + /** + * Create the TrustProductsInstance + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @param string $email The email address that will receive updates when the Customer-Profile resource changes status. + * @param string $policySid The unique string of a policy that is associated to the Customer-Profile resource. + * @param array|Options $options Optional Arguments + * @return TrustProductsInstance Created TrustProductsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $email, string $policySid, array $options = []): TrustProductsInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Email' => + $email, + 'PolicySid' => + $policySid, + 'StatusCallback' => + $options['statusCallback'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new TrustProductsInstance( + $this->version, + $payload + ); + } + + + /** + * Reads TrustProductsInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return TrustProductsInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams TrustProductsInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of TrustProductsInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return TrustProductsPage Page of TrustProductsInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): TrustProductsPage + { + $options = new Values($options); + + $params = Values::of([ + 'Status' => + $options['status'], + 'FriendlyName' => + $options['friendlyName'], + 'PolicySid' => + $options['policySid'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new TrustProductsPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of TrustProductsInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return TrustProductsPage Page of TrustProductsInstance + */ + public function getPage(string $targetUrl): TrustProductsPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new TrustProductsPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a TrustProductsContext + * + * @param string $sid The unique string that we created to identify the Customer-Profile resource. + */ + public function getContext( + string $sid + + ): TrustProductsContext + { + return new TrustProductsContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.TrustProductsList]'; + } +} diff --git a/app/api/Twilio/Rest/Trusthub/V1/TrustProductsOptions.php b/app/api/Twilio/Rest/Trusthub/V1/TrustProductsOptions.php new file mode 100755 index 0000000..beb8025 --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/TrustProductsOptions.php @@ -0,0 +1,272 @@ +options['statusCallback'] = $statusCallback; + } + + /** + * The URL we call to inform your application of status changes. + * + * @param string $statusCallback The URL we call to inform your application of status changes. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trusthub.V1.CreateTrustProductsOptions ' . $options . ']'; + } +} + + + +class ReadTrustProductsOptions extends Options + { + /** + * @param string $status The verification status of the Customer-Profile resource. + * @param string $friendlyName The string that you assigned to describe the resource. + * @param string $policySid The unique string of a policy that is associated to the Customer-Profile resource. + */ + public function __construct( + + string $status = Values::NONE, + string $friendlyName = Values::NONE, + string $policySid = Values::NONE + + ) { + $this->options['status'] = $status; + $this->options['friendlyName'] = $friendlyName; + $this->options['policySid'] = $policySid; + } + + /** + * The verification status of the Customer-Profile resource. + * + * @param string $status The verification status of the Customer-Profile resource. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * The string that you assigned to describe the resource. + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The unique string of a policy that is associated to the Customer-Profile resource. + * + * @param string $policySid The unique string of a policy that is associated to the Customer-Profile resource. + * @return $this Fluent Builder + */ + public function setPolicySid(string $policySid): self + { + $this->options['policySid'] = $policySid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trusthub.V1.ReadTrustProductsOptions ' . $options . ']'; + } +} + +class UpdateTrustProductsOptions extends Options + { + /** + * @param string $status + * @param string $statusCallback The URL we call to inform your application of status changes. + * @param string $friendlyName The string that you assigned to describe the resource. + * @param string $email The email address that will receive updates when the Customer-Profile resource changes status. + */ + public function __construct( + + string $status = Values::NONE, + string $statusCallback = Values::NONE, + string $friendlyName = Values::NONE, + string $email = Values::NONE + + ) { + $this->options['status'] = $status; + $this->options['statusCallback'] = $statusCallback; + $this->options['friendlyName'] = $friendlyName; + $this->options['email'] = $email; + } + + /** + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * The URL we call to inform your application of status changes. + * + * @param string $statusCallback The URL we call to inform your application of status changes. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The string that you assigned to describe the resource. + * + * @param string $friendlyName The string that you assigned to describe the resource. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The email address that will receive updates when the Customer-Profile resource changes status. + * + * @param string $email The email address that will receive updates when the Customer-Profile resource changes status. + * @return $this Fluent Builder + */ + public function setEmail(string $email): self + { + $this->options['email'] = $email; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Trusthub.V1.UpdateTrustProductsOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Trusthub/V1/TrustProductsPage.php b/app/api/Twilio/Rest/Trusthub/V1/TrustProductsPage.php new file mode 100755 index 0000000..9ad4bf4 --- /dev/null +++ b/app/api/Twilio/Rest/Trusthub/V1/TrustProductsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TrustProductsInstance \Twilio\Rest\Trusthub\V1\TrustProductsInstance + */ + public function buildInstance(array $payload): TrustProductsInstance + { + return new TrustProductsInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Trusthub.V1.TrustProductsPage]'; + } +} diff --git a/app/api/Twilio/Rest/TrusthubBase.php b/app/api/Twilio/Rest/TrusthubBase.php new file mode 100755 index 0000000..9cf35d3 --- /dev/null +++ b/app/api/Twilio/Rest/TrusthubBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://trusthub.twilio.com'; + } + + + /** + * @return V1 Version v1 of trusthub + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Trusthub]'; + } +} diff --git a/app/api/Twilio/Rest/Verify.php b/app/api/Twilio/Rest/Verify.php new file mode 100755 index 0000000..40ee9c0 --- /dev/null +++ b/app/api/Twilio/Rest/Verify.php @@ -0,0 +1,99 @@ +forms instead. + */ + protected function getForms(): \Twilio\Rest\Verify\V2\FormList { + echo "forms is deprecated. Use v2->forms instead."; + return $this->v2->forms; + } + + /** + * @deprecated Use v2->forms(\$formType) instead. + * @param string $formType The Type of this Form + */ + protected function contextForms(string $formType): \Twilio\Rest\Verify\V2\FormContext { + echo "forms(\$formType) is deprecated. Use v2->forms(\$formType) instead."; + return $this->v2->forms($formType); + } + + /** + * @deprecated Use v2->safelist instead. + */ + protected function getSafelist(): \Twilio\Rest\Verify\V2\SafelistList { + echo "safelist is deprecated. Use v2->safelist instead."; + return $this->v2->safelist; + } + + /** + * @deprecated Use v2->safelist(\$phoneNumber) instead. + * @param string $phoneNumber The phone number to be fetched from SafeList. + */ + protected function contextSafelist(string $phoneNumber): \Twilio\Rest\Verify\V2\SafelistContext { + echo "safelist(\$phoneNumber) is deprecated. Use v2->safelist(\$phoneNumber) instead."; + return $this->v2->safelist($phoneNumber); + } + + /** + * @deprecated Use v2->services instead. + */ + protected function getServices(): \Twilio\Rest\Verify\V2\ServiceList { + echo "services is deprecated. Use v2->services instead."; + return $this->v2->services; + } + + /** + * @deprecated Use v2->services(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextServices(string $sid): \Twilio\Rest\Verify\V2\ServiceContext { + echo "services(\$sid) is deprecated. Use v2->services(\$sid) instead."; + return $this->v2->services($sid); + } + + /** + * @deprecated Use v2->verificationAttempts instead. + */ + protected function getVerificationAttempts(): \Twilio\Rest\Verify\V2\VerificationAttemptList { + echo "verificationAttempts is deprecated. Use v2->verificationAttempts instead."; + return $this->v2->verificationAttempts; + } + + /** + * @deprecated Use v2->verificationAttempts(\$sid) instead. + * @param string $sid Verification Attempt Sid. + */ + protected function contextVerificationAttempts(string $sid): \Twilio\Rest\Verify\V2\VerificationAttemptContext { + echo "verificationAttempts(\$sid) is deprecated. Use v2->verificationAttempts(\$sid) instead."; + return $this->v2->verificationAttempts($sid); + } + + /** + * @deprecated Use v2->verificationAttemptsSummary instead. + */ + protected function getVerificationAttemptsSummary(): \Twilio\Rest\Verify\V2\VerificationAttemptsSummaryList { + echo "verificationAttemptsSummary is deprecated. Use v2->verificationAttemptsSummary instead."; + return $this->v2->verificationAttemptsSummary; + } + + /** + * @deprecated Use v2->verificationAttemptsSummary() instead. + */ + protected function contextVerificationAttemptsSummary(): \Twilio\Rest\Verify\V2\VerificationAttemptsSummaryContext { + echo "verificationAttemptsSummary() is deprecated. Use v2->verificationAttemptsSummary() instead."; + return $this->v2->verificationAttemptsSummary(); + } + + /** + * @deprecated Use v2->templates instead. + */ + protected function getTemplates(): \Twilio\Rest\Verify\V2\TemplateList { + echo "templates is deprecated. Use v2->templates instead."; + return $this->v2->templates; + } +} \ No newline at end of file diff --git a/app/api/Twilio/Rest/Verify/V2.php b/app/api/Twilio/Rest/Verify/V2.php new file mode 100755 index 0000000..38087b3 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2.php @@ -0,0 +1,153 @@ +version = 'v2'; + } + + protected function getForms(): FormList + { + if (!$this->_forms) { + $this->_forms = new FormList($this); + } + return $this->_forms; + } + + protected function getSafelist(): SafelistList + { + if (!$this->_safelist) { + $this->_safelist = new SafelistList($this); + } + return $this->_safelist; + } + + protected function getServices(): ServiceList + { + if (!$this->_services) { + $this->_services = new ServiceList($this); + } + return $this->_services; + } + + protected function getTemplates(): TemplateList + { + if (!$this->_templates) { + $this->_templates = new TemplateList($this); + } + return $this->_templates; + } + + protected function getVerificationAttempts(): VerificationAttemptList + { + if (!$this->_verificationAttempts) { + $this->_verificationAttempts = new VerificationAttemptList($this); + } + return $this->_verificationAttempts; + } + + protected function getVerificationAttemptsSummary(): VerificationAttemptsSummaryList + { + if (!$this->_verificationAttemptsSummary) { + $this->_verificationAttemptsSummary = new VerificationAttemptsSummaryList($this); + } + return $this->_verificationAttemptsSummary; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2]'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/FormContext.php b/app/api/Twilio/Rest/Verify/V2/FormContext.php new file mode 100755 index 0000000..337bdc5 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/FormContext.php @@ -0,0 +1,81 @@ +solution = [ + 'formType' => + $formType, + ]; + + $this->uri = '/Forms/' . \rawurlencode($formType) + .''; + } + + /** + * Fetch the FormInstance + * + * @return FormInstance Fetched FormInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FormInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new FormInstance( + $this->version, + $payload, + $this->solution['formType'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.FormContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/FormInstance.php b/app/api/Twilio/Rest/Verify/V2/FormInstance.php new file mode 100755 index 0000000..d0258c4 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/FormInstance.php @@ -0,0 +1,121 @@ +properties = [ + 'formType' => Values::array_get($payload, 'form_type'), + 'forms' => Values::array_get($payload, 'forms'), + 'formMeta' => Values::array_get($payload, 'form_meta'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['formType' => $formType ?: $this->properties['formType'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return FormContext Context for this FormInstance + */ + protected function proxy(): FormContext + { + if (!$this->context) { + $this->context = new FormContext( + $this->version, + $this->solution['formType'] + ); + } + + return $this->context; + } + + /** + * Fetch the FormInstance + * + * @return FormInstance Fetched FormInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FormInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.FormInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Verify/V2/FormList.php b/app/api/Twilio/Rest/Verify/V2/FormList.php new file mode 100755 index 0000000..02a79b4 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/FormList.php @@ -0,0 +1,65 @@ +solution = [ + ]; + } + + /** + * Constructs a FormContext + * + * @param string $formType The Type of this Form. Currently only `form-push` is supported. + */ + public function getContext( + string $formType + + ): FormContext + { + return new FormContext( + $this->version, + $formType + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.FormList]'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/FormPage.php b/app/api/Twilio/Rest/Verify/V2/FormPage.php new file mode 100755 index 0000000..9c0c80a --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/FormPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return FormInstance \Twilio\Rest\Verify\V2\FormInstance + */ + public function buildInstance(array $payload): FormInstance + { + return new FormInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.FormPage]'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/SafelistContext.php b/app/api/Twilio/Rest/Verify/V2/SafelistContext.php new file mode 100755 index 0000000..2c647e3 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/SafelistContext.php @@ -0,0 +1,94 @@ +solution = [ + 'phoneNumber' => + $phoneNumber, + ]; + + $this->uri = '/SafeList/Numbers/' . \rawurlencode($phoneNumber) + .''; + } + + /** + * Delete the SafelistInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the SafelistInstance + * + * @return SafelistInstance Fetched SafelistInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SafelistInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new SafelistInstance( + $this->version, + $payload, + $this->solution['phoneNumber'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.SafelistContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/SafelistInstance.php b/app/api/Twilio/Rest/Verify/V2/SafelistInstance.php new file mode 100755 index 0000000..2e53592 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/SafelistInstance.php @@ -0,0 +1,131 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'phoneNumber' => Values::array_get($payload, 'phone_number'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['phoneNumber' => $phoneNumber ?: $this->properties['phoneNumber'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SafelistContext Context for this SafelistInstance + */ + protected function proxy(): SafelistContext + { + if (!$this->context) { + $this->context = new SafelistContext( + $this->version, + $this->solution['phoneNumber'] + ); + } + + return $this->context; + } + + /** + * Delete the SafelistInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SafelistInstance + * + * @return SafelistInstance Fetched SafelistInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SafelistInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.SafelistInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Verify/V2/SafelistList.php b/app/api/Twilio/Rest/Verify/V2/SafelistList.php new file mode 100755 index 0000000..1170db3 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/SafelistList.php @@ -0,0 +1,93 @@ +solution = [ + ]; + + $this->uri = '/SafeList/Numbers'; + } + + /** + * Create the SafelistInstance + * + * @param string $phoneNumber The phone number to be added in SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). + * @return SafelistInstance Created SafelistInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $phoneNumber): SafelistInstance + { + + $data = Values::of([ + 'PhoneNumber' => + $phoneNumber, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new SafelistInstance( + $this->version, + $payload + ); + } + + + /** + * Constructs a SafelistContext + * + * @param string $phoneNumber The phone number to be removed from SafeList. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). + */ + public function getContext( + string $phoneNumber + + ): SafelistContext + { + return new SafelistContext( + $this->version, + $phoneNumber + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.SafelistList]'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/SafelistPage.php b/app/api/Twilio/Rest/Verify/V2/SafelistPage.php new file mode 100755 index 0000000..a9975cb --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/SafelistPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SafelistInstance \Twilio\Rest\Verify\V2\SafelistInstance + */ + public function buildInstance(array $payload): SafelistInstance + { + return new SafelistInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.SafelistPage]'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/Service/AccessTokenContext.php b/app/api/Twilio/Rest/Verify/V2/Service/AccessTokenContext.php new file mode 100755 index 0000000..be1c6da --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/AccessTokenContext.php @@ -0,0 +1,87 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/AccessTokens/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the AccessTokenInstance + * + * @return AccessTokenInstance Fetched AccessTokenInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AccessTokenInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new AccessTokenInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.AccessTokenContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/Service/AccessTokenInstance.php b/app/api/Twilio/Rest/Verify/V2/Service/AccessTokenInstance.php new file mode 100755 index 0000000..0227b73 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/AccessTokenInstance.php @@ -0,0 +1,136 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'entityIdentity' => Values::array_get($payload, 'entity_identity'), + 'factorType' => Values::array_get($payload, 'factor_type'), + 'factorFriendlyName' => Values::array_get($payload, 'factor_friendly_name'), + 'token' => Values::array_get($payload, 'token'), + 'url' => Values::array_get($payload, 'url'), + 'ttl' => Values::array_get($payload, 'ttl'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AccessTokenContext Context for this AccessTokenInstance + */ + protected function proxy(): AccessTokenContext + { + if (!$this->context) { + $this->context = new AccessTokenContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the AccessTokenInstance + * + * @return AccessTokenInstance Fetched AccessTokenInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): AccessTokenInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.AccessTokenInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Verify/V2/Service/AccessTokenList.php b/app/api/Twilio/Rest/Verify/V2/Service/AccessTokenList.php new file mode 100755 index 0000000..5ee91b0 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/AccessTokenList.php @@ -0,0 +1,112 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/AccessTokens'; + } + + /** + * Create the AccessTokenInstance + * + * @param string $identity The unique external identifier for the Entity of the Service. This identifier should be immutable, not PII, and generated by your external system, such as your user's UUID, GUID, or SID. + * @param string $factorType + * @param array|Options $options Optional Arguments + * @return AccessTokenInstance Created AccessTokenInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $identity, string $factorType, array $options = []): AccessTokenInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Identity' => + $identity, + 'FactorType' => + $factorType, + 'FactorFriendlyName' => + $options['factorFriendlyName'], + 'Ttl' => + $options['ttl'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new AccessTokenInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Constructs a AccessTokenContext + * + * @param string $sid A 34 character string that uniquely identifies this Access Token. + */ + public function getContext( + string $sid + + ): AccessTokenContext + { + return new AccessTokenContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.AccessTokenList]'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/Service/AccessTokenOptions.php b/app/api/Twilio/Rest/Verify/V2/Service/AccessTokenOptions.php new file mode 100755 index 0000000..2e068b6 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/AccessTokenOptions.php @@ -0,0 +1,96 @@ +options['factorFriendlyName'] = $factorFriendlyName; + $this->options['ttl'] = $ttl; + } + + /** + * The friendly name of the factor that is going to be created with this access token + * + * @param string $factorFriendlyName The friendly name of the factor that is going to be created with this access token + * @return $this Fluent Builder + */ + public function setFactorFriendlyName(string $factorFriendlyName): self + { + $this->options['factorFriendlyName'] = $factorFriendlyName; + return $this; + } + + /** + * How long, in seconds, the access token is valid. Can be an integer between 60 and 300. Default is 60. + * + * @param int $ttl How long, in seconds, the access token is valid. Can be an integer between 60 and 300. Default is 60. + * @return $this Fluent Builder + */ + public function setTtl(int $ttl): self + { + $this->options['ttl'] = $ttl; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Verify.V2.CreateAccessTokenOptions ' . $options . ']'; + } +} + + diff --git a/app/api/Twilio/Rest/Verify/V2/Service/AccessTokenPage.php b/app/api/Twilio/Rest/Verify/V2/Service/AccessTokenPage.php new file mode 100755 index 0000000..ee61695 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/AccessTokenPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AccessTokenInstance \Twilio\Rest\Verify\V2\Service\AccessTokenInstance + */ + public function buildInstance(array $payload): AccessTokenInstance + { + return new AccessTokenInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.AccessTokenPage]'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationInstance.php b/app/api/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationInstance.php new file mode 100755 index 0000000..9d51017 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationInstance.php @@ -0,0 +1,100 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'entitySid' => Values::array_get($payload, 'entity_sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'challengeSid' => Values::array_get($payload, 'challenge_sid'), + 'priority' => Values::array_get($payload, 'priority'), + 'ttl' => Values::array_get($payload, 'ttl'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'identity' => $identity, 'challengeSid' => $challengeSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.NotificationInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationList.php b/app/api/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationList.php new file mode 100755 index 0000000..17f5ef8 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationList.php @@ -0,0 +1,101 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'identity' => + $identity, + + 'challengeSid' => + $challengeSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Entities/' . \rawurlencode($identity) + .'/Challenges/' . \rawurlencode($challengeSid) + .'/Notifications'; + } + + /** + * Create the NotificationInstance + * + * @param array|Options $options Optional Arguments + * @return NotificationInstance Created NotificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): NotificationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Ttl' => + $options['ttl'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new NotificationInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['identity'], + $this->solution['challengeSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.NotificationList]'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationOptions.php b/app/api/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationOptions.php new file mode 100755 index 0000000..5e8bbeb --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationOptions.php @@ -0,0 +1,76 @@ +options['ttl'] = $ttl; + } + + /** + * How long, in seconds, the notification is valid. Can be an integer between 0 and 300. Default is 300. Delivery is attempted until the TTL elapses, even if the device is offline. 0 means that the notification delivery is attempted immediately, only once, and is not stored for future delivery. + * + * @param int $ttl How long, in seconds, the notification is valid. Can be an integer between 0 and 300. Default is 300. Delivery is attempted until the TTL elapses, even if the device is offline. 0 means that the notification delivery is attempted immediately, only once, and is not stored for future delivery. + * @return $this Fluent Builder + */ + public function setTtl(int $ttl): self + { + $this->options['ttl'] = $ttl; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Verify.V2.CreateNotificationOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationPage.php b/app/api/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationPage.php new file mode 100755 index 0000000..8d32dd6 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/Entity/Challenge/NotificationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return NotificationInstance \Twilio\Rest\Verify\V2\Service\Entity\Challenge\NotificationInstance + */ + public function buildInstance(array $payload): NotificationInstance + { + return new NotificationInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['identity'], $this->solution['challengeSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.NotificationPage]'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/Service/Entity/ChallengeContext.php b/app/api/Twilio/Rest/Verify/V2/Service/Entity/ChallengeContext.php new file mode 100755 index 0000000..e225ec3 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/Entity/ChallengeContext.php @@ -0,0 +1,186 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'identity' => + $identity, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Entities/' . \rawurlencode($identity) + .'/Challenges/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the ChallengeInstance + * + * @return ChallengeInstance Fetched ChallengeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ChallengeInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ChallengeInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['identity'], + $this->solution['sid'] + ); + } + + + /** + * Update the ChallengeInstance + * + * @param array|Options $options Optional Arguments + * @return ChallengeInstance Updated ChallengeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ChallengeInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'AuthPayload' => + $options['authPayload'], + 'Metadata' => + Serialize::jsonObject($options['metadata']), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new ChallengeInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['identity'], + $this->solution['sid'] + ); + } + + + /** + * Access the notifications + */ + protected function getNotifications(): NotificationList + { + if (!$this->_notifications) { + $this->_notifications = new NotificationList( + $this->version, + $this->solution['serviceSid'], + $this->solution['identity'], + $this->solution['sid'] + ); + } + + return $this->_notifications; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.ChallengeContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/Service/Entity/ChallengeInstance.php b/app/api/Twilio/Rest/Verify/V2/Service/Entity/ChallengeInstance.php new file mode 100755 index 0000000..4179981 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/Entity/ChallengeInstance.php @@ -0,0 +1,179 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'entitySid' => Values::array_get($payload, 'entity_sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'factorSid' => Values::array_get($payload, 'factor_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'dateResponded' => Deserialize::dateTime(Values::array_get($payload, 'date_responded')), + 'expirationDate' => Deserialize::dateTime(Values::array_get($payload, 'expiration_date')), + 'status' => Values::array_get($payload, 'status'), + 'respondedReason' => Values::array_get($payload, 'responded_reason'), + 'details' => Values::array_get($payload, 'details'), + 'hiddenDetails' => Values::array_get($payload, 'hidden_details'), + 'metadata' => Values::array_get($payload, 'metadata'), + 'factorType' => Values::array_get($payload, 'factor_type'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'identity' => $identity, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ChallengeContext Context for this ChallengeInstance + */ + protected function proxy(): ChallengeContext + { + if (!$this->context) { + $this->context = new ChallengeContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['identity'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the ChallengeInstance + * + * @return ChallengeInstance Fetched ChallengeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ChallengeInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ChallengeInstance + * + * @param array|Options $options Optional Arguments + * @return ChallengeInstance Updated ChallengeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ChallengeInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the notifications + */ + protected function getNotifications(): NotificationList + { + return $this->proxy()->notifications; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.ChallengeInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Verify/V2/Service/Entity/ChallengeList.php b/app/api/Twilio/Rest/Verify/V2/Service/Entity/ChallengeList.php new file mode 100755 index 0000000..d9ca0bf --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/Entity/ChallengeList.php @@ -0,0 +1,227 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'identity' => + $identity, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Entities/' . \rawurlencode($identity) + .'/Challenges'; + } + + /** + * Create the ChallengeInstance + * + * @param string $factorSid The unique SID identifier of the Factor. + * @param array|Options $options Optional Arguments + * @return ChallengeInstance Created ChallengeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $factorSid, array $options = []): ChallengeInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FactorSid' => + $factorSid, + 'ExpirationDate' => + Serialize::iso8601DateTime($options['expirationDate']), + 'Details.Message' => + $options['detailsMessage'], + 'Details.Fields' => + Serialize::map($options['detailsFields'], function ($e) { return Serialize::jsonObject($e); }), + 'HiddenDetails' => + Serialize::jsonObject($options['hiddenDetails']), + 'AuthPayload' => + $options['authPayload'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new ChallengeInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['identity'] + ); + } + + + /** + * Reads ChallengeInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ChallengeInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams ChallengeInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ChallengeInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ChallengePage Page of ChallengeInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ChallengePage + { + $options = new Values($options); + + $params = Values::of([ + 'FactorSid' => + $options['factorSid'], + 'Status' => + $options['status'], + 'Order' => + $options['order'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ChallengePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ChallengeInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ChallengePage Page of ChallengeInstance + */ + public function getPage(string $targetUrl): ChallengePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ChallengePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ChallengeContext + * + * @param string $sid A 34 character string that uniquely identifies this Challenge. + */ + public function getContext( + string $sid + + ): ChallengeContext + { + return new ChallengeContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['identity'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.ChallengeList]'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/Service/Entity/ChallengeOptions.php b/app/api/Twilio/Rest/Verify/V2/Service/Entity/ChallengeOptions.php new file mode 100755 index 0000000..00784bc --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/Entity/ChallengeOptions.php @@ -0,0 +1,308 @@ +options['expirationDate'] = $expirationDate; + $this->options['detailsMessage'] = $detailsMessage; + $this->options['detailsFields'] = $detailsFields; + $this->options['hiddenDetails'] = $hiddenDetails; + $this->options['authPayload'] = $authPayload; + } + + /** + * The date-time when this Challenge expires, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. The default value is five (5) minutes after Challenge creation. The max value is sixty (60) minutes after creation. + * + * @param \DateTime $expirationDate The date-time when this Challenge expires, given in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format. The default value is five (5) minutes after Challenge creation. The max value is sixty (60) minutes after creation. + * @return $this Fluent Builder + */ + public function setExpirationDate(\DateTime $expirationDate): self + { + $this->options['expirationDate'] = $expirationDate; + return $this; + } + + /** + * Shown to the user when the push notification arrives. Required when `factor_type` is `push`. Can be up to 256 characters in length + * + * @param string $detailsMessage Shown to the user when the push notification arrives. Required when `factor_type` is `push`. Can be up to 256 characters in length + * @return $this Fluent Builder + */ + public function setDetailsMessage(string $detailsMessage): self + { + $this->options['detailsMessage'] = $detailsMessage; + return $this; + } + + /** + * A list of objects that describe the Fields included in the Challenge. Each object contains the label and value of the field, the label can be up to 36 characters in length and the value can be up to 128 characters in length. Used when `factor_type` is `push`. There can be up to 20 details fields. + * + * @param array[] $detailsFields A list of objects that describe the Fields included in the Challenge. Each object contains the label and value of the field, the label can be up to 36 characters in length and the value can be up to 128 characters in length. Used when `factor_type` is `push`. There can be up to 20 details fields. + * @return $this Fluent Builder + */ + public function setDetailsFields(array $detailsFields): self + { + $this->options['detailsFields'] = $detailsFields; + return $this; + } + + /** + * Details provided to give context about the Challenge. Not shown to the end user. It must be a stringified JSON with only strings values eg. `{\\\"ip\\\": \\\"172.168.1.234\\\"}`. Can be up to 1024 characters in length + * + * @param array $hiddenDetails Details provided to give context about the Challenge. Not shown to the end user. It must be a stringified JSON with only strings values eg. `{\\\"ip\\\": \\\"172.168.1.234\\\"}`. Can be up to 1024 characters in length + * @return $this Fluent Builder + */ + public function setHiddenDetails(array $hiddenDetails): self + { + $this->options['hiddenDetails'] = $hiddenDetails; + return $this; + } + + /** + * Optional payload used to verify the Challenge upon creation. Only used with a Factor of type `totp` to carry the TOTP code that needs to be verified. For `TOTP` this value must be between 3 and 8 characters long. + * + * @param string $authPayload Optional payload used to verify the Challenge upon creation. Only used with a Factor of type `totp` to carry the TOTP code that needs to be verified. For `TOTP` this value must be between 3 and 8 characters long. + * @return $this Fluent Builder + */ + public function setAuthPayload(string $authPayload): self + { + $this->options['authPayload'] = $authPayload; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Verify.V2.CreateChallengeOptions ' . $options . ']'; + } +} + + +class ReadChallengeOptions extends Options + { + /** + * @param string $factorSid The unique SID identifier of the Factor. + * @param string $status The Status of the Challenges to fetch. One of `pending`, `expired`, `approved` or `denied`. + * @param string $order The desired sort order of the Challenges list. One of `asc` or `desc` for ascending and descending respectively. Defaults to `asc`. + */ + public function __construct( + + string $factorSid = Values::NONE, + string $status = Values::NONE, + string $order = Values::NONE + + ) { + $this->options['factorSid'] = $factorSid; + $this->options['status'] = $status; + $this->options['order'] = $order; + } + + /** + * The unique SID identifier of the Factor. + * + * @param string $factorSid The unique SID identifier of the Factor. + * @return $this Fluent Builder + */ + public function setFactorSid(string $factorSid): self + { + $this->options['factorSid'] = $factorSid; + return $this; + } + + /** + * The Status of the Challenges to fetch. One of `pending`, `expired`, `approved` or `denied`. + * + * @param string $status The Status of the Challenges to fetch. One of `pending`, `expired`, `approved` or `denied`. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * The desired sort order of the Challenges list. One of `asc` or `desc` for ascending and descending respectively. Defaults to `asc`. + * + * @param string $order The desired sort order of the Challenges list. One of `asc` or `desc` for ascending and descending respectively. Defaults to `asc`. + * @return $this Fluent Builder + */ + public function setOrder(string $order): self + { + $this->options['order'] = $order; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Verify.V2.ReadChallengeOptions ' . $options . ']'; + } +} + +class UpdateChallengeOptions extends Options + { + /** + * @param string $authPayload The optional payload needed to verify the Challenge. E.g., a TOTP would use the numeric code. For `TOTP` this value must be between 3 and 8 characters long. For `Push` this value can be up to 5456 characters in length + * @param array $metadata Custom metadata associated with the challenge. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg. `{\\\"os\\\": \\\"Android\\\"}`. Can be up to 1024 characters in length. + */ + public function __construct( + + string $authPayload = Values::NONE, + array $metadata = Values::ARRAY_NONE + + ) { + $this->options['authPayload'] = $authPayload; + $this->options['metadata'] = $metadata; + } + + /** + * The optional payload needed to verify the Challenge. E.g., a TOTP would use the numeric code. For `TOTP` this value must be between 3 and 8 characters long. For `Push` this value can be up to 5456 characters in length + * + * @param string $authPayload The optional payload needed to verify the Challenge. E.g., a TOTP would use the numeric code. For `TOTP` this value must be between 3 and 8 characters long. For `Push` this value can be up to 5456 characters in length + * @return $this Fluent Builder + */ + public function setAuthPayload(string $authPayload): self + { + $this->options['authPayload'] = $authPayload; + return $this; + } + + /** + * Custom metadata associated with the challenge. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg. `{\\\"os\\\": \\\"Android\\\"}`. Can be up to 1024 characters in length. + * + * @param array $metadata Custom metadata associated with the challenge. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg. `{\\\"os\\\": \\\"Android\\\"}`. Can be up to 1024 characters in length. + * @return $this Fluent Builder + */ + public function setMetadata(array $metadata): self + { + $this->options['metadata'] = $metadata; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Verify.V2.UpdateChallengeOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Verify/V2/Service/Entity/ChallengePage.php b/app/api/Twilio/Rest/Verify/V2/Service/Entity/ChallengePage.php new file mode 100755 index 0000000..bad3ff5 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/Entity/ChallengePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ChallengeInstance \Twilio\Rest\Verify\V2\Service\Entity\ChallengeInstance + */ + public function buildInstance(array $payload): ChallengeInstance + { + return new ChallengeInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['identity']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.ChallengePage]'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/Service/Entity/FactorContext.php b/app/api/Twilio/Rest/Verify/V2/Service/Entity/FactorContext.php new file mode 100755 index 0000000..e4369af --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/Entity/FactorContext.php @@ -0,0 +1,153 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'identity' => + $identity, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Entities/' . \rawurlencode($identity) + .'/Factors/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the FactorInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the FactorInstance + * + * @return FactorInstance Fetched FactorInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FactorInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new FactorInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['identity'], + $this->solution['sid'] + ); + } + + + /** + * Update the FactorInstance + * + * @param array|Options $options Optional Arguments + * @return FactorInstance Updated FactorInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): FactorInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'AuthPayload' => + $options['authPayload'], + 'FriendlyName' => + $options['friendlyName'], + 'Config.NotificationToken' => + $options['configNotificationToken'], + 'Config.SdkVersion' => + $options['configSdkVersion'], + 'Config.TimeStep' => + $options['configTimeStep'], + 'Config.Skew' => + $options['configSkew'], + 'Config.CodeLength' => + $options['configCodeLength'], + 'Config.Alg' => + $options['configAlg'], + 'Config.NotificationPlatform' => + $options['configNotificationPlatform'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new FactorInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['identity'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.FactorContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/Service/Entity/FactorInstance.php b/app/api/Twilio/Rest/Verify/V2/Service/Entity/FactorInstance.php new file mode 100755 index 0000000..d6299f2 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/Entity/FactorInstance.php @@ -0,0 +1,170 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'entitySid' => Values::array_get($payload, 'entity_sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'status' => Values::array_get($payload, 'status'), + 'factorType' => Values::array_get($payload, 'factor_type'), + 'config' => Values::array_get($payload, 'config'), + 'metadata' => Values::array_get($payload, 'metadata'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'identity' => $identity, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return FactorContext Context for this FactorInstance + */ + protected function proxy(): FactorContext + { + if (!$this->context) { + $this->context = new FactorContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['identity'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the FactorInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the FactorInstance + * + * @return FactorInstance Fetched FactorInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): FactorInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the FactorInstance + * + * @param array|Options $options Optional Arguments + * @return FactorInstance Updated FactorInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): FactorInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.FactorInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Verify/V2/Service/Entity/FactorList.php b/app/api/Twilio/Rest/Verify/V2/Service/Entity/FactorList.php new file mode 100755 index 0000000..dc48117 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/Entity/FactorList.php @@ -0,0 +1,175 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'identity' => + $identity, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Entities/' . \rawurlencode($identity) + .'/Factors'; + } + + /** + * Reads FactorInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return FactorInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams FactorInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of FactorInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return FactorPage Page of FactorInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): FactorPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new FactorPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of FactorInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return FactorPage Page of FactorInstance + */ + public function getPage(string $targetUrl): FactorPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new FactorPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a FactorContext + * + * @param string $sid A 34 character string that uniquely identifies this Factor. + */ + public function getContext( + string $sid + + ): FactorContext + { + return new FactorContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['identity'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.FactorList]'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/Service/Entity/FactorOptions.php b/app/api/Twilio/Rest/Verify/V2/Service/Entity/FactorOptions.php new file mode 100755 index 0000000..2939bb6 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/Entity/FactorOptions.php @@ -0,0 +1,224 @@ +options['authPayload'] = $authPayload; + $this->options['friendlyName'] = $friendlyName; + $this->options['configNotificationToken'] = $configNotificationToken; + $this->options['configSdkVersion'] = $configSdkVersion; + $this->options['configTimeStep'] = $configTimeStep; + $this->options['configSkew'] = $configSkew; + $this->options['configCodeLength'] = $configCodeLength; + $this->options['configAlg'] = $configAlg; + $this->options['configNotificationPlatform'] = $configNotificationPlatform; + } + + /** + * The optional payload needed to verify the Factor for the first time. E.g. for a TOTP, the numeric code. + * + * @param string $authPayload The optional payload needed to verify the Factor for the first time. E.g. for a TOTP, the numeric code. + * @return $this Fluent Builder + */ + public function setAuthPayload(string $authPayload): self + { + $this->options['authPayload'] = $authPayload; + return $this; + } + + /** + * The new friendly name of this Factor. It can be up to 64 characters. + * + * @param string $friendlyName The new friendly name of this Factor. It can be up to 64 characters. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * For APN, the device token. For FCM, the registration token. It is used to send the push notifications. Required when `factor_type` is `push`. If specified, this value must be between 32 and 255 characters long. + * + * @param string $configNotificationToken For APN, the device token. For FCM, the registration token. It is used to send the push notifications. Required when `factor_type` is `push`. If specified, this value must be between 32 and 255 characters long. + * @return $this Fluent Builder + */ + public function setConfigNotificationToken(string $configNotificationToken): self + { + $this->options['configNotificationToken'] = $configNotificationToken; + return $this; + } + + /** + * The Verify Push SDK version used to configure the factor + * + * @param string $configSdkVersion The Verify Push SDK version used to configure the factor + * @return $this Fluent Builder + */ + public function setConfigSdkVersion(string $configSdkVersion): self + { + $this->options['configSdkVersion'] = $configSdkVersion; + return $this; + } + + /** + * Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive + * + * @param int $configTimeStep Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive + * @return $this Fluent Builder + */ + public function setConfigTimeStep(int $configTimeStep): self + { + $this->options['configTimeStep'] = $configTimeStep; + return $this; + } + + /** + * The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive + * + * @param int $configSkew The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive + * @return $this Fluent Builder + */ + public function setConfigSkew(int $configSkew): self + { + $this->options['configSkew'] = $configSkew; + return $this; + } + + /** + * Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive + * + * @param int $configCodeLength Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive + * @return $this Fluent Builder + */ + public function setConfigCodeLength(int $configCodeLength): self + { + $this->options['configCodeLength'] = $configCodeLength; + return $this; + } + + /** + * @param string $configAlg + * @return $this Fluent Builder + */ + public function setConfigAlg(string $configAlg): self + { + $this->options['configAlg'] = $configAlg; + return $this; + } + + /** + * The transport technology used to generate the Notification Token. Can be `apn`, `fcm` or `none`. Required when `factor_type` is `push`. + * + * @param string $configNotificationPlatform The transport technology used to generate the Notification Token. Can be `apn`, `fcm` or `none`. Required when `factor_type` is `push`. + * @return $this Fluent Builder + */ + public function setConfigNotificationPlatform(string $configNotificationPlatform): self + { + $this->options['configNotificationPlatform'] = $configNotificationPlatform; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Verify.V2.UpdateFactorOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Verify/V2/Service/Entity/FactorPage.php b/app/api/Twilio/Rest/Verify/V2/Service/Entity/FactorPage.php new file mode 100755 index 0000000..571a6d5 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/Entity/FactorPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return FactorInstance \Twilio\Rest\Verify\V2\Service\Entity\FactorInstance + */ + public function buildInstance(array $payload): FactorInstance + { + return new FactorInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['identity']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.FactorPage]'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/Service/Entity/NewFactorInstance.php b/app/api/Twilio/Rest/Verify/V2/Service/Entity/NewFactorInstance.php new file mode 100755 index 0000000..fa49805 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/Entity/NewFactorInstance.php @@ -0,0 +1,109 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'entitySid' => Values::array_get($payload, 'entity_sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'binding' => Values::array_get($payload, 'binding'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'status' => Values::array_get($payload, 'status'), + 'factorType' => Values::array_get($payload, 'factor_type'), + 'config' => Values::array_get($payload, 'config'), + 'metadata' => Values::array_get($payload, 'metadata'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'identity' => $identity, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.NewFactorInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Verify/V2/Service/Entity/NewFactorList.php b/app/api/Twilio/Rest/Verify/V2/Service/Entity/NewFactorList.php new file mode 100755 index 0000000..b330b22 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/Entity/NewFactorList.php @@ -0,0 +1,123 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'identity' => + $identity, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Entities/' . \rawurlencode($identity) + .'/Factors'; + } + + /** + * Create the NewFactorInstance + * + * @param string $friendlyName The friendly name of this Factor. This can be any string up to 64 characters, meant for humans to distinguish between Factors. For `factor_type` `push`, this could be a device name. For `factor_type` `totp`, this value is used as the “account name” in constructing the `binding.uri` property. At the same time, we recommend avoiding providing PII. + * @param string $factorType + * @param array|Options $options Optional Arguments + * @return NewFactorInstance Created NewFactorInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, string $factorType, array $options = []): NewFactorInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'FactorType' => + $factorType, + 'Binding.Alg' => + $options['bindingAlg'], + 'Binding.PublicKey' => + $options['bindingPublicKey'], + 'Config.AppId' => + $options['configAppId'], + 'Config.NotificationPlatform' => + $options['configNotificationPlatform'], + 'Config.NotificationToken' => + $options['configNotificationToken'], + 'Config.SdkVersion' => + $options['configSdkVersion'], + 'Binding.Secret' => + $options['bindingSecret'], + 'Config.TimeStep' => + $options['configTimeStep'], + 'Config.Skew' => + $options['configSkew'], + 'Config.CodeLength' => + $options['configCodeLength'], + 'Config.Alg' => + $options['configAlg'], + 'Metadata' => + Serialize::jsonObject($options['metadata']), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new NewFactorInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['identity'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.NewFactorList]'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/Service/Entity/NewFactorOptions.php b/app/api/Twilio/Rest/Verify/V2/Service/Entity/NewFactorOptions.php new file mode 100755 index 0000000..b58b18d --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/Entity/NewFactorOptions.php @@ -0,0 +1,270 @@ +options['bindingAlg'] = $bindingAlg; + $this->options['bindingPublicKey'] = $bindingPublicKey; + $this->options['configAppId'] = $configAppId; + $this->options['configNotificationPlatform'] = $configNotificationPlatform; + $this->options['configNotificationToken'] = $configNotificationToken; + $this->options['configSdkVersion'] = $configSdkVersion; + $this->options['bindingSecret'] = $bindingSecret; + $this->options['configTimeStep'] = $configTimeStep; + $this->options['configSkew'] = $configSkew; + $this->options['configCodeLength'] = $configCodeLength; + $this->options['configAlg'] = $configAlg; + $this->options['metadata'] = $metadata; + } + + /** + * The algorithm used when `factor_type` is `push`. Algorithm supported: `ES256` + * + * @param string $bindingAlg The algorithm used when `factor_type` is `push`. Algorithm supported: `ES256` + * @return $this Fluent Builder + */ + public function setBindingAlg(string $bindingAlg): self + { + $this->options['bindingAlg'] = $bindingAlg; + return $this; + } + + /** + * The Ecdsa public key in PKIX, ASN.1 DER format encoded in Base64. Required when `factor_type` is `push` + * + * @param string $bindingPublicKey The Ecdsa public key in PKIX, ASN.1 DER format encoded in Base64. Required when `factor_type` is `push` + * @return $this Fluent Builder + */ + public function setBindingPublicKey(string $bindingPublicKey): self + { + $this->options['bindingPublicKey'] = $bindingPublicKey; + return $this; + } + + /** + * The ID that uniquely identifies your app in the Google or Apple store, such as `com.example.myapp`. It can be up to 100 characters long. Required when `factor_type` is `push`. + * + * @param string $configAppId The ID that uniquely identifies your app in the Google or Apple store, such as `com.example.myapp`. It can be up to 100 characters long. Required when `factor_type` is `push`. + * @return $this Fluent Builder + */ + public function setConfigAppId(string $configAppId): self + { + $this->options['configAppId'] = $configAppId; + return $this; + } + + /** + * @param string $configNotificationPlatform + * @return $this Fluent Builder + */ + public function setConfigNotificationPlatform(string $configNotificationPlatform): self + { + $this->options['configNotificationPlatform'] = $configNotificationPlatform; + return $this; + } + + /** + * For APN, the device token. For FCM, the registration token. It is used to send the push notifications. Must be between 32 and 255 characters long. Required when `factor_type` is `push`. + * + * @param string $configNotificationToken For APN, the device token. For FCM, the registration token. It is used to send the push notifications. Must be between 32 and 255 characters long. Required when `factor_type` is `push`. + * @return $this Fluent Builder + */ + public function setConfigNotificationToken(string $configNotificationToken): self + { + $this->options['configNotificationToken'] = $configNotificationToken; + return $this; + } + + /** + * The Verify Push SDK version used to configure the factor Required when `factor_type` is `push` + * + * @param string $configSdkVersion The Verify Push SDK version used to configure the factor Required when `factor_type` is `push` + * @return $this Fluent Builder + */ + public function setConfigSdkVersion(string $configSdkVersion): self + { + $this->options['configSdkVersion'] = $configSdkVersion; + return $this; + } + + /** + * The shared secret for TOTP factors encoded in Base32. This can be provided when creating the Factor, otherwise it will be generated. Used when `factor_type` is `totp` + * + * @param string $bindingSecret The shared secret for TOTP factors encoded in Base32. This can be provided when creating the Factor, otherwise it will be generated. Used when `factor_type` is `totp` + * @return $this Fluent Builder + */ + public function setBindingSecret(string $bindingSecret): self + { + $this->options['bindingSecret'] = $bindingSecret; + return $this; + } + + /** + * Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. The default value is defined at the service level in the property `totp.time_step`. Defaults to 30 seconds if not configured. Used when `factor_type` is `totp` + * + * @param int $configTimeStep Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. The default value is defined at the service level in the property `totp.time_step`. Defaults to 30 seconds if not configured. Used when `factor_type` is `totp` + * @return $this Fluent Builder + */ + public function setConfigTimeStep(int $configTimeStep): self + { + $this->options['configTimeStep'] = $configTimeStep; + return $this; + } + + /** + * The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. The default value is defined at the service level in the property `totp.skew`. If not configured defaults to 1. Used when `factor_type` is `totp` + * + * @param int $configSkew The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. The default value is defined at the service level in the property `totp.skew`. If not configured defaults to 1. Used when `factor_type` is `totp` + * @return $this Fluent Builder + */ + public function setConfigSkew(int $configSkew): self + { + $this->options['configSkew'] = $configSkew; + return $this; + } + + /** + * Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. The default value is defined at the service level in the property `totp.code_length`. If not configured defaults to 6. Used when `factor_type` is `totp` + * + * @param int $configCodeLength Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. The default value is defined at the service level in the property `totp.code_length`. If not configured defaults to 6. Used when `factor_type` is `totp` + * @return $this Fluent Builder + */ + public function setConfigCodeLength(int $configCodeLength): self + { + $this->options['configCodeLength'] = $configCodeLength; + return $this; + } + + /** + * @param string $configAlg + * @return $this Fluent Builder + */ + public function setConfigAlg(string $configAlg): self + { + $this->options['configAlg'] = $configAlg; + return $this; + } + + /** + * Custom metadata associated with the factor. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg. `{\\\"os\\\": \\\"Android\\\"}`. Can be up to 1024 characters in length. + * + * @param array $metadata Custom metadata associated with the factor. This is added by the Device/SDK directly to allow for the inclusion of device information. It must be a stringified JSON with only strings values eg. `{\\\"os\\\": \\\"Android\\\"}`. Can be up to 1024 characters in length. + * @return $this Fluent Builder + */ + public function setMetadata(array $metadata): self + { + $this->options['metadata'] = $metadata; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Verify.V2.CreateNewFactorOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Verify/V2/Service/Entity/NewFactorPage.php b/app/api/Twilio/Rest/Verify/V2/Service/Entity/NewFactorPage.php new file mode 100755 index 0000000..00b1aec --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/Entity/NewFactorPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return NewFactorInstance \Twilio\Rest\Verify\V2\Service\Entity\NewFactorInstance + */ + public function buildInstance(array $payload): NewFactorInstance + { + return new NewFactorInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['identity']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.NewFactorPage]'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/Service/EntityContext.php b/app/api/Twilio/Rest/Verify/V2/Service/EntityContext.php new file mode 100755 index 0000000..fc2badd --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/EntityContext.php @@ -0,0 +1,198 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'identity' => + $identity, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Entities/' . \rawurlencode($identity) + .''; + } + + /** + * Delete the EntityInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the EntityInstance + * + * @return EntityInstance Fetched EntityInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EntityInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new EntityInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['identity'] + ); + } + + + /** + * Access the factors + */ + protected function getFactors(): FactorList + { + if (!$this->_factors) { + $this->_factors = new FactorList( + $this->version, + $this->solution['serviceSid'], + $this->solution['identity'] + ); + } + + return $this->_factors; + } + + /** + * Access the newFactors + */ + protected function getNewFactors(): NewFactorList + { + if (!$this->_newFactors) { + $this->_newFactors = new NewFactorList( + $this->version, + $this->solution['serviceSid'], + $this->solution['identity'] + ); + } + + return $this->_newFactors; + } + + /** + * Access the challenges + */ + protected function getChallenges(): ChallengeList + { + if (!$this->_challenges) { + $this->_challenges = new ChallengeList( + $this->version, + $this->solution['serviceSid'], + $this->solution['identity'] + ); + } + + return $this->_challenges; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.EntityContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/Service/EntityInstance.php b/app/api/Twilio/Rest/Verify/V2/Service/EntityInstance.php new file mode 100755 index 0000000..6af2d4d --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/EntityInstance.php @@ -0,0 +1,175 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'identity' => Values::array_get($payload, 'identity'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'identity' => $identity ?: $this->properties['identity'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return EntityContext Context for this EntityInstance + */ + protected function proxy(): EntityContext + { + if (!$this->context) { + $this->context = new EntityContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['identity'] + ); + } + + return $this->context; + } + + /** + * Delete the EntityInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the EntityInstance + * + * @return EntityInstance Fetched EntityInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): EntityInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the factors + */ + protected function getFactors(): FactorList + { + return $this->proxy()->factors; + } + + /** + * Access the newFactors + */ + protected function getNewFactors(): NewFactorList + { + return $this->proxy()->newFactors; + } + + /** + * Access the challenges + */ + protected function getChallenges(): ChallengeList + { + return $this->proxy()->challenges; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.EntityInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Verify/V2/Service/EntityList.php b/app/api/Twilio/Rest/Verify/V2/Service/EntityList.php new file mode 100755 index 0000000..28a10d6 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/EntityList.php @@ -0,0 +1,194 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Entities'; + } + + /** + * Create the EntityInstance + * + * @param string $identity The unique external identifier for the Entity of the Service. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user's UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters. + * @return EntityInstance Created EntityInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $identity): EntityInstance + { + + $data = Values::of([ + 'Identity' => + $identity, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new EntityInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads EntityInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return EntityInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams EntityInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of EntityInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return EntityPage Page of EntityInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): EntityPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new EntityPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of EntityInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return EntityPage Page of EntityInstance + */ + public function getPage(string $targetUrl): EntityPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new EntityPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a EntityContext + * + * @param string $identity The unique external identifier for the Entity of the Service. This identifier should be immutable, not PII, length between 8 and 64 characters, and generated by your external system, such as your user's UUID, GUID, or SID. It can only contain dash (-) separated alphanumeric characters. + */ + public function getContext( + string $identity + + ): EntityContext + { + return new EntityContext( + $this->version, + $this->solution['serviceSid'], + $identity + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.EntityList]'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/Service/EntityPage.php b/app/api/Twilio/Rest/Verify/V2/Service/EntityPage.php new file mode 100755 index 0000000..6430586 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/EntityPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return EntityInstance \Twilio\Rest\Verify\V2\Service\EntityInstance + */ + public function buildInstance(array $payload): EntityInstance + { + return new EntityInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.EntityPage]'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/Service/MessagingConfigurationContext.php b/app/api/Twilio/Rest/Verify/V2/Service/MessagingConfigurationContext.php new file mode 100755 index 0000000..ca1f73e --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/MessagingConfigurationContext.php @@ -0,0 +1,127 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'country' => + $country, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/MessagingConfigurations/' . \rawurlencode($country) + .''; + } + + /** + * Delete the MessagingConfigurationInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the MessagingConfigurationInstance + * + * @return MessagingConfigurationInstance Fetched MessagingConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MessagingConfigurationInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new MessagingConfigurationInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['country'] + ); + } + + + /** + * Update the MessagingConfigurationInstance + * + * @param string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/sms/services/api) to be used to send SMS to the country of this configuration. + * @return MessagingConfigurationInstance Updated MessagingConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $messagingServiceSid): MessagingConfigurationInstance + { + + $data = Values::of([ + 'MessagingServiceSid' => + $messagingServiceSid, + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new MessagingConfigurationInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['country'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.MessagingConfigurationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/Service/MessagingConfigurationInstance.php b/app/api/Twilio/Rest/Verify/V2/Service/MessagingConfigurationInstance.php new file mode 100755 index 0000000..8530a46 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/MessagingConfigurationInstance.php @@ -0,0 +1,155 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'country' => Values::array_get($payload, 'country'), + 'messagingServiceSid' => Values::array_get($payload, 'messaging_service_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'country' => $country ?: $this->properties['country'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return MessagingConfigurationContext Context for this MessagingConfigurationInstance + */ + protected function proxy(): MessagingConfigurationContext + { + if (!$this->context) { + $this->context = new MessagingConfigurationContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['country'] + ); + } + + return $this->context; + } + + /** + * Delete the MessagingConfigurationInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the MessagingConfigurationInstance + * + * @return MessagingConfigurationInstance Fetched MessagingConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): MessagingConfigurationInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the MessagingConfigurationInstance + * + * @param string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/sms/services/api) to be used to send SMS to the country of this configuration. + * @return MessagingConfigurationInstance Updated MessagingConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $messagingServiceSid): MessagingConfigurationInstance + { + + return $this->proxy()->update($messagingServiceSid); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.MessagingConfigurationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Verify/V2/Service/MessagingConfigurationList.php b/app/api/Twilio/Rest/Verify/V2/Service/MessagingConfigurationList.php new file mode 100755 index 0000000..7d34284 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/MessagingConfigurationList.php @@ -0,0 +1,197 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/MessagingConfigurations'; + } + + /** + * Create the MessagingConfigurationInstance + * + * @param string $country The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country this configuration will be applied to. If this is a global configuration, Country will take the value `all`. + * @param string $messagingServiceSid The SID of the [Messaging Service](https://www.twilio.com/docs/sms/services/api) to be used to send SMS to the country of this configuration. + * @return MessagingConfigurationInstance Created MessagingConfigurationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $country, string $messagingServiceSid): MessagingConfigurationInstance + { + + $data = Values::of([ + 'Country' => + $country, + 'MessagingServiceSid' => + $messagingServiceSid, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new MessagingConfigurationInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads MessagingConfigurationInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return MessagingConfigurationInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams MessagingConfigurationInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of MessagingConfigurationInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return MessagingConfigurationPage Page of MessagingConfigurationInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): MessagingConfigurationPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new MessagingConfigurationPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of MessagingConfigurationInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return MessagingConfigurationPage Page of MessagingConfigurationInstance + */ + public function getPage(string $targetUrl): MessagingConfigurationPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new MessagingConfigurationPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a MessagingConfigurationContext + * + * @param string $country The [ISO-3166-1](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) country code of the country this configuration will be applied to. If this is a global configuration, Country will take the value `all`. + */ + public function getContext( + string $country + + ): MessagingConfigurationContext + { + return new MessagingConfigurationContext( + $this->version, + $this->solution['serviceSid'], + $country + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.MessagingConfigurationList]'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/Service/MessagingConfigurationPage.php b/app/api/Twilio/Rest/Verify/V2/Service/MessagingConfigurationPage.php new file mode 100755 index 0000000..010a04d --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/MessagingConfigurationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return MessagingConfigurationInstance \Twilio\Rest\Verify\V2\Service\MessagingConfigurationInstance + */ + public function buildInstance(array $payload): MessagingConfigurationInstance + { + return new MessagingConfigurationInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.MessagingConfigurationPage]'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/Service/RateLimit/BucketContext.php b/app/api/Twilio/Rest/Verify/V2/Service/RateLimit/BucketContext.php new file mode 100755 index 0000000..ba6eb41 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/RateLimit/BucketContext.php @@ -0,0 +1,139 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'rateLimitSid' => + $rateLimitSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/RateLimits/' . \rawurlencode($rateLimitSid) + .'/Buckets/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the BucketInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the BucketInstance + * + * @return BucketInstance Fetched BucketInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BucketInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new BucketInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['rateLimitSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the BucketInstance + * + * @param array|Options $options Optional Arguments + * @return BucketInstance Updated BucketInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): BucketInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Max' => + $options['max'], + 'Interval' => + $options['interval'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new BucketInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['rateLimitSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.BucketContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/Service/RateLimit/BucketInstance.php b/app/api/Twilio/Rest/Verify/V2/Service/RateLimit/BucketInstance.php new file mode 100755 index 0000000..c5441dd --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/RateLimit/BucketInstance.php @@ -0,0 +1,162 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'rateLimitSid' => Values::array_get($payload, 'rate_limit_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'max' => Values::array_get($payload, 'max'), + 'interval' => Values::array_get($payload, 'interval'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'rateLimitSid' => $rateLimitSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return BucketContext Context for this BucketInstance + */ + protected function proxy(): BucketContext + { + if (!$this->context) { + $this->context = new BucketContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['rateLimitSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the BucketInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the BucketInstance + * + * @return BucketInstance Fetched BucketInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): BucketInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the BucketInstance + * + * @param array|Options $options Optional Arguments + * @return BucketInstance Updated BucketInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): BucketInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.BucketInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Verify/V2/Service/RateLimit/BucketList.php b/app/api/Twilio/Rest/Verify/V2/Service/RateLimit/BucketList.php new file mode 100755 index 0000000..fa8d51f --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/RateLimit/BucketList.php @@ -0,0 +1,205 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + 'rateLimitSid' => + $rateLimitSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/RateLimits/' . \rawurlencode($rateLimitSid) + .'/Buckets'; + } + + /** + * Create the BucketInstance + * + * @param int $max Maximum number of requests permitted in during the interval. + * @param int $interval Number of seconds that the rate limit will be enforced over. + * @return BucketInstance Created BucketInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(int $max, int $interval): BucketInstance + { + + $data = Values::of([ + 'Max' => + $max, + 'Interval' => + $interval, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new BucketInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['rateLimitSid'] + ); + } + + + /** + * Reads BucketInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return BucketInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams BucketInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of BucketInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return BucketPage Page of BucketInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): BucketPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new BucketPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of BucketInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return BucketPage Page of BucketInstance + */ + public function getPage(string $targetUrl): BucketPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new BucketPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a BucketContext + * + * @param string $sid A 34 character string that uniquely identifies this Bucket. + */ + public function getContext( + string $sid + + ): BucketContext + { + return new BucketContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['rateLimitSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.BucketList]'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/Service/RateLimit/BucketOptions.php b/app/api/Twilio/Rest/Verify/V2/Service/RateLimit/BucketOptions.php new file mode 100755 index 0000000..b2826c1 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/RateLimit/BucketOptions.php @@ -0,0 +1,102 @@ +options['max'] = $max; + $this->options['interval'] = $interval; + } + + /** + * Maximum number of requests permitted in during the interval. + * + * @param int $max Maximum number of requests permitted in during the interval. + * @return $this Fluent Builder + */ + public function setMax(int $max): self + { + $this->options['max'] = $max; + return $this; + } + + /** + * Number of seconds that the rate limit will be enforced over. + * + * @param int $interval Number of seconds that the rate limit will be enforced over. + * @return $this Fluent Builder + */ + public function setInterval(int $interval): self + { + $this->options['interval'] = $interval; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Verify.V2.UpdateBucketOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Verify/V2/Service/RateLimit/BucketPage.php b/app/api/Twilio/Rest/Verify/V2/Service/RateLimit/BucketPage.php new file mode 100755 index 0000000..9d760a2 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/RateLimit/BucketPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return BucketInstance \Twilio\Rest\Verify\V2\Service\RateLimit\BucketInstance + */ + public function buildInstance(array $payload): BucketInstance + { + return new BucketInstance($this->version, $payload, $this->solution['serviceSid'], $this->solution['rateLimitSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.BucketPage]'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/Service/RateLimitContext.php b/app/api/Twilio/Rest/Verify/V2/Service/RateLimitContext.php new file mode 100755 index 0000000..ad9954b --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/RateLimitContext.php @@ -0,0 +1,189 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/RateLimits/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the RateLimitInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the RateLimitInstance + * + * @return RateLimitInstance Fetched RateLimitInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RateLimitInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new RateLimitInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the RateLimitInstance + * + * @param array|Options $options Optional Arguments + * @return RateLimitInstance Updated RateLimitInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): RateLimitInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Description' => + $options['description'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new RateLimitInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the buckets + */ + protected function getBuckets(): BucketList + { + if (!$this->_buckets) { + $this->_buckets = new BucketList( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->_buckets; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.RateLimitContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/Service/RateLimitInstance.php b/app/api/Twilio/Rest/Verify/V2/Service/RateLimitInstance.php new file mode 100755 index 0000000..a032814 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/RateLimitInstance.php @@ -0,0 +1,171 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'description' => Values::array_get($payload, 'description'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return RateLimitContext Context for this RateLimitInstance + */ + protected function proxy(): RateLimitContext + { + if (!$this->context) { + $this->context = new RateLimitContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the RateLimitInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the RateLimitInstance + * + * @return RateLimitInstance Fetched RateLimitInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RateLimitInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the RateLimitInstance + * + * @param array|Options $options Optional Arguments + * @return RateLimitInstance Updated RateLimitInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): RateLimitInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the buckets + */ + protected function getBuckets(): BucketList + { + return $this->proxy()->buckets; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.RateLimitInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Verify/V2/Service/RateLimitList.php b/app/api/Twilio/Rest/Verify/V2/Service/RateLimitList.php new file mode 100755 index 0000000..3c89057 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/RateLimitList.php @@ -0,0 +1,200 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/RateLimits'; + } + + /** + * Create the RateLimitInstance + * + * @param string $uniqueName Provides a unique and addressable name to be assigned to this Rate Limit, assigned by the developer, to be optionally used in addition to SID. **This value should not contain PII.** + * @param array|Options $options Optional Arguments + * @return RateLimitInstance Created RateLimitInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $uniqueName, array $options = []): RateLimitInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $uniqueName, + 'Description' => + $options['description'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new RateLimitInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads RateLimitInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return RateLimitInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams RateLimitInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of RateLimitInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return RateLimitPage Page of RateLimitInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): RateLimitPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new RateLimitPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of RateLimitInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return RateLimitPage Page of RateLimitInstance + */ + public function getPage(string $targetUrl): RateLimitPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new RateLimitPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a RateLimitContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Rate Limit resource to fetch. + */ + public function getContext( + string $sid + + ): RateLimitContext + { + return new RateLimitContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.RateLimitList]'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/Service/RateLimitOptions.php b/app/api/Twilio/Rest/Verify/V2/Service/RateLimitOptions.php new file mode 100755 index 0000000..803da54 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/RateLimitOptions.php @@ -0,0 +1,134 @@ +options['description'] = $description; + } + + /** + * Description of this Rate Limit + * + * @param string $description Description of this Rate Limit + * @return $this Fluent Builder + */ + public function setDescription(string $description): self + { + $this->options['description'] = $description; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Verify.V2.CreateRateLimitOptions ' . $options . ']'; + } +} + + + + +class UpdateRateLimitOptions extends Options + { + /** + * @param string $description Description of this Rate Limit + */ + public function __construct( + + string $description = Values::NONE + + ) { + $this->options['description'] = $description; + } + + /** + * Description of this Rate Limit + * + * @param string $description Description of this Rate Limit + * @return $this Fluent Builder + */ + public function setDescription(string $description): self + { + $this->options['description'] = $description; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Verify.V2.UpdateRateLimitOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Verify/V2/Service/RateLimitPage.php b/app/api/Twilio/Rest/Verify/V2/Service/RateLimitPage.php new file mode 100755 index 0000000..15e1ab1 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/RateLimitPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RateLimitInstance \Twilio\Rest\Verify\V2\Service\RateLimitInstance + */ + public function buildInstance(array $payload): RateLimitInstance + { + return new RateLimitInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.RateLimitPage]'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/Service/VerificationCheckInstance.php b/app/api/Twilio/Rest/Verify/V2/Service/VerificationCheckInstance.php new file mode 100755 index 0000000..f3ac0a7 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/VerificationCheckInstance.php @@ -0,0 +1,104 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'to' => Values::array_get($payload, 'to'), + 'channel' => Values::array_get($payload, 'channel'), + 'status' => Values::array_get($payload, 'status'), + 'valid' => Values::array_get($payload, 'valid'), + 'amount' => Values::array_get($payload, 'amount'), + 'payee' => Values::array_get($payload, 'payee'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'snaAttemptsErrorCodes' => Values::array_get($payload, 'sna_attempts_error_codes'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.VerificationCheckInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Verify/V2/Service/VerificationCheckList.php b/app/api/Twilio/Rest/Verify/V2/Service/VerificationCheckList.php new file mode 100755 index 0000000..eab513e --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/VerificationCheckList.php @@ -0,0 +1,95 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/VerificationCheck'; + } + + /** + * Create the VerificationCheckInstance + * + * @param array|Options $options Optional Arguments + * @return VerificationCheckInstance Created VerificationCheckInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): VerificationCheckInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Code' => + $options['code'], + 'To' => + $options['to'], + 'VerificationSid' => + $options['verificationSid'], + 'Amount' => + $options['amount'], + 'Payee' => + $options['payee'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new VerificationCheckInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.VerificationCheckList]'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/Service/VerificationCheckOptions.php b/app/api/Twilio/Rest/Verify/V2/Service/VerificationCheckOptions.php new file mode 100755 index 0000000..3e2d99b --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/VerificationCheckOptions.php @@ -0,0 +1,148 @@ +options['code'] = $code; + $this->options['to'] = $to; + $this->options['verificationSid'] = $verificationSid; + $this->options['amount'] = $amount; + $this->options['payee'] = $payee; + } + + /** + * The 4-10 character string being verified. + * + * @param string $code The 4-10 character string being verified. + * @return $this Fluent Builder + */ + public function setCode(string $code): self + { + $this->options['code'] = $code; + return $this; + } + + /** + * The phone number or [email](https://www.twilio.com/docs/verify/email) to verify. Either this parameter or the `verification_sid` must be specified. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). + * + * @param string $to The phone number or [email](https://www.twilio.com/docs/verify/email) to verify. Either this parameter or the `verification_sid` must be specified. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). + * @return $this Fluent Builder + */ + public function setTo(string $to): self + { + $this->options['to'] = $to; + return $this; + } + + /** + * A SID that uniquely identifies the Verification Check. Either this parameter or the `to` phone number/[email](https://www.twilio.com/docs/verify/email) must be specified. + * + * @param string $verificationSid A SID that uniquely identifies the Verification Check. Either this parameter or the `to` phone number/[email](https://www.twilio.com/docs/verify/email) must be specified. + * @return $this Fluent Builder + */ + public function setVerificationSid(string $verificationSid): self + { + $this->options['verificationSid'] = $verificationSid; + return $this; + } + + /** + * The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. + * + * @param string $amount The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. + * @return $this Fluent Builder + */ + public function setAmount(string $amount): self + { + $this->options['amount'] = $amount; + return $this; + } + + /** + * The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. + * + * @param string $payee The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. + * @return $this Fluent Builder + */ + public function setPayee(string $payee): self + { + $this->options['payee'] = $payee; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Verify.V2.CreateVerificationCheckOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Verify/V2/Service/VerificationCheckPage.php b/app/api/Twilio/Rest/Verify/V2/Service/VerificationCheckPage.php new file mode 100755 index 0000000..38d6c0d --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/VerificationCheckPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return VerificationCheckInstance \Twilio\Rest\Verify\V2\Service\VerificationCheckInstance + */ + public function buildInstance(array $payload): VerificationCheckInstance + { + return new VerificationCheckInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.VerificationCheckPage]'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/Service/VerificationContext.php b/app/api/Twilio/Rest/Verify/V2/Service/VerificationContext.php new file mode 100755 index 0000000..df4cd08 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/VerificationContext.php @@ -0,0 +1,114 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Verifications/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the VerificationInstance + * + * @return VerificationInstance Fetched VerificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): VerificationInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new VerificationInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the VerificationInstance + * + * @param string $status + * @return VerificationInstance Updated VerificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status): VerificationInstance + { + + $data = Values::of([ + 'Status' => + $status, + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new VerificationInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.VerificationContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/Service/VerificationInstance.php b/app/api/Twilio/Rest/Verify/V2/Service/VerificationInstance.php new file mode 100755 index 0000000..5563cc5 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/VerificationInstance.php @@ -0,0 +1,159 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'to' => Values::array_get($payload, 'to'), + 'channel' => Values::array_get($payload, 'channel'), + 'status' => Values::array_get($payload, 'status'), + 'valid' => Values::array_get($payload, 'valid'), + 'lookup' => Values::array_get($payload, 'lookup'), + 'amount' => Values::array_get($payload, 'amount'), + 'payee' => Values::array_get($payload, 'payee'), + 'sendCodeAttempts' => Values::array_get($payload, 'send_code_attempts'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'sna' => Values::array_get($payload, 'sna'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return VerificationContext Context for this VerificationInstance + */ + protected function proxy(): VerificationContext + { + if (!$this->context) { + $this->context = new VerificationContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the VerificationInstance + * + * @return VerificationInstance Fetched VerificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): VerificationInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the VerificationInstance + * + * @param string $status + * @return VerificationInstance Updated VerificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status): VerificationInstance + { + + return $this->proxy()->update($status); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.VerificationInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Verify/V2/Service/VerificationList.php b/app/api/Twilio/Rest/Verify/V2/Service/VerificationList.php new file mode 100755 index 0000000..4d90ee8 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/VerificationList.php @@ -0,0 +1,135 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Verifications'; + } + + /** + * Create the VerificationInstance + * + * @param string $to The phone number or [email](https://www.twilio.com/docs/verify/email) to verify. Phone numbers must be in [E.164 format](https://www.twilio.com/docs/glossary/what-e164). + * @param string $channel The verification method to use. One of: [`email`](https://www.twilio.com/docs/verify/email), `sms`, `whatsapp`, `call`, `sna` or `auto`. + * @param array|Options $options Optional Arguments + * @return VerificationInstance Created VerificationInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $to, string $channel, array $options = []): VerificationInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'To' => + $to, + 'Channel' => + $channel, + 'CustomFriendlyName' => + $options['customFriendlyName'], + 'CustomMessage' => + $options['customMessage'], + 'SendDigits' => + $options['sendDigits'], + 'Locale' => + $options['locale'], + 'CustomCode' => + $options['customCode'], + 'Amount' => + $options['amount'], + 'Payee' => + $options['payee'], + 'RateLimits' => + Serialize::jsonObject($options['rateLimits']), + 'ChannelConfiguration' => + Serialize::jsonObject($options['channelConfiguration']), + 'AppHash' => + $options['appHash'], + 'TemplateSid' => + $options['templateSid'], + 'TemplateCustomSubstitutions' => + $options['templateCustomSubstitutions'], + 'DeviceIp' => + $options['deviceIp'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new VerificationInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Constructs a VerificationContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Verification resource to fetch. + */ + public function getContext( + string $sid + + ): VerificationContext + { + return new VerificationContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.VerificationList]'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/Service/VerificationOptions.php b/app/api/Twilio/Rest/Verify/V2/Service/VerificationOptions.php new file mode 100755 index 0000000..b9575b4 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/VerificationOptions.php @@ -0,0 +1,296 @@ + Your AppName verification code is: 1234 He42w354ol9`. + * @param string $templateSid The message [template](https://www.twilio.com/docs/verify/api/templates). If provided, will override the default template for the Service. SMS and Voice channels only. + * @param string $templateCustomSubstitutions A stringified JSON object in which the keys are the template's special variables and the values are the variables substitutions. + * @param string $deviceIp Strongly encouraged if using the auto channel. The IP address of the client's device. If provided, it has to be a valid IPv4 or IPv6 address. + * @return CreateVerificationOptions Options builder + */ + public static function create( + + string $customFriendlyName = Values::NONE, + string $customMessage = Values::NONE, + string $sendDigits = Values::NONE, + string $locale = Values::NONE, + string $customCode = Values::NONE, + string $amount = Values::NONE, + string $payee = Values::NONE, + array $rateLimits = Values::ARRAY_NONE, + array $channelConfiguration = Values::ARRAY_NONE, + string $appHash = Values::NONE, + string $templateSid = Values::NONE, + string $templateCustomSubstitutions = Values::NONE, + string $deviceIp = Values::NONE + + ): CreateVerificationOptions + { + return new CreateVerificationOptions( + $customFriendlyName, + $customMessage, + $sendDigits, + $locale, + $customCode, + $amount, + $payee, + $rateLimits, + $channelConfiguration, + $appHash, + $templateSid, + $templateCustomSubstitutions, + $deviceIp + ); + } + + + +} + +class CreateVerificationOptions extends Options + { + /** + * @param string $customFriendlyName A custom user defined friendly name that overwrites the existing one in the verification message + * @param string $customMessage The text of a custom message to use for the verification. + * @param string $sendDigits The digits to send after a phone call is answered, for example, to dial an extension. For more information, see the Programmable Voice documentation of [sendDigits](https://www.twilio.com/docs/voice/twiml/number#attributes-sendDigits). + * @param string $locale Locale will automatically resolve based on phone number country code for SMS, WhatsApp, and call channel verifications. It will fallback to English or the template’s default translation if the selected translation is not available. This parameter will override the automatic locale resolution. [See supported languages and more information here](https://www.twilio.com/docs/verify/supported-languages). + * @param string $customCode A pre-generated code to use for verification. The code can be between 4 and 10 characters, inclusive. + * @param string $amount The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. + * @param string $payee The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. + * @param array $rateLimits The custom key-value pairs of Programmable Rate Limits. Keys correspond to `unique_name` fields defined when [creating your Rate Limit](https://www.twilio.com/docs/verify/api/service-rate-limits). Associated value pairs represent values in the request that you are rate limiting on. You may include multiple Rate Limit values in each request. + * @param array $channelConfiguration [`email`](https://www.twilio.com/docs/verify/email) channel configuration in json format. The fields 'from' and 'from_name' are optional but if included the 'from' field must have a valid email address. + * @param string $appHash Your [App Hash](https://developers.google.com/identity/sms-retriever/verify#computing_your_apps_hash_string) to be appended at the end of your verification SMS body. Applies only to SMS. Example SMS body: `<#> Your AppName verification code is: 1234 He42w354ol9`. + * @param string $templateSid The message [template](https://www.twilio.com/docs/verify/api/templates). If provided, will override the default template for the Service. SMS and Voice channels only. + * @param string $templateCustomSubstitutions A stringified JSON object in which the keys are the template's special variables and the values are the variables substitutions. + * @param string $deviceIp Strongly encouraged if using the auto channel. The IP address of the client's device. If provided, it has to be a valid IPv4 or IPv6 address. + */ + public function __construct( + + string $customFriendlyName = Values::NONE, + string $customMessage = Values::NONE, + string $sendDigits = Values::NONE, + string $locale = Values::NONE, + string $customCode = Values::NONE, + string $amount = Values::NONE, + string $payee = Values::NONE, + array $rateLimits = Values::ARRAY_NONE, + array $channelConfiguration = Values::ARRAY_NONE, + string $appHash = Values::NONE, + string $templateSid = Values::NONE, + string $templateCustomSubstitutions = Values::NONE, + string $deviceIp = Values::NONE + + ) { + $this->options['customFriendlyName'] = $customFriendlyName; + $this->options['customMessage'] = $customMessage; + $this->options['sendDigits'] = $sendDigits; + $this->options['locale'] = $locale; + $this->options['customCode'] = $customCode; + $this->options['amount'] = $amount; + $this->options['payee'] = $payee; + $this->options['rateLimits'] = $rateLimits; + $this->options['channelConfiguration'] = $channelConfiguration; + $this->options['appHash'] = $appHash; + $this->options['templateSid'] = $templateSid; + $this->options['templateCustomSubstitutions'] = $templateCustomSubstitutions; + $this->options['deviceIp'] = $deviceIp; + } + + /** + * A custom user defined friendly name that overwrites the existing one in the verification message + * + * @param string $customFriendlyName A custom user defined friendly name that overwrites the existing one in the verification message + * @return $this Fluent Builder + */ + public function setCustomFriendlyName(string $customFriendlyName): self + { + $this->options['customFriendlyName'] = $customFriendlyName; + return $this; + } + + /** + * The text of a custom message to use for the verification. + * + * @param string $customMessage The text of a custom message to use for the verification. + * @return $this Fluent Builder + */ + public function setCustomMessage(string $customMessage): self + { + $this->options['customMessage'] = $customMessage; + return $this; + } + + /** + * The digits to send after a phone call is answered, for example, to dial an extension. For more information, see the Programmable Voice documentation of [sendDigits](https://www.twilio.com/docs/voice/twiml/number#attributes-sendDigits). + * + * @param string $sendDigits The digits to send after a phone call is answered, for example, to dial an extension. For more information, see the Programmable Voice documentation of [sendDigits](https://www.twilio.com/docs/voice/twiml/number#attributes-sendDigits). + * @return $this Fluent Builder + */ + public function setSendDigits(string $sendDigits): self + { + $this->options['sendDigits'] = $sendDigits; + return $this; + } + + /** + * Locale will automatically resolve based on phone number country code for SMS, WhatsApp, and call channel verifications. It will fallback to English or the template’s default translation if the selected translation is not available. This parameter will override the automatic locale resolution. [See supported languages and more information here](https://www.twilio.com/docs/verify/supported-languages). + * + * @param string $locale Locale will automatically resolve based on phone number country code for SMS, WhatsApp, and call channel verifications. It will fallback to English or the template’s default translation if the selected translation is not available. This parameter will override the automatic locale resolution. [See supported languages and more information here](https://www.twilio.com/docs/verify/supported-languages). + * @return $this Fluent Builder + */ + public function setLocale(string $locale): self + { + $this->options['locale'] = $locale; + return $this; + } + + /** + * A pre-generated code to use for verification. The code can be between 4 and 10 characters, inclusive. + * + * @param string $customCode A pre-generated code to use for verification. The code can be between 4 and 10 characters, inclusive. + * @return $this Fluent Builder + */ + public function setCustomCode(string $customCode): self + { + $this->options['customCode'] = $customCode; + return $this; + } + + /** + * The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. + * + * @param string $amount The amount of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. + * @return $this Fluent Builder + */ + public function setAmount(string $amount): self + { + $this->options['amount'] = $amount; + return $this; + } + + /** + * The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. + * + * @param string $payee The payee of the associated PSD2 compliant transaction. Requires the PSD2 Service flag enabled. + * @return $this Fluent Builder + */ + public function setPayee(string $payee): self + { + $this->options['payee'] = $payee; + return $this; + } + + /** + * The custom key-value pairs of Programmable Rate Limits. Keys correspond to `unique_name` fields defined when [creating your Rate Limit](https://www.twilio.com/docs/verify/api/service-rate-limits). Associated value pairs represent values in the request that you are rate limiting on. You may include multiple Rate Limit values in each request. + * + * @param array $rateLimits The custom key-value pairs of Programmable Rate Limits. Keys correspond to `unique_name` fields defined when [creating your Rate Limit](https://www.twilio.com/docs/verify/api/service-rate-limits). Associated value pairs represent values in the request that you are rate limiting on. You may include multiple Rate Limit values in each request. + * @return $this Fluent Builder + */ + public function setRateLimits(array $rateLimits): self + { + $this->options['rateLimits'] = $rateLimits; + return $this; + } + + /** + * [`email`](https://www.twilio.com/docs/verify/email) channel configuration in json format. The fields 'from' and 'from_name' are optional but if included the 'from' field must have a valid email address. + * + * @param array $channelConfiguration [`email`](https://www.twilio.com/docs/verify/email) channel configuration in json format. The fields 'from' and 'from_name' are optional but if included the 'from' field must have a valid email address. + * @return $this Fluent Builder + */ + public function setChannelConfiguration(array $channelConfiguration): self + { + $this->options['channelConfiguration'] = $channelConfiguration; + return $this; + } + + /** + * Your [App Hash](https://developers.google.com/identity/sms-retriever/verify#computing_your_apps_hash_string) to be appended at the end of your verification SMS body. Applies only to SMS. Example SMS body: `<#> Your AppName verification code is: 1234 He42w354ol9`. + * + * @param string $appHash Your [App Hash](https://developers.google.com/identity/sms-retriever/verify#computing_your_apps_hash_string) to be appended at the end of your verification SMS body. Applies only to SMS. Example SMS body: `<#> Your AppName verification code is: 1234 He42w354ol9`. + * @return $this Fluent Builder + */ + public function setAppHash(string $appHash): self + { + $this->options['appHash'] = $appHash; + return $this; + } + + /** + * The message [template](https://www.twilio.com/docs/verify/api/templates). If provided, will override the default template for the Service. SMS and Voice channels only. + * + * @param string $templateSid The message [template](https://www.twilio.com/docs/verify/api/templates). If provided, will override the default template for the Service. SMS and Voice channels only. + * @return $this Fluent Builder + */ + public function setTemplateSid(string $templateSid): self + { + $this->options['templateSid'] = $templateSid; + return $this; + } + + /** + * A stringified JSON object in which the keys are the template's special variables and the values are the variables substitutions. + * + * @param string $templateCustomSubstitutions A stringified JSON object in which the keys are the template's special variables and the values are the variables substitutions. + * @return $this Fluent Builder + */ + public function setTemplateCustomSubstitutions(string $templateCustomSubstitutions): self + { + $this->options['templateCustomSubstitutions'] = $templateCustomSubstitutions; + return $this; + } + + /** + * Strongly encouraged if using the auto channel. The IP address of the client's device. If provided, it has to be a valid IPv4 or IPv6 address. + * + * @param string $deviceIp Strongly encouraged if using the auto channel. The IP address of the client's device. If provided, it has to be a valid IPv4 or IPv6 address. + * @return $this Fluent Builder + */ + public function setDeviceIp(string $deviceIp): self + { + $this->options['deviceIp'] = $deviceIp; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Verify.V2.CreateVerificationOptions ' . $options . ']'; + } +} + + + diff --git a/app/api/Twilio/Rest/Verify/V2/Service/VerificationPage.php b/app/api/Twilio/Rest/Verify/V2/Service/VerificationPage.php new file mode 100755 index 0000000..7c978f8 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/VerificationPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return VerificationInstance \Twilio\Rest\Verify\V2\Service\VerificationInstance + */ + public function buildInstance(array $payload): VerificationInstance + { + return new VerificationInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.VerificationPage]'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/Service/WebhookContext.php b/app/api/Twilio/Rest/Verify/V2/Service/WebhookContext.php new file mode 100755 index 0000000..d4447bf --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/WebhookContext.php @@ -0,0 +1,139 @@ +solution = [ + 'serviceSid' => + $serviceSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Webhooks/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the WebhookInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the WebhookInstance + * + * @return WebhookInstance Fetched WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WebhookInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new WebhookInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the WebhookInstance + * + * @param array|Options $options Optional Arguments + * @return WebhookInstance Updated WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WebhookInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'EventTypes' => + Serialize::map($options['eventTypes'], function ($e) { return $e; }), + 'WebhookUrl' => + $options['webhookUrl'], + 'Status' => + $options['status'], + 'Version' => + $options['version'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new WebhookInstance( + $this->version, + $payload, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.WebhookContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/Service/WebhookInstance.php b/app/api/Twilio/Rest/Verify/V2/Service/WebhookInstance.php new file mode 100755 index 0000000..dd9e1ee --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/WebhookInstance.php @@ -0,0 +1,166 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'eventTypes' => Values::array_get($payload, 'event_types'), + 'status' => Values::array_get($payload, 'status'), + 'version' => Values::array_get($payload, 'version'), + 'webhookUrl' => Values::array_get($payload, 'webhook_url'), + 'webhookMethod' => Values::array_get($payload, 'webhook_method'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['serviceSid' => $serviceSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return WebhookContext Context for this WebhookInstance + */ + protected function proxy(): WebhookContext + { + if (!$this->context) { + $this->context = new WebhookContext( + $this->version, + $this->solution['serviceSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the WebhookInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the WebhookInstance + * + * @return WebhookInstance Fetched WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): WebhookInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the WebhookInstance + * + * @param array|Options $options Optional Arguments + * @return WebhookInstance Updated WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): WebhookInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.WebhookInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Verify/V2/Service/WebhookList.php b/app/api/Twilio/Rest/Verify/V2/Service/WebhookList.php new file mode 100755 index 0000000..e19ec0a --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/WebhookList.php @@ -0,0 +1,209 @@ +solution = [ + 'serviceSid' => + $serviceSid, + + ]; + + $this->uri = '/Services/' . \rawurlencode($serviceSid) + .'/Webhooks'; + } + + /** + * Create the WebhookInstance + * + * @param string $friendlyName The string that you assigned to describe the webhook. **This value should not contain PII.** + * @param string[] $eventTypes The array of events that this Webhook is subscribed to. Possible event types: `*, factor.deleted, factor.created, factor.verified, challenge.approved, challenge.denied` + * @param string $webhookUrl The URL associated with this Webhook. + * @param array|Options $options Optional Arguments + * @return WebhookInstance Created WebhookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, array $eventTypes, string $webhookUrl, array $options = []): WebhookInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'EventTypes' => + Serialize::map($eventTypes,function ($e) { return $e; }), + 'WebhookUrl' => + $webhookUrl, + 'Status' => + $options['status'], + 'Version' => + $options['version'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new WebhookInstance( + $this->version, + $payload, + $this->solution['serviceSid'] + ); + } + + + /** + * Reads WebhookInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return WebhookInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams WebhookInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of WebhookInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return WebhookPage Page of WebhookInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): WebhookPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new WebhookPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of WebhookInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return WebhookPage Page of WebhookInstance + */ + public function getPage(string $targetUrl): WebhookPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new WebhookPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a WebhookContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Webhook resource to delete. + */ + public function getContext( + string $sid + + ): WebhookContext + { + return new WebhookContext( + $this->version, + $this->solution['serviceSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.WebhookList]'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/Service/WebhookOptions.php b/app/api/Twilio/Rest/Verify/V2/Service/WebhookOptions.php new file mode 100755 index 0000000..8cb8d54 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/WebhookOptions.php @@ -0,0 +1,216 @@ +options['status'] = $status; + $this->options['version'] = $version; + } + + /** + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * @param string $version + * @return $this Fluent Builder + */ + public function setVersion(string $version): self + { + $this->options['version'] = $version; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Verify.V2.CreateWebhookOptions ' . $options . ']'; + } +} + + + + +class UpdateWebhookOptions extends Options + { + /** + * @param string $friendlyName The string that you assigned to describe the webhook. **This value should not contain PII.** + * @param string[] $eventTypes The array of events that this Webhook is subscribed to. Possible event types: `*, factor.deleted, factor.created, factor.verified, challenge.approved, challenge.denied` + * @param string $webhookUrl The URL associated with this Webhook. + * @param string $status + * @param string $version + */ + public function __construct( + + string $friendlyName = Values::NONE, + array $eventTypes = Values::ARRAY_NONE, + string $webhookUrl = Values::NONE, + string $status = Values::NONE, + string $version = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['eventTypes'] = $eventTypes; + $this->options['webhookUrl'] = $webhookUrl; + $this->options['status'] = $status; + $this->options['version'] = $version; + } + + /** + * The string that you assigned to describe the webhook. **This value should not contain PII.** + * + * @param string $friendlyName The string that you assigned to describe the webhook. **This value should not contain PII.** + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The array of events that this Webhook is subscribed to. Possible event types: `*, factor.deleted, factor.created, factor.verified, challenge.approved, challenge.denied` + * + * @param string[] $eventTypes The array of events that this Webhook is subscribed to. Possible event types: `*, factor.deleted, factor.created, factor.verified, challenge.approved, challenge.denied` + * @return $this Fluent Builder + */ + public function setEventTypes(array $eventTypes): self + { + $this->options['eventTypes'] = $eventTypes; + return $this; + } + + /** + * The URL associated with this Webhook. + * + * @param string $webhookUrl The URL associated with this Webhook. + * @return $this Fluent Builder + */ + public function setWebhookUrl(string $webhookUrl): self + { + $this->options['webhookUrl'] = $webhookUrl; + return $this; + } + + /** + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * @param string $version + * @return $this Fluent Builder + */ + public function setVersion(string $version): self + { + $this->options['version'] = $version; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Verify.V2.UpdateWebhookOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Verify/V2/Service/WebhookPage.php b/app/api/Twilio/Rest/Verify/V2/Service/WebhookPage.php new file mode 100755 index 0000000..4ec0c53 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/Service/WebhookPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return WebhookInstance \Twilio\Rest\Verify\V2\Service\WebhookInstance + */ + public function buildInstance(array $payload): WebhookInstance + { + return new WebhookInstance($this->version, $payload, $this->solution['serviceSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.WebhookPage]'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/ServiceContext.php b/app/api/Twilio/Rest/Verify/V2/ServiceContext.php new file mode 100755 index 0000000..93114a7 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/ServiceContext.php @@ -0,0 +1,327 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Services/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'CodeLength' => + $options['codeLength'], + 'LookupEnabled' => + Serialize::booleanToString($options['lookupEnabled']), + 'SkipSmsToLandlines' => + Serialize::booleanToString($options['skipSmsToLandlines']), + 'DtmfInputRequired' => + Serialize::booleanToString($options['dtmfInputRequired']), + 'TtsName' => + $options['ttsName'], + 'Psd2Enabled' => + Serialize::booleanToString($options['psd2Enabled']), + 'DoNotShareWarningEnabled' => + Serialize::booleanToString($options['doNotShareWarningEnabled']), + 'CustomCodeEnabled' => + Serialize::booleanToString($options['customCodeEnabled']), + 'Push.IncludeDate' => + Serialize::booleanToString($options['pushIncludeDate']), + 'Push.ApnCredentialSid' => + $options['pushApnCredentialSid'], + 'Push.FcmCredentialSid' => + $options['pushFcmCredentialSid'], + 'Totp.Issuer' => + $options['totpIssuer'], + 'Totp.TimeStep' => + $options['totpTimeStep'], + 'Totp.CodeLength' => + $options['totpCodeLength'], + 'Totp.Skew' => + $options['totpSkew'], + 'DefaultTemplateSid' => + $options['defaultTemplateSid'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new ServiceInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the entities + */ + protected function getEntities(): EntityList + { + if (!$this->_entities) { + $this->_entities = new EntityList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_entities; + } + + /** + * Access the verificationChecks + */ + protected function getVerificationChecks(): VerificationCheckList + { + if (!$this->_verificationChecks) { + $this->_verificationChecks = new VerificationCheckList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_verificationChecks; + } + + /** + * Access the verifications + */ + protected function getVerifications(): VerificationList + { + if (!$this->_verifications) { + $this->_verifications = new VerificationList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_verifications; + } + + /** + * Access the accessTokens + */ + protected function getAccessTokens(): AccessTokenList + { + if (!$this->_accessTokens) { + $this->_accessTokens = new AccessTokenList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_accessTokens; + } + + /** + * Access the rateLimits + */ + protected function getRateLimits(): RateLimitList + { + if (!$this->_rateLimits) { + $this->_rateLimits = new RateLimitList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_rateLimits; + } + + /** + * Access the webhooks + */ + protected function getWebhooks(): WebhookList + { + if (!$this->_webhooks) { + $this->_webhooks = new WebhookList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_webhooks; + } + + /** + * Access the messagingConfigurations + */ + protected function getMessagingConfigurations(): MessagingConfigurationList + { + if (!$this->_messagingConfigurations) { + $this->_messagingConfigurations = new MessagingConfigurationList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_messagingConfigurations; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.ServiceContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/ServiceInstance.php b/app/api/Twilio/Rest/Verify/V2/ServiceInstance.php new file mode 100755 index 0000000..59cc921 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/ServiceInstance.php @@ -0,0 +1,247 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'codeLength' => Values::array_get($payload, 'code_length'), + 'lookupEnabled' => Values::array_get($payload, 'lookup_enabled'), + 'psd2Enabled' => Values::array_get($payload, 'psd2_enabled'), + 'skipSmsToLandlines' => Values::array_get($payload, 'skip_sms_to_landlines'), + 'dtmfInputRequired' => Values::array_get($payload, 'dtmf_input_required'), + 'ttsName' => Values::array_get($payload, 'tts_name'), + 'doNotShareWarningEnabled' => Values::array_get($payload, 'do_not_share_warning_enabled'), + 'customCodeEnabled' => Values::array_get($payload, 'custom_code_enabled'), + 'push' => Values::array_get($payload, 'push'), + 'totp' => Values::array_get($payload, 'totp'), + 'defaultTemplateSid' => Values::array_get($payload, 'default_template_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ServiceContext Context for this ServiceInstance + */ + protected function proxy(): ServiceContext + { + if (!$this->context) { + $this->context = new ServiceContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ServiceInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ServiceInstance + * + * @return ServiceInstance Fetched ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ServiceInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ServiceInstance + * + * @param array|Options $options Optional Arguments + * @return ServiceInstance Updated ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ServiceInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the entities + */ + protected function getEntities(): EntityList + { + return $this->proxy()->entities; + } + + /** + * Access the verificationChecks + */ + protected function getVerificationChecks(): VerificationCheckList + { + return $this->proxy()->verificationChecks; + } + + /** + * Access the verifications + */ + protected function getVerifications(): VerificationList + { + return $this->proxy()->verifications; + } + + /** + * Access the accessTokens + */ + protected function getAccessTokens(): AccessTokenList + { + return $this->proxy()->accessTokens; + } + + /** + * Access the rateLimits + */ + protected function getRateLimits(): RateLimitList + { + return $this->proxy()->rateLimits; + } + + /** + * Access the webhooks + */ + protected function getWebhooks(): WebhookList + { + return $this->proxy()->webhooks; + } + + /** + * Access the messagingConfigurations + */ + protected function getMessagingConfigurations(): MessagingConfigurationList + { + return $this->proxy()->messagingConfigurations; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.ServiceInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Verify/V2/ServiceList.php b/app/api/Twilio/Rest/Verify/V2/ServiceList.php new file mode 100755 index 0000000..3367c75 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/ServiceList.php @@ -0,0 +1,223 @@ +solution = [ + ]; + + $this->uri = '/Services'; + } + + /** + * Create the ServiceInstance + * + * @param string $friendlyName A descriptive string that you create to describe the verification service. It can be up to 30 characters long. **This value should not contain PII.** + * @param array|Options $options Optional Arguments + * @return ServiceInstance Created ServiceInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, array $options = []): ServiceInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'CodeLength' => + $options['codeLength'], + 'LookupEnabled' => + Serialize::booleanToString($options['lookupEnabled']), + 'SkipSmsToLandlines' => + Serialize::booleanToString($options['skipSmsToLandlines']), + 'DtmfInputRequired' => + Serialize::booleanToString($options['dtmfInputRequired']), + 'TtsName' => + $options['ttsName'], + 'Psd2Enabled' => + Serialize::booleanToString($options['psd2Enabled']), + 'DoNotShareWarningEnabled' => + Serialize::booleanToString($options['doNotShareWarningEnabled']), + 'CustomCodeEnabled' => + Serialize::booleanToString($options['customCodeEnabled']), + 'Push.IncludeDate' => + Serialize::booleanToString($options['pushIncludeDate']), + 'Push.ApnCredentialSid' => + $options['pushApnCredentialSid'], + 'Push.FcmCredentialSid' => + $options['pushFcmCredentialSid'], + 'Totp.Issuer' => + $options['totpIssuer'], + 'Totp.TimeStep' => + $options['totpTimeStep'], + 'Totp.CodeLength' => + $options['totpCodeLength'], + 'Totp.Skew' => + $options['totpSkew'], + 'DefaultTemplateSid' => + $options['defaultTemplateSid'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new ServiceInstance( + $this->version, + $payload + ); + } + + + /** + * Reads ServiceInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ServiceInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ServiceInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ServiceInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ServicePage Page of ServiceInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ServicePage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ServicePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ServiceInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ServicePage Page of ServiceInstance + */ + public function getPage(string $targetUrl): ServicePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ServicePage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ServiceContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the Verification Service resource to delete. + */ + public function getContext( + string $sid + + ): ServiceContext + { + return new ServiceContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.ServiceList]'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/ServiceOptions.php b/app/api/Twilio/Rest/Verify/V2/ServiceOptions.php new file mode 100755 index 0000000..b410aa8 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/ServiceOptions.php @@ -0,0 +1,692 @@ +options['codeLength'] = $codeLength; + $this->options['lookupEnabled'] = $lookupEnabled; + $this->options['skipSmsToLandlines'] = $skipSmsToLandlines; + $this->options['dtmfInputRequired'] = $dtmfInputRequired; + $this->options['ttsName'] = $ttsName; + $this->options['psd2Enabled'] = $psd2Enabled; + $this->options['doNotShareWarningEnabled'] = $doNotShareWarningEnabled; + $this->options['customCodeEnabled'] = $customCodeEnabled; + $this->options['pushIncludeDate'] = $pushIncludeDate; + $this->options['pushApnCredentialSid'] = $pushApnCredentialSid; + $this->options['pushFcmCredentialSid'] = $pushFcmCredentialSid; + $this->options['totpIssuer'] = $totpIssuer; + $this->options['totpTimeStep'] = $totpTimeStep; + $this->options['totpCodeLength'] = $totpCodeLength; + $this->options['totpSkew'] = $totpSkew; + $this->options['defaultTemplateSid'] = $defaultTemplateSid; + } + + /** + * The length of the verification code to generate. Must be an integer value between 4 and 10, inclusive. + * + * @param int $codeLength The length of the verification code to generate. Must be an integer value between 4 and 10, inclusive. + * @return $this Fluent Builder + */ + public function setCodeLength(int $codeLength): self + { + $this->options['codeLength'] = $codeLength; + return $this; + } + + /** + * Whether to perform a lookup with each verification started and return info about the phone number. + * + * @param bool $lookupEnabled Whether to perform a lookup with each verification started and return info about the phone number. + * @return $this Fluent Builder + */ + public function setLookupEnabled(bool $lookupEnabled): self + { + $this->options['lookupEnabled'] = $lookupEnabled; + return $this; + } + + /** + * Whether to skip sending SMS verifications to landlines. Requires `lookup_enabled`. + * + * @param bool $skipSmsToLandlines Whether to skip sending SMS verifications to landlines. Requires `lookup_enabled`. + * @return $this Fluent Builder + */ + public function setSkipSmsToLandlines(bool $skipSmsToLandlines): self + { + $this->options['skipSmsToLandlines'] = $skipSmsToLandlines; + return $this; + } + + /** + * Whether to ask the user to press a number before delivering the verify code in a phone call. + * + * @param bool $dtmfInputRequired Whether to ask the user to press a number before delivering the verify code in a phone call. + * @return $this Fluent Builder + */ + public function setDtmfInputRequired(bool $dtmfInputRequired): self + { + $this->options['dtmfInputRequired'] = $dtmfInputRequired; + return $this; + } + + /** + * The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages. + * + * @param string $ttsName The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages. + * @return $this Fluent Builder + */ + public function setTtsName(string $ttsName): self + { + $this->options['ttsName'] = $ttsName; + return $this; + } + + /** + * Whether to pass PSD2 transaction parameters when starting a verification. + * + * @param bool $psd2Enabled Whether to pass PSD2 transaction parameters when starting a verification. + * @return $this Fluent Builder + */ + public function setPsd2Enabled(bool $psd2Enabled): self + { + $this->options['psd2Enabled'] = $psd2Enabled; + return $this; + } + + /** + * Whether to add a security warning at the end of an SMS verification body. Disabled by default and applies only to SMS. Example SMS body: `Your AppName verification code is: 1234. Don’t share this code with anyone; our employees will never ask for the code` + * + * @param bool $doNotShareWarningEnabled Whether to add a security warning at the end of an SMS verification body. Disabled by default and applies only to SMS. Example SMS body: `Your AppName verification code is: 1234. Don’t share this code with anyone; our employees will never ask for the code` + * @return $this Fluent Builder + */ + public function setDoNotShareWarningEnabled(bool $doNotShareWarningEnabled): self + { + $this->options['doNotShareWarningEnabled'] = $doNotShareWarningEnabled; + return $this; + } + + /** + * Whether to allow sending verifications with a custom code instead of a randomly generated one. Not available for all customers. + * + * @param bool $customCodeEnabled Whether to allow sending verifications with a custom code instead of a randomly generated one. Not available for all customers. + * @return $this Fluent Builder + */ + public function setCustomCodeEnabled(bool $customCodeEnabled): self + { + $this->options['customCodeEnabled'] = $customCodeEnabled; + return $this; + } + + /** + * Optional configuration for the Push factors. If true, include the date in the Challenge's response. Otherwise, the date is omitted from the response. See [Challenge](https://www.twilio.com/docs/verify/api/challenge) resource’s details parameter for more info. Default: false. **Deprecated** do not use this parameter. This timestamp value is the same one as the one found in `date_created`, please use that one instead. + * + * @param bool $pushIncludeDate Optional configuration for the Push factors. If true, include the date in the Challenge's response. Otherwise, the date is omitted from the response. See [Challenge](https://www.twilio.com/docs/verify/api/challenge) resource’s details parameter for more info. Default: false. **Deprecated** do not use this parameter. This timestamp value is the same one as the one found in `date_created`, please use that one instead. + * @return $this Fluent Builder + */ + public function setPushIncludeDate(bool $pushIncludeDate): self + { + $this->options['pushIncludeDate'] = $pushIncludeDate; + return $this; + } + + /** + * Optional configuration for the Push factors. Set the APN Credential for this service. This will allow to send push notifications to iOS devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) + * + * @param string $pushApnCredentialSid Optional configuration for the Push factors. Set the APN Credential for this service. This will allow to send push notifications to iOS devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) + * @return $this Fluent Builder + */ + public function setPushApnCredentialSid(string $pushApnCredentialSid): self + { + $this->options['pushApnCredentialSid'] = $pushApnCredentialSid; + return $this; + } + + /** + * Optional configuration for the Push factors. Set the FCM Credential for this service. This will allow to send push notifications to Android devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) + * + * @param string $pushFcmCredentialSid Optional configuration for the Push factors. Set the FCM Credential for this service. This will allow to send push notifications to Android devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) + * @return $this Fluent Builder + */ + public function setPushFcmCredentialSid(string $pushFcmCredentialSid): self + { + $this->options['pushFcmCredentialSid'] = $pushFcmCredentialSid; + return $this; + } + + /** + * Optional configuration for the TOTP factors. Set TOTP Issuer for this service. This will allow to configure the issuer of the TOTP URI. Defaults to the service friendly name if not provided. + * + * @param string $totpIssuer Optional configuration for the TOTP factors. Set TOTP Issuer for this service. This will allow to configure the issuer of the TOTP URI. Defaults to the service friendly name if not provided. + * @return $this Fluent Builder + */ + public function setTotpIssuer(string $totpIssuer): self + { + $this->options['totpIssuer'] = $totpIssuer; + return $this; + } + + /** + * Optional configuration for the TOTP factors. Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. Defaults to 30 seconds + * + * @param int $totpTimeStep Optional configuration for the TOTP factors. Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. Defaults to 30 seconds + * @return $this Fluent Builder + */ + public function setTotpTimeStep(int $totpTimeStep): self + { + $this->options['totpTimeStep'] = $totpTimeStep; + return $this; + } + + /** + * Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 + * + * @param int $totpCodeLength Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 + * @return $this Fluent Builder + */ + public function setTotpCodeLength(int $totpCodeLength): self + { + $this->options['totpCodeLength'] = $totpCodeLength; + return $this; + } + + /** + * Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 + * + * @param int $totpSkew Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 + * @return $this Fluent Builder + */ + public function setTotpSkew(int $totpSkew): self + { + $this->options['totpSkew'] = $totpSkew; + return $this; + } + + /** + * The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. + * + * @param string $defaultTemplateSid The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. + * @return $this Fluent Builder + */ + public function setDefaultTemplateSid(string $defaultTemplateSid): self + { + $this->options['defaultTemplateSid'] = $defaultTemplateSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Verify.V2.CreateServiceOptions ' . $options . ']'; + } +} + + + + +class UpdateServiceOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the verification service. It can be up to 30 characters long. **This value should not contain PII.** + * @param int $codeLength The length of the verification code to generate. Must be an integer value between 4 and 10, inclusive. + * @param bool $lookupEnabled Whether to perform a lookup with each verification started and return info about the phone number. + * @param bool $skipSmsToLandlines Whether to skip sending SMS verifications to landlines. Requires `lookup_enabled`. + * @param bool $dtmfInputRequired Whether to ask the user to press a number before delivering the verify code in a phone call. + * @param string $ttsName The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages. + * @param bool $psd2Enabled Whether to pass PSD2 transaction parameters when starting a verification. + * @param bool $doNotShareWarningEnabled Whether to add a privacy warning at the end of an SMS. **Disabled by default and applies only for SMS.** + * @param bool $customCodeEnabled Whether to allow sending verifications with a custom code instead of a randomly generated one. Not available for all customers. + * @param bool $pushIncludeDate Optional configuration for the Push factors. If true, include the date in the Challenge's response. Otherwise, the date is omitted from the response. See [Challenge](https://www.twilio.com/docs/verify/api/challenge) resource’s details parameter for more info. Default: false. **Deprecated** do not use this parameter. + * @param string $pushApnCredentialSid Optional configuration for the Push factors. Set the APN Credential for this service. This will allow to send push notifications to iOS devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) + * @param string $pushFcmCredentialSid Optional configuration for the Push factors. Set the FCM Credential for this service. This will allow to send push notifications to Android devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) + * @param string $totpIssuer Optional configuration for the TOTP factors. Set TOTP Issuer for this service. This will allow to configure the issuer of the TOTP URI. + * @param int $totpTimeStep Optional configuration for the TOTP factors. Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. Defaults to 30 seconds + * @param int $totpCodeLength Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 + * @param int $totpSkew Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 + * @param string $defaultTemplateSid The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. + */ + public function __construct( + + string $friendlyName = Values::NONE, + int $codeLength = Values::INT_NONE, + bool $lookupEnabled = Values::BOOL_NONE, + bool $skipSmsToLandlines = Values::BOOL_NONE, + bool $dtmfInputRequired = Values::BOOL_NONE, + string $ttsName = Values::NONE, + bool $psd2Enabled = Values::BOOL_NONE, + bool $doNotShareWarningEnabled = Values::BOOL_NONE, + bool $customCodeEnabled = Values::BOOL_NONE, + bool $pushIncludeDate = Values::BOOL_NONE, + string $pushApnCredentialSid = Values::NONE, + string $pushFcmCredentialSid = Values::NONE, + string $totpIssuer = Values::NONE, + int $totpTimeStep = Values::INT_NONE, + int $totpCodeLength = Values::INT_NONE, + int $totpSkew = Values::INT_NONE, + string $defaultTemplateSid = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['codeLength'] = $codeLength; + $this->options['lookupEnabled'] = $lookupEnabled; + $this->options['skipSmsToLandlines'] = $skipSmsToLandlines; + $this->options['dtmfInputRequired'] = $dtmfInputRequired; + $this->options['ttsName'] = $ttsName; + $this->options['psd2Enabled'] = $psd2Enabled; + $this->options['doNotShareWarningEnabled'] = $doNotShareWarningEnabled; + $this->options['customCodeEnabled'] = $customCodeEnabled; + $this->options['pushIncludeDate'] = $pushIncludeDate; + $this->options['pushApnCredentialSid'] = $pushApnCredentialSid; + $this->options['pushFcmCredentialSid'] = $pushFcmCredentialSid; + $this->options['totpIssuer'] = $totpIssuer; + $this->options['totpTimeStep'] = $totpTimeStep; + $this->options['totpCodeLength'] = $totpCodeLength; + $this->options['totpSkew'] = $totpSkew; + $this->options['defaultTemplateSid'] = $defaultTemplateSid; + } + + /** + * A descriptive string that you create to describe the verification service. It can be up to 30 characters long. **This value should not contain PII.** + * + * @param string $friendlyName A descriptive string that you create to describe the verification service. It can be up to 30 characters long. **This value should not contain PII.** + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The length of the verification code to generate. Must be an integer value between 4 and 10, inclusive. + * + * @param int $codeLength The length of the verification code to generate. Must be an integer value between 4 and 10, inclusive. + * @return $this Fluent Builder + */ + public function setCodeLength(int $codeLength): self + { + $this->options['codeLength'] = $codeLength; + return $this; + } + + /** + * Whether to perform a lookup with each verification started and return info about the phone number. + * + * @param bool $lookupEnabled Whether to perform a lookup with each verification started and return info about the phone number. + * @return $this Fluent Builder + */ + public function setLookupEnabled(bool $lookupEnabled): self + { + $this->options['lookupEnabled'] = $lookupEnabled; + return $this; + } + + /** + * Whether to skip sending SMS verifications to landlines. Requires `lookup_enabled`. + * + * @param bool $skipSmsToLandlines Whether to skip sending SMS verifications to landlines. Requires `lookup_enabled`. + * @return $this Fluent Builder + */ + public function setSkipSmsToLandlines(bool $skipSmsToLandlines): self + { + $this->options['skipSmsToLandlines'] = $skipSmsToLandlines; + return $this; + } + + /** + * Whether to ask the user to press a number before delivering the verify code in a phone call. + * + * @param bool $dtmfInputRequired Whether to ask the user to press a number before delivering the verify code in a phone call. + * @return $this Fluent Builder + */ + public function setDtmfInputRequired(bool $dtmfInputRequired): self + { + $this->options['dtmfInputRequired'] = $dtmfInputRequired; + return $this; + } + + /** + * The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages. + * + * @param string $ttsName The name of an alternative text-to-speech service to use in phone calls. Applies only to TTS languages. + * @return $this Fluent Builder + */ + public function setTtsName(string $ttsName): self + { + $this->options['ttsName'] = $ttsName; + return $this; + } + + /** + * Whether to pass PSD2 transaction parameters when starting a verification. + * + * @param bool $psd2Enabled Whether to pass PSD2 transaction parameters when starting a verification. + * @return $this Fluent Builder + */ + public function setPsd2Enabled(bool $psd2Enabled): self + { + $this->options['psd2Enabled'] = $psd2Enabled; + return $this; + } + + /** + * Whether to add a privacy warning at the end of an SMS. **Disabled by default and applies only for SMS.** + * + * @param bool $doNotShareWarningEnabled Whether to add a privacy warning at the end of an SMS. **Disabled by default and applies only for SMS.** + * @return $this Fluent Builder + */ + public function setDoNotShareWarningEnabled(bool $doNotShareWarningEnabled): self + { + $this->options['doNotShareWarningEnabled'] = $doNotShareWarningEnabled; + return $this; + } + + /** + * Whether to allow sending verifications with a custom code instead of a randomly generated one. Not available for all customers. + * + * @param bool $customCodeEnabled Whether to allow sending verifications with a custom code instead of a randomly generated one. Not available for all customers. + * @return $this Fluent Builder + */ + public function setCustomCodeEnabled(bool $customCodeEnabled): self + { + $this->options['customCodeEnabled'] = $customCodeEnabled; + return $this; + } + + /** + * Optional configuration for the Push factors. If true, include the date in the Challenge's response. Otherwise, the date is omitted from the response. See [Challenge](https://www.twilio.com/docs/verify/api/challenge) resource’s details parameter for more info. Default: false. **Deprecated** do not use this parameter. + * + * @param bool $pushIncludeDate Optional configuration for the Push factors. If true, include the date in the Challenge's response. Otherwise, the date is omitted from the response. See [Challenge](https://www.twilio.com/docs/verify/api/challenge) resource’s details parameter for more info. Default: false. **Deprecated** do not use this parameter. + * @return $this Fluent Builder + */ + public function setPushIncludeDate(bool $pushIncludeDate): self + { + $this->options['pushIncludeDate'] = $pushIncludeDate; + return $this; + } + + /** + * Optional configuration for the Push factors. Set the APN Credential for this service. This will allow to send push notifications to iOS devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) + * + * @param string $pushApnCredentialSid Optional configuration for the Push factors. Set the APN Credential for this service. This will allow to send push notifications to iOS devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) + * @return $this Fluent Builder + */ + public function setPushApnCredentialSid(string $pushApnCredentialSid): self + { + $this->options['pushApnCredentialSid'] = $pushApnCredentialSid; + return $this; + } + + /** + * Optional configuration for the Push factors. Set the FCM Credential for this service. This will allow to send push notifications to Android devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) + * + * @param string $pushFcmCredentialSid Optional configuration for the Push factors. Set the FCM Credential for this service. This will allow to send push notifications to Android devices. See [Credential Resource](https://www.twilio.com/docs/notify/api/credential-resource) + * @return $this Fluent Builder + */ + public function setPushFcmCredentialSid(string $pushFcmCredentialSid): self + { + $this->options['pushFcmCredentialSid'] = $pushFcmCredentialSid; + return $this; + } + + /** + * Optional configuration for the TOTP factors. Set TOTP Issuer for this service. This will allow to configure the issuer of the TOTP URI. + * + * @param string $totpIssuer Optional configuration for the TOTP factors. Set TOTP Issuer for this service. This will allow to configure the issuer of the TOTP URI. + * @return $this Fluent Builder + */ + public function setTotpIssuer(string $totpIssuer): self + { + $this->options['totpIssuer'] = $totpIssuer; + return $this; + } + + /** + * Optional configuration for the TOTP factors. Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. Defaults to 30 seconds + * + * @param int $totpTimeStep Optional configuration for the TOTP factors. Defines how often, in seconds, are TOTP codes generated. i.e, a new TOTP code is generated every time_step seconds. Must be between 20 and 60 seconds, inclusive. Defaults to 30 seconds + * @return $this Fluent Builder + */ + public function setTotpTimeStep(int $totpTimeStep): self + { + $this->options['totpTimeStep'] = $totpTimeStep; + return $this; + } + + /** + * Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 + * + * @param int $totpCodeLength Optional configuration for the TOTP factors. Number of digits for generated TOTP codes. Must be between 3 and 8, inclusive. Defaults to 6 + * @return $this Fluent Builder + */ + public function setTotpCodeLength(int $totpCodeLength): self + { + $this->options['totpCodeLength'] = $totpCodeLength; + return $this; + } + + /** + * Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 + * + * @param int $totpSkew Optional configuration for the TOTP factors. The number of time-steps, past and future, that are valid for validation of TOTP codes. Must be between 0 and 2, inclusive. Defaults to 1 + * @return $this Fluent Builder + */ + public function setTotpSkew(int $totpSkew): self + { + $this->options['totpSkew'] = $totpSkew; + return $this; + } + + /** + * The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. + * + * @param string $defaultTemplateSid The default message [template](https://www.twilio.com/docs/verify/api/templates). Will be used for all SMS verifications unless explicitly overriden. SMS channel only. + * @return $this Fluent Builder + */ + public function setDefaultTemplateSid(string $defaultTemplateSid): self + { + $this->options['defaultTemplateSid'] = $defaultTemplateSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Verify.V2.UpdateServiceOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Verify/V2/ServicePage.php b/app/api/Twilio/Rest/Verify/V2/ServicePage.php new file mode 100755 index 0000000..2da6d53 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/ServicePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ServiceInstance \Twilio\Rest\Verify\V2\ServiceInstance + */ + public function buildInstance(array $payload): ServiceInstance + { + return new ServiceInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.ServicePage]'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/TemplateInstance.php b/app/api/Twilio/Rest/Verify/V2/TemplateInstance.php new file mode 100755 index 0000000..6499b0b --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/TemplateInstance.php @@ -0,0 +1,88 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'channels' => Values::array_get($payload, 'channels'), + 'translations' => Values::array_get($payload, 'translations'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.TemplateInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Verify/V2/TemplateList.php b/app/api/Twilio/Rest/Verify/V2/TemplateList.php new file mode 100755 index 0000000..0be2598 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/TemplateList.php @@ -0,0 +1,152 @@ +solution = [ + ]; + + $this->uri = '/Templates'; + } + + /** + * Reads TemplateInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return TemplateInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams TemplateInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of TemplateInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return TemplatePage Page of TemplateInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): TemplatePage + { + $options = new Values($options); + + $params = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new TemplatePage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of TemplateInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return TemplatePage Page of TemplateInstance + */ + public function getPage(string $targetUrl): TemplatePage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new TemplatePage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.TemplateList]'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/TemplateOptions.php b/app/api/Twilio/Rest/Verify/V2/TemplateOptions.php new file mode 100755 index 0000000..b6316ae --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/TemplateOptions.php @@ -0,0 +1,76 @@ +options['friendlyName'] = $friendlyName; + } + + /** + * String filter used to query templates with a given friendly name + * + * @param string $friendlyName String filter used to query templates with a given friendly name + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Verify.V2.ReadTemplateOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Verify/V2/TemplatePage.php b/app/api/Twilio/Rest/Verify/V2/TemplatePage.php new file mode 100755 index 0000000..2580a27 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/TemplatePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return TemplateInstance \Twilio\Rest\Verify\V2\TemplateInstance + */ + public function buildInstance(array $payload): TemplateInstance + { + return new TemplateInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.TemplatePage]'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/VerificationAttemptContext.php b/app/api/Twilio/Rest/Verify/V2/VerificationAttemptContext.php new file mode 100755 index 0000000..35469e1 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/VerificationAttemptContext.php @@ -0,0 +1,81 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Attempts/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the VerificationAttemptInstance + * + * @return VerificationAttemptInstance Fetched VerificationAttemptInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): VerificationAttemptInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new VerificationAttemptInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.VerificationAttemptContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/VerificationAttemptInstance.php b/app/api/Twilio/Rest/Verify/V2/VerificationAttemptInstance.php new file mode 100755 index 0000000..e502462 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/VerificationAttemptInstance.php @@ -0,0 +1,136 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'serviceSid' => Values::array_get($payload, 'service_sid'), + 'verificationSid' => Values::array_get($payload, 'verification_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'conversionStatus' => Values::array_get($payload, 'conversion_status'), + 'channel' => Values::array_get($payload, 'channel'), + 'price' => Values::array_get($payload, 'price'), + 'channelData' => Values::array_get($payload, 'channel_data'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return VerificationAttemptContext Context for this VerificationAttemptInstance + */ + protected function proxy(): VerificationAttemptContext + { + if (!$this->context) { + $this->context = new VerificationAttemptContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the VerificationAttemptInstance + * + * @return VerificationAttemptInstance Fetched VerificationAttemptInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): VerificationAttemptInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.VerificationAttemptInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Verify/V2/VerificationAttemptList.php b/app/api/Twilio/Rest/Verify/V2/VerificationAttemptList.php new file mode 100755 index 0000000..7ed54c9 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/VerificationAttemptList.php @@ -0,0 +1,183 @@ +solution = [ + ]; + + $this->uri = '/Attempts'; + } + + /** + * Reads VerificationAttemptInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return VerificationAttemptInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams VerificationAttemptInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of VerificationAttemptInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return VerificationAttemptPage Page of VerificationAttemptInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): VerificationAttemptPage + { + $options = new Values($options); + + $params = Values::of([ + 'DateCreatedAfter' => + Serialize::iso8601DateTime($options['dateCreatedAfter']), + 'DateCreatedBefore' => + Serialize::iso8601DateTime($options['dateCreatedBefore']), + 'ChannelData.To' => + $options['channelDataTo'], + 'Country' => + $options['country'], + 'Channel' => + $options['channel'], + 'VerifyServiceSid' => + $options['verifyServiceSid'], + 'VerificationSid' => + $options['verificationSid'], + 'Status' => + $options['status'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new VerificationAttemptPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of VerificationAttemptInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return VerificationAttemptPage Page of VerificationAttemptInstance + */ + public function getPage(string $targetUrl): VerificationAttemptPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new VerificationAttemptPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a VerificationAttemptContext + * + * @param string $sid The unique SID identifier of a Verification Attempt + */ + public function getContext( + string $sid + + ): VerificationAttemptContext + { + return new VerificationAttemptContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.VerificationAttemptList]'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/VerificationAttemptOptions.php b/app/api/Twilio/Rest/Verify/V2/VerificationAttemptOptions.php new file mode 100755 index 0000000..e9041d9 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/VerificationAttemptOptions.php @@ -0,0 +1,204 @@ +options['dateCreatedAfter'] = $dateCreatedAfter; + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + $this->options['channelDataTo'] = $channelDataTo; + $this->options['country'] = $country; + $this->options['channel'] = $channel; + $this->options['verifyServiceSid'] = $verifyServiceSid; + $this->options['verificationSid'] = $verificationSid; + $this->options['status'] = $status; + } + + /** + * Datetime filter used to query Verification Attempts created after this datetime. Given as GMT in RFC 2822 format. + * + * @param \DateTime $dateCreatedAfter Datetime filter used to query Verification Attempts created after this datetime. Given as GMT in RFC 2822 format. + * @return $this Fluent Builder + */ + public function setDateCreatedAfter(\DateTime $dateCreatedAfter): self + { + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + return $this; + } + + /** + * Datetime filter used to query Verification Attempts created before this datetime. Given as GMT in RFC 2822 format. + * + * @param \DateTime $dateCreatedBefore Datetime filter used to query Verification Attempts created before this datetime. Given as GMT in RFC 2822 format. + * @return $this Fluent Builder + */ + public function setDateCreatedBefore(\DateTime $dateCreatedBefore): self + { + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + return $this; + } + + /** + * Destination of a verification. It is phone number in E.164 format. + * + * @param string $channelDataTo Destination of a verification. It is phone number in E.164 format. + * @return $this Fluent Builder + */ + public function setChannelDataTo(string $channelDataTo): self + { + $this->options['channelDataTo'] = $channelDataTo; + return $this; + } + + /** + * Filter used to query Verification Attempts sent to the specified destination country. + * + * @param string $country Filter used to query Verification Attempts sent to the specified destination country. + * @return $this Fluent Builder + */ + public function setCountry(string $country): self + { + $this->options['country'] = $country; + return $this; + } + + /** + * Filter used to query Verification Attempts by communication channel. Valid values are `SMS` and `CALL` + * + * @param string $channel Filter used to query Verification Attempts by communication channel. Valid values are `SMS` and `CALL` + * @return $this Fluent Builder + */ + public function setChannel(string $channel): self + { + $this->options['channel'] = $channel; + return $this; + } + + /** + * Filter used to query Verification Attempts by verify service. Only attempts of the provided SID will be returned. + * + * @param string $verifyServiceSid Filter used to query Verification Attempts by verify service. Only attempts of the provided SID will be returned. + * @return $this Fluent Builder + */ + public function setVerifyServiceSid(string $verifyServiceSid): self + { + $this->options['verifyServiceSid'] = $verifyServiceSid; + return $this; + } + + /** + * Filter used to return all the Verification Attempts of a single verification. Only attempts of the provided verification SID will be returned. + * + * @param string $verificationSid Filter used to return all the Verification Attempts of a single verification. Only attempts of the provided verification SID will be returned. + * @return $this Fluent Builder + */ + public function setVerificationSid(string $verificationSid): self + { + $this->options['verificationSid'] = $verificationSid; + return $this; + } + + /** + * Filter used to query Verification Attempts by conversion status. Valid values are `UNCONVERTED`, for attempts that were not converted, and `CONVERTED`, for attempts that were confirmed. + * + * @param string $status Filter used to query Verification Attempts by conversion status. Valid values are `UNCONVERTED`, for attempts that were not converted, and `CONVERTED`, for attempts that were confirmed. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Verify.V2.ReadVerificationAttemptOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Verify/V2/VerificationAttemptPage.php b/app/api/Twilio/Rest/Verify/V2/VerificationAttemptPage.php new file mode 100755 index 0000000..0e2ad77 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/VerificationAttemptPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return VerificationAttemptInstance \Twilio\Rest\Verify\V2\VerificationAttemptInstance + */ + public function buildInstance(array $payload): VerificationAttemptInstance + { + return new VerificationAttemptInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.VerificationAttemptPage]'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryContext.php b/app/api/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryContext.php new file mode 100755 index 0000000..e73c6a7 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryContext.php @@ -0,0 +1,96 @@ +solution = [ + ]; + + $this->uri = '/Attempts/Summary'; + } + + /** + * Fetch the VerificationAttemptsSummaryInstance + * + * @param array|Options $options Optional Arguments + * @return VerificationAttemptsSummaryInstance Fetched VerificationAttemptsSummaryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): VerificationAttemptsSummaryInstance + { + + $options = new Values($options); + + $params = Values::of([ + 'VerifyServiceSid' => + $options['verifyServiceSid'], + 'DateCreatedAfter' => + Serialize::iso8601DateTime($options['dateCreatedAfter']), + 'DateCreatedBefore' => + Serialize::iso8601DateTime($options['dateCreatedBefore']), + 'Country' => + $options['country'], + 'Channel' => + $options['channel'], + 'DestinationPrefix' => + $options['destinationPrefix'], + ]); + + $payload = $this->version->fetch('GET', $this->uri, $params); + + return new VerificationAttemptsSummaryInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.VerificationAttemptsSummaryContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryInstance.php b/app/api/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryInstance.php new file mode 100755 index 0000000..a549b4f --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryInstance.php @@ -0,0 +1,123 @@ +properties = [ + 'totalAttempts' => Values::array_get($payload, 'total_attempts'), + 'totalConverted' => Values::array_get($payload, 'total_converted'), + 'totalUnconverted' => Values::array_get($payload, 'total_unconverted'), + 'conversionRatePercentage' => Values::array_get($payload, 'conversion_rate_percentage'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = []; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return VerificationAttemptsSummaryContext Context for this VerificationAttemptsSummaryInstance + */ + protected function proxy(): VerificationAttemptsSummaryContext + { + if (!$this->context) { + $this->context = new VerificationAttemptsSummaryContext( + $this->version + ); + } + + return $this->context; + } + + /** + * Fetch the VerificationAttemptsSummaryInstance + * + * @param array|Options $options Optional Arguments + * @return VerificationAttemptsSummaryInstance Fetched VerificationAttemptsSummaryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(array $options = []): VerificationAttemptsSummaryInstance + { + + return $this->proxy()->fetch($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Verify.V2.VerificationAttemptsSummaryInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryList.php b/app/api/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryList.php new file mode 100755 index 0000000..bfc543d --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryList.php @@ -0,0 +1,61 @@ +solution = [ + ]; + } + + /** + * Constructs a VerificationAttemptsSummaryContext + */ + public function getContext( + + ): VerificationAttemptsSummaryContext + { + return new VerificationAttemptsSummaryContext( + $this->version + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.VerificationAttemptsSummaryList]'; + } +} diff --git a/app/api/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryOptions.php b/app/api/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryOptions.php new file mode 100755 index 0000000..de99e39 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryOptions.php @@ -0,0 +1,166 @@ +options['verifyServiceSid'] = $verifyServiceSid; + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + $this->options['country'] = $country; + $this->options['channel'] = $channel; + $this->options['destinationPrefix'] = $destinationPrefix; + } + + /** + * Filter used to consider only Verification Attempts of the given verify service on the summary aggregation. + * + * @param string $verifyServiceSid Filter used to consider only Verification Attempts of the given verify service on the summary aggregation. + * @return $this Fluent Builder + */ + public function setVerifyServiceSid(string $verifyServiceSid): self + { + $this->options['verifyServiceSid'] = $verifyServiceSid; + return $this; + } + + /** + * Datetime filter used to consider only Verification Attempts created after this datetime on the summary aggregation. Given as GMT in RFC 2822 format. + * + * @param \DateTime $dateCreatedAfter Datetime filter used to consider only Verification Attempts created after this datetime on the summary aggregation. Given as GMT in RFC 2822 format. + * @return $this Fluent Builder + */ + public function setDateCreatedAfter(\DateTime $dateCreatedAfter): self + { + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + return $this; + } + + /** + * Datetime filter used to consider only Verification Attempts created before this datetime on the summary aggregation. Given as GMT in RFC 2822 format. + * + * @param \DateTime $dateCreatedBefore Datetime filter used to consider only Verification Attempts created before this datetime on the summary aggregation. Given as GMT in RFC 2822 format. + * @return $this Fluent Builder + */ + public function setDateCreatedBefore(\DateTime $dateCreatedBefore): self + { + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + return $this; + } + + /** + * Filter used to consider only Verification Attempts sent to the specified destination country on the summary aggregation. + * + * @param string $country Filter used to consider only Verification Attempts sent to the specified destination country on the summary aggregation. + * @return $this Fluent Builder + */ + public function setCountry(string $country): self + { + $this->options['country'] = $country; + return $this; + } + + /** + * Filter Verification Attempts considered on the summary aggregation by communication channel. Valid values are `SMS` and `CALL` + * + * @param string $channel Filter Verification Attempts considered on the summary aggregation by communication channel. Valid values are `SMS` and `CALL` + * @return $this Fluent Builder + */ + public function setChannel(string $channel): self + { + $this->options['channel'] = $channel; + return $this; + } + + /** + * Filter the Verification Attempts considered on the summary aggregation by Destination prefix. It is the prefix of a phone number in E.164 format. + * + * @param string $destinationPrefix Filter the Verification Attempts considered on the summary aggregation by Destination prefix. It is the prefix of a phone number in E.164 format. + * @return $this Fluent Builder + */ + public function setDestinationPrefix(string $destinationPrefix): self + { + $this->options['destinationPrefix'] = $destinationPrefix; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Verify.V2.FetchVerificationAttemptsSummaryOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryPage.php b/app/api/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryPage.php new file mode 100755 index 0000000..0faba54 --- /dev/null +++ b/app/api/Twilio/Rest/Verify/V2/VerificationAttemptsSummaryPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return VerificationAttemptsSummaryInstance \Twilio\Rest\Verify\V2\VerificationAttemptsSummaryInstance + */ + public function buildInstance(array $payload): VerificationAttemptsSummaryInstance + { + return new VerificationAttemptsSummaryInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Verify.V2.VerificationAttemptsSummaryPage]'; + } +} diff --git a/app/api/Twilio/Rest/VerifyBase.php b/app/api/Twilio/Rest/VerifyBase.php new file mode 100755 index 0000000..0cdf6a5 --- /dev/null +++ b/app/api/Twilio/Rest/VerifyBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://verify.twilio.com'; + } + + + /** + * @return V2 Version v2 of verify + */ + protected function getV2(): V2 { + if (!$this->_v2) { + $this->_v2 = new V2($this); + } + return $this->_v2; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Verify]'; + } +} diff --git a/app/api/Twilio/Rest/Video.php b/app/api/Twilio/Rest/Video.php new file mode 100755 index 0000000..e312dea --- /dev/null +++ b/app/api/Twilio/Rest/Video.php @@ -0,0 +1,107 @@ +compositions instead. + */ + protected function getCompositions(): \Twilio\Rest\Video\V1\CompositionList { + echo "compositions is deprecated. Use v1->compositions instead."; + return $this->v1->compositions; + } + + /** + * @deprecated Use v1->compositions(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextCompositions(string $sid): \Twilio\Rest\Video\V1\CompositionContext { + echo "compositions(\$sid) is deprecated. Use v1->compositions(\$sid) instead."; + return $this->v1->compositions($sid); + } + + /** + * @deprecated Use v1->compositionHooks instead. + */ + protected function getCompositionHooks(): \Twilio\Rest\Video\V1\CompositionHookList { + echo "compositionHooks is deprecated. Use v1->compositionHooks instead."; + return $this->v1->compositionHooks; + } + + /** + * @deprecated Use v1->compositionHooks(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextCompositionHooks(string $sid): \Twilio\Rest\Video\V1\CompositionHookContext { + echo "compositionHooks(\$sid) is deprecated. Use v1->compositionHooks(\$sid) instead."; + return $this->v1->compositionHooks($sid); + } + + /** + * @deprecated Use v1->compositionSettings instead. + */ + protected function getCompositionSettings(): \Twilio\Rest\Video\V1\CompositionSettingsList { + echo "compositionSettings is deprecated. Use v1->compositionSettings instead."; + return $this->v1->compositionSettings; + } + + /** + * @deprecated Use v1->compositionSettings() instead. + */ + protected function contextCompositionSettings(): \Twilio\Rest\Video\V1\CompositionSettingsContext { + echo "compositionSettings() is deprecated. Use v1->compositionSettings() instead."; + return $this->v1->compositionSettings(); + } + + /** + * @deprecated Use v1->recordings instead. + */ + protected function getRecordings(): \Twilio\Rest\Video\V1\RecordingList { + echo "recordings is deprecated. Use v1->recordings instead."; + return $this->v1->recordings; + } + + /** + * @deprecated Use v1->recordings(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextRecordings(string $sid): \Twilio\Rest\Video\V1\RecordingContext { + echo "recordings(\$sid) is deprecated. Use v1->recordings(\$sid) instead."; + return $this->v1->recordings($sid); + } + + /** + * @deprecated Use v1->recordingSettings instead. + */ + protected function getRecordingSettings(): \Twilio\Rest\Video\V1\RecordingSettingsList { + echo "recordingSettings is deprecated. Use v1->recordingSettings instead."; + return $this->v1->recordingSettings; + } + + /** + * @deprecated Use v1->recordingSettings() instead. + */ + protected function contextRecordingSettings(): \Twilio\Rest\Video\V1\RecordingSettingsContext { + echo "recordingSettings() is deprecated. Use v1->recordingSettings() instead."; + return $this->v1->recordingSettings(); + } + + /** + * @deprecated Use v1->rooms instead. + */ + protected function getRooms(): \Twilio\Rest\Video\V1\RoomList { + echo "rooms is deprecated. Use v1->rooms instead."; + return $this->v1->rooms; + } + + /** + * @deprecated Use v1->rooms(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextRooms(string $sid): \Twilio\Rest\Video\V1\RoomContext { + echo "rooms(\$sid) is deprecated. Use v1->rooms(\$sid) instead."; + return $this->v1->rooms($sid); + } +} \ No newline at end of file diff --git a/app/api/Twilio/Rest/Video/V1.php b/app/api/Twilio/Rest/Video/V1.php new file mode 100755 index 0000000..8905d13 --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1.php @@ -0,0 +1,153 @@ +version = 'v1'; + } + + protected function getCompositions(): CompositionList + { + if (!$this->_compositions) { + $this->_compositions = new CompositionList($this); + } + return $this->_compositions; + } + + protected function getCompositionHooks(): CompositionHookList + { + if (!$this->_compositionHooks) { + $this->_compositionHooks = new CompositionHookList($this); + } + return $this->_compositionHooks; + } + + protected function getCompositionSettings(): CompositionSettingsList + { + if (!$this->_compositionSettings) { + $this->_compositionSettings = new CompositionSettingsList($this); + } + return $this->_compositionSettings; + } + + protected function getRecordings(): RecordingList + { + if (!$this->_recordings) { + $this->_recordings = new RecordingList($this); + } + return $this->_recordings; + } + + protected function getRecordingSettings(): RecordingSettingsList + { + if (!$this->_recordingSettings) { + $this->_recordingSettings = new RecordingSettingsList($this); + } + return $this->_recordingSettings; + } + + protected function getRooms(): RoomList + { + if (!$this->_rooms) { + $this->_rooms = new RoomList($this); + } + return $this->_rooms; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1]'; + } +} diff --git a/app/api/Twilio/Rest/Video/V1/CompositionContext.php b/app/api/Twilio/Rest/Video/V1/CompositionContext.php new file mode 100755 index 0000000..b32be73 --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/CompositionContext.php @@ -0,0 +1,94 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Compositions/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the CompositionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the CompositionInstance + * + * @return CompositionInstance Fetched CompositionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CompositionInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new CompositionInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.CompositionContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Video/V1/CompositionHookContext.php b/app/api/Twilio/Rest/Video/V1/CompositionHookContext.php new file mode 100755 index 0000000..b1a0e61 --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/CompositionHookContext.php @@ -0,0 +1,143 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/CompositionHooks/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the CompositionHookInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the CompositionHookInstance + * + * @return CompositionHookInstance Fetched CompositionHookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CompositionHookInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new CompositionHookInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the CompositionHookInstance + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 100 characters long and it must be unique within the account. + * @param array|Options $options Optional Arguments + * @return CompositionHookInstance Updated CompositionHookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $friendlyName, array $options = []): CompositionHookInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Enabled' => + Serialize::booleanToString($options['enabled']), + 'VideoLayout' => + Serialize::jsonObject($options['videoLayout']), + 'AudioSources' => + Serialize::map($options['audioSources'], function ($e) { return $e; }), + 'AudioSourcesExcluded' => + Serialize::map($options['audioSourcesExcluded'], function ($e) { return $e; }), + 'Trim' => + Serialize::booleanToString($options['trim']), + 'Format' => + $options['format'], + 'Resolution' => + $options['resolution'], + 'StatusCallback' => + $options['statusCallback'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new CompositionHookInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.CompositionHookContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Video/V1/CompositionHookInstance.php b/app/api/Twilio/Rest/Video/V1/CompositionHookInstance.php new file mode 100755 index 0000000..64ceb37 --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/CompositionHookInstance.php @@ -0,0 +1,171 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'enabled' => Values::array_get($payload, 'enabled'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'sid' => Values::array_get($payload, 'sid'), + 'audioSources' => Values::array_get($payload, 'audio_sources'), + 'audioSourcesExcluded' => Values::array_get($payload, 'audio_sources_excluded'), + 'videoLayout' => Values::array_get($payload, 'video_layout'), + 'resolution' => Values::array_get($payload, 'resolution'), + 'trim' => Values::array_get($payload, 'trim'), + 'format' => Values::array_get($payload, 'format'), + 'statusCallback' => Values::array_get($payload, 'status_callback'), + 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CompositionHookContext Context for this CompositionHookInstance + */ + protected function proxy(): CompositionHookContext + { + if (!$this->context) { + $this->context = new CompositionHookContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the CompositionHookInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the CompositionHookInstance + * + * @return CompositionHookInstance Fetched CompositionHookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CompositionHookInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the CompositionHookInstance + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 100 characters long and it must be unique within the account. + * @param array|Options $options Optional Arguments + * @return CompositionHookInstance Updated CompositionHookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $friendlyName, array $options = []): CompositionHookInstance + { + + return $this->proxy()->update($friendlyName, $options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.CompositionHookInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Video/V1/CompositionHookList.php b/app/api/Twilio/Rest/Video/V1/CompositionHookList.php new file mode 100755 index 0000000..5c639bb --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/CompositionHookList.php @@ -0,0 +1,221 @@ +solution = [ + ]; + + $this->uri = '/CompositionHooks'; + } + + /** + * Create the CompositionHookInstance + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It can be up to 100 characters long and it must be unique within the account. + * @param array|Options $options Optional Arguments + * @return CompositionHookInstance Created CompositionHookInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, array $options = []): CompositionHookInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'Enabled' => + Serialize::booleanToString($options['enabled']), + 'VideoLayout' => + Serialize::jsonObject($options['videoLayout']), + 'AudioSources' => + Serialize::map($options['audioSources'], function ($e) { return $e; }), + 'AudioSourcesExcluded' => + Serialize::map($options['audioSourcesExcluded'], function ($e) { return $e; }), + 'Resolution' => + $options['resolution'], + 'Format' => + $options['format'], + 'StatusCallback' => + $options['statusCallback'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'Trim' => + Serialize::booleanToString($options['trim']), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new CompositionHookInstance( + $this->version, + $payload + ); + } + + + /** + * Reads CompositionHookInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return CompositionHookInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams CompositionHookInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CompositionHookInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return CompositionHookPage Page of CompositionHookInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CompositionHookPage + { + $options = new Values($options); + + $params = Values::of([ + 'Enabled' => + Serialize::booleanToString($options['enabled']), + 'DateCreatedAfter' => + Serialize::iso8601DateTime($options['dateCreatedAfter']), + 'DateCreatedBefore' => + Serialize::iso8601DateTime($options['dateCreatedBefore']), + 'FriendlyName' => + $options['friendlyName'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new CompositionHookPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of CompositionHookInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return CompositionHookPage Page of CompositionHookInstance + */ + public function getPage(string $targetUrl): CompositionHookPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CompositionHookPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CompositionHookContext + * + * @param string $sid The SID of the CompositionHook resource to delete. + */ + public function getContext( + string $sid + + ): CompositionHookContext + { + return new CompositionHookContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.CompositionHookList]'; + } +} diff --git a/app/api/Twilio/Rest/Video/V1/CompositionHookOptions.php b/app/api/Twilio/Rest/Video/V1/CompositionHookOptions.php new file mode 100755 index 0000000..0024248 --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/CompositionHookOptions.php @@ -0,0 +1,522 @@ +options['enabled'] = $enabled; + $this->options['videoLayout'] = $videoLayout; + $this->options['audioSources'] = $audioSources; + $this->options['audioSourcesExcluded'] = $audioSourcesExcluded; + $this->options['resolution'] = $resolution; + $this->options['format'] = $format; + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['trim'] = $trim; + } + + /** + * Whether the composition hook is active. When `true`, the composition hook will be triggered for every completed Group Room in the account. When `false`, the composition hook will never be triggered. + * + * @param bool $enabled Whether the composition hook is active. When `true`, the composition hook will be triggered for every completed Group Room in the account. When `false`, the composition hook will never be triggered. + * @return $this Fluent Builder + */ + public function setEnabled(bool $enabled): self + { + $this->options['enabled'] = $enabled; + return $this; + } + + /** + * An object that describes the video layout of the composition hook in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + * + * @param array $videoLayout An object that describes the video layout of the composition hook in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + * @return $this Fluent Builder + */ + public function setVideoLayout(array $videoLayout): self + { + $this->options['videoLayout'] = $videoLayout; + return $this; + } + + /** + * An array of track names from the same group room to merge into the compositions created by the composition hook. Can include zero or more track names. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` includes tracks named `student` as well as `studentTeam`. + * + * @param string[] $audioSources An array of track names from the same group room to merge into the compositions created by the composition hook. Can include zero or more track names. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` includes tracks named `student` as well as `studentTeam`. + * @return $this Fluent Builder + */ + public function setAudioSources(array $audioSources): self + { + $this->options['audioSources'] = $audioSources; + return $this; + } + + /** + * An array of track names to exclude. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. + * + * @param string[] $audioSourcesExcluded An array of track names to exclude. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. + * @return $this Fluent Builder + */ + public function setAudioSourcesExcluded(array $audioSourcesExcluded): self + { + $this->options['audioSourcesExcluded'] = $audioSourcesExcluded; + return $this; + } + + /** + * A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string's format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + * + * @param string $resolution A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string's format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + * @return $this Fluent Builder + */ + public function setResolution(string $resolution): self + { + $this->options['resolution'] = $resolution; + return $this; + } + + /** + * @param string $format + * @return $this Fluent Builder + */ + public function setFormat(string $format): self + { + $this->options['format'] = $format; + return $this; + } + + /** + * The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. + * + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. + * + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * Whether to clip the intervals where there is no active media in the Compositions triggered by the composition hook. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + * + * @param bool $trim Whether to clip the intervals where there is no active media in the Compositions triggered by the composition hook. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + * @return $this Fluent Builder + */ + public function setTrim(bool $trim): self + { + $this->options['trim'] = $trim; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Video.V1.CreateCompositionHookOptions ' . $options . ']'; + } +} + + + +class ReadCompositionHookOptions extends Options + { + /** + * @param bool $enabled Read only CompositionHook resources with an `enabled` value that matches this parameter. + * @param \DateTime $dateCreatedAfter Read only CompositionHook resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. + * @param \DateTime $dateCreatedBefore Read only CompositionHook resources created before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. + * @param string $friendlyName Read only CompositionHook resources with friendly names that match this string. The match is not case sensitive and can include asterisk `*` characters as wildcard match. + */ + public function __construct( + + bool $enabled = Values::BOOL_NONE, + \DateTime $dateCreatedAfter = null, + \DateTime $dateCreatedBefore = null, + string $friendlyName = Values::NONE + + ) { + $this->options['enabled'] = $enabled; + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + $this->options['friendlyName'] = $friendlyName; + } + + /** + * Read only CompositionHook resources with an `enabled` value that matches this parameter. + * + * @param bool $enabled Read only CompositionHook resources with an `enabled` value that matches this parameter. + * @return $this Fluent Builder + */ + public function setEnabled(bool $enabled): self + { + $this->options['enabled'] = $enabled; + return $this; + } + + /** + * Read only CompositionHook resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. + * + * @param \DateTime $dateCreatedAfter Read only CompositionHook resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. + * @return $this Fluent Builder + */ + public function setDateCreatedAfter(\DateTime $dateCreatedAfter): self + { + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + return $this; + } + + /** + * Read only CompositionHook resources created before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. + * + * @param \DateTime $dateCreatedBefore Read only CompositionHook resources created before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. + * @return $this Fluent Builder + */ + public function setDateCreatedBefore(\DateTime $dateCreatedBefore): self + { + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + return $this; + } + + /** + * Read only CompositionHook resources with friendly names that match this string. The match is not case sensitive and can include asterisk `*` characters as wildcard match. + * + * @param string $friendlyName Read only CompositionHook resources with friendly names that match this string. The match is not case sensitive and can include asterisk `*` characters as wildcard match. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Video.V1.ReadCompositionHookOptions ' . $options . ']'; + } +} + +class UpdateCompositionHookOptions extends Options + { + /** + * @param bool $enabled Whether the composition hook is active. When `true`, the composition hook will be triggered for every completed Group Room in the account. When `false`, the composition hook never triggers. + * @param array $videoLayout A JSON object that describes the video layout of the composition hook in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + * @param string[] $audioSources An array of track names from the same group room to merge into the compositions created by the composition hook. Can include zero or more track names. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` includes tracks named `student` as well as `studentTeam`. + * @param string[] $audioSourcesExcluded An array of track names to exclude. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. + * @param bool $trim Whether to clip the intervals where there is no active media in the compositions triggered by the composition hook. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + * @param string $format + * @param string $resolution A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string's format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. + */ + public function __construct( + + bool $enabled = Values::BOOL_NONE, + array $videoLayout = Values::ARRAY_NONE, + array $audioSources = Values::ARRAY_NONE, + array $audioSourcesExcluded = Values::ARRAY_NONE, + bool $trim = Values::BOOL_NONE, + string $format = Values::NONE, + string $resolution = Values::NONE, + string $statusCallback = Values::NONE, + string $statusCallbackMethod = Values::NONE + + ) { + $this->options['enabled'] = $enabled; + $this->options['videoLayout'] = $videoLayout; + $this->options['audioSources'] = $audioSources; + $this->options['audioSourcesExcluded'] = $audioSourcesExcluded; + $this->options['trim'] = $trim; + $this->options['format'] = $format; + $this->options['resolution'] = $resolution; + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + } + + /** + * Whether the composition hook is active. When `true`, the composition hook will be triggered for every completed Group Room in the account. When `false`, the composition hook never triggers. + * + * @param bool $enabled Whether the composition hook is active. When `true`, the composition hook will be triggered for every completed Group Room in the account. When `false`, the composition hook never triggers. + * @return $this Fluent Builder + */ + public function setEnabled(bool $enabled): self + { + $this->options['enabled'] = $enabled; + return $this; + } + + /** + * A JSON object that describes the video layout of the composition hook in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + * + * @param array $videoLayout A JSON object that describes the video layout of the composition hook in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + * @return $this Fluent Builder + */ + public function setVideoLayout(array $videoLayout): self + { + $this->options['videoLayout'] = $videoLayout; + return $this; + } + + /** + * An array of track names from the same group room to merge into the compositions created by the composition hook. Can include zero or more track names. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` includes tracks named `student` as well as `studentTeam`. + * + * @param string[] $audioSources An array of track names from the same group room to merge into the compositions created by the composition hook. Can include zero or more track names. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` includes tracks named `student` as well as `studentTeam`. + * @return $this Fluent Builder + */ + public function setAudioSources(array $audioSources): self + { + $this->options['audioSources'] = $audioSources; + return $this; + } + + /** + * An array of track names to exclude. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. + * + * @param string[] $audioSourcesExcluded An array of track names to exclude. A composition triggered by the composition hook includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which matches zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. + * @return $this Fluent Builder + */ + public function setAudioSourcesExcluded(array $audioSourcesExcluded): self + { + $this->options['audioSourcesExcluded'] = $audioSourcesExcluded; + return $this; + } + + /** + * Whether to clip the intervals where there is no active media in the compositions triggered by the composition hook. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + * + * @param bool $trim Whether to clip the intervals where there is no active media in the compositions triggered by the composition hook. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + * @return $this Fluent Builder + */ + public function setTrim(bool $trim): self + { + $this->options['trim'] = $trim; + return $this; + } + + /** + * @param string $format + * @return $this Fluent Builder + */ + public function setFormat(string $format): self + { + $this->options['format'] = $format; + return $this; + } + + /** + * A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string's format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + * + * @param string $resolution A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string's format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + * @return $this Fluent Builder + */ + public function setResolution(string $resolution): self + { + $this->options['resolution'] = $resolution; + return $this; + } + + /** + * The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. + * + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. + * + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Video.V1.UpdateCompositionHookOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Video/V1/CompositionHookPage.php b/app/api/Twilio/Rest/Video/V1/CompositionHookPage.php new file mode 100755 index 0000000..12b579b --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/CompositionHookPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CompositionHookInstance \Twilio\Rest\Video\V1\CompositionHookInstance + */ + public function buildInstance(array $payload): CompositionHookInstance + { + return new CompositionHookInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.CompositionHookPage]'; + } +} diff --git a/app/api/Twilio/Rest/Video/V1/CompositionInstance.php b/app/api/Twilio/Rest/Video/V1/CompositionInstance.php new file mode 100755 index 0000000..f847525 --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/CompositionInstance.php @@ -0,0 +1,168 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'status' => Values::array_get($payload, 'status'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateCompleted' => Deserialize::dateTime(Values::array_get($payload, 'date_completed')), + 'dateDeleted' => Deserialize::dateTime(Values::array_get($payload, 'date_deleted')), + 'sid' => Values::array_get($payload, 'sid'), + 'roomSid' => Values::array_get($payload, 'room_sid'), + 'audioSources' => Values::array_get($payload, 'audio_sources'), + 'audioSourcesExcluded' => Values::array_get($payload, 'audio_sources_excluded'), + 'videoLayout' => Values::array_get($payload, 'video_layout'), + 'resolution' => Values::array_get($payload, 'resolution'), + 'trim' => Values::array_get($payload, 'trim'), + 'format' => Values::array_get($payload, 'format'), + 'bitrate' => Values::array_get($payload, 'bitrate'), + 'size' => Values::array_get($payload, 'size'), + 'duration' => Values::array_get($payload, 'duration'), + 'mediaExternalLocation' => Values::array_get($payload, 'media_external_location'), + 'statusCallback' => Values::array_get($payload, 'status_callback'), + 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CompositionContext Context for this CompositionInstance + */ + protected function proxy(): CompositionContext + { + if (!$this->context) { + $this->context = new CompositionContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the CompositionInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the CompositionInstance + * + * @return CompositionInstance Fetched CompositionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CompositionInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.CompositionInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Video/V1/CompositionList.php b/app/api/Twilio/Rest/Video/V1/CompositionList.php new file mode 100755 index 0000000..6100b1b --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/CompositionList.php @@ -0,0 +1,219 @@ +solution = [ + ]; + + $this->uri = '/Compositions'; + } + + /** + * Create the CompositionInstance + * + * @param string $roomSid The SID of the Group Room with the media tracks to be used as composition sources. + * @param array|Options $options Optional Arguments + * @return CompositionInstance Created CompositionInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $roomSid, array $options = []): CompositionInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'RoomSid' => + $roomSid, + 'VideoLayout' => + Serialize::jsonObject($options['videoLayout']), + 'AudioSources' => + Serialize::map($options['audioSources'], function ($e) { return $e; }), + 'AudioSourcesExcluded' => + Serialize::map($options['audioSourcesExcluded'], function ($e) { return $e; }), + 'Resolution' => + $options['resolution'], + 'Format' => + $options['format'], + 'StatusCallback' => + $options['statusCallback'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'Trim' => + Serialize::booleanToString($options['trim']), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new CompositionInstance( + $this->version, + $payload + ); + } + + + /** + * Reads CompositionInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return CompositionInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams CompositionInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CompositionInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return CompositionPage Page of CompositionInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CompositionPage + { + $options = new Values($options); + + $params = Values::of([ + 'Status' => + $options['status'], + 'DateCreatedAfter' => + Serialize::iso8601DateTime($options['dateCreatedAfter']), + 'DateCreatedBefore' => + Serialize::iso8601DateTime($options['dateCreatedBefore']), + 'RoomSid' => + $options['roomSid'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new CompositionPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of CompositionInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return CompositionPage Page of CompositionInstance + */ + public function getPage(string $targetUrl): CompositionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CompositionPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CompositionContext + * + * @param string $sid The SID of the Composition resource to delete. + */ + public function getContext( + string $sid + + ): CompositionContext + { + return new CompositionContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.CompositionList]'; + } +} diff --git a/app/api/Twilio/Rest/Video/V1/CompositionOptions.php b/app/api/Twilio/Rest/Video/V1/CompositionOptions.php new file mode 100755 index 0000000..b6b81f4 --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/CompositionOptions.php @@ -0,0 +1,310 @@ +options['videoLayout'] = $videoLayout; + $this->options['audioSources'] = $audioSources; + $this->options['audioSourcesExcluded'] = $audioSourcesExcluded; + $this->options['resolution'] = $resolution; + $this->options['format'] = $format; + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['trim'] = $trim; + } + + /** + * An object that describes the video layout of the composition in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. Please, be aware that either video_layout or audio_sources have to be provided to get a valid creation request + * + * @param array $videoLayout An object that describes the video layout of the composition in terms of regions. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. Please, be aware that either video_layout or audio_sources have to be provided to get a valid creation request + * @return $this Fluent Builder + */ + public function setVideoLayout(array $videoLayout): self + { + $this->options['videoLayout'] = $videoLayout; + return $this; + } + + /** + * An array of track names from the same group room to merge into the new composition. Can include zero or more track names. The new composition includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which will match zero or more characters in a track name. For example, `student*` includes `student` as well as `studentTeam`. Please, be aware that either video_layout or audio_sources have to be provided to get a valid creation request + * + * @param string[] $audioSources An array of track names from the same group room to merge into the new composition. Can include zero or more track names. The new composition includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which will match zero or more characters in a track name. For example, `student*` includes `student` as well as `studentTeam`. Please, be aware that either video_layout or audio_sources have to be provided to get a valid creation request + * @return $this Fluent Builder + */ + public function setAudioSources(array $audioSources): self + { + $this->options['audioSources'] = $audioSources; + return $this; + } + + /** + * An array of track names to exclude. The new composition includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which will match zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. + * + * @param string[] $audioSourcesExcluded An array of track names to exclude. The new composition includes all audio sources specified in `audio_sources` except for those specified in `audio_sources_excluded`. The track names in this parameter can include an asterisk as a wild card character, which will match zero or more characters in a track name. For example, `student*` excludes `student` as well as `studentTeam`. This parameter can also be empty. + * @return $this Fluent Builder + */ + public function setAudioSourcesExcluded(array $audioSourcesExcluded): self + { + $this->options['audioSourcesExcluded'] = $audioSourcesExcluded; + return $this; + } + + /** + * A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string's format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + * + * @param string $resolution A string that describes the columns (width) and rows (height) of the generated composed video in pixels. Defaults to `640x480`. The string's format is `{width}x{height}` where: * 16 <= `{width}` <= 1280 * 16 <= `{height}` <= 1280 * `{width}` * `{height}` <= 921,600 Typical values are: * HD = `1280x720` * PAL = `1024x576` * VGA = `640x480` * CIF = `320x240` Note that the `resolution` imposes an aspect ratio to the resulting composition. When the original video tracks are constrained by the aspect ratio, they are scaled to fit. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + * @return $this Fluent Builder + */ + public function setResolution(string $resolution): self + { + $this->options['resolution'] = $resolution; + return $this; + } + + /** + * @param string $format + * @return $this Fluent Builder + */ + public function setFormat(string $format): self + { + $this->options['format'] = $format; + return $this; + } + + /** + * The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. + * + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application on every composition event. If not provided, status callback events will not be dispatched. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. + * + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be: `POST` or `GET` and the default is `POST`. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * Whether to clip the intervals where there is no active media in the composition. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + * + * @param bool $trim Whether to clip the intervals where there is no active media in the composition. The default is `true`. Compositions with `trim` enabled are shorter when the Room is created and no Participant joins for a while as well as if all the Participants leave the room and join later, because those gaps will be removed. See [Specifying Video Layouts](https://www.twilio.com/docs/video/api/compositions-resource#specifying-video-layouts) for more info. + * @return $this Fluent Builder + */ + public function setTrim(bool $trim): self + { + $this->options['trim'] = $trim; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Video.V1.CreateCompositionOptions ' . $options . ']'; + } +} + + + +class ReadCompositionOptions extends Options + { + /** + * @param string $status Read only Composition resources with this status. Can be: `enqueued`, `processing`, `completed`, `deleted`, or `failed`. + * @param \DateTime $dateCreatedAfter Read only Composition resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone. + * @param \DateTime $dateCreatedBefore Read only Composition resources created before this ISO 8601 date-time with time zone. + * @param string $roomSid Read only Composition resources with this Room SID. + */ + public function __construct( + + string $status = Values::NONE, + \DateTime $dateCreatedAfter = null, + \DateTime $dateCreatedBefore = null, + string $roomSid = Values::NONE + + ) { + $this->options['status'] = $status; + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + $this->options['roomSid'] = $roomSid; + } + + /** + * Read only Composition resources with this status. Can be: `enqueued`, `processing`, `completed`, `deleted`, or `failed`. + * + * @param string $status Read only Composition resources with this status. Can be: `enqueued`, `processing`, `completed`, `deleted`, or `failed`. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Read only Composition resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone. + * + * @param \DateTime $dateCreatedAfter Read only Composition resources created on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone. + * @return $this Fluent Builder + */ + public function setDateCreatedAfter(\DateTime $dateCreatedAfter): self + { + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + return $this; + } + + /** + * Read only Composition resources created before this ISO 8601 date-time with time zone. + * + * @param \DateTime $dateCreatedBefore Read only Composition resources created before this ISO 8601 date-time with time zone. + * @return $this Fluent Builder + */ + public function setDateCreatedBefore(\DateTime $dateCreatedBefore): self + { + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + return $this; + } + + /** + * Read only Composition resources with this Room SID. + * + * @param string $roomSid Read only Composition resources with this Room SID. + * @return $this Fluent Builder + */ + public function setRoomSid(string $roomSid): self + { + $this->options['roomSid'] = $roomSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Video.V1.ReadCompositionOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Video/V1/CompositionPage.php b/app/api/Twilio/Rest/Video/V1/CompositionPage.php new file mode 100755 index 0000000..2601d8e --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/CompositionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CompositionInstance \Twilio\Rest\Video\V1\CompositionInstance + */ + public function buildInstance(array $payload): CompositionInstance + { + return new CompositionInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.CompositionPage]'; + } +} diff --git a/app/api/Twilio/Rest/Video/V1/CompositionSettingsContext.php b/app/api/Twilio/Rest/Video/V1/CompositionSettingsContext.php new file mode 100755 index 0000000..e3822df --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/CompositionSettingsContext.php @@ -0,0 +1,115 @@ +solution = [ + ]; + + $this->uri = '/CompositionSettings/Default'; + } + + /** + * Create the CompositionSettingsInstance + * + * @param string $friendlyName A descriptive string that you create to describe the resource and show to the user in the console + * @param array|Options $options Optional Arguments + * @return CompositionSettingsInstance Created CompositionSettingsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, array $options = []): CompositionSettingsInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'AwsCredentialsSid' => + $options['awsCredentialsSid'], + 'EncryptionKeySid' => + $options['encryptionKeySid'], + 'AwsS3Url' => + $options['awsS3Url'], + 'AwsStorageEnabled' => + Serialize::booleanToString($options['awsStorageEnabled']), + 'EncryptionEnabled' => + Serialize::booleanToString($options['encryptionEnabled']), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new CompositionSettingsInstance( + $this->version, + $payload + ); + } + + + /** + * Fetch the CompositionSettingsInstance + * + * @return CompositionSettingsInstance Fetched CompositionSettingsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CompositionSettingsInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new CompositionSettingsInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.CompositionSettingsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Video/V1/CompositionSettingsInstance.php b/app/api/Twilio/Rest/Video/V1/CompositionSettingsInstance.php new file mode 100755 index 0000000..027e203 --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/CompositionSettingsInstance.php @@ -0,0 +1,142 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'awsCredentialsSid' => Values::array_get($payload, 'aws_credentials_sid'), + 'awsS3Url' => Values::array_get($payload, 'aws_s3_url'), + 'awsStorageEnabled' => Values::array_get($payload, 'aws_storage_enabled'), + 'encryptionKeySid' => Values::array_get($payload, 'encryption_key_sid'), + 'encryptionEnabled' => Values::array_get($payload, 'encryption_enabled'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = []; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CompositionSettingsContext Context for this CompositionSettingsInstance + */ + protected function proxy(): CompositionSettingsContext + { + if (!$this->context) { + $this->context = new CompositionSettingsContext( + $this->version + ); + } + + return $this->context; + } + + /** + * Create the CompositionSettingsInstance + * + * @param string $friendlyName A descriptive string that you create to describe the resource and show to the user in the console + * @param array|Options $options Optional Arguments + * @return CompositionSettingsInstance Created CompositionSettingsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, array $options = []): CompositionSettingsInstance + { + + return $this->proxy()->create($friendlyName, $options); + } + + /** + * Fetch the CompositionSettingsInstance + * + * @return CompositionSettingsInstance Fetched CompositionSettingsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CompositionSettingsInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.CompositionSettingsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Video/V1/CompositionSettingsList.php b/app/api/Twilio/Rest/Video/V1/CompositionSettingsList.php new file mode 100755 index 0000000..8be5511 --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/CompositionSettingsList.php @@ -0,0 +1,61 @@ +solution = [ + ]; + } + + /** + * Constructs a CompositionSettingsContext + */ + public function getContext( + + ): CompositionSettingsContext + { + return new CompositionSettingsContext( + $this->version + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.CompositionSettingsList]'; + } +} diff --git a/app/api/Twilio/Rest/Video/V1/CompositionSettingsOptions.php b/app/api/Twilio/Rest/Video/V1/CompositionSettingsOptions.php new file mode 100755 index 0000000..dd4d607 --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/CompositionSettingsOptions.php @@ -0,0 +1,150 @@ +RFC 3986. + * @param bool $awsStorageEnabled Whether all compositions should be written to the `aws_s3_url`. When `false`, all compositions are stored in our cloud. + * @param bool $encryptionEnabled Whether all compositions should be stored in an encrypted form. The default is `false`. + * @return CreateCompositionSettingsOptions Options builder + */ + public static function create( + + string $awsCredentialsSid = Values::NONE, + string $encryptionKeySid = Values::NONE, + string $awsS3Url = Values::NONE, + bool $awsStorageEnabled = Values::BOOL_NONE, + bool $encryptionEnabled = Values::BOOL_NONE + + ): CreateCompositionSettingsOptions + { + return new CreateCompositionSettingsOptions( + $awsCredentialsSid, + $encryptionKeySid, + $awsS3Url, + $awsStorageEnabled, + $encryptionEnabled + ); + } + + +} + +class CreateCompositionSettingsOptions extends Options + { + /** + * @param string $awsCredentialsSid The SID of the stored Credential resource. + * @param string $encryptionKeySid The SID of the Public Key resource to use for encryption. + * @param string $awsS3Url The URL of the AWS S3 bucket where the compositions should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986. + * @param bool $awsStorageEnabled Whether all compositions should be written to the `aws_s3_url`. When `false`, all compositions are stored in our cloud. + * @param bool $encryptionEnabled Whether all compositions should be stored in an encrypted form. The default is `false`. + */ + public function __construct( + + string $awsCredentialsSid = Values::NONE, + string $encryptionKeySid = Values::NONE, + string $awsS3Url = Values::NONE, + bool $awsStorageEnabled = Values::BOOL_NONE, + bool $encryptionEnabled = Values::BOOL_NONE + + ) { + $this->options['awsCredentialsSid'] = $awsCredentialsSid; + $this->options['encryptionKeySid'] = $encryptionKeySid; + $this->options['awsS3Url'] = $awsS3Url; + $this->options['awsStorageEnabled'] = $awsStorageEnabled; + $this->options['encryptionEnabled'] = $encryptionEnabled; + } + + /** + * The SID of the stored Credential resource. + * + * @param string $awsCredentialsSid The SID of the stored Credential resource. + * @return $this Fluent Builder + */ + public function setAwsCredentialsSid(string $awsCredentialsSid): self + { + $this->options['awsCredentialsSid'] = $awsCredentialsSid; + return $this; + } + + /** + * The SID of the Public Key resource to use for encryption. + * + * @param string $encryptionKeySid The SID of the Public Key resource to use for encryption. + * @return $this Fluent Builder + */ + public function setEncryptionKeySid(string $encryptionKeySid): self + { + $this->options['encryptionKeySid'] = $encryptionKeySid; + return $this; + } + + /** + * The URL of the AWS S3 bucket where the compositions should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986. + * + * @param string $awsS3Url The URL of the AWS S3 bucket where the compositions should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/compositions`, where `compositions` is the path in which you want the compositions to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986. + * @return $this Fluent Builder + */ + public function setAwsS3Url(string $awsS3Url): self + { + $this->options['awsS3Url'] = $awsS3Url; + return $this; + } + + /** + * Whether all compositions should be written to the `aws_s3_url`. When `false`, all compositions are stored in our cloud. + * + * @param bool $awsStorageEnabled Whether all compositions should be written to the `aws_s3_url`. When `false`, all compositions are stored in our cloud. + * @return $this Fluent Builder + */ + public function setAwsStorageEnabled(bool $awsStorageEnabled): self + { + $this->options['awsStorageEnabled'] = $awsStorageEnabled; + return $this; + } + + /** + * Whether all compositions should be stored in an encrypted form. The default is `false`. + * + * @param bool $encryptionEnabled Whether all compositions should be stored in an encrypted form. The default is `false`. + * @return $this Fluent Builder + */ + public function setEncryptionEnabled(bool $encryptionEnabled): self + { + $this->options['encryptionEnabled'] = $encryptionEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Video.V1.CreateCompositionSettingsOptions ' . $options . ']'; + } +} + + diff --git a/app/api/Twilio/Rest/Video/V1/CompositionSettingsPage.php b/app/api/Twilio/Rest/Video/V1/CompositionSettingsPage.php new file mode 100755 index 0000000..6d8ab4c --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/CompositionSettingsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CompositionSettingsInstance \Twilio\Rest\Video\V1\CompositionSettingsInstance + */ + public function buildInstance(array $payload): CompositionSettingsInstance + { + return new CompositionSettingsInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.CompositionSettingsPage]'; + } +} diff --git a/app/api/Twilio/Rest/Video/V1/RecordingContext.php b/app/api/Twilio/Rest/Video/V1/RecordingContext.php new file mode 100755 index 0000000..03141fb --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/RecordingContext.php @@ -0,0 +1,94 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Recordings/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the RecordingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the RecordingInstance + * + * @return RecordingInstance Fetched RecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RecordingInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new RecordingInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.RecordingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Video/V1/RecordingInstance.php b/app/api/Twilio/Rest/Video/V1/RecordingInstance.php new file mode 100755 index 0000000..e7e9e27 --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/RecordingInstance.php @@ -0,0 +1,162 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'status' => Values::array_get($payload, 'status'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'sid' => Values::array_get($payload, 'sid'), + 'sourceSid' => Values::array_get($payload, 'source_sid'), + 'size' => Values::array_get($payload, 'size'), + 'url' => Values::array_get($payload, 'url'), + 'type' => Values::array_get($payload, 'type'), + 'duration' => Values::array_get($payload, 'duration'), + 'containerFormat' => Values::array_get($payload, 'container_format'), + 'codec' => Values::array_get($payload, 'codec'), + 'groupingSids' => Values::array_get($payload, 'grouping_sids'), + 'trackName' => Values::array_get($payload, 'track_name'), + 'offset' => Values::array_get($payload, 'offset'), + 'mediaExternalLocation' => Values::array_get($payload, 'media_external_location'), + 'statusCallback' => Values::array_get($payload, 'status_callback'), + 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return RecordingContext Context for this RecordingInstance + */ + protected function proxy(): RecordingContext + { + if (!$this->context) { + $this->context = new RecordingContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the RecordingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the RecordingInstance + * + * @return RecordingInstance Fetched RecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RecordingInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.RecordingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Video/V1/RecordingList.php b/app/api/Twilio/Rest/Video/V1/RecordingList.php new file mode 100755 index 0000000..0bf1394 --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/RecordingList.php @@ -0,0 +1,179 @@ +solution = [ + ]; + + $this->uri = '/Recordings'; + } + + /** + * Reads RecordingInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return RecordingInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams RecordingInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of RecordingInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return RecordingPage Page of RecordingInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): RecordingPage + { + $options = new Values($options); + + $params = Values::of([ + 'Status' => + $options['status'], + 'SourceSid' => + $options['sourceSid'], + 'GroupingSid' => + Serialize::map($options['groupingSid'], function ($e) { return $e; }), + 'DateCreatedAfter' => + Serialize::iso8601DateTime($options['dateCreatedAfter']), + 'DateCreatedBefore' => + Serialize::iso8601DateTime($options['dateCreatedBefore']), + 'MediaType' => + $options['mediaType'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new RecordingPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of RecordingInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return RecordingPage Page of RecordingInstance + */ + public function getPage(string $targetUrl): RecordingPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new RecordingPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a RecordingContext + * + * @param string $sid The SID of the Recording resource to delete. + */ + public function getContext( + string $sid + + ): RecordingContext + { + return new RecordingContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.RecordingList]'; + } +} diff --git a/app/api/Twilio/Rest/Video/V1/RecordingOptions.php b/app/api/Twilio/Rest/Video/V1/RecordingOptions.php new file mode 100755 index 0000000..6a5a74f --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/RecordingOptions.php @@ -0,0 +1,170 @@ +options['status'] = $status; + $this->options['sourceSid'] = $sourceSid; + $this->options['groupingSid'] = $groupingSid; + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + $this->options['mediaType'] = $mediaType; + } + + /** + * Read only the recordings that have this status. Can be: `processing`, `completed`, or `deleted`. + * + * @param string $status Read only the recordings that have this status. Can be: `processing`, `completed`, or `deleted`. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Read only the recordings that have this `source_sid`. + * + * @param string $sourceSid Read only the recordings that have this `source_sid`. + * @return $this Fluent Builder + */ + public function setSourceSid(string $sourceSid): self + { + $this->options['sourceSid'] = $sourceSid; + return $this; + } + + /** + * Read only recordings with this `grouping_sid`, which may include a `participant_sid` and/or a `room_sid`. + * + * @param string[] $groupingSid Read only recordings with this `grouping_sid`, which may include a `participant_sid` and/or a `room_sid`. + * @return $this Fluent Builder + */ + public function setGroupingSid(array $groupingSid): self + { + $this->options['groupingSid'] = $groupingSid; + return $this; + } + + /** + * Read only recordings that started on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone. + * + * @param \DateTime $dateCreatedAfter Read only recordings that started on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone. + * @return $this Fluent Builder + */ + public function setDateCreatedAfter(\DateTime $dateCreatedAfter): self + { + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + return $this; + } + + /** + * Read only recordings that started before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone, given as `YYYY-MM-DDThh:mm:ss+|-hh:mm` or `YYYY-MM-DDThh:mm:ssZ`. + * + * @param \DateTime $dateCreatedBefore Read only recordings that started before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date-time with time zone, given as `YYYY-MM-DDThh:mm:ss+|-hh:mm` or `YYYY-MM-DDThh:mm:ssZ`. + * @return $this Fluent Builder + */ + public function setDateCreatedBefore(\DateTime $dateCreatedBefore): self + { + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + return $this; + } + + /** + * Read only recordings that have this media type. Can be either `audio` or `video`. + * + * @param string $mediaType Read only recordings that have this media type. Can be either `audio` or `video`. + * @return $this Fluent Builder + */ + public function setMediaType(string $mediaType): self + { + $this->options['mediaType'] = $mediaType; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Video.V1.ReadRecordingOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Video/V1/RecordingPage.php b/app/api/Twilio/Rest/Video/V1/RecordingPage.php new file mode 100755 index 0000000..79ff7f2 --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/RecordingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RecordingInstance \Twilio\Rest\Video\V1\RecordingInstance + */ + public function buildInstance(array $payload): RecordingInstance + { + return new RecordingInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.RecordingPage]'; + } +} diff --git a/app/api/Twilio/Rest/Video/V1/RecordingSettingsContext.php b/app/api/Twilio/Rest/Video/V1/RecordingSettingsContext.php new file mode 100755 index 0000000..5ca46e3 --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/RecordingSettingsContext.php @@ -0,0 +1,115 @@ +solution = [ + ]; + + $this->uri = '/RecordingSettings/Default'; + } + + /** + * Create the RecordingSettingsInstance + * + * @param string $friendlyName A descriptive string that you create to describe the resource and be shown to users in the console + * @param array|Options $options Optional Arguments + * @return RecordingSettingsInstance Created RecordingSettingsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, array $options = []): RecordingSettingsInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $friendlyName, + 'AwsCredentialsSid' => + $options['awsCredentialsSid'], + 'EncryptionKeySid' => + $options['encryptionKeySid'], + 'AwsS3Url' => + $options['awsS3Url'], + 'AwsStorageEnabled' => + Serialize::booleanToString($options['awsStorageEnabled']), + 'EncryptionEnabled' => + Serialize::booleanToString($options['encryptionEnabled']), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new RecordingSettingsInstance( + $this->version, + $payload + ); + } + + + /** + * Fetch the RecordingSettingsInstance + * + * @return RecordingSettingsInstance Fetched RecordingSettingsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RecordingSettingsInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new RecordingSettingsInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.RecordingSettingsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Video/V1/RecordingSettingsInstance.php b/app/api/Twilio/Rest/Video/V1/RecordingSettingsInstance.php new file mode 100755 index 0000000..ac09abe --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/RecordingSettingsInstance.php @@ -0,0 +1,142 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'awsCredentialsSid' => Values::array_get($payload, 'aws_credentials_sid'), + 'awsS3Url' => Values::array_get($payload, 'aws_s3_url'), + 'awsStorageEnabled' => Values::array_get($payload, 'aws_storage_enabled'), + 'encryptionKeySid' => Values::array_get($payload, 'encryption_key_sid'), + 'encryptionEnabled' => Values::array_get($payload, 'encryption_enabled'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = []; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return RecordingSettingsContext Context for this RecordingSettingsInstance + */ + protected function proxy(): RecordingSettingsContext + { + if (!$this->context) { + $this->context = new RecordingSettingsContext( + $this->version + ); + } + + return $this->context; + } + + /** + * Create the RecordingSettingsInstance + * + * @param string $friendlyName A descriptive string that you create to describe the resource and be shown to users in the console + * @param array|Options $options Optional Arguments + * @return RecordingSettingsInstance Created RecordingSettingsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $friendlyName, array $options = []): RecordingSettingsInstance + { + + return $this->proxy()->create($friendlyName, $options); + } + + /** + * Fetch the RecordingSettingsInstance + * + * @return RecordingSettingsInstance Fetched RecordingSettingsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RecordingSettingsInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.RecordingSettingsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Video/V1/RecordingSettingsList.php b/app/api/Twilio/Rest/Video/V1/RecordingSettingsList.php new file mode 100755 index 0000000..e85f1cf --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/RecordingSettingsList.php @@ -0,0 +1,61 @@ +solution = [ + ]; + } + + /** + * Constructs a RecordingSettingsContext + */ + public function getContext( + + ): RecordingSettingsContext + { + return new RecordingSettingsContext( + $this->version + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.RecordingSettingsList]'; + } +} diff --git a/app/api/Twilio/Rest/Video/V1/RecordingSettingsOptions.php b/app/api/Twilio/Rest/Video/V1/RecordingSettingsOptions.php new file mode 100755 index 0000000..999b09a --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/RecordingSettingsOptions.php @@ -0,0 +1,150 @@ +RFC 3986. + * @param bool $awsStorageEnabled Whether all recordings should be written to the `aws_s3_url`. When `false`, all recordings are stored in our cloud. + * @param bool $encryptionEnabled Whether all recordings should be stored in an encrypted form. The default is `false`. + * @return CreateRecordingSettingsOptions Options builder + */ + public static function create( + + string $awsCredentialsSid = Values::NONE, + string $encryptionKeySid = Values::NONE, + string $awsS3Url = Values::NONE, + bool $awsStorageEnabled = Values::BOOL_NONE, + bool $encryptionEnabled = Values::BOOL_NONE + + ): CreateRecordingSettingsOptions + { + return new CreateRecordingSettingsOptions( + $awsCredentialsSid, + $encryptionKeySid, + $awsS3Url, + $awsStorageEnabled, + $encryptionEnabled + ); + } + + +} + +class CreateRecordingSettingsOptions extends Options + { + /** + * @param string $awsCredentialsSid The SID of the stored Credential resource. + * @param string $encryptionKeySid The SID of the Public Key resource to use for encryption. + * @param string $awsS3Url The URL of the AWS S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986. + * @param bool $awsStorageEnabled Whether all recordings should be written to the `aws_s3_url`. When `false`, all recordings are stored in our cloud. + * @param bool $encryptionEnabled Whether all recordings should be stored in an encrypted form. The default is `false`. + */ + public function __construct( + + string $awsCredentialsSid = Values::NONE, + string $encryptionKeySid = Values::NONE, + string $awsS3Url = Values::NONE, + bool $awsStorageEnabled = Values::BOOL_NONE, + bool $encryptionEnabled = Values::BOOL_NONE + + ) { + $this->options['awsCredentialsSid'] = $awsCredentialsSid; + $this->options['encryptionKeySid'] = $encryptionKeySid; + $this->options['awsS3Url'] = $awsS3Url; + $this->options['awsStorageEnabled'] = $awsStorageEnabled; + $this->options['encryptionEnabled'] = $encryptionEnabled; + } + + /** + * The SID of the stored Credential resource. + * + * @param string $awsCredentialsSid The SID of the stored Credential resource. + * @return $this Fluent Builder + */ + public function setAwsCredentialsSid(string $awsCredentialsSid): self + { + $this->options['awsCredentialsSid'] = $awsCredentialsSid; + return $this; + } + + /** + * The SID of the Public Key resource to use for encryption. + * + * @param string $encryptionKeySid The SID of the Public Key resource to use for encryption. + * @return $this Fluent Builder + */ + public function setEncryptionKeySid(string $encryptionKeySid): self + { + $this->options['encryptionKeySid'] = $encryptionKeySid; + return $this; + } + + /** + * The URL of the AWS S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986. + * + * @param string $awsS3Url The URL of the AWS S3 bucket where the recordings should be stored. We only support DNS-compliant URLs like `https://documentation-example-twilio-bucket/recordings`, where `recordings` is the path in which you want the recordings to be stored. This URL accepts only URI-valid characters, as described in the RFC 3986. + * @return $this Fluent Builder + */ + public function setAwsS3Url(string $awsS3Url): self + { + $this->options['awsS3Url'] = $awsS3Url; + return $this; + } + + /** + * Whether all recordings should be written to the `aws_s3_url`. When `false`, all recordings are stored in our cloud. + * + * @param bool $awsStorageEnabled Whether all recordings should be written to the `aws_s3_url`. When `false`, all recordings are stored in our cloud. + * @return $this Fluent Builder + */ + public function setAwsStorageEnabled(bool $awsStorageEnabled): self + { + $this->options['awsStorageEnabled'] = $awsStorageEnabled; + return $this; + } + + /** + * Whether all recordings should be stored in an encrypted form. The default is `false`. + * + * @param bool $encryptionEnabled Whether all recordings should be stored in an encrypted form. The default is `false`. + * @return $this Fluent Builder + */ + public function setEncryptionEnabled(bool $encryptionEnabled): self + { + $this->options['encryptionEnabled'] = $encryptionEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Video.V1.CreateRecordingSettingsOptions ' . $options . ']'; + } +} + + diff --git a/app/api/Twilio/Rest/Video/V1/RecordingSettingsPage.php b/app/api/Twilio/Rest/Video/V1/RecordingSettingsPage.php new file mode 100755 index 0000000..256152f --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/RecordingSettingsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RecordingSettingsInstance \Twilio\Rest\Video\V1\RecordingSettingsInstance + */ + public function buildInstance(array $payload): RecordingSettingsInstance + { + return new RecordingSettingsInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.RecordingSettingsPage]'; + } +} diff --git a/app/api/Twilio/Rest/Video/V1/Room/Participant/AnonymizeContext.php b/app/api/Twilio/Rest/Video/V1/Room/Participant/AnonymizeContext.php new file mode 100755 index 0000000..ef0a64d --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/Room/Participant/AnonymizeContext.php @@ -0,0 +1,87 @@ +solution = [ + 'roomSid' => + $roomSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Rooms/' . \rawurlencode($roomSid) + .'/Participants/' . \rawurlencode($sid) + .'/Anonymize'; + } + + /** + * Update the AnonymizeInstance + * + * @return AnonymizeInstance Updated AnonymizeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(): AnonymizeInstance + { + + $payload = $this->version->update('POST', $this->uri); + + return new AnonymizeInstance( + $this->version, + $payload, + $this->solution['roomSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.AnonymizeContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Video/V1/Room/Participant/AnonymizeInstance.php b/app/api/Twilio/Rest/Video/V1/Room/Participant/AnonymizeInstance.php new file mode 100755 index 0000000..95f7f22 --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/Room/Participant/AnonymizeInstance.php @@ -0,0 +1,138 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'roomSid' => Values::array_get($payload, 'room_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'status' => Values::array_get($payload, 'status'), + 'identity' => Values::array_get($payload, 'identity'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), + 'endTime' => Deserialize::dateTime(Values::array_get($payload, 'end_time')), + 'duration' => Values::array_get($payload, 'duration'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['roomSid' => $roomSid, 'sid' => $sid, ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return AnonymizeContext Context for this AnonymizeInstance + */ + protected function proxy(): AnonymizeContext + { + if (!$this->context) { + $this->context = new AnonymizeContext( + $this->version, + $this->solution['roomSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Update the AnonymizeInstance + * + * @return AnonymizeInstance Updated AnonymizeInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(): AnonymizeInstance + { + + return $this->proxy()->update(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.AnonymizeInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Video/V1/Room/Participant/AnonymizeList.php b/app/api/Twilio/Rest/Video/V1/Room/Participant/AnonymizeList.php new file mode 100755 index 0000000..e9d0420 --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/Room/Participant/AnonymizeList.php @@ -0,0 +1,73 @@ +solution = [ + 'roomSid' => + $roomSid, + + 'sid' => + $sid, + + ]; + } + + /** + * Constructs a AnonymizeContext + */ + public function getContext( + + ): AnonymizeContext + { + return new AnonymizeContext( + $this->version, + $this->solution['roomSid'], + $this->solution['sid'] + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.AnonymizeList]'; + } +} diff --git a/app/api/Twilio/Rest/Video/V1/Room/Participant/AnonymizePage.php b/app/api/Twilio/Rest/Video/V1/Room/Participant/AnonymizePage.php new file mode 100755 index 0000000..3eb1cd5 --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/Room/Participant/AnonymizePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return AnonymizeInstance \Twilio\Rest\Video\V1\Room\Participant\AnonymizeInstance + */ + public function buildInstance(array $payload): AnonymizeInstance + { + return new AnonymizeInstance($this->version, $payload, $this->solution['roomSid'], $this->solution['sid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.AnonymizePage]'; + } +} diff --git a/app/api/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackContext.php b/app/api/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackContext.php new file mode 100755 index 0000000..b5c55e2 --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackContext.php @@ -0,0 +1,93 @@ +solution = [ + 'roomSid' => + $roomSid, + 'participantSid' => + $participantSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Rooms/' . \rawurlencode($roomSid) + .'/Participants/' . \rawurlencode($participantSid) + .'/PublishedTracks/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the PublishedTrackInstance + * + * @return PublishedTrackInstance Fetched PublishedTrackInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PublishedTrackInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new PublishedTrackInstance( + $this->version, + $payload, + $this->solution['roomSid'], + $this->solution['participantSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.PublishedTrackContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackInstance.php b/app/api/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackInstance.php new file mode 100755 index 0000000..a057cb2 --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackInstance.php @@ -0,0 +1,136 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'participantSid' => Values::array_get($payload, 'participant_sid'), + 'roomSid' => Values::array_get($payload, 'room_sid'), + 'name' => Values::array_get($payload, 'name'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'enabled' => Values::array_get($payload, 'enabled'), + 'kind' => Values::array_get($payload, 'kind'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['roomSid' => $roomSid, 'participantSid' => $participantSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return PublishedTrackContext Context for this PublishedTrackInstance + */ + protected function proxy(): PublishedTrackContext + { + if (!$this->context) { + $this->context = new PublishedTrackContext( + $this->version, + $this->solution['roomSid'], + $this->solution['participantSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the PublishedTrackInstance + * + * @return PublishedTrackInstance Fetched PublishedTrackInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): PublishedTrackInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.PublishedTrackInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackList.php b/app/api/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackList.php new file mode 100755 index 0000000..c008d60 --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackList.php @@ -0,0 +1,175 @@ +solution = [ + 'roomSid' => + $roomSid, + + 'participantSid' => + $participantSid, + + ]; + + $this->uri = '/Rooms/' . \rawurlencode($roomSid) + .'/Participants/' . \rawurlencode($participantSid) + .'/PublishedTracks'; + } + + /** + * Reads PublishedTrackInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return PublishedTrackInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams PublishedTrackInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of PublishedTrackInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return PublishedTrackPage Page of PublishedTrackInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): PublishedTrackPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new PublishedTrackPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of PublishedTrackInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return PublishedTrackPage Page of PublishedTrackInstance + */ + public function getPage(string $targetUrl): PublishedTrackPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new PublishedTrackPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a PublishedTrackContext + * + * @param string $sid The SID of the RoomParticipantPublishedTrack resource to fetch. + */ + public function getContext( + string $sid + + ): PublishedTrackContext + { + return new PublishedTrackContext( + $this->version, + $this->solution['roomSid'], + $this->solution['participantSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.PublishedTrackList]'; + } +} diff --git a/app/api/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackPage.php b/app/api/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackPage.php new file mode 100755 index 0000000..d19fd1e --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/Room/Participant/PublishedTrackPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return PublishedTrackInstance \Twilio\Rest\Video\V1\Room\Participant\PublishedTrackInstance + */ + public function buildInstance(array $payload): PublishedTrackInstance + { + return new PublishedTrackInstance($this->version, $payload, $this->solution['roomSid'], $this->solution['participantSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.PublishedTrackPage]'; + } +} diff --git a/app/api/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesInstance.php b/app/api/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesInstance.php new file mode 100755 index 0000000..5a0de4d --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesInstance.php @@ -0,0 +1,91 @@ +properties = [ + 'participantSid' => Values::array_get($payload, 'participant_sid'), + 'roomSid' => Values::array_get($payload, 'room_sid'), + 'rules' => Values::array_get($payload, 'rules'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + ]; + + $this->solution = ['roomSid' => $roomSid, 'participantSid' => $participantSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.SubscribeRulesInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesList.php b/app/api/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesList.php new file mode 100755 index 0000000..d2bbd7e --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesList.php @@ -0,0 +1,115 @@ +solution = [ + 'roomSid' => + $roomSid, + + 'participantSid' => + $participantSid, + + ]; + + $this->uri = '/Rooms/' . \rawurlencode($roomSid) + .'/Participants/' . \rawurlencode($participantSid) + .'/SubscribeRules'; + } + + /** + * Fetch the SubscribeRulesInstance + * + * @return SubscribeRulesInstance Fetched SubscribeRulesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SubscribeRulesInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new SubscribeRulesInstance( + $this->version, + $payload, + $this->solution['roomSid'], + $this->solution['participantSid'] + ); + } + + + /** + * Update the SubscribeRulesInstance + * + * @param array|Options $options Optional Arguments + * @return SubscribeRulesInstance Updated SubscribeRulesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SubscribeRulesInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Rules' => + Serialize::jsonObject($options['rules']), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new SubscribeRulesInstance( + $this->version, + $payload, + $this->solution['roomSid'], + $this->solution['participantSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.SubscribeRulesList]'; + } +} diff --git a/app/api/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesOptions.php b/app/api/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesOptions.php new file mode 100755 index 0000000..b8d7cb5 --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesOptions.php @@ -0,0 +1,78 @@ +options['rules'] = $rules; + } + + /** + * A JSON-encoded array of subscribe rules. See the [Specifying Subscribe Rules](https://www.twilio.com/docs/video/api/track-subscriptions#specifying-sr) section for further information. + * + * @param array $rules A JSON-encoded array of subscribe rules. See the [Specifying Subscribe Rules](https://www.twilio.com/docs/video/api/track-subscriptions#specifying-sr) section for further information. + * @return $this Fluent Builder + */ + public function setRules(array $rules): self + { + $this->options['rules'] = $rules; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Video.V1.UpdateSubscribeRulesOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesPage.php b/app/api/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesPage.php new file mode 100755 index 0000000..e52f7cf --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/Room/Participant/SubscribeRulesPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SubscribeRulesInstance \Twilio\Rest\Video\V1\Room\Participant\SubscribeRulesInstance + */ + public function buildInstance(array $payload): SubscribeRulesInstance + { + return new SubscribeRulesInstance($this->version, $payload, $this->solution['roomSid'], $this->solution['participantSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.SubscribeRulesPage]'; + } +} diff --git a/app/api/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackContext.php b/app/api/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackContext.php new file mode 100755 index 0000000..7db1440 --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackContext.php @@ -0,0 +1,93 @@ +solution = [ + 'roomSid' => + $roomSid, + 'participantSid' => + $participantSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Rooms/' . \rawurlencode($roomSid) + .'/Participants/' . \rawurlencode($participantSid) + .'/SubscribedTracks/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the SubscribedTrackInstance + * + * @return SubscribedTrackInstance Fetched SubscribedTrackInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SubscribedTrackInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new SubscribedTrackInstance( + $this->version, + $payload, + $this->solution['roomSid'], + $this->solution['participantSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.SubscribedTrackContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackInstance.php b/app/api/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackInstance.php new file mode 100755 index 0000000..0b2a0b3 --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackInstance.php @@ -0,0 +1,138 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'participantSid' => Values::array_get($payload, 'participant_sid'), + 'publisherSid' => Values::array_get($payload, 'publisher_sid'), + 'roomSid' => Values::array_get($payload, 'room_sid'), + 'name' => Values::array_get($payload, 'name'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'enabled' => Values::array_get($payload, 'enabled'), + 'kind' => Values::array_get($payload, 'kind'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['roomSid' => $roomSid, 'participantSid' => $participantSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SubscribedTrackContext Context for this SubscribedTrackInstance + */ + protected function proxy(): SubscribedTrackContext + { + if (!$this->context) { + $this->context = new SubscribedTrackContext( + $this->version, + $this->solution['roomSid'], + $this->solution['participantSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the SubscribedTrackInstance + * + * @return SubscribedTrackInstance Fetched SubscribedTrackInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SubscribedTrackInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.SubscribedTrackInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackList.php b/app/api/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackList.php new file mode 100755 index 0000000..41da244 --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackList.php @@ -0,0 +1,175 @@ +solution = [ + 'roomSid' => + $roomSid, + + 'participantSid' => + $participantSid, + + ]; + + $this->uri = '/Rooms/' . \rawurlencode($roomSid) + .'/Participants/' . \rawurlencode($participantSid) + .'/SubscribedTracks'; + } + + /** + * Reads SubscribedTrackInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return SubscribedTrackInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams SubscribedTrackInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SubscribedTrackInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return SubscribedTrackPage Page of SubscribedTrackInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SubscribedTrackPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SubscribedTrackPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SubscribedTrackInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SubscribedTrackPage Page of SubscribedTrackInstance + */ + public function getPage(string $targetUrl): SubscribedTrackPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SubscribedTrackPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SubscribedTrackContext + * + * @param string $sid The SID of the RoomParticipantSubscribedTrack resource to fetch. + */ + public function getContext( + string $sid + + ): SubscribedTrackContext + { + return new SubscribedTrackContext( + $this->version, + $this->solution['roomSid'], + $this->solution['participantSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.SubscribedTrackList]'; + } +} diff --git a/app/api/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackPage.php b/app/api/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackPage.php new file mode 100755 index 0000000..422d9d0 --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/Room/Participant/SubscribedTrackPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SubscribedTrackInstance \Twilio\Rest\Video\V1\Room\Participant\SubscribedTrackInstance + */ + public function buildInstance(array $payload): SubscribedTrackInstance + { + return new SubscribedTrackInstance($this->version, $payload, $this->solution['roomSid'], $this->solution['participantSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.SubscribedTrackPage]'; + } +} diff --git a/app/api/Twilio/Rest/Video/V1/Room/ParticipantContext.php b/app/api/Twilio/Rest/Video/V1/Room/ParticipantContext.php new file mode 100755 index 0000000..5eb271d --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/Room/ParticipantContext.php @@ -0,0 +1,235 @@ +solution = [ + 'roomSid' => + $roomSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Rooms/' . \rawurlencode($roomSid) + .'/Participants/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the ParticipantInstance + * + * @return ParticipantInstance Fetched ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ParticipantInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ParticipantInstance( + $this->version, + $payload, + $this->solution['roomSid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ParticipantInstance + * + * @param array|Options $options Optional Arguments + * @return ParticipantInstance Updated ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ParticipantInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Status' => + $options['status'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new ParticipantInstance( + $this->version, + $payload, + $this->solution['roomSid'], + $this->solution['sid'] + ); + } + + + /** + * Access the subscribeRules + */ + protected function getSubscribeRules(): SubscribeRulesList + { + if (!$this->_subscribeRules) { + $this->_subscribeRules = new SubscribeRulesList( + $this->version, + $this->solution['roomSid'], + $this->solution['sid'] + ); + } + + return $this->_subscribeRules; + } + + /** + * Access the subscribedTracks + */ + protected function getSubscribedTracks(): SubscribedTrackList + { + if (!$this->_subscribedTracks) { + $this->_subscribedTracks = new SubscribedTrackList( + $this->version, + $this->solution['roomSid'], + $this->solution['sid'] + ); + } + + return $this->_subscribedTracks; + } + + /** + * Access the publishedTracks + */ + protected function getPublishedTracks(): PublishedTrackList + { + if (!$this->_publishedTracks) { + $this->_publishedTracks = new PublishedTrackList( + $this->version, + $this->solution['roomSid'], + $this->solution['sid'] + ); + } + + return $this->_publishedTracks; + } + + /** + * Access the anonymize + */ + protected function getAnonymize(): AnonymizeList + { + if (!$this->_anonymize) { + $this->_anonymize = new AnonymizeList( + $this->version, + $this->solution['roomSid'], + $this->solution['sid'] + ); + } + + return $this->_anonymize; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.ParticipantContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Video/V1/Room/ParticipantInstance.php b/app/api/Twilio/Rest/Video/V1/Room/ParticipantInstance.php new file mode 100755 index 0000000..4057e4b --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/Room/ParticipantInstance.php @@ -0,0 +1,195 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'roomSid' => Values::array_get($payload, 'room_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'status' => Values::array_get($payload, 'status'), + 'identity' => Values::array_get($payload, 'identity'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'startTime' => Deserialize::dateTime(Values::array_get($payload, 'start_time')), + 'endTime' => Deserialize::dateTime(Values::array_get($payload, 'end_time')), + 'duration' => Values::array_get($payload, 'duration'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['roomSid' => $roomSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ParticipantContext Context for this ParticipantInstance + */ + protected function proxy(): ParticipantContext + { + if (!$this->context) { + $this->context = new ParticipantContext( + $this->version, + $this->solution['roomSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the ParticipantInstance + * + * @return ParticipantInstance Fetched ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ParticipantInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ParticipantInstance + * + * @param array|Options $options Optional Arguments + * @return ParticipantInstance Updated ParticipantInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ParticipantInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the subscribeRules + */ + protected function getSubscribeRules(): SubscribeRulesList + { + return $this->proxy()->subscribeRules; + } + + /** + * Access the subscribedTracks + */ + protected function getSubscribedTracks(): SubscribedTrackList + { + return $this->proxy()->subscribedTracks; + } + + /** + * Access the publishedTracks + */ + protected function getPublishedTracks(): PublishedTrackList + { + return $this->proxy()->publishedTracks; + } + + /** + * Access the anonymize + */ + protected function getAnonymize(): AnonymizeList + { + return $this->proxy()->anonymize; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.ParticipantInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Video/V1/Room/ParticipantList.php b/app/api/Twilio/Rest/Video/V1/Room/ParticipantList.php new file mode 100755 index 0000000..95a63fd --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/Room/ParticipantList.php @@ -0,0 +1,182 @@ +solution = [ + 'roomSid' => + $roomSid, + + ]; + + $this->uri = '/Rooms/' . \rawurlencode($roomSid) + .'/Participants'; + } + + /** + * Reads ParticipantInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ParticipantInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams ParticipantInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ParticipantInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ParticipantPage Page of ParticipantInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ParticipantPage + { + $options = new Values($options); + + $params = Values::of([ + 'Status' => + $options['status'], + 'Identity' => + $options['identity'], + 'DateCreatedAfter' => + Serialize::iso8601DateTime($options['dateCreatedAfter']), + 'DateCreatedBefore' => + Serialize::iso8601DateTime($options['dateCreatedBefore']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ParticipantPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ParticipantInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ParticipantPage Page of ParticipantInstance + */ + public function getPage(string $targetUrl): ParticipantPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ParticipantPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ParticipantContext + * + * @param string $sid The SID of the RoomParticipant resource to fetch. + */ + public function getContext( + string $sid + + ): ParticipantContext + { + return new ParticipantContext( + $this->version, + $this->solution['roomSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.ParticipantList]'; + } +} diff --git a/app/api/Twilio/Rest/Video/V1/Room/ParticipantOptions.php b/app/api/Twilio/Rest/Video/V1/Room/ParticipantOptions.php new file mode 100755 index 0000000..4fb1f33 --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/Room/ParticipantOptions.php @@ -0,0 +1,182 @@ +options['status'] = $status; + $this->options['identity'] = $identity; + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + } + + /** + * Read only the participants with this status. Can be: `connected` or `disconnected`. For `in-progress` Rooms the default Status is `connected`, for `completed` Rooms only `disconnected` Participants are returned. + * + * @param string $status Read only the participants with this status. Can be: `connected` or `disconnected`. For `in-progress` Rooms the default Status is `connected`, for `completed` Rooms only `disconnected` Participants are returned. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Read only the Participants with this [User](https://www.twilio.com/docs/chat/rest/user-resource) `identity` value. + * + * @param string $identity Read only the Participants with this [User](https://www.twilio.com/docs/chat/rest/user-resource) `identity` value. + * @return $this Fluent Builder + */ + public function setIdentity(string $identity): self + { + $this->options['identity'] = $identity; + return $this; + } + + /** + * Read only Participants that started after this date in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. + * + * @param \DateTime $dateCreatedAfter Read only Participants that started after this date in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. + * @return $this Fluent Builder + */ + public function setDateCreatedAfter(\DateTime $dateCreatedAfter): self + { + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + return $this; + } + + /** + * Read only Participants that started before this date in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. + * + * @param \DateTime $dateCreatedBefore Read only Participants that started before this date in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#UTC) format. + * @return $this Fluent Builder + */ + public function setDateCreatedBefore(\DateTime $dateCreatedBefore): self + { + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Video.V1.ReadParticipantOptions ' . $options . ']'; + } +} + +class UpdateParticipantOptions extends Options + { + /** + * @param string $status + */ + public function __construct( + + string $status = Values::NONE + + ) { + $this->options['status'] = $status; + } + + /** + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Video.V1.UpdateParticipantOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Video/V1/Room/ParticipantPage.php b/app/api/Twilio/Rest/Video/V1/Room/ParticipantPage.php new file mode 100755 index 0000000..91ad1d1 --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/Room/ParticipantPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ParticipantInstance \Twilio\Rest\Video\V1\Room\ParticipantInstance + */ + public function buildInstance(array $payload): ParticipantInstance + { + return new ParticipantInstance($this->version, $payload, $this->solution['roomSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.ParticipantPage]'; + } +} diff --git a/app/api/Twilio/Rest/Video/V1/Room/RecordingRulesInstance.php b/app/api/Twilio/Rest/Video/V1/Room/RecordingRulesInstance.php new file mode 100755 index 0000000..fd7665b --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/Room/RecordingRulesInstance.php @@ -0,0 +1,88 @@ +properties = [ + 'roomSid' => Values::array_get($payload, 'room_sid'), + 'rules' => Values::array_get($payload, 'rules'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + ]; + + $this->solution = ['roomSid' => $roomSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.RecordingRulesInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Video/V1/Room/RecordingRulesList.php b/app/api/Twilio/Rest/Video/V1/Room/RecordingRulesList.php new file mode 100755 index 0000000..b22f503 --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/Room/RecordingRulesList.php @@ -0,0 +1,107 @@ +solution = [ + 'roomSid' => + $roomSid, + + ]; + + $this->uri = '/Rooms/' . \rawurlencode($roomSid) + .'/RecordingRules'; + } + + /** + * Fetch the RecordingRulesInstance + * + * @return RecordingRulesInstance Fetched RecordingRulesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RecordingRulesInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new RecordingRulesInstance( + $this->version, + $payload, + $this->solution['roomSid'] + ); + } + + + /** + * Update the RecordingRulesInstance + * + * @param array|Options $options Optional Arguments + * @return RecordingRulesInstance Updated RecordingRulesInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): RecordingRulesInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Rules' => + Serialize::jsonObject($options['rules']), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new RecordingRulesInstance( + $this->version, + $payload, + $this->solution['roomSid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.RecordingRulesList]'; + } +} diff --git a/app/api/Twilio/Rest/Video/V1/Room/RecordingRulesOptions.php b/app/api/Twilio/Rest/Video/V1/Room/RecordingRulesOptions.php new file mode 100755 index 0000000..f9f020e --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/Room/RecordingRulesOptions.php @@ -0,0 +1,78 @@ +options['rules'] = $rules; + } + + /** + * A JSON-encoded array of recording rules. + * + * @param array $rules A JSON-encoded array of recording rules. + * @return $this Fluent Builder + */ + public function setRules(array $rules): self + { + $this->options['rules'] = $rules; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Video.V1.UpdateRecordingRulesOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Video/V1/Room/RecordingRulesPage.php b/app/api/Twilio/Rest/Video/V1/Room/RecordingRulesPage.php new file mode 100755 index 0000000..ec52eec --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/Room/RecordingRulesPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RecordingRulesInstance \Twilio\Rest\Video\V1\Room\RecordingRulesInstance + */ + public function buildInstance(array $payload): RecordingRulesInstance + { + return new RecordingRulesInstance($this->version, $payload, $this->solution['roomSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.RecordingRulesPage]'; + } +} diff --git a/app/api/Twilio/Rest/Video/V1/Room/RoomRecordingContext.php b/app/api/Twilio/Rest/Video/V1/Room/RoomRecordingContext.php new file mode 100755 index 0000000..6535a9f --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/Room/RoomRecordingContext.php @@ -0,0 +1,100 @@ +solution = [ + 'roomSid' => + $roomSid, + 'sid' => + $sid, + ]; + + $this->uri = '/Rooms/' . \rawurlencode($roomSid) + .'/Recordings/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the RoomRecordingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the RoomRecordingInstance + * + * @return RoomRecordingInstance Fetched RoomRecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RoomRecordingInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new RoomRecordingInstance( + $this->version, + $payload, + $this->solution['roomSid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.RoomRecordingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Video/V1/Room/RoomRecordingInstance.php b/app/api/Twilio/Rest/Video/V1/Room/RoomRecordingInstance.php new file mode 100755 index 0000000..153f821 --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/Room/RoomRecordingInstance.php @@ -0,0 +1,162 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'status' => Values::array_get($payload, 'status'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'sid' => Values::array_get($payload, 'sid'), + 'sourceSid' => Values::array_get($payload, 'source_sid'), + 'size' => Values::array_get($payload, 'size'), + 'url' => Values::array_get($payload, 'url'), + 'type' => Values::array_get($payload, 'type'), + 'duration' => Values::array_get($payload, 'duration'), + 'containerFormat' => Values::array_get($payload, 'container_format'), + 'codec' => Values::array_get($payload, 'codec'), + 'groupingSids' => Values::array_get($payload, 'grouping_sids'), + 'trackName' => Values::array_get($payload, 'track_name'), + 'offset' => Values::array_get($payload, 'offset'), + 'mediaExternalLocation' => Values::array_get($payload, 'media_external_location'), + 'roomSid' => Values::array_get($payload, 'room_sid'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['roomSid' => $roomSid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return RoomRecordingContext Context for this RoomRecordingInstance + */ + protected function proxy(): RoomRecordingContext + { + if (!$this->context) { + $this->context = new RoomRecordingContext( + $this->version, + $this->solution['roomSid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the RoomRecordingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the RoomRecordingInstance + * + * @return RoomRecordingInstance Fetched RoomRecordingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RoomRecordingInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.RoomRecordingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Video/V1/Room/RoomRecordingList.php b/app/api/Twilio/Rest/Video/V1/Room/RoomRecordingList.php new file mode 100755 index 0000000..0ecbe73 --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/Room/RoomRecordingList.php @@ -0,0 +1,182 @@ +solution = [ + 'roomSid' => + $roomSid, + + ]; + + $this->uri = '/Rooms/' . \rawurlencode($roomSid) + .'/Recordings'; + } + + /** + * Reads RoomRecordingInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return RoomRecordingInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams RoomRecordingInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of RoomRecordingInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return RoomRecordingPage Page of RoomRecordingInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): RoomRecordingPage + { + $options = new Values($options); + + $params = Values::of([ + 'Status' => + $options['status'], + 'SourceSid' => + $options['sourceSid'], + 'DateCreatedAfter' => + Serialize::iso8601DateTime($options['dateCreatedAfter']), + 'DateCreatedBefore' => + Serialize::iso8601DateTime($options['dateCreatedBefore']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new RoomRecordingPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of RoomRecordingInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return RoomRecordingPage Page of RoomRecordingInstance + */ + public function getPage(string $targetUrl): RoomRecordingPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new RoomRecordingPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a RoomRecordingContext + * + * @param string $sid The SID of the RoomRecording resource to delete. + */ + public function getContext( + string $sid + + ): RoomRecordingContext + { + return new RoomRecordingContext( + $this->version, + $this->solution['roomSid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.RoomRecordingList]'; + } +} diff --git a/app/api/Twilio/Rest/Video/V1/Room/RoomRecordingOptions.php b/app/api/Twilio/Rest/Video/V1/Room/RoomRecordingOptions.php new file mode 100755 index 0000000..1934c37 --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/Room/RoomRecordingOptions.php @@ -0,0 +1,134 @@ +options['status'] = $status; + $this->options['sourceSid'] = $sourceSid; + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + } + + /** + * Read only the recordings with this status. Can be: `processing`, `completed`, or `deleted`. + * + * @param string $status Read only the recordings with this status. Can be: `processing`, `completed`, or `deleted`. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Read only the recordings that have this `source_sid`. + * + * @param string $sourceSid Read only the recordings that have this `source_sid`. + * @return $this Fluent Builder + */ + public function setSourceSid(string $sourceSid): self + { + $this->options['sourceSid'] = $sourceSid; + return $this; + } + + /** + * Read only recordings that started on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. + * + * @param \DateTime $dateCreatedAfter Read only recordings that started on or after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. + * @return $this Fluent Builder + */ + public function setDateCreatedAfter(\DateTime $dateCreatedAfter): self + { + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + return $this; + } + + /** + * Read only Recordings that started before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. + * + * @param \DateTime $dateCreatedBefore Read only Recordings that started before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime with time zone. + * @return $this Fluent Builder + */ + public function setDateCreatedBefore(\DateTime $dateCreatedBefore): self + { + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Video.V1.ReadRoomRecordingOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Video/V1/Room/RoomRecordingPage.php b/app/api/Twilio/Rest/Video/V1/Room/RoomRecordingPage.php new file mode 100755 index 0000000..38f1b01 --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/Room/RoomRecordingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RoomRecordingInstance \Twilio\Rest\Video\V1\Room\RoomRecordingInstance + */ + public function buildInstance(array $payload): RoomRecordingInstance + { + return new RoomRecordingInstance($this->version, $payload, $this->solution['roomSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.RoomRecordingPage]'; + } +} diff --git a/app/api/Twilio/Rest/Video/V1/RoomContext.php b/app/api/Twilio/Rest/Video/V1/RoomContext.php new file mode 100755 index 0000000..9a1140c --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/RoomContext.php @@ -0,0 +1,202 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Rooms/' . \rawurlencode($sid) + .''; + } + + /** + * Fetch the RoomInstance + * + * @return RoomInstance Fetched RoomInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RoomInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new RoomInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the RoomInstance + * + * @param string $status + * @return RoomInstance Updated RoomInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status): RoomInstance + { + + $data = Values::of([ + 'Status' => + $status, + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new RoomInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the recordingRules + */ + protected function getRecordingRules(): RecordingRulesList + { + if (!$this->_recordingRules) { + $this->_recordingRules = new RecordingRulesList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_recordingRules; + } + + /** + * Access the participants + */ + protected function getParticipants(): ParticipantList + { + if (!$this->_participants) { + $this->_participants = new ParticipantList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_participants; + } + + /** + * Access the recordings + */ + protected function getRecordings(): RoomRecordingList + { + if (!$this->_recordings) { + $this->_recordings = new RoomRecordingList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_recordings; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.RoomContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Video/V1/RoomInstance.php b/app/api/Twilio/Rest/Video/V1/RoomInstance.php new file mode 100755 index 0000000..7c30f39 --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/RoomInstance.php @@ -0,0 +1,206 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'status' => Values::array_get($payload, 'status'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'enableTurn' => Values::array_get($payload, 'enable_turn'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'statusCallback' => Values::array_get($payload, 'status_callback'), + 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), + 'endTime' => Deserialize::dateTime(Values::array_get($payload, 'end_time')), + 'duration' => Values::array_get($payload, 'duration'), + 'type' => Values::array_get($payload, 'type'), + 'maxParticipants' => Values::array_get($payload, 'max_participants'), + 'maxParticipantDuration' => Values::array_get($payload, 'max_participant_duration'), + 'maxConcurrentPublishedTracks' => Values::array_get($payload, 'max_concurrent_published_tracks'), + 'recordParticipantsOnConnect' => Values::array_get($payload, 'record_participants_on_connect'), + 'videoCodecs' => Values::array_get($payload, 'video_codecs'), + 'mediaRegion' => Values::array_get($payload, 'media_region'), + 'audioOnly' => Values::array_get($payload, 'audio_only'), + 'emptyRoomTimeout' => Values::array_get($payload, 'empty_room_timeout'), + 'unusedRoomTimeout' => Values::array_get($payload, 'unused_room_timeout'), + 'largeRoom' => Values::array_get($payload, 'large_room'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return RoomContext Context for this RoomInstance + */ + protected function proxy(): RoomContext + { + if (!$this->context) { + $this->context = new RoomContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Fetch the RoomInstance + * + * @return RoomInstance Fetched RoomInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RoomInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the RoomInstance + * + * @param string $status + * @return RoomInstance Updated RoomInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $status): RoomInstance + { + + return $this->proxy()->update($status); + } + + /** + * Access the recordingRules + */ + protected function getRecordingRules(): RecordingRulesList + { + return $this->proxy()->recordingRules; + } + + /** + * Access the participants + */ + protected function getParticipants(): ParticipantList + { + return $this->proxy()->participants; + } + + /** + * Access the recordings + */ + protected function getRecordings(): RoomRecordingList + { + return $this->proxy()->recordings; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Video.V1.RoomInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Video/V1/RoomList.php b/app/api/Twilio/Rest/Video/V1/RoomList.php new file mode 100755 index 0000000..b505f8a --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/RoomList.php @@ -0,0 +1,230 @@ +solution = [ + ]; + + $this->uri = '/Rooms'; + } + + /** + * Create the RoomInstance + * + * @param array|Options $options Optional Arguments + * @return RoomInstance Created RoomInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): RoomInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'EnableTurn' => + Serialize::booleanToString($options['enableTurn']), + 'Type' => + $options['type'], + 'UniqueName' => + $options['uniqueName'], + 'StatusCallback' => + $options['statusCallback'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'MaxParticipants' => + $options['maxParticipants'], + 'RecordParticipantsOnConnect' => + Serialize::booleanToString($options['recordParticipantsOnConnect']), + 'VideoCodecs' => + $options['videoCodecs'], + 'MediaRegion' => + $options['mediaRegion'], + 'RecordingRules' => + Serialize::jsonObject($options['recordingRules']), + 'AudioOnly' => + Serialize::booleanToString($options['audioOnly']), + 'MaxParticipantDuration' => + $options['maxParticipantDuration'], + 'EmptyRoomTimeout' => + $options['emptyRoomTimeout'], + 'UnusedRoomTimeout' => + $options['unusedRoomTimeout'], + 'LargeRoom' => + Serialize::booleanToString($options['largeRoom']), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new RoomInstance( + $this->version, + $payload + ); + } + + + /** + * Reads RoomInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return RoomInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams RoomInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of RoomInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return RoomPage Page of RoomInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): RoomPage + { + $options = new Values($options); + + $params = Values::of([ + 'Status' => + $options['status'], + 'UniqueName' => + $options['uniqueName'], + 'DateCreatedAfter' => + Serialize::iso8601DateTime($options['dateCreatedAfter']), + 'DateCreatedBefore' => + Serialize::iso8601DateTime($options['dateCreatedBefore']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new RoomPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of RoomInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return RoomPage Page of RoomInstance + */ + public function getPage(string $targetUrl): RoomPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new RoomPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a RoomContext + * + * @param string $sid The SID of the Room resource to fetch. + */ + public function getContext( + string $sid + + ): RoomContext + { + return new RoomContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.RoomList]'; + } +} diff --git a/app/api/Twilio/Rest/Video/V1/RoomOptions.php b/app/api/Twilio/Rest/Video/V1/RoomOptions.php new file mode 100755 index 0000000..c32f866 --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/RoomOptions.php @@ -0,0 +1,436 @@ +options['enableTurn'] = $enableTurn; + $this->options['type'] = $type; + $this->options['uniqueName'] = $uniqueName; + $this->options['statusCallback'] = $statusCallback; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['maxParticipants'] = $maxParticipants; + $this->options['recordParticipantsOnConnect'] = $recordParticipantsOnConnect; + $this->options['videoCodecs'] = $videoCodecs; + $this->options['mediaRegion'] = $mediaRegion; + $this->options['recordingRules'] = $recordingRules; + $this->options['audioOnly'] = $audioOnly; + $this->options['maxParticipantDuration'] = $maxParticipantDuration; + $this->options['emptyRoomTimeout'] = $emptyRoomTimeout; + $this->options['unusedRoomTimeout'] = $unusedRoomTimeout; + $this->options['largeRoom'] = $largeRoom; + } + + /** + * Deprecated, now always considered to be true. + * + * @param bool $enableTurn Deprecated, now always considered to be true. + * @return $this Fluent Builder + */ + public function setEnableTurn(bool $enableTurn): self + { + $this->options['enableTurn'] = $enableTurn; + return $this; + } + + /** + * @param string $type + * @return $this Fluent Builder + */ + public function setType(string $type): self + { + $this->options['type'] = $type; + return $this; + } + + /** + * An application-defined string that uniquely identifies the resource. It can be used as a `room_sid` in place of the resource's `sid` in the URL to address the resource, assuming it does not contain any [reserved characters](https://tools.ietf.org/html/rfc3986#section-2.2) that would need to be URL encoded. This value is unique for `in-progress` rooms. SDK clients can use this name to connect to the room. REST API clients can use this name in place of the Room SID to interact with the room as long as the room is `in-progress`. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used as a `room_sid` in place of the resource's `sid` in the URL to address the resource, assuming it does not contain any [reserved characters](https://tools.ietf.org/html/rfc3986#section-2.2) that would need to be URL encoded. This value is unique for `in-progress` rooms. SDK clients can use this name to connect to the room. REST API clients can use this name in place of the Room SID to interact with the room as long as the room is `in-progress`. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * The URL we should call using the `status_callback_method` to send status information to your application on every room event. See [Status Callbacks](https://www.twilio.com/docs/video/api/status-callbacks) for more info. + * + * @param string $statusCallback The URL we should call using the `status_callback_method` to send status information to your application on every room event. See [Status Callbacks](https://www.twilio.com/docs/video/api/status-callbacks) for more info. + * @return $this Fluent Builder + */ + public function setStatusCallback(string $statusCallback): self + { + $this->options['statusCallback'] = $statusCallback; + return $this; + } + + /** + * The HTTP method we should use to call `status_callback`. Can be `POST` or `GET`. + * + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback`. Can be `POST` or `GET`. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * The maximum number of concurrent Participants allowed in the room. Peer-to-peer rooms can have up to 10 Participants. Small Group rooms can have up to 4 Participants. Group rooms can have up to 50 Participants. + * + * @param int $maxParticipants The maximum number of concurrent Participants allowed in the room. Peer-to-peer rooms can have up to 10 Participants. Small Group rooms can have up to 4 Participants. Group rooms can have up to 50 Participants. + * @return $this Fluent Builder + */ + public function setMaxParticipants(int $maxParticipants): self + { + $this->options['maxParticipants'] = $maxParticipants; + return $this; + } + + /** + * Whether to start recording when Participants connect. ***This feature is not available in `peer-to-peer` rooms.*** + * + * @param bool $recordParticipantsOnConnect Whether to start recording when Participants connect. ***This feature is not available in `peer-to-peer` rooms.*** + * @return $this Fluent Builder + */ + public function setRecordParticipantsOnConnect(bool $recordParticipantsOnConnect): self + { + $this->options['recordParticipantsOnConnect'] = $recordParticipantsOnConnect; + return $this; + } + + /** + * An array of the video codecs that are supported when publishing a track in the room. Can be: `VP8` and `H264`. ***This feature is not available in `peer-to-peer` rooms*** + * + * @param string $videoCodecs An array of the video codecs that are supported when publishing a track in the room. Can be: `VP8` and `H264`. ***This feature is not available in `peer-to-peer` rooms*** + * @return $this Fluent Builder + */ + public function setVideoCodecs(array $videoCodecs): self + { + $this->options['videoCodecs'] = $videoCodecs; + return $this; + } + + /** + * The region for the media server in Group Rooms. Can be: one of the [available Media Regions](https://www.twilio.com/docs/video/ip-address-whitelisting#group-rooms-media-servers). ***This feature is not available in `peer-to-peer` rooms.*** + * + * @param string $mediaRegion The region for the media server in Group Rooms. Can be: one of the [available Media Regions](https://www.twilio.com/docs/video/ip-address-whitelisting#group-rooms-media-servers). ***This feature is not available in `peer-to-peer` rooms.*** + * @return $this Fluent Builder + */ + public function setMediaRegion(string $mediaRegion): self + { + $this->options['mediaRegion'] = $mediaRegion; + return $this; + } + + /** + * A collection of Recording Rules that describe how to include or exclude matching tracks for recording + * + * @param array $recordingRules A collection of Recording Rules that describe how to include or exclude matching tracks for recording + * @return $this Fluent Builder + */ + public function setRecordingRules(array $recordingRules): self + { + $this->options['recordingRules'] = $recordingRules; + return $this; + } + + /** + * When set to true, indicates that the participants in the room will only publish audio. No video tracks will be allowed. Group rooms only. + * + * @param bool $audioOnly When set to true, indicates that the participants in the room will only publish audio. No video tracks will be allowed. Group rooms only. + * @return $this Fluent Builder + */ + public function setAudioOnly(bool $audioOnly): self + { + $this->options['audioOnly'] = $audioOnly; + return $this; + } + + /** + * The maximum number of seconds a Participant can be connected to the room. The maximum possible value is 86400 seconds (24 hours). The default is 14400 seconds (4 hours). + * + * @param int $maxParticipantDuration The maximum number of seconds a Participant can be connected to the room. The maximum possible value is 86400 seconds (24 hours). The default is 14400 seconds (4 hours). + * @return $this Fluent Builder + */ + public function setMaxParticipantDuration(int $maxParticipantDuration): self + { + $this->options['maxParticipantDuration'] = $maxParticipantDuration; + return $this; + } + + /** + * Configures how long (in minutes) a room will remain active after last participant leaves. Valid values range from 1 to 60 minutes (no fractions). + * + * @param int $emptyRoomTimeout Configures how long (in minutes) a room will remain active after last participant leaves. Valid values range from 1 to 60 minutes (no fractions). + * @return $this Fluent Builder + */ + public function setEmptyRoomTimeout(int $emptyRoomTimeout): self + { + $this->options['emptyRoomTimeout'] = $emptyRoomTimeout; + return $this; + } + + /** + * Configures how long (in minutes) a room will remain active if no one joins. Valid values range from 1 to 60 minutes (no fractions). + * + * @param int $unusedRoomTimeout Configures how long (in minutes) a room will remain active if no one joins. Valid values range from 1 to 60 minutes (no fractions). + * @return $this Fluent Builder + */ + public function setUnusedRoomTimeout(int $unusedRoomTimeout): self + { + $this->options['unusedRoomTimeout'] = $unusedRoomTimeout; + return $this; + } + + /** + * When set to true, indicated that this is the large room. + * + * @param bool $largeRoom When set to true, indicated that this is the large room. + * @return $this Fluent Builder + */ + public function setLargeRoom(bool $largeRoom): self + { + $this->options['largeRoom'] = $largeRoom; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Video.V1.CreateRoomOptions ' . $options . ']'; + } +} + + +class ReadRoomOptions extends Options + { + /** + * @param string $status Read only the rooms with this status. Can be: `in-progress` (default) or `completed` + * @param string $uniqueName Read only rooms with the this `unique_name`. + * @param \DateTime $dateCreatedAfter Read only rooms that started on or after this date, given as `YYYY-MM-DD`. + * @param \DateTime $dateCreatedBefore Read only rooms that started before this date, given as `YYYY-MM-DD`. + */ + public function __construct( + + string $status = Values::NONE, + string $uniqueName = Values::NONE, + \DateTime $dateCreatedAfter = null, + \DateTime $dateCreatedBefore = null + + ) { + $this->options['status'] = $status; + $this->options['uniqueName'] = $uniqueName; + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + } + + /** + * Read only the rooms with this status. Can be: `in-progress` (default) or `completed` + * + * @param string $status Read only the rooms with this status. Can be: `in-progress` (default) or `completed` + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Read only rooms with the this `unique_name`. + * + * @param string $uniqueName Read only rooms with the this `unique_name`. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * Read only rooms that started on or after this date, given as `YYYY-MM-DD`. + * + * @param \DateTime $dateCreatedAfter Read only rooms that started on or after this date, given as `YYYY-MM-DD`. + * @return $this Fluent Builder + */ + public function setDateCreatedAfter(\DateTime $dateCreatedAfter): self + { + $this->options['dateCreatedAfter'] = $dateCreatedAfter; + return $this; + } + + /** + * Read only rooms that started before this date, given as `YYYY-MM-DD`. + * + * @param \DateTime $dateCreatedBefore Read only rooms that started before this date, given as `YYYY-MM-DD`. + * @return $this Fluent Builder + */ + public function setDateCreatedBefore(\DateTime $dateCreatedBefore): self + { + $this->options['dateCreatedBefore'] = $dateCreatedBefore; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Video.V1.ReadRoomOptions ' . $options . ']'; + } +} + + diff --git a/app/api/Twilio/Rest/Video/V1/RoomPage.php b/app/api/Twilio/Rest/Video/V1/RoomPage.php new file mode 100755 index 0000000..55675f7 --- /dev/null +++ b/app/api/Twilio/Rest/Video/V1/RoomPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RoomInstance \Twilio\Rest\Video\V1\RoomInstance + */ + public function buildInstance(array $payload): RoomInstance + { + return new RoomInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Video.V1.RoomPage]'; + } +} diff --git a/app/api/Twilio/Rest/VideoBase.php b/app/api/Twilio/Rest/VideoBase.php new file mode 100755 index 0000000..cde0c39 --- /dev/null +++ b/app/api/Twilio/Rest/VideoBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://video.twilio.com'; + } + + + /** + * @return V1 Version v1 of video + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Video]'; + } +} diff --git a/app/api/Twilio/Rest/Voice.php b/app/api/Twilio/Rest/Voice.php new file mode 100755 index 0000000..855afc9 --- /dev/null +++ b/app/api/Twilio/Rest/Voice.php @@ -0,0 +1,101 @@ +archivedCalls instead. + */ + protected function getArchivedCalls(): \Twilio\Rest\Voice\V1\ArchivedCallList { + echo "archivedCalls is deprecated. Use v1->archivedCalls instead."; + return $this->v1->archivedCalls; + } + + /** + * @deprecated Use v1->archivedCalls(\$date, \$sid) instead. + * @param \DateTime $date The date of the Call in UTC. + * @param string $sid The unique string that identifies this resource + */ + protected function contextArchivedCalls(\DateTime $date, string $sid): \Twilio\Rest\Voice\V1\ArchivedCallContext { + echo "archivedCalls(\$date, \$sid) is deprecated. Use v1->archivedCalls(\$date, \$sid) instead."; + return $this->v1->archivedCalls($date, $sid); + } + + /** + * @deprecated Use v1->byocTrunks instead. + */ + protected function getByocTrunks(): \Twilio\Rest\Voice\V1\ByocTrunkList { + echo "byocTrunks is deprecated. Use v1->byocTrunks instead."; + return $this->v1->byocTrunks; + } + + /** + * @deprecated Use v1->byocTrunks(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextByocTrunks(string $sid): \Twilio\Rest\Voice\V1\ByocTrunkContext { + echo "byocTrunks(\$sid) is deprecated. Use v1->byocTrunks(\$sid) instead."; + return $this->v1->byocTrunks($sid); + } + + /** + * @deprecated Use v1->connectionPolicies instead. + */ + protected function getConnectionPolicies(): \Twilio\Rest\Voice\V1\ConnectionPolicyList { + echo "connectionPolicies is deprecated. Use v1->connectionPolicies instead."; + return $this->v1->connectionPolicies; + } + + /** + * @deprecated Use v1->connectionPolicies(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextConnectionPolicies(string $sid): \Twilio\Rest\Voice\V1\ConnectionPolicyContext { + echo "connectionPolicies(\$sid) is deprecated. Use v1->connectionPolicies(\$sid) instead."; + return $this->v1->connectionPolicies($sid); + } + + /** + * @deprecated Use v1->dialingPermissions instead. + */ + protected function getDialingPermissions(): \Twilio\Rest\Voice\V1\DialingPermissionsList { + echo "dialingPermissions is deprecated. Use v1->dialingPermissions instead."; + return $this->v1->dialingPermissions; + } + + /** + * @deprecated Use v1->ipRecords instead. + */ + protected function getIpRecords(): \Twilio\Rest\Voice\V1\IpRecordList { + echo "ipRecords is deprecated. Use v1->ipRecords instead."; + return $this->v1->ipRecords; + } + + /** + * @deprecated Use v1->ipRecords(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextIpRecords(string $sid): \Twilio\Rest\Voice\V1\IpRecordContext { + echo "ipRecords(\$sid) is deprecated. Use v1->ipRecords(\$sid) instead."; + return $this->v1->ipRecords($sid); + } + + /** + * @deprecated Use v1->sourceIpMappings instead. + */ + protected function getSourceIpMappings(): \Twilio\Rest\Voice\V1\SourceIpMappingList { + echo "sourceIpMappings is deprecated. Use v1->sourceIpMappings instead."; + return $this->v1->sourceIpMappings; + } + + /** + * @deprecated Use v1->sourceIpMappings(\$sid) instead. + * @param string $sid The unique string that identifies the resource + */ + protected function contextSourceIpMappings(string $sid): \Twilio\Rest\Voice\V1\SourceIpMappingContext { + echo "sourceIpMappings(\$sid) is deprecated. Use v1->sourceIpMappings(\$sid) instead."; + return $this->v1->sourceIpMappings($sid); + } +} \ No newline at end of file diff --git a/app/api/Twilio/Rest/Voice/V1.php b/app/api/Twilio/Rest/Voice/V1.php new file mode 100755 index 0000000..4ecee2b --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1.php @@ -0,0 +1,154 @@ +version = 'v1'; + } + + protected function getArchivedCalls(): ArchivedCallList + { + if (!$this->_archivedCalls) { + $this->_archivedCalls = new ArchivedCallList($this); + } + return $this->_archivedCalls; + } + + protected function getByocTrunks(): ByocTrunkList + { + if (!$this->_byocTrunks) { + $this->_byocTrunks = new ByocTrunkList($this); + } + return $this->_byocTrunks; + } + + protected function getConnectionPolicies(): ConnectionPolicyList + { + if (!$this->_connectionPolicies) { + $this->_connectionPolicies = new ConnectionPolicyList($this); + } + return $this->_connectionPolicies; + } + + protected function getDialingPermissions(): DialingPermissionsList + { + if (!$this->_dialingPermissions) { + $this->_dialingPermissions = new DialingPermissionsList($this); + } + return $this->_dialingPermissions; + } + + protected function getIpRecords(): IpRecordList + { + if (!$this->_ipRecords) { + $this->_ipRecords = new IpRecordList($this); + } + return $this->_ipRecords; + } + + protected function getSourceIpMappings(): SourceIpMappingList + { + if (!$this->_sourceIpMappings) { + $this->_sourceIpMappings = new SourceIpMappingList($this); + } + return $this->_sourceIpMappings; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1]'; + } +} diff --git a/app/api/Twilio/Rest/Voice/V1/ArchivedCallContext.php b/app/api/Twilio/Rest/Voice/V1/ArchivedCallContext.php new file mode 100755 index 0000000..64b5bbd --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/ArchivedCallContext.php @@ -0,0 +1,80 @@ +solution = [ + 'date' => + $date, + 'sid' => + $sid, + ]; + + $this->uri = '/Archives/' . \rawurlencode($date->format('Y-m-d')) + .'/Calls/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ArchivedCallInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Voice.V1.ArchivedCallContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Voice/V1/ArchivedCallInstance.php b/app/api/Twilio/Rest/Voice/V1/ArchivedCallInstance.php new file mode 100755 index 0000000..72f763c --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/ArchivedCallInstance.php @@ -0,0 +1,108 @@ +solution = ['date' => $date ?: $this->properties['date'], 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ArchivedCallContext Context for this ArchivedCallInstance + */ + protected function proxy(): ArchivedCallContext + { + if (!$this->context) { + $this->context = new ArchivedCallContext( + $this->version, + $this->solution['date'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ArchivedCallInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Voice.V1.ArchivedCallInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Voice/V1/ArchivedCallList.php b/app/api/Twilio/Rest/Voice/V1/ArchivedCallList.php new file mode 100755 index 0000000..cd9b858 --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/ArchivedCallList.php @@ -0,0 +1,69 @@ +solution = [ + ]; + } + + /** + * Constructs a ArchivedCallContext + * + * @param \DateTime $date The date of the Call in UTC. + * + * @param string $sid The Twilio-provided Call SID that uniquely identifies the Call resource to delete + */ + public function getContext( + \DateTime $date + , string $sid + + ): ArchivedCallContext + { + return new ArchivedCallContext( + $this->version, + $date, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.ArchivedCallList]'; + } +} diff --git a/app/api/Twilio/Rest/Voice/V1/ArchivedCallPage.php b/app/api/Twilio/Rest/Voice/V1/ArchivedCallPage.php new file mode 100755 index 0000000..dbc2301 --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/ArchivedCallPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ArchivedCallInstance \Twilio\Rest\Voice\V1\ArchivedCallInstance + */ + public function buildInstance(array $payload): ArchivedCallInstance + { + return new ArchivedCallInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.ArchivedCallPage]'; + } +} diff --git a/app/api/Twilio/Rest/Voice/V1/ByocTrunkContext.php b/app/api/Twilio/Rest/Voice/V1/ByocTrunkContext.php new file mode 100755 index 0000000..8295c1c --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/ByocTrunkContext.php @@ -0,0 +1,142 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/ByocTrunks/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ByocTrunkInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the ByocTrunkInstance + * + * @return ByocTrunkInstance Fetched ByocTrunkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ByocTrunkInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ByocTrunkInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the ByocTrunkInstance + * + * @param array|Options $options Optional Arguments + * @return ByocTrunkInstance Updated ByocTrunkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ByocTrunkInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'VoiceUrl' => + $options['voiceUrl'], + 'VoiceMethod' => + $options['voiceMethod'], + 'VoiceFallbackUrl' => + $options['voiceFallbackUrl'], + 'VoiceFallbackMethod' => + $options['voiceFallbackMethod'], + 'StatusCallbackUrl' => + $options['statusCallbackUrl'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'CnamLookupEnabled' => + Serialize::booleanToString($options['cnamLookupEnabled']), + 'ConnectionPolicySid' => + $options['connectionPolicySid'], + 'FromDomainSid' => + $options['fromDomainSid'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new ByocTrunkInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Voice.V1.ByocTrunkContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Voice/V1/ByocTrunkInstance.php b/app/api/Twilio/Rest/Voice/V1/ByocTrunkInstance.php new file mode 100755 index 0000000..e8a2811 --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/ByocTrunkInstance.php @@ -0,0 +1,170 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'voiceUrl' => Values::array_get($payload, 'voice_url'), + 'voiceMethod' => Values::array_get($payload, 'voice_method'), + 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), + 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), + 'statusCallbackUrl' => Values::array_get($payload, 'status_callback_url'), + 'statusCallbackMethod' => Values::array_get($payload, 'status_callback_method'), + 'cnamLookupEnabled' => Values::array_get($payload, 'cnam_lookup_enabled'), + 'connectionPolicySid' => Values::array_get($payload, 'connection_policy_sid'), + 'fromDomainSid' => Values::array_get($payload, 'from_domain_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ByocTrunkContext Context for this ByocTrunkInstance + */ + protected function proxy(): ByocTrunkContext + { + if (!$this->context) { + $this->context = new ByocTrunkContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ByocTrunkInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ByocTrunkInstance + * + * @return ByocTrunkInstance Fetched ByocTrunkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ByocTrunkInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ByocTrunkInstance + * + * @param array|Options $options Optional Arguments + * @return ByocTrunkInstance Updated ByocTrunkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ByocTrunkInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Voice.V1.ByocTrunkInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Voice/V1/ByocTrunkList.php b/app/api/Twilio/Rest/Voice/V1/ByocTrunkList.php new file mode 100755 index 0000000..bc5b825 --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/ByocTrunkList.php @@ -0,0 +1,208 @@ +solution = [ + ]; + + $this->uri = '/ByocTrunks'; + } + + /** + * Create the ByocTrunkInstance + * + * @param array|Options $options Optional Arguments + * @return ByocTrunkInstance Created ByocTrunkInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): ByocTrunkInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'VoiceUrl' => + $options['voiceUrl'], + 'VoiceMethod' => + $options['voiceMethod'], + 'VoiceFallbackUrl' => + $options['voiceFallbackUrl'], + 'VoiceFallbackMethod' => + $options['voiceFallbackMethod'], + 'StatusCallbackUrl' => + $options['statusCallbackUrl'], + 'StatusCallbackMethod' => + $options['statusCallbackMethod'], + 'CnamLookupEnabled' => + Serialize::booleanToString($options['cnamLookupEnabled']), + 'ConnectionPolicySid' => + $options['connectionPolicySid'], + 'FromDomainSid' => + $options['fromDomainSid'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new ByocTrunkInstance( + $this->version, + $payload + ); + } + + + /** + * Reads ByocTrunkInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ByocTrunkInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ByocTrunkInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ByocTrunkInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ByocTrunkPage Page of ByocTrunkInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ByocTrunkPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ByocTrunkPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ByocTrunkInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ByocTrunkPage Page of ByocTrunkInstance + */ + public function getPage(string $targetUrl): ByocTrunkPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ByocTrunkPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ByocTrunkContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the BYOC Trunk resource to delete. + */ + public function getContext( + string $sid + + ): ByocTrunkContext + { + return new ByocTrunkContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.ByocTrunkList]'; + } +} diff --git a/app/api/Twilio/Rest/Voice/V1/ByocTrunkOptions.php b/app/api/Twilio/Rest/Voice/V1/ByocTrunkOptions.php new file mode 100755 index 0000000..02c8273 --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/ByocTrunkOptions.php @@ -0,0 +1,458 @@ +options['friendlyName'] = $friendlyName; + $this->options['voiceUrl'] = $voiceUrl; + $this->options['voiceMethod'] = $voiceMethod; + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + $this->options['statusCallbackUrl'] = $statusCallbackUrl; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['cnamLookupEnabled'] = $cnamLookupEnabled; + $this->options['connectionPolicySid'] = $connectionPolicySid; + $this->options['fromDomainSid'] = $fromDomainSid; + } + + /** + * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The URL we should call when the BYOC Trunk receives a call. + * + * @param string $voiceUrl The URL we should call when the BYOC Trunk receives a call. + * @return $this Fluent Builder + */ + public function setVoiceUrl(string $voiceUrl): self + { + $this->options['voiceUrl'] = $voiceUrl; + return $this; + } + + /** + * The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. + * + * @param string $voiceMethod The HTTP method we should use to call `voice_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setVoiceMethod(string $voiceMethod): self + { + $this->options['voiceMethod'] = $voiceMethod; + return $this; + } + + /** + * The URL that we should call when an error occurs while retrieving or executing the TwiML from `voice_url`. + * + * @param string $voiceFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML from `voice_url`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackUrl(string $voiceFallbackUrl): self + { + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + return $this; + } + + /** + * The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. + * + * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackMethod(string $voiceFallbackMethod): self + { + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + return $this; + } + + /** + * The URL that we should call to pass status parameters (such as call ended) to your application. + * + * @param string $statusCallbackUrl The URL that we should call to pass status parameters (such as call ended) to your application. + * @return $this Fluent Builder + */ + public function setStatusCallbackUrl(string $statusCallbackUrl): self + { + $this->options['statusCallbackUrl'] = $statusCallbackUrl; + return $this; + } + + /** + * The HTTP method we should use to call `status_callback_url`. Can be: `GET` or `POST`. + * + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. + * + * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. + * @return $this Fluent Builder + */ + public function setCnamLookupEnabled(bool $cnamLookupEnabled): self + { + $this->options['cnamLookupEnabled'] = $cnamLookupEnabled; + return $this; + } + + /** + * The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure. + * + * @param string $connectionPolicySid The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure. + * @return $this Fluent Builder + */ + public function setConnectionPolicySid(string $connectionPolicySid): self + { + $this->options['connectionPolicySid'] = $connectionPolicySid; + return $this; + } + + /** + * The SID of the SIP Domain that should be used in the `From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to \\\"call back\\\" an incoming call, configure this with a [SIP Domain](https://www.twilio.com/docs/voice/api/sending-sip) to ensure proper routing. If not configured, the from domain will default to \\\"sip.twilio.com\\\". + * + * @param string $fromDomainSid The SID of the SIP Domain that should be used in the `From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to \\\"call back\\\" an incoming call, configure this with a [SIP Domain](https://www.twilio.com/docs/voice/api/sending-sip) to ensure proper routing. If not configured, the from domain will default to \\\"sip.twilio.com\\\". + * @return $this Fluent Builder + */ + public function setFromDomainSid(string $fromDomainSid): self + { + $this->options['fromDomainSid'] = $fromDomainSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Voice.V1.CreateByocTrunkOptions ' . $options . ']'; + } +} + + + + +class UpdateByocTrunkOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * @param string $voiceUrl The URL we should call when the BYOC Trunk receives a call. + * @param string $voiceMethod The HTTP method we should use to call `voice_url` + * @param string $voiceFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML requested by `voice_url`. + * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. + * @param string $statusCallbackUrl The URL that we should call to pass status parameters (such as call ended) to your application. + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback_url`. Can be: `GET` or `POST`. + * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. + * @param string $connectionPolicySid The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure. + * @param string $fromDomainSid The SID of the SIP Domain that should be used in the `From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to \\\"call back\\\" an incoming call, configure this with a [SIP Domain](https://www.twilio.com/docs/voice/api/sending-sip) to ensure proper routing. If not configured, the from domain will default to \\\"sip.twilio.com\\\". + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $voiceUrl = Values::NONE, + string $voiceMethod = Values::NONE, + string $voiceFallbackUrl = Values::NONE, + string $voiceFallbackMethod = Values::NONE, + string $statusCallbackUrl = Values::NONE, + string $statusCallbackMethod = Values::NONE, + bool $cnamLookupEnabled = Values::BOOL_NONE, + string $connectionPolicySid = Values::NONE, + string $fromDomainSid = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['voiceUrl'] = $voiceUrl; + $this->options['voiceMethod'] = $voiceMethod; + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + $this->options['statusCallbackUrl'] = $statusCallbackUrl; + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + $this->options['cnamLookupEnabled'] = $cnamLookupEnabled; + $this->options['connectionPolicySid'] = $connectionPolicySid; + $this->options['fromDomainSid'] = $fromDomainSid; + } + + /** + * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The URL we should call when the BYOC Trunk receives a call. + * + * @param string $voiceUrl The URL we should call when the BYOC Trunk receives a call. + * @return $this Fluent Builder + */ + public function setVoiceUrl(string $voiceUrl): self + { + $this->options['voiceUrl'] = $voiceUrl; + return $this; + } + + /** + * The HTTP method we should use to call `voice_url` + * + * @param string $voiceMethod The HTTP method we should use to call `voice_url` + * @return $this Fluent Builder + */ + public function setVoiceMethod(string $voiceMethod): self + { + $this->options['voiceMethod'] = $voiceMethod; + return $this; + } + + /** + * The URL that we should call when an error occurs while retrieving or executing the TwiML requested by `voice_url`. + * + * @param string $voiceFallbackUrl The URL that we should call when an error occurs while retrieving or executing the TwiML requested by `voice_url`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackUrl(string $voiceFallbackUrl): self + { + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + return $this; + } + + /** + * The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. + * + * @param string $voiceFallbackMethod The HTTP method we should use to call `voice_fallback_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setVoiceFallbackMethod(string $voiceFallbackMethod): self + { + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + return $this; + } + + /** + * The URL that we should call to pass status parameters (such as call ended) to your application. + * + * @param string $statusCallbackUrl The URL that we should call to pass status parameters (such as call ended) to your application. + * @return $this Fluent Builder + */ + public function setStatusCallbackUrl(string $statusCallbackUrl): self + { + $this->options['statusCallbackUrl'] = $statusCallbackUrl; + return $this; + } + + /** + * The HTTP method we should use to call `status_callback_url`. Can be: `GET` or `POST`. + * + * @param string $statusCallbackMethod The HTTP method we should use to call `status_callback_url`. Can be: `GET` or `POST`. + * @return $this Fluent Builder + */ + public function setStatusCallbackMethod(string $statusCallbackMethod): self + { + $this->options['statusCallbackMethod'] = $statusCallbackMethod; + return $this; + } + + /** + * Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. + * + * @param bool $cnamLookupEnabled Whether Caller ID Name (CNAM) lookup is enabled for the trunk. If enabled, all inbound calls to the BYOC Trunk from the United States and Canada automatically perform a CNAM Lookup and display Caller ID data on your phone. See [CNAM Lookups](https://www.twilio.com/docs/sip-trunking#CNAM) for more information. + * @return $this Fluent Builder + */ + public function setCnamLookupEnabled(bool $cnamLookupEnabled): self + { + $this->options['cnamLookupEnabled'] = $cnamLookupEnabled; + return $this; + } + + /** + * The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure. + * + * @param string $connectionPolicySid The SID of the Connection Policy that Twilio will use when routing traffic to your communications infrastructure. + * @return $this Fluent Builder + */ + public function setConnectionPolicySid(string $connectionPolicySid): self + { + $this->options['connectionPolicySid'] = $connectionPolicySid; + return $this; + } + + /** + * The SID of the SIP Domain that should be used in the `From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to \\\"call back\\\" an incoming call, configure this with a [SIP Domain](https://www.twilio.com/docs/voice/api/sending-sip) to ensure proper routing. If not configured, the from domain will default to \\\"sip.twilio.com\\\". + * + * @param string $fromDomainSid The SID of the SIP Domain that should be used in the `From` header of originating calls sent to your SIP infrastructure. If your SIP infrastructure allows users to \\\"call back\\\" an incoming call, configure this with a [SIP Domain](https://www.twilio.com/docs/voice/api/sending-sip) to ensure proper routing. If not configured, the from domain will default to \\\"sip.twilio.com\\\". + * @return $this Fluent Builder + */ + public function setFromDomainSid(string $fromDomainSid): self + { + $this->options['fromDomainSid'] = $fromDomainSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Voice.V1.UpdateByocTrunkOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Voice/V1/ByocTrunkPage.php b/app/api/Twilio/Rest/Voice/V1/ByocTrunkPage.php new file mode 100755 index 0000000..e59155a --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/ByocTrunkPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ByocTrunkInstance \Twilio\Rest\Voice\V1\ByocTrunkInstance + */ + public function buildInstance(array $payload): ByocTrunkInstance + { + return new ByocTrunkInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.ByocTrunkPage]'; + } +} diff --git a/app/api/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetContext.php b/app/api/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetContext.php new file mode 100755 index 0000000..a07adb2 --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetContext.php @@ -0,0 +1,139 @@ +solution = [ + 'connectionPolicySid' => + $connectionPolicySid, + 'sid' => + $sid, + ]; + + $this->uri = '/ConnectionPolicies/' . \rawurlencode($connectionPolicySid) + .'/Targets/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ConnectionPolicyTargetInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the ConnectionPolicyTargetInstance + * + * @return ConnectionPolicyTargetInstance Fetched ConnectionPolicyTargetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ConnectionPolicyTargetInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ConnectionPolicyTargetInstance( + $this->version, + $payload, + $this->solution['connectionPolicySid'], + $this->solution['sid'] + ); + } + + + /** + * Update the ConnectionPolicyTargetInstance + * + * @param array|Options $options Optional Arguments + * @return ConnectionPolicyTargetInstance Updated ConnectionPolicyTargetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ConnectionPolicyTargetInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + 'Target' => + $options['target'], + 'Priority' => + $options['priority'], + 'Weight' => + $options['weight'], + 'Enabled' => + Serialize::booleanToString($options['enabled']), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new ConnectionPolicyTargetInstance( + $this->version, + $payload, + $this->solution['connectionPolicySid'], + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Voice.V1.ConnectionPolicyTargetContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetInstance.php b/app/api/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetInstance.php new file mode 100755 index 0000000..ba3926e --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetInstance.php @@ -0,0 +1,164 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'connectionPolicySid' => Values::array_get($payload, 'connection_policy_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'target' => Values::array_get($payload, 'target'), + 'priority' => Values::array_get($payload, 'priority'), + 'weight' => Values::array_get($payload, 'weight'), + 'enabled' => Values::array_get($payload, 'enabled'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['connectionPolicySid' => $connectionPolicySid, 'sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ConnectionPolicyTargetContext Context for this ConnectionPolicyTargetInstance + */ + protected function proxy(): ConnectionPolicyTargetContext + { + if (!$this->context) { + $this->context = new ConnectionPolicyTargetContext( + $this->version, + $this->solution['connectionPolicySid'], + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ConnectionPolicyTargetInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ConnectionPolicyTargetInstance + * + * @return ConnectionPolicyTargetInstance Fetched ConnectionPolicyTargetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ConnectionPolicyTargetInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ConnectionPolicyTargetInstance + * + * @param array|Options $options Optional Arguments + * @return ConnectionPolicyTargetInstance Updated ConnectionPolicyTargetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ConnectionPolicyTargetInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Voice.V1.ConnectionPolicyTargetInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetList.php b/app/api/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetList.php new file mode 100755 index 0000000..a6749e5 --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetList.php @@ -0,0 +1,207 @@ +solution = [ + 'connectionPolicySid' => + $connectionPolicySid, + + ]; + + $this->uri = '/ConnectionPolicies/' . \rawurlencode($connectionPolicySid) + .'/Targets'; + } + + /** + * Create the ConnectionPolicyTargetInstance + * + * @param string $target The SIP address you want Twilio to route your calls to. This must be a `sip:` schema. `sips` is NOT supported. + * @param array|Options $options Optional Arguments + * @return ConnectionPolicyTargetInstance Created ConnectionPolicyTargetInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $target, array $options = []): ConnectionPolicyTargetInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Target' => + $target, + 'FriendlyName' => + $options['friendlyName'], + 'Priority' => + $options['priority'], + 'Weight' => + $options['weight'], + 'Enabled' => + Serialize::booleanToString($options['enabled']), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new ConnectionPolicyTargetInstance( + $this->version, + $payload, + $this->solution['connectionPolicySid'] + ); + } + + + /** + * Reads ConnectionPolicyTargetInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ConnectionPolicyTargetInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ConnectionPolicyTargetInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ConnectionPolicyTargetInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ConnectionPolicyTargetPage Page of ConnectionPolicyTargetInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ConnectionPolicyTargetPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ConnectionPolicyTargetPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ConnectionPolicyTargetInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ConnectionPolicyTargetPage Page of ConnectionPolicyTargetInstance + */ + public function getPage(string $targetUrl): ConnectionPolicyTargetPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ConnectionPolicyTargetPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ConnectionPolicyTargetContext + * + * @param string $sid The unique string that we created to identify the Target resource to delete. + */ + public function getContext( + string $sid + + ): ConnectionPolicyTargetContext + { + return new ConnectionPolicyTargetContext( + $this->version, + $this->solution['connectionPolicySid'], + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.ConnectionPolicyTargetList]'; + } +} diff --git a/app/api/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetOptions.php b/app/api/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetOptions.php new file mode 100755 index 0000000..d7851ee --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetOptions.php @@ -0,0 +1,260 @@ +options['friendlyName'] = $friendlyName; + $this->options['priority'] = $priority; + $this->options['weight'] = $weight; + $this->options['enabled'] = $enabled; + } + + /** + * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The relative importance of the target. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important target. + * + * @param int $priority The relative importance of the target. Can be an integer from 0 to 65535, inclusive, and the default is 10. The lowest number represents the most important target. + * @return $this Fluent Builder + */ + public function setPriority(int $priority): self + { + $this->options['priority'] = $priority; + return $this; + } + + /** + * The value that determines the relative share of the load the Target should receive compared to other Targets with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. Targets with higher values receive more load than those with lower ones with the same priority. + * + * @param int $weight The value that determines the relative share of the load the Target should receive compared to other Targets with the same priority. Can be an integer from 1 to 65535, inclusive, and the default is 10. Targets with higher values receive more load than those with lower ones with the same priority. + * @return $this Fluent Builder + */ + public function setWeight(int $weight): self + { + $this->options['weight'] = $weight; + return $this; + } + + /** + * Whether the Target is enabled. The default is `true`. + * + * @param bool $enabled Whether the Target is enabled. The default is `true`. + * @return $this Fluent Builder + */ + public function setEnabled(bool $enabled): self + { + $this->options['enabled'] = $enabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Voice.V1.CreateConnectionPolicyTargetOptions ' . $options . ']'; + } +} + + + + +class UpdateConnectionPolicyTargetOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * @param string $target The SIP address you want Twilio to route your calls to. This must be a `sip:` schema. `sips` is NOT supported. + * @param int $priority The relative importance of the target. Can be an integer from 0 to 65535, inclusive. The lowest number represents the most important target. + * @param int $weight The value that determines the relative share of the load the Target should receive compared to other Targets with the same priority. Can be an integer from 1 to 65535, inclusive. Targets with higher values receive more load than those with lower ones with the same priority. + * @param bool $enabled Whether the Target is enabled. + */ + public function __construct( + + string $friendlyName = Values::NONE, + string $target = Values::NONE, + int $priority = Values::INT_NONE, + int $weight = Values::INT_NONE, + bool $enabled = Values::BOOL_NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + $this->options['target'] = $target; + $this->options['priority'] = $priority; + $this->options['weight'] = $weight; + $this->options['enabled'] = $enabled; + } + + /** + * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The SIP address you want Twilio to route your calls to. This must be a `sip:` schema. `sips` is NOT supported. + * + * @param string $target The SIP address you want Twilio to route your calls to. This must be a `sip:` schema. `sips` is NOT supported. + * @return $this Fluent Builder + */ + public function setTarget(string $target): self + { + $this->options['target'] = $target; + return $this; + } + + /** + * The relative importance of the target. Can be an integer from 0 to 65535, inclusive. The lowest number represents the most important target. + * + * @param int $priority The relative importance of the target. Can be an integer from 0 to 65535, inclusive. The lowest number represents the most important target. + * @return $this Fluent Builder + */ + public function setPriority(int $priority): self + { + $this->options['priority'] = $priority; + return $this; + } + + /** + * The value that determines the relative share of the load the Target should receive compared to other Targets with the same priority. Can be an integer from 1 to 65535, inclusive. Targets with higher values receive more load than those with lower ones with the same priority. + * + * @param int $weight The value that determines the relative share of the load the Target should receive compared to other Targets with the same priority. Can be an integer from 1 to 65535, inclusive. Targets with higher values receive more load than those with lower ones with the same priority. + * @return $this Fluent Builder + */ + public function setWeight(int $weight): self + { + $this->options['weight'] = $weight; + return $this; + } + + /** + * Whether the Target is enabled. + * + * @param bool $enabled Whether the Target is enabled. + * @return $this Fluent Builder + */ + public function setEnabled(bool $enabled): self + { + $this->options['enabled'] = $enabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Voice.V1.UpdateConnectionPolicyTargetOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetPage.php b/app/api/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetPage.php new file mode 100755 index 0000000..cb0f1b1 --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/ConnectionPolicy/ConnectionPolicyTargetPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ConnectionPolicyTargetInstance \Twilio\Rest\Voice\V1\ConnectionPolicy\ConnectionPolicyTargetInstance + */ + public function buildInstance(array $payload): ConnectionPolicyTargetInstance + { + return new ConnectionPolicyTargetInstance($this->version, $payload, $this->solution['connectionPolicySid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.ConnectionPolicyTargetPage]'; + } +} diff --git a/app/api/Twilio/Rest/Voice/V1/ConnectionPolicyContext.php b/app/api/Twilio/Rest/Voice/V1/ConnectionPolicyContext.php new file mode 100755 index 0000000..1c5ab7f --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/ConnectionPolicyContext.php @@ -0,0 +1,181 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/ConnectionPolicies/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the ConnectionPolicyInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the ConnectionPolicyInstance + * + * @return ConnectionPolicyInstance Fetched ConnectionPolicyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ConnectionPolicyInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new ConnectionPolicyInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the ConnectionPolicyInstance + * + * @param array|Options $options Optional Arguments + * @return ConnectionPolicyInstance Updated ConnectionPolicyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ConnectionPolicyInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new ConnectionPolicyInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the targets + */ + protected function getTargets(): ConnectionPolicyTargetList + { + if (!$this->_targets) { + $this->_targets = new ConnectionPolicyTargetList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_targets; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Voice.V1.ConnectionPolicyContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Voice/V1/ConnectionPolicyInstance.php b/app/api/Twilio/Rest/Voice/V1/ConnectionPolicyInstance.php new file mode 100755 index 0000000..b24f1e1 --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/ConnectionPolicyInstance.php @@ -0,0 +1,165 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return ConnectionPolicyContext Context for this ConnectionPolicyInstance + */ + protected function proxy(): ConnectionPolicyContext + { + if (!$this->context) { + $this->context = new ConnectionPolicyContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the ConnectionPolicyInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the ConnectionPolicyInstance + * + * @return ConnectionPolicyInstance Fetched ConnectionPolicyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): ConnectionPolicyInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the ConnectionPolicyInstance + * + * @param array|Options $options Optional Arguments + * @return ConnectionPolicyInstance Updated ConnectionPolicyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): ConnectionPolicyInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the targets + */ + protected function getTargets(): ConnectionPolicyTargetList + { + return $this->proxy()->targets; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Voice.V1.ConnectionPolicyInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Voice/V1/ConnectionPolicyList.php b/app/api/Twilio/Rest/Voice/V1/ConnectionPolicyList.php new file mode 100755 index 0000000..bd2a346 --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/ConnectionPolicyList.php @@ -0,0 +1,189 @@ +solution = [ + ]; + + $this->uri = '/ConnectionPolicies'; + } + + /** + * Create the ConnectionPolicyInstance + * + * @param array|Options $options Optional Arguments + * @return ConnectionPolicyInstance Created ConnectionPolicyInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): ConnectionPolicyInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new ConnectionPolicyInstance( + $this->version, + $payload + ); + } + + + /** + * Reads ConnectionPolicyInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return ConnectionPolicyInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams ConnectionPolicyInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of ConnectionPolicyInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return ConnectionPolicyPage Page of ConnectionPolicyInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): ConnectionPolicyPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new ConnectionPolicyPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of ConnectionPolicyInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return ConnectionPolicyPage Page of ConnectionPolicyInstance + */ + public function getPage(string $targetUrl): ConnectionPolicyPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new ConnectionPolicyPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a ConnectionPolicyContext + * + * @param string $sid The unique string that we created to identify the Connection Policy resource to delete. + */ + public function getContext( + string $sid + + ): ConnectionPolicyContext + { + return new ConnectionPolicyContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.ConnectionPolicyList]'; + } +} diff --git a/app/api/Twilio/Rest/Voice/V1/ConnectionPolicyOptions.php b/app/api/Twilio/Rest/Voice/V1/ConnectionPolicyOptions.php new file mode 100755 index 0000000..2b9bfe4 --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/ConnectionPolicyOptions.php @@ -0,0 +1,134 @@ +options['friendlyName'] = $friendlyName; + } + + /** + * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Voice.V1.CreateConnectionPolicyOptions ' . $options . ']'; + } +} + + + + +class UpdateConnectionPolicyOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + */ + public function __construct( + + string $friendlyName = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + } + + /** + * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Voice.V1.UpdateConnectionPolicyOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Voice/V1/ConnectionPolicyPage.php b/app/api/Twilio/Rest/Voice/V1/ConnectionPolicyPage.php new file mode 100755 index 0000000..571c5a8 --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/ConnectionPolicyPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return ConnectionPolicyInstance \Twilio\Rest\Voice\V1\ConnectionPolicyInstance + */ + public function buildInstance(array $payload): ConnectionPolicyInstance + { + return new ConnectionPolicyInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.ConnectionPolicyPage]'; + } +} diff --git a/app/api/Twilio/Rest/Voice/V1/DialingPermissions/BulkCountryUpdateInstance.php b/app/api/Twilio/Rest/Voice/V1/DialingPermissions/BulkCountryUpdateInstance.php new file mode 100755 index 0000000..1e84e6d --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/DialingPermissions/BulkCountryUpdateInstance.php @@ -0,0 +1,82 @@ +properties = [ + 'updateCount' => Values::array_get($payload, 'update_count'), + 'updateRequest' => Values::array_get($payload, 'update_request'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.BulkCountryUpdateInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Voice/V1/DialingPermissions/BulkCountryUpdateList.php b/app/api/Twilio/Rest/Voice/V1/DialingPermissions/BulkCountryUpdateList.php new file mode 100755 index 0000000..216bc80 --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/DialingPermissions/BulkCountryUpdateList.php @@ -0,0 +1,77 @@ +solution = [ + ]; + + $this->uri = '/DialingPermissions/BulkCountryUpdates'; + } + + /** + * Create the BulkCountryUpdateInstance + * + * @param string $updateRequest URL encoded JSON array of update objects. example : `[ { \\\"iso_code\\\": \\\"GB\\\", \\\"low_risk_numbers_enabled\\\": \\\"true\\\", \\\"high_risk_special_numbers_enabled\\\":\\\"true\\\", \\\"high_risk_tollfraud_numbers_enabled\\\": \\\"false\\\" } ]` + * @return BulkCountryUpdateInstance Created BulkCountryUpdateInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $updateRequest): BulkCountryUpdateInstance + { + + $data = Values::of([ + 'UpdateRequest' => + $updateRequest, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new BulkCountryUpdateInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.BulkCountryUpdateList]'; + } +} diff --git a/app/api/Twilio/Rest/Voice/V1/DialingPermissions/BulkCountryUpdatePage.php b/app/api/Twilio/Rest/Voice/V1/DialingPermissions/BulkCountryUpdatePage.php new file mode 100755 index 0000000..947bf91 --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/DialingPermissions/BulkCountryUpdatePage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return BulkCountryUpdateInstance \Twilio\Rest\Voice\V1\DialingPermissions\BulkCountryUpdateInstance + */ + public function buildInstance(array $payload): BulkCountryUpdateInstance + { + return new BulkCountryUpdateInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.BulkCountryUpdatePage]'; + } +} diff --git a/app/api/Twilio/Rest/Voice/V1/DialingPermissions/Country/HighriskSpecialPrefixInstance.php b/app/api/Twilio/Rest/Voice/V1/DialingPermissions/Country/HighriskSpecialPrefixInstance.php new file mode 100755 index 0000000..d6a9410 --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/DialingPermissions/Country/HighriskSpecialPrefixInstance.php @@ -0,0 +1,81 @@ +properties = [ + 'prefix' => Values::array_get($payload, 'prefix'), + ]; + + $this->solution = ['isoCode' => $isoCode, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.HighriskSpecialPrefixInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Voice/V1/DialingPermissions/Country/HighriskSpecialPrefixList.php b/app/api/Twilio/Rest/Voice/V1/DialingPermissions/Country/HighriskSpecialPrefixList.php new file mode 100755 index 0000000..d9f95dd --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/DialingPermissions/Country/HighriskSpecialPrefixList.php @@ -0,0 +1,151 @@ +solution = [ + 'isoCode' => + $isoCode, + + ]; + + $this->uri = '/DialingPermissions/Countries/' . \rawurlencode($isoCode) + .'/HighRiskSpecialPrefixes'; + } + + /** + * Reads HighriskSpecialPrefixInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return HighriskSpecialPrefixInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams HighriskSpecialPrefixInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of HighriskSpecialPrefixInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return HighriskSpecialPrefixPage Page of HighriskSpecialPrefixInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): HighriskSpecialPrefixPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new HighriskSpecialPrefixPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of HighriskSpecialPrefixInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return HighriskSpecialPrefixPage Page of HighriskSpecialPrefixInstance + */ + public function getPage(string $targetUrl): HighriskSpecialPrefixPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new HighriskSpecialPrefixPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.HighriskSpecialPrefixList]'; + } +} diff --git a/app/api/Twilio/Rest/Voice/V1/DialingPermissions/Country/HighriskSpecialPrefixPage.php b/app/api/Twilio/Rest/Voice/V1/DialingPermissions/Country/HighriskSpecialPrefixPage.php new file mode 100755 index 0000000..4414889 --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/DialingPermissions/Country/HighriskSpecialPrefixPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return HighriskSpecialPrefixInstance \Twilio\Rest\Voice\V1\DialingPermissions\Country\HighriskSpecialPrefixInstance + */ + public function buildInstance(array $payload): HighriskSpecialPrefixInstance + { + return new HighriskSpecialPrefixInstance($this->version, $payload, $this->solution['isoCode']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.HighriskSpecialPrefixPage]'; + } +} diff --git a/app/api/Twilio/Rest/Voice/V1/DialingPermissions/CountryContext.php b/app/api/Twilio/Rest/Voice/V1/DialingPermissions/CountryContext.php new file mode 100755 index 0000000..b5fc06d --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/DialingPermissions/CountryContext.php @@ -0,0 +1,138 @@ +solution = [ + 'isoCode' => + $isoCode, + ]; + + $this->uri = '/DialingPermissions/Countries/' . \rawurlencode($isoCode) + .''; + } + + /** + * Fetch the CountryInstance + * + * @return CountryInstance Fetched CountryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CountryInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new CountryInstance( + $this->version, + $payload, + $this->solution['isoCode'] + ); + } + + + /** + * Access the highriskSpecialPrefixes + */ + protected function getHighriskSpecialPrefixes(): HighriskSpecialPrefixList + { + if (!$this->_highriskSpecialPrefixes) { + $this->_highriskSpecialPrefixes = new HighriskSpecialPrefixList( + $this->version, + $this->solution['isoCode'] + ); + } + + return $this->_highriskSpecialPrefixes; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Voice.V1.CountryContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Voice/V1/DialingPermissions/CountryInstance.php b/app/api/Twilio/Rest/Voice/V1/DialingPermissions/CountryInstance.php new file mode 100755 index 0000000..b66112f --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/DialingPermissions/CountryInstance.php @@ -0,0 +1,142 @@ +properties = [ + 'isoCode' => Values::array_get($payload, 'iso_code'), + 'name' => Values::array_get($payload, 'name'), + 'continent' => Values::array_get($payload, 'continent'), + 'countryCodes' => Values::array_get($payload, 'country_codes'), + 'lowRiskNumbersEnabled' => Values::array_get($payload, 'low_risk_numbers_enabled'), + 'highRiskSpecialNumbersEnabled' => Values::array_get($payload, 'high_risk_special_numbers_enabled'), + 'highRiskTollfraudNumbersEnabled' => Values::array_get($payload, 'high_risk_tollfraud_numbers_enabled'), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + ]; + + $this->solution = ['isoCode' => $isoCode ?: $this->properties['isoCode'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CountryContext Context for this CountryInstance + */ + protected function proxy(): CountryContext + { + if (!$this->context) { + $this->context = new CountryContext( + $this->version, + $this->solution['isoCode'] + ); + } + + return $this->context; + } + + /** + * Fetch the CountryInstance + * + * @return CountryInstance Fetched CountryInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CountryInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Access the highriskSpecialPrefixes + */ + protected function getHighriskSpecialPrefixes(): HighriskSpecialPrefixList + { + return $this->proxy()->highriskSpecialPrefixes; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Voice.V1.CountryInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Voice/V1/DialingPermissions/CountryList.php b/app/api/Twilio/Rest/Voice/V1/DialingPermissions/CountryList.php new file mode 100755 index 0000000..5a13acb --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/DialingPermissions/CountryList.php @@ -0,0 +1,179 @@ +solution = [ + ]; + + $this->uri = '/DialingPermissions/Countries'; + } + + /** + * Reads CountryInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return CountryInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams CountryInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CountryInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return CountryPage Page of CountryInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CountryPage + { + $options = new Values($options); + + $params = Values::of([ + 'IsoCode' => + $options['isoCode'], + 'Continent' => + $options['continent'], + 'CountryCode' => + $options['countryCode'], + 'LowRiskNumbersEnabled' => + Serialize::booleanToString($options['lowRiskNumbersEnabled']), + 'HighRiskSpecialNumbersEnabled' => + Serialize::booleanToString($options['highRiskSpecialNumbersEnabled']), + 'HighRiskTollfraudNumbersEnabled' => + Serialize::booleanToString($options['highRiskTollfraudNumbersEnabled']), + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new CountryPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of CountryInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return CountryPage Page of CountryInstance + */ + public function getPage(string $targetUrl): CountryPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CountryPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CountryContext + * + * @param string $isoCode The [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) of the DialingPermissions Country resource to fetch + */ + public function getContext( + string $isoCode + + ): CountryContext + { + return new CountryContext( + $this->version, + $isoCode + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.CountryList]'; + } +} diff --git a/app/api/Twilio/Rest/Voice/V1/DialingPermissions/CountryOptions.php b/app/api/Twilio/Rest/Voice/V1/DialingPermissions/CountryOptions.php new file mode 100755 index 0000000..51d7efd --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/DialingPermissions/CountryOptions.php @@ -0,0 +1,168 @@ +options['isoCode'] = $isoCode; + $this->options['continent'] = $continent; + $this->options['countryCode'] = $countryCode; + $this->options['lowRiskNumbersEnabled'] = $lowRiskNumbersEnabled; + $this->options['highRiskSpecialNumbersEnabled'] = $highRiskSpecialNumbersEnabled; + $this->options['highRiskTollfraudNumbersEnabled'] = $highRiskTollfraudNumbersEnabled; + } + + /** + * Filter to retrieve the country permissions by specifying the [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) + * + * @param string $isoCode Filter to retrieve the country permissions by specifying the [ISO country code](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) + * @return $this Fluent Builder + */ + public function setIsoCode(string $isoCode): self + { + $this->options['isoCode'] = $isoCode; + return $this; + } + + /** + * Filter to retrieve the country permissions by specifying the continent + * + * @param string $continent Filter to retrieve the country permissions by specifying the continent + * @return $this Fluent Builder + */ + public function setContinent(string $continent): self + { + $this->options['continent'] = $continent; + return $this; + } + + /** + * Filter the results by specified [country codes](https://www.itu.int/itudoc/itu-t/ob-lists/icc/e164_763.html) + * + * @param string $countryCode Filter the results by specified [country codes](https://www.itu.int/itudoc/itu-t/ob-lists/icc/e164_763.html) + * @return $this Fluent Builder + */ + public function setCountryCode(string $countryCode): self + { + $this->options['countryCode'] = $countryCode; + return $this; + } + + /** + * Filter to retrieve the country permissions with dialing to low-risk numbers enabled. Can be: `true` or `false`. + * + * @param bool $lowRiskNumbersEnabled Filter to retrieve the country permissions with dialing to low-risk numbers enabled. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setLowRiskNumbersEnabled(bool $lowRiskNumbersEnabled): self + { + $this->options['lowRiskNumbersEnabled'] = $lowRiskNumbersEnabled; + return $this; + } + + /** + * Filter to retrieve the country permissions with dialing to high-risk special service numbers enabled. Can be: `true` or `false` + * + * @param bool $highRiskSpecialNumbersEnabled Filter to retrieve the country permissions with dialing to high-risk special service numbers enabled. Can be: `true` or `false` + * @return $this Fluent Builder + */ + public function setHighRiskSpecialNumbersEnabled(bool $highRiskSpecialNumbersEnabled): self + { + $this->options['highRiskSpecialNumbersEnabled'] = $highRiskSpecialNumbersEnabled; + return $this; + } + + /** + * Filter to retrieve the country permissions with dialing to high-risk [toll fraud](https://www.twilio.com/learn/voice-and-video/toll-fraud) numbers enabled. Can be: `true` or `false`. + * + * @param bool $highRiskTollfraudNumbersEnabled Filter to retrieve the country permissions with dialing to high-risk [toll fraud](https://www.twilio.com/learn/voice-and-video/toll-fraud) numbers enabled. Can be: `true` or `false`. + * @return $this Fluent Builder + */ + public function setHighRiskTollfraudNumbersEnabled(bool $highRiskTollfraudNumbersEnabled): self + { + $this->options['highRiskTollfraudNumbersEnabled'] = $highRiskTollfraudNumbersEnabled; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Voice.V1.ReadCountryOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Voice/V1/DialingPermissions/CountryPage.php b/app/api/Twilio/Rest/Voice/V1/DialingPermissions/CountryPage.php new file mode 100755 index 0000000..b4b214b --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/DialingPermissions/CountryPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CountryInstance \Twilio\Rest\Voice\V1\DialingPermissions\CountryInstance + */ + public function buildInstance(array $payload): CountryInstance + { + return new CountryInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.CountryPage]'; + } +} diff --git a/app/api/Twilio/Rest/Voice/V1/DialingPermissions/SettingsContext.php b/app/api/Twilio/Rest/Voice/V1/DialingPermissions/SettingsContext.php new file mode 100755 index 0000000..f2e1912 --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/DialingPermissions/SettingsContext.php @@ -0,0 +1,104 @@ +solution = [ + ]; + + $this->uri = '/Settings'; + } + + /** + * Fetch the SettingsInstance + * + * @return SettingsInstance Fetched SettingsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SettingsInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new SettingsInstance( + $this->version, + $payload + ); + } + + + /** + * Update the SettingsInstance + * + * @param array|Options $options Optional Arguments + * @return SettingsInstance Updated SettingsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SettingsInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'DialingPermissionsInheritance' => + Serialize::booleanToString($options['dialingPermissionsInheritance']), + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new SettingsInstance( + $this->version, + $payload + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Voice.V1.SettingsContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Voice/V1/DialingPermissions/SettingsInstance.php b/app/api/Twilio/Rest/Voice/V1/DialingPermissions/SettingsInstance.php new file mode 100755 index 0000000..2240db6 --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/DialingPermissions/SettingsInstance.php @@ -0,0 +1,129 @@ +properties = [ + 'dialingPermissionsInheritance' => Values::array_get($payload, 'dialing_permissions_inheritance'), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = []; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SettingsContext Context for this SettingsInstance + */ + protected function proxy(): SettingsContext + { + if (!$this->context) { + $this->context = new SettingsContext( + $this->version + ); + } + + return $this->context; + } + + /** + * Fetch the SettingsInstance + * + * @return SettingsInstance Fetched SettingsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SettingsInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SettingsInstance + * + * @param array|Options $options Optional Arguments + * @return SettingsInstance Updated SettingsInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SettingsInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Voice.V1.SettingsInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Voice/V1/DialingPermissions/SettingsList.php b/app/api/Twilio/Rest/Voice/V1/DialingPermissions/SettingsList.php new file mode 100755 index 0000000..8923667 --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/DialingPermissions/SettingsList.php @@ -0,0 +1,61 @@ +solution = [ + ]; + } + + /** + * Constructs a SettingsContext + */ + public function getContext( + + ): SettingsContext + { + return new SettingsContext( + $this->version + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.SettingsList]'; + } +} diff --git a/app/api/Twilio/Rest/Voice/V1/DialingPermissions/SettingsOptions.php b/app/api/Twilio/Rest/Voice/V1/DialingPermissions/SettingsOptions.php new file mode 100755 index 0000000..8abeede --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/DialingPermissions/SettingsOptions.php @@ -0,0 +1,78 @@ +options['dialingPermissionsInheritance'] = $dialingPermissionsInheritance; + } + + /** + * `true` for the sub-account to inherit voice dialing permissions from the Master Project; otherwise `false`. + * + * @param bool $dialingPermissionsInheritance `true` for the sub-account to inherit voice dialing permissions from the Master Project; otherwise `false`. + * @return $this Fluent Builder + */ + public function setDialingPermissionsInheritance(bool $dialingPermissionsInheritance): self + { + $this->options['dialingPermissionsInheritance'] = $dialingPermissionsInheritance; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Voice.V1.UpdateSettingsOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Voice/V1/DialingPermissions/SettingsPage.php b/app/api/Twilio/Rest/Voice/V1/DialingPermissions/SettingsPage.php new file mode 100755 index 0000000..313ea95 --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/DialingPermissions/SettingsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SettingsInstance \Twilio\Rest\Voice\V1\DialingPermissions\SettingsInstance + */ + public function buildInstance(array $payload): SettingsInstance + { + return new SettingsInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.SettingsPage]'; + } +} diff --git a/app/api/Twilio/Rest/Voice/V1/DialingPermissionsInstance.php b/app/api/Twilio/Rest/Voice/V1/DialingPermissionsInstance.php new file mode 100755 index 0000000..f00794f --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/DialingPermissionsInstance.php @@ -0,0 +1,71 @@ +solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.DialingPermissionsInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Voice/V1/DialingPermissionsList.php b/app/api/Twilio/Rest/Voice/V1/DialingPermissionsList.php new file mode 100755 index 0000000..63659cd --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/DialingPermissionsList.php @@ -0,0 +1,139 @@ +solution = [ + ]; + } + + /** + * Access the bulkCountryUpdates + */ + protected function getBulkCountryUpdates(): BulkCountryUpdateList + { + if (!$this->_bulkCountryUpdates) { + $this->_bulkCountryUpdates = new BulkCountryUpdateList( + $this->version + ); + } + return $this->_bulkCountryUpdates; + } + + /** + * Access the countries + */ + protected function getCountries(): CountryList + { + if (!$this->_countries) { + $this->_countries = new CountryList( + $this->version + ); + } + return $this->_countries; + } + + /** + * Access the settings + */ + protected function getSettings(): SettingsList + { + if (!$this->_settings) { + $this->_settings = new SettingsList( + $this->version + ); + } + return $this->_settings; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return \Twilio\ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name) + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.DialingPermissionsList]'; + } +} diff --git a/app/api/Twilio/Rest/Voice/V1/DialingPermissionsPage.php b/app/api/Twilio/Rest/Voice/V1/DialingPermissionsPage.php new file mode 100755 index 0000000..30dcc79 --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/DialingPermissionsPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DialingPermissionsInstance \Twilio\Rest\Voice\V1\DialingPermissionsInstance + */ + public function buildInstance(array $payload): DialingPermissionsInstance + { + return new DialingPermissionsInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.DialingPermissionsPage]'; + } +} diff --git a/app/api/Twilio/Rest/Voice/V1/IpRecordContext.php b/app/api/Twilio/Rest/Voice/V1/IpRecordContext.php new file mode 100755 index 0000000..45b392c --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/IpRecordContext.php @@ -0,0 +1,123 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/IpRecords/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the IpRecordInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the IpRecordInstance + * + * @return IpRecordInstance Fetched IpRecordInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): IpRecordInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new IpRecordInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the IpRecordInstance + * + * @param array|Options $options Optional Arguments + * @return IpRecordInstance Updated IpRecordInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): IpRecordInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'FriendlyName' => + $options['friendlyName'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new IpRecordInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Voice.V1.IpRecordContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Voice/V1/IpRecordInstance.php b/app/api/Twilio/Rest/Voice/V1/IpRecordInstance.php new file mode 100755 index 0000000..7a7dac1 --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/IpRecordInstance.php @@ -0,0 +1,156 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'sid' => Values::array_get($payload, 'sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'ipAddress' => Values::array_get($payload, 'ip_address'), + 'cidrPrefixLength' => Values::array_get($payload, 'cidr_prefix_length'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return IpRecordContext Context for this IpRecordInstance + */ + protected function proxy(): IpRecordContext + { + if (!$this->context) { + $this->context = new IpRecordContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the IpRecordInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the IpRecordInstance + * + * @return IpRecordInstance Fetched IpRecordInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): IpRecordInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the IpRecordInstance + * + * @param array|Options $options Optional Arguments + * @return IpRecordInstance Updated IpRecordInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): IpRecordInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Voice.V1.IpRecordInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Voice/V1/IpRecordList.php b/app/api/Twilio/Rest/Voice/V1/IpRecordList.php new file mode 100755 index 0000000..47d1a4c --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/IpRecordList.php @@ -0,0 +1,194 @@ +solution = [ + ]; + + $this->uri = '/IpRecords'; + } + + /** + * Create the IpRecordInstance + * + * @param string $ipAddress An IP address in dotted decimal notation, IPv4 only. + * @param array|Options $options Optional Arguments + * @return IpRecordInstance Created IpRecordInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $ipAddress, array $options = []): IpRecordInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'IpAddress' => + $ipAddress, + 'FriendlyName' => + $options['friendlyName'], + 'CidrPrefixLength' => + $options['cidrPrefixLength'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new IpRecordInstance( + $this->version, + $payload + ); + } + + + /** + * Reads IpRecordInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return IpRecordInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams IpRecordInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of IpRecordInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return IpRecordPage Page of IpRecordInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): IpRecordPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new IpRecordPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of IpRecordInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return IpRecordPage Page of IpRecordInstance + */ + public function getPage(string $targetUrl): IpRecordPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new IpRecordPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a IpRecordContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the IP Record resource to delete. + */ + public function getContext( + string $sid + + ): IpRecordContext + { + return new IpRecordContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.IpRecordList]'; + } +} diff --git a/app/api/Twilio/Rest/Voice/V1/IpRecordOptions.php b/app/api/Twilio/Rest/Voice/V1/IpRecordOptions.php new file mode 100755 index 0000000..496ba1a --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/IpRecordOptions.php @@ -0,0 +1,152 @@ +options['friendlyName'] = $friendlyName; + $this->options['cidrPrefixLength'] = $cidrPrefixLength; + } + + /** + * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * An integer representing the length of the [CIDR](https://tools.ietf.org/html/rfc4632) prefix to use with this IP address. By default the entire IP address is used, which for IPv4 is value 32. + * + * @param int $cidrPrefixLength An integer representing the length of the [CIDR](https://tools.ietf.org/html/rfc4632) prefix to use with this IP address. By default the entire IP address is used, which for IPv4 is value 32. + * @return $this Fluent Builder + */ + public function setCidrPrefixLength(int $cidrPrefixLength): self + { + $this->options['cidrPrefixLength'] = $cidrPrefixLength; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Voice.V1.CreateIpRecordOptions ' . $options . ']'; + } +} + + + + +class UpdateIpRecordOptions extends Options + { + /** + * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + */ + public function __construct( + + string $friendlyName = Values::NONE + + ) { + $this->options['friendlyName'] = $friendlyName; + } + + /** + * A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It is not unique and can be up to 255 characters long. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Voice.V1.UpdateIpRecordOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Voice/V1/IpRecordPage.php b/app/api/Twilio/Rest/Voice/V1/IpRecordPage.php new file mode 100755 index 0000000..8148000 --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/IpRecordPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return IpRecordInstance \Twilio\Rest\Voice\V1\IpRecordInstance + */ + public function buildInstance(array $payload): IpRecordInstance + { + return new IpRecordInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.IpRecordPage]'; + } +} diff --git a/app/api/Twilio/Rest/Voice/V1/SourceIpMappingContext.php b/app/api/Twilio/Rest/Voice/V1/SourceIpMappingContext.php new file mode 100755 index 0000000..f76d741 --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/SourceIpMappingContext.php @@ -0,0 +1,120 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/SourceIpMappings/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the SourceIpMappingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the SourceIpMappingInstance + * + * @return SourceIpMappingInstance Fetched SourceIpMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SourceIpMappingInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new SourceIpMappingInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the SourceIpMappingInstance + * + * @param string $sipDomainSid The SID of the SIP Domain that the IP Record should be mapped to. + * @return SourceIpMappingInstance Updated SourceIpMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $sipDomainSid): SourceIpMappingInstance + { + + $data = Values::of([ + 'SipDomainSid' => + $sipDomainSid, + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new SourceIpMappingInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Voice.V1.SourceIpMappingContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Voice/V1/SourceIpMappingInstance.php b/app/api/Twilio/Rest/Voice/V1/SourceIpMappingInstance.php new file mode 100755 index 0000000..7f31b0d --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/SourceIpMappingInstance.php @@ -0,0 +1,151 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'ipRecordSid' => Values::array_get($payload, 'ip_record_sid'), + 'sipDomainSid' => Values::array_get($payload, 'sip_domain_sid'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SourceIpMappingContext Context for this SourceIpMappingInstance + */ + protected function proxy(): SourceIpMappingContext + { + if (!$this->context) { + $this->context = new SourceIpMappingContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the SourceIpMappingInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SourceIpMappingInstance + * + * @return SourceIpMappingInstance Fetched SourceIpMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SourceIpMappingInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SourceIpMappingInstance + * + * @param string $sipDomainSid The SID of the SIP Domain that the IP Record should be mapped to. + * @return SourceIpMappingInstance Updated SourceIpMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(string $sipDomainSid): SourceIpMappingInstance + { + + return $this->proxy()->update($sipDomainSid); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Voice.V1.SourceIpMappingInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Voice/V1/SourceIpMappingList.php b/app/api/Twilio/Rest/Voice/V1/SourceIpMappingList.php new file mode 100755 index 0000000..432f90d --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/SourceIpMappingList.php @@ -0,0 +1,189 @@ +solution = [ + ]; + + $this->uri = '/SourceIpMappings'; + } + + /** + * Create the SourceIpMappingInstance + * + * @param string $ipRecordSid The Twilio-provided string that uniquely identifies the IP Record resource to map from. + * @param string $sipDomainSid The SID of the SIP Domain that the IP Record should be mapped to. + * @return SourceIpMappingInstance Created SourceIpMappingInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $ipRecordSid, string $sipDomainSid): SourceIpMappingInstance + { + + $data = Values::of([ + 'IpRecordSid' => + $ipRecordSid, + 'SipDomainSid' => + $sipDomainSid, + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new SourceIpMappingInstance( + $this->version, + $payload + ); + } + + + /** + * Reads SourceIpMappingInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return SourceIpMappingInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams SourceIpMappingInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SourceIpMappingInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return SourceIpMappingPage Page of SourceIpMappingInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SourceIpMappingPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SourceIpMappingPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SourceIpMappingInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SourceIpMappingPage Page of SourceIpMappingInstance + */ + public function getPage(string $targetUrl): SourceIpMappingPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SourceIpMappingPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SourceIpMappingContext + * + * @param string $sid The Twilio-provided string that uniquely identifies the IP Record resource to delete. + */ + public function getContext( + string $sid + + ): SourceIpMappingContext + { + return new SourceIpMappingContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.SourceIpMappingList]'; + } +} diff --git a/app/api/Twilio/Rest/Voice/V1/SourceIpMappingPage.php b/app/api/Twilio/Rest/Voice/V1/SourceIpMappingPage.php new file mode 100755 index 0000000..3a04d1e --- /dev/null +++ b/app/api/Twilio/Rest/Voice/V1/SourceIpMappingPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SourceIpMappingInstance \Twilio\Rest\Voice\V1\SourceIpMappingInstance + */ + public function buildInstance(array $payload): SourceIpMappingInstance + { + return new SourceIpMappingInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Voice.V1.SourceIpMappingPage]'; + } +} diff --git a/app/api/Twilio/Rest/VoiceBase.php b/app/api/Twilio/Rest/VoiceBase.php new file mode 100755 index 0000000..3c5206d --- /dev/null +++ b/app/api/Twilio/Rest/VoiceBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://voice.twilio.com'; + } + + + /** + * @return V1 Version v1 of voice + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Voice]'; + } +} diff --git a/app/api/Twilio/Rest/Wireless.php b/app/api/Twilio/Rest/Wireless.php new file mode 100755 index 0000000..b96bcd1 --- /dev/null +++ b/app/api/Twilio/Rest/Wireless.php @@ -0,0 +1,67 @@ +usageRecords instead. + */ + protected function getUsageRecords(): \Twilio\Rest\Wireless\V1\UsageRecordList { + echo "usageRecords is deprecated. Use v1->usageRecords instead."; + return $this->v1->usageRecords; + } + + /** + * @deprecated Use v1->commands instead. + */ + protected function getCommands(): \Twilio\Rest\Wireless\V1\CommandList { + echo "commands is deprecated. Use v1->commands instead."; + return $this->v1->commands; + } + + /** + * @deprecated Use v1->commands(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextCommands(string $sid): \Twilio\Rest\Wireless\V1\CommandContext { + echo "commands(\$sid) is deprecated. Use v1->commands(\$sid) instead."; + return $this->v1->commands($sid); + } + + /** + * @deprecated Use v1->ratePlans instead. + */ + protected function getRatePlans(): \Twilio\Rest\Wireless\V1\RatePlanList { + echo "ratePlans is deprecated. Use v1->ratePlans instead."; + return $this->v1->ratePlans; + } + + /** + * @deprecated Use v1->ratePlans(\$sid) instead. + * @param string $sid The SID that identifies the resource to fetch + */ + protected function contextRatePlans(string $sid): \Twilio\Rest\Wireless\V1\RatePlanContext { + echo "ratePlans(\$sid) is deprecated. Use v1->ratePlans(\$sid) instead."; + return $this->v1->ratePlans($sid); + } + + /** + * @deprecated Use v1->sims instead. + */ + protected function getSims(): \Twilio\Rest\Wireless\V1\SimList { + echo "sims is deprecated. Use v1->sims instead."; + return $this->v1->sims; + } + + /** + * @deprecated Use v1->sims(\$sid) instead. + * @param string $sid The SID of the Sim resource to fetch + */ + protected function contextSims(string $sid): \Twilio\Rest\Wireless\V1\SimContext { + echo "sims(\$sid) is deprecated. Use v1->sims(\$sid) instead."; + return $this->v1->sims($sid); + } +} \ No newline at end of file diff --git a/app/api/Twilio/Rest/Wireless/V1.php b/app/api/Twilio/Rest/Wireless/V1.php new file mode 100755 index 0000000..5769e89 --- /dev/null +++ b/app/api/Twilio/Rest/Wireless/V1.php @@ -0,0 +1,130 @@ +version = 'v1'; + } + + protected function getCommands(): CommandList + { + if (!$this->_commands) { + $this->_commands = new CommandList($this); + } + return $this->_commands; + } + + protected function getRatePlans(): RatePlanList + { + if (!$this->_ratePlans) { + $this->_ratePlans = new RatePlanList($this); + } + return $this->_ratePlans; + } + + protected function getSims(): SimList + { + if (!$this->_sims) { + $this->_sims = new SimList($this); + } + return $this->_sims; + } + + protected function getUsageRecords(): UsageRecordList + { + if (!$this->_usageRecords) { + $this->_usageRecords = new UsageRecordList($this); + } + return $this->_usageRecords; + } + + /** + * Magic getter to lazy load root resources + * + * @param string $name Resource to return + * @return \Twilio\ListResource The requested resource + * @throws TwilioException For unknown resource + */ + public function __get(string $name) + { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown resource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Wireless.V1]'; + } +} diff --git a/app/api/Twilio/Rest/Wireless/V1/CommandContext.php b/app/api/Twilio/Rest/Wireless/V1/CommandContext.php new file mode 100755 index 0000000..38f6c4a --- /dev/null +++ b/app/api/Twilio/Rest/Wireless/V1/CommandContext.php @@ -0,0 +1,94 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Commands/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the CommandInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the CommandInstance + * + * @return CommandInstance Fetched CommandInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CommandInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new CommandInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Wireless.V1.CommandContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Wireless/V1/CommandInstance.php b/app/api/Twilio/Rest/Wireless/V1/CommandInstance.php new file mode 100755 index 0000000..f45c3d8 --- /dev/null +++ b/app/api/Twilio/Rest/Wireless/V1/CommandInstance.php @@ -0,0 +1,150 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'simSid' => Values::array_get($payload, 'sim_sid'), + 'command' => Values::array_get($payload, 'command'), + 'commandMode' => Values::array_get($payload, 'command_mode'), + 'transport' => Values::array_get($payload, 'transport'), + 'deliveryReceiptRequested' => Values::array_get($payload, 'delivery_receipt_requested'), + 'status' => Values::array_get($payload, 'status'), + 'direction' => Values::array_get($payload, 'direction'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return CommandContext Context for this CommandInstance + */ + protected function proxy(): CommandContext + { + if (!$this->context) { + $this->context = new CommandContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the CommandInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the CommandInstance + * + * @return CommandInstance Fetched CommandInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): CommandInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Wireless.V1.CommandInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Wireless/V1/CommandList.php b/app/api/Twilio/Rest/Wireless/V1/CommandList.php new file mode 100755 index 0000000..437d952 --- /dev/null +++ b/app/api/Twilio/Rest/Wireless/V1/CommandList.php @@ -0,0 +1,215 @@ +solution = [ + ]; + + $this->uri = '/Commands'; + } + + /** + * Create the CommandInstance + * + * @param string $command The message body of the Command. Can be plain text in text mode or a Base64 encoded byte string in binary mode. + * @param array|Options $options Optional Arguments + * @return CommandInstance Created CommandInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(string $command, array $options = []): CommandInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'Command' => + $command, + 'Sim' => + $options['sim'], + 'CallbackMethod' => + $options['callbackMethod'], + 'CallbackUrl' => + $options['callbackUrl'], + 'CommandMode' => + $options['commandMode'], + 'IncludeSid' => + $options['includeSid'], + 'DeliveryReceiptRequested' => + Serialize::booleanToString($options['deliveryReceiptRequested']), + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new CommandInstance( + $this->version, + $payload + ); + } + + + /** + * Reads CommandInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return CommandInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams CommandInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of CommandInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return CommandPage Page of CommandInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): CommandPage + { + $options = new Values($options); + + $params = Values::of([ + 'Sim' => + $options['sim'], + 'Status' => + $options['status'], + 'Direction' => + $options['direction'], + 'Transport' => + $options['transport'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new CommandPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of CommandInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return CommandPage Page of CommandInstance + */ + public function getPage(string $targetUrl): CommandPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new CommandPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a CommandContext + * + * @param string $sid The SID of the Command resource to delete. + */ + public function getContext( + string $sid + + ): CommandContext + { + return new CommandContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Wireless.V1.CommandList]'; + } +} diff --git a/app/api/Twilio/Rest/Wireless/V1/CommandOptions.php b/app/api/Twilio/Rest/Wireless/V1/CommandOptions.php new file mode 100755 index 0000000..16258e9 --- /dev/null +++ b/app/api/Twilio/Rest/Wireless/V1/CommandOptions.php @@ -0,0 +1,274 @@ +options['sim'] = $sim; + $this->options['callbackMethod'] = $callbackMethod; + $this->options['callbackUrl'] = $callbackUrl; + $this->options['commandMode'] = $commandMode; + $this->options['includeSid'] = $includeSid; + $this->options['deliveryReceiptRequested'] = $deliveryReceiptRequested; + } + + /** + * The `sid` or `unique_name` of the [SIM](https://www.twilio.com/docs/wireless/api/sim-resource) to send the Command to. + * + * @param string $sim The `sid` or `unique_name` of the [SIM](https://www.twilio.com/docs/wireless/api/sim-resource) to send the Command to. + * @return $this Fluent Builder + */ + public function setSim(string $sim): self + { + $this->options['sim'] = $sim; + return $this; + } + + /** + * The HTTP method we use to call `callback_url`. Can be: `POST` or `GET`, and the default is `POST`. + * + * @param string $callbackMethod The HTTP method we use to call `callback_url`. Can be: `POST` or `GET`, and the default is `POST`. + * @return $this Fluent Builder + */ + public function setCallbackMethod(string $callbackMethod): self + { + $this->options['callbackMethod'] = $callbackMethod; + return $this; + } + + /** + * The URL we call using the `callback_url` when the Command has finished sending, whether the command was delivered or it failed. + * + * @param string $callbackUrl The URL we call using the `callback_url` when the Command has finished sending, whether the command was delivered or it failed. + * @return $this Fluent Builder + */ + public function setCallbackUrl(string $callbackUrl): self + { + $this->options['callbackUrl'] = $callbackUrl; + return $this; + } + + /** + * @param string $commandMode + * @return $this Fluent Builder + */ + public function setCommandMode(string $commandMode): self + { + $this->options['commandMode'] = $commandMode; + return $this; + } + + /** + * Whether to include the SID of the command in the message body. Can be: `none`, `start`, or `end`, and the default behavior is `none`. When sending a Command to a SIM in text mode, we can automatically include the SID of the Command in the message body, which could be used to ensure that the device does not process the same Command more than once. A value of `start` will prepend the message with the Command SID, and `end` will append it to the end, separating the Command SID from the message body with a space. The length of the Command SID is included in the 160 character limit so the SMS body must be 128 characters or less before the Command SID is included. + * + * @param string $includeSid Whether to include the SID of the command in the message body. Can be: `none`, `start`, or `end`, and the default behavior is `none`. When sending a Command to a SIM in text mode, we can automatically include the SID of the Command in the message body, which could be used to ensure that the device does not process the same Command more than once. A value of `start` will prepend the message with the Command SID, and `end` will append it to the end, separating the Command SID from the message body with a space. The length of the Command SID is included in the 160 character limit so the SMS body must be 128 characters or less before the Command SID is included. + * @return $this Fluent Builder + */ + public function setIncludeSid(string $includeSid): self + { + $this->options['includeSid'] = $includeSid; + return $this; + } + + /** + * Whether to request delivery receipt from the recipient. For Commands that request delivery receipt, the Command state transitions to 'delivered' once the server has received a delivery receipt from the device. The default value is `true`. + * + * @param bool $deliveryReceiptRequested Whether to request delivery receipt from the recipient. For Commands that request delivery receipt, the Command state transitions to 'delivered' once the server has received a delivery receipt from the device. The default value is `true`. + * @return $this Fluent Builder + */ + public function setDeliveryReceiptRequested(bool $deliveryReceiptRequested): self + { + $this->options['deliveryReceiptRequested'] = $deliveryReceiptRequested; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Wireless.V1.CreateCommandOptions ' . $options . ']'; + } +} + + + +class ReadCommandOptions extends Options + { + /** + * @param string $sim The `sid` or `unique_name` of the [Sim resources](https://www.twilio.com/docs/wireless/api/sim-resource) to read. + * @param string $status The status of the resources to read. Can be: `queued`, `sent`, `delivered`, `received`, or `failed`. + * @param string $direction Only return Commands with this direction value. + * @param string $transport Only return Commands with this transport value. Can be: `sms` or `ip`. + */ + public function __construct( + + string $sim = Values::NONE, + string $status = Values::NONE, + string $direction = Values::NONE, + string $transport = Values::NONE + + ) { + $this->options['sim'] = $sim; + $this->options['status'] = $status; + $this->options['direction'] = $direction; + $this->options['transport'] = $transport; + } + + /** + * The `sid` or `unique_name` of the [Sim resources](https://www.twilio.com/docs/wireless/api/sim-resource) to read. + * + * @param string $sim The `sid` or `unique_name` of the [Sim resources](https://www.twilio.com/docs/wireless/api/sim-resource) to read. + * @return $this Fluent Builder + */ + public function setSim(string $sim): self + { + $this->options['sim'] = $sim; + return $this; + } + + /** + * The status of the resources to read. Can be: `queued`, `sent`, `delivered`, `received`, or `failed`. + * + * @param string $status The status of the resources to read. Can be: `queued`, `sent`, `delivered`, `received`, or `failed`. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Only return Commands with this direction value. + * + * @param string $direction Only return Commands with this direction value. + * @return $this Fluent Builder + */ + public function setDirection(string $direction): self + { + $this->options['direction'] = $direction; + return $this; + } + + /** + * Only return Commands with this transport value. Can be: `sms` or `ip`. + * + * @param string $transport Only return Commands with this transport value. Can be: `sms` or `ip`. + * @return $this Fluent Builder + */ + public function setTransport(string $transport): self + { + $this->options['transport'] = $transport; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Wireless.V1.ReadCommandOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Wireless/V1/CommandPage.php b/app/api/Twilio/Rest/Wireless/V1/CommandPage.php new file mode 100755 index 0000000..b85ed90 --- /dev/null +++ b/app/api/Twilio/Rest/Wireless/V1/CommandPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return CommandInstance \Twilio\Rest\Wireless\V1\CommandInstance + */ + public function buildInstance(array $payload): CommandInstance + { + return new CommandInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Wireless.V1.CommandPage]'; + } +} diff --git a/app/api/Twilio/Rest/Wireless/V1/RatePlanContext.php b/app/api/Twilio/Rest/Wireless/V1/RatePlanContext.php new file mode 100755 index 0000000..9063bb7 --- /dev/null +++ b/app/api/Twilio/Rest/Wireless/V1/RatePlanContext.php @@ -0,0 +1,125 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/RatePlans/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the RatePlanInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the RatePlanInstance + * + * @return RatePlanInstance Fetched RatePlanInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RatePlanInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new RatePlanInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the RatePlanInstance + * + * @param array|Options $options Optional Arguments + * @return RatePlanInstance Updated RatePlanInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): RatePlanInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + 'FriendlyName' => + $options['friendlyName'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new RatePlanInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Wireless.V1.RatePlanContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Wireless/V1/RatePlanInstance.php b/app/api/Twilio/Rest/Wireless/V1/RatePlanInstance.php new file mode 100755 index 0000000..1164f15 --- /dev/null +++ b/app/api/Twilio/Rest/Wireless/V1/RatePlanInstance.php @@ -0,0 +1,172 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'dataEnabled' => Values::array_get($payload, 'data_enabled'), + 'dataMetering' => Values::array_get($payload, 'data_metering'), + 'dataLimit' => Values::array_get($payload, 'data_limit'), + 'messagingEnabled' => Values::array_get($payload, 'messaging_enabled'), + 'voiceEnabled' => Values::array_get($payload, 'voice_enabled'), + 'nationalRoamingEnabled' => Values::array_get($payload, 'national_roaming_enabled'), + 'nationalRoamingDataLimit' => Values::array_get($payload, 'national_roaming_data_limit'), + 'internationalRoaming' => Values::array_get($payload, 'international_roaming'), + 'internationalRoamingDataLimit' => Values::array_get($payload, 'international_roaming_data_limit'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return RatePlanContext Context for this RatePlanInstance + */ + protected function proxy(): RatePlanContext + { + if (!$this->context) { + $this->context = new RatePlanContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the RatePlanInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the RatePlanInstance + * + * @return RatePlanInstance Fetched RatePlanInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): RatePlanInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the RatePlanInstance + * + * @param array|Options $options Optional Arguments + * @return RatePlanInstance Updated RatePlanInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): RatePlanInstance + { + + return $this->proxy()->update($options); + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Wireless.V1.RatePlanInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Wireless/V1/RatePlanList.php b/app/api/Twilio/Rest/Wireless/V1/RatePlanList.php new file mode 100755 index 0000000..4a7bd6e --- /dev/null +++ b/app/api/Twilio/Rest/Wireless/V1/RatePlanList.php @@ -0,0 +1,210 @@ +solution = [ + ]; + + $this->uri = '/RatePlans'; + } + + /** + * Create the RatePlanInstance + * + * @param array|Options $options Optional Arguments + * @return RatePlanInstance Created RatePlanInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function create(array $options = []): RatePlanInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + 'FriendlyName' => + $options['friendlyName'], + 'DataEnabled' => + Serialize::booleanToString($options['dataEnabled']), + 'DataLimit' => + $options['dataLimit'], + 'DataMetering' => + $options['dataMetering'], + 'MessagingEnabled' => + Serialize::booleanToString($options['messagingEnabled']), + 'VoiceEnabled' => + Serialize::booleanToString($options['voiceEnabled']), + 'NationalRoamingEnabled' => + Serialize::booleanToString($options['nationalRoamingEnabled']), + 'InternationalRoaming' => + Serialize::map($options['internationalRoaming'], function ($e) { return $e; }), + 'NationalRoamingDataLimit' => + $options['nationalRoamingDataLimit'], + 'InternationalRoamingDataLimit' => + $options['internationalRoamingDataLimit'], + ]); + + $payload = $this->version->create('POST', $this->uri, [], $data); + + return new RatePlanInstance( + $this->version, + $payload + ); + } + + + /** + * Reads RatePlanInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return RatePlanInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams RatePlanInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of RatePlanInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return RatePlanPage Page of RatePlanInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): RatePlanPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new RatePlanPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of RatePlanInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return RatePlanPage Page of RatePlanInstance + */ + public function getPage(string $targetUrl): RatePlanPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new RatePlanPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a RatePlanContext + * + * @param string $sid The SID of the RatePlan resource to delete. + */ + public function getContext( + string $sid + + ): RatePlanContext + { + return new RatePlanContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Wireless.V1.RatePlanList]'; + } +} diff --git a/app/api/Twilio/Rest/Wireless/V1/RatePlanOptions.php b/app/api/Twilio/Rest/Wireless/V1/RatePlanOptions.php new file mode 100755 index 0000000..1e00778 --- /dev/null +++ b/app/api/Twilio/Rest/Wireless/V1/RatePlanOptions.php @@ -0,0 +1,332 @@ +options['uniqueName'] = $uniqueName; + $this->options['friendlyName'] = $friendlyName; + $this->options['dataEnabled'] = $dataEnabled; + $this->options['dataLimit'] = $dataLimit; + $this->options['dataMetering'] = $dataMetering; + $this->options['messagingEnabled'] = $messagingEnabled; + $this->options['voiceEnabled'] = $voiceEnabled; + $this->options['nationalRoamingEnabled'] = $nationalRoamingEnabled; + $this->options['internationalRoaming'] = $internationalRoaming; + $this->options['nationalRoamingDataLimit'] = $nationalRoamingDataLimit; + $this->options['internationalRoamingDataLimit'] = $internationalRoamingDataLimit; + } + + /** + * An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * A descriptive string that you create to describe the resource. It does not have to be unique. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It does not have to be unique. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Whether SIMs can use GPRS/3G/4G/LTE data connectivity. + * + * @param bool $dataEnabled Whether SIMs can use GPRS/3G/4G/LTE data connectivity. + * @return $this Fluent Builder + */ + public function setDataEnabled(bool $dataEnabled): self + { + $this->options['dataEnabled'] = $dataEnabled; + return $this; + } + + /** + * The total data usage (download and upload combined) in Megabytes that the Network allows during one month on the home network (T-Mobile USA). The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB and the default value is `1000`. + * + * @param int $dataLimit The total data usage (download and upload combined) in Megabytes that the Network allows during one month on the home network (T-Mobile USA). The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB and the default value is `1000`. + * @return $this Fluent Builder + */ + public function setDataLimit(int $dataLimit): self + { + $this->options['dataLimit'] = $dataLimit; + return $this; + } + + /** + * The model used to meter data usage. Can be: `payg` and `quota-1`, `quota-10`, and `quota-50`. Learn more about the available [data metering models](https://www.twilio.com/docs/wireless/api/rateplan-resource#payg-vs-quota-data-plans). + * + * @param string $dataMetering The model used to meter data usage. Can be: `payg` and `quota-1`, `quota-10`, and `quota-50`. Learn more about the available [data metering models](https://www.twilio.com/docs/wireless/api/rateplan-resource#payg-vs-quota-data-plans). + * @return $this Fluent Builder + */ + public function setDataMetering(string $dataMetering): self + { + $this->options['dataMetering'] = $dataMetering; + return $this; + } + + /** + * Whether SIMs can make, send, and receive SMS using [Commands](https://www.twilio.com/docs/wireless/api/command-resource). + * + * @param bool $messagingEnabled Whether SIMs can make, send, and receive SMS using [Commands](https://www.twilio.com/docs/wireless/api/command-resource). + * @return $this Fluent Builder + */ + public function setMessagingEnabled(bool $messagingEnabled): self + { + $this->options['messagingEnabled'] = $messagingEnabled; + return $this; + } + + /** + * Deprecated. + * + * @param bool $voiceEnabled Deprecated. + * @return $this Fluent Builder + */ + public function setVoiceEnabled(bool $voiceEnabled): self + { + $this->options['voiceEnabled'] = $voiceEnabled; + return $this; + } + + /** + * Whether SIMs can roam on networks other than the home network (T-Mobile USA) in the United States. See [national roaming](https://www.twilio.com/docs/wireless/api/rateplan-resource#national-roaming). + * + * @param bool $nationalRoamingEnabled Whether SIMs can roam on networks other than the home network (T-Mobile USA) in the United States. See [national roaming](https://www.twilio.com/docs/wireless/api/rateplan-resource#national-roaming). + * @return $this Fluent Builder + */ + public function setNationalRoamingEnabled(bool $nationalRoamingEnabled): self + { + $this->options['nationalRoamingEnabled'] = $nationalRoamingEnabled; + return $this; + } + + /** + * The list of services that SIMs capable of using GPRS/3G/4G/LTE data connectivity can use outside of the United States. Can contain: `data` and `messaging`. + * + * @param string[] $internationalRoaming The list of services that SIMs capable of using GPRS/3G/4G/LTE data connectivity can use outside of the United States. Can contain: `data` and `messaging`. + * @return $this Fluent Builder + */ + public function setInternationalRoaming(array $internationalRoaming): self + { + $this->options['internationalRoaming'] = $internationalRoaming; + return $this; + } + + /** + * The total data usage (download and upload combined) in Megabytes that the Network allows during one month on non-home networks in the United States. The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB. See [national roaming](https://www.twilio.com/docs/wireless/api/rateplan-resource#national-roaming) for more info. + * + * @param int $nationalRoamingDataLimit The total data usage (download and upload combined) in Megabytes that the Network allows during one month on non-home networks in the United States. The metering period begins the day of activation and ends on the same day in the following month. Can be up to 2TB. See [national roaming](https://www.twilio.com/docs/wireless/api/rateplan-resource#national-roaming) for more info. + * @return $this Fluent Builder + */ + public function setNationalRoamingDataLimit(int $nationalRoamingDataLimit): self + { + $this->options['nationalRoamingDataLimit'] = $nationalRoamingDataLimit; + return $this; + } + + /** + * The total data usage (download and upload combined) in Megabytes that the Network allows during one month when roaming outside the United States. Can be up to 2TB. + * + * @param int $internationalRoamingDataLimit The total data usage (download and upload combined) in Megabytes that the Network allows during one month when roaming outside the United States. Can be up to 2TB. + * @return $this Fluent Builder + */ + public function setInternationalRoamingDataLimit(int $internationalRoamingDataLimit): self + { + $this->options['internationalRoamingDataLimit'] = $internationalRoamingDataLimit; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Wireless.V1.CreateRatePlanOptions ' . $options . ']'; + } +} + + + + +class UpdateRatePlanOptions extends Options + { + /** + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. + * @param string $friendlyName A descriptive string that you create to describe the resource. It does not have to be unique. + */ + public function __construct( + + string $uniqueName = Values::NONE, + string $friendlyName = Values::NONE + + ) { + $this->options['uniqueName'] = $uniqueName; + $this->options['friendlyName'] = $friendlyName; + } + + /** + * An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the resource's `sid` in the URL to address the resource. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * A descriptive string that you create to describe the resource. It does not have to be unique. + * + * @param string $friendlyName A descriptive string that you create to describe the resource. It does not have to be unique. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Wireless.V1.UpdateRatePlanOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Wireless/V1/RatePlanPage.php b/app/api/Twilio/Rest/Wireless/V1/RatePlanPage.php new file mode 100755 index 0000000..b2d39c7 --- /dev/null +++ b/app/api/Twilio/Rest/Wireless/V1/RatePlanPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return RatePlanInstance \Twilio\Rest\Wireless\V1\RatePlanInstance + */ + public function buildInstance(array $payload): RatePlanInstance + { + return new RatePlanInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Wireless.V1.RatePlanPage]'; + } +} diff --git a/app/api/Twilio/Rest/Wireless/V1/Sim/DataSessionInstance.php b/app/api/Twilio/Rest/Wireless/V1/Sim/DataSessionInstance.php new file mode 100755 index 0000000..d2c4361 --- /dev/null +++ b/app/api/Twilio/Rest/Wireless/V1/Sim/DataSessionInstance.php @@ -0,0 +1,112 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'simSid' => Values::array_get($payload, 'sim_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'radioLink' => Values::array_get($payload, 'radio_link'), + 'operatorMcc' => Values::array_get($payload, 'operator_mcc'), + 'operatorMnc' => Values::array_get($payload, 'operator_mnc'), + 'operatorCountry' => Values::array_get($payload, 'operator_country'), + 'operatorName' => Values::array_get($payload, 'operator_name'), + 'cellId' => Values::array_get($payload, 'cell_id'), + 'cellLocationEstimate' => Values::array_get($payload, 'cell_location_estimate'), + 'packetsUploaded' => Values::array_get($payload, 'packets_uploaded'), + 'packetsDownloaded' => Values::array_get($payload, 'packets_downloaded'), + 'lastUpdated' => Deserialize::dateTime(Values::array_get($payload, 'last_updated')), + 'start' => Deserialize::dateTime(Values::array_get($payload, 'start')), + 'end' => Deserialize::dateTime(Values::array_get($payload, 'end')), + 'imei' => Values::array_get($payload, 'imei'), + ]; + + $this->solution = ['simSid' => $simSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Wireless.V1.DataSessionInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Wireless/V1/Sim/DataSessionList.php b/app/api/Twilio/Rest/Wireless/V1/Sim/DataSessionList.php new file mode 100755 index 0000000..d3dc255 --- /dev/null +++ b/app/api/Twilio/Rest/Wireless/V1/Sim/DataSessionList.php @@ -0,0 +1,151 @@ +solution = [ + 'simSid' => + $simSid, + + ]; + + $this->uri = '/Sims/' . \rawurlencode($simSid) + .'/DataSessions'; + } + + /** + * Reads DataSessionInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return DataSessionInstance[] Array of results + */ + public function read(int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($limit, $pageSize), false); + } + + /** + * Streams DataSessionInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of DataSessionInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return DataSessionPage Page of DataSessionInstance + */ + public function page( + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): DataSessionPage + { + + $params = Values::of([ + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new DataSessionPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of DataSessionInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return DataSessionPage Page of DataSessionInstance + */ + public function getPage(string $targetUrl): DataSessionPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new DataSessionPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Wireless.V1.DataSessionList]'; + } +} diff --git a/app/api/Twilio/Rest/Wireless/V1/Sim/DataSessionPage.php b/app/api/Twilio/Rest/Wireless/V1/Sim/DataSessionPage.php new file mode 100755 index 0000000..a681659 --- /dev/null +++ b/app/api/Twilio/Rest/Wireless/V1/Sim/DataSessionPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return DataSessionInstance \Twilio\Rest\Wireless\V1\Sim\DataSessionInstance + */ + public function buildInstance(array $payload): DataSessionInstance + { + return new DataSessionInstance($this->version, $payload, $this->solution['simSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Wireless.V1.DataSessionPage]'; + } +} diff --git a/app/api/Twilio/Rest/Wireless/V1/Sim/UsageRecordInstance.php b/app/api/Twilio/Rest/Wireless/V1/Sim/UsageRecordInstance.php new file mode 100755 index 0000000..221ff94 --- /dev/null +++ b/app/api/Twilio/Rest/Wireless/V1/Sim/UsageRecordInstance.php @@ -0,0 +1,89 @@ +properties = [ + 'simSid' => Values::array_get($payload, 'sim_sid'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'period' => Values::array_get($payload, 'period'), + 'commands' => Values::array_get($payload, 'commands'), + 'data' => Values::array_get($payload, 'data'), + ]; + + $this->solution = ['simSid' => $simSid, ]; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Wireless.V1.UsageRecordInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Wireless/V1/Sim/UsageRecordList.php b/app/api/Twilio/Rest/Wireless/V1/Sim/UsageRecordList.php new file mode 100755 index 0000000..8049af1 --- /dev/null +++ b/app/api/Twilio/Rest/Wireless/V1/Sim/UsageRecordList.php @@ -0,0 +1,163 @@ +solution = [ + 'simSid' => + $simSid, + + ]; + + $this->uri = '/Sims/' . \rawurlencode($simSid) + .'/UsageRecords'; + } + + /** + * Reads UsageRecordInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return UsageRecordInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams UsageRecordInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of UsageRecordInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return UsageRecordPage Page of UsageRecordInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): UsageRecordPage + { + $options = new Values($options); + + $params = Values::of([ + 'End' => + Serialize::iso8601DateTime($options['end']), + 'Start' => + Serialize::iso8601DateTime($options['start']), + 'Granularity' => + $options['granularity'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new UsageRecordPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of UsageRecordInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return UsageRecordPage Page of UsageRecordInstance + */ + public function getPage(string $targetUrl): UsageRecordPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new UsageRecordPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Wireless.V1.UsageRecordList]'; + } +} diff --git a/app/api/Twilio/Rest/Wireless/V1/Sim/UsageRecordOptions.php b/app/api/Twilio/Rest/Wireless/V1/Sim/UsageRecordOptions.php new file mode 100755 index 0000000..c9156d9 --- /dev/null +++ b/app/api/Twilio/Rest/Wireless/V1/Sim/UsageRecordOptions.php @@ -0,0 +1,112 @@ +options['end'] = $end; + $this->options['start'] = $start; + $this->options['granularity'] = $granularity; + } + + /** + * Only include usage that occurred on or before this date, specified in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). The default is the current time. + * + * @param \DateTime $end Only include usage that occurred on or before this date, specified in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). The default is the current time. + * @return $this Fluent Builder + */ + public function setEnd(\DateTime $end): self + { + $this->options['end'] = $end; + return $this; + } + + /** + * Only include usage that has occurred on or after this date, specified in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). The default is one month before the `end` parameter value. + * + * @param \DateTime $start Only include usage that has occurred on or after this date, specified in [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). The default is one month before the `end` parameter value. + * @return $this Fluent Builder + */ + public function setStart(\DateTime $start): self + { + $this->options['start'] = $start; + return $this; + } + + /** + * How to summarize the usage by time. Can be: `daily`, `hourly`, or `all`. The default is `all`. A value of `all` returns one Usage Record that describes the usage for the entire period. + * + * @param string $granularity How to summarize the usage by time. Can be: `daily`, `hourly`, or `all`. The default is `all`. A value of `all` returns one Usage Record that describes the usage for the entire period. + * @return $this Fluent Builder + */ + public function setGranularity(string $granularity): self + { + $this->options['granularity'] = $granularity; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Wireless.V1.ReadUsageRecordOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Wireless/V1/Sim/UsageRecordPage.php b/app/api/Twilio/Rest/Wireless/V1/Sim/UsageRecordPage.php new file mode 100755 index 0000000..186fac6 --- /dev/null +++ b/app/api/Twilio/Rest/Wireless/V1/Sim/UsageRecordPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UsageRecordInstance \Twilio\Rest\Wireless\V1\Sim\UsageRecordInstance + */ + public function buildInstance(array $payload): UsageRecordInstance + { + return new UsageRecordInstance($this->version, $payload, $this->solution['simSid']); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Wireless.V1.UsageRecordPage]'; + } +} diff --git a/app/api/Twilio/Rest/Wireless/V1/SimContext.php b/app/api/Twilio/Rest/Wireless/V1/SimContext.php new file mode 100755 index 0000000..51a307c --- /dev/null +++ b/app/api/Twilio/Rest/Wireless/V1/SimContext.php @@ -0,0 +1,232 @@ +solution = [ + 'sid' => + $sid, + ]; + + $this->uri = '/Sims/' . \rawurlencode($sid) + .''; + } + + /** + * Delete the SimInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->version->delete('DELETE', $this->uri); + } + + + /** + * Fetch the SimInstance + * + * @return SimInstance Fetched SimInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SimInstance + { + + $payload = $this->version->fetch('GET', $this->uri); + + return new SimInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Update the SimInstance + * + * @param array|Options $options Optional Arguments + * @return SimInstance Updated SimInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SimInstance + { + + $options = new Values($options); + + $data = Values::of([ + 'UniqueName' => + $options['uniqueName'], + 'CallbackMethod' => + $options['callbackMethod'], + 'CallbackUrl' => + $options['callbackUrl'], + 'FriendlyName' => + $options['friendlyName'], + 'RatePlan' => + $options['ratePlan'], + 'Status' => + $options['status'], + 'CommandsCallbackMethod' => + $options['commandsCallbackMethod'], + 'CommandsCallbackUrl' => + $options['commandsCallbackUrl'], + 'SmsFallbackMethod' => + $options['smsFallbackMethod'], + 'SmsFallbackUrl' => + $options['smsFallbackUrl'], + 'SmsMethod' => + $options['smsMethod'], + 'SmsUrl' => + $options['smsUrl'], + 'VoiceFallbackMethod' => + $options['voiceFallbackMethod'], + 'VoiceFallbackUrl' => + $options['voiceFallbackUrl'], + 'VoiceMethod' => + $options['voiceMethod'], + 'VoiceUrl' => + $options['voiceUrl'], + 'ResetStatus' => + $options['resetStatus'], + 'AccountSid' => + $options['accountSid'], + ]); + + $payload = $this->version->update('POST', $this->uri, [], $data); + + return new SimInstance( + $this->version, + $payload, + $this->solution['sid'] + ); + } + + + /** + * Access the dataSessions + */ + protected function getDataSessions(): DataSessionList + { + if (!$this->_dataSessions) { + $this->_dataSessions = new DataSessionList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_dataSessions; + } + + /** + * Access the usageRecords + */ + protected function getUsageRecords(): UsageRecordList + { + if (!$this->_usageRecords) { + $this->_usageRecords = new UsageRecordList( + $this->version, + $this->solution['sid'] + ); + } + + return $this->_usageRecords; + } + + /** + * Magic getter to lazy load subresources + * + * @param string $name Subresource to return + * @return ListResource The requested subresource + * @throws TwilioException For unknown subresources + */ + public function __get(string $name): ListResource + { + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown subresource ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments): InstanceContext + { + $property = $this->$name; + if (\method_exists($property, 'getContext')) { + return \call_user_func_array(array($property, 'getContext'), $arguments); + } + + throw new TwilioException('Resource does not have a context'); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Wireless.V1.SimContext ' . \implode(' ', $context) . ']'; + } +} diff --git a/app/api/Twilio/Rest/Wireless/V1/SimInstance.php b/app/api/Twilio/Rest/Wireless/V1/SimInstance.php new file mode 100755 index 0000000..55d29d0 --- /dev/null +++ b/app/api/Twilio/Rest/Wireless/V1/SimInstance.php @@ -0,0 +1,209 @@ +properties = [ + 'sid' => Values::array_get($payload, 'sid'), + 'uniqueName' => Values::array_get($payload, 'unique_name'), + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'ratePlanSid' => Values::array_get($payload, 'rate_plan_sid'), + 'friendlyName' => Values::array_get($payload, 'friendly_name'), + 'iccid' => Values::array_get($payload, 'iccid'), + 'eId' => Values::array_get($payload, 'e_id'), + 'status' => Values::array_get($payload, 'status'), + 'resetStatus' => Values::array_get($payload, 'reset_status'), + 'commandsCallbackUrl' => Values::array_get($payload, 'commands_callback_url'), + 'commandsCallbackMethod' => Values::array_get($payload, 'commands_callback_method'), + 'smsFallbackMethod' => Values::array_get($payload, 'sms_fallback_method'), + 'smsFallbackUrl' => Values::array_get($payload, 'sms_fallback_url'), + 'smsMethod' => Values::array_get($payload, 'sms_method'), + 'smsUrl' => Values::array_get($payload, 'sms_url'), + 'voiceFallbackMethod' => Values::array_get($payload, 'voice_fallback_method'), + 'voiceFallbackUrl' => Values::array_get($payload, 'voice_fallback_url'), + 'voiceMethod' => Values::array_get($payload, 'voice_method'), + 'voiceUrl' => Values::array_get($payload, 'voice_url'), + 'dateCreated' => Deserialize::dateTime(Values::array_get($payload, 'date_created')), + 'dateUpdated' => Deserialize::dateTime(Values::array_get($payload, 'date_updated')), + 'url' => Values::array_get($payload, 'url'), + 'links' => Values::array_get($payload, 'links'), + 'ipAddress' => Values::array_get($payload, 'ip_address'), + ]; + + $this->solution = ['sid' => $sid ?: $this->properties['sid'], ]; + } + + /** + * Generate an instance context for the instance, the context is capable of + * performing various actions. All instance actions are proxied to the context + * + * @return SimContext Context for this SimInstance + */ + protected function proxy(): SimContext + { + if (!$this->context) { + $this->context = new SimContext( + $this->version, + $this->solution['sid'] + ); + } + + return $this->context; + } + + /** + * Delete the SimInstance + * + * @return bool True if delete succeeds, false otherwise + * @throws TwilioException When an HTTP error occurs. + */ + public function delete(): bool + { + + return $this->proxy()->delete(); + } + + /** + * Fetch the SimInstance + * + * @return SimInstance Fetched SimInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function fetch(): SimInstance + { + + return $this->proxy()->fetch(); + } + + /** + * Update the SimInstance + * + * @param array|Options $options Optional Arguments + * @return SimInstance Updated SimInstance + * @throws TwilioException When an HTTP error occurs. + */ + public function update(array $options = []): SimInstance + { + + return $this->proxy()->update($options); + } + + /** + * Access the dataSessions + */ + protected function getDataSessions(): DataSessionList + { + return $this->proxy()->dataSessions; + } + + /** + * Access the usageRecords + */ + protected function getUsageRecords(): UsageRecordList + { + return $this->proxy()->usageRecords; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $context = []; + foreach ($this->solution as $key => $value) { + $context[] = "$key=$value"; + } + return '[Twilio.Wireless.V1.SimInstance ' . \implode(' ', $context) . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Wireless/V1/SimList.php b/app/api/Twilio/Rest/Wireless/V1/SimList.php new file mode 100755 index 0000000..4fc1b8c --- /dev/null +++ b/app/api/Twilio/Rest/Wireless/V1/SimList.php @@ -0,0 +1,176 @@ +solution = [ + ]; + + $this->uri = '/Sims'; + } + + /** + * Reads SimInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return SimInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams SimInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of SimInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return SimPage Page of SimInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): SimPage + { + $options = new Values($options); + + $params = Values::of([ + 'Status' => + $options['status'], + 'Iccid' => + $options['iccid'], + 'RatePlan' => + $options['ratePlan'], + 'EId' => + $options['eId'], + 'SimRegistrationCode' => + $options['simRegistrationCode'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new SimPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of SimInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return SimPage Page of SimInstance + */ + public function getPage(string $targetUrl): SimPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new SimPage($this->version, $response, $this->solution); + } + + + /** + * Constructs a SimContext + * + * @param string $sid The SID or the `unique_name` of the Sim resource to delete. + */ + public function getContext( + string $sid + + ): SimContext + { + return new SimContext( + $this->version, + $sid + ); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Wireless.V1.SimList]'; + } +} diff --git a/app/api/Twilio/Rest/Wireless/V1/SimOptions.php b/app/api/Twilio/Rest/Wireless/V1/SimOptions.php new file mode 100755 index 0000000..0cb5fc2 --- /dev/null +++ b/app/api/Twilio/Rest/Wireless/V1/SimOptions.php @@ -0,0 +1,506 @@ +options['status'] = $status; + $this->options['iccid'] = $iccid; + $this->options['ratePlan'] = $ratePlan; + $this->options['eId'] = $eId; + $this->options['simRegistrationCode'] = $simRegistrationCode; + } + + /** + * Only return Sim resources with this status. + * + * @param string $status Only return Sim resources with this status. + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * Only return Sim resources with this ICCID. This will return a list with a maximum size of 1. + * + * @param string $iccid Only return Sim resources with this ICCID. This will return a list with a maximum size of 1. + * @return $this Fluent Builder + */ + public function setIccid(string $iccid): self + { + $this->options['iccid'] = $iccid; + return $this; + } + + /** + * The SID or unique name of a [RatePlan resource](https://www.twilio.com/docs/wireless/api/rateplan-resource). Only return Sim resources assigned to this RatePlan resource. + * + * @param string $ratePlan The SID or unique name of a [RatePlan resource](https://www.twilio.com/docs/wireless/api/rateplan-resource). Only return Sim resources assigned to this RatePlan resource. + * @return $this Fluent Builder + */ + public function setRatePlan(string $ratePlan): self + { + $this->options['ratePlan'] = $ratePlan; + return $this; + } + + /** + * Deprecated. + * + * @param string $eId Deprecated. + * @return $this Fluent Builder + */ + public function setEId(string $eId): self + { + $this->options['eId'] = $eId; + return $this; + } + + /** + * Only return Sim resources with this registration code. This will return a list with a maximum size of 1. + * + * @param string $simRegistrationCode Only return Sim resources with this registration code. This will return a list with a maximum size of 1. + * @return $this Fluent Builder + */ + public function setSimRegistrationCode(string $simRegistrationCode): self + { + $this->options['simRegistrationCode'] = $simRegistrationCode; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Wireless.V1.ReadSimOptions ' . $options . ']'; + } +} + +class UpdateSimOptions extends Options + { + /** + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the `sid` in the URL path to address the resource. + * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `POST` or `GET`. The default is `POST`. + * @param string $callbackUrl The URL we should call using the `callback_url` when the SIM has finished updating. When the SIM transitions from `new` to `ready` or from any status to `deactivated`, we call this URL when the status changes to an intermediate status (`ready` or `deactivated`) and again when the status changes to its final status (`active` or `canceled`). + * @param string $friendlyName A descriptive string that you create to describe the Sim resource. It does not need to be unique. + * @param string $ratePlan The SID or unique name of the [RatePlan resource](https://www.twilio.com/docs/wireless/api/rateplan-resource) to which the Sim resource should be assigned. + * @param string $status + * @param string $commandsCallbackMethod The HTTP method we should use to call `commands_callback_url`. Can be: `POST` or `GET`. The default is `POST`. + * @param string $commandsCallbackUrl The URL we should call using the `commands_callback_method` when the SIM sends a [Command](https://www.twilio.com/docs/wireless/api/command-resource). Your server should respond with an HTTP status code in the 200 range; any response body is ignored. + * @param string $smsFallbackMethod The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. Default is `POST`. + * @param string $smsFallbackUrl The URL we should call using the `sms_fallback_method` when an error occurs while retrieving or executing the TwiML requested from `sms_url`. + * @param string $smsMethod The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. Default is `POST`. + * @param string $smsUrl The URL we should call using the `sms_method` when the SIM-connected device sends an SMS message that is not a [Command](https://www.twilio.com/docs/wireless/api/command-resource). + * @param string $voiceFallbackMethod Deprecated. + * @param string $voiceFallbackUrl Deprecated. + * @param string $voiceMethod Deprecated. + * @param string $voiceUrl Deprecated. + * @param string $resetStatus + * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) to which the Sim resource should belong. The Account SID can only be that of the requesting Account or that of a [Subaccount](https://www.twilio.com/docs/iam/api/subaccounts) of the requesting Account. Only valid when the Sim resource's status is `new`. For more information, see the [Move SIMs between Subaccounts documentation](https://www.twilio.com/docs/wireless/api/sim-resource#move-sims-between-subaccounts). + */ + public function __construct( + + string $uniqueName = Values::NONE, + string $callbackMethod = Values::NONE, + string $callbackUrl = Values::NONE, + string $friendlyName = Values::NONE, + string $ratePlan = Values::NONE, + string $status = Values::NONE, + string $commandsCallbackMethod = Values::NONE, + string $commandsCallbackUrl = Values::NONE, + string $smsFallbackMethod = Values::NONE, + string $smsFallbackUrl = Values::NONE, + string $smsMethod = Values::NONE, + string $smsUrl = Values::NONE, + string $voiceFallbackMethod = Values::NONE, + string $voiceFallbackUrl = Values::NONE, + string $voiceMethod = Values::NONE, + string $voiceUrl = Values::NONE, + string $resetStatus = Values::NONE, + string $accountSid = Values::NONE + + ) { + $this->options['uniqueName'] = $uniqueName; + $this->options['callbackMethod'] = $callbackMethod; + $this->options['callbackUrl'] = $callbackUrl; + $this->options['friendlyName'] = $friendlyName; + $this->options['ratePlan'] = $ratePlan; + $this->options['status'] = $status; + $this->options['commandsCallbackMethod'] = $commandsCallbackMethod; + $this->options['commandsCallbackUrl'] = $commandsCallbackUrl; + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + $this->options['smsMethod'] = $smsMethod; + $this->options['smsUrl'] = $smsUrl; + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + $this->options['voiceMethod'] = $voiceMethod; + $this->options['voiceUrl'] = $voiceUrl; + $this->options['resetStatus'] = $resetStatus; + $this->options['accountSid'] = $accountSid; + } + + /** + * An application-defined string that uniquely identifies the resource. It can be used in place of the `sid` in the URL path to address the resource. + * + * @param string $uniqueName An application-defined string that uniquely identifies the resource. It can be used in place of the `sid` in the URL path to address the resource. + * @return $this Fluent Builder + */ + public function setUniqueName(string $uniqueName): self + { + $this->options['uniqueName'] = $uniqueName; + return $this; + } + + /** + * The HTTP method we should use to call `callback_url`. Can be: `POST` or `GET`. The default is `POST`. + * + * @param string $callbackMethod The HTTP method we should use to call `callback_url`. Can be: `POST` or `GET`. The default is `POST`. + * @return $this Fluent Builder + */ + public function setCallbackMethod(string $callbackMethod): self + { + $this->options['callbackMethod'] = $callbackMethod; + return $this; + } + + /** + * The URL we should call using the `callback_url` when the SIM has finished updating. When the SIM transitions from `new` to `ready` or from any status to `deactivated`, we call this URL when the status changes to an intermediate status (`ready` or `deactivated`) and again when the status changes to its final status (`active` or `canceled`). + * + * @param string $callbackUrl The URL we should call using the `callback_url` when the SIM has finished updating. When the SIM transitions from `new` to `ready` or from any status to `deactivated`, we call this URL when the status changes to an intermediate status (`ready` or `deactivated`) and again when the status changes to its final status (`active` or `canceled`). + * @return $this Fluent Builder + */ + public function setCallbackUrl(string $callbackUrl): self + { + $this->options['callbackUrl'] = $callbackUrl; + return $this; + } + + /** + * A descriptive string that you create to describe the Sim resource. It does not need to be unique. + * + * @param string $friendlyName A descriptive string that you create to describe the Sim resource. It does not need to be unique. + * @return $this Fluent Builder + */ + public function setFriendlyName(string $friendlyName): self + { + $this->options['friendlyName'] = $friendlyName; + return $this; + } + + /** + * The SID or unique name of the [RatePlan resource](https://www.twilio.com/docs/wireless/api/rateplan-resource) to which the Sim resource should be assigned. + * + * @param string $ratePlan The SID or unique name of the [RatePlan resource](https://www.twilio.com/docs/wireless/api/rateplan-resource) to which the Sim resource should be assigned. + * @return $this Fluent Builder + */ + public function setRatePlan(string $ratePlan): self + { + $this->options['ratePlan'] = $ratePlan; + return $this; + } + + /** + * @param string $status + * @return $this Fluent Builder + */ + public function setStatus(string $status): self + { + $this->options['status'] = $status; + return $this; + } + + /** + * The HTTP method we should use to call `commands_callback_url`. Can be: `POST` or `GET`. The default is `POST`. + * + * @param string $commandsCallbackMethod The HTTP method we should use to call `commands_callback_url`. Can be: `POST` or `GET`. The default is `POST`. + * @return $this Fluent Builder + */ + public function setCommandsCallbackMethod(string $commandsCallbackMethod): self + { + $this->options['commandsCallbackMethod'] = $commandsCallbackMethod; + return $this; + } + + /** + * The URL we should call using the `commands_callback_method` when the SIM sends a [Command](https://www.twilio.com/docs/wireless/api/command-resource). Your server should respond with an HTTP status code in the 200 range; any response body is ignored. + * + * @param string $commandsCallbackUrl The URL we should call using the `commands_callback_method` when the SIM sends a [Command](https://www.twilio.com/docs/wireless/api/command-resource). Your server should respond with an HTTP status code in the 200 range; any response body is ignored. + * @return $this Fluent Builder + */ + public function setCommandsCallbackUrl(string $commandsCallbackUrl): self + { + $this->options['commandsCallbackUrl'] = $commandsCallbackUrl; + return $this; + } + + /** + * The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. Default is `POST`. + * + * @param string $smsFallbackMethod The HTTP method we should use to call `sms_fallback_url`. Can be: `GET` or `POST`. Default is `POST`. + * @return $this Fluent Builder + */ + public function setSmsFallbackMethod(string $smsFallbackMethod): self + { + $this->options['smsFallbackMethod'] = $smsFallbackMethod; + return $this; + } + + /** + * The URL we should call using the `sms_fallback_method` when an error occurs while retrieving or executing the TwiML requested from `sms_url`. + * + * @param string $smsFallbackUrl The URL we should call using the `sms_fallback_method` when an error occurs while retrieving or executing the TwiML requested from `sms_url`. + * @return $this Fluent Builder + */ + public function setSmsFallbackUrl(string $smsFallbackUrl): self + { + $this->options['smsFallbackUrl'] = $smsFallbackUrl; + return $this; + } + + /** + * The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. Default is `POST`. + * + * @param string $smsMethod The HTTP method we should use to call `sms_url`. Can be: `GET` or `POST`. Default is `POST`. + * @return $this Fluent Builder + */ + public function setSmsMethod(string $smsMethod): self + { + $this->options['smsMethod'] = $smsMethod; + return $this; + } + + /** + * The URL we should call using the `sms_method` when the SIM-connected device sends an SMS message that is not a [Command](https://www.twilio.com/docs/wireless/api/command-resource). + * + * @param string $smsUrl The URL we should call using the `sms_method` when the SIM-connected device sends an SMS message that is not a [Command](https://www.twilio.com/docs/wireless/api/command-resource). + * @return $this Fluent Builder + */ + public function setSmsUrl(string $smsUrl): self + { + $this->options['smsUrl'] = $smsUrl; + return $this; + } + + /** + * Deprecated. + * + * @param string $voiceFallbackMethod Deprecated. + * @return $this Fluent Builder + */ + public function setVoiceFallbackMethod(string $voiceFallbackMethod): self + { + $this->options['voiceFallbackMethod'] = $voiceFallbackMethod; + return $this; + } + + /** + * Deprecated. + * + * @param string $voiceFallbackUrl Deprecated. + * @return $this Fluent Builder + */ + public function setVoiceFallbackUrl(string $voiceFallbackUrl): self + { + $this->options['voiceFallbackUrl'] = $voiceFallbackUrl; + return $this; + } + + /** + * Deprecated. + * + * @param string $voiceMethod Deprecated. + * @return $this Fluent Builder + */ + public function setVoiceMethod(string $voiceMethod): self + { + $this->options['voiceMethod'] = $voiceMethod; + return $this; + } + + /** + * Deprecated. + * + * @param string $voiceUrl Deprecated. + * @return $this Fluent Builder + */ + public function setVoiceUrl(string $voiceUrl): self + { + $this->options['voiceUrl'] = $voiceUrl; + return $this; + } + + /** + * @param string $resetStatus + * @return $this Fluent Builder + */ + public function setResetStatus(string $resetStatus): self + { + $this->options['resetStatus'] = $resetStatus; + return $this; + } + + /** + * The SID of the [Account](https://www.twilio.com/docs/iam/api/account) to which the Sim resource should belong. The Account SID can only be that of the requesting Account or that of a [Subaccount](https://www.twilio.com/docs/iam/api/subaccounts) of the requesting Account. Only valid when the Sim resource's status is `new`. For more information, see the [Move SIMs between Subaccounts documentation](https://www.twilio.com/docs/wireless/api/sim-resource#move-sims-between-subaccounts). + * + * @param string $accountSid The SID of the [Account](https://www.twilio.com/docs/iam/api/account) to which the Sim resource should belong. The Account SID can only be that of the requesting Account or that of a [Subaccount](https://www.twilio.com/docs/iam/api/subaccounts) of the requesting Account. Only valid when the Sim resource's status is `new`. For more information, see the [Move SIMs between Subaccounts documentation](https://www.twilio.com/docs/wireless/api/sim-resource#move-sims-between-subaccounts). + * @return $this Fluent Builder + */ + public function setAccountSid(string $accountSid): self + { + $this->options['accountSid'] = $accountSid; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Wireless.V1.UpdateSimOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Wireless/V1/SimPage.php b/app/api/Twilio/Rest/Wireless/V1/SimPage.php new file mode 100755 index 0000000..8fd38a0 --- /dev/null +++ b/app/api/Twilio/Rest/Wireless/V1/SimPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return SimInstance \Twilio\Rest\Wireless\V1\SimInstance + */ + public function buildInstance(array $payload): SimInstance + { + return new SimInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Wireless.V1.SimPage]'; + } +} diff --git a/app/api/Twilio/Rest/Wireless/V1/UsageRecordInstance.php b/app/api/Twilio/Rest/Wireless/V1/UsageRecordInstance.php new file mode 100755 index 0000000..4cb7e93 --- /dev/null +++ b/app/api/Twilio/Rest/Wireless/V1/UsageRecordInstance.php @@ -0,0 +1,86 @@ +properties = [ + 'accountSid' => Values::array_get($payload, 'account_sid'), + 'period' => Values::array_get($payload, 'period'), + 'commands' => Values::array_get($payload, 'commands'), + 'data' => Values::array_get($payload, 'data'), + ]; + + $this->solution = []; + } + + /** + * Magic getter to access properties + * + * @param string $name Property to access + * @return mixed The requested property + * @throws TwilioException For unknown properties + */ + public function __get(string $name) + { + if (\array_key_exists($name, $this->properties)) { + return $this->properties[$name]; + } + + if (\property_exists($this, '_' . $name)) { + $method = 'get' . \ucfirst($name); + return $this->$method(); + } + + throw new TwilioException('Unknown property: ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Wireless.V1.UsageRecordInstance]'; + } +} + diff --git a/app/api/Twilio/Rest/Wireless/V1/UsageRecordList.php b/app/api/Twilio/Rest/Wireless/V1/UsageRecordList.php new file mode 100755 index 0000000..a59c5a9 --- /dev/null +++ b/app/api/Twilio/Rest/Wireless/V1/UsageRecordList.php @@ -0,0 +1,157 @@ +solution = [ + ]; + + $this->uri = '/UsageRecords'; + } + + /** + * Reads UsageRecordInstance records from the API as a list. + * Unlike stream(), this operation is eager and will load `limit` records into + * memory before returning. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. read() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, read() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return UsageRecordInstance[] Array of results + */ + public function read(array $options = [], int $limit = null, $pageSize = null): array + { + return \iterator_to_array($this->stream($options, $limit, $pageSize), false); + } + + /** + * Streams UsageRecordInstance records from the API as a generator stream. + * This operation lazily loads records as efficiently as possible until the + * limit + * is reached. + * The results are returned as a generator, so this operation is memory + * efficient. + * + * @param array|Options $options Optional Arguments + * @param int $limit Upper limit for the number of records to return. stream() + * guarantees to never return more than limit. Default is no + * limit + * @param mixed $pageSize Number of records to fetch per request, when not set + * will use the default value of 50 records. If no + * page_size is defined but a limit is defined, stream() + * will attempt to read the limit with the most + * efficient page size, i.e. min(limit, 1000) + * @return Stream stream of results + */ + public function stream(array $options = [], int $limit = null, $pageSize = null): Stream + { + $limits = $this->version->readLimits($limit, $pageSize); + + $page = $this->page($options, $limits['pageSize']); + + return $this->version->stream($page, $limits['limit'], $limits['pageLimit']); + } + + /** + * Retrieve a single page of UsageRecordInstance records from the API. + * Request is executed immediately + * + * @param mixed $pageSize Number of records to return, defaults to 50 + * @param string $pageToken PageToken provided by the API + * @param mixed $pageNumber Page Number, this value is simply for client state + * @return UsageRecordPage Page of UsageRecordInstance + */ + public function page( + array $options = [], + $pageSize = Values::NONE, + string $pageToken = Values::NONE, + $pageNumber = Values::NONE + ): UsageRecordPage + { + $options = new Values($options); + + $params = Values::of([ + 'End' => + Serialize::iso8601DateTime($options['end']), + 'Start' => + Serialize::iso8601DateTime($options['start']), + 'Granularity' => + $options['granularity'], + 'PageToken' => $pageToken, + 'Page' => $pageNumber, + 'PageSize' => $pageSize, + ]); + + $response = $this->version->page('GET', $this->uri, $params); + + return new UsageRecordPage($this->version, $response, $this->solution); + } + + /** + * Retrieve a specific page of UsageRecordInstance records from the API. + * Request is executed immediately + * + * @param string $targetUrl API-generated URL for the requested results page + * @return UsageRecordPage Page of UsageRecordInstance + */ + public function getPage(string $targetUrl): UsageRecordPage + { + $response = $this->version->getDomain()->getClient()->request( + 'GET', + $targetUrl + ); + + return new UsageRecordPage($this->version, $response, $this->solution); + } + + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Wireless.V1.UsageRecordList]'; + } +} diff --git a/app/api/Twilio/Rest/Wireless/V1/UsageRecordOptions.php b/app/api/Twilio/Rest/Wireless/V1/UsageRecordOptions.php new file mode 100755 index 0000000..f1068c7 --- /dev/null +++ b/app/api/Twilio/Rest/Wireless/V1/UsageRecordOptions.php @@ -0,0 +1,112 @@ +options['end'] = $end; + $this->options['start'] = $start; + $this->options['granularity'] = $granularity; + } + + /** + * Only include usage that has occurred on or before this date. Format is [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). + * + * @param \DateTime $end Only include usage that has occurred on or before this date. Format is [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). + * @return $this Fluent Builder + */ + public function setEnd(\DateTime $end): self + { + $this->options['end'] = $end; + return $this; + } + + /** + * Only include usage that has occurred on or after this date. Format is [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). + * + * @param \DateTime $start Only include usage that has occurred on or after this date. Format is [ISO 8601](https://www.iso.org/iso-8601-date-and-time-format.html). + * @return $this Fluent Builder + */ + public function setStart(\DateTime $start): self + { + $this->options['start'] = $start; + return $this; + } + + /** + * How to summarize the usage by time. Can be: `daily`, `hourly`, or `all`. A value of `all` returns one Usage Record that describes the usage for the entire period. + * + * @param string $granularity How to summarize the usage by time. Can be: `daily`, `hourly`, or `all`. A value of `all` returns one Usage Record that describes the usage for the entire period. + * @return $this Fluent Builder + */ + public function setGranularity(string $granularity): self + { + $this->options['granularity'] = $granularity; + return $this; + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + $options = \http_build_query(Values::of($this->options), '', ' '); + return '[Twilio.Wireless.V1.ReadUsageRecordOptions ' . $options . ']'; + } +} + diff --git a/app/api/Twilio/Rest/Wireless/V1/UsageRecordPage.php b/app/api/Twilio/Rest/Wireless/V1/UsageRecordPage.php new file mode 100755 index 0000000..cf99de5 --- /dev/null +++ b/app/api/Twilio/Rest/Wireless/V1/UsageRecordPage.php @@ -0,0 +1,55 @@ +solution = $solution; + } + + /** + * @param array $payload Payload response from the API + * @return UsageRecordInstance \Twilio\Rest\Wireless\V1\UsageRecordInstance + */ + public function buildInstance(array $payload): UsageRecordInstance + { + return new UsageRecordInstance($this->version, $payload); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string + { + return '[Twilio.Wireless.V1.UsageRecordPage]'; + } +} diff --git a/app/api/Twilio/Rest/WirelessBase.php b/app/api/Twilio/Rest/WirelessBase.php new file mode 100755 index 0000000..773a7e0 --- /dev/null +++ b/app/api/Twilio/Rest/WirelessBase.php @@ -0,0 +1,88 @@ +baseUrl = 'https://wireless.twilio.com'; + } + + + /** + * @return V1 Version v1 of wireless + */ + protected function getV1(): V1 { + if (!$this->_v1) { + $this->_v1 = new V1($this); + } + return $this->_v1; + } + + /** + * Magic getter to lazy load version + * + * @param string $name Version to return + * @return \Twilio\Version The requested version + * @throws TwilioException For unknown versions + */ + public function __get(string $name) { + $method = 'get' . \ucfirst($name); + if (\method_exists($this, $method)) { + return $this->$method(); + } + + throw new TwilioException('Unknown version ' . $name); + } + + /** + * Magic caller to get resource contexts + * + * @param string $name Resource to return + * @param array $arguments Context parameters + * @return \Twilio\InstanceContext The requested resource context + * @throws TwilioException For unknown resource + */ + public function __call(string $name, array $arguments) { + $method = 'context' . \ucfirst($name); + if (\method_exists($this, $method)) { + return \call_user_func_array([$this, $method], $arguments); + } + + throw new TwilioException('Unknown context ' . $name); + } + + /** + * Provide a friendly representation + * + * @return string Machine friendly representation + */ + public function __toString(): string { + return '[Twilio.Wireless]'; + } +} diff --git a/app/api/Twilio/Security/RequestValidator.php b/app/api/Twilio/Security/RequestValidator.php new file mode 100755 index 0000000..8e02e1c --- /dev/null +++ b/app/api/Twilio/Security/RequestValidator.php @@ -0,0 +1,172 @@ +validate($_SERVER['HTTP_X_TWILIO_SIGNATURE'], 'https://your-example-url.com/api/route/', $_REQUEST); + * $isFromTwilio // <- if this is true, the request did come from Twilio, if not, it didn't + */ +class RequestValidator { + + /** + * @access private + * @var string The auth token to the Twilio Account + */ + private $authToken; + + /** + * constructor + * @access public + * @param string $authToken the auth token of the Twilio user's account + * Sets the account auth token to be used by the rest of the class + */ + public function __construct(string $authToken) { + $this->authToken = $authToken; + } + + /** + * Creates the actual base64 encoded signature of the sha1 hash of the concatenated URL and your auth token + * + * @param string $url the full URL of the request URL you specify for your phone number or app, from the protocol (https...) through the end of the query string (everything after the ?) + * @param array $data the Twilio parameters the request was made with + * @return string + */ + public function computeSignature(string $url, array $data = []): string { + // sort the array by keys + \ksort($data); + + foreach ($data as $key => $value) { + // convert a single value to an array or remove any duplicates + $valueArray = \is_array($value) ? \array_unique($value) : array($value); + // also sort all the values + \sort($valueArray); + + // append them to the data string with no delimiters + foreach ($valueArray as $item) { + $url .= $key . $item; + } + } + + // sha1 then base64 the url to the auth token and return the base64-ed string + return \base64_encode(\hash_hmac('sha1', $url, $this->authToken, true)); + } + + /** + * Converts the raw binary output to a hexadecimal return + * + * @param string $data + * @return string + */ + public static function computeBodyHash(string $data = ''): string { + return \bin2hex(\hash('sha256', $data, true)); + } + + /** + * The only method the client should be running...takes the Twilio signature, their URL, and the Twilio params and validates the signature + * + * @param string $expectedSignature + * @param string $url + * @param array|string $data + * @return bool + */ + public function validate(string $expectedSignature, string $url, $data = []): bool { + $parsedUrl = \parse_url($url); + + $urlWithPort = self::addPort($parsedUrl); + $urlWithoutPort = self::removePort($parsedUrl); + $validBodyHash = true; // May not receive body hash, so default succeed + + if (!\is_array($data)) { + // handling if the data was passed through as a string instead of an array of params + $queryString = \explode('?', $url); + $queryString = $queryString[1]; + \parse_str($queryString, $params); + + $validBodyHash = self::compare(self::computeBodyHash($data), Values::array_get($params, 'bodySHA256')); + $data = []; + } + + /* + * Check signature of the URL with and without port information + * since sig generation on the back end is inconsistent. + */ + $validSignatureWithPort = self::compare( + $expectedSignature, + $this->computeSignature($urlWithPort, $data) + ); + $validSignatureWithoutPort = self::compare( + $expectedSignature, + $this->computeSignature($urlWithoutPort, $data) + ); + + return $validBodyHash && ($validSignatureWithPort || $validSignatureWithoutPort); + } + + /** + * Time insensitive compare, function's runtime is governed by the length + * of the first argument, not the difference between the arguments. + * + * @param string $a First part of the comparison pair + * @param string $b Second part of the comparison pair + * @return bool True if $a === $b, false otherwise. + */ + public static function compare(?string $a, ?string $b): bool { + if ($a && $b) { + return hash_equals($a, $b); + } + + return false; + } + + /** + * Removes the port from the URL + * + * @param array $parsedUrl + * @return string Full URL without the port number + */ + private static function removePort(array $parsedUrl): string { + unset($parsedUrl['port']); + return self::unparse_url($parsedUrl); + } + + /** + * Adds the port to the URL + * + * @param array $parsedUrl + * @return string Full URL with the port number + */ + private static function addPort(array $parsedUrl): string { + if (!isset($parsedUrl['port'])) { + $port = ($parsedUrl['scheme'] === 'https') ? 443 : 80; + $parsedUrl['port'] = $port; + } + return self::unparse_url($parsedUrl); + } + + /** + * Builds the URL from its parsed component pieces + * + * @param array $parsedUrl + * @return string Full URL + */ + static function unparse_url(array $parsedUrl): string { + $parts = []; + + $parts['scheme'] = isset($parsedUrl['scheme']) ? $parsedUrl['scheme'] . '://' : ''; + $parts['user'] = $parsedUrl['user'] ?? ''; + $parts['pass'] = isset($parsedUrl['pass']) ? ':' . $parsedUrl['pass'] : ''; + $parts['pass'] = ($parts['user'] || $parts['pass']) ? $parts['pass'] . '@' : ''; + $parts['host'] = $parsedUrl['host'] ?? ''; + $parts['port'] = isset($parsedUrl['port']) ? ':' . $parsedUrl['port'] : ''; + $parts['path'] = $parsedUrl['path'] ?? ''; + $parts['query'] = isset($parsedUrl['query']) ? '?' . $parsedUrl['query'] : ''; + $parts['fragment'] = isset($parsedUrl['fragment']) ? '#' . $parsedUrl['fragment'] : ''; + + return \implode('', $parts); + } +} diff --git a/app/api/Twilio/Serialize.php b/app/api/Twilio/Serialize.php new file mode 100755 index 0000000..6d0643a --- /dev/null +++ b/app/api/Twilio/Serialize.php @@ -0,0 +1,83 @@ + $value) { + if (\is_array($value)) { + $result = self::flatten($value, $result, \array_merge($previous, [$key])); + } else { + $result[\implode('.', \array_merge($previous, [$key]))] = $value; + } + } + + return $result; + } + + public static function prefixedCollapsibleMap($map, string $prefix): array { + if ($map === null || $map === Values::NONE) { + return []; + } + + $flattened = self::flatten($map); + $result = []; + foreach ($flattened as $key => $value) { + $result[$prefix . '.' . $key] = $value; + } + + return $result; + } + + public static function iso8601Date($dateTime): string { + if ($dateTime === null || $dateTime === Values::NONE) { + return Values::NONE; + } + + if (\is_string($dateTime)) { + return $dateTime; + } + + $utcDate = clone $dateTime; + $utcDate->setTimezone(new \DateTimeZone('+0000')); + return $utcDate->format('Y-m-d'); + } + + public static function iso8601DateTime($dateTime): string { + if ($dateTime === null || $dateTime === Values::NONE) { + return Values::NONE; + } + + if (\is_string($dateTime)) { + return $dateTime; + } + + $utcDate = clone $dateTime; + $utcDate->setTimezone(new \DateTimeZone('+0000')); + return $utcDate->format('Y-m-d\TH:i:s\Z'); + } + + public static function booleanToString($boolOrStr) { + if ($boolOrStr === null || \is_string($boolOrStr)) { + return $boolOrStr; + } + + return $boolOrStr ? 'True' : 'False'; + } + + public static function jsonObject($object) { + if (\is_array($object)) { + return \json_encode($object); + } + return $object; + } + + public static function map($values, $map_func) { + if (!\is_array($values)) { + return $values; + } + return \array_map($map_func, $values); + } + +} diff --git a/app/api/Twilio/Stream.php b/app/api/Twilio/Stream.php new file mode 100755 index 0000000..4dec2ca --- /dev/null +++ b/app/api/Twilio/Stream.php @@ -0,0 +1,105 @@ +page = $page; + $this->firstPage = $page; + $this->limit = $limit; + $this->currentRecord = 1; + $this->pageLimit = $pageLimit; + $this->currentPage = 1; + } + + /** + * (PHP 5 >= 5.0.0)
+ * Return the current element + * @link http://php.net/manual/en/iterator.current.php + * @return mixed Can return any type. + */ + #[\ReturnTypeWillChange] + public function current() { + return $this->page->current(); + } + + /** + * (PHP 5 >= 5.0.0)
+ * Move forward to next element + * @link http://php.net/manual/en/iterator.next.php + * @return void Any returned value is ignored. + */ + public function next(): void { + $this->page->next(); + $this->currentRecord++; + + if ($this->overLimit()) { + return; + } + + if (!$this->page->valid()) { + if ($this->overPageLimit()) { + return; + } + $this->page = $this->page->nextPage(); + $this->currentPage++; + } + } + + /** + * (PHP 5 >= 5.0.0)
+ * Return the key of the current element + * @link http://php.net/manual/en/iterator.key.php + * @return mixed scalar on success, or null on failure. + */ + #[\ReturnTypeWillChange] + public function key() { + return $this->currentRecord; + } + + /** + * (PHP 5 >= 5.0.0)
+ * Checks if current position is valid + * @link http://php.net/manual/en/iterator.valid.php + * @return bool The return value will be casted to boolean and then evaluated. + * Returns true on success or false on failure. + */ + public function valid(): bool { + return $this->page && $this->page->valid() && !$this->overLimit() && !$this->overPageLimit(); + } + + /** + * (PHP 5 >= 5.0.0)
+ * Rewind the Iterator to the first element + * @link http://php.net/manual/en/iterator.rewind.php + * @return void Any returned value is ignored. + */ + public function rewind(): void { + $this->page = $this->firstPage; + $this->page->rewind(); + $this->currentPage = 1; + $this->currentRecord = 1; + } + + protected function overLimit(): bool { + return ($this->limit !== null + && $this->limit !== Values::NONE + && $this->limit < $this->currentRecord); + } + + protected function overPageLimit(): bool { + return ($this->pageLimit !== null + && $this->pageLimit !== Values::NONE + && $this->pageLimit < $this->currentPage); + } + +} diff --git a/app/api/Twilio/TaskRouter/WorkflowConfiguration.php b/app/api/Twilio/TaskRouter/WorkflowConfiguration.php new file mode 100755 index 0000000..3ee2c6b --- /dev/null +++ b/app/api/Twilio/TaskRouter/WorkflowConfiguration.php @@ -0,0 +1,49 @@ + + * @license http://creativecommons.org/licenses/MIT/ MIT + */ +class WorkflowConfiguration implements \JsonSerializable { + public $filters; + public $default_filter; + + public function __construct(array $filters, $default_filter = null) { + $this->filters = $filters; + $this->default_filter = $default_filter; + } + + public function toJSON() { + return \json_encode($this); + } + + public static function parse(string $json) { + return \json_decode($json); + } + + public static function fromJson(string $json): WorkflowConfiguration { + $configJSON = self::parse($json); + $default_filter = $configJSON->task_routing->default_filter; + $filters = []; + foreach ($configJSON->task_routing->filters as $filter) { + // friendly_name and filter_friendly_name should map to same variable + $friendly_name = $filter->filter_friendly_name ?? $filter->friendly_name; + $filter = new WorkflowRule($filter->expression, $filter->targets, $friendly_name); + $filters[] = $filter; + } + return new WorkflowConfiguration($filters, $default_filter); + } + + public function jsonSerialize(): array { + $json = []; + $task_routing = []; + $task_routing['filters'] = $this->filters; + $task_routing['default_filter'] = $this->default_filter; + $json['task_routing'] = $task_routing; + return $json; + } +} diff --git a/app/api/Twilio/TaskRouter/WorkflowRule.php b/app/api/Twilio/TaskRouter/WorkflowRule.php new file mode 100755 index 0000000..2a45efd --- /dev/null +++ b/app/api/Twilio/TaskRouter/WorkflowRule.php @@ -0,0 +1,31 @@ + + * @license http://creativecommons.org/licenses/MIT/ MIT + */ +class WorkflowRule implements \JsonSerializable { + public $expression; + public $friendly_name; + public $targets; + + public function __construct(string $expression, array $targets, string $friendly_name = null) { + $this->expression = $expression; + $this->targets = $targets; + $this->friendly_name = $friendly_name; + } + + public function jsonSerialize(): array { + $json = []; + $json['expression'] = $this->expression; + $json['targets'] = $this->targets; + if ($this->friendly_name !== null) { + $json['friendly_name'] = $this->friendly_name; + } + return $json; + } +} diff --git a/app/api/Twilio/TaskRouter/WorkflowRuleTarget.php b/app/api/Twilio/TaskRouter/WorkflowRuleTarget.php new file mode 100755 index 0000000..68fd134 --- /dev/null +++ b/app/api/Twilio/TaskRouter/WorkflowRuleTarget.php @@ -0,0 +1,38 @@ + + * @license http://creativecommons.org/licenses/MIT/ MIT + */ +class WorkflowRuleTarget implements \JsonSerializable { + public $queue; + public $expression; + public $priority; + public $timeout; + + public function __construct(string $queue, int $priority = null, int $timeout = null, string $expression = null) { + $this->queue = $queue; + $this->priority = $priority; + $this->timeout = $timeout; + $this->expression = $expression; + } + + public function jsonSerialize(): array { + $json = []; + $json['queue'] = $this->queue; + if ($this->priority !== null) { + $json['priority'] = $this->priority; + } + if ($this->timeout !== null) { + $json['timeout'] = $this->timeout; + } + if ($this->expression !== null) { + $json['expression'] = $this->expression; + } + return $json; + } +} diff --git a/app/api/Twilio/TwiML/Fax/Receive.php b/app/api/Twilio/TwiML/Fax/Receive.php new file mode 100755 index 0000000..3b40753 --- /dev/null +++ b/app/api/Twilio/TwiML/Fax/Receive.php @@ -0,0 +1,70 @@ +setAttribute('action', $action); + } + + /** + * Add Method attribute. + * + * @param string $method Receive action URL method + */ + public function setMethod($method): self { + return $this->setAttribute('method', $method); + } + + /** + * Add MediaType attribute. + * + * @param string $mediaType The media type used to store media in the fax media + * store + */ + public function setMediaType($mediaType): self { + return $this->setAttribute('mediaType', $mediaType); + } + + /** + * Add PageSize attribute. + * + * @param string $pageSize What size to interpret received pages as + */ + public function setPageSize($pageSize): self { + return $this->setAttribute('pageSize', $pageSize); + } + + /** + * Add StoreMedia attribute. + * + * @param bool $storeMedia Whether or not to store received media in the fax + * media store + */ + public function setStoreMedia($storeMedia): self { + return $this->setAttribute('storeMedia', $storeMedia); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/FaxResponse.php b/app/api/Twilio/TwiML/FaxResponse.php new file mode 100755 index 0000000..b95f0fe --- /dev/null +++ b/app/api/Twilio/TwiML/FaxResponse.php @@ -0,0 +1,29 @@ +nest(new Fax\Receive($attributes)); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/GenericNode.php b/app/api/Twilio/TwiML/GenericNode.php new file mode 100755 index 0000000..65f9c8f --- /dev/null +++ b/app/api/Twilio/TwiML/GenericNode.php @@ -0,0 +1,19 @@ +name = $name; + $this->value = $value; + } +} diff --git a/app/api/Twilio/TwiML/Messaging/Body.php b/app/api/Twilio/TwiML/Messaging/Body.php new file mode 100755 index 0000000..578f6f8 --- /dev/null +++ b/app/api/Twilio/TwiML/Messaging/Body.php @@ -0,0 +1,23 @@ +nest(new Body($message)); + } + + /** + * Add Media child. + * + * @param string $url Media URL + * @return Media Child element. + */ + public function media($url): Media { + return $this->nest(new Media($url)); + } + + /** + * Add To attribute. + * + * @param string $to Phone Number to send Message to + */ + public function setTo($to): self { + return $this->setAttribute('to', $to); + } + + /** + * Add From attribute. + * + * @param string $from Phone Number to send Message from + */ + public function setFrom($from): self { + return $this->setAttribute('from', $from); + } + + /** + * Add Action attribute. + * + * @param string $action Action URL + */ + public function setAction($action): self { + return $this->setAttribute('action', $action); + } + + /** + * Add Method attribute. + * + * @param string $method Action URL Method + */ + public function setMethod($method): self { + return $this->setAttribute('method', $method); + } + + /** + * Add StatusCallback attribute. + * + * @param string $statusCallback Status callback URL. Deprecated in favor of + * action. + */ + public function setStatusCallback($statusCallback): self { + return $this->setAttribute('statusCallback', $statusCallback); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Messaging/Redirect.php b/app/api/Twilio/TwiML/Messaging/Redirect.php new file mode 100755 index 0000000..efa685c --- /dev/null +++ b/app/api/Twilio/TwiML/Messaging/Redirect.php @@ -0,0 +1,33 @@ +setAttribute('method', $method); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/MessagingResponse.php b/app/api/Twilio/TwiML/MessagingResponse.php new file mode 100755 index 0000000..bfc877d --- /dev/null +++ b/app/api/Twilio/TwiML/MessagingResponse.php @@ -0,0 +1,41 @@ +nest(new Messaging\Message($body, $attributes)); + } + + /** + * Add Redirect child. + * + * @param string $url Redirect URL + * @param array $attributes Optional attributes + * @return Messaging\Redirect Child element. + */ + public function redirect($url, $attributes = []): Messaging\Redirect { + return $this->nest(new Messaging\Redirect($url, $attributes)); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/TwiML.php b/app/api/Twilio/TwiML/TwiML.php new file mode 100755 index 0000000..ec19f5e --- /dev/null +++ b/app/api/Twilio/TwiML/TwiML.php @@ -0,0 +1,136 @@ +name = $name; + $this->attributes = $attributes; + $this->children = []; + + if ($value !== null) { + $this->children[] = $value; + } + } + + /** + * Add a TwiML element. + * + * @param TwiML|string $twiml TwiML element to add + * @return TwiML $this + */ + public function append($twiml): TwiML { + $this->children[] = $twiml; + return $this; + } + + /** + * Add a TwiML element. + * + * @param TwiML $twiml TwiML element to add + * @return TwiML added TwiML element + */ + public function nest(TwiML $twiml): TwiML { + $this->children[] = $twiml; + return $twiml; + } + + /** + * Set TwiML attribute. + * + * @param string $key name of attribute + * @param string $value value of attribute + * @return static $this + */ + public function setAttribute(string $key, string $value): TwiML { + $this->attributes[$key] = $value; + return $this; + } + + /** + * @param string $name XML element name + * @param string $value XML value + * @param array $attributes XML attributes + * @return TwiML + */ + public function addChild(string $name, string $value = null, array $attributes = []): TwiML { + return $this->nest(new GenericNode($name, $value, $attributes)); + } + + /** + * Convert TwiML to XML string. + * + * @return string TwiML XML representation + */ + public function asXML(): string { + return (string)$this; + } + + /** + * Convert TwiML to XML string. + * + * @return string TwiML XML representation + */ + public function __toString(): string { + return $this->xml()->saveXML(); + } + + /** + * Build TwiML element. + * + * @param TwiML $twiml TwiML element to convert to XML + * @param DOMDocument $document XML document for the element + * @return DOMElement $element + */ + private function buildElement(TwiML $twiml, DOMDocument $document): DOMElement { + $element = $document->createElement($twiml->name); + + foreach ($twiml->attributes as $name => $value) { + if (\is_bool($value)) { + $value = ($value === true) ? 'true' : 'false'; + } + $element->setAttribute($name, $value); + } + + foreach ($twiml->children as $child) { + if (\is_string($child)) { + $element->appendChild($document->createTextNode($child)); + } else { + $element->appendChild($this->buildElement($child, $document)); + } + } + + return $element; + } + + /** + * Build XML element. + * + * @return DOMDocument Build TwiML element + */ + private function xml(): DOMDocument { + $document = new DOMDocument('1.0', 'UTF-8'); + $document->appendChild($this->buildElement($this, $document)); + return $document; + } +} diff --git a/app/api/Twilio/TwiML/Video/Room.php b/app/api/Twilio/TwiML/Video/Room.php new file mode 100755 index 0000000..d464f40 --- /dev/null +++ b/app/api/Twilio/TwiML/Video/Room.php @@ -0,0 +1,23 @@ +nest(new ApplicationSid($sid)); + } + + /** + * Add Parameter child. + * + * @param array $attributes Optional attributes + * @return Parameter Child element. + */ + public function parameter($attributes = []): Parameter { + return $this->nest(new Parameter($attributes)); + } + + /** + * Add Url attribute. + * + * @param string $url TwiML URL + */ + public function setUrl($url): self { + return $this->setAttribute('url', $url); + } + + /** + * Add Method attribute. + * + * @param string $method TwiML URL Method + */ + public function setMethod($method): self { + return $this->setAttribute('method', $method); + } + + /** + * Add StatusCallbackEvent attribute. + * + * @param string[] $statusCallbackEvent Events to trigger status callback + */ + public function setStatusCallbackEvent($statusCallbackEvent): self { + return $this->setAttribute('statusCallbackEvent', $statusCallbackEvent); + } + + /** + * Add StatusCallback attribute. + * + * @param string $statusCallback Status Callback URL + */ + public function setStatusCallback($statusCallback): self { + return $this->setAttribute('statusCallback', $statusCallback); + } + + /** + * Add StatusCallbackMethod attribute. + * + * @param string $statusCallbackMethod Status Callback URL Method + */ + public function setStatusCallbackMethod($statusCallbackMethod): self { + return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); + } + + /** + * Add CustomerId attribute. + * + * @param string $customerId Identity of the customer calling application + */ + public function setCustomerId($customerId): self { + return $this->setAttribute('customerId', $customerId); + } + + /** + * Add CopyParentTo attribute. + * + * @param bool $copyParentTo Copy parent call To field to called application + * side, otherwise use the application sid as To field + */ + public function setCopyParentTo($copyParentTo): self { + return $this->setAttribute('copyParentTo', $copyParentTo); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/ApplicationSid.php b/app/api/Twilio/TwiML/Voice/ApplicationSid.php new file mode 100755 index 0000000..6586873 --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/ApplicationSid.php @@ -0,0 +1,23 @@ +nest(new Identity($clientIdentity)); + } + + /** + * Add Parameter child. + * + * @param array $attributes Optional attributes + * @return Parameter Child element. + */ + public function parameter($attributes = []): Parameter { + return $this->nest(new Parameter($attributes)); + } + + /** + * Add Url attribute. + * + * @param string $url Client URL + */ + public function setUrl($url): self { + return $this->setAttribute('url', $url); + } + + /** + * Add Method attribute. + * + * @param string $method Client URL Method + */ + public function setMethod($method): self { + return $this->setAttribute('method', $method); + } + + /** + * Add StatusCallbackEvent attribute. + * + * @param string[] $statusCallbackEvent Events to trigger status callback + */ + public function setStatusCallbackEvent($statusCallbackEvent): self { + return $this->setAttribute('statusCallbackEvent', $statusCallbackEvent); + } + + /** + * Add StatusCallback attribute. + * + * @param string $statusCallback Status Callback URL + */ + public function setStatusCallback($statusCallback): self { + return $this->setAttribute('statusCallback', $statusCallback); + } + + /** + * Add StatusCallbackMethod attribute. + * + * @param string $statusCallbackMethod Status Callback URL Method + */ + public function setStatusCallbackMethod($statusCallbackMethod): self { + return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/Conference.php b/app/api/Twilio/TwiML/Voice/Conference.php new file mode 100755 index 0000000..f0bed21 --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/Conference.php @@ -0,0 +1,206 @@ +setAttribute('muted', $muted); + } + + /** + * Add Beep attribute. + * + * @param string $beep Play beep when joining + */ + public function setBeep($beep): self { + return $this->setAttribute('beep', $beep); + } + + /** + * Add StartConferenceOnEnter attribute. + * + * @param bool $startConferenceOnEnter Start the conference on enter + */ + public function setStartConferenceOnEnter($startConferenceOnEnter): self { + return $this->setAttribute('startConferenceOnEnter', $startConferenceOnEnter); + } + + /** + * Add EndConferenceOnExit attribute. + * + * @param bool $endConferenceOnExit End the conferenceon exit + */ + public function setEndConferenceOnExit($endConferenceOnExit): self { + return $this->setAttribute('endConferenceOnExit', $endConferenceOnExit); + } + + /** + * Add WaitUrl attribute. + * + * @param string $waitUrl Wait URL + */ + public function setWaitUrl($waitUrl): self { + return $this->setAttribute('waitUrl', $waitUrl); + } + + /** + * Add WaitMethod attribute. + * + * @param string $waitMethod Wait URL method + */ + public function setWaitMethod($waitMethod): self { + return $this->setAttribute('waitMethod', $waitMethod); + } + + /** + * Add MaxParticipants attribute. + * + * @param int $maxParticipants Maximum number of participants + */ + public function setMaxParticipants($maxParticipants): self { + return $this->setAttribute('maxParticipants', $maxParticipants); + } + + /** + * Add Record attribute. + * + * @param string $record Record the conference + */ + public function setRecord($record): self { + return $this->setAttribute('record', $record); + } + + /** + * Add Region attribute. + * + * @param string $region Conference region + */ + public function setRegion($region): self { + return $this->setAttribute('region', $region); + } + + /** + * Add Coach attribute. + * + * @param string $coach Call coach + */ + public function setCoach($coach): self { + return $this->setAttribute('coach', $coach); + } + + /** + * Add Trim attribute. + * + * @param string $trim Trim the conference recording + */ + public function setTrim($trim): self { + return $this->setAttribute('trim', $trim); + } + + /** + * Add StatusCallbackEvent attribute. + * + * @param string[] $statusCallbackEvent Events to call status callback URL + */ + public function setStatusCallbackEvent($statusCallbackEvent): self { + return $this->setAttribute('statusCallbackEvent', $statusCallbackEvent); + } + + /** + * Add StatusCallback attribute. + * + * @param string $statusCallback Status callback URL + */ + public function setStatusCallback($statusCallback): self { + return $this->setAttribute('statusCallback', $statusCallback); + } + + /** + * Add StatusCallbackMethod attribute. + * + * @param string $statusCallbackMethod Status callback URL method + */ + public function setStatusCallbackMethod($statusCallbackMethod): self { + return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); + } + + /** + * Add RecordingStatusCallback attribute. + * + * @param string $recordingStatusCallback Recording status callback URL + */ + public function setRecordingStatusCallback($recordingStatusCallback): self { + return $this->setAttribute('recordingStatusCallback', $recordingStatusCallback); + } + + /** + * Add RecordingStatusCallbackMethod attribute. + * + * @param string $recordingStatusCallbackMethod Recording status callback URL + * method + */ + public function setRecordingStatusCallbackMethod($recordingStatusCallbackMethod): self { + return $this->setAttribute('recordingStatusCallbackMethod', $recordingStatusCallbackMethod); + } + + /** + * Add RecordingStatusCallbackEvent attribute. + * + * @param string[] $recordingStatusCallbackEvent Recording status callback + * events + */ + public function setRecordingStatusCallbackEvent($recordingStatusCallbackEvent): self { + return $this->setAttribute('recordingStatusCallbackEvent', $recordingStatusCallbackEvent); + } + + /** + * Add EventCallbackUrl attribute. + * + * @param string $eventCallbackUrl Event callback URL + */ + public function setEventCallbackUrl($eventCallbackUrl): self { + return $this->setAttribute('eventCallbackUrl', $eventCallbackUrl); + } + + /** + * Add JitterBufferSize attribute. + * + * @param string $jitterBufferSize Size of jitter buffer for participant + */ + public function setJitterBufferSize($jitterBufferSize): self { + return $this->setAttribute('jitterBufferSize', $jitterBufferSize); + } + + /** + * Add ParticipantLabel attribute. + * + * @param string $participantLabel A label for participant + */ + public function setParticipantLabel($participantLabel): self { + return $this->setAttribute('participantLabel', $participantLabel); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/Config.php b/app/api/Twilio/TwiML/Voice/Config.php new file mode 100755 index 0000000..748b10d --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/Config.php @@ -0,0 +1,41 @@ +setAttribute('name', $name); + } + + /** + * Add Value attribute. + * + * @param string $value The value of the custom config + */ + public function setValue($value): self { + return $this->setAttribute('value', $value); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/Connect.php b/app/api/Twilio/TwiML/Voice/Connect.php new file mode 100755 index 0000000..b4bca51 --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/Connect.php @@ -0,0 +1,92 @@ +nest(new Room($name, $attributes)); + } + + /** + * Add Autopilot child. + * + * @param string $name Autopilot assistant sid or unique name + * @return Autopilot Child element. + */ + public function autopilot($name): Autopilot { + return $this->nest(new Autopilot($name)); + } + + /** + * Add Stream child. + * + * @param array $attributes Optional attributes + * @return Stream Child element. + */ + public function stream($attributes = []): Stream { + return $this->nest(new Stream($attributes)); + } + + /** + * Add VirtualAgent child. + * + * @param array $attributes Optional attributes + * @return VirtualAgent Child element. + */ + public function virtualAgent($attributes = []): VirtualAgent { + return $this->nest(new VirtualAgent($attributes)); + } + + /** + * Add Conversation child. + * + * @param array $attributes Optional attributes + * @return Conversation Child element. + */ + public function conversation($attributes = []): Conversation { + return $this->nest(new Conversation($attributes)); + } + + /** + * Add Action attribute. + * + * @param string $action Action URL + */ + public function setAction($action): self { + return $this->setAttribute('action', $action); + } + + /** + * Add Method attribute. + * + * @param string $method Action URL method + */ + public function setMethod($method): self { + return $this->setAttribute('method', $method); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/Conversation.php b/app/api/Twilio/TwiML/Voice/Conversation.php new file mode 100755 index 0000000..8274ffa --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/Conversation.php @@ -0,0 +1,151 @@ +setAttribute('serviceInstanceSid', $serviceInstanceSid); + } + + /** + * Add InboundAutocreation attribute. + * + * @param bool $inboundAutocreation Inbound autocreation + */ + public function setInboundAutocreation($inboundAutocreation): self { + return $this->setAttribute('inboundAutocreation', $inboundAutocreation); + } + + /** + * Add RoutingAssignmentTimeout attribute. + * + * @param int $routingAssignmentTimeout Routing assignment timeout + */ + public function setRoutingAssignmentTimeout($routingAssignmentTimeout): self { + return $this->setAttribute('routingAssignmentTimeout', $routingAssignmentTimeout); + } + + /** + * Add InboundTimeout attribute. + * + * @param int $inboundTimeout Inbound timeout + */ + public function setInboundTimeout($inboundTimeout): self { + return $this->setAttribute('inboundTimeout', $inboundTimeout); + } + + /** + * Add Url attribute. + * + * @param string $url TwiML URL + */ + public function setUrl($url): self { + return $this->setAttribute('url', $url); + } + + /** + * Add Method attribute. + * + * @param string $method TwiML URL method + */ + public function setMethod($method): self { + return $this->setAttribute('method', $method); + } + + /** + * Add Record attribute. + * + * @param string $record Record + */ + public function setRecord($record): self { + return $this->setAttribute('record', $record); + } + + /** + * Add Trim attribute. + * + * @param string $trim Trim + */ + public function setTrim($trim): self { + return $this->setAttribute('trim', $trim); + } + + /** + * Add RecordingStatusCallback attribute. + * + * @param string $recordingStatusCallback Recording status callback URL + */ + public function setRecordingStatusCallback($recordingStatusCallback): self { + return $this->setAttribute('recordingStatusCallback', $recordingStatusCallback); + } + + /** + * Add RecordingStatusCallbackMethod attribute. + * + * @param string $recordingStatusCallbackMethod Recording status callback URL + * method + */ + public function setRecordingStatusCallbackMethod($recordingStatusCallbackMethod): self { + return $this->setAttribute('recordingStatusCallbackMethod', $recordingStatusCallbackMethod); + } + + /** + * Add RecordingStatusCallbackEvent attribute. + * + * @param string[] $recordingStatusCallbackEvent Recording status callback + * events + */ + public function setRecordingStatusCallbackEvent($recordingStatusCallbackEvent): self { + return $this->setAttribute('recordingStatusCallbackEvent', $recordingStatusCallbackEvent); + } + + /** + * Add StatusCallback attribute. + * + * @param string $statusCallback Status callback URL + */ + public function setStatusCallback($statusCallback): self { + return $this->setAttribute('statusCallback', $statusCallback); + } + + /** + * Add StatusCallbackMethod attribute. + * + * @param string $statusCallbackMethod Status callback URL method + */ + public function setStatusCallbackMethod($statusCallbackMethod): self { + return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); + } + + /** + * Add StatusCallbackEvent attribute. + * + * @param string[] $statusCallbackEvent Events to call status callback URL + */ + public function setStatusCallbackEvent($statusCallbackEvent): self { + return $this->setAttribute('statusCallbackEvent', $statusCallbackEvent); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/Dial.php b/app/api/Twilio/TwiML/Voice/Dial.php new file mode 100755 index 0000000..30bcb24 --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/Dial.php @@ -0,0 +1,262 @@ +nest(new Client($identity, $attributes)); + } + + /** + * Add Conference child. + * + * @param string $name Conference name + * @param array $attributes Optional attributes + * @return Conference Child element. + */ + public function conference($name, $attributes = []): Conference { + return $this->nest(new Conference($name, $attributes)); + } + + /** + * Add Number child. + * + * @param string $phoneNumber Phone Number to dial + * @param array $attributes Optional attributes + * @return Number Child element. + */ + public function number($phoneNumber, $attributes = []): Number { + return $this->nest(new Number($phoneNumber, $attributes)); + } + + /** + * Add Queue child. + * + * @param string $name Queue name + * @param array $attributes Optional attributes + * @return Queue Child element. + */ + public function queue($name, $attributes = []): Queue { + return $this->nest(new Queue($name, $attributes)); + } + + /** + * Add Sim child. + * + * @param string $simSid SIM SID + * @return Sim Child element. + */ + public function sim($simSid): Sim { + return $this->nest(new Sim($simSid)); + } + + /** + * Add Sip child. + * + * @param string $sipUrl SIP URL + * @param array $attributes Optional attributes + * @return Sip Child element. + */ + public function sip($sipUrl, $attributes = []): Sip { + return $this->nest(new Sip($sipUrl, $attributes)); + } + + /** + * Add Application child. + * + * @param string $applicationSid Application sid + * @param array $attributes Optional attributes + * @return Application Child element. + */ + public function application($applicationSid = null, $attributes = []): Application { + return $this->nest(new Application($applicationSid, $attributes)); + } + + /** + * Add Action attribute. + * + * @param string $action Action URL + */ + public function setAction($action): self { + return $this->setAttribute('action', $action); + } + + /** + * Add Method attribute. + * + * @param string $method Action URL method + */ + public function setMethod($method): self { + return $this->setAttribute('method', $method); + } + + /** + * Add Timeout attribute. + * + * @param int $timeout Time to wait for answer + */ + public function setTimeout($timeout): self { + return $this->setAttribute('timeout', $timeout); + } + + /** + * Add HangupOnStar attribute. + * + * @param bool $hangupOnStar Hangup call on star press + */ + public function setHangupOnStar($hangupOnStar): self { + return $this->setAttribute('hangupOnStar', $hangupOnStar); + } + + /** + * Add TimeLimit attribute. + * + * @param int $timeLimit Max time length + */ + public function setTimeLimit($timeLimit): self { + return $this->setAttribute('timeLimit', $timeLimit); + } + + /** + * Add CallerId attribute. + * + * @param string $callerId Caller ID to display + */ + public function setCallerId($callerId): self { + return $this->setAttribute('callerId', $callerId); + } + + /** + * Add Record attribute. + * + * @param string $record Record the call + */ + public function setRecord($record): self { + return $this->setAttribute('record', $record); + } + + /** + * Add Trim attribute. + * + * @param string $trim Trim the recording + */ + public function setTrim($trim): self { + return $this->setAttribute('trim', $trim); + } + + /** + * Add RecordingStatusCallback attribute. + * + * @param string $recordingStatusCallback Recording status callback URL + */ + public function setRecordingStatusCallback($recordingStatusCallback): self { + return $this->setAttribute('recordingStatusCallback', $recordingStatusCallback); + } + + /** + * Add RecordingStatusCallbackMethod attribute. + * + * @param string $recordingStatusCallbackMethod Recording status callback URL + * method + */ + public function setRecordingStatusCallbackMethod($recordingStatusCallbackMethod): self { + return $this->setAttribute('recordingStatusCallbackMethod', $recordingStatusCallbackMethod); + } + + /** + * Add RecordingStatusCallbackEvent attribute. + * + * @param string[] $recordingStatusCallbackEvent Recording status callback + * events + */ + public function setRecordingStatusCallbackEvent($recordingStatusCallbackEvent): self { + return $this->setAttribute('recordingStatusCallbackEvent', $recordingStatusCallbackEvent); + } + + /** + * Add AnswerOnBridge attribute. + * + * @param bool $answerOnBridge Preserve the ringing behavior of the inbound + * call until the Dialed call picks up + */ + public function setAnswerOnBridge($answerOnBridge): self { + return $this->setAttribute('answerOnBridge', $answerOnBridge); + } + + /** + * Add RingTone attribute. + * + * @param string $ringTone Ringtone allows you to override the ringback tone + * that Twilio will play back to the caller while + * executing the Dial + */ + public function setRingTone($ringTone): self { + return $this->setAttribute('ringTone', $ringTone); + } + + /** + * Add RecordingTrack attribute. + * + * @param string $recordingTrack To indicate which audio track should be + * recorded + */ + public function setRecordingTrack($recordingTrack): self { + return $this->setAttribute('recordingTrack', $recordingTrack); + } + + /** + * Add Sequential attribute. + * + * @param bool $sequential Used to determine if child TwiML nouns should be + * dialed in order, one after the other (sequential) or + * dial all at once (parallel). Default is false, + * parallel + */ + public function setSequential($sequential): self { + return $this->setAttribute('sequential', $sequential); + } + + /** + * Add ReferUrl attribute. + * + * @param string $referUrl Webhook that will receive future SIP REFER requests + */ + public function setReferUrl($referUrl): self { + return $this->setAttribute('referUrl', $referUrl); + } + + /** + * Add ReferMethod attribute. + * + * @param string $referMethod The HTTP method to use for the refer Webhook + */ + public function setReferMethod($referMethod): self { + return $this->setAttribute('referMethod', $referMethod); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/Echo_.php b/app/api/Twilio/TwiML/Voice/Echo_.php new file mode 100755 index 0000000..afc2cd8 --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/Echo_.php @@ -0,0 +1,21 @@ +nest(new Task($body, $attributes)); + } + + /** + * Add Action attribute. + * + * @param string $action Action URL + */ + public function setAction($action): self { + return $this->setAttribute('action', $action); + } + + /** + * Add MaxQueueSize attribute. + * + * @param int $maxQueueSize Maximum size of queue + */ + public function setMaxQueueSize($maxQueueSize): self { + return $this->setAttribute('maxQueueSize', $maxQueueSize); + } + + /** + * Add Method attribute. + * + * @param string $method Action URL method + */ + public function setMethod($method): self { + return $this->setAttribute('method', $method); + } + + /** + * Add WaitUrl attribute. + * + * @param string $waitUrl Wait URL + */ + public function setWaitUrl($waitUrl): self { + return $this->setAttribute('waitUrl', $waitUrl); + } + + /** + * Add WaitUrlMethod attribute. + * + * @param string $waitUrlMethod Wait URL method + */ + public function setWaitUrlMethod($waitUrlMethod): self { + return $this->setAttribute('waitUrlMethod', $waitUrlMethod); + } + + /** + * Add WorkflowSid attribute. + * + * @param string $workflowSid TaskRouter Workflow SID + */ + public function setWorkflowSid($workflowSid): self { + return $this->setAttribute('workflowSid', $workflowSid); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/Gather.php b/app/api/Twilio/TwiML/Voice/Gather.php new file mode 100755 index 0000000..8bd5377 --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/Gather.php @@ -0,0 +1,220 @@ +nest(new Say($message, $attributes)); + } + + /** + * Add Pause child. + * + * @param array $attributes Optional attributes + * @return Pause Child element. + */ + public function pause($attributes = []): Pause { + return $this->nest(new Pause($attributes)); + } + + /** + * Add Play child. + * + * @param string $url Media URL + * @param array $attributes Optional attributes + * @return Play Child element. + */ + public function play($url = null, $attributes = []): Play { + return $this->nest(new Play($url, $attributes)); + } + + /** + * Add Input attribute. + * + * @param string[] $input Input type Twilio should accept + */ + public function setInput($input): self { + return $this->setAttribute('input', $input); + } + + /** + * Add Action attribute. + * + * @param string $action Action URL + */ + public function setAction($action): self { + return $this->setAttribute('action', $action); + } + + /** + * Add Method attribute. + * + * @param string $method Action URL method + */ + public function setMethod($method): self { + return $this->setAttribute('method', $method); + } + + /** + * Add Timeout attribute. + * + * @param int $timeout Time to wait to gather input + */ + public function setTimeout($timeout): self { + return $this->setAttribute('timeout', $timeout); + } + + /** + * Add SpeechTimeout attribute. + * + * @param string $speechTimeout Time to wait to gather speech input and it + * should be either auto or a positive integer. + */ + public function setSpeechTimeout($speechTimeout): self { + return $this->setAttribute('speechTimeout', $speechTimeout); + } + + /** + * Add MaxSpeechTime attribute. + * + * @param int $maxSpeechTime Max allowed time for speech input + */ + public function setMaxSpeechTime($maxSpeechTime): self { + return $this->setAttribute('maxSpeechTime', $maxSpeechTime); + } + + /** + * Add ProfanityFilter attribute. + * + * @param bool $profanityFilter Profanity Filter on speech + */ + public function setProfanityFilter($profanityFilter): self { + return $this->setAttribute('profanityFilter', $profanityFilter); + } + + /** + * Add FinishOnKey attribute. + * + * @param string $finishOnKey Finish gather on key + */ + public function setFinishOnKey($finishOnKey): self { + return $this->setAttribute('finishOnKey', $finishOnKey); + } + + /** + * Add NumDigits attribute. + * + * @param int $numDigits Number of digits to collect + */ + public function setNumDigits($numDigits): self { + return $this->setAttribute('numDigits', $numDigits); + } + + /** + * Add PartialResultCallback attribute. + * + * @param string $partialResultCallback Partial result callback URL + */ + public function setPartialResultCallback($partialResultCallback): self { + return $this->setAttribute('partialResultCallback', $partialResultCallback); + } + + /** + * Add PartialResultCallbackMethod attribute. + * + * @param string $partialResultCallbackMethod Partial result callback URL method + */ + public function setPartialResultCallbackMethod($partialResultCallbackMethod): self { + return $this->setAttribute('partialResultCallbackMethod', $partialResultCallbackMethod); + } + + /** + * Add Language attribute. + * + * @param string $language Language to use + */ + public function setLanguage($language): self { + return $this->setAttribute('language', $language); + } + + /** + * Add Hints attribute. + * + * @param string $hints Speech recognition hints + */ + public function setHints($hints): self { + return $this->setAttribute('hints', $hints); + } + + /** + * Add BargeIn attribute. + * + * @param bool $bargeIn Stop playing media upon speech + */ + public function setBargeIn($bargeIn): self { + return $this->setAttribute('bargeIn', $bargeIn); + } + + /** + * Add Debug attribute. + * + * @param bool $debug Allow debug for gather + */ + public function setDebug($debug): self { + return $this->setAttribute('debug', $debug); + } + + /** + * Add ActionOnEmptyResult attribute. + * + * @param bool $actionOnEmptyResult Force webhook to the action URL event if + * there is no input + */ + public function setActionOnEmptyResult($actionOnEmptyResult): self { + return $this->setAttribute('actionOnEmptyResult', $actionOnEmptyResult); + } + + /** + * Add SpeechModel attribute. + * + * @param string $speechModel Specify the model that is best suited for your + * use case + */ + public function setSpeechModel($speechModel): self { + return $this->setAttribute('speechModel', $speechModel); + } + + /** + * Add Enhanced attribute. + * + * @param bool $enhanced Use enhanced speech model + */ + public function setEnhanced($enhanced): self { + return $this->setAttribute('enhanced', $enhanced); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/Hangup.php b/app/api/Twilio/TwiML/Voice/Hangup.php new file mode 100755 index 0000000..0e70d43 --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/Hangup.php @@ -0,0 +1,31 @@ +nest(new Parameter($attributes)); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/Identity.php b/app/api/Twilio/TwiML/Voice/Identity.php new file mode 100755 index 0000000..abf4894 --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/Identity.php @@ -0,0 +1,23 @@ +setAttribute('sendDigits', $sendDigits); + } + + /** + * Add Url attribute. + * + * @param string $url TwiML URL + */ + public function setUrl($url): self { + return $this->setAttribute('url', $url); + } + + /** + * Add Method attribute. + * + * @param string $method TwiML URL method + */ + public function setMethod($method): self { + return $this->setAttribute('method', $method); + } + + /** + * Add StatusCallbackEvent attribute. + * + * @param string[] $statusCallbackEvent Events to call status callback + */ + public function setStatusCallbackEvent($statusCallbackEvent): self { + return $this->setAttribute('statusCallbackEvent', $statusCallbackEvent); + } + + /** + * Add StatusCallback attribute. + * + * @param string $statusCallback Status callback URL + */ + public function setStatusCallback($statusCallback): self { + return $this->setAttribute('statusCallback', $statusCallback); + } + + /** + * Add StatusCallbackMethod attribute. + * + * @param string $statusCallbackMethod Status callback URL method + */ + public function setStatusCallbackMethod($statusCallbackMethod): self { + return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); + } + + /** + * Add Byoc attribute. + * + * @param string $byoc BYOC trunk SID (Beta) + */ + public function setByoc($byoc): self { + return $this->setAttribute('byoc', $byoc); + } + + /** + * Add MachineDetection attribute. + * + * @param string $machineDetection Enable machine detection or end of greeting + * detection + */ + public function setMachineDetection($machineDetection): self { + return $this->setAttribute('machineDetection', $machineDetection); + } + + /** + * Add AmdStatusCallbackMethod attribute. + * + * @param string $amdStatusCallbackMethod HTTP Method to use with + * amd_status_callback + */ + public function setAmdStatusCallbackMethod($amdStatusCallbackMethod): self { + return $this->setAttribute('amdStatusCallbackMethod', $amdStatusCallbackMethod); + } + + /** + * Add AmdStatusCallback attribute. + * + * @param string $amdStatusCallback The URL we should call to send amd status + * information to your application + */ + public function setAmdStatusCallback($amdStatusCallback): self { + return $this->setAttribute('amdStatusCallback', $amdStatusCallback); + } + + /** + * Add MachineDetectionTimeout attribute. + * + * @param int $machineDetectionTimeout Number of seconds to wait for machine + * detection + */ + public function setMachineDetectionTimeout($machineDetectionTimeout): self { + return $this->setAttribute('machineDetectionTimeout', $machineDetectionTimeout); + } + + /** + * Add MachineDetectionSpeechThreshold attribute. + * + * @param int $machineDetectionSpeechThreshold Number of milliseconds for + * measuring stick for the length + * of the speech activity + */ + public function setMachineDetectionSpeechThreshold($machineDetectionSpeechThreshold): self { + return $this->setAttribute('machineDetectionSpeechThreshold', $machineDetectionSpeechThreshold); + } + + /** + * Add MachineDetectionSpeechEndThreshold attribute. + * + * @param int $machineDetectionSpeechEndThreshold Number of milliseconds of + * silence after speech activity + */ + public function setMachineDetectionSpeechEndThreshold($machineDetectionSpeechEndThreshold): self { + return $this->setAttribute('machineDetectionSpeechEndThreshold', $machineDetectionSpeechEndThreshold); + } + + /** + * Add MachineDetectionSilenceTimeout attribute. + * + * @param int $machineDetectionSilenceTimeout Number of milliseconds of initial + * silence + */ + public function setMachineDetectionSilenceTimeout($machineDetectionSilenceTimeout): self { + return $this->setAttribute('machineDetectionSilenceTimeout', $machineDetectionSilenceTimeout); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/Parameter.php b/app/api/Twilio/TwiML/Voice/Parameter.php new file mode 100755 index 0000000..6798ba9 --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/Parameter.php @@ -0,0 +1,41 @@ +setAttribute('name', $name); + } + + /** + * Add Value attribute. + * + * @param string $value The value of the custom parameter + */ + public function setValue($value): self { + return $this->setAttribute('value', $value); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/Pause.php b/app/api/Twilio/TwiML/Voice/Pause.php new file mode 100755 index 0000000..3716a75 --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/Pause.php @@ -0,0 +1,32 @@ +setAttribute('length', $length); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/Pay.php b/app/api/Twilio/TwiML/Voice/Pay.php new file mode 100755 index 0000000..eb38b17 --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/Pay.php @@ -0,0 +1,212 @@ +nest(new Prompt($attributes)); + } + + /** + * Add Parameter child. + * + * @param array $attributes Optional attributes + * @return Parameter Child element. + */ + public function parameter($attributes = []): Parameter { + return $this->nest(new Parameter($attributes)); + } + + /** + * Add Input attribute. + * + * @param string $input Input type Twilio should accept + */ + public function setInput($input): self { + return $this->setAttribute('input', $input); + } + + /** + * Add Action attribute. + * + * @param string $action Action URL + */ + public function setAction($action): self { + return $this->setAttribute('action', $action); + } + + /** + * Add BankAccountType attribute. + * + * @param string $bankAccountType Bank account type for ach transactions. If + * set, payment method attribute must be + * provided and value should be set to + * ach-debit. defaults to consumer-checking + */ + public function setBankAccountType($bankAccountType): self { + return $this->setAttribute('bankAccountType', $bankAccountType); + } + + /** + * Add StatusCallback attribute. + * + * @param string $statusCallback Status callback URL + */ + public function setStatusCallback($statusCallback): self { + return $this->setAttribute('statusCallback', $statusCallback); + } + + /** + * Add StatusCallbackMethod attribute. + * + * @param string $statusCallbackMethod Status callback method + */ + public function setStatusCallbackMethod($statusCallbackMethod): self { + return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); + } + + /** + * Add Timeout attribute. + * + * @param int $timeout Time to wait to gather input + */ + public function setTimeout($timeout): self { + return $this->setAttribute('timeout', $timeout); + } + + /** + * Add MaxAttempts attribute. + * + * @param int $maxAttempts Maximum number of allowed retries when gathering + * input + */ + public function setMaxAttempts($maxAttempts): self { + return $this->setAttribute('maxAttempts', $maxAttempts); + } + + /** + * Add SecurityCode attribute. + * + * @param bool $securityCode Prompt for security code + */ + public function setSecurityCode($securityCode): self { + return $this->setAttribute('securityCode', $securityCode); + } + + /** + * Add PostalCode attribute. + * + * @param string $postalCode Prompt for postal code and it should be true/false + * or default postal code + */ + public function setPostalCode($postalCode): self { + return $this->setAttribute('postalCode', $postalCode); + } + + /** + * Add MinPostalCodeLength attribute. + * + * @param int $minPostalCodeLength Prompt for minimum postal code length + */ + public function setMinPostalCodeLength($minPostalCodeLength): self { + return $this->setAttribute('minPostalCodeLength', $minPostalCodeLength); + } + + /** + * Add PaymentConnector attribute. + * + * @param string $paymentConnector Unique name for payment connector + */ + public function setPaymentConnector($paymentConnector): self { + return $this->setAttribute('paymentConnector', $paymentConnector); + } + + /** + * Add PaymentMethod attribute. + * + * @param string $paymentMethod Payment method to be used. defaults to + * credit-card + */ + public function setPaymentMethod($paymentMethod): self { + return $this->setAttribute('paymentMethod', $paymentMethod); + } + + /** + * Add TokenType attribute. + * + * @param string $tokenType Type of token + */ + public function setTokenType($tokenType): self { + return $this->setAttribute('tokenType', $tokenType); + } + + /** + * Add ChargeAmount attribute. + * + * @param string $chargeAmount Amount to process. If value is greater than 0 + * then make the payment else create a payment token + */ + public function setChargeAmount($chargeAmount): self { + return $this->setAttribute('chargeAmount', $chargeAmount); + } + + /** + * Add Currency attribute. + * + * @param string $currency Currency of the amount attribute + */ + public function setCurrency($currency): self { + return $this->setAttribute('currency', $currency); + } + + /** + * Add Description attribute. + * + * @param string $description Details regarding the payment + */ + public function setDescription($description): self { + return $this->setAttribute('description', $description); + } + + /** + * Add ValidCardTypes attribute. + * + * @param string[] $validCardTypes Comma separated accepted card types + */ + public function setValidCardTypes($validCardTypes): self { + return $this->setAttribute('validCardTypes', $validCardTypes); + } + + /** + * Add Language attribute. + * + * @param string $language Language to use + */ + public function setLanguage($language): self { + return $this->setAttribute('language', $language); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/Play.php b/app/api/Twilio/TwiML/Voice/Play.php new file mode 100755 index 0000000..a3e574e --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/Play.php @@ -0,0 +1,42 @@ +setAttribute('loop', $loop); + } + + /** + * Add Digits attribute. + * + * @param string $digits Play DTMF tones for digits + */ + public function setDigits($digits): self { + return $this->setAttribute('digits', $digits); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/Prompt.php b/app/api/Twilio/TwiML/Voice/Prompt.php new file mode 100755 index 0000000..64f4700 --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/Prompt.php @@ -0,0 +1,101 @@ +nest(new Say($message, $attributes)); + } + + /** + * Add Play child. + * + * @param string $url Media URL + * @param array $attributes Optional attributes + * @return Play Child element. + */ + public function play($url = null, $attributes = []): Play { + return $this->nest(new Play($url, $attributes)); + } + + /** + * Add Pause child. + * + * @param array $attributes Optional attributes + * @return Pause Child element. + */ + public function pause($attributes = []): Pause { + return $this->nest(new Pause($attributes)); + } + + /** + * Add For_ attribute. + * + * @param string $for_ Name of the payment source data element + */ + public function setFor_($for_): self { + return $this->setAttribute('for_', $for_); + } + + /** + * Add ErrorType attribute. + * + * @param string[] $errorType Type of error + */ + public function setErrorType($errorType): self { + return $this->setAttribute('errorType', $errorType); + } + + /** + * Add CardType attribute. + * + * @param string[] $cardType Type of the credit card + */ + public function setCardType($cardType): self { + return $this->setAttribute('cardType', $cardType); + } + + /** + * Add Attempt attribute. + * + * @param int[] $attempt Current attempt count + */ + public function setAttempt($attempt): self { + return $this->setAttribute('attempt', $attempt); + } + + /** + * Add RequireMatchingInputs attribute. + * + * @param bool $requireMatchingInputs Require customer to input requested + * information twice and verify matching. + */ + public function setRequireMatchingInputs($requireMatchingInputs): self { + return $this->setAttribute('requireMatchingInputs', $requireMatchingInputs); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/Queue.php b/app/api/Twilio/TwiML/Voice/Queue.php new file mode 100755 index 0000000..f8c1487 --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/Queue.php @@ -0,0 +1,60 @@ +setAttribute('url', $url); + } + + /** + * Add Method attribute. + * + * @param string $method Action URL method + */ + public function setMethod($method): self { + return $this->setAttribute('method', $method); + } + + /** + * Add ReservationSid attribute. + * + * @param string $reservationSid TaskRouter Reservation SID + */ + public function setReservationSid($reservationSid): self { + return $this->setAttribute('reservationSid', $reservationSid); + } + + /** + * Add PostWorkActivitySid attribute. + * + * @param string $postWorkActivitySid TaskRouter Activity SID + */ + public function setPostWorkActivitySid($postWorkActivitySid): self { + return $this->setAttribute('postWorkActivitySid', $postWorkActivitySid); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/Record.php b/app/api/Twilio/TwiML/Voice/Record.php new file mode 100755 index 0000000..3cf7a15 --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/Record.php @@ -0,0 +1,132 @@ +setAttribute('action', $action); + } + + /** + * Add Method attribute. + * + * @param string $method Action URL method + */ + public function setMethod($method): self { + return $this->setAttribute('method', $method); + } + + /** + * Add Timeout attribute. + * + * @param int $timeout Timeout to begin recording + */ + public function setTimeout($timeout): self { + return $this->setAttribute('timeout', $timeout); + } + + /** + * Add FinishOnKey attribute. + * + * @param string $finishOnKey Finish recording on key + */ + public function setFinishOnKey($finishOnKey): self { + return $this->setAttribute('finishOnKey', $finishOnKey); + } + + /** + * Add MaxLength attribute. + * + * @param int $maxLength Max time to record in seconds + */ + public function setMaxLength($maxLength): self { + return $this->setAttribute('maxLength', $maxLength); + } + + /** + * Add PlayBeep attribute. + * + * @param bool $playBeep Play beep + */ + public function setPlayBeep($playBeep): self { + return $this->setAttribute('playBeep', $playBeep); + } + + /** + * Add Trim attribute. + * + * @param string $trim Trim the recording + */ + public function setTrim($trim): self { + return $this->setAttribute('trim', $trim); + } + + /** + * Add RecordingStatusCallback attribute. + * + * @param string $recordingStatusCallback Status callback URL + */ + public function setRecordingStatusCallback($recordingStatusCallback): self { + return $this->setAttribute('recordingStatusCallback', $recordingStatusCallback); + } + + /** + * Add RecordingStatusCallbackMethod attribute. + * + * @param string $recordingStatusCallbackMethod Status callback URL method + */ + public function setRecordingStatusCallbackMethod($recordingStatusCallbackMethod): self { + return $this->setAttribute('recordingStatusCallbackMethod', $recordingStatusCallbackMethod); + } + + /** + * Add RecordingStatusCallbackEvent attribute. + * + * @param string[] $recordingStatusCallbackEvent Recording status callback + * events + */ + public function setRecordingStatusCallbackEvent($recordingStatusCallbackEvent): self { + return $this->setAttribute('recordingStatusCallbackEvent', $recordingStatusCallbackEvent); + } + + /** + * Add Transcribe attribute. + * + * @param bool $transcribe Transcribe the recording + */ + public function setTranscribe($transcribe): self { + return $this->setAttribute('transcribe', $transcribe); + } + + /** + * Add TranscribeCallback attribute. + * + * @param string $transcribeCallback Transcribe callback URL + */ + public function setTranscribeCallback($transcribeCallback): self { + return $this->setAttribute('transcribeCallback', $transcribeCallback); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/Redirect.php b/app/api/Twilio/TwiML/Voice/Redirect.php new file mode 100755 index 0000000..1a51581 --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/Redirect.php @@ -0,0 +1,33 @@ +setAttribute('method', $method); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/Refer.php b/app/api/Twilio/TwiML/Voice/Refer.php new file mode 100755 index 0000000..fe787e7 --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/Refer.php @@ -0,0 +1,51 @@ +nest(new ReferSip($sipUrl)); + } + + /** + * Add Action attribute. + * + * @param string $action Action URL + */ + public function setAction($action): self { + return $this->setAttribute('action', $action); + } + + /** + * Add Method attribute. + * + * @param string $method Action URL method + */ + public function setMethod($method): self { + return $this->setAttribute('method', $method); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/ReferSip.php b/app/api/Twilio/TwiML/Voice/ReferSip.php new file mode 100755 index 0000000..100c713 --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/ReferSip.php @@ -0,0 +1,23 @@ +nest(new Parameter($attributes)); + } + + /** + * Add Reason attribute. + * + * @param string $reason Rejection reason + */ + public function setReason($reason): self { + return $this->setAttribute('reason', $reason); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/Room.php b/app/api/Twilio/TwiML/Voice/Room.php new file mode 100755 index 0000000..1cc28c6 --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/Room.php @@ -0,0 +1,34 @@ +setAttribute('participantIdentity', $participantIdentity); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/Say.php b/app/api/Twilio/TwiML/Voice/Say.php new file mode 100755 index 0000000..626ab73 --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/Say.php @@ -0,0 +1,158 @@ +nest(new SsmlBreak($attributes)); + } + + /** + * Add Emphasis child. + * + * @param string $words Words to emphasize + * @param array $attributes Optional attributes + * @return SsmlEmphasis Child element. + */ + public function emphasis($words, $attributes = []): SsmlEmphasis { + return $this->nest(new SsmlEmphasis($words, $attributes)); + } + + /** + * Add Lang child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlLang Child element. + */ + public function lang($words, $attributes = []): SsmlLang { + return $this->nest(new SsmlLang($words, $attributes)); + } + + /** + * Add P child. + * + * @param string $words Words to speak + * @return SsmlP Child element. + */ + public function p($words): SsmlP { + return $this->nest(new SsmlP($words)); + } + + /** + * Add Phoneme child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlPhoneme Child element. + */ + public function phoneme($words, $attributes = []): SsmlPhoneme { + return $this->nest(new SsmlPhoneme($words, $attributes)); + } + + /** + * Add Prosody child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlProsody Child element. + */ + public function prosody($words, $attributes = []): SsmlProsody { + return $this->nest(new SsmlProsody($words, $attributes)); + } + + /** + * Add S child. + * + * @param string $words Words to speak + * @return SsmlS Child element. + */ + public function s($words): SsmlS { + return $this->nest(new SsmlS($words)); + } + + /** + * Add Say-As child. + * + * @param string $words Words to be interpreted + * @param array $attributes Optional attributes + * @return SsmlSayAs Child element. + */ + public function say_As($words, $attributes = []): SsmlSayAs { + return $this->nest(new SsmlSayAs($words, $attributes)); + } + + /** + * Add Sub child. + * + * @param string $words Words to be substituted + * @param array $attributes Optional attributes + * @return SsmlSub Child element. + */ + public function sub($words, $attributes = []): SsmlSub { + return $this->nest(new SsmlSub($words, $attributes)); + } + + /** + * Add W child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlW Child element. + */ + public function w($words, $attributes = []): SsmlW { + return $this->nest(new SsmlW($words, $attributes)); + } + + /** + * Add Voice attribute. + * + * @param string $voice Voice to use + */ + public function setVoice($voice): self { + return $this->setAttribute('voice', $voice); + } + + /** + * Add Loop attribute. + * + * @param int $loop Times to loop message + */ + public function setLoop($loop): self { + return $this->setAttribute('loop', $loop); + } + + /** + * Add Language attribute. + * + * @param string $language Message language + */ + public function setLanguage($language): self { + return $this->setAttribute('language', $language); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/Sim.php b/app/api/Twilio/TwiML/Voice/Sim.php new file mode 100755 index 0000000..3ca305a --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/Sim.php @@ -0,0 +1,23 @@ +setAttribute('username', $username); + } + + /** + * Add Password attribute. + * + * @param string $password SIP Password + */ + public function setPassword($password): self { + return $this->setAttribute('password', $password); + } + + /** + * Add Url attribute. + * + * @param string $url Action URL + */ + public function setUrl($url): self { + return $this->setAttribute('url', $url); + } + + /** + * Add Method attribute. + * + * @param string $method Action URL method + */ + public function setMethod($method): self { + return $this->setAttribute('method', $method); + } + + /** + * Add StatusCallbackEvent attribute. + * + * @param string[] $statusCallbackEvent Status callback events + */ + public function setStatusCallbackEvent($statusCallbackEvent): self { + return $this->setAttribute('statusCallbackEvent', $statusCallbackEvent); + } + + /** + * Add StatusCallback attribute. + * + * @param string $statusCallback Status callback URL + */ + public function setStatusCallback($statusCallback): self { + return $this->setAttribute('statusCallback', $statusCallback); + } + + /** + * Add StatusCallbackMethod attribute. + * + * @param string $statusCallbackMethod Status callback URL method + */ + public function setStatusCallbackMethod($statusCallbackMethod): self { + return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); + } + + /** + * Add MachineDetection attribute. + * + * @param string $machineDetection Enable machine detection or end of greeting + * detection + */ + public function setMachineDetection($machineDetection): self { + return $this->setAttribute('machineDetection', $machineDetection); + } + + /** + * Add AmdStatusCallbackMethod attribute. + * + * @param string $amdStatusCallbackMethod HTTP Method to use with + * amd_status_callback + */ + public function setAmdStatusCallbackMethod($amdStatusCallbackMethod): self { + return $this->setAttribute('amdStatusCallbackMethod', $amdStatusCallbackMethod); + } + + /** + * Add AmdStatusCallback attribute. + * + * @param string $amdStatusCallback The URL we should call to send amd status + * information to your application + */ + public function setAmdStatusCallback($amdStatusCallback): self { + return $this->setAttribute('amdStatusCallback', $amdStatusCallback); + } + + /** + * Add MachineDetectionTimeout attribute. + * + * @param int $machineDetectionTimeout Number of seconds to wait for machine + * detection + */ + public function setMachineDetectionTimeout($machineDetectionTimeout): self { + return $this->setAttribute('machineDetectionTimeout', $machineDetectionTimeout); + } + + /** + * Add MachineDetectionSpeechThreshold attribute. + * + * @param int $machineDetectionSpeechThreshold Number of milliseconds for + * measuring stick for the length + * of the speech activity + */ + public function setMachineDetectionSpeechThreshold($machineDetectionSpeechThreshold): self { + return $this->setAttribute('machineDetectionSpeechThreshold', $machineDetectionSpeechThreshold); + } + + /** + * Add MachineDetectionSpeechEndThreshold attribute. + * + * @param int $machineDetectionSpeechEndThreshold Number of milliseconds of + * silence after speech activity + */ + public function setMachineDetectionSpeechEndThreshold($machineDetectionSpeechEndThreshold): self { + return $this->setAttribute('machineDetectionSpeechEndThreshold', $machineDetectionSpeechEndThreshold); + } + + /** + * Add MachineDetectionSilenceTimeout attribute. + * + * @param int $machineDetectionSilenceTimeout Number of milliseconds of initial + * silence + */ + public function setMachineDetectionSilenceTimeout($machineDetectionSilenceTimeout): self { + return $this->setAttribute('machineDetectionSilenceTimeout', $machineDetectionSilenceTimeout); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/Siprec.php b/app/api/Twilio/TwiML/Voice/Siprec.php new file mode 100755 index 0000000..6cecb5e --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/Siprec.php @@ -0,0 +1,60 @@ +nest(new Parameter($attributes)); + } + + /** + * Add Name attribute. + * + * @param string $name Friendly name given to SIPREC + */ + public function setName($name): self { + return $this->setAttribute('name', $name); + } + + /** + * Add ConnectorName attribute. + * + * @param string $connectorName Unique name for Connector + */ + public function setConnectorName($connectorName): self { + return $this->setAttribute('connectorName', $connectorName); + } + + /** + * Add Track attribute. + * + * @param string $track Track to be streamed to remote service + */ + public function setTrack($track): self { + return $this->setAttribute('track', $track); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/Sms.php b/app/api/Twilio/TwiML/Voice/Sms.php new file mode 100755 index 0000000..b08a4ca --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/Sms.php @@ -0,0 +1,69 @@ +setAttribute('to', $to); + } + + /** + * Add From attribute. + * + * @param string $from Number to send message from + */ + public function setFrom($from): self { + return $this->setAttribute('from', $from); + } + + /** + * Add Action attribute. + * + * @param string $action Action URL + */ + public function setAction($action): self { + return $this->setAttribute('action', $action); + } + + /** + * Add Method attribute. + * + * @param string $method Action URL method + */ + public function setMethod($method): self { + return $this->setAttribute('method', $method); + } + + /** + * Add StatusCallback attribute. + * + * @param string $statusCallback Status callback URL + */ + public function setStatusCallback($statusCallback): self { + return $this->setAttribute('statusCallback', $statusCallback); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/SsmlBreak.php b/app/api/Twilio/TwiML/Voice/SsmlBreak.php new file mode 100755 index 0000000..670849d --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/SsmlBreak.php @@ -0,0 +1,42 @@ +setAttribute('strength', $strength); + } + + /** + * Add Time attribute. + * + * @param string $time Set a pause to a specific length of time in seconds or + * milliseconds, available values: [number]s, [number]ms + */ + public function setTime($time): self { + return $this->setAttribute('time', $time); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/SsmlEmphasis.php b/app/api/Twilio/TwiML/Voice/SsmlEmphasis.php new file mode 100755 index 0000000..3bb90b1 --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/SsmlEmphasis.php @@ -0,0 +1,120 @@ +nest(new SsmlBreak($attributes)); + } + + /** + * Add Emphasis child. + * + * @param string $words Words to emphasize + * @param array $attributes Optional attributes + * @return SsmlEmphasis Child element. + */ + public function emphasis($words, $attributes = []): SsmlEmphasis { + return $this->nest(new SsmlEmphasis($words, $attributes)); + } + + /** + * Add Lang child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlLang Child element. + */ + public function lang($words, $attributes = []): SsmlLang { + return $this->nest(new SsmlLang($words, $attributes)); + } + + /** + * Add Phoneme child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlPhoneme Child element. + */ + public function phoneme($words, $attributes = []): SsmlPhoneme { + return $this->nest(new SsmlPhoneme($words, $attributes)); + } + + /** + * Add Prosody child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlProsody Child element. + */ + public function prosody($words, $attributes = []): SsmlProsody { + return $this->nest(new SsmlProsody($words, $attributes)); + } + + /** + * Add Say-As child. + * + * @param string $words Words to be interpreted + * @param array $attributes Optional attributes + * @return SsmlSayAs Child element. + */ + public function say_As($words, $attributes = []): SsmlSayAs { + return $this->nest(new SsmlSayAs($words, $attributes)); + } + + /** + * Add Sub child. + * + * @param string $words Words to be substituted + * @param array $attributes Optional attributes + * @return SsmlSub Child element. + */ + public function sub($words, $attributes = []): SsmlSub { + return $this->nest(new SsmlSub($words, $attributes)); + } + + /** + * Add W child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlW Child element. + */ + public function w($words, $attributes = []): SsmlW { + return $this->nest(new SsmlW($words, $attributes)); + } + + /** + * Add Level attribute. + * + * @param string $level Specify the degree of emphasis + */ + public function setLevel($level): self { + return $this->setAttribute('level', $level); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/SsmlLang.php b/app/api/Twilio/TwiML/Voice/SsmlLang.php new file mode 100755 index 0000000..9f234e0 --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/SsmlLang.php @@ -0,0 +1,140 @@ +nest(new SsmlBreak($attributes)); + } + + /** + * Add Emphasis child. + * + * @param string $words Words to emphasize + * @param array $attributes Optional attributes + * @return SsmlEmphasis Child element. + */ + public function emphasis($words, $attributes = []): SsmlEmphasis { + return $this->nest(new SsmlEmphasis($words, $attributes)); + } + + /** + * Add Lang child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlLang Child element. + */ + public function lang($words, $attributes = []): SsmlLang { + return $this->nest(new SsmlLang($words, $attributes)); + } + + /** + * Add P child. + * + * @param string $words Words to speak + * @return SsmlP Child element. + */ + public function p($words): SsmlP { + return $this->nest(new SsmlP($words)); + } + + /** + * Add Phoneme child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlPhoneme Child element. + */ + public function phoneme($words, $attributes = []): SsmlPhoneme { + return $this->nest(new SsmlPhoneme($words, $attributes)); + } + + /** + * Add Prosody child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlProsody Child element. + */ + public function prosody($words, $attributes = []): SsmlProsody { + return $this->nest(new SsmlProsody($words, $attributes)); + } + + /** + * Add S child. + * + * @param string $words Words to speak + * @return SsmlS Child element. + */ + public function s($words): SsmlS { + return $this->nest(new SsmlS($words)); + } + + /** + * Add Say-As child. + * + * @param string $words Words to be interpreted + * @param array $attributes Optional attributes + * @return SsmlSayAs Child element. + */ + public function say_As($words, $attributes = []): SsmlSayAs { + return $this->nest(new SsmlSayAs($words, $attributes)); + } + + /** + * Add Sub child. + * + * @param string $words Words to be substituted + * @param array $attributes Optional attributes + * @return SsmlSub Child element. + */ + public function sub($words, $attributes = []): SsmlSub { + return $this->nest(new SsmlSub($words, $attributes)); + } + + /** + * Add W child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlW Child element. + */ + public function w($words, $attributes = []): SsmlW { + return $this->nest(new SsmlW($words, $attributes)); + } + + /** + * Add Xml:Lang attribute. + * + * @param string $xmlLang Specify the language + */ + public function setXmlLang($xmlLang): self { + return $this->setAttribute('xml:Lang', $xmlLang); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/SsmlP.php b/app/api/Twilio/TwiML/Voice/SsmlP.php new file mode 100755 index 0000000..a3bc731 --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/SsmlP.php @@ -0,0 +1,120 @@ +nest(new SsmlBreak($attributes)); + } + + /** + * Add Emphasis child. + * + * @param string $words Words to emphasize + * @param array $attributes Optional attributes + * @return SsmlEmphasis Child element. + */ + public function emphasis($words, $attributes = []): SsmlEmphasis { + return $this->nest(new SsmlEmphasis($words, $attributes)); + } + + /** + * Add Lang child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlLang Child element. + */ + public function lang($words, $attributes = []): SsmlLang { + return $this->nest(new SsmlLang($words, $attributes)); + } + + /** + * Add Phoneme child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlPhoneme Child element. + */ + public function phoneme($words, $attributes = []): SsmlPhoneme { + return $this->nest(new SsmlPhoneme($words, $attributes)); + } + + /** + * Add Prosody child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlProsody Child element. + */ + public function prosody($words, $attributes = []): SsmlProsody { + return $this->nest(new SsmlProsody($words, $attributes)); + } + + /** + * Add S child. + * + * @param string $words Words to speak + * @return SsmlS Child element. + */ + public function s($words): SsmlS { + return $this->nest(new SsmlS($words)); + } + + /** + * Add Say-As child. + * + * @param string $words Words to be interpreted + * @param array $attributes Optional attributes + * @return SsmlSayAs Child element. + */ + public function say_As($words, $attributes = []): SsmlSayAs { + return $this->nest(new SsmlSayAs($words, $attributes)); + } + + /** + * Add Sub child. + * + * @param string $words Words to be substituted + * @param array $attributes Optional attributes + * @return SsmlSub Child element. + */ + public function sub($words, $attributes = []): SsmlSub { + return $this->nest(new SsmlSub($words, $attributes)); + } + + /** + * Add W child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlW Child element. + */ + public function w($words, $attributes = []): SsmlW { + return $this->nest(new SsmlW($words, $attributes)); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/SsmlPhoneme.php b/app/api/Twilio/TwiML/Voice/SsmlPhoneme.php new file mode 100755 index 0000000..54798f4 --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/SsmlPhoneme.php @@ -0,0 +1,42 @@ +setAttribute('alphabet', $alphabet); + } + + /** + * Add Ph attribute. + * + * @param string $ph Specifiy the phonetic symbols for pronunciation + */ + public function setPh($ph): self { + return $this->setAttribute('ph', $ph); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/SsmlProsody.php b/app/api/Twilio/TwiML/Voice/SsmlProsody.php new file mode 100755 index 0000000..b6f2817 --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/SsmlProsody.php @@ -0,0 +1,161 @@ +nest(new SsmlBreak($attributes)); + } + + /** + * Add Emphasis child. + * + * @param string $words Words to emphasize + * @param array $attributes Optional attributes + * @return SsmlEmphasis Child element. + */ + public function emphasis($words, $attributes = []): SsmlEmphasis { + return $this->nest(new SsmlEmphasis($words, $attributes)); + } + + /** + * Add Lang child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlLang Child element. + */ + public function lang($words, $attributes = []): SsmlLang { + return $this->nest(new SsmlLang($words, $attributes)); + } + + /** + * Add P child. + * + * @param string $words Words to speak + * @return SsmlP Child element. + */ + public function p($words): SsmlP { + return $this->nest(new SsmlP($words)); + } + + /** + * Add Phoneme child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlPhoneme Child element. + */ + public function phoneme($words, $attributes = []): SsmlPhoneme { + return $this->nest(new SsmlPhoneme($words, $attributes)); + } + + /** + * Add Prosody child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlProsody Child element. + */ + public function prosody($words, $attributes = []): SsmlProsody { + return $this->nest(new SsmlProsody($words, $attributes)); + } + + /** + * Add S child. + * + * @param string $words Words to speak + * @return SsmlS Child element. + */ + public function s($words): SsmlS { + return $this->nest(new SsmlS($words)); + } + + /** + * Add Say-As child. + * + * @param string $words Words to be interpreted + * @param array $attributes Optional attributes + * @return SsmlSayAs Child element. + */ + public function say_As($words, $attributes = []): SsmlSayAs { + return $this->nest(new SsmlSayAs($words, $attributes)); + } + + /** + * Add Sub child. + * + * @param string $words Words to be substituted + * @param array $attributes Optional attributes + * @return SsmlSub Child element. + */ + public function sub($words, $attributes = []): SsmlSub { + return $this->nest(new SsmlSub($words, $attributes)); + } + + /** + * Add W child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlW Child element. + */ + public function w($words, $attributes = []): SsmlW { + return $this->nest(new SsmlW($words, $attributes)); + } + + /** + * Add Volume attribute. + * + * @param string $volume Specify the volume, available values: default, silent, + * x-soft, soft, medium, loud, x-loud, +ndB, -ndB + */ + public function setVolume($volume): self { + return $this->setAttribute('volume', $volume); + } + + /** + * Add Rate attribute. + * + * @param string $rate Specify the rate, available values: x-slow, slow, + * medium, fast, x-fast, n% + */ + public function setRate($rate): self { + return $this->setAttribute('rate', $rate); + } + + /** + * Add Pitch attribute. + * + * @param string $pitch Specify the pitch, available values: default, x-low, + * low, medium, high, x-high, +n%, -n% + */ + public function setPitch($pitch): self { + return $this->setAttribute('pitch', $pitch); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/SsmlS.php b/app/api/Twilio/TwiML/Voice/SsmlS.php new file mode 100755 index 0000000..9d8f41f --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/SsmlS.php @@ -0,0 +1,110 @@ +nest(new SsmlBreak($attributes)); + } + + /** + * Add Emphasis child. + * + * @param string $words Words to emphasize + * @param array $attributes Optional attributes + * @return SsmlEmphasis Child element. + */ + public function emphasis($words, $attributes = []): SsmlEmphasis { + return $this->nest(new SsmlEmphasis($words, $attributes)); + } + + /** + * Add Lang child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlLang Child element. + */ + public function lang($words, $attributes = []): SsmlLang { + return $this->nest(new SsmlLang($words, $attributes)); + } + + /** + * Add Phoneme child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlPhoneme Child element. + */ + public function phoneme($words, $attributes = []): SsmlPhoneme { + return $this->nest(new SsmlPhoneme($words, $attributes)); + } + + /** + * Add Prosody child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlProsody Child element. + */ + public function prosody($words, $attributes = []): SsmlProsody { + return $this->nest(new SsmlProsody($words, $attributes)); + } + + /** + * Add Say-As child. + * + * @param string $words Words to be interpreted + * @param array $attributes Optional attributes + * @return SsmlSayAs Child element. + */ + public function say_As($words, $attributes = []): SsmlSayAs { + return $this->nest(new SsmlSayAs($words, $attributes)); + } + + /** + * Add Sub child. + * + * @param string $words Words to be substituted + * @param array $attributes Optional attributes + * @return SsmlSub Child element. + */ + public function sub($words, $attributes = []): SsmlSub { + return $this->nest(new SsmlSub($words, $attributes)); + } + + /** + * Add W child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlW Child element. + */ + public function w($words, $attributes = []): SsmlW { + return $this->nest(new SsmlW($words, $attributes)); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/SsmlSayAs.php b/app/api/Twilio/TwiML/Voice/SsmlSayAs.php new file mode 100755 index 0000000..44be26e --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/SsmlSayAs.php @@ -0,0 +1,43 @@ +setAttribute('interpret-as', $interpretAs); + } + + /** + * Add Format attribute. + * + * @param string $format Specify the format of the date when interpret-as is + * set to date + */ + public function setFormat($format): self { + return $this->setAttribute('format', $format); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/SsmlSub.php b/app/api/Twilio/TwiML/Voice/SsmlSub.php new file mode 100755 index 0000000..b4fc5aa --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/SsmlSub.php @@ -0,0 +1,34 @@ +setAttribute('alias', $alias); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/SsmlW.php b/app/api/Twilio/TwiML/Voice/SsmlW.php new file mode 100755 index 0000000..b4bca69 --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/SsmlW.php @@ -0,0 +1,99 @@ +nest(new SsmlBreak($attributes)); + } + + /** + * Add Emphasis child. + * + * @param string $words Words to emphasize + * @param array $attributes Optional attributes + * @return SsmlEmphasis Child element. + */ + public function emphasis($words, $attributes = []): SsmlEmphasis { + return $this->nest(new SsmlEmphasis($words, $attributes)); + } + + /** + * Add Phoneme child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlPhoneme Child element. + */ + public function phoneme($words, $attributes = []): SsmlPhoneme { + return $this->nest(new SsmlPhoneme($words, $attributes)); + } + + /** + * Add Prosody child. + * + * @param string $words Words to speak + * @param array $attributes Optional attributes + * @return SsmlProsody Child element. + */ + public function prosody($words, $attributes = []): SsmlProsody { + return $this->nest(new SsmlProsody($words, $attributes)); + } + + /** + * Add Say-As child. + * + * @param string $words Words to be interpreted + * @param array $attributes Optional attributes + * @return SsmlSayAs Child element. + */ + public function say_As($words, $attributes = []): SsmlSayAs { + return $this->nest(new SsmlSayAs($words, $attributes)); + } + + /** + * Add Sub child. + * + * @param string $words Words to be substituted + * @param array $attributes Optional attributes + * @return SsmlSub Child element. + */ + public function sub($words, $attributes = []): SsmlSub { + return $this->nest(new SsmlSub($words, $attributes)); + } + + /** + * Add Role attribute. + * + * @param string $role Customize the pronunciation of words by specifying the + * word’s part of speech or alternate meaning + */ + public function setRole($role): self { + return $this->setAttribute('role', $role); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/Start.php b/app/api/Twilio/TwiML/Voice/Start.php new file mode 100755 index 0000000..8c29206 --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/Start.php @@ -0,0 +1,61 @@ +nest(new Stream($attributes)); + } + + /** + * Add Siprec child. + * + * @param array $attributes Optional attributes + * @return Siprec Child element. + */ + public function siprec($attributes = []): Siprec { + return $this->nest(new Siprec($attributes)); + } + + /** + * Add Action attribute. + * + * @param string $action Action URL + */ + public function setAction($action): self { + return $this->setAttribute('action', $action); + } + + /** + * Add Method attribute. + * + * @param string $method Action URL method + */ + public function setMethod($method): self { + return $this->setAttribute('method', $method); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/Stop.php b/app/api/Twilio/TwiML/Voice/Stop.php new file mode 100755 index 0000000..9266e29 --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/Stop.php @@ -0,0 +1,41 @@ +nest(new Stream($attributes)); + } + + /** + * Add Siprec child. + * + * @param array $attributes Optional attributes + * @return Siprec Child element. + */ + public function siprec($attributes = []): Siprec { + return $this->nest(new Siprec($attributes)); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/Stream.php b/app/api/Twilio/TwiML/Voice/Stream.php new file mode 100755 index 0000000..d1f33de --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/Stream.php @@ -0,0 +1,87 @@ +nest(new Parameter($attributes)); + } + + /** + * Add Name attribute. + * + * @param string $name Friendly name given to the Stream + */ + public function setName($name): self { + return $this->setAttribute('name', $name); + } + + /** + * Add ConnectorName attribute. + * + * @param string $connectorName Unique name for Stream Connector + */ + public function setConnectorName($connectorName): self { + return $this->setAttribute('connectorName', $connectorName); + } + + /** + * Add Url attribute. + * + * @param string $url URL of the remote service where the Stream is routed + */ + public function setUrl($url): self { + return $this->setAttribute('url', $url); + } + + /** + * Add Track attribute. + * + * @param string $track Track to be streamed to remote service + */ + public function setTrack($track): self { + return $this->setAttribute('track', $track); + } + + /** + * Add StatusCallback attribute. + * + * @param string $statusCallback Status Callback URL + */ + public function setStatusCallback($statusCallback): self { + return $this->setAttribute('statusCallback', $statusCallback); + } + + /** + * Add StatusCallbackMethod attribute. + * + * @param string $statusCallbackMethod Status Callback URL method + */ + public function setStatusCallbackMethod($statusCallbackMethod): self { + return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/Task.php b/app/api/Twilio/TwiML/Voice/Task.php new file mode 100755 index 0000000..722a9e8 --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/Task.php @@ -0,0 +1,42 @@ +setAttribute('priority', $priority); + } + + /** + * Add Timeout attribute. + * + * @param int $timeout Timeout associated with task + */ + public function setTimeout($timeout): self { + return $this->setAttribute('timeout', $timeout); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/Voice/VirtualAgent.php b/app/api/Twilio/TwiML/Voice/VirtualAgent.php new file mode 100755 index 0000000..9e52c4b --- /dev/null +++ b/app/api/Twilio/TwiML/Voice/VirtualAgent.php @@ -0,0 +1,92 @@ +nest(new Config($attributes)); + } + + /** + * Add Parameter child. + * + * @param array $attributes Optional attributes + * @return Parameter Child element. + */ + public function parameter($attributes = []): Parameter { + return $this->nest(new Parameter($attributes)); + } + + /** + * Add ConnectorName attribute. + * + * @param string $connectorName Defines the conversation profile Dialogflow + * needs to use + */ + public function setConnectorName($connectorName): self { + return $this->setAttribute('connectorName', $connectorName); + } + + /** + * Add Language attribute. + * + * @param string $language Language to be used by Dialogflow to transcribe + * speech + */ + public function setLanguage($language): self { + return $this->setAttribute('language', $language); + } + + /** + * Add SentimentAnalysis attribute. + * + * @param bool $sentimentAnalysis Whether sentiment analysis needs to be + * enabled or not + */ + public function setSentimentAnalysis($sentimentAnalysis): self { + return $this->setAttribute('sentimentAnalysis', $sentimentAnalysis); + } + + /** + * Add StatusCallback attribute. + * + * @param string $statusCallback URL to post status callbacks from Twilio + */ + public function setStatusCallback($statusCallback): self { + return $this->setAttribute('statusCallback', $statusCallback); + } + + /** + * Add StatusCallbackMethod attribute. + * + * @param string $statusCallbackMethod HTTP method to use when requesting the + * status callback URL + */ + public function setStatusCallbackMethod($statusCallbackMethod): self { + return $this->setAttribute('statusCallbackMethod', $statusCallbackMethod); + } +} \ No newline at end of file diff --git a/app/api/Twilio/TwiML/VoiceResponse.php b/app/api/Twilio/TwiML/VoiceResponse.php new file mode 100755 index 0000000..d1ed009 --- /dev/null +++ b/app/api/Twilio/TwiML/VoiceResponse.php @@ -0,0 +1,222 @@ +nest(new Voice\Connect($attributes)); + } + + /** + * Add Dial child. + * + * @param string $number Phone number to dial + * @param array $attributes Optional attributes + * @return Voice\Dial Child element. + */ + public function dial($number = null, $attributes = []): Voice\Dial { + return $this->nest(new Voice\Dial($number, $attributes)); + } + + /** + * Add Echo child. + * + * @return Voice\Echo_ Child element. + */ + public function echo_(): Voice\Echo_ { + return $this->nest(new Voice\Echo_()); + } + + /** + * Add Enqueue child. + * + * @param string $name Friendly name + * @param array $attributes Optional attributes + * @return Voice\Enqueue Child element. + */ + public function enqueue($name = null, $attributes = []): Voice\Enqueue { + return $this->nest(new Voice\Enqueue($name, $attributes)); + } + + /** + * Add Gather child. + * + * @param array $attributes Optional attributes + * @return Voice\Gather Child element. + */ + public function gather($attributes = []): Voice\Gather { + return $this->nest(new Voice\Gather($attributes)); + } + + /** + * Add Hangup child. + * + * @return Voice\Hangup Child element. + */ + public function hangup(): Voice\Hangup { + return $this->nest(new Voice\Hangup()); + } + + /** + * Add Leave child. + * + * @return Voice\Leave Child element. + */ + public function leave(): Voice\Leave { + return $this->nest(new Voice\Leave()); + } + + /** + * Add Pause child. + * + * @param array $attributes Optional attributes + * @return Voice\Pause Child element. + */ + public function pause($attributes = []): Voice\Pause { + return $this->nest(new Voice\Pause($attributes)); + } + + /** + * Add Play child. + * + * @param string $url Media URL + * @param array $attributes Optional attributes + * @return Voice\Play Child element. + */ + public function play($url = null, $attributes = []): Voice\Play { + return $this->nest(new Voice\Play($url, $attributes)); + } + + /** + * Add Queue child. + * + * @param string $name Queue name + * @param array $attributes Optional attributes + * @return Voice\Queue Child element. + */ + public function queue($name, $attributes = []): Voice\Queue { + return $this->nest(new Voice\Queue($name, $attributes)); + } + + /** + * Add Record child. + * + * @param array $attributes Optional attributes + * @return Voice\Record Child element. + */ + public function record($attributes = []): Voice\Record { + return $this->nest(new Voice\Record($attributes)); + } + + /** + * Add Redirect child. + * + * @param string $url Redirect URL + * @param array $attributes Optional attributes + * @return Voice\Redirect Child element. + */ + public function redirect($url, $attributes = []): Voice\Redirect { + return $this->nest(new Voice\Redirect($url, $attributes)); + } + + /** + * Add Reject child. + * + * @param array $attributes Optional attributes + * @return Voice\Reject Child element. + */ + public function reject($attributes = []): Voice\Reject { + return $this->nest(new Voice\Reject($attributes)); + } + + /** + * Add Say child. + * + * @param string $message Message to say + * @param array $attributes Optional attributes + * @return Voice\Say Child element. + */ + public function say($message, $attributes = []): Voice\Say { + return $this->nest(new Voice\Say($message, $attributes)); + } + + /** + * Add Sms child. + * + * @param string $message Message body + * @param array $attributes Optional attributes + * @return Voice\Sms Child element. + */ + public function sms($message, $attributes = []): Voice\Sms { + return $this->nest(new Voice\Sms($message, $attributes)); + } + + /** + * Add Pay child. + * + * @param array $attributes Optional attributes + * @return Voice\Pay Child element. + */ + public function pay($attributes = []): Voice\Pay { + return $this->nest(new Voice\Pay($attributes)); + } + + /** + * Add Prompt child. + * + * @param array $attributes Optional attributes + * @return Voice\Prompt Child element. + */ + public function prompt($attributes = []): Voice\Prompt { + return $this->nest(new Voice\Prompt($attributes)); + } + + /** + * Add Start child. + * + * @param array $attributes Optional attributes + * @return Voice\Start Child element. + */ + public function start($attributes = []): Voice\Start { + return $this->nest(new Voice\Start($attributes)); + } + + /** + * Add Stop child. + * + * @return Voice\Stop Child element. + */ + public function stop(): Voice\Stop { + return $this->nest(new Voice\Stop()); + } + + /** + * Add Refer child. + * + * @param array $attributes Optional attributes + * @return Voice\Refer Child element. + */ + public function refer($attributes = []): Voice\Refer { + return $this->nest(new Voice\Refer($attributes)); + } +} \ No newline at end of file diff --git a/app/api/Twilio/Values.php b/app/api/Twilio/Values.php new file mode 100755 index 0000000..105d338 --- /dev/null +++ b/app/api/Twilio/Values.php @@ -0,0 +1,98 @@ + $value) { + if (!in_array($value, self::$noneConstants, true)) { + $result[$key] = $value; + } + } + return $result; + } + + public function __construct(array $options) { + $this->options = []; + foreach ($options as $key => $value) { + $this->options[\strtolower($key)] = $value; + } + } + + /** + * (PHP 5 >= 5.0.0)
+ * Whether a offset exists + * @link http://php.net/manual/en/arrayaccess.offsetexists.php + * @param mixed $offset

+ * An offset to check for. + *

+ * @return bool true on success or false on failure. + *

+ *

+ * The return value will be casted to boolean if non-boolean was returned. + */ + public function offsetExists($offset): bool { + return true; + } + + /** + * (PHP 5 >= 5.0.0)
+ * Offset to retrieve + * @link http://php.net/manual/en/arrayaccess.offsetget.php + * @param mixed $offset

+ * The offset to retrieve. + *

+ * @return mixed Can return all value types. + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) { + $offset = \strtolower($offset); + return \array_key_exists($offset, $this->options) ? $this->options[$offset] : self::NONE; + } + + /** + * (PHP 5 >= 5.0.0)
+ * Offset to set + * @link http://php.net/manual/en/arrayaccess.offsetset.php + * @param mixed $offset

+ * The offset to assign the value to. + *

+ * @param mixed $value

+ * The value to set. + *

+ * @return void + */ + public function offsetSet($offset, $value): void { + $this->options[\strtolower($offset)] = $value; + } + + /** + * (PHP 5 >= 5.0.0)
+ * Offset to unset + * @link http://php.net/manual/en/arrayaccess.offsetunset.php + * @param mixed $offset

+ * The offset to unset. + *

+ * @return void + */ + public function offsetUnset($offset): void { + unset($this->options[$offset]); + } +} diff --git a/app/api/Twilio/Version.php b/app/api/Twilio/Version.php new file mode 100755 index 0000000..f2165d5 --- /dev/null +++ b/app/api/Twilio/Version.php @@ -0,0 +1,236 @@ +domain = $domain; + $this->version = null; + } + + /** + * Generate an absolute URL from a version relative uri + * @param string $uri Version relative uri + * @return string Absolute URL + */ + public function absoluteUrl(string $uri): string { + return $this->getDomain()->absoluteUrl($this->relativeUri($uri)); + } + + /** + * Generate a domain relative uri from a version relative uri + * @param string $uri Version relative uri + * @return string Domain relative uri + */ + public function relativeUri(string $uri): string { + return \trim($this->version ?? '', '/') . '/' . \trim($uri, '/'); + } + + public function request(string $method, string $uri, + array $params = [], array $data = [], array $headers = [], + string $username = null, string $password = null, + int $timeout = null): Response { + $uri = $this->relativeUri($uri); + return $this->getDomain()->request( + $method, + $uri, + $params, + $data, + $headers, + $username, + $password, + $timeout + ); + } + + /** + * Create the best possible exception for the response. + * + * Attempts to parse the response for Twilio Standard error messages and use + * those to populate the exception, falls back to generic error message and + * HTTP status code. + * + * @param Response $response Error response + * @param string $header Header for exception message + * @return TwilioException + */ + protected function exception(Response $response, string $header): TwilioException { + $message = '[HTTP ' . $response->getStatusCode() . '] ' . $header; + + $content = $response->getContent(); + if (\is_array($content)) { + $message .= isset($content['message']) ? ': ' . $content['message'] : ''; + $code = isset($content['code']) ? $content['code'] : $response->getStatusCode(); + $moreInfo = $content['more_info'] ?? ''; + $details = $content['details'] ?? []; + return new RestException($message, $code, $response->getStatusCode(), $moreInfo, $details); + } + + return new RestException($message, $response->getStatusCode(), $response->getStatusCode()); + } + + /** + * @throws TwilioException + */ + public function fetch(string $method, string $uri, + array $params = [], array $data = [], array $headers = [], + string $username = null, string $password = null, + int $timeout = null) { + $response = $this->request( + $method, + $uri, + $params, + $data, + $headers, + $username, + $password, + $timeout + ); + + // 3XX response codes are allowed here to allow for 307 redirect from Deactivations API. + if ($response->getStatusCode() < 200 || $response->getStatusCode() >= 400) { + throw $this->exception($response, 'Unable to fetch record'); + } + + return $response->getContent(); + } + + /** + * @throws TwilioException + */ + public function update(string $method, string $uri, + array $params = [], array $data = [], array $headers = [], + string $username = null, string $password = null, + int $timeout = null) { + $response = $this->request( + $method, + $uri, + $params, + $data, + $headers, + $username, + $password, + $timeout + ); + + if ($response->getStatusCode() < 200 || $response->getStatusCode() >= 300) { + throw $this->exception($response, 'Unable to update record'); + } + + return $response->getContent(); + } + + /** + * @throws TwilioException + */ + public function delete(string $method, string $uri, + array $params = [], array $data = [], array $headers = [], + string $username = null, string $password = null, + int $timeout = null): bool { + $response = $this->request( + $method, + $uri, + $params, + $data, + $headers, + $username, + $password, + $timeout + ); + + if ($response->getStatusCode() < 200 || $response->getStatusCode() >= 300) { + throw $this->exception($response, 'Unable to delete record'); + } + + return $response->getStatusCode() === 204; + } + + public function readLimits(int $limit = null, int $pageSize = null): array { + if ($limit && $pageSize === null) { + $pageSize = $limit; + } + + $pageSize = \min($pageSize, self::MAX_PAGE_SIZE); + + return [ + 'limit' => $limit ?: Values::NONE, + 'pageSize' => $pageSize ?: Values::NONE, + 'pageLimit' => Values::NONE, + ]; + } + + public function page(string $method, string $uri, + array $params = [], array $data = [], array $headers = [], + string $username = null, string $password = null, + int $timeout = null): Response { + return $this->request( + $method, + $uri, + $params, + $data, + $headers, + $username, + $password, + $timeout + ); + } + + public function stream(Page $page, $limit = null, $pageLimit = null): Stream { + return new Stream($page, $limit, $pageLimit); + } + + /** + * @throws TwilioException + */ + public function create(string $method, string $uri, + array $params = [], array $data = [], array $headers = [], + string $username = null, string $password = null, + int $timeout = null) { + $response = $this->request( + $method, + $uri, + $params, + $data, + $headers, + $username, + $password, + $timeout + ); + + if ($response->getStatusCode() < 200 || $response->getStatusCode() >= 300) { + throw $this->exception($response, 'Unable to create record'); + } + + return $response->getContent(); + } + + public function getDomain(): Domain { + return $this->domain; + } + + public function __toString(): string { + return '[Version]'; + } +} diff --git a/app/api/Twilio/VersionInfo.php b/app/api/Twilio/VersionInfo.php new file mode 100755 index 0000000..91afcf2 --- /dev/null +++ b/app/api/Twilio/VersionInfo.php @@ -0,0 +1,15 @@ +. + */ + +/** + * SplClassLoader implementation that implements the technical interoperability + * standards for PHP 5.3 namespaces and class names. + * + * http://groups.google.com/group/php-standards/web/psr-0-final-proposal?pli=1 + * + * // Example which loads classes for the Doctrine Common package in the + * // Doctrine\Common namespace. + * $classLoader = new SplClassLoader('Doctrine\Common', '/path/to/doctrine'); + * $classLoader->register(); + * + * @license http://www.opensource.org/licenses/mit-license.html MIT License + * @author Jonathan H. Wage + * @author Roman S. Borschel + * @author Matthew Weier O'Phinney + * @author Kris Wallsmith + * @author Fabien Potencier + */ +class SplClassLoader { + private $_fileExtension = '.php'; + private $_namespace; + private $_includePath; + private $_namespaceSeparator = '\\'; + + /** + * Creates a new SplClassLoader that loads classes of the + * specified namespace. + * + * @param string $ns The namespace to use. + * @param string $includePath The include path to search + */ + public function __construct($ns = null, $includePath = null) { + $this->_namespace = $ns; + $this->_includePath = $includePath; + } + + /** + * Sets the namespace separator used by classes in the namespace of this class loader. + * + * @param string $sep The separator to use. + */ + public function setNamespaceSeparator($sep): void { + $this->_namespaceSeparator = $sep; + } + + /** + * Gets the namespace separator used by classes in the namespace of this class loader. + * + * @return string The separator to use. + */ + public function getNamespaceSeparator(): string { + return $this->_namespaceSeparator; + } + + /** + * Sets the base include path for all class files in the namespace of this class loader. + * + * @param string $includePath + */ + public function setIncludePath($includePath): void { + $this->_includePath = $includePath; + } + + /** + * Gets the base include path for all class files in the namespace of this class loader. + * + * @return string $includePath + */ + public function getIncludePath(): string { + return $this->_includePath; + } + + /** + * Sets the file extension of class files in the namespace of this class loader. + * + * @param string $fileExtension + */ + public function setFileExtension($fileExtension): void { + $this->_fileExtension = $fileExtension; + } + + /** + * Gets the file extension of class files in the namespace of this class loader. + * + * @return string $fileExtension + */ + public function getFileExtension(): string { + return $this->_fileExtension; + } + + /** + * Installs this class loader on the SPL autoload stack. + */ + public function register(): void { + \spl_autoload_register([$this, 'loadClass']); + } + + /** + * Uninstalls this class loader from the SPL autoloader stack. + */ + public function unregister(): void { + \spl_autoload_unregister([$this, 'loadClass']); + } + + /** + * Loads the given class or interface. + * + * @param string $className The name of the class to load. + * @return void + */ + public function loadClass($className): void { + if (null === $this->_namespace || $this->_namespace . $this->_namespaceSeparator === \substr($className, 0, \strlen($this->_namespace . $this->_namespaceSeparator))) { + $fileName = ''; + $namespace = ''; + if (false !== ($lastNsPos = \strripos($className, $this->_namespaceSeparator))) { + $namespace = \substr($className, 0, $lastNsPos); + $className = \substr($className, $lastNsPos + 1); + $fileName = \str_replace($this->_namespaceSeparator, DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR; + } + $fileName .= \str_replace('_', DIRECTORY_SEPARATOR, $className) . $this->_fileExtension; + require ($this->_includePath !== null ? $this->_includePath . DIRECTORY_SEPARATOR : '') . $fileName; + } + } +} + +$twilioClassLoader = new SplClassLoader('Twilio', \realpath(__DIR__ . DIRECTORY_SEPARATOR . '..')); +$twilioClassLoader->register(); diff --git a/app/api/XLSX/xlsxwriter.class.php b/app/api/XLSX/xlsxwriter.class.php new file mode 100755 index 0000000..cb391f2 --- /dev/null +++ b/app/api/XLSX/xlsxwriter.class.php @@ -0,0 +1,981 @@ +tempFilename()) or self::log("Warning: tempdir ".sys_get_temp_dir()." not writeable, use ->setTempDir()"); + class_exists('ZipArchive') or self::log("Error: ZipArchive class does not exist"); + $this->addCellStyle($number_format='GENERAL', $style_string=null); + } + + public function setTitle($title='') { $this->title=$title; } + public function setSubject($subject='') { $this->subject=$subject; } + public function setAuthor($author='') { $this->author=$author; } + public function setCompany($company='') { $this->company=$company; } + public function setKeywords($keywords='') { $this->keywords=$keywords; } + public function setDescription($description='') { $this->description=$description; } + public function setTempDir($tempdir='') { $this->tempdir=$tempdir; } + public function setRightToLeft($isRightToLeft=false){ $this->isRightToLeft=$isRightToLeft; } + + public function __destruct() + { + if (!empty($this->temp_files)) { + foreach($this->temp_files as $temp_file) { + @unlink($temp_file); + } + } + } + + protected function tempFilename() + { + $tempdir = !empty($this->tempdir) ? $this->tempdir : sys_get_temp_dir(); + $filename = tempnam($tempdir, "xlsx_writer_"); + if (!$filename) { + // If you are seeing this error, it's possible you may have too many open + // file handles. If you're creating a spreadsheet with many small inserts, + // it is possible to exceed the default 1024 open file handles. Run 'ulimit -a' + // and try increasing the 'open files' number with 'ulimit -n 8192' + throw new \Exception("Unable to create tempfile - check file handle limits?"); + } + $this->temp_files[] = $filename; + return $filename; + } + + public function writeToStdOut() + { + $temp_file = $this->tempFilename(); + self::writeToFile($temp_file); + readfile($temp_file); + } + + public function writeToString() + { + $temp_file = $this->tempFilename(); + self::writeToFile($temp_file); + $string = file_get_contents($temp_file); + return $string; + } + + public function writeToFile($filename) + { + foreach($this->sheets as $sheet_name => $sheet) { + self::finalizeSheet($sheet_name);//making sure all footers have been written + } + + if ( file_exists( $filename ) ) { + if ( is_writable( $filename ) ) { + @unlink( $filename ); //if the zip already exists, remove it + } else { + self::log( "Error in " . __CLASS__ . "::" . __FUNCTION__ . ", file is not writeable." ); + return; + } + } + $zip = new ZipArchive(); + if (empty($this->sheets)) { self::log("Error in ".__CLASS__."::".__FUNCTION__.", no worksheets defined."); return; } + if (!$zip->open($filename, ZipArchive::CREATE)) { self::log("Error in ".__CLASS__."::".__FUNCTION__.", unable to create zip."); return; } + + $zip->addEmptyDir("docProps/"); + $zip->addFromString("docProps/app.xml" , self::buildAppXML() ); + $zip->addFromString("docProps/core.xml", self::buildCoreXML()); + + $zip->addEmptyDir("_rels/"); + $zip->addFromString("_rels/.rels", self::buildRelationshipsXML()); + + $zip->addEmptyDir("xl/worksheets/"); + foreach($this->sheets as $sheet) { + $zip->addFile($sheet->filename, "xl/worksheets/".$sheet->xmlname ); + } + $zip->addFromString("xl/workbook.xml" , self::buildWorkbookXML() ); + $zip->addFile($this->writeStylesXML(), "xl/styles.xml" ); //$zip->addFromString("xl/styles.xml" , self::buildStylesXML() ); + $zip->addFromString("[Content_Types].xml" , self::buildContentTypesXML() ); + + $zip->addEmptyDir("xl/_rels/"); + $zip->addFromString("xl/_rels/workbook.xml.rels", self::buildWorkbookRelsXML() ); + $zip->close(); + } + + protected function initializeSheet($sheet_name, $col_widths=array(), $auto_filter=false, $freeze_rows=false, $freeze_columns=false ) + { + //if already initialized + if ($this->current_sheet==$sheet_name || isset($this->sheets[$sheet_name])) + return; + + $sheet_filename = $this->tempFilename(); + $sheet_xmlname = 'sheet' . (count($this->sheets) + 1).".xml"; + $this->sheets[$sheet_name] = (object)array( + 'filename' => $sheet_filename, + 'sheetname' => $sheet_name, + 'xmlname' => $sheet_xmlname, + 'row_count' => 0, + 'file_writer' => new MEC_XLSXWriter_BuffererWriter($sheet_filename), + 'columns' => array(), + 'merge_cells' => array(), + 'max_cell_tag_start' => 0, + 'max_cell_tag_end' => 0, + 'auto_filter' => $auto_filter, + 'freeze_rows' => $freeze_rows, + 'freeze_columns' => $freeze_columns, + 'finalized' => false, + ); + $rightToLeftValue = $this->isRightToLeft ? 'true' : 'false'; + $sheet = &$this->sheets[$sheet_name]; + $tabselected = count($this->sheets) == 1 ? 'true' : 'false';//only first sheet is selected + $max_cell=MEC_XLSXWriter::xlsCell(self::EXCEL_2007_MAX_ROW, self::EXCEL_2007_MAX_COL);//XFE1048577 + $sheet->file_writer->write('' . "\n"); + $sheet->file_writer->write(''); + $sheet->file_writer->write( ''); + $sheet->file_writer->write( ''); + $sheet->file_writer->write( ''); + $sheet->max_cell_tag_start = $sheet->file_writer->ftell(); + $sheet->file_writer->write(''); + $sheet->max_cell_tag_end = $sheet->file_writer->ftell(); + $sheet->file_writer->write( ''); + $sheet->file_writer->write( ''); + if ($sheet->freeze_rows && $sheet->freeze_columns) { + $sheet->file_writer->write( ''); + $sheet->file_writer->write( ''); + $sheet->file_writer->write( ''); + $sheet->file_writer->write( ''); + } + elseif ($sheet->freeze_rows) { + $sheet->file_writer->write( ''); + $sheet->file_writer->write( ''); + } + elseif ($sheet->freeze_columns) { + $sheet->file_writer->write( ''); + $sheet->file_writer->write( ''); + } + else { // not frozen + $sheet->file_writer->write( ''); + } + $sheet->file_writer->write( ''); + $sheet->file_writer->write( ''); + $sheet->file_writer->write( ''); + $i=0; + if (!empty($col_widths)) { + foreach($col_widths as $column_width) { + $sheet->file_writer->write( ''); + $i++; + } + } + $sheet->file_writer->write( ''); + $sheet->file_writer->write( ''); + $sheet->file_writer->write( ''); + } + + private function addCellStyle($number_format, $cell_style_string) + { + $number_format_idx = self::add_to_list_get_index($this->number_formats, $number_format); + $lookup_string = $number_format_idx.";".$cell_style_string; + $cell_style_idx = self::add_to_list_get_index($this->cell_styles, $lookup_string); + return $cell_style_idx; + } + + private function initializeColumnTypes($header_types) + { + $column_types = []; + foreach($header_types as $v) + { + $number_format = self::numberFormatStandardized($v); + $number_format_type = self::determineNumberFormatType($number_format); + $cell_style_idx = $this->addCellStyle($number_format, $style_string=null); + $column_types[] = array('number_format' => $number_format,//contains excel format like 'YYYY-MM-DD HH:MM:SS' + 'number_format_type' => $number_format_type, //contains friendly format like 'datetime' + 'default_cell_style' => $cell_style_idx, + ); + } + return $column_types; + } + + public function writeSheetHeader($sheet_name, array $header_types, $col_options = null) + { + if (empty($sheet_name) || empty($header_types)) + return; + + $suppress_row = isset($col_options['suppress_row']) ? intval($col_options['suppress_row']) : false; + if (is_bool($col_options)) + { + self::log( "Warning! passing $suppress_row=false|true to writeSheetHeader() is deprecated, this will be removed in a future version." ); + $suppress_row = intval($col_options); + } + $style = &$col_options; + + $col_widths = isset($col_options['widths']) ? (array)$col_options['widths'] : []; + $auto_filter = isset($col_options['auto_filter']) ? intval($col_options['auto_filter']) : false; + $freeze_rows = isset($col_options['freeze_rows']) ? intval($col_options['freeze_rows']) : false; + $freeze_columns = isset($col_options['freeze_columns']) ? intval($col_options['freeze_columns']) : false; + self::initializeSheet($sheet_name, $col_widths, $auto_filter, $freeze_rows, $freeze_columns); + $sheet = &$this->sheets[$sheet_name]; + $sheet->columns = $this->initializeColumnTypes($header_types); + if (!$suppress_row) + { + $header_row = array_keys($header_types); + + $sheet->file_writer->write(''); + $sheet->row_count++; + } + $this->current_sheet = $sheet_name; + } + + public function writeSheetRow($sheet_name, array $row, $row_options=null) + { + if (empty($sheet_name)) + return; + + $this->initializeSheet($sheet_name); + $sheet = &$this->sheets[$sheet_name]; + if (count($sheet->columns) < count($row)) { + $default_column_types = $this->initializeColumnTypes( array_fill($from=0, $until=count($row), 'GENERAL') );//will map to n_auto + $sheet->columns = array_merge((array)$sheet->columns, $default_column_types); + } + + if (!empty($row_options)) + { + $ht = isset($row_options['height']) ? floatval($row_options['height']) : 12.1; + $customHt = isset($row_options['height']) ? true : false; + $hidden = isset($row_options['hidden']) ? (bool)($row_options['hidden']) : false; + $collapsed = isset($row_options['collapsed']) ? (bool)($row_options['collapsed']) : false; + $sheet->file_writer->write(''); + + if (!empty($sheet->merge_cells)) { + $sheet->file_writer->write( ''); + foreach ($sheet->merge_cells as $range) { + $sheet->file_writer->write( ''); + } + $sheet->file_writer->write( ''); + } + + $max_cell = self::xlsCell($sheet->row_count - 1, count($sheet->columns) - 1); + + if ($sheet->auto_filter) { + $sheet->file_writer->write( ''); + } + + $sheet->file_writer->write( ''); + $sheet->file_writer->write( ''); + $sheet->file_writer->write( ''); + $sheet->file_writer->write( ''); + $sheet->file_writer->write( '&C&"Times New Roman,Regular"&12&A'); + $sheet->file_writer->write( '&C&"Times New Roman,Regular"&12Page &P'); + $sheet->file_writer->write( ''); + $sheet->file_writer->write(''); + + $max_cell_tag = ''; + $padding_length = $sheet->max_cell_tag_end - $sheet->max_cell_tag_start - strlen($max_cell_tag); + $sheet->file_writer->fseek($sheet->max_cell_tag_start); + $sheet->file_writer->write($max_cell_tag.str_repeat(" ", $padding_length)); + $sheet->file_writer->close(); + $sheet->finalized=true; + } + + public function markMergedCell($sheet_name, $start_cell_row, $start_cell_column, $end_cell_row, $end_cell_column) + { + if (empty($sheet_name) || $this->sheets[$sheet_name]->finalized) + return; + + self::initializeSheet($sheet_name); + $sheet = &$this->sheets[$sheet_name]; + + $startCell = self::xlsCell($start_cell_row, $start_cell_column); + $endCell = self::xlsCell($end_cell_row, $end_cell_column); + $sheet->merge_cells[] = $startCell . ":" . $endCell; + } + + public function writeSheet(array $data, $sheet_name='', array $header_types=array()) + { + $sheet_name = empty($sheet_name) ? 'Sheet1' : $sheet_name; + $data = empty($data) ? array(array('')) : $data; + if (!empty($header_types)) + { + $this->writeSheetHeader($sheet_name, $header_types); + } + foreach($data as $i=>$row) + { + $this->writeSheetRow($sheet_name, $row); + } + $this->finalizeSheet($sheet_name); + } + + protected function writeCell(MEC_XLSXWriter_BuffererWriter &$file, $row_number, $column_number, $value, $num_format_type, $cell_style_idx) + { + $cell_name = self::xlsCell($row_number, $column_number); + + if (!is_scalar($value) || $value==='') { //objects, array, empty + $file->write(''); + } elseif (is_string($value) && $value[0]=='='){ + $file->write(''.self::xmlspecialchars(ltrim($value, '=')).''); + } elseif ($num_format_type=='n_date') { + $file->write(''.intval(self::convert_date_time($value)).''); + } elseif ($num_format_type=='n_datetime') { + $file->write(''.self::convert_date_time($value).''); + } elseif ($num_format_type=='n_numeric') { + $file->write(''.self::xmlspecialchars($value).'');//int,float,currency + } elseif ($num_format_type=='n_string') { + $file->write(''.self::xmlspecialchars($value).''); + } elseif ($num_format_type=='n_auto' || 1) { //auto-detect unknown column types + if (!is_string($value) || $value=='0' || ($value[0]!='0' && ctype_digit($value)) || preg_match("/^\-?(0|[1-9][0-9]*)(\.[0-9]+)?$/", $value)){ + $file->write(''.self::xmlspecialchars($value).'');//int,float,currency + } else { //implied: ($cell_format=='string') + $file->write(''.self::xmlspecialchars($value).''); + } + } + } + + protected function styleFontIndexes() + { + static $border_allowed = array('left','right','top','bottom'); + static $border_style_allowed = array('thin','medium','thick','dashDot','dashDotDot','dashed','dotted','double','hair','mediumDashDot','mediumDashDotDot','mediumDashed','slantDashDot'); + static $horizontal_allowed = array('general','left','right','justify','center'); + static $vertical_allowed = array('bottom','center','distributed','top'); + $default_font = array('size'=>'10','name'=>'Arial','family'=>'2'); + $fills = array('','');//2 placeholders for static xml later + $fonts = array('','','','');//4 placeholders for static xml later + $borders = array('');//1 placeholder for static xml later + $style_indexes = []; + foreach($this->cell_styles as $i=>$cell_style_string) + { + $semi_colon_pos = strpos($cell_style_string,";"); + $number_format_idx = substr($cell_style_string, 0, $semi_colon_pos); + $style_json_string = substr($cell_style_string, $semi_colon_pos+1); + $style = @json_decode($style_json_string, $as_assoc=true); + + $style_indexes[$i] = array('num_fmt_idx'=>$number_format_idx);//initialize entry + if (isset($style['border']) && is_string($style['border']))//border is a comma delimited str + { + $border_value['side'] = array_intersect(explode(",", $style['border']), $border_allowed); + if (isset($style['border-style']) && in_array($style['border-style'],$border_style_allowed)) + { + $border_value['style'] = $style['border-style']; + } + if (isset($style['border-color']) && is_string($style['border-color']) && $style['border-color'][0]=='#') + { + $v = substr($style['border-color'],1,6); + $v = strlen($v)==3 ? $v[0].$v[0].$v[1].$v[1].$v[2].$v[2] : $v;// expand cf0 => ccff00 + $border_value['color'] = "FF".strtoupper($v); + } + $style_indexes[$i]['border_idx'] = self::add_to_list_get_index($borders, json_encode($border_value)); + } + if (isset($style['fill']) && is_string($style['fill']) && $style['fill'][0]=='#') + { + $v = substr($style['fill'],1,6); + $v = strlen($v)==3 ? $v[0].$v[0].$v[1].$v[1].$v[2].$v[2] : $v;// expand cf0 => ccff00 + $style_indexes[$i]['fill_idx'] = self::add_to_list_get_index($fills, "FF".strtoupper($v) ); + } + if (isset($style['halign']) && in_array($style['halign'],$horizontal_allowed)) + { + $style_indexes[$i]['alignment'] = true; + $style_indexes[$i]['halign'] = $style['halign']; + } + if (isset($style['valign']) && in_array($style['valign'],$vertical_allowed)) + { + $style_indexes[$i]['alignment'] = true; + $style_indexes[$i]['valign'] = $style['valign']; + } + if (isset($style['wrap_text'])) + { + $style_indexes[$i]['alignment'] = true; + $style_indexes[$i]['wrap_text'] = (bool)$style['wrap_text']; + } + + $font = $default_font; + if (isset($style['font-size'])) + { + $font['size'] = floatval($style['font-size']);//floatval to allow "10.5" etc + } + if (isset($style['font']) && is_string($style['font'])) + { + if ($style['font']=='Comic Sans MS') { $font['family']=4; } + if ($style['font']=='Times New Roman') { $font['family']=1; } + if ($style['font']=='Courier New') { $font['family']=3; } + $font['name'] = strval($style['font']); + } + if (isset($style['font-style']) && is_string($style['font-style'])) + { + if (strpos($style['font-style'], 'bold')!==false) { $font['bold'] = true; } + if (strpos($style['font-style'], 'italic')!==false) { $font['italic'] = true; } + if (strpos($style['font-style'], 'strike')!==false) { $font['strike'] = true; } + if (strpos($style['font-style'], 'underline')!==false) { $font['underline'] = true; } + } + if (isset($style['color']) && is_string($style['color']) && $style['color'][0]=='#' ) + { + $v = substr($style['color'],1,6); + $v = strlen($v)==3 ? $v[0].$v[0].$v[1].$v[1].$v[2].$v[2] : $v;// expand cf0 => ccff00 + $font['color'] = "FF".strtoupper($v); + } + if ($font!=$default_font) + { + $style_indexes[$i]['font_idx'] = self::add_to_list_get_index($fonts, json_encode($font) ); + } + } + return array('fills'=>$fills,'fonts'=>$fonts,'borders'=>$borders,'styles'=>$style_indexes ); + } + + protected function writeStylesXML() + { + $r = self::styleFontIndexes(); + $fills = $r['fills']; + $fonts = $r['fonts']; + $borders = $r['borders']; + $style_indexes = $r['styles']; + + $temporary_filename = $this->tempFilename(); + $file = new MEC_XLSXWriter_BuffererWriter($temporary_filename); + $file->write(''."\n"); + $file->write(''); + $file->write(''); + foreach($this->number_formats as $i=>$v) { + $file->write(''); + } + //$file->write( ''); + //$file->write( ''); + //$file->write( ''); + //$file->write( ''); + $file->write(''); + + $file->write(''); + $file->write( ''); + $file->write( ''); + $file->write( ''); + $file->write( ''); + + foreach($fonts as $font) { + if (!empty($font)) { //fonts have 4 empty placeholders in array to offset the 4 static xml entries above + $f = json_decode($font,true); + $file->write(''); + $file->write( ''); + $file->write( ''); + if (!empty($f['color'])) { $file->write(''); } + if (!empty($f['bold'])) { $file->write(''); } + if (!empty($f['italic'])) { $file->write(''); } + if (!empty($f['underline'])) { $file->write(''); } + if (!empty($f['strike'])) { $file->write(''); } + $file->write(''); + } + } + $file->write(''); + + $file->write(''); + $file->write( ''); + $file->write( ''); + foreach($fills as $fill) { + if (!empty($fill)) { //fills have 2 empty placeholders in array to offset the 2 static xml entries above + $file->write(''); + } + } + $file->write(''); + + $file->write(''); + $file->write( ''); + foreach($borders as $border) { + if (!empty($border)) { //fonts have an empty placeholder in the array to offset the static xml entry above + $pieces = json_decode($border,true); + $border_style = !empty($pieces['style']) ? $pieces['style'] : 'hair'; + $border_color = !empty($pieces['color']) ? '' : ''; + $file->write(''); + foreach (array('left', 'right', 'top', 'bottom') as $side) + { + $show_side = in_array($side,$pieces['side']) ? true : false; + $file->write($show_side ? "<$side style=\"$border_style\">$border_color" : "<$side/>"); + } + $file->write( ''); + $file->write(''); + } + } + $file->write(''); + + $file->write(''); + $file->write( ''); + $file->write( ''); + $file->write( ''); + $file->write( ''); + $file->write( ''); + $file->write( ''); + $file->write( ''); + $file->write( ''); + $file->write( ''); + $file->write( ''); + $file->write( ''); + $file->write( ''); + $file->write( ''); + $file->write( ''); + $file->write( ''); + $file->write( ''); + $file->write( ''); + $file->write( ''); + $file->write( ''); + $file->write( ''); + $file->write( ''); + $file->write( ''); + $file->write(''); + + $file->write(''); + //$file->write( ''); + //$file->write( ''); + //$file->write( ''); + //$file->write( ''); + foreach($style_indexes as $v) + { + $applyAlignment = isset($v['alignment']) ? 'true' : 'false'; + $wrapText = !empty($v['wrap_text']) ? 'true' : 'false'; + $horizAlignment = isset($v['halign']) ? $v['halign'] : 'general'; + $vertAlignment = isset($v['valign']) ? $v['valign'] : 'bottom'; + $applyBorder = isset($v['border_idx']) ? 'true' : 'false'; + $applyFont = 'true'; + $borderIdx = isset($v['border_idx']) ? intval($v['border_idx']) : 0; + $fillIdx = isset($v['fill_idx']) ? intval($v['fill_idx']) : 0; + $fontIdx = isset($v['font_idx']) ? intval($v['font_idx']) : 0; + //$file->write(''); + $file->write(''); + $file->write(' '); + $file->write(' '); + } + $file->write(''); + $file->write( ''); + $file->write( ''); + $file->write( ''); + $file->write( ''); + $file->write( ''); + $file->write( ''); + $file->write( ''); + $file->write( ''); + $file->write(''); + $file->close(); + return $temporary_filename; + } + + protected function buildAppXML() + { + $app_xml=""; + $app_xml.=''."\n"; + $app_xml.=''; + $app_xml.='0'; + $app_xml.=''.self::xmlspecialchars($this->company).''; + $app_xml.=''; + return $app_xml; + } + + protected function buildCoreXML() + { + $core_xml=""; + $core_xml.=''."\n"; + $core_xml.=''; + $core_xml.=''.date("Y-m-d\TH:i:s.00\Z").'';//$date_time = '2014-10-25T15:54:37.00Z'; + $core_xml.=''.self::xmlspecialchars($this->title).''; + $core_xml.=''.self::xmlspecialchars($this->subject).''; + $core_xml.=''.self::xmlspecialchars($this->author).''; + if (!empty($this->keywords)) { + $core_xml.=''.self::xmlspecialchars(implode (", ", (array)$this->keywords)).''; + } + $core_xml.=''.self::xmlspecialchars($this->description).''; + $core_xml.='0'; + $core_xml.=''; + return $core_xml; + } + + protected function buildRelationshipsXML() + { + $rels_xml=""; + $rels_xml.=''."\n"; + $rels_xml.=''; + $rels_xml.=''; + $rels_xml.=''; + $rels_xml.=''; + $rels_xml.="\n"; + $rels_xml.=''; + return $rels_xml; + } + + protected function buildWorkbookXML() + { + $i=0; + $workbook_xml=""; + $workbook_xml.=''."\n"; + $workbook_xml.=''; + $workbook_xml.=''; + $workbook_xml.=''; + $workbook_xml.=''; + foreach($this->sheets as $sheet_name=>$sheet) { + $sheetname = self::sanitize_sheetname($sheet->sheetname); + $workbook_xml.=''; + $i++; + } + $workbook_xml.=''; + $workbook_xml.=''; + $i=0; + foreach($this->sheets as $sheet_name=>$sheet) { + if ($sheet->auto_filter) { + $sheetname = self::sanitize_sheetname($sheet->sheetname); + $workbook_xml.=''; + $i++; + } + } + $workbook_xml.=''; + $workbook_xml.=''; + return $workbook_xml; + } + + protected function buildWorkbookRelsXML() + { + $i=0; + $wkbkrels_xml=""; + $wkbkrels_xml.=''."\n"; + $wkbkrels_xml.=''; + $wkbkrels_xml.=''; + foreach($this->sheets as $sheet_name=>$sheet) { + $wkbkrels_xml.=''; + $i++; + } + $wkbkrels_xml.="\n"; + $wkbkrels_xml.=''; + return $wkbkrels_xml; + } + + protected function buildContentTypesXML() + { + $content_types_xml=""; + $content_types_xml.=''."\n"; + $content_types_xml.=''; + $content_types_xml.=''; + $content_types_xml.=''; + foreach($this->sheets as $sheet_name=>$sheet) { + $content_types_xml.=''; + } + $content_types_xml.=''; + $content_types_xml.=''; + $content_types_xml.=''; + $content_types_xml.=''; + $content_types_xml.="\n"; + $content_types_xml.=''; + return $content_types_xml; + } + + //------------------------------------------------------------------ + /* + * @param $row_number int, zero based + * @param $column_number int, zero based + * @param $absolute bool + * @return Cell label/coordinates, ex: A1, C3, AA42 (or if $absolute==true: $A$1, $C$3, $AA$42) + * */ + public static function xlsCell($row_number, $column_number, $absolute=false) + { + $n = $column_number; + for($r = ""; $n >= 0; $n = intval($n / 26) - 1) { + $r = chr($n%26 + 0x41) . $r; + } + if ($absolute) { + return '$' . $r . '$' . ($row_number+1); + } + return $r . ($row_number+1); + } + //------------------------------------------------------------------ + public static function log($string) + { + //file_put_contents("php://stderr", date("Y-m-d H:i:s:").rtrim(is_array($string) ? json_encode($string) : $string)."\n"); + error_log(date("Y-m-d H:i:s:").rtrim(is_array($string) ? json_encode($string) : $string)."\n"); + } + //------------------------------------------------------------------ + public static function sanitize_filename($filename) //http://msdn.microsoft.com/en-us/library/aa365247%28VS.85%29.aspx + { + $nonprinting = array_map('chr', range(0,31)); + $invalid_chars = array('<', '>', '?', '"', ':', '|', '\\', '/', '*', '&'); + $all_invalids = array_merge($nonprinting,$invalid_chars); + return str_replace($all_invalids, "", $filename); + } + //------------------------------------------------------------------ + public static function sanitize_sheetname($sheetname) + { + static $badchars = '\\/?*:[]'; + static $goodchars = ' '; + $sheetname = strtr($sheetname, $badchars, $goodchars); + $sheetname = function_exists('mb_substr') ? mb_substr($sheetname, 0, 31) : substr($sheetname, 0, 31); + $sheetname = trim(trim(trim($sheetname),"'"));//trim before and after trimming single quotes + return !empty($sheetname) ? $sheetname : 'Sheet'.((rand()%900)+100); + } + //------------------------------------------------------------------ + public static function xmlspecialchars($val) + { + //note, badchars does not include \t\n\r (\x09\x0a\x0d) + static $badchars = "\x00\x01\x02\x03\x04\x05\x06\x07\x08\x0b\x0c\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x7f"; + static $goodchars = " "; + return strtr(htmlspecialchars((string)$val, ENT_QUOTES | ENT_XML1 | ENT_SUBSTITUTE), $badchars, $goodchars);//strtr appears to be faster than str_replace + } + //------------------------------------------------------------------ + public static function array_first_key(array $arr) + { + reset($arr); + $first_key = key($arr); + return $first_key; + } + //------------------------------------------------------------------ + private static function determineNumberFormatType($num_format) + { + $num_format = preg_replace("/\[(Black|Blue|Cyan|Green|Magenta|Red|White|Yellow)\]/i", "", $num_format); + if ($num_format=='GENERAL') return 'n_auto'; + if ($num_format=='@') return 'n_string'; + if ($num_format=='0') return 'n_numeric'; + if (preg_match('/[H]{1,2}:[M]{1,2}(?![^"]*+")/i', $num_format)) return 'n_datetime'; + if (preg_match('/[M]{1,2}:[S]{1,2}(?![^"]*+")/i', $num_format)) return 'n_datetime'; + if (preg_match('/[Y]{2,4}(?![^"]*+")/i', $num_format)) return 'n_date'; + if (preg_match('/[D]{1,2}(?![^"]*+")/i', $num_format)) return 'n_date'; + if (preg_match('/[M]{1,2}(?![^"]*+")/i', $num_format)) return 'n_date'; + if (preg_match('/$(?![^"]*+")/', $num_format)) return 'n_numeric'; + if (preg_match('/%(?![^"]*+")/', $num_format)) return 'n_numeric'; + if (preg_match('/0(?![^"]*+")/', $num_format)) return 'n_numeric'; + return 'n_auto'; + } + //------------------------------------------------------------------ + private static function numberFormatStandardized($num_format) + { + if ($num_format=='money') { $num_format='dollar'; } + if ($num_format=='number') { $num_format='integer'; } + + if ($num_format=='string') $num_format='@'; + else if ($num_format=='integer') $num_format='0'; + else if ($num_format=='date') $num_format='YYYY-MM-DD'; + else if ($num_format=='datetime') $num_format='YYYY-MM-DD HH:MM:SS'; + else if ($num_format=='time') $num_format='HH:MM:SS'; + else if ($num_format=='price') $num_format='#,##0.00'; + else if ($num_format=='dollar') $num_format='[$$-1009]#,##0.00;[RED]-[$$-1009]#,##0.00'; + else if ($num_format=='euro') $num_format='#,##0.00 [$€-407];[RED]-#,##0.00 [$€-407]'; + $ignore_until=''; + $escaped = ''; + for($i=0,$ix=strlen($num_format); $i<$ix; $i++) + { + $c = $num_format[$i]; + if ($ignore_until=='' && $c=='[') + $ignore_until=']'; + else if ($ignore_until=='' && $c=='"') + $ignore_until='"'; + else if ($ignore_until==$c) + $ignore_until=''; + if ($ignore_until=='' && ($c==' ' || $c=='-' || $c=='(' || $c==')') && ($i==0 || $num_format[$i-1]!='_')) + $escaped.= "\\".$c; + else + $escaped.= $c; + } + return $escaped; + } + //------------------------------------------------------------------ + public static function add_to_list_get_index(&$haystack, $needle) + { + $existing_idx = array_search($needle, $haystack, $strict=true); + if ($existing_idx===false) + { + $existing_idx = count($haystack); + $haystack[] = $needle; + } + return $existing_idx; + } + //------------------------------------------------------------------ + public static function convert_date_time($date_input) //thanks to Excel::Writer::XLSX::Worksheet.pm (perl) + { + $days = 0; # Number of days since epoch + $seconds = 0; # Time expressed as fraction of 24h hours in seconds + $year=$month=$day=0; + $hour=$min =$sec=0; + + $date_time = $date_input; + if (preg_match("/(\d{4})\-(\d{2})\-(\d{2})/", $date_time, $matches)) + { + list($junk,$year,$month,$day) = $matches; + } + if (preg_match("/(\d+):(\d{2}):(\d{2})/", $date_time, $matches)) + { + list($junk,$hour,$min,$sec) = $matches; + $seconds = ( $hour * 60 * 60 + $min * 60 + $sec ) / ( 24 * 60 * 60 ); + } + + //using 1900 as epoch, not 1904, ignoring 1904 special case + + # Special cases for Excel. + if ("$year-$month-$day"=='1899-12-31') return $seconds ; # Excel 1900 epoch + if ("$year-$month-$day"=='1900-01-00') return $seconds ; # Excel 1900 epoch + if ("$year-$month-$day"=='1900-02-29') return 60 + $seconds ; # Excel false leapday + + # We calculate the date by calculating the number of days since the epoch + # and adjust for the number of leap days. We calculate the number of leap + # days by normalising the year in relation to the epoch. Thus the year 2000 + # becomes 100 for 4 and 100 year leapdays and 400 for 400 year leapdays. + $epoch = 1900; + $offset = 0; + $norm = 300; + $range = $year - $epoch; + + # Set month days and check for leap year. + $leap = (($year % 400 == 0) || (($year % 4 == 0) && ($year % 100)) ) ? 1 : 0; + $mdays = array( 31, ($leap ? 29 : 28), 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 ); + + # Some boundary checks + if ($year!=0 || $month !=0 || $day!=0) + { + if($year < $epoch || $year > 9999) return 0; + if($month < 1 || $month > 12) return 0; + if($day < 1 || $day > $mdays[ $month - 1 ]) return 0; + } + + # Accumulate the number of days since the epoch. + $days = $day; # Add days for current month + $days += array_sum( array_slice($mdays, 0, $month-1 ) ); # Add days for past months + $days += $range * 365; # Add days for past years + $days += intval( ( $range ) / 4 ); # Add leapdays + $days -= intval( ( $range + $offset ) / 100 ); # Subtract 100 year leapdays + $days += intval( ( $range + $offset + $norm ) / 400 ); # Add 400 year leapdays + $days -= $leap; # Already counted above + + # Adjust for Excel erroneously treating 1900 as a leap year. + if ($days > 59) { $days++;} + + return $days + $seconds; + } + //------------------------------------------------------------------ +} + +class MEC_XLSXWriter_BuffererWriter +{ + protected $fd=null; + protected $buffer=''; + protected $check_utf8=false; + + public function __construct($filename, $fd_fopen_flags='w', $check_utf8=false) + { + $this->check_utf8 = $check_utf8; + $this->fd = fopen($filename, $fd_fopen_flags); + if ($this->fd===false) { + MEC_XLSXWriter::log("Unable to open $filename for writing."); + } + } + + public function write($string) + { + $this->buffer.=$string; + if (isset($this->buffer[8191])) { + $this->purge(); + } + } + + protected function purge() + { + if ($this->fd) { + if ($this->check_utf8 && !self::isValidUTF8($this->buffer)) { + MEC_XLSXWriter::log("Error, invalid UTF8 encoding detected."); + $this->check_utf8 = false; + } + fwrite($this->fd, $this->buffer); + $this->buffer=''; + } + } + + public function close() + { + $this->purge(); + if ($this->fd) { + fclose($this->fd); + $this->fd=null; + } + } + + public function __destruct() + { + $this->close(); + } + + public function ftell() + { + if ($this->fd) { + $this->purge(); + return ftell($this->fd); + } + return -1; + } + + public function fseek($pos) + { + if ($this->fd) { + $this->purge(); + return fseek($this->fd, $pos); + } + return -1; + } + + protected static function isValidUTF8($string) + { + if (function_exists('mb_check_encoding')) + { + return mb_check_encoding($string, 'UTF-8') ? true : false; + } + return preg_match("//u", $string) ? true : false; + } +} + + + +// vim: set filetype=php expandtab tabstop=4 shiftwidth=4 autoindent smartindent: diff --git a/app/api/addons-api/addons-api.json b/app/api/addons-api/addons-api.json new file mode 100755 index 0000000..c8931e3 --- /dev/null +++ b/app/api/addons-api/addons-api.json @@ -0,0 +1,362 @@ +{ + "1": { + "slug": "mec-woocommerce", + "name": "Woocommerce Integration", + "version": "1.3.0", + "purchase": "https://webnus.net/checkout?edd_action=add_to_cart&download_id=34430549&edd_options[price_id]=1", + "video": "https://youtu.be/y0PrnUvNXN0", + "desc": "You can use WooCommerce cart to purchase tickets, it means that each ticket is defined as a product. You can purchase ticket and WooCommerce products at the same time.", + "comingsoon": "false", + "pro": "true", + "page": "https://webnus.net/modern-events-calendar/addons/woocommerce-integration/", + "img": "mec_addon_icon_27.svg" + }, + "2": { + "slug": "mec-shortcode-builder", + "name": "Elementor Shortcode Builder", + "version": "1.5.0", + "purchase": "https://webnus.net/checkout?edd_action=add_to_cart&download_id=34430567&edd_options[price_id]=1", + "video": "https://youtu.be/HyvApwsB70w", + "desc": "It enables you to create shortcodes in Elementor Live Editor. Adding this widget to your pages allows previewing the events and placing the shortcodes in pages with ease.", + "comingsoon": "false", + "pro": "false", + "page": "https://webnus.net/modern-events-calendar/addons/elementor-shortcode-builder/", + "img": "mec_addon_icon_40.svg" + }, + "3": { + "slug": "mec-form-builder", + "name": "Elementor Form Builder", + "version": "1.1.0", + "purchase": "https://webnus.net/checkout?edd_action=add_to_cart&download_id=34430581&edd_options[price_id]=1", + "video": "https://youtu.be/ejHnD20XuYs", + "desc": "Use this Add-on to build your form in Elementor Editor. It allows you to use many different type of fields and rearrange them by drag and drop and modify their styles.", + "comingsoon": "false", + "pro": "true", + "page": "https://webnus.net/modern-events-calendar/addons/elementor-form-builder/", + "img": "mec_addon_icon_37.svg" + }, + "4": { + "slug": "mec-single-builder", + "name": "Elementor Single Builder", + "version": "1.5.1", + "purchase": "https://webnus.net/checkout?edd_action=add_to_cart&download_id=34430593&edd_options[price_id]=1", + "video": "https://youtu.be/UTbFwEXTZAA", + "desc": "It provides you with the ability to edit single event page using Elementor. Manage the position of all elements in the Single page and in desktops, mobiles and tablets as well.", + "comingsoon": "false", + "pro": "false", + "page": "https://webnus.net/modern-events-calendar/addons/elementor-single-builder/", + "img": "mec_addon_icon_39.svg" + }, + "5": { + "slug": "mec-event-api", + "name": "Event API", + "version": "1.0.8", + "purchase": "https://webnus.net/checkout?edd_action=add_to_cart&download_id=34430602&edd_options[price_id]=1", + "video": "https://www.youtube.com/watch?v=dX5gUB7E_nk", + "desc": "It allows you to display your website events (shortcodes/single event) on other websites without installing MEC. You can even use JSON output features to make your Apps compatible with MEC.", + "comingsoon": "false", + "pro": "false", + "page": "https://webnus.net/modern-events-calendar/addons/event-api/", + "img": "event-api.svg" + }, + "6": { + "slug": "mec-multisite-event-sync", + "name": "Multisite Event Sync", + "version": "1.0.3", + "purchase": "https://webnus.net/checkout?edd_action=add_to_cart&download_id=34430589&edd_options[price_id]=1", + "video": "https://youtu.be/BTAa7_slVs8", + "desc": "You can now sync events in your subsites with the main website and any changes to the main website is inherited by the subsites. You can select the subsites to be synced in admin panel.", + "comingsoon": "false", + "pro": "false", + "page": "https://webnus.net/modern-events-calendar/addons/multisite-event-sync/", + "img": "multi-site-3.svg" + }, + "7": { + "slug": "mec-user-dashboard", + "name": "User Dashboard", + "version": "1.1.6", + "purchase": "https://webnus.net/checkout?edd_action=add_to_cart&download_id=34430571&edd_options[price_id]=1", + "video": "https://youtu.be/q1fEeGLlfEk", + "desc": "Using this addon, you can create a specific page for each user. It contains information about purchased tickets, registered events and many more. Users can now log in to purchase tickets.", + "comingsoon": "false", + "pro": "false", + "page": "https://webnus.net/modern-events-calendar/addons/user-dashboard/", + "img": "user-dashboard.svg" + }, + "8": { + "slug": "mec-shortcode-designer", + "name": "Elementor Shortcode Designer", + "version": "1.1.5", + "purchase": "https://webnus.net/checkout?edd_action=add_to_cart&download_id=34430537&edd_options[price_id]=1", + "video": "https://youtu.be/X4i-0zxxuFc", + "desc": "It allows you to create unlimited custom shortcodes. You can include any elements you wish with the intended style and positioning by simply drag and dropping them in Elementor.", + "comingsoon": "false", + "pro": "false", + "page": "https://webnus.net/modern-events-calendar/addons/elementor-shortcode-designer/", + "img": "mec-shortcode-designer-addon-icon.svg" + }, + "9": { + "slug": "mec-invoice", + "name": "Ticket and Invoice", + "version": "1.2.2", + "purchase": "https://webnus.net/checkout?edd_action=add_to_cart&download_id=34430615&edd_options[price_id]=1", + "video": "https://youtu.be/JH0jSFzM57s", + "desc": "This addon enables you to manage invoices. it allows custom styling with Elementor Page Builder, check-in using QR code, generating HTML invoices, and much more.", + "comingsoon": "false", + "pro": "true", + "page": "https://webnus.net/modern-events-calendar/addons/ticket-invoice/", + "img": "invoice-5.svg" + }, + "10": { + "slug": "mec-advanced-map", + "name": "Advanced Map", + "version": "1.0.1", + "purchase": "https://webnus.net/checkout?edd_action=add_to_cart&download_id=34430606&edd_options[price_id]=1", + "video": "https://www.youtube.com/watch?v=-G75aV542FI", + "desc": "Now you can use OpenStreetMap instead of Google Maps and enjoy new features such as Street, Region, etc. for detailed and precise filtering. Display filters and events next to the map in a new view.", + "comingsoon": "false", + "pro": "true", + "page": "https://webnus.net/modern-events-calendar/addons/advanced-map/", + "img": "advanced-map-2.svg" + }, + "11": { + "slug": "mec-advanced-reports", + "name": "Advanced Reports", + "version": "1.0.8", + "purchase": "https://webnus.net/checkout?edd_action=add_to_cart&download_id=34430504&edd_options[price_id]=1", + "video": "https://www.youtube.com/watch?v=TGC63V5aznM", + "desc": "Enjoy an advanced report page in the backend, with more features. The attendee table and graphs can be filtered based on date. You can also view a list of attendees for each event based on date.", + "comingsoon": "false", + "pro": "true", + "page": "https://webnus.net/modern-events-calendar/addons/advanced-reports/", + "img": "advanced-report.svg" + }, + "12": { + "slug": "mec-fluent-layouts", + "name": "Fluent-view Layouts", + "version": "1.2.1", + "purchase": "https://webnus.net/checkout?edd_action=add_to_cart&download_id=34430575&edd_options[price_id]=1", + "video": "https://www.youtube.com/watch?v=kCBw5UF1tlk", + "desc": "These skins are designed based the most recent design trends. The add-on can magically turn the view of your calendar.", + "comingsoon": "false", + "pro": "false", + "page": "https://webnus.net/modern-events-calendar/addons/fluent-view-layouts/", + "img": "fluent-view.svg" + }, + "13": { + "slug": "mec-zapier", + "name": "Zapier Integration", + "version": "1.0.2", + "purchase": "https://webnus.net/checkout?edd_action=add_to_cart&download_id=34430557&edd_options[price_id]=1", + "video": "https://www.youtube.com/watch?v=vDwox71ajig", + "desc": "This addon enables you to create your own Zap with Mailchimp, active campaign, meetup, Eventbrite and many other apps when an event is added, edited, canceled, or booked.", + "comingsoon": "false", + "pro": "true", + "page": "https://webnus.net/modern-events-calendar/addons/zapier-integration/", + "img": "zapier-integration01.svg" + }, + "14": { + "slug": "mec-virtual-events", + "name": "Virtual Events", + "version": "1.1.0", + "purchase": "https://webnus.net/checkout?edd_action=add_to_cart&download_id=34430527&edd_options[price_id]=1", + "video": "https://www.youtube.com/watch?v=7ESpENaGt3M", + "desc": "This addon allows you to turn your events into virtual ones and provide an embeded link or directed link and password of your online event to your attendees.", + "comingsoon": "false", + "pro": "false", + "page": "https://webnus.net/modern-events-calendar/addons/virtual-events/", + "img": "virtual-events.svg" + }, + "15": { + "slug": "mec-waiting-list", + "name": "Waiting List", + "version": "1.0.1", + "purchase": "https://webnus.net/checkout?edd_action=add_to_cart&download_id=34430541&edd_options[price_id]=1", + "video": "https://www.youtube.com/watch?v=IoUQWTBK6gQ", + "desc": "This addon enables you to create a waiting form after selling out the tickets, so people can reserve one in case one of the attendees cancel their reservation.", + "comingsoon": "false", + "pro": "true", + "page": "https://webnus.net/modern-events-calendar/addons/waiting-list/", + "img": "waiting-list-icon.svg" + }, + "16": { + "slug": "mec-divi-single-builder", + "name": "Divi Single Builder", + "version": "1.0.2", + "purchase": "https://webnus.net/checkout?edd_action=add_to_cart&download_id=34430545&edd_options[price_id]=1", + "video": "https://www.youtube.com/watch?v=tVY-puNJs6s", + "desc": "It provides you with the ability to edit single event page using Divi. Manage the position of all elements in the Single page and in desktops, mobiles and tablets as well.", + "comingsoon": "false", + "pro": "false", + "page": "https://webnus.net/modern-events-calendar/addons/divi-single-builder/", + "img": "divi-single-builder-addon.svg" + }, + "17": { + "slug": "mec-zoom-integration", + "name": "Zoom Integration", + "version": "1.0.1", + "purchase": "https://webnus.net/checkout?edd_action=add_to_cart&download_id=34430585&edd_options[price_id]=1", + "video": "https://www.youtube.com/watch?v=oFaVyvTLSkQ", + "desc": "With this add-on you can show your users the information regarding your meetings and webinars. Provide the users with an embedded code of your event link plus username and password.", + "comingsoon": "false", + "pro": "false", + "page": "https://webnus.net/modern-events-calendar/addons/zoom-integration/", + "img": "zoom-integration-addon.svg" + }, + "18": { + "slug": "mec-advanced-organizer", + "name": "Advanced Organizer", + "version": "1.0.1", + "purchase": "https://webnus.net/checkout?edd_action=add_to_cart&download_id=34430506&edd_options[price_id]=1", + "video": "https://www.youtube.com/watch?v=fsxtjDtrfd4", + "desc": "You can now create an exclusive page for every organizer and have a list of organizers wherever you like using a shortcode. You can also display organizers in a slider format.", + "comingsoon": "false", + "pro": "false", + "page": "https://webnus.net/modern-events-calendar/addons/advanced-organizer/", + "img": "advanced-organizer01.svg" + }, + "19": { + "slug": "mec-advanced-speaker", + "name": "Advanced Speaker", + "version": "1.0.1", + "purchase": "https://webnus.net/checkout?edd_action=add_to_cart&download_id=34430523&edd_options[price_id]=1", + "video": "https://www.youtube.com/watch?v=1BpdikYZmm4", + "desc": "You can now create an exclusive page for every speaker and have a list of speakers wherever you like using a shortcode. You can also display speakers in a slider format.", + "comingsoon": "false", + "pro": "false", + "page": "https://webnus.net/modern-events-calendar/addons/advanced-speaker/", + "img": "advanced-speaker01.svg" + }, + "20": { + "slug": "mec-advanced-location", + "name": "Advanced Location", + "version": "1.0.1", + "purchase": "https://webnus.net/checkout?edd_action=add_to_cart&download_id=34430508&edd_options[price_id]=1", + "video": "https://www.youtube.com/watch?v=4R1UYKTAkKc", + "desc": "You can now create an exclusive page for every location and have a list of locations wherever you like using a shortcode. You can also display locations in a slider format.", + "comingsoon": "false", + "pro": "false", + "page": "https://webnus.net/modern-events-calendar/addons/advanced-location/", + "img": "advanced-location01.svg" + }, + "21": { + "slug": "mec-advanced-importer", + "name": "Advanced Importer", + "version": "1.0.0", + "purchase": "https://webnus.net/checkout?edd_action=add_to_cart&download_id=34430561&edd_options[price_id]=1", + "video": "https://www.youtube.com/watch?v=VxvVDk_n1_A", + "desc": "With this addon, you can connect to Facebook, Google, Meetup, and Eventbrite and etc… unlimitedly. This makes the import process so easy.", + "comingsoon": "false", + "pro": "false", + "page": "https://webnus.net/modern-events-calendar/addons/advanced-importer/", + "img": "advanced-importer-addon-icon.svg" + }, + "22": { + "slug": "mec-rsvp", + "name": "RSVP Events", + "version": "1.1.0", + "purchase": "https://webnus.net/checkout?edd_action=add_to_cart&download_id=34430611&edd_options[price_id]=1", + "video": "https://youtu.be/naFOTICC8os", + "desc": "Would you like your attendees to be able to RSVP to event so you know who goes to the event? RSVP event is here to do that for you like a charm.", + "comingsoon": "false", + "pro": "false", + "page": "https://webnus.net/modern-events-calendar/addons/rsvp-events/", + "img": "rsvp-event-addon.svg" + }, + "23": { + "slug": "mec-buddyboss", + "name": "BuddyBoss Integration", + "version": "1.0.0", + "purchase": "https://webnus.net/checkout?edd_action=add_to_cart&download_id=34430553&edd_options[price_id]=1", + "video": "https://www.youtube.com/watch?v=4Aun31CnETo", + "desc": "You can assign events to your groups and each group has its own events. Different individuals can submit events and display them in the groups.", + "comingsoon": "false", + "pro": "false", + "page": "https://webnus.net/modern-events-calendar/addons/buddyboss-integration/", + "img": "buddyboss-integration-addon.svg" + }, + "24": { + "slug": "mec-social-poster", + "name": "Social Auto Poster", + "version": "1.0.0", + "purchase": "https://webnus.net/checkout?edd_action=add_to_cart&download_id=34435919&edd_options[price_id]=1", + "video": "https://www.youtube.com/watch?v=cpxThz7GgAY", + "desc": "Using this addon, you can share your events on your socials easily and automatically. Everything will be easy for you with this addon. ", + "comingsoon": "false", + "pro": "false", + "page": "https://webnus.net/modern-events-calendar/addons/social-auto-poster/", + "img": "social-poster-addon.svg" + }, + "25": { + "slug": "mec-webex-integration", + "name": "Webex Integration", + "version": "1.0.0", + "purchase": "https://webnus.net/checkout?edd_action=add_to_cart&download_id=34433684&edd_options[price_id]=1", + "video": "https://www.youtube.com/watch?v=Rw5Q-4Zvvew", + "desc": "You can show the meetings' and webinars' information to your users, provide them with an embedded code that links to the event, plus containing username and password.", + "comingsoon": "false", + "pro": "false", + "page": "https://webnus.net/modern-events-calendar/addons/webex-integration/", + "img": "webex-integration-addon.svg" + }, + "26": { + "slug": "mec-fes-builder", + "name": "Elementor FES Builder", + "version": "1.0.0", + "purchase": "https://webnus.net/checkout?edd_action=add_to_cart&download_id=34437588&edd_options[price_id]=1", + "video": "https://www.youtube.com/watch?v=yv56td1c9AM", + "desc": "This addon enables you to build your frontend event submission form with Elementor Editor. It also gives you the possibility to use various types of fields and drag and drop them anywhere.", + "comingsoon": "false", + "pro": "false", + "page": "https://webnus.net/modern-events-calendar/addons/elementor-frontend-event-submission-builder", + "img": "elementor-fes-builder.svg" + }, + "27": { + "slug": "mec-seat", + "name": "Seat", + "version": "1.0.0", + "purchase": "https://webnus.net/checkout?edd_action=add_to_cart&download_id=34436692&edd_options[price_id]=1", + "video": "https://www.youtube.com/watch?v=hSa9d30AvLA", + "desc": "With this addon you can define a layout for your venue and then set various prices for different rows and have users pick their own spot and purchase the ticket.", + "comingsoon": "false", + "pro": "true", + "page": "https://webnus.net/modern-events-calendar/addons/seat/", + "img": "seat-addon-icon.svg" + }, + "28": { + "slug": "mec-gutenberg-single-builder", + "name": "Gutenberg Single Builder", + "version": "1.0.0", + "purchase": "https://webnus.net/checkout?edd_action=add_to_cart&download_id=34437586&edd_options[price_id]=1", + "video": "https://www.youtube.com/watch?v=_yBVzi09whU", + "desc": "This addon gives you the option to edit the Single Event Page using Gutenberg. You can manage the position of all elements of the Event Page whether on desktop, mobile or tablet.", + "comingsoon": "false", + "pro": "false", + "page": "https://webnus.net/modern-events-calendar/addons/gutenberg-single-builder/", + "img": "mec-gutenberg-single-builder.svg" + }, + "29": { + "slug": "mec-square-payment", + "name": "Square Payment", + "version": "1.0.0", + "purchase": "https://webnus.net/checkout?edd_action=add_to_cart&download_id=34437587&edd_options[price_id]=1", + "video": "https://www.youtube.com/watch?v=JQsKSo8FGDw", + "desc": "This addon enables your users to pay for their tickets using Square Payment Gateway. It will be added as an option to Booking Payments and you can enable it whenever you need it.", + "comingsoon": "false", + "pro": "true", + "page": "https://webnus.net/modern-events-calendar/addons/square-payment/", + "img": "square-integration-addon.svg" + }, + "30": { + "slug": "", + "name": "Liquid-view Layouts", + "version": "1.0.0", + "purchase": "https://webnus.net/checkout?edd_action=add_to_cart&download_id=34437589&edd_options[price_id]=1", + "video": "https://www.youtube.com/watch?v=PU-N_GT0OqM", + "desc": "Brand new skins coming from the future! The skins have been designed according to the latest trends. With this addon you can magically transform the look of your calendar with its 20+ skins for all shortcodes.", + "comingsoon": "false", + "pro": "false", + "page": "https://webnus.net/modern-events-calendar/addons/liquid-view-layout", + "img": "liquid-view-layouts.svg" + } +} diff --git a/app/api/addons-api/advanced-importer-addon-icon.svg b/app/api/addons-api/advanced-importer-addon-icon.svg new file mode 100755 index 0000000..a0f2200 --- /dev/null +++ b/app/api/addons-api/advanced-importer-addon-icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/api/addons-api/advanced-location01.svg b/app/api/addons-api/advanced-location01.svg new file mode 100755 index 0000000..ba3fc25 --- /dev/null +++ b/app/api/addons-api/advanced-location01.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/api/addons-api/advanced-map-2.svg b/app/api/addons-api/advanced-map-2.svg new file mode 100755 index 0000000..2079723 --- /dev/null +++ b/app/api/addons-api/advanced-map-2.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/api/addons-api/advanced-organizer01.svg b/app/api/addons-api/advanced-organizer01.svg new file mode 100755 index 0000000..60b88e7 --- /dev/null +++ b/app/api/addons-api/advanced-organizer01.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/api/addons-api/advanced-report.svg b/app/api/addons-api/advanced-report.svg new file mode 100755 index 0000000..3f98d28 --- /dev/null +++ b/app/api/addons-api/advanced-report.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/api/addons-api/advanced-speaker01.svg b/app/api/addons-api/advanced-speaker01.svg new file mode 100755 index 0000000..7798b8a --- /dev/null +++ b/app/api/addons-api/advanced-speaker01.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/api/addons-api/blackfriday.json b/app/api/addons-api/blackfriday.json new file mode 100755 index 0000000..b8eeac4 --- /dev/null +++ b/app/api/addons-api/blackfriday.json @@ -0,0 +1,3 @@ +[{ + "html": "
Announcement


Webnus Black Friday 2021 Sales!

Huge Discount for New Packages & Bundles

We are introducing a lot of new packages and bundles with unbelievable discounts. Our Black Friday is already live and you only have a few more days to use the opportunity. These bundles are both for Developers, who need licenses in bulk from 40 licenses in one bundle to 100 licenses for all our products, and users who need a few licenses. For our users, we have prepared packages from 2 licenses to 30 licenses. The discount is for special packages up to 98% off.

Find out more
","display": "1" +}] \ No newline at end of file diff --git a/app/api/addons-api/buddyboss-integration-addon.svg b/app/api/addons-api/buddyboss-integration-addon.svg new file mode 100755 index 0000000..42ea96f --- /dev/null +++ b/app/api/addons-api/buddyboss-integration-addon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/api/addons-api/divi-single-builder-addon.svg b/app/api/addons-api/divi-single-builder-addon.svg new file mode 100755 index 0000000..5afcd96 --- /dev/null +++ b/app/api/addons-api/divi-single-builder-addon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/api/addons-api/elementor-fes-builder.svg b/app/api/addons-api/elementor-fes-builder.svg new file mode 100755 index 0000000..713463c --- /dev/null +++ b/app/api/addons-api/elementor-fes-builder.svg @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/api/addons-api/event-api.svg b/app/api/addons-api/event-api.svg new file mode 100755 index 0000000..5454f2a --- /dev/null +++ b/app/api/addons-api/event-api.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/api/addons-api/fluent-view.svg b/app/api/addons-api/fluent-view.svg new file mode 100755 index 0000000..79ee16b --- /dev/null +++ b/app/api/addons-api/fluent-view.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/api/addons-api/gutenberg-single -builder-addon.svg b/app/api/addons-api/gutenberg-single -builder-addon.svg new file mode 100755 index 0000000..ab057c9 --- /dev/null +++ b/app/api/addons-api/gutenberg-single -builder-addon.svg @@ -0,0 +1,46 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/api/addons-api/index.html b/app/api/addons-api/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/api/addons-api/invoice-5.svg b/app/api/addons-api/invoice-5.svg new file mode 100755 index 0000000..4bb6103 --- /dev/null +++ b/app/api/addons-api/invoice-5.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/api/addons-api/liquid-view-layouts.svg b/app/api/addons-api/liquid-view-layouts.svg new file mode 100755 index 0000000..3d89fdd --- /dev/null +++ b/app/api/addons-api/liquid-view-layouts.svg @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/api/addons-api/mec-extra-content-2.json b/app/api/addons-api/mec-extra-content-2.json new file mode 100755 index 0000000..2d4cec3 --- /dev/null +++ b/app/api/addons-api/mec-extra-content-2.json @@ -0,0 +1,5 @@ +[ + { + "display": "1" + } +] diff --git a/app/api/addons-api/mec-extra-content.json b/app/api/addons-api/mec-extra-content.json new file mode 100755 index 0000000..2d4cec3 --- /dev/null +++ b/app/api/addons-api/mec-extra-content.json @@ -0,0 +1,5 @@ +[ + { + "display": "1" + } +] diff --git a/app/api/addons-api/mec-extra-content/5addons-announcement.png b/app/api/addons-api/mec-extra-content/5addons-announcement.png new file mode 100755 index 0000000..ee671d7 Binary files /dev/null and b/app/api/addons-api/mec-extra-content/5addons-announcement.png differ diff --git a/app/api/addons-api/mec-extra-content/7x7-campaign-special-min.png b/app/api/addons-api/mec-extra-content/7x7-campaign-special-min.png new file mode 100755 index 0000000..517acd9 Binary files /dev/null and b/app/api/addons-api/mec-extra-content/7x7-campaign-special-min.png differ diff --git a/app/api/addons-api/mec-extra-content/advanced-importer-addon-banner.png b/app/api/addons-api/mec-extra-content/advanced-importer-addon-banner.png new file mode 100755 index 0000000..88867bb Binary files /dev/null and b/app/api/addons-api/mec-extra-content/advanced-importer-addon-banner.png differ diff --git a/app/api/addons-api/mec-extra-content/advanced-map-addon-share-1-min.jpg b/app/api/addons-api/mec-extra-content/advanced-map-addon-share-1-min.jpg new file mode 100755 index 0000000..143309a Binary files /dev/null and b/app/api/addons-api/mec-extra-content/advanced-map-addon-share-1-min.jpg differ diff --git a/app/api/addons-api/mec-extra-content/advanced-map-addon-share-1.jpg b/app/api/addons-api/mec-extra-content/advanced-map-addon-share-1.jpg new file mode 100755 index 0000000..6e72ba1 Binary files /dev/null and b/app/api/addons-api/mec-extra-content/advanced-map-addon-share-1.jpg differ diff --git a/app/api/addons-api/mec-extra-content/advanced-reports-addon-teaser.png b/app/api/addons-api/mec-extra-content/advanced-reports-addon-teaser.png new file mode 100755 index 0000000..baaeb2a Binary files /dev/null and b/app/api/addons-api/mec-extra-content/advanced-reports-addon-teaser.png differ diff --git a/app/api/addons-api/mec-extra-content/bf-2021-pop-bg3.png b/app/api/addons-api/mec-extra-content/bf-2021-pop-bg3.png new file mode 100755 index 0000000..9779a03 Binary files /dev/null and b/app/api/addons-api/mec-extra-content/bf-2021-pop-bg3.png differ diff --git a/app/api/addons-api/mec-extra-content/bfcm2022-mec-bknd-1-min.png b/app/api/addons-api/mec-extra-content/bfcm2022-mec-bknd-1-min.png new file mode 100755 index 0000000..6b0674d Binary files /dev/null and b/app/api/addons-api/mec-extra-content/bfcm2022-mec-bknd-1-min.png differ diff --git a/app/api/addons-api/mec-extra-content/black-f-banner-1.png b/app/api/addons-api/mec-extra-content/black-f-banner-1.png new file mode 100755 index 0000000..9b6f93b Binary files /dev/null and b/app/api/addons-api/mec-extra-content/black-f-banner-1.png differ diff --git a/app/api/addons-api/mec-extra-content/black-friday-2021-3-min.jpg b/app/api/addons-api/mec-extra-content/black-friday-2021-3-min.jpg new file mode 100755 index 0000000..7875756 Binary files /dev/null and b/app/api/addons-api/mec-extra-content/black-friday-2021-3-min.jpg differ diff --git a/app/api/addons-api/mec-extra-content/black-friday-2021-ntf1-min.jpg b/app/api/addons-api/mec-extra-content/black-friday-2021-ntf1-min.jpg new file mode 100755 index 0000000..65c5139 Binary files /dev/null and b/app/api/addons-api/mec-extra-content/black-friday-2021-ntf1-min.jpg differ diff --git a/app/api/addons-api/mec-extra-content/black-friday-2021-ntf2-min.jpg b/app/api/addons-api/mec-extra-content/black-friday-2021-ntf2-min.jpg new file mode 100755 index 0000000..edbf2c5 Binary files /dev/null and b/app/api/addons-api/mec-extra-content/black-friday-2021-ntf2-min.jpg differ diff --git a/app/api/addons-api/mec-extra-content/buddyboss-addon-banner.png b/app/api/addons-api/mec-extra-content/buddyboss-addon-banner.png new file mode 100755 index 0000000..56b9be8 Binary files /dev/null and b/app/api/addons-api/mec-extra-content/buddyboss-addon-banner.png differ diff --git a/app/api/addons-api/mec-extra-content/c7x7-ans1.png b/app/api/addons-api/mec-extra-content/c7x7-ans1.png new file mode 100755 index 0000000..57e6139 Binary files /dev/null and b/app/api/addons-api/mec-extra-content/c7x7-ans1.png differ diff --git a/app/api/addons-api/mec-extra-content/divi-single-builder-addon-banner.png b/app/api/addons-api/mec-extra-content/divi-single-builder-addon-banner.png new file mode 100755 index 0000000..c00e10d Binary files /dev/null and b/app/api/addons-api/mec-extra-content/divi-single-builder-addon-banner.png differ diff --git a/app/api/addons-api/mec-extra-content/elementor-fes-builder.svg b/app/api/addons-api/mec-extra-content/elementor-fes-builder.svg new file mode 100755 index 0000000..1625dea --- /dev/null +++ b/app/api/addons-api/mec-extra-content/elementor-fes-builder.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/api/addons-api/mec-extra-content/index.html b/app/api/addons-api/mec-extra-content/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/api/addons-api/mec-extra-content/invoice-addon-share-min.png b/app/api/addons-api/mec-extra-content/invoice-addon-share-min.png new file mode 100755 index 0000000..3de23e2 Binary files /dev/null and b/app/api/addons-api/mec-extra-content/invoice-addon-share-min.png differ diff --git a/app/api/addons-api/mec-extra-content/liquid-view-layouts.svg b/app/api/addons-api/mec-extra-content/liquid-view-layouts.svg new file mode 100755 index 0000000..3d89fdd --- /dev/null +++ b/app/api/addons-api/mec-extra-content/liquid-view-layouts.svg @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/api/addons-api/mec-extra-content/lite-new-update-announcement.png b/app/api/addons-api/mec-extra-content/lite-new-update-announcement.png new file mode 100755 index 0000000..0bad882 Binary files /dev/null and b/app/api/addons-api/mec-extra-content/lite-new-update-announcement.png differ diff --git a/app/api/addons-api/mec-extra-content/lite-update.jpg b/app/api/addons-api/mec-extra-content/lite-update.jpg new file mode 100755 index 0000000..4dbb62a Binary files /dev/null and b/app/api/addons-api/mec-extra-content/lite-update.jpg differ diff --git a/app/api/addons-api/mec-extra-content/mec-covid 19.png b/app/api/addons-api/mec-extra-content/mec-covid 19.png new file mode 100755 index 0000000..b718f3f Binary files /dev/null and b/app/api/addons-api/mec-extra-content/mec-covid 19.png differ diff --git a/app/api/addons-api/mec-extra-content/mec-fluent-view.jpg b/app/api/addons-api/mec-extra-content/mec-fluent-view.jpg new file mode 100755 index 0000000..d720588 Binary files /dev/null and b/app/api/addons-api/mec-extra-content/mec-fluent-view.jpg differ diff --git a/app/api/addons-api/mec-extra-content/mec-ft-req-banner.png b/app/api/addons-api/mec-extra-content/mec-ft-req-banner.png new file mode 100755 index 0000000..36e1c1c Binary files /dev/null and b/app/api/addons-api/mec-extra-content/mec-ft-req-banner.png differ diff --git a/app/api/addons-api/mec-extra-content/mec-gutenberg-single-builder.svg b/app/api/addons-api/mec-extra-content/mec-gutenberg-single-builder.svg new file mode 100755 index 0000000..ff996c6 --- /dev/null +++ b/app/api/addons-api/mec-extra-content/mec-gutenberg-single-builder.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/api/addons-api/mec-extra-content/mec-notif-banner-1.png b/app/api/addons-api/mec-extra-content/mec-notif-banner-1.png new file mode 100755 index 0000000..3d8ac5e Binary files /dev/null and b/app/api/addons-api/mec-extra-content/mec-notif-banner-1.png differ diff --git a/app/api/addons-api/mec-extra-content/mec-notif-banner-11.png b/app/api/addons-api/mec-extra-content/mec-notif-banner-11.png new file mode 100755 index 0000000..3d8ac5e Binary files /dev/null and b/app/api/addons-api/mec-extra-content/mec-notif-banner-11.png differ diff --git a/app/api/addons-api/mec-extra-content/photo_2022-01-10_16-33-18.jpg b/app/api/addons-api/mec-extra-content/photo_2022-01-10_16-33-18.jpg new file mode 100755 index 0000000..5fb9cc1 Binary files /dev/null and b/app/api/addons-api/mec-extra-content/photo_2022-01-10_16-33-18.jpg differ diff --git a/app/api/addons-api/mec-extra-content/rsvp-events-addon-banner.png b/app/api/addons-api/mec-extra-content/rsvp-events-addon-banner.png new file mode 100755 index 0000000..9b4e7b2 Binary files /dev/null and b/app/api/addons-api/mec-extra-content/rsvp-events-addon-banner.png differ diff --git a/app/api/addons-api/mec-extra-content/seat-addon-icon.svg b/app/api/addons-api/mec-extra-content/seat-addon-icon.svg new file mode 100755 index 0000000..ac7066d --- /dev/null +++ b/app/api/addons-api/mec-extra-content/seat-addon-icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/api/addons-api/mec-extra-content/social-poster-addon.svg b/app/api/addons-api/mec-extra-content/social-poster-addon.svg new file mode 100755 index 0000000..b299eab --- /dev/null +++ b/app/api/addons-api/mec-extra-content/social-poster-addon.svg @@ -0,0 +1 @@ +19 \ No newline at end of file diff --git a/app/api/addons-api/mec-extra-content/square-integration-addon.svg b/app/api/addons-api/mec-extra-content/square-integration-addon.svg new file mode 100755 index 0000000..b28ad90 --- /dev/null +++ b/app/api/addons-api/mec-extra-content/square-integration-addon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/api/addons-api/mec-extra-content/style2.css b/app/api/addons-api/mec-extra-content/style2.css new file mode 100755 index 0000000..b8b99c3 --- /dev/null +++ b/app/api/addons-api/mec-extra-content/style2.css @@ -0,0 +1,138 @@ +#webnus-dashboard .mec-cmsg-2-notification-box-wrap,#webnus-dashboard .mec-cmsg-notification-box-wrap { + margin-top:30px !important; +} + +body[class^="page_MEC-settings"] .w-clearfix.w-box.mec-cmsg-notification-box-wrap { + margin-top: 0; +} +body[class*="page_MEC-settings"] .mec-custom-msg-notification-set-box.extra, body[class*="page_MEC-settings"] .mec-custom-msg-2-notification-set-box.extra{ + font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",Oxygen,Roboto,sans-serif; + max-width:1018px; + border-radius: 11px; + overflow:hidden; + margin-right: auto; + margin-left: auto; + margin-top:25px; + margin-bottom:27px +} +.mec-addons-key-features ul { + margin: 5px 0 15px; +} +.mec-addons-key-features ul li { + margin-bottom: 1px; + font-size: 13px; + color: #717479; + padding-left: 18px; + position: relative; +} +.mec-addons-notification-box-content.mec-new-addons p{ + font-size:14px; +} +.mec-new-addons .mec-addons-notification-title { + font-size: 20px; + font-weight: 600; + margin-bottom: 12px; +} +.mec-addons-key-features ul li:before { + position: absolute; + left: -1px; + top: 6px; + color: #36da74; + background: none; + font-size: 13px; + font-weight: bold; + vertical-align: middle; + font-family: "simple-line-icons"; + border-radius: 50%; + padding: 0; + width: 13px; + height: 13px; + line-height: 13px; + z-index: 3; + background: rgba(64, 241, 147, 0.12); + content: "\e080"; +} + +.mec-addons-notification-box-content.mec-new-addons a { + background: #1fcae4; + color: #fff!important; + padding: 6px 20px; + margin-top: 3px; + margin-bottom: 12px; + display: inline-block; + border-radius: 60px; + text-transform: none; + font-size: 13px; + letter-spacing: .4px; + transition: all .1s ease; + font-weight: 600; + text-decoration: none; + box-shadow: 0 0 0 3px rgb(56 213 237 / 8%) !important; +} + +.mec-addons-notification-box-content.mec-new-addons a:hover { + background: #1fcae4; + box-shadow: 0 0 0 4px rgb(56 213 237 / 15%) !important; +} + +.mec-new-addons-wrap .mec-addons-notification-box-image { + width: 590px; + display: inline-block; + vertical-align: top; +} +body[class*="page_MEC-settings"] .mec-new-addons-wrap .mec-addons-notification-box-image { + width: 450px; +} + +.mec-new-addons-wrap .mec-addons-notification-box-content { + width: calc(100% - 590px); + display: inline-block; + padding-left: 20px; +} + +.mec-new-addons-wrap .mec-addons-notification-box-image img { + max-width: 590px; +} +body[class*="page_MEC-settings"] .mec-new-addons-wrap .mec-addons-notification-box-image img { + max-width: 450px; +} + +body[class*="page_MEC-settings"] .mec-new-addons-wrap .mec-addons-notification-box-content { + width: calc(100% - 470px); +} +.mec-new-addons-wrap .w-box-content code { + display: block; + margin-bottom: 6px; +} + +@media(max-width:480px) { + + .mec-new-addons-wrap .mec-addons-notification-box-content { + width: 100%; + padding: 0; + } + + .mec-addons-notification-box-content .w-box-content { + padding-top: 30px; + padding-bottom: 30px; + padding-left: 0; + } + + .mec-new-addons-wrap .mec-addons-notification-box-image { + width: 100% !important; + } + + body[class*="page_MEC-settings"] .mec-new-addons-wrap .mec-addons-notification-box-content { + width: 100% !important; + padding: 0 !important; + } + + body[class*="page_MEC-settings"] .mec-new-addons-wrap .mec-addons-notification-box-content .w-box-content { + padding: 0; + } + +} + +#webnus-dashboard .mec-new-addons-wrap { + margin-top: 30px !important; +} \ No newline at end of file diff --git a/app/api/addons-api/mec-extra-content/virtual-events-addon-banner.png b/app/api/addons-api/mec-extra-content/virtual-events-addon-banner.png new file mode 100755 index 0000000..612d7c6 Binary files /dev/null and b/app/api/addons-api/mec-extra-content/virtual-events-addon-banner.png differ diff --git a/app/api/addons-api/mec-extra-content/waiting-list-addon-banner.png b/app/api/addons-api/mec-extra-content/waiting-list-addon-banner.png new file mode 100755 index 0000000..50093ab Binary files /dev/null and b/app/api/addons-api/mec-extra-content/waiting-list-addon-banner.png differ diff --git a/app/api/addons-api/mec-extra-content/zapier-integration-addon-banner1.png b/app/api/addons-api/mec-extra-content/zapier-integration-addon-banner1.png new file mode 100755 index 0000000..3282546 Binary files /dev/null and b/app/api/addons-api/mec-extra-content/zapier-integration-addon-banner1.png differ diff --git a/app/api/addons-api/mec-extra-content/zoom-integration-addon-banner.png b/app/api/addons-api/mec-extra-content/zoom-integration-addon-banner.png new file mode 100755 index 0000000..9301f31 Binary files /dev/null and b/app/api/addons-api/mec-extra-content/zoom-integration-addon-banner.png differ diff --git a/app/api/addons-api/mec-gutenberg-single-builder.svg b/app/api/addons-api/mec-gutenberg-single-builder.svg new file mode 100755 index 0000000..ff996c6 --- /dev/null +++ b/app/api/addons-api/mec-gutenberg-single-builder.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/api/addons-api/mec-shortcode-designer-addon-icon.svg b/app/api/addons-api/mec-shortcode-designer-addon-icon.svg new file mode 100755 index 0000000..37d0e0b --- /dev/null +++ b/app/api/addons-api/mec-shortcode-designer-addon-icon.svg @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/api/addons-api/mec_addon_icon_27.svg b/app/api/addons-api/mec_addon_icon_27.svg new file mode 100755 index 0000000..b8d7f63 --- /dev/null +++ b/app/api/addons-api/mec_addon_icon_27.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/api/addons-api/mec_addon_icon_37.svg b/app/api/addons-api/mec_addon_icon_37.svg new file mode 100755 index 0000000..b267900 --- /dev/null +++ b/app/api/addons-api/mec_addon_icon_37.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/api/addons-api/mec_addon_icon_39.svg b/app/api/addons-api/mec_addon_icon_39.svg new file mode 100755 index 0000000..ef5310f --- /dev/null +++ b/app/api/addons-api/mec_addon_icon_39.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/api/addons-api/mec_addon_icon_40.svg b/app/api/addons-api/mec_addon_icon_40.svg new file mode 100755 index 0000000..896a260 --- /dev/null +++ b/app/api/addons-api/mec_addon_icon_40.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/api/addons-api/multi-site-3.svg b/app/api/addons-api/multi-site-3.svg new file mode 100755 index 0000000..24de626 --- /dev/null +++ b/app/api/addons-api/multi-site-3.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/api/addons-api/rsvp-event-addon.svg b/app/api/addons-api/rsvp-event-addon.svg new file mode 100755 index 0000000..7545906 --- /dev/null +++ b/app/api/addons-api/rsvp-event-addon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/api/addons-api/seat-addon-icon.svg b/app/api/addons-api/seat-addon-icon.svg new file mode 100755 index 0000000..0084990 --- /dev/null +++ b/app/api/addons-api/seat-addon-icon.svg @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/api/addons-api/social-auto-poster-addon.svg b/app/api/addons-api/social-auto-poster-addon.svg new file mode 100755 index 0000000..25dbb9d --- /dev/null +++ b/app/api/addons-api/social-auto-poster-addon.svg @@ -0,0 +1 @@ +19 \ No newline at end of file diff --git a/app/api/addons-api/social-poster-addon.svg b/app/api/addons-api/social-poster-addon.svg new file mode 100755 index 0000000..6ff2788 --- /dev/null +++ b/app/api/addons-api/social-poster-addon.svg @@ -0,0 +1,50 @@ + + + + + + + + + + + + 19 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/api/addons-api/square-integration-addon.svg b/app/api/addons-api/square-integration-addon.svg new file mode 100755 index 0000000..2110a9e --- /dev/null +++ b/app/api/addons-api/square-integration-addon.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/app/api/addons-api/user-dashboard.svg b/app/api/addons-api/user-dashboard.svg new file mode 100755 index 0000000..4cf76e6 --- /dev/null +++ b/app/api/addons-api/user-dashboard.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/api/addons-api/virtual-events.svg b/app/api/addons-api/virtual-events.svg new file mode 100755 index 0000000..36ad5cb --- /dev/null +++ b/app/api/addons-api/virtual-events.svg @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/api/addons-api/waiting-list-icon.svg b/app/api/addons-api/waiting-list-icon.svg new file mode 100755 index 0000000..658f7e5 --- /dev/null +++ b/app/api/addons-api/waiting-list-icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/api/addons-api/webex-integration-addon.svg b/app/api/addons-api/webex-integration-addon.svg new file mode 100755 index 0000000..d932398 --- /dev/null +++ b/app/api/addons-api/webex-integration-addon.svg @@ -0,0 +1,299 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/api/addons-api/zapier-integration01 (1).svg b/app/api/addons-api/zapier-integration01 (1).svg new file mode 100755 index 0000000..114b829 --- /dev/null +++ b/app/api/addons-api/zapier-integration01 (1).svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/api/addons-api/zapier-integration01.svg b/app/api/addons-api/zapier-integration01.svg new file mode 100755 index 0000000..114b829 --- /dev/null +++ b/app/api/addons-api/zapier-integration01.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/api/addons-api/zoom-integration-addon.svg b/app/api/addons-api/zoom-integration-addon.svg new file mode 100755 index 0000000..779cd3b --- /dev/null +++ b/app/api/addons-api/zoom-integration-addon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/api/index.html b/app/api/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/composer.json b/app/composer.json new file mode 100755 index 0000000..b99d37a --- /dev/null +++ b/app/composer.json @@ -0,0 +1,10 @@ +{ + "require": { + "johngrogg/ics-parser": "^2" + }, + "autoload": { + "psr-4": { + "MEC\\":"core/src/" + } + } +} \ No newline at end of file diff --git a/app/composer.lock b/app/composer.lock new file mode 100755 index 0000000..2eac2c3 --- /dev/null +++ b/app/composer.lock @@ -0,0 +1,84 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "82778bfd99b4c915557aac3d1e3871cf", + "packages": [ + { + "name": "johngrogg/ics-parser", + "version": "v2.2.2", + "source": { + "type": "git", + "url": "https://github.com/u01jmg3/ics-parser.git", + "reference": "69c80471a0a99142ebc72b21c2bc084e81a7c4f4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/u01jmg3/ics-parser/zipball/69c80471a0a99142ebc72b21c2bc084e81a7c4f4", + "reference": "69c80471a0a99142ebc72b21c2bc084e81a7c4f4", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": ">=5.3.9" + }, + "require-dev": { + "phpunit/phpunit": "^4", + "squizlabs/php_codesniffer": "~2.9.1" + }, + "type": "library", + "autoload": { + "psr-0": { + "ICal": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jonathan Goode", + "role": "Developer/Owner" + }, + { + "name": "John Grogg", + "email": "john.grogg@gmail.com", + "role": "Developer/Prior Owner" + } + ], + "description": "ICS Parser", + "homepage": "https://github.com/u01jmg3/ics-parser", + "keywords": [ + "iCalendar", + "ical", + "ical-parser", + "ics", + "ics-parser", + "ifb" + ], + "support": { + "issues": "https://github.com/u01jmg3/ics-parser/issues", + "source": "https://github.com/u01jmg3/ics-parser/tree/v2.2.2" + }, + "funding": [ + { + "url": "https://github.com/sponsors/u01jmg3", + "type": "github" + } + ], + "time": "2020-11-02T10:28:33+00:00" + } + ], + "packages-dev": [], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": [], + "platform-dev": [], + "plugin-api-version": "2.3.0" +} diff --git a/app/controller.php b/app/controller.php new file mode 100755 index 0000000..43faaf8 --- /dev/null +++ b/app/controller.php @@ -0,0 +1,18 @@ + + */ +class MEC_controller extends MEC_base +{ + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + } +} \ No newline at end of file diff --git a/app/core/mec.php b/app/core/mec.php new file mode 100755 index 0000000..d510935 --- /dev/null +++ b/app/core/mec.php @@ -0,0 +1,19 @@ +init(); \ No newline at end of file diff --git a/app/core/puc/.editorconfig b/app/core/puc/.editorconfig new file mode 100755 index 0000000..42b7503 --- /dev/null +++ b/app/core/puc/.editorconfig @@ -0,0 +1,15 @@ +[*] +charset=utf-8 +end_of_line=lf +insert_final_newline=false +indent_style=tab +tab_width=4 + +[{phpunit.xml.dist,*.jhm,*.xslt,*.xul,*.rng,*.xsl,*.xsd,*.ant,*.tld,*.fxml,*.jrxml,*.xml,*.jnlp,*.wsdl}] +indent_style=space +indent_size=4 + +[*.svg] +indent_style=space +indent_size=4 + diff --git a/app/core/puc/.gitignore b/app/core/puc/.gitignore new file mode 100755 index 0000000..64255d9 --- /dev/null +++ b/app/core/puc/.gitignore @@ -0,0 +1,40 @@ +# Created by .ignore support plugin (hsz.mobi) +### JetBrains template +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 + +# The entire IDEA/PhpStorm directory +.idea/ + +# CMake +cmake-build-*/ + +# Mongo Explorer plugin +.idea/**/mongoSettings.xml + +# File-based project format +*.iws + +# IntelliJ +out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Cursive Clojure plugin +.idea/replstate.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties +fabric.properties + +# Editor-based Rest Client +.idea/httpRequests + +# Android studio 3.1+ serialized cache file +.idea/caches/build_file_checksums.ser diff --git a/app/core/puc/Puc/v4/Factory.php b/app/core/puc/Puc/v4/Factory.php new file mode 100755 index 0000000..d9e875c --- /dev/null +++ b/app/core/puc/Puc/v4/Factory.php @@ -0,0 +1,6 @@ +rootDir = dirname(__FILE__) . '/'; + $nameParts = explode('_', __CLASS__, 3); + $this->prefix = $nameParts[0] . '_' . $nameParts[1] . '_'; + + $this->libraryDir = $this->rootDir . '../..'; + if ( !self::isPhar() ) { + $this->libraryDir = realpath($this->libraryDir); + } + $this->libraryDir = $this->libraryDir . '/'; + + $this->staticMap = array( + 'PucReadmeParser' => 'vendor/PucReadmeParser.php', + 'Parsedown' => 'vendor/Parsedown.php', + 'Puc_v4_Factory' => 'Puc/v4/Factory.php', + ); + + spl_autoload_register(array($this, 'autoload')); + } + + /** + * Determine if this file is running as part of a Phar archive. + * + * @return bool + */ + private static function isPhar() { + //Check if the current file path starts with "phar://". + static $pharProtocol = 'phar://'; + return (substr(__FILE__, 0, strlen($pharProtocol)) === $pharProtocol); + } + + public function autoload($className) { + if ( isset($this->staticMap[$className]) && file_exists($this->libraryDir . $this->staticMap[$className]) ) { + /** @noinspection PhpIncludeInspection */ + include ($this->libraryDir . $this->staticMap[$className]); + return; + } + + if (strpos($className, $this->prefix) === 0) { + $path = substr($className, strlen($this->prefix)); + $path = str_replace('_', '/', $path); + $path = $this->rootDir . $path . '.php'; + + if (file_exists($path)) { + /** @noinspection PhpIncludeInspection */ + include $path; + } + } + } + } + +endif; diff --git a/app/core/puc/Puc/v4p11/DebugBar/Extension.php b/app/core/puc/Puc/v4p11/DebugBar/Extension.php new file mode 100755 index 0000000..97823de --- /dev/null +++ b/app/core/puc/Puc/v4p11/DebugBar/Extension.php @@ -0,0 +1,190 @@ +updateChecker = $updateChecker; + if ( isset($panelClass) ) { + $this->panelClass = $panelClass; + } + + if ( version_compare(PHP_VERSION, '5.3', '>=') && (strpos($this->panelClass, '\\') === false) ) { + $this->panelClass = __NAMESPACE__ . '\\' . $this->panelClass; + } + + add_filter('debug_bar_panels', array($this, 'addDebugBarPanel')); + add_action('debug_bar_enqueue_scripts', array($this, 'enqueuePanelDependencies')); + + add_action('wp_ajax_puc_v4_debug_check_now', array($this, 'ajaxCheckNow')); + } + + /** + * Register the PUC Debug Bar panel. + * + * @param array $panels + * @return array + */ + public function addDebugBarPanel($panels) { + if ( $this->updateChecker->userCanInstallUpdates() ) { + $panels[] = new $this->panelClass($this->updateChecker); + } + return $panels; + } + + /** + * Enqueue our Debug Bar scripts and styles. + */ + public function enqueuePanelDependencies() { + wp_enqueue_style( + 'puc-debug-bar-style-v4', + $this->getLibraryUrl("/css/puc-debug-bar.css"), + array('debug-bar'), + '20171124' + ); + + wp_enqueue_script( + 'puc-debug-bar-js-v4', + $this->getLibraryUrl("/js/debug-bar.js"), + array('jquery'), + '20201209' + ); + } + + /** + * Run an update check and output the result. Useful for making sure that + * the update checking process works as expected. + */ + public function ajaxCheckNow() { + if ( sanitize_text_field($_POST['uid']) !== $this->updateChecker->getUniqueName('uid') ) { + return; + } + $this->preAjaxRequest(); + $update = $this->updateChecker->checkForUpdates(); + if ( $update !== null ) { + echo "An update is available:"; + echo '
', htmlentities(print_r($update, true)), '
'; + } else { + echo 'No updates found.'; + } + + $errors = $this->updateChecker->getLastRequestApiErrors(); + if ( !empty($errors) ) { + printf('

The update checker encountered %d API error%s.

', count($errors), (count($errors) > 1) ? 's' : ''); + + foreach (array_values($errors) as $num => $item) { + $wpError = $item['error']; + /** @var WP_Error $wpError */ + printf('

%d) %s

', $num + 1, esc_html($wpError->get_error_message())); + + echo '
'; + printf('
Error code:
%s
', esc_html($wpError->get_error_code())); + + if ( isset($item['url']) ) { + printf('
Requested URL:
%s
', esc_html($item['url'])); + } + + if ( isset($item['httpResponse']) ) { + if ( is_wp_error($item['httpResponse']) ) { + $httpError = $item['httpResponse']; + /** @var WP_Error $httpError */ + printf( + '
WordPress HTTP API error:
%s (%s)
', + esc_html($httpError->get_error_message()), + esc_html($httpError->get_error_code()) + ); + } else { + //Status code. + printf( + '
HTTP status:
%d %s
', + wp_remote_retrieve_response_code($item['httpResponse']), + wp_remote_retrieve_response_message($item['httpResponse']) + ); + + //Headers. + echo '
Response headers:
';
+							foreach (wp_remote_retrieve_headers($item['httpResponse']) as $name => $value) {
+								printf("%s: %s\n", esc_html($name), esc_html($value));
+							}
+							echo '
'; + + //Body. + $body = wp_remote_retrieve_body($item['httpResponse']); + if ( $body === '' ) { + $body = '(Empty response.)'; + } else if ( strlen($body) > self::RESPONSE_BODY_LENGTH_LIMIT ) { + $length = strlen($body); + $body = substr($body, 0, self::RESPONSE_BODY_LENGTH_LIMIT) + . sprintf("\n(Long string truncated. Total length: %d bytes.)", $length); + } + + printf('
Response body:
%s
', esc_html($body)); + } + } + echo '
'; + } + } + + exit; + } + + /** + * Check access permissions and enable error display (for debugging). + */ + protected function preAjaxRequest() { + if ( !$this->updateChecker->userCanInstallUpdates() ) { + die('Access denied'); + } + check_ajax_referer('puc-ajax'); + + error_reporting(E_ALL); + @ini_set('display_errors', 'On'); + } + + /** + * Remove hooks that were added by this extension. + */ + public function removeHooks() { + remove_filter('debug_bar_panels', array($this, 'addDebugBarPanel')); + remove_action('debug_bar_enqueue_scripts', array($this, 'enqueuePanelDependencies')); + remove_action('wp_ajax_puc_v4_debug_check_now', array($this, 'ajaxCheckNow')); + } + + /** + * @param string $filePath + * @return string + */ + private function getLibraryUrl($filePath) { + $absolutePath = realpath(dirname(__FILE__) . '/../../../' . ltrim($filePath, '/')); + + //Where is the library located inside the WordPress directory structure? + $absolutePath = Puc_v4p11_Factory::normalizePath($absolutePath); + + $pluginDir = Puc_v4p11_Factory::normalizePath(WP_PLUGIN_DIR); + $muPluginDir = Puc_v4p11_Factory::normalizePath(WPMU_PLUGIN_DIR); + $themeDir = Puc_v4p11_Factory::normalizePath(get_theme_root()); + + if ( (strpos($absolutePath, $pluginDir) === 0) || (strpos($absolutePath, $muPluginDir) === 0) ) { + //It's part of a plugin. + return plugins_url(basename($absolutePath), $absolutePath); + } else if ( strpos($absolutePath, $themeDir) === 0 ) { + //It's part of a theme. + $relativePath = substr($absolutePath, strlen($themeDir) + 1); + $template = substr($relativePath, 0, strpos($relativePath, '/')); + $baseUrl = get_theme_root_uri($template); + + if ( !empty($baseUrl) && $relativePath ) { + return $baseUrl . '/' . $relativePath; + } + } + + return ''; + } + } + +endif; diff --git a/app/core/puc/Puc/v4p11/DebugBar/Panel.php b/app/core/puc/Puc/v4p11/DebugBar/Panel.php new file mode 100755 index 0000000..4859d49 --- /dev/null +++ b/app/core/puc/Puc/v4p11/DebugBar/Panel.php @@ -0,0 +1,165 @@ +'; + + public function __construct($updateChecker) { + $this->updateChecker = $updateChecker; + $title = sprintf( + 'PUC (%s)', + esc_attr($this->updateChecker->getUniqueName('uid')), + $this->updateChecker->slug + ); + parent::__construct($title); + } + + public function render() { + printf( + '
', + esc_attr($this->updateChecker->getUniqueName('debug-bar-panel')), + esc_attr($this->updateChecker->slug), + esc_attr($this->updateChecker->getUniqueName('uid')), + esc_attr(wp_create_nonce('puc-ajax')) + ); + + $this->displayConfiguration(); + $this->displayStatus(); + $this->displayCurrentUpdate(); + + echo '
'; + } + + private function displayConfiguration() { + echo '

Configuration

'; + echo ''; + $this->displayConfigHeader(); + $this->row('Slug', htmlentities($this->updateChecker->slug)); + $this->row('DB option', htmlentities($this->updateChecker->optionName)); + + $requestInfoButton = $this->getMetadataButton(); + $this->row('Metadata URL', htmlentities($this->updateChecker->metadataUrl) . ' ' . $requestInfoButton . $this->responseBox); + + $scheduler = $this->updateChecker->scheduler; + if ( $scheduler->checkPeriod > 0 ) { + $this->row('Automatic checks', 'Every ' . $scheduler->checkPeriod . ' hours'); + } else { + $this->row('Automatic checks', 'Disabled'); + } + + if ( isset($scheduler->throttleRedundantChecks) ) { + if ( $scheduler->throttleRedundantChecks && ($scheduler->checkPeriod > 0) ) { + $this->row( + 'Throttling', + sprintf( + 'Enabled. If an update is already available, check for updates every %1$d hours instead of every %2$d hours.', + $scheduler->throttledCheckPeriod, + $scheduler->checkPeriod + ) + ); + } else { + $this->row('Throttling', 'Disabled'); + } + } + + $this->updateChecker->onDisplayConfiguration($this); + + echo '
'; + } + + protected function displayConfigHeader() { + //Do nothing. This should be implemented in subclasses. + } + + protected function getMetadataButton() { + return ''; + } + + private function displayStatus() { + echo '

Status

'; + echo ''; + $state = $this->updateChecker->getUpdateState(); + $checkNowButton = ''; + if ( function_exists('get_submit_button') ) { + $checkNowButton = get_submit_button( + 'Check Now', + 'secondary', + 'puc-check-now-button', + false, + array('id' => $this->updateChecker->getUniqueName('check-now-button')) + ); + } + + if ( $state->getLastCheck() > 0 ) { + $this->row('Last check', $this->formatTimeWithDelta($state->getLastCheck()) . ' ' . $checkNowButton . $this->responseBox); + } else { + $this->row('Last check', 'Never'); + } + + $nextCheck = wp_next_scheduled($this->updateChecker->scheduler->getCronHookName()); + $this->row('Next automatic check', $this->formatTimeWithDelta($nextCheck)); + + if ( $state->getCheckedVersion() !== '' ) { + $this->row('Checked version', htmlentities($state->getCheckedVersion())); + $this->row('Cached update', $state->getUpdate()); + } + $this->row('Update checker class', htmlentities(get_class($this->updateChecker))); + echo '
'; + } + + private function displayCurrentUpdate() { + $update = $this->updateChecker->getUpdate(); + if ( $update !== null ) { + echo '

An Update Is Available

'; + echo ''; + $fields = $this->getUpdateFields(); + foreach($fields as $field) { + if ( property_exists($update, $field) ) { + $this->row(ucwords(str_replace('_', ' ', $field)), htmlentities($update->$field)); + } + } + echo '
'; + } else { + echo '

No updates currently available

'; + } + } + + protected function getUpdateFields() { + return array('version', 'download_url', 'slug',); + } + + private function formatTimeWithDelta($unixTime) { + if ( empty($unixTime) ) { + return 'Never'; + } + + $delta = time() - $unixTime; + $result = human_time_diff(time(), $unixTime); + if ( $delta < 0 ) { + $result = 'after ' . $result; + } else { + $result = $result . ' ago'; + } + $result .= ' (' . $this->formatTimestamp($unixTime) . ')'; + return $result; + } + + private function formatTimestamp($unixTime) { + return gmdate('Y-m-d H:i:s', $unixTime + (get_option('gmt_offset') * 3600)); + } + + public function row($name, $value) { + if ( is_object($value) || is_array($value) ) { + $value = '
' . htmlentities(print_r($value, true)) . '
'; + } else if ($value === null) { + $value = 'null'; + } + printf('%1$s %2$s', $name, $value); + } + } + +endif; diff --git a/app/core/puc/Puc/v4p11/DebugBar/PluginExtension.php b/app/core/puc/Puc/v4p11/DebugBar/PluginExtension.php new file mode 100755 index 0000000..5936108 --- /dev/null +++ b/app/core/puc/Puc/v4p11/DebugBar/PluginExtension.php @@ -0,0 +1,33 @@ +updateChecker->getUniqueName('uid') ) { + return; + } + $this->preAjaxRequest(); + $info = $this->updateChecker->requestInfo(); + if ( $info !== null ) { + echo 'Successfully retrieved plugin info from the metadata URL:'; + echo '
', htmlentities(print_r($info, true)), '
'; + } else { + echo 'Failed to retrieve plugin info from the metadata URL.'; + } + exit; + } + } + +endif; diff --git a/app/core/puc/Puc/v4p11/DebugBar/PluginPanel.php b/app/core/puc/Puc/v4p11/DebugBar/PluginPanel.php new file mode 100755 index 0000000..06a5ad7 --- /dev/null +++ b/app/core/puc/Puc/v4p11/DebugBar/PluginPanel.php @@ -0,0 +1,38 @@ +row('Plugin file', htmlentities($this->updateChecker->pluginFile)); + parent::displayConfigHeader(); + } + + protected function getMetadataButton() { + $requestInfoButton = ''; + if ( function_exists('get_submit_button') ) { + $requestInfoButton = get_submit_button( + 'Request Info', + 'secondary', + 'puc-request-info-button', + false, + array('id' => $this->updateChecker->getUniqueName('request-info-button')) + ); + } + return $requestInfoButton; + } + + protected function getUpdateFields() { + return array_merge( + parent::getUpdateFields(), + array('homepage', 'upgrade_notice', 'tested',) + ); + } + } + +endif; diff --git a/app/core/puc/Puc/v4p11/DebugBar/ThemePanel.php b/app/core/puc/Puc/v4p11/DebugBar/ThemePanel.php new file mode 100755 index 0000000..ade36b9 --- /dev/null +++ b/app/core/puc/Puc/v4p11/DebugBar/ThemePanel.php @@ -0,0 +1,21 @@ +row('Theme directory', htmlentities($this->updateChecker->directoryName)); + parent::displayConfigHeader(); + } + + protected function getUpdateFields() { + return array_merge(parent::getUpdateFields(), array('details_url')); + } + } + +endif; diff --git a/app/core/puc/Puc/v4p11/Factory.php b/app/core/puc/Puc/v4p11/Factory.php new file mode 100755 index 0000000..35eccc5 --- /dev/null +++ b/app/core/puc/Puc/v4p11/Factory.php @@ -0,0 +1,365 @@ + '', + 'slug' => '', + 'checkPeriod' => 12, + 'optionName' => '', + 'muPluginFile' => '', + ); + $args = array_merge($defaults, array_intersect_key($args, $defaults)); + extract($args, EXTR_SKIP); + + //Check for the service URI + if ( empty($metadataUrl) ) { + $metadataUrl = self::getServiceURI($fullPath); + } + + /** @noinspection PhpUndefinedVariableInspection These variables are created by extract(), above. */ + return self::buildUpdateChecker($metadataUrl, $fullPath, $slug, $checkPeriod, $optionName, $muPluginFile); + } + + /** + * Create a new instance of the update checker. + * + * This method automatically detects if you're using it for a plugin or a theme and chooses + * the appropriate implementation for your update source (JSON file, GitHub, BitBucket, etc). + * + * @see Puc_v4p11_UpdateChecker::__construct + * + * @param string $metadataUrl The URL of the metadata file, a GitHub repository, or another supported update source. + * @param string $fullPath Full path to the main plugin file or to the theme directory. + * @param string $slug Custom slug. Defaults to the name of the main plugin file or the theme directory. + * @param int $checkPeriod How often to check for updates (in hours). + * @param string $optionName Where to store book-keeping info about update checks. + * @param string $muPluginFile The plugin filename relative to the mu-plugins directory. + * @return Puc_v4p11_Plugin_UpdateChecker|Puc_v4p11_Theme_UpdateChecker|Puc_v4p11_Vcs_BaseChecker + */ + public static function buildUpdateChecker($metadataUrl, $fullPath, $slug = '', $checkPeriod = 12, $optionName = '', $muPluginFile = '') { + $fullPath = self::normalizePath($fullPath); + $id = null; + + //Plugin or theme? + $themeDirectory = self::getThemeDirectoryName($fullPath); + if ( self::isPluginFile($fullPath) ) { + $type = 'Plugin'; + $id = $fullPath; + } else if ( $themeDirectory !== null ) { + $type = 'Theme'; + $id = $themeDirectory; + } else { + throw new RuntimeException(sprintf( + 'The update checker cannot determine if "%s" is a plugin or a theme. ' . + 'This is a bug. Please contact the PUC developer.', + htmlentities($fullPath) + )); + } + + //Which hosting service does the URL point to? + $service = self::getVcsService($metadataUrl); + + $apiClass = null; + if ( empty($service) ) { + //The default is to get update information from a remote JSON file. + $checkerClass = $type . '_UpdateChecker'; + } else { + //You can also use a VCS repository like GitHub. + $checkerClass = 'Vcs_' . $type . 'UpdateChecker'; + $apiClass = $service . 'Api'; + } + + $checkerClass = self::getCompatibleClassVersion($checkerClass); + if ( $checkerClass === null ) { + trigger_error( + sprintf( + 'PUC %s does not support updates for %ss %s', + htmlentities(self::$latestCompatibleVersion), + strtolower($type), + $service ? ('hosted on ' . htmlentities($service)) : 'using JSON metadata' + ), + E_USER_ERROR + ); + return null; + } + + //Add the current namespace to the class name(s). + if ( version_compare(PHP_VERSION, '5.3', '>=') ) { + $checkerClass = __NAMESPACE__ . '\\' . $checkerClass; + } + + if ( !isset($apiClass) ) { + //Plain old update checker. + return new $checkerClass($metadataUrl, $id, $slug, $checkPeriod, $optionName, $muPluginFile); + } else { + //VCS checker + an API client. + $apiClass = self::getCompatibleClassVersion($apiClass); + if ( $apiClass === null ) { + trigger_error(sprintf( + 'PUC %s does not support %s', + htmlentities(self::$latestCompatibleVersion), + htmlentities($service) + ), E_USER_ERROR); + return null; + } + + if ( version_compare(PHP_VERSION, '5.3', '>=') && (strpos($apiClass, '\\') === false) ) { + $apiClass = __NAMESPACE__ . '\\' . $apiClass; + } + + return new $checkerClass( + new $apiClass($metadataUrl), + $id, + $slug, + $checkPeriod, + $optionName, + $muPluginFile + ); + } + } + + /** + * + * Normalize a filesystem path. Introduced in WP 3.9. + * Copying here allows use of the class on earlier versions. + * This version adapted from WP 4.8.2 (unchanged since 4.5.0) + * + * @param string $path Path to normalize. + * @return string Normalized path. + */ + public static function normalizePath($path) { + if ( function_exists('wp_normalize_path') ) { + return wp_normalize_path($path); + } + $path = str_replace('\\', '/', $path); + $path = preg_replace('|(?<=.)/+|', '/', $path); + if ( substr($path, 1, 1) === ':' ) { + $path = ucfirst($path); + } + return $path; + } + + /** + * Check if the path points to a plugin file. + * + * @param string $absolutePath Normalized path. + * @return bool + */ + protected static function isPluginFile($absolutePath) { + //Is the file inside the "plugins" or "mu-plugins" directory? + $pluginDir = self::normalizePath(WP_PLUGIN_DIR); + $muPluginDir = self::normalizePath(WPMU_PLUGIN_DIR); + if ( (strpos($absolutePath, $pluginDir) === 0) || (strpos($absolutePath, $muPluginDir) === 0) ) { + return true; + } + + //Is it a file at all? Caution: is_file() can fail if the parent dir. doesn't have the +x permission set. + if ( !is_file($absolutePath) ) { + return false; + } + + //Does it have a valid plugin header? + //This is a last-ditch check for plugins symlinked from outside the WP root. + if ( function_exists('get_file_data') ) { + $headers = get_file_data($absolutePath, array('Name' => 'Plugin Name'), 'plugin'); + return !empty($headers['Name']); + } + + return false; + } + + /** + * Get the name of the theme's directory from a full path to a file inside that directory. + * E.g. "/abc/public_html/wp-content/themes/foo/whatever.php" => "foo". + * + * Note that subdirectories are currently not supported. For example, + * "/xyz/wp-content/themes/my-theme/includes/whatever.php" => NULL. + * + * @param string $absolutePath Normalized path. + * @return string|null Directory name, or NULL if the path doesn't point to a theme. + */ + protected static function getThemeDirectoryName($absolutePath) { + if ( is_file($absolutePath) ) { + $absolutePath = dirname($absolutePath); + } + + if ( file_exists($absolutePath . '/style.css') ) { + return basename($absolutePath); + } + return null; + } + + /** + * Get the service URI from the file header. + * + * @param string $fullPath + * @return string + */ + private static function getServiceURI($fullPath) { + //Look for the URI + if ( is_readable($fullPath) ) { + $seek = array( + 'github' => 'GitHub URI', + 'gitlab' => 'GitLab URI', + 'bucket' => 'BitBucket URI', + ); + $seek = apply_filters('puc_get_source_uri', $seek); + $data = get_file_data($fullPath, $seek); + foreach ($data as $key => $uri) { + if ( $uri ) { + return $uri; + } + } + } + + //URI was not found so throw an error. + throw new RuntimeException( + sprintf('Unable to locate URI in header of "%s"', htmlentities($fullPath)) + ); + } + + /** + * Get the name of the hosting service that the URL points to. + * + * @param string $metadataUrl + * @return string|null + */ + private static function getVcsService($metadataUrl) { + $service = null; + + //Which hosting service does the URL point to? + $host = parse_url($metadataUrl, PHP_URL_HOST); + $path = parse_url($metadataUrl, PHP_URL_PATH); + + //Check if the path looks like "/user-name/repository". + //For GitLab.com it can also be "/user/group1/group2/.../repository". + $repoRegex = '@^/?([^/]+?)/([^/#?&]+?)/?$@'; + if ( $host === 'gitlab.com' ) { + $repoRegex = '@^/?(?:[^/#?&]++/){1,20}(?:[^/#?&]++)/?$@'; + } + if ( preg_match($repoRegex, $path) ) { + $knownServices = array( + 'github.com' => 'GitHub', + 'bitbucket.org' => 'BitBucket', + 'gitlab.com' => 'GitLab', + ); + if ( isset($knownServices[$host]) ) { + $service = $knownServices[$host]; + } + } + + return apply_filters('puc_get_vcs_service', $service, $host, $path, $metadataUrl); + } + + /** + * Get the latest version of the specified class that has the same major version number + * as this factory class. + * + * @param string $class Partial class name. + * @return string|null Full class name. + */ + protected static function getCompatibleClassVersion($class) { + if ( isset(self::$classVersions[$class][self::$latestCompatibleVersion]) ) { + return self::$classVersions[$class][self::$latestCompatibleVersion]; + } + return null; + } + + /** + * Get the specific class name for the latest available version of a class. + * + * @param string $class + * @return null|string + */ + public static function getLatestClassVersion($class) { + if ( !self::$sorted ) { + self::sortVersions(); + } + + if ( isset(self::$classVersions[$class]) ) { + return reset(self::$classVersions[$class]); + } else { + return null; + } + } + + /** + * Sort available class versions in descending order (i.e. newest first). + */ + protected static function sortVersions() { + foreach ( self::$classVersions as $class => $versions ) { + uksort($versions, array(__CLASS__, 'compareVersions')); + self::$classVersions[$class] = $versions; + } + self::$sorted = true; + } + + protected static function compareVersions($a, $b) { + return -version_compare($a, $b); + } + + /** + * Register a version of a class. + * + * @access private This method is only for internal use by the library. + * + * @param string $generalClass Class name without version numbers, e.g. 'PluginUpdateChecker'. + * @param string $versionedClass Actual class name, e.g. 'PluginUpdateChecker_1_2'. + * @param string $version Version number, e.g. '1.2'. + */ + public static function addVersion($generalClass, $versionedClass, $version) { + if ( empty(self::$myMajorVersion) ) { + $nameParts = explode('_', __CLASS__, 3); + self::$myMajorVersion = substr(ltrim($nameParts[1], 'v'), 0, 1); + } + + //Store the greatest version number that matches our major version. + $components = explode('.', $version); + if ( $components[0] === self::$myMajorVersion ) { + + if ( + empty(self::$latestCompatibleVersion) + || version_compare($version, self::$latestCompatibleVersion, '>') + ) { + self::$latestCompatibleVersion = $version; + } + + } + + if ( !isset(self::$classVersions[$generalClass]) ) { + self::$classVersions[$generalClass] = []; + } + self::$classVersions[$generalClass][$version] = $versionedClass; + self::$sorted = false; + } + } + +endif; diff --git a/app/core/puc/Puc/v4p11/InstalledPackage.php b/app/core/puc/Puc/v4p11/InstalledPackage.php new file mode 100755 index 0000000..05dba7e --- /dev/null +++ b/app/core/puc/Puc/v4p11/InstalledPackage.php @@ -0,0 +1,103 @@ +updateChecker = $updateChecker; + } + + /** + * Get the currently installed version of the plugin or theme. + * + * @return string|null Version number. + */ + abstract public function getInstalledVersion(); + + /** + * Get the full path of the plugin or theme directory (without a trailing slash). + * + * @return string + */ + abstract public function getAbsoluteDirectoryPath(); + + /** + * Check whether a regular file exists in the package's directory. + * + * @param string $relativeFileName File name relative to the package directory. + * @return bool + */ + public function fileExists($relativeFileName) { + return is_file( + $this->getAbsoluteDirectoryPath() + . DIRECTORY_SEPARATOR + . ltrim($relativeFileName, '/\\') + ); + } + + /* ------------------------------------------------------------------- + * File header parsing + * ------------------------------------------------------------------- + */ + + /** + * Parse plugin or theme metadata from the header comment. + * + * This is basically a simplified version of the get_file_data() function from /wp-includes/functions.php. + * It's intended as a utility for subclasses that detect updates by parsing files in a VCS. + * + * @param string|null $content File contents. + * @return string[] + */ + public function getFileHeader($content) { + $content = (string)$content; + + //WordPress only looks at the first 8 KiB of the file, so we do the same. + $content = substr($content, 0, 8192); + //Normalize line endings. + $content = str_replace("\r", "\n", $content); + + $headers = $this->getHeaderNames(); + $results = []; + foreach ($headers as $field => $name) { + $success = preg_match('/^[ \t\/*#@]*' . preg_quote($name, '/') . ':(.*)$/mi', $content, $matches); + + if ( ($success === 1) && $matches[1] ) { + $value = $matches[1]; + if ( function_exists('_cleanup_header_comment') ) { + $value = _cleanup_header_comment($value); + } + $results[$field] = $value; + } else { + $results[$field] = ''; + } + } + + return $results; + } + + /** + * @return array Format: ['HeaderKey' => 'Header Name'] + */ + abstract protected function getHeaderNames(); + + /** + * Get the value of a specific plugin or theme header. + * + * @param string $headerName + * @return string Either the value of the header, or an empty string if the header doesn't exist. + */ + abstract public function getHeaderValue($headerName); + + } +endif; diff --git a/app/core/puc/Puc/v4p11/Metadata.php b/app/core/puc/Puc/v4p11/Metadata.php new file mode 100755 index 0000000..3241256 --- /dev/null +++ b/app/core/puc/Puc/v4p11/Metadata.php @@ -0,0 +1,132 @@ +validateMetadata($apiResponse); + if ( is_wp_error($valid) ){ + do_action('puc_api_error', $valid); + trigger_error($valid->get_error_message(), E_USER_NOTICE); + return false; + } + + foreach(get_object_vars($apiResponse) as $key => $value){ + $target->$key = $value; + } + + return true; + } + + /** + * No validation by default! Subclasses should check that the required fields are present. + * + * @param StdClass $apiResponse + * @return bool|WP_Error + */ + protected function validateMetadata(/** @noinspection PhpUnusedParameterInspection */ $apiResponse) { + return true; + } + + /** + * Create a new instance by copying the necessary fields from another object. + * + * @abstract + * @param StdClass|self $object The source object. + * @return self The new copy. + */ + public static function fromObject(/** @noinspection PhpUnusedParameterInspection */ $object) { + throw new LogicException('The ' . __METHOD__ . ' method must be implemented by subclasses'); + } + + /** + * Create an instance of StdClass that can later be converted back to an + * update or info container. Useful for serialization and caching, as it + * avoids the "incomplete object" problem if the cached value is loaded + * before this class. + * + * @return StdClass + */ + public function toStdClass() { + $object = new stdClass(); + $this->copyFields($this, $object); + return $object; + } + + /** + * Transform the metadata into the format used by WordPress core. + * + * @return object + */ + abstract public function toWpFormat(); + + /** + * Copy known fields from one object to another. + * + * @param StdClass|self $from + * @param StdClass|self $to + */ + protected function copyFields($from, $to) { + $fields = $this->getFieldNames(); + + if ( property_exists($from, 'slug') && !empty($from->slug) ) { + //Let plugins add extra fields without having to create subclasses. + $fields = apply_filters($this->getPrefixedFilter('retain_fields') . '-' . $from->slug, $fields); + } + + foreach ($fields as $field) { + if ( property_exists($from, $field) ) { + $to->$field = $from->$field; + } + } + } + + /** + * @return string[] + */ + protected function getFieldNames() { + return []; + } + + /** + * @param string $tag + * @return string + */ + protected function getPrefixedFilter($tag) { + return 'puc_' . $tag; + } + } + +endif; diff --git a/app/core/puc/Puc/v4p11/OAuthSignature.php b/app/core/puc/Puc/v4p11/OAuthSignature.php new file mode 100755 index 0000000..c870d33 --- /dev/null +++ b/app/core/puc/Puc/v4p11/OAuthSignature.php @@ -0,0 +1,100 @@ +consumerKey = $consumerKey; + $this->consumerSecret = $consumerSecret; + } + + /** + * Sign a URL using OAuth 1.0. + * + * @param string $url The URL to be signed. It may contain query parameters. + * @param string $method HTTP method such as "GET", "POST" and so on. + * @return string The signed URL. + */ + public function sign($url, $method = 'GET') { + $parameters = []; + + //Parse query parameters. + $query = parse_url($url, PHP_URL_QUERY); + if ( !empty($query) ) { + parse_str($query, $parsedParams); + if ( is_array($parameters) ) { + $parameters = $parsedParams; + } + //Remove the query string from the URL. We'll replace it later. + $url = substr($url, 0, strpos($url, '?')); + } + + $parameters = array_merge( + $parameters, + array( + 'oauth_consumer_key' => $this->consumerKey, + 'oauth_nonce' => $this->nonce(), + 'oauth_signature_method' => 'HMAC-SHA1', + 'oauth_timestamp' => time(), + 'oauth_version' => '1.0', + ) + ); + unset($parameters['oauth_signature']); + + //Parameters must be sorted alphabetically before signing. + ksort($parameters); + + //The most complicated part of the request - generating the signature. + //The string to sign contains the HTTP method, the URL path, and all of + //our query parameters. Everything is URL encoded. Then we concatenate + //them with ampersands into a single string to hash. + $encodedVerb = urlencode($method); + $encodedUrl = urlencode($url); + $encodedParams = urlencode(http_build_query($parameters, '', '&')); + + $stringToSign = $encodedVerb . '&' . $encodedUrl . '&' . $encodedParams; + + //Since we only have one OAuth token (the consumer secret) we only have + //to use it as our HMAC key. However, we still have to append an & to it + //as if we were using it with additional tokens. + $secret = urlencode($this->consumerSecret) . '&'; + + //The signature is a hash of the consumer key and the base string. Note + //that we have to get the raw output from hash_hmac and base64 encode + //the binary data result. + $parameters['oauth_signature'] = base64_encode(hash_hmac('sha1', $stringToSign, $secret, true)); + + return ($url . '?' . http_build_query($parameters)); + } + + /** + * Generate a random nonce. + * + * @return string + */ + private function nonce() { + $mt = microtime(); + + $rand = null; + if ( is_callable('random_bytes') ) { + try { + $rand = random_bytes(16); + } catch (Exception $ex) { + //Fall back to mt_rand (below). + } + } + if ( $rand === null ) { + $rand = mt_rand(); + } + + return md5($mt . '_' . $rand); + } + } + +endif; diff --git a/app/core/puc/Puc/v4p11/Plugin/Info.php b/app/core/puc/Puc/v4p11/Plugin/Info.php new file mode 100755 index 0000000..fc4eb1e --- /dev/null +++ b/app/core/puc/Puc/v4p11/Plugin/Info.php @@ -0,0 +1,132 @@ +sections = (array)$instance->sections; + $instance->icons = (array)$instance->icons; + + return $instance; + } + + /** + * Very, very basic validation. + * + * @param StdClass $apiResponse + * @return bool|WP_Error + */ + protected function validateMetadata($apiResponse) { + if ( + !isset($apiResponse->name, $apiResponse->version) + || empty($apiResponse->name) + || empty($apiResponse->version) + ) { + return new WP_Error( + 'puc-invalid-metadata', + "The plugin metadata file does not contain the required 'name' and/or 'version' keys." + ); + } + return true; + } + + + /** + * Transform plugin info into the format used by the native WordPress.org API + * + * @return object + */ + public function toWpFormat(){ + $info = new stdClass; + + //The custom update API is built so that many fields have the same name and format + //as those returned by the native WordPress.org API. These can be assigned directly. + $sameFormat = array( + 'name', 'slug', 'version', 'requires', 'tested', 'rating', 'upgrade_notice', + 'num_ratings', 'downloaded', 'active_installs', 'homepage', 'last_updated', + 'requires_php', + ); + foreach($sameFormat as $field){ + if ( isset($this->$field) ) { + $info->$field = $this->$field; + } else { + $info->$field = null; + } + } + + //Other fields need to be renamed and/or transformed. + $info->download_link = $this->download_url; + $info->author = $this->getFormattedAuthor(); + $info->sections = array_merge(array('description' => ''), $this->sections); + + if ( !empty($this->banners) ) { + //WP expects an array with two keys: "high" and "low". Both are optional. + //Docs: https://wordpress.org/plugins/about/faq/#banners + $info->banners = is_object($this->banners) ? get_object_vars($this->banners) : $this->banners; + $info->banners = array_intersect_key($info->banners, array('high' => true, 'low' => true)); + } + + return $info; + } + + protected function getFormattedAuthor() { + if ( !empty($this->author_homepage) ){ + /** @noinspection HtmlUnknownTarget */ + return sprintf('%s', $this->author_homepage, $this->author); + } + return $this->author; + } + } + +endif; diff --git a/app/core/puc/Puc/v4p11/Plugin/Package.php b/app/core/puc/Puc/v4p11/Plugin/Package.php new file mode 100755 index 0000000..f4c6813 --- /dev/null +++ b/app/core/puc/Puc/v4p11/Plugin/Package.php @@ -0,0 +1,184 @@ +pluginAbsolutePath = $pluginAbsolutePath; + $this->pluginFile = plugin_basename($this->pluginAbsolutePath); + + parent::__construct($updateChecker); + + //Clear the version number cache when something - anything - is upgraded or WP clears the update cache. + add_filter('upgrader_post_install', array($this, 'clearCachedVersion')); + add_action('delete_site_transient_update_plugins', array($this, 'clearCachedVersion')); + } + + public function getInstalledVersion() { + if ( isset($this->cachedInstalledVersion) ) { + return $this->cachedInstalledVersion; + } + + $pluginHeader = $this->getPluginHeader(); + if ( isset($pluginHeader['Version']) ) { + $this->cachedInstalledVersion = $pluginHeader['Version']; + return $pluginHeader['Version']; + } else { + //This can happen if the filename points to something that is not a plugin. + $this->updateChecker->triggerError( + sprintf( + "Can't to read the Version header for '%s'. The filename is incorrect or is not a plugin.", + $this->updateChecker->pluginFile + ), + E_USER_WARNING + ); + return null; + } + } + + /** + * Clear the cached plugin version. This method can be set up as a filter (hook) and will + * return the filter argument unmodified. + * + * @param mixed $filterArgument + * @return mixed + */ + public function clearCachedVersion($filterArgument = null) { + $this->cachedInstalledVersion = null; + return $filterArgument; + } + + public function getAbsoluteDirectoryPath() { + return dirname($this->pluginAbsolutePath); + } + + /** + * Get the value of a specific plugin or theme header. + * + * @param string $headerName + * @param string $defaultValue + * @return string Either the value of the header, or $defaultValue if the header doesn't exist or is empty. + */ + public function getHeaderValue($headerName, $defaultValue = '') { + $headers = $this->getPluginHeader(); + if ( isset($headers[$headerName]) && ($headers[$headerName] !== '') ) { + return $headers[$headerName]; + } + return $defaultValue; + } + + protected function getHeaderNames() { + return array( + 'Name' => 'Plugin Name', + 'PluginURI' => 'Plugin URI', + 'Version' => 'Version', + 'Description' => 'Description', + 'Author' => 'Author', + 'AuthorURI' => 'Author URI', + 'TextDomain' => 'Text Domain', + 'DomainPath' => 'Domain Path', + 'Network' => 'Network', + + //The newest WordPress version that this plugin requires or has been tested with. + //We support several different formats for compatibility with other libraries. + 'Tested WP' => 'Tested WP', + 'Requires WP' => 'Requires WP', + 'Tested up to' => 'Tested up to', + 'Requires at least' => 'Requires at least', + ); + } + + /** + * Get the translated plugin title. + * + * @return string + */ + public function getPluginTitle() { + $title = ''; + $header = $this->getPluginHeader(); + if ( $header && !empty($header['Name']) && isset($header['TextDomain']) ) { + $title = translate($header['Name'], $header['TextDomain']); + } + return $title; + } + + /** + * Get plugin's metadata from its file header. + * + * @return array + */ + public function getPluginHeader() { + if ( !is_file($this->pluginAbsolutePath) ) { + //This can happen if the plugin filename is wrong. + $this->updateChecker->triggerError( + sprintf( + "Can't to read the plugin header for '%s'. The file does not exist.", + $this->updateChecker->pluginFile + ), + E_USER_WARNING + ); + return []; + } + + if ( !function_exists('get_plugin_data') ) { + /** @noinspection PhpIncludeInspection */ + require_once(ABSPATH . '/wp-admin/includes/plugin.php'); + } + return get_plugin_data($this->pluginAbsolutePath, false, false); + } + + public function removeHooks() { + remove_filter('upgrader_post_install', array($this, 'clearCachedVersion')); + remove_action('delete_site_transient_update_plugins', array($this, 'clearCachedVersion')); + } + + /** + * Check if the plugin file is inside the mu-plugins directory. + * + * @return bool + */ + public function isMuPlugin() { + static $cachedResult = null; + + if ( $cachedResult === null ) { + if ( !defined('WPMU_PLUGIN_DIR') || !is_string(WPMU_PLUGIN_DIR) ) { + $cachedResult = false; + return $cachedResult; + } + + //Convert both paths to the canonical form before comparison. + $muPluginDir = realpath(WPMU_PLUGIN_DIR); + $pluginPath = realpath($this->pluginAbsolutePath); + //If realpath() fails, just normalize the syntax instead. + if (($muPluginDir === false) || ($pluginPath === false)) { + $muPluginDir = Puc_v4p11_Factory::normalizePath(WPMU_PLUGIN_DIR); + $pluginPath = Puc_v4p11_Factory::normalizePath($this->pluginAbsolutePath); + } + + $cachedResult = (strpos($pluginPath, $muPluginDir) === 0); + } + + return $cachedResult; + } + } + +endif; diff --git a/app/core/puc/Puc/v4p11/Plugin/Ui.php b/app/core/puc/Puc/v4p11/Plugin/Ui.php new file mode 100755 index 0000000..7b9ee46 --- /dev/null +++ b/app/core/puc/Puc/v4p11/Plugin/Ui.php @@ -0,0 +1,278 @@ +updateChecker = $updateChecker; + $this->manualCheckErrorTransient = $this->updateChecker->getUniqueName('manual_check_errors'); + + add_action('admin_init', array($this, 'onAdminInit')); + } + + public function onAdminInit() { + if ( $this->updateChecker->userCanInstallUpdates() ) { + $this->handleManualCheck(); + + add_filter('plugin_row_meta', array($this, 'addViewDetailsLink'), 10, 3); + add_filter('plugin_row_meta', array($this, 'addCheckForUpdatesLink'), 10, 2); + add_action('all_admin_notices', array($this, 'displayManualCheckResult')); + } + } + + /** + * Add a "View Details" link to the plugin row in the "Plugins" page. By default, + * the new link will appear before the "Visit plugin site" link (if present). + * + * You can change the link text by using the "puc_view_details_link-$slug" filter. + * Returning an empty string from the filter will disable the link. + * + * You can change the position of the link using the + * "puc_view_details_link_position-$slug" filter. + * Returning 'before' or 'after' will place the link immediately before/after + * the "Visit plugin site" link. + * Returning 'append' places the link after any existing links at the time of the hook. + * Returning 'replace' replaces the "Visit plugin site" link. + * Returning anything else disables the link when there is a "Visit plugin site" link. + * + * If there is no "Visit plugin site" link 'append' is always used! + * + * @param array $pluginMeta Array of meta links. + * @param string $pluginFile + * @param array $pluginData Array of plugin header data. + * @return array + */ + public function addViewDetailsLink($pluginMeta, $pluginFile, $pluginData = array()) { + if ( $this->isMyPluginFile($pluginFile) && !isset($pluginData['slug']) ) { + $linkText = apply_filters($this->updateChecker->getUniqueName('view_details_link'), esc_html__('View details')); + if ( !empty($linkText) ) { + $viewDetailsLinkPosition = 'append'; + + //Find the "Visit plugin site" link (if present). + $visitPluginSiteLinkIndex = count($pluginMeta) - 1; + if ( $pluginData['PluginURI'] ) { + $escapedPluginUri = esc_url($pluginData['PluginURI']); + foreach ($pluginMeta as $linkIndex => $existingLink) { + if ( strpos($existingLink, $escapedPluginUri) !== false ) { + $visitPluginSiteLinkIndex = $linkIndex; + $viewDetailsLinkPosition = apply_filters( + $this->updateChecker->getUniqueName('view_details_link_position'), + 'before' + ); + break; + } + } + } + + $viewDetailsLink = sprintf('%s', + esc_url(network_admin_url('plugin-install.php?tab=plugin-information&plugin=' . urlencode($this->updateChecker->slug) . + '&TB_iframe=true&width=600&height=550')), + esc_attr(sprintf(esc_html__('More information about %s'), $pluginData['Name'])), + esc_attr($pluginData['Name']), + $linkText + ); + switch ($viewDetailsLinkPosition) { + case 'before': + array_splice($pluginMeta, $visitPluginSiteLinkIndex, 0, $viewDetailsLink); + break; + case 'after': + array_splice($pluginMeta, $visitPluginSiteLinkIndex + 1, 0, $viewDetailsLink); + break; + case 'replace': + $pluginMeta[$visitPluginSiteLinkIndex] = $viewDetailsLink; + break; + case 'append': + default: + $pluginMeta[] = $viewDetailsLink; + break; + } + } + } + return $pluginMeta; + } + + /** + * Add a "Check for updates" link to the plugin row in the "Plugins" page. By default, + * the new link will appear after the "Visit plugin site" link if present, otherwise + * after the "View plugin details" link. + * + * You can change the link text by using the "puc_manual_check_link-$slug" filter. + * Returning an empty string from the filter will disable the link. + * + * @param array $pluginMeta Array of meta links. + * @param string $pluginFile + * @return array + */ + public function addCheckForUpdatesLink($pluginMeta, $pluginFile) { + if ( $this->isMyPluginFile($pluginFile) ) { + $linkUrl = wp_nonce_url( + add_query_arg( + array( + 'puc_check_for_updates' => 1, + 'puc_slug' => $this->updateChecker->slug, + ), + self_admin_url('plugins.php') + ), + 'puc_check_for_updates' + ); + + $linkText = apply_filters( + $this->updateChecker->getUniqueName('manual_check_link'), + __('Check for updates', 'plugin-update-checker') + ); + if ( !empty($linkText) ) { + /** @noinspection HtmlUnknownTarget */ + $pluginMeta[] = sprintf('%s', esc_attr($linkUrl), $linkText); + } + } + return $pluginMeta; + } + + protected function isMyPluginFile($pluginFile) { + return ($pluginFile == $this->updateChecker->pluginFile) + || (!empty($this->updateChecker->muPluginFile) && ($pluginFile == $this->updateChecker->muPluginFile)); + } + + /** + * Check for updates when the user clicks the "Check for updates" link. + * + * @see self::addCheckForUpdatesLink() + * + * @return void + */ + public function handleManualCheck() { + $shouldCheck = + isset($_GET['puc_check_for_updates'], $_GET['puc_slug']) + && $_GET['puc_slug'] == $this->updateChecker->slug + && check_admin_referer('puc_check_for_updates'); + + if ( $shouldCheck ) { + $update = $this->updateChecker->checkForUpdates(); + $status = ($update === null) ? 'no_update' : 'update_available'; + $lastRequestApiErrors = $this->updateChecker->getLastRequestApiErrors(); + + if ( ($update === null) && !empty($lastRequestApiErrors) ) { + //Some errors are not critical. For example, if PUC tries to retrieve the readme.txt + //file from GitHub and gets a 404, that's an API error, but it doesn't prevent updates + //from working. Maybe the plugin simply doesn't have a readme. + //Let's only show important errors. + $foundCriticalErrors = false; + $questionableErrorCodes = array( + 'puc-github-http-error', + 'puc-gitlab-http-error', + 'puc-bitbucket-http-error', + ); + + foreach ($lastRequestApiErrors as $item) { + $wpError = $item['error']; + /** @var WP_Error $wpError */ + if ( !in_array($wpError->get_error_code(), $questionableErrorCodes) ) { + $foundCriticalErrors = true; + break; + } + } + + if ( $foundCriticalErrors ) { + $status = 'error'; + set_site_transient($this->manualCheckErrorTransient, $lastRequestApiErrors, 60); + } + } + + wp_redirect(add_query_arg( + array( + 'puc_update_check_result' => $status, + 'puc_slug' => $this->updateChecker->slug, + ), + self_admin_url('plugins.php') + )); + exit; + } + } + + /** + * Display the results of a manual update check. + * + * @see self::handleManualCheck() + * + * You can change the result message by using the "puc_manual_check_message-$slug" filter. + */ + public function displayManualCheckResult() { + if ( isset($_GET['puc_update_check_result'], $_GET['puc_slug']) && ($_GET['puc_slug'] == $this->updateChecker->slug) ) { + $status = strval($_GET['puc_update_check_result']); + $title = $this->updateChecker->getInstalledPackage()->getPluginTitle(); + $noticeClass = 'updated notice-success'; + $details = ''; + + if ( $status == 'no_update' ) { + $message = sprintf(_x('The %s plugin is up to date.', 'the plugin title', 'plugin-update-checker'), $title); + } else if ( $status == 'update_available' ) { + $message = sprintf(_x('A new version of the %s plugin is available.', 'the plugin title', 'plugin-update-checker'), $title); + } else if ( $status === 'error' ) { + $message = sprintf(_x('Could not determine if updates are available for %s.', 'the plugin title', 'plugin-update-checker'), $title); + $noticeClass = 'error notice-error'; + + $details = $this->formatManualCheckErrors(get_site_transient($this->manualCheckErrorTransient)); + delete_site_transient($this->manualCheckErrorTransient); + } else { + $message = sprintf(esc_html__('Unknown update checker status "%s"', 'plugin-update-checker'), htmlentities($status)); + $noticeClass = 'error notice-error'; + } + printf( + '

%s

%s
', + $noticeClass, + apply_filters($this->updateChecker->getUniqueName('manual_check_message'), $message, $status), + $details + ); + } + } + + /** + * Format the list of errors that were thrown during an update check. + * + * @param array $errors + * @return string + */ + protected function formatManualCheckErrors($errors) { + if ( empty($errors) ) { + return ''; + } + $output = ''; + + $showAsList = count($errors) > 1; + if ( $showAsList ) { + $output .= '
    '; + $formatString = '
  1. %1$s %2$s
  2. '; + } else { + $formatString = '

    %1$s %2$s

    '; + } + foreach ($errors as $item) { + $wpError = $item['error']; + /** @var WP_Error $wpError */ + $output .= sprintf( + $formatString, + $wpError->get_error_message(), + $wpError->get_error_code() + ); + } + if ( $showAsList ) { + $output .= '
'; + } + + return $output; + } + + public function removeHooks() { + remove_action('admin_init', array($this, 'onAdminInit')); + remove_filter('plugin_row_meta', array($this, 'addViewDetailsLink'), 10); + remove_filter('plugin_row_meta', array($this, 'addCheckForUpdatesLink'), 10); + remove_action('all_admin_notices', array($this, 'displayManualCheckResult')); + } + } +endif; diff --git a/app/core/puc/Puc/v4p11/Plugin/Update.php b/app/core/puc/Puc/v4p11/Plugin/Update.php new file mode 100755 index 0000000..e805f37 --- /dev/null +++ b/app/core/puc/Puc/v4p11/Plugin/Update.php @@ -0,0 +1,112 @@ +copyFields($object, $update); + return $update; + } + + /** + * @return string[] + */ + protected function getFieldNames() { + return array_merge(parent::getFieldNames(), self::$extraFields); + } + + /** + * Transform the update into the format used by WordPress native plugin API. + * + * @return object + */ + public function toWpFormat() { + $update = parent::toWpFormat(); + + $update->id = $this->id; + $update->url = $this->homepage; + $update->tested = $this->tested; + $update->requires_php = $this->requires_php; + $update->plugin = $this->filename; + + if ( !empty($this->upgrade_notice) ) { + $update->upgrade_notice = $this->upgrade_notice; + } + + if ( !empty($this->icons) && is_array($this->icons) ) { + //This should be an array with up to 4 keys: 'svg', '1x', '2x' and 'default'. + //Docs: https://developer.wordpress.org/plugins/wordpress-org/plugin-assets/#plugin-icons + $icons = array_intersect_key( + $this->icons, + array('svg' => true, '1x' => true, '2x' => true, 'default' => true) + ); + if ( !empty($icons) ) { + $update->icons = $icons; + + //It appears that the 'default' icon isn't used anywhere in WordPress 4.9, + //but lets set it just in case a future release needs it. + if ( !isset($update->icons['default']) ) { + $update->icons['default'] = current($update->icons); + } + } + } + + return $update; + } + } + +endif; diff --git a/app/core/puc/Puc/v4p11/Plugin/UpdateChecker.php b/app/core/puc/Puc/v4p11/Plugin/UpdateChecker.php new file mode 100755 index 0000000..12f0d0d --- /dev/null +++ b/app/core/puc/Puc/v4p11/Plugin/UpdateChecker.php @@ -0,0 +1,414 @@ +pluginAbsolutePath = $pluginFile; + $this->pluginFile = plugin_basename($this->pluginAbsolutePath); + $this->muPluginFile = $muPluginFile; + + //If no slug is specified, use the name of the main plugin file as the slug. + //For example, 'my-cool-plugin/cool-plugin.php' becomes 'cool-plugin'. + if ( empty($slug) ){ + $slug = basename($this->pluginFile, '.php'); + } + + //Plugin slugs must be unique. + $slugCheckFilter = 'puc_is_slug_in_use-' . $slug; + $slugUsedBy = apply_filters($slugCheckFilter, false); + if ( $slugUsedBy ) { + $this->triggerError(sprintf( + 'Plugin slug "%s" is already in use by %s. Slugs must be unique.', + htmlentities($slug), + htmlentities($slugUsedBy) + ), E_USER_ERROR); + } + add_filter($slugCheckFilter, array($this, 'getAbsolutePath')); + + parent::__construct($metadataUrl, dirname($this->pluginFile), $slug, $checkPeriod, $optionName); + + //Backwards compatibility: If the plugin is a mu-plugin but no $muPluginFile is specified, assume + //it's the same as $pluginFile given that it's not in a subdirectory (WP only looks in the base dir). + if ( (strpbrk($this->pluginFile, '/\\') === false) && $this->isUnknownMuPlugin() ) { + $this->muPluginFile = $this->pluginFile; + } + + //To prevent a crash during plugin uninstallation, remove updater hooks when the user removes the plugin. + //Details: https://github.com/YahnisElsts/plugin-update-checker/issues/138#issuecomment-335590964 + add_action('uninstall_' . $this->pluginFile, array($this, 'removeHooks')); + + $this->extraUi = new Puc_v4p11_Plugin_Ui($this); + } + + /** + * Create an instance of the scheduler. + * + * @param int $checkPeriod + * @return Puc_v4p11_Scheduler + */ + protected function createScheduler($checkPeriod) { + $scheduler = new Puc_v4p11_Scheduler($this, $checkPeriod, array('load-plugins.php')); + register_deactivation_hook($this->pluginFile, array($scheduler, 'removeUpdaterCron')); + return $scheduler; + } + + /** + * Install the hooks required to run periodic update checks and inject update info + * into WP data structures. + * + * @return void + */ + protected function installHooks(){ + //Override requests for plugin information + add_filter('plugins_api', array($this, 'injectInfo'), 20, 3); + + parent::installHooks(); + } + + /** + * Remove update checker hooks. + * + * The intent is to prevent a fatal error that can happen if the plugin has an uninstall + * hook. During uninstallation, WP includes the main plugin file (which creates a PUC instance), + * the uninstall hook runs, WP deletes the plugin files and then updates some transients. + * If PUC hooks are still around at this time, they could throw an error while trying to + * autoload classes from files that no longer exist. + * + * The "site_transient_{$transient}" filter is the main problem here, but let's also remove + * most other PUC hooks to be safe. + * + * @internal + */ + public function removeHooks() { + parent::removeHooks(); + $this->extraUi->removeHooks(); + $this->package->removeHooks(); + + remove_filter('plugins_api', array($this, 'injectInfo'), 20); + } + + /** + * Retrieve plugin info from the configured API endpoint. + * + * @uses wp_remote_get() + * + * @param array $queryArgs Additional query arguments to append to the request. Optional. + * @return Puc_v4p11_Plugin_Info + */ + public function requestInfo($queryArgs = array()) { + list($pluginInfo, $result) = $this->requestMetadata('Puc_v4p11_Plugin_Info', 'request_info', $queryArgs); + + if ( $pluginInfo !== null ) { + /** @var Puc_v4p11_Plugin_Info $pluginInfo */ + $pluginInfo->filename = $this->pluginFile; + $pluginInfo->slug = $this->slug; + } + + $pluginInfo = apply_filters($this->getUniqueName('request_info_result'), $pluginInfo, $result); + return $pluginInfo; + } + + /** + * Retrieve the latest update (if any) from the configured API endpoint. + * + * @uses PluginUpdateChecker::requestInfo() + * + * @return Puc_v4p11_Update|null An instance of Plugin_Update, or NULL when no updates are available. + */ + public function requestUpdate() { + //For the sake of simplicity, this function just calls requestInfo() + //and transforms the result accordingly. + $pluginInfo = $this->requestInfo(array('checking_for_updates' => '1')); + if ( $pluginInfo === null ){ + return null; + } + $update = Puc_v4p11_Plugin_Update::fromPluginInfo($pluginInfo); + + $update = $this->filterUpdateResult($update); + + return $update; + } + + /** + * Intercept plugins_api() calls that request information about our plugin and + * use the configured API endpoint to satisfy them. + * + * @see plugins_api() + * + * @param mixed $result + * @param string $action + * @param array|object $args + * @return mixed + */ + public function injectInfo($result, $action = null, $args = null){ + $relevant = ($action == 'plugin_information') && isset($args->slug) && ( + ($args->slug == $this->slug) || ($args->slug == dirname($this->pluginFile)) + ); + if ( !$relevant ) { + return $result; + } + + $pluginInfo = $this->requestInfo(); + $this->fixSupportedWordpressVersion($pluginInfo); + + $pluginInfo = apply_filters($this->getUniqueName('pre_inject_info'), $pluginInfo); + if ( $pluginInfo ) { + return $pluginInfo->toWpFormat(); + } + + return $result; + } + + protected function shouldShowUpdates() { + //No update notifications for mu-plugins unless explicitly enabled. The MU plugin file + //is usually different from the main plugin file so the update wouldn't show up properly anyway. + return !$this->isUnknownMuPlugin(); + } + + /** + * @param stdClass|null $updates + * @param stdClass $updateToAdd + * @return stdClass + */ + protected function addUpdateToList($updates, $updateToAdd) { + if ( $this->package->isMuPlugin() ) { + //WP does not support automatic update installation for mu-plugins, but we can + //still display a notice. + $updateToAdd->package = null; + } + return parent::addUpdateToList($updates, $updateToAdd); + } + + /** + * @param stdClass|null $updates + * @return stdClass|null + */ + protected function removeUpdateFromList($updates) { + $updates = parent::removeUpdateFromList($updates); + if ( !empty($this->muPluginFile) && isset($updates, $updates->response) ) { + unset($updates->response[$this->muPluginFile]); + } + return $updates; + } + + /** + * For plugins, the update array is indexed by the plugin filename relative to the "plugins" + * directory. Example: "plugin-name/plugin.php". + * + * @return string + */ + protected function getUpdateListKey() { + if ( $this->package->isMuPlugin() ) { + return $this->muPluginFile; + } + return $this->pluginFile; + } + + protected function getNoUpdateItemFields() { + return array_merge( + parent::getNoUpdateItemFields(), + array( + 'id' => $this->pluginFile, + 'slug' => $this->slug, + 'plugin' => $this->pluginFile, + 'icons' => array(), + 'banners' => array(), + 'banners_rtl' => array(), + 'tested' => '', + 'compatibility' => new stdClass(), + ) + ); + } + + /** + * Alias for isBeingUpgraded(). + * + * @deprecated + * @param WP_Upgrader|null $upgrader The upgrader that's performing the current update. + * @return bool + */ + public function isPluginBeingUpgraded($upgrader = null) { + return $this->isBeingUpgraded($upgrader); + } + + /** + * Is there an update being installed for this plugin, right now? + * + * @param WP_Upgrader|null $upgrader + * @return bool + */ + public function isBeingUpgraded($upgrader = null) { + return $this->upgraderStatus->isPluginBeingUpgraded($this->pluginFile, $upgrader); + } + + /** + * Get the details of the currently available update, if any. + * + * If no updates are available, or if the last known update version is below or equal + * to the currently installed version, this method will return NULL. + * + * Uses cached update data. To retrieve update information straight from + * the metadata URL, call requestUpdate() instead. + * + * @return Puc_v4p11_Plugin_Update|null + */ + public function getUpdate() { + $update = parent::getUpdate(); + if ( isset($update) ) { + /** @var Puc_v4p11_Plugin_Update $update */ + $update->filename = $this->pluginFile; + } + return $update; + } + + /** + * Get the translated plugin title. + * + * @deprecated + * @return string + */ + public function getPluginTitle() { + return $this->package->getPluginTitle(); + } + + /** + * Check if the current user has the required permissions to install updates. + * + * @return bool + */ + public function userCanInstallUpdates() { + return current_user_can('update_plugins'); + } + + /** + * Check if the plugin file is inside the mu-plugins directory. + * + * @deprecated + * @return bool + */ + protected function isMuPlugin() { + return $this->package->isMuPlugin(); + } + + /** + * MU plugins are partially supported, but only when we know which file in mu-plugins + * corresponds to this plugin. + * + * @return bool + */ + protected function isUnknownMuPlugin() { + return empty($this->muPluginFile) && $this->package->isMuPlugin(); + } + + /** + * Get absolute path to the main plugin file. + * + * @return string + */ + public function getAbsolutePath() { + return $this->pluginAbsolutePath; + } + + /** + * Register a callback for filtering query arguments. + * + * The callback function should take one argument - an associative array of query arguments. + * It should return a modified array of query arguments. + * + * @uses add_filter() This method is a convenience wrapper for add_filter(). + * + * @param callable $callback + * @return void + */ + public function addQueryArgFilter($callback){ + $this->addFilter('request_info_query_args', $callback); + } + + /** + * Register a callback for filtering arguments passed to wp_remote_get(). + * + * The callback function should take one argument - an associative array of arguments - + * and return a modified array or arguments. See the WP documentation on wp_remote_get() + * for details on what arguments are available and how they work. + * + * @uses add_filter() This method is a convenience wrapper for add_filter(). + * + * @param callable $callback + * @return void + */ + public function addHttpRequestArgFilter($callback) { + $this->addFilter('request_info_options', $callback); + } + + /** + * Register a callback for filtering the plugin info retrieved from the external API. + * + * The callback function should take two arguments. If the plugin info was retrieved + * successfully, the first argument passed will be an instance of PluginInfo. Otherwise, + * it will be NULL. The second argument will be the corresponding return value of + * wp_remote_get (see WP docs for details). + * + * The callback function should return a new or modified instance of PluginInfo or NULL. + * + * @uses add_filter() This method is a convenience wrapper for add_filter(). + * + * @param callable $callback + * @return void + */ + public function addResultFilter($callback) { + $this->addFilter('request_info_result', $callback, 10, 2); + } + + protected function createDebugBarExtension() { + return new Puc_v4p11_DebugBar_PluginExtension($this); + } + + /** + * Create a package instance that represents this plugin or theme. + * + * @return Puc_v4p11_InstalledPackage + */ + protected function createInstalledPackage() { + return new Puc_v4p11_Plugin_Package($this->pluginAbsolutePath, $this); + } + + /** + * @return Puc_v4p11_Plugin_Package + */ + public function getInstalledPackage() { + return $this->package; + } + } + +endif; diff --git a/app/core/puc/Puc/v4p11/Scheduler.php b/app/core/puc/Puc/v4p11/Scheduler.php new file mode 100755 index 0000000..cd861cf --- /dev/null +++ b/app/core/puc/Puc/v4p11/Scheduler.php @@ -0,0 +1,266 @@ +updateChecker = $updateChecker; + $this->checkPeriod = $checkPeriod; + + //Set up the periodic update checks + $this->cronHook = $this->updateChecker->getUniqueName('cron_check_updates'); + if ( $this->checkPeriod > 0 ){ + + //Trigger the check via Cron. + //Try to use one of the default schedules if possible as it's less likely to conflict + //with other plugins and their custom schedules. + $defaultSchedules = array( + 1 => 'hourly', + 12 => 'twicedaily', + 24 => 'daily', + ); + if ( array_key_exists($this->checkPeriod, $defaultSchedules) ) { + $scheduleName = $defaultSchedules[$this->checkPeriod]; + } else { + //Use a custom cron schedule. + $scheduleName = 'every' . $this->checkPeriod . 'hours'; + add_filter('cron_schedules', array($this, '_addCustomSchedule')); + } + + if ( !wp_next_scheduled($this->cronHook) && !defined('WP_INSTALLING') ) { + //Randomly offset the schedule to help prevent update server traffic spikes. Without this + //most checks may happen during times of day when people are most likely to install new plugins. + $firstCheckTime = time() - rand(0, max($this->checkPeriod * 3600 - 15 * 60, 1)); + $firstCheckTime = apply_filters( + $this->updateChecker->getUniqueName('first_check_time'), + $firstCheckTime + ); + wp_schedule_event($firstCheckTime, $scheduleName, $this->cronHook); + } + add_action($this->cronHook, array($this, 'maybeCheckForUpdates')); + + //In case Cron is disabled or unreliable, we also manually trigger + //the periodic checks while the user is browsing the Dashboard. + add_action( 'admin_init', array($this, 'maybeCheckForUpdates') ); + + //Like WordPress itself, we check more often on certain pages. + /** @see wp_update_plugins */ + add_action('load-update-core.php', array($this, 'maybeCheckForUpdates')); + //"load-update.php" and "load-plugins.php" or "load-themes.php". + $this->hourlyCheckHooks = array_merge($this->hourlyCheckHooks, $hourlyHooks); + foreach($this->hourlyCheckHooks as $hook) { + add_action($hook, array($this, 'maybeCheckForUpdates')); + } + //This hook fires after a bulk update is complete. + add_action('upgrader_process_complete', array($this, 'upgraderProcessComplete'), 11, 2); + + } else { + //Periodic checks are disabled. + wp_clear_scheduled_hook($this->cronHook); + } + } + + /** + * Runs upon the WP action upgrader_process_complete. + * + * We look at the parameters to decide whether to call maybeCheckForUpdates() or not. + * We also check if the update checker has been removed by the update. + * + * @param WP_Upgrader $upgrader WP_Upgrader instance + * @param array $upgradeInfo extra information about the upgrade + */ + public function upgraderProcessComplete( + /** @noinspection PhpUnusedParameterInspection */ + $upgrader, $upgradeInfo + ) { + //Cancel all further actions if the current version of PUC has been deleted or overwritten + //by a different version during the upgrade. If we try to do anything more in that situation, + //we could trigger a fatal error by trying to autoload a deleted class. + clearstatcache(); + if ( !file_exists(__FILE__) ) { + $this->removeHooks(); + $this->updateChecker->removeHooks(); + return; + } + + //Sanity check and limitation to relevant types. + if ( + !is_array($upgradeInfo) || !isset($upgradeInfo['type'], $upgradeInfo['action']) + || 'update' !== $upgradeInfo['action'] || !in_array($upgradeInfo['type'], array('plugin', 'theme')) + ) { + return; + } + + //Filter out notifications of upgrades that should have no bearing upon whether or not our + //current info is up-to-date. + if ( is_a($this->updateChecker, 'Puc_v4p11_Theme_UpdateChecker') ) { + if ( 'theme' !== $upgradeInfo['type'] || !isset($upgradeInfo['themes']) ) { + return; + } + + //Letting too many things going through for checks is not a real problem, so we compare widely. + if ( !in_array( + strtolower($this->updateChecker->directoryName), + array_map('strtolower', $upgradeInfo['themes']) + ) ) { + return; + } + } + + if ( is_a($this->updateChecker, 'Puc_v4p11_Plugin_UpdateChecker') ) { + if ( 'plugin' !== $upgradeInfo['type'] || !isset($upgradeInfo['plugins']) ) { + return; + } + + //Themes pass in directory names in the information array, but plugins use the relative plugin path. + if ( !in_array( + strtolower($this->updateChecker->directoryName), + array_map('dirname', array_map('strtolower', $upgradeInfo['plugins'])) + ) ) { + return; + } + } + + $this->maybeCheckForUpdates(); + } + + /** + * Check for updates if the configured check interval has already elapsed. + * Will use a shorter check interval on certain admin pages like "Dashboard -> Updates" or when doing cron. + * + * You can override the default behaviour by using the "puc_check_now-$slug" filter. + * The filter callback will be passed three parameters: + * - Current decision. TRUE = check updates now, FALSE = don't check now. + * - Last check time as a Unix timestamp. + * - Configured check period in hours. + * Return TRUE to check for updates immediately, or FALSE to cancel. + * + * This method is declared public because it's a hook callback. Calling it directly is not recommended. + */ + public function maybeCheckForUpdates() { + if ( empty($this->checkPeriod) ){ + return; + } + + $state = $this->updateChecker->getUpdateState(); + $shouldCheck = ($state->timeSinceLastCheck() >= $this->getEffectiveCheckPeriod()); + + //Let plugin authors substitute their own algorithm. + $shouldCheck = apply_filters( + $this->updateChecker->getUniqueName('check_now'), + $shouldCheck, + $state->getLastCheck(), + $this->checkPeriod + ); + + if ( $shouldCheck ) { + $this->updateChecker->checkForUpdates(); + } + } + + /** + * Calculate the actual check period based on the current status and environment. + * + * @return int Check period in seconds. + */ + protected function getEffectiveCheckPeriod() { + $currentFilter = current_filter(); + if ( in_array($currentFilter, array('load-update-core.php', 'upgrader_process_complete')) ) { + //Check more often when the user visits "Dashboard -> Updates" or does a bulk update. + $period = 60; + } else if ( in_array($currentFilter, $this->hourlyCheckHooks) ) { + //Also check more often on /wp-admin/update.php and the "Plugins" or "Themes" page. + $period = 3600; + } else if ( $this->throttleRedundantChecks && ($this->updateChecker->getUpdate() !== null) ) { + //Check less frequently if it's already known that an update is available. + $period = $this->throttledCheckPeriod * 3600; + } else if ( defined('DOING_CRON') && constant('DOING_CRON') ) { + //WordPress cron schedules are not exact, so lets do an update check even + //if slightly less than $checkPeriod hours have elapsed since the last check. + $cronFuzziness = 20 * 60; + $period = $this->checkPeriod * 3600 - $cronFuzziness; + } else { + $period = $this->checkPeriod * 3600; + } + + return $period; + } + + /** + * Add our custom schedule to the array of Cron schedules used by WP. + * + * @param array $schedules + * @return array + */ + public function _addCustomSchedule($schedules) { + if ( $this->checkPeriod && ($this->checkPeriod > 0) ){ + $scheduleName = 'every' . $this->checkPeriod . 'hours'; + $schedules[$scheduleName] = array( + 'interval' => $this->checkPeriod * 3600, + 'display' => sprintf('Every %d hours', $this->checkPeriod), + ); + } + return $schedules; + } + + /** + * Remove the scheduled cron event that the library uses to check for updates. + * + * @return void + */ + public function removeUpdaterCron() { + wp_clear_scheduled_hook($this->cronHook); + } + + /** + * Get the name of the update checker's WP-cron hook. Mostly useful for debugging. + * + * @return string + */ + public function getCronHookName() { + return $this->cronHook; + } + + /** + * Remove most hooks added by the scheduler. + */ + public function removeHooks() { + remove_filter('cron_schedules', array($this, '_addCustomSchedule')); + remove_action('admin_init', array($this, 'maybeCheckForUpdates')); + remove_action('load-update-core.php', array($this, 'maybeCheckForUpdates')); + + if ( $this->cronHook !== null ) { + remove_action($this->cronHook, array($this, 'maybeCheckForUpdates')); + } + if ( !empty($this->hourlyCheckHooks) ) { + foreach ($this->hourlyCheckHooks as $hook) { + remove_action($hook, array($this, 'maybeCheckForUpdates')); + } + } + } + } + +endif; diff --git a/app/core/puc/Puc/v4p11/StateStore.php b/app/core/puc/Puc/v4p11/StateStore.php new file mode 100755 index 0000000..738a820 --- /dev/null +++ b/app/core/puc/Puc/v4p11/StateStore.php @@ -0,0 +1,207 @@ +optionName = $optionName; + } + + /** + * Get time elapsed since the last update check. + * + * If there are no recorded update checks, this method returns a large arbitrary number + * (i.e. time since the Unix epoch). + * + * @return int Elapsed time in seconds. + */ + public function timeSinceLastCheck() { + $this->lazyLoad(); + return time() - $this->lastCheck; + } + + /** + * @return int + */ + public function getLastCheck() { + $this->lazyLoad(); + return $this->lastCheck; + } + + /** + * Set the time of the last update check to the current timestamp. + * + * @return $this + */ + public function setLastCheckToNow() { + $this->lazyLoad(); + $this->lastCheck = time(); + return $this; + } + + /** + * @return null|Puc_v4p11_Update + */ + public function getUpdate() { + $this->lazyLoad(); + return $this->update; + } + + /** + * @param Puc_v4p11_Update|null $update + * @return $this + */ + public function setUpdate(Puc_v4p11_Update $update = null) { + $this->lazyLoad(); + $this->update = $update; + return $this; + } + + /** + * @return string + */ + public function getCheckedVersion() { + $this->lazyLoad(); + return $this->checkedVersion; + } + + /** + * @param string $version + * @return $this + */ + public function setCheckedVersion($version) { + $this->lazyLoad(); + $this->checkedVersion = strval($version); + return $this; + } + + /** + * Get translation updates. + * + * @return array + */ + public function getTranslations() { + $this->lazyLoad(); + if ( isset($this->update, $this->update->translations) ) { + return $this->update->translations; + } + return []; + } + + /** + * Set translation updates. + * + * @param array $translationUpdates + */ + public function setTranslations($translationUpdates) { + $this->lazyLoad(); + if ( isset($this->update) ) { + $this->update->translations = $translationUpdates; + $this->save(); + } + } + + public function save() { + $state = new stdClass(); + + $state->lastCheck = $this->lastCheck; + $state->checkedVersion = $this->checkedVersion; + + if ( isset($this->update)) { + $state->update = $this->update->toStdClass(); + + $updateClass = get_class($this->update); + $state->updateClass = $updateClass; + $prefix = $this->getLibPrefix(); + if ( Puc_v4p11_Utils::startsWith($updateClass, $prefix) ) { + $state->updateBaseClass = substr($updateClass, strlen($prefix)); + } + } + + update_site_option($this->optionName, $state); + $this->isLoaded = true; + } + + /** + * @return $this + */ + public function lazyLoad() { + if ( !$this->isLoaded ) { + $this->load(); + } + return $this; + } + + protected function load() { + $this->isLoaded = true; + + $state = get_site_option($this->optionName, null); + + if ( !is_object($state) ) { + $this->lastCheck = 0; + $this->checkedVersion = ''; + $this->update = null; + return; + } + + $this->lastCheck = intval(Puc_v4p11_Utils::get($state, 'lastCheck', 0)); + $this->checkedVersion = Puc_v4p11_Utils::get($state, 'checkedVersion', ''); + $this->update = null; + + if ( isset($state->update) ) { + //This mess is due to the fact that the want the update class from this version + //of the library, not the version that saved the update. + + $updateClass = null; + if ( isset($state->updateBaseClass) ) { + $updateClass = $this->getLibPrefix() . $state->updateBaseClass; + } else if ( isset($state->updateClass) && class_exists($state->updateClass) ) { + $updateClass = $state->updateClass; + } + + if ( $updateClass !== null ) { + $this->update = call_user_func(array($updateClass, 'fromObject'), $state->update); + } + } + } + + public function delete() { + delete_site_option($this->optionName); + + $this->lastCheck = 0; + $this->checkedVersion = ''; + $this->update = null; + } + + private function getLibPrefix() { + $parts = explode('_', __CLASS__, 3); + return $parts[0] . '_' . $parts[1] . '_'; + } + } + +endif; diff --git a/app/core/puc/Puc/v4p11/Theme/Package.php b/app/core/puc/Puc/v4p11/Theme/Package.php new file mode 100755 index 0000000..d9c9b50 --- /dev/null +++ b/app/core/puc/Puc/v4p11/Theme/Package.php @@ -0,0 +1,65 @@ +stylesheet = $stylesheet; + $this->theme = wp_get_theme($this->stylesheet); + + parent::__construct($updateChecker); + } + + public function getInstalledVersion() { + return $this->theme->get('Version'); + } + + public function getAbsoluteDirectoryPath() { + if ( method_exists($this->theme, 'get_stylesheet_directory') ) { + return $this->theme->get_stylesheet_directory(); //Available since WP 3.4. + } + return get_theme_root($this->stylesheet) . '/' . $this->stylesheet; + } + + /** + * Get the value of a specific plugin or theme header. + * + * @param string $headerName + * @param string $defaultValue + * @return string Either the value of the header, or $defaultValue if the header doesn't exist or is empty. + */ + public function getHeaderValue($headerName, $defaultValue = '') { + $value = $this->theme->get($headerName); + if ( ($headerName === false) || ($headerName === '') ) { + return $defaultValue; + } + return $value; + } + + protected function getHeaderNames() { + return array( + 'Name' => 'Theme Name', + 'ThemeURI' => 'Theme URI', + 'Description' => 'Description', + 'Author' => 'Author', + 'AuthorURI' => 'Author URI', + 'Version' => 'Version', + 'Template' => 'Template', + 'Status' => 'Status', + 'Tags' => 'Tags', + 'TextDomain' => 'Text Domain', + 'DomainPath' => 'Domain Path', + ); + } + } + +endif; diff --git a/app/core/puc/Puc/v4p11/Theme/Update.php b/app/core/puc/Puc/v4p11/Theme/Update.php new file mode 100755 index 0000000..a0325c9 --- /dev/null +++ b/app/core/puc/Puc/v4p11/Theme/Update.php @@ -0,0 +1,84 @@ + $this->slug, + 'new_version' => $this->version, + 'url' => $this->details_url, + ); + + if ( !empty($this->download_url) ) { + $update['package'] = $this->download_url; + } + + return $update; + } + + /** + * Create a new instance of Theme_Update from its JSON-encoded representation. + * + * @param string $json Valid JSON string representing a theme information object. + * @return self New instance of ThemeUpdate, or NULL on error. + */ + public static function fromJson($json) { + $instance = new self(); + if ( !parent::createFromJson($json, $instance) ) { + return null; + } + return $instance; + } + + /** + * Create a new instance by copying the necessary fields from another object. + * + * @param StdClass|Puc_v4p11_Theme_Update $object The source object. + * @return Puc_v4p11_Theme_Update The new copy. + */ + public static function fromObject($object) { + $update = new self(); + $update->copyFields($object, $update); + return $update; + } + + /** + * Basic validation. + * + * @param StdClass $apiResponse + * @return bool|WP_Error + */ + protected function validateMetadata($apiResponse) { + $required = array('version', 'details_url'); + foreach($required as $key) { + if ( !isset($apiResponse->$key) || empty($apiResponse->$key) ) { + return new WP_Error( + 'tuc-invalid-metadata', + sprintf('The theme metadata is missing the required "%s" key.', $key) + ); + } + } + return true; + } + + protected function getFieldNames() { + return array_merge(parent::getFieldNames(), self::$extraFields); + } + + protected function getPrefixedFilter($tag) { + return parent::getPrefixedFilter($tag) . '_theme'; + } + } + +endif; diff --git a/app/core/puc/Puc/v4p11/Theme/UpdateChecker.php b/app/core/puc/Puc/v4p11/Theme/UpdateChecker.php new file mode 100755 index 0000000..865a228 --- /dev/null +++ b/app/core/puc/Puc/v4p11/Theme/UpdateChecker.php @@ -0,0 +1,152 @@ +stylesheet = $stylesheet; + + parent::__construct( + $metadataUrl, + $stylesheet, + $customSlug ? $customSlug : $stylesheet, + $checkPeriod, + $optionName + ); + } + + /** + * For themes, the update array is indexed by theme directory name. + * + * @return string + */ + protected function getUpdateListKey() { + return $this->directoryName; + } + + /** + * Retrieve the latest update (if any) from the configured API endpoint. + * + * @return Puc_v4p11_Update|null An instance of Update, or NULL when no updates are available. + */ + public function requestUpdate() { + list($themeUpdate, $result) = $this->requestMetadata('Puc_v4p11_Theme_Update', 'request_update'); + + if ( $themeUpdate !== null ) { + /** @var Puc_v4p11_Theme_Update $themeUpdate */ + $themeUpdate->slug = $this->slug; + } + + $themeUpdate = $this->filterUpdateResult($themeUpdate, $result); + return $themeUpdate; + } + + protected function getNoUpdateItemFields() { + return array_merge( + parent::getNoUpdateItemFields(), + array( + 'theme' => $this->directoryName, + 'requires' => '', + ) + ); + } + + public function userCanInstallUpdates() { + return current_user_can('update_themes'); + } + + /** + * Create an instance of the scheduler. + * + * @param int $checkPeriod + * @return Puc_v4p11_Scheduler + */ + protected function createScheduler($checkPeriod) { + return new Puc_v4p11_Scheduler($this, $checkPeriod, array('load-themes.php')); + } + + /** + * Is there an update being installed right now for this theme? + * + * @param WP_Upgrader|null $upgrader The upgrader that's performing the current update. + * @return bool + */ + public function isBeingUpgraded($upgrader = null) { + return $this->upgraderStatus->isThemeBeingUpgraded($this->stylesheet, $upgrader); + } + + protected function createDebugBarExtension() { + return new Puc_v4p11_DebugBar_Extension($this, 'Puc_v4p11_DebugBar_ThemePanel'); + } + + /** + * Register a callback for filtering query arguments. + * + * The callback function should take one argument - an associative array of query arguments. + * It should return a modified array of query arguments. + * + * @param callable $callback + * @return void + */ + public function addQueryArgFilter($callback){ + $this->addFilter('request_update_query_args', $callback); + } + + /** + * Register a callback for filtering arguments passed to wp_remote_get(). + * + * The callback function should take one argument - an associative array of arguments - + * and return a modified array or arguments. See the WP documentation on wp_remote_get() + * for details on what arguments are available and how they work. + * + * @uses add_filter() This method is a convenience wrapper for add_filter(). + * + * @param callable $callback + * @return void + */ + public function addHttpRequestArgFilter($callback) { + $this->addFilter('request_update_options', $callback); + } + + /** + * Register a callback for filtering theme updates retrieved from the external API. + * + * The callback function should take two arguments. If the theme update was retrieved + * successfully, the first argument passed will be an instance of Theme_Update. Otherwise, + * it will be NULL. The second argument will be the corresponding return value of + * wp_remote_get (see WP docs for details). + * + * The callback function should return a new or modified instance of Theme_Update or NULL. + * + * @uses add_filter() This method is a convenience wrapper for add_filter(). + * + * @param callable $callback + * @return void + */ + public function addResultFilter($callback) { + $this->addFilter('request_update_result', $callback, 10, 2); + } + + /** + * Create a package instance that represents this plugin or theme. + * + * @return Puc_v4p11_InstalledPackage + */ + protected function createInstalledPackage() { + return new Puc_v4p11_Theme_Package($this->stylesheet, $this); + } + } + +endif; diff --git a/app/core/puc/Puc/v4p11/Update.php b/app/core/puc/Puc/v4p11/Update.php new file mode 100755 index 0000000..f12172d --- /dev/null +++ b/app/core/puc/Puc/v4p11/Update.php @@ -0,0 +1,34 @@ +slug = $this->slug; + $update->new_version = $this->version; + $update->package = $this->download_url; + + return $update; + } + } + +endif; diff --git a/app/core/puc/Puc/v4p11/UpdateChecker.php b/app/core/puc/Puc/v4p11/UpdateChecker.php new file mode 100755 index 0000000..a10f6f7 --- /dev/null +++ b/app/core/puc/Puc/v4p11/UpdateChecker.php @@ -0,0 +1,999 @@ +debugMode = (bool)(constant('WP_DEBUG')); + $this->metadataUrl = $metadataUrl; + $this->directoryName = $directoryName; + $this->slug = !empty($slug) ? $slug : $this->directoryName; + + $this->optionName = $optionName; + if ( empty($this->optionName) ) { + //BC: Initially the library only supported plugin updates and didn't use type prefixes + //in the option name. Lets use the same prefix-less name when possible. + if ( $this->filterSuffix === '' ) { + $this->optionName = 'external_updates-' . $this->slug; + } else { + $this->optionName = $this->getUniqueName('external_updates'); + } + } + + $this->package = $this->createInstalledPackage(); + $this->scheduler = $this->createScheduler($checkPeriod); + $this->upgraderStatus = new Puc_v4p11_UpgraderStatus(); + $this->updateState = new Puc_v4p11_StateStore($this->optionName); + + if ( did_action('init') ) { + $this->loadTextDomain(); + } else { + add_action('init', array($this, 'loadTextDomain')); + } + + $this->installHooks(); + } + + /** + * @internal + */ + public function loadTextDomain() { + //We're not using load_plugin_textdomain() or its siblings because figuring out where + //the library is located (plugin, mu-plugin, theme, custom wp-content paths) is messy. + $domain = 'plugin-update-checker'; + $locale = apply_filters( + 'plugin_locale', + (is_admin() && function_exists('get_user_locale')) ? get_user_locale() : get_locale(), + $domain + ); + + $moFile = $domain . '-' . $locale . '.mo'; + $path = realpath(dirname(__FILE__) . '/../../languages'); + + if ($path && file_exists($path)) { + load_textdomain($domain, $path . '/' . $moFile); + } + } + + protected function installHooks() { + //Insert our update info into the update array maintained by WP. + add_filter('site_transient_' . $this->updateTransient, array($this,'injectUpdate')); + + //Insert translation updates into the update list. + add_filter('site_transient_' . $this->updateTransient, array($this, 'injectTranslationUpdates')); + + //Clear translation updates when WP clears the update cache. + //This needs to be done directly because the library doesn't actually remove obsolete plugin updates, + //it just hides them (see getUpdate()). We can't do that with translations - too much disk I/O. + add_action( + 'delete_site_transient_' . $this->updateTransient, + array($this, 'clearCachedTranslationUpdates') + ); + + //Rename the update directory to be the same as the existing directory. + if ( $this->directoryName !== '.' ) { + add_filter('upgrader_source_selection', array($this, 'fixDirectoryName'), 10, 3); + } + + //Allow HTTP requests to the metadata URL even if it's on a local host. + add_filter('http_request_host_is_external', array($this, 'allowMetadataHost'), 10, 2); + + //DebugBar integration. + if ( did_action('plugins_loaded') ) { + $this->maybeInitDebugBar(); + } else { + add_action('plugins_loaded', array($this, 'maybeInitDebugBar')); + } + } + + /** + * Remove hooks that were added by this update checker instance. + */ + public function removeHooks() { + remove_filter('site_transient_' . $this->updateTransient, array($this,'injectUpdate')); + remove_filter('site_transient_' . $this->updateTransient, array($this, 'injectTranslationUpdates')); + remove_action( + 'delete_site_transient_' . $this->updateTransient, + array($this, 'clearCachedTranslationUpdates') + ); + + remove_filter('upgrader_source_selection', array($this, 'fixDirectoryName'), 10); + remove_filter('http_request_host_is_external', array($this, 'allowMetadataHost'), 10); + remove_action('plugins_loaded', array($this, 'maybeInitDebugBar')); + + remove_action('init', array($this, 'loadTextDomain')); + + if ( $this->scheduler ) { + $this->scheduler->removeHooks(); + } + + if ( $this->debugBarExtension ) { + $this->debugBarExtension->removeHooks(); + } + } + + /** + * Check if the current user has the required permissions to install updates. + * + * @return bool + */ + abstract public function userCanInstallUpdates(); + + /** + * Explicitly allow HTTP requests to the metadata URL. + * + * WordPress has a security feature where the HTTP API will reject all requests that are sent to + * another site hosted on the same server as the current site (IP match), a local host, or a local + * IP, unless the host exactly matches the current site. + * + * This feature is opt-in (at least in WP 4.4). Apparently some people enable it. + * + * That can be a problem when you're developing your plugin and you decide to host the update information + * on the same server as your test site. Update requests will mysteriously fail. + * + * We fix that by adding an exception for the metadata host. + * + * @param bool $allow + * @param string $host + * @return bool + */ + public function allowMetadataHost($allow, $host) { + if ( $this->cachedMetadataHost === 0 ) { + $this->cachedMetadataHost = parse_url($this->metadataUrl, PHP_URL_HOST); + } + + if ( is_string($this->cachedMetadataHost) && (strtolower($host) === strtolower($this->cachedMetadataHost)) ) { + return true; + } + return $allow; + } + + /** + * Create a package instance that represents this plugin or theme. + * + * @return Puc_v4p11_InstalledPackage + */ + abstract protected function createInstalledPackage(); + + /** + * @return Puc_v4p11_InstalledPackage + */ + public function getInstalledPackage() { + return $this->package; + } + + /** + * Create an instance of the scheduler. + * + * This is implemented as a method to make it possible for plugins to subclass the update checker + * and substitute their own scheduler. + * + * @param int $checkPeriod + * @return Puc_v4p11_Scheduler + */ + abstract protected function createScheduler($checkPeriod); + + /** + * Check for updates. The results are stored in the DB option specified in $optionName. + * + * @return Puc_v4p11_Update|null + */ + public function checkForUpdates() { + $installedVersion = $this->getInstalledVersion(); + //Fail silently if we can't find the plugin/theme or read its header. + if ( $installedVersion === null ) { + $this->triggerError( + sprintf('Skipping update check for %s - installed version unknown.', $this->slug), + E_USER_WARNING + ); + return null; + } + + //Start collecting API errors. + $this->lastRequestApiErrors = []; + add_action('puc_api_error', array($this, 'collectApiErrors'), 10, 4); + + $state = $this->updateState; + $state->setLastCheckToNow() + ->setCheckedVersion($installedVersion) + ->save(); //Save before checking in case something goes wrong + + $state->setUpdate($this->requestUpdate()); + $state->save(); + + //Stop collecting API errors. + remove_action('puc_api_error', array($this, 'collectApiErrors'), 10); + + return $this->getUpdate(); + } + + /** + * Load the update checker state from the DB. + * + * @return Puc_v4p11_StateStore + */ + public function getUpdateState() { + return $this->updateState->lazyLoad(); + } + + /** + * Reset update checker state - i.e. last check time, cached update data and so on. + * + * Call this when your plugin is being uninstalled, or if you want to + * clear the update cache. + */ + public function resetUpdateState() { + $this->updateState->delete(); + } + + /** + * Get the details of the currently available update, if any. + * + * If no updates are available, or if the last known update version is below or equal + * to the currently installed version, this method will return NULL. + * + * Uses cached update data. To retrieve update information straight from + * the metadata URL, call requestUpdate() instead. + * + * @return Puc_v4p11_Update|null + */ + public function getUpdate() { + $update = $this->updateState->getUpdate(); + + //Is there an update available? + if ( isset($update) ) { + //Check if the update is actually newer than the currently installed version. + $installedVersion = $this->getInstalledVersion(); + if ( ($installedVersion !== null) && version_compare($update->version, $installedVersion, '>') ){ + return $update; + } + } + return null; + } + + /** + * Retrieve the latest update (if any) from the configured API endpoint. + * + * Subclasses should run the update through filterUpdateResult before returning it. + * + * @return Puc_v4p11_Update An instance of Update, or NULL when no updates are available. + */ + abstract public function requestUpdate(); + + /** + * Filter the result of a requestUpdate() call. + * + * @param Puc_v4p11_Update|null $update + * @param array|WP_Error|null $httpResult The value returned by wp_remote_get(), if any. + * @return Puc_v4p11_Update + */ + protected function filterUpdateResult($update, $httpResult = null) { + //Let plugins/themes modify the update. + $update = apply_filters($this->getUniqueName('request_update_result'), $update, $httpResult); + + $this->fixSupportedWordpressVersion($update); + + if ( isset($update, $update->translations) ) { + //Keep only those translation updates that apply to this site. + $update->translations = $this->filterApplicableTranslations($update->translations); + } + + return $update; + } + + /** + * The "Tested up to" field in the plugin metadata is supposed to be in the form of "major.minor", + * while WordPress core's list_plugin_updates() expects the $update->tested field to be an exact + * version, e.g. "major.minor.patch", to say it's compatible. In other case it shows + * "Compatibility: Unknown". + * The function mimics how wordpress.org API crafts the "tested" field out of "Tested up to". + * + * @param Puc_v4p11_Metadata|null $update + */ + protected function fixSupportedWordpressVersion(Puc_v4p11_Metadata $update = null) { + if ( !isset($update->tested) || !preg_match('/^\d++\.\d++$/', $update->tested) ) { + return; + } + + $actualWpVersions = []; + + $wpVersion = $GLOBALS['wp_version']; + + if ( function_exists('get_core_updates') ) { + $coreUpdates = get_core_updates(); + if ( is_array($coreUpdates) ) { + foreach ($coreUpdates as $coreUpdate) { + if ( isset($coreUpdate->current) ) { + $actualWpVersions[] = $coreUpdate->current; + } + } + } + } + + $actualWpVersions[] = $wpVersion; + + $actualWpPatchNumber = null; + foreach ($actualWpVersions as $version) { + if ( preg_match('/^(?P\d++\.\d++)(?:\.(?P\d++))?/', $version, $versionParts) ) { + if ( $versionParts['majorMinor'] === $update->tested ) { + $patch = isset($versionParts['patch']) ? intval($versionParts['patch']) : 0; + if ( $actualWpPatchNumber === null ) { + $actualWpPatchNumber = $patch; + } else { + $actualWpPatchNumber = max($actualWpPatchNumber, $patch); + } + } + } + } + if ( $actualWpPatchNumber === null ) { + $actualWpPatchNumber = 999; + } + + if ( $actualWpPatchNumber > 0 ) { + $update->tested .= '.' . $actualWpPatchNumber; + } + } + + /** + * Get the currently installed version of the plugin or theme. + * + * @return string|null Version number. + */ + public function getInstalledVersion() { + return $this->package->getInstalledVersion(); + } + + /** + * Get the full path of the plugin or theme directory. + * + * @return string + */ + public function getAbsoluteDirectoryPath() { + return $this->package->getAbsoluteDirectoryPath(); + } + + /** + * Trigger a PHP error, but only when $debugMode is enabled. + * + * @param string $message + * @param int $errorType + */ + public function triggerError($message, $errorType) { + if ( $this->isDebugModeEnabled() ) { + trigger_error($message, $errorType); + } + } + + /** + * @return bool + */ + protected function isDebugModeEnabled() { + if ( $this->debugMode === null ) { + $this->debugMode = (bool)(constant('WP_DEBUG')); + } + return $this->debugMode; + } + + /** + * Get the full name of an update checker filter, action or DB entry. + * + * This method adds the "puc_" prefix and the "-$slug" suffix to the filter name. + * For example, "pre_inject_update" becomes "puc_pre_inject_update-plugin-slug". + * + * @param string $baseTag + * @return string + */ + public function getUniqueName($baseTag) { + $name = 'puc_' . $baseTag; + if ( $this->filterSuffix !== '' ) { + $name .= '_' . $this->filterSuffix; + } + return $name . '-' . $this->slug; + } + + /** + * Store API errors that are generated when checking for updates. + * + * @internal + * @param WP_Error $error + * @param array|null $httpResponse + * @param string|null $url + * @param string|null $slug + */ + public function collectApiErrors($error, $httpResponse = null, $url = null, $slug = null) { + if ( isset($slug) && ($slug !== $this->slug) ) { + return; + } + + $this->lastRequestApiErrors[] = array( + 'error' => $error, + 'httpResponse' => $httpResponse, + 'url' => $url, + ); + } + + /** + * @return array + */ + public function getLastRequestApiErrors() { + return $this->lastRequestApiErrors; + } + + /* ------------------------------------------------------------------- + * PUC filters and filter utilities + * ------------------------------------------------------------------- + */ + + /** + * Register a callback for one of the update checker filters. + * + * Identical to add_filter(), except it automatically adds the "puc_" prefix + * and the "-$slug" suffix to the filter name. For example, "request_info_result" + * becomes "puc_request_info_result-your_plugin_slug". + * + * @param string $tag + * @param callable $callback + * @param int $priority + * @param int $acceptedArgs + */ + public function addFilter($tag, $callback, $priority = 10, $acceptedArgs = 1) { + add_filter($this->getUniqueName($tag), $callback, $priority, $acceptedArgs); + } + + /* ------------------------------------------------------------------- + * Inject updates + * ------------------------------------------------------------------- + */ + + /** + * Insert the latest update (if any) into the update list maintained by WP. + * + * @param stdClass $updates Update list. + * @return stdClass Modified update list. + */ + public function injectUpdate($updates) { + //Is there an update to insert? + $update = $this->getUpdate(); + + if ( !$this->shouldShowUpdates() ) { + $update = null; + } + + if ( !empty($update) ) { + //Let plugins filter the update info before it's passed on to WordPress. + $update = apply_filters($this->getUniqueName('pre_inject_update'), $update); + $updates = $this->addUpdateToList($updates, $update->toWpFormat()); + } else { + //Clean up any stale update info. + $updates = $this->removeUpdateFromList($updates); + //Add a placeholder item to the "no_update" list to enable auto-update support. + //If we don't do this, the option to enable automatic updates will only show up + //when an update is available. + $updates = $this->addNoUpdateItem($updates); + } + + return $updates; + } + + /** + * @param stdClass|null $updates + * @param stdClass|array $updateToAdd + * @return stdClass + */ + protected function addUpdateToList($updates, $updateToAdd) { + if ( !is_object($updates) ) { + $updates = new stdClass(); + $updates->response = []; + } + + $updates->response[$this->getUpdateListKey()] = $updateToAdd; + return $updates; + } + + /** + * @param stdClass|null $updates + * @return stdClass|null + */ + protected function removeUpdateFromList($updates) { + if ( isset($updates, $updates->response) ) { + unset($updates->response[$this->getUpdateListKey()]); + } + return $updates; + } + + /** + * See this post for more information: + * @link https://make.wordpress.org/core/2020/07/30/recommended-usage-of-the-updates-api-to-support-the-auto-updates-ui-for-plugins-and-themes-in-wordpress-5-5/ + * + * @param stdClass|null $updates + * @return stdClass + */ + protected function addNoUpdateItem($updates) { + if ( !is_object($updates) ) { + $updates = new stdClass(); + $updates->response = []; + $updates->no_update = []; + } else if ( !isset($updates->no_update) ) { + $updates->no_update = []; + } + + $updates->no_update[$this->getUpdateListKey()] = (object) $this->getNoUpdateItemFields(); + + return $updates; + } + + /** + * Subclasses should override this method to add fields that are specific to plugins or themes. + * @return array + */ + protected function getNoUpdateItemFields() { + return array( + 'new_version' => $this->getInstalledVersion(), + 'url' => '', + 'package' => '', + 'requires_php' => '', + ); + } + + /** + * Get the key that will be used when adding updates to the update list that's maintained + * by the WordPress core. The list is always an associative array, but the key is different + * for plugins and themes. + * + * @return string + */ + abstract protected function getUpdateListKey(); + + /** + * Should we show available updates? + * + * Usually the answer is "yes", but there are exceptions. For example, WordPress doesn't + * support automatic updates installation for mu-plugins, so PUC usually won't show update + * notifications in that case. See the plugin-specific subclass for details. + * + * Note: This method only applies to updates that are displayed (or not) in the WordPress + * admin. It doesn't affect APIs like requestUpdate and getUpdate. + * + * @return bool + */ + protected function shouldShowUpdates() { + return true; + } + + /* ------------------------------------------------------------------- + * JSON-based update API + * ------------------------------------------------------------------- + */ + + /** + * Retrieve plugin or theme metadata from the JSON document at $this->metadataUrl. + * + * @param string $metaClass Parse the JSON as an instance of this class. It must have a static fromJson method. + * @param string $filterRoot + * @param array $queryArgs Additional query arguments. + * @return array [Puc_v4p11_Metadata|null, array|WP_Error] A metadata instance and the value returned by wp_remote_get(). + */ + protected function requestMetadata($metaClass, $filterRoot, $queryArgs = array()) { + //Query args to append to the URL. Plugins can add their own by using a filter callback (see addQueryArgFilter()). + $queryArgs = array_merge( + array( + 'installed_version' => strval($this->getInstalledVersion()), + 'php' => phpversion(), + 'locale' => get_locale(), + ), + $queryArgs + ); + $queryArgs = apply_filters($this->getUniqueName($filterRoot . '_query_args'), $queryArgs); + + //Various options for the wp_remote_get() call. Plugins can filter these, too. + $options = array( + 'timeout' => 10, //seconds + 'headers' => array( + 'Accept' => 'application/json', + ), + 'user-agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36', + + ); + $options = apply_filters($this->getUniqueName($filterRoot . '_options'), $options); + + //The metadata file should be at 'http://your-api.com/url/here/$slug/info.json' + $url = $this->metadataUrl; + if ( !empty($queryArgs) ){ + $url = add_query_arg($queryArgs, $url); + } + + $result = wp_remote_get($url, $options); + + $result = apply_filters($this->getUniqueName('request_metadata_http_result'), $result, $url, $options); + + //Try to parse the response + $status = $this->validateApiResponse($result); + $metadata = null; + if ( !is_wp_error($status) ){ + if ( version_compare(PHP_VERSION, '5.3', '>=') && (strpos($metaClass, '\\') === false) ) { + $metaClass = __NAMESPACE__ . '\\' . $metaClass; + } + $metadata = call_user_func(array($metaClass, 'fromJson'), $result['body']); + } else { + do_action('puc_api_error', $status, $result, $url, $this->slug); + $this->triggerError( + sprintf('The URL %s does not point to a valid metadata file. ', $url) + . $status->get_error_message(), + E_USER_WARNING + ); + } + + return array($metadata, $result); + } + + /** + * Check if $result is a successful update API response. + * + * @param array|WP_Error $result + * @return true|WP_Error + */ + protected function validateApiResponse($result) { + if ( is_wp_error($result) ) { /** @var WP_Error $result */ + return new WP_Error($result->get_error_code(), 'WP HTTP Error: ' . $result->get_error_message()); + } + + if ( !isset($result['response']['code']) ) { + return new WP_Error( + 'puc_no_response_code', + 'wp_remote_get() returned an unexpected result.' + ); + } + + if ( $result['response']['code'] !== 200 ) { + return new WP_Error( + 'puc_unexpected_response_code', + 'HTTP response code is ' . $result['response']['code'] . ' (expected: 200)' + ); + } + + if ( empty($result['body']) ) { + return new WP_Error('puc_empty_response', 'The metadata file appears to be empty.'); + } + + return true; + } + + /* ------------------------------------------------------------------- + * Language packs / Translation updates + * ------------------------------------------------------------------- + */ + + /** + * Filter a list of translation updates and return a new list that contains only updates + * that apply to the current site. + * + * @param array $translations + * @return array + */ + protected function filterApplicableTranslations($translations) { + $languages = array_flip(array_values(get_available_languages())); + $installedTranslations = $this->getInstalledTranslations(); + + $applicableTranslations = []; + foreach ($translations as $translation) { + //Does it match one of the available core languages? + $isApplicable = array_key_exists($translation->language, $languages); + //Is it more recent than an already-installed translation? + if ( isset($installedTranslations[$translation->language]) ) { + $updateTimestamp = strtotime($translation->updated); + $installedTimestamp = strtotime($installedTranslations[$translation->language]['PO-Revision-Date']); + $isApplicable = $updateTimestamp > $installedTimestamp; + } + + if ( $isApplicable ) { + $applicableTranslations[] = $translation; + } + } + + return $applicableTranslations; + } + + /** + * Get a list of installed translations for this plugin or theme. + * + * @return array + */ + protected function getInstalledTranslations() { + if ( !function_exists('wp_get_installed_translations') ) { + return []; + } + $installedTranslations = wp_get_installed_translations($this->translationType . 's'); + if ( isset($installedTranslations[$this->directoryName]) ) { + $installedTranslations = $installedTranslations[$this->directoryName]; + } else { + $installedTranslations = []; + } + return $installedTranslations; + } + + /** + * Insert translation updates into the list maintained by WordPress. + * + * @param stdClass $updates + * @return stdClass + */ + public function injectTranslationUpdates($updates) { + $translationUpdates = $this->getTranslationUpdates(); + if ( empty($translationUpdates) ) { + return $updates; + } + + //Being defensive. + if ( !is_object($updates) ) { + $updates = new stdClass(); + } + if ( !isset($updates->translations) ) { + $updates->translations = []; + } + + //In case there's a name collision with a plugin or theme hosted on wordpress.org, + //remove any preexisting updates that match our thing. + $updates->translations = array_values(array_filter( + $updates->translations, + array($this, 'isNotMyTranslation') + )); + + //Add our updates to the list. + foreach($translationUpdates as $update) { + $convertedUpdate = array_merge( + array( + 'type' => $this->translationType, + 'slug' => $this->directoryName, + 'autoupdate' => 0, + //AFAICT, WordPress doesn't actually use the "version" field for anything. + //But lets make sure it's there, just in case. + 'version' => isset($update->version) ? $update->version : ('1.' . strtotime($update->updated)), + ), + (array)$update + ); + + $updates->translations[] = $convertedUpdate; + } + + return $updates; + } + + /** + * Get a list of available translation updates. + * + * This method will return an empty array if there are no updates. + * Uses cached update data. + * + * @return array + */ + public function getTranslationUpdates() { + return $this->updateState->getTranslations(); + } + + /** + * Remove all cached translation updates. + * + * @see wp_clean_update_cache + */ + public function clearCachedTranslationUpdates() { + $this->updateState->setTranslations(array()); + } + + /** + * Filter callback. Keeps only translations that *don't* match this plugin or theme. + * + * @param array $translation + * @return bool + */ + protected function isNotMyTranslation($translation) { + $isMatch = isset($translation['type'], $translation['slug']) + && ($translation['type'] === $this->translationType) + && ($translation['slug'] === $this->directoryName); + + return !$isMatch; + } + + /* ------------------------------------------------------------------- + * Fix directory name when installing updates + * ------------------------------------------------------------------- + */ + + /** + * Rename the update directory to match the existing plugin/theme directory. + * + * When WordPress installs a plugin or theme update, it assumes that the ZIP file will contain + * exactly one directory, and that the directory name will be the same as the directory where + * the plugin or theme is currently installed. + * + * GitHub and other repositories provide ZIP downloads, but they often use directory names like + * "project-branch" or "project-tag-hash". We need to change the name to the actual plugin folder. + * + * This is a hook callback. Don't call it from a plugin. + * + * @access protected + * + * @param string $source The directory to copy to /wp-content/plugins or /wp-content/themes. Usually a subdirectory of $remoteSource. + * @param string $remoteSource WordPress has extracted the update to this directory. + * @param WP_Upgrader $upgrader + * @return string|WP_Error + */ + public function fixDirectoryName($source, $remoteSource, $upgrader) { + global $wp_filesystem; + /** @var WP_Filesystem_Base $wp_filesystem */ + + //Basic sanity checks. + if ( !isset($source, $remoteSource, $upgrader, $upgrader->skin, $wp_filesystem) ) { + return $source; + } + + //If WordPress is upgrading anything other than our plugin/theme, leave the directory name unchanged. + if ( !$this->isBeingUpgraded($upgrader) ) { + return $source; + } + + //Rename the source to match the existing directory. + $correctedSource = trailingslashit($remoteSource) . $this->directoryName . '/'; + if ( $source !== $correctedSource ) { + //The update archive should contain a single directory that contains the rest of plugin/theme files. + //Otherwise, WordPress will try to copy the entire working directory ($source == $remoteSource). + //We can't rename $remoteSource because that would break WordPress code that cleans up temporary files + //after update. + if ( $this->isBadDirectoryStructure($remoteSource) ) { + return new WP_Error( + 'puc-incorrect-directory-structure', + sprintf( + 'The directory structure of the update is incorrect. All files should be inside ' . + 'a directory named %s, not at the root of the ZIP archive.', + htmlentities($this->slug) + ) + ); + } + + /** @var WP_Upgrader_Skin $upgrader ->skin */ + $upgrader->skin->feedback(sprintf( + 'Renaming %s to %s…', + '' . basename($source) . '', + '' . $this->directoryName . '' + )); + + if ( $wp_filesystem->move($source, $correctedSource, true) ) { + $upgrader->skin->feedback('Directory successfully renamed.'); + return $correctedSource; + } else { + return new WP_Error( + 'puc-rename-failed', + 'Unable to rename the update to match the existing directory.' + ); + } + } + + return $source; + } + + /** + * Is there an update being installed right now, for this plugin or theme? + * + * @param WP_Upgrader|null $upgrader The upgrader that's performing the current update. + * @return bool + */ + abstract public function isBeingUpgraded($upgrader = null); + + /** + * Check for incorrect update directory structure. An update must contain a single directory, + * all other files should be inside that directory. + * + * @param string $remoteSource Directory path. + * @return bool + */ + protected function isBadDirectoryStructure($remoteSource) { + global $wp_filesystem; + /** @var WP_Filesystem_Base $wp_filesystem */ + + $sourceFiles = $wp_filesystem->dirlist($remoteSource); + if ( is_array($sourceFiles) ) { + $sourceFiles = array_keys($sourceFiles); + $firstFilePath = trailingslashit($remoteSource) . $sourceFiles[0]; + return (count($sourceFiles) > 1) || (!$wp_filesystem->is_dir($firstFilePath)); + } + + //Assume it's fine. + return false; + } + + /* ------------------------------------------------------------------- + * DebugBar integration + * ------------------------------------------------------------------- + */ + + /** + * Initialize the update checker Debug Bar plugin/add-on thingy. + */ + public function maybeInitDebugBar() { + if ( class_exists('Debug_Bar', false) && file_exists(dirname(__FILE__) . '/DebugBar') ) { + $this->debugBarExtension = $this->createDebugBarExtension(); + } + } + + protected function createDebugBarExtension() { + return new Puc_v4p11_DebugBar_Extension($this); + } + + /** + * Display additional configuration details in the Debug Bar panel. + * + * @param Puc_v4p11_DebugBar_Panel $panel + */ + public function onDisplayConfiguration($panel) { + //Do nothing. Subclasses can use this to add additional info to the panel. + } + + } + +endif; diff --git a/app/core/puc/Puc/v4p11/UpgraderStatus.php b/app/core/puc/Puc/v4p11/UpgraderStatus.php new file mode 100755 index 0000000..38575db --- /dev/null +++ b/app/core/puc/Puc/v4p11/UpgraderStatus.php @@ -0,0 +1,199 @@ +isBeingUpgraded('plugin', $pluginFile, $upgrader); + } + + /** + * Is there an update being installed for a specific theme? + * + * @param string $stylesheet Theme directory name. + * @param WP_Upgrader|null $upgrader The upgrader that's performing the current update. + * @return bool + */ + public function isThemeBeingUpgraded($stylesheet, $upgrader = null) { + return $this->isBeingUpgraded('theme', $stylesheet, $upgrader); + } + + /** + * Check if a specific theme or plugin is being upgraded. + * + * @param string $type + * @param string $id + * @param Plugin_Upgrader|WP_Upgrader|null $upgrader + * @return bool + */ + protected function isBeingUpgraded($type, $id, $upgrader = null) { + if ( isset($upgrader) ) { + list($currentType, $currentId) = $this->getThingBeingUpgradedBy($upgrader); + if ( $currentType !== null ) { + $this->currentType = $currentType; + $this->currentId = $currentId; + } + } + return ($this->currentType === $type) && ($this->currentId === $id); + } + + /** + * Figure out which theme or plugin is being upgraded by a WP_Upgrader instance. + * + * Returns an array with two items. The first item is the type of the thing that's being + * upgraded: "plugin" or "theme". The second item is either the plugin basename or + * the theme directory name. If we can't determine what the upgrader is doing, both items + * will be NULL. + * + * Examples: + * ['plugin', 'plugin-dir-name/plugin.php'] + * ['theme', 'theme-dir-name'] + * + * @param Plugin_Upgrader|WP_Upgrader $upgrader + * @return array + */ + private function getThingBeingUpgradedBy($upgrader) { + if ( !isset($upgrader, $upgrader->skin) ) { + return array(null, null); + } + + //Figure out which plugin or theme is being upgraded. + $pluginFile = null; + $themeDirectoryName = null; + + $skin = $upgrader->skin; + if ( isset($skin->theme_info) && ($skin->theme_info instanceof WP_Theme) ) { + $themeDirectoryName = $skin->theme_info->get_stylesheet(); + } elseif ( $skin instanceof Plugin_Upgrader_Skin ) { + if ( isset($skin->plugin) && is_string($skin->plugin) && ($skin->plugin !== '') ) { + $pluginFile = $skin->plugin; + } + } elseif ( $skin instanceof Theme_Upgrader_Skin ) { + if ( isset($skin->theme) && is_string($skin->theme) && ($skin->theme !== '') ) { + $themeDirectoryName = $skin->theme; + } + } elseif ( isset($skin->plugin_info) && is_array($skin->plugin_info) ) { + //This case is tricky because Bulk_Plugin_Upgrader_Skin (etc) doesn't actually store the plugin + //filename anywhere. Instead, it has the plugin headers in $plugin_info. So the best we can + //do is compare those headers to the headers of installed plugins. + $pluginFile = $this->identifyPluginByHeaders($skin->plugin_info); + } + + if ( $pluginFile !== null ) { + return array('plugin', $pluginFile); + } elseif ( $themeDirectoryName !== null ) { + return array('theme', $themeDirectoryName); + } + return array(null, null); + } + + /** + * Identify an installed plugin based on its headers. + * + * @param array $searchHeaders The plugin file header to look for. + * @return string|null Plugin basename ("foo/bar.php"), or NULL if we can't identify the plugin. + */ + private function identifyPluginByHeaders($searchHeaders) { + if ( !function_exists('get_plugins') ){ + /** @noinspection PhpIncludeInspection */ + require_once( ABSPATH . '/wp-admin/includes/plugin.php' ); + } + + $installedPlugins = get_plugins(); + $matches = []; + foreach($installedPlugins as $pluginBasename => $headers) { + $diff1 = array_diff_assoc($headers, $searchHeaders); + $diff2 = array_diff_assoc($searchHeaders, $headers); + if ( empty($diff1) && empty($diff2) ) { + $matches[] = $pluginBasename; + } + } + + //It's possible (though very unlikely) that there could be two plugins with identical + //headers. In that case, we can't unambiguously identify the plugin that's being upgraded. + if ( count($matches) !== 1 ) { + return null; + } + + return reset($matches); + } + + /** + * @access private + * + * @param mixed $input + * @param array $hookExtra + * @return mixed Returns $input unaltered. + */ + public function setUpgradedThing($input, $hookExtra) { + if ( !empty($hookExtra['plugin']) && is_string($hookExtra['plugin']) ) { + $this->currentId = $hookExtra['plugin']; + $this->currentType = 'plugin'; + } elseif ( !empty($hookExtra['theme']) && is_string($hookExtra['theme']) ) { + $this->currentId = $hookExtra['theme']; + $this->currentType = 'theme'; + } else { + $this->currentType = null; + $this->currentId = null; + } + return $input; + } + + /** + * @access private + * + * @param array $options + * @return array + */ + public function setUpgradedPluginFromOptions($options) { + if ( isset($options['hook_extra']['plugin']) && is_string($options['hook_extra']['plugin']) ) { + $this->currentType = 'plugin'; + $this->currentId = $options['hook_extra']['plugin']; + } else { + $this->currentType = null; + $this->currentId = null; + } + return $options; + } + + /** + * @access private + * + * @param mixed $input + * @return mixed Returns $input unaltered. + */ + public function clearUpgradedThing($input = null) { + $this->currentId = null; + $this->currentType = null; + return $input; + } + } + +endif; diff --git a/app/core/puc/Puc/v4p11/Utils.php b/app/core/puc/Puc/v4p11/Utils.php new file mode 100755 index 0000000..62ce66d --- /dev/null +++ b/app/core/puc/Puc/v4p11/Utils.php @@ -0,0 +1,69 @@ +$node) ) { + $currentValue = $currentValue->$node; + } else { + return $default; + } + } + + return $currentValue; + } + + /** + * Get the first array element that is not empty. + * + * @param array $values + * @param mixed|null $default Returns this value if there are no non-empty elements. + * @return mixed|null + */ + public static function findNotEmpty($values, $default = null) { + if ( empty($values) ) { + return $default; + } + + foreach ($values as $value) { + if ( !empty($value) ) { + return $value; + } + } + + return $default; + } + + /** + * Check if the input string starts with the specified prefix. + * + * @param string $input + * @param string $prefix + * @return bool + */ + public static function startsWith($input, $prefix) { + $length = strlen($prefix); + return (substr($input, 0, $length) === $prefix); + } + } + +endif; diff --git a/app/core/puc/Puc/v4p11/Vcs/Api.php b/app/core/puc/Puc/v4p11/Vcs/Api.php new file mode 100755 index 0000000..251c675 --- /dev/null +++ b/app/core/puc/Puc/v4p11/Vcs/Api.php @@ -0,0 +1,302 @@ +repositoryUrl = $repositoryUrl; + $this->setAuthentication($credentials); + } + + /** + * @return string + */ + public function getRepositoryUrl() { + return $this->repositoryUrl; + } + + /** + * Figure out which reference (i.e tag or branch) contains the latest version. + * + * @param string $configBranch Start looking in this branch. + * @return null|Puc_v4p11_Vcs_Reference + */ + abstract public function chooseReference($configBranch); + + /** + * Get the readme.txt file from the remote repository and parse it + * according to the plugin readme standard. + * + * @param string $ref Tag or branch name. + * @return array Parsed readme. + */ + public function getRemoteReadme($ref = 'master') { + $fileContents = $this->getRemoteFile($this->getLocalReadmeName(), $ref); + if ( empty($fileContents) ) { + return []; + } + + $parser = new PucReadmeParser(); + return $parser->parse_readme_contents($fileContents); + } + + /** + * Get the case-sensitive name of the local readme.txt file. + * + * In most cases it should just be called "readme.txt", but some plugins call it "README.txt", + * "README.TXT", or even "Readme.txt". Most VCS are case-sensitive so we need to know the correct + * capitalization. + * + * Defaults to "readme.txt" (all lowercase). + * + * @return string + */ + public function getLocalReadmeName() { + static $fileName = null; + if ( $fileName !== null ) { + return $fileName; + } + + $fileName = 'readme.txt'; + if ( isset($this->localDirectory) ) { + $files = scandir($this->localDirectory); + if ( !empty($files) ) { + foreach ($files as $possibleFileName) { + if ( strcasecmp($possibleFileName, 'readme.txt') === 0 ) { + $fileName = $possibleFileName; + break; + } + } + } + } + return $fileName; + } + + /** + * Get a branch. + * + * @param string $branchName + * @return Puc_v4p11_Vcs_Reference|null + */ + abstract public function getBranch($branchName); + + /** + * Get a specific tag. + * + * @param string $tagName + * @return Puc_v4p11_Vcs_Reference|null + */ + abstract public function getTag($tagName); + + /** + * Get the tag that looks like the highest version number. + * (Implementations should skip pre-release versions if possible.) + * + * @return Puc_v4p11_Vcs_Reference|null + */ + abstract public function getLatestTag(); + + /** + * Check if a tag name string looks like a version number. + * + * @param string $name + * @return bool + */ + protected function looksLikeVersion($name) { + //Tag names may be prefixed with "v", e.g. "v1.2.3". + $name = ltrim($name, 'v'); + + //The version string must start with a number. + if ( !is_numeric(substr($name, 0, 1)) ) { + return false; + } + + //The goal is to accept any SemVer-compatible or "PHP-standardized" version number. + return (preg_match('@^(\d{1,5}?)(\.\d{1,10}?){0,4}?($|[abrdp+_\-]|\s)@i', $name) === 1); + } + + /** + * Check if a tag appears to be named like a version number. + * + * @param stdClass $tag + * @return bool + */ + protected function isVersionTag($tag) { + $property = $this->tagNameProperty; + return isset($tag->$property) && $this->looksLikeVersion($tag->$property); + } + + /** + * Sort a list of tags as if they were version numbers. + * Tags that don't look like version number will be removed. + * + * @param stdClass[] $tags Array of tag objects. + * @return stdClass[] Filtered array of tags sorted in descending order. + */ + protected function sortTagsByVersion($tags) { + //Keep only those tags that look like version numbers. + $versionTags = array_filter($tags, array($this, 'isVersionTag')); + //Sort them in descending order. + usort($versionTags, array($this, 'compareTagNames')); + + return $versionTags; + } + + /** + * Compare two tags as if they were version number. + * + * @param stdClass $tag1 Tag object. + * @param stdClass $tag2 Another tag object. + * @return int + */ + protected function compareTagNames($tag1, $tag2) { + $property = $this->tagNameProperty; + if ( !isset($tag1->$property) ) { + return 1; + } + if ( !isset($tag2->$property) ) { + return -1; + } + return -version_compare(ltrim($tag1->$property, 'v'), ltrim($tag2->$property, 'v')); + } + + /** + * Get the contents of a file from a specific branch or tag. + * + * @param string $path File name. + * @param string $ref + * @return null|string Either the contents of the file, or null if the file doesn't exist or there's an error. + */ + abstract public function getRemoteFile($path, $ref = 'master'); + + /** + * Get the timestamp of the latest commit that changed the specified branch or tag. + * + * @param string $ref Reference name (e.g. branch or tag). + * @return string|null + */ + abstract public function getLatestCommitTime($ref); + + /** + * Get the contents of the changelog file from the repository. + * + * @param string $ref + * @param string $localDirectory Full path to the local plugin or theme directory. + * @return null|string The HTML contents of the changelog. + */ + public function getRemoteChangelog($ref, $localDirectory) { + $filename = $this->findChangelogName($localDirectory); + if ( empty($filename) ) { + return null; + } + + $changelog = $this->getRemoteFile($filename, $ref); + if ( $changelog === null ) { + return null; + } + + /** @noinspection PhpUndefinedClassInspection */ + return Parsedown::instance()->text($changelog); + } + + /** + * Guess the name of the changelog file. + * + * @param string $directory + * @return string|null + */ + protected function findChangelogName($directory = null) { + if ( !isset($directory) ) { + $directory = $this->localDirectory; + } + if ( empty($directory) || !is_dir($directory) || ($directory === '.') ) { + return null; + } + + $possibleNames = array('CHANGES.md', 'CHANGELOG.md', 'changes.md', 'changelog.md'); + $files = scandir($directory); + $foundNames = array_intersect($possibleNames, $files); + + if ( !empty($foundNames) ) { + return reset($foundNames); + } + return null; + } + + /** + * Set authentication credentials. + * + * @param $credentials + */ + public function setAuthentication($credentials) { + $this->credentials = $credentials; + } + + public function isAuthenticationEnabled() { + return !empty($this->credentials); + } + + /** + * @param string $url + * @return string + */ + public function signDownloadUrl($url) { + return $url; + } + + /** + * @param string $filterName + */ + public function setHttpFilterName($filterName) { + $this->httpFilterName = $filterName; + } + + /** + * @param string $directory + */ + public function setLocalDirectory($directory) { + if ( empty($directory) || !is_dir($directory) || ($directory === '.') ) { + $this->localDirectory = null; + } else { + $this->localDirectory = $directory; + } + } + + /** + * @param string $slug + */ + public function setSlug($slug) { + $this->slug = $slug; + } + } + +endif; diff --git a/app/core/puc/Puc/v4p11/Vcs/BaseChecker.php b/app/core/puc/Puc/v4p11/Vcs/BaseChecker.php new file mode 100755 index 0000000..6cf5211 --- /dev/null +++ b/app/core/puc/Puc/v4p11/Vcs/BaseChecker.php @@ -0,0 +1,27 @@ +[^/]+?)/(?P[^/#?&]+?)/?$@', $path, $matches) ) { + $this->username = $matches['username']; + $this->repository = $matches['repository']; + } else { + throw new InvalidArgumentException('Invalid BitBucket repository URL: "' . $repositoryUrl . '"'); + } + + parent::__construct($repositoryUrl, $credentials); + } + + /** + * Figure out which reference (i.e tag or branch) contains the latest version. + * + * @param string $configBranch Start looking in this branch. + * @return null|Puc_v4p11_Vcs_Reference + */ + public function chooseReference($configBranch) { + $updateSource = null; + + //Check if there's a "Stable tag: 1.2.3" header that points to a valid tag. + $updateSource = $this->getStableTag($configBranch); + + //Look for version-like tags. + if ( !$updateSource && ($configBranch === 'master' || $configBranch === 'main') ) { + $updateSource = $this->getLatestTag(); + } + //If all else fails, use the specified branch itself. + if ( !$updateSource ) { + $updateSource = $this->getBranch($configBranch); + } + + return $updateSource; + } + + public function getBranch($branchName) { + $branch = $this->api('/refs/branches/' . $branchName); + if ( is_wp_error($branch) || empty($branch) ) { + return null; + } + + //The "/src/{stuff}/{path}" endpoint doesn't seem to handle branch names that contain slashes. + //If we don't encode the slash, we get a 404. If we encode it as "%2F", we get a 401. + //To avoid issues, if the branch name is not URL-safe, let's use the commit hash instead. + $ref = $branch->name; + if ((urlencode($ref) !== $ref) && isset($branch->target->hash)) { + $ref = $branch->target->hash; + } + + return new Puc_v4p11_Vcs_Reference(array( + 'name' => $ref, + 'updated' => $branch->target->date, + 'downloadUrl' => $this->getDownloadUrl($branch->name), + )); + } + + /** + * Get a specific tag. + * + * @param string $tagName + * @return Puc_v4p11_Vcs_Reference|null + */ + public function getTag($tagName) { + $tag = $this->api('/refs/tags/' . $tagName); + if ( is_wp_error($tag) || empty($tag) ) { + return null; + } + + return new Puc_v4p11_Vcs_Reference(array( + 'name' => $tag->name, + 'version' => ltrim($tag->name, 'v'), + 'updated' => $tag->target->date, + 'downloadUrl' => $this->getDownloadUrl($tag->name), + )); + } + + /** + * Get the tag that looks like the highest version number. + * + * @return Puc_v4p11_Vcs_Reference|null + */ + public function getLatestTag() { + $tags = $this->api('/refs/tags?sort=-target.date'); + if ( !isset($tags, $tags->values) || !is_array($tags->values) ) { + return null; + } + + //Filter and sort the list of tags. + $versionTags = $this->sortTagsByVersion($tags->values); + + //Return the first result. + if ( !empty($versionTags) ) { + $tag = $versionTags[0]; + return new Puc_v4p11_Vcs_Reference(array( + 'name' => $tag->name, + 'version' => ltrim($tag->name, 'v'), + 'updated' => $tag->target->date, + 'downloadUrl' => $this->getDownloadUrl($tag->name), + )); + } + return null; + } + + /** + * Get the tag/ref specified by the "Stable tag" header in the readme.txt of a given branch. + * + * @param string $branch + * @return null|Puc_v4p11_Vcs_Reference + */ + protected function getStableTag($branch) { + $remoteReadme = $this->getRemoteReadme($branch); + if ( !empty($remoteReadme['stable_tag']) ) { + $tag = $remoteReadme['stable_tag']; + + //You can explicitly opt out of using tags by setting "Stable tag" to + //"trunk" or the name of the current branch. + if ( ($tag === $branch) || ($tag === 'trunk') ) { + return $this->getBranch($branch); + } + + return $this->getTag($tag); + } + + return null; + } + + /** + * @param string $ref + * @return string + */ + protected function getDownloadUrl($ref) { + return sprintf( + 'https://bitbucket.org/%s/%s/get/%s.zip', + $this->username, + $this->repository, + $ref + ); + } + + /** + * Get the contents of a file from a specific branch or tag. + * + * @param string $path File name. + * @param string $ref + * @return null|string Either the contents of the file, or null if the file doesn't exist or there's an error. + */ + public function getRemoteFile($path, $ref = 'master') { + $response = $this->api('src/' . $ref . '/' . ltrim($path)); + if ( is_wp_error($response) || !is_string($response) ) { + return null; + } + return $response; + } + + /** + * Get the timestamp of the latest commit that changed the specified branch or tag. + * + * @param string $ref Reference name (e.g. branch or tag). + * @return string|null + */ + public function getLatestCommitTime($ref) { + $response = $this->api('commits/' . $ref); + if ( isset($response->values, $response->values[0], $response->values[0]->date) ) { + return $response->values[0]->date; + } + return null; + } + + /** + * Perform a BitBucket API 2.0 request. + * + * @param string $url + * @param string $version + * @return mixed|WP_Error + */ + public function api($url, $version = '2.0') { + $url = ltrim($url, '/'); + $isSrcResource = Puc_v4p11_Utils::startsWith($url, 'src/'); + + $url = implode('/', array( + 'https://api.bitbucket.org', + $version, + 'repositories', + $this->username, + $this->repository, + $url + )); + $baseUrl = $url; + + if ( $this->oauth ) { + $url = $this->oauth->sign($url,'GET'); + } + + $options = array('timeout' => 10); + if ( !empty($this->httpFilterName) ) { + $options = apply_filters($this->httpFilterName, $options); + } + $response = wp_remote_get($url, $options); + if ( is_wp_error($response) ) { + do_action('puc_api_error', $response, null, $url, $this->slug); + return $response; + } + + $code = wp_remote_retrieve_response_code($response); + $body = wp_remote_retrieve_body($response); + if ( $code === 200 ) { + if ( $isSrcResource ) { + //Most responses are JSON-encoded, but src resources just + //return raw file contents. + $document = $body; + } else { + $document = json_decode($body); + } + return $document; + } + + $error = new WP_Error( + 'puc-bitbucket-http-error', + sprintf('BitBucket API error. Base URL: "%s", HTTP status code: %d.', $baseUrl, $code) + ); + do_action('puc_api_error', $error, $response, $url, $this->slug); + + return $error; + } + + /** + * @param array $credentials + */ + public function setAuthentication($credentials) { + parent::setAuthentication($credentials); + + if ( !empty($credentials) && !empty($credentials['consumer_key']) ) { + $this->oauth = new Puc_v4p11_OAuthSignature( + $credentials['consumer_key'], + $credentials['consumer_secret'] + ); + } else { + $this->oauth = null; + } + } + + public function signDownloadUrl($url) { + //Add authentication data to download URLs. Since OAuth signatures incorporate + //timestamps, we have to do this immediately before inserting the update. Otherwise + //authentication could fail due to a stale timestamp. + if ( $this->oauth ) { + $url = $this->oauth->sign($url); + } + return $url; + } + } + +endif; diff --git a/app/core/puc/Puc/v4p11/Vcs/GitHubApi.php b/app/core/puc/Puc/v4p11/Vcs/GitHubApi.php new file mode 100755 index 0000000..310a746 --- /dev/null +++ b/app/core/puc/Puc/v4p11/Vcs/GitHubApi.php @@ -0,0 +1,441 @@ +[^/]+?)/(?P[^/#?&]+?)/?$@', $path, $matches) ) { + $this->userName = $matches['username']; + $this->repositoryName = $matches['repository']; + } else { + throw new InvalidArgumentException('Invalid GitHub repository URL: "' . $repositoryUrl . '"'); + } + + parent::__construct($repositoryUrl, $accessToken); + } + + /** + * Get the latest release from GitHub. + * + * @return Puc_v4p11_Vcs_Reference|null + */ + public function getLatestRelease() { + $release = $this->api('/repos/:user/:repo/releases/latest'); + if ( is_wp_error($release) || !is_object($release) || !isset($release->tag_name) ) { + return null; + } + + $reference = new Puc_v4p11_Vcs_Reference(array( + 'name' => $release->tag_name, + 'version' => ltrim($release->tag_name, 'v'), //Remove the "v" prefix from "v1.2.3". + 'downloadUrl' => $release->zipball_url, + 'updated' => $release->created_at, + 'apiResponse' => $release, + )); + + if ( isset($release->assets[0]) ) { + $reference->downloadCount = $release->assets[0]->download_count; + } + + if ( $this->releaseAssetsEnabled && isset($release->assets, $release->assets[0]) ) { + //Use the first release asset that matches the specified regular expression. + $matchingAssets = array_filter($release->assets, array($this, 'matchesAssetFilter')); + if ( !empty($matchingAssets) ) { + if ( $this->isAuthenticationEnabled() ) { + /** + * Keep in mind that we'll need to add an "Accept" header to download this asset. + * + * @see setUpdateDownloadHeaders() + */ + $reference->downloadUrl = $matchingAssets[0]->url; + } else { + //It seems that browser_download_url only works for public repositories. + //Using an access_token doesn't help. Maybe OAuth would work? + $reference->downloadUrl = $matchingAssets[0]->browser_download_url; + } + + $reference->downloadCount = $matchingAssets[0]->download_count; + } + } + + if ( !empty($release->body) ) { + /** @noinspection PhpUndefinedClassInspection */ + $reference->changelog = Parsedown::instance()->text($release->body); + } + + return $reference; + } + + /** + * Get the tag that looks like the highest version number. + * + * @return Puc_v4p11_Vcs_Reference|null + */ + public function getLatestTag() { + $tags = $this->api('/repos/:user/:repo/tags'); + + if ( is_wp_error($tags) || !is_array($tags) ) { + return null; + } + + $versionTags = $this->sortTagsByVersion($tags); + if ( empty($versionTags) ) { + return null; + } + + $tag = $versionTags[0]; + return new Puc_v4p11_Vcs_Reference(array( + 'name' => $tag->name, + 'version' => ltrim($tag->name, 'v'), + 'downloadUrl' => $tag->zipball_url, + 'apiResponse' => $tag, + )); + } + + /** + * Get a branch by name. + * + * @param string $branchName + * @return null|Puc_v4p11_Vcs_Reference + */ + public function getBranch($branchName) { + $branch = $this->api('/repos/:user/:repo/branches/' . $branchName); + if ( is_wp_error($branch) || empty($branch) ) { + return null; + } + + $reference = new Puc_v4p11_Vcs_Reference(array( + 'name' => $branch->name, + 'downloadUrl' => $this->buildArchiveDownloadUrl($branch->name), + 'apiResponse' => $branch, + )); + + if ( isset($branch->commit, $branch->commit->commit, $branch->commit->commit->author->date) ) { + $reference->updated = $branch->commit->commit->author->date; + } + + return $reference; + } + + /** + * Get the latest commit that changed the specified file. + * + * @param string $filename + * @param string $ref Reference name (e.g. branch or tag). + * @return StdClass|null + */ + public function getLatestCommit($filename, $ref = 'master') { + $commits = $this->api( + '/repos/:user/:repo/commits', + array( + 'path' => $filename, + 'sha' => $ref, + ) + ); + if ( !is_wp_error($commits) && isset($commits[0]) ) { + return $commits[0]; + } + return null; + } + + /** + * Get the timestamp of the latest commit that changed the specified branch or tag. + * + * @param string $ref Reference name (e.g. branch or tag). + * @return string|null + */ + public function getLatestCommitTime($ref) { + $commits = $this->api('/repos/:user/:repo/commits', array('sha' => $ref)); + if ( !is_wp_error($commits) && isset($commits[0]) ) { + return $commits[0]->commit->author->date; + } + return null; + } + + /** + * Perform a GitHub API request. + * + * @param string $url + * @param array $queryParams + * @return mixed|WP_Error + */ + protected function api($url, $queryParams = array()) { + $baseUrl = $url; + $url = $this->buildApiUrl($url, $queryParams); + + $options = array('timeout' => 10); + if ( $this->isAuthenticationEnabled() ) { + $options['headers'] = array('Authorization' => $this->getAuthorizationHeader()); + } + + if ( !empty($this->httpFilterName) ) { + $options = apply_filters($this->httpFilterName, $options); + } + $response = wp_remote_get($url, $options); + if ( is_wp_error($response) ) { + do_action('puc_api_error', $response, null, $url, $this->slug); + return $response; + } + + $code = wp_remote_retrieve_response_code($response); + $body = wp_remote_retrieve_body($response); + if ( $code === 200 ) { + $document = json_decode($body); + return $document; + } + + $error = new WP_Error( + 'puc-github-http-error', + sprintf('GitHub API error. Base URL: "%s", HTTP status code: %d.', $baseUrl, $code) + ); + do_action('puc_api_error', $error, $response, $url, $this->slug); + + return $error; + } + + /** + * Build a fully qualified URL for an API request. + * + * @param string $url + * @param array $queryParams + * @return string + */ + protected function buildApiUrl($url, $queryParams) { + $variables = array( + 'user' => $this->userName, + 'repo' => $this->repositoryName, + ); + foreach ($variables as $name => $value) { + $url = str_replace('/:' . $name, '/' . urlencode($value), $url); + } + $url = 'https://api.github.com' . $url; + + if ( !empty($queryParams) ) { + $url = add_query_arg($queryParams, $url); + } + + return $url; + } + + /** + * Get the contents of a file from a specific branch or tag. + * + * @param string $path File name. + * @param string $ref + * @return null|string Either the contents of the file, or null if the file doesn't exist or there's an error. + */ + public function getRemoteFile($path, $ref = 'master') { + $apiUrl = '/repos/:user/:repo/contents/' . $path; + $response = $this->api($apiUrl, array('ref' => $ref)); + + if ( is_wp_error($response) || !isset($response->content) || ($response->encoding !== 'base64') ) { + return null; + } + return base64_decode($response->content); + } + + /** + * Generate a URL to download a ZIP archive of the specified branch/tag/etc. + * + * @param string $ref + * @return string + */ + public function buildArchiveDownloadUrl($ref = 'master') { + $url = sprintf( + 'https://api.github.com/repos/%1$s/%2$s/zipball/%3$s', + urlencode($this->userName), + urlencode($this->repositoryName), + urlencode($ref) + ); + return $url; + } + + /** + * Get a specific tag. + * + * @param string $tagName + * @return void + */ + public function getTag($tagName) { + //The current GitHub update checker doesn't use getTag, so I didn't bother to implement it. + throw new LogicException('The ' . __METHOD__ . ' method is not implemented and should not be used.'); + } + + public function setAuthentication($credentials) { + parent::setAuthentication($credentials); + $this->accessToken = is_string($credentials) ? $credentials : null; + + //Optimization: Instead of filtering all HTTP requests, let's do it only when + //WordPress is about to download an update. + add_filter('upgrader_pre_download', array($this, 'addHttpRequestFilter'), 10, 1); //WP 3.7+ + } + + /** + * Figure out which reference (i.e tag or branch) contains the latest version. + * + * @param string $configBranch Start looking in this branch. + * @return null|Puc_v4p11_Vcs_Reference + */ + public function chooseReference($configBranch) { + $updateSource = null; + + if ( $configBranch === 'master' ) { + //Use the latest release. + $updateSource = $this->getLatestRelease(); + if ( $updateSource === null ) { + //Failing that, use the tag with the highest version number. + $updateSource = $this->getLatestTag(); + } + } + //Alternatively, just use the branch itself. + if ( empty($updateSource) ) { + $updateSource = $this->getBranch($configBranch); + } + + return $updateSource; + } + + /** + * Enable updating via release assets. + * + * If the latest release contains no usable assets, the update checker + * will fall back to using the automatically generated ZIP archive. + * + * Private repositories will only work with WordPress 3.7 or later. + * + * @param string|null $fileNameRegex Optional. Use only those assets where the file name matches this regex. + */ + public function enableReleaseAssets($fileNameRegex = null) { + $this->releaseAssetsEnabled = true; + $this->assetFilterRegex = $fileNameRegex; + $this->assetApiBaseUrl = sprintf( + '//api.github.com/repos/%1$s/%2$s/releases/assets/', + $this->userName, + $this->repositoryName + ); + } + + /** + * Does this asset match the file name regex? + * + * @param stdClass $releaseAsset + * @return bool + */ + protected function matchesAssetFilter($releaseAsset) { + if ( $this->assetFilterRegex === null ) { + //The default is to accept all assets. + return true; + } + return isset($releaseAsset->name) && preg_match($this->assetFilterRegex, $releaseAsset->name); + } + + /** + * @internal + * @param bool $result + * @return bool + */ + public function addHttpRequestFilter($result) { + if ( !$this->downloadFilterAdded && $this->isAuthenticationEnabled() ) { + add_filter('http_request_args', array($this, 'setUpdateDownloadHeaders'), 10, 2); + add_action('requests-requests.before_redirect', array($this, 'removeAuthHeaderFromRedirects'), 10, 4); + $this->downloadFilterAdded = true; + } + return $result; + } + + /** + * Set the HTTP headers that are necessary to download updates from private repositories. + * + * See GitHub docs: + * @link https://developer.github.com/v3/repos/releases/#get-a-single-release-asset + * @link https://developer.github.com/v3/auth/#basic-authentication + * + * @internal + * @param array $requestArgs + * @param string $url + * @return array + */ + public function setUpdateDownloadHeaders($requestArgs, $url = '') { + //Is WordPress trying to download one of our release assets? + if ( $this->releaseAssetsEnabled && (strpos($url, $this->assetApiBaseUrl) !== false) ) { + $requestArgs['headers']['Accept'] = 'application/octet-stream'; + } + //Use Basic authentication, but only if the download is from our repository. + $repoApiBaseUrl = $this->buildApiUrl('/repos/:user/:repo/', array()); + if ( $this->isAuthenticationEnabled() && (strpos($url, $repoApiBaseUrl)) === 0 ) { + $requestArgs['headers']['Authorization'] = $this->getAuthorizationHeader(); + } + return $requestArgs; + } + + /** + * When following a redirect, the Requests library will automatically forward + * the authorization header to other hosts. We don't want that because it breaks + * AWS downloads and can leak authorization information. + * + * @internal + * @param string $location + * @param array $headers + */ + public function removeAuthHeaderFromRedirects(&$location, &$headers) { + $repoApiBaseUrl = $this->buildApiUrl('/repos/:user/:repo/', array()); + if ( strpos($location, $repoApiBaseUrl) === 0 ) { + return; //This request is going to GitHub, so it's fine. + } + //Remove the header. + if ( isset($headers['Authorization']) ) { + unset($headers['Authorization']); + } + } + + /** + * Generate the value of the "Authorization" header. + * + * @return string + */ + protected function getAuthorizationHeader() { + return 'Basic ' . base64_encode($this->userName . ':' . $this->accessToken); + } + } + +endif; diff --git a/app/core/puc/Puc/v4p11/Vcs/GitLabApi.php b/app/core/puc/Puc/v4p11/Vcs/GitLabApi.php new file mode 100755 index 0000000..9835ae1 --- /dev/null +++ b/app/core/puc/Puc/v4p11/Vcs/GitLabApi.php @@ -0,0 +1,399 @@ +repositoryHost = parse_url($repositoryUrl, PHP_URL_HOST) . $port; + + if ( $this->repositoryHost !== 'gitlab.com' ) { + $this->repositoryProtocol = parse_url($repositoryUrl, PHP_URL_SCHEME); + } + + //Find the repository information + $path = parse_url($repositoryUrl, PHP_URL_PATH); + if ( preg_match('@^/?(?P[^/]+?)/(?P[^/#?&]+?)/?$@', $path, $matches) ) { + $this->userName = $matches['username']; + $this->repositoryName = $matches['repository']; + } elseif ( ($this->repositoryHost === 'gitlab.com') ) { + //This is probably a repository in a subgroup, e.g. "/organization/category/repo". + $parts = explode('/', trim($path, '/')); + if ( count($parts) < 3 ) { + throw new InvalidArgumentException('Invalid GitLab.com repository URL: "' . $repositoryUrl . '"'); + } + $lastPart = array_pop($parts); + $this->userName = implode('/', $parts); + $this->repositoryName = $lastPart; + } else { + //There could be subgroups in the URL: gitlab.domain.com/group/subgroup/subgroup2/repository + if ( $subgroup !== null ) { + $path = str_replace(trailingslashit($subgroup), '', $path); + } + + //This is not a traditional url, it could be gitlab is in a deeper subdirectory. + //Get the path segments. + $segments = explode('/', untrailingslashit(ltrim($path, '/'))); + + //We need at least /user-name/repository-name/ + if ( count($segments) < 2 ) { + throw new InvalidArgumentException('Invalid GitLab repository URL: "' . $repositoryUrl . '"'); + } + + //Get the username and repository name. + $usernameRepo = array_splice($segments, -2, 2); + $this->userName = $usernameRepo[0]; + $this->repositoryName = $usernameRepo[1]; + + //Append the remaining segments to the host if there are segments left. + if ( count($segments) > 0 ) { + $this->repositoryHost = trailingslashit($this->repositoryHost) . implode('/', $segments); + } + + //Add subgroups to username. + if ( $subgroup !== null ) { + $this->userName = $usernameRepo[0] . '/' . untrailingslashit($subgroup); + } + } + + parent::__construct($repositoryUrl, $accessToken); + } + + /** + * Get the latest release from GitLab. + * + * @return Puc_v4p11_Vcs_Reference|null + */ + public function getLatestRelease() { + $releases = $this->api('/:id/releases'); + if ( is_wp_error($releases) || empty($releases) || !is_array($releases) ) { + return null; + } + + foreach ($releases as $release) { + if ( true !== $release->upcoming_release ) { + break 1; //Break the loop on the first release we find that isn't an upcoming release + } + } + if ( is_wp_error($release) || !is_object($release) || !isset($release->tag_name) ) { + return null; + } + + $reference = new Puc_v4p11_Vcs_Reference(array( + 'name' => $release->tag_name, + 'version' => ltrim($release->tag_name, 'v'), //Remove the "v" prefix from "v1.2.3". + 'downloadUrl' => '', + 'updated' => $release->released_at, + 'apiResponse' => $release, + )); + $download_url = false; + + if ( $this->releasePackageEnabled && isset($release->assets, $release->assets->links) ) { + /** + * Use the first asset LINK that is a zip format file generated by a Gitlab Release Pipeline + * + * @link https://gist.github.com/timwiel/9dfd3526c768efad4973254085e065ce + */ + foreach ($release->assets->links as $link) { + if ( 'zip' === substr($link->url, -3) ) { + $download_url = $link->url; + break 1; + } + } + if ( empty( $download_url ) ) { + return null; + } + if ( ! empty( $this->accessToken ) ) { + $download_url = add_query_arg('private_token', $this->accessToken, $download_url); + } + $reference->downloadUrl = $download_url; + return $reference; + + } elseif ( isset($release->assets) ) { + /** + * Use the first asset SOURCE file that is a zip format from a Gitlab Release which should be a zip file + */ + foreach ($release->assets->sources as $source) { + if ( 'zip' === $source->format ) { + $download_url = $source->url; + break 1; + } + } + if ( empty( $download_url ) ) { + return null; + } + if ( ! empty( $this->accessToken ) ) { + $download_url = add_query_arg('private_token', $this->accessToken, $download_url); + } + $reference->downloadUrl = $download_url; + return $reference; + + } + + //If we get this far without a return then obviosuly noi release download urls were found + return null; + } + + /** + * Get the tag that looks like the highest version number. + * + * @return Puc_v4p11_Vcs_Reference|null + */ + public function getLatestTag() { + $tags = $this->api('/:id/repository/tags'); + if ( is_wp_error($tags) || empty($tags) || !is_array($tags) ) { + return null; + } + + $versionTags = $this->sortTagsByVersion($tags); + if ( empty($versionTags) ) { + return null; + } + + $tag = $versionTags[0]; + return new Puc_v4p11_Vcs_Reference(array( + 'name' => $tag->name, + 'version' => ltrim($tag->name, 'v'), + 'downloadUrl' => $this->buildArchiveDownloadUrl($tag->name), + 'apiResponse' => $tag, + )); + } + + /** + * Get a branch by name. + * + * @param string $branchName + * @return null|Puc_v4p11_Vcs_Reference + */ + public function getBranch($branchName) { + $branch = $this->api('/:id/repository/branches/' . $branchName); + if ( is_wp_error($branch) || empty($branch) ) { + return null; + } + + $reference = new Puc_v4p11_Vcs_Reference(array( + 'name' => $branch->name, + 'downloadUrl' => $this->buildArchiveDownloadUrl($branch->name), + 'apiResponse' => $branch, + )); + + if ( isset($branch->commit, $branch->commit->committed_date) ) { + $reference->updated = $branch->commit->committed_date; + } + + return $reference; + } + + /** + * Get the timestamp of the latest commit that changed the specified branch or tag. + * + * @param string $ref Reference name (e.g. branch or tag). + * @return string|null + */ + public function getLatestCommitTime($ref) { + $commits = $this->api('/:id/repository/commits/', array('ref_name' => $ref)); + if ( is_wp_error($commits) || !is_array($commits) || !isset($commits[0]) ) { + return null; + } + + return $commits[0]->committed_date; + } + + /** + * Perform a GitLab API request. + * + * @param string $url + * @param array $queryParams + * @return mixed|WP_Error + */ + protected function api($url, $queryParams = array()) { + $baseUrl = $url; + $url = $this->buildApiUrl($url, $queryParams); + + $options = array('timeout' => 10); + if ( !empty($this->httpFilterName) ) { + $options = apply_filters($this->httpFilterName, $options); + } + + $response = wp_remote_get($url, $options); + if ( is_wp_error($response) ) { + do_action('puc_api_error', $response, null, $url, $this->slug); + return $response; + } + + $code = wp_remote_retrieve_response_code($response); + $body = wp_remote_retrieve_body($response); + if ( $code === 200 ) { + return json_decode($body); + } + + $error = new WP_Error( + 'puc-gitlab-http-error', + sprintf('GitLab API error. URL: "%s", HTTP status code: %d.', $baseUrl, $code) + ); + do_action('puc_api_error', $error, $response, $url, $this->slug); + + return $error; + } + + /** + * Build a fully qualified URL for an API request. + * + * @param string $url + * @param array $queryParams + * @return string + */ + protected function buildApiUrl($url, $queryParams) { + $variables = array( + 'user' => $this->userName, + 'repo' => $this->repositoryName, + 'id' => $this->userName . '/' . $this->repositoryName, + ); + + foreach ($variables as $name => $value) { + $url = str_replace("/:{$name}", '/' . urlencode($value), $url); + } + + $url = substr($url, 1); + $url = sprintf('%1$s://%2$s/api/v4/projects/%3$s', $this->repositoryProtocol, $this->repositoryHost, $url); + + if ( !empty($this->accessToken) ) { + $queryParams['private_token'] = $this->accessToken; + } + + if ( !empty($queryParams) ) { + $url = add_query_arg($queryParams, $url); + } + + return $url; + } + + /** + * Get the contents of a file from a specific branch or tag. + * + * @param string $path File name. + * @param string $ref + * @return null|string Either the contents of the file, or null if the file doesn't exist or there's an error. + */ + public function getRemoteFile($path, $ref = 'master') { + $response = $this->api('/:id/repository/files/' . $path, array('ref' => $ref)); + if ( is_wp_error($response) || !isset($response->content) || $response->encoding !== 'base64' ) { + return null; + } + + return base64_decode($response->content); + } + + /** + * Generate a URL to download a ZIP archive of the specified branch/tag/etc. + * + * @param string $ref + * @return string + */ + public function buildArchiveDownloadUrl($ref = 'master') { + $url = sprintf( + '%1$s://%2$s/api/v4/projects/%3$s/repository/archive.zip', + $this->repositoryProtocol, + $this->repositoryHost, + urlencode($this->userName . '/' . $this->repositoryName) + ); + $url = add_query_arg('sha', urlencode($ref), $url); + + if ( !empty($this->accessToken) ) { + $url = add_query_arg('private_token', $this->accessToken, $url); + } + + return $url; + } + + /** + * Get a specific tag. + * + * @param string $tagName + * @return void + */ + public function getTag($tagName) { + throw new LogicException('The ' . __METHOD__ . ' method is not implemented and should not be used.'); + } + + /** + * Figure out which reference (i.e tag or branch) contains the latest version. + * + * @param string $configBranch Start looking in this branch. + * @return null|Puc_v4p11_Vcs_Reference + */ + public function chooseReference($configBranch) { + + if ( $configBranch === 'main' || $configBranch === 'master' ) { + //Use the latest release. + $updateSource = $this->getLatestRelease(); + if ( $updateSource === null ) { + //Failing that, use the tag with the highest version number. + $updateSource = $this->getLatestTag(); + } + } + //Alternatively, just use the branch itself. + if ( empty($updateSource) ) { + $updateSource = $this->getBranch($configBranch); + } + + return $updateSource; + } + + public function setAuthentication($credentials) { + parent::setAuthentication($credentials); + $this->accessToken = is_string($credentials) ? $credentials : null; + } + + public function enableReleaseAssets() { + $this->releaseAssetsEnabled = true; + $this->releasePackageEnabled = false; + } + + public function enableReleasePackages() { + $this->releaseAssetsEnabled = false; + $this->releasePackageEnabled = true; + } + + } + +endif; diff --git a/app/core/puc/Puc/v4p11/Vcs/PluginUpdateChecker.php b/app/core/puc/Puc/v4p11/Vcs/PluginUpdateChecker.php new file mode 100755 index 0000000..a5a0c97 --- /dev/null +++ b/app/core/puc/Puc/v4p11/Vcs/PluginUpdateChecker.php @@ -0,0 +1,293 @@ +api = $api; + $this->api->setHttpFilterName($this->getUniqueName('request_info_options')); + + parent::__construct($api->getRepositoryUrl(), $pluginFile, $slug, $checkPeriod, $optionName, $muPluginFile); + + $this->api->setSlug($this->slug); + } + + public function requestInfo($unusedParameter = null) { + //We have to make several remote API requests to gather all the necessary info + //which can take a while on slow networks. + if ( function_exists('set_time_limit') ) { + @set_time_limit(60); + } + + $api = $this->api; + $api->setLocalDirectory($this->package->getAbsoluteDirectoryPath()); + + $info = new Puc_v4p11_Plugin_Info(); + $info->filename = $this->pluginFile; + $info->slug = $this->slug; + + $this->setInfoFromHeader($this->package->getPluginHeader(), $info); + $this->setIconsFromLocalAssets($info); + $this->setBannersFromLocalAssets($info); + + //Pick a branch or tag. + $updateSource = $api->chooseReference($this->branch); + if ( $updateSource ) { + $ref = $updateSource->name; + $info->version = $updateSource->version; + $info->last_updated = $updateSource->updated; + $info->download_url = $updateSource->downloadUrl; + + if ( !empty($updateSource->changelog) ) { + $info->sections['changelog'] = $updateSource->changelog; + } + if ( isset($updateSource->downloadCount) ) { + $info->downloaded = $updateSource->downloadCount; + } + } else { + //There's probably a network problem or an authentication error. + do_action( + 'puc_api_error', + new WP_Error( + 'puc-no-update-source', + 'Could not retrieve version information from the repository. ' + . 'This usually means that the update checker either can\'t connect ' + . 'to the repository or it\'s configured incorrectly.' + ), + null, null, $this->slug + ); + return null; + } + + //Get headers from the main plugin file in this branch/tag. Its "Version" header and other metadata + //are what the WordPress install will actually see after upgrading, so they take precedence over releases/tags. + $mainPluginFile = basename($this->pluginFile); + $remotePlugin = $api->getRemoteFile($mainPluginFile, $ref); + if ( !empty($remotePlugin) ) { + $remoteHeader = $this->package->getFileHeader($remotePlugin); + $this->setInfoFromHeader($remoteHeader, $info); + } + + //Try parsing readme.txt. If it's formatted according to WordPress.org standards, it will contain + //a lot of useful information like the required/tested WP version, changelog, and so on. + if ( $this->readmeTxtExistsLocally() ) { + $this->setInfoFromRemoteReadme($ref, $info); + } + + //The changelog might be in a separate file. + if ( empty($info->sections['changelog']) ) { + $info->sections['changelog'] = $api->getRemoteChangelog($ref, $this->package->getAbsoluteDirectoryPath()); + if ( empty($info->sections['changelog']) ) { + $info->sections['changelog'] = esc_html__('There is no changelog available.', 'plugin-update-checker'); + } + } + + if ( empty($info->last_updated) ) { + //Fetch the latest commit that changed the tag or branch and use it as the "last_updated" date. + $latestCommitTime = $api->getLatestCommitTime($ref); + if ( $latestCommitTime !== null ) { + $info->last_updated = $latestCommitTime; + } + } + + $info = apply_filters($this->getUniqueName('request_info_result'), $info, null); + return $info; + } + + /** + * Check if the currently installed version has a readme.txt file. + * + * @return bool + */ + protected function readmeTxtExistsLocally() { + return $this->package->fileExists($this->api->getLocalReadmeName()); + } + + /** + * Copy plugin metadata from a file header to a Plugin Info object. + * + * @param array $fileHeader + * @param Puc_v4p11_Plugin_Info $pluginInfo + */ + protected function setInfoFromHeader($fileHeader, $pluginInfo) { + $headerToPropertyMap = array( + 'Version' => 'version', + 'Name' => 'name', + 'PluginURI' => 'homepage', + 'Author' => 'author', + 'AuthorName' => 'author', + 'AuthorURI' => 'author_homepage', + + 'Requires WP' => 'requires', + 'Tested WP' => 'tested', + 'Requires at least' => 'requires', + 'Tested up to' => 'tested', + + 'Requires PHP' => 'requires_php', + ); + foreach ($headerToPropertyMap as $headerName => $property) { + if ( isset($fileHeader[$headerName]) && !empty($fileHeader[$headerName]) ) { + $pluginInfo->$property = $fileHeader[$headerName]; + } + } + + if ( !empty($fileHeader['Description']) ) { + $pluginInfo->sections['description'] = $fileHeader['Description']; + } + } + + /** + * Copy plugin metadata from the remote readme.txt file. + * + * @param string $ref GitHub tag or branch where to look for the readme. + * @param Puc_v4p11_Plugin_Info $pluginInfo + */ + protected function setInfoFromRemoteReadme($ref, $pluginInfo) { + $readme = $this->api->getRemoteReadme($ref); + if ( empty($readme) ) { + return; + } + + if ( isset($readme['sections']) ) { + $pluginInfo->sections = array_merge($pluginInfo->sections, $readme['sections']); + } + if ( !empty($readme['tested_up_to']) ) { + $pluginInfo->tested = $readme['tested_up_to']; + } + if ( !empty($readme['requires_at_least']) ) { + $pluginInfo->requires = $readme['requires_at_least']; + } + if ( !empty($readme['requires_php']) ) { + $pluginInfo->requires_php = $readme['requires_php']; + } + + if ( isset($readme['upgrade_notice'], $readme['upgrade_notice'][$pluginInfo->version]) ) { + $pluginInfo->upgrade_notice = $readme['upgrade_notice'][$pluginInfo->version]; + } + } + + /** + * Add icons from the currently installed version to a Plugin Info object. + * + * The icons should be in a subdirectory named "assets". Supported image formats + * and file names are described here: + * @link https://developer.wordpress.org/plugins/wordpress-org/plugin-assets/#plugin-icons + * + * @param Puc_v4p11_Plugin_Info $pluginInfo + */ + protected function setIconsFromLocalAssets($pluginInfo) { + $icons = $this->getLocalAssetUrls(array( + 'icon.svg' => 'svg', + 'icon-256x256.png' => '2x', + 'icon-256x256.jpg' => '2x', + 'icon-128x128.png' => '1x', + 'icon-128x128.jpg' => '1x', + )); + + if ( !empty($icons) ) { + //The "default" key seems to be used only as last-resort fallback in WP core (5.8/5.9), + //but we'll set it anyway in case some code somewhere needs it. + reset($icons); + $firstKey = key($icons); + $icons['default'] = $icons[$firstKey]; + + $pluginInfo->icons = $icons; + } + } + + /** + * Add banners from the currently installed version to a Plugin Info object. + * + * The banners should be in a subdirectory named "assets". Supported image formats + * and file names are described here: + * @link https://developer.wordpress.org/plugins/wordpress-org/plugin-assets/#plugin-headers + * + * @param Puc_v4p11_Plugin_Info $pluginInfo + */ + protected function setBannersFromLocalAssets($pluginInfo) { + $banners = $this->getLocalAssetUrls(array( + 'banner-772x250.png' => 'high', + 'banner-772x250.jpg' => 'high', + 'banner-1544x500.png' => 'low', + 'banner-1544x500.jpg' => 'low', + )); + + if ( !empty($banners) ) { + $pluginInfo->banners = $banners; + } + } + + /** + * @param array $filesToKeys + * @return array + */ + protected function getLocalAssetUrls($filesToKeys) { + $assetDirectory = $this->package->getAbsoluteDirectoryPath() . DIRECTORY_SEPARATOR . 'assets'; + if ( !is_dir($assetDirectory) ) { + return []; + } + $assetBaseUrl = trailingslashit(plugins_url('', $assetDirectory . '/imaginary.file')); + + $foundAssets = []; + foreach ($filesToKeys as $fileName => $key) { + $fullBannerPath = $assetDirectory . DIRECTORY_SEPARATOR . $fileName; + if ( !isset($icons[$key]) && is_file($fullBannerPath) ) { + $foundAssets[$key] = $assetBaseUrl . $fileName; + } + } + + return $foundAssets; + } + + public function setBranch($branch) { + $this->branch = $branch; + return $this; + } + + public function setAuthentication($credentials) { + $this->api->setAuthentication($credentials); + return $this; + } + + public function getVcsApi() { + return $this->api; + } + + public function getUpdate() { + $update = parent::getUpdate(); + + if ( isset($update) && !empty($update->download_url) ) { + $update->download_url = $this->api->signDownloadUrl($update->download_url); + } + + return $update; + } + + public function onDisplayConfiguration($panel) { + parent::onDisplayConfiguration($panel); + $panel->row('Branch', $this->branch); + $panel->row('Authentication enabled', $this->api->isAuthenticationEnabled() ? 'Yes' : 'No'); + $panel->row('API client', get_class($this->api)); + } + } + +endif; diff --git a/app/core/puc/Puc/v4p11/Vcs/Reference.php b/app/core/puc/Puc/v4p11/Vcs/Reference.php new file mode 100755 index 0000000..2270994 --- /dev/null +++ b/app/core/puc/Puc/v4p11/Vcs/Reference.php @@ -0,0 +1,49 @@ +properties = $properties; + } + + /** + * @param string $name + * @return mixed|null + */ + public function __get($name) { + return array_key_exists($name, $this->properties) ? $this->properties[$name] : null; + } + + /** + * @param string $name + * @param mixed $value + */ + public function __set($name, $value) { + $this->properties[$name] = $value; + } + + /** + * @param string $name + * @return bool + */ + public function __isset($name) { + return isset($this->properties[$name]); + } + + } + +endif; diff --git a/app/core/puc/Puc/v4p11/Vcs/ThemeUpdateChecker.php b/app/core/puc/Puc/v4p11/Vcs/ThemeUpdateChecker.php new file mode 100755 index 0000000..9c2fa4f --- /dev/null +++ b/app/core/puc/Puc/v4p11/Vcs/ThemeUpdateChecker.php @@ -0,0 +1,118 @@ +api = $api; + $this->api->setHttpFilterName($this->getUniqueName('request_update_options')); + + parent::__construct($api->getRepositoryUrl(), $stylesheet, $customSlug, $checkPeriod, $optionName); + + $this->api->setSlug($this->slug); + } + + public function requestUpdate() { + $api = $this->api; + $api->setLocalDirectory($this->package->getAbsoluteDirectoryPath()); + + $update = new Puc_v4p11_Theme_Update(); + $update->slug = $this->slug; + + //Figure out which reference (tag or branch) we'll use to get the latest version of the theme. + $updateSource = $api->chooseReference($this->branch); + if ( $updateSource ) { + $ref = $updateSource->name; + $update->download_url = $updateSource->downloadUrl; + } else { + do_action( + 'puc_api_error', + new WP_Error( + 'puc-no-update-source', + 'Could not retrieve version information from the repository. ' + . 'This usually means that the update checker either can\'t connect ' + . 'to the repository or it\'s configured incorrectly.' + ), + null, null, $this->slug + ); + $ref = $this->branch; + } + + //Get headers from the main stylesheet in this branch/tag. Its "Version" header and other metadata + //are what the WordPress install will actually see after upgrading, so they take precedence over releases/tags. + $remoteHeader = $this->package->getFileHeader($api->getRemoteFile('style.css', $ref)); + $update->version = Puc_v4p11_Utils::findNotEmpty(array( + $remoteHeader['Version'], + Puc_v4p11_Utils::get($updateSource, 'version'), + )); + + //The details URL defaults to the Theme URI header or the repository URL. + $update->details_url = Puc_v4p11_Utils::findNotEmpty(array( + $remoteHeader['ThemeURI'], + $this->package->getHeaderValue('ThemeURI'), + $this->metadataUrl, + )); + + if ( empty($update->version) ) { + //It looks like we didn't find a valid update after all. + $update = null; + } + + $update = $this->filterUpdateResult($update); + return $update; + } + + //FIXME: This is duplicated code. Both theme and plugin subclasses that use VCS share these methods. + + public function setBranch($branch) { + $this->branch = $branch; + return $this; + } + + public function setAuthentication($credentials) { + $this->api->setAuthentication($credentials); + return $this; + } + + public function getVcsApi() { + return $this->api; + } + + public function getUpdate() { + $update = parent::getUpdate(); + + if ( isset($update) && !empty($update->download_url) ) { + $update->download_url = $this->api->signDownloadUrl($update->download_url); + } + + return $update; + } + + public function onDisplayConfiguration($panel) { + parent::onDisplayConfiguration($panel); + $panel->row('Branch', $this->branch); + $panel->row('Authentication enabled', $this->api->isAuthenticationEnabled() ? 'Yes' : 'No'); + $panel->row('API client', get_class($this->api)); + } + } + +endif; diff --git a/app/core/puc/README.md b/app/core/puc/README.md new file mode 100755 index 0000000..c63f147 --- /dev/null +++ b/app/core/puc/README.md @@ -0,0 +1,326 @@ +Plugin Update Checker +===================== + +This is a custom update checker library for WordPress plugins and themes. It lets you add automatic update notifications and one-click upgrades to your commercial plugins, private themes, and so on. All you need to do is put your plugin/theme details in a JSON file, place the file on your server, and pass the URL to the library. The library periodically checks the URL to see if there's a new version available and displays an update notification to the user if necessary. + +From the users' perspective, it works just like with plugins and themes hosted on WordPress.org. The update checker uses the default upgrade UI that is familiar to most WordPress users. + + + +**Table of Contents** + +- [Getting Started](#getting-started) + - [Self-hosted Plugins and Themes](#self-hosted-plugins-and-themes) + - [How to Release an Update](#how-to-release-an-update) + - [Notes](#notes) + - [GitHub Integration](#github-integration) + - [How to Release an Update](#how-to-release-an-update-1) + - [Notes](#notes-1) + - [BitBucket Integration](#bitbucket-integration) + - [How to Release an Update](#how-to-release-an-update-2) + - [GitLab Integration](#gitlab-integration) + - [How to Release a GitLab Update](#how-to-release-a-gitlab-update) +- [License Management](#license-management) +- [Resources](#resources) + + + +Getting Started +--------------- + +*Note:* In each of the below examples, part of the instructions are to create an instance of the update checker class. It's recommended to do this either during the `plugins_loaded` action or outside of any hooks. If you do it only during an `admin_*` action, then updates will not be visible to a wide variety of WordPress maanagement tools; they will only be visible to logged-in users on dashboard pages. + +### Self-hosted Plugins and Themes + +1. Download [the latest release](https://github.com/YahnisElsts/plugin-update-checker/releases/latest) and copy the `plugin-update-checker` directory to your plugin or theme. +2. Go to the `examples` subdirectory and open the .json file that fits your project type. Replace the placeholder data with your plugin/theme details. + - Plugin example: + + ```json + { + "name" : "Plugin Name", + "version" : "2.0", + "download_url" : "http://example.com/plugin-name-2.0.zip", + "sections" : { + "description" : "Plugin description here. You can use HTML." + } + } + ``` + + This is a minimal example that leaves out optional fields. See [this table](https://docs.google.com/spreadsheets/d/1eOBbW7Go2qEQXReOOCdidMTf_tDYRq4JfegcO1CBPIs/edit?usp=sharing) for a full list of supported fields and their descriptions. + - Theme example: + + ```json + { + "version": "2.0", + "details_url": "http://example.com/version-2.0-details.html", + "download_url": "http://example.com/example-theme-2.0.zip" + } + ``` + + This is actually a complete example that shows all theme-related fields. `version` and `download_url` should be self-explanatory. The `details_url` key specifies the page that the user will see if they click the "View version 1.2.3 details" link in an update notification. +3. Upload the JSON file to a publicly accessible location. +4. Add the following code to the main plugin file or to the `functions.php` file: + + ```php + require 'path/to/plugin-update-checker/plugin-update-checker.php'; + $myUpdateChecker = Puc_v4_Factory::buildUpdateChecker( + 'http://example.com/path/to/details.json', + __FILE__, //Full path to the main plugin file or functions.php. + 'unique-plugin-or-theme-slug' + ); + ``` + Note: If you're using the Composer autoloader, you don't need to explicitly `require` the library. + +#### How to Release an Update + +Change the `version` number in the JSON file and make sure that `download_url` points to the latest version. Update the other fields if necessary. Tip: You can use [wp-update-server](https://github.com/YahnisElsts/wp-update-server) to automate this process. + +By default, the library will check the specified URL for changes every 12 hours. You can force it to check immediately by clicking the "Check for updates" link on the "Plugins" page (it's next to the "Visit plugin site" link). Themes don't have that link, but you can also trigger an update check like this: + + 1. Install [Debug Bar](https://srd.wordpress.org/plugins/debug-bar/). + 2. Click the "Debug" menu in the Admin Bar (a.k.a Toolbar). + 3. Open the "PUC (your-slug)" panel. + 4. Click the "Check Now" button. + +#### Notes +- The second argument passed to `buildUpdateChecker` must be the absolute path to the main plugin file or any file in the theme directory. If you followed the "getting started" instructions, you can just use the `__FILE__` constant. +- The third argument - i.e. the slug - is optional but recommended. In most cases, the slug should be the same as the name of your plugin directory. For example, if your plugin lives in `/wp-content/plugins/my-plugin`, set the slug to `my-plugin`. If the slug is omitted, the update checker will use the name of the main plugin file as the slug (e.g. `my-cool-plugin.php` → `my-cool-plugin`). This can lead to conflicts if your plugin has a generic file name like `plugin.php`. + + This doesn't affect themes because PUC uses the theme directory name as the default slug. Still, if you're planning to use the slug in your own code - e.g. to filter updates or override update checker behaviour - it can be a good idea to set it explicitly. + +### GitHub Integration + +1. Download [the latest release](https://github.com/YahnisElsts/plugin-update-checker/releases/latest) and copy the `plugin-update-checker` directory to your plugin or theme. +2. Add the following code to the main plugin file or `functions.php`: + + ```php + require 'plugin-update-checker/plugin-update-checker.php'; + $myUpdateChecker = Puc_v4_Factory::buildUpdateChecker( + 'https://github.com/user-name/repo-name/', + __FILE__, + 'unique-plugin-or-theme-slug' + ); + + //Set the branch that contains the stable release. + $myUpdateChecker->setBranch('stable-branch-name'); + + //Optional: If you're using a private repository, specify the access token like this: + $myUpdateChecker->setAuthentication('your-token-here'); + ``` +3. Plugins only: Add a `readme.txt` file formatted according to the [WordPress.org plugin readme standard](https://wordpress.org/plugins/readme.txt) to your repository. The contents of this file will be shown when the user clicks the "View version 1.2.3 details" link. + +#### How to Release an Update + +This library supports a couple of different ways to release updates on GitHub. Pick the one that best fits your workflow. + +- **GitHub releases** + + Create a new release using the "Releases" feature on GitHub. The tag name and release title don't matter. The description is optional, but if you do provide one, it will be displayed when the user clicks the "View version x.y.z details" link on the "Plugins" page. Note that PUC ignores releases marked as "This is a pre-release". + + If you want to use release assets, call the `enableReleaseAssets()` method after creating the update checker instance: + ```php + $myUpdateChecker->getVcsApi()->enableReleaseAssets(); + ``` + +- **Tags** + + To release version 1.2.3, create a new Git tag named `v1.2.3` or `1.2.3`. That's it. + + PUC doesn't require strict adherence to [SemVer](http://semver.org/). These are all valid tag names: `v1.2.3`, `v1.2-foo`, `1.2.3_rc1-ABC`, `1.2.3.4.5`. However, be warned that it's not smart enough to filter out alpha/beta/RC versions. If that's a problem, you might want to use GitHub releases or branches instead. + +- **Stable branch** + + Point the update checker at a stable, production-ready branch: + ```php + $updateChecker->setBranch('branch-name'); + ``` + PUC will periodically check the `Version` header in the main plugin file or `style.css` and display a notification if it's greater than the installed version. + + Caveat: If you set the branch to `master` (the default), the update checker will look for recent releases and tags first. It'll only use the `master` branch if it doesn't find anything else suitable. + +#### Notes + +The library will pull update details from the following parts of a release/tag/branch: + +- Version number + - The "Version" plugin header. + - The latest GitHub release or tag name. +- Changelog + - The "Changelog" section of `readme.txt`. + - One of the following files: + CHANGES.md, CHANGELOG.md, changes.md, changelog.md + - GitHub release notes. +- Required and tested WordPress versions + - The "Requires at least" and "Tested up to" fields in `readme.txt`. + - The following plugin headers: + `Required WP`, `Tested WP`, `Requires at least`, `Tested up to` +- "Last updated" timestamp + - The creation timestamp of the latest GitHub release. + - The latest commit in the selected tag or branch. +- Number of downloads + - The `download_count` statistic of the latest release. + - If you're not using GitHub releases, there will be no download stats. +- Other plugin details - author, homepage URL, description + - The "Description" section of `readme.txt`. + - Remote plugin headers (i.e. the latest version on GitHub). + - Local plugin headers (i.e. the currently installed version). +- Ratings, banners, screenshots + - Not supported. + +### BitBucket Integration + +1. Download [the latest release](https://github.com/YahnisElsts/plugin-update-checker/releases/latest) and copy the `plugin-update-checker` directory to your plugin or theme. +2. Add the following code to the main plugin file or `functions.php`: + + ```php + require 'plugin-update-checker/plugin-update-checker.php'; + $myUpdateChecker = Puc_v4_Factory::buildUpdateChecker( + 'https://bitbucket.org/user-name/repo-name', + __FILE__, + 'unique-plugin-or-theme-slug' + ); + + //Optional: If you're using a private repository, create an OAuth consumer + //and set the authentication credentials like this: + //Note: For now you need to check "This is a private consumer" when + //creating the consumer to work around #134: + // https://github.com/YahnisElsts/plugin-update-checker/issues/134 + $myUpdateChecker->setAuthentication(array( + 'consumer_key' => '...', + 'consumer_secret' => '...', + )); + + //Optional: Set the branch that contains the stable release. + $myUpdateChecker->setBranch('stable-branch-name'); + ``` +3. Optional: Add a `readme.txt` file formatted according to the [WordPress.org plugin readme standard](https://wordpress.org/plugins/readme.txt) to your repository. For plugins, the contents of this file will be shown when the user clicks the "View version 1.2.3 details" link. + +#### How to Release an Update + +BitBucket doesn't have an equivalent to GitHub's releases, so the process is slightly different. You can use any of the following approaches: + +- **`Stable tag` header** + + This is the recommended approach if you're using tags to mark each version. Add a `readme.txt` file formatted according to the [WordPress.org plugin readme standard](https://wordpress.org/plugins/readme.txt) to your repository. Set the "stable tag" header to the tag that represents the latest release. Example: + ```text + Stable tag: v1.2.3 + ``` + The tag doesn't have to start with a "v" or follow any particular format. You can use any name you like as long as it's a valid Git tag. + + Tip: If you explicitly set a stable branch, the update checker will look for a `readme.txt` in that branch. Otherwise it will only look at the `master` branch. + +- **Tags** + + You can skip the "stable tag" bit and just create a new Git tag named `v1.2.3` or `1.2.3`. The update checker will look at the most recent tags and pick the one that looks like the highest version number. + + PUC doesn't require strict adherence to [SemVer](http://semver.org/). These are all valid tag names: `v1.2.3`, `v1.2-foo`, `1.2.3_rc1-ABC`, `1.2.3.4.5`. However, be warned that it's not smart enough to filter out alpha/beta/RC versions. + +- **Stable branch** + + Point the update checker at a stable, production-ready branch: + ```php + $updateChecker->setBranch('branch-name'); + ``` + PUC will periodically check the `Version` header in the main plugin file or `style.css` and display a notification if it's greater than the installed version. Caveat: If you set the branch to `master`, the update checker will still look for tags first. + +### GitLab Integration + +1. Download [the latest release](https://github.com/YahnisElsts/plugin-update-checker/releases/latest) and copy the `plugin-update-checker` directory to your plugin or theme. +2. Add the following code to the main plugin file or `functions.php` and define how you want to check for updates from Gitlab (refer to: [Gitlab: How to Release an Update](#how-to-release-a-gitlab-update)): + + ```php + require 'plugin-update-checker/plugin-update-checker.php'; + $myUpdateChecker = Puc_v4_Factory::buildUpdateChecker( + 'https://gitlab.com/user-name/repo-name/', + __FILE__, + 'unique-plugin-or-theme-slug' + ); + + //Optional: If you're using a private repository, specify the access token like this: + $myUpdateChecker->setAuthentication('your-token-here'); + ``` + + Alternatively, if you're using a self-hosted GitLab instance, initialize the update checker like this: + ```php + $myUpdateChecker = new Puc_v4p11_Vcs_PluginUpdateChecker( + new Puc_v4p11_Vcs_GitLabApi('https://myserver.com/user-name/repo-name/'), + __FILE__, + 'unique-plugin-or-theme-slug' + ); + //Optional: Add setAuthentication(...) and setBranch(...) as shown above. + ``` + If you're using a self-hosted GitLab instance and [subgroups or nested groups](https://docs.gitlab.com/ce/user/group/subgroups/index.html), you have to tell the update checker which parts of the URL are subgroups: + ```php + $myUpdateChecker = new Puc_v4p11_Vcs_PluginUpdateChecker( + new Puc_v4p11_Vcs_GitLabApi('https://myserver.com/group-name/subgroup-level1/subgroup-level2/subgroup-level3/repo-name/', null, 'subgroup-level1/subgroup-level2/subgroup-level3'), + __FILE__, + 'unique-plugin-or-theme-slug' + ); + + ``` + +3. Plugins only: Add a `readme.txt` file formatted according to the [WordPress.org plugin readme standard](https://wordpress.org/plugins/readme.txt) to your repository. The contents of this file will be shown when the user clicks the "View version 1.2.3 details" link. + +#### How to Release a GitLab Update +A Gitlab repository can be checked for updates in 4 different ways. + +1. **Stable branch** (other than `master` or `main`): + - Point the update checker at any stable, production-ready branch and PUC will periodically check the `Version` header in the main plugin file or `style.css` and display a notification if it's greater than the installed version. + - Add the following code: + ```php + //Add the following code to your main plugin file or `functions.php` file to check for updates from a custom branch + $myUpdateChecker->setBranch('stable-branch-name'); + ``` + - Caveats: + - If you set the branch to `main` (the default) or `master` (the historical default), the update checker will look for recent releases and tags first. It'll only use the `main` or `master` branch if it doesn't find anything else suitable. + +2. **GitLab Releases using Generic Packages**: + - Use a Gitlab CI/CD Pipeline to automatically generate your update on release using a Generic Package. The benefit of using Generic Package assets over the Source Code assets is that the code can already be built and production ready. + - Add the following code: + ```php + //Add the following code to your main plugin file or `functions.php` file to check for a new update from releases using generic packages + $myUpdateChecker->getVcsApi()->enableReleasePackages(); + ``` + - PUC will periodically check the release version (i.e. the tag name of the release) and will display a notification if the release is a greater version than the installed version. + - The release tag name should loosely follow [SemVer](http://semver.org/) but these are all valid release names: `v1.2.3`, `v1.2-foo`, `1.2.3_rc1-ABC`, `1.2.3.4.5` However, be warned that it's not smart enough to filter out alpha/beta/RC versions. If that's a problem, you might want to use GitLab branches instead. + - For more information about *Gitlab Release Generic Packages* refer to the following links: + - [Gitlab CI/CD Release Documentation](https://docs.gitlab.com/ee/user/project/releases/#create-release-from-gitlab-ci) + - [Gitlab Release Assets as Generic Package Documentation](https://gitlab.com/gitlab-org/release-cli/-/tree/master/docs/examples/release-assets-as-generic-package/) + - [Example .gitlab-ci.yml file using Release Generic Packages for generating a update package from the Sensei-LMS wordpress plugin](https://gist.github.com/timwiel/9dfd3526c768efad4973254085e065ce) + + +3. **GitLab Releases using Source Code Assets**: + - Create a new release using the "Releases" feature on Gitlab. + - Add the following code: + ```php + //Add the following code to your main plugin file or `functions.php` file to check for a new update from releases using release assets + $myUpdateChecker->getVcsApi()->enableReleaseAssets(); + ``` + - PUC will periodically check the release version (based on release tag name) and display a notification if the release version is greater than the installed version. + - The release name should loosely follow [SemVer](http://semver.org/) but these are all valid release names: `v1.2.3`, `v1.2-foo`, `1.2.3_rc1-ABC`, `1.2.3.4.5` However, be warned that it's not smart enough to filter out alpha/beta/RC versions. If that's a problem, you might want to use GitLab branches instead. + + +4. **Tags** (this is the default option): + - To release version 1.2.3, create a new Git tag named `v1.2.3` or `1.2.3`. + - Optionally, add the following code: + ```php + //Add the following code to your main plugin file or `functions.php` file to check for updates from the default branch + $myUpdateChecker->setBranch('master'); //or 'main' + ``` + - PUC doesn't require strict adherence to [SemVer](http://semver.org/). These are all valid tag names: `v1.2.3`, `v1.2-foo`, `1.2.3_rc1-ABC`, `1.2.3.4.5`. However, be warned that it's not smart enough to filter out alpha/beta/RC versions. If that's a problem, you might want to use GitLab branches instead. + +License Management +------------------ + +Currently, the update checker doesn't have any built-in license management features. It only provides some hooks that you can use to, for example, append license keys to update requests (`$updateChecker->addQueryArgFilter()`). If you're looking for ways to manage and verify licenses, please post your feedback in [this issue](https://github.com/YahnisElsts/plugin-update-checker/issues/222). + +Resources +--------- + +- [This blog post](http://w-shadow.com/blog/2010/09/02/automatic-updates-for-any-plugin/) has more information about the update checker API. *Slightly out of date.* +- [Debug Bar](https://wordpress.org/plugins/debug-bar/) - useful for testing and debugging the update checker. +- [Update format reference](https://docs.google.com/spreadsheets/d/1eOBbW7Go2qEQXReOOCdidMTf_tDYRq4JfegcO1CBPIs/edit?usp=sharing) - describes all fields supported by the JSON-based update information format used by the update checker. Only covers plugins. Themes use a similar but more limited format. +- [Securing download links](http://w-shadow.com/blog/2013/03/19/plugin-updates-securing-download-links/) - a general overview. +- [A GUI for entering download credentials](http://open-tools.net/documentation/tutorial-automatic-updates.html#wordpress) +- [Theme Update Checker](http://w-shadow.com/blog/2011/06/02/automatic-updates-for-commercial-themes/) - an older, theme-only variant of this update checker. diff --git a/app/core/puc/composer.json b/app/core/puc/composer.json new file mode 100755 index 0000000..f2218b6 --- /dev/null +++ b/app/core/puc/composer.json @@ -0,0 +1,23 @@ +{ + "name": "yahnis-elsts/plugin-update-checker", + "type": "library", + "description": "A custom update checker for WordPress plugins and themes. Useful if you can't host your plugin in the official WP repository but still want it to support automatic updates.", + "keywords": ["wordpress", "plugin updates", "automatic updates", "theme updates"], + "homepage": "https://github.com/YahnisElsts/plugin-update-checker/", + "license": "MIT", + "authors": [ + { + "name": "Yahnis Elsts", + "email": "whiteshadow@w-shadow.com", + "homepage": "http://w-shadow.com/", + "role": "Developer" + } + ], + "require": { + "php": ">=5.2.0", + "ext-json": "*" + }, + "autoload": { + "files": ["load-v4p11.php"] + } +} diff --git a/app/core/puc/css/puc-debug-bar.css b/app/core/puc/css/puc-debug-bar.css new file mode 100755 index 0000000..e011078 --- /dev/null +++ b/app/core/puc/css/puc-debug-bar.css @@ -0,0 +1,70 @@ +.puc-debug-bar-panel-v4 pre { + margin-top: 0; +} + +/* Style the debug data table to match "widefat" table style used by WordPress. */ +table.puc-debug-data { + width: 100%; + clear: both; + margin: 0; + + border-spacing: 0; + background-color: #f9f9f9; + + border-radius: 3px; + border: 1px solid #dfdfdf; + border-collapse: separate; +} + +table.puc-debug-data * { + word-wrap: break-word; +} + +table.puc-debug-data th { + width: 11em; + padding: 7px 7px 8px; + text-align: left; + + font-family: "Georgia", "Times New Roman", "Bitstream Charter", "Times", serif; + font-weight: 400; + font-size: 14px; + line-height: 1.3em; + text-shadow: rgba(255, 255, 255, 0.804) 0 1px 0; +} + +table.puc-debug-data td, table.puc-debug-data th { + border-width: 1px 0; + border-style: solid; + + border-top-color: #fff; + border-bottom-color: #dfdfdf; + + text-transform: none; +} + +table.puc-debug-data td { + color: #555; + font-size: 12px; + padding: 4px 7px 2px; + vertical-align: top; +} + +.puc-ajax-response { + border: 1px solid #dfdfdf; + border-radius: 3px; + padding: 0.5em; + margin: 5px 0; + background-color: white; +} + +.puc-ajax-nonce { + display: none; +} + +.puc-ajax-response dt { + margin: 0; +} + +.puc-ajax-response dd { + margin: 0 0 1em; +} diff --git a/app/core/puc/examples/plugin.json b/app/core/puc/examples/plugin.json new file mode 100755 index 0000000..fea211a --- /dev/null +++ b/app/core/puc/examples/plugin.json @@ -0,0 +1,52 @@ +{ + "name": "My Example Plugin", + "version": "2.0", + "download_url": "http://example.com/updates/example-plugin.zip", + + "homepage": "http://example.com/", + "requires": "4.5", + "tested": "4.8", + "last_updated": "2017-01-01 16:17:00", + "upgrade_notice": "Here's why you should upgrade...", + + "author": "Janis Elsts", + "author_homepage": "http://example.com/", + + "sections": { + "description": "(Required) Plugin description. Basic HTML can be used in all sections.", + "installation": "(Recommended) Installation instructions.", + "changelog": "(Recommended) Changelog.

This section will be displayed by default when the user clicks 'View version x.y.z details'.

", + "custom_section": "This is a custom section labeled 'Custom Section'." + }, + + "icons" : { + "1x" : "http://w-shadow.com/files/external-update-example/assets/icon-128x128.png", + "2x" : "http://w-shadow.com/files/external-update-example/assets/icon-256x256.png" + }, + + "banners": { + "low": "http://w-shadow.com/files/external-update-example/assets/banner-772x250.png", + "high": "http://w-shadow.com/files/external-update-example/assets/banner-1544x500.png" + }, + + "translations": [ + { + "language": "fr_FR", + "version": "4.0", + "updated": "2016-04-22 23:22:42", + "package": "http://example.com/updates/translations/french-language-pack.zip" + }, + { + "language": "de_DE", + "version": "5.0", + "updated": "2016-04-22 23:22:42", + "package": "http://example.com/updates/translations/german-language-pack.zip" + } + ], + + "rating": 90, + "num_ratings": 123, + + "downloaded": 1234, + "active_installs": 12345 +} \ No newline at end of file diff --git a/app/core/puc/examples/theme.json b/app/core/puc/examples/theme.json new file mode 100755 index 0000000..df6c8c7 --- /dev/null +++ b/app/core/puc/examples/theme.json @@ -0,0 +1,5 @@ +{ + "version": "2.0", + "details_url": "http://example.com/version-2.0-details.html", + "download_url": "http://example.com/example-theme-2.0.zip" +} \ No newline at end of file diff --git a/app/core/puc/js/debug-bar.js b/app/core/puc/js/debug-bar.js new file mode 100755 index 0000000..e73d890 --- /dev/null +++ b/app/core/puc/js/debug-bar.js @@ -0,0 +1,52 @@ +jQuery(function($) { + + function runAjaxAction(button, action) { + button = $(button); + var panel = button.closest('.puc-debug-bar-panel-v4'); + var responseBox = button.closest('td').find('.puc-ajax-response'); + + responseBox.text('Processing...').show(); + $.post( + ajaxurl, + { + action : action, + uid : panel.data('uid'), + _wpnonce: panel.data('nonce') + }, + function(data) { + responseBox.html(data); + }, + 'html' + ); + } + + $('.puc-debug-bar-panel-v4 input[name="puc-check-now-button"]').on('click', function() { + runAjaxAction(this, 'puc_v4_debug_check_now'); + return false; + }); + + $('.puc-debug-bar-panel-v4 input[name="puc-request-info-button"]').on('click', function() { + runAjaxAction(this, 'puc_v4_debug_request_info'); + return false; + }); + + + // Debug Bar uses the panel class name as part of its link and container IDs. This means we can + // end up with multiple identical IDs if more than one plugin uses the update checker library. + // Fix it by replacing the class name with the plugin slug. + var panels = $('#debug-menu-targets').find('.puc-debug-bar-panel-v4'); + panels.each(function() { + var panel = $(this); + var uid = panel.data('uid'); + var target = panel.closest('.debug-menu-target'); + + //Change the panel wrapper ID. + target.attr('id', 'debug-menu-target-puc-' + uid); + + //Change the menu link ID as well and point it at the new target ID. + $('#debug-bar-menu').find('.puc-debug-menu-link-' + uid) + .closest('.debug-menu-link') + .attr('id', 'debug-menu-link-puc-' + uid) + .attr('href', '#' + target.attr('id')); + }); +}); \ No newline at end of file diff --git a/app/core/puc/languages/plugin-update-checker-ca.mo b/app/core/puc/languages/plugin-update-checker-ca.mo new file mode 100755 index 0000000..59645fa Binary files /dev/null and b/app/core/puc/languages/plugin-update-checker-ca.mo differ diff --git a/app/core/puc/languages/plugin-update-checker-ca.po b/app/core/puc/languages/plugin-update-checker-ca.po new file mode 100755 index 0000000..facf365 --- /dev/null +++ b/app/core/puc/languages/plugin-update-checker-ca.po @@ -0,0 +1,48 @@ +msgid "" +msgstr "" +"Project-Id-Version: plugin-update-checker\n" +"POT-Creation-Date: 2017-11-24 17:02+0200\n" +"PO-Revision-Date: 2019-09-25 18:15+0200\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.2.3\n" +"X-Poedit-Basepath: ..\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n" +"Last-Translator: \n" +"Language: ca\n" +"X-Poedit-SearchPath-0: .\n" + +#: Puc/v4p3/Plugin/UpdateChecker.php:395 +msgid "Check for updates" +msgstr "Comprova si hi ha actualitzacions" + +#: Puc/v4p3/Plugin/UpdateChecker.php:548 +#, php-format +msgctxt "the plugin title" +msgid "The %s plugin is up to date." +msgstr "L’extensió %s està actualitzada." + +#: Puc/v4p3/Plugin/UpdateChecker.php:550 +#, php-format +msgctxt "the plugin title" +msgid "A new version of the %s plugin is available." +msgstr "Una nova versió de l’extensió %s està disponible." + +#: Puc/v4p3/Plugin/UpdateChecker.php:552 +#, php-format +msgctxt "the plugin title" +msgid "Could not determine if updates are available for %s." +msgstr "No s’ha pogut determinar si hi ha actualitzacions per a %s." + +#: Puc/v4p3/Plugin/UpdateChecker.php:558 +#, php-format +msgid "Unknown update checker status \"%s\"" +msgstr "Estat del comprovador d’actualitzacions desconegut \"%s\"" + +#: Puc/v4p3/Vcs/PluginUpdateChecker.php:95 +msgid "There is no changelog available." +msgstr "No hi ha cap registre de canvis disponible." diff --git a/app/core/puc/languages/plugin-update-checker-cs_CZ.mo b/app/core/puc/languages/plugin-update-checker-cs_CZ.mo new file mode 100755 index 0000000..ac6d20e Binary files /dev/null and b/app/core/puc/languages/plugin-update-checker-cs_CZ.mo differ diff --git a/app/core/puc/languages/plugin-update-checker-cs_CZ.po b/app/core/puc/languages/plugin-update-checker-cs_CZ.po new file mode 100755 index 0000000..2c9af18 --- /dev/null +++ b/app/core/puc/languages/plugin-update-checker-cs_CZ.po @@ -0,0 +1,45 @@ +msgid "" +msgstr "" +"Project-Id-Version: plugin-update-checker\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2017-05-20 10:53+0300\n" +"PO-Revision-Date: 2017-07-05 15:39+0000\n" +"Last-Translator: Vojtěch Sajdl \n" +"Language-Team: Czech (Czech Republic)\n" +"Language: cs-CZ\n" +"Plural-Forms: nplurals=2; plural=(n != 1)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Loco-Source-Locale: cs_CZ\n" +"X-Generator: Loco - https://localise.biz/\n" +"X-Poedit-Basepath: ..\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n" +"X-Poedit-SearchPath-0: .\n" +"X-Loco-Parser: loco_parse_po" + +#: Puc/v4p1/Plugin/UpdateChecker.php:358 +msgid "Check for updates" +msgstr "Zkontrolovat aktualizace" + +#: Puc/v4p1/Plugin/UpdateChecker.php:405 +#, php-format +msgctxt "the plugin title" +msgid "The %s plugin is up to date." +msgstr "Plugin %s je aktuální." + +#: Puc/v4p1/Plugin/UpdateChecker.php:407 +#, php-format +msgctxt "the plugin title" +msgid "A new version of the %s plugin is available." +msgstr "Nová verze pluginu %s je dostupná." + +#: Puc/v4p1/Plugin/UpdateChecker.php:409 +#, php-format +msgid "Unknown update checker status \"%s\"" +msgstr "Neznámý status kontroly aktualizací \"%s\"" + +#: Puc/v4p1/Vcs/PluginUpdateChecker.php:83 +msgid "There is no changelog available." +msgstr "Changelog není dostupný." diff --git a/app/core/puc/languages/plugin-update-checker-da_DK.mo b/app/core/puc/languages/plugin-update-checker-da_DK.mo new file mode 100755 index 0000000..9c59670 Binary files /dev/null and b/app/core/puc/languages/plugin-update-checker-da_DK.mo differ diff --git a/app/core/puc/languages/plugin-update-checker-da_DK.po b/app/core/puc/languages/plugin-update-checker-da_DK.po new file mode 100755 index 0000000..ed13312 --- /dev/null +++ b/app/core/puc/languages/plugin-update-checker-da_DK.po @@ -0,0 +1,42 @@ +msgid "" +msgstr "" +"Project-Id-Version: plugin-update-checker\n" +"POT-Creation-Date: 2017-05-20 10:53+0300\n" +"PO-Revision-Date: 2017-10-17 11:07+0200\n" +"Last-Translator: Mikk3lRo\n" +"Language-Team: Mikk3lRo\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.0.4\n" +"X-Poedit-Basepath: ..\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n" +"Language: da_DK\n" +"X-Poedit-SearchPath-0: .\n" + +#: Puc/v4p1/Plugin/UpdateChecker.php:358 +msgid "Check for updates" +msgstr "Undersøg for opdateringer" + +#: Puc/v4p1/Plugin/UpdateChecker.php:405 +#, php-format +msgctxt "the plugin title" +msgid "The %s plugin is up to date." +msgstr "Plugin'et %s er allerede opdateret." + +#: Puc/v4p1/Plugin/UpdateChecker.php:407 +#, php-format +msgctxt "the plugin title" +msgid "A new version of the %s plugin is available." +msgstr "En ny version af plugin'et %s er tilgængelig." + +#: Puc/v4p1/Plugin/UpdateChecker.php:409 +#, php-format +msgid "Unknown update checker status \"%s\"" +msgstr "Ukendt opdateringsstatus: \"%s\"" + +#: Puc/v4p1/Vcs/PluginUpdateChecker.php:83 +msgid "There is no changelog available." +msgstr "Der er ingen ændringslog tilgængelig." diff --git a/app/core/puc/languages/plugin-update-checker-de_DE.mo b/app/core/puc/languages/plugin-update-checker-de_DE.mo new file mode 100755 index 0000000..0734cae Binary files /dev/null and b/app/core/puc/languages/plugin-update-checker-de_DE.mo differ diff --git a/app/core/puc/languages/plugin-update-checker-de_DE.po b/app/core/puc/languages/plugin-update-checker-de_DE.po new file mode 100755 index 0000000..e40636b --- /dev/null +++ b/app/core/puc/languages/plugin-update-checker-de_DE.po @@ -0,0 +1,38 @@ +msgid "" +msgstr "" +"Project-Id-Version: plugin-update-checker\n" +"POT-Creation-Date: 2016-06-29 20:21+0100\n" +"PO-Revision-Date: 2016-06-29 20:23+0100\n" +"Last-Translator: Igor Lückel \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.1\n" +"X-Poedit-Basepath: ..\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e\n" +"Language: de_DE\n" +"X-Poedit-SearchPath-0: .\n" + +#: github-checker.php:137 +msgid "There is no changelog available." +msgstr "Es ist keine Liste von Programmänderungen verfügbar." + +#: plugin-update-checker.php:852 +msgid "Check for updates" +msgstr "Nach Update suchen" + +#: plugin-update-checker.php:896 +msgid "This plugin is up to date." +msgstr "Das Plugin ist aktuell." + +#: plugin-update-checker.php:898 +msgid "A new version of this plugin is available." +msgstr "Es ist eine neue Version für das Plugin verfügbar." + +#: plugin-update-checker.php:900 +#, php-format +msgid "Unknown update checker status \"%s\"" +msgstr "Unbekannter Update Status \"%s\"" diff --git a/app/core/puc/languages/plugin-update-checker-es_AR.mo b/app/core/puc/languages/plugin-update-checker-es_AR.mo new file mode 100755 index 0000000..85afecd Binary files /dev/null and b/app/core/puc/languages/plugin-update-checker-es_AR.mo differ diff --git a/app/core/puc/languages/plugin-update-checker-es_AR.po b/app/core/puc/languages/plugin-update-checker-es_AR.po new file mode 100755 index 0000000..b335844 --- /dev/null +++ b/app/core/puc/languages/plugin-update-checker-es_AR.po @@ -0,0 +1,48 @@ +msgid "" +msgstr "" +"Project-Id-Version: plugin-update-checker\n" +"POT-Creation-Date: 2017-11-24 17:02+0200\n" +"PO-Revision-Date: 2020-03-21 15:13-0400\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.3\n" +"X-Poedit-Basepath: ..\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n" +"Last-Translator: \n" +"Language: es_ES\n" +"X-Poedit-SearchPath-0: .\n" + +#: Puc/v4p3/Plugin/UpdateChecker.php:395 +msgid "Check for updates" +msgstr "Comprobar si hay actualizaciones" + +#: Puc/v4p3/Plugin/UpdateChecker.php:548 +#, php-format +msgctxt "the plugin title" +msgid "The %s plugin is up to date." +msgstr "El plugin %s está actualizado." + +#: Puc/v4p3/Plugin/UpdateChecker.php:550 +#, php-format +msgctxt "the plugin title" +msgid "A new version of the %s plugin is available." +msgstr "Una nueva versión del %s plugin está disponible." + +#: Puc/v4p3/Plugin/UpdateChecker.php:552 +#, php-format +msgctxt "the plugin title" +msgid "Could not determine if updates are available for %s." +msgstr "No se pudo determinar si hay actualizaciones disponibles para %s." + +#: Puc/v4p3/Plugin/UpdateChecker.php:558 +#, php-format +msgid "Unknown update checker status \"%s\"" +msgstr "Estado del comprobador de actualización desconocido «%s»" + +#: Puc/v4p3/Vcs/PluginUpdateChecker.php:95 +msgid "There is no changelog available." +msgstr "No hay un registro de cambios disponible." diff --git a/app/core/puc/languages/plugin-update-checker-es_CL.mo b/app/core/puc/languages/plugin-update-checker-es_CL.mo new file mode 100755 index 0000000..de9c752 Binary files /dev/null and b/app/core/puc/languages/plugin-update-checker-es_CL.mo differ diff --git a/app/core/puc/languages/plugin-update-checker-es_CL.po b/app/core/puc/languages/plugin-update-checker-es_CL.po new file mode 100755 index 0000000..929ccbd --- /dev/null +++ b/app/core/puc/languages/plugin-update-checker-es_CL.po @@ -0,0 +1,48 @@ +msgid "" +msgstr "" +"Project-Id-Version: plugin-update-checker\n" +"POT-Creation-Date: 2017-11-24 17:02+0200\n" +"PO-Revision-Date: 2020-03-21 15:14-0400\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.3\n" +"X-Poedit-Basepath: ..\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n" +"Last-Translator: \n" +"Language: es_ES\n" +"X-Poedit-SearchPath-0: .\n" + +#: Puc/v4p3/Plugin/UpdateChecker.php:395 +msgid "Check for updates" +msgstr "Comprobar si hay actualizaciones" + +#: Puc/v4p3/Plugin/UpdateChecker.php:548 +#, php-format +msgctxt "the plugin title" +msgid "The %s plugin is up to date." +msgstr "El plugin %s está actualizado." + +#: Puc/v4p3/Plugin/UpdateChecker.php:550 +#, php-format +msgctxt "the plugin title" +msgid "A new version of the %s plugin is available." +msgstr "Una nueva versión del %s plugin está disponible." + +#: Puc/v4p3/Plugin/UpdateChecker.php:552 +#, php-format +msgctxt "the plugin title" +msgid "Could not determine if updates are available for %s." +msgstr "No se pudo determinar si hay actualizaciones disponibles para %s." + +#: Puc/v4p3/Plugin/UpdateChecker.php:558 +#, php-format +msgid "Unknown update checker status \"%s\"" +msgstr "Estado del comprobador de actualización desconocido «%s»" + +#: Puc/v4p3/Vcs/PluginUpdateChecker.php:95 +msgid "There is no changelog available." +msgstr "No hay un registro de cambios disponible." diff --git a/app/core/puc/languages/plugin-update-checker-es_CO.mo b/app/core/puc/languages/plugin-update-checker-es_CO.mo new file mode 100755 index 0000000..de9c752 Binary files /dev/null and b/app/core/puc/languages/plugin-update-checker-es_CO.mo differ diff --git a/app/core/puc/languages/plugin-update-checker-es_CO.po b/app/core/puc/languages/plugin-update-checker-es_CO.po new file mode 100755 index 0000000..929ccbd --- /dev/null +++ b/app/core/puc/languages/plugin-update-checker-es_CO.po @@ -0,0 +1,48 @@ +msgid "" +msgstr "" +"Project-Id-Version: plugin-update-checker\n" +"POT-Creation-Date: 2017-11-24 17:02+0200\n" +"PO-Revision-Date: 2020-03-21 15:14-0400\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.3\n" +"X-Poedit-Basepath: ..\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n" +"Last-Translator: \n" +"Language: es_ES\n" +"X-Poedit-SearchPath-0: .\n" + +#: Puc/v4p3/Plugin/UpdateChecker.php:395 +msgid "Check for updates" +msgstr "Comprobar si hay actualizaciones" + +#: Puc/v4p3/Plugin/UpdateChecker.php:548 +#, php-format +msgctxt "the plugin title" +msgid "The %s plugin is up to date." +msgstr "El plugin %s está actualizado." + +#: Puc/v4p3/Plugin/UpdateChecker.php:550 +#, php-format +msgctxt "the plugin title" +msgid "A new version of the %s plugin is available." +msgstr "Una nueva versión del %s plugin está disponible." + +#: Puc/v4p3/Plugin/UpdateChecker.php:552 +#, php-format +msgctxt "the plugin title" +msgid "Could not determine if updates are available for %s." +msgstr "No se pudo determinar si hay actualizaciones disponibles para %s." + +#: Puc/v4p3/Plugin/UpdateChecker.php:558 +#, php-format +msgid "Unknown update checker status \"%s\"" +msgstr "Estado del comprobador de actualización desconocido «%s»" + +#: Puc/v4p3/Vcs/PluginUpdateChecker.php:95 +msgid "There is no changelog available." +msgstr "No hay un registro de cambios disponible." diff --git a/app/core/puc/languages/plugin-update-checker-es_CR.mo b/app/core/puc/languages/plugin-update-checker-es_CR.mo new file mode 100755 index 0000000..de9c752 Binary files /dev/null and b/app/core/puc/languages/plugin-update-checker-es_CR.mo differ diff --git a/app/core/puc/languages/plugin-update-checker-es_CR.po b/app/core/puc/languages/plugin-update-checker-es_CR.po new file mode 100755 index 0000000..929ccbd --- /dev/null +++ b/app/core/puc/languages/plugin-update-checker-es_CR.po @@ -0,0 +1,48 @@ +msgid "" +msgstr "" +"Project-Id-Version: plugin-update-checker\n" +"POT-Creation-Date: 2017-11-24 17:02+0200\n" +"PO-Revision-Date: 2020-03-21 15:14-0400\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.3\n" +"X-Poedit-Basepath: ..\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n" +"Last-Translator: \n" +"Language: es_ES\n" +"X-Poedit-SearchPath-0: .\n" + +#: Puc/v4p3/Plugin/UpdateChecker.php:395 +msgid "Check for updates" +msgstr "Comprobar si hay actualizaciones" + +#: Puc/v4p3/Plugin/UpdateChecker.php:548 +#, php-format +msgctxt "the plugin title" +msgid "The %s plugin is up to date." +msgstr "El plugin %s está actualizado." + +#: Puc/v4p3/Plugin/UpdateChecker.php:550 +#, php-format +msgctxt "the plugin title" +msgid "A new version of the %s plugin is available." +msgstr "Una nueva versión del %s plugin está disponible." + +#: Puc/v4p3/Plugin/UpdateChecker.php:552 +#, php-format +msgctxt "the plugin title" +msgid "Could not determine if updates are available for %s." +msgstr "No se pudo determinar si hay actualizaciones disponibles para %s." + +#: Puc/v4p3/Plugin/UpdateChecker.php:558 +#, php-format +msgid "Unknown update checker status \"%s\"" +msgstr "Estado del comprobador de actualización desconocido «%s»" + +#: Puc/v4p3/Vcs/PluginUpdateChecker.php:95 +msgid "There is no changelog available." +msgstr "No hay un registro de cambios disponible." diff --git a/app/core/puc/languages/plugin-update-checker-es_DO.mo b/app/core/puc/languages/plugin-update-checker-es_DO.mo new file mode 100755 index 0000000..de9c752 Binary files /dev/null and b/app/core/puc/languages/plugin-update-checker-es_DO.mo differ diff --git a/app/core/puc/languages/plugin-update-checker-es_DO.po b/app/core/puc/languages/plugin-update-checker-es_DO.po new file mode 100755 index 0000000..929ccbd --- /dev/null +++ b/app/core/puc/languages/plugin-update-checker-es_DO.po @@ -0,0 +1,48 @@ +msgid "" +msgstr "" +"Project-Id-Version: plugin-update-checker\n" +"POT-Creation-Date: 2017-11-24 17:02+0200\n" +"PO-Revision-Date: 2020-03-21 15:14-0400\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.3\n" +"X-Poedit-Basepath: ..\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n" +"Last-Translator: \n" +"Language: es_ES\n" +"X-Poedit-SearchPath-0: .\n" + +#: Puc/v4p3/Plugin/UpdateChecker.php:395 +msgid "Check for updates" +msgstr "Comprobar si hay actualizaciones" + +#: Puc/v4p3/Plugin/UpdateChecker.php:548 +#, php-format +msgctxt "the plugin title" +msgid "The %s plugin is up to date." +msgstr "El plugin %s está actualizado." + +#: Puc/v4p3/Plugin/UpdateChecker.php:550 +#, php-format +msgctxt "the plugin title" +msgid "A new version of the %s plugin is available." +msgstr "Una nueva versión del %s plugin está disponible." + +#: Puc/v4p3/Plugin/UpdateChecker.php:552 +#, php-format +msgctxt "the plugin title" +msgid "Could not determine if updates are available for %s." +msgstr "No se pudo determinar si hay actualizaciones disponibles para %s." + +#: Puc/v4p3/Plugin/UpdateChecker.php:558 +#, php-format +msgid "Unknown update checker status \"%s\"" +msgstr "Estado del comprobador de actualización desconocido «%s»" + +#: Puc/v4p3/Vcs/PluginUpdateChecker.php:95 +msgid "There is no changelog available." +msgstr "No hay un registro de cambios disponible." diff --git a/app/core/puc/languages/plugin-update-checker-es_ES.mo b/app/core/puc/languages/plugin-update-checker-es_ES.mo new file mode 100755 index 0000000..1cf71f4 Binary files /dev/null and b/app/core/puc/languages/plugin-update-checker-es_ES.mo differ diff --git a/app/core/puc/languages/plugin-update-checker-es_ES.po b/app/core/puc/languages/plugin-update-checker-es_ES.po new file mode 100755 index 0000000..d9c3bb1 --- /dev/null +++ b/app/core/puc/languages/plugin-update-checker-es_ES.po @@ -0,0 +1,48 @@ +msgid "" +msgstr "" +"Project-Id-Version: plugin-update-checker\n" +"POT-Creation-Date: 2017-11-24 17:02+0200\n" +"PO-Revision-Date: 2020-03-21 14:56-0400\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.3\n" +"X-Poedit-Basepath: ..\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n" +"Last-Translator: \n" +"Language: es_ES\n" +"X-Poedit-SearchPath-0: .\n" + +#: Puc/v4p3/Plugin/UpdateChecker.php:395 +msgid "Check for updates" +msgstr "Comprobar si hay actualizaciones" + +#: Puc/v4p3/Plugin/UpdateChecker.php:548 +#, php-format +msgctxt "the plugin title" +msgid "The %s plugin is up to date." +msgstr "El plugin %s está actualizado." + +#: Puc/v4p3/Plugin/UpdateChecker.php:550 +#, php-format +msgctxt "the plugin title" +msgid "A new version of the %s plugin is available." +msgstr "Una nueva versión del %s plugin está disponible." + +#: Puc/v4p3/Plugin/UpdateChecker.php:552 +#, php-format +msgctxt "the plugin title" +msgid "Could not determine if updates are available for %s." +msgstr "No se pudo determinar si hay actualizaciones disponibles para %s." + +#: Puc/v4p3/Plugin/UpdateChecker.php:558 +#, php-format +msgid "Unknown update checker status \"%s\"" +msgstr "Estado del comprobador de actualización desconocido «%s»" + +#: Puc/v4p3/Vcs/PluginUpdateChecker.php:95 +msgid "There is no changelog available." +msgstr "No hay un registro de cambios disponible." diff --git a/app/core/puc/languages/plugin-update-checker-es_GT.mo b/app/core/puc/languages/plugin-update-checker-es_GT.mo new file mode 100755 index 0000000..de9c752 Binary files /dev/null and b/app/core/puc/languages/plugin-update-checker-es_GT.mo differ diff --git a/app/core/puc/languages/plugin-update-checker-es_GT.po b/app/core/puc/languages/plugin-update-checker-es_GT.po new file mode 100755 index 0000000..929ccbd --- /dev/null +++ b/app/core/puc/languages/plugin-update-checker-es_GT.po @@ -0,0 +1,48 @@ +msgid "" +msgstr "" +"Project-Id-Version: plugin-update-checker\n" +"POT-Creation-Date: 2017-11-24 17:02+0200\n" +"PO-Revision-Date: 2020-03-21 15:14-0400\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.3\n" +"X-Poedit-Basepath: ..\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n" +"Last-Translator: \n" +"Language: es_ES\n" +"X-Poedit-SearchPath-0: .\n" + +#: Puc/v4p3/Plugin/UpdateChecker.php:395 +msgid "Check for updates" +msgstr "Comprobar si hay actualizaciones" + +#: Puc/v4p3/Plugin/UpdateChecker.php:548 +#, php-format +msgctxt "the plugin title" +msgid "The %s plugin is up to date." +msgstr "El plugin %s está actualizado." + +#: Puc/v4p3/Plugin/UpdateChecker.php:550 +#, php-format +msgctxt "the plugin title" +msgid "A new version of the %s plugin is available." +msgstr "Una nueva versión del %s plugin está disponible." + +#: Puc/v4p3/Plugin/UpdateChecker.php:552 +#, php-format +msgctxt "the plugin title" +msgid "Could not determine if updates are available for %s." +msgstr "No se pudo determinar si hay actualizaciones disponibles para %s." + +#: Puc/v4p3/Plugin/UpdateChecker.php:558 +#, php-format +msgid "Unknown update checker status \"%s\"" +msgstr "Estado del comprobador de actualización desconocido «%s»" + +#: Puc/v4p3/Vcs/PluginUpdateChecker.php:95 +msgid "There is no changelog available." +msgstr "No hay un registro de cambios disponible." diff --git a/app/core/puc/languages/plugin-update-checker-es_HN.mo b/app/core/puc/languages/plugin-update-checker-es_HN.mo new file mode 100755 index 0000000..de9c752 Binary files /dev/null and b/app/core/puc/languages/plugin-update-checker-es_HN.mo differ diff --git a/app/core/puc/languages/plugin-update-checker-es_HN.po b/app/core/puc/languages/plugin-update-checker-es_HN.po new file mode 100755 index 0000000..929ccbd --- /dev/null +++ b/app/core/puc/languages/plugin-update-checker-es_HN.po @@ -0,0 +1,48 @@ +msgid "" +msgstr "" +"Project-Id-Version: plugin-update-checker\n" +"POT-Creation-Date: 2017-11-24 17:02+0200\n" +"PO-Revision-Date: 2020-03-21 15:14-0400\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.3\n" +"X-Poedit-Basepath: ..\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n" +"Last-Translator: \n" +"Language: es_ES\n" +"X-Poedit-SearchPath-0: .\n" + +#: Puc/v4p3/Plugin/UpdateChecker.php:395 +msgid "Check for updates" +msgstr "Comprobar si hay actualizaciones" + +#: Puc/v4p3/Plugin/UpdateChecker.php:548 +#, php-format +msgctxt "the plugin title" +msgid "The %s plugin is up to date." +msgstr "El plugin %s está actualizado." + +#: Puc/v4p3/Plugin/UpdateChecker.php:550 +#, php-format +msgctxt "the plugin title" +msgid "A new version of the %s plugin is available." +msgstr "Una nueva versión del %s plugin está disponible." + +#: Puc/v4p3/Plugin/UpdateChecker.php:552 +#, php-format +msgctxt "the plugin title" +msgid "Could not determine if updates are available for %s." +msgstr "No se pudo determinar si hay actualizaciones disponibles para %s." + +#: Puc/v4p3/Plugin/UpdateChecker.php:558 +#, php-format +msgid "Unknown update checker status \"%s\"" +msgstr "Estado del comprobador de actualización desconocido «%s»" + +#: Puc/v4p3/Vcs/PluginUpdateChecker.php:95 +msgid "There is no changelog available." +msgstr "No hay un registro de cambios disponible." diff --git a/app/core/puc/languages/plugin-update-checker-es_MX.mo b/app/core/puc/languages/plugin-update-checker-es_MX.mo new file mode 100755 index 0000000..9ce83f6 Binary files /dev/null and b/app/core/puc/languages/plugin-update-checker-es_MX.mo differ diff --git a/app/core/puc/languages/plugin-update-checker-es_MX.po b/app/core/puc/languages/plugin-update-checker-es_MX.po new file mode 100755 index 0000000..de33f8f --- /dev/null +++ b/app/core/puc/languages/plugin-update-checker-es_MX.po @@ -0,0 +1,48 @@ +msgid "" +msgstr "" +"Project-Id-Version: plugin-update-checker\n" +"POT-Creation-Date: 2017-11-24 17:02+0200\n" +"PO-Revision-Date: 2020-03-21 14:57-0400\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.3\n" +"X-Poedit-Basepath: ..\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n" +"Last-Translator: \n" +"Language: es_ES\n" +"X-Poedit-SearchPath-0: .\n" + +#: Puc/v4p3/Plugin/UpdateChecker.php:395 +msgid "Check for updates" +msgstr "Comprobar si hay actualizaciones" + +#: Puc/v4p3/Plugin/UpdateChecker.php:548 +#, php-format +msgctxt "the plugin title" +msgid "The %s plugin is up to date." +msgstr "El plugin %s está actualizado." + +#: Puc/v4p3/Plugin/UpdateChecker.php:550 +#, php-format +msgctxt "the plugin title" +msgid "A new version of the %s plugin is available." +msgstr "Una nueva versión del %s plugin está disponible." + +#: Puc/v4p3/Plugin/UpdateChecker.php:552 +#, php-format +msgctxt "the plugin title" +msgid "Could not determine if updates are available for %s." +msgstr "No se pudo determinar si hay actualizaciones disponibles para %s." + +#: Puc/v4p3/Plugin/UpdateChecker.php:558 +#, php-format +msgid "Unknown update checker status \"%s\"" +msgstr "Estado del comprobador de actualización desconocido «%s»" + +#: Puc/v4p3/Vcs/PluginUpdateChecker.php:95 +msgid "There is no changelog available." +msgstr "No hay un registro de cambios disponible." diff --git a/app/core/puc/languages/plugin-update-checker-es_PE.mo b/app/core/puc/languages/plugin-update-checker-es_PE.mo new file mode 100755 index 0000000..92c4f34 Binary files /dev/null and b/app/core/puc/languages/plugin-update-checker-es_PE.mo differ diff --git a/app/core/puc/languages/plugin-update-checker-es_PE.po b/app/core/puc/languages/plugin-update-checker-es_PE.po new file mode 100755 index 0000000..58b2d4f --- /dev/null +++ b/app/core/puc/languages/plugin-update-checker-es_PE.po @@ -0,0 +1,48 @@ +msgid "" +msgstr "" +"Project-Id-Version: plugin-update-checker\n" +"POT-Creation-Date: 2017-11-24 17:02+0200\n" +"PO-Revision-Date: 2020-03-21 15:15-0400\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.3\n" +"X-Poedit-Basepath: ..\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n" +"Last-Translator: \n" +"Language: es_ES\n" +"X-Poedit-SearchPath-0: .\n" + +#: Puc/v4p3/Plugin/UpdateChecker.php:395 +msgid "Check for updates" +msgstr "Comprobar si hay actualizaciones" + +#: Puc/v4p3/Plugin/UpdateChecker.php:548 +#, php-format +msgctxt "the plugin title" +msgid "The %s plugin is up to date." +msgstr "El plugin %s está actualizado." + +#: Puc/v4p3/Plugin/UpdateChecker.php:550 +#, php-format +msgctxt "the plugin title" +msgid "A new version of the %s plugin is available." +msgstr "Una nueva versión del %s plugin está disponible." + +#: Puc/v4p3/Plugin/UpdateChecker.php:552 +#, php-format +msgctxt "the plugin title" +msgid "Could not determine if updates are available for %s." +msgstr "No se pudo determinar si hay actualizaciones disponibles para %s." + +#: Puc/v4p3/Plugin/UpdateChecker.php:558 +#, php-format +msgid "Unknown update checker status \"%s\"" +msgstr "Estado del comprobador de actualización desconocido «%s»" + +#: Puc/v4p3/Vcs/PluginUpdateChecker.php:95 +msgid "There is no changelog available." +msgstr "No hay un registro de cambios disponible." diff --git a/app/core/puc/languages/plugin-update-checker-es_PR.mo b/app/core/puc/languages/plugin-update-checker-es_PR.mo new file mode 100755 index 0000000..92c4f34 Binary files /dev/null and b/app/core/puc/languages/plugin-update-checker-es_PR.mo differ diff --git a/app/core/puc/languages/plugin-update-checker-es_PR.po b/app/core/puc/languages/plugin-update-checker-es_PR.po new file mode 100755 index 0000000..58b2d4f --- /dev/null +++ b/app/core/puc/languages/plugin-update-checker-es_PR.po @@ -0,0 +1,48 @@ +msgid "" +msgstr "" +"Project-Id-Version: plugin-update-checker\n" +"POT-Creation-Date: 2017-11-24 17:02+0200\n" +"PO-Revision-Date: 2020-03-21 15:15-0400\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.3\n" +"X-Poedit-Basepath: ..\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n" +"Last-Translator: \n" +"Language: es_ES\n" +"X-Poedit-SearchPath-0: .\n" + +#: Puc/v4p3/Plugin/UpdateChecker.php:395 +msgid "Check for updates" +msgstr "Comprobar si hay actualizaciones" + +#: Puc/v4p3/Plugin/UpdateChecker.php:548 +#, php-format +msgctxt "the plugin title" +msgid "The %s plugin is up to date." +msgstr "El plugin %s está actualizado." + +#: Puc/v4p3/Plugin/UpdateChecker.php:550 +#, php-format +msgctxt "the plugin title" +msgid "A new version of the %s plugin is available." +msgstr "Una nueva versión del %s plugin está disponible." + +#: Puc/v4p3/Plugin/UpdateChecker.php:552 +#, php-format +msgctxt "the plugin title" +msgid "Could not determine if updates are available for %s." +msgstr "No se pudo determinar si hay actualizaciones disponibles para %s." + +#: Puc/v4p3/Plugin/UpdateChecker.php:558 +#, php-format +msgid "Unknown update checker status \"%s\"" +msgstr "Estado del comprobador de actualización desconocido «%s»" + +#: Puc/v4p3/Vcs/PluginUpdateChecker.php:95 +msgid "There is no changelog available." +msgstr "No hay un registro de cambios disponible." diff --git a/app/core/puc/languages/plugin-update-checker-es_UY.mo b/app/core/puc/languages/plugin-update-checker-es_UY.mo new file mode 100755 index 0000000..92c4f34 Binary files /dev/null and b/app/core/puc/languages/plugin-update-checker-es_UY.mo differ diff --git a/app/core/puc/languages/plugin-update-checker-es_UY.po b/app/core/puc/languages/plugin-update-checker-es_UY.po new file mode 100755 index 0000000..58b2d4f --- /dev/null +++ b/app/core/puc/languages/plugin-update-checker-es_UY.po @@ -0,0 +1,48 @@ +msgid "" +msgstr "" +"Project-Id-Version: plugin-update-checker\n" +"POT-Creation-Date: 2017-11-24 17:02+0200\n" +"PO-Revision-Date: 2020-03-21 15:15-0400\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.3\n" +"X-Poedit-Basepath: ..\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n" +"Last-Translator: \n" +"Language: es_ES\n" +"X-Poedit-SearchPath-0: .\n" + +#: Puc/v4p3/Plugin/UpdateChecker.php:395 +msgid "Check for updates" +msgstr "Comprobar si hay actualizaciones" + +#: Puc/v4p3/Plugin/UpdateChecker.php:548 +#, php-format +msgctxt "the plugin title" +msgid "The %s plugin is up to date." +msgstr "El plugin %s está actualizado." + +#: Puc/v4p3/Plugin/UpdateChecker.php:550 +#, php-format +msgctxt "the plugin title" +msgid "A new version of the %s plugin is available." +msgstr "Una nueva versión del %s plugin está disponible." + +#: Puc/v4p3/Plugin/UpdateChecker.php:552 +#, php-format +msgctxt "the plugin title" +msgid "Could not determine if updates are available for %s." +msgstr "No se pudo determinar si hay actualizaciones disponibles para %s." + +#: Puc/v4p3/Plugin/UpdateChecker.php:558 +#, php-format +msgid "Unknown update checker status \"%s\"" +msgstr "Estado del comprobador de actualización desconocido «%s»" + +#: Puc/v4p3/Vcs/PluginUpdateChecker.php:95 +msgid "There is no changelog available." +msgstr "No hay un registro de cambios disponible." diff --git a/app/core/puc/languages/plugin-update-checker-es_VE.mo b/app/core/puc/languages/plugin-update-checker-es_VE.mo new file mode 100755 index 0000000..9ce83f6 Binary files /dev/null and b/app/core/puc/languages/plugin-update-checker-es_VE.mo differ diff --git a/app/core/puc/languages/plugin-update-checker-es_VE.po b/app/core/puc/languages/plugin-update-checker-es_VE.po new file mode 100755 index 0000000..de33f8f --- /dev/null +++ b/app/core/puc/languages/plugin-update-checker-es_VE.po @@ -0,0 +1,48 @@ +msgid "" +msgstr "" +"Project-Id-Version: plugin-update-checker\n" +"POT-Creation-Date: 2017-11-24 17:02+0200\n" +"PO-Revision-Date: 2020-03-21 14:57-0400\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.3\n" +"X-Poedit-Basepath: ..\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n" +"Last-Translator: \n" +"Language: es_ES\n" +"X-Poedit-SearchPath-0: .\n" + +#: Puc/v4p3/Plugin/UpdateChecker.php:395 +msgid "Check for updates" +msgstr "Comprobar si hay actualizaciones" + +#: Puc/v4p3/Plugin/UpdateChecker.php:548 +#, php-format +msgctxt "the plugin title" +msgid "The %s plugin is up to date." +msgstr "El plugin %s está actualizado." + +#: Puc/v4p3/Plugin/UpdateChecker.php:550 +#, php-format +msgctxt "the plugin title" +msgid "A new version of the %s plugin is available." +msgstr "Una nueva versión del %s plugin está disponible." + +#: Puc/v4p3/Plugin/UpdateChecker.php:552 +#, php-format +msgctxt "the plugin title" +msgid "Could not determine if updates are available for %s." +msgstr "No se pudo determinar si hay actualizaciones disponibles para %s." + +#: Puc/v4p3/Plugin/UpdateChecker.php:558 +#, php-format +msgid "Unknown update checker status \"%s\"" +msgstr "Estado del comprobador de actualización desconocido «%s»" + +#: Puc/v4p3/Vcs/PluginUpdateChecker.php:95 +msgid "There is no changelog available." +msgstr "No hay un registro de cambios disponible." diff --git a/app/core/puc/languages/plugin-update-checker-fa_IR.mo b/app/core/puc/languages/plugin-update-checker-fa_IR.mo new file mode 100755 index 0000000..a68f100 Binary files /dev/null and b/app/core/puc/languages/plugin-update-checker-fa_IR.mo differ diff --git a/app/core/puc/languages/plugin-update-checker-fa_IR.po b/app/core/puc/languages/plugin-update-checker-fa_IR.po new file mode 100755 index 0000000..1181d51 --- /dev/null +++ b/app/core/puc/languages/plugin-update-checker-fa_IR.po @@ -0,0 +1,38 @@ +msgid "" +msgstr "" +"Project-Id-Version: plugin-update-checker\n" +"POT-Creation-Date: 2016-02-17 14:21+0100\n" +"PO-Revision-Date: 2016-10-28 14:30+0330\n" +"Last-Translator: studio RVOLA \n" +"Language-Team: Pro Style \n" +"Language: fa_IR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.8\n" +"X-Poedit-Basepath: ..\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e\n" +"X-Poedit-SearchPath-0: .\n" + +#: github-checker.php:120 +msgid "There is no changelog available." +msgstr "شرحی برای تغییرات یافت نشد" + +#: plugin-update-checker.php:637 +msgid "Check for updates" +msgstr "بررسی برای بروزرسانی " + +#: plugin-update-checker.php:681 +msgid "This plugin is up to date." +msgstr "شما از آخرین نسخه استفاده میکنید . به‌روز باشید" + +#: plugin-update-checker.php:683 +msgid "A new version of this plugin is available." +msgstr "نسخه جدیدی برای افزونه ارائه شده است ." + +#: plugin-update-checker.php:685 +#, php-format +msgid "Unknown update checker status \"%s\"" +msgstr "وضعیت ناشناخته برای بروزرسانی \"%s\"" diff --git a/app/core/puc/languages/plugin-update-checker-fr_CA.mo b/app/core/puc/languages/plugin-update-checker-fr_CA.mo new file mode 100755 index 0000000..24639b6 Binary files /dev/null and b/app/core/puc/languages/plugin-update-checker-fr_CA.mo differ diff --git a/app/core/puc/languages/plugin-update-checker-fr_CA.po b/app/core/puc/languages/plugin-update-checker-fr_CA.po new file mode 100755 index 0000000..6246227 --- /dev/null +++ b/app/core/puc/languages/plugin-update-checker-fr_CA.po @@ -0,0 +1,48 @@ +msgid "" +msgstr "" +"Project-Id-Version: plugin-update-checker\n" +"POT-Creation-Date: 2017-11-24 17:02+0200\n" +"PO-Revision-Date: 2018-02-12 10:32-0500\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.0.4\n" +"X-Poedit-Basepath: ..\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n" +"Last-Translator: Eric Gagnon \n" +"Language: fr_CA\n" +"X-Poedit-SearchPath-0: .\n" + +#: Puc/v4p3/Plugin/UpdateChecker.php:395 +msgid "Check for updates" +msgstr "Vérifier les mises à jour" + +#: Puc/v4p3/Plugin/UpdateChecker.php:548 +#, php-format +msgctxt "the plugin title" +msgid "The %s plugin is up to date." +msgstr "L’extension %s est à jour." + +#: Puc/v4p3/Plugin/UpdateChecker.php:550 +#, php-format +msgctxt "the plugin title" +msgid "A new version of the %s plugin is available." +msgstr "Une nouvelle version de l’extension %s est disponible." + +#: Puc/v4p3/Plugin/UpdateChecker.php:552 +#, php-format +msgctxt "the plugin title" +msgid "Could not determine if updates are available for %s." +msgstr "Impossible de déterminer si une mise à jour est disponible pour \"%s\"" + +#: Puc/v4p3/Plugin/UpdateChecker.php:558 +#, php-format +msgid "Unknown update checker status \"%s\"" +msgstr "Un problème inconnu est survenu \"%s\"" + +#: Puc/v4p3/Vcs/PluginUpdateChecker.php:95 +msgid "There is no changelog available." +msgstr "Il n’y a aucun journal de mise à jour disponible." diff --git a/app/core/puc/languages/plugin-update-checker-fr_FR.mo b/app/core/puc/languages/plugin-update-checker-fr_FR.mo new file mode 100755 index 0000000..a492d96 Binary files /dev/null and b/app/core/puc/languages/plugin-update-checker-fr_FR.mo differ diff --git a/app/core/puc/languages/plugin-update-checker-fr_FR.po b/app/core/puc/languages/plugin-update-checker-fr_FR.po new file mode 100755 index 0000000..0c32ebb --- /dev/null +++ b/app/core/puc/languages/plugin-update-checker-fr_FR.po @@ -0,0 +1,42 @@ +msgid "" +msgstr "" +"Project-Id-Version: plugin-update-checker\n" +"POT-Creation-Date: 2017-07-07 14:53+0200\n" +"PO-Revision-Date: 2017-07-07 14:54+0200\n" +"Language-Team: studio RVOLA \n" +"Language: fr_FR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.0.2\n" +"X-Poedit-Basepath: ..\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n" +"Last-Translator: Nicolas GEHIN\n" +"X-Poedit-SearchPath-0: .\n" + +#: Puc/v4p1/Plugin/UpdateChecker.php:358 +msgid "Check for updates" +msgstr "Vérifier les mises à jour" + +#: Puc/v4p1/Plugin/UpdateChecker.php:405 +#, php-format +msgctxt "the plugin title" +msgid "The %s plugin is up to date." +msgstr "L’extension %s est à jour." + +#: Puc/v4p1/Plugin/UpdateChecker.php:407 +#, php-format +msgctxt "the plugin title" +msgid "A new version of the %s plugin is available." +msgstr "Une nouvelle version de l’extension %s est disponible." + +#: Puc/v4p1/Plugin/UpdateChecker.php:409 +#, php-format +msgid "Unknown update checker status \"%s\"" +msgstr "Un problème inconnu est survenu \"%s\"" + +#: Puc/v4p1/Vcs/PluginUpdateChecker.php:85 +msgid "There is no changelog available." +msgstr "Il n’y a aucun journal de mise à jour disponible." diff --git a/app/core/puc/languages/plugin-update-checker-hu_HU.mo b/app/core/puc/languages/plugin-update-checker-hu_HU.mo new file mode 100755 index 0000000..4789ef1 Binary files /dev/null and b/app/core/puc/languages/plugin-update-checker-hu_HU.mo differ diff --git a/app/core/puc/languages/plugin-update-checker-hu_HU.po b/app/core/puc/languages/plugin-update-checker-hu_HU.po new file mode 100755 index 0000000..8a5d7bf --- /dev/null +++ b/app/core/puc/languages/plugin-update-checker-hu_HU.po @@ -0,0 +1,41 @@ +msgid "" +msgstr "" +"Project-Id-Version: plugin-update-checker\n" +"POT-Creation-Date: 2016-01-11 21:23+0100\n" +"PO-Revision-Date: 2016-01-11 21:25+0100\n" +"Last-Translator: Tamás András Horváth \n" +"Language-Team: \n" +"Language: hu_HU\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.6\n" +"X-Poedit-Basepath: ..\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e\n" +"X-Poedit-SearchPath-0: .\n" + +#: github-checker.php:137 +msgid "There is no changelog available." +msgstr "Nem érhető el a changelog." + +#: plugin-update-checker.php:852 +msgid "Check for updates" +msgstr "Frissítés ellenőrzése" + +#: plugin-update-checker.php:896 +msgid "This plugin is up to date." +msgstr "Ez a plugin naprakész." + +#: plugin-update-checker.php:898 +msgid "A new version of this plugin is available." +msgstr "Új verzió érhető el a kiegészítőhöz" + +#: plugin-update-checker.php:900 +#, php-format +msgid "Unknown update checker status \"%s\"" +msgstr "Ismeretlen a frissítés ellenőrző státusza \"%s\"" + +#~ msgid "Every %d hours" +#~ msgstr "Minden %d órában" diff --git a/app/core/puc/languages/plugin-update-checker-it_IT.mo b/app/core/puc/languages/plugin-update-checker-it_IT.mo new file mode 100755 index 0000000..6a2c57d Binary files /dev/null and b/app/core/puc/languages/plugin-update-checker-it_IT.mo differ diff --git a/app/core/puc/languages/plugin-update-checker-it_IT.po b/app/core/puc/languages/plugin-update-checker-it_IT.po new file mode 100755 index 0000000..206e0a0 --- /dev/null +++ b/app/core/puc/languages/plugin-update-checker-it_IT.po @@ -0,0 +1,38 @@ +msgid "" +msgstr "" +"Project-Id-Version: plugin-update-checker\n" +"POT-Creation-Date: 2016-06-29 20:21+0100\n" +"PO-Revision-Date: 2017-01-15 12:24+0100\n" +"Last-Translator: Igor Lückel \n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.5.5\n" +"X-Poedit-Basepath: ..\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e\n" +"Language: de_DE\n" +"X-Poedit-SearchPath-0: .\n" + +#: github-checker.php:137 +msgid "There is no changelog available." +msgstr "Non c'è alcuna sezione di aggiornamento disponibile" + +#: plugin-update-checker.php:852 +msgid "Check for updates" +msgstr "Verifica aggiornamenti" + +#: plugin-update-checker.php:896 +msgid "This plugin is up to date." +msgstr "Il plugin è aggiornato" + +#: plugin-update-checker.php:898 +msgid "A new version of this plugin is available." +msgstr "Una nuova versione del plugin è disponibile" + +#: plugin-update-checker.php:900 +#, php-format +msgid "Unknown update checker status \"%s\"" +msgstr "Si è verificato un problema sconosciuto \"%s\"" diff --git a/app/core/puc/languages/plugin-update-checker-ja.mo b/app/core/puc/languages/plugin-update-checker-ja.mo new file mode 100755 index 0000000..941b6ba Binary files /dev/null and b/app/core/puc/languages/plugin-update-checker-ja.mo differ diff --git a/app/core/puc/languages/plugin-update-checker-ja.po b/app/core/puc/languages/plugin-update-checker-ja.po new file mode 100755 index 0000000..3b1227f --- /dev/null +++ b/app/core/puc/languages/plugin-update-checker-ja.po @@ -0,0 +1,57 @@ +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: 2019-07-15 17:07+0900\n" +"PO-Revision-Date: 2019-07-15 17:12+0900\n" +"Last-Translator: tak \n" +"Language-Team: \n" +"Language: ja_JP\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.2.3\n" +"X-Poedit-Basepath: ../../../../../../Applications/XAMPP/xamppfiles/htdocs/" +"kisagai/wordpress/wp-content/plugins/simple-stripe-gateway/Puc\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Poedit-KeywordsList: __;_x:1,2c\n" +"X-Poedit-SearchPath-0: .\n" + +#: v4p7/Plugin/Ui.php:54 +msgid "View details" +msgstr "詳細を表示" + +#: v4p7/Plugin/Ui.php:77 +#, php-format +msgid "More information about %s" +msgstr "%sについての詳細" + +#: v4p7/Plugin/Ui.php:128 +msgid "Check for updates" +msgstr "アップデートを確認" + +#: v4p7/Plugin/Ui.php:213 +#, php-format +msgctxt "the plugin title" +msgid "The %s plugin is up to date." +msgstr "%s プラグインは、最新バージョンです。" + +#: v4p7/Plugin/Ui.php:215 +#, php-format +msgctxt "the plugin title" +msgid "A new version of the %s plugin is available." +msgstr "%s プラグインの最新バージョンがあります。" + +#: v4p7/Plugin/Ui.php:217 +#, php-format +msgctxt "the plugin title" +msgid "Could not determine if updates are available for %s." +msgstr "%s のアップデートがあるかどうかを判断できませんでした。" + +#: v4p7/Plugin/Ui.php:223 +#, php-format +msgid "Unknown update checker status \"%s\"" +msgstr "バージョンアップの確認で想定外の状態になりました。ステータス:”%s”" + +#: v4p7/Vcs/PluginUpdateChecker.php:98 +msgid "There is no changelog available." +msgstr "更新履歴はありません。" diff --git a/app/core/puc/languages/plugin-update-checker-nl_BE.mo b/app/core/puc/languages/plugin-update-checker-nl_BE.mo new file mode 100755 index 0000000..1cea26d Binary files /dev/null and b/app/core/puc/languages/plugin-update-checker-nl_BE.mo differ diff --git a/app/core/puc/languages/plugin-update-checker-nl_BE.po b/app/core/puc/languages/plugin-update-checker-nl_BE.po new file mode 100755 index 0000000..c31db98 --- /dev/null +++ b/app/core/puc/languages/plugin-update-checker-nl_BE.po @@ -0,0 +1,48 @@ +msgid "" +msgstr "" +"Project-Id-Version: plugin-update-checker\n" +"POT-Creation-Date: 2018-03-25 18:15+0200\n" +"PO-Revision-Date: 2018-03-25 18:32+0200\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.7.1\n" +"X-Poedit-Basepath: ..\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n" +"Last-Translator: Frank Goossens \n" +"Language: nl_BE\n" +"X-Poedit-SearchPath-0: .\n" + +#: Puc/v4p3/Plugin/UpdateChecker.php:395 +msgid "Check for updates" +msgstr "Controleer op nieuwe versies" + +#: Puc/v4p3/Plugin/UpdateChecker.php:548 +#, php-format +msgctxt "the plugin title" +msgid "The %s plugin is up to date." +msgstr "De meest recente %s versie is geïnstalleerd." + +#: Puc/v4p3/Plugin/UpdateChecker.php:550 +#, php-format +msgctxt "the plugin title" +msgid "A new version of the %s plugin is available." +msgstr "Er is een nieuwe versie van %s beschikbaar." + +#: Puc/v4p3/Plugin/UpdateChecker.php:552 +#, php-format +msgctxt "the plugin title" +msgid "Could not determine if updates are available for %s." +msgstr "Kon niet bepalen of er nieuwe versie van %s beschikbaar is." + +#: Puc/v4p3/Plugin/UpdateChecker.php:558 +#, php-format +msgid "Unknown update checker status \"%s\"" +msgstr "Ongekende status bij controle op nieuwe versie: \"%s\"" + +#: Puc/v4p3/Vcs/PluginUpdateChecker.php:95 +msgid "There is no changelog available." +msgstr "Er is geen changelog beschikbaar." diff --git a/app/core/puc/languages/plugin-update-checker-nl_NL.mo b/app/core/puc/languages/plugin-update-checker-nl_NL.mo new file mode 100755 index 0000000..16dde62 Binary files /dev/null and b/app/core/puc/languages/plugin-update-checker-nl_NL.mo differ diff --git a/app/core/puc/languages/plugin-update-checker-nl_NL.po b/app/core/puc/languages/plugin-update-checker-nl_NL.po new file mode 100755 index 0000000..114cce9 --- /dev/null +++ b/app/core/puc/languages/plugin-update-checker-nl_NL.po @@ -0,0 +1,48 @@ +msgid "" +msgstr "" +"Project-Id-Version: plugin-update-checker\n" +"POT-Creation-Date: 2018-03-25 18:15+0200\n" +"PO-Revision-Date: 2018-03-25 18:32+0200\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.7.1\n" +"X-Poedit-Basepath: ..\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n" +"Last-Translator: Frank Goossens \n" +"Language: nl_NL\n" +"X-Poedit-SearchPath-0: .\n" + +#: Puc/v4p3/Plugin/UpdateChecker.php:395 +msgid "Check for updates" +msgstr "Controleer op nieuwe versies" + +#: Puc/v4p3/Plugin/UpdateChecker.php:548 +#, php-format +msgctxt "the plugin title" +msgid "The %s plugin is up to date." +msgstr "De meest recente %s versie is geïnstalleerd." + +#: Puc/v4p3/Plugin/UpdateChecker.php:550 +#, php-format +msgctxt "the plugin title" +msgid "A new version of the %s plugin is available." +msgstr "Er is een nieuwe versie van %s beschikbaar." + +#: Puc/v4p3/Plugin/UpdateChecker.php:552 +#, php-format +msgctxt "the plugin title" +msgid "Could not determine if updates are available for %s." +msgstr "Kon niet bepalen of er nieuwe versie van %s beschikbaar is." + +#: Puc/v4p3/Plugin/UpdateChecker.php:558 +#, php-format +msgid "Unknown update checker status \"%s\"" +msgstr "Ongekende status bij controle op nieuwe versie: \"%s\"" + +#: Puc/v4p3/Vcs/PluginUpdateChecker.php:95 +msgid "There is no changelog available." +msgstr "Er is geen changelog beschikbaar." diff --git a/app/core/puc/languages/plugin-update-checker-pt_BR.mo b/app/core/puc/languages/plugin-update-checker-pt_BR.mo new file mode 100755 index 0000000..d1c0f28 Binary files /dev/null and b/app/core/puc/languages/plugin-update-checker-pt_BR.mo differ diff --git a/app/core/puc/languages/plugin-update-checker-pt_BR.po b/app/core/puc/languages/plugin-update-checker-pt_BR.po new file mode 100755 index 0000000..ff0f132 --- /dev/null +++ b/app/core/puc/languages/plugin-update-checker-pt_BR.po @@ -0,0 +1,48 @@ +msgid "" +msgstr "" +"Project-Id-Version: plugin-update-checker\n" +"POT-Creation-Date: 2017-05-19 15:41-0300\n" +"PO-Revision-Date: 2017-05-19 15:42-0300\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: pt_BR\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 1.8.8\n" +"X-Poedit-Basepath: ..\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_x;_x:1,2c\n" +"X-Poedit-SearchPath-0: .\n" + +#: Puc/v4p1/Plugin/UpdateChecker.php:358 +msgid "Check for updates" +msgstr "Verificar Atualizações" + +#: Puc/v4p1/Plugin/UpdateChecker.php:401 Puc/v4p1/Plugin/UpdateChecker.php:406 +#, php-format +msgctxt "the plugin title" +msgid "The %s plugin is up to date." +msgstr "O plugin %s já está na sua versão mais recente." + +#: Puc/v4p1/Plugin/UpdateChecker.php:408 +#, php-format +msgctxt "the plugin title" +msgid "A new version of the %s plugin is available." +msgstr "Há uma nova versão para o plugin %s disponível para download." + +#: Puc/v4p1/Plugin/UpdateChecker.php:410 +#, php-format +msgid "Unknown update checker status \"%s\"" +msgstr "Status \"%s\" desconhecido." + +#: Puc/v4p1/Vcs/PluginUpdateChecker.php:83 +msgid "There is no changelog available." +msgstr "Não há um changelog disponível." + +#~ msgid "The %s plugin is up to date." +#~ msgstr "O plugin %s já está na sua versão mais recente." + +#~ msgid "A new version of the %s plugin is available." +#~ msgstr "Há uma nova versão para o plugin %s disponível para download." diff --git a/app/core/puc/languages/plugin-update-checker-ru_RU.mo b/app/core/puc/languages/plugin-update-checker-ru_RU.mo new file mode 100755 index 0000000..50b330e Binary files /dev/null and b/app/core/puc/languages/plugin-update-checker-ru_RU.mo differ diff --git a/app/core/puc/languages/plugin-update-checker-ru_RU.po b/app/core/puc/languages/plugin-update-checker-ru_RU.po new file mode 100755 index 0000000..28917db --- /dev/null +++ b/app/core/puc/languages/plugin-update-checker-ru_RU.po @@ -0,0 +1,48 @@ +msgid "" +msgstr "" +"Project-Id-Version: plugin-update-checker\n" +"POT-Creation-Date: 2020-08-08 14:36+0300\n" +"PO-Revision-Date: 2021-12-20 17:59+0200\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.2\n" +"X-Poedit-Basepath: ..\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n" +"Last-Translator: \n" +"Language: ru_RU\n" +"X-Poedit-SearchPath-0: .\n" + +#: Puc/v4p11/Plugin/Ui.php:128 +msgid "Check for updates" +msgstr "Проверить обновления" + +#: Puc/v4p11/Plugin/Ui.php:213 +#, php-format +msgctxt "the plugin title" +msgid "The %s plugin is up to date." +msgstr "Плагин %s обновлён." + +#: Puc/v4p11/Plugin/Ui.php:215 +#, php-format +msgctxt "the plugin title" +msgid "A new version of the %s plugin is available." +msgstr "Новая версия %s доступна." + +#: Puc/v4p11/Plugin/Ui.php:217 +#, php-format +msgctxt "the plugin title" +msgid "Could not determine if updates are available for %s." +msgstr "Не удалось определить, доступны ли обновления для %s." + +#: Puc/v4p11/Plugin/Ui.php:223 +#, php-format +msgid "Unknown update checker status \"%s\"" +msgstr "Неизвестный статус средства проверки обновлений \"%s\"" + +#: Puc/v4p11/Vcs/PluginUpdateChecker.php:98 +msgid "There is no changelog available." +msgstr "Журнал изменений отсутствует." diff --git a/app/core/puc/languages/plugin-update-checker-sl_SI.mo b/app/core/puc/languages/plugin-update-checker-sl_SI.mo new file mode 100755 index 0000000..df47ca7 Binary files /dev/null and b/app/core/puc/languages/plugin-update-checker-sl_SI.mo differ diff --git a/app/core/puc/languages/plugin-update-checker-sl_SI.po b/app/core/puc/languages/plugin-update-checker-sl_SI.po new file mode 100755 index 0000000..ca9f89e --- /dev/null +++ b/app/core/puc/languages/plugin-update-checker-sl_SI.po @@ -0,0 +1,48 @@ +msgid "" +msgstr "" +"Project-Id-Version: plugin-update-checker\n" +"POT-Creation-Date: 2017-11-24 17:02+0200\n" +"PO-Revision-Date: 2018-10-27 20:36+0200\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.2\n" +"X-Poedit-Basepath: ..\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100>=3 && n%100<=4 ? 2 : 3);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n" +"Last-Translator: Igor Funa\n" +"Language: sl_SI\n" +"X-Poedit-SearchPath-0: .\n" + +#: Puc/v4p3/Plugin/UpdateChecker.php:395 +msgid "Check for updates" +msgstr "Preveri posodobitve" + +#: Puc/v4p3/Plugin/UpdateChecker.php:548 +#, php-format +msgctxt "the plugin title" +msgid "The %s plugin is up to date." +msgstr "Vtičnik %s je že posodobljen." + +#: Puc/v4p3/Plugin/UpdateChecker.php:550 +#, php-format +msgctxt "the plugin title" +msgid "A new version of the %s plugin is available." +msgstr "Nova različica vtičnika %s je na razpolago." + +#: Puc/v4p3/Plugin/UpdateChecker.php:552 +#, php-format +msgctxt "the plugin title" +msgid "Could not determine if updates are available for %s." +msgstr "Ne morem ugotoviti če se za vtičnik %s na razpolago posodobitve." + +#: Puc/v4p3/Plugin/UpdateChecker.php:558 +#, php-format +msgid "Unknown update checker status \"%s\"" +msgstr "Neznan status preverjanja posodobitev za \"%s\"" + +#: Puc/v4p3/Vcs/PluginUpdateChecker.php:95 +msgid "There is no changelog available." +msgstr "Dnevnik sprememb ni na razpolago." diff --git a/app/core/puc/languages/plugin-update-checker-sv_SE.mo b/app/core/puc/languages/plugin-update-checker-sv_SE.mo new file mode 100755 index 0000000..4d06fc1 Binary files /dev/null and b/app/core/puc/languages/plugin-update-checker-sv_SE.mo differ diff --git a/app/core/puc/languages/plugin-update-checker-sv_SE.po b/app/core/puc/languages/plugin-update-checker-sv_SE.po new file mode 100755 index 0000000..0c9a4fd --- /dev/null +++ b/app/core/puc/languages/plugin-update-checker-sv_SE.po @@ -0,0 +1,42 @@ +msgid "" +msgstr "" +"Project-Id-Version: plugin-update-checker\n" +"POT-Creation-Date: 2017-05-20 10:53+0300\n" +"PO-Revision-Date: 2017-10-16 15:02+0200\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.0.4\n" +"X-Poedit-Basepath: ..\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n" +"Last-Translator: \n" +"Language: sv_SE\n" +"X-Poedit-SearchPath-0: .\n" + +#: Puc/v4p1/Plugin/UpdateChecker.php:358 +msgid "Check for updates" +msgstr "Sök efter uppdateringar" + +#: Puc/v4p1/Plugin/UpdateChecker.php:405 +#, php-format +msgctxt "the plugin title" +msgid "The %s plugin is up to date." +msgstr "Tillägget %s är uppdaterat." + +#: Puc/v4p1/Plugin/UpdateChecker.php:407 +#, php-format +msgctxt "the plugin title" +msgid "A new version of the %s plugin is available." +msgstr "Det finns en ny version av tillägget %s." + +#: Puc/v4p1/Plugin/UpdateChecker.php:409 +#, php-format +msgid "Unknown update checker status \"%s\"" +msgstr "Okänd status för kontroll av uppdatering “%s”" + +#: Puc/v4p1/Vcs/PluginUpdateChecker.php:83 +msgid "There is no changelog available." +msgstr "Det finns ingen ändringslogg tillgänglig." diff --git a/app/core/puc/languages/plugin-update-checker-tr_TR.mo b/app/core/puc/languages/plugin-update-checker-tr_TR.mo new file mode 100755 index 0000000..58be2f9 Binary files /dev/null and b/app/core/puc/languages/plugin-update-checker-tr_TR.mo differ diff --git a/app/core/puc/languages/plugin-update-checker-tr_TR.po b/app/core/puc/languages/plugin-update-checker-tr_TR.po new file mode 100755 index 0000000..03c4c73 --- /dev/null +++ b/app/core/puc/languages/plugin-update-checker-tr_TR.po @@ -0,0 +1,48 @@ +msgid "" +msgstr "" +"Project-Id-Version: plugin-update-checker\n" +"POT-Creation-Date: 2017-11-24 17:02+0200\n" +"PO-Revision-Date: 2021-11-15 19:07+0300\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 3.0\n" +"X-Poedit-Basepath: ..\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n" +"Last-Translator: Emre Erkan \n" +"Language: tr\n" +"X-Poedit-SearchPath-0: .\n" + +#: Puc/v4p3/Plugin/UpdateChecker.php:395 +msgid "Check for updates" +msgstr "Güncellemeleri kontrol et" + +#: Puc/v4p3/Plugin/UpdateChecker.php:548 +#, php-format +msgctxt "the plugin title" +msgid "The %s plugin is up to date." +msgstr "%s eklentisi güncel." + +#: Puc/v4p3/Plugin/UpdateChecker.php:550 +#, php-format +msgctxt "the plugin title" +msgid "A new version of the %s plugin is available." +msgstr "%s eklentisinin yeni bir sürümü mevcut." + +#: Puc/v4p3/Plugin/UpdateChecker.php:552 +#, php-format +msgctxt "the plugin title" +msgid "Could not determine if updates are available for %s." +msgstr "%s için güncelleme olup olmadığı belirlenemedi." + +#: Puc/v4p3/Plugin/UpdateChecker.php:558 +#, php-format +msgid "Unknown update checker status \"%s\"" +msgstr "Bilinmeyen güncelleme denetleyicisi durumu \"%s\"" + +#: Puc/v4p3/Vcs/PluginUpdateChecker.php:95 +msgid "There is no changelog available." +msgstr "Kullanılabilir bir değişiklik yok." diff --git a/app/core/puc/languages/plugin-update-checker-uk_UA.mo b/app/core/puc/languages/plugin-update-checker-uk_UA.mo new file mode 100755 index 0000000..79494e5 Binary files /dev/null and b/app/core/puc/languages/plugin-update-checker-uk_UA.mo differ diff --git a/app/core/puc/languages/plugin-update-checker-uk_UA.po b/app/core/puc/languages/plugin-update-checker-uk_UA.po new file mode 100755 index 0000000..f2821f8 --- /dev/null +++ b/app/core/puc/languages/plugin-update-checker-uk_UA.po @@ -0,0 +1,48 @@ +msgid "" +msgstr "" +"Project-Id-Version: plugin-update-checker\n" +"POT-Creation-Date: 2020-08-08 14:36+0300\n" +"PO-Revision-Date: 2021-12-20 17:55+0200\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.2\n" +"X-Poedit-Basepath: ..\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n" +"Last-Translator: \n" +"Language: uk_UA\n" +"X-Poedit-SearchPath-0: .\n" + +#: Puc/v4p11/Plugin/Ui.php:128 +msgid "Check for updates" +msgstr "Перевірити оновлення" + +#: Puc/v4p11/Plugin/Ui.php:213 +#, php-format +msgctxt "the plugin title" +msgid "The %s plugin is up to date." +msgstr "Плагін %s оновлено." + +#: Puc/v4p11/Plugin/Ui.php:215 +#, php-format +msgctxt "the plugin title" +msgid "A new version of the %s plugin is available." +msgstr "Нова версія %s доступна." + +#: Puc/v4p11/Plugin/Ui.php:217 +#, php-format +msgctxt "the plugin title" +msgid "Could not determine if updates are available for %s." +msgstr "Не вдалося визначити, чи доступні оновлення для %s." + +#: Puc/v4p11/Plugin/Ui.php:223 +#, php-format +msgid "Unknown update checker status \"%s\"" +msgstr "Невідомий статус перевірки оновлень \"%s\"" + +#: Puc/v4p11/Vcs/PluginUpdateChecker.php:98 +msgid "There is no changelog available." +msgstr "Немає доступного журналу змін." diff --git a/app/core/puc/languages/plugin-update-checker-zh_CN.mo b/app/core/puc/languages/plugin-update-checker-zh_CN.mo new file mode 100755 index 0000000..c0fc405 Binary files /dev/null and b/app/core/puc/languages/plugin-update-checker-zh_CN.mo differ diff --git a/app/core/puc/languages/plugin-update-checker-zh_CN.po b/app/core/puc/languages/plugin-update-checker-zh_CN.po new file mode 100755 index 0000000..b82d831 --- /dev/null +++ b/app/core/puc/languages/plugin-update-checker-zh_CN.po @@ -0,0 +1,48 @@ +msgid "" +msgstr "" +"Project-Id-Version: plugin-update-checker\n" +"POT-Creation-Date: 2017-11-24 17:02+0200\n" +"PO-Revision-Date: 2020-08-04 08:10+0800\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.4\n" +"X-Poedit-Basepath: ..\n" +"Plural-Forms: nplurals=1; plural=0;\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n" +"Last-Translator: Seaton Jiang \n" +"Language: zh_CN\n" +"X-Poedit-SearchPath-0: .\n" + +#: Puc/v4p3/Plugin/UpdateChecker.php:395 +msgid "Check for updates" +msgstr "检查更新" + +#: Puc/v4p3/Plugin/UpdateChecker.php:548 +#, php-format +msgctxt "the plugin title" +msgid "The %s plugin is up to date." +msgstr "%s 目前是最新版本。" + +#: Puc/v4p3/Plugin/UpdateChecker.php:550 +#, php-format +msgctxt "the plugin title" +msgid "A new version of the %s plugin is available." +msgstr "%s 当前有可用的更新。" + +#: Puc/v4p3/Plugin/UpdateChecker.php:552 +#, php-format +msgctxt "the plugin title" +msgid "Could not determine if updates are available for %s." +msgstr "%s 无法确定是否有可用的更新。" + +#: Puc/v4p3/Plugin/UpdateChecker.php:558 +#, php-format +msgid "Unknown update checker status \"%s\"" +msgstr "未知的更新检查状态:%s" + +#: Puc/v4p3/Vcs/PluginUpdateChecker.php:95 +msgid "There is no changelog available." +msgstr "没有可用的更新日志。" diff --git a/app/core/puc/languages/plugin-update-checker.pot b/app/core/puc/languages/plugin-update-checker.pot new file mode 100755 index 0000000..a594c79 --- /dev/null +++ b/app/core/puc/languages/plugin-update-checker.pot @@ -0,0 +1,49 @@ +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: plugin-update-checker\n" +"POT-Creation-Date: 2020-08-08 14:36+0300\n" +"PO-Revision-Date: 2016-01-10 20:59+0100\n" +"Last-Translator: Tamás András Horváth \n" +"Language-Team: \n" +"Language: en_US\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.4\n" +"X-Poedit-Basepath: ..\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Poedit-SourceCharset: UTF-8\n" +"X-Poedit-KeywordsList: __;_e;_x:1,2c;_x\n" +"X-Poedit-SearchPath-0: .\n" + +#: Puc/v4p11/Plugin/Ui.php:128 +msgid "Check for updates" +msgstr "" + +#: Puc/v4p11/Plugin/Ui.php:213 +#, php-format +msgctxt "the plugin title" +msgid "The %s plugin is up to date." +msgstr "" + +#: Puc/v4p11/Plugin/Ui.php:215 +#, php-format +msgctxt "the plugin title" +msgid "A new version of the %s plugin is available." +msgstr "" + +#: Puc/v4p11/Plugin/Ui.php:217 +#, php-format +msgctxt "the plugin title" +msgid "Could not determine if updates are available for %s." +msgstr "" + +#: Puc/v4p11/Plugin/Ui.php:223 +#, php-format +msgid "Unknown update checker status \"%s\"" +msgstr "" + +#: Puc/v4p11/Vcs/PluginUpdateChecker.php:98 +msgid "There is no changelog available." +msgstr "" diff --git a/app/core/puc/license.txt b/app/core/puc/license.txt new file mode 100755 index 0000000..b194df8 --- /dev/null +++ b/app/core/puc/license.txt @@ -0,0 +1,7 @@ +Copyright (c) 2017 Jānis Elsts + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/app/core/puc/load-v4p11.php b/app/core/puc/load-v4p11.php new file mode 100755 index 0000000..6478b13 --- /dev/null +++ b/app/core/puc/load-v4p11.php @@ -0,0 +1,28 @@ + 'Puc_v4p11_Plugin_UpdateChecker', + 'Theme_UpdateChecker' => 'Puc_v4p11_Theme_UpdateChecker', + + 'Vcs_PluginUpdateChecker' => 'Puc_v4p11_Vcs_PluginUpdateChecker', + 'Vcs_ThemeUpdateChecker' => 'Puc_v4p11_Vcs_ThemeUpdateChecker', + + 'GitHubApi' => 'Puc_v4p11_Vcs_GitHubApi', + 'BitBucketApi' => 'Puc_v4p11_Vcs_BitBucketApi', + 'GitLabApi' => 'Puc_v4p11_Vcs_GitLabApi', + ) + as $pucGeneralClass => $pucVersionedClass +) { + Puc_v4_Factory::addVersion($pucGeneralClass, $pucVersionedClass, '4.11'); + //Also add it to the minor-version factory in case the major-version factory + //was already defined by another, older version of the update checker. + Puc_v4p11_Factory::addVersion($pucGeneralClass, $pucVersionedClass, '4.11'); +} + diff --git a/app/core/puc/plugin-update-checker.php b/app/core/puc/plugin-update-checker.php new file mode 100755 index 0000000..ad60818 --- /dev/null +++ b/app/core/puc/plugin-update-checker.php @@ -0,0 +1,10 @@ +=') ) { + require __DIR__ . '/ParsedownModern.php'; + } else { + require __DIR__ . '/ParsedownLegacy.php'; + } +} diff --git a/app/core/puc/vendor/ParsedownLegacy.php b/app/core/puc/vendor/ParsedownLegacy.php new file mode 100755 index 0000000..3ecd1f5 --- /dev/null +++ b/app/core/puc/vendor/ParsedownLegacy.php @@ -0,0 +1,1535 @@ +DefinitionData = []; + + # standardize line breaks + $text = str_replace(array("\r\n", "\r"), "\n", $text); + + # remove surrounding line breaks + $text = trim($text, "\n"); + + # split text into lines + $lines = explode("\n", $text); + + # iterate through lines to identify blocks + $markup = $this->lines($lines); + + # trim line breaks + $markup = trim($markup, "\n"); + + return $markup; + } + + # + # Setters + # + + function setBreaksEnabled($breaksEnabled) + { + $this->breaksEnabled = $breaksEnabled; + + return $this; + } + + protected $breaksEnabled; + + function setMarkupEscaped($markupEscaped) + { + $this->markupEscaped = $markupEscaped; + + return $this; + } + + protected $markupEscaped; + + function setUrlsLinked($urlsLinked) + { + $this->urlsLinked = $urlsLinked; + + return $this; + } + + protected $urlsLinked = true; + + # + # Lines + # + + protected $BlockTypes = array( + '#' => array('Header'), + '*' => array('Rule', 'List'), + '+' => array('List'), + '-' => array('SetextHeader', 'Table', 'Rule', 'List'), + '0' => array('List'), + '1' => array('List'), + '2' => array('List'), + '3' => array('List'), + '4' => array('List'), + '5' => array('List'), + '6' => array('List'), + '7' => array('List'), + '8' => array('List'), + '9' => array('List'), + ':' => array('Table'), + '<' => array('Comment', 'Markup'), + '=' => array('SetextHeader'), + '>' => array('Quote'), + '[' => array('Reference'), + '_' => array('Rule'), + '`' => array('FencedCode'), + '|' => array('Table'), + '~' => array('FencedCode'), + ); + + # ~ + + protected $DefinitionTypes = array( + '[' => array('Reference'), + ); + + # ~ + + protected $unmarkedBlockTypes = array( + 'Code', + ); + + # + # Blocks + # + + private function lines(array $lines) + { + $CurrentBlock = null; + + foreach ($lines as $line) + { + if (chop($line) === '') + { + if (isset($CurrentBlock)) + { + $CurrentBlock['interrupted'] = true; + } + + continue; + } + + if (strpos($line, "\t") !== false) + { + $parts = explode("\t", $line); + + $line = $parts[0]; + + unset($parts[0]); + + foreach ($parts as $part) + { + $shortage = 4 - mb_strlen($line, 'utf-8') % 4; + + $line .= str_repeat(' ', $shortage); + $line .= $part; + } + } + + $indent = 0; + + while (isset($line[$indent]) and $line[$indent] === ' ') + { + $indent ++; + } + + $text = $indent > 0 ? substr($line, $indent) : $line; + + # ~ + + $Line = array('body' => $line, 'indent' => $indent, 'text' => $text); + + # ~ + + if (isset($CurrentBlock['incomplete'])) + { + $Block = $this->{'block'.$CurrentBlock['type'].'Continue'}($Line, $CurrentBlock); + + if (isset($Block)) + { + $CurrentBlock = $Block; + + continue; + } + else + { + if (method_exists($this, 'block'.$CurrentBlock['type'].'Complete')) + { + $CurrentBlock = $this->{'block'.$CurrentBlock['type'].'Complete'}($CurrentBlock); + } + + unset($CurrentBlock['incomplete']); + } + } + + # ~ + + $marker = $text[0]; + + # ~ + + $blockTypes = $this->unmarkedBlockTypes; + + if (isset($this->BlockTypes[$marker])) + { + foreach ($this->BlockTypes[$marker] as $blockType) + { + $blockTypes []= $blockType; + } + } + + # + # ~ + + foreach ($blockTypes as $blockType) + { + $Block = $this->{'block'.$blockType}($Line, $CurrentBlock); + + if (isset($Block)) + { + $Block['type'] = $blockType; + + if ( ! isset($Block['identified'])) + { + $Blocks []= $CurrentBlock; + + $Block['identified'] = true; + } + + if (method_exists($this, 'block'.$blockType.'Continue')) + { + $Block['incomplete'] = true; + } + + $CurrentBlock = $Block; + + continue 2; + } + } + + # ~ + + if (isset($CurrentBlock) and ! isset($CurrentBlock['type']) and ! isset($CurrentBlock['interrupted'])) + { + $CurrentBlock['element']['text'] .= "\n".$text; + } + else + { + $Blocks []= $CurrentBlock; + + $CurrentBlock = $this->paragraph($Line); + + $CurrentBlock['identified'] = true; + } + } + + # ~ + + if (isset($CurrentBlock['incomplete']) and method_exists($this, 'block'.$CurrentBlock['type'].'Complete')) + { + $CurrentBlock = $this->{'block'.$CurrentBlock['type'].'Complete'}($CurrentBlock); + } + + # ~ + + $Blocks []= $CurrentBlock; + + unset($Blocks[0]); + + # ~ + + $markup = ''; + + foreach ($Blocks as $Block) + { + if (isset($Block['hidden'])) + { + continue; + } + + $markup .= "\n"; + $markup .= isset($Block['markup']) ? $Block['markup'] : $this->element($Block['element']); + } + + $markup .= "\n"; + + # ~ + + return $markup; + } + + # + # Code + + protected function blockCode($Line, $Block = null) + { + if (isset($Block) and ! isset($Block['type']) and ! isset($Block['interrupted'])) + { + return; + } + + if ($Line['indent'] >= 4) + { + $text = substr($Line['body'], 4); + + $Block = array( + 'element' => array( + 'name' => 'pre', + 'handler' => 'element', + 'text' => array( + 'name' => 'code', + 'text' => $text, + ), + ), + ); + + return $Block; + } + } + + protected function blockCodeContinue($Line, $Block) + { + if ($Line['indent'] >= 4) + { + if (isset($Block['interrupted'])) + { + $Block['element']['text']['text'] .= "\n"; + + unset($Block['interrupted']); + } + + $Block['element']['text']['text'] .= "\n"; + + $text = substr($Line['body'], 4); + + $Block['element']['text']['text'] .= $text; + + return $Block; + } + } + + protected function blockCodeComplete($Block) + { + $text = $Block['element']['text']['text']; + + $text = htmlspecialchars($text, ENT_NOQUOTES, 'UTF-8'); + + $Block['element']['text']['text'] = $text; + + return $Block; + } + + # + # Comment + + protected function blockComment($Line) + { + if ($this->markupEscaped) + { + return; + } + + if (isset($Line['text'][3]) and $Line['text'][3] === '-' and $Line['text'][2] === '-' and $Line['text'][1] === '!') + { + $Block = array( + 'markup' => $Line['body'], + ); + + if (preg_match('/-->$/', $Line['text'])) + { + $Block['closed'] = true; + } + + return $Block; + } + } + + protected function blockCommentContinue($Line, array $Block) + { + if (isset($Block['closed'])) + { + return; + } + + $Block['markup'] .= "\n" . $Line['body']; + + if (preg_match('/-->$/', $Line['text'])) + { + $Block['closed'] = true; + } + + return $Block; + } + + # + # Fenced Code + + protected function blockFencedCode($Line) + { + if (preg_match('/^(['.$Line['text'][0].']{3,})[ ]*([\w-]+)?[ ]*$/', $Line['text'], $matches)) + { + $Element = array( + 'name' => 'code', + 'text' => '', + ); + + if (isset($matches[2])) + { + $class = 'language-'.$matches[2]; + + $Element['attributes'] = array( + 'class' => $class, + ); + } + + $Block = array( + 'char' => $Line['text'][0], + 'element' => array( + 'name' => 'pre', + 'handler' => 'element', + 'text' => $Element, + ), + ); + + return $Block; + } + } + + protected function blockFencedCodeContinue($Line, $Block) + { + if (isset($Block['complete'])) + { + return; + } + + if (isset($Block['interrupted'])) + { + $Block['element']['text']['text'] .= "\n"; + + unset($Block['interrupted']); + } + + if (preg_match('/^'.$Block['char'].'{3,}[ ]*$/', $Line['text'])) + { + $Block['element']['text']['text'] = substr($Block['element']['text']['text'], 1); + + $Block['complete'] = true; + + return $Block; + } + + $Block['element']['text']['text'] .= "\n".$Line['body'];; + + return $Block; + } + + protected function blockFencedCodeComplete($Block) + { + $text = $Block['element']['text']['text']; + + $text = htmlspecialchars($text, ENT_NOQUOTES, 'UTF-8'); + + $Block['element']['text']['text'] = $text; + + return $Block; + } + + # + # Header + + protected function blockHeader($Line) + { + if (isset($Line['text'][1])) + { + $level = 1; + + while (isset($Line['text'][$level]) and $Line['text'][$level] === '#') + { + $level ++; + } + + if ($level > 6) + { + return; + } + + $text = trim($Line['text'], '# '); + + $Block = array( + 'element' => array( + 'name' => 'h' . min(6, $level), + 'text' => $text, + 'handler' => 'line', + ), + ); + + return $Block; + } + } + + # + # List + + protected function blockList($Line) + { + list($name, $pattern) = $Line['text'][0] <= '-' ? array('ul', '[*+-]') : array('ol', '[0-9]+[.]'); + + if (preg_match('/^('.$pattern.'[ ]+)(.*)/', $Line['text'], $matches)) + { + $Block = array( + 'indent' => $Line['indent'], + 'pattern' => $pattern, + 'element' => array( + 'name' => $name, + 'handler' => 'elements', + ), + ); + + $Block['li'] = array( + 'name' => 'li', + 'handler' => 'li', + 'text' => array( + $matches[2], + ), + ); + + $Block['element']['text'] []= & $Block['li']; + + return $Block; + } + } + + protected function blockListContinue($Line, array $Block) + { + if ($Block['indent'] === $Line['indent'] and preg_match('/^'.$Block['pattern'].'(?:[ ]+(.*)|$)/', $Line['text'], $matches)) + { + if (isset($Block['interrupted'])) + { + $Block['li']['text'] []= ''; + + unset($Block['interrupted']); + } + + unset($Block['li']); + + $text = isset($matches[1]) ? $matches[1] : ''; + + $Block['li'] = array( + 'name' => 'li', + 'handler' => 'li', + 'text' => array( + $text, + ), + ); + + $Block['element']['text'] []= & $Block['li']; + + return $Block; + } + + if ($Line['text'][0] === '[' and $this->blockReference($Line)) + { + return $Block; + } + + if ( ! isset($Block['interrupted'])) + { + $text = preg_replace('/^[ ]{0,4}/', '', $Line['body']); + + $Block['li']['text'] []= $text; + + return $Block; + } + + if ($Line['indent'] > 0) + { + $Block['li']['text'] []= ''; + + $text = preg_replace('/^[ ]{0,4}/', '', $Line['body']); + + $Block['li']['text'] []= $text; + + unset($Block['interrupted']); + + return $Block; + } + } + + # + # Quote + + protected function blockQuote($Line) + { + if (preg_match('/^>[ ]?(.*)/', $Line['text'], $matches)) + { + $Block = array( + 'element' => array( + 'name' => 'blockquote', + 'handler' => 'lines', + 'text' => (array) $matches[1], + ), + ); + + return $Block; + } + } + + protected function blockQuoteContinue($Line, array $Block) + { + if ($Line['text'][0] === '>' and preg_match('/^>[ ]?(.*)/', $Line['text'], $matches)) + { + if (isset($Block['interrupted'])) + { + $Block['element']['text'] []= ''; + + unset($Block['interrupted']); + } + + $Block['element']['text'] []= $matches[1]; + + return $Block; + } + + if ( ! isset($Block['interrupted'])) + { + $Block['element']['text'] []= $Line['text']; + + return $Block; + } + } + + # + # Rule + + protected function blockRule($Line) + { + if (preg_match('/^(['.$Line['text'][0].'])([ ]*\1){2,}[ ]*$/', $Line['text'])) + { + $Block = array( + 'element' => array( + 'name' => 'hr' + ), + ); + + return $Block; + } + } + + # + # Setext + + protected function blockSetextHeader($Line, array $Block = null) + { + if ( ! isset($Block) or isset($Block['type']) or isset($Block['interrupted'])) + { + return; + } + + if (chop($Line['text'], $Line['text'][0]) === '') + { + $Block['element']['name'] = $Line['text'][0] === '=' ? 'h1' : 'h2'; + + return $Block; + } + } + + # + # Markup + + protected function blockMarkup($Line) + { + if ($this->markupEscaped) + { + return; + } + + if (preg_match('/^<(\w*)(?:[ ]*'.$this->regexHtmlAttribute.')*[ ]*(\/)?>/', $Line['text'], $matches)) + { + if (in_array($matches[1], $this->textLevelElements)) + { + return; + } + + $Block = array( + 'name' => $matches[1], + 'depth' => 0, + 'markup' => $Line['text'], + ); + + $length = strlen($matches[0]); + + $remainder = substr($Line['text'], $length); + + if (trim($remainder) === '') + { + if (isset($matches[2]) or in_array($matches[1], $this->voidElements)) + { + $Block['closed'] = true; + + $Block['void'] = true; + } + } + else + { + if (isset($matches[2]) or in_array($matches[1], $this->voidElements)) + { + return; + } + + if (preg_match('/<\/'.$matches[1].'>[ ]*$/i', $remainder)) + { + $Block['closed'] = true; + } + } + + return $Block; + } + } + + protected function blockMarkupContinue($Line, array $Block) + { + if (isset($Block['closed'])) + { + return; + } + + if (preg_match('/^<'.$Block['name'].'(?:[ ]*'.$this->regexHtmlAttribute.')*[ ]*>/i', $Line['text'])) # open + { + $Block['depth'] ++; + } + + if (preg_match('/(.*?)<\/'.$Block['name'].'>[ ]*$/i', $Line['text'], $matches)) # close + { + if ($Block['depth'] > 0) + { + $Block['depth'] --; + } + else + { + $Block['closed'] = true; + } + + $Block['markup'] .= $matches[1]; + } + + if (isset($Block['interrupted'])) + { + $Block['markup'] .= "\n"; + + unset($Block['interrupted']); + } + + $Block['markup'] .= "\n".$Line['body']; + + return $Block; + } + + # + # Reference + + protected function blockReference($Line) + { + if (preg_match('/^\[(.+?)\]:[ ]*?(?:[ ]+["\'(](.+)["\')])?[ ]*$/', $Line['text'], $matches)) + { + $id = strtolower($matches[1]); + + $Data = array( + 'url' => $matches[2], + 'title' => null, + ); + + if (isset($matches[3])) + { + $Data['title'] = $matches[3]; + } + + $this->DefinitionData['Reference'][$id] = $Data; + + $Block = array( + 'hidden' => true, + ); + + return $Block; + } + } + + # + # Table + + protected function blockTable($Line, array $Block = null) + { + if ( ! isset($Block) or isset($Block['type']) or isset($Block['interrupted'])) + { + return; + } + + if (strpos($Block['element']['text'], '|') !== false and chop($Line['text'], ' -:|') === '') + { + $alignments = []; + + $divider = $Line['text']; + + $divider = trim($divider); + $divider = trim($divider, '|'); + + $dividerCells = explode('|', $divider); + + foreach ($dividerCells as $dividerCell) + { + $dividerCell = trim($dividerCell); + + if ($dividerCell === '') + { + continue; + } + + $alignment = null; + + if ($dividerCell[0] === ':') + { + $alignment = 'left'; + } + + if (substr($dividerCell, - 1) === ':') + { + $alignment = $alignment === 'left' ? 'center' : 'right'; + } + + $alignments []= $alignment; + } + + # ~ + + $HeaderElements = []; + + $header = $Block['element']['text']; + + $header = trim($header); + $header = trim($header, '|'); + + $headerCells = explode('|', $header); + + foreach ($headerCells as $index => $headerCell) + { + $headerCell = trim($headerCell); + + $HeaderElement = array( + 'name' => 'th', + 'text' => $headerCell, + 'handler' => 'line', + ); + + if (isset($alignments[$index])) + { + $alignment = $alignments[$index]; + + $HeaderElement['attributes'] = array( + 'style' => 'text-align: '.$alignment.';', + ); + } + + $HeaderElements []= $HeaderElement; + } + + # ~ + + $Block = array( + 'alignments' => $alignments, + 'identified' => true, + 'element' => array( + 'name' => 'table', + 'handler' => 'elements', + ), + ); + + $Block['element']['text'] []= array( + 'name' => 'thead', + 'handler' => 'elements', + ); + + $Block['element']['text'] []= array( + 'name' => 'tbody', + 'handler' => 'elements', + 'text' => array(), + ); + + $Block['element']['text'][0]['text'] []= array( + 'name' => 'tr', + 'handler' => 'elements', + 'text' => $HeaderElements, + ); + + return $Block; + } + } + + protected function blockTableContinue($Line, array $Block) + { + if (isset($Block['interrupted'])) + { + return; + } + + if ($Line['text'][0] === '|' or strpos($Line['text'], '|')) + { + $Elements = []; + + $row = $Line['text']; + + $row = trim($row); + $row = trim($row, '|'); + + preg_match_all('/(?:(\\\\[|])|[^|`]|`[^`]+`|`)+/', $row, $matches); + + foreach ($matches[0] as $index => $cell) + { + $cell = trim($cell); + + $Element = array( + 'name' => 'td', + 'handler' => 'line', + 'text' => $cell, + ); + + if (isset($Block['alignments'][$index])) + { + $Element['attributes'] = array( + 'style' => 'text-align: '.$Block['alignments'][$index].';', + ); + } + + $Elements []= $Element; + } + + $Element = array( + 'name' => 'tr', + 'handler' => 'elements', + 'text' => $Elements, + ); + + $Block['element']['text'][1]['text'] []= $Element; + + return $Block; + } + } + + # + # ~ + # + + protected function paragraph($Line) + { + $Block = array( + 'element' => array( + 'name' => 'p', + 'text' => $Line['text'], + 'handler' => 'line', + ), + ); + + return $Block; + } + + # + # Inline Elements + # + + protected $InlineTypes = array( + '"' => array('SpecialCharacter'), + '!' => array('Image'), + '&' => array('SpecialCharacter'), + '*' => array('Emphasis'), + ':' => array('Url'), + '<' => array('UrlTag', 'EmailTag', 'Markup', 'SpecialCharacter'), + '>' => array('SpecialCharacter'), + '[' => array('Link'), + '_' => array('Emphasis'), + '`' => array('Code'), + '~' => array('Strikethrough'), + '\\' => array('EscapeSequence'), + ); + + # ~ + + protected $inlineMarkerList = '!"*_&[:<>`~\\'; + + # + # ~ + # + + public function line($text) + { + $markup = ''; + + $unexaminedText = $text; + + $markerPosition = 0; + + while ($excerpt = strpbrk($unexaminedText, $this->inlineMarkerList)) + { + $marker = $excerpt[0]; + + $markerPosition += strpos($unexaminedText, $marker); + + $Excerpt = array('text' => $excerpt, 'context' => $text); + + foreach ($this->InlineTypes[$marker] as $inlineType) + { + $Inline = $this->{'inline'.$inlineType}($Excerpt); + + if ( ! isset($Inline)) + { + continue; + } + + if (isset($Inline['position']) and $Inline['position'] > $markerPosition) # position is ahead of marker + { + continue; + } + + if ( ! isset($Inline['position'])) + { + $Inline['position'] = $markerPosition; + } + + $unmarkedText = substr($text, 0, $Inline['position']); + + $markup .= $this->unmarkedText($unmarkedText); + + $markup .= isset($Inline['markup']) ? $Inline['markup'] : $this->element($Inline['element']); + + $text = substr($text, $Inline['position'] + $Inline['extent']); + + $unexaminedText = $text; + + $markerPosition = 0; + + continue 2; + } + + $unexaminedText = substr($excerpt, 1); + + $markerPosition ++; + } + + $markup .= $this->unmarkedText($text); + + return $markup; + } + + # + # ~ + # + + protected function inlineCode($Excerpt) + { + $marker = $Excerpt['text'][0]; + + if (preg_match('/^('.$marker.'+)[ ]*(.+?)[ ]*(? strlen($matches[0]), + 'element' => array( + 'name' => 'code', + 'text' => $text, + ), + ); + } + } + + protected function inlineEmailTag($Excerpt) + { + if (strpos($Excerpt['text'], '>') !== false and preg_match('/^<((mailto:)?\S+?@\S+?)>/i', $Excerpt['text'], $matches)) + { + $url = $matches[1]; + + if ( ! isset($matches[2])) + { + $url = 'mailto:' . $url; + } + + return array( + 'extent' => strlen($matches[0]), + 'element' => array( + 'name' => 'a', + 'text' => $matches[1], + 'attributes' => array( + 'href' => $url, + ), + ), + ); + } + } + + protected function inlineEmphasis($Excerpt) + { + if ( ! isset($Excerpt['text'][1])) + { + return; + } + + $marker = $Excerpt['text'][0]; + + if ($Excerpt['text'][1] === $marker and preg_match($this->StrongRegex[$marker], $Excerpt['text'], $matches)) + { + $emphasis = 'strong'; + } + elseif (preg_match($this->EmRegex[$marker], $Excerpt['text'], $matches)) + { + $emphasis = 'em'; + } + else + { + return; + } + + return array( + 'extent' => strlen($matches[0]), + 'element' => array( + 'name' => $emphasis, + 'handler' => 'line', + 'text' => $matches[1], + ), + ); + } + + protected function inlineEscapeSequence($Excerpt) + { + if (isset($Excerpt['text'][1]) and in_array($Excerpt['text'][1], $this->specialCharacters)) + { + return array( + 'markup' => $Excerpt['text'][1], + 'extent' => 2, + ); + } + } + + protected function inlineImage($Excerpt) + { + if ( ! isset($Excerpt['text'][1]) or $Excerpt['text'][1] !== '[') + { + return; + } + + $Excerpt['text']= substr($Excerpt['text'], 1); + + $Link = $this->inlineLink($Excerpt); + + if ($Link === null) + { + return; + } + + $Inline = array( + 'extent' => $Link['extent'] + 1, + 'element' => array( + 'name' => 'img', + 'attributes' => array( + 'src' => $Link['element']['attributes']['href'], + 'alt' => $Link['element']['text'], + ), + ), + ); + + $Inline['element']['attributes'] += $Link['element']['attributes']; + + unset($Inline['element']['attributes']['href']); + + return $Inline; + } + + protected function inlineLink($Excerpt) + { + $Element = array( + 'name' => 'a', + 'handler' => 'line', + 'text' => null, + 'attributes' => array( + 'href' => null, + 'title' => null, + ), + ); + + $extent = 0; + + $remainder = $Excerpt['text']; + + if (preg_match('/\[((?:[^][]|(?R))*)\]/', $remainder, $matches)) + { + $Element['text'] = $matches[1]; + + $extent += strlen($matches[0]); + + $remainder = substr($remainder, $extent); + } + else + { + return; + } + + if (preg_match('/^[(]((?:[^ (]|[(][^ )]+[)])+)(?:[ ]+("[^"]+"|\'[^\']+\'))?[)]/', $remainder, $matches)) + { + $Element['attributes']['href'] = $matches[1]; + + if (isset($matches[2])) + { + $Element['attributes']['title'] = substr($matches[2], 1, - 1); + } + + $extent += strlen($matches[0]); + } + else + { + if (preg_match('/^\s*\[(.*?)\]/', $remainder, $matches)) + { + $definition = $matches[1] ? $matches[1] : $Element['text']; + $definition = strtolower($definition); + + $extent += strlen($matches[0]); + } + else + { + $definition = strtolower($Element['text']); + } + + if ( ! isset($this->DefinitionData['Reference'][$definition])) + { + return; + } + + $Definition = $this->DefinitionData['Reference'][$definition]; + + $Element['attributes']['href'] = $Definition['url']; + $Element['attributes']['title'] = $Definition['title']; + } + + $Element['attributes']['href'] = str_replace(array('&', '<'), array('&', '<'), $Element['attributes']['href']); + + return array( + 'extent' => $extent, + 'element' => $Element, + ); + } + + protected function inlineMarkup($Excerpt) + { + if ($this->markupEscaped or strpos($Excerpt['text'], '>') === false) + { + return; + } + + if ($Excerpt['text'][1] === '/' and preg_match('/^<\/\w*[ ]*>/s', $Excerpt['text'], $matches)) + { + return array( + 'markup' => $matches[0], + 'extent' => strlen($matches[0]), + ); + } + + if ($Excerpt['text'][1] === '!' and preg_match('/^/s', $Excerpt['text'], $matches)) + { + return array( + 'markup' => $matches[0], + 'extent' => strlen($matches[0]), + ); + } + + if ($Excerpt['text'][1] !== ' ' and preg_match('/^<\w*(?:[ ]*'.$this->regexHtmlAttribute.')*[ ]*\/?>/s', $Excerpt['text'], $matches)) + { + return array( + 'markup' => $matches[0], + 'extent' => strlen($matches[0]), + ); + } + } + + protected function inlineSpecialCharacter($Excerpt) + { + if ($Excerpt['text'][0] === '&' and ! preg_match('/^&#?\w+;/', $Excerpt['text'])) + { + return array( + 'markup' => '&', + 'extent' => 1, + ); + } + + $SpecialCharacter = array('>' => 'gt', '<' => 'lt', '"' => 'quot'); + + if (isset($SpecialCharacter[$Excerpt['text'][0]])) + { + return array( + 'markup' => '&'.$SpecialCharacter[$Excerpt['text'][0]].';', + 'extent' => 1, + ); + } + } + + protected function inlineStrikethrough($Excerpt) + { + if ( ! isset($Excerpt['text'][1])) + { + return; + } + + if ($Excerpt['text'][1] === '~' and preg_match('/^~~(?=\S)(.+?)(?<=\S)~~/', $Excerpt['text'], $matches)) + { + return array( + 'extent' => strlen($matches[0]), + 'element' => array( + 'name' => 'del', + 'text' => $matches[1], + 'handler' => 'line', + ), + ); + } + } + + protected function inlineUrl($Excerpt) + { + if ($this->urlsLinked !== true or ! isset($Excerpt['text'][2]) or $Excerpt['text'][2] !== '/') + { + return; + } + + if (preg_match('/\bhttps?:[\/]{2}[^\s<]+\b\/*/ui', $Excerpt['context'], $matches, PREG_OFFSET_CAPTURE)) + { + $Inline = array( + 'extent' => strlen($matches[0][0]), + 'position' => $matches[0][1], + 'element' => array( + 'name' => 'a', + 'text' => $matches[0][0], + 'attributes' => array( + 'href' => $matches[0][0], + ), + ), + ); + + return $Inline; + } + } + + protected function inlineUrlTag($Excerpt) + { + if (strpos($Excerpt['text'], '>') !== false and preg_match('/^<(\w+:\/{2}[^ >]+)>/i', $Excerpt['text'], $matches)) + { + $url = str_replace(array('&', '<'), array('&', '<'), $matches[1]); + + return array( + 'extent' => strlen($matches[0]), + 'element' => array( + 'name' => 'a', + 'text' => $url, + 'attributes' => array( + 'href' => $url, + ), + ), + ); + } + } + + # + # ~ + + protected $unmarkedInlineTypes = array("\n" => 'Break', '://' => 'Url'); + + # ~ + + protected function unmarkedText($text) + { + if ($this->breaksEnabled) + { + $text = preg_replace('/[ ]*\n/', "
\n", $text); + } + else + { + $text = preg_replace('/(?:[ ][ ]+|[ ]*\\\\)\n/', "
\n", $text); + $text = str_replace(" \n", "\n", $text); + } + + return $text; + } + + # + # Handlers + # + + protected function element(array $Element) + { + $markup = '<'.$Element['name']; + + if (isset($Element['attributes'])) + { + foreach ($Element['attributes'] as $name => $value) + { + if ($value === null) + { + continue; + } + + $markup .= ' '.$name.'="'.$value.'"'; + } + } + + if (isset($Element['text'])) + { + $markup .= '>'; + + if (isset($Element['handler'])) + { + $markup .= $this->{$Element['handler']}($Element['text']); + } + else + { + $markup .= $Element['text']; + } + + $markup .= ''; + } + else + { + $markup .= ' />'; + } + + return $markup; + } + + protected function elements(array $Elements) + { + $markup = ''; + + foreach ($Elements as $Element) + { + $markup .= "\n" . $this->element($Element); + } + + $markup .= "\n"; + + return $markup; + } + + # ~ + + protected function li($lines) + { + $markup = $this->lines($lines); + + $trimmedMarkup = trim($markup); + + if ( ! in_array('', $lines) and substr($trimmedMarkup, 0, 3) === '

') + { + $markup = $trimmedMarkup; + $markup = substr($markup, 3); + + $position = strpos($markup, "

"); + + $markup = substr_replace($markup, '', $position, 4); + } + + return $markup; + } + + # + # Deprecated Methods + # + + function parse($text) + { + $markup = $this->text($text); + + return $markup; + } + + # + # Static Methods + # + + static function instance($name = 'default') + { + if (isset(self::$instances[$name])) + { + return self::$instances[$name]; + } + + $instance = new self(); + + self::$instances[$name] = $instance; + + return $instance; + } + + private static $instances = []; + + # + # Fields + # + + protected $DefinitionData; + + # + # Read-Only + + protected $specialCharacters = array( + '\\', '`', '*', '_', '{', '}', '[', ']', '(', ')', '>', '#', '+', '-', '.', '!', '|', + ); + + protected $StrongRegex = array( + '*' => '/^[*]{2}((?:\\\\\*|[^*]|[*][^*]*[*])+?)[*]{2}(?![*])/s', + '_' => '/^__((?:\\\\_|[^_]|_[^_]*_)+?)__(?!_)/us', + ); + + protected $EmRegex = array( + '*' => '/^[*]((?:\\\\\*|[^*]|[*][*][^*]+?[*][*])+?)[*](?![*])/s', + '_' => '/^_((?:\\\\_|[^_]|__[^_]*__)+?)_(?!_)\b/us', + ); + + protected $regexHtmlAttribute = '[a-zA-Z_:][\w:.-]*(?:\s*=\s*(?:[^"\'=<>`\s]+|"[^"]*"|\'[^\']*\'))?'; + + protected $voidElements = array( + 'area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'link', 'meta', 'param', 'source', + ); + + protected $textLevelElements = array( + 'a', 'br', 'bdo', 'abbr', 'blink', 'nextid', 'acronym', 'basefont', + 'b', 'em', 'big', 'cite', 'small', 'spacer', 'listing', + 'i', 'rp', 'del', 'code', 'strike', 'marquee', + 'q', 'rt', 'ins', 'font', 'strong', + 's', 'tt', 'sub', 'mark', + 'u', 'xm', 'sup', 'nobr', + 'var', 'ruby', + 'wbr', 'span', + 'time', + ); +} diff --git a/app/core/puc/vendor/ParsedownModern.php b/app/core/puc/vendor/ParsedownModern.php new file mode 100755 index 0000000..0970796 --- /dev/null +++ b/app/core/puc/vendor/ParsedownModern.php @@ -0,0 +1,1538 @@ +DefinitionData = []; + + # standardize line breaks + $text = str_replace(array("\r\n", "\r"), "\n", $text); + + # remove surrounding line breaks + $text = trim($text, "\n"); + + # split text into lines + $lines = explode("\n", $text); + + # iterate through lines to identify blocks + $markup = $this->lines($lines); + + # trim line breaks + $markup = trim($markup, "\n"); + + return $markup; + } + + # + # Setters + # + + function setBreaksEnabled($breaksEnabled) + { + $this->breaksEnabled = $breaksEnabled; + + return $this; + } + + protected $breaksEnabled; + + function setMarkupEscaped($markupEscaped) + { + $this->markupEscaped = $markupEscaped; + + return $this; + } + + protected $markupEscaped; + + function setUrlsLinked($urlsLinked) + { + $this->urlsLinked = $urlsLinked; + + return $this; + } + + protected $urlsLinked = true; + + # + # Lines + # + + protected $BlockTypes = array( + '#' => array('Header'), + '*' => array('Rule', 'List'), + '+' => array('List'), + '-' => array('SetextHeader', 'Table', 'Rule', 'List'), + '0' => array('List'), + '1' => array('List'), + '2' => array('List'), + '3' => array('List'), + '4' => array('List'), + '5' => array('List'), + '6' => array('List'), + '7' => array('List'), + '8' => array('List'), + '9' => array('List'), + ':' => array('Table'), + '<' => array('Comment', 'Markup'), + '=' => array('SetextHeader'), + '>' => array('Quote'), + '[' => array('Reference'), + '_' => array('Rule'), + '`' => array('FencedCode'), + '|' => array('Table'), + '~' => array('FencedCode'), + ); + + # ~ + + protected $unmarkedBlockTypes = array( + 'Code', + ); + + # + # Blocks + # + + protected function lines(array $lines) + { + $CurrentBlock = null; + + foreach ($lines as $line) + { + if (chop($line) === '') + { + if (isset($CurrentBlock)) + { + $CurrentBlock['interrupted'] = true; + } + + continue; + } + + if (strpos($line, "\t") !== false) + { + $parts = explode("\t", $line); + + $line = $parts[0]; + + unset($parts[0]); + + foreach ($parts as $part) + { + $shortage = 4 - mb_strlen($line, 'utf-8') % 4; + + $line .= str_repeat(' ', $shortage); + $line .= $part; + } + } + + $indent = 0; + + while (isset($line[$indent]) and $line[$indent] === ' ') + { + $indent ++; + } + + $text = $indent > 0 ? substr($line, $indent) : $line; + + # ~ + + $Line = array('body' => $line, 'indent' => $indent, 'text' => $text); + + # ~ + + if (isset($CurrentBlock['continuable'])) + { + $Block = $this->{'block'.$CurrentBlock['type'].'Continue'}($Line, $CurrentBlock); + + if (isset($Block)) + { + $CurrentBlock = $Block; + + continue; + } + else + { + if ($this->isBlockCompletable($CurrentBlock['type'])) + { + $CurrentBlock = $this->{'block'.$CurrentBlock['type'].'Complete'}($CurrentBlock); + } + } + } + + # ~ + + $marker = $text[0]; + + # ~ + + $blockTypes = $this->unmarkedBlockTypes; + + if (isset($this->BlockTypes[$marker])) + { + foreach ($this->BlockTypes[$marker] as $blockType) + { + $blockTypes []= $blockType; + } + } + + # + # ~ + + foreach ($blockTypes as $blockType) + { + $Block = $this->{'block'.$blockType}($Line, $CurrentBlock); + + if (isset($Block)) + { + $Block['type'] = $blockType; + + if ( ! isset($Block['identified'])) + { + $Blocks []= $CurrentBlock; + + $Block['identified'] = true; + } + + if ($this->isBlockContinuable($blockType)) + { + $Block['continuable'] = true; + } + + $CurrentBlock = $Block; + + continue 2; + } + } + + # ~ + + if (isset($CurrentBlock) and ! isset($CurrentBlock['type']) and ! isset($CurrentBlock['interrupted'])) + { + $CurrentBlock['element']['text'] .= "\n".$text; + } + else + { + $Blocks []= $CurrentBlock; + + $CurrentBlock = $this->paragraph($Line); + + $CurrentBlock['identified'] = true; + } + } + + # ~ + + if (isset($CurrentBlock['continuable']) and $this->isBlockCompletable($CurrentBlock['type'])) + { + $CurrentBlock = $this->{'block'.$CurrentBlock['type'].'Complete'}($CurrentBlock); + } + + # ~ + + $Blocks []= $CurrentBlock; + + unset($Blocks[0]); + + # ~ + + $markup = ''; + + foreach ($Blocks as $Block) + { + if (isset($Block['hidden'])) + { + continue; + } + + $markup .= "\n"; + $markup .= isset($Block['markup']) ? $Block['markup'] : $this->element($Block['element']); + } + + $markup .= "\n"; + + # ~ + + return $markup; + } + + protected function isBlockContinuable($Type) + { + return method_exists($this, 'block'.$Type.'Continue'); + } + + protected function isBlockCompletable($Type) + { + return method_exists($this, 'block'.$Type.'Complete'); + } + + # + # Code + + protected function blockCode($Line, $Block = null) + { + if (isset($Block) and ! isset($Block['type']) and ! isset($Block['interrupted'])) + { + return; + } + + if ($Line['indent'] >= 4) + { + $text = substr($Line['body'], 4); + + $Block = array( + 'element' => array( + 'name' => 'pre', + 'handler' => 'element', + 'text' => array( + 'name' => 'code', + 'text' => $text, + ), + ), + ); + + return $Block; + } + } + + protected function blockCodeContinue($Line, $Block) + { + if ($Line['indent'] >= 4) + { + if (isset($Block['interrupted'])) + { + $Block['element']['text']['text'] .= "\n"; + + unset($Block['interrupted']); + } + + $Block['element']['text']['text'] .= "\n"; + + $text = substr($Line['body'], 4); + + $Block['element']['text']['text'] .= $text; + + return $Block; + } + } + + protected function blockCodeComplete($Block) + { + $text = $Block['element']['text']['text']; + + $text = htmlspecialchars($text, ENT_NOQUOTES, 'UTF-8'); + + $Block['element']['text']['text'] = $text; + + return $Block; + } + + # + # Comment + + protected function blockComment($Line) + { + if ($this->markupEscaped) + { + return; + } + + if (isset($Line['text'][3]) and $Line['text'][3] === '-' and $Line['text'][2] === '-' and $Line['text'][1] === '!') + { + $Block = array( + 'markup' => $Line['body'], + ); + + if (preg_match('/-->$/', $Line['text'])) + { + $Block['closed'] = true; + } + + return $Block; + } + } + + protected function blockCommentContinue($Line, array $Block) + { + if (isset($Block['closed'])) + { + return; + } + + $Block['markup'] .= "\n" . $Line['body']; + + if (preg_match('/-->$/', $Line['text'])) + { + $Block['closed'] = true; + } + + return $Block; + } + + # + # Fenced Code + + protected function blockFencedCode($Line) + { + if (preg_match('/^['.$Line['text'][0].']{3,}[ ]*([\w-]+)?[ ]*$/', $Line['text'], $matches)) + { + $Element = array( + 'name' => 'code', + 'text' => '', + ); + + if (isset($matches[1])) + { + $class = 'language-'.$matches[1]; + + $Element['attributes'] = array( + 'class' => $class, + ); + } + + $Block = array( + 'char' => $Line['text'][0], + 'element' => array( + 'name' => 'pre', + 'handler' => 'element', + 'text' => $Element, + ), + ); + + return $Block; + } + } + + protected function blockFencedCodeContinue($Line, $Block) + { + if (isset($Block['complete'])) + { + return; + } + + if (isset($Block['interrupted'])) + { + $Block['element']['text']['text'] .= "\n"; + + unset($Block['interrupted']); + } + + if (preg_match('/^'.$Block['char'].'{3,}[ ]*$/', $Line['text'])) + { + $Block['element']['text']['text'] = substr($Block['element']['text']['text'], 1); + + $Block['complete'] = true; + + return $Block; + } + + $Block['element']['text']['text'] .= "\n".$Line['body'];; + + return $Block; + } + + protected function blockFencedCodeComplete($Block) + { + $text = $Block['element']['text']['text']; + + $text = htmlspecialchars($text, ENT_NOQUOTES, 'UTF-8'); + + $Block['element']['text']['text'] = $text; + + return $Block; + } + + # + # Header + + protected function blockHeader($Line) + { + if (isset($Line['text'][1])) + { + $level = 1; + + while (isset($Line['text'][$level]) and $Line['text'][$level] === '#') + { + $level ++; + } + + if ($level > 6) + { + return; + } + + $text = trim($Line['text'], '# '); + + $Block = array( + 'element' => array( + 'name' => 'h' . min(6, $level), + 'text' => $text, + 'handler' => 'line', + ), + ); + + return $Block; + } + } + + # + # List + + protected function blockList($Line) + { + list($name, $pattern) = $Line['text'][0] <= '-' ? array('ul', '[*+-]') : array('ol', '[0-9]+[.]'); + + if (preg_match('/^('.$pattern.'[ ]+)(.*)/', $Line['text'], $matches)) + { + $Block = array( + 'indent' => $Line['indent'], + 'pattern' => $pattern, + 'element' => array( + 'name' => $name, + 'handler' => 'elements', + ), + ); + + $Block['li'] = array( + 'name' => 'li', + 'handler' => 'li', + 'text' => array( + $matches[2], + ), + ); + + $Block['element']['text'] []= & $Block['li']; + + return $Block; + } + } + + protected function blockListContinue($Line, array $Block) + { + if ($Block['indent'] === $Line['indent'] and preg_match('/^'.$Block['pattern'].'(?:[ ]+(.*)|$)/', $Line['text'], $matches)) + { + if (isset($Block['interrupted'])) + { + $Block['li']['text'] []= ''; + + unset($Block['interrupted']); + } + + unset($Block['li']); + + $text = isset($matches[1]) ? $matches[1] : ''; + + $Block['li'] = array( + 'name' => 'li', + 'handler' => 'li', + 'text' => array( + $text, + ), + ); + + $Block['element']['text'] []= & $Block['li']; + + return $Block; + } + + if ($Line['text'][0] === '[' and $this->blockReference($Line)) + { + return $Block; + } + + if ( ! isset($Block['interrupted'])) + { + $text = preg_replace('/^[ ]{0,4}/', '', $Line['body']); + + $Block['li']['text'] []= $text; + + return $Block; + } + + if ($Line['indent'] > 0) + { + $Block['li']['text'] []= ''; + + $text = preg_replace('/^[ ]{0,4}/', '', $Line['body']); + + $Block['li']['text'] []= $text; + + unset($Block['interrupted']); + + return $Block; + } + } + + # + # Quote + + protected function blockQuote($Line) + { + if (preg_match('/^>[ ]?(.*)/', $Line['text'], $matches)) + { + $Block = array( + 'element' => array( + 'name' => 'blockquote', + 'handler' => 'lines', + 'text' => (array) $matches[1], + ), + ); + + return $Block; + } + } + + protected function blockQuoteContinue($Line, array $Block) + { + if ($Line['text'][0] === '>' and preg_match('/^>[ ]?(.*)/', $Line['text'], $matches)) + { + if (isset($Block['interrupted'])) + { + $Block['element']['text'] []= ''; + + unset($Block['interrupted']); + } + + $Block['element']['text'] []= $matches[1]; + + return $Block; + } + + if ( ! isset($Block['interrupted'])) + { + $Block['element']['text'] []= $Line['text']; + + return $Block; + } + } + + # + # Rule + + protected function blockRule($Line) + { + if (preg_match('/^(['.$Line['text'][0].'])([ ]*\1){2,}[ ]*$/', $Line['text'])) + { + $Block = array( + 'element' => array( + 'name' => 'hr' + ), + ); + + return $Block; + } + } + + # + # Setext + + protected function blockSetextHeader($Line, array $Block = null) + { + if ( ! isset($Block) or isset($Block['type']) or isset($Block['interrupted'])) + { + return; + } + + if (chop($Line['text'], $Line['text'][0]) === '') + { + $Block['element']['name'] = $Line['text'][0] === '=' ? 'h1' : 'h2'; + + return $Block; + } + } + + # + # Markup + + protected function blockMarkup($Line) + { + if ($this->markupEscaped) + { + return; + } + + if (preg_match('/^<(\w*)(?:[ ]*'.$this->regexHtmlAttribute.')*[ ]*(\/)?>/', $Line['text'], $matches)) + { + $element = strtolower($matches[1]); + + if (in_array($element, $this->textLevelElements)) + { + return; + } + + $Block = array( + 'name' => $matches[1], + 'depth' => 0, + 'markup' => $Line['text'], + ); + + $length = strlen($matches[0]); + + $remainder = substr($Line['text'], $length); + + if (trim($remainder) === '') + { + if (isset($matches[2]) or in_array($matches[1], $this->voidElements)) + { + $Block['closed'] = true; + + $Block['void'] = true; + } + } + else + { + if (isset($matches[2]) or in_array($matches[1], $this->voidElements)) + { + return; + } + + if (preg_match('/<\/'.$matches[1].'>[ ]*$/i', $remainder)) + { + $Block['closed'] = true; + } + } + + return $Block; + } + } + + protected function blockMarkupContinue($Line, array $Block) + { + if (isset($Block['closed'])) + { + return; + } + + if (preg_match('/^<'.$Block['name'].'(?:[ ]*'.$this->regexHtmlAttribute.')*[ ]*>/i', $Line['text'])) # open + { + $Block['depth'] ++; + } + + if (preg_match('/(.*?)<\/'.$Block['name'].'>[ ]*$/i', $Line['text'], $matches)) # close + { + if ($Block['depth'] > 0) + { + $Block['depth'] --; + } + else + { + $Block['closed'] = true; + } + } + + if (isset($Block['interrupted'])) + { + $Block['markup'] .= "\n"; + + unset($Block['interrupted']); + } + + $Block['markup'] .= "\n".$Line['body']; + + return $Block; + } + + # + # Reference + + protected function blockReference($Line) + { + if (preg_match('/^\[(.+?)\]:[ ]*?(?:[ ]+["\'(](.+)["\')])?[ ]*$/', $Line['text'], $matches)) + { + $id = strtolower($matches[1]); + + $Data = array( + 'url' => $matches[2], + 'title' => null, + ); + + if (isset($matches[3])) + { + $Data['title'] = $matches[3]; + } + + $this->DefinitionData['Reference'][$id] = $Data; + + $Block = array( + 'hidden' => true, + ); + + return $Block; + } + } + + # + # Table + + protected function blockTable($Line, array $Block = null) + { + if ( ! isset($Block) or isset($Block['type']) or isset($Block['interrupted'])) + { + return; + } + + if (strpos($Block['element']['text'], '|') !== false and chop($Line['text'], ' -:|') === '') + { + $alignments = []; + + $divider = $Line['text']; + + $divider = trim($divider); + $divider = trim($divider, '|'); + + $dividerCells = explode('|', $divider); + + foreach ($dividerCells as $dividerCell) + { + $dividerCell = trim($dividerCell); + + if ($dividerCell === '') + { + continue; + } + + $alignment = null; + + if ($dividerCell[0] === ':') + { + $alignment = 'left'; + } + + if (substr($dividerCell, - 1) === ':') + { + $alignment = $alignment === 'left' ? 'center' : 'right'; + } + + $alignments []= $alignment; + } + + # ~ + + $HeaderElements = []; + + $header = $Block['element']['text']; + + $header = trim($header); + $header = trim($header, '|'); + + $headerCells = explode('|', $header); + + foreach ($headerCells as $index => $headerCell) + { + $headerCell = trim($headerCell); + + $HeaderElement = array( + 'name' => 'th', + 'text' => $headerCell, + 'handler' => 'line', + ); + + if (isset($alignments[$index])) + { + $alignment = $alignments[$index]; + + $HeaderElement['attributes'] = array( + 'style' => 'text-align: '.$alignment.';', + ); + } + + $HeaderElements []= $HeaderElement; + } + + # ~ + + $Block = array( + 'alignments' => $alignments, + 'identified' => true, + 'element' => array( + 'name' => 'table', + 'handler' => 'elements', + ), + ); + + $Block['element']['text'] []= array( + 'name' => 'thead', + 'handler' => 'elements', + ); + + $Block['element']['text'] []= array( + 'name' => 'tbody', + 'handler' => 'elements', + 'text' => array(), + ); + + $Block['element']['text'][0]['text'] []= array( + 'name' => 'tr', + 'handler' => 'elements', + 'text' => $HeaderElements, + ); + + return $Block; + } + } + + protected function blockTableContinue($Line, array $Block) + { + if (isset($Block['interrupted'])) + { + return; + } + + if ($Line['text'][0] === '|' or strpos($Line['text'], '|')) + { + $Elements = []; + + $row = $Line['text']; + + $row = trim($row); + $row = trim($row, '|'); + + preg_match_all('/(?:(\\\\[|])|[^|`]|`[^`]+`|`)+/', $row, $matches); + + foreach ($matches[0] as $index => $cell) + { + $cell = trim($cell); + + $Element = array( + 'name' => 'td', + 'handler' => 'line', + 'text' => $cell, + ); + + if (isset($Block['alignments'][$index])) + { + $Element['attributes'] = array( + 'style' => 'text-align: '.$Block['alignments'][$index].';', + ); + } + + $Elements []= $Element; + } + + $Element = array( + 'name' => 'tr', + 'handler' => 'elements', + 'text' => $Elements, + ); + + $Block['element']['text'][1]['text'] []= $Element; + + return $Block; + } + } + + # + # ~ + # + + protected function paragraph($Line) + { + $Block = array( + 'element' => array( + 'name' => 'p', + 'text' => $Line['text'], + 'handler' => 'line', + ), + ); + + return $Block; + } + + # + # Inline Elements + # + + protected $InlineTypes = array( + '"' => array('SpecialCharacter'), + '!' => array('Image'), + '&' => array('SpecialCharacter'), + '*' => array('Emphasis'), + ':' => array('Url'), + '<' => array('UrlTag', 'EmailTag', 'Markup', 'SpecialCharacter'), + '>' => array('SpecialCharacter'), + '[' => array('Link'), + '_' => array('Emphasis'), + '`' => array('Code'), + '~' => array('Strikethrough'), + '\\' => array('EscapeSequence'), + ); + + # ~ + + protected $inlineMarkerList = '!"*_&[:<>`~\\'; + + # + # ~ + # + + public function line($text) + { + $markup = ''; + + # $excerpt is based on the first occurrence of a marker + + while ($excerpt = strpbrk($text, $this->inlineMarkerList)) + { + $marker = $excerpt[0]; + + $markerPosition = strpos($text, $marker); + + $Excerpt = array('text' => $excerpt, 'context' => $text); + + foreach ($this->InlineTypes[$marker] as $inlineType) + { + $Inline = $this->{'inline'.$inlineType}($Excerpt); + + if ( ! isset($Inline)) + { + continue; + } + + # makes sure that the inline belongs to "our" marker + + if (isset($Inline['position']) and $Inline['position'] > $markerPosition) + { + continue; + } + + # sets a default inline position + + if ( ! isset($Inline['position'])) + { + $Inline['position'] = $markerPosition; + } + + # the text that comes before the inline + $unmarkedText = substr($text, 0, $Inline['position']); + + # compile the unmarked text + $markup .= $this->unmarkedText($unmarkedText); + + # compile the inline + $markup .= isset($Inline['markup']) ? $Inline['markup'] : $this->element($Inline['element']); + + # remove the examined text + $text = substr($text, $Inline['position'] + $Inline['extent']); + + continue 2; + } + + # the marker does not belong to an inline + + $unmarkedText = substr($text, 0, $markerPosition + 1); + + $markup .= $this->unmarkedText($unmarkedText); + + $text = substr($text, $markerPosition + 1); + } + + $markup .= $this->unmarkedText($text); + + return $markup; + } + + # + # ~ + # + + protected function inlineCode($Excerpt) + { + $marker = $Excerpt['text'][0]; + + if (preg_match('/^('.$marker.'+)[ ]*(.+?)[ ]*(? strlen($matches[0]), + 'element' => array( + 'name' => 'code', + 'text' => $text, + ), + ); + } + } + + protected function inlineEmailTag($Excerpt) + { + if (strpos($Excerpt['text'], '>') !== false and preg_match('/^<((mailto:)?\S+?@\S+?)>/i', $Excerpt['text'], $matches)) + { + $url = $matches[1]; + + if ( ! isset($matches[2])) + { + $url = 'mailto:' . $url; + } + + return array( + 'extent' => strlen($matches[0]), + 'element' => array( + 'name' => 'a', + 'text' => $matches[1], + 'attributes' => array( + 'href' => $url, + ), + ), + ); + } + } + + protected function inlineEmphasis($Excerpt) + { + if ( ! isset($Excerpt['text'][1])) + { + return; + } + + $marker = $Excerpt['text'][0]; + + if ($Excerpt['text'][1] === $marker and preg_match($this->StrongRegex[$marker], $Excerpt['text'], $matches)) + { + $emphasis = 'strong'; + } + elseif (preg_match($this->EmRegex[$marker], $Excerpt['text'], $matches)) + { + $emphasis = 'em'; + } + else + { + return; + } + + return array( + 'extent' => strlen($matches[0]), + 'element' => array( + 'name' => $emphasis, + 'handler' => 'line', + 'text' => $matches[1], + ), + ); + } + + protected function inlineEscapeSequence($Excerpt) + { + if (isset($Excerpt['text'][1]) and in_array($Excerpt['text'][1], $this->specialCharacters)) + { + return array( + 'markup' => $Excerpt['text'][1], + 'extent' => 2, + ); + } + } + + protected function inlineImage($Excerpt) + { + if ( ! isset($Excerpt['text'][1]) or $Excerpt['text'][1] !== '[') + { + return; + } + + $Excerpt['text']= substr($Excerpt['text'], 1); + + $Link = $this->inlineLink($Excerpt); + + if ($Link === null) + { + return; + } + + $Inline = array( + 'extent' => $Link['extent'] + 1, + 'element' => array( + 'name' => 'img', + 'attributes' => array( + 'src' => $Link['element']['attributes']['href'], + 'alt' => $Link['element']['text'], + ), + ), + ); + + $Inline['element']['attributes'] += $Link['element']['attributes']; + + unset($Inline['element']['attributes']['href']); + + return $Inline; + } + + protected function inlineLink($Excerpt) + { + $Element = array( + 'name' => 'a', + 'handler' => 'line', + 'text' => null, + 'attributes' => array( + 'href' => null, + 'title' => null, + ), + ); + + $extent = 0; + + $remainder = $Excerpt['text']; + + if (preg_match('/\[((?:[^][]|(?R))*)\]/', $remainder, $matches)) + { + $Element['text'] = $matches[1]; + + $extent += strlen($matches[0]); + + $remainder = substr($remainder, $extent); + } + else + { + return; + } + + if (preg_match('/^[(]((?:[^ ()]|[(][^ )]+[)])+)(?:[ ]+("[^"]*"|\'[^\']*\'))?[)]/', $remainder, $matches)) + { + $Element['attributes']['href'] = $matches[1]; + + if (isset($matches[2])) + { + $Element['attributes']['title'] = substr($matches[2], 1, - 1); + } + + $extent += strlen($matches[0]); + } + else + { + if (preg_match('/^\s*\[(.*?)\]/', $remainder, $matches)) + { + $definition = strlen($matches[1]) ? $matches[1] : $Element['text']; + $definition = strtolower($definition); + + $extent += strlen($matches[0]); + } + else + { + $definition = strtolower($Element['text']); + } + + if ( ! isset($this->DefinitionData['Reference'][$definition])) + { + return; + } + + $Definition = $this->DefinitionData['Reference'][$definition]; + + $Element['attributes']['href'] = $Definition['url']; + $Element['attributes']['title'] = $Definition['title']; + } + + $Element['attributes']['href'] = str_replace(array('&', '<'), array('&', '<'), $Element['attributes']['href']); + + return array( + 'extent' => $extent, + 'element' => $Element, + ); + } + + protected function inlineMarkup($Excerpt) + { + if ($this->markupEscaped or strpos($Excerpt['text'], '>') === false) + { + return; + } + + if ($Excerpt['text'][1] === '/' and preg_match('/^<\/\w*[ ]*>/s', $Excerpt['text'], $matches)) + { + return array( + 'markup' => $matches[0], + 'extent' => strlen($matches[0]), + ); + } + + if ($Excerpt['text'][1] === '!' and preg_match('/^/s', $Excerpt['text'], $matches)) + { + return array( + 'markup' => $matches[0], + 'extent' => strlen($matches[0]), + ); + } + + if ($Excerpt['text'][1] !== ' ' and preg_match('/^<\w*(?:[ ]*'.$this->regexHtmlAttribute.')*[ ]*\/?>/s', $Excerpt['text'], $matches)) + { + return array( + 'markup' => $matches[0], + 'extent' => strlen($matches[0]), + ); + } + } + + protected function inlineSpecialCharacter($Excerpt) + { + if ($Excerpt['text'][0] === '&' and ! preg_match('/^&#?\w+;/', $Excerpt['text'])) + { + return array( + 'markup' => '&', + 'extent' => 1, + ); + } + + $SpecialCharacter = array('>' => 'gt', '<' => 'lt', '"' => 'quot'); + + if (isset($SpecialCharacter[$Excerpt['text'][0]])) + { + return array( + 'markup' => '&'.$SpecialCharacter[$Excerpt['text'][0]].';', + 'extent' => 1, + ); + } + } + + protected function inlineStrikethrough($Excerpt) + { + if ( ! isset($Excerpt['text'][1])) + { + return; + } + + if ($Excerpt['text'][1] === '~' and preg_match('/^~~(?=\S)(.+?)(?<=\S)~~/', $Excerpt['text'], $matches)) + { + return array( + 'extent' => strlen($matches[0]), + 'element' => array( + 'name' => 'del', + 'text' => $matches[1], + 'handler' => 'line', + ), + ); + } + } + + protected function inlineUrl($Excerpt) + { + if ($this->urlsLinked !== true or ! isset($Excerpt['text'][2]) or $Excerpt['text'][2] !== '/') + { + return; + } + + if (preg_match('/\bhttps?:[\/]{2}[^\s<]+\b\/*/ui', $Excerpt['context'], $matches, PREG_OFFSET_CAPTURE)) + { + $Inline = array( + 'extent' => strlen($matches[0][0]), + 'position' => $matches[0][1], + 'element' => array( + 'name' => 'a', + 'text' => $matches[0][0], + 'attributes' => array( + 'href' => $matches[0][0], + ), + ), + ); + + return $Inline; + } + } + + protected function inlineUrlTag($Excerpt) + { + if (strpos($Excerpt['text'], '>') !== false and preg_match('/^<(\w+:\/{2}[^ >]+)>/i', $Excerpt['text'], $matches)) + { + $url = str_replace(array('&', '<'), array('&', '<'), $matches[1]); + + return array( + 'extent' => strlen($matches[0]), + 'element' => array( + 'name' => 'a', + 'text' => $url, + 'attributes' => array( + 'href' => $url, + ), + ), + ); + } + } + + # ~ + + protected function unmarkedText($text) + { + if ($this->breaksEnabled) + { + $text = preg_replace('/[ ]*\n/', "
\n", $text); + } + else + { + $text = preg_replace('/(?:[ ][ ]+|[ ]*\\\\)\n/', "
\n", $text); + $text = str_replace(" \n", "\n", $text); + } + + return $text; + } + + # + # Handlers + # + + protected function element(array $Element) + { + $markup = '<'.$Element['name']; + + if (isset($Element['attributes'])) + { + foreach ($Element['attributes'] as $name => $value) + { + if ($value === null) + { + continue; + } + + $markup .= ' '.$name.'="'.$value.'"'; + } + } + + if (isset($Element['text'])) + { + $markup .= '>'; + + if (isset($Element['handler'])) + { + $markup .= $this->{$Element['handler']}($Element['text']); + } + else + { + $markup .= $Element['text']; + } + + $markup .= ''; + } + else + { + $markup .= ' />'; + } + + return $markup; + } + + protected function elements(array $Elements) + { + $markup = ''; + + foreach ($Elements as $Element) + { + $markup .= "\n" . $this->element($Element); + } + + $markup .= "\n"; + + return $markup; + } + + # ~ + + protected function li($lines) + { + $markup = $this->lines($lines); + + $trimmedMarkup = trim($markup); + + if ( ! in_array('', $lines) and substr($trimmedMarkup, 0, 3) === '

') + { + $markup = $trimmedMarkup; + $markup = substr($markup, 3); + + $position = strpos($markup, "

"); + + $markup = substr_replace($markup, '', $position, 4); + } + + return $markup; + } + + # + # Deprecated Methods + # + + function parse($text) + { + $markup = $this->text($text); + + return $markup; + } + + # + # Static Methods + # + + static function instance($name = 'default') + { + if (isset(self::$instances[$name])) + { + return self::$instances[$name]; + } + + $instance = new static(); + + self::$instances[$name] = $instance; + + return $instance; + } + + private static $instances = []; + + # + # Fields + # + + protected $DefinitionData; + + # + # Read-Only + + protected $specialCharacters = array( + '\\', '`', '*', '_', '{', '}', '[', ']', '(', ')', '>', '#', '+', '-', '.', '!', '|', + ); + + protected $StrongRegex = array( + '*' => '/^[*]{2}((?:\\\\\*|[^*]|[*][^*]*[*])+?)[*]{2}(?![*])/s', + '_' => '/^__((?:\\\\_|[^_]|_[^_]*_)+?)__(?!_)/us', + ); + + protected $EmRegex = array( + '*' => '/^[*]((?:\\\\\*|[^*]|[*][*][^*]+?[*][*])+?)[*](?![*])/s', + '_' => '/^_((?:\\\\_|[^_]|__[^_]*__)+?)_(?!_)\b/us', + ); + + protected $regexHtmlAttribute = '[a-zA-Z_:][\w:.-]*(?:\s*=\s*(?:[^"\'=<>`\s]+|"[^"]*"|\'[^\']*\'))?'; + + protected $voidElements = array( + 'area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'link', 'meta', 'param', 'source', + ); + + protected $textLevelElements = array( + 'a', 'br', 'bdo', 'abbr', 'blink', 'nextid', 'acronym', 'basefont', + 'b', 'em', 'big', 'cite', 'small', 'spacer', 'listing', + 'i', 'rp', 'del', 'code', 'strike', 'marquee', + 'q', 'rt', 'ins', 'font', 'strong', + 's', 'tt', 'sub', 'mark', + 'u', 'xm', 'sup', 'nobr', + 'var', 'ruby', + 'wbr', 'span', + 'time', + ); +} \ No newline at end of file diff --git a/app/core/puc/vendor/PucReadmeParser.php b/app/core/puc/vendor/PucReadmeParser.php new file mode 100755 index 0000000..40d1bb3 --- /dev/null +++ b/app/core/puc/vendor/PucReadmeParser.php @@ -0,0 +1,348 @@ +parse_readme_contents( $file_contents ); + } + + function parse_readme_contents( $file_contents ) { + $file_contents = str_replace(array("\r\n", "\r"), "\n", $file_contents); + $file_contents = trim($file_contents); + if ( 0 === strpos( $file_contents, "\xEF\xBB\xBF" ) ) + $file_contents = substr( $file_contents, 3 ); + + // Markdown transformations + $file_contents = preg_replace( "|^###([^#]+)#*?\s*?\n|im", '=$1='."\n", $file_contents ); + $file_contents = preg_replace( "|^##([^#]+)#*?\s*?\n|im", '==$1=='."\n", $file_contents ); + $file_contents = preg_replace( "|^#([^#]+)#*?\s*?\n|im", '===$1==='."\n", $file_contents ); + + // === Plugin Name === + // Must be the very first thing. + if ( !preg_match('|^===(.*)===|', $file_contents, $_name) ) + return []; // require a name + $name = trim($_name[1], '='); + $name = $this->sanitize_text( $name ); + + $file_contents = $this->chop_string( $file_contents, $_name[0] ); + + + // Requires at least: 1.5 + if ( preg_match('|Requires at least:(.*)|i', $file_contents, $_requires_at_least) ) + $requires_at_least = $this->sanitize_text($_requires_at_least[1]); + else + $requires_at_least = NULL; + + + // Tested up to: 2.1 + if ( preg_match('|Tested up to:(.*)|i', $file_contents, $_tested_up_to) ) + $tested_up_to = $this->sanitize_text( $_tested_up_to[1] ); + else + $tested_up_to = NULL; + + // Requires PHP: 5.2.4 + if ( preg_match('|Requires PHP:(.*)|i', $file_contents, $_requires_php) ) { + $requires_php = $this->sanitize_text( $_requires_php[1] ); + } else { + $requires_php = null; + } + + // Stable tag: 10.4-ride-the-fire-eagle-danger-day + if ( preg_match('|Stable tag:(.*)|i', $file_contents, $_stable_tag) ) + $stable_tag = $this->sanitize_text( $_stable_tag[1] ); + else + $stable_tag = NULL; // we assume trunk, but don't set it here to tell the difference between specified trunk and default trunk + + + // Tags: some tag, another tag, we like tags + if ( preg_match('|Tags:(.*)|i', $file_contents, $_tags) ) { + $tags = preg_split('|,[\s]*?|', trim($_tags[1])); + foreach ( array_keys($tags) as $t ) + $tags[$t] = $this->sanitize_text( $tags[$t] ); + } else { + $tags = []; + } + + + // Contributors: markjaquith, mdawaffe, zefrank + $contributors = []; + if ( preg_match('|Contributors:(.*)|i', $file_contents, $_contributors) ) { + $temp_contributors = preg_split('|,[\s]*|', trim($_contributors[1])); + foreach ( array_keys($temp_contributors) as $c ) { + $tmp_sanitized = $this->user_sanitize( $temp_contributors[$c] ); + if ( strlen(trim($tmp_sanitized)) > 0 ) + $contributors[$c] = $tmp_sanitized; + unset($tmp_sanitized); + } + } + + + // Donate Link: URL + if ( preg_match('|Donate link:(.*)|i', $file_contents, $_donate_link) ) + $donate_link = esc_url( $_donate_link[1] ); + else + $donate_link = NULL; + + + // togs, conts, etc are optional and order shouldn't matter. So we chop them only after we've grabbed their values. + foreach ( array('tags', 'contributors', 'requires_at_least', 'tested_up_to', 'stable_tag', 'donate_link') as $chop ) { + if ( $$chop ) { + $_chop = '_' . $chop; + $file_contents = $this->chop_string( $file_contents, ${$_chop}[0] ); + } + } + + $file_contents = trim($file_contents); + + + // short-description fu + if ( !preg_match('/(^(.*?))^[\s]*=+?[\s]*.+?[\s]*=+?/ms', $file_contents, $_short_description) ) + $_short_description = array( 1 => &$file_contents, 2 => &$file_contents ); + $short_desc_filtered = $this->sanitize_text( $_short_description[2] ); + $short_desc_length = strlen($short_desc_filtered); + $short_description = substr($short_desc_filtered, 0, 150); + if ( $short_desc_length > strlen($short_description) ) + $truncated = true; + else + $truncated = false; + if ( $_short_description[1] ) + $file_contents = $this->chop_string( $file_contents, $_short_description[1] ); // yes, the [1] is intentional + + // == Section == + // Break into sections + // $_sections[0] will be the title of the first section, $_sections[1] will be the content of the first section + // the array alternates from there: title2, content2, title3, content3... and so forth + $_sections = preg_split('/^[\s]*==[\s]*(.+?)[\s]*==/m', $file_contents, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY); + + $sections = []; + for ( $i=0; $i < count($_sections); $i +=2 ) { + $title = $this->sanitize_text( $_sections[$i] ); + if ( isset($_sections[$i+1]) ) { + $content = preg_replace('/(^[\s]*)=[\s]+(.+?)[\s]+=/m', '$1

$2

', $_sections[$i+1]); + $content = $this->filter_text( $content, true ); + } else { + $content = ''; + } + $sections[str_replace(' ', '_', strtolower($title))] = array('title' => $title, 'content' => $content); + } + + + // Special sections + // This is where we nab our special sections, so we can enforce their order and treat them differently, if needed + // upgrade_notice is not a section, but parse it like it is for now + $final_sections = []; + foreach ( array('description', 'installation', 'frequently_asked_questions', 'screenshots', 'changelog', 'change_log', 'upgrade_notice') as $special_section ) { + if ( isset($sections[$special_section]) ) { + $final_sections[$special_section] = $sections[$special_section]['content']; + unset($sections[$special_section]); + } + } + if ( isset($final_sections['change_log']) && empty($final_sections['changelog']) ) + $final_sections['changelog'] = $final_sections['change_log']; + + + $final_screenshots = []; + if ( isset($final_sections['screenshots']) ) { + preg_match_all('|
  • (.*?)
  • |s', $final_sections['screenshots'], $screenshots, PREG_SET_ORDER); + if ( $screenshots ) { + foreach ( (array) $screenshots as $ss ) + $final_screenshots[] = $ss[1]; + } + } + + // Parse the upgrade_notice section specially: + // 1.0 => blah, 1.1 => fnord + $upgrade_notice = []; + if ( isset($final_sections['upgrade_notice']) ) { + $split = preg_split( '#

    (.*?)

    #', $final_sections['upgrade_notice'], -1, PREG_SPLIT_DELIM_CAPTURE | PREG_SPLIT_NO_EMPTY ); + if ( count($split) >= 2 ) { + for ( $i = 0; $i < count( $split ); $i += 2 ) { + $upgrade_notice[$this->sanitize_text( $split[$i] )] = substr( $this->sanitize_text( $split[$i + 1] ), 0, 300 ); + } + } + unset( $final_sections['upgrade_notice'] ); + } + + // No description? + // No problem... we'll just fall back to the old style of description + // We'll even let you use markup this time! + $excerpt = false; + if ( !isset($final_sections['description']) ) { + $final_sections = array_merge(array('description' => $this->filter_text( $_short_description[2], true )), $final_sections); + $excerpt = true; + } + + + // dump the non-special sections into $remaining_content + // their order will be determined by their original order in the readme.txt + $remaining_content = ''; + foreach ( $sections as $s_name => $s_data ) { + $remaining_content .= "\n

    {$s_data['title']}

    \n{$s_data['content']}"; + } + $remaining_content = trim($remaining_content); + + + // All done! + // $r['tags'] and $r['contributors'] are simple arrays + // $r['sections'] is an array with named elements + $r = array( + 'name' => $name, + 'tags' => $tags, + 'requires_at_least' => $requires_at_least, + 'tested_up_to' => $tested_up_to, + 'requires_php' => $requires_php, + 'stable_tag' => $stable_tag, + 'contributors' => $contributors, + 'donate_link' => $donate_link, + 'short_description' => $short_description, + 'screenshots' => $final_screenshots, + 'is_excerpt' => $excerpt, + 'is_truncated' => $truncated, + 'sections' => $final_sections, + 'remaining_content' => $remaining_content, + 'upgrade_notice' => $upgrade_notice + ); + + return $r; + } + + function chop_string( $string, $chop ) { // chop a "prefix" from a string: Agressive! uses strstr not 0 === strpos + if ( $_string = strstr($string, $chop) ) { + $_string = substr($_string, strlen($chop)); + return trim($_string); + } else { + return trim($string); + } + } + + function user_sanitize( $text, $strict = false ) { // whitelisted chars + if ( function_exists('user_sanitize') ) // bbPress native + return user_sanitize( $text, $strict ); + + if ( $strict ) { + $text = preg_replace('/[^a-z0-9-]/i', '', $text); + $text = preg_replace('|-+|', '-', $text); + } else { + $text = preg_replace('/[^a-z0-9_-]/i', '', $text); + } + return $text; + } + + function sanitize_text( $text ) { // not fancy + $text = strip_tags($text); + $text = esc_html($text); + $text = trim($text); + return $text; + } + + function filter_text( $text, $markdown = false ) { // fancy, Markdown + $text = trim($text); + + $text = call_user_func( array( __CLASS__, 'code_trick' ), $text, $markdown ); // A better parser than Markdown's for: backticks -> CODE + + if ( $markdown ) { // Parse markdown. + if ( !class_exists('Parsedown', false) ) { + /** @noinspection PhpIncludeInspection */ + require_once(dirname(__FILE__) . '/Parsedown' . (version_compare(PHP_VERSION, '5.3.0', '>=') ? '' : 'Legacy') . '.php'); + } + $instance = Parsedown::instance(); + $text = $instance->text($text); + } + + $allowed = array( + 'a' => array( + 'href' => array(), + 'title' => array(), + 'rel' => array()), + 'blockquote' => array('cite' => array()), + 'br' => array(), + 'p' => array(), + 'code' => array(), + 'pre' => array(), + 'em' => array(), + 'strong' => array(), + 'ul' => array(), + 'ol' => array(), + 'li' => array(), + 'h3' => array(), + 'h4' => array() + ); + + $text = balanceTags($text); + + $text = wp_kses( $text, $allowed ); + $text = trim($text); + return $text; + } + + function code_trick( $text, $markdown ) { // Don't use bbPress native function - it's incompatible with Markdown + // If doing markdown, first take any user formatted code blocks and turn them into backticks so that + // markdown will preserve things like underscores in code blocks + if ( $markdown ) + $text = preg_replace_callback("!(
    |)(.*?)(
    |)!s", array( __CLASS__,'decodeit'), $text); + + $text = str_replace(array("\r\n", "\r"), "\n", $text); + if ( !$markdown ) { + // This gets the "inline" code blocks, but can't be used with Markdown. + $text = preg_replace_callback("|(`)(.*?)`|", array( __CLASS__, 'encodeit'), $text); + // This gets the "block level" code blocks and converts them to PRE CODE + $text = preg_replace_callback("!(^|\n)`(.*?)`!s", array( __CLASS__, 'encodeit'), $text); + } else { + // Markdown can do inline code, we convert bbPress style block level code to Markdown style + $text = preg_replace_callback("!(^|\n)([ \t]*?)`(.*?)`!s", array( __CLASS__, 'indent'), $text); + } + return $text; + } + + function indent( $matches ) { + $text = $matches[3]; + $text = preg_replace('|^|m', $matches[2] . ' ', $text); + return $matches[1] . $text; + } + + function encodeit( $matches ) { + if ( function_exists('encodeit') ) // bbPress native + return encodeit( $matches ); + + $text = trim($matches[2]); + $text = htmlspecialchars($text, ENT_QUOTES); + $text = str_replace(array("\r\n", "\r"), "\n", $text); + $text = preg_replace("|\n\n\n+|", "\n\n", $text); + $text = str_replace('&lt;', '<', $text); + $text = str_replace('&gt;', '>', $text); + $text = "$text"; + if ( "`" != $matches[1] ) + $text = "
    $text
    "; + return $text; + } + + function decodeit( $matches ) { + if ( function_exists('decodeit') ) // bbPress native + return decodeit( $matches ); + + $text = $matches[2]; + $trans_table = array_flip(get_html_translation_table(HTML_ENTITIES)); + $text = strtr($text, $trans_table); + $text = str_replace('
    ', '', $text); + $text = str_replace('&', '&', $text); + $text = str_replace(''', "'", $text); + if ( '
    ' == $matches[1] )
    +			$text = "\n$text\n";
    +		return "`$text`";
    +	}
    +
    +} // end class
    +
    +endif;
    diff --git a/app/core/src/Attendees/Attendee.php b/app/core/src/Attendees/Attendee.php
    new file mode 100755
    index 0000000..e17daae
    --- /dev/null
    +++ b/app/core/src/Attendees/Attendee.php
    @@ -0,0 +1,120 @@
    +set_data( $data );
    +    }
    +
    +    /**
    +     * @param array $data
    +     */
    +    public function set_data( $data ){
    +
    +        $this->data = [
    +            'attendee_id' => isset($data['attendee_id']) ? $data['attendee_id'] : '',
    +            'post_id' => isset($data['post_id']) ? $data['post_id'] : '',
    +            'event_id' => isset($data['event_id']) ? $data['event_id'] : '',
    +            'occurrence' => isset($data['occurrence']) ? $data['occurrence'] : '',
    +            'first_name' => isset($data['first_name']) ? $data['first_name'] : '',
    +            'last_name' => isset($data['last_name']) ? $data['last_name'] : '',
    +            'email' => isset($data['email']) ? $data['email'] : '',
    +            'count' => isset($data['count']) && $data['count'] ? $data['count'] : 1,
    +            'reg' => isset($data['reg']) && is_array($data['reg']) ? $data['reg'] : [],
    +        ];
    +    }
    +
    +    /**
    +     * @param string $key
    +     * @return mixed
    +     */
    +    public function get_data( $key = null ){
    +
    +        return !is_null( $key ) ? $this->data[$key] : $key;
    +    }
    +
    +    /**
    +     * @return int
    +     */
    +    public function get_id(){
    +
    +        return $this->get_data( 'attendee_id' );
    +    }
    +
    +    /**
    +     * @return int
    +     */
    +    public function get_event_id(){
    +
    +        return $this->get_data( 'event_id' );
    +    }
    +
    +    /**
    +     * @return int
    +     */
    +    public function get_occurrence_id(){
    +
    +        return $this->get_data( 'occurrence' );
    +    }
    +
    +    /**
    +     * @return string
    +     */
    +    public function get_email(){
    +
    +        return $this->get_data( 'email' );
    +    }
    +
    +    /**
    +     * @return string
    +     */
    +    public function get_first_name(){
    +
    +        return $this->get_data( 'first_name' );
    +    }
    +
    +    /**
    +     * @return string
    +     */
    +    public function get_last_name(){
    +
    +        return $this->get_data( 'last_name' );
    +    }
    +
    +    /**
    +     * @return string
    +     */
    +    public function get_name(){
    +
    +        return $this->get_first_name().' '.$this->get_last_name();
    +    }
    +
    +    /**
    +     * @return int
    +     */
    +    public function get_count(){
    +
    +        return $this->get_data( 'count' );
    +    }
    +
    +    /**
    +     * @return int
    +     */
    +    public function get_reg_data(){
    +
    +        return $this->get_data( 'reg' );
    +    }
    +}
    \ No newline at end of file
    diff --git a/app/core/src/Attendees/Attendees.php b/app/core/src/Attendees/Attendees.php
    new file mode 100755
    index 0000000..55fd83a
    --- /dev/null
    +++ b/app/core/src/Attendees/Attendees.php
    @@ -0,0 +1,593 @@
    +tbl = $wpdb->prefix.'mec_attendees';
    +    }
    +
    +    private function get_where( $conditions = array()){
    +
    +        $where = "1";
    +
    +        if( !is_array($conditions) || empty($conditions) ){
    +
    +            return $where;
    +        }
    +
    +        global $wpdb;
    +        foreach($conditions as $k => $v){
    +
    +            switch($k){
    +
    +                case 'post_id':
    +                case 'event_id':
    +                case 'occurrence':
    +                case 'email':
    +                case 'first_name':
    +                case 'last_name':
    +                case 'count':
    +                case 'verification':
    +                case 'confirmation':
    +                    if($v){
    +
    +                        if( is_array( $v ) && !isset( $v['compare'] ) ){
    +
    +                            $v = is_array($v) ? "'" . implode("','",$v) . "'" : $v;
    +                            $where .= " AND `{$k}` IN (".$v.")";
    +                        }elseif( is_array( $v ) && isset( $v['compare'] ) ){
    +
    +                            $compare = isset( $v['compare'] ) ? $v['compare'] : 'IN';
    +                            $v = isset( $v['value'] ) ? $v['value'] : false;
    +                            if( !$v ){
    +
    +                                break;
    +                            }
    +
    +                            $v = is_array($v) ? "'" . implode("','",$v) . "'" : $v;
    +                            $where .= " AND `{$k}` {$compare} (".$v.")";
    +                        } else {
    +
    +                            $where .= $wpdb->prepare(
    +                                " AND `{$k}` = '%s'",
    +                                $v
    +                            );
    +                        }
    +                    }
    +                break;
    +
    +
    +            }
    +        }
    +
    +        return $where;
    +    }
    +
    +    public function get_rows( $conditions, $fields = '*' ){
    +
    +        global $wpdb;
    +        $where = $this->get_where( $conditions );
    +
    +        $fields = is_array($fields) && !empty($fields) ? "`" . implode( '`,`', $fields ) . "`" : $fields;
    +        $fields = !empty($fields) ? $fields : '*';
    +
    +        $sql = "SELECT {$fields} FROM {$this->tbl} WHERE {$where}";
    +
    +        return $wpdb->get_results($sql,ARRAY_A);
    +    }
    +
    +    public function _get_attendees( $conditions = array(), $return_by_post_and_occurrence_data = false ){
    +
    +        $rows = $this->get_rows( $conditions);
    +
    +        $attendees = [];
    +        if(!empty($rows) && is_array($rows)){
    +
    +            foreach( $rows as $row ){
    +
    +                $attendee_id = $row['attendee_id'];
    +                $data = maybe_unserialize($row['data']);
    +
    +                $attendee = [
    +                    'post_id' => $row['post_id'],
    +                    'attendee_id' => $attendee_id,
    +                    'first_name' => $row['first_name'],
    +                    'last_name' => $row['last_name'],
    +                    'name' => $row['first_name'] .' '.$row['last_name'],
    +                    'email' => $row['email'],
    +                    'count' => $row['count'],
    +                    'verification' => $row['verification'],
    +                    'confirmation' => $row['confirmation'],
    +                    'reg' => is_array($data) ? $data : [],
    +                ];
    +
    +                if($return_by_post_and_occurrence_data){
    +
    +                    $attendee['post_id'] = $row['post_id'];
    +                    $attendee['event_id'] = $row['event_id'];
    +                    $attendee['occurrence'] = $row['occurrence'];
    +                }
    +
    +                $attendees[$attendee_id] = $attendee;
    +            }
    +        }
    +
    +        return $attendees;
    +    }
    +
    +    private function _insert( $attendee_data ){
    +
    +        global $wpdb;
    +        $attendee = [
    +            'post_id' => (int)$attendee_data['post_id'],
    +            'event_id' => (int)$attendee_data['event_id'],
    +            'occurrence' => (int)$attendee_data['occurrence'],
    +            'email' => $attendee_data['email'],
    +            'first_name' => $attendee_data['first_name'],
    +            'last_name' => $attendee_data['last_name'],
    +            'data' => $attendee_data['data'],
    +            'count' => isset($attendee_data['count']) && $attendee_data['count'] > 0 ? (int)$attendee_data['count'] : 1,
    +            'verification' => isset($attendee_data['verification']) ? $attendee_data['verification'] : 0,
    +            'confirmation' => isset($attendee_data['confirmation']) ? $attendee_data['confirmation'] : 0,
    +        ];
    +
    +        $v_type = ['%d','%d','%d','%s','%s','%s','%s','%d','%d','%d'];
    +
    +        return $wpdb->insert($this->tbl, $attendee, $v_type );
    +    }
    +
    +    private function _update( $attendee_data, $where ){
    +
    +        if(empty($where)){
    +
    +            return false;
    +        }
    +
    +        global $wpdb;
    +
    +        $attendee = [
    +            'post_id' => '',
    +            'event_id' => '',
    +            'occurrence' => '',
    +            'email' => '',
    +            'first_name' => '',
    +            'last_name' => '',
    +            'data' => '',
    +            'count' => '',
    +            'verification' => '',
    +            'confirmation' => '',
    +
    +        ];
    +
    +        $v_type = ['%d','%d','%d','%s','%s','%s','%s','%d','%d','%d'];
    +
    +        foreach($attendee as $k => $v){
    +
    +            switch($k){
    +
    +                case 'post_id':
    +                case 'event_id':
    +                case 'occurrence':
    +                case 'email':
    +                case 'first_name':
    +                case 'last_name':
    +                case 'count':
    +                case 'verification':
    +                case 'confirmation':
    +                case 'data':
    +                    if(isset($attendee_data[$k])){
    +
    +                        $attendee[$k] = $attendee_data[$k];
    +                    }else{
    +
    +                        unset($attendee[$k]);
    +                    }
    +                break;
    +            }
    +        }
    +
    +        return $wpdb->update($this->tbl, $attendee, $where, $v_type );
    +    }
    +
    +    private function _delete( $conditions ){
    +
    +        global $wpdb;
    +        return $wpdb->delete($this->tbl,$conditions);
    +    }
    +
    +    private function _add_or_update( $attendee ){
    +
    +        $post_id = isset($attendee['post_id']) ? (int)$attendee['post_id'] : 0;
    +        $event_id = isset($attendee['event_id']) ? (int)$attendee['event_id'] : 0;
    +        $occurrence = isset($attendee['occurrence']) ? (int)$attendee['occurrence'] : 0;
    +        $attendee['email'] =  isset($attendee['email']) ? sanitize_email($attendee['email']) : 0;
    +        $email = $attendee['email'];
    +        $first_name = isset($attendee['first_name']) ? sanitize_text_field( $attendee['first_name']) : '';
    +        $last_name = isset($attendee['last_name']) ? sanitize_text_field( $attendee['last_name']) : '';
    +
    +        if( !$post_id || !$event_id || !$occurrence || !$email ){
    +
    +            return false;
    +        }
    +
    +        $attendee['data'] = isset($attendee['data']) ? serialize($attendee['data']) : '';
    +        $existed = $this->is_existed( $post_id, $event_id, $occurrence, $email, $first_name, $last_name );
    +
    +        if( !$existed ){
    +
    +            $r = $this->_insert($attendee);
    +        }elseif( $existed ){
    +
    +            $where['attendee_id'] = $existed;
    +            $r = $this->_update($attendee, $where);
    +        }
    +
    +        return $r;
    +    }
    +
    +    public function get_attendees( $post_id, $event_id, $occurrence, $return_cached = true ){
    +
    +        $cached = $return_cached ? $this->get_cache( $post_id, $event_id, $occurrence ) : false;
    +        if( $cached ){
    +
    +            return $cached;
    +        }
    +
    +        $conditions = [
    +            'post_id' => $post_id,
    +            'event_id' => $event_id,
    +            'occurrence' => $occurrence,
    +        ];
    +
    +        $attendees = $this->_get_attendees( $conditions );
    +        $this->update_cache( $post_id, $event_id, $occurrence, $attendees );
    +
    +        return $attendees;
    +    }
    +
    +    public function is_existed( $post_id, $event_id, $occurrence, $email, $first_name, $last_name ){
    +
    +        $conditions = [
    +            'post_id' => $post_id,
    +            'event_id' => $event_id,
    +            'occurrence' => $occurrence,
    +            'email' => $email,
    +            'first_name' => $first_name,
    +            'last_name' => $last_name,
    +        ];
    +
    +        $r = $this->_get_attendees($conditions);
    +
    +        if(count($r)){
    +
    +            return key($r);
    +        }
    +
    +        return false;
    +    }
    +
    +    public function add_or_update( $post_id, $event_id, $occurrence, $attendees ){
    +
    +        $success = null;
    +        if( !$post_id || !$event_id || !$occurrence || !is_array($attendees) ){
    +
    +            return false;
    +        }
    +
    +        $new_attendees = [];
    +        foreach( $attendees as $attendee ){
    +
    +            $email = isset($attendee['email']) ? sanitize_email($attendee['email']) : 0;
    +            $first_name = isset($attendee['first_name']) ? sanitize_text_field( $attendee['first_name'] ) : '';
    +            $last_name = isset($attendee['last_name']) ? sanitize_text_field( $attendee['last_name'] ) : '';
    +            if(!$email){
    +
    +                continue;
    +            }
    +
    +            $data = isset($attendee['data']) ? (array)$attendee['data'] : [];
    +            $data = empty($data) && isset($attendee['reg']) ? (array)$attendee['reg'] : $data;
    +            unset($data['reg']);
    +
    +            $attendee['post_id'] = $post_id;
    +            $attendee['event_id'] = $event_id;
    +            $attendee['occurrence'] = $occurrence;
    +            $attendee['data'] = $data;
    +            $attendee['count'] = 1;
    +
    +
    +            $na_key = "{$email}-{$first_name}-{$last_name}";
    +            if(isset($new_attendees[ $na_key ])){
    +
    +                $new_attendees[ $na_key ]['count']++;
    +
    +                continue;
    +            }
    +
    +            $new_attendees[ $na_key ] = $attendee;
    +        }
    +
    +        foreach( $new_attendees as $attendee ){
    +
    +            $s = $this->_add_or_update( $attendee );
    +            $success = !is_null($success) ? $success : true;
    +            $success = $success && $s;
    +        }
    +
    +        $this->clear_cache( $post_id, $event_id, $occurrence );
    +
    +        return $success;
    +    }
    +
    +    public function remove_other_attendees( $post_id, $event_id, $occurrence ) {
    +
    +        global $wpdb;
    +        $sql = $wpdb->prepare(
    +            "DELETE FROM `%1s` where `post_id` = %2s && ( `event_id` != %3s || `occurrence` != %4s )",
    +            $this->tbl,
    +            $post_id,
    +            $event_id,
    +            $occurrence
    +        );
    +
    +        $wpdb->query( $sql );
    +    }
    +
    +    public function update_attendees( $post_id, $event_id, $occurrence, $attendees ){
    +
    +        if( !$post_id || !$event_id || !$occurrence || !is_array($attendees) ){
    +
    +            return false;
    +        }
    +
    +        $this->remove_other_attendees( $post_id, $event_id, $occurrence );
    +
    +        $saved_attendees = $this->get_attendees( $post_id, $event_id, $occurrence, false );
    +        $saved_attendees_keys = [];
    +        foreach( $saved_attendees as $saved_attendee ) {
    +
    +            $email = isset($saved_attendee['email']) ? sanitize_email($saved_attendee['email']) : 0;
    +            $first_name = isset($saved_attendee['first_name']) ? sanitize_text_field( $saved_attendee['first_name'] ) : '';
    +            $last_name = isset($saved_attendee['last_name']) ? sanitize_text_field( $saved_attendee['last_name'] ) : '';
    +            $attendee_id = $saved_attendee['attendee_id'] ?? 0;
    +
    +            $sa_key = "{$email}-{$first_name}-{$last_name}";
    +
    +            $saved_attendees_keys[ $attendee_id ] = $sa_key;
    +        }
    +
    +        foreach( $attendees as $_a_key => $attendee ) {
    +
    +            $email = isset($attendee['email']) ? sanitize_email($attendee['email']) : 0;
    +            $first_name = isset($attendee['first_name']) ? sanitize_text_field( $attendee['first_name'] ) : '';
    +            $last_name = isset($attendee['last_name']) ? sanitize_text_field( $attendee['last_name'] ) : '';
    +
    +            $a_key = "{$email}-{$first_name}-{$last_name}";
    +
    +            $attendees_keys[ $_a_key ] = $a_key;
    +        }
    +
    +        foreach( $saved_attendees_keys as $attendee_id => $attendee_key ){
    +
    +            $saved_attendee_id = array_search( $attendee_key, $attendees_keys );
    +            if( false === $saved_attendee_id ){
    +
    +                $conditions = [
    +                    'attendee_id' => $attendee_id,
    +                ];
    +                $this->_delete($conditions);
    +            }
    +        }
    +
    +        return $this->add_or_update( $post_id, $event_id, $occurrence , $attendees );
    +    }
    +
    +    public function update_attendee_status( $status_key, $status, $post_id, $email = null, $event_id = null, $occurrence = null ){
    +
    +        if( !in_array( $status_key, [ 'confirmation', 'verification' ] ) ){
    +
    +            return;
    +        }
    +
    +        $conditions = [
    +            'post_id' => $post_id,
    +            'event_id' => $event_id,
    +            'occurrence' => $occurrence,
    +            'email' => $email,
    +        ];
    +
    +        $attendees = $this->_get_attendees( $conditions, true );
    +
    +        foreach( $attendees as $k => $attendee ){
    +
    +            $attendee_id = $attendee['attendee_id'];
    +
    +            if(!$attendee_id){
    +
    +                continue;
    +            }
    +
    +            $saved_status = $attendee[$status_key];
    +            if( $status === $saved_status ){
    +
    +                unset($attendees[$k]);
    +                continue;
    +            }
    +
    +            $attendee[$status_key] = (int)$status;
    +            $where = array(
    +                'attendee_id' => $attendee_id
    +            );
    +
    +            $this->_update( $attendee , $where );
    +        }
    +    }
    +
    +    public function update_confirmation_status( $status, $post_id, $email = null, $event_id = null, $occurrence = null ){
    +
    +        return $this->update_attendee_status( 'confirmation', $status, $post_id, $email, $event_id, $occurrence );
    +    }
    +
    +    public function update_verification_status( $status, $post_id, $email = null, $event_id = null, $occurrence = null ){
    +
    +        return $this->update_attendee_status( 'verification', $status, $post_id, $email, $event_id, $occurrence );
    +    }
    +
    +    public function delete( $post_id, $email = null, $event_id = null, $occurrence = null ){
    +
    +        $conditions['post_id'] = $post_id;
    +
    +        if( !is_null($email) ){
    +
    +            $conditions['email'] = $email;
    +        }
    +
    +        if( !is_null($event_id) ){
    +
    +            $conditions['event_id'] = $event_id;
    +        }
    +
    +        if( !is_null($occurrence) ){
    +
    +            $conditions['occurrence'] = $occurrence;
    +        }
    +
    +        $this->_delete( $conditions );
    +    }
    +
    +    public function get_attendees_emails( $post_id = null, $event_id = null, $occurrence = null, $confirmation = null, $verification = null ){
    +
    +        $conditions = [];
    +
    +        if( !is_null($post_id) ){
    +
    +            $conditions['post_id'] = $post_id;
    +        }
    +
    +        if( !is_null($event_id) ){
    +
    +            $conditions['event_id'] = $event_id;
    +        }
    +
    +        if( !is_null($occurrence) ){
    +
    +            $conditions['occurrence'] = $occurrence;
    +        }
    +
    +        if( !is_null($confirmation) ){
    +
    +            $conditions['confirmation'] = $confirmation;
    +        }
    +
    +        if( !is_null($verification) ){
    +
    +            $conditions['verification'] = $verification;
    +        }
    +
    +        $emails = $this->get_rows($conditions,'email');
    +        $emails = array_column( $emails, 'email' );
    +
    +        $emails = array_unique($emails);
    +
    +        return $emails;
    +    }
    +
    +    /**
    +     * @param string $email
    +     * @param int $post_id
    +     * @param int $event_id
    +     * @param int $occurrence
    +     * @return array|int
    +     */
    +    public function get_total_attendees_group_by_email( $email = null, $post_id = null, $event_id = null, $occurrence = null, $exclude_post_ids = [], $confirmation = 1, $verification = 1 ){
    +
    +        $conditions = [];
    +
    +        if( !is_null($email) ){
    +
    +            $conditions['email'] = $email;
    +        }
    +
    +        if( !is_null($post_id) ){
    +
    +            $conditions['post_id'] = $post_id;
    +        }
    +
    +        if( !is_null($event_id) ){
    +
    +            $conditions['event_id'] = $event_id;
    +        }
    +
    +        if( !is_null($occurrence) ){
    +
    +            $conditions['occurrence'] = $occurrence;
    +        }
    +
    +        if($exclude_post_ids){
    +
    +            $exclude_post_ids = is_array($exclude_post_ids) ? $exclude_post_ids : explode(',',$exclude_post_ids);
    +            $conditions['post_id'] = [
    +                'compare' => 'NOT IN',
    +                'value' => $exclude_post_ids,
    +            ];
    +        }
    +
    +        if( !is_null($confirmation) ){
    +
    +            $conditions['confirmation'] = $confirmation;
    +        }
    +
    +        if( !is_null($verification) ){
    +
    +            $conditions['verification'] = $verification;
    +        }
    +
    +        $total_used_emails = [];
    +        $rows = $this->get_rows($conditions,'`email`,`count`');
    +
    +        foreach($rows as $row){
    +
    +            $r_email = $row['email'];
    +            $r_count = $row['count'];
    +
    +            if( !isset( $total_used_emails[ $r_email ] ) ){
    +                $total_used_emails[ $r_email ] = 0;
    +            }
    +
    +            $total_used_emails[ $r_email ] += $r_count;
    +        }
    +
    +        if(empty($email)){
    +
    +            return $total_used_emails;
    +        }
    +
    +        return isset($total_used_emails[$email]) ? (int)$total_used_emails[$email] : 0;
    +    }
    +
    +    public function get_cache( $post_id, $event_id, $occurrence ){
    +
    +        $cache_key = 'mec-attendees-'.$post_id.'-'.$event_id.'-'.$occurrence;
    +        return get_transient( $cache_key );
    +    }
    +
    +    public function update_cache( $post_id, $event_id, $occurrence, $attendees ){
    +
    +        $cache_key = 'mec-attendees-'.$post_id.'-'.$event_id.'-'.$occurrence;
    +        set_transient( $cache_key, $attendees, 3600 );
    +    }
    +
    +    public function clear_cache( $post_id, $event_id, $occurrence ){
    +
    +        $cache_key = 'mec-attendees-'.$post_id.'-'.$event_id.'-'.$occurrence;
    +        delete_transient( $cache_key );
    +    }
    +}
    \ No newline at end of file
    diff --git a/app/core/src/Attendees/AttendeesTable.php b/app/core/src/Attendees/AttendeesTable.php
    new file mode 100755
    index 0000000..b782d1c
    --- /dev/null
    +++ b/app/core/src/Attendees/AttendeesTable.php
    @@ -0,0 +1,70 @@
    +prefix . self::$tbl;
    +        $db_option_key = 'mec_table_version_'.$attendees_table_name;
    +
    +        $tables = $wpdb->get_results("SHOW TABLES");
    +        $tables_group = "Tables_in_".DB_NAME;
    +        $tables = array_column($tables,$tables_group);
    +        $table_exists = array_search($attendees_table_name,$tables);
    +
    +        if(false === $table_exists){
    +
    +            $charset = $wpdb->get_charset_collate();
    +            $sql = "CREATE TABLE IF NOT EXISTS `{$attendees_table_name}` (
    +                `attendee_id` bigint(20) NOT NULL AUTO_INCREMENT,
    +                `post_id` bigint(20) NOT NULL,
    +                `event_id` bigint(20) NOT NULL,
    +                `occurrence` int(11) NOT NULL,
    +                `email` varchar(50) NOT NULL,
    +                `first_name` varchar(50) NOT NULL,
    +                `last_name` varchar(50) NOT NULL,
    +                `data` text NULL,
    +                `count` int(11) DEFAULT 1,
    +                `verification` int(1) DEFAULT 0,
    +                `confirmation` int(1) DEFAULT 0,
    +                PRIMARY KEY (`attendee_id`)
    +            ){$charset}";
    +
    +            dbDelta( $sql );
    +
    +            update_option( $db_option_key, static::$version );
    +        }else{
    +
    +            $db_version = get_option( $db_option_key, '1.0.0' );
    +
    +            if( version_compare($db_version, '1.1.0', '<') ){
    +
    +                $wpdb->query( "ALTER TABLE `{$attendees_table_name}` CHANGE  IF EXISTS `name` `first_name` varchar(50) NOT NULL;" );
    +                $wpdb->query( "ALTER TABLE `{$attendees_table_name}` ADD IF NOT EXISTS `last_name` varchar(50) NOT NULL AFTER `first_name`;" );
    +                $wpdb->query( "ALTER TABLE `{$attendees_table_name}` ADD IF NOT EXISTS `verification` int(1) NOT NULL DEFAULT 0 AFTER `count`;" );
    +                $wpdb->query( "ALTER TABLE `{$attendees_table_name}` ADD  IF NOT EXISTS `confirmation` int(1) NOT NULL DEFAULT 0 AFTER `verification`;" );
    +
    +                update_option( $db_option_key, '1.1.0' );
    +            }
    +
    +
    +            update_option( $db_option_key, static::$version );
    +        }
    +
    +
    +
    +
    +
    +    }
    +}
    \ No newline at end of file
    diff --git a/app/core/src/Attendees/index.php b/app/core/src/Attendees/index.php
    new file mode 100755
    index 0000000..9d7a83d
    --- /dev/null
    +++ b/app/core/src/Attendees/index.php
    @@ -0,0 +1,5 @@
    +define();
    +		$this->includes();
    +		$this->init_hooks();
    +		$this->admin();
    +		$this->enqueue_scripts();
    +	}
    +
    +	/**
    +	 * MEC Instance
    +	 *
    +	 * @return self()
    +	 */
    +	public static function instance() {
    +
    +		if ( is_null( self::$instance ) ) {
    +			self::$instance = new self();
    +		}
    +
    +		return self::$instance;
    +	}
    +
    +	/**
    +	 * Set Constants
    +	 *
    +	 * @return void
    +	 */
    +	public function define() {
    +
    +		define( 'MEC_CORE_PD', plugin_dir_path( MEC_CORE_FILE ) );
    +		define( 'MEC_CORE_PDI', plugin_dir_path( MEC_CORE_FILE ) . 'src/' );
    +		define( 'MEC_CORE_PU_JS', plugins_url( 'assets/js/', MEC_CORE_FILE ) );
    +		define( 'MEC_CORE_PU_CSS', plugins_url( 'assets/css/', MEC_CORE_FILE ) );
    +		define( 'MEC_CORE_PU_IMG', plugins_url( 'assets/img/', MEC_CORE_FILE ) );
    +		define( 'MEC_CORE_PU_FONTS', plugins_url( 'assets/fonts/', MEC_CORE_FILE ) );
    +		define( 'MEC_CORE_TEMPLATES', plugin_dir_path( MEC_CORE_FILE ) . 'templates/' );
    +	}
    +
    +	/**
    +	 * Include Files
    +	 *
    +	 * @return void
    +	 */
    +	public function includes() {
    +
    +	}
    +
    +
    +	/**
    +	 * Include Files If is Admin
    +	 *
    +	 * @return void
    +	 */
    +	public function admin() {
    +
    +		if ( !is_admin() ) {
    +			return;
    +		}
    +
    +		FlushNotices::getInstance()->init();
    +	}
    +
    +
    +	/**
    +	 * Register actions enqueue scripts
    +	 *
    +	 * @return void
    +	 */
    +	public function enqueue_scripts() {
    +
    +
    +	}
    +
    +	/**
    +	 * Add Hooks - Actions and Filters
    +	 *
    +	 * @return void
    +	 */
    +	public function init_hooks() {
    +
    +		add_action( 'admin_notices', array( $this, 'upgrade_notice') );
    +		add_action('wp_ajax_mec-upgrade-transactions-in-db', array( __CLASS__, 'upgrade_transactions_db_by_ajax' ) );
    +
    +		add_action( 'init', [ $this, 'init' ] );
    +
    +		register_activation_hook( MEC_CORE_FILE, __CLASS__ . '::register_activation' );
    +		$db_version = get_option('mec_core_db','1.0.0');
    +		if(version_compare($db_version, '6.10.0', '<')){
    +
    +			static::register_activation();
    +		}
    +	}
    +
    +	/**
    +	 * Active Plugin
    +	 *
    +	 * @return void
    +	 */
    +	public static function register_activation() {
    +
    +		AttendeesTable::create_table();
    +
    +		update_option('mec_core_db',MEC_VERSION);
    +	}
    +
    +
    +	/**
    +	 * Init MEC after WordPress
    +	 *
    +	 * @return void
    +	 */
    +	public function init() {
    +
    +	}
    +
    +	public static function should_include_assets(){
    +
    +        $factory = \MEC::getInstance('app.libraries.factory');
    +
    +        return $factory->should_include_assets('frontend');
    +    }
    +
    +	public static function is_include_assets_in_footer(){
    +
    +        return '1' == \MEC\Settings\Settings::getInstance()->get_settings('assets_in_footer_status') ? true : false;
    +    }
    +
    +	public static function get_main(){
    +
    +		global $MEC_Main;
    +		if(is_null($MEC_Main)){
    +
    +			$MEC_Main = new \MEC_main();
    +		}
    +
    +		return $MEC_Main;
    +	}
    +
    +	/**
    +	 * Upgrade transactions in db
    +	 *
    +	 * @return void
    +	 */
    +	public static function upgrade_transactions() {
    +
    +		$db_version = get_option( 'mec_transaction_version', '1.0.0' );
    +		if( version_compare( $db_version, MEC_VERSION, '<' ) ) {
    +
    +			if( current_user_can('activate_plugins') ) {
    +
    +				\MEC\Transactions\Transaction::upgrade_db();
    +			}
    +		}
    +	}
    +
    +	/**
    +	 * Upgrade transactions in db by ajax
    +	 *
    +	 * @return void
    +	 */
    +	public static function upgrade_transactions_db_by_ajax() {
    +
    +		if( !isset( $_POST['nonce'] ) || !wp_verify_nonce( $_POST['nonce'], 'mec-upgrade-transactions-in-db' ) ) {
    +
    +			return;
    +		}
    +
    +		$db_version = get_option( 'mec_transaction_version', '1.0.0' );
    +		if( version_compare( $db_version, '6.10.0', '<' ) ) {
    +
    +			static::upgrade_transactions();
    +			wp_send_json(array(
    +				'done' => false,
    +			));
    +		}else{
    +
    +			wp_send_json(array(
    +				'done' => true,
    +			));
    +		}
    +	}
    +
    +	public function upgrade_notice($type = false) {
    +
    +		$booking_module_status = (bool)\MEC\Settings\Settings::getInstance()->get_settings('booking_status');
    +		$db_version = get_option( 'mec_transaction_version', '1.0.0' );
    +		if( version_compare( $db_version, '6.10.0', '<' ) && $booking_module_status ) {
    +
    +			if (!current_user_can('activate_plugins')) {
    +				return;
    +			}
    +
    +			$upgrade_url = admin_url( '?mec_upgrade_db=true' );
    +			$message        = '

    ' + . __('Your booking database needs updating. To do that, click the button below and wait until the operation is over. Do not refresh the page until the end.', 'modern-events-calendar-lite') + . '
    ' . __('Note: if you have many bookings, the operation might take longer, please be patient.', 'modern-events-calendar-lite') . '' + . '

    '; + $message .= '

    ' . sprintf('%s', $upgrade_url, __('Upgrade Database Now', 'modern-events-calendar-lite')) . '

    '; + + ?> + +
    +

    +
    + + + get_event_mec( $event ); + $event = $events[0]; + } + + $form_title = $args['form_title'] ?? esc_html__("Attendee's Form", 'modern-events-calendar-lite'); + $date_ex = explode(':', $date); + $occurrence = $date_ex[0]; + + $mec_settings = \MEC\Settings\Settings::getInstance()->get_settings(); + $bookClass = \MEC\Base::get_main()->getBook(); + + $event_id = $event->ID; + $translated_event_id = (isset($_REQUEST['translated_event_id']) ? sanitize_text_field($_REQUEST['translated_event_id']) : 0); + $requested_event_id = $event->requested_id ?? $event_id; + + $mec_email = false; + $mec_name = false; + foreach($reg_fields as $field) { + + if(isset($field['type'])) { + + if($field['type'] == 'mec_email') $mec_email = true; + if($field['type'] == 'name') $mec_name = true; + } + else break; + } + + if(!$mec_name) { + + $reg_fields[] = array( + 'mandatory' => '0', + 'type' => 'name', + 'label' => esc_html__('Name', 'modern-events-calendar-lite'), + ); + } + + if(!$mec_email) { + $reg_fields[] = array( + 'mandatory' => '0', + 'type' => 'mec_email', + 'label' => esc_html__('Email', 'modern-events-calendar-lite'), + ); + } + + $fees = $bookClass->get_fees($event_id); + + $step_skipped = (isset($_REQUEST['do_skip']) ? sanitize_text_field($_REQUEST['do_skip']) : 0); + + // WC System + $WC_status = (isset($mec_settings['wc_status']) and $mec_settings['wc_status'] and class_exists('WooCommerce')); + if($WC_status) $fees = []; + + // MEC Card + $cart_status = (isset($mec_settings['mec_cart_status']) and $mec_settings['mec_cart_status']); + if($cart_status) $WC_status = false; + + $total_ticket_prices = 0; + $check_free_tickets_booking = apply_filters('check_free_tickets_booking', 1); + $has_fees = (bool) count($fees); + + $current_user = wp_get_current_user(); + $first_for_all = (!isset($mec_settings['booking_first_for_all']) || $mec_settings['booking_first_for_all'] == 1); + + // Username & Password Method + $booking_register = !((isset($mec_settings['booking_registration']) and !$mec_settings['booking_registration'])); + $booking_userpass = (isset($mec_settings['booking_userpass']) and trim($mec_settings['booking_userpass'])) ? $mec_settings['booking_userpass'] : 'auto'; + + // Lock Pre-filled Fields + $lock_prefilled = isset($mec_settings['booking_lock_prefilled']) && trim($mec_settings['booking_lock_prefilled']) != '' ? $mec_settings['booking_lock_prefilled'] : 0; + + // Attendee Counter + $attendee_counter = (isset($mec_settings['attendee_counter']) and $mec_settings['attendee_counter']) ? $mec_settings['attendee_counter'] : ''; + + $display_progress_bar = \MEC\Base::get_main()->can_display_booking_progress_bar($mec_settings); + + $event_tickets = $event->data->tickets ?? []; + + foreach ($tickets as $ticket_id => $count) { + + if (!$count) continue; + $ticket = $event_tickets[$ticket_id]; + + for($p = 1; $p <= $count; $p++) { + + $ticket_price = $bookClass->get_ticket_price($ticket, current_time('Y-m-d'), $event_id, $occurrence); + if(is_numeric($ticket_price)) $total_ticket_prices += $ticket_price; + } + } + + if(isset($all_dates) and count($all_dates)) { + + $total_ticket_prices = $total_ticket_prices * count($all_dates); + } + + static::enqueue(); + + ?> +
    + + +
      +
    • +
    • + +
    • + +
    • +
    • + +
    + +

    + + +
    +
    svg('form/subtotal-icon'); ?>
    +
    +
    + + render_price($total_ticket_prices, $requested_event_id)); ?> +
    +
    +
    + +
      + +
    + +
      + + $count) : if (!$count) continue; + $ticket = $event_tickets[$ticket_id]; + for ($i = 1; $i <= $count; $i++) : + ?> +
    • + + + get_ticket_price_label($ticket, current_time('Y-m-d'), $event_id, $occurrence))): ?> +
      +
      svg('form/ticket-icon'); ?>
      +
      +

      + + +

      + get_ticket_price_label($ticket, current_time('Y-m-d'), $event_id, $occurrence); + $ticket_price = apply_filters('mec_filter_ticket_price_label', $ticket_price, $ticket, $event_id, $bookClass); + ?> +
      + + +
      +
      +
      + + + +
        + $lock_prefilled + ] ); ?> +
      + + + ticket_variations($event_id, $ticket_id, $translated_event_id); + + if($WC_status) $ticket_variations = []; + if(\MEC\Base::get_main()->has_variations_per_ticket($event_id, $ticket_id)) $first_for_all = false; + + $has_variations = (bool) count($ticket_variations); + ?> + $ticket_variation): if(!is_numeric($ticket_variation_id) || !isset($ticket_variation['title']) || !trim($ticket_variation['title'])) continue; ?> +
      +
      +
      render_price($ticket_variation['price'], $requested_event_id)); ?>
      + +
      +
      + + + + +
    • + + +
    + + 1 and $first_for_all) : ?> +
    + +
    + + + +
    +

    +
      +
    • + + +
    • +
    • + + +
    • +
    +
    + + +
    + + + + + + + + + + + + + + + + + + + + +
    + + + + +
    +
    + + + $field ) : + + if(in_array($f_id, [':i:',':fi:','_i_','_fi_',], true)){ + + continue; + } + + $type = $field['type'] ?? false; + if ( false === $type ) { + continue; + } + + $j = !is_null($j) ? $j : $f_id; + $field_id = !empty($field['key']) ? $field['key'] : $f_id; + $html_id = 'mec_field_' . $group_id . '_' . $type . '_' . $j; + $required = ( ( isset( $field['required'] ) && $field['required'] ) || ( isset( $field['mandatory'] ) && $field['mandatory'] ) ) ? 'required="required"' : ''; + $field_label = $field['label'] ?? null; + + $field_name = strtolower( str_replace( [ + ' ', + ',', + ':', + '"', + "'", + ], '_', $field_label ) ); + + $field_id = strtolower( str_replace( [ + ' ', + ',', + ':', + '"', + "'", + ], '_', $field_id ) ); + + if( !isset( $field['inline'] ) && in_array( $type, array( 'name', 'mec_email' )) ){ + + $field['inline'] = 'enable'; + } + + $classes = []; + + $single_row = isset($field['single_row']) && $field['single_row'] == 'enable'; + $full_width = isset($field['full_width']) && $field['full_width'] == 'enable'; + + if ( isset( $field['inline'] ) && 'enable' === $field['inline'] ) { + $classes[] = 'col-md-6'; + } elseif ( isset( $field['inline_third'] ) && 'enable' === $field['inline_third'] ) { + $classes[] = 'col-md-4'; + } else { + $classes[] = 'col-md-12'; // 'col-md-6' + } + + if( $is_dashboard ){ + + $classes[] = 'mec-form-row'; + } + + if( isset( $field['mandatory'] ) && $field['mandatory'] ){ + + $classes[] = 'mec-reg-mandatory'; + } + + if( $single_row ){ + + $classes[] = 'clearfix'; + } + ?> +
  • + first_name . ' ' . $current_user->last_name); + $has_icon = $field['has_icon'] ?? true; + $icon_content = \MEC\Base::get_main()->svg('form/user-icon'); + break; + case 'first_name': + $field_type = 'text'; + $field_id = 'first_name'; + $field['label'] = $field['label'] ?? esc_html__('First Name', 'modern-events-calendar-lite'); + $value = $current_user->first_name; + break; + case 'last_name': + $field_type = 'text'; + $field_id = 'last_name'; + $field['label'] = $field['label'] ?? esc_html__('Last Name', 'modern-events-calendar-lite'); + $value = $current_user->last_name; + break; + case 'mec_email': + $field_type = 'email'; + $field_id = $type; + $field['label'] = $field['label'] ?? esc_html__('Email', 'modern-events-calendar-lite'); + $value = isset( $current_user->user_email ) ? $current_user->user_email : ''; + $has_icon = $field['has_icon'] ?? true; + $icon_content = \MEC\Base::get_main()->svg('form/email-icon'); + case 'email': + $field_type = 'email'; + $field['label'] = $field['label'] ?? 'Email'; + $value = $main->get_from_mapped_field($field, ($current_user->user_email ?: '')); + break; + case 'text': + $field_type = 'text'; + $field['label'] = $field['label'] ?? ''; + $value = $main->get_from_mapped_field($field); + break; + case 'date': + $field_type = 'date'; + $field['label'] = $field['label'] ?? 'Date'; + $value = $main->get_from_mapped_field($field); + $class = 'mec-date-picker'; + $attributes = ' min="' . esc_attr( date( 'Y-m-d', strtotime( '-100 years' ) ) ) . '" max="' . esc_attr( date( 'Y-m-d', strtotime( '+100 years' ) ) ) . '" onload="mec_add_datepicker()"'; + break; + case 'file': + $field_type = 'file'; + $field['label'] = $field['label'] ?? 'File'; + $value = ''; + break; + case 'tel': + $field_type = 'tel'; + $field['label'] = $field['label'] ?? 'Tel'; + $value = $main->get_from_mapped_field($field); + break; + case 'textarea': + $field_type = 'textarea'; + $field['label'] = $field['label'] ?? ''; + $value = $main->get_from_mapped_field($field); + break; + case 'select': + $field_type = 'select'; + $field['label'] = $field['label'] ?? ''; + $value = $main->get_from_mapped_field($field); + $selected = ''; + break; + case 'radio': + case 'checkbox': + $field_type = $type; + $value = $main->get_from_mapped_field($field); + break; + case 'agreement': + + $value = ''; + break; + + } + + $primary_field_ids = [ + 'mec_email', + 'name', + 'first_name', + 'last_name' + ]; + $primary_field_id = $field_id; + if( 'fixed' === $form_type || ( 'reg' === $form_type && in_array($field_id, $primary_field_ids ,true) ) ){ + + $field_id = 'mec_email' === $field_id ? 'email' : $field_id; + $value = $data[$field_id] ?? $value; + } else { + + $value = $data[$form_type][$field_id] ?? $value; + } + + $lock_field = !empty( $value ); + $lock_field = ( $lock_field && ( $lock_prefilled == 1 || ( $lock_prefilled == 2 && $j == 0 ) ) ) ? 'readonly' : ''; + + if( 'reg' === $form_type && !in_array($primary_field_id,$primary_field_ids,true) ) { + + $field_name = $field_base_name . '[reg][' . esc_attr($field_id) . ']'; + }else{ + + $field_name = $field_base_name . '[' . esc_attr($field_id) . ']'; + } + + // Display Label + if ( isset( $field['label'] ) && !empty( $field['label'] ) && 'agreement' !== $type ) { + + $label_field = ''; + + echo $is_dashboard ? '
    '.\MEC_kses::form($label_field).'
    ' : \MEC_kses::form($label_field); + } + + $input_html = ''; + $field_class = $class; + // Display Input + switch ( $type ) { + case 'name': + case 'first_name': + case 'last_name': + case 'mec_email': + + $placeholder = ( isset( $field['placeholder'] ) && $field['placeholder'] ) ? esc_html__( $field['placeholder'], 'modern-events-calendar-lite') : esc_html__( $field['label'], 'modern-events-calendar-lite'); + $input_html = ''; + + break; + case 'text': + case 'date': + case 'file': + case 'email': + case 'tel': + + $placeholder = ( isset( $field['placeholder'] ) && $field['placeholder'] ) ? esc_html__( $field['placeholder'], 'modern-events-calendar-lite') : esc_html__( $field['label'], 'modern-events-calendar-lite'); + $input_html = ''; + + break; + case 'textarea': + + $placeholder = ( isset( $field['placeholder'] ) && $field['placeholder'] ) ? esc_html__( $field['placeholder'], 'modern-events-calendar-lite') : esc_html__( $field['label'], 'modern-events-calendar-lite'); + $input_html = ''; + + break; + case 'select': + + $placeholder = ''; + $input_html = ''; + + break; + case 'radio': + $options = isset($field['options']) ? $field['options'] : []; + foreach ( $options as $field_option ) { + $current_value = esc_html__( $field_option['label'], 'modern-events-calendar-lite'); + $checked = in_array($current_value,(array)$value); + $input_html .= ''; + } + + break; + + case 'checkbox': + $options = isset($field['options']) ? $field['options'] : []; + foreach ( $options as $field_option ) { + $current_value = esc_html__( $field_option['label'], 'modern-events-calendar-lite'); + $checked = in_array($current_value,(array)$value); + $input_html .= ''; + } + + break; + case 'agreement': + + $checked = isset( $field['status'] ) ? $field['status'] : 'checked'; + $input_html = ''; + + break; + + case 'p': + + $input_html = '

    ' . do_shortcode( stripslashes( $field['content'] ?? '' ) ) . '

    '; + + break; + } + + if( !empty( $has_icon ) ) { + + $wrapper_class = "mec-{$group_id}-{$type}-field-wrapper"; + $icon_class = "mec-{$group_id}-{$type}-field-icon"; + $input_html = '' + . '' . $icon_content .' ' + . $input_html + .''; + } + echo $is_dashboard ? '
    '.\MEC_kses::form($input_html).'
    ' : \MEC_kses::form($input_html); + ?> +
  • + + '; + } + ?> + type = 'book'; + parent::__construct( $data, $load_post ); + } + + /** + * @return int + */ + public function get_event_id() { + + return (int) $this->get_meta( 'mec_event_id' ); + } + + /** + * @return string + */ + public function get_title() { + + return get_the_title( $this->ID ); + } + + /** + * @return array //TODO: Convert to Attendee[] + */ + public function get_attendees() { + + return $this->get_meta( 'mec_attendees' ); + } + + /** + * @return array + */ + public function get_primary_attendees(){ + + $attendees = $this->get_attendees(); + return (array)current($attendees); + } + + /** + * @return bool + */ + public function is_first_attendee_data_for_all() { + + return (bool)$this->get_meta( 'mec_first_for_all' ); + } + + /** + * @return array + */ + public function get_fixed_fields() { + + return (array)$this->get_meta( 'mec_fixed_fields' ); + } + + /** + * @return string $start_timestamp:$end_timestamp + */ + public function get_attention_time( $type = null ) { + + $data = $this->get_meta( 'mec_attention_time' ); + if ( !is_null( $type ) ) { + + $data = explode( ':', $data ); + } + + if ( 'start' === $type ) { + + $data = isset( $data[0] ) ? $data[0] : ''; + } elseif ( 'end' === $type ) { + + $data = isset( $data[1] ) ? $data[1] : ''; + } + + return $data; + } + + /** + * @return int -1 , 0 , 1 + */ + public function get_confirm_status() { + + return $this->get_meta( 'mec_confirmed' ); + } + + public function get_confirm_status_text() { + + $status = $this->get_confirm_status(); + + switch ( $status ) { + case '-1': + + $text = esc_html__('Rejected', 'modern-events-calendar-lite'); + + break; + case '1': + + $text = esc_html__('Confirmed', 'modern-events-calendar-lite'); + + break; + case '0': + default: + + $text = esc_html__('Pending', 'modern-events-calendar-lite'); + + break; + } + + return $text; + } + + /** + * @param $status + * @param string $mode manually|automatic + * + * @return void + */ + public function set_confirm_status( $status, $mode = 'manually' ) { + + $text_status = ''; + $status = strtolower( trim( $status ) ); + switch ( $status ) { + case 'reject': + case '-1': + $status = -1; + $text_status = 'rejected'; + break; + case 'pending': + case '0': + $status = 0; + $text_status = 'pending'; + break; + case 'confirm': + case '1': + $status = 1; + $text_status = 'confirm'; + break; + } + + if ( in_array( $status, array( -1, 0, 1 ), false ) ) { + + $old_status = $this->get_meta( 'mec_confirmed' ); + $status = apply_filters( 'mec_' . $this->type . '_confirmed_status_value', $status, $mode, $this->ID, $this ); + if ( $old_status != $status ) { + + $this->set_meta( 'mec_confirmed', $status ); + $this->set_meta( 'mec_status_' . $text_status . '_changed', time() ); + /** + * Do Action for send email or ... + */ + do_action( 'mec_' . $this->type . '_confirmed', $this->ID, $old_status, $status, $mode ); + + return true; + } + } + } + + /** + * @return int -1 , 0 , 1 + */ + public function get_verification_status() { + + return $this->get_meta( 'mec_verified' ); + } + + public function get_verification_status_text() { + + $status = $this->get_verification_status(); + + switch ( $status ) { + case '-1': + + $text = esc_html__('Canceled', 'modern-events-calendar-lite'); + + break; + case '1': + + $text = esc_html__('Verified', 'modern-events-calendar-lite'); + + break; + case '0': + default: + + $text = esc_html__('Waiting', 'modern-events-calendar-lite'); + + break; + } + + return $text; + } + + /** + * @param $status + * @param string $mode manually|automatic + * + * @return void + */ + public function set_verification_status( $status, $mode = 'manually' ) { + + $text_status = ''; + $status = strtolower( trim( $status ) ); + switch ( $status ) { + case 'canceled': + case '-1': + $status = -1; + $text_status = 'canceled'; + break; + case 'waiting': + case '0': + $status = 0; + $text_status = 'waiting'; + break; + case 'verified': + case '1': + $status = 1; + $text_status = 'verified'; + break; + } + + if ( in_array( $status, array( -1, 0, 1 ), false ) ) { + + $old_status = $this->get_meta( 'mec_verified' ); + $status = apply_filters( 'mec_' . $this->type . '_verified_status_value', $status, $mode, $this->ID, $this ); + + if ( $old_status != $status ) { + + $this->set_meta( 'mec_verified', $status ); + $this->set_meta( 'mec_status_' . $text_status . '_changed', time() ); + /** + * Do Action for send email or ... + */ + do_action( 'mec_' . $this->type . '_verified', $this->ID, $old_status, $status, $mode ); + + return true; + } + } + + } + + /** + * @return int|float|string + */ + public function get_price() { + + return $this->get_meta( 'mec_price' ); + } + + /** + * @return mixed + */ + public function get_location_id() { + + return $this->get_meta( 'mec_booking_location' ); + } + + /** + * @return array|\WP_Error|\WP_Term|null + */ + public function get_location_term() { + + $location_id = $this->get_location_id(); + $location = get_term( $location_id, 'mec_location', ARRAY_A ); + + return $location; + } + + /** + * @return string 1,2,3 + */ + public function get_tickets() { + + return $this->get_meta( 'mec_ticket_id' ); + } + + /** + * @return array + */ + public function get_tickets_ids() { + + $ids = []; + $tickets = $this->get_tickets(); + $tickets = explode( ',', trim( $tickets, ', ' ) ); + + foreach ( $tickets as $ticket_id ) { + + if ( empty( $ticket_id ) || isset( $ids[ $ticket_id ] ) ) { + + continue; + } + + $ids[ $ticket_id ] = $ticket_id; + } + + return $ids; + } + + public function timestamp($start, $end){ + // Timestamp is already available + if(isset($start['timestamp']) and isset($end['timestamp'])) + { + return $start['timestamp'].':'.$end['timestamp']; + } + + $s_hour = $start['hour']; + if(strtoupper($start['ampm']) == 'AM' and $s_hour == '0') $s_hour = 12; + + $e_hour = $end['hour']; + if(strtoupper($end['ampm']) == 'AM' and $e_hour == '0') $e_hour = 12; + + $start_time = $start['date'].' '.sprintf("%02d", $s_hour).':'.sprintf("%02d", $start['minutes']).' '.$start['ampm']; + $end_time = $end['date'].' '.sprintf("%02d", $e_hour).':'.sprintf("%02d", $end['minutes']).' '.$end['ampm']; + + return strtotime($start_time).':'.strtotime($end_time); + } + +} diff --git a/app/core/src/Books/BookingForm.php b/app/core/src/Books/BookingForm.php new file mode 100755 index 0000000..dde58e1 --- /dev/null +++ b/app/core/src/Books/BookingForm.php @@ -0,0 +1,68 @@ +enqueue(); + $mainClass = new \MEC_main(); + $single = new \MEC_skin_single(); + $settings = Settings::getInstance()->get_settings(); + + global $MEC_Events; + $MEC_Events = $single->get_event_mec($event_id); + $single_event = isset( $MEC_Events[0] ) ? $MEC_Events[0] : false; + if( !$single_event ){ + + return; + } + + $is_modal = isset($settings['single_booking_style']) && $settings['single_booking_style'] == 'modal' ? true : false; + + $data_lity_class = ''; + if ( $is_modal ) { + + $data_lity_class = 'lity-hide'; + } + + $booking_options = get_post_meta($event_id, 'mec_booking', true); + $occurrence = (isset($single_event->date['start']['timestamp']) ? $single_event->date['start']['timestamp'] : (isset($_GET['occurrence']) ? sanitize_text_field($_GET['occurrence']) : '')); + $occurrence_end_date = trim($occurrence) ? $mainClass->get_end_date_by_occurrence($single_event->data->ID, (isset($single_event->date['start']['date']) ? $single_event->date['start']['date'] : $occurrence)) : ''; + + if ($mainClass->is_sold($single_event, (trim($occurrence) ? $occurrence : $single_event->date['start']['date'])) && count($single_event->dates) <= 1) : ?> +
    class=" mec-sold-tickets warning-msg"> + + date)); ?> +
    + can_show_booking_module($single_event)) : + ?> +
    + module('booking.default', array('event' => $MEC_Events))); + } + ?> +
    + 'mec-books', + 'fields' => '', + 'posts_per_page' => -1, + 'post_status' => array('publish','pending','draft','future','private'), + 'meta_query' => array( + 'relation' => 'AND', + ) + ); + + $q_args = wp_parse_args($q_args,$default); + + //event_ids start + if(array_key_exists('event_id',$q_args) && !empty($q_args['event_id'])){ + + $q_args['meta_query']['event_id'] = array( + 'key' => 'mec_event_id', + 'value' => $q_args['event_id'], + 'compare' => '=', + ); + } + + if(array_key_exists('event_ids__in',$q_args)){ + + $q_args['meta_query']['event_ids__in'] = array( + 'key' => 'mec_event_id', + 'value' => (array) $q_args['event_ids__in'], + 'compare' => 'IN', + ); + } + + if(array_key_exists('event_ids__not_in',$q_args)){ + + $q_args['meta_query']['event_ids__not_in'] = array( + 'key' => 'mec_event_id', + 'value' => (array) $q_args['event_ids__not_in'], + 'compare' => 'NOT IN', + ); + } + //event_ids end + + //other meta start + if(array_key_exists('attendee_email',$q_args) && !empty($q_args['event_id'])){ + + $q_args['meta_query']['attendee_email'] = array( + 'key' => 'mec_attendees', + 'value' => '"'.$q_args['attendee_email'].'"', + 'compare' => 'LIKE', + ); + } + + if(array_key_exists('confirmed',$q_args) && !empty($q_args['confirmed'])){ + + $q_args['meta_query']['confirmed'] = array( + 'key' => 'mec_confirmed', + 'value' => $q_args['confirmed'], + 'compare' => '=', + ); + } + + if(array_key_exists('verified',$q_args) && !empty($q_args['confirmed'])){ + + $q_args['meta_query']['verified'] = array( + 'key' => 'mec_verified', + 'value' => $q_args['verified'], + 'compare' => '=', + ); + } + //other meta end + + return get_posts($q_args); + } + + public function get_books_ids($q_args){ + + $default = array( + 'posts_per_page' => -1, + 'fields' => 'ids', + ); + + $q_args = wp_parse_args($q_args,$default); + + return $this->get_books($q_args); + } +} \ No newline at end of file diff --git a/app/core/src/Books/EventBook.php b/app/core/src/Books/EventBook.php new file mode 100755 index 0000000..99e15df --- /dev/null +++ b/app/core/src/Books/EventBook.php @@ -0,0 +1,148 @@ +get_tickets_availability( $event_id, $timestamp ); + } + + public function get_attendees( $event_id, $timestamp ){ + + $bookings = \MEC\Base::get_main()->get_bookings($event_id, $timestamp); + $book = \MEC\Base::get_main()->getBook(); + + if(count($bookings)){ + + $unique_attendees = []; + foreach($bookings as $booking){ + + $attendees = $book->get_attendees($booking->ID); + foreach($attendees as $attendee){ + + if(!isset($unique_attendees[$attendee['email']])) { + $unique_attendees[$attendee['email']] = $attendee; + + } else { + $unique_attendees[$attendee['email']]['count'] += 1; + } + } + } + } + + return $unique_attendees; + } + + public function get_total_attendees( $event_id, $timestamp ){ + + $attendees = $this->get_attendees( $event_id, $timestamp ); + $total = array_sum( array_column( $attendees, 'count' ) ); + + return $total; + } + + /** + * Booking Options + * + * @param int $event_id + * @return array + */ + public function get_booking_options( $event_id ){ + + return (array)get_post_meta( $event_id, 'mec_booking', true); + } + + /** + * Total Booking Limit return int | "-1" unlimited + * + * @param int $event_id + * @return int + */ + public function get_total_booking_limit($event_id){ + + $booking_options = $this->get_booking_options($event_id); + $bookings_limit = isset($booking_options['bookings_limit']) && (int)$booking_options['bookings_limit'] ? (int)$booking_options['bookings_limit'] : -1; + if(isset($booking_options['bookings_limit_unlimited']) && $booking_options['bookings_limit_unlimited']){ + + $bookings_limit = -1; + } + + return $bookings_limit; + } + + /** + * Total User Booking Limit return int | "-1" unlimited + * + * @param int $event_id + * @return int + */ + public function get_user_total_booking_limit($event_id){ + + $booking_options = $this->get_booking_options($event_id); + $bookings_limit = isset($booking_options['bookings_user_limit']) && (int)$booking_options['bookings_user_limit'] ? (int)$booking_options['bookings_user_limit'] : -1; + if(isset($booking_options['bookings_user_limit_unlimited']) && $booking_options['bookings_user_limit_unlimited']){ + + $bookings_limit = -1; + } + + return $bookings_limit; + } + + public function get_user_books( $event_id ){ + + if ( ! is_user_logged_in() ) { + + return false; + } + + $user_data = wp_get_current_user(); + + $email = $user_data->user_email; + if ( empty( $email ) ) { + + return false; + } + + $books = BooksQuery::getInstance()->get_books_ids( + array( + 'attendee_email' => $email, + 'event_id' => $event_id, + ) + ); + + return $books; + } + + /** + * @param int $event_id + * @return array + */ + public function get_user_books_times_for_event( $event_id ) { + + $books = $this->get_user_books( $event_id ); + + if( empty( $books ) || !$books ){ + + return $books; + } + + $books_times = []; + if ( is_array( $books ) ) { + + foreach ( $books as $book_id ) { + + $books_times[ $book_id ] = get_post_meta( $book_id, 'mec_attention_time_start', true ); + } + } + + return $books_times; + } +} diff --git a/app/core/src/Books/index.php b/app/core/src/Books/index.php new file mode 100755 index 0000000..9d7a83d --- /dev/null +++ b/app/core/src/Books/index.php @@ -0,0 +1,5 @@ +type = 'event'; + parent::__construct( $data, $load_post ); + } + + public function get_tickets() { + + return $this->get_meta( 'mec_tickets' ); + } + + public function get_content( $content = null ) { + + return is_null( $content ) ? $this->main->get_post_content( $this->ID ) : $content; + } + + public function get_datetime() { + + $date = $this->get_data( 'date' ); + $is_allday = (bool)$this->get_meta( 'mec_allday' ); + + if ( ! is_null( $date ) ) { + + if( $is_allday ) { + + $start_date = $date['start']['date']; + $end_date = $date['end']['date']; + $date['start']['timestamp'] = strtotime( "{$start_date} 00:01" ); + $date['end']['timestamp'] = strtotime( "{$end_date} 23:59" ); + } + + return $date; + } + + $types = array( + 'start', + 'end', + ); + + $datetime = array( + 'hour' => '', + 'minutes' => '', + 'ampm' => '', + ); + + $datetimes = array( + 'start' => $datetime, + 'end' => $datetime, + ); + + foreach ( $types as $type ) { + + $date = $this->get_meta( 'mec_' . $type . '_date' ); + $hours = $this->get_meta( 'mec_' . $type . '_time_hour' ); + $minutes = $this->get_meta( 'mec_' . $type . '_time_minutes' ); + $ampm = $this->get_meta( 'mec_' . $type . '_time_ampm' ); + + $datetime = array( + 'date' => $date, + 'hours' => sprintf('%02d',$hours), + 'minutes' => sprintf('%02d',$minutes), + 'ampm' => $ampm ? $ampm : '', + ); + + if( !$is_allday ) { + + $datetime['datetime'] = "{$date} {$datetime['hours']}:{$datetime['minutes']} {$datetime['ampm']}"; + }else{ + + $time = 'start' === $type ? '00:01' : '23:59'; + $datetime['datetime'] = "{$date} $time"; + } + $datetime['timestamp'] = strtotime($datetime['datetime']); + $datetimes[ $type ] = $datetime; + } + + $this->data['datetimes'] = $datetimes; + + return $datetimes; + } + + public function get_repeating_status(){ + + return $this->get_meta('mec_repeat_status'); + } + + public function get_repeating_type(){ + + return $this->get_meta('mec_repeat_type'); + } + + public function get_occurrences_times( $start, $limit = 100 ) { + + $k = 'mec-occurrences-'.$this->ID.'-' . $start . $limit; + $occurrences = wp_cache_get( $k ); + if ( empty( $occurrences ) ) { + + $feature = \MEC::getInstance('app.libraries.feature_occurrences'); + $occurrences = $feature->get_dates( $this->ID, $start, $limit ); + wp_cache_set( $k, $occurrences, 'mec-occurrences', 120 ); + } + + return $occurrences; + } + + public function get_occurrence_data( $occurrence_id ){ + + return \MEC::getInstance('app.features.feature_occurrences')->get($occurrence_id); + } + + + public function get_occurrence_time( $start ){ + + $occurrence = $this->get_occurrences_times( $start, 1 ); + $occurrence = is_array($occurrence) ? current($occurrence) : []; + + return (object)$occurrence; + } + + public function get_end_timestamp_occurrence($timestamp){ + + if(empty($timestamp) || !is_numeric($timestamp)){ + + return null; + } + + $end_occurrence = $this->get_occurrence_time( $timestamp ); + $event_end_datetime = isset($end_occurrence->tend) ? $end_occurrence->tend : false; + + if(false === $event_end_datetime){ + + $start_date = date('Y-m-d',$timestamp); + $end_date = \MEC\Base::get_main()->get_end_date_by_occurrence( $this->ID, $start_date ); + $datetimes = $this->get_datetime($this->ID); + $event_end_datetime = strtotime("{$end_date} {$datetimes['hours']}:{$datetimes['minutes']} {$datetimes['ampm']}"); + } + + return $event_end_datetime; + } + + public function get_detail( $skin_type = 'single', $start_timestamp = '' ){ + + $start_timestamp = !empty( $start_timestamp ) ? $start_timestamp : strtotime('Yesterday'); + + $event_id = $this->ID; + $main = new \MEC_Main(); + $render = $main->getRender(); + + $rendered = $render->data($event_id); + + $dates = $render->dates($event_id, NULL, 6, date('Y-m-d H:i', $start_timestamp)); + + $data = new \stdClass(); + $data->ID = $event_id; + $data->data = $rendered; + $data->dates = $dates; + $data->date = isset($dates[0]) ? $dates[0] : $this->get_datetime($event_id); + + $skin = new \stdClass(); + $skin->skin = $skin_type; + $skin->multiple_days_method = Settings::getInstance()->get_settings('multiple_day_show_method'); + + return $render->after_render( $data, $skin ); + } + + public function get_notifications_settings($group_id = null){ + + $notifications = $this->get_meta('mec_notifications'); + + if( !is_null( $group_id ) ){ + + return isset($notifications[$group_id]) ? $notifications[$group_id] : null; + } + + return $notifications; + + } + + /** + * Return event link + * + * @param int $start_timestamp + * @param bool $replace_read_more_link + * + * @return string + */ + public function get_permalink( $start_timestamp = '', $replace_read_more_link = true, $single_date_method = null ){ + + if( $replace_read_more_link ){ + + $custom_link = $this->get_meta('mec_read_more'); + if( !empty( $custom_link ) ){ + + return $custom_link; + } + } + + if( is_null( $single_date_method ) ){ + + $single_date_method = \MEC\Settings\Settings::getInstance()->get_settings( 'single_date_method' ); + } + + $url = isset( $this->data['data']->permalink ) ? $this->data['data']->permalink : get_the_permalink( $this->get_id() ); + + if( !empty( $single_date_method ) && 'referred' === $single_date_method ) { + + if( empty( $start_timestamp ) ){ + + $start_timestamp = current_time('timestamp', 0); + $occurrence = $this->get_occurrence_time( $start_timestamp ); + $start_timestamp = $occurrence->tstart; + $start_datetime = date( 'Y-m-d H:i', $start_timestamp ); + } + + $start_date = date( 'Y-m-d', $start_timestamp ); + $start_time = date( 'H:i', $start_timestamp ); + + $url = \MEC\Base::get_main()->add_qs_var('occurrence', $start_date, $url); + + $repeat_type = $this->get_meta( 'mec_repeat_type' ); + if( 'custom_days' === $repeat_type ){ + + $url = \MEC\Base::get_main()->add_qs_var('time', $start_timestamp, $url); + } + } + + return apply_filters( 'mec_get_event_permalink', $url, $this ); + } + + /** + * Return terms + * + * @param string $taxonomy + * + * @return array + */ + public function get_terms( $taxonomy ){ + + return wp_get_post_terms( $this->get_id(), $taxonomy ); + } + + /** + * Return terms ids + * + * @param string $taxonomy + * + * @return array + */ + public function get_terms_ids( $taxonomy ){ + + $terms = $this->get_terms( $taxonomy ); + + $ids = []; + foreach( $terms as $term ){ + + $ids[ $term->term_id ] = $term->term_id; + } + + return $ids; + } + + /** + * Return event custom data + * + * @return array + */ + public function get_custom_data(){ + + $data = []; + $event_fields_data = $this->get_meta( 'mec_fields' ); + if(!is_array($event_fields_data)) $event_fields_data = []; + + $event_fields = \MEC\Base::get_main()->get_event_fields(); + foreach($event_fields as $f => $event_field){ + + if(!is_numeric($f)) { + + continue; + } + + $label = isset($event_field['label']) ? $event_field['label'] : ''; + $value = isset($event_fields_data[$f]) ? $event_fields_data[$f] : NULL; + + if(is_array($value)) { + + $value = implode(', ', $value); + } + + $data[ $f ] = array( + 'label' => $label, + 'value' => $value, + ); + } + + return $data; + } +} diff --git a/app/core/src/Events/Events.php b/app/core/src/Events/Events.php new file mode 100755 index 0000000..668d6b2 --- /dev/null +++ b/app/core/src/Events/Events.php @@ -0,0 +1,100 @@ + '', + 'content' => '', + 'status' => 'publish', + ); + + $event = wp_parse_args( $event, $d_args ); + + $event_arg = array( + + 'post_title' => $event['title'], + 'post_content' => $event['content'], + 'post_status' => $event['status'], + ); + + $event_id = wp_insert_post( $event_arg ); + + do_action( 'mec_saved_event', $event_id, $event ); + + $event_mata = array( + 'mec_location_id', + 'mec_dont_show_map', + 'mec_organizer_id', + 'mec_read_more', + 'mec_more_info', + 'mec_more_info_title', + 'mec_more_info_target', + 'mec_cost', + + 'mec_additional_organizer_ids', + 'mec_additional_location_ids', + + 'mec_date', + 'mec_repeat', + 'mec_certain_weekdays', + 'mec_allday', + 'one_occurrence', + 'mec_hide_time', + 'mec_hide_end_time', + 'mec_comment', + 'mec_timezone', + 'mec_countdown_method', + 'mec_public', + + 'mec_start_date', + 'mec_start_time_hour', + 'mec_start_time_minutes', + 'mec_start_time_ampm', + 'mec_start_day_seconds', + + 'mec_end_date', + 'mec_end_time_hour', + 'mec_end_time_minutes', + 'mec_end_time_ampm', + 'mec_end_day_seconds', + + 'mec_repeat_status', + 'mec_repeat_type', + 'mec_repeat_interval', + 'mec_repeat_end', + 'mec_repeat_end_at_occurrences', + 'mec_repeat_end_at_date', + 'mec_advanced_days', + + 'mec_event_date_submit', + + 'mec_in_days', + 'mec_not_in_days', + 'mec_hourly_schedules', + 'mec_booking', + + 'mec_tickets', + 'mec_fees_global_inheritance', + 'mec_fees', + + 'mec_ticket_variations_global_inheritance', + 'mec_ticket_variations', + 'mec_reg_fields_global_inheritance', + + 'mec_reg_fields', + 'mec_bfixed_fields', + 'mec_op', + + 'mec_fields', + 'mec_notifications', + ); + + } +} diff --git a/app/core/src/Events/EventsQuery.php b/app/core/src/Events/EventsQuery.php new file mode 100755 index 0000000..19d2216 --- /dev/null +++ b/app/core/src/Events/EventsQuery.php @@ -0,0 +1,153 @@ + 'mec-events', + 'fields' => '', + 'posts_per_page' => get_option('posts_per_page',12), + 'post_status' => array('publish','pending','draft','future','private'), + 'meta_query' => array( + 'relation' => 'AND', + ), + 'post__in' => array(), + 'meta_query' => array(), + ); + + if(is_numeric($q_args) && $q_args > 0){ + + $q_args = array( + 'event_id' => $q_args + ); + } + + $q_args = wp_parse_args( $q_args, $default ); + + return $q_args; + } + + public function get_tax_query($q_args){ + + $taxonomies = array( + 'label', + 'category', + 'location', + 'organizer', + 'speaker', + 'event_type', + 'event_type_2', + ); + + $tax_query = array( + 'relation'=>'AND' + ); + + foreach($q_args as $tax => $v){ + + if(!empty($v) && in_array($tax,$taxonomies)){ + + $taxonomy = 'mec_'.$tax; + $tax_query[$taxonomy.'_term_ids'] = array( + 'taxonomy'=> $taxonomy, + 'field'=>'term_id', + 'terms'=> !is_array($v) ? explode(',', trim($v, ', ')) : (array)$v, + ); + } + } + + $tax_query = apply_filters('mec_map_tax_query', $tax_query,$q_args); + + return $tax_query; + } + + public function get_events($q_args){ + + $tax_query = array_merge_recursive( + isset($q_args['tax_query']) ? $q_args['tax_query'] : array(), + $this->get_tax_query($q_args) + ); + $q_args['tax_query'] = $tax_query; + + $q_args = $this->parse_args($q_args); + + //event_ids start + if(array_key_exists('event_id',$q_args) && !empty($q_args['event_id'])){ + + $q_args['ID'] = $q_args['event_id']; + } + + if(array_key_exists('event_ids__in',$q_args) && is_array( $q_args['event_ids__in'] )){ + + $post_in = isset( $q_args['post_in'] ) && is_array( $q_args['post_in'] ) ? $q_args['post_in'] : []; + + $q_args['post__in'] = array_merge( + $post_in, + $q_args['event_ids__in'] + ); + } + + if(array_key_exists('event_ids__not_in',$q_args) && is_array( $q_args['event_ids__not_in'] )){ + + $post_not_in = isset( $q_args['post__not_in'] ) && is_array( $q_args['post__not_in'] ) ? $q_args['post__not_in'] : []; + + $q_args['post__not_in'] = array_merge( + $post_not_in, + $q_args['event_ids__not_in'] + ); + } + + //event_ids end + + return get_posts($q_args); + } + + public function get_events_ids($q_args){ + + $default = array( + 'posts_per_page' => -1, + 'fields' => 'ids', + ); + + $q_args = wp_parse_args($q_args,$default); + + return $this->get_events($q_args); + } + + public function get_last_event($return = 'post'){ + + $query_args = $this->parse_args( + array( + 'posts_per_page' => 1, + 'order' => 'DESC', + 'orderby' => 'ID' + ) + ); + $events = get_posts($query_args); + + if(isset($events[0]) && !empty($events[0])){ + switch($return){ + case 'event': + $event = new Event($events[0]); + return $event->get_detail(); + + break; + case 'post': + default: + + return (array)$events[0]; + + break; + } + } + + return false; + } +} \ No newline at end of file diff --git a/app/core/src/Events/index.php b/app/core/src/Events/index.php new file mode 100755 index 0000000..40d16fd --- /dev/null +++ b/app/core/src/Events/index.php @@ -0,0 +1,5 @@ +get_settings(); + + if ( $is_edit_mode && ( !isset($settings['booking_status']) || !$settings['booking_status'] ) ) { + + echo '
    +

    ' + .'' + . esc_html__('This widget is displayed if booking module is active. In order for the widget in this page to be displayed correctly, please activate Booking module.', 'modern-events-calendar-lite') + .'' + .'' . esc_html__('How to set booking module', 'modern-events-calendar-lite') . ' ' + .'

    ' + .'
    '; + + return false; + } + + return true; + } + + /** + * Return title html field + * + * @param WP_Post $post + * @param array $atts + * + * @since 1.0.0 + * + * @return void + */ + public static function title( $post, $atts = array() ){ + ?> +
    + + +
    + +
    + post_content) ? $post->post_content : ''), + 'mec_fes_content', + array( + 'textarea_name'=>'mec[content]', + 'textarea_rows' => $atts['textarea_rows'] ?? get_option('default_post_edit_rows', 10), + ) + ); ?> +
    + post_excerpt) ? esc_textarea($post->post_excerpt) : ''; + + $placeholder = $required ? __('Event Excerpt', 'modern-events-calendar-lite') : __('Optional Event Excerpt', 'modern-events-calendar-lite'); + ?> +
    +

    *' : ''); ?>

    +
    +
    + +
    +
    +
    + ID; + + // This date format used for datepicker + $datepicker_format = $atts['datepicker_format'] ?? 'Y-m-d'; + $time_format = $atts['time_format'] ?? 12; + $required = (isset($atts['required']) and $atts['required']); + + $allday = get_post_meta($post_id, 'mec_allday', true); + $one_occurrence = get_post_meta($post_id, 'one_occurrence', true); + $comment = get_post_meta($post_id, 'mec_comment', true); + $hide_time = get_post_meta($post_id, 'mec_hide_time', true); + + // MEC Main + $main = \MEC\Base::get_main(); + + // Settings + $settings = $main->get_settings(); + + $hide_end_time_global = isset($settings['hide_event_end_time']) && $settings['hide_event_end_time']; + $hide_end_time = get_post_meta($post_id, 'mec_hide_end_time', true); + + if($hide_end_time_global) $hide_end_time = 1; + + $start_date = get_post_meta($post_id, 'mec_start_date', true); + + // Advanced Repeating Day + $advanced_days = get_post_meta( $post->ID, 'mec_advanced_days', true ); + $advanced_days = (is_array($advanced_days)) ? $advanced_days : []; + $advanced_str = (count($advanced_days)) ? implode('-', $advanced_days) : ''; + + $start_time_hour = get_post_meta($post_id, 'mec_start_time_hour', true); + if(trim($start_time_hour) == '') $start_time_hour = 8; + + $start_time_minutes = get_post_meta($post_id, 'mec_start_time_minutes', true); + if(trim($start_time_minutes) == '') $start_time_minutes = 0; + + $start_time_ampm = get_post_meta($post_id, 'mec_start_time_ampm', true); + if(trim($start_time_ampm) == '') $start_time_ampm = 'AM'; + + $end_date = get_post_meta($post_id, 'mec_end_date', true); + + $end_time_hour = get_post_meta($post_id, 'mec_end_time_hour', true); + if(trim($end_time_hour) == '') $end_time_hour = 6; + + $end_time_minutes = get_post_meta($post_id, 'mec_end_time_minutes', true); + if(trim($end_time_minutes) == '') $end_time_minutes = 0; + + $end_time_ampm = get_post_meta($post_id, 'mec_end_time_ampm', true); + if(trim($end_time_ampm) == '') $end_time_ampm = 'PM'; + + $repeat_status = get_post_meta($post_id, 'mec_repeat_status', true); + $repeat_type = get_post_meta($post_id, 'mec_repeat_type', true); + if(trim($repeat_type) == '') $repeat_type = 'daily'; + + $repeat_interval = get_post_meta($post_id, 'mec_repeat_interval', true); + if(trim($repeat_interval) == '' and in_array($repeat_type, array('daily', 'weekly'))) $repeat_interval = 1; + + $certain_weekdays = get_post_meta($post_id, 'mec_certain_weekdays', true); + if($repeat_type != 'certain_weekdays') $certain_weekdays = []; + + $in_days_str = get_post_meta($post_id, 'mec_in_days', true); + $in_days = trim($in_days_str) ? explode(',', $in_days_str) : []; + + $mec_repeat_end = get_post_meta($post_id, 'mec_repeat_end', true); + if(trim($mec_repeat_end) == '') $mec_repeat_end = 'never'; + + $repeat_end_at_occurrences = get_post_meta($post_id, 'mec_repeat_end_at_occurrences', true); + if(trim($repeat_end_at_occurrences) == '') $repeat_end_at_occurrences = 9; + + $repeat_end_at_date = get_post_meta($post_id, 'mec_repeat_end_at_date', true); + ?> +
    +

    +
    +
    + + +
    +
    +
    + +
    +
    + timepicker(array( + 'method' => $time_format, + 'time_hour' => $start_time_hour, + 'time_minutes' => $start_time_minutes, + 'time_ampm' => $start_time_ampm, + 'name' => 'mec[date][start]', + 'id_key' => 'start_', + 'include_h0' => true, + )); ?> +
    +
    +
    + + +
    +
    +
    + +
    +
    + timepicker(array( + 'method' => $time_format, + 'time_hour' => $end_time_hour, + 'time_minutes' => $end_time_minutes, + 'time_ampm' => $end_time_ampm, + 'name' => 'mec[date][end]', + 'id_key' => 'end_', + )); ?> +
    +
    +
    + type="checkbox" name="mec[date][allday]" id="mec_allday" value="1" onchange="jQuery('.mec-time-picker').toggle();" /> +
    +
    + type="checkbox" name="mec[date][hide_time]" id="mec_hide_time" value="1" /> +
    +
    + type="checkbox" name="mec[date][hide_end_time]" id="mec_hide_end_time" value="1" /> +
    +
    +
    + +

    +
    +
    +
    +
    +

    +
    + type="checkbox" name="mec[date][repeat][status]" id="mec_repeat" value="1" /> +
    +
    +
    + + +
    +
    + + +
    +
    + + + + + + + + +
    +
    +
    +
    +
    +
    + +
    +
    + timepicker(array( + 'method' => $time_format, + 'time_hour' => $start_time_hour, + 'time_minutes' => $start_time_minutes, + 'time_ampm' => $start_time_ampm, + 'name' => 'mec[exceptionsdays][start]', + 'id_key' => 'exceptions_in_days_start_', + 'include_h0' => true, + )); ?> +
    +
    +
    +
    + +
    +
    + timepicker(array( + 'method' => $time_format, + 'time_hour' => $end_time_hour, + 'time_minutes' => $end_time_minutes, + 'time_ampm' => $end_time_ampm, + 'name' => 'mec[exceptionsdays][end]', + 'id_key' => 'exceptions_in_days_end_', + )); ?> +
    +
    +
    +
    + + +
    +
    +
    +

    + + +

    +
    +
    + +
    +
    +
    +
    +
    +
    + + standardize_format($in_day[0], $datepicker_format); + $second_date = \MEC\Base::get_main()->standardize_format($in_day[1], $datepicker_format); + + $in_day_start_time = ''; + $in_day_start_time_label = ''; + $in_day_end_time = ''; + $in_day_end_time_label = ''; + + if(isset($in_day[2]) and isset($in_day[3])) + { + $in_day_start_time = $in_day[2]; + $in_day_end_time = $in_day[3]; + + // If 24 hours format is enabled then convert it back to 12 hours + if( $time_format == 24 ) + { + $in_day_ex_start = explode('-', $in_day_start_time); + $in_day_ex_end = explode('-', $in_day_end_time); + + $in_day_start_time_label = \MEC\Base::get_main()->to_24hours($in_day_ex_start[0], $in_day_ex_start[2]).':'.$in_day_ex_start[1]; + $in_day_end_time_label = \MEC\Base::get_main()->to_24hours($in_day_ex_end[0], $in_day_ex_end[2]).':'.$in_day_ex_end[1]; + } + else + { + $pos = strpos($in_day_start_time, '-'); + if($pos !== false) $in_day_start_time_label = substr_replace($in_day_start_time, ':', $pos, 1); + + $pos = strpos($in_day_end_time, '-'); + if($pos !== false) $in_day_end_time_label = substr_replace($in_day_end_time, ':', $pos, 1); + + $in_day_start_time_label = str_replace('-', ' ', $in_day_start_time_label); + $in_day_end_time_label = str_replace('-', ' ', $in_day_end_time_label); + } + } + + $in_day = $first_date . ':' . $second_date.(trim($in_day_start_time) ? ':'.$in_day_start_time : '').(trim($in_day_end_time) ? ':'.$in_day_end_time : ''); + $in_day_label = $first_date. (trim($in_day_start_time_label) ? ' '.$in_day_start_time_label : '') . ' - ' . $second_date. (trim($in_day_end_time_label) ? ' '.$in_day_end_time_label : ''); + ?> +
    + + + x +
    + +
    + +
    +
    + + :label: + x +
    +
    +
    +
    +
    +
      +
    • + +
    • +
        + advanced_repeating_sort_day(\MEC\Base::get_main()->get_first_day_of_week(), 1); ?> +
      • "> + + .1- +
      • + advanced_repeating_sort_day(\MEC\Base::get_main()->get_first_day_of_week(), 2); ?> +
      • "> + + .1- +
      • + advanced_repeating_sort_day(\MEC\Base::get_main()->get_first_day_of_week(), 3); ?> +
      • "> + + .1- +
      • + advanced_repeating_sort_day(\MEC\Base::get_main()->get_first_day_of_week(), 4); ?> +
      • "> + + .1- +
      • + advanced_repeating_sort_day(\MEC\Base::get_main()->get_first_day_of_week(), 5); ?> +
      • "> + + .1- +
      • + advanced_repeating_sort_day(\MEC\Base::get_main()->get_first_day_of_week(), 6); ?> +
      • "> + + .1- +
      • + advanced_repeating_sort_day(\MEC\Base::get_main()->get_first_day_of_week(), 7); ?> +
      • "> + + .1- +
      • +
      +
    +
      +
    • + +
    • +
        + advanced_repeating_sort_day(\MEC\Base::get_main()->get_first_day_of_week(), 1); ?> +
      • "> + + .2- +
      • + advanced_repeating_sort_day(\MEC\Base::get_main()->get_first_day_of_week(), 2); ?> +
      • "> + + .2- +
      • + advanced_repeating_sort_day(\MEC\Base::get_main()->get_first_day_of_week(), 3); ?> +
      • "> + + .2- +
      • + advanced_repeating_sort_day(\MEC\Base::get_main()->get_first_day_of_week(), 4); ?> +
      • "> + + .2- +
      • + advanced_repeating_sort_day(\MEC\Base::get_main()->get_first_day_of_week(), 5); ?> +
      • "> + + .2- +
      • + advanced_repeating_sort_day(\MEC\Base::get_main()->get_first_day_of_week(), 6); ?> +
      • "> + + .2- +
      • + advanced_repeating_sort_day(\MEC\Base::get_main()->get_first_day_of_week(), 7); ?> +
      • "> + + .2- +
      • +
      +
    +
      +
    • + +
    • +
        + advanced_repeating_sort_day(\MEC\Base::get_main()->get_first_day_of_week(), 1); ?> +
      • "> + + .3- +
      • + advanced_repeating_sort_day(\MEC\Base::get_main()->get_first_day_of_week(), 2); ?> +
      • "> + + .3- +
      • + advanced_repeating_sort_day(\MEC\Base::get_main()->get_first_day_of_week(), 3); ?> +
      • "> + + .3- +
      • + advanced_repeating_sort_day(\MEC\Base::get_main()->get_first_day_of_week(), 4); ?> +
      • "> + + .3- +
      • + advanced_repeating_sort_day(\MEC\Base::get_main()->get_first_day_of_week(), 5); ?> +
      • "> + + .3- +
      • + advanced_repeating_sort_day(\MEC\Base::get_main()->get_first_day_of_week(), 6); ?> +
      • "> + + .3- +
      • + advanced_repeating_sort_day(\MEC\Base::get_main()->get_first_day_of_week(), 7); ?> +
      • "> + + .3- +
      • +
      +
    +
      +
    • + +
    • +
        + advanced_repeating_sort_day(\MEC\Base::get_main()->get_first_day_of_week(), 1); ?> +
      • "> + + .4- +
      • + advanced_repeating_sort_day(\MEC\Base::get_main()->get_first_day_of_week(), 2); ?> +
      • "> + + .4- +
      • + advanced_repeating_sort_day(\MEC\Base::get_main()->get_first_day_of_week(), 3); ?> +
      • "> + + .4- +
      • + advanced_repeating_sort_day(\MEC\Base::get_main()->get_first_day_of_week(), 4); ?> +
      • "> + + .4- +
      • + advanced_repeating_sort_day(\MEC\Base::get_main()->get_first_day_of_week(), 5); ?> +
      • "> + + .4- +
      • + advanced_repeating_sort_day(\MEC\Base::get_main()->get_first_day_of_week(), 6); ?> +
      • "> + + .4- +
      • + advanced_repeating_sort_day(\MEC\Base::get_main()->get_first_day_of_week(), 7); ?> +
      • "> + + .4- +
      • +
      +
    +
      +
    • + +
    • +
        + advanced_repeating_sort_day(\MEC\Base::get_main()->get_first_day_of_week(), 1); ?> +
      • "> + + .l- +
      • + advanced_repeating_sort_day(\MEC\Base::get_main()->get_first_day_of_week(), 2); ?> +
      • "> + + .l- +
      • + advanced_repeating_sort_day(\MEC\Base::get_main()->get_first_day_of_week(), 3); ?> +
      • "> + + .l- +
      • + advanced_repeating_sort_day(\MEC\Base::get_main()->get_first_day_of_week(), 4); ?> +
      • "> + + .l- +
      • + advanced_repeating_sort_day(\MEC\Base::get_main()->get_first_day_of_week(), 5); ?> +
      • "> + + .l- +
      • + advanced_repeating_sort_day(\MEC\Base::get_main()->get_first_day_of_week(), 6); ?> +
      • "> + + .l- +
      • + advanced_repeating_sort_day(\MEC\Base::get_main()->get_first_day_of_week(), 7); ?> +
      • "> + + .l- +
      • +
      +
    + +
    +
    +
    +
    + +
    +
    + type="radio" value="never" name="mec[date][repeat][end]" id="mec_repeat_ends_never" /> + +
    +
    +
    + type="radio" value="date" name="mec[date][repeat][end]" id="mec_repeat_ends_date" /> + +
    + +
    +
    +
    + type="radio" value="occurrences" name="mec[date][repeat][end]" id="mec_repeat_ends_occurrences" /> + +
    + + +
    +
    +

    +
    + +
    +
    +
    + + type="checkbox" name="mec[date][one_occurrence]" id="mec-one-occurrence" value="1"/> +
    +
    +
    +
    +
    + + ID, 'mec_countdown_method', true); + if(trim($countdown_method) == '') { + + $countdown_method = 'global'; + } + + ?> +
    +

    +
    +
    + +
    +
    +
    + ID, 'mec_style_per_event', true); + if(trim($style_per_event) == '') { + + $style_per_event = 'global'; + } + + ?> +
    +

    +
    +
    + +
    +
    +
    + ID, 'mec_trailer_url', true); + $trailer_title = get_post_meta($post->ID, 'mec_trailer_title', true); + ?> +
    +

    +
    +
    + +
    +
    + +
    +
    +
    + ID, 'mec_public', true); + if(trim($public) === '') { + + $public = 1; + } + ?> +
    +

    +
    +
    + +
    +
    +
    + ID, 'mec_timezone', true); + if(trim($event_timezone) == '') { + + $event_timezone = 'global'; + } + ?> +
    +

    +
    +
    + +
    + +
    +
    + is_note_visible(get_post_status($post->ID)) ){ + + if( $is_edit_mode ){ + + echo '
    +

    ' + .'' + . esc_html__('The output cannot be displayed.', 'modern-events-calendar-lite') + .'' + .'' . esc_html__('How to set', 'modern-events-calendar-lite') . ' ' + .'

    ' + .'
    '; + } + + return; + } + + $note = get_post_meta($post->ID, 'mec_note', true); + ?> +
    +

    +
    + +
    +
    + + ID, 'fes_guest_email', true); + $guest_name = get_post_meta($post->ID, 'fes_guest_name', true); + ?> + + + ID, 'mec_read_more', true); + $more_info = get_post_meta($post->ID, 'mec_more_info', true); + $more_info_title = get_post_meta($post->ID, 'mec_more_info_title', true); + ?> + + + + get_settings(); + + $cost = get_post_meta($post->ID, 'mec_cost', true); + $cost_type = ((isset($settings['single_cost_type']) and trim($settings['single_cost_type'])) ? $settings['single_cost_type'] : 'numeric'); + + $cost_auto_calculate = get_post_meta($post->ID, 'mec_cost_auto_calculate', true); + + $currency = get_post_meta($post->ID, 'mec_currency', true); + if(!is_array($currency)) $currency = []; + + $currency_per_event = ((isset($settings['currency_per_event']) and trim($settings['currency_per_event'])) ? $settings['currency_per_event'] : 0); + + $currencies = \MEC\Base::get_main()->get_currencies(); + $current_currency = (isset($currency['currency']) ? $currency['currency'] : (isset($settings['currency']) ? $settings['currency'] : NULL)); + ?> + +
    +

    m('event_cost', esc_html__('Event Cost', 'modern-events-calendar-lite'))); ?> *' : ''; ?>

    +
    +
    + class="mec-col-3" name="mec[cost]" id="mec_cost" value="" placeholder="" /> +
    +
    + +
    +
    + +
    +
    + + +

    +
    + +
    + +
    +
    +
    + +
    + + +
    +
    +

    +
    + +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    + +
    +
    + +
    + ID); + + ?> +
    +

    +
    + + + + + + + + +
    +
    + + ID); + $featured_image = wp_get_attachment_image_src($attachment_id, 'large'); + if(isset($featured_image[0])) { + + $featured_image = $featured_image[0]; + } + + $featured_image_caption = $atts['featured_image_caption'] ?? false; + $media_access = current_user_can('upload_files'); + ?> + + + + +
    +

    m('taxonomy_categories', esc_html__('Categories', 'modern-events-calendar-lite'))); ?> *' : ''); ?>

    +
    + 'mec_category', + 'hide_empty' => false, + 'title_li' => '', + 'walker' => new \FES_Custom_Walker($post->ID), + )); + ?> +
    +
    + + ID, 'mec_label'); + + $labels = []; + if($post_labels) { + + foreach($post_labels as $post_label){ + + $labels[] = $post_label->term_id; + } + } + + $label_terms = get_terms( + array( + 'taxonomy'=>'mec_label', + 'hide_empty'=>false, + ) + ); + + if( $is_edit_mode && empty( $label_terms ) ){ + + echo '

    ' + .''. esc_html__('This widget is displayed if label is set. In order for the widget in this page to be displayed correctly, please set label for your last event.', 'modern-events-calendar-lite').'' + . '' . esc_html__('How to set label', 'modern-events-calendar-lite') . ' ' + .'

    '; + } + + ?> + + +
    +

    m('taxonomy_labels', esc_html__('Labels', 'modern-events-calendar-lite'))); ?> *' : ''); ?>

    +
    + + + +
    +
    + + + ID, 'mec_color', true); + $available_colors = \MEC\Base::get_main()->get_available_colors(); + + if(!trim($color)) { + + $color = $available_colors[0]; + } + ?> + + + +
    +

    +
    +
    + + + + +
    +
    +
    + + + ID, apply_filters('mec_taxonomy_tag', '')); + + $tags = ''; + foreach($post_tags as $post_tag) { + + $tags .= $post_tag->name.','; + } + ?> + +
    +

    +
    + +
    +
    + + 'mec_speaker', + 'hide_empty'=>false + )); + + if( is_wp_error( $speaker_terms ) ){ + + if( $is_edit_mode ){ + + echo '

    ' + .''. esc_html__('This widget is displayed if speaker is set. In order for the widget in this page to be displayed correctly, please set speaker for your last event.', 'modern-events-calendar-lite').'' + . '' . esc_html__('How to set speaker', 'modern-events-calendar-lite') . ' ' + .'

    '; + } + + error_log( print_r($speaker_terms, true) ); + return; + } + + $post_speakers = get_the_terms($post->ID, 'mec_speaker'); + $speakers = []; + if($post_speakers) { + foreach($post_speakers as $post_speaker){ + + if(!isset($post_speaker->term_id)) continue; + $speakers[] = $post_speaker->term_id; + } + } + + ?> + +
    +

    m('taxonomy_speakers', esc_html__('Speakers', 'modern-events-calendar-lite'))); ?>

    +
    + +

    m('taxonomy_speaker', esc_html__('speaker', 'modern-events-calendar-lite')))); ?>

    + +
    +
    + + + + + +
    +
    + + ID, 'mec_sponsor'); + if( is_wp_error( $post_sponsors ) ){ + + if( $is_edit_mode ){ + + echo '
    +

    ' + .'' + . esc_html__('The output cannot be displayed.', 'modern-events-calendar-lite') + .'' + .'' . esc_html__('How to set', 'modern-events-calendar-lite') . ' ' + .'

    ' + .'
    '; + } + + error_log( print_r($post_sponsors, true) ); + return; + } + + $sponsors = []; + if( is_array( $post_sponsors ) ) { + foreach($post_sponsors as $post_sponsor){ + + if(!isset($post_sponsor->term_id)) continue; + + $sponsors[] = $post_sponsor->term_id; + } + } + + $sponsor_terms = get_terms(array( + 'taxonomy'=>'mec_sponsor', + 'hide_empty'=>false + )); + + ?> + +
    +

    m('taxonomy_sponsors', esc_html__('Sponsors', 'modern-events-calendar-lite'))); ?>

    + +
    + +

    m('taxonomy_sponsor', esc_html__('sponsor', 'modern-events-calendar-lite')))); ?>

    + +
    + +
    + + + + + +
    +
    + + +
    +
    + + +
    +
    + getEventFields(); + $fields->form(array( + 'id' => 'mec-event-data', + 'class' => 'mec-meta-box-fields mec-event-tab-content mec-fes-event-fields', + 'post' => $post, + 'data' => get_post_meta($post->ID, 'mec_fields', true), + 'name_prefix' => 'mec', + 'id_prefix' => 'mec_event_fields_', + 'mandatory_status' => true, + )); + } + + /** + * Return hourly schedules html field + * + * @param WP_Post $post + * @param array $atts + * + * @since 1.0.0 + * + * @return void + */ + public static function hourly_schedule( $post, $atts = array() ){ + + $settings = \MEC\Settings\Settings::getInstance()->get_settings(); + + $meta_hourly_schedules = get_post_meta($post->ID, 'mec_hourly_schedules', true); + if(is_array($meta_hourly_schedules) and count($meta_hourly_schedules)) + { + $first_key = key($meta_hourly_schedules); + + $hourly_schedules = []; + if(!isset($meta_hourly_schedules[$first_key]['schedules'])) + { + $hourly_schedules[] = array( + 'title' => esc_html__('Day 1', 'modern-events-calendar-lite'), + 'schedules' => $meta_hourly_schedules, + ); + } + else $hourly_schedules = $meta_hourly_schedules; + } + else $hourly_schedules = []; + + // Status of Speakers Feature + $speakers_status = isset($settings['speakers_status']) && $settings['speakers_status']; + $speakers = get_terms('mec_speaker', array( + 'orderby' => 'name', + 'order' => 'ASC', + 'hide_empty' => '0', + )); + + $builder = \MEC\Base::get_main()->getFormBuilder(); + $builder->hourlySchedule([ + 'hourly_schedules' => $hourly_schedules, + 'speakers_status' => $speakers_status, + 'speakers' => $speakers, + ]); + } + + /** + * Return Event Gallery html form + * + * @param WP_Post $post + * @param array $atts + * + * @since 1.0.0 + * + * @return void + */ + public static function event_gallery($post, $atts = array()) + { + // Disable For Guest + if(!get_current_user_id()) return; + + $required = isset($atts['required']) && $atts['required']; + $gallery = get_post_meta($post->ID, 'mec_event_gallery', true); + if(!is_array($gallery)) $gallery = []; + ?> + + + ID, 'mec_related_events', true); + if(!is_array($related_events)) $related_events = []; + + // Main + $main = \MEC\Base::get_main(); + + // All Upcoming Events + $all_events = $main->get_upcoming_event_ids(); + if(!is_array($all_events)) $all_events = []; + + // Unshift Current Events + if(count($related_events)) + { + foreach(array_reverse($related_events) as $related_event) + { + array_unshift($all_events, $related_event); + } + } + + $all_events = array_unique($all_events); + ?> + + ID, 'mec_banner', true); + if(!is_array($banner_options)) $banner_options = []; + + $mec_banner_status = isset($banner_options['status']) && $banner_options['status']; + $mec_banner_color = $banner_options['color'] ?? ''; + $mec_banner_image = $banner_options['image'] ?? ''; + $mec_banner_featured_image = $banner_options['use_featured_image'] ?? 0; + ?> +
    +

    +
    + +
    +
    +
    + + +
    +
    + + +
    + +
    +
    + load_map_assets(); + + $settings = \MEC\Settings\Settings::getInstance()->get_settings(); + + $locations = get_terms('mec_location', array('orderby'=>'name', 'hide_empty'=>'0')); + $dont_show_map = get_post_meta($post->ID, 'mec_dont_show_map', true); + + $location_id = get_post_meta($post->ID, 'mec_location_id', true); + $location_id = apply_filters('wpml_object_id', $location_id, 'mec_location', true); + + $location_ids = get_post_meta($post->ID, 'mec_additional_location_ids', true); + if(!is_array($location_ids)) $location_ids = []; + + $additional_locations_status = (!isset($settings['additional_locations']) or (isset($settings['additional_locations']) and $settings['additional_locations'])) ? true : false; + if($is_fes_form and isset($settings['fes_section_other_locations']) and !$settings['fes_section_other_locations']) $additional_locations_status = false; + + // Map Options + $status = isset($settings['google_maps_status']) ? $settings['google_maps_status'] : 1; + $api_key = isset($settings['google_maps_api_key']) ? $settings['google_maps_api_key'] : ''; + + // FES Options + $add_new_location = ($is_fes_form and isset($settings['fes_add_location'])) ? $settings['fes_add_location'] : 1; + $required = ($is_fes_form and isset($settings['fes_required_location']) and $settings['fes_required_location']); + $optional = !$required; + ?> + +
    +

    m('taxonomy_location', esc_html__('Location', 'modern-events-calendar-lite'))); ?> *' : ''); ?>

    +
    + + +
    +
    +

    +
    + +
    +
    +
    +
    + +

    +
    +
    + +

    + + + + +
    +
    + +
    +
    + + + +
    +
    +

    +
    + +
    +
    +
    + +
    +
    + +
    + + +
    +
    + + + +
    + +
    + + + + +
    + +
    + getPRO()): ?> +
    + + +
    + + +

    m('other_locations', esc_html__('Other Locations', 'modern-events-calendar-lite'))); ?>

    +
    +

    +
    + +
    +
    + +
    + get_settings(); + + $organizers = get_terms('mec_organizer', array('orderby'=>'name', 'hide_empty'=>'0')); + + $organizer_id = get_post_meta($post->ID, 'mec_organizer_id', true); + $organizer_id = apply_filters('wpml_object_id', $organizer_id, 'mec_organizer', true); + + // Detect it by current user + if($is_fes_form && trim($organizer_id) === '' && is_user_logged_in()) + { + // MEC Main + $main = \MEC\Base::get_main(); + + $current_user = wp_get_current_user(); + $organizer_id = apply_filters( + 'mec_get_organizer_id_by_email', + $main->get_organizer_id_by_email($current_user->user_email), + $current_user, + $current_user->user_email + ); + } + + $organizer_ids = get_post_meta($post->ID, 'mec_additional_organizer_ids', true); + if(!is_array($organizer_ids)) $organizer_ids = []; + $organizer_ids = array_unique($organizer_ids); + + $additional_organizers_status = !isset($settings['additional_organizers']) || $settings['additional_organizers']; + + // FES Options + $use_all_organizers = (($is_fes_form and isset($settings['fes_use_all_organizers']) and !$settings['fes_use_all_organizers']) ? false : true); + if(!$use_all_organizers) + { + $additional_organizers_status = false; + $organizers = []; + + // Display Saved Organizer for Current Event in FES + if($post->ID and $organizer_id and $organizer_id != 1) $organizers[] = get_term($organizer_id); + } + + $add_new_organizer = ($is_fes_form and isset($settings['fes_add_organizer'])) ? $settings['fes_add_organizer'] : 1; + ?> +
    +

    m('taxonomy_organizer', esc_html__('Organizer', 'modern-events-calendar-lite'))); ?>

    +
    + + +
    +
    +

    +
    + +
    +
    +
    +
    + +

    +
    +
    + +

    +
    +
    + +

    +
    +
    + +

    +
    +
    + +

    +
    + +
    +
    + + + +
    + +
    + + + + +
    + +
    + +
    +

    m('other_organizers', esc_html__('Other Organizers', 'modern-events-calendar-lite'))); ?>

    +
    +

    +
    + + +
    +
    +
    +
      + +
    • + + + + name); ?> +
    • + +
    +
    +
    + +
    + ID ); + + $bookings_limit = isset($booking_options['bookings_limit']) ? $booking_options['bookings_limit'] : ''; + $bookings_limit_unlimited = isset($booking_options['bookings_limit_unlimited']) && $booking_options['bookings_limit_unlimited'] == 1 ? true : false; + ?> +
    +

    +
    + + +
    +
    + ID ); + $bookings_date_selection = isset($booking_options['bookings_date_selection']) ? $booking_options['bookings_date_selection'] : 'global'; + ?> +
    +

    +
    + +
    + +
    +
    +
    + ID ); + + $bookings_minimum_per_booking = (isset($booking_options['bookings_minimum_per_booking']) and trim($booking_options['bookings_minimum_per_booking'])) ? (int) $booking_options['bookings_minimum_per_booking'] : 1; + ?> +
    +

    +
    + +
    +
    + ID ); + + global $wp_roles; + $roles = $wp_roles->get_names(); + + $loggedin_discount = isset($booking_options['loggedin_discount']) ? $booking_options['loggedin_discount'] : ''; + + ?> +
    +

    + $role_name): + $role_discount = isset($booking_options['roles_discount_'.$role_key]) ? $booking_options['roles_discount_'.$role_key] : $loggedin_discount; + ?> +
    +
    + +
    + +
    + +
    + ID ); + + $bookings_all_occurrences = isset($booking_options['bookings_all_occurrences']) ? $booking_options['bookings_all_occurrences'] : 0; + $bookings_all_occurrences_multiple = isset($booking_options['bookings_all_occurrences_multiple']) ? $booking_options['bookings_all_occurrences_multiple'] : 0; + + ?> +
    +

    +
    + +
    +
    + +
    +
    + ID ); + + $bookings_stop_selling_after_first_occurrence = isset($booking_options['stop_selling_after_first_occurrence']) ? $booking_options['stop_selling_after_first_occurrence'] : 0; + ?> +
    +

    +
    + +
    + + +
    +
    +

    +
    + +
    +
    +
    +
    + +
    +
    + ID ); + + ?> +
    +

    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + get_settings(); + + $booking_options = static::get_booking_options( $post->ID ); + + $bookings_last_few_tickets_percentage_inherite = $booking_options['last_few_tickets_percentage_inherit'] ?? 1; + $bookings_last_few_tickets_percentage = ((isset($booking_options['last_few_tickets_percentage']) and trim($booking_options['last_few_tickets_percentage']) != '') ? max(1, $booking_options['last_few_tickets_percentage']) : (isset($settings['booking_last_few_tickets_percentage']) ? max(1, $settings['booking_last_few_tickets_percentage']) : 15)); + + ?> +
    +
    +

    +
    + + type="number" min="1" max="100" step="1" name="mec[booking][last_few_tickets_percentage]" value="" placeholder=""/> +
    +
    +
    + ID ); + + $bookings_thankyou_page_inherit = isset($booking_options['thankyou_page_inherit']) ? $booking_options['thankyou_page_inherit'] : 1; + + $pages = get_pages(); + ?> + +
    +

    +
    + +
    +
    > +
    +
    + +
    + + +
    +
    +

    +
    + +
    +
    +
    +
    + +
    + + +
    +
    +

    +
    + +
    +
    +
    +
    +
    + + ID ); + + $bookings_booking_button_label = ((isset($booking_options['bookings_booking_button_label']) and trim($booking_options['bookings_booking_button_label']) != '') ? $booking_options['bookings_booking_button_label'] : ''); + + ?> +
    +

    +
    + +
    +
    + getPartialPayment(); + + // Partial Payment per event is not enabled + if(!$partial_payment->is_payable_per_event_enabled()) return; + + $booking_options = static::get_booking_options( $post->ID ); + + $payable_inherit = !isset($booking_options['bookings_payable_inherit']) || $booking_options['bookings_payable_inherit']; + $payable = $booking_options['bookings_payable'] ?? 100; + $payable_type = $booking_options['bookings_payable_type'] ?? 'percent'; + + // Validate + list($payable, $payable_type) = $partial_payment->validate_payable_options($payable, $payable_type); + ?> +
    +

    +
    + +
    +
    > +
    +
    + +
    + + +
    +
    +
    +
    + ID ); + + $bookings_user_limit = $booking_options['bookings_user_limit'] ?? ''; + $bookings_user_limit_unlimited = $booking_options['bookings_user_limit_unlimited'] ?? true; + + ?> +
    +

    +
    + + type="text" name="mec[booking][bookings_user_limit]" id="mec_bookings_user_limit" + value="" placeholder=""/> +
    +
    + get_gateways_options(); + + if( !( isset($gateway_settings['gateways_per_event']) and $gateway_settings['gateways_per_event'] ) ){ + + if( $is_edit_mode ){ + + echo '
    +

    ' + .'' + . esc_html__('Payment gateways per event is disabled.', 'modern-events-calendar-lite') + .'' + .'' . esc_html__('How to set', 'modern-events-calendar-lite') . ' ' + .'

    ' + .'
    '; + } + + return; + } + + $gateways = \MEC\Base::get_main()->get_gateways(); + $enableds_gateways = []; + foreach($gateways as $gateway){ + + if(!$gateway->enabled()) continue; + $enableds_gateways[] = $gateway; + } + + if( $is_edit_mode && empty( $enableds_gateways ) ){ + + echo '
    +

    ' + .'' + . esc_html__('There is no payment gateway to show.', 'modern-events-calendar-lite') + .'' + .'' . esc_html__('How to set', 'modern-events-calendar-lite') . ' ' + .'

    ' + .'
    '; + + return; + } + + $booking_options = static::get_booking_options( $post->ID ); + + ?> +
    +

    +

    + + +
    + +
    + +
    + get_settings(); + + $booking_options = static::get_booking_options( $post->ID ); + + $global_inheritance = get_post_meta($post->ID, 'mec_fees_global_inheritance', true); + if (trim($global_inheritance) == '') { + $global_inheritance = 1; + } + + $fees = get_post_meta($post->ID, 'mec_fees', true); + + $global_fees = isset($settings['fees']) ? $settings['fees'] : []; + if (!is_array($fees) and trim($fees) == '') { + $fees = $global_fees; + } + + if (!is_array($fees)) { + $fees = []; + } + ?> +
    +

    +
    +
    + +
    +
    +
    + +
    +
    + $fee) : + if (!is_numeric($key)) { + continue; + } + $i = max($i, $key); + ?> +
    +
    + +
    +
    + + + +
    +
    +

    +

    +
    + +
    +
    + + + + +
    +
    + +
    +
    +
    + +
    +
    +
    + +
    +
    + + + +
    +
    +

    +

    +
    + +
    +
    + + + + +
    +
    +
    +
    + ID, 'mec_reg_fields_global_inheritance', true); + if(trim($global_inheritance) == '') $global_inheritance = 1; + + $reg_fields = get_post_meta($post->ID, 'mec_reg_fields', true); + $global_reg_fields = \MEC\Base::get_main()->get_reg_fields(); + + if((is_array($reg_fields) and !count($reg_fields)) or (!is_array($reg_fields) and trim($reg_fields) == '')) $reg_fields = $global_reg_fields; + if(!is_array($reg_fields)) $reg_fields = []; + + $bfixed_fields = get_post_meta($post->ID, 'mec_bfixed_fields', true); + $global_bfixed_fields = \MEC\Base::get_main()->get_bfixed_fields(); + + if((is_array($bfixed_fields) and !count($bfixed_fields)) or (!is_array($bfixed_fields) and trim($bfixed_fields) == '')) $bfixed_fields = $global_bfixed_fields; + if(!is_array($bfixed_fields)) $bfixed_fields = []; + + $mec_name = false; + $mec_email = false; + + foreach($reg_fields as $field) + { + if(isset($field['type'])) + { + if($field['type'] == 'mec_email') $mec_email = true; + if($field['type'] == 'name') $mec_name = true; + } + else break; + } + + if(!$mec_name) + { + array_unshift($reg_fields, array( + 'mandatory' => '0', + 'type' => 'name', + 'label' => esc_html__('Name', 'modern-events-calendar-lite'), + )); + } + + if(!$mec_email) + { + array_unshift($reg_fields, array( + 'mandatory' => '0', + 'type' => 'mec_email', + 'label' => esc_html__('Email', 'modern-events-calendar-lite'), + )); + } + ?> +
    +

    + + ID != \MEC\Base::get_main()->get_original_event($post->ID)) : ?> +

    + + +
    +
    + +
    + ID); ?> +
    + +
    +
    + + + +
      + $reg_field) + { + if(!is_numeric($key)) continue; + + $i = max($i, $key); + + if($reg_field['type'] == 'text') echo \MEC_kses::form(\MEC\Base::get_main()->field_text($key, $reg_field)); + elseif($reg_field['type'] == 'mec_email') echo \MEC_kses::form(\MEC\Base::get_main()->field_mec_email($key, $reg_field)); + elseif($reg_field['type'] == 'name') echo \MEC_kses::form(\MEC\Base::get_main()->field_name($key, $reg_field)); + elseif($reg_field['type'] == 'email') echo \MEC_kses::form(\MEC\Base::get_main()->field_email($key, $reg_field)); + elseif($reg_field['type'] == 'date') echo \MEC_kses::form(\MEC\Base::get_main()->field_date($key, $reg_field)); + elseif($reg_field['type'] == 'file') echo \MEC_kses::form(\MEC\Base::get_main()->field_file($key, $reg_field)); + elseif($reg_field['type'] == 'tel') echo \MEC_kses::form(\MEC\Base::get_main()->field_tel($key, $reg_field)); + elseif($reg_field['type'] == 'textarea') echo \MEC_kses::form(\MEC\Base::get_main()->field_textarea($key, $reg_field)); + elseif($reg_field['type'] == 'p') echo \MEC_kses::form(\MEC\Base::get_main()->field_p($key, $reg_field)); + elseif($reg_field['type'] == 'checkbox') echo \MEC_kses::form(\MEC\Base::get_main()->field_checkbox($key, $reg_field)); + elseif($reg_field['type'] == 'radio') echo \MEC_kses::form(\MEC\Base::get_main()->field_radio($key, $reg_field)); + elseif($reg_field['type'] == 'select') echo \MEC_kses::form(\MEC\Base::get_main()->field_select($key, $reg_field)); + elseif($reg_field['type'] == 'agreement') echo \MEC_kses::form(\MEC\Base::get_main()->field_agreement($key, $reg_field)); + } + ?> +
    +
    + + + + + + + + + + + + + +
    + +
    +
    + field_text(':i:')); ?> +
    +
    + field_email(':i:')); ?> +
    +
    + field_mec_email(':i:')); ?> +
    +
    + field_name(':i:')); ?> +
    +
    + field_tel(':i:')); ?> +
    +
    + field_date(':i:')); ?> +
    +
    + field_file(':i:')); ?> +
    +
    + field_textarea(':i:')); ?> +
    +
    + field_checkbox(':i:')); ?> +
    +
    + field_radio(':i:')); ?> +
    +
    + field_select(':i:')); ?> +
    +
    + field_agreement(':i:')); ?> +
    +
    + field_p(':i:')); ?> +
    +
    + field_option(':fi:', ':i:')); ?> +
    +
    +
    +
    +
    +
    + + + +
      + $bfixed_field) + { + if(!is_numeric($key)) continue; + if(!is_array($bfixed_field)) continue; + $b = max($b, $key); + + if($bfixed_field['type'] == 'text') echo \MEC_kses::form(\MEC\Base::get_main()->field_text($key, $bfixed_field, 'bfixed')); + elseif($bfixed_field['type'] == 'name') echo \MEC_kses::form(\MEC\Base::get_main()->field_name($key, $bfixed_field, 'bfixed')); + elseif($bfixed_field['type'] == 'mec_email') echo \MEC_kses::form(\MEC\Base::get_main()->field_mec_email($key, $bfixed_field, 'bfixed')); + elseif($bfixed_field['type'] == 'email') echo \MEC_kses::form(\MEC\Base::get_main()->field_email($key, $bfixed_field, 'bfixed')); + elseif($bfixed_field['type'] == 'date') echo \MEC_kses::form(\MEC\Base::get_main()->field_date($key, $bfixed_field, 'bfixed')); + elseif($bfixed_field['type'] == 'file') echo \MEC_kses::form(\MEC\Base::get_main()->field_file($key, $bfixed_field, 'bfixed')); + elseif($bfixed_field['type'] == 'tel') echo \MEC_kses::form(\MEC\Base::get_main()->field_tel($key, $bfixed_field, 'bfixed')); + elseif($bfixed_field['type'] == 'textarea') echo \MEC_kses::form(\MEC\Base::get_main()->field_textarea($key, $bfixed_field, 'bfixed')); + elseif($bfixed_field['type'] == 'p') echo \MEC_kses::form(\MEC\Base::get_main()->field_p($key, $bfixed_field, 'bfixed')); + elseif($bfixed_field['type'] == 'checkbox') echo \MEC_kses::form(\MEC\Base::get_main()->field_checkbox($key, $bfixed_field, 'bfixed')); + elseif($bfixed_field['type'] == 'radio') echo \MEC_kses::form(\MEC\Base::get_main()->field_radio($key, $bfixed_field, 'bfixed')); + elseif($bfixed_field['type'] == 'select') echo \MEC_kses::form(\MEC\Base::get_main()->field_select($key, $bfixed_field, 'bfixed')); + elseif($bfixed_field['type'] == 'agreement') echo \MEC_kses::form(\MEC\Base::get_main()->field_agreement($key, $bfixed_field, 'bfixed')); + } + ?> +
    +
    + + + + + + + + + + +
    +
    + +
    +
    + field_text(':i:', array(), 'bfixed')); ?> +
    +
    + field_email(':i:', array(), 'bfixed')); ?> +
    +
    + field_tel(':i:', array(), 'bfixed')); ?> +
    +
    + field_date(':i:', array(), 'bfixed')); ?> +
    +
    + field_textarea(':i:', array(), 'bfixed')); ?> +
    +
    + field_checkbox(':i:', array(), 'bfixed')); ?> +
    +
    + field_radio(':i:', array(), 'bfixed')); ?> +
    +
    + field_select(':i:', array(), 'bfixed')); ?> +
    +
    + field_agreement(':i:', array(), 'bfixed')); ?> +
    +
    + field_p(':i:', array(), 'bfixed')); ?> +
    +
    + field_option(':fi:', ':i:', array(), 'bfixed')); ?> +
    +
    +
    + +
    +
    +
    + ID); + } + + /** + * Return ticket variations html field + * + * @param WP_Post $post + * @param array $atts + * + * @since 1.0.0 + * + * @return void + */ + public static function ticket_variations( $post, $atts = array() ){ + + if( !static::booking_demo_check( $post, $atts ) ){ + + return; + } + + $settings = \MEC\Settings\Settings::getInstance()->get_settings(); + + $global_inheritance = get_post_meta($post->ID, 'mec_ticket_variations_global_inheritance', true); + if(trim($global_inheritance) == '') $global_inheritance = 1; + + $ticket_variations = get_post_meta($post->ID, 'mec_ticket_variations', true); + $global_variations = $settings['ticket_variations'] ?? []; + + if(!is_array($ticket_variations) and trim($ticket_variations) == '') $ticket_variations = $global_variations; + if(!is_array($ticket_variations)) $ticket_variations = []; + + // Ticket Variations Object + $TicketVariations = \MEC\Base::get_main()->getTicketVariations(); + ?> +
    +

    +
    +
    + +
    +
    +
    + +
    +
    + $ticket_variation) + { + if(!is_numeric($key)) continue; + + $i = max($i, $key); + $TicketVariations->item([ + 'i' => $i, + 'value' => $ticket_variation, + ]); + } + ?> +
    +
    +
    + +
    + item([ + 'i' => ':i:', + 'value' => [], + ]); + ?> +
    +
    + post_status) and $post->post_status != 'auto-draft'); + if($draft) return; + + $limit = 100; + $now = current_time('timestamp'); + $_6months_ago = strtotime('-6 Months', $now); + + $occ = new \MEC_feature_occurrences(); + $occurrences = $occ->get_dates($post->ID, $now, $limit); + + $date_format = get_option('date_format'); + $time_format = get_option('time_format'); + $datetime_format = $date_format.' '.$time_format; + + $db = \MEC\Base::get_main()->getDB(); + $booking_dates = $db->select("SELECT `date` FROM `#__mec_bookings` WHERE `event_id`='".esc_sql($post->ID)."' GROUP BY `date` ORDER BY `date`", 'loadColumn'); + $booking_dates_for_manage = $db->select("SELECT `date` FROM `#__mec_bookings` WHERE `event_id`='".esc_sql($post->ID)."' AND `verified`=1 GROUP BY `date` ORDER BY `date`", 'loadColumn'); + + do_action('mec_events_meta_box_attendees_start', $post); + ?> +
    +

    +
    +
    + +
    +
    +
    +
    + + + '.esc_html(date_i18n($datetime_format, strtotime($booking_date))).''; + + $from = ''; + + $to_options = ''; + foreach($occurrences as $occurrence) $to_options .= ''; + + $to = ''; + ?> +

    +
    +
    + + +
    +
    +
    + + + '.esc_html(date_i18n($datetime_format, strtotime($booking_date_for_manage))).''; + + $dates_manage = ''; + ?> +

    +
    +
    + + + +
    +
    +
    + +
    + + get_settings(); + + $tickets = get_post_meta($post->ID, 'mec_tickets', true); + if(!is_array($tickets)) $tickets = []; + + // Global Tickets + $global_tickets = isset($settings['default_tickets_status']) && $settings['default_tickets_status']; + $global_tickets_applied = (int) get_post_meta($post->ID, 'mec_global_tickets_applied', true); + + // Global Tickets + if($global_tickets && !count($tickets) && ($post->ID == -1 || get_post_status($post->ID) === 'auto-draft' || $global_tickets_applied == 0)) + { + $tickets = is_array($settings['tickets']) ? $settings['tickets'] : []; + } + + // Tickets + $ticketBuilder = $main->getTickets(); + ?> +
    + + +
    +
    +
    +
    +
    +
    + + +

    m('tickets', esc_html__('Tickets', 'modern-events-calendar-lite'))); ?>

    + + ID != $main->get_original_event($post->ID)): ?> +

    + + + builder([ + 'tickets' => $tickets, + 'object_id' => $post->ID, + ]); ?> +
    + ID, 'mec_public_dl_file', true); + if(trim($file_id) == '') $file_id = ''; + + $file_url = $file_id ? wp_get_attachment_url($file_id) : ''; + + $title = get_post_meta($post->ID, 'mec_public_dl_title', true); + $description = get_post_meta($post->ID, 'mec_public_dl_description', true); + ?> + +
    +

    +
    + + +

    + + +
    +
    +
    + + +
    +
    + + +
    +
    + ID, 'mec_dl_file', true); + if(trim($file_id) == '') $file_id = ''; + + $file_url = $file_id ? wp_get_attachment_url($file_id) : ''; + ?> + +
    +

    +
    + + +

    + + +
    +
    +
    + post_status) and $post->post_status != 'auto-draft') ? false : true; + $repeat_status = get_post_meta($post->ID, 'mec_repeat_status', true); + + if($draft or !$repeat_status) return; + + $limit = 100; + $now = current_time('timestamp'); + $_6months_ago = strtotime('-6 Months', $now); + + $occurrences = $occurencesClass->get_dates($post->ID, $now, $limit); + + $date_format = get_option('date_format'); + $time_format = get_option('time_format'); + $datetime_format = $date_format.' '.$time_format; + + $all_occurrences = $occurencesClass->get_all_occurrences($post->ID, strtotime('-1 Month')); + ?> +
    +

    +
    +
    + + +
    +
      + get_occurrence_form($all_occurrence['id'])); ?> +
    +
    +
    + + ID, 'mec_imported_from_google', true ); + if( $imported_from_google ): ?> +

    + +
    + + + + get_event_label_status(get_post_status($post->ID)); ?> + + + +
    + getCaptcha()->status('fes'); + + if( $is_edit_mode && !$status ) + { + echo '
    +

    ' + .'' + . esc_html__('Captcha is not enabled.', 'modern-events-calendar-lite') + .'' + .'' . esc_html__('How to set', 'modern-events-calendar-lite') . ' ' + .'

    ' + .'
    '; + } + + if($status) echo \MEC\Base::get_main()->getCaptcha()->field(); + } + + /** + * Return submit button html field + * + * @param WP_Post $post + * @param array $atts + * + * @since 1.0.0 + * + * @return void + */ + public static function submit_button( $post, $atts = array() ){ + + ?> + +
    + + + + +
    + + + + ID != -1 && $post == "") { + + $post = get_post_meta($post->ID, 'meta_box_virtual', true); + } + + do_action('mec_virtual_event_form', $post); + } + + /** + * Return zoom html field + * + * @param WP_Post $post + * @param array $atts + * + * @since 1.0.0 + * + * @return void + */ + public static function zoom( $post, $atts = array() ){ + + ?> + + ID != -1 && $post == "") { + + $post = get_post_meta($post->ID, 'meta_box_virtual', true); + } + + do_action('mec_zoom_event_form', $post); + } + + /** + * Return other html fields + * + * @param WP_Post $post + * @param array $atts + * + * @since 1.0.0 + * + * @return void + */ + public static function other_fields( $post, $atts = array() ){ + + do_action('mec_fes_metabox_details', $post); + } + + /** + * Register style and scripts + * + * @since 1.0.0 + * + * @return void + */ + public static function register_style_and_scripts(){ + + wp_register_script( 'mec-fes-form-builder', plugin_dir_url( __FILE__ ) . 'scripts.js', array( 'jquery' ), MEC_VERSION ); + } + + /** + * Enqueue style and scripts + * + * @since 1.0.0 + * + * @return void + */ + public static function enqueue(){ + + static::register_style_and_scripts(); + + wp_enqueue_script( 'mec-fes-form-builder' ); + + do_action( 'mec_fes_form_enqueue_scripts' ); + } + + /** + * Return html + * + * @return string + */ + public function output( $event ){ + + $html = ''; + + return $html; + } +} diff --git a/app/core/src/FES/index.php b/app/core/src/FES/index.php new file mode 100755 index 0000000..40d16fd --- /dev/null +++ b/app/core/src/FES/index.php @@ -0,0 +1,5 @@ +"); + jQuery("#mec_fes_remove_image_button").removeClass("mec-util-hidden"); + } else { + jQuery("#mec_fes_thumbnail_error").html(data.message).removeClass("mec-util-hidden"); + } + }); + + return false; +} + +function mec_fes_upload_location_thumbnail() { + var fd = new FormData(); + + fd.append("action", "mec_fes_upload_featured_image"); + fd.append("_wpnonce", mecdata.fes_upload_nonce); + fd.append("file", jQuery("#mec_fes_location_thumbnail_file").prop("files")[0]); + + // Submit Button + const $button = jQuery('.mec-fes-sub-button'); + + // Disable Button + $button.prop('disabled', true); + + jQuery.ajax({ + url: mecdata.ajax_url, + type: "POST", + data: fd, + dataType: "json", + processData: false, + contentType: false + }) + .done(function (data) { + // Enable Button + $button.prop('disabled', false); + + jQuery("#mec_fes_location_thumbnail").val(data.data.url); + jQuery("#mec_fes_location_thumbnail_file").val(""); + jQuery("#mec_fes_location_thumbnail_img").html(""); + jQuery("#mec_fes_location_remove_image_button").removeClass("mec-util-hidden"); + }); + + return false; +} + +function mec_fes_upload_organizer_thumbnail() { + var fd = new FormData(); + + fd.append("action", "mec_fes_upload_featured_image"); + fd.append("_wpnonce", mecdata.fes_upload_nonce); + fd.append("file", jQuery("#mec_fes_organizer_thumbnail_file").prop("files")[0]); + + // Submit Button + const $button = jQuery('.mec-fes-sub-button'); + + // Disable Button + $button.prop('disabled', true); + + jQuery.ajax({ + url: mecdata.ajax_url, + type: "POST", + data: fd, + dataType: "json", + processData: false, + contentType: false + }) + .done(function (data) { + // Enable Button + $button.prop('disabled', false); + + jQuery("#mec_fes_organizer_thumbnail").val(data.data.url); + jQuery("#mec_fes_organizer_thumbnail_file").val(""); + jQuery("#mec_fes_organizer_thumbnail_img").html(""); + jQuery("#mec_fes_organizer_remove_image_button").removeClass("mec-util-hidden"); + }); + + return false; +} + +jQuery(document).ready(function ($) { + var mec_fes_form_ajax = false; + $("#mec_fes_form").on("submit", function (event) { + event.preventDefault(); + + var $form = $("#mec_fes_form"); + + // Hide the message + $("#mec_fes_form_message").removeClass("mec-error").removeClass("mec-success").html("").hide(); + + // Add loading Class to the form + $form.addClass("mec-fes-loading"); + $(".mec-fes-form-cntt").hide(); + $(".mec-fes-form-sdbr").hide(); + $(".mec-fes-submit-wide").hide(); + + // Fix WordPress editor issue + $("#mec_fes_content-html").click(); + $("#mec_fes_content-tmce").click(); + + // Abort previous request + if (mec_fes_form_ajax) mec_fes_form_ajax.abort(); + + var data = $form.serialize(); + mec_fes_form_ajax = $.ajax({ + type: "POST", + url: mecdata.ajax_url, + data: data, + dataType: "JSON", + success: function (response) { + // Remove the loading Class from the form + $("#mec_fes_form").removeClass("mec-fes-loading"); + $(".mec-fes-form-cntt").show(); + $(".mec-fes-form-sdbr").show(); + $(".mec-fes-submit-wide").show(); + + if (response.success == "1") { + // Show the message + $("#mec_fes_form_message").removeClass("mec-error").removeClass("mec-success").addClass("mec-success").html(response.message).css("display", "inline-block"); + + // Set the event id + $(".mec-fes-post-id").val(response.data.post_id); + + // Redirect Currnet Page + if (response.data.redirect_to !== "") { + setTimeout(function () { + window.location.href = response.data.redirect_to; + }, mecdata.fes_thankyou_page_time ); + } + } else { + // Refresh reCaptcha + if (response.code === "CAPTCHA_IS_INVALID" && typeof grecaptcha !== "undefined") { + grecaptcha.reset(); + } + + // Show the message + $("#mec_fes_form_message").removeClass("mec-error").addClass("mec-error").html(response.message).css("display", "inline-block"); + } + $("#mec_fes_form_message").get(0).scrollIntoView({behavior: 'smooth', block: 'end'}); + }, + error: function (jqXHR, textStatus, errorThrown) { + // Remove the loading Class from the form + $("#mec_fes_form").removeClass("loading"); + } + }); + }); + + // Location select2 + jQuery(".mec-additional-locations select").select2(); + jQuery("#mec_location_id").select2(); + + // Organizer Select2 + jQuery(".mec-additional-organizers select").select2(); + jQuery("#mec_organizer_id").select2(); +}); \ No newline at end of file diff --git a/app/core/src/Forms/CustomForm.php b/app/core/src/Forms/CustomForm.php new file mode 100755 index 0000000..1cdb25a --- /dev/null +++ b/app/core/src/Forms/CustomForm.php @@ -0,0 +1,162 @@ +get_settings( $status_key ); + switch ( $status ) { + case 'enable': + + break; + case 'default': + default: + $group_keys = explode( '_', $form_id ); + $group_id = str_replace( end( $group_keys ), 'general', $group_id ); + break; + } + } + + $options = Settings::getInstance()->get_options(); + $fields = isset( $options[ $group_id ] ) ? $options[ $group_id ] : []; + + + return apply_filters( 'mec_get_custom_form_fields', $fields, $event_id, $form_id, $group_id, $primary_group_id,$translated_event_id ); + } + + + public function get_reg_fields( $group_id, $event_id = null, $translated_event_id = null ) { + + $group_id .= '_reg'; + $mec_email = false; + $mec_first_name = false; + $mec_last_name = false; + + $fields = $this->get_fields( $group_id, $event_id, $translated_event_id ); + + if ( !is_array( $fields ) ) { + $fields = []; + } + + foreach ( $fields as $k => $field ) { + if ( isset( $field['type'] ) ) { + if ( 'first_name' === $field['type'] ) { + $mec_first_name = true; + $fields[$k]['mapping'] = 'first_name'; + } + + if ( 'last_name' === $field['type'] ) { + $mec_last_name = true; + $fields[$k]['mapping'] = 'last_name'; + } + + if ( 'mec_email' === $field['type'] ) { + $mec_email = true; + } + } else { + break; + } + } + + if ( !$mec_last_name ) { + array_unshift( + $fields, + array( + 'mandatory' => '0', + 'type' => 'last_name', + 'mapping' => 'last_name', + 'label' => esc_html__( 'Last Name', 'modern-events-calendar-lite'), + ) + ); + } + + if ( !$mec_first_name ) { + array_unshift( + $fields, + array( + 'mandatory' => '0', + 'type' => 'first_name', + 'mapping' => 'first_name', + 'label' => esc_html__( 'First Name', 'modern-events-calendar-lite'), + ) + ); + } + + if ( !$mec_email ) { + array_unshift( + $fields, + array( + 'mandatory' => '0', + 'type' => 'mec_email', + 'label' => esc_html__( 'Email', 'modern-events-calendar-lite'), + ) + ); + } + + return $fields; + } + + public function get_fixed_fields( $group_id, $event_id = null, $translated_event_id = null ) { + + $group_id .= '_bfixed'; + + return $this->get_fields( $group_id, $event_id, $translated_event_id ); + } + + public function display_reg_fields( $group_id, $event_id = null, $attendee_id = 0, $translated_event_id = null, $data = array() ) { + + if ( is_null( $event_id ) ) { + + $event_id = get_the_ID(); + } + + $fields = $this->get_reg_fields( $group_id, $event_id ); + ob_start(); + DisplayFields::display_fields( $group_id, 'reg', $fields, $attendee_id,[], $data ); + + return ob_get_clean(); + } + + public function display_fixed_fields( $group_id, $event_id = null, $translated_event_id = null, $data = array() ) { + + if ( is_null( $event_id ) ) { + + $event_id = get_the_ID(); + } + + $fields = $this->get_fixed_fields( $group_id, $event_id ); + ob_start(); + DisplayFields::display_fields( $group_id, 'fixed', $fields, 0, [], $data ); + + return ob_get_clean(); + } + + public function display_fields( $group_id, $event_id = null, $attendee_id = 0,$data = [] ) { + + $fixed_data = isset($data['fixed']) && is_array($data['fixed']) ? $data['fixed'] : []; + $html = $this->display_fixed_fields( $group_id, $event_id, null, $fixed_data ); + + $reg_data = isset($data['reg']) && is_array($data['reg']) ? $data['reg'] : []; + $html .= $this->display_reg_fields( $group_id, $event_id, $attendee_id, null, $reg_data ); + + return $html; + } + +} \ No newline at end of file diff --git a/app/core/src/Forms/DisplayFields.php b/app/core/src/Forms/DisplayFields.php new file mode 100755 index 0000000..5f21478 --- /dev/null +++ b/app/core/src/Forms/DisplayFields.php @@ -0,0 +1,257 @@ + + + $field ) : + + if(in_array($field_id, [':i:',':fi:','_i_','_fi_',], true)){ + + continue; + } + + $type = isset( $field['type'] ) ? $field['type'] : false; + if ( false === $type ) { + continue; + } + + $j = !is_null($j) ? $j : $field_id; + $field_id = isset($field['key']) && !empty($field['key']) ? $field['key'] : $field_id; + $html_id = 'mec_field_' . $group_id . '_' . $type . '_' . $j; + $required = ( ( isset( $field['required'] ) && $field['required'] ) || ( isset( $field['mandatory'] ) && $field['mandatory'] ) ) ? 'required="required"' : ''; + $field_label = isset($field['label']) ? $field['label'] : null; + + $field_name = strtolower( str_replace( [ + ' ', + ',', + ':', + '"', + "'", + ], '_', $field_label ) ); + + $field_id = strtolower( str_replace( [ + ' ', + ',', + ':', + '"', + "'", + ], '_', $field_id ) ); + + if ( isset( $field['single_row'] ) && 'enable' === $field['single_row'] ) : ?> +
    + + + +
    + first_name; + break; + case 'last_name': + $field_type = 'text'; + $field_id = 'last_name'; + $field['label'] = isset( $field['label'] ) ? $field['label'] : esc_html__('Last Name', 'modern-events-calendar-lite'); + $value = $current_user->last_name; + break; + case 'mec_email': + $field_type = 'email'; + $field_id = $type; + $field['label'] = isset( $field['label'] ) ? $field['label'] : esc_html__('Email', 'modern-events-calendar-lite'); + $value = isset( $current_user->user_email ) ? $current_user->user_email : ''; + case 'email': + $field_type = 'email'; + $field['label'] = isset( $field['label'] ) ? $field['label'] : 'Email'; + $value = isset( $current_user->user_email ) ? $current_user->user_email : ''; + break; + case 'text': + $field_type = 'text'; + $field['label'] = isset( $field['label'] ) ? $field['label'] : ''; + $value = ''; + break; + case 'date': + $field_type = 'date'; + $field['label'] = isset( $field['label'] ) ? $field['label'] : 'Date'; + $value = ''; + $class = 'mec-date-picker'; + $attributes = ' min="' . esc_attr( date( 'Y-m-d', strtotime( '-100 years' ) ) ) . '" max="' . esc_attr( date( 'Y-m-d', strtotime( '+100 years' ) ) ) . '" onload="mec_add_datepicker()"'; + break; + case 'file': + $field_type = 'file'; + $field['label'] = isset( $field['label'] ) ? $field['label'] : 'File'; + $value = ''; + break; + case 'tel': + $field_type = 'tel'; + $field['label'] = isset( $field['label'] ) ? $field['label'] : 'Tel'; + $value = ''; + break; + case 'textarea': + $field_type = 'textarea'; + $field['label'] = isset( $field['label'] ) ? $field['label'] : ''; + $value = ''; + break; + case 'select': + $field_type = 'select'; + $field['label'] = isset( $field['label'] ) ? $field['label'] : ''; + $value = ''; + $selected = ''; + break; + case 'radio': + case 'checkbox': + $field_type = $type; + $value = ''; + break; + case 'agreement': + + break; + + } + + if( 'fixed' === $form_type || ( 'reg' === $form_type && in_array($field_id,['mec_email','first_name','last_name'],true) ) ){ + + $field_id = 'mec_email' === $field_id ? 'email' : $field_id; + $value = isset($data[$field_id]) ? $data[$field_id] : $value; + } else { + + $value = isset($data[$form_type][$field_id]) ? $data[$form_type][$field_id] : $value; + } + + $lock_field = !empty( $value ); + $lock_field = ( $lock_field && ( $lock_prefilled == 1 or ( $lock_prefilled == 2 and $j == 1 ) ) ) ? 'readonly' : ''; + + if('reg' === $form_type){ + + $field_name = 'rsvp[attendees][' . esc_attr($j) . '][' . esc_attr($form_type) . '][' . esc_attr($field_id) . ']'; + }else{ + + $field_name = 'rsvp[' . esc_attr($form_type) . '][' . esc_attr($field_id) . ']'; + } + // Display Label + if ( isset( $field['label'] ) && !empty( $field['label'] ) && 'agreement' !== $type ) { + + $label_field = ''; + + echo is_admin() ? '
    '.\MEC_kses::form($label_field).'
    ' : \MEC_kses::form($label_field); + } + + $input_html = ''; + // Display Input + switch ( $type ) { + case 'first_name': + case 'last_name': + case 'mec_email': + + $placeholder = ( isset( $field['placeholder'] ) && $field['placeholder'] ) ? esc_html__( $field['placeholder'], 'modern-events-calendar-lite') : esc_html__( $field['label'], 'modern-events-calendar-lite'); + $input_html = ''; + + break; + case 'text': + case 'date': + case 'file': + case 'email': + case 'tel': + + $placeholder = ( isset( $field['placeholder'] ) && $field['placeholder'] ) ? esc_html__( $field['placeholder'], 'modern-events-calendar-lite') : esc_html__( $field['label'], 'modern-events-calendar-lite'); + $input_html = ''; + + break; + case 'textarea': + + $placeholder = ( isset( $field['placeholder'] ) && $field['placeholder'] ) ? esc_html__( $field['placeholder'], 'modern-events-calendar-lite') : esc_html__( $field['label'], 'modern-events-calendar-lite'); + $input_html = ''; + + break; + case 'select': + + $placeholder = ''; + $input_html = ''; + + break; + case 'radio': + case 'checkbox': + $options = isset($field['options']) ? $field['options'] : []; + foreach ( $options as $field_option ) { + $current_value = esc_html__( $field_option['label'], 'modern-events-calendar-lite'); + $checked = in_array($current_value,(array)$value); + $input_html .= ''; + } + + break; + case 'agreement': + + $checked = isset( $field['status'] ) ? $field['status'] : 'checked'; + $input_html = ''; + + break; + + case 'p': + + $input_html = '

    ' . do_shortcode( stripslashes( $field['content'] ) ) . '

    '; + + break; + } + + echo is_admin() ? '
    '.\MEC_kses::form($input_html).'
    ' : \MEC_kses::form($input_html); + ?> +
    + get_wp_user_fields_dropdown( + 'mec[' . esc_attr( $prefix ) . '_fields][' . esc_attr( $key ) . '][mapping]', + $v + ); + } + + $html .= '
    + +
    '; + + + return $html; + } + + /** + * Show text field options in booking form + * + * @param string $key + * @param array $values + * @param string $prefix + * + * @return string + */ + public function field_text( $key, $values = array(), $prefix = 'reg' ) { + + return '
  • + ' . esc_html__( 'Sort', 'modern-events-calendar-lite') . ' + ' . esc_html__( 'Text', 'modern-events-calendar-lite') . ' + ' . ( $prefix === 'event' ? '%%event_field_' . esc_attr( $key ) . '%%' : ( $prefix === 'bfixed' ? '%%booking_field_' . esc_attr( $key ) . '%%' : '' ) ) . ' + ' . ( str_contains($prefix, 'rsvp',) && str_contains($prefix, 'bfixed') ? '%%rsvp_field_' . esc_attr( $key ) . '%%' : '' ) . ' +

    + +

    + ' . esc_html__( 'Remove', 'modern-events-calendar-lite') . ' +
    + + + ' . $this->input_key( $key, 'text', $values, $prefix ) . ' +
    +
  • '; + } + + /** + * Show text field options in booking form + * + * @param string $key + * @param array $values + * @param string $prefix + * + * @return string + */ + public function field_name( $key, $values = array(), $prefix = 'reg' ) { + + $type = $values['type']; + switch($type){ + case 'first_name': + + $label = esc_html__( 'MEC First Name', 'modern-events-calendar-lite'); + break; + case 'last_name': + + $label = esc_html__( 'MEC Last Name', 'modern-events-calendar-lite'); + break; + default: + + $label = esc_html__( 'MEC Name', 'modern-events-calendar-lite'); + break; + + } + + return '
  • + ' . esc_html__( 'Sort', 'modern-events-calendar-lite') . ' + ' . esc_html( $label ) . ' + ' . ( $prefix === 'event' ? '%%event_field_' . esc_attr( $key ) . '%%' : ( $prefix === 'bfixed' ? '%%booking_field_' . esc_attr( $key ) . '%%' : '' ) ) . ' + + ' . esc_html__( 'Remove', 'modern-events-calendar-lite') . ' +
    + + +
    +
  • '; + } + + /** + * Show text field options in booking form + * + * @param string $key + * @param array $values + * @param string $prefix + * + * @return string + */ + public function field_first_name( $key, $values = array(), $prefix = 'reg' ) { + + return $this->field_name( $key, $values, $prefix ); + } + + /** + * Show text field options in booking form + * + * @param string $key + * @param array $values + * @param string $prefix + * + * @return string + */ + public function field_last_name( $key, $values = array(), $prefix = 'reg' ) { + + return $this->field_name( $key, $values, $prefix ); + } + + /** + * Show text field options in booking form + * + * @param string $key + * @param array $values + * @param string $prefix + * + * @return string + */ + public function field_mec_email( $key, $values = array(), $prefix = 'reg' ) { + + return '
  • + ' . esc_html__( 'Sort', 'modern-events-calendar-lite') . ' + ' . esc_html__( 'MEC Email', 'modern-events-calendar-lite') . ' + ' . ( $prefix === 'event' ? '%%event_field_' . esc_attr( $key ) . '%%' : ( $prefix === 'bfixed' ? '%%booking_field_' . esc_attr( $key ) . '%%' : '' ) ) . ' + + ' . esc_html__( 'Remove', 'modern-events-calendar-lite') . ' +
    + + +
    +
  • '; + } + + /** + * Show email field options in booking form + * + * @param string $key + * @param array $values + * @param string $prefix + * + * @return string + */ + public function field_email( $key, $values = array(), $prefix = 'reg' ) { + + return '
  • + ' . esc_html__( 'Sort', 'modern-events-calendar-lite') . ' + ' . esc_html__( 'Email', 'modern-events-calendar-lite') . ' + ' . ( $prefix === 'event' ? '%%event_field_' . esc_attr( $key ) . '%%' : ( $prefix === 'bfixed' ? '%%booking_field_' . esc_attr( $key ) . '%%' : '' ) ) . ' + ' . ( str_contains($prefix, 'rsvp',) && str_contains($prefix, 'bfixed') ? '%%rsvp_field_' . esc_attr( $key ) . '%%' : '' ) . ' +

    + +

    + ' . esc_html__( 'Remove', 'modern-events-calendar-lite') . ' +
    + + + ' . $this->input_key( $key, 'email', $values, $prefix ) . ' +
    +
  • '; + } + + /** + * Show URL field options in forms + * + * @param string $key + * @param array $values + * @param string $prefix + * + * @return string + */ + public function field_url( $key, $values = array(), $prefix = 'reg' ) { + + return '
  • + ' . esc_html__( 'Sort', 'modern-events-calendar-lite') . ' + ' . esc_html__( 'URL', 'modern-events-calendar-lite') . ' + ' . ( $prefix === 'event' ? '%%event_field_' . esc_attr( $key ) . '%%' : ( $prefix === 'bfixed' ? '%%booking_field_' . esc_attr( $key ) . '%%' : '' ) ) . ' +

    + +

    + ' . esc_html__( 'Remove', 'modern-events-calendar-lite') . ' +
    + + + ' . $this->input_key( $key, 'url', $values, $prefix ) . ' +
    +
  • '; + } + + /** + * Show file field options in booking form + * + * @param string $key + * @param array $values + * @param string $prefix + * + * @return string + */ + public function field_file( $key, $values = array(), $prefix = 'reg' ) { + + return '
  • + ' . esc_html__( 'Sort', 'modern-events-calendar-lite') . ' + ' . esc_html__( 'File', 'modern-events-calendar-lite') . ' + ' . ( $prefix === 'event' ? '%%event_field_' . esc_attr( $key ) . '%%' : ( $prefix === 'bfixed' ? '%%booking_field_' . esc_attr( $key ) . '%%' : '' ) ) . ' + ' . ( str_contains($prefix, 'rsvp',) && str_contains($prefix, 'bfixed') ? '%%rsvp_field_' . esc_attr( $key ) . '%%' : '' ) . ' +

    + +

    + ' . esc_html__( 'Remove', 'modern-events-calendar-lite') . ' +
    + + +
    +
  • '; + } + + /** + * Show date field options in booking form + * + * @param string $key + * @param array $values + * @param string $prefix + * + * @return string + */ + public function field_date( $key, $values = array(), $prefix = 'reg' ) { + + return '
  • + ' . esc_html__( 'Sort', 'modern-events-calendar-lite') . ' + ' . esc_html__( 'Date', 'modern-events-calendar-lite') . ' + ' . ( $prefix === 'event' ? '%%event_field_' . esc_attr( $key ) . '%%' : ( $prefix === 'bfixed' ? '%%booking_field_' . esc_attr( $key ) . '%%' : '' ) ) . ' + ' . ( str_contains($prefix, 'rsvp',) && str_contains($prefix, 'bfixed') ? '%%rsvp_field_' . esc_attr( $key ) . '%%' : '' ) . ' +

    + +

    + ' . esc_html__( 'Remove', 'modern-events-calendar-lite') . ' +
    + + + ' . $this->input_key( $key, 'date', $values, $prefix ) . ' +
    +
  • '; + } + + /** + * Show tel field options in booking form + * + * @param string $key + * @param array $values + * @param string $prefix + * + * @return string + */ + public function field_tel( $key, $values = array(), $prefix = 'reg' ) { + + return '
  • + ' . esc_html__( 'Sort', 'modern-events-calendar-lite') . ' + ' . esc_html__( 'Tel', 'modern-events-calendar-lite') . ' + ' . ( $prefix === 'event' ? '%%event_field_' . esc_attr( $key ) . '%%' : ( $prefix === 'bfixed' ? '%%booking_field_' . esc_attr( $key ) . '%%' : '' ) ) . ' + ' . ( str_contains($prefix, 'rsvp',) && str_contains($prefix, 'bfixed') ? '%%rsvp_field_' . esc_attr( $key ) . '%%' : '' ) . ' +

    + +

    + ' . esc_html__( 'Remove', 'modern-events-calendar-lite') . ' +
    + + + ' . $this->input_key( $key, 'tel', $values, $prefix ) . ' +
    +
  • '; + } + + /** + * Show textarea field options in booking form + * + * @param string $key + * @param array $values + * @param string $prefix + * + * @return string + */ + public function field_textarea( $key, $values = array(), $prefix = 'reg' ) { + + return '
  • + ' . esc_html__( 'Sort', 'modern-events-calendar-lite') . ' + ' . esc_html__( 'Textarea', 'modern-events-calendar-lite') . ' + ' . ( $prefix === 'event' ? '%%event_field_' . esc_attr( $key ) . '%%' : ( $prefix === 'bfixed' ? '%%booking_field_' . esc_attr( $key ) . '%%' : '' ) ) . ' + ' . ( str_contains($prefix, 'rsvp',) && str_contains($prefix, 'bfixed') ? '%%rsvp_field_' . esc_attr( $key ) . '%%' : '' ) . ' +

    + +

    + ' . esc_html__( 'Remove', 'modern-events-calendar-lite') . ' +
    + + + ' . $this->input_key( $key, 'textarea', $values, $prefix ) . ' +
    +
  • '; + } + + /** + * Show paragraph field options in booking form + * + * @param string $key + * @param array $values + * @param string $prefix + * + * @return string + */ + public function field_p( $key, $values = array(), $prefix = 'reg' ) { + + return '
  • + ' . esc_html__( 'Sort', 'modern-events-calendar-lite') . ' + ' . esc_html__( 'Paragraph', 'modern-events-calendar-lite') . ' + ' . esc_html__( 'Remove', 'modern-events-calendar-lite') . ' +
    + + +

    ' . esc_html__( 'HTML and shortcode are allowed.' ) . '

    +
    +
  • '; + } + + /** + * Show checkbox field options in booking form + * + * @param string $key + * @param array $values + * @param string $prefix + * + * @return string + */ + public function field_checkbox( $key, $values = array(), $prefix = 'reg' ) { + + $i = 0; + $field = '
  • + ' . esc_html__( 'Sort', 'modern-events-calendar-lite') . ' + ' . esc_html__( 'Checkboxes', 'modern-events-calendar-lite') . ' + ' . ( $prefix === 'event' ? '%%event_field_' . esc_attr( $key ) . '%%' : ( $prefix === 'bfixed' ? '%%booking_field_' . esc_attr( $key ) . '%%' : '' ) ) . ' + ' . ( str_contains($prefix, 'rsvp',) && str_contains($prefix, 'bfixed') ? '%%rsvp_field_' . esc_attr( $key ) . '%%' : '' ) . ' +

    + +

    + ' . esc_html__( 'Remove', 'modern-events-calendar-lite') . ' +
    + + + ' . $this->input_key( $key, 'checkbox', $values, $prefix ) . ' +
      '; + + if ( isset( $values['options'] ) and is_array( $values['options'] ) and count( $values['options'] ) ) { + foreach ( $values['options'] as $option_key => $option ) { + $i = max( $i, $option_key ); + $field .= $this->field_option( $key, $option_key, $values, $prefix ); + } + } + + $field .= '
    + + +
    +
  • '; + + return $field; + } + + /** + * Show radio field options in booking form + * + * @param string $key + * @param array $values + * @param string $prefix + * + * @return string + */ + public function field_radio( $key, $values = array(), $prefix = 'reg' ) { + + $i = 0; + $field = '
  • + ' . esc_html__( 'Sort', 'modern-events-calendar-lite') . ' + ' . esc_html__( 'Radio Buttons', 'modern-events-calendar-lite') . ' + ' . ( $prefix === 'event' ? '%%event_field_' . esc_attr( $key ) . '%%' : ( $prefix === 'bfixed' ? '%%booking_field_' . esc_attr( $key ) . '%%' : '' ) ) . ' + ' . ( str_contains($prefix, 'rsvp',) && str_contains($prefix, 'bfixed') ? '%%rsvp_field_' . esc_attr( $key ) . '%%' : '' ) . ' +

    + +

    + ' . esc_html__( 'Remove', 'modern-events-calendar-lite') . ' +
    + + + ' . $this->input_key( $key, 'radio', $values, $prefix ) . ' +
      '; + + if ( isset( $values['options'] ) and is_array( $values['options'] ) and count( $values['options'] ) ) { + foreach ( $values['options'] as $option_key => $option ) { + $i = max( $i, $option_key ); + $field .= $this->field_option( $key, $option_key, $values, $prefix ); + } + } + + $field .= '
    + + +
    +
  • '; + + return $field; + } + + /** + * Show select field options in booking form + * + * @param string $key + * @param array $values + * @param string $prefix + * + * @return string + */ + public function field_select( $key, $values = array(), $prefix = 'reg' ) { + + $i = 0; + $field = '
  • + ' . esc_html__( 'Sort', 'modern-events-calendar-lite') . ' + ' . esc_html__( 'Dropdown', 'modern-events-calendar-lite') . ' + ' . ( $prefix === 'event' ? '%%event_field_' . esc_attr( $key ) . '%%' : ( $prefix === 'bfixed' ? '%%booking_field_' . esc_attr( $key ) . '%%' : '' ) ) . ' + ' . ( str_contains($prefix, 'rsvp',) && str_contains($prefix, 'bfixed') ? '%%rsvp_field_' . esc_attr( $key ) . '%%' : '' ) . ' +

    + +

    +

    + +

    + ' . esc_html__( 'Remove', 'modern-events-calendar-lite') . ' +
    + + + ' . $this->input_key( $key, 'select', $values, $prefix ) . ' +
      '; + + if ( isset( $values['options'] ) and is_array( $values['options'] ) and count( $values['options'] ) ) { + foreach ( $values['options'] as $option_key => $option ) { + $i = max( $i, $option_key ); + $field .= $this->field_option( $key, $option_key, $values, $prefix ); + } + } + + $field .= '
    + + +
    +
  • '; + + return $field; + } + + /** + * Show agreement field options in booking form + * + * @param string $key + * @param array $values + * @param string $prefix + * + * @return string + */ + public function field_agreement( $key, $values = array(), $prefix = 'reg' ) { + + // WordPress Pages + $pages = get_pages(); + + $i = 0; + $field = '
  • + ' . esc_html__( 'Sort', 'modern-events-calendar-lite') . ' + ' . esc_html__( 'Agreement', 'modern-events-calendar-lite') . ' + ' . ( $prefix === 'event' ? '%%event_field_' . esc_attr( $key ) . '%%' : ( $prefix === 'bfixed' ? '%%booking_field_' . esc_attr( $key ) . '%%' : '' ) ) . ' + ' . ( str_contains($prefix, 'rsvp',) && str_contains($prefix, 'bfixed') ? '%%rsvp_field_' . esc_attr( $key ) . '%%' : '' ) . ' +

    + +

    + ' . esc_html__( 'Remove', 'modern-events-calendar-lite') . ' +
    + +

    ' . esc_html__( 'Instead of %s, the page title with a link will be show.', 'modern-events-calendar-lite') . '

    +
    + + +
    +
    + + +
    + +
    +
  • '; + + return $field; + } + + /** + * Show option tag parameters in booking form for select, checkbox and radio tags + * + * @param string $field_key + * @param string $key + * @param array $values + * @param string $prefix + * + * @return string + */ + public function field_option( $field_key, $key, $values = array(), $prefix = 'reg' ) { + + return '
  • + ' . esc_html__( 'Sort', 'modern-events-calendar-lite') . ' + ' . esc_html__( 'Remove', 'modern-events-calendar-lite') . ' + +
  • '; + } + + public function get_wp_user_fields_dropdown( $name, $value ) { + + $fields = $this->get_wp_user_fields(); + + $dropdown = ''; + + return $dropdown; + } + + public function get_wp_user_fields() { + + $user_id = get_current_user_id(); + if( !$user_id ){ + + return array(); + } + $raw_fields = get_user_meta( $user_id ); + + $forbidden = array( + 'nickname', + 'syntax_highlighting', + 'comment_shortcuts', + 'admin_color', + 'use_ssl', + 'show_admin_bar_front', + 'wp_user_level', + 'user_last_view_date', + 'user_last_view_date_events', + 'wc_last_active', + 'last_update', + 'last_activity', + 'locale', + 'show_welcome_panel', + 'rich_editing', + 'nav_menu_recently_edited', + ); + + $fields = array(); + foreach ( $raw_fields as $key => $values ) { + if ( substr( $key, 0, 1 ) === '_' ) { + continue; + } + if ( substr( $key, 0, 4 ) === 'icl_' ) { + continue; + } + if ( substr( $key, 0, 4 ) === 'mec_' ) { + continue; + } + if ( substr( $key, 0, 3 ) === 'wp_' ) { + continue; + } + if ( substr( $key, 0, 10 ) === 'dismissed_' ) { + continue; + } + if ( in_array( $key, $forbidden ) ) { + continue; + } + + $value = ( isset( $values[0] ) ? $values[0] : null ); + if ( is_array( $value ) ) { + continue; + } + if ( is_serialized( $value ) ) { + continue; + } + + $fields[ $key ] = trim( ucwords( str_replace( '_', ' ', $key ) ) ); + } + + return $fields; + } + +} diff --git a/app/core/src/Forms/SettingsForm.php b/app/core/src/Forms/SettingsForm.php new file mode 100755 index 0000000..b45de7d --- /dev/null +++ b/app/core/src/Forms/SettingsForm.php @@ -0,0 +1,322 @@ +main = new \MEC_Main(); + } + + public function enqueue() { + + if ( true !== $this->enqueue ) { + + wp_enqueue_style( 'mec-backend', plugin_dir_url( __FILE__ ) . 'backend.css' ); + wp_enqueue_script( 'mec-backend', plugin_dir_url( __FILE__ ) . 'backend.js', array( 'jquery' ) ); + $this->enqueue = true; + } + } + + /** + * Get Form Fields + * + * @param $group_id + * + * @return array + */ + public function get_fields( $group_id ) { + + return CustomForm::getInstance()->get_reg_fields( $group_id ); + } + + /** + * @param $group_id + * + * @return array + */ + public function get_fixed_fields( $group_id ) { + + $fixed_fields = CustomForm::getInstance()->get_fixed_fields( $group_id ); + if ( !is_array( $fixed_fields ) ) { + $fixed_fields = []; + } + + return $fixed_fields; + } + + /** + * @param string $type + * + * @return mixed|void + */ + public function get_element_fields( $type = 'reg' ) { + + $elements = array( + 'first_name' => array( + 'required' => true, + 'text' => esc_html__( 'MEC First Name', 'modern-events-calendar-lite'), + 'class' => 'red', + ), + 'last_name' => array( + 'required' => true, + 'text' => esc_html__( 'MEC Last Name', 'modern-events-calendar-lite'), + 'class' => 'red', + ), + 'mec_email' => array( + 'required' => true, + 'text' => esc_html__( 'MEC Email', 'modern-events-calendar-lite'), + 'class' => 'red', + ), + 'text' => array( + 'required' => false, + 'text' => esc_html__( 'Text', 'modern-events-calendar-lite'), + 'class' => '', + ), + 'email' => array( + 'required' => false, + 'text' => esc_html__( 'Email', 'modern-events-calendar-lite'), + 'class' => '', + ), + 'date' => array( + 'required' => false, + 'text' => esc_html__( 'Date', 'modern-events-calendar-lite'), + 'class' => '', + ), + 'tel' => array( + 'required' => false, + 'text' => esc_html__( 'Tel', 'modern-events-calendar-lite'), + 'class' => '', + ), + 'file' => array( + 'required' => false, + 'text' => esc_html__( 'File', 'modern-events-calendar-lite'), + 'class' => '', + ), + 'textarea' => array( + 'required' => false, + 'text' => esc_html__( 'Textarea', 'modern-events-calendar-lite'), + 'class' => '', + ), + 'checkbox' => array( + 'required' => false, + 'text' => esc_html__( 'Checkboxes', 'modern-events-calendar-lite'), + 'class' => '', + ), + 'radio' => array( + 'required' => false, + 'text' => esc_html__( 'Radio Buttons', 'modern-events-calendar-lite'), + 'class' => '', + ), + 'select' => array( + 'required' => false, + 'text' => esc_html__( 'Dropdown', 'modern-events-calendar-lite'), + 'class' => '', + ), + 'agreement' => array( + 'required' => false, + 'text' => esc_html__( 'Agreement', 'modern-events-calendar-lite'), + 'class' => '', + ), + 'p' => array( + 'required' => false, + 'text' => esc_html__( 'Paragraph', 'modern-events-calendar-lite'), + 'class' => '', + ), + ); + + if ( 'reg' !== $type ) { + + unset( $elements['first_name'] ); + unset( $elements['last_name'] ); + unset( $elements['mec_email'] ); + } + + return apply_filters( 'mec_get_element_fields', $elements ); + } + + /** + * @param array $fields + * @param string $group_id + * @param string $type reg|bfixed|$custom + */ + public function display_fields( $fields, $group_id, $type = 'reg' ) { + + $type_fields = $type; + $type = $group_id . '_' . $type; + add_action( 'admin_footer', array( $this, 'enqueue' ) ); + ?> +
    + +
    + + + + +
      + $field_args ) { + if(in_array($key, [':i:',':fi:','_i_','_fi_',], true)){ + + continue; + } + $i = max( $i, (int)$key ); + + + echo \MEC_kses::form($this->display_field( $key, $field_args, $type )); + } + + ?> +
    +
    + get_element_fields( $type_fields ); + foreach ( $elements as $element_id => $element ) { + + $text = isset( $element['text'] ) ? $element['text'] : ''; + $class = isset( $element['class'] ) ? $element['class'] : ''; + echo ''; + } + + ?> +
    + +
    + + + +
    + $element ) { + $method = 'field_' . $element_id; + if ( method_exists( FormFields::class, $method ) ) { + + echo '
    ' . + $this->display_field( ':i:', [ 'type' => $element_id ], $type ) + . '
    '; + } + } + + ?> +
    + field_option( ':fi:', ':i:', array(), $type ); ?> +
    +
    +
    + + fieldFactory ) ) { + + $this->fieldFactory = FormFields::getInstance(); + } + + $html = ''; + switch ( $type ) { + case 'text': + $html .= $this->fieldFactory->field_text( $key, $field_args, $prefix ); + break; + case 'name': + $html .= $this->fieldFactory->field_first_name( $key, $field_args, $prefix ); + break; + case 'first_name': + $html .= $this->fieldFactory->field_first_name( $key, $field_args, $prefix ); + break; + case 'last_name': + $html .= $this->fieldFactory->field_last_name( $key, $field_args, $prefix ); + break; + case 'mec_email': + $html .= $this->fieldFactory->field_mec_email( $key, $field_args, $prefix ); + break; + case 'email': + $html .= $this->fieldFactory->field_email( $key, $field_args, $prefix ); + break; + case 'date': + $html .= $this->fieldFactory->field_date( $key, $field_args, $prefix ); + break; + case 'file': + $html .= $this->fieldFactory->field_file( $key, $field_args, $prefix ); + break; + case 'tel': + $html .= $this->fieldFactory->field_tel( $key, $field_args, $prefix ); + break; + case 'textarea': + $html .= $this->fieldFactory->field_textarea( $key, $field_args, $prefix ); + break; + case 'p': + $html .= $this->fieldFactory->field_p( $key, $field_args, $prefix ); + break; + case 'checkbox': + $html .= $this->fieldFactory->field_checkbox( $key, $field_args, $prefix ); + break; + case 'radio': + $html .= $this->fieldFactory->field_radio( $key, $field_args, $prefix ); + break; + case 'select': + $html .= $this->fieldFactory->field_select( $key, $field_args, $prefix ); + break; + case 'agreement': + $html .= $this->fieldFactory->field_agreement( $key, $field_args, $prefix ); + break; + } + + return $html; + } + + public function display_settings_form_fields( $group_id, $fields = null) { + + $type = 'reg'; + if( is_null( $fields ) ){ + + $fields = $this->get_fields( $group_id ); + } + + $this->display_fields( $fields, $group_id, $type ); + } + + public function display_settings_form_fixed_fields( $group_id, $fields = null ) { + + $type = 'bfixed'; + if( is_null( $fields ) ){ + + $fields = $this->get_fixed_fields( $group_id ); + } + + $this->display_fields( $fields, $group_id, $type ); + } + +} \ No newline at end of file diff --git a/app/core/src/Forms/backend.css b/app/core/src/Forms/backend.css new file mode 100755 index 0000000..2de38eb --- /dev/null +++ b/app/core/src/Forms/backend.css @@ -0,0 +1,408 @@ +.mec_form_field_types .button { + position: relative; + outline: 0; + border-radius: 50px; + padding: 2px 21px 2px 31px !important; + line-height: 1; + font-size: 11px; + font-weight: 600; + color: #40d9f1; + letter-spacing: 2px; + height: auto; + cursor: pointer; + margin-top: 5px; + text-transform: uppercase; + box-shadow: 0 2px 6px -3px #40d9f1; + border: 2px solid #cfeff5; +} + +.mec_form_field_types .button.red { + color: #ea6485; + box-shadow: 0 2px 6px -3px #ea6485; + background: #fff; + border-color: #ffd2dd; +} + +.mec_form_field_types .button.red:hover { + background: #ea6485; + color: #fff; +} + +.mec_form_field_types .button:before { + position: absolute; + left: 12px; + color: #40d9f1; + content: "\e095"; + font-family: simple-line-icons; + font-size: 13px; + display: inline-block; +} + +.mec_form_field_types .button.red:before { + color: #ea6485; +} + +.mec_form_field_types .button.red:hover:before{ + color: #fff; +} +.mec_form_field_types .button:hover:before { + color: #0a4b78; +} + +.mec_form_field_types .button.red:hover { + color: #fff; + border: 2px solid #ea6485; +} + +.mec-fes-form .mec_form_fields span.mec_field_sort, +.mec-fes-form .mec_form_fields span.mec_bfixed_field_sort { + font-size: 0; + color: #fff; + padding-left: 20px; +} + +.mec-fes-form .mec_form_fields .mec_waiting_field_options, +.mec-fes-form .mec_form_fields .mec_bfixed_field_option_sort, +.mec-fes-form .mec_form_fields span.mec_field_option_sort { + font-size: 0; +} + +.mec-fes-form .mec_form_fields span.mec_field_option_sort:before, +.mec-fes-form .mec_form_fields span.mec_waiting_field_options:before, +.mec-fes-form .mec_form_fields span.mec_field_sort:before, +.mec-fes-form .mec_form_fields span.mec_bfixed_field_option_sort:before, +.mec-fes-form .mec_form_fields span.mec_bfixed_field_sort:before { + position: absolute; + left: px; + top: 12px; + width: 80px; + height: 20px; + display: block; + cursor: move; + font-family: simple-line-icons; + content: "\e023"; + font-size: 18px; + color: #888 +} + +.mec-fes-form .mec_form_fields span.mec_field_option_sort:before, +.mec-fes-form .mec_form_fields span.mec_waiting_field_options:before, +.mec-fes-form .mec_form_fields span.mec_bfixed_field_option_sort:before { + font-size: 13px; + left: 2px; + top: 26px; + width: 14px; + height: 14px +} + + +.mec_form_fields, +#mec_event_form_fields, +.mec_form_fields { + padding: 20px; + background: #f7f8f9; + margin: 0 0 20px 0; + border-radius: 3px; + min-height: 150px; + border: 2px dashed #dcdee0 +} + +.mec_form_fields li, #mec_event_form_fields li { + margin: 4px 10px; + border-radius: 2px; + padding: 20px 34px 24px; + background: #fff; + position: relative; + transition: all .3s ease; + + /*border-radius: 3px 11px 3px 3px;*/ + /*padding: 10px 20px 15px;*/ + position: relative; + border: 1px solid #f1f3f5; + box-shadow: 0 1px 5px rgba(0,0,0,2%) +} + +.mec_form_fields li, #mec_event_form_fields li { + +} + + +.mec_form_fields li, +#mec_event_form_fields li, +.mec_form_fields li { + margin: 4px; + border-radius: 2px; + padding: 20px 34px 24px; + background: #fff; + position: relative; + transition: all .3s ease +} + + +.mec_form_fields li ul, +#mec_event_form_fields li ul, +.mec_form_fields li ul { + padding-top: 15px; + padding-bottom: 15px; + margin: 1px +} + +.mec_form_fields li ul li, +#mec_event_form_fields li ul li, +.mec_form_fields li ul li { + padding: 7px 30px 7px 46px +} + +.mec_form_fields span.mec_event_field_type, +#mec_event_form_fields span.mec_event_field_type, +.mec_form_fields span.mec_field_type { + font-size: 11px; + font-weight: 600; + color: #8a8a8a; + text-transform: uppercase; + letter-spacing: 2px +} + +.mec_form_fields span.mec_bfixed_field_option_sort, +.mec_form_fields span.mec_bfixed_field_remove, +.mec_form_fields span.mec_bfixed_field_sort, +#mec_event_form_fields span.mec_event_field_option_sort, +#mec_event_form_fields span.mec_event_field_remove, +#mec_event_form_fields span.mec_event_field_sort, +.mec_form_fields span.mec_field_option_sort, +.mec_form_fields span.mec_field_remove, +.mec_form_fields span.mec_field_sort { + font-size: 0; + color: #fff +} + +.mec_form_fields span.mec_bfixed_field_remove, +#mec_event_form_fields span.mec_event_field_remove, +.mec_form_fields span.mec_field_remove { + position: absolute; + right: 0; + top: 0 +} + +.mec_form_fields span.mec_bfixed_field_option_sort:before, +.mec_form_fields span.mec_bfixed_field_remove:before, +.mec_form_fields span.mec_bfixed_field_sort:before, +#mec_event_form_fields span.mec_event_field_option_sort:before, +#mec_event_form_fields span.mec_event_field_remove:before, +#mec_event_form_fields span.mec_event_field_sort:before, +.mec_form_fields span.mec_field_option_sort:before, +.mec_form_fields span.mec_field_remove:before, +.mec_form_fields span.mec_field_sort:before { + position: absolute; + left: 10px; + top: 20px; + width: 80px; + height: 20px; + display: block; + cursor: move; + font-family: simple-line-icons; + content: "\e023"; + font-size: 18px; + color: #888 +} + +.mec_form_fields span.mec_bfixed_field_remove:before, +#mec_event_form_fields span.mec_event_field_remove:before, +.mec_form_fields span.mec_field_remove:before { + content: "\e082"; + width: 20px; + height: 20px; + left: auto; + right: 15px; + color: #f96666; + cursor: pointer +} + +#mec_event_form_fields span.mec_event_field_option_sort:before, +.mec_form_fields span.mec_field_option_sort:before { + font-size: 13px; + left: 2px; + top: 23px; + width: 14px; + height: 14px +} + +#mec_event_form_fields li ul li span.mec_event_field_remove, +.mec_form_fields li ul li span.mec_field_remove { + right: auto; + left: 60px; + top: 2px +} + +#mec_event_form_fields p.mec_event_field_options, +.mec_form_fields p.mec_waiting_field_options { + margin: 6px 0 8px +} + +.mec_form_fields input[type=number], .mec_form_fields input[type=text], .mec_form_fields select, .mec_form_fields textarea, +#mec_event_form_fields input[type=number], #mec_event_form_fields input[type=text], #mec_event_form_fields select, #mec_event_form_fields textarea, +.mec_form_fields input[type=number], .mec_form_fields input[type=text], .mec_form_fields select, .mec_form_fields textarea { + min-width: 260px; + min-height: 34px; + margin-bottom: 7px; + margin-top: 7px +} + +.mec_form_fields textarea, +#mec_event_form_fields textarea, +.mec_form_fields textarea { + min-height: 66px +} + +#mec_event_form_field_types button, #mec_event_form_fields button, +.mec_form_field_types button, .mec_form_fields button { + position: relative; + outline: 0; + background: #fff; + border: 1px solid #e2e2e2; + border-radius: 50px; + padding: 11px 21px 11px 31px; + line-height: 1; + font-size: 11px; + font-weight: 600; + color: #444; + letter-spacing: 2px; + height: auto; + cursor: pointer; + margin-top: 5px; + text-transform: uppercase; + box-shadow: 0 0 3px rgba(0, 0, 0, .03) +} + +#mec_event_form_field_types button:hover, #mec_event_form_fields button:hover, +.mec_form_field_types button:hover, .mec_form_fields button:hover { + border-color: #008aff; + box-shadow: 0 0 7px rgba(0, 0, 0, .1) +} + +#mec_bfixed_form_field_types button:before, .mec_form_fields button:before, +#mec_event_form_field_types button:before, #mec_event_form_fields button:before, +.mec_form_field_types button:before, .mec_form_fields button:before { + position: absolute; + left: 12px; + color: #008aff; + content: "\e095"; + font-family: simple-line-icons; + font-size: 13px; + display: inline-block +} + +.mec_form_fields button.red:hover, +#mec_event_form_field_types button.red:hover, #mec_event_form_fields button.red:hover, +.mec_form_field_types button.red:hover, .mec_form_fields button.red:hover { + border-color: red; + box-shadow: 0 0 7px rgba(0, 0, 0, .1) +} + +.mec_form_fields button.red:before, +#mec_event_form_field_types button.red:before, #mec_event_form_fields button.red:before, +.mec_form_field_types button.red:before, .mec_form_fields button.red:before { + position: absolute; + left: 12px; + color: red; + content: "\e095"; + font-family: simple-line-icons; + font-size: 13px; + display: inline-block +} + +.mec_form_fields .mec_bfixed_notification_placeholder, +#mec_event_form_fields .mec_event_notification_placeholder { + padding: 2px; + display: block; + margin: 10px 0 20px; +} + +@media (max-width: 768px) { + .mec_form_fields input[type=number], .mec_form_fields input[type=text], .mec_form_fields select, .mec_form_fields textarea, + #mec_event_form_fields input[type=number], #mec_event_form_fields input[type=text], #mec_event_form_fields select, #mec_event_form_fields textarea, + .mec_form_fields input[type=number], .mec_form_fields input[type=text], .mec_form_fields select, .mec_form_fields textarea { + min-width: 80px; + width: 100% + } +} + + +.mec-admin-dark-mode.post-type-mec-events .mec_form_fields li, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .mec_form_fields li { + background: #1F1F1F; + color: #fff; +} + +.mec-admin-dark-mode.post-type-mec-events .mec_form_fields { + background: #282828; + border-color: #353535; +} + +.mec-admin-dark-mode.post-type-mec-events .mec_form_fields button, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .mec_form_fields button, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .mec_form_fields { + background: #000; +} + +/* MEC Backend Responsive Mobile & Tablet */ +@media (max-width: 480px) { + #mec_event_form_fields, + .mec_form_fields { + padding: 10px; + } +} + + +.mec_form_fields span.mec_field_remove, +.mec_form_fields span.mec_field_sort { + font-size: 0; + color: #fff; + padding: 5px; +} + +.mec_form_fields span.mec_field_remove { + position: absolute; + right: 0; + top: 0 +} + +.mec_form_fields span.mec_field_sort:before { + position: absolute; + left: 10px; + top: 20px; + width: 80px; + height: 20px; + display: block; + cursor: move; + font-family: simple-line-icons; + content: "\e023"; + font-size: 18px; + color: #888 +} + +.mec_form_fields span.mec_field_remove:before { + content: "\e082"; + width: 20px; + height: 20px; + left: auto; + right: 15px; + color: #f96666; + cursor: pointer +} + +.mec_form_fields li ul li span.mec_field_remove { + right: auto; + left: 60px; + top: 2px +} + +.mec_form_fields li ul, #mec_event_form_fields li ul { + padding-top: 15px; + padding-bottom: 15px; + margin: 1px +} + +.mec_form_fields li ul li, #mec_event_form_fields li ul li { + padding: 7px 30px 7px 46px +} diff --git a/app/core/src/Forms/backend.js b/app/core/src/Forms/backend.js new file mode 100755 index 0000000..d77149a --- /dev/null +++ b/app/core/src/Forms/backend.js @@ -0,0 +1,139 @@ +function mec_fields_option_listeners() { + + jQuery('.mec_field_remove').on('click', function (e) { + jQuery(this).parent('li').remove(); + }); + + jQuery('button.mec-field-add-option').off('click').on('click', function (e) { + + var container = jQuery(e.currentTarget).parents('.mec-container'); + if(container.length > 1){ + container = container[0]; + } + var form = jQuery(e.currentTarget).parents('.mec-form-row'); + if(form.length > 1){ + form = form[0]; + } + var item_box = jQuery(e.currentTarget).parents('li'); + var form_type = jQuery(form).data('form-type'); + var field_id = jQuery(this).data('field-id'); + var key = jQuery('#mec_new_' + form_type + '_field_option_key_' + field_id, container).val(); + var html = jQuery('.mec_field_option', container).html().replace(/:i:/g, key).replace(/:fi:/g, field_id); + + jQuery('.mec_fields_options_container', item_box).append(html); + jQuery('#mec_new_' + form_type + '_field_option_key_' + field_id, container).val(parseInt(key) + 1); + + mec_fields_option_listeners(); + }); + + if (typeof jQuery.fn.sortable !== 'undefined') { + jQuery(".mec_form_fields").sortable( + { + handle: '.mec_field_sort' + }); + + jQuery(".mec_fields_options_container").sortable( + { + handle: '.mec_field_option_sort' + }); + } +} + +jQuery(document).ready(function($) +{ + let $event_selectbox = $('.mec-reports-selectbox-event'); + + /* Load event dates in Report page */ + if ($event_selectbox.length > 0) { + $event_selectbox.select2(); + $event_selectbox.on('change', function (e) { + e.preventDefault(); + var id = $event_selectbox.val(); + $.ajax({ + url: mec_admin_localize.ajax_url, + type: 'POST', + data: { + action: 'report_event_dates', + nonce: mec_admin_localize.ajax_nonce, + event_id: id, + }, + success: function (response) { + $('.mec-report-selected-event-attendees-wrap').hide(); + $('.mec-reports-selectbox-dates').remove(); + $('.mec-report-selected-event-attendees-wrap .w-row .w-col-sm-12').html(''); + $('.mec-report-select-event-wrap .w-row .w-col-sm-12').append(response); + $('.mec-report-sendmail-wrap').hide(); + $('.mec-report-backtoselect-wrap').hide(); + }, + }); + }); + } + + $event_selectbox.trigger('change'); + + jQuery('[name="mec[waiting_form][waiting_form_id]"]').on("change", function () { + if (jQuery(this).data("name") == "waiting_form_id") { + jQuery("div#mec_form_container").removeClass("mec-util-hidden"); + jQuery("#waiting_form_id").addClass("mec-util-hidden"); + } else { + jQuery("div#mec_form_container").addClass("mec-util-hidden"); + jQuery("#waiting_form_id").removeClass("mec-util-hidden"); + jQuery(this).val(jQuery("#waiting_form_id").val()); + } + }); + jQuery("#waiting_form_id").on("change", function () { + jQuery("input[data-name=formBuilder_waiting_form_id]").val(jQuery(this).val()); + }) + + if (typeof (mec_default_waiting_form_id) != "undefined") { + jQuery("input[data-name=formBuilder_waiting_form_id]").prop("checked", true); + jQuery("#waiting_form_id").removeClass("mec-util-hidden"); + jQuery("div#mec_form_container").addClass("mec-util-hidden"); + jQuery("input[data-name=formBuilder_waiting_form_id]").val(mec_default_waiting_form_id); + } else { + jQuery("input[data-name=waiting_form_id]").prop("checked", true); + } + + $('.mec_form_field_types button').on('click', function (e) { + var container = $(e.currentTarget).parents('.mec-container'); + if(container.length > 1){ + container = container[0]; + } + var form = $(e.currentTarget).parents('.mec-form-row'); + if(form.length > 1){ + form = form[0]; + } + var form_type = $(form).data('form-type'); + var type = $(this).data('type'); + + if (type === 'mec_email') { + if ($('.mec_form_fields', form).find('input[value="mec_email"][type="hidden"]').length) { + return false; + } + } + + if (type === 'last_name') { + if ($('.mec_form_fields', form).find('input[value="last_name"][type="hidden"]').length) { + return false; + } + } + + if (type === 'first_name') { + if ($('.mec_form_fields', form).find('input[value="first_name"][type="hidden"]').length) { + return false; + } + } + + var key = $('#mec_new_' + form_type + '_field_key', container).val(); + var html = $('.mec_field_' + type, container).html().replace(/:i:/g, key); + + $('.mec_form_fields', form).append(html); + $('#mec_new_' + form_type + '_field_key', container).val(parseInt(key) + 1); + + // Set onclick listener for add option fields + mec_fields_option_listeners(); + }); + + // Set onclick listener for add option fields + mec_fields_option_listeners(); +}); diff --git a/app/core/src/Forms/custom-form.css b/app/core/src/Forms/custom-form.css new file mode 100755 index 0000000..c47be26 --- /dev/null +++ b/app/core/src/Forms/custom-form.css @@ -0,0 +1,110 @@ +.mec-custom-form-box .hidden { + display: none; +} + +.mec-custom-form-box input[type=date], +.mec-custom-form-box input[type=email], +.mec-custom-form-box input[type=number], +.mec-custom-form-box input[type=password], +.mec-custom-form-box input[type=tel], +.mec-custom-form-box input[type=text], +.mec-custom-form-box select, +.mec-custom-form-box textarea { + display: block; + background: #fcfcfc; + min-height: 42px; + min-width: 180px; + font-size: 13px; + border: 1px solid #e0e0e0; + padding: 13px 10px; + width: 330px; + margin-bottom: 20px; + box-shadow: inset 0 2px 4px rgba(0, 0, 0, 5%); + clear: both; +} + +.mec-custom-form-box form > h4 { + text-transform: uppercase; + font-size: 15px; + font-weight: 700; + color: #313131; + border-bottom: 4px solid #ebebeb; + width: 100%; + display: block; + padding-bottom: 10px; + position: relative; + text-align: center; + margin-bottom: 20px; +} + +.mec-custom-form-box form > h4:before { + padding: 1px 35px; + border-bottom: 4px solid #40d9f1; + font-size: 6px; + content: ""; + text-align: center; + position: absolute; + bottom: -4px; + margin-left: -35px; + left: 50%; +} + +.mec-custom-form-box select { + display: block; + background: #fcfcfc; + min-height: 42px; + min-width: 180px; + font-size: 13px; + border: 1px solid #e0e0e0; + padding: 13px 10px; + width: 330px; + margin-bottom: 20px; + box-shadow: inset 0 2px 4px rgba(0, 0, 0 , 5%); + clear: both; +} + +.mec-custom-form-box button { + min-width: 155px; + margin-top: 5px; + margin-left: 10px; + border-radius: 2px; + box-shadow: 0 2px 1px rgba(0 ,0 ,0 , 8%); +} +/* +.mec-custom-form-box .button, +.mec-custom-form-box a.button:not(.owl-dot), +.mec-custom-form-box button:not(.owl-dot):not(.gm-control-active), +.mec-custom-form-box input[type=button], +.mec-custom-form-box input[type=reset], +.mec-custom-form-box input[type=submit] { + position: relative; + border: none; + border-radius: 2px; + color: #fff; + display: inline-block; + font-size: 12px; + letter-spacing: 1px; + line-height: 1.5; + text-transform: uppercase; + font-weight: 600; + text-decoration: none; + cursor: pointer; + margin-bottom: 21px; + margin-right: 10px; + line-height: 1; + padding: 18px 20px 16px; + background: #24ca4f; + -webkit-transition: all .21s ease; + -moz-transition: all .21s ease; + transition: all .21s ease; +} */ + +.mec-custom-form-box input[type=checkbox], +.mec-custom-form-box .mec-form-row input[type=checkbox], +.mec-custom-form-box .mec_rsvp_form .mec-form-row input[type=checkbox], +.mec-custom-form-box input[type=radio], +.mec-custom-form-box .mec-form-row input[type=radio], +.mec-custom-form-box .mec_rsvp_form .mec-form-row input[type=radio] { + position: relative; + margin:0 3px; +} diff --git a/app/core/src/Forms/index.php b/app/core/src/Forms/index.php new file mode 100755 index 0000000..092481f --- /dev/null +++ b/app/core/src/Forms/index.php @@ -0,0 +1,5 @@ +init( $taxonomy ); + } + + public function init( $taxonomy ) { + + $this->taxonomy = $taxonomy; + + add_filter( "bulk_actions-edit-{$taxonomy}", array( $this, 'add_export_bulk_action' ) ); + add_filter( "handle_bulk_actions-edit-{$taxonomy}", array( $this, 'handle_export_data_bulk_action' ),10,3); + add_action( 'admin_init', array( $this, 'admin_init' ) ); + add_action( 'mec_import_export_page', array( $this, 'import_page' ) ); + } + + public function admin_init() { + + $ix_action = isset($_REQUEST['mec-ix-action']) ? sanitize_text_field( $_REQUEST['mec-ix-action'] ) : ''; + + if( $ix_action && in_array( $ix_action, array( 'import-start-organizers', 'import-start-speakers', 'import-start-locations' ) ) ){ + + global $MEC_Import_Result; + $MEC_Import_Result = $this->import_from_csv(); + } + } + + public function get_columns( $taxonomy ) { + + $columns = array( + 'term_id' => __('ID', 'modern-events-calendar-lite'), + 'name' => esc_html__('Name', 'modern-events-calendar-lite'), + 'description' => esc_html__('Description', 'modern-events-calendar-lite'), + 'thumbnail' => esc_html__('Thumbnail', 'modern-events-calendar-lite'), + ); + + + if(!function_exists('is_plugin_active')) { + + include_once(ABSPATH . 'wp-admin/includes/plugin.php'); + } + + $is_active_dashboard = is_plugin_active( 'mec-user-dashboard/mec-user-dashboard.php' ); + + if( in_array( $taxonomy, array( 'mec_organizer', 'mec_speaker' ) ) ) { + + $columns['tel'] = esc_html__('Tel', 'modern-events-calendar-lite'); + $columns['email'] = esc_html__('Email', 'modern-events-calendar-lite'); + $columns['url'] = esc_html__('Page URL', 'modern-events-calendar-lite'); + $columns['page_label'] = esc_html__('Page Label', 'modern-events-calendar-lite'); + $columns['email'] = esc_html__('Email', 'modern-events-calendar-lite'); + $columns['facebook'] = esc_html__('Facebook', 'modern-events-calendar-lite'); + $columns['instagram'] = esc_html__('Instagram', 'modern-events-calendar-lite'); + $columns['linkedin'] = esc_html__('Linkedin', 'modern-events-calendar-lite'); + $columns['twitter'] = esc_html__('Twitter', 'modern-events-calendar-lite'); + $columns['featured'] = esc_html__('Featured', 'modern-events-calendar-lite'); + + if( $is_active_dashboard && 'mec_organizer' == $taxonomy ) { + + $columns['mec_organizer_user'] = __( 'Organizer User ID', 'modern-events-calendar-lite'); + }elseif( $is_active_dashboard && 'mec_organizer' == $taxonomy ) { + + $columns['mec_speaker_user'] = __( 'Speaker User ID', 'modern-events-calendar-lite'); + } + + } elseif ( 'mec_location' === $taxonomy ) { + + $columns['address'] = esc_html__('Address', 'modern-events-calendar-lite'); + $columns['opening_hour'] = esc_html__('Opening Hour', 'modern-events-calendar-lite'); + $columns['latitude'] = esc_html__('Latitude', 'modern-events-calendar-lite'); + $columns['longitude'] = esc_html__('Longitude', 'modern-events-calendar-lite'); + $columns['url'] = esc_html__('Location Website', 'modern-events-calendar-lite'); + } + + + return apply_filters('mec_csv_export_terms_columns', $columns, $taxonomy); + } + + public function add_export_bulk_action( $bulk_actions ) { + + $bulk_actions['export-csv'] = __( 'Export as CSV', 'mec-advanced-organizer' ); + + return $bulk_actions; + } + + public function handle_export_data_bulk_action($redirect_url, $action, $term_ids){ + + if( 'export-csv' === $action ) { + + $taxonomy = $_REQUEST['taxonomy'] ?? ''; + + $columns = $this->get_columns( $taxonomy ); + + $terms = get_terms(array( + 'taxonomy' => $taxonomy, + 'hide_empty' => false, + 'term_ids' => $term_ids, + )); + + $terms_data = []; + foreach( $terms as $term ) { + + $term_id = $term->term_id; + + $term_data = []; + foreach( $columns as $column_id => $column_title ) { + + switch( $column_id ) { + case 'term_id': + case 'name': + case 'description': + + $term_data[ $column_id ] = $term->{$column_id}; + break; + default: + + $term_data[ $column_id ] = get_term_meta( $term_id, $column_id, true ); + + break; + } + } + + $terms_data[ $term_id ] = $term_data; + } + + header('Content-Type: text/csv; charset=utf-8'); + header('Content-Disposition: attachment; filename=' . $taxonomy . '-' .md5(time().mt_rand(100, 999)).'.csv'); + + $output = fopen('php://output', 'w'); + fprintf( $output, chr(0xEF).chr(0xBB).chr(0xBF) ); + fputcsv( $output, $columns ); + + foreach( $terms_data as $term_data ) { + + fputcsv( $output, $term_data ); + } + + die(); + } + + return $redirect_url; + } + + public function upload_featured_image( $image_url ) { + + $attach_id = \MEC\Base::get_main()->get_attach_id($image_url); + if(!$attach_id) { + + $upload_dir = wp_upload_dir(); + $filename = basename($image_url); + + if(wp_mkdir_p($upload_dir['path'])) $file = $upload_dir['path'].'/'.$filename; + else $file = $upload_dir['basedir'].'/'.$filename; + + if(!file_exists($file)) { + + $image_data = \MEC\Base::get_main()->get_web_page($image_url); + file_put_contents($file, $image_data); + } + + $wp_filetype = wp_check_filetype($filename, null); + $attachment = array( + 'post_mime_type' => $wp_filetype['type'], + 'post_title' => sanitize_file_name($filename), + 'post_content' => '', + 'post_status'=>'inherit' + ); + + $attach_id = wp_insert_attachment( $attachment, $file ); + require_once ABSPATH.'wp-admin/includes/image.php'; + + $attach_data = wp_generate_attachment_metadata( $attach_id, $file ); + wp_update_attachment_metadata( $attach_id, $attach_data ); + } + + return $attach_id; + } + + public function import_from_csv() { + + $nonce = (isset($_POST['_wpnonce']) ? $_POST['_wpnonce'] : ''); + if (!$nonce || !wp_verify_nonce($nonce, 'mec_import_start_upload')) { + + return; + } + + $import_action = isset($_POST['mec-ix-action']) ? sanitize_text_field($_POST['mec-ix-action']) : ''; + if ('import-start-' . str_replace( 'mec_', '', $this->taxonomy ) . 's' !== $import_action) { + + return; + } + + $taxonomy = $this->taxonomy; + $columns = $this->get_columns( $taxonomy ); + + $feed_file = $_FILES['feed']; + + // File is not uploaded + if (!isset($feed_file['name']) or (isset($feed_file['name']) and trim($feed_file['name']) == '')) return array('success' => 0, 'message' => __('Please upload a CSV file.', 'mec-organizer')); + + // File name validation + $name_ex = explode('.', $feed_file['name']); + $name_end = end($name_ex); + if ($name_end != 'csv') return array('success' => 0, 'message' => __('Please upload a CSV file.', 'mec-organizer')); + + // Upload the File + $upload_dir = wp_upload_dir(); + + $target_path = $upload_dir['basedir'] . '/' . basename($feed_file['name']); + $uploaded = move_uploaded_file($feed_file['tmp_name'], $target_path); + + // Error on Upload + if (!$uploaded) return array('success' => 0, 'message' => __("An error occurred during the file upload! Please check permissions!", 'mec-organizer')); + + if ($type = mime_content_type($target_path) and $type == 'text/x-php') { + unlink($target_path); + return array('success' => 0, 'message' => __("Please upload a CSV file.", 'mec-organizer')); + } + + $field_keys = []; + $terms = []; + if (($h = fopen($target_path, 'r')) !== false) { + + $r = 0; + while (($data = fgetcsv($h, 1000, ",")) !== false) { + $r++; + + $cell_1 = $data[0]; + if ($r === 1 && !is_numeric($cell_1)){ + + $field_keys['ID'] = 0; + foreach( $columns as $k => $title ){ + + $id = array_search( $title, $data ); + if(false !== $id){ + + $field_keys[$title] = $id; + } + } + + continue; + } + + $term = []; + foreach( $columns as $column_id => $title ) { + + $term[ $column_id ] = $data[ $field_keys[$title] ] ?? ''; + } + + $term_id = $term['term_id'] ?? false; + if( $term_id ){ + + $term['ID'] = $term_id; + $terms[$term_id] = $term; + }else{ + + $terms[] = $term; + } + + } + + fclose($h); + + foreach ( $terms as $term_data ) { + + $term_id = (int)($term_data['term_id'] ?? 0); + $term_name = $term_data['term_name'] ?? ''; + $args = []; + foreach( $term_data as $t_id => $t_data ) { + + switch( $t_id ) { + case 'term_id': + break; + case 'name': + case 'description': + + $args[ $t_id ] = $t_data; + break; + default: + $meta_inputs[ $t_id ] = $t_data; + + } + } + + if( $term_id ) { + + $r = wp_update_term( $term_id, $taxonomy, $args ); + }else{ + + $r = wp_insert_term( $term_name, $taxonomy, $args ); + $term_id = $r['term_id'] ?? 0; + } + + $featured_image = $term_data['thumbnail'] ?? ''; + if( trim($featured_image) ) { + + $file = \MEC\Base::get_main()->getFile(); + $file_name = basename($featured_image); + + $path = rtrim($upload_dir['path'], DS.' ').DS.$file_name; + $url = rtrim($upload_dir['url'], '/ ').'/'.$file_name; + + // Download Image + $buffer = \MEC\Base::get_main()->get_web_page($featured_image); + + $file->write( $path, $buffer ); + if( $this->upload_featured_image( $url ) ) { + + $meta_inputs['thumbnail'] = $url; + } + } + + if( $term_id ) { + + foreach( $meta_inputs as $meta_key => $meta_value ) { + + update_term_meta( $term_id, $meta_key, $meta_value ); + } + } + } + } + + // Delete File + unlink($target_path); + + return array('success' => (count($terms) ? 1 : 0), 'message' => (count($terms) ? __('The Organizers are imported successfully!', 'mec-organizer') : __('No Organizers found to import!', 'mec-organizer'))); + } + + public function import_page( $tab ) { + + if ( 'MEC-import' !== $tab ) { + return; + } + + $tax = str_replace( 'mec_', '', $this->taxonomy ); + $taxonomy = "{$tax}s"; + + $ix_action = isset($_REQUEST['mec-ix-action']) ? sanitize_text_field( $_REQUEST['mec-ix-action'] ) : ''; + ?> +
    +

    +
    +
    +

    + ' . __('Modern Events Calendar', 'mec-organizer') . '' + ); + ?> +

    +

    + +

    +
    +
    + + + + +
    +
    +
    + + +
    + +
    + +
    + +
    + $notice, + "type" => $type, + "dismissible" => $dismissible_text + )); + + update_option("mec_flash_notices", $notices ); + } + + /** + * Display flush notices + * + * @since 1.0.0 + * + * @return void + */ + function display_flash_notices() { + $notices = get_option( "mec_flash_notices", array() ); + + foreach ( $notices as $notice ) { + + printf('

    %3$s

    ', + $notice['type'], + $notice['dismissible'], + $notice['notice'] + ); + } + + if( ! empty( $notices ) ) { + + delete_option( "mec_flash_notices", array() ); + } + } +} \ No newline at end of file diff --git a/app/core/src/Libraries/index.php b/app/core/src/Libraries/index.php new file mode 100755 index 0000000..40d16fd --- /dev/null +++ b/app/core/src/Libraries/index.php @@ -0,0 +1,5 @@ +ID; + if(!$term_id){ + return []; + } + + return array( + 'id'=>$term_id, + 'name'=>$term->name, + 'address'=> get_term_meta( $term_id, 'address', true), + 'latitude'=>get_term_meta($term_id, 'latitude', true), + 'longitude'=>get_term_meta($term_id, 'longitude', true), + 'url'=>get_term_meta($term_id, 'url', true), + 'thumbnail'=>get_term_meta($term_id, 'thumbnail', true) + ); + } +} \ No newline at end of file diff --git a/app/core/src/Locations/index.php b/app/core/src/Locations/index.php new file mode 100755 index 0000000..112d0ee --- /dev/null +++ b/app/core/src/Locations/index.php @@ -0,0 +1,5 @@ + '', + 'group_id' => '', + 'base_field_name' => '', + 'section_title' => '', + 'enable_options_text' => '', + 'enable_options_description' => '', + 'placeholders' => [], + 'options' => '', + ); + + $atts = wp_parse_args( $atts, $default ); + + $atts = apply_filters( 'mec_display_notification_settings_atts', $atts ); + + include __DIR__ .'/template-notification-settings.php'; + } +} \ No newline at end of file diff --git a/app/core/src/Notifications/SendEmail.php b/app/core/src/Notifications/SendEmail.php new file mode 100755 index 0000000..a6eca0a --- /dev/null +++ b/app/core/src/Notifications/SendEmail.php @@ -0,0 +1,489 @@ +get_options('notifications'); + + return isset($options[$this->group_id]) && is_array($options[$this->group_id]) ? $options[$this->group_id] : $this->get_default_notification_settings(); + } + + public function get_default_notification_settings(){ + + return []; + } + + public function get_notification_settings( $key = null ){ + + if( empty($this->notifications_options) ){ + $global_options = $this->_get_notifications_settings(); + $this->notifications_options = $global_options; + + $event_options = []; + if($this->event_id){ + + $event = new Event( $this->event_id, false ); + $event_options = $event->get_notifications_settings(); + if( isset($event_options['status']) && (bool)$event_options['status'] ){ + + $this->notifications_options['subject'] = $event_options['subject']; + $this->notifications_options['content'] = $event_options['content']; + } + if ( str_contains($this->group_id,'rsvp')){ + if( isset($event_options[$this->group_id]['status']) && (bool)$event_options[$this->group_id]['status'] ){ + + $this->notifications_options['subject'] = $event_options[$this->group_id]['subject']; + $this->notifications_options['content'] = $event_options[$this->group_id]['content']; + } + } + } + + $this->notifications_options = apply_filters('mec_get_notifications_options', $this->notifications_options, $this->group_id, $global_options, $event_options ); + } + + if(!is_null( $key )){ + + return isset( $this->notifications_options[$key] ) ? $this->notifications_options[$key] : null; + } + + return $this->notifications_options; + } + + public function get_subject( $default = '' ){ + + $subject = $this->get_notification_settings( 'subject' ); + + return !is_null($subject) ? esc_html__($subject, 'modern-events-calendar-lite') : $default; + } + + public function get_content( $default = '' ){ + + $content = $this->get_notification_settings( 'content' ); + + return !empty($content) ? $content : $default; + } + + public function get_enabled_status(){ + + $status = $this->get_notification_settings( 'status' ); + + return (bool)$status ; + } + + public function get_send_to_admin_status(){ + + $status = $this->get_notification_settings( 'send_to_admin' ); + + return (bool)$status ; + } + + public function get_send_to_organizer_status(){ + + $status = $this->get_notification_settings( 'send_to_organizer' ); + + return (bool)$status ; + } + + public function get_send_to_event_author_status(){ + + $status = $this->get_notification_settings( 'send_to_author' ); + + return (bool)$status ; + } + + public function get_send_to_user_status(){ + + $status = $this->get_notification_settings( 'send_to_user' ); + + return (bool)$status ; + } + + public function get_recipients_emails(){ + + $recipients = $this->get_notification_settings( 'recipients' ); + $recipients = explode(',', trim($recipients)); + + return !empty($recipients) && is_array($recipients) ? $recipients : []; + } + + public function get_receiver_users_ids(){ + + $users_ids = $this->get_notification_settings( 'receiver_users' ); + + return !empty($users_ids) && is_array($users_ids) ? $users_ids : []; + } + + public function get_receiver_users_emails(){ + + $users_ids = $this->get_receiver_users_ids(); + + return (array)\MEC\base::get_main()->get_emails_by_users($users_ids); + } + + public function get_receiver_roles(){ + + $users_ids = $this->get_notification_settings( 'receiver_roles' ); + + return !empty($users_ids) && is_array($users_ids) ? $users_ids : []; + } + + public function get_receiver_roles_emails(){ + + $users_roles = $this->get_receiver_roles(); + + return (array)\MEC\base::get_main()->get_emails_by_roles( $users_roles ); + } + + public function get_organizer_email(){ + + $organizer_id = get_post_meta($this->event_id, 'mec_organizer_id', true); + $email = get_term_meta($organizer_id, 'email', true); + + return trim($email) ? $email : false; + } + + public function get_event_author_email(){ + + $email = ''; + $event = get_post( $this->event_id ); + $author_id = isset( $event->post_author ) ? $event->post_author : 0; + $user = $author_id ? get_user_by( 'id', $author_id ) : false; + if( is_a( $user, '\WP_User' ) ) { + + $email = isset( $user->user_email ) ? $user->user_email : ''; + } + + return trim($email) ? $email : false; + } + + public function get_all_recipients_emails(){ + + $emails = array_merge( + $this->get_recipients_emails(), + $this->get_receiver_users_emails(), + ); + + $emails = array_merge( + $emails, + $this->get_receiver_roles_emails() + ); + + $emails = array_map('trim', $emails); + foreach($emails as $k => $email){ + + if(empty($email) || !filter_var($email, FILTER_VALIDATE_EMAIL)){ + + unset($emails[$k]); + } + } + + return array_unique($emails); + } + + public function get_target_users_or_emails(){ + + $users_or_emails = []; + + + $allowed_check_settings_for_attendees = $this->allowed_check_settings_for_attendees(); + + + $is_in_allowed = in_array($this->group_id, $allowed_check_settings_for_attendees); + + if( + !$is_in_allowed + || + ($is_in_allowed && $this->get_send_to_user_status()) + ){ + + $attendees = $this->get_attendees(); + + if( is_array($attendees) && !empty($attendees) ){ + + $users_or_emails = $attendees; + } + } + + if($this->get_send_to_admin_status()){ + + $users_or_emails[] = get_bloginfo('admin_email'); + } + + if($this->get_send_to_organizer_status()){ + + $organizer_email = $this->get_organizer_email(); + if(!empty($organizer_email)){ + + $users_or_emails[] = $organizer_email; + } + } + + if($this->get_send_to_event_author_status()){ + + $author_email = $this->get_event_author_email(); + if(!empty($author_email)){ + + $users_or_emails[] = $author_email; + } + } + + return $users_or_emails; + } + + public function get_author($object_id){ + return (object)[]; + } + + public function render_author(&$content,$object_id,$attendee){ + + $author = $this->get_author($object_id); + + + $first_name = (isset($author->first_name) ? $author->first_name : ''); + $last_name = (isset($author->last_name) ? $author->last_name : ''); + $name = (isset($author->first_name) ? trim($author->first_name.' '.(isset($author->last_name) ? $author->last_name : '')) : ''); + $email = (isset($author->user_email) ? $author->user_email : ''); + + /** + * Get the data from Attendee instead of main author user + */ + if(isset($attendee['name']) and trim($attendee['name'])){ + $name = $attendee['name']; + $attendee_ex_name = explode(' ', $name); + + $first_name = isset($attendee_ex_name[0]) ? $attendee_ex_name[0] : ''; + $last_name = isset($attendee_ex_name[1]) ? $attendee_ex_name[1] : ''; + $email = isset($attendee['email']) ? $attendee['email'] : $email; + } + + // author Data + $content = str_replace('%%first_name%%', $first_name, $content); + $content = str_replace('%%last_name%%', $last_name, $content); + $content = str_replace('%%name%%', $name, $content); + $content = str_replace('%%user_email%%', $email, $content); + $content = str_replace('%%user_id%%', (isset($author->ID) ? $author->ID : ''), $content); + + return $content; + } + + public function render_site_data(&$content,$object_id){ + + $content = str_replace('%%blog_name%%', get_bloginfo('name'), $content); + $content = str_replace('%%blog_url%%', get_bloginfo('url'), $content); + $content = str_replace('%%blog_description%%', get_bloginfo('description'), $content); + + return $content; + } + + public function render_event_data(&$content,$object_id,$timestamps){ + + // Date & Time Format + $date_format = get_option('date_format'); + $time_format = get_option('time_format'); + + if(!trim($timestamps)) { + + $timestamps = $this->get_event_times(); + } + list($start_timestamp, $end_timestamp) = explode(':', $timestamps); + + // Event Data + $organizer_id = get_post_meta($this->event_id, 'mec_organizer_id', true); + $location_id = get_post_meta($this->event_id, 'mec_location_id', true); + $speaker_id = wp_get_post_terms( $this->event_id, 'mec_speaker', ''); + + $organizer = get_term($organizer_id, 'mec_organizer'); + $location = get_term($location_id, 'mec_location'); + + // Data Fields + $event_fields = \MEC\Base::get_main()->get_event_fields(); + $event_fields_data = get_post_meta($this->event_id, 'mec_fields', true); + if(!is_array($event_fields_data)) $event_fields_data = []; + + foreach($event_fields as $f => $event_field){ + if(!is_numeric($f)) { + + continue; + } + + $event_field_name = isset($event_field['label']) ? $event_field['label'] : ''; + $field_value = isset($event_fields_data[$f]) ? $event_fields_data[$f] : NULL; + if((!is_array($field_value) and trim($field_value) === '') or (is_array($field_value) and !count($field_value))){ + $content = str_replace('%%event_field_'.$f.'%%', '', $content); + $content = str_replace('%%event_field_'.$f.'_with_name%%', '', $content); + + continue; + } + + if(is_array($field_value)) $field_value = implode(', ', $field_value); + + $content = str_replace('%%event_field_'.$f.'%%', trim(stripslashes($field_value), ', '), $content); + $content = str_replace('%%event_field_'.$f.'_with_name%%', trim((trim($event_field_name) ? stripslashes($event_field_name).': ' : '').trim(stripslashes($field_value), ', ')), $content); + } + + $content = str_replace('%%event_title%%', get_the_title($this->event_id), $content); + $content = str_replace('%%event_description%%', strip_tags(strip_shortcodes(get_post_field('post_content', $this->event_id))), $content); + + $event_tags = get_the_terms($this->event_id, apply_filters('mec_taxonomy_tag', '')); + $content = str_replace('%%event_tags%%', (is_array($event_tags) ? join(', ', wp_list_pluck($event_tags, 'name')) : ''), $content); + + $event_labels = get_the_terms($this->event_id, 'mec_label'); + $content = str_replace('%%event_labels%%', (is_array($event_labels) ? join(', ', wp_list_pluck($event_labels, 'name')) : ''), $content); + + $event_categories = get_the_terms($this->event_id, 'mec_category'); + $content = str_replace('%%event_categories%%', (is_array($event_categories) ? join(', ', wp_list_pluck($event_categories, 'name')) : ''), $content); + + $mec_cost = get_post_meta($this->event_id, 'mec_cost', true); + $mec_cost = (isset($params['cost']) and trim($params['cost']) != '') ? preg_replace("/[^0-9.]/", '', $params['cost']) : $mec_cost; + + $read_more = get_post_meta($this->event_id, 'mec_read_more', true); + $read_more = (isset($params['read_more']) and trim($params['read_more']) != '') ? $params['read_more'] : $read_more; + + $more_info = get_post_meta($this->event_id, 'mec_more_info', true); + $more_info = (isset($params['more_info']) and trim($params['more_info']) != '') ? $params['more_info'] : $more_info; + + $content = str_replace('%%event_cost%%', (is_numeric($mec_cost) ? \MEC\Base::get_main()->render_price($mec_cost, $this->event_id) : $mec_cost), $content); + $content = str_replace('%%event_link%%', \MEC\Base::get_main()->get_event_date_permalink(get_permalink($this->event_id), date('Y-m-d', $start_timestamp)), $content); + $content = str_replace('%%event_more_info%%', esc_url($read_more), $content); + $content = str_replace('%%event_other_info%%', esc_url($more_info), $content); + $content = str_replace('%%event_start_date%%', \MEC\Base::get_main()->date_i18n($date_format, $start_timestamp), $content); + $content = str_replace('%%event_end_date%%', \MEC\Base::get_main()->date_i18n($date_format, $end_timestamp), $content); + $content = str_replace('%%event_start_time%%', date_i18n($time_format, $start_timestamp), $content); + $content = str_replace('%%event_end_time%%', date_i18n($time_format, $end_timestamp), $content); + $content = str_replace('%%event_timezone%%', \MEC\Base::get_main()->get_timezone($this->event_id), $content); + + $online_link = \MEC_feature_occurrences::param($this->event_id, $start_timestamp, 'moved_online_link', get_post_meta($this->event_id, 'mec_moved_online_link', true)); + $content = str_replace('%%online_link%%', esc_url($online_link), $content); + + $featured_image = ''; + $thumbnail_url = \MEC\Base::get_main()->get_post_thumbnail_url($this->event_id, 'medium'); + if(trim($thumbnail_url)) $featured_image = ''; + + $content = str_replace('%%event_featured_image%%', $featured_image, $content); + + $content = str_replace('%%event_organizer_name%%', (isset($organizer->name) ? $organizer->name : ''), $content); + $content = str_replace('%%event_organizer_tel%%', get_term_meta($organizer_id, 'tel', true), $content); + $content = str_replace('%%event_organizer_email%%', get_term_meta($organizer_id, 'email', true), $content); + $content = str_replace('%%event_organizer_url%%', get_term_meta($organizer_id, 'url', true), $content); + + $additional_organizers_name = ''; + $additional_organizers_tel = ''; + $additional_organizers_email = ''; + $additional_organizers_url = ''; + + $additional_organizers_ids = get_post_meta($this->event_id, 'mec_additional_organizer_ids', true); + if(!is_array($additional_organizers_ids)) $additional_organizers_ids = []; + + foreach($additional_organizers_ids as $additional_organizers_id) + { + $additional_organizer = get_term($additional_organizers_id, 'mec_organizer'); + if(isset($additional_organizer->name)) + { + $additional_organizers_name .= $additional_organizer->name.', '; + $additional_organizers_tel .= get_term_meta($additional_organizers_id, 'tel', true).'
    '; + $additional_organizers_email .= get_term_meta($additional_organizers_id, 'email', true).'
    '; + $additional_organizers_url .= get_term_meta($additional_organizers_id, 'url', true).'
    '; + } + } + + $content = str_replace('%%event_other_organizers_name%%', trim($additional_organizers_name, ', '), $content); + $content = str_replace('%%event_other_organizers_tel%%', trim($additional_organizers_tel, ', '), $content); + $content = str_replace('%%event_other_organizers_email%%', trim($additional_organizers_email, ', '), $content); + $content = str_replace('%%event_other_organizers_url%%', trim($additional_organizers_url, ', '), $content); + + $speaker_name = []; + foreach($speaker_id as $speaker) $speaker_name[] = isset($speaker->name) ? $speaker->name : null; + + $content = str_replace('%%event_speaker_name%%', (isset($speaker_name) ? implode(', ', $speaker_name): ''), $content); + $content = str_replace('%%event_location_name%%', (isset($location->name) ? $location->name : get_term_meta($location_id, 'address', true)), $content); + $content = str_replace('%%event_location_address%%', get_term_meta($location_id, 'address', true), $content); + + $additional_locations_name = ''; + $additional_locations_address = ''; + + $additional_locations_ids = get_post_meta($this->event_id, 'mec_additional_location_ids', true); + if(!is_array($additional_locations_ids)) $additional_locations_ids = []; + + foreach($additional_locations_ids as $additional_locations_id){ + $additional_location = get_term($additional_locations_id, 'mec_location'); + if(isset($additional_location->name)) + { + $additional_locations_name .= $additional_location->name.', '; + $additional_locations_address .= get_term_meta($additional_locations_id, 'address', true).'
    '; + } + } + + $content = str_replace('%%event_other_locations_name%%', trim($additional_locations_name, ', '), $content); + $content = str_replace('%%event_other_locations_address%%', trim($additional_locations_address, ', '), $content); + + $gmt_offset_seconds = \MEC\Base::get_main()->get_gmt_offset_seconds($start_timestamp, $this->event_id); + $event_title = get_the_title($this->event_id); + $event_info = get_post($this->event_id); + $event_content = trim($event_info->post_content) ? strip_shortcodes(strip_tags($event_info->post_content)) : $event_title; + $event_content = apply_filters('mec_add_content_to_export_google_calendar_details', $event_content,$this->event_id ); + + // Virtual Event + $content = str_replace('%%virtual_link%%', get_post_meta($this->event_id, 'mec_virtual_link_url', true), $content); + $content = str_replace('%%virtual_password%%', get_post_meta($this->event_id, 'mec_virtual_password', true), $content); + $content = str_replace('%%virtual_embed%%', get_post_meta($this->event_id, 'mec_virtual_embed', true), $content); + + $content = str_replace('%%zoom_join%%', get_post_meta($this->event_id, 'mec_zoom_join_url', true), $content); + $content = str_replace('%%zoom_link%%', get_post_meta($this->event_id, 'mec_zoom_link_url', true), $content); + $content = str_replace('%%zoom_password%%', get_post_meta($this->event_id, 'mec_zoom_password', true), $content); + $content = str_replace('%%zoom_embed%%', get_post_meta($this->event_id, 'mec_zoom_embed', true), $content); + + return $content; + } + + public function add_template($content){ + + $style = \MEC\Base::get_main()->get_styling(); + $bgnotifications = isset($style['notification_bg']) ? $style['notification_bg'] : '#f6f6f6'; + + return ' + + + +
    +
    + '.\MEC_kses::page($content).' +
    +
    '; + } + + public function send_mail($args){ + + return wp_mail( + $args['to'], + html_entity_decode(stripslashes($args['subject']), ENT_HTML5), + wpautop(stripslashes($args['message'])), + $args['headers'], + $args['attachments'] + ); + } +} diff --git a/app/core/src/Notifications/index.php b/app/core/src/Notifications/index.php new file mode 100755 index 0000000..112d0ee --- /dev/null +++ b/app/core/src/Notifications/index.php @@ -0,0 +1,5 @@ + + +
    + +

    +
    +
    + +
    +

    +
    +
    + + + +
    +
    + +
    +
    + +
    +
    + + +
    +
    + +
    +
    + get_users_dropdown($users, $group_id . '_notification'); + ?> + +
    +
    +

    +
    + +
    +
    +
    + + + +
    +
    + +
    +
    + get_roles_dropdown($roles, $group_id . '_notification'); + ?> + +
    +
    +

    +
    + +
    +
    +
    + + +
    +
    + +
    +
    + + +
    +
    +

    +
    + +
    +
    +
    + + + +
    + + esc_attr($base_field_name.'['. $group_id.'_notification][content]') + ) + ); + ?> +
    + + + +
    +
    +

    +
      + $p_text): ?> +
    • :
    • + + +
    +
    +
    + + + +
    +
    diff --git a/app/core/src/PostBase.php b/app/core/src/PostBase.php new file mode 100755 index 0000000..56871ed --- /dev/null +++ b/app/core/src/PostBase.php @@ -0,0 +1,138 @@ + $data, + ); + } + + if ( is_a( $data, '\WP_Post' ) ) { + + $data = (array) $data; + } elseif ( is_object( $data ) ) { + + $data = (array) $data; + } + + $this->data = $data; + $this->ID = isset($this->data['ID']) ? $this->data['ID'] : 0; + } + + /** + * @return int + */ + public function get_id() { + + return $this->ID; + } + + /** + * @return int + */ + public function get_title() { + + return isset($this->data['title']) ? $this->data['title'] : get_the_title($this->ID); + } + + /** + * @param string $key + * @param mixed $default + * + * @return mixed + */ + public function get_data( $key, $default = null ) { + + $v = isset( $this->data[ $key ] ) ? $this->data[ $key ] : $default; + + return apply_filters( 'mec_' . $this->type . '_get_data', $v, $key, $this->data, $default ); + } + + /** + * @param string $key + * @param mixed $value + */ + public function set_data( $key, $value ) { + + $value = apply_filters( 'mec_' . $this->type . '_get_data', $value, $key, $this->data ); + $this->data[ $key ] = $value; + } + + public function get_cached_all_data() { + + return $this->data; + } + + /** + * @return array|int|\WP_Post|null + */ + public function to_array() { + + return $this->get_cached_all_data(); + } + + /** + * @param string $key + * @param bool $return_cached + * + * @return mixed + */ + public function get_meta( $key, $return_cached = true ) { + + if(empty($key)){ + + return null; + } + + $data = $this->get_data( $key ); + if ( is_null( $data ) || !$return_cached ) { + + $data = get_post_meta( $this->ID, $key, true ); + $this->data[ $key ] = $data; + } + + return $data; + } + + /** + * @param string $key + * @param $value + * + * @return void + */ + public function set_meta( $key, $value ) { + + update_post_meta( $this->ID, $key, $value ); + $this->set_data( $key, $value ); + } + +} diff --git a/app/core/src/Settings/Settings.php b/app/core/src/Settings/Settings.php new file mode 100755 index 0000000..d6e9277 --- /dev/null +++ b/app/core/src/Settings/Settings.php @@ -0,0 +1,67 @@ +options = (array) get_option( 'mec_options' ); + } + + /** + * @param string|null $key + * + * @return false|mixed|void + */ + public function get_options( $key = null ) { + + if ( !is_null( $key ) ) { + + return isset( $this->options[ $key ] ) ? $this->options[ $key ] : null; + } + + return $this->options; + } + + /** + * @param string|null $key + * + * @return false|mixed|void + */ + public function get_settings( $key = null ) { + + + if ( !is_null( $key ) ) { + + return isset( $this->options['settings'][ $key ] ) ? $this->options['settings'][ $key ] : null; + } + + return isset( $this->options['settings'] ) ? $this->options['settings'] : []; + } + + /** + * @param string|null $key + * + * @return false|mixed|void + */ + public function get_styling( $key = null ) { + + + if ( !is_null( $key ) ) { + + return isset( $this->options['styling'][ $key ] ) ? $this->options['styling'][ $key ] : null; + } + + return isset( $this->options['styling'] ) ? $this->options['styling'] : []; + } + + + +} \ No newline at end of file diff --git a/app/core/src/Settings/index.php b/app/core/src/Settings/index.php new file mode 100755 index 0000000..9d7a83d --- /dev/null +++ b/app/core/src/Settings/index.php @@ -0,0 +1,5 @@ +get_event_id(); + } + + /** + * Get html of widget + * + * @param string $widget + * @return string + */ + public function output( $widget, $event_id = 0, $atts = array() ){ + + $html = ''; + switch( $widget ){ + + case 'title': + case 'simple-header': + + $html = Widgets\SimpleHeader\SimpleHeader::getInstance()->output( $event_id, $atts ); + + break; + + case 'content': + + $html = Widgets\Content\Content::getInstance()->output( $event_id, $atts ); + + break; + + case 'featured-image': + case 'thumbnail': + + $html = Widgets\FeaturedImage\FeaturedImage::getInstance()->output( $event_id, $atts ); + + break; + case 'event-gallery': + + $html = Widgets\EventGallery\EventGallery::getInstance()->output( $event_id, $atts ); + + break; + + case 'event-breadcrumbs': + + $html = Widgets\EventBreadcrumbs\EventBreadcrumbs::getInstance()->output( $event_id, $atts ); + + break; + + case 'event-cancellation-reason': + + $html = Widgets\EventCancellationReason\EventCancellationReason::getInstance()->output( $event_id, $atts ); + + break; + + case 'event-attendees': + + $html = Widgets\EventAttendees\EventAttendees::getInstance()->output( $event_id, $atts ); + + break; + case 'booking-form': + + $html = Widgets\BookingForm\BookingForm::getInstance()->output( $event_id, $atts ); + + break; + case 'rsvp-form': + + $html = Widgets\RSVPForm\RSVPForm::getInstance()->output( $event_id, $atts ); + + break; + + case 'event-category': + + $html = Widgets\EventCategories\EventCategories::getInstance()->output( $event_id, $atts ); + + break; + + case 'event-cost': + + $html = Widgets\EventCost\EventCost::getInstance()->output( $event_id, $atts ); + + break; + + case 'event-countdown': + + $html = Widgets\EventCountdown\EventCountdown::getInstance()->output( $event_id, $atts ); + + break; + + case 'event-data': + + $html = Widgets\EventData\EventData::getInstance()->output( $event_id, $atts ); + + break; + + case 'event-date': + + $html = Widgets\EventDate\EventDate::getInstance()->output( $event_id, $atts ); + + break; + + case 'event-export': + + $html = Widgets\EventExport\EventExport::getInstance()->output( $event_id, $atts ); + + break; + case 'event-googlemap': + + $html = Widgets\EventGoogleMap\EventGoogleMap::getInstance()->output( $event_id, $atts ); + + break; + + case 'event-hourly-schedule': + + $html = Widgets\EventHourlySchedule\EventHourlySchedule::getInstance()->output( $event_id, $atts ); + + break; + + case 'event-labels': + + $html = Widgets\EventLabels\EventLabels::getInstance()->output( $event_id, $atts ); + + break; + case 'event-local-time': + + $html = Widgets\EventLocalTime\EventLocalTime::getInstance()->output( $event_id, $atts ); + + break; + case 'event-locations': + + $html = Widgets\EventLocations\EventLocations::getInstance()->output( $event_id, $atts ); + + break; + case 'event-more-info': + + $html = Widgets\EventMoreInfo\EventMoreInfo::getInstance()->output( $event_id, $atts ); + + break; + case 'event-next-occurrences': + + $html = Widgets\EventNextOccurrences\EventNextOccurrences::getInstance()->output( $event_id, $atts ); + + break; + case 'event-next-previous': + + $html = Widgets\EventNextPrevious\EventNextPrevious::getInstance()->output( $event_id, $atts ); + + break; + + case 'event-organizers': + + $html = Widgets\EventOrganizers\EventOrganizers::getInstance()->output( $event_id, $atts ); + + break; + case 'event-qr-code': + + $html = Widgets\EventQrCode\EventQrCode::getInstance()->output( $event_id, $atts ); + + break; + case 'event-register-button': + + $html = Widgets\EventRegisterButton\EventRegisterButton::getInstance()->output( $event_id, $atts ); + + break; + case 'event-related': + + $html = Widgets\EventRelated\EventRelated::getInstance()->output( $event_id, $atts ); + + break; + case 'event-social-share': + + $html = Widgets\EventSocialShare\EventSocialShare::getInstance()->output( $event_id, $atts ); + + break; + case 'event-speakers': + + $html = Widgets\EventSpeakers\EventSpeakers::getInstance()->output( $event_id, $atts ); + + break; + case 'event-sponsors': + + $html = Widgets\EventSponsors\EventSponsors::getInstance()->output( $event_id, $atts ); + + break; + case 'event-tags': + + $html = Widgets\EventTags\EventTags::getInstance()->output( $event_id, $atts ); + + break; + case 'event-time': + + $html = Widgets\EventTime\EventTime::getInstance()->output( $event_id, $atts ); + + break; + case 'event-weather': + + $html = Widgets\EventWeather\EventWeather::getInstance()->output( $event_id, $atts ); + + break; + case 'event-public-download': + + $html = Widgets\EventPublicDownload\EventPublicDownload::getInstance()->output( $event_id, $atts ); + + break; + case 'event-zoom': + + $html = Widgets\EventZoom\EventZoom::getInstance()->output( $event_id, $atts ); + + break; + case 'event-virtual': + + $html = Widgets\EventVirtual\EventVirtual::getInstance()->output( $event_id, $atts ); + + break; + case 'event-faq': + + $html = Widgets\FAQ\FAQ::getInstance()->output( $event_id, $atts ); + + break; + case 'event-trailer-url': + + $html = Widgets\EventTrailerUrl\EventTrailerUrl::getInstance()->output( $event_id, $atts ); + + break; + case 'event-banner': + + $html = Widgets\EventBanner\EventBanner::getInstance()->output( $event_id, $atts ); + + break; + + } + + return $html; + } +} diff --git a/app/core/src/SingleBuilder/Widgets/BookingForm/BookingForm.php b/app/core/src/SingleBuilder/Widgets/BookingForm/BookingForm.php new file mode 100755 index 0000000..98d1b0c --- /dev/null +++ b/app/core/src/SingleBuilder/Widgets/BookingForm/BookingForm.php @@ -0,0 +1,92 @@ +display_form($event_id); + return ob_get_clean(); + } + + /** + * Get HTML Output + * + * @param int $event_id + * @param array $atts + * + * @return string + */ + public function output( $event_id = 0, $atts = array() ){ + + if( !$event_id ){ + + $event_id = $this->get_event_id(); + } + + if(!$event_id){ + return ''; + } + + if( isset( $atts['display_price_label'] ) && $atts['display_price_label'] ){ + update_option('mec_filter_price_label','yes'); + update_option('mec_filter_ticket_price_label','yes'); + + }else{ + + update_option('mec_filter_price_label','no'); + update_option('mec_filter_ticket_price_label','no'); + } + + $settings = $this->settings; + $event_detail = $this->get_event_detail($event_id); + $html = ''; + + if ( true === $this->is_editor_mode && ( !isset($settings['booking_status']) || !$settings['booking_status'] ) ) { + $html = '
    +

    ' + .'' + . esc_html__('This widget is displayed if label is set. In order for the widget in this page to be displayed correctly, please set Booking module for your last event.', 'modern-events-calendar-lite') + .'' + .'' . esc_html__('How to set booking module', 'modern-events-calendar-lite') . ' ' + .'

    ' + .'
    '; + } else { + + $html = $this->get_display_booking_form($event_id); + + if ( true === $this->is_editor_mode && \MEC\Base::get_main()->can_show_booking_module($event_detail) && isset($settings['single_booking_style']) && $settings['single_booking_style'] == 'modal'){ + + $html .= ''; + + $html .= '

    ' + .__('It seems that you have set "Booking" to modal from Single Event MEC Settings. You need to know that for this mode to work you must add Register Button Widget to this page, then in the front-end by clicking the Register button in your events you can then see the modal mode of the Booking.', 'modern-events-calendar-lite') + .'

    '; + }elseif( true === $this->is_editor_mode && empty($html) ){ + + $html .= '

    ' + .'' + . esc_html__('This widget is displayed if Booking is set. In order for the widget in this page to be displayed correctly, please set Booking module for your last event.', 'modern-events-calendar-lite') + .'' + .'' . esc_html__('How to set Booking module', 'modern-events-calendar-lite') . ' ' + .'

    '; + }elseif ( true === $this->is_editor_mode ){ + + $html .= ''; + } + } + + return $html; + } +} diff --git a/app/core/src/SingleBuilder/Widgets/Content/Content.php b/app/core/src/SingleBuilder/Widgets/Content/Content.php new file mode 100755 index 0000000..f78d4b5 --- /dev/null +++ b/app/core/src/SingleBuilder/Widgets/Content/Content.php @@ -0,0 +1,64 @@ +get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $content = get_the_content( '', false, $event_id ); + $content = wpautop( $content ); + $content = do_shortcode( $content ); + + if( !$this->is_editor_mode() ){ + + $content = apply_filters( 'the_content', $content ); + $content = str_replace( ']]>', ']]>', $content ); + }else{ + + if( 'yes' === get_post_meta( $event_id, '_elementor_edit_mode', true ) ){ + + $content = \Elementor\Plugin::instance()->frontend->get_builder_content_for_display( $event_id ); + } + } + + if ( empty( $content ) && $this->is_editor_mode() ) { + + $html = '

    ' + .''. esc_html__('This widget is displayed if event content is set. In order for the widget in this page to be displayed correctly, please set content for your last event.', 'modern-events-calendar-lite').'' + .'

    '; + } else { + + $class_loadmore = ''; + if ( isset($atts['mec_content_loadmore']) && $atts['mec_content_loadmore'] ) { + $class_loadmore = 'read-more-text'; + } + + $html = '
    ' + . $content . + '
    '; + } + + return $html; + } +} diff --git a/app/core/src/SingleBuilder/Widgets/EventAttendees/EventAttendees.php b/app/core/src/SingleBuilder/Widgets/EventAttendees/EventAttendees.php new file mode 100755 index 0000000..ed61b92 --- /dev/null +++ b/app/core/src/SingleBuilder/Widgets/EventAttendees/EventAttendees.php @@ -0,0 +1,51 @@ +get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $settings = $this->settings; + $events_detail = $this->get_event_detail($event_id); + + $html = ''; + if( isset($settings['bp_status']) && $settings['bp_status'] ){ + + ob_start(); + echo Base::get_main()->module('attendees-list.details', array('event'=>$events_detail)); + $html = ob_get_clean(); + } + + if ( true === $this->is_editor_mode && empty( $html ) ) { + + $html = '

    ' + .''. esc_html__('This widget is displayed if buddypress is set. In order for the widget in this page to be displayed correctly, please set buddypress for your last event.', 'modern-events-calendar-lite').'' + . '' . esc_html__('How to set buddypress', 'modern-events-calendar-lite') . ' ' + .'

    '; + } + + return $html; + } +} + diff --git a/app/core/src/SingleBuilder/Widgets/EventBanner/EventBanner.php b/app/core/src/SingleBuilder/Widgets/EventBanner/EventBanner.php new file mode 100755 index 0000000..4dd9ba0 --- /dev/null +++ b/app/core/src/SingleBuilder/Widgets/EventBanner/EventBanner.php @@ -0,0 +1,116 @@ +get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $settings = $this->settings; + $event = $this->get_event_detail($event_id); + $single = new \MEC_skin_single(); + + $html = ''; + + if ( true === $this->is_editor_mode && !$single->can_display_banner_module($event)) { + $html = '

    ' + .''. esc_html__('This widget is displayed if Enabled Banner is set. please set Enable Event Banner Feature for Single Event Page.', 'modern-events-calendar-lite').'' + . '' . esc_html__('How to set Enable Event Banner Feature', 'modern-events-calendar-lite') . ' ' + .'

    '; + } else { + + $occurrence = (isset($event->date['start']['date']) ? $event->date['start']['date'] : (isset($_GET['occurrence']) ? sanitize_text_field($_GET['occurrence']) : '')); + $occurrence_end_date = (isset($event->date['end']['date']) ? $event->date['end']['date'] : (trim($occurrence) ? $single->main->get_end_date_by_occurrence($event->data->ID, (isset($event->date['start']['date']) ? $event->date['start']['date'] : $occurrence)) : '')); + + $occurrence_full = (isset($event->date['start']) and is_array($event->date['start'])) ? $event->date['start'] : []; + if(!count($occurrence_full) and isset($_GET['occurrence'])) $occurrence_full = array('date' => sanitize_text_field($_GET['occurrence'])); + + $occurrence_end_full = (isset($event->date['end']) and is_array($event->date['end'])) ? $event->date['end'] : []; + if(!count($occurrence_end_full) and trim($occurrence)) $occurrence_end_full = array('date' => $single->main->get_end_date_by_occurrence($event->data->ID, $occurrence)); + + ob_start(); + + // Banner Options + $banner = isset($event->data, $event->data->meta, $event->data->meta['mec_banner']) ? $event->data->meta['mec_banner'] : []; + if(!is_array($banner)) $banner = []; + + $color = $banner['color'] ?? ''; + $image = $banner['image'] ?? ''; + + $featured_image = $banner['use_featured_image'] ?? 0; + + // Force Featured Image + if(isset($this->settings['banner_force_featured_image']) && $this->settings['banner_force_featured_image']) + { + $featured_image = 1; + if(trim($color) === '') $color = '#333333'; + } + + if($featured_image) $image = (string) get_the_post_thumbnail_url($event->ID, 'full'); + + $mode = 'color'; + $bg = 'background: '.$color; + + if(trim($image)) + { + $bg = 'background: url(\''.$image.'\') no-repeat center; background-size: cover'; + $mode = trim($color) ? 'color-image' : 'image'; + } + + $location_id = $single->main->get_master_location_id($event); + $location = $location_id ? $single->main->get_location_data($location_id) : []; + + $content = ''; + + // Title + $content .= '
    '; + $content .= MEC_kses::element($single->main->display_cancellation_reason($event, $single->display_cancellation_reason)); + $content .= '

    '.get_the_title().'

    '; + $content .= '
    '; + + // Date & Time + ob_start(); + $single->display_datetime_widget($event, $occurrence_full, $occurrence_end_full); + $content .= '
    '.ob_get_clean().'
    '; + + // Location + if($location_id and count($location)) + { + ob_start(); + $single->display_location_widget($event); + $content .= '
    '.ob_get_clean().'
    '; + } + + echo '
    ' + .$content. + '
    '. + ($mode === 'color-image' ? '
    ' : ''). + '
    '; + + $html = ob_get_clean(); + } + + return $html; + } +} diff --git a/app/core/src/SingleBuilder/Widgets/EventBreadcrumbs/EventBreadcrumbs.php b/app/core/src/SingleBuilder/Widgets/EventBreadcrumbs/EventBreadcrumbs.php new file mode 100755 index 0000000..1c1f911 --- /dev/null +++ b/app/core/src/SingleBuilder/Widgets/EventBreadcrumbs/EventBreadcrumbs.php @@ -0,0 +1,65 @@ +get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $single = new \MEC_skin_single(); + + ob_start(); + echo '
    '; + $single->display_breadcrumb_widget( $event_id ); + echo '
    '; + return ob_get_clean(); + } + + /** + * Get HTML Output + * + * @param int $event_id + * @param array $atts + * + * @return string + */ + public function output( $event_id = 0, $atts = array() ){ + + if( !$event_id ){ + + $event_id = $this->get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $settings = $this->settings; + $events_detail = $this->get_event_detail($event_id); + + if ( true === $this->is_editor_mode && ( !isset($settings['breadcrumbs']) || !$settings['breadcrumbs'] ) ) { + + $html = '

    ' + .''. esc_html__('This widget is displayed if breadcrumbs is set. In order for the widget in this page to be displayed correctly, please set breadcrumbs for your last event.', 'modern-events-calendar-lite').'' + . '' . esc_html__('How to set breadcrumbs', 'modern-events-calendar-lite') . ' ' + .'

    '; + } else { + + $html = $this->get_breadcrumb_html($event_id); + } + + return $html; + } +} diff --git a/app/core/src/SingleBuilder/Widgets/EventCancellationReason/EventCancellationReason.php b/app/core/src/SingleBuilder/Widgets/EventCancellationReason/EventCancellationReason.php new file mode 100755 index 0000000..7f07876 --- /dev/null +++ b/app/core/src/SingleBuilder/Widgets/EventCancellationReason/EventCancellationReason.php @@ -0,0 +1,64 @@ +get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $events_detail = $this->get_event_detail($event_id); + + $display_reason = get_post_meta( $event_id , 'mec_display_cancellation_reason_in_single_page', true); + ob_start(); + if ($display_reason) { + echo Base::get_main()->display_cancellation_reason($events_detail, $display_reason); + } + return ob_get_clean(); + } + + /** + * Get HTML Output + * + * @param int $event_id + * @param array $atts + * + * @return string + */ + public function output( $event_id = 0, $atts = array() ){ + + if( !$event_id ){ + + $event_id = $this->get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $display_reason = get_post_meta( $event_id , 'mec_display_cancellation_reason_in_single_page', true); + if ( !$display_reason && $this->is_editor_mode() ) { + + $html = '

    ' + .''. esc_html__('This widget is displayed if cancellation reason is set. In order for the widget in this page to be displayed correctly, please set cancellation reason for your last event.', 'modern-events-calendar-lite').'' + . '' . esc_html__('Cancellation Reason', 'modern-events-calendar-lite') . ' ' + .'

    '; + } else { + + $html = $this->get_html($event_id); + } + + return $html; + } +} diff --git a/app/core/src/SingleBuilder/Widgets/EventCategories/EventCategories.php b/app/core/src/SingleBuilder/Widgets/EventCategories/EventCategories.php new file mode 100755 index 0000000..21c62e4 --- /dev/null +++ b/app/core/src/SingleBuilder/Widgets/EventCategories/EventCategories.php @@ -0,0 +1,66 @@ +get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $settings = $this->settings; + $events_detail = $this->get_event_detail($event_id); + $categories = isset($events_detail->data->categories) ? $events_detail->data->categories : []; + + $html = ''; + if ( true === $this->is_editor_mode && empty( $categories ) ) { + + $html = '

    ' + .''. esc_html__('This widget is displayed if category is set. In order for the widget in this page to be displayed correctly, please set category for your last event.', 'modern-events-calendar-lite').'' + . '' . esc_html__('How to set category', 'modern-events-calendar-lite') . ' ' + .'

    '; + } elseif ( !empty($categories) ) { + + ob_start(); + echo '
    '; + if( isset( $atts['mec_category_show_icon'] ) && $atts['mec_category_show_icon'] ){ + echo $this->icons->display('folder'); + } + if( isset( $atts['mec_category_show_title'] ) && $atts['mec_category_show_title'] ){ + echo '
    ' . Base::get_main()->m('taxonomy_categories', esc_html__('Category', 'modern-events-calendar-lite')) . '
    '; + } + echo '
    '; + foreach ($categories as $category) { + $icon = get_metadata('term', $category['id'], 'mec_cat_icon', true); + if( isset( $atts['mec_category_show_link_icon'] ) && $atts['mec_category_show_link_icon'] ){ + $icon = isset($icon) && $icon != '' ? '' : ''; + } + echo '
    +
    '; + } + echo '
    '; + $html = ob_get_clean(); + } + + return $html; + } +} diff --git a/app/core/src/SingleBuilder/Widgets/EventCost/EventCost.php b/app/core/src/SingleBuilder/Widgets/EventCost/EventCost.php new file mode 100755 index 0000000..c28c3ef --- /dev/null +++ b/app/core/src/SingleBuilder/Widgets/EventCost/EventCost.php @@ -0,0 +1,113 @@ +get_event_id(); + } + + if (!$event_id) { + return ''; + } + + $settings = $this->settings; + $events_detail = $this->get_event_detail($event_id); + $html = ''; + if (true === $this->is_editor_mode && (isset($events_detail->data->meta['mec_cost_auto_calculate']) ? $events_detail->data->meta['mec_cost_auto_calculate'] == '0' : true )) { + if (!(isset($events_detail->data->meta['mec_cost']) && $events_detail->data->meta['mec_cost'] != '')) { + $html = '

    ' + . '' . esc_html__('This widget is displayed if cost is set. In order for the widget in this page to be displayed correctly, please set cost for your last event.', 'modern-events-calendar-lite') . '' + . '' . esc_html__('How to set cost', 'modern-events-calendar-lite') . ' ' + . '

    '; + }else{ + ob_start(); + + $cost = \MEC\Base::get_main()->get_event_cost($events_detail); + if ($cost) { + echo '
    '; + ?> +
    + icons->display('wallet'); + } ?> + +

    m('cost', esc_html__('Cost', 'modern-events-calendar-lite'))); ?>

    + +
    +
    + render_price($cost, $events_detail->ID); + } else { + + $rendered_cost = $cost; + } + + echo apply_filters('mec_display_event_cost', $rendered_cost, $cost); + ?> +
    +
    +
    + '; + } + } + } else { + ob_start(); + + $cost = \MEC\Base::get_main()->get_event_cost($events_detail); + if ($cost) { + echo '
    '; + ?> +
    + icons->display('wallet'); + } ?> + +

    m('cost', esc_html__('Cost', 'modern-events-calendar-lite'))); ?>

    + +
    +
    + render_price($cost, $events_detail->ID); + } else { + + $rendered_cost = $cost; + } + + echo apply_filters('mec_display_event_cost', $rendered_cost, $cost); + ?> +
    +
    +
    + '; + } + + $html = ob_get_clean(); + } + + return $html; + } +} diff --git a/app/core/src/SingleBuilder/Widgets/EventCountdown/EventCountdown.php b/app/core/src/SingleBuilder/Widgets/EventCountdown/EventCountdown.php new file mode 100755 index 0000000..f5b5f4b --- /dev/null +++ b/app/core/src/SingleBuilder/Widgets/EventCountdown/EventCountdown.php @@ -0,0 +1,50 @@ +get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $settings = $this->settings; + $events_detail = $this->get_event_detail($event_id); + + $html = ''; + if ( true === $this->is_editor_mode && ( !isset($settings['countdown_status']) || !$settings['countdown_status'] ) ) { + + $html = '

    ' + .''. esc_html__('This widget is displayed if cost is set. In order for the widget in this page to be displayed correctly, please set cost for your last event.', 'modern-events-calendar-lite').'' + . '' . esc_html__('How to set cost', 'modern-events-calendar-lite') . ' ' + .'

    '; + } else { + + $wrap_class = (true === $this->is_editor_mode) ? 'mec-wrap' : ''; + + $html = '
    ' + . Base::get_main()->module('countdown.details', array('event'=>array($events_detail))) . + '
    '; + } + + return $html; + } +} diff --git a/app/core/src/SingleBuilder/Widgets/EventData/EventData.php b/app/core/src/SingleBuilder/Widgets/EventData/EventData.php new file mode 100755 index 0000000..e32d1df --- /dev/null +++ b/app/core/src/SingleBuilder/Widgets/EventData/EventData.php @@ -0,0 +1,53 @@ +get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $settings = $this->settings; + $event_detail = $this->get_event_detail($event_id); + $data = (isset($event_detail->data->meta['mec_fields']) and is_array($event_detail->data->meta['mec_fields'])) ? $event_detail->data->meta['mec_fields'] : get_post_meta($event_detail->ID, 'mec_fields', true); + + + $html = ''; + if( !empty($data) && ( isset($settings['display_event_fields']) && $settings['display_event_fields'] ) ){ + + $single = new \MEC_skin_single(); + ob_start(); + $single->display_data_fields( $event_detail ); + $html = ob_get_clean(); + } + + if ( true === $this->is_editor_mode && empty( $html ) ) { + + $html = '

    ' + .''. esc_html__('This widget is displayed if event data is set. In order for the widget in this page to be displayed correctly, please set event data for your last event.', 'modern-events-calendar-lite').'' + . '' . esc_html__('How to set Custom Fields', 'modern-events-calendar-lite') . ' ' + .'

    '; + } + + return $html; + } +} diff --git a/app/core/src/SingleBuilder/Widgets/EventDate/EventDate.php b/app/core/src/SingleBuilder/Widgets/EventDate/EventDate.php new file mode 100755 index 0000000..4cbe5bb --- /dev/null +++ b/app/core/src/SingleBuilder/Widgets/EventDate/EventDate.php @@ -0,0 +1,68 @@ +get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $settings = $this->settings; + $event_detail = $this->get_event_detail($event_id); + + $occurrence = isset($_GET['occurrence']) ? sanitize_text_field($_GET['occurrence']) : ''; + $start_datetime = !trim($occurrence) && isset($event_detail->date['start']) ? $event_detail->date['start'] : array( 'date' => $occurrence ); + $occurrence_end_date = trim($occurrence) ? Base::get_main()->get_end_date_by_occurrence($event_detail->data->ID, $start_datetime['date']) : ''; + $end_datetime = isset($event_detail->date['end']) ? $event_detail->date['end'] : array( 'date' => $occurrence_end_date ); + + $date_format = isset($settings['single_date_format1']) ? $settings['single_date_format1'] : get_option( 'date_format' ); + $date_label = Base::get_main()->date_label( $start_datetime, $end_datetime, $date_format ); + + $html = ''; + $midnight_event = Base::get_main()->is_midnight_event($event_detail); + ob_start(); + ?> +
    +
    + icons->display('calendar'); + } ?> + +

    + +
    + +
    dateify( $event_detail, $date_format ); ?>
    + +
    array( 'class' => array(), 'itemprop' => array() ) ) ); ?>
    + +
    + holding_status( $event_detail ); ?> +
    +
    + get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $settings = $this->settings; + $event_detail = $this->get_event_detail($event_id); + + $html = ''; + if ( true === $this->is_editor_mode && ( !isset($settings['export_module_status']) || !$settings['export_module_status'] ) ) { + + $html = '

    ' + .''. esc_html__('This widget is displayed if export module is set. In order for the widget in this page to be displayed correctly, please set export module for your last event.', 'modern-events-calendar-lite').'' + . '' . esc_html__('How to set export module', 'modern-events-calendar-lite') . ' ' + .'

    '; + } else { + + ob_start(); + echo Base::get_main()->module('export.details', array('event'=>$event_detail)); + $html = ob_get_clean(); + } + + return $html; + } +} diff --git a/app/core/src/SingleBuilder/Widgets/EventGallery/EventGallery.php b/app/core/src/SingleBuilder/Widgets/EventGallery/EventGallery.php new file mode 100755 index 0000000..cc848fe --- /dev/null +++ b/app/core/src/SingleBuilder/Widgets/EventGallery/EventGallery.php @@ -0,0 +1,95 @@ +settings['event_gallery_status']) and $this->settings['event_gallery_status'] ) ) { + + return ''; + } + + $gallery = get_post_meta( $event_id, 'mec_event_gallery', true ); + if( !is_array( $gallery ) ) { + + $gallery = []; + } + + // Gallery + if( count( $gallery ) ) { + // Featured Image + $featured_image_id = get_post_thumbnail_id( $event_id ); + + // Add Featured Image to Gallery + if($featured_image_id and !in_array( $featured_image_id, $gallery ) ) { + + array_unshift( $gallery, $featured_image_id ); + } + + // First Image + $first_image_id = $gallery[0]; + + $gallery_list = ''; + + $first_attachment_title = get_the_title( $first_image_id ); + + return ''; + } + + return ''; + } + + /** + * Get HTML Output + * + * @param int $event_id + * @param array $atts + * @return string + */ + public function output( $event_id = 0, $atts = array() ){ + + if( !$event_id ){ + + $event_id = $this->get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $html = ''; + $settings = $this->settings; + + $event_gallery_module = isset($this->settings['event_gallery_status']) and $this->settings['event_gallery_status'] ? true : false; + if( $event_gallery_module ) { + + $html = $this->display_gallery( $event_id ); + } + + if ( ( true === $this->is_editor_mode || ( $atts['edit_mode'] ?? false ) ) && empty( $html ) ) { + + $html = '

    ' + .''. esc_html__('This widget is displayed if event gallery is set. In order for the widget in this page to be displayed correctly, please set Event Gallery module for your last event.', 'modern-events-calendar-lite').'' + . '' . esc_html__('How to set Event Gallery module', 'modern-events-calendar-lite') . ' ' + .'

    '; + } + + return $html; + } +} diff --git a/app/core/src/SingleBuilder/Widgets/EventGoogleMap/EventGoogleMap.php b/app/core/src/SingleBuilder/Widgets/EventGoogleMap/EventGoogleMap.php new file mode 100755 index 0000000..6ab6e3f --- /dev/null +++ b/app/core/src/SingleBuilder/Widgets/EventGoogleMap/EventGoogleMap.php @@ -0,0 +1,62 @@ +get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $settings = $this->settings; + $event_detail = $this->get_event_detail($event_id); + $primary_location_id = isset($event_detail->data->meta['mec_location_id']) ? $event_detail->data->meta['mec_location_id'] : ''; + $have_location = $primary_location_id && $primary_location_id > 1 ? true : false; + + $html = ''; + if( isset($settings['google_maps_status']) && $settings['google_maps_status'] && $have_location ){ + + $html = Base::get_main()->module('googlemap.details', array('event' => [$event_detail])); + if( $html ){ + + $html = '
    ' + . $html . + '
    '; + } + } + + if ( true === $this->is_editor_mode && ( !isset($settings['google_maps_status']) || !$settings['google_maps_status'] ) ) { + + $html = '

    ' + .''. esc_html__('This option is disabled. In order for the widget in this page to be displayed correctly, please turn on Google Maps Options and set the API for it there.', 'modern-events-calendar-lite').'' + . '' . esc_html__('How to set Google Map', 'modern-events-calendar-lite') . ' ' + .'

    '; + } elseif ( true === $this->is_editor_mode && empty( $html ) ){ + + $html = '

    ' + .''. esc_html__('This widget is displayed if Google Map is set. In order for the widget in this page to be displayed correctly, please set Google Map for your last event.', 'modern-events-calendar-lite').'' + . '' . esc_html__('How to set Google Map', 'modern-events-calendar-lite') . ' ' + .'

    '; + } + + return $html; + } +} diff --git a/app/core/src/SingleBuilder/Widgets/EventHourlySchedule/EventHourlySchedule.php b/app/core/src/SingleBuilder/Widgets/EventHourlySchedule/EventHourlySchedule.php new file mode 100755 index 0000000..2863494 --- /dev/null +++ b/app/core/src/SingleBuilder/Widgets/EventHourlySchedule/EventHourlySchedule.php @@ -0,0 +1,50 @@ +get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $settings = $this->settings; + $event_detail = $this->get_event_detail($event_id); + $hourly_schedules = isset($event_detail->data->hourly_schedules) && is_array($event_detail->data->hourly_schedules) ? $event_detail->data->hourly_schedules : []; + + $html = ''; + if ( true === $this->is_editor_mode && 0 == count($hourly_schedules) ) { + + $html = '

    ' + .''. esc_html__('This widget is displayed if Hourly Schedule is set. In order for the widget in this page to be displayed correctly, please set Hourly Schedule for your last event.', 'modern-events-calendar-lite').'' + . '' . esc_html__('How to set Hourly Schedule', 'modern-events-calendar-lite') . ' ' + .'

    '; + } else { + + $single = new \MEC_skin_single(); + ob_start(); + $single->display_hourly_schedules_widget( $event_detail ); + $html = ob_get_clean(); + } + + return $html; + } +} diff --git a/app/core/src/SingleBuilder/Widgets/EventLabels/EventLabels.php b/app/core/src/SingleBuilder/Widgets/EventLabels/EventLabels.php new file mode 100755 index 0000000..2dcb0a8 --- /dev/null +++ b/app/core/src/SingleBuilder/Widgets/EventLabels/EventLabels.php @@ -0,0 +1,65 @@ +get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $settings = $this->settings; + $event_detail = $this->get_event_detail($event_id); + $labels = isset($event_detail->data->labels) ? $event_detail->data->labels : []; + + $html = ''; + ob_start(); + if ( empty($labels) && true === $this->is_editor_mode ) { + + echo '

    ' + .''. esc_html__('This widget is displayed if label is set. In order for the widget in this page to be displayed correctly, please set label for your last event.', 'modern-events-calendar-lite').'' + . '' . esc_html__('How to set label', 'modern-events-calendar-lite') . ' ' + .'

    '; + } elseif ( !empty($labels) ) { + + echo '
    '; + $mec_items = count($labels); + $mec_i = 0; ?> +
    + + + + +

    m('taxonomy_labels', esc_html__('Labels', 'modern-events-calendar-lite')); ?>

    + + $label) : + $seperator = (++$mec_i === $mec_items) ? '' : ','; + echo '
    ' . esc_html($label["name"] . $seperator) . '
    '; + endforeach; ?> +
    + '; + } + $html = ob_get_clean(); + + return $html; + } +} diff --git a/app/core/src/SingleBuilder/Widgets/EventLocalTime/EventLocalTime.php b/app/core/src/SingleBuilder/Widgets/EventLocalTime/EventLocalTime.php new file mode 100755 index 0000000..60ee147 --- /dev/null +++ b/app/core/src/SingleBuilder/Widgets/EventLocalTime/EventLocalTime.php @@ -0,0 +1,48 @@ +get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $settings = $this->settings; + $event_detail = $this->get_event_detail($event_id); + + $html = ''; + if ( true === $this->is_editor_mode && ( !isset($settings['local_time_module_status']) || !$settings['local_time_module_status'] ) ) { + + $html = '

    ' + .''. esc_html__('This widget is displayed if label is set. In order for the widget in this page to be displayed correctly, please set LocalTime module for your last event.', 'modern-events-calendar-lite').'' + . '' . esc_html__('How to set LocalTime module', 'modern-events-calendar-lite') . ' ' + .'

    '; + } else { + + $html = '
    ' + .Base::get_main()->module('local-time.details', array('event'=>$event_detail)) . + '
    '; + } + + return $html; + } +} diff --git a/app/core/src/SingleBuilder/Widgets/EventLocations/EventLocations.php b/app/core/src/SingleBuilder/Widgets/EventLocations/EventLocations.php new file mode 100755 index 0000000..976068e --- /dev/null +++ b/app/core/src/SingleBuilder/Widgets/EventLocations/EventLocations.php @@ -0,0 +1,108 @@ +get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $settings = $this->settings; + $event_detail = $this->get_event_detail($event_id); + $locations = isset($event_detail->data->locations) ? $event_detail->data->locations : []; + $primary_location_id = \MEC\Base::get_main()->get_master_location_id( $event_detail ); + $location_term = get_term_by( 'id', $primary_location_id, 'mec_location' ); + + $html = ''; + if ( true === $this->is_editor_mode && ( empty($locations) || !isset($locations[$primary_location_id]) ) ) { + + $html = '

    ' + .''. esc_html__('This widget is displayed if location is set. In order for the widget in this page to be displayed correctly, please set location for your last event.', 'modern-events-calendar-lite').'' + . '' . esc_html__('How to set location', 'modern-events-calendar-lite') . ' ' + .'

    '; + } elseif ( !empty($locations) && isset($locations[$primary_location_id]) and !empty($locations[$primary_location_id])) { + + $single = new \MEC_skin_single(); + ob_start(); + $location = $locations[$primary_location_id]; + + echo '
    '; + ?> +
    + icons->display('location-pin'); ?> +

    m('taxonomy_location', esc_html__('Location', 'modern-events-calendar-lite')); ?>

    + + + <?php echo (isset($location['name']) ? esc_attr($location['name']) : ''); ?> + +
    get_location_html($location)); ?>
    + +
    +
    +
    + + +
    + +
    + +
    + +
    +

    description ); ?>

    +
    + +
    + show_other_locations($event_detail); // Show Additional Locations + echo '
    '; + + $html = ob_get_clean(); + } + + return $html; + } + + public function get_location_html($location) + { + $location_id = (isset($location['id']) ? $location['id'] : ''); + $location_name = (isset($location['name']) ? $location['name'] : ''); + + + if(is_plugin_active('mec-advanced-location/mec-advanced-location.php') && ( $this->settings['advanced_location']['location_enable_link_section_title'] ?? false )){ + $location_link = apply_filters('mec_location_single_page_link', '', $location_id, $location_name, $location); + }else{ +// $location_link = (isset($location['url']) ? $location['url'] : ''); + return $location_name; + } + + if(!empty($location_link)) $location_html =''.esc_html($location_name).''; + else $location_html = $location_name; + + return $location_html; + } +} diff --git a/app/core/src/SingleBuilder/Widgets/EventMoreInfo/EventMoreInfo.php b/app/core/src/SingleBuilder/Widgets/EventMoreInfo/EventMoreInfo.php new file mode 100755 index 0000000..9f7d339 --- /dev/null +++ b/app/core/src/SingleBuilder/Widgets/EventMoreInfo/EventMoreInfo.php @@ -0,0 +1,74 @@ +get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $settings = $this->settings; + $event_detail = $this->get_event_detail($event_id); + $start_timestamp = $event_detail->date['start']['timestamp'] ?? ''; + $data = (isset($event_detail->data->meta['mec_fields']) and is_array($event_detail->data->meta['mec_fields'])) ? $event_detail->data->meta['mec_fields'] : get_post_meta($event_detail->ID, 'mec_fields', true); + + $more_info = $event_detail->data->meta['mec_more_info'] ?? ''; + $more_info_title = $event_detail->data->meta['mec_more_info_title'] ?? esc_html__('Read More', 'modern-events-calendar-lite'); + $more_info_target = $event_detail->data->meta['mec_more_info_target'] ?? '_self'; + + $html = ''; + if ( true === $this->is_editor_mode && ( !( $more_info != '' ) ) ) { + + $html = '

    ' + .''. esc_html__('This widget is displayed if read more is set. In order for the widget in this page to be displayed correctly, please set read more for your last event.', 'modern-events-calendar-lite').'' + . '' . esc_html__('How to set read more', 'modern-events-calendar-lite') . ' ' + .'

    '; + } else { + + $more_info = MEC_feature_occurrences::param($event_id, $start_timestamp, 'more_info', $more_info); + $more_info_title = MEC_feature_occurrences::param($event_id, $start_timestamp, 'more_info_title', $more_info_title); + $more_info_target = MEC_feature_occurrences::param($event_id, $start_timestamp, 'more_info_target', $more_info_target); + + ob_start(); + if ( trim($more_info) && $more_info != 'http://') { + ?> + +
    +
    + icons->display('info'); + } ?> + +

    m('more_info_link', esc_html__('More Info', 'modern-events-calendar-lite')); ?>

    + +
    +
    +
    + get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $settings = $this->settings; + $event_detail = $this->get_event_detail($event_id); + + $html = ''; + if ( true === $this->is_editor_mode && ( !isset($settings['next_event_module_status']) || !$settings['next_event_module_status'] ) ) { + + $html = '

    ' + .''. esc_html__('This widget is displayed if next events module is set. In order for the widget in this page to be displayed correctly, please set next events module for your last event.', 'modern-events-calendar-lite').'' + . '' . esc_html__('How to set next events module', 'modern-events-calendar-lite') . ' ' + .'

    '; + } else { + + ob_start(); + echo Base::get_main()->module('next-event.details', array('event'=>$event_detail)); + $html = ob_get_clean(); + } + + return $html; + } +} diff --git a/app/core/src/SingleBuilder/Widgets/EventNextPrevious/EventNextPrevious.php b/app/core/src/SingleBuilder/Widgets/EventNextPrevious/EventNextPrevious.php new file mode 100755 index 0000000..f466334 --- /dev/null +++ b/app/core/src/SingleBuilder/Widgets/EventNextPrevious/EventNextPrevious.php @@ -0,0 +1,49 @@ +get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $settings = $this->settings; + $event_detail = $this->get_event_detail($event_id); + + $html = ''; + if ( true === $this->is_editor_mode && ( !isset($settings['next_previous_events']) || !$settings['next_previous_events'] ) ) { + + $html = '

    ' + .''. esc_html__('This widget is displayed if related events is set. In order for the widget in this page to be displayed correctly, please set Related Event for your last event.', 'modern-events-calendar-lite').'' + . '' . esc_html__('How to set Next/Previous Events', 'modern-events-calendar-lite') . ' ' + .'

    '; + } else { + + $single = new \MEC_skin_single(); + ob_start(); + $single->display_next_previous_events($event_detail); + $html = ob_get_clean(); + } + + return $html; + } +} diff --git a/app/core/src/SingleBuilder/Widgets/EventOrganizers/EventOrganizers.php b/app/core/src/SingleBuilder/Widgets/EventOrganizers/EventOrganizers.php new file mode 100755 index 0000000..9d715b5 --- /dev/null +++ b/app/core/src/SingleBuilder/Widgets/EventOrganizers/EventOrganizers.php @@ -0,0 +1,151 @@ +get_settings('addintional_organizers_social_links'); + if( !$status ){ + + return; + } + + if( is_numeric( $organizer ) ){ + + $organizer = get_term_by( 'id', $organizer, 'mec_organizer' ); + } + + $organizer_id = $organizer->term_id; + ?> +
    + + + + + + + + + + + + + + + + +
    + get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $settings = $this->settings; + $event_detail = $this->get_event_detail($event_id); + $single = new \MEC_skin_single(); + $organizers = isset($event_detail->data->organizers) ? $event_detail->data->organizers : []; + $primary_organizer_id = \MEC\Base::get_main()->get_master_organizer_id( $event_detail ); + + $html = ''; + if ( true === $this->is_editor_mode && ( empty($organizers) || !isset($organizers[$primary_organizer_id]) ) ) { + + $html = '

    ' + .''. esc_html__('This widget is displayed if organizer is set. In order for the widget in this page to be displayed correctly, please set organizer for your last event.', 'modern-events-calendar-lite').'' + . '' . esc_html__('How to set organizer', 'modern-events-calendar-lite') . ' ' + .'

    '; + } elseif ( !empty($organizers) && isset($organizers[$primary_organizer_id]) && !empty($organizers[$primary_organizer_id])) { + + ob_start(); + $organizer = $organizers[$primary_organizer_id]; + + echo '
    '; + ?> +
    + +

    m('taxonomy_organizer', esc_html__('Organizer', 'modern-events-calendar-lite')); ?>

    + + + <?php echo (isset($organizer['name']) ? esc_attr($organizer['name']) : ''); ?> + + +
    + + + +
    +
    + + +
    + +
    + +
    + +
    + +
    + +
    + +
    + +
    + +
    + +
    + +
    + data, 'mec_organizer'); if($organizer_description_setting == '1'): foreach($organizer_terms as $organizer_term) { if ($organizer_term->term_id == $organizer['id'] ) { if(isset($organizer_term->description) && !empty($organizer_term->description)): ?> +
    +

    description );?>

    +
    + + + +
    + show_other_organizers($event_detail); // Show Additional Organizers + echo '
    '; + $html = ob_get_clean(); + } + + return $html; + } +} diff --git a/app/core/src/SingleBuilder/Widgets/EventPublicDownload/EventPublicDownload.php b/app/core/src/SingleBuilder/Widgets/EventPublicDownload/EventPublicDownload.php new file mode 100755 index 0000000..3f42315 --- /dev/null +++ b/app/core/src/SingleBuilder/Widgets/EventPublicDownload/EventPublicDownload.php @@ -0,0 +1,46 @@ +get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $settings = $this->settings; + $events_detail = $this->get_event_detail($event_id); + + $single = new \MEC_skin_single(); + $html = $single->display_public_download_module( $events_detail ); + + if ( empty( $html ) && $this->is_editor_mode() ) { + + $html = '

    ' + .''. esc_html__('This widget is displayed if event Public Download is set. In order for the widget in this page to be displayed correctly, please set Public Download for your last event.', 'modern-events-calendar-lite').'' + . '' . esc_html__('How to set Public Download', 'modern-events-calendar-lite') . ' ' + .'

    '; + + } + + return $html; + } +} diff --git a/app/core/src/SingleBuilder/Widgets/EventQrCode/EventQrCode.php b/app/core/src/SingleBuilder/Widgets/EventQrCode/EventQrCode.php new file mode 100755 index 0000000..b26347a --- /dev/null +++ b/app/core/src/SingleBuilder/Widgets/EventQrCode/EventQrCode.php @@ -0,0 +1,48 @@ +get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $settings = $this->settings; + $event_detail = $this->get_event_detail($event_id); + + $html = ''; + if ( true === $this->is_editor_mode && ( !isset($settings['qrcode_module_status']) || !$settings['qrcode_module_status'] ) ) { + + $html = '

    ' + .''. esc_html__('This widget is displayed if QR Code is set. In order for the widget in this page to be displayed correctly, please set QR code module for your last event.', 'modern-events-calendar-lite').'' + . '' . esc_html__('How to set QR code module', 'modern-events-calendar-lite') . ' ' + .'

    '; + } else { + + ob_start(); + echo Base::get_main()->module('qrcode.details', array('event' => $event_detail)); + $html = ob_get_clean(); + } + + return $html; + } +} diff --git a/app/core/src/SingleBuilder/Widgets/EventRegisterButton/EventRegisterButton.php b/app/core/src/SingleBuilder/Widgets/EventRegisterButton/EventRegisterButton.php new file mode 100755 index 0000000..5d77279 --- /dev/null +++ b/app/core/src/SingleBuilder/Widgets/EventRegisterButton/EventRegisterButton.php @@ -0,0 +1,98 @@ +get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $settings = $this->settings; + $event_detail = $this->get_event_detail($event_id); + + $html = ''; + if ( true === $this->is_editor_mode && ( !isset($settings['single_booking_style']) || !$settings['single_booking_style'] ) ) { + + $html = '

    ' + .''. esc_html__('This widget is displayed if register button is set. In order for the widget in this page to be displayed correctly, please set register button for your last event.', 'modern-events-calendar-lite').'' + . '' . esc_html__('How to set register button', 'modern-events-calendar-lite') . ' ' + .'

    '; + } else { + + $single = new \MEC_skin_single(); + + $mec_more_info = isset($event_detail->data->meta['mec_more_info']) && trim($event_detail->data->meta['mec_more_info']) && $event_detail->data->meta['mec_more_info'] != 'http://'; + $mec_more_info_target = isset($event_detail->data->meta['mec_more_info_target']) ? $event_detail->data->meta['mec_more_info_target'] : '_self'; + if (isset($event_detail->data->meta['mec_more_info_title']) && trim($event_detail->data->meta['mec_more_info_title'])){ + $button_text = trim($event_detail->data->meta['mec_more_info_title']); + }else{ + $button_text = Base::get_main()->m('register_button', esc_html__('REGISTER', 'modern-events-calendar-lite')); + } + + $classes = ''; + if (isset($settings['single_booking_style']) && $settings['single_booking_style'] != 'modal'){ + $classes = 'simple-booking'; + } + ob_start(); + ?> + + can_show_booking_module($event_detail)) : ?> +
    + + > + +
    + +
    + + + +
    + + get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $settings = $this->settings; + $event_detail = $this->get_event_detail($event_id); + + $html = ''; + if ( true === $this->is_editor_mode && ( !isset($settings['related_events']) || !$settings['related_events'] ) ) { + + $html = '

    ' + .''. esc_html__('This widget is displayed if related events is set. In order for the widget in this page to be displayed correctly, please set Related Event for your last event.', 'modern-events-calendar-lite').'' + . '' . esc_html__('How to set related events', 'modern-events-calendar-lite') . ' ' + .'

    '; + } else { + + $single = new \MEC_skin_single(); + ob_start(); + $single->display_related_posts_widget( $event_id, 'thumbrelated' ); + $html = ob_get_clean(); + } + + return $html; + } +} diff --git a/app/core/src/SingleBuilder/Widgets/EventSocialShare/EventSocialShare.php b/app/core/src/SingleBuilder/Widgets/EventSocialShare/EventSocialShare.php new file mode 100755 index 0000000..ccdcfd1 --- /dev/null +++ b/app/core/src/SingleBuilder/Widgets/EventSocialShare/EventSocialShare.php @@ -0,0 +1,79 @@ +get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $settings = $this->settings; + $event_detail = $this->get_event_detail($event_id); + $data = (isset($event_detail->data->meta['mec_fields']) and is_array($event_detail->data->meta['mec_fields'])) ? $event_detail->data->meta['mec_fields'] : get_post_meta($event_detail->ID, 'mec_fields', true); + + $html = ''; + if ( true === $this->is_editor_mode && ( !isset($settings['social_network_status']) || !$settings['social_network_status'] ) ) { + + $html = '

    ' + .''. esc_html__('This widget is displayed if social networks is set. In order for the widget in this page to be displayed correctly, please set label for your last event.', 'modern-events-calendar-lite').'' + . '' . esc_html__('How to set social networks', 'modern-events-calendar-lite') . ' ' + .'

    '; + } else { + + $single = new \MEC_skin_single(); + ob_start(); + $url = isset($event_detail->data->permalink) ? $event_detail->data->permalink : ''; + if (trim($url) == '') { + return; + } + $socials = Base::get_main()->get_social_networks(); + ?> +
    + +
    + +
    +
    + get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $settings = $this->settings; + $event_detail = $this->get_event_detail($event_id); + $speakers = (isset($event_detail->data->speakers) and is_array($event_detail->data->speakers)) ? $event_detail->data->speakers : []; + + $html = ''; + if ( true === $this->is_editor_mode && ( empty($speakers) || (!isset($settings['speakers_status']) || !$settings['speakers_status']) ) ) { + + $html = '

    ' + .''. esc_html__('This widget is displayed if speaker is set. In order for the widget in this page to be displayed correctly, please set speaker for your last event.', 'modern-events-calendar-lite').'' + . '' . esc_html__('How to set speaker', 'modern-events-calendar-lite') . ' ' + .'

    '; + } elseif ( true === $this->is_editor_mode && isset($settings['speakers_status']) && $settings['speakers_status'] ) { + + $html = Base::get_main()->module('speakers.details', array('event'=>$event_detail)); + } else { + + ob_start(); + // Event Speaker + echo Base::get_main()->module('speakers.details', array('event'=>$event_detail)); + ?> + + get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $settings = $this->settings; + $event_detail = $this->get_event_detail($event_id); + $sponsors = (isset($event_detail->data->sponsors) and is_array($event_detail->data->sponsors)) ? $event_detail->data->sponsors : []; + + $html = ''; + if ( true === $this->is_editor_mode && ( empty($sponsors) || (!isset($settings['sponsors_status']) || !$settings['sponsors_status']) ) ) { + + $html = '

    ' + .''. esc_html__('This widget is displayed if sponsor is set. In order for the widget in this page to be displayed correctly, please set sponsor for your last event.', 'modern-events-calendar-lite').'' + . '' . esc_html__('How to set sponsor', 'modern-events-calendar-lite') . ' ' + .'

    '; + } elseif ( true === $this->is_editor_mode && isset($settings['sponsors_status']) && $settings['sponsors_status'] ) { + + $html = Base::get_main()->module('sponsors.details', array('event'=>$event_detail)); + } else { + + ob_start(); + // Event Sponsor + echo Base::get_main()->module('sponsors.details', array('event'=>$event_detail)); + $html = ob_get_clean(); + } + + return $html; + } +} diff --git a/app/core/src/SingleBuilder/Widgets/EventTags/EventTags.php b/app/core/src/SingleBuilder/Widgets/EventTags/EventTags.php new file mode 100755 index 0000000..fe60395 --- /dev/null +++ b/app/core/src/SingleBuilder/Widgets/EventTags/EventTags.php @@ -0,0 +1,65 @@ +get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $settings = $this->settings; + $event_detail = $this->get_event_detail($event_id); + $data = (isset($event_detail->data->meta['mec_fields']) and is_array($event_detail->data->meta['mec_fields'])) ? $event_detail->data->meta['mec_fields'] : get_post_meta($event_detail->ID, 'mec_fields', true); + + $tags = get_the_tags( $event_id ); + + $html = ''; + if ( true === $this->is_editor_mode && empty( $tags ) ) { + + $html = '

    ' + .''. esc_html__('This widget is displayed if tags is set. In order for the widget in this page to be displayed correctly, please set tags for your last event.', 'modern-events-calendar-lite').'' + . '' . esc_html__('How to set tags', 'modern-events-calendar-lite') . ' ' + .'

    '; + } else { + + ob_start(); + echo '
    '; + if( isset( $atts['mec_tags_show_title'] ) && $atts['mec_tags_show_title'] ){ + echo '' . esc_html__( 'Tags: ', 'modern-events-calendar-lite') . ''; + } + if ( $tags ) { + echo implode( + ', ', + array_map( + function($tag) { + return '' . esc_html($tag->name) . ' '; + }, $tags + ) + ); + } + echo '
    '; + $html = ob_get_clean(); + } + + return $html; + } +} diff --git a/app/core/src/SingleBuilder/Widgets/EventTime/EventTime.php b/app/core/src/SingleBuilder/Widgets/EventTime/EventTime.php new file mode 100755 index 0000000..b797095 --- /dev/null +++ b/app/core/src/SingleBuilder/Widgets/EventTime/EventTime.php @@ -0,0 +1,67 @@ +get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $settings = $this->settings; + $event_detail = $this->get_event_detail($event_id); + + ob_start(); + echo '
    '; + echo ''; + // Event Time + if (isset($event_detail->data->meta['mec_date']['start']) and !empty($event_detail->data->meta['mec_date']['start'])) { + if (isset($event_detail->data->meta['mec_hide_time']) and $event_detail->data->meta['mec_hide_time'] == '0') { + $time_comment = isset($event_detail->data->meta['mec_comment']) ? $event_detail->data->meta['mec_comment'] : ''; + $allday = isset($event_detail->data->meta['mec_allday']) ? $event_detail->data->meta['mec_allday'] : 0; + ?> +
    + + icons->display('clock'); ?> + + +

    + + +
    + data->time) and trim($event_detail->data->time['start'])) : ?> + +
    data->time['start'] ); ?>data->time['end']) ? esc_html( ' - ' . $event_detail->data->time['end'] ) : ''); ?>
    + +
    m('all_day', esc_html__('All Day' , 'modern-events-calendar-lite')) ); ?>
    + +
    +
    + '; + $html = ob_get_clean(); + + return $html; + } +} diff --git a/app/core/src/SingleBuilder/Widgets/EventTrailerUrl/EventTrailerUrl.php b/app/core/src/SingleBuilder/Widgets/EventTrailerUrl/EventTrailerUrl.php new file mode 100755 index 0000000..a0a90c3 --- /dev/null +++ b/app/core/src/SingleBuilder/Widgets/EventTrailerUrl/EventTrailerUrl.php @@ -0,0 +1,37 @@ +get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $single = new \MEC_skin_single(); + $event_detail = $this->get_event_detail($event_id); + + $html = '
    ' + . $single->display_trailer_url( $event_detail ) . + '
    '; + + return $html; + } +} diff --git a/app/core/src/SingleBuilder/Widgets/EventVirtual/EventVirtual.php b/app/core/src/SingleBuilder/Widgets/EventVirtual/EventVirtual.php new file mode 100755 index 0000000..01eec0b --- /dev/null +++ b/app/core/src/SingleBuilder/Widgets/EventVirtual/EventVirtual.php @@ -0,0 +1,54 @@ +get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $settings = $this->settings; + $events_detail = $this->get_event_detail($event_id); + + $html = ''; + if ( true === $this->is_editor_mode && isset( $events_detail->data->meta['mec_virtual_event'] ) && 'none' === $events_detail->data->meta['mec_virtual_event'] ) { + + $html = '

    ' + .''. esc_html__('Please make sure the last event has appropriate content for this widget.', 'modern-events-calendar-lite').'' + . '' . esc_html__('How to set up Zoom event', 'modern-events-calendar-lite') . ' ' + .'

    '; + } else { + + ob_start(); + if ( isset( $atts['virtual_event_type'] ) && $atts['virtual_event_type'] == 'badge' ) { + + do_action('mec_single_virtual_badge', $events_detail->data ); + } else { + + do_action('mec_single_after_content', $events_detail ); + } + $html = ob_get_clean(); + } + + return $html; + } +} diff --git a/app/core/src/SingleBuilder/Widgets/EventWeather/EventWeather.php b/app/core/src/SingleBuilder/Widgets/EventWeather/EventWeather.php new file mode 100755 index 0000000..e542416 --- /dev/null +++ b/app/core/src/SingleBuilder/Widgets/EventWeather/EventWeather.php @@ -0,0 +1,50 @@ +get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $settings = $this->settings; + $event_detail = $this->get_event_detail($event_id); + + $html = ''; + if( isset($settings['weather_module_status']) && $settings['weather_module_status'] ){ + + ob_start(); + echo Base::get_main()->module('weather.details', array('event' => $event_detail)); + $html = ob_get_clean(); + } + + if ( true === $this->is_editor_mode && empty( $html ) ) { + + $html = '

    ' + .''. esc_html__('This widget is displayed if weather is set. In order for the widget in this page to be displayed correctly, please set location for your last event.', 'modern-events-calendar-lite').'' + . '' . esc_html__('How to set weather', 'modern-events-calendar-lite') . ' ' + .'

    '; + } + + return $html; + } +} diff --git a/app/core/src/SingleBuilder/Widgets/EventZoom/EventZoom.php b/app/core/src/SingleBuilder/Widgets/EventZoom/EventZoom.php new file mode 100755 index 0000000..f5b6815 --- /dev/null +++ b/app/core/src/SingleBuilder/Widgets/EventZoom/EventZoom.php @@ -0,0 +1,54 @@ +get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $settings = $this->settings; + $events_detail = $this->get_event_detail($event_id); + + $html = ''; + if ( true === $this->is_editor_mode && isset( $events_detail->data->meta['mec_zoom_event'] ) && 'none' === $events_detail->data->meta['mec_zoom_event'] ) { + + $html = '

    ' + .''. esc_html__('Please make sure the last event has appropriate content for this widget.', 'modern-events-calendar-lite').'' + . '' . esc_html__('How to set up Zoom event', 'modern-events-calendar-lite') . ' ' + .'

    '; + } else { + + ob_start(); + if ( isset( $atts['zoom_event_type'] ) && $atts['zoom_event_type'] == 'badge' ) { + + do_action('mec_single_zoom_badge', $events_detail->data ); + } else { + + do_action('mec_single_after_content', $events_detail ); + } + $html = ob_get_clean(); + } + + return $html; + } +} diff --git a/app/core/src/SingleBuilder/Widgets/FAQ/FAQ.php b/app/core/src/SingleBuilder/Widgets/FAQ/FAQ.php new file mode 100755 index 0000000..ff0a05f --- /dev/null +++ b/app/core/src/SingleBuilder/Widgets/FAQ/FAQ.php @@ -0,0 +1,42 @@ +get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $single = new \MEC_skin_single(); + $event_detail = $this->get_event_detail($event_id); + + ob_start(); + $single->display_faq( $event_detail ); + $faq_html = ob_get_clean(); + + + $html = '
    ' + . $faq_html . + '
    '; + + return $html; + } +} diff --git a/app/core/src/SingleBuilder/Widgets/FeaturedImage/FeaturedImage.php b/app/core/src/SingleBuilder/Widgets/FeaturedImage/FeaturedImage.php new file mode 100755 index 0000000..fe6b4a5 --- /dev/null +++ b/app/core/src/SingleBuilder/Widgets/FeaturedImage/FeaturedImage.php @@ -0,0 +1,58 @@ +get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $settings = $this->settings; + $atts = shortcode_atts( [ + 'image_width' => 500, + 'image_height' => 500, + ], + $atts + ); + + $html = $this->get_thumbnail($event_id,$atts['image_width'],$atts['image_height']); + + if ( true === $this->is_editor_mode && empty($html) ) { + + $width = $atts['image_width'] ? $atts['image_width'] : ''; + $height = $atts['image_height'] ? $atts['image_height'] : ''; + $html = ' '; + } + + return $html; + } +} diff --git a/app/core/src/SingleBuilder/Widgets/FeaturedImage/empty-pic.jpg b/app/core/src/SingleBuilder/Widgets/FeaturedImage/empty-pic.jpg new file mode 100755 index 0000000..bec115d Binary files /dev/null and b/app/core/src/SingleBuilder/Widgets/FeaturedImage/empty-pic.jpg differ diff --git a/app/core/src/SingleBuilder/Widgets/RSVPForm/RSVPForm.php b/app/core/src/SingleBuilder/Widgets/RSVPForm/RSVPForm.php new file mode 100755 index 0000000..8e927bf --- /dev/null +++ b/app/core/src/SingleBuilder/Widgets/RSVPForm/RSVPForm.php @@ -0,0 +1,69 @@ +get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $is_rsvp_enabled = false; + + if(!function_exists('is_plugin_active')) { + + include_once(ABSPATH . 'wp-admin/includes/plugin.php'); + } + + if( is_plugin_active('mec-rsvp/mec-rsvp.php') ) { + + $is_rsvp_enabled = \MEC_RSVP\RSVP\EventRSVP::getInstance()->can_display_rsvp_form( $event_id ); + } + + $settings = $this->settings; + $html = ''; + + if ( true === $this->is_editor_mode && !$is_rsvp_enabled ) { + + $html = '
    +

    ' + .'' + . esc_html__('This widget is displayed if label is set. In order for the widget in this page to be displayed correctly, please set RSVP module for your last event.', 'modern-events-calendar-lite') + .'' + .'' . esc_html__('How to set RSVP module', 'modern-events-calendar-lite') . ' ' + .'

    ' + .'
    '; + } elseif( $is_rsvp_enabled ) { + + $html = $this->get_display_rsvp_form( $event_id ); + } + + return $html; + } +} diff --git a/app/core/src/SingleBuilder/Widgets/SimpleHeader/SimpleHeader.php b/app/core/src/SingleBuilder/Widgets/SimpleHeader/SimpleHeader.php new file mode 100755 index 0000000..aaa7716 --- /dev/null +++ b/app/core/src/SingleBuilder/Widgets/SimpleHeader/SimpleHeader.php @@ -0,0 +1,36 @@ +get_event_id(); + } + + if(!$event_id){ + return ''; + } + + $html = '<' . $html_tag . ' class="mec-single-title">' + .get_the_title($event_id). + ''; + + return $html; + } +} diff --git a/app/core/src/SingleBuilder/Widgets/WidgetBase.php b/app/core/src/SingleBuilder/Widgets/WidgetBase.php new file mode 100755 index 0000000..0d831f9 --- /dev/null +++ b/app/core/src/SingleBuilder/Widgets/WidgetBase.php @@ -0,0 +1,96 @@ +settings = $this->get_mec_settings(); + $this->is_editor_mode = $this->is_editor_mode(); + $main = MEC::getInstance('app.libraries.main'); + $settings_mec = $main->get_settings(); + $this->icons = $main->icons($settings_mec['icons'] ?? []); + } + + /** + * Is editor mode + * + * @return boolean + */ + public function is_editor_mode(){ + + return apply_filters( 'mec_single_builder_editor_mode', false ); + } + + /** + * @return WP_Post + */ + public function get_last_event(){ + + global $MEC_Last_Event; + if(!$MEC_Last_Event){ + + $EventQuery = new \MEC\Events\EventsQuery([]); + $MEC_Last_Event = $EventQuery->get_last_event('post'); + } + + return $MEC_Last_Event; + } + + /** + * Get Event ID + * + * @return int|false + */ + public function get_event_id(){ + + $editor_mode = $this->is_editor_mode(); + + $event_id = false; + if(is_single() && 'mec-events' === get_post_type()){ + + $event_id = get_the_ID(); + }elseif( $editor_mode ){ + + $last_event = $this->get_last_event(); + $event_id = isset($last_event['ID']) ? $last_event['ID'] : 0; + } + + return apply_filters( 'mec_get_event_id_for_widget', $event_id, $editor_mode ); + } + + /** + * @param int|WP_Post $event + * + * @return Object + */ + public function get_event_detail($event){ + + $event_id = is_a( $event, '\WP_Post' ) ? $event->ID : $event; + $single = new \MEC_skin_single(); + $events = $single->get_event_mec( $event_id ); + + if( !isset( $events[0] ) ){ + + $event = new \MEC\Events\Event($event); + return $event->get_detail(); + }else{ + + return $events[0]; + } + } + + public function get_mec_settings(){ + + return \MEC\Settings\Settings::getInstance()->get_settings(); + } +} diff --git a/app/core/src/SingleBuilder/index.php b/app/core/src/SingleBuilder/index.php new file mode 100755 index 0000000..40d16fd --- /dev/null +++ b/app/core/src/SingleBuilder/index.php @@ -0,0 +1,5 @@ +data = $data; + } + + /** + * @param string $key + * @param mixed $default + * @return mixed + */ + public function get_data($key,$default = null){ + + $v = isset($this->data[$key]) ? $this->data[$key] : $default; + + return apply_filters('mec_ticket_get_data',$v,$key,$this->data,$default); + } + + /** + * @param string $type start|end + * @return array + */ + private function _get_time($type){ + + return array( + 'h' => isset($this->data['ticket_'.$type.'_time_hour']) ? sprintf('%02d',$this->data['ticket_'.$type.'_time_hour']) : '', + 'm' => isset($this->data['ticket_'.$type.'_time_minute']) ? sprintf('%02d',$this->data['ticket_'.$type.'_time_minute']) : '', + 'ampm' => isset($this->data['ticket_'.$type.'_time_ampm']) ? $this->data['ticket_'.$type.'_time_ampm'] : '', + ); + } + + /** + * @param string $type all|start|end + * @param string $format + * @return string + */ + public function get_time($type = 'all',$format = 'H:i A'){ + + $start = $this->_get_time('start'); + $end = $this->_get_time('end'); + + $start_time = "{$start['h']}:{$start['m']} {$start['ampm']}"; + $end_time = "{$end['h']}:{$end['m']} {$end['ampm']}"; + + $start = date($format,strtotime($start_time)); + $end = date($format,strtotime($end_time)); + + switch($type){ + case 'start': + return $start_time; + break; + case 'end': + return $end_time; + break; + default: + return "$start_time $end_time"; + break; + } + } +} \ No newline at end of file diff --git a/app/core/src/Tickets/Tickets.php b/app/core/src/Tickets/Tickets.php new file mode 100755 index 0000000..47efe27 --- /dev/null +++ b/app/core/src/Tickets/Tickets.php @@ -0,0 +1,51 @@ + $ticket){ + + $tickets[$k] = new Ticket($ticket); + } + + return $tickets; + } + + /** + * @param int $event_id + * @param array $tickets //TODO: Ticket[] + * @return void + */ + public function update_event_tickets($event_id,$tickets){ + + update_post_meta($event_id, 'mec_tickets', $tickets); + } + + /** + * @param int $event_id + * @param int $ticket_id + * @return array|null //TODO: Ticket + */ + public function get_ticket($event_id,$ticket_id){ + + if(!$event_id){ + + return null; + } + + $tickets = $this->get_event_tickets($event_id); + + return isset($tickets[$ticket_id]) ? $tickets[$ticket_id] : null; + } +} \ No newline at end of file diff --git a/app/core/src/Tickets/index.php b/app/core/src/Tickets/index.php new file mode 100755 index 0000000..40d16fd --- /dev/null +++ b/app/core/src/Tickets/index.php @@ -0,0 +1,5 @@ +bookClass = new \MEC_book(); + $this->gateways = $this->get_gateways(); + $this->gateways_options = \MEC\Base::get_main()->get_gateways_options(); + + $this->transaction_id = $transaction_id ?: static::generate_transaction_id(); + + $this->ticket_variations_status = (bool)\MEC\Settings\Settings::getInstance()->get_settings('ticket_variations_status'); + $this->taxes_fees_status = (bool)\MEC\Settings\Settings::getInstance()->get_settings('taxes_fees_status'); + + if( !is_null( $data ) && is_array( $data ) ) { + + $this->set_data( $data ); + }else{ + + $this->set_data( + $this->get_saved_data() + ); + } + } + + public static function generate_transaction_id() { + + $method = \MEC\Settings\Settings::getInstance()->get_settings('booking_tid_gen_method'); + $method = !empty( $method ) ? $method : 'random'; + + $string = str_shuffle('ABCDEFGHJKLMNOPQRSTUVWXYZ'); + $prefix = substr($string, 0, 3); + + if($method === 'ordered') { + + $start = \MEC\Settings\Settings::getInstance()->get_settings('booking_tid_start_from'); + $start = ( !empty( $start ) && is_numeric( $start ) && $start >= 1 ) ? $start : 10000; + $existing = get_option('mec_tid_current', 1); + + $number = max($start, $existing)+1; + + $key = $prefix.$number; + update_option('mec_tid_current', $number); + } else { + + $key = $prefix.mt_rand(10000, 99999); + } + + // If the key exist then generate another key + if(get_option($key, false) !== false) $key = static::generate_transaction_id(); + + return $key; + } + + public function prepare_data( $data ) { + + $event_id = $data['event_id'] ?? $this->get_event_id(); + $book_id = $this->bookClass->get_book_id_transaction_id( $this->transaction_id ); + $gateway = $book_id ? get_post_meta( $book_id, 'mec_gateway', true ) : false; + $is_partial_payment = $book_id ? false : $this->bookClass->partial_payment->is_enabled(); + + return wp_parse_args( + $data, + array( + 'tickets' => array(), + 'first_for_all' => false, + 'event_id' => 0, + 'translated_event_id' => 0, + 'date' => '', + 'all_dates' => array(), + 'timestamps' => array(), + 'booking_id' => $book_id, + // 'price_details' => array(), + 'total' => 0, + 'discount' => 0, + 'price' => 0, + 'payable' => 0, + 'coupon' => '', + 'fields' => array(), + 'gateway' => $gateway ?: 'MEC_gateway_pay_locally', + + 'order_id' => '', + 'WCTax' => '', + 'wc_coupons' => array(), + 'wc_discounts' => array(), + + 'is_partial_payment' => $is_partial_payment ? 1 : 0, + 'partial_payment_settings' => $is_partial_payment ? $this->bookClass->partial_payment->get_validated_payable_options( $event_id ) : array(), + ) + ); + } + + /** + * Return saved data + * + * @return array + */ + private function get_saved_data() { + + $data = get_option( $this->transaction_id, array() ); + + return is_array( $data ) ? $data : []; + } + + /** + * Update saved data + * + * @param bool $reset_cache + * + * @return string + */ + public function update_data( $reset_cache = true ) { + + update_option( $this->transaction_id, $this->data, false ); + + if( $reset_cache ) { + + $this->update_cache_tickets_details(); + } + + return $this->transaction_id; + } + + /** + * Return data + * + * @return array + */ + public function get_data() { + + return $this->data; + } + + public function set_data( $data ) { + + $this->data = $this->prepare_data( $data ); + } + + public function get_ticket_variations_status() { + + if( 'MEC_gateway_woocommerce' == $this->get_gateway() ) { + + return false; + } + + return $this->ticket_variations_status; + } + + public function get_taxes_fees_status() { + + return $this->taxes_fees_status; + } + + public function get_event_tickets() { + + if( is_null( $this->event_tickets ) ) { + + $event_tickets = get_post_meta( $this->get_event_id(), 'mec_tickets', true ); + $this->event_tickets = is_array( $event_tickets ) ? $event_tickets : []; + } + + return $this->event_tickets; + } + + public function get_all_tickets_details( $return_cached = true ) { + + if( is_null( $this->tickets_details ) || !$return_cached ) { + + $this->tickets_details = $this->get_all_occurrences_tickets_details( $return_cached ); + } + + return $this->tickets_details; + } + + public function get_cached_tickets_details() { + + return get_option( $this->transaction_id . '_cached', false ); + } + + public function update_cache_tickets_details( $data = null ) { + + if( is_null( $data ) ) { + + $data = $this->get_all_tickets_details( false ); + } + + update_option( $this->transaction_id . '_cached', $data, false ); + } + + public function reset_cache_tickets_details() { + + $this->tickets_details = null; + + delete_option( $this->transaction_id . '_cached' ); + } + + public function _get_total() { + + return $this->data['total'] ?? ''; + } + + public function _get_payable() { + + return $this->data['payable'] ?? ''; + } + + public function get_event_id() { + + return $this->data['event_id'] ?? 0; + } + + public function is_first_for_all() { + + return (bool)( $this->data['first_for_all'] ?? 0 ); + } + + public function get_translated_event_id() { + + return $this->data['translated_event_id'] ?? 0; + } + + public function get_dates() { + + $all_dates = isset( $this->data['all_dates'] ) && is_array( $this->data['all_dates'] ) && !empty( $this->data['all_dates'] ) ? $this->data['all_dates'] : array( $this->data['date'] ?? '' ); + + foreach( $all_dates as $k => $timestamps ){ + + if( empty( $timestamps ) || is_array( $timestamps ) ) { + + unset( $all_dates[ $k ] ); + } + } + + return array_values( $all_dates ); + } + + public function get_date() { + + $all_dates = $this->get_dates(); + + return current( $all_dates ); + } + + public function get_invoice_key() { + + return $this->data['invoice_key'] ?? ''; + } + + public function get_book_id() { + + return $this->data['booking_id'] ?? $this->bookClass->get_book_id_transaction_id( $this->transaction_id ); + } + + public function get_author_id() { + + $book_id = $this->get_book_id(); + if( !$book_id ) { + + return get_current_user_id(); + } + + $book = get_post( $book_id ); + + return is_a( $book, '\WP_Post' ) ? $book->post_author : 0; + } + + public function get_gateway() { + + return $this->data['gateway'] ?? ''; + } + + public function get_gateways() { + + return array ( + 'MEC_gateway_pay_locally' => (object) array( + 'key' => 'MEC_gateway_pay_locally', + 'label' => __('Pay Locally', 'modern-events-calendar-lite'), + 'id' => 1, + ), + 'MEC_gateway_paypal_express' => (object) array( + 'key' => 'MEC_gateway_paypal_express', + 'label' => __('PayPal Express', 'modern-events-calendar-lite'), + 'id' => 2, + ), + 'MEC_gateway_woocommerce' => + (object) array( + 'key' => 'MEC_gateway_woocommerce', + 'label' => __('Pay by WooCommerce', 'modern-events-calendar-lite'), + 'id' => 6, + ), + 'MEC_gateway_paypal_credit_card' => (object) array( + 'key' => 'MEC_gateway_paypal_credit_card', + 'label' => __('PayPal Credit Card', 'modern-events-calendar-lite'), + 'id' => 3, + ), + 'MEC_gateway_stripe' => (object) array( + 'key' => 'MEC_gateway_stripe', + 'label' => __('Stripe', 'modern-events-calendar-lite'), + 'id' => 5, + ), + 'MEC_gateway_stripe_connect' => (object) array( + 'key' => 'MEC_gateway_stripe_connect', + 'label' => __('Stripe Connect', 'modern-events-calendar-lite'), + 'id' => 7, + ), + 'MEC_gateway_bank_transfer' => (object) array( + 'key' => 'MEC_gateway_bank_transfer', + 'label' => __('Bank Transfer', 'modern-events-calendar-lite'), + 'id' => 8, + ), + 'MEC_gateway_paypal_standard' => (object) array( + 'key' => 'MEC_gateway_paypal_standard', + 'label' => __('PayPal Standard', 'modern-events-calendar-lite'), + 'id' => 9, + ), + 'MEC_gateway_add_to_woocommerce_cart' => (object) array( + 'key' => 'MEC_gateway_add_to_woocommerce_cart', + 'label' => __('Add to cart', 'modern-events-calendar-lite'), + 'id' => 1995, + ), + ); + } + + public function get_gateway_number() { + + $gateway_number = ''; + $gateway = $this->get_gateway(); + $current_gateway = $this->gateways[ $gateway ] ?? false; + if( $current_gateway && isset( $current_gateway->id ) ) { + + $gateway_number = $current_gateway->id; + } + + return $gateway_number; + } + + public function get_gateway_label( $gateway = null ) { + + $gateway_label = ''; + if( is_null( $gateway ) ){ + + $gateway = $this->get_gateway(); + } + + $current_gateway = $this->gateways[ $gateway ] ?? false; + if( $current_gateway && isset( $current_gateway->id ) ) { + + $gateway_label = $current_gateway->label; + } + + return $gateway_label; + } + + public function get_tickets() { + + return $this->data['tickets'] ?? []; + } + + public function get_coupon() { + + return $this->data['coupon'] ?? ''; + } + + public function get_wc_coupons() { + + $coupons = $this->data['wc_coupon'] ?? []; + + return is_array( $coupons ) ? $coupons : explode( ',', $coupons ); + } + + public function get_wc_discounts() { + + $discounts = $this->data['wc_discounts'] ?? []; + + return is_array( $discounts ) ? $discounts : []; + } + + public function get_order_id() { + + return $this->data['order_id'] ?? 0; + } + + public function is_wc(){ + + return $this->get_order_id() ? true : false; + } + + public function get_discount() { + + return $this->data['discount'] ?? ''; + } + + public function get_fixed_fields() { + + return $this->data['fields'] ?? []; + } + + public function is_partial_payment() { + + $is_partial_payment = $this->data['is_partial_payment'] ?? false; + + return (bool) $is_partial_payment; + } + + public function get_partial_payment_settings() { + + $settings = $this->data['partial_payment_settings'] ?? []; + + return is_array( $settings ) ? $settings : []; + } + + + public function get_ticket_price( $ticket, $start_timestamp ) { + + return $this->bookClass->get_ticket_regular_price_key( + $ticket, + current_time('Y-m-d'), + $this->get_event_id(), + 'price', + $start_timestamp + ); + } + + public function get_ticket_variations_details( $ticket ) { + + $variation_details = []; + if( ! $this->get_ticket_variations_status() ) { + + return $variation_details; + } + + $event_id = $this->get_event_id(); + $ticket_id = $ticket['id'] ?? 0; + $variations = $ticket['variations'] ?? []; + + if( is_array( $variations ) && count( $variations ) ) { + + $ticket_variations = \MEC\Base::get_main()->ticket_variations( $event_id, $ticket_id ); + + foreach( $ticket_variations as $key => $ticket_variation ) { + + if(!is_numeric($key)) continue; + if(!isset($ticket_variation['title']) or (isset($ticket_variation['title']) and !trim($ticket_variation['title']))) continue; + + $variation_count = isset($variations[$key]) ? $variations[$key] : 0; + if(!$variation_count or ($variation_count and $variation_count < 0)) continue; + $v_price = (isset($ticket_variation['price']) and trim($ticket_variation['price']) != '') ? $ticket_variation['price'] : 0; + + $variation_amount = $v_price * $variation_count; + $variation_title = $ticket_variation['title'].' ('.esc_html($variation_count).')'; + + // Price Details + if(!isset($variation_details[$key])) { + + $variation_details[ $key ] = array( + 'variation_key' => $key, + 'price' => $v_price, + 'amount'=> $variation_amount, + 'description'=> __( $variation_title, 'modern-events-calendar-lite'), + 'type'=> 'variation', + 'count' => $variation_count + ); + } else { + + $variation_details[$key]['amount'] += $variation_amount; + + $new_count = ((int) $variation_details[$key]['count'] + $variation_count); + $variation_details[$key]['count'] = $new_count; + $variation_details[$key]['description'] = esc_html__($ticket_variation['title'].' ('.$new_count.')', 'modern-events-calendar-lite'); + } + } + } + + return $variation_details; + } + + public function get_gateway_options() { + + $gateway_number = $this->get_gateway_number(); + + return $this->gateways_options[ $gateway_number ] ?? []; + } + + public function is_disabled_fees_for_gateway() { + + $fees_disabled_gateways = \MEC\Settings\Settings::getInstance()->get_settings( 'fees_disabled_gateways' ); + $fees_disabled_gateways = is_array( $fees_disabled_gateways ) ? $fees_disabled_gateways : []; + $gateway_number = $this->get_gateway_number(); + + if( 'MEC_gateway_woocommerce' == $this->get_gateway() ) { + + return true; + } + + if( in_array( $gateway_number, $fees_disabled_gateways ) ) { + + return true; + } + + return false; + } + + public function get_order( $order_id ) { + + if( !$order_id ) { + + return false; + } + + if( function_exists( 'wc_get_order' ) ) { + + $order = wc_get_order( $order_id ); + return is_a( $order, '\WC_Order' ) ? $order : false; + } + + return false; + } + + public function get_order_fees() { + + $wc_fees = []; + $prices_include_tax = 'yes' === get_option( 'woocommerce_prices_include_tax', 'no' ); + if( $prices_include_tax ) { + + return $wc_fees; + } + + $order_id = $this->get_order_id(); + $order = $this->get_order( $order_id ); + if( $order ) { + + foreach ($order->get_tax_totals() as $key => $tax) { + + $tax_value = \WC_Tax::get_rate_percent_value($tax->rate_id); + $wc_fees[ 'wc_'. $key ] = [ + 'title' => 'WooCommerce ' . $tax->label, + 'amount' => $tax_value, + 'type' => 'amount', + 'type2' => 'wc', + ]; + } + } + + return $wc_fees; + } + + public function get_event_fees() { + + $fees = []; + $event_id = $this->get_event_id(); + $mec_fees = $this->bookClass->get_fees( $event_id ); + + if( $this->has_100percent_coupon() && $this->apply_100percent_coupon_to_all_fees() ){ + + return []; + } + + $disabled_fees_for_gateway = $this->is_disabled_fees_for_gateway(); + + $gateway = $this->get_gateway(); + $gateway_options = $this->get_gateway_options(); + + $can_use_mec_fees = !$disabled_fees_for_gateway; + $can_use_woo_fees = false; + + switch( $gateway ) { + + case 'MEC_gateway_add_to_woocommerce_cart': + + $use_wc_taxes = isset( $gateway_options['use_woo_taxes'] ) && 'on' == $gateway_options['use_woo_taxes'] ? true : false; + $use_mec_taxes = isset( $gateway_options['use_mec_taxes'] ) && 'on' == $gateway_options['use_mec_taxes'] ? true : false; + + $can_use_woo_fees = $use_wc_taxes; + $can_use_mec_fees = ( !$disabled_fees_for_gateway && $use_mec_taxes ); + break; + } + + if( $can_use_mec_fees ) { + + $fees = array_merge_recursive( $fees, $mec_fees ); + } + + if( $can_use_woo_fees ) { + + $order_fees = $this->get_order_fees(); + $fees = array_merge_recursive( $fees, $order_fees ); + } + + return apply_filters( 'mec_transaction_get_event_fees', $fees, $event_id, $this, $mec_fees ); + } + + public function get_ticket_fees_details( $ticket, $total_tickets_count, $total_tickets_dates ) { + + $fee_details = []; + if( ! $this->get_taxes_fees_status() ) { + + return $fee_details; + } + + $tickets_count = $ticket['count'] ?? 1; + $tickets_and_variations_amount_with_discount = $ticket['tickets_and_variations_amount_with_discount'] ?? 0; + + $fees = $this->get_event_fees(); + + foreach( $fees as $key => $fee ) { + + if(!is_numeric($key)) continue; + + $fee_amount_config = isset($fee['amount']) ? (float) $fee['amount'] : 0; + $fee_amount = 0; + + $type = $fee['type'] ?? ''; + switch( $type ) { + case 'amount_per_date': + + $fee_amount = (float) ($fee_amount_config * $total_tickets_dates); + $fee_amount = (float) ($fee_amount / $total_tickets_count); + break; + case 'percent': // per ticket + + $fee_amount = (float) (( $tickets_and_variations_amount_with_discount * $fee_amount_config ) / 100); + break; + case 'amount': // per ticket + + $fee_amount = (float) ($tickets_count * $fee_amount_config); + break; + case 'amount_per_booking': + + $fee_amount = (float) $fee_amount_config; + $fee_amount = (float) ($fee_amount / $total_tickets_count); + break; + } + + // Price Details + if( ! isset($fee_details[ $key ] ) ) { + + $fee_details[ $key ] = array( + 'fee_key' => $key, + 'amount'=> (float) $fee_amount, + 'description'=>__($fee['title'], 'modern-events-calendar-lite'), + 'type'=>'fee', + 'fee_type'=> $fee['type'], + 'fee_amount'=> (float) $fee_amount_config + ); + } else { + + $fee_details[ $key ]['amount'] += (float) $fee_amount; + } + } + + return $fee_details; + } + + public function get_ticket_order_discounts_details( $ticket, $total_tickets_amount_with_variations ) { + + $discounts_details = []; + $ticket_price = $ticket['ticket_price'] ?? 0; + $ticket_variations_amount = $ticket['variations_amount'] ?? 0; + $ticket_count = $ticket['count'] ?? 0; + + $order_id = $this->get_order_id(); + $order = $this->get_order( $order_id ); + if ( $order ) { + + $coupons = $order->get_coupon_codes(); + + foreach( $coupons as $coupon_code ) { + + $coupon = new \WC_Coupon( $coupon_code ); + $coupon_discount_type = $coupon->get_discount_type(); + $coupon_discount = $coupon->get_amount(); + + $discount_ticket_amount = 0; + $discount_ticket_variation_amount = 0; + $total_ticket_discount = 0; + if ( 'percent' === $coupon_discount_type ) { + + $discount_ticket_amount = ($ticket_price * $coupon_discount) / 100; + $discount_ticket_variation_amount = ($ticket_variations_amount * $coupon_discount) / 100; + $total_ticket_discount = $discount_ticket_amount + $discount_ticket_variation_amount; + } else { + + $percent = ($ticket_price * 100) / $total_tickets_amount_with_variations; + $discount_ticket_amount = ($coupon_discount * $percent) / 100; + $discount_ticket_variation_amount = $ticket_variations_amount * $percent / 100; + $total_ticket_discount = $discount_ticket_amount + $discount_ticket_variation_amount; + } + + if( ! isset( $discounts_details[ "wc_coupon_{$coupon_code}" ] ) ) { + + $discounts_details[ "wc_coupon_{$coupon_code}" ] = array( + 'discount_key' => "wc_coupon_{$coupon_code}", + 'ticket_amount' => $discount_ticket_amount, + 'tickets_amount' => $discount_ticket_amount * $ticket_count, + 'variation_amount' => $discount_ticket_variation_amount, + 'variations_amount' => $discount_ticket_variation_amount * $ticket_count, + 'amount'=> $total_ticket_discount, + 'fee' => $total_ticket_discount * $ticket_count, + 'description'=> esc_html__( 'Discount by WC Coupon', 'modern-events-calendar-lite'), + 'coupon_code' => $coupon_code, + 'type'=> 'wc_coupon', + 'discount_type'=> $coupon_discount_type, + 'discount_amount'=> $coupon_discount, + ); + } else { + + $discounts_details[ "wc_coupon_{$coupon_code}" ]['amount'] += $total_ticket_discount; + } + } + } + + return $discounts_details; + } + + public function get_ticket_discounts_details( $ticket, $total_tickets_amount_with_variations ) { + + if( 'MEC_gateway_woocommerce' == $this->get_gateway() ) { + + return $this->get_ticket_order_discounts_details( $ticket, $total_tickets_amount_with_variations ); + } + + $discounts_details = []; + $ticket_price = $ticket['ticket_price'] ?? 0; + $ticket_variations_amount = $ticket['variations_amount'] ?? 0; + $ticket_count = $ticket['count'] ?? 0; + + $event_id = $this->get_event_id(); + $booking_options = get_post_meta( $event_id, 'mec_booking', true ); + if( !is_array( $booking_options ) ) { + + $booking_options = []; + } + + // User Discount + $user_id = $this->get_author_id(); + if( $user_id ) { + // User + $user = get_user_by( 'id', $user_id ); + + $roles = is_a( $user, '\WP_User' ) && isset( $user->roles ) ? (array)$user->roles : []; + + $loggedin_discount = (isset($booking_options['loggedin_discount']) ? $booking_options['loggedin_discount'] : 0); + $role_discount = $loggedin_discount; + + foreach( $roles as $key => $role ) { + + // If role discount is higher than the preset role OR a previous roles discount, set it to the new higher discount + if( + isset($booking_options['roles_discount_'.$role]) + && is_numeric($booking_options['roles_discount_'.$role]) + && $booking_options['roles_discount_'.$role] > $role_discount + ){ + + $role_discount = $booking_options['roles_discount_'.$role]; + } + } + + $discount_ticket_amount = 0; + $discount_ticket_variation_amount = 0; + if( trim( $role_discount ) and is_numeric( $role_discount ) ){ + + $discount_ticket_amount = $ticket_price * $role_discount / 100; + // $discount_ticket_variation_amount = $ticket_variations_amount * $role_discount / 100; + $total_ticket_discount = $discount_ticket_amount + $discount_ticket_variation_amount; + if( ! isset( $discounts_details[ 'roles_discount' ] ) ) { + + $discounts_details[ 'roles_discount' ] = array( + 'discount_key' => 'roles_discount', + 'ticket_amount' => $discount_ticket_amount, + 'tickets_amount' => $discount_ticket_amount * $ticket_count, + 'variation_amount' => $discount_ticket_variation_amount, + 'variations_amount' => $discount_ticket_variation_amount * $ticket_count, + 'amount'=> $total_ticket_discount * $ticket_count, + 'fee' => $total_ticket_discount, + 'description'=>__( 'User Discount', 'modern-events-calendar-lite'), + 'type'=> 'roles_discount', + 'discount_type'=> 'roles_discount', + 'discount_amount'=> $role_discount, + ); + } else { + + // $discounts_details[ 'roles_discount' ]['amount'] += $fee_amount; + } + } + } + + // MEC Coupon Discount + $coupon = $this->get_coupon(); + if ( $coupon ) { + + $coupon_details = $this->get_mec_coupon_detail( $coupon ); + + $coupon_id = $coupon_details['coupon_id'] ?? false; + + if ( $coupon_id ) { + + $coupon_discount_type = $coupon_details['discount_type'] ?? false; + $coupon_discount = $coupon_details['discount'] ?? false; + $maximum_discount = $coupon_details['maximum_discount'] ?? 0; + + $discount_ticket_amount = 0; + $discount_ticket_variation_amount = 0; + $total_ticket_discount = 0; + if ( 'percent' === $coupon_discount_type ) { + + $discount_ticket_amount = ($ticket_price * $coupon_discount) / 100; + $discount_ticket_variation_amount = ($ticket_variations_amount * $coupon_discount) / 100; + $total_ticket_discount = $discount_ticket_amount + $discount_ticket_variation_amount; + } else { + + $percent = ($ticket_price * 100) / $total_tickets_amount_with_variations; + $discount_ticket_amount = ($coupon_discount * $percent) / 100; + $discount_ticket_variation_amount = $ticket_variations_amount * $percent / 100; + $total_ticket_discount = $discount_ticket_amount + $discount_ticket_variation_amount; + } + + if($total_ticket_discount > $maximum_discount && $maximum_discount!=0){ + $discount_ticket_amount = $maximum_discount; + $discount_ticket_variation_amount = $ticket_variations_amount - $maximum_discount < 0 ? 0 : $ticket_variations_amount - $maximum_discount; + $total_ticket_discount = $discount_ticket_amount + $discount_ticket_variation_amount; + } + + if( ! isset( $discounts_details[ 'coupon_discount' ] ) ) { + + $discounts_details[ 'coupon_discount' ] = array( + 'discount_key' => 'coupon_discount', + 'ticket_amount' => $discount_ticket_amount, + 'tickets_amount' => $discount_ticket_amount * $ticket_count, + 'variation_amount' => $discount_ticket_variation_amount, + 'variations_amount' => $discount_ticket_variation_amount * $ticket_count, + 'amount'=> $total_ticket_discount, + 'fee' => $total_ticket_discount * $ticket_count, + 'description'=>__( 'Discount', 'modern-events-calendar-lite'), + 'type'=> 'coupon_discount', + 'discount_type'=> $coupon_discount_type, + 'discount_amount'=> $coupon_discount, + ); + } else { + + $discounts_details[ 'coupon_discount' ]['amount'] += $total_ticket_discount; + } + } + } + + // WC Coupon Discount + $wc_discounts = $this->get_ticket_order_discounts_details( $ticket, $total_tickets_amount_with_variations ); + $discounts_details = array_merge_recursive( $discounts_details, $wc_discounts ); + + return $discounts_details; + } + + public function get_all_occurrences_tickets_details( $return_cached = true ) { + + if( $return_cached ) { + + $cached_data = $this->get_cached_tickets_details(); + if( $cached_data ) { + return $cached_data; + } + } + + $timestamps = $this->get_dates(); + $event_tickets = $this->get_event_tickets(); + $saved_tickets = $this->get_tickets(); + $removed_tickets = $this->data['removed_tickets'] ?? []; + + $tickets = []; + $row_id = 0; + foreach( $timestamps as $timestamp ) { + + $timestamp_ex = explode(':', $timestamp); + $start_timestamp = $timestamp_ex[0]; + $end_timestamp = $timestamp_ex[1]; + + if( !is_numeric( $start_timestamp ) || !$start_timestamp ){ + + continue; + } + + foreach( $saved_tickets as $key => $ticket ) { + + $is_removed_ticket = $removed_tickets[ $key ][ $timestamp ] ?? false; + if( $is_removed_ticket ) { + + continue; + } + + $ticket_id = $ticket['id'] ?? null; + $ticket_count = $ticket['count'] ?? 1; + $attendee_key = $key; + + if( is_null( $ticket_id ) ) { + + continue; + } + + $t_price = 0; + if( isset( $event_tickets[ $ticket_id ]['price'] ) ){ + + $t_price = $this->get_ticket_price( + $event_tickets[ $ticket_id ], + $start_timestamp + ); + } + + if( !is_numeric( $t_price ) ) { + + $t_price = 0; + } + + $tickets_amount = $t_price * $ticket_count; + + $variations = $this->get_ticket_variations_details( $ticket ); + $variations_amount = array_sum( + array_column( $variations, 'amount' ) + ); + + + $ticket_info = $event_tickets[ $ticket_id ] ?? []; + + $ticket_start_hour = isset($ticket_info['ticket_start_time_hour']) ? $ticket_info['ticket_start_time_hour'] : 8; + $ticket_start_minute = isset($ticket_info['ticket_start_time_minute']) ? $ticket_info['ticket_start_time_minute'] : 0; + $ticket_start_ampm = isset($ticket_info['ticket_start_time_ampm']) ? $ticket_info['ticket_start_time_ampm'] : 'AM'; + $ticket_end_hour = isset($ticket_info['ticket_end_time_hour']) ? $ticket_info['ticket_end_time_hour'] : 6; + $ticket_end_minute = isset($ticket_info['ticket_end_time_minute']) ? $ticket_info['ticket_end_time_minute'] : 0; + $ticket_end_ampm = isset($ticket_info['ticket_end_time_ampm']) ? $ticket_info['ticket_end_time_ampm'] : 'PM'; + + $ticket_start_minute_s = $ticket_start_minute; + $ticket_end_minute_s = $ticket_end_minute; + + if($ticket_start_minute == '0') $ticket_start_minute_s = '00'; + if($ticket_start_minute == '5') $ticket_start_minute_s = '05'; + if($ticket_end_minute == '0') $ticket_end_minute_s = '00'; + if($ticket_end_minute == '5') $ticket_end_minute_s = '05'; + + $ticket_start_seconds = \MEC\Base::get_Main()->time_to_seconds( + \MEC\Base::get_Main()->to_24hours($ticket_start_hour, $ticket_start_ampm), + $ticket_start_minute_s + ); + + $ticket_end_seconds = \MEC\Base::get_Main()->time_to_seconds( + \MEC\Base::get_Main()->to_24hours($ticket_end_hour, $ticket_end_ampm), + $ticket_end_minute_s + ); + + $ticket_limit = $ticket_info['limit'] ?? ''; + $tickets_amount_with_variations = $tickets_amount + $variations_amount; + + $ticket['row_id'] = ++$row_id; + $ticket['attendee_key'] = $attendee_key; + $ticket['ticket_id'] = $event_tickets[ $ticket_id ]['id'] ?? ''; + $ticket['ticket_name'] = $event_tickets[ $ticket_id ]['name'] ?? ''; + $ticket['ticket_price'] = $t_price; + $ticket['tickets_amount'] = $tickets_amount; + $ticket['tickets_amount_with_variations'] = $tickets_amount_with_variations; + $ticket['partial_payment_tickets_amount_with_variations'] = $this->get_partial_payment_amount( $tickets_amount_with_variations ); + $ticket['ticket_limit'] = $ticket_limit; + $ticket['variations_amount'] = $variations_amount; + $ticket['variations_details'] = $variations; + $ticket['date'] = $timestamp; + $ticket['product_id'] = $ticket[ 'product_ids' ][ $timestamp ] ?? 0; + + $ticket_date_timestamp_day_start = strtotime( date( 'Y-m-d', $start_timestamp ) ); + $ticket_date_timestamp_day_end = strtotime( date( 'Y-m-d', $end_timestamp ) ); + $ticket['ticket_timestamp_start'] = $ticket_date_timestamp_day_start + $ticket_start_seconds; + $ticket['ticket_timestamp_end'] = $ticket_date_timestamp_day_end + $ticket_end_seconds; + + $ticket = apply_filters( 'mec_transaction_get_ticket_details', $ticket, $key, $ticket_id, $saved_tickets, $event_tickets ); + + $tickets[] = $ticket; + } + } + + + $total_tickets_count = $this->calculate_total_tickets_count( $tickets ); + $total_tickets_dates = $this->get_total_tickets_dates( $tickets ); + $total_tickets_amount_with_variations =$this->calculate_total_tickets_amount_with_variations( $tickets ); + + foreach( $tickets as $k => $ticket ) { + + $discounts = $this->get_ticket_discounts_details( $ticket, $total_tickets_amount_with_variations ); + $discounts_amount = array_sum( + array_column( $discounts, 'amount' ) + ); + + if( $ticket['tickets_amount_with_variations'] < $discounts_amount ) { + + $discounts_amount = $ticket['tickets_amount_with_variations']; + } + $ticket['discounts_amount'] = $discounts_amount; + $ticket['discounts_details'] = $discounts; + $ticket['tickets_and_variations_amount_with_discount'] = $ticket['tickets_amount_with_variations'] - $discounts_amount; + + $fees = $this->get_ticket_fees_details( $ticket, $total_tickets_count, $total_tickets_dates ); + + $fees_amount = 0; + $fees_per_ticket_amount = 0; + $per_ticket_fee_types = array( + 'percent', + 'amount', + ); + foreach( $fees as $fee ){ + + $fee_type = $fee['fee_type'] ?? ''; + $fee_amount = $fee['amount'] ?? 0; + $fees_amount += $fee_amount; + + if( in_array( $fee_type, $per_ticket_fee_types ) ) { + + $fees_per_ticket_amount += $fee_amount; + } + } + $ticket['fees_per_ticket_amount'] = $fees_per_ticket_amount; + $ticket['fees_amount'] = $fees_amount; + $ticket['fees_details'] = $fees; + + $tickets[ $k ] = $ticket; + } + + + $this->update_cache_tickets_details( $tickets ); + + return $tickets; + } + + public function get_all_tickets_variations_detail( $tickets = null ) { + + if( is_null( $tickets ) ){ + + $tickets = $this->get_all_tickets_details(); + } + + $_variations_details = []; + foreach( $tickets as $ticket ) { + + $_variations_details = array_merge( + $_variations_details, + $ticket['variations_details'] ?? array() + ); + } + + $variations_details = []; + foreach( $_variations_details as $k => $variation_details ) { + + $variation_key = $variation_details['variation_key'] ?? 0; + $amount = $variation_details['amount'] ?? 0; + $count = $variation_details['count'] ?? 0; + + if( !isset( $variations_details[ $variation_key ] ) ) { + + $variations_details[ $variation_key ] = $variation_details; + } else { + + $variations_details[ $variation_key ]['amount'] += $amount; + $variations_details[ $variation_key ]['count'] += $count; + } + } + + return $variations_details; + } + + public function get_all_tickets_fees_detail( $tickets = null ) { + + if( is_null( $tickets ) ){ + + $tickets = $this->get_all_tickets_details(); + } + + $_fees_details = []; + foreach( $tickets as $ticket ) { + + $_fees_details = array_merge( + $_fees_details, + $ticket['fees_details'] ?? array() + ); + } + + $fees_details = []; + foreach( $_fees_details as $k => $fee_details ) { + + $fee_key = $fee_details['fee_key'] ?? 0; + $amount = $fee_details['amount'] ?? 0; + $count = $fee_details['count'] ?? 1; + + if( !isset( $fees_details[ $fee_key ] ) ) { + + $fees_details[ $fee_key ] = $fee_details; + } else { + + if( !isset( $fees_details[ $fee_key ]['amount'] ) ){ + + $fees_details[ $fee_key ]['amount'] = 0; + } + $fees_details[ $fee_key ]['amount'] += $amount; + + if( !isset( $fees_details[ $fee_key ]['count'] ) ){ + + $fees_details[ $fee_key ]['count'] = 0; + } + $fees_details[ $fee_key ]['count'] += $count; + } + } + + return $fees_details; + } + + public function get_all_tickets_discounts_detail( $tickets = null ) { + + if( is_null( $tickets ) ){ + + $tickets = $this->get_all_tickets_details(); + } + + $_discounts_details = []; + foreach( $tickets as $ticket ) { + + $_discounts_details = array_merge( + $_discounts_details, + $ticket['discounts_details'] ?? array() + ); + } + + $discounts_details = []; + foreach( $_discounts_details as $k => $discount_details ) { + + $discount_key = $discount_details['discount_key'] ?? 0; + $amount = $discount_details['amount'] ?? 0; + $count = $discount_details['count'] ?? 1; + + if( !isset( $discounts_details[ $discount_key ] ) ) { + + $discounts_details[ $discount_key ] = $discount_details; + } else { + + if( !isset( $discounts_details[ $discount_key ]['amount'] ) ){ + + $discounts_details[ $discount_key ]['amount'] = 0; + } + $discounts_details[ $discount_key ]['amount'] += $amount; + + if( !isset( $discounts_details[ $discount_key ]['count'] ) ){ + + $discounts_details[ $discount_key ]['count'] = 0; + } + $discounts_details[ $discount_key ]['count'] += $count; + } + } + + return $discounts_details; + } + + public function calculate_total_tickets_detail( $tickets, $key ) { + + $total = 0; + switch( $key ) { + + case 'discount': + + $discounts_details = $this->get_all_tickets_discounts_detail( $tickets ); + + $total = array_sum( + array_column( $discounts_details, 'amount' ) + ); + break; + + case 'fees_amount': + + $fees_details = $this->get_all_tickets_fees_detail( $tickets ); + + $total = array_sum( + array_column( $fees_details, 'amount' ) + ); + break; + + case 'variations_amount': + + $variations_details = $this->get_all_tickets_variations_detail( $tickets ); + + $total = array_sum( + array_column( $variations_details, 'amount' ) + ); + break; + + default: + $total = array_sum( + array_column( $tickets, $key ) + ); + } + + return $total; + } + + public function calculate_total_tickets_amount( $tickets ) { + + return $this->calculate_total_tickets_detail( $tickets, 'tickets_amount' ); + } + + public function calculate_total_tickets_amount_with_variations( $tickets ) { + + return $this->calculate_total_tickets_detail( $tickets, 'tickets_amount_with_variations' ); + } + + + + public function calculate_total_tickets_count( $tickets ) { + + return $this->calculate_total_tickets_detail( $tickets, 'count' ); + } + + public function calculate_total_tickets_variations_amount( $tickets ) { + + return $this->calculate_total_tickets_detail( $tickets, 'variations_amount' ); + } + + public function calculate_total_tickets_fees_amount( $tickets ) { + + return $this->calculate_total_tickets_detail( $tickets, 'fees_amount' ); + } + + public function calculate_total_tickets_discounts_amount( $tickets ) { + + return $this->calculate_total_tickets_detail( $tickets, 'discounts_amount' ); + } + + public function remove_ticket( $ticket_key, $date, $update = true ) { + + $tickets = $this->get_tickets(); + + $ticket_product_ids = $tickets[ $ticket_key ]['product_ids'] ?? []; + unset( $ticket_product_ids[ $date ] ); + $tickets[ $ticket_key ]['product_ids'] = $ticket_product_ids; + + $this->data['tickets'] = $tickets; + + if( empty( $ticket_product_ids ) ) { + + unset( $this->data['tickets'][ $ticket_key ] ); + unset( $this->data['removed_tickets'][ $ticket_key ] ); + } else { + + $this->data['removed_tickets'][ $ticket_key ][ $date ] = true; + } + + $this->reset_cache_tickets_details(); + + $saved_dates = $this->get_dates(); + $ticket_dates = $this->get_tickets_dates(); + + if( count( $saved_dates ) !== count( $ticket_dates ) ) { + + $this->data['timestamps'] = $ticket_dates; + $this->data['all_dates'] = $ticket_dates; + $this->data['date'] = current( $ticket_dates ); + } + + if( $update ) { + + $this->update_data(); + } + } + + public function remove_ticket_by_product_id( $product_id ) { + + $attendee_key = get_post_meta( $product_id, 'attendee_key', true ); + $date = get_post_meta( $product_id, 'mec_date', true ); + + $ticket_key = (int)$attendee_key; + + $this->remove_ticket( $ticket_key, $date, true ); + + $tickets = $this->get_tickets(); + if( !empty( $tickets ) ) { + + $this->create_products_from_items( false, true ); + } + + //TODO: update fees + } + + public function _get_tickets_dates( $tickets ) { + + $dates = array_column( $tickets, 'date' ); + $dates = array_unique( $dates ); + + return $dates; + } + + public function get_tickets_emails( $tickets ) { + + $emails = array_column( $tickets, 'email' ); + $emails = array_unique( $emails ); + + return $emails; + } + + public function get_total_tickets_dates( $tickets ) { + + return count( $this->_get_tickets_dates( $tickets ) ); + } + + public function get_details( $filters = array() ) { + + $tickets_details = $this->get_all_tickets_details(); + + if( !empty( $filters ) ){ + + foreach( $tickets_details as $td_key => $ticket_details ) { + + foreach( $filters as $f_key => $f_value ) { + + $t_value = $ticket_details[ $f_key ] ?? ''; + if( $t_value != $f_value ) { + + unset( $tickets_details[ $td_key ] ); + } + } + } + } + + $total_tickets_amount = $this->calculate_total_tickets_amount( $tickets_details ); + $total_tickets_amount_with_variations = $this->calculate_total_tickets_amount_with_variations( $tickets_details ); + $total_tickets_count = $this->calculate_total_tickets_count( $tickets_details ); + $total_variations_amount = $this->calculate_total_tickets_variations_amount( $tickets_details ); + $total_fees_amount = $this->calculate_total_tickets_fees_amount( $tickets_details ); + $fees_details = $this->get_all_tickets_fees_detail( $tickets_details ); + $total_discounts_amount = $this->calculate_total_tickets_discounts_amount( $tickets_details ); + $discounts_details = $this->get_all_tickets_discounts_detail( $tickets_details ); + $variations_details = $this->get_all_tickets_variations_detail( $tickets_details ); + $dates = $this->_get_tickets_dates( $tickets_details ); + $total_dates = $this->get_total_tickets_dates( $tickets_details ); + $emails = $this->get_tickets_emails( $tickets_details ); + + + //TODO: add discount + return array( + 'tickets_dates' => $dates, + 'tickets_emails' => $emails, + 'tickets_details' => $tickets_details, + 'fees_details' => $fees_details, + 'discounts_details' => $discounts_details, + 'variations_details' => $variations_details, + 'summary' => array( + 'total_tickets_amount' => $total_tickets_amount, + 'total_tickets_amount_with_variations' => $total_tickets_amount_with_variations, + 'total_tickets_count' => $total_tickets_count, + 'total_variations_amount' => $total_variations_amount, + 'total_fee_amount' => $total_fees_amount, + 'total_discounts_amount' => $total_discounts_amount, + 'subtotal_amount_with_fee' => $total_tickets_amount + $total_variations_amount + $total_fees_amount, + 'subtotal_amount_without_fee' => $total_tickets_amount + $total_variations_amount, + 'total_amount_with_fee' => $total_tickets_amount + $total_variations_amount + $total_fees_amount - $total_discounts_amount, + 'total_amount_without_fee' => $total_tickets_amount + $total_variations_amount - $total_discounts_amount, + 'total_dates' => $total_dates, + ) + ); + } + + private function get_all_occurrences_details() { + + $this->price_details = $this->get_details(array( + // 'attendee_key' => 0, + )); + + return $this->price_details; + } + + public function get_price_details() { + + if( is_null( $this->price_details ) ){ + + $this->get_all_occurrences_details(); + } + + return $this->price_details; + } + + public function get_tickets_details( $filters = array() ) { + + $details = $this->get_details( $filters ); + + $column_key = 'tickets_details'; + + return $details[ $column_key ]; + } + + public function get_variations_details( $filters = array() ) { + + $details = $this->get_details( $filters ); + + $column_key = 'variations_details'; + + return $details[ $column_key ]; + } + + public function get_variations( $filters = array() ) { + + $details = $this->get_details( $filters ); + + $column_key = 'total_variations_amount'; + + return $details['summary'][ $column_key ]; + } + + public function get_partial_payment_amount( $total ) { + + if( !$this->is_partial_payment() ) { + + return $total; + } + + $payable = $total; + + [$payable_amount, $payable_type] = $this->get_partial_payment_settings(); + + if($payable_type === 'percent') { + + $payable = $total * ($payable_amount / 100); + } elseif($payable_type === 'amount') { + + $payable = min($total, $payable_amount); + } + + return $payable; + } + + public function calculate_partial_payment( $filters = array(), $apply_fees = true ) { + + $total = $this->get_total( $filters, $apply_fees ); + + $payable = $this->get_partial_payment_amount( $total ); + + return $payable; + } + + public function get_fees_details( $filters = array() ) { + + $details = $this->get_details( $filters ); + + $column_key = 'fees_details'; + + return $details[ $column_key ]; + } + + public function get_emails( $filters = array() ) { + + $details = $this->get_details( $filters ); + + $column_key = 'tickets_emails'; + + return $details[ $column_key ]; + } + + public function get_tickets_dates( $filters = array() ) { + + $details = $this->get_details( $filters ); + + $column_key = 'tickets_dates'; + + return $details[ $column_key ]; + } + + public function get_fees( $filters = array() ) { + + $details = $this->get_details( $filters ); + + $column_key = 'total_fee_amount'; + + return $details['summary'][ $column_key ]; + } + + public function get_discounts( $filters = array() ) { + + $details = $this->get_details( $filters ); + + $column_key = 'total_discounts_amount'; + + return $details['summary'][ $column_key ]; + } + + public function get_subtotal( $filters = array(), $apply_fees = true ) { + + $details = $this->get_details( $filters ); + + $column_key = 'subtotal_amount_with_fee';//total_amount_with_fee | total_amount_without_fee + + if( !$apply_fees ) { + + $column_key = 'subtotal_amount_without_fee'; + } + + return $details['summary'][ $column_key ]; + } + + public function get_total( $filters = array(), $apply_fees = true ) { + + $details = $this->get_details( $filters ); + + $column_key = 'total_amount_with_fee';//total_amount_with_fee | total_amount_without_fee + + if( !$apply_fees ) { + + $column_key = 'total_amount_without_fee'; + } + + return $details['summary'][ $column_key ]; + } + + public function get_payable( $filters = array(), $apply_fees = true ) { + + $total = $this->get_total( $filters, $apply_fees ); + $payable = $total; + + // Calculate Payable + if( $this->is_partial_payment() ) { + + $payable = $this->calculate_partial_payment( $filters, $apply_fees ); + } + + return $payable; + } + + public function get_total_dates( $filters = array() ) { + + $details = $this->get_details( $filters ); + + $column_key = 'total_dates'; + + return $details['summary'][ $column_key ]; + } + + public function get_attendees_info( $filters = array() ) { + + $info = []; + $tickets_details = $this->get_tickets_details( $filters ); + foreach( $tickets_details as $ticket_details ) { + + $email = $ticket_details['email']; + $date = $ticket_details['date']; + $name = $ticket_details['name']; + $detail_key = "$email-$date-$name"; + $count = $ticket_details['count']; + if( !isset( $info[ $detail_key ] ) ) { + + $info[ $detail_key ] = array( + 'name' => $name, + 'email' => $email, + 'date' => $date, + 'count' => $ticket_details['count'], + 'reg' => $ticket_details['reg'] ?? array(), + ); + } else { + + $info[ $detail_key ]['count'] += $count; + } + } + + return $info; + } + + public function validate_for_add_book() { + + $errors = []; + $date_format = 'Y-m-d'; + $event_id = $this->get_event_id(); + $tickets_details = $this->get_tickets_details(); + $dates = $this->get_tickets_dates(); + + foreach( $dates as $date ) { + + $t_occurrences = explode( ':', $date ); + $occurrence_time = $t_occurrences[0]; + $availability[ $occurrence_time ] = $this->bookClass->get_tickets_availability( + $event_id, + $occurrence_time + ); + } + + foreach( $tickets_details as $ticket ) { + + $t_occurrences = explode( ':', $ticket['date'] ); + $occurrence = $t_occurrences[0]; + $occurrence_availability = $availability[ $occurrence ] ?? []; + $ticket_id = $ticket['id']; + $ticket_name = $ticket['ticket_name']; + $ticket_count = $ticket['count']; + + $ticket_availability = $occurrence_availability[ $ticket_id ] ?? false; + $str_replace = !empty( $ticket_name ) ? ''. $ticket_name .'' : ''; + $ticket_message_sold_out = sprintf( + __('The %s ticket is sold out in %s. You can try another ticket or another date.', 'modern-events-calendar-lite'), + $str_replace, + date_i18n( $date_format, $occurrence ) + ); + + if( -1 != $ticket_availability && ( !$ticket_availability || $ticket_count > $ticket_availability ) ) { + + $errors[ "$ticket_id-$occurrence" ] = array( + 'success' => 0, + 'message'=>sprintf( + \MEC\Base::get_main()->m( + 'booking_restriction_message3', + $ticket_message_sold_out + ), + $ticket_availability + ), + 'code'=>'LIMIT_REACHED' + ); + } + } + + if( !empty( $errors ) ) { + + return $errors; + } + + return true; + } + + public function get_closest_occurrence() { + + $all_dates = $this->get_dates(); + + if( count( $all_dates ) > 1 ){ + + foreach( $all_dates as $timestamps ){ + + $ex = explode( ':', $timestamps ); + $start_timestamp = $ex[0]; + $end_timestamp = $ex[1]; + $current_timestamp = current_time('timestamp'); + if( $current_timestamp >= $end_timestamp ){ + + continue; + } + + return $timestamps; + } + } + + $timestamps = current( $all_dates ); + + return $timestamps; + } + + public function get_closest_occurrence_start_timestamp() { + + $timestamps = $this->get_closest_occurrence(); + $ex = explode( ':', $timestamps ); + + return $ex[0]; + } + + public function get_closest_occurrence_end_timestamp() { + + $timestamps = $this->get_closest_occurrence(); + $ex = explode( ':', $timestamps ); + + return $ex[1]; + } + + public function register_user( $attendee, $args = array() ) { + + $user = \MEC::getInstance('app.libraries.user'); + return $user->register($attendee, $args); + } + + public function create_book_from_transaction( $args = array(), $rebuild = false ) { + + $book_id = $this->get_book_id(); + if( $book_id && !$rebuild ){ + + return $book_id; + } + + $attendees = $this->get_tickets(); + $attention_date = $this->get_date(); + $attention_times = explode(':', $attention_date); + $date = date('Y-m-d H:i:s', trim($attention_times[0])); + + // Is there any attendee? + if (!count( $attendees )) { + + return new \WP_Error( + 'NO_TICKET', + __( 'There is no attendee for booking!', 'modern-events-calendar-lite') + ); + } + + $main_attendee = isset($attendees[0]) ? $attendees[0] : []; + $name = $main_attendee['name'] ?? ''; + $ticket_ids = ''; + $attendees_info = []; + + foreach ($attendees as $attendee) { + + $ticket_ids .= $attendee['id'] . ','; + if (!array_key_exists($attendee['email'], $attendees_info)) { + + $attendees_info[$attendee['email']] = array( + 'count' => $attendee['count'] + ); + } else { + + $attendees_info[ $attendee['email'] ]['count'] = ($attendees_info[$attendee['email']]['count'] + $attendee['count']); + } + } + + $user_id = $this->register_user( $main_attendee ); + $user = \MEC::getInstance('app.libraries.user'); + + $gateway = $args['mec_gateway'] ?? $this->get_gateway(); + $gateway_label = $args['mec_gateway_label'] ?? $this->get_gateway_label( $gateway ); + $book_id = $this->bookClass->add( + array( + 'post_author' => $user_id, + 'post_type' => 'mec-books', + 'post_title' => $name.' - '.$user->get($user_id)->user_email, + 'post_date' => $date, + 'attendees_info' => $attendees_info, + 'mec_attendees' => $attendees, + 'mec_gateway' => $gateway, + 'mec_gateway_label' => $gateway_label, + ), + $this->transaction_id, + ',' . $ticket_ids + ); + + //TODO: update book meta + + // Fires after completely creating a new booking + do_action('mec_booking_completed', $book_id); + + return $book_id; + } + + public function create_products_from_items( $rebuild = false, $update = false ) { + + $product_ids = []; + + $saved_data = $this->get_saved_data(); + $tickets_details = $this->get_tickets_details(); + foreach( $tickets_details as $ticket_detail ) { + //TODO: is first for all + $attendee_key = $ticket_detail['attendee_key']; + $date = $ticket_detail['date']; + $ex_date = explode( ':', $date ); + $start_timestamp = $ex_date[0]; + $product_id = $ticket_detail['product_id'] ?? 0; + + if( !$product_id || $rebuild || $update ) { + + $product_id = $this->create_ticket_product( $ticket_detail, $update ); + + $saved_data['tickets'][ $attendee_key ][ 'product_ids' ][ $date ] = $product_id; + } + + $product_ids[] = $product_id; + } + + + $saved_fees_product_ids = $saved_data['fees_product_ids'] ?? []; + $related_products = $product_ids; + $per_ticket_fee_types = array( + 'percent', + 'amount', + ); + // $dates = $this->get_tickets_dates(); + // foreach( $dates as $timestamp ) { + + $filters = array( + // 'date' => $timestamp, + ); + $fees_details = $this->get_fees_details( $filters ); + $fees_product_ids = []; + foreach( $fees_details as $fee_key => $fee_detail ) { + + $fee_type = $fee_detail['fee_type']; + if( in_array( $fee_type, $per_ticket_fee_types ) ) { + + continue; + } + + $product_id = $saved_fees_product_ids[ $fee_key ] ?? 0; + $fee_detail['product_id'] = $product_id; + + if( !$product_id || $rebuild || $update ) { + + $product_id = $this->create_fee_product( $fee_detail, $related_products, $update ); + + $fees_product_ids[ $fee_key ] = $product_id; + } + + $product_ids[] = $product_id; + } + // } + + $saved_data['fees_product_ids'] = $fees_product_ids; + + $this->set_data( $saved_data ); // new data + $this->update_data(); + + return $product_ids; + } + + public function create_product( $args ) { + + $transaction_id = $this->transaction_id; + + $product_type = \MEC\Settings\Settings::getInstance()->get_settings( 'ticket_product_type' ); + $product_type = $product_type ? $product_type : 'virtual'; + $is_virtual = ( 'virtual' === $product_type ) ? 'yes' : 'no'; + $event_id = $this->get_event_id(); + + $meta_input = wp_parse_args( + $args['meta_input'] ?? array(), + array( + '_visibility' => false, + '_stock_status' => 'instock', + 'total_sales' => '0', + '_downloadable' => 'no', + '_purchase_note' => '', + '_featured' => 'no', + '_weight' => '', + '_length' => '', + '_width' => '', + '_height' => '', + '_sku' => '', + '_product_attributes' => array(), + '_sale_price_dates_from' => '', + '_sale_price_dates_to' => '', + '_sold_individually' => '', + '_manage_stock' => 'no', + '_backorders' => 'no', + '_stock' => '', + '_product_image_gallery' => '', + + 'transaction_id' => $transaction_id, + '_mec_event_id' => $event_id, + 'event_id' => $event_id, //TODO: remove + 'event_name' => get_the_title( $event_id ), + + 'first_for_all' => $this->is_first_for_all() ? 'yes' : 'no', + '_virtual' => $is_virtual, + '_regular_price' => '', + '_sale_price' => '', + '_price' => '', + + 'cantChangeQuantity' => true, + // 'm_product_type' => '', + // 'related_products' => '', + ) + ); + + unset( $args['meta_input'] ); + + $defaults = array( + 'post_content' => '', + 'post_status' => 'MEC_Tickets', + 'post_title' => $args['product_title'], + 'post_parent' => '', + 'post_type' => 'product', + 'meta_input' => $meta_input + ); + + $args = wp_parse_args( $args, $defaults ); + + // Create post + $post_id = wp_insert_post( $args ); + wp_set_object_terms($post_id, 'MEC-Woo-Cat', 'product_cat', true); + wp_set_object_terms($post_id, 'simple', 'product_type'); + + $terms = array('exclude-from-search', 'exclude-from-catalog'); + wp_set_post_terms($post_id, $terms, 'product_visibility', false); + + + + if (has_post_thumbnail( $event_id )) { + $image = wp_get_attachment_image_src(get_post_thumbnail_id( $event_id ), 'full'); + $event_featured_image = str_replace(get_site_url(), $_SERVER['DOCUMENT_ROOT'], $image[0]); + + if ($event_featured_image) { + set_post_thumbnail($post_id, attachment_url_to_postid($image[0])); + } + } + + if (isset($args['m_product_type'])) { + + update_post_meta($post_id, 'm_product_type', $args['m_product_type']); + update_post_meta($post_id, 'related_products', $args['related_products']); + } + + if (isset($args['cantChangeQuantity'])) { + + update_post_meta($post_id, 'cantChangeQuantity', true); + } + + return $post_id; + } + + public function create_ticket_product( $ticket_detail, $update = false ) { + + $ticket_id = $ticket_detail['id'] ?? ''; + $ticket_product_id = $ticket_detail['product_id'] ?? 0; + $attendee_key = $ticket_detail['attendee_key'] ?? ''; + + $ticket_price = $ticket_detail['ticket_price'] ?? 0; + $ticket_sale_price = $ticket_detail['ticket_sale_price'] ?? $ticket_price; + $variations_amount = $ticket_detail['variations_amount'] ?? 0; + $discounts_amount = $ticket_detail['discounts_amount'] ?? 0; + $fees_per_ticket_amount = $ticket_detail['fees_per_ticket_amount'] ?? 0; + + $ticket_price += $fees_per_ticket_amount; + $ticket_sale_price += $fees_per_ticket_amount; + + $ticket_price += $variations_amount; + $ticket_sale_price += $variations_amount - $discounts_amount; + + $ticket_sale_price = $this->get_partial_payment_amount( $ticket_sale_price ); + + $variations = $ticket_detail['variations_details'] ?? []; + + $args = array( + 'product_title' => __( 'Ticket', 'modern-events-calendar-lite') . ' (' . $ticket_detail['ticket_name'] . ') - ' . $this->transaction_id, + 'meta_input' => array( + '_regular_price' => $ticket_price, + '_sale_price' => $ticket_sale_price, + '_price' => $ticket_sale_price, + + 'ticket_id' => $ticket_id, + 'ticket_name' => $ticket['ticket_name'] ?? '', + 'attendee_key' => $attendee_key, + 'mec_ticket' => $ticket_detail, + 'mec_date' => $ticket_detail['date'], + 'ticket_used_count' => $ticket_detail['count'], + ) + ); + + if( $update && $ticket_product_id ) { + + $args['ID'] = $ticket_product_id; + } + + $post_id = $this->create_product( $args ); + + $ticket_sales_with_wooCommerce_product = false; + + $event_tickets = $this->get_event_tickets(); + $event_ticket = isset( $event_tickets[$ticket_id] ) && is_array( $event_tickets[$ticket_id] ) ? $event_tickets[$ticket_id] : []; + $ticket_custom_categories = isset( $event_ticket['category_ids'] ) && !empty( $event_ticket['category_ids'] ) ? (array)$event_ticket['category_ids'] : []; + if( false == $ticket_sales_with_wooCommerce_product && !empty( $ticket_custom_categories ) ){ + + foreach($ticket_custom_categories as $k => $category_id){ + + $ticket_custom_categories[$k] = intval($category_id); + } + + wp_set_object_terms($post_id, $ticket_custom_categories, 'product_cat', true); + } + + foreach( $variations as $variation ) { + + $variation_data[] = [ + 'MEC_WOO_V_max' => @$variation['max'], + 'MEC_WOO_V_title' => $variation['description'], + 'MEC_WOO_V_price' => $variation['price'], + 'MEC_WOO_V_count' => $variation['count'], + ]; + + add_post_meta($post_id, 'MEC_Variation_Data', json_encode($variation_data , JSON_UNESCAPED_UNICODE )); + } + + return $post_id; + } + + public function create_fee_product( $fee_detail, $related_products = array(), $update = false ) { + + $fee_amount = $fee_detail['amount']; + $fee_description = $fee_detail['description']; + $fee_type = $fee_detail['fee_type']; + $fee_product_id = $fee_detail['product_id'] ?? 0; + + $fee_sale_amount = $this->get_partial_payment_amount( $fee_amount ); + + $args = array( + 'product_title' => "$fee_description - {$this->transaction_id}", + 'meta_input' => array( + '_regular_price' => $fee_amount, + '_sale_price' => $fee_sale_amount, + '_price' => $fee_sale_amount, + + 'ticket_used_count' => 1, + 'm_product_type' => $fee_type, + 'related_products' => $related_products + ), + ); + + if( $update && $fee_product_id ) { + + $args['ID'] = $fee_product_id; + } + + $post_id = $this->create_product( $args ); + + return $post_id; + } + + public static function upgrade_db() { + + $books = get_posts(array( + 'post_type' => 'mec-books', + 'posts_per_page' => 100, + 'fields' => 'ids', + 'meta_query' => array( + array( + 'key' => 'mec_transaction_upgraded', + 'compare' => 'NOT EXISTS', + ) + ) + )); + + if( 0 === count( $books ) ) { + + update_option( 'mec_transaction_version', MEC_VERSION ); + return; + } + + add_filter( 'mec_transaction_get_event_fees', array( __CLASS__, 'filter_transaction_get_event_fees' ), 10, 3 ); + + $transaction_ids = []; + foreach( $books as $book_id ) { + + $transaction_ids[ $book_id ] = get_post_meta( $book_id, 'mec_transaction_id', true ); + } + + foreach( $transaction_ids as $book_id => $transaction_id ) { + + update_post_meta( $book_id, 'mec_transaction_upgraded', 'yes' ); + + $transaction = get_option( $transaction_id, false ); + if( !$transaction ) { + continue; + } + + if( isset( $transaction['old_tickets'] ) ){ + + $transaction['tickets'] = $transaction['old_tickets']; + }else{ + + $transaction['old_tickets'] = $transaction['tickets']; + } + + if( !isset( $transaction['booking_id'] ) ){ + + $transaction['booking_id'] = $book_id; + } + + if( !isset( $transaction['event_id'] ) ){ + + $transaction['booking_id'] = $book_id; + } + + if( !isset( $transaction['gateway'] ) ){ + + $gateway = get_post_meta( $book_id, 'mec_gateway', true ); + $transaction['gateway'] = !empty( $gateway ) ? $gateway : 'MEC_gateway_pay_locally'; + } + + if( !isset( $transaction['applied_fee'] ) ){ + + $has_fee = in_array( + 'fee', + array_column( $transaction['price_details']['details'] ?? array(), 'type' ) + ); + + $transaction['applied_fee'] = $has_fee; + } + + if( !isset( $transaction['applied_discount'] ) && $transaction['discount'] ){ + + $has_discount = in_array( + 'discount', + array_column( $transaction['price_details']['details'] ?? array(), 'type' ) + ); + + $transaction['applied_discount'] = $has_discount; + } + + if( isset( $transaction['tickets'][0]['_name'] ) ){ + + $book = new \MEC_book(); + $attendees = $book->get_attendees( $book_id ); + if( count( $attendees ) !== count( $transaction['tickets'] ) ) { + + $transaction['tickets'] = $attendees; + } + + if( isset( $transaction['tickets'][0]['date'] ) ){ + + $ticket_date = false; + $new_tickets = []; + foreach( $transaction['old_tickets'] as $old_ticket ) { + + if( $ticket_date && $ticket_date !== $old_ticket['date'] ) { + + continue; + } + + if( !$ticket_date ) { + + $ticket_date = $old_ticket['date']; + } + + $ticket = $old_ticket; + + unset( $ticket['date'] ); + unset( $ticket['product_id'] ); + + $ticket['count'] = 1; + + $new_tickets[] = $ticket; + } + + $transaction['tickets'] = $new_tickets; + } + + foreach( $transaction['tickets'] as $k => $ticket ) { + + $ticket; + $attendee_name = $ticket['_name']; + unset( $ticket['_name'] ); + unset( $ticket['date'] ); + if( !empty( $attendee_name ) ) { + + $ticket['name'] = $attendee_name; + } + + $transaction['tickets'][ $k ] = $ticket; + } + } + + $woo_order_id = get_post_meta( $book_id, 'mec_order_id', true ); + $transaction['order_id'] = $woo_order_id; //TODO: add in + + if( $woo_order_id ) { + + $transaction['wc'] = true; + } + + $total = $transaction['total'] ?? 0; + $payable = $transaction['payable'] ?? 0; + if( $total < $payable ) { + + $transaction['total'] = $payable; + $transaction['payable'] = $total; + }else{ + + // $transaction['total'] = $total; + // $transaction['payable'] = $payable; + } + + + update_option( $transaction_id, $transaction, false ); + + $total = $transaction['total'] ?? 0; + $payable = $transaction['payable'] ?? $total; + + $transactionObject = new \MEC\Transactions\Transaction( $transaction_id ); + if( + $transactionObject->get_subtotal() != $total + || + $transactionObject->get_total() != $payable + ) { + + /* + error_log( "Transaction error {$book_id}-{$transaction_id}"); + echo '
    ';
    +					var_dump( $book_id );
    +					var_dump($transactionObject->get_subtotal() . '!=' . $transaction['total']);
    +					var_dump($transactionObject->get_total() . '!=' . $transaction['payable']);
    +					echo ''. $book_id .'
    ' ; + echo ' delete '. $book_id .'
    ' ; + echo '


    '; + print_r($transactionObject->get_all_occurrences_details()); + wp_die(print_r($transaction)); + */ + } else { + + $transactionObject->update_cache_tickets_details(); + } + } + } + + public static function filter_transaction_get_event_fees( $fees, $event_id, $class ) { + + $transaction = $class->get_saved_data(); + $saved_fees = array_filter( $transaction['price_details']['details'], function( $a ){ + + return $a['type'] === 'fee'; + }); + $saved_fees = array_values( $saved_fees ); + $saved_fees_titles = array_column( $saved_fees, 'description' ); + + foreach( $fees as $k => $fee ) { + + $index = array_search( $fee['title'], $saved_fees_titles ); + if( false !== $index ){ + + $fees[ $k ]['type'] = $saved_fees[ $index ]['fee_type']; + $fees[ $k ]['amount'] = $saved_fees[ $index ]['fee_amount']; + } else { + + unset( $fees[ $k ] ); + } + } + + return $fees; + } + + public function get_mec_coupon_detail( $coupon ) { + + $coupon_details = []; + $term = get_term_by( 'name', $coupon, 'mec_coupon' ); + $coupon_id = isset($term->term_id) ? $term->term_id : 0; + $maximum_discount = get_metadata('term', $coupon_id, 'maximum_discount', true); + if ( $coupon_id ) { + + $coupon_details['coupon_id'] = $coupon_id; + $coupon_details['discount_type'] = get_term_meta($coupon_id, 'discount_type', true); + $coupon_details['discount'] = get_term_meta($coupon_id, 'discount', true); + $coupon_details['maximum_discount'] = $maximum_discount; + } + + return $coupon_details; + } + + public function has_100percent_coupon(){ + + $coupon = $this->get_coupon(); + $coupon_details = $this->get_mec_coupon_detail( $coupon ); + + $discount_type = $coupon_details['discount_type'] ?? false; + $discount = $coupon_details['discount'] ?? false; + + if( 'percent' === $discount_type && 100 == $discount ) { + + return true; + } + + return false; + } + + public function apply_100percent_coupon_to_all_fees() { + + return \MEC\Settings\Settings::getInstance()->get_settings('coupons_apply_100percent_to_all'); + } +} diff --git a/app/core/src/Transactions/index.php b/app/core/src/Transactions/index.php new file mode 100755 index 0000000..9d7a83d --- /dev/null +++ b/app/core/src/Transactions/index.php @@ -0,0 +1,5 @@ + + */ +class MEC_feature_admincalendar extends MEC_base +{ + public $factory; + public $main; + public $settings; + public $status; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Factory + $this->factory = $this->getFactory(); + + // Import MEC Main + $this->main = $this->getMain(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + + // Admin Calendar Status + $this->status = (isset($_GET['adminview']) and $_GET['adminview'] === 'calendar'); + } + + /** + * Initialize admin calendar feature + * @author Webnus + */ + public function init() + { + // Disabled? + if(!isset($this->settings['admin_calendar']) or (isset($this->settings['admin_calendar']) and !$this->settings['admin_calendar'])) return; + + // Admin Calendar + $this->factory->action('admin_head-edit.php', [$this, 'output']); + + // Assets + if($this->status) $this->factory->action('admin_enqueue_scripts', [$this, 'assets'], 0); + } + + public function output() + { + global $current_screen; + + // Add it only on Event Page + if('mec-events' != $current_screen->post_type) return; + + if($this->status) + { + $HTML = $this->getRender()->vmonth(['sk-options' => ['monthly_view' => ['style' => 'admin']]]); + $this->factory->params('footer', function() use($HTML) + { + ?> + + + factory->params('footer', function() + { + ?> + + main->asset('js/admin-calendar.js'), ['jquery'], $this->main->get_version()); + + // Style + wp_enqueue_style('mec-admin-calendar-style', $this->main->asset('css/admin-calendar.min.css'), ['mec-backend-style'], $this->main->get_version()); + } +} \ No newline at end of file diff --git a/app/features/adminupcoming.php b/app/features/adminupcoming.php new file mode 100755 index 0000000..ee842f5 --- /dev/null +++ b/app/features/adminupcoming.php @@ -0,0 +1,145 @@ + + */ +class MEC_feature_adminupcoming extends MEC_base +{ + public $factory; + public $main; + public $settings; + public $status; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Factory + $this->factory = $this->getFactory(); + + // Import MEC Main + $this->main = $this->getMain(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + + // Admin Calendar Status + $this->status = (isset($_GET['adminview']) and $_GET['adminview'] === 'upcoming'); + } + + /** + * Initialize admin upcoming feature + * @author Webnus + */ + public function init() + { + // Temporary + return; + + // Disabled? + if(!isset($this->settings['admin_upcoming_events']) || !$this->settings['admin_upcoming_events']) return; + + // Admin Upcoming List + $this->factory->action('admin_head-edit.php', array($this, 'output')); + + // Assets + if($this->status) $this->factory->action('admin_enqueue_scripts', array($this, 'assets'), 0); + + // Download Bookings + if(isset($_GET['mec-dl-bookings']) && $_GET['mec-dl-bookings']) $this->factory->action('init', [$this, 'download_bookings']); + } + + public function output() + { + global $current_screen; + + // Add it only on Event Page + if('mec-events' != $current_screen->post_type) return; + + if($this->status) + { + $HTML = $this->getRender()->vlist([ + 'sk-options' => ['list' => [ + 'style' => 'admin', + 'month_divider' => 0, + 'include_events_times' => 1, + 'pagination' => 'loadmore', + ]] + ]); + + $this->factory->params('footer', function() use($HTML) + { + ?> + + factory->params('footer', function() + { + ?> + + main->asset('js/admin-upcoming.js'), array('jquery'), $this->main->get_version()); + + // Style + wp_enqueue_style('mec-admin-upcoming', $this->main->asset('css/admin-upcoming.min.css'), array('mec-backend-style'), $this->main->get_version()); + } + + public function download_bookings() + { + // Not logged in? + if(!get_current_user_id()) return; + + // Check Capability + $capability = (current_user_can('administrator') ? 'manage_options' : 'mec_bookings'); + if(!current_user_can($capability)) return; + + $event_id = $_GET['event_id'] ?? 0; + $occurrence = $_GET['occurrence'] ?? 0; + + // Invalid Data + if(!$event_id or !$occurrence) return; + + // Bookings + $bookings = $this->main->get_bookings_by_event_occurrence($event_id, $occurrence); + + // No booking + if(!count($bookings)) return; + + $booking_ids = []; + foreach($bookings as $booking) $booking_ids[] = $booking->ID; + + $filename = 'bookings-' . md5(time() . mt_rand(100, 999)) . '.csv'; + + $book = new MEC_feature_books(); + $rows = $book->csvexcel($booking_ids); + + $this->main->generate_download_csv($rows, $filename); + + exit; + } +} \ No newline at end of file diff --git a/app/features/archive.php b/app/features/archive.php new file mode 100755 index 0000000..6ad000b --- /dev/null +++ b/app/features/archive.php @@ -0,0 +1,49 @@ + + */ +class MEC_feature_archive extends MEC_base +{ + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + } + + /** + * Initialize search feature + * @author Webnus + */ + public function init() + { + // Main + $main = $this->getMain(); + + // Settings + $settings = $main->get_settings(); + + // Sidebar Status + $sidebar_status = (boolean) ($settings['archive_sidebar'] ?? 0); + + if($sidebar_status) + { + add_action( 'widgets_init', function() + { + register_sidebar([ + 'name' => __( 'MEC Archive', 'modern-events-calendar-lite'), + 'id' => 'mec-archive', + 'description' => __('Widgets in this area will be shown on archive pages.', 'modern-events-calendar-lite'), + 'before_widget' => '', + 'after_widget' => '', + 'before_title' => '', + 'after_title' => '', + ]); + }); + } + } +} \ No newline at end of file diff --git a/app/features/autoemails.php b/app/features/autoemails.php new file mode 100755 index 0000000..aa906ea --- /dev/null +++ b/app/features/autoemails.php @@ -0,0 +1,162 @@ + + */ +class MEC_feature_autoemails extends MEC_base +{ + public $factory; + public $main; + public $PT; + public $settings; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Factory + $this->factory = $this->getFactory(); + + // Import MEC Main + $this->main = $this->getMain(); + + // MEC Email Post Type Name + $this->PT = $this->main->get_email_post_type(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + } + + /** + * Initialize Auto Email feature + * @author Webnus + */ + public function init() + { + // PRO Version is required + if(!$this->getPRO()) return false; + + // Show Auto Email feature only if module is enabled + if(!isset($this->settings['auto_emails_module_status']) or (isset($this->settings['auto_emails_module_status']) and !$this->settings['auto_emails_module_status'])) return false; + + $this->factory->action('init', array($this, 'register_post_type')); + $this->factory->action('save_post', array($this, 'save_email'), 10); + $this->factory->action('add_meta_boxes', array($this, 'register_meta_boxes'), 1); + + return true; + } + + /** + * Registers email post type + * @author Webnus + */ + public function register_post_type() + { + $singular_label = esc_html__('Email', 'modern-events-calendar-lite'); + $plural_label = esc_html__('Emails', 'modern-events-calendar-lite'); + + $capability = 'manage_options'; + register_post_type($this->PT, + array( + 'labels'=>array + ( + 'name'=>$plural_label, + 'singular_name'=>$singular_label, + 'add_new'=>sprintf(esc_html__('Add %s', 'modern-events-calendar-lite'), $singular_label), + 'add_new_item'=>sprintf(esc_html__('Add %s', 'modern-events-calendar-lite'), $singular_label), + 'not_found'=>sprintf(esc_html__('No %s found!', 'modern-events-calendar-lite'), strtolower($plural_label)), + 'all_items'=>$plural_label, + 'edit_item'=>sprintf(esc_html__('Edit %s', 'modern-events-calendar-lite'), $plural_label), + 'not_found_in_trash'=>sprintf(esc_html__('No %s found in Trash!', 'modern-events-calendar-lite'), strtolower($singular_label)) + ), + 'public'=>false, + 'show_ui'=>(current_user_can($capability) ? true : false), + 'show_in_menu'=>false, + 'show_in_admin_bar'=>false, + 'show_in_nav_menus'=>false, + 'has_archive'=>false, + 'exclude_from_search'=>true, + 'publicly_queryable'=>false, + 'supports'=>array('title', 'editor'), + 'capabilities'=>array + ( + 'read'=>$capability, + 'read_post'=>$capability, + 'read_private_posts'=>$capability, + 'create_post'=>$capability, + 'create_posts'=>$capability, + 'edit_post'=>$capability, + 'edit_posts'=>$capability, + 'edit_private_posts'=>$capability, + 'edit_published_posts'=>$capability, + 'edit_others_posts'=>$capability, + 'publish_posts'=>$capability, + 'delete_post'=>$capability, + 'delete_posts'=>$capability, + 'delete_private_posts'=>$capability, + 'delete_published_posts'=>$capability, + 'delete_others_posts'=>$capability, + ), + ) + ); + } + + /** + * Registers meta boxes + * @author Webnus + */ + public function register_meta_boxes() + { + add_meta_box('mec_email_metabox_details', esc_html__('Details', 'modern-events-calendar-lite'), array($this, 'meta_box_details'), $this->PT, 'normal', 'high'); + } + + public function meta_box_details($post) + { + $path = MEC::import('app.features.emails.details', true, true); + + ob_start(); + include $path; + echo MEC_kses::full(ob_get_clean()); + } + + /** + * Save email data from backend + * @author Webnus + * @param int $post_id + * @return void + */ + public function save_email($post_id) + { + // Check if our nonce is set. + if(!isset($_POST['mec_email_nonce'])) return; + + // Verify that the nonce is valid. + if(!wp_verify_nonce(sanitize_text_field($_POST['mec_email_nonce']), 'mec_email_data')) return; + + // If this is an autosave, our form has not been submitted, so we don't want to do anything. + if(defined('DOING_AUTOSAVE') and DOING_AUTOSAVE) return; + + // MEC Data + $mec = (isset($_POST['mec']) and is_array($_POST['mec'])) ? $this->main->sanitize_deep_array($_POST['mec']) : []; + + // All Options + update_post_meta($post_id, 'mec', $mec); + + update_post_meta($post_id, 'mec_time', (isset($mec['time']) ? sanitize_text_field($mec['time']) : 1)); + update_post_meta($post_id, 'mec_type', (isset($mec['type']) ? sanitize_text_field($mec['type']) : 'day')); + update_post_meta($post_id, 'mec_afterbefore', (isset($mec['afterbefore']) ? sanitize_text_field($mec['afterbefore']) : 'before')); + + $events = (isset($mec['events']) and is_array($mec['events']) and count($mec['events'])) ? array_map('sanitize_text_field', wp_unslash($mec['events'])) : []; + + $all = (isset($mec['all']) ? sanitize_text_field($mec['all']) : 1); + if($all) $events = []; + + update_post_meta($post_id, 'mec_all', $all); + update_post_meta($post_id, 'mec_events', $events); + } +} \ No newline at end of file diff --git a/app/features/booking/calendar_novel.php b/app/features/booking/calendar_novel.php new file mode 100755 index 0000000..33114cb --- /dev/null +++ b/app/features/booking/calendar_novel.php @@ -0,0 +1,198 @@ +dates ?? array($event->date); + +// Multiple Day Event +$multiple_date = (isset($dates) && $dates[0]['start']['date'] != $dates[0]['end']['date']) ? 'mec-multiple-event' : ''; + +$first_date = ($start ?? (isset($dates[0]) ? $dates[0]['start']['date'] : NULL)); +if(!$first_date) return; + +$selected_datetime = ($selected_datetime ?? $this->book->timestamp($dates[0]['start'], $dates[0]['end'])); + +// Settings +$settings = $this->main->get_settings(); +$ml_settings = $this->main->get_ml_settings(); + +// Is Booking Enabled for Ongoing Events +$booking_ongoing = (isset($settings['booking_ongoing']) and $settings['booking_ongoing']); + +// Options +$event_color = $this->main->get_event_color_dot($event); +$allday = isset($event->data->meta['mec_allday']) ? $event->data->meta['mec_allday'] : 0; +$date_format = (isset($ml_settings['booking_date_format1']) and trim($ml_settings['booking_date_format1'])) ? $ml_settings['booking_date_format1'] : 'Y-m-d'; +$date_format = trim(str_replace(['H', 'h', 'i', 's', 'A', 'a', 'G', 'g', 'B', 'u', 'v', ':'], '', $date_format), ': '); +$time_format = get_option('time_format'); + +// before/after Month +$_1month_before = strtotime('first day of -1 month', strtotime($first_date)); +$_1month_after = strtotime('first day of +1 month', strtotime($first_date)); +$current_month_time = strtotime($first_date); + +$year = date('Y', strtotime($first_date)); +$month = date('m', strtotime($first_date)); +$active_day = date('d', strtotime($first_date)); + +// Start day of week +$week_start = $this->main->get_first_day_of_week(); + +// days and weeks vars +$running_day = date('w', mktime(0, 0, 0, $month, 1, $year)); +$days_in_month = date('t', mktime(0, 0, 0, $month, 1, $year)); +$days_in_previous_month = $this->main->get_days_in_previous_month($month, $year); + +$days_in_this_week = 1; +$day_counter = 0; + +if($week_start == 1) // Monday +{ + if($running_day != 0) $running_day = $running_day - 1; + else $running_day = 6; +} +elseif($week_start == 6) // Saturday +{ + if($running_day != 6) $running_day = $running_day + 1; + else $running_day = 0; +} +elseif($week_start == 5) // Friday +{ + if($running_day < 4) $running_day = $running_day + 2; + elseif($running_day == 5) $running_day = 0; + elseif($running_day == 6) $running_day = 1; +} + +$navigator_html = ''; + +// Show previous navigation +if(strtotime(date('Y-m-t', $_1month_before)) >= time()) +{ + $navigator_html .= ''; +} + +$navigator_html .= '

    '.esc_html($this->main->date_i18n('F Y', $current_month_time)).'

    '; + +// Show next navigation +if(strtotime(date('Y-m-01', $_1month_after)) >= time()) +{ + $navigator_html .= ''; +} + +// Generating javascript code tpl +$javascript = ''; + +// Include javascript code into the page +echo MEC_kses::full($javascript); +?> +
    +
    +
    + main->get_weekday_abbr_labels(); + echo '
    '.implode('
    ', $headings).'
    '; + ?> +
    + '.($days_in_previous_month - ($running_day-1-$x)).''; + $days_in_this_week++; + } + + // keep going with days .... + for($list_day = 1; $list_day <= $days_in_month; $list_day++) + { + $time = strtotime($year.'-'.$month.'-'.$list_day); + $today = date('Y-m-d', $time); + $day_id = date('Ymd', $time); + + $render = ''; + $first_day = ''; + $default_day = ''; + $middle_day = ''; + $last_day = ''; + $repeat = 0; + $is_soldout = true; + + foreach($dates as $date) + { + if(!isset($date['fake']) and strtotime($date['start']['date']) <= $time and $time <= strtotime($date['end']['date']) and ($booking_ongoing or (isset($date['start']['timestamp']) and $date['start']['timestamp'] >= current_time('timestamp', 0)))) + { + $repeat++; + $date_timestamp = $this->book->timestamp($date['start'], $date['end']); + $start_datetime = $date['start']['date'].' '.sprintf("%02d", $date['start']['hour']).':'.sprintf("%02d", $date['start']['minutes']).' '.$date['start']['ampm']; + $date_timestamp_ex = explode(':', $date_timestamp); + + $soldout = $this->main->is_soldout($event->ID, $start_datetime); + if($is_soldout and !$soldout) $is_soldout = false; + + $render .='
    ' .(($date['start']['date'] !== $date['end']['date']) ? '
    '.strip_tags($this->main->date_label($date['start'], $date['end'], $date_format, ' - ', false, (isset($date['allday']) ? $date['allday'] : 0), $event)).'
    ' : ($allday != 0 ? esc_html__('All Day' , 'modern-events-calendar-lite') : '')).strip_tags($this->main->date_label($date['start'], $date['end'], $time_format, ' - ', false, (isset($date['allday']) ? $date['allday'] : 0))).(($date['start']['date'] !== $date['end']['date']) ? '
    ' : '') .'
    '; + $first_day = strtotime($date['start']['date']) == $time ? ' first-day' : null; + $middle_day = (strtotime($date['end']['date']) != $time && strtotime($date['start']['date']) != $time) ? ' middle-day' : null; + $last_day = strtotime($date['end']['date']) == $time ? ' last-day' : null; + $default_day = strtotime($first_date) == $time ? ' mec-active' : null; + } + } + + if($repeat == 1) $date_timestamp_ex = explode(':', $date_timestamp); + + $repeat_class = $repeat > 1 ? ' mec-has-time-repeat' : ''; + $date_for_wrap = $repeat == 1 ? 'data-timestamp="'.esc_attr($date_timestamp).'" data-formatted-date="'.esc_attr($this->main->date_i18n($date_format, $date_timestamp_ex[0])).'"' : ''; + $custom_class1 = $repeat == 1 ? ' mec-has-one-repeat-in-day' : ''; + $custom_class2 = $repeat >= 1 ? ' mec-has-event-for-booking' : ''; + $soldout_class = ($is_soldout ? ' mec-booking-calendar-date-soldout' : ''); + + echo '
    '.$list_day.'
    '; + echo '
    '.MEC_kses::full($render).'
    '; + echo '
    '; + + if($running_day == 6) + { + echo '
    '; + + if((($day_counter+1) != $days_in_month) or (($day_counter+1) == $days_in_month and $days_in_this_week == 7)) + { + echo '
    '; + } + + $running_day = -1; + $days_in_this_week = 0; + } + + $days_in_this_week++; $running_day++; $day_counter++; + } + + // finish the rest of the days in the week + if($days_in_this_week < 8) + { + for($x = 1; $x <= (8 - $days_in_this_week); $x++) + { + echo '
    '.esc_html($x).'
    '; + } + } + ?> +
    +
    +
    +
    \ No newline at end of file diff --git a/app/features/booking/variations.php b/app/features/booking/variations.php new file mode 100755 index 0000000..ca534b6 --- /dev/null +++ b/app/features/booking/variations.php @@ -0,0 +1,23 @@ +main->ticket_variations($event_id); + +// No Variations +if(!is_array($variations) || !count($variations)) return ''; +?> +
    +
      + +
    • +
      +

      main->render_price($variation['price'], $event_id); ?>

      +
    • + +
    +
    \ No newline at end of file diff --git a/app/features/bookingcalendar.php b/app/features/bookingcalendar.php new file mode 100755 index 0000000..f0cd8da --- /dev/null +++ b/app/features/bookingcalendar.php @@ -0,0 +1,138 @@ + + */ +class MEC_feature_bookingcalendar extends MEC_base +{ + /** + * @var MEC_factory + */ + public $factory; + + /** + * @var MEC_main + */ + public $main; + + /** + * @var MEC_book + */ + public $book; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // MEC Factory + $this->factory = $this->getFactory(); + + // MEC Main + $this->main = $this->getMain(); + + // MEC Book + $this->book = $this->getBook(); + } + + /** + * Initialize User Events Feature + * @author Webnus + */ + public function init() + { + $this->factory->action('wp_ajax_mec_booking_calendar_load_month', array($this, 'load_month')); + $this->factory->action('wp_ajax_nopriv_mec_booking_calendar_load_month', array($this, 'load_month')); + } + + public function display_calendar($event, $uniqueid, $start = NULL, $selected_datetime = NULL) + { + $path = MEC::import('app.features.booking.calendar_novel', true, true); + + // Generate Month + ob_start(); + include $path; + return ob_get_clean(); + } + + /** + * Load month for AJAX request + * @author Webnus + * @return void + */ + public function load_month() + { + // Render + $render = $this->getRender(); + + $event_id = isset($_REQUEST['event_id']) ? sanitize_text_field($_REQUEST['event_id']) : NULL; + $uniqueid = isset($_REQUEST['uniqueid']) ? sanitize_text_field($_REQUEST['uniqueid']) : NULL; + $year = isset($_REQUEST['year']) ? sanitize_text_field($_REQUEST['year']) : NULL; + $month = isset($_REQUEST['month']) ? sanitize_text_field($_REQUEST['month']) : NULL; + + // Start Date + $start = $year.'-'.$month.'-01'; + if(strtotime($start) < current_time('timestamp')) $start = current_time('Y-m-d'); + + // End Date + $end = date('Y-m-t', strtotime($start)); + + $rendered = $render->data($event_id, ''); + + $data = new stdClass(); + $data->ID = $event_id; + $data->data = $rendered; + + // Get Event Dates + $records = $this->getDB()->select("SELECT * FROM `#__mec_dates` WHERE `post_id`='".$event_id."' AND ((`dstart` <= '".$start."' AND `dend` >= '".$end."') OR (`dstart` <= '".$start."' AND `dend` >= '".$start."' AND `dend` <= '".$end."') OR (`dstart` >= '".$start."' AND `dend` <= '".$end."') OR (`dstart` >= '".$start."' AND `dstart` <= '".$end."' AND `dend` >= '".$end."'))", 'loadAssocList'); + + $dates = []; + foreach($records as $record) + { + $dates[] = array( + 'start' => array( + 'date' => $record['dstart'], + 'hour' => date('g', $record['tstart']), + 'minutes' => date('i', $record['tstart']), + 'ampm' => date('A', $record['tstart']), + 'timestamp' => $record['tstart'], + ), + 'end' => array( + 'date' => $record['dend'], + 'hour' => date('g', $record['tend']), + 'minutes' => date('i', $record['tend']), + 'ampm' => date('A', $record['tend']), + 'timestamp' => $record['tend'], + ), + 'allday' => ((isset($data->data->meta) and isset($data->data->meta->mec_allday)) ? $data->data->meta->mec_allday : 0), + 'hide_time' => ((isset($data->data->meta) and isset($data->data->meta->mec_hide_time)) ? $data->data->meta->mec_hide_time : 0), + 'past' => $this->main->is_past($record['dstart'], $start), + ); + } + + if(!count($dates)) + { + $dates = array( + array( + 'fake' => true, + 'start' => array( + 'date' => $start + ), + 'end' => array( + 'date' => $start + ), + ) + ); + } + + $data->dates = $dates; + $data->date = isset($data->dates[0]) ? $data->dates[0] : []; + + echo json_encode(array('html' => $this->display_calendar($data, $uniqueid, $start))); + exit; + } +} \ No newline at end of file diff --git a/app/features/cart.php b/app/features/cart.php new file mode 100755 index 0000000..b3732b1 --- /dev/null +++ b/app/features/cart.php @@ -0,0 +1,192 @@ + + */ +class MEC_feature_cart extends MEC_base +{ + public $factory; + public $main; + public $cart; + public $book; + public $settings; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Factory + $this->factory = $this->getFactory(); + + // Import MEC Main + $this->main = $this->getMain(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + + // Import MEC Cart + $this->cart = $this->getCart(); + + // Import MEC Booking + $this->book = $this->getBook(); + } + + /** + * Initialize Cart Feature + * @author Webnus + */ + public function init() + { + // Cart Status + $cart_status = (isset($this->settings['mec_cart_status']) and $this->settings['mec_cart_status']) ? true : false; + + // Feature is not enabled + if(!$cart_status) return; + + // Shortcodes + $this->factory->shortcode('mec-cart', array($this, 'cart')); + $this->factory->shortcode('mec-checkout', array($this, 'checkout')); + + // Remove Transaction from Cart + $this->factory->action('wp_ajax_mec_cart_remove_transaction', array($this, 'remove')); + $this->factory->action('wp_ajax_nopriv_mec_cart_remove_transaction', array($this, 'remove')); + + // Apply Coupon + $this->factory->action('wp_ajax_mec_cart_coupon', array($this, 'coupon')); + $this->factory->action('wp_ajax_nopriv_mec_cart_coupon', array($this, 'coupon')); + + // Free Checkout + $this->factory->action('wp_ajax_mec_do_cart_free', array($this, 'free')); + $this->factory->action('wp_ajax_nopriv_mec_do_cart_free', array($this, 'free')); + } + + public function cart($atts) + { + $path = MEC::import('app.features.cart.cart', true, true); + + ob_start(); + include $path; + return $output = ob_get_clean(); + } + + public function checkout($atts) + { + $path = MEC::import('app.features.cart.checkout', true, true); + + ob_start(); + include $path; + return $output = ob_get_clean(); + } + + public function remove() + { + $transaction_id = isset($_REQUEST['transaction_id']) ? sanitize_text_field($_REQUEST['transaction_id']) : NULL; + + $cart_id = $this->cart->get_cart_id(); + $cart = $this->cart->get_cart($cart_id); + + // Validation + if(!in_array($transaction_id, $cart)) wp_send_json(array('success' => 0, 'message' => esc_html__('Transaction does not exists in cart.', 'modern-events-calendar-lite'))); + + // Remove + $this->cart->remove($transaction_id); + + // Updated Cart + $updated_cart = $this->cart->get_cart($cart_id); + + // Total + $total = 0; + foreach($updated_cart as $t_id) + { + $TO = $this->book->get_TO($t_id); + $total += $TO->get_payable(); + } + + // Response + wp_send_json(array( + 'success' => 1, + 'total' => $this->main->render_price($total), + 'message' => esc_html__('Successfully removed and updated the cart.', 'modern-events-calendar-lite'), + )); + } + + public function coupon() + { + $coupon = isset($_REQUEST['coupon']) ? sanitize_text_field($_REQUEST['coupon']) : NULL; + + $cart_id = $this->cart->get_cart_id(); + $cart = $this->cart->get_cart($cart_id); + + $applied = false; + foreach($cart as $transaction_id) + { + $TO = $this->book->get_TO($transaction_id); + + // Free Transaction + if($TO->is_free()) continue; + + $validity = $this->book->coupon_check_validity($coupon, $TO->get_event_id(), $TO->get_array()); + if($validity == 1) + { + $applied = true; + $this->book->coupon_apply($coupon, $transaction_id); + } + } + + // Response + if($applied) + { + wp_send_json(array( + 'success' => 1, + 'message' => esc_html__('Coupon applied successfully. Please wait ...', 'modern-events-calendar-lite'), + )); + } + else + { + wp_send_json(array( + 'success' => 0, + 'message' => esc_html__('Coupon was not valid or applicable.', 'modern-events-calendar-lite'), + )); + } + } + + public function free() + { + $cart_id = isset($_POST['cart_id']) ? sanitize_text_field($_POST['cart_id']) : ''; + + // Verify that the nonce is valid. + if(!wp_verify_nonce(sanitize_text_field($_POST['_wpnonce']), 'mec_cart_form_' . $cart_id)) + { + wp_send_json(array( + 'success' => 0, + 'code' => 'NONCE_IS_INVALID', + 'message' => esc_html__('Request is invalid!', 'modern-events-calendar-lite'), + )); + } + + $cart = $this->cart->get_cart($cart_id); + if(!$this->cart->is_free($cart)) + { + wp_send_json(array( + 'success' => 0, + 'code' => 'NOT_FREE', + 'message' => esc_html__('Your cart is not free!', 'modern-events-calendar-lite'), + )); + } + + $free_gateway = new MEC_gateway_free(); + $results = $free_gateway->cart_do_transaction($cart_id); + + $results['output'] = '

    ' . esc_html__('Thanks for your booking.', 'modern-events-calendar-lite') . '

    +
    +
    ' . MEC_kses::element($results['message']) . '
    +
    '; + + wp_send_json($results); + } +} \ No newline at end of file diff --git a/app/features/cart/cart.php b/app/features/cart/cart.php new file mode 100755 index 0000000..d41d1c4 --- /dev/null +++ b/app/features/cart/cart.php @@ -0,0 +1,95 @@ +cart->get_cart_id(); +$cart = $this->cart->get_cart($cart_id); + +// Javascript Code +$javascript = ''; + +// Include javascript code into the footer +$this->factory->params('footer', $javascript); + +// Events Archive +$archive_url = $this->main->get_archive_url(); +?> +
    + +
    +

    + +
    + +
    + +
    + + + + + + + + + + + + + + + book->get_TO($transaction_id); ?> + + + + + + + + + + + + + + + + +
    + + get_coupon() ? '
    '.esc_html($TO->get_coupon()).'' : ''); ?> +
    get_event_featured_image()); ?>get_event_link()); ?>get_tickets_html()); ?>get_dates_html()); ?> + get_price_html()); ?> +
    get_price_details_html()); ?>
    +
    main->render_price($this->cart->get_payable($cart))); ?>
    +
    + + settings['coupons_status']) and $this->settings['coupons_status']): ?> +
    +
    + + +
    +
    +
    + + + settings['checkout_page']) and $this->settings['checkout_page']): ?> +
    + +
    + +
    + + +
    \ No newline at end of file diff --git a/app/features/cart/checkout.php b/app/features/cart/checkout.php new file mode 100755 index 0000000..6751d57 --- /dev/null +++ b/app/features/cart/checkout.php @@ -0,0 +1,164 @@ +cart->get_cart_id(); +$cart = $this->cart->get_cart($cart_id); + +$empty = (count($cart) ? false : true); +$free = $this->cart->is_free($cart); + +$gateways = $this->main->get_gateways(); +$gateway_settings = $this->main->get_gateways_options(); + +$fees_disabled_gateways = isset( $this->settings['fees_disabled_gateways'] ) && is_array( $this->settings['fees_disabled_gateways'] ) ? $this->settings['fees_disabled_gateways'] : []; +$total_fees_prices_for_disabled_gateways = []; + +$active_gateways = []; +foreach($gateways as $gateway) +{ + if(!$gateway->enabled()) continue; + if(in_array($gateway->id, array(6, 7))) continue; // Stripe Connect & Pay By WooCommerce + + $active_gateways[] = $gateway; +} + +// Javascript Code +$javascript = ''; + +// Redirect Cart ID +$redirect_cart_id = isset($_REQUEST['mec_stripe_redirect_cart_id']) ? $_REQUEST['mec_stripe_redirect_cart_id'] : ''; + +$redirect_message = ''; +if(trim($redirect_cart_id)) +{ + $redirect_message = get_option('mec_cart_'.$redirect_cart_id.'_message', ''); + delete_option('mec_cart_'.$redirect_cart_id.'_message'); +} + +// Include javascript code into the footer +$this->factory->params('footer', $javascript); +?> +
    +
    +
    + + +
    +
    +
    + + + +

    + + id ] = 0; + ?> +
    +
      + book->get_TO($transaction_id); $price_details = $TO->get_price_details(); ?> + id; ?> +
    • + $detail){ + + if( 'fee' === $detail['type'] ){ + + $ticket_price -= $detail['amount']; + $total_fees_prices_for_disabled_gateways[ $gateway->id ] += $detail['amount']; + unset( $price_details['details'][ $k ] ); + } + } + } + ?> +

      get_event_link()); ?> (main->render_price( $ticket_price > 0 ? $ticket_price : 0 , $TO->get_event_id())); ?>)

      +
      get_tickets_html()); ?>
      +
        + +
      • + + main->render_price($detail['amount'], $TO->get_event_id())); ?> +
      • + +
      + +
    • + +
    +
    + + + + +
    +
    \ No newline at end of file diff --git a/app/features/cart/index.html b/app/features/cart/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/features/certificates.php b/app/features/certificates.php new file mode 100755 index 0000000..463d5e1 --- /dev/null +++ b/app/features/certificates.php @@ -0,0 +1,310 @@ + + */ +class MEC_feature_certificates extends MEC_base +{ + public $factory; + public $main; + public $settings; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Factory + $this->factory = $this->getFactory(); + + // Import MEC Main + $this->main = $this->getMain(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + } + + /** + * Initialize Auto Email feature + * @author Webnus + */ + public function init() + { + // PRO Version is required + if(!$this->getPRO()) return false; + + // Show certificate feature only if module is enabled + if(!isset($this->settings['certificate_status']) || !$this->settings['certificate_status']) return false; + + $this->factory->action('init', [$this, 'register_post_type']); + $this->factory->filter('template_include', [$this, 'include_cert_template']); + + $this->factory->shortcode('mec_cert_event_title', [$this, 'shortcode_event_title']); + $this->factory->shortcode('mec_cert_event_date', [$this, 'shortcode_event_date']); + $this->factory->shortcode('mec_cert_attendee_name', [$this, 'shortcode_attendee_name']); + $this->factory->shortcode('mec_cert_attendee_id', [$this, 'shortcode_attendee_id']); + $this->factory->shortcode('mec_cert_transaction_id', [$this, 'shortcode_transaction_id']); + $this->factory->shortcode('mec_cert_ticket_id', [$this, 'shortcode_ticket_id']); + $this->factory->shortcode('mec_cert_ticket_name', [$this, 'shortcode_ticket_name']); + + $this->factory->action('wp_ajax_mec_send_certificates', [$this, 'send_certificates']); + + return true; + } + + /** + * Registers certificate post type + * @author Webnus + */ + public function register_post_type() + { + $singular_label = esc_html__('Certificate', 'modern-events-calendar-lite'); + $plural_label = esc_html__('Certificates', 'modern-events-calendar-lite'); + + $capability = 'manage_options'; + register_post_type($this->main->get_certificate_post_type(), array( + 'labels' => array( + 'name' => $plural_label, + 'singular_name' => $singular_label, + 'add_new' => sprintf(esc_html__('Add %s', 'modern-events-calendar-lite'), $singular_label), + 'add_new_item' => sprintf(esc_html__('Add %s', 'modern-events-calendar-lite'), $singular_label), + 'not_found' => sprintf(esc_html__('No %s found!', 'modern-events-calendar-lite'), strtolower($plural_label)), + 'all_items' => $plural_label, + 'edit_item' => sprintf(esc_html__('Edit %s', 'modern-events-calendar-lite'), $plural_label), + 'not_found_in_trash' => sprintf(esc_html__('No %s found in Trash!', 'modern-events-calendar-lite'), strtolower($singular_label)) + ), + 'public' => true, + 'show_ui'=> current_user_can($capability), + 'show_in_menu' => false, + 'show_in_admin_bar' => false, + 'show_in_nav_menus' => false, + 'has_archive' => false, + 'exclude_from_search' => true, + 'publicly_queryable' => true, + 'supports' => array('title', 'editor'), + 'capabilities' => array( + 'read' => $capability, + 'read_post' => $capability, + 'read_private_posts' => $capability, + 'create_post' => $capability, + 'create_posts' => $capability, + 'edit_post' => $capability, + 'edit_posts' => $capability, + 'edit_private_posts' => $capability, + 'edit_published_posts' => $capability, + 'edit_others_posts' => $capability, + 'publish_posts' => $capability, + 'delete_post' => $capability, + 'delete_posts' => $capability, + 'delete_private_posts' => $capability, + 'delete_published_posts' => $capability, + 'delete_others_posts' => $capability, + ), + )); + } + + /** + * @param $template + * @return mixed|string + */ + public function include_cert_template($template) + { + // Get global post + global $post; + + // Certificate Post + if($post && isset($post->post_type) && $post->post_type === $this->main->get_certificate_post_type()) + { + $template = $this->main->get_plugin_path().'app'.DS.'features'.DS.'certificates'.DS.'template.php'; + } + + return $template; + } + + /** + * @return array + */ + private function get_request() + { + $ex = explode('-', $_GET['key'] ?? ''); // [attendee_id]-[mec-booking-id]-[transaction-id]-[ticket-id] + + return [ + $ex[0] ?? null, + $ex[1] ?? null, + $ex[2] ?? null, + $ex[3] ?? null + ]; + } + + /** + * @return array|WP_Post|null + */ + private function get_requested_event() + { + $booking = $this->get_requested_booking(); + + return get_post($booking->event_id); + } + + /** + * @return mixed + */ + private function get_requested_booking() + { + list( + $attendee_id, + $mec_booking_id, + $transaction_id, + $ticket_id + ) = $this->get_request(); + + return $this->getDB()->select("SELECT * FROM `#__mec_bookings` WHERE `id`='".esc_sql($mec_booking_id)."'", 'loadObject'); + } + + /** + * @return mixed + */ + private function get_requested_attendee() + { + list( + $attendee_id, + $mec_booking_id, + $transaction_id, + $ticket_id + ) = $this->get_request(); + + return $this->getDB()->select("SELECT * FROM `#__mec_booking_attendees` WHERE `id`='".esc_sql($attendee_id)."'", 'loadObject'); + } + + /** + * @return string + */ + public function shortcode_event_title() + { + $event = $this->get_requested_event(); + + return $event ? $event->post_title : 'N/A'; + } + + /** + * @return string + */ + public function shortcode_event_date() + { + $booking = $this->get_requested_booking(); + $date_format = get_option('date_format'); + + return $booking ? (string) wp_date($date_format, strtotime($booking->date)) : 'N/A'; + } + + /** + * @return mixed + */ + public function shortcode_attendee_id() + { + list( + $attendee_id, + $mec_booking_id, + $transaction_id, + $ticket_id + ) = $this->get_request(); + + return $attendee_id; + } + + /** + * @return string + */ + public function shortcode_attendee_name() + { + $attendee = $this->get_requested_attendee(); + if($attendee) + { + $user = $this->getUser()->get($attendee->user_id); + return $user->first_name . ' ' . $user->last_name; + } + + return 'N/A'; + } + + /** + * @return mixed + */ + public function shortcode_transaction_id() + { + list( + $attendee_id, + $mec_booking_id, + $transaction_id, + $ticket_id + ) = $this->get_request(); + + return $transaction_id; + } + + /** + * @return mixed + */ + public function shortcode_ticket_id() + { + list( + $attendee_id, + $mec_booking_id, + $transaction_id, + $ticket_id + ) = $this->get_request(); + + return $ticket_id; + } + + /** + * @return mixed + */ + public function shortcode_ticket_name() + { + list( + $attendee_id, + $mec_booking_id, + $transaction_id, + $ticket_id + ) = $this->get_request(); + + $event = $this->get_requested_event(); + + $event_tickets = get_post_meta($event->ID, 'mec_tickets', true); + if(!is_array($event_tickets)) $event_tickets = []; + + return isset($event_tickets[$ticket_id]) ? $event_tickets[$ticket_id]['name'] : 'N/A'; + } + + public function send_certificates() + { + // Current User is not Permitted + if(!current_user_can('manage_options')) $this->main->response(['success' => 0, 'code' => 'NO_ACCESS']); + + $template = isset($_POST['template']) ? sanitize_text_field($_POST['template']) : 0; + $attendee_ids = isset($_POST['attendee_ids']) ? sanitize_text_field($_POST['attendee_ids']) : NULL; + $attendee_ids = trim($attendee_ids, ', '); + + $attendees = explode(',', $attendee_ids); + + // Invalid Request + if(!count($attendees) || !trim($template)) $this->main->response(['success' => 0, 'code' => 'INVALID_REQUEST']); + + // Notifications + $notifications = $this->getNotifications(); + + // Send Certificates + foreach($attendees as $attendee) + { + $notifications->certificate_send($attendee, $template); + } + + echo json_encode(['success' => 1, 'message' => esc_html__('Certificates sent successfully.', 'modern-events-calendar-lite')]); + exit; + } +} \ No newline at end of file diff --git a/app/features/certificates/template.php b/app/features/certificates/template.php new file mode 100755 index 0000000..a79592d --- /dev/null +++ b/app/features/certificates/template.php @@ -0,0 +1,60 @@ + + + + + + + + <?php echo esc_html($post->post_title); ?> + + + + +
    +
    + +
    + + + diff --git a/app/features/colors.php b/app/features/colors.php new file mode 100755 index 0000000..f83376c --- /dev/null +++ b/app/features/colors.php @@ -0,0 +1,125 @@ + + */ +class MEC_feature_colors extends MEC_base +{ + /** + * @var MEC_factory + */ + public $factory; + + /** + * @var MEC_main + */ + public $main; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Factory + $this->factory = $this->getFactory(); + + // Import MEC Main + $this->main = $this->getMain(); + } + + /** + * Initialize colors feature + * @author Webnus + */ + public function init() + { + $this->factory->action('add_meta_boxes', array($this, 'register_meta_boxes')); + $this->factory->action('save_post', array($this, 'save_event'), 3); + } + + /** + * Registers color meta box + * @author Webnus + */ + public function register_meta_boxes() + { + add_meta_box('mec_metabox_color', esc_html__('Event Color', 'modern-events-calendar-lite'), array($this, 'meta_box_colors'), $this->main->get_main_post_type(), 'side'); + } + + public function mec_hex2rgb($hex) + { + $hex = str_replace("#", "", $hex); + if(strlen($hex) == 3) + { + $r = hexdec(substr($hex,0,1).substr($hex,0,1)); + $g = hexdec(substr($hex,1,1).substr($hex,1,1)); + $b = hexdec(substr($hex,2,1).substr($hex,2,1)); + } + else + { + $r = hexdec(substr($hex,0,2)); + $g = hexdec(substr($hex,2,2)); + $b = hexdec(substr($hex,4,2)); + } + + return array($r, $g, $b); + } + + /** + * Show color meta box content + * @author Webnus + * @param object $post + */ + public function meta_box_colors($post) + { + $color = get_post_meta($post->ID, 'mec_color', true); + $available_colors = $this->main->get_available_colors(); + ?> +
    +
    + +
    +
    + + mec_hex2rgb('#'.$available_color); ?> + + '; ?> + + + +
    +
    + + * @param int $post_id + * @return void + */ + public function save_event($post_id) + { + // Check if our nonce is set. + if(!isset($_POST['mec_event_nonce'])) return; + + // Verify that the nonce is valid. + if(!wp_verify_nonce(sanitize_text_field($_POST['mec_event_nonce']), 'mec_event_data')) return; + + // If this is an autosave, our form has not been submitted, so we don't want to do anything. + if(defined('DOING_AUTOSAVE') and DOING_AUTOSAVE) return; + + // Get Modern Events Calendar Data + $_mec = isset($_POST['mec']) ? $this->main->sanitize_deep_array($_POST['mec']) : []; + + $color = isset($_mec['color']) ? trim(sanitize_text_field($_mec['color']), '# ') : ''; + update_post_meta($post_id, 'mec_color', $color); + + // Add the new color to available colors + if(trim($color)) $this->main->add_to_available_colors($color); + } +} \ No newline at end of file diff --git a/app/features/compatibility.php b/app/features/compatibility.php new file mode 100755 index 0000000..642ad19 --- /dev/null +++ b/app/features/compatibility.php @@ -0,0 +1,103 @@ + + */ +class MEC_feature_compatibility extends MEC_base +{ + /** + * @var MEC_factory + */ + public $factory; + + /** + * @var MEC_main + */ + public $main; + + /** + * To Override default HTML ID of MEC template files + * @var string + */ + public $html_id = ''; + + /** + * To add HTML Classes to MEC template files + * @var array + */ + public $html_class = []; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Factory + $this->factory = $this->getFactory(); + + // Import MEC Main + $this->main = $this->getMain(); + } + + /** + * Initialize compatibility + * @author Webnus + */ + public function init() + { + // MEC Filters for changing HTML ID of MEC Pages + $this->factory->filter('mec_archive_page_html_id', array($this, 'html_id')); + $this->factory->filter('mec_category_page_html_id', array($this, 'html_id')); + $this->factory->filter('mec_single_page_html_id', array($this, 'html_id')); + + // MEC Filters for changing HTML class of MEC Pages + $this->factory->filter('mec_archive_page_html_class', array($this, 'html_class')); + $this->factory->filter('mec_category_page_html_class', array($this, 'html_class')); + $this->factory->filter('mec_single_page_html_class', array($this, 'html_class')); + + // Make MEC compatible with themes and child themes + $this->factory->action('init', array($this, 'make_it_compatible')); + } + + /** + * Make MEC compatible by adding/changing HTML Classes/IDs + * @author Webnus + */ + public function make_it_compatible() + { + $template = get_template(); + + if($template == 'logitrans') + { + $this->html_class = ['wrapper']; + } + } + + /** + * Return HTML ID of MEC Pages + * @author Webnus + * @param string $id + * @return string + */ + public function html_id($id) + { + if(trim($this->html_id)) return $this->html_id; + else return $id; + } + + /** + * Return HTML Class of MEC Pages + * @author Webnus + * @param string $class + * @return string + */ + public function html_class($class) + { + if(is_array($this->html_class) and count($this->html_class)) return $class.' '.implode(' ', $this->html_class); + else return $class; + } +} \ No newline at end of file diff --git a/app/features/contextual.php b/app/features/contextual.php new file mode 100755 index 0000000..944b89e --- /dev/null +++ b/app/features/contextual.php @@ -0,0 +1,345 @@ + + */ +class MEC_feature_contextual extends MEC_base +{ + /** + * @var MEC_factory + */ + public $factory; + + /** + * @var MEC_main + */ + public $main; + public $settings; + + public function __construct() + { + // Import MEC Main + $this->main = $this->getMain(); + + // Import MEC Factory + $this->factory = $this->getFactory(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + } + + /** + * Initialize the auto update class + * @author Webnus + */ + public function init() + { + // updating checking + //$this->factory->filter('contextual_help', array($this, 'contextual'), 10, 2); + } + + public function contextual( $contextual_help, $screen_id) + { + $screen = get_current_screen(); + switch($screen_id) + { + case 'm-e-calendar_page_MEC-settings': + + // To add a whole tab group + $screen->add_help_tab(array + ( + 'id' => 'mec-settings', + 'title' => esc_html__('Settings', 'modern-events-calendar-lite'), + 'callback' => array($this, 'settings') + )); + + $screen->add_help_tab(array + ( + 'id' => 'mec-form', + 'title' => esc_html__('Booking Form', 'modern-events-calendar-lite'), + 'content' => esc_html__('

    Booking Form

    + Build your booking registration form (This form will be used for every attendee). ', 'modern-events-calendar-lite') + )); + + $screen->add_help_tab(array + ( + 'id' => 'mec-gateways', + 'title' => esc_html__('Payment Gateways', 'modern-events-calendar-lite'), + 'content' => esc_html__('

    Payment Gateways

    ', 'modern-events-calendar-lite') + )); + + $screen->add_help_tab(array + ( + 'id' => 'mec-notifications', + 'title' => esc_html__('Notifications', 'modern-events-calendar-lite'), + 'content' => esc_html__('

    Notifications

    You can edit your messages in there.MEC Notificatoin Module', 'modern-events-calendar-lite') + )); + + break; + + case 'm-e-calendar_page_MEC-ix': + + $screen->add_help_tab(array + ( + 'id' => 'mec-importexport', + 'title' => esc_html__('Google Cal. Import', 'modern-events-calendar-lite'), + 'content' => esc_html__('

    Import/Export

    Google Cal. Import:
    ', 'modern-events-calendar-lite') + )); + + $screen->add_help_tab(array + ( + 'id' => 'mec-importexportg', + 'title' => esc_html__('Google Cal. Export', 'modern-events-calendar-lite'), + 'content' => esc_html__('

    Import/Export

    Google Cal. Export:
    ', 'modern-events-calendar-lite') + )); + + $screen->add_help_tab(array + ( + 'id' => 'mec-importexportf', + 'title' => esc_html__('Facebook Cal. Import', 'modern-events-calendar-lite'), + 'content' => esc_html__('

    Import/Export

    Facebook Cal. Import:
    ', 'modern-events-calendar-lite') + )); + + break; + } + + return $contextual_help; + } + + public function settings() + { + ?> +
    +
      +
    • + +
    + +
      +
    • + +
    + +
      +
    • + +
    + +
      +
    • + +
    + +
      +
    • + +
    + +
      +
    • + +
    + +
      +
    • + +
    + +
      +
    • + +
    + +
      +
    • + +
    + +
      +
    • + +
    + +
      +
    • + +
    + +
      +
    • + +
    + +
      +
    • + +
    + +
      +
    • + +
    + +
      +
    • + +
    + +
      +
    • + +
    +
    + + */ +class MEC_feature_dc extends MEC_base +{ + public $factory; + public $main; + public $settings; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Factory + $this->factory = $this->getFactory(); + + // Import MEC Main + $this->main = $this->getMain(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + } + + /** + * Initialize admin calendar feature + * @author Webnus + */ + public function init() + { + // Dynamic Content Shortcode + $this->factory->shortcode('MEC_dc', array($this, 'output')); + } + + public function output($atts = array()) + { + $event_id = $atts['event'] ?? NULL; + + if(!$event_id) $event_id = $atts['id'] ?? NULL; + if(!$event_id) + { + global $post; + if($post->post_type === $this->main->get_main_post_type()) $event_id = $post->ID; + } + + // Key + $key = $atts['key'] ?? NULL; + + // Invalid Data + if(!$event_id || !$key) return ''; + + $post = get_post($event_id); + + // Invalid Post + if($post->post_type !== $this->main->get_main_post_type()) return ''; + + // Event + if(isset($GLOBALS['mec-event'])) $event = $GLOBALS['mec-event']; + else + { + $events = (new MEC_skin_single())->get_event_mec($event_id); + $event = current($events); + } + + return $this->render($event, $key); + } + + public function render($event, $key) + { + $meta = $event->data->meta; + $date = $event->date; + + if($key === 'start_date') + { + $date_format = get_option('date_format'); + return $this->main->date_i18n($date_format, strtotime($meta['mec_start_datetime']), $event); + } + elseif($key === 'start_time') + { + $time_format = get_option('time_format'); + return $this->main->date_i18n($time_format, strtotime($meta['mec_start_datetime']), $event); + } + elseif($key === 'start_datetime') + { + $date_format = get_option('date_format'); + $time_format = get_option('time_format'); + $datetime_format = $date_format.' '.$time_format; + + return $this->main->date_i18n($datetime_format, strtotime($meta['mec_start_datetime']), $event); + } + elseif($key === 'end_date') + { + $date_format = get_option('date_format'); + return $this->main->date_i18n($date_format, strtotime($meta['mec_end_datetime']), $event); + } + elseif($key === 'end_time') + { + $time_format = get_option('time_format'); + return $this->main->date_i18n($time_format, strtotime($meta['mec_end_datetime']), $event); + } + elseif($key === 'end_datetime') + { + $date_format = get_option('date_format'); + $time_format = get_option('time_format'); + $datetime_format = $date_format.' '.$time_format; + + return $this->main->date_i18n($datetime_format, strtotime($meta['mec_end_datetime']), $event); + } + elseif($key === 'occurrence') + { + $date_format = get_option('date_format'); + $midnight_event = $this->main->is_midnight_event($event); + + if($midnight_event) return $this->main->dateify($event, $date_format); + else return $this->main->date_label($date['start'], $date['end'], $date_format, ' - ', true, 0, $event); + } + elseif($key === 'occurrence_start_date') + { + $date_format = get_option('date_format'); + return $this->main->date_i18n($date_format, $date['start']['timestamp'], $event); + } + elseif($key === 'occurrence_start_time') + { + $time_format = get_option('time_format'); + return $this->main->date_i18n($time_format, $date['start']['timestamp'], $event); + } + elseif($key === 'occurrence_start_datetime') + { + $date_format = get_option('date_format'); + $time_format = get_option('time_format'); + $datetime_format = $date_format.' '.$time_format; + + return $this->main->date_i18n($datetime_format, $date['start']['timestamp'], $event); + } + elseif($key === 'occurrence_end_date') + { + $date_format = get_option('date_format'); + return $this->main->date_i18n($date_format, $date['end']['timestamp'], $event); + } + elseif($key === 'occurrence_end_time') + { + $time_format = get_option('time_format'); + return $this->main->date_i18n($time_format, $date['end']['timestamp'], $event); + } + elseif($key === 'occurrence_end_datetime') + { + $date_format = get_option('date_format'); + $time_format = get_option('time_format'); + $datetime_format = $date_format.' '.$time_format; + + return $this->main->date_i18n($datetime_format, $date['end']['timestamp'], $event); + } + elseif($key === 'location_name') + { + $location_id = $this->main->get_master_location_id($event); + $location = get_term($location_id); + + return ($location and isset($location->name)) ? $location->name : ''; + } + elseif($key === 'location_address') + { + $location_id = $this->main->get_master_location_id($event); + return get_term_meta($location_id, 'address', true); + } + elseif($key === 'location_url') + { + $location_id = $this->main->get_master_location_id($event); + return get_term_meta($location_id, 'url', true); + } + elseif($key === 'organizer_name') + { + $organizer_id = $this->main->get_master_organizer_id($event); + $organizer = get_term($organizer_id); + + return ($organizer and isset($organizer->name)) ? $organizer->name : ''; + } + elseif($key === 'organizer_tel') + { + $organizer_id = $this->main->get_master_organizer_id($event); + return get_term_meta($organizer_id, 'tel', true); + } + elseif($key === 'organizer_email') + { + $organizer_id = $this->main->get_master_organizer_id($event); + return get_term_meta($organizer_id, 'email', true); + } + elseif($key === 'organizer_url') + { + $organizer_id = $this->main->get_master_organizer_id($event); + return get_term_meta($organizer_id, 'url', true); + } + elseif($key === 'cost') + { + return $this->main->get_event_cost($event); + } + elseif($key === 'more_info_url') + { + $more_info_url = (isset($event->data->meta['mec_more_info']) and trim($event->data->meta['mec_more_info']) and $event->data->meta['mec_more_info'] != 'http://') ? $event->data->meta['mec_more_info'] : ''; + if(isset($event->date) and isset($event->date['start']) and isset($event->date['start']['timestamp'])) $more_info_url = MEC_feature_occurrences::param($event->ID, $event->date['start']['timestamp'], 'more_info', $more_info_url); + + return $more_info_url; + } + elseif($key === 'more_info_tag') + { + $more_info_url = (isset($event->data->meta['mec_more_info']) and trim($event->data->meta['mec_more_info']) and $event->data->meta['mec_more_info'] != 'http://') ? $event->data->meta['mec_more_info'] : ''; + if(isset($event->date) and isset($event->date['start']) and isset($event->date['start']['timestamp'])) $more_info_url = MEC_feature_occurrences::param($event->ID, $event->date['start']['timestamp'], 'more_info', $more_info_url); + + $more_info_target = MEC_feature_occurrences::param($event->ID, $event->date['start']['timestamp'], 'more_info_target', ($event->data->meta['mec_more_info_target'] ?? '_self')); + $more_info_title = MEC_feature_occurrences::param($event->ID, $event->date['start']['timestamp'], 'more_info_title', ((isset($event->data->meta['mec_more_info_title']) and trim($event->data->meta['mec_more_info_title'])) ? $event->data->meta['mec_more_info_title'] : esc_html__('Read More', 'modern-events-calendar-lite'))); + + return ''.esc_html($more_info_title).''; + } + else return ''; + } +} \ No newline at end of file diff --git a/app/features/dlfile.php b/app/features/dlfile.php new file mode 100755 index 0000000..5d07bef --- /dev/null +++ b/app/features/dlfile.php @@ -0,0 +1,233 @@ + + */ +class MEC_feature_dlfile extends MEC_base +{ + public $factory; + public $main; + public $settings; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Factory + $this->factory = $this->getFactory(); + + // Import MEC Main + $this->main = $this->getMain(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + } + + /** + * Initialize locations feature + * @author Webnus + */ + public function init() + { + // Booking Status + $booking_status = isset($this->settings['booking_status']) && $this->settings['booking_status']; + + // Booking Download Status + $booking_download = (isset($this->settings['downloadable_file_status']) and $this->settings['downloadable_file_status']); + + // Public Download Module + $public_download_module = (isset($this->settings['public_download_module']) and $this->settings['public_download_module']); + + // Booking download is enabled + if($booking_status and $booking_download) + { + // Metabox + $this->factory->action('mec_metabox_booking', array($this, 'meta_box_downloadable_file'), 17); + + // Downloadable File for FES + if(!isset($this->settings['fes_section_downloadable_file']) or (isset($this->settings['fes_section_downloadable_file']) and $this->settings['fes_section_downloadable_file'])) $this->factory->action('mec_fes_metabox_details', array($this, 'meta_box_downloadable_file'), 47); + + // AJAX + $this->factory->action('wp_ajax_mec_downloadable_file_upload', array($this, 'upload')); + } + + // Public Download Module is enabled + if($public_download_module) + { + // Metabox + $this->factory->action('mec_metabox_details', array($this, 'meta_box_public_module'), 18); + + // Downloadable File for FES + if(!isset($this->settings['fes_section_public_download_module']) or (isset($this->settings['fes_section_public_download_module']) and $this->settings['fes_section_public_download_module'])) $this->factory->action('mec_fes_metabox_details', array($this, 'meta_box_public_module'), 32); + + // AJAX + $this->factory->action('wp_ajax_mec_public_download_module_file_upload', array($this, 'public_download_module_upload')); + } + } + + /** + * Show downloadable file of event into the Add/Edit event page + * + * @author Webnus + * @param WP_Post $post + */ + public function meta_box_downloadable_file($post){ + + FormBuilder::downloadable_file( $post ); + } + + public function upload() + { + // Check if our nonce is set. + if(!isset($_POST['_wpnonce'])) $this->main->response(array('success'=>0, 'code'=>'NONCE_MISSING')); + + // Verify that the nonce is valid. + if(!wp_verify_nonce(sanitize_text_field($_POST['_wpnonce']), 'mec_downloadable_file_upload')) $this->main->response(array('success'=>0, 'code'=>'NONCE_IS_INVALID')); + + $uploaded_file = $_FILES['file'] ?? NULL; + + // No file + if(!$uploaded_file) $this->main->response(array('success'=>0, 'code'=>'NO_FILE', 'message'=>esc_html__('Please upload a file.', 'modern-events-calendar-lite'))); + + $allowed = array('gif', 'jpeg', 'jpg', 'png', 'pdf', 'zip'); + + $ex = explode('.', $uploaded_file['name']); + $extension = end($ex); + + // Invalid Extension + if(!in_array($extension, $allowed)) $this->main->response(array('success'=>0, 'code'=>'INVALID_EXTENSION', 'message'=>sprintf(esc_html__('File extension is invalid. You can upload %s files.', 'modern-events-calendar-lite'), implode(', ', $allowed)))); + + // Maximum File Size + $max_file_size = isset($this->settings['fes_max_file_size']) ? (int) ($this->settings['fes_max_file_size'] * 1000) : (5000 * 1000); + + // Invalid Size + if($uploaded_file['size'] > $max_file_size) $this->main->response(array('success'=>0, 'code'=>'IMAGE_IS_TOO_BIG', 'message'=>sprintf(esc_html__('File is too big. Maximum size is %s KB.', 'modern-events-calendar-lite'), ($max_file_size / 1000)))); + + // Include the functions + if(!function_exists('wp_handle_upload')) + { + require_once ABSPATH.'wp-admin/includes/file.php'; + require_once(ABSPATH.'wp-admin/includes/image.php'); + } + + $upload = wp_upload_bits($uploaded_file['name'], NULL, file_get_contents($uploaded_file['tmp_name'])); + $wp_filetype = wp_check_filetype(basename($upload['file'])); + + $wp_upload_dir = wp_upload_dir(); + $attachment = array( + 'guid' => $wp_upload_dir['baseurl'] . _wp_relative_upload_path($upload['file']), + 'post_mime_type' => $wp_filetype['type'], + 'post_title' => preg_replace('/\.[^.]+$/', '', basename($upload['file'])), + 'post_content' => '', + 'post_status' => 'inherit' + ); + + $attach_id = wp_insert_attachment($attachment, $upload['file']); + wp_update_attachment_metadata($attach_id, wp_generate_attachment_metadata($attach_id, $upload['file'])); + + $success = 0; + $data = []; + + if($attach_id && (!isset($upload['error']) || !$upload['error'])) + { + $success = 1; + $message = esc_html__('File uploaded!', 'modern-events-calendar-lite'); + + $data['url'] = $upload['url']; + $data['id'] = $attach_id; + } + else + { + $message = $upload['error']; + } + + $this->main->response(array('success'=>$success, 'message'=>$message, 'data'=>$data)); + } + + /** + * Show public download module of event into the Add/Edit event page + * + * @author Webnus + * @param object $post + */ + public function meta_box_public_module($post){ + + FormBuilder::public_download( $post ); + } + + public function public_download_module_upload() + { + // Check if our nonce is set. + if(!isset($_POST['_wpnonce'])) $this->main->response(array('success'=>0, 'code'=>'NONCE_MISSING')); + + // Verify that the nonce is valid. + if(!wp_verify_nonce(sanitize_text_field($_POST['_wpnonce']), 'mec_public_download_module_file_upload')) $this->main->response(array('success'=>0, 'code'=>'NONCE_IS_INVALID')); + + $uploaded_file = $_FILES['file'] ?? NULL; + + // No file + if(!$uploaded_file) $this->main->response(array('success'=>0, 'code'=>'NO_FILE', 'message'=>esc_html__('Please upload a file.', 'modern-events-calendar-lite'))); + + $allowed = array('docx', 'jpeg', 'jpg', 'png', 'pdf', 'zip'); + + $ex = explode('.', $uploaded_file['name']); + $extension = end($ex); + + // Invalid Extension + if(!in_array($extension, $allowed)) $this->main->response(array('success'=>0, 'code'=>'INVALID_EXTENSION', 'message'=>sprintf(esc_html__('File extension is invalid. You can upload %s files.', 'modern-events-calendar-lite'), implode(', ', $allowed)))); + + // Maximum File Size + $max_file_size = isset($this->settings['fes_max_file_size']) ? (int) ($this->settings['fes_max_file_size'] * 1000) : (5000 * 1000); + + // Invalid Size + if($uploaded_file['size'] > $max_file_size) $this->main->response(array('success'=>0, 'code'=>'IMAGE_IS_TOO_BIG', 'message'=>sprintf(esc_html__('File is too big. Maximum size is %s KB.', 'modern-events-calendar-lite'), ($max_file_size / 1000)))); + + // Include the functions + if(!function_exists('wp_handle_upload')) + { + require_once ABSPATH.'wp-admin/includes/file.php'; + require_once(ABSPATH.'wp-admin/includes/image.php'); + } + + $upload = wp_upload_bits($uploaded_file['name'], NULL, file_get_contents($uploaded_file['tmp_name'])); + $wp_filetype = wp_check_filetype(basename($upload['file'])); + + $wp_upload_dir = wp_upload_dir(); + $attachment = array( + 'guid' => $wp_upload_dir['baseurl'] . _wp_relative_upload_path($upload['file']), + 'post_mime_type' => $wp_filetype['type'], + 'post_title' => preg_replace('/\.[^.]+$/', '', basename($upload['file'])), + 'post_content' => '', + 'post_status' => 'inherit' + ); + + $attach_id = wp_insert_attachment($attachment, $upload['file']); + wp_update_attachment_metadata($attach_id, wp_generate_attachment_metadata($attach_id, $upload['file'])); + + $success = 0; + $data = []; + + if($attach_id && (!isset($upload['error']) || !$upload['error'])) + { + $success = 1; + $message = esc_html__('File uploaded!', 'modern-events-calendar-lite'); + + $data['url'] = $upload['url']; + $data['id'] = $attach_id; + } + else + { + $message = $upload['error']; + } + + $this->main->response(array('success'=>$success, 'message'=>$message, 'data'=>$data)); + } +} \ No newline at end of file diff --git a/app/features/emails/details.php b/app/features/emails/details.php new file mode 100755 index 0000000..34e8419 --- /dev/null +++ b/app/features/emails/details.php @@ -0,0 +1,68 @@ +ID, 'mec_time', true); +if($time == '') $time = 1; + +$type = get_post_meta($post->ID, 'mec_type', true); +if($type == '') $type = 'day'; + +$afterbefore = get_post_meta($post->ID, 'mec_afterbefore', true); +if($afterbefore == '') $afterbefore = 'before'; + +$all = get_post_meta($post->ID, 'mec_all', true); +if($all == '') $all = 1; + +$events = get_post_meta($post->ID, 'mec_events', true); +if(!is_array($events)) $events = []; + +// Upcoming Events +$upcoming_event_ids = $this->main->get_upcoming_event_ids(NULL, 'publish'); +?> + \ No newline at end of file diff --git a/app/features/events.php b/app/features/events.php new file mode 100755 index 0000000..6936ae9 --- /dev/null +++ b/app/features/events.php @@ -0,0 +1,4062 @@ + + */ +class MEC_feature_events extends MEC_base +{ + public $factory; + public $main; + public $db; + public $PT; + public $settings; + public $render; + + /** + * Constructor method + * + * @author Webnus + */ + public function __construct() + { + // Import MEC Factory + $this->factory = $this->getFactory(); + + // Import MEC Main + $this->main = $this->getMain(); + + // Import MEC DB + $this->db = $this->getDB(); + + // MEC Post Type Name + $this->PT = $this->main->get_main_post_type(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + } + + /** + * Initialize events feature + * + * @author Webnus + */ + public function init() + { + $this->factory->action('init', array($this, 'register_post_type')); + $this->factory->action('mec_category_add_form_fields', array($this, 'add_category_fields'), 10, 2); + $this->factory->action('mec_category_edit_form_fields', array($this, 'edit_category_fields'), 10, 2); + $this->factory->action('edited_mec_category', array($this, 'save_metadata')); + $this->factory->action('created_mec_category', array($this, 'save_metadata')); + + $this->factory->action('init', array($this, 'register_endpoints')); + $this->factory->action('add_meta_boxes_' . $this->PT, array($this, 'remove_taxonomies_metaboxes')); + $this->factory->action('save_post', array($this, 'save_event'), 10); + $this->factory->action('edit_post', array($this, 'quick_edit'), 10); + $this->factory->action('delete_post', array($this, 'delete_event'), 10); + $this->factory->action('transition_post_status', array($this, 'event_published'), 10 , 3); + + $this->factory->filter('post_row_actions', array($this, 'action_links'), 10, 2); + $this->factory->action('admin_init', array($this, 'duplicate_event')); + + $this->factory->action('add_meta_boxes', array($this, 'register_meta_boxes'), 1); + $this->factory->action('restrict_manage_posts', array($this, 'add_filters')); + $this->factory->action('manage_posts_extra_tablenav', array($this, 'add_buttons')); + if(is_admin()) $this->factory->action('pre_get_posts', array($this, 'filter')); + + $this->factory->action('mec_metabox_details', array($this, 'meta_box_nonce'), 10); + $this->factory->action('mec_metabox_details', array($this, 'meta_box_dates'), 20); + $this->factory->action('mec_metabox_details', array($this, 'meta_box_hourly_schedule'), 30); + $this->factory->action('mec_metabox_details', array($this, 'meta_box_links'), 40); + $this->factory->action('mec_metabox_details', array($this, 'meta_box_cost'), 50); + $this->factory->action('mec_metabox_details', array($this, 'meta_box_fields'), 60); + + // Hourly Schedule for FES + if(!isset($this->settings['fes_section_hourly_schedule']) or (isset($this->settings['fes_section_hourly_schedule']) and $this->settings['fes_section_hourly_schedule'])) + { + $this->factory->action('mec_fes_metabox_details', array($this, 'meta_box_hourly_schedule'), 30); + } + + // Data Fields for FES + if(!isset($this->settings['fes_section_data_fields']) or (isset($this->settings['fes_section_data_fields']) and $this->settings['fes_section_data_fields'])) + { + $this->factory->action('mec_fes_metabox_details', array($this, 'meta_box_fields'), 20); + } + + // Show exceptional days if enabled + if(isset($this->settings['exceptional_days']) and $this->settings['exceptional_days']) + { + $this->factory->action('mec_metabox_details', array($this, 'meta_box_exceptional_days'), 25); + $this->factory->action('mec_fes_metabox_details', array($this, 'meta_box_exceptional_days'), 25); + } + + // Show Booking meta box only if booking module is enabled + $booking_status = (isset($this->settings['booking_status']) and $this->settings['booking_status']); + if($booking_status) + { + $this->factory->action('mec_metabox_booking', array($this, 'meta_box_booking_options'), 5); + $this->factory->action('mec_metabox_booking', array($this, 'meta_box_tickets')); + $this->factory->action('mec_metabox_booking', array($this, 'meta_box_regform'), 20); + $this->factory->action('mec_metabox_booking', array($this, 'meta_box_attendees'), 22); + $this->factory->action('wp_ajax_mec_event_bookings', array($this, 'mec_event_bookings'), 23); + $this->factory->action('wp_ajax_mec_move_bookings', array($this, 'mec_move_bookings'), 24); + $this->factory->action('wp_ajax_mec_manage_bookings', array($this, 'mec_manage_bookings'), 25); + + if(!isset($this->settings['fes_section_booking']) or (isset($this->settings['fes_section_booking']) and $this->settings['fes_section_booking'])) + { + // Booking Options for FES + if(!isset($this->settings['fes_section_booking']) or (isset($this->settings['fes_section_booking']) and $this->settings['fes_section_booking'])) $this->factory->action('mec_fes_metabox_details', array($this, 'meta_box_booking_options'), 35); + + // Ticket Options for FES + if(!isset($this->settings['fes_section_tickets']) or (isset($this->settings['fes_section_tickets']) and $this->settings['fes_section_tickets'])) $this->factory->action('mec_fes_metabox_details', array($this, 'meta_box_tickets'), 40); + + // Registration Form for FES + if(!isset($this->settings['fes_section_reg_form']) or (isset($this->settings['fes_section_reg_form']) and $this->settings['fes_section_reg_form'])) $this->factory->action('mec_fes_metabox_details', array($this, 'meta_box_regform'), 45); + + // Attendees for FES + if(!isset($this->settings['fes_section_booking_att']) or (isset($this->settings['fes_section_booking_att']) and $this->settings['fes_section_booking_att'])) $this->factory->action('mec_fes_metabox_details', array($this, 'meta_box_attendees'), 48); + } + } + + // Show fees meta box only if fees module is enabled + if(isset($this->settings['taxes_fees_status']) and $this->settings['taxes_fees_status']) + { + $this->factory->action('mec_metabox_booking', array($this, 'meta_box_fees'), 15); + + // Fees for FES + if(!isset($this->settings['fes_section_booking']) or (isset($this->settings['fes_section_booking']) and $this->settings['fes_section_booking'])) + { + if($booking_status and (!isset($this->settings['fes_section_fees']) or (isset($this->settings['fes_section_fees']) and $this->settings['fes_section_fees']))) + { + $this->factory->action('mec_fes_metabox_details', array($this, 'meta_box_fees'), 45); + } + } + } + + // Show ticket variations meta box only if the module is enabled + if($booking_status and isset($this->settings['ticket_variations_status']) and $this->settings['ticket_variations_status']) + { + $this->factory->action('mec_metabox_booking', array($this, 'meta_box_ticket_variations'), 16); + + // Ticket Variations for FES + if(!isset($this->settings['fes_section_booking']) or (isset($this->settings['fes_section_booking']) and $this->settings['fes_section_booking'])) + { + if(!isset($this->settings['fes_section_ticket_variations']) or (isset($this->settings['fes_section_ticket_variations']) and $this->settings['fes_section_ticket_variations'])) + { + $this->factory->action('mec_fes_metabox_details', array($this, 'meta_box_ticket_variations'), 46); + } + } + } + + $this->factory->filter('manage_' . $this->PT . '_posts_columns', array($this, 'filter_columns')); + $this->factory->filter('manage_edit-' . $this->PT . '_sortable_columns', array($this, 'filter_sortable_columns')); + $this->factory->action('manage_' . $this->PT . '_posts_custom_column', array($this, 'filter_columns_content'), 10, 2); + + $this->factory->action('admin_footer-edit.php', array($this, 'add_bulk_actions')); + $this->factory->action('load-edit.php', array($this, 'do_bulk_actions')); + $this->factory->action('pre_post_update', array($this, 'bulk_edit'), 10); + + // WPML Duplicate + $this->factory->action('icl_make_duplicate', array($this, 'icl_duplicate'), 10, 4); + $this->factory->action('icl_pro_translation_saved', array($this, 'wpml_pro_translation_saved'), 10, 3); + + // Image Fallback + if(isset($this->settings['fallback_featured_image_status']) and $this->settings['fallback_featured_image_status']) + { + $this->factory->filter('get_post_metadata', array($this, 'set_fallback_image_id'), 10, 4); + $this->factory->filter('post_thumbnail_html', array($this, 'show_fallback_image'), 20, 5); + } + + // Event Gallery + if(isset($this->settings['event_gallery_status']) and $this->settings['event_gallery_status']) + { + // AJAX + $this->factory->action('wp_ajax_mec_event_gallery_image_upload', array($this, 'gallery_image_upload')); + } + + // Related Events Per Event + if(isset($this->settings['related_events_per_event']) and $this->settings['related_events_per_event']) + { + $this->factory->action('mec_metabox_details', array($this, 'meta_box_related_events'), 17); + + // Related Events Per Event for FES + if(!isset($this->settings['fes_section_related_events']) or (isset($this->settings['fes_section_related_events']) and $this->settings['fes_section_related_events'])) + { + $this->factory->action('mec_fes_metabox_details', array($this, 'meta_box_related_events'), 33); + } + } + + // Event Banner + if(isset($this->settings['banner_status']) && $this->settings['banner_status'] && (!isset($this->settings['banner_force_featured_image']) || !$this->settings['banner_force_featured_image'])) + { + $this->factory->action('mec_metabox_details', array($this, 'meta_box_banner'), 18); + + // Event Banner for FES + if(!isset($this->settings['fes_section_banner']) or (isset($this->settings['fes_section_banner']) and $this->settings['fes_section_banner'])) + { + $this->factory->action('mec_fes_metabox_details', array($this, 'meta_box_banner'), 34); + } + } + + // Timezone Notice + $timezone_string = get_option('timezone_string'); + if(trim($timezone_string) === '') + { + add_action('admin_notices', function() + { + echo '
    +

    '.esc_html__('It is advisable to utilize a geographic timezone, such as "America/Los_Angeles" instead of a UTC timezone offset, like "UTC+0," while using The Modern Events Calendar. The latter may cause issues when importing events or with Daylight Saving Time.', 'modern-events-calendar-lite').'

    +
    '; + }); + } + } + + /** + * Registers events post type and assign it to some taxonomies + * + * @author Webnus + */ + public function register_post_type() + { + // Get supported features for event post type + $supports = apply_filters('mec_event_supports', array('editor', 'title', 'excerpt', 'author', 'thumbnail', 'comments')); + + $args = apply_filters( + 'mec_event_register_post_type_args', + array( + 'labels' => array( + 'name' => esc_html__('Events', 'modern-events-calendar-lite'), + 'singular_name' => esc_html__('Event', 'modern-events-calendar-lite'), + 'add_new' => esc_html__('Add Event', 'modern-events-calendar-lite'), + 'add_new_item' => esc_html__('Add New Event', 'modern-events-calendar-lite'), + 'not_found' => esc_html__('No events found!', 'modern-events-calendar-lite'), + 'all_items' => esc_html__('All Events', 'modern-events-calendar-lite'), + 'edit_item' => esc_html__('Edit Event', 'modern-events-calendar-lite'), + 'view_item' => esc_html__('View Event', 'modern-events-calendar-lite'), + 'not_found_in_trash' => esc_html__('No events found in Trash!', 'modern-events-calendar-lite'), + ), + 'public' => true, + 'has_archive' => ($this->main->get_archive_status() ? true : false), + 'menu_icon' => plugin_dir_url(__FILE__ ) . '../../assets/img/mec.svg', + 'menu_position' => 26, + 'show_in_menu' => 'mec-intro', + 'rewrite' => array( + 'slug' => $this->main->get_main_slug(), + 'ep_mask' => EP_MEC_EVENTS, + 'with_front' => false, + ), + 'supports' => $supports, + 'show_in_rest' => true, + + ) + ); + register_post_type( $this->PT, $args ); + + $singular_label = $this->main->m('taxonomy_category', esc_html__('Category', 'modern-events-calendar-lite')); + $plural_label = $this->main->m('taxonomy_categories', esc_html__('Categories', 'modern-events-calendar-lite')); + + $category_args = apply_filters( + 'mec_register_taxonomy_args', + array( + 'label' => $plural_label, + 'labels' => array( + 'name' => $plural_label, + 'singular_name' => $singular_label, + 'all_items' => sprintf(esc_html__('All %s', 'modern-events-calendar-lite'), $plural_label), + 'edit_item' => sprintf(esc_html__('Edit %s', 'modern-events-calendar-lite'), $singular_label), + 'view_item' => sprintf(esc_html__('View %s', 'modern-events-calendar-lite'), $singular_label), + 'update_item' => sprintf(esc_html__('Update %s', 'modern-events-calendar-lite'), $singular_label), + 'add_new_item' => sprintf(esc_html__('Add New %s', 'modern-events-calendar-lite'), $singular_label), + 'new_item_name' => sprintf(esc_html__('New %s Name', 'modern-events-calendar-lite'), $singular_label), + 'popular_items' => sprintf(esc_html__('Popular %s', 'modern-events-calendar-lite'), $plural_label), + 'search_items' => sprintf(esc_html__('Search %s', 'modern-events-calendar-lite'), $plural_label), + ), + 'public' => true, + 'show_ui' => true, + 'show_in_rest' => true, + 'hierarchical' => true, + 'has_archive' => true, + 'rewrite' => array('slug' => $this->main->get_category_slug()), + ), + 'mec_category' + ); + + register_taxonomy( + 'mec_category', + $this->PT, + $category_args + ); + + register_taxonomy_for_object_type('mec_category', $this->PT); + } + + /** + * Register meta field to taxonomies + * + * @author Webnus + */ + public function add_category_fields() + { + add_thickbox(); + + // Fallback Status + $fallback = (isset($this->settings['fallback_featured_image_status']) and $this->settings['fallback_featured_image_status']); + ?> +
    + + + +
    +
    + + +

    +
    + +
    + +
    + + + +
    + + + */ + public function edit_category_fields($term) + { + add_thickbox(); + + // Fallback Status + $fallback = (isset($this->settings['fallback_featured_image_status']) and $this->settings['fallback_featured_image_status']); + + // Fallback Image + $fallback_image = get_metadata('term', $term->term_id, 'mec_cat_fallback_image', true); + + // Icon + $icon = get_metadata('term', $term->term_id, 'mec_cat_icon', true); + + // Color + $color = get_metadata('term', $term->term_id, 'mec_cat_color', true); + ?> + + + + + + + + +
    + + + + + + + + + +

    + + + + + + + + +
    '; ?>
    + + + + + + + + * @param int $term_id + */ + public function save_metadata($term_id) + { + // Quick Edit + if(!isset($_POST['mec_cat_icon'])) return; + + $icon = sanitize_text_field($_POST['mec_cat_icon']); + update_term_meta($term_id, 'mec_cat_icon', $icon); + + $color = isset($_POST['mec_cat_color']) ? sanitize_text_field($_POST['mec_cat_color']) : ''; + update_term_meta($term_id, 'mec_cat_color', $color); + + $fallback = isset($_POST['fallback']) ? sanitize_text_field($_POST['fallback']) : ''; + update_term_meta($term_id, 'mec_cat_fallback_image', $fallback); + } + + public function register_endpoints() + { + add_rewrite_endpoint('verify', EP_MEC_EVENTS); + add_rewrite_endpoint('cancel', EP_MEC_EVENTS); + add_rewrite_endpoint('gateway-cancel', EP_MEC_EVENTS); + add_rewrite_endpoint('gateway-return', EP_MEC_EVENTS); + } + + /** + * Remove normal meta boxes for some taxonomies + * + * @author Webnus + */ + public function remove_taxonomies_metaboxes() + { + remove_meta_box('tagsdiv-mec_location', $this->PT, 'side'); + remove_meta_box('tagsdiv-mec_organizer', $this->PT, 'side'); + remove_meta_box('tagsdiv-mec_label', $this->PT, 'side'); + } + + /** + * Registers 2 meta boxes for event data + * + * @author Webnus + */ + public function register_meta_boxes() + { + // Event Details + add_meta_box('mec_metabox_details', esc_html__('Event Details', 'modern-events-calendar-lite'), array($this, 'meta_box_details'), $this->main->get_main_post_type(), 'normal', 'high'); + + // Visibility + $visibility_status = !isset($this->settings['event_visibility_status']) || $this->settings['event_visibility_status']; + $style_per_event = isset($this->settings['style_per_event']) && $this->settings['style_per_event']; + + if($visibility_status || $style_per_event) + { + add_meta_box('mec_metabox_visibility', esc_html__('Visibility', 'modern-events-calendar-lite'), array($this, 'meta_box_visibility'), $this->main->get_main_post_type(), 'side'); + } + + // Gallery + if(isset($this->settings['event_gallery_status']) && $this->settings['event_gallery_status']) + { + add_meta_box('mec_metabox_gallery', esc_html__('Gallery', 'modern-events-calendar-lite'), array($this, 'meta_box_event_gallery'), $this->main->get_main_post_type(), 'side', 'low'); + } + + // Show Booking meta box only if booking module is enabled + if($this->getPRO() and isset($this->settings['booking_status']) and $this->settings['booking_status']) + { + add_meta_box('mec_metabox_booking', esc_html__('Booking', 'modern-events-calendar-lite'), array($this, 'meta_box_booking'), $this->main->get_main_post_type(), 'normal', 'high'); + } + } + + /** + * Show content of details meta box + * + * @author Webnus + * @param WP_Post $post + */ + public function meta_box_details($post) + { + global $post; + $note = get_post_meta($post->ID, 'mec_note', true); + $note_visibility = $this->main->is_note_visible($post->post_status); + + $fes_guest_email = get_post_meta($post->ID, 'fes_guest_email', true); + $fes_guest_name = get_post_meta($post->ID, 'fes_guest_name', true); + + $event_fields = $this->main->get_event_fields(); + ?> +
    +
    + 'mec_meta_box_fes_form', + esc_html__('Date And Time', 'modern-events-calendar-lite') => 'mec_meta_box_date_form', + esc_html__('Event Repeating', 'modern-events-calendar-lite') => 'mec_meta_box_repeat_form', + esc_html__('Event Data', 'modern-events-calendar-lite') => 'mec-event-data', + esc_html__('Exceptional Days', 'modern-events-calendar-lite') => 'mec-exceptional-days', + esc_html__('Hourly Schedule', 'modern-events-calendar-lite') => 'mec-hourly-schedule', + esc_html__('Location/Venue', 'modern-events-calendar-lite') => 'mec-location', + esc_html__('Links', 'modern-events-calendar-lite') => 'mec-read-more', + esc_html__('Organizer', 'modern-events-calendar-lite') => 'mec-organizer', + esc_html__('Cost', 'modern-events-calendar-lite') => 'mec-cost', + esc_html__('SEO Schema / Event Status', 'modern-events-calendar-lite') => 'mec-schema', + esc_html__('Notifications', 'modern-events-calendar-lite') => 'mec-notifications', + esc_html__('Public Download', 'modern-events-calendar-lite') => 'mec-public-download-module-file', + esc_html__('Related Events', 'modern-events-calendar-lite') => 'mec-event-related-events', + esc_html__('Event Banner', 'modern-events-calendar-lite') => 'mec-event-banner', + ); + + $single_event_meta_title = apply_filters('mec-single-event-meta-title', $tabs, $activated, $post); + foreach($single_event_meta_title as $link_name => $link_address) + { + if($link_address == 'mec_meta_box_fes_form') + { + if(($note_visibility and trim($note)) || (trim($fes_guest_email) and trim($fes_guest_name))) echo ''.esc_html($link_name).''; + } + elseif($link_address == 'mec-exceptional-days') + { + if(isset($this->settings['exceptional_days']) and $this->settings['exceptional_days']) echo ''.esc_html($link_name).''; + } + elseif($link_address == 'mec-event-data') + { + if(count($event_fields) and isset($this->settings['display_event_fields_backend']) and $this->settings['display_event_fields_backend'] == 1) echo ''.esc_html($link_name).''; + } + elseif($link_address == 'mec-notifications') + { + if(isset($this->settings['notif_per_event']) and $this->settings['notif_per_event']) echo ''.esc_html($link_name).''; + } + elseif($link_address == 'mec-public-download-module-file') + { + if(isset($this->settings['public_download_module']) and $this->settings['public_download_module']) echo ''.esc_html($link_name).''; + } + elseif($link_address == 'mec-event-related-events') + { + if(isset($this->settings['related_events_per_event']) and $this->settings['related_events_per_event']) echo ''.esc_html($link_name).''; + } + elseif($link_address == 'mec-event-banner') + { + if(isset($this->settings['banner_status']) && $this->settings['banner_status'] && (!isset($this->settings['banner_force_featured_image']) || !$this->settings['banner_force_featured_image'])) echo ''.esc_html($link_name).''; + } + elseif($link_address === 'mec-organizer') + { + if((!isset($this->settings['organizers_status']) || $this->settings['organizers_status'])) echo ''.esc_html($link_name).''; + } + else + { + echo ''.esc_html($link_name).''; + } + } + ?> +
    +
    + +
    +
    + + + settings['display_event_fields_backend']) and $this->settings['display_event_fields_backend'] == 1): ?> + + + */ + public function meta_box_visibility($post) + { + // Public Event + $public = get_post_meta($post->ID, 'mec_public', true); + if(trim($public) === '') $public = 1; + + $style_per_event = get_post_meta($post->ID, 'mec_style_per_event', true); + if(trim($style_per_event) == '') $style_per_event = 'global'; + ?> +
    + settings['event_visibility_status']) or (isset($this->settings['event_visibility_status']) and $this->settings['event_visibility_status'])): ?> + +
    +
    + +
    +
    + + settings['style_per_event']) and $this->settings['style_per_event']): ?> + +
    +
    + +
    +
    + +
    + + */ + public function meta_box_gallery($post) + { + } + + /** + * Add a security nonce to the Add/Edit events page + * + * @author Webnus + */ + public function meta_box_nonce() + { + // Add a nonce field, so we can check for it later. + wp_nonce_field('mec_event_data', 'mec_event_nonce'); + } + + /** + * Show date options of event into the Add/Edit event page + * + * @author Webnus + * @param WP_Post $post + */ + public function meta_box_dates($post) + { + global $post; + + $allday = get_post_meta($post->ID, 'mec_allday', true); + $one_occurrence = get_post_meta($post->ID, 'one_occurrence', true); + $comment = get_post_meta($post->ID, 'mec_comment', true); + $hide_time = get_post_meta($post->ID, 'mec_hide_time', true); + $start_date = get_post_meta($post->ID, 'mec_start_date', true); + + $hide_end_time_global = isset($this->settings['hide_event_end_time']) && $this->settings['hide_event_end_time']; + $hide_end_time = get_post_meta($post->ID, 'mec_hide_end_time', true); + + if($hide_end_time_global) $hide_end_time = 1; + + // This date format used for datepicker + $datepicker_format = (isset($this->settings['datepicker_format']) and trim($this->settings['datepicker_format'])) ? $this->settings['datepicker_format'] : 'Y-m-d'; + + // Advanced Repeating Day + $advanced_days = get_post_meta($post->ID, 'mec_advanced_days', true); + $advanced_days = is_array($advanced_days) ? $advanced_days : []; + $advanced_str = count($advanced_days) ? implode('-', $advanced_days) : ''; + + $start_time_hour = get_post_meta($post->ID, 'mec_start_time_hour', true); + if(trim($start_time_hour) == '') $start_time_hour = 8; + + $start_time_minutes = get_post_meta($post->ID, 'mec_start_time_minutes', true); + if(trim($start_time_minutes) == '') $start_time_minutes = 0; + + $start_time_ampm = get_post_meta($post->ID, 'mec_start_time_ampm', true); + if(trim($start_time_ampm) == '') $start_time_ampm = 'AM'; + + $end_date = get_post_meta($post->ID, 'mec_end_date', true); + + $end_time_hour = get_post_meta($post->ID, 'mec_end_time_hour', true); + if(trim($end_time_hour) == '') $end_time_hour = 6; + + $end_time_minutes = get_post_meta($post->ID, 'mec_end_time_minutes', true); + if(trim($end_time_minutes) == '') $end_time_minutes = 0; + + $end_time_ampm = get_post_meta($post->ID, 'mec_end_time_ampm', true); + if(trim($end_time_ampm) == '') $end_time_ampm = 'PM'; + + $repeat_status = get_post_meta($post->ID, 'mec_repeat_status', true); + $repeat_type = get_post_meta($post->ID, 'mec_repeat_type', true); + if(trim($repeat_type) == '') $repeat_type = 'daily'; + + $repeat_interval = get_post_meta($post->ID, 'mec_repeat_interval', true); + if(trim($repeat_interval) == '' and in_array($repeat_type, array('daily', 'weekly'))) $repeat_interval = 1; + + $certain_weekdays = get_post_meta($post->ID, 'mec_certain_weekdays', true); + if($repeat_type != 'certain_weekdays') $certain_weekdays = []; + + $in_days_str = get_post_meta($post->ID, 'mec_in_days', true); + $in_days = trim($in_days_str) ? explode(',', $in_days_str) : []; + + $mec_repeat_end = get_post_meta($post->ID, 'mec_repeat_end', true); + if(trim($mec_repeat_end) == '') $mec_repeat_end = 'never'; + + $repeat_end_at_occurrences = get_post_meta($post->ID, 'mec_repeat_end_at_occurrences', true); + if(trim($repeat_end_at_occurrences) == '') $repeat_end_at_occurrences = 9; + + $repeat_end_at_date = get_post_meta($post->ID, 'mec_repeat_end_at_date', true); + + $note = get_post_meta($post->ID, 'mec_note', true); + $note_visibility = $this->main->is_note_visible($post->post_status); + + $fes_guest_email = get_post_meta($post->ID, 'fes_guest_email', true); + $fes_guest_name = get_post_meta($post->ID, 'fes_guest_name', true); + $imported_from_google = get_post_meta($post->ID, 'mec_imported_from_google', true); + + $event_timezone = get_post_meta($post->ID, 'mec_timezone', true); + if(trim($event_timezone) == '') $event_timezone = 'global'; + + $countdown_method = get_post_meta($post->ID, 'mec_countdown_method', true); + if(trim($countdown_method) == '') $countdown_method = 'global'; + ?> +
    + +
    + + +
    +

    +

    +
    + + +
    +

    +

    :

    +

    :

    +
    + + +
    + + + + +

    + + +
    +
    +
    +
    +
    +
    +
    +

    +
    +
    + + +
    +
    +
    + +
    +
    + main->timepicker(array( + 'method' => $this->settings['time_format'] ?? 12, + 'time_hour' => $start_time_hour, + 'time_minutes' => $start_time_minutes, + 'time_ampm' => $start_time_ampm, + 'name' => 'mec[date][start]', + 'id_key' => 'start_', + 'include_h0' => true, + )); ?> +
    +
    +
    + + +
    +
    +
    + +
    +
    + main->timepicker(array( + 'method' => $this->settings['time_format'] ?? 12, + 'time_hour' => $end_time_hour, + 'time_minutes' => $end_time_minutes, + 'time_ampm' => $end_time_ampm, + 'name' => 'mec[date][end]', + 'id_key' => 'end_', + )); ?> +
    +
    + ID); ?> +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    + + +
    +
    +
    +

    + +

    +
    +
    + +
    +
    +
    + + settings['countdown_status']) and $this->settings['countdown_status'] and isset($this->settings['countdown_method_per_event']) and $this->settings['countdown_method_per_event']): ?> +

    +
    +
    + +
    +
    + + + settings['tz_per_event']) and $this->settings['tz_per_event']): ?> +
    +

    +
    +
    + +
    +
    +
    + + +
    + +
    +
    +

    +
    + +
    +
    +
    + + +
    +
    + + +
    +
    + + main->get_weekday_i18n_labels(); + foreach($weekdays as $weekday): + ?> + + +
    +
    +
    +
    +
    +
    + +
    +
    + main->timepicker(array( + 'method' => (isset($this->settings['time_format']) ? $this->settings['time_format'] : 12), + 'time_hour' => $start_time_hour, + 'time_minutes' => $start_time_minutes, + 'time_ampm' => $start_time_ampm, + 'name' => 'mec[exceptionsdays][start]', + 'id_key' => 'exceptions_in_days_start_', + 'include_h0' => true, + )); ?> +
    +
    + + + + +
    +
    +
    +

    + + +

    +
    +
    + +
    +
    +
    +
    +
    + +
    +
    + main->timepicker(array( + 'method' => ($this->settings['time_format'] ?? 12), + 'time_hour' => $end_time_hour, + 'time_minutes' => $end_time_minutes, + 'time_ampm' => $end_time_ampm, + 'name' => 'mec[exceptionsdays][end]', + 'id_key' => 'exceptions_in_days_end_', + )); ?> +
    +
    +
    +
    +
    + + main->standardize_format($in_day[0], $datepicker_format); + $second_date = $this->main->standardize_format($in_day[1], $datepicker_format); + + $in_day_start_time = ''; + $in_day_start_time_label = ''; + $in_day_end_time = ''; + $in_day_end_time_label = ''; + + if(isset($in_day[2]) and isset($in_day[3])) + { + $in_day_start_time = $in_day[2]; + $in_day_end_time = $in_day[3]; + + // If 24 hours format is enabled then convert it back to 12 hours + if(isset($this->settings['time_format']) and $this->settings['time_format'] == 24) + { + $in_day_ex_start = explode('-', $in_day_start_time); + $in_day_ex_end = explode('-', $in_day_end_time); + + $in_day_start_time_label = $this->main->to_24hours($in_day_ex_start[0], $in_day_ex_start[2]).':'.$in_day_ex_start[1]; + $in_day_end_time_label = $this->main->to_24hours($in_day_ex_end[0], $in_day_ex_end[2]).':'.$in_day_ex_end[1]; + } + else + { + $pos = strpos($in_day_start_time, '-'); + if($pos !== false) $in_day_start_time_label = substr_replace($in_day_start_time, ':', $pos, 1); + + $pos = strpos($in_day_end_time, '-'); + if($pos !== false) $in_day_end_time_label = substr_replace($in_day_end_time, ':', $pos, 1); + + $in_day_start_time_label = str_replace('-', ' ', $in_day_start_time_label); + $in_day_end_time_label = str_replace('-', ' ', $in_day_end_time_label); + } + } + + $in_day = $first_date . ':' . $second_date.(trim($in_day_start_time) ? ':'.$in_day_start_time : '').(trim($in_day_end_time) ? ':'.$in_day_end_time : ''); + $in_day_label = $first_date. (trim($in_day_start_time_label) ? ' '.esc_html($in_day_start_time_label).'' : '') . ' - ' . $second_date. (trim($in_day_end_time_label) ? ' '.esc_html($in_day_end_time_label).'' : ''); + ?> +
    + + + x +
    + +
    + +
    +
    + + :label: + x +
    +
    +
    +
    +
    +
      +
    • + +
    • +
        + main->advanced_repeating_sort_day($this->main->get_first_day_of_week(), 1); ?> +
      • "> + + .1- +
      • + main->advanced_repeating_sort_day($this->main->get_first_day_of_week(), 2); ?> +
      • "> + + .1- +
      • + main->advanced_repeating_sort_day($this->main->get_first_day_of_week(), 3); ?> +
      • "> + + .1- +
      • + main->advanced_repeating_sort_day($this->main->get_first_day_of_week(), 4); ?> +
      • "> + + .1- +
      • + main->advanced_repeating_sort_day($this->main->get_first_day_of_week(), 5); ?> +
      • "> + + .1- +
      • + main->advanced_repeating_sort_day($this->main->get_first_day_of_week(), 6); ?> +
      • "> + + .1- +
      • + main->advanced_repeating_sort_day($this->main->get_first_day_of_week(), 7); ?> +
      • "> + + .1- +
      • +
      +
    +
      +
    • + +
    • +
        + main->advanced_repeating_sort_day($this->main->get_first_day_of_week(), 1); ?> +
      • "> + + .2- +
      • + main->advanced_repeating_sort_day($this->main->get_first_day_of_week(), 2); ?> +
      • "> + + .2- +
      • + main->advanced_repeating_sort_day($this->main->get_first_day_of_week(), 3); ?> +
      • "> + + .2- +
      • + main->advanced_repeating_sort_day($this->main->get_first_day_of_week(), 4); ?> +
      • "> + + .2- +
      • + main->advanced_repeating_sort_day($this->main->get_first_day_of_week(), 5); ?> +
      • "> + + .2- +
      • + main->advanced_repeating_sort_day($this->main->get_first_day_of_week(), 6); ?> +
      • "> + + .2- +
      • + main->advanced_repeating_sort_day($this->main->get_first_day_of_week(), 7); ?> +
      • "> + + .2- +
      • +
      +
    +
      +
    • + +
    • +
        + main->advanced_repeating_sort_day($this->main->get_first_day_of_week(), 1); ?> +
      • "> + + .3- +
      • + main->advanced_repeating_sort_day($this->main->get_first_day_of_week(), 2); ?> +
      • "> + + .3- +
      • + main->advanced_repeating_sort_day($this->main->get_first_day_of_week(), 3); ?> +
      • "> + + .3- +
      • + main->advanced_repeating_sort_day($this->main->get_first_day_of_week(), 4); ?> +
      • "> + + .3- +
      • + main->advanced_repeating_sort_day($this->main->get_first_day_of_week(), 5); ?> +
      • "> + + .3- +
      • + main->advanced_repeating_sort_day($this->main->get_first_day_of_week(), 6); ?> +
      • "> + + .3- +
      • + main->advanced_repeating_sort_day($this->main->get_first_day_of_week(), 7); ?> +
      • "> + + .3- +
      • +
      +
    +
      +
    • + +
    • +
        + main->advanced_repeating_sort_day($this->main->get_first_day_of_week(), 1); ?> +
      • "> + + .4- +
      • + main->advanced_repeating_sort_day($this->main->get_first_day_of_week(), 2); ?> +
      • "> + + .4- +
      • + main->advanced_repeating_sort_day($this->main->get_first_day_of_week(), 3); ?> +
      • "> + + .4- +
      • + main->advanced_repeating_sort_day($this->main->get_first_day_of_week(), 4); ?> +
      • "> + + .4- +
      • + main->advanced_repeating_sort_day($this->main->get_first_day_of_week(), 5); ?> +
      • "> + + .4- +
      • + main->advanced_repeating_sort_day($this->main->get_first_day_of_week(), 6); ?> +
      • "> + + .4- +
      • + main->advanced_repeating_sort_day($this->main->get_first_day_of_week(), 7); ?> +
      • "> + + .4- +
      • +
      +
    +
      +
    • + +
    • +
        + main->advanced_repeating_sort_day($this->main->get_first_day_of_week(), 1); ?> +
      • "> + + .l- +
      • + main->advanced_repeating_sort_day($this->main->get_first_day_of_week(), 2); ?> +
      • "> + + .l- +
      • + main->advanced_repeating_sort_day($this->main->get_first_day_of_week(), 3); ?> +
      • "> + + .l- +
      • + main->advanced_repeating_sort_day($this->main->get_first_day_of_week(), 4); ?> +
      • "> + + .l- +
      • + main->advanced_repeating_sort_day($this->main->get_first_day_of_week(), 5); ?> +
      • "> + + .l- +
      • + main->advanced_repeating_sort_day($this->main->get_first_day_of_week(), 6); ?> +
      • "> + + .l- +
      • + main->advanced_repeating_sort_day($this->main->get_first_day_of_week(), 7); ?> +
      • "> + + .l- +
      • +
      +
    + +
    +
    +
    +
    +

    +
    +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + + +
    +
    +
    +

    + +

    +
    +
    + +
    +
    +
    +
    + +
    +
    +
    +
    + + * @param WP_Post $post + */ + public function meta_box_cost($post) + { + $cost = get_post_meta($post->ID, 'mec_cost', true); + $cost_auto_calculate = get_post_meta($post->ID, 'mec_cost_auto_calculate', true); + + $currency = get_post_meta($post->ID, 'mec_currency', true); + if(!is_array($currency)) $currency = []; + + $type = ((isset($this->settings['single_cost_type']) and trim($this->settings['single_cost_type'])) ? $this->settings['single_cost_type'] : 'numeric'); + $currency_per_event = ((isset($this->settings['currency_per_event']) and trim($this->settings['currency_per_event'])) ? $this->settings['currency_per_event'] : 0); + + $currencies = $this->main->get_currencies(); + $current_currency = ($currency['currency'] ?? ($this->settings['currency'] ?? 'USD')); + ?> +
    + +
    +
    +
    +
    +
    +
    + +
    +

    main->m('event_cost', esc_html__('Event Cost', 'modern-events-calendar-lite'))); ?>

    +
    +
    + + + + class="mec-col-3" name="mec[cost]" id="mec_cost" value="" title="" placeholder=""/> + +
    +
    + getPRO()): ?> +
    +
    + +
    +
    + +
    + +
    + +

    +
    + +
    + +
    +
    +
    + +
    + + +
    +
    +
    +

    + +

    +
    +
    + +
    +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + + * @param WP_Post $post + */ + public function meta_box_exceptional_days($post) + { + $not_in_days_str = get_post_meta($post->ID, 'mec_not_in_days', true); + $not_in_days = trim($not_in_days_str) ? explode(',', $not_in_days_str) : []; + ?> +
    +

    +
    +
    +
    + + +
    + getFormBuilder(); + $builder->exceptionalDays([ + 'values' => $not_in_days + ]); + ?> +
    +
    +
    + + * @param WP_Post $post + */ + public function meta_box_hourly_schedule($post) + { + FormBuilder::hourly_schedule( $post ); + } + + + + /** + * Display Related Events in the Add/Edit event page + * + * @author Webnus + * @param WP_Post $post + */ + public function meta_box_related_events($post) + { + FormBuilder::related_events($post); + } + + /** + * Display Event Banner in the Add/Edit event page + * + * @author Webnus + * @param WP_Post $post + */ + public function meta_box_banner($post) + { + FormBuilder::banner($post); + } + + /** + * Display Event Gallery form in the Add/Edit event page + * + * @author Webnus + * @param WP_Post $post + */ + public function meta_box_event_gallery($post) + { + $gallery = get_post_meta($post->ID, 'mec_event_gallery', true); + if(!is_array($gallery)) $gallery = []; + ?> + + + + * @param WP_Post $post + */ + public function meta_box_links($post) + { + $read_more = get_post_meta($post->ID, 'mec_read_more', true); + $more_info = get_post_meta($post->ID, 'mec_more_info', true); + $more_info_title = get_post_meta($post->ID, 'mec_more_info_title', true); + $more_info_target = get_post_meta($post->ID, 'mec_more_info_target', true); + + $trailer_url_status = isset($this->settings['trailer_url_status']) && $this->settings['trailer_url_status']; + + $trailer_url = get_post_meta($post->ID, 'mec_trailer_url', true); + $trailer_title = get_post_meta($post->ID, 'mec_trailer_title', true); + ?> + + + * @param WP_Post $post + */ + public function meta_box_booking($post) + { + $gateway_settings = $this->main->get_gateways_options(); + ?> +
    +
    + + + settings['taxes_fees_status']) and $this->settings['taxes_fees_status']): ?> + + + settings['ticket_variations_status']) and $this->settings['ticket_variations_status']): ?> + + + + + + + settings['downloadable_file_status']) and $this->settings['downloadable_file_status']): ?> + + + + + + + +
    +
    + +
    +
    + + + * @param WP_Post $post + */ + public function meta_box_booking_options($post) + { + $FES = !is_admin(); + + $booking_options = get_post_meta($post->ID, 'mec_booking', true); + if(!is_array($booking_options)) $booking_options = []; + + $fes_booking_tbl = (!isset($this->settings['fes_section_booking_tbl']) or (isset($this->settings['fes_section_booking_tbl']) and $this->settings['fes_section_booking_tbl'])); + $fes_booking_dspe = (!isset($this->settings['fes_section_booking_dspe']) or (isset($this->settings['fes_section_booking_dspe']) and $this->settings['fes_section_booking_dspe'])); + $fes_booking_mtpb = (!isset($this->settings['fes_section_booking_mtpb']) or (isset($this->settings['fes_section_booking_mtpb']) and $this->settings['fes_section_booking_mtpb'])); + $fes_booking_dpur = (!isset($this->settings['fes_section_booking_dpur']) or (isset($this->settings['fes_section_booking_dpur']) and $this->settings['fes_section_booking_dpur'])); + $fes_booking_bao = (!isset($this->settings['fes_section_booking_bao']) or (isset($this->settings['fes_section_booking_bao']) and $this->settings['fes_section_booking_bao'])); + $fes_booking_io = (!isset($this->settings['fes_section_booking_io']) or (isset($this->settings['fes_section_booking_io']) and $this->settings['fes_section_booking_io'])); + $fes_booking_aa = (!isset($this->settings['fes_section_booking_aa']) or (isset($this->settings['fes_section_booking_aa']) and $this->settings['fes_section_booking_aa'])); + $fes_booking_lftp = (!isset($this->settings['fes_section_booking_lftp']) or (isset($this->settings['fes_section_booking_lftp']) and $this->settings['fes_section_booking_lftp'])); + $fes_booking_typ = (!isset($this->settings['fes_section_booking_typ']) or (isset($this->settings['fes_section_booking_typ']) and $this->settings['fes_section_booking_typ'])); + $fes_booking_bbl = (!isset($this->settings['fes_section_booking_bbl']) or (isset($this->settings['fes_section_booking_bbl']) and $this->settings['fes_section_booking_bbl'])); + $fes_booking_tubl = (!isset($this->settings['fes_section_booking_tubl']) or (isset($this->settings['fes_section_booking_tubl']) and $this->settings['fes_section_booking_tubl'])); + + $dpur_status = (!isset($this->settings['discount_per_user_role_status']) or (isset($this->settings['discount_per_user_role_status']) and $this->settings['discount_per_user_role_status'])); + + $partial_payment = $this->getPartialPayment(); + $fes_booking_pp = $partial_payment->is_fes_pp_section_enabled(); + ?> +
    + +
    + + +
    +
    +
    +
    +
    +
    + + +
    + +
    +
    + settings['booking_date_selection_per_event']) and $this->settings['booking_date_selection_per_event'] and (!$FES or ($FES and $fes_booking_dspe))){ + + FormBuilder::booking_date_selection( $post ); + } + + if($dpur_status and (!$FES or ($FES and $fes_booking_dpur))){ + + FormBuilder::discount_per_user_roles( $post ); + } + + if(!$FES or ($FES and $fes_booking_bao)){ + + FormBuilder::book_all_occurrences( $post ); + } + + if(!$FES or ($FES and $fes_booking_io)){ + + FormBuilder::interval_options( $post ); + } + + if(!$FES or ($FES and $fes_booking_aa)){ + + FormBuilder::automatic_approval( $post ); + } + + if((isset($this->settings['last_few_tickets_percentage_per_event']) && $this->settings['last_few_tickets_percentage_per_event']) or ($FES and $fes_booking_lftp)){ + + FormBuilder::last_few_tickets_percentage( $post ); + } + + if((isset($this->settings['thankyou_page_per_event']) && $this->settings['thankyou_page_per_event']) && (!$FES || $fes_booking_typ)){ + + FormBuilder::thankyou_page( $post ); + } + + if(!$FES or ($FES and $fes_booking_bbl)){ + + FormBuilder::booking_button_label( $post ); + } + + if(!$FES or ($FES and $fes_booking_pp)){ + + FormBuilder::booking_partial_payment( $post ); + } + + if(!$FES or ($FES and $fes_booking_tubl)){ + FormBuilder::total_user_booking_limits( $post ); + } + ?> +
    +
    + + + +
    + + * @param WP_Post $post + */ + public function meta_box_tickets($post){ + + FormBuilder::tickets( $post ); + } + + /** + * Show fees of event into the Add/Edit event page + * + * @author Webnus + * @param WP_Post $post + */ + public function meta_box_fees($post){ + + FormBuilder::fees( $post ); + } + + /** + * Show ticket variations into the Add/Edit event page + * + * @author Webnus + * @param WP_Post $post + */ + public function meta_box_ticket_variations($post){ + + FormBuilder::ticket_variations( $post ); + } + + /** + * Show registration form of event into the Add/Edit event page + * + * @author Webnus + * @param WP_Post $post + */ + public function meta_box_regform($post){ + + FormBuilder::booking_form( $post ); + } + + /** + * Show attendees of event into the Add/Edit event page + * + * @author Webnus + * @param WP_Post $post + */ + public function meta_box_attendees($post){ + + FormBuilder::attendees( $post ); + } + + /** + * Save event data + * + * @author Webnus + * @param int $post_id + * @return void + */ + public function save_event($post_id) + { + // Check if our nonce is set. + if(!isset($_POST['mec_event_nonce'])) return; + + // It's from FES + if(isset($_POST['action']) and sanitize_text_field($_POST['action']) === 'mec_fes_form') return; + + // Verify that the nonce is valid. + if(!wp_verify_nonce(sanitize_text_field($_POST['mec_event_nonce']), 'mec_event_data')) return; + + // If this is an autosave, our form has not been submitted, so we don't want to do anything. + if(defined('DOING_AUTOSAVE') and DOING_AUTOSAVE) return; + + // Get Modern Events Calendar Data + $_mec = isset($_POST['mec']) ? $this->main->sanitize_deep_array($_POST['mec']) : []; + + $start_date = (isset($_mec['date']['start']['date']) and trim($_mec['date']['start']['date'])) ? $this->main->standardize_format(sanitize_text_field($_mec['date']['start']['date'])) : date('Y-m-d'); + $end_date = (isset($_mec['date']['end']['date']) and trim($_mec['date']['end']['date'])) ? $this->main->standardize_format(sanitize_text_field($_mec['date']['end']['date'])) : date('Y-m-d'); + + // Remove Cached Data + wp_cache_delete($post_id, 'mec-events-data'); + + $location_id = isset($_mec['location_id']) ? sanitize_text_field($_mec['location_id']) : 0; + $dont_show_map = isset($_mec['dont_show_map']) ? sanitize_text_field($_mec['dont_show_map']) : 0; + $organizer_id = isset($_mec['organizer_id']) ? sanitize_text_field($_mec['organizer_id']) : 0; + $read_more = isset($_mec['read_more']) ? sanitize_url($_mec['read_more']) : ''; + $more_info = (isset($_mec['more_info']) and trim($_mec['more_info'])) ? sanitize_url($_mec['more_info']) : ''; + $more_info_title = isset($_mec['more_info_title']) ? sanitize_text_field($_mec['more_info_title']) : ''; + $more_info_target = isset($_mec['more_info_target']) ? sanitize_text_field($_mec['more_info_target']) : ''; + + $cost = isset($_mec['cost']) ? sanitize_text_field($_mec['cost']) : ''; + $cost = apply_filters( + 'mec_event_cost_sanitize', + sanitize_text_field($cost), + $cost + ); + + $cost_auto_calculate = (isset($_mec['cost_auto_calculate']) ? sanitize_text_field($_mec['cost_auto_calculate']) : 0); + $currency_options = ((isset($_mec['currency']) and is_array($_mec['currency'])) ? $_mec['currency'] : array()); + + update_post_meta($post_id, 'mec_location_id', $location_id); + update_post_meta($post_id, 'mec_dont_show_map', $dont_show_map); + update_post_meta($post_id, 'mec_organizer_id', $organizer_id); + update_post_meta($post_id, 'mec_read_more', $read_more); + update_post_meta($post_id, 'mec_more_info', $more_info); + update_post_meta($post_id, 'mec_more_info_title', $more_info_title); + update_post_meta($post_id, 'mec_more_info_target', $more_info_target); + update_post_meta($post_id, 'mec_cost', $cost); + update_post_meta($post_id, 'mec_cost_auto_calculate', $cost_auto_calculate); + update_post_meta($post_id, 'mec_currency', $currency_options); + + do_action('update_custom_dev_post_meta', $_mec, $post_id); + + // Additional Organizers + $additional_organizer_ids = $_mec['additional_organizer_ids'] ?? []; + + foreach($additional_organizer_ids as $additional_organizer_id) wp_set_object_terms($post_id, (int) $additional_organizer_id, 'mec_organizer', true); + update_post_meta($post_id, 'mec_additional_organizer_ids', $additional_organizer_ids); + + // Additional locations + $additional_location_ids = $_mec['additional_location_ids'] ?? []; + + foreach($additional_location_ids as $additional_location_id) wp_set_object_terms($post_id, (int) $additional_location_id, 'mec_location', true); + update_post_meta($post_id, 'mec_additional_location_ids', $additional_location_ids); + + // Date Options + $date = $_mec['date'] ?? []; + + $start_date = date('Y-m-d', strtotime($start_date)); + + // Fix Date End & Event Finish + if(isset($date['repeat']['status']) && $date['repeat']['status']) + { + $days_diff = $this->main->get_days_diff($start_date, $end_date); + + // Daily + if(isset($date['repeat']['type']) && $date['repeat']['type'] === 'daily' && $days_diff >= 5) + { + $date['repeat']['end'] = 'date'; + $date['repeat']['end_at_date'] = $end_date; + + $end_date = $start_date; + } + // Weekly + else if(isset($date['repeat']['type']) && $date['repeat']['type'] === 'weekly' && $days_diff >= 15) + { + $date['repeat']['end'] = 'date'; + $date['repeat']['end_at_date'] = $end_date; + + $end_date = $start_date; + } + } + + // Set the start date + $date['start']['date'] = $start_date; + + $start_time_hour = isset($date['start']) ? sanitize_text_field($date['start']['hour']) : '8'; + $start_time_minutes = isset($date['start']) ? sanitize_text_field($date['start']['minutes']) : '00'; + $start_time_ampm = (isset($date['start']) and isset($date['start']['ampm'])) ? sanitize_text_field($date['start']['ampm']) : 'AM'; + + $end_date = date('Y-m-d', strtotime($end_date)); + + // Fix end_date if it's smaller than start_date + if(strtotime($end_date) < strtotime($start_date)) $end_date = $start_date; + + // Set the end date + $date['end']['date'] = $end_date; + + $end_time_hour = isset($date['end']) ? sanitize_text_field($date['end']['hour']) : '6'; + $end_time_minutes = isset($date['end']) ? sanitize_text_field($date['end']['minutes']) : '00'; + $end_time_ampm = (isset($date['end']) and isset($date['end']['ampm'])) ? sanitize_text_field($date['end']['ampm']) : 'PM'; + + if(isset($this->settings['time_format']) and $this->settings['time_format'] == 24) + { + $day_start_seconds = $this->main->time_to_seconds($this->main->to_24hours($start_time_hour, NULL, 'start'), $start_time_minutes); + $day_end_seconds = $this->main->time_to_seconds($this->main->to_24hours($end_time_hour, NULL, 'end'), $end_time_minutes); + } + else + { + $day_start_seconds = $this->main->time_to_seconds($this->main->to_24hours($start_time_hour, $start_time_ampm, 'start'), $start_time_minutes); + $day_end_seconds = $this->main->time_to_seconds($this->main->to_24hours($end_time_hour, $end_time_ampm, 'end'), $end_time_minutes); + } + + if($end_date === $start_date and $day_end_seconds < $day_start_seconds) + { + $day_end_seconds = $day_start_seconds; + + $end_time_hour = $start_time_hour; + $end_time_minutes = $start_time_minutes; + $end_time_ampm = $start_time_ampm; + + $date['end']['hour'] = $start_time_hour; + $date['end']['minutes'] = $start_time_minutes; + $date['end']['ampm'] = $start_time_ampm; + } + + // If 24 hours format is enabled then convert it back to 12 hours + if(isset($this->settings['time_format']) and $this->settings['time_format'] == 24) + { + if($start_time_hour < 12) $start_time_ampm = 'AM'; + elseif($start_time_hour == 12) $start_time_ampm = 'PM'; + elseif($start_time_hour > 12) + { + $start_time_hour -= 12; + $start_time_ampm = 'PM'; + } + + if($start_time_hour == 0) + { + $start_time_hour = 12; + $start_time_ampm = 'AM'; + } + + if($end_time_hour < 12) $end_time_ampm = 'AM'; + elseif($end_time_hour == 12) $end_time_ampm = 'PM'; + elseif($end_time_hour > 12) + { + $end_time_hour -= 12; + $end_time_ampm = 'PM'; + } + + if($end_time_hour == 0) + { + $end_time_hour = 12; + $end_time_ampm = 'AM'; + } + + // Set converted values to date array + $date['start']['hour'] = $start_time_hour; + $date['start']['ampm'] = $start_time_ampm; + + $date['end']['hour'] = $end_time_hour; + $date['end']['ampm'] = $end_time_ampm; + } + + $allday = isset($date['allday']) ? 1 : 0; + $one_occurrence = isset($date['one_occurrence']) ? 1 : 0; + $hide_time = isset($date['hide_time']) ? 1 : 0; + $hide_end_time = isset($date['hide_end_time']) ? 1 : 0; + $comment = isset($date['comment']) ? sanitize_text_field($date['comment']) : ''; + $timezone = (isset($_mec['timezone']) and trim($_mec['timezone']) != '') ? sanitize_text_field($_mec['timezone']) : 'global'; + $countdown_method = (isset($_mec['countdown_method']) and trim($_mec['countdown_method']) != '') ? sanitize_text_field($_mec['countdown_method']) : 'global'; + $style_per_event = (isset($_mec['style_per_event']) and trim($_mec['style_per_event']) != '') ? sanitize_text_field($_mec['style_per_event']) : 'global'; + $trailer_url = (isset($_mec['trailer_url']) and trim($_mec['trailer_url']) != '') ? sanitize_url($_mec['trailer_url']) : ''; + $trailer_title = isset($_mec['trailer_title']) ? sanitize_text_field($_mec['trailer_title']) : ''; + $public = (isset($_mec['public']) and trim($_mec['public']) != '') ? sanitize_text_field($_mec['public']) : 1; + + // Set start time and end time if event is all day + if($allday == 1) + { + $start_time_hour = '8'; + $start_time_minutes = '00'; + $start_time_ampm = 'AM'; + + $end_time_hour = '6'; + $end_time_minutes = '00'; + $end_time_ampm = 'PM'; + } + + // Repeat Options + $repeat = $date['repeat'] ?? []; + $certain_weekdays = $repeat['certain_weekdays'] ?? []; + + $repeat_status = isset($repeat['status']) ? 1 : 0; + $repeat_type = ($repeat_status and isset($repeat['type'])) ? $repeat['type'] : ''; + + // Unset Repeat if no days are selected + if($repeat_type == 'certain_weekdays' && (!is_array($certain_weekdays) || !count($certain_weekdays))) + { + $repeat_status = 0; + $repeat['status'] = 0; + $repeat['type'] = ''; + } + + $repeat_interval = ($repeat_status and isset($repeat['interval']) and trim($repeat['interval'])) ? $repeat['interval'] : 1; + + // Advanced Repeat + $advanced = isset($repeat['advanced']) ? sanitize_text_field($repeat['advanced']) : ''; + + if(!is_numeric($repeat_interval)) $repeat_interval = null; + + if($repeat_type == 'weekly') $interval_multiply = 7; + else $interval_multiply = 1; + + // Reset certain weekdays if repeat type is not set to certain weekdays + if($repeat_type != 'certain_weekdays') $certain_weekdays = []; + + if(!is_null($repeat_interval)) $repeat_interval = $repeat_interval * $interval_multiply; + + // String To Array + if($repeat_type == 'advanced' and trim($advanced)) $advanced = explode('-', $advanced); + else $advanced = []; + + $repeat_end = ($repeat_status and isset($repeat['end'])) ? $repeat['end'] : ''; + $repeat_end_at_occurrences = ($repeat_status && isset($repeat['end_at_occurrences']) && is_numeric($repeat['end_at_occurrences'])) ? $repeat['end_at_occurrences'] - 1 : 9; + $repeat_end_at_date = ($repeat_status and isset($repeat['end_at_date'])) ? $this->main->standardize_format( $repeat['end_at_date'] ) : ''; + + // Previous Date Times + $prev_start_datetime = get_post_meta($post_id, 'mec_start_datetime', true); + $prev_end_datetime = get_post_meta($post_id, 'mec_end_datetime', true); + + $start_datetime = $start_date.' '.sprintf('%02d', $start_time_hour).':'.sprintf('%02d', $start_time_minutes).' '.$start_time_ampm; + $end_datetime = $end_date.' '.sprintf('%02d', $end_time_hour).':'.sprintf('%02d', $end_time_minutes).' '.$end_time_ampm; + + update_post_meta($post_id, 'mec_date', $date); + update_post_meta($post_id, 'mec_repeat', $repeat); + update_post_meta($post_id, 'mec_certain_weekdays', $certain_weekdays); + update_post_meta($post_id, 'mec_allday', $allday); + update_post_meta($post_id, 'one_occurrence', $one_occurrence); + update_post_meta($post_id, 'mec_hide_time', $hide_time); + update_post_meta($post_id, 'mec_hide_end_time', $hide_end_time); + update_post_meta($post_id, 'mec_comment', $comment); + update_post_meta($post_id, 'mec_timezone', $timezone); + update_post_meta($post_id, 'mec_countdown_method', $countdown_method); + update_post_meta($post_id, 'mec_style_per_event', $style_per_event); + update_post_meta($post_id, 'mec_trailer_url', $trailer_url); + update_post_meta($post_id, 'mec_trailer_title', $trailer_title); + update_post_meta($post_id, 'mec_public', $public); + + do_action('update_custom_post_meta', $date, $post_id); + + update_post_meta($post_id, 'mec_start_date', $start_date); + update_post_meta($post_id, 'mec_start_time_hour', $start_time_hour); + update_post_meta($post_id, 'mec_start_time_minutes', $start_time_minutes); + update_post_meta($post_id, 'mec_start_time_ampm', $start_time_ampm); + update_post_meta($post_id, 'mec_start_day_seconds', $day_start_seconds); + update_post_meta($post_id, 'mec_start_datetime', $start_datetime); + + update_post_meta($post_id, 'mec_end_date', $end_date); + update_post_meta($post_id, 'mec_end_time_hour', $end_time_hour); + update_post_meta($post_id, 'mec_end_time_minutes', $end_time_minutes); + update_post_meta($post_id, 'mec_end_time_ampm', $end_time_ampm); + update_post_meta($post_id, 'mec_end_day_seconds', $day_end_seconds); + update_post_meta($post_id, 'mec_end_datetime', $end_datetime); + + update_post_meta($post_id, 'mec_repeat_status', $repeat_status); + update_post_meta($post_id, 'mec_repeat_type', $repeat_type); + update_post_meta($post_id, 'mec_repeat_interval', $repeat_interval); + update_post_meta($post_id, 'mec_repeat_end', $repeat_end); + update_post_meta($post_id, 'mec_repeat_end_at_occurrences', $repeat_end_at_occurrences); + update_post_meta($post_id, 'mec_repeat_end_at_date', $repeat_end_at_date); + update_post_meta($post_id, 'mec_advanced_days', $advanced); + + // Event Sequence (Used in iCal feed) + $sequence = (int) get_post_meta($post_id, 'mec_sequence', true); + update_post_meta($post_id, 'mec_sequence', ($sequence + 1)); + + // For Event Notification Badge. + if(!current_user_can('administrator')) update_post_meta($post_id, 'mec_event_date_submit', date('YmdHis', current_time('timestamp', 0))); + + // Creating $event array for inserting in mec_events table + $event = array( + 'post_id' => $post_id, + 'start' => $start_date, + 'repeat' => $repeat_status, + 'rinterval' => (!in_array($repeat_type, array('daily', 'weekly', 'monthly')) ? null : $repeat_interval), + 'time_start' => $day_start_seconds, + 'time_end' => $day_end_seconds, + ); + + $year = null; + $month = null; + $day = null; + $week = null; + $weekday = null; + $weekdays = null; + + // MEC weekdays + $mec_weekdays = $this->main->get_weekdays(); + + // MEC weekends + $mec_weekends = $this->main->get_weekends(); + + $plus_date = ''; + if($repeat_type == 'daily') + { + $plus_date = '+' . $repeat_end_at_occurrences * $repeat_interval . ' Days'; + } + elseif($repeat_type == 'weekly') + { + $plus_date = '+' . $repeat_end_at_occurrences * ($repeat_interval) . ' Days'; + } + elseif($repeat_type == 'weekday') + { + $repeat_interval = 1; + $plus_date = '+' . $repeat_end_at_occurrences * $repeat_interval . ' Weekdays'; + + $weekdays = ',' . implode(',', $mec_weekdays) . ','; + } + elseif($repeat_type == 'weekend') + { + $repeat_interval = 1; + $plus_date = '+' . round($repeat_end_at_occurrences / 2) * ($repeat_interval * 7) . ' Days'; + + $weekdays = ',' . implode(',', $mec_weekends) . ','; + } + elseif($repeat_type == 'certain_weekdays') + { + $repeat_interval = 1; + $plus_date = '+' . ceil(($repeat_end_at_occurrences * $repeat_interval) * (7 / count($certain_weekdays))) . ' days'; + + $weekdays = ',' . implode(',', $certain_weekdays) . ','; + } + elseif($repeat_type == 'monthly') + { + $plus_date = '+' . $repeat_end_at_occurrences * $repeat_interval . ' Months'; + + $year = '*'; + $month = '*'; + + $s = $start_date; + $e = $end_date; + + $_days = []; + while(strtotime($s) <= strtotime($e)) + { + $_days[] = date('d', strtotime($s)); + $s = date('Y-m-d', strtotime('+1 Day', strtotime($s))); + } + + $day = ',' . implode(',', array_unique($_days)) . ','; + + $week = '*'; + $weekday = '*'; + } + elseif($repeat_type == 'yearly') + { + $plus_date = '+' . $repeat_end_at_occurrences * $repeat_interval . ' Years'; + + $year = '*'; + + $s = $start_date; + $e = $end_date; + + $_months = []; + $_days = []; + while(strtotime($s) <= strtotime($e)) + { + $_months[] = date('m', strtotime($s)); + $_days[] = date('d', strtotime($s)); + + $s = date('Y-m-d', strtotime('+1 Day', strtotime($s))); + } + + $_months = array_unique($_months); + + $month = ',' . implode(',', array($_months[0])) . ','; + $day = ',' . implode(',', array_unique($_days)) . ','; + + $week = '*'; + $weekday = '*'; + } + elseif($repeat_type == "advanced") + { + // Render class object + $this->render = $this->getRender(); + + // Get finish date + $event_info = array('start' => $date['start'], 'end' => $date['end']); + $dates = $this->render->generate_advanced_days($advanced, $event_info, $repeat_end_at_occurrences, $start_date, 'events'); + + $period_date = $this->main->date_diff($start_date, end($dates)['end']['date']); + $plus_date = '+' . $period_date->days . ' Days'; + } + + $in_days_arr = (isset($_mec['in_days']) and is_array($_mec['in_days']) and count($_mec['in_days'])) ? array_unique($_mec['in_days']) : []; + $not_in_days_arr = (isset($_mec['not_in_days']) and is_array($_mec['not_in_days']) and count($_mec['not_in_days'])) ? array_unique($_mec['not_in_days']) : []; + + $in_days = ''; + if(count($in_days_arr)) + { + if(isset($in_days_arr[':i:'])) unset($in_days_arr[':i:']); + + $in_days_arr = array_map(function($value) + { + $ex = explode(':', $value); + + $in_days_times = ''; + if(isset($ex[2]) and isset($ex[3])) + { + $in_days_start_time = $ex[2]; + $in_days_end_time = $ex[3]; + + // If 24 hours format is enabled then convert it back to 12 hours + if(isset($this->settings['time_format']) and $this->settings['time_format'] == 24) + { + $ex_start_time = explode('-', $in_days_start_time); + $ex_end_time = explode('-', $in_days_end_time); + + $in_days_start_hour = $ex_start_time[0]; + $in_days_start_minutes = $ex_start_time[1]; + $in_days_start_ampm = $ex_start_time[2]; + + $in_days_end_hour = $ex_end_time[0]; + $in_days_end_minutes = $ex_end_time[1]; + $in_days_end_ampm = $ex_end_time[2]; + + if(trim($in_days_start_ampm) == '') + { + if($in_days_start_hour < 12) $in_days_start_ampm = 'AM'; + elseif($in_days_start_hour == 12) $in_days_start_ampm = 'PM'; + elseif($in_days_start_hour > 12) + { + $in_days_start_hour -= 12; + $in_days_start_ampm = 'PM'; + } + elseif($in_days_start_hour == 0) + { + $in_days_start_hour = 12; + $in_days_start_ampm = 'AM'; + } + } + + if(trim($in_days_end_ampm) == '') + { + if($in_days_end_hour < 12) $in_days_end_ampm = 'AM'; + elseif($in_days_end_hour == 12) $in_days_end_ampm = 'PM'; + elseif($in_days_end_hour > 12) + { + $in_days_end_hour -= 12; + $in_days_end_ampm = 'PM'; + } + elseif($in_days_end_hour == 0) + { + $in_days_end_hour = 12; + $in_days_end_ampm = 'AM'; + } + } + + if(strlen($in_days_start_hour) == 1) $in_days_start_hour = '0'.$in_days_start_hour; + if(strlen($in_days_start_minutes) == 1) $in_days_start_minutes = '0'.$in_days_start_minutes; + + if(strlen($in_days_end_hour) == 1) $in_days_end_hour = '0'.$in_days_end_hour; + if(strlen($in_days_end_minutes) == 1) $in_days_end_minutes = '0'.$in_days_end_minutes; + + $in_days_start_time = $in_days_start_hour.'-'.$in_days_start_minutes.'-'.$in_days_start_ampm; + $in_days_end_time = $in_days_end_hour.'-'.$in_days_end_minutes.'-'.$in_days_end_ampm; + } + + $in_days_times = ':'.$in_days_start_time.':'.$in_days_end_time; + } + + return $this->main->standardize_format($ex[0]) . ':' . $this->main->standardize_format($ex[1]).$in_days_times; + }, $in_days_arr); + + usort($in_days_arr, function($a, $b) + { + $ex_a = explode(':', $a); + $ex_b = explode(':', $b); + + $date_a = $ex_a[0]; + $date_b = $ex_b[0]; + + $in_day_a_time_label = ''; + if(isset($ex_a[2])) + { + $in_day_a_time = $ex_a[2]; + $pos = strpos($in_day_a_time, '-'); + if($pos !== false) $in_day_a_time_label = substr_replace($in_day_a_time, ':', $pos, 1); + + $in_day_a_time_label = str_replace('-', ' ', $in_day_a_time_label); + } + + $in_day_b_time_label = ''; + if(isset($ex_b[2])) + { + $in_day_b_time = $ex_b[2]; + $pos = strpos($in_day_b_time, '-'); + if($pos !== false) $in_day_b_time_label = substr_replace($in_day_b_time, ':', $pos, 1); + + $in_day_b_time_label = str_replace('-', ' ', $in_day_b_time_label); + } + + return strtotime(trim($date_a.' '.$in_day_a_time_label)) - strtotime(trim($date_b.' '.$in_day_b_time_label)); + }); + + if(!isset($in_days_arr[':i:'])) $in_days_arr[':i:'] = ':val:'; + foreach($in_days_arr as $key => $in_day_arr) + { + if(is_numeric($key)) $in_days .= $in_day_arr . ','; + } + } + + $not_in_days = ''; + if(count($not_in_days_arr)) + { + foreach($not_in_days_arr as $key => $not_in_day_arr) + { + if(is_numeric($key)) $not_in_days .= $this->main->standardize_format( $not_in_day_arr ) . ','; + } + } + + $in_days = trim($in_days, ', '); + $not_in_days = trim($not_in_days, ', '); + + update_post_meta($post_id, 'mec_in_days', $in_days); + update_post_meta($post_id, 'mec_not_in_days', $not_in_days); + + // Repeat End Date + if($repeat_end == 'date') $repeat_end_date = $repeat_end_at_date; + elseif($repeat_end == 'occurrences') + { + if($plus_date) $repeat_end_date = date('Y-m-d', strtotime($plus_date, strtotime($end_date))); + else $repeat_end_date = '0000-00-00'; + } + else $repeat_end_date = '0000-00-00'; + + // If event is not repeating then set the end date of event correctly + if(!$repeat_status or $repeat_type == 'custom_days') $repeat_end_date = $end_date; + + // Add parameters to the $event + $event['end'] = $repeat_end_date; + $event['year'] = $year; + $event['month'] = $month; + $event['day'] = $day; + $event['week'] = $week; + $event['weekday'] = $weekday; + $event['weekdays'] = $weekdays; + $event['days'] = $in_days; + $event['not_in_days'] = $not_in_days; + + // Update MEC Events Table + $mec_event_id = $this->db->select("SELECT `id` FROM `#__mec_events` WHERE `post_id`='$post_id'", 'loadResult'); + + if(!$mec_event_id) + { + $q1 = ''; + $q2 = ''; + + foreach($event as $key => $value) + { + $q1 .= "`$key`,"; + + if(is_null($value)) $q2 .= 'NULL,'; + else $q2 .= "'$value',"; + } + + $this->db->q('INSERT INTO `#__mec_events` (' . trim($q1, ', ') . ') VALUES (' . trim($q2, ', ') . ')', 'INSERT'); + } + else + { + $q = ''; + + foreach($event as $key => $value) + { + if(is_null($value)) $q .= "`$key`=NULL,"; + else $q .= "`$key`='$value',"; + } + + $this->db->q('UPDATE `#__mec_events` SET ' . trim($q, ', ') . " WHERE `id`='$mec_event_id'"); + } + + // Update Schedule + $schedule = $this->getSchedule(); + $schedule->reschedule($post_id, $schedule->get_reschedule_maximum($repeat_type)); + + // Hourly Schedule Options + $raw_hourly_schedules = $_mec['hourly_schedules'] ?? []; + unset($raw_hourly_schedules[':d:']); + + $hourly_schedules = []; + foreach($raw_hourly_schedules as $raw_hourly_schedule) + { + if(isset($raw_hourly_schedule['schedules'][':i:'])) unset($raw_hourly_schedule['schedules'][':i:']); + $hourly_schedules[] = $raw_hourly_schedule; + } + + update_post_meta($post_id, 'mec_hourly_schedules', $hourly_schedules); + + // Booking and Ticket Options + $booking = $_mec['booking'] ?? []; + update_post_meta($post_id, 'mec_booking', $booking); + + $tickets = $_mec['tickets'] ?? []; + if(isset($tickets[':i:'])) unset($tickets[':i:']); + + // Unset Ticket Dats + if(count($tickets)) + { + $new_tickets = []; + foreach($tickets as $key => $ticket) + { + unset($ticket['dates'][':j:']); + $ticket_start_time_ampm = ((isset($ticket['ticket_start_time_hour']) and (intval($ticket['ticket_start_time_hour']) > 0 and intval($ticket['ticket_start_time_hour']) < 13) and isset($ticket['ticket_start_time_ampm'])) ? $ticket['ticket_start_time_ampm'] : ''); + $ticket_render_start_time = ((isset($ticket['ticket_start_time_hour']) and $ticket['ticket_start_time_hour']) ? date('h:ia', strtotime(sprintf('%02d', $ticket['ticket_start_time_hour']) . ':' . sprintf('%02d', $ticket['ticket_start_time_minute']) . $ticket_start_time_ampm)) : ''); + $ticket_end_time_ampm = ((isset($ticket['ticket_end_time_hour']) and (intval($ticket['ticket_end_time_hour']) > 0 and intval($ticket['ticket_end_time_hour']) < 13) and isset($ticket['ticket_end_time_ampm'])) ? $ticket['ticket_end_time_ampm'] : ''); + $ticket_render_end_time = ((isset($ticket['ticket_end_time_hour']) and $ticket['ticket_end_time_hour']) ? date('h:ia', strtotime(sprintf('%02d', $ticket['ticket_end_time_hour']) . ':' . sprintf('%02d', $ticket['ticket_end_time_minute']) . $ticket_end_time_ampm)) : ''); + + $ticket['ticket_start_time_hour'] = substr($ticket_render_start_time, 0, 2); + $ticket['ticket_start_time_ampm'] = strtoupper(substr($ticket_render_start_time, 5, 6)); + $ticket['ticket_end_time_hour'] = substr($ticket_render_end_time, 0, 2); + $ticket['ticket_end_time_ampm'] = strtoupper(substr($ticket_render_end_time, 5, 6)); + $ticket['price'] = trim($ticket['price']); + $ticket['limit'] = trim($ticket['limit']); + $ticket['minimum_ticket'] = trim($ticket['minimum_ticket']); + $ticket['stop_selling_value'] = trim($ticket['stop_selling_value']); + $ticket['category_ids'] = !empty( $ticket['category_ids'] ) ? (array) $ticket['category_ids'] : []; + + // Bellow conditional block code is used to change ticket dates format to compatible ticket past dates structure for store in db. + foreach($ticket['dates'] as $dates_ticket_key => $dates_ticket_values) + { + if(isset($dates_ticket_values['start']) and trim($dates_ticket_values['start'])) + { + $ticket['dates'][$dates_ticket_key]['start'] = $this->main->standardize_format($dates_ticket_values['start']); + } + + if(isset($dates_ticket_values['end']) and trim($dates_ticket_values['end'])) + { + $ticket['dates'][$dates_ticket_key]['end'] = $this->main->standardize_format($dates_ticket_values['end']); + } + } + + $ticket['id'] = $key; + $new_tickets[$key] = $ticket; + } + + $tickets = $new_tickets; + } + + update_post_meta($post_id, 'mec_tickets', $tickets); + update_post_meta($post_id, 'mec_global_tickets_applied', 1); + + // Fee options + $fees_global_inheritance = isset($_mec['fees_global_inheritance']) ? sanitize_text_field($_mec['fees_global_inheritance']) : 1; + update_post_meta($post_id, 'mec_fees_global_inheritance', $fees_global_inheritance); + + $fees = $_mec['fees'] ?? []; + if(isset($fees[':i:'])) unset($fees[':i:']); + + update_post_meta($post_id, 'mec_fees', $fees); + + // Ticket Variations options + $ticket_variations_global_inheritance = isset($_mec['ticket_variations_global_inheritance']) ? sanitize_text_field($_mec['ticket_variations_global_inheritance']) : 1; + update_post_meta($post_id, 'mec_ticket_variations_global_inheritance', $ticket_variations_global_inheritance); + + $ticket_variations = $_mec['ticket_variations'] ?? []; + if(isset($ticket_variations[':i:'])) unset($ticket_variations[':i:']); + + update_post_meta($post_id, 'mec_ticket_variations', $ticket_variations); + + // Registration Fields options + $reg_fields_global_inheritance = isset($_mec['reg_fields_global_inheritance']) ? sanitize_text_field($_mec['reg_fields_global_inheritance']) : 1; + update_post_meta($post_id, 'mec_reg_fields_global_inheritance', $reg_fields_global_inheritance); + + $reg_fields = $_mec['reg_fields'] ?? []; + if($reg_fields_global_inheritance) $reg_fields = []; + + do_action('mec_save_reg_fields', $post_id, $reg_fields); + update_post_meta($post_id, 'mec_reg_fields', $reg_fields); + + $bfixed_fields = $_mec['bfixed_fields'] ?? []; + if($reg_fields_global_inheritance) $bfixed_fields = []; + + do_action('mec_save_bfixed_fields', $post_id, $bfixed_fields); + update_post_meta($post_id, 'mec_bfixed_fields', $bfixed_fields); + + // Organizer Payment Options + $op = $_mec['op'] ?? []; + update_post_meta($post_id, 'mec_op', $op); + update_user_meta(get_post_field('post_author', $post_id), 'mec_op', $op); + + // MEC Fields + $fields = (isset($_mec['fields']) and is_array($_mec['fields'])) ? $_mec['fields'] : []; + update_post_meta($post_id, 'mec_fields', $fields); + + // Save fields one by one + foreach($fields as $field_id=>$values) + { + if(is_array($values)) + { + $values = array_unique($values); + $values = implode(',', $values); + } + + update_post_meta($post_id, 'mec_fields_'.$field_id, sanitize_text_field($values)); + } + + // Downloadable File + if(isset($_mec['downloadable_file'])) + { + $dl_file = sanitize_text_field($_mec['downloadable_file']); + update_post_meta($post_id, 'mec_dl_file', $dl_file); + } + + // Public Download Module File + if(isset($_mec['public_download_module_file'])) + { + $public_dl_file = isset($_mec['public_download_module_file']) ? sanitize_text_field($_mec['public_download_module_file']) : ''; + update_post_meta($post_id, 'mec_public_dl_file', $public_dl_file); + + $public_dl_title = isset($_mec['public_download_module_title']) ? sanitize_text_field($_mec['public_download_module_title']) : ''; + update_post_meta($post_id, 'mec_public_dl_title', $public_dl_title); + + $public_dl_description = isset($_mec['public_download_module_description']) ? sanitize_text_field($_mec['public_download_module_description']) : ''; + update_post_meta($post_id, 'mec_public_dl_description', $public_dl_description); + } + + // Event Gallery + $gallery = (isset($_mec['event_gallery']) and is_array($_mec['event_gallery'])) ? $_mec['event_gallery'] : []; + update_post_meta($post_id, 'mec_event_gallery', $gallery); + + // Related Events + $related_events = (isset($_mec['related_events']) and is_array($_mec['related_events'])) ? $_mec['related_events'] : []; + update_post_meta($post_id, 'mec_related_events', $related_events); + + // Event Banner + $event_banner = (isset($_mec['banner']) and is_array($_mec['banner'])) ? $_mec['banner'] : []; + update_post_meta($post_id, 'mec_banner', $event_banner); + + // Notifications + if(isset($_mec['notifications'])) + { + $notifications = (isset($_mec['notifications']) and is_array($_mec['notifications'])) ? $_mec['notifications'] : []; + update_post_meta($post_id, 'mec_notifications', $notifications); + } + + // Event Dates Changed? + if($prev_start_datetime and $prev_end_datetime and !$repeat_status and $prev_start_datetime != $start_datetime and $prev_end_datetime != $end_datetime) + { + $this->main->event_date_updated($post_id, $prev_start_datetime, $prev_end_datetime); + } + + $mec_update = (isset($_REQUEST['original_publish']) and strtolower(trim(sanitize_text_field($_REQUEST['original_publish']))) == 'publish') ? false : true; + do_action('mec_after_publish_admin_event', $post_id, $mec_update); + + // Save Event Data + do_action('mec_save_event_data', $post_id, $_mec); + } + + public function quick_edit($post_id) + { + // Validating And Verifying + if((!isset($_POST['screen']) || trim($_POST['screen']) != 'edit-mec-events') and !check_ajax_referer('inlineeditnonce', '_inline_edit', false)) return; + + $mec_locations = (isset($_POST['tax_input']['mec_location']) and trim($_POST['tax_input']['mec_location'])) ? array_filter(explode(',', sanitize_text_field($_POST['tax_input']['mec_location']))) : NULL; + $mec_organizers = (isset($_POST['tax_input']['mec_organizer']) and trim($_POST['tax_input']['mec_organizer'])) ? array_filter(explode(',', sanitize_text_field($_POST['tax_input']['mec_organizer']))) : NULL; + + // MEC Locations Quick Edit + $this->mec_locations_edit($post_id, $mec_locations, 'quick_edit'); + + // MEC Organizers Quick Edit + $this->mec_organizers_edit($post_id, $mec_organizers, 'quick_edit'); + } + + /** + * Publish an event + * @author Webnus + * @param string $new + * @param string $old + * @param WP_Post $post + * @return void + */ + public function event_published($new, $old, $post) + { + if($post->post_type !== $this->PT) return; + + // Fires after publish an event to send notifications etc. + do_action('mec_event_published', $new, $old, $post); + + // Update Status + $this->db->q("UPDATE `#__mec_dates` SET `status`='".esc_sql($new)."' WHERE `post_id`='".esc_sql($post->ID)."'"); + } + + /** + * Remove MEC event data after deleting a post permanently + * + * @author Webnus + * @param int $post_id + * @return boolean + */ + public function delete_event($post_id) + { + $post = get_post($post_id); + if($post->post_type !== $this->PT) return false; + + $this->db->q("DELETE FROM `#__mec_events` WHERE `post_id`='$post_id'"); + $this->db->q("DELETE FROM `#__mec_dates` WHERE `post_id`='$post_id'"); + $this->db->q("DELETE FROM `#__mec_occurrences` WHERE `post_id`='$post_id'"); + + return true; + } + + public function add_buttons($which) + { + $screen = get_current_screen(); + if($which === 'top' and $screen->post_type === $this->PT) + { + echo ''.esc_html__('Expired Events', 'modern-events-calendar-lite').''; + echo ' '.esc_html__('Upcoming Events', 'modern-events-calendar-lite').''; + } + } + + /** + * Add filter options in manage events page + * + * @author Webnus + * @param string $post_type + * @return void + */ + public function add_filters($post_type) + { + if($post_type != $this->PT) return; + + $datepicker_format = 'Y-m-d'; + $start_date = isset( $_GET['mec_start_date'] ) ? $_GET['mec_start_date'] : ''; + echo ''; + + $taxonomy = 'mec_label'; + if(wp_count_terms($taxonomy)) + { + wp_dropdown_categories( + array( + 'show_option_all' => sprintf(esc_html__('Show all %s', 'modern-events-calendar-lite'), $this->main->m('taxonomy_labels', esc_html__('labels', 'modern-events-calendar-lite'))), + 'taxonomy' => $taxonomy, + 'name' => $taxonomy, + 'value_field' => 'slug', + 'orderby' => 'name', + 'order' => 'ASC', + 'selected' => (isset($_GET[$taxonomy]) ? sanitize_text_field($_GET[$taxonomy]) : ''), + 'show_count' => false, + 'hide_empty' => false, + ) + ); + } + + $taxonomy = 'mec_location'; + if(wp_count_terms($taxonomy)) + { + wp_dropdown_categories( + array( + 'show_option_all' => sprintf(esc_html__('Show all %s', 'modern-events-calendar-lite'), $this->main->m('taxonomy_locations', esc_html__('locations', 'modern-events-calendar-lite'))), + 'taxonomy' => $taxonomy, + 'name' => $taxonomy, + 'value_field' => 'slug', + 'orderby' => 'name', + 'order' => 'ASC', + 'selected' => (isset($_GET[$taxonomy]) ? sanitize_text_field($_GET[$taxonomy]) : ''), + 'show_count' => false, + 'hide_empty' => false, + ) + ); + } + + $taxonomy = 'mec_organizer'; + if(wp_count_terms($taxonomy)) + { + wp_dropdown_categories( + array( + 'show_option_all' => sprintf(esc_html__('Show all %s', 'modern-events-calendar-lite'), $this->main->m('taxonomy_organizers', esc_html__('organizers', 'modern-events-calendar-lite'))), + 'taxonomy' => $taxonomy, + 'name' => $taxonomy, + 'value_field' => 'slug', + 'orderby' => 'name', + 'order' => 'ASC', + 'selected' => (isset($_GET[$taxonomy]) ? sanitize_text_field($_GET[$taxonomy]) : ''), + 'show_count' => false, + 'hide_empty' => false, + ) + ); + } + + $taxonomy = 'mec_category'; + if(wp_count_terms($taxonomy)) + { + wp_dropdown_categories( + array( + 'show_option_all' => sprintf(esc_html__('Show all %s', 'modern-events-calendar-lite'), $this->main->m('taxonomy_categorys', esc_html__('Categories', 'modern-events-calendar-lite'))), + 'taxonomy' => $taxonomy, + 'name' => $taxonomy, + 'value_field' => 'slug', + 'orderby' => 'name', + 'order' => 'ASC', + 'selected' => (isset($_GET[$taxonomy]) ? sanitize_text_field($_GET[$taxonomy]) : ''), + 'show_count' => false, + 'hide_empty' => false, + ) + ); + } + + // Lightbox + echo ' +
    +
    '. esc_html__('Attendees List', 'modern-events-calendar-lite') .'
    +
    +
    + +
    +
    + +
    +
    +
    '; + } + + /** + * Filters columns of events feature + * + * @author Webnus + * @param array $columns + * @return array + */ + public function filter_columns($columns) + { + unset($columns['comments']); + unset($columns['date']); + unset($columns['tags']); + + $columns['title'] = esc_html__('Title', 'modern-events-calendar-lite'); + $columns['category'] = esc_html__('Category', 'modern-events-calendar-lite'); + $columns['location'] = $this->main->m('taxonomy_location', esc_html__('Location', 'modern-events-calendar-lite')); + $columns['organizer'] = $this->main->m('taxonomy_organizer', esc_html__('Organizer', 'modern-events-calendar-lite')); + $columns['start_date'] = esc_html__('Start Date', 'modern-events-calendar-lite'); + $columns['end_date'] = esc_html__('End Date', 'modern-events-calendar-lite'); + + // Sold Tickets + if($this->getPRO() && isset($this->settings['booking_status']) && $this->settings['booking_status']) $columns['tickets'] = esc_html__('Tickets', 'modern-events-calendar-lite'); + + $columns['repeat'] = esc_html__('Repeat', 'modern-events-calendar-lite'); + return $columns; + } + + /** + * Filters sortable columns of events feature + * + * @author Webnus + * @param array $columns + * @return array + */ + public function filter_sortable_columns($columns) + { + $columns['start_date'] = 'start_date'; + $columns['end_date'] = 'end_date'; + + return $columns; + } + + /** + * Filters columns content of events feature + * + * @author Webnus + * @param string $column_name + * @param int $post_id + * @return string + */ + public function filter_columns_content($column_name, $post_id) + { + if($column_name == 'location') + { + $location = get_term(get_post_meta($post_id, 'mec_location_id', true)); + echo (isset($location->name) && 'uncategorized' !== $location->slug ? esc_html($location->name) : '----'); + } + elseif($column_name == 'organizer') + { + $organizer = get_term(get_post_meta($post_id, 'mec_organizer_id', true)); + echo (isset($organizer->name) && 'uncategorized' !== $organizer->slug ? esc_html($organizer->name) : '----'); + } + elseif($column_name == 'start_date') + { + $datetime_format = get_option('date_format', 'Y-n-d').' '.get_option('time_format', 'H:i'); + $date = get_post_meta($post_id, 'mec_start_date', true); + + echo esc_html($this->main->date_i18n($datetime_format, (strtotime($date) + ((int) get_post_meta($post_id, 'mec_start_day_seconds', true))), $post_id)); + } + elseif($column_name == 'end_date') + { + $datetime_format = get_option('date_format', 'Y-n-d').' '.get_option('time_format', 'H:i'); + $date = get_post_meta($post_id, 'mec_end_date', true); + + echo esc_html($this->main->date_i18n($datetime_format, (strtotime($date) + ((int) get_post_meta($post_id, 'mec_end_day_seconds', true))), $post_id)); + } + elseif($column_name == 'tickets') + { + $book = $this->getBook(); + + echo esc_html($book->get_all_sold_tickets($post_id)).' / '.$book->get_total_tickets($post_id); + } + elseif($column_name == 'repeat') + { + $repeat_type = get_post_meta($post_id, 'mec_repeat_type', true); + echo esc_html(ucwords(str_replace('_', ' ', $repeat_type))); + } + elseif($column_name == 'category') + { + $post_categories = get_the_terms($post_id, 'mec_category'); + if($post_categories) foreach($post_categories as $post_category) $categories[] = $post_category->name; + if(!empty($categories)) + { + $category_name = implode(",", $categories); + echo esc_html($category_name); + } + } + } + + /** + * Sort events if sorted by custom columns + * + * @author Webnus + * @param object $query + * @return void + */ + public function filter($query) + { + if(!is_admin() or $query->get('post_type') != $this->PT) return; + + $meta_query = []; + $order_query = []; + + $orderby = $query->get('orderby'); + $order = $query->get('order'); + + $expired = (isset($_REQUEST['mec-expired']) ? sanitize_text_field($_REQUEST['mec-expired']) : 0); + if($expired) + { + $today = current_time('Y-m-d'); + $today_seconds = $this->main->time_to_seconds(current_time('H'), current_time('i'), current_time('s')); + + $expired_ids = $this->db->select("SELECT post_id FROM `#__mec_events` WHERE `end` != '0000-00-00' AND `end` < '".$today."' OR (`end` = '".$today."' AND `time_end` <= '".$today_seconds."')", 'loadColumn'); + + $filtered_ids = []; + foreach($expired_ids as $expired_id) + { + $custom_days = $this->db->select("SELECT days FROM `#__mec_events` WHERE `post_id` = '".esc_sql($expired_id)."'", 'loadResult'); + if(!$custom_days) $filtered_ids[] = $expired_id; + else + { + $ex = explode(',', $custom_days); + $last = end($ex); + + $parts = explode(':', $last); + + $last_date = $parts[1] ?? ''; + $last_time = $parts[3] ?? ''; + $last_time = str_replace('-AM', ' AM', $last_time); + $last_time = str_replace('-PM', ' PM', $last_time); + $last_time = str_replace('-', ':', $last_time); + + $last_datetime = $last_date.' '.$last_time; + if(trim($last_datetime) === '' || strtotime($last_datetime) < current_time('timestamp')) $filtered_ids[] = $expired_id; + } + } + + if(!count($filtered_ids)) $filtered_ids = [0]; + + $query->set('post__in', $filtered_ids); + + if(!trim($orderby)) $orderby = 'end_date'; + if(!trim($order)) $order = 'asc'; + } + + $upcoming = (isset($_REQUEST['mec-upcoming']) ? sanitize_text_field($_REQUEST['mec-upcoming']) : 0); + if($upcoming) + { + $now = current_time('Y-m-d H:i:s'); + + $post_id_rows = $this->db->select("SELECT `post_id` FROM `#__mec_dates` WHERE `tstart` >= '".strtotime($now)."' GROUP BY `post_id`", 'loadObjectList'); + + $post_ids = []; + foreach($post_id_rows as $post_id_row) $post_ids[] = $post_id_row->post_id; + + $post_ids = array_unique($post_ids); + $query->set('post__in', $post_ids); + + if(!trim($orderby)) $orderby = 'start_date'; + } + + if($orderby == 'start_date') + { + $meta_query['mec_start_date'] = array( + 'key' => 'mec_start_date', + ); + + $meta_query['mec_start_day_seconds'] = array( + 'key' => 'mec_start_day_seconds', + ); + + $order_query = array( + 'mec_start_date' => $query->get('order'), + 'mec_start_day_seconds' => $query->get('order'), + ); + } + elseif($orderby == 'end_date') + { + $meta_query['mec_end_date'] = array( + 'key' => 'mec_end_date', + ); + + $meta_query['mec_end_day_seconds'] = array( + 'key' => 'mec_end_day_seconds', + ); + + $order_query = array( + 'mec_end_date' => $order, + 'mec_end_day_seconds' => $order, + ); + } + + $start_date = isset( $_GET['mec_start_date'] ) ? $_GET['mec_start_date'] : ''; + if( !empty( $start_date ) ){ + + $meta_query['mec_start_date'] = array( + 'key' => 'mec_start_date', + 'value' => date( 'Y-m-d', strtotime( $start_date ) ), + 'compare' => '=', + 'type' => 'DATE' + ); + } + + if(count($meta_query)) $query->set('meta_query', $meta_query); + if(count($order_query)) $query->set('orderby', $order_query); + } + + public function add_bulk_actions() + { + global $post_type; + + if ($post_type == $this->PT) { + ?> + + current_action(); + if(!$action) return false; + + $post_type = isset($_GET['post_type']) ? sanitize_text_field($_GET['post_type']) : 'post'; + if($post_type != $this->PT) return false; + + check_admin_referer('bulk-posts'); + + switch($action) + { + case 'ical-export': + + $post_ids = (isset($_GET['post']) and is_array($_GET['post']) and count($_GET['post'])) ? array_map('sanitize_text_field', wp_unslash($_GET['post'])) : []; + $events = ''; + + foreach($post_ids as $post_id) $events .= $this->main->ical_single((int) $post_id); + $ical_calendar = $this->main->ical_calendar($events); + + header('Content-type: application/force-download; charset=utf-8'); + header('Content-Disposition: attachment; filename="mec-events-' . date('YmdTHi') . '.ics"'); + + echo MEC_kses::full($ical_calendar); + + exit; + + case 'ms-excel-export': + + $filename = 'mec-events-' . md5(time() . mt_rand(100, 999)) . '.xlsx'; + + $rows = $this->csvexcel(); + $this->main->generate_download_excel($rows, $filename); + + exit; + + case 'csv-export': + + $filename = 'mec-events-' . md5(time() . mt_rand(100, 999)) . '.csv'; + + $rows = $this->csvexcel(); + $this->main->generate_download_csv($rows, $filename); + + exit; + + case 'g-cal-csv-export': + + header('Content-Type: text/csv; charset=utf-8'); + header('Content-Disposition: attachment; filename=mec-events-' . md5(time() . mt_rand(100, 999)) . '.csv'); + + $this->gcalcsv(); + + exit; + + case 'xml-export': + + $post_ids = (isset($_GET['post']) and is_array($_GET['post']) and count($_GET['post'])) ? array_map('sanitize_text_field', wp_unslash($_GET['post'])) : []; + + $events = []; + foreach($post_ids as $post_id) $events[] = $this->main->export_single((int) $post_id); + + $xml_feed = $this->main->xml_convert(array('events' => $events)); + + header('Content-type: application/force-download; charset=utf-8'); + header('Content-Disposition: attachment; filename="mec-events-' . date('YmdTHi') . '.xml"'); + + echo $xml_feed; + + exit; + + case 'json-export': + + $post_ids = (isset($_GET['post']) and is_array($_GET['post']) and count($_GET['post'])) ? array_map('sanitize_text_field', wp_unslash($_GET['post'])) : []; + + $events = []; + foreach($post_ids as $post_id) $events[] = $this->main->export_single((int) $post_id); + + header('Content-type: application/force-download; charset=utf-8'); + header('Content-Disposition: attachment; filename="mec-events-' . date('YmdTHi') . '.json"'); + + echo json_encode($events); + + exit; + + case 'duplicate': + + $post_ids = (isset($_GET['post']) and is_array($_GET['post']) and count($_GET['post'])) ? array_map('sanitize_text_field', wp_unslash($_GET['post'])) : []; + foreach($post_ids as $post_id) $this->main->duplicate((int) $post_id); + + break; + + default: + return false; + } + + wp_redirect('edit.php?post_type=' . $this->main->get_main_post_type()); + exit; + } + + public function csvexcel($export_all = false) + { + // MEC Render Library + $render = $this->getRender(); + + if($export_all) $post_ids = get_posts('post_type=mec-events&fields=ids&posts_per_page=-1'); + else $post_ids = (isset($_GET['post']) and is_array($_GET['post']) and count($_GET['post'])) ? array_map('sanitize_text_field', wp_unslash($_GET['post'])) : []; + + $columns = array( + esc_html__('ID', 'modern-events-calendar-lite'), + esc_html__('Title', 'modern-events-calendar-lite'), + esc_html__('Description', 'modern-events-calendar-lite'), + esc_html__('Start Date', 'modern-events-calendar-lite'), + esc_html__('Start Time', 'modern-events-calendar-lite'), + esc_html__('End Date', 'modern-events-calendar-lite'), + esc_html__('End Time', 'modern-events-calendar-lite'), + esc_html__('Link', 'modern-events-calendar-lite'), + $this->main->m('taxonomy_location', esc_html__('Location', 'modern-events-calendar-lite')), + esc_html__('Address', 'modern-events-calendar-lite'), + $this->main->m('taxonomy_organizer', esc_html__('Organizer', 'modern-events-calendar-lite')), + sprintf(esc_html__('%s Tel', 'modern-events-calendar-lite'), $this->main->m('taxonomy_organizer', esc_html__('Organizer', 'modern-events-calendar-lite'))), + sprintf(esc_html__('%s Email', 'modern-events-calendar-lite'), $this->main->m('taxonomy_organizer', esc_html__('Organizer', 'modern-events-calendar-lite'))), + $this->main->m('event_cost', esc_html__('Event Cost', 'modern-events-calendar-lite')), + esc_html__('Featured Image', 'modern-events-calendar-lite'), + esc_html__('Labels', 'modern-events-calendar-lite'), + esc_html__('Categories', 'modern-events-calendar-lite'), + esc_html__('Tags', 'modern-events-calendar-lite'), + ); + + // Speakers + if(isset($this->settings['speakers_status']) and $this->settings['speakers_status']) $columns[] = esc_html__('Speakers', 'modern-events-calendar-lite'); + + // Event Fields + $fields = $this->main->get_event_fields(); + if(!is_array($fields)) $fields = []; + + foreach($fields as $f => $field) + { + if(!is_numeric($f)) continue; + if(!isset($field['label']) or trim($field['label']) == '') continue; + + $columns[] = stripslashes($field['label']); + } + + $rows = []; + $rows[] = $columns; + + foreach($post_ids as $post_id) + { + $post_id = (int) $post_id; + + $data = $render->data($post_id); + $dates = $render->dates($post_id, $data); + $date = $dates[0] ?? []; + + // No Date + if(!count($date)) continue; + + $location = $data->locations[$data->meta['mec_location_id']] ?? []; + $organizer = $data->organizers[$data->meta['mec_organizer_id']] ?? []; + $cost = $data->meta['mec_cost'] ?? null; + + $taxonomies = array('mec_label', 'mec_category', apply_filters('mec_taxonomy_tag', '')); + if(isset($this->settings['speakers_status']) and $this->settings['speakers_status']) $taxonomies[] = 'mec_speaker'; + + $labels = []; + $categories = []; + $tags = []; + $speakers = []; + + $terms = wp_get_post_terms($post_id, $taxonomies, array('fields'=>'all')); + foreach($terms as $term) + { + // First Validation + if(!isset($term->taxonomy)) continue; + + if($term->taxonomy == 'mec_label') $labels[] = $term->name; + elseif($term->taxonomy == 'mec_category') $categories[] = $term->name; + elseif($term->taxonomy == apply_filters('mec_taxonomy_tag', '')) $tags[] = $term->name; + elseif($term->taxonomy == 'mec_speaker') $speakers[] = $term->name; + } + + $event = array( + $post_id, + html_entity_decode($data->title, ENT_QUOTES | ENT_HTML5), + html_entity_decode(strip_tags($data->content), ENT_QUOTES | ENT_HTML5), + $date['start']['date'], + $data->time['start'], + $date['end']['date'], + $data->time['end'], + $data->permalink, + ($location['name'] ?? ''), + ($location['address'] ?? ''), + ($organizer['name'] ?? ''), + ($organizer['tel'] ?? ''), + ($organizer['email'] ?? ''), + (is_numeric($cost) ? $this->main->render_price($cost, $post_id) : $cost), + $this->main->get_post_thumbnail_url($post_id), + implode(', ', $labels), + implode(', ', $categories), + implode(', ', $tags), + ); + + // Speakers + if(isset($this->settings['speakers_status']) and $this->settings['speakers_status']) $event[] = implode(', ', $speakers); + + // Event Fields + if(isset($data->fields) and is_array($data->fields) and count($data->fields)) + { + foreach($data->fields as $field) $event[] = $field['value']; + } + + $rows[] = $event; + } + + return $rows; + } + + public function gcalcsv($export_all = false) + { + // MEC Render Library + $render = $this->getRender(); + + if($export_all) $post_ids = get_posts('post_type=mec-events&fields=ids&posts_per_page=-1'); + else $post_ids = (isset($_GET['post']) and is_array($_GET['post']) and count($_GET['post'])) ? array_map('sanitize_text_field', wp_unslash($_GET['post'])) : []; + + // Do not translate these column names + $columns = array( + 'Subject', + 'Start Date', + 'Start Time', + 'End Date', + 'End Time', + 'All Day Event', + 'Description', + 'Location', + 'Private', + ); + + $delimiter = ','; + + $output = fopen('php://output', 'w'); + fprintf($output, chr(0xEF).chr(0xBB).chr(0xBF)); + fputcsv($output, $columns, $delimiter); + + foreach($post_ids as $post_id) + { + $post_id = (int) $post_id; + + $data = $render->data($post_id); + $dates = $render->dates($post_id, $data); + $date = $dates[0]; + + $start_date = $date['start']['date']; + $start_time = $data->time['start']; + $end_date = $date['end']['date']; + $end_time = $data->time['end']; + + $start_timestamp = isset($date['start'], $date['start']['timestamp']) ? $date['start']['timestamp'] : NULL; + $end_timestamp = isset($date['end'], $date['end']['timestamp']) ? $date['end']['timestamp'] : NULL; + + if($start_timestamp) + { + $start_date = date('m/d/Y', $start_timestamp); + $start_time = date('h:i A', $start_timestamp); + } + + if($end_timestamp) + { + $end_date = date('m/d/Y', $end_timestamp); + $end_time = date('h:i A', $end_timestamp); + } + + $location = $data->locations[$data->meta['mec_location_id']] ?? []; + $allday = (boolean) get_post_meta($post_id, 'mec_allday', true); + + $public = get_post_meta($post_id, 'mec_public', true); + if(trim($public) === '') $public = 1; + + $event = array( + html_entity_decode($data->title, ENT_QUOTES | ENT_HTML5), + $start_date, + $start_time, + $end_date, + $end_time, + ($allday ? 'True' : 'False'), + html_entity_decode(strip_tags($data->content), ENT_QUOTES | ENT_HTML5), + $location['address'] ?? '', + ($public ? 'True' : 'False') + ); + + fputcsv($output, $event, $delimiter); + } + } + + public function action_links($actions, $post) + { + if($post->post_type != $this->PT) return $actions; + + // Editor and Higher + if(current_user_can('edit_post', $post->ID)) + { + // Duplicate Button + $actions['mec-duplicate'] = ''.esc_html__('Duplicate', 'modern-events-calendar-lite').''; + } + + // Booking Button + if($this->getPRO() && current_user_can('edit_others_posts') && isset($this->settings['booking_status']) && $this->settings['booking_status']) $actions['mec-bookings'] = ''.esc_html__('Bookings', 'modern-events-calendar-lite').''; + + // Certificate Button + if($this->getPRO() && isset($this->settings['certificate_status']) && $this->settings['certificate_status']) $actions['mec-send-certificate'] = ''.esc_html__('Send Certificates', 'modern-events-calendar-lite').''; + + return $actions; + } + + public function duplicate_event() + { + // It's not a duplicate request + if(!isset($_GET['mec-action']) or sanitize_text_field($_GET['mec-action']) != 'duplicate-event') return false; + + // Event ID to duplicate + $id = isset($_GET['id']) ? (int) sanitize_text_field($_GET['id']) : 0; + if(!$id) return false; + + // Only editor and higher + if(!current_user_can('edit_post', $id)) return false; + + // Duplicate + $new_post_id = $this->main->duplicate($id); + + wp_redirect('post.php?post=' . $new_post_id . '&action=edit'); + exit; + } + + /** + * Do bulk edit Action + * + * @author Webnus + * @return void + */ + public function bulk_edit() + { + $post_ids = (isset($_GET['post']) and is_array($_GET['post']) and count($_GET['post'])) ? array_map('sanitize_text_field', wp_unslash($_GET['post'])) : []; + if(!count($post_ids)) return; + + $mec_locations = (isset($_GET['tax_input']['mec_location']) and trim($_GET['tax_input']['mec_location'])) ? array_filter(explode(',', sanitize_text_field($_GET['tax_input']['mec_location']))) : NULL; + $mec_organizers = (isset($_GET['tax_input']['mec_organizer']) and trim($_GET['tax_input']['mec_organizer'])) ? array_filter(explode(',', sanitize_text_field($_GET['tax_input']['mec_organizer']))) : NULL; + + if(!$mec_locations and !$mec_organizers) return; + + $taxonomies = []; + if(is_array($mec_locations)) $taxonomies[] = 'mec_location'; + if(is_array($mec_organizers)) $taxonomies[] = 'mec_organizer'; + + $terms = get_terms(array( + 'taxonomy' => $taxonomies, + )); + + foreach($post_ids as $post_id) + { + foreach($terms as $term) + { + $term_objects = get_objects_in_term($term->term_id, $term->taxonomy); + if(in_array($post_id, $term_objects)) wp_remove_object_terms($post_id, $term->term_id, $term->taxonomy); + } + + // MEC Locations Bulk Edit + $this->mec_locations_edit($post_id, $mec_locations); + + // MEC Organizers Bulk Edit + $this->mec_organizers_edit($post_id, $mec_organizers); + } + } + + // MEC Locations Edit. + public function mec_locations_edit($post_id, $mec_locations, $action = 'bulk_edit') + { + if(!is_null($mec_locations)) + { + $term_location = current($mec_locations); + if(!term_exists($term_location, 'mec_location')) wp_insert_term($term_location, 'mec_location', array()); + + $location_id = get_term_by('name', $term_location, 'mec_location')->term_id; + wp_set_object_terms($post_id, (int) $location_id, 'mec_location'); + update_post_meta($post_id, 'mec_location_id', $location_id); + + if(count($mec_locations) > 1) + { + // Additional locations + $additional_location_ids = []; + + for($i = 1; $i < count($mec_locations); $i++) + { + if(!term_exists($mec_locations[$i], 'mec_location')) wp_insert_term($mec_locations[$i], 'mec_location', array()); + + $additional_location_id = get_term_by('name', $mec_locations[$i], 'mec_location')->term_id; + wp_set_object_terms($post_id, (int)$additional_location_id, 'mec_location', true); + $additional_location_ids[] = (int)$additional_location_id; + } + + update_post_meta($post_id, 'mec_additional_location_ids', $additional_location_ids); + } + } + elseif($action == 'quick_edit') + { + update_post_meta($post_id, 'mec_location_id', 0); + update_post_meta($post_id, 'mec_additional_location_ids', array()); + } + } + + // MEC Organizers Edit. + public function mec_organizers_edit($post_id, $mec_organizers, $action = 'bulk_edit') + { + if(!is_null($mec_organizers)) + { + $term_organizer = current($mec_organizers); + if(!term_exists($term_organizer, 'mec_organizer')) wp_insert_term($term_organizer, 'mec_organizer', array()); + + $organizer_id = get_term_by('name', current($mec_organizers), 'mec_organizer')->term_id; + wp_set_object_terms($post_id, (int)$organizer_id, 'mec_organizer'); + update_post_meta($post_id, 'mec_organizer_id', $organizer_id); + + if(count($mec_organizers) > 1) + { + // Additional organizers + $additional_organizer_ids = []; + + for($i = 1; $i < count($mec_organizers); $i++) + { + if(!term_exists($mec_organizers[$i], 'mec_organizer')) wp_insert_term($mec_organizers[$i], 'mec_organizer', array()); + + $additional_organizer_id = get_term_by('name', $mec_organizers[$i], 'mec_organizer')->term_id; + wp_set_object_terms($post_id, (int)$additional_organizer_id, 'mec_organizer', true); + $additional_organizer_ids[] = (int)$additional_organizer_id; + } + + update_post_meta($post_id, 'mec_additional_organizer_ids', $additional_organizer_ids); + } + } + elseif($action == 'quick_edit') + { + update_post_meta($post_id, 'mec_organizer_id', 0); + update_post_meta($post_id, 'mec_additional_organizer_ids', array()); + } + } + + public function icl_duplicate($master_post_id, $lang, $post, $id) + { + $master = get_post($master_post_id); + $target = get_post($id); + + if($master->post_type != $this->PT) return; + if($target->post_type != $this->PT) return; + + $already_duplicated = get_post_meta($id, 'mec_icl_duplicated', true); + if($already_duplicated) return; + + $master_location_id = get_post_meta($master_post_id, 'mec_location_id', true); + $target_location_id = apply_filters('wpml_object_id', $master_location_id, 'mec_location', true, $lang); + + update_post_meta($id, 'mec_location_id', $target_location_id); + + $master_additional_location_ids = get_post_meta($master_post_id, 'mec_additional_location_ids', true); + if(!is_array($master_additional_location_ids)) $master_additional_location_ids = []; + + $target_additional_location_ids = []; + foreach($master_additional_location_ids as $master_additional_location_id) + { + $target_additional_location_ids[] = apply_filters('wpml_object_id', $master_additional_location_id, 'mec_location', true, $lang); + } + + update_post_meta($id, 'mec_additional_location_ids', $target_additional_location_ids); + + $master_organizer_id = get_post_meta($master_post_id, 'mec_organizer_id', true); + $target_organizer_id = apply_filters('wpml_object_id', $master_organizer_id, 'mec_organizer', true, $lang); + + update_post_meta($id, 'mec_organizer_id', $target_organizer_id); + + $master_additional_organizer_ids = get_post_meta($master_post_id, 'mec_additional_organizer_ids', true); + if(!is_array($master_additional_organizer_ids)) $master_additional_organizer_ids = []; + + $target_additional_organizer_ids = []; + foreach($master_additional_organizer_ids as $master_additional_organizer_id) + { + $target_additional_organizer_ids[] = apply_filters('wpml_object_id', $master_additional_organizer_id, 'mec_location', true, $lang); + } + + update_post_meta($id, 'mec_additional_organizer_ids', $target_additional_organizer_ids); + + // MEC Tables + $this->db->q("INSERT INTO `#__mec_events` (`post_id`, `start`, `end`, `repeat`, `rinterval`, `year`, `month`, `day`, `week`, `weekday`, `weekdays`, `days`, `not_in_days`, `time_start`, `time_end`) SELECT '".$id."', `start`, `end`, `repeat`, `rinterval`, `year`, `month`, `day`, `week`, `weekday`, `weekdays`, `days`, `not_in_days`, `time_start`, `time_end` FROM `#__mec_events` WHERE `post_id`='".$master_post_id."'"); + + update_post_meta($id, 'mec_icl_duplicated', 1); + + // Update Schedule + $schedule = $this->getSchedule(); + $schedule->reschedule($id); + } + + public function wpml_pro_translation_saved($new_post_id, $fields, $job) + { + global $iclTranslationManagement; + + $master_post_id = NULL; + if(is_object($job) and $iclTranslationManagement) + { + $element_type_prefix = $iclTranslationManagement->get_element_type_prefix_from_job($job); + $original_post = $iclTranslationManagement->get_post($job->original_doc_id, $element_type_prefix); + + if($original_post) $master_post_id = $original_post->ID; + } + + // Target Language + $lang_options = apply_filters('wpml_post_language_details', NULL, $new_post_id); + $lang = (is_array($lang_options) and isset($lang_options['language_code'])) ? $lang_options['language_code'] : ''; + + // Duplicate Content + if($master_post_id) $this->icl_duplicate($master_post_id, $lang, (new stdClass()), $new_post_id); + } + + public function set_fallback_image_id($value, $post_id, $meta_key, $single) + { + // Only on frontend + if(is_admin() and (!defined('DOING_AJAX') or (defined('DOING_AJAX') and !DOING_AJAX))) return $value; + + // Only for empty _thumbnail_id keys + if(!empty($meta_key) && '_thumbnail_id' !== $meta_key) return $value; + + // Only For Events + if(get_post_type($post_id) != $this->PT) return $value; + + // Get current Cache + $meta_cache = wp_cache_get($post_id, 'post_meta'); + if(!$meta_cache) + { + $meta_cache = update_meta_cache('post', array($post_id)); + $meta_cache = $meta_cache[$post_id] ?? []; + } + + // Is the _thumbnail_id present in cache? + if(!empty($meta_cache['_thumbnail_id'][0])) return $value; + + $fallback_image_id = $this->get_fallback_image_id($post_id); + if(!$fallback_image_id) return $value; + + // Set the Fallback Image in cache + $meta_cache['_thumbnail_id'][0] = $fallback_image_id; + wp_cache_set($post_id, $meta_cache, 'post_meta'); + + return $value; + } + + public function show_fallback_image($html, $post_id, $post_thumbnail_id, $size, $attr) + { + // Only on frontend + if((is_admin() && (!defined('DOING_AJAX') || !DOING_AJAX))) return $html; + + // Only For Events + if(get_post_type($post_id) != $this->PT) return $html; + + $fallback_image_id = $this->get_fallback_image_id($post_id); + + // if an image is set return that image. + if((int) $fallback_image_id !== (int) $post_thumbnail_id) return $html; + + if(isset($attr['class'])) $attr['class'] .= ' mec-fallback-img'; + else + { + $size_class = $size; + if(is_array($size_class)) $size_class = 'size-'.implode('x', $size_class); + + $attr = array('class' => 'attachment-'.$size_class.' default-featured-img'); + } + + return wp_get_attachment_image($fallback_image_id, $size, false, $attr); + } + + public function get_fallback_image_id($event_id) + { + // Categories + $categories = get_the_terms($event_id, 'mec_category'); + if(!is_array($categories) or !count($categories)) return NULL; + + // Fallback Image ID + $fallback_image_id = NULL; + foreach($categories as $category) + { + $fallback_image = get_term_meta($category->term_id, 'mec_cat_fallback_image', true); + if(trim($fallback_image)) + { + $fallback_image_id = attachment_url_to_postid($fallback_image); + if($fallback_image_id) break; + } + } + + return $fallback_image_id; + } + + public function mec_event_bookings() + { + $id = isset($_POST['id']) ? sanitize_text_field($_POST['id']) : 0; + $backend = isset($_POST['backend']) ? sanitize_text_field($_POST['backend']) : 0; + + $p_occurrence = isset($_POST['occurrence']) ? sanitize_text_field($_POST['occurrence']) : NULL; + $occurrence = explode(':', $p_occurrence)[0]; + if($occurrence == 'all') $occurrence = strtotime('+100 years'); + + $bookings = $this->main->get_bookings($id, $occurrence); + $book = $this->getBook(); + + $html = ''; + $total_attendees = 0; + + if(count($bookings)) + { + $html .= '
    +
    + '.esc_html__('Title', 'modern-events-calendar-lite').' +
    + +
    + '.esc_html__('Transaction ID', 'modern-events-calendar-lite').' +
    +
    + '.esc_html__('Price', 'modern-events-calendar-lite').' +
    +
    '; + + /** @var WP_Post $booking */ + foreach($bookings as $booking) + { + $attendees = $book->get_attendees($booking->ID); + + $attendees = apply_filters('mec_filter_event_bookings', $attendees, $booking->ID, $p_occurrence); + $total_attendees += count($attendees); + + $unique_attendees = []; + foreach($attendees as $attendee) + { + if(!isset($unique_attendees[$attendee['email']])) $unique_attendees[$attendee['email']] = $attendee; + else $unique_attendees[$attendee['email']]['count'] += 1; + } + + $attendees_html = ''.count($attendees).''; + $attendees_html .= '
    '; + $attendees_html .= '
      '; + + foreach($unique_attendees as $unique_attendee) + { + $attendees_html .= '
    • '; + $attendees_html .= '
      '.esc_html($unique_attendee['name']).((isset($unique_attendee['count']) and $unique_attendee['count'] > 1) ? ' ('.esc_html($unique_attendee['count']).')' : '').'
      '; + $attendees_html .= ''; + $attendees_html .= '
    • '; + } + + $attendees_html .= '
    '; + $attendees_html .= '
    '; + + $transaction_id = get_post_meta($booking->ID, 'mec_transaction_id', true); + + $price = get_post_meta($booking->ID, 'mec_price', true); + $event_id = get_post_meta($booking->ID, 'mec_event_id', true); + + $price_html = $this->main->render_price(($price ?: 0), $event_id); + $price_html .= ' ('.get_post_meta($booking->ID, 'mec_gateway_label', true).')'; + + $all_dates = get_post_meta($booking->ID, 'mec_all_dates', true); + if(is_array($all_dates) and count($all_dates) > 1) $price_html .= ' '.sprintf(esc_html__('for %s dates', 'modern-events-calendar-lite'), count($all_dates)); + + $html .= '
    '; + $html .= '
    '.($backend ? ''.esc_html($booking->post_title).'' : esc_html($booking->post_title)).'
    '; + $html .= '
    '.MEC_kses::form($attendees_html).'
    '; + $html .= '
    '.esc_html($transaction_id).'
    '; + $html .= '
    '.MEC_kses::element($price_html).'
    '; + $html .= '
    '; + } + } + else + { + $html .= '

    '.esc_html__("No Bookings Found!", 'modern-events-calendar-lite').'

    '; + } + + $html = apply_filters('mec_event_bookings_report', $html, $bookings, $id, $backend, $occurrence, $total_attendees); + + echo json_encode(array('html' => $html, 'found' => (bool) count($bookings))); + exit; + } + + public function gallery_image_upload() + { + // Check if our nonce is set. + if(!isset($_POST['_wpnonce'])) $this->main->response(array('success'=>0, 'code'=>'NONCE_MISSING')); + + // Verify that the nonce is valid. + if(!wp_verify_nonce(sanitize_text_field($_POST['_wpnonce']), 'mec_event_gallery_image_upload')) $this->main->response(array('success'=>0, 'code'=>'NONCE_IS_INVALID')); + + $images = (isset($_FILES['images']) and is_array($_FILES['images'])) ? $_FILES['images'] : []; + + // No file + if(!count($images)) $this->main->response(array('success'=>0, 'code'=>'NO_FILE', 'message'=>esc_html__('Please upload an image.', 'modern-events-calendar-lite'))); + + // Include the functions + if(!function_exists('wp_handle_upload')) + { + require_once ABSPATH.'wp-admin/includes/file.php'; + require_once(ABSPATH.'wp-admin/includes/image.php'); + } + + // Upload Restrictions + $max_file_size = isset($this->settings['fes_max_file_size']) ? (int) ($this->settings['fes_max_file_size'] * 1000) : (5000 * 1000); + $allowed = array('jpeg', 'jpg', 'png', 'gif', 'webp'); + + $success = 0; + $data = []; + + $count = count($images['name']); + for($i = 0; $i < $count; $i++) + { + $image = array( + 'name' => $images['name'][$i], + 'type' => $images['type'][$i], + 'tmp_name' => $images['tmp_name'][$i], + 'error' => $images['error'][$i], + 'size' => $images['size'][$i], + ); + + $ex = explode('.', $image['name']); + $extension = end($ex); + + // Invalid Extension + if(!in_array(strtolower($extension), $allowed)) continue; + + // Invalid Size + if($image['size'] > $max_file_size) continue; + + $uploaded = wp_handle_upload($image, array('test_form' => false)); + + if($uploaded and !isset($uploaded['error'])) + { + $success = 1; + $attachment = array( + 'post_mime_type' => $uploaded['type'], + 'post_title' => '', + 'post_content' => '', + 'post_status' => 'inherit' + ); + + // Add as Attachment + $attachment_id = wp_insert_attachment($attachment, $uploaded['file']); + + // Update Metadata + wp_update_attachment_metadata($attachment_id, wp_generate_attachment_metadata($attachment_id, $uploaded['file'])); + + $data[] = array( + 'id' => $attachment_id, + 'url' => $uploaded['url'] + ); + } + } + + $message = $success ? esc_html__('The images are uploaded!', 'modern-events-calendar-lite') : esc_html__('An error occurred!', 'modern-events-calendar-lite'); + + $this->main->response(array('success'=>$success, 'message'=>$message, 'data'=>$data)); + } + + public function mec_move_bookings() + { + // Check if our nonce is set. + if(!isset($_POST['_wpnonce'])) $this->main->response(['success'=>0, 'code'=>'NONCE_MISSING']); + + // Verify that the nonce is valid. + if(!wp_verify_nonce(sanitize_text_field($_POST['_wpnonce']), 'mec_move_bookings')) $this->main->response(['success'=>0, 'code'=>'NONCE_IS_INVALID']); + + $event_id = isset($_POST['id']) ? (int) sanitize_text_field($_POST['id']) : 0; + $from = isset($_POST['from']) ? (int) sanitize_text_field($_POST['from']) : 0; + $to_start = isset($_POST['to']) ? (int) sanitize_text_field($_POST['to']) : 0; + + if(!$event_id || !$from || !$to_start) $this->main->response(['success' => 0, 'code' => 'MISS_INFORMATION']); + + // Booking Library + $book = $this->getBook(); + + $bookings = $this->main->get_bookings($event_id, $from); + foreach($bookings as $booking) + { + $book->move($booking->ID, $from, $to_start); + $book->move_notify($booking->ID, $to_start); + } + + $message = '

    '.sprintf(esc_html__('%s bookings moved to new date', 'modern-events-calendar-lite'), count($bookings)).'

    '; + $this->main->response(['success' => 1, 'message' => $message]); + } + + public function mec_manage_bookings() + { + // Check if our nonce is set. + if(!isset($_POST['_wpnonce'])) $this->main->response(['success'=>0, 'code'=>'NONCE_MISSING']); + + // Verify that the nonce is valid. + if(!wp_verify_nonce(sanitize_text_field($_POST['_wpnonce']), 'mec_manage_bookings')) $this->main->response(['success'=>0, 'code'=>'NONCE_IS_INVALID']); + + $event_id = isset($_POST['id']) ? (int) sanitize_text_field($_POST['id']) : 0; + $mode = isset($_POST['mode']) ? sanitize_text_field($_POST['mode']) : 'cancel'; + $date = isset($_POST['date']) ? (int) sanitize_text_field($_POST['date']) : 0; + + if(!$event_id or !$mode or !$date or !in_array($mode, ['cancel', 'refund'])) $this->main->response(['success' => 0, 'code' => 'MISS_INFORMATION']); + + // Booking Library + $book = $this->getBook(); + + $bookings = $this->main->get_bookings($event_id, $date); + foreach($bookings as $booking) + { + if($mode === 'refund') $book->cancel($booking->ID, true); + else $book->cancel($booking->ID, false); + } + + if($mode === 'refund') $message = '

    '.sprintf(esc_html__('%s bookings canceled (and refunded).', 'modern-events-calendar-lite'), count($bookings)).'

    '; + else $message = '

    '.sprintf(esc_html__('%s bookings canceled.', 'modern-events-calendar-lite'), count($bookings)).'

    '; + + $this->main->response(['success' => 1, 'message' => $message]); + } +} diff --git a/app/features/faq.php b/app/features/faq.php new file mode 100755 index 0000000..0540a32 --- /dev/null +++ b/app/features/faq.php @@ -0,0 +1,162 @@ + + */ +class MEC_feature_faq extends MEC_base +{ + public $factory; + public $main; + public $settings; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Factory + $this->factory = $this->getFactory(); + + // Import MEC Main + $this->main = $this->getMain(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + } + + /** + * Initialize feature + * @author Webnus + */ + public function init() + { + // FAQ Status + $faq_status = isset($this->settings['faq_status']) && $this->settings['faq_status']; + + // Feature is not enabled + if(!$faq_status) return; + + // Tab + $this->factory->filter('mec-single-event-meta-title', array($this, 'tab')); + + // Metabox + $this->factory->action('mec_metabox_details', array($this, 'meta_box_faq'), 18); + + // FAQ for FES + if(!isset($this->settings['fes_section_faq']) or (isset($this->settings['fes_section_faq']) and $this->settings['fes_section_faq'])) $this->factory->action('mec_fes_metabox_details', array($this, 'meta_box_faq'), 18); + + // Save Data + $this->factory->action('mec_save_event_data', array($this, 'save'), 10, 2); + } + + public function tab($tabs) + { + $tabs[__('FAQ', 'modern-events-calendar-lite')] = 'mec-faq'; + return $tabs; + } + + /** + * Show FAQs of event into the Add/Edit event page + * + * @author Webnus + * @param object $post + */ + public function meta_box_faq($post) + { + $faqs = get_post_meta($post->ID, 'mec_faq', true); + if(!is_array($faqs)) $faqs = []; + ?> +
    +

    +
    +
    + +
    +
      + +
    • +
      +
        +
      • +
      +
      +
      +
      +
      + +
      +
      + +
      +
      +
      +
      + +
      +
      + +
      +
      +
      +
    • + +
    +
    + +
    +
  • +
    +
      +
    • +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
  • +
    +
    + $f) + { + if(!is_numeric($k)) continue; + + $faq[$k] = $f; + } + + update_post_meta($post_id, 'mec_faq', $faq); + } +} \ No newline at end of file diff --git a/app/features/feed.php b/app/features/feed.php new file mode 100755 index 0000000..2556720 --- /dev/null +++ b/app/features/feed.php @@ -0,0 +1,227 @@ + + */ +class MEC_feature_feed extends MEC_base +{ + /** + * @var MEC_factory + */ + public $factory; + + /** + * @var MEC_main + */ + public $main; + + /** + * @var MEC_feed + */ + public $feed; + public $PT; + public $events; + public $settings; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Factory + $this->factory = $this->getFactory(); + + // Import MEC Main + $this->main = $this->getMain(); + + // Import MEC Feed + $this->feed = $this->getFeed(); + + // MEC Post Type Name + $this->PT = $this->main->get_main_post_type(); + + // General Settings + $this->settings = $this->main->get_settings(); + } + + /** + * Initialize feed feature + * @author Webnus + */ + public function init() + { + remove_all_actions('do_feed_rss2'); + $this->factory->action('do_feed_rss2', array($this, 'rss2')); + + // Include Featured Image + if(!isset($this->settings['include_image_in_feed']) or (isset($this->settings['include_image_in_feed']) and $this->settings['include_image_in_feed'])) + { + add_filter('get_the_excerpt', array($this, 'include_featured_image'), 10, 2); + } + + if(!is_admin()) $this->factory->action('init', array($this, 'ical'), 999); + } + + /** + * Do the feed + * @author Webnus + * @param string $for_comments + */ + public function rss2($for_comments) + { + $rss2 = MEC::import('app.features.feed.rss2', true, true); + + if(get_query_var('post_type') == $this->PT) + { + // Fetch Events + $this->events = $this->fetch(); + + // Include Feed template + include_once $rss2; + } + elseif(get_query_var('taxonomy') == 'mec_category') + { + $q = get_queried_object(); + $term_id = $q->term_id; + + // Fetch Events + $this->events = $this->fetch($term_id); + + // Include Feed template + include_once $rss2; + } + else do_feed_rss2($for_comments); // Call default function + } + + /** + * Returns the events + * @author Webnus + * @param $category + * @return array + */ + public function fetch($category = NULL) + { + $args = [ + 'sk-options' => [ + 'list' => [ + 'limit' => get_option('posts_per_rss', 12), + ] + ], + 'category' => $category + ]; + + $EO = new MEC_skin_list(); // Events Object + $EO->initialize($args); + $EO->search(); + + return $EO->fetch(); + } + + /** + * @param string $excerpt + * @param WP_Post $post + * @return string + */ + public function include_featured_image($excerpt, $post = NULL) + { + // Only RSS + if(!is_feed()) return $excerpt; + + // Get Current Post + if(!$post) $post = get_post(); + if(!$post) return $excerpt; + + // It's not event + if($post->post_type != $this->main->get_main_post_type()) return $excerpt; + + $image = get_the_post_thumbnail($post); + if(trim($image)) $excerpt = $image.' '.$excerpt; + + return $excerpt; + } + + /** + * @throws Exception + */ + public function ical() + { + $ical_feed = (isset($_GET['mec-ical-feed']) and sanitize_text_field($_GET['mec-ical-feed'])); + if(!$ical_feed) return false; + + // Feed is not enabled + if(!isset($this->settings['ical_feed']) or (isset($this->settings['ical_feed']) and !$this->settings['ical_feed'])) return false; + + $only_upcoming_events = (isset($this->settings['ical_feed_upcoming']) and $this->settings['ical_feed_upcoming']); + if($only_upcoming_events) + { + $event_ids = $this->main->get_upcoming_event_ids(current_time('timestamp'), 'publish'); + } + else + { + $events = $this->main->get_events('-1'); + + $event_ids = []; + foreach($events as $event) $event_ids[] = $event->ID; + } + + // Filtered Events + $filtered_ids = null; + + // Filter Criteria + $locations_str = isset($_REQUEST['mec_locations']) ? trim($_REQUEST['mec_locations'], ', ') : ''; + $categories_str = isset($_REQUEST['mec_categories']) ? trim($_REQUEST['mec_categories'], ', ') : ''; + $organizers_str = isset($_REQUEST['mec_organizers']) ? trim($_REQUEST['mec_organizers'], ', ') : ''; + + // Filter Events + if(trim($locations_str, ', ') || trim($categories_str, ', ') || trim($organizers_str, ', ')) + { + $locations = []; + if(trim($locations_str, ', ')) $locations = array_map('trim', explode(',', $locations_str)); + + $categories = []; + if(trim($categories_str, ', ')) $categories = array_map('trim', explode(',', $categories_str)); + + $organizers = []; + if(trim($organizers_str, ', ')) $organizers = array_map('trim', explode(',', $organizers_str)); + + $filtered = $this->main->get_filtered_events($locations, $categories, $organizers); + + $filtered_ids = []; + foreach($filtered as $filtered_post) $filtered_ids[] = $filtered_post->ID; + } + + if(is_array($filtered_ids)) + { + // No Events Found + if(!count($filtered_ids)) $event_ids = []; + else + { + $new_event_ids = []; + foreach($filtered_ids as $filtered_id) + { + if(in_array($filtered_id, $event_ids)) $new_event_ids[] = $filtered_id; + } + + $event_ids = $new_event_ids; + } + } + + $output = ''; + foreach($event_ids as $event_id) $output .= $this->main->ical_single($event_id, '', '', !$only_upcoming_events); + + // Include in iCal + $ical_calendar = $this->main->ical_calendar($output); + + // Content Type + header('Content-Type: text/calendar; charset=utf-8'); + header('Content-Disposition: inline; filename="mec-events-'.date('YmdTHi').'.ics"'); + + // Print the Calendar + echo MEC_kses::full($ical_calendar); + exit; + } +} diff --git a/app/features/feed/index.html b/app/features/feed/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/features/feed/rss2.php b/app/features/feed/rss2.php new file mode 100755 index 0000000..ba3e52c --- /dev/null +++ b/app/features/feed/rss2.php @@ -0,0 +1,102 @@ +'; +do_action('rss_tag_pre', 'rss2'); +?> + + > + + <?php wp_title_rss(); ?> + + + + main->mysql2date('D, d M Y H:i:s O', get_lastpostmodified('GMT'), wp_timezone())); ?> + + + + + + events as $date=>$events): foreach($events as $event): $GLOBALS['post'] = get_post($event->ID) ?> + main->get_timezone($event); + $tz = ($timezone ? new DateTimeZone($timezone) : NULL); + + $cost = (isset($event->data->meta) and isset($event->data->meta['mec_cost']) and trim($event->data->meta['mec_cost'])) ? $event->data->meta['mec_cost'] : ''; + if(isset($event->date) and isset($event->date['start']) and isset($event->date['start']['timestamp'])) $cost = MEC_feature_occurrences::param($event->ID, $event->date['start']['timestamp'], 'cost', $cost); + + $location_id = $this->main->get_master_location_id($event); + ?> + + <?php echo esc_html($this->feed->title($event->ID)); ?> + main->get_event_date_permalink($event, $event->date['start']['date'])); ?> + + ID) or comments_open($event->ID)): ?> + feed->comments_link_feed($event->ID); ?> + + + main->mysql2date('D, d M Y H:i:s O', $event->date['start']['date'].' '.$event->data->time['start'], $tz)); ?> + feed->author($event->data->post->post_author)); ?>]]> + + ID); ?> + + feed->excerpt($event->ID)); ?>]]> + + feed->content($event->ID, 'rss2'); ?> + ]]> + + + ID) or comments_open($event->ID)): ?> + ID, 'rss2')); ?> + ID); ?> + + + ID) and (!isset($this->settings['include_image_in_feed']) or (isset($this->settings['include_image_in_feed']) and !$this->settings['include_image_in_feed']))): $thumbnail_ID = get_post_thumbnail_id($event->ID); $thumbnail = wp_get_attachment_image_src($thumbnail_ID, 'large'); ?> + + + + + data) and isset($event->data->time) and isset($event->data->time['start'])): ?> + data->time['start']); ?> + + + main->get_end_date_by_occurrence($event->ID, $date)); ?> + data) and isset($event->data->time) and isset($event->data->time['end'])): ?> + data->time['end']); ?> + + + main->get_location_data($location_id) and count($location)): ?> + + + + + main->render_price($cost, $event->ID) : $cost); ?> + + + data->categories) and is_array($event->data->categories) and count($event->data->categories)): ?> + data->categories as $category) $categories .= $category['name'].', '; echo trim($categories, ', ') ?> + + + feed->enclosure_rss($event->ID); ?> + + + + + + + \ No newline at end of file diff --git a/app/features/fes.php b/app/features/fes.php new file mode 100755 index 0000000..d6530f2 --- /dev/null +++ b/app/features/fes.php @@ -0,0 +1,1763 @@ + + */ +class MEC_feature_fes extends MEC_base +{ + public $factory; + public $main; + public $db; + public $settings; + public $PT; + public $render; + public $relative_link = false; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Factory + $this->factory = $this->getFactory(); + + // Import MEC Main + $this->main = $this->getMain(); + + // Import MEC DB + $this->db = $this->getDB(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + + // Event Post Type + $this->PT = $this->main->get_main_post_type(); + } + + /** + * Initialize colors feature + * @author Webnus + */ + public function init() + { + // Frontend Event Submission Form + $this->factory->shortcode('MEC_fes_form', array($this, 'vform')); + + // Event Single Page + $this->factory->shortcode('MEC_fes_list', array($this, 'vlist')); + + // Process the event form + $this->factory->action('wp_ajax_mec_fes_form', array($this, 'fes_form')); + $this->factory->action('wp_ajax_nopriv_mec_fes_form', array($this, 'fes_form')); + + // Upload featured image + $this->factory->action('wp_ajax_mec_fes_upload_featured_image', array($this, 'fes_upload')); + $this->factory->action('wp_ajax_nopriv_mec_fes_upload_featured_image', array($this, 'fes_upload')); + + // Export the event + $this->factory->action('wp_ajax_mec_fes_csv_export', array($this, 'mec_fes_csv_export')); + + // Remove the event + $this->factory->action('wp_ajax_mec_fes_remove', array($this, 'fes_remove')); + + // Event Published + $this->factory->action('transition_post_status', array($this, 'status_changed'), 10, 3); + + $this->factory->filter('ajax_query_attachments_args', [$this, 'current_user_attachments']); + } + + /** + * @return bool + */ + public function current_user_can_submit_event() + { + $capability = true; + $user = wp_get_current_user(); + + if($user->ID and isset($this->settings['fes_access_roles']) and is_array($this->settings['fes_access_roles'])) + { + $capability = false; + if(isset($user->roles) and is_array($user->roles)) + { + foreach($user->roles as $user_role) + { + if(in_array($user_role, $this->settings['fes_access_roles'])) $capability = true; + if($capability) break; + } + } + } + + if (is_plugin_active('buddyboss-platform/bp-loader.php') && + is_plugin_active('mec-buddyboss/mec-buddyboss.php')) { + + return true; + } + + return apply_filters('mec_fes_form_current_user_can_submit_event', $capability, $this->settings); + } + + /** + * @param int $post_id + * @return bool + */ + public function current_user_can_upsert_event($post_id) + { + if($post_id == -1) return true; + + $original_post_id = $this->main->get_original_event($post_id); + if(current_user_can('edit_post', $original_post_id)) return true; + + $post = get_post($post_id); + if(isset($post->post_author) && (int) $post->post_author === get_current_user_id()) return true; + + return false; + } + + /** + * Generate frontend event submission form view + * @author Webnus + * @param array $atts + * @return string + */ + public function vform($atts = array()) + { + // Force to array + if(!is_array($atts)) $atts = []; + + if(isset($_GET['vlist']) and sanitize_text_field($_GET['vlist']) == 1) + { + return $this->vlist($atts); + } + + // Force to Relative Link + $this->relative_link = (isset($atts['relative-link']) and $atts['relative-link']); + + // Show login/register message if user is not logged in and guest submission is not enabled. + if(!is_user_logged_in() and (!isset($this->settings['fes_guest_status']) or (isset($this->settings['fes_guest_status']) and $this->settings['fes_guest_status'] == '0'))) + { + // Show message + $message = sprintf(esc_html__('Please %s/%s in order to submit new events.', 'modern-events-calendar-lite'), ''.esc_html__('Login', 'modern-events-calendar-lite').'', ''.esc_html__('Register', 'modern-events-calendar-lite').''); + + ob_start(); + include MEC::import('app.features.fes.message', true, true); + return ob_get_clean(); + } + + $can_user_submit_event = $this->current_user_can_submit_event(); + if(true !== $can_user_submit_event) + { + return '
    '. esc_html__( 'You do not have access to create an event', 'modern-events-calendar-lite').'
    '; + } + + $post_id = isset($_GET['post_id']) ? sanitize_text_field($_GET['post_id']) : -1; + + // Selected post is not an event + if($post_id > 0 and get_post_type($post_id) != $this->PT) + { + // Show message + $message = esc_html__("Sorry! Selected post is not an event.", 'modern-events-calendar-lite'); + + ob_start(); + include MEC::import('app.features.fes.message', true, true); + return ob_get_clean(); + } + + // Show a warning to current user if modification of post is not possible for him/her + if(!$this->current_user_can_upsert_event($post_id)) + { + // Show message + $message = esc_html__("Sorry! You don't have access to modify this event.", 'modern-events-calendar-lite'); + + ob_start(); + include MEC::import('app.features.fes.message', true, true); + return ob_get_clean(); + } + + $post = get_post($post_id); + + if($post_id == -1) + { + $post = new stdClass(); + $post->ID = -1; + } + + $path = MEC::import('app.features.fes.form', true, true); + $path = apply_filters('mec_fes_form_template_path', $path); + + ob_start(); + include $path; + return ob_get_clean(); + } + + /** + * Generate frontend event submission list view + * @author Webnus + * @param array $atts + * @return string + */ + public function vlist($atts = array()) + { + // Force to array + if(!is_array($atts)) $atts = []; + + $post_id = isset($_GET['post_id']) ? sanitize_text_field($_GET['post_id']) : NULL; + + // Force to Relative Link + $this->relative_link = (isset($atts['relative-link']) and $atts['relative-link']); + + // Show a warning to current user if modification of post is not possible for him/her + if($post_id > 0 and !$this->current_user_can_upsert_event($post_id)) + { + // Show message + $message = esc_html__("Sorry! You don't have access to modify this event.", 'modern-events-calendar-lite'); + + ob_start(); + include MEC::import('app.features.fes.message', true, true); + return ob_get_clean(); + } + elseif($post_id == -1 or ($post_id > 0 and $this->current_user_can_upsert_event($post_id))) + { + return $this->vform($atts); + } + + // Show login/register message if user is not logged in + if(!is_user_logged_in()) + { + // Show message + $message = sprintf(esc_html__('Please %s/%s in order to manage events.', 'modern-events-calendar-lite'), ''.esc_html__('Login', 'modern-events-calendar-lite').'', ''.esc_html__('Register', 'modern-events-calendar-lite').''); + + ob_start(); + include MEC::import('app.features.fes.message', true, true); + return ob_get_clean(); + } + + $can_user_submit_event = $this->current_user_can_submit_event(); + if(true !== $can_user_submit_event) + { + return '
    '. esc_html__( 'You do not have access to view the list of events', 'modern-events-calendar-lite').'
    '; + } + + $path = MEC::import('app.features.fes.list', true, true); + + ob_start(); + include $path; + return ob_get_clean(); + } + + public function fes_remove() + { + // Check if our nonce is set. + if(!isset($_POST['_wpnonce'])) $this->main->response(array('success'=>0, 'code'=>'NONCE_MISSING')); + + // Verify that the nonce is valid. + if(!wp_verify_nonce(sanitize_text_field($_POST['_wpnonce']), 'mec_fes_remove')) $this->main->response(array('success'=>0, 'code'=>'NONCE_IS_INVALID')); + + $post_id = isset($_POST['post_id']) ? sanitize_text_field($_POST['post_id']) : 0; + + // Verify current user can remove the event + if(!current_user_can('delete_post', $post_id)) $this->main->response(array('success'=>0, 'code'=>'USER_CANNOT_REMOVE_EVENT')); + + // Trash the event + wp_delete_post($post_id); + + $this->main->response(array('success'=>1, 'message'=>__('Event removed!', 'modern-events-calendar-lite'))); + } + + public function mec_fes_csv_export() + { + if((!isset($_REQUEST['mec_event_id'])) or (!isset($_REQUEST['fes_nonce'])) or (!wp_verify_nonce(sanitize_text_field($_REQUEST['fes_nonce']), 'mec_fes_nonce'))) die(json_encode(array('ex' => "error"))); + + $event_id = intval(sanitize_text_field($_REQUEST['mec_event_id'])); + $timestamp = isset($_REQUEST['timestamp']) ? sanitize_text_field($_REQUEST['timestamp']) : 0; + $booking_ids = ''; + $type = isset($_REQUEST['type']) ? sanitize_text_field($_REQUEST['type']) : 'csv'; + + switch($type) + { + case 'ms-excel': + + header('Content-Type: application/vnd.ms-excel; charset=utf-8'); + header('Content-Disposition: attachment; filename=attendees-'.md5(time().mt_rand(100, 999)).'.xls'); + + break; + + default: + case 'csv': + + header('Content-Type: text/csv; charset=utf-8'); + header('Content-Disposition: attachment; filename=attendees-'.md5(time().mt_rand(100, 999)).'.csv'); + + break; + } + + if($timestamp) + { + $bookings = $this->main->get_bookings($event_id, $timestamp); + foreach($bookings as $booking) + { + $booking_ids .= $booking->ID.','; + } + } + + $post_ids = trim($booking_ids) ? explode(',', trim($booking_ids, ', ')) : []; + + if(!count($post_ids) and !$timestamp) + { + $books = $this->db->select("SELECT `post_id` FROM `#__postmeta` WHERE `meta_key`='mec_event_id' AND `meta_value`={$event_id}", 'loadAssocList'); + foreach($books as $book) if(isset($book['post_id'])) $post_ids[] = $book['post_id']; + } + + $event_ids = []; + foreach($post_ids as $post_id) $event_ids[] = get_post_meta($post_id, 'mec_event_id', true); + $event_ids = array_unique($event_ids); + + $main_event_id = NULL; + if(count($event_ids) == 1) $main_event_id = $event_ids[0]; + + $columns = array(__('ID', 'modern-events-calendar-lite'), esc_html__('Event', 'modern-events-calendar-lite'), esc_html__('Date', 'modern-events-calendar-lite'), esc_html__('Order Time', 'modern-events-calendar-lite'), $this->main->m('ticket', esc_html__('Ticket', 'modern-events-calendar-lite')), esc_html__('Transaction ID', 'modern-events-calendar-lite'), esc_html__('Total Price', 'modern-events-calendar-lite'), esc_html__('Gateway', 'modern-events-calendar-lite'), esc_html__('Name', 'modern-events-calendar-lite'), esc_html__('Email', 'modern-events-calendar-lite'), esc_html__('Ticket Variation', 'modern-events-calendar-lite'), esc_html__('Confirmation', 'modern-events-calendar-lite'), esc_html__('Verification', 'modern-events-calendar-lite')); + $columns = apply_filters('mec_csv_export_columns', $columns); + + $bfixed_fields = $this->main->get_bfixed_fields($main_event_id); + foreach($bfixed_fields as $bfixed_field_key=>$bfixed_field) + { + // Placeholder Keys + if(!is_numeric($bfixed_field_key)) continue; + + $type = $bfixed_field['type'] ?? ''; + $label = isset($bfixed_field['label']) ? esc_html__($bfixed_field['label'], 'modern-events-calendar-lite') : ''; + + if($type == 'agreement') $label = sprintf($label, get_the_title($bfixed_field['page'])); + if(trim($label) == '') continue; + + $columns[] = stripslashes($label); + } + + $reg_fields = $this->main->get_reg_fields($main_event_id); + foreach($reg_fields as $reg_field_key=>$reg_field) + { + // Placeholder Keys + if(!is_numeric($reg_field_key)) continue; + + $type = $reg_field['type'] ?? ''; + $label = isset($reg_field['label']) ? esc_html__($reg_field['label'], 'modern-events-calendar-lite') : ''; + + if(trim($label) == '' or $type == 'name' or $type == 'mec_email') continue; + if($type == 'agreement') $label = sprintf($label, get_the_title($reg_field['page'])); + + $columns[] = $label; + } + + $columns[] = esc_html__('Attachments', 'modern-events-calendar-lite'); + + $columns = apply_filters( 'mec_fes_export_columns', $columns, $main_event_id ); + + $output = fopen('php://output', 'w'); + fprintf($output, chr(0xEF).chr(0xBB).chr(0xBF)); + fputcsv($output, $columns); + + // MEC User + $u = $this->getUser(); + + // Book Library + $book = $this->getBook(); + + foreach($post_ids as $post_id) + { + $post_id = (int) $post_id; + + $event_id = get_post_meta($post_id, 'mec_event_id', true); + $transaction_id = get_post_meta($post_id, 'mec_transaction_id', true); + $order_time = get_post_meta($post_id, 'mec_booking_time', true); + $tickets = get_post_meta($event_id, 'mec_tickets', true); + + $attendees = get_post_meta($post_id, 'mec_attendees', true); + if(!is_array($attendees) || !count($attendees)) $attendees = array(get_post_meta($post_id, 'mec_attendee', true)); + + $price = get_post_meta($post_id, 'mec_price', true); + $gateway_label = get_post_meta($post_id, 'mec_gateway_label', true); + $booker = $u->booking($post_id); + + $confirmed = $this->main->get_confirmation_label(get_post_meta($post_id, 'mec_confirmed', true)); + $verified = $this->main->get_verification_label(get_post_meta($post_id, 'mec_verified', true)); + $transaction = $book->get_transaction($transaction_id); + + $attachments = ''; + if(isset($attendees['attachments'])) + { + foreach($attendees['attachments'] as $attachment) + { + $attachments .= @$attachment['url'] . "\n"; + } + } + + foreach($attendees as $key => $attendee) + { + if($key === 'attachments') continue; + if(isset($attendee[0]['MEC_TYPE_OF_DATA'])) continue; + + $ticket_variations_output = ''; + if(isset($attendee['variations']) and is_array($attendee['variations']) and count($attendee['variations'])) + { + $ticket_variations = $this->main->ticket_variations($post_id, $attendee['id']); + foreach($attendee['variations'] as $a_variation_id => $a_variation_count) + { + if((int) $a_variation_count > 0) $ticket_variations_output .= $ticket_variations[$a_variation_id]['title'].": (".$a_variation_count.')'.", "; + } + } + + $ticket_id = $attendee['id'] ?? get_post_meta($post_id, 'mec_ticket_id', true); + $booking = array( + $post_id, + html_entity_decode(get_the_title($event_id), ENT_QUOTES | ENT_HTML5), + get_the_date('', $post_id), + $order_time, + ($tickets[$ticket_id]['name'] ?? esc_html__('Unknown', 'modern-events-calendar-lite')), + $transaction_id, + $this->main->render_price(($price ? $price : 0), $post_id), + html_entity_decode($gateway_label, ENT_QUOTES | ENT_HTML5), + ($attendee['name'] ?? (isset($booker->first_name) ? trim($booker->first_name . ' ' . $booker->last_name) : '')), + ($attendee['email'] ?? @$booker->user_email), + html_entity_decode(trim($ticket_variations_output, ', '), ENT_QUOTES | ENT_HTML5), + $confirmed, + $verified + ); + + $booking = apply_filters('mec_csv_export_booking', $booking, $post_id, $event_id, $attendee ); + + $bfixed_values = (isset($transaction['fields']) and is_array($transaction['fields'])) ? $transaction['fields'] : []; + foreach($bfixed_fields as $bfixed_field_id => $bfixed_field) + { + if(!is_numeric($bfixed_field_id)) continue; + + $bfixed_label = $bfixed_field['label'] ?? ''; + if(trim($bfixed_label) == '') continue; + + $booking[] = isset($bfixed_values[$bfixed_field_id]) ? ((is_string($bfixed_values[$bfixed_field_id]) and trim($bfixed_values[$bfixed_field_id])) ? stripslashes($bfixed_values[$bfixed_field_id]) : (is_array($bfixed_values[$bfixed_field_id]) ? implode(' | ', $bfixed_values[$bfixed_field_id]) : '---')) : ''; + } + + $reg_form = $attendee['reg'] ?? []; + foreach($reg_fields as $field_id=>$reg_field) + { + // Placeholder Keys + if(!is_numeric($field_id)) continue; + + $type = $reg_field['type'] ?? ''; + $label = isset($reg_field['label']) ? esc_html__($reg_field['label'], 'modern-events-calendar-lite') : ''; + if(trim($label) == '' or $type == 'name' or $type == 'mec_email') continue; + + $booking[] = isset($reg_form[$field_id]) ? ((is_string($reg_form[$field_id]) and trim($reg_form[$field_id])) ? $reg_form[$field_id] : (is_array($reg_form[$field_id]) ? implode(' | ', $reg_form[$field_id]) : '---')) : ''; + } + + if($attachments) + { + $booking[] = $attachments; + $attachments = ''; + } + + $booking = apply_filters( 'mec_fes_export_booking', $booking, $main_event_id ); + + fputcsv($output, $booking); + } + } + + die(); + } + + public function fes_upload() + { + // Check if our nonce is set. + if(!isset($_POST['_wpnonce'])) $this->main->response(array('success'=>0, 'code'=>'NONCE_MISSING')); + + // Verify that the nonce is valid. + if(!wp_verify_nonce(sanitize_text_field($_POST['_wpnonce']), 'mec_fes_upload_featured_image')) $this->main->response(array('success'=>0, 'code'=>'NONCE_IS_INVALID')); + + // Include the function + if(!function_exists('wp_handle_upload')) require_once ABSPATH.'wp-admin/includes/file.php'; + + $uploaded_file = $_FILES['file'] ?? NULL; + + // No file + if(!$uploaded_file) $this->main->response(array('success'=>0, 'code'=>'NO_FILE', 'message'=>esc_html__('Please upload an image.', 'modern-events-calendar-lite'))); + + $allowed = array('gif', 'jpeg', 'jpg', 'png', 'webp'); + + $ex = explode('.', $uploaded_file['name']); + $extension = end($ex); + + // Invalid Extension + if(!in_array($extension, $allowed)) $this->main->response(array('success'=>0, 'code'=>'INVALID_EXTENSION', 'message'=>sprintf(esc_html__('image extension is invalid. You can upload %s images.', 'modern-events-calendar-lite'), implode(', ', $allowed)))); + + // Maximum File Size + $max_file_size = isset($this->settings['fes_max_file_size']) ? (int) ($this->settings['fes_max_file_size'] * 1000) : (5000 * 1000); + + // Invalid Size + if($uploaded_file['size'] > $max_file_size) $this->main->response(array('success'=>0, 'code'=>'IMAGE_IS_TOO_BIG', 'message'=>sprintf(esc_html__('Image is too big. Maximum size is %s KB.', 'modern-events-calendar-lite'), ($max_file_size / 1000)))); + + $movefile = wp_handle_upload($uploaded_file, array('test_form'=>false)); + + $success = 0; + $data = []; + + if($movefile and !isset($movefile['error'])) + { + $success = 1; + $message = esc_html__('Image uploaded!', 'modern-events-calendar-lite'); + + $data['url'] = $movefile['url']; + } + else + { + $message = $movefile['error']; + } + + $this->main->response(array('success'=>$success, 'message'=>$message, 'data'=>$data)); + } + + public function fes_form() + { + // Check if our nonce is set. + if(!isset($_POST['_wpnonce'])) $this->main->response(array('success'=>0, 'code'=>'NONCE_MISSING')); + + // Verify that the nonce is valid. + if(!wp_verify_nonce(sanitize_text_field($_POST['_wpnonce']), 'mec_fes_form')) $this->main->response(array('success'=>0, 'code'=>'NONCE_IS_INVALID')); + + $mec = isset($_POST['mec']) ? $this->main->sanitize_deep_array($_POST['mec']) : []; + + // Post ID + $post_id = isset($mec['post_id']) ? (int) sanitize_text_field($mec['post_id']) : -1; + + // Show a warning to current user if modification of post is not possible for him/her + if(!$this->current_user_can_upsert_event($post_id)) $this->main->response(array('success'=>0, 'message'=>esc_html__("Sorry! You don't have access to modify this event.", 'modern-events-calendar-lite'), 'code'=>'NO_ACCESS')); + + // Validate Captcha + if($this->getCaptcha()->status('fes') and !$this->getCaptcha()->is_valid()) + { + $this->main->response(array('success'=>0, 'message'=>__('Invalid Captcha! Please try again.', 'modern-events-calendar-lite'), 'code'=>'CAPTCHA_IS_INVALID')); + } + + // Agreement Status + $agreement_status = (isset($this->settings['fes_agreement']) and $this->settings['fes_agreement']); + if($agreement_status) + { + $checked = (isset($mec['agreement']) and $mec['agreement']); + if(!$checked) $this->main->response(array('success'=>0, 'message'=>__('You should accept the terms and conditions.', 'modern-events-calendar-lite'), 'code'=>'TERMS_CONDITIONS')); + } + + $start_date = (isset($mec['date']['start']['date']) and trim($mec['date']['start']['date'])) ? $this->main->standardize_format(sanitize_text_field($mec['date']['start']['date'])) : date('Y-m-d'); + $end_date = (isset($mec['date']['end']['date']) and trim($mec['date']['end']['date'])) ? $this->main->standardize_format(sanitize_text_field($mec['date']['end']['date'])) : date('Y-m-d'); + + $post_title = isset($mec['title']) ? sanitize_text_field($mec['title']) : ''; + $post_content = isset($mec['content']) ? MEC_kses::page($mec['content']) : ''; + $post_excerpt = isset($mec['excerpt']) ? MEC_kses::page($mec['excerpt']) : ''; + $post_tags = isset($mec['tags']) ? sanitize_text_field($mec['tags']) : ''; + $post_categories = isset($mec['categories']) ? array_map('sanitize_text_field', $mec['categories']) : []; + $post_speakers = isset($mec['speakers']) ? array_map('sanitize_text_field', $mec['speakers']) : []; + $post_sponsors = isset($mec['sponsors']) ? array_map('sanitize_text_field', $mec['sponsors']) : []; + $post_labels = isset($mec['labels']) ? array_map('sanitize_text_field', $mec['labels']) : []; + $featured_image = isset($mec['featured_image']) ? sanitize_text_field($mec['featured_image']) : ''; + + $read_more = isset($mec['read_more']) ? sanitize_url($mec['read_more']) : ''; + $more_info = (isset($mec['more_info']) and trim($mec['more_info'])) ? sanitize_url($mec['more_info']) : ''; + $more_info_title = isset($mec['more_info_title']) ? sanitize_text_field($mec['more_info_title']) : ''; + $more_info_target = isset($this->settings['fes_event_link_target']) && $this->settings['fes_event_link_target'] ? $this->settings['fes_event_link_target'] : ''; + + $cost = isset($mec['cost']) ? sanitize_text_field($mec['cost']) : ''; + + // Title is Required + if(!trim($post_title)) $this->main->response(array('success'=>0, 'message'=>__('Please fill event title field!', 'modern-events-calendar-lite'), 'code'=>'TITLE_IS_EMPTY')); + + // Body is Required + $is_required_content = apply_filters( + 'mec_fes_form_is_required_fields', + isset($this->settings['fes_required_body']) && $this->settings['fes_required_body'], + 'content' + ); + if($is_required_content && !trim($post_content)) $this->main->response(array('success'=>0, 'message'=>__('Please fill event body field!', 'modern-events-calendar-lite'), 'code'=>'BODY_IS_EMPTY')); + + // excerpt is Required + $is_required_excerpt = apply_filters( + 'mec_fes_form_is_required_fields', + isset($this->settings['fes_required_excerpt']) && $this->settings['fes_required_excerpt'], + 'excerpt' + ); + if($is_required_excerpt && !trim($post_excerpt)) $this->main->response(array('success'=>0, 'message'=>__('Please fill event excerpt field!', 'modern-events-calendar-lite'), 'code'=>'EXCERPT_IS_EMPTY')); + + // Dates are Required + $is_required_dates = apply_filters( + 'mec_fes_form_is_required_fields', + (isset($this->settings['fes_required_dates']) and $this->settings['fes_required_dates']), + 'dates' + ); + if($is_required_dates) + { + $start_date_is_filled = (isset($mec['date']['start']['date']) and trim($mec['date']['start']['date'])); + $end_date_is_filled = (isset($mec['date']['end']['date']) and trim($mec['date']['end']['date'])); + + if(!$start_date_is_filled) $this->main->response(array('success'=>0, 'message'=>__('Please fill event start date!', 'modern-events-calendar-lite'), 'code'=>'START_DATE_IS_EMPTY')); + if(!$end_date_is_filled) $this->main->response(array('success'=>0, 'message'=>__('Please fill event end date!', 'modern-events-calendar-lite'), 'code'=>'END_DATE_IS_EMPTY')); + } + + // Category is Required + $is_required_category = apply_filters( + 'mec_fes_form_is_required_fields', + isset($this->settings['fes_section_categories']) && $this->settings['fes_section_categories'] && isset($this->settings['fes_required_category']) && $this->settings['fes_required_category'], + 'category' + ); + if($is_required_category and !count($post_categories)) $this->main->response(array('success'=>0, 'message'=>__('Please select at-least one category!', 'modern-events-calendar-lite'), 'code'=>'CATEGORY_IS_EMPTY')); + + // Location is Required + $is_required_location = apply_filters( + 'mec_fes_form_is_required_fields', + (isset($this->settings['fes_section_location']) and $this->settings['fes_section_location'] and isset($this->settings['fes_required_location']) and $this->settings['fes_required_location']), + 'location' + ); + if($is_required_location) + { + $location_id_is_filled = (isset($mec['location_id']) and trim($mec['location_id']) and $mec['location_id'] != 1); + $location_add_request = (isset($mec['location'], $mec['location']['address']) and trim($mec['location']['address'])); + + if(!$location_id_is_filled and !$location_add_request) $this->main->response(array('success'=>0, 'message'=>__('Please select the event location!', 'modern-events-calendar-lite'), 'code'=>'LOCATION_IS_EMPTY')); + } + + // Label is Required + $is_required_label = apply_filters( + 'mec_fes_form_is_required_fields', + isset($this->settings['fes_section_labels']) && $this->settings['fes_section_labels'] && isset($this->settings['fes_required_label']) && $this->settings['fes_required_label'], + 'label' + ); + if($is_required_label and !count($post_labels)) $this->main->response(array('success'=>0, 'message'=>__('Please select at-least one label!', 'modern-events-calendar-lite'), 'code'=>'LABEL_IS_EMPTY')); + + // Featured Image is Required + $is_required_featured_image = apply_filters( + 'mec_fes_form_is_required_fields', + isset($this->settings['fes_section_featured_image']) && $this->settings['fes_section_featured_image'] && isset($this->settings['fes_required_featured_image']) && $this->settings['fes_required_featured_image'], + 'featured_image' + ); + if($is_required_featured_image and !trim($featured_image)) $this->main->response(array('success'=>0, 'message'=>__('Please upload a featured image!', 'modern-events-calendar-lite'), 'code'=>'FEATURED_IMAGE_IS_EMPTY')); + + // Event link is required + $is_required_event_link = apply_filters( + 'mec_fes_form_is_required_fields', + isset($this->settings['fes_required_event_link']) && $this->settings['fes_required_event_link'], + 'event_link' + ); + if($is_required_event_link and !trim($read_more)) $this->main->response(array('success'=>0, 'message'=>__('Please fill event link!', 'modern-events-calendar-lite'), 'code'=>'EVENT_LINK_IS_EMPTY')); + + // More Info is required + $is_required_more_info = apply_filters( + 'mec_fes_form_is_required_fields', + isset($this->settings['fes_required_more_info']) && $this->settings['fes_required_more_info'], + 'more_info' + ); + if($is_required_more_info and !trim($more_info)) $this->main->response(array('success'=>0, 'message'=>__('Please fill more info!', 'modern-events-calendar-lite'), 'code'=>'MORE_INFO_IS_EMPTY')); + + // Cost is required + $is_required_cost = apply_filters( + 'mec_fes_form_is_required_fields', + isset($this->settings['fes_required_cost']) && $this->settings['fes_required_cost'], + 'cost' + ); + if($is_required_cost and trim($cost) === '') $this->main->response(array('success'=>0, 'message'=>__('Please fill cost!', 'modern-events-calendar-lite'), 'code'=>'COST_IS_EMPTY')); + + // Post Status + $status = 'pending'; + if(current_user_can('publish_posts')) $status = 'publish'; + + $method = 'updated'; + + // Create new event + if($post_id == -1) + { + // Force Status + if(isset($this->settings['fes_new_event_status']) and trim($this->settings['fes_new_event_status'])) $status = $this->settings['fes_new_event_status']; + + $post = ['post_title'=>$post_title, 'post_content'=>$post_content, 'post_excerpt'=>$post_excerpt, 'post_type'=>$this->PT, 'post_status'=>$status]; + $post_id = wp_insert_post($post); + + $method = 'added'; + + // FES Flag + update_post_meta($post_id, 'mec_created_by_fes', 1); + + // Default Category + if(isset($this->settings['fes_default_category']) and $this->settings['fes_default_category'] and !count($post_categories)) + { + $post_categories[$this->settings['fes_default_category']] = 1; + } + } + + wp_update_post(['ID'=>$post_id, 'post_title'=>$post_title, 'post_content'=>$post_content, 'post_excerpt'=>$post_excerpt, 'post_status'=>$status]); + + // Categories Section + if(!isset($this->settings['fes_section_categories']) or (isset($this->settings['fes_section_categories']) and $this->settings['fes_section_categories'])) + { + // Categories + $categories = []; + foreach($post_categories as $post_category=>$value) $categories[] = (int) $post_category; + + wp_set_post_terms($post_id, $categories, 'mec_category'); + } + + // Speakers Section + if(!isset($this->settings['fes_section_speaker']) or (isset($this->settings['fes_section_speaker']) and $this->settings['fes_section_speaker'])) + { + // Speakers + if(isset($this->settings['speakers_status']) and $this->settings['speakers_status']) + { + $speakers = []; + foreach($post_speakers as $post_speaker=>$value) $speakers[] = (int) $post_speaker; + + wp_set_post_terms($post_id, $speakers, 'mec_speaker'); + } + } + + // Sponsors Section + if($this->getPRO() and isset($this->settings['fes_section_sponsor']) and $this->settings['fes_section_sponsor']) + { + // Sponsors + if(isset($this->settings['sponsors_status']) and $this->settings['sponsors_status']) + { + $sponsors = []; + foreach($post_sponsors as $post_sponsor=>$value) $sponsors[] = (int) $post_sponsor; + + wp_set_post_terms($post_id, $sponsors, 'mec_sponsor'); + } + } + + // Labels Section + if(!isset($this->settings['fes_section_labels']) or (isset($this->settings['fes_section_labels']) and $this->settings['fes_section_labels'])) + { + // Labels + $labels = []; + foreach($post_labels as $post_label=>$value) $labels[] = (int) $post_label; + + wp_set_post_terms($post_id, $labels, 'mec_label'); + do_action('mec_label_change_to_radio', $labels, $post_labels, $post_id); + } + + // Color Section + if(!isset($this->settings['fes_section_event_color']) or (isset($this->settings['fes_section_event_color']) and $this->settings['fes_section_event_color'])) + { + // Color + $color = isset($mec['color']) ? sanitize_text_field(trim($mec['color'], '# ')) : ''; + update_post_meta($post_id, 'mec_color', $color); + } + + // Tags Section + if(!isset($this->settings['fes_section_tags']) or (isset($this->settings['fes_section_tags']) and $this->settings['fes_section_tags'])) + { + // Tags + wp_set_post_terms($post_id, $post_tags, apply_filters('mec_taxonomy_tag', '')); + } + + // Featured Image Section + if(!isset($this->settings['fes_section_featured_image']) || $this->settings['fes_section_featured_image']) + { + // Featured Image + if(trim($featured_image)) $this->main->set_featured_image($featured_image, $post_id, ['gif', 'jpeg', 'jpg', 'png', 'webp']); + else delete_post_thumbnail($post_id); + + // Featured Image Caption + if(isset($this->settings['featured_image_caption']) && $this->settings['featured_image_caption']) + { + $attachment_id = get_post_thumbnail_id($post_id); + if($attachment_id) + { + $featured_image_caption = isset($mec['featured_image_caption']) ? sanitize_text_field($mec['featured_image_caption']) : ''; + $this->db->q("UPDATE `#__posts` SET `post_excerpt`='".esc_sql($featured_image_caption)."' WHERE `ID`=".((int) $attachment_id)); + } + } + } + + // Links Section + if(!isset($this->settings['fes_section_event_links']) or (isset($this->settings['fes_section_event_links']) and $this->settings['fes_section_event_links'])) + { + update_post_meta($post_id, 'mec_read_more', $read_more); + update_post_meta($post_id, 'mec_more_info', $more_info); + update_post_meta($post_id, 'mec_more_info_title', $more_info_title); + update_post_meta($post_id, 'mec_more_info_target', $more_info_target); + } + + // Cost Section + if(!isset($this->settings['fes_section_cost']) or (isset($this->settings['fes_section_cost']) and $this->settings['fes_section_cost'])) + { + $cost = apply_filters( + 'mec_event_cost_sanitize', + sanitize_text_field($cost), + $cost + ); + + $cost_auto_calculate = (isset($mec['cost_auto_calculate']) ? sanitize_text_field($mec['cost_auto_calculate']) : 0); + $currency_options = ((isset($mec['currency']) and is_array($mec['currency'])) ? array_map('sanitize_text_field', $mec['currency']) : array()); + + update_post_meta($post_id, 'mec_cost', $cost); + update_post_meta($post_id, 'mec_cost_auto_calculate', $cost_auto_calculate); + update_post_meta($post_id, 'mec_currency', $currency_options); + } + + // Guest Name and Email + $fes_guest_email = isset($mec['fes_guest_email']) ? sanitize_email($mec['fes_guest_email']) : ''; + $fes_guest_name = isset($mec['fes_guest_name']) ? sanitize_text_field($mec['fes_guest_name']) : ''; + $note = isset($mec['note']) ? sanitize_text_field($mec['note']) : ''; + + update_post_meta($post_id, 'fes_guest_email', $fes_guest_email); + update_post_meta($post_id, 'fes_guest_name', $fes_guest_name); + update_post_meta($post_id, 'mec_note', $note); + + // Location Section + if(!isset($this->settings['fes_section_location']) or (isset($this->settings['fes_section_location']) and $this->settings['fes_section_location'])) + { + // Location + $location_id = isset($mec['location_id']) ? sanitize_text_field($mec['location_id']) : 1; + + // Selected a saved location + if($location_id) + { + // Set term to the post + wp_set_object_terms($post_id, (int) $location_id, 'mec_location'); + } + else + { + $address = (isset($mec['location']['address']) and trim($mec['location']['address'])) ? sanitize_text_field($mec['location']['address']) : ''; + $name = (isset($mec['location']['name']) and trim($mec['location']['name'])) ? sanitize_text_field($mec['location']['name']) : (trim($address) ? $address : esc_html__('Location Name', 'modern-events-calendar-lite')); + + $term = get_term_by('name', $name, 'mec_location'); + + // Term already exists + if(is_object($term) and isset($term->term_id)) + { + // Set term to the post + wp_set_object_terms($post_id, (int) $term->term_id, 'mec_location'); + } + else + { + $term = wp_insert_term($name, 'mec_location'); + + $location_id = $term['term_id']; + if($location_id) + { + // Set term to the post + wp_set_object_terms($post_id, (int) $location_id, 'mec_location'); + + $opening_hour = (isset($mec['location']['opening_hour']) and trim($mec['location']['opening_hour'])) ? sanitize_text_field($mec['location']['opening_hour']) : ''; + $latitude = (isset($mec['location']['latitude']) and trim($mec['location']['latitude'])) ? sanitize_text_field($mec['location']['latitude']) : 0; + $longitude = (isset($mec['location']['longitude']) and trim($mec['location']['longitude'])) ? sanitize_text_field($mec['location']['longitude']) : 0; + $url = (isset($mec['location']['url']) and trim($mec['location']['url'])) ? sanitize_url($mec['location']['url']) : ''; + $tel = (isset($mec['location']['tel']) and trim($mec['location']['tel'])) ? sanitize_text_field($mec['location']['tel']) : ''; + $thumbnail = (isset($mec['location']['thumbnail']) and trim($mec['location']['thumbnail'])) ? sanitize_text_field($mec['location']['thumbnail']) : ''; + + if(!trim($latitude) or !trim($longitude)) + { + $geo_point = $this->main->get_lat_lng($address); + + $latitude = $geo_point[0]; + $longitude = $geo_point[1]; + } + + update_term_meta($location_id, 'address', $address); + update_term_meta($location_id, 'opening_hour', $opening_hour); + update_term_meta($location_id, 'latitude', $latitude); + update_term_meta($location_id, 'longitude', $longitude); + update_term_meta($location_id, 'url', $url); + update_term_meta($location_id, 'tel', $tel); + update_term_meta($location_id, 'thumbnail', $thumbnail); + } + else $location_id = 1; + } + } + + update_post_meta($post_id, 'mec_location_id', $location_id); + + $dont_show_map = isset($mec['dont_show_map']) ? sanitize_text_field($mec['dont_show_map']) : 0; + update_post_meta($post_id, 'mec_dont_show_map', $dont_show_map); + } + + // Organizer Section + if(!isset($this->settings['fes_section_organizer']) or (isset($this->settings['fes_section_organizer']) and $this->settings['fes_section_organizer'])) + { + // Organizer + $organizer_id = isset($mec['organizer_id']) ? sanitize_text_field($mec['organizer_id']) : 1; + + // Selected a saved organizer + if(isset($organizer_id) and $organizer_id) + { + // Set term to the post + wp_set_object_terms($post_id, (int) $organizer_id, 'mec_organizer'); + } + else + { + $name = (isset($mec['organizer']['name']) and trim($mec['organizer']['name'])) ? sanitize_text_field($mec['organizer']['name']) : esc_html__('Organizer Name', 'modern-events-calendar-lite'); + + $term = get_term_by('name', $name, 'mec_organizer'); + + // Term already exists + if(is_object($term) and isset($term->term_id)) + { + // Set term to the post + wp_set_object_terms($post_id, (int) $term->term_id, 'mec_organizer'); + } + else + { + $term = wp_insert_term($name, 'mec_organizer'); + + $organizer_id = $term['term_id']; + if($organizer_id) + { + // Set term to the post + wp_set_object_terms($post_id, (int) $organizer_id, 'mec_organizer'); + + $tel = (isset($mec['organizer']['tel']) and trim($mec['organizer']['tel'])) ? sanitize_text_field($mec['organizer']['tel']) : ''; + $email = (isset($mec['organizer']['email']) and trim($mec['organizer']['email'])) ? sanitize_text_field($mec['organizer']['email']) : ''; + $url = (isset($mec['organizer']['url']) and trim($mec['organizer']['url'])) ? sanitize_url($mec['organizer']['url']) : ''; + $page_label = (isset($mec['organizer']['page_label']) and trim($mec['organizer']['page_label'])) ? sanitize_text_field($mec['organizer']['page_label']) : ''; + $thumbnail = (isset($mec['organizer']['thumbnail']) and trim($mec['organizer']['thumbnail'])) ? sanitize_text_field($mec['organizer']['thumbnail']) : ''; + + update_term_meta($organizer_id, 'tel', $tel); + update_term_meta($organizer_id, 'email', $email); + update_term_meta($organizer_id, 'url', $url); + update_term_meta($organizer_id, 'page_label', $page_label); + update_term_meta($organizer_id, 'thumbnail', $thumbnail); + } + else $organizer_id = 1; + } + } + + update_post_meta($post_id, 'mec_organizer_id', $organizer_id); + + // Additional Organizers + $additional_organizer_ids = $mec['additional_organizer_ids'] ?? []; + + foreach($additional_organizer_ids as $additional_organizer_id) wp_set_object_terms($post_id, (int) $additional_organizer_id, 'mec_organizer', true); + update_post_meta($post_id, 'mec_additional_organizer_ids', $additional_organizer_ids); + + // Additional locations + $additional_location_ids = $mec['additional_location_ids'] ?? []; + + foreach($additional_location_ids as $additional_location_id) wp_set_object_terms($post_id, (int) $additional_location_id, 'mec_location', true); + update_post_meta($post_id, 'mec_additional_location_ids', $additional_location_ids); + } + + // Date Options + $date = $mec['date'] ?? []; + + $start_date = date('Y-m-d', strtotime($start_date)); + + // Set the start date + $date['start']['date'] = $start_date; + + $start_time_hour = isset($date['start']) ? sanitize_text_field($date['start']['hour']) : '8'; + $start_time_minutes = isset($date['start']) ? sanitize_text_field($date['start']['minutes']) : '00'; + $start_time_ampm = (isset($date['start']) and isset($date['start']['ampm'])) ? sanitize_text_field($date['start']['ampm']) : 'AM'; + + $end_date = date('Y-m-d', strtotime($end_date)); + + // Fix end_date if it's smaller than start_date + if(strtotime($end_date) < strtotime($start_date)) $end_date = $start_date; + + // Set the end date + $date['end']['date'] = $end_date; + + $end_time_hour = isset($date['end']) ? sanitize_text_field($date['end']['hour']) : '6'; + $end_time_minutes = isset($date['end']) ? sanitize_text_field($date['end']['minutes']) : '00'; + $end_time_ampm = (isset($date['end']) and isset($date['end']['ampm'])) ? sanitize_text_field($date['end']['ampm']) : 'PM'; + + if(isset($this->settings['time_format']) and $this->settings['time_format'] == 24) + { + $day_start_seconds = $this->main->time_to_seconds($this->main->to_24hours($start_time_hour, NULL), $start_time_minutes); + $day_end_seconds = $this->main->time_to_seconds($this->main->to_24hours($end_time_hour, NULL), $end_time_minutes); + } + else + { + $day_start_seconds = $this->main->time_to_seconds($this->main->to_24hours($start_time_hour, $start_time_ampm), $start_time_minutes); + $day_end_seconds = $this->main->time_to_seconds($this->main->to_24hours($end_time_hour, $end_time_ampm), $end_time_minutes); + } + + if($end_date === $start_date and $day_end_seconds < $day_start_seconds) + { + $day_end_seconds = $day_start_seconds; + + $end_time_hour = $start_time_hour; + $end_time_minutes = $start_time_minutes; + $end_time_ampm = $start_time_ampm; + + $date['end']['hour'] = $start_time_hour; + $date['end']['minutes'] = $start_time_minutes; + $date['end']['ampm'] = $start_time_ampm; + } + + // If 24 hours format is enabled then convert it back to 12 hours + if(isset($this->settings['time_format']) and $this->settings['time_format'] == 24) + { + if($start_time_hour < 12) $start_time_ampm = 'AM'; + elseif($start_time_hour == 12) $start_time_ampm = 'PM'; + elseif($start_time_hour > 12) + { + $start_time_hour -= 12; + $start_time_ampm = 'PM'; + } + elseif($start_time_hour == 0) + { + $start_time_hour = 12; + $start_time_ampm = 'AM'; + } + + if($end_time_hour < 12) $end_time_ampm = 'AM'; + elseif($end_time_hour == 12) $end_time_ampm = 'PM'; + elseif($end_time_hour > 12) + { + $end_time_hour -= 12; + $end_time_ampm = 'PM'; + } + elseif($end_time_hour == 0) + { + $end_time_hour = 12; + $end_time_ampm = 'AM'; + } + + // Set converted values to date array + $date['start']['hour'] = $start_time_hour; + $date['start']['ampm'] = $start_time_ampm; + + $date['end']['hour'] = $end_time_hour; + $date['end']['ampm'] = $end_time_ampm; + } + + $allday = isset($date['allday']) ? 1 : 0; + $one_occurrence = isset($date['one_occurrence']) ? 1 : 0; + $hide_time = isset($date['hide_time']) ? 1 : 0; + $hide_end_time = isset($date['hide_end_time']) ? 1 : 0; + $comment = isset($date['comment']) ? sanitize_text_field($date['comment']) : ''; + $timezone = (isset($mec['timezone']) and trim($mec['timezone']) != '') ? sanitize_text_field($mec['timezone']) : 'global'; + $countdown_method = (isset($mec['countdown_method']) and trim($mec['countdown_method']) != '') ? sanitize_text_field($mec['countdown_method']) : 'global'; + $style_per_event = (isset($mec['style_per_event']) and trim($mec['style_per_event']) != '') ? sanitize_text_field($mec['style_per_event']) : 'global'; + $trailer_url = (isset($mec['trailer_url']) and trim($mec['trailer_url']) != '') ? sanitize_url($mec['trailer_url']) : ''; + $trailer_title = isset($mec['trailer_title']) ? sanitize_text_field($mec['trailer_title']) : ''; + $public = (isset($mec['public']) and trim($mec['public']) != '') ? sanitize_text_field($mec['public']) : 1; + + // Set start time and end time if event is all day + if($allday == 1) + { + $start_time_hour = '8'; + $start_time_minutes = '00'; + $start_time_ampm = 'AM'; + + $end_time_hour = '6'; + $end_time_minutes = '00'; + $end_time_ampm = 'PM'; + } + + // Previous Date Times + $prev_start_datetime = get_post_meta($post_id, 'mec_start_datetime', true); + $prev_end_datetime = get_post_meta($post_id, 'mec_end_datetime', true); + + $start_datetime = $start_date.' '.sprintf('%02d', $start_time_hour).':'.sprintf('%02d', $start_time_minutes).' '.$start_time_ampm; + $end_datetime = $end_date.' '.sprintf('%02d', $end_time_hour).':'.sprintf('%02d', $end_time_minutes).' '.$end_time_ampm; + + update_post_meta($post_id, 'mec_start_date', $start_date); + update_post_meta($post_id, 'mec_start_time_hour', $start_time_hour); + update_post_meta($post_id, 'mec_start_time_minutes', $start_time_minutes); + update_post_meta($post_id, 'mec_start_time_ampm', $start_time_ampm); + update_post_meta($post_id, 'mec_start_day_seconds', $day_start_seconds); + update_post_meta($post_id, 'mec_start_datetime', $start_datetime); + + update_post_meta($post_id, 'mec_end_date', $end_date); + update_post_meta($post_id, 'mec_end_time_hour', $end_time_hour); + update_post_meta($post_id, 'mec_end_time_minutes', $end_time_minutes); + update_post_meta($post_id, 'mec_end_time_ampm', $end_time_ampm); + update_post_meta($post_id, 'mec_end_day_seconds', $day_end_seconds); + update_post_meta($post_id, 'mec_end_datetime', $end_datetime); + + update_post_meta($post_id, 'mec_date', $date); + + // Repeat Options + $repeat = $date['repeat'] ?? []; + $certain_weekdays = $repeat['certain_weekdays'] ?? []; + + $repeat_status = isset($repeat['status']) ? 1 : 0; + $repeat_type = ($repeat_status and isset($repeat['type'])) ? sanitize_text_field($repeat['type']) : ''; + + $repeat_interval = ($repeat_status and isset($repeat['interval']) and trim($repeat['interval'])) ? sanitize_text_field($repeat['interval']) : 1; + + // Advanced Repeat + $advanced = isset($repeat['advanced']) ? sanitize_text_field($repeat['advanced']) : ''; + + if(!is_numeric($repeat_interval)) $repeat_interval = NULL; + + if($repeat_type == 'weekly') $interval_multiply = 7; + else $interval_multiply = 1; + + // Reset certain weekdays if repeat type is not set to certain weekdays + if($repeat_type != 'certain_weekdays') $certain_weekdays = []; + + if(!is_null($repeat_interval)) $repeat_interval = $repeat_interval*$interval_multiply; + + // String To Array + if($repeat_type == 'advanced' and trim($advanced)) $advanced = explode('-', $advanced); + else $advanced = []; + + $repeat_end = ($repeat_status and isset($repeat['end'])) ? sanitize_text_field($repeat['end']) : ''; + $repeat_end_at_occurrences = ($repeat_status && isset($repeat['end_at_occurrences']) && is_numeric($repeat['end_at_occurrences'])) ? $repeat['end_at_occurrences'] - 1 : 9; + $repeat_end_at_date = ($repeat_status and isset($repeat['end_at_date'])) ? $this->main->standardize_format(sanitize_text_field($repeat['end_at_date'])) : ''; + + update_post_meta($post_id, 'mec_date', $date); + update_post_meta($post_id, 'mec_repeat', $repeat); + update_post_meta($post_id, 'mec_certain_weekdays', $certain_weekdays); + update_post_meta($post_id, 'mec_allday', $allday); + update_post_meta($post_id, 'one_occurrence', $one_occurrence); + update_post_meta($post_id, 'mec_hide_time', $hide_time); + update_post_meta($post_id, 'mec_hide_end_time', $hide_end_time); + update_post_meta($post_id, 'mec_comment', $comment); + update_post_meta($post_id, 'mec_timezone', $timezone); + update_post_meta($post_id, 'mec_countdown_method', $countdown_method); + update_post_meta($post_id, 'mec_style_per_event', $style_per_event); + update_post_meta($post_id, 'mec_trailer_url', $trailer_url); + update_post_meta($post_id, 'mec_trailer_title', $trailer_title); + update_post_meta($post_id, 'mec_public', $public); + update_post_meta($post_id, 'mec_repeat_status', $repeat_status); + update_post_meta($post_id, 'mec_repeat_type', $repeat_type); + update_post_meta($post_id, 'mec_repeat_interval', $repeat_interval); + update_post_meta($post_id, 'mec_repeat_end', $repeat_end); + update_post_meta($post_id, 'mec_repeat_end_at_occurrences', $repeat_end_at_occurrences); + update_post_meta($post_id, 'mec_repeat_end_at_date', $repeat_end_at_date); + update_post_meta($post_id, 'mec_advanced_days', $advanced); + + // Event Sequence (Used in iCal feed) + $sequence = (int) get_post_meta($post_id, 'mec_sequence', true); + update_post_meta($post_id, 'mec_sequence', ($sequence + 1)); + + // Creating $event array for inserting in mec_events table + $event = array('post_id'=>$post_id, 'start'=>$start_date, 'repeat'=>$repeat_status, 'rinterval'=>(!in_array($repeat_type, array('daily', 'weekly', 'monthly')) ? NULL : $repeat_interval), 'time_start'=>$day_start_seconds, 'time_end'=>$day_end_seconds); + + $year = NULL; + $month = NULL; + $day = NULL; + $week = NULL; + $weekday = NULL; + $weekdays = NULL; + + // MEC weekdays + $mec_weekdays = $this->main->get_weekdays(); + + // MEC weekends + $mec_weekends = $this->main->get_weekends(); + + $plus_date = null; + if($repeat_type == 'daily') + { + $plus_date = '+'.$repeat_end_at_occurrences*$repeat_interval.' Days'; + } + elseif($repeat_type == 'weekly') + { + $plus_date = '+'.$repeat_end_at_occurrences*($repeat_interval).' Days'; + } + elseif($repeat_type == 'weekday') + { + $repeat_interval = 1; + $plus_date = '+'.$repeat_end_at_occurrences*$repeat_interval.' Weekdays'; + + $weekdays = ','.implode(',', $mec_weekdays).','; + } + elseif($repeat_type == 'weekend') + { + $repeat_interval = 1; + $plus_date = '+'.round($repeat_end_at_occurrences/2)*($repeat_interval*7).' Days'; + + $weekdays = ','.implode(',', $mec_weekends).','; + } + elseif($repeat_type == 'certain_weekdays') + { + $repeat_interval = 1; + $plus_date = '+' . ceil(($repeat_end_at_occurrences * $repeat_interval) * (7/count($certain_weekdays))) . ' days'; + + $weekdays = ','.implode(',', $certain_weekdays).','; + } + elseif($repeat_type == 'monthly') + { + $plus_date = '+'.$repeat_end_at_occurrences*$repeat_interval.' Months'; + + $year = '*'; + $month = '*'; + + $s = $start_date; + $e = $end_date; + + $_days = []; + while(strtotime($s) <= strtotime($e)) + { + $_days[] = date('d', strtotime($s)); + $s = date('Y-m-d', strtotime('+1 Day', strtotime($s))); + } + + $day = ','.implode(',', array_unique($_days)).','; + + $week = '*'; + $weekday = '*'; + } + elseif($repeat_type == 'yearly') + { + $plus_date = '+'.$repeat_end_at_occurrences*$repeat_interval.' Years'; + + $year = '*'; + + $s = $start_date; + $e = $end_date; + + $_months = []; + $_days = []; + while(strtotime($s) <= strtotime($e)) + { + $_months[] = date('m', strtotime($s)); + $_days[] = date('d', strtotime($s)); + + $s = date('Y-m-d', strtotime('+1 Day', strtotime($s))); + } + + $month = ','.implode(',', array_unique($_months)).','; + $day = ','.implode(',', array_unique($_days)).','; + + $week = '*'; + $weekday = '*'; + } + elseif($repeat_type == "advanced") + { + // Render class object + $this->render = $this->getRender(); + + // Get finish date + $event_info = array('start' => $date['start'], 'end' => $date['end']); + $dates = $this->render->generate_advanced_days($advanced, $event_info, $repeat_end_at_occurrences +1, date( 'Y-m-d', current_time( 'timestamp', 0 )), 'events'); + + $period_date = $this->main->date_diff($start_date, end($dates)['end']['date']); + + $plus_date = '+' . $period_date->days . ' Days'; + } + + // "In Days" and "Not In Days" + $in_days_arr = (isset($mec['in_days']) and is_array($mec['in_days']) and count($mec['in_days'])) ? array_unique($mec['in_days']) : []; + $not_in_days_arr = (isset($mec['not_in_days']) and is_array($mec['not_in_days']) and count($mec['not_in_days'])) ? array_unique($mec['not_in_days']) : []; + + $in_days = ''; + if(count($in_days_arr)) + { + if(isset($in_days_arr[':i:'])) unset($in_days_arr[':i:']); + + $in_days_arr = array_map(function($value) + { + $ex = explode(':', $value); + + $in_days_times = ''; + if(isset($ex[2]) and isset($ex[3])) + { + $in_days_start_time = $ex[2]; + $in_days_end_time = $ex[3]; + + // If 24 hours format is enabled then convert it back to 12 hours + if(isset($this->settings['time_format']) and $this->settings['time_format'] == 24) + { + $ex_start_time = explode('-', $in_days_start_time); + $ex_end_time = explode('-', $in_days_end_time); + + $in_days_start_hour = $ex_start_time[0]; + $in_days_start_minutes = $ex_start_time[1]; + $in_days_start_ampm = $ex_start_time[2]; + + $in_days_end_hour = $ex_end_time[0]; + $in_days_end_minutes = $ex_end_time[1]; + $in_days_end_ampm = $ex_end_time[2]; + + if(trim($in_days_start_ampm) == '') + { + if($in_days_start_hour < 12) $in_days_start_ampm = 'AM'; + elseif($in_days_start_hour == 12) $in_days_start_ampm = 'PM'; + elseif($in_days_start_hour > 12) + { + $in_days_start_hour -= 12; + $in_days_start_ampm = 'PM'; + } + elseif($in_days_start_hour == 0) + { + $in_days_start_hour = 12; + $in_days_start_ampm = 'AM'; + } + } + + if(trim($in_days_end_ampm) == '') + { + if($in_days_end_hour < 12) $in_days_end_ampm = 'AM'; + elseif($in_days_end_hour == 12) $in_days_end_ampm = 'PM'; + elseif($in_days_end_hour > 12) + { + $in_days_end_hour -= 12; + $in_days_end_ampm = 'PM'; + } + elseif($in_days_end_hour == 0) + { + $in_days_end_hour = 12; + $in_days_end_ampm = 'AM'; + } + } + + if(strlen($in_days_start_hour) == 1) $in_days_start_hour = '0'.$in_days_start_hour; + if(strlen($in_days_start_minutes) == 1) $in_days_start_minutes = '0'.$in_days_start_minutes; + + if(strlen($in_days_end_hour) == 1) $in_days_end_hour = '0'.$in_days_end_hour; + if(strlen($in_days_end_minutes) == 1) $in_days_end_minutes = '0'.$in_days_end_minutes; + + $in_days_start_time = $in_days_start_hour.'-'.$in_days_start_minutes.'-'.$in_days_start_ampm; + $in_days_end_time = $in_days_end_hour.'-'.$in_days_end_minutes.'-'.$in_days_end_ampm; + } + + $in_days_times = ':'.$in_days_start_time.':'.$in_days_end_time; + } + + return $this->main->standardize_format($ex[0]) . ':' . $this->main->standardize_format($ex[1]).$in_days_times; + }, $in_days_arr); + + usort($in_days_arr, function($a, $b) + { + $ex_a = explode(':', $a); + $ex_b = explode(':', $b); + + $date_a = $ex_a[0]; + $date_b = $ex_b[0]; + + $in_day_a_time_label = ''; + if(isset($ex_a[2])) + { + $in_day_a_time = $ex_a[2]; + $pos = strpos($in_day_a_time, '-'); + if($pos !== false) $in_day_a_time_label = substr_replace($in_day_a_time, ':', $pos, 1); + + $in_day_a_time_label = str_replace('-', ' ', $in_day_a_time_label); + } + + $in_day_b_time_label = ''; + if(isset($ex_b[2])) + { + $in_day_b_time = $ex_b[2]; + $pos = strpos($in_day_b_time, '-'); + if($pos !== false) $in_day_b_time_label = substr_replace($in_day_b_time, ':', $pos, 1); + + $in_day_b_time_label = str_replace('-', ' ', $in_day_b_time_label); + } + + return strtotime(trim($date_a.' '.$in_day_a_time_label)) - strtotime(trim($date_b.' '.$in_day_b_time_label)); + }); + + if(!isset($in_days_arr[':i:'])) $in_days_arr[':i:'] = ':val:'; + foreach($in_days_arr as $key => $in_day_arr) + { + if(is_numeric($key)) $in_days .= $in_day_arr . ','; + } + } + + $not_in_days = ''; + if(count($not_in_days_arr)) + { + foreach($not_in_days_arr as $key => $not_in_day_arr) + { + if(is_numeric($key)) $not_in_days .= $this->main->standardize_format($not_in_day_arr) . ','; + } + } + + $in_days = trim($in_days, ', '); + $not_in_days = trim($not_in_days, ', '); + + update_post_meta($post_id, 'mec_in_days', $in_days); + update_post_meta($post_id, 'mec_not_in_days', $not_in_days); + + // Repeat End Date + if($repeat_end == 'never') $repeat_end_date = '0000-00-00'; + elseif($repeat_end == 'date') $repeat_end_date = $repeat_end_at_date; + elseif($repeat_end == 'occurrences') + { + if($plus_date) $repeat_end_date = date('Y-m-d', strtotime($plus_date, strtotime($end_date))); + else $repeat_end_date = '0000-00-00'; + } + else $repeat_end_date = '0000-00-00'; + + // If event is not repeating then set the end date of event correctly + if(!$repeat_status or $repeat_type == 'custom_days') $repeat_end_date = $end_date; + + // Add parameters to the $event + $event['end'] = $repeat_end_date; + $event['year'] = $year; + $event['month'] = $month; + $event['day'] = $day; + $event['week'] = $week; + $event['weekday'] = $weekday; + $event['weekdays'] = $weekdays; + $event['days'] = $in_days; + $event['not_in_days'] = $not_in_days; + + // Update MEC Events Table + $mec_event_id = $this->db->select($this->db->prepare("SELECT `id` FROM `#__mec_events` WHERE `post_id` = %d", $post_id), 'loadResult'); + + if(!$mec_event_id) + { + $q1 = ""; + $q2 = ""; + + foreach($event as $key=>$value) + { + $q1 .= "`$key`,"; + + if(is_null($value)) $q2 .= "NULL,"; + else $q2 .= "'$value',"; + } + + $this->db->q("INSERT INTO `#__mec_events` (".trim($q1, ', ').") VALUES (".trim($q2, ', ').")", 'INSERT'); + } + else + { + $q = ""; + + foreach($event as $key=>$value) + { + if(is_null($value)) $q .= "`$key`=NULL,"; + else $q .= "`$key`='$value',"; + } + + $this->db->q("UPDATE `#__mec_events` SET ".trim($q, ', ')." WHERE `id`='$mec_event_id'"); + } + + // Update Schedule + $schedule = $this->getSchedule(); + $schedule->reschedule($post_id, $schedule->get_reschedule_maximum($repeat_type)); + + // Hourly Schedule + if(!isset($this->settings['fes_section_hourly_schedule']) or (isset($this->settings['fes_section_hourly_schedule']) and $this->settings['fes_section_hourly_schedule'])) + { + // Hourly Schedule Options + $raw_hourly_schedules = $mec['hourly_schedules'] ?? []; + unset($raw_hourly_schedules[':d:']); + + $hourly_schedules = []; + foreach($raw_hourly_schedules as $raw_hourly_schedule) + { + unset($raw_hourly_schedule['schedules'][':i:']); + $hourly_schedules[] = $raw_hourly_schedule; + } + + update_post_meta($post_id, 'mec_hourly_schedules', $hourly_schedules); + } + + // Booking Options + if(!isset($this->settings['fes_section_booking']) or (isset($this->settings['fes_section_booking']) and $this->settings['fes_section_booking'])) + { + // Booking and Ticket Options + $booking = $mec['booking'] ?? []; + update_post_meta($post_id, 'mec_booking', $booking); + + // Tickets + if(!isset($this->settings['fes_section_tickets']) or (isset($this->settings['fes_section_tickets']) and $this->settings['fes_section_tickets'])) + { + $tickets = $mec['tickets'] ?? []; + unset($tickets[':i:']); + + // Unset Ticket Dats + if(count($tickets)) + { + $new_tickets = []; + foreach($tickets as $key => $ticket) + { + unset($ticket['dates'][':j:']); + + $ticket_start_time_ampm = ((intval($ticket['ticket_start_time_hour']) > 0 and intval($ticket['ticket_start_time_hour']) < 13) and isset($ticket['ticket_start_time_ampm'])) ? $ticket['ticket_start_time_ampm'] : ''; + $ticket_render_start_time = date('h:ia', strtotime(sprintf('%02d', $ticket['ticket_start_time_hour']) . ':' . sprintf('%02d', $ticket['ticket_start_time_minute']) . $ticket_start_time_ampm)); + $ticket_end_time_ampm = ((intval($ticket['ticket_end_time_hour']) > 0 and intval($ticket['ticket_end_time_hour']) < 13) and isset($ticket['ticket_end_time_ampm'])) ? $ticket['ticket_end_time_ampm'] : ''; + $ticket_render_end_time = date('h:ia', strtotime(sprintf('%02d', $ticket['ticket_end_time_hour']) . ':' . sprintf('%02d', $ticket['ticket_end_time_minute']) . $ticket_end_time_ampm)); + + $ticket['ticket_start_time_hour'] = substr($ticket_render_start_time, 0, 2); + $ticket['ticket_start_time_ampm'] = strtoupper(substr($ticket_render_start_time, 5, 6)); + $ticket['ticket_end_time_hour'] = substr($ticket_render_end_time, 0, 2); + $ticket['ticket_end_time_ampm'] = strtoupper(substr($ticket_render_end_time, 5, 6)); + $ticket['price'] = trim($ticket['price']); + $ticket['limit'] = trim($ticket['limit']); + $ticket['minimum_ticket'] = trim($ticket['minimum_ticket']); + $ticket['stop_selling_value'] = trim($ticket['stop_selling_value']); + + // Bellow conditional block code is used to change ticket dates format to compatible ticket past dates structure for store in db. + foreach($ticket['dates'] as $dates_ticket_key => $dates_ticket_values) + { + if(isset($dates_ticket_values['start']) and trim($dates_ticket_values['start'])) + { + $ticket['dates'][$dates_ticket_key]['start'] = $this->main->standardize_format($dates_ticket_values['start']); + } + + if(isset($dates_ticket_values['end']) and trim($dates_ticket_values['end'])) + { + $ticket['dates'][$dates_ticket_key]['end'] = $this->main->standardize_format($dates_ticket_values['end']); + } + } + + $new_tickets[$key] = $ticket; + } + + $tickets = $new_tickets; + } + + update_post_meta($post_id, 'mec_tickets', $tickets); + update_post_meta($post_id, 'mec_global_tickets_applied', 1); + } + + // Fees + if(!isset($this->settings['fes_section_fees']) or (isset($this->settings['fes_section_fees']) and $this->settings['fes_section_fees'])) + { + // Fee options + $fees_global_inheritance = isset($mec['fees_global_inheritance']) ? sanitize_text_field($mec['fees_global_inheritance']) : 1; + update_post_meta($post_id, 'mec_fees_global_inheritance', $fees_global_inheritance); + + $fees = $mec['fees'] ?? []; + update_post_meta($post_id, 'mec_fees', $fees); + } + + // Variation + if(!isset($this->settings['fes_section_ticket_variations']) or (isset($this->settings['fes_section_ticket_variations']) and $this->settings['fes_section_ticket_variations'])) + { + // Ticket Variation options + $ticket_variations_global_inheritance = isset($mec['ticket_variations_global_inheritance']) ? sanitize_text_field($mec['ticket_variations_global_inheritance']) : 1; + update_post_meta($post_id, 'mec_ticket_variations_global_inheritance', $ticket_variations_global_inheritance); + + $ticket_variations = $mec['ticket_variations'] ?? []; + update_post_meta($post_id, 'mec_ticket_variations', $ticket_variations); + } + + // Booking Form + if(!isset($this->settings['fes_section_reg_form']) or (isset($this->settings['fes_section_reg_form']) and $this->settings['fes_section_reg_form'])) + { + // Registration Fields options + $reg_fields_global_inheritance = isset($mec['reg_fields_global_inheritance']) ? sanitize_text_field($mec['reg_fields_global_inheritance']) : 1; + update_post_meta($post_id, 'mec_reg_fields_global_inheritance', $reg_fields_global_inheritance); + + $reg_fields = $mec['reg_fields'] ?? []; + if($reg_fields_global_inheritance) $reg_fields = []; + + update_post_meta($post_id, 'mec_reg_fields', $reg_fields); + + $bfixed_fields = $mec['bfixed_fields'] ?? []; + if($reg_fields_global_inheritance) $bfixed_fields = []; + + update_post_meta($post_id, 'mec_bfixed_fields', $bfixed_fields); + } + } + + // Organizer Payment Options + $op = $mec['op'] ?? []; + update_post_meta($post_id, 'mec_op', $op); + update_user_meta(get_post_field('post_author', $post_id), 'mec_op', $op); + + // MEC Fields + $fields = (isset($mec['fields']) and is_array($mec['fields'])) ? $mec['fields'] : []; + update_post_meta($post_id, 'mec_fields', $fields); + + // Save fields one by one + foreach($fields as $field_id=>$values) + { + if(is_array($values)) + { + $values = array_unique($values); + $values = implode(',', $values); + } + + update_post_meta($post_id, 'mec_fields_'.$field_id, sanitize_text_field($values)); + } + + // Downloadable File + if(isset($mec['downloadable_file'])) + { + $dl_file = sanitize_text_field($mec['downloadable_file']); + update_post_meta($post_id, 'mec_dl_file', $dl_file); + } + + // Public Download Module File + if(isset($mec['public_download_module_file'])) + { + $public_dl_file = sanitize_text_field($mec['public_download_module_file']); + update_post_meta($post_id, 'mec_public_dl_file', $public_dl_file); + + $public_dl_title = isset($mec['public_download_module_title']) ? sanitize_text_field($mec['public_download_module_title']) : ''; + update_post_meta($post_id, 'mec_public_dl_title', $public_dl_title); + + $public_dl_description = isset($mec['public_download_module_description']) ? sanitize_text_field($mec['public_download_module_description']) : ''; + update_post_meta($post_id, 'mec_public_dl_description', $public_dl_description); + } + + // Event Gallery + $gallery = isset($mec['event_gallery']) && is_array($mec['event_gallery']) ? $mec['event_gallery'] : []; + update_post_meta($post_id, 'mec_event_gallery', $gallery); + + // Related Events + $related_events = (isset($mec['related_events']) and is_array($mec['related_events'])) ? $mec['related_events'] : []; + update_post_meta($post_id, 'mec_related_events', $related_events); + + // Event Banner + $event_banner = (isset($mec['banner']) and is_array($mec['banner'])) ? $mec['banner'] : []; + update_post_meta($post_id, 'mec_banner', $event_banner); + + // Event Dates Changed? + if($prev_start_datetime and $prev_end_datetime and !$repeat_status and $prev_start_datetime != $start_datetime and $prev_end_datetime != $end_datetime) + { + $this->main->event_date_updated($post_id, $prev_start_datetime, $prev_end_datetime); + } + + do_action('save_fes_meta_action', $post_id, $mec); + + // For Event Notification Badge. + if(isset($_REQUEST['mec']['post_id']) and trim(sanitize_text_field($_REQUEST['mec']['post_id'])) == '-1') update_post_meta($post_id, 'mec_event_date_submit', date('YmdHis', current_time('timestamp', 0))); + + $message = ''; + if($status == 'pending') $message = esc_html__('Event submitted. It will publish as soon as possible.', 'modern-events-calendar-lite'); + elseif($status == 'publish') $message = esc_html__('The event published.', 'modern-events-calendar-lite'); + + // Trigger Event + if($method == 'updated') do_action('mec_fes_updated', $post_id , 'update'); + else do_action('mec_fes_added', $post_id , ''); + + // Save Event Data + do_action('mec_save_event_data', $post_id, $mec); + + $redirect_to = ((isset($this->settings['fes_thankyou_page']) and trim($this->settings['fes_thankyou_page'])) ? get_permalink(intval($this->settings['fes_thankyou_page'])) : ''); + if(isset($this->settings['fes_thankyou_page_url']) and trim($this->settings['fes_thankyou_page_url'])) $redirect_to = esc_url($this->settings['fes_thankyou_page_url']); + + $this->main->response(array( + 'success' => 1, + 'message' => $message, + 'data'=> array( + 'post_id' => $post_id, + 'redirect_to' => $redirect_to, + ), + )); + } + + public function link_add_event() + { + if(!$this->relative_link and isset($this->settings['fes_form_page']) and trim($this->settings['fes_form_page'])) return get_permalink($this->settings['fes_form_page']); + else return $this->main->add_qs_var('post_id', '-1', $this->main->remove_qs_var('vlist')); + } + + public function link_edit_event($post_id) + { + if(!$this->relative_link and isset($this->settings['fes_form_page']) and trim($this->settings['fes_form_page'])) return $this->main->add_qs_var('post_id', $post_id, get_permalink($this->settings['fes_form_page'])); + else return $this->main->add_qs_var('post_id', $post_id, $this->main->remove_qs_var('vlist')); + } + + public function link_list_events() + { + if(!$this->relative_link and isset($this->settings['fes_list_page']) and trim($this->settings['fes_list_page'])) return get_permalink($this->settings['fes_list_page']); + else return $this->main->add_qs_var('vlist', 1, $this->main->remove_qs_var('post_id')); + } + + /** + * @param string $new_status + * @param string $old_status + * @param WP_Post $post + */ + public function status_changed($new_status, $old_status, $post) + { + // User creation is not enabled + if(!isset($this->settings['fes_guest_user_creation']) or (isset($this->settings['fes_guest_user_creation']) and !$this->settings['fes_guest_user_creation'])) return; + + if(('publish' === $new_status && 'publish' !== $old_status) && $this->PT === $post->post_type) + { + $guest_email = get_post_meta($post->ID, 'fes_guest_email', true); + if(!trim($guest_email) || !is_email($guest_email)) return; + + $user_id = 0; + $user_exists = email_exists($guest_email); + + if($user_exists and $user_exists == $post->post_author) return; + elseif($user_exists) $user_id = $user_exists; + else + { + $registered = register_new_user($guest_email, $guest_email); + if(!is_wp_error($registered)) + { + $user_id = $registered; + + $guest_name = get_post_meta($post->ID, 'fes_guest_name', true); + $ex = explode(' ', $guest_name); + + $first_name = $ex[0]; + unset($ex[0]); + + $last_name = implode(' ', $ex); + + wp_update_user(array( + 'ID' => $user_id, + 'first_name' => $first_name, + 'last_name' => $last_name, + )); + + $user = new WP_User($user_id); + $user->set_role('author'); + } + } + + if($user_id) + { + $db = $this->getDB(); + $db->q("UPDATE `#__posts` SET `post_author`='$user_id' WHERE `ID`='".$post->ID."'"); + } + } + } + + public function current_user_attachments($query = []) + { + $fes = $_REQUEST['mec_fes'] ?? 0; + $user_id = get_current_user_id(); + + if ($fes && $user_id && !current_user_can('manage_options')) { + $query['author'] = $user_id; + } + + return $query; + } +} + +// FES Categories Custom Walker +class FES_Custom_Walker extends Walker_Category +{ + /** + * This class is a custom walker for front end event submission hierarchical categories customizing + */ + private $post_id; + + function __construct($post_id) + { + $this->post_id = $post_id; + } + + function start_lvl(&$output, $depth = 0, $args = array()) + { + $indent = str_repeat("\t", $depth); + $output .= "$indent
    "; + } + + function end_lvl(&$output, $depth = 0, $args = array()) + { + $indent = str_repeat("\t", $depth); + $output .= "$indent
    "; + } + + function start_el(&$output, $data_object, $depth = 0, $args = array(), $current_object_id = 0) + { + $post_categories = get_the_terms($this->post_id, 'mec_category'); + + $categories = []; + if($post_categories) foreach($post_categories as $post_category) $categories[] = $post_category->term_id; + + $output .= ''; + } +} diff --git a/app/features/fes/form.php b/app/features/fes/form.php new file mode 100755 index 0000000..fdff13e --- /dev/null +++ b/app/features/fes/form.php @@ -0,0 +1,212 @@ + +
    + + $this->link_list_events(), + ) + ); + ?> + + +
    +
    + +
    + + settings['fes_section_excerpt']) && $this->settings['fes_section_excerpt']){ + + FormBuilder::excerpt( + $post, + array( + 'required' => isset($this->settings['fes_required_excerpt']) && $this->settings['fes_required_excerpt'], + ) + ); + } + + FormBuilder::info( $post ); + + FormBuilder::datetime( + $post, + array( + 'time_format' => $this->settings['time_format'] ?? 12, + 'datepicker_format' => (isset($this->settings['datepicker_format']) and trim($this->settings['datepicker_format'])) ? $this->settings['datepicker_format'] : 'Y-m-d', + 'required' => isset($this->settings['fes_required_dates']) && $this->settings['fes_required_dates'], + ) + ); + + if(isset($this->settings['tz_per_event']) and $this->settings['tz_per_event']){ + + FormBuilder::timezone( $post, array() ); + } + + if(isset($this->settings['countdown_status']) and $this->settings['countdown_status'] and (!isset($this->settings['fes_section_countdown_method']) or (isset($this->settings['fes_section_countdown_method']) and $this->settings['fes_section_countdown_method']))){ + + FormBuilder::countdown_status( $post, array() ); + } + + if(isset($this->settings['style_per_event']) and $this->settings['style_per_event'] and isset($this->settings['fes_section_style_per_event']) and $this->settings['fes_section_style_per_event']){ + + FormBuilder::style_per_event( $post, array() ); + } + + if(isset($this->settings['trailer_url_status']) and $this->settings['trailer_url_status'] and isset($this->settings['fes_section_trailer_url']) and $this->settings['fes_section_trailer_url']){ + + FormBuilder::trailer_url( $post, array() ); + } + + if( + (!isset($this->settings['event_visibility_status']) or (isset($this->settings['event_visibility_status']) and $this->settings['event_visibility_status'])) and + (!isset($this->settings['fes_section_shortcode_visibility']) or (isset($this->settings['fes_section_shortcode_visibility']) and $this->settings['fes_section_shortcode_visibility'])) + ){ + + FormBuilder::visibility( $post, array() ); + } + + FormBuilder::other_fields( $post, array() ); + + FormBuilder::note( $post, array() ); + ?> +
    + +
    + settings['fes_guest_name_email']) and $this->settings['fes_guest_name_email']){ + + FormBuilder::guest( $post, array() ); + } + + if(!isset($this->settings['fes_section_event_links']) or (isset($this->settings['fes_section_event_links']) and $this->settings['fes_section_event_links'])){ + + FormBuilder::event_links( + $post, + array( + 'event_link_required' => (isset($this->settings['fes_required_event_link']) and $this->settings['fes_required_event_link']), + 'more_info_required' => (isset($this->settings['fes_required_more_info_link']) and $this->settings['fes_required_more_info_link']), + ) + ); + } + + if(!isset($this->settings['fes_section_cost']) or (isset($this->settings['fes_section_cost']) and $this->settings['fes_section_cost'])){ + + FormBuilder::cost( + $post, + array( + 'required' => ((isset($this->settings['fes_required_cost']) and $this->settings['fes_required_cost'])), + ) + ); + } + + if(!isset($this->settings['fes_section_featured_image']) or (isset($this->settings['fes_section_featured_image']) and $this->settings['fes_section_featured_image'])){ + + FormBuilder::thumbnail( + $post, + array( + 'required' => (isset($this->settings['fes_required_featured_image']) and $this->settings['fes_required_featured_image']), + 'featured_image_caption' => (isset($this->settings['featured_image_caption']) and $this->settings['featured_image_caption']), + ) + ); + } + + if(!isset($this->settings['fes_section_event_gallery']) or (isset($this->settings['fes_section_event_gallery']) and $this->settings['fes_section_event_gallery'])) + { + FormBuilder::event_gallery( $post ); + } + + if(!isset($this->settings['fes_section_categories']) or (isset($this->settings['fes_section_categories']) and $this->settings['fes_section_categories'])) + { + FormBuilder::categories( + $post, + array( + 'required' => (isset($this->settings['fes_required_category']) and $this->settings['fes_required_category']), + ) + ); + } + + if(!isset($this->settings['fes_section_labels']) or (isset($this->settings['fes_section_labels']) and $this->settings['fes_section_labels'])){ + + FormBuilder::labels( + $post, + array( + 'required' => (isset($this->settings['fes_required_label']) and $this->settings['fes_required_label']), + ) + ); + } + + if(!isset($this->settings['fes_section_event_color']) or (isset($this->settings['fes_section_event_color']) and $this->settings['fes_section_event_color'])){ + + FormBuilder::color( $post, array() ); + } + + if(!isset($this->settings['fes_section_tags']) or (isset($this->settings['fes_section_tags']) and $this->settings['fes_section_tags'])){ + + FormBuilder::tags( $post, array() ); + } + + if((isset($this->settings['speakers_status']) and $this->settings['speakers_status']) and isset($this->settings['fes_section_speaker']) and $this->settings['fes_section_speaker']){ + + FormBuilder::speakers( $post, array() ); + } + + if( $this->getPRO() && isset($this->settings['sponsors_status']) and $this->settings['sponsors_status'] and isset($this->settings['fes_section_sponsor']) and $this->settings['fes_section_sponsor'] ){ + + FormBuilder::sponsors( $post, array( + 'add_sponsors' => !isset($this->settings['fes_add_sponsor']) || $this->settings['fes_add_sponsor'] ? 1: 0, + ) ); + } + + + if( isset($this->settings['fes_section_virtual_events']) && $this->settings['fes_section_virtual_events'] ){ + + FormBuilder::virtual( $post, array() ); + } + + if( isset($this->settings['fes_section_zoom_integration']) && $this->settings['fes_section_zoom_integration'] ){ + + FormBuilder::zoom( $post, array() ); + } + + ?> + +
    +
    + + settings['fes_agreement']) and $this->settings['fes_agreement']){ + + FormBuilder::agreement( + $post, + array( + 'agreement_page' => (isset($this->settings['fes_agreement_page']) and $this->settings['fes_agreement_page']) ? $this->settings['fes_agreement_page'] : false, + 'checked' => isset($this->settings['fes_agreement_checked']) && $this->settings['fes_agreement_checked'], + ) + ); + } + + FormBuilder::recaptcha( $post, array() ); + + FormBuilder::submit_button( $post, array() ); + ?> +
    +
    +
    + + \ No newline at end of file diff --git a/app/features/fes/index.html b/app/features/fes/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/features/fes/list.php b/app/features/fes/list.php new file mode 100755 index 0000000..7e9f14f --- /dev/null +++ b/app/features/fes/list.php @@ -0,0 +1,178 @@ +$this->PT, + 'posts_per_page'=>$limit, + 'paged'=>$paged, + 'post_status'=>array('pending', 'draft', 'future', 'publish') +); + +// Apply Author Query +if(!current_user_can('edit_others_posts')) $args['author'] = get_current_user_id(); + +// The Query +$query = new WP_Query($args); + +// Date Format +$date_format = get_option('date_format'); + +// Display Date +$display_date = (isset($this->settings['fes_display_date_in_list']) && $this->settings['fes_display_date_in_list']); + +// Generating javascript code of countdown module +$javascript = ''; + +// Include javascript code into the footer +$this->factory->params('footer', $javascript); +?> +
    + have_posts()): ?> +
    + +
    + +
      + have_posts()): $query->the_post(); + // Show Post Status + global $post; + $status = $this->main->get_event_label_status(trim($post->post_status)); + ?> +
    • + + + + (main->date_label(array( + 'date' => get_post_meta(get_the_ID(), 'mec_start_date', true) + ), array( + 'date' => get_post_meta(get_the_ID(), 'mec_end_date', true) + ), $date_format)); ?>) + + + settings['booking_status']) && $this->settings['booking_status']): + ?> +
      + + +
      +
      + +
      + + +
      +
      + +
        + getRender(); + $dates = $render->dates(get_the_ID(), NULL, 15, date('Y-m-d', $past_week)); + + $book = $this->getBook(); + foreach($dates as $date) + { + if(isset($date['start']['date']) and isset($date['end']['date'])) + { + $attendees_count = 0; + + $bookings = $this->main->get_bookings(get_the_ID(), $date['start']['timestamp']); + foreach($bookings as $booking) + { + $attendees_count += $book->get_total_attendees($booking->ID); + } + ?> +
      • main->date_label($date['start'], $date['end'], $date_format)); ?>
      • + +
      + +
      +
      + + +
      +
      +
    • + +
    + + +

    +
    + +
    + +
    \ No newline at end of file diff --git a/app/features/fes/message.php b/app/features/fes/message.php new file mode 100755 index 0000000..7b5df78 --- /dev/null +++ b/app/features/fes/message.php @@ -0,0 +1,7 @@ + +
    +

    +
    \ No newline at end of file diff --git a/app/features/gateways/index.html b/app/features/gateways/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/features/hourlyschedule.php b/app/features/hourlyschedule.php new file mode 100755 index 0000000..27a524a --- /dev/null +++ b/app/features/hourlyschedule.php @@ -0,0 +1,79 @@ + + */ +class MEC_feature_hourlyschedule extends MEC_base +{ + public $factory; + public $main; + public $cart; + public $book; + public $settings; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Factory + $this->factory = $this->getFactory(); + + // Import MEC Main + $this->main = $this->getMain(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + } + + /** + * Initialize Hourly Schedule Feature + * @author Webnus + */ + public function init() + { + // Hourly Schedule Shortcode + $this->factory->shortcode('mec-hourly-schedule', array($this, 'shortcode')); + } + + /** + * @param $atts + * @return string + * @throws Exception + */ + public function shortcode($atts) + { + $event_id = $atts['event-id'] ?? 0; + if(!$event_id) return '

    '.esc_html__('Please insert event id!', 'modern-events-calendar-lite').'

    '; + + $event = get_post($event_id); + if(!$event || $event->post_type != $this->main->get_main_post_type()) return '

    '.esc_html__('Event is not valid!', 'modern-events-calendar-lite').'

    '; + + // Create Single Skin + $single = new MEC_skin_single(); + + // Initialize the skin + $single->initialize([ + 'id' => $event_id, + 'maximum_dates' => $this->settings['booking_maximum_dates'] ?? 6 + ]); + + // Fetch the events + $events = $single->fetch(); + + if(!isset($events[0])) return '

    '.esc_html__('Event is not valid!', 'modern-events-calendar-lite').'

    '; + + ob_start(); + $single->display_hourly_schedules_widget($events[0], [ + 'title' => $event->post_title + ]); + + $html = ob_get_clean(); + + return '
    ' . MEC_kses::full($html) . '
    '; + } +} \ No newline at end of file diff --git a/app/features/index.html b/app/features/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/features/ix.php b/app/features/ix.php new file mode 100755 index 0000000..5625b3d --- /dev/null +++ b/app/features/ix.php @@ -0,0 +1,5254 @@ += 5.3 otherwise it doesn't activate + * @author Webnus + */ +class MEC_feature_ix extends MEC_base +{ + public $factory; + public $main; + public $db; + public $action; + public $ix; + public $response; + + /** + * Facebook App Access Token + * @var string + */ + private $fb_access_token = ''; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Factory + $this->factory = $this->getFactory(); + + // Import MEC Main + $this->main = $this->getMain(); + + // Import MEC DB + $this->db = $this->getDB(); + } + + /** + * Initialize IX feature + * @author Webnus + */ + public function init() + { + // Disable Import / Export Feature if autoload feature is not exists + if(!function_exists('spl_autoload_register')) return; + + $this->factory->action('admin_menu', array($this, 'menus'), 20); + + // Import APIs + $this->factory->action('init', array($this, 'include_google_api')); + $this->factory->action('init', array($this, 'include_meetup_api')); + + // MEC IX Action + $mec_ix_action = isset($_GET['mec-ix-action']) ? sanitize_text_field($_GET['mec-ix-action']) : ''; + + // Export All Events + if($mec_ix_action == 'export-events') $this->factory->action('init', array($this, 'export_all_events_do'), 9999); + elseif($mec_ix_action == 'export-bookings') $this->factory->action('init', array($this, 'export_all_bookings_do'), 9999); + elseif($mec_ix_action == 'google-calendar-export-get-token') $this->factory->action('init', array($this, 'g_calendar_export_get_token'), 9999); + + // AJAX Actions + $this->factory->action('wp_ajax_mec_ix_add_to_g_calendar', array($this, 'g_calendar_export_do')); + $this->factory->action('wp_ajax_mec_ix_g_calendar_authenticate', array($this, 'g_calendar_export_authenticate')); + + // Import XML File + $this->factory->action('mec_import_file', array($this, 'import_do')); + + // Third Party Plugins + $this->factory->action('wp_ajax_mec_ix_thirdparty_import', array($this, 'thirdparty_import_do')); + } + + /** + * Import Google API libraries + * @author Webnus + */ + public function include_google_api() + { + if(class_exists('Google_Service_Calendar')) return; + + MEC::import('app.api.Google.autoload', false); + } + + /** + * Import Meetup API libraries + * @author Webnus + */ + public function include_meetup_api() + { + if(class_exists('Meetup')) return; + + MEC::import('app.api.Meetup.meetup', false); + } + + /** + * Add the IX menu + * @author Webnus + */ + public function menus() + { + $capability = (current_user_can('administrator') ? 'manage_options' : 'mec_import_export'); + add_submenu_page('mec-intro', esc_html__('MEC - Import / Export', 'modern-events-calendar-lite'), esc_html__('Import / Export', 'modern-events-calendar-lite'), $capability, 'MEC-ix', array($this, 'ix')); + } + + /** + * Show content of Import / Export Menu + * @author Webnus + * @return void + */ + public function ix() + { + $tab = isset($_GET['tab']) ? sanitize_text_field($_GET['tab']) : ''; + + if($tab == 'MEC-export') $this->ix_export(); + elseif($tab == 'MEC-sync') $this->ix_sync(); + elseif($tab == 'MEC-g-calendar-export') $this->ix_g_calendar_export(); + elseif($tab == 'MEC-f-calendar-import') $this->ix_f_calendar_import(); + elseif($tab == 'MEC-meetup-import') $this->ix_meetup_import(); + elseif($tab == 'MEC-import') $this->ix_import(); + elseif($tab == 'MEC-thirdparty') $this->ix_thirdparty(); + elseif($tab == 'MEC-test-data') $this->ix_test_data(); + else $this->ix_g_calendar_import(); + } + + /** + * Show content of export tab + * @author Webnus + * @return void + */ + public function ix_export() + { + $path = MEC::import('app.features.ix.export', true, true); + + ob_start(); + include $path; + echo MEC_kses::full(ob_get_clean()); + } + + /** + * Show content of export tab + * @author Webnus + * @return void + */ + public function ix_sync() + { + // Current Action + $this->action = isset($_POST['mec-ix-action']) ? sanitize_text_field($_POST['mec-ix-action']) : ''; + $this->ix = ((isset($_POST['ix']) and is_array($_POST['ix'])) ? array_map('sanitize_text_field', $_POST['ix']) : array()); + + if($this->action == 'save-sync-options') + { + // Save options + $this->main->save_ix_options(array( + 'sync_g_import'=> $this->ix['sync_g_import'] ?? 0, + 'sync_g_import_auto'=> $this->ix['sync_g_import_auto'] ?? 0, + 'sync_g_export'=> $this->ix['sync_g_export'] ?? 0, + 'sync_g_export_auto'=> $this->ix['sync_g_export_auto'] ?? 0, + 'sync_g_export_attendees'=> $this->ix['sync_g_export_attendees'] ?? 0, + 'sync_f_import'=> $this->ix['sync_f_import'] ?? 0, + 'sync_meetup_import'=> $this->ix['sync_meetup_import'] ?? 0, + 'sync_meetup_import_auto'=> $this->ix['sync_meetup_import_auto'] ?? 0, + )); + } + + $path = MEC::import('app.features.ix.sync', true, true); + + ob_start(); + include $path; + echo MEC_kses::full(ob_get_clean()); + } + + /** + * Show content of import tab + * @author Webnus + * @return void + */ + public function ix_import() + { + // Current Action + $this->action = isset($_POST['mec-ix-action']) ? sanitize_text_field($_POST['mec-ix-action']) : ''; + $this->ix = ((isset($_POST['ix']) and is_array($_POST['ix'])) ? array_map('sanitize_text_field', $_POST['ix']) : array()); + + $this->response = []; + + $nonce = (isset($_POST['_wpnonce']) ? sanitize_text_field($_POST['_wpnonce']) : ''); + if(wp_verify_nonce($nonce, 'mec_import_start_upload')) + { + if(in_array($this->action, array('import-start-xml', 'import-start-ics'))) $this->response = $this->import_start(); + elseif($this->action == 'import-start-bookings') $this->response = $this->import_start_bookings(); + elseif(!empty($this->action)) $this->response = apply_filters('mec_import_item_action', array(), $this->action); + } + + $path = MEC::import('app.features.ix.import', true, true); + + ob_start(); + include $path; + echo MEC_kses::full(ob_get_clean()); + } + + public function import_start_bookings() + { + $feed_file = $_FILES['feed']; + + // File is not uploaded + if(!isset($feed_file['name']) or trim($feed_file['name']) == '') return array('success' => 0, 'message' => esc_html__('Please upload a CSV file.', 'modern-events-calendar-lite')); + + // File name validation + $name_ex = explode('.', $feed_file['name']); + $name_end = end($name_ex); + if($name_end != 'csv') return array('success' => 0, 'message' => esc_html__('Please upload a CSV file.', 'modern-events-calendar-lite')); + + // Upload the File + $upload_dir = wp_upload_dir(); + + $target_path = $upload_dir['basedir'].'/'.basename($feed_file['name']); + $uploaded = move_uploaded_file($feed_file['tmp_name'], $target_path); + + // Error on Upload + if(!$uploaded) return array('success' => 0, 'message' => esc_html__("An error occurred during the file upload! Please check permissions!", 'modern-events-calendar-lite')); + + if($type = mime_content_type($target_path) and $type == 'text/x-php') + { + unlink($target_path); + return array('success' => 0, 'message' => esc_html__("Please upload a CSV file.", 'modern-events-calendar-lite')); + } + + $bookings = []; + if(($h = fopen($target_path, 'r')) !== false) + { + // MEC Libraries + $gateway = new MEC_gateway(); + $book = $this->getBook(); + + $delimiters = [";" => 0, "," => 0, "\t" => 0, "|" => 0]; + + $first = fgets($h); + foreach ($delimiters as $delimiter => &$count) { + $count = count(str_getcsv($first, $delimiter)); + } + + $separator = array_search(max($delimiters), $delimiters); + + $r = 0; + while(($data = fgetcsv($h, 1000, $separator)) !== false) + { + $r++; + + $booking_id = $data[0]; + if($r === 1 and !is_numeric($booking_id)) continue; + + $event_title = $data[1]; + $event_id = post_exists($event_title, '', '', $this->main->get_main_post_type()); + + // Event not Found + if(!$event_id) continue; + + $tickets = get_post_meta($event_id, 'mec_tickets', true); + if(!is_array($tickets)) $tickets = []; + + $ticket_id = NULL; + $ticket_name = $data[6]; + + foreach($tickets as $tid => $ticket) + { + if(strtolower($ticket['name']) == strtolower($ticket_name)) + { + $ticket_id = $tid; + break; + } + } + + // Ticket ID not found! + if(is_null($ticket_id)) continue; + + $transaction_id = $data[7]; + + // Transaction Exists + $transaction_exists = $book->get_transaction($transaction_id); + if(is_array($transaction_exists) and count($transaction_exists)) continue; + + $start_datetime = $data[2]; + $end_datetime = $data[3]; + $name = $data[10]; + $email = $data[11]; + + $confirmed_label = $data[13]; + if($confirmed_label == esc_html__('Confirmed', 'modern-events-calendar-lite')) $confirmed = 1; + elseif($confirmed_label == esc_html__('Rejected', 'modern-events-calendar-lite')) $confirmed = -1; + else $confirmed = 0; + + $verified_label = $data[14]; + if($verified_label == esc_html__('Verified', 'modern-events-calendar-lite')) $verified = 1; + elseif($verified_label == esc_html__('Canceled', 'modern-events-calendar-lite')) $verified = -1; + else $verified = 0; + + $other_dates_str = $data[15] ?? ''; + $other_dates = []; + + if(trim($other_dates_str)) + { + $other_dates_ex1 = explode("\n", $other_dates_str); + foreach($other_dates_ex1 as $other_date_ex1) + { + $other_date_ex2 = explode(' -> ', trim($other_date_ex1)); + $other_dates[] = strtotime($other_date_ex2[0]).':'.strtotime($other_date_ex2[1]); + } + } + + $main_date = strtotime($start_datetime).':'.strtotime($end_datetime); + + $all_dates = []; + if(count($other_dates)) $all_dates = array_merge(array($main_date), $other_dates); + + $ticket_variations = explode(',', $data[12]); + $variations = $this->main->ticket_variations($event_id, $ticket_id); + + $v = []; + foreach($variations as $vid => $variation) + { + foreach($ticket_variations as $ticket_variation) + { + $variation_ex = explode(':', $ticket_variation); + if(!isset($variation_ex[1])) continue; + + $variation_name = $variation_ex[0]; + $variation_count = trim($variation_ex[1], '() '); + + if(strtolower($variation['title']) == strtolower($variation_name)) + { + $v[$vid] = $variation_count; + } + } + } + + if(!isset($bookings[$transaction_id])) $bookings[$transaction_id] = array('tickets' => array()); + + $bookings[$transaction_id]['tickets'][] = array( + 'email' => $email, + 'name' => $name, + 'variations' => $v, + 'id' => $ticket_id, + 'count' => 1 + ); + + if(!isset($bookings[$transaction_id]['date'])) $bookings[$transaction_id]['date'] = $main_date; + if(!isset($bookings[$transaction_id]['other_dates'])) $bookings[$transaction_id]['other_dates'] = $other_dates; + if(!isset($bookings[$transaction_id]['all_dates'])) $bookings[$transaction_id]['all_dates'] = $all_dates; + if(!isset($bookings[$transaction_id]['event_id'])) $bookings[$transaction_id]['event_id'] = $event_id; + if(!isset($bookings[$transaction_id]['confirmed'])) $bookings[$transaction_id]['confirmed'] = $confirmed; + if(!isset($bookings[$transaction_id]['verified'])) $bookings[$transaction_id]['verified'] = $verified; + } + + fclose($h); + + // MEC User + $u = $this->getUser(); + + foreach($bookings as $transaction_id => $transaction) + { + $event_id = $transaction['event_id']; + $tickets = $transaction['tickets']; + + $event_tickets = get_post_meta($event_id, 'mec_tickets', true); + if(!is_array($event_tickets)) $event_tickets = []; + + $raw_tickets = []; + $raw_variations = []; + + foreach($tickets as $ticket) + { + if(!isset($raw_tickets[$ticket['id']])) $raw_tickets[$ticket['id']] = 1; + else $raw_tickets[$ticket['id']] += 1; + + if(isset($ticket['variations']) and is_array($ticket['variations']) and count($ticket['variations'])) + { + // Variations Per Ticket + if(!isset($raw_variations[$ticket['id']])) $raw_variations[$ticket['id']] = []; + + foreach($ticket['variations'] as $variation_id => $variation_count) + { + if(!trim($variation_count)) continue; + + if(!isset($raw_variations[$ticket['id']][$variation_id])) $raw_variations[$ticket['id']][$variation_id] = $variation_count; + else $raw_variations[$ticket['id']][$variation_id] += $variation_count; + } + } + } + + $attention_date = $transaction['date'] ?? ''; + $attention_times = explode(':', $attention_date); + $date = date('Y-m-d H:i:s', trim($attention_times[0])); + + $other_dates = (isset($transaction['other_dates']) and is_array($transaction['other_dates'])) ? $transaction['other_dates'] : []; + $all_dates = (isset($transaction['all_dates']) and is_array($transaction['all_dates'])) ? $transaction['all_dates'] : []; + $timestamps = (isset($transaction['timestamps']) and is_array($transaction['timestamps'])) ? $transaction['timestamps'] : array($attention_date); + + // Calculate price of bookings + $price_details = $book->get_price_details($raw_tickets, $event_id, $event_tickets, $raw_variations, $timestamps); + + $transaction['all_dates'] = $all_dates; + $transaction['other_dates'] = $other_dates; + $transaction['timestamps'] = $timestamps; + $transaction['price_details'] = $price_details; + $transaction['total'] = $price_details['total']; + $transaction['discount'] = 0; + $transaction['price'] = $price_details['total']; + $transaction['payable'] = $price_details['payable']; + $transaction['coupon'] = NULL; + + update_option($transaction_id, $transaction, false); + + $attendees = $transaction['tickets'] ?? []; + + $main_attendee = $attendees[0] ?? []; + $name = $main_attendee['name'] ?? ''; + + $ticket_ids = ''; + $attendees_info = []; + + foreach($attendees as $i => $attendee) + { + if(!is_numeric($i)) continue; + + $ticket_ids .= $attendee['id'] . ','; + if(!array_key_exists($attendee['email'], $attendees_info)) $attendees_info[$attendee['email']] = array('count' => $attendee['count']); + else $attendees_info[$attendee['email']]['count'] = ($attendees_info[$attendee['email']]['count'] + $attendee['count']); + } + + $ticket_ids = ',' . trim($ticket_ids, ', ') . ','; + $user_id = $gateway->register_user($main_attendee); + + $book_subject = $name.' - '.($main_attendee['email'] ?? $u->get($user_id)->user_email); + $book_id = $book->add( + array( + 'post_author' => $user_id, + 'post_type' => $this->main->get_book_post_type(), + 'post_title' => $book_subject, + 'post_date' => $date, + 'attendees_info' => $attendees_info, + 'mec_attendees' => $attendees, + 'mec_gateway' => 'MEC_gateway', + 'mec_gateway_label' => $gateway->title() + ), + $transaction_id, + $ticket_ids + ); + + // Assign User + $u->assign($book_id, $user_id); + + update_post_meta($book_id, 'mec_confirmed', $transaction['confirmed']); + update_post_meta($book_id, 'mec_verified', $transaction['verified']); + } + } + + // Delete File + unlink($target_path); + + return array('success' => (count($bookings) ? 1 : 0), 'message' => (count($bookings) ? esc_html__('The bookings are imported successfully!', 'modern-events-calendar-lite') : esc_html__('No bookings found to import!', 'modern-events-calendar-lite'))); + } + + public function import_start() + { + $feed_file = $_FILES['feed']; + + // File is not uploaded + if(!isset($feed_file['name']) or trim($feed_file['name']) == '') return array('success' => 0, 'message' => esc_html__('Please upload the feed file.', 'modern-events-calendar-lite')); + + // File name validation + $ex = explode('.', $feed_file['name']); + $name_end = end($ex); + if(!in_array($name_end, array('xml', 'ics'))) return array('success' => 0, 'message' => esc_html__('Please upload an XML or an ICS file.', 'modern-events-calendar-lite')); + + // File Type is not valid + if(!isset($feed_file['type']) or !in_array(strtolower($feed_file['type']), array('text/xml', 'text/calendar'))) return array('success' => 0, 'message' => esc_html__('The file type should be XML or ICS.', 'modern-events-calendar-lite')); + + // Upload the File + $upload_dir = wp_upload_dir(); + + $target_path = $upload_dir['basedir'].'/'.basename($feed_file['name']); + $uploaded = move_uploaded_file($feed_file['tmp_name'], $target_path); + + // Error on Upload + if(!$uploaded) return array('success' => 0, 'message' => esc_html__("An error occurred during the file upload! Please check permissions!", 'modern-events-calendar-lite')); + + if($type = mime_content_type($target_path) and $type == 'text/x-php') + { + unlink($target_path); + return array('success' => 0, 'message' => esc_html__("Please upload an XML or an ICS file.", 'modern-events-calendar-lite')); + } + + if($type === 'text/calendar' and is_string($this->main->parse_ics($target_path))) + { + return array('success' => 0, 'message' => sprintf(__("The ICS file is not valid. Reported Error: %s", 'modern-events-calendar-lite'), ''.$this->main->parse_ics($target_path).'')); + } + + // Import + do_action('mec_import_file', $target_path); + + // Delete File + unlink($target_path); + + return array('success' => 1, 'message' => esc_html__('The events are imported successfully!', 'modern-events-calendar-lite')); + } + + public function import_do($feed) + { + // Increase the resources + @ini_set('memory_limit', '1024M'); + @ini_set('max_execution_time', 300); + + do_action('mec_custom_max_execution'); + + $file = $this->getFile(); + $extension = $file->getExt($feed); + + /** + * @var MEC_db $db + */ + $db = $this->getDB(); + + /** + * @var MEC_main $main + */ + $main = $this->getMain(); + + // Settings + $settings = $main->get_settings(); + + // WP Upload Path + $wp_upload_dir = wp_upload_dir(); + + $posts = []; + if(strtolower($extension) == 'xml') + { + $xml_string = str_replace(':i:', 'iii', $file->read($feed)); + $xml_string = str_replace(':fi:', 'fif', $xml_string); + $xml_string = str_replace(':v:', 'vvv', $xml_string); + + $XML = simplexml_load_string($xml_string); + if($XML === false) return false; + + foreach($XML->children() as $event) + { + $feed_event_id = (int) $event->ID; + + // Event Data + $meta = $event->meta; + $mec = $event->mec; + + // Event location + $location = ($event->locations ? $event->locations->item[0] : NULL); + $location_id = ($location and isset($location->name)) ? $main->save_location(array + ( + 'name'=>trim((string) $location->name), + 'address'=>(string) $location->address, + 'latitude'=>(string) $location->latitude, + 'longitude'=>(string) $location->longitude, + 'thumbnail'=>(string) $location->thumbnail + )) : 1; + + // Event Organizer + $organizer = ($event->organizers ? $event->organizers->item[0] : NULL); + $organizer_id = ($organizer and isset($organizer->name)) ? $main->save_organizer(array + ( + 'name'=>trim((string) $organizer->name), + 'email'=>(string) $organizer->email, + 'tel'=>(string) $organizer->tel, + 'url'=>(string) $organizer->url, + 'thumbnail'=>(string) $organizer->thumbnail + )) : 1; + + // Event Categories + $category_ids = []; + if(isset($event->categories)) + { + foreach($event->categories->children() as $category) + { + $category_id = $main->save_category(array + ( + 'name'=>trim((string) $category->name), + )); + + if($category_id) $category_ids[] = $category_id; + } + } + + // Event Tags + $tag_ids = []; + if(isset($event->tags)) + { + foreach($event->tags->children() as $tag) + { + $tag_id = $main->save_tag(array + ( + 'name'=>trim((string) $tag->name), + )); + + if($tag_id) $tag_ids[] = $tag_id; + } + } + + // Event Labels + $label_ids = []; + if(isset($event->labels)) + { + foreach($event->labels->children() as $label) + { + $label_id = $main->save_label(array + ( + 'name'=>trim((string) $label->name), + 'color'=>(string) $label->color, + )); + + if($label_id) $label_ids[] = $label_id; + } + } + + // Event Speakers + $speaker_ids = []; + if(isset($event->speakers)) + { + foreach($event->speakers->children() as $speaker) + { + $speaker_id = $main->save_speaker(array + ( + 'name'=>trim((string) $speaker->name), + 'job_title'=>(string) (isset($speaker->job_title) ? $speaker->job_title : ''), + 'tel'=>(string) (isset($speaker->tel) ? $speaker->tel : ''), + 'email'=>(string) (isset($speaker->email) ? $speaker->email : ''), + 'facebook'=>(string) (isset($speaker->facebook) ? $speaker->facebook : ''), + 'twitter'=>(string) (isset($speaker->twitter) ? $speaker->twitter : ''), + 'instagram'=>(string) (isset($speaker->instagram) ? $speaker->instagram : ''), + 'linkedin'=>(string) (isset($speaker->linkedin) ? $speaker->linkedin : ''), + 'website'=>(string) (isset($speaker->website) ? $speaker->website : ''), + 'thumbnail'=>(string) (isset($speaker->thumbnail) ? $speaker->thumbnail : ''), + )); + + if($speaker_id) $speaker_ids[] = $speaker_id; + } + } + + // Event Sponsors + $sponsor_ids = []; + if(isset($event->sponsors) and isset($settings['sponsors_status']) and $settings['sponsors_status']) + { + foreach($event->sponsors->children() as $sponsor) + { + $sponsor_id = $main->save_sponsor(array + ( + 'name'=>trim((string) $sponsor->name), + 'link'=>(string) (isset($sponsor->link) ? $sponsor->link : ''), + 'logo'=>(string) (isset($sponsor->logo) ? $sponsor->logo : ''), + )); + + if($sponsor_id) $sponsor_ids[] = $sponsor_id; + } + } + + // Start + $start_date = (string) $meta->mec_date->start->date; + $start_hour = (int) $meta->mec_date->start->hour; + $start_minutes = (int) $meta->mec_date->start->minutes; + $start_ampm = (string) $meta->mec_date->start->ampm; + + // End + $end_date = (string) $meta->mec_date->end->date; + $end_hour = (int) $meta->mec_date->end->hour; + $end_minutes = (int) $meta->mec_date->end->minutes; + $end_ampm = (string) $meta->mec_date->end->ampm; + + // Time Options + $allday = (int) $meta->mec_date->allday; + $time_comment = (string) $meta->mec_date->comment; + $hide_time = (int) $meta->mec_date->hide_time; + $hide_end_time = (int) $meta->mec_date->hide_end_time; + + // Repeat Options + $repeat_status = (int) $meta->mec_repeat_status; + $repeat_type = (string) $meta->mec_repeat_type; + $repeat_interval = (int) $meta->mec_repeat_interval; + $finish = (string) $mec->end; + $year = (string) $mec->year; + $month = (string) $mec->month; + $day = (string) $mec->day; + $week = (string) $mec->week; + $weekday = (string) $mec->weekday; + $weekdays = (string) $mec->weekdays; + $days = (string) $mec->days; + $not_in_days = (string) $mec->not_in_days; + + $additional_organizer_ids = []; + if(isset($meta->mec_additional_organizer_ids)) + { + foreach($meta->mec_additional_organizer_ids->children() as $o) + { + $additional_organizer_ids[] = (int) $o; + } + } + + $hourly_schedules = []; + if(isset($meta->mec_hourly_schedules)) + { + foreach($meta->mec_hourly_schedules->children() as $s) + { + $hourly_schedules[] = array + ( + 'from' => (string) $s->from, + 'to' => (string) $s->to, + 'title' => (string) $s->title, + 'description' => (string) $s->description, + ); + } + } + + $tickets = []; + if(isset($meta->mec_tickets)) + { + foreach($meta->mec_tickets->children() as $t) + { + $tickets[] = array + ( + 'name' => (string) $t->name, + 'description' => (string) $t->description, + 'price' => (string) $t->price, + 'price_label' => (string) $t->price_label, + 'limit' => (string) $t->limit, + 'unlimited' => (int) $t->unlimited, + ); + } + } + + $fees = []; + if(isset($meta->mec_fees)) + { + foreach($meta->mec_fees->children() as $f) + { + if($f->getName() !== 'item') continue; + + $fees[] = array + ( + 'title' => (string) $f->title, + 'amount' => (string) $f->amount, + 'type' => (string) $f->type, + ); + } + } + + $reg_fields = []; + if(isset($meta->mec_reg_fields)) + { + foreach($meta->mec_reg_fields->children() as $r) + { + if($r->getName() !== 'item') continue; + + $options = []; + foreach($r->options->children() as $o) $options[] = (string) $o->label; + + $reg_fields[] = array + ( + 'mandatory' => (int) $r->mandatory, + 'type' => (string) $r->type, + 'label' => (string) $r->label, + 'options' => $options, + ); + } + } + + $advanced_days = []; + if(isset($meta->mec_advanced_days)) + { + foreach($meta->mec_advanced_days->children() as $t) + { + $advanced_days[] = (string) $t; + } + } + + // Event Fields + $event_fields = []; + if(isset($event->fields)) + { + // Global Fields + $global_fields = $this->main->get_event_fields(); + if(!is_array($global_fields)) $global_fields = []; + + foreach($event->fields->children() as $field) + { + $field_id = isset($field->id) ? (int) $field->id : NULL; + if(!$field_id) continue; + + $field_type = isset($field->type) ? (string) $field->type : NULL; + if(!$field_type) continue; + + $field_val = isset($field->value) ? (string) $field->value : NULL; + if(!$field_val) continue; + + $global_field = ($global_fields[$field_id] ?? NULL); + if(!$global_field) continue; + + if(!is_array($global_field) or (is_array($global_field) and !isset($global_field['type'])) or (is_array($global_field) and isset($global_field['type']) and $global_field['type'] !== $field_type)) continue; + + if(in_array($field_type, array('checkbox'))) + { + $raw_field_value = explode(',', trim($field_val, ', ')); + + $field_value = []; + foreach($raw_field_value as $field_k => $field_v) + { + if(trim($field_v) !== '') $field_value[] = trim($field_v); + } + } + else $field_value = $field_val; + + $event_fields[$field_id] = $field_value; + } + } + + $args = array + ( + 'title'=> (string) $event->title, + 'content'=> (string) $event->content, + 'status'=> (string) ($event->post ? $event->post->post_status : 'publish'), + 'location_id'=>$location_id, + 'organizer_id'=>$organizer_id, + 'date'=>array + ( + 'start'=>array( + 'date'=>$start_date, + 'hour'=>$start_hour, + 'minutes'=>$start_minutes, + 'ampm'=>$start_ampm, + ), + 'end'=>array( + 'date'=>$end_date, + 'hour'=>$end_hour, + 'minutes'=>$end_minutes, + 'ampm'=>$end_ampm, + ), + 'repeat'=>array(), + 'allday'=>$allday, + 'comment'=>$time_comment, + 'hide_time'=>$hide_time, + 'hide_end_time'=>$hide_end_time, + ), + 'start'=>$start_date, + 'start_time_hour'=>$start_hour, + 'start_time_minutes'=>$start_minutes, + 'start_time_ampm'=>$start_ampm, + 'end'=>$end_date, + 'end_time_hour'=>$end_hour, + 'end_time_minutes'=>$end_minutes, + 'end_time_ampm'=>$end_ampm, + 'repeat_status'=>$repeat_status, + 'repeat_type'=>$repeat_type, + 'interval'=>$repeat_interval, + 'finish'=>$finish, + 'year'=>$year, + 'month'=>$month, + 'day'=>$day, + 'week'=>$week, + 'weekday'=>$weekday, + 'weekdays'=>$weekdays, + 'days'=>$days, + 'not_in_days'=>$not_in_days, + 'meta'=>array + ( + 'mec_source'=>'mec-calendar', + 'mec_feed_event_id'=>$feed_event_id, + 'mec_dont_show_map'=> (int) $meta->mec_dont_show_map, + 'mec_color'=> (string) $meta->mec_color, + 'mec_read_more'=> (string) $meta->mec_read_more, + 'mec_more_info'=> (string) $meta->mec_more_info, + 'mec_more_info_title'=> (string) $meta->mec_more_info_title, + 'mec_more_info_target'=> (string) $meta->mec_more_info_target, + 'mec_cost'=> (string) $meta->mec_cost, + 'mec_additional_organizer_ids' =>$additional_organizer_ids, + 'mec_repeat'=>array + ( + 'status' => (int) $meta->mec_repeat->status, + 'type' => (string) $meta->mec_repeat->type, + 'interval' => (int) $meta->mec_repeat->interval, + 'end' => (string) $meta->mec_repeat->end, + 'end_at_date' => (string) $meta->mec_repeat->end_at_date, + 'end_at_occurrences' => (string) $meta->mec_repeat->end_at_occurrences, + ), + 'mec_allday'=>$allday, + 'mec_hide_time'=>$hide_time, + 'mec_hide_end_time'=>$hide_end_time, + 'mec_comment'=>$time_comment, + 'mec_repeat_end'=> (string) $meta->mec_repeat_end, + 'mec_repeat_end_at_occurrences'=> (string) $meta->mec_repeat_end_at_occurrences, + 'mec_repeat_end_at_date'=> (string) $meta->mec_repeat_end_at_date, + 'mec_in_days'=> (string) $meta->mec_in_days, + 'mec_not_in_days'=> (string) $meta->mec_not_in_days, + 'mec_hourly_schedules'=>$hourly_schedules, + 'mec_booking'=>array + ( + 'bookings_limit_unlimited' => (int) $meta->mec_booking->bookings_limit_unlimited, + 'bookings_limit' => (int) $meta->mec_booking->bookings_limit, + ), + 'mec_tickets'=>$tickets, + 'mec_fees_global_inheritance'=> (int) $meta->mec_fees_global_inheritance, + 'mec_fees'=>$fees, + 'mec_reg_fields_global_inheritance'=> (int) $meta->mec_reg_fields_global_inheritance, + 'mec_reg_fields'=>$reg_fields, + 'mec_advanced_days'=>$advanced_days, + 'mec_fields'=>$event_fields, + ) + ); + + $post_id = $db->select("SELECT `post_id` FROM `#__postmeta` WHERE `meta_value`='$feed_event_id' AND `meta_key`='mec_feed_event_id'", 'loadResult'); + + // Insert the event into MEC + $post_id = $main->save_event($args, $post_id); + + // Add it to the imported posts + $posts[] = $post_id; + + // Set location to the post + if($location_id) wp_set_object_terms($post_id, (int) $location_id, 'mec_location'); + + // Set organizer to the post + if($organizer_id) wp_set_object_terms($post_id, (int) $organizer_id, 'mec_organizer'); + + // Set categories to the post + if(count($category_ids)) foreach($category_ids as $category_id) wp_set_object_terms($post_id, (int) $category_id, 'mec_category', true); + + // Set tags to the post + if(count($tag_ids)) foreach($tag_ids as $tag_id) wp_set_object_terms($post_id, (int) $tag_id, apply_filters('mec_taxonomy_tag', ''), true); + + // Set labels to the post + if(count($label_ids)) foreach($label_ids as $label_id) wp_set_object_terms($post_id, (int) $label_id, 'mec_label', true); + + // Set speakers to the post + if(count($speaker_ids)) foreach($speaker_ids as $speaker_id) wp_set_object_terms($post_id, (int) $speaker_id, 'mec_speaker', true); + + // Set sponsors to the post + if(count($sponsor_ids)) foreach($sponsor_ids as $sponsor_id) wp_set_object_terms($post_id, (int) $sponsor_id, 'mec_sponsor', true); + + // Featured Image + $featured_image = isset($event->featured_image) ? (string) $event->featured_image->full : ''; + if(!has_post_thumbnail($post_id) and trim($featured_image)) + { + $file_name = basename($featured_image); + + $path = rtrim($wp_upload_dir['path'], DS.' ').DS.$file_name; + $url = rtrim($wp_upload_dir['url'], '/ ').'/'.$file_name; + + // Download Image + $buffer = $main->get_web_page($featured_image); + + $file->write($path, $buffer); + $main->set_featured_image($url, $post_id); + } + } + } + elseif(strtolower($extension) == 'ics') + { + $parsed = $main->parse_ics($feed); + + // ics file not valid + if(is_string($parsed)) return $posts; + + $calendar_timezone = $parsed->calendarTimeZone(); + + // Timezone + $timezone = $main->get_timezone(); + + $events = $parsed->events(); + foreach($events as $event) + { + $feed_event_id = $event->uid; + + // Event location + $location = $event->location; + $location_id = $location && trim($location) ? $main->save_location(array + ( + 'name'=>trim((string) $location), + )) : 1; + + // Event Organizer + $organizer = $event->organizer_array ?? []; + $organizer_id = (isset($organizer[0]) and isset($organizer[0]['CN'])) ? $main->save_organizer(array + ( + 'name'=>trim((string) $organizer[0]['CN']), + 'email'=>(string) str_replace('MAILTO:', '', $organizer[1]), + )) : 1; + + // Event Categories + $category_ids = []; + if(isset($event->categories) and trim($event->categories)) + { + $cats = explode(',', $event->categories); + foreach($cats as $category) + { + $category_id = $main->save_category(array + ( + 'name'=>trim((string) $category), + )); + + if($category_id) $category_ids[] = $category_id; + } + } + + // Event Timezone + $event_timezone = $timezone; + + $ics_timezone = NULL; + if(isset($event->dtstart_array) and isset($event->dtstart_array[0]) and isset($event->dtstart_array[0]['TZID'])) $ics_timezone = $event->dtstart_array[0]['TZID']; + + $allday_event = ((isset($event->dtstart_array, $event->dtstart_array[0], $event->dtstart_array[0]['VALUE']) and $event->dtstart_array[0]['VALUE'] === 'DATE') and (isset($event->dtend_array, $event->dtend_array[0], $event->dtend_array[0]['VALUE']) and $event->dtend_array[0]['VALUE'] === 'DATE')); + $start_datetime = $event->dtstart; + + $not_in_days = NULL; + + // ICS file has Timezone for event + if($ics_timezone) + { + $date_start = new DateTime($start_datetime, new DateTimeZone($ics_timezone)); + $event_timezone = $ics_timezone; + + $date_end = NULL; + + $end_timestamp = isset($event->dtend) ? strtotime($event->dtend) : 0; + if($end_timestamp) + { + $end_datetime = $event->dtend; + + $date_end = new DateTime($end_datetime, new DateTimeZone($ics_timezone)); + } + + // Excluded Dates + if(isset($event->exdate) and trim($event->exdate)) + { + $ex_dates = explode(',', $event->exdate); + + $not_in_days = ''; + foreach($ex_dates as $ex_date) + { + $exd = new DateTime($ex_date, new DateTimeZone('UTC')); + $exd->setTimezone(new DateTimeZone($ics_timezone)); + + $not_in_days .= $exd->format('Y-m-d').','; + } + + $not_in_days = trim($not_in_days, ', '); + } + } + // Consider UTC as default timezone + else + { + $cal_tz = 'UTC'; + if(trim($calendar_timezone)) $cal_tz = $calendar_timezone; + + if(isset($event->dtstart_tz) and !$allday_event) $start_datetime = $event->dtstart_tz; + + $date_start = new DateTime($start_datetime, new DateTimeZone($cal_tz)); + $date_start->setTimezone(new DateTimeZone($event_timezone)); + + $date_end = NULL; + + $end_timestamp = isset($event->dtend) ? strtotime($event->dtend) : 0; + if($end_timestamp) + { + $end_datetime = $event->dtend; + if(isset($event->dtend_tz) and !$allday_event) $end_datetime = $event->dtend_tz; + + $date_end = new DateTime($end_datetime, new DateTimeZone($cal_tz)); + $date_end->setTimezone(new DateTimeZone($event_timezone)); + } + + // Excluded Dates + if(isset($event->exdate) and trim($event->exdate)) + { + $ex_dates = explode(',', $event->exdate); + + $not_in_days = ''; + foreach($ex_dates as $ex_date) + { + $exd = new DateTime($ex_date, new DateTimeZone($cal_tz)); + $exd->setTimezone(new DateTimeZone($event_timezone)); + + $not_in_days .= $exd->format('Y-m-d').','; + } + + $not_in_days = trim($not_in_days, ', '); + } + } + + $start_date = $date_start->format('Y-m-d'); + $start_hour = $date_start->format('g'); + $start_minutes = $date_start->format('i'); + $start_ampm = $date_start->format('A'); + + $end_date = $end_timestamp ? $date_end->format('Y-m-d') : $start_date; + $end_hour = $end_timestamp ? $date_end->format('g') : 8; + $end_minutes = $end_timestamp ? $date_end->format('i') : '00'; + $end_ampm = $end_timestamp ? $date_end->format('A') : 'PM'; + + // Time Options + $allday = 0; + $time_comment = ''; + $hide_time = 0; + $hide_end_time = 0; + + if($start_hour === '12' and $start_minutes === '00' and $start_ampm === 'AM' and $end_hour === '12' and $end_minutes === '00' and $end_ampm === 'AM') + { + $allday = 1; + + $start_hour = 0; + $start_minutes = 0; + $start_ampm = 'AM'; + + $end_hour = 11; + $end_minutes = 55; + $end_ampm = 'PM'; + + $diff = $this->main->date_diff($start_date, $end_date); + if(($diff ? $diff->days : 0) > 1) + { + $date_end->sub(new DateInterval('P1D')); + $end_date = $date_end->format('Y-m-d'); + } + } + + // Repeat Options + $repeat_status = 0; + $repeat_type = ''; + $repeat_interval = NULL; + $finish = $end_date; + $year = NULL; + $month = NULL; + $day = NULL; + $week = NULL; + $weekday = NULL; + $weekdays = NULL; + $days = NULL; + $repeat_count = NULL; + $advanced_days = NULL; + + // Recurring Event + $rrule = (isset($event->rrule) and trim($event->rrule)) ? $event->rrule : ''; + if(trim($rrule) != '') + { + $ex1 = explode(';', $rrule); + + $rule = []; + foreach($ex1 as $r) + { + $ex2 = explode('=', $r); + $rrule_key = strtolower($ex2[0]); + $rrule_value = ($rrule_key == 'until' ? $ex2[1] : strtolower($ex2[1])); + $rule[$rrule_key] = $rrule_value; + } + + if(isset($rule['count']) and is_numeric($rule['count'])) $repeat_count = max($rule['count'], 0); + + $repeat_status = 1; + if($rule['freq'] == 'daily') + { + $repeat_type = 'daily'; + $repeat_interval = $rule['interval'] ?? 1; + } + elseif($rule['freq'] == 'weekly') + { + $repeat_type = 'weekly'; + $repeat_interval = isset($rule['interval']) ? $rule['interval']*7 : 7; + } + elseif($rule['freq'] == 'monthly' and isset($rule['byday']) and trim($rule['byday'])) + { + $repeat_type = 'advanced'; + + $adv_week = (isset($rule['bysetpos']) and trim($rule['bysetpos']) != '') ? $rule['bysetpos'] : (int) substr($rule['byday'], 0, -2); + $adv_day = str_replace($adv_week, '', $rule['byday']); + + $mec_adv_day = 'Sat'; + if($adv_day == 'su') $mec_adv_day = 'Sun'; + elseif($adv_day == 'mo') $mec_adv_day = 'Mon'; + elseif($adv_day == 'tu') $mec_adv_day = 'Tue'; + elseif($adv_day == 'we') $mec_adv_day = 'Wed'; + elseif($adv_day == 'th') $mec_adv_day = 'Thu'; + elseif($adv_day == 'fr') $mec_adv_day = 'Fri'; + + if($adv_week < 0) $adv_week = 'l'; + $advanced_days = array($mec_adv_day.'.'.$adv_week); + } + elseif($rule['freq'] == 'monthly') + { + $repeat_type = 'monthly'; + + $year = '*'; + $month = '*'; + + $s = $start_date; + $e = $end_date; + + $_days = []; + while(strtotime($s) <= strtotime($e)) + { + $_days[] = date('d', strtotime($s)); + $s = date('Y-m-d', strtotime('+1 Day', strtotime($s))); + } + + $day = ','.implode(',', array_unique($_days)).','; + + $week = '*'; + $weekday = '*'; + $repeat_interval = $rule['interval'] ?? 1; + } + elseif($rule['freq'] == 'yearly') + { + $repeat_type = 'yearly'; + + $year = '*'; + + $s = $start_date; + $e = $end_date; + + $_months = []; + $_days = []; + while(strtotime($s) <= strtotime($e)) + { + $_months[] = date('m', strtotime($s)); + $_days[] = date('d', strtotime($s)); + + $s = date('Y-m-d', strtotime('+1 Day', strtotime($s))); + } + + $month = ','.implode(',', array_unique($_months)).','; + $day = ','.implode(',', array_unique($_days)).','; + + $week = '*'; + $weekday = '*'; + } + + // Custom Week Days + if($repeat_type == 'weekly' and isset($rule['byday']) and count(explode(',', $rule['byday'])) > 1) + { + $g_week_days = explode(',', $rule['byday']); + $week_day_mapping = array('mo'=>1, 'tu'=>2, 'we'=>3, 'th'=>4, 'fr'=>5, 'sa'=>6, 'su'=>7); + + $weekdays = ''; + foreach($g_week_days as $g_week_day) $weekdays .= $week_day_mapping[$g_week_day].','; + + $weekdays = ','.trim($weekdays, ', ').','; + $repeat_interval = NULL; + + $repeat_type = 'certain_weekdays'; + } + + $finish = isset($rule['until']) ? date('Y-m-d', strtotime($rule['until'])) : NULL; + } + + $additional_organizer_ids = []; + $hourly_schedules = []; + $tickets = []; + $fees = []; + $reg_fields = []; + + $args = array + ( + 'title' => (string) $event->summary, + 'content' => (string) $event->description, + 'location_id' => $location_id, + 'organizer_id' => $organizer_id, + 'date' => array + ( + 'start' => array( + 'date' => $start_date, + 'hour' => $start_hour, + 'minutes' => $start_minutes, + 'ampm' => $start_ampm, + ), + 'end' => array( + 'date' => $end_date, + 'hour' => $end_hour, + 'minutes' => $end_minutes, + 'ampm' => $end_ampm, + ), + 'repeat' => array(), + 'allday' => $allday, + 'comment' => $time_comment, + 'hide_time' => $hide_time, + 'hide_end_time' => $hide_end_time, + ), + 'start' => $start_date, + 'start_time_hour' => $start_hour, + 'start_time_minutes' => $start_minutes, + 'start_time_ampm' => $start_ampm, + 'end' => $end_date, + 'end_time_hour' => $end_hour, + 'end_time_minutes' => $end_minutes, + 'end_time_ampm' => $end_ampm, + 'repeat_status'=>$repeat_status, + 'repeat_type'=>$repeat_type, + 'repeat_count'=>$repeat_count, + 'interval'=>$repeat_interval, + 'finish'=>$finish, + 'year' => $year, + 'month' => $month, + 'day' => $day, + 'week' => $week, + 'weekday' => $weekday, + 'weekdays' => $weekdays, + 'days' => $days, + 'not_in_days' => $not_in_days, + 'meta' => array + ( + 'mec_source' => 'ics-calendar', + 'mec_feed_event_id' => $feed_event_id, + 'mec_dont_show_map' => 0, + 'mec_additional_organizer_ids' => $additional_organizer_ids, + 'mec_allday' => $allday, + 'mec_hide_time' => $hide_time, + 'mec_hide_end_time' => $hide_end_time, + 'mec_comment' => $time_comment, + 'mec_in_days'=> $days, + 'mec_not_in_days'=> $not_in_days, + 'mec_hourly_schedules' => $hourly_schedules, + 'mec_tickets' => $tickets, + 'mec_fees_global_inheritance' => 1, + 'mec_fees' => $fees, + 'mec_reg_fields_global_inheritance' => 1, + 'mec_reg_fields' => $reg_fields, + 'mec_timezone' => ($event_timezone === $timezone ? 'global' : $event_timezone), + 'mec_advanced_days'=>$advanced_days, + ) + ); + + $post_id = $db->select("SELECT `post_id` FROM `#__postmeta` WHERE `meta_value`='$feed_event_id' AND `meta_key`='mec_feed_event_id'", 'loadResult'); + + // Insert the event into MEC + $post_id = $main->save_event($args, $post_id); + + // Add it to the imported posts + $posts[] = $post_id; + + // Set location to the post + if($location_id) wp_set_object_terms($post_id, (int) $location_id, 'mec_location'); + + // Set organizer to the post + if($organizer_id) wp_set_object_terms($post_id, (int) $organizer_id, 'mec_organizer'); + + // Set categories to the post + if(count($category_ids)) foreach($category_ids as $category_id) wp_set_object_terms($post_id, (int) $category_id, 'mec_category', true); + + // Featured Image + $featured_image = isset($event->attach) ? (string) $event->attach : ''; + if(!has_post_thumbnail($post_id) and trim($featured_image)) + { + $file_name = basename($featured_image); + + $path = rtrim($wp_upload_dir['path'], DS.' ').DS.$file_name; + $url = rtrim($wp_upload_dir['url'], '/ ').'/'.$file_name; + + // Download Image + $buffer = $main->get_web_page($featured_image); + + $file->write($path, $buffer); + $main->set_featured_image($url, $post_id); + } + } + } + + return $posts; + } + + /** + * Show content of test data tab + * @author Webnus + * @return void + */ + public function ix_test_data() + { + // Current Action + $this->action = isset($_POST['mec-ix-action']) ? sanitize_text_field($_POST['mec-ix-action']) : ''; + $this->ix = (isset($_POST['ix']) and is_array($_POST['ix'])) ? array_map('sanitize_text_field', $_POST['ix']) : []; + + $this->response = []; + if($this->action == 'test-data-generation-start') $this->response = $this->generate_test_data(); + + $path = MEC::import('app.features.ix.test_data', true, true); + + ob_start(); + include $path; + echo MEC_kses::full(ob_get_clean()); + } + + public function generate_test_data() + { + $number = isset($_POST['number']) ? sanitize_text_field($_POST['number']) : 10; + $category_method = isset($_POST['category']) ? sanitize_text_field($_POST['category']) : ''; + $tag_method = isset($_POST['tag']) ? sanitize_text_field($_POST['tag']) : ''; + $organizer_method = isset($_POST['organizer']) ? sanitize_text_field($_POST['organizer']) : ''; + $location_method = isset($_POST['location']) ? sanitize_text_field($_POST['location']) : ''; + + $category_id = $tag_id = $organizer_id = $location_id = null; + $tag_taxonomy = apply_filters('mec_taxonomy_tag', ''); + + if($category_method && $category_method === 'random') $category_id = $this->select_random_term('mec_category'); + else if($category_method && $category_method === 'generate') $category_id = $this->generate_random_term('mec_category'); + else if($category_method) $category_id = (int) $category_method; + + if($tag_method && $tag_method === 'random') $tag_id = $this->select_random_term($tag_taxonomy); + else if($tag_method && $tag_method === 'generate') $tag_id = $this->generate_random_term($tag_taxonomy); + else if($tag_method) $tag_id = (int) $tag_method; + + if($organizer_method && $organizer_method === 'random') $organizer_id = $this->select_random_term('mec_organizer'); + else if($organizer_method && $organizer_method === 'generate') $organizer_id = $this->generate_random_term('mec_organizer'); + else if($organizer_method) $organizer_id = (int) $organizer_method; + + if($location_method && $location_method === 'random') $location_id = $this->select_random_term('mec_location'); + else if($location_method && $location_method === 'generate') $location_id = $this->generate_random_term('mec_location'); + else if($location_method) $location_id = (int) $location_method; + + // Generate Events + for($i = 1; $i <= $number; $i++) + { + $chars = str_shuffle('abcdefghijklmnopqrstuvwxyz'); + $name = ucfirst(substr($chars, 0, rand(6, 10))); + + $start_date = date('Y-m-d', strtotime('+'.rand(2, 30).' days')); + $start_hour = 8; + $start_minutes = 0; + $start_ampm = 'AM'; + + $end_date = date('Y-m-d', strtotime('+'.rand(0, 3).' days', strtotime($start_date))); + $end_hour = 6; + $end_minutes = 0; + $end_ampm = 'PM'; + + $event_id = $this->main->save_event([ + 'title' => sprintf(esc_html__('%s - Test Event', 'modern-events-calendar-lite'), $name), + 'location_id' => $location_id, + 'organizer_id' => $organizer_id, + 'date' => [ + 'start' => [ + 'date' => $start_date, + 'hour' => $start_hour, + 'minutes' => $start_minutes, + 'ampm' => $start_ampm, + ], + 'end' => [ + 'date' => $end_date, + 'hour' => $end_hour, + 'minutes' => $end_minutes, + 'ampm' => $end_ampm, + ], + 'repeat' => [], + 'allday' => 0, + 'comment' => '', + 'hide_time' => 0, + 'hide_end_time' => 0, + ], + 'start' => $start_date, + 'start_time_hour' => $start_hour, + 'start_time_minutes' => $start_minutes, + 'start_time_ampm' => $start_ampm, + 'end' => $end_date, + 'end_time_hour' => $end_hour, + 'end_time_minutes' => $end_minutes, + 'end_time_ampm' => $end_ampm, + 'repeat_status' => 0, + 'repeat_type' => '', + 'interval' => null, + 'finish' => $end_date, + 'year' => null, + 'month' => null, + 'day' => null, + 'week' => null, + 'weekday' => null, + 'weekdays' => null, + 'meta' => [ + 'mec_source' => 'mec-random', + 'mec_allday' => 0, + 'mec_advanced_days' => null, + ] + ]); + + // Set terms + if($location_id) wp_set_object_terms($event_id, (int) $location_id, 'mec_location'); + if($organizer_id) wp_set_object_terms($event_id, (int) $organizer_id, 'mec_organizer'); + if($category_id) wp_set_object_terms($event_id, (int) $category_id, 'mec_category'); + if($tag_id) wp_set_object_terms($event_id, (int) $tag_id, $tag_taxonomy); + + if($category_method && $category_method === 'random') $category_id = $this->select_random_term('mec_category'); + if($tag_method && $tag_method === 'random') $tag_id = $this->select_random_term($tag_taxonomy); + if($organizer_method && $organizer_method === 'random') $organizer_id = $this->select_random_term('mec_organizer'); + if($location_method && $location_method === 'random') $location_id = $this->select_random_term('mec_location'); + } + + return ['success' => 1, 'message' => sprintf(esc_html__("%s events successfully created.", 'modern-events-calendar-lite'), ''.$number.'')]; + } + + private function select_random_term($taxonomy) + { + $terms = get_terms([ + 'taxonomy' => $taxonomy, + 'hide_empty' => 0, + ]); + if(count($terms) === 0) return 0; + + shuffle($terms); + return array_slice($terms, 0, 1)[0]->term_id; + } + + private function generate_random_term($taxonomy) + { + $chars = str_shuffle('abcdefghijklmnopqrstuvwxyz'); + $name = ucfirst(substr($chars, 0, rand(5, 8))); + + return wp_insert_term($name, $taxonomy)['term_id']; + } + + /** + * Show content of third party tab + * @author Webnus + * @return void + */ + public function ix_thirdparty() + { + // Current Action + $this->action = isset($_POST['mec-ix-action']) ? sanitize_text_field($_POST['mec-ix-action']) : ''; + $this->ix = ((isset($_POST['ix']) and is_array($_POST['ix'])) ? array_map('sanitize_text_field', $_POST['ix']) : array()); + + $this->response = []; + if($this->action == 'thirdparty-import-start') $this->response = $this->thirdparty_import_start(); + + $path = MEC::import('app.features.ix.thirdparty', true, true); + + ob_start(); + include $path; + echo MEC_kses::full(ob_get_clean()); + } + + public function thirdparty_import_start() + { + $third_party = $this->ix['third-party'] ?? NULL; + + if($third_party == 'eventon' and class_exists('EventON')) + { + $events = get_posts(array( + 'posts_per_page' => -1, + 'post_type' => 'ajde_events', + )); + } + elseif($third_party == 'the-events-calendar' and class_exists('Tribe__Events__Main')) + { + $events = get_posts(array( + 'posts_per_page' => -1, + 'post_type' => 'tribe_events', + )); + } + elseif($third_party == 'weekly-class' and class_exists('WeeklyClass')) + { + $events = get_posts(array( + 'posts_per_page' => -1, + 'post_type' => 'class', + )); + } + elseif($third_party == 'calendarize-it' and class_exists('plugin_righthere_calendar')) + { + $events = get_posts(array( + 'posts_per_page' => -1, + 'post_type' => 'events', + )); + } + elseif($third_party == 'event-espresso' and function_exists('bootstrap_espresso')) + { + $events = get_posts(array( + 'posts_per_page' => -1, + 'post_type' => 'espresso_events', + )); + } + elseif($third_party == 'events-manager-recurring' and class_exists('EM_Formats')) + { + $events = get_posts(array( + 'posts_per_page' => -1, + 'post_type' => 'event-recurring', + )); + } + elseif($third_party == 'events-manager-single' and class_exists('EM_Formats')) + { + $events = get_posts(array( + 'posts_per_page' => -1, + 'post_type' => 'event', + 'meta_key' => '_recurrence_id', + 'meta_compare' => 'NOT EXISTS' + )); + } + elseif($third_party == 'wp-event-manager' and class_exists('WP_Event_Manager')) + { + $events = get_posts(array( + 'posts_per_page' => -1, + 'post_type' => 'event_listing', + )); + } + else return array('success'=>0, 'message'=>__("Third Party plugin is not installed and activated!", 'modern-events-calendar-lite')); + + return array( + 'success' => 1, + 'data' => array( + 'count' => count($events), + 'events' => $events + ) + ); + } + + public function thirdparty_import_do() + { + // Check if our nonce is set. + if(!isset($_POST['_wpnonce'])) $this->main->response(array('success'=>0, 'code'=>'NONCE_MISSING')); + + // Verify that the nonce is valid. + if(!wp_verify_nonce(sanitize_text_field($_POST['_wpnonce']), 'mec_ix_thirdparty_import')) $this->main->response(array('success'=>0, 'code'=>'NONCE_IS_INVALID')); + + $this->ix = ((isset($_POST['ix']) and is_array($_POST['ix'])) ? array_map('sanitize_text_field', $_POST['ix']) : array()); + + $step = (isset($_POST['step']) and is_numeric($_POST['step']) and $_POST['step'] > 0) ? (int) $_POST['step'] : 1; + $count = 20; + $offset = max(($step - 1), 0) * $count; + + $all_events = ((isset($_POST['tp-events']) and is_array($_POST['tp-events'])) ? array_map('sanitize_text_field', $_POST['tp-events']) : array()); + $events = array_slice($all_events, $offset, $count); + + $third_party = $this->ix['third-party'] ?? ''; + + $response = array('success'=>0, 'message'=>__('Third Party plugin is invalid!', 'modern-events-calendar-lite')); + if($third_party == 'eventon') $response = $this->thirdparty_eventon_import_do($events); + elseif($third_party == 'the-events-calendar') $response = $this->thirdparty_tec_import_do($events); + elseif($third_party == 'weekly-class') $response = $this->thirdparty_weekly_class_import_do($events); + elseif($third_party == 'calendarize-it') $response = $this->thirdparty_calendarize_it_import_do($events); + elseif($third_party == 'event-espresso') $response = $this->thirdparty_es_import_do($events); + elseif($third_party == 'events-manager-recurring') $response = $this->thirdparty_emr_import_do($events); + elseif($third_party == 'events-manager-single') $response = $this->thirdparty_ems_import_do($events); + elseif($third_party == 'wp-event-manager') $response = $this->thirdparty_wpem_import_do($events); + + $response['next_step'] = $step + 1; + $response['finished'] = (int) ($step * $count >= count($all_events)); + $response['all'] = (int) count($all_events); + $response['imported'] = (int) min(($step * $count), count($all_events)); + + $this->main->response($response); + } + + public function thirdparty_eventon_import_do($IDs) + { + $count = 0; + foreach($IDs as $ID) + { + $post = get_post($ID); + $metas = $this->main->get_post_meta($ID); + + // Event Title and Content + $title = $post->post_title; + $description = $post->post_content; + $third_party_id = $ID; + + // Event location + $locations = wp_get_post_terms($ID, 'event_location'); + $location_id = 1; + + // Import Event Locations into MEC locations + if(isset($this->ix['import_locations']) and $this->ix['import_locations'] and isset($locations[0])) + { + $l_metas = evo_get_term_meta('event_location', $locations[0]->term_id); + $location_id = $this->main->save_location(array + ( + 'name'=>trim($locations[0]->name), + 'address'=>($l_metas['location_address'] ?? ''), + 'latitude'=>($l_metas['location_lat'] ?? 0), + 'longitude'=>($l_metas['location_lon'] ?? 0), + )); + } + + // Event Organizer + $organizers = wp_get_post_terms($ID, 'event_organizer'); + $organizer_id = 1; + + // Import Event Organizer into MEC organizers + if(isset($this->ix['import_organizers']) and $this->ix['import_organizers'] and isset($organizers[0])) + { + $o_metas = evo_get_term_meta('event_organizer', $organizers[0]->term_id); + $organizer_id = $this->main->save_organizer(array + ( + 'name'=>trim($organizers[0]->name), + 'tel'=>($o_metas['evcal_org_contact'] ?? ''), + 'url'=>($o_metas['evcal_org_exlink'] ?? ''), + )); + } + + // Event Categories + $categories = wp_get_post_terms($ID, 'event_type'); + $category_ids = []; + + // Import Event Categories into MEC categories + if(isset($this->ix['import_categories']) and $this->ix['import_categories'] and count($categories)) + { + foreach($categories as $category) + { + $category_id = $this->main->save_category(array + ( + 'name'=>trim($category->name), + )); + + if($category_id) $category_ids[] = $category_id; + } + } + + // Event Start Date and Time + $date_start = new DateTime(date('Y-m-d G:i', $metas['evcal_srow'])); + if(isset($metas['evo_event_timezone']) and trim($metas['evo_event_timezone'])) $date_start->setTimezone(new DateTimeZone($metas['evo_event_timezone'])); + + $start_date = $date_start->format('Y-m-d'); + $start_hour = $date_start->format('g'); + $start_minutes = $date_start->format('i'); + $start_ampm = $date_start->format('A'); + + // Event End Date and Time + $date_end = new DateTime(date('Y-m-d G:i', $metas['evcal_erow'])); + if(isset($metas['evo_event_timezone']) and trim($metas['evo_event_timezone'])) $date_end->setTimezone(new DateTimeZone($metas['evo_event_timezone'])); + + $end_date = $date_end->format('Y-m-d'); + $end_hour = $date_end->format('g'); + $end_minutes = $date_end->format('i'); + $end_ampm = $date_end->format('A'); + + // Event Time Options + $hide_end_time = (isset($metas['evo_hide_endtime']) and $metas['evo_hide_endtime'] == 'yes') ? 1 : 0; + $allday = (isset($metas['evcal_allday']) and trim($metas['evcal_allday']) == 'yes') ? $metas['evcal_allday'] : 0; + + // Recurring Event + if(isset($metas['evcal_repeat']) and $metas['evcal_repeat'] == 'yes') + { + $repeat_status = 1; + $interval = NULL; + $year = NULL; + $month = NULL; + $day = NULL; + $week = NULL; + $weekday = NULL; + $weekdays = NULL; + $days = NULL; + $finish = NULL; + + $occurrences = (isset($metas['repeat_intervals']) and is_array($metas['repeat_intervals'])) ? $metas['repeat_intervals'] : []; + if(count($occurrences)) + { + $t = $occurrences[(count($occurrences) -1)][1]; + $finish = date('Y-m-d', $t); + } + + $freq = (isset($metas['evcal_rep_freq']) and trim($metas['evcal_rep_freq'])) ? $metas['evcal_rep_freq'] : 'daily'; + + if($freq == 'daily') + { + $repeat_type = 'daily'; + $interval = $metas['evcal_rep_gap'] ?? 1; + } + elseif($freq == 'weekly') + { + $repeat_type = 'weekly'; + $interval = isset($metas['evcal_rep_gap']) ? $metas['evcal_rep_gap']*7 : 7; + } + elseif($freq == 'monthly') + { + $repeat_type = 'monthly'; + + $year = '*'; + $month = '*'; + + $s = $start_date; + $e = $end_date; + + $_days = []; + while(strtotime($s) <= strtotime($e)) + { + $_days[] = date('d', strtotime($s)); + $s = date('Y-m-d', strtotime('+1 Day', strtotime($s))); + } + + $day = ','.implode(',', array_unique($_days)).','; + + $week = '*'; + $weekday = '*'; + } + elseif($freq == 'yearly') + { + $repeat_type = 'yearly'; + + $year = '*'; + + $s = $start_date; + $e = $end_date; + + $_months = []; + $_days = []; + while(strtotime($s) <= strtotime($e)) + { + $_months[] = date('m', strtotime($s)); + $_days[] = date('d', strtotime($s)); + + $s = date('Y-m-d', strtotime('+1 Day', strtotime($s))); + } + + $month = ','.implode(',', array_unique($_months)).','; + $day = ','.implode(',', array_unique($_days)).','; + + $week = '*'; + $weekday = '*'; + } + elseif($freq == 'custom') + { + $repeat_type = 'custom_days'; + $occurrences = (isset($metas['repeat_intervals']) and is_array($metas['repeat_intervals'])) ? $metas['repeat_intervals'] : []; + + $days = ''; + $x = 1; + foreach($occurrences as $occurrence) + { + if($x == 1) + { + $finish = date('Y-m-d', $occurrence[0]); + + $x++; + continue; + } + + $days .= date('Y-m-d', $occurrence[0]).','; + $x++; + } + + $days = trim($days, ', '); + } + else $repeat_type = ''; + + // Custom Week Days + if($repeat_type == 'weekly' and isset($metas['evo_rep_WKwk']) and is_array($metas['evo_rep_WKwk']) and count($metas['evo_rep_WKwk']) > 1) + { + $week_day_mapping = array('d1'=>1, 'd2'=>2, 'd3'=>3, 'd4'=>4, 'd5'=>5, 'd6'=>6, 'd0'=>7); + + $weekdays = ''; + foreach($metas['evo_rep_WKwk'] as $week_day) $weekdays .= $week_day_mapping['d'.$week_day].','; + + $weekdays = ','.trim($weekdays, ', ').','; + $interval = NULL; + + $repeat_type = 'certain_weekdays'; + } + } + // Single Event + else + { + $repeat_status = 0; + $repeat_type = ''; + $interval = NULL; + $finish = $end_date; + $year = NULL; + $month = NULL; + $day = NULL; + $week = NULL; + $weekday = NULL; + $weekdays = NULL; + $days = NULL; + } + + // Hourly Schedule + $hourly_schedules = []; + if(isset($metas['_sch_blocks']) and is_array($metas['_sch_blocks']) and count($metas['_sch_blocks'])) + { + foreach($metas['_sch_blocks'] as $sch_block) + { + foreach($sch_block as $sch) + { + if(!is_array($sch)) continue; + $hourly_schedules[] = array( + 'from' => $sch['evo_sch_stime'], + 'to' => $sch['evo_sch_etime'], + 'title' => $sch['evo_sch_title'], + 'description' => $sch['evo_sch_desc'], + ); + } + } + } + + // Read More Link + $more_info_link = isset($metas['evcal_lmlink']) && trim($metas['evcal_lmlink']) ? $metas['evcal_lmlink'] : ''; + + $args = array + ( + 'title'=>$title, + 'content'=>$description, + 'location_id'=>$location_id, + 'organizer_id'=>$organizer_id, + 'date'=>array + ( + 'start'=>array( + 'date'=>$start_date, + 'hour'=>$start_hour, + 'minutes'=>$start_minutes, + 'ampm'=>$start_ampm, + ), + 'end'=>array( + 'date'=>$end_date, + 'hour'=>$end_hour, + 'minutes'=>$end_minutes, + 'ampm'=>$end_ampm, + ), + 'repeat'=>array( + 'end'=>'date', + 'end_at_date'=>$finish, + 'end_at_occurrences'=>10, + ), + 'allday'=>$allday, + 'comment'=>'', + 'hide_time'=>0, + 'hide_end_time'=>$hide_end_time, + ), + 'start'=>$start_date, + 'start_time_hour'=>$start_hour, + 'start_time_minutes'=>$start_minutes, + 'start_time_ampm'=>$start_ampm, + 'end'=>$end_date, + 'end_time_hour'=>$end_hour, + 'end_time_minutes'=>$end_minutes, + 'end_time_ampm'=>$end_ampm, + 'repeat_status'=>$repeat_status, + 'repeat_type'=>$repeat_type, + 'interval'=>$interval, + 'finish'=>$finish, + 'year'=>$year, + 'month'=>$month, + 'day'=>$day, + 'week'=>$week, + 'weekday'=>$weekday, + 'weekdays'=>$weekdays, + 'days'=>$days, + 'meta'=>[ + 'mec_source'=>'eventon', + 'mec_eventon_id'=>$third_party_id, + 'mec_allday'=>$allday, + 'hide_end_time'=>$hide_end_time, + 'mec_repeat_end'=>'date', + 'mec_repeat_end_at_occurrences'=>9, + 'mec_repeat_end_at_date'=>$finish, + 'mec_in_days'=>$days, + 'mec_hourly_schedules'=>$hourly_schedules, + 'mec_more_info'=>$more_info_link, + ] + ); + + $post_id = $this->db->select("SELECT `post_id` FROM `#__postmeta` WHERE `meta_value`='$third_party_id' AND `meta_key`='mec_eventon_id'", 'loadResult'); + + // Insert the event into MEC + $post_id = $this->main->save_event($args, $post_id); + + // Set location to the post + if($location_id) wp_set_object_terms($post_id, (int) $location_id, 'mec_location'); + + // Set organizer to the post + if($organizer_id) wp_set_object_terms($post_id, (int) $organizer_id, 'mec_organizer'); + + // Set categories to the post + if(count($category_ids)) foreach($category_ids as $category_id) wp_set_object_terms($post_id, (int) $category_id, 'mec_category', true); + + // Set Features Image + if(isset($this->ix['import_featured_image']) and $this->ix['import_featured_image'] and $thumbnail_id = get_post_thumbnail_id($ID)) + { + set_post_thumbnail($post_id, $thumbnail_id); + } + + $count++; + } + + return array('success'=>1, 'data'=>$count); + } + + /** + * @throws Exception + */ + public function thirdparty_tec_import_do($IDs) + { + $count = 0; + foreach($IDs as $ID) + { + $post = get_post($ID); + $metas = $this->main->get_post_meta($ID); + + // Event Title and Content + $title = $post->post_title; + $description = $post->post_content; + $third_party_id = $ID; + + // Event Author + $author = NULL; + if(isset($this->ix['import_author']) and $this->ix['import_author'] and $post->post_author) + { + $author = $post->post_author; + } + + // Event location + $location = get_post($metas['_EventVenueID']); + $location_id = 1; + + // Import Event Locations into MEC locations + if(isset($this->ix['import_locations']) and $this->ix['import_locations'] and isset($location->ID)) + { + $l_metas = $this->main->get_post_meta($location->ID); + $location_id = $this->main->save_location(array + ( + 'name' => trim($location->post_title), + 'address' => $l_metas['_VenueAddress'] ?? '', + 'latitude' => 0, + 'longitude' => 0, + )); + } + + // Event Organizer + $organizer = get_post($metas['_EventOrganizerID']); + $organizer_id = 1; + + // Import Event Organizer into MEC organizers + if(isset($this->ix['import_organizers']) and $this->ix['import_organizers'] and isset($organizer->ID)) + { + $o_metas = $this->main->get_post_meta($organizer->ID); + $organizer_id = $this->main->save_organizer(array + ( + 'name' => trim($organizer->post_title), + 'tel' => $o_metas['_OrganizerPhone'] ?? '', + 'email' => $o_metas['_OrganizerEmail'] ?? '', + 'url' => $o_metas['_OrganizerWebsite'] ?? '', + )); + } + + // Event Categories + $categories = wp_get_post_terms($ID, 'tribe_events_cat'); + $category_ids = []; + + // Import Event Categories into MEC categories + if(isset($this->ix['import_categories']) and $this->ix['import_categories'] and count($categories)) + { + foreach($categories as $category) + { + $category_id = $this->main->save_category(array + ( + 'name'=>trim($category->name), + )); + + if($category_id) $category_ids[] = $category_id; + } + } + + // Event Start Date and Time + $date_start = new DateTime(date('Y-m-d G:i', strtotime($metas['_EventStartDate']))); + + $start_date = $date_start->format('Y-m-d'); + $start_hour = $date_start->format('g'); + $start_minutes = $date_start->format('i'); + $start_ampm = $date_start->format('A'); + + // Event End Date and Time + $date_end = new DateTime(date('Y-m-d G:i', strtotime($metas['_EventEndDate']))); + + $end_date = $date_end->format('Y-m-d'); + $end_hour = $date_end->format('g'); + $end_minutes = $date_end->format('i'); + $end_ampm = $date_end->format('A'); + + // Event Time Options + $hide_end_time = 0; + $allday = (isset($metas['_EventAllDay']) and trim($metas['_EventAllDay']) == 'yes') ? 1 : 0; + + // Recurring Event + if( + isset($metas['_EventRecurrence']['rules']) && is_array($metas['_EventRecurrence']) && count($metas['_EventRecurrence']) && + is_array($metas['_EventRecurrence']['rules']) && count($metas['_EventRecurrence']['rules']) + ) + { + $repeat_status = 1; + $repeat_type = ''; + $finish = NULL; + $year = NULL; + $month = NULL; + $day = NULL; + $week = NULL; + $weekday = NULL; + $weekdays = NULL; + $days = NULL; + $advanced_days = NULL; + + $rule = $metas['_EventRecurrence']['rules'][0]; + + $end_type = 'never'; + $finish_type = isset($rule['end-type']) ? strtolower($rule['end-type']) : 'never'; + + if($finish_type === 'on' and isset($rule['end']) and trim($rule['end'])) + { + $end_type = 'date'; + $finish = $rule['end']; + } + elseif($finish_type === 'after' and isset($rule['end-count']) and trim($rule['end-count'])) + { + $end_type = 'occurrences'; + $end_occurrence = (int) $rule['end-count']; + } + + $interval = (int) $rule['custom']['interval']; + + $type = strtolower($rule['custom']['type']); + if($type === 'daily') + { + $repeat_type = 'daily'; + } + else if($type === 'weekly') + { + $repeat_type = 'certain_weekdays'; + + if(count($rule['custom']['week']['day']) === 1) + { + $repeat_type = 'weekly'; + $interval = $interval * 7; + } + else + { + $weekdays = ','.trim(implode(',', $rule['custom']['week']['day']), ', ').','; + $interval = NULL; + } + } + else if($type === 'monthly') + { + if(isset($rule['custom']['month']['same-day']) && $rule['custom']['month']['same-day'] === 'no') + { + $repeat_type = 'advanced'; + + $week_no = $rule['custom']['month']['number']; + if($week_no == 'Last' || $week_no == '5') $week_no = 'l'; + + $week_day = $rule['custom']['month']['day']; + + if($week_day == '0') $week_day = 'Sun'; + elseif($week_day == '1') $week_day = 'Mon'; + elseif($week_day == '2') $week_day = 'Tue'; + elseif($week_day == '3') $week_day = 'Wed'; + elseif($week_day == '4') $week_day = 'Thu'; + elseif($week_day == '5') $week_day = 'Fri'; + else $week_day = 'Sat'; + + $advanced_days = [$week_day.'.'.$week_no]; + } + else + { + $repeat_type = 'monthly'; + + $year = '*'; + $month = '*'; + + $s = $start_date; + $e = $end_date; + + $_days = []; + while(strtotime($s) <= strtotime($e)) + { + $_days[] = date('d', strtotime($s)); + $s = date('Y-m-d', strtotime('+1 Day', strtotime($s))); + } + + $day = ',' . implode(',', array_unique($_days)) . ','; + + $week = '*'; + $weekday = '*'; + } + } + else if($type === 'yearly') + { + $repeat_type = 'yearly'; + + $year = '*'; + + $s = $start_date; + $e = $end_date; + + $_months = []; + $_days = []; + while(strtotime($s) <= strtotime($e)) + { + $_months[] = date('m', strtotime($s)); + $_days[] = date('d', strtotime($s)); + + $s = date('Y-m-d', strtotime('+1 Day', strtotime($s))); + } + + $_months = array_unique($_months); + + $month = ',' . implode(',', array($_months[0])) . ','; + $day = ',' . implode(',', array_unique($_days)) . ','; + + $week = '*'; + $weekday = '*'; + } + } + else + { + // Single Event + $repeat_status = 0; + $repeat_type = ''; + $interval = NULL; + $finish = $end_date; + $year = NULL; + $month = NULL; + $day = NULL; + $week = NULL; + $weekday = NULL; + $weekdays = NULL; + $days = NULL; + + $end_type = 'date'; + $end_occurrence = 10; + } + + $args = array + ( + 'title'=>$title, + 'content'=>$description, + 'author'=>$author, + 'location_id'=>$location_id, + 'organizer_id'=>$organizer_id, + 'date'=>array + ( + 'start'=>array( + 'date'=>$start_date, + 'hour'=>$start_hour, + 'minutes'=>$start_minutes, + 'ampm'=>$start_ampm, + ), + 'end'=>array( + 'date'=>$end_date, + 'hour'=>$end_hour, + 'minutes'=>$end_minutes, + 'ampm'=>$end_ampm, + ), + 'repeat'=>array( + 'end'=>$end_type, + 'end_at_date'=>$finish, + 'end_at_occurrences'=>$end_occurrence, + ), + 'allday'=>$allday, + 'comment'=>'', + 'hide_time'=>0, + 'hide_end_time'=>$hide_end_time, + ), + 'start'=>$start_date, + 'start_time_hour'=>$start_hour, + 'start_time_minutes'=>$start_minutes, + 'start_time_ampm'=>$start_ampm, + 'end'=>$end_date, + 'end_time_hour'=>$end_hour, + 'end_time_minutes'=>$end_minutes, + 'end_time_ampm'=>$end_ampm, + 'repeat_status'=>$repeat_status, + 'repeat_type'=>$repeat_type, + 'interval'=>$interval, + 'finish'=>$finish, + 'year'=>$year, + 'month'=>$month, + 'day'=>$day, + 'week'=>$week, + 'weekday'=>$weekday, + 'weekdays'=>$weekdays, + 'days'=>$days, + 'meta'=>array + ( + 'mec_source'=>'the-events-calendar', + 'mec_tec_id'=>$third_party_id, + 'mec_allday'=>$allday, + 'hide_end_time'=>$hide_end_time, + 'mec_repeat_end'=>$end_type, + 'mec_repeat_end_at_occurrences'=>$end_occurrence - 1, + 'mec_repeat_end_at_date'=>$finish, + 'mec_in_days'=>$days, + 'mec_more_info'=>$metas['_EventURL'], + 'mec_cost'=>trim($metas['_EventCurrencySymbol'].$metas['_EventCost']), + 'mec_advanced_days'=>$advanced_days, + ) + ); + + $post_id = $this->db->select("SELECT `post_id` FROM `#__postmeta` WHERE `meta_value`='$third_party_id' AND `meta_key`='mec_tec_id'", 'loadResult'); + + // Insert the event into MEC + $post_id = $this->main->save_event($args, $post_id); + + // Set location to the post + if($location_id) wp_set_object_terms($post_id, (int) $location_id, 'mec_location'); + + // Set organizer to the post + if($organizer_id) wp_set_object_terms($post_id, (int) $organizer_id, 'mec_organizer'); + + // Set categories to the post + if(count($category_ids)) foreach($category_ids as $category_id) wp_set_object_terms($post_id, (int) $category_id, 'mec_category', true); + + // Set Features Image + if(isset($this->ix['import_featured_image']) and $this->ix['import_featured_image'] and $thumbnail_id = get_post_thumbnail_id($ID)) + { + set_post_thumbnail($post_id, $thumbnail_id); + } + + $count++; + } + + return array('success'=>1, 'data'=>$count); + } + + public function thirdparty_weekly_class_import_do($IDs) + { + $count = 0; + foreach($IDs as $ID) + { + $post = get_post($ID); + $metas = $this->main->get_post_meta($ID); + + // Event Title and Content + $title = $post->post_title; + $description = $post->post_content; + $third_party_id = $ID; + + // Event location + $locations = wp_get_post_terms($ID, 'wcs-room'); + $location_id = 1; + + // Import Event Locations into MEC locations + if(isset($this->ix['import_locations']) and $this->ix['import_locations'] and isset($locations[0])) + { + $location_id = $this->main->save_location(array + ( + 'name'=>trim($locations[0]->name), + 'address'=>'', + 'latitude'=>'', + 'longitude'=>'', + )); + } + + // Event Organizer + $organizers = wp_get_post_terms($ID, 'wcs-instructor'); + $organizer_id = 1; + + // Import Event Organizer into MEC organizers + if(isset($this->ix['import_organizers']) and $this->ix['import_organizers'] and isset($organizers[0])) + { + $organizer_id = $this->main->save_organizer(array + ( + 'name'=>trim($organizers[0]->name), + 'tel'=>'', + 'url'=>'', + )); + } + + // Event Categories + $categories = wp_get_post_terms($ID, 'wcs-type'); + $category_ids = []; + + // Import Event Categories into MEC categories + if(isset($this->ix['import_categories']) and $this->ix['import_categories'] and count($categories)) + { + foreach($categories as $category) + { + $category_id = $this->main->save_category(array + ( + 'name'=>trim($category->name), + )); + + if($category_id) $category_ids[] = $category_id; + } + } + + // Event Start Date and Time + $date_start = new DateTime(date('Y-m-d G:i', $metas['_wcs_timestamp'])); + + $start_date = $date_start->format('Y-m-d'); + $start_hour = $date_start->format('g'); + $start_minutes = $date_start->format('i'); + $start_ampm = $date_start->format('A'); + + // Event End Date and Time + $date_end = new DateTime(date('Y-m-d G:i', ($metas['_wcs_timestamp']+($metas['_wcs_duration']*60)))); + + $end_date = $date_end->format('Y-m-d'); + $end_hour = $date_end->format('g'); + $end_minutes = $date_end->format('i'); + $end_ampm = $date_end->format('A'); + + // Event Time Options + $hide_end_time = 0; + $allday = 0; + + // Recurring Event + if(isset($metas['_wcs_interval']) and $metas['_wcs_interval']) + { + $repeat_status = 1; + $interval = NULL; + $year = NULL; + $month = NULL; + $day = NULL; + $week = NULL; + $weekday = NULL; + $weekdays = NULL; + $days = NULL; + $finish = (isset($metas['_wcs_repeat_until']) and trim($metas['_wcs_repeat_until'])) ? date('Y-m-d', strtotime($metas['_wcs_repeat_until'])) : NULL; + + $freq = trim($metas['_wcs_interval']) ? $metas['_wcs_interval'] : 2; + + if($freq == 2) // Daily + { + $repeat_type = 'daily'; + $interval = 1; + } + elseif($freq == 1 or $freq == 3) // Weekly or Every Two Weeks + { + $repeat_type = 'weekly'; + $interval = $freq == 3 ? 14 : 7; + } + elseif($freq == 4) // Monthly + { + $repeat_type = 'monthly'; + + $year = '*'; + $month = '*'; + + $s = $start_date; + $e = $end_date; + + $_days = []; + while(strtotime($s) <= strtotime($e)) + { + $_days[] = date('d', strtotime($s)); + $s = date('Y-m-d', strtotime('+1 Day', strtotime($s))); + } + + $day = ','.implode(',', array_unique($_days)).','; + + $week = '*'; + $weekday = '*'; + } + elseif($freq == 5) // Yearly + { + $repeat_type = 'yearly'; + + $year = '*'; + + $s = $start_date; + $e = $end_date; + + $_months = []; + $_days = []; + while(strtotime($s) <= strtotime($e)) + { + $_months[] = date('m', strtotime($s)); + $_days[] = date('d', strtotime($s)); + + $s = date('Y-m-d', strtotime('+1 Day', strtotime($s))); + } + + $month = ','.implode(',', array_unique($_months)).','; + $day = ','.implode(',', array_unique($_days)).','; + + $week = '*'; + $weekday = '*'; + } + else $repeat_type = ''; + + // Custom Week Days + if($repeat_type == 'daily' and isset($metas['_wcs_repeat_days']) and is_array($metas['_wcs_repeat_days']) and count($metas['_wcs_repeat_days']) > 1 and count($metas['_wcs_repeat_days']) < 7) + { + $week_day_mapping = array('d1'=>1, 'd2'=>2, 'd3'=>3, 'd4'=>4, 'd5'=>5, 'd6'=>6, 'd0'=>7); + + $weekdays = ''; + foreach($metas['_wcs_repeat_days'] as $week_day) $weekdays .= $week_day_mapping['d'.$week_day].','; + + $weekdays = ','.trim($weekdays, ', ').','; + $interval = NULL; + + $repeat_type = 'certain_weekdays'; + } + } + // Single Event + else + { + $repeat_status = 0; + $repeat_type = ''; + $interval = NULL; + $finish = $end_date; + $year = NULL; + $month = NULL; + $day = NULL; + $week = NULL; + $weekday = NULL; + $weekdays = NULL; + $days = NULL; + } + + $args = array + ( + 'title'=>$title, + 'content'=>$description, + 'location_id'=>$location_id, + 'organizer_id'=>$organizer_id, + 'date'=>array + ( + 'start'=>array( + 'date'=>$start_date, + 'hour'=>$start_hour, + 'minutes'=>$start_minutes, + 'ampm'=>$start_ampm, + ), + 'end'=>array( + 'date'=>$end_date, + 'hour'=>$end_hour, + 'minutes'=>$end_minutes, + 'ampm'=>$end_ampm, + ), + 'repeat'=>array( + 'end'=>'date', + 'end_at_date'=>$finish, + 'end_at_occurrences'=>10, + ), + 'allday'=>$allday, + 'comment'=>'', + 'hide_time'=>0, + 'hide_end_time'=>$hide_end_time, + ), + 'start'=>$start_date, + 'start_time_hour'=>$start_hour, + 'start_time_minutes'=>$start_minutes, + 'start_time_ampm'=>$start_ampm, + 'end'=>$end_date, + 'end_time_hour'=>$end_hour, + 'end_time_minutes'=>$end_minutes, + 'end_time_ampm'=>$end_ampm, + 'repeat_status'=>$repeat_status, + 'repeat_type'=>$repeat_type, + 'interval'=>$interval, + 'finish'=>$finish, + 'year'=>$year, + 'month'=>$month, + 'day'=>$day, + 'week'=>$week, + 'weekday'=>$weekday, + 'weekdays'=>$weekdays, + 'days'=>$days, + 'meta'=>array + ( + 'mec_source'=>'weekly_class', + 'mec_weekly_class_id'=>$third_party_id, + 'mec_allday'=>$allday, + 'hide_end_time'=>$hide_end_time, + 'mec_repeat_end'=>($finish ? 'date' : 'never'), + 'mec_repeat_end_at_occurrences'=>9, + 'mec_repeat_end_at_date'=>$finish, + 'mec_in_days'=>$days, + ) + ); + + $post_id = $this->db->select("SELECT `post_id` FROM `#__postmeta` WHERE `meta_value`='$third_party_id' AND `meta_key`='mec_weekly_class_id'", 'loadResult'); + + // Insert the event into MEC + $post_id = $this->main->save_event($args, $post_id); + + // Set location to the post + if($location_id) wp_set_object_terms($post_id, (int) $location_id, 'mec_location'); + + // Set organizer to the post + if($organizer_id) wp_set_object_terms($post_id, (int) $organizer_id, 'mec_organizer'); + + // Set categories to the post + if(count($category_ids)) foreach($category_ids as $category_id) wp_set_object_terms($post_id, (int) $category_id, 'mec_category', true); + + // Set Features Image + if(isset($this->ix['import_featured_image']) and $this->ix['import_featured_image'] and $thumbnail_id = get_post_thumbnail_id($ID)) + { + set_post_thumbnail($post_id, $thumbnail_id); + } + + $count++; + } + + return array('success'=>1, 'data'=>$count); + } + + public function thirdparty_calendarize_it_import_do($IDs) + { + $count = 0; + foreach($IDs as $ID) + { + $post = get_post($ID); + $metas = $this->main->get_post_meta($ID); + + // Event Title and Content + $title = $post->post_title; + $description = $post->post_content; + $third_party_id = $ID; + + // Event location + $locations = wp_get_post_terms($ID, 'venue'); + $location_id = 1; + + // Import Event Locations into MEC locations + if(isset($this->ix['import_locations']) and $this->ix['import_locations'] and isset($locations[0])) + { + $location_id = $this->main->save_location(array + ( + 'name'=>trim($locations[0]->name), + 'address'=>trim(get_term_meta($locations[0]->term_id, 'address', true)), + 'latitude'=>trim(get_term_meta($locations[0]->term_id, 'glat', true)), + 'longitude'=>trim(get_term_meta($locations[0]->term_id, 'glon', true)), + )); + } + + // Event Organizer + $organizers = wp_get_post_terms($ID, 'organizer'); + $organizer_id = 1; + + // Import Event Organizer into MEC organizers + if(isset($this->ix['import_organizers']) and $this->ix['import_organizers'] and isset($organizers[0])) + { + $organizer_id = $this->main->save_organizer(array + ( + 'name'=>trim($organizers[0]->name), + 'tel'=>trim(get_term_meta($organizers[0]->term_id, 'phone', true)), + 'email'=>trim(get_term_meta($organizers[0]->term_id, 'email', true)), + 'url'=>trim(get_term_meta($organizers[0]->term_id, 'website', true)), + )); + } + + // Event Categories + $categories = wp_get_post_terms($ID, 'calendar'); + $category_ids = []; + + // Import Event Categories into MEC categories + if(isset($this->ix['import_categories']) and $this->ix['import_categories'] and count($categories)) + { + foreach($categories as $category) + { + $category_id = $this->main->save_category(array + ( + 'name'=>trim($category->name), + )); + + if($category_id) $category_ids[] = $category_id; + } + } + + // Event Start Date and Time + $date_start = new DateTime(date('Y-m-d G:i', strtotime($metas['fc_start_datetime']))); + + $start_date = $date_start->format('Y-m-d'); + $start_hour = $date_start->format('g'); + $start_minutes = $date_start->format('i'); + $start_ampm = $date_start->format('A'); + + // Event End Date and Time + $date_end = new DateTime(date('Y-m-d G:i', strtotime($metas['fc_end_datetime']))); + + $end_date = $date_end->format('Y-m-d'); + $end_hour = $date_end->format('g'); + $end_minutes = $date_end->format('i'); + $end_ampm = $date_end->format('A'); + + // Event Time Options + $hide_end_time = 0; + $allday = $metas['fc_allday'] ?? 0; + + // Recurring Event + if(isset($metas['fc_rrule']) and trim($metas['fc_rrule'])) + { + $rules = explode(';', trim($metas['fc_rrule'], '; ')); + + $rule = []; + foreach($rules as $rule_row) + { + $ex = explode('=', $rule_row); + $key = strtolower($ex[0]); + $value = $key == 'until' ? $ex[1] : strtolower($ex[1]); + + $rule[$key] = $value; + } + + $repeat_status = 1; + $interval = NULL; + $year = NULL; + $month = NULL; + $day = NULL; + $week = NULL; + $weekday = NULL; + $weekdays = NULL; + $days = NULL; + $finish = isset($rule['until']) ? date('Y-m-d', strtotime($rule['until'])) : NULL; + + if($rule['freq'] == 'daily') + { + $repeat_type = 'daily'; + $interval = $rule['interval'] ?? 1; + + if(isset($rule['count'])) $finish = date('Y-m-d', strtotime('+'.$rule['count'].' days', strtotime($start_date))); + } + elseif($rule['freq'] == 'weekly') + { + $repeat_type = 'weekly'; + $interval = isset($rule['interval']) ? $rule['interval']*7 : 7; + + if(isset($rule['count'])) $finish = date('Y-m-d', strtotime('+'.$rule['count'].' weeks', strtotime($start_date))); + } + elseif($rule['freq'] == 'monthly') + { + $repeat_type = 'monthly'; + + $year = '*'; + $month = '*'; + + $s = $start_date; + $e = $end_date; + + $_days = []; + while(strtotime($s) <= strtotime($e)) + { + $_days[] = date('d', strtotime($s)); + $s = date('Y-m-d', strtotime('+1 Day', strtotime($s))); + } + + $day = ','.implode(',', array_unique($_days)).','; + + $week = '*'; + $weekday = '*'; + + if(isset($rule['count'])) $finish = date('Y-m-d', strtotime('+'.$rule['count'].' months', strtotime($start_date))); + } + elseif($rule['freq'] == 'yearly') + { + $repeat_type = 'yearly'; + + $year = '*'; + + $s = $start_date; + $e = $end_date; + + $_months = []; + $_days = []; + while(strtotime($s) <= strtotime($e)) + { + $_months[] = date('m', strtotime($s)); + $_days[] = date('d', strtotime($s)); + + $s = date('Y-m-d', strtotime('+1 Day', strtotime($s))); + } + + $month = ','.implode(',', array_unique($_months)).','; + $day = ','.implode(',', array_unique($_days)).','; + + $week = '*'; + $weekday = '*'; + + if(isset($rule['count'])) $finish = date('Y-m-d', strtotime('+'.$rule['count'].' years', strtotime($start_date))); + } + } + // Custom Days + elseif(isset($metas['fc_rdate']) and trim($metas['fc_rdate'])) + { + $fc_rdates = explode(',', $metas['fc_rdate']); + $str_days = ''; + foreach($fc_rdates as $fc_rdate) $str_days .= date('Y-m-d', strtotime($fc_rdate)).','; + + $repeat_status = 1; + $repeat_type = 'custom_days'; + $interval = NULL; + $finish = $end_date; + $year = NULL; + $month = NULL; + $day = NULL; + $week = NULL; + $weekday = NULL; + $weekdays = NULL; + $days = trim($str_days, ', '); + } + // Single Event + else + { + $repeat_status = 0; + $repeat_type = ''; + $interval = NULL; + $finish = $end_date; + $year = NULL; + $month = NULL; + $day = NULL; + $week = NULL; + $weekday = NULL; + $weekdays = NULL; + $days = NULL; + } + + $args = array + ( + 'title'=>$title, + 'content'=>$description, + 'location_id'=>$location_id, + 'organizer_id'=>$organizer_id, + 'date'=>array + ( + 'start'=>array( + 'date'=>$start_date, + 'hour'=>$start_hour, + 'minutes'=>$start_minutes, + 'ampm'=>$start_ampm, + ), + 'end'=>array( + 'date'=>$end_date, + 'hour'=>$end_hour, + 'minutes'=>$end_minutes, + 'ampm'=>$end_ampm, + ), + 'repeat'=>array( + 'end'=>'date', + 'end_at_date'=>$finish, + 'end_at_occurrences'=>10, + ), + 'allday'=>$allday, + 'comment'=>'', + 'hide_time'=>0, + 'hide_end_time'=>$hide_end_time, + ), + 'start'=>$start_date, + 'start_time_hour'=>$start_hour, + 'start_time_minutes'=>$start_minutes, + 'start_time_ampm'=>$start_ampm, + 'end'=>$end_date, + 'end_time_hour'=>$end_hour, + 'end_time_minutes'=>$end_minutes, + 'end_time_ampm'=>$end_ampm, + 'repeat_status'=>$repeat_status, + 'repeat_type'=>$repeat_type, + 'interval'=>$interval, + 'finish'=>$finish, + 'year'=>$year, + 'month'=>$month, + 'day'=>$day, + 'week'=>$week, + 'weekday'=>$weekday, + 'weekdays'=>$weekdays, + 'days'=>$days, + 'meta'=>array + ( + 'mec_source'=>'calendarize_it', + 'mec_calendarize_it_id'=>$third_party_id, + 'mec_allday'=>$allday, + 'hide_end_time'=>$hide_end_time, + 'mec_repeat_end'=>($finish ? 'date' : 'never'), + 'mec_repeat_end_at_occurrences'=>9, + 'mec_repeat_end_at_date'=>$finish, + 'mec_in_days'=>$days, + ) + ); + + $post_id = $this->db->select("SELECT `post_id` FROM `#__postmeta` WHERE `meta_value`='$third_party_id' AND `meta_key`='mec_calendarize_it_id'", 'loadResult'); + + // Insert the event into MEC + $post_id = $this->main->save_event($args, $post_id); + + // Set location to the post + if($location_id) wp_set_object_terms($post_id, (int) $location_id, 'mec_location'); + + // Set organizer to the post + if($organizer_id) wp_set_object_terms($post_id, (int) $organizer_id, 'mec_organizer'); + + // Set categories to the post + if(count($category_ids)) foreach($category_ids as $category_id) wp_set_object_terms($post_id, (int) $category_id, 'mec_category', true); + + // Set Features Image + if(isset($this->ix['import_featured_image']) and $this->ix['import_featured_image'] and $thumbnail_id = get_post_thumbnail_id($ID)) + { + set_post_thumbnail($post_id, $thumbnail_id); + } + + $count++; + } + + return array('success'=>1, 'data'=>$count); + } + + public function thirdparty_es_import_do($IDs) + { + // Timezone + $timezone = $this->main->get_timezone(); + + $count = 0; + foreach($IDs as $ID) + { + $post = get_post($ID); + + // Event Title and Content + $title = $post->post_title; + $description = $post->post_content; + $third_party_id = $ID; + + // Event location + $venue_id = $this->db->select("SELECT `VNU_ID` FROM `#__esp_event_venue` WHERE `EVT_ID`='".$ID."' ORDER BY `EVV_ID` ASC LIMIT 1", 'loadResult'); + $location_id = 1; + + // Import Event Locations into MEC locations + if(isset($this->ix['import_locations']) and $this->ix['import_locations'] and $venue_id) + { + $v_meta = $this->db->select("SELECT * FROM `#__esp_venue_meta` WHERE `VNU_ID`='".$venue_id."'", 'loadAssoc'); + $location_id = $this->main->save_location(array + ( + 'name'=>get_the_title($venue_id), + 'address'=>trim($v_meta['VNU_address'].' '.$v_meta['VNU_address2']), + 'latitude'=>'', + 'longitude'=>'', + )); + } + + // Event Categories + $categories = wp_get_post_terms($ID, 'espresso_event_categories'); + $category_ids = []; + + // Import Event Categories into MEC categories + if(isset($this->ix['import_categories']) and $this->ix['import_categories'] and count($categories)) + { + foreach($categories as $category) + { + $category_id = $this->main->save_category(array + ( + 'name'=>trim($category->name), + )); + + if($category_id) $category_ids[] = $category_id; + } + } + + $datetimes = $venue_id = $this->db->select("SELECT * FROM `#__esp_datetime` WHERE `EVT_ID`='".$ID."' ORDER BY `DTT_EVT_start` ASC", 'loadAssocList'); + + $dt_start = NULL; + $dt_end = NULL; + $custom_days = []; + + $i = 1; + foreach($datetimes as $datetime) + { + if(!$dt_start) $dt_start = $datetime['DTT_EVT_start']; + if(!$dt_end) $dt_end = $datetime['DTT_EVT_end']; + + // Add to Custom Days + if($i > 1) $custom_days[] = array(date('Y-m-d', strtotime($datetime['DTT_EVT_start'])), date('Y-m-d', strtotime($datetime['DTT_EVT_end']))); + + $i++; + } + + // Event Start Date and Time + $date_start = new DateTime(date('Y-m-d G:i', strtotime($dt_start)), new DateTimeZone('UTC')); + $date_start->setTimezone(new DateTimeZone($timezone)); + + $start_date = $date_start->format('Y-m-d'); + $start_hour = $date_start->format('g'); + $start_minutes = $date_start->format('i'); + $start_ampm = $date_start->format('A'); + + // Event End Date and Time + $date_end = new DateTime(date('Y-m-d G:i', strtotime($dt_end)), new DateTimeZone('UTC')); + $date_end->setTimezone(new DateTimeZone($timezone)); + + $end_date = $date_end->format('Y-m-d'); + $end_hour = $date_end->format('g'); + $end_minutes = $date_end->format('i'); + $end_ampm = $date_end->format('A'); + + // Event Time Options + $hide_end_time = 0; + $allday = 0; + + // Custom Days + if(count($custom_days)) + { + $str_days = ''; + foreach($custom_days as $custom_day) $str_days .= date('Y-m-d', strtotime($custom_day[0])).':'.date('Y-m-d', strtotime($custom_day[1])).','; + + $repeat_status = 1; + $repeat_type = 'custom_days'; + $interval = NULL; + $finish = $end_date; + $year = NULL; + $month = NULL; + $day = NULL; + $week = NULL; + $weekday = NULL; + $weekdays = NULL; + $days = trim($str_days, ', '); + } + // Single Event + else + { + $repeat_status = 0; + $repeat_type = ''; + $interval = NULL; + $finish = $end_date; + $year = NULL; + $month = NULL; + $day = NULL; + $week = NULL; + $weekday = NULL; + $weekdays = NULL; + $days = NULL; + } + + $args = array + ( + 'title'=>$title, + 'content'=>$description, + 'location_id'=>$location_id, + 'organizer_id'=>1, + 'date'=>array + ( + 'start'=>array( + 'date'=>$start_date, + 'hour'=>$start_hour, + 'minutes'=>$start_minutes, + 'ampm'=>$start_ampm, + ), + 'end'=>array( + 'date'=>$end_date, + 'hour'=>$end_hour, + 'minutes'=>$end_minutes, + 'ampm'=>$end_ampm, + ), + 'repeat'=>array( + 'end'=>'date', + 'end_at_date'=>$finish, + 'end_at_occurrences'=>10, + ), + 'allday'=>$allday, + 'comment'=>'', + 'hide_time'=>0, + 'hide_end_time'=>$hide_end_time, + ), + 'start'=>$start_date, + 'start_time_hour'=>$start_hour, + 'start_time_minutes'=>$start_minutes, + 'start_time_ampm'=>$start_ampm, + 'end'=>$end_date, + 'end_time_hour'=>$end_hour, + 'end_time_minutes'=>$end_minutes, + 'end_time_ampm'=>$end_ampm, + 'repeat_status'=>$repeat_status, + 'repeat_type'=>$repeat_type, + 'interval'=>$interval, + 'finish'=>$finish, + 'year'=>$year, + 'month'=>$month, + 'day'=>$day, + 'week'=>$week, + 'weekday'=>$weekday, + 'weekdays'=>$weekdays, + 'days'=>$days, + 'meta'=>array + ( + 'mec_source'=>'eventespresso', + 'mec_eventespresso_id'=>$third_party_id, + 'mec_allday'=>$allday, + 'hide_end_time'=>$hide_end_time, + 'mec_repeat_end'=>($finish ? 'date' : 'never'), + 'mec_repeat_end_at_occurrences'=>9, + 'mec_repeat_end_at_date'=>$finish, + 'mec_in_days'=>$days, + ) + ); + + $post_id = $this->db->select("SELECT `post_id` FROM `#__postmeta` WHERE `meta_value`='$third_party_id' AND `meta_key`='mec_eventespresso_id'", 'loadResult'); + + // Insert the event into MEC + $post_id = $this->main->save_event($args, $post_id); + + // Set location to the post + if($location_id) wp_set_object_terms($post_id, (int) $location_id, 'mec_location'); + + // Set categories to the post + if(count($category_ids)) foreach($category_ids as $category_id) wp_set_object_terms($post_id, (int) $category_id, 'mec_category', true); + + // Set Features Image + if(isset($this->ix['import_featured_image']) and $this->ix['import_featured_image'] and $thumbnail_id = get_post_thumbnail_id($ID)) + { + set_post_thumbnail($post_id, $thumbnail_id); + } + + $count++; + } + + return array('success'=>1, 'data'=>$count); + } + + public function thirdparty_emr_import_do($IDs) + { + $count = 0; + foreach($IDs as $ID) + { + $post = get_post($ID); + $metas = $this->main->get_post_meta($ID); + + // Event Title and Content + $title = $post->post_title; + $description = $post->post_content; + $third_party_id = $ID; + + // Event location + $location = $this->db->select("SELECT * FROM `#__em_locations` WHERE `location_id`='".(isset($metas['_location_id']) ? $metas['_location_id'] : 0)."'", 'loadAssoc'); + $location_id = 1; + + // Import Event Locations into MEC locations + if(isset($this->ix['import_locations']) and $this->ix['import_locations'] and isset($location['post_id'])) + { + $address = $location['location_address'].' '.$location['location_region'].' '.$location['location_town'].' '.$location['location_state'].' '.$location['location_country']; + $location_id = $this->main->save_location(array + ( + 'name'=>trim($location['location_name']), + 'address'=>trim($address), + 'latitude'=>trim($location['location_latitude']), + 'longitude'=>trim($location['location_longitude']), + )); + } + + // Event Categories + $categories = wp_get_post_terms($ID, 'event-categories'); + $category_ids = []; + + // Import Event Categories into MEC categories + if(isset($this->ix['import_categories']) and $this->ix['import_categories'] and count($categories)) + { + foreach($categories as $category) + { + $category_id = $this->main->save_category(array + ( + 'name'=>trim($category->name), + )); + + if($category_id) $category_ids[] = $category_id; + } + } + + // Event Start Date and Time + $date_start = new DateTime(date('Y-m-d G:i', strtotime($metas['_event_start_local']))); + + $start_date = $date_start->format('Y-m-d'); + $start_hour = $date_start->format('g'); + $start_minutes = $date_start->format('i'); + $start_ampm = $date_start->format('A'); + + // Event End Date and Time + $date_end = new DateTime(date('Y-m-d', strtotime('+'.(isset($metas['_recurrence_days']) ? $metas['_recurrence_days'] : 0).' days', strtotime($metas['_event_start_local']))).' '.$metas['_event_end_time']); + + $end_date = $date_end->format('Y-m-d'); + $end_hour = $date_end->format('g'); + $end_minutes = $date_end->format('i'); + $end_ampm = $date_end->format('A'); + + // Event Time Options + $hide_end_time = 0; + $allday = $metas['_event_all_day'] ?? 0; + + $repeat_status = 1; + $interval = NULL; + $year = NULL; + $month = NULL; + $day = NULL; + $week = NULL; + $weekday = NULL; + $weekdays = NULL; + $days = NULL; + $finish = date('Y-m-d', strtotime($metas['_event_end_local'])); + $repeat_type = ''; + $advanced_days = NULL; + + if($metas['_recurrence_freq'] == 'daily') + { + $repeat_type = 'daily'; + $interval = $metas['_recurrence_interval'] ?? 1; + } + elseif($metas['_recurrence_freq'] == 'weekly') + { + $repeat_type = 'certain_weekdays'; + $interval = 1; + $weekdays = ',' . str_replace('0', '7', $metas['_recurrence_byday']) . ','; + } + elseif($metas['_recurrence_freq'] == 'monthly') + { + $repeat_type = 'advanced'; + + $week_no = $metas['_recurrence_byweekno']; + if($week_no == '-1' || $week_no == '5') $week_no = 'l'; + + $week_day = $metas['_recurrence_byday']; + + if($week_day == '0') $week_day = 'Sun'; + elseif($week_day == '1') $week_day = 'Mon'; + elseif($week_day == '2') $week_day = 'Tue'; + elseif($week_day == '3') $week_day = 'Wed'; + elseif($week_day == '4') $week_day = 'Thu'; + elseif($week_day == '5') $week_day = 'Fri'; + else $week_day = 'Sat'; + + $advanced_days = array($week_day.'.'.$week_no); + } + elseif($metas['_recurrence_freq'] == 'yearly') + { + $repeat_type = 'yearly'; + + $year = '*'; + + $s = $start_date; + $e = $end_date; + + $_months = []; + $_days = []; + while(strtotime($s) <= strtotime($e)) + { + $_months[] = date('m', strtotime($s)); + $_days[] = date('d', strtotime($s)); + + $s = date('Y-m-d', strtotime('+1 Day', strtotime($s))); + } + + $month = ','.implode(',', array_unique($_months)).','; + $day = ','.implode(',', array_unique($_days)).','; + + $week = '*'; + $weekday = '*'; + } + + $args = array + ( + 'title'=>$title, + 'content'=>$description, + 'location_id'=>$location_id, + 'organizer_id'=>1, + 'date'=>array + ( + 'start'=>array( + 'date'=>$start_date, + 'hour'=>$start_hour, + 'minutes'=>$start_minutes, + 'ampm'=>$start_ampm, + ), + 'end'=>array( + 'date'=>$end_date, + 'hour'=>$end_hour, + 'minutes'=>$end_minutes, + 'ampm'=>$end_ampm, + ), + 'repeat'=>array( + 'end'=>'date', + 'end_at_date'=>$finish, + 'end_at_occurrences'=>10, + ), + 'allday'=>$allday, + 'comment'=>'', + 'hide_time'=>0, + 'hide_end_time'=>$hide_end_time, + ), + 'start'=>$start_date, + 'start_time_hour'=>$start_hour, + 'start_time_minutes'=>$start_minutes, + 'start_time_ampm'=>$start_ampm, + 'end'=>$end_date, + 'end_time_hour'=>$end_hour, + 'end_time_minutes'=>$end_minutes, + 'end_time_ampm'=>$end_ampm, + 'repeat_status'=>$repeat_status, + 'repeat_type'=>$repeat_type, + 'interval'=>$interval, + 'finish'=>$finish, + 'year'=>$year, + 'month'=>$month, + 'day'=>$day, + 'week'=>$week, + 'weekday'=>$weekday, + 'weekdays'=>$weekdays, + 'days'=>$days, + 'meta'=>array + ( + 'mec_source'=>'event_manager_recurring', + 'mec_emr_id'=>$third_party_id, + 'mec_allday'=>$allday, + 'hide_end_time'=>$hide_end_time, + 'mec_repeat_end'=>($finish ? 'date' : 'never'), + 'mec_repeat_end_at_occurrences'=>9, + 'mec_repeat_end_at_date'=>$finish, + 'mec_in_days'=>$days, + 'mec_advanced_days'=>$advanced_days, + ) + ); + + $post_id = $this->db->select("SELECT `post_id` FROM `#__postmeta` WHERE `meta_value`='$third_party_id' AND `meta_key`='mec_emr_id'", 'loadResult'); + + // Insert the event into MEC + $post_id = $this->main->save_event($args, $post_id); + + // Set location to the post + if($location_id) wp_set_object_terms($post_id, (int) $location_id, 'mec_location'); + + // Set categories to the post + if(count($category_ids)) foreach($category_ids as $category_id) wp_set_object_terms($post_id, (int) $category_id, 'mec_category', true); + + // Set Features Image + if(isset($this->ix['import_featured_image']) and $this->ix['import_featured_image'] and $thumbnail_id = get_post_thumbnail_id($ID)) + { + set_post_thumbnail($post_id, $thumbnail_id); + } + + $count++; + } + + return array('success'=>1, 'data'=>$count); + } + + public function thirdparty_ems_import_do($IDs) + { + $count = 0; + foreach($IDs as $ID) + { + $post = get_post($ID); + $metas = $this->main->get_post_meta($ID); + + // Event Title and Content + $title = $post->post_title; + $description = $post->post_content; + $third_party_id = $ID; + + // Event location + $location = $this->db->select("SELECT * FROM `#__em_locations` WHERE `location_id`='".(isset($metas['_location_id']) ? $metas['_location_id'] : 0)."'", 'loadAssoc'); + $location_id = 1; + + // Import Event Locations into MEC locations + if(isset($this->ix['import_locations']) and $this->ix['import_locations'] and isset($location['post_id'])) + { + $address = $location['location_address'].' '.$location['location_region'].' '.$location['location_town'].' '.$location['location_state'].' '.$location['location_country']; + $location_id = $this->main->save_location(array + ( + 'name'=>trim($location['location_name']), + 'address'=>trim($address), + 'latitude'=>trim($location['location_latitude']), + 'longitude'=>trim($location['location_longitude']), + )); + } + + // Event Categories + $categories = wp_get_post_terms($ID, 'event-categories'); + $category_ids = []; + + // Import Event Categories into MEC categories + if(isset($this->ix['import_categories']) and $this->ix['import_categories'] and count($categories)) + { + foreach($categories as $category) + { + $category_id = $this->main->save_category(array + ( + 'name'=>trim($category->name), + )); + + if($category_id) $category_ids[] = $category_id; + } + } + + // Event Start Date and Time + $date_start = new DateTime(date('Y-m-d G:i', strtotime($metas['_event_start_local']))); + + $start_date = $date_start->format('Y-m-d'); + $start_hour = $date_start->format('g'); + $start_minutes = $date_start->format('i'); + $start_ampm = $date_start->format('A'); + + // Event End Date and Time + $date_end = new DateTime(date('Y-m-d G:i', strtotime($metas['_event_end_local']))); + + $end_date = $date_end->format('Y-m-d'); + $end_hour = $date_end->format('g'); + $end_minutes = $date_end->format('i'); + $end_ampm = $date_end->format('A'); + + // Event Time Options + $hide_end_time = 0; + $allday = $metas['_event_all_day'] ?? 0; + + // Single Event + $repeat_status = 0; + $repeat_type = ''; + $interval = NULL; + $finish = $end_date; + $year = NULL; + $month = NULL; + $day = NULL; + $week = NULL; + $weekday = NULL; + $weekdays = NULL; + $days = NULL; + + $args = array + ( + 'title'=>$title, + 'content'=>$description, + 'location_id'=>$location_id, + 'organizer_id'=>1, + 'date'=>array + ( + 'start'=>array( + 'date'=>$start_date, + 'hour'=>$start_hour, + 'minutes'=>$start_minutes, + 'ampm'=>$start_ampm, + ), + 'end'=>array( + 'date'=>$end_date, + 'hour'=>$end_hour, + 'minutes'=>$end_minutes, + 'ampm'=>$end_ampm, + ), + 'repeat'=>array( + 'end'=>'date', + 'end_at_date'=>$finish, + 'end_at_occurrences'=>10, + ), + 'allday'=>$allday, + 'comment'=>'', + 'hide_time'=>0, + 'hide_end_time'=>$hide_end_time, + ), + 'start'=>$start_date, + 'start_time_hour'=>$start_hour, + 'start_time_minutes'=>$start_minutes, + 'start_time_ampm'=>$start_ampm, + 'end'=>$end_date, + 'end_time_hour'=>$end_hour, + 'end_time_minutes'=>$end_minutes, + 'end_time_ampm'=>$end_ampm, + 'repeat_status'=>$repeat_status, + 'repeat_type'=>$repeat_type, + 'interval'=>$interval, + 'finish'=>$finish, + 'year'=>$year, + 'month'=>$month, + 'day'=>$day, + 'week'=>$week, + 'weekday'=>$weekday, + 'weekdays'=>$weekdays, + 'days'=>$days, + 'meta'=>array + ( + 'mec_source'=>'event_manager_single', + 'mec_ems_id'=>$third_party_id, + 'mec_allday'=>$allday, + 'hide_end_time'=>$hide_end_time, + 'mec_repeat_end'=>($finish ? 'date' : 'never'), + 'mec_repeat_end_at_occurrences'=>9, + 'mec_repeat_end_at_date'=>$finish, + 'mec_in_days'=>$days, + ) + ); + + $post_id = $this->db->select("SELECT `post_id` FROM `#__postmeta` WHERE `meta_value`='$third_party_id' AND `meta_key`='mec_ems_id'", 'loadResult'); + + // Insert the event into MEC + $post_id = $this->main->save_event($args, $post_id); + + // Set location to the post + if($location_id) wp_set_object_terms($post_id, (int) $location_id, 'mec_location'); + + // Set categories to the post + if(count($category_ids)) foreach($category_ids as $category_id) wp_set_object_terms($post_id, (int) $category_id, 'mec_category', true); + + // Set Features Image + if(isset($this->ix['import_featured_image']) and $this->ix['import_featured_image'] and $thumbnail_id = get_post_thumbnail_id($ID)) + { + set_post_thumbnail($post_id, $thumbnail_id); + } + + $count++; + } + + return array('success'=>1, 'data'=>$count); + } + + public function thirdparty_wpem_import_do($IDs) + { + $count = 0; + foreach($IDs as $ID) + { + $post = get_post($ID); + $metas = $this->main->get_post_meta($ID); + + // Event Title and Content + $title = $post->post_title; + $description = $post->post_content; + $third_party_id = $ID; + + // Event location + $location = get_post($metas['_event_venue_ids']); + $location_id = 1; + + // Import Event Locations into MEC locations + if(isset($this->ix['import_locations']) and $this->ix['import_locations'] and isset($location->ID)) + { + $l_metas = $this->main->get_post_meta($location->ID); + $thumbnail = has_post_thumbnail($location->ID) ? $this->main->get_post_thumbnail_url($location->ID, 'full') : ''; + + $location_id = $this->main->save_location(array + ( + 'name'=>trim($location->post_title), + 'address'=>(isset($l_metas['_venue_description']) ? $l_metas['_venue_description'] : ''), + 'latitude'=>0, + 'longitude'=>0, + 'thumbnail'=>$thumbnail + )); + } + + // Event Organizer + $organizers = $metas['_event_organizer_ids']; + $organizer = (isset($organizers[0]) ? get_post($organizers[0]) : new stdClass()); + + if(isset($organizers[0])) unset($organizers[0]); + $wpem_additional_organizers_ids = $organizers; + + $organizer_id = 1; + $additional_organizers_ids = []; + + // Import Event Organizer into MEC organizers + if(isset($this->ix['import_organizers']) and $this->ix['import_organizers'] and isset($organizer->ID)) + { + $o_metas = $this->main->get_post_meta($organizer->ID); + + $organizer_id = $this->main->save_organizer(array + ( + 'name'=>trim($organizer->post_title), + 'tel'=>'', + 'email'=>($o_metas['_organizer_email'] ?? ''), + 'url'=>($o_metas['_organizer_website'] ?? ''), + )); + + if(is_array($wpem_additional_organizers_ids) and count($wpem_additional_organizers_ids)) + { + foreach($wpem_additional_organizers_ids as $wpem_additional_organizers_id) + { + $o_organizer = get_post($wpem_additional_organizers_id); + $o_metas = $this->main->get_post_meta($wpem_additional_organizers_id); + + $additional_organizers_ids[] = $this->main->save_organizer(array + ( + 'name'=>trim($o_organizer->post_title), + 'tel'=>'', + 'email'=>($o_metas['_organizer_email'] ?? ''), + 'url'=>($o_metas['_organizer_website'] ?? ''), + )); + } + } + } + + // Event Categories + $categories = wp_get_post_terms($ID, 'event_listing_category'); + $category_ids = []; + + // Import Event Categories into MEC categories + if(isset($this->ix['import_categories']) and $this->ix['import_categories'] and count($categories)) + { + foreach($categories as $category) + { + $category_id = $this->main->save_category(array + ( + 'name'=>trim($category->name), + )); + + if($category_id) $category_ids[] = $category_id; + } + } + + // Event Start Date and Time + $date_start = new DateTime(date('Y-m-d G:i', strtotime($metas['_event_start_date']))); + + $start_date = $date_start->format('Y-m-d'); + $start_hour = $date_start->format('g'); + $start_minutes = $date_start->format('i'); + $start_ampm = $date_start->format('A'); + + // Event End Date and Time + $date_end = new DateTime(date('Y-m-d G:i', strtotime($metas['_event_end_date']))); + + $end_date = $date_end->format('Y-m-d'); + $end_hour = $date_end->format('g'); + $end_minutes = $date_end->format('i'); + $end_ampm = $date_end->format('A'); + + // Event Time Options + $hide_end_time = 0; + $allday = 0; + + // Single Event + $repeat_status = 0; + $repeat_type = ''; + $interval = NULL; + $finish = $end_date; + $year = NULL; + $month = NULL; + $day = NULL; + $week = NULL; + $weekday = NULL; + $weekdays = NULL; + $days = NULL; + + $args = array + ( + 'title'=>$title, + 'content'=>$description, + 'location_id'=>$location_id, + 'organizer_id'=>$organizer_id, + 'date'=>array + ( + 'start'=>array( + 'date'=>$start_date, + 'hour'=>$start_hour, + 'minutes'=>$start_minutes, + 'ampm'=>$start_ampm, + ), + 'end'=>array( + 'date'=>$end_date, + 'hour'=>$end_hour, + 'minutes'=>$end_minutes, + 'ampm'=>$end_ampm, + ), + 'repeat'=>array( + 'end'=>'date', + 'end_at_date'=>$finish, + 'end_at_occurrences'=>10, + ), + 'allday'=>$allday, + 'comment'=>'', + 'hide_time'=>0, + 'hide_end_time'=>$hide_end_time, + ), + 'start'=>$start_date, + 'start_time_hour'=>$start_hour, + 'start_time_minutes'=>$start_minutes, + 'start_time_ampm'=>$start_ampm, + 'end'=>$end_date, + 'end_time_hour'=>$end_hour, + 'end_time_minutes'=>$end_minutes, + 'end_time_ampm'=>$end_ampm, + 'repeat_status'=>$repeat_status, + 'repeat_type'=>$repeat_type, + 'interval'=>$interval, + 'finish'=>$finish, + 'year'=>$year, + 'month'=>$month, + 'day'=>$day, + 'week'=>$week, + 'weekday'=>$weekday, + 'weekdays'=>$weekdays, + 'days'=>$days, + 'meta'=>array + ( + 'mec_source'=>'the-events-calendar', + 'mec_tec_id'=>$third_party_id, + 'mec_allday'=>$allday, + 'hide_end_time'=>$hide_end_time, + 'mec_repeat_end'=>'date', + 'mec_repeat_end_at_occurrences'=>9, + 'mec_repeat_end_at_date'=>$finish, + 'mec_in_days'=>$days, + 'mec_more_info'=>'', + 'mec_cost'=>'', + ) + ); + + $post_id = $this->db->select("SELECT `post_id` FROM `#__postmeta` WHERE `meta_value`='$third_party_id' AND `meta_key`='mec_tec_id'", 'loadResult'); + + // Insert the event into MEC + $post_id = $this->main->save_event($args, $post_id); + + // Set location to the post + if($location_id) wp_set_object_terms($post_id, (int) $location_id, 'mec_location'); + + // Set organizer to the post + if($organizer_id) wp_set_object_terms($post_id, (int) $organizer_id, 'mec_organizer'); + + // Set additional organizers + if(is_array($additional_organizers_ids) and count($additional_organizers_ids)) + { + foreach($additional_organizers_ids as $additional_organizers_id) wp_set_object_terms($post_id, (int) $additional_organizers_id, 'mec_organizer', true); + update_post_meta($post_id, 'mec_additional_organizer_ids', $additional_organizers_ids); + } + + // Set categories to the post + if(count($category_ids)) foreach($category_ids as $category_id) wp_set_object_terms($post_id, (int) $category_id, 'mec_category', true); + + // Set Features Image + if(isset($this->ix['import_featured_image']) and $this->ix['import_featured_image'] and $thumbnail_id = get_post_thumbnail_id($ID)) + { + set_post_thumbnail($post_id, $thumbnail_id); + } + + $count++; + } + + return array('success'=>1, 'data'=>$count); + } + + /** + * Show content of export tab + * @author Webnus + * @return void + */ + public function ix_g_calendar_export() + { + // Current Action + $this->action = isset($_POST['mec-ix-action']) ? sanitize_text_field($_POST['mec-ix-action']) : (isset($_GET['mec-ix-action']) ? sanitize_text_field($_GET['mec-ix-action']) : ''); + + $path = MEC::import('app.features.ix.export_g_calendar', true, true); + + ob_start(); + include $path; + echo MEC_kses::full(ob_get_clean()); + } + + /** + * Show content of import tab + * @author Webnus + * @return void + */ + public function ix_g_calendar_import() + { + // Current Action + $this->action = isset($_POST['mec-ix-action']) ? sanitize_text_field($_POST['mec-ix-action']) : ''; + $this->ix = ((isset($_POST['ix']) and is_array($_POST['ix'])) ? array_map('sanitize_text_field', $_POST['ix']) : array()); + + $this->response = []; + if($this->action == 'google-calendar-import-start') $this->response = $this->g_calendar_import_start(); + elseif($this->action == 'google-calendar-import-do') $this->response = $this->g_calendar_import_do(); + + $path = MEC::import('app.features.ix.import_g_calendar', true, true); + + ob_start(); + include $path; + echo MEC_kses::full(ob_get_clean()); + } + + public function g_calendar_import_start() + { + $api_key = $this->ix['google_import_api_key'] ?? NULL; + $calendar_id = $this->ix['google_import_calendar_id'] ?? NULL; + $start_date = $this->ix['google_import_start_date'] ?? 'Today'; + $end_date = (isset($this->ix['google_import_end_date']) and trim($this->ix['google_import_end_date'])) ? $this->ix['google_import_end_date'] : 'Tomorrow'; + + if(!trim($api_key) or !trim($calendar_id)) return array('success'=>0, 'error'=>__('API key and Calendar ID are required!', 'modern-events-calendar-lite')); + + // Save options + $this->main->save_ix_options(array('google_import_api_key'=>$api_key, 'google_import_calendar_id'=>$calendar_id, 'google_import_start_date'=>$start_date, 'google_import_end_date'=>$end_date)); + + // GMT Offset + $gmt_offset = $this->main->get_gmt_offset(); + + $client = new Google_Client(); + $client->setApplicationName('Modern Events Calendar'); + $client->setAccessType('online'); + $client->setScopes(array('https://www.googleapis.com/auth/calendar.readonly')); + $client->setDeveloperKey($api_key); + + $service = new Google_Service_Calendar($client); + $data = []; + + try + { + $args = []; + $args['timeMin'] = date('Y-m-d\TH:i:s', strtotime($start_date)).$gmt_offset; + $args['timeMax'] = date('Y-m-d\TH:i:s', strtotime($end_date)).$gmt_offset; + $args['maxResults'] = 50000; + + $response = $service->events->listEvents($calendar_id, $args); + + $data['id'] = $calendar_id; + $data['title'] = $response->getSummary(); + $data['timezone'] = $response->getTimeZone(); + $data['events'] = []; + + foreach($response->getItems() as $event) + { + $title = $event->getSummary(); + if(trim($title) == '') continue; + + $recurring_event_id = $event->getRecurringEventId(); + + // Update Date & Time + if(isset($data['events'][$recurring_event_id])) + { + $data['events'][$recurring_event_id]['start'] = $event->getStart(); + $data['events'][$recurring_event_id]['end'] = $event->getEnd(); + } + // Import Only Main Events + elseif(!$recurring_event_id) $data['events'][$event->id] = array('id'=>$event->id, 'title'=>$title, 'start'=>$event->getStart(), 'end'=>$event->getEnd()); + } + + $data['count'] = count($data['events']); + } + catch(Exception $e) + { + $error = $e->getMessage(); + return array('success'=>0, 'error'=>$error); + } + + return array('success'=>1, 'data'=>$data); + } + + public function g_calendar_import_do() + { + $g_events = ((isset($_POST['g-events']) and is_array($_POST['g-events'])) ? array_map('sanitize_text_field', $_POST['g-events']) : array()); + if(!count($g_events)) return array('success'=>0, 'error'=>__('Please select events to import!', 'modern-events-calendar-lite')); + + $api_key = $this->ix['google_import_api_key'] ?? NULL; + $calendar_id = $this->ix['google_import_calendar_id'] ?? NULL; + + if(!trim($api_key) or !trim($calendar_id)) return array('success'=>0, 'error'=>__('API key and Calendar ID are required!', 'modern-events-calendar-lite')); + + // Timezone + $timezone = $this->main->get_timezone(); + + $client = new Google_Client(); + $client->setApplicationName('Modern Events Calendar'); + $client->setAccessType('online'); + $client->setScopes(array('https://www.googleapis.com/auth/calendar.readonly')); + $client->setDeveloperKey($api_key); + + $service = new Google_Service_Calendar($client); + $post_ids = []; + + foreach($g_events as $g_event) + { + try + { + $event = $service->events->get($calendar_id, $g_event, array('timeZone' => $timezone)); + } + catch(Exception $e) + { + continue; + } + + // Event Title and Content + $title = $event->getSummary(); + $description = $event->getDescription(); + $gcal_ical_uid = $event->getICalUID(); + $gcal_id = $event->getId(); + + // Event location + $location = $event->getLocation(); + $location_id = 1; + + // Import Event Locations into MEC locations + if(isset($this->ix['import_locations']) and $this->ix['import_locations'] and trim($location)) + { + $location_ex = explode(',', $location); + $location_id = $this->main->save_location(array + ( + 'name'=>trim($location_ex[0]), + 'address'=>$location + )); + } + + // Event Organizer + $organizer = $event->getOrganizer(); + $organizer_id = 1; + + // Import Event Organizer into MEC organizers + if(isset($this->ix['import_organizers']) and $this->ix['import_organizers']) + { + $organizer_id = $this->main->save_organizer(array + ( + 'name'=>$organizer->getDisplayName(), + 'email'=>$organizer->getEmail() + )); + } + + // Event Start Date and Time + $start = $event->getStart(); + + $g_start_date = $start->getDate(); + $g_start_datetime = $start->getDateTime(); + + $date_start = new DateTime((trim($g_start_datetime) ? $g_start_datetime : $g_start_date)); + $start_date = $date_start->format('Y-m-d'); + $start_hour = 8; + $start_minutes = '00'; + $start_ampm = 'AM'; + + if(trim($g_start_datetime)) + { + $start_hour = $date_start->format('g'); + $start_minutes = $date_start->format('i'); + $start_ampm = $date_start->format('A'); + } + + // Event End Date and Time + $end = $event->getEnd(); + + $g_end_date = $end->getDate(); + $g_end_datetime = $end->getDateTime(); + + $date_end = new DateTime((trim($g_end_datetime) ? $g_end_datetime : $g_end_date)); + $end_date = $date_end->format('Y-m-d'); + $end_hour = 6; + $end_minutes = '00'; + $end_ampm = 'PM'; + + if(trim($g_end_datetime)) + { + $end_hour = $date_end->format('g'); + $end_minutes = $date_end->format('i'); + $end_ampm = $date_end->format('A'); + } + + // Event Time Options + $allday = 0; + + // Both Start and Date times are empty, so it's all day event + if(!trim($g_end_datetime) and !trim($g_start_datetime)) + { + $allday = 1; + + $start_hour = 0; + $start_minutes = 0; + $start_ampm = 'AM'; + + $end_hour = 11; + $end_minutes = 55; + $end_ampm = 'PM'; + } + + // Recurring Event + if($event->getRecurrence()) + { + $repeat_status = 1; + $r_rules = $event->getRecurrence(); + + $i = 0; + + do + { + $g_recurrence_rule = $r_rules[$i]; + $main_rule_ex = explode(':', $g_recurrence_rule); + $rules = explode(';', $main_rule_ex[1]); + + $i++; + } + while($main_rule_ex[0] != 'RRULE' and isset($r_rules[$i])); + + $rule = []; + foreach($rules as $rule_row) + { + $ex = explode('=', $rule_row); + $key = strtolower($ex[0]); + $value = isset($ex[1]) ? ($key == 'until' ? $ex[1] : strtolower($ex[1])) : ''; + + $rule[$key] = $value; + } + + $interval = NULL; + $year = NULL; + $month = NULL; + $day = NULL; + $week = NULL; + $weekday = NULL; + $weekdays = NULL; + $advanced_days = NULL; + + $repeat_count = NULL; + if(isset($rule['count']) and is_numeric($rule['count'])) $repeat_count = max($rule['count'], 0); + + if(isset($rule['freq']) && $rule['freq'] == 'daily') + { + $repeat_type = 'daily'; + $interval = $rule['interval'] ?? 1; + } + elseif(isset($rule['freq']) && $rule['freq'] == 'weekly') + { + $repeat_type = 'weekly'; + $interval = isset($rule['interval']) ? $rule['interval']*7 : 7; + } + elseif(isset($rule['freq']) && $rule['freq'] == 'monthly' and isset($rule['byday']) and trim($rule['byday'])) + { + $repeat_type = 'advanced'; + + $adv_week = (isset($rule['bysetpos']) and trim($rule['bysetpos']) != '') ? $rule['bysetpos'] : (int) substr($rule['byday'], 0, -2); + $adv_day = str_replace($adv_week, '', $rule['byday']); + + $mec_adv_day = 'Sat'; + if($adv_day == 'su') $mec_adv_day = 'Sun'; + elseif($adv_day == 'mo') $mec_adv_day = 'Mon'; + elseif($adv_day == 'tu') $mec_adv_day = 'Tue'; + elseif($adv_day == 'we') $mec_adv_day = 'Wed'; + elseif($adv_day == 'th') $mec_adv_day = 'Thu'; + elseif($adv_day == 'fr') $mec_adv_day = 'Fri'; + + if($adv_week < 0) $adv_week = 'l'; + + $advanced_days = array($mec_adv_day.'.'.$adv_week); + } + elseif(isset($rule['freq']) && $rule['freq'] == 'monthly') + { + $repeat_type = 'monthly'; + $interval = $rule['interval'] ?? 1; + + $year = '*'; + $month = '*'; + + $s = $start_date; + $e = $end_date; + + $_days = []; + while(strtotime($s) <= strtotime($e)) + { + $_days[] = date('d', strtotime($s)); + $s = date('Y-m-d', strtotime('+1 Day', strtotime($s))); + } + + $day = ','.implode(',', array_unique($_days)).','; + + $week = '*'; + $weekday = '*'; + } + elseif(isset($rule['freq']) && $rule['freq'] == 'yearly') + { + $repeat_type = 'yearly'; + + $year = '*'; + + $s = $start_date; + $e = $end_date; + + $_months = []; + $_days = []; + while(strtotime($s) <= strtotime($e)) + { + $_months[] = date('m', strtotime($s)); + $_days[] = date('d', strtotime($s)); + + $s = date('Y-m-d', strtotime('+1 Day', strtotime($s))); + } + + $month = ','.implode(',', array_unique($_months)).','; + $day = ','.implode(',', array_unique($_days)).','; + + $week = '*'; + $weekday = '*'; + } + else $repeat_type = ''; + + // Custom Week Days + if($repeat_type == 'weekly' and isset($rule['byday']) and count(explode(',', $rule['byday'])) > 1) + { + $g_week_days = explode(',', $rule['byday']); + $week_day_mapping = array('mo'=>1, 'tu'=>2, 'we'=>3, 'th'=>4, 'fr'=>5, 'sa'=>6, 'su'=>7); + + $weekdays = ''; + foreach($g_week_days as $g_week_day) $weekdays .= $week_day_mapping[$g_week_day].','; + + $weekdays = ','.trim($weekdays, ', ').','; + $interval = NULL; + + $repeat_type = 'certain_weekdays'; + } + + $finish = isset($rule['until']) ? date('Y-m-d', strtotime($rule['until'])) : NULL; + + // It's all day event, so we should reduce one day from the end date! Google provides 2020-12-12 while the event ends at 2020-12-11 + if($allday) + { + $diff = $this->main->date_diff($start_date, $end_date); + if(($diff ? $diff->days : 0) >= 1) + { + $date_end->sub(new DateInterval('P1D')); + $end_date = $date_end->format('Y-m-d'); + } + } + } + // Single Event + else + { + // It's a one-day single event but google sends 2020-12-12 as end date if start date is 2020-12-11 + if(trim($g_end_datetime) == '' and date('Y-m-d', strtotime('-1 day', strtotime($end_date))) == $start_date) + { + $end_date = $start_date; + } + // It's all day event, so we should reduce one day from the end date! Google provides 2020-12-12 while the event ends at 2020-12-11 + elseif($allday) + { + $diff = $this->main->date_diff($start_date, $end_date); + if(($diff ? $diff->days : 0) > 1) + { + $date_end->sub(new DateInterval('P1D')); + $end_date = $date_end->format('Y-m-d'); + } + } + + $repeat_status = 0; + $g_recurrence_rule = ''; + $repeat_type = ''; + $interval = NULL; + $finish = $end_date; + $year = NULL; + $month = NULL; + $day = NULL; + $week = NULL; + $weekday = NULL; + $weekdays = NULL; + $advanced_days = NULL; + $repeat_count = NULL; + } + + $args = array + ( + 'title'=>$title, + 'content'=>$description, + 'location_id'=>$location_id, + 'organizer_id'=>$organizer_id, + 'date'=>array + ( + 'start'=>array( + 'date'=>$start_date, + 'hour'=>$start_hour, + 'minutes'=>$start_minutes, + 'ampm'=>$start_ampm, + ), + 'end'=>array( + 'date'=>$end_date, + 'hour'=>$end_hour, + 'minutes'=>$end_minutes, + 'ampm'=>$end_ampm, + ), + 'repeat'=>array(), + 'allday'=>$allday, + 'comment'=>'', + 'hide_time'=>0, + 'hide_end_time'=>0, + ), + 'start'=>$start_date, + 'start_time_hour'=>$start_hour, + 'start_time_minutes'=>$start_minutes, + 'start_time_ampm'=>$start_ampm, + 'end'=>$end_date, + 'end_time_hour'=>$end_hour, + 'end_time_minutes'=>$end_minutes, + 'end_time_ampm'=>$end_ampm, + 'repeat_status'=>$repeat_status, + 'repeat_type'=>$repeat_type, + 'repeat_count'=>$repeat_count, + 'interval'=>$interval, + 'finish'=>$finish, + 'year'=>$year, + 'month'=>$month, + 'day'=>$day, + 'week'=>$week, + 'weekday'=>$weekday, + 'weekdays'=>$weekdays, + 'meta'=>array + ( + 'mec_source'=>'google-calendar', + 'mec_gcal_ical_uid'=>$gcal_ical_uid, + 'mec_gcal_id'=>$gcal_id, + 'mec_gcal_calendar_id'=>$calendar_id, + 'mec_g_recurrence_rule'=>$g_recurrence_rule, + 'mec_allday'=>$allday, + 'mec_advanced_days'=>$advanced_days, + ) + ); + + $post_id = $this->db->select("SELECT `post_id` FROM `#__postmeta` WHERE `meta_value`='$gcal_id' AND `meta_key`='mec_gcal_id'", 'loadResult'); + + // Imported From Google + if(!post_exists($title, $description, '', $this->main->get_main_post_type())) $args['meta']['mec_imported_from_google'] = 1; + + // Insert the event into MEC + $post_id = $this->main->save_event($args, $post_id); + $post_ids[] = $post_id; + + // Set location to the post + if($location_id) wp_set_object_terms($post_id, (int) $location_id, 'mec_location'); + + // Set organizer to the post + if($organizer_id) wp_set_object_terms($post_id, (int) $organizer_id, 'mec_organizer'); + + // MEC Dates + $dates = $this->db->select("SELECT `dstart` FROM `#__mec_dates` WHERE `post_id`='".$post_id."' ORDER BY `tstart` ASC LIMIT 50", 'loadColumn'); + + // Event Instances + $instances = $service->events->instances($calendar_id, $gcal_id, array('maxResults' => 50)); + + $gdates = []; + foreach($instances as $instance) + { + $start = $instance->getStart(); + $date = $start->getDate(); + + $gdates[] = $date; + } + + $exdates = []; + $previous_not_found = NULL; + $next_found = NULL; + + foreach($dates as $date) + { + if(!in_array($date, $gdates)) $previous_not_found = $date; + elseif($previous_not_found) + { + $exdates[] = $previous_not_found; + $previous_not_found = NULL; + } + } + + // Update MEC EXDATES + $exdates = array_unique($exdates); + if(count($exdates)) + { + $args['not_in_days'] = implode(',', $exdates); + + $this->main->save_event($args, $post_id); + } + } + + return array('success'=>1, 'data'=>$post_ids); + } + + /** + * Show content of meetup import tab + * @return void + * @throws Exception + * @author Webnus + */ + public function ix_meetup_import() + { + // Current Action + $this->action = isset($_POST['mec-ix-action']) ? sanitize_text_field($_POST['mec-ix-action']) : 'meetup-import-config'; + if(isset($_GET['mec-ix-action']) and trim($_GET['mec-ix-action'])) $this->action = $_GET['mec-ix-action']; + + $this->ix = isset($_POST['ix']) && is_array($_POST['ix']) ? array_map('sanitize_text_field', $_POST['ix']) : []; + + $this->response = []; + + if($this->action == 'meetup-import-login') $this->response = $this->meetup_import_login(); + elseif($this->action == 'meetup-import-start') $this->response = $this->meetup_import_start(); + elseif($this->action == 'meetup-import-do') $this->response = $this->meetup_import_do(); + + $path = MEC::import('app.features.ix.import_meetup', true, true); + + ob_start(); + include $path; + echo MEC_kses::full(ob_get_clean()); + } + + public function meetup_import_login() + { + // Meetup Keys + $public_key = $this->ix['meetup_public_key'] ?? NULL; + $secret_key = $this->ix['meetup_secret_key'] ?? NULL; + $group_name = $this->ix['meetup_group_name'] ?? NULL; + + // Save options + $this->main->save_ix_options([ + 'meetup_public_key' => $public_key, + 'meetup_secret_key' => $secret_key, + 'meetup_group_name' => $group_name, + ]); + + // Meetup API + $meetup = $this->getMeetup(); + + // Redirect URL + $redirect_url = $meetup->get_redirect_url(); + + return [ + 'login' => 'https://secure.meetup.com/oauth2/authorize?client_id='.$public_key.'&response_type=code&redirect_uri='.urlencode($redirect_url) + ]; + } + + public function meetup_import_start() + { + // One Time Key + $code = $_GET['code'] ?? ''; + + // No Access + if(!trim($code)) return ['success'=>0, 'error'=>__('Something happened. Please make sure you allow the website to access your meetup account.', 'modern-events-calendar-lite')]; + + // IX Options + $ix = $this->main->get_ix_options(); + + // Meetup API + $meetup = $this->getMeetup(); + + // Token + $token = $meetup->get_tokens_by_code($code); + + // Group Name + $group_name = $ix['meetup_group_name'] ?? ''; + + // Group Info + $group_info = $meetup->get_group_name($token, $group_name); + + // No Access + if(!isset($group_info['data']['groupByUrlname']) || !is_array($group_info['data']['groupByUrlname'])) return ['success'=>0, 'error'=>__('Meetup group not found!', 'modern-events-calendar-lite')]; + + // Upcoming Events + $events = $meetup->get_group_events($token, $group_name); + $data = []; + + try + { + $m_events = []; + if(isset($events['data']['groupByUrlname']['upcomingEvents']['edges'])) + { + foreach($events['data']['groupByUrlname']['upcomingEvents']['edges'] as $edge) + { + $start = $edge['node']['dateTime']; + $end = $edge['node']['endTime']; + + $m_events[] = [ + 'id' => $edge['node']['id'], + 'title' => $edge['node']['title'], + 'url' => $edge['node']['eventUrl'], + 'start' => date('Y-m-d H:i:s', strtotime($start)), + 'end' => date('Y-m-d H:i:s', strtotime($end)), + ]; + } + } + + $data['title'] = $group_info['data']['groupByUrlname']['name']; + $data['events'] = $m_events; + $data['count'] = count($m_events); + } + catch(Exception $e) + { + $error = $e->getMessage(); + return ['success'=>0, 'error'=>$error]; + } + + return ['success'=>1, 'data'=>$data]; + } + + /** + * @throws Exception + */ + public function meetup_import_do() + { + $m_events = isset($_POST['m-events']) && is_array($_POST['m-events']) ? array_map('sanitize_text_field', $_POST['m-events']) : []; + if(!count($m_events)) return ['success'=>0, 'error'=>__('Please select events to import!', 'modern-events-calendar-lite')]; + + // Meetup API + $meetup = $this->getMeetup(); + + // IX Options + $ix = $this->main->get_ix_options(); + $group_name = $ix['meetup_group_name'] ?? NULL; + + // Token + $token = $meetup->get_token(); + + // Invalid Token + if(!trim($token)) return ['success'=>0, 'error'=>__('Invalid API Token.', 'modern-events-calendar-lite')]; + + // Timezone + $timezone = $this->main->get_timezone(); + + // MEC File + $file = $this->getFile(); + $wp_upload_dir = wp_upload_dir(); + + $post_ids = []; + foreach($m_events as $m_event) + { + try + { + $data = $meetup->get_event($token, $m_event); + $event = isset($data['data']['event']) && is_array($data['data']['event']) ? $data['data']['event'] : []; + + if(!count($event)) continue; + } + catch(Exception $e) + { + continue; + } + + // Event Title and Content + $title = $event['title']; + $description = $event['description']; + $mcal_id = $event['id']; + + // Event location + $location = $event['venue'] ?? []; + $location_id = 1; + + // Import Event Locations into MEC locations + if(isset($this->ix['import_locations']) && $this->ix['import_locations'] && count($location)) + { + $address = $location['address'] ?? ''; + $address .= isset($location['city']) ? ', '.$location['city'] : ''; + $address .= isset($location['state']) ? ', '.$location['state'] : ''; + $address .= isset($location['country']) ? ', '.$location['country'] : ''; + + $location_id = $this->main->save_location([ + 'name' => trim($location['name']), + 'latitude' => trim($location['lat']), + 'longitude' => trim($location['lng']), + 'address' => $address + ]); + } + + // Event Organizer + $organizers = $event['hosts'] ?? []; + $main_organizer_id = 1; + $additional_organizer_ids = []; + + // Import Event Organizer into MEC organizers + if(isset($this->ix['import_organizers']) && $this->ix['import_organizers'] && count($organizers)) + { + $o = 1; + foreach($organizers as $organizer) + { + $organizer_id = $this->main->save_organizer([ + 'name' => $organizer['name'], + 'thumbnail' => '' + ]); + + if($o == 1) $main_organizer_id = $organizer_id; + else $additional_organizer_ids[] = $organizer_id; + + $o++; + } + } + + // Timezone + $TZ = $event['timezone'] ?? 'UTC'; + + // Event Start Date and Time + $start = strtotime($event['dateTime']); + + $date_start = new DateTime(date('Y-m-d H:i:s', $start), new DateTimeZone($TZ)); + $date_start->setTimezone(new DateTimeZone($timezone)); + + $start_date = $date_start->format('Y-m-d'); + $start_hour = $date_start->format('g'); + $start_minutes = $date_start->format('i'); + $start_ampm = $date_start->format('A'); + + // Event End Date and Time + $end = strtotime($event['endTime']); + + $date_end = new DateTime(date('Y-m-d H:i:s', $end), new DateTimeZone($TZ)); + $date_end->setTimezone(new DateTimeZone($timezone)); + + $end_date = $date_end->format('Y-m-d'); + $end_hour = $date_end->format('g'); + $end_minutes = $date_end->format('i'); + $end_ampm = $date_end->format('A'); + + // Meetup Link + $more_info = $event['eventUrl'] ?? ''; + + // Fee Options + $fee = 0; + if(isset($event['feeSettings']) && is_array($event['feeSettings'])) + { + $fee = $event['feeSettings']['amount'].' '.$event['feeSettings']['currency']; + } + + // Event Time Options + $allday = 0; + + // Single Event + $repeat_status = 0; + $repeat_type = ''; + $interval = NULL; + $finish = $end_date; + $year = NULL; + $month = NULL; + $day = NULL; + $week = NULL; + $weekday = NULL; + $weekdays = NULL; + + $args = [ + 'title'=>$title, + 'content'=>$description, + 'location_id'=>$location_id, + 'organizer_id'=>$main_organizer_id, + 'date'=>[ + 'start'=>[ + 'date'=>$start_date, + 'hour'=>$start_hour, + 'minutes'=>$start_minutes, + 'ampm'=>$start_ampm, + ], + 'end'=>[ + 'date'=>$end_date, + 'hour'=>$end_hour, + 'minutes'=>$end_minutes, + 'ampm'=>$end_ampm, + ], + 'repeat'=>[], + 'allday'=>$allday, + 'comment'=>'', + 'hide_time'=>0, + 'hide_end_time'=>0, + ], + 'start'=>$start_date, + 'start_time_hour'=>$start_hour, + 'start_time_minutes'=>$start_minutes, + 'start_time_ampm'=>$start_ampm, + 'end'=>$end_date, + 'end_time_hour'=>$end_hour, + 'end_time_minutes'=>$end_minutes, + 'end_time_ampm'=>$end_ampm, + 'repeat_status'=>$repeat_status, + 'repeat_type'=>$repeat_type, + 'interval'=>$interval, + 'finish'=>$finish, + 'year'=>$year, + 'month'=>$month, + 'day'=>$day, + 'week'=>$week, + 'weekday'=>$weekday, + 'weekdays'=>$weekdays, + 'meta'=>[ + 'mec_source'=>'meetup', + 'mec_meetup_id'=>$mcal_id, + 'mec_meetup_series_id'=>'', + 'mec_more_info'=>$more_info, + 'mec_more_info_title'=>__('Check at Meetup', 'modern-events-calendar-lite'), + 'mec_more_info_target'=>'_self', + 'mec_cost'=>$fee, + 'mec_meetup_url'=>$group_name, + 'mec_allday'=>$allday + ] + ]; + + $post_id = $this->db->select("SELECT `post_id` FROM `#__postmeta` WHERE `meta_value`='$mcal_id' AND `meta_key`='mec_meetup_id'", 'loadResult'); + + // Insert the event into MEC + $post_id = $this->main->save_event($args, $post_id); + $post_ids[] = $post_id; + + // Set location to the post + if($location_id) wp_set_object_terms($post_id, (int) $location_id, 'mec_location'); + + // Set organizer to the post + if($main_organizer_id) wp_set_object_terms($post_id, (int) $main_organizer_id, 'mec_organizer'); + + // Set Additional Organizers + if(count($additional_organizer_ids)) + { + foreach($additional_organizer_ids as $additional_organizer_id) wp_set_object_terms($post_id, (int) $additional_organizer_id, 'mec_organizer', true); + update_post_meta($post_id, 'mec_additional_organizer_ids', $additional_organizer_ids); + } + + // Featured Image + if(!has_post_thumbnail($post_id) && isset($event['imageUrl'])) + { + $photo = $this->main->get_web_page($event['imageUrl']); + $file_name = md5($post_id).'.'.$this->main->get_image_type_by_buffer($photo); + + $path = rtrim($wp_upload_dir['path'], DS.' ').DS.$file_name; + $url = rtrim($wp_upload_dir['url'], '/ ').'/'.$file_name; + + $file->write($path, $photo); + $this->main->set_featured_image($url, $post_id); + } + } + + return ['success'=>1, 'data'=>$post_ids]; + } + + public function export_all_events_do() + { + // Current User Doesn't Have Access + $capability = (current_user_can('administrator') ? 'manage_options' : 'mec_import_export'); + if(!current_user_can($capability)) return; + + $format = isset($_GET['format']) ? sanitize_text_field($_GET['format']) : 'csv'; + $events = $this->main->get_events('-1'); + + switch($format) + { + case 'ical': + + $output = ''; + foreach($events as $event) $output .= $this->main->ical_single($event->ID); + + $ical_calendar = $this->main->ical_calendar($output); + + header('Content-type: application/force-download; charset=utf-8'); + header('Content-Disposition: attachment; filename="mec-events-'.date('YmdTHi').'.ics"'); + + echo MEC_kses::full($ical_calendar); + exit; + + case 'csv': + + $filename = 'mec-events-' . md5(time() . mt_rand(100, 999)) . '.csv'; + $events_feature = new MEC_feature_events(); + + $rows = $events_feature->csvexcel(true); + $this->main->generate_download_csv($rows, $filename); + + exit; + + case 'g-cal-csv': + + header('Content-Type: text/csv; charset=utf-8'); + header('Content-Disposition: attachment; filename=mec-events-' . md5(time() . mt_rand(100, 999)) . '.csv'); + + $events_feature = new MEC_feature_events(); + $events_feature->gcalcsv(true); + exit; + + case 'ms-excel': + + $filename = 'mec-events-' . md5(time() . mt_rand(100, 999)) . '.xlsx'; + $events_feature = new MEC_feature_events(); + + $rows = $events_feature->csvexcel(true); + $this->main->generate_download_excel($rows, $filename); + + exit; + + case 'xml': + + $output = []; + foreach($events as $event) $output[] = $this->main->export_single($event->ID); + + $xml_feed = $this->main->xml_convert(array('events'=>$output)); + + header('Content-type: application/force-download; charset=utf-8'); + header('Content-Disposition: attachment; filename="mec-events-'.date('YmdTHi').'.xml"'); + + echo $xml_feed; + exit; + + case 'json': + + $output = []; + foreach($events as $event) $output[] = $this->main->export_single($event->ID); + + header('Content-type: application/force-download; charset=utf-8'); + header('Content-Disposition: attachment; filename="mec-events-'.date('YmdTHi').'.json"'); + + echo json_encode($output); + exit; + } + } + + public function export_all_bookings_do() + { + // Current User Doesn't Have Access + $capability = (current_user_can('administrator') ? 'manage_options' : 'mec_import_export'); + if(!current_user_can($capability)) return false; + + $format = isset($_GET['format']) ? sanitize_text_field($_GET['format']) : 'csv'; + switch($format) + { + case 'ms-excel': + + $booking_ids = $this->bookings_csvexcel(); + + $book = new MEC_feature_books(); + $rows = $book->csvexcel($booking_ids); + + $filename = 'bookings-' . md5(time() . mt_rand(100, 999)) . '.xlsx'; + $this->main->generate_download_excel($rows, $filename); + + exit; + + case 'csv': + + $booking_ids = $this->bookings_csvexcel(); + + $book = new MEC_feature_books(); + $rows = $book->csvexcel($booking_ids); + + $filename = 'bookings-' . md5(time() . mt_rand(100, 999)) . '.csv'; + $this->main->generate_download_csv($rows, $filename); + + exit; + } + } + + public function bookings_csvexcel() + { + $bookings = get_posts(array('post_type'=>$this->main->get_book_post_type(), 'numberposts'=>-1, 'post_status'=>'publish')); + + $booking_ids = []; + foreach($bookings as $booking) $booking_ids[] = $booking->ID; + + return $booking_ids; + } + + public function g_calendar_export_authenticate() + { + $ix = ((isset($_POST['ix']) and is_array($_POST['ix'])) ? array_map('sanitize_text_field', $_POST['ix']) : array()); + + $client_id = $ix['google_export_client_id'] ?? NULL; + $client_secret = $ix['google_export_client_secret'] ?? NULL; + $calendar_id = $ix['google_export_calendar_id'] ?? NULL; + $auth_url = ''; + + if(!trim($client_id) or !trim($client_secret) or !trim($calendar_id)) $this->main->response(array('success'=>0, 'message'=>__('All of Client ID, Client Secret, and Calendar ID are required!', 'modern-events-calendar-lite'))); + + // Save options + $this->main->save_ix_options(array('google_export_client_id'=>$client_id, 'google_export_client_secret'=>$client_secret, 'google_export_calendar_id'=>$calendar_id)); + + try + { + $client = new Google_Client(); + $client->setApplicationName(get_bloginfo('name')); + $client->setAccessType('offline'); + $client->setApprovalPrompt('force'); + $client->setScopes(array('https://www.googleapis.com/auth/calendar')); + $client->setClientId($client_id); + $client->setClientSecret($client_secret); + $client->setRedirectUri($this->main->add_qs_vars(array('mec-ix-action'=>'google-calendar-export-get-token'), $this->main->URL('backend').'admin.php?page=MEC-ix&tab=MEC-g-calendar-export')); + + $auth_url = filter_var($client->createAuthUrl(), FILTER_SANITIZE_URL); + } + catch(Exception $ex) + { + $this->main->response(array('success'=>0, 'message'=>$ex->getMessage())); + } + + $this->main->response(array('success'=>1, 'message'=>sprintf(esc_html__('All seems good! Please click %s to authenticate your app.', 'modern-events-calendar-lite'), ''.esc_html__('here', 'modern-events-calendar-lite').''))); + } + + public function g_calendar_export_get_token() + { + $code = isset($_GET['code']) ? sanitize_text_field($_GET['code']) : ''; + + $ix = $this->main->get_ix_options(); + $client_id = $ix['google_export_client_id'] ?? NULL; + $client_secret = $ix['google_export_client_secret'] ?? NULL; + + try + { + $client = new Google_Client(); + $client->setApplicationName(get_bloginfo('name')); + $client->setAccessType('offline'); + $client->setApprovalPrompt('force'); + $client->setScopes(array('https://www.googleapis.com/auth/calendar')); + $client->setClientId($client_id); + $client->setClientSecret($client_secret); + $client->setRedirectUri($this->main->add_qs_vars(array('mec-ix-action'=>'google-calendar-export-get-token'), $this->main->URL('backend').'admin.php?page=MEC-ix&tab=MEC-g-calendar-export')); + + $authentication = $client->authenticate($code); + $token = $client->getAccessToken(); + + $auth = json_decode($authentication, true); + $refresh_token = $auth['refresh_token']; + + // Save options + $this->main->save_ix_options(array('google_export_token'=>$token, 'google_export_refresh_token'=>$refresh_token)); + + $url = $this->main->remove_qs_var('code', $this->main->remove_qs_var('mec-ix-action')); + header('location: '.$url); + exit; + } + catch(Exception $ex) + { + echo esc_html($ex->getMessage()); + exit; + } + } + + public function g_calendar_export_do() + { + $mec_event_ids = ((isset($_POST['mec-events']) and is_array($_POST['mec-events'])) ? array_map('sanitize_text_field', $_POST['mec-events']) : array()); + $export_attendees = (isset($_POST['export_attendees']) ? sanitize_text_field($_POST['export_attendees']) : 0); + + $ix = $this->main->get_ix_options(); + + $client_id = $ix['google_export_client_id'] ?? NULL; + $client_secret = $ix['google_export_client_secret'] ?? NULL; + $token = $ix['google_export_token'] ?? NULL; + $refresh_token = $ix['google_export_refresh_token'] ?? NULL; + $calendar_id = $ix['google_export_calendar_id'] ?? NULL; + + if(!trim($client_id) or !trim($client_secret) or !trim($calendar_id)) $this->main->response(array('success'=>0, 'message'=>__('Client App, Client Secret, and Calendar ID are all required!', 'modern-events-calendar-lite'))); + + $client = new Google_Client(); + $client->setApplicationName('Modern Events Calendar'); + $client->setAccessType('offline'); + $client->setScopes(array('https://www.googleapis.com/auth/calendar')); + $client->setClientId($client_id); + $client->setClientSecret($client_secret); + $client->setRedirectUri($this->main->add_qs_vars(array('mec-ix-action'=>'google-calendar-export-get-token'), $this->main->URL('backend').'admin.php?page=MEC-ix&tab=MEC-g-calendar-export')); + $client->setAccessToken($token); + $client->refreshToken($refresh_token); + + $service = new Google_Service_Calendar($client); + + // MEC Render Library + $render = $this->getRender(); + + $g_events_not_inserted = []; + $g_events_inserted = []; + $g_events_updated = []; + + foreach($mec_event_ids as $mec_event_id) + { + $data = $render->data($mec_event_id); + + $dates = $render->dates($mec_event_id, $data); + $date = $dates[0] ?? []; + + // No Date + if(!count($date)) continue; + + // Timezone Options + $timezone = $this->main->get_timezone($mec_event_id); + + $location = $data->locations[$data->meta['mec_location_id']] ?? []; + $organizer = $data->organizers[$data->meta['mec_organizer_id']] ?? []; + + $recurrence = $this->main->get_ical_rrules($data); + + $start = array( + 'dateTime'=>date('Y-m-d\TH:i:s', $date['start']['timestamp']), + 'timeZone'=>$timezone, + ); + + $end = array( + 'dateTime'=>date('Y-m-d\TH:i:s', $date['end']['timestamp']), + 'timeZone'=>$timezone, + ); + + $allday = $data->meta['mec_allday'] ?? 0; + if($allday) + { + $start['dateTime'] = date('Y-m-d\T00:00:00', $date['start']['timestamp']); + $end['dateTime'] = date('Y-m-d\T00:00:00', strtotime('+1 Day', strtotime($end['dateTime']))); + } + + // Event Data + $event_data = array + ( + 'summary'=>$data->title, + 'location'=>($location['address'] ?? ($location['name'] ?? '')), + 'description'=>strip_tags(strip_shortcodes($data->content)), + 'start'=>$start, + 'end'=>$end, + 'recurrence'=>$recurrence, + 'attendees'=>array(), + 'reminders'=>array(), + ); + + $event = new Google_Service_Calendar_Event($event_data); + $iCalUID = 'mec-ical-'.$data->ID; + + $mec_iCalUID = get_post_meta($data->ID, 'mec_gcal_ical_uid', true); + $mec_calendar_id = get_post_meta($data->ID, 'mec_gcal_calendar_id', true); + + /** + * Event is imported from same google calendar, + * and now it's exporting to its calendar again, + * so we're trying to update existing one by setting event iCal ID + */ + if($mec_calendar_id == $calendar_id and trim($mec_iCalUID)) $iCalUID = $mec_iCalUID; + + $event->setICalUID($iCalUID); + + // Set the organizer if exists + if(isset($organizer['name'])) + { + $g_organizer = new Google_Service_Calendar_EventOrganizer(); + $g_organizer->setDisplayName($organizer['name']); + $g_organizer->setEmail($organizer['email']); + + $event->setOrganizer($g_organizer); + } + + // Set the attendees + if($export_attendees) + { + $attendees = []; + foreach($this->main->get_event_attendees($data->ID) as $att) + { + $attendee = new Google_Service_Calendar_EventAttendee(); + $attendee->setDisplayName($att['name']); + $attendee->setEmail($att['email']); + $attendee->setResponseStatus('accepted'); + + $attendees[] = $attendee; + } + + $event->setAttendees($attendees); + } + + try + { + $g_event = $service->events->insert($calendar_id, $event); + + // Set Google Calendar ID to MEC database for updating it in the future instead of adding it twice + update_post_meta($data->ID, 'mec_gcal_ical_uid', $g_event->getICalUID()); + update_post_meta($data->ID, 'mec_gcal_calendar_id', $calendar_id); + update_post_meta($data->ID, 'mec_gcal_id', $g_event->getId()); + + $g_events_inserted[] = array('title'=>$data->title, 'message'=>$g_event->htmlLink); + } + catch(Exception $ex) + { + // Event already existed + if($ex->getCode() == 409) + { + try + { + $g_event_id = get_post_meta($data->ID, 'mec_gcal_id', true); + $g_event = $service->events->get($calendar_id, $g_event_id); + + // Update Event Data + $g_event->setSummary($event_data['summary']); + $g_event->setLocation($event_data['location']); + $g_event->setDescription($event_data['description']); + $g_event->setRecurrence($event_data['recurrence']); + + $start = new Google_Service_Calendar_EventDateTime(); + $start->setDateTime($event_data['start']['dateTime']); + $start->setTimeZone($event_data['start']['timeZone']); + $g_event->setStart($start); + + $end = new Google_Service_Calendar_EventDateTime(); + $end->setDateTime($event_data['end']['dateTime']); + $end->setTimeZone($event_data['end']['timeZone']); + $g_event->setEnd($end); + + $g_updated_event = $service->events->update($calendar_id, $g_event_id, $g_event); + $g_events_updated[] = array('title'=>$data->title, 'message'=>$g_updated_event->htmlLink); + } + catch(Exception $ex) + { + $g_events_not_inserted[] = array('title'=>$data->title, 'message'=>$ex->getMessage()); + } + } + else $g_events_not_inserted[] = array('title'=>$data->title, 'message'=>$ex->getMessage()); + } + } + + $results = '
      '; + foreach($g_events_not_inserted as $g_event_not_inserted) $results .= '
    • '.MEC_kses::element($g_event_not_inserted['title']).': '.MEC_kses::element($g_event_not_inserted['message']).'
    • '; + $results .= '
        '; + + $message = (count($g_events_inserted) ? sprintf(esc_html__('%s events added to Google Calendar with success.', 'modern-events-calendar-lite'), ''.count($g_events_inserted).'') : ''); + $message .= (count($g_events_updated) ? ' '.sprintf(esc_html__('%s Updated previously added events.', 'modern-events-calendar-lite'), ''.count($g_events_updated).'') : ''); + $message .= (count($g_events_not_inserted) ? ' '.sprintf(esc_html__('%s events failed to add for following reasons: %s', 'modern-events-calendar-lite'), ''.count($g_events_not_inserted).'', $results) : ''); + + $this->main->response(array('success'=>((count($g_events_inserted) or count($g_events_updated)) ? 1 : 0), 'message'=>trim($message))); + } + + /** + * Show content of Facebook Import tab + * @author Webnus + * @return void + */ + public function ix_f_calendar_import() + { + // Current Action + $this->action = isset($_POST['mec-ix-action']) ? sanitize_text_field($_POST['mec-ix-action']) : ''; + $this->ix = ((isset($_POST['ix']) and is_array($_POST['ix'])) ? array_map('sanitize_text_field', $_POST['ix']) : array()); + + $this->response = []; + if($this->action == 'facebook-calendar-import-start') $this->response = $this->f_calendar_import_start(); + elseif($this->action == 'facebook-calendar-import-do') $this->response = $this->f_calendar_import_do(); + + $path = MEC::import('app.features.ix.import_f_calendar', true, true); + + ob_start(); + include $path; + echo MEC_kses::full(ob_get_clean()); + } + + public function f_calendar_import_start() + { + $fb_page_link = $this->ix['facebook_import_page_link'] ?? NULL; + $this->fb_access_token = $this->ix['facebook_app_token'] ?? NULL; + + if(!trim($fb_page_link)) return array('success'=>0, 'message'=>__("Please insert your Facebook page's link.", 'modern-events-calendar-lite')); + + // Save options + $this->main->save_ix_options(['facebook_import_page_link'=>$fb_page_link]); + $this->main->save_ix_options(['facebook_app_token'=>$this->fb_access_token]); + + $fb_page = $this->f_calendar_import_get_page($fb_page_link); + + $fb_page_id = $fb_page['id'] ?? 0; + if(!$fb_page_id) + { + $message = esc_html__("We were not able to recognize your Facebook page. Please check again and provide a valid link.", 'modern-events-calendar-lite'); + if(isset($fb_page['error']) and isset($fb_page['error']['message'])) $message = $fb_page['error']['message']; + + return array('success'=>0, 'message'=>$message); + } + + $events = []; + $next_page = 'https://graph.facebook.com/v18.0/'.$fb_page_id.'/events/?access_token='.$this->fb_access_token; + + do + { + $events_result = $this->main->get_web_page($next_page); + $fb_events = json_decode($events_result, true); + + // Exit the loop if no event found + if(!isset($fb_events['data'])) break; + + foreach($fb_events['data'] as $fb_event) + { + $events[] = array('id'=>$fb_event['id'], 'name'=>$fb_event['name']); + } + + $next_page = $fb_events['paging']['next'] ?? NULL; + } + while($next_page); + + if(!count($events)) return array('success'=>0, 'message'=>__("No events found!", 'modern-events-calendar-lite')); + else return array('success'=>1, 'message'=>'', 'data'=>array('events'=>$events, 'count'=>count($events), 'name'=>$fb_page['name'])); + } + + public function f_calendar_import_do() + { + $f_events = ((isset($_POST['f-events']) and is_array($_POST['f-events'])) ? array_map('sanitize_text_field', $_POST['f-events']) : array()); + if(!count($f_events)) return array('success'=>0, 'message'=>__('Please select events to import!', 'modern-events-calendar-lite')); + + $fb_page_link = $this->ix['facebook_import_page_link'] ?? NULL; + $this->fb_access_token = $this->ix['facebook_app_token'] ?? NULL; + if(!trim($fb_page_link)) return array('success'=>0, 'message'=>__("Please insert your facebook page's link.", 'modern-events-calendar-lite')); + + $fb_page = $this->f_calendar_import_get_page($fb_page_link); + + $fb_page_id = $fb_page['id'] ?? 0; + if(!$fb_page_id) return array('success'=>0, 'message'=>__("We were not able to recognize your Facebook page. Please check again and provide a valid link.", 'modern-events-calendar-lite')); + + // Timezone + $timezone = $this->main->get_timezone(); + + // MEC File + $file = $this->getFile(); + $wp_upload_dir = wp_upload_dir(); + + $post_ids = []; + foreach($f_events as $f_event_id) + { + $events_result = $this->main->get_web_page('https://graph.facebook.com/v18.0/'.$f_event_id.'?fields=name,place,description,start_time,end_time,cover,event_times&access_token='.$this->fb_access_token); + $event = json_decode($events_result, true); + + // An error Occurred + if(isset($event['error']) and is_array($event['error']) and count($event['error'])) continue; + + // Event organizer + $organizer_id = 1; + + // Event location + $location = $event['place'] ?? []; + $location_id = 1; + + // Import Event Locations into MEC locations + if(isset($this->ix['import_locations']) and $this->ix['import_locations'] and count($location)) + { + $location_name = $location['name']; + $location_address = trim($location_name.' '.($location['location']['city'] ?? '').' '.($location['location']['state'] ?? '').' '.($location['location']['country'] ?? '').' '.($location['location']['zip'] ?? ''), ''); + $location_id = $this->main->save_location(array + ( + 'name'=>trim($location_name), + 'address'=>$location_address, + 'latitude'=>!empty($location['location']['latitude']) ? $location['location']['latitude'] : '', + 'longitude'=>!empty($location['location']['longitude']) ? $location['location']['longitude'] : '', + )); + } + + // Event Title and Content + $title = $event['name']; + $description = $event['description'] ?? ''; + + // Event Times (Custom Events) + $event_times = ((isset($event['event_times']) and is_array($event['event_times'])) ? $event['event_times'] : array()); + + if(count($event_times)) + { + $days = ''; + $main_datetime = []; + + $i = 1; + foreach($event_times as $event_time) + { + if($i == count($event_times)) $main_datetime = $event_time; + else + { + $ds = new DateTime($event_time['start_time']); + $ds->setTimezone(new DateTimeZone($timezone)); + + $de = new DateTime($event_time['end_time']); + $de->setTimezone(new DateTimeZone($timezone)); + + $days .= $ds->format('Y-m-d').':'.$de->format('Y-m-d').':'.$ds->format('h-i-A').':'.$de->format('h-i-A').','; + } + + $i++; + } + + $date_start = new DateTime($main_datetime['start_time']); + $date_start->setTimezone(new DateTimeZone($timezone)); + + $start_date = $date_start->format('Y-m-d'); + $start_hour = $date_start->format('g'); + $start_minutes = $date_start->format('i'); + $start_ampm = $date_start->format('A'); + + $date_end = new DateTime($main_datetime['end_time']); + $date_end->setTimezone(new DateTimeZone($timezone)); + + $end_date = $date_end->format('Y-m-d'); + $end_hour = $date_end->format('g'); + $end_minutes = $date_end->format('i'); + $end_ampm = $date_end->format('A'); + + $repeat_status = 1; + $repeat_type = 'custom_days'; + $days = trim($days, ', '); + } + else + { + $date_start = new DateTime($event['start_time']); + $date_start->setTimezone(new DateTimeZone($timezone)); + + $start_date = $date_start->format('Y-m-d'); + $start_hour = $date_start->format('g'); + $start_minutes = $date_start->format('i'); + $start_ampm = $date_start->format('A'); + + $end_timestamp = isset($event['end_time']) ? strtotime($event['end_time']) : 0; + if($end_timestamp) + { + $date_end = new DateTime($event['end_time']); + $date_end->setTimezone(new DateTimeZone($timezone)); + } + + $end_date = $end_timestamp ? $date_end->format('Y-m-d') : $start_date; + $end_hour = $end_timestamp ? $date_end->format('g') : 8; + $end_minutes = $end_timestamp ? $date_end->format('i') : '00'; + $end_ampm = $end_timestamp ? $date_end->format('A') : 'PM'; + + $repeat_status = 0; + $repeat_type = ''; + $days = NULL; + } + + // Event Time Options + $allday = 0; + + // Import Facebook Link as Event Link + $read_more = ''; + if(isset($this->ix['import_link_event']) and $this->ix['import_link_event']) $read_more = 'https://www.facebook.com/events/'.$f_event_id.'/'; + + // Import Facebook Link as More Info + $more_info = ''; + if(isset($this->ix['import_link_more_info']) and $this->ix['import_link_more_info']) $more_info = 'https://www.facebook.com/events/'.$f_event_id.'/'; + + $args = array + ( + 'title'=>$title, + 'content'=>$description, + 'location_id'=>$location_id, + 'organizer_id'=>$organizer_id, + 'date'=>array + ( + 'start'=>array( + 'date'=>$start_date, + 'hour'=>$start_hour, + 'minutes'=>$start_minutes, + 'ampm'=>$start_ampm, + ), + 'end'=>array( + 'date'=>$end_date, + 'hour'=>$end_hour, + 'minutes'=>$end_minutes, + 'ampm'=>$end_ampm, + ), + 'repeat'=>array(), + 'allday'=>$allday, + 'comment'=>'', + 'hide_time'=>0, + 'hide_end_time'=>0, + ), + 'start'=>$start_date, + 'start_time_hour'=>$start_hour, + 'start_time_minutes'=>$start_minutes, + 'start_time_ampm'=>$start_ampm, + 'end'=>$end_date, + 'end_time_hour'=>$end_hour, + 'end_time_minutes'=>$end_minutes, + 'end_time_ampm'=>$end_ampm, + 'repeat_status'=>$repeat_status, + 'repeat_type'=>$repeat_type, + 'interval'=>NULL, + 'finish'=>$end_date, + 'year'=>NULL, + 'month'=>NULL, + 'day'=>NULL, + 'week'=>NULL, + 'weekday'=>NULL, + 'weekdays'=>NULL, + 'days'=>$days, + 'meta'=>array + ( + 'mec_source'=>'facebook-calendar', + 'mec_facebook_page_id'=>$fb_page_id, + 'mec_facebook_event_id'=>$f_event_id, + 'mec_allday'=>$allday, + 'mec_read_more'=>$read_more, + 'mec_more_info'=>$more_info, + 'mec_in_days'=>$days, + ) + ); + + $post_id = $this->db->select("SELECT `post_id` FROM `#__postmeta` WHERE `meta_value`='$f_event_id' AND `meta_key`='mec_facebook_event_id'", 'loadResult'); + + // Insert the event into MEC + $post_id = $this->main->save_event($args, $post_id); + $post_ids[] = $post_id; + + // Set location to the post + if($location_id) wp_set_object_terms($post_id, (int) $location_id, 'mec_location'); + + if(!has_post_thumbnail($post_id) and isset($event['cover']) and is_array($event['cover']) and count($event['cover'])) + { + $photo = $this->main->get_web_page($event['cover']['source']); + $file_name = md5($post_id).'.'.$this->main->get_image_type_by_buffer($photo); + + $path = rtrim($wp_upload_dir['path'], DS.' ').DS.$file_name; + $url = rtrim($wp_upload_dir['url'], '/ ').'/'.$file_name; + + $file->write($path, $photo); + $this->main->set_featured_image($url, $post_id); + } + } + + return array('success'=>1, 'data'=>$post_ids); + } + + public function f_calendar_import_get_page($link) + { + $this->fb_access_token = $this->ix['facebook_app_token'] ?? NULL; + $fb_page_result = $this->main->get_web_page('https://graph.facebook.com/v18.0/?access_token='.$this->fb_access_token.'&id='.$link); + + return json_decode($fb_page_result, true); + } +} \ No newline at end of file diff --git a/app/features/ix/export.php b/app/features/ix/export.php new file mode 100755 index 0000000..7150493 --- /dev/null +++ b/app/features/ix/export.php @@ -0,0 +1,71 @@ +main->get_events('-1'); + +// Settings +$settings = $this->main->get_settings(); +?> +
        +

        + +
        +
        +
        +

        +

        +
          +
        • +
        • +
        • +
        • +
        • +
        • +
        +
        +
        +

        +

        main->URL('backend')).'edit.php?post_type=mec-events">'.esc_html__('Events', 'modern-events-calendar-lite').''); ?>

        +
        + + +
        +

        +

        main->URL('site'), '/ ').'/?mec-ical-feed=1" target="_blank">'.trim($this->main->URL('site'), '/ ').'/?mec-ical-feed=1'); ?>

        +
        + + + main->getPRO()): ?> +
        +
        +

        +

        +
          +
        • +
        • +
        +
        +
        +

        +

        main->URL('backend')).'edit.php?post_type=mec-books">'.esc_html__('Bookings', 'modern-events-calendar-lite').''); ?>

        +
        + + + +
        +
        +
        \ No newline at end of file diff --git a/app/features/ix/export_g_calendar.php b/app/features/ix/export_g_calendar.php new file mode 100755 index 0000000..3b29de2 --- /dev/null +++ b/app/features/ix/export_g_calendar.php @@ -0,0 +1,189 @@ +main->get_events('-1', array('publish', 'pending', 'future', 'draft', 'private')); +$ix_options = $this->main->get_ix_options(); + +// Start the export process if token is exists +if(isset($ix_options['google_export_token']) && $ix_options['google_export_token']) $this->action = 'google-calendar-export-start'; +?> +
        +

        + +
        +
        +
        +

        +

        '.esc_url($this->main->add_qs_vars(array('mec-ix-action'=>'google-calendar-export-get-token'), $this->main->URL('backend').'admin.php?page=MEC-ix&tab=MEC-g-calendar-export')).''); ?>

        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        +

        +
        +
        + action == 'google-calendar-export-start'): ?> +
        +
        +
          +
        • +
        • +
        • +
        +
          + +
        • + +
        • + +
        +
        +

        +
        + +
        + +
        +

        +
        +
        + +
        +
        +
        + +factory->params('footer', function() +{ + ?> + + main->get_integrated_plugins_for_import(); +?> +
        +

        + +
        +
        +

        +
        +
        +

        '.esc_html__('Modern Events Calendar', 'modern-events-calendar-lite').''); ?>

        +
        +
        + + + + +
        +
        + + action == 'import-start-xml'): ?> +
        + response['success'] == 0): ?> +
        response['message']); ?>
        + +
        response['message']); ?>
        + +
        + + +

        + getPRO()): ?> +
        +
        +

        '.esc_html__('Modern Events Calendar', 'modern-events-calendar-lite').''); ?>

        +
        +
        + + + + +
        +
        + +
        main->get_pro_link()).'" target="_blank">'.esc_html__('Pro version of Modern Events Calendar', 'modern-events-calendar-lite').''); ?>
        + + + action == 'import-start-ics'): ?> +
        + response['success'] == 0): ?> +
        response['message']); ?>
        + +
        response['message']); ?>
        + +
        + + + + +

        + getPRO()): ?> +
        +
        +

        '.esc_html__('Modern Events Calendar', 'modern-events-calendar-lite').''); ?>

        +

        main->asset('files/sample.csv')).'">sample.csv'); ?>

        +

        +
        +
        + + + + +
        +
        + +
        main->get_pro_link()).'" target="_blank">'.esc_html__('Pro version of Modern Events Calendar', 'modern-events-calendar-lite').''); ?>
        + + + action == 'import-start-bookings'): ?> +
        + response['success'] == 0): ?> +
        response['message']); ?>
        + +
        response['message']); ?>
        + +
        + +
        + + +
        +
        \ No newline at end of file diff --git a/app/features/ix/import_f_calendar.php b/app/features/ix/import_f_calendar.php new file mode 100755 index 0000000..a5a03b8 --- /dev/null +++ b/app/features/ix/import_f_calendar.php @@ -0,0 +1,112 @@ +main->get_ix_options(); +?> +
        +

        + +
        +
        + +

        + + + action == 'facebook-calendar-import-start'): ?> +
        + response['success'] == 0): ?> +
        response['message']); ?>
        + +
        +
        +

        +
        '.esc_html($this->response['data']['count']).'', ''.esc_html($this->response['data']['name']).''); ?>
        +
          +
        • +
        • +
        • +
        +
          + response['data']['events'] as $event): if(trim($event['name']) == '') continue; ?> +
        • + +
        • + +
        +
        +
        +

        +
        + +
        +
        + +
        +
        + +
        + + + + +
        +
        + +
        + action == 'facebook-calendar-import-do'): ?> +
        + response['success'] == 0): ?> +
        response['message']); ?>
        + +
        '.count($this->response['data']).''); ?>
        + +
        + + +
        +
        +
        \ No newline at end of file diff --git a/app/features/ix/import_g_calendar.php b/app/features/ix/import_g_calendar.php new file mode 100755 index 0000000..d401843 --- /dev/null +++ b/app/features/ix/import_g_calendar.php @@ -0,0 +1,129 @@ +main->get_ix_options(); +?> +
        +

        + +
        +
        +
        +
        +

        +

        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + + +
        +
        + action == 'google-calendar-import-start'): ?> +
        + response['success'] == 0): ?> +
        response['error']); ?>
        + +
        +
        +

        +
        '.esc_html($this->response['data']['count']).'', ''.esc_html($this->response['data']['title']).''); ?>
        +
          +
        • +
        • +
        • +
        +
          + main->get_timezone(); foreach($this->response['data']['events'] as $event): if(trim($event['title']) == '') continue; ?> + date) && trim($event['start']->date)) + ? $event['start']->date + : $event['start']->dateTime + )); + if($timezone != $this->response['data']['timezone']) $date_start->setTimezone(new DateTimeZone($timezone)); + + $date_end = new DateTime(( + (isset($event['end']->date) && trim($event['end']->date)) + ? $event['end']->date + : $event['end']->dateTime + )); + if($timezone != $this->response['data']['timezone']) $date_end->setTimezone(new DateTimeZone($timezone)); + ?> +
        • + +
        • + +
        +
        +
        +

        +
        + +
        +
        + +
        + + + + +
        +
        + +
        + action == 'google-calendar-import-do'): ?> +
        + response['success'] == 0): ?> +
        response['error']); ?>
        + +
        '.count($this->response['data']).''); ?>
        + +
        + +
        +
        +
        +
        \ No newline at end of file diff --git a/app/features/ix/import_meetup.php b/app/features/ix/import_meetup.php new file mode 100755 index 0000000..afefbca --- /dev/null +++ b/app/features/ix/import_meetup.php @@ -0,0 +1,121 @@ +main->get_ix_options(); +?> +
        +

        + +
        +
        +
        + action === 'meetup-import-config'): ?> +
        +

        +

        https://www.meetup.com/api/oauth/list/'); ?>

        +

        '.get_home_url().''); ?>

        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +

        blahblahblah'); ?>

        +
        + + +
        +
        + action === 'meetup-import-login'): ?> + + action === 'meetup-import-start'): ?> +
        + response['success'] == 0): ?> +
        response['error']); ?>
        + + +
        +
        +

        +
        '.esc_html($this->response['data']['count']).'', ''.esc_html($this->response['data']['title']).''); ?>
        +
          +
        • +
        • +
        • +
        +
          + response['data']['events'] as $event): ?> +
        • + +
        • + +
        +
        +
        +

        +
        + +
        +
        + +
        + + + + +
        +
        + +
        + action == 'meetup-import-do'): ?> +
        + response['success'] == 0): ?> +
        response['error']); ?>
        + +
        '.count($this->response['data']).''); ?>
        +
        :
        + +
        + +
        +
        +
        +
        \ No newline at end of file diff --git a/app/features/ix/index.html b/app/features/ix/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/features/ix/sync.php b/app/features/ix/sync.php new file mode 100755 index 0000000..d799d72 --- /dev/null +++ b/app/features/ix/sync.php @@ -0,0 +1,118 @@ +main->get_ix_options(); +?> +
        +

        + +
        +
        + main->getPRO()): ?> +
        main->get_pro_link()).'" target="_blank">'.esc_html__('Pro version of Modern Events Calendar', 'modern-events-calendar-lite').''); ?>
        + +
        +
        + + +
        +
        + +

        : '.esc_html($cron).''); ?>

        +
        +
        + + +
        +
        + +
        +
        + +
        +
        +
        +
        + : '.esc_html($cron).''); ?> +
        +
        +
        + + +
        + + +
        +
        + +

        : '.esc_html($cron).''); ?>

        +
        + + +
        + + +
        +
        + +

        : '.esc_html($cron).''); ?>

        +
        + +
        +

        +

        -

        +

        -

        + + + + + + + +
        + +
        + + +
        +
        + +
        +
        +
        \ No newline at end of file diff --git a/app/features/ix/test_data.php b/app/features/ix/test_data.php new file mode 100755 index 0000000..ad93281 --- /dev/null +++ b/app/features/ix/test_data.php @@ -0,0 +1,115 @@ + 'mec_category', + 'hide_empty' => 0, +)); +$tags = get_terms(array( + 'taxonomy' => apply_filters('mec_taxonomy_tag', ''), + 'hide_empty' => 0, +)); +$locations = get_terms(array( + 'taxonomy' => 'mec_location', + 'hide_empty' => 0, +)); +$organizers = get_terms(array( + 'taxonomy' => 'mec_organizer', + 'hide_empty' => 0, +)); +?> +
        +

        + +
        +
        +

        +
        +
        +

        +
        +
        + + +
        +
        + + +
        +
        + + +
        +
        + + +
        +
        + + +
        +
        + + + +
        +
        + + action == 'test-data-generation-start'): ?> +
        + response['success'] == 0): ?> +
        response['message']); ?>
        + +
        response['message']); ?>
        + +
        + +
        + + +
        +
        \ No newline at end of file diff --git a/app/features/ix/thirdparty.php b/app/features/ix/thirdparty.php new file mode 100755 index 0000000..655ea1d --- /dev/null +++ b/app/features/ix/thirdparty.php @@ -0,0 +1,215 @@ +main->get_integrated_plugins_for_import(); +?> +
        +

        + +
        +
        +

        +
        +
        +

        '.esc_html__('Modern Events Calendar', 'modern-events-calendar-lite').''); ?>

        +
        +
        + + + +
        +
        + + action == 'thirdparty-import-start'): ?> +
        + response['success'] == 0): ?> +
        response['message']); ?>
        + response['data']['count']) && !$this->response['data']['count']): ?> +
        + +
        +
        +
        +

        +
        '.esc_html($this->response['data']['count']).''); ?>
        +
          +
        • +
        • +
        • +
        +
          + response['data']['events'] as $event): if(trim($event->post_title) == '') continue; ?> +
        • + +
        • + +
        +
        +
        +

        + + ix['third-party'], array('event-espresso', 'events-manager-single', 'events-manager-recurring'))): ?> +
        + +
        + + + ix['third-party'], array('the-events-calendar'))): ?> +
        + +
        + + +
        + +
        +
        + +
        +
        + +
        + + + +
        +
        + +
        +
        + +
        + action == 'thirdparty-import-do'): ?> +
        + response['success'] == 0): ?> +
        response['message']); ?>
        + +
        '.esc_html($this->response['data']).''); ?>
        +
        :
        + +
        + +
        +
        +
        +factory->params('footer', function() +{ + ?> + + + */ +class MEC_feature_labels extends MEC_base +{ + /** + * @var MEC_factory + */ + public $factory; + + /** + * @var MEC_main + */ + public $main; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Factory + $this->factory = $this->getFactory(); + + // Import MEC Main + $this->main = $this->getMain(); + } + + /** + * Initialize label feature + * @author Webnus + */ + public function init() + { + $this->factory->action('init', array($this, 'register_taxonomy'), 15); + $this->factory->action('mec_label_edit_form_fields', array($this, 'edit_form')); + $this->factory->action('mec_label_add_form_fields', array($this, 'add_form')); + $this->factory->action('edited_mec_label', array($this, 'save_metadata')); + $this->factory->action('created_mec_label', array($this, 'save_metadata')); + + $this->factory->action('add_meta_boxes', array($this, 'register_meta_boxes')); + + $this->factory->filter('manage_edit-mec_label_columns', array($this, 'filter_columns')); + $this->factory->filter('manage_mec_label_custom_column', array($this, 'filter_columns_content'), 10, 3); + + $this->factory->action('save_post', array($this, 'save_event'), 3); + } + + /** + * Register label taxonomy + * @author Webnus + */ + public function register_taxonomy() + { + $singular_label = $this->main->m('taxonomy_label', esc_html__('Label', 'modern-events-calendar-lite')); + $plural_label = $this->main->m('taxonomy_labels', esc_html__('Labels', 'modern-events-calendar-lite')); + + $label_args = apply_filters( + 'mec_register_taxonomy_args', + array( + 'label'=>$plural_label, + 'labels'=>array( + 'name'=>$plural_label, + 'singular_name'=>$singular_label, + 'all_items'=>sprintf(esc_html__('All %s', 'modern-events-calendar-lite'), $plural_label), + 'edit_item'=>sprintf(esc_html__('Edit %s', 'modern-events-calendar-lite'), $singular_label), + 'view_item'=>sprintf(esc_html__('View %s', 'modern-events-calendar-lite'), $singular_label), + 'update_item'=>sprintf(esc_html__('Update %s', 'modern-events-calendar-lite'), $singular_label), + 'add_new_item'=>sprintf(esc_html__('Add New %s', 'modern-events-calendar-lite'), $singular_label), + 'new_item_name'=>sprintf(esc_html__('New %s Name', 'modern-events-calendar-lite'), $singular_label), + 'popular_items'=>sprintf(esc_html__('Popular %s', 'modern-events-calendar-lite'), $plural_label), + 'search_items'=>sprintf(esc_html__('Search %s', 'modern-events-calendar-lite'), $plural_label), + 'back_to_items'=>sprintf(esc_html__('← Back to %s', 'modern-events-calendar-lite'), $plural_label), + 'not_found'=>sprintf(esc_html__('no %s found.', 'modern-events-calendar-lite'), strtolower($plural_label)), + ), + 'rewrite'=>array('slug'=>'events-label'), + 'public'=>false, + 'show_ui'=>true, + 'hierarchical'=>false, + ), + 'mec_label' + ); + register_taxonomy( + 'mec_label', + $this->main->get_main_post_type(), + $label_args + ); + + register_taxonomy_for_object_type('mec_label', $this->main->get_main_post_type()); + } + + /** + * Show edit form of labels + * @author Webnus + * @param object $term + */ + public function edit_form($term) + { + $color = get_metadata('term', $term->term_id, 'color', true); + $style = get_metadata('term', $term->term_id, 'style', true); + ?> + + + + + + +

        + + + + + + + + +

        + + + + */ + public function add_form() + { + ?> +
        + + +

        +
        +
        + + +

        +
        + + * @param int $term_id + */ + public function save_metadata($term_id) + { + // Quick Edit + if(!isset($_POST['color'])) return; + + $color = isset($_POST['color']) ? sanitize_text_field($_POST['color']) : $this->main->get_default_label_color(); + update_term_meta($term_id, 'color', $color); + + $style = isset($_POST['style']) ? sanitize_text_field($_POST['style']) : ''; + update_term_meta($term_id, 'style', $style); + } + + /** + * Filter label taxonomy columns + * @author Webnus + * @param array $columns + * @return array + */ + public function filter_columns($columns) + { + unset($columns['name']); + unset($columns['slug']); + unset($columns['description']); + unset($columns['posts']); + + $columns['id'] = esc_html__('ID', 'modern-events-calendar-lite'); + $columns['name'] = esc_html__('Name', 'modern-events-calendar-lite'); + $columns['color'] = esc_html__('Color', 'modern-events-calendar-lite'); + $columns['posts'] = esc_html__('Count', 'modern-events-calendar-lite'); + $columns['slug'] = esc_html__('Slug', 'modern-events-calendar-lite'); + + return $columns; + } + + /** + * Filter content of label taxonomy + * @author Webnus + * @param string $content + * @param string $column_name + * @param int $term_id + * @return string + */ + public function filter_columns_content($content, $column_name, $term_id) + { + switch($column_name) + { + case 'id': + + $content = $term_id; + break; + + case 'color': + + $content = ''; + break; + + default: + break; + } + + return $content; + } + + /** + * Register meta box of labels + * @author Webnus + */ + public function register_meta_boxes() + { + add_meta_box('mec_metabox_label', sprintf(esc_html__('Event %s', 'modern-events-calendar-lite'), $this->main->m('taxonomy_labels', esc_html__('Labels', 'modern-events-calendar-lite'))), array($this, 'meta_box_labels'), $this->main->get_main_post_type(), 'side'); + } + + /** + * Show meta box of labels + * @author Webnus + * @param object $post + */ + public function meta_box_labels($post) + { + $labels = get_terms('mec_label', array('orderby'=>'name', 'order'=>'ASC', 'hide_empty'=>'0')); + $terms = wp_get_post_terms($post->ID, 'mec_label', array('fields'=>'ids')); + ?> +
        +
        + +
        + + +
        + +
        +
        + + * @param int $post_id + * @return void + */ + public function save_event($post_id) + { + // Check if our nonce is set. + if(!isset($_POST['mec_event_nonce'])) return; + + // Verify that the nonce is valid. + if(!wp_verify_nonce(sanitize_text_field($_POST['mec_event_nonce']), 'mec_event_data')) return; + + // If this is an autosave, our form has not been submitted, so we don't want to do anything. + if(defined('DOING_AUTOSAVE') and DOING_AUTOSAVE) return; + + // Get Modern Events Calendar Data + $_mec = isset($_POST['mec']) ? $this->main->sanitize_deep_array($_POST['mec']) : []; + + $_labels = isset($_mec['labels']) ? (array) $_mec['labels'] : []; + + $_labels = array_map('sanitize_text_field', $_labels); + $_labels = array_map('intval', $_labels); + $_labels = array_unique($_labels); + + wp_set_object_terms($post_id, $_labels, 'mec_label'); + } +} \ No newline at end of file diff --git a/app/features/locations.php b/app/features/locations.php new file mode 100755 index 0000000..8d81ed3 --- /dev/null +++ b/app/features/locations.php @@ -0,0 +1,437 @@ + + */ +class MEC_feature_locations extends MEC_base +{ + public $factory; + public $main; + public $settings; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Factory + $this->factory = $this->getFactory(); + + // Import MEC Main + $this->main = $this->getMain(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + } + + /** + * Initialize locations feature + * @author Webnus + */ + public function init() + { + $this->factory->action('init', array($this, 'register_taxonomy'), 20); + $this->factory->action('mec_location_edit_form_fields', array($this, 'edit_form')); + $this->factory->action('mec_location_add_form_fields', array($this, 'add_form')); + $this->factory->action('edited_mec_location', array($this, 'save_metadata')); + $this->factory->action('created_mec_location', array($this, 'save_metadata')); + + $this->factory->action('mec_metabox_details', array($this, 'meta_box_location'), 30); + if(!isset($this->settings['fes_section_location']) or (isset($this->settings['fes_section_location']) and $this->settings['fes_section_location'])) $this->factory->action('mec_fes_metabox_details', array($this, 'meta_box_location'), 30); + + $this->factory->filter('manage_edit-mec_location_columns', array($this, 'filter_columns')); + $this->factory->filter('manage_mec_location_custom_column', array($this, 'filter_columns_content'), 10, 3); + + $this->factory->action('save_post', array($this, 'save_event'), 1); + } + + /** + * Registers location taxonomy + * @author Webnus + */ + public function register_taxonomy() + { + $singular_label = $this->main->m('taxonomy_location', esc_html__('Location', 'modern-events-calendar-lite')); + $plural_label = $this->main->m('taxonomy_locations', esc_html__('Locations', 'modern-events-calendar-lite')); + + $location_args = apply_filters( + 'mec_register_taxonomy_args', + array( + 'label'=>$plural_label, + 'labels'=>array( + 'name'=>$plural_label, + 'singular_name'=>$singular_label, + 'all_items'=>sprintf(esc_html__('All %s', 'modern-events-calendar-lite'), $plural_label), + 'edit_item'=>sprintf(esc_html__('Edit %s', 'modern-events-calendar-lite'), $singular_label), + 'view_item'=>sprintf(esc_html__('View %s', 'modern-events-calendar-lite'), $singular_label), + 'update_item'=>sprintf(esc_html__('Update %s', 'modern-events-calendar-lite'), $singular_label), + 'add_new_item'=>sprintf(esc_html__('Add New %s', 'modern-events-calendar-lite'), $singular_label), + 'new_item_name'=>sprintf(esc_html__('New %s Name', 'modern-events-calendar-lite'), $singular_label), + 'popular_items'=>sprintf(esc_html__('Popular %s', 'modern-events-calendar-lite'), $plural_label), + 'search_items'=>sprintf(esc_html__('Search %s', 'modern-events-calendar-lite'), $plural_label), + 'back_to_items'=>sprintf(esc_html__('← Back to %s', 'modern-events-calendar-lite'), $plural_label), + 'not_found'=>sprintf(esc_html__('no %s found.', 'modern-events-calendar-lite'), strtolower($plural_label)), + ), + 'rewrite'=>array('slug'=>'events-location'), + 'public'=>false, + 'show_ui'=>true, + 'hierarchical'=>false, + ), + 'mec_location' + ); + register_taxonomy( + 'mec_location', + $this->main->get_main_post_type(), + $location_args + ); + + register_taxonomy_for_object_type('mec_location', $this->main->get_main_post_type()); + } + + /** + * Show edit form of location taxonomy + * @author Webnus + * @param object $term + */ + public function edit_form($term) + { + $this->main->load_map_assets(true); + + $address = get_metadata('term', $term->term_id, 'address', true); + $opening_hour = get_metadata('term', $term->term_id, 'opening_hour', true); + $latitude = get_metadata('term', $term->term_id, 'latitude', true); + $longitude = get_metadata('term', $term->term_id, 'longitude', true); + $url = get_metadata('term', $term->term_id, 'url', true); + $tel = get_metadata('term', $term->term_id, 'tel', true); + $thumbnail = get_metadata('term', $term->term_id, 'thumbnail', true); + + // Map Options + $status = $this->settings['google_maps_status'] ?? 1; + $api_key = $this->settings['google_maps_api_key'] ?? ''; + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        '; ?>
        + + + + + + + */ + public function add_form() + { + $this->main->load_map_assets(true); + + // Map Options + $status = $this->settings['google_maps_status'] ?? 1; + $api_key = $this->settings['google_maps_api_key'] ?? ''; + ?> +
        + + + + + + +
        +
        + + +
        +
        + + +
        +
        + + +
        +
        + + +
        +
        + + +
        + +
        + +
        + + + +
        + + * @param int $term_id + */ + public function save_metadata($term_id) + { + // Quick Edit + if(!isset($_POST['address'])) return; + + $address = sanitize_text_field($_POST['address']); + $opening_hour = isset($_POST['opening_hour']) ? sanitize_text_field($_POST['opening_hour']) : ''; + $latitude = isset($_POST['latitude']) ? sanitize_text_field($_POST['latitude']) : '0'; + $longitude = isset($_POST['longitude']) ? sanitize_text_field($_POST['longitude']) : '0'; + $url = (isset($_POST['url']) and trim($_POST['url'])) ? sanitize_url($_POST['url']) : ''; + $tel = (isset($_POST['tel']) and trim($_POST['tel'])) ? sanitize_text_field($_POST['tel']) : ''; + $thumbnail = isset($_POST['thumbnail']) ? sanitize_text_field($_POST['thumbnail']) : ''; + + // Geo Point is Empty or Address Changed + if(!floatval($latitude) or !floatval($longitude) or (trim($address) and ($address != get_term_meta($term_id, 'address', true)))) + { + $geo_point = $this->main->get_lat_lng($address); + + if(isset($geo_point[0]) and trim($geo_point[0])) $latitude = $geo_point[0]; + if(isset($geo_point[1]) and trim($geo_point[1])) $longitude = $geo_point[1]; + } + + update_term_meta($term_id, 'address', $address); + update_term_meta($term_id, 'opening_hour', $opening_hour); + update_term_meta($term_id, 'latitude', $latitude); + update_term_meta($term_id, 'longitude', $longitude); + update_term_meta($term_id, 'url', $url); + update_term_meta($term_id, 'tel', $tel); + update_term_meta($term_id, 'thumbnail', $thumbnail); + + do_action('mec_save_location_extra_fields', $term_id); + } + + /** + * Filter columns of location taxonomy + * @author Webnus + * @param array $columns + * @return array + */ + public function filter_columns($columns) + { + unset($columns['name']); + unset($columns['slug']); + unset($columns['description']); + unset($columns['posts']); + + $columns['id'] = esc_html__('ID', 'modern-events-calendar-lite'); + $columns['name'] = esc_html__('Location', 'modern-events-calendar-lite'); + $columns['address'] = esc_html__('Address', 'modern-events-calendar-lite'); + $columns['posts'] = esc_html__('Count', 'modern-events-calendar-lite'); + $columns['slug'] = esc_html__('Slug', 'modern-events-calendar-lite'); + + return $columns; + } + + /** + * Filter content of location taxonomy columns + * @author Webnus + * @param string $content + * @param string $column_name + * @param int $term_id + * @return string + */ + public function filter_columns_content($content, $column_name, $term_id) + { + switch($column_name) + { + case 'id': + + $content = $term_id; + break; + + case 'address': + + $content = get_metadata('term', $term_id, 'address', true); + break; + + default: + break; + } + + return $content; + } + + /** + * Show location meta box + * @author Webnus + * @param WP_Post|object $post + */ + public function meta_box_location($post) + { + FormBuilder::locations( $post ); + } + + /** + * Save event location data + * @author Webnus + * @param int $post_id + * @return boolean + */ + public function save_event($post_id) + { + // Check if our nonce is set. + if(!isset($_POST['mec_event_nonce'])) return false; + + // Verify that the nonce is valid. + if(!wp_verify_nonce(sanitize_text_field($_POST['mec_event_nonce']), 'mec_event_data')) return false; + + // If this is an autosave, our form has not been submitted, so we don't want to do anything. + if(defined('DOING_AUTOSAVE') and DOING_AUTOSAVE) return false; + + $action = (isset($_POST['action']) ? sanitize_text_field($_POST['action']) : ''); + if($action === 'mec_fes_form') return false; + + // Get Modern Events Calendar Data + $_mec = isset($_POST['mec']) ? $this->main->sanitize_deep_array($_POST['mec']) : []; + + // Selected a saved location + if(isset($_mec['location_id']) and $_mec['location_id']) + { + // Set term to the post + wp_set_object_terms($post_id, (int) sanitize_text_field($_mec['location_id']), 'mec_location'); + + return true; + } + + $address = (isset($_mec['location']['address']) and trim($_mec['location']['address'])) ? sanitize_text_field($_mec['location']['address']) : ''; + $opening_hour = (isset($_mec['location']['opening_hour']) and trim($_mec['location']['opening_hour'])) ? sanitize_text_field($_mec['location']['opening_hour']) : ''; + $name = (isset($_mec['location']['name']) and trim($_mec['location']['name'])) ? sanitize_text_field($_mec['location']['name']) : (trim($address) ? $address : esc_html__('Location Name', 'modern-events-calendar-lite')); + + $term = get_term_by('name', $name, 'mec_location'); + + // Term already exists + if(is_object($term) and isset($term->term_id)) + { + // Set term to the post + wp_set_object_terms($post_id, (int) $term->term_id, 'mec_location'); + + return true; + } + + $term = wp_insert_term($name, 'mec_location'); + + // An error occurred + if(is_wp_error($term)) return false; + + $location_id = $term['term_id']; + if(!$location_id) return false; + + // Set Location ID to the parameters + $_POST['mec']['location_id'] = $location_id; + + // Set term to the post + wp_set_object_terms($post_id, (int) $location_id, 'mec_location'); + + $latitude = isset($_mec['location']['latitude']) && trim($_mec['location']['latitude']) ? sanitize_text_field($_mec['location']['latitude']) : 0; + $longitude = isset($_mec['location']['longitude']) && trim($_mec['location']['longitude']) ? sanitize_text_field($_mec['location']['longitude']) : 0; + $url = isset($_mec['location']['url']) && trim($_mec['location']['url']) ? sanitize_url($_mec['location']['url']) : ''; + $tel = isset($_mec['location']['tel']) && trim($_mec['location']['tel']) ? sanitize_text_field($_mec['location']['tel']) : ''; + $thumbnail = isset($_mec['location']['thumbnail']) && trim($_mec['location']['thumbnail']) ? sanitize_text_field($_mec['location']['thumbnail']) : ''; + + if((!trim($latitude) or !trim($longitude)) and trim($address)) + { + $geo_point = $this->main->get_lat_lng($address); + + if(isset($geo_point[0]) and trim($geo_point[0])) $latitude = $geo_point[0]; + if(isset($geo_point[1]) and trim($geo_point[1])) $longitude = $geo_point[1]; + } + + update_term_meta($location_id, 'address', $address); + update_term_meta($location_id, 'opening_hour', $opening_hour); + update_term_meta($location_id, 'latitude', $latitude); + update_term_meta($location_id, 'longitude', $longitude); + update_term_meta($location_id, 'url', $url); + update_term_meta($location_id, 'tel', $tel); + update_term_meta($location_id, 'thumbnail', $thumbnail); + + return true; + } +} \ No newline at end of file diff --git a/app/features/login.php b/app/features/login.php new file mode 100755 index 0000000..3eac1c1 --- /dev/null +++ b/app/features/login.php @@ -0,0 +1,73 @@ + + */ +class MEC_feature_login extends MEC_base +{ + public $factory; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Factory + $this->factory = $this->getFactory(); + } + + /** + * Initialize search feature + * @author Webnus + */ + public function init() + { + // login form shortcode + $this->factory->shortcode('MEC_login', array($this, 'login')); + + $this->factory->action('wp_ajax_mec_ajax_login_data', array($this, 'mec_ajax_login_data')); + $this->factory->action('wp_ajax_nopriv_mec_ajax_login_data', array($this, 'mec_ajax_login_data')); + } + + public function mec_ajax_login_data() + { + // Check if our nonce is set. + if(!isset($_POST['mec_login_nonce'])) return; + + // Verify that the nonce is valid. + if(!wp_verify_nonce(sanitize_text_field($_POST['mec_login_nonce']), 'mec-ajax-login-nonce')) return; + + $info = []; + $info['user_login'] = sanitize_text_field($_POST['username']); + $info['user_password'] = sanitize_text_field($_POST['password']); + $info['remember'] = true; + + $user_signon = wp_signon($info, true); // secure_cookie set true. + if(is_wp_error($user_signon)) + { + echo json_encode(array('loggedin'=>false, 'message'=>__(''.esc_html__('Wrong username or password, reloading...', 'modern-events-calendar-lite').''))); + } + else + { + echo json_encode(array('loggedin'=>true, 'message'=>__(''.esc_html__('Login successful, redirecting...', 'modern-events-calendar-lite').''))); + } + + die(); + } + + /** + * Show user login form + * @return string + */ + public function login() + { + $path = MEC::import('app.features.login.login', true, true); + + ob_start(); + include $path; + return ob_get_clean(); + } +} \ No newline at end of file diff --git a/app/features/login/index.html b/app/features/login/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/features/login/login.php b/app/features/login/login.php new file mode 100755 index 0000000..f875674 --- /dev/null +++ b/app/features/login/login.php @@ -0,0 +1,156 @@ + + +factory->params('footer', function() +{ + ?> + + + */ +class MEC_feature_maintenance extends MEC_base +{ + public $factory; + public $main; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Factory + $this->factory = $this->getFactory(); + + // Main Library + $this->main = $this->getMain(); + } + + /** + * Initialize maintenance feature + * + * @author Webnus + */ + public function init() + { + $this->factory->action('mec_maintenance', [$this, 'maintenance']); + } + + /** + * MEC Maintenance Jobs + * + * @return void + */ + public function maintenance() + { + // Settings + $settings = $this->main->get_settings(); + + // Trash Interval + $trash_interval = isset($settings['events_trash_interval']) ? (int) $settings['events_trash_interval'] : 0; + + // Do Events Trash + if ($trash_interval) $this->events('trash', $trash_interval); + + // Purge Interval + $purge_interval = isset($settings['events_purge_interval']) ? (int) $settings['events_purge_interval'] : 0; + + // Do Events Purge + if ($purge_interval) $this->events('purge', $purge_interval); + } + + public function events($type, $interval) + { + // Date + $date = date('Y-m-d', strtotime('-' . $interval . ' Days')); + + // DB + $db = $this->getDB(); + + // Events + $event_ids = $db->select("SELECT post_id FROM `#__mec_dates` WHERE `dend` < '" . $date . "' GROUP BY post_id ORDER BY dend DESC", 'loadColumn'); + + // Upcoming Events + $upcoming_events = $this->main->get_upcoming_event_ids(); + + // Trash / Purge + foreach ($event_ids as $event_id) + { + // Event is still ongoing + if (in_array($event_id, $upcoming_events)) continue; + + if ($type === 'trash') wp_trash_post($event_id); + else if ($type === 'purge') wp_delete_post($event_id, true); + } + } +} diff --git a/app/features/mec.php b/app/features/mec.php new file mode 100755 index 0000000..e459d65 --- /dev/null +++ b/app/features/mec.php @@ -0,0 +1,2147 @@ + + */ +class MEC_feature_mec extends MEC_base +{ + /** + * @var MEC_factory + */ + public $factory; + + /** + * @var MEC_db + */ + public $db; + + /** + * @var MEC_main + */ + public $main; + + /** + * @var MEC_notifications + */ + public $notifications; + public $settings; + public $ml_settings; + public $page; + public $PT; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Factory + $this->factory = $this->getFactory(); + + // Import MEC DB + $this->db = $this->getDB(); + + // Import MEC Main + $this->main = $this->getMain(); + + // Import MEC Notifications + $this->notifications = $this->getNotifications(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + + // MEC Multilingual Settings + $this->ml_settings = $this->main->get_ml_settings(); + } + + /** + * Initialize calendars feature + * @author Webnus + */ + public function init() + { + $this->factory->action('admin_menu', [$this, 'menus']); + $this->factory->action('admin_menu', [$this, 'support_menu'], 21); + $this->factory->action('init', [$this, 'register_post_type']); + $this->factory->action('add_meta_boxes', [$this, 'register_meta_boxes'], 1); + $this->factory->filter('post_row_actions', [$this, 'action_links'], 10, 2); + $this->factory->action('admin_init', [$this, 'duplicate_shortcode']); + + $this->factory->action('parent_file', [$this, 'mec_parent_menu_highlight']); + $this->factory->action('submenu_file', [$this, 'mec_sub_menu_highlight']); + + $this->factory->action('current_screen', [$this, 'booking_badge']); + $this->factory->action('current_screen', [$this, 'events_badge']); + + // Google Maps API + $this->factory->filter('mec_gm_include', [$this, 'gm_include']); + + $this->factory->filter('manage_mec_calendars_posts_columns', [$this, 'filter_columns']); + $this->factory->action('manage_mec_calendars_posts_custom_column', [$this, 'filter_columns_content'], 10, 2); + + $this->factory->action('save_post', [$this, 'save_calendar']); + + // BuddyPress Integration + $this->factory->action('mec_booking_confirmed', [$this->main, 'bp_add_activity']); + $this->factory->action('mec_booking_verified', [$this->main, 'bp_add_activity']); + $this->factory->action('bp_register_activity_actions', [$this->main, 'bp_register_activity_actions']); + $this->factory->action('bp_setup_nav', [$this->main, 'bp_add_profile_menu']); + + // Mailchimp Integration + $this->factory->action('mec_booking_verified', [$this->main, 'mailchimp_add_subscriber']); + + // Campaign Monitor Integration + $this->factory->action('mec_booking_verified', [$this->main, 'campaign_monitor_add_subscriber']); + + // MailerLite Integration + $this->factory->action('mec_booking_verified', [$this->main, 'mailerlite_add_subscriber']); + + // Constant Contact Integration + $this->factory->action('mec_booking_verified', [$this->main, 'constantcontact_add_subscriber']); + + // Active Campaign Integration + $this->factory->action('mec_booking_verified', [$this->main, 'active_campaign_add_subscriber']); + + // AWeber Integration + $this->factory->action('mec_booking_verified', [$this->main, 'aweber_add_subscriber']); + + // MailPoet Integration + $this->factory->action('mec_booking_verified', [$this->main, 'mailpoet_add_subscriber']); + + // Sendfox Integration + $this->factory->action('mec_booking_verified', [$this->main, 'sendfox_add_subscriber']); + + $booking_notification_hook = 'mec_booking_completed'; + if (isset($this->settings['notification_gdpr']) && $this->settings['notification_gdpr']) $booking_notification_hook = 'mec_booking_verified'; + + // MEC Notifications + $this->factory->action('mec_booking_completed', [$this->notifications, 'email_verification']); + $this->factory->action($booking_notification_hook, [$this->notifications, 'booking_notification'], 11); + $this->factory->action('mec_booking_completed', [$this->notifications, 'admin_notification'], 12); + $this->factory->action('mec_booking_confirmed', [$this->notifications, 'booking_confirmation'], 10, 2); + $this->factory->action('mec_booking_canceled', [$this->notifications, 'booking_cancellation'], 12); + $this->factory->action('mec_booking_rejected', [$this->notifications, 'booking_rejection'], 12); + $this->factory->action('mec_fes_added', [$this->notifications, 'new_event'], 50, 2); + $this->factory->action('mec_after_publish_admin_event', [$this->notifications, 'new_event'], 10, 2); + $this->factory->action('mec_event_published', [$this->notifications, 'user_event_publishing'], 10, 3); + $this->factory->action('mec_event_soldout', [$this->notifications, 'event_soldout'], 10, 2); + $this->factory->action('mec_booking_moved_notify', [$this->notifications, 'booking_moved'], 11); + + $this->page = isset($_GET['page']) ? sanitize_text_field($_GET['page']) : 'MEC-settings'; + + // MEC Post Type Name + $this->PT = $this->main->get_main_post_type(); + + // Disable Block Editor + $gutenberg_status = (!isset($this->settings['gutenberg']) || (isset($this->settings['gutenberg']) && $this->settings['gutenberg'])); + if ($gutenberg_status) + { + $this->factory->filter('gutenberg_can_edit_post_type', [$this, 'gutenberg'], 10, 2); + $this->factory->filter('use_block_editor_for_post_type', [$this, 'gutenberg'], 10, 2); + } + + // Export Settings + $this->factory->action('wp_ajax_download_settings', [$this, 'download_settings']); + + // Import Settings + $this->factory->action('wp_ajax_import_settings', [$this, 'import_settings']); + + // License Activation + $this->factory->action('wp_ajax_activate_license', [$this, 'activate_license']); + $this->factory->action('wp_ajax_revoke_license', [$this, 'revoke_license']); + + // Close Notification + $this->factory->action('wp_ajax_close_notification', [$this, 'close_notification']); + + // Close Custom Text Notification + $this->factory->action('wp_ajax_close_cmsg_notification', [$this, 'close_cmsg_notification']); + $this->factory->action('wp_ajax_close_cmsg_2_notification', [$this, 'close_cmsg_2_notification']); + + // Occurrences Dropdown + $this->factory->action('wp_ajax_mec_occurrences_dropdown', [$this, 'dropdown']); + + // Scheduler Cronjob + $schedule = $this->getSchedule(); + $this->factory->action('mec_scheduler', [$schedule, 'cron']); + + $syncSchedule = $this->getSyncSchedule(); + $this->factory->action('mec_syncScheduler', [$syncSchedule, 'sync']); + + // Dashboard Metaboxes + $this->factory->action('wp_dashboard_setup', [$this, 'dashboard_widgets']); + + // Dashboard Metabox Total Booking ajax + $this->factory->action('wp_ajax_total-booking-get-reports', [$this, 'dashboard_widget_total_booking_ajax_handler']); + + // Custom Capability Map + if (is_admin()) $this->factory->filter('map_meta_cap', [$this, 'map_meta_cap'], 10, 4); + + // Protected Content Shortcode + if ($this->getPRO()) $this->factory->shortcode('mec-only-booked-users', [$this, 'only_booked_users_content']); + + // Assets Per Page + if (!function_exists('is_plugin_active')) include_once ABSPATH . 'wp-admin/includes/plugin.php'; + + $this->factory->filter('mec_include_frontend_assets', [$this, 'assets_per_page']); + + if (isset($this->settings['assets_per_page_status']) and $this->settings['assets_per_page_status']) + { + $this->factory->action('add_meta_boxes', [$this, 'register_assets_per_page_meta_boxes'], 1); + $this->factory->action('save_post', [$this, 'assets_per_page_save_page'], 10, 2); + } + + // SEO Title + $this->factory->filter('pre_get_document_title', [$this, 'page_title'], 1000); + + // Event Latest Event Date Time + $this->factory->action('mec_save_event_data', function () + { + update_option('mec_latest_event_datetime', current_time('YmdHis'), false); + }); + + // Kses + MEC::import('app.libraries.kses'); + + $this->factory->filter('mec_kses_tags', ['MEC_kses', 'tags'], 10, 2); + $this->factory->filter('safe_style_css', ['MEC_kses', 'styles']); + + // Upload + $this->factory->filter('upload_mimes', [$this, 'upload_mimes']); + + // Download Debug Log File + $this->factory->action('admin_init', [$this, 'download_debug_log_file']); + + // Database Setup + $this->factory->action('wp_ajax_mec_maintenance_reinstall', [$this, 'rerun_sql']); + } + + /* Activate License */ + public function activate_license() + { + if ($this->getPRO()) + { + // Current User is not Permitted + if (!current_user_can('manage_options')) $this->main->response(['success' => 0, 'code' => 'ADMIN_ONLY']); + + if (!wp_verify_nonce(sanitize_text_field($_REQUEST['nonce']), 'mec_settings_nonce')) exit(); + + $options = get_option('mec_options'); + $options['product_name'] = sanitize_text_field($_REQUEST['content']['LicenseTypeJson']); + $options['purchase_code'] = sanitize_text_field($_REQUEST['content']['PurchaseCodeJson']); + $payload = []; + + $verify = $this->plugin_activation_request($options); + + if ($verify && isset($verify->item_link)) + { + $payload['message'] = esc_html__('success'); + $payload['status'] = true; + $payload['button_text'] = esc_html__('revoke', 'modern-events-calendar-lite'); + update_option('mec_license_status', 'active'); + $options['product_id'] = $verify->item_id; + } + else + { + $payload['message'] = esc_html__('Activation failed'); + $payload['status'] = false; + $payload['button_text'] = esc_html__('submit', 'modern-events-calendar-lite'); + update_option('mec_license_status', 'faild'); + } + + update_option('mec_options', $options); + $payload = json_encode($payload); + echo MEC_kses::element($payload); + wp_die(); + } + } + + public function revoke_license() + { + if ($this->getPRO()) + { + $options = get_option('mec_options'); + $options['product_name'] = ''; + $options['purchase_code'] = ''; + $options['product_id'] = ''; + update_option('mec_options', $options); + + $payload = json_encode(['message' => 'revoked', 'status' => true, 'button_text' => esc_html__('submit', 'modern-events-calendar-lite')]); + echo MEC_kses::element($payload); + wp_die(); + } + } + + // MEC activation request + public function plugin_activation_request($options) + { + $code = $options['purchase_code']; + if (empty($code)) return false; + + $product_name = $options['product_name']; + $item_id = $options['product_id']; + $url = get_home_url(); + $verify_url = MEC_API_ACTIVATION . '/activation/verify?category=mec&license=' . $code . '&url=' . $url . '&item_id=' . $item_id; + + $JSON = wp_remote_retrieve_body(wp_remote_get($verify_url, [ + 'body' => null, + 'timeout' => '120', + 'redirection' => '10', + 'user-agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36', + ])); + + if ($JSON != '') + { + $data = json_decode($JSON); + return $data; + } + else return false; + } + + /* Download MEC settings */ + public function download_settings() + { + // Current User is not Permitted + if (!current_user_can('mec_settings') and !current_user_can('administrator')) $this->main->response(['success' => 0, 'code' => 'ADMIN_ONLY']); + + if (!wp_verify_nonce(sanitize_text_field($_REQUEST['nonce']), 'mec_settings_download')) + { + exit(); + } + + $content = get_option('mec_options'); + $content = json_encode($content, true); + + header('Content-type: application/txt'); + header('Content-Description: MEC Settings'); + header('Content-Disposition: attachment; filename="mec_options_backup_' . date('d-m-Y') . '.json"'); + header('Content-Transfer-Encoding: binary'); + header('Expires: 0'); + header('Cache-Control: no-cache, no-store, max-age=0, must-revalidate'); + print_r($content); + wp_die(); + } + + /* Close addons notification */ + public function close_notification() + { + // Current User is not Permitted + if (!current_user_can('mec_settings') and !current_user_can('administrator')) $this->main->response(['success' => 0, 'code' => 'ADMIN_ONLY']); + if (!wp_verify_nonce(sanitize_text_field($_REQUEST['nonce']), 'mec_settings_nonce')) exit(); + + update_option('mec_addons_notification_option', 'open'); + wp_die(); + } + + /* Close addons notification */ + public function close_cmsg_2_notification() + { + // Current User is not Permitted + if (!current_user_can('mec_settings') and !current_user_can('administrator')) $this->main->response(['success' => 0, 'code' => 'ADMIN_ONLY']); + if (!wp_verify_nonce(sanitize_text_field($_REQUEST['nonce']), 'mec_settings_nonce')) exit(); + + update_option('mec_custom_msg_2_close_option', 'open'); + wp_die(); + } + + /* Close addons notification */ + public function close_cmsg_notification() + { + // Current User is not Permitted + if (!current_user_can('mec_settings') and !current_user_can('administrator')) $this->main->response(['success' => 0, 'code' => 'ADMIN_ONLY']); + if (!wp_verify_nonce(sanitize_text_field($_REQUEST['nonce']), 'mec_settings_nonce')) exit(); + + update_option('mec_custom_msg_close_option', 'open'); + wp_die(); + } + + /* Import MEC settings */ + public function import_settings() + { + // Current User is not Permitted + if (!current_user_can('mec_settings') and !current_user_can('administrator')) $this->main->response(['success' => 0, 'code' => 'ADMIN_ONLY']); + if (!wp_verify_nonce(sanitize_text_field($_REQUEST['nonce']), 'mec_settings_nonce')) exit(); + + $options = $this->main->sanitize_deep_array($_REQUEST['content']); + if ($options == 'No-JSON') + { + echo '
        ' . esc_html__('Your option is not in JSON format. Please insert correct options in this field and try again.', 'modern-events-calendar-lite') . '
        '; + exit(); + } + else + { + if (empty($options)) + { + echo '
        ' . esc_html__('Your options field can not be empty!', 'modern-events-calendar-lite') . '
        '; + exit; + } + else + { + update_option('mec_options', $options); + echo '
        ' . esc_html__('Your options imported successfuly.', 'modern-events-calendar-lite') . '
        '; + } + } + + wp_die(); + } + + /** + * highlighting menu when click on taxonomy + * @param string $parent_file + * @return string + * @author Webnus + */ + public function mec_parent_menu_highlight($parent_file) + { + global $current_screen; + + $taxonomy = $current_screen->taxonomy; + $post_type = $current_screen->post_type; + + // Don't do amything if the post type is not our post type + if (!in_array($post_type, [ + $this->PT, + $this->main->get_email_post_type(), + $this->main->get_certificate_post_type(), + ])) return $parent_file; + + // Other Post Types + if ($post_type === $this->main->get_email_post_type()) return 'mec-intro'; + if ($post_type === $this->main->get_certificate_post_type()) return 'mec-intro'; + + // Tag Taxonomy + $tag_taxonomy = apply_filters('mec_taxonomy_tag', ''); + + switch ($taxonomy) + { + case 'mec_category': + case $tag_taxonomy: + case 'mec_label': + case 'mec_location': + case 'mec_organizer': + case 'mec_speaker': + case 'mec_sponsor': + + $parent_file = 'mec-intro'; + break; + + default: + //nothing + break; + } + + return $parent_file; + } + + public function mec_sub_menu_highlight($submenu_file) + { + global $current_screen; + + $taxonomy = $current_screen->taxonomy; + $post_type = $current_screen->post_type; + + // Don't do amything if the post type is not our post type + if (!in_array($post_type, [ + $this->PT, + $this->main->get_email_post_type(), + $this->main->get_certificate_post_type(), + ])) return $submenu_file; + + // Other Post Types + if ($post_type === $this->main->get_email_post_type()) return 'edit.php?post_type=' . $post_type; + if ($post_type === $this->main->get_certificate_post_type()) return 'edit.php?post_type=' . $post_type; + + // Tag Taxonomy + $tag_taxonomy = apply_filters('mec_taxonomy_tag', ''); + + switch ($taxonomy) + { + case 'mec_category': + + $submenu_file = 'edit-tags.php?taxonomy=mec_category&post_type=' . $this->PT; + break; + case $tag_taxonomy: + + $submenu_file = 'edit-tags.php?taxonomy=' . $tag_taxonomy . '&post_type=' . $this->PT; + break; + case 'mec_label': + + $submenu_file = 'edit-tags.php?taxonomy=mec_label&post_type=' . $this->PT; + break; + case 'mec_location': + + $submenu_file = 'edit-tags.php?taxonomy=mec_location&post_type=' . $this->PT; + break; + case 'mec_organizer': + + $submenu_file = 'edit-tags.php?taxonomy=mec_organizer&post_type=' . $this->PT; + break; + case 'mec_speaker': + + $submenu_file = 'edit-tags.php?taxonomy=mec_speaker&post_type=' . $this->PT; + break; + case 'mec_sponsor': + + $submenu_file = 'edit-tags.php?taxonomy=mec_sponsor&post_type=' . $this->PT; + break; + default: + //nothing + break; + } + + return $submenu_file; + } + + /** + * Add the support menu + * @author Webnus + */ + public function support_menu() + { + add_submenu_page('mec-intro', esc_html__('MEC - Support', 'modern-events-calendar-lite'), esc_html__('Support', 'modern-events-calendar-lite'), 'manage_options', 'MEC-support', [$this, 'support_page']); + } + + /** + * Add the calendars menu + * @author Webnus + */ + public function menus() + { + global $submenu; + unset($submenu['mec-intro'][2]); + + remove_menu_page('edit.php?post_type=mec-events'); + remove_menu_page('edit.php?post_type=mec_calendars'); + do_action('before_mec_submenu_action'); + + add_submenu_page('mec-intro', esc_html__('Add Event', 'modern-events-calendar-lite'), esc_html__('Add Event', 'modern-events-calendar-lite'), apply_filters('mec_menu_cap', 'edit_posts', 'add_event'), 'post-new.php?post_type=' . $this->PT); + add_submenu_page('mec-intro', esc_html__('Tags', 'modern-events-calendar-lite'), esc_html__('Tags', 'modern-events-calendar-lite'), apply_filters('mec_menu_cap', 'edit_others_posts', 'tags'), 'edit-tags.php?taxonomy=' . apply_filters('mec_taxonomy_tag', '') . '&post_type=' . $this->PT); + add_submenu_page('mec-intro', esc_html($this->main->m('taxonomy_categories', esc_html__('Categories', 'modern-events-calendar-lite'))), esc_html($this->main->m('taxonomy_categories', esc_html__('Categories', 'modern-events-calendar-lite'))), apply_filters('mec_menu_cap', 'edit_others_posts', 'categories'), 'edit-tags.php?taxonomy=mec_category&post_type=' . $this->PT); + add_submenu_page('mec-intro', esc_html($this->main->m('taxonomy_labels', esc_html__('Labels', 'modern-events-calendar-lite'))), esc_html($this->main->m('taxonomy_labels', esc_html__('Labels', 'modern-events-calendar-lite'))), apply_filters('mec_menu_cap', 'edit_others_posts', 'labels'), 'edit-tags.php?taxonomy=mec_label&post_type=' . $this->PT); + add_submenu_page('mec-intro', esc_html($this->main->m('taxonomy_locations', esc_html__('Locations', 'modern-events-calendar-lite'))), esc_html($this->main->m('taxonomy_locations', esc_html__('Locations', 'modern-events-calendar-lite'))), apply_filters('mec_menu_cap', 'edit_others_posts', 'locations'), 'edit-tags.php?taxonomy=mec_location&post_type=' . $this->PT); + + // Organizers Menu + if (!isset($this->settings['organizers_status']) || $this->settings['organizers_status']) + { + add_submenu_page('mec-intro', esc_html($this->main->m('taxonomy_organizers', esc_html__('Organizers', 'modern-events-calendar-lite'))), esc_html($this->main->m('taxonomy_organizers', esc_html__('Organizers', 'modern-events-calendar-lite'))), apply_filters('mec_menu_cap', 'edit_others_posts', 'organizers'), 'edit-tags.php?taxonomy=mec_organizer&post_type=' . $this->PT); + } + + // Speakers Menu + if (isset($this->settings['speakers_status']) and $this->settings['speakers_status']) + { + add_submenu_page('mec-intro', esc_html($this->main->m('taxonomy_speakers', esc_html__('Speakers', 'modern-events-calendar-lite'))), esc_html($this->main->m('taxonomy_speakers', esc_html__('Speakers', 'modern-events-calendar-lite'))), apply_filters('mec_menu_cap', 'edit_others_posts', 'speakers'), 'edit-tags.php?taxonomy=mec_speaker&post_type=' . $this->PT); + } + + // Sponsors Menu + if ($this->getPRO() and isset($this->settings['sponsors_status']) and $this->settings['sponsors_status']) + { + add_submenu_page('mec-intro', esc_html($this->main->m('taxonomy_sponsors', esc_html__('Sponsors', 'modern-events-calendar-lite'))), esc_html($this->main->m('taxonomy_sponsors', esc_html__('Sponsors', 'modern-events-calendar-lite'))), apply_filters('mec_menu_cap', 'edit_others_posts', 'sponsors'), 'edit-tags.php?taxonomy=mec_sponsor&post_type=' . $this->PT); + } + + $capability = current_user_can('administrator') ? 'manage_options' : 'mec_shortcodes'; + $capability = apply_filters('mec_menu_cap', $capability, 'shortcodes'); + add_submenu_page('mec-intro', esc_html__('Shortcodes', 'modern-events-calendar-lite'), esc_html__('Shortcodes', 'modern-events-calendar-lite'), $capability, 'edit.php?post_type=mec_calendars'); + + // Auto Email Menu + if ($this->getPRO() and isset($this->settings['auto_emails_module_status']) and $this->settings['auto_emails_module_status']) + { + $capability = apply_filters('mec_menu_cap', 'manage_options', 'emails'); + add_submenu_page('mec-intro', esc_html__('Emails', 'modern-events-calendar-lite'), esc_html__('Emails', 'modern-events-calendar-lite'), $capability, 'edit.php?post_type=mec-emails'); + } + + // Certificates Menu + if ($this->getPRO() and isset($this->settings['certificate_status']) and $this->settings['certificate_status']) + { + $capability = apply_filters('mec_menu_cap', 'manage_options', 'certificate'); + add_submenu_page('mec-intro', esc_html__('Certificates', 'modern-events-calendar-lite'), esc_html__('Certificates', 'modern-events-calendar-lite'), $capability, 'edit.php?post_type=' . $this->main->get_certificate_post_type()); + } + + // Webhooks Menu + if (isset($this->settings['webhooks_status']) and $this->settings['webhooks_status']) + { + $capability = apply_filters('mec_menu_cap', 'manage_options', 'webhooks'); + add_submenu_page('mec-intro', esc_html__('Webhooks', 'modern-events-calendar-lite'), esc_html__('Webhooks', 'modern-events-calendar-lite'), $capability, 'edit.php?post_type=mec-webhooks'); + } + + $capability = (current_user_can('administrator') ? 'manage_options' : 'mec_settings'); + add_submenu_page('mec-intro', esc_html__('MEC - Settings', 'modern-events-calendar-lite'), esc_html__('Settings', 'modern-events-calendar-lite'), apply_filters('mec_menu_cap', $capability, 'settings'), 'MEC-settings', [$this, 'page']); + + add_submenu_page('mec-intro', esc_html__('MEC - Addons', 'modern-events-calendar-lite'), esc_html__('Addons', 'modern-events-calendar-lite'), apply_filters('mec_menu_cap', 'manage_options', 'addons'), 'MEC-addons', [$this, 'addons']); + add_submenu_page('mec-intro', esc_html__('MEC - Wizard', 'modern-events-calendar-lite'), esc_html__('Wizard', 'modern-events-calendar-lite'), apply_filters('mec_menu_cap', 'manage_options', 'wizard'), 'MEC-wizard', [$this, 'setup_wizard']); + + if (!$this->getPRO()) add_submenu_page('mec-intro', esc_html__('MEC - Go Pro', 'modern-events-calendar-lite'), esc_html__('Go Pro', 'modern-events-calendar-lite'), apply_filters('mec_menu_cap', 'manage_options', 'go_pro'), 'MEC-go-pro', [$this, 'go_pro']); + do_action('after_mec_submenu_action'); + } + + /** + * Get Wizard page + * @return void + * @author Webnus + */ + public function setup_wizard() + { + $this->display_wizard(); + } + + /** + * Show Wizard page + * @return void + * @author Webnus + */ + public function display_wizard() + { + $path = MEC::import('app.features.mec.wizard', true, true); + ob_start(); + include $path; + echo MEC_kses::full(ob_get_clean()); + } + + /** + * Register post type of calendars/custom shortcodes + * @author Webnus + * + */ + public function register_post_type() + { + $elementor = class_exists('MEC_Shortcode_Builder') && did_action('elementor/loaded') ? true : false; + + register_post_type('mec_calendars', + [ + 'labels' => [ + 'name' => __('Shortcodes', 'modern-events-calendar-lite'), + 'singular_name' => __('Shortcode', 'modern-events-calendar-lite'), + 'add_new' => __('Add Shortcode', 'modern-events-calendar-lite'), + 'add_new_item' => __('Add New Shortcode', 'modern-events-calendar-lite'), + 'not_found' => __('No shortcodes found!', 'modern-events-calendar-lite'), + 'all_items' => __('All Shortcodes', 'modern-events-calendar-lite'), + 'edit_item' => __('Edit shortcodes', 'modern-events-calendar-lite'), + 'not_found_in_trash' => __('No shortcodes found in Trash!', 'modern-events-calendar-lite'), + ], + 'public' => $elementor, + 'show_in_nav_menus' => false, + 'show_in_admin_bar' => $elementor, + 'show_ui' => true, + 'has_archive' => false, + 'exclude_from_search' => true, + 'publicly_queryable' => $elementor, + 'show_in_menu' => 'mec-intro', + 'supports' => ['title'], + ] + ); + + do_action('mec_register_post_type'); + } + + /** + * Filter columns of calendars/custom shortcodes + * @param array $columns + * @return array + * @author Webnus + */ + public function filter_columns($columns) + { + $columns['shortcode'] = esc_html__('Shortcode', 'modern-events-calendar-lite'); + return $columns; + } + + /** + * Filter column content of calendars/custom shortcodes + * @param string $column_name + * @param int $post_id + * @author Webnus + */ + public function filter_columns_content($column_name, $post_id) + { + if ($column_name == 'shortcode') + { + echo '[MEC id="' . $post_id . '"]'; + } + } + + /** + * Register meta boxes of calendars/custom shortcodes + * @author Webnus + */ + public function register_meta_boxes() + { + // Fix conflict between Ultimate GDPR and niceSelect + $screen = get_current_screen(); + if ($screen->id == 'mec_calendars') remove_all_actions('acf/input/admin_head'); + + add_meta_box('mec_calendar_display_options', esc_html__('Display Options', 'modern-events-calendar-lite'), [$this, 'meta_box_display_options'], 'mec_calendars', 'normal', 'high'); + add_meta_box('mec_calendar_filter', esc_html__('Filter Options', 'modern-events-calendar-lite'), [$this, 'meta_box_filter'], 'mec_calendars', 'normal', 'high'); + add_meta_box('mec_calendar_shortcode', esc_html__('Shortcode', 'modern-events-calendar-lite'), [$this, 'meta_box_shortcode'], 'mec_calendars', 'side'); + add_meta_box('mec_calendar_search_form', esc_html__('Search Form', 'modern-events-calendar-lite'), [$this, 'meta_box_search_form'], 'mec_calendars', 'side'); + add_meta_box('mec_calendar_icons', esc_html__('Icon Options', 'modern-events-calendar-lite'), [$this, 'meta_box_icons'], 'mec_calendars', 'normal', 'low'); + } + + public function action_links($actions, $post) + { + if ($post->post_type != 'mec_calendars') return $actions; + + // Editor and Higher + if (current_user_can('edit_post', $post->ID)) + { + // Duplicate Button + $actions['mec-duplicate'] = '' . esc_html__('Duplicate', 'modern-events-calendar-lite') . ''; + } + + return $actions; + } + + public function duplicate_shortcode() + { + // It's not a duplicate request + if (!isset($_GET['mec-action']) or (isset($_GET['mec-action']) and sanitize_text_field($_GET['mec-action']) != 'duplicate-shortcode')) return false; + + // Shortcode ID to duplicate + $id = isset($_GET['id']) ? (int) sanitize_text_field($_GET['id']) : 0; + if (!$id) return false; + + // Only editor and higher + if (!current_user_can('edit_post', $id)) return false; + + // Duplicate Shortcode + $new_post_id = $this->main->duplicate_post($id); + + wp_redirect('post.php?post=' . $new_post_id . '&action=edit'); + exit; + } + + /** + * Save calendars/custom shortcodes + * @param int $post_id + * @return void + * @author Webnus + */ + public function save_calendar($post_id) + { + // Check if our nonce is set. + if (!isset($_POST['mec_calendar_nonce'])) return; + + // Verify that the nonce is valid. + if (!wp_verify_nonce(sanitize_text_field($_POST['mec_calendar_nonce']), 'mec_calendar_data')) return; + + // If this is an autosave, our form has not been submitted, so we don't want to do anything. + if (defined('DOING_AUTOSAVE') and DOING_AUTOSAVE) return; + + $terms = isset($_POST['mec_tax_input']) ? $this->main->sanitize_deep_array($_POST['mec_tax_input']) : []; + + $categories_arr = (isset($terms['mec_category']) and is_array($terms['mec_category'])) ? $terms['mec_category'] : []; + $ex_categories_arr = (isset($terms['mec_ex_category']) and is_array($terms['mec_ex_category'])) ? $terms['mec_ex_category'] : []; + foreach ($ex_categories_arr as $ex_category) + { + $f = array_search($ex_category, $categories_arr); + if (is_numeric($f)) unset($categories_arr[$f]); + } + + $categories = sanitize_text_field(implode(',', $categories_arr)); + $ex_categories = sanitize_text_field(implode(',', $ex_categories_arr)); + + $locations_arr = (isset($terms['mec_location']) and is_array($terms['mec_location'])) ? $terms['mec_location'] : []; + $ex_locations_arr = (isset($terms['mec_ex_location']) and is_array($terms['mec_ex_location'])) ? $terms['mec_ex_location'] : []; + foreach ($ex_locations_arr as $ex_location) + { + $f = array_search($ex_location, $locations_arr); + if (is_numeric($f)) unset($locations_arr[$f]); + } + + $locations = sanitize_text_field(implode(',', $locations_arr)); + $ex_locations = sanitize_text_field(implode(',', $ex_locations_arr)); + + $organizers_arr = (isset($terms['mec_organizer']) and is_array($terms['mec_organizer'])) ? $terms['mec_organizer'] : []; + $ex_organizers_arr = (isset($terms['mec_ex_organizer']) and is_array($terms['mec_ex_organizer'])) ? $terms['mec_ex_organizer'] : []; + foreach ($ex_organizers_arr as $ex_organizer) + { + $f = array_search($ex_organizer, $organizers_arr); + if (is_numeric($f)) unset($organizers_arr[$f]); + } + + $organizers = sanitize_text_field(implode(',', $organizers_arr)); + $ex_organizers = sanitize_text_field(implode(',', $ex_organizers_arr)); + + $sponsors = (isset($terms['mec_sponsor']) and is_array($terms['mec_sponsor'])) ? sanitize_text_field(implode(',', $terms['mec_sponsor'])) : ''; + + $labels_arr = (isset($terms['mec_label']) and is_array($terms['mec_label'])) ? $terms['mec_label'] : []; + $ex_labels_arr = (isset($terms['mec_ex_labels']) and is_array($terms['mec_ex_labels'])) ? $terms['mec_ex_labels'] : []; + foreach ($ex_labels_arr as $ex_label) + { + $f = array_search($ex_label, $labels_arr); + if (is_numeric($f)) unset($labels_arr[$f]); + } + + $labels = sanitize_text_field(implode(',', $labels_arr)); + $ex_labels = sanitize_text_field(implode(',', $ex_labels_arr)); + + $tags = isset($terms['mec_tag']) && is_array($terms['mec_tag']) ? $terms['mec_tag'] : []; + $ex_tags = isset($terms['mec_ex_tags']) && is_array($terms['mec_ex_tags']) ? $terms['mec_ex_tags'] : []; + + $authors_arr = (isset($terms['mec_author']) and is_array($terms['mec_author'])) ? $terms['mec_author'] : []; + $ex_authors_arr = (isset($terms['mec_ex_authors']) and is_array($terms['mec_ex_authors'])) ? $terms['mec_ex_authors'] : []; + + foreach ($ex_authors_arr as $ex_author) + { + $f = array_search($ex_author, $authors_arr); + if (is_numeric($f)) unset($authors_arr[$f]); + } + + $authors = sanitize_text_field(implode(',', $authors_arr)); + $ex_authors = sanitize_text_field(implode(',', $ex_authors_arr)); + + // Fix tags + if (is_array($tags) and count($tags) == 1 and trim($tags[0]) == '') $tags = []; + if (is_array($tags)) + { + $tags = array_map('trim', $tags); + $tags = implode(',', $tags); + } + + // Fix Ex tags + if (is_array($ex_tags) and count($ex_tags) == 1 and trim($ex_tags[0]) == '') $ex_tags = []; + if (is_array($ex_tags)) + { + $ex_tags = array_map('trim', $ex_tags); + $ex_tags = implode(',', $ex_tags); + } + + update_post_meta($post_id, 'label', $labels); + update_post_meta($post_id, 'ex_label', $ex_labels); + update_post_meta($post_id, 'category', $categories); + update_post_meta($post_id, 'ex_category', $ex_categories); + update_post_meta($post_id, 'location', $locations); + update_post_meta($post_id, 'ex_location', $ex_locations); + update_post_meta($post_id, 'organizer', $organizers); + update_post_meta($post_id, 'ex_organizer', $ex_organizers); + update_post_meta($post_id, 'sponsor', $sponsors); + update_post_meta($post_id, 'tag', $tags); + update_post_meta($post_id, 'ex_tag', $ex_tags); + update_post_meta($post_id, 'author', $authors); + update_post_meta($post_id, 'ex_author', $ex_authors); + + do_action('mec_shortcode_filters_save', $post_id, $terms); + + $mec = (isset($_POST['mec']) ? $this->main->sanitize_deep_array($_POST['mec']) : []); + + // Icons + $icons = isset($mec['icons']) && is_array($mec['icons']) ? $mec['icons'] : []; + update_post_meta($post_id, 'mec_icons', $icons); + + $skin = (isset($mec['skin']) ? sanitize_text_field($mec['skin']) : ''); + $start_date_type = ((isset($mec['sk-options'][$skin]) and isset($mec['sk-options'][$skin]['start_date_type'])) ? sanitize_text_field($mec['sk-options'][$skin]['start_date_type']) : 'today'); + $end_date_type = ((isset($mec['sk-options'][$skin]) and isset($mec['sk-options'][$skin]['end_date_type'])) ? sanitize_text_field($mec['sk-options'][$skin]['end_date_type']) : 'date'); + + $ongoing = ((isset($mec['show_only_ongoing_events']) and $mec['show_only_ongoing_events']) ? 1 : 0); + + // Set start date to Today because of showing ongoing events + if ($ongoing and in_array($skin, ['list', 'grid', 'agenda', 'timeline'])) $mec['sk-options'][$skin]['start_date_type'] = 'today'; + // Enable "Show Past Events" option since the start date is past + else if (in_array($start_date_type, ['yesterday', 'start_last_year', 'start_last_month', 'start_last_week'])) $mec['show_past_events'] = 1; + + // Set date filter type to dropdown because of skin + if (!in_array($skin, ['list', 'grid', 'agenda', 'timeline', 'map', 'custom']) and $mec['sf-options'][$skin]['month_filter']['type'] == 'date-range-picker') $mec['sf-options'][$skin]['month_filter']['type'] = 'dropdown'; + + // Enable Descending Order + if ($start_date_type === 'date' and $end_date_type === 'date' and isset($mec['sk-options'][$skin]) and isset($mec['sk-options'][$skin]['start_date']) and isset($mec['sk-options'][$skin]['maximum_date_range']) and trim($mec['sk-options'][$skin]['start_date']) and trim($mec['sk-options'][$skin]['maximum_date_range']) and strtotime($mec['sk-options'][$skin]['start_date']) > strtotime($mec['sk-options'][$skin]['maximum_date_range'])) $mec['sk-options'][$skin]['order_method'] = 'DESC'; + + foreach ($mec as $key => $value) update_post_meta($post_id, $key, $value); + } + + /** + * Show content of filter meta box + * @param object $post + * @author Webnus + */ + public function meta_box_filter($post) + { + $path = MEC::import('app.features.mec.meta_boxes.filter', true, true); + + ob_start(); + include $path; + echo MEC_kses::full(ob_get_clean()); + } + + /** + * Show content of shortcode meta box + * @param object $post + * @author Webnus + */ + public function meta_box_shortcode($post) + { + $path = MEC::import('app.features.mec.meta_boxes.shortcode', true, true); + + ob_start(); + include $path; + echo MEC_kses::full(ob_get_clean()); + } + + /** + * Show content of search form meta box + * @param object $post + * @author Webnus + */ + public function meta_box_search_form($post) + { + $path = MEC::import('app.features.mec.meta_boxes.search_form', true, true); + + ob_start(); + include $path; + echo MEC_kses::full(ob_get_clean()); + } + + /** + * Show content of display options meta box + * @param object $post + * @author Webnus + */ + public function meta_box_display_options($post) + { + $path = MEC::import('app.features.mec.meta_boxes.display_options', true, true); + + ob_start(); + include $path; + echo MEC_kses::full(ob_get_clean()); + } + + /** + * Show content of skin options meta box + * @param object $post + * @author Webnus + */ + public function meta_box_skin_options($post) + { + $path = MEC::import('app.features.mec.meta_boxes.skin_options', true, true); + + ob_start(); + include $path; + echo MEC_kses::full(ob_get_clean()); + } + + /** + * Show content of icons meta box + * @param object $post + * @author Webnus + */ + public function meta_box_icons($post) + { + $path = MEC::import('app.features.mec.meta_boxes.icons', true, true); + + ob_start(); + include $path; + echo MEC_kses::full(ob_get_clean()); + } + + /** + * Get Addons page + * @return void + * @author Webnus + */ + public function go_pro() + { + $this->display_go_pro(); + } + + /** + * Show go_pro page + * @return void + * @author Webnus + */ + public function display_go_pro() + { + $path = MEC::import('app.features.mec.go-pro', true, true); + ob_start(); + include $path; + echo MEC_kses::full(ob_get_clean()); + } + + /** + * Get Addons page + * @return void + * @author Webnus + */ + public function addons() + { + $this->display_addons(); + } + + /** + * Show Addons page + * @return void + * @author Webnus + */ + public function display_addons() + { + $path = MEC::import('app.features.mec.addons', true, true); + ob_start(); + include $path; + echo MEC_kses::full(ob_get_clean()); + } + + /** + * Show support page + * @return void + * @author Webnus + */ + public function display_support() + { + $path = MEC::import('app.features.mec.support-page', true, true); + ob_start(); + include $path; + echo MEC_kses::full(ob_get_clean()); + } + + /** + * support page + * @return void + * @author Webnus + */ + public function support_page() + { + $this->display_support(); + } + + /** + * Show content settings menu + * @return void + * @author Webnus + */ + public function page() + { + $tab = isset($_GET['tab']) ? sanitize_text_field($_GET['tab']) : 'MEC-settings'; + + if ($tab == 'MEC-customcss') $this->styles(); + else if ($tab == 'MEC-ie') $this->import_export(); + else if ($tab == 'MEC-notifications') $this->notifications(); + else if ($tab == 'MEC-messages') $this->messages(); + else if ($tab == 'MEC-styling') $this->styling(); + else if ($tab == 'MEC-single') $this->single(); + else if ($tab == 'MEC-fes') $this->fes(); + else if ($tab == 'MEC-booking') $this->booking(); + else if ($tab == 'MEC-modules') $this->modules(); + else if ($tab == 'MEC-integrations') $this->integrations(); + else if (apply_filters('mec_is_custom_settings', false, $tab)) + { + do_action('mec_display_settings_page', $tab); + } + else $this->settings(); + } + + /** + * Show content of settings tab + * @return void + * @author Webnus + */ + public function settings() + { + $path = MEC::import('app.features.mec.settings', true, true); + + ob_start(); + include $path; + echo MEC_kses::full(ob_get_clean()); + } + + /** + * Show content of styles tab + * @return void + * @author Webnus + */ + public function styles() + { + $path = MEC::import('app.features.mec.styles', true, true); + + ob_start(); + include $path; + echo MEC_kses::full(ob_get_clean()); + } + + /** + * Show content of styling tab + * @return void + * @author Webnus + */ + public function styling() + { + $path = MEC::import('app.features.mec.styling', true, true); + + ob_start(); + include $path; + echo MEC_kses::full(ob_get_clean()); + } + + /** + * Show content of single tab + * @return void + * @author Webnus + */ + public function single() + { + $path = MEC::import('app.features.mec.single', true, true); + + ob_start(); + include $path; + echo MEC_kses::full(ob_get_clean()); + } + + /** + * Show content of Frontend Event Submission tab + * @return void + * @author Webnus + */ + public function fes() + { + $path = MEC::import('app.features.mec.fes', true, true); + + ob_start(); + include $path; + echo MEC_kses::full(ob_get_clean()); + } + + /** + * Show content of booking tab + * @return void + * @author Webnus + */ + public function booking() + { + $path = MEC::import('app.features.mec.booking', true, true); + + ob_start(); + include $path; + echo MEC_kses::full(ob_get_clean()); + } + + /** + * Show content of modules tab + * @return void + * @author Webnus + */ + public function modules() + { + $path = MEC::import('app.features.mec.modules', true, true); + + ob_start(); + include $path; + echo MEC_kses::full(ob_get_clean()); + } + + /** + * Show content of import/export tab + * @return void + * @author Webnus + */ + public function import_export() + { + $path = MEC::import('app.features.mec.ie', true, true); + + ob_start(); + include $path; + echo MEC_kses::full(ob_get_clean()); + } + + /** + * Show content of notifications tab + * @return void + * @author Webnus + */ + public function notifications() + { + $path = MEC::import('app.features.mec.notifications', true, true); + + ob_start(); + include $path; + echo MEC_kses::full(ob_get_clean()); + } + + /** + * Show content of messages tab + * @return void + * @author Webnus + */ + public function messages() + { + $path = MEC::import('app.features.mec.messages', true, true); + + ob_start(); + include $path; + echo MEC_kses::full(ob_get_clean()); + } + + /** + * Show content of integrations tab + * @return void + * @author Webnus + */ + public function integrations() + { + $path = MEC::import('app.features.mec.integrations', true, true); + + ob_start(); + include $path; + echo MEC_kses::full(ob_get_clean()); + } + + /** + * Whether to include google map library + * @param boolean $gm_include + * @return boolean + * @author Webnus + */ + public function gm_include($gm_include) + { + // Don't include the library if google Maps API is set to don't load + if (isset($this->settings['google_maps_dont_load_api']) and $this->settings['google_maps_dont_load_api']) return false; + + return $gm_include; + } + + /** + * Single Event Display Method + * @param string $skin + * @param int $value + * @param int $image_popup + * @return string + */ + public function sed_method_field($skin, $value = 0, $image_popup = 0) + { + $image_popup_html = '
        +
        + +
        +
        + + +
        +
        '; + + return '' . MEC_kses::form($image_popup_html); + } + + public function order_method_field($skin, $value = 'ASC', $key = 'order_method') + { + return '
        +
        + +
        +
        + + + +
        +
        ' . esc_html__('Descending Order', 'modern-events-calendar-lite') . '
        +

        ' . esc_html__('Enable this option to sort events in descending order.', 'modern-events-calendar-lite') . '

        +
        + +
        +
        +
        '; + } + + public function booking_button_field($skin, $value = 0) + { + $booking_status = (!isset($this->settings['booking_status']) or (isset($this->settings['booking_status']) and !$this->settings['booking_status'])) ? false : true; + if (!$booking_status) return ''; + + return '
        +
        + +
        +
        + + + +
        +
        ' . esc_html__('Booking Button / Icon', 'modern-events-calendar-lite') . '
        +

        ' . esc_html__('Enable this option to display booking button / icon in this shortcode.', 'modern-events-calendar-lite') . '

        +
        + +
        +
        +
        '; + } + + public function display_organizer_field($skin, $value = 0) + { + return '
        +
        + +
        +
        + + + +
        +
        ' . esc_html__('Display Organizers', 'modern-events-calendar-lite') . '
        +

        ' . esc_html__('Enable this option to display events organizers in this shortcode.', 'modern-events-calendar-lite') . '

        +
        + +
        +
        +
        '; + } + + public function display_custom_data_field($skin, $value = 0) + { + return '
        +
        + +
        +
        + + + +
        +
        ' . esc_html__('Display Custom Fields', 'modern-events-calendar-lite') . '
        +

        ' . esc_html__('Enable this option to display events custom data in this shortcode.', 'modern-events-calendar-lite') . '

        +
        + +
        +
        +
        '; + } + + public function display_pagination_field($skin, $options = []) + { + $value = isset($options['pagination']) ? (string) $options['pagination'] : ''; + + // Legacy Option + if (trim($value) === '' and isset($options['load_more_button'])) $value = $options['load_more_button'] ? 'loadmore' : '0'; + + return '
        +
        + +
        +
        + +
        +
        '; + } + + public function display_price_field($skin, $value = 0) + { + return ($skin === 'full_calendar' ? '

        ' . esc_html__("The price shows in List View and Tile View.", 'modern-events-calendar-lite') . '

        ' : '') . ' +
        +
        + +
        +
        + + + + +
        +
        ' . esc_html__('Display Event Price', 'modern-events-calendar-lite') . '
        +

        ' . esc_html__('Enable this option to display events price in this shortcode.', 'modern-events-calendar-lite') . '

        +
        + +
        +
        +
        '; + } + + public function display_status_bar_field($skin, $value = 0) + { + return '
        +
        + +
        +
        + + + +
        +
        ' . esc_html__('Display Organizers', 'modern-events-calendar-lite') . '
        +

        ' . esc_html__('Enable this option to display the status bar in this shortcode.', 'modern-events-calendar-lite') . '

        +
        + +
        +
        +
        '; + } + + public function display_progress_bar_field($skin, $value) + { + // Module is not enabled + if (!isset($this->settings['progress_bar_status']) or (isset($this->settings['progress_bar_status']) and !$this->settings['progress_bar_status'])) return ''; + + return '
        +
        + +
        +
        + + + +
        +
        '; + } + + public function display_detailed_time_field($skin, $value = 0) + { + return '
        +
        + + ' . esc_html__('For Multiple Day Events', 'modern-events-calendar-lite') . ' +
        +
        + + +
        +
        '; + } + + /** + * Disable Gutenberg Editor for MEC Post Types + * @param boolean $status + * @param string $post_type + * @return bool + */ + public function gutenberg($status, $post_type) + { + if (in_array($post_type, [$this->PT, $this->main->get_book_post_type(), $this->main->get_shortcode_post_type()])) return false; + return $status; + } + + /** + * Show Booking Badge. + * @param object $screen + * @return void + */ + public function booking_badge($screen) + { + $user_id = get_current_user_id(); + $user_last_view_date = get_user_meta($user_id, 'user_last_view_date', true); + + if (!trim($user_last_view_date)) + { + update_user_meta($user_id, 'user_last_view_date', date('YmdHis', current_time('timestamp', 0))); + return; + } + + $latest_booking_datetime = get_option('mec_latest_booking_datetime'); + if ($latest_booking_datetime and (int) $latest_booking_datetime <= (int) $user_last_view_date) return; + + $args = [ + 'post_type' => $this->main->get_book_post_type(), + 'post_status' => 'any', + 'meta_query' => [ + [ + 'key' => 'mec_book_date_submit', + 'value' => $user_last_view_date, + 'compare' => '>=', + ], + ], + ]; + + $count = 0; + $query = new WP_Query($args); + if ($query->have_posts()) + { + while ($query->have_posts()) + { + $query->the_post(); + $count += 1; + } + } + + wp_reset_postdata(); + + if ($count != 0) + { + // Append Booking Badge To Booking Menu. + global $menu; + + $badge = ' %%count%%'; + $menu_item = wp_list_filter($menu, [2 => 'edit.php?post_type=' . $this->main->get_book_post_type()]); + if (is_array($menu_item) and count($menu_item)) + { + $menu[key($menu_item)][0] .= str_replace('%%count%%', esc_attr($count), $badge); + } + } + + if (isset($screen->id) and $screen->id == 'edit-mec-books') + { + update_user_meta($user_id, 'user_last_view_date', date('YmdHis', current_time('timestamp', 0))); + return; + } + } + + /** + * Show Events Badge. + * @param object $screen + * @return void + */ + public function events_badge($screen) + { + if (!current_user_can('administrator') and !current_user_can('editor')) return; + + $user_id = get_current_user_id(); + $user_last_view_date_events = get_user_meta($user_id, 'user_last_view_date_events', true); + + if (!trim($user_last_view_date_events)) + { + update_user_meta($user_id, 'user_last_view_date_events', date('YmdHis', current_time('timestamp', 0))); + return; + } + + $latest_event_datetime = get_option('mec_latest_event_datetime'); + if ($latest_event_datetime and (int) $latest_event_datetime <= (int) $user_last_view_date_events) return; + + $args = [ + 'post_type' => $this->main->get_main_post_type(), + 'post_status' => 'any', + 'meta_query' => [ + [ + 'key' => 'mec_event_date_submit', + 'value' => $user_last_view_date_events, + 'compare' => '>=', + ], + ], + ]; + + $count = 0; + $query = new WP_Query($args); + if ($query->have_posts()) + { + while ($query->have_posts()) + { + $query->the_post(); + $count += 1; + } + } + + wp_reset_postdata(); + + if ($count != 0) + { + // Append Events Badge To Event Menu. + global $menu; + + $badge = ' %%count%%'; + $menu_item = wp_list_filter($menu, [2 => 'mec-intro']); + if (is_array($menu_item) and count($menu_item)) + { + $menu[key($menu_item)][0] .= str_replace('%%count%%', esc_attr($count), $badge); + } + } + + if (isset($screen->id) and $screen->id == 'edit-mec-events') + { + update_user_meta($user_id, 'user_last_view_date_events', date('YmdHis', current_time('timestamp', 0))); + return; + } + } + + /** + * Add MEC metaboxes in WordPress dashboard + * @author Webnus + */ + public function dashboard_widgets() + { + wp_add_dashboard_widget( + 'mec_widget_news_features', + esc_html__('Modern Events Calendar', 'modern-events-calendar-lite'), + [$this, 'widget_news'] + ); + + if ($this->getPRO() and current_user_can('mec_settings') and isset($this->settings['booking_status']) and $this->settings['booking_status']) + { + wp_add_dashboard_widget( + 'mec_widget_total_bookings', + esc_html__('Total Bookings', 'modern-events-calendar-lite'), + [$this, 'widget_total_bookings'] + ); + } + } + + /** + * MEC render metabox in WordPress dashboard + * @author Webnus + */ + public function widget_news() + { + // Head Section + echo '
        +
        + +

        ' . ($this->getPRO() ? esc_html__('Modern Events Calendar', 'modern-events-calendar-lite') : esc_html__('Modern Events Calendar (Lite)', 'modern-events-calendar-lite')) . '

        + Create New Event +
        +
        +
        +
        '; + + // Upcoming Events + $upcoming_events = $this->main->get_upcoming_events(3); + echo '

        ' . esc_html__('Upcoming Events', 'modern-events-calendar-lite') . '

          '; + foreach ($upcoming_events as $date => $content) + { + foreach ($content as $array_id => $event) + { + $location_id = $this->main->get_master_location_id($event); + + $event_title = $event->data->title; + $event_link = $event->data->permalink; + $event_date = $this->main->date_i18n(get_option('date_format'), $event->date['start']['date']); + $location = get_term($location_id, 'mec_location'); + + $locationName = ''; + if (isset($location->name)) $locationName = $location->name; + + echo '
        • + +
          + ' . esc_html($event_title) . ' +
          ' . esc_html($locationName) . '
          +
          +
          ' . esc_html($event_date) . '
          +
          +
        • '; + } + } + + echo '
        '; + + $mec_get_webnus_news_time = get_option('mec_get_webnus_news_time'); + if (!isset($mec_get_webnus_news_time) || !$mec_get_webnus_news_time) + { + $data_url = wp_remote_get('https://webnus.net/wp-json/wninfo/v1/posts', ['user-agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36']); + $obj = ((is_array($data_url) and isset($data_url['body'])) ? json_decode($data_url['body']) : ''); + + update_option('mec_get_webnus_news_time', date("Y-m-d")); + update_option('mec_get_webnus_news_html', $obj); + } + else + { + if (strtotime(date("Y-m-d")) > strtotime($mec_get_webnus_news_time)) + { + $data_url = wp_remote_get('https://webnus.net/wp-json/wninfo/v1/posts', ['user-agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36']); + $obj = ((is_array($data_url) and isset($data_url['body'])) ? json_decode($data_url['body']) : ''); + + update_option('mec_get_webnus_news_time', date("Y-m-d")); + update_option('mec_get_webnus_news_html', $obj); + } + else + { + $obj = get_option('mec_get_webnus_news_html'); + } + } + + // News + if (!empty($obj)) + { + echo '

        ' . esc_html__('News & Updates', 'modern-events-calendar-lite') . '

        '; + } + + // Links + echo ''; + } + + public function dashboard_widget_total_booking_ajax_handler() + { + $start = isset($_REQUEST['start']) ? sanitize_text_field($_REQUEST['start']) : date('Y-m-d', strtotime('-15 days')); + $end = isset($_REQUEST['end']) ? sanitize_text_field($_REQUEST['end']) : date('Y-m-d'); + $type = isset($_REQUEST['type']) ? sanitize_text_field($_REQUEST['type']) : 'daily'; + $chart = isset($_REQUEST['chart']) ? sanitize_text_field($_REQUEST['chart']) : 'bar'; + + ob_start(); + $this->display_total_booking_chart($start, $end, $type, $chart); + $r = ob_get_clean(); + + wp_send_json($r); + } + + public function display_total_booking_chart($start, $end, $type = 'daily', $chart = 'bar') + { + $start = (!empty($start) ? $start : date('Y-m-d', strtotime('-15 days'))); + $end = (!empty($end) ? $end : date('Y-m-d')); + + $periods = $this->main->get_date_periods($start, $end, $type); + + $stats = ''; + $labels = ''; + foreach ($periods as $period) + { + $post_type = $this->main->get_book_post_type(); + $posts_ids = $this->db->select("SELECT `ID` FROM `#__posts` WHERE `post_type`='" . $post_type . "' AND `post_date`>='" . $period['start'] . "' AND `post_date`<='" . $period['end'] . "'", 'loadColumn'); + + if (count($posts_ids)) $total_sells = $this->db->select("SELECT SUM(`meta_value`) FROM `#__postmeta` WHERE `meta_key`='mec_price' AND `post_id` IN (" . implode(',', $posts_ids) . ")", 'loadResult'); + else $total_sells = 0; + + $labels .= '"' . $period['label'] . '",'; + $stats .= $total_sells . ','; + } + + $currency = $this->main->get_currency_sign(); + + echo ''; + echo ''; + } + + public function widget_total_bookings() + { + $current_page = isset($_GET['page']) ? sanitize_text_field($_GET['page']) : 'dashboard'; + + wp_enqueue_script('mec-chartjs-script'); + wp_enqueue_script('mec-total-booking-reports-script', $this->main->asset('js/total-booking-reports.js')); + wp_localize_script('mec-total-booking-reports-script', 'mec_ajax_data', [ + 'ajaxurl' => admin_url('admin-ajax.php'), + ]); + ?> +
        +
        +
        +
        + +
        +
        +
          +
        • +
        • +
        • +
        • +
        + + +
        + + + + + + +
        +
        + display_total_booking_chart($start, $end, $type, $chart); + ?> +
        +
        +
        +
        +
        + db->select("SELECT MIN(cast(meta_value as unsigned)) AS date FROM `#__postmeta` WHERE `meta_key`='mec_start_date'", 'loadResult'); + $end_year = $max_end_year = $this->db->select("SELECT MAX(cast(meta_value as unsigned)) AS date FROM `#__postmeta` WHERE `meta_key`='mec_end_date'", 'loadResult'); + $current_month = current_time('m'); + ?> +
        +
        + +
        +
        + ID))) return ''; + + // Date + $date = (isset($mec_current_event->date) ? $mec_current_event->date : []); + $start_timestamp = (isset($date['start']) and isset($date['start']['timestamp'])) ? $date['start']['timestamp'] : null; + $end_timestamp = (isset($date['end']) and isset($date['end']['timestamp'])) ? $date['end']['timestamp'] : null; + + // Invalid Date + if (!$start_timestamp or !$end_timestamp) return ''; + + // Not Booked + if (!$this->main->is_user_booked($user_id, $mec_current_event->ID, $start_timestamp)) return ''; + + // Booked + return $content; + } + + public function register_assets_per_page_meta_boxes() + { + $post_types = $this->assets_per_page_post_types(); + add_meta_box('mec_metabox_app', esc_html__('Include MEC Assets', 'modern-events-calendar-lite'), [$this, 'meta_box_assets_per_page'], $post_types, 'side', 'low'); + } + + public function meta_box_assets_per_page($post) + { + $mec_include_assets = get_post_meta($post->ID, 'mec_include_assets', true); + ?> +
        + +
        + assets_per_page_post_types(); + + // Not a Supported Post Type + if (!in_array($post->post_type, $post_types)) return; + + if (isset($_POST['mec_include_assets'])) + { + $mec_include_assets = sanitize_text_field($_POST['mec_include_assets']); + update_post_meta($post_id, 'mec_include_assets', $mec_include_assets); + } + } + + public function assets_per_page($status) + { + global $post; + $status_per_page = 1; + if ($post) + { + $post_types = $this->assets_per_page_post_types(); + + if (isset($post->post_type) and in_array($post->post_type, $post_types)) + { + $status_per_page = get_post_meta($post->ID, 'mec_include_assets', true); + if (trim($status_per_page) == '') $status_per_page = 0; + } + } + + if (is_plugin_active('buddyboss-platform/bp-loader.php') && + is_plugin_active('mec-buddyboss/mec-buddyboss.php') && + (isset($this->settings['assets_per_page_status']) and $this->settings['assets_per_page_status'])) + { + + if (isset($post->is_page) && $status_per_page == 0) $status_per_page = 1; + + return (boolean) $status_per_page; + } + + // Turned Off + if (!isset($this->settings['assets_per_page_status']) or (isset($this->settings['assets_per_page_status']) and !$this->settings['assets_per_page_status'])) return $status; + // Turned On + else + { + $status = (boolean) $status_per_page; + } + + return $status; + } + + public function assets_per_page_post_types() + { + return apply_filters('mec_assets_per_page_post_types', ['page', 'post', 'forum', 'topic', 'reply']); + } + + public function page_title($title) + { + // Occurrences Status + $occurrences_status = (isset($this->settings['per_occurrences_status']) and $this->settings['per_occurrences_status'] and $this->getPRO()); + + if (is_singular($this->main->get_main_post_type()) and $occurrences_status) + { + global $post; + + $timestamp = ((isset($_GET['time']) and $_GET['time']) ? (int) sanitize_text_field($_GET['time']) : null); + + $occurrence = (isset($_GET['occurrence']) ? sanitize_text_field($_GET['occurrence']) : null); + if (!$timestamp and $occurrence) $timestamp = strtotime($occurrence) + (int) get_post_meta($post->ID, 'mec_start_day_seconds', true); + + if (!$timestamp) + { + $render = $this->getRender(); + $dates = $render->dates($post->ID, null, 1, date('Y-m-d', strtotime('Yesterday'))); + + if (isset($dates[0]) and isset($dates[0]['start']) and isset($dates[0]['start']['timestamp'])) $timestamp = $dates[0]['start']['timestamp']; + } + + $title = MEC_feature_occurrences::param($post->ID, $timestamp, 'title', $title); + } + + return $title; + } + + public function dropdown() + { + // Check if our nonce is set. + if (!isset($_POST['_wpnonce'])) $this->main->response(['success' => 0, 'code' => 'NONCE_MISSING']); + + // Verify that the nonce is valid. + if (!wp_verify_nonce(sanitize_text_field($_POST['_wpnonce']), 'mec_occurrences_dropdown')) $this->main->response(['success' => 0, 'code' => 'NONCE_IS_INVALID']); + + $date = isset($_POST['date']) ? sanitize_text_field($_POST['date']) : ''; + $id = isset($_POST['id']) ? sanitize_text_field($_POST['id']) : ''; + + // Date is invalid! + if (!trim($date) or !trim($id)) $this->main->response(['success' => 0, 'code' => 'DATE_OR_ID_IS_INVALID']); + + $dates = explode(':', $date); + + $limit = 100; + $now = $dates[0]; + $_6months_ago = strtotime('-6 Months', $now); + + $occ = new MEC_feature_occurrences(); + $occurrences = $occ->get_dates($id, $now, $limit); + + $date_format = get_option('date_format'); + $time_format = get_option('time_format'); + $datetime_format = $date_format . ' ' . $time_format; + + $success = 0; + $html = ''; + + $i = 1; + foreach ($occurrences as $occurrence) + { + $success = 1; + $html .= ''; + $i++; + } + + if (count($occurrences) >= $limit and isset($occurrence)) $html .= ''; + + $this->main->response(['success' => $success, 'html' => $html]); + } + + public function upload_mimes($mimes) + { + if (!is_array($mimes)) return $mimes; + + if (!isset($mimes['zip'])) $mimes['zip'] = 'application/zip'; + return $mimes; + } + + /** + * @param $skin + * @param array $options + * @return string + */ + public function search_form_event_fields($skin, $options = []) + { + // Feature Disabled + if (!isset($this->settings['display_event_fields_search']) or (isset($this->settings['display_event_fields_search']) and !$this->settings['display_event_fields_search'])) return ''; + + $event_fields = $this->main->get_event_fields(); + $field_options = (isset($options['fields']) and is_array($options['fields']) and count($options['fields'])) ? $options['fields'] : []; + + // No Fields + if (!is_array($event_fields) or (is_array($event_fields) and !count($event_fields))) return ''; + + ob_start(); + foreach ($event_fields as $field_id => $event_field) + { + // Templates + if (!is_numeric($field_id)) continue; + + $label = isset($event_field['label']) ? $event_field['label'] : ''; + $type = isset($event_field['type']) ? $event_field['type'] : ''; + + if (!$label or !$type) continue; + if (in_array($type, ['p', 'email', 'url', 'tel'])) continue; + ?> +
        + + +
        + ' . esc_html__('Event Fields', 'modern-events-calendar-lite') . '
        ' . $fields; + return $fields; + } + + /** + * @return void + */ + public function download_debug_log_file() + { + if (!isset($_REQUEST['mec-download-log-file']) || !$_REQUEST['mec-download-log-file']) return; + + // Current User is not Permitted + if (!current_user_can('manage_options')) return; + + $log_file = WP_CONTENT_DIR . '/debug.log'; + if (defined('WP_DEBUG_LOG') && is_string(WP_DEBUG_LOG)) $log_file = WP_DEBUG_LOG; + + header('Content-Type: application/octet-stream'); + header('Content-Disposition: attachment; filename=' . basename('debug.log')); + header('Expires: 0'); + header('Cache-Control: must-revalidate'); + header('Pragma: public'); + header('Content-Length: ' . filesize($log_file)); + readfile($log_file); + exit; + } + + /** + * @return void + */ + public function rerun_sql() + { + // Current User is not Permitted + if (!current_user_can('manage_options')) return; + + // Create Tables + $this->main->create_mec_tables(); + + // Response + wp_send_json(["success" => 1, 'message' => esc_html__('Database setup is done.')]); + } +} diff --git a/app/features/mec/addons.php b/app/features/mec/addons.php new file mode 100755 index 0000000..e2d31b2 --- /dev/null +++ b/app/features/mec/addons.php @@ -0,0 +1,75 @@ + +
        +
        +
        +
        +

        +
        +
        + main->get_styling(); $darkadmin_mode = ( isset($styling['dark_mode']) ) ? $styling['dark_mode'] : ''; if ($darkadmin_mode == 1): $darklogo = plugin_dir_url(__FILE__ ) . '../../../assets/img/mec-logo-w2.png'; else: $darklogo = plugin_dir_url(__FILE__ ) . '../../../assets/img/mec-logo-w.png'; endif; ?> + + +
        +
        +
        +
        + + +
        + + $value) : ?> +
        +
        +
        +
        +
        name); ?>
        + comingsoon == 'false' ) : ?> + pro == 'true' ) : ?> +
        Requires Pro Version
        + +
        Requires Pro / Lite Version
        + + +
        +
        +
        +

        desc); ?>

        +
        +
        + +
        +
        +
        + + +
        +
        +

        + "file_get_contents" and "Curl" functions are not activated on your server. Please contact your host provider in this regard.', 'modern-events-calendar-lite'); ?> +

        +
        +
        + +
        + +
        +
        \ No newline at end of file diff --git a/app/features/mec/booking.php b/app/features/mec/booking.php new file mode 100755 index 0000000..9f98b07 --- /dev/null +++ b/app/features/mec/booking.php @@ -0,0 +1,1557 @@ +main->is_multilingual(); +$locale = $this->main->get_backend_active_locale(); + +$settings = $this->main->get_settings(); +$ml_settings = $this->main->get_ml_settings(NULL, $locale); + +$fees = $settings['fees'] ?? []; +$ticket_variations = $settings['ticket_variations'] ?? []; + +// WordPress Pages +$pages = get_pages(); + +// User Roles +$roles = array_reverse(wp_roles()->roles); + +$bfixed_fields = $this->main->get_bfixed_fields(); +if(!is_array($bfixed_fields)) $bfixed_fields = []; + +// Booking form +$mec_email = false; +$mec_name = false; + +$reg_fields = $this->main->get_reg_fields(); +if(!is_array($reg_fields)) $reg_fields = []; + +foreach($reg_fields as $field) +{ + if(isset($field['type'])) + { + if($field['type'] == 'name') $mec_name = true; + if($field['type'] == 'mec_email') $mec_email = true; + } + else break; +} + +if(!$mec_name) +{ + array_unshift( + $reg_fields, + array( + 'mandatory' => '0', + 'type' => 'name', + 'label' => esc_html__('Name', 'modern-events-calendar-lite'), + ) + ); +} + +if(!$mec_email) +{ + array_unshift( + $reg_fields, + array( + 'mandatory' => '0', + 'type' => 'mec_email', + 'label' => esc_html__('Email', 'modern-events-calendar-lite'), + ) + ); +} + +// Payment Gateways +$gateways = $this->main->get_gateways(); +$gateways_options = $this->main->get_gateways_options(); +?> +
        +
        +
        + + +
        + +
        + +
        + main->get_sidebar_menu('booking'); ?> +
        + +
        +
        +
        +
        +
        + +
        + +
        +

        + + main->getPRO()): ?> +
        main->get_pro_link()).'" target="_blank">'.esc_html__('Pro version of Modern Events Calendar', 'modern-events-calendar-lite').''); ?>
        + +
        + +

        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        + +
        + +
        +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        "> +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        + +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        +
        +
        +
        +
        + +
        +
        +
        +
        + +
        +
        +
        +
        + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        + +
        +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        + +
        +
        +
        + +
        + +
        +
        +
        +
        + +
        + +
        +
        +
        +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        +
        + +
        +
        + $role): $wcb_value = $settings['booking_wcb_' . $role_key] ?? 1; ?> +
        +
        + +
        +
        + +
        + +
        +
        +
        +
        +
        + +
        +
        +
        +
        + +
        +
        +
        +
        +
        + +
        +
        +
        +
        + +
        +
        +
        +
        + +
        +
        + +
        +
        + +
        +
        + + +
        + + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        + +
        +
        + + main->getPRO()): ?> +
        main->get_pro_link()).'" target="_blank">'.esc_html__('Pro version of Modern Events Calendar', 'modern-events-calendar-lite').''); ?>
        + +
        +
        +

        [mec-booking event-id="1"]'); ?>

        +

        ticket-id="1"'); ?>

        +
        +
        + + +
        +
        + +
        + +
        +


        +
        +
        + +
        + +
        +

        +
        + +
        +
        +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        +
        + +
        + + +
        +
        +
        +
        + +
        +
        +
        + +
        +
        +
        + + +
        +
        +

        +
        + +
        +
        +
        + +
        + + main->getPRO()): ?> +
        main->get_pro_link()).'" target="_blank">'.esc_html__('Pro version of Modern Events Calendar', 'modern-events-calendar-lite').''); ?>
        + +
        + +

        Webhooks", 'modern-events-calendar-lite'); ?>

        +
        + +
        +
        + settings ) ?> + +
        + + settings['booking_status']) and $this->settings['booking_status']): ?> + + main, $this->settings); ?> + +
        +

        +
        +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        +
        + +
        +
        +
        +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        +
        + +
        +
        +
        +
        + +
        +
        +
        +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        +
        + +
        +
        +
        + +
        +

        +
        + +
        +
        +
        +
        +
        +
        +
        +
        + main->getTickets()->builder([ + 'tickets' => $settings['tickets'] ?? [], + 'name_prefix' => 'mec[settings][tickets]', + 'object_id' => null, + ]); ?> +
        +
        + +
        +

        + + main->getPRO()): ?> +
        main->get_pro_link()).'" target="_blank">'.esc_html__('Pro version of Modern Events Calendar', 'modern-events-calendar-lite').''); ?>
        + +
        + +

        Booking", 'modern-events-calendar-lite'); ?>

        +
        +
        +
        + +
        + +
        +

        + + main->getPRO()): ?> +
        main->get_pro_link()).'" target="_blank">'.esc_html__('Pro version of Modern Events Calendar', 'modern-events-calendar-lite').''); ?>
        + +
        + +
        +
        +
        + +
        +
        + $fee): if(!is_numeric($key)) continue; $i = max($i, $key); ?> +
        +
        + +
        +
        + + + +
        +
        +

        +
        + +
        +
        + + + + +
        +
        + +
        + +
        +
        +
        + +
        +
        + + + +
        +
        +

        +
        + +
        +
        + + + + +
        +
        +
        + + +
        +
        + +
        + + + +
        + +
        + + +
        +
        +
        + +

        +
        +
        +
        + +
        + +
        +

        + + main->getPRO()): ?> +
        main->get_pro_link()).'" target="_blank">'.esc_html__('Pro version of Modern Events Calendar', 'modern-events-calendar-lite').''); ?>
        + +
        + +
        +
        +
        + +
        +
        + getTicketVariations(); + $i = 0; + foreach($ticket_variations as $key => $ticket_variation) + { + if(!is_numeric($key)) continue; + $i = max($i, $key); + + $TicketVariations->item([ + 'i' => $i, + 'name_prefix' => 'mec[settings][ticket_variations]', + 'value' => $ticket_variation, + ]); + } + ?> +
        + +
        + item([ + 'i' => ':i:', + 'name_prefix' => 'mec[settings][ticket_variations]', + 'value' => [], + ]); + ?> +
        +
        + +
        +
        +
        +
        +

        [mec-ticket-variations event-id="10"]'); ?>

        +
        +
        +
        + +
        + +
        +

        +
        +
        +
        + + +
        + + + +
          + $reg_field) + { + if(!is_numeric($key)) continue; + $i = max( $i, $key ); + + if($reg_field['type'] == 'text') echo MEC_kses::form($this->main->field_text($key, $reg_field)); + elseif($reg_field['type'] == 'name') echo MEC_kses::form($this->main->field_name($key, $reg_field)); + elseif($reg_field['type'] == 'mec_email') echo MEC_kses::form($this->main->field_mec_email($key, $reg_field)); + elseif($reg_field['type'] == 'email') echo MEC_kses::form($this->main->field_email($key, $reg_field)); + elseif($reg_field['type'] == 'date') echo MEC_kses::form($this->main->field_date($key, $reg_field)); + elseif($reg_field['type'] == 'file') echo MEC_kses::form($this->main->field_file($key, $reg_field)); + elseif($reg_field['type'] == 'tel') echo MEC_kses::form($this->main->field_tel($key, $reg_field)); + elseif($reg_field['type'] == 'textarea') echo MEC_kses::form($this->main->field_textarea($key, $reg_field)); + elseif($reg_field['type'] == 'p') echo MEC_kses::form($this->main->field_p($key, $reg_field)); + elseif($reg_field['type'] == 'checkbox') echo MEC_kses::form($this->main->field_checkbox($key, $reg_field)); + elseif($reg_field['type'] == 'radio') echo MEC_kses::form($this->main->field_radio($key, $reg_field)); + elseif($reg_field['type'] == 'select') echo MEC_kses::form($this->main->field_select($key, $reg_field)); + elseif($reg_field['type'] == 'agreement') echo MEC_kses::form($this->main->field_agreement($key, $reg_field)); + } + ?> +
        +
        + + + + + + + + + + + + + +
        + +
        + +
        + +
        +
        + main->field_text(':i:')); ?> +
        +
        + main->field_email(':i:')); ?> +
        +
        + main->field_mec_email(':i:')); ?> +
        +
        + main->field_name(':i:')); ?> +
        +
        + main->field_tel(':i:')); ?> +
        +
        + main->field_date(':i:')); ?> +
        +
        + main->field_file(':i:')); ?> +
        +
        + main->field_textarea(':i:')); ?> +
        +
        + main->field_checkbox(':i:')); ?> +
        +
        + main->field_radio(':i:')); ?> +
        +
        + main->field_select(':i:')); ?> +
        +
        + main->field_agreement(':i:')); ?> +
        +
        + main->field_p(':i:')); ?> +
        +
        + main->field_option(':fi:', ':i:')); ?> +
        +
        +
        +
        +
        +
        + + +
        + + + +
          + $bfixed_field) + { + if(!is_numeric($key)) continue; + $b = max($b, $key); + + if( !isset($bfixed_field['type']) ) continue; + + if($bfixed_field['type'] == 'text') echo MEC_kses::form($this->main->field_text($key, $bfixed_field, 'bfixed')); + elseif($bfixed_field['type'] == 'name') echo MEC_kses::form($this->main->field_name($key, $bfixed_field, 'bfixed')); + elseif($bfixed_field['type'] == 'mec_email') echo MEC_kses::form($this->main->field_mec_email($key, $bfixed_field, 'bfixed')); + elseif($bfixed_field['type'] == 'email') echo MEC_kses::form($this->main->field_email($key, $bfixed_field, 'bfixed')); + elseif($bfixed_field['type'] == 'date') echo MEC_kses::form($this->main->field_date($key, $bfixed_field, 'bfixed')); + elseif($bfixed_field['type'] == 'file') echo MEC_kses::form($this->main->field_file($key, $bfixed_field, 'bfixed')); + elseif($bfixed_field['type'] == 'tel') echo MEC_kses::form($this->main->field_tel($key, $bfixed_field, 'bfixed')); + elseif($bfixed_field['type'] == 'textarea') echo MEC_kses::form($this->main->field_textarea($key, $bfixed_field, 'bfixed')); + elseif($bfixed_field['type'] == 'p') echo MEC_kses::form($this->main->field_p($key, $bfixed_field, 'bfixed')); + elseif($bfixed_field['type'] == 'checkbox') echo MEC_kses::form($this->main->field_checkbox($key, $bfixed_field, 'bfixed')); + elseif($bfixed_field['type'] == 'radio') echo MEC_kses::form($this->main->field_radio($key, $bfixed_field, 'bfixed')); + elseif($bfixed_field['type'] == 'select') echo MEC_kses::form($this->main->field_select($key, $bfixed_field, 'bfixed')); + elseif($bfixed_field['type'] == 'agreement') echo MEC_kses::form($this->main->field_agreement($key, $bfixed_field, 'bfixed')); + } + ?> +
        +
        + + + + + + + + + + +
        + +
        +
        + + +
        + +
        + +
        +
        + main->field_text(':i:', array(), 'bfixed')); ?> +
        +
        + main->field_email(':i:', array(), 'bfixed')); ?> +
        +
        + main->field_tel(':i:', array(), 'bfixed')); ?> +
        +
        + main->field_date(':i:', array(), 'bfixed')); ?> +
        +
        + main->field_textarea(':i:', array(), 'bfixed')); ?> +
        +
        + main->field_checkbox(':i:', array(), 'bfixed')); ?> +
        +
        + main->field_radio(':i:', array(), 'bfixed')); ?> +
        +
        + main->field_select(':i:', array(), 'bfixed')); ?> +
        +
        + main->field_agreement(':i:', array(), 'bfixed')); ?> +
        +
        + main->field_p(':i:', array(), 'bfixed')); ?> +
        +
        + main->field_option(':fi:', ':i:', array(), 'bfixed')); ?> +
        +
        +
        + + +
        + +
        +

        +
        + + +
        +
        + +

        +
        + + +

        + + +

        +
          +
        • +
        • +
        • +
        • +
        • +
        • +
        + +
        + +
        + + +
        +
        +

        +

        +
        + +
        +
        +
        +
        + +
        + +
        +
        +
        + +
        + + +
        +
        +

        +

        +
        + +
        +
        +
        +
        +
        +
        + + +
        +
        +
          + +
        • + options_form(); ?> +
        • + +
        +
        +
        +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        +
        + +
        + +

        +
        +
        +
        +
        +
        + + +
        +
        +
        + +
        +

        +
        +
        + +

        +
        +

        +
          +
        • +
        • +
        • +
        • +
        • +
        • +
        • +
        + +
        + +
        + +

        [mec-cart]'); ?>

        +
        +
        +
        + +
        + +

        [mec-checkout]'); ?>

        +
        +
        +
        + +
        + +
        +
        +
        +
        + +
        +
        +
        +
        +
        +
        + + + +
        + + + + + +
        +
        + +
        +
        +
        +
        + + + +
        + +factory->params('footer', ''); \ No newline at end of file diff --git a/app/features/mec/dashboard.php b/app/features/mec/dashboard.php new file mode 100755 index 0000000..ae5af98 --- /dev/null +++ b/app/features/mec/dashboard.php @@ -0,0 +1,384 @@ +get_main_post_type()); +$user_post_count = $count_events->publish ?? '0'; + +// user calendar created +$count_calendars = wp_count_posts('mec_calendars'); +$user_post_count_c = $count_calendars->publish ?? '0'; + +// mec location +$user_location_count_l = wp_count_terms('mec_location', array( + 'hide_empty' => false, + 'parent' => 0 +)); + +// mec organizer +$user_organizer_count_l = wp_count_terms('mec_organizer', array( + 'hide_empty' => false, + 'parent' => 0 +)); + +$version = $verify = NULL; +if ($this->getPRO()) $mec_license_status = get_option('mec_license_status'); + +// MEC Database +$db = $this->getDB(); + +// MEC Settings +$settings = $this->get_settings(); + +// MEC Booking Status +$booking_status = ($this->getPRO() and isset($settings['booking_status']) and $settings['booking_status']); + +// Add ChartJS library +if ($booking_status) wp_enqueue_script('mec-chartjs-script'); + +// Whether to show dashboard boxes or not! +$box_support = apply_filters('mec_dashboard_box_support', true); +$box_stats = apply_filters('mec_dashboard_box_stats', true); +?> + +
        +
        +
        +
        +

        user_firstname); ?>

        +
        + ' . ($this->getPRO() ? esc_html__('Modern Events Calendar', 'modern-events-calendar-lite') : esc_html__('Modern Events Calendar (Lite)', 'modern-events-calendar-lite')) . ''); ?> +
        +
        +
        + get_styling(); + $darkadmin_mode = $styling['dark_mode'] ?? ''; + if ($darkadmin_mode == 1): $darklogo = plugin_dir_url(__FILE__) . '../../../assets/img/mec-logo-w2.png'; + else: $darklogo = plugin_dir_url(__FILE__) . '../../../assets/img/mec-logo-w.png'; + endif; ?> + + +
        +
        +
        + +
        +
        +
        + +
        +
        + getPRO()): ?> +
        +
        +
        +

        + ' . esc_html__('lite', 'modern-events-calendar-lite') . ''); ?> +

        + + + +
        + +
        + +
        +
        +
        + + mec_custom_msg_2('yes', 'yes')); ?> + mec_custom_msg('yes', 'yes')); ?> +
        +
        +
        +
        +

        +

        +
        +
        + +
        + +
        +
        + getPRO() && has_action('addons_activation')) : ?> +
        +
        +
        + +
        + +
        +
        + +
        +
        + +
        +
        +
        + +
        +

        +
        + +
        +
        + + getPRO()) : ?> +
        +
        +
        + +
        + +
        +

        +
        + +
        +
        + + +
        +
        +
        + ' . esc_html__('Troubleshooting', 'modern-events-calendar-lite') . ''; + ?> +
        +
        +
        + +
        + +
        +
        + +
        +
        +
        + +
        +

        +
        + +
        +
        + + +
        +
        +
        +

        ' . esc_html($user_post_count) . '

        ' . esc_html__('Events', 'modern-events-calendar-lite'); ?>

        +
        +
        +
        +
        +
        +
        +

        ' . esc_html($user_post_count_c) . '

        ' . esc_html__('Shortcodes', 'modern-events-calendar-lite'); ?>

        +
        +
        +
        +
        +
        +
        +

        ' . esc_html($user_location_count_l) . '

        ' . esc_html__('Locations', 'modern-events-calendar-lite'); ?>

        +
        +
        +
        +
        +
        +
        +

        ' . esc_html($user_organizer_count_l) . '

        ' . esc_html__('Organizers', 'modern-events-calendar-lite'); ?>

        +
        +
        +
        + +
        + +
        +
        +
        +
        + +
        +
        + getRender(); + echo MEC_kses::full($render->skin('list', array( + 'sk-options' => array('list' => array( + 'style' => 'minimal', + 'start_date_type' => 'today', + 'pagination_method' => '0', + 'limit' => '6', + 'month_divider' => '0', + 'load_more_button' => false, + 'ignore_js' => true + )) + ))); + ?> +
        +
        +
        + +
        +
        +
        + +
        +
        + select("SELECT COUNT(`meta_id`) AS count, `meta_value` AS gateway FROM `#__postmeta` WHERE `meta_key`='mec_gateway' GROUP BY `meta_value`", 'loadAssocList'); + + $labels = ''; + $data = ''; + $bg_colors = ''; + + foreach ($results as $result) { + if (!class_exists($result['gateway'])) { + continue; + } + + $gateway = new $result['gateway']; + $stats[] = array('label' => $gateway->title(), 'count' => $result['count']); + + $labels .= '"' . esc_html($gateway->title()) . '",'; + $data .= ((int) $result['count']) . ','; + $bg_colors .= "'" . $gateway->color() . "',"; + } + echo ''; + + $this->getFactory()->params('footer', ''); + ?> +
        +
        +
        + +
        + widget_total_bookings(); ?> + + + getPRO()) (new MEC_feature_mec())->widget_print(); ?> + +
        +
        +
        +
        + +
        +
        +
        +
        +
        +
        +
        +
        +
        \ No newline at end of file diff --git a/app/features/mec/dyncss.php b/app/features/mec/dyncss.php new file mode 100755 index 0000000..bdfe8e9 --- /dev/null +++ b/app/features/mec/dyncss.php @@ -0,0 +1,392 @@ +main->get_styling(); + +// colorskin +$color = ''; + +function mec_dyn_hex2rgb($cc) +{ + if($cc[0] == '#') $cc = substr($cc, 1); + + if(strlen($cc) == 6) list($r, $g, $b) = array($cc[0] . $cc[1], $cc[2] . $cc[3], $cc[4] . $cc[5]); + elseif(strlen($cc) == 3) list($r, $g, $b) = array($cc[0] . $cc[0], $cc[1] . $cc[1], $cc[2] . $cc[2]); + else return false; + + $r = ((!function_exists('ctype_xdigit') or (function_exists('ctype_xdigit') and ctype_xdigit($r))) ? hexdec($r) : NULL); + $g = ((!function_exists('ctype_xdigit') or (function_exists('ctype_xdigit') and ctype_xdigit($g))) ? hexdec($g) : NULL); + $b = ((!function_exists('ctype_xdigit') or (function_exists('ctype_xdigit') and ctype_xdigit($b))) ? hexdec($b) : NULL); + + if(is_null($r) or is_null($g) or is_null($b)) return false; + else return array('red' => $r, 'green' => $g, 'blue' => $b); +} + +if(isset($styling['color']) && $styling['color']) $color = $styling['color']; +elseif(isset($styling['mec_colorskin'])) $color = $styling['mec_colorskin']; + +$rgb_color = '64,217,241'; +if(!empty($color)) $rgb_color = mec_dyn_hex2rgb($color); + +// Typography +$mec_h_fontfamily_arr = $mec_p_fontfamily_arr = $fonts_url = $mec_container_normal_width = $mec_container_large_width = ''; + +if(isset($styling['mec_h_fontfamily']) && $styling['mec_h_fontfamily']) +{ + $mec_h_fontfamily_arr = $styling['mec_h_fontfamily']; + $mec_h_fontfamily_arr = str_replace("[", "", $mec_h_fontfamily_arr); + $mec_h_fontfamily_arr = str_replace("]", "", $mec_h_fontfamily_arr); + $mec_h_fontfamily_arr = explode(",", $mec_h_fontfamily_arr); +} + +if(isset($styling['mec_p_fontfamily']) && $styling['mec_p_fontfamily']) +{ + $mec_p_fontfamily_arr = $styling['mec_p_fontfamily']; + $mec_p_fontfamily_arr = str_replace("[", "", $mec_p_fontfamily_arr); + $mec_p_fontfamily_arr = str_replace("]", "", $mec_p_fontfamily_arr); + $mec_p_fontfamily_arr = explode(",", $mec_p_fontfamily_arr); +} + +if((is_array($mec_h_fontfamily_arr) && $mec_h_fontfamily_arr) || (is_array($mec_p_fontfamily_arr) && $mec_p_fontfamily_arr)) +{ + //Google font + $font_families = []; + $subsets = 'latin,latin-ext'; + $variant_h = ''; + $variant_p = ''; + $mec_h_fontfamily_array = ''; + if ( is_array($mec_h_fontfamily_arr) && $mec_h_fontfamily_arr ) : + foreach($mec_h_fontfamily_arr as $key=>$mec_h_fontfamily_array) { + if($key != '0') $variant_h .= $mec_h_fontfamily_array .', '; + } + endif; + + if ( is_array($mec_p_fontfamily_arr) && $mec_p_fontfamily_arr ) : + foreach($mec_p_fontfamily_arr as $key=>$mec_p_fontfamily_array) { + if($key != '0') $variant_p .= $mec_h_fontfamily_array .', '; + } + endif; + + $font_families[] = !empty($mec_h_fontfamily_arr[0]) ? $mec_h_fontfamily_arr[0] . ':' . $variant_h : ''; + $font_families[] = !empty($mec_p_fontfamily_arr[0]) ? $mec_p_fontfamily_arr[0] . ':' . $variant_p : ''; + + if($font_families) + { + $fonts_url = add_query_arg(array( + 'family'=>urlencode(implode('|', $font_families)), + 'subset'=>urlencode($subsets), + ), 'https://fonts.googleapis.com/css'); + } +} + +if(isset($styling['container_normal_width']) && $styling['container_normal_width']) +{ + $mec_container_normal_width = trim( $styling['container_normal_width'] ); + if($mec_container_normal_width ) { + if (is_numeric($mec_container_normal_width)) { + $mec_container_normal_width .= 'px'; + } + } +} + +if(isset($styling['container_large_width']) && $styling['container_large_width']) +{ + $mec_container_large_width = trim( $styling['container_large_width'] ); + if($mec_container_large_width ) { + if (is_numeric($mec_container_large_width)) { + $mec_container_large_width .= 'px'; + } + } +} +$title_color = $title_color_hover = $content_color = ''; +if(isset($styling['title_color']) && $styling['title_color']) +{ + $title_color = $styling['title_color']; +} + +if(isset($styling['title_color_hover']) && $styling['title_color_hover']) +{ + $title_color_hover = $styling['title_color_hover']; +} + +if(isset($styling['content_color']) && $styling['content_color']) +{ + $content_color = $styling['content_color']; +} + +ob_start(); + +echo ':root,::before,::after{'; + +// render headings font familty +if($mec_h_fontfamily_arr): ?> + /* == Custom Fonts For H Tag + ---------------- */ + --mec-heading-font-family: ''; + + + /* == Custom Fonts For P Tag + ---------------- */ + --mec-paragraph-font-family: ''; + + /* == TextColors + ---------------- */ + --mec-color-skin: ; + --mec-color-skin-rgba-1: rgba(,,,.25); + --mec-color-skin-rgba-2: rgba(,,,.5); + --mec-color-skin-rgba-3: rgba(,,,.75); + --mec-color-skin-rgba-4: rgba(,,,.11); + + --mec-color-skin: #40d9f1; + --mec-color-skin-rgba-1: rgba(64, 217, 241, .25); + --mec-color-skin-rgba-2: rgba(64, 217, 241, .5); + --mec-color-skin-rgba-3: rgba(64, 217, 241, .75); + --mec-color-skin-rgba-4: rgba(64, 217, 241, .11); + + --mec-container-normal-width: ; + + --mec-container-normal-width: 1196px; + + --mec-container-large-width: ; + + --mec-container-large-width: 1690px; + + --mec-title-color: ; + + --mec-title-color-hover: ; + + --mec-content-color: ; + + --mec-fes-main-color: ; + --mec-fes-main-color-rgba-1: rgba; + --mec-fes-main-color-rgba-2: rgba; + --mec-fes-main-color-rgba-3: rgba; + --mec-fes-main-color-rgba-4: rgba; + --mec-fes-main-color-rgba-5: rgb; + --mec-fes-main-color-rgba-6: rgba; + + --mec-fes-main-color: ; + --mec-fes-main-color-rgba-1: rgba; + --mec-fes-main-color-rgba-2: rgba; + --mec-fes-main-color-rgba-3: rgba; + --mec-fes-main-color-rgba-4: rgba; + --mec-fes-main-color-rgba-5: rgb; + --mec-fes-main-color-rgba-6: rgba; + + --mec-fluent-main-color: ; + --mec-fluent-main-color-rgba-1: rgba; + --mec-fluent-main-color-rgba-2: rgba; + --mec-fluent-main-color-rgba-3: rgba; + --mec-fluent-main-color-rgba-4: rgba; + --mec-fluent-main-color-rgba-5: rgba; + --mec-fluent-main-color-rgba-6: rgba; + + --mec-fluent-main-color: ; + --mec-fluent-main-color-rgba-1: rgba; + --mec-fluent-main-color-rgba-2: rgba; + --mec-fluent-main-color-rgba-3: rgba; + --mec-fluent-main-color-rgba-4: rgba; + --mec-fluent-main-color-rgba-5: rgba; + --mec-fluent-main-color-rgba-6: rgba; + + --mec-fluent-bold-color: ; + + --mec-fluent-bold-color: ; + + --mec-fluent-bg-hover-color: ; + + --mec-fluent-bg-hover-color: ; + + --mec-fluent-bg-color: ; + + --mec-fluent-bg-color: ; + + --mec-fluent-second-bg-color: ; + + --mec-fluent-second-bg-color: ; + + .mec-fluent-wrap.mec-skin-list-wrap .mec-calendar, + .mec-fluent-wrap .mec-skin-weekly-view-events-container, + .mec-fluent-wrap .mec-daily-view-events-left-side, + .mec-fluent-wrap .mec-daily-view-events-right-side, + .mec-fluent-wrap .mec-yearly-view-wrap .mec-yearly-calendar-sec, + .mec-fluent-wrap .mec-yearly-view-wrap .mec-yearly-agenda-sec, + .mec-fluent-wrap.mec-skin-grid-wrap .mec-calendar, + .mec-fluent-wrap.mec-skin-tile-container .mec-calendar, + .mec-fluent-wrap.mec-events-agenda-container .mec-events-agenda-wrap { + max-height: unset !important; + } + + .mec-fes-form #mec_reg_form_field_types .button.red:before, .mec-fes-form #mec_reg_form_field_types .button.red { + border-color: #ffd2dd; + color: #ea6485; + } + + .mec-fes-form #mec_reg_form_field_types .button.red:hover, .mec-fes-form #mec_reg_form_field_types .button.red:before, .mec-fes-form #mec_reg_form_field_types .button:hover, .mec-fes-form #mec_bfixed_form_field_types .button:hover:before, .mec-fes-form #mec_reg_form_field_types .button:hover:before, .mec-fes-form #mec_bfixed_form_field_types .button:hover, .mec-fes-form .mec-form-row .button:not(.wp-color-result):hover { + color: #fff; + } + + .mec-fes-form .mec-meta-box-fields h4 label { + background: transparent; + } + + .mec-fluent-wrap.mec-skin-cover-container .mec-event-cover-fluent-type2 .mec-event-sharing-wrap:hover li a, .mec-single-fluent-wrap .mec-booking-button, .mec-single-fluent-wrap .mec-booking-button, .mec-single-fluent-wrap .mec-booking-button, .mec-fluent-wrap.mec-skin-cover-container .mec-event-cover-fluent-type1 .mec-booking-button, .mec-fluent-wrap.mec-skin-cover-container .mec-event-cover-fluent-type4 .mec-booking-button, .mec-fluent-wrap.mec-skin-cover-container .mec-event-cover-fluent-type3 .mec-booking-button { + color: #fff !important; + } + + .mec-fluent-wrap .mec-yearly-view-wrap .mec-agenda-events-wrap { + background-color: transparent !important; + } + .mec-fluent-wrap.mec-skin-cover-container .mec-event-cover-fluent-type1 .mec-date-wrap i, .mec-fluent-wrap.mec-skin-cover-container .mec-event-cover-fluent-type4 .mec-date-wrap i, .mec-fluent-wrap.mec-skin-cover-container .mec-event-cover-fluent-type2 .mec-date-wrap i { + background-color: #fff !important; + } + .mec-single-fluent-body .lity-content .mec-events-meta-group-booking button:hover, .mec-fluent-wrap.mec-single-fluent-wrap .mec-events-meta-group-booking button:hover { + background-color: #000 !important; + } + + .mec-fluent-wrap.mec-skin-cover-container .mec-event-sharing-wrap>li:first-of-type i, .mec-single-fluent-wrap .mec-single-event-bar .mec-booking-button, .mec-fluent-wrap.mec-skin-cover-container .mec-event-cover-fluent-type2 span.mec-event-day-num, .mec-fluent-wrap.mec-skin-cover-container .mec-event-cover-fluent-type2 .mec-event-sharing-wrap:hover li:first-child a { + color: #fff; + } + + .mec-fluent-wrap.mec-skin-cover-container .mec-event-cover-fluent-type1 .mec-booking-button:hover, .mec-fluent-wrap.mec-skin-cover-container .mec-event-cover-fluent-type4 .mec-booking-button:hover, .mec-fluent-wrap.mec-skin-cover-container .mec-event-cover-fluent-type3 .mec-booking-button:hover { + background-color: #fff; + } + main->is_multilingual(); +$locale = $this->main->get_backend_active_locale(); + +$settings = $this->main->get_settings(); +$ml_settings = $this->main->get_ml_settings(NULL, $locale); + +// WordPress Pages +$pages = get_pages(); + +// Event Fields +$event_fields = $this->main->get_event_fields(); + +$mec_categories = get_terms(array( + 'taxonomy' => 'mec_category', + 'hide_empty' => false, +)); +?> +
        +
        +
        + + +
        + +
        + +
        + main->get_sidebar_menu('fes'); ?> +
        + +
        +
        +
        +
        +
        + +
        + +
        +

        + +
        +
        +
        +
        +
        +
        + +
        + + +
        + +
        + +

        [MEC_fes_list]'); ?>

        +
        +
        +
        + +
        + +

        [MEC_fes_form]'); ?>

        +
        +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        +
        +
        + +
        + +
        +
        + +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        + + +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        + +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        +
        + +
        +

        + roles); ?> +
        +
        + + +
        +
        +

        +
        + +
        +
        +
        + + $r): ?> +
          +
        • + +
        • +
        + +
        +
        +
        + +
        +
        +
        + +
        +
        + +
        +
        +
        + +
        +

        + +
        + +
        + +
        + +
        +
        + +
        +
        + +
        +
        + +
        + +
        + +
        +
        + +
        + + +
        + +
        + + + +
        + +
        + + + +
        + +
        + + +
        + +
        +
        + +
        + +
        + + +
        +
        +

        +
        + +
        +
        + +
        + +
        +
        + +
        +
        + +
        +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        + +
        +
        +
        + +
        +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        +
        + +
        +
        + +
        +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        +
        + +
        + + getPRO()): ?> +
        + +
        +
        +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        + +
        +
        + +
        +
        + +
        +
        + +
        +
        + +
        +
        + +
        +
        + +
        +
        + +
        +
        + +
        +
        + +
        +
        + +
        +
        + +
        +
        + +
        + getPartialPayment()->is_payable_per_event_enabled()): ?> +
        + +
        + +
        + + +
        + +
        +
        + +
        + + +
        + +
        + + + +
        + +
        + + + +
        + +
        + + + +
        + +
        + + + +
        + +
        + + + +
        + +
        + + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        +
        + +
        +
        +
        + +
        +
        + +
        + +
        +
        +
        + + +
        + +
        +

        + + esc_html__('Event Description', 'modern-events-calendar-lite'), + 'excerpt' => esc_html__('Excerpt', 'modern-events-calendar-lite'), + 'dates' => esc_html__('Dates', 'modern-events-calendar-lite'), + 'cost' => esc_html__('Cost', 'modern-events-calendar-lite'), + 'event_link' => esc_html__('Event Link', 'modern-events-calendar-lite'), + 'more_info_link' => esc_html__('More Info Link', 'modern-events-calendar-lite'), + 'category' => esc_html__('Category', 'modern-events-calendar-lite'), + 'location' => esc_html__('Location', 'modern-events-calendar-lite'), + 'featured_image' => esc_html__('Featured Image', 'modern-events-calendar-lite'), + 'label' => esc_html__('Label', 'modern-events-calendar-lite')) as $req_field => $label): ?> +
        + +
        + +
        + +
        + + + + + +
        +
        + +
        +
        +
        +
        + + + +
        + +factory->params('footer', ''); \ No newline at end of file diff --git a/app/features/mec/gateways.php b/app/features/mec/gateways.php new file mode 100755 index 0000000..9fd1925 --- /dev/null +++ b/app/features/mec/gateways.php @@ -0,0 +1,3 @@ + +
        +
        +
        +
        +

        +
        +
        + main->get_styling(); $darkadmin_mode = ( isset($styling['dark_mode']) ) ? $styling['dark_mode'] : ''; if ($darkadmin_mode == 1): $darklogo = plugin_dir_url(__FILE__ ) . '../../../assets/img/mec-logo-w2.png'; else: $darklogo = plugin_dir_url(__FILE__ ) . '../../../assets/img/mec-logo-w.png'; endif; ?> + + +
        +
        +
        +
        +
        +
        +
        +
        Pro Features
        +
        +
        +
        +
        +
        Modern Events Calendar Pro
        +

        Modern Events Calendar has been created according to trending design methods and latest technology with attractive design. + We gathered all features of event calendar as you desire with advanced booking system and many other useful options which are practical in real world! Below you can see a list of some of the pro features:

        +
        +
          +
        • Booking System
        • +
        • Reporting Dashboard
        • +
        • Timetable View
        • +
        • Map view + Directions
        • +
        • Reminders Notification
        • +
        • Weather module
        • +
        • PDF invoice
        • +
        • Mailchimp Integration
        • +
        • Campaign Monitor Integration
        • +
        +
          +
        • Cancellation Booking
        • +
        • Attendee list
        • +
        • Organizer payment (Commission System)
        • +
        • Advanced Tax/Fee system
        • +
        • Ticket Variations
        • +
        • Coupons/Discount system
        • +
        • Synchronization
        • +
        • MailerLite Integration
        • +
        • Constant Contact Integration
        • +
        +
        +
        Find out more +
        +
        +
        +
        +
        +
        +
        +
        +
        +
        +

        + '.esc_html__('lite', 'modern-events-calendar-lite').''); ?> +

        + + + +
        + +
        + +
        +
        +
        +
        +
        \ No newline at end of file diff --git a/app/features/mec/ie.php b/app/features/mec/ie.php new file mode 100755 index 0000000..b66531d --- /dev/null +++ b/app/features/mec/ie.php @@ -0,0 +1,59 @@ + + +
        + +
        + +
        + main->get_sidebar_menu('ie'); ?> +
        + +
        + +
        + +
        +
        +
        +
        +
        +

        +
        +

        +

        +
        +
        +
        + +
        +
        +
        +
        +
        + +
        +
        +
        + +
        + +
        +
        + +
        +
        +
        +
        +
        +
        +
        + +
        + +
        \ No newline at end of file diff --git a/app/features/mec/index.html b/app/features/mec/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/features/mec/integrations.php b/app/features/mec/integrations.php new file mode 100755 index 0000000..0261452 --- /dev/null +++ b/app/features/mec/integrations.php @@ -0,0 +1,517 @@ +main->get_settings(); + +// WordPress Pages +$pages = get_pages(); + +// MEC Categories +$categories = get_terms(array( + 'taxonomy' => 'mec_category', + 'hide_empty' => 0, +)); +if(!is_array($categories)) $categories = []; +?> +
        +
        +
        + + +
        + +
        + +
        + main->get_sidebar_menu('integrations'); ?> +
        + +
        +
        +
        +
        +
        + +
        + + main->getPRO()): ?> + +
        +

        +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        + +
        +
        +
        + +
        +

        +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        +
        + +
        +

        +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        +
        + +
        +

        +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        + null, + 'timeout' => '10', + 'redirection' => '10', + 'headers' => array('Content-Type' => 'application/json', 'Authorization' => 'Bearer ' . $settings['constantcontact_access_token']), + ))); + } + ?> + +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        +
        + +
        +

        +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        +
        + +
        +

        +
        + +
        +
        +
        + +
        + +
        +
        +

        AWeber for WordPress'); ?>

        +

        '.esc_html__('here', 'modern-events-calendar-lite').''); ?>

        +
        +
        + +
        +

        +
        + +
        +
        + getLists(); ?> +
        + +
        + +
        +
        + +

        MailPoet'); ?>

        +
        +
        + +
        +

        +
        + +
        +
        + + +
        + +
        + +
        +
        + +

        WP Sendfox'); ?>

        +
        +
        + +
        +

        +
        + +
        +
        +
        + +
        +
        + +
        + +
        +
        +
        + +
        +
        + +
        +
        +
        +
        +

        +
        + +

        +
        +
        +
        + +
        + +
        +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        +
        +
        +

        +
        + +
        +
        + +
        +
        + +
          + id]) and is_array($pmp_booking[$level->id])) ? $pmp_booking[$level->id] : []); ?> +
        • +
          name); ?>
          +
            + +
          • + +
          • + +
          +
        • + +
        + +
        +
        + +
        +

        +
        + + + + + +
        + + +
        +
        + +
        +
        +
        +
        + + + +
        +getFactory()->params('footer', function() +{ + ?> + + main->is_multilingual(); +$locale = $this->main->get_backend_active_locale(); + +$messages = $this->main->get_messages(); +$values = $this->main->get_messages_options(($multilingual ? $locale : NULL)); +?> +
        + +
        +
        + + +
        + +
        + +
        + main->get_sidebar_menu('messages'); ?> +
        + +
        + +
        + +
        +
        +
        +
        +
        +

        +

        +
        +
          + $category): ?> +
        • +
          +
            + $message): ?> +
          • + + +
          • + +
          +
        • + +
        +
        +
        + + + + + +
        +
        +
        +
        +
        +
        +
        + + + +
        + +getFactory()->params('footer', function() +{ + ?> + + main->get_skins(); +$selected_skin = get_post_meta($post->ID, 'skin', true); +$sk_options = get_post_meta($post->ID, 'sk-options', true); + +// MEC Events +$events = $this->main->get_events(); + +// Upcoming Events +$upcoming_event_ids = $this->main->get_upcoming_event_ids(); +?> +
        + + +
        +
        + + +
        + +
        + + +
        + +
        + + +
        +
        + + +
        + +
        +
        + +
        + + +
        + + +
        +
        +

        +
        + +
        +
        +
        + + order_method_field('list', (isset($sk_options_list['order_method']) ? $sk_options_list['order_method'] : 'ASC'))); ?> +
        + + + +
        +
        +

        +
        + +
        +
        +
        + + + + + +
        +
        +

        +
        + +
        +
        +
        + + + + + +
        +
        +

        +
        + +
        +
        +
        + + + +
        +
        +

        +
        + +
        +
        +
        + + + + +
        +
        +

        +
        + +
        +
        +
        + + + +
        +
        +

        +
        + +
        +
        + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + display_pagination_field('list', $sk_options_list)); ?> +
        +
        + +
        +
        + + /> + +
        +
        + display_price_field('list', (isset($sk_options_list['display_price']) ? $sk_options_list['display_price'] : 0))); ?> + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + + settings['organizers_status']) || $this->settings['organizers_status']) echo MEC_kses::form($this->display_organizer_field('list', $sk_options_list['display_organizer'] ?? 0)); ?> + +
        +
        + +
        +
        + main->getPRO()): ?> +
        main->get_pro_link()).'" target="_blank">'.esc_html__('Pro version of Modern Events Calendar', 'modern-events-calendar-lite').''); ?>
        + + + /> + + +
        +
        +

        +
        + +
        + +
        +
        + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        +
        +
        + +
        +
        + + /> + +
        +
        + + booking_button_field('list', (isset($sk_options_list['booking_button']) ? $sk_options_list['booking_button'] : 0))); ?> + display_custom_data_field('list', (isset($sk_options_list['custom_data']) ? $sk_options_list['custom_data'] : 0))); ?> + display_status_bar_field('list', (isset($sk_options_list['status_bar']) ? $sk_options_list['status_bar'] : 0))); ?> +
        +
        + +
        +
        + + /> + +
        +
        +
        + sed_method_field('list', (isset($sk_options_list['sed_method']) ? $sk_options_list['sed_method'] : 0), (isset($sk_options_list['image_popup']) ? $sk_options_list['image_popup'] : 0))); ?> +
        + +
        + + +
        + +
        + + +
        +
        + + +
        + +
        +
        + +
        + + +
        + + +
        +
        +

        +
        + +
        +
        +
        + + order_method_field('grid', (isset($sk_options_grid['order_method']) ? $sk_options_grid['order_method'] : 'ASC'))); ?> +
        + + + +
        +
        +

        +
        + +
        +
        +
        + + + + +
        +
        +

        +
        + +
        +
        +
        + + + + +
        +
        +

        +
        + +
        +
        +
        + + + + + +
        +
        +

        +
        + +
        +
        +
        + + + +
        +
        +

        +
        + +
        +
        +
        + + + + + +
        +
        +

        +
        + +
        +
        +
        + + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + + + +
        +
        +

        +
        + +
        +
        + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + display_pagination_field('grid', $sk_options_grid)); ?> + display_price_field('grid', (isset($sk_options_grid['display_price']) ? $sk_options_grid['display_price'] : 0))); ?> + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + + settings['organizers_status']) || $this->settings['organizers_status']) echo MEC_kses::form($this->display_organizer_field('grid', $sk_options_grid['display_organizer'] ?? 0)); ?> + +
        +
        + +
        +
        + main->getPRO()): ?> +
        main->get_pro_link()).'" target="_blank">'.esc_html__('Pro version of Modern Events Calendar', 'modern-events-calendar-lite').''); ?>
        + + + /> + + +
        +
        +

        +
        + +
        + +
        +
        + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        +
        +
        + +
        +
        + + /> + +
        +
        + + booking_button_field('grid', (isset($sk_options_grid['booking_button']) ? $sk_options_grid['booking_button'] : 0))); ?> + display_custom_data_field('grid', (isset($sk_options_grid['custom_data']) ? $sk_options_grid['custom_data'] : 0))); ?> + sed_method_field('grid', (isset($sk_options_grid['sed_method']) ? $sk_options_grid['sed_method'] : 0), (isset($sk_options_grid['image_popup']) ? $sk_options_grid['image_popup'] : 0))); ?> + +
        + + +
        + + main->getPRO()): ?> +
        main->get_pro_link()).'" target="_blank">'.esc_html__('Pro version of Modern Events Calendar', 'modern-events-calendar-lite').''); ?>
        + + + +
        + + +
        +
        + + +
        + +
        +
        + +
        + + +
        + + +
        +
        +

        +
        + +
        +
        +
        + + order_method_field('agenda', (isset($sk_options_agenda['order_method']) ? $sk_options_agenda['order_method'] : 'ASC'))); ?> +
        + + + + +
        +
        +

        +
        + +
        +
        +
        + + + +
        +
        +

        +
        + +
        +
        + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + display_pagination_field('agenda', $sk_options_agenda)); ?> +
        +
        + +
        +
        + + /> + +
        +
        + booking_button_field('agenda', (isset($sk_options_agenda['booking_button']) ? $sk_options_agenda['booking_button'] : 0))); ?> + display_custom_data_field('agenda', (isset($sk_options_agenda['custom_data']) ? $sk_options_agenda['custom_data'] : 0))); ?> + sed_method_field('agenda', (isset($sk_options_agenda['sed_method']) ? $sk_options_agenda['sed_method'] : 0), (isset($sk_options_agenda['image_popup']) ? $sk_options_agenda['image_popup'] : 0))); ?> + +
        + + +
        + + +
        + + +
        + +
        + + +
        + +
        +
        +
        + + +
        +
        + + +
        +
        + + +
        +
        +
        +
        + +
        +
        + + /> + +
        +
        + +
        +
        + + +
        +
        + + +
        + + +
        +
        +

        +
        + +
        +
        +
        + order_method_field('full_calendar', (isset($sk_options_full_calendar['order_method_list']) ? $sk_options_full_calendar['order_method_list'] : 'ASC'), 'order_method_list')); ?> +
        +
        +
        +
        +
        + +
        +
        + + /> + +
        +
        +
        +
        + + +
        + + +
        +
        +

        +
        + +
        +
        +
        + order_method_field('full_calendar', (isset($sk_options_full_calendar['order_method_grid']) ? $sk_options_full_calendar['order_method_grid'] : 'ASC'), 'order_method_grid')); ?> +
        +
        +
        +
        + +
        +
        + + /> + +
        +
        +
        +
        +
        + +
        +
        + + main->getPRO()) + { + echo ' /> + +
        +
        + +
        + + + +
        +
        +
        + main->getPRO()): ?> +
        main->get_pro_link()).'" target="_blank">'.esc_html__('Pro version of Modern Events Calendar', 'modern-events-calendar-lite').'', ''.esc_html__('Yearly View', 'modern-events-calendar-lite').''); ?>
        + +
        +
        +
        + +
        +
        + + /> + +
        +
        +
        > +
        +
        + +
        +
        + + /> + +
        +
        +
        +
        + +
        +
        + + /> + +
        +
        +
        +
        + +
        +
        + + /> + +
        +
        +
        +
        + +
        +
        + + /> + +
        +
        +
        +
        +
        + +
        +
        + + /> + +
        +
        +
        +
        + +
        +
        + + /> + +
        +
        + display_price_field('full_calendar', (isset($sk_options_full_calendar['display_price']) ? $sk_options_full_calendar['display_price'] : 0))); ?> + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + booking_button_field('full_calendar', (isset($sk_options_full_calendar['booking_button']) ? $sk_options_full_calendar['booking_button'] : 0))); ?> + display_custom_data_field('full_calendar', (isset($sk_options_full_calendar['custom_data']) ? $sk_options_full_calendar['custom_data'] : 0))); ?> + sed_method_field('full_calendar', (isset($sk_options_full_calendar['sed_method']) ? $sk_options_full_calendar['sed_method'] : 0), (isset($sk_options_full_calendar['image_popup']) ? $sk_options_full_calendar['image_popup'] : 0))); ?> + +
        + + +
        + + main->getPRO()): ?> +
        main->get_pro_link()).'" target="_blank">'.esc_html__('Pro version of Modern Events Calendar', 'modern-events-calendar-lite').''); ?>
        + + + +
        + + +
        +
        + + +
        + +
        +
        +
        + + + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + +
        + main->get_months_labels() as $n => $month): ?> +
        + + /> + +
        + +
        +
        + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + +
        +
        + +
        +
        + + /> + +
        +
        + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + +

        + booking_button_field('yearly_view', (isset($sk_options_yearly_view['booking_button']) ? $sk_options_yearly_view['booking_button'] : 0))); ?> + display_custom_data_field('yearly_view', (isset($sk_options_yearly_view['custom_data']) ? $sk_options_yearly_view['custom_data'] : 0))); ?> + sed_method_field('yearly_view', (isset($sk_options_yearly_view['sed_method']) ? $sk_options_yearly_view['sed_method'] : 0), (isset($sk_options_yearly_view['image_popup']) ? $sk_options_yearly_view['image_popup'] : 0))); ?> + +
        + + +
        + +
        + + +
        +
        +
        + +
        +
        + + /> + +
        +
        +
        + + +
        + +
        +
        +
        + + +
        + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + +
        +
        + +
        +
        + + /> + +
        +
        +

        + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + + settings['organizers_status']) || $this->settings['organizers_status']) echo MEC_kses::form($this->display_organizer_field('monthly_view', $sk_options_monthly_view['display_organizer'] ?? 0)); ?> + +
        +
        + +
        +
        + + /> + +
        +
        +
        +
        + +
        +
        + + /> + +
        +
        +
        +
        + +
        +
        + + /> + +
        +
        + booking_button_field('monthly_view', ($sk_options_monthly_view['booking_button'] ?? 0))); ?> + display_custom_data_field('monthly_view', ($sk_options_monthly_view['custom_data'] ?? 0))); ?> + display_detailed_time_field('monthly_view', ($sk_options_monthly_view['detailed_time'] ?? 0))); ?> + sed_method_field('monthly_view', ($sk_options_monthly_view['sed_method'] ?? 0), ($sk_options_monthly_view['image_popup'] ?? 0))); ?> + +
        + + +
        + + main->getPRO()): ?> +
        main->get_pro_link()).'" target="_blank">'.esc_html__('Pro version of Modern Events Calendar', 'modern-events-calendar-lite').''); ?>
        + + + +
        + + +
        + +
        + + +
        + +
        +
        +
        + + +
        +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        +
        +
        + +
        +
        + + /> + +
        +
        +

        + + + + +
        + + +
        + + +
        + + +
        + +
        + + + +
        + +
        +
        +
        + + +
        + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + +
        +
        + +
        +
        + + /> + +
        +
        +

        + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + + settings['organizers_status']) || $this->settings['organizers_status']) echo MEC_kses::form($this->display_organizer_field('daily_view', $sk_options_daily_view['display_organizer'] ?? 0)); ?> + + booking_button_field('daily_view', $sk_options_daily_view['booking_button'] ?? 0)); ?> + display_custom_data_field('daily_view', $sk_options_daily_view['custom_data'] ?? 0)); ?> + display_detailed_time_field('daily_view', $sk_options_daily_view['detailed_time'] ?? 0)); ?> + sed_method_field('daily_view', $sk_options_daily_view['sed_method'] ?? 0, $sk_options_daily_view['image_popup'] ?? 0)); ?> + +
        + + +
        + + +
        + + +
        + +
        + + +
        + +
        +
        +
        + + +
        + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + + settings['organizers_status']) || $this->settings['organizers_status']) echo MEC_kses::form($this->display_organizer_field('weekly_view', $sk_options_weekly_view['display_organizer'] ?? 0)); ?> + +
        +
        + +
        +
        + + /> + +
        +
        +

        + booking_button_field('weekly_view', ($sk_options_weekly_view['booking_button'] ?? 0))); ?> + display_custom_data_field('weekly_view', ($sk_options_weekly_view['custom_data'] ?? 0))); ?> + display_detailed_time_field('weekly_view', ($sk_options_weekly_view['detailed_time'] ?? 0))); ?> + sed_method_field('weekly_view', ($sk_options_weekly_view['sed_method'] ?? 0), ($sk_options_weekly_view['image_popup'] ?? 0))); ?> + +
        + + +
        + + main->getPRO()): ?> +
        main->get_pro_link()).'" target="_blank">'.esc_html__('Pro version of Modern Events Calendar', 'modern-events-calendar-lite').''); ?>
        + + + +
        + + +
        +
        + + +
        + +
        +
        +
        + + +
        +
        +
        + + +
        +
        +
        +
        + + +
        +
        + + +
        +
        +
        +
        + + + +
        +
        + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + +
        +
        +
        + +
        +
        + + /> + +
        +
        +

        +
        +
        + booking_button_field('timetable', (isset($sk_options_timetable['booking_button']) ? $sk_options_timetable['booking_button'] : 0))); ?> + display_custom_data_field('timetable', (isset($sk_options_timetable['custom_data']) ? $sk_options_timetable['custom_data'] : 0))); ?> + sed_method_field('timetable', (isset($sk_options_timetable['sed_method']) ? $sk_options_timetable['sed_method'] : 0), (isset($sk_options_timetable['image_popup']) ? $sk_options_timetable['image_popup'] : 0))); ?> +
        + +
        + + +
        + main->getPRO()): ?> +
        main->get_pro_link()).'" target="_blank">'.esc_html__('Pro version of Modern Events Calendar', 'modern-events-calendar-lite').''); ?>
        + + + + +
        + + +
        + +
        +
        + +
        + + +
        + + +
        +
        +

        +
        + +
        +
        +
        + + order_method_field('masonry', (isset($sk_options_masonry['order_method']) ? $sk_options_masonry['order_method'] : 'ASC'))); ?> +
        + + + + +
        +
        +

        +
        + +
        +
        +
        + + + +
        +
        +

        +
        + +
        +
        +
        + + +
        + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + + settings['organizers_status']) || $this->settings['organizers_status']) echo MEC_kses::form($this->display_organizer_field('masonry', $sk_options_masonry['display_organizer'] ?? 0)); ?> + +
        +
        + +

        +
        +
        + + /> + +
        +
        +
        +
        + +

        +
        +
        + + /> + +
        +
        + display_pagination_field('masonry', $sk_options_masonry)); ?> + booking_button_field('masonry', (isset($sk_options_masonry['booking_button']) ? $sk_options_masonry['booking_button'] : 0))); ?> + display_custom_data_field('masonry', (isset($sk_options_masonry['custom_data']) ? $sk_options_masonry['custom_data'] : 0))); ?> + sed_method_field('masonry', (isset($sk_options_masonry['sed_method']) ? $sk_options_masonry['sed_method'] : 0), (isset($sk_options_masonry['image_popup']) ? $sk_options_masonry['image_popup'] : 0))); ?> + +
        + + +
        + +
        + + +
        +
        + + + + + +
        +
        +

        +
        + +
        +
        +
        + + + + +
        +
        +

        +
        + +
        +
        +
        + + + +
        +
        +

        +
        + +
        +
        +
        + + +
        + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        + + +
        + +
        + + +
        +
        + + + +
        +
        +

        +
        + +
        +
        +
        + + + +
        +
        +

        +
        + +
        +
        +
        + + + + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + + +
        + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        + + +
        + + main->getPRO()): ?> +
        main->get_pro_link()).'" target="_blank">'.esc_html__('Pro version of Modern Events Calendar', 'modern-events-calendar-lite').''); ?>
        + + + +
        + + +
        + +
        + + + + +
        +
        +

        +
        + +
        +
        +
        + + +
        + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        + + + + + +
        + +
        + + +
        +
        + + +
        + +
        +
        +
        + + + + + +
        +
        +

        +
        + +
        +
        +
        + + + + + +
        +
        +

        +
        + +
        +
        +
        + + + + + +
        +
        +

        +
        + +
        +
        +
        + + + + + +
        +
        +

        +
        + +
        +
        +
        + + + + + +
        +
        +

        +
        + +
        +
        +
        + + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + + +
        + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + display_custom_data_field('slider', (isset($sk_options_slider['custom_data']) ? $sk_options_slider['custom_data'] : 0))); ?> + +
        + + +
        + + +
        + + +
        + +
        +
        + +
        + + +
        + + +
        +
        +

        +
        + +
        +
        +
        + + order_method_field('timeline', (isset($sk_options_timeline['order_method']) ? $sk_options_timeline['order_method'] : 'ASC'))); ?> +
        + + + +
        +
        +

        +
        + +
        +
        +
        + + + +
        +
        +

        +
        + +
        +
        + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + + settings['organizers_status']) || $this->settings['organizers_status']) echo MEC_kses::form($this->display_organizer_field('timeline', $sk_options_timeline['display_organizer'] ?? 0)); ?> + + display_pagination_field('timeline', $sk_options_timeline)); ?> +
        +
        + +
        +
        + + /> + +
        +
        + booking_button_field('timeline', (isset($sk_options_timeline['booking_button']) ? $sk_options_timeline['booking_button'] : 0))); ?> + display_custom_data_field('timeline', (isset($sk_options_timeline['custom_data']) ? $sk_options_timeline['custom_data'] : 0))); ?> + sed_method_field('timeline', (isset($sk_options_timeline['sed_method']) ? $sk_options_timeline['sed_method'] : 0), (isset($sk_options_timeline['image_popup']) ? $sk_options_timeline['image_popup'] : 0))); ?> +
        + + +
        + + +
        + + +
        + +
        +
        +
        + + + + +
        +
        +

        +
        + +
        +
        +
        + + +
        + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + + settings['organizers_status']) || $this->settings['organizers_status']) echo MEC_kses::form($this->display_organizer_field('tile', $sk_options_tile['display_organizer'] ?? 0)); ?> + +
        +
        + +
        +
        + + onchange="jQuery('#mec_tile_off_month_options').toggle();" /> + +
        +
        +

        +
        > +
        + + + +
        +
        +

        +
        + +
        +
        + display_pagination_field('tile', $sk_options_tile)); ?> +
        + booking_button_field('tile', (isset($sk_options_tile['booking_button']) ? $sk_options_tile['booking_button'] : 0))); ?> + display_custom_data_field('tile', (isset($sk_options_tile['custom_data']) ? $sk_options_tile['custom_data'] : 0))); ?> + sed_method_field('tile', (isset($sk_options_tile['sed_method']) ? $sk_options_tile['sed_method'] : 0), (isset($sk_options_tile['image_popup']) ? $sk_options_tile['image_popup'] : 0))); ?> +
        + + +
        + + +
        + + +
        + +
        +
        +
        + + +
        +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + +
        +
        + + /> + + +
        +
        +

        +
        + +
        +
        +
        +
        + sed_method_field('general_calendar', (isset($sk_options_general_calendar['sed_method']) ? $sk_options_general_calendar['sed_method'] : 0), (isset($sk_options_general_calendar['image_popup']) ? $sk_options_general_calendar['image_popup'] : 0))); ?> +
        + +
        + + + +
        +
        +
        + + diff --git a/app/features/mec/meta_boxes/filter.php b/app/features/mec/meta_boxes/filter.php new file mode 100755 index 0000000..1c66096 --- /dev/null +++ b/app/features/mec/meta_boxes/filter.php @@ -0,0 +1,393 @@ + + */ +class MEC_tax_walker extends Walker_Category_Checklist +{ + public function start_el(&$output, $data_object, $depth = 0, $args = array(), $current_object_id = 0) + { + $args['popular_cats'] = empty($args['popular_cats']) ? array() : $args['popular_cats']; + $class = in_array($data_object->term_id, $args['popular_cats']) ? ' class="popular-category"' : ''; + + $args['selected_cats'] = empty($args['selected_cats']) ? array() : $args['selected_cats']; + + if(!empty($args['list_only'])) + { + $aria_cheched = 'false'; + $inner_class = 'category'; + + if(in_array($data_object->term_id, $args['selected_cats'])) + { + $inner_class .= ' selected'; + $aria_cheched = 'true'; + } + // Show only Terms with Posts + if($data_object->count) + { + $output .= "\n".'
      • '. + ''; + } + } + else + { + // Show only Terms with Posts + if($data_object->count) + { + $output .= "\n
      • + +factory->params('footer', ''); diff --git a/app/features/mec/single.php b/app/features/mec/single.php new file mode 100755 index 0000000..ac7bddf --- /dev/null +++ b/app/features/mec/single.php @@ -0,0 +1,760 @@ +main->is_multilingual(); +$locale = $this->main->get_backend_active_locale(); + +$settings = $this->main->get_settings(); +$ml_settings = $this->main->get_ml_settings(NULL, $locale); + +// WordPress Pages +$pages = get_pages(); + +// Event Fields +$event_fields = $this->main->get_event_fields(); +?> +
        +
        +
        + + +
        + +
        + +
        + main->get_sidebar_menu('single_event'); ?> +
        + +
        +
        +
        +
        +
        + +
        + +
        + +

        + +
        +
        +
        +
        +
        +
        + +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        + + main->getPRO() and isset($this->settings['booking_status']) and $this->settings['booking_status']): ?> +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        + +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        + +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        + +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        + +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        + +
        + +
        +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        + +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        + +
        +
        + + +
        +
        +

        +
        + +
        +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        + + getPRO()): ?> +
        +
        +
        + +
        +
        + + +
        +
        +
        + + +
        +
        +

        +
        + +
        +
        +
        + +
        +
        +
        + +
        +
        +
        + +

        +
        +
        +
        + +
        +
        +
        + +
        +
        + +
        +
        +
        + +
        +
        + + getPRO()): ?> +
        +
        +
        +
        +

        [mec-only-booked-users]', '[mec-only-booked-users]Hi[/mec-only-booked-users]'); ?>

        +
        +
        +
        + + +
        +
        +
        +
        +

        [mec-hourly-schedule event-id="1"]'); ?>

        +
        +
        +
        +
        + +
        + +
        +

        +
        +
        + +
        +
        +
        +
        +
        + + + +
          + $event_field) + { + if(!is_numeric($key)) continue; + $i = max($i, $key); + + if($event_field['type'] == 'text') echo MEC_kses::form($this->main->field_text($key, $event_field, 'event')); + elseif($event_field['type'] == 'email') echo MEC_kses::form($this->main->field_email($key, $event_field, 'event')); + elseif($event_field['type'] == 'url') echo MEC_kses::form($this->main->field_url($key, $event_field, 'event')); + elseif($event_field['type'] == 'date') echo MEC_kses::form($this->main->field_date($key, $event_field, 'event')); + elseif($event_field['type'] == 'tel') echo MEC_kses::form($this->main->field_tel($key, $event_field, 'event')); + elseif($event_field['type'] == 'textarea') echo MEC_kses::form($this->main->field_textarea($key, $event_field, 'event')); + elseif($event_field['type'] == 'p') echo MEC_kses::form($this->main->field_p($key, $event_field, 'event')); + elseif($event_field['type'] == 'checkbox') echo MEC_kses::form($this->main->field_checkbox($key, $event_field, 'event')); + elseif($event_field['type'] == 'radio') echo MEC_kses::form($this->main->field_radio($key, $event_field, 'event')); + elseif($event_field['type'] == 'select') echo MEC_kses::form($this->main->field_select($key, $event_field, 'event')); + } + ?> +
        +
        + + + + + + + + + + +
        +
        +
        + +
        +
        + main->field_text(':i:', array(), 'event')); ?> +
        +
        + main->field_email(':i:', array(), 'event')); ?> +
        +
        + main->field_url(':i:', array(), 'event')); ?> +
        +
        + main->field_tel(':i:', array(), 'event')); ?> +
        +
        + main->field_date(':i:', array(), 'event')); ?> +
        +
        + main->field_textarea(':i:', array(), 'event')); ?> +
        +
        + main->field_checkbox(':i:', array(), 'event')); ?> +
        +
        + main->field_radio(':i:', array(), 'event')); ?> +
        +
        + main->field_select(':i:', array(), 'event')); ?> +
        +
        + main->field_p(':i:', array(), 'event')); ?> +
        +
        + main->field_option(':fi:', ':i:', array(), 'event')); ?> +
        +
        +
        + +
        +
        + +

        +
        +
        +
        + +
        +

        +
        +
        +
          +
        • + +
        • +
        • + +
        • +
        • + +
        • +
        • + +
        • +
        • + +
        • +
        • + +
        • +
        • + +
        • +
        • + +
        • +
        • + +
        • + +
        • + +
        • + +
        • + +
        • +
        • + +
        • +
        • + +
        • +
        • + +
        • +
        • + +
        • +
        • + +
        • +
        • + +
        • +
        • + +
        • +
        • + +
        • + + + +
        • + +
        • + +
        +
        +
        +
        + +
        +

        + main->icons()->form( + 'single', + 'mec[settings]', + (isset($settings['icons']) && is_array($settings['icons']) ? $settings['icons'] : []) + ); ?> +
        + +
        + + + + + +
        +
        + +
        +
        +
        +
        + + + +
        + +factory->params('footer', ''); diff --git a/app/features/mec/styles.php b/app/features/mec/styles.php new file mode 100755 index 0000000..9946154 --- /dev/null +++ b/app/features/mec/styles.php @@ -0,0 +1,101 @@ +main->get_styles(); +?> + +
        + +
        + +
        + +
        + main->get_sidebar_menu('customcss'); ?> +
        + +
        + +
        + +
        +
        +
        +
        +
        +

        +
        + +

        + + +
        +
        +
        +
        +
        +
        +
        + + + +
        + +getFactory()->params('footer', function() +{ + ?> + + main->get_styling(); +$fonts = include MEC::import('app.features.mec.webfonts.webfonts', true, true); + +$google_fonts = []; +$google_fonts['none'] = array( + 'label'=>esc_html__('Default Font', 'modern-events-calendar-lite'), + 'variants'=>array('regular'), + 'subsets'=>array(), + 'category'=>'', + 'value'=>'', +); + +if(is_array($fonts)) +{ + foreach($fonts['items'] as $font) + { + $google_fonts[$font['family']] = array( + 'label'=>$font['family'], + 'variants'=>$font['variants'], + 'subsets'=>$font['subsets'], + 'category'=>$font['category'], + ); + } +} +?> +
        + +
        +
        + + +
        + +
        + +
        + main->get_sidebar_menu('styling'); ?> +
        + +
        + +
        + +
        +
        + +
        +
        +
        +

        + +
        +
        +
        + +
        +
        +
          + 'mec-colorskin-1', + '#0093d0'=>'mec-colorskin-2', + '#e53f51'=>'mec-colorskin-3', + '#f1c40f'=>'mec-colorskin-4', + '#e64883'=>'mec-colorskin-5', + '#45ab48'=>'mec-colorskin-6', + '#9661ab'=>'mec-colorskin-7', + '#0aad80'=>'mec-colorskin-8', + '#0ab1f0'=>'mec-colorskin-9', + '#ff5a00'=>'mec-colorskin-10', + '#c3512f'=>'mec-colorskin-11', + '#55606e'=>'mec-colorskin-12', + '#fe8178'=>'mec-colorskin-13', + '#7c6853'=>'mec-colorskin-14', + '#bed431'=>'mec-colorskin-15', + '#2d5c88'=>'mec-colorskin-16', + '#77da55'=>'mec-colorskin-17', + '#2997ab'=>'mec-colorskin-18', + '#734854'=>'mec-colorskin-19', + '#a81010'=>'mec-colorskin-20', + '#4ccfad'=>'mec-colorskin-21', + '#3a609f'=>'mec-colorskin-22', + '#333333'=>'mec-colorskin-23', + '#D2D2D2'=>'mec-colorskin-24', + '#636363'=>'mec-colorskin-25', + ); + + foreach($colorskins as $colorskin=>$values): ?> +
        • + +
        • + +
        +
        +
        +
        +
        + +
        +
        + +
        +
        +

        +
        +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        +
        + +
        +
        + +
        +
        + +
        +
        + +
        +
        + +
        +
        + +
        +
        + +
        +
        + +
        +
        + + +
        +
        + +
        + + + +
        +
        + +
        + +
        + + + +
        +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        + + +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        + + + +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        + +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        + + + +
        + +
        +
        + +
        +
        + +
        +
        + +
        +
        + +
        +
        + +
        +
        + +
        + + +
        +
        +
        +
        +
        +
        +
        + + + +
        + +getFactory()->params('footer', function() +{ + ?> + + +
        +
        +
        +
        +

        +
        + + + +

        + +

        +
        +
        +
        + + +
        +
        +
        +
        + + getPRO()): ?> +
        +
        +
        +

        '.esc_html__('Dear user', 'modern-events-calendar-lite').''); ?>

        + Get 12 Month Premium Support + Get 6 Month Premium Support +
        +
        +
        + + + getPRO()): ?> +
        +
        +
        +

        '.esc_html__('Dear user', 'modern-events-calendar-lite').''); ?>

        + Get 12 Month Premium Support + Get 6 Month Premium Support +
        +
        +
        + + + + +
        +
        + +
        +
        + +
        +
        +
        +
        + +
        +
        +
          +
        • +
        • +
        • +
        • +
        • +
        • +
        +
        +
        +
        +
        +
        +
        + +
        +
        +
          +
        • +
        • +
        • +
        • +
        • +
        • +
        +
        +
        +
        +
        +
        +
        + +
        +
        +
          +
        • +
        • +
        • +
        • +
        • +
        • +
        +
        +
        +
        +
        +
        +
        + +
        +
        +
          +
        • +
        • +
        • +
        • +
        • +
        • +
        +
        +
        +
        +
        + +
        +
        +
        +
        + +
        +
        +
          +
        • +
        • +
        • +
        +
        + +
        +
        +
        +
        +
        +
        +
        + +
        +
        +
          +
        • +
        • +
        • +
        +
        + +
        +
        +
        +
        +
        +
        +
        + +
        +
        +
          +
        • +
        • +
        • +
        +
        + +
        +
        +
        +
        +
        +
        +
        + +
        +
        +
          +
        • +
        • +
        • +
        +
        + +
        +
        +
        +
        +
        + +
        +
        +
        +
        + +
        +
        +
          +
        • +
        • +
        • +
        +
        + +
        +
        +
        +
        +
        +
        +
        + +
        +
        +
          +
        • +
        • +
        • +
        +
        + +
        +
        +
        +
        +
        +
        +
        + +
        +
        +
          +
        • +
        • +
        • +
        +
        + +
        +
        +
        +
        +
        +
        +
        + +
        +
        +
          +
        • +
        • +
        • +
        +
        + +
        +
        +
        +
        +
        + +
        +
        +
        +
        + +
        +
        +
        +
        +
        + + 1- Uploading the plugin file using FTP. For more information, please click here.
        + 2- Using the auto-update feature which needs the adding of the purchase code in the corresponding section in the plugin. For more information, please click here.', 'modern-events-calendar-lite') , 'https://webnus.net/dox/modern-events-calendar/how-to-update-manually-plugin/', 'https://webnus.net/dox/modern-events-calendar/how-to-auto-update-plugin/' ); ?> +
        + +
        +
        +
        + +
        +
        + click here.', 'modern-events-calendar-lite') , 'https://webnus.net/dox/modern-events-calendar/mec-theme-integration-guide/' ); ?> +
        + +
        +
        + click here.', 'modern-events-calendar-lite') , 'https://webnus.net/dox/modern-events-calendar/translate-mec/' ); ?> +
        + +
        +
        + +
        +
        +
        +
        +
        +
        +
        +
        +
        + +
        +
        + + + + + + + + + + + +
        +
        +
        +
        +
        +
        +
        +
        +
        +
          +
        • +
          +
          +
        • +
        • +
          +
          +
        • +
        • +
          +
          +
        • +
        • +
          +
          +
        • +
        • +
          +
          +
        • +
        • +
          +
          +
        • +
        • +
          +
          +
        • +
        • +
          +
          +
        • +
        • +
          +
          +
        • +
        • +
          +
          +
        • +
        +
        +
        +
        + +
        +
        +
        +
        + + + +

        main->URL('admin').'?mec-download-log-file=1">'.esc_html__('Download').''); ?>

        + +

        + + +

        + +
        +
        +
        + +
        + getPRO()) : ?> +
        +
        +
        +
        +
        +


        + +
        +
        +
        +
        + + +
        +
        + +factory->params('footer', function() +{ + ?> + + getPRO()): ?> + + + +
        + +
        + +
        + + +
        + +
        + +
        + +
        +
        +

        +
        +
        +
        +
        +
        +
        + +
        +
        +

        + +

        +
        + +
        +
        +
        +
        +
        +
        +
        +
        + +
        +
        + getPRO()): ?> +

        + +

        + +
        + getPRO()): ?> + + + + +
        +
        +
        +
        +
        +
        +
        +
        + +
        +
        +
          +
        • +
        • +
        • +
        • +
        • +
        • +
        +
        +
        +
        +
        +
        +
        +
        +
        + +
        + +
        \ No newline at end of file diff --git a/app/features/mec/webfonts/index.html b/app/features/mec/webfonts/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/features/mec/webfonts/webfonts.php b/app/features/mec/webfonts/webfonts.php new file mode 100755 index 0000000..8da4d97 --- /dev/null +++ b/app/features/mec/webfonts/webfonts.php @@ -0,0 +1,6 @@ + "webfonts#webfontList", "items" => array(array("kind" => "webfonts#webfont", "family" => "ABeeZee", "category" => "sans-serif", "variants" => array("regular", "italic"), "subsets" => array("latin"), "version" => "v9", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/abeezee/v9/mE5BOuZKGln_Ex0uYKpIaw.ttf", "italic" => "http://fonts.gstatic.com/s/abeezee/v9/kpplLynmYgP0YtlJA3atRw.ttf")), array("kind" => "webfonts#webfont", "family" => "Abel", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/abel/v6/RpUKfqNxoyNe_ka23bzQ2A.ttf")), array("kind" => "webfonts#webfont", "family" => "Abril Fatface", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/abrilfatface/v8/X1g_KwGeBV3ajZIXQ9VnDojjx0o0jr6fNXxPgYh_a8Q.ttf")), array("kind" => "webfonts#webfont", "family" => "Aclonica", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-20", "files" => array("regular" => "http://fonts.gstatic.com/s/aclonica/v6/M6pHZMPwK3DiBSlo3jwAKQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Acme", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/acme/v5/-J6XNtAHPZBEbsifCdBt-g.ttf")), array("kind" => "webfonts#webfont", "family" => "Actor", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/actor/v6/ugMf40CrRK6Jf6Yz_xNSmQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Adamina", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/adamina/v8/RUQfOodOMiVVYqFZcSlT9w.ttf")), array("kind" => "webfonts#webfont", "family" => "Advent Pro", "category" => "sans-serif", "variants" => array("100", "200", "300", "regular", "500", "600", "700"), "subsets" => array("latin", "latin-ext", "greek"), "version" => "v4", "lastModified" => "2016-06-07", "files" => array("100" => "http://fonts.gstatic.com/s/adventpro/v4/87-JOpSUecTG50PBYK4ysi3USBnSvpkopQaUR-2r7iU.ttf", "200" => "http://fonts.gstatic.com/s/adventpro/v4/URTSSjIp0Wr-GrjxFdFWnGeudeTO44zf-ht3k-KNzwg.ttf", "300" => "http://fonts.gstatic.com/s/adventpro/v4/sJaBfJYSFgoB80OL1_66m0eOrDcLawS7-ssYqLr2Xp4.ttf", "500" => "http://fonts.gstatic.com/s/adventpro/v4/7kBth2-rT8tP40RmMMXMLJp-63r6doWhTEbsfBIRJ7A.ttf", "600" => "http://fonts.gstatic.com/s/adventpro/v4/3Jo-2maCzv2QLzQBzaKHV_pTEJqju4Hz1txDWij77d4.ttf", "700" => "http://fonts.gstatic.com/s/adventpro/v4/M4I6QiICt-ey_wZTpR2gKwJKKGfqHaYFsRG-T3ceEVo.ttf", "regular" => "http://fonts.gstatic.com/s/adventpro/v4/1NxMBeKVcNNH2H46AUR3wfesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Aguafina Script", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/aguafinascript/v5/65g7cgMtMGnNlNyq_Z6CvMxLhO8OSNnfAp53LK1_iRs.ttf")), array("kind" => "webfonts#webfont", "family" => "Akronim", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/akronim/v5/qA0L2CSArk3tuOWE1AR1DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Aladin", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/aladin/v5/PyuJ5cVHkduO0j5fAMKvAA.ttf")), array("kind" => "webfonts#webfont", "family" => "Aldrich", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/aldrich/v6/kMMW1S56gFx7RP_mW1g-Eg.ttf")), array("kind" => "webfonts#webfont", "family" => "Alef", "category" => "sans-serif", "variants" => array("regular", "700"), "subsets" => array("latin", "hebrew"), "version" => "v6", "lastModified" => "2016-06-07", "files" => array("700" => "http://fonts.gstatic.com/s/alef/v6/VDgZJhEwudtOzOFQpZ8MEA.ttf", "regular" => "http://fonts.gstatic.com/s/alef/v6/ENvZ_P0HBDQxNZYCQO0lUA.ttf")), array("kind" => "webfonts#webfont", "family" => "Alegreya", "category" => "serif", "variants" => array("regular", "italic", "700", "700italic", "900", "900italic"), "subsets" => array("latin", "latin-ext"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/alegreya/v7/5oZtdI5-wQwgAFrd9erCsaCWcynf_cDxXwCLxiixG1c.ttf", "900" => "http://fonts.gstatic.com/s/alegreya/v7/oQeMxX-vxGImzDgX6nxA7KCWcynf_cDxXwCLxiixG1c.ttf", "regular" => "http://fonts.gstatic.com/s/alegreya/v7/62J3atXd6bvMU4qO_ca-eA.ttf", "italic" => "http://fonts.gstatic.com/s/alegreya/v7/cbshnQGxwmlHBjUil7DaIfesZW2xOQ-xsNqO47m55DA.ttf", "700italic" => "http://fonts.gstatic.com/s/alegreya/v7/IWi8e5bpnqhMRsZKTcTUWgJKKGfqHaYFsRG-T3ceEVo.ttf", "900italic" => "http://fonts.gstatic.com/s/alegreya/v7/-L71QLH_XqgYWaI1GbOVhp0EAVxt0G0biEntp43Qt6E.ttf")), array("kind" => "webfonts#webfont", "family" => "Alegreya SC", "category" => "serif", "variants" => array("regular", "italic", "700", "700italic", "900", "900italic"), "subsets" => array("latin", "latin-ext"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/alegreyasc/v6/M9OIREoxDkvynwTpBAYUq3e1Pd76Vl7zRpE7NLJQ7XU.ttf", "900" => "http://fonts.gstatic.com/s/alegreyasc/v6/M9OIREoxDkvynwTpBAYUqyenaqEuufTBk9XMKnKmgDA.ttf", "regular" => "http://fonts.gstatic.com/s/alegreyasc/v6/3ozeFnTbygMK6PfHh8B-iqCWcynf_cDxXwCLxiixG1c.ttf", "italic" => "http://fonts.gstatic.com/s/alegreyasc/v6/GOqmv3FLsJ2r6ZALMZVBmkeOrDcLawS7-ssYqLr2Xp4.ttf", "700italic" => "http://fonts.gstatic.com/s/alegreyasc/v6/5PCoU7IUfCicpKBJtBmP6c_zJjSACmk0BRPxQqhnNLU.ttf", "900italic" => "http://fonts.gstatic.com/s/alegreyasc/v6/5PCoU7IUfCicpKBJtBmP6U_yTOUGsoC54csJe1b-IRw.ttf")), array("kind" => "webfonts#webfont", "family" => "Alegreya Sans", "category" => "sans-serif", "variants" => array("100", "100italic", "300", "300italic", "regular", "italic", "500", "500italic", "700", "700italic", "800", "800italic", "900", "900italic"), "subsets" => array("latin", "latin-ext", "vietnamese"), "version" => "v3", "lastModified" => "2016-06-07", "files" => array("100" => "http://fonts.gstatic.com/s/alegreyasans/v3/TKyx_-JJ6MdpQruNk-t-PJFGFO4uyVFMfB6LZsii7kI.ttf", "300" => "http://fonts.gstatic.com/s/alegreyasans/v3/11EDm-lum6tskJMBbdy9acB1LjARzAvdqa1uQC32v70.ttf", "500" => "http://fonts.gstatic.com/s/alegreyasans/v3/11EDm-lum6tskJMBbdy9aQqQmZ7VjhwksfpNVG0pqGc.ttf", "700" => "http://fonts.gstatic.com/s/alegreyasans/v3/11EDm-lum6tskJMBbdy9aVCbmAUID8LN-q3pJpOk3Ys.ttf", "800" => "http://fonts.gstatic.com/s/alegreyasans/v3/11EDm-lum6tskJMBbdy9acxnD5BewVtRRHHljCwR2bM.ttf", "900" => "http://fonts.gstatic.com/s/alegreyasans/v3/11EDm-lum6tskJMBbdy9aW42xlVP-j5dagE7-AU2zwg.ttf", "100italic" => "http://fonts.gstatic.com/s/alegreyasans/v3/gRkSP2lBpqoMTVxg7DmVn2cDnjsrnI9_xJ-5gnBaHsE.ttf", "300italic" => "http://fonts.gstatic.com/s/alegreyasans/v3/WfiXipsmjqRqsDBQ1bA9CnfqlVoxTUFFx1C8tBqmbcg.ttf", "regular" => "http://fonts.gstatic.com/s/alegreyasans/v3/KYNzioYhDai7mTMnx_gDgn8f0n03UdmQgF_CLvNR2vg.ttf", "italic" => "http://fonts.gstatic.com/s/alegreyasans/v3/TKyx_-JJ6MdpQruNk-t-PD4G9C9ttb0Oz5Cvf0qOitE.ttf", "500italic" => "http://fonts.gstatic.com/s/alegreyasans/v3/WfiXipsmjqRqsDBQ1bA9Cs7DCVO6wo6i5LKIyZDzK40.ttf", "700italic" => "http://fonts.gstatic.com/s/alegreyasans/v3/WfiXipsmjqRqsDBQ1bA9CpF66r9C4AnxxlBlGd7xY4g.ttf", "800italic" => "http://fonts.gstatic.com/s/alegreyasans/v3/WfiXipsmjqRqsDBQ1bA9CicOAJ_9MkLPbDmrtXDPbIU.ttf", "900italic" => "http://fonts.gstatic.com/s/alegreyasans/v3/WfiXipsmjqRqsDBQ1bA9ChRaDUI9aE8-k7PrIG2iiuo.ttf")), array("kind" => "webfonts#webfont", "family" => "Alegreya Sans SC", "category" => "sans-serif", "variants" => array("100", "100italic", "300", "300italic", "regular", "italic", "500", "500italic", "700", "700italic", "800", "800italic", "900", "900italic"), "subsets" => array("latin", "latin-ext", "vietnamese"), "version" => "v3", "lastModified" => "2016-06-07", "files" => array("100" => "http://fonts.gstatic.com/s/alegreyasanssc/v3/trwFkDJLOJf6hqM93944kVnzStfdnFU-MXbO84aBs_M.ttf", "300" => "http://fonts.gstatic.com/s/alegreyasanssc/v3/AjAmkoP1y0Vaad0UPPR46-1IqtfxJspFjzJp0SaQRcI.ttf", "500" => "http://fonts.gstatic.com/s/alegreyasanssc/v3/AjAmkoP1y0Vaad0UPPR46_hHTluI57wqxl55RvSYo3s.ttf", "700" => "http://fonts.gstatic.com/s/alegreyasanssc/v3/AjAmkoP1y0Vaad0UPPR4600aId5t1FC-xZ8nmpa_XLk.ttf", "800" => "http://fonts.gstatic.com/s/alegreyasanssc/v3/AjAmkoP1y0Vaad0UPPR46wQgSHD3Lo1Mif2Wkk5swWA.ttf", "900" => "http://fonts.gstatic.com/s/alegreyasanssc/v3/AjAmkoP1y0Vaad0UPPR461Rf9EWUSEX_PR1d_gLKfpM.ttf", "100italic" => "http://fonts.gstatic.com/s/alegreyasanssc/v3/qG3gA9iy5RpXMH4crZboqqakMVR0XlJhO7VdJ8yYvA4.ttf", "300italic" => "http://fonts.gstatic.com/s/alegreyasanssc/v3/0VweK-TO3aQgazdxg8fs0CnTKaH808trtzttbEg4yVA.ttf", "regular" => "http://fonts.gstatic.com/s/alegreyasanssc/v3/6kgb6ZvOagoVIRZyl8XV-EklWX-XdLVn1WTiuGuvKIU.ttf", "italic" => "http://fonts.gstatic.com/s/alegreyasanssc/v3/trwFkDJLOJf6hqM93944kTfqo69HNOlCNZvbwAmUtiA.ttf", "500italic" => "http://fonts.gstatic.com/s/alegreyasanssc/v3/0VweK-TO3aQgazdxg8fs0NqVvxKdFVwqwzilqfVd39U.ttf", "700italic" => "http://fonts.gstatic.com/s/alegreyasanssc/v3/0VweK-TO3aQgazdxg8fs0IBYn3VD6xMEnodOh8pnFw4.ttf", "800italic" => "http://fonts.gstatic.com/s/alegreyasanssc/v3/0VweK-TO3aQgazdxg8fs0HStmCm6Rs90XeztCALm0H8.ttf", "900italic" => "http://fonts.gstatic.com/s/alegreyasanssc/v3/0VweK-TO3aQgazdxg8fs0IvtwEfTCJoOJugANj-jWDI.ttf")), array("kind" => "webfonts#webfont", "family" => "Alex Brush", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/alexbrush/v6/ooh3KJFbKJSUoIRWfiu8o_esZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Alfa Slab One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/alfaslabone/v5/Qx6FPcitRwTC_k88tLPc-Yjjx0o0jr6fNXxPgYh_a8Q.ttf")), array("kind" => "webfonts#webfont", "family" => "Alice", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/alice/v7/wZTAfivekBqIg-rk63nFvQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Alike", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/alike/v8/Ho8YpRKNk_202fwDiGNIyw.ttf")), array("kind" => "webfonts#webfont", "family" => "Alike Angular", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/alikeangular/v6/OpeCu4xxI3qO1C7CZcJtPT3XH2uEnVI__ynTBvNyki8.ttf")), array("kind" => "webfonts#webfont", "family" => "Allan", "category" => "display", "variants" => array("regular", "700"), "subsets" => array("latin", "latin-ext"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/allan/v7/zSxQiwo7wgnr7KkMXhSiag.ttf", "regular" => "http://fonts.gstatic.com/s/allan/v7/T3lemhgZmLQkQI2Qc2bQHA.ttf")), array("kind" => "webfonts#webfont", "family" => "Allerta", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/allerta/v7/s9FOEuiJFTNbMe06ifzV8g.ttf")), array("kind" => "webfonts#webfont", "family" => "Allerta Stencil", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/allertastencil/v7/CdSZfRtHbQrBohqmzSdDYFf2eT4jUldwg_9fgfY_tHc.ttf")), array("kind" => "webfonts#webfont", "family" => "Allura", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/allura/v4/4hcqgZanyuJ2gMYWffIR6A.ttf")), array("kind" => "webfonts#webfont", "family" => "Almendra", "category" => "serif", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("latin", "latin-ext"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/almendra/v8/ZpLdQMj7Q2AFio4nNO6A76CWcynf_cDxXwCLxiixG1c.ttf", "regular" => "http://fonts.gstatic.com/s/almendra/v8/PDpbB-ZF7deXAAEYPkQOeg.ttf", "italic" => "http://fonts.gstatic.com/s/almendra/v8/CNWLyiDucqVKVgr4EMidi_esZW2xOQ-xsNqO47m55DA.ttf", "700italic" => "http://fonts.gstatic.com/s/almendra/v8/-tXHKMcnn6FqrhJV3l1e3QJKKGfqHaYFsRG-T3ceEVo.ttf")), array("kind" => "webfonts#webfont", "family" => "Almendra Display", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/almendradisplay/v6/2Zuu97WJ_ez-87yz5Ai8fF6uyC_qD11hrFQ6EGgTJWI.ttf")), array("kind" => "webfonts#webfont", "family" => "Almendra SC", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/almendrasc/v6/IuiLd8Fm9I6raSalxMoWeaCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Amarante", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/amarante/v4/2dQHjIBWSpydit5zkJZnOw.ttf")), array("kind" => "webfonts#webfont", "family" => "Amaranth", "category" => "sans-serif", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-06-07", "files" => array("700" => "http://fonts.gstatic.com/s/amaranth/v6/j5OFHqadfxyLnQRxFeox6qCWcynf_cDxXwCLxiixG1c.ttf", "regular" => "http://fonts.gstatic.com/s/amaranth/v6/7VcBog22JBHsHXHdnnycTA.ttf", "italic" => "http://fonts.gstatic.com/s/amaranth/v6/UrJlRY9LcVERJSvggsdBqPesZW2xOQ-xsNqO47m55DA.ttf", "700italic" => "http://fonts.gstatic.com/s/amaranth/v6/BHyuYFj9nqLFNvOvGh0xTwJKKGfqHaYFsRG-T3ceEVo.ttf")), array("kind" => "webfonts#webfont", "family" => "Amatic SC", "category" => "handwriting", "variants" => array("regular", "700"), "subsets" => array("latin", "latin-ext"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/amaticsc/v8/IDnkRTPGcrSVo50UyYNK7y3USBnSvpkopQaUR-2r7iU.ttf", "regular" => "http://fonts.gstatic.com/s/amaticsc/v8/MldbRWLFytvqxU1y81xSVg.ttf")), array("kind" => "webfonts#webfont", "family" => "Amatica SC", "category" => "display", "variants" => array("regular", "700"), "subsets" => array("latin", "latin-ext", "hebrew"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("700" => "http://fonts.gstatic.com/s/amaticasc/v1/nFmSxyAMfCP_5xGDJ4j5TgJKKGfqHaYFsRG-T3ceEVo.ttf", "regular" => "http://fonts.gstatic.com/s/amaticasc/v1/f9SWSy9DLsJV2etvm5rwGPesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Amethysta", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/amethysta/v4/1jEo9tOFIJDolAUpBnWbnA.ttf")), array("kind" => "webfonts#webfont", "family" => "Amiko", "category" => "sans-serif", "variants" => array("regular", "600", "700"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("600" => "http://fonts.gstatic.com/s/amiko/v1/BaZst4RZ4sDyD3mH-BfVaA.ttf", "700" => "http://fonts.gstatic.com/s/amiko/v1/6syx43mQ07VvOmpFc0G9Lg.ttf", "regular" => "http://fonts.gstatic.com/s/amiko/v1/A7bjc3cOLJtGgpPGnxyHsw.ttf")), array("kind" => "webfonts#webfont", "family" => "Amiri", "category" => "serif", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("latin", "arabic"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/amiri/v7/WQsR_moz-FNqVwGYgptqiA.ttf", "regular" => "http://fonts.gstatic.com/s/amiri/v7/ATARrPmSew75SlpOw2YABQ.ttf", "italic" => "http://fonts.gstatic.com/s/amiri/v7/3t1yTQlLUXBw8htrqlXBrw.ttf", "700italic" => "http://fonts.gstatic.com/s/amiri/v7/uF8aNEyD0bxMeTBg9bFDSPesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Amita", "category" => "handwriting", "variants" => array("regular", "700"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v1", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/amita/v1/cIYA2Lzp7l2pcGsqpUidBg.ttf", "regular" => "http://fonts.gstatic.com/s/amita/v1/RhdhGBXSJqkHo6g7miTEcQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Anaheim", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/anaheim/v4/t-z8aXHMpgI2gjN_rIflKA.ttf")), array("kind" => "webfonts#webfont", "family" => "Andada", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/andada/v7/rSFaDqNNQBRw3y19MB5Y4w.ttf")), array("kind" => "webfonts#webfont", "family" => "Andika", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("cyrillic", "cyrillic-ext", "latin", "latin-ext", "vietnamese"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/andika/v7/oe-ag1G0lcqZ3IXfeEgaGg.ttf")), array("kind" => "webfonts#webfont", "family" => "Angkor", "category" => "display", "variants" => array("regular"), "subsets" => array("khmer"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/angkor/v8/DLpLgIS-8F10ecwKqCm95Q.ttf")), array("kind" => "webfonts#webfont", "family" => "Annie Use Your Telescope", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/annieuseyourtelescope/v6/2cuiO5VmaR09C8SLGEQjGqbp7mtG8sPlcZvOaO8HBak.ttf")), array("kind" => "webfonts#webfont", "family" => "Anonymous Pro", "category" => "monospace", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("cyrillic", "latin", "latin-ext", "greek"), "version" => "v9", "lastModified" => "2016-06-07", "files" => array("700" => "http://fonts.gstatic.com/s/anonymouspro/v9/WDf5lZYgdmmKhO8E1AQud--Cz_5MeePnXDAcLNWyBME.ttf", "regular" => "http://fonts.gstatic.com/s/anonymouspro/v9/Zhfjj_gat3waL4JSju74E-V_5zh5b-_HiooIRUBwn1A.ttf", "italic" => "http://fonts.gstatic.com/s/anonymouspro/v9/q0u6LFHwttnT_69euiDbWKwIsuKDCXG0NQm7BvAgx-c.ttf", "700italic" => "http://fonts.gstatic.com/s/anonymouspro/v9/_fVr_XGln-cetWSUc-JpfA1LL9bfs7wyIp6F8OC9RxA.ttf")), array("kind" => "webfonts#webfont", "family" => "Antic", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/antic/v7/hEa8XCNM7tXGzD0Uk0AipA.ttf")), array("kind" => "webfonts#webfont", "family" => "Antic Didone", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/anticdidone/v4/r3nJcTDuOluOL6LGDV1vRy3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Antic Slab", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/anticslab/v4/PSbJCTKkAS7skPdkd7AKEvesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Anton", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v7", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/anton/v7/XIbCenm-W0IRHWYIh7CGUQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Arapey", "category" => "serif", "variants" => array("regular", "italic"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/arapey/v5/dqu823lrSYn8T2gApTdslA.ttf", "italic" => "http://fonts.gstatic.com/s/arapey/v5/pY-Xi5JNBpaWxy2tZhEm5A.ttf")), array("kind" => "webfonts#webfont", "family" => "Arbutus", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/arbutus/v5/Go_hurxoUsn5MnqNVQgodQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Arbutus Slab", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/arbutusslab/v4/6k3Yp6iS9l4jRIpynA8qMy3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Architects Daughter", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/architectsdaughter/v6/RXTgOOQ9AAtaVOHxx0IUBMCy0EhZjHzu-y0e6uLf4Fg.ttf")), array("kind" => "webfonts#webfont", "family" => "Archivo Black", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/archivoblack/v4/WoAoVT7K3k7hHfxKbvB6B51XQG8isOYYJhPIYAyrESQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Archivo Narrow", "category" => "sans-serif", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/archivonarrow/v5/M__Wu4PAmHf4YZvQM8tWsMLtdzs3iyjn_YuT226ZsLU.ttf", "regular" => "http://fonts.gstatic.com/s/archivonarrow/v5/DsLzC9scoPnrGiwYYMQXppTvAuddT2xDMbdz0mdLyZY.ttf", "italic" => "http://fonts.gstatic.com/s/archivonarrow/v5/vqsrtPCpTU3tJlKfuXP5zUpmlyBQEFfdE6dERLXdQGQ.ttf", "700italic" => "http://fonts.gstatic.com/s/archivonarrow/v5/wG6O733y5zHl4EKCOh8rSTg5KB8MNJ4uPAETq9naQO8.ttf")), array("kind" => "webfonts#webfont", "family" => "Aref Ruqaa", "category" => "serif", "variants" => array("regular", "700"), "subsets" => array("latin", "arabic"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("700" => "http://fonts.gstatic.com/s/arefruqaa/v1/RT-Q5DVI9arM6ZKux-UmTAJKKGfqHaYFsRG-T3ceEVo.ttf", "regular" => "http://fonts.gstatic.com/s/arefruqaa/v1/kbqI055uLQz2hkccTTrYPfesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Arima Madurai", "category" => "display", "variants" => array("100", "200", "300", "regular", "500", "700", "800", "900"), "subsets" => array("latin", "tamil", "latin-ext", "vietnamese"), "version" => "v2", "lastModified" => "2016-06-20", "files" => array("100" => "http://fonts.gstatic.com/s/arimamadurai/v2/Q0tjl46beRRcUe3RlWWNrdyXLlNBCUjoM1yKFfVCFUI.ttf", "200" => "http://fonts.gstatic.com/s/arimamadurai/v2/EsCGNPwBfkMk17-w_DTJ4rArwWuxcSSKq67BdR6k5Rg.ttf", "300" => "http://fonts.gstatic.com/s/arimamadurai/v2/EsCGNPwBfkMk17-w_DTJ4joJ52uD-1fmXmi8u0n_zsc.ttf", "500" => "http://fonts.gstatic.com/s/arimamadurai/v2/EsCGNPwBfkMk17-w_DTJ4v_2zpxNHQ3utWt_82o9dAo.ttf", "700" => "http://fonts.gstatic.com/s/arimamadurai/v2/EsCGNPwBfkMk17-w_DTJ4qiiXuG_rGcOxkuidirlnJE.ttf", "800" => "http://fonts.gstatic.com/s/arimamadurai/v2/EsCGNPwBfkMk17-w_DTJ4khKLu0CevfTHM1eXjGnvQo.ttf", "900" => "http://fonts.gstatic.com/s/arimamadurai/v2/EsCGNPwBfkMk17-w_DTJ4kZ0oshA7r_PlGegwiHddT8.ttf", "regular" => "http://fonts.gstatic.com/s/arimamadurai/v2/8fNfThKRw_pr7MwgNdcHiW_MnNA9OgK8I1F23mNWOpE.ttf")), array("kind" => "webfonts#webfont", "family" => "Arimo", "category" => "sans-serif", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("cyrillic", "cyrillic-ext", "latin", "greek-ext", "latin-ext", "greek", "hebrew", "vietnamese"), "version" => "v9", "lastModified" => "2016-05-20", "files" => array("700" => "http://fonts.gstatic.com/s/arimo/v9/ZItXugREyvV9LnbY_gxAmw.ttf", "regular" => "http://fonts.gstatic.com/s/arimo/v9/Gpeo80g-5ji2CcyXWnzh7g.ttf", "italic" => "http://fonts.gstatic.com/s/arimo/v9/_OdGbnX2-qQ96C4OjhyuPw.ttf", "700italic" => "http://fonts.gstatic.com/s/arimo/v9/__nOLWqmeXdhfr0g7GaFePesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Arizonia", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/arizonia/v6/yzJqkHZqryZBTM7RKYV9Wg.ttf")), array("kind" => "webfonts#webfont", "family" => "Armata", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v6", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/armata/v6/1H8FwGgIRrbYtxSfXhOHlQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Artifika", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/artifika/v6/Ekfp4H4QG7D-WsABDOyj8g.ttf")), array("kind" => "webfonts#webfont", "family" => "Arvo", "category" => "serif", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("latin"), "version" => "v9", "lastModified" => "2016-06-07", "files" => array("700" => "http://fonts.gstatic.com/s/arvo/v9/OB3FDST7U38u3OjPK_vvRQ.ttf", "regular" => "http://fonts.gstatic.com/s/arvo/v9/vvWPwz-PlZEwjOOIKqoZzA.ttf", "italic" => "http://fonts.gstatic.com/s/arvo/v9/id5a4BCjbenl5Gkqonw_Rw.ttf", "700italic" => "http://fonts.gstatic.com/s/arvo/v9/Hvl2MuWoXLaCy2v6MD4Yvw.ttf")), array("kind" => "webfonts#webfont", "family" => "Arya", "category" => "sans-serif", "variants" => array("regular", "700"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v1", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/arya/v1/N13tgOvG7VTXawiI-fJiQA.ttf", "regular" => "http://fonts.gstatic.com/s/arya/v1/xEVqtU3v8QLospHKpDaYEw.ttf")), array("kind" => "webfonts#webfont", "family" => "Asap", "category" => "sans-serif", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-06-07", "files" => array("700" => "http://fonts.gstatic.com/s/asap/v4/o5RUA7SsJ80M8oDFBnrDbg.ttf", "regular" => "http://fonts.gstatic.com/s/asap/v4/2lf-1MDR8tsTpEtvJmr2hA.ttf", "italic" => "http://fonts.gstatic.com/s/asap/v4/mwxNHf8QS8gNWCAMwkJNIg.ttf", "700italic" => "http://fonts.gstatic.com/s/asap/v4/_rZz9y2oXc09jT5T6BexLQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Asar", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v2", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/asar/v2/mSmn3H5CcMA84CZ586X7WQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Asset", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/asset/v6/hfPmqY-JzuR1lULlQf9iTg.ttf")), array("kind" => "webfonts#webfont", "family" => "Assistant", "category" => "sans-serif", "variants" => array("200", "300", "regular", "600", "700", "800"), "subsets" => array("latin", "hebrew"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("200" => "http://fonts.gstatic.com/s/assistant/v1/xXstfiHQzjB9j5ZxYTBoZy3USBnSvpkopQaUR-2r7iU.ttf", "300" => "http://fonts.gstatic.com/s/assistant/v1/vPC3tCw3LOzCSeGCtVp5Wi3USBnSvpkopQaUR-2r7iU.ttf", "600" => "http://fonts.gstatic.com/s/assistant/v1/Y4UC5nQA69lWpfV0itoWLi3USBnSvpkopQaUR-2r7iU.ttf", "700" => "http://fonts.gstatic.com/s/assistant/v1/dZywGH4pMxP6OVyrppOJxy3USBnSvpkopQaUR-2r7iU.ttf", "800" => "http://fonts.gstatic.com/s/assistant/v1/-mTR0sX8a0RsadH4AMDT8C3USBnSvpkopQaUR-2r7iU.ttf", "regular" => "http://fonts.gstatic.com/s/assistant/v1/2iDwv6DBtyixlK5YHngp1w.ttf")), array("kind" => "webfonts#webfont", "family" => "Astloch", "category" => "display", "variants" => array("regular", "700"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/astloch/v6/aPkhM2tL-tz1jX6aX2rvo_esZW2xOQ-xsNqO47m55DA.ttf", "regular" => "http://fonts.gstatic.com/s/astloch/v6/fmbitVmHYLQP7MGPuFgpag.ttf")), array("kind" => "webfonts#webfont", "family" => "Asul", "category" => "sans-serif", "variants" => array("regular", "700"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/asul/v5/uO8uNmxaq87-DdPmkEg5Gg.ttf", "regular" => "http://fonts.gstatic.com/s/asul/v5/9qpsNR_OOwyOYyo2N0IbBw.ttf")), array("kind" => "webfonts#webfont", "family" => "Athiti", "category" => "sans-serif", "variants" => array("200", "300", "regular", "500", "600", "700"), "subsets" => array("latin", "thai", "latin-ext", "vietnamese"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("200" => "http://fonts.gstatic.com/s/athiti/v1/Ge5skdKwzxRPajVLdOJuIg.ttf", "300" => "http://fonts.gstatic.com/s/athiti/v1/OoT7lj4AaSp1JpGJLKn3CA.ttf", "500" => "http://fonts.gstatic.com/s/athiti/v1/W3pP-ANXfsMOVOG-cqqMFw.ttf", "600" => "http://fonts.gstatic.com/s/athiti/v1/kYx3dtUYNEuUlzWczYzsmQ.ttf", "700" => "http://fonts.gstatic.com/s/athiti/v1/tyXFOxQyZGXfqHhtqSikdw.ttf", "regular" => "http://fonts.gstatic.com/s/athiti/v1/e7eiIKP18Iz9Kg1xat6AYw.ttf")), array("kind" => "webfonts#webfont", "family" => "Atma", "category" => "display", "variants" => array("300", "regular", "500", "600", "700"), "subsets" => array("bengali", "latin", "latin-ext"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("300" => "http://fonts.gstatic.com/s/atma/v1/noxn2r6cT3JgmEDt6Ip5pQ.ttf", "500" => "http://fonts.gstatic.com/s/atma/v1/Htksg3ZXeAEbSvUdTQX-uw.ttf", "600" => "http://fonts.gstatic.com/s/atma/v1/EGUwD65ZZn9IIHp5Y36b4A.ttf", "700" => "http://fonts.gstatic.com/s/atma/v1/-fkXl3wADUHjobbwO9d-Wg.ttf", "regular" => "http://fonts.gstatic.com/s/atma/v1/dkXPrLoE_uqcgUFj4JdfRQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Atomic Age", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/atomicage/v7/WvBMe4FxANIKpo6Oi0mVJ_esZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Aubrey", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/aubrey/v8/zo9w8klO8bmOQIMajQ2aTA.ttf")), array("kind" => "webfonts#webfont", "family" => "Audiowide", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/audiowide/v4/yGcwRZB6VmoYhPUYT-mEow.ttf")), array("kind" => "webfonts#webfont", "family" => "Autour One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/autourone/v5/2xmQBcg7FN72jaQRFZPIDvesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Average", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/average/v4/aHUibBqdDbVYl5FM48pxyQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Average Sans", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/averagesans/v4/dnU3R-5A_43y5bIyLztPsS3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Averia Gruesa Libre", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/averiagruesalibre/v4/10vbZTOoN6T8D-nvDzwRFyXcKHuZXlCN8VkWHpkUzKM.ttf")), array("kind" => "webfonts#webfont", "family" => "Averia Libre", "category" => "display", "variants" => array("300", "300italic", "regular", "italic", "700", "700italic"), "subsets" => array("latin"), "version" => "v4", "lastModified" => "2016-06-07", "files" => array("300" => "http://fonts.gstatic.com/s/averialibre/v4/r6hGL8sSLm4dTzOPXgx5XacQoVhARpoaILP7amxE_8g.ttf", "700" => "http://fonts.gstatic.com/s/averialibre/v4/r6hGL8sSLm4dTzOPXgx5XUD2ttfZwueP-QU272T9-k4.ttf", "300italic" => "http://fonts.gstatic.com/s/averialibre/v4/I6wAYuAvOgT7el2ePj2nkina0FLWfcB-J_SAYmcAXaI.ttf", "regular" => "http://fonts.gstatic.com/s/averialibre/v4/rYVgHZZQICWnhjguGsBspC3USBnSvpkopQaUR-2r7iU.ttf", "italic" => "http://fonts.gstatic.com/s/averialibre/v4/1etzuoNxVHR8F533EkD1WfMZXuCXbOrAvx5R0IT5Oyo.ttf", "700italic" => "http://fonts.gstatic.com/s/averialibre/v4/I6wAYuAvOgT7el2ePj2nkvAs9-1nE9qOqhChW0m4nDE.ttf")), array("kind" => "webfonts#webfont", "family" => "Averia Sans Libre", "category" => "display", "variants" => array("300", "300italic", "regular", "italic", "700", "700italic"), "subsets" => array("latin"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("300" => "http://fonts.gstatic.com/s/averiasanslibre/v4/_9-jTfQjaBsWAF_yp5z-V4CP_KG_g80s1KXiBtJHoNc.ttf", "700" => "http://fonts.gstatic.com/s/averiasanslibre/v4/_9-jTfQjaBsWAF_yp5z-V8QwVOrz1y5GihpZmtKLhlI.ttf", "300italic" => "http://fonts.gstatic.com/s/averiasanslibre/v4/o7BEIK-fG3Ykc5Rzteh88YuyGu4JqttndUh4gRKxic0.ttf", "regular" => "http://fonts.gstatic.com/s/averiasanslibre/v4/yRJpjT39KxACO9F31mj_LqV8_KRn4epKAjTFK1s1fsg.ttf", "italic" => "http://fonts.gstatic.com/s/averiasanslibre/v4/COEzR_NPBSUOl3pFwPbPoCZU2HnUZT1xVKaIrHDioao.ttf", "700italic" => "http://fonts.gstatic.com/s/averiasanslibre/v4/o7BEIK-fG3Ykc5Rzteh88bXy1DXgmJcVtKjM5UWamMs.ttf")), array("kind" => "webfonts#webfont", "family" => "Averia Serif Libre", "category" => "display", "variants" => array("300", "300italic", "regular", "italic", "700", "700italic"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("300" => "http://fonts.gstatic.com/s/averiaseriflibre/v5/yvITAdr5D1nlsdFswJAb8SmC4gFJ2PHmfdVKEd_5S9M.ttf", "700" => "http://fonts.gstatic.com/s/averiaseriflibre/v5/yvITAdr5D1nlsdFswJAb8Q50KV5TaOVolur4zV2iZsg.ttf", "300italic" => "http://fonts.gstatic.com/s/averiaseriflibre/v5/YOLFXyye4sZt6AZk1QybCG2okl0bU63CauowU4iApig.ttf", "regular" => "http://fonts.gstatic.com/s/averiaseriflibre/v5/fdtF30xa_Erw0zAzOoG4BZqY66i8AUyI16fGqw0iAew.ttf", "italic" => "http://fonts.gstatic.com/s/averiaseriflibre/v5/o9qhvK9iT5iDWfyhQUe-6Ru_b0bTq5iipbJ9hhgHJ6U.ttf", "700italic" => "http://fonts.gstatic.com/s/averiaseriflibre/v5/YOLFXyye4sZt6AZk1QybCNxohRXP4tNDqG3X4Hqn21k.ttf")), array("kind" => "webfonts#webfont", "family" => "Bad Script", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("cyrillic", "latin"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/badscript/v5/cRyUs0nJ2eMQFHwBsZNRXfesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Baloo", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "devanagari", "latin-ext", "vietnamese"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("regular" => "http://fonts.gstatic.com/s/baloo/v1/uFkbq9GEAWUcT0XNeptJ1Q.ttf")), array("kind" => "webfonts#webfont", "family" => "Baloo Bhai", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext", "gujarati", "vietnamese"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("regular" => "http://fonts.gstatic.com/s/baloobhai/v1/FQvpC-04bh2QINuWAdnNW_esZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Baloo Da", "category" => "display", "variants" => array("regular"), "subsets" => array("bengali", "latin", "latin-ext", "vietnamese"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("regular" => "http://fonts.gstatic.com/s/balooda/v1/RAJ0l2eJl_HDURCVxRE1iQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Baloo Thambi", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "tamil", "latin-ext", "vietnamese"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("regular" => "http://fonts.gstatic.com/s/baloothambi/v1/qXK3dZIeU-O-HruaN5cK0y3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Balthazar", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/balthazar/v5/WgbaSIs6dJAGXJ0qbz2xlw.ttf")), array("kind" => "webfonts#webfont", "family" => "Bangers", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/bangers/v8/WAffdge5w99Xif-DLeqmcA.ttf")), array("kind" => "webfonts#webfont", "family" => "Basic", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v6", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/basic/v6/hNII2mS5Dxw5C0u_m3mXgA.ttf")), array("kind" => "webfonts#webfont", "family" => "Battambang", "category" => "display", "variants" => array("regular", "700"), "subsets" => array("khmer"), "version" => "v9", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/battambang/v9/dezbRtMzfzAA99DmrCYRMgJKKGfqHaYFsRG-T3ceEVo.ttf", "regular" => "http://fonts.gstatic.com/s/battambang/v9/MzrUfQLefYum5vVGM3EZVPesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Baumans", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/baumans/v5/o0bFdPW1H5kd5saqqOcoVg.ttf")), array("kind" => "webfonts#webfont", "family" => "Bayon", "category" => "display", "variants" => array("regular"), "subsets" => array("khmer"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/bayon/v8/yTubusjTnpNRZwA4_50iVw.ttf")), array("kind" => "webfonts#webfont", "family" => "Belgrano", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/belgrano/v6/iq8DUa2s7g6WRCeMiFrmtQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Belleza", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/belleza/v4/wchA3BWJlVqvIcSeNZyXew.ttf")), array("kind" => "webfonts#webfont", "family" => "BenchNine", "category" => "sans-serif", "variants" => array("300", "regular", "700"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("300" => "http://fonts.gstatic.com/s/benchnine/v4/ah9xtUy9wLQ3qnWa2p-piS3USBnSvpkopQaUR-2r7iU.ttf", "700" => "http://fonts.gstatic.com/s/benchnine/v4/qZpi6ZVZg3L2RL_xoBLxWS3USBnSvpkopQaUR-2r7iU.ttf", "regular" => "http://fonts.gstatic.com/s/benchnine/v4/h3OAlYqU3aOeNkuXgH2Q2w.ttf")), array("kind" => "webfonts#webfont", "family" => "Bentham", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/bentham/v6/5-Mo8Fe7yg5tzV0GlQIuzQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Berkshire Swash", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/berkshireswash/v4/4RZJjVRPjYnC2939hKCAimKfbtsIjCZP_edQljX9gR0.ttf")), array("kind" => "webfonts#webfont", "family" => "Bevan", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/bevan/v7/Rtg3zDsCeQiaJ_Qno22OJA.ttf")), array("kind" => "webfonts#webfont", "family" => "Bigelow Rules", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/bigelowrules/v4/FEJCPLwo07FS-6SK6Al50X8f0n03UdmQgF_CLvNR2vg.ttf")), array("kind" => "webfonts#webfont", "family" => "Bigshot One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/bigshotone/v6/wSyZjBNTWDQHnvWE2jt6j6CWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Bilbo", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/bilbo/v6/-ty-lPs5H7OIucWbnpFrkA.ttf")), array("kind" => "webfonts#webfont", "family" => "Bilbo Swash Caps", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/bilboswashcaps/v7/UB_-crLvhx-PwGKW1oosDmYeFSdnSpRYv5h9gpdlD1g.ttf")), array("kind" => "webfonts#webfont", "family" => "BioRhyme", "category" => "serif", "variants" => array("200", "300", "regular", "700", "800"), "subsets" => array("latin", "latin-ext"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("200" => "http://fonts.gstatic.com/s/biorhyme/v1/bj-6g_1gJHCc9xQZtLWL36CWcynf_cDxXwCLxiixG1c.ttf", "300" => "http://fonts.gstatic.com/s/biorhyme/v1/jWqHmLFlu30n7xp12uZd8qCWcynf_cDxXwCLxiixG1c.ttf", "700" => "http://fonts.gstatic.com/s/biorhyme/v1/36KN76U1iKt5TFDm2lBz0KCWcynf_cDxXwCLxiixG1c.ttf", "800" => "http://fonts.gstatic.com/s/biorhyme/v1/k6bYbUnESjLYnworWvSTL6CWcynf_cDxXwCLxiixG1c.ttf", "regular" => "http://fonts.gstatic.com/s/biorhyme/v1/n6v5UkVPy_CjbP3fvsu1CA.ttf")), array("kind" => "webfonts#webfont", "family" => "BioRhyme Expanded", "category" => "serif", "variants" => array("200", "300", "regular", "700", "800"), "subsets" => array("latin", "latin-ext"), "version" => "v2", "lastModified" => "2016-06-20", "files" => array("200" => "http://fonts.gstatic.com/s/biorhymeexpanded/v2/FKL4Vyxmq2vsiDrSOzz2sC7oxZzNh3ej55UHm-HviBI.ttf", "300" => "http://fonts.gstatic.com/s/biorhymeexpanded/v2/FKL4Vyxmq2vsiDrSOzz2sFu4cYPPksG4MRjB5UiYPPw.ttf", "700" => "http://fonts.gstatic.com/s/biorhymeexpanded/v2/FKL4Vyxmq2vsiDrSOzz2sMVisRVfPEfQ0jijOMQbr0Q.ttf", "800" => "http://fonts.gstatic.com/s/biorhymeexpanded/v2/FKL4Vyxmq2vsiDrSOzz2sIv1v1eCT6RPbcYZYQ1T1CE.ttf", "regular" => "http://fonts.gstatic.com/s/biorhymeexpanded/v2/hgBNpgjTRZzGmZxqN5OuVjndr_hij4ilAk2n1d1AhsE.ttf")), array("kind" => "webfonts#webfont", "family" => "Biryani", "category" => "sans-serif", "variants" => array("200", "300", "regular", "600", "700", "800", "900"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v1", "lastModified" => "2016-05-31", "files" => array("200" => "http://fonts.gstatic.com/s/biryani/v1/Xx38YzyTFF8n6mRS1Yd88vesZW2xOQ-xsNqO47m55DA.ttf", "300" => "http://fonts.gstatic.com/s/biryani/v1/u-bneRbizmFMd0VQp5Ze6vesZW2xOQ-xsNqO47m55DA.ttf", "600" => "http://fonts.gstatic.com/s/biryani/v1/1EdcPCVxBR2txgjrza6_YPesZW2xOQ-xsNqO47m55DA.ttf", "700" => "http://fonts.gstatic.com/s/biryani/v1/qN2MTZ0j1sKSCtfXLB2dR_esZW2xOQ-xsNqO47m55DA.ttf", "800" => "http://fonts.gstatic.com/s/biryani/v1/DJyziS7FEy441v22InYdevesZW2xOQ-xsNqO47m55DA.ttf", "900" => "http://fonts.gstatic.com/s/biryani/v1/trcLkrIut0lM_PPSyQfAMPesZW2xOQ-xsNqO47m55DA.ttf", "regular" => "http://fonts.gstatic.com/s/biryani/v1/W7bfR8-IY76Xz0QoB8L2xw.ttf")), array("kind" => "webfonts#webfont", "family" => "Bitter", "category" => "serif", "variants" => array("regular", "italic", "700"), "subsets" => array("latin", "latin-ext"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/bitter/v8/4dUtr_4BvHuoRU35suyOAg.ttf", "regular" => "http://fonts.gstatic.com/s/bitter/v8/w_BNdJvVZDRmqy5aSfB2kQ.ttf", "italic" => "http://fonts.gstatic.com/s/bitter/v8/TC0FZEVzXQIGgzmRfKPZbA.ttf")), array("kind" => "webfonts#webfont", "family" => "Black Ops One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v7", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/blackopsone/v7/2XW-DmDsGbDLE372KrMW1Yjjx0o0jr6fNXxPgYh_a8Q.ttf")), array("kind" => "webfonts#webfont", "family" => "Bokor", "category" => "display", "variants" => array("regular"), "subsets" => array("khmer"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/bokor/v8/uAKdo0A85WW23Gs6mcbw7A.ttf")), array("kind" => "webfonts#webfont", "family" => "Bonbon", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/bonbon/v7/IW3u1yzG1knyW5oz0s9_6Q.ttf")), array("kind" => "webfonts#webfont", "family" => "Boogaloo", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/boogaloo/v6/4Wu1tvFMoB80fSu8qLgQfQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Bowlby One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/bowlbyone/v7/eKpHjHfjoxM2bX36YNucefesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Bowlby One SC", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/bowlbyonesc/v8/8ZkeXftTuzKBtmxOYXoRedDkZCMxWJecxjvKm2f8MJw.ttf")), array("kind" => "webfonts#webfont", "family" => "Brawler", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/brawler/v6/3gfSw6imxQnQxweVITqUrg.ttf")), array("kind" => "webfonts#webfont", "family" => "Bree Serif", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/breeserif/v5/5h9crBVIrvZqgf34FHcnEfesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Bubblegum Sans", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/bubblegumsans/v5/Y9iTUUNz6lbl6TrvV4iwsytnKWgpfO2iSkLzTz-AABg.ttf")), array("kind" => "webfonts#webfont", "family" => "Bubbler One", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/bubblerone/v4/e8S0qevkZAFaBybtt_SU4qCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Buda", "category" => "display", "variants" => array("300"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("300" => "http://fonts.gstatic.com/s/buda/v6/hLtAmNUmEMJH2yx7NGUjnA.ttf")), array("kind" => "webfonts#webfont", "family" => "Buenard", "category" => "serif", "variants" => array("regular", "700"), "subsets" => array("latin", "latin-ext"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/buenard/v7/yUlGE115dGr7O9w9FlP3UvesZW2xOQ-xsNqO47m55DA.ttf", "regular" => "http://fonts.gstatic.com/s/buenard/v7/NSpMPGKAUgrLrlstYVvIXQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Bungee", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext", "vietnamese"), "version" => "v2", "lastModified" => "2016-06-20", "files" => array("regular" => "http://fonts.gstatic.com/s/bungee/v2/0jM4G9s968t1_tpwzM9UDg.ttf")), array("kind" => "webfonts#webfont", "family" => "Bungee Hairline", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext", "vietnamese"), "version" => "v2", "lastModified" => "2016-06-20", "files" => array("regular" => "http://fonts.gstatic.com/s/bungeehairline/v2/8Li3dr3whdkxuk7pmLaZaSom6rTIagUDR1YFcrrRZjQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Bungee Inline", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext", "vietnamese"), "version" => "v2", "lastModified" => "2016-06-20", "files" => array("regular" => "http://fonts.gstatic.com/s/bungeeinline/v2/Tb-1914q4rFpjT-F66PLCYjjx0o0jr6fNXxPgYh_a8Q.ttf")), array("kind" => "webfonts#webfont", "family" => "Bungee Outline", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext", "vietnamese"), "version" => "v2", "lastModified" => "2016-06-20", "files" => array("regular" => "http://fonts.gstatic.com/s/bungeeoutline/v2/PcidvzXIcqS2Qwxm_iG6bLAREgn5xbW23GEXXnhMQ5Y.ttf")), array("kind" => "webfonts#webfont", "family" => "Bungee Shade", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext", "vietnamese"), "version" => "v2", "lastModified" => "2016-06-20", "files" => array("regular" => "http://fonts.gstatic.com/s/bungeeshade/v2/HSW7pxPYXBWkq7OSnuXoeC3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Butcherman", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/butcherman/v7/bxiJmD567sPBVpJsT0XR0vesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Butterfly Kids", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/butterflykids/v4/J4NTF5M25htqeTffYImtlUZaDk62iwTBnbnvwSjZciA.ttf")), array("kind" => "webfonts#webfont", "family" => "Cabin", "category" => "sans-serif", "variants" => array("regular", "italic", "500", "500italic", "600", "600italic", "700", "700italic"), "subsets" => array("latin"), "version" => "v9", "lastModified" => "2016-05-31", "files" => array("500" => "http://fonts.gstatic.com/s/cabin/v9/HgsCQ-k3_Z_uQ86aFolNBg.ttf", "600" => "http://fonts.gstatic.com/s/cabin/v9/eUDAvKhBtmTCkeVBsFk34A.ttf", "700" => "http://fonts.gstatic.com/s/cabin/v9/4EKhProuY1hq_WCAomq9Dg.ttf", "regular" => "http://fonts.gstatic.com/s/cabin/v9/XeuAFYo2xAPHxZGBbQtHhA.ttf", "italic" => "http://fonts.gstatic.com/s/cabin/v9/0tJ9k3DI5xC4GBgs1E_Jxw.ttf", "500italic" => "http://fonts.gstatic.com/s/cabin/v9/50sjhrGE0njyO-7mGDhGP_esZW2xOQ-xsNqO47m55DA.ttf", "600italic" => "http://fonts.gstatic.com/s/cabin/v9/sFQpQDBd3G2om0Nl5dD2CvesZW2xOQ-xsNqO47m55DA.ttf", "700italic" => "http://fonts.gstatic.com/s/cabin/v9/K83QKi8MOKLEqj6bgZ7LrfesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Cabin Condensed", "category" => "sans-serif", "variants" => array("regular", "500", "600", "700"), "subsets" => array("latin"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("500" => "http://fonts.gstatic.com/s/cabincondensed/v8/Ez4zJbsGr2BgXcNUWBVgEARL_-ABKXdjsJSPT0lc2Bk.ttf", "600" => "http://fonts.gstatic.com/s/cabincondensed/v8/Ez4zJbsGr2BgXcNUWBVgELS5sSASxc8z4EQTQj7DCAI.ttf", "700" => "http://fonts.gstatic.com/s/cabincondensed/v8/Ez4zJbsGr2BgXcNUWBVgEMAWgzcA047xWLixhLCofl8.ttf", "regular" => "http://fonts.gstatic.com/s/cabincondensed/v8/B0txb0blf2N29WdYPJjMSiQPsWWoiv__AzYJ9Zzn9II.ttf")), array("kind" => "webfonts#webfont", "family" => "Cabin Sketch", "category" => "display", "variants" => array("regular", "700"), "subsets" => array("latin"), "version" => "v9", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/cabinsketch/v9/ki3SSN5HMOO0-IOLOj069ED2ttfZwueP-QU272T9-k4.ttf", "regular" => "http://fonts.gstatic.com/s/cabinsketch/v9/d9fijO34zQajqQvl3YHRCS3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Caesar Dressing", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/caesardressing/v5/2T_WzBgE2Xz3FsyJMq34T9gR43u4FvCuJwIfF5Zxl6Y.ttf")), array("kind" => "webfonts#webfont", "family" => "Cagliostro", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/cagliostro/v5/i85oXbtdSatNEzss99bpj_esZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Cairo", "category" => "sans-serif", "variants" => array("200", "300", "regular", "600", "700", "900"), "subsets" => array("latin", "latin-ext", "arabic"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("200" => "http://fonts.gstatic.com/s/cairo/v1/9BU6Hrio9syG9zwo_CNPXg.ttf", "300" => "http://fonts.gstatic.com/s/cairo/v1/mpy3SIEJVOIfFnVLujcRDg.ttf", "600" => "http://fonts.gstatic.com/s/cairo/v1/Ct_3a0tcTEyNNSnuZKDd7g.ttf", "700" => "http://fonts.gstatic.com/s/cairo/v1/ONxTSBYfmg-V5CkIwS_5gQ.ttf", "900" => "http://fonts.gstatic.com/s/cairo/v1/Fm-hIVCp5OI5mO4Ec71jcw.ttf", "regular" => "http://fonts.gstatic.com/s/cairo/v1/-tPnHq7mmAjcjJRSjsuZGA.ttf")), array("kind" => "webfonts#webfont", "family" => "Calligraffitti", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-20", "files" => array("regular" => "http://fonts.gstatic.com/s/calligraffitti/v7/vLVN2Y-z65rVu1R7lWdvyDXz_orj3gX0_NzfmYulrko.ttf")), array("kind" => "webfonts#webfont", "family" => "Cambay", "category" => "sans-serif", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v1", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/cambay/v1/jw9niBxa04eEhnSwTWCEgw.ttf", "regular" => "http://fonts.gstatic.com/s/cambay/v1/etU9Bab4VuhzS-OKsb1VXg.ttf", "italic" => "http://fonts.gstatic.com/s/cambay/v1/ZEz9yNqpEOgejaw1rBhugQ.ttf", "700italic" => "http://fonts.gstatic.com/s/cambay/v1/j-5v_uUr0NXTumWN0siOiaCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Cambo", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/cambo/v5/PnwpRuTdkYCf8qk4ajmNRA.ttf")), array("kind" => "webfonts#webfont", "family" => "Candal", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/candal/v6/x44dDW28zK7GR1gGDBmj9g.ttf")), array("kind" => "webfonts#webfont", "family" => "Cantarell", "category" => "sans-serif", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-06-07", "files" => array("700" => "http://fonts.gstatic.com/s/cantarell/v6/Yir4ZDsCn4g1kWopdg-ehC3USBnSvpkopQaUR-2r7iU.ttf", "regular" => "http://fonts.gstatic.com/s/cantarell/v6/p5ydP_uWQ5lsFzcP_XVMEw.ttf", "italic" => "http://fonts.gstatic.com/s/cantarell/v6/DTCLtOSqP-7dgM-V_xKUjqCWcynf_cDxXwCLxiixG1c.ttf", "700italic" => "http://fonts.gstatic.com/s/cantarell/v6/weehrwMeZBXb0QyrWnRwFXe1Pd76Vl7zRpE7NLJQ7XU.ttf")), array("kind" => "webfonts#webfont", "family" => "Cantata One", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v6", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/cantataone/v6/-a5FDvnBqaBMDaGgZYnEfqCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Cantora One", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/cantoraone/v5/oI-DS62RbHI8ZREjp73ehqCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Capriola", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/capriola/v4/JxXPlkdzWwF9Cwelbvi9jA.ttf")), array("kind" => "webfonts#webfont", "family" => "Cardo", "category" => "serif", "variants" => array("regular", "italic", "700"), "subsets" => array("latin", "greek-ext", "latin-ext", "greek"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/cardo/v8/lQN30weILimrKvp8rZhF1w.ttf", "regular" => "http://fonts.gstatic.com/s/cardo/v8/jbkF2_R0FKUEZTq5dwSknQ.ttf", "italic" => "http://fonts.gstatic.com/s/cardo/v8/pcv4Np9tUkq0YREYUcEEJQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Carme", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/carme/v7/08E0NP1eRBEyFRUadmMfgA.ttf")), array("kind" => "webfonts#webfont", "family" => "Carrois Gothic", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/carroisgothic/v5/GCgb7bssGpwp7V5ynxmWy2x3d0cwUleGuRTmCYfCUaM.ttf")), array("kind" => "webfonts#webfont", "family" => "Carrois Gothic SC", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/carroisgothicsc/v5/bVp4nhwFIXU-r3LqUR8DSJTdPW1ioadGi2uRiKgJVCY.ttf")), array("kind" => "webfonts#webfont", "family" => "Carter One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v8", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/carterone/v8/5X_LFvdbcB7OBG7hBgZ7fPesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Catamaran", "category" => "sans-serif", "variants" => array("100", "200", "300", "regular", "500", "600", "700", "800", "900"), "subsets" => array("latin", "tamil", "latin-ext"), "version" => "v1", "lastModified" => "2016-05-31", "files" => array("100" => "http://fonts.gstatic.com/s/catamaran/v1/ilWHBiy0krUPdlmYxDuqC6CWcynf_cDxXwCLxiixG1c.ttf", "200" => "http://fonts.gstatic.com/s/catamaran/v1/hFc-HKSsGk6M-psujei1MC3USBnSvpkopQaUR-2r7iU.ttf", "300" => "http://fonts.gstatic.com/s/catamaran/v1/Aaag4ccR7Oh_4eai-jbrYC3USBnSvpkopQaUR-2r7iU.ttf", "500" => "http://fonts.gstatic.com/s/catamaran/v1/83WSX3F86qsvj1Z4EI0tQi3USBnSvpkopQaUR-2r7iU.ttf", "600" => "http://fonts.gstatic.com/s/catamaran/v1/a9PlHHnuBWiGGk0TwuFKTi3USBnSvpkopQaUR-2r7iU.ttf", "700" => "http://fonts.gstatic.com/s/catamaran/v1/PpgVtUHUdnBZYNpnzGbScy3USBnSvpkopQaUR-2r7iU.ttf", "800" => "http://fonts.gstatic.com/s/catamaran/v1/6VjB_uSfn3DZ93IQv58CmC3USBnSvpkopQaUR-2r7iU.ttf", "900" => "http://fonts.gstatic.com/s/catamaran/v1/5ys9TqpQc9Q6gHqbSox6py3USBnSvpkopQaUR-2r7iU.ttf", "regular" => "http://fonts.gstatic.com/s/catamaran/v1/MdNkM-DU8f6R-25Nxpr_XA.ttf")), array("kind" => "webfonts#webfont", "family" => "Caudex", "category" => "serif", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("latin", "greek-ext", "latin-ext", "greek"), "version" => "v6", "lastModified" => "2016-06-07", "files" => array("700" => "http://fonts.gstatic.com/s/caudex/v6/PetCI4GyQ5Q3LiOzUu_mMg.ttf", "regular" => "http://fonts.gstatic.com/s/caudex/v6/PWEexiHLDmQbn2b1OPZWfg.ttf", "italic" => "http://fonts.gstatic.com/s/caudex/v6/XjMZF6XCisvV3qapD4oJdw.ttf", "700italic" => "http://fonts.gstatic.com/s/caudex/v6/yT8YeHLjaJvQXlUEYOA8gqCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Caveat", "category" => "handwriting", "variants" => array("regular", "700"), "subsets" => array("latin", "latin-ext"), "version" => "v2", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/caveat/v2/LkaFtQENGJry2eUMwGRTeA.ttf", "regular" => "http://fonts.gstatic.com/s/caveat/v2/8I23b6N-6rRVbh-C_Vx3yA.ttf")), array("kind" => "webfonts#webfont", "family" => "Caveat Brush", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v2", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/caveatbrush/v2/_d7bgsk3hfC4DXnUEeYKsy3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Cedarville Cursive", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/cedarvillecursive/v7/cuCe6HrkcqrWTWTUE7dw-41zwq9-z_Lf44CzRAA0d0Y.ttf")), array("kind" => "webfonts#webfont", "family" => "Ceviche One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/cevicheone/v7/WOaXIMBD4VYMy39MsobJhKCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Changa", "category" => "sans-serif", "variants" => array("200", "300", "regular", "500", "600", "700", "800"), "subsets" => array("latin", "latin-ext", "arabic"), "version" => "v2", "lastModified" => "2016-06-20", "files" => array("200" => "http://fonts.gstatic.com/s/changa/v2/QNWVD9FzsnhVmHzE7HryDQ.ttf", "300" => "http://fonts.gstatic.com/s/changa/v2/OKZ0H1bMg3M9EZMVzgQ9fg.ttf", "500" => "http://fonts.gstatic.com/s/changa/v2/KrXcHYf9ILB8aFWCj0Vfxg.ttf", "600" => "http://fonts.gstatic.com/s/changa/v2/6uCpqxwcsYkfV0M8Ls6WPA.ttf", "700" => "http://fonts.gstatic.com/s/changa/v2/vAXzeaPkdpxlejFN7h0ibw.ttf", "800" => "http://fonts.gstatic.com/s/changa/v2/H3IsiH2Fx0Pc4_OU4HSpng.ttf", "regular" => "http://fonts.gstatic.com/s/changa/v2/7_e8qktkj6uKM0DamZJY9Q.ttf")), array("kind" => "webfonts#webfont", "family" => "Changa One", "category" => "display", "variants" => array("regular", "italic"), "subsets" => array("latin"), "version" => "v9", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/changaone/v9/dr4qjce4W3kxFrZRkVD87fesZW2xOQ-xsNqO47m55DA.ttf", "italic" => "http://fonts.gstatic.com/s/changaone/v9/wJVQlUs1lAZel-WdTo2U9y3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Chango", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/chango/v5/3W3AeMMtRTH08t5qLOjBmg.ttf")), array("kind" => "webfonts#webfont", "family" => "Chathura", "category" => "sans-serif", "variants" => array("100", "300", "regular", "700", "800"), "subsets" => array("latin", "telugu"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("100" => "http://fonts.gstatic.com/s/chathura/v1/7tUse0wFXIOSPewsdeNXPvesZW2xOQ-xsNqO47m55DA.ttf", "300" => "http://fonts.gstatic.com/s/chathura/v1/Gmhr6ULHnPDt9spOZrHOfKCWcynf_cDxXwCLxiixG1c.ttf", "700" => "http://fonts.gstatic.com/s/chathura/v1/BO9LvNAseMQ3n1tKWH-uTKCWcynf_cDxXwCLxiixG1c.ttf", "800" => "http://fonts.gstatic.com/s/chathura/v1/prh_X_5NSsBQefIdGi5B6KCWcynf_cDxXwCLxiixG1c.ttf", "regular" => "http://fonts.gstatic.com/s/chathura/v1/7hRNO-_zjRopkcP2n1rr8g.ttf")), array("kind" => "webfonts#webfont", "family" => "Chau Philomene One", "category" => "sans-serif", "variants" => array("regular", "italic"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/chauphilomeneone/v5/KKc5egCL-a2fFVoOA2x6tBFi5dxgSTdxqnMJgWkBJcg.ttf", "italic" => "http://fonts.gstatic.com/s/chauphilomeneone/v5/eJj1PY_iN4KiIuyOvtMHJP6uyLkxyiC4WcYA74sfquE.ttf")), array("kind" => "webfonts#webfont", "family" => "Chela One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/chelaone/v5/h5O0dEnpnIq6jQnWxZybrA.ttf")), array("kind" => "webfonts#webfont", "family" => "Chelsea Market", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/chelseamarket/v4/qSdzwh2A4BbNemy78sJLfAAI1i8fIftCBXsBF2v9UMI.ttf")), array("kind" => "webfonts#webfont", "family" => "Chenla", "category" => "display", "variants" => array("regular"), "subsets" => array("khmer"), "version" => "v9", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/chenla/v9/aLNpdAUDq2MZbWz2U1a16g.ttf")), array("kind" => "webfonts#webfont", "family" => "Cherry Cream Soda", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-20", "files" => array("regular" => "http://fonts.gstatic.com/s/cherrycreamsoda/v6/OrD-AUnFcZeeKa6F_c0_WxOiHiuAPYA9ry3O1RG2XIU.ttf")), array("kind" => "webfonts#webfont", "family" => "Cherry Swash", "category" => "display", "variants" => array("regular", "700"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-06-07", "files" => array("700" => "http://fonts.gstatic.com/s/cherryswash/v4/-CfyMyQqfucZPQNB0nvYyED2ttfZwueP-QU272T9-k4.ttf", "regular" => "http://fonts.gstatic.com/s/cherryswash/v4/HqOk7C7J1TZ5i3L-ejF0vi3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Chewy", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/chewy/v7/hcDN5cvQdIu6Bx4mg_TSyw.ttf")), array("kind" => "webfonts#webfont", "family" => "Chicle", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/chicle/v5/xg4q57Ut9ZmyFwLp51JLgg.ttf")), array("kind" => "webfonts#webfont", "family" => "Chivo", "category" => "sans-serif", "variants" => array("regular", "italic", "900", "900italic"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("900" => "http://fonts.gstatic.com/s/chivo/v7/JAdkiWd46QCW4vOsj3dzTA.ttf", "regular" => "http://fonts.gstatic.com/s/chivo/v7/L88PEuzS9eRfHRZhAPhZyw.ttf", "italic" => "http://fonts.gstatic.com/s/chivo/v7/Oe3-Q-a2kBzPnhHck_baMg.ttf", "900italic" => "http://fonts.gstatic.com/s/chivo/v7/LoszYnE86q2wJEOjCigBQ_esZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Chonburi", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "thai", "latin-ext", "vietnamese"), "version" => "v1", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/chonburi/v1/jd9PfbW0x_8Myt_XeUxvSQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Cinzel", "category" => "serif", "variants" => array("regular", "700", "900"), "subsets" => array("latin"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/cinzel/v4/nYcFQ6_3pf_6YDrOFjBR8Q.ttf", "900" => "http://fonts.gstatic.com/s/cinzel/v4/FTBj72ozM2cEOSxiVsRb3A.ttf", "regular" => "http://fonts.gstatic.com/s/cinzel/v4/GF7dy_Nc-a6EaHYSyGd-EA.ttf")), array("kind" => "webfonts#webfont", "family" => "Cinzel Decorative", "category" => "display", "variants" => array("regular", "700", "900"), "subsets" => array("latin"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/cinzeldecorative/v4/pXhIVnhFtL_B9Vb1wq2F95-YYVDmZkJErg0zgx9XuZI.ttf", "900" => "http://fonts.gstatic.com/s/cinzeldecorative/v4/pXhIVnhFtL_B9Vb1wq2F97Khqbv0zQZa0g-9HOXAalU.ttf", "regular" => "http://fonts.gstatic.com/s/cinzeldecorative/v4/fmgK7oaJJIXAkhd9798yQgT5USbJx2F82lQbogPy2bY.ttf")), array("kind" => "webfonts#webfont", "family" => "Clicker Script", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/clickerscript/v4/Zupmk8XwADjufGxWB9KThBnpV0hQCek3EmWnCPrvGRM.ttf")), array("kind" => "webfonts#webfont", "family" => "Coda", "category" => "display", "variants" => array("regular", "800"), "subsets" => array("latin", "latin-ext"), "version" => "v11", "lastModified" => "2016-05-31", "files" => array("800" => "http://fonts.gstatic.com/s/coda/v11/6ZIw0sbALY0KTMWllZB3hQ.ttf", "regular" => "http://fonts.gstatic.com/s/coda/v11/yHDvulhg-P-p2KRgRrnUYw.ttf")), array("kind" => "webfonts#webfont", "family" => "Coda Caption", "category" => "sans-serif", "variants" => array("800"), "subsets" => array("latin", "latin-ext"), "version" => "v9", "lastModified" => "2016-05-31", "files" => array("800" => "http://fonts.gstatic.com/s/codacaption/v9/YDl6urZh-DUFhiMBTgAnz_qsay_1ZmRGmC8pVRdIfAg.ttf")), array("kind" => "webfonts#webfont", "family" => "Codystar", "category" => "display", "variants" => array("300", "regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("300" => "http://fonts.gstatic.com/s/codystar/v4/EVaUzfJkcb8Zqx9kzQLXqqCWcynf_cDxXwCLxiixG1c.ttf", "regular" => "http://fonts.gstatic.com/s/codystar/v4/EN-CPFKYowSI7SuR7-0cZA.ttf")), array("kind" => "webfonts#webfont", "family" => "Coiny", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "tamil", "latin-ext", "vietnamese"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("regular" => "http://fonts.gstatic.com/s/coiny/v1/B-pC9lRxssd2RDK37Rdekw.ttf")), array("kind" => "webfonts#webfont", "family" => "Combo", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/combo/v5/Nab98KjR3JZSSPGtzLyXNw.ttf")), array("kind" => "webfonts#webfont", "family" => "Comfortaa", "category" => "display", "variants" => array("300", "regular", "700"), "subsets" => array("cyrillic", "cyrillic-ext", "latin", "latin-ext", "greek"), "version" => "v7", "lastModified" => "2016-06-07", "files" => array("300" => "http://fonts.gstatic.com/s/comfortaa/v7/r_tUZNl0G8xCoOmp_JkSCi3USBnSvpkopQaUR-2r7iU.ttf", "700" => "http://fonts.gstatic.com/s/comfortaa/v7/fND5XPYKrF2tQDwwfWZJIy3USBnSvpkopQaUR-2r7iU.ttf", "regular" => "http://fonts.gstatic.com/s/comfortaa/v7/lZx6C1VViPgSOhCBUP7hXA.ttf")), array("kind" => "webfonts#webfont", "family" => "Coming Soon", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-20", "files" => array("regular" => "http://fonts.gstatic.com/s/comingsoon/v6/Yz2z3IAe2HSQAOWsSG8COKCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Concert One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/concertone/v7/N5IWCIGhUNdPZn_efTxKN6CWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Condiment", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/condiment/v4/CstmdiPpgFSV0FUNL5LrJA.ttf")), array("kind" => "webfonts#webfont", "family" => "Content", "category" => "display", "variants" => array("regular", "700"), "subsets" => array("khmer"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/content/v8/7PivP8Zvs2qn6F6aNbSQe_esZW2xOQ-xsNqO47m55DA.ttf", "regular" => "http://fonts.gstatic.com/s/content/v8/l8qaLjygvOkDEU2G6-cjfQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Contrail One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/contrailone/v6/b41KxjgiyqX-hkggANDU6C3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Convergence", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/convergence/v5/eykrGz1NN_YpQmkAZjW-qKCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Cookie", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/cookie/v7/HxeUC62y_YdDbiFlze357A.ttf")), array("kind" => "webfonts#webfont", "family" => "Copse", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/copse/v6/wikLrtPGjZDvZ5w2i5HLWg.ttf")), array("kind" => "webfonts#webfont", "family" => "Corben", "category" => "display", "variants" => array("regular", "700"), "subsets" => array("latin", "latin-ext"), "version" => "v9", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/corben/v9/lirJaFSQWdGQuV--fksg5g.ttf", "regular" => "http://fonts.gstatic.com/s/corben/v9/tTysMZkt-j8Y5yhkgsoajQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Cormorant", "category" => "serif", "variants" => array("300", "300italic", "regular", "italic", "500", "500italic", "600", "600italic", "700", "700italic"), "subsets" => array("cyrillic", "latin", "latin-ext", "vietnamese"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("300" => "http://fonts.gstatic.com/s/cormorant/v1/diggKPcUerIA8GQWRVxsVS3USBnSvpkopQaUR-2r7iU.ttf", "500" => "http://fonts.gstatic.com/s/cormorant/v1/lwoiMb1lzDf49h802vpRUy3USBnSvpkopQaUR-2r7iU.ttf", "600" => "http://fonts.gstatic.com/s/cormorant/v1/LKEtp8XimHLN0gSYqnV9qy3USBnSvpkopQaUR-2r7iU.ttf", "700" => "http://fonts.gstatic.com/s/cormorant/v1/vOi7JV5F3JmPzXDgUqUwgS3USBnSvpkopQaUR-2r7iU.ttf", "300italic" => "http://fonts.gstatic.com/s/cormorant/v1/UydD9tmk-DfLnEFRr_bBZy9-WlPSxbfiI49GsXo3q0g.ttf", "regular" => "http://fonts.gstatic.com/s/cormorant/v1/9vWr5LgrNEgvhv1P3z9uuQ.ttf", "italic" => "http://fonts.gstatic.com/s/cormorant/v1/zzcH3j00ejnIc8jicdcz6KCWcynf_cDxXwCLxiixG1c.ttf", "500italic" => "http://fonts.gstatic.com/s/cormorant/v1/UydD9tmk-DfLnEFRr_bBZ8CNfqCYlB_eIx7H1TVXe60.ttf", "600italic" => "http://fonts.gstatic.com/s/cormorant/v1/UydD9tmk-DfLnEFRr_bBZ5Z7xm-Bj30Bj2KNdXDzSZg.ttf", "700italic" => "http://fonts.gstatic.com/s/cormorant/v1/UydD9tmk-DfLnEFRr_bBZ3e1Pd76Vl7zRpE7NLJQ7XU.ttf")), array("kind" => "webfonts#webfont", "family" => "Cormorant Garamond", "category" => "serif", "variants" => array("300", "300italic", "regular", "italic", "500", "500italic", "600", "600italic", "700", "700italic"), "subsets" => array("cyrillic", "latin", "latin-ext", "vietnamese"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("300" => "http://fonts.gstatic.com/s/cormorantgaramond/v1/iEjm9hVxcattz37Y8gZwVXDeRRUpi2fYbqcTC9PsYaU.ttf", "500" => "http://fonts.gstatic.com/s/cormorantgaramond/v1/iEjm9hVxcattz37Y8gZwVSkwnhSVYGQY4MSUB3uw374.ttf", "600" => "http://fonts.gstatic.com/s/cormorantgaramond/v1/iEjm9hVxcattz37Y8gZwVVc2xdGA7R8efE0K6NwSoyI.ttf", "700" => "http://fonts.gstatic.com/s/cormorantgaramond/v1/iEjm9hVxcattz37Y8gZwVdNg01MkafbqNYmDx8wt95c.ttf", "300italic" => "http://fonts.gstatic.com/s/cormorantgaramond/v1/zuqx3k1yUEl3Eavo-ZPEAjZXe39LdglsIzDOvKnCCso.ttf", "regular" => "http://fonts.gstatic.com/s/cormorantgaramond/v1/EI2hhCO6kSfLAy-Dpd8fd7_BES7rBA-D9Lo3vCx9yHc.ttf", "italic" => "http://fonts.gstatic.com/s/cormorantgaramond/v1/eGTlzchVxDKKvK6d7drzlkVlEttMzBRhK_wsRQ4MqEE.ttf", "500italic" => "http://fonts.gstatic.com/s/cormorantgaramond/v1/zuqx3k1yUEl3Eavo-ZPEAq8qrY1CcUgPLrA3ytfr3SY.ttf", "600italic" => "http://fonts.gstatic.com/s/cormorantgaramond/v1/zuqx3k1yUEl3Eavo-ZPEAqms9Rm_p2hhD4xhClOGPEw.ttf", "700italic" => "http://fonts.gstatic.com/s/cormorantgaramond/v1/zuqx3k1yUEl3Eavo-ZPEAvEntfLz8TC-DlAIEJQEwCA.ttf")), array("kind" => "webfonts#webfont", "family" => "Cormorant Infant", "category" => "serif", "variants" => array("300", "300italic", "regular", "italic", "500", "500italic", "600", "600italic", "700", "700italic"), "subsets" => array("cyrillic", "latin", "latin-ext", "vietnamese"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("300" => "http://fonts.gstatic.com/s/cormorantinfant/v1/MYRpw6pQIf0XStsiZXQWA_alucuYFvoGqpCMGloCN2Y.ttf", "500" => "http://fonts.gstatic.com/s/cormorantinfant/v1/MYRpw6pQIf0XStsiZXQWA4PJQ8Vh-2Qw35Pq7cVYzdo.ttf", "600" => "http://fonts.gstatic.com/s/cormorantinfant/v1/MYRpw6pQIf0XStsiZXQWA9G0tNuOpbNMRdNl4S5e-n0.ttf", "700" => "http://fonts.gstatic.com/s/cormorantinfant/v1/MYRpw6pQIf0XStsiZXQWAx-3ZynwDtU_450Ho62jf_I.ttf", "300italic" => "http://fonts.gstatic.com/s/cormorantinfant/v1/PK34LKusK6SSQFR2m5-LZgNCjGMFnYSoo4kW2wZNowE.ttf", "regular" => "http://fonts.gstatic.com/s/cormorantinfant/v1/q5F0I_a42y_qtMoOtqdjagGlf-pqPDOheSBqZOVpkRo.ttf", "italic" => "http://fonts.gstatic.com/s/cormorantinfant/v1/U6OamtMgLoVs0zd53Z1pNpbq6_N3pcDBvA-VsecMIAA.ttf", "500italic" => "http://fonts.gstatic.com/s/cormorantinfant/v1/PK34LKusK6SSQFR2m5-LZq9x-au7fLBTFpfuT52_G64.ttf", "600italic" => "http://fonts.gstatic.com/s/cormorantinfant/v1/PK34LKusK6SSQFR2m5-LZkZbdnTqrL_1WMEFjxg0OwY.ttf", "700italic" => "http://fonts.gstatic.com/s/cormorantinfant/v1/PK34LKusK6SSQFR2m5-LZmKEEmz9BBHY1o7RrRAiUXQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Cormorant SC", "category" => "serif", "variants" => array("300", "regular", "500", "600", "700"), "subsets" => array("cyrillic", "latin", "latin-ext", "vietnamese"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("300" => "http://fonts.gstatic.com/s/cormorantsc/v1/CCo4fI9EYzhUJcvojQ9Em6cQoVhARpoaILP7amxE_8g.ttf", "500" => "http://fonts.gstatic.com/s/cormorantsc/v1/CCo4fI9EYzhUJcvojQ9Em5MQuUSAwdHsY8ov_6tk1oA.ttf", "600" => "http://fonts.gstatic.com/s/cormorantsc/v1/CCo4fI9EYzhUJcvojQ9Em2v8CylhIUtwUiYO7Z2wXbE.ttf", "700" => "http://fonts.gstatic.com/s/cormorantsc/v1/CCo4fI9EYzhUJcvojQ9Em0D2ttfZwueP-QU272T9-k4.ttf", "regular" => "http://fonts.gstatic.com/s/cormorantsc/v1/o2HxNCgvhmwJdltu-68tzC3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Cormorant Unicase", "category" => "serif", "variants" => array("300", "regular", "500", "600", "700"), "subsets" => array("cyrillic", "latin", "latin-ext", "vietnamese"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("300" => "http://fonts.gstatic.com/s/cormorantunicase/v1/-0mwRHhjEGfrz-UDHJ_78TyAYAK5JX1-zBpfFXu9t3Y.ttf", "500" => "http://fonts.gstatic.com/s/cormorantunicase/v1/-0mwRHhjEGfrz-UDHJ_78WActzpz5sLElWWJpZBcHK4.ttf", "600" => "http://fonts.gstatic.com/s/cormorantunicase/v1/-0mwRHhjEGfrz-UDHJ_78U0bQT13XmwBbvkXy6Yb64Y.ttf", "700" => "http://fonts.gstatic.com/s/cormorantunicase/v1/-0mwRHhjEGfrz-UDHJ_78Z5CFeQBXku3ADXbkP2V7W8.ttf", "regular" => "http://fonts.gstatic.com/s/cormorantunicase/v1/THO7JMNV6qRoZlg7dU5RUz01TLsHlMvD1uPU3gXOh9s.ttf")), array("kind" => "webfonts#webfont", "family" => "Cormorant Upright", "category" => "serif", "variants" => array("300", "regular", "500", "600", "700"), "subsets" => array("latin", "latin-ext", "vietnamese"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("300" => "http://fonts.gstatic.com/s/cormorantupright/v1/PwJT_lCdbLUyVq-tARIPhjCfCvaSiUMfec2BKBTMAaw.ttf", "500" => "http://fonts.gstatic.com/s/cormorantupright/v1/PwJT_lCdbLUyVq-tARIPhiWhx5Kr-bzfZXhgF-AnSvk.ttf", "600" => "http://fonts.gstatic.com/s/cormorantupright/v1/PwJT_lCdbLUyVq-tARIPhuDigFx2V_wQ4SOTZdg5a2s.ttf", "700" => "http://fonts.gstatic.com/s/cormorantupright/v1/PwJT_lCdbLUyVq-tARIPhuO6SP7lRr11seyd3AkK37Q.ttf", "regular" => "http://fonts.gstatic.com/s/cormorantupright/v1/0n68kajKjTOJn9EPQkf1a-ojtTJJf2MtgkoRSid3NcM.ttf")), array("kind" => "webfonts#webfont", "family" => "Courgette", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/courgette/v4/2YO0EYtyE9HUPLZprahpZA.ttf")), array("kind" => "webfonts#webfont", "family" => "Cousine", "category" => "monospace", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("cyrillic", "cyrillic-ext", "latin", "greek-ext", "latin-ext", "greek", "hebrew", "vietnamese"), "version" => "v10", "lastModified" => "2016-06-07", "files" => array("700" => "http://fonts.gstatic.com/s/cousine/v10/FXEOnNUcCzhdtoBxiq-lovesZW2xOQ-xsNqO47m55DA.ttf", "regular" => "http://fonts.gstatic.com/s/cousine/v10/GYX4bPXObJNJo63QJEUnLg.ttf", "italic" => "http://fonts.gstatic.com/s/cousine/v10/1WtIuajLoo8vjVwsrZ3eOg.ttf", "700italic" => "http://fonts.gstatic.com/s/cousine/v10/y_AZ5Sz-FwL1lux2xLSTZS3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Coustard", "category" => "serif", "variants" => array("regular", "900"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("900" => "http://fonts.gstatic.com/s/coustard/v6/W02OCWO6OfMUHz6aVyegQ6CWcynf_cDxXwCLxiixG1c.ttf", "regular" => "http://fonts.gstatic.com/s/coustard/v6/iO2Rs5PmqAEAXoU3SkMVBg.ttf")), array("kind" => "webfonts#webfont", "family" => "Covered By Your Grace", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/coveredbyyourgrace/v6/6ozZp4BPlrbDRWPe3EBGA6CVUMdvnk-GcAiZQrX9Gek.ttf")), array("kind" => "webfonts#webfont", "family" => "Crafty Girls", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/craftygirls/v5/0Sv8UWFFdhQmesHL32H8oy3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Creepster", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/creepster/v5/0vdr5kWJ6aJlOg5JvxnXzQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Crete Round", "category" => "serif", "variants" => array("regular", "italic"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/creteround/v5/B8EwN421qqOCCT8vOH4wJ6CWcynf_cDxXwCLxiixG1c.ttf", "italic" => "http://fonts.gstatic.com/s/creteround/v5/5xAt7XK2vkUdjhGtt98unUeOrDcLawS7-ssYqLr2Xp4.ttf")), array("kind" => "webfonts#webfont", "family" => "Crimson Text", "category" => "serif", "variants" => array("regular", "italic", "600", "600italic", "700", "700italic"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("600" => "http://fonts.gstatic.com/s/crimsontext/v6/rEy5tGc5HdXy56Xvd4f3I2v8CylhIUtwUiYO7Z2wXbE.ttf", "700" => "http://fonts.gstatic.com/s/crimsontext/v6/rEy5tGc5HdXy56Xvd4f3I0D2ttfZwueP-QU272T9-k4.ttf", "regular" => "http://fonts.gstatic.com/s/crimsontext/v6/3IFMwfRa07i-auYR-B-zNS3USBnSvpkopQaUR-2r7iU.ttf", "italic" => "http://fonts.gstatic.com/s/crimsontext/v6/a5QZnvmn5amyNI-t2BMkWPMZXuCXbOrAvx5R0IT5Oyo.ttf", "600italic" => "http://fonts.gstatic.com/s/crimsontext/v6/4j4TR-EfnvCt43InYpUNDIR-5-urNOGAobhAyctHvW8.ttf", "700italic" => "http://fonts.gstatic.com/s/crimsontext/v6/4j4TR-EfnvCt43InYpUNDPAs9-1nE9qOqhChW0m4nDE.ttf")), array("kind" => "webfonts#webfont", "family" => "Croissant One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/croissantone/v4/mPjsOObnC77fp1cvZlOfIYjjx0o0jr6fNXxPgYh_a8Q.ttf")), array("kind" => "webfonts#webfont", "family" => "Crushed", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-20", "files" => array("regular" => "http://fonts.gstatic.com/s/crushed/v6/aHwSejs3Kt0Lg95u7j32jA.ttf")), array("kind" => "webfonts#webfont", "family" => "Cuprum", "category" => "sans-serif", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("cyrillic", "latin", "latin-ext"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/cuprum/v7/6tl3_FkDeXSD72oEHuJh4w.ttf", "regular" => "http://fonts.gstatic.com/s/cuprum/v7/JgXs0F_UiaEdAS74msmFNg.ttf", "italic" => "http://fonts.gstatic.com/s/cuprum/v7/cLEz0KV6OxInnktSzpk58g.ttf", "700italic" => "http://fonts.gstatic.com/s/cuprum/v7/bnkXaBfoYvaJ75axRPSwVKCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Cutive", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/cutive/v8/G2bW-ImyOCwKxBkLyz39YQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Cutive Mono", "category" => "monospace", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/cutivemono/v4/ncWQtFVKcSs8OW798v30k6CWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Damion", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/damion/v6/13XtECwKxhD_VrOqXL4SiA.ttf")), array("kind" => "webfonts#webfont", "family" => "Dancing Script", "category" => "handwriting", "variants" => array("regular", "700"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/dancingscript/v7/KGBfwabt0ZRLA5W1ywjowb_dAmXiKjTPGCuO6G2MbfA.ttf", "regular" => "http://fonts.gstatic.com/s/dancingscript/v7/DK0eTGXiZjN6yA8zAEyM2RnpV0hQCek3EmWnCPrvGRM.ttf")), array("kind" => "webfonts#webfont", "family" => "Dangrek", "category" => "display", "variants" => array("regular"), "subsets" => array("khmer"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/dangrek/v8/LOaFhBT-EHNxZjV8DAW_ew.ttf")), array("kind" => "webfonts#webfont", "family" => "David Libre", "category" => "serif", "variants" => array("regular", "500", "700"), "subsets" => array("latin", "latin-ext", "hebrew", "vietnamese"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("500" => "http://fonts.gstatic.com/s/davidlibre/v1/ea-623K8OFNeGhfSzdpmysCNfqCYlB_eIx7H1TVXe60.ttf", "700" => "http://fonts.gstatic.com/s/davidlibre/v1/ea-623K8OFNeGhfSzdpmyne1Pd76Vl7zRpE7NLJQ7XU.ttf", "regular" => "http://fonts.gstatic.com/s/davidlibre/v1/Fp_YuX4CP0pzlSUtACdOo6CWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Dawning of a New Day", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/dawningofanewday/v7/JiDsRhiKZt8uz3NJ5xA06gXLnohmOYWQZqo_sW8GLTk.ttf")), array("kind" => "webfonts#webfont", "family" => "Days One", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/daysone/v6/kzwZjNhc1iabMsrc_hKBIA.ttf")), array("kind" => "webfonts#webfont", "family" => "Dekko", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v3", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/dekko/v3/AKtgABKC1rUxgIgS-bpojw.ttf")), array("kind" => "webfonts#webfont", "family" => "Delius", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/delius/v6/TQA163qafki2-gV-B6F_ag.ttf")), array("kind" => "webfonts#webfont", "family" => "Delius Swash Caps", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/deliusswashcaps/v8/uXyrEUnoWApxIOICunRq7yIrxb5zDVgU2N3VzXm7zq4.ttf")), array("kind" => "webfonts#webfont", "family" => "Delius Unicase", "category" => "handwriting", "variants" => array("regular", "700"), "subsets" => array("latin"), "version" => "v9", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/deliusunicase/v9/7FTMTITcb4dxUp99FAdTqNy5weKXdcrx-wE0cgECMq8.ttf", "regular" => "http://fonts.gstatic.com/s/deliusunicase/v9/b2sKujV3Q48RV2PQ0k1vqu6rPKfVZo7L2bERcf0BDns.ttf")), array("kind" => "webfonts#webfont", "family" => "Della Respira", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v4", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/dellarespira/v4/F4E6Lo_IZ6L9AJCcbqtDVeDcg5akpSnIcsPhLOFv7l8.ttf")), array("kind" => "webfonts#webfont", "family" => "Denk One", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/denkone/v4/TdXOeA4eA_hEx4W8Sh9wPw.ttf")), array("kind" => "webfonts#webfont", "family" => "Devonshire", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/devonshire/v5/I3ct_2t12SYizP8ZC-KFi_esZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Dhurjati", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "telugu"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/dhurjati/v4/uV6jO5e2iFMbGB0z79Cy5g.ttf")), array("kind" => "webfonts#webfont", "family" => "Didact Gothic", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("cyrillic", "cyrillic-ext", "latin", "greek-ext", "latin-ext", "greek"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/didactgothic/v7/v8_72sD3DYMKyM0dn3LtWotBLojGU5Qdl8-5NL4v70w.ttf")), array("kind" => "webfonts#webfont", "family" => "Diplomata", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/diplomata/v8/u-ByBiKgN6rTMA36H3kcKg.ttf")), array("kind" => "webfonts#webfont", "family" => "Diplomata SC", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/diplomatasc/v5/JdVwAwfE1a_pahXjk5qpNi3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Domine", "category" => "serif", "variants" => array("regular", "700"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/domine/v4/phBcG1ZbQFxUIt18hPVxnw.ttf", "regular" => "http://fonts.gstatic.com/s/domine/v4/wfVIgamVFjMNQAEWurCiHA.ttf")), array("kind" => "webfonts#webfont", "family" => "Donegal One", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/donegalone/v4/6kN4-fDxz7T9s5U61HwfF6CWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Doppio One", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/doppioone/v4/WHZ3HJQotpk_4aSMNBo_t_esZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Dorsa", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/dorsa/v7/wCc3cUe6XrmG2LQE6GlIrw.ttf")), array("kind" => "webfonts#webfont", "family" => "Dosis", "category" => "sans-serif", "variants" => array("200", "300", "regular", "500", "600", "700", "800"), "subsets" => array("latin", "latin-ext"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("200" => "http://fonts.gstatic.com/s/dosis/v6/ztftab0r6hcd7AeurUGrSQ.ttf", "300" => "http://fonts.gstatic.com/s/dosis/v6/awIB6L0h5mb0plIKorXmuA.ttf", "500" => "http://fonts.gstatic.com/s/dosis/v6/ruEXDOFMxDPGnjCBKRqdAQ.ttf", "600" => "http://fonts.gstatic.com/s/dosis/v6/KNAswRNwm3tfONddYyidxg.ttf", "700" => "http://fonts.gstatic.com/s/dosis/v6/AEEAj0ONidK8NQQMBBlSig.ttf", "800" => "http://fonts.gstatic.com/s/dosis/v6/nlrKd8E69vvUU39XGsvR7Q.ttf", "regular" => "http://fonts.gstatic.com/s/dosis/v6/rJRlixu-w0JZ1MyhJpao_Q.ttf")), array("kind" => "webfonts#webfont", "family" => "Dr Sugiyama", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/drsugiyama/v5/S5Yx3MIckgoyHhhS4C9Tv6CWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Droid Sans", "category" => "sans-serif", "variants" => array("regular", "700"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-20", "files" => array("700" => "http://fonts.gstatic.com/s/droidsans/v6/EFpQQyG9GqCrobXxL-KRMQJKKGfqHaYFsRG-T3ceEVo.ttf", "regular" => "http://fonts.gstatic.com/s/droidsans/v6/rS9BT6-asrfjpkcV3DXf__esZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Droid Sans Mono", "category" => "monospace", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-20", "files" => array("regular" => "http://fonts.gstatic.com/s/droidsansmono/v7/ns-m2xQYezAtqh7ai59hJcwD6PD0c3_abh9zHKQtbGU.ttf")), array("kind" => "webfonts#webfont", "family" => "Droid Serif", "category" => "serif", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-06-07", "files" => array("700" => "http://fonts.gstatic.com/s/droidserif/v6/QQt14e8dY39u-eYBZmppwXe1Pd76Vl7zRpE7NLJQ7XU.ttf", "regular" => "http://fonts.gstatic.com/s/droidserif/v6/DgAtPy6rIVa2Zx3Xh9KaNaCWcynf_cDxXwCLxiixG1c.ttf", "italic" => "http://fonts.gstatic.com/s/droidserif/v6/cj2hUnSRBhwmSPr9kS5890eOrDcLawS7-ssYqLr2Xp4.ttf", "700italic" => "http://fonts.gstatic.com/s/droidserif/v6/c92rD_x0V1LslSFt3-QEps_zJjSACmk0BRPxQqhnNLU.ttf")), array("kind" => "webfonts#webfont", "family" => "Duru Sans", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v9", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/durusans/v9/xn7iYH8xwmSyTvEV_HOxTw.ttf")), array("kind" => "webfonts#webfont", "family" => "Dynalight", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/dynalight/v5/-CWsIe8OUDWTIHjSAh41kA.ttf")), array("kind" => "webfonts#webfont", "family" => "EB Garamond", "category" => "serif", "variants" => array("regular"), "subsets" => array("cyrillic", "cyrillic-ext", "latin", "latin-ext", "vietnamese"), "version" => "v7", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/ebgaramond/v7/CDR0kuiFK7I1OZ2hSdR7G6CWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Eagle Lake", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/eaglelake/v4/ZKlYin7caemhx9eSg6RvPfesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Eater", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/eater/v5/gm6f3OmYEdbs3lPQtUfBkA.ttf")), array("kind" => "webfonts#webfont", "family" => "Economica", "category" => "sans-serif", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/economica/v4/UK4l2VEpwjv3gdcwbwXE9C3USBnSvpkopQaUR-2r7iU.ttf", "regular" => "http://fonts.gstatic.com/s/economica/v4/G4rJRujzZbq9Nxngu9l3hg.ttf", "italic" => "http://fonts.gstatic.com/s/economica/v4/p5O9AVeUqx_n35xQRinNYaCWcynf_cDxXwCLxiixG1c.ttf", "700italic" => "http://fonts.gstatic.com/s/economica/v4/ac5dlUsedQ03RqGOeay-3Xe1Pd76Vl7zRpE7NLJQ7XU.ttf")), array("kind" => "webfonts#webfont", "family" => "Eczar", "category" => "serif", "variants" => array("regular", "500", "600", "700", "800"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v4", "lastModified" => "2016-06-07", "files" => array("500" => "http://fonts.gstatic.com/s/eczar/v4/Ooe4KaPp2594tF8TbMfdlQ.ttf", "600" => "http://fonts.gstatic.com/s/eczar/v4/IjQsWW0bmgkZ6lnN72cnTQ.ttf", "700" => "http://fonts.gstatic.com/s/eczar/v4/ELC8RVXfBMb3VuuHtMwBOA.ttf", "800" => "http://fonts.gstatic.com/s/eczar/v4/9Uyt6nTZLx_Qj5_WRah-iQ.ttf", "regular" => "http://fonts.gstatic.com/s/eczar/v4/uKZcAQ5JBBs1UbeXFRbBRg.ttf")), array("kind" => "webfonts#webfont", "family" => "Ek Mukta", "category" => "sans-serif", "variants" => array("200", "300", "regular", "500", "600", "700", "800"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("200" => "http://fonts.gstatic.com/s/ekmukta/v7/crtkNHh5JcM3VJKG0E-B36CWcynf_cDxXwCLxiixG1c.ttf", "300" => "http://fonts.gstatic.com/s/ekmukta/v7/mpaAv7CIyk0VnZlqSneVxKCWcynf_cDxXwCLxiixG1c.ttf", "500" => "http://fonts.gstatic.com/s/ekmukta/v7/PZ1y2MstFczWvBlFSgzMyaCWcynf_cDxXwCLxiixG1c.ttf", "600" => "http://fonts.gstatic.com/s/ekmukta/v7/Z5Mfzeu6M3emakcJO2QeTqCWcynf_cDxXwCLxiixG1c.ttf", "700" => "http://fonts.gstatic.com/s/ekmukta/v7/4ugcOGR28Jn-oBIn0-qLYaCWcynf_cDxXwCLxiixG1c.ttf", "800" => "http://fonts.gstatic.com/s/ekmukta/v7/O68TH5OjEhVmn9_gIrcfS6CWcynf_cDxXwCLxiixG1c.ttf", "regular" => "http://fonts.gstatic.com/s/ekmukta/v7/aFcjXdC5jyJ1p8w54wIIrg.ttf")), array("kind" => "webfonts#webfont", "family" => "El Messiri", "category" => "sans-serif", "variants" => array("regular", "500", "600", "700"), "subsets" => array("cyrillic", "latin", "arabic"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("500" => "http://fonts.gstatic.com/s/elmessiri/v1/kQW9PA2krAOzditagrX75pp-63r6doWhTEbsfBIRJ7A.ttf", "600" => "http://fonts.gstatic.com/s/elmessiri/v1/HYl7TNqFfA1utGLZRWwzLPpTEJqju4Hz1txDWij77d4.ttf", "700" => "http://fonts.gstatic.com/s/elmessiri/v1/ji73glXFIetaSqMU3cz7rAJKKGfqHaYFsRG-T3ceEVo.ttf", "regular" => "http://fonts.gstatic.com/s/elmessiri/v1/dik94vfrFvHFnvdvxaX8N_esZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Electrolize", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/electrolize/v5/yFVu5iokC-nt4B1Cyfxb9aCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Elsie", "category" => "display", "variants" => array("regular", "900"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("900" => "http://fonts.gstatic.com/s/elsie/v5/1t-9f0N2NFYwAgN7oaISqg.ttf", "regular" => "http://fonts.gstatic.com/s/elsie/v5/gwspePauE45BJu6Ok1QrfQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Elsie Swash Caps", "category" => "display", "variants" => array("regular", "900"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("900" => "http://fonts.gstatic.com/s/elsieswashcaps/v4/iZnus9qif0tR5pGaDv5zdKoKBWBozTtxi30NfZDOXXU.ttf", "regular" => "http://fonts.gstatic.com/s/elsieswashcaps/v4/9L3hIJMPCf6sxCltnxd6X2YeFSdnSpRYv5h9gpdlD1g.ttf")), array("kind" => "webfonts#webfont", "family" => "Emblema One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/emblemaone/v5/7IlBUjBWPIiw7cr_O2IfSaCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Emilys Candy", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/emilyscandy/v4/PofLVm6v1SwZGOzC8s-I3S3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Engagement", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/engagement/v5/4Uz0Jii7oVPcaFRYmbpU6vesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Englebert", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/englebert/v4/sll38iOvOuarDTYBchlP3Q.ttf")), array("kind" => "webfonts#webfont", "family" => "Enriqueta", "category" => "serif", "variants" => array("regular", "700"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/enriqueta/v5/I27Pb-wEGH2ajLYP0QrtSC3USBnSvpkopQaUR-2r7iU.ttf", "regular" => "http://fonts.gstatic.com/s/enriqueta/v5/_p90TrIwR1SC-vDKtmrv6A.ttf")), array("kind" => "webfonts#webfont", "family" => "Erica One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/ericaone/v7/cIBnH2VAqQMIGYAcE4ufvQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Esteban", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/esteban/v4/ESyhLgqDDyK5JcFPp2svDw.ttf")), array("kind" => "webfonts#webfont", "family" => "Euphoria Script", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/euphoriascript/v4/c4XB4Iijj_NvSsCF4I0O2MxLhO8OSNnfAp53LK1_iRs.ttf")), array("kind" => "webfonts#webfont", "family" => "Ewert", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/ewert/v4/Em8hrzuzSbfHcTVqMjbAQg.ttf")), array("kind" => "webfonts#webfont", "family" => "Exo", "category" => "sans-serif", "variants" => array("100", "100italic", "200", "200italic", "300", "300italic", "regular", "italic", "500", "500italic", "600", "600italic", "700", "700italic", "800", "800italic", "900", "900italic"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("100" => "http://fonts.gstatic.com/s/exo/v4/RI7A9uwjRmPbVp0n8e-Jvg.ttf", "200" => "http://fonts.gstatic.com/s/exo/v4/F8OfC_swrRRxpFt-tlXZQg.ttf", "300" => "http://fonts.gstatic.com/s/exo/v4/SBrN7TKUqgGUvfxqHqsnNw.ttf", "500" => "http://fonts.gstatic.com/s/exo/v4/jCg6DmGGXt_OVyp5ofQHPw.ttf", "600" => "http://fonts.gstatic.com/s/exo/v4/q_SG5kXUmOcIvFpgtdZnlw.ttf", "700" => "http://fonts.gstatic.com/s/exo/v4/3_jwsL4v9uHjl5Q37G57mw.ttf", "800" => "http://fonts.gstatic.com/s/exo/v4/yLPuxBuV0lzqibRJyooOJg.ttf", "900" => "http://fonts.gstatic.com/s/exo/v4/97d0nd6Yv4-SA_X92xAuZA.ttf", "100italic" => "http://fonts.gstatic.com/s/exo/v4/qtGyZZlWb2EEvby3ZPosxw.ttf", "200italic" => "http://fonts.gstatic.com/s/exo/v4/fr4HBfXHYiIngW2_bhlgRw.ttf", "300italic" => "http://fonts.gstatic.com/s/exo/v4/3gmiLjBegIfcDLISjTGA1g.ttf", "regular" => "http://fonts.gstatic.com/s/exo/v4/eUEzTFueNXRVhbt4PEB8kQ.ttf", "italic" => "http://fonts.gstatic.com/s/exo/v4/cfgolWisMSURhpQeVHl_NA.ttf", "500italic" => "http://fonts.gstatic.com/s/exo/v4/lo5eTdCNJZQVN08p8RnzAQ.ttf", "600italic" => "http://fonts.gstatic.com/s/exo/v4/0cExa8K_pxS2lTuMr68XUA.ttf", "700italic" => "http://fonts.gstatic.com/s/exo/v4/0me55yJIxd5vyQ9bF7SsiA.ttf", "800italic" => "http://fonts.gstatic.com/s/exo/v4/n3LejeKVj_8gtZq5fIgNYw.ttf", "900italic" => "http://fonts.gstatic.com/s/exo/v4/JHTkQVhzyLtkY13Ye95TJQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Exo 2", "category" => "sans-serif", "variants" => array("100", "100italic", "200", "200italic", "300", "300italic", "regular", "italic", "500", "500italic", "600", "600italic", "700", "700italic", "800", "800italic", "900", "900italic"), "subsets" => array("cyrillic", "latin", "latin-ext"), "version" => "v3", "lastModified" => "2016-05-31", "files" => array("100" => "http://fonts.gstatic.com/s/exo2/v3/oVOtQy53isv97g4UhBUDqg.ttf", "200" => "http://fonts.gstatic.com/s/exo2/v3/qa-Ci2pBwJdCxciE1ErifQ.ttf", "300" => "http://fonts.gstatic.com/s/exo2/v3/nLUBdz_lHHoVIPor05Byhw.ttf", "500" => "http://fonts.gstatic.com/s/exo2/v3/oM0rzUuPqVJpW-VEIpuW5w.ttf", "600" => "http://fonts.gstatic.com/s/exo2/v3/YnSn3HsyvyI1feGSdRMYqA.ttf", "700" => "http://fonts.gstatic.com/s/exo2/v3/2DiK4XkdTckfTk6we73-bQ.ttf", "800" => "http://fonts.gstatic.com/s/exo2/v3/IVYl_7dJruOg8zKRpC8Hrw.ttf", "900" => "http://fonts.gstatic.com/s/exo2/v3/e8csG8Wnu87AF6uCndkFRQ.ttf", "100italic" => "http://fonts.gstatic.com/s/exo2/v3/LNYVgsJcaCxoKFHmd4AZcg.ttf", "200italic" => "http://fonts.gstatic.com/s/exo2/v3/DCrVxDVvS69n50O-5erZVvesZW2xOQ-xsNqO47m55DA.ttf", "300italic" => "http://fonts.gstatic.com/s/exo2/v3/iSy9VTeUTiqiurQg2ywtu_esZW2xOQ-xsNqO47m55DA.ttf", "regular" => "http://fonts.gstatic.com/s/exo2/v3/Pf_kZuIH5c5WKVkQUaeSWQ.ttf", "italic" => "http://fonts.gstatic.com/s/exo2/v3/xxA5ZscX9sTU6U0lZJUlYA.ttf", "500italic" => "http://fonts.gstatic.com/s/exo2/v3/amzRVCB-gipwdihZZ2LtT_esZW2xOQ-xsNqO47m55DA.ttf", "600italic" => "http://fonts.gstatic.com/s/exo2/v3/Vmo58BiptGwfVFb0teU5gPesZW2xOQ-xsNqO47m55DA.ttf", "700italic" => "http://fonts.gstatic.com/s/exo2/v3/Sdo-zW-4_--pDkTg6bYrY_esZW2xOQ-xsNqO47m55DA.ttf", "800italic" => "http://fonts.gstatic.com/s/exo2/v3/p0TA6KeOz1o4rySEbvUxI_esZW2xOQ-xsNqO47m55DA.ttf", "900italic" => "http://fonts.gstatic.com/s/exo2/v3/KPhsGCoT2-7Uj6pMlRscH_esZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Expletus Sans", "category" => "display", "variants" => array("regular", "italic", "500", "500italic", "600", "600italic", "700", "700italic"), "subsets" => array("latin"), "version" => "v9", "lastModified" => "2016-06-07", "files" => array("500" => "http://fonts.gstatic.com/s/expletussans/v9/cl6rhMY77Ilk8lB_uYRRwAqQmZ7VjhwksfpNVG0pqGc.ttf", "600" => "http://fonts.gstatic.com/s/expletussans/v9/cl6rhMY77Ilk8lB_uYRRwCvj1tU7IJMS3CS9kCx2B3U.ttf", "700" => "http://fonts.gstatic.com/s/expletussans/v9/cl6rhMY77Ilk8lB_uYRRwFCbmAUID8LN-q3pJpOk3Ys.ttf", "regular" => "http://fonts.gstatic.com/s/expletussans/v9/gegTSDBDs5le3g6uxU1ZsX8f0n03UdmQgF_CLvNR2vg.ttf", "italic" => "http://fonts.gstatic.com/s/expletussans/v9/Y-erXmY0b6DU_i2Qu0hTJj4G9C9ttb0Oz5Cvf0qOitE.ttf", "500italic" => "http://fonts.gstatic.com/s/expletussans/v9/sRBNtc46w65uJE451UYmW87DCVO6wo6i5LKIyZDzK40.ttf", "600italic" => "http://fonts.gstatic.com/s/expletussans/v9/sRBNtc46w65uJE451UYmW8yKH23ZS6zCKOFHG0e_4JE.ttf", "700italic" => "http://fonts.gstatic.com/s/expletussans/v9/sRBNtc46w65uJE451UYmW5F66r9C4AnxxlBlGd7xY4g.ttf")), array("kind" => "webfonts#webfont", "family" => "Fanwood Text", "category" => "serif", "variants" => array("regular", "italic"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/fanwoodtext/v6/hDNDHUlsSb8bgnEmDp4T_i3USBnSvpkopQaUR-2r7iU.ttf", "italic" => "http://fonts.gstatic.com/s/fanwoodtext/v6/0J3SBbkMZqBV-3iGxs5E9_MZXuCXbOrAvx5R0IT5Oyo.ttf")), array("kind" => "webfonts#webfont", "family" => "Farsan", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext", "gujarati", "vietnamese"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("regular" => "http://fonts.gstatic.com/s/farsan/v1/Hdf9Y76SQ6e1X0Nqk3rHtw.ttf")), array("kind" => "webfonts#webfont", "family" => "Fascinate", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/fascinate/v5/ZE0637WWkBPKt1AmFaqD3Q.ttf")), array("kind" => "webfonts#webfont", "family" => "Fascinate Inline", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/fascinateinline/v6/lRguYfMfWArflkm5aOQ5QJmp8DTZ6iHear7UV05iykg.ttf")), array("kind" => "webfonts#webfont", "family" => "Faster One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/fasterone/v6/YxTOW2sf56uxD1T7byP5K_esZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Fasthand", "category" => "serif", "variants" => array("regular"), "subsets" => array("khmer"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/fasthand/v7/6XAagHH_KmpZL67wTvsETQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Fauna One", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/faunaone/v4/8kL-wpAPofcAMELI_5NRnQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Federant", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v8", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/federant/v8/tddZFSiGvxICNOGra0i5aA.ttf")), array("kind" => "webfonts#webfont", "family" => "Federo", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/federo/v8/JPhe1S2tujeyaR79gXBLeQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Felipa", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/felipa/v4/SeyfyFZY7abAQXGrOIYnYg.ttf")), array("kind" => "webfonts#webfont", "family" => "Fenix", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/fenix/v4/Ak8wR3VSlAN7VN_eMeJj7Q.ttf")), array("kind" => "webfonts#webfont", "family" => "Finger Paint", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/fingerpaint/v5/m_ZRbiY-aPb13R3DWPBGXy3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Fira Mono", "category" => "monospace", "variants" => array("regular", "700"), "subsets" => array("cyrillic", "cyrillic-ext", "latin", "latin-ext", "greek"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/firamono/v4/l24Wph3FsyKAbJ8dfExTZy3USBnSvpkopQaUR-2r7iU.ttf", "regular" => "http://fonts.gstatic.com/s/firamono/v4/WQOm1D4RO-yvA9q9trJc8g.ttf")), array("kind" => "webfonts#webfont", "family" => "Fira Sans", "category" => "sans-serif", "variants" => array("300", "300italic", "regular", "italic", "500", "500italic", "700", "700italic"), "subsets" => array("cyrillic", "cyrillic-ext", "latin", "latin-ext", "greek"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("300" => "http://fonts.gstatic.com/s/firasans/v6/VTBnrK42EiOBncVyQXZ7jy3USBnSvpkopQaUR-2r7iU.ttf", "500" => "http://fonts.gstatic.com/s/firasans/v6/zM2u8V3CuPVwAAXFQcDi4C3USBnSvpkopQaUR-2r7iU.ttf", "700" => "http://fonts.gstatic.com/s/firasans/v6/DugPdSljmOTocZOR2CItOi3USBnSvpkopQaUR-2r7iU.ttf", "300italic" => "http://fonts.gstatic.com/s/firasans/v6/6s0YCA9oCTF6hM60YM-qTS9-WlPSxbfiI49GsXo3q0g.ttf", "regular" => "http://fonts.gstatic.com/s/firasans/v6/nsT0isDy56OkSX99sFQbXw.ttf", "italic" => "http://fonts.gstatic.com/s/firasans/v6/cPT_2ddmoxsUuMtQqa8zGqCWcynf_cDxXwCLxiixG1c.ttf", "500italic" => "http://fonts.gstatic.com/s/firasans/v6/6s0YCA9oCTF6hM60YM-qTcCNfqCYlB_eIx7H1TVXe60.ttf", "700italic" => "http://fonts.gstatic.com/s/firasans/v6/6s0YCA9oCTF6hM60YM-qTXe1Pd76Vl7zRpE7NLJQ7XU.ttf")), array("kind" => "webfonts#webfont", "family" => "Fjalla One", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/fjallaone/v4/3b7vWCfOZsU53vMa8LWsf_esZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Fjord One", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/fjordone/v5/R_YHK8au2uFPw5tNu5N7zw.ttf")), array("kind" => "webfonts#webfont", "family" => "Flamenco", "category" => "display", "variants" => array("300", "regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("300" => "http://fonts.gstatic.com/s/flamenco/v6/x9iI5CogvuZVCGoRHwXuo6CWcynf_cDxXwCLxiixG1c.ttf", "regular" => "http://fonts.gstatic.com/s/flamenco/v6/HC0ugfLLgt26I5_BWD1PZA.ttf")), array("kind" => "webfonts#webfont", "family" => "Flavors", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/flavors/v5/SPJi5QclATvon8ExcKGRvQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Fondamento", "category" => "handwriting", "variants" => array("regular", "italic"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/fondamento/v5/6LWXcjT1B7bnWluAOSNfMPesZW2xOQ-xsNqO47m55DA.ttf", "italic" => "http://fonts.gstatic.com/s/fondamento/v5/y6TmwhSbZ8rYq7OTFyo7OS3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Fontdiner Swanky", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-20", "files" => array("regular" => "http://fonts.gstatic.com/s/fontdinerswanky/v6/8_GxIO5ixMtn5P6COsF3TlBjMPLzPAFJwRBn-s1U7kA.ttf")), array("kind" => "webfonts#webfont", "family" => "Forum", "category" => "display", "variants" => array("regular"), "subsets" => array("cyrillic", "cyrillic-ext", "latin", "latin-ext"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/forum/v7/MZUpsq1VfLrqv8eSDcbrrQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Francois One", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v9", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/francoisone/v9/bYbkq2nU2TSx4SwFbz5sCC3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Frank Ruhl Libre", "category" => "sans-serif", "variants" => array("300", "regular", "500", "700", "900"), "subsets" => array("latin", "latin-ext", "hebrew"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("300" => "http://fonts.gstatic.com/s/frankruhllibre/v1/y8NWif61iD8Hg8bGAmxFPOo9jvbqtCEVUIntIHarXsc.ttf", "500" => "http://fonts.gstatic.com/s/frankruhllibre/v1/y8NWif61iD8Hg8bGAmxFPC-WNtISbX_UO2d0wZPgXtk.ttf", "700" => "http://fonts.gstatic.com/s/frankruhllibre/v1/y8NWif61iD8Hg8bGAmxFPDPYiZEMiRRbPdIFMoTwDbo.ttf", "900" => "http://fonts.gstatic.com/s/frankruhllibre/v1/y8NWif61iD8Hg8bGAmxFPNRZIVFRjDx-6MOpcoWbVhA.ttf", "regular" => "http://fonts.gstatic.com/s/frankruhllibre/v1/yDLloNqBpFmakCImLv4OJkfFI6QBbouvcOFcz81E3Ek.ttf")), array("kind" => "webfonts#webfont", "family" => "Freckle Face", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/freckleface/v4/7-B8j9BPJgazdHIGqPNv8y3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Fredericka the Great", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/frederickathegreat/v5/7Es8Lxoku-e5eOZWpxw18nrnet6gXN1McwdQxS1dVrI.ttf")), array("kind" => "webfonts#webfont", "family" => "Fredoka One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/fredokaone/v4/QKfwXi-z-KtJAlnO2ethYqCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Freehand", "category" => "display", "variants" => array("regular"), "subsets" => array("khmer"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/freehand/v8/uEBQxvA0lnn_BrD6krlxMw.ttf")), array("kind" => "webfonts#webfont", "family" => "Fresca", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/fresca/v5/2q7Qm9sCo1tWvVgSDVWNIw.ttf")), array("kind" => "webfonts#webfont", "family" => "Frijole", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/frijole/v5/L2MfZse-2gCascuD-nLhWg.ttf")), array("kind" => "webfonts#webfont", "family" => "Fruktur", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/fruktur/v8/PnQvfEi1LssAvhJsCwH__w.ttf")), array("kind" => "webfonts#webfont", "family" => "Fugaz One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/fugazone/v6/5tteVDCwxsr8-5RuSiRWOw.ttf")), array("kind" => "webfonts#webfont", "family" => "GFS Didot", "category" => "serif", "variants" => array("regular"), "subsets" => array("greek"), "version" => "v6", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/gfsdidot/v6/jQKxZy2RU-h9tkPZcRVluA.ttf")), array("kind" => "webfonts#webfont", "family" => "GFS Neohellenic", "category" => "sans-serif", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("greek"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/gfsneohellenic/v7/7HwjPQa7qNiOsnUce2h4448_BwCLZY3eDSV6kppAwI8.ttf", "regular" => "http://fonts.gstatic.com/s/gfsneohellenic/v7/B4xRqbn-tANVqVgamMsSDiayCZa0z7CpFzlkqoCHztc.ttf", "italic" => "http://fonts.gstatic.com/s/gfsneohellenic/v7/KnaWrO4awITAqigQIIYXKkCTdomiyJpIzPbEbIES3rU.ttf", "700italic" => "http://fonts.gstatic.com/s/gfsneohellenic/v7/FwWjoX6XqT-szJFyqsu_GYFF0fM4h-krcpQk7emtCpE.ttf")), array("kind" => "webfonts#webfont", "family" => "Gabriela", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/gabriela/v4/B-2ZfbAO3HDrxqV6lR5tdA.ttf")), array("kind" => "webfonts#webfont", "family" => "Gafata", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/gafata/v5/aTFqlki_3Dc3geo-FxHTvQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Galada", "category" => "display", "variants" => array("regular"), "subsets" => array("bengali", "latin"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("regular" => "http://fonts.gstatic.com/s/galada/v1/xGkllHQb8OOCv9VJ6IObSA.ttf")), array("kind" => "webfonts#webfont", "family" => "Galdeano", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/galdeano/v6/ZKFMQI6HxEG1jOT0UGSZUg.ttf")), array("kind" => "webfonts#webfont", "family" => "Galindo", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/galindo/v4/2lafAS_ZEfB33OJryhXDUg.ttf")), array("kind" => "webfonts#webfont", "family" => "Gentium Basic", "category" => "serif", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("latin", "latin-ext"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/gentiumbasic/v8/2qL6yulgGf0wwgOp-UqGyLNuTeOOLg3nUymsEEGmdO0.ttf", "regular" => "http://fonts.gstatic.com/s/gentiumbasic/v8/KCktj43blvLkhOTolFn-MYtBLojGU5Qdl8-5NL4v70w.ttf", "italic" => "http://fonts.gstatic.com/s/gentiumbasic/v8/qoFz4NSMaYC2UmsMAG3lyTj3mvXnCeAk09uTtmkJGRc.ttf", "700italic" => "http://fonts.gstatic.com/s/gentiumbasic/v8/8N9-c_aQDJ8LbI1NGVMrwtswO1vWwP9exiF8s0wqW10.ttf")), array("kind" => "webfonts#webfont", "family" => "Gentium Book Basic", "category" => "serif", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("latin", "latin-ext"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/gentiumbookbasic/v7/T2vUYmWzlqUtgLYdlemGnaWESMHIjnSjm9UUxYtEOko.ttf", "regular" => "http://fonts.gstatic.com/s/gentiumbookbasic/v7/IRFxB2matTxrjZt6a3FUnrWDjKAyldGEr6eEi2MBNeY.ttf", "italic" => "http://fonts.gstatic.com/s/gentiumbookbasic/v7/qHqW2lwKO8-uTfIkh8FsUfXfjMwrYnmPVsQth2IcAPY.ttf", "700italic" => "http://fonts.gstatic.com/s/gentiumbookbasic/v7/632u7TMIoFDWQYUaHFUp5PA2A9KyRZEkn4TZVuhsWRM.ttf")), array("kind" => "webfonts#webfont", "family" => "Geo", "category" => "sans-serif", "variants" => array("regular", "italic"), "subsets" => array("latin"), "version" => "v8", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/geo/v8/mJuJYk5Pww84B4uHAQ1XaA.ttf", "italic" => "http://fonts.gstatic.com/s/geo/v8/8_r1wToF7nPdDuX1qxel6Q.ttf")), array("kind" => "webfonts#webfont", "family" => "Geostar", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/geostar/v6/A8WQbhQbpYx3GWWaShJ9GA.ttf")), array("kind" => "webfonts#webfont", "family" => "Geostar Fill", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/geostarfill/v6/Y5ovXPPOHYTfQzK2aM-hui3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Germania One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/germaniaone/v4/3_6AyUql_-FbDi1e68jHdC3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Gidugu", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "telugu"), "version" => "v3", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/gidugu/v3/Ey6Eq3hrT6MM58iFItFcgw.ttf")), array("kind" => "webfonts#webfont", "family" => "Gilda Display", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/gildadisplay/v4/8yAVUZLLZ3wb7dSsjix0CADHmap7fRWINAsw8-RaxNg.ttf")), array("kind" => "webfonts#webfont", "family" => "Give You Glory", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/giveyouglory/v6/DFEWZFgGmfseyIdGRJAxuBwwkpSPZdvjnMtysdqprfI.ttf")), array("kind" => "webfonts#webfont", "family" => "Glass Antiqua", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/glassantiqua/v4/0yLrXKplgdUDIMz5TnCHNODcg5akpSnIcsPhLOFv7l8.ttf")), array("kind" => "webfonts#webfont", "family" => "Glegoo", "category" => "serif", "variants" => array("regular", "700"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/glegoo/v5/TlLolbauH0-0Aiz1LUH5og.ttf", "regular" => "http://fonts.gstatic.com/s/glegoo/v5/2tf-h3n2A_SNYXEO0C8bKw.ttf")), array("kind" => "webfonts#webfont", "family" => "Gloria Hallelujah", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/gloriahallelujah/v8/CA1k7SlXcY5kvI81M_R28Q3RdPdyebSUyJECJouPsvA.ttf")), array("kind" => "webfonts#webfont", "family" => "Goblin One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/goblinone/v6/331XtzoXgpVEvNTVcBJ_C_esZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Gochi Hand", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/gochihand/v7/KT1-WxgHsittJ34_20IfAPesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Gorditas", "category" => "display", "variants" => array("regular", "700"), "subsets" => array("latin"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/gorditas/v4/6-XCeknmxaon8AUqVkMnHaCWcynf_cDxXwCLxiixG1c.ttf", "regular" => "http://fonts.gstatic.com/s/gorditas/v4/uMgZhXUyH6qNGF3QsjQT5Q.ttf")), array("kind" => "webfonts#webfont", "family" => "Goudy Bookletter 1911", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/goudybookletter1911/v6/l5lwlGTN3pEY5Bf-rQEuIIjNDsyURsIKu4GSfvSE4mA.ttf")), array("kind" => "webfonts#webfont", "family" => "Graduate", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/graduate/v4/JpAmYLHqcIh9_Ff35HHwiA.ttf")), array("kind" => "webfonts#webfont", "family" => "Grand Hotel", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/grandhotel/v4/C_A8HiFZjXPpnMt38XnK7qCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Gravitas One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/gravitasone/v6/nBHdBv6zVNU8MtP6w9FwTS3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Great Vibes", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/greatvibes/v4/4Mi5RG_9LjQYrTU55GN_L6CWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Griffy", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/griffy/v4/vWkyYGBSyE5xjnShNtJtzw.ttf")), array("kind" => "webfonts#webfont", "family" => "Gruppo", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/gruppo/v7/pS_JM0cK_piBZve-lfUq9w.ttf")), array("kind" => "webfonts#webfont", "family" => "Gudea", "category" => "sans-serif", "variants" => array("regular", "italic", "700"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/gudea/v4/lsip4aiWhJ9bx172Y9FN_w.ttf", "regular" => "http://fonts.gstatic.com/s/gudea/v4/S-4QqBlkMPiiA3jNeCR5yw.ttf", "italic" => "http://fonts.gstatic.com/s/gudea/v4/7mNgsGw_vfS-uUgRVXNDSw.ttf")), array("kind" => "webfonts#webfont", "family" => "Gurajada", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin", "telugu"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/gurajada/v4/6Adfkl4PCRyq6XTENACEyA.ttf")), array("kind" => "webfonts#webfont", "family" => "Habibi", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/habibi/v5/YYyqXF6pWpL7kmKgS_2iUA.ttf")), array("kind" => "webfonts#webfont", "family" => "Halant", "category" => "serif", "variants" => array("300", "regular", "500", "600", "700"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v2", "lastModified" => "2016-05-31", "files" => array("300" => "http://fonts.gstatic.com/s/halant/v2/dM3ItAOWNNod_Cf3MnLlEg.ttf", "500" => "http://fonts.gstatic.com/s/halant/v2/tlsNj3K-hJKtiirTDtUbkQ.ttf", "600" => "http://fonts.gstatic.com/s/halant/v2/zNR2WvI_V8o652vIZp3X4Q.ttf", "700" => "http://fonts.gstatic.com/s/halant/v2/D9FN7OH89AuCmZDLHbPQfA.ttf", "regular" => "http://fonts.gstatic.com/s/halant/v2/rEs7Jk3SVyt3cTx6DoTu1w.ttf")), array("kind" => "webfonts#webfont", "family" => "Hammersmith One", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v7", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/hammersmithone/v7/FWNn6ITYqL6or7ZTmBxRhjjVlsJB_M_Q_LtZxsoxvlw.ttf")), array("kind" => "webfonts#webfont", "family" => "Hanalei", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/hanalei/v6/Sx8vVMBnXSQyK6Cn0CBJ3A.ttf")), array("kind" => "webfonts#webfont", "family" => "Hanalei Fill", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/hanaleifill/v5/5uPeWLnaDdtm4UBG26Ds6C3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Handlee", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/handlee/v5/6OfkXkyC0E5NZN80ED8u3A.ttf")), array("kind" => "webfonts#webfont", "family" => "Hanuman", "category" => "serif", "variants" => array("regular", "700"), "subsets" => array("khmer"), "version" => "v9", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/hanuman/v9/lzzXZ2l84x88giDrbfq76vesZW2xOQ-xsNqO47m55DA.ttf", "regular" => "http://fonts.gstatic.com/s/hanuman/v9/hRhwOGGmElJSl6KSPvEnOQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Happy Monkey", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/happymonkey/v5/c2o0ps8nkBmaOYctqBq1rS3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Harmattan", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "arabic"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("regular" => "http://fonts.gstatic.com/s/harmattan/v1/xNM1nDKzsLfoCLQtMRztGA.ttf")), array("kind" => "webfonts#webfont", "family" => "Headland One", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/headlandone/v4/iGmBeOvQGfq9DSbjJ8jDVy3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Heebo", "category" => "sans-serif", "variants" => array("100", "300", "regular", "500", "700", "800", "900"), "subsets" => array("latin", "hebrew"), "version" => "v2", "lastModified" => "2016-06-20", "files" => array("100" => "http://fonts.gstatic.com/s/heebo/v2/SoQODIucfpkiveZloUR6ag.ttf", "300" => "http://fonts.gstatic.com/s/heebo/v2/dg5T18yyjkKiU_9mmcbDSQ.ttf", "500" => "http://fonts.gstatic.com/s/heebo/v2/jDb70ZCwdD6JnmQU62ZQZA.ttf", "700" => "http://fonts.gstatic.com/s/heebo/v2/NsBYEn6oWei8pPqytA07yA.ttf", "800" => "http://fonts.gstatic.com/s/heebo/v2/h4CV2Qq56LKIinGGOStvsw.ttf", "900" => "http://fonts.gstatic.com/s/heebo/v2/uDfzHw3R0Bfa6HyIIcj-ow.ttf", "regular" => "http://fonts.gstatic.com/s/heebo/v2/nyHCGMPliplPNqpssbDSIA.ttf")), array("kind" => "webfonts#webfont", "family" => "Henny Penny", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/hennypenny/v4/XRgo3ogXyi3tpsFfjImRF6CWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Herr Von Muellerhoff", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/herrvonmuellerhoff/v6/mmy24EUmk4tjm4gAEjUd7NLGIYrUsBdh-JWHYgiDiMU.ttf")), array("kind" => "webfonts#webfont", "family" => "Hind", "category" => "sans-serif", "variants" => array("300", "regular", "500", "600", "700"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v6", "lastModified" => "2016-06-02", "files" => array("300" => "http://fonts.gstatic.com/s/hind/v6/qa346Adgv9kPDXoD1my4kA.ttf", "500" => "http://fonts.gstatic.com/s/hind/v6/2cs8RCVcYtiv4iNDH1UsQQ.ttf", "600" => "http://fonts.gstatic.com/s/hind/v6/TUKUmFMXSoxloBP1ni08oA.ttf", "700" => "http://fonts.gstatic.com/s/hind/v6/cXJJavLdUbCfjxlsA6DqTw.ttf", "regular" => "http://fonts.gstatic.com/s/hind/v6/mktFHh5Z5P9YjGKSslSUtA.ttf")), array("kind" => "webfonts#webfont", "family" => "Hind Guntur", "category" => "sans-serif", "variants" => array("300", "regular", "500", "600", "700"), "subsets" => array("latin", "telugu", "latin-ext"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("300" => "http://fonts.gstatic.com/s/hindguntur/v1/Szg33M7ab5MTWe-PWAcNAi9-WlPSxbfiI49GsXo3q0g.ttf", "500" => "http://fonts.gstatic.com/s/hindguntur/v1/Szg33M7ab5MTWe-PWAcNAsCNfqCYlB_eIx7H1TVXe60.ttf", "600" => "http://fonts.gstatic.com/s/hindguntur/v1/Szg33M7ab5MTWe-PWAcNApZ7xm-Bj30Bj2KNdXDzSZg.ttf", "700" => "http://fonts.gstatic.com/s/hindguntur/v1/Szg33M7ab5MTWe-PWAcNAne1Pd76Vl7zRpE7NLJQ7XU.ttf", "regular" => "http://fonts.gstatic.com/s/hindguntur/v1/MXz-KyAeVZstlFz6v-5SC6CWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Hind Madurai", "category" => "sans-serif", "variants" => array("300", "regular", "500", "600", "700"), "subsets" => array("latin", "tamil", "latin-ext"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("300" => "http://fonts.gstatic.com/s/hindmadurai/v1/sdSJTZLdRXJhVTP92m2S66cQoVhARpoaILP7amxE_8g.ttf", "500" => "http://fonts.gstatic.com/s/hindmadurai/v1/sdSJTZLdRXJhVTP92m2S65MQuUSAwdHsY8ov_6tk1oA.ttf", "600" => "http://fonts.gstatic.com/s/hindmadurai/v1/sdSJTZLdRXJhVTP92m2S62v8CylhIUtwUiYO7Z2wXbE.ttf", "700" => "http://fonts.gstatic.com/s/hindmadurai/v1/sdSJTZLdRXJhVTP92m2S60D2ttfZwueP-QU272T9-k4.ttf", "regular" => "http://fonts.gstatic.com/s/hindmadurai/v1/pJpl47LatORZNWf8rgdiyS3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Hind Siliguri", "category" => "sans-serif", "variants" => array("300", "regular", "500", "600", "700"), "subsets" => array("bengali", "latin", "latin-ext"), "version" => "v2", "lastModified" => "2016-06-02", "files" => array("300" => "http://fonts.gstatic.com/s/hindsiliguri/v2/fBpmjMpv5Rh6S25yVfWJnzoJ52uD-1fmXmi8u0n_zsc.ttf", "500" => "http://fonts.gstatic.com/s/hindsiliguri/v2/fBpmjMpv5Rh6S25yVfWJn__2zpxNHQ3utWt_82o9dAo.ttf", "600" => "http://fonts.gstatic.com/s/hindsiliguri/v2/fBpmjMpv5Rh6S25yVfWJn-x91FDzFvnud68bXrNkpDA.ttf", "700" => "http://fonts.gstatic.com/s/hindsiliguri/v2/fBpmjMpv5Rh6S25yVfWJn6iiXuG_rGcOxkuidirlnJE.ttf", "regular" => "http://fonts.gstatic.com/s/hindsiliguri/v2/f2eEi2pbIa8eBfNwpUl0Am_MnNA9OgK8I1F23mNWOpE.ttf")), array("kind" => "webfonts#webfont", "family" => "Hind Vadodara", "category" => "sans-serif", "variants" => array("300", "regular", "500", "600", "700"), "subsets" => array("latin", "latin-ext", "gujarati"), "version" => "v2", "lastModified" => "2016-06-02", "files" => array("300" => "http://fonts.gstatic.com/s/hindvadodara/v2/KrZ6f_YevRawHvh0qDBkTbDwfZ__Dotj_J8NiWv76DQ.ttf", "500" => "http://fonts.gstatic.com/s/hindvadodara/v2/KrZ6f_YevRawHvh0qDBkTZzEKvFIU9WyojfbAkhDb6c.ttf", "600" => "http://fonts.gstatic.com/s/hindvadodara/v2/KrZ6f_YevRawHvh0qDBkTfgXs2VXrZsRiQ1c96pXZKI.ttf", "700" => "http://fonts.gstatic.com/s/hindvadodara/v2/KrZ6f_YevRawHvh0qDBkTYGjoH95IEFGA7BjhXnx_eg.ttf", "regular" => "http://fonts.gstatic.com/s/hindvadodara/v2/9c6KKeibr6NtFqknnNxZB-Dcg5akpSnIcsPhLOFv7l8.ttf")), array("kind" => "webfonts#webfont", "family" => "Holtwood One SC", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/holtwoodonesc/v7/sToOq3cIxbfnhbEkgYNuBbAgSRh1LpJXlLfl8IbsmHg.ttf")), array("kind" => "webfonts#webfont", "family" => "Homemade Apple", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/homemadeapple/v6/yg3UMEsefgZ8IHz_ryz86BiPOmFWYV1WlrJkRafc4c0.ttf")), array("kind" => "webfonts#webfont", "family" => "Homenaje", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/homenaje/v5/v0YBU0iBRrGdVjDNQILxtA.ttf")), array("kind" => "webfonts#webfont", "family" => "IM Fell DW Pica", "category" => "serif", "variants" => array("regular", "italic"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/imfelldwpica/v6/W81bfaWiUicLSPbJhW-ATsA5qm663gJGVdtpamafG5A.ttf", "italic" => "http://fonts.gstatic.com/s/imfelldwpica/v6/alQJ8SK5aSOZVaelYoyT4PL2asmh5DlYQYCosKo6yQs.ttf")), array("kind" => "webfonts#webfont", "family" => "IM Fell DW Pica SC", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/imfelldwpicasc/v6/xBKKJV4z2KsrtQnmjGO17JZ9RBdEL0H9o5qzT1Rtof4.ttf")), array("kind" => "webfonts#webfont", "family" => "IM Fell Double Pica", "category" => "serif", "variants" => array("regular", "italic"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/imfelldoublepica/v6/yN1wY_01BkQnO0LYAhXdUol14jEdVOhEmvtCMCVwYak.ttf", "italic" => "http://fonts.gstatic.com/s/imfelldoublepica/v6/64odUh2hAw8D9dkFKTlWYq0AWwkgdQfsRHec8TYi4mI.ttf")), array("kind" => "webfonts#webfont", "family" => "IM Fell Double Pica SC", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/imfelldoublepicasc/v6/jkrUtrLFpMw4ZazhfkKsGwc4LoC4OJUqLw9omnT3VOU.ttf")), array("kind" => "webfonts#webfont", "family" => "IM Fell English", "category" => "serif", "variants" => array("regular", "italic"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/imfellenglish/v6/xwIisCqGFi8pff-oa9uSVHGNmx1fDm-u2eBJHQkdrmk.ttf", "italic" => "http://fonts.gstatic.com/s/imfellenglish/v6/Z3cnIAI_L3XTRfz4JuZKbuewladMPCWTthtMv9cPS-c.ttf")), array("kind" => "webfonts#webfont", "family" => "IM Fell English SC", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/imfellenglishsc/v6/h3Tn6yWfw4b5qaLD1RWvz5ATixNthKRRR1XVH3rJNiw.ttf")), array("kind" => "webfonts#webfont", "family" => "IM Fell French Canon", "category" => "serif", "variants" => array("regular", "italic"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/imfellfrenchcanon/v6/iKB0WL1BagSpNPz3NLMdsJ3V2FNpBrlLSvqUnERhBP8.ttf", "italic" => "http://fonts.gstatic.com/s/imfellfrenchcanon/v6/owCuNQkLLFW7TBBPJbMnhRa-QL94KdW80H29tcyld2A.ttf")), array("kind" => "webfonts#webfont", "family" => "IM Fell French Canon SC", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/imfellfrenchcanonsc/v6/kA3bS19-tQbeT_iG32EZmaiyyzHwYrAbmNulTz423iM.ttf")), array("kind" => "webfonts#webfont", "family" => "IM Fell Great Primer", "category" => "serif", "variants" => array("regular", "italic"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/imfellgreatprimer/v6/AL8ALGNthei20f9Cu3e93rgeX3ROgtTz44CitKAxzKI.ttf", "italic" => "http://fonts.gstatic.com/s/imfellgreatprimer/v6/1a-artkXMVg682r7TTxVY1_YG2SFv8Ma7CxRl1S3o7g.ttf")), array("kind" => "webfonts#webfont", "family" => "IM Fell Great Primer SC", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/imfellgreatprimersc/v6/A313vRj97hMMGFjt6rgSJtRg-ciw1Y27JeXb2Zv4lZQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Iceberg", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/iceberg/v4/p2XVm4M-N0AOEEOymFKC5w.ttf")), array("kind" => "webfonts#webfont", "family" => "Iceland", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/iceland/v5/kq3uTMGgvzWGNi39B_WxGA.ttf")), array("kind" => "webfonts#webfont", "family" => "Imprima", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/imprima/v4/eRjquWLjwLGnTEhLH7u3kA.ttf")), array("kind" => "webfonts#webfont", "family" => "Inconsolata", "category" => "monospace", "variants" => array("regular", "700"), "subsets" => array("latin", "latin-ext"), "version" => "v12", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/inconsolata/v12/AIed271kqQlcIRSOnQH0yXe1Pd76Vl7zRpE7NLJQ7XU.ttf", "regular" => "http://fonts.gstatic.com/s/inconsolata/v12/7bMKuoy6Nh0ft0SHnIGMuaCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Inder", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/inder/v5/C38TwecLTfKxIHDc_Adcrw.ttf")), array("kind" => "webfonts#webfont", "family" => "Indie Flower", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/indieflower/v8/10JVD_humAd5zP2yrFqw6i3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Inika", "category" => "serif", "variants" => array("regular", "700"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/inika/v4/bl3ZoTyrWsFun2zYbsgJrA.ttf", "regular" => "http://fonts.gstatic.com/s/inika/v4/eZCrULQGaIxkrRoGz_DjhQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Inknut Antiqua", "category" => "serif", "variants" => array("300", "regular", "500", "600", "700", "800", "900"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v1", "lastModified" => "2016-05-31", "files" => array("300" => "http://fonts.gstatic.com/s/inknutantiqua/v1/CagoW52rBcslcXzHh6tVIg6hmPNSXwHGnJQCeQHKUMo.ttf", "500" => "http://fonts.gstatic.com/s/inknutantiqua/v1/CagoW52rBcslcXzHh6tVIiYCDvi1XFzRnTV7qUFsNgk.ttf", "600" => "http://fonts.gstatic.com/s/inknutantiqua/v1/CagoW52rBcslcXzHh6tVIjLEgY6PI0GrY6L00mykcEQ.ttf", "700" => "http://fonts.gstatic.com/s/inknutantiqua/v1/CagoW52rBcslcXzHh6tVIlRhfXn9P4_QueZ7VkUHUNc.ttf", "800" => "http://fonts.gstatic.com/s/inknutantiqua/v1/CagoW52rBcslcXzHh6tVInARjXVu2t2krcNTHiCb1qY.ttf", "900" => "http://fonts.gstatic.com/s/inknutantiqua/v1/CagoW52rBcslcXzHh6tVIrTsNy1JrFNT1qKy8j7W3CU.ttf", "regular" => "http://fonts.gstatic.com/s/inknutantiqua/v1/VlmmTfOrxr3HfcnhMueX9arFJ4O13IHVxZbM6yoslpo.ttf")), array("kind" => "webfonts#webfont", "family" => "Inter", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/inter/v5/C38TwecLTfKxIHDc_Adcrw.ttf")), array("kind" => "webfonts#webfont", "family" => "Irish Grover", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-20", "files" => array("regular" => "http://fonts.gstatic.com/s/irishgrover/v6/kUp7uUPooL-KsLGzeVJbBC3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Istok Web", "category" => "sans-serif", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("cyrillic", "cyrillic-ext", "latin", "latin-ext"), "version" => "v10", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/istokweb/v10/2koEo4AKFSvK4B52O_Mwai3USBnSvpkopQaUR-2r7iU.ttf", "regular" => "http://fonts.gstatic.com/s/istokweb/v10/RYLSjEXQ0nNtLLc4n7--dQ.ttf", "italic" => "http://fonts.gstatic.com/s/istokweb/v10/kvcT2SlTjmGbC3YlZxmrl6CWcynf_cDxXwCLxiixG1c.ttf", "700italic" => "http://fonts.gstatic.com/s/istokweb/v10/ycQ3g52ELrh3o_HYCNNUw3e1Pd76Vl7zRpE7NLJQ7XU.ttf")), array("kind" => "webfonts#webfont", "family" => "Italiana", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/italiana/v4/dt95fkCSTOF-c6QNjwSycA.ttf")), array("kind" => "webfonts#webfont", "family" => "Italianno", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/italianno/v6/HsyHnLpKf8uP7aMpDQHZmg.ttf")), array("kind" => "webfonts#webfont", "family" => "Itim", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "thai", "latin-ext", "vietnamese"), "version" => "v1", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/itim/v1/HHV9WK2x5lUkc5bxMXG8Tw.ttf")), array("kind" => "webfonts#webfont", "family" => "Jacques Francois", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v4", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/jacquesfrancois/v4/_-0XWPQIW6tOzTHg4KaJ_M13D_4KM32Q4UmTSjpuNGQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Jacques Francois Shadow", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v4", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/jacquesfrancoisshadow/v4/V14y0H3vq56fY9SV4OL_FASt0D_oLVawA8L8b9iKjbs.ttf")), array("kind" => "webfonts#webfont", "family" => "Jaldi", "category" => "sans-serif", "variants" => array("regular", "700"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v2", "lastModified" => "2016-06-07", "files" => array("700" => "http://fonts.gstatic.com/s/jaldi/v2/OIbtgjjEp3aVWtjF6WY8mA.ttf", "regular" => "http://fonts.gstatic.com/s/jaldi/v2/x1vR-bPW9a1EB-BUVqttCw.ttf")), array("kind" => "webfonts#webfont", "family" => "Jim Nightshade", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/jimnightshade/v4/_n43lYHXVWNgXegdYRIK9CF1W_bo0EdycfH0kHciIic.ttf")), array("kind" => "webfonts#webfont", "family" => "Jockey One", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/jockeyone/v6/cAucnOZLvFo07w2AbufBCfesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Jolly Lodger", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/jollylodger/v4/RX8HnkBgaEKQSHQyP9itiS3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Jomhuria", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext", "arabic"), "version" => "v2", "lastModified" => "2016-06-20", "files" => array("regular" => "http://fonts.gstatic.com/s/jomhuria/v2/hrvsccQpBliIgor15WxE6g.ttf")), array("kind" => "webfonts#webfont", "family" => "Josefin Sans", "category" => "sans-serif", "variants" => array("100", "100italic", "300", "300italic", "regular", "italic", "600", "600italic", "700", "700italic"), "subsets" => array("latin", "latin-ext"), "version" => "v9", "lastModified" => "2016-05-31", "files" => array("100" => "http://fonts.gstatic.com/s/josefinsans/v9/q9w3H4aeBxj0hZ8Osfi3d8SVQ0giZ-l_NELu3lgGyYw.ttf", "300" => "http://fonts.gstatic.com/s/josefinsans/v9/C6HYlRF50SGJq1XyXj04z6cQoVhARpoaILP7amxE_8g.ttf", "600" => "http://fonts.gstatic.com/s/josefinsans/v9/C6HYlRF50SGJq1XyXj04z2v8CylhIUtwUiYO7Z2wXbE.ttf", "700" => "http://fonts.gstatic.com/s/josefinsans/v9/C6HYlRF50SGJq1XyXj04z0D2ttfZwueP-QU272T9-k4.ttf", "100italic" => "http://fonts.gstatic.com/s/josefinsans/v9/s7-P1gqRNRNn-YWdOYnAOXXcj1rQwlNLIS625o-SrL0.ttf", "300italic" => "http://fonts.gstatic.com/s/josefinsans/v9/ppse0J9fKSaoxCIIJb33Gyna0FLWfcB-J_SAYmcAXaI.ttf", "regular" => "http://fonts.gstatic.com/s/josefinsans/v9/xgzbb53t8j-Mo-vYa23n5i3USBnSvpkopQaUR-2r7iU.ttf", "italic" => "http://fonts.gstatic.com/s/josefinsans/v9/q9w3H4aeBxj0hZ8Osfi3d_MZXuCXbOrAvx5R0IT5Oyo.ttf", "600italic" => "http://fonts.gstatic.com/s/josefinsans/v9/ppse0J9fKSaoxCIIJb33G4R-5-urNOGAobhAyctHvW8.ttf", "700italic" => "http://fonts.gstatic.com/s/josefinsans/v9/ppse0J9fKSaoxCIIJb33G_As9-1nE9qOqhChW0m4nDE.ttf")), array("kind" => "webfonts#webfont", "family" => "Josefin Slab", "category" => "serif", "variants" => array("100", "100italic", "300", "300italic", "regular", "italic", "600", "600italic", "700", "700italic"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("100" => "http://fonts.gstatic.com/s/josefinslab/v6/etsUjZYO8lTLU85lDhZwUsSVQ0giZ-l_NELu3lgGyYw.ttf", "300" => "http://fonts.gstatic.com/s/josefinslab/v6/NbE6ykYuM2IyEwxQxOIi2KcQoVhARpoaILP7amxE_8g.ttf", "600" => "http://fonts.gstatic.com/s/josefinslab/v6/NbE6ykYuM2IyEwxQxOIi2Gv8CylhIUtwUiYO7Z2wXbE.ttf", "700" => "http://fonts.gstatic.com/s/josefinslab/v6/NbE6ykYuM2IyEwxQxOIi2ED2ttfZwueP-QU272T9-k4.ttf", "100italic" => "http://fonts.gstatic.com/s/josefinslab/v6/8BjDChqLgBF3RJKfwHIYh3Xcj1rQwlNLIS625o-SrL0.ttf", "300italic" => "http://fonts.gstatic.com/s/josefinslab/v6/af9sBoKGPbGO0r21xJulyyna0FLWfcB-J_SAYmcAXaI.ttf", "regular" => "http://fonts.gstatic.com/s/josefinslab/v6/46aYWdgz-1oFX11flmyEfS3USBnSvpkopQaUR-2r7iU.ttf", "italic" => "http://fonts.gstatic.com/s/josefinslab/v6/etsUjZYO8lTLU85lDhZwUvMZXuCXbOrAvx5R0IT5Oyo.ttf", "600italic" => "http://fonts.gstatic.com/s/josefinslab/v6/af9sBoKGPbGO0r21xJuly4R-5-urNOGAobhAyctHvW8.ttf", "700italic" => "http://fonts.gstatic.com/s/josefinslab/v6/af9sBoKGPbGO0r21xJuly_As9-1nE9qOqhChW0m4nDE.ttf")), array("kind" => "webfonts#webfont", "family" => "Joti One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/jotione/v4/P3r_Th0ESHJdzunsvWgUfQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Judson", "category" => "serif", "variants" => array("regular", "italic", "700"), "subsets" => array("latin", "latin-ext", "vietnamese"), "version" => "v9", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/judson/v9/he4a2LwiPJc7r8x0oKCKiA.ttf", "regular" => "http://fonts.gstatic.com/s/judson/v9/znM1AAs0eytUaJzf1CrYZQ.ttf", "italic" => "http://fonts.gstatic.com/s/judson/v9/GVqQW9P52ygW-ySq-CLwAA.ttf")), array("kind" => "webfonts#webfont", "family" => "Julee", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/julee/v6/CAib-jsUsSO8SvVRnE9fHA.ttf")), array("kind" => "webfonts#webfont", "family" => "Julius Sans One", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/juliussansone/v5/iU65JP9acQHPDLkdalCF7jjVlsJB_M_Q_LtZxsoxvlw.ttf")), array("kind" => "webfonts#webfont", "family" => "Junge", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/junge/v4/j4IXCXtxrw9qIBheercp3A.ttf")), array("kind" => "webfonts#webfont", "family" => "Jura", "category" => "sans-serif", "variants" => array("300", "regular", "500", "600"), "subsets" => array("cyrillic", "cyrillic-ext", "latin", "latin-ext", "greek"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("300" => "http://fonts.gstatic.com/s/jura/v7/Rqx_xy1UnN0C7wD3FUSyPQ.ttf", "500" => "http://fonts.gstatic.com/s/jura/v7/16xhfjHCiaLj3tsqqgmtGg.ttf", "600" => "http://fonts.gstatic.com/s/jura/v7/iwseduOwJSdY8wQ1Y6CJdA.ttf", "regular" => "http://fonts.gstatic.com/s/jura/v7/YAWMwF3sN0KCbynMq-Yr_Q.ttf")), array("kind" => "webfonts#webfont", "family" => "Just Another Hand", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-20", "files" => array("regular" => "http://fonts.gstatic.com/s/justanotherhand/v7/fKV8XYuRNNagXr38eqbRf99BnJIEGrvoojniP57E51c.ttf")), array("kind" => "webfonts#webfont", "family" => "Just Me Again Down Here", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/justmeagaindownhere/v8/sN06iTc9ITubLTgXoG-kc3M9eVLpVTSK6TqZTIgBrWQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Kadwa", "category" => "serif", "variants" => array("regular", "700"), "subsets" => array("latin", "devanagari"), "version" => "v1", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/kadwa/v1/NFPZaBfekj_Io-7vUMz4Ww.ttf", "regular" => "http://fonts.gstatic.com/s/kadwa/v1/VwEN8oKGqaa0ug9kRpvSSg.ttf")), array("kind" => "webfonts#webfont", "family" => "Kalam", "category" => "handwriting", "variants" => array("300", "regular", "700"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v7", "lastModified" => "2016-06-07", "files" => array("300" => "http://fonts.gstatic.com/s/kalam/v7/MgQQlk1SgPEHdlkWMNh7Jg.ttf", "700" => "http://fonts.gstatic.com/s/kalam/v7/95nLItUGyWtNLZjSckluLQ.ttf", "regular" => "http://fonts.gstatic.com/s/kalam/v7/hNEJkp2K-aql7e5WQish4Q.ttf")), array("kind" => "webfonts#webfont", "family" => "Kameron", "category" => "serif", "variants" => array("regular", "700"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/kameron/v7/rabVVbzlflqvmXJUFlKnu_esZW2xOQ-xsNqO47m55DA.ttf", "regular" => "http://fonts.gstatic.com/s/kameron/v7/9r8HYhqDSwcq9WMjupL82A.ttf")), array("kind" => "webfonts#webfont", "family" => "Kanit", "category" => "sans-serif", "variants" => array("100", "100italic", "200", "200italic", "300", "300italic", "regular", "italic", "500", "500italic", "600", "600italic", "700", "700italic", "800", "800italic", "900", "900italic"), "subsets" => array("latin", "thai", "latin-ext", "vietnamese"), "version" => "v1", "lastModified" => "2016-05-31", "files" => array("100" => "http://fonts.gstatic.com/s/kanit/v1/CYl4qOK-NWwZp3iTKW1eIA.ttf", "200" => "http://fonts.gstatic.com/s/kanit/v1/wfLWkj1C4tYl7MoiFWS3bA.ttf", "300" => "http://fonts.gstatic.com/s/kanit/v1/SM5qHynYGdOmMKEwGUFIPA.ttf", "500" => "http://fonts.gstatic.com/s/kanit/v1/GxoU_USIJyIy8WIcYSUO2g.ttf", "600" => "http://fonts.gstatic.com/s/kanit/v1/n_qoIVxojeQY0D1pvoNDhA.ttf", "700" => "http://fonts.gstatic.com/s/kanit/v1/kEGmYvO8My36j5ILmbUPRg.ttf", "800" => "http://fonts.gstatic.com/s/kanit/v1/YTp-zAuKXxwnA1YnJIF1rg.ttf", "900" => "http://fonts.gstatic.com/s/kanit/v1/1NIEkusi3bG3GgO9Hor3fQ.ttf", "100italic" => "http://fonts.gstatic.com/s/kanit/v1/NLNtc56MpXmHl1yOrop8oQ.ttf", "200italic" => "http://fonts.gstatic.com/s/kanit/v1/D8gkrAAM2bvNJ-1i4ot-1_esZW2xOQ-xsNqO47m55DA.ttf", "300italic" => "http://fonts.gstatic.com/s/kanit/v1/IePislKOKy3Bqfpb9V5VM_esZW2xOQ-xsNqO47m55DA.ttf", "regular" => "http://fonts.gstatic.com/s/kanit/v1/L6VKvM17ZmevDynOiw7H9w.ttf", "italic" => "http://fonts.gstatic.com/s/kanit/v1/sHLq5U0-T0oSMTnwTKgv-A.ttf", "500italic" => "http://fonts.gstatic.com/s/kanit/v1/hrCiWCaNv9AaF0mDY1F2zPesZW2xOQ-xsNqO47m55DA.ttf", "600italic" => "http://fonts.gstatic.com/s/kanit/v1/9BkP85yRDoVayTWQwdGLqPesZW2xOQ-xsNqO47m55DA.ttf", "700italic" => "http://fonts.gstatic.com/s/kanit/v1/WNo3ZZ9xtOZJknNlvHAFWfesZW2xOQ-xsNqO47m55DA.ttf", "800italic" => "http://fonts.gstatic.com/s/kanit/v1/qiTGrW5sCa9UQp841fWjc_esZW2xOQ-xsNqO47m55DA.ttf", "900italic" => "http://fonts.gstatic.com/s/kanit/v1/ogN5dFD1r4BfxNV4Nb-TXfesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Kantumruy", "category" => "sans-serif", "variants" => array("300", "regular", "700"), "subsets" => array("khmer"), "version" => "v3", "lastModified" => "2016-05-31", "files" => array("300" => "http://fonts.gstatic.com/s/kantumruy/v3/ERRwQE0WG5uanaZWmOFXNi3USBnSvpkopQaUR-2r7iU.ttf", "700" => "http://fonts.gstatic.com/s/kantumruy/v3/gie_zErpGf_rNzs920C2Ji3USBnSvpkopQaUR-2r7iU.ttf", "regular" => "http://fonts.gstatic.com/s/kantumruy/v3/kQfXNYElQxr5dS8FyjD39Q.ttf")), array("kind" => "webfonts#webfont", "family" => "Karla", "category" => "sans-serif", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/karla/v5/JS501sZLxZ4zraLQdncOUA.ttf", "regular" => "http://fonts.gstatic.com/s/karla/v5/78UgGRwJFkhqaoFimqoKpQ.ttf", "italic" => "http://fonts.gstatic.com/s/karla/v5/51UBKly9RQOnOkj95ZwEFw.ttf", "700italic" => "http://fonts.gstatic.com/s/karla/v5/3YDyi09gQjCRh-5-SVhTTvesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Karma", "category" => "serif", "variants" => array("300", "regular", "500", "600", "700"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("300" => "http://fonts.gstatic.com/s/karma/v5/lH6ijJnguWR2Sz7tEl6MQQ.ttf", "500" => "http://fonts.gstatic.com/s/karma/v5/9YGjxi6Hcvz2Kh-rzO_cAw.ttf", "600" => "http://fonts.gstatic.com/s/karma/v5/h_CVzXXtqSxjfS2sIwaejA.ttf", "700" => "http://fonts.gstatic.com/s/karma/v5/smuSM08oApsQPPVYbHd1CA.ttf", "regular" => "http://fonts.gstatic.com/s/karma/v5/wvqTxAGBUrTqU0urTEoPIw.ttf")), array("kind" => "webfonts#webfont", "family" => "Katibeh", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext", "arabic"), "version" => "v2", "lastModified" => "2016-06-20", "files" => array("regular" => "http://fonts.gstatic.com/s/katibeh/v2/Q-SA43uWR2uu3wBIvedotA.ttf")), array("kind" => "webfonts#webfont", "family" => "Kaushan Script", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/kaushanscript/v5/qx1LSqts-NtiKcLw4N03IBnpV0hQCek3EmWnCPrvGRM.ttf")), array("kind" => "webfonts#webfont", "family" => "Kavivanar", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "tamil", "latin-ext"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("regular" => "http://fonts.gstatic.com/s/kavivanar/v1/VLDrdUtF1irKFc8rFWgDaw.ttf")), array("kind" => "webfonts#webfont", "family" => "Kavoon", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/kavoon/v5/382m-6baKXqJFQjEgobt6Q.ttf")), array("kind" => "webfonts#webfont", "family" => "Kdam Thmor", "category" => "display", "variants" => array("regular"), "subsets" => array("khmer"), "version" => "v3", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/kdamthmor/v3/otCdP6UU-VBIrBfVDWBQJ_esZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Keania One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/keaniaone/v4/PACrDKZWngXzgo-ucl6buvesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Kelly Slab", "category" => "display", "variants" => array("regular"), "subsets" => array("cyrillic", "latin", "latin-ext"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/kellyslab/v6/F_2oS1e9XdYx1MAi8XEVefesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Kenia", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/kenia/v8/OLM9-XfITK9PsTLKbGBrwg.ttf")), array("kind" => "webfonts#webfont", "family" => "Khand", "category" => "sans-serif", "variants" => array("300", "regular", "500", "600", "700"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v4", "lastModified" => "2016-06-07", "files" => array("300" => "http://fonts.gstatic.com/s/khand/v4/072zRl4OU9Pinjjkg174LA.ttf", "500" => "http://fonts.gstatic.com/s/khand/v4/46_p-SqtuMe56nxQdteWxg.ttf", "600" => "http://fonts.gstatic.com/s/khand/v4/zggGWYIiPJyMTgkfxP_kaA.ttf", "700" => "http://fonts.gstatic.com/s/khand/v4/0I0UWaN-X5QBmfexpXKhqg.ttf", "regular" => "http://fonts.gstatic.com/s/khand/v4/HdLdTNFqNIDGJZl1ZEj84w.ttf")), array("kind" => "webfonts#webfont", "family" => "Khmer", "category" => "display", "variants" => array("regular"), "subsets" => array("khmer"), "version" => "v9", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/khmer/v9/vWaBJIbaQuBNz02ALIKJ3A.ttf")), array("kind" => "webfonts#webfont", "family" => "Khula", "category" => "sans-serif", "variants" => array("300", "regular", "600", "700", "800"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v1", "lastModified" => "2016-05-31", "files" => array("300" => "http://fonts.gstatic.com/s/khula/v1/_1LySU5Upq-sc4OZ1b_GIw.ttf", "600" => "http://fonts.gstatic.com/s/khula/v1/4ZH86Hce-aeFDaedTnbkbg.ttf", "700" => "http://fonts.gstatic.com/s/khula/v1/UGVExGl-Jjs-YPpGv-MZ6w.ttf", "800" => "http://fonts.gstatic.com/s/khula/v1/Sccp_oOo8FWgbx5smie7xQ.ttf", "regular" => "http://fonts.gstatic.com/s/khula/v1/izcPIFyCSd16XI1Ak_Wk7Q.ttf")), array("kind" => "webfonts#webfont", "family" => "Kite One", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/kiteone/v4/8ojWmgUc97m0f_i6sTqLoQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Knewave", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/knewave/v5/KGHM4XWr4iKnBMqzZLkPBg.ttf")), array("kind" => "webfonts#webfont", "family" => "Kotta One", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/kottaone/v4/AB2Q7hVw6niJYDgLvFXu5w.ttf")), array("kind" => "webfonts#webfont", "family" => "Koulen", "category" => "display", "variants" => array("regular"), "subsets" => array("khmer"), "version" => "v10", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/koulen/v10/AAYOK8RSRO7FTskTzFuzNw.ttf")), array("kind" => "webfonts#webfont", "family" => "Kranky", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/kranky/v6/C8dxxTS99-fZ84vWk8SDrg.ttf")), array("kind" => "webfonts#webfont", "family" => "Kreon", "category" => "serif", "variants" => array("300", "regular", "700"), "subsets" => array("latin"), "version" => "v9", "lastModified" => "2016-05-31", "files" => array("300" => "http://fonts.gstatic.com/s/kreon/v9/HKtJRiq5C2zbq5N1IX32sA.ttf", "700" => "http://fonts.gstatic.com/s/kreon/v9/jh0dSmaPodjxISiblIUTkw.ttf", "regular" => "http://fonts.gstatic.com/s/kreon/v9/zA_IZt0u0S3cvHJu-n1oEg.ttf")), array("kind" => "webfonts#webfont", "family" => "Kristi", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/kristi/v7/aRsgBQrkQkMlu4UPSnJyOQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Krona One", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/kronaone/v4/zcQj4ljqTo166AdourlF9w.ttf")), array("kind" => "webfonts#webfont", "family" => "Kumar One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext", "gujarati"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("regular" => "http://fonts.gstatic.com/s/kumarone/v1/YmcJD6Wky1clGYY5OD-BkQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Kumar One Outline", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext", "gujarati"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("regular" => "http://fonts.gstatic.com/s/kumaroneoutline/v1/hnQF47H-55qiLAGgq7C3QyxhoCTLJoiJ-y-zew8F8j0.ttf")), array("kind" => "webfonts#webfont", "family" => "Kurale", "category" => "serif", "variants" => array("regular"), "subsets" => array("cyrillic", "latin", "devanagari", "latin-ext"), "version" => "v1", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/kurale/v1/rxeyIcvQlT4XAWwNbXFCfw.ttf")), array("kind" => "webfonts#webfont", "family" => "La Belle Aurore", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/labelleaurore/v7/Irdbc4ASuUoWDjd_Wc3md123K2iuuhwZgaKapkyRTY8.ttf")), array("kind" => "webfonts#webfont", "family" => "Laila", "category" => "serif", "variants" => array("300", "regular", "500", "600", "700"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v2", "lastModified" => "2016-06-07", "files" => array("300" => "http://fonts.gstatic.com/s/laila/v2/bLbIVEZF3IWSZ-in72GJvA.ttf", "500" => "http://fonts.gstatic.com/s/laila/v2/tkf8VtFvW9g3VsxQCA6WOQ.ttf", "600" => "http://fonts.gstatic.com/s/laila/v2/3EMP2L6JRQ4GaHIxCldCeA.ttf", "700" => "http://fonts.gstatic.com/s/laila/v2/R7P4z1xjcjecmjZ9GyhqHQ.ttf", "regular" => "http://fonts.gstatic.com/s/laila/v2/6iYor3edprH7360qtBGoag.ttf")), array("kind" => "webfonts#webfont", "family" => "Lakki Reddy", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "telugu"), "version" => "v3", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/lakkireddy/v3/Q5EpFa91FjW37t0FCnedaKCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Lalezar", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext", "arabic", "vietnamese"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("regular" => "http://fonts.gstatic.com/s/lalezar/v1/k4_MPf09PGmL7oyGdPKwcg.ttf")), array("kind" => "webfonts#webfont", "family" => "Lancelot", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/lancelot/v6/XMT7T_oo_MQUGAnU2v-sdA.ttf")), array("kind" => "webfonts#webfont", "family" => "Lateef", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "arabic"), "version" => "v10", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/lateef/v10/PAsKCgi1qc7XPwvzo_I-DQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Lato", "category" => "sans-serif", "variants" => array("100", "100italic", "300", "300italic", "regular", "italic", "700", "700italic", "900", "900italic"), "subsets" => array("latin", "latin-ext"), "version" => "v11", "lastModified" => "2016-05-31", "files" => array("100" => "http://fonts.gstatic.com/s/lato/v11/Upp-ka9rLQmHYCsFgwL-eg.ttf", "300" => "http://fonts.gstatic.com/s/lato/v11/Ja02qOppOVq9jeRjWekbHg.ttf", "700" => "http://fonts.gstatic.com/s/lato/v11/iX_QxBBZLhNj5JHlTzHQzg.ttf", "900" => "http://fonts.gstatic.com/s/lato/v11/8TPEV6NbYWZlNsXjbYVv7w.ttf", "100italic" => "http://fonts.gstatic.com/s/lato/v11/zLegi10uS_9-fnUDISl0KA.ttf", "300italic" => "http://fonts.gstatic.com/s/lato/v11/dVebFcn7EV7wAKwgYestUg.ttf", "regular" => "http://fonts.gstatic.com/s/lato/v11/h7rISIcQapZBpei-sXwIwg.ttf", "italic" => "http://fonts.gstatic.com/s/lato/v11/P_dJOFJylV3A870UIOtr0w.ttf", "700italic" => "http://fonts.gstatic.com/s/lato/v11/WFcZakHrrCKeUJxHA4T_gw.ttf", "900italic" => "http://fonts.gstatic.com/s/lato/v11/draWperrI7n2xi35Cl08fA.ttf")), array("kind" => "webfonts#webfont", "family" => "League Script", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/leaguescript/v7/wnRFLvfabWK_DauqppD6vSeUSrabuTpOsMEiRLtKwk0.ttf")), array("kind" => "webfonts#webfont", "family" => "Leckerli One", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/leckerlione/v7/S2Y_iLrItTu8kIJTkS7DrC3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Ledger", "category" => "serif", "variants" => array("regular"), "subsets" => array("cyrillic", "latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/ledger/v4/G432jp-tahOfWHbCYkI0jw.ttf")), array("kind" => "webfonts#webfont", "family" => "Lekton", "category" => "sans-serif", "variants" => array("regular", "italic", "700"), "subsets" => array("latin", "latin-ext"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/lekton/v7/WZw-uL8WTkx3SBVfTlevXQ.ttf", "regular" => "http://fonts.gstatic.com/s/lekton/v7/r483JYmxf5PjIm4jVAm8Yg.ttf", "italic" => "http://fonts.gstatic.com/s/lekton/v7/_UbDIPBA1wDqSbhp-OED7A.ttf")), array("kind" => "webfonts#webfont", "family" => "Lexend", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v19", "lastModified" => "2023-09-14", "files" => array("regular" => "https://fonts.gstatic.com/s/lexend/v19/wlptgwvFAVdoq2_F94zlCfv0bz1WCzsW_LBte6KuGEo.ttf")), array("kind" => "webfonts#webfont", "family" => "Lemon", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/lemon/v5/wed1nNu4LNSu-3RoRVUhUw.ttf")), array("kind" => "webfonts#webfont", "family" => "Lemonada", "category" => "display", "variants" => array("300", "regular", "600", "700"), "subsets" => array("latin", "latin-ext", "arabic", "vietnamese"), "version" => "v2", "lastModified" => "2016-06-20", "files" => array("300" => "http://fonts.gstatic.com/s/lemonada/v2/uM3MufQOcwGHuruj4TsXiqCWcynf_cDxXwCLxiixG1c.ttf", "600" => "http://fonts.gstatic.com/s/lemonada/v2/9Vd4MNKsOxNyLzlfTXdKLqCWcynf_cDxXwCLxiixG1c.ttf", "700" => "http://fonts.gstatic.com/s/lemonada/v2/9jKcm4hRI511-Dy7FFfQ3aCWcynf_cDxXwCLxiixG1c.ttf", "regular" => "http://fonts.gstatic.com/s/lemonada/v2/pkzws3AUXmaaAzOi7aydSQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Libre Baskerville", "category" => "serif", "variants" => array("regular", "italic", "700"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/librebaskerville/v4/kH7K4InNTm7mmOXXjrA5v-xuswJKUVpBRfYFpz0W3Iw.ttf", "regular" => "http://fonts.gstatic.com/s/librebaskerville/v4/pR0sBQVcY0JZc_ciXjFsKyyZRYCSvpCzQKuMWnP5NDY.ttf", "italic" => "http://fonts.gstatic.com/s/librebaskerville/v4/QHIOz1iKF3bIEzRdDFaf5QnhapNS5Oi8FPrBRDLbsW4.ttf")), array("kind" => "webfonts#webfont", "family" => "Libre Franklin", "category" => "sans-serif", "variants" => array("100", "100italic", "200", "200italic", "300", "300italic", "regular", "italic", "500", "500italic", "600", "600italic", "700", "700italic", "800", "800italic", "900", "900italic"), "subsets" => array("latin", "latin-ext"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("100" => "http://fonts.gstatic.com/s/librefranklin/v1/zrsyK9EytLQ07oRM9IZIsX6Zf0VB_l-7q6pFtcZSRCs.ttf", "200" => "http://fonts.gstatic.com/s/librefranklin/v1/1_DGDtljMiPWFs5rl_p0yCwKTB4uIbnDXE2hyxZaFPY.ttf", "300" => "http://fonts.gstatic.com/s/librefranklin/v1/1_DGDtljMiPWFs5rl_p0yMhKJW3W9-339CFS_Lie1us.ttf", "500" => "http://fonts.gstatic.com/s/librefranklin/v1/1_DGDtljMiPWFs5rl_p0yMBjwrbmxH6gp8HgxjPD8qo.ttf", "600" => "http://fonts.gstatic.com/s/librefranklin/v1/1_DGDtljMiPWFs5rl_p0yORt4MKdIUjA60qLK3wI2m8.ttf", "700" => "http://fonts.gstatic.com/s/librefranklin/v1/1_DGDtljMiPWFs5rl_p0yEnStGWSv3WdwjmyyI8xc7Q.ttf", "800" => "http://fonts.gstatic.com/s/librefranklin/v1/1_DGDtljMiPWFs5rl_p0yKltwG0cydF-uC1kFVv1hts.ttf", "900" => "http://fonts.gstatic.com/s/librefranklin/v1/1_DGDtljMiPWFs5rl_p0yF7duMYIKwoQ5QsTL00fobw.ttf", "100italic" => "http://fonts.gstatic.com/s/librefranklin/v1/LHzsuUmxr4UY-IoiG8pRK4gsWNE1DYiT_eIOcNe2Au4.ttf", "200italic" => "http://fonts.gstatic.com/s/librefranklin/v1/7_V210XP3LBEtEwiCTqho0lu1sSkaQaYEjN61aJ3i1I.ttf", "300italic" => "http://fonts.gstatic.com/s/librefranklin/v1/7_V210XP3LBEtEwiCTqho14je5cfhxzx5bEvSaoyQQI.ttf", "regular" => "http://fonts.gstatic.com/s/librefranklin/v1/PFwjf3aDdAQPvNKUrT3U7_fSnedoLXQQjURyDxluu8g.ttf", "italic" => "http://fonts.gstatic.com/s/librefranklin/v1/zrsyK9EytLQ07oRM9IZIsX5kKxjpQfTpnFf2SrDLxlg.ttf", "500italic" => "http://fonts.gstatic.com/s/librefranklin/v1/7_V210XP3LBEtEwiCTqho5VcuOW5XbZIr02vW37iuvg.ttf", "600italic" => "http://fonts.gstatic.com/s/librefranklin/v1/7_V210XP3LBEtEwiCTqhowNPRgU5g4Xymf9hgRWrbNs.ttf", "700italic" => "http://fonts.gstatic.com/s/librefranklin/v1/7_V210XP3LBEtEwiCTqhow7kn3RFjf4gfwsdsBE-Rf4.ttf", "800italic" => "http://fonts.gstatic.com/s/librefranklin/v1/7_V210XP3LBEtEwiCTqho80d7u0uHUbaRkK-cNyim1w.ttf", "900italic" => "http://fonts.gstatic.com/s/librefranklin/v1/7_V210XP3LBEtEwiCTqho0THpHUXJVnEwH4tSjkF0wg.ttf")), array("kind" => "webfonts#webfont", "family" => "Life Savers", "category" => "display", "variants" => array("regular", "700"), "subsets" => array("latin", "latin-ext"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/lifesavers/v6/THQKqChyYUm97rNPVFdGGXe1Pd76Vl7zRpE7NLJQ7XU.ttf", "regular" => "http://fonts.gstatic.com/s/lifesavers/v6/g49cUDk4Y1P0G5NMkMAm7qCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Lilita One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/lilitaone/v4/vTxJQjbNV6BCBHx8sGDCVvesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Lily Script One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/lilyscriptone/v4/uPWsLVW8uiXqIBnE8ZwGPDjVlsJB_M_Q_LtZxsoxvlw.ttf")), array("kind" => "webfonts#webfont", "family" => "Limelight", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/limelight/v7/5dTfN6igsXjLjOy8QQShcg.ttf")), array("kind" => "webfonts#webfont", "family" => "Linden Hill", "category" => "serif", "variants" => array("regular", "italic"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/lindenhill/v6/UgsC0txqd-E1yjvjutwm_KCWcynf_cDxXwCLxiixG1c.ttf", "italic" => "http://fonts.gstatic.com/s/lindenhill/v6/OcS3bZcu8vJvIDH8Zic83keOrDcLawS7-ssYqLr2Xp4.ttf")), array("kind" => "webfonts#webfont", "family" => "Lobster", "category" => "display", "variants" => array("regular"), "subsets" => array("cyrillic", "latin", "latin-ext", "vietnamese"), "version" => "v18", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/lobster/v18/9LpJGtNuM1D8FAZ2BkJH2Q.ttf")), array("kind" => "webfonts#webfont", "family" => "Lobster Two", "category" => "display", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("latin"), "version" => "v9", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/lobstertwo/v9/bmdxOflBqMqjEC0-kGsIiHe1Pd76Vl7zRpE7NLJQ7XU.ttf", "regular" => "http://fonts.gstatic.com/s/lobstertwo/v9/xb9aY4w9ceh8JRzobID1naCWcynf_cDxXwCLxiixG1c.ttf", "italic" => "http://fonts.gstatic.com/s/lobstertwo/v9/Ul_16MSbfayQv1I4QhLEoEeOrDcLawS7-ssYqLr2Xp4.ttf", "700italic" => "http://fonts.gstatic.com/s/lobstertwo/v9/LEkN2_no_6kFvRfiBZ8xpM_zJjSACmk0BRPxQqhnNLU.ttf")), array("kind" => "webfonts#webfont", "family" => "Londrina Outline", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/londrinaoutline/v5/lls08GOa1eT74p072l1AWJmp8DTZ6iHear7UV05iykg.ttf")), array("kind" => "webfonts#webfont", "family" => "Londrina Shadow", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/londrinashadow/v4/dNYuzPS_7eYgXFJBzMoKdbw6Z3rVA5KDSi7aQxS92Nk.ttf")), array("kind" => "webfonts#webfont", "family" => "Londrina Sketch", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/londrinasketch/v4/p7Ai06aT1Ycp_D2fyE3z69d6z_uhFGnpCOifUY1fJQo.ttf")), array("kind" => "webfonts#webfont", "family" => "Londrina Solid", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/londrinasolid/v4/yysorIEiYSBb0ylZjg791MR125CwGqh8XBqkBzea0LA.ttf")), array("kind" => "webfonts#webfont", "family" => "Lora", "category" => "serif", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("cyrillic", "latin", "latin-ext"), "version" => "v9", "lastModified" => "2016-06-07", "files" => array("700" => "http://fonts.gstatic.com/s/lora/v9/enKND5SfzQKkggBA_VnT1A.ttf", "regular" => "http://fonts.gstatic.com/s/lora/v9/aXJ7KVIGcejEy1abawZazg.ttf", "italic" => "http://fonts.gstatic.com/s/lora/v9/AN2EZaj2tFRpyveuNn9BOg.ttf", "700italic" => "http://fonts.gstatic.com/s/lora/v9/ivs9j3kYU65pR9QD9YFdzQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Love Ya Like A Sister", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/loveyalikeasister/v7/LzkxWS-af0Br2Sk_YgSJY-ad1xEP8DQfgfY8MH9aBUg.ttf")), array("kind" => "webfonts#webfont", "family" => "Loved by the King", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/lovedbytheking/v6/wg03xD4cWigj4YDufLBSr8io2AFEwwMpu7y5KyiyAJc.ttf")), array("kind" => "webfonts#webfont", "family" => "Lovers Quarrel", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/loversquarrel/v4/gipdZ8b7pKb89MzQLAtJHLHLxci2ElvNEmOB303HLk0.ttf")), array("kind" => "webfonts#webfont", "family" => "Luckiest Guy", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/luckiestguy/v6/5718gH8nDy3hFVihOpkY5C3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Lusitana", "category" => "serif", "variants" => array("regular", "700"), "subsets" => array("latin"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/lusitana/v4/GWtZyUsONxgkdl3Mc1P7FKCWcynf_cDxXwCLxiixG1c.ttf", "regular" => "http://fonts.gstatic.com/s/lusitana/v4/l1h9VDomkwbdzbPdmLcUIw.ttf")), array("kind" => "webfonts#webfont", "family" => "Lustria", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/lustria/v4/gXAk0s4ai0X-TAOhYzZd1w.ttf")), array("kind" => "webfonts#webfont", "family" => "Macondo", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/macondo/v5/G6yPNUscRPQ8ufBXs_8yRQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Macondo Swash Caps", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/macondoswashcaps/v4/SsSR706z-MlvEH7_LS6JAPkkgYRHs6GSG949m-K6x2k.ttf")), array("kind" => "webfonts#webfont", "family" => "Mada", "category" => "sans-serif", "variants" => array("300", "regular", "500", "900"), "subsets" => array("latin", "arabic"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("300" => "http://fonts.gstatic.com/s/mada/v1/P46fye2TPh4fVwALgHSXCA.ttf", "500" => "http://fonts.gstatic.com/s/mada/v1/PhhDsBi34sP0LptbpS9m6w.ttf", "900" => "http://fonts.gstatic.com/s/mada/v1/aCyc9Kc3rOJLL6fV9VfptA.ttf", "regular" => "http://fonts.gstatic.com/s/mada/v1/io_zUrt5o943T_q45OHLWQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Magra", "category" => "sans-serif", "variants" => array("regular", "700"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/magra/v4/6fOM5sq5cIn8D0RjX8Lztw.ttf", "regular" => "http://fonts.gstatic.com/s/magra/v4/hoZ13bwCXBxuGZqAudgc5A.ttf")), array("kind" => "webfonts#webfont", "family" => "Maiden Orange", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/maidenorange/v6/ZhKIA2SPisEwdhW7g0RUWojjx0o0jr6fNXxPgYh_a8Q.ttf")), array("kind" => "webfonts#webfont", "family" => "Maitree", "category" => "serif", "variants" => array("200", "300", "regular", "500", "600", "700"), "subsets" => array("latin", "thai", "latin-ext", "vietnamese"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("200" => "http://fonts.gstatic.com/s/maitree/v1/JTlrRs3bVPV4i05cUIx_z_esZW2xOQ-xsNqO47m55DA.ttf", "300" => "http://fonts.gstatic.com/s/maitree/v1/rEGdABAOaqCHggl37mkWjfesZW2xOQ-xsNqO47m55DA.ttf", "500" => "http://fonts.gstatic.com/s/maitree/v1/2VHD7TXjRhN4Xu74SEPGdvesZW2xOQ-xsNqO47m55DA.ttf", "600" => "http://fonts.gstatic.com/s/maitree/v1/uuazDnPwt30gW3cKsG-e0_esZW2xOQ-xsNqO47m55DA.ttf", "700" => "http://fonts.gstatic.com/s/maitree/v1/cnHhc9fphsL3q-pistN3IPesZW2xOQ-xsNqO47m55DA.ttf", "regular" => "http://fonts.gstatic.com/s/maitree/v1/SpKVJkAjDAYOr1VkdSRspA.ttf")), array("kind" => "webfonts#webfont", "family" => "Mako", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/mako/v7/z5zSLmfPlv1uTVAdmJBLXg.ttf")), array("kind" => "webfonts#webfont", "family" => "Mallanna", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "telugu"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/mallanna/v4/krCTa-CfMbtxqF0689CbuQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Mandali", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "telugu"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/mandali/v4/0lF8yJ7fkyjXuqtSi5bWbQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Marcellus", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/marcellus/v4/UjiLZzumxWC9whJ86UtaYw.ttf")), array("kind" => "webfonts#webfont", "family" => "Marcellus SC", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/marcellussc/v4/_jugwxhkkynrvsfrxVx8gS3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Marck Script", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("cyrillic", "latin", "latin-ext"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/marckscript/v7/O_D1NAZVOFOobLbVtW3bci3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Margarine", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/margarine/v5/DJnJwIrcO_cGkjSzY3MERw.ttf")), array("kind" => "webfonts#webfont", "family" => "Marko One", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/markoone/v6/hpP7j861sOAco43iDc4n4w.ttf")), array("kind" => "webfonts#webfont", "family" => "Marmelad", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("cyrillic", "latin", "latin-ext"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/marmelad/v6/jI0_FBlSOIRLL0ePWOhOwQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Martel", "category" => "serif", "variants" => array("200", "300", "regular", "600", "700", "800", "900"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v1", "lastModified" => "2016-05-31", "files" => array("200" => "http://fonts.gstatic.com/s/martel/v1/_wfGdswZbat7P4tupHLA1w.ttf", "300" => "http://fonts.gstatic.com/s/martel/v1/SghoV2F2VPdVU3P0a4fa9w.ttf", "600" => "http://fonts.gstatic.com/s/martel/v1/Kt9uPhH1PvUwuZ5Y6zuAMQ.ttf", "700" => "http://fonts.gstatic.com/s/martel/v1/4OzIiKB5wE36xXL2U0vzWQ.ttf", "800" => "http://fonts.gstatic.com/s/martel/v1/RVF8drcQoRkRL7l_ZkpTlQ.ttf", "900" => "http://fonts.gstatic.com/s/martel/v1/iS0YUpFJoiLRlnyl40rpEA.ttf", "regular" => "http://fonts.gstatic.com/s/martel/v1/9ALu5czkaaf5zsYk6GJEnQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Martel Sans", "category" => "sans-serif", "variants" => array("200", "300", "regular", "600", "700", "800", "900"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v2", "lastModified" => "2016-05-31", "files" => array("200" => "http://fonts.gstatic.com/s/martelsans/v2/7ajme85aKKx_SCWF59ImQEnzyIngrzGjGh22wPb6cGM.ttf", "300" => "http://fonts.gstatic.com/s/martelsans/v2/7ajme85aKKx_SCWF59ImQC9-WlPSxbfiI49GsXo3q0g.ttf", "600" => "http://fonts.gstatic.com/s/martelsans/v2/7ajme85aKKx_SCWF59ImQJZ7xm-Bj30Bj2KNdXDzSZg.ttf", "700" => "http://fonts.gstatic.com/s/martelsans/v2/7ajme85aKKx_SCWF59ImQHe1Pd76Vl7zRpE7NLJQ7XU.ttf", "800" => "http://fonts.gstatic.com/s/martelsans/v2/7ajme85aKKx_SCWF59ImQA89PwPrYLaRFJ-HNCU9NbA.ttf", "900" => "http://fonts.gstatic.com/s/martelsans/v2/7ajme85aKKx_SCWF59ImQCenaqEuufTBk9XMKnKmgDA.ttf", "regular" => "http://fonts.gstatic.com/s/martelsans/v2/91c8DPDZncMc0RFfhmc2RqCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Marvel", "category" => "sans-serif", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/marvel/v6/WrHDBL1RupWGo2UcdgxB3Q.ttf", "regular" => "http://fonts.gstatic.com/s/marvel/v6/Fg1dO8tWVb-MlyqhsbXEkg.ttf", "italic" => "http://fonts.gstatic.com/s/marvel/v6/HzyjFB-oR5usrc7Lxz9g8w.ttf", "700italic" => "http://fonts.gstatic.com/s/marvel/v6/Gzf5NT09Y6xskdQRj2kz1qCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Mate", "category" => "serif", "variants" => array("regular", "italic"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/mate/v5/ooFviPcJ6hZP5bAE71Cawg.ttf", "italic" => "http://fonts.gstatic.com/s/mate/v5/5XwW6_cbisGvCX5qmNiqfA.ttf")), array("kind" => "webfonts#webfont", "family" => "Mate SC", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/matesc/v5/-YkIT2TZoPZF6pawKzDpWw.ttf")), array("kind" => "webfonts#webfont", "family" => "Maven Pro", "category" => "sans-serif", "variants" => array("regular", "500", "700", "900"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("500" => "http://fonts.gstatic.com/s/mavenpro/v7/SQVfzoJBbj9t3aVcmbspRi3USBnSvpkopQaUR-2r7iU.ttf", "700" => "http://fonts.gstatic.com/s/mavenpro/v7/uDssvmXgp7Nj3i336k_dSi3USBnSvpkopQaUR-2r7iU.ttf", "900" => "http://fonts.gstatic.com/s/mavenpro/v7/-91TwiFzqeL1F7Kh91APwS3USBnSvpkopQaUR-2r7iU.ttf", "regular" => "http://fonts.gstatic.com/s/mavenpro/v7/sqPJIFG4gqsjl-0q_46Gbw.ttf")), array("kind" => "webfonts#webfont", "family" => "McLaren", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/mclaren/v4/OprvTGxaiINBKW_1_U0eoQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Meddon", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v9", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/meddon/v9/f8zJO98uu2EtSj9p7ci9RA.ttf")), array("kind" => "webfonts#webfont", "family" => "MedievalSharp", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/medievalsharp/v8/85X_PjV6tftJ0-rX7KYQkOe45sJkivqprK7VkUlzfg0.ttf")), array("kind" => "webfonts#webfont", "family" => "Medula One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/medulaone/v6/AasPgDQak81dsTGQHc5zUPesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Meera Inimai", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "tamil"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("regular" => "http://fonts.gstatic.com/s/meerainimai/v1/fWbdJc2ZVZnWCi06NRCxDy3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Megrim", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/megrim/v7/e-9jVUC9lv1zxaFQARuftw.ttf")), array("kind" => "webfonts#webfont", "family" => "Meie Script", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/meiescript/v4/oTIWE5MmPye-rCyVp_6KEqCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Merienda", "category" => "handwriting", "variants" => array("regular", "700"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/merienda/v4/GlwcvRLlgiVE2MBFQ4r0sKCWcynf_cDxXwCLxiixG1c.ttf", "regular" => "http://fonts.gstatic.com/s/merienda/v4/MYY6Og1qZlOQtPW2G95Y3A.ttf")), array("kind" => "webfonts#webfont", "family" => "Merienda One", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/meriendaone/v7/bCA-uDdUx6nTO8SjzCLXvS3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Merriweather", "category" => "serif", "variants" => array("300", "300italic", "regular", "italic", "700", "700italic", "900", "900italic"), "subsets" => array("cyrillic", "cyrillic-ext", "latin", "latin-ext"), "version" => "v13", "lastModified" => "2016-06-07", "files" => array("300" => "http://fonts.gstatic.com/s/merriweather/v13/ZvcMqxEwPfh2qDWBPxn6nqcQoVhARpoaILP7amxE_8g.ttf", "700" => "http://fonts.gstatic.com/s/merriweather/v13/ZvcMqxEwPfh2qDWBPxn6nkD2ttfZwueP-QU272T9-k4.ttf", "900" => "http://fonts.gstatic.com/s/merriweather/v13/ZvcMqxEwPfh2qDWBPxn6nqObDOjC3UL77puoeHsE3fw.ttf", "300italic" => "http://fonts.gstatic.com/s/merriweather/v13/EYh7Vl4ywhowqULgRdYwICna0FLWfcB-J_SAYmcAXaI.ttf", "regular" => "http://fonts.gstatic.com/s/merriweather/v13/RFda8w1V0eDZheqfcyQ4EC3USBnSvpkopQaUR-2r7iU.ttf", "italic" => "http://fonts.gstatic.com/s/merriweather/v13/So5lHxHT37p2SS4-t60SlPMZXuCXbOrAvx5R0IT5Oyo.ttf", "700italic" => "http://fonts.gstatic.com/s/merriweather/v13/EYh7Vl4ywhowqULgRdYwIPAs9-1nE9qOqhChW0m4nDE.ttf", "900italic" => "http://fonts.gstatic.com/s/merriweather/v13/EYh7Vl4ywhowqULgRdYwIBd0_s6jQr9r5s5OZYvtzBY.ttf")), array("kind" => "webfonts#webfont", "family" => "Merriweather Sans", "category" => "sans-serif", "variants" => array("300", "300italic", "regular", "italic", "700", "700italic", "800", "800italic"), "subsets" => array("latin", "latin-ext"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("300" => "http://fonts.gstatic.com/s/merriweathersans/v8/6LmGj5dOJopQKEkt88Gowan5N8K-_DP0e9e_v51obXQ.ttf", "700" => "http://fonts.gstatic.com/s/merriweathersans/v8/6LmGj5dOJopQKEkt88GowbqxG25nQNOioCZSK4sU-CA.ttf", "800" => "http://fonts.gstatic.com/s/merriweathersans/v8/6LmGj5dOJopQKEkt88GowYufzO2zUYSj5LqoJ3UGkco.ttf", "300italic" => "http://fonts.gstatic.com/s/merriweathersans/v8/nAqt4hiqwq3tzCecpgPmVdytE4nGXk2hYD5nJ740tBw.ttf", "regular" => "http://fonts.gstatic.com/s/merriweathersans/v8/AKu1CjQ4qnV8MUltkAX3sOAj_ty82iuwwDTNEYXGiyQ.ttf", "italic" => "http://fonts.gstatic.com/s/merriweathersans/v8/3Mz4hOHzs2npRMG3B1ascZ32VBCoA_HLsn85tSWZmdo.ttf", "700italic" => "http://fonts.gstatic.com/s/merriweathersans/v8/nAqt4hiqwq3tzCecpgPmVbuqAJxizi8Dk_SK5et7kMg.ttf", "800italic" => "http://fonts.gstatic.com/s/merriweathersans/v8/nAqt4hiqwq3tzCecpgPmVdDmPrYMy3aZO4LmnZsxTQw.ttf")), array("kind" => "webfonts#webfont", "family" => "Metal", "category" => "display", "variants" => array("regular"), "subsets" => array("khmer"), "version" => "v9", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/metal/v9/zA3UOP13ooQcxjv04BZX5g.ttf")), array("kind" => "webfonts#webfont", "family" => "Metal Mania", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/metalmania/v6/isriV_rAUgj6bPWPN6l9QKCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Metamorphous", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v6", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/metamorphous/v6/wGqUKXRinIYggz-BTRU9ei3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Metrophobic", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/metrophobic/v6/SaglWZWCrrv_D17u1i4v_aCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Michroma", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/michroma/v7/0c2XrW81_QsiKV8T9thumA.ttf")), array("kind" => "webfonts#webfont", "family" => "Milonga", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/milonga/v4/dzNdIUSTGFmy2ahovDRcWg.ttf")), array("kind" => "webfonts#webfont", "family" => "Miltonian", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v10", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/miltonian/v10/Z4HrYZyqm0BnNNzcCUfzoQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Miltonian Tattoo", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v11", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/miltoniantattoo/v11/1oU_8OGYwW46eh02YHydn2uk0YtI6thZkz1Hmh-odwg.ttf")), array("kind" => "webfonts#webfont", "family" => "Miniver", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/miniver/v5/4yTQohOH_cWKRS5laRFhYg.ttf")), array("kind" => "webfonts#webfont", "family" => "Miriam Libre", "category" => "sans-serif", "variants" => array("regular", "700"), "subsets" => array("latin", "latin-ext", "hebrew"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("700" => "http://fonts.gstatic.com/s/miriamlibre/v1/FLc0J-Gdn8ynDWUkeeesAED2ttfZwueP-QU272T9-k4.ttf", "regular" => "http://fonts.gstatic.com/s/miriamlibre/v1/Ljtpu8zR5iJWmlN3Faba5S3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Mirza", "category" => "display", "variants" => array("regular", "500", "600", "700"), "subsets" => array("latin", "latin-ext", "arabic"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("500" => "http://fonts.gstatic.com/s/mirza/v1/dT3HbZoBCx1xbU7PnFEFyQ.ttf", "600" => "http://fonts.gstatic.com/s/mirza/v1/6T4uh2Zti9P6Eq_gbAYvVQ.ttf", "700" => "http://fonts.gstatic.com/s/mirza/v1/b47CZDHoZdhnplmDpZymFw.ttf", "regular" => "http://fonts.gstatic.com/s/mirza/v1/8oe36Xbgj9BMSLJBaZ8VAQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Miss Fajardose", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/missfajardose/v6/WcXjlQPKn6nBfr8LY3ktNu6rPKfVZo7L2bERcf0BDns.ttf")), array("kind" => "webfonts#webfont", "family" => "Mitr", "category" => "sans-serif", "variants" => array("200", "300", "regular", "500", "600", "700"), "subsets" => array("latin", "thai", "latin-ext", "vietnamese"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("200" => "http://fonts.gstatic.com/s/mitr/v1/GCzZRAhweqJhxrmM0bPztg.ttf", "300" => "http://fonts.gstatic.com/s/mitr/v1/A61rQ_y9i8Ja__oFN7KxiQ.ttf", "500" => "http://fonts.gstatic.com/s/mitr/v1/r_Z6yrJJ0zmkGAqxqjlLRg.ttf", "600" => "http://fonts.gstatic.com/s/mitr/v1/42l66tb_XMxM97GKatU9Ng.ttf", "700" => "http://fonts.gstatic.com/s/mitr/v1/V-V7Rul5HOZ651R4Tml2Lw.ttf", "regular" => "http://fonts.gstatic.com/s/mitr/v1/vKMd72X2iT4iBo5GvdCa_A.ttf")), array("kind" => "webfonts#webfont", "family" => "Modak", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v2", "lastModified" => "2016-05-11", "files" => array("regular" => "http://fonts.gstatic.com/s/modak/v2/lMsN0QIKid-pCPvL0hH4nw.ttf")), array("kind" => "webfonts#webfont", "family" => "Modern Antiqua", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/modernantiqua/v6/8qX_tr6Xzy4t9fvZDXPkh6rFJ4O13IHVxZbM6yoslpo.ttf")), array("kind" => "webfonts#webfont", "family" => "Mogra", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext", "gujarati"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("regular" => "http://fonts.gstatic.com/s/mogra/v1/gIxQBn9PseDaI0D4FnOiBQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Molengo", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/molengo/v7/jcjgeGuzv83I55AzOTpXNQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Molle", "category" => "handwriting", "variants" => array("italic"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("italic" => "http://fonts.gstatic.com/s/molle/v4/9XTdCsjPXifLqo5et-YoGA.ttf")), array("kind" => "webfonts#webfont", "family" => "Monda", "category" => "sans-serif", "variants" => array("regular", "700"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/monda/v4/EVOzZUyc_j1w2GuTgTAW1g.ttf", "regular" => "http://fonts.gstatic.com/s/monda/v4/qFMHZ9zvR6B_gnoIgosPrw.ttf")), array("kind" => "webfonts#webfont", "family" => "Monofett", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/monofett/v6/C6K5L799Rgxzg2brgOaqAw.ttf")), array("kind" => "webfonts#webfont", "family" => "Monoton", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/monoton/v6/aCz8ja_bE4dg-7agSvExdw.ttf")), array("kind" => "webfonts#webfont", "family" => "Monsieur La Doulaise", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/monsieurladoulaise/v5/IMAdMj6Eq9jZ46CPctFtMKP61oAqTJXlx5ZVOBmcPdM.ttf")), array("kind" => "webfonts#webfont", "family" => "Montaga", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/montaga/v4/PwTwUboiD-M4-mFjZfJs2A.ttf")), array("kind" => "webfonts#webfont", "family" => "Montez", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-20", "files" => array("regular" => "http://fonts.gstatic.com/s/montez/v6/kx58rLOWQQLGFM4pDHv5Ng.ttf")), array("kind" => "webfonts#webfont", "family" => "Montserrat", "category" => "sans-serif", "variants" => array("regular", "700"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/montserrat/v7/IQHow_FEYlDC4Gzy_m8fcgJKKGfqHaYFsRG-T3ceEVo.ttf", "regular" => "http://fonts.gstatic.com/s/montserrat/v7/Kqy6-utIpx_30Xzecmeo8_esZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Montserrat Alternates", "category" => "sans-serif", "variants" => array("regular", "700"), "subsets" => array("latin"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/montserratalternates/v4/YENqOGAVzwIHjYNjmKuAZpeqBKvsAhm-s2I4RVSXFfc.ttf", "regular" => "http://fonts.gstatic.com/s/montserratalternates/v4/z2n1Sjxk9souK3HCtdHuklPuEVRGaG9GCQnmM16YWq0.ttf")), array("kind" => "webfonts#webfont", "family" => "Montserrat Subrayada", "category" => "sans-serif", "variants" => array("regular", "700"), "subsets" => array("latin"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/montserratsubrayada/v4/wf-IKpsHcfm0C9uaz9IeGJvEcF1LWArDbGWgKZSH9go.ttf", "regular" => "http://fonts.gstatic.com/s/montserratsubrayada/v4/nzoCWCz0e9c7Mr2Gl8bbgrJymm6ilkk9f0nDA_sC_qk.ttf")), array("kind" => "webfonts#webfont", "family" => "Moul", "category" => "display", "variants" => array("regular"), "subsets" => array("khmer"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/moul/v8/Kb0ALQnfyXawP1a_P_gpTQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Moulpali", "category" => "display", "variants" => array("regular"), "subsets" => array("khmer"), "version" => "v9", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/moulpali/v9/diD74BprGhmVkJoerKmrKA.ttf")), array("kind" => "webfonts#webfont", "family" => "Mountains of Christmas", "category" => "display", "variants" => array("regular", "700"), "subsets" => array("latin"), "version" => "v8", "lastModified" => "2016-06-07", "files" => array("700" => "http://fonts.gstatic.com/s/mountainsofchristmas/v8/PymufKtHszoLrY0uiAYKNM9cPTbSBTrQyTa5TWAe3vE.ttf", "regular" => "http://fonts.gstatic.com/s/mountainsofchristmas/v8/dVGBFPwd6G44IWDbQtPew2Auds3jz1Fxb61CgfaGDr4.ttf")), array("kind" => "webfonts#webfont", "family" => "Mouse Memoirs", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/mousememoirs/v4/NBFaaJFux_j0AQbAsW3QeH8f0n03UdmQgF_CLvNR2vg.ttf")), array("kind" => "webfonts#webfont", "family" => "Mr Bedfort", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/mrbedfort/v5/81bGgHTRikLs_puEGshl7_esZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Mr Dafoe", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/mrdafoe/v5/s32Q1S6ZkT7EaX53mUirvQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Mr De Haviland", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/mrdehaviland/v5/fD8y4L6PJ4vqDk7z8Y8e27v4lrhng1lzu7-weKO6cw8.ttf")), array("kind" => "webfonts#webfont", "family" => "Mrs Saint Delafield", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/mrssaintdelafield/v4/vuWagfFT7bj9lFtZOFBwmjHMBelqWf3tJeGyts2SmKU.ttf")), array("kind" => "webfonts#webfont", "family" => "Mrs Sheppards", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/mrssheppards/v5/2WFsWMV3VUeCz6UVH7UjCn8f0n03UdmQgF_CLvNR2vg.ttf")), array("kind" => "webfonts#webfont", "family" => "Mukta Vaani", "category" => "sans-serif", "variants" => array("200", "300", "regular", "500", "600", "700", "800"), "subsets" => array("latin", "latin-ext", "gujarati"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("200" => "http://fonts.gstatic.com/s/muktavaani/v1/X9qyC4rK_D9w1AvSv0mw_0nzyIngrzGjGh22wPb6cGM.ttf", "300" => "http://fonts.gstatic.com/s/muktavaani/v1/X9qyC4rK_D9w1AvSv0mw_y9-WlPSxbfiI49GsXo3q0g.ttf", "500" => "http://fonts.gstatic.com/s/muktavaani/v1/X9qyC4rK_D9w1AvSv0mw_8CNfqCYlB_eIx7H1TVXe60.ttf", "600" => "http://fonts.gstatic.com/s/muktavaani/v1/X9qyC4rK_D9w1AvSv0mw_5Z7xm-Bj30Bj2KNdXDzSZg.ttf", "700" => "http://fonts.gstatic.com/s/muktavaani/v1/X9qyC4rK_D9w1AvSv0mw_3e1Pd76Vl7zRpE7NLJQ7XU.ttf", "800" => "http://fonts.gstatic.com/s/muktavaani/v1/X9qyC4rK_D9w1AvSv0mw_w89PwPrYLaRFJ-HNCU9NbA.ttf", "regular" => "http://fonts.gstatic.com/s/muktavaani/v1/knS0wTOFNOwOD4CZrdHIxKCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Muli", "category" => "sans-serif", "variants" => array("300", "300italic", "regular", "italic"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("300" => "http://fonts.gstatic.com/s/muli/v7/VJw4F3ZHRAZ7Hmg3nQu5YQ.ttf", "300italic" => "http://fonts.gstatic.com/s/muli/v7/s-NKMCru8HiyjEt0ZDoBoA.ttf", "regular" => "http://fonts.gstatic.com/s/muli/v7/KJiP6KznxbALQgfJcDdPAw.ttf", "italic" => "http://fonts.gstatic.com/s/muli/v7/Cg0K_IWANs9xkNoxV7H1_w.ttf")), array("kind" => "webfonts#webfont", "family" => "Mystery Quest", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/mysteryquest/v4/467jJvg0c7HgucvBB9PLDyeUSrabuTpOsMEiRLtKwk0.ttf")), array("kind" => "webfonts#webfont", "family" => "NTR", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "telugu"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/ntr/v4/e7H4ZLtGfVOYyOupo6T12g.ttf")), array("kind" => "webfonts#webfont", "family" => "Neucha", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("cyrillic", "latin"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/neucha/v8/bijdhB-TzQdtpl0ykhGh4Q.ttf")), array("kind" => "webfonts#webfont", "family" => "Neuton", "category" => "serif", "variants" => array("200", "300", "regular", "italic", "700", "800"), "subsets" => array("latin", "latin-ext"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("200" => "http://fonts.gstatic.com/s/neuton/v8/DA3Mkew3XqSkPpi1f4tJow.ttf", "300" => "http://fonts.gstatic.com/s/neuton/v8/xrc_aZ2hx-gdeV0mlY8Vww.ttf", "700" => "http://fonts.gstatic.com/s/neuton/v8/gnWpkWY7DirkKiovncYrfg.ttf", "800" => "http://fonts.gstatic.com/s/neuton/v8/XPzBQV4lY6enLxQG9cF1jw.ttf", "regular" => "http://fonts.gstatic.com/s/neuton/v8/9R-MGIOQUdjAVeB6nE6PcQ.ttf", "italic" => "http://fonts.gstatic.com/s/neuton/v8/uVMT3JOB5BNFi3lgPp6kEg.ttf")), array("kind" => "webfonts#webfont", "family" => "New Rocker", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/newrocker/v5/EFUWzHJedEkpW399zYOHofesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "News Cycle", "category" => "sans-serif", "variants" => array("regular", "700"), "subsets" => array("latin", "latin-ext"), "version" => "v13", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/newscycle/v13/G28Ny31cr5orMqEQy6ljtwJKKGfqHaYFsRG-T3ceEVo.ttf", "regular" => "http://fonts.gstatic.com/s/newscycle/v13/xyMAr8VfiUzIOvS1abHJO_esZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Niconne", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/niconne/v6/ZA-mFw2QNXodx5y7kfELBg.ttf")), array("kind" => "webfonts#webfont", "family" => "Nixie One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/nixieone/v7/h6kQfmzm0Shdnp3eswRaqQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Nobile", "category" => "sans-serif", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/nobile/v7/9p6M-Yrg_r_QPmSD1skrOg.ttf", "regular" => "http://fonts.gstatic.com/s/nobile/v7/lC_lPi1ddtN38iXTCRh6ow.ttf", "italic" => "http://fonts.gstatic.com/s/nobile/v7/vGmrpKzWQQSrb-PR6FWBIA.ttf", "700italic" => "http://fonts.gstatic.com/s/nobile/v7/oQ1eYPaXV638N03KvsNvyKCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Nokora", "category" => "serif", "variants" => array("regular", "700"), "subsets" => array("khmer"), "version" => "v9", "lastModified" => "2016-05-20", "files" => array("700" => "http://fonts.gstatic.com/s/nokora/v9/QMqqa4QEOhQpiig3cAPmbQ.ttf", "regular" => "http://fonts.gstatic.com/s/nokora/v9/dRyz1JfnyKPNaRcBNX9F9A.ttf")), array("kind" => "webfonts#webfont", "family" => "Norican", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/norican/v4/SHnSqhYAWG5sZTWcPzEHig.ttf")), array("kind" => "webfonts#webfont", "family" => "Nosifer", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/nosifer/v5/7eJGoIuHRrtcG00j6CptSA.ttf")), array("kind" => "webfonts#webfont", "family" => "Nothing You Could Do", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/nothingyoucoulddo/v6/jpk1K3jbJoyoK0XKaSyQAf-TpkXjXYGWiJZAEtBRjPU.ttf")), array("kind" => "webfonts#webfont", "family" => "Noticia Text", "category" => "serif", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("latin", "latin-ext", "vietnamese"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/noticiatext/v6/pEko-RqEtp45bE2P80AAKUD2ttfZwueP-QU272T9-k4.ttf", "regular" => "http://fonts.gstatic.com/s/noticiatext/v6/wdyV6x3eKpdeUPQ7BJ5uUC3USBnSvpkopQaUR-2r7iU.ttf", "italic" => "http://fonts.gstatic.com/s/noticiatext/v6/dAuxVpkYE_Q_IwIm6elsKPMZXuCXbOrAvx5R0IT5Oyo.ttf", "700italic" => "http://fonts.gstatic.com/s/noticiatext/v6/-rQ7V8ARjf28_b7kRa0JuvAs9-1nE9qOqhChW0m4nDE.ttf")), array("kind" => "webfonts#webfont", "family" => "Noto Sans", "category" => "sans-serif", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("cyrillic", "cyrillic-ext", "latin", "devanagari", "greek-ext", "latin-ext", "greek", "vietnamese"), "version" => "v6", "lastModified" => "2016-05-20", "files" => array("700" => "http://fonts.gstatic.com/s/notosans/v6/PIbvSEyHEdL91QLOQRnZ1y3USBnSvpkopQaUR-2r7iU.ttf", "regular" => "http://fonts.gstatic.com/s/notosans/v6/0Ue9FiUJwVhi4NGfHJS5uA.ttf", "italic" => "http://fonts.gstatic.com/s/notosans/v6/dLcNKMgJ1H5RVoZFraDz0qCWcynf_cDxXwCLxiixG1c.ttf", "700italic" => "http://fonts.gstatic.com/s/notosans/v6/9Z3uUWMRR7crzm1TjRicDne1Pd76Vl7zRpE7NLJQ7XU.ttf")), array("kind" => "webfonts#webfont", "family" => "Noto Serif", "category" => "serif", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("cyrillic", "cyrillic-ext", "latin", "greek-ext", "latin-ext", "greek", "vietnamese"), "version" => "v4", "lastModified" => "2016-05-20", "files" => array("700" => "http://fonts.gstatic.com/s/notoserif/v4/lJAvZoKA5NttpPc9yc6lPQJKKGfqHaYFsRG-T3ceEVo.ttf", "regular" => "http://fonts.gstatic.com/s/notoserif/v4/zW6mc7bC1CWw8dH0yxY8JfesZW2xOQ-xsNqO47m55DA.ttf", "italic" => "http://fonts.gstatic.com/s/notoserif/v4/HQXBIwLHsOJCNEQeX9kNzy3USBnSvpkopQaUR-2r7iU.ttf", "700italic" => "http://fonts.gstatic.com/s/notoserif/v4/Wreg0Be4tcFGM2t6VWytvED2ttfZwueP-QU272T9-k4.ttf")), array("kind" => "webfonts#webfont", "family" => "Nova Cut", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/novacut/v8/6q12jWcBvj0KO2cMRP97tA.ttf")), array("kind" => "webfonts#webfont", "family" => "Nova Flat", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/novaflat/v8/pK7a0CoGzI684qe_XSHBqQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Nova Mono", "category" => "monospace", "variants" => array("regular"), "subsets" => array("latin", "greek"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/novamono/v7/6-SChr5ZIaaasJFBkgrLNw.ttf")), array("kind" => "webfonts#webfont", "family" => "Nova Oval", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/novaoval/v8/VuukVpKP8BwUf8o9W5LYQQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Nova Round", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/novaround/v8/7-cK3Ari_8XYYFgVMxVhDvesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Nova Script", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/novascript/v8/dEvxQDLgx1M1TKY-NmBWYaCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Nova Slim", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/novaslim/v8/rPYXC81_VL2EW-4CzBX65g.ttf")), array("kind" => "webfonts#webfont", "family" => "Nova Square", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/novasquare/v8/BcBzXoaDzYX78rquGXVuSqCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Numans", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/numans/v6/g5snI2p6OEjjTNmTHyBdiQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Nunito", "category" => "sans-serif", "variants" => array("300", "regular", "700"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("300" => "http://fonts.gstatic.com/s/nunito/v7/zXQvrWBJqUooM7Xv98MrQw.ttf", "700" => "http://fonts.gstatic.com/s/nunito/v7/aEdlqgMuYbpe4U3TnqOQMA.ttf", "regular" => "http://fonts.gstatic.com/s/nunito/v7/ySZTeT3IuzJj0GK6uGpbBg.ttf")), array("kind" => "webfonts#webfont", "family" => "Odor Mean Chey", "category" => "display", "variants" => array("regular"), "subsets" => array("khmer"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/odormeanchey/v8/GK3E7EjPoBkeZhYshGFo0eVKG8sq4NyGgdteJLvqLDs.ttf")), array("kind" => "webfonts#webfont", "family" => "Offside", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/offside/v4/v0C913SB8wqQUvcu1faUqw.ttf")), array("kind" => "webfonts#webfont", "family" => "Old Standard TT", "category" => "serif", "variants" => array("regular", "italic", "700"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/oldstandardtt/v7/5Ywdce7XEbTSbxs__4X1_HJqbZqK7TdZ58X80Q_Lw8Y.ttf", "regular" => "http://fonts.gstatic.com/s/oldstandardtt/v7/n6RTCDcIPWSE8UNBa4k-DLcB5jyhm1VsHs65c3QNDr0.ttf", "italic" => "http://fonts.gstatic.com/s/oldstandardtt/v7/QQT_AUSp4AV4dpJfIN7U5PWrQzeMtsHf8QsWQ2cZg3c.ttf")), array("kind" => "webfonts#webfont", "family" => "Oldenburg", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/oldenburg/v4/dqA_M_uoCVXZbCO-oKBTnQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Oleo Script", "category" => "display", "variants" => array("regular", "700"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/oleoscript/v5/hudNQFKFl98JdNnlo363fne1Pd76Vl7zRpE7NLJQ7XU.ttf", "regular" => "http://fonts.gstatic.com/s/oleoscript/v5/21stZcmPyzbQVXtmGegyqKCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Oleo Script Swash Caps", "category" => "display", "variants" => array("regular", "700"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/oleoscriptswashcaps/v4/HMO3ftxA9AU5floml9c755reFYaXZ4zuJXJ8fr8OO1g.ttf", "regular" => "http://fonts.gstatic.com/s/oleoscriptswashcaps/v4/vdWhGqsBUAP-FF3NOYTe4iMF4kXAPemmyaDpMXQ31P0.ttf")), array("kind" => "webfonts#webfont", "family" => "Open Sans", "category" => "sans-serif", "variants" => array("300", "300italic", "regular", "italic", "600", "600italic", "700", "700italic", "800", "800italic"), "subsets" => array("cyrillic", "cyrillic-ext", "latin", "greek-ext", "latin-ext", "greek", "vietnamese"), "version" => "v13", "lastModified" => "2016-05-20", "files" => array("300" => "http://fonts.gstatic.com/s/opensans/v13/DXI1ORHCpsQm3Vp6mXoaTS3USBnSvpkopQaUR-2r7iU.ttf", "600" => "http://fonts.gstatic.com/s/opensans/v13/MTP_ySUJH_bn48VBG8sNSi3USBnSvpkopQaUR-2r7iU.ttf", "700" => "http://fonts.gstatic.com/s/opensans/v13/k3k702ZOKiLJc3WVjuplzC3USBnSvpkopQaUR-2r7iU.ttf", "800" => "http://fonts.gstatic.com/s/opensans/v13/EInbV5DfGHOiMmvb1Xr-hi3USBnSvpkopQaUR-2r7iU.ttf", "300italic" => "http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxi9-WlPSxbfiI49GsXo3q0g.ttf", "regular" => "http://fonts.gstatic.com/s/opensans/v13/IgZJs4-7SA1XX_edsoXWog.ttf", "italic" => "http://fonts.gstatic.com/s/opensans/v13/O4NhV7_qs9r9seTo7fnsVKCWcynf_cDxXwCLxiixG1c.ttf", "600italic" => "http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxpZ7xm-Bj30Bj2KNdXDzSZg.ttf", "700italic" => "http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxne1Pd76Vl7zRpE7NLJQ7XU.ttf", "800italic" => "http://fonts.gstatic.com/s/opensans/v13/PRmiXeptR36kaC0GEAetxg89PwPrYLaRFJ-HNCU9NbA.ttf")), array("kind" => "webfonts#webfont", "family" => "Open Sans Condensed", "category" => "sans-serif", "variants" => array("300", "300italic", "700"), "subsets" => array("cyrillic", "cyrillic-ext", "latin", "greek-ext", "latin-ext", "greek", "vietnamese"), "version" => "v10", "lastModified" => "2016-05-20", "files" => array("300" => "http://fonts.gstatic.com/s/opensanscondensed/v10/gk5FxslNkTTHtojXrkp-xEMwSSh38KQVJx4ABtsZTnA.ttf", "700" => "http://fonts.gstatic.com/s/opensanscondensed/v10/gk5FxslNkTTHtojXrkp-xBEM87DM3yorPOrvA-vB930.ttf", "300italic" => "http://fonts.gstatic.com/s/opensanscondensed/v10/jIXlqT1WKafUSwj6s9AzV4_LkTZ_uhAwfmGJ084hlvM.ttf")), array("kind" => "webfonts#webfont", "family" => "Oranienbaum", "category" => "serif", "variants" => array("regular"), "subsets" => array("cyrillic", "cyrillic-ext", "latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/oranienbaum/v5/M98jYwCSn0PaFhXXgviCoaCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Orbitron", "category" => "sans-serif", "variants" => array("regular", "500", "700", "900"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("500" => "http://fonts.gstatic.com/s/orbitron/v7/p-y_ffzMdo5JN_7ia0vYEqCWcynf_cDxXwCLxiixG1c.ttf", "700" => "http://fonts.gstatic.com/s/orbitron/v7/PS9_6SLkY1Y6OgPO3APr6qCWcynf_cDxXwCLxiixG1c.ttf", "900" => "http://fonts.gstatic.com/s/orbitron/v7/2I3-8i9hT294TE_pyjy9SaCWcynf_cDxXwCLxiixG1c.ttf", "regular" => "http://fonts.gstatic.com/s/orbitron/v7/DY8swouAZjR3RaUPRf0HDQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Oregano", "category" => "display", "variants" => array("regular", "italic"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/oregano/v4/UiLhqNixVv2EpjRoBG6axA.ttf", "italic" => "http://fonts.gstatic.com/s/oregano/v4/_iwqGEht6XsAuEaCbYG64Q.ttf")), array("kind" => "webfonts#webfont", "family" => "Orienta", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/orienta/v4/_NKSk93mMs0xsqtfjCsB3Q.ttf")), array("kind" => "webfonts#webfont", "family" => "Original Surfer", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/originalsurfer/v5/gdHw6HpSIN4D6Xt7pi1-qIkEz33TDwAZczo_6fY7eg0.ttf")), array("kind" => "webfonts#webfont", "family" => "Oswald", "category" => "sans-serif", "variants" => array("300", "regular", "700"), "subsets" => array("latin", "latin-ext"), "version" => "v11", "lastModified" => "2016-05-31", "files" => array("300" => "http://fonts.gstatic.com/s/oswald/v11/y3tZpCdiRD4oNRRYFcAR5Q.ttf", "700" => "http://fonts.gstatic.com/s/oswald/v11/7wj8ldV_5Ti37rHa0m1DDw.ttf", "regular" => "http://fonts.gstatic.com/s/oswald/v11/uLEd2g2vJglLPfsBF91DCg.ttf")), array("kind" => "webfonts#webfont", "family" => "Over the Rainbow", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/overtherainbow/v7/6gp-gkpI2kie2dHQQLM2jQBdxkZd83xOSx-PAQ2QmiI.ttf")), array("kind" => "webfonts#webfont", "family" => "Overlock", "category" => "display", "variants" => array("regular", "italic", "700", "700italic", "900", "900italic"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/overlock/v5/Fexr8SqXM8Bm_gEVUA7AKaCWcynf_cDxXwCLxiixG1c.ttf", "900" => "http://fonts.gstatic.com/s/overlock/v5/YPJCVTT8ZbG3899l_-KIGqCWcynf_cDxXwCLxiixG1c.ttf", "regular" => "http://fonts.gstatic.com/s/overlock/v5/Z8oYsGi88-E1cUB8YBFMAg.ttf", "italic" => "http://fonts.gstatic.com/s/overlock/v5/rq6EacukHROOBrFrK_zF6_esZW2xOQ-xsNqO47m55DA.ttf", "700italic" => "http://fonts.gstatic.com/s/overlock/v5/wFWnYgeXKYBks6gEUwYnfAJKKGfqHaYFsRG-T3ceEVo.ttf", "900italic" => "http://fonts.gstatic.com/s/overlock/v5/iOZhxT2zlg7W5ij_lb-oDp0EAVxt0G0biEntp43Qt6E.ttf")), array("kind" => "webfonts#webfont", "family" => "Overlock SC", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/overlocksc/v5/8D7HYDsvS_g1GhBnlHzgzaCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Ovo", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/ovo/v7/mFg27dimu3s9t09qjCwB1g.ttf")), array("kind" => "webfonts#webfont", "family" => "Oxygen", "category" => "sans-serif", "variants" => array("300", "regular", "700"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-06-07", "files" => array("300" => "http://fonts.gstatic.com/s/oxygen/v5/lZ31r0bR1Bzt_DfGZu1S8A.ttf", "700" => "http://fonts.gstatic.com/s/oxygen/v5/yLqkmDwuNtt5pSqsJmhyrg.ttf", "regular" => "http://fonts.gstatic.com/s/oxygen/v5/uhoyAE7XlQL22abzQieHjw.ttf")), array("kind" => "webfonts#webfont", "family" => "Oxygen Mono", "category" => "monospace", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/oxygenmono/v4/DigTu7k4b7OmM8ubt1Qza6CWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "PT Mono", "category" => "monospace", "variants" => array("regular"), "subsets" => array("cyrillic", "cyrillic-ext", "latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/ptmono/v4/QUbM8H9yJK5NhpQ0REO6Wg.ttf")), array("kind" => "webfonts#webfont", "family" => "PT Sans", "category" => "sans-serif", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("cyrillic", "cyrillic-ext", "latin", "latin-ext"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/ptsans/v8/F51BEgHuR0tYHxF0bD4vwvesZW2xOQ-xsNqO47m55DA.ttf", "regular" => "http://fonts.gstatic.com/s/ptsans/v8/UFoEz2uiuMypUGZL1NKoeg.ttf", "italic" => "http://fonts.gstatic.com/s/ptsans/v8/yls9EYWOd496wiu7qzfgNg.ttf", "700italic" => "http://fonts.gstatic.com/s/ptsans/v8/lILlYDvubYemzYzN7GbLkC3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "PT Sans Caption", "category" => "sans-serif", "variants" => array("regular", "700"), "subsets" => array("cyrillic", "cyrillic-ext", "latin", "latin-ext"), "version" => "v9", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/ptsanscaption/v9/Q-gJrFokeE7JydPpxASt25tc0eyfI4QDEsobEEpk_hA.ttf", "regular" => "http://fonts.gstatic.com/s/ptsanscaption/v9/OXYTDOzBcXU8MTNBvBHeSW8by34Z3mUMtM-o4y-SHCY.ttf")), array("kind" => "webfonts#webfont", "family" => "PT Sans Narrow", "category" => "sans-serif", "variants" => array("regular", "700"), "subsets" => array("cyrillic", "cyrillic-ext", "latin", "latin-ext"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/ptsansnarrow/v7/Q_pTky3Sc3ubRibGToTAYsLtdzs3iyjn_YuT226ZsLU.ttf", "regular" => "http://fonts.gstatic.com/s/ptsansnarrow/v7/UyYrYy3ltEffJV9QueSi4ZTvAuddT2xDMbdz0mdLyZY.ttf")), array("kind" => "webfonts#webfont", "family" => "PT Serif", "category" => "serif", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("cyrillic", "cyrillic-ext", "latin", "latin-ext"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/ptserif/v8/kyZw18tqQ5if-_wpmxxOeKCWcynf_cDxXwCLxiixG1c.ttf", "regular" => "http://fonts.gstatic.com/s/ptserif/v8/sAo427rn3-QL9sWCbMZXhA.ttf", "italic" => "http://fonts.gstatic.com/s/ptserif/v8/9khWhKzhpkH0OkNnBKS3n_esZW2xOQ-xsNqO47m55DA.ttf", "700italic" => "http://fonts.gstatic.com/s/ptserif/v8/Foydq9xJp--nfYIx2TBz9QJKKGfqHaYFsRG-T3ceEVo.ttf")), array("kind" => "webfonts#webfont", "family" => "PT Serif Caption", "category" => "serif", "variants" => array("regular", "italic"), "subsets" => array("cyrillic", "cyrillic-ext", "latin", "latin-ext"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/ptserifcaption/v8/7xkFOeTxxO1GMC1suOUYWVsRioCqs5fohhaYel24W3k.ttf", "italic" => "http://fonts.gstatic.com/s/ptserifcaption/v8/0kfPsmrmTSgiec7u_Wa0DB1mqvzPHelJwRcF_s_EUM0.ttf")), array("kind" => "webfonts#webfont", "family" => "Pacifico", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/pacifico/v7/GIrpeRY1r5CzbfL8r182lw.ttf")), array("kind" => "webfonts#webfont", "family" => "Palanquin", "category" => "sans-serif", "variants" => array("100", "200", "300", "regular", "500", "600", "700"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v1", "lastModified" => "2016-05-31", "files" => array("100" => "http://fonts.gstatic.com/s/palanquin/v1/Hu0eGDVGK_g4saUFu6AK3KCWcynf_cDxXwCLxiixG1c.ttf", "200" => "http://fonts.gstatic.com/s/palanquin/v1/pqXYXD7-VI5ezTjeqQOcyC3USBnSvpkopQaUR-2r7iU.ttf", "300" => "http://fonts.gstatic.com/s/palanquin/v1/c0-J5OCAagpFCKkKraz-Ey3USBnSvpkopQaUR-2r7iU.ttf", "500" => "http://fonts.gstatic.com/s/palanquin/v1/wLvvkEcZMKy95afLWh2EfC3USBnSvpkopQaUR-2r7iU.ttf", "600" => "http://fonts.gstatic.com/s/palanquin/v1/405UIAv95_yZkCECrH6y-i3USBnSvpkopQaUR-2r7iU.ttf", "700" => "http://fonts.gstatic.com/s/palanquin/v1/-UtkePo3NFvxEN3rGCtTvi3USBnSvpkopQaUR-2r7iU.ttf", "regular" => "http://fonts.gstatic.com/s/palanquin/v1/xCwBUoAEV0kzCDwerAZ0Aw.ttf")), array("kind" => "webfonts#webfont", "family" => "Palanquin Dark", "category" => "sans-serif", "variants" => array("regular", "500", "600", "700"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v1", "lastModified" => "2016-05-31", "files" => array("500" => "http://fonts.gstatic.com/s/palanquindark/v1/iXyBGf5UbFUu6BG8hOY-maMZTo-EwKMRQt3RWHocLi0.ttf", "600" => "http://fonts.gstatic.com/s/palanquindark/v1/iXyBGf5UbFUu6BG8hOY-mVNxaunw8i4Gywrk2SigRnk.ttf", "700" => "http://fonts.gstatic.com/s/palanquindark/v1/iXyBGf5UbFUu6BG8hOY-mWToair6W0TEE44XrlfKbiM.ttf", "regular" => "http://fonts.gstatic.com/s/palanquindark/v1/PamTqrrgbBh_M3702w39rOfChn3JSg5yz_Q_xmrKQN0.ttf")), array("kind" => "webfonts#webfont", "family" => "Paprika", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/paprika/v4/b-VpyoRSieBdB5BPJVF8HQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Parisienne", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/parisienne/v4/TW74B5QISJNx9moxGlmJfvesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Passero One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v8", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/passeroone/v8/Yc-7nH5deCCv9Ed0MMnAQqCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Passion One", "category" => "display", "variants" => array("regular", "700", "900"), "subsets" => array("latin", "latin-ext"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/passionone/v6/feOcYDy2R-f3Ysy72PYJ2ne1Pd76Vl7zRpE7NLJQ7XU.ttf", "900" => "http://fonts.gstatic.com/s/passionone/v6/feOcYDy2R-f3Ysy72PYJ2ienaqEuufTBk9XMKnKmgDA.ttf", "regular" => "http://fonts.gstatic.com/s/passionone/v6/1UIK1tg3bKJ4J3o35M4heqCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Pathway Gothic One", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/pathwaygothicone/v4/Lqv9ztoTUV8Q0FmQZzPqaA6A6xIYD7vYcYDop1i-K-c.ttf")), array("kind" => "webfonts#webfont", "family" => "Patrick Hand", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext", "vietnamese"), "version" => "v10", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/patrickhand/v10/9BG3JJgt_HlF3NpEUehL0C3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Patrick Hand SC", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext", "vietnamese"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/patrickhandsc/v4/OYFWCgfCR-7uHIovjUZXsbAgSRh1LpJXlLfl8IbsmHg.ttf")), array("kind" => "webfonts#webfont", "family" => "Pattaya", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("cyrillic", "latin", "thai", "latin-ext", "vietnamese"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("regular" => "http://fonts.gstatic.com/s/pattaya/v1/sJEout1xdD7J8H-1H81pIQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Patua One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/patuaone/v6/njZwotTYjswR4qdhsW-kJw.ttf")), array("kind" => "webfonts#webfont", "family" => "Pavanam", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "tamil", "latin-ext"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("regular" => "http://fonts.gstatic.com/s/pavanam/v1/C7yuEhNK5oftNLSL3I0bGw.ttf")), array("kind" => "webfonts#webfont", "family" => "Paytone One", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/paytoneone/v8/3WCxC7JAJjQHQVoIE0ZwvqCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Peddana", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin", "telugu"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/peddana/v4/zaSZuj_GhmC8AOTugOROnA.ttf")), array("kind" => "webfonts#webfont", "family" => "Peralta", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/peralta/v4/cTJX5KEuc0GKRU9NXSm-8Q.ttf")), array("kind" => "webfonts#webfont", "family" => "Permanent Marker", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/permanentmarker/v5/9vYsg5VgPHKK8SXYbf3sMol14xj5tdg9OHF8w4E7StQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Petit Formal Script", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/petitformalscript/v4/OEZwr2-ovBsq2n3ACCKoEvVPl2Gjtxj0D6F7QLy1VQc.ttf")), array("kind" => "webfonts#webfont", "family" => "Petrona", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/petrona/v5/nnQwxlP6dhrGovYEFtemTg.ttf")), array("kind" => "webfonts#webfont", "family" => "Philosopher", "category" => "sans-serif", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("cyrillic", "latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/philosopher/v7/napvkewXG9Gqby5vwGHICHe1Pd76Vl7zRpE7NLJQ7XU.ttf", "regular" => "http://fonts.gstatic.com/s/philosopher/v7/oZLTrB9jmJsyV0u_T0TKEaCWcynf_cDxXwCLxiixG1c.ttf", "italic" => "http://fonts.gstatic.com/s/philosopher/v7/_9Hnc_gz9k7Qq6uKaeHKmUeOrDcLawS7-ssYqLr2Xp4.ttf", "700italic" => "http://fonts.gstatic.com/s/philosopher/v7/PuKlryTcvTj7-qZWfLCFIM_zJjSACmk0BRPxQqhnNLU.ttf")), array("kind" => "webfonts#webfont", "family" => "Piedra", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/piedra/v5/owf-AvEEyAj9LJ2tVZ_3Mw.ttf")), array("kind" => "webfonts#webfont", "family" => "Pinyon Script", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/pinyonscript/v6/TzghnhfCn7TuE73f-CBQ0CeUSrabuTpOsMEiRLtKwk0.ttf")), array("kind" => "webfonts#webfont", "family" => "Pirata One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/pirataone/v4/WnbD86B4vB2ckYcL7oxuhvesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Plaster", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v8", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/plaster/v8/O4QG9Z5116CXyfJdR9zxLw.ttf")), array("kind" => "webfonts#webfont", "family" => "Play", "category" => "sans-serif", "variants" => array("regular", "700"), "subsets" => array("cyrillic", "cyrillic-ext", "latin", "latin-ext", "greek"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/play/v7/crPhg6I0alLI-MpB3vW-zw.ttf", "regular" => "http://fonts.gstatic.com/s/play/v7/GWvfObW8LhtsOX333MCpBg.ttf")), array("kind" => "webfonts#webfont", "family" => "Playball", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/playball/v6/3hOFiQm_EUzycTpcN9uz4w.ttf")), array("kind" => "webfonts#webfont", "family" => "Playfair Display", "category" => "serif", "variants" => array("regular", "italic", "700", "700italic", "900", "900italic"), "subsets" => array("cyrillic", "latin", "latin-ext"), "version" => "v10", "lastModified" => "2016-06-07", "files" => array("700" => "http://fonts.gstatic.com/s/playfairdisplay/v10/UC3ZEjagJi85gF9qFaBgICsv6SrURqJprbhH_C1Mw8w.ttf", "900" => "http://fonts.gstatic.com/s/playfairdisplay/v10/UC3ZEjagJi85gF9qFaBgIKqwMe2wjvZrAR44M0BJZ48.ttf", "regular" => "http://fonts.gstatic.com/s/playfairdisplay/v10/2NBgzUtEeyB-Xtpr9bm1CV6uyC_qD11hrFQ6EGgTJWI.ttf", "italic" => "http://fonts.gstatic.com/s/playfairdisplay/v10/9MkijrV-dEJ0-_NWV7E6NzMsbnvDNEBX25F5HWk9AhI.ttf", "700italic" => "http://fonts.gstatic.com/s/playfairdisplay/v10/n7G4PqJvFP2Kubl0VBLDECsYW3XoOVcYyYdp9NzzS9E.ttf", "900italic" => "http://fonts.gstatic.com/s/playfairdisplay/v10/n7G4PqJvFP2Kubl0VBLDEC0JfJ4xmm7j1kL6D7mPxrA.ttf")), array("kind" => "webfonts#webfont", "family" => "Playfair Display SC", "category" => "serif", "variants" => array("regular", "italic", "700", "700italic", "900", "900italic"), "subsets" => array("cyrillic", "latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-06-07", "files" => array("700" => "http://fonts.gstatic.com/s/playfairdisplaysc/v5/5ggqGkvWJU_TtW2W8cEubA-Amcyomnuy4WsCiPxGHjw.ttf", "900" => "http://fonts.gstatic.com/s/playfairdisplaysc/v5/5ggqGkvWJU_TtW2W8cEubKXL3C32k275YmX_AcBPZ7w.ttf", "regular" => "http://fonts.gstatic.com/s/playfairdisplaysc/v5/G0-tvBxd4eQRdwFKB8dRkcpjYTDWIvcAwAccqeW9uNM.ttf", "italic" => "http://fonts.gstatic.com/s/playfairdisplaysc/v5/myuYiFR-4NTrUT4w6TKls2klJsJYggW8rlNoTOTuau0.ttf", "700italic" => "http://fonts.gstatic.com/s/playfairdisplaysc/v5/6X0OQrQhEEnPo56RalREX4krgPi80XvBcbTwmz-rgmU.ttf", "900italic" => "http://fonts.gstatic.com/s/playfairdisplaysc/v5/6X0OQrQhEEnPo56RalREX8Zag2q3ssKz8uH1RU4a9gs.ttf")), array("kind" => "webfonts#webfont", "family" => "Podkova", "category" => "serif", "variants" => array("regular", "700"), "subsets" => array("latin"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/podkova/v8/SqW4aa8m_KVrOgYSydQ33vesZW2xOQ-xsNqO47m55DA.ttf", "regular" => "http://fonts.gstatic.com/s/podkova/v8/eylljyGVfB8ZUQjYY3WZRQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Poiret One", "category" => "display", "variants" => array("regular"), "subsets" => array("cyrillic", "latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/poiretone/v4/dWcYed048E5gHGDIt8i1CPesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Poller One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/pollerone/v6/dkctmDlTPcZ6boC8662RA_esZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Poly", "category" => "serif", "variants" => array("regular", "italic"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/poly/v7/bcMAuiacS2qkd54BcwW6_Q.ttf", "italic" => "http://fonts.gstatic.com/s/poly/v7/Zkx-eIlZSjKUrPGYhV5PeA.ttf")), array("kind" => "webfonts#webfont", "family" => "Pompiere", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/pompiere/v6/o_va2p9CD5JfmFohAkGZIA.ttf")), array("kind" => "webfonts#webfont", "family" => "Pontano Sans", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/pontanosans/v4/gTHiwyxi6S7iiHpqAoiE3C3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Poppins", "category" => "sans-serif", "variants" => array("300", "regular", "500", "600", "700"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v1", "lastModified" => "2016-06-07", "files" => array("300" => "http://fonts.gstatic.com/s/poppins/v1/VIeViZ2fPtYBt3B2fQZplvesZW2xOQ-xsNqO47m55DA.ttf", "500" => "http://fonts.gstatic.com/s/poppins/v1/4WGKlFyjcmCFVl8pRsgZ9vesZW2xOQ-xsNqO47m55DA.ttf", "600" => "http://fonts.gstatic.com/s/poppins/v1/-zOABrCWORC3lyDh-ajNnPesZW2xOQ-xsNqO47m55DA.ttf", "700" => "http://fonts.gstatic.com/s/poppins/v1/8JitanEsk5aDh7mDYs-fYfesZW2xOQ-xsNqO47m55DA.ttf", "regular" => "http://fonts.gstatic.com/s/poppins/v1/hlvAxH6aIdOjWlLzgm0jqg.ttf")), array("kind" => "webfonts#webfont", "family" => "Port Lligat Sans", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/portlligatsans/v5/CUEdhRk7oC7up0p6t0g4P6mASEpx5X0ZpsuJOuvfOGA.ttf")), array("kind" => "webfonts#webfont", "family" => "Port Lligat Slab", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/portlligatslab/v5/CUEdhRk7oC7up0p6t0g4PxLSPACXvawUYCBEnHsOe30.ttf")), array("kind" => "webfonts#webfont", "family" => "Pragati Narrow", "category" => "sans-serif", "variants" => array("regular", "700"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v2", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/pragatinarrow/v2/DnSI1zRkc0CY-hI5SC3q3MLtdzs3iyjn_YuT226ZsLU.ttf", "regular" => "http://fonts.gstatic.com/s/pragatinarrow/v2/HzG2TfC862qPNsZsV_djPpTvAuddT2xDMbdz0mdLyZY.ttf")), array("kind" => "webfonts#webfont", "family" => "Prata", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/prata/v6/3gmx8r842loRRm9iQkCDGg.ttf")), array("kind" => "webfonts#webfont", "family" => "Preahvihear", "category" => "display", "variants" => array("regular"), "subsets" => array("khmer"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/preahvihear/v8/82tDI-xTc53CxxOzEG4hDaCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Press Start 2P", "category" => "display", "variants" => array("regular"), "subsets" => array("cyrillic", "latin", "latin-ext", "greek"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/pressstart2p/v4/8Lg6LX8-ntOHUQnvQ0E7o1jfl3W46Sz5gOkEVhcFWF4.ttf")), array("kind" => "webfonts#webfont", "family" => "Pridi", "category" => "serif", "variants" => array("200", "300", "regular", "500", "600", "700"), "subsets" => array("latin", "thai", "latin-ext", "vietnamese"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("200" => "http://fonts.gstatic.com/s/pridi/v1/WvKJ-kflGuELyK4uQzpYIA.ttf", "300" => "http://fonts.gstatic.com/s/pridi/v1/Ihwk-OGVFS69PINILdqAjQ.ttf", "500" => "http://fonts.gstatic.com/s/pridi/v1/dPNOrMxU-HjLo-fvkFydsQ.ttf", "600" => "http://fonts.gstatic.com/s/pridi/v1/J0i5OZxX07KC4mby5RjNbg.ttf", "700" => "http://fonts.gstatic.com/s/pridi/v1/UhCy4jDDJttTB8k8rtWadg.ttf", "regular" => "http://fonts.gstatic.com/s/pridi/v1/Mau018Ghi7LJX7FkGYCZAQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Princess Sofia", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/princesssofia/v4/8g5l8r9BM0t1QsXLTajDe-wjmA7ie-lFcByzHGRhCIg.ttf")), array("kind" => "webfonts#webfont", "family" => "Prociono", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/prociono/v6/43ZYDHWogdFeNBWTl6ksmw.ttf")), array("kind" => "webfonts#webfont", "family" => "Prompt", "category" => "sans-serif", "variants" => array("100", "100italic", "200", "200italic", "300", "300italic", "regular", "italic", "500", "500italic", "600", "600italic", "700", "700italic", "800", "800italic", "900", "900italic"), "subsets" => array("latin", "thai", "latin-ext", "vietnamese"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("100" => "http://fonts.gstatic.com/s/prompt/v1/ltjX-trOmfS-yKy_awt70g.ttf", "200" => "http://fonts.gstatic.com/s/prompt/v1/MNB_CVkbfYHFMWX_UbDC2Q.ttf", "300" => "http://fonts.gstatic.com/s/prompt/v1/LzifakiWysr3N3OoAdbdpg.ttf", "500" => "http://fonts.gstatic.com/s/prompt/v1/w31OY1otplAgr5iZ21K7Fg.ttf", "600" => "http://fonts.gstatic.com/s/prompt/v1/uUrJjg1BGaIb6CAOlUIp9g.ttf", "700" => "http://fonts.gstatic.com/s/prompt/v1/HdM_epiStzshOr-49ubVyg.ttf", "800" => "http://fonts.gstatic.com/s/prompt/v1/GF9cOamDd7mYPHNW1nZLKg.ttf", "900" => "http://fonts.gstatic.com/s/prompt/v1/KFgmbwHbRBQb28VFhH3c8Q.ttf", "100italic" => "http://fonts.gstatic.com/s/prompt/v1/KvTeArBpVb-tA2mahV6Jk_esZW2xOQ-xsNqO47m55DA.ttf", "200italic" => "http://fonts.gstatic.com/s/prompt/v1/NR0JuXzzCDKpLNVhfyEAiaCWcynf_cDxXwCLxiixG1c.ttf", "300italic" => "http://fonts.gstatic.com/s/prompt/v1/ir8BhbeDHM-qnbo-tnpmt6CWcynf_cDxXwCLxiixG1c.ttf", "regular" => "http://fonts.gstatic.com/s/prompt/v1/nDo1rQFnTFNua4cp-OnD2A.ttf", "italic" => "http://fonts.gstatic.com/s/prompt/v1/ZD4khIP924SU2fRYOJkraQ.ttf", "500italic" => "http://fonts.gstatic.com/s/prompt/v1/dfaeaRx00u9arVHsaDjliaCWcynf_cDxXwCLxiixG1c.ttf", "600italic" => "http://fonts.gstatic.com/s/prompt/v1/CJUBMsoNNHMMdFRxm-n7p6CWcynf_cDxXwCLxiixG1c.ttf", "700italic" => "http://fonts.gstatic.com/s/prompt/v1/GtXRH7QWy3aLCHoJuR5WIKCWcynf_cDxXwCLxiixG1c.ttf", "800italic" => "http://fonts.gstatic.com/s/prompt/v1/kBLgnnEB-VXkOLFCc0pzwqCWcynf_cDxXwCLxiixG1c.ttf", "900italic" => "http://fonts.gstatic.com/s/prompt/v1/qjrOe-lEPwDDeUu5g6q_DaCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Prosto One", "category" => "display", "variants" => array("regular"), "subsets" => array("cyrillic", "latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/prostoone/v5/bsqnAElAqk9kX7eABTRFJPesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Proza Libre", "category" => "sans-serif", "variants" => array("regular", "italic", "500", "500italic", "600", "600italic", "700", "700italic", "800", "800italic"), "subsets" => array("latin", "latin-ext"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("500" => "http://fonts.gstatic.com/s/prozalibre/v1/4gjxWDPA6RMWrIls_qgQBsCNfqCYlB_eIx7H1TVXe60.ttf", "600" => "http://fonts.gstatic.com/s/prozalibre/v1/4gjxWDPA6RMWrIls_qgQBpZ7xm-Bj30Bj2KNdXDzSZg.ttf", "700" => "http://fonts.gstatic.com/s/prozalibre/v1/4gjxWDPA6RMWrIls_qgQBne1Pd76Vl7zRpE7NLJQ7XU.ttf", "800" => "http://fonts.gstatic.com/s/prozalibre/v1/4gjxWDPA6RMWrIls_qgQBg89PwPrYLaRFJ-HNCU9NbA.ttf", "regular" => "http://fonts.gstatic.com/s/prozalibre/v1/Hg11OrfE1P_U6mKmrZPknKCWcynf_cDxXwCLxiixG1c.ttf", "italic" => "http://fonts.gstatic.com/s/prozalibre/v1/ClQTew5IUT7yKo8vyspLxEeOrDcLawS7-ssYqLr2Xp4.ttf", "500italic" => "http://fonts.gstatic.com/s/prozalibre/v1/rWq3Qp4ZlPGKduc1qkgLHGnWRcJAYo5PSCx8UfGMHCI.ttf", "600italic" => "http://fonts.gstatic.com/s/prozalibre/v1/rWq3Qp4ZlPGKduc1qkgLHJe6We3S5L6hKLscKpOkmlo.ttf", "700italic" => "http://fonts.gstatic.com/s/prozalibre/v1/rWq3Qp4ZlPGKduc1qkgLHM_zJjSACmk0BRPxQqhnNLU.ttf", "800italic" => "http://fonts.gstatic.com/s/prozalibre/v1/rWq3Qp4ZlPGKduc1qkgLHCad_7rtf4IdDfsLVg-2OV4.ttf")), array("kind" => "webfonts#webfont", "family" => "Puritan", "category" => "sans-serif", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("latin"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/puritan/v8/pJS2SdwI0SCiVnO0iQSFT_esZW2xOQ-xsNqO47m55DA.ttf", "regular" => "http://fonts.gstatic.com/s/puritan/v8/wv_RtgVBSCn-or2MC0n4Kg.ttf", "italic" => "http://fonts.gstatic.com/s/puritan/v8/BqZX8Tp200LeMv1KlzXgLQ.ttf", "700italic" => "http://fonts.gstatic.com/s/puritan/v8/rFG3XkMJL75nUNZwCEIJqC3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Purple Purse", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/purplepurse/v5/Q5heFUrdmei9axbMITxxxS3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Quando", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/quando/v5/03nDiEZuO2-h3xvtG6UmHg.ttf")), array("kind" => "webfonts#webfont", "family" => "Quantico", "category" => "sans-serif", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/quantico/v5/OVZZzjcZ3Hkq2ojVcUtDjaCWcynf_cDxXwCLxiixG1c.ttf", "regular" => "http://fonts.gstatic.com/s/quantico/v5/pwSnP8Xpaix2rIz99HrSlQ.ttf", "italic" => "http://fonts.gstatic.com/s/quantico/v5/KQhDd2OsZi6HiITUeFQ2U_esZW2xOQ-xsNqO47m55DA.ttf", "700italic" => "http://fonts.gstatic.com/s/quantico/v5/HeCYRcZbdRso3ZUu01ELbQJKKGfqHaYFsRG-T3ceEVo.ttf")), array("kind" => "webfonts#webfont", "family" => "Quattrocento", "category" => "serif", "variants" => array("regular", "700"), "subsets" => array("latin", "latin-ext"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/quattrocento/v8/Uvi-cRwyvqFpl9j3oT2mqkD2ttfZwueP-QU272T9-k4.ttf", "regular" => "http://fonts.gstatic.com/s/quattrocento/v8/WZDISdyil4HsmirlOdBRFC3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Quattrocento Sans", "category" => "sans-serif", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("latin", "latin-ext"), "version" => "v9", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/quattrocentosans/v9/tXSgPxDl7Lk8Zr_5qX8FIbqxG25nQNOioCZSK4sU-CA.ttf", "regular" => "http://fonts.gstatic.com/s/quattrocentosans/v9/efd6FGWWGX5Z3ztwLBrG9eAj_ty82iuwwDTNEYXGiyQ.ttf", "italic" => "http://fonts.gstatic.com/s/quattrocentosans/v9/8PXYbvM__bjl0rBnKiByg532VBCoA_HLsn85tSWZmdo.ttf", "700italic" => "http://fonts.gstatic.com/s/quattrocentosans/v9/8N1PdXpbG6RtFvTjl-5E7buqAJxizi8Dk_SK5et7kMg.ttf")), array("kind" => "webfonts#webfont", "family" => "Questrial", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/questrial/v6/MoHHaw_WwNs_hd9ob1zTVw.ttf")), array("kind" => "webfonts#webfont", "family" => "Quicksand", "category" => "sans-serif", "variants" => array("300", "regular", "700"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("300" => "http://fonts.gstatic.com/s/quicksand/v5/qhfoJiLu10kFjChCCTvGlC3USBnSvpkopQaUR-2r7iU.ttf", "700" => "http://fonts.gstatic.com/s/quicksand/v5/32nyIRHyCu6iqEka_hbKsi3USBnSvpkopQaUR-2r7iU.ttf", "regular" => "http://fonts.gstatic.com/s/quicksand/v5/Ngv3fIJjKB7sD-bTUGIFCA.ttf")), array("kind" => "webfonts#webfont", "family" => "Quintessential", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/quintessential/v4/mmk6ioesnTrEky_Zb92E5s02lXbtMOtZWfuxKeMZO8Q.ttf")), array("kind" => "webfonts#webfont", "family" => "Qwigley", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/qwigley/v6/aDqxws-KubFID85TZHFouw.ttf")), array("kind" => "webfonts#webfont", "family" => "Racing Sans One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/racingsansone/v4/1r3DpWaCiT7y3PD4KgkNyDjVlsJB_M_Q_LtZxsoxvlw.ttf")), array("kind" => "webfonts#webfont", "family" => "Radley", "category" => "serif", "variants" => array("regular", "italic"), "subsets" => array("latin", "latin-ext"), "version" => "v9", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/radley/v9/FgE9di09a-mXGzAIyI6Q9Q.ttf", "italic" => "http://fonts.gstatic.com/s/radley/v9/Z_JcACuPAOO2f9kzQcGRug.ttf")), array("kind" => "webfonts#webfont", "family" => "Rajdhani", "category" => "sans-serif", "variants" => array("300", "regular", "500", "600", "700"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v5", "lastModified" => "2016-06-07", "files" => array("300" => "http://fonts.gstatic.com/s/rajdhani/v5/9pItuEhQZVGdq8spnHTku6CWcynf_cDxXwCLxiixG1c.ttf", "500" => "http://fonts.gstatic.com/s/rajdhani/v5/nd_5ZpVwm710HcLual0fBqCWcynf_cDxXwCLxiixG1c.ttf", "600" => "http://fonts.gstatic.com/s/rajdhani/v5/5fnmZahByDeTtgxIiqbJSaCWcynf_cDxXwCLxiixG1c.ttf", "700" => "http://fonts.gstatic.com/s/rajdhani/v5/UBK6d2Hg7X7wYLlF92aXW6CWcynf_cDxXwCLxiixG1c.ttf", "regular" => "http://fonts.gstatic.com/s/rajdhani/v5/Wfy5zp4PGFAFS7-Wetehzw.ttf")), array("kind" => "webfonts#webfont", "family" => "Rakkas", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext", "arabic"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("regular" => "http://fonts.gstatic.com/s/rakkas/v1/XWSZpoSbAR4myQgKbSJM9A.ttf")), array("kind" => "webfonts#webfont", "family" => "Raleway", "category" => "sans-serif", "variants" => array("100", "100italic", "200", "200italic", "300", "300italic", "regular", "italic", "500", "500italic", "600", "600italic", "700", "700italic", "800", "800italic", "900", "900italic"), "subsets" => array("latin", "latin-ext"), "version" => "v11", "lastModified" => "2016-06-07", "files" => array("100" => "http://fonts.gstatic.com/s/raleway/v11/UDfD6oxBaBnmFJwQ7XAFNw.ttf", "200" => "http://fonts.gstatic.com/s/raleway/v11/LAQwev4hdCtYkOYX4Oc7nPesZW2xOQ-xsNqO47m55DA.ttf", "300" => "http://fonts.gstatic.com/s/raleway/v11/2VvSZU2kb4DZwFfRM4fLQPesZW2xOQ-xsNqO47m55DA.ttf", "500" => "http://fonts.gstatic.com/s/raleway/v11/348gn6PEmbLDWlHbbV15d_esZW2xOQ-xsNqO47m55DA.ttf", "600" => "http://fonts.gstatic.com/s/raleway/v11/M7no6oPkwKYJkedjB1wqEvesZW2xOQ-xsNqO47m55DA.ttf", "700" => "http://fonts.gstatic.com/s/raleway/v11/VGEV9-DrblisWOWLbK-1XPesZW2xOQ-xsNqO47m55DA.ttf", "800" => "http://fonts.gstatic.com/s/raleway/v11/mMh0JrsYMXcLO69jgJwpUvesZW2xOQ-xsNqO47m55DA.ttf", "900" => "http://fonts.gstatic.com/s/raleway/v11/ajQQGcDBLcyLpaUfD76UuPesZW2xOQ-xsNqO47m55DA.ttf", "100italic" => "http://fonts.gstatic.com/s/raleway/v11/hUpHtml6IPNuUR-FwVi2UKCWcynf_cDxXwCLxiixG1c.ttf", "200italic" => "http://fonts.gstatic.com/s/raleway/v11/N2DIbZG4399cPGfifZUEQi3USBnSvpkopQaUR-2r7iU.ttf", "300italic" => "http://fonts.gstatic.com/s/raleway/v11/TVSB8ogXDKMcnAAJ5CqrUi3USBnSvpkopQaUR-2r7iU.ttf", "regular" => "http://fonts.gstatic.com/s/raleway/v11/_dCzxpXzIS3sL-gdJWAP8A.ttf", "italic" => "http://fonts.gstatic.com/s/raleway/v11/utU2m1gdZSfuQpArSy5Dbw.ttf", "500italic" => "http://fonts.gstatic.com/s/raleway/v11/S7vGLZZ40c85SJgiptJGVy3USBnSvpkopQaUR-2r7iU.ttf", "600italic" => "http://fonts.gstatic.com/s/raleway/v11/OY22yoG8EJ3IN_muVWm29C3USBnSvpkopQaUR-2r7iU.ttf", "700italic" => "http://fonts.gstatic.com/s/raleway/v11/lFxvRPuGFG5ktd7P0WRwKi3USBnSvpkopQaUR-2r7iU.ttf", "800italic" => "http://fonts.gstatic.com/s/raleway/v11/us4LjTCmlYgh3W8CKujEJi3USBnSvpkopQaUR-2r7iU.ttf", "900italic" => "http://fonts.gstatic.com/s/raleway/v11/oY2RadnkHfshu5f0FLsgVS3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Raleway Dots", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/ralewaydots/v4/lhLgmWCRcyz-QXo8LCzTfC3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Ramabhadra", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "telugu"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/ramabhadra/v5/JyhxLXRVQChLDGADS_c5MPesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Ramaraja", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin", "telugu"), "version" => "v1", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/ramaraja/v1/XIqzxFapVczstBedHdQTiw.ttf")), array("kind" => "webfonts#webfont", "family" => "Rambla", "category" => "sans-serif", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/rambla/v4/C5VZH8BxQKmnBuoC00UPpw.ttf", "regular" => "http://fonts.gstatic.com/s/rambla/v4/YaTmpvm5gFg_ShJKTQmdzg.ttf", "italic" => "http://fonts.gstatic.com/s/rambla/v4/mhUgsKmp0qw3uATdDDAuwA.ttf", "700italic" => "http://fonts.gstatic.com/s/rambla/v4/ziMzUZya6QahrKONSI1TzqCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Rammetto One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/rammettoone/v5/mh0uQ1tV8QgSx9v_KyEYPC3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Ranchers", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/ranchers/v4/9ya8CZYhqT66VERfjQ7eLA.ttf")), array("kind" => "webfonts#webfont", "family" => "Rancho", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/rancho/v6/ekp3-4QykC4--6KaslRgHA.ttf")), array("kind" => "webfonts#webfont", "family" => "Ranga", "category" => "display", "variants" => array("regular", "700"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v1", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/ranga/v1/h8G_gEUH7vHKH-NkjAs34A.ttf", "regular" => "http://fonts.gstatic.com/s/ranga/v1/xpW6zFTNzY1JykoBIqE1Zg.ttf")), array("kind" => "webfonts#webfont", "family" => "Rasa", "category" => "serif", "variants" => array("300", "regular", "500", "600", "700"), "subsets" => array("latin", "latin-ext", "gujarati"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("300" => "http://fonts.gstatic.com/s/rasa/v1/XQ1gDq2EqBtGcdadPyPbww.ttf", "500" => "http://fonts.gstatic.com/s/rasa/v1/HfsDi_Ls3NARO_YEODINGg.ttf", "600" => "http://fonts.gstatic.com/s/rasa/v1/f-fvbq-hWIQCdmT3QHGk3Q.ttf", "700" => "http://fonts.gstatic.com/s/rasa/v1/TSF3CG-8Cn72jvaVdqtMMQ.ttf", "regular" => "http://fonts.gstatic.com/s/rasa/v1/A5PoJUwX_PxTsywxlRB79g.ttf")), array("kind" => "webfonts#webfont", "family" => "Rationale", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/rationale/v7/7M2eN-di0NGLQse7HzJRfg.ttf")), array("kind" => "webfonts#webfont", "family" => "Ravi Prakash", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "telugu"), "version" => "v3", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/raviprakash/v3/8EzbM7Rymjk25jWeHxbO6C3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Redressed", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-20", "files" => array("regular" => "http://fonts.gstatic.com/s/redressed/v6/3aZ5sTBppH3oSm5SabegtA.ttf")), array("kind" => "webfonts#webfont", "family" => "Reem Kufi", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "arabic"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("regular" => "http://fonts.gstatic.com/s/reemkufi/v1/xLwMbK_T1g-h9p-rp60A1Q.ttf")), array("kind" => "webfonts#webfont", "family" => "Reenie Beanie", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/reeniebeanie/v7/ljpKc6CdXusL1cnGUSamX4jjx0o0jr6fNXxPgYh_a8Q.ttf")), array("kind" => "webfonts#webfont", "family" => "Revalia", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/revalia/v4/1TKw66fF5_poiL0Ktgo4_A.ttf")), array("kind" => "webfonts#webfont", "family" => "Rhodium Libre", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v1", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/rhodiumlibre/v1/Vxr7A4-xE2zsBDDI8BcseIjjx0o0jr6fNXxPgYh_a8Q.ttf")), array("kind" => "webfonts#webfont", "family" => "Ribeye", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/ribeye/v5/e5w3VE8HnWBln4Ll6lUj3Q.ttf")), array("kind" => "webfonts#webfont", "family" => "Ribeye Marrow", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/ribeyemarrow/v6/q7cBSA-4ErAXBCDFPrhlY0cTNmV93fYG7UKgsLQNQWs.ttf")), array("kind" => "webfonts#webfont", "family" => "Righteous", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/righteous/v5/0nRRWM_gCGCt2S-BCfN8WQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Risque", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/risque/v4/92RnElGnl8yHP97-KV3Fyg.ttf")), array("kind" => "webfonts#webfont", "family" => "Roboto", "category" => "sans-serif", "variants" => array("100", "100italic", "300", "300italic", "regular", "italic", "500", "500italic", "700", "700italic", "900", "900italic"), "subsets" => array("cyrillic", "cyrillic-ext", "latin", "greek-ext", "latin-ext", "greek", "vietnamese"), "version" => "v15", "lastModified" => "2016-06-07", "files" => array("100" => "http://fonts.gstatic.com/s/roboto/v15/7MygqTe2zs9YkP0adA9QQQ.ttf", "300" => "http://fonts.gstatic.com/s/roboto/v15/dtpHsbgPEm2lVWciJZ0P-A.ttf", "500" => "http://fonts.gstatic.com/s/roboto/v15/Uxzkqj-MIMWle-XP2pDNAA.ttf", "700" => "http://fonts.gstatic.com/s/roboto/v15/bdHGHleUa-ndQCOrdpfxfw.ttf", "900" => "http://fonts.gstatic.com/s/roboto/v15/H1vB34nOKWXqzKotq25pcg.ttf", "100italic" => "http://fonts.gstatic.com/s/roboto/v15/T1xnudodhcgwXCmZQ490TPesZW2xOQ-xsNqO47m55DA.ttf", "300italic" => "http://fonts.gstatic.com/s/roboto/v15/iE8HhaRzdhPxC93dOdA056CWcynf_cDxXwCLxiixG1c.ttf", "regular" => "http://fonts.gstatic.com/s/roboto/v15/W5F8_SL0XFawnjxHGsZjJA.ttf", "italic" => "http://fonts.gstatic.com/s/roboto/v15/hcKoSgxdnKlbH5dlTwKbow.ttf", "500italic" => "http://fonts.gstatic.com/s/roboto/v15/daIfzbEw-lbjMyv4rMUUTqCWcynf_cDxXwCLxiixG1c.ttf", "700italic" => "http://fonts.gstatic.com/s/roboto/v15/owYYXKukxFDFjr0ZO8NXh6CWcynf_cDxXwCLxiixG1c.ttf", "900italic" => "http://fonts.gstatic.com/s/roboto/v15/b9PWBSMHrT2zM5FgUdtu0aCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Roboto Condensed", "category" => "sans-serif", "variants" => array("300", "300italic", "regular", "italic", "700", "700italic"), "subsets" => array("cyrillic", "cyrillic-ext", "latin", "greek-ext", "latin-ext", "greek", "vietnamese"), "version" => "v13", "lastModified" => "2016-06-07", "files" => array("300" => "http://fonts.gstatic.com/s/robotocondensed/v13/b9QBgL0iMZfDSpmcXcE8nJRhFVcex_hajThhFkHyhYk.ttf", "700" => "http://fonts.gstatic.com/s/robotocondensed/v13/b9QBgL0iMZfDSpmcXcE8nPOYkGiSOYDq_T7HbIOV1hA.ttf", "300italic" => "http://fonts.gstatic.com/s/robotocondensed/v13/mg0cGfGRUERshzBlvqxeAPYa9bgCHecWXGgisnodcS0.ttf", "regular" => "http://fonts.gstatic.com/s/robotocondensed/v13/Zd2E9abXLFGSr9G3YK2MsKDbm6fPDOZJsR8PmdG62gY.ttf", "italic" => "http://fonts.gstatic.com/s/robotocondensed/v13/BP5K8ZAJv9qEbmuFp8RpJY_eiqgTfYGaH0bJiUDZ5GA.ttf", "700italic" => "http://fonts.gstatic.com/s/robotocondensed/v13/mg0cGfGRUERshzBlvqxeAE2zk2RGRC3SlyyLLQfjS_8.ttf")), array("kind" => "webfonts#webfont", "family" => "Roboto Mono", "category" => "monospace", "variants" => array("100", "100italic", "300", "300italic", "regular", "italic", "500", "500italic", "700", "700italic"), "subsets" => array("cyrillic", "cyrillic-ext", "latin", "greek-ext", "latin-ext", "greek", "vietnamese"), "version" => "v4", "lastModified" => "2016-06-07", "files" => array("100" => "http://fonts.gstatic.com/s/robotomono/v4/aOIeRp72J9_Hp_8KwQ9M-YAWxXGWZ3yJw6KhWS7MxOk.ttf", "300" => "http://fonts.gstatic.com/s/robotomono/v4/N4duVc9C58uwPiY8_59Fzy9-WlPSxbfiI49GsXo3q0g.ttf", "500" => "http://fonts.gstatic.com/s/robotomono/v4/N4duVc9C58uwPiY8_59Fz8CNfqCYlB_eIx7H1TVXe60.ttf", "700" => "http://fonts.gstatic.com/s/robotomono/v4/N4duVc9C58uwPiY8_59Fz3e1Pd76Vl7zRpE7NLJQ7XU.ttf", "100italic" => "http://fonts.gstatic.com/s/robotomono/v4/rqQ1zSE-ZGCKVZgew-A9dgyDtfpXZi-8rXUZYR4dumU.ttf", "300italic" => "http://fonts.gstatic.com/s/robotomono/v4/1OsMuiiO6FCF2x67vzDKA2o9eWDfYYxG3A176Zl7aIg.ttf", "regular" => "http://fonts.gstatic.com/s/robotomono/v4/eJ4cxQe85Lo39t-LVoKa26CWcynf_cDxXwCLxiixG1c.ttf", "italic" => "http://fonts.gstatic.com/s/robotomono/v4/mE0EPT_93c7f86_WQexR3EeOrDcLawS7-ssYqLr2Xp4.ttf", "500italic" => "http://fonts.gstatic.com/s/robotomono/v4/1OsMuiiO6FCF2x67vzDKA2nWRcJAYo5PSCx8UfGMHCI.ttf", "700italic" => "http://fonts.gstatic.com/s/robotomono/v4/1OsMuiiO6FCF2x67vzDKA8_zJjSACmk0BRPxQqhnNLU.ttf")), array("kind" => "webfonts#webfont", "family" => "Roboto Slab", "category" => "serif", "variants" => array("100", "300", "regular", "700"), "subsets" => array("cyrillic", "cyrillic-ext", "latin", "greek-ext", "latin-ext", "greek", "vietnamese"), "version" => "v6", "lastModified" => "2016-05-20", "files" => array("100" => "http://fonts.gstatic.com/s/robotoslab/v6/MEz38VLIFL-t46JUtkIEgIAWxXGWZ3yJw6KhWS7MxOk.ttf", "300" => "http://fonts.gstatic.com/s/robotoslab/v6/dazS1PrQQuCxC3iOAJFEJS9-WlPSxbfiI49GsXo3q0g.ttf", "700" => "http://fonts.gstatic.com/s/robotoslab/v6/dazS1PrQQuCxC3iOAJFEJXe1Pd76Vl7zRpE7NLJQ7XU.ttf", "regular" => "http://fonts.gstatic.com/s/robotoslab/v6/3__ulTNA7unv0UtplybPiqCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Rochester", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-20", "files" => array("regular" => "http://fonts.gstatic.com/s/rochester/v6/bnj8tmQBiOkdji_G_yvypg.ttf")), array("kind" => "webfonts#webfont", "family" => "Rock Salt", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/rocksalt/v6/Zy7JF9h9WbhD9V3SFMQ1UQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Rokkitt", "category" => "serif", "variants" => array("regular", "700"), "subsets" => array("latin"), "version" => "v10", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/rokkitt/v10/gxlo-sr3rPmvgSixYog_ofesZW2xOQ-xsNqO47m55DA.ttf", "regular" => "http://fonts.gstatic.com/s/rokkitt/v10/GMA7Z_ToF8uSvpZAgnp_VQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Romanesco", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/romanesco/v5/2udIjUrpK_CPzYSxRVzD4Q.ttf")), array("kind" => "webfonts#webfont", "family" => "Ropa Sans", "category" => "sans-serif", "variants" => array("regular", "italic"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/ropasans/v5/Gba7ZzVBuhg6nX_AoSwlkQ.ttf", "italic" => "http://fonts.gstatic.com/s/ropasans/v5/V1zbhZQscNrh63dy5Jk2nqCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Rosario", "category" => "sans-serif", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("latin"), "version" => "v11", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/rosario/v11/nrS6PJvDWN42RP4TFWccd_esZW2xOQ-xsNqO47m55DA.ttf", "regular" => "http://fonts.gstatic.com/s/rosario/v11/bL-cEh8dXtDupB2WccA2LA.ttf", "italic" => "http://fonts.gstatic.com/s/rosario/v11/pkflNy18HEuVVx4EOjeb_Q.ttf", "700italic" => "http://fonts.gstatic.com/s/rosario/v11/EOgFX2Va5VGrkhn_eDpIRS3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Rosarivo", "category" => "serif", "variants" => array("regular", "italic"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/rosarivo/v4/EmPiINK0qyqc7KSsNjJamA.ttf", "italic" => "http://fonts.gstatic.com/s/rosarivo/v4/u3VuWsWQlX1pDqsbz4paNPesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Rouge Script", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/rougescript/v5/AgXDSqZJmy12qS0ixjs6Vy3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Rozha One", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v2", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/rozhaone/v2/PyrMHQ6lucEIxwKmhqsX8A.ttf")), array("kind" => "webfonts#webfont", "family" => "Rubik", "category" => "sans-serif", "variants" => array("300", "300italic", "regular", "italic", "500", "500italic", "700", "700italic", "900", "900italic"), "subsets" => array("cyrillic", "latin", "latin-ext", "hebrew"), "version" => "v2", "lastModified" => "2016-06-02", "files" => array("300" => "http://fonts.gstatic.com/s/rubik/v2/o1vXYO8YwDpErHEAPAxpOg.ttf", "500" => "http://fonts.gstatic.com/s/rubik/v2/D4HihERG27s-BJrQ4dvkbw.ttf", "700" => "http://fonts.gstatic.com/s/rubik/v2/m1GGHcpLe6Mb0_sAyjXE4g.ttf", "900" => "http://fonts.gstatic.com/s/rubik/v2/mOHfPRl5uP4vw7-5-dbnng.ttf", "300italic" => "http://fonts.gstatic.com/s/rubik/v2/NyXDvUhvZLSWiVfGa5KM-vesZW2xOQ-xsNqO47m55DA.ttf", "regular" => "http://fonts.gstatic.com/s/rubik/v2/4sMyW_teKWHB3K8Hm-Il6A.ttf", "italic" => "http://fonts.gstatic.com/s/rubik/v2/elD65ddI0qvNcCh42b1Iqg.ttf", "500italic" => "http://fonts.gstatic.com/s/rubik/v2/0hcxMdoMbXtHiEM1ebdN6PesZW2xOQ-xsNqO47m55DA.ttf", "700italic" => "http://fonts.gstatic.com/s/rubik/v2/R4g_rs714cUXVZcdnRdHw_esZW2xOQ-xsNqO47m55DA.ttf", "900italic" => "http://fonts.gstatic.com/s/rubik/v2/HH1b7kBbwInqlw8OQxRE5vesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Rubik Mono One", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("cyrillic", "latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/rubikmonoone/v5/e_cupPtD4BrZzotubJD7UbAREgn5xbW23GEXXnhMQ5Y.ttf")), array("kind" => "webfonts#webfont", "family" => "Rubik One", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("cyrillic", "latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/rubikone/v4/Zs6TtctNRSIR8T5PO018rQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Ruda", "category" => "sans-serif", "variants" => array("regular", "700", "900"), "subsets" => array("latin", "latin-ext"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/ruda/v7/JABOu1SYOHcGXVejUq4w6g.ttf", "900" => "http://fonts.gstatic.com/s/ruda/v7/Uzusv-enCjoIrznlJJaBRw.ttf", "regular" => "http://fonts.gstatic.com/s/ruda/v7/jPEIPB7DM2DNK_uBGv2HGw.ttf")), array("kind" => "webfonts#webfont", "family" => "Rufina", "category" => "serif", "variants" => array("regular", "700"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/rufina/v4/D0RUjXFr55y4MVZY2Ww_RA.ttf", "regular" => "http://fonts.gstatic.com/s/rufina/v4/s9IFr_fIemiohfZS-ZRDbQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Ruge Boogie", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/rugeboogie/v7/U-TTmltL8aENLVIqYbI5QaCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Ruluko", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/ruluko/v4/lv4cMwJtrx_dzmlK5SDc1g.ttf")), array("kind" => "webfonts#webfont", "family" => "Rum Raisin", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/rumraisin/v4/kDiL-ntDOEq26B7kYM7cx_esZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Ruslan Display", "category" => "display", "variants" => array("regular"), "subsets" => array("cyrillic", "latin", "latin-ext"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/ruslandisplay/v7/SREdhlyLNUfU1VssRBfs3rgH88D3l9N4auRNHrNS708.ttf")), array("kind" => "webfonts#webfont", "family" => "Russo One", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("cyrillic", "latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/russoone/v5/zfwxZ--UhUc7FVfgT21PRQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Ruthie", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/ruthie/v6/vJ2LorukHSbWYoEs5juivg.ttf")), array("kind" => "webfonts#webfont", "family" => "Rye", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/rye/v4/VUrJlpPpSZxspl3w_yNOrQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Sacramento", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/sacramento/v4/_kv-qycSHMNdhjiv0Kj7BvesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Sahitya", "category" => "serif", "variants" => array("regular", "700"), "subsets" => array("latin", "devanagari"), "version" => "v1", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/sahitya/v1/Zm5hNvMwUyN3tC4GMkH1l_esZW2xOQ-xsNqO47m55DA.ttf", "regular" => "http://fonts.gstatic.com/s/sahitya/v1/wQWULcDbZqljdTfjOUtDvw.ttf")), array("kind" => "webfonts#webfont", "family" => "Sail", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/sail/v7/iuEoG6kt-bePGvtdpL0GUQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Salsa", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/salsa/v6/BnpUCBmYdvggScEPs5JbpA.ttf")), array("kind" => "webfonts#webfont", "family" => "Sanchez", "category" => "serif", "variants" => array("regular", "italic"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/sanchez/v4/BEL8ao-E2LJ5eHPLB2UAiw.ttf", "italic" => "http://fonts.gstatic.com/s/sanchez/v4/iSrhkWLexUZzDeNxNEHtzA.ttf")), array("kind" => "webfonts#webfont", "family" => "Sancreek", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/sancreek/v7/8ZacBMraWMvHly4IJI3esw.ttf")), array("kind" => "webfonts#webfont", "family" => "Sansita One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/sansitaone/v6/xWqf68oB50JXqGIRR0h2hqCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Sarala", "category" => "sans-serif", "variants" => array("regular", "700"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v1", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/sarala/v1/hpc9cz8KYsazwq2In_oJYw.ttf", "regular" => "http://fonts.gstatic.com/s/sarala/v1/ohip9lixCHoBab7hTtgLnw.ttf")), array("kind" => "webfonts#webfont", "family" => "Sarina", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/sarina/v5/XYtRfaSknHIU3NHdfTdXoQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Sarpanch", "category" => "sans-serif", "variants" => array("regular", "500", "600", "700", "800", "900"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v1", "lastModified" => "2016-05-31", "files" => array("500" => "http://fonts.gstatic.com/s/sarpanch/v1/Ov7BxSrFSZYrfuJxL1LzQaCWcynf_cDxXwCLxiixG1c.ttf", "600" => "http://fonts.gstatic.com/s/sarpanch/v1/WTnP2wnc0qSbUaaDG-2OQ6CWcynf_cDxXwCLxiixG1c.ttf", "700" => "http://fonts.gstatic.com/s/sarpanch/v1/57kYsSpovYmFaEt2hsZhv6CWcynf_cDxXwCLxiixG1c.ttf", "800" => "http://fonts.gstatic.com/s/sarpanch/v1/OKyqPLjdnuVghR-1TV6RzaCWcynf_cDxXwCLxiixG1c.ttf", "900" => "http://fonts.gstatic.com/s/sarpanch/v1/JhYc2cr6kqWTo_P0vfvJR6CWcynf_cDxXwCLxiixG1c.ttf", "regular" => "http://fonts.gstatic.com/s/sarpanch/v1/YMBZdT27b6O5a1DADbAGSg.ttf")), array("kind" => "webfonts#webfont", "family" => "Satisfy", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-20", "files" => array("regular" => "http://fonts.gstatic.com/s/satisfy/v6/PRlyepkd-JCGHiN8e9WV2w.ttf")), array("kind" => "webfonts#webfont", "family" => "Scada", "category" => "sans-serif", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("cyrillic", "latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/scada/v4/t6XNWdMdVWUz93EuRVmifQ.ttf", "regular" => "http://fonts.gstatic.com/s/scada/v4/iZNC3ZEYwe3je6H-28d5Ug.ttf", "italic" => "http://fonts.gstatic.com/s/scada/v4/PCGyLT1qNawkOUQ3uHFhBw.ttf", "700italic" => "http://fonts.gstatic.com/s/scada/v4/kLrBIf7V4mDMwcd_Yw7-D_esZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Scheherazade", "category" => "serif", "variants" => array("regular", "700"), "subsets" => array("latin", "arabic"), "version" => "v12", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/scheherazade/v12/C1wtT46acJkQxc6mPHwvHED2ttfZwueP-QU272T9-k4.ttf", "regular" => "http://fonts.gstatic.com/s/scheherazade/v12/AuKlqGWzUC-8XqMOmsqXiy3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Schoolbell", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-20", "files" => array("regular" => "http://fonts.gstatic.com/s/schoolbell/v6/95-3djEuubb3cJx-6E7j4vesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Scope One", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v2", "lastModified" => "2016-06-20", "files" => array("regular" => "http://fonts.gstatic.com/s/scopeone/v2/ge7dY8Yht-n7_1cLHtoT3w.ttf")), array("kind" => "webfonts#webfont", "family" => "Seaweed Script", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/seaweedscript/v4/eorWAPpOvvWrPw5IHwE60BnpV0hQCek3EmWnCPrvGRM.ttf")), array("kind" => "webfonts#webfont", "family" => "Secular One", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext", "hebrew"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("regular" => "http://fonts.gstatic.com/s/secularone/v1/yW9qikjpt_X0fh5oQJcdo6CWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Sevillana", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/sevillana/v4/6m1Nh35oP7YEt00U80Smiw.ttf")), array("kind" => "webfonts#webfont", "family" => "Seymour One", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("cyrillic", "latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/seymourone/v4/HrdG2AEG_870Xb7xBVv6C6CWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Shadows Into Light", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/shadowsintolight/v6/clhLqOv7MXn459PTh0gXYAW_5bEze-iLRNvGrRpJsfM.ttf")), array("kind" => "webfonts#webfont", "family" => "Shadows Into Light Two", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/shadowsintolighttwo/v4/gDxHeefcXIo-lOuZFCn2xVQrZk-Pga5KeEE_oZjkQjQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Shanti", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/shanti/v8/lc4nG_JG6Q-2FQSOMMhb_w.ttf")), array("kind" => "webfonts#webfont", "family" => "Share", "category" => "display", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("latin", "latin-ext"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/share/v6/XrU8e7a1YKurguyY2azk1Q.ttf", "regular" => "http://fonts.gstatic.com/s/share/v6/1ytD7zSb_-g9I2GG67vmVw.ttf", "italic" => "http://fonts.gstatic.com/s/share/v6/a9YGdQWFRlNJ0zClJVaY3Q.ttf", "700italic" => "http://fonts.gstatic.com/s/share/v6/A992-bLVYwAflKu6iaznufesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Share Tech", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/sharetech/v5/Dq3DuZ5_0SW3oEfAWFpen_esZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Share Tech Mono", "category" => "monospace", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/sharetechmono/v6/RQxK-3RA0Lnf3gnnnNrAscwD6PD0c3_abh9zHKQtbGU.ttf")), array("kind" => "webfonts#webfont", "family" => "Shojumaru", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/shojumaru/v4/WP8cxonzQQVAoI3RJQ2wug.ttf")), array("kind" => "webfonts#webfont", "family" => "Short Stack", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/shortstack/v6/v4dXPI0Rm8XN9gk4SDdqlqCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Shrikhand", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext", "gujarati"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("regular" => "http://fonts.gstatic.com/s/shrikhand/v1/45jwHiwIDTWCy3Ir85vvKA.ttf")), array("kind" => "webfonts#webfont", "family" => "Siemreap", "category" => "display", "variants" => array("regular"), "subsets" => array("khmer"), "version" => "v9", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/siemreap/v9/JSK-mOIsXwxo-zE9XDDl_g.ttf")), array("kind" => "webfonts#webfont", "family" => "Sigmar One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/sigmarone/v6/oh_5NxD5JBZksdo2EntKefesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Signika", "category" => "sans-serif", "variants" => array("300", "regular", "600", "700"), "subsets" => array("latin", "latin-ext"), "version" => "v6", "lastModified" => "2016-06-07", "files" => array("300" => "http://fonts.gstatic.com/s/signika/v6/0wDPonOzsYeEo-1KO78w4fesZW2xOQ-xsNqO47m55DA.ttf", "600" => "http://fonts.gstatic.com/s/signika/v6/lQMOF6NUN2ooR7WvB7tADvesZW2xOQ-xsNqO47m55DA.ttf", "700" => "http://fonts.gstatic.com/s/signika/v6/lEcnfPBICWJPv5BbVNnFJPesZW2xOQ-xsNqO47m55DA.ttf", "regular" => "http://fonts.gstatic.com/s/signika/v6/WvDswbww0oAtvBg2l1L-9w.ttf")), array("kind" => "webfonts#webfont", "family" => "Signika Negative", "category" => "sans-serif", "variants" => array("300", "regular", "600", "700"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-06-07", "files" => array("300" => "http://fonts.gstatic.com/s/signikanegative/v5/q5TOjIw4CenPw6C-TW06FjYFXpUPtCmIEFDvjUnLLaI.ttf", "600" => "http://fonts.gstatic.com/s/signikanegative/v5/q5TOjIw4CenPw6C-TW06FrKLaDJM01OezSVA2R_O3qI.ttf", "700" => "http://fonts.gstatic.com/s/signikanegative/v5/q5TOjIw4CenPw6C-TW06FpYzPxtVvobH1w3hEppR8WI.ttf", "regular" => "http://fonts.gstatic.com/s/signikanegative/v5/Z-Q1hzbY8uAo3TpTyPFMXVM1lnCWMnren5_v6047e5A.ttf")), array("kind" => "webfonts#webfont", "family" => "Simonetta", "category" => "display", "variants" => array("regular", "italic", "900", "900italic"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("900" => "http://fonts.gstatic.com/s/simonetta/v5/22EwvvJ2r1VwVCxit5LcVi3USBnSvpkopQaUR-2r7iU.ttf", "regular" => "http://fonts.gstatic.com/s/simonetta/v5/fN8puNuahBo4EYMQgp12Yg.ttf", "italic" => "http://fonts.gstatic.com/s/simonetta/v5/ynxQ3FqfF_Nziwy3T9ZwL6CWcynf_cDxXwCLxiixG1c.ttf", "900italic" => "http://fonts.gstatic.com/s/simonetta/v5/WUXOpCgBZaRPrWtMCpeKoienaqEuufTBk9XMKnKmgDA.ttf")), array("kind" => "webfonts#webfont", "family" => "Sintony", "category" => "sans-serif", "variants" => array("regular", "700"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/sintony/v4/zVXQB1wqJn6PE4dWXoYpvPesZW2xOQ-xsNqO47m55DA.ttf", "regular" => "http://fonts.gstatic.com/s/sintony/v4/IDhCijoIMev2L6Lg5QsduQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Sirin Stencil", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/sirinstencil/v5/pRpLdo0SawzO7MoBpvowsImg74kgS1F7KeR8rWhYwkU.ttf")), array("kind" => "webfonts#webfont", "family" => "Six Caps", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/sixcaps/v7/_XeDnO0HOV8Er9u97If1tQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Skranji", "category" => "display", "variants" => array("regular", "700"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-06-07", "files" => array("700" => "http://fonts.gstatic.com/s/skranji/v4/Lcrhg-fviVkxiEgoadsI1vesZW2xOQ-xsNqO47m55DA.ttf", "regular" => "http://fonts.gstatic.com/s/skranji/v4/jnOLPS0iZmDL7dfWnW3nIw.ttf")), array("kind" => "webfonts#webfont", "family" => "Slabo 13px", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v3", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/slabo13px/v3/jPGWFTjRXfCSzy0qd1nqdvesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Slabo 27px", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v3", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/slabo27px/v3/gC0o8B9eU21EafNkXlRAfPesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Slackey", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-20", "files" => array("regular" => "http://fonts.gstatic.com/s/slackey/v6/evRIMNhGVCRJvCPv4kteeA.ttf")), array("kind" => "webfonts#webfont", "family" => "Smokum", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-20", "files" => array("regular" => "http://fonts.gstatic.com/s/smokum/v6/8YP4BuAcy97X8WfdKfxVRw.ttf")), array("kind" => "webfonts#webfont", "family" => "Smythe", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/smythe/v7/yACD1gy_MpbB9Ft42fUvYw.ttf")), array("kind" => "webfonts#webfont", "family" => "Sniglet", "category" => "display", "variants" => array("regular", "800"), "subsets" => array("latin", "latin-ext"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("800" => "http://fonts.gstatic.com/s/sniglet/v8/NLF91nBmcEfkBgcEWbHFa_esZW2xOQ-xsNqO47m55DA.ttf", "regular" => "http://fonts.gstatic.com/s/sniglet/v8/XWhyQLHH4SpCVsHRPRgu9w.ttf")), array("kind" => "webfonts#webfont", "family" => "Snippet", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/snippet/v6/eUcYMLq2GtHZovLlQH_9kA.ttf")), array("kind" => "webfonts#webfont", "family" => "Snowburst One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/snowburstone/v4/zSQzKOPukXRux2oTqfYJjIjjx0o0jr6fNXxPgYh_a8Q.ttf")), array("kind" => "webfonts#webfont", "family" => "Sofadi One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v4", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/sofadione/v4/nirf4G12IcJ6KI8Eoj119fesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Sofia", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/sofia/v5/Imnvx0Ag9r6iDBFUY5_RaQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Sonsie One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/sonsieone/v5/KSP7xT1OSy0q2ob6RQOTWPesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Sorts Mill Goudy", "category" => "serif", "variants" => array("regular", "italic"), "subsets" => array("latin", "latin-ext"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/sortsmillgoudy/v6/JzRrPKdwEnE8F1TDmDLMUlIL2Qjg-Xlsg_fhGbe2P5U.ttf", "italic" => "http://fonts.gstatic.com/s/sortsmillgoudy/v6/UUu1lKiy4hRmBWk599VL1TYNkCNSzLyoucKmbTguvr0.ttf")), array("kind" => "webfonts#webfont", "family" => "Source Code Pro", "category" => "monospace", "variants" => array("200", "300", "regular", "500", "600", "700", "900"), "subsets" => array("latin", "latin-ext"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("200" => "http://fonts.gstatic.com/s/sourcecodepro/v6/leqv3v-yTsJNC7nFznSMqaXvKVW_haheDNrHjziJZVk.ttf", "300" => "http://fonts.gstatic.com/s/sourcecodepro/v6/leqv3v-yTsJNC7nFznSMqVP7R5lD_au4SZC6Ks_vyWs.ttf", "500" => "http://fonts.gstatic.com/s/sourcecodepro/v6/leqv3v-yTsJNC7nFznSMqX63uKwMO11Of4rJWV582wg.ttf", "600" => "http://fonts.gstatic.com/s/sourcecodepro/v6/leqv3v-yTsJNC7nFznSMqeiMeWyi5E_-XkTgB5psiDg.ttf", "700" => "http://fonts.gstatic.com/s/sourcecodepro/v6/leqv3v-yTsJNC7nFznSMqfgXsetDviZcdR5OzC1KPcw.ttf", "900" => "http://fonts.gstatic.com/s/sourcecodepro/v6/leqv3v-yTsJNC7nFznSMqRA_awHl7mXRjE_LQVochcU.ttf", "regular" => "http://fonts.gstatic.com/s/sourcecodepro/v6/mrl8jkM18OlOQN8JLgasD9Rl0pGnog23EMYRrBmUzJQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Source Sans Pro", "category" => "sans-serif", "variants" => array("200", "200italic", "300", "300italic", "regular", "italic", "600", "600italic", "700", "700italic", "900", "900italic"), "subsets" => array("latin", "latin-ext", "vietnamese"), "version" => "v9", "lastModified" => "2016-05-31", "files" => array("200" => "http://fonts.gstatic.com/s/sourcesanspro/v9/toadOcfmlt9b38dHJxOBGKXvKVW_haheDNrHjziJZVk.ttf", "300" => "http://fonts.gstatic.com/s/sourcesanspro/v9/toadOcfmlt9b38dHJxOBGFP7R5lD_au4SZC6Ks_vyWs.ttf", "600" => "http://fonts.gstatic.com/s/sourcesanspro/v9/toadOcfmlt9b38dHJxOBGOiMeWyi5E_-XkTgB5psiDg.ttf", "700" => "http://fonts.gstatic.com/s/sourcesanspro/v9/toadOcfmlt9b38dHJxOBGPgXsetDviZcdR5OzC1KPcw.ttf", "900" => "http://fonts.gstatic.com/s/sourcesanspro/v9/toadOcfmlt9b38dHJxOBGBA_awHl7mXRjE_LQVochcU.ttf", "200italic" => "http://fonts.gstatic.com/s/sourcesanspro/v9/fpTVHK8qsXbIeTHTrnQH6OptKU7UIBg2hLM7eMTU8bI.ttf", "300italic" => "http://fonts.gstatic.com/s/sourcesanspro/v9/fpTVHK8qsXbIeTHTrnQH6DUpNKoQAsDux-Todp8f29w.ttf", "regular" => "http://fonts.gstatic.com/s/sourcesanspro/v9/ODelI1aHBYDBqgeIAH2zlNRl0pGnog23EMYRrBmUzJQ.ttf", "italic" => "http://fonts.gstatic.com/s/sourcesanspro/v9/M2Jd71oPJhLKp0zdtTvoMwRX4TIfMQQEXLu74GftruE.ttf", "600italic" => "http://fonts.gstatic.com/s/sourcesanspro/v9/fpTVHK8qsXbIeTHTrnQH6Pp6lGoTTgjlW0sC4r900Co.ttf", "700italic" => "http://fonts.gstatic.com/s/sourcesanspro/v9/fpTVHK8qsXbIeTHTrnQH6LVT4locI09aamSzFGQlDMY.ttf", "900italic" => "http://fonts.gstatic.com/s/sourcesanspro/v9/fpTVHK8qsXbIeTHTrnQH6A0NcF6HPGWR298uWIdxWv0.ttf")), array("kind" => "webfonts#webfont", "family" => "Source Serif Pro", "category" => "serif", "variants" => array("regular", "600", "700"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("600" => "http://fonts.gstatic.com/s/sourceserifpro/v4/yd5lDMt8Sva2PE17yiLarGi4cQnvCGV11m1KlXh97aQ.ttf", "700" => "http://fonts.gstatic.com/s/sourceserifpro/v4/yd5lDMt8Sva2PE17yiLarEkpYHRvxGNSCrR82n_RDNk.ttf", "regular" => "http://fonts.gstatic.com/s/sourceserifpro/v4/CeUM4np2c42DV49nanp55YGL0S0YDpKs5GpLtZIQ0m4.ttf")), array("kind" => "webfonts#webfont", "family" => "Space Mono", "category" => "monospace", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("latin", "latin-ext", "vietnamese"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("700" => "http://fonts.gstatic.com/s/spacemono/v1/vdpMRWfyjfCvDYTz00NEPAJKKGfqHaYFsRG-T3ceEVo.ttf", "regular" => "http://fonts.gstatic.com/s/spacemono/v1/B_LOPq3uMVBqC_kmqwURBfesZW2xOQ-xsNqO47m55DA.ttf", "italic" => "http://fonts.gstatic.com/s/spacemono/v1/7xgIgvUEl9Gvhtf7tXsRzC3USBnSvpkopQaUR-2r7iU.ttf", "700italic" => "http://fonts.gstatic.com/s/spacemono/v1/y2NWQDXe2-qPj6a6rWkLc0D2ttfZwueP-QU272T9-k4.ttf")), array("kind" => "webfonts#webfont", "family" => "Special Elite", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/specialelite/v6/9-wW4zu3WNoD5Fjka35Jm4jjx0o0jr6fNXxPgYh_a8Q.ttf")), array("kind" => "webfonts#webfont", "family" => "Spicy Rice", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/spicyrice/v5/WGCtz7cLoggXARPi9OGD6_esZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Spinnaker", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v8", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/spinnaker/v8/MQdIXivKITpjROUdiN6Jgg.ttf")), array("kind" => "webfonts#webfont", "family" => "Spirax", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/spirax/v5/IOKqhk-Ccl7y31yDsePPkw.ttf")), array("kind" => "webfonts#webfont", "family" => "Squada One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/squadaone/v5/3tzGuaJdD65cZVgfQzN8uvesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Sree Krushnadevaraya", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin", "telugu"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/sreekrushnadevaraya/v4/CdsXmnHyEqVl1ahzOh5qnzjDZVem5Eb4d0dXjXa0F_Q.ttf")), array("kind" => "webfonts#webfont", "family" => "Sriracha", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "thai", "latin-ext", "vietnamese"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("regular" => "http://fonts.gstatic.com/s/sriracha/v1/l-TXHmKwoHm6vtjy4oUz8Q.ttf")), array("kind" => "webfonts#webfont", "family" => "Stalemate", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/stalemate/v4/wQLCnG0qB6mOu2Wit2dt_w.ttf")), array("kind" => "webfonts#webfont", "family" => "Stalinist One", "category" => "display", "variants" => array("regular"), "subsets" => array("cyrillic", "latin", "latin-ext"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/stalinistone/v8/MQpS-WezM9W4Dd7D3B7I-UT7eZ8.ttf")), array("kind" => "webfonts#webfont", "family" => "Stardos Stencil", "category" => "display", "variants" => array("regular", "700"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/stardosstencil/v6/h4ExtgvoXhPtv9Ieqd-XC81wDCbBgmIo8UyjIhmkeSM.ttf", "regular" => "http://fonts.gstatic.com/s/stardosstencil/v6/ygEOyTW9a6u4fi4OXEZeTFf2eT4jUldwg_9fgfY_tHc.ttf")), array("kind" => "webfonts#webfont", "family" => "Stint Ultra Condensed", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/stintultracondensed/v5/8DqLK6-YSClFZt3u3EgOUYelbRYnLTTQA1Z5cVLnsI4.ttf")), array("kind" => "webfonts#webfont", "family" => "Stint Ultra Expanded", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/stintultraexpanded/v4/FeigX-wDDgHMCKuhekhedQ7dxr0N5HY0cZKknTIL6n4.ttf")), array("kind" => "webfonts#webfont", "family" => "Stoke", "category" => "serif", "variants" => array("300", "regular"), "subsets" => array("latin", "latin-ext"), "version" => "v6", "lastModified" => "2016-06-07", "files" => array("300" => "http://fonts.gstatic.com/s/stoke/v6/Sell9475FOS8jUqQsfFsUQ.ttf", "regular" => "http://fonts.gstatic.com/s/stoke/v6/A7qJNoqOm2d6o1E6e0yUFg.ttf")), array("kind" => "webfonts#webfont", "family" => "Strait", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/strait/v4/m4W73ViNmProETY2ybc-Bg.ttf")), array("kind" => "webfonts#webfont", "family" => "Sue Ellen Francisco", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/sueellenfrancisco/v7/TwHX4vSxMUnJUdEz1JIgrhzazJzPVbGl8jnf1tisRz4.ttf")), array("kind" => "webfonts#webfont", "family" => "Suez One", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext", "hebrew"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("regular" => "http://fonts.gstatic.com/s/suezone/v1/xulpHtKbz3V8hoSLE2uKDw.ttf")), array("kind" => "webfonts#webfont", "family" => "Sumana", "category" => "serif", "variants" => array("regular", "700"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v1", "lastModified" => "2016-06-07", "files" => array("700" => "http://fonts.gstatic.com/s/sumana/v1/8AcM-KAproitONSBBHj3sQ.ttf", "regular" => "http://fonts.gstatic.com/s/sumana/v1/wgdl__wAK7pzliiWs0Nlog.ttf")), array("kind" => "webfonts#webfont", "family" => "Sunshiney", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/sunshiney/v6/kaWOb4pGbwNijM7CkxK1sQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Supermercado One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/supermercadoone/v6/kMGPVTNFiFEp1U274uBMb4mm5hmSKNFf3C5YoMa-lrM.ttf")), array("kind" => "webfonts#webfont", "family" => "Sura", "category" => "serif", "variants" => array("regular", "700"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v1", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/sura/v1/Z5bXQaFGmoWicN1WlcncxA.ttf", "regular" => "http://fonts.gstatic.com/s/sura/v1/jznKrhTH5NezYxb0-Q5zzA.ttf")), array("kind" => "webfonts#webfont", "family" => "Suranna", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin", "telugu"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/suranna/v4/PYmfr6TQeTqZ-r8HnPM-kA.ttf")), array("kind" => "webfonts#webfont", "family" => "Suravaram", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin", "telugu"), "version" => "v3", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/suravaram/v3/G4dPee4pel_w2HqzavW4MA.ttf")), array("kind" => "webfonts#webfont", "family" => "Suwannaphum", "category" => "display", "variants" => array("regular"), "subsets" => array("khmer"), "version" => "v9", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/suwannaphum/v9/1jIPOyXied3T79GCnSlCN6CWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Swanky and Moo Moo", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/swankyandmoomoo/v6/orVNZ9kDeE3lWp3U3YELu9DVLKqNC3_XMNHhr8S94FU.ttf")), array("kind" => "webfonts#webfont", "family" => "Syncopate", "category" => "sans-serif", "variants" => array("regular", "700"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-20", "files" => array("700" => "http://fonts.gstatic.com/s/syncopate/v7/S5z8ixiOoC4WJ1im6jAlYC3USBnSvpkopQaUR-2r7iU.ttf", "regular" => "http://fonts.gstatic.com/s/syncopate/v7/RQVwO52fAH6MI764EcaYtw.ttf")), array("kind" => "webfonts#webfont", "family" => "Tangerine", "category" => "handwriting", "variants" => array("regular", "700"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-06-07", "files" => array("700" => "http://fonts.gstatic.com/s/tangerine/v7/UkFsr-RwJB_d2l9fIWsx3i3USBnSvpkopQaUR-2r7iU.ttf", "regular" => "http://fonts.gstatic.com/s/tangerine/v7/DTPeM3IROhnkz7aYG2a9sA.ttf")), array("kind" => "webfonts#webfont", "family" => "Taprom", "category" => "display", "variants" => array("regular"), "subsets" => array("khmer"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/taprom/v8/-KByU3BaUsyIvQs79qFObg.ttf")), array("kind" => "webfonts#webfont", "family" => "Tauri", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/tauri/v4/XIWeYJDXNqiVNej0zEqtGg.ttf")), array("kind" => "webfonts#webfont", "family" => "Taviraj", "category" => "serif", "variants" => array("100", "100italic", "200", "200italic", "300", "300italic", "regular", "italic", "500", "500italic", "600", "600italic", "700", "700italic", "800", "800italic", "900", "900italic"), "subsets" => array("latin", "thai", "latin-ext", "vietnamese"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("100" => "http://fonts.gstatic.com/s/taviraj/v1/7iDtujKEc7hwcT6D0zLx-A.ttf", "200" => "http://fonts.gstatic.com/s/taviraj/v1/fn3qCO_sC_zLuf2hqWE37fesZW2xOQ-xsNqO47m55DA.ttf", "300" => "http://fonts.gstatic.com/s/taviraj/v1/1EIpbtG_cs5haG6Ba9wX8vesZW2xOQ-xsNqO47m55DA.ttf", "500" => "http://fonts.gstatic.com/s/taviraj/v1/s8BuqYm5ebG2N1R4JkTp_fesZW2xOQ-xsNqO47m55DA.ttf", "600" => "http://fonts.gstatic.com/s/taviraj/v1/KscmiA6HGz7nCcHhaddQH_esZW2xOQ-xsNqO47m55DA.ttf", "700" => "http://fonts.gstatic.com/s/taviraj/v1/TY91892tTFNYCeCXjQ1AEPesZW2xOQ-xsNqO47m55DA.ttf", "800" => "http://fonts.gstatic.com/s/taviraj/v1/oGWJbiDGcxlInLLnrLxTDvesZW2xOQ-xsNqO47m55DA.ttf", "900" => "http://fonts.gstatic.com/s/taviraj/v1/RfIEodnN0NYWUdZHol5fdPesZW2xOQ-xsNqO47m55DA.ttf", "100italic" => "http://fonts.gstatic.com/s/taviraj/v1/ai0UdHXB1gi5etfpU0CZ6aCWcynf_cDxXwCLxiixG1c.ttf", "200italic" => "http://fonts.gstatic.com/s/taviraj/v1/eDMMTK5GhTdvvz3R-ZWvay3USBnSvpkopQaUR-2r7iU.ttf", "300italic" => "http://fonts.gstatic.com/s/taviraj/v1/IEBfc1xGgsBbdCeXKNAtfS3USBnSvpkopQaUR-2r7iU.ttf", "regular" => "http://fonts.gstatic.com/s/taviraj/v1/AH1eoWagKJhbVx4Poc3M1A.ttf", "italic" => "http://fonts.gstatic.com/s/taviraj/v1/hAS5RxygdSnG4626KdkXuQ.ttf", "500italic" => "http://fonts.gstatic.com/s/taviraj/v1/319qfe3yzAi9RNFu-dI9zy3USBnSvpkopQaUR-2r7iU.ttf", "600italic" => "http://fonts.gstatic.com/s/taviraj/v1/ofRN6EMiboGiM2Ga3cG_yy3USBnSvpkopQaUR-2r7iU.ttf", "700italic" => "http://fonts.gstatic.com/s/taviraj/v1/4Yzb6i1xtMRZn9oAQ484nS3USBnSvpkopQaUR-2r7iU.ttf", "800italic" => "http://fonts.gstatic.com/s/taviraj/v1/MPtY5Qs3hwV4f0LUH-vVmy3USBnSvpkopQaUR-2r7iU.ttf", "900italic" => "http://fonts.gstatic.com/s/taviraj/v1/aDM2JaXSd_qo0nqKiBAq5C3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Teko", "category" => "sans-serif", "variants" => array("300", "regular", "500", "600", "700"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("300" => "http://fonts.gstatic.com/s/teko/v5/OobFGE9eo24rcBpN6zXDaQ.ttf", "500" => "http://fonts.gstatic.com/s/teko/v5/FQ0duU7gWM4cSaImOfAjBA.ttf", "600" => "http://fonts.gstatic.com/s/teko/v5/QDx_i8H-TZ1IK1JEVrqwEQ.ttf", "700" => "http://fonts.gstatic.com/s/teko/v5/xKfTxe_SWpH4xU75vmvylA.ttf", "regular" => "http://fonts.gstatic.com/s/teko/v5/UtekqODEqZXSN2L-njejpA.ttf")), array("kind" => "webfonts#webfont", "family" => "Telex", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/telex/v4/24-3xP9ywYeHOcFU3iGk8A.ttf")), array("kind" => "webfonts#webfont", "family" => "Tenali Ramakrishna", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "telugu"), "version" => "v3", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/tenaliramakrishna/v3/M0nTmDqv2M7AGoGh-c946BZak5pSBHqWX6uyVMiMFoA.ttf")), array("kind" => "webfonts#webfont", "family" => "Tenor Sans", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("cyrillic", "latin", "latin-ext"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/tenorsans/v7/dUBulmjNJJInvK5vL7O9yfesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Text Me One", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/textmeone/v4/9em_3ckd_P5PQkP4aDyDLqCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "The Girl Next Door", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/thegirlnextdoor/v7/cWRA4JVGeEcHGcPl5hmX7kzo0nFFoM60ux_D9BUymX4.ttf")), array("kind" => "webfonts#webfont", "family" => "Tienne", "category" => "serif", "variants" => array("regular", "700", "900"), "subsets" => array("latin"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/tienne/v8/JvoCDOlyOSEyYGRwCyfs3g.ttf", "900" => "http://fonts.gstatic.com/s/tienne/v8/FBano5T521OWexj2iRYLMw.ttf", "regular" => "http://fonts.gstatic.com/s/tienne/v8/-IIfDl701C0z7-fy2kmGvA.ttf")), array("kind" => "webfonts#webfont", "family" => "Tillana", "category" => "handwriting", "variants" => array("regular", "500", "600", "700", "800"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v1", "lastModified" => "2016-05-31", "files" => array("500" => "http://fonts.gstatic.com/s/tillana/v1/gqdUngSIcY9tSla5eCZky_esZW2xOQ-xsNqO47m55DA.ttf", "600" => "http://fonts.gstatic.com/s/tillana/v1/fqon6-r15hy8M1cyiYfQBvesZW2xOQ-xsNqO47m55DA.ttf", "700" => "http://fonts.gstatic.com/s/tillana/v1/jGARMTxLrMerzTCpGBpMffesZW2xOQ-xsNqO47m55DA.ttf", "800" => "http://fonts.gstatic.com/s/tillana/v1/pmTtNH_Ibktj5Cyc1XrP6vesZW2xOQ-xsNqO47m55DA.ttf", "regular" => "http://fonts.gstatic.com/s/tillana/v1/zN0D-jDPsr1HzU3VRFLY5g.ttf")), array("kind" => "webfonts#webfont", "family" => "Timmana", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "telugu"), "version" => "v1", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/timmana/v1/T25SicsJUJkc2s2sbBsDnA.ttf")), array("kind" => "webfonts#webfont", "family" => "Tinos", "category" => "serif", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("cyrillic", "cyrillic-ext", "latin", "greek-ext", "latin-ext", "greek", "hebrew", "vietnamese"), "version" => "v9", "lastModified" => "2016-05-20", "files" => array("700" => "http://fonts.gstatic.com/s/tinos/v9/vHXfhX8jZuQruowfon93yQ.ttf", "regular" => "http://fonts.gstatic.com/s/tinos/v9/EqpUbkVmutfwZ0PjpoGwCg.ttf", "italic" => "http://fonts.gstatic.com/s/tinos/v9/slfyzlasCr9vTsaP4lUh9A.ttf", "700italic" => "http://fonts.gstatic.com/s/tinos/v9/M6kfzvDMM0CdxdraoFpG6vesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Titan One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/titanone/v4/FbvpRvzfV_oipS0De3iAZg.ttf")), array("kind" => "webfonts#webfont", "family" => "Titillium Web", "category" => "sans-serif", "variants" => array("200", "200italic", "300", "300italic", "regular", "italic", "600", "600italic", "700", "700italic", "900"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("200" => "http://fonts.gstatic.com/s/titilliumweb/v4/anMUvcNT0H1YN4FII8wprzOdCrLccoxq42eaxM802O0.ttf", "300" => "http://fonts.gstatic.com/s/titilliumweb/v4/anMUvcNT0H1YN4FII8wpr9ZAkYT8DuUZELiKLwMGWAo.ttf", "600" => "http://fonts.gstatic.com/s/titilliumweb/v4/anMUvcNT0H1YN4FII8wpr28K9dEd5Ue-HTQrlA7E2xQ.ttf", "700" => "http://fonts.gstatic.com/s/titilliumweb/v4/anMUvcNT0H1YN4FII8wpr2-6tpSbB9YhmWtmd1_gi_U.ttf", "900" => "http://fonts.gstatic.com/s/titilliumweb/v4/anMUvcNT0H1YN4FII8wpr7L0GmZLri-m-nfoo0Vul4Y.ttf", "200italic" => "http://fonts.gstatic.com/s/titilliumweb/v4/RZunN20OBmkvrU7sA4GPPj4N98U-66ThNJvtgddRfBE.ttf", "300italic" => "http://fonts.gstatic.com/s/titilliumweb/v4/RZunN20OBmkvrU7sA4GPPrfzCkqg7ORZlRf2cc4mXu8.ttf", "regular" => "http://fonts.gstatic.com/s/titilliumweb/v4/7XUFZ5tgS-tD6QamInJTcTyagQBwYgYywpS70xNq8SQ.ttf", "italic" => "http://fonts.gstatic.com/s/titilliumweb/v4/r9OmwyQxrgzUAhaLET_KO-ixohbIP6lHkU-1Mgq95cY.ttf", "600italic" => "http://fonts.gstatic.com/s/titilliumweb/v4/RZunN20OBmkvrU7sA4GPPgOhzTSndyK8UWja2yJjKLc.ttf", "700italic" => "http://fonts.gstatic.com/s/titilliumweb/v4/RZunN20OBmkvrU7sA4GPPio3LEw-4MM8Ao2j9wPOfpw.ttf")), array("kind" => "webfonts#webfont", "family" => "Trade Winds", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/tradewinds/v5/sDOCVgAxw6PEUi2xdMsoDaCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Trirong", "category" => "serif", "variants" => array("100", "100italic", "200", "200italic", "300", "300italic", "regular", "italic", "500", "500italic", "600", "600italic", "700", "700italic", "800", "800italic", "900", "900italic"), "subsets" => array("latin", "thai", "latin-ext", "vietnamese"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("100" => "http://fonts.gstatic.com/s/trirong/v1/A4AP1moxqvtadq5CW3L17A.ttf", "200" => "http://fonts.gstatic.com/s/trirong/v1/QD8N5qk-agpAEYCSSWullPesZW2xOQ-xsNqO47m55DA.ttf", "300" => "http://fonts.gstatic.com/s/trirong/v1/mfCfGz4GqprWJZ47PUMDGfesZW2xOQ-xsNqO47m55DA.ttf", "500" => "http://fonts.gstatic.com/s/trirong/v1/6CsQ6UR1e8rURaEPxqnGBvesZW2xOQ-xsNqO47m55DA.ttf", "600" => "http://fonts.gstatic.com/s/trirong/v1/1FjmLIhPhB6Yc7RWqO27mfesZW2xOQ-xsNqO47m55DA.ttf", "700" => "http://fonts.gstatic.com/s/trirong/v1/ab8hG5CTSzMAobTnPgcDP_esZW2xOQ-xsNqO47m55DA.ttf", "800" => "http://fonts.gstatic.com/s/trirong/v1/UBRQXGJvi5EHcyI5wwZew_esZW2xOQ-xsNqO47m55DA.ttf", "900" => "http://fonts.gstatic.com/s/trirong/v1/Lam1ewMdiP3O-bVYT-W6t_esZW2xOQ-xsNqO47m55DA.ttf", "100italic" => "http://fonts.gstatic.com/s/trirong/v1/ke-m75CXBPHlqwRHmCTBi6CWcynf_cDxXwCLxiixG1c.ttf", "200italic" => "http://fonts.gstatic.com/s/trirong/v1/TLnptEEWKdIVHKJYBO592y3USBnSvpkopQaUR-2r7iU.ttf", "300italic" => "http://fonts.gstatic.com/s/trirong/v1/RnkK09k5OfEHFxd_smcYuC3USBnSvpkopQaUR-2r7iU.ttf", "regular" => "http://fonts.gstatic.com/s/trirong/v1/lYu4kez-Enlvh2X-itx6CA.ttf", "italic" => "http://fonts.gstatic.com/s/trirong/v1/kV0MzmWPKkglEtJf--dQhQ.ttf", "500italic" => "http://fonts.gstatic.com/s/trirong/v1/I7H5Vf-5oH45BHkyxaUodS3USBnSvpkopQaUR-2r7iU.ttf", "600italic" => "http://fonts.gstatic.com/s/trirong/v1/BXLhSV51vCWUiACSqyWe6i3USBnSvpkopQaUR-2r7iU.ttf", "700italic" => "http://fonts.gstatic.com/s/trirong/v1/CEBv6IoZawJuRHdATx4LQi3USBnSvpkopQaUR-2r7iU.ttf", "800italic" => "http://fonts.gstatic.com/s/trirong/v1/lGUgSzOvjUqrsrJfnROivC3USBnSvpkopQaUR-2r7iU.ttf", "900italic" => "http://fonts.gstatic.com/s/trirong/v1/EtuLHyx5DS9oX5NoKhYlkC3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Trocchi", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/trocchi/v4/uldNPaKrUGVeGCVsmacLwA.ttf")), array("kind" => "webfonts#webfont", "family" => "Trochut", "category" => "display", "variants" => array("regular", "italic", "700"), "subsets" => array("latin"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/trochut/v4/lWqNOv6ISR8ehNzGLFLnJ_esZW2xOQ-xsNqO47m55DA.ttf", "regular" => "http://fonts.gstatic.com/s/trochut/v4/6Y65B0x-2JsnYt16OH5omw.ttf", "italic" => "http://fonts.gstatic.com/s/trochut/v4/pczUwr4ZFvC79TgNO5cZng.ttf")), array("kind" => "webfonts#webfont", "family" => "Trykker", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/trykker/v5/YiVrVJpBFN7I1l_CWk6yYQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Tulpen One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/tulpenone/v6/lwcTfVIEVxpZLZlWzR5baPesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Ubuntu", "category" => "sans-serif", "variants" => array("300", "300italic", "regular", "italic", "500", "500italic", "700", "700italic"), "subsets" => array("cyrillic", "cyrillic-ext", "latin", "greek-ext", "latin-ext", "greek"), "version" => "v9", "lastModified" => "2016-06-03", "files" => array("300" => "http://fonts.gstatic.com/s/ubuntu/v9/7-wH0j2QCTHKgp7vLh9-sQ.ttf", "500" => "http://fonts.gstatic.com/s/ubuntu/v9/bMbHEMwSUmkzcK2x_74QbA.ttf", "700" => "http://fonts.gstatic.com/s/ubuntu/v9/B7BtHjNYwAp3HgLNagENOQ.ttf", "300italic" => "http://fonts.gstatic.com/s/ubuntu/v9/j-TYDdXcC_eQzhhp386SjaCWcynf_cDxXwCLxiixG1c.ttf", "regular" => "http://fonts.gstatic.com/s/ubuntu/v9/lhhB5ZCwEkBRbHMSnYuKyA.ttf", "italic" => "http://fonts.gstatic.com/s/ubuntu/v9/b9hP8wd30SygxZjGGk4DCQ.ttf", "500italic" => "http://fonts.gstatic.com/s/ubuntu/v9/NWdMogIO7U6AtEM4dDdf_aCWcynf_cDxXwCLxiixG1c.ttf", "700italic" => "http://fonts.gstatic.com/s/ubuntu/v9/pqisLQoeO9YTDCNnlQ9bf6CWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Ubuntu Condensed", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("cyrillic", "cyrillic-ext", "latin", "greek-ext", "latin-ext", "greek"), "version" => "v7", "lastModified" => "2016-06-03", "files" => array("regular" => "http://fonts.gstatic.com/s/ubuntucondensed/v7/DBCt-NXN57MTAFjitYxdrKDbm6fPDOZJsR8PmdG62gY.ttf")), array("kind" => "webfonts#webfont", "family" => "Ubuntu Mono", "category" => "monospace", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("cyrillic", "cyrillic-ext", "latin", "greek-ext", "latin-ext", "greek"), "version" => "v6", "lastModified" => "2016-06-03", "files" => array("700" => "http://fonts.gstatic.com/s/ubuntumono/v6/ceqTZGKHipo8pJj4molytne1Pd76Vl7zRpE7NLJQ7XU.ttf", "regular" => "http://fonts.gstatic.com/s/ubuntumono/v6/EgeuS9OtEmA0y_JRo03MQaCWcynf_cDxXwCLxiixG1c.ttf", "italic" => "http://fonts.gstatic.com/s/ubuntumono/v6/KAKuHXAHZOeECOWAHsRKA0eOrDcLawS7-ssYqLr2Xp4.ttf", "700italic" => "http://fonts.gstatic.com/s/ubuntumono/v6/n_d8tv_JOIiYyMXR4eaV9c_zJjSACmk0BRPxQqhnNLU.ttf")), array("kind" => "webfonts#webfont", "family" => "Ultra", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v8", "lastModified" => "2016-05-20", "files" => array("regular" => "http://fonts.gstatic.com/s/ultra/v8/OW8uXkOstRADuhEmGOFQLA.ttf")), array("kind" => "webfonts#webfont", "family" => "Uncial Antiqua", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/uncialantiqua/v4/F-leefDiFwQXsyd6eaSllqrFJ4O13IHVxZbM6yoslpo.ttf")), array("kind" => "webfonts#webfont", "family" => "Underdog", "category" => "display", "variants" => array("regular"), "subsets" => array("cyrillic", "latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-06-07", "files" => array("regular" => "http://fonts.gstatic.com/s/underdog/v5/gBv9yjez_-5PnTprHWq0ig.ttf")), array("kind" => "webfonts#webfont", "family" => "Unica One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/unicaone/v4/KbYKlhWMDpatWViqDkNQgA.ttf")), array("kind" => "webfonts#webfont", "family" => "UnifrakturCook", "category" => "display", "variants" => array("700"), "subsets" => array("latin"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/unifrakturcook/v8/ASwh69ykD8iaoYijVEU6RrWZkcsCTHKV51zmcUsafQ0.ttf")), array("kind" => "webfonts#webfont", "family" => "UnifrakturMaguntia", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/unifrakturmaguntia/v7/7KWy3ymCVR_xfAvvcIXm3-kdNg30GQauG_DE-tMYtWk.ttf")), array("kind" => "webfonts#webfont", "family" => "Unkempt", "category" => "display", "variants" => array("regular", "700"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-06-07", "files" => array("700" => "http://fonts.gstatic.com/s/unkempt/v7/V7H-GCl9bgwGwqFqTTgDHvesZW2xOQ-xsNqO47m55DA.ttf", "regular" => "http://fonts.gstatic.com/s/unkempt/v7/NLLBeNSspr0RGs71R5LHWA.ttf")), array("kind" => "webfonts#webfont", "family" => "Unlock", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/unlock/v6/rXEQzK7uIAlhoyoAEiMy1w.ttf")), array("kind" => "webfonts#webfont", "family" => "Unna", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/unna/v8/UAS0AM7AmbdCNY_80xyAZQ.ttf")), array("kind" => "webfonts#webfont", "family" => "VT323", "category" => "monospace", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/vt323/v7/ITU2YQfM073o1iYK3nSOmQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Vampiro One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/vampiroone/v7/OVDs4gY4WpS5u3Qd1gXRW6CWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Varela", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/varela/v7/ON7qs0cKUUixhhDFXlZUjw.ttf")), array("kind" => "webfonts#webfont", "family" => "Varela Round", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "hebrew"), "version" => "v7", "lastModified" => "2016-06-02", "files" => array("regular" => "http://fonts.gstatic.com/s/varelaround/v7/APH4jr0uSos5wiut5cpjri3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Vast Shadow", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/vastshadow/v6/io4hqKX3ibiqQQjYfW0-h6CWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Vesper Libre", "category" => "serif", "variants" => array("regular", "500", "700", "900"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("500" => "http://fonts.gstatic.com/s/vesperlibre/v8/0liLgNkygqH6EOtsVjZDsZMQuUSAwdHsY8ov_6tk1oA.ttf", "700" => "http://fonts.gstatic.com/s/vesperlibre/v8/0liLgNkygqH6EOtsVjZDsUD2ttfZwueP-QU272T9-k4.ttf", "900" => "http://fonts.gstatic.com/s/vesperlibre/v8/0liLgNkygqH6EOtsVjZDsaObDOjC3UL77puoeHsE3fw.ttf", "regular" => "http://fonts.gstatic.com/s/vesperlibre/v8/Cg-TeZFsqV8BaOcoVwzu2C3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Vibur", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/vibur/v7/xB9aKsUbJo68XP0bAg2iLw.ttf")), array("kind" => "webfonts#webfont", "family" => "Vidaloka", "category" => "serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/vidaloka/v8/C6Nul0ogKUWkx356rrt9RA.ttf")), array("kind" => "webfonts#webfont", "family" => "Viga", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/viga/v5/uD87gDbhS7frHLX4uL6agg.ttf")), array("kind" => "webfonts#webfont", "family" => "Voces", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/voces/v5/QoBH6g6yKgNIgvL8A2aE2Q.ttf")), array("kind" => "webfonts#webfont", "family" => "Volkhov", "category" => "serif", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("latin"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/volkhov/v8/L8PbKS-kEoLHm7nP--NCzPesZW2xOQ-xsNqO47m55DA.ttf", "regular" => "http://fonts.gstatic.com/s/volkhov/v8/MDIZAofe1T_J3un5Kgo8zg.ttf", "italic" => "http://fonts.gstatic.com/s/volkhov/v8/1rTjmztKEpbkKH06JwF8Yw.ttf", "700italic" => "http://fonts.gstatic.com/s/volkhov/v8/W6oG0QDDjCgj0gmsHE520C3USBnSvpkopQaUR-2r7iU.ttf")), array("kind" => "webfonts#webfont", "family" => "Vollkorn", "category" => "serif", "variants" => array("regular", "italic", "700", "700italic"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("700" => "http://fonts.gstatic.com/s/vollkorn/v6/gOwQjJVGXlDOONC12hVoBqCWcynf_cDxXwCLxiixG1c.ttf", "regular" => "http://fonts.gstatic.com/s/vollkorn/v6/IiexqYAeh8uII223thYx3w.ttf", "italic" => "http://fonts.gstatic.com/s/vollkorn/v6/UuIzosgR1ovBhJFdwVp3fvesZW2xOQ-xsNqO47m55DA.ttf", "700italic" => "http://fonts.gstatic.com/s/vollkorn/v6/KNiAlx6phRqXCwnZZG51JAJKKGfqHaYFsRG-T3ceEVo.ttf")), array("kind" => "webfonts#webfont", "family" => "Voltaire", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/voltaire/v6/WvqBzaGEBbRV-hrahwO2cA.ttf")), array("kind" => "webfonts#webfont", "family" => "Waiting for the Sunrise", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/waitingforthesunrise/v7/eNfH7kLpF1PZWpsetF-ha9TChrNgrDiT3Zy6yGf3FnM.ttf")), array("kind" => "webfonts#webfont", "family" => "Wallpoet", "category" => "display", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v8", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/wallpoet/v8/hmum4WuBN4A0Z_7367NDIg.ttf")), array("kind" => "webfonts#webfont", "family" => "Walter Turncoat", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-20", "files" => array("regular" => "http://fonts.gstatic.com/s/walterturncoat/v6/sG9su5g4GXy1KP73cU3hvQplL2YwNeota48DxFlGDUo.ttf")), array("kind" => "webfonts#webfont", "family" => "Warnes", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/warnes/v6/MXG7_Phj4YpzAXxKGItuBw.ttf")), array("kind" => "webfonts#webfont", "family" => "Wellfleet", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/wellfleet/v4/J5tOx72iFRPgHYpbK9J4XQ.ttf")), array("kind" => "webfonts#webfont", "family" => "Wendy One", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin", "latin-ext"), "version" => "v4", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/wendyone/v4/R8CJT2oDXdMk_ZtuHTxoxw.ttf")), array("kind" => "webfonts#webfont", "family" => "Wire One", "category" => "sans-serif", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/wireone/v7/sRLhaQOQpWnvXwIx0CycQw.ttf")), array("kind" => "webfonts#webfont", "family" => "Work Sans", "category" => "sans-serif", "variants" => array("100", "200", "300", "regular", "500", "600", "700", "800", "900"), "subsets" => array("latin", "latin-ext"), "version" => "v2", "lastModified" => "2016-06-07", "files" => array("100" => "http://fonts.gstatic.com/s/worksans/v2/ZAhtNqLaAViKjGLajtuwWaCWcynf_cDxXwCLxiixG1c.ttf", "200" => "http://fonts.gstatic.com/s/worksans/v2/u_mYNr_qYP37m7vgvmIYZy3USBnSvpkopQaUR-2r7iU.ttf", "300" => "http://fonts.gstatic.com/s/worksans/v2/FD_Udbezj8EHXbdsqLUply3USBnSvpkopQaUR-2r7iU.ttf", "500" => "http://fonts.gstatic.com/s/worksans/v2/Nbre-U_bp6Xktt8cpgwaJC3USBnSvpkopQaUR-2r7iU.ttf", "600" => "http://fonts.gstatic.com/s/worksans/v2/z9rX03Xuz9ZNHTMg1_ghGS3USBnSvpkopQaUR-2r7iU.ttf", "700" => "http://fonts.gstatic.com/s/worksans/v2/4udXuXg54JlPEP5iKO5AmS3USBnSvpkopQaUR-2r7iU.ttf", "800" => "http://fonts.gstatic.com/s/worksans/v2/IQh-ap2Uqs7kl1YINeeEGi3USBnSvpkopQaUR-2r7iU.ttf", "900" => "http://fonts.gstatic.com/s/worksans/v2/Hjn0acvjHfjY_vAK9Uc6gi3USBnSvpkopQaUR-2r7iU.ttf", "regular" => "http://fonts.gstatic.com/s/worksans/v2/zVvigUiMvx7JVEnrJgc-5Q.ttf")), array("kind" => "webfonts#webfont", "family" => "Yanone Kaffeesatz", "category" => "sans-serif", "variants" => array("200", "300", "regular", "700"), "subsets" => array("latin", "latin-ext"), "version" => "v7", "lastModified" => "2016-05-31", "files" => array("200" => "http://fonts.gstatic.com/s/yanonekaffeesatz/v7/We_iSDqttE3etzfdfhuPRbq92v6XxU4pSv06GI0NsGc.ttf", "300" => "http://fonts.gstatic.com/s/yanonekaffeesatz/v7/We_iSDqttE3etzfdfhuPRZlIwXPiNoNT_wxzJ2t3mTE.ttf", "700" => "http://fonts.gstatic.com/s/yanonekaffeesatz/v7/We_iSDqttE3etzfdfhuPRf2R4S6PlKaGXWPfWpHpcl0.ttf", "regular" => "http://fonts.gstatic.com/s/yanonekaffeesatz/v7/YDAoLskQQ5MOAgvHUQCcLdXn3cHbFGWU4T2HrSN6JF4.ttf")), array("kind" => "webfonts#webfont", "family" => "Yantramanav", "category" => "sans-serif", "variants" => array("100", "300", "regular", "500", "700", "900"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v1", "lastModified" => "2016-05-31", "files" => array("100" => "http://fonts.gstatic.com/s/yantramanav/v1/Rs1I2PF4Z8GAb6qjgvr8wIAWxXGWZ3yJw6KhWS7MxOk.ttf", "300" => "http://fonts.gstatic.com/s/yantramanav/v1/HSfbC4Z8I8BZ00wiXeA5bC9-WlPSxbfiI49GsXo3q0g.ttf", "500" => "http://fonts.gstatic.com/s/yantramanav/v1/HSfbC4Z8I8BZ00wiXeA5bMCNfqCYlB_eIx7H1TVXe60.ttf", "700" => "http://fonts.gstatic.com/s/yantramanav/v1/HSfbC4Z8I8BZ00wiXeA5bHe1Pd76Vl7zRpE7NLJQ7XU.ttf", "900" => "http://fonts.gstatic.com/s/yantramanav/v1/HSfbC4Z8I8BZ00wiXeA5bCenaqEuufTBk9XMKnKmgDA.ttf", "regular" => "http://fonts.gstatic.com/s/yantramanav/v1/FwdziO-qWAO8pZg8e376kaCWcynf_cDxXwCLxiixG1c.ttf")), array("kind" => "webfonts#webfont", "family" => "Yatra One", "category" => "display", "variants" => array("regular"), "subsets" => array("latin", "devanagari", "latin-ext"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("regular" => "http://fonts.gstatic.com/s/yatraone/v1/ApKQzWF7_vG0Lt5TDqgUvw.ttf")), array("kind" => "webfonts#webfont", "family" => "Yellowtail", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-20", "files" => array("regular" => "http://fonts.gstatic.com/s/yellowtail/v6/HLrU6lhCTjXfLZ7X60LcB_esZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Yeseva One", "category" => "display", "variants" => array("regular"), "subsets" => array("cyrillic", "latin", "latin-ext"), "version" => "v10", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/yesevaone/v10/eenQQxvpzSA80JmisGcgX_esZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Yesteryear", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v5", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/yesteryear/v5/dv09hP_ZrdjVOfZQXKXuZvesZW2xOQ-xsNqO47m55DA.ttf")), array("kind" => "webfonts#webfont", "family" => "Yrsa", "category" => "serif", "variants" => array("300", "regular", "500", "600", "700"), "subsets" => array("latin", "latin-ext"), "version" => "v1", "lastModified" => "2016-06-20", "files" => array("300" => "http://fonts.gstatic.com/s/yrsa/v1/YI0C1syzAYpkrPx27UnC2w.ttf", "500" => "http://fonts.gstatic.com/s/yrsa/v1/rWuZmBLHIeKRbnfSvWCvYg.ttf", "600" => "http://fonts.gstatic.com/s/yrsa/v1/1413P-oEfrq-tBIdqnslDQ.ttf", "700" => "http://fonts.gstatic.com/s/yrsa/v1/iV49zaJV5wyo_4LgxE2yng.ttf", "regular" => "http://fonts.gstatic.com/s/yrsa/v1/JWX_dCK4_Jq-oqF7r9rFHg.ttf")), array("kind" => "webfonts#webfont", "family" => "Zeyada", "category" => "handwriting", "variants" => array("regular"), "subsets" => array("latin"), "version" => "v6", "lastModified" => "2016-05-31", "files" => array("regular" => "http://fonts.gstatic.com/s/zeyada/v6/hmonmGYYFwqTZQfG2nRswQ.ttf")))); diff --git a/app/features/mec/wizard.php b/app/features/mec/wizard.php new file mode 100755 index 0000000..adc6611 --- /dev/null +++ b/app/features/mec/wizard.php @@ -0,0 +1,567 @@ +main->get_settings(); +$archive_skins = $this->main->get_archive_skins(); +?> + +
        +
        +

        +
        +

        +
        +
        +
        + +
        +
        + +
        +
        +
        +
        + + + +
        +
        +
        + +
        + + + +
        + + + \ No newline at end of file diff --git a/app/features/notifications.php b/app/features/notifications.php new file mode 100755 index 0000000..e991fd1 --- /dev/null +++ b/app/features/notifications.php @@ -0,0 +1,212 @@ + + */ +class MEC_feature_notifications extends MEC_base +{ + public $factory; + public $main; + public $settings; + public $notif_settings; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Factory + $this->factory = $this->getFactory(); + + // Import MEC Main + $this->main = $this->getMain(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + + // MEC Notification Settings + $this->notif_settings = $this->main->get_notifications(); + } + + /** + * Initialize notifications feature + * @author Webnus + */ + public function init() + { + // Module is disabled + if(!isset($this->settings['notif_per_event']) || !$this->settings['notif_per_event']) return; + + $this->factory->action('mec_metabox_details', [$this, 'meta_box_notifications'], 30); + } + + /** + * Show notification meta box + * @author Webnus + * @param $post + */ + public function meta_box_notifications($post) + { + $values = get_post_meta($post->ID, 'mec_notifications', true); + if(!is_array($values)) $values = []; + + $notifications = $this->get_notifications(); + ?> +
        + $notification): if(isset($this->notif_settings[$key]) and isset($this->notif_settings[$key]['status']) and !$this->notif_settings[$key]['status']) continue; ?> +
        +

        +
        + +
        +
        +
        +
        + +
        +
        + +
        +
        +
        +
        + +
        +
        + notif_settings[$key]) and isset($this->notif_settings[$key]['content']) and trim($this->notif_settings[$key]['content'])) ? stripslashes($this->notif_settings[$key]['content']) : '')), 'mec_notifications_'.esc_attr($key).'_content', array('textarea_name'=>'mec[notifications]['.$key.'][content]')); ?> +
        +
        + + +
        +
        + +

        + display_placeholders(); ?> +
        + [ + 'label' => esc_html__('Booking Notification', 'modern-events-calendar-lite') + ], + 'booking_confirmation' => [ + 'label' => esc_html__('Booking Confirmation', 'modern-events-calendar-lite') + ], + 'booking_rejection' => [ + 'label' => esc_html__('Booking Rejection', 'modern-events-calendar-lite') + ], + 'email_verification' => [ + 'label' => esc_html__('Email Verification', 'modern-events-calendar-lite') + ], + 'cancellation_notification' => [ + 'label' => esc_html__('Booking Cancellation', 'modern-events-calendar-lite') + ], + 'booking_reminder' => [ + 'label' => esc_html__('Booking Reminder', 'modern-events-calendar-lite') + ], + 'event_finished' => [ + 'label' => esc_html__('Event Finished', 'modern-events-calendar-lite') + ], + 'event_soldout' => [ + 'label' => esc_html__('Event Soldout', 'modern-events-calendar-lite') + ], + 'admin_notification' => [ + 'label' => esc_html__('Admin Notification', 'modern-events-calendar-lite') + ], + 'certificate_send' => [ + 'label' => esc_html__('Send Certificate', 'modern-events-calendar-lite') + ], + ]; + + return apply_filters('mec_event_notifications', $notifications); + } + + public static function display_placeholders() + { + ?> +
          +
        • %%name%%:
        • +
        • %%first_name%%:
        • +
        • %%last_name%%:
        • +
        • %%user_email%%:
        • +
        • %%book_date%%:
        • +
        • %%book_time%%:
        • +
        • %%book_datetime%%:
        • +
        • %%book_other_datetimes%%:
        • +
        • %%book_date_next_occurrences%%:
        • +
        • %%book_datetime_next_occurrences%%:
        • +
        • %%book_price%%:
        • +
        • %%book_payable%%:
        • +
        • %%attendee_price%%:
        • +
        • %%book_order_time%%:
        • +
        • %%blog_name%%:
        • +
        • %%blog_url%%:
        • +
        • %%blog_description%%:
        • +
        • %%event_title%%:
        • +
        • %%event_description%%:
        • +
        • %%event_tags%%:
        • +
        • %%event_labels%%:
        • +
        • %%event_categories%%:
        • +
        • %%event_cost%%:
        • +
        • %%event_link%%:
        • +
        • %%event_speaker_name%%:
        • +
        • %%event_organizer_name%%:
        • +
        • %%event_organizer_tel%%:
        • +
        • %%event_organizer_email%%:
        • +
        • %%event_organizer_url%%:
        • +
        • %%event_other_organizers_name%%:
        • +
        • %%event_other_organizers_tel%%:
        • +
        • %%event_other_organizers_email%%:
        • +
        • %%event_location_name%%:
        • +
        • %%event_location_address%%:
        • +
        • %%event_other_locations_name%%:
        • +
        • %%event_other_locations_address%%:
        • +
        • %%event_featured_image%%:
        • +
        • %%event_more_info%%:
        • +
        • %%event_other_info%%:
        • +
        • %%online_link%%:
        • +
        • %%attendees_full_info%%:
        • +
        • %%all_bfixed_fields%%:
        • +
        • %%booking_id%%:
        • +
        • %%booking_transaction_id%%:
        • +
        • %%admin_link%%:
        • +
        • %%total_attendees%%:
        • +
        • %%amount_tickets%%:
        • +
        • %%ticket_name%%:
        • +
        • %%ticket_time%%:
        • +
        • %%ticket_name_time%%:
        • +
        • %%ticket_private_description%%:
        • +
        • %%ticket_variations%%:
        • +
        • %%payment_gateway%%:
        • +
        • %%dl_file%%:
        • +
        • %%google_calendar_link%%:
        • +
        • %%google_calendar_link_next_occurrences%%:
        • +
        • %%event_start_date%%:
        • +
        • %%event_end_date%%:
        • +
        • %%event_start_time%%:
        • +
        • %%event_end_time%%:
        • +
        • %%event_timezone%%:
        • +
        • %%event_start_date_local%%:
        • +
        • %%event_end_date_local%%:
        • +
        • %%event_start_time_local%%:
        • +
        • %%event_end_time_local%%:
        • +
        • %%event_status%%:
        • +
        • %%event_note%%:
        • + +
        + + */ +class MEC_feature_occurrences extends MEC_base +{ + public $factory; + public $main; + public $settings; + public $db; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Factory + $this->factory = $this->getFactory(); + + // Import MEC Main + $this->main = $this->getMain(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + + // Import MEC DB + $this->db = $this->getDB(); + } + + /** + * Initialize occurrences feature + * @author Webnus + */ + public function init() + { + // Occurrences Status + $occurrences_status = isset($this->settings['per_occurrences_status']) && $this->settings['per_occurrences_status'] && $this->getPRO(); + + // Feature is not enabled + if(!$occurrences_status) return; + + // Tab + $this->factory->filter('mec-single-event-meta-title', array($this, 'tab'), 10, 3); + + // Metabox + $this->factory->action('mec_metabox_details', array($this, 'meta_box_occurrences'), 18); + + // Occurrences for FES + if(!isset($this->settings['fes_section_occurrences']) or (isset($this->settings['fes_section_occurrences']) and $this->settings['fes_section_occurrences'])) $this->factory->action('mec_fes_metabox_details', array($this, 'meta_box_occurrences'), 18); + + // AJAX + $this->factory->action('wp_ajax_mec_occurrences_add', array($this, 'add')); + $this->factory->action('wp_ajax_mec_occurrences_delete', array($this, 'delete')); + + // Save Data + $this->factory->action('mec_save_event_data', array($this, 'save'), 10, 2); + + $this->factory->filter('mec_occurrence_event_title', [$this, 'title'], 10, 2); + } + + public function tab($tabs, $activated, $post) + { + $draft = !(isset($post->post_status) && $post->post_status != 'auto-draft'); + $repeat_status = get_post_meta($post->ID, 'mec_repeat_status', true); + + if($draft or !$repeat_status) return $tabs; + + $tabs[__('Occurrences', 'modern-events-calendar-lite')] = 'mec-occurrences'; + return $tabs; + } + + /** + * Show occurrences of event into the Add/Edit event page + * + * @author Webnus + * @param WP_Post $post + */ + public function meta_box_occurrences($post) + { + FormBuilder::occurrences( $post ); + } + + public function delete() + { + // Check if our nonce is set. + if(!isset($_POST['_wpnonce'])) $this->main->response(array('success'=>0, 'code'=>'NONCE_MISSING')); + + // Verify that the nonce is valid. + if(!wp_verify_nonce(sanitize_text_field($_POST['_wpnonce']), 'mec_occurrences_delete')) $this->main->response(array('success'=>0, 'code'=>'NONCE_IS_INVALID')); + + $occurrence_id = isset($_POST['id']) ? sanitize_text_field($_POST['id']) : ''; + + // Request is invalid! + if(!trim($occurrence_id)) $this->main->response(array('success'=>0, 'code'=>'ID_IS_INVALID')); + + $this->db->q("DELETE FROM `#__mec_occurrences` WHERE `id`='".$this->db->escape($occurrence_id)."'"); + + $this->main->response(array('success'=>1)); + } + + public function add() + { + // Check if our nonce is set. + if(!isset($_POST['_wpnonce'])) $this->main->response(array('success'=>0, 'code'=>'NONCE_MISSING')); + + // Verify that the nonce is valid. + if(!wp_verify_nonce(sanitize_text_field($_POST['_wpnonce']), 'mec_occurrences_add')) $this->main->response(array('success'=>0, 'code'=>'NONCE_IS_INVALID')); + + $date = isset($_POST['date']) ? sanitize_text_field($_POST['date']) : ''; + $id = isset($_POST['id']) ? sanitize_text_field($_POST['id']) : ''; + + // Date is invalid! + if(!trim($date) or !trim($id)) $this->main->response(array('success'=>0, 'code'=>'DATE_OR_ID_IS_INVALID')); + + $dates = explode(':', $date); + + // Add Occurrence + $occurrence_id = $this->db->q("INSERT INTO `#__mec_occurrences` (`post_id`,`occurrence`,`params`) VALUES ('".$id."','".$dates[0]."','".json_encode(array())."')", 'insert'); + + $success = 1; + + ob_start(); + $this->get_occurrence_form($occurrence_id); + $html = ob_get_clean(); + + $this->main->response(array('success'=>$success, 'html'=>$html)); + } + + public function get_occurrence_form($occurrence_id) + { + $params = $this->get($occurrence_id); + $data = $this->get_data($occurrence_id); + + $event_id = $data['post_id'] ?? 0; + $post = get_post($event_id); + + $date_format = get_option('date_format'); + $time_format = get_option('time_format'); + $datetime_format = $date_format.' '.$time_format; + + $event_status = (isset($params['event_status']) and trim($params['event_status'])) ? $params['event_status'] : 'EventScheduled'; + $moved_online_link = (isset($params['moved_online_link']) and trim($params['moved_online_link'])) ? $params['moved_online_link'] : ''; + $cancelled_reason = (isset($params['cancelled_reason']) and trim($params['cancelled_reason'])) ? $params['cancelled_reason'] : ''; + $display_cancellation_reason_in_single_page = (isset($params['display_cancellation_reason_in_single_page']) and trim($params['display_cancellation_reason_in_single_page'])) ? $params['display_cancellation_reason_in_single_page'] : ''; + + $hourly_schedules = (isset($params['hourly_schedules']) and is_array($params['hourly_schedules'])) ? $params['hourly_schedules'] : []; + $fields_data = (isset($params['fields']) and is_array($params['fields'])) ? $params['fields'] : get_post_meta($post->ID, 'mec_fields', true); + + // Status of Speakers Feature + $speakers_status = isset($this->settings['speakers_status']) && $this->settings['speakers_status']; + $speakers = get_terms('mec_speaker', array( + 'orderby' => 'name', + 'order' => 'ASC', + 'hide_empty' => '0', + )); + + // Cost + $type = ((isset($this->settings['single_cost_type']) and trim($this->settings['single_cost_type'])) ? $this->settings['single_cost_type'] : 'numeric'); + + // Links + $read_more = (isset($params['read_more']) ? esc_attr($params['read_more']) : ''); + $more_info = (isset($params['more_info']) ? esc_attr($params['more_info']) : ''); + $more_info_title = (isset($params['more_info_title']) ? esc_attr($params['more_info_title']) : ''); + $more_info_target = (isset($params['more_info_target']) ? esc_attr($params['more_info_target']) : ''); + + // Locations + $locations = get_terms('mec_location', array('orderby'=>'name', 'hide_empty'=>'0')); + $location_id = (isset($params['location_id']) ? esc_attr($params['location_id']) : ''); + + $dont_show_map = (isset($params['dont_show_map']) ? esc_attr($params['dont_show_map']) : ''); + + // Organizers + $organizers = get_terms('mec_organizer', array('orderby'=>'name', 'hide_empty'=>'0')); + $organizer_id = (isset($params['organizer_id']) ? esc_attr($params['organizer_id']) : ''); + + // Tickets + $tickets = get_post_meta($event_id, 'mec_tickets', true); + if(!is_array($tickets)) $tickets = []; + + $occ_tickets = (isset($params['tickets']) and is_array($params['tickets'])) ? $params['tickets'] : []; + + // Bookings + $bookings = $this->main->get_bookings($event_id, $data['occurrence']); + + // All Occurrences + $occurrences = $this->get_dates($event_id, current_time('timestamp')); + ?> +
      • +

        + +
        +
        +
        +
        +
        +
        +
        +
        +
        +

        main->m('event_cost', esc_html__('SEO Schema / Event Status', 'modern-events-calendar-lite'))); ?>

        +
        +
        + +

        +
        +
        + +

        +
        +
        + +

        +
        +
        + +

        +
        +
        > +
        + + +
        +
        +

        +
        +
        + +
        + +
        +

        main->m('bookings', esc_html__('Bookings', 'modern-events-calendar-lite'))); ?>

        +

        + + +
        +
        + +
        + +
        +
        + +
        +
        + +

        +
        + +
        +
        +
        +
        + getFormBuilder(); + $builder->hourlySchedule([ + 'hourly_schedules' => $hourly_schedules, + 'speakers_status' => $speakers_status, + 'speakers' => $speakers, + 'wrapper_class' => '', + 'prefix' => 'mec_occurrences_'.esc_attr($occurrence_id).'_', + 'name_prefix' => 'mec[occurrences]['.esc_attr($occurrence_id).']', + ]); + ?> +
        +
        +
        +
        + getEventFields(); + $fields->form(array( + 'id' => 'mec_occurrences_event_fields_'.esc_attr($occurrence_id), + 'class' => 'no', + 'post' => $post, + 'data' => $fields_data, + 'id_prefix' => 'mec_occurrences_'.esc_attr($occurrence_id).'_', + 'name_prefix' => 'mec[occurrences]['.esc_attr($occurrence_id).']', + 'mandatory_status' => false, + )); + ?> +
        +
        +
        +
        +

        main->m('taxonomy_location', esc_html__('Location', 'modern-events-calendar-lite'))); ?>

        +
        + + +
        +
        +

        +
        + +
        +
        + + getPRO()): ?> +
        +
        + + +
        +
        + +
        +
        +
        +
        +

        main->m('taxonomy_organizer', esc_html__('Organizer', 'modern-events-calendar-lite'))); ?>

        +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        +
        +
        +

        main->m('event_cost', esc_html__('Event Cost', 'modern-events-calendar-lite'))); ?>

        +
        +
        + class="mec-col-3" name="mec[occurrences][][cost]" id="mec_occurrences__cost" value="" title="" placeholder=""/> +
        +
        +
        +
        + + +
        +
        +

        main->m('tickets', esc_html__('Tickets', 'modern-events-calendar-lite'))); ?>

        +
        + $ticket): if(!is_numeric($key)) continue; $occ_ticket = $occ_tickets[$key] ?? []; ?> +
        +
        + +
        +
        + +
        +
        + +
        +
        + +
        +
        +
        + + +
        +
        +

        +
        + + + ID, esc_attr($occurrence_id)); ?> +
        +
        + + + + +
        +
        +
        + +
      • + getBook(); + + foreach($occurrences as $occurrence) + { + // Clean Hourly Schedules + $raw_hourly_schedules = $occurrence['hourly_schedules'] ?? []; + if(isset($raw_hourly_schedules[':d:'])) unset($raw_hourly_schedules[':d:']); + + $hourly_schedules = []; + foreach($raw_hourly_schedules as $raw_hourly_schedule) + { + if(isset($raw_hourly_schedule['schedules'][':i:'])) unset($raw_hourly_schedule['schedules'][':i:']); + $hourly_schedules[] = $raw_hourly_schedule; + } + + // Hourly Schedules + $occurrence['hourly_schedules'] = $hourly_schedules; + + $location_id = $occurrence['location_id'] ?? ''; + if($location_id) $location_ids[] = $location_id; + + $organizer_id = $occurrence['organizer_id'] ?? ''; + if($organizer_id) $organizer_ids[] = $organizer_id; + + // Status + $status = $occurrence['event_status'] ?? 'EventScheduled'; + $bookings_status = $occurrence['cancel_bookings'] ?? ''; + $move_bookings_to = $occurrence['move_bookings_to'] ?? ''; + + if($status === 'EventCancelled' && trim($bookings_status)) + { + $timestamp = $this->db->select("SELECT occurrence FROM `#__mec_occurrences` WHERE `id`='".esc_sql($occurrence['id'])."'", 'loadResult'); + $bookings = $this->main->get_bookings($post_id, $timestamp); + + $occ_data = $this->get_data($occurrence['id']); + + foreach($bookings as $booking) + { + if($bookings_status === 'refund') $book->cancel($booking->ID, true); + elseif($bookings_status === 'move' && trim($move_bookings_to) && isset($occ_data['occurrence'])) $book->move($booking->ID, $occ_data['occurrence'], $move_bookings_to); + elseif($bookings_status === 'move_notify' && trim($move_bookings_to) && isset($occ_data['occurrence'])) + { + $book->move($booking->ID, $occ_data['occurrence'], $move_bookings_to); + $book->move_notify($booking->ID, $move_bookings_to); + } + else $book->cancel($booking->ID, false); + } + } + + + // Save Occurrence + $this->db->q("UPDATE `#__mec_occurrences` SET `params`='".json_encode($occurrence, JSON_UNESCAPED_UNICODE)."' WHERE `id`='".$this->db->escape($occurrence['id'])."'"); + } + + $organizer_ids = array_unique($organizer_ids); + foreach($organizer_ids as $organizer_id) wp_set_object_terms($post_id, (int) $organizer_id, 'mec_organizer', true); + + $location_ids = array_unique($location_ids); + foreach($location_ids as $location_id) wp_set_object_terms($post_id, (int) $location_id, 'mec_location', true); + } + + public function get_dates($post_id, $start, $limit = 100) + { + return $this->db->select("SELECT `tstart`, `tend` FROM `#__mec_dates` WHERE `post_id`='".$this->db->escape($post_id)."' AND `tstart`>='".$this->db->escape($start)."' ORDER BY `tstart` ASC LIMIT ".$this->db->escape($limit)); + } + + public function get($occurrence_id) + { + $JSON = $this->db->select("SELECT `params` FROM `#__mec_occurrences` WHERE `id`='".$this->db->escape($occurrence_id)."'", 'loadResult'); + + if(!trim($JSON)) return []; + else + { + $params = json_decode($JSON, true); + + if(!is_array($params)) return []; + else return $params; + } + } + + public function get_data($occurrence_id) + { + return $this->db->select("SELECT * FROM `#__mec_occurrences` WHERE `id`='".$this->db->escape($occurrence_id)."'", 'loadAssoc'); + } + + public function get_all_occurrences($post_id, $start = NULL) + { + return $this->db->select("SELECT * FROM `#__mec_occurrences` WHERE `post_id`='".$this->db->escape($post_id)."' ".($start ? "AND `occurrence`>='".$this->db->escape($start)."'" : '')." ORDER BY `occurrence` DESC LIMIT 200", 'loadAssocList'); + } + + public static function param($post_id, $timestamp, $key, $default = NULL) + { + // Main + $main = new MEC_main(); + + // Cache + $cache = $main->getCache(); + + // Get + $params = $cache->rememberOnce('mec_occ_param_'.$post_id.'_'.$timestamp.'_'.$key, function() use($main, $post_id, $timestamp) + { + $db = $main->getDB(); + $JSON = $db->select("SELECT `params` FROM `#__mec_occurrences` WHERE `post_id`='".$db->escape($post_id)."' AND `occurrence`='".$db->escape($timestamp)."' ORDER BY `id` DESC LIMIT 1", 'loadResult'); + + if(is_null($JSON) or !trim($JSON)) $params = []; + else $params = json_decode($JSON, true); + + return is_array($params) ? $params : []; + }); + + if($key == '*') return $params; + elseif(isset($params[$key]) and !is_array($params[$key]) and trim($params[$key]) != '') return $params[$key]; + elseif(isset($params[$key]) and is_array($params[$key])) return $params[$key]; + else return $default; + } + + public static function fetch($date_events = array()) + { + $occurrences = []; + $where = ''; + + foreach($date_events as $events) + { + foreach($events as $event) + { + $timestamp = (isset($event->date) and isset($event->date['start']) and isset($event->date['start']['timestamp']) and $event->date['start']['timestamp']) ? $event->date['start']['timestamp'] : NULL; + if(!$timestamp) continue; + + $occurrences[] = array($event->ID, $timestamp); + $where .= "(`post_id`=".esc_sql($event->ID)." AND `occurrence`=".esc_sql($timestamp).") OR "; + } + } + + // No Occurrences + if(!count($occurrences)) return; + + // Add to Cache + self::cache_fetched_occurrences($occurrences, $where); + } + + public static function fetch_single($event, $dates) + { + $occurrences = []; + $where = ''; + + foreach($dates as $date) + { + $timestamp = (isset($date) and isset($date['start']) and isset($date['start']['timestamp']) and $date['start']['timestamp']) ? $date['start']['timestamp'] : NULL; + if(!$timestamp) continue; + + $occurrences[] = array($event->ID, $timestamp); + $where .= "(`post_id`=".esc_sql($event->ID)." AND `occurrence`=".esc_sql($timestamp).") OR "; + } + + // No Occurrences + if(!count($occurrences)) return; + + // Add to Cache + self::cache_fetched_occurrences($occurrences, $where); + } + + public static function cache_fetched_occurrences($occurrences, $where) + { + // Main + $main = new MEC_main(); + + // Db + $db = $main->getDB(); + + // Records + $records = $db->select("SELECT `post_id`, `occurrence`, `params` FROM `#__mec_occurrences` WHERE ".rtrim($where, 'OR ')); + + // Mapped Records + $mapped_records = []; + + foreach($records as $record) + { + $JSON = $record->params; + + if(!trim($JSON)) $params = []; + else $params = json_decode($JSON, true); + + $mapped_records[$record->post_id.':'.$record->occurrence] = (is_array($params) ? $params : array()); + } + + // Cache + $cache = $main->getCache(); + + // Add to Cache + foreach($occurrences as $occurrence) + { + $post_id = $occurrence[0]; + $timestamp = $occurrence[1]; + + $value = $mapped_records[$post_id . ':' . $timestamp] ?? []; + $cache->set('mec_occ_param_'.$post_id.'_'.$timestamp, $value); + } + } + + public function title($title, $event) + { + $time = $event->data->time ?? []; + + if(is_array($time) && count($time) && isset($time['start_timestamp']) && $time['start_timestamp']) + { + $title = MEC_feature_occurrences::param($event->ID, $time['start_timestamp'], 'title', $title); + } + + return $title; + } +} \ No newline at end of file diff --git a/app/features/organizers.php b/app/features/organizers.php new file mode 100755 index 0000000..99ed7cd --- /dev/null +++ b/app/features/organizers.php @@ -0,0 +1,418 @@ + + */ +class MEC_feature_organizers extends MEC_base +{ + public $factory; + public $main; + public $settings; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Factory + $this->factory = $this->getFactory(); + + // Import MEC Main + $this->main = $this->getMain(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + } + + /** + * Initialize organizers feature + * @author Webnus + */ + public function init() + { + // Organizer Module is Disabled + if(isset($this->settings['organizers_status']) && !$this->settings['organizers_status']) return; + + $this->factory->action('init', array($this, 'register_taxonomy'), 25); + $this->factory->action('mec_organizer_edit_form_fields', array($this, 'edit_form')); + $this->factory->action('mec_organizer_add_form_fields', array($this, 'add_form')); + $this->factory->action('edited_mec_organizer', array($this, 'save_metadata')); + $this->factory->action('created_mec_organizer', array($this, 'save_metadata')); + + $this->factory->action('mec_metabox_details', array($this, 'meta_box_organizer'), 40); + if(!isset($this->settings['fes_section_organizer']) or (isset($this->settings['fes_section_organizer']) and $this->settings['fes_section_organizer'])) $this->factory->action('mec_fes_metabox_details', array($this, 'meta_box_organizer'), 31); + + $this->factory->filter('manage_edit-mec_organizer_columns', array($this, 'filter_columns')); + $this->factory->filter('manage_mec_organizer_custom_column', array($this, 'filter_columns_content'), 10, 3); + + $this->factory->action('save_post', array($this, 'save_event'), 2); + } + + /** + * Registers organizer taxonomy + * @author Webnus + */ + public function register_taxonomy() + { + $singular_label = $this->main->m('taxonomy_organizer', esc_html__('Organizer', 'modern-events-calendar-lite')); + $plural_label = $this->main->m('taxonomy_organizers', esc_html__('Organizers', 'modern-events-calendar-lite')); + + $organizer_args = apply_filters( + 'mec_register_taxonomy_args', + array( + 'label'=>$plural_label, + 'labels'=>array( + 'name'=>$plural_label, + 'singular_name'=>$singular_label, + 'all_items'=>sprintf(esc_html__('All %s', 'modern-events-calendar-lite'), $plural_label), + 'edit_item'=>sprintf(esc_html__('Edit %s', 'modern-events-calendar-lite'), $singular_label), + 'view_item'=>sprintf(esc_html__('View %s', 'modern-events-calendar-lite'), $singular_label), + 'update_item'=>sprintf(esc_html__('Update %s', 'modern-events-calendar-lite'), $singular_label), + 'add_new_item'=>sprintf(esc_html__('Add New %s', 'modern-events-calendar-lite'), $singular_label), + 'new_item_name'=>sprintf(esc_html__('New %s Name', 'modern-events-calendar-lite'), $singular_label), + 'popular_items'=>sprintf(esc_html__('Popular %s', 'modern-events-calendar-lite'), $plural_label), + 'search_items'=>sprintf(esc_html__('Search %s', 'modern-events-calendar-lite'), $plural_label), + 'back_to_items'=>sprintf(esc_html__('← Back to %s', 'modern-events-calendar-lite'), $plural_label), + 'not_found'=>sprintf(esc_html__('no %s found.', 'modern-events-calendar-lite'), strtolower($plural_label)), + ), + 'rewrite'=>array('slug'=>'events-organizer'), + 'public'=>false, + 'show_ui'=>true, + 'hierarchical'=>false, + ), + 'mec_organizer' + ); + register_taxonomy( + 'mec_organizer', + $this->main->get_main_post_type(), + $organizer_args + ); + + register_taxonomy_for_object_type('mec_organizer', $this->main->get_main_post_type()); + } + + /** + * Show edit form of organizer taxonomy + * @author Webnus + * @param object $term + */ + public function edit_form($term) + { + $tel = get_metadata('term', $term->term_id, 'tel', true); + $email = get_metadata('term', $term->term_id, 'email', true); + $url = get_metadata('term', $term->term_id, 'url', true); + $page_label = get_metadata('term', $term->term_id, 'page_label', true); + $facebook = get_metadata('term', $term->term_id, 'facebook', true); + $instagram = get_metadata('term', $term->term_id, 'instagram', true); + $linkedin = get_metadata('term', $term->term_id, 'linkedin', true); + $twitter = get_metadata('term', $term->term_id, 'twitter', true); + $thumbnail = get_metadata('term', $term->term_id, 'thumbnail', true); + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        '; ?>
        + + + + + + + + */ + public function add_form() + { + ?> +
        + + +
        +
        + + +
        +
        + + +
        +
        + + +
        +
        + + +
        +
        + + +
        +
        + + +
        +
        + + +
        +
        + +
        + + + +
        + + + * @param int $term_id + */ + public function save_metadata($term_id) + { + // Quick Edit + if(!isset($_POST['tel'])) return; + + $tel = isset($_POST['tel']) ? sanitize_text_field($_POST['tel']) : ''; + $email = isset($_POST['email']) ? sanitize_text_field($_POST['email']) : ''; + $url = (isset($_POST['url']) and trim($_POST['url'])) ? sanitize_url($_POST['url']) : ''; + $page_label = (isset($_POST['page_label']) and trim($_POST['page_label'])) ? sanitize_text_field($_POST['page_label']) : ''; + $facebook = (isset($_POST['facebook']) and trim($_POST['facebook'])) ? esc_url($_POST['facebook']) : ''; + $twitter = (isset($_POST['twitter']) and trim($_POST['twitter'])) ? esc_url($_POST['twitter']) : ''; + $instagram = (isset($_POST['instagram']) and trim($_POST['instagram'])) ? esc_url($_POST['instagram']) : ''; + $linkedin = (isset($_POST['linkedin']) and trim($_POST['linkedin'])) ? esc_url($_POST['linkedin']) : ''; + $thumbnail = isset($_POST['thumbnail']) ? sanitize_text_field($_POST['thumbnail']) : ''; + + update_term_meta($term_id, 'tel', $tel); + update_term_meta($term_id, 'email', $email); + update_term_meta($term_id, 'url', $url); + update_term_meta($term_id, 'page_label', $page_label); + update_term_meta($term_id, 'facebook', $facebook); + update_term_meta($term_id, 'twitter', $twitter); + update_term_meta($term_id, 'instagram', $instagram); + update_term_meta($term_id, 'linkedin', $linkedin); + update_term_meta($term_id, 'thumbnail', $thumbnail); + + do_action('mec_save_organizer_extra_fields', $term_id); + } + + /** + * Filter columns of organizer taxonomy + * @author Webnus + * @param array $columns + * @return array + */ + public function filter_columns($columns) + { + unset($columns['name']); + unset($columns['slug']); + unset($columns['description']); + unset($columns['posts']); + + $columns['id'] = esc_html__('ID', 'modern-events-calendar-lite'); + $columns['name'] = $this->main->m('taxonomy_organizer', esc_html__('Organizer', 'modern-events-calendar-lite')); + $columns['contact'] = esc_html__('Contact info', 'modern-events-calendar-lite'); + $columns['posts'] = esc_html__('Count', 'modern-events-calendar-lite'); + $columns['slug'] = esc_html__('Slug', 'modern-events-calendar-lite'); + + return apply_filters('organizer_filter_column', $columns); + } + + /** + * Filter content of organizer taxonomy columns + * @author Webnus + * @param string $content + * @param string $column_name + * @param int $term_id + * @return string + */ + public function filter_columns_content($content, $column_name, $term_id) + { + switch($column_name) + { + case 'id': + + $content = $term_id; + break; + + case 'contact': + + $tel = get_metadata('term', $term_id, 'tel', true); + $email = get_metadata('term', $term_id, 'email', true); + + $content = $email.(trim($tel) ? '
        '.$tel : ''); + break; + + default: + break; + } + + return apply_filters('organizer_filter_column_content', $content, $column_name, $term_id); + } + + /** + * Show organizer meta box + * @author Webnus + * @param object $post + */ + public function meta_box_organizer($post){ + + FormBuilder::organizers( $post ); + } + + /** + * Save event organizer data + * @author Webnus + * @param int $post_id + * @return boolean + */ + public function save_event($post_id) + { + // Check if our nonce is set. + if(!isset($_POST['mec_event_nonce'])) return false; + + // Verify that the nonce is valid. + if(!wp_verify_nonce(sanitize_text_field($_POST['mec_event_nonce']), 'mec_event_data')) return false; + + // If this is an autosave, our form has not been submitted, so we don't want to do anything. + if(defined('DOING_AUTOSAVE') and DOING_AUTOSAVE) return false; + + $action = (isset($_POST['action']) ? sanitize_text_field($_POST['action']) : ''); + if($action === 'mec_fes_form') return false; + + // Get Modern Events Calendar Data + $_mec = isset($_POST['mec']) ? $this->main->sanitize_deep_array($_POST['mec']) : []; + + // Selected a saved organizer + if(isset($_mec['organizer_id']) and $_mec['organizer_id']) + { + // Set term to the post + wp_set_object_terms($post_id, (int) sanitize_text_field($_mec['organizer_id']), 'mec_organizer'); + + return true; + } + + $name = (isset($_mec['organizer']['name']) and trim($_mec['organizer']['name'])) ? sanitize_text_field($_mec['organizer']['name']) : esc_html__('Organizer Name', 'modern-events-calendar-lite'); + + $term = get_term_by('name', $name, 'mec_organizer'); + + // Term already exists + if(is_object($term) and isset($term->term_id)) + { + // Set term to the post + wp_set_object_terms($post_id, (int) $term->term_id, 'mec_organizer'); + + return true; + } + + $term = wp_insert_term($name, 'mec_organizer'); + + // An error occurred + if(is_wp_error($term)) return false; + + $organizer_id = $term['term_id']; + + if(!$organizer_id) return false; + + // Set Organizer ID to the parameters + $_POST['mec']['organizer_id'] = $organizer_id; + + // Set term to the post + wp_set_object_terms($post_id, (int) $organizer_id, 'mec_organizer'); + + $tel = (isset($_mec['organizer']['tel']) and trim($_mec['organizer']['tel'])) ? sanitize_text_field($_mec['organizer']['tel']) : ''; + $email = (isset($_mec['organizer']['email']) and trim($_mec['organizer']['email'])) ? sanitize_text_field($_mec['organizer']['email']) : ''; + $url = (isset($_mec['organizer']['url']) and trim($_mec['organizer']['url'])) ? sanitize_url($_mec['organizer']['url']) : ''; + $page_label = (isset($_mec['organizer']['page_label']) and trim($_mec['organizer']['page_label'])) ? sanitize_text_field($_mec['organizer']['page_label']) : ''; + $thumbnail = (isset($_mec['organizer']['thumbnail']) and trim($_mec['organizer']['thumbnail'])) ? sanitize_text_field($_mec['organizer']['thumbnail']) : ''; + + update_term_meta($organizer_id, 'tel', $tel); + update_term_meta($organizer_id, 'email', $email); + update_term_meta($organizer_id, 'url', $url); + update_term_meta($organizer_id, 'page_label', $page_label); + update_term_meta($organizer_id, 'thumbnail', $thumbnail); + + return true; + } +} \ No newline at end of file diff --git a/app/features/partial.php b/app/features/partial.php new file mode 100755 index 0000000..2ccf420 --- /dev/null +++ b/app/features/partial.php @@ -0,0 +1,77 @@ + + */ +class MEC_feature_partial extends MEC_base +{ + /** + * @var MEC_factory + */ + public $factory; + + /** + * @var MEC_main + */ + public $main; + + /** + * Partial Payment Library + * @var MEC_partial + */ + public $partial_payment; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Factory + $this->factory = $this->getFactory(); + + // Import MEC Main + $this->main = $this->getMain(); + + // Import Partial Payment + $this->partial_payment = $this->getPartialPayment(); + } + + /** + * Initialize + * @author Webnus + */ + public function init() + { + // Pro version is required + if(!$this->getPRO()) return false; + + // Partial Payment is not enabled + if(!$this->partial_payment->is_enabled()) return false; + + // Validate Settings Form + add_filter('mec_validate_general_settings_options', [$this, 'validate_settings_form'], 10, 1); + + return true; + } + + public function validate_settings_form($all_options) + { + // It's not a settings form + if(!isset($all_options['settings'])) return $all_options; + + $payable = isset($all_options['settings']['booking_payable']) ? $all_options['settings']['booking_payable'] : 100; + $payable_type = isset($all_options['settings']['booking_payable_type']) ? $all_options['settings']['booking_payable_type'] : 'percent'; + + // Validate + [$payable, $payable_type] = $this->partial_payment->validate_payable_options($payable, $payable_type); + + $all_options['settings']['booking_payable'] = $payable; + $all_options['settings']['booking_payable_type'] = $payable_type; + + return $all_options; + } +} \ No newline at end of file diff --git a/app/features/popup.php b/app/features/popup.php new file mode 100755 index 0000000..643172d --- /dev/null +++ b/app/features/popup.php @@ -0,0 +1,681 @@ + + */ +class MEC_feature_popup extends MEC_base +{ + public $factory; + public $main; + public $settings; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Factory + $this->factory = $this->getFactory(); + + // Import MEC Main + $this->main = $this->getMain(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + } + + /** + * Initialize popup feature + * @author Webnus + */ + public function init() + { + // Shortcode & Event Popup + $this->factory->action('restrict_manage_posts', array($this, 'add_popup')); + + // Shortcode Save + $this->factory->action('wp_ajax_mec_popup_shortcode', array($this, 'shortcode_save')); + + // Event Save + $this->factory->action('wp_ajax_mec_popup_event', array($this, 'event_save')); + $this->factory->action('wp_ajax_mec_popup_event_category', array($this, 'save_category')); + } + + public function add_popup($post_type) + { + // Shortcode Popup + if($post_type == $this->main->get_shortcode_post_type()) + { + $path = MEC::import('app.features.popup.shortcode', true, true); + include $path; + } + //Event Popup + elseif($post_type == $this->main->get_main_post_type()) + { + $path = MEC::import('app.features.popup.event', true, true); + include $path; + } + } + + public function shortcode_save() + { + // Security Nonce + $wpnonce = isset($_POST['_mecnonce']) ? sanitize_text_field($_POST['_mecnonce']) : NULL; + + // Check if our nonce is set. + if(!trim($wpnonce)) $this->main->response(array('success'=>0, 'code'=>'NONCE_MISSING')); + + // Verify that the nonce is valid. + if(!wp_verify_nonce($wpnonce, 'mec_shortcode_popup')) $this->main->response(array('success'=>0, 'code'=>'NONCE_IS_INVALID')); + + $params = (isset($_POST['shortcode']) and is_array($_POST['shortcode'])) ? $this->main->sanitize_deep_array($_POST['shortcode']) : []; + + $skin = isset($params['skin']) ? sanitize_text_field($params['skin']) : 'list'; + $title = isset($params['name']) ? sanitize_text_field($params['name']) : ucwords(str_replace('_', ' ', $skin)); + + $show_past_events = isset($params['show_past_events']) ? sanitize_text_field($params['show_past_events']) : 1; + $show_only_past_events = isset($params['show_only_past_events']) ? sanitize_text_field($params['show_only_past_events']) : 0; + $show_only_ongoing_events = isset($params['show_only_ongoing_events']) ? sanitize_text_field($params['show_only_ongoing_events']) : 0; + + $sed = isset($params['sed']) ? sanitize_text_field($params['sed']) : 0; + $style = isset($params['style']) ? sanitize_text_field($params['style']) : 'clean'; + $event = isset($params['event']) ? sanitize_text_field($params['event']) : 0; + $custom_style = isset($params['custom_style']) ? sanitize_text_field($params['custom_style']) : ''; + + $skin_options = array( + 'list' => array( + 'style' => $style, + 'start_date_type' => 'today', + 'start_date' => '', + 'maximum_date_range' => '', + 'include_events_times' => 0, + 'pagination_method' => 'loadmore', + 'month_divider' => 1, + 'map_on_top' => 0, + 'set_geolocation' => 0, + 'toggle_month_divider' => 0, + ), + 'grid' => array( + 'style' => $style, + 'start_date_type' => 'today', + 'start_date' => '', + 'maximum_date_range' => '', + 'count' => 3, + 'pagination_method' => 'loadmore', + 'map_on_top' => 0, + 'set_geolocation' => 0, + ), + 'agenda' => array( + 'style' => $style, + 'start_date_type' => 'today', + 'start_date' => '', + 'maximum_date_range' => '', + 'month_divider' => 1, + 'pagination_method' => 'loadmore', + ), + 'full_calendar' => array( + 'start_date_type' => 'start_current_month', + 'default_view' => 'list', + 'monthly_style' => $style, + 'list' => 1, + 'yearly' => 0, + 'monthly' => 1, + 'weekly' => 1, + 'daily' => 1, + 'display_price' => 0, + ), + 'yearly_view' => array( + 'style' => $style, + 'start_date_type' => 'start_current_year', + 'start_date' => '', + 'next_previous_button' => 1, + ), + 'monthly_view' => array( + 'style' => $style, + 'start_date_type' => 'start_current_month', + 'start_date' => '', + 'next_previous_button' => 1, + ), + 'map' => array( + 'start_date_type' => 'today', + 'start_date' => '', + 'limit' => 200, + 'geolocation' => 0, + ), + 'daily_view' => array( + 'start_date_type' => 'today', + 'start_date' => '', + 'next_previous_button' => 1, + ), + 'weekly_view' => array( + 'start_date_type' => 'start_current_week', + 'start_date' => '', + 'next_previous_button' => 1, + ), + 'timetable' => array( + 'style' => $style, + 'start_date_type' => 'start_current_week', + 'start_date' => '', + 'number_of_days' => 5, + 'week_start' => -1, + 'start_time' => 8, + 'end_time' => 20, + 'next_previous_button' => 1, + ), + 'masonry' => array( + 'start_date_type' => 'today', + 'start_date' => '', + 'maximum_date_range' => '', + 'filter_by' => '', + 'fit_to_row' => 0, + 'masonry_like_grid' => 0, + 'pagination_method' => 'loadmore', + ), + 'cover' => array( + 'style' => $style, + 'event_id' => $event, + ), + 'countdown' => array( + 'style' => $style, + 'event_id' => $event, + ), + 'available_spot' => array( + 'event_id' => $event, + ), + 'carousel' => array( + 'style' => $style, + 'start_date_type' => 'today', + 'start_date' => '', + 'count' => 3, + 'autoplay' => 1, + ), + 'slider' => array( + 'style' => $style, + 'start_date_type' => 'today', + 'start_date' => '', + 'autoplay' => 1, + ), + 'timeline' => array( + 'start_date_type' => 'today', + 'start_date' => '', + 'maximum_date_range' => '', + 'pagination_method' => 'loadmore', + 'month_divider' => 0, + ), + 'tile' => array( + 'start_date_type' => 'start_current_month', + 'start_date' => '', + 'count' => 4, + 'next_previous_button' => 1, + ), + 'custom' => array( + 'style' => $custom_style, + ), + ); + + $sk = $skin_options[$skin] ?? ['style' => $style, 'start_date_type' => 'today', 'start_date' => '']; + + $sk['sed_method'] = $sed; + $sk['image_popup'] = 0; + + $sf = []; + $sf_status = 0; + $sf_display_label = ''; + + if($skin == 'full_calendar') + { + $sf = array('month_filter'=>array('type'=>'dropdown'), 'text_search'=>array('type'=>'text_input')); + $sf_status = 1; + } + + // Create Default Calendars + $metas = array( + 'label' => '', + 'category' => '', + 'location' => '', + 'organizer' => '', + 'tag' => '', + 'author' => '', + 'skin' => $skin, + 'sk-options' => array( + $skin => $sk + ), + 'sf-options' => array($skin => $sf), + 'sf_status' => $sf_status, + 'sf_display_label' => $sf_display_label, + 'show_past_events' => $show_past_events, + 'show_only_past_events' => $show_only_past_events, + 'show_only_ongoing_events' => $show_only_ongoing_events, + ); + + $post = array('post_title'=>$title, 'post_content'=>'', 'post_type'=>'mec_calendars', 'post_status'=>'publish'); + $post_id = wp_insert_post($post); + + foreach($metas as $key=>$value) update_post_meta($post_id, $key, $value); + + $this->main->response(array('success'=>1, 'id'=>$post_id)); + } + + public function event_save() + { + // Security Nonce + $wpnonce = isset($_POST['_mecnonce']) ? sanitize_text_field($_POST['_mecnonce']) : NULL; + + // Check if our nonce is set. + if(!trim($wpnonce)) $this->main->response(array('success'=>0, 'code'=>'NONCE_MISSING')); + + // Verify that the nonce is valid. + if(!wp_verify_nonce($wpnonce, 'mec_event_popup')) $this->main->response(array('success'=>0, 'code'=>'NONCE_IS_INVALID')); + + $mec = (isset($_POST['mec']) and is_array($_POST['mec'])) ? $this->main->sanitize_deep_array($_POST['mec'], 'text', array('content', 'excerpt')) : []; + + $post_title = isset($mec['title']) ? sanitize_text_field($mec['title']) : ''; + $post_content = isset($mec['content']) ? MEC_kses::page($mec['content']) : ''; + $featured_image = isset($mec['featured_image']) ? sanitize_text_field($mec['featured_image']) : ''; + + // Post Status + $status = 'pending'; + if(current_user_can('publish_posts')) $status = 'publish'; + + $post = array('post_title'=>$post_title, 'post_content'=>$post_content, 'post_type'=>$this->main->get_main_post_type(), 'post_status'=>$status); + $post_id = wp_insert_post($post); + + // Categories + $categories = (isset($_POST['tax_input']) and isset($_POST['tax_input']['mec_category']) and is_array($_POST['tax_input']['mec_category'])) ? $this->main->sanitize_deep_array($_POST['tax_input']['mec_category']) : []; + wp_set_post_terms($post_id, $categories, 'mec_category'); + + // Color + $color = isset($mec['color']) ? sanitize_text_field(trim($mec['color'], '# ')) : ''; + update_post_meta($post_id, 'mec_color', $color); + + // Featured Image + if($featured_image) set_post_thumbnail($post_id, $featured_image); + + // Location + $location_id = isset($mec['location_id']) ? sanitize_text_field($mec['location_id']) : 0; + + // Selected a saved location + if($location_id) + { + // Set term to the post + wp_set_object_terms($post_id, (int) $location_id, 'mec_location'); + } + else + { + $address = (isset($mec['location']['address']) and trim($mec['location']['address'])) ? sanitize_text_field($mec['location']['address']) : ''; + $name = (isset($mec['location']['name']) and trim($mec['location']['name'])) ? sanitize_text_field($mec['location']['name']) : (trim($address) ? $address : esc_html__('Location Name', 'modern-events-calendar-lite')); + + $term = get_term_by('name', $name, 'mec_location'); + + // Term already exists + if(is_object($term) and isset($term->term_id)) + { + // Set term to the post + wp_set_object_terms($post_id, (int) $term->term_id, 'mec_location'); + + $location_id = (int) $term->term_id; + } + else + { + $term = wp_insert_term($name, 'mec_location'); + + $location_id = $term['term_id']; + if($location_id) + { + // Set term to the post + wp_set_object_terms($post_id, (int) $location_id, 'mec_location'); + + $latitude = (isset($mec['location']['latitude']) and trim($mec['location']['latitude'])) ? sanitize_text_field($mec['location']['latitude']) : 0; + $longitude = (isset($mec['location']['longitude']) and trim($mec['location']['longitude'])) ? sanitize_text_field($mec['location']['longitude']) : 0; + $thumbnail = (isset($mec['location']['thumbnail']) and trim($mec['location']['thumbnail'])) ? sanitize_text_field($mec['location']['thumbnail']) : ''; + + if(!trim($latitude) or !trim($longitude)) + { + $geo_point = $this->main->get_lat_lng($address); + + $latitude = $geo_point[0]; + $longitude = $geo_point[1]; + } + + update_term_meta($location_id, 'address', $address); + update_term_meta($location_id, 'latitude', $latitude); + update_term_meta($location_id, 'longitude', $longitude); + update_term_meta($location_id, 'thumbnail', $thumbnail); + } + else $location_id = 1; + } + } + + update_post_meta($post_id, 'mec_location_id', $location_id); + + $dont_show_map = isset($mec['dont_show_map']) ? sanitize_text_field($mec['dont_show_map']) : 0; + update_post_meta($post_id, 'mec_dont_show_map', $dont_show_map); + + // Organizer + $organizer_id = isset($mec['organizer_id']) ? sanitize_text_field($mec['organizer_id']) : 0; + + if(!isset($this->settings['organizers_status']) || $this->settings['organizers_status']) + { + // Selected a saved organizer + if($organizer_id) + { + // Set term to the post + wp_set_object_terms($post_id, (int) $organizer_id, 'mec_organizer'); + } + else + { + $name = (isset($mec['organizer']['name']) and trim($mec['organizer']['name'])) ? sanitize_text_field($mec['organizer']['name']) : esc_html__('Organizer Name', 'modern-events-calendar-lite'); + + $term = get_term_by('name', $name, 'mec_organizer'); + + // Term already exists + if(is_object($term) and isset($term->term_id)) + { + // Set term to the post + wp_set_object_terms($post_id, (int) $term->term_id, 'mec_organizer'); + $organizer_id = (int) $term->term_id; + } + else + { + $term = wp_insert_term($name, 'mec_organizer'); + + $organizer_id = $term['term_id']; + if($organizer_id) + { + // Set term to the post + wp_set_object_terms($post_id, (int) $organizer_id, 'mec_organizer'); + + $tel = (isset($mec['organizer']['tel']) and trim($mec['organizer']['tel'])) ? sanitize_text_field($mec['organizer']['tel']) : ''; + $email = (isset($mec['organizer']['email']) and trim($mec['organizer']['email'])) ? sanitize_text_field($mec['organizer']['email']) : ''; + $url = (isset($mec['organizer']['url']) and trim($mec['organizer']['url'])) ? sanitize_url($mec['organizer']['url']) : ''; + $thumbnail = (isset($mec['organizer']['thumbnail']) and trim($mec['organizer']['thumbnail'])) ? sanitize_text_field($mec['organizer']['thumbnail']) : ''; + + update_term_meta($organizer_id, 'tel', $tel); + update_term_meta($organizer_id, 'email', $email); + update_term_meta($organizer_id, 'url', $url); + update_term_meta($organizer_id, 'thumbnail', $thumbnail); + } + else $organizer_id = 1; + } + } + } + + update_post_meta($post_id, 'mec_organizer_id', $organizer_id); + + // Date Options + $date = $mec['date'] ?? []; + + $start_date = (isset($date['start']['date']) and trim($date['start']['date'])) ? $this->main->standardize_format(sanitize_text_field($date['start']['date'])) : date('Y-m-d'); + $end_date = (isset($date['end']['date']) and trim($date['end']['date'])) ? $this->main->standardize_format(sanitize_text_field($date['end']['date'])) : date('Y-m-d'); + + // Set the start date + $date['start']['date'] = $start_date; + + $start_time_hour = isset($date['start']) ? sanitize_text_field($date['start']['hour']) : '8'; + $start_time_minutes = isset($date['start']) ? sanitize_text_field($date['start']['minutes']) : '00'; + $start_time_ampm = (isset($date['start']) and isset($date['start']['ampm'])) ? sanitize_text_field($date['start']['ampm']) : 'AM'; + + // Fix end_date if it's smaller than start_date + if(strtotime($end_date) < strtotime($start_date)) $end_date = $start_date; + + // Set the end date + $date['end']['date'] = $end_date; + + $end_time_hour = isset($date['end']) ? sanitize_text_field($date['end']['hour']) : '6'; + $end_time_minutes = isset($date['end']) ? sanitize_text_field($date['end']['minutes']) : '00'; + $end_time_ampm = (isset($date['end']) and isset($date['end']['ampm'])) ? sanitize_text_field($date['end']['ampm']) : 'PM'; + + if(isset($this->settings['time_format']) and $this->settings['time_format'] == 24) + { + $day_start_seconds = $this->main->time_to_seconds($this->main->to_24hours($start_time_hour, NULL, 'start'), $start_time_minutes); + $day_end_seconds = $this->main->time_to_seconds($this->main->to_24hours($end_time_hour, NULL, 'end'), $end_time_minutes); + } + else + { + $day_start_seconds = $this->main->time_to_seconds($this->main->to_24hours($start_time_hour, $start_time_ampm, 'start'), $start_time_minutes); + $day_end_seconds = $this->main->time_to_seconds($this->main->to_24hours($end_time_hour, $end_time_ampm, 'end'), $end_time_minutes); + } + + if($end_date === $start_date and $day_end_seconds < $day_start_seconds) + { + $day_end_seconds = $day_start_seconds; + + $end_time_hour = $start_time_hour; + $end_time_minutes = $start_time_minutes; + $end_time_ampm = $start_time_ampm; + + $date['end']['hour'] = $start_time_hour; + $date['end']['minutes'] = $start_time_minutes; + $date['end']['ampm'] = $start_time_ampm; + } + + // If 24 hours format is enabled then convert it back to 12 hours + if(isset($this->settings['time_format']) and $this->settings['time_format'] == 24) + { + if($start_time_hour < 12) $start_time_ampm = 'AM'; + elseif($start_time_hour == 12) $start_time_ampm = 'PM'; + elseif($start_time_hour > 12) + { + $start_time_hour -= 12; + $start_time_ampm = 'PM'; + } + elseif($start_time_hour == 0) + { + $start_time_hour = 12; + $start_time_ampm = 'AM'; + } + + if($end_time_hour < 12) $end_time_ampm = 'AM'; + elseif($end_time_hour == 12) $end_time_ampm = 'PM'; + elseif($end_time_hour > 12) + { + $end_time_hour -= 12; + $end_time_ampm = 'PM'; + } + elseif($end_time_hour == 0) + { + $end_time_hour = 12; + $end_time_ampm = 'AM'; + } + + // Set converted values to date array + $date['start']['hour'] = $start_time_hour; + $date['start']['ampm'] = $start_time_ampm; + + $date['end']['hour'] = $end_time_hour; + $date['end']['ampm'] = $end_time_ampm; + } + + $allday = isset($date['allday']) ? 1 : 0; + + // Set start time and end time if event is all day + if($allday == 1) + { + $start_time_hour = '8'; + $start_time_minutes = '00'; + $start_time_ampm = 'AM'; + + $end_time_hour = '6'; + $end_time_minutes = '00'; + $end_time_ampm = 'PM'; + } + + $start_datetime = $start_date.' '.sprintf('%02d', $start_time_hour).':'.sprintf('%02d', $start_time_minutes).' '.$start_time_ampm; + $end_datetime = $end_date.' '.sprintf('%02d', $end_time_hour).':'.sprintf('%02d', $end_time_minutes).' '.$end_time_ampm; + + update_post_meta($post_id, 'mec_start_date', $start_date); + update_post_meta($post_id, 'mec_start_time_hour', $start_time_hour); + update_post_meta($post_id, 'mec_start_time_minutes', $start_time_minutes); + update_post_meta($post_id, 'mec_start_time_ampm', $start_time_ampm); + update_post_meta($post_id, 'mec_start_day_seconds', $day_start_seconds); + update_post_meta($post_id, 'mec_start_datetime', $start_datetime); + + update_post_meta($post_id, 'mec_end_date', $end_date); + update_post_meta($post_id, 'mec_end_time_hour', $end_time_hour); + update_post_meta($post_id, 'mec_end_time_minutes', $end_time_minutes); + update_post_meta($post_id, 'mec_end_time_ampm', $end_time_ampm); + update_post_meta($post_id, 'mec_end_day_seconds', $day_end_seconds); + update_post_meta($post_id, 'mec_end_datetime', $end_datetime); + + // Repeat Options + $repeat = []; + $repeat_type = NULL; + $repeat_status = 0; + + $repeat_end = ''; + $repeat_end_at_occurrences = ''; + $repeat_end_at_date = ''; + + update_post_meta($post_id, 'mec_date', $date); + update_post_meta($post_id, 'mec_repeat', $repeat); + update_post_meta($post_id, 'mec_certain_weekdays', ''); + update_post_meta($post_id, 'mec_allday', $allday); + update_post_meta($post_id, 'mec_hide_time', 0); + update_post_meta($post_id, 'mec_hide_end_time', 0); + update_post_meta($post_id, 'mec_comment', ''); + update_post_meta($post_id, 'mec_repeat_status', $repeat_status); + update_post_meta($post_id, 'mec_repeat_type', ''); + update_post_meta($post_id, 'mec_repeat_interval', ''); + update_post_meta($post_id, 'mec_repeat_end', $repeat_end); + update_post_meta($post_id, 'mec_repeat_end_at_occurrences', $repeat_end_at_occurrences); + update_post_meta($post_id, 'mec_repeat_end_at_date', $repeat_end_at_date); + update_post_meta($post_id, 'mec_advanced_days', ''); + + // Creating $event array for inserting in mec_events table + $event = array('post_id'=>$post_id, 'start'=>$start_date, 'repeat'=>$repeat_status, 'rinterval'=>NULL, 'time_start'=>$day_start_seconds, 'time_end'=>$day_end_seconds); + + $year = NULL; + $month = NULL; + $day = NULL; + $week = NULL; + $weekday = NULL; + $weekdays = NULL; + + $in_days = ''; + $not_in_days = ''; + + update_post_meta($post_id, 'mec_in_days', $in_days); + update_post_meta($post_id, 'mec_not_in_days', $not_in_days); + + // Repeat End Date + $repeat_end_date = '0000-00-00'; + + // Add parameters to the $event + $event['end'] = $repeat_end_date; + $event['year'] = $year; + $event['month'] = $month; + $event['day'] = $day; + $event['week'] = $week; + $event['weekday'] = $weekday; + $event['weekdays'] = $weekdays; + $event['days'] = $in_days; + $event['not_in_days'] = $not_in_days; + + // DB Library + $db = $this->getDB(); + + // Update MEC Events Table + $mec_event_id = $db->select("SELECT `id` FROM `#__mec_events` WHERE `post_id`='".$db->escape($post_id)."'", 'loadResult'); + + if(!$mec_event_id) + { + $q1 = ""; + $q2 = ""; + + foreach($event as $key=>$value) + { + $q1 .= "`$key`,"; + + if(is_null($value)) $q2 .= "NULL,"; + else $q2 .= "'$value',"; + } + + $db->q("INSERT INTO `#__mec_events` (".trim($q1, ', ').") VALUES (".trim($q2, ', ').")", 'INSERT'); + } + else + { + $q = ""; + + foreach($event as $key=>$value) + { + if(is_null($value)) $q .= "`$key`=NULL,"; + else $q .= "`$key`='$value',"; + } + + $db->q("UPDATE `#__mec_events` SET ".trim($q, ', ')." WHERE `id`='$mec_event_id'"); + } + + // Update Schedule + $schedule = $this->getSchedule(); + $schedule->reschedule($post_id, $schedule->get_reschedule_maximum($repeat_type)); + + // Hourly Schedule Options + $hourly_schedules = []; + update_post_meta($post_id, 'mec_hourly_schedules', $hourly_schedules); + + // Booking and Ticket Options + $booking = []; + update_post_meta($post_id, 'mec_booking', $booking); + + $tickets = []; + update_post_meta($post_id, 'mec_tickets', $tickets); + + // Fee options + $fees_global_inheritance = 1; + update_post_meta($post_id, 'mec_fees_global_inheritance', $fees_global_inheritance); + + $fees = []; + update_post_meta($post_id, 'mec_fees', $fees); + + // Ticket Variation options + $ticket_variations_global_inheritance = 1; + update_post_meta($post_id, 'mec_ticket_variations_global_inheritance', $ticket_variations_global_inheritance); + + $ticket_variations = []; + update_post_meta($post_id, 'mec_ticket_variations', $ticket_variations); + + // Registration Fields options + $reg_fields_global_inheritance = 1; + update_post_meta($post_id, 'mec_reg_fields_global_inheritance', $reg_fields_global_inheritance); + + $reg_fields = []; + update_post_meta($post_id, 'mec_reg_fields', $reg_fields); + + // Organizer Payment Options + $op = []; + update_post_meta($post_id, 'mec_op', $op); + update_user_meta(get_post_field('post_author', $post_id), 'mec_op', $op); + + // For Event Notification Badge. + update_post_meta($post_id, 'mec_event_date_submit', date('YmdHis', current_time('timestamp', 0))); + + do_action('mec_after_publish_admin_event', $post_id, false); + + // Save Event Data + do_action('mec_save_event_data', $post_id, $mec); + + $this->main->response(array( + 'success' => 1, + 'id' => $post_id, + 'link' => get_post_permalink($post_id), + )); + } + + public function save_category() + { + $category = isset($_POST['category']) ? sanitize_text_field($_POST['category']) : ''; + + $term = term_exists($category, 'mec_category'); + if(!$term) + { + $term = wp_insert_term($category, 'mec_category'); + $category_id = $term['term_id']; + } + else $category_id = $term['term_id']; + + $this->main->response(array('success' => 1, 'id' => $category_id, 'name' => $category)); + } +} \ No newline at end of file diff --git a/app/features/popup/event.php b/app/features/popup/event.php new file mode 100755 index 0000000..a8da2ee --- /dev/null +++ b/app/features/popup/event.php @@ -0,0 +1,668 @@ +main->get_settings(); + +// Post Object +$post = new stdClass(); +$post->ID = 0; + +// Features +$feature_colors = new MEC_feature_colors(); + +$allday = 0; +$start_date = date('Y-m-d', strtotime('Tomorrow')); +$start_time_hour = 8; +$start_time_minutes = 0; +$start_time_ampm = 'AM'; +$end_date = $start_date; +$end_time_hour = 6; +$end_time_minutes = 0; +$end_time_ampm = 'PM'; + +$locations = get_terms('mec_location', array('orderby'=>'name', 'hide_empty'=>'0')); +$location_id = 1; +$dont_show_map = 1; + +$organizers = get_terms('mec_organizer', array('orderby'=>'name', 'hide_empty'=>'0')); +$organizer_id = 1; +$wizard_page = isset($_REQUEST['page']) ? sanitize_text_field($_REQUEST['page']) : ''; +$main_page = isset($_REQUEST['post_type']) ? sanitize_text_field($_REQUEST['post_type']) : ''; + +// This date format used for input type of datepicker. +$datepicker_format = (isset($settings['datepicker_format']) and trim($settings['datepicker_format'])) ? $settings['datepicker_format'] : 'Y-m-d'; + +if(!isset($post_type)) $post_type = NULL; + +$step = 1; +?> +
        +
        + +
          +
        • +
        • +
        • + +
        • + +
        • +
        • +
        • +
        • +
        +
        +
        +
        +
        +
        +
        + + + + + display_name); ?> + +
        +
        + +
        +
        +
        + + + + + meta_box_colors($post); ?> +
        +
        +
        +
        +
        + +
        +
        + main->timepicker(array( + 'method' => $settings['time_format'] ?? 12, + 'time_hour' => $start_time_hour, + 'time_minutes' => $start_time_minutes, + 'time_ampm' => $start_time_ampm, + 'name' => 'mec[date][start]', + 'id_key' => 'start_', + 'include_h0' => true, + )); ?> +
        +
        +
        +
        + +
        +
        + main->timepicker(array( + 'method' => $settings['time_format'] ?? 12, + 'time_hour' => $end_time_hour, + 'time_minutes' => $end_time_minutes, + 'time_ampm' => $end_time_ampm, + 'name' => 'mec[date][end]', + 'id_key' => 'end_', + )); ?> +
        +
        +
        + +
        +
        +
        +
        +
        +
        + + +
        +
        +

        +
        + +
        + +
        + + getPRO()): ?> +
        + + +
        + + +
        +
        + +
        +
        +
        + +
        +
        +
        + + + +
        +
        +

        +
        + +
        +
        +
        +
        +
        + +
        +
        +
        + + +
        +
        +

        +
        + +
        + +
        +
        +
        +
        + +

        +
        +
        + +

        +
        +
        +
        + +

        +
        +
        +
        + +

        +
        +
        +
        +
        + +

        +
        +
        +
        +
        +
        + + +
        +
        +
        +
        +
        +
        +
        +
        +
        + +
        +
        +
          +
        • +
        • +
        +
        +
        +
          + 'mec_category', + )); ?> +
        +
        +
        + + +
        +
        +
        + +
        +
        + +
        +
        +
        +
        +
        + +

        +
        + + +
        +
        +
        +
        +
        +
        +
        + + +
        +
        +
        + +getFactory()->params('footer', function() use($main_page, $wizard_page, $post_type, $settings, $step) +{ + ?> + + + \ No newline at end of file diff --git a/app/features/popup/index.html b/app/features/popup/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/features/popup/settings.php b/app/features/popup/settings.php new file mode 100755 index 0000000..0d62fb7 --- /dev/null +++ b/app/features/popup/settings.php @@ -0,0 +1,958 @@ + +
        +
        +
        +
        + +
          +
        • 1
        • +
        • 2
        • +
        • 3
        • +
        • 4
        • + getPRO()) : ?> +
        • 5
        • +
        • 6
        • + +
        • 5
        • + +
        +
        +
        +
        +
        + + + + + display_name); ?> +
        +
        + +
        +
        + +
        +
        +
        + +
        + + main->get_weekday_i18n_labels(); ?> +
        + +
        +
        + main->get_weekdays(); foreach($weekdays as $weekday): ?> + + +
        +
        +
        + +
        + +
        +
        + main->get_weekends(); foreach($weekdays as $weekday): ?> + + +
        +
        +
        +
        +
        +
        +
        + +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        + +
        + +
        + + + ' /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        +
        +
        + +
        + + +
        +
        +

        +
        + +
        +

        +
        +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        +
        +
        +
        +
        + +
        + +
        +
        + +
        + +
        +
        +
        +
        + +
        + + +
        + +
        + +
        + +
        + + + + + + + + + +
        +
        +
        +
        +
        +
        +
        + +
        +
        + +
        +
        +
        + +
        +
        +
        +
        +
          + __('Google Calendar', 'modern-events-calendar-lite'), 'ical'=>__('iCal', 'modern-events-calendar-lite')); + foreach($event_options as $event_key=>$event_option): ?> +
        • + +
          + + +
          +
        • + +
        +
        +
        +
        +
        +
        + getPRO()) : ?> +
        +
        + +
        + +
        +
        +
        + +
        + +
        +
        +
        + +
        + + +
        +
        +

        +
        + +
        +
        +
        + +
        +
        + +
        +
        +
        +
        + +
        +
        +
        +
        + +
        +
        +
        +
        + +
        +
        +
        +
        +
        +
        +
        + +
        +
        + +
        +
        + +
        +
        +

        +
        +
        +
        +
        + +
        +
        +
          + 'mec-colorskin-1', + '#0093d0'=>'mec-colorskin-2', + '#e53f51'=>'mec-colorskin-3', + '#f1c40f'=>'mec-colorskin-4', + '#e64883'=>'mec-colorskin-5', + '#45ab48'=>'mec-colorskin-6', + '#9661ab'=>'mec-colorskin-7', + '#0aad80'=>'mec-colorskin-8', + '#0ab1f0'=>'mec-colorskin-9', + '#ff5a00'=>'mec-colorskin-10', + '#c3512f'=>'mec-colorskin-11', + '#55606e'=>'mec-colorskin-12', + '#fe8178'=>'mec-colorskin-13', + '#7c6853'=>'mec-colorskin-14', + '#bed431'=>'mec-colorskin-15', + '#2d5c88'=>'mec-colorskin-16', + '#77da55'=>'mec-colorskin-17', + '#2997ab'=>'mec-colorskin-18', + '#734854'=>'mec-colorskin-19', + '#a81010'=>'mec-colorskin-20', + '#4ccfad'=>'mec-colorskin-21', + '#3a609f'=>'mec-colorskin-22', + '#333333'=>'mec-colorskin-23', + '#D2D2D2'=>'mec-colorskin-24', + '#636363'=>'mec-colorskin-25', + ); + + foreach($colorskins as $colorskin=>$values): ?> +
        • + +
        • + +
        +
        +
        +
        +
        + +
        +
        + +
        +
        + +
        +
        + +
        +
        +

        +
        +
        +
        +
        + +
        +
        +
          + 'mec-colorskin-1', + '#0093d0'=>'mec-colorskin-2', + '#e53f51'=>'mec-colorskin-3', + '#f1c40f'=>'mec-colorskin-4', + '#e64883'=>'mec-colorskin-5', + '#45ab48'=>'mec-colorskin-6', + '#9661ab'=>'mec-colorskin-7', + '#0aad80'=>'mec-colorskin-8', + '#0ab1f0'=>'mec-colorskin-9', + '#ff5a00'=>'mec-colorskin-10', + '#c3512f'=>'mec-colorskin-11', + '#55606e'=>'mec-colorskin-12', + '#fe8178'=>'mec-colorskin-13', + '#7c6853'=>'mec-colorskin-14', + '#bed431'=>'mec-colorskin-15', + '#2d5c88'=>'mec-colorskin-16', + '#77da55'=>'mec-colorskin-17', + '#2997ab'=>'mec-colorskin-18', + '#734854'=>'mec-colorskin-19', + '#a81010'=>'mec-colorskin-20', + '#4ccfad'=>'mec-colorskin-21', + '#3a609f'=>'mec-colorskin-22', + '#333333'=>'mec-colorskin-23', + '#D2D2D2'=>'mec-colorskin-24', + '#636363'=>'mec-colorskin-25', + ); + + foreach($colorskins as $colorskin=>$values): ?> +
        • + +
        • + +
        +
        +
        +
        +
        + +
        + + + + +
        +
        +
        +
        + +getFactory()->params('footer', function() +{ +?> + + main->get_skins(); + +// MEC Events +$events = $this->main->get_events(); + +// MEC Settings +$settings = $this->main->get_settings(); +$wizard_page = isset($_REQUEST['page']) ? sanitize_text_field($_REQUEST['page']) : ''; +$main_page = isset($_REQUEST['post_type']) ? sanitize_text_field($_REQUEST['post_type']) : ''; + +if(!isset($post_type)) $post_type = NULL; +?> +
        +
        + +
          +
        • 1
        • +
        • 2
        • +
        • 3
        • +
        • 4
        • +
        • 5
        • +
        • 6
        • +
        +
        +
        +
        +
        +
        +
        + + + + + display_name); ?> + +
        +
        + +
        +
        +
        + + + +
        +
        +
          + $name): ?> +
        • + +
        • + +
        +
        +
        +
        +
        + + + + + + + + +
        +
        + + + + + + + + + + +
        +
        + + + + +
        +
        +

        + + + + + + +
        +
        + + + + +
        +
        + + + + + + + + +
        +
        +
        +
        + + + + +
        +
        + + + + +
        +
        + + + + + +
        +
        + + + + +
        +
        + + + + + + + + + +
        +
        + + + + + + +
        +
        + + + + + +
        + +
        + + + + + + + + +
        +
        +
        +
        + + + + +
        +
        + 'mec_designer', + 'post_status' => 'publish', + 'order' => 'DESC', + 'posts_per_page' => -1, + ); + $styles = new WP_Query($args); + ?> +

        + +
        +
        +
        +
        +
        +
        +
        +

        +
        + + + +
        +
        +
        +

        + +
        +
        +
        +
        +
        + +

        +
        +
        + + + +
        +
        +
        +
        + +

        '.esc_html__('only', 'modern-events-calendar-lite').''); ?>

        +
        +
        + + + +
        +
        +
        +
        + +

        +
        +
        + + + +
        +
        +
        +
        +
        +
        +
        +

        +
        + + +
        +
        +

        +
        +
        +
        +
        +
        + + + +
        +
        +
        + + + + +getFactory()->params('footer', function() use($main_page, $wizard_page, $post_type, $fluent) +{ + ?> + + + \ No newline at end of file diff --git a/app/features/profile.php b/app/features/profile.php new file mode 100755 index 0000000..bba2353 --- /dev/null +++ b/app/features/profile.php @@ -0,0 +1,99 @@ + + */ +class MEC_feature_profile extends MEC_base +{ + /** + * @var MEC_factory + */ + public $factory; + + /** + * @var MEC_main + */ + public $main; + + /** + * @var MEC_book + */ + public $book; + + /** + * @var string + */ + public $PT; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Factory + $this->factory = $this->getFactory(); + + // Import MEC Main + $this->main = $this->getMain(); + + // Import MEC Book + $this->book = $this->getBook(); + + // Booking Post Type + $this->PT = $this->main->get_book_post_type(); + } + + /** + * Initialize profile feature + * @author Webnus + */ + public function init() + { + // Profile Shortcode + $this->factory->shortcode('MEC_profile', array($this, 'profile')); + } + + /** + * Show user profile + * @param array $atts + * @return string + */ + public function profile($atts = []) + { + // Force to array + if(!is_array($atts)) $atts = []; + + // Show login/register message if user is not logged in and guest submission is not enabled. + if(!is_user_logged_in()) + { + // Show message + $message = sprintf(esc_html__('Please %s/%s in order to see your bookings / profile.', 'modern-events-calendar-lite'), ''.esc_html__('Login', 'modern-events-calendar-lite').'', ''.esc_html__('Register', 'modern-events-calendar-lite').''); + + ob_start(); + include MEC::import('app.features.profile.message', true, true); + return ob_get_clean(); + } + + // Needs Pro + if(!$this->getPRO()) + { + // Show message + $message = sprintf(esc_html__('To use this feature you should upgrade to %s first.', 'modern-events-calendar-lite'), ''.esc_html__('MEC Pro', 'modern-events-calendar-lite').''); + + ob_start(); + include MEC::import('app.features.profile.message', true, true); + return ob_get_clean(); + } + + + $path = MEC::import('app.features.profile.profile', true, true); + + ob_start(); + include $path; + return ob_get_clean(); + } +} \ No newline at end of file diff --git a/app/features/profile/index.html b/app/features/profile/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/features/profile/message.php b/app/features/profile/message.php new file mode 100755 index 0000000..6f6893c --- /dev/null +++ b/app/features/profile/message.php @@ -0,0 +1,7 @@ + +
        +

        +
        \ No newline at end of file diff --git a/app/features/profile/profile.php b/app/features/profile/profile.php new file mode 100755 index 0000000..18c8519 --- /dev/null +++ b/app/features/profile/profile.php @@ -0,0 +1,272 @@ +getRender(); + +// Query +$q = array( + 'post_type'=>$this->PT, + 'author'=>get_current_user_id(), + 'posts_per_page'=>'-1', + 'post_status'=>array('pending', 'draft', 'future', 'publish'), + 'meta_query'=>array(), + 'date_query'=>array(), + 'orderby'=>'post_date', + 'order'=>'DESC', +); + +// Hide Canceled Bookings +if($hide_canceleds) +{ + $q['meta_query'][] = array('key'=>'mec_verified', 'value'=>'-1', 'compare'=>'!='); +} + +// Show Only Upcoming Bookings +if($upcomings) +{ + $q['date_query'] = array( + 'after' => current_time('Y-m-d H:i:s'), + ); +} + +// The Query +$query = new WP_Query($q); + +$id = 1; +?> +
        + have_posts()): ?> + + + + + + + + + + + + + have_posts()): $query->the_post(); + $ID = get_the_ID(); + $transaction_id = $this->book->get_transaction_id_book_id($ID); + $event_id = get_post_meta($ID, 'mec_event_id', true); + $ticket_ids = get_post_meta($ID, 'mec_ticket_id', true); + + $confirmed = get_post_meta($ID, 'mec_confirmed', true); + $verified = get_post_meta($ID, 'mec_verified', true); + + if($verified == '-1') $status_class = 'mec-book-rejected'; + elseif($confirmed == '1') $status_class = 'mec-book-confirmed'; + elseif($confirmed == '-1') $status_class = 'mec-book-rejected'; + else $status_class = 'mec-book-pending'; + + $transaction = $this->book->get_transaction($transaction_id); + $timestamps = explode(':', get_post_meta($ID, 'mec_date', true)); + + $start_time = $timestamps[0]; + $end_time = $timestamps[1]; + + $booking_options = get_post_meta($event_id, 'mec_booking', true); + $bookings_all_occurrences = $booking_options['bookings_all_occurrences'] ?? 0; + + if($bookings_all_occurrences) + { + $dates = $render->dates($event_id, NULL, 1, NULL); + if(is_array($dates) and count($dates) and isset($dates[0])) + { + $start_time = ((isset($dates[0]['start']) and isset($dates[0]['start']['timestamp'])) ? $dates[0]['start']['timestamp'] : 0); + $end_time = ((isset($dates[0]['end']) and isset($dates[0]['end']['timestamp'])) ? $dates[0]['end']['timestamp'] : 0); + } + } + + // Check If Event Exist + $db = $this->getDB(); + $check_event_exist = $db->select("SELECT `ID` FROM `#__posts` WHERE `ID`=$event_id", 'loadResult'); + + $event = trim($check_event_exist) ? $render->data($event_id) : []; + + // Multiple Dates + $all_dates = (isset($transaction['all_dates']) and is_array($transaction['all_dates'])) ? $transaction['all_dates'] : []; + ?> + + + + + + + + + ID, $ID, $event); ?> + + +
        +
        +
        + + + + + + + + + + + + + + + +
        + $attendee) + { + if(!is_numeric($attendee_i)) continue; + + echo '
        '; + echo ''.esc_html($person_id).''; + echo ''.(isset($attendee['_name']) ? esc_html($attendee['_name']) : esc_html($attendee['name'])).''; + echo ''.esc_html($attendee['email']).''; + echo ''.((isset($event->tickets[$attendee['id']]) ? esc_html($event->tickets[$attendee['id']]['name']) : '').' '.(isset($event->tickets[$attendee['id']]) ? esc_html($event->tickets[$attendee['id']]['price_label']) : '')).''; + + // Ticket Variations + echo ''; + if(isset($attendee['variations']) and is_array($attendee['variations']) and count($attendee['variations'])) + { + $ticket_variations = $this->main->ticket_variations((trim($check_event_exist) ? $event_id : NULL), $attendee['id']); + foreach($attendee['variations'] as $variation_id=>$variation_count) + { + if(!$variation_count or $variation_count < 0) continue; + + $variation_title = (isset($ticket_variations[$variation_id]) and isset($ticket_variations[$variation_id]['title'])) ? $ticket_variations[$variation_id]['title'] : ''; + if(!trim($variation_title)) continue; + + echo ''.' + '.esc_html($variation_title).' ('.esc_html($variation_count).')'.''; + } + } + else + { + echo '-'; + } + + echo ''; + $person_id++; + echo '
        '; + } + } + ?> +
        +
        + +
        + + + + + + + + + + + + + + + +
        + + + ID) or !isset($event->title)) : ?> + + + title); ?> + + + + + + + +
        + +
        + + + +
        +
        + + main->get_verification_label($verified)) : esc_html($this->main->get_confirmation_label($confirmed)); ?> + + + + + + + + + + + - + + + + ID)) + { + $location_id = $this->main->get_master_location_id($event); + $location_latitude = $event->locations[$location_id]['latitude'] ?? NULL; + $location_longitude = $event->locations[$location_id]['longitude'] ?? NULL; + } + ?> + + + "> + + + + + + + + + + + + + +
        + +

        + +
        + diff --git a/app/features/report.php b/app/features/report.php new file mode 100755 index 0000000..fc1da92 --- /dev/null +++ b/app/features/report.php @@ -0,0 +1,319 @@ + + */ +class MEC_feature_report extends MEC_base +{ + /** + * @var MEC_factory + */ + private $factory; + + /** + * @var MEC_db + */ + private $db; + + /** + * @var MEC_main + */ + private $main; + + private $settings; + private $ml_settings; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Factory + $this->factory = $this->getFactory(); + + // Import MEC DB + $this->db = $this->getDB(); + + // Import MEC Main + $this->main = $this->getMain(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + + // MEC Multilingual Settings + $this->ml_settings = $this->main->get_ml_settings(); + } + + /** + * Initialize search feature + * @author Webnus + */ + public function init() + { + $this->factory->action('admin_menu', [$this, 'menu'], 11); + + // Close Custom Text Notification + $this->factory->action('wp_ajax_report_event_dates', [$this, 'report_event_dates']); + + // Event Attendees + $this->factory->action('wp_ajax_mec_attendees', [$this, 'attendees']); + + // Selective Email + $this->factory->action('wp_ajax_mec_mass_email', [$this, 'mass_email']); + + // Mass Action + $this->factory->action('wp_ajax_mec_report_mass', [$this, 'mass_actions']); + } + + public function menu() + { + if(isset($this->settings['booking_status']) && $this->settings['booking_status']) + { + add_submenu_page('mec-intro', esc_html__('MEC - Report', 'modern-events-calendar-lite'), esc_html__('Report', 'modern-events-calendar-lite'), 'mec_report', 'MEC-report', [$this, 'report']); + } + } + + /** + * Show report page + * @author Webnus + * @return void + */ + public function report() + { + $path = MEC::import('app.features.report.tpl', true, true); + + ob_start(); + include $path; + do_action('mec_display_report_page', $path); + echo MEC_kses::full(ob_get_clean()); + } + + /* Report Event Dates */ + public function report_event_dates() + { + // Current User is not Permitted + if(!current_user_can('mec_report')) $this->main->response(['success'=>0, 'code'=>'ADMIN_ONLY']); + if(!wp_verify_nonce(sanitize_text_field($_REQUEST['nonce']), 'mec_settings_nonce')) exit(); + + $event_id = sanitize_text_field($_POST['event_id']); + + $booking_options = get_post_meta($event_id, 'mec_booking', true); + $bookings_all_occurrences = $booking_options['bookings_all_occurrences'] ?? 0; + + if($event_id != 'none') + { + $dates = $this->db->select("SELECT `tstart`, `tend` FROM `#__mec_dates` WHERE `post_id`='".$event_id."' LIMIT 100"); + $occurrence = count($dates) ? reset($dates)->tstart : ''; + + $date_format = isset($this->ml_settings['booking_date_format1']) && trim($this->ml_settings['booking_date_format1']) + ? $this->ml_settings['booking_date_format1'] + : 'Y-m-d'; + + if(get_post_meta($event_id, 'mec_repeat_type', true) === 'custom_days') $date_format .= ' '.get_option('time_format'); + + echo ''; + } + else + { + echo ''; + } + + wp_die(); + } + + public function attendees() + { + $id = isset($_POST['id']) ? sanitize_text_field($_POST['id']) : 0; + + $occurrence = isset($_POST['occurrence']) ? sanitize_text_field($_POST['occurrence']) : NULL; + $occurrence = explode(':', $occurrence)[0]; + + if($occurrence == 'all') $occurrence = strtotime('+100 years'); + elseif($occurrence == 'none') $occurrence = NULL; + + $attendees = $this->main->get_event_attendees($id, $occurrence); + + $html = ''; + if(count($attendees)) + { + $html .= $this->main->get_attendees_table($attendees, $id, $occurrence); + $email_button = '

        '.esc_html__('If you want to send an email, first select your attendees and then click in the button below, please.', 'modern-events-calendar-lite').'

        '; + + // Certificate + if($occurrence && isset($this->settings['certificate_status']) && $this->settings['certificate_status']) + { + $certificates = get_posts([ + 'post_type' => $this->main->get_certificate_post_type(), + 'status' => 'publish', + 'numberposts' => -1, + 'orderby' => 'post_title', + 'order' => 'ASC' + ]); + + $certificate_options = ''; + foreach($certificates as $certificate) + { + $certificate_options .= ''; + } + + $email_button .= '
        +

        '.esc_html__('Certificate', 'modern-events-calendar-lite').'

        + + +
        +
        '; + } + } + else + { + $html .= '

        '.esc_html__("No Attendees Found!", 'modern-events-calendar-lite').'

        '; + $email_button = ''; + } + + echo json_encode(['html' => $html, 'email_button' => $email_button]); + exit; + } + + public function mass_email() + { + if(!wp_verify_nonce(sanitize_text_field($_REQUEST['nonce']), 'mec_settings_nonce')) exit(); + + // Current User is not Permitted + if(!current_user_can('mec_report')) $this->main->response(array('success'=>0, 'code'=>'NO_ACCESS')); + + $mail_recipients_info = isset($_POST['mail_recipients_info']) ? trim(sanitize_text_field($_POST['mail_recipients_info']), ', ') : ''; + $mail_subject = isset($_POST['mail_subject']) ? sanitize_text_field($_POST['mail_subject']) : ''; + $mail_content = isset($_POST['mail_content']) ? MEC_kses::page($_POST['mail_content']) : ''; + $mail_copy = isset($_POST['mail_copy']) ? sanitize_text_field($_POST['mail_copy']) : 0; + + $render_recipients = array_unique(explode(',', $mail_recipients_info)); + $headers = array('Content-Type: text/html; charset=UTF-8'); + + // Changing some sender email info. + $notifications = $this->getNotifications(); + $notifications->mec_sender_email_notification_filter(); + + // Send to Admin + if($mail_copy) $render_recipients[] = 'Admin:.:'.get_option('admin_email'); + + // Set Email Type to HTML + add_filter('wp_mail_content_type', array($this->main, 'html_email_type')); + + foreach($render_recipients as $recipient) + { + $render_recipient = explode(':.:', $recipient); + + $to = isset($render_recipient[1]) ? trim($render_recipient[1]) : ''; + if(!trim($to)) continue; + + $message = $mail_content; + $message = str_replace('%%name%%', (isset($render_recipient[0]) ? trim($render_recipient[0]) : ''), $message); + + $mail_arg = array( + 'to' => $to, + 'subject' => $mail_subject, + 'message' => $message, + 'headers' => $headers, + 'attachments' => array(), + ); + + $mail_arg = apply_filters('mec_before_send_mass_email', $mail_arg, 'mass_email'); + + // Send the mail + wp_mail($mail_arg['to'], html_entity_decode(stripslashes($mail_arg['subject']), ENT_HTML5), wpautop(stripslashes($mail_arg['message'])), $mail_arg['headers'], $mail_arg['attachments']); + } + + // Remove the HTML Email filter + remove_filter('wp_mail_content_type', array($this->main, 'html_email_type')); + + wp_die(true); + } + + public function mass_actions() + { + // Invalid Request + if(!wp_verify_nonce(sanitize_text_field($_REQUEST['_wpnonce'] ?? ''), 'mec_report_mass')) $this->main->response(['success'=>0, 'code'=>'INVALID_NONCE']); + + // Current User is not Permitted + if(!current_user_can('mec_report')) $this->main->response(['success'=>0, 'code'=>'NO_ACCESS']); + + $task = isset($_POST['task']) ? sanitize_text_field($_POST['task']) : 'suggest'; + $events = isset($_POST['events']) && is_array($_POST['events']) ? $_POST['events'] : []; + + // Invalid Events + if(!count($events)) $this->main->response(['success'=>0, 'code'=>'INVALID_EVENTS']); + + // Suggest New Event + if($task === 'suggest') + { + // New Event to Suggest + $new_event = isset($_POST['new_event']) ? sanitize_text_field($_POST['new_event']) : ''; + + // Invalid Event + if(!$new_event) $this->main->response(['success'=>0, 'code'=>'INVALID_EVENT']); + + // Notifications Library + $notifications = $this->getNotifications(); + + $attendees_count = 0; + $sent = []; + foreach($events as $id) + { + $attendees = $this->main->get_event_attendees($id); + foreach($attendees as $attendee) + { + $attendees_count++; + + $email = $attendee['email'] ?? ''; + if(!$email || in_array($email, $sent)) continue; + + // Do not send multiple emails to same email + $sent[] = $email; + + // Suggest the Event + $notifications->suggest_event([ + 'email' => $email, + 'name' => $attendee['name'] ?? '', + ], $new_event, $attendee['book_id'] ?? ''); + } + } + + $this->main->response(['success'=>1, 'code'=>'EMAILS_SENT', 'message' => sprintf(esc_html__('%s unique emails are sent successfully to %s attendees.', 'modern-events-calendar-lite'), count($sent), $attendees_count)]); + } + + wp_die(true); + } +} \ No newline at end of file diff --git a/app/features/report/tpl.php b/app/features/report/tpl.php new file mode 100755 index 0000000..5523b72 --- /dev/null +++ b/app/features/report/tpl.php @@ -0,0 +1,146 @@ +main->get_events(-1, ['pending', 'draft', 'future', 'publish']); +$date_format = get_option('date_format'); + +$styling = $this->main->get_styling(); +$dark_mode = $styling['dark_mode'] ?? ''; + +$logo = plugin_dir_url(__FILE__ ) . '../../../assets/img/mec-logo-w.png'; +if($dark_mode == 1) $logo = plugin_dir_url(__FILE__ ) . '../../../assets/img/mec-logo-w2.png'; +?> +
        +

        +
        +
        + + +
        + +

        +

        +
        +
        +
        + +
        +
          + ID; + if($this->main->get_original_event($id) !== $id) $id = $this->main->get_original_event($id); + + $sold_tickets = $this->getBook()->get_all_sold_tickets($id); + echo '
        • '; + } + ?> +
        +
        +
        +
        + +
        +
        +
        +
        + +
        +
        + +
        +
        +
        +
        +
        + + + +
        +
        +
        + +
        +
        +
        + +

        +

        +
        +
        +
        + +
        +
        +
        +
        +
        +
        +
        +
        +
        + +
        +

        +

        0'); ?>

        +

        +
        +
        + +

        +
          +
        • %%name%%:
        • +
        +
        + + + + + + + + +
        + +
        +
        +
        + +
        +
        +
        +
        \ No newline at end of file diff --git a/app/features/restful.php b/app/features/restful.php new file mode 100755 index 0000000..d6a22d3 --- /dev/null +++ b/app/features/restful.php @@ -0,0 +1,166 @@ + + */ +class MEC_feature_restful extends MEC_base +{ + /** + * @var MEC_factory + */ + public $factory; + + /** + * @var MEC_restful + */ + public $restful; + + private $settings; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Factory + $this->factory = $this->getFactory(); + + // Import MEC RESTful + $this->restful = $this->getRestful(); + + // MEC Settings + $this->settings = $this->getMain()->get_settings(); + } + + /** + * Initialize + * @author Webnus + */ + public function init() + { + // Disabled + if(!isset($this->settings['restful_api_status']) || !$this->settings['restful_api_status']) return; + + $this->factory->action('rest_api_init', [$this, 'register']); + } + + public function register() + { + // Get Events + register_rest_route($this->restful->get_namespace(), 'events', [ + 'methods' => 'GET', + 'callback' => [$this, 'events'], + 'permission_callback' => [$this->restful, 'guest'], + ]); + } + + public function events(WP_REST_Request $request) + { + $limit = $request->get_param('limit'); + if(!$limit) $limit = 12; + + if(!is_numeric($limit)) + { + return $this->restful->response([ + 'data' => new WP_Error(400, esc_html__('Limit parameter must be numeric!', 'modern-events-calendar-lite')), + 'status' => 400, + ]); + } + + $order = $request->get_param('order'); + if(!$order) $order = 'ASC'; + + if(!in_array($order, ['ASC', 'DESC'])) + { + return $this->restful->response([ + 'data' => new WP_Error(400, esc_html__('Order parameter is invalid!', 'modern-events-calendar-lite')), + 'status' => 400, + ]); + } + + $start_date_type = $request->get_param('start_date_type'); + if(!$start_date_type) $start_date_type = 'today'; + + $start_date = $request->get_param('start_date'); + + if($start_date_type === 'date' && !$start_date) + { + return $this->restful->response([ + 'data' => new WP_Error(400, esc_html__('When the start_date_type parameter is set to date, then start_date parameter is required.', 'modern-events-calendar-lite')), + 'status' => 400, + ]); + } + + $end_date_type = $request->get_param('end_date_type'); + if(!$end_date_type) $end_date_type = 'date'; + + $end_date = $request->get_param('end_date'); + + $show_only_past_events = (int) $request->get_param('show_only_past_events'); + $include_past_events = (int) $request->get_param('include_past_events'); + + $show_only_ongoing_events = (int) $request->get_param('show_only_ongoing_events'); + $include_ongoing_events = (int) $request->get_param('include_ongoing_events'); + + $args = [ + 'sk-options' => [ + 'list' => [ + 'limit' => $limit, + 'order_method' => $order, + 'start_date_type' => $start_date_type, + 'start_date' => $start_date, + 'end_date_type' => $end_date_type, + 'maximum_date_range' => $end_date + ] + ], + 'show_only_past_events' => $show_only_past_events, + 'show_past_events' => $include_past_events, + 'show_only_ongoing_events' => $show_only_ongoing_events, + 'show_ongoing_events' => $include_ongoing_events, + 's' => (string) $request->get_param('keyword'), + 'label' => (string) $request->get_param('labels'), + 'ex_label' => (string) $request->get_param('ex_labels'), + 'category' => (string) $request->get_param('categories'), + 'ex_category' => (string) $request->get_param('ex_categories'), + 'location' => (string) $request->get_param('locations'), + 'ex_location' => (string) $request->get_param('ex_locations'), + 'address' => (string) $request->get_param('address'), + 'organizer' => (string) $request->get_param('organizers'), + 'ex_organizer' => (string) $request->get_param('ex_organizers'), + 'sponsor' => (string) $request->get_param('sponsors'), + 'speaker' => (string) $request->get_param('speakers'), + 'tag' => (string) $request->get_param('tags'), + 'ex_tag' => (string) $request->get_param('ex_tags'), + ]; + + // Events Object + $EO = new MEC_skin_list(); + $EO->initialize($args); + + // Set Offset + $EO->offset = (int) $request->get_param('offset'); + + // Search + $EO->search(); + + // Events + $events = $EO->fetch(); + + // Response + return $this->restful->response([ + 'data' => [ + 'events' => $events, + 'pagination' => [ + 'next_date' => $EO->end_date, + 'next_offset' => $EO->next_offset, + 'has_more_events' => $EO->has_more_events, + 'found' => $EO->found, + ], + ] + ]); + } +} diff --git a/app/features/schema.php b/app/features/schema.php new file mode 100755 index 0000000..6dce62e --- /dev/null +++ b/app/features/schema.php @@ -0,0 +1,309 @@ + + */ +class MEC_feature_schema extends MEC_base +{ + public $factory; + public $main; + public $settings; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Factory + $this->factory = $this->getFactory(); + + // Import MEC Main + $this->main = $this->getMain(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + } + + /** + * Initialize locations feature + * @author Webnus + */ + public function init() + { + // Schema Meta Box + $this->factory->action('mec_metabox_details', array($this, 'meta_box_schema'), 60); + if(!isset($this->settings['fes_section_schema']) or (isset($this->settings['fes_section_schema']) and $this->settings['fes_section_schema'])) $this->factory->action('mec_fes_metabox_details', array($this, 'meta_box_schema'), 60); + + // Save Schema Data + $this->factory->action('save_post', array($this, 'save_event')); + + // Print Schema + if(isset($this->settings['schema']) and $this->settings['schema'] != 0) + { + $this->factory->action('mec_schema', array($this, 'schema'), 10); + $this->factory->filter('mec_schema_text', array($this, 'schema_text'), 10, 2); + } + } + + /** + * Show location meta box + * @author Webnus + * @param object $post + */ + public function meta_box_schema($post) + { + $event_status = get_post_meta($post->ID, 'mec_event_status', true); + if(!trim($event_status)) $event_status = 'EventScheduled'; + + $moved_online_link = get_post_meta($post->ID, 'mec_moved_online_link', true); + $cancelled_reason = get_post_meta($post->ID, 'mec_cancelled_reason', true); + $display_cancellation_reason_in_single_page = get_post_meta($post->ID, 'mec_display_cancellation_reason_in_single_page', true); + ?> +
        +

        +

        + +
        + +

        +
        +
        + +

        +
        +
        + +

        +
        +
        + +

        +
        +
        > +
        + + +
        +
        +

        +
        +
        + +
        +
        +
        + +

        +
        + +
        + + + * @param int $post_id + * @return boolean + */ + public function save_event($post_id) + { + // Check if our nonce is set. + if(!isset($_POST['mec_event_nonce'])) return false; + + // Verify that the nonce is valid. + if(!wp_verify_nonce(sanitize_text_field($_POST['mec_event_nonce']), 'mec_event_data')) return false; + + // If this is an autosave, our form has not been submitted, so we don't want to do anything. + if(defined('DOING_AUTOSAVE') and DOING_AUTOSAVE) return false; + + // Get Modern Events Calendar Data + $_mec = isset($_POST['mec']) ? $this->main->sanitize_deep_array($_POST['mec']) : []; + + $event_status = isset($_mec['event_status']) ? sanitize_text_field($_mec['event_status']) : 'EventScheduled'; + if(!in_array($event_status, array('EventScheduled', 'EventRescheduled', 'EventPostponed', 'EventCancelled', 'EventMovedOnline'))) $event_status = 'EventScheduled'; + + update_post_meta($post_id, 'mec_event_status', $event_status); + + $moved_online_link = (isset($_mec['moved_online_link']) and filter_var($_mec['moved_online_link'], FILTER_VALIDATE_URL)) ? sanitize_url($_mec['moved_online_link']) : ''; + update_post_meta($post_id, 'mec_moved_online_link', $moved_online_link); + + $cancelled_reason = (isset($_mec['cancelled_reason']) and !empty($_mec['cancelled_reason'])) ? sanitize_text_field($_mec['cancelled_reason']) : ''; + update_post_meta($post_id, 'mec_cancelled_reason', $cancelled_reason); + + $display_cancellation_reason_in_single_page = (isset($_mec['display_cancellation_reason_in_single_page']) and !empty($_mec['display_cancellation_reason_in_single_page'])); + update_post_meta($post_id, 'mec_display_cancellation_reason_in_single_page', $display_cancellation_reason_in_single_page); + + return true; + } + + public function schema($event) + { + $status = $this->settings['schema'] ?? 0; + if(!$status) return; + + $speakers = []; + if(isset($event->data->speakers) and is_array($event->data->speakers) and count($event->data->speakers)) + { + foreach($event->data->speakers as $value) + { + $speakers[] = array( + "@type" => isset($value['type']) && $value['type'] == 'group' ? "PerformingGroup" : "Person", + "name" => $value['name'], + "image" => $value['thumbnail'], + "sameAs" => $value['facebook'], + ); + } + } + + $start_timestamp = ($event->data->time['start_timestamp'] ?? ($event->date['start']['timestamp'] ?? strtotime($event->date['start']['date']))); + + // All Params + $params = MEC_feature_occurrences::param($event->ID, $start_timestamp, '*'); + + $event_status = (isset($event->data->meta['mec_event_status']) and trim($event->data->meta['mec_event_status'])) ? $event->data->meta['mec_event_status'] : 'EventScheduled'; + $event_status = (isset($params['event_status']) and trim($params['event_status']) != '') ? $params['event_status'] : $event_status; + + if(!in_array($event_status, array('EventScheduled', 'EventRescheduled', 'EventPostponed', 'EventCancelled', 'EventMovedOnline'))) $event_status = 'EventScheduled'; + + $cost = $this->main->get_event_cost($event, false); + + $location_id = $this->main->get_master_location_id($event); + $location = ($location_id ? $this->main->get_location_data($location_id) : array()); + + $start_date = (isset($event->date) and isset($event->date['start']) and isset($event->date['start']['date'])) ? $event->date['start']['date'] : NULL; + $end_date = (isset($event->date) and isset($event->date['end']) and isset($event->date['end']['date'])) ? $event->date['end']['date'] : NULL; + + $event_link = $this->main->get_event_date_permalink($event, $start_date); + $soldout = $this->main->is_soldout($event, $event->date); + + $organizer_id = $this->main->get_master_organizer_id($event); + $organizer = $organizer_id ? $this->main->get_organizer_data($organizer_id) : []; + + $moved_online_link = (isset($event->data->meta['mec_moved_online_link']) and trim($event->data->meta['mec_moved_online_link'])) ? $event->data->meta['mec_moved_online_link'] : ''; + $moved_online_link = (isset($params['moved_online_link']) and trim($params['moved_online_link']) != '') ? $params['moved_online_link'] : $moved_online_link; + + $content = strip_tags($event->data->post->post_content); + + $this->factory->printOnAjaxOrFooter(function() use($event, $event_status, $start_date, $end_date, $moved_online_link, $event_link, $location, $organizer, $cost, $soldout, $content, $speakers) + { + ?> + + + */ +class MEC_feature_search extends MEC_base +{ + /** + * @var MEC_factory + */ + public $factory; + + /** + * @var MEC_main + */ + public $main; + + /** + * @var MEC_search + */ + public $search; + + /** + * @var array + */ + public $settings; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Factory + $this->factory = $this->getFactory(); + + // Import MEC Main + $this->main = $this->getMain(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + + // Search Library + $this->search = $this->getSearch(); + } + + /** + * Initialize search feature + * @author Webnus + */ + public function init() + { + // Search Shortcode + $this->factory->shortcode('MEC_search_bar', array($this, 'search')); + + if(isset($this->settings['search_bar_ajax_mode']) && $this->settings['search_bar_ajax_mode'] == '1') + { + $this->factory->action('wp_ajax_mec_get_ajax_search_data', array($this, 'mec_get_ajax_search_data')); + $this->factory->action('wp_ajax_nopriv_mec_get_ajax_search_data', array($this, 'mec_get_ajax_search_data')); + } + elseif(!is_admin()) + { + $this->factory->filter('pre_get_posts', array($this, 'mec_search_filter')); + } + + // Search Narrow + $this->factory->action('wp_ajax_mec_refine_search_items', array($this->search, 'refine')); + $this->factory->action('wp_ajax_nopriv_mec_refine_search_items', array($this->search, 'refine')); + } + + /** + * Show taxonomy + * @param string $taxonomy + * @param string $icon + * @return boolean|string + */ + public function show_taxonomy($taxonomy, $icon) + { + $terms = get_terms($taxonomy, array('hide_empty' => false)); + $out = ''; + + if(is_wp_error($terms) || empty($terms)) return false; + $taxonomy_name = ($taxonomy == apply_filters('mec_taxonomy_tag', '')) ? 'tag' : str_replace('mec_', '', $taxonomy); + + switch($taxonomy_name) + { + // Message Category + case 'category': + $taxonomy_name = $this->main->m('taxonomy_category', esc_html__('Category', 'modern-events-calendar-lite')); + $taxonomy_key = 'category'; + break; + + // Message Location + case 'location': + $taxonomy_name = $this->main->m('taxonomy_location', esc_html__('Location', 'modern-events-calendar-lite')); + $taxonomy_key = 'location'; + break; + + // Message Organizer + case 'organizer': + $taxonomy_name = $this->main->m('taxonomy_organizer', esc_html__('Organizer', 'modern-events-calendar-lite')); + $taxonomy_key = 'organizer'; + break; + + // Message Organizer + case 'speaker': + $taxonomy_name = $this->main->m('taxonomy_speaker', esc_html__('Speaker', 'modern-events-calendar-lite')); + $taxonomy_key = 'speaker'; + break; + + // Message Tag + case 'tag': + $taxonomy_name = esc_html__('Tag', 'modern-events-calendar-lite'); + $taxonomy_key = 'tag'; + break; + + // Message label + case 'label': + $taxonomy_name = $this->main->m('taxonomy_label', esc_html__('Label', 'modern-events-calendar-lite')); + $taxonomy_key = 'label'; + break; + + // Default Screen + default: + $taxonomy_name = str_replace('mec_', '', $taxonomy); + $taxonomy_key = $taxonomy_name; + break; + } + + $out .= ''; + + return $out; + } + + public function mec_get_ajax_search_data() + { + if(sanitize_text_field($_POST['length']) < '3') + { + esc_html_e('Please enter at least 3 characters and try again', 'modern-events-calendar-lite'); + die(); + } + + $mec_tag_query = NULL; + $mec_queries = []; + + if(!empty($_POST['location'])) + { + $location = sanitize_text_field($_POST['location']); + $mec_queries[] = array( + 'taxonomy' => 'mec_location', + 'field' => 'id', + 'terms' => array($location), + 'operator' => 'IN' + ); + } + + if(!empty($_POST['category'])) + { + $category = sanitize_text_field($_POST['category']); + $mec_queries[] = array( + 'taxonomy' => 'mec_category', + 'field' => 'id', + 'terms' => array($category), + 'operator' => 'IN' + ); + } + + if(!empty($_POST['organizer'])) + { + $organizer = sanitize_text_field($_POST['organizer']); + $mec_queries[] = array( + 'taxonomy' => 'mec_organizer', + 'field' => 'id', + 'terms' => array($organizer), + 'operator' => 'IN' + ); + } + + if(!empty($_POST['speaker'])) + { + $speaker = sanitize_text_field($_POST['speaker']); + $mec_queries[] = array( + 'taxonomy' => 'mec_speaker', + 'field' => 'id', + 'terms' => array($speaker), + 'operator' => 'IN' + ); + } + + // Tag Method + $tag_method = $this->settings['tag_method'] ?? 'post_tag'; + + if(!empty($_POST['tag'])) + { + if($tag_method === 'post_tag') + { + $term = get_term_by('id', sanitize_text_field($_POST['tag']), apply_filters('mec_taxonomy_tag', '')); + if($term) $mec_tag_query = $term->slug; + } + else + { + $mec_queries[] = array( + 'taxonomy' => apply_filters('mec_taxonomy_tag', ''), + 'field' => 'id', + 'terms' => array(sanitize_text_field($_POST['tag'])), + 'operator' => 'IN' + ); + } + } + + if(!empty($_POST['label'])) + { + $label = sanitize_text_field($_POST['label']); + $mec_queries[] = array( + 'taxonomy' => 'mec_label', + 'field' => 'id', + 'terms' => array($label), + 'operator' => 'IN' + ); + } + + $args = array( + 'tax_query' => $mec_queries, + 's' => sanitize_text_field($_POST['keyword']), + 'post_type' => $this->main->get_main_post_type(), + 'post_status' => array('publish'), + ); + + if($tag_method === 'post_tag' && $mec_tag_query) $args['tag'] = $mec_tag_query; + + // Query + $the_query = new WP_Query($args); + if($the_query->have_posts()) + { + while($the_query->have_posts()) + { + $the_query->the_post(); + include MEC::import('app.features.search_bar.search_result', true, true); + } + + wp_reset_postdata(); + } + else + { + include MEC::import('app.features.search_bar.search_noresult', true, true); + } + + die(); + } + + /** + * Search Filter + * @param WP_Query $query + * @return WP_Query $query + */ + public function mec_search_filter($query) + { + // Do not change Query if it is not search page! + if(!$query->is_search) return $query; + + // Do not do anything in Backend + if(is_admin()) return $query; + + // Do not change anything in Rest API + if(defined('REST_REQUEST')) return $query; + + // Do not change Query if it is not a search related to MEC! + if((is_array($query->get('post_type')) and !in_array($this->main->get_main_post_type(), $query->get('post_type'))) or (!is_array($query->get('post_type')) and $query->get('post_type') != 'mec-events')) return $query; + + $mec_tag_query = NULL; + $mec_queries = []; + + if(!empty($_GET['location'])) + { + $mec_queries[] = array( + 'taxonomy' => 'mec_location', + 'field' => 'id', + 'terms' => array(sanitize_text_field($_GET['location'])), + 'operator' => 'IN' + ); + } + + if(!empty($_GET['category'])) + { + $mec_queries[] = array( + 'taxonomy' => 'mec_category', + 'field' => 'id', + 'terms' => array(sanitize_text_field($_GET['category'])), + 'operator' => 'IN' + ); + } + + if(!empty($_GET['organizer'])) + { + $mec_queries[] = array( + 'taxonomy' => 'mec_organizer', + 'field' => 'id', + 'terms' => array(sanitize_text_field($_GET['organizer'])), + 'operator' => 'IN' + ); + } + + if(!empty($_GET['speaker'])) + { + $mec_queries[] = array( + 'taxonomy' => 'mec_speaker', + 'field' => 'id', + 'terms' => array(sanitize_text_field($_GET['speaker'])), + 'operator' => 'IN' + ); + } + + // Tag Method + $tag_method = $this->settings['tag_method'] ?? 'post_tag'; + + if(!empty($_GET['tag'])) + { + if($tag_method === 'post_tag') + { + $term = get_term_by('id', sanitize_text_field($_GET['tag']), apply_filters('mec_taxonomy_tag', '')); + if($term) $mec_tag_query = $term->slug; + } + else + { + $mec_queries[] = array( + 'taxonomy' => apply_filters('mec_taxonomy_tag', ''), + 'field' => 'id', + 'terms' => array(sanitize_text_field($_GET['tag'])), + 'operator' => 'IN' + ); + } + } + + if(!empty($_GET['label'])) + { + $mec_queries[] = array( + 'taxonomy' => 'mec_label', + 'field' => 'id', + 'terms' => array(sanitize_text_field($_GET['label'])), + 'operator' => 'IN' + ); + } + + if($mec_tag_query and $tag_method === 'post_tag') $query->set('tag', $mec_tag_query); + else + { + $query->set('tag', null); + $query->set('tag_slug__in', null); + } + + if(count($mec_queries)) + { + $query->set('tax_query', $mec_queries); + $query->tax_query = $mec_queries; + } + + return $query; + } + + /** + * Show user search bar + * @return string + */ + public function search() + { + $path = MEC::import('app.features.search_bar.search_bar', true, true); + + ob_start(); + include $path; + return ob_get_clean(); + } +} \ No newline at end of file diff --git a/app/features/search_bar/index.html b/app/features/search_bar/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/features/search_bar/search_bar.php b/app/features/search_bar/search_bar.php new file mode 100755 index 0000000..cc87524 --- /dev/null +++ b/app/features/search_bar/search_bar.php @@ -0,0 +1,153 @@ +main->get_settings(); + +$modern_type = ''; +if(isset($settings['search_bar_modern_type']) && $settings['search_bar_modern_type'] == '1') $modern_type = 'mec-modern-search-bar '; + +$output = '
        '; +echo MEC_kses::form($output); +?> + \ No newline at end of file diff --git a/app/features/search_bar/search_noresult.php b/app/features/search_bar/search_noresult.php new file mode 100755 index 0000000..1306b38 --- /dev/null +++ b/app/features/search_bar/search_noresult.php @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/app/features/search_bar/search_result.php b/app/features/search_bar/search_result.php new file mode 100755 index 0000000..e5a4522 --- /dev/null +++ b/app/features/search_bar/search_result.php @@ -0,0 +1,34 @@ + main->get_settings(); +$start_hour = get_post_meta(get_the_ID(), 'mec_start_time_hour', true); +$start_min = (get_post_meta(get_the_ID(), 'mec_start_time_minutes', true) < '10') ? '0' . get_post_meta(get_the_ID(), 'mec_start_time_minutes', true) : get_post_meta(get_the_ID(), 'mec_start_time_minutes', true); +$start_ampm = get_post_meta(get_the_ID(), 'mec_start_time_ampm', true); +$end_hour = get_post_meta(get_the_ID(), 'mec_end_time_hour', true); +$end_min = (get_post_meta(get_the_ID(), 'mec_end_time_minutes', true) < '10') ? '0' . get_post_meta(get_the_ID(), 'mec_end_time_minutes', true) : get_post_meta(get_the_ID(), 'mec_end_time_minutes', true); +$end_ampm = get_post_meta(get_the_ID(), 'mec_end_time_ampm', true); +$time = (get_post_meta(get_the_ID(), 'mec_allday', true) == '1' ) ? $this->main->m('all_day', esc_html__('All Day' , 'modern-events-calendar-lite')) : $start_hour . ':' . $start_min . ' ' . $start_ampm . ' - ' . $end_hour . ':' . $end_min . ' ' . $end_ampm; +?> +
        +
        + main->date_i18n('d', strtotime(get_post_meta(get_the_ID(), 'mec_start_date', true)))); ?>main->date_i18n('F', strtotime(get_post_meta(get_the_ID(), 'mec_start_date', true)))); ?> +
        +
        + +
        +
        + +
        +

        + +

        +
        + name); + ?> +
        +
        \ No newline at end of file diff --git a/app/features/sms.php b/app/features/sms.php new file mode 100755 index 0000000..1d89c34 --- /dev/null +++ b/app/features/sms.php @@ -0,0 +1,140 @@ + + */ +class MEC_feature_sms extends MEC_base +{ + public $factory; + public $main; + public $settings; + public $notifications; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Factory + $this->factory = $this->getFactory(); + + // Import MEC Main + $this->main = $this->getMain(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + + // MEC Notification Library + $this->notifications = $this->main->getNotifications(); + } + + /** + * Initialize locations feature + * @author Webnus + */ + public function init() + { + // Pro Only + if(!$this->getPRO()) return; + + // SMS Status + $sms_status = (isset($this->settings['sms_status']) and $this->settings['sms_status']); + + // SMS is not enabled + if(!$sms_status) return; + + $sid = $this->settings['sms_twilio_account_sid'] ?? ''; + $auth_token = $this->settings['sms_twilio_auth_token'] ?? ''; + $from = $this->settings['sms_twilio_sender_number'] ?? ''; + + // Insufficient Credentials + if(!trim($sid) or !trim($auth_token) or !trim($from)) return; + + // Admin Notification + $this->factory->action('mec_booking_completed', array($this, 'admin_notification'), 12); + } + + /** + * Send admin notification + * + * @param int $book_id + * @return bool + * @throws \Twilio\Exceptions\ConfigurationException + * @throws \Twilio\Exceptions\TwilioException + * @author Webnus + */ + public function admin_notification($book_id) + { + if(!$book_id) return false; + + // Admin Notification is disabled + if(isset($this->settings['sms_notif_admin_status']) and !$this->settings['sms_notif_admin_status']) return false; + + $recipients_str = $this->settings['sms_notif_admin_recipients'] ?? ''; + + // No recipients + if(trim($recipients_str) === '') return false; + + $recipients = explode(',', $recipients_str); + + // Unique Recipients + $recipients = array_map('trim', $recipients); + $recipients = array_unique($recipients); + + $message = $this->settings['sms_notif_admin_text'] ?? ''; + $message = $this->notifications->content($message, $book_id); + + // Remove remained placeholders + $message = preg_replace('/%%.*%%/', '', $message); + + // Strip HTML Tags + $message = strip_tags($message); + + try + { + // Twilio Client + $client = $this->get_twilio_client(); + + // From Number + $from = $this->settings['sms_twilio_sender_number'] ?? ''; + + // Send Text Messages + foreach ($recipients as $recipient) + { + $client->messages->create( + $recipient, + [ + 'from' => $from, + 'body' => $message + ] + ); + } + } + catch(Exception $e) + { + // Store the Error + update_option('mec_sms_twilio_error', $e->getMessage()); + + return false; + } + + return true; + } + + /** + * @throws \Twilio\Exceptions\ConfigurationException + */ + public function get_twilio_client() + { + require __DIR__ . '/../api/Twilio/autoload.php'; + + $sid = $this->settings['sms_twilio_account_sid'] ?? ''; + $auth_token = $this->settings['sms_twilio_auth_token'] ?? ''; + + return new Twilio\Rest\Client($sid, $auth_token); + } +} \ No newline at end of file diff --git a/app/features/speakers.php b/app/features/speakers.php new file mode 100755 index 0000000..f9512f5 --- /dev/null +++ b/app/features/speakers.php @@ -0,0 +1,565 @@ + + */ +class MEC_feature_speakers extends MEC_base +{ + public $factory; + public $main; + public $settings; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Factory + $this->factory = $this->getFactory(); + + // Import MEC Main + $this->main = $this->getMain(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + } + + /** + * Initialize speakers feature + * @author Webnus + */ + public function init() + { + // Speakers Feature is Disabled + if(!isset($this->settings['speakers_status']) || !$this->settings['speakers_status']) return; + + $this->factory->action('init', array($this, 'register_taxonomy'), 25); + $this->factory->action('mec_speaker_edit_form_fields', array($this, 'edit_form')); + $this->factory->action('mec_speaker_add_form_fields', array($this, 'add_form')); + $this->factory->action('edited_mec_speaker', array($this, 'save_metadata')); + $this->factory->action('created_mec_speaker', array($this, 'save_metadata')); + + $this->factory->action('wp_ajax_speaker_adding', array($this, 'fes_speaker_adding')); + $this->factory->action('wp_ajax_nopriv_speaker_adding', array($this, 'fes_speaker_adding')); + $this->factory->action('wp_ajax_mec_sponsor_adding', array($this, 'fes_sponsor_adding')); + $this->factory->action('wp_ajax_nopriv_mec_sponsor_adding', array($this, 'fes_sponsor_adding')); + $this->factory->action('current_screen', array($this, 'show_notices')); + + $this->factory->filter('manage_edit-mec_speaker_columns', array($this, 'filter_columns')); + $this->factory->filter('manage_mec_speaker_custom_column', array($this, 'filter_columns_content'), 10, 3); + + $this->factory->action('current_screen', array($this, 'update_speakers_list_admin')); + $this->factory->action('mec_fes_form_footer', array($this, 'update_speakers_list')); + + $this->factory->action('wp_ajax_update_speakers_list', array($this, 'get_speakers')); + $this->factory->action('wp_ajax_nopriv_update_speakers_list', array($this, 'get_speakers')); + + $this->factory->filter('post_edit_category_parent_dropdown_args', array($this, 'hide_parent_dropdown')); + } + + /** + * Registers speaker taxonomy + * @author Webnus + */ + public function register_taxonomy() + { + $singular_label = $this->main->m('taxonomy_speaker', esc_html__('Speaker', 'modern-events-calendar-lite')); + $plural_label = $this->main->m('taxonomy_speakers', esc_html__('Speakers', 'modern-events-calendar-lite')); + $speaker_args = apply_filters( + 'mec_register_taxonomy_args', + array( + 'label'=>$plural_label, + 'labels'=>array( + 'name'=>$plural_label, + 'singular_name'=>$singular_label, + 'all_items'=>sprintf(esc_html__('All %s', 'modern-events-calendar-lite'), $plural_label), + 'edit_item'=>sprintf(esc_html__('Edit %s', 'modern-events-calendar-lite'), $singular_label), + 'view_item'=>sprintf(esc_html__('View %s', 'modern-events-calendar-lite'), $singular_label), + 'update_item'=>sprintf(esc_html__('Update %s', 'modern-events-calendar-lite'), $singular_label), + 'add_new_item'=>sprintf(esc_html__('Add New %s', 'modern-events-calendar-lite'), $singular_label), + 'new_item_name'=>sprintf(esc_html__('New %s Name', 'modern-events-calendar-lite'), $singular_label), + 'popular_items'=>sprintf(esc_html__('Popular %s', 'modern-events-calendar-lite'), $plural_label), + 'search_items'=>sprintf(esc_html__('Search %s', 'modern-events-calendar-lite'), $plural_label), + 'back_to_items'=>sprintf(esc_html__('← Back to %s', 'modern-events-calendar-lite'), $plural_label), + 'not_found'=>sprintf(esc_html__('no %s found.', 'modern-events-calendar-lite'), strtolower($plural_label)), + ), + 'rewrite'=>array('slug'=>'events-speaker'), + 'public'=>false, + 'show_ui'=>true, + 'show_in_rest'=>true, + 'hierarchical'=>false, + 'meta_box_cb'=>(isset($_POST['_inline_edit']) ? '' : 'post_categories_meta_box'), + ), + 'mec_speaker' + ); + register_taxonomy( + 'mec_speaker', + $this->main->get_main_post_type(), + $speaker_args + ); + + register_taxonomy_for_object_type('mec_speaker', $this->main->get_main_post_type()); + } + + /** + * Show edit form of speaker taxonomy + * @author Webnus + * @param object $term + */ + public function edit_form($term) + { + $job_title = get_metadata('term', $term->term_id, 'job_title', true); + $tel = get_metadata('term', $term->term_id, 'tel', true); + $email = get_metadata('term', $term->term_id, 'email', true); + $website = get_metadata('term', $term->term_id, 'website', true); + $index = get_metadata('term', $term->term_id, 'mec_index', true); + $facebook = get_metadata('term', $term->term_id, 'facebook', true); + $type = get_metadata('term', $term->term_id, 'type', true); + $instagram = get_metadata('term', $term->term_id, 'instagram', true); + $linkedin = get_metadata('term', $term->term_id, 'linkedin', true); + $twitter = get_metadata('term', $term->term_id, 'twitter', true); + $thumbnail = get_metadata('term', $term->term_id, 'thumbnail', true); + ?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        '; ?>
        + + + + + + + + */ + public function add_form() + { + ?> +
        + + +
        +
        + + +
        +
        + + +
        +
        + + +
        +
        + + +
        +
        + + +

        +
        +
        + + +
        +
        + + +
        +
        + + +
        +
        + + +
        +
        + +
        + + + +
        + + + * @param int $term_id + */ + public function save_metadata($term_id) + { + // Quick Edit + if(!isset($_POST['job_title'])) return; + + $job_title = sanitize_text_field($_POST['job_title']); + $type = isset($_POST['type']) ? sanitize_text_field($_POST['type']) : 'person'; + $tel = isset($_POST['tel']) ? sanitize_text_field($_POST['tel']) : ''; + $email = isset($_POST['email']) ? sanitize_text_field($_POST['email']) : ''; + $website = (isset($_POST['website']) and trim($_POST['website'])) ? esc_url($_POST['website']) : ''; + $index = (isset($_POST['mec_index']) and trim($_POST['mec_index'])) ? sanitize_text_field($_POST['mec_index']) : 99; + $facebook = (isset($_POST['facebook']) and trim($_POST['facebook'])) ? esc_url($_POST['facebook']) : ''; + $twitter = (isset($_POST['twitter']) and trim($_POST['twitter'])) ? esc_url($_POST['twitter']) : ''; + $instagram = (isset($_POST['instagram']) and trim($_POST['instagram'])) ? esc_url($_POST['instagram']) : ''; + $linkedin = (isset($_POST['linkedin']) and trim($_POST['linkedin'])) ? esc_url($_POST['linkedin']) : ''; + $thumbnail = isset($_POST['thumbnail']) ? sanitize_text_field($_POST['thumbnail']) : ''; + + update_term_meta($term_id, 'type', $type); + update_term_meta($term_id, 'job_title', $job_title); + update_term_meta($term_id, 'tel', $tel); + update_term_meta($term_id, 'email', $email); + update_term_meta($term_id, 'website', $website); + update_term_meta($term_id, 'mec_index', $index); + update_term_meta($term_id, 'facebook', $facebook); + update_term_meta($term_id, 'twitter', $twitter); + update_term_meta($term_id, 'instagram', $instagram); + update_term_meta($term_id, 'linkedin', $linkedin); + update_term_meta($term_id, 'thumbnail', $thumbnail); + + do_action('mec_save_speaker_extra_fields', $term_id); + } + + /** + * Filter columns of speaker taxonomy + * @author Webnus + * @param array $columns + * @return array + */ + public function filter_columns($columns) + { + unset($columns['name']); + unset($columns['slug']); + unset($columns['description']); + unset($columns['posts']); + + $columns['id'] = esc_html__('ID', 'modern-events-calendar-lite'); + $columns['name'] = $this->main->m('taxonomy_speaker', esc_html__('Speaker', 'modern-events-calendar-lite')); + $columns['job_title'] = esc_html__('Job Title', 'modern-events-calendar-lite'); + $columns['tel'] = esc_html__('Tel', 'modern-events-calendar-lite'); + $columns['posts'] = esc_html__('Count', 'modern-events-calendar-lite'); + + return apply_filters('speaker_filter_column', $columns); + } + + /** + * Filter content of speaker taxonomy columns + * @author Webnus + * @param string $content + * @param string $column_name + * @param int $term_id + * @return string + */ + public function filter_columns_content($content, $column_name, $term_id) + { + switch($column_name) + { + case 'id': + + $content = $term_id; + break; + + case 'tel': + + $content = get_metadata('term', $term_id, 'tel', true); + + break; + + case 'job_title': + + $content = get_metadata('term', $term_id, 'job_title', true); + + break; + + default: + break; + } + + return apply_filters('speaker_filter_column_content', $content, $column_name, $term_id); + } + + /** + * Adding new speaker + * @author Webnus + * @return void + */ + public function fes_speaker_adding() + { + $content = isset($_REQUEST['content']) ? sanitize_text_field($_REQUEST['content']) : NULL; + $key = isset($_REQUEST['key']) ? sanitize_text_field($_REQUEST['key']) : NULL; + + $content = wp_strip_all_tags($content); + $content = sanitize_text_field($content); + $key = intval($key); + + if(!trim($content)) + { + echo '

        ' . sprintf(esc_html__('Sorry, You must insert %s name!', 'modern-events-calendar-lite'), strtolower(\MEC\Base::get_main()->m('taxonomy_speaker', esc_html__('speaker', 'modern-events-calendar-lite')))) . '

        '; + exit; + } + + if(term_exists($content, 'mec_speaker')) + { + echo '

        ' . esc_html__("Sorry, {$content} already exists!", 'modern-events-calendar-lite') . '

        '; + exit; + } + + wp_insert_term(trim($content), 'mec_speaker'); + + $speakers = ''; + $speaker_terms = get_terms(array('taxonomy'=>'mec_speaker', 'hide_empty'=>false)); + foreach($speaker_terms as $speaker_term) + { + $speakers .= ''; + } + + echo MEC_kses::form($speakers); + exit; + } + + /** + * Adding new sponsor + * @author Webnus + * @return void + */ + public function fes_sponsor_adding() + { + $content = isset($_REQUEST['content']) ? sanitize_text_field($_REQUEST['content']) : NULL; + $key = isset($_REQUEST['key']) ? sanitize_text_field($_REQUEST['key']) : NULL; + + $content = wp_strip_all_tags($content); + $content = sanitize_text_field($content); + $key = intval($key); + + if(!trim($content)) + { + echo '

        ' . sprintf(esc_html__('Sorry, You must insert %s name!', 'modern-events-calendar-lite'), strtolower(\MEC\Base::get_main()->m('taxonomy_sponsor', esc_html__('sponsor', 'modern-events-calendar-lite')))) . '

        '; + exit; + } + + if(term_exists($content, 'mec_sponsor')) + { + echo '

        ' . esc_html__("Sorry, {$content} already exists!", 'modern-events-calendar-lite') . '

        '; + exit; + } + + wp_insert_term(trim($content), 'mec_sponsor'); + + $sponsors = ''; + $sponsor_terms = get_terms(array('taxonomy'=>'mec_sponsor', 'hide_empty'=>false)); + foreach($sponsor_terms as $sponsor_term) + { + $sponsors .= ''; + } + + echo MEC_kses::form($sponsors); + exit; + } + + public function show_notices($screen) + { + if(isset($screen->id) and $screen->id == 'edit-mec_speaker') + { + add_action('admin_footer', function() + { + echo ""; + }); + } + } + + public function update_speakers_list_admin($screen) + { + if(isset($screen->id) and $screen->id == 'mec-events' and isset($screen->base) and $screen->base == 'post') + { + add_action('admin_footer', array($this, 'update_speakers_list')); + } + } + + public function update_speakers_list() + { + echo ""; + } + + public function get_speakers() + { + $speakers = get_terms('mec_speaker', array( + 'orderby' => 'name', + 'order' => 'ASC', + 'hide_empty' => '0', + )); + + $sp = []; + foreach($speakers as $speaker) + { + $sp[] = array($speaker->term_id, $speaker->name); + } + + wp_send_json(array('speakers' => $sp)); + } + + public function hide_parent_dropdown($args) + { + if('mec_speaker' == $args['taxonomy']) $args['echo'] = false; + return $args; + } +} diff --git a/app/features/sponsors.php b/app/features/sponsors.php new file mode 100755 index 0000000..1a10f3e --- /dev/null +++ b/app/features/sponsors.php @@ -0,0 +1,176 @@ + + */ +class MEC_feature_sponsors extends MEC_base +{ + public $factory; + public $main; + public $settings; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Factory + $this->factory = $this->getFactory(); + + // Import MEC Main + $this->main = $this->getMain(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + } + + /** + * Initialize Sponsors feature + * @author Webnus + */ + public function init() + { + // Feature is not included in PRO + if(!$this->getPRO()) return; + + // Sponsors Feature is Disabled + if(!isset($this->settings['sponsors_status']) or (isset($this->settings['sponsors_status']) and !$this->settings['sponsors_status'])) return; + + $this->factory->action('init', array($this, 'register_taxonomy'), 25); + $this->factory->action('mec_sponsor_edit_form_fields', array($this, 'edit_form')); + $this->factory->action('mec_sponsor_add_form_fields', array($this, 'add_form')); + $this->factory->action('edited_mec_sponsor', array($this, 'save_metadata')); + $this->factory->action('created_mec_sponsor', array($this, 'save_metadata')); + + $this->factory->filter('post_edit_category_parent_dropdown_args', array($this, 'hide_parent_dropdown')); + } + + /** + * Registers Sponsors taxonomy + * @author Webnus + */ + public function register_taxonomy() + { + $singular_label = $this->main->m('taxonomy_sponsor', esc_html__('Sponsor', 'modern-events-calendar-lite')); + $plural_label = $this->main->m('taxonomy_sponsors', esc_html__('Sponsors', 'modern-events-calendar-lite')); + + $sponsor_args = apply_filters( + 'mec_register_taxonomy_args', + array( + 'label'=>$plural_label, + 'labels'=>array( + 'name'=>$plural_label, + 'singular_name'=>$singular_label, + 'all_items'=>sprintf(esc_html__('All %s', 'modern-events-calendar-lite'), $plural_label), + 'edit_item'=>sprintf(esc_html__('Edit %s', 'modern-events-calendar-lite'), $singular_label), + 'view_item'=>sprintf(esc_html__('View %s', 'modern-events-calendar-lite'), $singular_label), + 'update_item'=>sprintf(esc_html__('Update %s', 'modern-events-calendar-lite'), $singular_label), + 'add_new_item'=>sprintf(esc_html__('Add New %s', 'modern-events-calendar-lite'), $singular_label), + 'new_item_name'=>sprintf(esc_html__('New %s Name', 'modern-events-calendar-lite'), $singular_label), + 'popular_items'=>sprintf(esc_html__('Popular %s', 'modern-events-calendar-lite'), $plural_label), + 'search_items'=>sprintf(esc_html__('Search %s', 'modern-events-calendar-lite'), $plural_label), + 'back_to_items'=>sprintf(esc_html__('← Back to %s', 'modern-events-calendar-lite'), $plural_label), + 'not_found'=>sprintf(esc_html__('no %s found.', 'modern-events-calendar-lite'), strtolower($plural_label)), + ), + 'rewrite'=>array('slug'=>'events-sponsor'), + 'public'=>false, + 'show_ui'=>true, + 'show_in_rest'=>true, + 'hierarchical'=>false, + 'meta_box_cb' => function_exists('wp_doing_ajax') && wp_doing_ajax() ? '' : 'post_categories_meta_box', + ), + 'mec_sponsor' + ); + register_taxonomy( + 'mec_sponsor', + $this->main->get_main_post_type(), + $sponsor_args + ); + + register_taxonomy_for_object_type('mec_sponsor', $this->main->get_main_post_type()); + } + + /** + * Show edit form of Sponsors taxonomy + * @author Webnus + * @param object $term + */ + public function edit_form($term) + { + $link = get_metadata('term', $term->term_id, 'link', true); + $logo = get_metadata('term', $term->term_id, 'logo', true); + ?> + + + + + + + + + + + + + +
        '; ?>
        + + + + + + + + */ + public function add_form() + { + ?> +
        + + +
        +
        + +
        + + + +
        + + + * @param int $term_id + */ + public function save_metadata($term_id) + { + // Quick Edit + if(!isset($_POST['link'])) return; + + $link = (isset($_POST['link']) and trim($_POST['link'])) ? esc_url($_POST['link']) : ''; + $logo = (isset($_POST['logo']) and trim($_POST['logo'])) ? esc_url($_POST['logo']) : ''; + + update_term_meta($term_id, 'link', $link); + update_term_meta($term_id, 'logo', $logo); + + do_action('mec_save_sponsor_extra_fields', $term_id); + } + + public function hide_parent_dropdown($args) + { + if('mec_sponsor' == $args['taxonomy']) $args['echo'] = false; + return $args; + } +} diff --git a/app/features/tag.php b/app/features/tag.php new file mode 100755 index 0000000..4b8fe1c --- /dev/null +++ b/app/features/tag.php @@ -0,0 +1,132 @@ + + */ +class MEC_feature_tag extends MEC_base +{ + public $factory; + public $main; + public $settings; + public $PT; + public $taxonomy; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Factory + $this->factory = $this->getFactory(); + + // Main Library + $this->main = $this->getMain(); + + // Settings + $this->settings = $this->main->get_settings(); + + // Post Type + $this->PT = $this->main->get_main_post_type(); + + // Taxonomy + $this->taxonomy = (isset($this->settings['tag_method']) ? $this->settings['tag_method'] : 'post_tag'); + } + + /** + * Initialize search feature + * @author Webnus + */ + public function init() + { + $this->factory->action('init', array($this, 'register_taxonomy'), 100); + $this->factory->filter('mec_taxonomy_tag', array($this, 'taxonomy'), 10); + + // Toggle Tag Method + $this->factory->action('mec_tag_method_changed', array($this, 'toggle'), 10, 2); + } + + public function register_taxonomy($taxonomy = NULL) + { + if(!$taxonomy) $taxonomy = $this->taxonomy; + + if($taxonomy === 'post_tag') register_taxonomy_for_object_type('post_tag', $this->PT); + else + { + $singular_label = $this->main->m('taxonomy_tag', esc_html__('Tag', 'modern-events-calendar-lite')); + $plural_label = $this->main->m('taxonomy_tags', esc_html__('Tags', 'modern-events-calendar-lite')); + + $tag_args = apply_filters( + 'mec_register_taxonomy_args', + array( + 'label'=>$plural_label, + 'labels'=>array( + 'name'=>$plural_label, + 'singular_name'=>$singular_label, + 'all_items'=>sprintf(esc_html__('All %s', 'modern-events-calendar-lite'), $plural_label), + 'edit_item'=>sprintf(esc_html__('Edit %s', 'modern-events-calendar-lite'), $singular_label), + 'view_item'=>sprintf(esc_html__('View %s', 'modern-events-calendar-lite'), $singular_label), + 'update_item'=>sprintf(esc_html__('Update %s', 'modern-events-calendar-lite'), $singular_label), + 'add_new_item'=>sprintf(esc_html__('Add New %s', 'modern-events-calendar-lite'), $singular_label), + 'new_item_name'=>sprintf(esc_html__('New %s Name', 'modern-events-calendar-lite'), $singular_label), + 'popular_items'=>sprintf(esc_html__('Popular %s', 'modern-events-calendar-lite'), $plural_label), + 'search_items'=>sprintf(esc_html__('Search %s', 'modern-events-calendar-lite'), $plural_label), + 'back_to_items'=>sprintf(esc_html__('← Back to %s', 'modern-events-calendar-lite'), $plural_label), + 'not_found'=>sprintf(esc_html__('no %s found.', 'modern-events-calendar-lite'), strtolower($plural_label)), + ), + 'rewrite'=>array('slug'=>'events-tag'), + 'public'=>true, + 'show_ui'=>true, + 'show_in_rest'=>true, + 'hierarchical'=>false, + ), + 'mec_tag' + ); + register_taxonomy( + 'mec_tag', + $this->PT, + $tag_args + ); + + register_taxonomy_for_object_type('mec_tag', $this->PT); + } + } + + public function taxonomy($taxonomy) + { + return $this->taxonomy; + } + + public function toggle($new_method, $old_method) + { + // Register New Taxonomy + $this->register_taxonomy($new_method); + + $events = get_posts(array( + 'post_type' => $this->PT, + 'post_status' => array('publish', 'pending', 'draft', 'future', 'private', 'trash'), + 'numberposts' => -1 + )); + + foreach($events as $event) + { + $old_terms = get_the_terms($event, $old_method); + if(!is_array($old_terms) or (is_array($old_terms) and !count($old_terms))) continue; + + $new_term_ids = []; + foreach($old_terms as $old_term) + { + $term = wp_create_term($old_term->name, $new_method); + $new_term_id = (int) (is_array($term) ? $term['term_id'] : (is_numeric($term) ? $term : false)); + + if(!$new_term_id) continue; + $new_term_ids[] = $new_term_id; + } + + if(count($new_term_ids)) wp_set_object_terms($event->ID, $new_term_ids, $new_method); + wp_delete_object_term_relationships($event->ID, $old_method); + } + } +} \ No newline at end of file diff --git a/app/features/taxonomies/shortcode.php b/app/features/taxonomies/shortcode.php new file mode 100755 index 0000000..43e7e47 --- /dev/null +++ b/app/features/taxonomies/shortcode.php @@ -0,0 +1,29 @@ + +
        + +
        \ No newline at end of file diff --git a/app/features/taxonomyshortcode.php b/app/features/taxonomyshortcode.php new file mode 100755 index 0000000..2f94fa1 --- /dev/null +++ b/app/features/taxonomyshortcode.php @@ -0,0 +1,67 @@ + + */ +class MEC_feature_taxonomyshortcode extends MEC_base +{ + /** + * @var MEC_factory + */ + public $factory; + + /** + * @var MEC_main + */ + public $main; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Factory + $this->factory = $this->getFactory(); + + // Import MEC Main + $this->main = $this->getMain(); + } + + /** + * Initialize User Events Feature + * @author Webnus + */ + public function init() + { + // User Events Shortcode + $this->factory->shortcode('MEC_taxonomy_category', array($this, 'category')); + } + + public function category(): string + { + $categories = get_terms([ + 'taxonomy' => 'mec_category' + ]); + + return $this->output($categories); + } + + /** + * Show Terms Output + * + * @param array $terms + * @return string + */ + public function output(array $terms = []): string + { + $path = MEC::import('app.features.taxonomies.shortcode', true, true); + + ob_start(); + include $path; + return ob_get_clean(); + } +} \ No newline at end of file diff --git a/app/features/update.php b/app/features/update.php new file mode 100755 index 0000000..16d93cf --- /dev/null +++ b/app/features/update.php @@ -0,0 +1,930 @@ + + */ +class MEC_feature_update extends MEC_base +{ + public $factory; + public $main; + public $db; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Main + $this->main = $this->getMain(); + + // Import MEC DB + $this->db = $this->getDB(); + + // Import MEC Factory + $this->factory = $this->getFactory(); + } + + /** + * Initialize update feature + * @author Webnus + */ + public function init() + { + // Plugin is not installed yet so no need to run these upgrades + if(!get_option('mec_installed', 0)) return; + + // Run the Update Function + $this->factory->action('admin_init', array($this, 'update')); + } + + public function update() + { + $version = get_option('mec_version', '1.0.0'); + + // It's updated to latest version + if(version_compare($version, $this->main->get_version(), '>=')) return; + + // Run the updates one by one + if(version_compare($version, '1.0.3', '<')) $this->version103(); + if(version_compare($version, '1.3.0', '<')) $this->version130(); + if(version_compare($version, '1.5.0', '<')) $this->version150(); + if(version_compare($version, '2.2.0', '<')) $this->version220(); + if(version_compare($version, '2.9.0', '<')) $this->version290(); + if(version_compare($version, '3.2.0', '<')) $this->version320(); + if(version_compare($version, '3.5.0', '<')) $this->version350(); + if(version_compare($version, '4.0.0', '<')) $this->version400(); + if(version_compare($version, '4.3.0', '<')) $this->version430(); + if(version_compare($version, '4.4.6', '<')) $this->version446(); + if(version_compare($version, '4.6.1', '<')) $this->version461(); + if(version_compare($version, '4.9.0', '<')) $this->version490(); + if(version_compare($version, '5.0.5', '<')) $this->version505(); + if(version_compare($version, '5.5.1', '<')) $this->version551(); + if(version_compare($version, '5.7.1', '<')) $this->version571(); + if(version_compare($version, '5.10.0', '<')) $this->version5100(); + if(version_compare($version, '5.11.0', '<')) $this->version5110(); + if(version_compare($version, '5.12.6', '<')) $this->version5126(); + if(version_compare($version, '5.13.5', '<')) $this->version5135(); + if(version_compare($version, '5.14.0', '<')) $this->version5140(); + if(version_compare($version, '5.16.0', '<')) $this->version5160(); + if(version_compare($version, '5.16.1', '<')) $this->version5161(); + if(version_compare($version, '5.16.2', '<')) $this->version5162(); + if(version_compare($version, '5.17.0', '<')) $this->version5170(); + if(version_compare($version, '5.17.1', '<')) $this->version5171(); + if(version_compare($version, '5.19.1', '<')) $this->version5191(); + if(version_compare($version, '5.22.0', '<')) $this->version5220(); + if(version_compare($version, '6.0.0', '<')) $this->version600(); + // if(version_compare($version, '6.2.6', '>')) $this->version626(); + if(version_compare($version, '6.4.0', '<')) $this->version640(); + if(version_compare($version, '6.5.3', '<')) $this->version653(); + if(version_compare($version, '6.6.11', '<')) $this->version6611(); + if(version_compare($version, '6.7.5', '<')) $this->version675(); + if(version_compare($version, '6.8.35', '<')) $this->version6835(); + if(version_compare($version, '7.0.0', '<')) $this->version700(); + if(version_compare($version, '7.2.0', '<')) $this->version720(); + if(version_compare($version, '7.4.0', '<')) $this->version740(); + if(version_compare($version, '7.11.0', '<')) $this->version7110(); + if(version_compare($version, '7.13.0', '<')) $this->version7130(); + + // Update to latest version to prevent running the code twice + update_option('mec_version', $this->main->get_version()); + } + + public function update_capabilities($capabilities) + { + // Site Admin + $role = get_role('administrator'); + if($role) foreach($capabilities as $capability) $role->add_cap($capability, true); + + // Multisite + if(is_multisite()) + { + // All Super Admins + $supers = get_super_admins(); + foreach($supers as $admin) + { + $user = new WP_User(0, $admin); + foreach($capabilities as $capability) $user->add_cap($capability, true); + } + } + } + + public function reschedule() + { + // Scheduler + $schedule = $this->getSchedule(); + + // Add Schedule for All Events + $events = $this->main->get_events(); + foreach($events as $event) $schedule->reschedule($event->ID, 50); + } + + /** + * Update database to version 1.0.3 + * @author Webnus + */ + public function version103() + { + // Get current MEC options + $current = get_option('mec_options', array()); + if(is_string($current) and trim($current) == '') $current = []; + + // Merge new options with previous options + $current['notifications']['new_event'] = array + ( + 'status'=>'1', + 'subject'=>'A new event is added.', + 'recipients'=>'', + 'content'=>"Hello, + + A new event just added. The event title is %%event_title%% and it's status is %%event_status%% + The new event may need to be published. Please use this link for managing your website events: %%admin_link%% + + Regards, + %%blog_name%%" + ); + + // Update it only if options already exists. + if(get_option('mec_options') !== false) + { + // Save new options + update_option('mec_options', $current); + } + } + + /** + * Update database to version 1.3.0 + * @author Webnus + */ + public function version130() + { + $this->db->q("ALTER TABLE `#__mec_events` ADD `days` TEXT NULL DEFAULT NULL, ADD `time_start` INT(10) NOT NULL DEFAULT '0', ADD `time_end` INT(10) NOT NULL DEFAULT '0'"); + } + + /** + * Update database to version 1.5.0 + * @author Webnus + */ + public function version150() + { + $this->db->q("ALTER TABLE `#__mec_events` ADD `not_in_days` TEXT NOT NULL DEFAULT '' AFTER `days`"); + $this->db->q("ALTER TABLE `#__mec_events` CHANGE `days` `days` TEXT NOT NULL DEFAULT ''"); + } + + /** + * Update database to version 2.2.0 + * @author Webnus + */ + public function version220() + { + // Get current MEC options + $current = get_option('mec_options', array()); + if(is_string($current) and trim($current) == '') $current = []; + + // Merge new options with previous options + $current['notifications']['booking_reminder'] = array + ( + 'status'=>'0', + 'subject'=>'Booking Reminder', + 'recipients'=>'', + 'days'=>'1,3', + 'content'=>"Hello, + + This email is to remind you that you booked %%event_title%% event on %%book_date%% date. + We're looking forward to see you at %%event_location_address%%. You can contact %%event_organizer_email%% if you have any questions. + + Regards, + %%blog_name%%" + ); + + // Update it only if options already exists. + if(get_option('mec_options') !== false) + { + // Save new options + update_option('mec_options', $current); + } + } + + public function version290() + { + $this->db->q("UPDATE `#__postmeta` SET `meta_value`=CONCAT(',', `meta_value`) WHERE `meta_key`='mec_ticket_id'"); + $this->db->q("UPDATE `#__postmeta` SET `meta_value`=CONCAT(`meta_value`, ',') WHERE `meta_key`='mec_ticket_id'"); + } + + public function version320() + { + $this->db->q("ALTER TABLE `#__mec_events` DROP INDEX `repeat`;"); + $this->db->q("ALTER TABLE `#__mec_events` CHANGE `rinterval` `rinterval` VARCHAR(10);"); + $this->db->q("ALTER TABLE `#__mec_events` CHANGE `year` `year` VARCHAR(80);"); + $this->db->q("ALTER TABLE `#__mec_events` CHANGE `month` `month` VARCHAR(80);"); + $this->db->q("ALTER TABLE `#__mec_events` CHANGE `day` `day` VARCHAR(80);"); + $this->db->q("ALTER TABLE `#__mec_events` CHANGE `week` `week` VARCHAR(80);"); + $this->db->q("ALTER TABLE `#__mec_events` CHANGE `weekday` `weekday` VARCHAR(80);"); + $this->db->q("ALTER TABLE `#__mec_events` CHANGE `weekdays` `weekdays` VARCHAR(80);"); + $this->db->q("ALTER TABLE `#__mec_events` ADD INDEX( `start`, `end`, `repeat`, `rinterval`, `year`, `month`, `day`, `week`, `weekday`, `weekdays`, `time_start`, `time_end`);"); + } + + public function version350() + { + $this->db->q("CREATE TABLE IF NOT EXISTS `#__mec_dates` ( + `id` int(10) UNSIGNED NOT NULL, + `post_id` int(10) NOT NULL, + `dstart` date NOT NULL, + `dend` date NOT NULL, + `type` enum('include','exclude') COLLATE [:COLLATE:] NOT NULL DEFAULT 'include' + ) DEFAULT CHARSET=[:CHARSET:] COLLATE=[:COLLATE:];"); + + $this->db->q("ALTER TABLE `#__mec_dates` ADD PRIMARY KEY (`id`), ADD KEY `post_id` (`post_id`), ADD KEY `type` (`type`);"); + $this->db->q("ALTER TABLE `#__mec_dates` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;"); + + $custom_days = $this->db->select("SELECT * FROM `#__mec_events` WHERE `days`!=''", 'loadAssocList'); + foreach($custom_days as $custom_day) + { + $days = explode(',', trim($custom_day['days'], ', ')); + + $new_days_str = ''; + foreach($days as $day) + { + if(!trim($day)) continue; + + $start = $day; + $end = $day; + + $this->db->q("INSERT INTO `#__mec_dates` (`post_id`,`dstart`,`dend`,`type`) VALUES ('".$custom_day['post_id']."','$start','$end','include')"); + + $new_days_str .= $start.':'.$end.','; + } + + $new_days_str = trim($new_days_str, ', '); + + $this->db->q("UPDATE `#__mec_events` SET `days`='".$new_days_str."' WHERE `post_id`='".$custom_day['post_id']."'"); + update_post_meta($custom_day['post_id'], 'mec_in_days', $new_days_str); + } + } + + public function version400() + { + // Add Columns + $this->db->q("ALTER TABLE `#__mec_dates` ADD `tstart` INT(11) UNSIGNED NOT NULL DEFAULT '0' AFTER `dend`;"); + $this->db->q("ALTER TABLE `#__mec_dates` ADD `tend` INT(11) UNSIGNED NOT NULL DEFAULT '0' AFTER `tstart`;"); + + // Add Indexes + $this->db->q("ALTER TABLE `#__mec_dates` ADD INDEX (`tstart`);"); + $this->db->q("ALTER TABLE `#__mec_dates` ADD INDEX (`tend`);"); + + // Drop Columns + $this->db->q("ALTER TABLE `#__mec_dates` DROP COLUMN `type`;"); + + // Reschedule + $this->reschedule(); + + // Scheduler Cron job + if(!wp_next_scheduled('mec_scheduler')) wp_schedule_event(time(), 'hourly', 'mec_scheduler'); + } + + public function version430() + { + // Get current MEC options + $current = get_option('mec_options', array()); + if(is_string($current) and trim($current) == '') $current = []; + + // Merge new options with previous options + $current['notifications']['cancellation_notification'] = array + ( + 'status'=>'0', + 'subject'=>'Your booking is canceled.', + 'recipients'=>'', + 'send_to_admin'=>'1', + 'send_to_organizer'=>'0', + 'send_to_user'=>'0', + 'content'=>"Hi %%name%%, + + For your information, your booking for %%event_title%% at %%book_date%% is canceled. + + Regards, + %%blog_name%%" + ); + + // Update it only if options already exists. + if(get_option('mec_options') !== false) + { + // Save new options + update_option('mec_options', $current); + } + } + + public function version446() + { + if(!wp_next_scheduled('mec_syncScheduler')) wp_schedule_event(time(), 'daily', 'mec_syncScheduler'); + } + + public function version461() + { + // Get current MEC options + $current = get_option('mec_options', array()); + if(is_string($current) and trim($current) == '') $current = []; + + // Merge new options with previous options + $current['notifications']['user_event_publishing'] = array + ( + 'status'=>'0', + 'subject'=>'Your event gets published!', + 'recipients'=>'', + 'content'=>"Hello %%name%%, + + Your event gets published. You can check it below: + + %%event_title%% + + Regards, + %%blog_name%%" + ); + + // Update it only if options already exists. + if(get_option('mec_options') !== false) + { + // Save new options + update_option('mec_options', $current); + } + } + + public function version490() + { + // Get Booking Posts + $bookings = get_posts(array( + 'post_type' => $this->main->get_book_post_type(), + 'numberposts' => '-1', + 'post_status' => 'any', + )); + + foreach($bookings as $id => $booking) + { + $event_id = get_post_meta($booking->ID, 'mec_event_id', true); + $location_id = get_post_meta($event_id, 'mec_location_id', true); + + if(!empty($location_id)) update_post_meta($booking->ID, 'mec_booking_location', $location_id); + } + } + + public function version505() + { + if(!wp_next_scheduled('mec_syncScheduler')) wp_schedule_event(time(), 'daily', 'mec_syncScheduler'); + } + + public function version551() + { + // Get Booking Posts + $bookings = get_posts(array( + 'post_type' => $this->main->get_book_post_type(), + 'numberposts' => '-1', + 'post_status' => 'any', + )); + + foreach($bookings as $id => $booking) + { + $event_id = get_post_meta($booking->ID, 'mec_event_id', true); + + $start_time_int = (int) get_post_meta($event_id, 'mec_start_day_seconds', true); + $end_time_int = (int) get_post_meta($event_id, 'mec_end_day_seconds', true); + + $start_time = gmdate('H:i:s', $start_time_int); + $end_time = gmdate('H:i:s', $end_time_int); + + $mec_date = get_post_meta($booking->ID, 'mec_date', true); + if(is_array($mec_date) and isset($mec_date['start']) and isset($mec_date['start']['date'])) $mec_date = $mec_date['start']['date'].':'.$mec_date['end']['date']; + + list($start_date, $end_date) = explode(':', $mec_date); + if(is_numeric($start_date) or is_numeric($end_date)) continue; + + $start_datetime = $start_date.' '.$start_time; + $end_datetime = $end_date.' '.$end_time; + + // Update MEC Date + update_post_meta($booking->ID, 'mec_date', strtotime($start_datetime).':'.strtotime($end_datetime)); + + $post_date = date('Y-m-d H:i:s', strtotime($start_datetime)); + $gmt_date = get_gmt_from_date($post_date); + + // Update Booking Date + wp_update_post(array( + 'ID' => $booking->ID, + 'post_date' => $post_date, + 'post_date_gmt' => $gmt_date, + )); + } + } + + public function version571() + { + // Get current MEC options + $current = get_option('mec_options', array()); + if(is_string($current) and trim($current) == '') $current = []; + + if(!isset($current['notifications']['booking_reminder'])) return; + if(isset($current['notifications']['booking_reminder']['hours'])) return; + + // Change Days to Hours + $days = explode(',', trim($current['notifications']['booking_reminder']['days'], ', ')); + + $hours = ''; + foreach($days as $day) + { + $hours .= ($day * 24).','; + } + + $current['notifications']['booking_reminder']['hours'] = trim($hours, ', '); + unset($current['notifications']['booking_reminder']['days']); + + // Update it only if options already exists. + if(get_option('mec_options') !== false) + { + // Save new options + update_option('mec_options', $current); + } + } + + public function version5100() + { + $this->db->q("CREATE TABLE IF NOT EXISTS `#__mec_occurrences` ( + `id` int(10) UNSIGNED NOT NULL, + `post_id` int(10) UNSIGNED NOT NULL, + `occurrence` int(10) UNSIGNED NOT NULL, + `params` text COLLATE [:COLLATE:] + ) DEFAULT CHARSET=[:CHARSET:] COLLATE=[:COLLATE:];"); + + $this->db->q("ALTER TABLE `#__mec_occurrences` ADD PRIMARY KEY (`id`), ADD KEY `post_id` (`post_id`), ADD KEY `occurrence` (`occurrence`);"); + $this->db->q("ALTER TABLE `#__mec_occurrences` MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT;"); + } + + public function version5110() + { + $this->db->q("CREATE TABLE IF NOT EXISTS `#__mec_users` ( + `id` int(10) NOT NULL, + `first_name` varchar(255) NOT NULL, + `last_name` varchar(255) NOT NULL, + `email` varchar(127) NOT NULL, + `reg` TEXT NULL DEFAULT NULL, + `created_at` datetime DEFAULT NULL, + `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP + ) DEFAULT CHARSET=[:CHARSET:] COLLATE=[:COLLATE:];"); + + $this->db->q("ALTER TABLE `#__mec_users` ADD PRIMARY KEY (`id`);"); + $this->db->q("ALTER TABLE `#__mec_users` MODIFY `id` int NOT NULL AUTO_INCREMENT;"); + $this->db->q("ALTER TABLE `#__mec_users` AUTO_INCREMENT=1000000;"); + $this->db->q("ALTER TABLE `#__mec_users` ADD UNIQUE KEY `email` (`email`);"); + } + + public function version5126() + { + $all = $this->db->select("SELECT * FROM `#__mec_users`", 'loadAssocList'); + $zeros = $this->db->select("SELECT * FROM `#__mec_users` WHERE `id`='0'", 'loadAssocList'); + + if(is_array($all) and !count($all)) + { + $this->db->q("DROP TABLE `#__mec_users`"); + $this->version5110(); + } + elseif(is_array($zeros) and count($zeros)) + { + $this->db->q("TRUNCATE `#__mec_users`"); + $this->db->q("ALTER TABLE `#__mec_users` CHANGE `email` `email` VARCHAR(127) NOT NULL;"); + $this->db->q("ALTER TABLE `#__mec_users` ADD PRIMARY KEY (`id`);"); + $this->db->q("ALTER TABLE `#__mec_users` MODIFY `id` int NOT NULL AUTO_INCREMENT;"); + $this->db->q("ALTER TABLE `#__mec_users` AUTO_INCREMENT=1000000;"); + $this->db->q("ALTER TABLE `#__mec_users` ADD UNIQUE KEY `email` (`email`);"); + } + else + { + $this->db->q("ALTER TABLE `#__mec_users` CHANGE `email` `email` VARCHAR(127) NOT NULL;"); + } + } + + public function version5135() + { + // Get current MEC options + $current = get_option('mec_options', array()); + if(is_string($current) and trim($current) == '') $current = []; + + // Merge new options with previous options + $current['notifications']['booking_rejection'] = array + ( + 'status'=>'0', + 'subject'=>'Your booking got rejected!', + 'recipients'=>'', + 'send_to_admin'=>'0', + 'send_to_organizer'=>'1', + 'send_to_user'=>'1', + 'content'=>"Hi %%name%%, + + For your information, your booking for %%event_title%% at %%book_datetime%% is rejected. + + Regards, + %%blog_name%%" + ); + + $current['notifications']['event_soldout'] = array + ( + 'status'=>'0', + 'subject'=>'Your event is soldout!', + 'recipients'=>'', + 'send_to_admin'=>'1', + 'send_to_organizer'=>'1', + 'content'=>"Hi %%name%%, + + For your information, your %%event_title%% event at %%book_datetime%% is soldout. + + Regards, + %%blog_name%%" + ); + + // Update it only if options already exists. + if(get_option('mec_options') !== false) + { + // Save new options + update_option('mec_options', $current); + } + } + + public function version5140() + { + // List of Capabilities + $capabilities = array('mec_bookings', 'mec_add_booking', 'mec_coupons', 'mec_report', 'mec_import_export', 'mec_settings'); + + // Update Capabilities + $this->update_capabilities($capabilities); + } + + public function version5160() + { + $mec = $this->db->select("SELECT * FROM `#__mec_users`", 'loadAssocList'); + if(is_array($mec) and !count($mec)) + { + $this->db->q("DROP TABLE `#__mec_users`"); + $this->version5110(); + } + + // Add Public Column + $this->db->q("ALTER TABLE `#__mec_dates` ADD `public` INT(4) UNSIGNED NOT NULL DEFAULT 1 AFTER `tend`;"); + } + + public function version5161() + { + // Add Public Column If Not Exists + if(!$this->db->columns('mec_dates', 'public')) + { + $this->db->q("ALTER TABLE `#__mec_dates` ADD `public` INT(4) UNSIGNED NOT NULL DEFAULT 1 AFTER `tend`;"); + } + } + + public function version5162() + { + $this->version5161(); + } + + public function version5170() + { + // List of Capabilities + $capabilities = array('mec_shortcodes', 'mec_settings'); + + // Update Capabilities + $this->update_capabilities($capabilities); + } + + public function version5171() + { + $this->version5170(); + $this->reschedule(); + } + + public function version5191() + { + $this->version5170(); + } + + public function version5220() + { + // All Events + $events = $this->main->get_events(); + + foreach($events as $event) + { + $start_time_hour = get_post_meta($event->ID, 'mec_start_time_hour', true); + $start_time_minutes = get_post_meta($event->ID, 'mec_start_time_minutes', true); + $start_time_ampm = get_post_meta($event->ID, 'mec_start_time_ampm', true); + $end_time_hour = get_post_meta($event->ID, 'mec_end_time_hour', true); + $end_time_minutes = get_post_meta($event->ID, 'mec_end_time_minutes', true); + $end_time_ampm = get_post_meta($event->ID, 'mec_end_time_ampm', true); + + $day_start_seconds = $this->main->time_to_seconds($this->main->to_24hours($start_time_hour, $start_time_ampm), $start_time_minutes); + $day_end_seconds = $this->main->time_to_seconds($this->main->to_24hours($end_time_hour, $end_time_ampm), $end_time_minutes); + + update_post_meta($event->ID, 'mec_start_day_seconds', $day_start_seconds); + update_post_meta($event->ID, 'mec_end_day_seconds', $day_end_seconds); + } + } + + public function version600() + { + $this->db->q("CREATE TABLE IF NOT EXISTS `#__mec_bookings` ( + `id` int UNSIGNED NOT NULL, + `booking_id` int UNSIGNED NOT NULL, + `event_id` int UNSIGNED NOT NULL, + `ticket_ids` varchar(255) NOT NULL, + `status` varchar(20) NOT NULL DEFAULT 'pending', + `confirmed` tinyint NOT NULL DEFAULT '0', + `verified` tinyint NOT NULL DEFAULT '0', + `all_occurrences` tinyint NOT NULL DEFAULT '0', + `date` datetime NOT NULL, + `timestamp` int UNSIGNED NOT NULL + ) DEFAULT CHARSET=[:CHARSET:] COLLATE=[:COLLATE:];"); + + $this->db->q("ALTER TABLE `#__mec_bookings` ADD PRIMARY KEY (`id`);"); + $this->db->q("ALTER TABLE `#__mec_bookings` MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT;"); + $this->db->q("ALTER TABLE `#__mec_bookings` ADD KEY `event_id` (`event_id`,`ticket_ids`,`status`,`confirmed`,`verified`,`date`);"); + $this->db->q("ALTER TABLE `#__mec_bookings` ADD KEY `booking_id` (`booking_id`);"); + $this->db->q("ALTER TABLE `#__mec_bookings` ADD KEY `timestamp` (`timestamp`);"); + $this->db->q("ALTER TABLE `#__mec_bookings` ADD `transaction_id` VARCHAR(20) NULL AFTER `booking_id`;"); + + $this->db->q("ALTER TABLE `#__mec_bookings` ADD `user_id` INT(10) UNSIGNED NULL DEFAULT NULL AFTER `booking_id`;"); + $this->db->q("ALTER TABLE `#__mec_bookings` ADD INDEX (`user_id`);"); + + // Get Booking Posts + $bookings = get_posts(array( + 'post_type' => $this->main->get_book_post_type(), + 'numberposts' => '-1', + 'post_status' => 'any', + )); + + // Booking Record + $bookingRecord = $this->getBookingRecord(); + + // Add Records for Existing Bookings + foreach($bookings as $booking) $bookingRecord->insert($booking); + } + + public function version626() + { + if(!$this->getPRO()) return; + + // Get Options + $options = get_option('mec_options'); + $code = $options['purchase_code'] ?? ''; + $item_id = $options['product_id'] ?? ''; + $url = get_home_url(); + + $reActivationOption = get_option('reActivationOption'); + if(empty($code) || $reActivationOption) return; + + if(!$reActivationOption) + { + $verify_url = MEC_API_ACTIVATION . '/activation/verify?category=mec&license=' . $code . '&url=' . $url . '&item_id=' . $item_id; + $JSON = wp_remote_retrieve_body(wp_remote_get($verify_url, array( + 'body' => null, + 'timeout' => '120', + 'redirection' => '10', + 'user-agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36', + ))); + + if($JSON != '') + { + $data = json_decode($JSON); + if($data and isset($data->item_link)) + { + $options['product_id'] = $data->item_id; + + update_option('mec_license_status', 'active'); + update_option('mec_options', $options); + update_option('reActivationOption', '1'); + } + else + { + update_option('mec_license_status', 'faild'); + update_option('reActivationOption', '1'); + } + } + else update_option('reActivationOption', '1'); + } + } + + public function version640() + { + $this->db->q("ALTER TABLE `#__mec_dates` ADD `status` VARCHAR(20) NOT NULL DEFAULT 'publish' AFTER `tend`;"); + } + + public function version653() + { + $this->db->q("ALTER TABLE `#__mec_bookings` CHANGE `ticket_ids` `ticket_ids` VARCHAR(655) NOT NULL;"); + } + + public function version6611() + { + // Add Seats Columns If Not Exists + if(!$this->db->columns('mec_bookings', 'seats')) + { + $this->db->q("ALTER TABLE `#__mec_bookings` ADD `seats` INT(10) UNSIGNED NOT NULL DEFAULT 0 AFTER `ticket_ids`;"); + + // Booking Records + $bookings = $this->db->select("SELECT `id`, `ticket_ids` FROM `#__mec_bookings` ORDER BY `date` DESC LIMIT 2000", 'loadObjectList'); + foreach($bookings as $booking) + { + $ticket_ids = trim($booking->ticket_ids, ', '); + $seats = substr_count($ticket_ids, ',') + 1; + + $this->db->q("UPDATE `#__mec_bookings` SET `seats`='".esc_sql($seats)."' WHERE `id`=".esc_sql($booking->id)); + } + } + } + + public function version675() + { + $bookings = get_posts([ + 'post_type' => $this->main->get_book_post_type(), + 'numberposts' => 300, + 'post_status' => 'publish' + ]); + + // MEC Booking + $book = $this->getBook(); + + foreach($bookings as $booking) + { + $price = get_post_meta($booking->ID, 'mec_price', true); + + // Payable Data Exists + $existing_payable = get_post_meta($booking->ID, 'mec_payable', true); + if($existing_payable) continue; + + update_post_meta($booking->ID, 'mec_payable', $price); + + $transaction_id = get_post_meta($booking->ID, 'mec_transaction_id', true); + $transaction = $book->get_transaction($transaction_id); + + if(isset($transaction['price'])) + { + $transaction['price_details']['payable'] = $transaction['price']; + $transaction['payable'] = $transaction['price']; + + $book->update_transaction($transaction_id, $transaction); + } + } + } + + public function version6835() + { + if(!wp_next_scheduled('mec_maintenance')) wp_schedule_event(time(), 'daily', 'mec_maintenance'); + } + + public function version700() + { + // Table already exists + if($this->db->exists('mec_booking_attendees')) return; + + $this->db->q("CREATE TABLE IF NOT EXISTS `#__mec_booking_attendees` ( + `id` int UNSIGNED NOT NULL, + `mec_booking_id` int UNSIGNED NOT NULL, + `user_id` int UNSIGNED NOT NULL, + `ticket_id` int UNSIGNED NOT NULL + ) CHARSET=[:CHARSET:] COLLATE=[:COLLATE:];"); + + $this->db->q("ALTER TABLE `#__mec_booking_attendees` ADD PRIMARY KEY (`id`);"); + $this->db->q("ALTER TABLE `#__mec_booking_attendees` ADD KEY `mec_booking_id` (`mec_booking_id`);"); + $this->db->q("ALTER TABLE `#__mec_booking_attendees` MODIFY `id` int UNSIGNED NOT NULL AUTO_INCREMENT;"); + $this->db->q("ALTER TABLE `#__mec_booking_attendees` ADD CONSTRAINT `mec_booking_id` FOREIGN KEY (`mec_booking_id`) REFERENCES `#__mec_bookings`(`id`) ON DELETE CASCADE ON UPDATE CASCADE;"); + } + + public function version720() + { + // Get current MEC options + $current = get_option('mec_options', array()); + if(is_string($current) and trim($current) == '') $current = []; + + // Merge new options with previous options + $current['notifications']['certificate_send'] = array + ( + 'status'=>'1', + 'subject'=>'Event Attendee Certificates', + 'recipients'=>'', + 'content'=>"Hi %%name%%, + + Congratulations for successfully attending / completing the event %%event_title%%. + Click the following link to download or print your PDF certificate. + + %%certificate_link%% + + Regards, + %%blog_name%%" + ); + + // Update it only if options already exists. + if(get_option('mec_options') !== false) + { + // Save new options + update_option('mec_options', $current); + } + } + + public function version740() + { + $settings = $this->main->get_settings(); + + // Speaker Status + if(isset($settings['speakers_status']) && $settings['speakers_status']) + { + $speakers = get_terms('mec_speaker', [ + 'orderby' => 'name', + 'order' => 'ASC', + 'hide_empty' => '0', + ]); + + $i = 1; + foreach($speakers as $speaker) + { + update_term_meta($speaker->term_id, 'mec_index', $i); + } + } + } + + public function version7110() + { + // Get current MEC options + $current = get_option('mec_options', array()); + if(is_string($current) && trim($current) == '') $current = []; + + // Booking Moved Notification + $current['notifications']['booking_moved'] = array + ( + 'status'=>'0', + 'subject'=>'Your booking has been rescheduled', + 'recipients'=>'', + 'content'=>"Hi %%name%%, + + We are writing to inform you that your booking for %%event_title%%, %%book_datetime_prev%% has been moved to a new date. Please find the updated booking details below: + + New Booking Details: + + Event/Service Name: %%event_title%% + New Date: %%book_date%% + New Time: %%book_time%% + + We apologize for any inconvenience this may cause and appreciate your understanding. If the new date and time do not work for you, you can cancel the booking using following link: + + %%cancellation_link%% + + Regards, + %%blog_name%%" + ); + + // Suggest Event Notification + $current['notifications']['suggest_event'] = array + ( + 'subject'=>"Discover more events you'll love!", + 'recipients'=>'', + 'content'=>"Hi %%name%%, + + We thought you'd be interested in the following event coming up that we think you'll love. + + %%event_title%% + %%event_description%% + + You can find more details and book your tickets on our website: %%event_link%% + + Regards, + %%blog_name%%" + ); + + // Update it only if options already exists. + if(get_option('mec_options') !== false) + { + // Save new options + update_option('mec_options', $current); + } + } + + public function version7130() + { + // Get current MEC options + $current = get_option('mec_options', array()); + if(is_string($current) && trim($current) == '') $current = []; + + $settings = $current['settings'] ?? []; + + $trash_interval = isset($settings['events_trash_interval']) ? (int) $settings['events_trash_interval'] : 0; + $purge_interval = isset($settings['events_purge_interval']) ? (int) $settings['events_purge_interval'] : 0; + + if($trash_interval && $trash_interval <= 36) $trash_interval = $trash_interval * 30; + if($purge_interval && $purge_interval <= 36) $purge_interval = $purge_interval * 30; + + $current['settings']['events_trash_interval'] = $trash_interval; + $current['settings']['events_purge_interval'] = $purge_interval; + + // Update it only if options already exists. + if(get_option('mec_options') !== false) + { + // Save new options + update_option('mec_options', $current); + } + } +} diff --git a/app/features/userevents.php b/app/features/userevents.php new file mode 100755 index 0000000..6587aa5 --- /dev/null +++ b/app/features/userevents.php @@ -0,0 +1,84 @@ + + */ +class MEC_feature_userevents extends MEC_base +{ + /** + * @var MEC_factory + */ + public $factory; + + /** + * @var MEC_main + */ + public $main; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Factory + $this->factory = $this->getFactory(); + + // Import MEC Main + $this->main = $this->getMain(); + } + + /** + * Initialize User Events Feature + * @author Webnus + */ + public function init() + { + // User Events Shortcode + $this->factory->shortcode('MEC_userevents', [$this, 'output']); + } + + /** + * Show user events + * @param array $atts + * @return string + */ + public function output($atts = array()) + { + // Show login/register message if user is not logged in and guest submission is not enabled. + if(!is_user_logged_in()) + { + // Show message + $message = sprintf(esc_html__('Please %s/%s in order to see your own events.', 'modern-events-calendar-lite'), ''.esc_html__('Login', 'modern-events-calendar-lite').'', ''.esc_html__('Register', 'modern-events-calendar-lite').''); + + return '
        +

        '.MEC_kses::element($message).'

        +
        '; + } + + // Render Library + $render = $this->getRender(); + + // Settings + $settings = $this->main->get_settings(); + + $shortcode_id = isset($settings['userevents_shortcode']) && trim($settings['userevents_shortcode']) ? $settings['userevents_shortcode'] : NULL; + + $atts = apply_filters('mec_calendar_atts', $render->parse($shortcode_id, [ + 'author' => get_current_user_id() + ])); + + $skin = $atts['skin'] ?? 'monthly_view'; + if(!in_array($skin, ['monthly_view', 'daily_view', 'weekly_view', 'list', 'grid', 'agenda'])) + { + return '
        +

        '.esc_html__('Invalid Skin!', 'modern-events-calendar-lite').'

        +
        '; + } + + return $render->skin($skin, $atts); + } +} \ No newline at end of file diff --git a/app/features/wc.php b/app/features/wc.php new file mode 100755 index 0000000..4aea533 --- /dev/null +++ b/app/features/wc.php @@ -0,0 +1,302 @@ + + */ +class MEC_feature_wc extends MEC_base +{ + /** + * @var MEC_factory + */ + public $factory; + + /** + * @var MEC_main + */ + public $main; + + /** + * @var array + */ + public $settings; + + /** + * @var array + */ + public $ml_settings; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Factory + $this->factory = $this->getFactory(); + + // Import MEC Main + $this->main = $this->getMain(); + + // General Options + $this->settings = $this->main->get_settings(); + + // MEC Multilingual Settings + $this->ml_settings = $this->main->get_ml_settings(); + } + + /** + * Initialize + * @author Webnus + */ + public function init() + { + // Pro version is required + if(!$this->getPRO()) return; + + // WC Hooks + if(isset($this->settings['wc_status']) and $this->settings['wc_status']) $this->factory->action('init', array($this, 'hooks')); + } + + public function hooks() + { + // WooCommerce is not installed + if(!class_exists('WooCommerce')) return; + + // WC library + $wc = $this->getWC(); + + // WooCommerce + $this->factory->action('woocommerce_order_status_completed', array($wc, 'completed')); + $this->factory->action('woocommerce_thankyou', array($wc, 'paid')); + $this->factory->action('woocommerce_new_order_item', array($wc, 'meta'), 10, 2); + $this->factory->action('woocommerce_order_status_cancelled', array($wc, 'cancelled')); + $this->factory->action('woocommerce_order_status_refunded', array($wc, 'cancelled')); + $this->factory->action('woocommerce_after_checkout_validation', array($this, 'validate'),10,2); + $this->factory->action('wp', [$this, 'single_product_page']); + + $this->factory->filter('woocommerce_order_item_display_meta_key', array($this, 'display_key'), 10, 2); + $this->factory->filter('woocommerce_order_item_display_meta_value', array($this, 'display_value'), 10, 2); + $this->factory->filter('woocommerce_cart_item_name', array($this, 'display_name'), 10, 2); + $this->factory->filter('woocommerce_cart_item_thumbnail', array($this, 'display_thumbnail'), 10, 2); + $this->factory->filter('woocommerce_quantity_input_args', array($this, 'adjust_quantity'), 10, 2); + } + + public function display_key($display_key, $meta) + { + if($meta->key == 'mec_event_id') $display_key = esc_html__('Event', 'modern-events-calendar-lite'); + elseif($meta->key == 'mec_date') $display_key = esc_html__('Date', 'modern-events-calendar-lite'); + elseif($meta->key == 'mec_other_dates') $display_key = esc_html__('Other Dates', 'modern-events-calendar-lite'); + elseif($meta->key == 'mec_transaction_id') $display_key = esc_html__('Transaction ID', 'modern-events-calendar-lite'); + + return $display_key; + } + + public function display_value($display_value, $meta) + { + if($meta->key == 'mec_event_id') $display_value = ''.get_the_title($meta->value).''; + elseif($meta->key == 'mec_transaction_id') $display_value = $meta->value; + elseif($meta->key == 'mec_date') + { + $date_format = (isset($this->ml_settings['booking_date_format1']) and trim($this->ml_settings['booking_date_format1'])) ? $this->ml_settings['booking_date_format1'] : 'Y-m-d'; + $time_format = get_option('time_format'); + + if(strpos($date_format, 'h') !== false or strpos($date_format, 'H') !== false or strpos($date_format, 'g') !== false or strpos($date_format, 'G') !== false) $datetime_format = $date_format; + else $datetime_format = $date_format.' '.$time_format; + + $dates = explode(':', $meta->value); + + $start_datetime = date_i18n($datetime_format, $dates[0]); + $end_datetime = date_i18n($datetime_format, $dates[1]); + + $display_value = sprintf(esc_html__('%s to %s', 'modern-events-calendar-lite'), $start_datetime, $end_datetime); + } + elseif($meta->key == 'mec_other_dates') + { + $date_format = (isset($this->ml_settings['booking_date_format1']) and trim($this->ml_settings['booking_date_format1'])) ? $this->ml_settings['booking_date_format1'] : 'Y-m-d'; + $time_format = get_option('time_format'); + + if(strpos($date_format, 'h') !== false or strpos($date_format, 'H') !== false or strpos($date_format, 'g') !== false or strpos($date_format, 'G') !== false) $datetime_format = $date_format; + else $datetime_format = $date_format.' '.$time_format; + + $dates = (is_array($meta->value) ? $meta->value : explode(',', $meta->value)); + + $date_values = []; + foreach($dates as $date) + { + if(!trim($date)) continue; + + $timestamps = explode(':', $date); + if(!isset($timestamps[0]) or !isset($timestamps[1])) continue; + + $start_datetime = date_i18n($datetime_format, $timestamps[0]); + $end_datetime = date_i18n($datetime_format, $timestamps[1]); + + $date_values[] = sprintf(esc_html__('%s to %s', 'modern-events-calendar-lite'), $start_datetime, $end_datetime); + } + + $display_value = implode('
        ', $date_values); + } + + return $display_value; + } + + public function display_name($name, $item) + { + if(!isset($item['mec_event_id']) or !trim($item['mec_event_id'])) return $name; + if(!isset($item['mec_date']) or !trim($item['mec_date'])) return $name; + + $date_format = (isset($this->ml_settings['booking_date_format1']) and trim($this->ml_settings['booking_date_format1'])) ? $this->ml_settings['booking_date_format1'] : get_option('date_format'); + $other_dates = (isset($item['mec_other_dates']) and is_array($item['mec_other_dates'])) ? $item['mec_other_dates'] : []; + + $dates = array_merge(array($item['mec_date']), $other_dates); + + $formatted_dates = []; + foreach($dates as $d) + { + $timestamps = explode(':', $d); + $formatted_dates[] = date_i18n($date_format, $timestamps[0]); + } + + $name .= ' ('.implode(', ', $formatted_dates).')'; + return $name; + } + + public function display_thumbnail($image, $item) + { + if(!isset($item['mec_event_id']) or !trim($item['mec_event_id'])) return $image; + if(!isset($item['product_id']) or !trim($item['product_id'])) return $image; + + $product_id = $item['product_id']; + if(has_post_thumbnail($product_id)) return $image; + + $event_id = $item['mec_event_id']; + if(has_post_thumbnail($event_id)) return get_the_post_thumbnail($event_id); + + return $image; + } + + public function validate($data, $errors) + { + // Cart Items + $items = WC()->cart->get_cart(); + + // Book + $book = $this->getBook(); + + $printed = false; + $all_items = []; + foreach($items as $item) + { + $event_id = $item['mec_event_id'] ?? NULL; + if(!$event_id) continue; + + $product_id = $item['product_id'] ?? NULL; + $mec_ticket = get_post_meta($product_id, 'mec_ticket', true); + + $ex = explode(':', $mec_ticket); + $ticket_id = $ex[1] ?? NULL; + if(!$ticket_id) continue; + + $date = $item['mec_date'] ?? NULL; + $timestamps = explode(':', $date); + $timestamp = $timestamps[0]; + + $other_dates = (isset($item['mec_other_dates']) and is_array($item['mec_other_dates'])) ? $item['mec_other_dates'] : []; + $all_dates = array_merge([$date], $other_dates); + + $quantity = $item['quantity'] ?? 1; + if(count($all_dates) > 1 && $quantity % count($all_dates) === 0) $quantity = $quantity / count($all_dates); + + if(!isset($all_items[$event_id])) $all_items[$event_id] = []; + if(!isset($all_items[$event_id][$ticket_id])) $all_items[$event_id][$ticket_id] = []; + + if(!isset($all_items[$event_id][$ticket_id][$timestamp])) $all_items[$event_id][$ticket_id][$timestamp] = $quantity; + else $all_items[$event_id][$ticket_id][$timestamp] += $quantity; + + $availability = $book->get_tickets_availability($event_id, $timestamp); + $tickets = get_post_meta($event_id, 'mec_tickets', true); + + // Ticket is not available + if(!isset($availability[$ticket_id]) or ($availability[$ticket_id] != -1 and $availability[$ticket_id] < $quantity)) + { + $printed = true; + if($availability[$ticket_id] == '0') $errors->add('validation', sprintf(esc_html__('%s ticket is sold out!', 'modern-events-calendar-lite'), $tickets[$ticket_id]['name'])); + else $errors->add('validation', sprintf(esc_html__('Only %s slots remained for %s ticket so you cannot book %s ones.', 'modern-events-calendar-lite'), $availability[$ticket_id], $tickets[$ticket_id]['name'], $quantity)); + } + } + + // Error already printed + if($printed) return; + + foreach($all_items as $event_id => $tickets) + { + // User Booking Limits + list($limit, $unlimited) = $book->get_user_booking_limit($event_id); + + $total_quantity = 0; + foreach($tickets as $ticket_id => $timestamps) + { + foreach($timestamps as $timestamp => $quantity) + { + $availability = $book->get_tickets_availability($event_id, $timestamp); + $tickets = get_post_meta($event_id, 'mec_tickets', true); + + $total_quantity += $quantity; + + // Ticket is not available + if(!isset($availability[$ticket_id]) or ($availability[$ticket_id] != -1 and $availability[$ticket_id] < $quantity)) + { + if($availability[$ticket_id] == '0') $errors->add('validation', sprintf(esc_html__('%s ticket is sold out!', 'modern-events-calendar-lite'), $tickets[$ticket_id]['name'])); + else $errors->add('validation', sprintf(esc_html__('Only %s slots remained for %s ticket so you cannot book %s ones.', 'modern-events-calendar-lite'), $availability[$ticket_id], $tickets[$ticket_id]['name'], $quantity)); + } + } + } + + // Take Care of User Limit + if(!$unlimited and $total_quantity > $limit) + { + $errors->add('validation', sprintf($this->main->m('booking_restriction_message3', esc_html__("Maximum allowed number of tickets that you can book is %s.", 'modern-events-calendar-lite')), $limit)); + } + } + } + + /** + * @param $args + * @param WC_Product $product + * @return mixed + */ + public function adjust_quantity($args, $product) + { + $mec_product = get_post_meta($product->get_id(), 'mec_ticket', true); + + // Make the quantity input as read-only so nobody can change its value + if($mec_product and isset($args['input_value']) and is_numeric($args['input_value'])) + { + $args['min_value'] = $args['input_value']; + $args['max_value'] = $args['input_value']; + } + + return $args; + } + + public function single_product_page() + { + // WooCommerce Product + if(is_product()) + { + global $post; + + // MEC Product + $is_mec = get_post_meta($post->ID, 'mec_ticket', true); + if($is_mec) + { + global $wp_query; + $wp_query->set_404(); + status_header(404); + } + } + } +} diff --git a/app/features/webhooks.php b/app/features/webhooks.php new file mode 100755 index 0000000..816e659 --- /dev/null +++ b/app/features/webhooks.php @@ -0,0 +1,361 @@ + + */ +class MEC_feature_webhooks extends MEC_base +{ + public $factory; + public $main; + public $PT; + public $settings; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Factory + $this->factory = $this->getFactory(); + + // Import MEC Main + $this->main = $this->getMain(); + + // MEC Webhook Post Type Name + $this->PT = $this->main->get_webhook_post_type(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + } + + /** + * Initialize Webhooks feature + * @author Webnus + */ + public function init() + { + // PRO Version is required + if(!$this->getPRO()) return false; + + // Show Webhook feature only if module is enabled + if(!isset($this->settings['webhooks_status']) or (isset($this->settings['webhooks_status']) and !$this->settings['webhooks_status'])) return false; + + $this->factory->action('init', [$this, 'register_post_type']); + $this->factory->action('save_post', [$this, 'save_webhook'], 10); + $this->factory->action('add_meta_boxes', [$this, 'register_meta_boxes'], 1); + + // Webhooks + foreach([ + 'mec_booking_confirmed', + 'mec_booking_verified', + 'mec_booking_added', + 'mec_booking_rejected', + 'mec_booking_canceled', + 'mec_booking_refunded', + ] as $hook) $this->factory->action($hook, function($booking_id) use ($hook) { + return $this->webhook_booking($booking_id, $hook); + }, 999); + + return true; + } + + /** + * Registers email post type + * @author Webnus + */ + public function register_post_type() + { + $singular_label = esc_html__('Webhook', 'modern-events-calendar-lite'); + $plural_label = esc_html__('Webhooks', 'modern-events-calendar-lite'); + + $capability = 'manage_options'; + register_post_type($this->PT, + [ + 'labels'=>[ + 'name'=>$plural_label, + 'singular_name'=>$singular_label, + 'add_new'=>sprintf(esc_html__('Add %s', 'modern-events-calendar-lite'), $singular_label), + 'add_new_item'=>sprintf(esc_html__('Add %s', 'modern-events-calendar-lite'), $singular_label), + 'not_found'=>sprintf(esc_html__('No %s found!', 'modern-events-calendar-lite'), strtolower($plural_label)), + 'all_items'=>$plural_label, + 'edit_item'=>sprintf(esc_html__('Edit %s', 'modern-events-calendar-lite'), $plural_label), + 'not_found_in_trash'=>sprintf(esc_html__('No %s found in Trash!', 'modern-events-calendar-lite'), strtolower($singular_label)) + ], + 'public'=>false, + 'show_ui'=>(current_user_can($capability) ? true : false), + 'show_in_menu'=>false, + 'show_in_admin_bar'=>false, + 'show_in_nav_menus'=>false, + 'has_archive'=>false, + 'exclude_from_search'=>true, + 'publicly_queryable'=>false, + 'supports'=>['title'], + 'capabilities'=> [ + 'read'=>$capability, + 'read_post'=>$capability, + 'read_private_posts'=>$capability, + 'create_post'=>$capability, + 'create_posts'=>$capability, + 'edit_post'=>$capability, + 'edit_posts'=>$capability, + 'edit_private_posts'=>$capability, + 'edit_published_posts'=>$capability, + 'edit_others_posts'=>$capability, + 'publish_posts'=>$capability, + 'delete_post'=>$capability, + 'delete_posts'=>$capability, + 'delete_private_posts'=>$capability, + 'delete_published_posts'=>$capability, + 'delete_others_posts'=>$capability, + ], + ] + ); + } + + /** + * Registers meta boxes + * @author Webnus + */ + public function register_meta_boxes() + { + add_meta_box('mec_webhook_metabox_details', esc_html__('Details', 'modern-events-calendar-lite'), [$this, 'meta_box_details'], $this->PT, 'normal', 'high'); + } + + public function meta_box_details($post) + { + $path = MEC::import('app.features.webhooks.details', true, true); + + ob_start(); + include $path; + echo MEC_kses::full(ob_get_clean()); + } + + /** + * Save webhook data from backend + * @author Webnus + * @param int $post_id + * @return void + */ + public function save_webhook($post_id) + { + // Check if our nonce is set. + if(!isset($_POST['mec_webhook_nonce'])) return; + + // Verify that the nonce is valid. + if(!wp_verify_nonce(sanitize_text_field($_POST['mec_webhook_nonce']), 'mec_webhook_data')) return; + + // If this is an autosave, our form has not been submitted, so we don't want to do anything. + if(defined('DOING_AUTOSAVE') and DOING_AUTOSAVE) return; + + // MEC Data + $mec = (isset($_POST['mec']) and is_array($_POST['mec'])) ? $this->main->sanitize_deep_array($_POST['mec']) : []; + + // All Options + update_post_meta($post_id, 'mec', $mec); + + update_post_meta($post_id, 'mec_hook', isset($mec['hook']) ? sanitize_text_field($mec['hook']) : ''); + update_post_meta($post_id, 'mec_url', isset($mec['url']) ? sanitize_url($mec['url']) : ''); + update_post_meta($post_id, 'mec_method', isset($mec['method']) ? strtoupper(sanitize_text_field($mec['method'])) : 'POST'); + } + + public function webhook_booking($booking_id, $hook) + { + // Get Webhooks to Call + $webhooks = $this->get($hook); + + // No Webhooks + if(!is_array($webhooks) or (is_array($webhooks) and !count($webhooks))) return; + + // Booking Data + $data = $this->booking_data($booking_id); + + // Call Webhooks + foreach($webhooks as $webhook) + { + $method = strtoupper(get_post_meta($webhook->ID, 'mec_method', true)); + $url = get_post_meta($webhook->ID, 'mec_url', true); + + // Prepare Headers + $headers = apply_filters('mec_webhooks_headers', [], $webhook, $url); + + if($method === 'GET') + { + wp_remote_get($url, apply_filters('mec_webhooks_args', [ + 'headers' => $headers, + 'body' => $data + ])); + } + else + { + wp_remote_post($url, apply_filters('mec_webhooks_args', [ + 'headers' => $headers, + 'body' => $data + ])); + } + } + } + + public function get($hook) + { + return get_posts([ + 'post_type' => $this->PT, + 'status' => 'publish', + 'numberposts' => -1, + 'meta_key' => 'mec_hook', + 'meta_value' => $hook, + ]); + } + + public function booking_data($booking_id) + { + // MEC User + $u = $this->getUser(); + + // MEC Booking + $b = $this->getBook(); + + $event_id = get_post_meta($booking_id, 'mec_event_id', true); + $transaction_id = get_post_meta($booking_id, 'mec_transaction_id', true); + $order_time = get_post_meta($booking_id, 'mec_booking_time', true); + $tickets = get_post_meta($event_id, 'mec_tickets', true); + $timestamps = explode(':', get_post_meta($booking_id, 'mec_date', true)); + + $attendees = get_post_meta($booking_id, 'mec_attendees', true); + + $booker = $u->booking($booking_id); + + $confirmed = $this->main->get_confirmation_label(get_post_meta($booking_id, 'mec_confirmed', true)); + $verified = $this->main->get_verification_label(get_post_meta($booking_id, 'mec_verified', true)); + $transaction = $b->get_transaction($transaction_id); + + // Date & Time Format + $datetime_format = get_option('date_format').' '.get_option('time_format'); + + $other_dates_formatted = []; + + $other_dates = (isset($transaction['other_dates']) and is_array($transaction['other_dates'])) ? $transaction['other_dates'] : []; + foreach($other_dates as $other_date) + { + $other_timestamps = explode(':', $other_date); + $other_dates_formatted[] = [ + date($datetime_format, $other_timestamps[0]), + date($datetime_format, $other_timestamps[1]) + ]; + } + + $reg_fields = $this->main->get_reg_fields($event_id); + $bfixed_fields = $this->main->get_bfixed_fields($event_id); + + $bfixed_data = []; + $bfixed_values = (isset($transaction['fields']) and is_array($transaction['fields'])) ? $transaction['fields'] : []; + foreach($bfixed_fields as $bfixed_field_id => $bfixed_field) + { + if(!is_numeric($bfixed_field_id)) continue; + + $bfixed_label = isset($bfixed_field['label']) ? $bfixed_field['label'] : ''; + if(trim($bfixed_label) == '') continue; + + $bfixed_data[] = [ + 'label' => $bfixed_label, + 'value' => isset($bfixed_values[$bfixed_field_id]) ? ((is_string($bfixed_values[$bfixed_field_id]) and trim($bfixed_values[$bfixed_field_id])) ? stripslashes($bfixed_values[$bfixed_field_id]) : (is_array($bfixed_values[$bfixed_field_id]) ? implode(' | ', $bfixed_values[$bfixed_field_id]) : '---')) : '' + ]; + } + + $attendees_data = []; + foreach($attendees as $key => $attendee) + { + if($key === 'attachments') continue; + if(isset($attendee[0]['MEC_TYPE_OF_DATA'])) continue; + + $variations = []; + if(isset($attendee['variations']) and is_array($attendee['variations']) and count($attendee['variations'])) + { + $ticket_variations = $this->main->ticket_variations($event_id, $attendee['id']); + foreach($attendee['variations'] as $a_variation_id => $a_variation_count) + { + if((int) $a_variation_count > 0) + { + $variations[] = [ + 'id' => $a_variation_id, + 'title' => isset($ticket_variations[$a_variation_id]) ? $ticket_variations[$a_variation_id]['title'] : 'N/A', + 'count' => $a_variation_count, + ]; + } + } + } + + $raw_price = $b->get_ticket_total_price($transaction, $attendee, $booking_id); + $rendered_price = $this->main->render_price($raw_price, $event_id); + + $ticket_id = isset($attendee['id']) ? $attendee['id'] : get_post_meta($booking_id, 'mec_ticket_id', true); + + $reg_data = []; + $reg_form = isset($attendee['reg']) ? $attendee['reg'] : []; + foreach($reg_fields as $field_id=>$reg_field) + { + // Placeholder Keys + if(!is_numeric($field_id)) continue; + + $type = isset($reg_field['type']) ? $reg_field['type'] : ''; + $label = isset($reg_field['label']) ? esc_html__($reg_field['label'], 'modern-events-calendar-lite') : ''; + + if(trim($label) == '' or $type == 'name' or $type == 'mec_email') continue; + + $reg_data[] = [ + 'label' => $label, + 'value' => isset($reg_form[$field_id]) ? ((is_string($reg_form[$field_id]) and trim($reg_form[$field_id])) ? stripslashes($reg_form[$field_id]) : (is_array($reg_form[$field_id]) ? implode(' | ', $reg_form[$field_id]) : '---')) : '', + ]; + } + + $attendees_data[] = [ + 'name' => isset($attendee['name']) ? $attendee['name'] : (isset($booker->first_name) ? trim($booker->first_name.' '.$booker->last_name) : ''), + 'email' => isset($attendee['email']) ? $attendee['email'] : @$booker->user_email, + 'ticket' => [ + 'id' => $ticket_id, + 'name' => isset($tickets[$ticket_id], $tickets[$ticket_id]['name']) ? $tickets[$ticket_id]['name'] : esc_html__('Unknown', 'modern-events-calendar-lite') + ], + 'price' => $raw_price, + 'price_rendered' => $rendered_price, + 'fields' => $reg_data, + 'variations' => $variations + ]; + } + + return [ + 'id' => $booking_id, + 'event' => [ + 'id' => $event_id, + 'title' => get_the_title($event_id), + ], + 'start' => date($datetime_format, $timestamps[0]), + 'end' => date($datetime_format, $timestamps[1]), + 'other_dates' => $other_dates_formatted, + 'order_time' => date($datetime_format, strtotime($order_time)), + 'attendees' => $attendees_data, + 'transaction_id' => $transaction_id, + 'gateway' => [ + 'key' => get_post_meta($booking_id, 'mec_gateway', true), + 'label' => get_post_meta($booking_id, 'mec_gateway_label', true), + 'ref_id' => get_post_meta($booking_id, 'mec_gateway_ref_id', true) + ], + 'confirmation' => [ + 'key' => get_post_meta($booking_id, 'mec_confirmed', true), + 'label' => $confirmed + ], + 'verification' => [ + 'key' => get_post_meta($booking_id, 'mec_verified', true), + 'label' => $verified + ], + 'fields' => $bfixed_data, + 'price' => [ + 'price' => get_post_meta($booking_id, 'mec_price', true), + 'payable' => get_post_meta($booking_id, 'mec_payable', true), + 'coupon' => get_post_meta($booking_id, 'mec_coupon_code', true), + ], + ]; + } +} \ No newline at end of file diff --git a/app/features/webhooks/details.php b/app/features/webhooks/details.php new file mode 100755 index 0000000..48115f4 --- /dev/null +++ b/app/features/webhooks/details.php @@ -0,0 +1,39 @@ +ID, 'mec_hook', true); +$method = get_post_meta($post->ID, 'mec_method', true); +$url = get_post_meta($post->ID, 'mec_url', true); +?> +
        +
        +

        + +
        + +
        +

        + + + +

        +
        + + +
        \ No newline at end of file diff --git a/app/index.html b/app/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/libraries/base.php b/app/libraries/base.php new file mode 100755 index 0000000..92a657d --- /dev/null +++ b/app/libraries/base.php @@ -0,0 +1,326 @@ + + * @abstract + */ +abstract class MEC_base extends MEC +{ + /** + * Returns MEC_db instance + * @final + * @author Webnus + * @return MEC_db instance + */ + final public function getDB() + { + return MEC::getInstance('app.libraries.db'); + } + + /** + * Returns MEC_file instance + * @final + * @author Webnus + * @return MEC_file instance + */ + final public function getFile() + { + return MEC::getInstance('app.libraries.filesystem', 'MEC_file'); + } + + /** + * Returns MEC_folder instance + * @final + * @author Webnus + * @return MEC_folder instance + */ + final public function getFolder() + { + return MEC::getInstance('app.libraries.filesystem', 'MEC_folder'); + } + + /** + * Returns MEC_path instance + * @final + * @author Webnus + * @return MEC_path instance + */ + final public function getPath() + { + return MEC::getInstance('app.libraries.filesystem', 'MEC_path'); + } + + /** + * Returns MEC_main instance + * @final + * @author Webnus + * @return MEC_main instance + */ + final public function getMain() + { + return MEC::getInstance('app.libraries.main'); + } + + /** + * Returns MEC_factory instance + * @final + * @author Webnus + * @return MEC_factory instance + */ + final public function getFactory() + { + return MEC::getInstance('app.libraries.factory'); + } + + /** + * Returns MEC_render instance + * @final + * @author Webnus + * @return MEC_render instance + */ + final public function getRender() + { + return MEC::getInstance('app.libraries.render'); + } + + /** + * Returns MEC_parser instance + * @final + * @author Webnus + * @return MEC_parser instance + */ + final public function getParser() + { + return MEC::getInstance('app.libraries.parser'); + } + + /** + * Returns MEC_feed instance + * @final + * @author Webnus + * @return MEC_feed instance + */ + final public function getFeed() + { + return MEC::getInstance('app.libraries.feed'); + } + + /** + * Returns MEC_book instance + * @final + * @author Webnus + * @return MEC_book instance + */ + final public function getBook() + { + return MEC::getInstance('app.libraries.book'); + } + + /** + * Returns MEC_notifications instance + * @final + * @author Webnus + * @return MEC_notifications instance + */ + final public function getNotifications() + { + return MEC::getInstance('app.libraries.notifications'); + } + + /** + * Returns QRCode instance + * @final + * @author Webnus + * @return QRcode instance + */ + final public function getQRcode() + { + self::import('app.libraries.qrcode'); + return new QRcode(); + } + + /** + * Returns PRO instance + * @final + * @author Webnus + * @return MEC_pro instance + */ + final public function getPRO() + { + return MEC::getInstance('app.libraries.pro'); + } + + /** + * Returns PRO instance + * @final + * @author Webnus + * @return MEC_schedule instance + */ + final public function getSchedule() + { + return MEC::getInstance('app.libraries.schedule'); + } + + /** + * Returns PRO instance + * @final + * @author Webnus + * @return MEC_syncSchedule instance + */ + final public function getSyncSchedule() + { + return MEC::getInstance('app.libraries.syncSchedule'); + } + + /** + * Returns Cache instance + * @final + * @author Webnus + * @return MEC_cache instance + */ + final public function getCache() + { + MEC::import('app.libraries.cache'); + return MEC_cache::getInstance(); + } + + /** + * Returns WC instance + * @final + * @author Webnus + * @return MEC_wc instance + */ + final public function getWC() + { + return MEC::getInstance('app.libraries.wc'); + } + + /** + * Returns User instance + * @final + * @author Webnus + * @return MEC_user instance + */ + final public function getUser() + { + return MEC::getInstance('app.libraries.user'); + } + + /** + * Returns Form Builder instance + * @final + * @author Webnus + * @return MEC_formBuilder instance + */ + final public function getFormBuilder() + { + return MEC::getInstance('app.libraries.formBuilder'); + } + + /** + * Returns Event Fields instance + * @final + * @author Webnus + * @return MEC_eventFields instance + */ + final public function getEventFields() + { + return MEC::getInstance('app.libraries.eventFields'); + } + + /** + * Returns Search instance + * @final + * @author Webnus + * @return MEC_search instance + */ + final public function getSearch() + { + return MEC::getInstance('app.libraries.search'); + } + + /** + * Returns Ticket Variations instance + * @final + * @author Webnus + * @return MEC_ticketVariations instance + */ + final public function getTicketVariations() + { + return MEC::getInstance('app.libraries.ticketVariations'); + } + + /** + * Returns Booking Record instance + * @final + * @author Webnus + * @return MEC_bookingRecord instance + */ + final public function getBookingRecord() + { + return MEC::getInstance('app.libraries.bookingRecord'); + } + + /** + * Returns MEC Cart instance + * @final + * @author Webnus + * @return MEC_cart instance + */ + final public function getCart() + { + return MEC::getInstance('app.libraries.cart'); + } + + /** + * Returns Partial Payment instance + * @final + * @author Webnus + * @return MEC_partial instance + */ + final public function getPartialPayment() + { + return MEC::getInstance('app.libraries.partial'); + } + + /** + * Returns Captcha instance + * @final + * @author Webnus + * @return MEC_captcha instance + */ + final public function getCaptcha() + { + return MEC::getInstance('app.libraries.captcha'); + } + + /** + * Returns Tickets instance + * @final + * @author Webnus + * @return MEC_tickets instance + */ + final public function getTickets() + { + return MEC::getInstance('app.libraries.tickets'); + } + + /** + * @return MEC_meetup + */ + final public function getMeetup() + { + return MEC::getInstance('app.libraries.meetup'); + } + + /** + * @return MEC_restful + */ + final public function getRestful() + { + return MEC::getInstance('app.libraries.restful'); + } +} diff --git a/app/libraries/book.php b/app/libraries/book.php new file mode 100755 index 0000000..4567298 --- /dev/null +++ b/app/libraries/book.php @@ -0,0 +1,1946 @@ + + */ +class MEC_book extends MEC_base +{ + /** + * @var array + */ + public $settings; + + /** + * @var MEC_main + */ + public $main; + + /** + * Post Type Slug + * @var string + */ + public $PT; + + /** + * @var MEC_partial + */ + public $partial_payment; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Main + $this->main = $this->getMain(); + + // MEC Book Post Type Name + $this->PT = $this->main->get_book_post_type(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + + // MEC Partial Payment + $this->partial_payment = $this->getPartialPayment(); + } + + /** + * Get invoice (Ticket price + Fees) based on tickets + * @param array $tickets + * @param int $event_id + * @param array $event_tickets + * @param array $variations + * @param array $timestamps + * @param boolean $apply_fees + * @return array + * @author Webnus + */ + public function get_price_details($tickets, $event_id, $event_tickets, $variations = [], $timestamps = [], $apply_fees = true) + { + $total_tickets_amount = 0; + $total_tickets_count = 0; + $total_variations_amount = 0; + $total_fee_amount = 0; + + $variation_details = []; + $fee_details = []; + + $details = []; + foreach ($timestamps as $timestamp) + { + $date_tickets_amount = 0; + $date_tickets_count = 0; + $date_variations_amount = 0; + $date_fee_amount = 0; + + $timestamp_ex = explode(':', $timestamp); + $timestamp = $timestamp_ex[0]; + + foreach ($tickets as $ticket_id => $count) + { + if (!$count) continue; + if (!isset($event_tickets[$ticket_id])) continue; + + $date_tickets_count += $count; + + $t_price = isset($event_tickets[$ticket_id]['price']) ? $this->get_ticket_price($event_tickets[$ticket_id], current_time('Y-m-d'), $event_id, $timestamp) : 0; + if (!is_numeric($t_price)) $t_price = 0; + + $date_tickets_amount = $date_tickets_amount + ($t_price * $count); + + // Variations module is enabled and some variations bought + if (isset($this->settings['ticket_variations_status']) and $this->settings['ticket_variations_status'] and is_array($variations) and count($variations)) + { + $ticket_variations = $this->main->ticket_variations($event_id, $ticket_id); + + foreach ($ticket_variations as $key => $ticket_variation) + { + if (!is_numeric($key)) continue; + if (!isset($ticket_variation['title']) or !trim($ticket_variation['title'])) continue; + + $booked_variations = isset($variations[$ticket_id]) && is_array($variations[$ticket_id]) ? $variations[$ticket_id] : []; + + $variation_count = $booked_variations[$key] ?? 0; + if (!$variation_count or $variation_count < 0) continue; + + $v_price = (isset($ticket_variation['price']) and trim($ticket_variation['price']) != '') ? $ticket_variation['price'] : 0; + + $variation_amount = $v_price * $variation_count; + $variation_title = $ticket_variation['title'] . ' (' . esc_html($variation_count) . ')'; + + // Add To Total + $date_variations_amount += $variation_amount; + + // Price Details + if (!isset($variation_details[$key])) $variation_details[$key] = ['amount' => $variation_amount, 'description' => __($variation_title, 'modern-events-calendar-lite'), 'type' => 'variation', 'count' => $variation_count]; + else + { + $variation_details[$key]['amount'] += $variation_amount; + + $new_count = ((int) $variation_details[$key]['count'] + $variation_count); + $variation_details[$key]['count'] = $new_count; + $variation_details[$key]['description'] = esc_html__($ticket_variation['title'] . ' (' . $new_count . ')', 'modern-events-calendar-lite'); + } + } + } + } + + $total_tickets_amount += $date_tickets_amount; + $total_variations_amount += $date_variations_amount; + $total_tickets_count += $date_tickets_count; + + // Fees module is enabled + if ($apply_fees and isset($this->settings['taxes_fees_status']) and $this->settings['taxes_fees_status']) + { + $fees = $this->get_fees($event_id); + + foreach ($fees as $key => $fee) + { + $fee_amount = 0; + if (!is_numeric($key)) continue; + + if ($fee['type'] == 'amount_per_date') $fee_amount += $fee['amount']; + else continue; + + // Add to Total + $date_fee_amount += $fee_amount; + + // Price Details + if (!isset($fee_details[$key])) $fee_details[$key] = ['amount' => $fee_amount, 'description' => __($fee['title'], 'modern-events-calendar-lite'), 'type' => 'fee', 'fee_type' => $fee['type'], 'fee_amount' => $fee['amount']]; + else $fee_details[$key]['amount'] += $fee_amount; + } + } + + $total_fee_amount += $date_fee_amount; + } + + $tax_inclusion_type = isset($this->settings['tax_inclusion']) && trim($this->settings['tax_inclusion']) ? $this->settings['tax_inclusion'] : 'excluded'; + $total_ticket_percent_fee_amount = 0; + + // Fees module is enabled + if ($apply_fees && isset($this->settings['taxes_fees_status']) && $this->settings['taxes_fees_status']) + { + $fees = $this->get_fees($event_id); + $rest_fee_amount = 0; + + // Fee Per Booking + foreach ($fees as $key => $fee) + { + if (!is_numeric($key)) continue; + + $fee_amount_config = isset($fee['amount']) ? (float) $fee['amount'] : 0; + $fee_amount = 0; + + if ($fee['type'] == 'percent') + { + if ($tax_inclusion_type === 'included') + { + $fee_amount += ($total_tickets_amount + $total_variations_amount) - (($total_tickets_amount + $total_variations_amount) / (1 + ($fee_amount_config / 100))); + + // Add to Ticket Percent Fee + $total_ticket_percent_fee_amount += $total_tickets_amount - ($total_tickets_amount / (1 + ($fee_amount_config / 100))); + + // Variation Details + if (count($variation_details)) + { + $new_variation_details = []; + foreach ($variation_details as $variation_detail) + { + $variation_fee_amount = $variation_detail['amount'] - ($variation_detail['amount'] / (1 + ($fee_amount_config / 100))); + + $variation_detail['amount'] = $variation_detail['amount'] - $variation_fee_amount; + $total_variations_amount = $total_variations_amount - $variation_fee_amount; + + $new_variation_details[] = $variation_detail; + } + + $variation_details = $new_variation_details; + } + } + else $fee_amount += (($total_tickets_amount + $total_variations_amount) * $fee_amount_config) / 100; + } + else if ($fee['type'] == 'amount') $fee_amount += ($total_tickets_count * $fee_amount_config); + else if ($fee['type'] == 'amount_per_booking') $fee_amount += $fee_amount_config; + else continue; + + // Add to Total + $rest_fee_amount += $fee_amount; + + // Price Details + if (!isset($fee_details[$key])) $fee_details[$key] = ['amount' => $fee_amount, 'description' => __($fee['title'], 'modern-events-calendar-lite'), 'type' => 'fee', 'fee_type' => $fee['type'], 'fee_amount' => $fee_amount_config]; + else $fee_details[$key]['amount'] += $fee_amount; + } + + $total_fee_amount += $rest_fee_amount; + } + + if ($tax_inclusion_type === 'included') + { + $total_tickets_amount = $total_tickets_amount - $total_ticket_percent_fee_amount; + } + + // Ticket Details + $details[] = ['amount' => $total_tickets_amount, 'description' => esc_html__('Subtotal', 'modern-events-calendar-lite'), 'type' => 'tickets']; + + // Variation Details + foreach ($variation_details as $variation_detail) $details[] = $variation_detail; + + // Fee Details + foreach ($fee_details as $fee_detail) $details[] = $fee_detail; + + $total = $total_tickets_amount + $total_fee_amount + $total_variations_amount; + $payable = $total; + + // Calculate Payable + if ($this->partial_payment->is_enabled()) $payable = $this->partial_payment->calculate($total, $event_id); + + return [ + 'total' => $total, + 'payable' => $payable, + 'details' => $details, + ]; + } + + /** + * Get fees of a certain event + * @param int $event_id + * @return array + * @author Webnus + */ + public function get_fees($event_id) + { + $fees_global_inheritance = get_post_meta($event_id, 'mec_fees_global_inheritance', true); + if (is_string($fees_global_inheritance) and trim($fees_global_inheritance) == '') $fees_global_inheritance = 1; + + // Event fees + $fees = get_post_meta($event_id, 'mec_fees', true); + + // Get fees from global options + if ($fees_global_inheritance) $fees = $this->settings['fees'] ?? []; + + // Clean + if (isset($fees[':i:'])) unset($fees[':i:']); + + return $fees; + } + + /** + * Save a temporary booking + * @param array $data + * @return int + * @author Webnus + */ + public function temporary($data = []) + { + $transaction = new Transaction(0, $data); + return $transaction->update_data(); + } + + /** + * Generate a transaction id for bookings + * @return string + * @author Webnus + */ + public function get_transaction_id()//TODO: remove + { + return Transaction::generate_transaction_id(); + } + + /** + * Get transaction data + * @param string $transaction_id + * @return array + * @author Webnus + */ + public function get_transaction($transaction_id) + { + return get_option($transaction_id, []); + } + + /** + * @param $transaction_id + * @return MEC_transaction + */ + public function get_TO($transaction_id) + { + MEC::import('app.libraries.transaction'); + return (new MEC_transaction($transaction_id)); + } + + /** + * Update a transaction + * @param string $transaction_id + * @param array $data + * @author Webnus + */ + public function update_transaction($transaction_id, $data) + { + update_option($transaction_id, $data, false); + + if ($transaction_id) + { + $transactionObject = new Transaction($transaction_id); + $transactionObject->reset_cache_tickets_details(); + } + } + + /** + * Add a booking + * @param array $values + * @param string $transaction_id + * @param int $ticket_ids + * @return int|boolean + * @author Webnus + */ + public function add($values, $transaction_id, $ticket_ids) + { + // Check Transaction State + $db = $this->main->getDB(); + $db_transaction_ids = $db->select("SELECT `post_id` FROM `#__postmeta` WHERE `meta_key` = 'mec_transaction_id' AND `meta_value` = '$transaction_id'"); + + foreach ($db_transaction_ids as $db_transaction_id) + { + $book_status = get_post_status($db_transaction_id->post_id); + if (trim($book_status) == 'trash') unset($db_transaction_ids[$db_transaction_id->post_id]); + } + + if (count($db_transaction_ids)) return false; + + // Transaction Data + $transaction = $this->get_transaction($transaction_id); + $event_id = $transaction['event_id']; + + $attention_date = $transaction['date'] ?? ''; + $attention_times = explode(':', $attention_date); + + // Default values + if (!isset($values['post_date'])) $values['post_date'] = date('Y-m-d H:i:s', trim($attention_times[0])); + if (!isset($values['post_status'])) $values['post_status'] = 'publish'; + + $book_id = wp_insert_post($values); + + // Delete Cache + delete_transient('all_sold_tickets_' . $event_id); + + // Update transaction id after insert book for prevent repeat reservation books. + update_post_meta($book_id, 'mec_transaction_id', $transaction_id); + + // Payment Gateway + if (isset($values['mec_gateway']) and isset($values['mec_gateway_label'])) + { + update_post_meta($book_id, 'mec_gateway', $values['mec_gateway']); + update_post_meta($book_id, 'mec_gateway_label', $values['mec_gateway_label']); + } + + $transaction['booking_id'] = $book_id; + $transaction['invoice_key'] = md5(time() . mt_rand(10000, 99999)); + if (isset($values['mec_gateway'])) + { + $transaction['gateway'] = $values['mec_gateway']; + } + + $this->update_transaction($transaction_id, $transaction); + + // Publish it + wp_publish_post($book_id); + + // Assign User + if (isset($values['post_author']) and $values['post_author']) + { + $u = $this->getUser(); + $u->assign($book_id, $values['post_author']); + } + + update_post_meta($book_id, 'mec_verified', 0); + update_post_meta($book_id, 'mec_verification_key', md5(time() . mt_rand(10000, 99999))); + update_post_meta($book_id, 'mec_cancellation_key', md5(time() . mt_rand(10000, 99999))); + + update_post_meta($book_id, 'mec_confirmed', 0); + + update_post_meta($book_id, 'mec_event_id', $event_id); + update_post_meta($book_id, 'mec_date', $transaction['date']); + update_post_meta($book_id, 'mec_ticket_id', $ticket_ids); + update_post_meta($book_id, 'mec_booking_time', current_time('Y-m-d H:i:s')); + update_post_meta($book_id, 'mec_locale', $transaction['locale'] ?? ''); + + // Multiple Dates + if (isset($transaction['all_dates']) and is_array($transaction['all_dates'])) update_post_meta($book_id, 'mec_all_dates', $transaction['all_dates']); + if (isset($transaction['other_dates']) and is_array($transaction['other_dates'])) update_post_meta($book_id, 'mec_other_dates', $transaction['other_dates']); + + update_post_meta($book_id, 'mec_attention_time', $attention_date); + update_post_meta($book_id, 'mec_attention_time_start', $attention_times[0]); + update_post_meta($book_id, 'mec_attention_time_end', $attention_times[1]); + + // For Badge Bubble Notification Alert Count From It. + update_post_meta($book_id, 'mec_book_date_submit', date('YmdHis', current_time('timestamp'))); + + $location_id = $this->main->get_master_location_id($event_id, $attention_times[0]); + if (!empty($location_id)) update_post_meta($book_id, 'mec_booking_location', $location_id); + + // Event Tickets + $tickets = get_post_meta($event_id, 'mec_tickets', true); + + if (isset($values['mec_attendees'])) + { + foreach ($values['mec_attendees'] as $k => $mec_attendee) + { + if (!is_numeric($k)) continue; + $values['mec_attendees'][$k]['buyerip'] = $this->main->get_client_ip(); + + $ticket_id = $mec_attendee['id'] ?? 0; + $ticket_price = (isset($tickets[$ticket_id]) ? $tickets[$ticket_id]['price'] : 0); + + update_post_meta($book_id, 'mec_ticket_price_' . $ticket_id, $ticket_price); + } + + update_post_meta($book_id, 'mec_attendees', $values['mec_attendees']); + } + + $price = $transaction['price'] ?? ($transaction['total'] ?? 0); + update_post_meta($book_id, 'mec_price', $price); + + $payable = $transaction['payable'] ?? $price; + update_post_meta($book_id, 'mec_payable', $payable); + + // A coupon applied + if (isset($transaction['coupon'])) + { + $coupon_id = $this->coupon_get_id($transaction['coupon']); + if ($coupon_id) + { + wp_set_object_terms($book_id, $coupon_id, 'mec_coupon'); + update_post_meta($book_id, 'mec_coupon_code', $transaction['coupon']); + } + } + + // Local Data + update_post_meta($book_id, 'mec_local_timezone', $this->main->get_timezone_by_ip()); + + // Booking Record + $this->getBookingRecord()->insert($book_id); + + // Fires after adding a new booking to send notifications etc + do_action('mec_booking_added', $book_id); + + list($auto_verify_free, $auto_verify_paid) = $this->get_auto_verification_status($event_id, $book_id); + list($auto_confirm_free, $auto_confirm_paid) = $this->get_auto_confirmation_status($event_id, $book_id); + + $verified = false; + + // Auto verification for free bookings is enabled + if ($price <= 0 and $auto_verify_free) + { + $this->verify($book_id); + $verified = true; + } + + // Auto verification for paid bookings is enabled + if ($price > 0 and $auto_verify_paid) + { + $this->verify($book_id); + $verified = true; + } + + // Auto confirmation for free bookings is enabled + if ($price <= 0 and $auto_confirm_free and $verified) + { + $this->confirm($book_id, 'auto'); + } + + // Auto confirmation for paid bookings is enabled + if ($price > 0 and $auto_confirm_paid and $verified) + { + // Work or don't work auto confirmation when pay through pay locally payment. + $gateways_settings = get_option('mec_options', []); + $gateway_key = null; + $can_auto_confirm = true; + $action = isset($_GET['action']) ? sanitize_text_field($_GET['action']) : false; + + switch ($action) + { + case 'mec_do_transaction_pay_locally': + case 'mec_cart_do_transaction_pay_locally': + + $gateway_key = 1; + break; + case 'mec_do_transaction_bank_transfer': + case 'mec_cart_do_transaction_bank_transfer': + + $gateway_key = 8; + break; + } + + if (!is_null($gateway_key) && isset($gateways_settings['gateways'][$gateway_key]['disable_auto_confirmation']) && trim($gateways_settings['gateways'][$gateway_key]['disable_auto_confirmation'])) + { + $can_auto_confirm = false; + } + + if ($can_auto_confirm) $this->confirm($book_id, 'auto'); + } + + // Latest Booking Date & Time + update_option('mec_latest_booking_datetime', current_time('YmdHis'), false); + + return $book_id; + } + + /** + * Confirm a booking + * @param int $book_id + * @param string $mode + * @return boolean + * @author Webnus + */ + public function confirm($book_id, $mode = 'manually') + { + update_post_meta($book_id, 'mec_confirmed', 1); + + // Fires after confirming a booking to send notifications etc. + do_action('mec_booking_confirmed', $book_id, $mode); + + $event_id = get_post_meta($book_id, 'mec_event_id', true); + $date = get_post_meta($book_id, 'mec_date', true); + $timestamps = explode(':', $date); + + // Booking Records + $this->getBookingRecord()->confirm($book_id); + + // Disable Cache + $cache = $this->getCache(); + $cache->disable(); + + // Event is sold-out so fire the event + $soldout = $this->main->is_sold($event_id, $timestamps[0]); + if ($soldout) do_action('mec_event_soldout', $event_id, $book_id); + + // Enable Cache + $cache->enable(); + + return true; + } + + /** + * Reject a booking + * @param int $book_id + * @return boolean + * @author Webnus + */ + public function reject($book_id) + { + update_post_meta($book_id, 'mec_confirmed', -1); + + // Booking Records + $this->getBookingRecord()->reject($book_id); + + // Fires after rejecting a booking to send notifications etc. + do_action('mec_booking_rejected', $book_id); + + return true; + } + + /** + * Make a booking pending + * @param int $book_id + * @return boolean + * @author Webnus + */ + public function pending($book_id) + { + update_post_meta($book_id, 'mec_confirmed', 0); + + // Booking Records + $this->getBookingRecord()->pending($book_id); + + // Fires after pending a booking to send notifications etc. + do_action('mec_booking_pended', $book_id); + + return true; + } + + /** + * Verify a booking + * @param int $book_id + * @return boolean + * @author Webnus + */ + public function verify($book_id) + { + update_post_meta($book_id, 'mec_verified', 1); + + // Booking Records + $this->getBookingRecord()->verify($book_id); + + // Fires after verifying a booking to send notifications etc. + do_action('mec_booking_verified', $book_id); + + return true; + } + + /** + * Cancel a booking + * @param int $book_id + * @param ?bool $refund + * @return boolean + * @author Webnus + */ + public function cancel($book_id, $refund = null) + { + $verified = -1; + $verified = apply_filters('mec_verified_value', $verified, $book_id); + + if ($verified != -1) return true; + + update_post_meta($book_id, 'mec_verified', -1); + update_post_meta($book_id, 'mec_cancelled_date', date('Y-m-d H:i:s', current_time('timestamp'))); + + if (is_null($refund)) $refund = (isset($this->settings['booking_auto_refund']) and $this->settings['booking_auto_refund']); + $gateway = get_post_meta($book_id, 'mec_gateway', true); + + if ($refund and $gateway == 'MEC_gateway_stripe') + { + $stripe = new MEC_gateway_stripe(); + $stripe->refund($book_id); + + // Actions + do_action('mec_booking_refunded', $book_id); + } + + // Booking Records + $this->getBookingRecord()->cancel($book_id); + + // Fires after canceling a booking to send notifications etc. + do_action('mec_booking_canceled', $book_id); + + return true; + } + + public function move($booking_id, $from_start, $to_start) + { + // Database + $db = $this->getDB(); + + // Event + $event_id = get_post_meta($booking_id, 'mec_event_id', true); + + $offset = (int) $this->main->get_gmt_offset_seconds($event_id, $to_start); + $to_start_datetime = wp_date('Y-m-d H:i:s', $to_start - $offset); + $to_end = (int) $db->select("SELECT `tend` FROM `#__mec_dates` WHERE `post_id`='" . esc_sql($event_id) . "' AND `tstart`='" . esc_sql($to_start) . "'", 'loadResult'); + $from_end = (int) $db->select("SELECT `tend` FROM `#__mec_dates` WHERE `post_id`='" . esc_sql($event_id) . "' AND `tstart`='" . esc_sql($from_start) . "'", 'loadResult'); + + // Update Booking Post + $db->q("UPDATE `#__posts` SET `post_date`='" . esc_sql($to_start_datetime) . "', `post_date_gmt`='" . get_gmt_from_date($to_start_datetime) . "' WHERE `ID`='" . esc_sql($booking_id) . "'"); + + // Update Booking Meta + foreach ([ + 'mec_date' => $to_start . ':' . $to_end, + 'mec_attention_time' => $to_start . ':' . $to_end, + 'mec_attention_time_start' => $to_start, + 'mec_attention_time_end' => $to_end, + ] as $key => $value) + { + // Keep Previous Data + $prev = get_post_meta($booking_id, $key, true); + update_post_meta($booking_id, $key . '_prev', $prev); + + update_post_meta($booking_id, $key, $value); + } + + // All Dates + $all_dates = get_post_meta($booking_id, 'mec_all_dates', true); + if (!is_array($all_dates)) $all_dates = []; + + $k = array_search($from_start . ':' . $from_end, $all_dates); + if ($k !== false) + { + $all_dates[$k] = $to_start . ':' . $to_end; + } + + update_post_meta($booking_id, 'mec_all_dates', $all_dates); + + // Update Transaction + $transaction_id = get_post_meta($booking_id, 'mec_transaction_id', true); + $transaction = $this->get_transaction($transaction_id); + + if (isset($transaction['timestamps']) and is_array($transaction['timestamps'])) + { + $k = array_search($transaction['date'], $transaction['timestamps']); + if ($k !== false) $transaction['timestamps'][$k] = $to_start . ':' . $to_end; + } + + $transaction['date'] = $to_start . ':' . $to_end; + $this->update_transaction($transaction_id, $transaction); + + // Update booking Record + $db->q("UPDATE `#__mec_bookings` SET `timestamp`='" . esc_sql($to_start) . "', `date`='" . esc_sql($to_start_datetime) . "' WHERE `booking_id`='" . esc_sql($booking_id) . "' AND `event_id`='" . esc_sql($event_id) . "' AND `timestamp`='" . esc_sql($from_start) . "'"); + + // Delete Cache + clean_post_cache($booking_id); + + // Fires after moving a booking to send notifications etc. + do_action('mec_booking_moved', $booking_id, $to_start); + } + + public function move_notify($booking_id, $moved_to) + { + // Fires after moving a booking to send notifications etc. + do_action('mec_booking_moved_notify', $booking_id, $moved_to); + } + + /** + * Waiting a booking + * @param int $book_id + * @return boolean + * @author Webnus + */ + public function waiting($book_id) + { + update_post_meta($book_id, 'mec_verified', 0); + + // Booking Records + $this->getBookingRecord()->waiting($book_id); + + // Fires after waiting a booking to send notifications etc. + do_action('mec_booking_waiting', $book_id); + + return true; + } + + /** + * Returns ticket availabilities of an event for a certain date + * @param int $event_id + * @param int $timestamp + * @param string $mode + * @return array|integer + * @author Webnus + */ + public function get_tickets_availability($event_id, $timestamp, $mode = 'availability') + { + $ex = explode(':', $timestamp); + $timestamp = $ex[0]; + + if (!is_numeric($timestamp)) $timestamp = strtotime($timestamp); + + $availability = []; + $tickets = get_post_meta($event_id, 'mec_tickets', true); + + // No Ticket Found! + if (!is_array($tickets) or !count($tickets)) + { + if ($mode == 'reservation') return 0; + else return $availability; + } + + $booking_options = get_post_meta($event_id, 'mec_booking', true); + if (!is_array($booking_options)) $booking_options = []; + + $total_bookings_limit = (isset($booking_options['bookings_limit']) and trim($booking_options['bookings_limit']) !== '') ? $booking_options['bookings_limit'] : 100; + $bookings_limit_unlimited = $booking_options['bookings_limit_unlimited'] ?? 0; + $book_all_occurrences = isset($booking_options['bookings_all_occurrences']) ? (int) $booking_options['bookings_all_occurrences'] : 0; + + if ($bookings_limit_unlimited == '1') $total_bookings_limit = '-1'; + + // Get Per Occurrence + $total_bookings_limit = MEC_feature_occurrences::param($event_id, $timestamp, 'bookings_limit', $total_bookings_limit); + + // Total Booking Limit + $total_bookings_limit_original = $total_bookings_limit; + + // Ticket Selling Stop + $event_date = date('Y-m-d h:i a', $timestamp); + + if (!$book_all_occurrences && trim($timestamp)) $date_query = " AND `timestamp`=" . $timestamp; + else $date_query = ""; + + // Database + $db = $this->getDB(); + + // Cache + $cache = $this->getCache(); + + $booked = 0; + foreach ($tickets as $ticket_id => $ticket) + { + $limit = (isset($ticket['limit']) and trim($ticket['limit']) != '') ? $ticket['limit'] : -1; + + $ticket_seats = (isset($ticket['seats']) and is_numeric($ticket['seats'])) ? (int) $ticket['seats'] : 1; + $ticket_seats = max(1, $ticket_seats); + + $records = $cache->rememberOnce($event_id . ':' . $ticket_id . ':' . $timestamp, function () use ($db, $event_id, $ticket_id, $date_query) + { + return $db->select("SELECT `id`,`ticket_ids` FROM `#__mec_bookings` WHERE `event_id`=" . $event_id . " AND `ticket_ids` LIKE '%," . $ticket_id . ",%' AND `status` IN ('publish', 'pending', 'draft', 'future', 'private') AND `confirmed`!='-1' AND `verified`!='-1'" . $date_query); + }); + + $bookings = 0; + $booked_seats = 0; + foreach ($records as $record) + { + $ticket_ids = explode(',', trim($record->ticket_ids, ', ')); + $ticket_ids_count = array_count_values($ticket_ids); + + if (isset($ticket_ids_count[$ticket_id]) and is_numeric($ticket_ids_count[$ticket_id])) + { + $bookings += $ticket_ids_count[$ticket_id]; + $booked_seats += ($ticket_ids_count[$ticket_id] * $ticket_seats); + } + } + + if ($total_bookings_limit > 0) $total_bookings_limit = max(($total_bookings_limit - $booked_seats), 0); + $booked += $bookings; + + $availability_date_start = $ticket['availability_start'] ?? ''; + $availability_date_end = $ticket['availability_end'] ?? ''; + + if (trim($availability_date_start) && trim($availability_date_end)) + { + if (!(strtotime($availability_date_start) <= $timestamp && strtotime($availability_date_end) >= $timestamp)) + { + $availability[$ticket_id] = 0; + $availability['not_available_' . $ticket_id] = true; + $availability['seats_' . $ticket_id] = $ticket_seats; + continue; + } + } + + // Ticket Selling Stop + $stop_selling_value = isset($ticket['stop_selling_value']) ? trim($ticket['stop_selling_value']) : 0; + $stop_selling_type = isset($ticket['stop_selling_type']) ? trim($ticket['stop_selling_type']) : 'day'; + + if ($stop_selling_value > 0 and $this->main->check_date_time_validation('Y-m-d h:i a', strtolower($event_date))) + { + if (strtotime("-" . $stop_selling_value . $stop_selling_type, strtotime($event_date)) <= current_time('timestamp')) + { + $availability[$ticket_id] = 0; + $availability['stop_selling_' . $ticket_id] = true; + $availability['seats_' . $ticket_id] = $ticket_seats; + continue; + } + } + + // Few Seats + if ($ticket_seats > 1 and $total_bookings_limit > 0 and $total_bookings_limit < $ticket_seats) + { + $availability[$ticket_id] = 0; + $availability['seats_' . $ticket_id] = $ticket_seats; + continue; + } + + // Ticket is Unlimited + if ((isset($ticket['unlimited']) and $ticket['unlimited'] == 1) or $limit == -1) + { + $availability[$ticket_id] = $total_bookings_limit > 0 ? floor($total_bookings_limit / $ticket_seats) : -1; + $availability['seats_' . $ticket_id] = $ticket_seats; + continue; + } + + if ($limit == '') $limit = 0; + + $limit = (int) $limit; + $booked_seats = (int) $booked_seats; + + // Unlimited Total + if ($total_bookings_limit == '-1') $ticket_availability = $limit - $booked_seats; + else $ticket_availability = min(($limit - $booked_seats), max($total_bookings_limit, 0)); + + $availability[$ticket_id] = $ticket_availability >= 0 ? floor($ticket_availability / $ticket_seats) : 0; + $availability['seats_' . $ticket_id] = $ticket_seats; + } + + // For the time being set reservation parameter + if ($mode == 'reservation') return $booked; + + // Set Total Booking Limit + $availability['total'] = $total_bookings_limit; + + // Do not send higher limit for tickets compared to total limit + if ($total_bookings_limit != '-1' and $total_bookings_limit > 0) + { + $new_availability = []; + foreach ($availability as $ticket_id => $limit) + { + if (is_numeric($ticket_id)) + { + $ticket_seats = $availability['seats_' . $ticket_id]; + $ticket_seats = max(1, $ticket_seats); + + $seats = $limit * $ticket_seats; + $new_availability[$ticket_id] = floor(min($seats, $total_bookings_limit) / $ticket_seats); + } + else $new_availability[$ticket_id] = $limit; + } + + return apply_filters('mec_get_tickets_availability', $new_availability, $event_id, $timestamp, $mode, $tickets); + } + + // Total Booking Limit Reached + if ($total_bookings_limit_original != -1 and $booked >= $total_bookings_limit_original) + { + $new_availability = []; + foreach ($availability as $ticket_id => $limit) + { + if (is_numeric($ticket_id)) $new_availability[$ticket_id] = 0; + else $new_availability[$ticket_id] = $limit; + } + + return apply_filters('mec_get_tickets_availability', $new_availability, $event_id, $timestamp, $mode, $tickets); + } + + return apply_filters('mec_get_tickets_availability', $availability, $event_id, $timestamp, $mode, $tickets); + } + + /** + * Returns ticket availabilities of an event for a certain date + * @param int $event_id + * @param array $dates + * @return array + * @author Webnus + */ + public function get_tickets_availability_multiple($event_id, $dates) + { + $availability = []; + foreach ($dates as $date) + { + $ex = explode(':', sanitize_text_field($date)); + $date = $ex[0]; + + $a = $this->get_tickets_availability($event_id, $date); + if (!is_array($a)) continue; + + // Fill Compatibility + if (!count($availability)) $availability = $a; + + // Minimum Availability + foreach ($availability as $k => $v) + { + if (isset($a[$k])) $availability[$k] = min($a[$k], $v); + } + } + + return $availability; + } + + /** + * Check validity of a coupon + * @param string $coupon + * @param int $event_id + * @param array $transaction + * @return int + * @author Webnus + */ + public function coupon_check_validity($coupon, $event_id, $transaction) + { + $term = get_term_by('name', $coupon, 'mec_coupon'); + $coupon_id = $term->term_id ?? 0; + + // Coupon is not exists + if (!$coupon_id) return 0; + + // Usage Limit + $usage_limit = get_term_meta($coupon_id, 'usage_limit', true); + $status = ($usage_limit == '-1' or (int) $usage_limit > $term->count) ? 1 : -1; + + // Expiration Date + if ($status === 1) + { + $expiration_date = get_term_meta($coupon_id, 'expiration_date', true); + if (trim($expiration_date) and strtotime($expiration_date) < strtotime(date('Y-m-d'))) + { + $status = -2; + } + } + + // Event Specification + if ($status === 1) + { + $all_events = get_term_meta($coupon_id, 'target_event', true); + if (trim($all_events) == '') $all_events = 1; + + $target_events = get_term_meta($coupon_id, 'target_events', true); + if (!is_array($target_events)) + { + $target_events = []; + if ($all_events and $all_events != 1) $target_events[] = $all_events; + } + + if (!$all_events and is_array($target_events) and count($target_events) and !in_array($event_id, $target_events)) + { + $status = -3; + } + } + + // Category Specification + if ($status === 1) + { + $all_target_categories = get_term_meta($coupon_id, 'target_category', true); + if (trim($all_target_categories) == '') $all_target_categories = 1; + + $target_categories = get_term_meta($coupon_id, 'target_categories', true); + if (!$all_target_categories and is_array($target_categories) and count($target_categories)) + { + $event_categories = wp_get_post_terms($event_id, 'mec_category', ['fields' => 'ids']); + + $found = false; + foreach ($target_categories as $target_category) + { + if (in_array($target_category, $event_categories)) + { + $found = true; + break; + } + } + + if (!$found) $status = -6; + } + } + + // Minimum Tickets + if ($status === 1) + { + $ticket_minimum = get_term_meta($coupon_id, 'ticket_minimum', true); + if (!trim($ticket_minimum)) $ticket_minimum = 1; + + $tickets = $transaction['tickets'] ?? []; + if (isset($tickets['attachments'])) unset($tickets['attachments']); + + if (count($tickets) < $ticket_minimum) + { + $status = -4; + } + } + + // Maximum Tickets + if ($status === 1) + { + $ticket_maximum = get_term_meta($coupon_id, 'ticket_maximum', true); + if (trim($ticket_maximum)) + { + $tickets = $transaction['tickets'] ?? []; + if (isset($tickets['attachments'])) unset($tickets['attachments']); + + if (count($tickets) > $ticket_maximum) + { + $status = -5; + } + } + } + + $all_dates = (isset($transaction['all_dates']) and is_array($transaction['all_dates'])) ? $transaction['all_dates'] : []; + + // Minimum Dates + if ($status === 1 and count($all_dates) >= 1) + { + $date_minimum = get_term_meta($coupon_id, 'date_minimum', true); + if (!trim($date_minimum)) $date_minimum = 1; + + if (count($all_dates) < $date_minimum) + { + $status = -7; + } + } + + // Maximum Dates + if ($status === 1 and count($all_dates) >= 1) + { + $date_maximum = get_term_meta($coupon_id, 'date_maximum', true); + if (trim($date_maximum)) + { + if (count($all_dates) > $date_maximum) + { + $status = -8; + } + } + } + + return $status; + } + + /** + * Apply a coupon to a transaction + * @param string $coupon + * @param int $transaction_id + * @return int + * @author Webnus + */ + public function coupon_apply($coupon, $transaction_id) + { + $transaction = $this->get_transaction($transaction_id); + $event_id = $transaction['event_id'] ?? null; + + // Verify validity of coupon + if ($this->coupon_check_validity($coupon, $event_id, $transaction) != 1) return 0; + + $total = $transaction['total']; + $discount = $this->coupon_get_discount($coupon, $total); + $after_discount = $total - $discount; + + $transaction['price_details']['total'] = $after_discount; + + $price_details = $transaction['price_details']['details']; + foreach ($price_details as $i => $price_detail) + { + if (isset($price_detail['type']) and $price_detail['type'] == 'discount' and isset($price_detail['coupon'])) unset($price_details[$i]); + } + + $price_details[] = ['amount' => $discount, 'description' => __('Discount', 'modern-events-calendar-lite'), 'type' => 'discount', 'coupon' => $coupon]; + + $transaction['price_details']['details'] = $price_details; + $transaction['discount'] = $discount; + $transaction['price'] = $after_discount; + $transaction['coupon'] = $coupon; + + // Re-calculate + $transaction = $this->recalculate($transaction); + + // Update Transaction + $this->update_transaction($transaction_id, $transaction); + + return $transaction['discount'] ?? $discount; + } + + /** + * Get discount of a coupon + * @param string $coupon + * @param int $total + * @return int + * @author Webnus + */ + public function coupon_get_discount($coupon, $total) + { + $coupon_id = $this->coupon_get_id($coupon); + + // Coupon is not exists + if (!$coupon_id) return 0; + + $discount_type = get_term_meta($coupon_id, 'discount_type', true); + $discount = get_term_meta($coupon_id, 'discount', true); + + if ($discount_type == 'percent') + { + $discount_amount = ($total * $discount) / 100; + + $discount_max = get_term_meta($coupon_id, 'maximum_discount', true); + if (trim($discount_max) and is_numeric($discount_max)) $discount_amount = min($discount_amount, $discount_max); + } + else $discount_amount = min($discount, $total); + + return $discount_amount; + } + + /** + * Get id of a coupon by coupon number + * @param string $coupon + * @return int + * @author Webnus + */ + public function coupon_get_id($coupon) + { + $term = get_term_by('name', $coupon, 'mec_coupon'); + return $term->term_id ?? 0; + } + + /** + * Is coupon 100 percent? + * @param string $coupon + * @return bool + * @author Webnus + */ + public function coupon_is_100percent($coupon) + { + $coupon_id = $this->coupon_get_id($coupon); + + // Coupon is not exists + if (!$coupon_id) return false; + + $discount_type = get_term_meta($coupon_id, 'discount_type', true); + $discount = (int) get_term_meta($coupon_id, 'discount', true); + + return ($discount_type === 'percent' and $discount === 100); + } + + public function recalculate($transaction) + { + $price_details = $transaction['price_details']['details']; + + $other_dates = (isset($transaction['other_dates']) and is_array($transaction['other_dates'])) ? $transaction['other_dates'] : []; + $dates_count = count($other_dates) + 1; + + $booked_tickets = $transaction['tickets']; + if (isset($booked_tickets['attachments'])) unset($booked_tickets['attachments']); + + $total_tickets_count = (count($booked_tickets) * $dates_count); + + $total_fee_amount = 0; + $taxable = 0; + $total_discount = 0; + $fees_to_apply = []; + $discounts_to_apply = []; + + foreach ($price_details as $i => $item) + { + $type = $item['type'] ?? ''; + $amount = $item['amount'] ?? 0; + + if ($type == 'fee') $fees_to_apply[] = $item; + else if ($type == 'discount') $discounts_to_apply[] = $item; + else $taxable += $amount; + + // Remove Fee and Discount Items + if (in_array($type, ['fee', 'discount'])) unset($price_details[$i]); + } + + $total = $taxable; + + $fee_discount = 0; + $fee_discount_type = 'percent'; + + // Apply Discounts + foreach ($discounts_to_apply as $discount_item) + { + $coupon_id = $this->coupon_get_id($discount_item['coupon']); + if ($coupon_id && get_term_meta($coupon_id, 'apply_on_fees', true)) + { + $fee_discount_type = get_term_meta($coupon_id, 'discount_type', true); + $fee_discount = get_term_meta($coupon_id, 'discount', true); + } + + $discount = $this->coupon_get_discount($discount_item['coupon'], $taxable); + $taxable = max(0, ($taxable - $discount)); + $total_discount += $discount; + + $price_details[] = ['amount' => $discount, 'description' => __('Discount', 'modern-events-calendar-lite'), 'type' => 'discount', 'coupon' => $discount_item['coupon']]; + } + + // Apply Fees + foreach ($fees_to_apply as $fee_item) + { + $fee_amount = 0; + + if ($fee_item['fee_type'] == 'percent') $fee_amount += ($taxable * $fee_item['fee_amount']) / 100; + else if ($fee_item['fee_type'] == 'amount') $fee_amount += ($total_tickets_count * $fee_item['fee_amount']); + else if ($fee_item['fee_type'] == 'amount_per_date') $fee_amount += ($dates_count * $fee_item['fee_amount']); + else if ($fee_item['fee_type'] == 'amount_per_booking') $fee_amount += $fee_item['fee_amount']; + + // Apply Discount on Fee + if ($fee_discount && in_array($fee_item['fee_type'], ['amount', 'amount_per_date', 'amount_per_booking'])) + { + if ($fee_discount_type === 'percent') $fee_discount_amount = (float) ($fee_amount * min($fee_discount, 100)) / 100; + else $fee_discount_amount = (float) max($fee_discount, 0); + + $fee_discount_amount = min($fee_amount, $fee_discount_amount); + + $total_discount += $fee_discount_amount; + $fee_amount = max($fee_amount - $fee_discount_amount, 0); + } + + $total_fee_amount += $fee_amount; + $price_details[] = ['amount' => $fee_amount, 'description' => __($fee_item['description'], 'modern-events-calendar-lite'), 'type' => 'fee', 'fee_type' => $fee_item['fee_type'], 'fee_amount' => $fee_item['fee_amount']]; + } + + $total += $total_fee_amount; + $price = ($taxable + $total_fee_amount); + $payable = $price; + + // Calculate Payable + if ($this->partial_payment->is_enabled()) $payable = $this->partial_payment->calculate($price, $transaction['event_id']); + + $transaction['price_details']['total'] = $price; + $transaction['price_details']['payable'] = $payable; + $transaction['price_details']['details'] = $price_details; + $transaction['discount'] = $total_discount; + $transaction['total'] = $total; + $transaction['price'] = $price; + $transaction['payable'] = $payable; + + return $transaction; + } + + /** + * Get invoice link for certain transaction + * @param $transaction_id + * @return string + * @author Webnus + */ + public function get_invoice_link($transaction_id) + { + if (isset($this->settings['booking_invoice']) and !$this->settings['booking_invoice']) return ''; + + $main = $this->getMain(); + + $url = $main->URL(); + $url = $main->add_qs_var('method', 'mec-invoice', $url); + + // Invoice Key + $transaction = $this->get_transaction($transaction_id); + if (isset($transaction['invoice_key'])) $url = $main->add_qs_var('mec-key', $transaction['invoice_key'], $url); + + return apply_filters('mec_booking_invoice_url', $main->add_qs_var('id', $transaction_id, $url), $transaction_id); + } + + /** + * Get Downloadable file link for certain transaction + * @param $book_id + * @return string + * @author Webnus + */ + public function get_dl_file_link($book_id) + { + if (!isset($this->settings['downloadable_file_status']) or (isset($this->settings['downloadable_file_status']) and !$this->settings['downloadable_file_status'])) return ''; + + $event_id = get_post_meta($book_id, 'mec_event_id', true); + $dl_file_id = get_post_meta($event_id, 'mec_dl_file', true); + + return apply_filters('mec_booking_dl_file_url', ($dl_file_id ? wp_get_attachment_url($dl_file_id) : ''), $book_id); + } + + public function get_bookings_by_transaction_id($transaction_id) + { + $main = $this->getMain(); + + return get_posts([ + 'posts_per_page' => -1, + 'post_type' => $main->get_book_post_type(), + 'meta_key' => 'mec_transaction_id', + 'meta_value' => $transaction_id, + ]); + } + + public function get_thankyou_page($page_id, $transaction_id = null, $cart_id = null) + { + $main = $this->getMain(); + $page = get_permalink($page_id); + + if ($transaction_id) $page = $main->add_qs_var('transaction', $transaction_id, $page); + if ($cart_id) $page = $main->add_qs_var('cart', $cart_id, $page); + + return $page; + } + + public function invoice_link_shortcode() + { + $transaction = isset($_GET['transaction']) ? sanitize_text_field($_GET['transaction']) : null; + if (!$transaction) return null; + + $book = $this->getBook(); + return '' . esc_html__('Download Invoice', 'modern-events-calendar-lite') . ''; + } + + public function get_total_attendees($book_id) + { + $attendees = get_post_meta($book_id, 'mec_attendees', true); + $count = 0; + + if (is_array($attendees)) + { + foreach ($attendees as $key => $attendee) + { + if ($key === 'attachments') continue; + + if (!isset($attendee[0]['MEC_TYPE_OF_DATA'])) $count++; + else if ($attendee[0]['MEC_TYPE_OF_DATA'] != 'attachment') $count++; + } + } + + return $count; + } + + public function get_attendees($book_id) + { + $attendees = get_post_meta($book_id, 'mec_attendees', true); + $clean = []; + + if (is_array($attendees)) + { + foreach ($attendees as $key => $attendee) + { + if ($key === 'attachments') continue; + + $clean[$key] = $attendee; + } + } + + return $clean; + } + + public function get_transaction_id_book_id($book_id) + { + return get_post_meta($book_id, 'mec_transaction_id', true); + } + + public function get_book_id_transaction_id($transaction_id) + { + $db = $this->getDB(); + return $db->select("SELECT `post_id` FROM `#__postmeta` WHERE `meta_key`='mec_transaction_id' AND `meta_value`='" . $db->escape($transaction_id) . "'", 'loadResult'); + } + + public function get_ticket_price_label($ticket, $current_date, $event_id, $timestamp = null) + { + return $this->get_ticket_price_key($ticket, $current_date, $event_id, 'price_label', $timestamp); + } + + public function get_ticket_price($ticket, $current_date, $event_id, $timestamp = null) + { + $price = $this->get_ticket_price_key($ticket, $current_date, $event_id, 'price', $timestamp); + return trim($price) ? $price : 0; + } + + public function get_ticket_regular_price_key($ticket, $current_date, $event_id, $key, $timestamp = null) + { + $data = $ticket[$key] ?? null; + + if ($timestamp and isset($ticket['id']) and trim($ticket['id']) !== '') + { + $occ_tickets = MEC_feature_occurrences::param($event_id, $timestamp, 'tickets', []); + if (is_array($occ_tickets) and isset($occ_tickets[$ticket['id']]) and is_array($occ_tickets[$ticket['id']]) and isset($occ_tickets[$ticket['id']][$key]) and trim($occ_tickets[$ticket['id']][$key]) !== '') + { + $data = $occ_tickets[$ticket['id']][$key]; + } + } + + $price_dates = (isset($ticket['dates']) and is_array($ticket['dates'])) ? $ticket['dates'] : []; + if (count($price_dates)) + { + $current_time = strtotime($current_date); + foreach ($price_dates as $k => $price_date) + { + if (!is_numeric($k)) continue; + + $start = $price_date['start']; + $end = $price_date['end']; + + if ($current_time >= strtotime($start) and $current_time <= strtotime($end)) + { + if ($key == 'price_label') $data = $price_date['label']; + else $data = $price_date[$key]; + } + } + } + + return $data; + } + + public function get_ticket_price_key($ticket, $current_date, $event_id, $key, $timestamp = null) + { + $data = $this->get_ticket_regular_price_key($ticket, $current_date, $event_id, $key, $timestamp); + + return $this->get_price_for_loggedin_users($event_id, $data, $key); + } + + /** + * Returns tickets prices of an event for a certain date + * @param int $event_id + * @param string $date + * @param string $key + * @param int $timestamp + * @return array + * @author Webnus + */ + public function get_tickets_prices($event_id, $date, $key = 'price', $timestamp = null) + { + $prices = []; + $tickets = get_post_meta($event_id, 'mec_tickets', true); + + // No Ticket Found! + if (!is_array($tickets) || !count($tickets)) return $prices; + + foreach ($tickets as $ticket_id => $ticket) + { + $price = $this->get_ticket_price_key($ticket, $date, $event_id, $key, $timestamp); + $prices[$ticket_id] = apply_filters('mec_filter_ticket_price', $price, $ticket, $event_id, $this); + } + + return $prices; + } + + public function get_price_for_loggedin_users($event_id, $price, $type = 'price') + { + if (!is_user_logged_in()) return $price; + + $user_id = get_current_user_id(); + return $this->get_price_for_users($event_id, $price, $user_id, $type); + } + + public function get_price_for_users($event_id, $price, $user_id, $type = 'price') + { + // Guest User + if (!$user_id) return $price; + + $booking_options = get_post_meta($event_id, 'mec_booking', true); + if (!is_array($booking_options)) $booking_options = []; + + // User + $user = get_user_by('id', $user_id); + + // Invalid User ID + if (!$user || !isset($user->roles)) return $price; + + $roles = $user->roles; + + $loggedin_discount = $booking_options['loggedin_discount'] ?? 0; + $role_discount = $loggedin_discount; + + // Step through all roles in Array that comes from WordPress Core + foreach ($roles as $role) + { + // If role discount is higher than the preset role OR a previous roles discount, set it to the new higher discount + if (isset($booking_options['roles_discount_' . $role]) and is_numeric($booking_options['roles_discount_' . $role]) and $booking_options['roles_discount_' . $role] > $role_discount) $role_discount = $booking_options['roles_discount_' . $role]; + } + + if (trim($role_discount) and is_numeric($role_discount)) + { + if ($type === 'price_label' and !is_numeric($price)) + { + $numeric = preg_replace("/[^0-9.]/", '', $price); + if (is_numeric($numeric)) $price = $this->main->render_price(($numeric - (($numeric * $role_discount) / 100)), $event_id); + } + else + { + $price = $price - (($price * $role_discount) / 100); + } + } + + // Render Numeric Price + if ($type === 'price_label' and is_numeric($price)) $price = $this->main->render_price($price, $event_id); + + return $price; + } + + public function get_user_booking_limit($event_id) + { + $unlimited = false; + $limit = 12; + $mec_settings = $this->main->get_settings(); + $booking_options = get_post_meta($event_id, 'mec_booking', true); + + // Total user booking limited + if (isset($booking_options['bookings_user_limit_unlimited']) and !trim($booking_options['bookings_user_limit_unlimited'])) + { + $limit = (isset($booking_options['bookings_user_limit']) and trim($booking_options['bookings_user_limit'])) ? trim($booking_options['bookings_user_limit']) : $limit; + } + else + { + // If Inherit from global options activate + if (!isset($mec_settings['booking_limit']) or !trim($mec_settings['booking_limit'])) $unlimited = true; + else $limit = trim($mec_settings['booking_limit']); + } + + return [$limit, $unlimited]; + } + + public function get_minimum_tickets_per_booking($event_id) + { + $booking_options = get_post_meta($event_id, 'mec_booking', true); + + $bookings_minimum_per_booking = (isset($booking_options['bookings_minimum_per_booking']) and trim($booking_options['bookings_minimum_per_booking'])) ? (int) $booking_options['bookings_minimum_per_booking'] : 1; + return max($bookings_minimum_per_booking, 1); + } + + public function timestamp($start, $end) + { + // Timestamp is already available + if (isset($start['timestamp']) && isset($end['timestamp'])) + { + return $start['timestamp'] . ':' . $end['timestamp']; + } + + $s_hour = $start['hour']; + if (strtoupper($start['ampm']) == 'AM' and $s_hour == '0') $s_hour = 12; + + $e_hour = $end['hour']; + if (strtoupper($end['ampm']) == 'AM' and $e_hour == '0') $e_hour = 12; + + $start_time = $start['date'] . ' ' . sprintf("%02d", $s_hour) . ':' . sprintf("%02d", $start['minutes']) . ' ' . $start['ampm']; + $end_time = $end['date'] . ' ' . sprintf("%02d", $e_hour) . ':' . sprintf("%02d", $end['minutes']) . ' ' . $end['ampm']; + + return strtotime($start_time) . ':' . strtotime($end_time); + } + + public function get_event_id_by_transaction_id($transaction_id) + { + $transaction = $this->get_transaction($transaction_id); + return $transaction['event_id'] ?? 0; + } + + public function get_attendee_price($transaction, $email) + { + if (!is_array($transaction)) $transaction = $this->get_transaction($transaction); + + // No Attendees found! + if (!isset($transaction['tickets']) || !is_array($transaction['tickets'])) return false; + + $attendee = []; + foreach ($transaction['tickets'] as $key => $ticket) + { + if (!is_numeric($key)) continue; + + if ($ticket['email'] == $email) + { + $attendee = $ticket; + break; + } + } + + // Attendee not found + if (!count($attendee)) return false; + + $event_id = $transaction['event_id'] ?? 0; + if (!$event_id) return false; + + $tickets = get_post_meta($event_id, 'mec_tickets', true); + + $dates = explode(':', $transaction['date']); + + $ticket_price = isset($tickets[$attendee['id']]) ? $this->get_ticket_price($tickets[$attendee['id']], date('Y-m-d', $dates[0]), $event_id, $dates[0]) : 0; + if (!$ticket_price) return false; + + $variation_price = 0; + + // Ticket Variations + if (isset($attendee['variations']) and is_array($attendee['variations']) and count($attendee['variations'])) + { + $ticket_variations = $this->main->ticket_variations($event_id, $attendee['id']); + foreach ($attendee['variations'] as $variation_id => $variation_count) + { + if (!$variation_count || $variation_count < 0) continue; + + $variation_price += ((isset($ticket_variations[$variation_id]['price']) and is_numeric($ticket_variations[$variation_id]['price'])) ? $ticket_variations[$variation_id]['price'] : 0); + } + } + + return ($ticket_price + $variation_price); + } + + public function get_auto_verification_status($event_id, $book_id) + { + // Booking Options + $BO = get_post_meta($event_id, 'mec_booking', true); + if (!is_array($BO)) $BO = []; + + $event_auto_verify = (isset($BO['auto_verify']) and trim($BO['auto_verify']) != '') ? $BO['auto_verify'] : 'global'; + if (is_numeric($event_auto_verify)) $event_auto_verify = (int) $event_auto_verify; + + if ($event_auto_verify === 'global') + { + $auto_verify_free = $this->settings['booking_auto_verify_free'] ?? 0; + $auto_verify_paid = $this->settings['booking_auto_verify_paid'] ?? 0; + } + else + { + $auto_verify_free = $event_auto_verify; + $auto_verify_paid = $event_auto_verify; + } + + return apply_filters('mec_get_auto_verification_status', [$auto_verify_free, $auto_verify_paid], $event_id, $book_id); + } + + public function get_auto_confirmation_status($event_id, $book_id) + { + // Booking Options + $BO = get_post_meta($event_id, 'mec_booking', true); + if (!is_array($BO)) $BO = []; + + $event_auto_confirm = (isset($BO['auto_confirm']) and trim($BO['auto_confirm']) != '') ? $BO['auto_confirm'] : 'global'; + if (is_numeric($event_auto_confirm)) $event_auto_confirm = (int) $event_auto_confirm; + + if ($event_auto_confirm === 'global') + { + $auto_confirm_free = $this->settings['booking_auto_confirm_free'] ?? 0; + $auto_confirm_paid = $this->settings['booking_auto_confirm_paid'] ?? 0; + } + else + { + $auto_confirm_free = $event_auto_confirm; + $auto_confirm_paid = $event_auto_confirm; + } + + return apply_filters('mec_get_auto_confirmation_status', [$auto_confirm_free, $auto_confirm_paid], $event_id, $book_id); + } + + public function get_total_tickets($event_id) + { + $booking_options = get_post_meta($event_id, 'mec_booking', true); + if (!is_array($booking_options)) $booking_options = []; + + $tickets = get_post_meta($event_id, 'mec_tickets', true); + + $total_bookings_limit = (isset($booking_options['bookings_limit']) and trim($booking_options['bookings_limit']) !== '') ? $booking_options['bookings_limit'] : 100; + $bookings_limit_unlimited = $booking_options['bookings_limit_unlimited'] ?? 0; + + if ($bookings_limit_unlimited == '1') $total_bookings_limit = '-1'; + + $all_ticket_availability = -1; + foreach ($tickets as $ticket_id => $ticket) + { + $limit = (isset($ticket['limit']) and trim($ticket['limit']) != '') ? $ticket['limit'] : -1; + + $ticket_seats = (isset($ticket['seats']) and is_numeric($ticket['seats'])) ? (int) $ticket['seats'] : 1; + $ticket_seats = max(1, $ticket_seats); + + // Ticket is Unlimited + if ((isset($ticket['unlimited']) && $ticket['unlimited'] == 1) || $limit == -1) continue; + + // Unlimited Total + if ($total_bookings_limit == '-1') $ticket_availability = $limit; + else $ticket_availability = min($limit, max($total_bookings_limit, 0)); + + $all_ticket_availability = max($all_ticket_availability, 0); + $all_ticket_availability += $ticket_availability >= 0 ? floor($ticket_availability / $ticket_seats) : 0; + } + + $final = $all_ticket_availability != '-1' ? $all_ticket_availability : $total_bookings_limit; + + return $final == '-1' ? __('Unlimited', 'modern-events-calendar-lite') : $final; + } + + public function get_all_sold_tickets($event_id) + { + // Transient Key + $transient_key = 'all_sold_tickets_' . $event_id; + + // Cached Data + $cached = get_transient($transient_key); + + // Return Cached Data + if ($cached) return $cached; + + $query = new WP_Query([ + 'post_type' => $this->PT, + 'posts_per_page' => -1, + 'post_status' => ['publish', 'pending', 'draft', 'future', 'private'], + 'meta_query' => [ + ['key' => 'mec_event_id', 'value' => $event_id, 'compare' => '='], + ['key' => 'mec_confirmed', 'value' => 1, 'compare' => '='], + ['key' => 'mec_verified', 'value' => 1, 'compare' => '='], + ], + ]); + + $sold = 0; + if ($query->have_posts()) + { + // The Loop + while ($query->have_posts()) + { + $query->the_post(); + $sold += $this->get_total_attendees(get_the_ID()); + } + + // Restore original Post Data + wp_reset_postdata(); + } + + // Set Transient + set_transient($transient_key, $sold, 24 * HOUR_IN_SECONDS); + + return $sold; + } + + public function get_ticket_total_price($transaction, $attendee, $booking_id) + { + $event_id = $transaction['event_id']; + + $all_attendees = get_post_meta($booking_id, 'mec_attendees', true); + if (!is_array($all_attendees) || !count($all_attendees)) $all_attendees = [get_post_meta($booking_id, 'mec_attendee', true)]; + + if (isset($all_attendees['attachments'])) unset($all_attendees['attachments']); + + $total_price = get_post_meta($booking_id, 'mec_price', true); + if (count($all_attendees) == 1) return $total_price; + + $tickets = get_post_meta($event_id, 'mec_tickets', true); + $ticket_id = $attendee['id']; + + $ticket_variations = $this->main->ticket_variations($event_id, $ticket_id); + + $ticket_price_booking_saved = get_post_meta($booking_id, 'mec_ticket_price_' . $ticket_id, true); + if (trim($ticket_price_booking_saved) === '') $ticket_price_booking_saved = 0; + + $ticket_price = (isset($tickets[$ticket_id]) ? $tickets[$ticket_id]['price'] : $ticket_price_booking_saved); + + $user = $this->getUser(); + $booking_user = $user->booking($booking_id); + + $ticket_price = $this->get_price_for_users($event_id, $ticket_price, $booking_user->ID); + + // Price Per Date + if (isset($tickets[$ticket_id]['dates']) and is_array($tickets[$ticket_id]['dates']) and count($tickets[$ticket_id]['dates'])) + { + $book_time = strtotime(get_post_meta($booking_id, 'mec_booking_time', true)); + if ($book_time) + { + $pdates = $tickets[$ticket_id]['dates']; + foreach ($pdates as $pdate) + { + if (!isset($pdate['start']) or !isset($pdate['end'])) continue; + + $t_start = strtotime($pdate['start']); + $t_end = strtotime($pdate['end']); + + if ($book_time >= $t_start and $book_time <= $t_end and isset($pdate['price'])) + { + $ticket_price = $pdate['price']; + break; + } + } + } + } + + $variation_price = 0; + if (isset($attendee['variations']) and is_array($attendee['variations']) and count($attendee['variations'])) + { + foreach ($attendee['variations'] as $variation_id => $count) + { + if (!trim($count)) continue; + if (!isset($ticket_variations[$variation_id])) continue; + + $p = $ticket_variations[$variation_id]['price']; + if (is_numeric($p) and is_numeric($count)) $variation_price += ($p * $count); + } + } + + // Fees + $total_fees = 0; + + // Discounts + $discounts = 0; + + if (isset($transaction['price_details']) and isset($transaction['price_details']['details']) and is_array($transaction['price_details']['details']) and count($transaction['price_details']['details'])) + { + foreach ($transaction['price_details']['details'] as $detail) + { + if (!isset($detail['type'])) continue; + + if ($detail['type'] == 'fee' and isset($detail['amount']) and is_numeric($detail['amount'])) $total_fees += $detail['amount']; + if ($detail['type'] == 'discount' and isset($detail['amount']) and is_numeric($detail['amount'])) $discounts += $detail['amount']; + } + } + + $ticket_total_price = null; + if (is_numeric($ticket_price) and is_numeric($variation_price) and is_numeric($total_fees) and is_numeric($discounts)) + { + + $ticket_total_price = ($ticket_price + $variation_price + ($total_fees / count($all_attendees))) - ($discounts / count($all_attendees)); + } + + return (!is_null($ticket_total_price) ? $ticket_total_price : $total_price); + } + + /** + * Remove Fees From a Transaction + * @param int $transaction_id + * @return boolean + * @author Webnus + */ + public function remove_fees($transaction_id) + { + $transaction = $this->get_transaction($transaction_id); + $price_details = $transaction['price_details']['details']; + + $removed_fees = []; + foreach ($price_details as $i => $price_detail) + { + if (isset($price_detail['type']) and $price_detail['type'] == 'fee') + { + $removed_fees[] = $price_detail; + unset($price_details[$i]); + } + } + + $transaction['price_details']['details'] = $price_details; + $transaction['removed_fees_status'] = 1; + $transaction['removed_fees'] = (count($removed_fees) ? $removed_fees : ($transaction['removed_fees'] ?? [])); + + // Re-calculate + $transaction = $this->recalculate($transaction); + + // Update Transaction + $this->update_transaction($transaction_id, $transaction); + + return true; + } + + /** + * Re-Add Fees To a Transaction + * @param int $transaction_id + * @return boolean + * @author Webnus + */ + public function readd_fees($transaction_id) + { + $transaction = $this->get_transaction($transaction_id); + + $is_removed = $transaction['removed_fees_status'] ?? 0; + if (!$is_removed) return false; + + $price_details = $transaction['price_details']['details']; + + $removed_fees = (isset($transaction['removed_fees']) and is_array($transaction['removed_fees'])) ? $transaction['removed_fees'] : []; + foreach ($removed_fees as $removed_fee) $price_details[] = $removed_fee; + + $transaction['price_details']['details'] = $price_details; + + unset($transaction['removed_fees_status']); + unset($transaction['removed_fees']); + + // Re-calculate + $transaction = $this->recalculate($transaction); + + // Update Transaction + $this->update_transaction($transaction_id, $transaction); + + return true; + } + + public function get_cancel_url($event, $booking_id) + { + $event_url = trim(get_permalink($event), '/ '); + $cancelation_key = get_post_meta($booking_id, 'mec_cancellation_key', true); + + if (strpos($event_url, '?') === false) return $event_url . '/cancel/' . $cancelation_key . '/'; + else return $this->main->add_qs_var('cancel', $cancelation_key, $event_url); + } +} diff --git a/app/libraries/bookingRecord.php b/app/libraries/bookingRecord.php new file mode 100755 index 0000000..71bed51 --- /dev/null +++ b/app/libraries/bookingRecord.php @@ -0,0 +1,195 @@ + + */ +class MEC_bookingRecord extends MEC_base +{ + /** + * @var MEC_main + */ + public $main; + + /** + * @var MEC_db + */ + public $db; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Main + $this->main = $this->getMain(); + + // Import MEC DB + $this->db = $this->getDB(); + } + + /** + * @param WP_Post|integer $booking + * @return array + */ + public function insert($booking) + { + // Get Booking by ID + if(is_numeric($booking)) $booking = get_post($booking); + + if(!$booking || !is_a($booking, '\WP_Post')) return []; + + // User Library + $u = $this->getUser(); + + // Get Main User + $user = $u->booking($booking->ID); + + $user_id = $user ? $user->ID : 0; + $verified = get_post_meta($booking->ID, 'mec_verified', true); + $confirmed = get_post_meta($booking->ID, 'mec_confirmed', true); + $event_id = get_post_meta($booking->ID, 'mec_event_id', true); + $ticket_ids = get_post_meta($booking->ID, 'mec_ticket_id', true); + $transaction_id = get_post_meta($booking->ID, 'mec_transaction_id', true); + + $event_tickets = get_post_meta($event_id, 'mec_tickets', true); + if(!is_array($event_tickets)) $event_tickets = []; + + $seats = 0; + $booked_ticket_ids = explode(',', trim($ticket_ids, ', ')); + foreach($booked_ticket_ids as $booked_ticket_id) + { + $booked_ticket_id = (int) trim($booked_ticket_id); + $data = (isset($event_tickets[$booked_ticket_id]) and is_array($event_tickets[$booked_ticket_id])) ? $event_tickets[$booked_ticket_id] : []; + + $ticket_seats = (isset($data['seats']) and is_numeric($data['seats'])) ? (int) $data['seats'] : 1; + $seats += $ticket_seats; + } + + $booking_options = get_post_meta($event_id, 'mec_booking', true); + $all_occurrences = $booking_options['bookings_all_occurrences'] ?? 0; + + $attendees = get_post_meta($booking->ID, 'mec_attendees', true); + + $all_dates = get_post_meta($booking->ID, 'mec_all_dates', true); + $timestamps = []; + + // Multiple Dates + if($all_dates and is_array($all_dates) and count($all_dates)) $timestamps = $all_dates; + // Single Date + else $timestamps[] = get_post_meta($booking->ID, 'mec_date', true); + + $ids = []; + foreach($timestamps as $timestamp) + { + $timestamp = is_array($timestamp) ? '' : explode(':', $timestamp)[0]; + if($timestamp && !is_numeric($timestamp)) $timestamp = strtotime($timestamp); + + if(!trim($timestamp)) continue; + + // Exists? + $exists = $this->db->select("SELECT `id` FROM `#__mec_bookings` WHERE `transaction_id`='".esc_sql($transaction_id)."' AND `timestamp`='".esc_sql($timestamp)."'", 'loadResult'); + if($exists) continue; + + // Insert + $query = "INSERT INTO `#__mec_bookings` (`booking_id`,`user_id`,`transaction_id`,`event_id`,`ticket_ids`,`seats`,`status`,`confirmed`,`verified`,`all_occurrences`,`date`,`timestamp`) VALUES ('".esc_sql($booking->ID)."','".esc_sql($user_id)."','".esc_sql($transaction_id)."','".esc_sql($event_id)."','".esc_sql($ticket_ids)."','".esc_sql($seats)."','".$booking->post_status."','".esc_sql($confirmed)."','".esc_sql($verified)."','".esc_sql($all_occurrences)."','".date('Y-n-d H:i:s', $timestamp)."','".esc_sql($timestamp)."');"; + $id = $this->db->q($query, 'INSERT'); + + foreach($attendees as $k => $attendee) + { + // No Attendee + if(!is_numeric($k)) continue; + if(!isset($attendee['id'])) continue; + + // Ticket ID + $ticket_id = $attendee['id']; + + // Register attendee in MEC + $attendee_id = $u->register($attendee, [ + 'register_in_mec' => true, + ]); + + // Insert Booking Attendees + $query = "INSERT INTO `#__mec_booking_attendees` (`mec_booking_id`,`user_id`,`ticket_id`) VALUES ('".esc_sql($id)."','".esc_sql($attendee_id)."','".esc_sql($ticket_id)."');"; + $this->db->q($query, 'INSERT'); + } + + $ids[] = $id; + } + + return $ids; + } + + /** + * @param WP_Post|integer $booking + * @return array + */ + public function update($booking) + { + // Delete + $this->delete($booking); + + return $this->insert($booking); + } + + /** + * @param WP_Post|integer $booking + */ + public function delete($booking) + { + // Get Booking by ID + if(is_numeric($booking)) $booking = get_post($booking); + + $this->db->q("DELETE FROM `#__mec_bookings` WHERE `booking_id`='".$booking->ID."'"); + } + + public function confirm($booking) + { + return $this->set($booking, array('confirmed' => 1)); + } + + public function reject($booking) + { + return $this->set($booking, array('confirmed' => -1)); + } + + public function pending($booking) + { + return $this->set($booking, array('confirmed' => 0)); + } + + public function verify($booking) + { + return $this->set($booking, array('verified' => 1)); + } + + public function cancel($booking) + { + return $this->set($booking, array('verified' => -1)); + } + + public function waiting($booking) + { + return $this->set($booking, array('verified' => 0)); + } + + public function set($booking, $values) + { + // Get Booking by ID + if(is_numeric($booking)) $booking = get_post($booking); + + // Invalid Booking + if(!$booking || !is_a($booking, '\WP_Post')) return []; + + $q = ""; + foreach($values as $key => $value) $q .= "`".esc_attr($key)."`='".esc_sql($value)."',"; + + // Nothing to Update! + if(trim($q) == '') return false; + + return $this->db->q("UPDATE `#__mec_bookings` SET ".trim($q, ', ')." WHERE `booking_id`='".esc_sql($booking->ID)."'"); + } +} \ No newline at end of file diff --git a/app/libraries/cache.php b/app/libraries/cache.php new file mode 100755 index 0000000..9962e57 --- /dev/null +++ b/app/libraries/cache.php @@ -0,0 +1,87 @@ + + */ +class MEC_cache +{ + protected static $instance = null; + protected static $cache = []; + protected static $enabled = true; + + /** + * Constructor method + * @author Webnus + */ + private function __construct() + { + } + + public function __clone() + { + } + + public function __wakeup() + { + } + + public static function getInstance() + { + // Get an instance of Class + if(is_null(self::$instance)) self::$instance = new self(); + + // Return the instance + return self::$instance; + } + + public static function set($key, $value) + { + self::$cache[$key] = $value; + } + + public static function has($key) + { + return isset(self::$cache[$key]); + } + + public static function get($key) + { + return self::$cache[$key] ?? NULL; + } + + public static function delete($key) + { + if(MEC_cache::has($key)) + { + unset(self::$cache[$key]); + return true; + } + + return false; + } + + public function disable() + { + return self::$enabled = false; + } + + public function enable() + { + return self::$enabled = true; + } + + public function rememberOnce($key, $callback) + { + if($this->has($key) and self::$enabled) $data = $this->get($key); + else + { + $data = call_user_func($callback); + $this->set($key, $data); + } + + return $data; + } +} \ No newline at end of file diff --git a/app/libraries/captcha.php b/app/libraries/captcha.php new file mode 100755 index 0000000..a8f8e80 --- /dev/null +++ b/app/libraries/captcha.php @@ -0,0 +1,189 @@ + + */ +class MEC_captcha extends MEC_base +{ + const GOOGLE = 'grecaptcha'; + const MTCAPTCHA = 'mtcaptcha'; + + /** + * @var MEC_main + */ + public $main; + + /** + * @var array + */ + public $settings; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // MEC Main library + $this->main = $this->getMain(); + + // MEC settings + $this->settings = $this->main->get_settings(); + } + + public function assets() + { + // Captcha Client + $client = $this->client(); + + // Captcha is disabled + if(!$client) return false; + + // Current locale + $locale = $this->main->get_current_language(); + + // Google Recaptcha + if($client === self::GOOGLE) + { + // Include Google Recaptcha Javascript API + if(apply_filters('mec_grecaptcha_include', true)) wp_enqueue_script('recaptcha', '//www.google.com/recaptcha/api.js?hl='.str_replace('_', '-', $locale), array(), $this->main->get_version(), true); + } + elseif($client === self::MTCAPTCHA) + { + $ex = explode('_', $locale); + $lang_code = $ex[0]; + + add_action('wp_head', function() use ($lang_code) + { + ?> + + client(); + + // Captcha is disabled + if(!$client) return ''; + + // Google Recaptcha + if($client === self::GOOGLE) + { + return '
        +
        +
        '; + } + elseif($client === self::MTCAPTCHA) + { + return '
        +
        +
        '; + } + + return ''; + } + + public function is_valid() + { + // Captcha Client + $client = $this->client(); + + // Captcha is disabled + if(!$client) return false; + + // Google Recaptcha + if($client === self::GOOGLE) + { + $token = isset($_REQUEST['g-recaptcha-response']) ? sanitize_text_field($_REQUEST['g-recaptcha-response']) : NULL; + + $req = ""; + foreach([ + 'secret' => $this->settings['google_recaptcha_secretkey'] ?? '', + 'remoteip' => $this->main->get_client_ip(), + 'v' => 'php_1.0', + 'response' => $token + ] as $key=>$value) $req .= $key.'='.urlencode(stripslashes($value)).'&'; + + // Validate the re-captcha + $response = $this->main->get_web_page("https://www.google.com/recaptcha/api/siteverify?".trim($req, '& ')); + $answers = json_decode($response, true); + + if(isset($answers['success']) and trim($answers['success'])) return true; + else return false; + } + elseif($client === self::MTCAPTCHA) + { + $token = isset($_REQUEST['mtcaptcha-verifiedtoken']) ? sanitize_text_field($_REQUEST['mtcaptcha-verifiedtoken']) : NULL; + + // Validate the re-captcha + $response = $this->main->get_web_page("https://service.mtcaptcha.com/mtcv1/api/checktoken?privatekey=".urlencode(stripslashes($this->settings['mtcaptcha_privatekey']))."&token=".urlencode(stripslashes($token))); + $answers = json_decode($response, true); + + if(isset($answers['success']) and $answers['success']) return true; + else return false; + } + + return false; + } + + /** + * @param string $section + * @return bool + */ + public function status($section = '') + { + // Captcha Client + $client = $this->client(); + + // Captcha is disabled + if(!$client) return false; + + // Google Recaptcha + if($client === self::GOOGLE) + { + // Check if the feature is enabled for certain section + if(trim($section) and (!isset($this->settings['google_recaptcha_'.$section]) or (isset($this->settings['google_recaptcha_'.$section]) and !$this->settings['google_recaptcha_'.$section]))) return false; + + // Check if site key and secret key is not empty + if(!isset($this->settings['google_recaptcha_sitekey']) or (isset($this->settings['google_recaptcha_sitekey']) and trim($this->settings['google_recaptcha_sitekey']) === '')) return false; + if(!isset($this->settings['google_recaptcha_secretkey']) or (isset($this->settings['google_recaptcha_secretkey']) and trim($this->settings['google_recaptcha_secretkey']) === '')) return false; + } + elseif($client === self::MTCAPTCHA) + { + // Check if the feature is enabled for certain section + if(trim($section) and (!isset($this->settings['mtcaptcha_'.$section]) or (isset($this->settings['mtcaptcha_'.$section]) and !$this->settings['mtcaptcha_'.$section]))) return false; + + // Check if site key and secret key is not empty + if(!isset($this->settings['mtcaptcha_sitekey']) or (isset($this->settings['mtcaptcha_sitekey']) and trim($this->settings['mtcaptcha_sitekey']) === '')) return false; + if(!isset($this->settings['mtcaptcha_privatekey']) or (isset($this->settings['mtcaptcha_privatekey']) and trim($this->settings['mtcaptcha_privatekey']) === '')) return false; + } + + return true; + } + + public function client() + { + // Google Recaptcha + if(isset($this->settings['google_recaptcha_status']) and $this->settings['google_recaptcha_status']) return self::GOOGLE; + // MTCaptcha + elseif(isset($this->settings['mtcaptcha_status']) and $this->settings['mtcaptcha_status']) return self::MTCAPTCHA; + + return false; + } +} \ No newline at end of file diff --git a/app/libraries/cart.php b/app/libraries/cart.php new file mode 100755 index 0000000..e483a55 --- /dev/null +++ b/app/libraries/cart.php @@ -0,0 +1,257 @@ + + */ +class MEC_cart extends MEC_base +{ + /** + * @var MEC_main + */ + private $main; + private $settings; + private $ticket_names = []; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Main + $this->main = $this->getMain(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + } + + public function add($transaction_id) + { + $cart_id = $this->get_cart_id(); + + $cart = $this->get_cart($cart_id); + $cart[] = $transaction_id; + + $this->update_cart($cart_id, $cart); + + // Add to Ticket Names + $this->ticket_names = array_merge($this->ticket_names, $this->get_ticket_names($transaction_id)); + + return $this; + } + + public function remove($transaction_id) + { + $cart_id = $this->get_cart_id(); + + $cart = $this->get_cart($cart_id); + if(!in_array($transaction_id, $cart)) return false; + + $key = array_search($transaction_id, $cart); + if($key !== false) unset($cart[$key]); + + $this->update_cart($cart_id, $cart); + + return true; + } + + public function next() + { + $ticket_names = implode(', ', $this->ticket_names); + if(trim($ticket_names) === '') $ticket_names = esc_html__('Ticket', 'modern-events-calendar-lite'); + + // Checkout URL + if(isset($this->settings['cart_after_add']) and $this->settings['cart_after_add'] == 'checkout') return array('type' => 'url', 'url' => $this->get_checkout_url()); + // Optional Checkout URL + if(isset($this->settings['cart_after_add']) and $this->settings['cart_after_add'] == 'optional_cart') return array('type' => 'message', 'message' => '
        '); + // Optional Cart URL + if(isset($this->settings['cart_after_add']) and $this->settings['cart_after_add'] == 'optional_chckout') return array('type' => 'message', 'message' => '
        '); + // Cart URL + else return array('type' => 'url', 'url' => $this->get_cart_url()); + } + + public function get_cart($cart_id) + { + $cart = get_option('mec_cart_'.$cart_id, NULL); + if(is_null($cart)) + { + $cart = []; + update_option('mec_cart_'.$cart_id, $cart, false); + } + + if(!is_array($cart)) $cart = []; + return $cart; + } + + public function update_cart($cart_id, $value) + { + return update_option('mec_cart_'.$cart_id, $value, false); + } + + public function archive_cart($cart_id) + { + $value = $this->get_cart($cart_id); + return update_option('mec_cart_'.$cart_id.'_archived', $value, false); + } + + public function get_archived_cart($cart_id) + { + $cart = get_option('mec_cart_'.$cart_id.'_archived', NULL); + + if(!is_array($cart)) $cart = []; + return $cart; + } + + public function get_cart_id() + { + $cart_id = (isset($_COOKIE['mec_cart']) and trim($_COOKIE['mec_cart'])) ? sanitize_text_field($_COOKIE['mec_cart']) : NULL; + if(!$cart_id and !headers_sent()) $cart_id = $this->get_fresh_cart_id(); + + return $cart_id; + } + + public function get_fresh_cart_id() + { + $cart_id = mt_rand(100000000, 999999999); + setcookie('mec_cart', $cart_id, (time()+(30*86400)), '/'); + + return $cart_id; + } + + public function get_checkout_url() + { + $page_id = (isset($this->settings['checkout_page']) and trim($this->settings['checkout_page'])) ? $this->settings['checkout_page'] : NULL; + return ($page_id ? get_permalink($page_id) : home_url()); + } + + public function get_cart_url() + { + $page_id = (isset($this->settings['cart_page']) and trim($this->settings['cart_page'])) ? $this->settings['cart_page'] : NULL; + $language_codes_array = null; + $language_current_code = null; + if ( class_exists( 'TRP_Translate_Press' ) ){ + $trp = TRP_Translate_Press::get_trp_instance(); + $trp_settings = $trp->get_component( 'settings' ); + $language_codes_array = $trp_settings->get_settings()['publish-languages']; + $language_current_code = $_REQUEST['trp-form-language']; + } + + if(!empty($language_codes_array)){ + return home_url() . '/'.$language_current_code.str_replace(home_url(),'',get_permalink($page_id)); + }else{ + return ($page_id ? get_permalink($page_id) : home_url()); + } + } + + public function get_ticket_names($transaction_id) + { + $book = $this->getBook(); + $transaction = $book->get_transaction($transaction_id); + + $event_id = ((isset($transaction['event_id']) and $transaction['event_id']) ? $transaction['event_id'] : 0); + $tickets = ((isset($transaction['tickets']) and is_array($transaction['tickets'])) ? $transaction['tickets'] : array()); + + $event_tickets = get_post_meta($event_id, 'mec_tickets', true); + if(!is_array($event_tickets)) $event_tickets = []; + + $names = []; + foreach($tickets as $key => $ticket) + { + if(!is_numeric($key)) continue; + + $ticket_id = (isset($ticket['id']) and $ticket['id']) ? $ticket['id'] : 0; + if(!$ticket_id) continue; + + $ticket = $event_tickets[$ticket_id] ?? []; + $ticket_name = ($ticket['name'] ?? ''); + + if(trim($ticket_name)) $names[] = $ticket_name; + } + + return array_unique($names); + } + + public function get_payable($cart = NULL) + { + if(is_null($cart)) + { + $cart_id = $this->get_cart_id(); + $cart = $this->get_cart($cart_id); + } + + // Booking Library + $book = $this->getBook(); + + $payable = 0; + foreach($cart as $transaction_id) + { + $TO = $book->get_TO($transaction_id); + + $payable += $TO->get_payable(); + } + + return $payable; + } + + public function is_free($cart = NULL) + { + $payable = $this->get_payable($cart); + return !($payable > 0); + } + + public function clear($cart_id) + { + // Save it for future usage + $this->archive_cart($cart_id); + + // Make it empty + $this->update_cart($cart_id, array()); + + // New Cart ID + $this->get_fresh_cart_id(); + } + + public function get_first_event_id($cart = NULL) + { + if(is_null($cart)) + { + $cart_id = $this->get_cart_id(); + $cart = $this->get_cart($cart_id); + } + + // Booking Library + $book = $this->getBook(); + + $event_id = NULL; + foreach($cart as $transaction_id) + { + $TO = $book->get_TO($transaction_id); + + $event_id = $TO->get_event_id(); + break; + } + + return $event_id; + } + + public function get_invoice_link($cart_id) + { + if(isset($this->settings['mec_cart_invoice']) and !$this->settings['mec_cart_invoice']) return ''; + + $url = $this->main->URL(); + $url = $this->main->add_qs_var('method', 'mec-cart-invoice', $url); + + // Invoice Key + $url = $this->main->add_qs_var('mec-key', $cart_id, $url); + + return apply_filters('mec_cart_invoice_url', $url, $cart_id); + } + + public function is_done($cart_id) + { + return (bool) $this->get_archived_cart($cart_id); + } +} diff --git a/app/libraries/db.php b/app/libraries/db.php new file mode 100755 index 0000000..bd398dd --- /dev/null +++ b/app/libraries/db.php @@ -0,0 +1,240 @@ + + */ +class MEC_db extends MEC_base +{ + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + } + + /** + * Runs any query + * @author Webnus + * @param string $query + * @param string $type + * @return mixed + */ + public function q($query, $type = '') + { + // Apply DB prefix + $query = $this->_prefix($query); + + // Converts query type to lowercase + $type = strtolower($type); + + // Calls select function if query type is select + if($type == 'select') return $this->select($query); + + // Get WordPress DB object + $database = $this->get_DBO(); + + // If query type is insert, return the insert id + if($type == 'insert') + { + $database->query($query); + return $database->insert_id; + } + + // Run the query and return the result + return $database->query($query); + + } + + /** + * Returns records count of a query + * @author Webnus + * @param string $query + * @param string $table + * @return int + */ + public function num($query, $table = '') + { + // If table is filled, generate the query + if(trim($table) != '') $query = "SELECT COUNT(*) FROM `#__$table`"; + + // Apply DB prefix + $query = $this->_prefix($query); + + // Get WordPress Db object + $database = $this->get_DBO(); + return $database->get_var($query); + } + + /** + * Selects records from Database + * @author Webnus + * @param string $query + * @param string $result + * @return mixed + */ + public function select($query, $result = 'loadObjectList') + { + // Apply DB prefix + $query = $this->_prefix($query); + + // Get WordPress DB object + $database = $this->get_DBO(); + + if($result == 'loadObjectList') return $database->get_results($query, OBJECT_K); + elseif($result == 'loadObject') return $database->get_row($query, OBJECT); + elseif($result == 'loadAssocList') return $database->get_results($query, ARRAY_A); + elseif($result == 'loadAssoc') return $database->get_row($query, ARRAY_A); + elseif($result == 'loadResult') return $database->get_var($query); + elseif($result == 'loadColumn') return $database->get_col($query); + else return $database->get_results($query, OBJECT_K); + } + + /** + * Get a record from Database + * @author Webnus + * @param string|array $selects + * @param string $table + * @param string $field + * @param string $value + * @param boolean $return_object + * @param string $condition + * @return mixed + */ + public function get($selects, $table, $field, $value, $return_object = true, $condition = '') + { + $fields = ''; + + if(is_array($selects)) + { + foreach($selects as $select) $fields .= '`'.$select.'`,'; + $fields = trim($fields, ' ,'); + } + else + { + $fields = $selects; + } + + // Generate the condition + if(trim($condition) == '') $condition = "`$field`='".esc_sql($value)."'"; + + // Generate the query + $query = "SELECT $fields FROM `#__$table` WHERE $condition"; + + // Apply DB prefix + $query = $this->_prefix($query); + + // Get WordPress DB object + $database = $this->get_DBO(); + + if($selects != '*' and !is_array($selects)) return $database->get_var($query); + elseif($return_object) + { + return $database->get_row($query); + } + else + { + return $database->get_row($query, ARRAY_A); + } + } + + public function columns($table = 'mec_dates', $column = NULL) + { + if(trim($table) == '') return false; + + $query = "SHOW COLUMNS FROM `#__".$table."`"; + $results = $this->q($query, "select"); + + $columns = []; + foreach($results as $result) $columns[] = $result->Field; + + if(trim($column) and in_array($column, $columns)) return true; + elseif(trim($column)) return false; + + return $columns; + } + + /** + * Check if a table exist or not + * @param string $table + * @return bool + */ + public function exists($table) + { + $query = "SHOW TABLES LIKE '#__".$table."'"; + return (bool) $this->select($query, "loadObject"); + } + + /** + * Apply WordPress table prefix on queries + * @author Webnus + * @param string $query + * @return string + */ + public function _prefix($query) + { + // Get WordPress DB object + $wpdb = $this->get_DBO(); + + $charset = $wpdb->charset; + if(!trim($charset)) $charset = 'utf8'; + + $collate = $wpdb->collate; + if(!trim($collate)) + { + $charset = 'utf8'; + $collate = 'utf8_unicode_ci'; + } + + $query = str_replace('#__blogs', $wpdb->base_prefix.'blogs', $query); + $query = str_replace('#__', $wpdb->prefix, $query); + $query = str_replace('[:CHARSET:]', $charset, $query); + + return str_replace('[:COLLATE:]', $collate, $query); + } + + public function escape($parameter) + { + $database = $this->get_DBO(); + global $wp_version; + + if(is_array($parameter)) + { + $return_data = []; + foreach($parameter as $key=>$value) + { + $return_data[$key] = $this->escape($value); + } + } + else + { + if(version_compare($wp_version, '3.6', '<')) $return_data = $database->escape($parameter); + else $return_data = esc_sql($parameter); + } + + return $return_data; + } + + public function prepare($query, ...$args) + { + // Get WordPress DB object + $database = $this->get_DBO(); + + return $database->prepare($query, $args); + } + + /** + * Returns WordPres DB Object + * @author Webnus + * @global wpdb $wpdb + * @return wpdb + */ + public function get_DBO() + { + global $wpdb; + return $wpdb; + } +} \ No newline at end of file diff --git a/app/libraries/eventFields.php b/app/libraries/eventFields.php new file mode 100755 index 0000000..f8baf37 --- /dev/null +++ b/app/libraries/eventFields.php @@ -0,0 +1,131 @@ + + */ +class MEC_eventFields extends MEC_base +{ + /** + * @var MEC_main + */ + public $main; + public $settings; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Main + $this->main = $this->getMain(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + } + + public function form($args) + { + if(!isset($this->settings['display_event_fields_backend']) || $this->settings['display_event_fields_backend'] != 1) return; + + $id = $args['id'] ?? 'mec-event-data'; + $class = $args['class'] ?? 'mec-meta-box-fields mec-event-tab-content'; + $data = $args['data'] ?? []; + $name_prefix = $args['name_prefix'] ?? 'mec'; + $id_prefix = $args['id_prefix'] ?? 'mec_event_fields_'; + $mandatory_status = $args['mandatory_status'] ?? true; + + $event_fields = $this->main->get_event_fields(); + ?> +
        +

        + + $event_field): if(!is_numeric($j)) continue; ?> +
        + +
        + + +
        + +
        + + /> + + + /> + + + /> + + + min="1970-01-01" max="2099-12-31" /> + + + /> + + + + + $name_prefix.'[fields]['.esc_attr($j).']', + 'teeny' => true, + 'media_buttons' => false, + )); ?> + + '.do_shortcode(stripslashes($event_field['content'])).'

        '; + ?> + + + + + + + + + + + + + + +
        + +
        + + +
        + + + */ +class MEC_factory extends MEC_base +{ + public $main; + public $file; + public $folder; + public $db; + public $parser; + + /** + * @static + * @var array + */ + public static $params = []; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Load Vendors + require_once MEC_ABSPATH . 'app/vendor/autoload.php'; + + // MEC Main library + $this->main = $this->getMain(); + + // MEC File library + $this->file = $this->getFile(); + + // MEC Folder library + $this->folder = $this->getFolder(); + + // MEC DB library + $this->db = $this->getDB(); + + // MEC Parser library + $this->parser = $this->getParser(); + + // Import MEC Controller Class + $this->import('app.controller'); + } + + /** + * Register Webnus MEC actions + * @author Webnus + */ + public function load_actions() + { + // Set CronJobs + $this->action('admin_init', array($this, 'mec_add_cron_jobs'), 9999); + + // Register MEC function to be called in WordPress footer hook + $this->action('wp_footer', array($this, 'load_footer'), 9999); + $this->action('admin_footer', array($this, 'load_footer'), 9999); + + // Parse WordPress query + $this->action('parse_query', array($this->parser, 'WPQ_parse'), 99); + + // Add custom styles to header + $this->action('wp_head', array($this, 'include_styles'), 9999999999); + + if (!is_admin()) { + // MEC iCal export + $this->action('init', array($this->main, 'ical'), 9999); + + // MEC iCal export in email + $this->action('init', array($this->main, 'ical_email'), 999); + + // MEC Booking Invoice + $this->action('init', array($this->main, 'booking_invoice'), 9999); + + // MEC Cart Invoice + $this->action('init', array($this->main, 'cart_invoice'), 9999); + + // MEC Print Feature + $this->action('init', array($this->main, 'print_calendar'), 9999); + + // MEC Print Feature + $this->action('wp', array($this->main, 'booking_modal'), 9999); + + // Add Events to Tag Archive Page + $this->action('pre_get_posts', array($this->main, 'add_events_to_tags_archive')); + } + + // Redirect to MEC Dashboard + $this->action('admin_init', array($this->main, 'mec_redirect_after_activate')); + + // MEC booking verification and cancellation + $this->action('mec_before_main_content', array($this->main, 'do_endpoints'), 9999); + + // Add AJAX actions + $this->action('wp_ajax_mec_save_styles', array($this->main, 'save_options')); + $this->action('wp_ajax_mec_save_settings', array($this->main, 'save_options')); + $this->action('wp_ajax_mec_save_reg_form', array($this->main, 'save_options')); + $this->action('wp_ajax_mec_save_gateways', array($this->main, 'save_options')); + $this->action('wp_ajax_mec_save_styling', array($this->main, 'save_options')); + $this->action('wp_ajax_mec_save_notifications', array($this->main, 'save_notifications')); + $this->action('wp_ajax_mec_save_messages', array($this->main, 'save_messages')); + $this->action('wp_ajax_wizard_import_dummy_events', array($this->main, 'wizard_import_dummy_events')); + $this->action('wp_ajax_wizard_import_dummy_shortcodes', array($this->main, 'wizard_import_dummy_shortcodes')); + $this->action('wp_ajax_wizard_save_weekdays', array($this->main, 'save_wizard_options')); + $this->action('wp_ajax_wizard_save_slug', array($this->main, 'save_wizard_options')); + $this->action('wp_ajax_wizard_save_module', array($this->main, 'save_wizard_options')); + $this->action('wp_ajax_wizard_save_single', array($this->main, 'save_wizard_options')); + $this->action('wp_ajax_wizard_save_booking', array($this->main, 'save_wizard_options')); + $this->action('wp_ajax_wizard_save_styling', array($this->main, 'save_wizard_options')); + } + + /** + * Register Webnus MEC hooks such as activate, deactivate and uninstall hooks + * @author Webnus + */ + public function load_hooks() + { + register_activation_hook(MEC_ABSPATH . MEC_FILENAME, array($this, 'activate')); + register_deactivation_hook(MEC_ABSPATH . MEC_FILENAME, array($this, 'deactivate')); + } + + /** + * load MEC filters + * @author Webnus + */ + public function load_filters() + { + // Load MEC Plugin links + $this->filter('plugin_row_meta', array($this, 'load_plugin_links'), 10, 2); + $this->filter('plugin_action_links_' . plugin_basename(MEC_DIRNAME . DS . MEC_FILENAME), array($this, 'load_plugin_action_links'), 10, 1); + + // Add MEC rewrite rules + $this->filter('generate_rewrite_rules', array($this->parser, 'load_rewrites')); + $this->filter('query_vars', array($this->parser, 'add_query_vars')); + + // Manage MEC templates + $this->filter('template_include', array($this->parser, 'template'), 99); + + // Fetch Googlemap style JSON + $this->filter('mec_get_googlemap_style', array($this->main, 'fetch_googlemap_style')); + + // Filter Request + $this->filter('request', array($this->main, 'filter_request')); + + // Block Editor Category + if (function_exists('register_block_type')) $this->filter('block_categories_all', array($this->main, 'add_custom_block_cateogry'), 9999); + + // Add Taxonomy etc to filters + $this->filter('mec_vyear_atts', array($this->main, 'add_search_filters')); + $this->filter('mec_vmonth_atts', array($this->main, 'add_search_filters')); + $this->filter('mec_vweek_atts', array($this->main, 'add_search_filters')); + $this->filter('mec_vday_atts', array($this->main, 'add_search_filters')); + $this->filter('mec_vfull_atts', array($this->main, 'add_search_filters')); + $this->filter('mec_vmap_atts', array($this->main, 'add_search_filters')); + $this->filter('mec_vlist_atts', array($this->main, 'add_search_filters')); + $this->filter('mec_vgrid_atts', array($this->main, 'add_search_filters')); + $this->filter('mec_vtimetable_atts', array($this->main, 'add_search_filters')); + $this->filter('mec_vmasonry_atts', array($this->main, 'add_search_filters')); + $this->filter('mec_vagenda_atts', array($this->main, 'add_search_filters')); + $this->filter('mce_buttons', array($this->main, 'add_mce_buttons')); + $this->filter('mce_external_plugins', array($this->main, 'add_mce_external_plugins')); + + $this->filter('pre_get_document_title', array($this->parser, 'archive_document_title')); + } + + /** + * load MEC menus + * @author Webnus + */ + public function load_menus() + { + add_menu_page( + __('M.E. Calendar', 'modern-events-calendar-lite'), + esc_html__('M.E. Calendar', 'modern-events-calendar-lite'), + apply_filters('mec_menu_cap', 'edit_posts', 'mec-intro'), + 'mec-intro', + array($this->main, 'dashboard'), + plugin_dir_url(__FILE__) . '../../assets/img/mec.svg', + 26 + ); + } + + /** + * load MEC Features + * @author Webnus + */ + public function load_features() + { + $path = MEC_ABSPATH . 'app' . DS . 'features' . DS; + $files = $this->folder->files($path, '.php$'); + + foreach ($files as $file) { + $name = str_replace('.php', '', $file); + + $class = 'MEC_feature_' . $name; + MEC::getInstance('app.features.' . $name, $class); + + if (!class_exists($class)) continue; + + $object = new $class(); + $object->init(); + } + } + + /** + * Inserting MEC plugin links + * @author Webnus + * @param array $links + * @param string $file + * @return array + */ + public function load_plugin_links($links, $file) + { + if (strpos($file, MEC_DIRNAME) !== false) { + if (!$this->getPRO()) { + $upgrade = '' . _x('Upgrade to Pro Version', 'plugin link', 'modern-events-calendar-lite') . ''; + $links[] = $upgrade; + } + } + + return $links; + } + + /** + * Load MEC plugin action links + * @author Webnus + * @param array $links + * @return array + */ + public function load_plugin_action_links($links) + { + $settings = '' . _x('Settings', 'plugin link', 'modern-events-calendar-lite') . ''; + array_unshift($links, $settings); + + if (!$this->getPRO()) { + $upgrade = '' . _x('Upgrade', 'plugin link', 'modern-events-calendar-lite') . ''; + array_unshift($links, $upgrade); + } + + return $links; + } + + public function register_styles_and_scripts() + { + + // Get Current Screen + global $current_screen; + if (!isset($current_screen) && function_exists('get_current_screen')) $current_screen = get_current_screen(); + + $backend_js_dependencies = array( + 'jquery', + 'wp-color-picker', + 'jquery-ui-datepicker', + ); + if (is_a($current_screen, '\WP_Screen') && method_exists($current_screen, 'is_block_editor') and $current_screen->is_block_editor()) { + $backend_js_dependencies[] = 'wp-blocks'; + } + + $js_dependencies = array( + 'jquery', + ); + $scripts = array( + 'mec-typekit-script' => $this->main->asset('js/jquery.typewatch.js'), + 'mec-niceselect-script' => $this->main->asset('js/jquery.nice-select.min.js'), + 'mec-select2-script' => $this->main->asset('packages/select2/select2.full.min.js'), + 'mec-lity-script' => $this->main->asset('packages/lity/lity.min.js'), + 'mec-nice-scroll' => $this->main->asset('js/jquery.nicescroll.min.js'), + 'featherlight' => $this->main->asset('packages/featherlight/featherlight.js'), + 'mec-owl-carousel-script' => $this->main->asset('packages/owl-carousel/owl.carousel.min.js'), + 'mec-backend-script' => array( + 'src' => $this->main->asset('js/backend.js'), + 'deps' => $backend_js_dependencies, + 'in_footer' => false, + ), + 'mec-events-script' => $this->main->asset('js/events.js'), /// dep in front 'mec-frontend-script' + 'mec-general-calendar-script' => $this->main->asset('js/mec-general-calendar.js'), + 'mec-tooltip-script' => $this->main->asset('packages/tooltip/tooltip.js'), + 'mec-shuffle-script' => $this->main->asset('js/shuffle.min.js'), + 'mec-frontend-script' => array( + 'src' => $this->main->asset('js/frontend.js'), + 'deps' => array( + 'jquery', + 'mec-tooltip-script' + ), + ), + 'mec-colorbrightness-script' => $this->main->asset('packages/colorbrightness/colorbrightness.min.js'), + 'mec-chartjs-script' => $this->main->asset('js/chartjs.min.js'), + 'mec-date-format-script' => $this->main->asset('js/date.format.min.js'), + ); + + if (is_plugin_active('mec-single-builder/mec-single-builder.php')) { + $scripts['mec-flipcount-script'] = $this->main->asset('js/flipcount.js'); + } elseif (is_plugin_active('divi-single-builder/divi-single-builder.php') || is_plugin_active('mec-divi-single-builder/divi-single-builder.php')) { + $scripts['mec-flipcount-script'] = $this->main->asset('js/flipcount-divi.js'); + } else { + $scripts['mec-flipcount-script'] = $this->main->asset('js/flipcount.js'); + } + + foreach ($scripts as $script_id => $script) { + + $src = is_array($script) ? $script['src'] : $script; + $deps = is_array($script) && isset($script['deps']) ? $script['deps'] : $js_dependencies; + $version = $this->main->get_version(); + $in_footer = is_array($script) && isset($script['in_footer']) ? $script['in_footer'] : true; + + wp_register_script($script_id, $src, $deps, $version, $in_footer); + } + + $backend_css_dependencies = array( + 'wp-color-picker', + ); + $css_dependencies = array(); + $styles = array( + 'mec-select2-style' => $this->main->asset('packages/select2/select2.min.css'), + 'featherlight' => $this->main->asset('packages/featherlight/featherlight.css'), + 'mec-font-icons' => $this->main->asset('css/iconfonts.css'), + 'mec-backend-rtl-style' => $this->main->asset('css/mecrtl.min.css'), + 'mec-backend-style' => array( + 'src' => $this->main->asset('css/backend.min.css'), + 'deps' => $backend_css_dependencies, + ), + 'mec-lity-style' => $this->main->asset('packages/lity/lity.min.css'), + 'mec-owl-carousel-style' => $this->main->asset('packages/owl-carousel/owl.carousel.min.css'), + 'mec-niceselect-style' => $this->main->asset('css/nice-select.min.css'), + + 'mec-frontend-style' => $this->main->asset('css/frontend.min.css'), + 'accessibility' => $this->main->asset('css/a11y.min.css'), + 'mec-tooltip-style' => $this->main->asset('packages/tooltip/tooltip.css'), + 'mec-tooltip-shadow-style' => $this->main->asset('packages/tooltip/tooltipster-sideTip-shadow.min.css'), + 'mec-general-calendar-style' => $this->main->asset('css/mec-general-calendar.css'), + 'mec-google-fonts' => '//fonts.googleapis.com/css?family=Montserrat:400,700|Roboto:100,300,400,700', + 'mec-custom-google-font' => get_option('mec_gfont'), + ); + foreach ($styles as $style_id => $style) { + + $src = is_array($style) ? $style['src'] : $style; + $deps = is_array($style) && isset($style['deps']) ? $style['deps'] : $css_dependencies; + $version = $this->main->get_version(); + + wp_register_style($style_id, $src, $deps, $version); + } + + // Settings + $settings = $this->main->get_settings(); + wp_localize_script('mec-backend-script', 'mec_admin_localize', array( + 'ajax_url' => admin_url('admin-ajax.php'), + 'ajax_nonce' => wp_create_nonce('mec_settings_nonce'), + 'mce_items' => $this->main->mce_get_shortcode_list(), + 'datepicker_format' => (isset($settings['datepicker_format']) and trim($settings['datepicker_format'])) ? trim($settings['datepicker_format']) : 'yy-mm-dd', + )); + + if (did_action('elementor/loaded')) $elementor_edit_mode = !\Elementor\Plugin::$instance->editor->is_edit_mode() ? 'no' : 'yes'; + else $elementor_edit_mode = 'no'; + + // Settings + $grecaptcha_key = isset($settings['google_recaptcha_sitekey']) ? trim($settings['google_recaptcha_sitekey']) : ''; + $fes_thankyou_page_time = (isset($settings['fes_thankyou_page_time']) and trim($settings['fes_thankyou_page_time']) != '') ? (int) $settings['fes_thankyou_page_time'] : 2000; + + // Localize Some Strings + $mecdata = apply_filters('mec_locolize_data', array( + 'day' => __('day', 'modern-events-calendar-lite'), + 'days' => __('days', 'modern-events-calendar-lite'), + 'hour' => __('hour', 'modern-events-calendar-lite'), + 'hours' => __('hours', 'modern-events-calendar-lite'), + 'minute' => __('minute', 'modern-events-calendar-lite'), + 'minutes' => __('minutes', 'modern-events-calendar-lite'), + 'second' => __('second', 'modern-events-calendar-lite'), + 'seconds' => __('seconds', 'modern-events-calendar-lite'), + 'next' => __('Next', 'modern-events-calendar-lite'), + 'prev' => __('Prev', 'modern-events-calendar-lite'), + 'elementor_edit_mode' => $elementor_edit_mode, + 'recapcha_key' => $grecaptcha_key, + 'ajax_url' => admin_url('admin-ajax.php'), + 'fes_nonce' => wp_create_nonce('mec_fes_nonce'), + 'fes_thankyou_page_time' => $fes_thankyou_page_time, + 'fes_upload_nonce' => wp_create_nonce('mec_fes_upload_featured_image'), + 'current_year' => date('Y', current_time('timestamp', 0)), + 'current_month' => date('m', current_time('timestamp', 0)), + 'datepicker_format' => (isset($settings['datepicker_format']) and trim($settings['datepicker_format'])) ? trim($settings['datepicker_format']) : 'yy-mm-dd', + )); + + // Localize Some Strings + wp_localize_script('mec-frontend-script', 'mecdata', $mecdata); + } + + /** + * Load MEC Backend assets such as CSS or JavaScript files + * @author Webnus + */ + public function load_backend_assets() + { + if ($this->should_include_assets('backend')) { + // Get Current Screen + global $current_screen; + if (!isset($current_screen)) $current_screen = get_current_screen(); + + // Styling + $styling = $this->main->get_styling(); + + // Include MEC typekit script file + wp_enqueue_script('mec-typekit-script'); + + //Include the nice-select + wp_enqueue_script('mec-niceselect-script'); + + //Include Select2 + wp_enqueue_script('mec-select2-script'); + wp_enqueue_style('mec-select2-style'); + + // Include Lity Lightbox + wp_enqueue_script('mec-lity-script'); + + // Include Nicescroll + wp_enqueue_script('mec-nice-scroll'); + + wp_enqueue_style('featherlight'); + wp_enqueue_script('featherlight'); + + // Include MEC Carousel JS libraries + wp_enqueue_script('mec-owl-carousel-script'); + + // Backend Dependencies + $dependencies = array('jquery', 'wp-color-picker', 'jquery-ui-datepicker'); + + // Add WP Blocks to the dependencies only when needed! + if (method_exists($current_screen, 'is_block_editor') and $current_screen->is_block_editor()) $dependencies[] = 'wp-blocks'; + + // Register New Block Editor + if (function_exists('register_block_type')) register_block_type('mec/blockeditor', array('editor_script' => 'block.editor')); + + // Include MEC backend script file + wp_enqueue_script('mec-backend-script'); + + // Settings + $settings = $this->main->get_settings(); + + wp_localize_script('mec-backend-script', 'mec_admin_localize', array( + 'ajax_url' => admin_url('admin-ajax.php'), + 'ajax_nonce' => wp_create_nonce('mec_settings_nonce'), + 'mce_items' => $this->main->mce_get_shortcode_list(), + 'datepicker_format' => (isset($settings['datepicker_format']) and trim($settings['datepicker_format'])) ? trim($settings['datepicker_format']) : 'yy-mm-dd', + )); + + wp_enqueue_script('mec-events-script'); + + // Thickbox + wp_enqueue_media(); + + // WP Editor + wp_enqueue_editor(); + + // MEC Icons + wp_enqueue_style('mec-font-icons'); + + // Include "Right to Left" CSS file + if (is_rtl()) wp_enqueue_style('mec-backend-rtl-style'); + + // Include Lity CSS file + wp_enqueue_style('mec-lity-style'); + } + + // Include MEC backend CSS + wp_enqueue_style('mec-backend-style'); + + if (isset($styling) and isset($styling['accessibility']) && $styling['accessibility']) wp_enqueue_style('mec-backend-accessibility', $this->main->asset('css/a11y-backend.min.css'), $this->main->get_version()); + } + + /** + * Load MEC frontend assets such as CSS or JavaScript files + * @author Webnus + */ + public function load_frontend_assets() + { + if ($this->should_include_assets('frontend')) { + // Styling + $styling = $this->main->get_styling(); + + // Google Fonts Status + $gfonts_status = !(isset($styling['disable_gfonts']) and $styling['disable_gfonts']); + + // Include WordPress jQuery + wp_enqueue_script('jquery'); + + // Include jQuery date picker + if (!defined("SHOW_CT_BUILDER")) wp_enqueue_script('jquery-ui-datepicker'); + + // Load Isotope + if (class_exists('ET_Builder_Element')) $this->main->load_isotope_assets(); + + include_once(ABSPATH . 'wp-admin/includes/plugin.php'); + if (is_plugin_active('elementor/elementor.php') && class_exists('\Elementor\Plugin') && \Elementor\Plugin::$instance->preview->is_preview_mode()) $this->main->load_isotope_assets(); + + wp_enqueue_script('mec-typekit-script'); + wp_enqueue_script('featherlight'); + + // Include Select2 + wp_enqueue_script('mec-select2-script'); + wp_enqueue_style('mec-select2-style'); + + // General Calendar + wp_enqueue_script('mec-general-calendar-script'); + + // Include MEC frontend script files + wp_enqueue_script('mec-tooltip-script'); + wp_enqueue_script('mec-frontend-script'); + + wp_enqueue_script('mec-events-script'); + + // Include Lity Lightbox + wp_enqueue_script('mec-lity-script'); + + // Include color brightness + wp_enqueue_script('mec-colorbrightness-script'); + + // Include MEC frontend JS libraries + wp_enqueue_script('mec-owl-carousel-script'); + + if (did_action('elementor/loaded')) $elementor_edit_mode = !\Elementor\Plugin::$instance->editor->is_edit_mode() ? 'no' : 'yes'; + else $elementor_edit_mode = 'no'; + + // Settings + $settings = $this->main->get_settings(); + $grecaptcha_key = isset($settings['google_recaptcha_sitekey']) ? trim($settings['google_recaptcha_sitekey']) : ''; + $fes_thankyou_page_time = (isset($settings['fes_thankyou_page_time']) and trim($settings['fes_thankyou_page_time']) != '') ? (int) $settings['fes_thankyou_page_time'] : 2000; + + // Localize Some Strings + $mecdata = apply_filters('mec_locolize_data', array( + 'day' => __('day', 'modern-events-calendar-lite'), + 'days' => __('days', 'modern-events-calendar-lite'), + 'hour' => __('hour', 'modern-events-calendar-lite'), + 'hours' => __('hours', 'modern-events-calendar-lite'), + 'minute' => __('minute', 'modern-events-calendar-lite'), + 'minutes' => __('minutes', 'modern-events-calendar-lite'), + 'second' => __('second', 'modern-events-calendar-lite'), + 'seconds' => __('seconds', 'modern-events-calendar-lite'), + 'next' => __('Next', 'modern-events-calendar-lite'), + 'prev' => __('Prev', 'modern-events-calendar-lite'), + 'elementor_edit_mode' => $elementor_edit_mode, + 'recapcha_key' => $grecaptcha_key, + 'ajax_url' => admin_url('admin-ajax.php'), + 'fes_nonce' => wp_create_nonce('mec_fes_nonce'), + 'fes_thankyou_page_time' => $fes_thankyou_page_time, + 'fes_upload_nonce' => wp_create_nonce('mec_fes_upload_featured_image'), + 'current_year' => date('Y', current_time('timestamp', 0)), + 'current_month' => date('m', current_time('timestamp', 0)), + 'datepicker_format' => (isset($settings['datepicker_format']) and trim($settings['datepicker_format'])) ? trim($settings['datepicker_format']) : 'yy-mm-dd', + )); + + // Localize Some Strings + wp_localize_script('mec-frontend-script', 'mecdata', $mecdata); + + // Include Security Captcha Assets + $this->getCaptcha()->assets(); + + // Include MEC frontend CSS files + wp_enqueue_style('mec-font-icons'); + wp_enqueue_style('mec-frontend-style'); + if (isset($styling['accessibility']) && $styling['accessibility']) wp_enqueue_style('accessibility'); + + wp_enqueue_style('mec-tooltip-style'); + wp_enqueue_style('mec-tooltip-shadow-style'); + wp_enqueue_style('featherlight', $this->main->asset('packages/featherlight/featherlight.css')); + + // Include "Right to Left" CSS file + if (is_rtl()) wp_enqueue_style('mec-frontend-rtl-style'); + + // Include Google Fonts + if ($gfonts_status and get_option('mec_dyncss') == 0) wp_enqueue_style('mec-google-fonts'); + + // Include Google Font + if ($gfonts_status and get_option('mec_gfont')) wp_enqueue_style('mec-custom-google-font'); + + // Include Lity CSS file + wp_enqueue_style('mec-lity-style'); + + // General Calendar + wp_enqueue_style('mec-general-calendar-style'); + } + } + + /** + * Prints custom styles in the page header + * @author Webnus + * @return void + */ + public function include_styles() + { + if ($this->should_include_assets('frontend')) { + // Include Dynamic CSS + if (get_option('mec_dyncss')) { + echo ''; + } + + $styles = $this->main->get_styles(); + + // Print custom styles + if (isset($styles['CSS']) and trim($styles['CSS']) != '') { + $CSS = strip_tags($styles['CSS']); + echo ''; + } + } + } + + /** + * Load MEC widget + * @author Webnus + */ + public function load_widgets() + { + // register mec side bar + register_sidebar(array( + 'id' => 'mec-single-sidebar', + 'name' => esc_html__('MEC Single Sidebar', 'modern-events-calendar-lite'), + 'description' => esc_html__('Custom sidebar for single and modal page of MEC.', 'modern-events-calendar-lite'), + 'before_widget' => '
        ', + 'after_widget' => '
        ', + 'before_title' => '

        ', + 'after_title' => '

        ' + )); + + // Import MEC Widget Class + $this->import('app.widgets.MEC'); + $this->import('app.widgets.single'); + + register_widget('MEC_MEC_widget'); + register_widget('MEC_single_widget'); + } + + /** + * Register MEC shortcode in WordPress + * @author Webnus + */ + public function load_shortcodes() + { + // MEC Render library + $render = $this->getRender(); + + // Events Archive Page + $this->shortcode('MEC', array($render, 'shortcode')); + + // Event Single Page + $this->shortcode('MEC_single', array($render, 'vsingle')); + + // MEC Render library + $book = $this->getBook(); + + // Booking Invoice + $this->shortcode('MEC_invoice_link', array($book, 'invoice_link_shortcode')); + } + + /** + * Load dynamic css + * @author Webnus + */ + public function mec_dyncss() + { + // Import Dynamic CSS codes + $path = $this->import('app.features.mec.dyncss', true, true); + + ob_start(); + include $path; + echo ob_get_clean(); + } + + /** + * Load MEC skins in WordPress + * @author Webnus + */ + public function load_skins() + { + // Import MEC skins Class + $this->import('app.libraries.skins'); + + $MEC_skins = new MEC_skins(); + $MEC_skins->load(); + } + + /** + * Register MEC addons in WordPress + * @author Webnus + */ + public function load_addons() + { + // Import MEC VC addon + $this->import('app.addons.VC'); + + $MEC_addon_VC = new MEC_addon_VC(); + $MEC_addon_VC->init(); + + // Import MEC KC addon + $this->import('app.addons.KC'); + + $MEC_addon_KC = new MEC_addon_KC(); + $MEC_addon_KC->init(); + + // Import MEC Elementor addon + $this->import('app.addons.elementor'); + $MEC_addon_elementor = new MEC_addon_elementor(); + $MEC_addon_elementor->init(); + + // Import MEC Elementor addon + $this->import('app.addons.avada'); + $MEC_addon_avada = new MEC_addon_avada(); + $MEC_addon_avada->init(); + + // Import MEC Divi addon + $this->import('app.addons.divi'); + $MEC_addon_divi = new MEC_addon_divi(); + $MEC_addon_divi->init(); + + // Import MEC Beaver Builder addon + $this->import('app.addons.beaver'); + $MEC_addon_beaver = new MEC_addon_beaver(); + $MEC_addon_beaver->init(); + + // Import MEC LearnDash addon + $this->import('app.addons.learndash'); + $MEC_addon_LD = new MEC_addon_learndash(); + $MEC_addon_LD->init(); + + // Import MEC PaidMembership Pro addon + $this->import('app.addons.PMP'); + $MEC_addon_PMP = new MEC_addon_PMP(); + $MEC_addon_PMP->init(); + + // Import The Newsletter Plugin addon + $this->import('app.addons.TNP'); + $MEC_addon_TNP = new MEC_addon_TNP(); + $MEC_addon_TNP->init(); + + // Import ACF addon + $this->import('app.addons.ACF'); + $MEC_addon_ACF = new MEC_addon_ACF(); + $MEC_addon_ACF->init(); + } + + /** + * Initialize MEC Auto Update Feature + * @author Webnus + */ + public function load_auto_update() + { + $options = get_option('mec_options'); + $product_name = !empty($options['product_name']) ? esc_html__($options['product_name']) : ''; + $product_id = !empty($options['product_id']) ? esc_html__($options['product_id']) : ''; + $purchase_code = !empty($options['purchase_code']) ? esc_html__($options['purchase_code']) : ''; + $url = urlencode(get_home_url()); + + require_once MEC_ABSPATH . 'app/core/puc/plugin-update-checker.php'; + if (!$this->getPRO()) { + $MyUpdateChecker = Puc_v4_Factory::buildUpdateChecker( + add_query_arg(array('purchase_code' => '', 'url' => '', 'id' => '', 'category' => 'mec'), MEC_API_UPDATE . '/updates/?action=get_metadata&slug=modern-events-calendar-lite'), //Metadata URL. + MEC_ABSPATH . 'modern-events-calendar-lite.php', //Full path to the main plugin file. + 'modern-events-calendar-lite', //Plugin slug. Usually it's the same as the name of the directory. + 24 + ); + } else { + $MyUpdateChecker = Puc_v4_Factory::buildUpdateChecker( + add_query_arg(array('purchase_code' => $purchase_code, 'url' => $url, 'id' => $product_id, 'category' => 'mec'), MEC_API_UPDATE . '/updates/?action=get_metadata&slug=modern-events-calendar'), //Metadata URL. + MEC_ABSPATH . 'mec.php', //Full path to the main plugin file. + 'mec', //Plugin slug. Usually it's the same as the name of the directory. + 24 + ); + } + + $name = $this->getPRO() ? 'mec' : 'modern-events-calendar-lite'; + add_filter('puc_request_info_result-' . $name, function ($info) { + if (!$info) return; + + unset($info->sections['installation']); + unset($info->sections['faq']); + unset($info->sections['screenshots']); + unset($info->sections['wordpress_event_calendar']); + unset($info->sections['best_wordpress_event_management_plugin']); + unset($info->sections['new_designed_beautiful_event_view_layouts:']); + unset($info->sections['covid-19_(coronavirus)']); + unset($info->sections['10_best_event_calendar_plugins_and_themes_for_wordpress_2020']); + unset($info->sections['experts_opinions']); + unset($info->sections['some_new_features']); + unset($info->sections['user_reviews']); + unset($info->sections['convert_your_events_in_a_few_seconds']); + unset($info->sections['virtual_events_addon']); + unset($info->sections['main_features']); + unset($info->sections['integration']); + unset($info->sections['key_features']); + unset($info->sections['addons']); + unset($info->sections['screenshots']); + unset($info->sections['helpful_documentation']); + unset($info->sections['developers']); + unset($info->sections['frequently_asked_questions']); + + return $info; + }); + } + + /** + * Add strings (CSS, JavaScript, etc.) to website sections such as footer etc. + * @author Webnus + * @param string $key + * @param string|closure $string + * @return boolean + */ + public function params($key, $string) + { + $key = (string) $key; + + if ($string instanceof Closure) { + ob_start(); + call_user_func($string); + $string = ob_get_clean(); + } + + $string = (string) $string; + + // No Key or No String + if (trim($string) == '' or trim($key) == '') return false; + + // Register the key for removing PHP notices + if (!isset(self::$params[$key])) self::$params[$key] = []; + + // Add it to the MEC params + array_push(self::$params[$key], $string); + return true; + } + + public function printOnAjaxOrFooter($string) + { + if ($string instanceof Closure) { + ob_start(); + call_user_func($string); + $string = ob_get_clean(); + } + + if (defined('DOING_AJAX') && DOING_AJAX) echo $string; + else $this->params('footer', $string); + } + + /** + * Insert MEC assets into the website footer + * @author Webnus + * @return void + */ + public function load_footer() + { + if (!isset(self::$params['footer']) or (isset(self::$params['footer']) and !count(self::$params['footer']))) return; + + // Remove duplicate strings + $strings = array_unique(self::$params['footer']); + + // Print the assets in the footer + foreach ($strings as $string) echo PHP_EOL . $string . PHP_EOL; + } + + /** + * Add MEC actions to WordPress + * @author Webnus + * @param string $hook + * @param string|array|Closure $function + * @param int $priority + * @param int $accepted_args + * @return boolean + */ + public function action($hook, $function, $priority = 10, $accepted_args = 1) + { + // Check Parameters + if (!trim($hook) or !$function) return false; + + // Add it to WordPress actions + return add_action($hook, $function, $priority, $accepted_args); + } + + /** + * Add MEC filters to WordPress filters + * @author Webnus + * @param string $tag + * @param string|array $function + * @param int $priority + * @param int $accepted_args + * @return boolean + */ + public function filter($tag, $function, $priority = 10, $accepted_args = 1) + { + // Check Parameters + if (!trim($tag) or !$function) return false; + + // Add it to WordPress filters + return add_filter($tag, $function, $priority, $accepted_args); + } + + /** + * Add MEC shortcodes to WordPress shortcodes + * @author Webnus + * @param string $shortcode + * @param string|array $function + * @return boolean + */ + public function shortcode($shortcode, $function) + { + // Check Parameters + if (!trim($shortcode) or !$function) return false; + + // Add it to WordPress shortcodes + add_shortcode($shortcode, $function); + return true; + } + + /** + * Runs on plugin activation + * @author Webnus + * @param boolean $network + * @return boolean + */ + public function activate($network = false) + { + // Redirect user to MEC Dashboard + add_option('mec_activation_redirect', true); + + // Uninstall Hook + register_uninstall_hook(MEC_ABSPATH . MEC_FILENAME, array('MEC_factory', 'uninstall')); + + $current_blog_id = get_current_blog_id(); + + // Plugin activated only for one blog + if (!function_exists('is_multisite') or (function_exists('is_multisite') and !is_multisite())) $network = false; + if (!$network) { + // Refresh WordPress rewrite rules + $this->main->flush_rewrite_rules(); + + return $this->install($current_blog_id); + } + + // Plugin activated for all blogs + $blogs = $this->db->select("SELECT `blog_id` FROM `#__blogs`", 'loadColumn'); + foreach ($blogs as $blog_id) { + switch_to_blog($blog_id); + $this->install($blog_id); + } + + switch_to_blog($current_blog_id); + + // Refresh WordPress rewrite rules + $this->main->flush_rewrite_rules(); + return true; + } + + /** + * Runs on plugin deactivation + * @author Webnus + * @param boolean $network + * @return void + */ + public function deactivate($network = false) + { + $this->main->flush_rewrite_rules(); + + // Clear Scheduler Cronjob + wp_clear_scheduled_hook('mec_scheduler'); + wp_clear_scheduled_hook('mec_syncScheduler'); + } + + /** + * Runs on plugin uninstallation + * @author Webnus + * @return boolean + */ + public static function uninstall() + { + // Main Object + $main = MEC::getInstance('app.libraries.main'); + + // Database Object + $db = MEC::getInstance('app.libraries.db'); + + // Refresh WordPress rewrite rules + $main->flush_rewrite_rules(); + + // Getting current blog + $current_blog_id = get_current_blog_id(); + + if (!function_exists('is_multisite') or (function_exists('is_multisite') and !is_multisite())) return self::purge($current_blog_id); + + // Plugin activated for all blogs + $blogs = $db->select("SELECT `blog_id` FROM `#__blogs`", 'loadColumn'); + foreach ($blogs as $blog_id) { + switch_to_blog($blog_id); + self::purge($blog_id); + } + + // Switch back to current blog + switch_to_blog($current_blog_id); + return true; + } + + /** + * Install the plugin on s certain blog + * @author Webnus + * @param int $blog_id + */ + public function install($blog_id = 1) + { + // Plugin installed before + if (get_option('mec_installed', 0)) { + // Create mec_events table if it's removed for any reason + $this->main->create_mec_tables(); + + return; + } + + // Run Queries + $query_file = MEC_ABSPATH . 'assets' . DS . 'sql' . DS . 'install.sql'; + if ($this->file->exists($query_file)) { + $queries = $this->file->read($query_file); + $sqls = explode(';', $queries); + + foreach ($sqls as $sql) { + $sql = trim($sql, '; '); + if (trim($sql) == '') continue; + + $sql .= ';'; + + try { + $this->db->q($sql); + } catch (Exception $e) { + } + } + } + + // Default Options + $options = array( + 'settings' => array( + 'multiple_day_show_method' => 'first_day_listgrid', + 'google_maps_status' => 1, + 'export_module_status' => 1, + 'sn' => array('googlecal' => 1, 'ical' => 1, 'facebook' => 1, 'gplus' => 1, 'twitter' => 1, 'linkedin' => 1, 'email' => 1), + 'countdown_status' => 1, + 'social_network_status' => 1, + 'default_skin_archive' => 'full_calendar', + ), + 'styles' => array('CSS' => ''), + 'gateways' => array(1 => array('status' => 1)), + 'notifications' => array( + 'booking_notification' => array( + 'subject' => 'Your booking is received.', + 'recipients' => '', + 'content' => "Hello %%name%%, + + Your booking is received. We will check and confirm your booking as soon as possible. + Thanks for your patience. + + Regards, + %%blog_name%%" + ), + 'email_verification' => array( + 'subject' => 'Please verify your booking.', + 'recipients' => '', + 'content' => "Hi %%name%%, + + Please verify your booking by clicking on following link: + + %%verification_link%% + + Regards, + %%blog_name%%" + ), + 'booking_confirmation' => array( + 'subject' => 'Your booking is confirmed.', + 'recipients' => '', + 'content' => "Hi %%name%%, + + Your booking is confirmed. You should be available at %%book_date%% in %%event_location_address%%. + + You can contact to event organizer by calling %%event_organizer_tel%%. + + Regards, + %%blog_name%%" + ), + 'cancellation_notification' => array( + 'status' => '0', + 'subject' => 'Your booking is canceled.', + 'recipients' => '', + 'send_to_admin' => '1', + 'send_to_organizer' => '0', + 'send_to_user' => '0', + 'content' => "Hi %%name%%, + + For your information, your booking for %%event_title%% at %%book_date%% is canceled. + + Regards, + %%blog_name%%" + ), + 'admin_notification' => array( + 'subject' => 'A new booking is received.', + 'recipients' => '', + 'content' => "Dear Admin, + + A new booking is received. Please check and confirm it as soon as possible. + + %%admin_link%% + + %%attendees_full_info%% + + Regards, + %%blog_name%%" + ), + 'new_event' => array( + 'status' => '1', + 'subject' => 'A new event is added.', + 'recipients' => '', + 'content' => "Hello, + + A new event just added. The event title is %%event_title%% and its status is %%event_status%%. + The new event may need to be published. Please use this link for managing your website events: %%admin_link%% + + Regards, + %%blog_name%%" + ), + 'user_event_publishing' => array( + 'status' => '1', + 'subject' => 'Your event gets published', + 'recipients' => '', + 'content' => "Hello %%name%%, + + Your event gets published. You can check it below: + + %%event_title%% + + Regards, + %%blog_name%%" + ), + 'event_soldout' => array( + 'status' => '0', + 'subject' => 'Your event is soldout!', + 'recipients' => '', + 'send_to_admin' => '1', + 'send_to_organizer' => '1', + 'content' => "Hi %%name%%, + + For your information, your %%event_title%% event at %%book_date%% is soldout. + + Regards, + %%blog_name%%" + ), + 'booking_rejection' => array( + 'status' => '0', + 'subject' => 'Your booking got rejected!', + 'recipients' => '', + 'send_to_admin' => '0', + 'send_to_organizer' => '1', + 'send_to_user' => '1', + 'content' => "Hi %%name%%, + + For your information, your booking for %%event_title%% at %%book_date%% is rejected. + + Regards, + %%blog_name%%" + ) + ), + ); + + add_option('mec_options', $options); + + // Mark this blog as installed + update_option('mec_installed', 1); + + // Set the version into the Database + update_option('mec_version', $this->main->get_version()); + + // MEC Capabilities + $role = get_role('administrator'); + if ($role) { + $role->add_cap('mec_bookings', true); + $role->add_cap('mec_add_booking', true); + $role->add_cap('mec_coupons', true); + $role->add_cap('mec_report', true); + $role->add_cap('mec_import_export', true); + $role->add_cap('mec_settings', true); + $role->add_cap('mec_shortcodes', true); + } + } + + /** + * Add cron jobs + * @author Webnus + */ + public function mec_add_cron_jobs() + { + // Scheduler Cron job + if (!wp_next_scheduled('mec_scheduler')) wp_schedule_event(time(), 'hourly', 'mec_scheduler'); + if (!wp_next_scheduled('mec_syncScheduler')) wp_schedule_event(time(), 'daily', 'mec_syncScheduler'); + if (!wp_next_scheduled('mec_maintenance')) wp_schedule_event(time(), 'daily', 'mec_maintenance'); + } + + /** + * Remove MEC from a blog + * @author Webnus + * @param int $blog_id + */ + public static function purge($blog_id = 1) + { + // Database Object + $main = MEC::getInstance('app.libraries.main'); + + // Settings + $settings = $main->get_settings(); + + // Purge data on uninstall + if (isset($settings['remove_data_on_uninstall']) and $settings['remove_data_on_uninstall']) { + // Database Object + $db = MEC::getInstance('app.libraries.db'); + + // Drop Tables + $db->q("DROP TABLE IF EXISTS `#__mec_events`"); + $db->q("DROP TABLE IF EXISTS `#__mec_dates`"); + $db->q("DROP TABLE IF EXISTS `#__mec_users`"); + $db->q("DROP TABLE IF EXISTS `#__mec_occurrences`"); + + // Removing MEC posts and postmeta data + $posts = $db->select("SELECT ID FROM `#__posts` WHERE `post_type`='mec-events' OR `post_type`='mec_calendars' OR `post_type`='mec-books'", 'loadAssocList'); + if (is_array($posts) and count($posts)) { + $post_ids = $meta_ids = ''; + + $remove_post_sql = "DELETE FROM `#__posts` WHERE"; + $remove_post_meta_sql = "DELETE FROM `#__postmeta` WHERE"; + + foreach ($posts as $post) { + if (isset($post['ID'])) { + $meta_ids .= ' `post_id`=' . $post['ID'] . ' OR '; + $post_ids .= ' `ID`=' . $post['ID'] . ' OR '; + } + } + + $remove_post_sql .= substr($post_ids, 0, -4); + $remove_post_meta_sql .= substr($meta_ids, 0, -4); + + $db->q($remove_post_sql); + $db->q($remove_post_meta_sql); + } + + // Removing all MEC taxonomy terms + $terms = $db->select("SELECT #__term_taxonomy.`term_id`, #__term_taxonomy.`taxonomy` FROM `#__terms` INNER JOIN `#__term_taxonomy` ON #__terms.`term_id` = #__term_taxonomy.`term_id` WHERE #__term_taxonomy.`taxonomy` = 'mec_category' OR #__term_taxonomy.`taxonomy` = 'mec_label' OR #__term_taxonomy.`taxonomy` = 'mec_location' OR #__term_taxonomy.`taxonomy` = 'mec_organizer' OR #__term_taxonomy.`taxonomy` = 'mec_speaker' OR #__term_taxonomy.`taxonomy` = 'mec_coupon'", 'loadAssocList'); + foreach ($terms as $term) { + if (isset($term['term_id']) and isset($term['taxonomy'])) { + wp_delete_term((int) $term['term_id'], trim($term['taxonomy'])); + } + } + + // MEC Deleted + delete_option('mec_installed'); + delete_option('mec_options'); + delete_option('mec_version'); + delete_option('widget_mec_mec_widget'); + delete_option('widget_mec_single_widget'); + delete_option('mec_gfont'); + delete_option('mec_dyncss'); + delete_option('mec_custom_msg_display_option'); + delete_option('mec_custom_msg_2_display_option'); + delete_option('mec_custom_msg_close_option'); + delete_option('mec_custom_msg_2_close_option'); + delete_option('mec_category_children'); + } + } + + /** + * Add a body class for active theme + * @return int $class + * @author Webnus + */ + public function mec_active_theme_body_class($classes) + { + $class = 'mec-theme-' . get_template(); + + if (is_array($classes)) { + $classes[] = $class; + } else { + $classes .= ' ' . $class . ' '; + } + return $classes; + } + + /** + * Remove MEC from a blog + * @param $dark + * @return int $dark + * @author Webnus + */ + public function mec_body_class($dark) + { + $styling = $this->main->get_styling(); + + $dark_mode = $styling['dark_mode'] ?? ''; + if (!empty($dark_mode) and $dark_mode == 1) $dark[] = 'mec-dark-mode'; + + return $dark; + } + + /** + * Remove MEC from a blog + * @param $darkadmin + * @return int $darkadmin + * @author Webnus + */ + public function mec_admin_body_class($darkadmin) + { + $styling = $this->main->get_styling(); + + $darkadmin_mode = $styling['dark_mode'] ?? ''; + if ($darkadmin_mode == 1) $darkadmin = 'mec-admin-dark-mode'; + + return $darkadmin; + } + + public function should_include_assets($client = 'frontend') + { + if ($client == 'frontend') return apply_filters('mec_include_frontend_assets', true); + else { + // Current Screen + $screen = get_current_screen(); + + $base = $screen->base; + $page = isset($_REQUEST['page']) ? sanitize_text_field($_REQUEST['page']) : ''; + $post_type = $screen->post_type; + $taxonomy = $screen->taxonomy; + + // It's one of MEC taxonomy pages + if (trim($taxonomy) and in_array($taxonomy, array( + apply_filters('mec_taxonomy_tag', ''), + 'mec_category', + 'mec_label', + 'mec_location', + 'mec_organizer', + 'mec_speaker', + 'mec_coupon' + ))) return true; + + // It's one of MEC post type pages + if (trim($post_type) and in_array($post_type, array( + $this->main->get_main_post_type(), + 'mec_calendars', + $this->main->get_book_post_type() + ))) return true; + + // It's Block Editor + if (method_exists($screen, 'is_block_editor') and $screen->is_block_editor()) return true; + + // It's one of MEC pages or the pages that MEC should work fine + if ((trim($base) and in_array($base, array( + 'toplevel_page_mec-intro', + 'm-e-calendar_page_MEC-settings', + 'm-e-calendar_page_MEC-addons', + 'm-e-calendar_page_MEC-report', + 'm-e-calendar_page_MEC-ix', + 'm-e-calendar_page_MEC-support', + 'm-e-calendar_page_MEC-wizard', + 'm-e-calendar_page_MEC-go-pro', + 'widgets', + ))) or (trim($page) and in_array($page, array( + 'mec-intro', + 'MEC-settings', + 'MEC-addons', + 'MEC-report', + 'MEC-ix', + 'MEC-support', + 'MEC-wizard', + 'MEC-go-pro', + 'mec-advanced-report', + )))) return true; + + return apply_filters('mec_include_backend_assets', false); + } + } + + function mecShowUpgradeNotification($currentPluginMetadata, $newPluginMetadata) + { + // check "upgrade_notice" + +?> +
        + + + +
        + + */ +class MEC_feed extends MEC_base +{ + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + } + + /** + * @author Webnus + * @param int $post_id + * @return string + */ + public function title($post_id) + { + $title = get_the_title($post_id); + return apply_filters('the_title_rss', $title); + } + + /** + * @author Webnus + * @param int $post_id + * @return string + */ + public function permalink($post_id) + { + $permalink = get_post_permalink($post_id); + return esc_url(apply_filters('the_permalink_rss', $permalink)); + } + + /** + * @author Webnus + * @param int $post_id + * @return string + */ + public function attachment($post_id) + { + $main = $this->getMain(); + + $featured_link = $main->get_post_thumbnail_url($post_id,'full'); + return esc_url(apply_filters('the_attachment_rss', $featured_link)); + } + + /** + * @author Webnus + * @param int $post_id + * @return string + */ + public function comments_link_feed($post_id) + { + return esc_url(apply_filters('comments_link_feed', get_comments_link($post_id))); + } + + /** + * @author Webnus + * @param int $user_id + * @return string + */ + public function author($user_id) + { + $authordata = get_userdata($user_id); + return apply_filters('the_author', is_object($authordata) ? $authordata->display_name : null); + } + + /** + * @author Webnus + * @param int $post_id + * @return string + */ + public function excerpt($post_id) + { + $post = get_post($post_id); + + if(empty($post)) return ''; + if(post_password_required($post)) return esc_html__('There is no excerpt because this is a protected post.'); + + return apply_filters('get_the_excerpt', $post->post_excerpt, $post); + } + + /** + * @author Webnus + * @param int $post_id + * @param string $feed_type + * @return string + */ + public function content($post_id, $feed_type = NULL) + { + if(!$feed_type) $feed_type = get_default_feed(); + + $post = get_post($post_id); + $content = str_replace(']]>', ']]>', apply_filters('the_content', $post->post_content)); + + return apply_filters('the_content_feed', $content, $feed_type); + } + + /** + * @author Webnus + * @param int $post_id + * @return string + */ + public function enclosure_rss($post_id) + { + $enclosure = ''; + if(post_password_required($post_id)) return $enclosure; + + foreach((array) get_post_custom($post_id) as $key=>$val) + { + if($key != 'enclosure') continue; + + foreach((array) $val as $enc) + { + $enc = explode("\n", $enc); + + $t = preg_split('/[ \t]/', trim($enc[2])); + $type = $t[0]; + + $enclosure .= apply_filters('rss_enclosure', ''."\n"); + } + } + + return $enclosure; + } + + /** + * @author Webnus + * @param int $post_id + * @return string + */ + public function enclosure_atom($post_id) + { + $enclosure = ''; + if(post_password_required($post_id)) return $enclosure; + + foreach((array) get_post_custom() as $key=>$val) + { + if($key != 'enclosure') continue; + foreach((array) $val as $enc) + { + $enc = explode("\n", $enc); + $enclosure .= apply_filters('atom_enclosure', ''."\n"); + } + } + + return $enclosure; + } +} \ No newline at end of file diff --git a/app/libraries/filesystem.php b/app/libraries/filesystem.php new file mode 100755 index 0000000..89870ff --- /dev/null +++ b/app/libraries/filesystem.php @@ -0,0 +1,864 @@ + + */ +class MEC_file extends MEC_base +{ + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + } + + /** + * @author Webnus + * @param string $file + * @return string + */ + public static function getExt($file) + { + $ex = explode('.', $file); + return end($ex); + } + + /** + * @author Webnus + * @param string $file + * @return string + */ + public static function stripExt($file) + { + return preg_replace('#\.[^.]*$#', '', $file); + } + + /** + * @author Webnus + * @param string $file + * @return string + */ + public static function makeSafe($file) + { + $regex = array('#(\.){2,}#', '#[^A-Za-z0-9\.\_\- ]#', '#^\.#'); + return preg_replace($regex, '', $file); + } + + /** + * @author Webnus + * @param string $src + * @param string $dest + * @param string $path + * @return boolean + */ + public static function copy($src, $dest, $path = null) + { + // Prepend a base path if it exists + if ($path) + { + $src = MEC_path::clean($path . '/' . $src); + $dest = MEC_path::clean($path . '/' . $dest); + } + + // Check src path + if (!is_readable($src)) + { + return false; + } + + if (!@ copy($src, $dest)) + { + return false; + } + + return true; + } + + /** + * @author Webnus + * @param string $file + * @return boolean + */ + public static function delete($file) + { + if(is_array($file)) + { + $files = $file; + } + else + { + $files[] = $file; + } + + foreach($files as $file) + { + $file = MEC_path::clean($file); + + @chmod($file, 0777); + @unlink($file); + } + + return true; + } + + /** + * @author Webnus + * @param string $src + * @param string $dest + * @param string $path + * @return boolean + */ + public static function move($src, $dest, $path = '') + { + if($path) + { + $src = MEC_path::clean($path . '/' . $src); + $dest = MEC_path::clean($path . '/' . $dest); + } + + // Check src path + if(!is_readable($src)) return false; + if(!@rename($src, $dest)) return false; + + return true; + } + + /** + * @author Webnus + * @param string $filename + * @return boolean + */ + public static function read($filename) + { + // Initialise variables. + $fh = fopen($filename, 'rb'); + + if(false === $fh) return false; + + clearstatcache(); + + if($fsize = @filesize($filename)) + { + $data = fread($fh, $fsize); + + fclose($fh); + return $data; + } + else + { + fclose($fh); + return false; + } + } + + /** + * @author Webnus + * @param string $file + * @param string $buffer + * @return string + */ + public static function write($file, &$buffer) + { + @set_time_limit(ini_get('max_execution_time')); + + // If the destination directory doesn't exist we need to create it + if (!file_exists(dirname($file))) + { + MEC_folder::create(dirname($file)); + } + + $file = MEC_path::clean($file); + $ret = is_int(file_put_contents($file, $buffer)) ? true : false; + + return $ret; + } + + /** + * @author Webnus + * @param string $src + * @param string $dest + * @return boolean + */ + public static function upload($src, $dest) + { + // Ensure that the path is valid and clean + $dest = MEC_path::clean($dest); + $baseDir = dirname($dest); + + if (!file_exists($baseDir)) + { + MEC_folder::create($baseDir); + } + + if (is_writable($baseDir) && move_uploaded_file($src, $dest)) + { + // Short circuit to prevent file permission errors + if (MEC_path::setPermissions($dest)) $ret = true; + else $ret = false; + } + else $ret = false; + + return $ret; + } + + /** + * @author Webnus + * @param string $file + * @return string + */ + public static function exists($file) + { + return is_file(MEC_path::clean($file)); + } + + /** + * @author Webnus + * @param string $file + * @return string + */ + public static function getName($file) + { + // Convert backslashes to forward slashes + $file = str_replace('\\', '/', $file); + $slash = strrpos($file, '/'); + + if ($slash !== false) + { + return substr($file, $slash + 1); + } + else + { + return $file; + } + } +} + +/** + * Webnus MEC Folder class. + * @author Webnus + */ +class MEC_folder extends MEC_base +{ + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + parent::__construct(); + } + + /** + * @author Webnus + * @param string $src + * @param string $dest + * @param string $path + * @param boolean $force + * @return boolean + */ + public static function copy($src, $dest, $path = '', $force = false) + { + @set_time_limit(ini_get('max_execution_time')); + + if ($path) + { + $src = MEC_path::clean($path . '/' . $src); + $dest = MEC_path::clean($path . '/' . $dest); + } + + // Eliminate trailing directory separators, if any + $src = rtrim($src, DIRECTORY_SEPARATOR); + $dest = rtrim($dest, DIRECTORY_SEPARATOR); + + if (!self::exists($src)) return false; + if (self::exists($dest) && !$force) return false; + + // Make sure the destination exists + if (!self::create($dest)) return false; + if (!($dh = @opendir($src))) return false; + + // Walk through the directory copying files and recursing into folders. + while (($file = readdir($dh)) !== false) + { + $sfid = $src . '/' . $file; + $dfid = $dest . '/' . $file; + + switch (filetype($sfid)) + { + case 'dir': + + if ($file != '.' && $file != '..') + { + $ret = self::copy($sfid, $dfid, null, $force); + if ($ret !== true) + { + return $ret; + } + } + break; + + case 'file': + + if (!@copy($sfid, $dfid)) + { + return false; + } + break; + } + } + + return true; + } + + /** + * Create a folder -- and all necessary parent folders. + * @author Webnus + * @staticvar int $nested + * @param string $path + * @param int $mode + * @return boolean + */ + public static function create($path = '', $mode = 0755) + { + // Initialise variables. + static $nested = 0; + + // Check to make sure the path valid and clean + $path = MEC_path::clean($path); + + // Check if parent dir exists + $parent = dirname($path); + + if (!self::exists($parent)) + { + // Prevent infinite loops! + $nested++; + if (($nested > 20) || ($parent == $path)) + { + $nested--; + return false; + } + + // Create the parent directory + if (self::create($parent, $mode) !== true) + { + // MEC_folder::create throws an error + $nested--; + return false; + } + + // OK, parent directory has been created + $nested--; + } + + // Check if dir already exists + if (self::exists($path)) + { + return true; + } + + // We need to get and explode the open_basedir paths + $obd = ini_get('open_basedir'); + + // If open_basedir is set we need to get the open_basedir that the path is in + if ($obd != null) + { + $obdSeparator = ":"; + + // Create the array of open_basedir paths + $obdArray = explode($obdSeparator, $obd); + $inBaseDir = false; + // Iterate through open_basedir paths looking for a match + foreach ($obdArray as $test) + { + $test = MEC_path::clean($test); + if (strpos($path, $test) === 0) + { + $inBaseDir = true; + break; + } + } + if ($inBaseDir == false) + { + return false; + } + } + + // First set umask + $origmask = @umask(0); + + // Create the path + if (!$ret = @mkdir($path, $mode)) + { + @umask($origmask); + return false; + } + + // Reset umask + @umask($origmask); + + return $ret; + } + + /** + * @author Webnus + * @param string $path + * @return boolean + */ + public static function delete($path) + { + @set_time_limit(ini_get('max_execution_time')); + + // Sanity check + if (!$path) + { + return false; + } + + // Check to make sure the path valid and clean + $path = MEC_path::clean($path); + + // Is this really a folder? + if (!is_dir($path)) + { + return false; + } + + // Remove all the files in folder if they exist; disable all filtering + $files = self::files($path, '.', false, true, array(), array()); + if (!empty($files)) + { + if (MEC_file::delete($files) !== true) + { + return false; + } + } + + // Remove sub-folders of folder; disable all filtering + $folders = self::folders($path, '.', false, true, array(), array()); + foreach ($folders as $folder) + { + if (is_link($folder)) + { + if (MEC_file::delete($folder) !== true) + { + return false; + } + } + elseif (self::delete($folder) !== true) + { + return false; + } + } + + // In case of restricted permissions we zap it one way or the other + // as long as the owner is either the webserver or the ftp. + if (@rmdir($path)) + { + $ret = true; + } + else + { + $ret = false; + } + + return $ret; + } + + /** + * @author Webnus + * @param string $src + * @param string $dest + * @param string $path + * @return boolean + */ + public static function move($src, $dest, $path = '') + { + if ($path) + { + $src = MEC_path::clean($path . '/' . $src); + $dest = MEC_path::clean($path . '/' . $dest); + } + + if (!self::exists($src)) return false; + if (self::exists($dest)) return false; + + if (!@rename($src, $dest)) + { + return false; + } + + return true; + } + + /** + * @author Webnus + * @param string $path + * @return string + */ + public static function exists($path) + { + return is_dir(MEC_path::clean($path)); + } + + /** + * @author Webnus + * @param string $path + * @param string $filter + * @param boolean $recurse + * @param boolean $full + * @param array $exclude + * @param array $excludefilter + * @return boolean|array + */ + public static function files($path, $filter = '.', $recurse = false, $full = false, $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX'), $excludefilter = array('^\..*', '.*~')) + { + // Check to make sure the path valid and clean + $path = MEC_path::clean($path); + + // Is the path a folder? + if (!is_dir($path)) + { + return false; + } + + // Compute the excludefilter string + if (count($excludefilter)) + { + $excludefilter_string = '/(' . implode('|', $excludefilter) . ')/'; + } + else + { + $excludefilter_string = ''; + } + + // Get the files + $arr = self::_items($path, $filter, $recurse, $full, $exclude, $excludefilter_string, true); + + // Sort the files + asort($arr); + return array_values($arr); + } + + /** + * @author Webnus + * @param string $path + * @param string $filter + * @param boolean $recurse + * @param boolean $full + * @param array $exclude + * @param array $excludefilter + * @return boolean|array + */ + public static function folders($path, $filter = '.', $recurse = false, $full = false, $exclude = array('.svn', 'CVS', '.DS_Store', '__MACOSX'), $excludefilter = array('^\..*')) + { + // Check to make sure the path valid and clean + $path = MEC_path::clean($path); + + // Is the path a folder? + if (!is_dir($path)) + { + return false; + } + + // Compute the excludefilter string + if (count($excludefilter)) + { + $excludefilter_string = '/(' . implode('|', $excludefilter) . ')/'; + } + else + { + $excludefilter_string = ''; + } + + // Get the folders + $arr = self::_items($path, $filter, $recurse, $full, $exclude, $excludefilter_string, false); + + // Sort the folders + asort($arr); + return array_values($arr); + } + + /** + * @author Webnus + * @param string $path + * @param string $filter + * @param boolean $recurse + * @param boolean $full + * @param array $exclude + * @param array|string $excludefilter_string + * @param boolean $findfiles + * @return array + */ + protected static function _items($path, $filter, $recurse, $full, $exclude, $excludefilter_string, $findfiles) + { + @set_time_limit(ini_get('max_execution_time')); + + // Initialise variables. + $arr = []; + + // Read the source directory + if (!($handle = @opendir($path))) + { + return $arr; + } + + while (($file = readdir($handle)) !== false) + { + if ($file != '.' && $file != '..' && !in_array($file, $exclude) + && (empty($excludefilter_string) || !preg_match($excludefilter_string, $file))) + { + // Compute the fullpath + $fullpath = $path . '/' . $file; + + // Compute the isDir flag + $isDir = is_dir($fullpath); + + if (($isDir xor $findfiles) && preg_match("/$filter/", $file)) + { + // (fullpath is dir and folders are searched or fullpath is not dir and files are searched) and file matches the filter + if ($full) + { + // Full path is requested + $arr[] = $fullpath; + } + else + { + // Filename is requested + $arr[] = $file; + } + } + + if ($isDir && $recurse) + { + // Search recursively + if (is_integer($recurse)) + { + // Until depth 0 is reached + $arr = array_merge($arr, self::_items($fullpath, $filter, $recurse - 1, $full, $exclude, $excludefilter_string, $findfiles)); + } + else + { + $arr = array_merge($arr, self::_items($fullpath, $filter, $recurse, $full, $exclude, $excludefilter_string, $findfiles)); + } + } + } + } + + closedir($handle); + return $arr; + } + + /** + * @author Webnus + * @param string $path + * @return string + */ + public static function makeSafe($path) + { + $regex = array('#[^A-Za-z0-9:_\\\/-]#'); + return preg_replace($regex, '', $path); + } +} + +/** + * Webnus MEC Path class. + * @author Webnus + */ +class MEC_path extends MEC_base +{ + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + parent::__construct(); + } + + /** + * @author Webnus + * @param string $path + * @return boolean + */ + public static function canChmod($path) + { + $perms = fileperms($path); + if ($perms !== false) + { + if (@chmod($path, $perms ^ 0001)) + { + @chmod($path, $perms); + return true; + } + } + + return false; + } + + /** + * @author Webnus + * @param string $path + * @param string $filemode + * @param string $foldermode + * @return boolean + */ + public static function setPermissions($path, $filemode = '0644', $foldermode = '0755') + { + // Initialise return value + $ret = true; + + if (is_dir($path)) + { + $dh = opendir($path); + + while ($file = readdir($dh)) + { + if ($file != '.' && $file != '..') + { + $fullpath = $path . '/' . $file; + if (is_dir($fullpath)) + { + if (!MEC_path::setPermissions($fullpath, $filemode, $foldermode)) + { + $ret = false; + } + } + else + { + if (isset($filemode)) + { + if (!@ chmod($fullpath, octdec($filemode))) + { + $ret = false; + } + } + } + } + } + + closedir($dh); + if (isset($foldermode)) + { + if (!@ chmod($path, octdec($foldermode))) + { + $ret = false; + } + } + } + else + { + if (isset($filemode)) + { + $ret = @ chmod($path, octdec($filemode)); + } + } + + return $ret; + } + + /** + * @author Webnus + * @param string $path + * @return string + */ + public static function getPermissions($path) + { + $path = MEC_path::clean($path); + $mode = @ decoct(@ fileperms($path) & 0777); + + if(strlen($mode) < 3) + { + return '---------'; + } + + $parsed_mode = ''; + for($i = 0; $i < 3; $i++) + { + // read + $parsed_mode .= ($mode[$i] & 04) ? "r" : "-"; + // write + $parsed_mode .= ($mode[$i] & 02) ? "w" : "-"; + // execute + $parsed_mode .= ($mode[$i] & 01) ? "x" : "-"; + } + + return $parsed_mode; + } + + /** + * @author Webnus + * @param string $path + * @param string $ds + * @return string + */ + public static function check($path, $ds = DIRECTORY_SEPARATOR) + { + $path = MEC_path::clean($path, $ds); + return $path; + } + + /** + * @author Webnus + * @param string $path + * @param string $ds + * @return string + */ + public static function clean($path, $ds = DIRECTORY_SEPARATOR) + { + $path = trim($path); + if(empty($path)) + { + $path = BASE_PATH; + } + else + { + // Remove double slashes and backslashes and convert all slashes and backslashes to DIRECTORY_SEPARATOR + $path = preg_replace('#[/\\\\]+#', $ds, $path); + } + + return $path; + } + + /** + * @author Webnus + * @param array $paths + * @param string $file + * @return boolean + */ + public static function find($paths, $file) + { + settype($paths, 'array'); //force to array + + // Start looping through the path set + foreach ($paths as $path) + { + // Get the path to the file + $fullname = $path . '/' . $file; + + // Is the path based on a stream? + if (strpos($path, '://') === false) + { + // Not a stream, so do a realpath() to avoid directory + // traversal attempts on the local file system. + $path = realpath($path); // needed for substr() later + $fullname = realpath($fullname); + } + + // The substr() check added to make sure that the realpath() + // results in a directory registered so that + // non-registered directories are not accessible via directory + // traversal attempts. + if (file_exists($fullname) && substr($fullname, 0, strlen($path)) == $path) + { + return $fullname; + } + } + + return false; + } +} \ No newline at end of file diff --git a/app/libraries/formBuilder.php b/app/libraries/formBuilder.php new file mode 100755 index 0000000..d16e0e5 --- /dev/null +++ b/app/libraries/formBuilder.php @@ -0,0 +1,246 @@ + + */ +class MEC_formBuilder extends MEC_base +{ + /** + * @var MEC_main + */ + public $main; + + /** + * @var array + */ + public $settings; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Main + $this->main = $this->getMain(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + } + + /** + * @param $args + * @return void + */ + public function hourlySchedule($args) + { + $hourly_schedules = $args['hourly_schedules']; + $speakers_status = $args['speakers_status']; + $speakers = $args['speakers']; + $wrapper_class = $args['wrapper_class'] ?? 'mec-meta-box-fields mec-event-tab-content mec-fes-hourly-schedule'; + $prefix = $args['prefix'] ?? ''; + $name_prefix = ((isset($args['name_prefix']) and trim($args['name_prefix'])) ? $args['name_prefix'] : 'mec'); + ?> +
        +

        +
        +
        + + +
        +
        +
        + +
        +

        +
        +
        +
        +
        +
        +
        + +
        +
        +
        + + +
        +
        + $hourly_schedule): if(!is_numeric($key)) continue; $i = max($i, $key); ?> +
        + + + + + + + + + + +
        + main->m('taxonomy_speakers', esc_html__('Speakers:', 'modern-events-calendar-lite'))); ?> + + + +
        + +
        + +
        +
        + +
        +
        + + + + + + + + + + +
        + main->m('taxonomy_speakers', esc_html__('Speakers:', 'modern-events-calendar-lite'))); ?> + + + +
        + +
        +
        +
        + +
        + +
        +
        +

        +
        +
        +
        +
        +
        +
        +
        + +
        +
        +
        + + +
        +
        +
        +
        + +
        +
        + + + + + + + + + + +
        + main->m('taxonomy_speakers', esc_html__('Speakers:', 'modern-events-calendar-lite'))); ?> + + + +
        + +
        +
        +
        +
        +
        + +
        +
        +
        + +
        +
        + + + +
        +
        +
        +

        + +

        +
        +
        + +
        + +
        +
        +
        + settings['datepicker_format']) and trim($this->settings['datepicker_format'])) ? $this->settings['datepicker_format'] : 'Y-m-d'; + $i = 1; + foreach ($values as $key => $not_in_day) : if(!is_numeric($key)) continue; ?> +
        + + main->standardize_format($not_in_day, $datepicker_format)); ?> + x +
        + +
        + +
        +
        + + :val: + x +
        +
        +
        + + */ +class MEC_icons +{ + protected $icons = []; + + /** + * Constructor method + * @author Webnus + */ + public function __construct($icons = []) + { + $this->icons = $icons; + } + + public function has($key) + { + return isset($this->icons[$key]) && trim($this->icons[$key]); + } + + public function display($key) + { + $default = $this->default($key); + $custom = isset($this->icons[$key]) && trim($this->icons[$key]) ? ''.esc_attr($key).'' : ''; + + return trim($custom) ? $custom : $default; + } + + public function default($key) + { + $all = $this->all(); + return isset($all[$key]['default']) && trim($all[$key]['default']) ? $all[$key]['default'] : ''; + } + + public function all() + { + return apply_filters('mec_icons', [ + 'location-pin' => [ + 'name' => __('Location Marker Icon', 'modern-events-calendar-lite'), + 'default' => '', + 'modules' => ['single', 'shortcode'], + ], + 'map-marker' => [ + 'name' => __('Map Marker Icon', 'modern-events-calendar-lite'), + 'default' => '', + 'modules' => ['shortcode'], + ], + 'info' => [ + 'name' => __('Info Icon', 'modern-events-calendar-lite'), + 'default' => '', + 'modules' => ['single'], + ], + 'bookmark' => [ + 'name' => __('Bookmark Icon', 'modern-events-calendar-lite'), + 'default' => '', + 'modules' => ['single'], + ], + 'folder' => [ + 'name' => __('Folder Icon', 'modern-events-calendar-lite'), + 'default' => '', + 'modules' => ['single', 'shortcode'], + ], + 'home' => [ + 'name' => __('Home Icon', 'modern-events-calendar-lite'), + 'default' => '', + 'modules' => ['single'], + ], + 'phone' => [ + 'name' => __('Phone Icon', 'modern-events-calendar-lite'), + 'default' => '', + 'modules' => ['single'], + ], + 'envelope' => [ + 'name' => __('Envelope Icon', 'modern-events-calendar-lite'), + 'default' => '', + 'modules' => ['single'], + ], + 'calendar' => [ + 'name' => __('Calendar Icon', 'modern-events-calendar-lite'), + 'default' => '', + 'modules' => ['single', 'shortcode'], + ], + 'clock' => [ + 'name' => __('Clock Icon', 'modern-events-calendar-lite'), + 'default' => '', + 'modules' => ['single', 'shortcode'], + ], + 'clock-o' => [ + 'name' => __('Clock 2 Icon', 'modern-events-calendar-lite'), + 'default' => '', + 'modules' => ['shortcode'], + ], + 'wallet' => [ + 'name' => __('Wallet Icon', 'modern-events-calendar-lite'), + 'default' => '', + 'modules' => ['single', 'shortcode'], + ], + 'user' => [ + 'name' => __('User Icon', 'modern-events-calendar-lite'), + 'default' => '', + 'modules' => ['shortcode'], + ], + 'magnifier' => [ + 'name' => __('Magnifire Icon', 'modern-events-calendar-lite'), + 'default' => '', + 'modules' => ['shortcode'], + ], + 'credit-card' => [ + 'name' => __('Credit Card Icon', 'modern-events-calendar-lite'), + 'default' => '', + 'modules' => ['shortcode'], + ], + 'map' => [ + 'name' => __('Map Icon', 'modern-events-calendar-lite'), + 'default' => '', + 'modules' => ['shortcode'], + ], + 'pin' => [ + 'name' => __('Pin Icon', 'modern-events-calendar-lite'), + 'default' => '', + 'modules' => ['shortcode'], + ], + 'tag' => [ + 'name' => __('Tag Icon', 'modern-events-calendar-lite'), + 'default' => '', + 'modules' => ['shortcode'], + ], + 'microphone' => [ + 'name' => __('Microphone Icon', 'modern-events-calendar-lite'), + 'default' => '', + 'modules' => ['shortcode'], + ], + 'sitemap' => [ + 'name' => __('Website Icon', 'modern-events-calendar-lite'), + 'default' => '', + 'modules' => ['single'], + ] + ]); + } + + public function form($section = 'single', $prefix = 'mec[settings]', $values = []) + { + $all = $this->all(); + ?> +
        +
        + $icon): if(!in_array($section, $icon['modules'])) continue; $current = isset($values[$key]) && trim($values[$key]) ? $values[$key] : ''; ?> +
        +
        + + +
        +
        + + + +
        +
        +
        <?php echo esc_attr($icon['name']); ?>
        +
        +
        + +
        +
        + 1, + 'aria-*' => 1, + 'type' => 1, + 'value' => 1, + 'class' => 1, + 'id' => 1, + 'for' => 1, + 'style' => 1, + 'src' => 1, + 'alt' => 1, + 'title' => 1, + 'placeholder' => 1, + 'href' => 1, + 'rel' => 1, + 'target' => 1, + 'novalidate' => 1, + 'name' => 1, + 'tabindex' => 1, + 'action' => 1, + 'method' => 1, + 'width' => 1, + 'height' => 1, + 'selected' => 1, + 'checked' => 1, + 'readonly' => 1, + 'disabled' => 1, + 'required' => 1, + 'autocomplete' => 1, + 'min' => 1, + 'max' => 1, + 'step' => 1, + 'cols' => 1, + 'rows' => 1, + 'lang' => 1, + 'dir' => 1, + 'enctype' => 1, + 'multiple' => 1, + 'frameborder' => 1, + 'allow' => 1, + 'allowfullscreen' => 1, + 'label' => 1, + 'align' => 1, + 'accept-charset' => 1, + 'itemtype' => 1, + 'itemscope' => 1, + 'itemprop' => 1, + 'content' => 1, + 'onclick' => 1, + 'onsubmit' => 1, + 'onchange' => 1, + 'xmlns' => 1, + 'viewbox' => 1, + 'd' => 1, + 'transform' => 1, + 'fill' => 1, + 'enable-background' => 1, + 'version' => 1, + 'xml:space' => 1, + 'xmlns:xlink' => 1, + 'onkeydown' => 1, + ); + + public function __construct() + { + } + + public static function full($html) + { + if(is_null($html)) return ''; + + if(is_null(self::$allowed_html_full)) + { + $allowed = wp_kses_allowed_html('post'); + self::$allowed_html_full = apply_filters('mec_kses_tags', $allowed, 'full'); + } + + if(defined('MEC_NO_JS_CSS_IN_HTML') && MEC_NO_JS_CSS_IN_HTML) return wp_kses($html, self::$allowed_html_full); + else return $html; + } + + public static function page($html) + { + if(is_null($html)) return ''; + + if(is_null(self::$allowed_html_page)) + { + $allowed = wp_kses_allowed_html('post'); + self::$allowed_html_page = apply_filters('mec_kses_tags', $allowed, 'page'); + } + + return wp_kses($html, self::$allowed_html_page); + } + + public static function form($html) + { + if(is_null($html)) return ''; + + if(is_null(self::$allowed_html_form)) + { + $allowed = wp_kses_allowed_html('post'); + self::$allowed_html_form = apply_filters('mec_kses_tags', $allowed, 'form'); + } + + return wp_kses($html, self::$allowed_html_form); + } + + public static function element($html) + { + if(is_null($html)) return ''; + + if(is_null(self::$allowed_html_element)) + { + $allowed = wp_kses_allowed_html('post'); + self::$allowed_html_element = apply_filters('mec_kses_tags', $allowed, 'element'); + } + + return wp_kses($html, self::$allowed_html_element); + } + + /** + * Element + Embed + * @param $html + * @return string + */ + public static function rich($html) + { + if(is_null($html)) return ''; + + if(is_null(self::$allowed_html_rich)) + { + $allowed = wp_kses_allowed_html('post'); + self::$allowed_html_rich = apply_filters('mec_kses_tags', $allowed, 'rich'); + } + + return wp_kses($html, self::$allowed_html_rich); + } + + /** + * Only Embed + * @param $html + * @return string + */ + public static function embed($html) + { + if(is_null($html)) return ''; + + if(is_null(self::$allowed_html_embed)) + { + self::$allowed_html_embed = apply_filters('mec_kses_tags', array(), 'embed'); + } + + return wp_kses($html, self::$allowed_html_embed); + } + + public static function tags($tags, $context) + { + foreach(array( + 'svg', + 'path', + 'div', + 'span', + 'ul', + 'li', + 'a', + 'button', + 'progress', + 'dt', + 'dl', + ) as $tag) + { + $tags[$tag] = self::$allowed_attrs; + } + + if(in_array($context, array('form', 'page', 'full'))) + { + $tags['form'] = self::$allowed_attrs; + $tags['label'] = self::$allowed_attrs; + $tags['input'] = self::$allowed_attrs; + $tags['select'] = self::$allowed_attrs; + $tags['option'] = self::$allowed_attrs; + $tags['optgroup'] = self::$allowed_attrs; + $tags['textarea'] = self::$allowed_attrs; + $tags['button'] = self::$allowed_attrs; + $tags['fieldset'] = self::$allowed_attrs; + $tags['output'] = self::$allowed_attrs; + } + + if(in_array($context, array('embed', 'rich', 'full'))) + { + if(!isset($tags['iframe'])) $tags['iframe'] = self::$allowed_attrs; + if(!isset($tags['canvas'])) $tags['canvas'] = self::$allowed_attrs; + } + + if($context === 'full') + { + if(!isset($tags['script'])) $tags['script'] = self::$allowed_attrs; + if(!isset($tags['style'])) $tags['style'] = self::$allowed_attrs; + } + + return $tags; + } + + public static function styles($styles) + { + $styles[] = 'display'; + $styles[] = 'opacity'; + + return $styles; + } +} \ No newline at end of file diff --git a/app/libraries/main.php b/app/libraries/main.php new file mode 100755 index 0000000..b9111a8 --- /dev/null +++ b/app/libraries/main.php @@ -0,0 +1,10512 @@ + + */ +class MEC_main extends MEC_base +{ + /** + * Constructor method + * @author Webnus + */ + public function __construct() {} + + /** + * Returns the archive URL of events for provided skin + * @author Webnus + * @param string $skin + * @return string + */ + public function archive_URL($skin) + { + return $this->URL('site') . $this->get_main_slug() . '/' . $skin . '/'; + } + + /** + * Returns full current URL of WordPress + * @author Webnus + * @return string + */ + public function get_full_url() + { + // Check protocol + $page_url = 'http'; + if (isset($_SERVER['HTTPS']) and $_SERVER['HTTPS'] == 'on') $page_url .= 's'; + + // Get domain + $site_domain = (isset($_SERVER['HTTP_HOST']) and trim($_SERVER['HTTP_HOST']) != '') ? sanitize_text_field($_SERVER['HTTP_HOST']) : sanitize_text_field($_SERVER['SERVER_NAME']); + + $page_url .= '://'; + $page_url .= $site_domain . $_SERVER['REQUEST_URI']; + + // Return full URL + return $page_url; + } + + /** + * Get domain of a certain URL + * @author Webnus + * @param string $url + * @return string + */ + public function get_domain($url = NULL) + { + // Get current URL + if (is_null($url)) $url = $this->get_full_url(); + + $url = str_replace('http://', '', $url); + $url = str_replace('https://', '', $url); + $url = str_replace('ftp://', '', $url); + $url = str_replace('svn://', '', $url); + $url = str_replace('www.', '', $url); + + $ex = explode('/', $url); + $ex2 = explode('?', $ex[0]); + + return $ex2[0]; + } + + /** + * Remove query string from the URL + * @author Webnus + * @param string $key + * @param string $url + * @return string + */ + public function remove_qs_var($key, $url = '') + { + if (trim($url) == '') $url = $this->get_full_url(); + + $url = preg_replace('/(.*)(\?|&)' . $key . '=[^&]+?(&)(.*)/i', '$1$2$4', $url . '&'); + return substr($url, 0, -1); + } + + /** + * Add query string to the URL + * @author Webnus + * @param string $key + * @param string $value + * @param string $url + * @return string + */ + public function add_qs_var($key, $value, $url = '') + { + if (trim($url) == '') $url = $this->get_full_url(); + + $url = preg_replace('/(.*)(\?|&)' . $key . '=[^&]+?(&)(.*)/i', '$1$2$4', $url . '&'); + $url = substr($url, 0, -1); + + if (strpos($url, '?') === false) + return $url . '?' . $key . '=' . $value; + else + return $url . '&' . $key . '=' . $value; + } + + /** + * Add multiple query strings to the URL + * @author Webnus + * @param array $vars + * @param string $url + * @return string + */ + public function add_qs_vars($vars, $url = '') + { + if (trim($url) == '') $url = $this->get_full_url(); + + foreach ($vars as $key => $value) $url = $this->add_qs_var($key, $value, $url); + return $url; + } + + /** + * Returns WordPress authors + * @author Webnus + * @param array $args + * @return array + */ + public function get_authors($args = array()) + { + return get_users($args); + } + + /** + * Returns full URL of an asset + * @author Webnus + * @param string $asset + * @param boolean $override + * @return string + */ + public function asset($asset, $override = true) + { + $url = $this->URL('MEC') . 'assets/' . $asset; + + if ($override) { + // Search the file in the main theme + $theme_path = get_template_directory() . DS . 'webnus' . DS . MEC_DIRNAME . DS . 'assets' . DS . $asset; + + /** + * If overridden file exists on the main theme, then use it instead of normal file + * For example you can override /path/to/plugin/assets/js/frontend.js file in your theme by adding a file into the /path/to/theme/webnus/modern-events-calendar/assets/js/frontend.js + */ + if (file_exists($theme_path)) $url = get_template_directory_uri() . '/webnus/' . MEC_DIRNAME . '/assets/' . $asset; + + // If the theme is a child theme then search the file in child theme + if (get_template_directory() != get_stylesheet_directory()) { + // Child theme overridden file + $child_theme_path = get_stylesheet_directory() . DS . 'webnus' . DS . MEC_DIRNAME . DS . 'assets' . DS . $asset; + + /** + * If overridden file exists on the child theme, then use it instead of normal or main theme file + * For example you can override /path/to/plugin/assets/js/frontend.js file in your theme by adding a file into the /path/to/child/theme/webnus/modern-events-calendar/assets/js/frontend.js + */ + if (file_exists($child_theme_path)) $url = get_stylesheet_directory_uri() . '/webnus/' . MEC_DIRNAME . '/assets/' . $asset; + } + } + + return $url; + } + + public function svg($icon, $override = true) + { + $title = sprintf(__('%s icon', 'modern-events-calendar-lite'), ucfirst(str_replace('-', ' ', $icon))); + + return '' . esc_attr($title) . ''; + } + + /** + * Returns URL of WordPress items such as site, admin, plugins, MEC plugin etc. + * @author Webnus + * @param string $type + * @return string + */ + public function URL($type = 'site') + { + // Make it lowercase + $type = strtolower($type); + + // Frontend + if (in_array($type, array('frontend', 'site'))) $url = home_url() . '/'; + // Backend + elseif (in_array($type, array('backend', 'admin'))) $url = admin_url(); + // WordPress' Content directory URL + elseif ($type == 'content') $url = content_url() . '/'; + // WordPress' plugins directory URL + elseif ($type == 'plugin') $url = plugins_url() . '/'; + // WordPress include directory URL + elseif ($type == 'include') $url = includes_url(); + // Webnus MEC plugin URL + else { + // If plugin installed regularly on plugins directory + if (!defined('MEC_IN_THEME')) $url = plugins_url() . '/' . MEC_DIRNAME . '/'; + // If plugin embedded into one theme + else $url = get_template_directory_uri() . '/plugins/' . MEC_DIRNAME . '/'; + } + + return $url; + } + + /** + * Returns plugin absolute path + * @author Webnus + * @return string + */ + public function get_plugin_path() + { + return MEC_ABSPATH; + } + + /** + * Returns a WordPress option + * @author Webnus + * @param string $option + * @param mixed $default + * @return mixed + */ + public function get_option($option, $default = NULL) + { + return get_option($option, $default); + } + + /** + * Returns WordPress categories based on arguments + * @author Webnus + * @param array $args + * @return array + */ + public function get_categories($args = array()) + { + return get_categories($args); + } + + /** + * Returns WordPress tags based on arguments + * @author Webnus + * @param array $args + * @return array + */ + public function get_tags($args = array()) + { + return get_tags($args); + } + + /** + * Convert location string to latitude and longitude + * @author Webnus + * @param string $address + * @return array + */ + public function get_lat_lng($address) + { + $address = urlencode($address); + if (!trim($address)) return array(0, 0); + + // MEC Settings + $settings = $this->get_settings(); + + $url1 = "https://maps.googleapis.com/maps/api/geocode/json?address=" . $address . ((isset($settings['google_maps_api_key']) and trim($settings['google_maps_api_key']) != '') ? '&key=' . $settings['google_maps_api_key'] : ''); + $url2 = 'http://www.datasciencetoolkit.org/maps/api/geocode/json?sensor=false&address=' . $address; + + // Get Latitide and Longitude by First URL + $JSON = wp_remote_retrieve_body(wp_remote_get($url1, array( + 'body' => null, + 'timeout' => '10', + 'redirection' => '10', + ))); + + $data = json_decode($JSON, true); + + $location_point = isset($data['results'][0]) ? $data['results'][0]['geometry']['location'] : []; + if ((isset($location_point['lat']) and $location_point['lat']) and (isset($location_point['lng']) and $location_point['lng'])) { + return array($location_point['lat'], $location_point['lng']); + } + + // Get Latitide and Longitude by Second URL + $JSON = wp_remote_retrieve_body(wp_remote_get($url2, array( + 'body' => null, + 'timeout' => '10', + 'redirection' => '10', + ))); + + $data = json_decode($JSON, true); + + $location_point = isset($data['results'][0]) ? $data['results'][0]['geometry']['location'] : []; + if ((isset($location_point['lat']) and $location_point['lat']) and (isset($location_point['lng']) and $location_point['lng'])) { + return array($location_point['lat'], $location_point['lng']); + } + + return array(0, 0); + } + + /** + * @author Webnus + * @return string + */ + public function get_default_label_color() + { + return apply_filters('mec_default_label_color', '#fefefe'); + } + + /** + * @author Webnus + * @param mixed $event + * @return string + */ + public function get_post_content($event) + { + if (is_object($event)) $event_id = $event->data->ID; + else $event_id = $event; + + $post = get_post($event_id); + if (!$post) return NULL; + + $content = apply_filters('the_content', str_replace('[MEC ', '', $post->post_content)); + return str_replace(']]>', ']]>', do_shortcode($content)); + } + + /** + * @author Webnus + * @param int $post_id + * @param boolean $skip + * @return array + */ + public function get_post_meta($post_id, $skip = false) + { + // Cache + $cache = $this->getCache(); + + // Return From Cache + return $cache->rememberOnce('meta-' . $post_id . '-' . ($skip ? 1 : 0), function () use ($post_id, $skip) { + $raw_data = get_post_meta($post_id, '', true); + $data = []; + + // Invalid Raw Data + if (!is_array($raw_data)) return $data; + + foreach ($raw_data as $key => $val) { + if ($skip and strpos($key, 'mec') === false and strpos($key, 'event') === false) continue; + $data[$key] = isset($val[0]) ? (!is_serialized($val[0]) ? $val[0] : unserialize($val[0])) : NULL; + } + + return $data; + }); + } + + /** + * @author Webnus + * @return array + */ + public function get_skins() + { + $skins = array( + 'list' => __('List View', 'modern-events-calendar-lite'), + 'grid' => __('Grid View', 'modern-events-calendar-lite'), + 'agenda' => __('Agenda View', 'modern-events-calendar-lite'), + 'full_calendar' => __('Full Calendar', 'modern-events-calendar-lite'), + 'yearly_view' => __('Yearly View', 'modern-events-calendar-lite'), + 'monthly_view' => __('Calendar/Monthly View', 'modern-events-calendar-lite'), + 'daily_view' => __('Daily View', 'modern-events-calendar-lite'), + 'weekly_view' => __('Weekly View', 'modern-events-calendar-lite'), + 'timetable' => __('Timetable View', 'modern-events-calendar-lite'), + 'masonry' => __('Masonry View', 'modern-events-calendar-lite'), + 'map' => __('Map View', 'modern-events-calendar-lite'), + 'cover' => __('Cover View', 'modern-events-calendar-lite'), + 'countdown' => __('Countdown View', 'modern-events-calendar-lite'), + 'available_spot' => __('Available Spot', 'modern-events-calendar-lite'), + 'carousel' => __('Carousel View', 'modern-events-calendar-lite'), + 'slider' => __('Slider View', 'modern-events-calendar-lite'), + 'timeline' => __('Timeline View', 'modern-events-calendar-lite'), + 'tile' => __('Tile View', 'modern-events-calendar-lite'), + 'general_calendar' => __('General Calendar', 'modern-events-calendar-lite'), + ); + + return apply_filters('mec_calendar_skins', $skins); + } + + public function get_months_labels() + { + $labels = array( + 1 => date_i18n('F', strtotime(date('Y') . '-01-01')), + 2 => date_i18n('F', strtotime(date('Y') . '-02-01')), + 3 => date_i18n('F', strtotime(date('Y') . '-03-01')), + 4 => date_i18n('F', strtotime(date('Y') . '-04-01')), + 5 => date_i18n('F', strtotime(date('Y') . '-05-01')), + 6 => date_i18n('F', strtotime(date('Y') . '-06-01')), + 7 => date_i18n('F', strtotime(date('Y') . '-07-01')), + 8 => date_i18n('F', strtotime(date('Y') . '-08-01')), + 9 => date_i18n('F', strtotime(date('Y') . '-09-01')), + 10 => date_i18n('F', strtotime(date('Y') . '-10-01')), + 11 => date_i18n('F', strtotime(date('Y') . '-11-01')), + 12 => date_i18n('F', strtotime(date('Y') . '-12-01')), + ); + + + return apply_filters('mec_months_labels', $labels); + } + + /** + * Returns weekday labels + * @author Webnus + * @param integer $week_start + * @return array + */ + public function get_weekday_labels($week_start = NULL) + { + if (is_null($week_start)) $week_start = $this->get_first_day_of_week(); + + /** + * Please don't change it to translate-able strings + */ + $raw = array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'); + + $labels = array_slice($raw, $week_start); + $rest = array_slice($raw, 0, $week_start); + + foreach ($rest as $label) $labels[] = $label; + + return apply_filters('mec_weekday_labels', $labels); + } + + /** + * Returns abbr weekday labels + * @author Webnus + * @return array + */ + public function get_weekday_abbr_labels() + { + $week_start = $this->get_first_day_of_week(); + $raw = array( + $this->m('weekdays_su', esc_html__('SU', 'modern-events-calendar-lite')), + $this->m('weekdays_mo', esc_html__('MO', 'modern-events-calendar-lite')), + $this->m('weekdays_tu', esc_html__('TU', 'modern-events-calendar-lite')), + $this->m('weekdays_we', esc_html__('WE', 'modern-events-calendar-lite')), + $this->m('weekdays_th', esc_html__('TH', 'modern-events-calendar-lite')), + $this->m('weekdays_fr', esc_html__('FR', 'modern-events-calendar-lite')), + $this->m('weekdays_sa', esc_html__('SA', 'modern-events-calendar-lite')) + ); + + $labels = array_slice($raw, $week_start); + $rest = array_slice($raw, 0, $week_start); + + foreach ($rest as $label) $labels[] = $label; + + return apply_filters('mec_weekday_abbr_labels', $labels); + } + + /** + * Returns translatable weekday labels + * @author Webnus + * @return array + */ + public function get_weekday_i18n_labels() + { + $week_start = $this->get_first_day_of_week(); + $raw = array(array(7, esc_html__('Sunday', 'modern-events-calendar-lite')), array(1, esc_html__('Monday', 'modern-events-calendar-lite')), array(2, esc_html__('Tuesday', 'modern-events-calendar-lite')), array(3, esc_html__('Wednesday', 'modern-events-calendar-lite')), array(4, esc_html__('Thursday', 'modern-events-calendar-lite')), array(5, esc_html__('Friday', 'modern-events-calendar-lite')), array(6, esc_html__('Saturday', 'modern-events-calendar-lite'))); + + $labels = array_slice($raw, $week_start); + $rest = array_slice($raw, 0, $week_start); + + foreach ($rest as $label) $labels[] = $label; + + return apply_filters('mec_weekday_i18n_labels', $labels); + } + + /** + * Flush WordPress rewrite rules + * @author Webnus + */ + public function flush_rewrite_rules() + { + // Register Events Post Type + $MEC_events = MEC::getInstance('app.features.events', 'MEC_feature_events'); + $MEC_events->register_post_type(); + + flush_rewrite_rules(); + } + + /** + * Get single slug of MEC + * @author Webnus + * @return string + */ + public function get_single_slug() + { + $settings = $this->get_settings(); + $slug = (isset($settings['single_slug']) and trim($settings['single_slug']) != '') ? $settings['single_slug'] : 'event'; + + return strtolower($slug); + } + + /** + * Returns main slug of MEC + * @author Webnus + * @return string + */ + public function get_main_slug() + { + $settings = $this->get_settings(); + $slug = (isset($settings['slug']) and trim($settings['slug']) != '') ? $settings['slug'] : 'events'; + + return strtolower($slug); + } + + /** + * Returns category slug of MEC + * @author Webnus + * @return string + */ + public function get_category_slug() + { + $settings = $this->get_settings(); + $slug = (isset($settings['category_slug']) and trim($settings['category_slug']) != '') ? $settings['category_slug'] : 'mec-category'; + + return strtolower($slug); + } + + /** + * Get archive page title + * @param bool $meta + * @return string + * @author Webnus + */ + public function get_archive_title($meta = true) + { + $settings = $this->get_settings(); + $archive_title = (isset($settings['archive_title']) and trim($settings['archive_title']) != '') ? $settings['archive_title'] : 'Events'; + + // Add Blog Name + if ($meta and apply_filters('mec_archive_title_add_blog_name', true)) $archive_title .= ' - ' . get_bloginfo('name'); + + return apply_filters('mec_archive_title', $archive_title); + } + + public function get_archive_url() + { + $archive_link = get_post_type_archive_link($this->get_main_post_type()); + + // Archive is disabled + if ($archive_link === false) { + $archive_page = get_page_by_path('events2'); + if ($archive_page) $archive_link = get_permalink($archive_page); + } + + return $archive_link; + } + + /** + * @author Webnus + * @return string + */ + public function get_archive_thumbnail() + { + return apply_filters('mec_archive_thumbnail', ''); + } + + /** + * @author Webnus + * @return string + */ + public function get_single_thumbnail() + { + return apply_filters('mec_single_thumbnail', ''); + } + + /** + * @author Webnus + * @return string + */ + public function get_main_post_type() + { + return apply_filters('mec_post_type_name', 'mec-events'); + } + + /** + * Returns main options of MEC + * @author Webnus + * @param string $locale + * @return array + */ + public function get_options($locale = NULL) + { + if ($locale) { + $options = get_option('mec_options_' . strtolower($locale), array()); + if (!is_array($options) || !count($options)) $options = get_option('mec_options', array()); + + return $options; + } else return get_option('mec_options', array()); + } + + /** + * Returns Multilingual options of MEC + * @author Webnus + * @param string $key + * @param string $locale + * @return array + */ + public function get_ml_settings($key = NULL, $locale = NULL) + { + if (!$locale) $locale = $this->get_current_locale(); + + $options = get_option('mec_options_ml_' . strtolower($locale), array()); + if (!$this->is_multilingual() or !is_array($options) or (is_array($options) and !count($options))) { + $all = get_option('mec_options', array()); + if (!is_array($all)) $all = []; + + $options = (isset($all['settings']) ? $all['settings'] : array()); + } + + return ($key ? (isset($options[$key]) ? $options[$key] : NULL) : $options); + } + + /** + * Returns MEC settings menus + * @author Webnus + * @param string $active_menu + * @return void + */ + public function get_sidebar_menu($active_menu = 'settings') + { + $options = $this->get_settings(); + $settings = apply_filters('mec-settings-items-settings', array( + esc_html__('General', 'modern-events-calendar-lite') => 'general_option', + esc_html__('Archive Pages', 'modern-events-calendar-lite') => 'archive_options', + esc_html__('Slugs/Permalinks', 'modern-events-calendar-lite') => 'slug_option', + esc_html__('Currency', 'modern-events-calendar-lite') => 'currency_option', + esc_html__('Security Captcha', 'modern-events-calendar-lite') => 'captcha_option', + esc_html__('Search', 'modern-events-calendar-lite') => 'search_options', + ), $active_menu); + + $integrations = apply_filters('mec-settings-items-integrations', array( + esc_html__('Mailchimp', 'modern-events-calendar-lite') => 'mailchimp_option', + esc_html__('Campaign Monitor', 'modern-events-calendar-lite') => 'campaign_monitor_option', + esc_html__('MailerLite', 'modern-events-calendar-lite') => 'mailerlite_option', + esc_html__('Constant Contact', 'modern-events-calendar-lite') => 'constantcontact_option', + esc_html__('Active Campaign', 'modern-events-calendar-lite') => 'active_campaign_option', + esc_html__('AWeber', 'modern-events-calendar-lite') => 'aweber_option', + esc_html__('MailPoet', 'modern-events-calendar-lite') => 'mailpoet_option', + esc_html__('Sendfox', 'modern-events-calendar-lite') => 'sendfox_option', + esc_html__('BuddyPress', 'modern-events-calendar-lite') => 'buddy_option', + esc_html__('LearnDash', 'modern-events-calendar-lite') => 'learndash_options', + esc_html__('Paid Membership Pro', 'modern-events-calendar-lite') => 'pmp_options', + ), $active_menu); + + $single_event = apply_filters('mec-settings-item-single_event', array( + esc_html__('Single Event Page', 'modern-events-calendar-lite') => 'event_options', + esc_html__('Custom Fields', 'modern-events-calendar-lite') => 'event_form_option', + esc_html__('Sidebar', 'modern-events-calendar-lite') => 'single_sidebar_options', + esc_html__('Icons', 'modern-events-calendar-lite') => 'single_icons_options', + ), $active_menu); + + $booking = apply_filters('mec-settings-item-booking', array( + $this->m('booking', esc_html__('Booking', 'modern-events-calendar-lite')) => 'booking_option', + sprintf(esc_html__('%s Elements', 'modern-events-calendar-lite'), $this->m('booking', esc_html__('Booking', 'modern-events-calendar-lite'))) => 'booking_elements', + esc_html__('Global Tickets', 'modern-events-calendar-lite') => 'booking_tickets_option', + sprintf(esc_html__('%s Form', 'modern-events-calendar-lite'), $this->m('booking', esc_html__('Booking', 'modern-events-calendar-lite'))) => 'booking_form_option', + esc_html__('Payment Gateways', 'modern-events-calendar-lite') => 'payment_gateways_option', + esc_html__('MEC Cart', 'modern-events-calendar-lite') => 'cart_option', + esc_html__('Ticket Variations & Options', 'modern-events-calendar-lite') => 'ticket_variations_option', + esc_html__('Taxes / Fees', 'modern-events-calendar-lite') => 'taxes_option', + esc_html__('Coupons', 'modern-events-calendar-lite') => 'coupon_option', + ), $active_menu); + + $modules = apply_filters('mec-settings-item-modules', array( + esc_html__('Speakers', 'modern-events-calendar-lite') => 'speakers_option', + esc_html__('Organizers', 'modern-events-calendar-lite') => 'organizers_option', + esc_html__('Locations', 'modern-events-calendar-lite') => 'locations_option', + esc_html__('Countdown', 'modern-events-calendar-lite') => 'countdown_option', + esc_html__('Map', 'modern-events-calendar-lite') => 'googlemap_option', + esc_html__('Exceptional Days', 'modern-events-calendar-lite') => 'exceptional_option', + esc_html__('Local Time', 'modern-events-calendar-lite') => 'time_module_option', + esc_html__('Progress Bar', 'modern-events-calendar-lite') => 'progress_bar_option', + esc_html__('Event Gallery', 'modern-events-calendar-lite') => 'event_gallery_option', + esc_html__('QR Code', 'modern-events-calendar-lite') => 'qrcode_module_option', + esc_html__('Weather', 'modern-events-calendar-lite') => 'weather_module_option', + esc_html__('Related Events', 'modern-events-calendar-lite') => 'related_events', + esc_html__('Social Networks', 'modern-events-calendar-lite') => 'social_options', + esc_html__('Event Export', 'modern-events-calendar-lite') => 'export_module_option', + esc_html__('Next Event', 'modern-events-calendar-lite') => 'next_event_option', + esc_html__('Next / Previous Events', 'modern-events-calendar-lite') => 'next_previous_events', + ), $active_menu); + + $FES = apply_filters('mec-settings-items-fes', array( + esc_html__('General', 'modern-events-calendar-lite') => 'fes_general_options', + esc_html__('Access Level', 'modern-events-calendar-lite') => 'fes_acl_options', + esc_html__('FES Sections', 'modern-events-calendar-lite') => 'fes_section_options', + esc_html__('Required Fields', 'modern-events-calendar-lite') => 'fes_req_fields_options', + ), $active_menu); + + $notifications_items = array( + esc_html__('Options', 'modern-events-calendar-lite') => 'notification_options', + esc_html__('New Event', 'modern-events-calendar-lite') => 'new_event', + esc_html__('User Event Publishing', 'modern-events-calendar-lite') => 'user_event_publishing', + ); + + if ($this->getPRO()) + { + $settings[esc_html__('RESTful API', 'modern-events-calendar-lite')] = 'restful_api_options'; + + $notifications_items = [ + esc_html__('Options', 'modern-events-calendar-lite') => 'notification_options', + esc_html__('Booking', 'modern-events-calendar-lite') => 'booking_notification_section', + esc_html__('Booking Confirmation', 'modern-events-calendar-lite') => 'booking_confirmation', + esc_html__('Booking Rejection', 'modern-events-calendar-lite') => 'booking_rejection', + esc_html__('Booking Verification', 'modern-events-calendar-lite') => 'booking_verification', + esc_html__('Booking Cancellation', 'modern-events-calendar-lite') => 'cancellation_notification', + esc_html__('Booking Reminder', 'modern-events-calendar-lite') => 'booking_reminder', + esc_html__('Booking Reschedule', 'modern-events-calendar-lite') => 'booking_moved', + esc_html__('Event Soldout', 'modern-events-calendar-lite') => 'event_soldout', + esc_html__('Admin', 'modern-events-calendar-lite') => 'admin_notification', + esc_html__('Event Finished', 'modern-events-calendar-lite') => 'event_finished', + esc_html__('New Event', 'modern-events-calendar-lite') => 'new_event', + esc_html__('User Event Publishing', 'modern-events-calendar-lite') => 'user_event_publishing', + esc_html__('Auto Emails', 'modern-events-calendar-lite') => 'auto_emails_option', + esc_html__('Suggest Event', 'modern-events-calendar-lite') => 'suggest_event', + ]; + + // Certificate + if (isset($options['certificate_status']) && $options['certificate_status']) { + $notifications_items[esc_html__('Certification', 'modern-events-calendar-lite')] = 'certificate_send'; + } + + $modules = apply_filters('mec-settings-item-modules', [ + esc_html__('Speakers', 'modern-events-calendar-lite') => 'speakers_option', + esc_html__('Organizers', 'modern-events-calendar-lite') => 'organizers_option', + esc_html__('Sponsors', 'modern-events-calendar-lite') => 'sponsors_option', + esc_html__('Locations', 'modern-events-calendar-lite') => 'locations_option', + esc_html__('Countdown', 'modern-events-calendar-lite') => 'countdown_option', + esc_html__('Map', 'modern-events-calendar-lite') => 'googlemap_option', + esc_html__('Exceptional Days', 'modern-events-calendar-lite') => 'exceptional_option', + esc_html__('Local Time', 'modern-events-calendar-lite') => 'time_module_option', + esc_html__('Progress Bar', 'modern-events-calendar-lite') => 'progress_bar_option', + esc_html__('Event Gallery', 'modern-events-calendar-lite') => 'event_gallery_option', + esc_html__('QR Code', 'modern-events-calendar-lite') => 'qrcode_module_option', + esc_html__('Weather', 'modern-events-calendar-lite') => 'weather_module_option', + esc_html__('Related Events', 'modern-events-calendar-lite') => 'related_events', + esc_html__('Social Networks', 'modern-events-calendar-lite') => 'social_options', + esc_html__('Export', 'modern-events-calendar-lite') => 'export_module_option', + esc_html__('Next Event', 'modern-events-calendar-lite') => 'next_event_option', + esc_html__('Next / Previous Events', 'modern-events-calendar-lite') => 'next_previous_events', + esc_html__('Certificates', 'modern-events-calendar-lite') => 'certificate_options', + esc_html__('SMS', 'modern-events-calendar-lite') => 'sms_options', + ], $active_menu); + } + + $notifications = apply_filters('mec-settings-item-notifications', $notifications_items, $active_menu); +?> + + + + * @return array + */ + public function get_settings() + { + $options = $this->get_options(); + return (isset($options['settings']) ? $options['settings'] : array()); + } + + /** + * Returns MEC addons message + * @author Webnus + * @return string + */ + public function addons_msg() + { + $get_n_option = get_option('mec_addons_notification_option'); + if ($get_n_option == 'open') return ''; + + return ' +
        +
        +
        +
        ' . esc_html__('New Addons For MEC! Now Customize MEC in Elementor', 'modern-events-calendar-lite') . '
        +
        +
        + +
        +
        +
        +

        ' . esc_html__('The time has come at last, and the new practical add-ons for MEC have been released. This is a revolution in the world of Event Calendars. We have provided you with a wide range of features only by having the 4 add-ons below:', 'modern-events-calendar-lite') . '

        +
          +
        1. ' . esc_html__('WooCommerce Integration: You can now purchase ticket (as products) and Woo products at the same time.', 'modern-events-calendar-lite') . '
        2. +
        3. ' . esc_html__('Event API: display your events (shortcodes/single event) on other websites without MEC. Use JSON output features to make your Apps compatible with MEC.', 'modern-events-calendar-lite') . '
        4. +
        5. ' . esc_html__('Multisite Event Sync: Sync events between your subsites and main websites. Changes in the main one will be inherited by the subsites. you can set these up in the admin panel.', 'modern-events-calendar-lite') . '
        6. +
        7. ' . esc_html__('User Dashboard: Create exclusive pages for users. These pages can contain ticket purchase information, information about registered events. Users can now log in to purchase tickets.', 'modern-events-calendar-lite') . '
        8. +
        + ' . esc_html__('find out more', 'modern-events-calendar-lite') . ' +
        +
        +
        +
        +
        +
        + '; + } + + /** + * Returns MEC custom message 2 + * @author Webnus + * @return string + */ + public function mec_custom_msg_2($display_option = '', $message = '') + { + $get_cmsg_display_option = get_option('mec_custom_msg_2_display_option'); + $get_mec_saved_message_time = get_option('mec_saved_message_2_time'); + $data_url = 'https://files.webnus.site/addons-api/mec-extra-content-2.json'; + + if (!isset($get_mec_saved_message_time)): + if (ini_get('allow_url_fopen')) { + $body = @file_get_contents(plugin_dir_path(__FILE__) . '../api/addons-api/mec-extra-content-2.json'); + } + $obj = json_decode($body); + update_option('mec_saved_message_2_time', date("Y-m-d")); + else: + if (strtotime(date("Y-m-d")) > strtotime($get_mec_saved_message_time)) { + if (ini_get('allow_url_fopen')) { + $body = @file_get_contents(plugin_dir_path(__FILE__) . '../api/addons-api/mec-extra-content-2.json'); + } + $obj = json_decode($body); + update_option('mec_saved_message_2_time', date("Y-m-d")); + } else { + $mec_custom_msg_html = get_option('mec_custom_msg_2_html'); + $mec_custom_msg_display = get_option('mec_custom_msg_2_display'); + if ($get_cmsg_display_option != $mec_custom_msg_display) : + update_option('mec_custom_msg_2_display_option', $mec_custom_msg_display); + update_option('mec_custom_msg_2_close_option', 'close'); + update_option('mec_saved_message_2_time', date("Y-m-d")); + return $mec_custom_msg_html; + else: + $get_cmsg_close_option = get_option('mec_custom_msg_2_close_option'); + update_option('mec_saved_message_2_time', date("Y-m-d")); + if ($get_cmsg_close_option == 'open') return ''; + return $mec_custom_msg_html; + endif; + } + endif; + + if (!empty($obj)) { + $display = ''; + $html = ''; + + foreach ($obj as $value) { + $html = '
        Announcement
        Square Payment

        As promised, another one of the most-requested addons by you, Square Payment, is released this week. The first six addons are out already. Webex Integration and Social Auto Poster and Elementor FES Builder and Seat and Gutenberg Single Builder and Square Payment are now available on our website for purchase.

        Read More
        '; + update_option('mec_custom_msg_2_html', $html); + $display = $value->display; + update_option('mec_custom_msg_2_display', $display); + } + + if ($get_cmsg_display_option != $display) { + update_option('mec_custom_msg_2_display_option', $display); + update_option('mec_custom_msg_2_close_option', 'close'); + } else { + $get_cmsg_close_option = get_option('mec_custom_msg_2_close_option'); + if ($get_cmsg_close_option === 'open') return ''; + } + + return $html; + } + + return ''; + } + + /** + * Returns MEC custom message + * @author Webnus + * @return array + */ + public function mec_custom_msg($display_option = '', $message = '') + { + $get_cmsg_display_option = get_option('mec_custom_msg_display_option'); + $get_mec_saved_message_time = get_option('mec_saved_message_time'); + $data_url = 'https://files.webnus.site/addons-api/mec-extra-content.json'; + + if (!isset($get_mec_saved_message_time)): + if (ini_get('allow_url_fopen')) { + $body = @file_get_contents(plugin_dir_path(__FILE__) . '../api/addons-api/mec-extra-content.json'); + } + $obj = json_decode($body); + update_option('mec_saved_message_time', date("Y-m-d")); + else: + if (strtotime(date("Y-m-d")) > strtotime($get_mec_saved_message_time)) { + if (ini_get('allow_url_fopen')) { + $body = @file_get_contents(plugin_dir_path(__FILE__) . '../api/addons-api/mec-extra-content.json'); + } + $obj = json_decode($body); + update_option('mec_saved_message_time', date("Y-m-d")); + } else { + $mec_custom_msg_html = get_option('mec_custom_msg_html'); + $mec_custom_msg_display = get_option('mec_custom_msg_display'); + if ($get_cmsg_display_option != $mec_custom_msg_display) : + update_option('mec_custom_msg_display_option', $mec_custom_msg_display); + update_option('mec_custom_msg_close_option', 'close'); + update_option('mec_saved_message_time', date("Y-m-d")); + return $mec_custom_msg_html; + elseif ($get_cmsg_display_option == $mec_custom_msg_display) : + $get_cmsg_close_option = get_option('mec_custom_msg_close_option'); + update_option('mec_saved_message_time', date("Y-m-d")); + if ($get_cmsg_close_option == 'open') return; + return $mec_custom_msg_html; + endif; + } + endif; + + if (!empty($obj)) : + foreach ($obj as $key => $value) { + $html = '
        Announcement
        Liquid View Layouts

        As promised, another one of the most-requested addons by you, Liquid View Layouts, is released this week. The all addons are out already. Webex Integration and Social Auto Poster and Elementor FES Builder and Seat and Gutenberg Single Builder and Square Payment and Liquid View Layouts are now available on our website for purchase.

        Read More
        '; + update_option('mec_custom_msg_html', $html); + $display = $value->display; + update_option('mec_custom_msg_display', $display); + } + + if ($get_cmsg_display_option != $display) : + update_option('mec_custom_msg_display_option', $display); + update_option('mec_custom_msg_close_option', 'close'); + return $html; + elseif ($get_cmsg_display_option == $display) : + $get_cmsg_close_option = get_option('mec_custom_msg_close_option'); + if ($get_cmsg_close_option == 'open') return; + return $html; + endif; + else: + return ''; + endif; + } + /** + * Returns MEC settings + * @author Webnus + * @return array + */ + public function get_default_form() + { + $options = $this->get_options(); + return $options['default_form'] ?? []; + } + + /** + * Returns registration form fields + * @author Webnus + * @param integer $event_id + * @param integer $translated_event_id + * @return array + */ + public function get_reg_fields($event_id = NULL, $translated_event_id = NULL) + { + $options = $this->get_options(); + $reg_fields = $options['reg_fields'] ?? []; + + // Event Booking Fields + if ($event_id) { + $global_inheritance = get_post_meta($event_id, 'mec_reg_fields_global_inheritance', true); + if (trim($global_inheritance) == '') $global_inheritance = 1; + + if (!$global_inheritance) { + $event_reg_fields = get_post_meta($event_id, 'mec_reg_fields', true); + if (is_array($event_reg_fields)) $reg_fields = $event_reg_fields; + + // We're getting fields for a translated event + if ($translated_event_id and $event_id != $translated_event_id) { + $translated_reg_fields = get_post_meta($translated_event_id, 'mec_reg_fields', true); + if (!is_array($translated_reg_fields)) $translated_reg_fields = []; + + foreach ($translated_reg_fields as $field_id => $translated_reg_field) { + if (!isset($reg_fields[$field_id])) continue; + if (isset($translated_reg_field['label']) and trim($translated_reg_field['label'])) $reg_fields[$field_id]['label'] = $translated_reg_field['label']; + if (isset($translated_reg_field['options']) and is_array($translated_reg_field['options'])) $reg_fields[$field_id]['options'] = $translated_reg_field['options']; + } + } + } + } + + return apply_filters('mec_get_reg_fields', $reg_fields, $event_id); + } + + /** + * Returns booking fixed fields + * @author Webnus + * @param integer $event_id + * @param integer $translated_event_id + * @return array + */ + public function get_bfixed_fields($event_id = NULL, $translated_event_id = NULL) + { + $options = $this->get_options(); + $bfixed_fields = $options['bfixed_fields'] ?? []; + + // Event Fields + if ($event_id) { + $global_inheritance = get_post_meta($event_id, 'mec_reg_fields_global_inheritance', true); + if (trim($global_inheritance) == '') $global_inheritance = 1; + + if (!$global_inheritance) { + $event_bfixed_fields = get_post_meta($event_id, 'mec_bfixed_fields', true); + if (is_array($event_bfixed_fields)) $bfixed_fields = $event_bfixed_fields; + + // We're getting fields for a translated event + if ($translated_event_id and $event_id != $translated_event_id) { + $translated_bfixed_fields = get_post_meta($translated_event_id, 'mec_bfixed_fields', true); + if (!is_array($translated_bfixed_fields)) $translated_bfixed_fields = []; + + foreach ($translated_bfixed_fields as $field_id => $translated_bfixed_field) { + if (!isset($bfixed_fields[$field_id])) continue; + if (isset($translated_bfixed_field['label']) and trim($translated_bfixed_field['label'])) $bfixed_fields[$field_id]['label'] = $translated_bfixed_field['label']; + if (isset($translated_bfixed_field['options']) and is_array($translated_bfixed_field['options'])) $bfixed_fields[$field_id]['options'] = $translated_bfixed_field['options']; + } + } + } + } + + return apply_filters('mec_get_bfixed_fields', $bfixed_fields, $event_id); + } + + /** + * Returns event form fields + * @author Webnus + * @return array + */ + public function get_event_fields() + { + $options = $this->get_options(); + $event_fields = $options['event_fields'] ?? []; + + if (isset($event_fields[':i:'])) unset($event_fields[':i:']); + if (isset($event_fields[':fi:'])) unset($event_fields[':fi:']); + + return apply_filters('mec_get_event_fields', $event_fields); + } + + /** + * Returns Ticket Variations + * @author Webnus + * @param integer $event_id + * @param integer $ticket_id + * @return array + */ + public function ticket_variations($event_id = NULL, $ticket_id = NULL) + { + $settings = $this->get_settings(); + $ticket_variations = (isset($settings['ticket_variations']) and is_array($settings['ticket_variations'])) ? $settings['ticket_variations'] : []; + + // Event Ticket Variations + if ($event_id) { + $global_inheritance = get_post_meta($event_id, 'mec_ticket_variations_global_inheritance', true); + if (trim($global_inheritance) == '') $global_inheritance = 1; + + if (!$global_inheritance) { + $event_ticket_variations = get_post_meta($event_id, 'mec_ticket_variations', true); + if (is_array($event_ticket_variations)) $ticket_variations = $event_ticket_variations; + } + + // Variations Per Ticket + if ($ticket_id) { + $tickets = get_post_meta($event_id, 'mec_tickets', true); + $ticket = ((isset($tickets[$ticket_id]) and is_array($tickets[$ticket_id])) ? $tickets[$ticket_id] : array()); + + $event_inheritance = $ticket['variations_event_inheritance'] ?? 1; + if (!$event_inheritance and isset($ticket['variations']) and is_array($ticket['variations'])) $ticket_variations = $ticket['variations']; + } + } + + // Clean + if (isset($ticket_variations[':i:'])) unset($ticket_variations[':i:']); + if (isset($ticket_variations[':v:'])) unset($ticket_variations[':v:']); + + return $ticket_variations; + } + + public function has_variations_per_ticket($event_id, $ticket_id) + { + $has = false; + + $tickets = get_post_meta($event_id, 'mec_tickets', true); + $ticket = ((isset($tickets[$ticket_id]) and is_array($tickets[$ticket_id])) ? $tickets[$ticket_id] : array()); + + $event_inheritance = $ticket['variations_event_inheritance'] ?? 1; + if (!$event_inheritance and isset($ticket['variations']) and is_array($ticket['variations'])) $has = true; + + return $has; + } + + /** + * Returns Messages Options + * @author Webnus + * @param string $locale + * @return array + */ + public function get_messages_options($locale = NULL) + { + if ($this->is_multilingual() and !$locale) $locale = $this->get_current_language(); + + $options = $this->get_options($locale); + return $options['messages'] ?? []; + } + + /** + * Returns gateways options + * @author Webnus + * @return array + */ + public function get_gateways_options() + { + $options = $this->get_options(); + return $options['gateways'] ?? []; + } + /** + * Returns notifications settings of MEC + * @author Webnus + * @param string $locale + * @return array + */ + public function get_notifications($locale = NULL) + { + if ($this->is_multilingual() and !$locale) $locale = $this->get_current_language(); + + $options = $this->get_options($locale); + return $options['notifications'] ?? []; + } + + /** + * Returns Import/Export options of MEC + * @author Webnus + * @return array + */ + public function get_ix_options() + { + $options = $this->get_options(); + return $options['ix'] ?? []; + } + + /** + * Returns style settings of MEC + * @author Webnus + * @return array + */ + public function get_styles() + { + $options = $this->get_options(); + return $options['styles'] ?? []; + } + + /** + * Returns styling option of MEC + * @author Webnus + * @return array + */ + public function get_styling() + { + $options = $this->get_options(); + return $options['styling'] ?? []; + } + + /** + * Saves MEC settings + * @author Webnus + * @return void + */ + public function save_options() + { + $wpnonce = isset($_REQUEST['_wpnonce']) ? sanitize_text_field($_REQUEST['_wpnonce']) : NULL; + + // Check if our nonce is set. + if (!trim($wpnonce)) $this->response(array('success' => 0, 'code' => 'NONCE_MISSING')); + + // Verify that the nonce is valid. + if (!wp_verify_nonce($wpnonce, 'mec_options_form')) $this->response(array('success' => 0, 'code' => 'NONCE_IS_INVALID')); + + // Current User is not Permitted + if (!current_user_can('mec_settings') and !current_user_can('administrator')) $this->response(array('success' => 0, 'code' => 'ADMIN_ONLY')); + + // Get mec options + $mec = isset($_REQUEST['mec']) ? $this->sanitize_deep_array($_REQUEST['mec']) : []; + + if (isset($mec['reg_fields']) and !is_array($mec['reg_fields'])) $mec['reg_fields'] = []; + if (isset($mec['bfixed_fields']) and !is_array($mec['bfixed_fields'])) $mec['bfixed_fields'] = []; + if (isset($mec['event_fields']) and !is_array($mec['event_fields'])) $mec['event_fields'] = []; + + $filtered = []; + foreach ($mec as $key => $value) $filtered[$key] = (is_array($value) ? $value : array()); + + // Get current MEC options + $current = get_option('mec_options', array()); + if (is_string($current) and trim($current) == '') $current = []; + + // Validations + if (isset($filtered['settings']) and isset($filtered['settings']['slug'])) $filtered['settings']['slug'] = strtolower(str_replace(' ', '-', $filtered['settings']['slug'])); + if (isset($filtered['settings']) and isset($filtered['settings']['category_slug'])) $filtered['settings']['category_slug'] = strtolower(str_replace(' ', '-', $filtered['settings']['category_slug'])); + if (isset($filtered['settings']) and isset($filtered['settings']['custom_archive'])) $filtered['settings']['custom_archive'] = isset($filtered['settings']['custom_archive']) ? str_replace('\"', '"', $filtered['settings']['custom_archive']) : ''; + + // Bellow conditional block codes is used for sortable booking form items. + if (isset($filtered['reg_fields'])) { + if (!is_array($filtered['reg_fields'])) $filtered['reg_fields'] = []; + } + + if (isset($current['reg_fields']) and isset($filtered['reg_fields'])) { + $current['reg_fields'] = $filtered['reg_fields']; + } + + // Bellow conditional block codes is used for sortable booking fixed form items. + if (isset($filtered['bfixed_fields'])) { + if (!is_array($filtered['bfixed_fields'])) $filtered['bfixed_fields'] = []; + } + + if (isset($current['bfixed_fields']) and isset($filtered['bfixed_fields'])) { + $current['bfixed_fields'] = $filtered['bfixed_fields']; + } + + // Bellow conditional block codes is used for sortable event form items. + if (isset($filtered['event_fields'])) { + if (!is_array($filtered['event_fields'])) $filtered['event_fields'] = []; + } + + if (isset($current['event_fields']) and isset($filtered['event_fields'])) { + $current['event_fields'] = $filtered['event_fields']; + } + + // Tag Method Changed + $old_tag_method = ((isset($current['settings']) and isset($current['settings']['tag_method'])) ? $current['settings']['tag_method'] : 'post_tag'); + if (isset($filtered['settings']) and isset($filtered['settings']['tag_method']) and $filtered['settings']['tag_method'] != $old_tag_method) { + do_action('mec_tag_method_changed', $filtered['settings']['tag_method'], $old_tag_method); + } + + // Third Party Validation + $filtered = apply_filters('mec_validate_general_settings_options', $filtered, $current); + + // Generate New Options + $final = $current; + + // Merge new options with previous options + foreach ($filtered as $key => $value) { + if (is_array($value)) { + foreach ($value as $k => $v) { + // Define New Array + if (!isset($final[$key])) $final[$key] = []; + + // Overwrite Old Value + $final[$key][$k] = $v; + } + } + // Overwrite Old Value + else $final[$key] = $value; + } + + // Disable some options when MEC Cart is enabled + if (isset($final['settings']) and isset($final['settings']['mec_cart_status']) and $final['settings']['mec_cart_status']) { + $final['settings']['wc_status'] = 0; + $final['settings']['currency_per_event'] = 0; + } + + $final = apply_filters('mec_save_options_final', $final); + + // MEC Save Options + do_action('mec_save_options', $final); + + // Multilingual Options + if ($this->is_multilingual()) { + // Locale + $locale = isset($_REQUEST['mec_locale']) ? sanitize_text_field($_REQUEST['mec_locale']) : NULL; + if ($locale) { + $ml_current = get_option('mec_options_ml_' . $locale, array()); + if (is_string($ml_current) and trim($ml_current) == '') $ml_current = []; + + $ml_options = $ml_current; + foreach (array('single_date_format1' => 'settings', 'booking_date_format1' => 'settings') as $k2 => $k1) { + if (isset($filtered[$k1]) and isset($filtered[$k1][$k2])) $ml_options[$k2] = $filtered[$k1][$k2]; + elseif (!isset($ml_options[$k2]) and isset($final[$k1], $final[$k1][$k2])) $ml_options[$k2] = $final[$k1][$k2]; + } + + update_option('mec_options_ml_' . $locale, $ml_options); + } + } + + // Save final options + update_option('mec_options', $final); + + // MEC Saved Options + do_action('mec_saved_options', $final); + + // Refresh WordPress rewrite rules + $this->flush_rewrite_rules(); + + // Print the response + $this->response(array('success' => 1)); + } + + /** + * Saves MEC Notifications + * @author Webnus + */ + public function save_notifications() + { + $wpnonce = isset($_REQUEST['_wpnonce']) ? sanitize_text_field($_REQUEST['_wpnonce']) : NULL; + + // Check if our nonce is set. + if (!trim($wpnonce)) $this->response(array('success' => 0, 'code' => 'NONCE_MISSING')); + + // Verify that the nonce is valid. + if (!wp_verify_nonce($wpnonce, 'mec_options_form')) $this->response(array('success' => 0, 'code' => 'NONCE_IS_INVALID')); + + // Current User is not Permitted + if (!current_user_can('mec_settings') and !current_user_can('administrator')) $this->response(array('success' => 0, 'code' => 'ADMIN_ONLY')); + + // Locale + $locale = isset($_REQUEST['mec_locale']) ? sanitize_text_field($_REQUEST['mec_locale']) : NULL; + + // Get mec options + $mec = isset($_REQUEST['mec']) ? $this->sanitize_deep_array($_REQUEST['mec']) : []; + $notifications = $mec['notifications'] ?? []; + $settings = $mec['settings'] ?? []; + + $rendered = []; + foreach ($notifications as $notif_key => $notification) { + if (isset($notification['receiver_users']) and is_string($notification['receiver_users']) and trim($notification['receiver_users'])) { + $notification['receiver_users'] = array_map('trim', explode(',', $notification['receiver_users'])); + } + + $rendered[$notif_key] = $notification; + } + + // Get current MEC notifications + $current = $this->get_notifications($locale); + if (is_string($current) and trim($current) == '') $current = []; + + // Merge new options with previous options + $final_notifications = []; + $final_notifications['notifications'] = array_merge($current, $rendered); + + $core_options = get_option('mec_options', array()); + if (isset($core_options['settings']) and is_array($core_options['settings'])) $final_notifications['settings'] = array_merge($core_options['settings'], $settings); + + // Get current MEC options + $options = get_option('mec_options', array()); + + if ($this->is_multilingual() and $locale and !is_array($options)) $options = get_option('mec_options_' . strtolower($locale), array()); + if (is_string($options) and trim($options) == '') $options = []; + + // Merge new options with previous options + $final = array_merge($options, $final_notifications); + + if ($this->is_multilingual() and $locale) { + // Save final options + update_option('mec_options_' . strtolower($locale), $final); + + $default_locale = $this->get_current_language(); + if ($default_locale === $locale) update_option('mec_options', $final); + } + + // Save final options + update_option('mec_options', $final); + + // Print the response + $this->response(array('success' => 1)); + } + + /** + * Saves MEC settings + * @author Webnus + * @return void + */ + public function save_messages() + { + // Security Nonce + $wpnonce = isset($_REQUEST['_wpnonce']) ? sanitize_text_field($_REQUEST['_wpnonce']) : NULL; + + // Check if our nonce is set. + if (!trim($wpnonce)) $this->response(array('success' => 0, 'code' => 'NONCE_MISSING')); + + // Verify that the nonce is valid. + if (!wp_verify_nonce($wpnonce, 'mec_options_form')) $this->response(array('success' => 0, 'code' => 'NONCE_IS_INVALID')); + + // Current User is not Permitted + if (!current_user_can('mec_settings') and !current_user_can('administrator')) $this->response(array('success' => 0, 'code' => 'ADMIN_ONLY')); + + // Locale + $locale = isset($_REQUEST['mec_locale']) ? sanitize_text_field($_REQUEST['mec_locale']) : NULL; + + // Get mec options + $mec = isset($_REQUEST['mec']) ? $this->sanitize_deep_array($_REQUEST['mec']) : []; + $messages = isset($mec['messages']) ? $mec['messages'] : []; + + // Get current MEC options + $current = $this->get_messages_options($locale); + if (is_string($current) and trim($current) == '') $current = []; + + // Merge new options with previous options + $final_messages = []; + $final_messages['messages'] = array_merge($current, $messages); + + // Get current MEC options + $options = []; + + if ($this->is_multilingual() and $locale) $options = get_option('mec_options_' . strtolower($locale), array()); + if (!is_array($options) or (is_array($options) and !count($options))) $options = get_option('mec_options', array()); + if (is_string($options) and trim($options) == '') $options = []; + + // Merge new options with previous options + $final = array_merge($options, $final_messages); + + // Multilingual + if ($this->is_multilingual() and $locale) { + // Save final options + update_option('mec_options_' . strtolower($locale), $final); + + $default_locale = $this->get_current_language(); + if ($default_locale === $locale) update_option('mec_options', $final); + } else { + // Save final options + update_option('mec_options', $final); + } + + // Print the response + $this->response(array('success' => 1)); + } + + /** + * Saves MEC Import/Export options + * @author Webnus + * @param array $ix_options + * @return boolean + */ + public function save_ix_options($ix_options = array()) + { + // Current User is not Permitted + $capability = (current_user_can('administrator') ? 'manage_options' : 'mec_import_export'); + if (!current_user_can($capability)) $this->response(array('success' => 0, 'code' => 'ADMIN_ONLY')); + + // Get current MEC ix options + $current = $this->get_ix_options(); + if (is_string($current) and trim($current) == '') $current = []; + + // Merge new options with previous options + $final_ix = []; + $final_ix['ix'] = array_merge($current, $ix_options); + + // Get current MEC options + $options = get_option('mec_options', array()); + if (is_string($options) and trim($options) == '') $options = []; + + // Merge new options with previous options + $final = array_merge($options, $final_ix); + + // Save final options + update_option('mec_options', $final); + + return true; + } + + /** + * Get first day of week from WordPress + * @author Webnus + * @return int + */ + public function get_first_day_of_week() + { + return get_option('start_of_week', 1); + } + + /** + * @author Webnus + * @param array $response + * @return void + */ + public function response($response) + { + wp_send_json($response); + } + + /** + * Check if a date passed or not + * @author Webnus + * @param mixed $end + * @param mixed $now + * @return int + */ + public function is_past($end, $now) + { + return (int) $this->is_date_after($end, $now); + } + + /** + * Check if a date is after a certain point or not + * + * @param string|int $point + * @param string|int $date + * @param boolean $equal + * + * @return boolean + */ + public function is_date_after($point, $date, $equal = false) + { + if (!is_numeric($point)) $point = strtotime($point); + if (!is_numeric($date)) $date = strtotime($date); + + // Never End + if ($point <= 0) return false; + + return ($equal ? $date >= $point : $date > $point); + } + + /** + * @author Webnus + * @param int $id + * @return string + */ + public function get_weekday_name_by_day_id($id) + { + // These names will be used in PHP functions, so they mustn't translate + $days = array(1 => 'Monday', 2 => 'Tuesday', 3 => 'Wednesday', 4 => 'Thursday', 5 => 'Friday', 6 => 'Saturday', 7 => 'Sunday'); + return $days[$id]; + } + + /** + * Spilts 2 dates to weeks + * @author Webnus + * @param DateTime|String $start + * @param DateTime|String $end + * @param int $first_day_of_week + * @return array + */ + public function split_to_weeks($start, $end, $first_day_of_week = NULL) + { + if (is_null($first_day_of_week)) $first_day_of_week = $this->get_first_day_of_week(); + + $end_day_of_week = ($first_day_of_week - 1 >= 0) ? $first_day_of_week - 1 : 6; + + $start_time = strtotime($start); + $end_time = strtotime($end); + + $start = new DateTime(date('Y-m-d', $start_time)); + $end = new DateTime(date('Y-m-d 23:59', $end_time)); + + $interval = new DateInterval('P1D'); + $dateRange = new DatePeriod($start, $interval, $end); + + $weekday = 0; + $weekNumber = 1; + $weeks = []; + foreach ($dateRange as $date) { + // Fix the PHP notice + if (!isset($weeks[$weekNumber])) $weeks[$weekNumber] = []; + + // It's first week and the week is not started from first weekday + if ($weekNumber == 1 and $weekday == 0 and $date->format('w') != $first_day_of_week) { + $remained_days = $date->format('w'); + + if ($first_day_of_week == 0) $remained_days = $date->format('w'); // Sunday + elseif ($first_day_of_week == 1) // Monday + { + if ($remained_days != 0) $remained_days = $remained_days - 1; + else $remained_days = 6; + } elseif ($first_day_of_week == 6) // Saturday + { + if ($remained_days != 6) $remained_days = $remained_days + 1; + else $remained_days = 0; + } elseif ($first_day_of_week == 5) // Friday + { + if ($remained_days < 4) $remained_days = $remained_days + 2; + elseif ($remained_days == 5) $remained_days = 0; + elseif ($remained_days == 6) $remained_days = 1; + } + + $interval = new DateInterval('P' . $remained_days . 'D'); + $interval->invert = 1; + $date->add($interval); + + for ($i = $remained_days; $i > 0; $i--) { + $weeks[$weekNumber][] = $date->format('Y-m-d'); + $date->add(new DateInterval('P1D')); + } + } + + $weeks[$weekNumber][] = $date->format('Y-m-d'); + $weekday++; + + if ($date->format('w') == $end_day_of_week) { + $weekNumber++; + $weekday = 0; + } + } + + // Month is finished but week is not finished + if ($weekday > 0 and $weekday < 7) { + $remained_days = (6 - $weekday); + for ($i = 0; $i <= $remained_days; $i++) { + $date->add(new DateInterval('P1D')); + $weeks[$weekNumber][] = $date->format('Y-m-d'); + + if ($date->format('w') == $end_day_of_week) $weekNumber++; + } + } + + return $weeks; + } + + /** + * Returns MEC Container Width + * @author Webnus + */ + public function get_container_width() + { + $settings = $this->get_settings(); + $container_width = (isset($settings['container_width']) and trim($settings['container_width']) != '') ? $settings['container_width'] : ''; + update_option('mec_container_width', $container_width); + } + + /** + * Returns MEC colors + * @author Webnus + * @return array + */ + public function get_available_colors() + { + $colors = get_option('mec_colors', $this->get_default_colors()); + return apply_filters('mec_available_colors', $colors); + } + + /** + * Returns MEC default colors + * @author Webnus + * @return array + */ + public function get_default_colors() + { + return apply_filters('mec_default_colors', array('fdd700', '00a0d2', 'e14d43', 'dd823b', 'a3b745')); + } + + /** + * Add a new color to MEC available colors + * @author Webnus + * @param string $color + */ + public function add_to_available_colors($color) + { + $colors = $this->get_available_colors(); + $colors[] = $color; + + $colors = array_unique($colors); + update_option('mec_colors', $colors); + } + + /** + * Returns available googlemap styles + * @author Webnus + * @return array + */ + public function get_googlemap_styles() + { + $styles = array( + array('key' => 'light-dream.json', 'name' => 'Light Dream'), + array('key' => 'intown-map.json', 'name' => 'inTown Map'), + array('key' => 'midnight.json', 'name' => 'Midnight'), + array('key' => 'pale-down.json', 'name' => 'Pale Down'), + array('key' => 'blue-essence.json', 'name' => 'Blue Essence'), + array('key' => 'blue-water.json', 'name' => 'Blue Water'), + array('key' => 'apple-maps-esque.json', 'name' => 'Apple Maps Esque'), + array('key' => 'CDO.json', 'name' => 'CDO'), + array('key' => 'shades-of-grey.json', 'name' => 'Shades of Grey'), + array('key' => 'subtle-grayscale.json', 'name' => 'Subtle Grayscale'), + array('key' => 'ultra-light.json', 'name' => 'Ultra Light'), + array('key' => 'facebook.json', 'name' => 'Facebook'), + ); + + return apply_filters('mec_googlemap_styles', $styles); + } + + /** + * Filters provided google map styles + * @author Webnus + * @param string $style + * @return string + */ + public function get_googlemap_style($style) + { + return apply_filters('mec_get_googlemap_style', $style); + } + + /** + * Fetchs googlemap styles from file + * @author Webnus + * @param string $style + * @return string + */ + public function fetch_googlemap_style($style) + { + $path = $this->get_plugin_path() . 'app' . DS . 'modules' . DS . 'googlemap' . DS . 'styles' . DS . $style; + + // MEC file library + $file = $this->getFile(); + + if ($file->exists($path)) return trim($file->read($path)); + else return ''; + } + + /** + * Get marker infowindow for showing on the map + * @author Webnus + * @param array $marker + * @return string + */ + public function get_marker_infowindow($marker) + { + $count = count($marker['event_ids']); + + $content = ' +
        +
        ' . esc_html($count) . '
        +
        + ' . ($count > 1 ? esc_html__('Events at this location', 'modern-events-calendar-lite') : esc_html__('Event at this location', 'modern-events-calendar-lite')) . ' + ' . (trim($marker['address']) ? $marker['address'] : $marker['name']) . ' +
        +
        '; + + return apply_filters('mec_get_marker_infowindow', $content); + } + + /** + * Get marker Lightbox for showing on the map + * @author Webnus + * @param object $event + * @param string $date_format + * @param string $skin_style + * @return string + */ + public function get_marker_lightbox($event, $date_format = 'M d Y', $skin_style = 'classic') + { + $ex_format = explode(' ', $date_format); + $format_1 = isset($ex_format[0]) ? $ex_format[0] : 'M'; + $format_2 = isset($ex_format[1]) ? $ex_format[1] : 'd'; + $format_3 = isset($ex_format[2]) ? $ex_format[2] : 'Y'; + + $link = $this->get_event_date_permalink($event, (isset($event->date['start']) ? $event->date['start']['date'] : NULL)); + $infowindow_thumb = trim($event->data->featured_image['thumbnail']) ? '
        ' . esc_attr($event->data->title) . '
        ' : ''; + $event_start_date_day = !empty($event->date['start']['date']) ? $this->date_i18n($format_1, strtotime($event->date['start']['date'])) : ''; + $event_start_date_month = !empty($event->date['start']['date']) ? $this->date_i18n($format_2, strtotime($event->date['start']['date'])) : ''; + $event_start_date_year = !empty($event->date['start']['date']) ? $this->date_i18n($format_3, strtotime($event->date['start']['date'])) : ''; + + $content = ' +
        +
        + +
        +
        '; + + return apply_filters('mec_get_marker_lightbox', $content, $event, $date_format, $skin_style); + } + + /** + * Returns available social networks + * @author Webnus + * @return array + */ + public function get_social_networks() + { + $social_networks = array( + 'facebook' => array('id' => 'facebook', 'name' => __('Facebook', 'modern-events-calendar-lite'), 'function' => array($this, 'sn_facebook')), + 'twitter' => array('id' => 'twitter', 'name' => __('Twitter', 'modern-events-calendar-lite'), 'function' => array($this, 'sn_twitter')), + 'linkedin' => array('id' => 'linkedin', 'name' => __('Linkedin', 'modern-events-calendar-lite'), 'function' => array($this, 'sn_linkedin')), + 'vk' => array('id' => 'vk', 'name' => __('VK', 'modern-events-calendar-lite'), 'function' => array($this, 'sn_vk')), + 'tumblr' => array('id' => 'tumblr', 'name' => __('Tumblr', 'modern-events-calendar-lite'), 'function' => array($this, 'sn_tumblr')), + 'pinterest' => array('id' => 'pinterest', 'name' => __('Pinterest', 'modern-events-calendar-lite'), 'function' => array($this, 'sn_pinterest')), + 'flipboard' => array('id' => 'flipboard', 'name' => __('Flipboard', 'modern-events-calendar-lite'), 'function' => array($this, 'sn_flipboard')), + 'pocket' => array('id' => 'pocket', 'name' => __('GetPocket', 'modern-events-calendar-lite'), 'function' => array($this, 'sn_pocket')), + 'reddit' => array('id' => 'reddit', 'name' => __('Reddit', 'modern-events-calendar-lite'), 'function' => array($this, 'sn_reddit')), + 'whatsapp' => array('id' => 'whatsapp', 'name' => __('WhatsApp', 'modern-events-calendar-lite'), 'function' => array($this, 'sn_whatsapp')), + 'telegram' => array('id' => 'telegram', 'name' => __('Telegram', 'modern-events-calendar-lite'), 'function' => array($this, 'sn_telegram')), + 'email' => array('id' => 'email', 'name' => __('Email', 'modern-events-calendar-lite'), 'function' => array($this, 'sn_email')), + ); + + return apply_filters('mec_social_networks', $social_networks); + } + + /** + * Do facebook link for social networks + * @author Webnus + * @param string $url + * @param object $event + * @param array $social + * @return string + */ + public function sn_facebook($url, $event, $social = array()) + { + $occurrence = (isset($_GET['occurrence']) ? sanitize_text_field($_GET['occurrence']) : ''); + if (trim($occurrence) != '') $url = $this->add_qs_var('occurrence', $occurrence, $url); + + return '
      • '; + } + + /** + * Do twitter link for social networks + * @author Webnus + * @param string $url + * @param object $event + * @param array $social + * @return string + */ + public function sn_twitter($url, $event, $social = array()) + { + $occurrence = (isset($_GET['occurrence']) ? sanitize_text_field($_GET['occurrence']) : ''); + if (trim($occurrence) != '') $url = $this->add_qs_var('occurrence', $occurrence, $url); + + return '
      • '; + } + + /** + * Do linkedin link for social networks + * @author Webnus + * @param string $url + * @param object $event + * @param array $social + * @return string + */ + public function sn_linkedin($url, $event, $social = array()) + { + $occurrence = (isset($_GET['occurrence']) ? sanitize_text_field($_GET['occurrence']) : ''); + if (trim($occurrence) != '') $url = $this->add_qs_var('occurrence', $occurrence, $url); + + return '
      • '; + } + + /** + * Do email link for social networks + * @author Webnus + * @param string $url + * @param object $event + * @param array $social + * @return string + */ + public function sn_email($url, $event, $social = array()) + { + $occurrence = (isset($_GET['occurrence']) ? sanitize_text_field($_GET['occurrence']) : ''); + if (trim($occurrence) != '') $url = $this->add_qs_var('occurrence', $occurrence, $url); + + $event->data->title = str_replace('–', '-', $event->data->title); + $event->data->title = str_replace('”', '’’', $event->data->title); + $event->data->title = str_replace('’', "’", $event->data->title); + $event->data->title = str_replace('&', '%26', $event->data->title); + $event->data->title = str_replace('#038;', '', $event->data->title); + + return '
      • '; + } + + /** + * Do VK link for social networks + * @author Webnus + * @param string $url + * @param object $event + * @param array $social + * @return string + */ + public function sn_vk($url, $event, $social = array()) + { + $occurrence = (isset($_GET['occurrence']) ? sanitize_text_field($_GET['occurrence']) : ''); + if (trim($occurrence) != '') $url = $this->add_qs_var('occurrence', $occurrence, $url); + + return '
      • '; + } + + + /** + * Do tumblr link for social networks + * @author Webnus + * @param string $url + * @param object $event + * @param array $social + * @return string + */ + public function sn_tumblr($url, $event, $social = array()) + { + $occurrence = (isset($_GET['occurrence']) ? sanitize_text_field($_GET['occurrence']) : ''); + if (trim($occurrence) != '') $url = $this->add_qs_var('occurrence', $occurrence, $url); + return '
      • '; + } + + /** + * Do pinterest link for social networks + * @author Webnus + * @param string $url + * @param object $event + * @param array $social + * @return string + */ + public function sn_pinterest($url, $event, $social = array()) + { + $occurrence = (isset($_GET['occurrence']) ? sanitize_text_field($_GET['occurrence']) : ''); + if (trim($occurrence) != '') $url = $this->add_qs_var('occurrence', $occurrence, $url); + + return '
      • '; + } + + /** + * Do flipboard link for social networks + * @author Webnus + * @param string $url + * @param object $event + * @param array $social + * @return string + */ + public function sn_flipboard($url, $event, $social = array()) + { + $occurrence = (isset($_GET['occurrence']) ? sanitize_text_field($_GET['occurrence']) : ''); + if (trim($occurrence) != '') $url = $this->add_qs_var('occurrence', $occurrence, $url); + + return '
      • + + +
      • '; + } + + /** + * Do pocket link for social networks + * @author Webnus + * @param string $url + * @param object $event + * @param array $social + * @return string + */ + public function sn_pocket($url, $event, $social = array()) + { + $occurrence = (isset($_GET['occurrence']) ? sanitize_text_field($_GET['occurrence']) : ''); + if (trim($occurrence) != '') $url = $this->add_qs_var('occurrence', $occurrence, $url); + + return '
      • '; + } + + /** + * Do reddit link for social networks + * @author Webnus + * @param string $url + * @param object $event + * @param array $social + * @return string + */ + public function sn_reddit($url, $event, $social = array()) + { + $occurrence = (isset($_GET['occurrence']) ? sanitize_text_field($_GET['occurrence']) : ''); + if (trim($occurrence) != '') $url = $this->add_qs_var('occurrence', $occurrence, $url); + + return '
      • '; + } + + /** + * Do telegram link for social networks + * @author Webnus + * @param string $url + * @param object $event + * @param array $social + * @return string + */ + public function sn_telegram($url, $event, $social = array()) + { + $occurrence = (isset($_GET['occurrence']) ? sanitize_text_field($_GET['occurrence']) : ''); + if (trim($occurrence) != '') $url = $this->add_qs_var('occurrence', $occurrence, $url); + + return '
      • + + +
      • '; + } + + /** + * Do whatsapp link for social networks + * @author Webnus + * @param string $url + * @param object $event + * @param array $social + * @return string + */ + public function sn_whatsapp($url, $event, $social = array()) + { + $occurrence = (isset($_GET['occurrence']) ? sanitize_text_field($_GET['occurrence']) : ''); + if (trim($occurrence) != '') $url = $this->add_qs_var('occurrence', $occurrence, $url); + + return '
      • '; + } + + /** + * Get available skins for archive page + * @author Webnus + * @return array + */ + public function get_archive_skins() + { + if (!$this->getPRO()) { + $archive_skins = array( + array('skin' => 'full_calendar', 'name' => __('Full Calendar', 'modern-events-calendar-lite')), + array('skin' => 'monthly_view', 'name' => __('Calendar/Monthly View', 'modern-events-calendar-lite')), + array('skin' => 'weekly_view', 'name' => __('Weekly View', 'modern-events-calendar-lite')), + array('skin' => 'daily_view', 'name' => __('Daily View', 'modern-events-calendar-lite')), + array('skin' => 'list', 'name' => __('List View', 'modern-events-calendar-lite')), + array('skin' => 'grid', 'name' => __('Grid View', 'modern-events-calendar-lite')), + array('skin' => 'general_calendar', 'name' => __('General Calendar', 'modern-events-calendar-lite')), + array('skin' => 'custom', 'name' => __('Custom Shortcode', 'modern-events-calendar-lite')), + ); + } else { + $archive_skins = array( + array('skin' => 'full_calendar', 'name' => __('Full Calendar', 'modern-events-calendar-lite')), + array('skin' => 'yearly_view', 'name' => __('Yearly View', 'modern-events-calendar-lite')), + array('skin' => 'monthly_view', 'name' => __('Calendar/Monthly View', 'modern-events-calendar-lite')), + array('skin' => 'weekly_view', 'name' => __('Weekly View', 'modern-events-calendar-lite')), + array('skin' => 'daily_view', 'name' => __('Daily View', 'modern-events-calendar-lite')), + array('skin' => 'timetable', 'name' => __('Timetable View', 'modern-events-calendar-lite')), + array('skin' => 'masonry', 'name' => __('Masonry View', 'modern-events-calendar-lite')), + array('skin' => 'list', 'name' => __('List View', 'modern-events-calendar-lite')), + array('skin' => 'grid', 'name' => __('Grid View', 'modern-events-calendar-lite')), + array('skin' => 'agenda', 'name' => __('Agenda View', 'modern-events-calendar-lite')), + array('skin' => 'map', 'name' => __('Map View', 'modern-events-calendar-lite')), + array('skin' => 'general_calendar', 'name' => __('General Calendar', 'modern-events-calendar-lite')), + array('skin' => 'custom', 'name' => __('Custom Shortcode', 'modern-events-calendar-lite')), + ); + } + + return apply_filters('mec_archive_skins', $archive_skins); + } + + /** + * Get available skins for archive page + * @author Webnus + * @return array + */ + public function get_category_skins() + { + if (!$this->getPRO()) { + $category_skins = array( + array('skin' => 'full_calendar', 'name' => __('Full Calendar', 'modern-events-calendar-lite')), + array('skin' => 'monthly_view', 'name' => __('Calendar/Monthly View', 'modern-events-calendar-lite')), + array('skin' => 'weekly_view', 'name' => __('Weekly View', 'modern-events-calendar-lite')), + array('skin' => 'daily_view', 'name' => __('Daily View', 'modern-events-calendar-lite')), + array('skin' => 'list', 'name' => __('List View', 'modern-events-calendar-lite')), + array('skin' => 'grid', 'name' => __('Grid View', 'modern-events-calendar-lite')), + array('skin' => 'general_calendar', 'name' => __('General Calendar', 'modern-events-calendar-lite')), + array('skin' => 'custom', 'name' => __('Custom Shortcode', 'modern-events-calendar-lite')), + ); + } else { + $category_skins = array( + array('skin' => 'full_calendar', 'name' => __('Full Calendar', 'modern-events-calendar-lite')), + array('skin' => 'yearly_view', 'name' => __('Yearly View', 'modern-events-calendar-lite')), + array('skin' => 'monthly_view', 'name' => __('Calendar/Monthly View', 'modern-events-calendar-lite')), + array('skin' => 'weekly_view', 'name' => __('Weekly View', 'modern-events-calendar-lite')), + array('skin' => 'daily_view', 'name' => __('Daily View', 'modern-events-calendar-lite')), + array('skin' => 'timetable', 'name' => __('Timetable View', 'modern-events-calendar-lite')), + array('skin' => 'masonry', 'name' => __('Masonry View', 'modern-events-calendar-lite')), + array('skin' => 'list', 'name' => __('List View', 'modern-events-calendar-lite')), + array('skin' => 'grid', 'name' => __('Grid View', 'modern-events-calendar-lite')), + array('skin' => 'agenda', 'name' => __('Agenda View', 'modern-events-calendar-lite')), + array('skin' => 'map', 'name' => __('Map View', 'modern-events-calendar-lite')), + array('skin' => 'general_calendar', 'name' => __('General Calendar', 'modern-events-calendar-lite')), + array('skin' => 'custom', 'name' => __('Custom Shortcode', 'modern-events-calendar-lite')), + ); + } + + return apply_filters('mec_category_skins', $category_skins); + } + + /** + * Get events posts + * @author Webnus + * @param int $limit + * @param array $status + * @return WP_Post[] + */ + public function get_events($limit = -1, $status = ['publish']) + { + return get_posts([ + 'post_type' => $this->get_main_post_type(), + 'numberposts' => $limit, + 'post_status' => $status + ]); + } + + /** + * Get id of ongoing events + * @param int $now + * @param null $status + * @return array + * @author Webnus + */ + public function get_ongoing_event_ids($now = NULL, $status = NULL) + { + // Database Object + $db = $this->getDB(); + + $status_query = ''; + if ($status) $status_query .= " AND `status`='" . esc_sql($status) . "'"; + + $ids = $db->select("SELECT `post_id` FROM `#__mec_dates` WHERE `tstart` <= " . $now . " AND `tend` > " . $now . $status_query, 'loadColumn'); + return array_unique($ids); + } + + /** + * Get id of upcoming events + * @param int $now + * @param null $status + * @return array + * @author Webnus + */ + public function get_upcoming_event_ids($now = NULL, $status = NULL) + { + // Database Object + $db = $this->getDB(); + + // Current Timestamp + $start = (($now and is_numeric($now)) ? $now : current_time('timestamp')); + + $status_query = ''; + if ($status) $status_query .= " AND `status`='" . esc_sql($status) . "'"; + + $ids = $db->select("SELECT `post_id` FROM `#__mec_dates` WHERE `tstart` >= " . $start . $status_query, 'loadColumn'); + return array_unique($ids); + } + + /** + * Get id of expired events + * @param int $now + * @param null $status + * @return array + * @author Webnus + */ + public function get_expired_event_ids($now = NULL, $status = NULL) + { + // Database Object + $db = $this->getDB(); + + // Current Timestamp + $end = (($now and is_numeric($now)) ? $now : current_time('timestamp', 0)); + + $status_query = ''; + if ($status) $status_query .= " AND `status`='" . esc_sql($status) . "'"; + + $ids = $db->select("SELECT `post_id` FROM `#__mec_dates` WHERE `tend` <= " . $end . $status_query, 'loadColumn'); + return array_unique($ids); + } + + /** + * Get id of all events + * @param null $status + * @return array + * @author Webnus + */ + public function get_all_event_ids($status = NULL) + { + // Database Object + $db = $this->getDB(); + + $status_query = ''; + if ($status) $status_query .= " AND `status`='" . esc_sql($status) . "'"; + + $ids = $db->select("SELECT `post_id` FROM `#__mec_dates` WHERE 1" . $status_query, 'loadColumn'); + return array_unique($ids); + } + + /** + * Get id of events by period + * @author Webnus + * @param string|int $start + * @param string|int $end + * @return array + */ + public function get_event_ids_by_period($start, $end) + { + if (!is_numeric($start)) $start = strtotime($start); + if (!is_numeric($end)) $end = strtotime($end); + + // Database Object + $db = $this->getDB(); + + return $db->select("SELECT `post_id` FROM `#__mec_dates` WHERE (`tstart` <= " . $start . " AND `tend` >= " . $end . ") OR (`tstart` > " . $start . " AND `tend` < " . $end . ") OR (`tstart` > " . $start . " AND `tstart` < " . $end . " AND `tend` >= " . $end . ") OR (`tstart` <= " . $start . " AND `tend` > " . $start . " AND `tend` < " . $end . ")", 'loadColumn'); + } + + public function get_filtered_events($locations = [], $categories = [], $organizers = []) + { + // Taxonomy Query + $tax_query = []; + + // Filter by Location + if (count($locations)) { + $tax_query[] = [ + 'taxonomy' => 'mec_location', + 'field' => 'term_id', + 'terms' => $locations, + 'operator' => 'IN', + ]; + } + + // Filter by Categories + if (count($categories)) { + $tax_query[] = [ + 'taxonomy' => 'mec_category', + 'field' => 'term_id', + 'terms' => $categories, + 'operator' => 'IN', + ]; + } + + // Filter by Organizers + if (count($organizers)) { + $tax_query[] = [ + 'taxonomy' => 'mec_organizer', + 'field' => 'term_id', + 'terms' => $organizers, + 'operator' => 'IN', + ]; + } + + // Filter Events + return get_posts([ + 'post_type' => $this->get_main_post_type(), + 'numberposts' => -1, + 'post_status' => ['publish'], + 'tax_query' => $tax_query + ]); + } + + /** + * Get method of showing for multiple days events + * @author Webnus + * @return string + */ + public function get_multiple_days_method() + { + $settings = $this->get_settings(); + + $method = isset($settings['multiple_day_show_method']) ? $settings['multiple_day_show_method'] : 'first_day_listgrid'; + return apply_filters('mec_multiple_days_method', $method); + } + + /** + * Get method of showing/hiding events based on event time + * @author Webnus + * @return string + */ + public function get_hide_time_method() + { + $settings = $this->get_settings(); + + $method = isset($settings['hide_time_method']) ? $settings['hide_time_method'] : 'start'; + return apply_filters('mec_hide_time_method', $method); + } + + /** + * Get hour format of MEC + * @author Webnus + * @return int|string + */ + public function get_hour_format() + { + $settings = $this->get_settings(); + + $format = isset($settings['time_format']) ? $settings['time_format'] : 12; + return apply_filters('mec_hour_format', $format); + } + + /** + * Get formatted hour based on configurations + * @author Webnus + * @param int $hour + * @param int $minutes + * @param string $ampm + * @return string + */ + public function get_formatted_hour($hour, $minutes, $ampm) + { + // Hour Format of MEC (12/24) + $hour_format = $this->get_hour_format(); + + $formatted = ''; + if ($hour_format == '12') { + $formatted = sprintf("%02d", $hour) . ':' . sprintf("%02d", $minutes) . ' ' . esc_html__($ampm, 'modern-events-calendar-lite'); + } elseif ($hour_format == '24') { + if (strtoupper($ampm) == 'PM' and $hour != 12) $hour += 12; + if (strtoupper($ampm) == 'AM' and $hour == 12) $hour += 12; + + $formatted = sprintf("%02d", $hour) . ':' . sprintf("%02d", $minutes); + } + + return $formatted; + } + + /** + * Get formatted time based on WordPress Time Format + * @author Webnus + * @param int $seconds + * @return string + */ + public function get_time($seconds) + { + $format = get_option('time_format'); + if (trim($format) === '') $format = 'H:i'; + + return gmdate($format, $seconds); + } + + /** + * Renders a module such as links or googlemap + * @author Webnus + * @param string $module + * @param array $params + * @return string + */ + public function module($module, $params = array()) + { + // Get module path + $path = MEC::import('app.modules.' . $module, true, true); + + // MEC libraries + $render = $this->getRender(); + $factory = $this->getFactory(); + + // Extract Module Params + extract($params); + + ob_start(); + include $path; + return $output = ob_get_clean(); + } + + /** + * Returns MEC currencies + * @author Webnus + * @return array + */ + public function get_currencies() + { + $currencies = array( + '$' => 'USD', + '€' => 'EUR', + '£' => 'GBP', + 'CHF' => 'CHF', + 'CAD' => 'CAD', + 'AUD' => 'AUD', + 'JPY' => 'JPY', + 'SEK' => 'SEK', + 'GEL' => 'GEL', + 'AFN' => 'AFN', + 'ALL' => 'ALL', + 'DZD' => 'DZD', + 'AOA' => 'AOA', + 'ARS' => 'ARS', + 'AMD' => 'AMD', + 'AWG' => 'AWG', + 'AZN' => 'AZN', + 'BSD' => 'BSD', + 'BHD' => 'BHD', + 'BBD' => 'BBD', + 'BYR' => 'BYR', + 'BZD' => 'BZD', + 'BMD' => 'BMD', + 'BTN' => 'BTN', + 'BOB' => 'BOB', + 'BAM' => 'BAM', + 'BWP' => 'BWP', + 'BRL' => 'BRL', + 'BND' => 'BND', + 'BGN' => 'BGN', + 'BIF' => 'BIF', + 'KHR' => 'KHR', + 'CVE' => 'CVE', + 'KYD' => 'KYD', + 'XAF' => 'XAF', + 'CLP' => 'CLP', + 'COP' => 'COP', + 'KMF' => 'KMF', + 'CDF' => 'CDF', + 'NZD' => 'NZD', + 'CRC' => 'CRC', + 'HRK' => 'HRK', + 'CUC' => 'CUC', + 'CUP' => 'CUP', + 'CZK' => 'CZK', + 'DKK' => 'DKK', + 'DJF' => 'DJF', + 'DOP' => 'DOP', + 'XCD' => 'XCD', + 'EGP' => 'EGP', + 'ERN' => 'ERN', + 'EEK' => 'EEK', + 'ETB' => 'ETB', + 'FKP' => 'FKP', + 'FJD' => 'FJD', + 'GMD' => 'GMD', + 'GHS' => 'GHS', + 'GIP' => 'GIP', + 'GTQ' => 'GTQ', + 'GNF' => 'GNF', + 'GYD' => 'GYD', + 'HTG' => 'HTG', + 'HNL' => 'HNL', + 'HKD' => 'HKD', + 'HUF' => 'HUF', + 'ISK' => 'ISK', + 'INR' => 'INR', + 'IDR' => 'IDR', + 'IRR' => 'IRR', + 'IQD' => 'IQD', + 'ILS' => 'ILS', + 'NIS' => 'NIS', + 'JMD' => 'JMD', + 'JOD' => 'JOD', + 'KZT' => 'KZT', + 'KES' => 'KES', + 'KWD' => 'KWD', + 'KGS' => 'KGS', + 'LAK' => 'LAK', + 'LVL' => 'LVL', + 'LBP' => 'LBP', + 'LSL' => 'LSL', + 'LRD' => 'LRD', + 'LYD' => 'LYD', + 'LTL' => 'LTL', + 'MOP' => 'MOP', + 'MKD' => 'MKD', + 'MGA' => 'MGA', + 'MWK' => 'MWK', + 'MYR' => 'MYR', + 'MVR' => 'MVR', + 'MRO' => 'MRO', + 'MUR' => 'MUR', + 'MXN' => 'MXN', + 'MDL' => 'MDL', + 'MNT' => 'MNT', + 'MAD' => 'MAD', + 'MZN' => 'MZN', + 'MMK' => 'MMK', + 'NAD' => 'NAD', + 'NPR' => 'NPR', + 'ANG' => 'ANG', + 'TWD' => 'TWD', + 'NIO' => 'NIO', + 'NGN' => 'NGN', + 'KPW' => 'KPW', + 'NOK' => 'NOK', + 'OMR' => 'OMR', + 'PKR' => 'PKR', + 'PAB' => 'PAB', + 'PGK' => 'PGK', + 'PYG' => 'PYG', + 'PEN' => 'PEN', + 'PHP' => 'PHP', + 'PLN' => 'PLN', + 'QAR' => 'QAR', + 'CNY' => 'CNY', + 'RON' => 'RON', + 'RUB' => 'RUB', + 'RWF' => 'RWF', + 'SHP' => 'SHP', + 'SVC' => 'SVC', + 'WST' => 'WST', + 'SAR' => 'SAR', + 'RSD' => 'RSD', + 'SCR' => 'SCR', + 'SLL' => 'SLL', + 'SGD' => 'SGD', + 'SBD' => 'SBD', + 'SOS' => 'SOS', + 'ZAR' => 'ZAR', + 'KRW' => 'KRW', + 'LKR' => 'LKR', + 'SDG' => 'SDG', + 'SRD' => 'SRD', + 'SZL' => 'SZL', + 'SYP' => 'SYP', + 'STD' => 'STD', + 'TJS' => 'TJS', + 'TZS' => 'TZS', + 'THB' => 'THB', + 'TOP' => 'TOP', + 'PRB' => 'PRB', + 'TTD' => 'TTD', + 'TND' => 'TND', + 'TRY' => 'TRY', + 'TMT' => 'TMT', + 'TVD' => 'TVD', + 'UGX' => 'UGX', + 'UAH' => 'UAH', + 'AED' => 'AED', + 'UYU' => 'UYU', + 'UZS' => 'UZS', + 'VUV' => 'VUV', + 'VEF' => 'VEF', + 'VND' => 'VND', + 'XOF' => 'XOF', + 'YER' => 'YER', + 'ZMK' => 'ZMK', + 'ZWL' => 'ZWL', + 'BDT' => 'BDT', + ); + + return apply_filters('mec_currencies', $currencies); + } + + /** + * Returns MEC version + * @author Webnus + * @return string + */ + public function get_version() + { + $version = MEC_VERSION; + + if (defined('WP_DEBUG') and WP_DEBUG) $version .= '.' . time(); + return $version; + } + + /** + * Set endpoint vars to true + * @author Webnus + * @param array $vars + * @return array + */ + public function filter_request($vars) + { + if (isset($vars['gateway-cancel'])) $vars['gateway-cancel'] = true; + if (isset($vars['gateway-return'])) $vars['gateway-return'] = true; + if (isset($vars['gateway-notify'])) $vars['gateway-notify'] = true; + + return $vars; + } + + /** + * Do the jobs after endpoints and show related output + * @author Webnus + * @return boolean + */ + public function do_endpoints() + { + if (get_query_var('verify')) { + $key = sanitize_text_field(get_query_var('verify')); + + $db = $this->getDB(); + $book_id = $db->select("SELECT `post_id` FROM `#__postmeta` WHERE `meta_key`='mec_verification_key' AND `meta_value`='$key'", 'loadResult'); + + if (!$book_id) return false; + + $status = get_post_meta($book_id, 'mec_verified', true); + if ($status == '1') { + $status_user = get_post_meta($book_id, 'mec_verified_user', true); + if (trim($status_user) == '') $status_user = 0; + + if (!$status_user) { + // User Status + update_post_meta($book_id, 'mec_verified_user', 1); + + echo '

        ' . esc_html__('Your booking has been verified successfully!', 'modern-events-calendar-lite') . '

        '; + return false; + } else { + echo '

        ' . esc_html__('Your booking already verified!', 'modern-events-calendar-lite') . '

        '; + return false; + } + } + + $book = $this->getBook(); + if ($book->verify($book_id)) { + // Confirm Booking After Verification + $confirmation_status = get_post_meta($book_id, 'mec_confirmed', true); + if (!$confirmation_status) { + $event_id = get_post_meta($book_id, 'mec_event_id', true); + $price = get_post_meta($book_id, 'mec_price', true); + + list($auto_confirm_free, $auto_confirm_paid) = $book->get_auto_confirmation_status($event_id, $book_id); + + // Auto confirmation for free bookings is enabled + if ($price <= 0 and $auto_confirm_free) { + $book->confirm($book_id, 'auto'); + } + + // Auto confirmation for paid bookings is enabled + if ($price > 0 and $auto_confirm_paid) { + $book->confirm($book_id, 'auto'); + } + } + + echo '

        ' . esc_html__('Your booking has been verified successfully!', 'modern-events-calendar-lite') . '

        '; + } else echo '

        ' . esc_html__('Your booking cannot verify!', 'modern-events-calendar-lite') . '

        '; + } elseif (get_query_var('cancel')) { + $key = sanitize_text_field(get_query_var('cancel')); + $sure = isset($_GET['mec-sure']) ? (int) $_GET['mec-sure'] : 0; + + $db = $this->getDB(); + $book_id = $db->select("SELECT `post_id` FROM `#__postmeta` WHERE `meta_key`='mec_cancellation_key' AND `meta_value`='$key'", 'loadResult'); + + if (!$book_id) return false; + + $status = get_post_meta($book_id, 'mec_verified', true); + if ($status == '-1') { + $status_user = get_post_meta($book_id, 'mec_canceled_user', true); + if (trim($status_user) == '') $status_user = 0; + + if (!$status_user) { + // User Status + update_post_meta($book_id, 'mec_canceled_user', 1); + + echo '

        ' . esc_html__('Your booking successfully canceled.', 'modern-events-calendar-lite') . '

        '; + } else { + echo '

        ' . esc_html__('Your booking already canceled!', 'modern-events-calendar-lite') . '

        '; + } + + return false; + } + + $timestamps = explode(':', get_post_meta($book_id, 'mec_date', true)); + $start = $timestamps[0]; + $end = $timestamps[1]; + + $right_now = current_time('timestamp', 0); + if ($right_now >= $end) { + echo '

        ' . esc_html__('The event is already finished!', 'modern-events-calendar-lite') . '

        '; + return false; + } + + // MEC Settings + $settings = $this->get_settings(); + + $cancellation_period_from = $settings['cancellation_period_from'] ?? 0; + $cancellation_period_to = $settings['cancellation_period_time'] ?? 0; + $cancellation_period_p = $settings['cancellation_period_p'] ?? 'hour'; + $cancellation_period_type = $settings['cancellation_period_type'] ?? 'before'; + + if ($cancellation_period_from or $cancellation_period_to) { + if ($cancellation_period_from) { + if ($cancellation_period_type == 'before') $min_time = ($start - ($cancellation_period_from * ($cancellation_period_p == 'hour' ? 3600 : 86400))); + else $min_time = ($start + ($cancellation_period_from * ($cancellation_period_p == 'hour' ? 3600 : 86400))); + + if ($right_now < $min_time) { + echo '

        ' . esc_html__("The cancelation window is not started yet.", 'modern-events-calendar-lite') . '

        '; + return false; + } + } + + if ($cancellation_period_to) { + if ($cancellation_period_type == 'before') $max_time = ($start - ($cancellation_period_to * ($cancellation_period_p == 'hour' ? 3600 : 86400))); + else $max_time = ($start + ($cancellation_period_to * ($cancellation_period_p == 'hour' ? 3600 : 86400))); + + if ($right_now > $max_time) { + echo '

        ' . esc_html__("The cancelation window is passed.", 'modern-events-calendar-lite') . '

        '; + return false; + } + } + } + + if (!$sure) { + echo '

        ' . esc_html__("Are you sure that you want to cancel the booking?", 'modern-events-calendar-lite') . ' ' . esc_html__('Yes, please cancel it.', 'modern-events-calendar-lite') . '

        '; + return false; + } + + $book = $this->getBook(); + if ($book->cancel($book_id)) { + echo '

        ' . esc_html__('Your booking successfully canceled.', 'modern-events-calendar-lite') . '

        '; + + $cancel_page = (isset($settings['booking_cancel_page']) and trim($settings['booking_cancel_page'])) ? $settings['booking_cancel_page'] : NULL; + $cancel_page_url = get_permalink($cancel_page); + $cancel_page_time = (isset($settings['booking_cancel_page_time']) and trim($settings['booking_cancel_page_time']) != '') ? $settings['booking_cancel_page_time'] : 2500; + + if ($cancel_page and $cancel_page_url) echo ''; + } else echo '

        ' . esc_html__('Your booking cannot be canceled.', 'modern-events-calendar-lite') . '

        '; + } elseif (get_query_var('gateway-cancel')) { + echo '

        ' . esc_html__('You canceled the payment successfully.', 'modern-events-calendar-lite') . '

        '; + } elseif (get_query_var('gateway-return')) { + echo '

        ' . esc_html__('You returned from payment gateway successfully.', 'modern-events-calendar-lite') . '

        '; + } + + // Trigget Actions + do_action('mec_gateway_do_endpoints', $this); + } + + public function booking_invoice() + { + // Booking Invoice + if (isset($_GET['method']) and sanitize_text_field($_GET['method']) == 'mec-invoice') { + $settings = $this->get_settings(); + if (isset($settings['booking_invoice']) and !$settings['booking_invoice']) wp_die(__('Cannot find the invoice!', 'modern-events-calendar-lite'), esc_html__('Invoice is invalid.', 'modern-events-calendar-lite')); + + $ml_settings = $this->get_ml_settings(); + + $transaction_id = sanitize_text_field($_GET['id']); + + // Libraries + $book = $this->getBook(); + $render = $this->getRender(); + $db = $this->getDB(); + + $transaction = $book->get_transaction($transaction_id); + $event_id = $transaction['event_id'] ?? 0; + $requested_event_id = $transaction['translated_event_id'] ?? $event_id; + + // Don't Show PDF If Booking is Pending + $book_id = $db->select("SELECT `post_id` FROM `#__postmeta` WHERE `meta_value`='" . $transaction_id . "' AND `meta_key`='mec_transaction_id'", 'loadResult'); + $mec_confirmed = get_post_meta($book_id, 'mec_confirmed', true); + + if (!$mec_confirmed and (!current_user_can('administrator') and !current_user_can('editor'))) wp_die(__('Your booking still is not confirmed. You can download it after confirmation!', 'modern-events-calendar-lite'), esc_html__('Booking Not Confirmed.', 'modern-events-calendar-lite')); + if (!$event_id) wp_die(__('Cannot find the booking!', 'modern-events-calendar-lite'), esc_html__('Booking is invalid.', 'modern-events-calendar-lite')); + + // Invoice Key + $invoice_key = $transaction['invoice_key'] ?? NULL; + if ($invoice_key and (!isset($_GET['mec-key']) or sanitize_text_field($_GET['mec-key']) != $invoice_key)) wp_die(__("You don't have access to view this invoice!", 'modern-events-calendar-lite'), esc_html__('Key is invalid.', 'modern-events-calendar-lite')); + + $event = $render->data($event_id); + + $bfixed_fields = $this->get_bfixed_fields($event_id); + $reg_fields = $this->get_reg_fields($event_id); + + $location_id = $this->get_master_location_id($event); + $location = isset($event->locations[$location_id]) ? (trim($event->locations[$location_id]['address']) ? $event->locations[$location_id]['address'] : $event->locations[$location_id]['name']) : ''; + + $dates = isset($transaction['date']) ? explode(':', $transaction['date']) : array(time(), time()); + + // Multiple Dates + $all_dates = ((isset($transaction['all_dates']) and is_array($transaction['all_dates'])) ? $transaction['all_dates'] : array()); + + // Get Booking Post + $booking = $book->get_bookings_by_transaction_id($transaction_id); + + $booking_time = isset($booking[0]) ? get_post_meta($booking[0]->ID, 'mec_booking_time', true) : NULL; + if (!$booking_time and is_numeric($dates[0])) $booking_time = date('Y-m-d', $dates[0]); + + $booking_time = date('Y-m-d', strtotime($booking_time)); + + // Coupon Code + $coupon_code = isset($booking[0]) ? get_post_meta($booking[0]->ID, 'mec_coupon_code', true) : ''; + + // Include the tFPDF Class + if (!class_exists('tFPDF')) require_once MEC_ABSPATH . 'app' . DS . 'api' . DS . 'TFPDF' . DS . 'tfpdf.php'; + + $pdf = new tFPDF(); + $pdf->AddPage(); + + // Add a Unicode font (uses UTF-8) + $pdf->AddFont('DejaVu', '', 'DejaVuSansCondensed.ttf', true); + $pdf->AddFont('DejaVuBold', '', 'DejaVuSansCondensed-Bold.ttf', true); + + $pdf->SetTitle(sprintf(esc_html__('%s Invoice', 'modern-events-calendar-lite'), $transaction_id)); + $pdf->SetAuthor(get_bloginfo('name'), true); + + // Event Information + $pdf->SetFont('DejaVuBold', '', 18); + $pdf->Write(25, html_entity_decode(get_the_title($event->ID))); + $pdf->Ln(); + + if (trim($location)) { + $pdf->SetFont('DejaVuBold', '', 12); + $pdf->Write(6, esc_html__('Location', 'modern-events-calendar-lite') . ': '); + $pdf->SetFont('DejaVu', '', 12); + $pdf->Write(6, $location); + $pdf->Ln(); + } + + $date_format = (isset($ml_settings['booking_date_format1']) and trim($ml_settings['booking_date_format1'])) ? $ml_settings['booking_date_format1'] : 'Y-m-d'; + $time_format = get_option('time_format'); + + if (is_numeric($dates[0]) and is_numeric($dates[1])) { + $start_datetime = date($date_format . ' ' . $time_format, $dates[0]); + $end_datetime = date($date_format . ' ' . $time_format, $dates[1]); + } else { + $start_datetime = $dates[0] . ' ' . $event->data->time['start']; + $end_datetime = $dates[1] . ' ' . $event->data->time['end']; + } + + $booking_options = $event->meta['mec_booking'] ?? []; + $bookings_all_occurrences = $booking_options['bookings_all_occurrences'] ?? 0; + + if (count($all_dates)) { + $pdf->SetFont('DejaVuBold', '', 12); + $pdf->Write(6, esc_html__('Date and Times', 'modern-events-calendar-lite')); + $pdf->Ln(); + $pdf->SetFont('DejaVu', '', 12); + + foreach ($all_dates as $one_date) { + $other_timestamps = explode(':', $one_date); + if (isset($other_timestamps[0]) and isset($other_timestamps[1])) { + $pdf->Write(6, sprintf(esc_html__('%s to %s', 'modern-events-calendar-lite'), $this->date_i18n($date_format . ' ' . $time_format, $other_timestamps[0]), $this->date_i18n($date_format . ' ' . $time_format, $other_timestamps[1]))); + $pdf->Ln(); + } + } + + $pdf->Ln(); + } elseif (!$bookings_all_occurrences) { + $pdf->SetFont('DejaVuBold', '', 12); + $pdf->Write(6, esc_html__('Date and Time', 'modern-events-calendar-lite') . ': '); + $pdf->SetFont('DejaVu', '', 12); + $pdf->Write(6, trim($start_datetime) . ' - ' . (($start_datetime != $end_datetime) ? $end_datetime . ' ' : ''), '- '); + $pdf->Ln(); + } + + $pdf->SetFont('DejaVuBold', '', 12); + $pdf->Write(6, esc_html__('Transaction ID', 'modern-events-calendar-lite') . ': '); + $pdf->SetFont('DejaVu', '', 12); + $pdf->Write(6, $transaction_id); + $pdf->Ln(); + + if (is_array($bfixed_fields) and count($bfixed_fields) and isset($transaction['fields']) and is_array($transaction['fields']) and count($transaction['fields'])) { + $pdf->SetFont('DejaVuBold', '', 16); + $pdf->Write(20, sprintf(esc_html__('%s Fields', 'modern-events-calendar-lite'), $this->m('booking', esc_html__('Booking', 'modern-events-calendar-lite')))); + $pdf->Ln(); + + foreach ($bfixed_fields as $bfixed_field_id => $bfixed_field) { + if (!is_numeric($bfixed_field_id)) continue; + + $bfixed_value = $transaction['fields'][$bfixed_field_id] ?? NULL; + if (!$bfixed_value) continue; + + $bfixed_type = $bfixed_field['type'] ?? NULL; + $bfixed_label = $bfixed_field['label'] ?? ''; + + if ($bfixed_type != 'agreement') { + $pdf->SetFont('DejaVu', '', 12); + $pdf->Write(6, $bfixed_label . ": " . (is_array($bfixed_value) ? stripslashes(implode(',', $bfixed_value)) : stripslashes($bfixed_value))); + $pdf->Ln(); + } + } + } + + // Attendees + if (isset($transaction['tickets']) and is_array($transaction['tickets']) and count($transaction['tickets'])) { + $pdf->SetFont('DejaVuBold', '', 16); + $pdf->Write(20, esc_html__('Attendees', 'modern-events-calendar-lite')); + $pdf->Ln(); + + $i = 1; + foreach ($transaction['tickets'] as $attendee) { + if (!isset($attendee['id'])) continue; + + $pdf->SetFont('DejaVuBold', '', 12); + $pdf->Write(6, stripslashes($attendee['name'])); + $pdf->Ln(); + + $pdf->SetFont('DejaVu', '', 10); + $pdf->Write(6, $attendee['email']); + $pdf->Ln(); + + $pdf->Write(6, ((isset($event->tickets[$attendee['id']]) ? esc_html__($this->m('ticket', esc_html__('Ticket', 'modern-events-calendar-lite'))) . ': ' . esc_html($event->tickets[$attendee['id']]['name']) : '') . ' ' . (isset($event->tickets[$attendee['id']]) ? $book->get_ticket_price_label($event->tickets[$attendee['id']], $booking_time, $event_id, $dates[0]) : ''))); + + // Registration Fields + $reg_form = (isset($attendee['reg']) and is_array($attendee['reg'])) ? $attendee['reg'] : []; + $reg_fields = apply_filters('mec_bookign_reg_form', $reg_fields, $event_id, get_post($event_id)); + + if (isset($reg_form) and count($reg_form)) { + foreach ($reg_form as $field_id => $value) { + $label = isset($reg_fields[$field_id]) ? $reg_fields[$field_id]['label'] : ''; + $type = isset($reg_fields[$field_id]) ? $reg_fields[$field_id]['type'] : ''; + + $pdf->Ln(); + + if ($type == 'agreement') { + $pdf->Write(5, sprintf(esc_html__($label, 'modern-events-calendar-lite'), get_the_title($reg_fields[$field_id]['page'])) . ": " . ($value == '1' ? esc_html__('Yes', 'modern-events-calendar-lite') : esc_html__('No', 'modern-events-calendar-lite'))); + } else { + $pdf->Write(5, $label . ": " . (is_string($value) ? stripslashes($value) : (is_array($value) ? stripslashes(implode(', ', $value)) : '---'))); + } + } + } + + // Ticket Variations + if (isset($attendee['variations']) and is_array($attendee['variations']) and count($attendee['variations'])) { + $ticket_variations = $this->ticket_variations($event_id, $attendee['id']); + + foreach ($attendee['variations'] as $variation_id => $variation_count) { + if (!$variation_count || $variation_count < 0) continue; + + $variation_title = (isset($ticket_variations[$variation_id]) and isset($ticket_variations[$variation_id]['title'])) ? $ticket_variations[$variation_id]['title'] : ''; + if (!trim($variation_title)) continue; + + $pdf->Ln(); + $pdf->Write(6, '+ ' . $variation_title . ' (' . $variation_count . ')'); + } + } + + if ($i != count($transaction['tickets'])) $pdf->Ln(12); + else $pdf->Ln(); + + $i++; + } + } + + // Billing Information + if (isset($transaction['price_details']) and isset($transaction['price_details']['details']) and is_array($transaction['price_details']['details']) and count($transaction['price_details']['details'])) { + $pdf->SetFont('DejaVuBold', '', 16); + $pdf->Write(20, esc_html__('Billing', 'modern-events-calendar-lite')); + $pdf->Ln(); + + $pdf->SetFont('DejaVu', '', 12); + foreach ($transaction['price_details']['details'] as $price_row) { + $pdf->Write(6, $price_row['description'] . ": " . $this->render_price($price_row['amount'], $requested_event_id)); + $pdf->Ln(); + } + + if ($coupon_code) { + $pdf->Write(6, esc_html__('Coupon Code', 'modern-events-calendar-lite') . ": " . $coupon_code); + $pdf->Ln(); + } + + $pdf->SetFont('DejaVuBold', '', 12); + $pdf->Write(10, esc_html__('Total', 'modern-events-calendar-lite') . ': '); + $pdf->Write(10, $this->render_price($transaction['price'], $requested_event_id)); + $pdf->Ln(); + } + + // Geteway + $pdf->SetFont('DejaVuBold', '', 16); + $pdf->Write(20, esc_html__('Payment', 'modern-events-calendar-lite')); + $pdf->Ln(); + + if (isset($transaction['payable'])) { + $pdf->SetFont('DejaVu', '', 12); + $pdf->Write(6, esc_html__('Paid Amount', 'modern-events-calendar-lite') . ': '); + $pdf->Write(6, $this->render_price($transaction['payable'], $requested_event_id)); + $pdf->Ln(); + } + + $pdf->SetFont('DejaVu', '', 12); + $pdf->Write(6, esc_html__('Gateway', 'modern-events-calendar-lite') . ': '); + $pdf->Write(6, get_post_meta($book_id, 'mec_gateway_label', true)); + $pdf->Ln(); + + $pdf->SetFont('DejaVu', '', 12); + $pdf->Write(6, esc_html__('Transaction ID', 'modern-events-calendar-lite') . ': '); + $pdf->Write(6, ((isset($transaction['gateway_transaction_id']) and trim($transaction['gateway_transaction_id'])) ? $transaction['gateway_transaction_id'] : $transaction_id)); + $pdf->Ln(); + + $date_format = get_option('date_format'); + $time_format = get_option('time_format'); + + $pdf->SetFont('DejaVu', '', 12); + $pdf->Write(6, esc_html__('Payment Time', 'modern-events-calendar-lite') . ': '); + $pdf->Write(6, date($date_format . ' ' . $time_format, strtotime(get_post_meta($book_id, 'mec_booking_time', true)))); + $pdf->Ln(); + + do_action('mec_book_invoice_pdf_before_qr_code', $pdf, $book_id, $transaction); + + $image = $this->module('qrcode.invoice', array('event' => $event)); + if (trim($image)) { + // QR Code + $pdf->SetX(-50); + $pdf->Image($image); + $pdf->Ln(); + } + + $pdf->Output(); + exit; + } + } + + public function cart_invoice() + { + // Cart Invoice + if (!isset($_GET['method']) or sanitize_text_field($_GET['method']) !== 'mec-cart-invoice') return; + + $settings = $this->get_settings(); + if (!isset($settings['mec_cart_invoice']) or !$settings['mec_cart_invoice']) wp_die(__('Cannot find the invoice!', 'modern-events-calendar-lite'), esc_html__('Invoice is invalid.', 'modern-events-calendar-lite')); + + $ml_settings = $this->get_ml_settings(); + + $cart_id = sanitize_text_field($_GET['mec-key']); + + $c = $this->getCart(); + $cart = $c->get_archived_cart($cart_id); + + if (!count($cart)) wp_die(__('Cannot find the invoice!', 'modern-events-calendar-lite'), esc_html__('Invoice is invalid.', 'modern-events-calendar-lite')); + + // Libraries + $book = $this->getBook(); + $render = $this->getRender(); + $db = $this->getDB(); + + // Include the tFPDF Class + if (!class_exists('tFPDF')) require_once MEC_ABSPATH . 'app' . DS . 'api' . DS . 'TFPDF' . DS . 'tfpdf.php'; + + $pdf = new tFPDF(); + $pdf->AddPage(); + + // Add a Unicode font (uses UTF-8) + $pdf->AddFont('DejaVu', '', 'DejaVuSansCondensed.ttf', true); + $pdf->AddFont('DejaVuBold', '', 'DejaVuSansCondensed-Bold.ttf', true); + + $pdf->SetTitle(sprintf(esc_html__('%s Invoice', 'modern-events-calendar-lite'), $cart_id)); + $pdf->SetAuthor(get_bloginfo('name'), true); + + foreach ($cart as $transaction_id) { + $transaction = $book->get_transaction($transaction_id); + $event_id = $transaction['event_id'] ?? 0; + $requested_event_id = $transaction['translated_event_id'] ?? $event_id; + + // Don't Show PDF If Booking is Pending + $book_id = $db->select("SELECT `post_id` FROM `#__postmeta` WHERE `meta_value`='" . $transaction_id . "' AND `meta_key`='mec_transaction_id'", 'loadResult'); + $mec_confirmed = get_post_meta($book_id, 'mec_confirmed', true); + + $event = $render->data($event_id); + + $reg_fields = $this->get_reg_fields($event_id); + $bfixed_fields = $this->get_bfixed_fields($event_id); + + $location_id = $this->get_master_location_id($event); + $location = isset($event->locations[$location_id]) ? (trim($event->locations[$location_id]['address']) ? $event->locations[$location_id]['address'] : $event->locations[$location_id]['name']) : ''; + + $dates = isset($transaction['date']) ? explode(':', $transaction['date']) : array(time(), time()); + + // Multiple Dates + $all_dates = ((isset($transaction['all_dates']) and is_array($transaction['all_dates'])) ? $transaction['all_dates'] : array()); + + // Get Booking Post + $booking = $book->get_bookings_by_transaction_id($transaction_id); + + $booking_time = isset($booking[0]) ? get_post_meta($booking[0]->ID, 'mec_booking_time', true) : NULL; + if (!$booking_time and is_numeric($dates[0])) $booking_time = date('Y-m-d', $dates[0]); + + $booking_time = date('Y-m-d', strtotime($booking_time)); + + // Coupon Code + $coupon_code = isset($booking[0]) ? get_post_meta($booking[0]->ID, 'mec_coupon_code', true) : ''; + + // Event Information + $pdf->SetFont('DejaVuBold', '', 18); + $pdf->Write(18, html_entity_decode(get_the_title($event->ID))); + $pdf->Ln(); + + $pdf->SetFont('DejaVuBold', '', 9); + $pdf->Write(5, esc_html__('Transaction ID', 'modern-events-calendar-lite') . ': '); + $pdf->SetFont('DejaVu', '', 9); + $pdf->Write(5, $transaction_id . ' (' . ($mec_confirmed ? esc_html__('Confirmed', 'modern-events-calendar-lite') : esc_html__('Not Confirmed', 'modern-events-calendar-lite')) . ')'); + $pdf->Ln(); + + if (trim($location)) { + $pdf->SetFont('DejaVuBold', '', 9); + $pdf->Write(5, esc_html__('Location', 'modern-events-calendar-lite') . ': '); + $pdf->SetFont('DejaVu', '', 9); + $pdf->Write(5, $location); + $pdf->Ln(); + } + + $date_format = (isset($ml_settings['booking_date_format1']) and trim($ml_settings['booking_date_format1'])) ? $ml_settings['booking_date_format1'] : 'Y-m-d'; + $time_format = get_option('time_format'); + + if (is_numeric($dates[0]) and is_numeric($dates[1])) { + $start_datetime = date($date_format . ' ' . $time_format, $dates[0]); + $end_datetime = date($date_format . ' ' . $time_format, $dates[1]); + } else { + $start_datetime = $dates[0] . ' ' . $event->data->time['start']; + $end_datetime = $dates[1] . ' ' . $event->data->time['end']; + } + + $booking_options = isset($event->meta['mec_booking']) ? $event->meta['mec_booking'] : []; + $bookings_all_occurrences = isset($booking_options['bookings_all_occurrences']) ? $booking_options['bookings_all_occurrences'] : 0; + + if (count($all_dates)) { + $pdf->SetFont('DejaVuBold', '', 9); + $pdf->Write(5, __('Date & Times', 'modern-events-calendar-lite')); + $pdf->Ln(); + $pdf->SetFont('DejaVu', '', 9); + + foreach ($all_dates as $one_date) { + $other_timestamps = explode(':', $one_date); + if (isset($other_timestamps[0]) and isset($other_timestamps[1])) { + $pdf->Write(5, sprintf(esc_html__('%s to %s', 'modern-events-calendar-lite'), $this->date_i18n($date_format . ' ' . $time_format, $other_timestamps[0]), $this->date_i18n($date_format . ' ' . $time_format, $other_timestamps[1]))); + $pdf->Ln(); + } + } + + $pdf->Ln(); + } elseif (!$bookings_all_occurrences) { + $pdf->SetFont('DejaVuBold', '', 9); + $pdf->Write(5, __('Date & Time', 'modern-events-calendar-lite') . ': '); + $pdf->SetFont('DejaVu', '', 9); + $pdf->Write(5, trim($start_datetime) . ' - ' . (($start_datetime != $end_datetime) ? $end_datetime . ' ' : ''), '- '); + $pdf->Ln(); + } + + // Booking Fixed Fields + if (is_array($bfixed_fields) and count($bfixed_fields)) { + $pdf->Ln(); + $pdf->SetFont('DejaVuBold', '', 12); + $pdf->Write(5, sprintf(esc_html__('%s Fields', 'modern-events-calendar-lite'), $this->m('booking', esc_html__('Booking', 'modern-events-calendar-lite')))); + $pdf->Ln(); + + $pdf->SetFont('DejaVu', '', 9); + foreach ($bfixed_fields as $bfixed_field_id => $bfixed_field) { + if (!is_numeric($bfixed_field_id)) continue; + + $bfixed_value = isset($transaction['fields'][$bfixed_field_id]) ? $transaction['fields'][$bfixed_field_id] : NULL; + if (!$bfixed_value) continue; + + $bfixed_type = isset($bfixed_field['type']) ? $bfixed_field['type'] : NULL; + $bfixed_label = isset($bfixed_field['label']) ? $bfixed_field['label'] : ''; + + if ($bfixed_type == 'agreement') { + $pdf->Write(5, sprintf(esc_html__($bfixed_label, 'modern-events-calendar-lite'), get_the_title($bfixed_field['page'])) . ": " . ($bfixed_value == '1' ? esc_html__('Yes', 'modern-events-calendar-lite') : esc_html__('No', 'modern-events-calendar-lite'))); + } else { + $pdf->Write(5, $bfixed_label . ": " . (is_array($bfixed_value) ? stripslashes(implode(',', $bfixed_value)) : stripslashes($bfixed_value))); + } + + $pdf->Ln(); + } + } + + // Attendees + if (isset($transaction['tickets']) and is_array($transaction['tickets']) and count($transaction['tickets'])) { + $pdf->Ln(); + $pdf->SetFont('DejaVuBold', '', 12); + $pdf->Write(5, esc_html__('Attendees', 'modern-events-calendar-lite')); + $pdf->Ln(); + $pdf->Ln(); + + $i = 1; + foreach ($transaction['tickets'] as $attendee) { + if (!isset($attendee['id'])) continue; + + $pdf->SetFont('DejaVuBold', '', 9); + $pdf->Write(5, stripslashes($attendee['name'])); + $pdf->Ln(); + + $pdf->SetFont('DejaVu', '', 9); + $pdf->Write(5, $attendee['email']); + $pdf->Ln(); + + $pdf->Write(5, ((isset($event->tickets[$attendee['id']]) ? esc_html__($this->m('ticket', esc_html__('Ticket', 'modern-events-calendar-lite'))) . ': ' . esc_html($event->tickets[$attendee['id']]['name']) : '') . ' ' . (isset($event->tickets[$attendee['id']]) ? esc_html($book->get_ticket_price_label($event->tickets[$attendee['id']], $booking_time, $event_id, $dates[0])) : ''))); + + // Registration Fields + $reg_form = isset($attendee['reg']) ? $attendee['reg'] : []; + $reg_fields = apply_filters('mec_bookign_reg_form', $reg_fields, $event_id, get_post($event_id)); + + if (isset($reg_form) and count($reg_form)) { + foreach ($reg_form as $field_id => $value) { + $label = isset($reg_fields[$field_id]) ? $reg_fields[$field_id]['label'] : ''; + $type = isset($reg_fields[$field_id]) ? $reg_fields[$field_id]['type'] : ''; + + $pdf->Ln(); + + if ($type == 'agreement') { + $pdf->Write(5, sprintf(esc_html__($label, 'modern-events-calendar-lite'), get_the_title($reg_fields[$field_id]['page'])) . ": " . ($value == '1' ? esc_html__('Yes', 'modern-events-calendar-lite') : esc_html__('No', 'modern-events-calendar-lite'))); + } else { + $pdf->Write(5, $label . ": " . (is_string($value) ? $value : (is_array($value) ? implode(', ', $value) : '---'))); + } + } + } + + // Ticket Variations + if (isset($attendee['variations']) and is_array($attendee['variations']) and count($attendee['variations'])) { + $ticket_variations = $this->ticket_variations($event_id, $attendee['id']); + + foreach ($attendee['variations'] as $variation_id => $variation_count) { + if (!$variation_count or ($variation_count and $variation_count < 0)) continue; + + $variation_title = (isset($ticket_variations[$variation_id]) and isset($ticket_variations[$variation_id]['title'])) ? $ticket_variations[$variation_id]['title'] : ''; + if (!trim($variation_title)) continue; + + $pdf->Ln(); + $pdf->Write(5, '+ ' . $variation_title . ' (' . $variation_count . ')'); + } + } + + if ($i != count($transaction['tickets'])) $pdf->Ln(9); + else $pdf->Ln(); + + $i++; + } + } + + // Billing Information + if (isset($transaction['price_details']) and isset($transaction['price_details']['details']) and is_array($transaction['price_details']['details']) and count($transaction['price_details']['details'])) { + $pdf->SetFont('DejaVuBold', '', 12); + $pdf->Write(5, esc_html__('Billing', 'modern-events-calendar-lite')); + $pdf->Ln(); + + $pdf->SetFont('DejaVu', '', 9); + foreach ($transaction['price_details']['details'] as $price_row) { + $pdf->Write(5, $price_row['description'] . ": " . $this->render_price($price_row['amount'], $requested_event_id)); + $pdf->Ln(); + } + + if ($coupon_code) { + $pdf->Write(5, esc_html__('Coupon Code', 'modern-events-calendar-lite') . ": " . $coupon_code); + $pdf->Ln(); + } + + $pdf->SetFont('DejaVuBold', '', 9); + $pdf->Write(5, esc_html__('Total', 'modern-events-calendar-lite') . ': '); + $pdf->Write(5, $this->render_price($transaction['price'], $requested_event_id)); + $pdf->Ln(); + } + + // Geteway + $pdf->Ln(); + $pdf->SetFont('DejaVuBold', '', 12); + $pdf->Write(5, esc_html__('Payment', 'modern-events-calendar-lite')); + $pdf->Ln(); + + if (isset($transaction['payable'])) { + $pdf->SetFont('DejaVu', '', 12); + $pdf->Write(6, esc_html__('Paid Amount', 'modern-events-calendar-lite') . ': '); + $pdf->Write(6, $this->render_price($transaction['payable'], $requested_event_id)); + $pdf->Ln(); + } + + $pdf->SetFont('DejaVu', '', 9); + $pdf->Write(5, esc_html__('Gateway', 'modern-events-calendar-lite') . ': '); + $pdf->Write(5, get_post_meta($book_id, 'mec_gateway_label', true)); + $pdf->Ln(); + + $pdf->SetFont('DejaVu', '', 9); + $pdf->Write(5, esc_html__('Transaction ID', 'modern-events-calendar-lite') . ': '); + $pdf->Write(5, ((isset($transaction['gateway_transaction_id']) and trim($transaction['gateway_transaction_id'])) ? $transaction['gateway_transaction_id'] : $transaction_id)); + $pdf->Ln(); + + $date_format = get_option('date_format'); + $time_format = get_option('time_format'); + + $pdf->SetFont('DejaVu', '', 9); + $pdf->Write(5, esc_html__('Payment Time', 'modern-events-calendar-lite') . ': '); + $pdf->Write(5, date($date_format . ' ' . $time_format, strtotime(get_post_meta($book_id, 'mec_booking_time', true)))); + $pdf->Ln(); + } + + $pdf->Output(); + exit; + } + + public function print_calendar() + { + // Print Calendar + if (isset($_GET['method']) and sanitize_text_field($_GET['method']) == 'mec-print' and $this->getPRO()) { + $year = isset($_GET['mec-year']) ? sanitize_text_field($_GET['mec-year']) : NULL; + $month = isset($_GET['mec-month']) ? sanitize_text_field($_GET['mec-month']) : NULL; + + // Month and Year are required! + if (!trim($year) or !trim($month)) return; + + $start = $year . '-' . $month . '-01'; + $end = date('Y-m-t', strtotime($start)); + + $atts = []; + $atts['sk-options']['agenda']['start_date_type'] = 'date'; + $atts['sk-options']['agenda']['start_date'] = $start; + $atts['sk-options']['agenda']['maximum_date_range'] = $end; + $atts['sk-options']['agenda']['style'] = 'clean'; + $atts['sk-options']['agenda']['limit'] = 1000; + $atts['sf_status'] = false; + $atts['sf_display_label'] = false; + + // Create Skin Object Class + $SKO = new MEC_skin_agenda(); + + // Initialize the skin + $SKO->initialize($atts); + + // Fetch the events + $SKO->fetch(); + + ob_start(); + ?> + + + + + + + + output()); ?> + + + + getPRO()) { + global $post; + + // Current Post is not Event + if ($post->post_type != $this->get_main_post_type()) return; + + ob_start(); + ?> + + + + + + + > + ID . '"]'); ?> + + + + + + */ + public function ical() + { + // ical export + if (isset($_GET['method']) and sanitize_text_field($_GET['method']) == 'ical') { + $id = sanitize_text_field($_GET['id']); + $post = get_post($id); + + if ($post->post_type == $this->get_main_post_type() and $post->post_status == 'publish') { + $occurrence = isset($_GET['occurrence']) ? sanitize_text_field($_GET['occurrence']) : ''; + + $events = $this->ical_single($id, $occurrence, '', true); + $ical_calendar = $this->ical_calendar($events); + + header('Content-type: application/force-download; charset=utf-8'); + header('Content-Disposition: attachment; filename="mec-event-' . $id . '.ics"'); + + echo MEC_kses::full($ical_calendar); + exit; + } + } + } + + /** + * Generates ical output in email + * @author Webnus + */ + public function ical_email() + { + // ical export + if (isset($_GET['method']) and sanitize_text_field($_GET['method']) == 'ical-email') { + $id = sanitize_text_field($_GET['id']); + $book_id = sanitize_text_field($_GET['book_id']); + $key = sanitize_text_field($_GET['key']); + + if ($key != md5($book_id)) wp_die(__('Request is not valid.', 'modern-events-calendar-lite'), esc_html__('iCal export stopped!', 'modern-events-calendar-lite'), array('back_link' => true)); + + $occurrence = isset($_GET['occurrence']) ? sanitize_text_field($_GET['occurrence']) : ''; + + $events = $this->ical_single_email($id, $book_id, $occurrence); + $ical_calendar = $this->ical_calendar($events); + + header('Content-type: application/force-download; charset=utf-8'); + header('Content-Disposition: attachment; filename="mec-booking-' . $book_id . '.ics"'); + + echo MEC_kses::full($ical_calendar); + exit; + } + } + + /** + * Returns the iCal URL of event + * @author Webnus + * @param $event_id + * @param string $occurrence + * @return string + */ + public function ical_URL($event_id, $occurrence = '') + { + $url = $this->URL('site'); + $url = $this->add_qs_var('method', 'ical', $url); + $url = $this->add_qs_var('id', $event_id, $url); + + // Add Occurrence Date if passed + if (trim($occurrence)) $url = $this->add_qs_var('occurrence', $occurrence, $url); + + return $url; + } + + public function ical_URL_email($event_id, $book_id, $occurrence = '') + { + $url = $this->URL('site'); + $url = $this->add_qs_var('method', 'ical-email', $url); + $url = $this->add_qs_var('id', $event_id, $url); + $url = $this->add_qs_var('book_id', $book_id, $url); + $url = $this->add_qs_var('key', md5($book_id), $url); + + // Add Occurrence Date if passed + if (trim($occurrence)) $url = $this->add_qs_var('occurrence', $occurrence, $url); + + return $url; + } + + /** + * Returns iCal export for one event + * @param int $event_id + * @param string $occurrence + * @param string $occurrence_time + * @param bool $start_from_beginning + * @return string + * @throws Exception + * @author Webnus + */ + public function ical_single($event_id, $occurrence = '', $occurrence_time = '', $start_from_beginning = false) + { + // Valid Line Separator + $crlf = "\r\n"; + + // MEC Render Library + $render = $this->getRender(); + + // Event Data + $event = $render->data($event_id); + + // Not an Event + if ($event->post->post_type != $this->get_main_post_type()) return ''; + + if ($start_from_beginning and isset($event->meta, $event->meta['mec_start_datetime'])) { + $start_time = strtotime($event->meta['mec_start_datetime']); + $end_time = strtotime($event->meta['mec_end_datetime']); + } else { + $occurrence_end_date = (trim($occurrence) ? $this->get_end_date_by_occurrence($event_id, $occurrence) : ''); + + // Event Dates + $dates = $this->get_event_next_occurrences($event, $occurrence, 2, $occurrence_time); + + $date = $dates[0] ?? []; + + if ($date['start']['hour'] == '0' && $date['start']['ampm'] == 'AM') $date['start']['hour'] = 12; + if ($date['end']['hour'] == '0' && $date['end']['ampm'] == 'AM') $date['end']['hour'] = 12; + + $start_time_string = isset($date['start']) ? sprintf("%02d", $date['start']['hour']) . ':' . sprintf("%02d", $date['start']['minutes']) . ' ' . $date['start']['ampm'] : ''; + $end_time_string = isset($date['end']) ? sprintf("%02d", $date['end']['hour']) . ':' . sprintf("%02d", $date['end']['minutes']) . ' ' . $date['end']['ampm'] : ''; + + if (isset($date['start'], $date['start']['timestamp'])) $start_time = $date['start']['timestamp']; + else $start_time = strtotime(((isset($date['start']) and trim($date['start']['date'])) ? $date['start']['date'] : $occurrence) . ' ' . $start_time_string); + + if (isset($date['end'], $date['end']['timestamp'])) $end_time = $date['end']['timestamp']; + else $end_time = strtotime((trim($occurrence_end_date) ? $occurrence_end_date : $date['end']['date']) . ' ' . $end_time_string); + } + + $gmt_offset_seconds = $this->get_gmt_offset_seconds($start_time, $event); + $stamp = strtotime($event->post->post_date); + $modified = strtotime($event->post->post_modified); + + $rrules = $this->get_ical_rrules($event); + $time_format = 'Ymd\\THi00\\Z'; + + $sequence = (isset($event->meta['mec_sequence']) ? (int) $event->meta['mec_sequence'] : 0); + + // All Day Event + if (isset($event->meta['mec_date']) and isset($event->meta['mec_date']['allday']) and $event->meta['mec_date']['allday']) { + $start_time = strtotime("Today", $start_time); + $end_time = strtotime('Tomorrow', $end_time); + } + + $ical = "BEGIN:VEVENT" . $crlf; + $ical .= "CLASS:PUBLIC" . $crlf; + $ical .= "UID:MEC-" . md5($event_id) . "@" . $this->get_domain() . $crlf; + $ical .= "DTSTART:" . gmdate($time_format, ($start_time - $gmt_offset_seconds)) . $crlf; + $ical .= "DTEND:" . gmdate($time_format, ($end_time - $gmt_offset_seconds)) . $crlf; + $ical .= "DTSTAMP:" . gmdate($time_format, ($stamp - $gmt_offset_seconds)) . $crlf; + + if (is_array($rrules) and count($rrules)) { + foreach ($rrules as $rrule) $ical .= $rrule . $crlf; + } + + $event_content = preg_replace('#]*href="((?!/)[^"]+)">[^<]+#', '$0 ( $1 )', $event->content); + $event_content = strip_shortcodes(strip_tags($event_content)); + $event_content = str_replace("\r\n", "\\n", $event_content); + $event_content = str_replace("\n", "\\n", $event_content); + $event_content = preg_replace('/(]*>.+?<\/script>|]*>.+?<\/style>)/s', '', $event_content); + + $ical .= "CREATED:" . date('Ymd', $stamp) . $crlf; + $ical .= "LAST-MODIFIED:" . date('Ymd', $modified) . $crlf; + $ical .= "PRIORITY:5" . $crlf; + $ical .= "SEQUENCE:" . $sequence . $crlf; + $ical .= "TRANSP:OPAQUE" . $crlf; + $ical .= "SUMMARY:" . html_entity_decode(apply_filters('mec_ical_single_summary', $event->title, $event_id), ENT_NOQUOTES, 'UTF-8') . $crlf; + $ical .= "DESCRIPTION:" . html_entity_decode(apply_filters('mec_ical_single_description', $event_content, $event_id, $event), ENT_NOQUOTES, 'UTF-8') . $crlf; + $ical .= "URL:" . apply_filters('mec_ical_single_url', $event->permalink, $event_id) . $crlf; + + // Organizer + $organizer_id = $this->get_master_organizer_id($event->ID, $start_time); + $organizer = $event->organizers[$organizer_id] ?? []; + $organizer_name = (isset($organizer['name']) and trim($organizer['name'])) ? $organizer['name'] : NULL; + $organizer_email = (isset($organizer['email']) and trim($organizer['email'])) ? $organizer['email'] : NULL; + + if ($organizer_name or $organizer_email) $ical .= "ORGANIZER;CN=" . $organizer_name . ":MAILTO:" . $organizer_email . $crlf; + + // Categories + $categories = ''; + if (isset($event->categories) and is_array($event->categories) and count($event->categories)) { + foreach ($event->categories as $category) $categories .= $category['name'] . ','; + } + + if (trim($categories) != '') $ical .= "CATEGORIES:" . trim($categories, ', ') . $crlf; + + // Location + $location_id = $this->get_master_location_id($event->ID, $start_time); + $location = $event->locations[$location_id] ?? []; + $address = ((isset($location['address']) and trim($location['address'])) ? $location['address'] : (isset($location['name']) ? $location['name'] : '')); + + if (trim($address) != '') $ical .= "LOCATION:" . $address . $crlf; + + // Featured Image + if (trim($event->featured_image['full']) != '') { + $ex = explode('/', $event->featured_image['full']); + $filename = end($ex); + $ical .= "ATTACH;FMTTYPE=" . $this->get_mime_content_type($filename) . ":" . $event->featured_image['full'] . $crlf; + } + + $ical .= "END:VEVENT" . $crlf; + + return apply_filters('mec_ical_single', $ical); + } + + public function ical_single_occurrence($start_time, $end_time, $event, $rrules = array(), $extra_lines = array()) + { + // Valid Line Separator + $crlf = "\r\n"; + + $stamp_gmt = strtotime($event->post->post_date_gmt); + $stamp = strtotime($event->post->post_date); + $modified = strtotime($event->post->post_modified); + + $timezone = $this->get_timezone($event->ID); + $time_format = 'Ymd\\THi00'; + + $sequence = (isset($event->meta['mec_sequence']) ? (int) $event->meta['mec_sequence'] : 0); + + // All Day Event + if (isset($event->meta['mec_date']) and isset($event->meta['mec_date']['allday']) and $event->meta['mec_date']['allday']) { + $time_format = 'Ymd\\T000000'; + $end_time = strtotime('+1 Day', $end_time); + } + + $ical = "BEGIN:VEVENT" . $crlf; + $ical .= "CLASS:PUBLIC" . $crlf; + $ical .= "DTSTART;TZID=" . $timezone . ":" . date($time_format, $start_time) . $crlf; + $ical .= "DTEND;TZID=" . $timezone . ":" . date($time_format, $end_time) . $crlf; + $ical .= "DTSTAMP:" . gmdate($time_format, $stamp_gmt) . $crlf; + $ical .= "UID:MEC-" . md5($event->ID) . "@" . $this->get_domain() . $crlf; + + if (is_array($rrules) and count($rrules)) { + foreach ($rrules as $rrule) $ical .= $rrule . $crlf; + } + + if (is_array($extra_lines) and count($extra_lines)) { + foreach ($extra_lines as $extra_line) $ical .= $extra_line . $crlf; + } + + $event_content = preg_replace('#]*href="((?!/)[^"]+)">[^<]+#', '$0 ( $1 )', $event->content); + $event_content = strip_shortcodes(strip_tags($event_content)); + $event_content = str_replace("\r\n", "\\n", $event_content); + $event_content = str_replace("\n", "\\n", $event_content); + $event_content = preg_replace('/(]*>.+?<\/script>|]*>.+?<\/style>)/s', '', $event_content); + + $ical .= "CREATED:" . date('Ymd', $stamp) . $crlf; + $ical .= "LAST-MODIFIED:" . date('Ymd', $modified) . $crlf; + $ical .= "PRIORITY:5" . $crlf; + $ical .= "SEQUENCE:" . $sequence . $crlf; + $ical .= "TRANSP:OPAQUE" . $crlf; + $ical .= "SUMMARY:" . html_entity_decode(apply_filters('mec_ical_single_summary', $event->title, $event->ID), ENT_NOQUOTES, 'UTF-8') . $crlf; + $ical .= "DESCRIPTION:" . html_entity_decode(apply_filters('mec_ical_single_description', $event_content, $event->ID, $event), ENT_NOQUOTES, 'UTF-8') . $crlf; + $ical .= "URL:" . apply_filters('mec_ical_single_url', $event->permalink, $event->ID) . $crlf; + + // Organizer + $organizer_id = $this->get_master_organizer_id($event->ID, $start_time); + $organizer = $event->organizers[$organizer_id] ?? []; + $organizer_name = (isset($organizer['name']) and trim($organizer['name'])) ? $organizer['name'] : NULL; + $organizer_email = (isset($organizer['email']) and trim($organizer['email'])) ? $organizer['email'] : NULL; + + if ($organizer_name or $organizer_email) $ical .= "ORGANIZER;CN=" . $organizer_name . ":MAILTO:" . $organizer_email . $crlf; + + // Categories + $categories = ''; + if (isset($event->categories) and is_array($event->categories) and count($event->categories)) { + foreach ($event->categories as $category) $categories .= $category['name'] . ','; + } + + if (trim($categories) != '') $ical .= "CATEGORIES:" . trim($categories, ', ') . $crlf; + + // Location + $location_id = $this->get_master_location_id($event->ID, $start_time); + $location = $event->locations[$location_id] ?? []; + $address = ((isset($location['address']) and trim($location['address'])) ? $location['address'] : (isset($location['name']) ? $location['name'] : '')); + + if (trim($address) != '') $ical .= "LOCATION:" . $address . $crlf; + + // Featured Image + if (trim($event->featured_image['full']) != '') { + $ex = explode('/', $event->featured_image['full']); + $filename = end($ex); + $ical .= "ATTACH;FMTTYPE=" . $this->get_mime_content_type($filename) . ":" . $event->featured_image['full'] . $crlf; + } + + $ical .= "END:VEVENT" . $crlf; + + return apply_filters('mec_ical_single', $ical); + } + + /** + * Returns iCal export for email + * @author Webnus + * @param int $event_id + * @param int $book_id + * @param string $occurrence + * @return string + */ + public function ical_single_email($event_id, $book_id, $occurrence = '') + { + // Valid Line Separator + $crlf = "\r\n"; + + $date = get_post_meta($book_id, 'mec_date', true); + $timestamps = explode(':', $date); + + // MEC Render Library + $render = $this->getRender(); + $event = $render->data($event_id); + + $start_time = ($timestamps[0] ?? strtotime(get_the_date($book_id))); + $end_time = ($timestamps[1] ?? strtotime(get_the_date($book_id))); + + $location_id = $this->get_master_location_id($event->ID, $start_time); + $location = $event->locations[$location_id] ?? []; + $address = (isset($location['address']) and trim($location['address'])) ? $location['address'] : (isset($location['name']) ? $location['name'] : ''); + + $gmt_offset_seconds = $this->get_gmt_offset_seconds($start_time, $event); + + $stamp = strtotime($event->post->post_date); + $modified = strtotime($event->post->post_modified); + $time_format = (isset($event->meta['mec_date']) and isset($event->meta['mec_date']['allday']) and $event->meta['mec_date']['allday']) ? 'Ymd' : 'Ymd\\THi00\\Z'; + + $sequence = (isset($event->meta['mec_sequence']) ? (int) $event->meta['mec_sequence'] : 0); + + $event_content = preg_replace('#]*href="((?!/)[^"]+)">[^<]+#', '$0 ( $1 )', $event->content); + $event_content = strip_shortcodes(strip_tags($event_content)); + $event_content = str_replace("\r\n", "\\n", $event_content); + $event_content = str_replace("\n", "\\n", $event_content); + $event_content = preg_replace('/(]*>.+?<\/script>|]*>.+?<\/style>)/s', '', $event_content); + + $ical = "BEGIN:VEVENT" . $crlf; + $ical .= "CLASS:PUBLIC" . $crlf; + $ical .= "UID:MEC-" . md5($event_id) . "@" . $this->get_domain() . $crlf; + $ical .= "DTSTART:" . gmdate($time_format, ($start_time - $gmt_offset_seconds)) . $crlf; + $ical .= "DTEND:" . gmdate($time_format, ($end_time - $gmt_offset_seconds)) . $crlf; + $ical .= "DTSTAMP:" . gmdate($time_format, ($stamp - $gmt_offset_seconds)) . $crlf; + $ical .= "CREATED:" . date('Ymd', $stamp) . $crlf; + $ical .= "LAST-MODIFIED:" . date('Ymd', $modified) . $crlf; + $ical .= "PRIORITY:5" . $crlf; + $ical .= "SEQUENCE:" . $sequence . $crlf; + $ical .= "TRANSP:OPAQUE" . $crlf; + $ical .= "SUMMARY:" . html_entity_decode(apply_filters('mec_ical_single_summary', $event->title, $event_id), ENT_NOQUOTES, 'UTF-8') . $crlf; + $ical .= "DESCRIPTION:" . html_entity_decode(apply_filters('mec_ical_single_description', $event_content, $event_id, $event), ENT_NOQUOTES, 'UTF-8') . $crlf; + $ical .= "X-ALT-DESC;FMTTYPE=text/html:" . html_entity_decode(apply_filters('mec_ical_single_description', $event_content, $event_id, $event), ENT_NOQUOTES, 'UTF-8') . $crlf; + $ical .= "URL:" . apply_filters('mec_ical_single_url', $event->permalink, $event_id) . $crlf; + + // Location + if (trim($address) != '') $ical .= "LOCATION:" . $address . $crlf; + + // Featured Image + if (trim($event->featured_image['full']) != '') { + $ex = explode('/', $event->featured_image['full']); + $filename = end($ex); + $ical .= "ATTACH;FMTTYPE=" . $this->get_mime_content_type($filename) . ":" . $event->featured_image['full'] . $crlf; + } + + $ical .= "END:VEVENT" . $crlf; + + return apply_filters('mec_ical_single', $ical); + } + + /** + * Returns iCal export for some events + * @author Webnus + * @param string $events + * @return string + */ + public function ical_calendar($events) + { + // Valid Line Separator + $crlf = "\r\n"; + + $ical = "BEGIN:VCALENDAR" . $crlf; + $ical .= "VERSION:2.0" . $crlf; + $ical .= "METHOD:PUBLISH" . $crlf; + $ical .= "CALSCALE:GREGORIAN" . $crlf; + $ical .= "PRODID:-//WordPress - MECv" . $this->get_version() . "//EN" . $crlf; + $ical .= "X-ORIGINAL-URL:" . $this->URL('site') . $crlf; + $ical .= "X-WR-CALNAME:" . get_bloginfo('name') . $crlf; + $ical .= "X-WR-CALDESC:" . get_bloginfo('description') . $crlf; + $ical .= "REFRESH-INTERVAL;VALUE=DURATION:PT1H" . $crlf; + $ical .= "X-PUBLISHED-TTL:PT1H" . $crlf; + $ical .= "X-MS-OLK-FORCEINSPECTOROPEN:TRUE" . $crlf; + $ical .= $events; + $ical .= "END:VCALENDAR" . $crlf; + + return $ical; + } + + /** + * Get mime-type of a file + * @author Webnus + * @param string $filename + * @return string + */ + public function get_mime_content_type($filename) + { + // Remove query string from the image name + if (strpos($filename, '?') !== false) { + $ex = explode('?', $filename); + $filename = $ex[0]; + } + + $mime_types = array( + 'txt' => 'text/plain', + 'htm' => 'text/html', + 'html' => 'text/html', + 'php' => 'text/html', + 'css' => 'text/css', + 'js' => 'application/javascript', + 'json' => 'application/json', + 'xml' => 'application/xml', + 'swf' => 'application/x-shockwave-flash', + 'flv' => 'video/x-flv', + + // images + 'png' => 'image/png', + 'jpe' => 'image/jpeg', + 'jpeg' => 'image/jpeg', + 'jpg' => 'image/jpeg', + 'webp' => 'image/webp', + 'gif' => 'image/gif', + 'bmp' => 'image/bmp', + 'ico' => 'image/vnd.microsoft.icon', + 'tiff' => 'image/tiff', + 'tif' => 'image/tiff', + 'svg' => 'image/svg+xml', + 'svgz' => 'image/svg+xml', + + // archives + 'zip' => 'application/zip', + 'rar' => 'application/x-rar-compressed', + 'exe' => 'application/x-msdownload', + 'msi' => 'application/x-msdownload', + 'cab' => 'application/vnd.ms-cab-compressed', + + // audio/video + 'mp3' => 'audio/mpeg', + 'qt' => 'video/quicktime', + 'mov' => 'video/quicktime', + + // adobe + 'pdf' => 'application/pdf', + 'psd' => 'image/vnd.adobe.photoshop', + 'ai' => 'application/postscript', + 'eps' => 'application/postscript', + 'ps' => 'application/postscript', + + // MS Office + 'doc' => 'application/msword', + 'rtf' => 'application/rtf', + 'xls' => 'application/vnd.ms-excel', + 'ppt' => 'application/vnd.ms-powerpoint', + + // open office + 'odt' => 'application/vnd.oasis.opendocument.text', + 'ods' => 'application/vnd.oasis.opendocument.spreadsheet', + ); + + $ex = explode('.', $filename); + $ext = strtolower(array_pop($ex)); + if (array_key_exists($ext, $mime_types)) { + return $mime_types[$ext]; + } elseif (function_exists('finfo_open')) { + $finfo = finfo_open(FILEINFO_MIME); + $mimetype = finfo_file($finfo, $filename); + finfo_close($finfo); + + return $mimetype; + } else { + return 'application/octet-stream'; + } + } + + /** + * Returns book post type slug + * @author Webnus + * @return string + */ + public function get_book_post_type() + { + return apply_filters('mec_book_post_type_name', 'mec-books'); + } + + /** + * Returns shortcode post type slug + * @author Webnus + * @return string + */ + public function get_shortcode_post_type() + { + return apply_filters('mec_shortcode_post_type_name', 'mec_calendars'); + } + + /** + * Returns email post type + * @author Webnus + * @return string + */ + public function get_email_post_type() + { + return apply_filters('mec_email_post_type_name', 'mec-emails'); + } + + /** + * Returns certificate type + * @author Webnus + * @return string + */ + public function get_certificate_post_type() + { + return apply_filters('mec_certificate_post_type_name', 'mec-certificate'); + } + + /** + * Returns webhooks post type + * @author Webnus + * @return string + */ + public function get_webhook_post_type() + { + return apply_filters('mec_email_post_type_name', 'mec-webhooks'); + } + + public function field_icon_feature($key, $values = array(), $prefix = 'reg') + { + if ($prefix !== 'event') return ''; + + // MEC Settings + $settings = $this->get_settings(); + + // Feature is disabled + if (!isset($settings['event_fields_icon']) or (isset($settings['event_fields_icon']) and !$settings['event_fields_icon'])) return ''; + + $preview_html_id = 'mec_thumbnail_img_' . esc_attr($prefix) . '_' . esc_attr($key); + $input_html_id = 'mec_thumbnail_' . esc_attr($prefix) . '_' . esc_attr($key); + $icon = isset($values['icon']) ? $values['icon'] : ''; + + return ' +
        ' . (trim($icon) != '' ? '' : '') . '
        + + + +
        '; + } + + /** + * Show text field options in booking form + * @author Webnus + * @param string $key + * @param array $values + * @param string $prefix + * @return string + */ + public function field_text($key, $values = array(), $prefix = 'reg') + { + return '
      • + ' . esc_html__('Sort', 'modern-events-calendar-lite') . ' + ' . esc_html__('Text', 'modern-events-calendar-lite') . ' + ' . ($prefix == 'event' ? '%%event_field_' . esc_html($key) . '%%' : ($prefix == 'bfixed' ? '%%booking_field_' . esc_html($key) . '%%' : '')) . ' + ' . $this->field_icon_feature($key, $values, $prefix) . ' + ' . apply_filters('mec_form_field_description', '', $key, $values, $prefix) . ' +

        + +

        + ' . esc_html__('Remove', 'modern-events-calendar-lite') . ' +
        + + + ' . ($prefix == 'reg' ? $this->get_wp_user_fields_dropdown('mec[' . esc_attr($prefix) . '_fields][' . esc_attr($key) . '][mapping]', ($values['mapping'] ?? '')) : '') . ' +
        +
      • '; + } + + /** + * Show text field options in booking form + * @author Webnus + * @param string $key + * @param array $values + * @param string $prefix + * @return string + */ + public function field_name($key, $values = array(), $prefix = 'reg') + { + return '
      • + ' . esc_html__('Sort', 'modern-events-calendar-lite') . ' + ' . esc_html__('MEC Name', 'modern-events-calendar-lite') . ' + ' . ($prefix == 'event' ? '%%event_field_' . esc_html($key) . '%%' : ($prefix == 'bfixed' ? '%%booking_field_' . esc_html($key) . '%%' : '')) . ' + ' . $this->field_icon_feature($key, $values, $prefix) . ' + ' . apply_filters('mec_form_field_description', '', $key, $values, $prefix) . ' + +
        + + +
        +
      • '; + } + + /** + * Show text field options in booking form + * @author Webnus + * @param string $key + * @param array $values + * @param string $prefix + * @return string + */ + public function field_mec_email($key, $values = array(), $prefix = 'reg') + { + return '
      • + ' . esc_html__('Sort', 'modern-events-calendar-lite') . ' + ' . esc_html__('MEC Email', 'modern-events-calendar-lite') . ' + ' . ($prefix == 'event' ? '%%event_field_' . esc_html($key) . '%%' : ($prefix == 'bfixed' ? '%%booking_field_' . esc_html($key) . '%%' : '')) . ' + ' . $this->field_icon_feature($key, $values, $prefix) . ' + ' . apply_filters('mec_form_field_description', '', $key, $values, $prefix) . ' + +
        + + +
        +
      • '; + } + + /** + * Show email field options in booking form + * @author Webnus + * @param string $key + * @param array $values + * @param string $prefix + * @return string + */ + public function field_email($key, $values = array(), $prefix = 'reg') + { + return '
      • + ' . esc_html__('Sort', 'modern-events-calendar-lite') . ' + ' . esc_html__('Email', 'modern-events-calendar-lite') . ' + ' . ($prefix == 'event' ? '%%event_field_' . esc_html($key) . '%%' : ($prefix == 'bfixed' ? '%%booking_field_' . esc_html($key) . '%%' : '')) . ' + ' . $this->field_icon_feature($key, $values, $prefix) . ' + ' . apply_filters('mec_form_field_description', '', $key, $values, $prefix) . ' +

        + +

        + ' . esc_html__('Remove', 'modern-events-calendar-lite') . ' +
        + + + ' . ($prefix == 'reg' ? $this->get_wp_user_fields_dropdown('mec[' . esc_attr($prefix) . '_fields][' . esc_attr($key) . '][mapping]', ($values['mapping'] ?? '')) : '') . ' +
        +
      • '; + } + + /** + * Show URL field options in forms + * @author Webnus + * @param string $key + * @param array $values + * @param string $prefix + * @return string + */ + public function field_url($key, $values = array(), $prefix = 'reg') + { + return '
      • + ' . esc_html__('Sort', 'modern-events-calendar-lite') . ' + ' . esc_html__('URL', 'modern-events-calendar-lite') . ' + ' . ($prefix == 'event' ? '%%event_field_' . esc_html($key) . '%%' : ($prefix == 'bfixed' ? '%%booking_field_' . esc_html($key) . '%%' : '')) . ' + ' . $this->field_icon_feature($key, $values, $prefix) . ' + ' . apply_filters('mec_form_field_description', '', $key, $values, $prefix) . ' +

        + +

        + ' . esc_html__('Remove', 'modern-events-calendar-lite') . ' +
        + + + ' . ($prefix == 'reg' ? $this->get_wp_user_fields_dropdown('mec[' . esc_attr($prefix) . '_fields][' . esc_attr($key) . '][mapping]', ($values['mapping'] ?? '')) : '') . ' +
        +
      • '; + } + + /** + * Show file field options in booking form + * @author Webnus + * @param string $key + * @param array $values + * @param string $prefix + * @return string + */ + public function field_file($key, $values = array(), $prefix = 'reg') + { + return '
      • + ' . esc_html__('Sort', 'modern-events-calendar-lite') . ' + ' . esc_html__('File', 'modern-events-calendar-lite') . ' + ' . ($prefix == 'event' ? '%%event_field_' . esc_html($key) . '%%' : ($prefix == 'bfixed' ? '%%booking_field_' . esc_html($key) . '%%' : '')) . ' + ' . $this->field_icon_feature($key, $values, $prefix) . ' + ' . apply_filters('mec_form_field_description', '', $key, $values, $prefix) . ' +

        + +

        + ' . esc_html__('Remove', 'modern-events-calendar-lite') . ' +
        + + +
        +
      • '; + } + + /** + * Show date field options in booking form + * @author Webnus + * @param string $key + * @param array $values + * @param string $prefix + * @return string + */ + public function field_date($key, $values = array(), $prefix = 'reg') + { + return '
      • + ' . esc_html__('Sort', 'modern-events-calendar-lite') . ' + ' . esc_html__('Date', 'modern-events-calendar-lite') . ' + ' . ($prefix == 'event' ? '%%event_field_' . esc_html($key) . '%%' : ($prefix == 'bfixed' ? '%%booking_field_' . esc_html($key) . '%%' : '')) . ' + ' . $this->field_icon_feature($key, $values, $prefix) . ' + ' . apply_filters('mec_form_field_description', '', $key, $values, $prefix) . ' +

        + +

        + ' . esc_html__('Remove', 'modern-events-calendar-lite') . ' +
        + + + ' . ($prefix == 'reg' ? $this->get_wp_user_fields_dropdown('mec[' . esc_attr($prefix) . '_fields][' . esc_attr($key) . '][mapping]', ($values['mapping'] ?? '')) : '') . ' +
        +
      • '; + } + + /** + * Show tel field options in booking form + * @author Webnus + * @param string $key + * @param array $values + * @param string $prefix + * @return string + */ + public function field_tel($key, $values = array(), $prefix = 'reg') + { + return '
      • + ' . esc_html__('Sort', 'modern-events-calendar-lite') . ' + ' . esc_html__('Tel', 'modern-events-calendar-lite') . ' + ' . ($prefix == 'event' ? '%%event_field_' . esc_html($key) . '%%' : ($prefix == 'bfixed' ? '%%booking_field_' . esc_html($key) . '%%' : '')) . ' + ' . $this->field_icon_feature($key, $values, $prefix) . ' + ' . apply_filters('mec_form_field_description', '', $key, $values, $prefix) . ' +

        + +

        + ' . esc_html__('Remove', 'modern-events-calendar-lite') . ' +
        + + + ' . ($prefix == 'reg' ? $this->get_wp_user_fields_dropdown('mec[' . esc_attr($prefix) . '_fields][' . esc_attr($key) . '][mapping]', ($values['mapping'] ?? '')) : '') . ' +
        +
      • '; + } + + /** + * Show textarea field options in booking form + * @author Webnus + * @param string $key + * @param array $values + * @param string $prefix + * @return string + */ + public function field_textarea($key, $values = array(), $prefix = 'reg') + { + return '
      • + ' . esc_html__('Sort', 'modern-events-calendar-lite') . ' + ' . esc_html__('Textarea', 'modern-events-calendar-lite') . ' + ' . ($prefix == 'event' ? '%%event_field_' . esc_html($key) . '%%' : ($prefix == 'bfixed' ? '%%booking_field_' . esc_html($key) . '%%' : '')) . ' + ' . $this->field_icon_feature($key, $values, $prefix) . ' + ' . apply_filters('mec_form_field_description', '', $key, $values, $prefix) . ' +

        +

        + +
        + ' . ($prefix == 'event' ? '
        ' : '') . ' +

        + ' . esc_html__('Remove', 'modern-events-calendar-lite') . ' +
        + + + ' . ($prefix == 'reg' ? $this->get_wp_user_fields_dropdown('mec[' . esc_attr($prefix) . '_fields][' . esc_attr($key) . '][mapping]', ($values['mapping'] ?? '')) : '') . ' +
        +
      • '; + } + + /** + * Show paragraph field options in booking form + * @author Webnus + * @param string $key + * @param array $values + * @param string $prefix + * @return string + */ + public function field_p($key, $values = array(), $prefix = 'reg') + { + return '
      • + ' . esc_html__('Sort', 'modern-events-calendar-lite') . ' + ' . esc_html__('Paragraph', 'modern-events-calendar-lite') . ' + ' . esc_html__('Remove', 'modern-events-calendar-lite') . ' + ' . apply_filters('mec_form_field_description', '', $key, $values, $prefix) . ' +
        + + +

        ' . esc_html__('HTML and shortcode are allowed.') . '

        +
        +
      • '; + } + + /** + * Show checkbox field options in booking form + * @author Webnus + * @param string $key + * @param array $values + * @param string $prefix + * @return string + */ + public function field_checkbox($key, $values = array(), $prefix = 'reg') + { + $i = 0; + $field = '
      • + ' . esc_html__('Sort', 'modern-events-calendar-lite') . ' + ' . esc_html__('Checkboxes', 'modern-events-calendar-lite') . ' + ' . ($prefix == 'event' ? '%%event_field_' . esc_html($key) . '%%' : ($prefix == 'bfixed' ? '%%booking_field_' . esc_html($key) . '%%' : '')) . ' + ' . $this->field_icon_feature($key, $values, $prefix) . ' + ' . apply_filters('mec_form_field_description', '', $key, $values, $prefix) . ' +

        + +

        + ' . esc_html__('Remove', 'modern-events-calendar-lite') . ' +
        + + + ' . ($prefix == 'reg' ? $this->get_wp_user_fields_dropdown('mec[' . esc_attr($prefix) . '_fields][' . esc_attr($key) . '][mapping]', ($values['mapping'] ?? '')) : '') . ' +
          '; + + if (isset($values['options']) and is_array($values['options']) and count($values['options'])) { + foreach ($values['options'] as $option_key => $option) { + $i = max($i, $option_key); + $field .= $this->field_option($key, $option_key, $values, $prefix); + } + } + + $field .= '
        + + +
        +
      • '; + + return $field; + } + + /** + * Show radio field options in booking form + * @author Webnus + * @param string $key + * @param array $values + * @param string $prefix + * @return string + */ + public function field_radio($key, $values = array(), $prefix = 'reg') + { + $i = 0; + $field = '
      • + ' . esc_html__('Sort', 'modern-events-calendar-lite') . ' + ' . esc_html__('Radio Buttons', 'modern-events-calendar-lite') . ' + ' . ($prefix == 'event' ? '%%event_field_' . esc_html($key) . '%%' : ($prefix == 'bfixed' ? '%%booking_field_' . esc_html($key) . '%%' : '')) . ' + ' . $this->field_icon_feature($key, $values, $prefix) . ' + ' . apply_filters('mec_form_field_description', '', $key, $values, $prefix) . ' +

        + +

        + ' . esc_html__('Remove', 'modern-events-calendar-lite') . ' +
        + + + ' . ($prefix == 'reg' ? $this->get_wp_user_fields_dropdown('mec[' . esc_attr($prefix) . '_fields][' . esc_attr($key) . '][mapping]', ($values['mapping'] ?? '')) : '') . ' +
          '; + + if (isset($values['options']) and is_array($values['options']) and count($values['options'])) { + foreach ($values['options'] as $option_key => $option) { + $i = max($i, $option_key); + $field .= $this->field_option($key, $option_key, $values, $prefix); + } + } + + $field .= '
        + + +
        +
      • '; + + return $field; + } + + /** + * Show select field options in booking form + * @author Webnus + * @param string $key + * @param array $values + * @param string $prefix + * @return string + */ + public function field_select($key, $values = array(), $prefix = 'reg') + { + $i = 0; + $field = '
      • + ' . esc_html__('Sort', 'modern-events-calendar-lite') . ' + ' . esc_html__('Dropdown', 'modern-events-calendar-lite') . ' + ' . ($prefix == 'event' ? '%%event_field_' . esc_html($key) . '%%' : ($prefix == 'bfixed' ? '%%booking_field_' . esc_html($key) . '%%' : '')) . ' + ' . $this->field_icon_feature($key, $values, $prefix) . ' + ' . apply_filters('mec_form_field_description', '', $key, $values, $prefix) . ' +

        + +

        +

        + +

        + ' . esc_html__('Remove', 'modern-events-calendar-lite') . ' +
        + + + ' . ($prefix == 'reg' ? $this->get_wp_user_fields_dropdown('mec[' . esc_attr($prefix) . '_fields][' . esc_attr($key) . '][mapping]', ($values['mapping'] ?? '')) : '') . ' +
          '; + + if (isset($values['options']) and is_array($values['options']) and count($values['options'])) { + foreach ($values['options'] as $option_key => $option) { + $i = max($i, $option_key); + $field .= $this->field_option($key, $option_key, $values, $prefix); + } + } + + $field .= '
        + + +
        +
      • '; + + return $field; + } + + /** + * Show agreement field options in booking form + * @author Webnus + * @param string $key + * @param array $values + * @param string $prefix + * @return string + */ + public function field_agreement($key, $values = array(), $prefix = 'reg') + { + // WordPress Pages + $pages = get_pages(); + + $i = 0; + $field = '
      • + ' . esc_html__('Sort', 'modern-events-calendar-lite') . ' + ' . esc_html__('Agreement', 'modern-events-calendar-lite') . ' + ' . ($prefix == 'event' ? '%%event_field_' . esc_html($key) . '%%' : ($prefix == 'bfixed' ? '%%booking_field_' . esc_html($key) . '%%' : '')) . ' + ' . $this->field_icon_feature($key, $values, $prefix) . ' + ' . apply_filters('mec_form_field_description', '', $key, $values, $prefix) . ' +

        + +

        + ' . esc_html__('Remove', 'modern-events-calendar-lite') . ' +
        + +

        ' . esc_html__('Instead of %s, the page title with a link will be show.', 'modern-events-calendar-lite') . '

        +
        + + +
        +
        + + +
        + +
        +
      • '; + + return $field; + } + + /** + * Show option tag parameters in booking form for select, checkbox and radio tags + * @author Webnus + * @param string $field_key + * @param string $key + * @param array $values + * @param string $prefix + * @return string + */ + public function field_option($field_key, $key, $values = array(), $prefix = 'reg') + { + return '
      • + ' . esc_html__('Sort', 'modern-events-calendar-lite') . ' + ' . esc_html__('Remove', 'modern-events-calendar-lite') . ' + +
      • '; + } + + /** + * Render raw price and return its output + * @param int|object $event + * @author Webnus + * @param int $price + * @param boolean $apply_free + * @return string + */ + public function render_price($price, $event = NULL, $apply_free = true) + { + // return Free if price is 0 + if ($price == '0' and $apply_free) return esc_html__('Free', 'modern-events-calendar-lite'); + + $thousand_separator = $this->get_thousand_separator($event); + $decimal_separator = $this->get_decimal_separator($event); + + $currency = $this->get_currency_sign($event); + $currency_sign_position = $this->get_currency_sign_position($event); + $decimals = $this->get_decimals($event); + + // Force to double + if (is_string($price)) $price = (float) $price; + + $rendered = number_format($price, ($decimal_separator === false ? 0 : $decimals), ($decimal_separator === false ? '' : $decimal_separator), $thousand_separator); + + if ($currency_sign_position == 'after') $rendered = $rendered . $currency; + elseif ($currency_sign_position == 'after_space') $rendered = $rendered . ' ' . $currency; + elseif ($currency_sign_position == 'before_space') $rendered = $currency . ' ' . $rendered; + else $rendered = $currency . $rendered; + + return $rendered; + } + + /** + * Returns thousands separator + * @param int|object $event + * @author Webnus + * @return string + */ + public function get_thousand_separator($event = NULL) + { + $settings = $this->get_settings(); + + // Separator + $separator = (isset($settings['thousand_separator']) ? $settings['thousand_separator'] : ','); + + // Currency Per Event + if ($event and isset($settings['currency_per_event']) and $settings['currency_per_event']) { + $options = $this->get_event_currency_options($event); + if (isset($options['thousand_separator']) and trim($options['thousand_separator'])) $separator = $options['thousand_separator']; + } + + return apply_filters('mec_thousand_separator', $separator); + } + + /** + * Returns decimal separator + * @param int|object $event + * @author Webnus + * @return string + */ + public function get_decimal_separator($event = NULL) + { + $settings = $this->get_settings(); + + // Separator + $separator = (isset($settings['decimal_separator']) ? $settings['decimal_separator'] : '.'); + + // Status + $disabled = (isset($settings['decimal_separator_status']) and $settings['decimal_separator_status'] == 0); + + // Currency Per Event + if ($event and isset($settings['currency_per_event']) and $settings['currency_per_event']) { + $options = $this->get_event_currency_options($event); + if (isset($options['decimal_separator']) and trim($options['decimal_separator'])) $separator = $options['decimal_separator']; + if (isset($options['decimal_separator_status'])) $disabled = (bool) !$options['decimal_separator_status']; + } + + return apply_filters('mec_decimal_separator', ($disabled ? false : $separator)); + } + + /** + * @param int|object $event + * @return array + */ + public function get_event_currency_options($event) + { + $event_id = (is_object($event) ? $event->ID : $event); + + $options = get_post_meta($event_id, 'mec_currency', true); + if (!is_array($options)) $options = []; + + return $options; + } + + /** + * Returns currency of MEC + * @param int|object $event + * @author Webnus + * @return string + */ + public function get_currency($event = NULL) + { + $settings = $this->get_settings(); + $currency = ($settings['currency'] ?? ''); + + // Currency Per Event + if ($event and isset($settings['currency_per_event']) and $settings['currency_per_event']) { + $options = $this->get_event_currency_options($event); + if (isset($options['currency']) and trim($options['currency'])) $currency = $options['currency']; + } + + return apply_filters('mec_currency', $currency); + } + + /** + * Returns currency sign of MEC + * @param int|object $event + * @author Webnus + * @return string + */ + public function get_currency_sign($event = NULL) + { + $settings = $this->get_settings(); + + // Get Currency Symptom + $currency = $this->get_currency($event); + if (isset($settings['currency_symptom']) and trim($settings['currency_symptom'])) $currency = $settings['currency_symptom']; + + // Currency Per Event + if ($event and isset($settings['currency_per_event']) and $settings['currency_per_event']) { + $options = $this->get_event_currency_options($event); + if (isset($options['currency_symptom']) and trim($options['currency_symptom'])) $currency = $options['currency_symptom']; + } + + return apply_filters('mec_currency_sign', $currency); + } + + /** + * Returns currency code of MEC + * @param int|object $event + * @author Webnus + * @return string + */ + public function get_currency_code($event = NULL) + { + $currency = $this->get_currency($event); + $currencies = $this->get_currencies(); + + return isset($currencies[$currency]) ? $currencies[$currency] : 'USD'; + } + + /** + * Returns currency sign position of MEC + * @param int|object $event + * @author Webnus + * @return string + */ + public function get_currency_sign_position($event = NULL) + { + $settings = $this->get_settings(); + + // Currency Position + $position = (isset($settings['currency_sign']) ? $settings['currency_sign'] : ''); + + // Currency Per Event + if ($event and isset($settings['currency_per_event']) and $settings['currency_per_event']) { + $options = $this->get_event_currency_options($event); + if (isset($options['currency_sign']) and trim($options['currency_sign'])) $position = $options['currency_sign']; + } + + return apply_filters('mec_currency_sign_position', $position); + } + + public function get_decimals($event = NULL) + { + + $settings = $this->get_settings(); + + // Currency Decimals + $decimals = (isset($settings['currency_decimals']) ? (int)$settings['currency_decimals'] : 2); + + // Currency Per Event + if ($event and isset($settings['currency_per_event']) and $settings['currency_per_event']) { + $options = $this->get_event_currency_options($event); + if (isset($options['currency_decimals']) and trim($options['currency_decimals'])) $decimals = (int)$options['currency_decimals']; + } + + return apply_filters('mec_currency_decimals', $decimals); + } + + /** + * Returns MEC Payment Gateways + * @author Webnus + * @return array + */ + public function get_gateways() + { + return apply_filters('mec_gateways', array()); + } + + /** + * Check to see if user exists by its username + * @author Webnus + * @param string $username + * @return boolean + */ + public function username_exists($username) + { + /** first validation **/ + if (!trim($username)) return true; + + return username_exists($username); + } + + /** + * Check to see if user exists by its email + * @author Webnus + * @param string $email + * @return boolean + */ + public function email_exists($email) + { + /** first validation **/ + if (!trim($email)) return true; + + return email_exists($email); + } + + /** + * Register a user in WordPress + * @author Webnus + * @param string $username + * @param string $email + * @param string $password + * @param boolean $auto + * @return boolean + */ + public function register_user($username, $email, $password = NULL, $auto = true) + { + /** first validation **/ + if (!trim($username) or !trim($email)) return false; + + if ($auto) return register_new_user($username, $email); + return wp_create_user($username, $password, $email); + } + + /** + * Convert a formatted date into standard format + * @author Webnus + * @param string $date + * @return string + */ + public function to_standard_date($date) + { + $date = str_replace('-', '/', $date); + $date = str_replace('.', '/', $date); + + return date('Y-m-d', strtotime($date)); + } + + /** + * Render the date + * @author Webnus + * @param string $date + * @return string + */ + public function render_date($date) + { + return $date; + } + + /** + * Generate output of MEC Dashboard + * @author Webnus + */ + public function dashboard() + { + // Import dashboard page of MEC + $path = $this->import('app.features.mec.dashboard', true, true); + + // Create mec_events table if it's removed for any reason + $this->create_mec_tables(); + + ob_start(); + include $path; + echo MEC_kses::full(ob_get_clean()); + } + + /** + * Redirect on plugin activation + * @author Webnus + */ + public function mec_redirect_after_activate() + { + $do_redirection = apply_filters('mec_do_redirection_after_activation', true); + if (!$do_redirection) return false; + + // No need to redirect + if (!get_option('mec_activation_redirect', false)) return true; + + // Delete the option to don't do it always + delete_option('mec_activation_redirect'); + + // Redirect to MEC Dashboard + wp_redirect(admin_url('/admin.php?page=MEC-wizard')); + exit; + } + + /** + * Check if we can show booking module or not + * @author Webnus + * @param object $event + * @return boolean + */ + public function can_show_booking_module($event) + { + // PRO Version is required + if (!$this->getPRO()) return false; + + // MEC Settings + $settings = $this->get_settings(); + + // Booking on single page is disabled + if (!isset($settings['booking_status']) or (isset($settings['booking_status']) and !$settings['booking_status'])) return false; + + // Who Can Book + $wcb_all = (isset($settings['booking_wcb_all']) and is_numeric($settings['booking_wcb_all'])) ? $settings['booking_wcb_all'] : 1; + if (!$wcb_all) { + $user_id = get_current_user_id(); + + // Guest User is not Permitted + if (!$user_id) return false; + + // User + $user = get_user_by('id', $user_id); + + // Invalid User ID + if (!$user or ($user and !isset($user->roles))) return false; + + $roles = (array) $user->roles; + + $can = false; + foreach ($roles as $role) if (isset($settings['booking_wcb_' . $role]) and $settings['booking_wcb_' . $role]) $can = true; + + if (!$can) return false; + } + + $tickets = isset($event->data->tickets) ? $event->data->tickets : []; + $dates = isset($event->dates) ? $event->dates : (isset($event->date) ? $event->date : array()); + $next_date = isset($dates[0]) ? $dates[0] : (isset($event->date) ? $event->date : array()); + + // No Dates or no Tickets + if (!count($dates) or !count($tickets)) return false; + + $start_timestamp = isset($next_date['start']['timestamp']) ? $next_date['start']['timestamp'] : NULL; + + // Occurrence Canceled + if ($this->is_occurrence_cenceled($event, $start_timestamp)) return false; + + // Booking Options + $booking_options = (isset($event->data->meta['mec_booking']) and is_array($event->data->meta['mec_booking'])) ? $event->data->meta['mec_booking'] : []; + + $booking_unlimited = (!isset($booking_options['bookings_limit_unlimited']) || $booking_options['bookings_limit_unlimited']); + $booking_limit = (isset($booking_options['bookings_limit']) and trim($booking_options['bookings_limit']) !== '') ? (int) $booking_options['bookings_limit'] : -1; + + // Limit is 0 + if (!$booking_unlimited and $booking_limit === 0) return false; + + $book_all_occurrences = 0; + if (isset($event->data) and isset($event->data->meta) and isset($booking_options['bookings_all_occurrences'])) $book_all_occurrences = (int) $booking_options['bookings_all_occurrences']; + + $bookings_stop_selling_after_first_occurrence = isset($booking_options['stop_selling_after_first_occurrence']) ? $booking_options['stop_selling_after_first_occurrence'] : 0; + if ($bookings_stop_selling_after_first_occurrence and $this->is_first_occurrence_passed($event)) return false; + + $show_booking_form_interval = (isset($settings['show_booking_form_interval'])) ? $settings['show_booking_form_interval'] : 0; + if (isset($booking_options['show_booking_form_interval']) and trim($booking_options['show_booking_form_interval']) != '') $show_booking_form_interval = $booking_options['show_booking_form_interval']; + + // Check Show Booking Form Time + if ($show_booking_form_interval) { + if ($book_all_occurrences) { + $db = $this->getDB(); + $first_timestamp = $db->select("SELECT `tstart` FROM `#__mec_dates` WHERE `post_id`=" . $event->data->ID . " ORDER BY `tstart` ASC LIMIT 1", 'loadResult'); + $render_date = date('Y-m-d h:i a', $first_timestamp); + } else { + $render_date = (isset($next_date['start']['date']) ? trim($next_date['start']['date']) : date('Y-m-d')) . ' ' . (isset($next_date['start']['hour']) ? trim(sprintf('%02d', $next_date['start']['hour'])) : date('h', current_time('timestamp', 0))) . ':' + . (isset($next_date['start']['minutes']) ? trim(sprintf('%02d', $next_date['start']['minutes'])) : date('i', current_time('timestamp', 0))) . ' ' . (isset($next_date['start']['ampm']) ? trim($next_date['start']['ampm']) : date('a', current_time('timestamp', 0))); + } + + if ($this->check_date_time_validation('Y-m-d h:i a', strtolower($render_date))) { + $date_diff = $this->date_diff(date('Y-m-d h:i a', current_time('timestamp')), $render_date); + if (isset($date_diff->days) and !$date_diff->invert) { + $minute = $date_diff->days * 24 * 60; + $minute += $date_diff->h * 60; + $minute += $date_diff->i; + + if ($minute > $show_booking_form_interval) return false; + } + } + } + + // Booking OnGoing Event Option + $ongoing_event_book = (isset($settings['booking_ongoing']) and $settings['booking_ongoing'] == '1'); + + // The event is Expired/Passed + if ($ongoing_event_book) { + if (!isset($next_date['end']) or (isset($next_date['end']) and $this->is_past($next_date['end']['date'], current_time('Y-m-d')))) return false; + if (isset($next_date['end']) and isset($next_date['end']['timestamp']) and $next_date['end']['timestamp'] < current_time('timestamp', 0)) return false; + } else { + $time_format = 'Y-m-d'; + $render_date = isset($next_date['start']) ? trim($next_date['start']['date']) : false; + + if (!trim($event->data->meta['mec_repeat_status'])) { + if (isset($next_date['start']['hour'])) $render_date .= ' ' . sprintf('%02d', $next_date['start']['hour']) . ':' . sprintf('%02d', $next_date['start']['minutes']) . trim($next_date['start']['ampm']); + else $render_date .= ' ' . date('h:ia', $event->data->time['start_timestamp']); + + $time_format .= ' h:ia'; + } + + if (!$render_date or ($render_date and $this->is_past($render_date, current_time($time_format)))) return false; + } + + // MEC payment gateways + $gateway_options = $this->get_gateways_options(); + + $is_gateway_enabled = false; + foreach ($gateway_options as $gateway_option) { + if (is_array($gateway_option) and isset($gateway_option['status']) and $gateway_option['status'] != 0) { + $is_gateway_enabled = true; + break; + } + } + + $wc_status = ((isset($settings['wc_status']) and class_exists('WooCommerce')) ? (bool) $settings['wc_status'] : false); + + // No Payment gateway is enabled + if (!$is_gateway_enabled and !$wc_status) return false; + + return apply_filters('mec_can_show_booking_module', true, $event); + } + + /** + * Check if we can show countdown module or not + * @author Webnus + * @param object $event + * @return boolean + */ + public function can_show_countdown_module($event) + { + // MEC Settings + $settings = $this->get_settings(); + + // Countdown on single page is disabled + if (!isset($settings['countdown_status']) || !$settings['countdown_status']) return false; + + $date = $event->date; + $start_date = (isset($date['start']) and isset($date['start']['date'])) ? $date['start']['date'] : date('Y-m-d'); + + $countdown_method = get_post_meta($event->ID, 'mec_countdown_method', true); + if (trim($countdown_method) == '') $countdown_method = 'global'; + + if ($countdown_method == 'global') $ongoing = isset($settings['hide_time_method']) && trim($settings['hide_time_method']) == 'end'; + else $ongoing = $countdown_method == 'end'; + + // The event is Expired/Passed + if ($this->is_past($start_date, date('Y-m-d')) and !$ongoing) return false; + + return true; + } + + /** + * @param null $event + * @return DateTimeZone + */ + public function get_TZO($event = NULL) + { + $timezone = $this->get_timezone($event); + return new DateTimeZone($timezone); + } + + /** + * Get default timezone of WordPress + * @author Webnus + * @param mixed $event + * @return string + */ + public function get_timezone($event = NULL) + { + if (!is_null($event)) { + $event_id = ((is_object($event) and isset($event->ID)) ? $event->ID : $event); + $timezone = get_post_meta($event_id, 'mec_timezone', true); + + if (trim($timezone) != '' and $timezone != 'global') $timezone_string = $timezone; + else $timezone_string = get_option('timezone_string'); + } else $timezone_string = get_option('timezone_string'); + + $gmt_offset = get_option('gmt_offset'); + + if (trim($timezone_string) == '' and trim($gmt_offset)) $timezone_string = $this->get_timezone_by_offset($gmt_offset); + elseif (trim($timezone_string) == '' and trim($gmt_offset) == '0') { + $timezone_string = 'UTC'; + } + + return $timezone_string; + } + + /** + * Get GMT offset based on hours:minutes + * @author Webnus + * @param mixed $event + * @param $date + * @return string + */ + public function get_gmt_offset($event = NULL, $date = NULL) + { + // Timezone + $timezone = $this->get_timezone($event); + + // Convert to Date + if ($date and is_numeric($date)) $date = date('Y-m-d', $date); + elseif (!$date) $date = current_time('Y-m-d'); + + $UTC = new DateTimeZone('UTC'); + $TZ = new DateTimeZone($timezone); + + $gmt_offset_seconds = $TZ->getOffset((new DateTime($date, $UTC))); + $gmt_offset = ($gmt_offset_seconds / HOUR_IN_SECONDS); + + $minutes = $gmt_offset * 60; + $hour_minutes = sprintf("%02d", $minutes % 60); + + // Convert the hour into two digits format + $h = ($minutes - $hour_minutes) / 60; + $hours = sprintf("%02d", abs($h)); + + // Add - sign to the first of hour if it's negative + if ($h < 0) $hours = '-' . $hours; + + return (substr($hours, 0, 1) == '-' ? '' : '+') . $hours . ':' . (((int) $hour_minutes < 0) ? abs($hour_minutes) : $hour_minutes); + } + + /** + * Get GMT offset based on seconds + * @author Webnus + * @param $date + * @param mixed $event + * @return string + */ + public function get_gmt_offset_seconds($date = NULL, $event = NULL) + { + if ($date) { + $timezone = new DateTimeZone($this->get_timezone($event)); + + // Convert to Date + if (is_numeric($date)) $date = date('Y-m-d H:i:s', $date); + + $target = new DateTime($date, $timezone); + return $timezone->getOffset($target); + } else { + $gmt_offset = get_option('gmt_offset'); + $seconds = $gmt_offset * HOUR_IN_SECONDS; + + return (substr($gmt_offset, 0, 1) == '-' ? '' : '+') . $seconds; + } + } + + public function get_timezone_by_offset($offset) + { + $seconds = $offset * 3600; + + $timezone = timezone_name_from_abbr('', $seconds, 0); + if ($timezone === false) { + $timezones = array( + '-12' => 'Pacific/Auckland', + '-11.5' => 'Pacific/Auckland', // Approx + '-11' => 'Pacific/Apia', + '-10.5' => 'Pacific/Apia', // Approx + '-10' => 'Pacific/Honolulu', + '-9.5' => 'Pacific/Honolulu', // Approx + '-9' => 'America/Anchorage', + '-8.5' => 'America/Anchorage', // Approx + '-8' => 'America/Los_Angeles', + '-7.5' => 'America/Los_Angeles', // Approx + '-7' => 'America/Denver', + '-6.5' => 'America/Denver', // Approx + '-6' => 'America/Chicago', + '-5.5' => 'America/Chicago', // Approx + '-5' => 'America/New_York', + '-4.5' => 'America/New_York', // Approx + '-4' => 'America/Halifax', + '-3.5' => 'America/Halifax', // Approx + '-3' => 'America/Sao_Paulo', + '-2.5' => 'America/Sao_Paulo', // Approx + '-2' => 'America/Sao_Paulo', + '-1.5' => 'Atlantic/Azores', // Approx + '-1' => 'Atlantic/Azores', + '-0.5' => 'UTC', // Approx + '0' => 'UTC', + '0.5' => 'UTC', // Approx + '1' => 'Europe/Paris', + '1.5' => 'Europe/Paris', // Approx + '2' => 'Europe/Helsinki', + '2.5' => 'Europe/Helsinki', // Approx + '3' => 'Europe/Moscow', + '3.5' => 'Europe/Moscow', // Approx + '4' => 'Asia/Dubai', + '4.5' => 'Asia/Tehran', + '5' => 'Asia/Karachi', + '5.5' => 'Asia/Kolkata', + '5.75' => 'Asia/Katmandu', + '6' => 'Asia/Yekaterinburg', + '6.5' => 'Asia/Yekaterinburg', // Approx + '7' => 'Asia/Krasnoyarsk', + '7.5' => 'Asia/Krasnoyarsk', // Approx + '8' => 'Asia/Shanghai', + '8.5' => 'Asia/Shanghai', // Approx + '8.75' => 'Asia/Tokyo', // Approx + '9' => 'Asia/Tokyo', + '9.5' => 'Asia/Tokyo', // Approx + '10' => 'Australia/Melbourne', + '10.5' => 'Australia/Adelaide', + '11' => 'Australia/Melbourne', // Approx + '11.5' => 'Pacific/Auckland', // Approx + '12' => 'Pacific/Auckland', + '12.75' => 'Pacific/Apia', // Approx + '13' => 'Pacific/Apia', + '13.75' => 'Pacific/Honolulu', // Approx + '14' => 'Pacific/Honolulu', + ); + + $timezone = isset($timezones[$offset]) ? $timezones[$offset] : NULL; + } + + return $timezone; + } + + /** + * Get status of Google recaptcha + * @author Webnus + * @deprecated + * @param string $section + * @return boolean + */ + public function get_recaptcha_status($section = '') + { + return $this->getCaptcha()->status($section); + } + + /** + * Get re-captcha verification from Google servers + * @author Webnus + * @deprecated + * @param string $remote_ip + * @param string $response + * @return boolean + */ + public function get_recaptcha_response($response, $remote_ip = NULL) + { + return $this->getCaptcha()->is_valid(); + } + + /** + * Get current language of WordPress + * @author Webnus + * @return string + */ + public function get_current_language() + { + return apply_filters('plugin_locale', get_locale(), 'modern-events-calendar-lite'); + } + + /** + * Write to a log file + * @author Webnus + * @param string|array $log_msg + * @param string $path + */ + public function debug_log($log_msg, $path = '') + { + if (trim($path) == '') $path = MEC_ABSPATH . 'log.txt'; + if (is_array($log_msg) or is_object($log_msg)) $log_msg = print_r($log_msg, true); + + $log_msg .= "\n" . '========' . "\n"; + + $fh = fopen($path, 'a'); + fwrite($fh, $log_msg); + } + + /** + * Filter Skin parameters to add taxonomy, etc. filters that come from WordPress Query + * This used for taxonomy archive pages etc. that are handled by WordPress itself + * @author Webnus + * @param array $atts + * @return array + */ + public function add_search_filters($atts = array()) + { + // Taxonomy Archive Page + if (is_tax()) { + $query = get_queried_object(); + $term_id = $query->term_id; + + if (!isset($atts['category'])) $atts['category'] = ''; + + $atts['category'] = trim(trim($atts['category'], ', ') . ',' . $term_id, ', '); + } + + return $atts; + } + + /** + * Filter TinyMce Buttons + * @author Webnus + * @param array $buttons + * @return array + */ + public function add_mce_buttons($buttons) + { + array_push($buttons, 'mec_mce_buttons'); + return $buttons; + } + + /** + * Filter TinyMce plugins + * @author Webnus + * @param array $plugins + * @return array + */ + public function add_mce_external_plugins($plugins) + { + $plugins['mec_mce_buttons'] = $this->asset('js/mec-external.js'); + return $plugins; + } + + /** + * Return JSON output id and the name of a post type + * @author Webnus + * @param string $post_type + * @return string JSON + */ + public function mce_get_shortcode_list($post_type = 'mec_calendars') + { + $shortcodes = []; + $shortcodes['mce_title'] = esc_html__('M.E. Calender', 'modern-events-calendar-lite'); + $shortcodes['shortcodes'] = []; + + if (post_type_exists($post_type)) { + $shortcodes_list = get_posts(array( + 'post_type' => $post_type, + 'post_status' => 'publish', + 'posts_per_page' => -1, + 'order' => 'DESC' + )); + + if (count($shortcodes_list)) { + foreach ($shortcodes_list as $shortcode) { + $shortcode_item = []; + $shortcode_item['ID'] = $shortcode->ID; + + // PostName + $shortcode_item['PN'] = $shortcode->post_name; + array_push($shortcodes['shortcodes'], $shortcode_item); + } + } + } + + return json_encode($shortcodes); + } + + /** + * Return date_diff + * @author Webnus + * @param string $start_date + * @param string $end_date + * @return object + */ + public function date_diff($start_date, $end_date) + { + if (version_compare(PHP_VERSION, '5.3.0', '>=')) return date_diff(date_create($start_date), date_create($end_date)); + else { + $start = new DateTime($start_date); + $end = new DateTime($end_date); + $days = round(($end->format('U') - $start->format('U')) / (60 * 60 * 24)); + + $interval = new stdClass(); + $interval->days = abs($days); + $interval->invert = ($days >= 0 ? 0 : 1); + + return $interval; + } + } + + /** + * Convert a certain time into seconds (Hours should be in 24 hours format) + * @author Webnus + * @param int $hours + * @param int $minutes + * @param int $seconds + * @return int + */ + public function time_to_seconds($hours, $minutes = 0, $seconds = 0) + { + return (((int) $hours * 3600) + ((int) $minutes * 60) + (int) $seconds); + } + + /** + * Convert a 12-hour format hour to a 24-hour format hour + * @author Webnus + * @param int $hour + * @param string $ampm + * @param string $type + * @return int + */ + public function to_24hours($hour, $ampm = 'PM', $type = 'end') + { + // Time is already in 24-hour format + if (is_null($ampm)) return $hour; + + $ampm = strtoupper($ampm); + + if ($ampm == 'AM' and $hour < 12) return $hour; + elseif ($ampm == 'AM' and $hour == 12 and $type === 'end') return 24; + elseif ($ampm == 'AM' and $hour == 12 and $type === 'start') return 0; + elseif ($ampm == 'PM' and $hour < 12) return ((int) $hour) + 12; + elseif ($ampm == 'PM' and $hour == 12) return 12; + elseif ($hour > 12) return $hour; + } + + /** + * Get rendered events based on a certain criteria + * @author Webnus + * @param array $args + * @return array + */ + public function get_rendered_events($args = array()) + { + $events = []; + $sorted = []; + + // Parse the args + $args = wp_parse_args($args, array( + 'post_type' => $this->get_main_post_type(), + 'posts_per_page' => '-1', + 'post_status' => 'publish' + )); + + // The Query + $query = new WP_Query($args); + + if ($query->have_posts()) { + // MEC Render Library + $render = $this->getRender(); + + // The Loop + while ($query->have_posts()) { + $query->the_post(); + + $event_id = get_the_ID(); + $rendered = $render->data($event_id); + + $data = new stdClass(); + $data->ID = $event_id; + $data->data = $rendered; + $data->dates = $render->dates($event_id, $rendered, 6); + $data->date = isset($data->dates[0]) ? $data->dates[0] : []; + + // Caclculate event start time + $event_start_time = strtotime($data->date['start']['date']) + $rendered->meta['mec_start_day_seconds']; + + // Add the event into the to be sorted array + if (!isset($sorted[$event_start_time])) $sorted[$event_start_time] = []; + $sorted[$event_start_time][] = $data; + } + + ksort($sorted, SORT_NUMERIC); + } + + // Add sorted events to the results + foreach ($sorted as $sorted_events) { + if (!is_array($sorted_events)) continue; + foreach ($sorted_events as $sorted_event) $events[$sorted_event->ID] = $sorted_event; + } + + // Restore original Post Data + wp_reset_postdata(); + + return $events; + } + + /** + * Duplicate an event + * @author Webnus + * @param int $post_id + * @return boolean|int + */ + public function duplicate($post_id) + { + $post = get_post($post_id); + + // Post is not exists + if (!$post) return false; + + // Duplicate Post + $new_post_id = $this->duplicate_post($post_id); + + // MEC DB Library + $db = $this->getDB(); + + // Duplicate MEC record + $mec_data = $db->select("SELECT * FROM `#__mec_events` WHERE `post_id`='$post_id'", 'loadAssoc'); + + $q1 = ""; + $q2 = ""; + foreach ($mec_data as $key => $value) { + if (in_array($key, array('id', 'post_id'))) continue; + + $q1 .= "`$key`,"; + $q2 .= "'$value',"; + } + + $db->q("INSERT INTO `#__mec_events` (`post_id`," . trim($q1, ', ') . ") VALUES ('$new_post_id'," . trim($q2, ', ') . ")"); + + // Update Schedule + $schedule = $this->getSchedule(); + $schedule->reschedule($new_post_id); + + return $new_post_id; + } + + /** + * Duplicate a post + * @author Webnus + * @param int $post_id + * @return boolean|int + */ + public function duplicate_post($post_id) + { + $post = get_post($post_id); + + // Post is not exists + if (!$post) return false; + + // MEC DB Library + $db = $this->getDB(); + + // New post data array + $args = array( + 'comment_status' => $post->comment_status, + 'ping_status' => $post->ping_status, + 'post_author' => $post->post_author, + 'post_content' => $post->post_content, + 'post_excerpt' => $post->post_excerpt, + 'post_name' => sanitize_title($post->post_name . '-' . mt_rand(100, 999)), + 'post_parent' => $post->post_parent, + 'post_password' => $post->post_password, + 'post_status' => 'draft', + 'post_title' => sprintf(esc_html__('Copy of %s', 'modern-events-calendar-lite'), $post->post_title), + 'post_type' => $post->post_type, + 'to_ping' => $post->to_ping, + 'menu_order' => $post->menu_order + ); + + // insert the new post + $new_post_id = wp_insert_post($args); + + // get all current post terms ad set them to the new post draft + $taxonomies = get_object_taxonomies($post->post_type); + foreach ($taxonomies as $taxonomy) { + $post_terms = wp_get_object_terms($post_id, $taxonomy, array('fields' => 'slugs')); + wp_set_object_terms($new_post_id, $post_terms, $taxonomy, false); + } + + // duplicate all post meta + $post_metas = $db->select("SELECT `meta_key`, `meta_value` FROM `#__postmeta` WHERE `post_id`='$post_id'", 'loadObjectList'); + if (count($post_metas)) { + $wpdb = $db->get_DBO(); + $sql_query = "INSERT INTO `#__postmeta` (post_id, meta_key, meta_value) "; + + $sql_query_sel = []; + foreach ($post_metas as $meta_info) { + $meta_key = esc_sql($meta_info->meta_key); + $meta_value = $meta_info->meta_value; + + $sql_query_sel[] = $wpdb->prepare("SELECT $new_post_id, %s, %s", $meta_key, $meta_value); + } + + $sql_query .= implode(" UNION ALL ", $sql_query_sel); + $db->q($sql_query); + } + + return $new_post_id; + } + + /** + * Returns start/end date label + * @author Webnus + * @param array $start + * @param array $end + * @param string $format + * @param string $separator + * @param boolean $minify + * @param integer $allday + * @param object $event + * @param boolean $omit_end_date + * @return string + */ + public function date_label($start, $end, $format, $separator = ' - ', $minify = true, $allday = 0, $event = NULL, $omit_end_date = false) + { + $start_datetime = $start['date']; + $end_datetime = $end['date']; + + $start_parsed = date_parse($start_datetime); + $end_parsed = date_parse($end_datetime); + + if (isset($start['hour']) and ($start_parsed === false or (is_array($start_parsed) and isset($start_parsed['hour']) and $start_parsed['hour'] === false))) { + $s_hour = $start['hour']; + if (strtoupper($start['ampm']) == 'AM' and $s_hour == '0') $s_hour = 12; + + $start_datetime .= ' ' . sprintf("%02d", $s_hour) . ':' . sprintf("%02d", $start['minutes']) . ' ' . $start['ampm']; + } + + if (isset($end['hour']) and ($end_parsed === false or (is_array($end_parsed) and isset($end_parsed['hour']) and $end_parsed['hour'] === false))) { + $e_hour = $end['hour']; + if (strtoupper($end['ampm']) == 'AM' and $e_hour == '0') $e_hour = 12; + + $end_datetime .= ' ' . sprintf("%02d", $e_hour) . ':' . sprintf("%02d", $end['minutes']) . ' ' . $end['ampm']; + } + + $start_timestamp = strtotime($start_datetime); + $end_timestamp = strtotime($end_datetime); + + $timezone_GMT = new DateTimeZone("GMT"); + $timezone_event = new DateTimeZone($this->get_timezone($event)); + + $dt_now = new DateTime("now", $timezone_GMT); + $dt_start = new DateTime($start_datetime, $timezone_GMT); + $dt_end = new DateTime($end_datetime, $timezone_GMT); + + $offset_now = $timezone_event->getOffset($dt_now); + $offset_start = $timezone_event->getOffset($dt_start); + $offset_end = $timezone_event->getOffset($dt_end); + + if ($offset_now != $offset_start and !function_exists('wp_date')) { + $diff = $offset_start - $offset_now; + if ($diff > 0) $start_timestamp += $diff; + } + + if ($offset_now != $offset_end and !function_exists('wp_date')) { + $diff = $offset_end - $offset_now; + if ($diff > 0) $end_timestamp += $diff; + } + + // Event is All Day so remove the time formats + if ($allday) { + foreach (array('a', 'A', 'B', 'g', 'G', 'h', 'H', 'i', 's', 'u', 'v') as $f) $format = str_replace($f, '', $format); + $format = trim($format, ': '); + } + + $start_timestamp = apply_filters('mec_date_label_start_timestamp', $start_timestamp, $event); + $end_timestamp = apply_filters('mec_date_label_end_timestamp', $end_timestamp, $event); + + if ($start_timestamp >= $end_timestamp) { + $format = stripslashes($format); + + return '' . esc_html($this->date_i18n($format, $start_timestamp, $event)) . ''; + } else { + $start_date = $this->date_i18n($format, $start_timestamp, $event); + $end_date = $this->date_i18n($format, $end_timestamp, $event); + + if ($start_date == $end_date) return '' . esc_html($start_date) . ''; + else { + $start_m = date('m', $start_timestamp); + $end_m = date('m', $end_timestamp); + + $start_y = date('Y', $start_timestamp); + $end_y = date('Y', $end_timestamp); + + // Same Month but Different Days + if ($minify and $start_m == $end_m and $start_y == $end_y and date('d', $start_timestamp) != date('d', $end_timestamp)) { + $month_format = 'F'; + if (strpos($format, 'm') !== false) $month_format = 'm'; + elseif (strpos($format, 'M') !== false) $month_format = 'M'; + elseif (strpos($format, 'n') !== false) $month_format = 'n'; + + $year_format = ''; + if (strpos($format, 'Y') !== false) $year_format = 'Y'; + elseif (strpos($format, 'y') !== false) $year_format = 'y'; + + $start_m = $this->date_i18n($month_format, $start_timestamp, $event); + $start_y = (trim($year_format) ? $this->date_i18n($year_format, $start_timestamp, $event) : ''); + $end_y = (trim($year_format) ? $this->date_i18n($year_format, $end_timestamp, $event) : ''); + + $chars = str_split($format); + + $date_label = ''; + foreach ($chars as $char) { + if (in_array($char, array('d', 'D', 'j', 'l', 'N', 'S', 'w', 'z'))) { + $dot = (strpos($format, $char . '.') !== false); + $date_label .= $this->date_i18n($char, $start_timestamp, $event) . ($dot ? '.' : '') . ' - ' . $this->date_i18n($char, $end_timestamp, $event); + } elseif (in_array($char, array('F', 'm', 'M', 'n'))) { + $date_label .= $start_m; + } elseif (in_array($char, array('Y', 'y', 'o'))) { + $date_label .= ($start_y === $end_y ? $start_y : $start_y . ' - ' . $end_y); + } elseif (in_array($char, array('e', 'I', 'O', 'P', 'p', 'T', 'Z'))) { + $date_label .= $this->date_i18n($char, $start_timestamp, $event); + } else $date_label .= $char; + } + + return '' . esc_html($date_label) . ''; + } else { + $end_format = $format; + if ($omit_end_date && date('Ymd', $start_timestamp) === date('Ymd', $end_timestamp)) { + $end_format = get_option('time_format'); + } + + return apply_filters( + 'mec_date_label_start_end_html', + '' . esc_html($this->date_i18n($format, $start_timestamp, $event)) . '' . esc_html($separator . $this->date_i18n($end_format, $end_timestamp, $event)) . '', + $start_timestamp, + $end_timestamp, + $event + ); + } + } + } + } + + public function dateify($event, $format, $separator = ' - ') + { + // Settings + $settings = $this->get_settings(); + + $time = sprintf("%02d", $event->data->meta['mec_end_time_hour']) . ':'; + $time .= sprintf("%02d", $event->data->meta['mec_end_time_minutes']) . ' '; + $time .= $event->data->meta['mec_end_time_ampm']; + + $start_date = $event->date['start']['date']; + $end_date = $event->date['end']['date']; + + $start_timestamp = strtotime($event->date['start']['date']); + $end_timestamp = strtotime($event->date['end']['date']); + + // Midnight Hour + $midnight_hour = (isset($settings['midnight_hour']) and $settings['midnight_hour']) ? $settings['midnight_hour'] : 0; + $midnight = $end_timestamp + (3600 * $midnight_hour); + + // End Date is before Midnight + if ($start_timestamp < $end_timestamp and $midnight >= strtotime($end_date . ' ' . $time)) $end_date = date('Y-m-d', ($end_timestamp - 86400)); + + return $this->date_label(array('date' => $start_date), array('date' => $end_date), $format, $separator, true, 0, $event); + } + + public function date_i18n($format, $time = NULL, $event = NULL) + { + // Force to numeric + if (!is_numeric($time) && $time) $time = strtotime($time); + + if ($event and function_exists('wp_date')) { + $TZO = ((isset($event->TZO) and $event->TZO and ($event->TZO instanceof DateTimeZone)) ? $event->TZO : $this->get_TZO($event)); + + // Force to UTC + $time = $time - $TZO->getOffset(new DateTime(date('Y-m-d H:i:s', $time))); + + return wp_date($format, $time, $TZO); + } else { + $timezone_GMT = new DateTimeZone("GMT"); + $timezone_site = new DateTimeZone($this->get_timezone()); + + $dt_now = new DateTime("now", $timezone_GMT); + $dt_time = new DateTime(date('Y-m-d', $time), $timezone_GMT); + + $offset_now = $timezone_site->getOffset($dt_now); + $offset_time = $timezone_site->getOffset($dt_time); + + if ($offset_now != $offset_time and !function_exists('wp_date')) { + $diff = $offset_time - $offset_now; + if ($diff > 0) $time += $diff; + } + + return date_i18n($format, $time); + } + } + + /** + * Returns start/end time labels + * @author Webnus + * @param string $start + * @param string $end + * @param array $args + * @return string + */ + public function display_time($start = '', $end = '', $args = array()) + { + if (!trim($start)) return ''; + + $class = isset($args['class']) ? esc_attr($args['class']) : 'mec-time-details'; + $separator = isset($args['separator']) ? esc_attr($args['separator']) : '-'; + $display_svg = isset($args['display_svg']) && $args['display_svg']; + $icon = isset($args['icon']) && trim($args['icon']) ? $args['icon'] : ''; + + $return = '
        ' . ($display_svg ? $icon : ''); + $return .= '' . esc_html($start) . ''; + if (trim($end)) $return .= ' ' . $separator . ' ' . esc_html($end) . ''; + $return .= '
        '; + + return $return; + } + + /** + * Returns end date of an event based on start date + * @author Webnus + * @param string $date + * @param object $event + * @return string + */ + public function get_end_date($date, $event) + { + $start_date = $event->meta['mec_date']['start'] ?? []; + $end_date = $event->meta['mec_date']['end'] ?? []; + + // Event Past + $past = $this->is_past($event->mec->end, $date); + + // Normal event + if (isset($event->mec->repeat) and $event->mec->repeat == '0') { + return $end_date['date'] ?? $date; + } + // Custom Days + elseif ($custom_date_db = $this->get_end_date_from_db($date, $event)) { + return $custom_date_db; + } + // Past Event + elseif ($past) { + return $end_date['date'] ?? $date; + } else { + $event_period = ((isset($start_date['date']) and isset($end_date['date'])) ? $this->date_diff($start_date['date'], $end_date['date']) : false); + $event_period_days = $event_period ? $event_period->days : 0; + + /** + * Multiple Day Event + * Check to see if today is between start day and end day. + * For example start day is 5 and end day is 15, but we're in 9th so only 6 days remained till ending the event not 10 days. + */ + if ($event_period_days) { + $start_day = date('j', strtotime($start_date['date'])); + $day = date('j', strtotime($date)); + + if ($day >= $start_day) $passed_days = $day - $start_day; + else $passed_days = ($day + date('t', strtotime($start_date['date']))) - $start_day; + + if ($passed_days <= $event_period_days) $event_period_days = $event_period_days - $passed_days; + } + + return date('Y-m-d', strtotime('+' . $event_period_days . ' Days', strtotime($date))); + } + } + + public function get_end_date_from_db($date, $event) + { + // Cache + $cache = $this->getCache(); + + return $cache->rememberOnce($event->ID . ':' . $date, function () use ($event, $date) { + // DB + $db = $this->getDB(); + + return $db->select("SELECT `dend` FROM `#__mec_dates` WHERE `post_id`='" . $event->ID . "' AND `dstart`<='" . $date . "' AND `dend`>='" . $date . "' ORDER BY `id` DESC LIMIT 1", 'loadResult'); + }); + } + + /** + * Get Archive Status of MEC + * @author Webnus + * @return int + */ + public function get_archive_status() + { + $settings = $this->get_settings(); + + $status = isset($settings['archive_status']) ? $settings['archive_status'] : '1'; + return apply_filters('mec_archive_status', $status); + } + + /** + * Check to see if a table exists or not + * @author Webnus + * @param string $table + * @return boolean + */ + public function table_exists($table = 'mec_events') + { + // MEC DB library + $db = $this->getDB(); + + return $db->q("SHOW TABLES LIKE '#__$table'"); + } + + /** + * Create MEC Tables + * @author Webnus + * @return boolean + */ + public function create_mec_tables() + { + // MEC Events table already exists + if ($this->table_exists('mec_events') and $this->table_exists('mec_dates') and $this->table_exists('mec_occurrences') and $this->table_exists('mec_users') and $this->table_exists('mec_bookings') and $this->table_exists('mec_booking_attendees')) return true; + + // MEC File library + $file = $this->getFile(); + + // MEC DB library + $db = $this->getDB(); + + // Run Queries + $query_file = MEC_ABSPATH . 'assets' . DS . 'sql' . DS . 'tables.sql'; + if ($file->exists($query_file)) { + $queries = $file->read($query_file); + $sqls = explode(';', $queries); + + foreach ($sqls as $sql) { + $sql = trim($sql, '; '); + if (trim($sql) == '') continue; + + $sql .= ';'; + + try { + $db->q($sql); + } catch (Exception $e) { + } + } + } + + return true; + } + + /** + * Return HTML email type + * @author Webnus + * @param string $content_type + * @return string + */ + public function html_email_type($content_type) + { + return 'text/html'; + } + + public function get_next_upcoming_event() + { + MEC::import('app.skins.list'); + + // Get list skin + $list = new MEC_skin_list(); + + // Attributes + $atts = [ + 'show_only_past_events' => 0, + 'show_past_events' => 0, + 'start_date_type' => 'today', + 'sk-options' => [ + 'list' => ['limit' => 1] + ], + ]; + + // Initialize the skin + $list->initialize($atts); + + // General Settings + $settings = $this->get_settings(); + + // Disable Ongoing Events + $disable_for_ongoing = (isset($settings['countdown_disable_for_ongoing_events']) and $settings['countdown_disable_for_ongoing_events']); + if ($disable_for_ongoing) $list->hide_time_method = 'start'; + + // Fetch the events + $list->fetch(); + + $events = $list->events; + $key = key($events); + + return (isset($events[$key][0]) ? $events[$key][0] : array()); + } + + /** + * Return a web page + * @author Webnus + * @param string $url + * @param int $timeout + * @return string + */ + public function get_web_page($url, $timeout = 20) + { + $result = false; + + // Doing WordPress Remote + if (function_exists('wp_remote_get')) { + $result = wp_remote_retrieve_body(wp_remote_get($url, array( + 'body' => null, + 'timeout' => $timeout, + 'redirection' => 5, + ))); + } + + // Doing FGC + if ($result === false) { + $http = []; + $result = @file_get_contents($url, false, stream_context_create(array('http' => $http))); + } + + return $result; + } + + public function save_events($events = array()) + { + $ids = []; + + foreach ($events as $event) $ids[] = $this->save_event($event, (isset($event['ID']) ? $event['ID'] : NULL)); + return $ids; + } + + public function save_event($event = array(), $post_id = NULL) + { + $post = array( + 'post_title' => $event['title'], + 'post_content' => $event['content'] ?? '', + 'post_type' => $this->get_main_post_type(), + 'post_status' => $event['status'] ?? 'publish' + ); + + // Update previously inserted post + if (!is_null($post_id)) $post['ID'] = $post_id; + + // Post Author + if (isset($event['author']) and $event['author'] and is_numeric($event['author'])) $post['post_author'] = $event['author']; + + $post_id = wp_insert_post($post); + + update_post_meta($post_id, 'mec_location_id', ($event['location_id'] ?? 1)); + update_post_meta($post_id, 'mec_dont_show_map', 0); + update_post_meta($post_id, 'mec_organizer_id', ($event['organizer_id'] ?? 1)); + + $start_time_hour = ($event['start_time_hour'] ?? 8); + $start_time_minutes = ($event['start_time_minutes'] ?? 0); + $start_time_ampm = ($event['start_time_ampm'] ?? 'AM'); + + $end_time_hour = ($event['end_time_hour'] ?? 6); + $end_time_minutes = ($event['end_time_minutes'] ?? 0); + $end_time_ampm = ($event['end_time_ampm'] ?? 'PM'); + + $allday = ($event['allday'] ?? 0); + $time_comment = ($event['time_comment'] ?? ''); + $hide_time = ((isset($event['date']) and isset($event['date']['hide_time'])) ? $event['date']['hide_time'] : 0); + $hide_end_time = ((isset($event['date']) and isset($event['date']['hide_end_time'])) ? $event['date']['hide_end_time'] : 0); + + $day_start_seconds = $this->time_to_seconds($this->to_24hours($start_time_hour, $start_time_ampm), $start_time_minutes); + $day_end_seconds = $this->time_to_seconds($this->to_24hours($end_time_hour, $end_time_ampm), $end_time_minutes); + + update_post_meta($post_id, 'mec_allday', $allday); + update_post_meta($post_id, 'mec_hide_time', $hide_time); + update_post_meta($post_id, 'mec_hide_end_time', $hide_end_time); + + update_post_meta($post_id, 'mec_start_date', $event['start']); + update_post_meta($post_id, 'mec_start_time_hour', $start_time_hour); + update_post_meta($post_id, 'mec_start_time_minutes', $start_time_minutes); + update_post_meta($post_id, 'mec_start_time_ampm', $start_time_ampm); + update_post_meta($post_id, 'mec_start_day_seconds', $day_start_seconds); + + update_post_meta($post_id, 'mec_end_date', $event['end']); + update_post_meta($post_id, 'mec_end_time_hour', $end_time_hour); + update_post_meta($post_id, 'mec_end_time_minutes', $end_time_minutes); + update_post_meta($post_id, 'mec_end_time_ampm', $end_time_ampm); + update_post_meta($post_id, 'mec_end_day_seconds', $day_end_seconds); + + update_post_meta($post_id, 'mec_repeat_status', $event['repeat_status']); + update_post_meta($post_id, 'mec_repeat_type', $event['repeat_type']); + update_post_meta($post_id, 'mec_repeat_interval', $event['interval']); + + update_post_meta($post_id, 'mec_certain_weekdays', explode(',', trim(($event['weekdays'] ?? ''), ', '))); + + $date = array( + 'start' => array('date' => $event['start'], 'hour' => $start_time_hour, 'minutes' => $start_time_minutes, 'ampm' => $start_time_ampm), + 'end' => array('date' => $event['end'], 'hour' => $end_time_hour, 'minutes' => $end_time_minutes, 'ampm' => $end_time_ampm), + 'repeat' => ((isset($event['date']) and isset($event['date']['repeat']) and is_array($event['date']['repeat'])) ? $event['date']['repeat'] : array()), + 'allday' => $allday, + 'hide_time' => ((isset($event['date']) and isset($event['date']['hide_time'])) ? $event['date']['hide_time'] : 0), + 'hide_end_time' => ((isset($event['date']) and isset($event['date']['hide_end_time'])) ? $event['date']['hide_end_time'] : 0), + 'comment' => $time_comment, + ); + + // Finish Date + $finish_date = ($event['finish'] ?? ''); + + // End after count + $repeat_count = ($event['repeat_count'] ?? NULL); + if ($repeat_count and is_numeric($repeat_count)) { + $repeat_count = ($repeat_count - 1); + update_post_meta($post_id, 'mec_repeat_end_at_occurrences', $repeat_count); + update_post_meta($post_id, 'mec_repeat_end', 'occurrences'); + + $date['repeat']['end'] = 'occurrences'; + $date['repeat']['end_at_occurrences'] = $repeat_count; + + $plus_date = ''; + if ($event['repeat_type'] == 'daily') { + $plus_date = '+' . $repeat_count * $event['interval'] . ' Days'; + } elseif ($event['repeat_type'] == 'weekly') { + $plus_date = '+' . $repeat_count * ($event['interval']) . ' Days'; + } elseif ($event['repeat_type'] == 'monthly') { + $plus_date = '+' . $repeat_count * $event['interval'] . ' Months'; + } elseif ($event['repeat_type'] == 'yearly') { + $plus_date = '+' . $repeat_count * $event['interval'] . ' Years'; + } + + if ($plus_date) $finish_date = date('Y-m-d', strtotime($plus_date, strtotime($event['end']))); + } + + if ($finish_date) { + update_post_meta($post_id, 'mec_repeat_end_at_date', $finish_date); + update_post_meta($post_id, 'mec_repeat_end', ($repeat_count ? 'occurrences' : 'date')); + + $date['repeat']['end'] = ($repeat_count ? 'occurrences' : 'date'); + $date['repeat']['end_at_date'] = $finish_date; + } + + update_post_meta($post_id, 'mec_date', $date); + + // Not In Days + $not_in_days = ($event['not_in_days'] ?? ''); + if ($not_in_days) update_post_meta($post_id, 'mec_not_in_days', $not_in_days); + + // Creating $mec array for inserting in mec_events table + $mec = array('post_id' => $post_id, 'start' => $event['start'], 'repeat' => $event['repeat_status'], 'rinterval' => $event['interval'], 'time_start' => $day_start_seconds, 'time_end' => $day_end_seconds); + + // Add parameters to the $mec + $mec['end'] = (trim($finish_date) ? $finish_date : '0000-00-00'); + $mec['year'] = $event['year'] ?? NULL; + $mec['month'] = $event['month'] ?? NULL; + $mec['day'] = $event['day'] ?? NULL; + $mec['week'] = $event['week'] ?? NULL; + $mec['weekday'] = $event['weekday'] ?? NULL; + $mec['weekdays'] = $event['weekdays'] ?? NULL; + $mec['days'] = $event['days'] ?? ''; + $mec['not_in_days'] = $not_in_days; + + // MEC DB Library + $db = $this->getDB(); + + // Update MEC Events Table + $mec_event_id = $db->select("SELECT `id` FROM `#__mec_events` WHERE `post_id`='$post_id'", 'loadResult'); + + if (!$mec_event_id) { + $q1 = ""; + $q2 = ""; + + foreach ($mec as $key => $value) { + $q1 .= "`$key`,"; + + if (is_null($value)) $q2 .= "NULL,"; + else $q2 .= "'$value',"; + } + + $db->q("INSERT INTO `#__mec_events` (" . trim($q1, ', ') . ") VALUES (" . trim($q2, ', ') . ")", 'INSERT'); + } else { + $q = ""; + + foreach ($mec as $key => $value) { + if (is_null($value)) $q .= "`$key`=NULL,"; + else $q .= "`$key`='$value',"; + } + + $db->q("UPDATE `#__mec_events` SET " . trim($q, ', ') . " WHERE `id`='$mec_event_id'"); + } + + if (isset($event['meta']) and is_array($event['meta'])) foreach ($event['meta'] as $key => $value) update_post_meta($post_id, $key, $value); + + // Update Schedule + $schedule = $this->getSchedule(); + $schedule->reschedule($post_id, $schedule->get_reschedule_maximum($event['repeat_type'])); + + return $post_id; + } + + public function save_category($category = array()) + { + $name = $category['name'] ?? ''; + if (!trim($name)) return false; + + $term = get_term_by('name', $name, 'mec_category'); + + // Term already exists + if (is_object($term) and isset($term->term_id)) return $term->term_id; + + $term = wp_insert_term($name, 'mec_category'); + + // An error occurred + if (is_wp_error($term)) return false; + + $category_id = $term['term_id']; + if (!$category_id) return false; + + return $category_id; + } + + public function save_tag($tag = array()) + { + $name = $tag['name'] ?? ''; + if (!trim($name)) return false; + + $term = get_term_by('name', $name, apply_filters('mec_taxonomy_tag', '')); + + // Term already exists + if (is_object($term) and isset($term->term_id)) return $term->term_id; + + $term = wp_insert_term($name, apply_filters('mec_taxonomy_tag', '')); + + // An error occurred + if (is_wp_error($term)) return false; + + $tag_id = $term['term_id']; + if (!$tag_id) return false; + + return $tag_id; + } + + public function save_label($label = array()) + { + $name = $label['name'] ?? ''; + if (!trim($name)) return false; + + $term = get_term_by('name', $name, 'mec_label'); + + // Term already exists + if (is_object($term) and isset($term->term_id)) return $term->term_id; + + $term = wp_insert_term($name, 'mec_label'); + + // An error occurred + if (is_wp_error($term)) return false; + + $label_id = $term['term_id']; + if (!$label_id) return false; + + $color = $label['color'] ?? ''; + update_term_meta($label_id, 'color', $color); + + return $label_id; + } + + public function save_organizer($organizer = array()) + { + $name = $organizer['name'] ?? ''; + if (!trim($name)) return false; + + $term = get_term_by('name', $name, 'mec_organizer'); + + // Term already exists + if (is_object($term) and isset($term->term_id)) return $term->term_id; + + $term = wp_insert_term($name, 'mec_organizer'); + + // An error occurred + if (is_wp_error($term)) return false; + + $organizer_id = $term['term_id']; + if (!$organizer_id) return false; + + if (isset($organizer['tel']) && strpos($organizer['tel'], '@') !== false) { + // Just for EventON + $tel = ''; + $email = trim($organizer['tel']) ? $organizer['tel'] : ''; + } else { + $tel = (isset($organizer['tel']) and trim($organizer['tel'])) ? $organizer['tel'] : ''; + $email = (isset($organizer['email']) and trim($organizer['email'])) ? $organizer['email'] : ''; + } + + $url = (isset($organizer['url']) and trim($organizer['url'])) ? $organizer['url'] : ''; + $thumbnail = $organizer['thumbnail'] ?? ''; + + update_term_meta($organizer_id, 'tel', $tel); + update_term_meta($organizer_id, 'email', $email); + update_term_meta($organizer_id, 'url', $url); + if (trim($thumbnail)) update_term_meta($organizer_id, 'thumbnail', $thumbnail); + + return $organizer_id; + } + + public function save_location($location = array()) + { + $name = $location['name'] ?? ''; + if (!trim($name)) return false; + + $term = get_term_by('name', $name, 'mec_location'); + + // Term already exists + if (is_object($term) and isset($term->term_id)) return $term->term_id; + + $term = wp_insert_term($name, 'mec_location'); + + // An error occurred + if (is_wp_error($term)) return false; + + $location_id = $term['term_id']; + if (!$location_id) return false; + + $latitude = (isset($location['latitude']) and trim($location['latitude'])) ? $location['latitude'] : 0; + $longitude = (isset($location['longitude']) and trim($location['longitude'])) ? $location['longitude'] : 0; + $address = $location['address'] ?? ''; + $thumbnail = $location['thumbnail'] ?? ''; + $url = $location['url'] ?? ''; + + if (!trim($latitude) or !trim($longitude)) { + $geo_point = $this->get_lat_lng($address); + + $latitude = $geo_point[0]; + $longitude = $geo_point[1]; + } + + update_term_meta($location_id, 'address', $address); + update_term_meta($location_id, 'latitude', $latitude); + update_term_meta($location_id, 'longitude', $longitude); + update_term_meta($location_id, 'url', $url); + + if (trim($thumbnail)) update_term_meta($location_id, 'thumbnail', $thumbnail); + return $location_id; + } + + public function save_speaker($speaker = array()) + { + $name = $speaker['name'] ?? ''; + if (!trim($name)) return false; + + $term = get_term_by('name', $name, 'mec_speaker'); + + // Term already exists + if (is_object($term) and isset($term->term_id)) return $term->term_id; + + $term = wp_insert_term($name, 'mec_speaker'); + + // An error occurred + if (is_wp_error($term)) return false; + + $speaker_id = $term['term_id']; + if (!$speaker_id) return false; + + $job_title = (isset($speaker['job_title']) and trim($speaker['job_title'])) ? $speaker['job_title'] : ''; + $tel = (isset($speaker['tel']) and trim($speaker['tel'])) ? $speaker['tel'] : ''; + $email = (isset($speaker['email']) and trim($speaker['email'])) ? $speaker['email'] : ''; + $facebook = (isset($speaker['facebook']) and trim($speaker['facebook'])) ? esc_url($speaker['facebook']) : ''; + $twitter = (isset($speaker['twitter']) and trim($speaker['twitter'])) ? esc_url($speaker['twitter']) : ''; + $instagram = (isset($speaker['instagram']) and trim($speaker['instagram'])) ? esc_url($speaker['instagram']) : ''; + $linkedin = (isset($speaker['linkedin']) and trim($speaker['linkedin'])) ? esc_url($speaker['linkedin']) : ''; + $website = (isset($speaker['website']) and trim($speaker['website'])) ? esc_url($speaker['website']) : ''; + $thumbnail = $speaker['thumbnail'] ?? ''; + + update_term_meta($speaker_id, 'job_title', $job_title); + update_term_meta($speaker_id, 'tel', $tel); + update_term_meta($speaker_id, 'email', $email); + update_term_meta($speaker_id, 'facebook', $facebook); + update_term_meta($speaker_id, 'twitter', $twitter); + update_term_meta($speaker_id, 'instagram', $instagram); + update_term_meta($speaker_id, 'linkedin', $linkedin); + update_term_meta($speaker_id, 'website', $website); + if (trim($thumbnail)) update_term_meta($speaker_id, 'thumbnail', $thumbnail); + + return $speaker_id; + } + + public function save_sponsor($sponsor = array()) + { + $name = $sponsor['name'] ?? ''; + if (!trim($name)) return false; + + $term = get_term_by('name', $name, 'mec_sponsor'); + + // Term already exists + if (is_object($term) and isset($term->term_id)) return $term->term_id; + + $term = wp_insert_term($name, 'mec_sponsor'); + + // An error occurred + if (is_wp_error($term)) return false; + + $sponsor_id = $term['term_id']; + if (!$sponsor_id) return false; + + $link = (isset($sponsor['link']) and trim($sponsor['link'])) ? esc_url($sponsor['link']) : ''; + $logo = (isset($sponsor['logo']) and trim($sponsor['logo'])) ? esc_url($sponsor['logo']) : ''; + + update_term_meta($sponsor_id, 'link', $link); + if (trim($logo)) update_term_meta($sponsor_id, 'logo', $logo); + + return $sponsor_id; + } + + /** + * Returns data export array for one event + * @author Webnus + * @param int $event_id + * @return stdClass + */ + public function export_single($event_id) + { + // MEC Render Library + $render = $this->getRender(); + + return $render->data($event_id); + } + + /** + * Converts array to XML string + * @author Webnus + * @param array $data + * @return string + */ + public function xml_convert($data) + { + $main_node = array_keys($data); + + // Creating SimpleXMLElement object + $xml = new SimpleXMLElement('<' . $main_node[0] . '>'); + + // Convert array to xml + $this->array_to_xml($data[$main_node[0]], $xml); + + // Return XML String + return $xml->asXML(); + } + + public function array_to_xml($data, &$xml) + { + foreach ($data as $key => $value) { + if (is_numeric($key)) $key = 'item'; + + if (is_array($value)) { + $subnode = $xml->addChild($key); + $this->array_to_xml($value, $subnode); + } elseif (is_object($value)) { + $subnode = $xml->addChild($key); + $this->array_to_xml($value, $subnode); + } else { + $xml->addChild($key, ($value ? htmlspecialchars($value) : $value)); + } + } + } + + /** + * Returns Weekdays Day Numbers + * @author Webnus + * @return array + */ + public function get_weekdays() + { + $weekdays = array(1, 2, 3, 4, 5); + + // Get weekdays from options + $settings = $this->get_settings(); + if (isset($settings['weekdays']) and is_array($settings['weekdays']) and count($settings['weekdays'])) $weekdays = $settings['weekdays']; + + return apply_filters('mec_weekday_numbers', $weekdays); + } + + /** + * Returns Weekends Day Numbers + * @author Webnus + * @return array + */ + public function get_weekends() + { + $weekends = array(6, 7); + + // Get weekdays from options + $settings = $this->get_settings(); + if (isset($settings['weekends']) and is_array($settings['weekends']) and count($settings['weekends'])) $weekends = $settings['weekends']; + + return apply_filters('mec_weekend_numbers', $weekends); + } + + /** + * Returns Event link with Occurrence Date + * @author Webnus + * @param string|object $event + * @param string $date + * @param boolean $force + * @param array $time + * @return string + */ + public function get_event_date_permalink($event, $date = NULL, $force = false, $time = NULL) + { + // Get MEC Options + $settings = $this->get_settings(); + + if (is_object($event)) { + // Event Permalink + $url = $event->data->permalink; + + // Return same URL if date is not provided + if (is_null($date)) return apply_filters('mec_event_permalink', $url); + + // Single Page Date method is set to next date + if (!$force and (!isset($settings['single_date_method']) or (isset($settings['single_date_method']) and $settings['single_date_method'] == 'next'))) return apply_filters('mec_event_permalink', $url); + + if (is_array($time) and isset($time['start_timestamp'])) $time_str = date('H:i:s', $time['start_timestamp']); + elseif (is_array($time) and isset($time['start_raw'])) $time_str = $time['start_raw']; + elseif (isset($event->data->time) and is_array($event->data->time) and isset($event->data->time['start_timestamp'])) $time_str = date('H:i:s', $event->data->time['start_timestamp']); + elseif (isset($event->data->time) and is_array($event->data->time) and isset($event->data->time['start_raw'])) $time_str = date('H:i:s', strtotime($event->data->time['start_raw'])); + else $time_str = $event->data->time['start_raw']; + + // Timestamp + $timestamp = strtotime($date . ' ' . $time_str); + + // Do not add occurrence when custom link is set + $read_more = (isset($event->data->meta) and isset($event->data->meta['mec_read_more']) and filter_var($event->data->meta['mec_read_more'], FILTER_VALIDATE_URL)) ? $event->data->meta['mec_read_more'] : NULL; + $read_more_occ_url = MEC_feature_occurrences::param($event->ID, $timestamp, 'read_more', $read_more); + + if ($read_more_occ_url and filter_var($read_more_occ_url, FILTER_VALIDATE_URL)) $url = $read_more_occ_url; + if ($read_more_occ_url) return apply_filters('mec_event_permalink', $url); + + // Add Date to the URL + $url = $this->add_qs_var('occurrence', $date, $url); + + $repeat_type = (isset($event->data->meta['mec_repeat_type']) ? $event->data->meta['mec_repeat_type'] : ''); + if ($repeat_type == 'custom_days' and isset($event->data->time) and isset($event->data->time['start_raw'])) { + // Add Time + $url = $this->add_qs_var('time', $timestamp, $url); + } + + return apply_filters('mec_event_permalink', $url); + } else { + // Event Permalink + $url = $event; + + // Return same URL if data is not provided + if (is_null($date)) return apply_filters('mec_event_permalink', $url); + + // Single Page Date method is set to next date + if (!$force and (!isset($settings['single_date_method']) or (isset($settings['single_date_method']) and $settings['single_date_method'] == 'next'))) return apply_filters('mec_event_permalink', $url); + + return apply_filters('mec_event_permalink', $this->add_qs_var('occurrence', $date, $url)); + } + } + + /** + * Register MEC Activity Action Type in BuddeyPress + * @return void + */ + public function bp_register_activity_actions() + { + bp_activity_set_action( + 'mec', + 'booked_event', + esc_html__('Booked an event.', 'modern-events-calendar-lite') + ); + } + + /** + * Add a new activity to BuddyPress when a user book an event + * @param int $book_id + * @return boolean|int + */ + public function bp_add_activity($book_id) + { + // Get MEC Options + $settings = $this->get_settings(); + + // BuddyPress' integration is disabled + if (!isset($settings['bp_status']) || !$settings['bp_status']) return false; + + // BuddyPress add activity is disabled + if (!isset($settings['bp_add_activity']) || !$settings['bp_add_activity']) return false; + + // BuddyPress is not installed or activated + if (!function_exists('bp_activity_add')) return false; + + $verification = get_post_meta($book_id, 'mec_verified', true); + $confirmation = get_post_meta($book_id, 'mec_confirmed', true); + + // Booking is not verified or confirmed + if ($verification != 1 or $confirmation != 1) return false; + + $event_id = get_post_meta($book_id, 'mec_event_id', true); + $booker_id = get_post_field('post_author', $book_id); + + $event_title = get_the_title($event_id); + $event_link = get_the_permalink($event_id); + + $profile_link = bp_core_get_userlink($booker_id); + $bp_activity_id = get_post_meta($book_id, 'mec_bp_activity_id', true); + + $activity_id = bp_activity_add(array( + 'id' => $bp_activity_id, + 'action' => sprintf(esc_html__('%s booked %s event.', 'modern-events-calendar-lite'), $profile_link, '' . esc_html($event_title) . ''), + 'component' => 'mec', + 'type' => 'booked_event', + 'primary_link' => $event_link, + 'user_id' => $booker_id, + 'item_id' => $book_id, + 'secondary_item_id' => $event_id, + )); + + // Set Activity ID + update_post_meta($book_id, 'mec_bp_activity_id', $activity_id); + + return $activity_id; + } + + public function bp_add_profile_menu() + { + // Get MEC Options + $settings = $this->get_settings(); + + // BuddyPress' integration is disabled + if (!isset($settings['bp_status']) or !$settings['bp_status']) return false; + + // BuddyPress' events menus is disabled + if (!isset($settings['bp_profile_menu']) or !$settings['bp_profile_menu']) return false; + + // User is not logged in + if (!is_user_logged_in()) return false; + + global $bp; + + // Loggedin User is not Displayed User + if (!isset($bp->displayed_user) or (isset($bp->displayed_user->id) and get_current_user_id() != $bp->displayed_user->id)) return false; + + bp_core_new_nav_item(array( + 'name' => esc_html__('Events', 'modern-events-calendar-lite'), + 'slug' => 'mec-events', + 'screen_function' => array($this, 'bp_profile_menu_screen'), + 'position' => 30, + 'parent_url' => bp_loggedin_user_domain() . '/mec-events/', + 'parent_slug' => $bp->profile->slug, + 'default_subnav_slug' => 'events' + )); + + return true; + } + + public function bp_profile_menu_screen() + { + add_action('bp_template_title', array($this, 'bp_profile_menu_title')); + add_action('bp_template_content', array($this, 'bp_profile_menu_content')); + + bp_core_load_template(array('buddypress/members/single/plugins')); + } + + public function bp_profile_menu_title() + { + echo esc_html__('Events', 'modern-events-calendar-lite'); + } + + public function bp_profile_menu_content() + { + echo do_shortcode('[MEC_fes_list relative-link="1"]'); + } + + /** + * Add booker information to mailchimp list + * @param int $book_id + * @return boolean + */ + public function mailchimp_add_subscriber($book_id) + { + // Get MEC Options + $settings = $this->get_settings(); + $ml_settings = $this->get_ml_settings(); + + // Mailchim integration is disabled + if (!isset($settings['mchimp_status']) or (isset($settings['mchimp_status']) and !$settings['mchimp_status'])) return false; + + $api_key = $settings['mchimp_api_key'] ?? ''; + $list_id = $settings['mchimp_list_id'] ?? ''; + + // Mailchim credentials are required + if (!trim($api_key) or !trim($list_id)) return false; + + // Options + $date_format = (isset($ml_settings['booking_date_format1']) and trim($ml_settings['booking_date_format1'])) ? $ml_settings['booking_date_format1'] : 'Y-m-d'; + $segment_status = (isset($settings['mchimp_segment_status']) and $settings['mchimp_segment_status']); + + // Booking Date + $mec_date = get_post_meta($book_id, 'mec_date', true); + $dates = (trim($mec_date) ? explode(':', $mec_date) : array()); + $booking_date = date($date_format, $dates[0]); + + // Event Title + $event_id = get_post_meta($book_id, 'mec_event_id', true); + $event = get_post($event_id); + + $book = $this->getBook(); + $attendees = $book->get_attendees($book_id); + + $data_center = substr($api_key, strpos($api_key, '-') + 1); + $subscription_status = isset($settings['mchimp_subscription_status']) ? $settings['mchimp_subscription_status'] : 'subscribed'; + + $member_response = NULL; + $did = []; + + foreach ($attendees as $attendee) { + // Name + $name = ((isset($attendee['name']) and trim($attendee['name'])) ? $attendee['name'] : ''); + + // Email + $email = ((isset($attendee['email']) and trim($attendee['email'])) ? $attendee['email'] : ''); + if (!is_email($email)) continue; + + // No Duplicate + if (in_array($email, $did)) continue; + $did[] = $email; + + $names = explode(' ', $name); + + $first_name = $names[0]; + unset($names[0]); + + $last_name = implode(' ', $names); + + // UPSERT + $member_response = wp_remote_request('https://' . $data_center . '.api.mailchimp.com/3.0/lists/' . $list_id . '/members/' . md5(strtolower($email)), array( + 'method' => 'PUT', + 'body' => json_encode(array( + 'email_address' => $email, + 'status' => $subscription_status, + 'merge_fields' => array( + 'FNAME' => $first_name, + 'LNAME' => $last_name + ), + 'tags' => array($booking_date, $event->post_title) + )), + 'timeout' => '10', + 'redirection' => '10', + 'headers' => array('Content-Type' => 'application/json', 'Authorization' => 'Basic ' . base64_encode('user:' . $api_key)), + )); + + // TAGS + wp_remote_post('https://' . $data_center . '.api.mailchimp.com/3.0/lists/' . $list_id . '/members/' . md5(strtolower($email)) . '/tags', array( + 'body' => json_encode(array( + 'tags' => array( + array('name' => $booking_date, 'status' => 'active'), + array('name' => $event->post_title, 'status' => 'active') + ) + )), + 'timeout' => '10', + 'redirection' => '10', + 'headers' => array('Content-Type' => 'application/json', 'Authorization' => 'Basic ' . base64_encode('user:' . $api_key)), + )); + } + + // Handle Segment + if ($segment_status) { + wp_remote_post('https://' . $data_center . '.api.mailchimp.com/3.0/lists/' . $list_id . '/segments/', array( + 'body' => json_encode(array( + 'name' => sprintf('%s at %s', $event->post_title, $booking_date), + 'options' => array( + 'match' => 'any', + 'conditions' => array() + ) + )), + 'timeout' => '10', + 'redirection' => '10', + 'headers' => array('Content-Type' => 'application/json', 'Authorization' => 'Basic ' . base64_encode('user:' . $api_key)), + )); + } + + return ($member_response ? wp_remote_retrieve_response_code($member_response) : false); + } + + /** + * Add booker information to campaign monitor list + * @param int $book_id + * @return boolean + */ + public function campaign_monitor_add_subscriber($book_id) + { + // Skip on Lite + if (!$this->getPRO()) return false; + + require_once MEC_ABSPATH . '/app/api/Campaign_Monitor/csrest_subscribers.php'; + + // Get MEC Options + $settings = $this->get_settings(); + + // Campaign Monitor integration is disabled + if (!isset($settings['campm_status']) or (isset($settings['campm_status']) and !$settings['campm_status'])) return false; + + $api_key = $settings['campm_api_key'] ?? ''; + $list_id = $settings['campm_list_id'] ?? ''; + + // Campaign Monitor credentials are required + if (!trim($api_key) or !trim($list_id)) return false; + + // MEC User + $u = $this->getUser(); + $booker = $u->booking($book_id); + + $wrap = new CS_REST_Subscribers($list_id, $api_key); + $wrap->add(array( + 'EmailAddress' => $booker->user_email, + 'Name' => $booker->first_name . ' ' . $booker->last_name, + 'ConsentToTrack' => 'yes', + 'Resubscribe' => true + )); + } + + /** + * Add booker information to mailerlite list + * @param int $book_id + * @return boolean}int + */ + public function mailerlite_add_subscriber($book_id) + { + // Get MEC Options + $settings = $this->get_settings(); + + // mailerlite integration is disabled + if (!isset($settings['mailerlite_status']) or (isset($settings['mailerlite_status']) and !$settings['mailerlite_status'])) return false; + + $api_key = $settings['mailerlite_api_key'] ?? ''; + $list_id = $settings['mailerlite_list_id'] ?? ''; + + // mailerlite credentials are required + if (!trim($api_key) or !trim($list_id)) return false; + + // MEC User + $u = $this->getUser(); + $booker = $u->booking($book_id); + + $url = 'https://api.mailerlite.com/api/v2/groups/' . $list_id . '/subscribers'; + + $json = json_encode(array( + 'email' => $booker->user_email, + 'name' => $booker->first_name . ' ' . $booker->last_name, + )); + + // Execute the Request and Return the Response Code + return wp_remote_retrieve_response_code(wp_remote_post($url, array( + 'body' => $json, + 'timeout' => '10', + 'redirection' => '10', + 'headers' => array('Content-Type' => 'application/json', 'X-MailerLite-ApiKey' => $api_key), + ))); + } + + /** + * Add booker information to Active Campaign list + * @param int $book_id + * @return boolean + */ + public function active_campaign_add_subscriber($book_id) + { + // Get MEC Options + $settings = $this->get_settings(); + + // Mailchim integration is disabled + if (!isset($settings['active_campaign_status']) or (isset($settings['active_campaign_status']) and !$settings['active_campaign_status'])) return false; + + $api_url = $settings['active_campaign_api_url'] ?? ''; + $api_key = $settings['active_campaign_api_key'] ?? ''; + $list_id = $settings['active_campaign_list_id'] ?? ''; + + // Mailchim credentials are required + if (!trim($api_url) or !trim($api_key)) return false; + + // MEC User + $u = $this->getUser(); + $booker = $u->booking($book_id); + + $url = $api_url . '/api/3/contact/sync'; + + $array_parameters = array( + 'email' => $booker->user_email, + 'firstName' => $booker->first_name, + 'lastName' => $booker->last_name, + ); + $array_parameters = apply_filters('mec_active_campaign_parameters', $array_parameters, $booker, $book_id); + $json = json_encode(array( + 'contact' => $array_parameters, + )); + + // Execute the Request and Return the Response Code + $request = wp_remote_post($url, array( + 'body' => $json, + 'timeout' => '10', + 'redirection' => '10', + 'headers' => array('Content-Type' => 'application/json', 'Api-Token' => $api_key), + )); + + if (is_wp_error($request) || wp_remote_retrieve_response_code($request) != 200) { + error_log(print_r($request, true)); + } + $response = wp_remote_retrieve_body($request); + + // Subscribe to list + if (trim($list_id)) { + $person = json_decode($response); + $new_url = $api_url . '/api/3/contactLists'; + $new_json = json_encode(array( + 'contactList' => array( + 'list' => (int)$list_id, + 'contact' => (int)$person->contact->id, + 'status' => 1, + ), + )); + $new_request = wp_remote_post($new_url, array( + 'body' => $new_json, + 'timeout' => '10', + 'redirection' => '10', + 'headers' => array('Content-Type' => 'application/json', 'Api-Token' => $api_key), + )); + + if (is_wp_error($new_request) || wp_remote_retrieve_response_code($new_request) != 200) { + error_log(print_r($new_request, true)); + } + + $new_response = wp_remote_retrieve_body($new_request); + } + } + + /** + * Add booker information to Aweber list + * @param int $book_id + * @return boolean + */ + public function aweber_add_subscriber($book_id) + { + // Aweber Plugin is not installed or it's not activated + if (!class_exists('AWeberWebFormPluginNamespace\AWeberWebformPlugin')) return false; + + // Get MEC Options + $settings = $this->get_settings(); + + // AWeber's integration is disabled + if (!isset($settings['aweber_status']) || !$settings['aweber_status']) return false; + + $list_id = isset($settings['aweber_list_id']) ? preg_replace("/[^0-9]/", "", $settings['aweber_list_id']) : ''; + + // AWeber's credentials are required + if (!trim($list_id)) return false; + + $aweber = new \AWeberWebFormPluginNamespace\AWeberWebformPlugin(); + + // MEC User + $u = $this->getUser(); + $booker = $u->booking($book_id); + $name = trim($booker->first_name . ' ' . $booker->last_name); + + return $aweber->create_subscriber($booker->user_email, NULL, $list_id, $name, 'a,b'); + } + + /** + * Add booker information to Mailpoet list + * @param int $book_id + * @return boolean|array + */ + public function mailpoet_add_subscriber($book_id) + { + // Mailpoet Plugin is not installed or it's not activated + if (!class_exists(\MailPoet\API\API::class)) return false; + + // Get MEC Options + $settings = $this->get_settings(); + + // MailPoet integration is disabled + if (!isset($settings['mailpoet_status']) or (isset($settings['mailpoet_status']) and !$settings['mailpoet_status'])) return false; + + // MailPoet API + $mailpoet_api = \MailPoet\API\API::MP('v1'); + + // List ID + $list_ids = (isset($settings['mailpoet_list_id']) and trim($settings['mailpoet_list_id'])) ? array($settings['mailpoet_list_id']) : NULL; + + // MEC User + $u = $this->getUser(); + $booker = $u->booking($book_id); + + try { + return $mailpoet_api->addSubscriber(array( + 'email' => $booker->user_email, + 'first_name' => $booker->first_name, + 'last_name' => $booker->last_name, + ), $list_ids); + } catch (Exception $e) { + if ($e->getCode() == 12 and $list_ids) { + try { + $subscriber = $mailpoet_api->getSubscriber($booker->user_email); + return $mailpoet_api->subscribeToLists($subscriber['id'], $list_ids); + } catch (Exception $e) { + return false; + } + } + + return false; + } + } + + /** + * Add booker information to Sendfox list + * @param int $book_id + * @return boolean|array + */ + public function sendfox_add_subscriber($book_id) + { + // Sendfox Plugin is not installed or it's not activated + if (!function_exists('gb_sf4wp_add_contact')) return false; + + // Get MEC Options + $settings = $this->get_settings(); + + // Sendfox integration is disabled + if (!isset($settings['sendfox_status']) || !$settings['sendfox_status']) return false; + + // List ID + $list_id = ((isset($settings['sendfox_list_id']) and trim($settings['sendfox_list_id'])) ? (int) $settings['sendfox_list_id'] : NULL); + + // MEC User + $u = $this->getUser(); + $booker = $u->booking($book_id); + + return gb_sf4wp_add_contact(array( + 'email' => $booker->user_email, + 'first_name' => $booker->first_name, + 'last_name' => $booker->last_name, + 'lists' => array($list_id) + )); + } + + /** + * Add booker information to constantcontact list + * @param int $book_id + * @return boolean|int + */ + public function constantcontact_add_subscriber($book_id) + { + + // Get MEC Options + $settings = $this->get_settings(); + + // constantcontact integration is disabled + if (!isset($settings['constantcontact_status']) || !$settings['constantcontact_status']) return false; + + $api_key = $settings['constantcontact_api_key'] ?? ''; + $access_token = $settings['constantcontact_access_token'] ?? ''; + $list_id = $settings['constantcontact_list_id'] ?? ''; + + // constantcontact credentials are required + if (!trim($api_key) or !trim($access_token) or !trim($list_id)) return false; + + // MEC User + $u = $this->getUser(); + $booker = $u->booking($book_id); + + $url = 'https://api.constantcontact.com/v2/contacts?action_by=ACTION_BY_OWNER&api_key=' . $api_key; + + $json = json_encode(array( + 'lists' => array(json_encode(array('list' => $list_id))), + 'email_addresses' => array(json_encode(array('email_address' => $booker->user_email))), + 'first_name' => $booker->first_name, + 'last_name' => $booker->last_name, + )); + + // Execute the Request and Return the Response Code + return wp_remote_retrieve_response_code(wp_remote_post($url, array( + 'body' => $json, + 'timeout' => '10', + 'redirection' => '10', + 'headers' => array('Content-Type' => 'application/json', 'Authorization' => 'Bearer ' . $access_token), + ))); + } + + /** + * Returns Booking of a certain event at certain date + * @param int $event_id + * @param integer $timestamp + * @param integer|string $limit + * @param integer $user_id + * @param boolean $verified + * @return array + */ + public function get_bookings($event_id, $timestamp = NULL, $limit = '-1', $user_id = NULL, $verified = true) + { + if ($timestamp) { + $booking_options = get_post_meta($event_id, 'mec_booking', true); + if (!is_array($booking_options)) $booking_options = []; + + $book_all_occurrences = isset($booking_options['bookings_all_occurrences']) ? (int) $booking_options['bookings_all_occurrences'] : 0; + + if (!$book_all_occurrences) $date_query = " AND `timestamp`=" . $timestamp; + else $date_query = " AND `timestamp`<=" . $timestamp; + } else $date_query = ""; + + if ($user_id) $user_query = " AND `user_id`=" . $user_id; + else $user_query = ""; + + if (is_numeric($limit) and $limit > 0) $limit_query = " LIMIT " . $limit; + else $limit_query = ""; + + if ($verified) $status_query = " AND `status` IN ('publish', 'future') AND `confirmed`='1' AND `verified`='1'"; + else $status_query = ""; + + // Database + $db = $this->getDB(); + + $records = $db->select("SELECT `id`,`booking_id`,`timestamp` FROM `#__mec_bookings` WHERE `event_id`=" . $event_id . $status_query . $date_query . $user_query . $limit_query); + + $results = []; + foreach ($records as $record) { + $post = get_post($record->booking_id); + $post->mec_timestamp = $record->timestamp; + $post->mec_booking_record_id = $record->id; + + $results[] = $post; + } + + return $results; + } + + public function get_bookings_for_occurrence($timestamps, $args = array()) + { + $limit = (isset($args['limit']) and is_numeric($args['limit'])) ? $args['limit'] : -1; + $status = (isset($args['status']) and is_array($args['status'])) ? $args['status'] : []; + $confirmed = (isset($args['confirmed']) and is_numeric($args['confirmed'])) ? $args['confirmed'] : null; + $verified = (isset($args['verified']) and is_numeric($args['verified'])) ? $args['verified'] : null; + $event_id = (isset($args['event_id']) and is_numeric($args['event_id'])) ? $args['event_id'] : null; + + $start = $timestamps[0]; + $end = $timestamps[1] ?? NULL; + + // Database + $db = $this->getDB(); + + // Query + $query = "SELECT `id`,`booking_id`,`timestamp` FROM `#__mec_bookings` WHERE 1"; + + // Confirmation + if (!is_null($confirmed)) { + $query .= " AND `confirmed`='" . esc_sql($confirmed) . "'"; + } + + // Verification + if (!is_null($verified)) { + $query .= " AND `verified`='" . esc_sql($verified) . "'"; + } + + // Status + if (count($status)) { + $status_str = ''; + foreach ($status as $s) $status_str .= "'" . $s . "', "; + + $query .= " AND `status` IN (" . trim($status_str, ', ') . ")"; + } + + // Event ID + if ($event_id) { + $query .= " AND `event_id`=" . esc_sql($event_id); + } + + // Times + if ($start and $end) { + $query .= " AND `timestamp`>='" . esc_sql($start) . "' AND `timestamp`<'" . esc_sql($end) . "'"; + } else $query .= " AND `timestamp`='" . esc_sql($start) . "'"; + + // Order + $query .= " ORDER BY `id` ASC"; + + // Limit + if ($limit > 0) $query .= " LIMIT " . $limit; + + $records = $db->select($query); + + $results = []; + foreach ($records as $record) { + $post = get_post($record->booking_id); + $post->mec_timestamp = $record->timestamp; + + $results[] = $post; + } + + return $results; + } + + public function get_bookings_by_event_occurrence($event_id, $occurrence) + { + return $this->get_bookings_for_occurrence([ + $occurrence, + ], [ + 'event_id' => $event_id, + 'limit' => -1 + ]); + } + + public function get_total_attendees_by_event_occurrence($event_id, $occurrence) + { + $bookings = $this->get_bookings_by_event_occurrence($event_id, $occurrence); + + $total = 0; + if (count($bookings)) { + // Booking Library + $book = $this->getBook(); + + // Determine Total Attendees + foreach ($bookings as $booking) $total += $book->get_total_attendees($booking->ID); + } + + return $total; + } + + /** + * Check whether to show event note or not + * @param string $status + * @return boolean + */ + public function is_note_visible($status) + { + // MEC Settings + $settings = $this->get_settings(); + + // FES Note is not enabled + if (!isset($settings['fes_note']) || !$settings['fes_note']) return false; + + // Return visibility status by post status and visibility method + return (isset($settings['fes_note_visibility']) ? ($settings['fes_note_visibility'] == 'always' ? true : $status != 'publish') : true); + } + + /** + * Get Next event based on datetime of current event + * @param array $atts + * @return object + */ + public function get_next_event($atts = array()) + { + MEC::import('app.skins.list'); + + // Get list skin + $list = new MEC_skin_list(); + + // Initialize the skin + $list->initialize($atts); + + // Fetch the events + $list->fetch(); + + $events = $list->events; + $key = key($events); + + return $events[$key][0] ?? (new stdClass()); + } + + /** + * For getting event end date based on occurrence date + * @param int $event_id + * @param string $occurrence + * @return string + */ + public function get_end_date_by_occurrence($event_id, $occurrence) + { + $event_date = get_post_meta($event_id, 'mec_date', true); + + $start_date = $event_date['start'] ?? []; + $end_date = $event_date['end'] ?? []; + + $event_period = $this->date_diff($start_date['date'], $end_date['date']); + $event_period_days = $event_period ? $event_period->days : 0; + + // Single Day Event + if (!$event_period_days) return $occurrence; + + return date('Y-m-d', strtotime('+' . $event_period_days . ' days', strtotime($occurrence))); + } + + /** + * Add MEC Event CPT to Tags Archive Page + * @param object $query + */ + public function add_events_to_tags_archive($query) + { + if ($query->is_tag() and $query->is_main_query() and !is_admin()) { + $pt = $this->get_main_post_type(); + $query->set('post_type', array('post', $pt)); + } + } + + /** + * Get Post ID by meta value and meta key + * @param string $meta_key + * @param string $meta_value + * @return string + */ + public function get_post_id_by_meta($meta_key, $meta_value) + { + $db = $this->getDB(); + return $db->select("SELECT `post_id` FROM `#__postmeta` WHERE `meta_value`='$meta_value' AND `meta_key`='$meta_key'", 'loadResult'); + } + + /** + * Set Featured Image for a Post + * @param string $image_url + * @param int $post_id + * @param array $allowed_extensions + * @return bool|int + */ + public function set_featured_image($image_url, $post_id, $allowed_extensions = []) + { + $attach_id = $this->get_attach_id($image_url); + if (!$attach_id) { + $upload_dir = wp_upload_dir(); + $filename = basename($image_url); + + $ex = explode('.', $filename); + $extension = end($ex); + + // Invalid Extension + if (count($allowed_extensions) && !in_array($extension, $allowed_extensions)) return false; + + $validate = wp_check_filetype($filename); + if ($validate['type'] === false) return false; + + if (wp_mkdir_p($upload_dir['path'])) $file = $upload_dir['path'] . '/' . $filename; + else $file = $upload_dir['basedir'] . '/' . $filename; + + if (!file_exists($file)) { + $image_data = $this->get_web_page($image_url); + file_put_contents($file, $image_data); + } + + $wp_filetype = wp_check_filetype($filename, null); + $attachment = array( + 'post_mime_type' => $wp_filetype['type'], + 'post_title' => sanitize_file_name($filename), + 'post_content' => '', + 'post_status' => 'inherit' + ); + + $attach_id = wp_insert_attachment($attachment, $file, $post_id); + require_once ABSPATH . 'wp-admin/includes/image.php'; + + $attach_data = wp_generate_attachment_metadata($attach_id, $file); + wp_update_attachment_metadata($attach_id, $attach_data); + } + + return set_post_thumbnail($post_id, $attach_id); + } + + /** + * Get Attachment ID by Image URL + * @param string $image_url + * @return int + */ + public function get_attach_id($image_url) + { + $db = $this->getDB(); + return $db->select("SELECT `ID` FROM `#__posts` WHERE `guid`='$image_url'", 'loadResult'); + } + + /** + * Get Image Type by Buffer. Used in Facebook Importer + * @param string $buffer + * @return string + */ + public function get_image_type_by_buffer($buffer) + { + $types = array('jpeg' => "\xFF\xD8\xFF", 'gif' => 'GIF', 'png' => "\x89\x50\x4e\x47\x0d\x0a", 'bmp' => 'BM', 'psd' => '8BPS', 'swf' => 'FWS'); + $found = 'other'; + + foreach ($types as $type => $header) { + if (strpos($buffer, $header) === 0) { + $found = $type; + break; + } + } + + return $found; + } + + /** + * Load Google Maps assets + * @var boolean $force + * @var $define_settings + * @return bool + */ + public function load_map_assets($force = false, $define_settings = null) + { + if (!$this->getPRO()) return false; + + // MEC Settings + $settings = $this->get_settings(); + + $assets = array('js' => array(), 'css' => array()); + + $local = $this->get_current_language(); + $ex = explode('_', $local); + + $language = ((isset($ex[0]) and trim($ex[0])) ? $ex[0] : 'en'); + $region = ((isset($ex[1]) and trim($ex[1])) ? $ex[1] : 'US'); + + $gm_include = apply_filters('mec_gm_include', true); + if ($gm_include or $force) $assets['js']['googlemap'] = '//maps.googleapis.com/maps/api/js?libraries=places' . ((isset($settings['google_maps_api_key']) and trim($settings['google_maps_api_key']) != '') ? '&key=' . $settings['google_maps_api_key'] : '') . '&language=' . $language . '®ion=' . $region; + + $assets['js']['mec-richmarker-script'] = $this->asset('packages/richmarker/richmarker.min.js'); // Google Maps Rich Marker + $assets['js']['mec-clustering-script'] = $this->asset('packages/clusterer/markerclusterer.min.js'); // Google Maps Clustering + $assets['js']['mec-googlemap-script'] = $this->asset('js/googlemap.js'); // Google Maps Javascript API + + // Apply Filters + $assets = apply_filters('mec_map_assets_include', $assets, $this, $define_settings); + + if (isset($assets['js']) && is_array($assets['js']) && count($assets['js']) > 0) foreach ($assets['js'] as $key => $link) wp_enqueue_script($key, $link, array('jquery'), $this->get_version()); + if (isset($assets['css']) && is_array($assets['css']) && count($assets['css']) > 0) foreach ($assets['css'] as $key => $link) wp_enqueue_style($key, $link, array(), $this->get_version()); + } + + /** + * Load Owl Carousel assets + */ + public function load_owl_assets() + { + // Include MEC frontend CSS files + wp_enqueue_style('mec-owl-carousel-style'); + wp_enqueue_style('mec-owl-carousel-theme-style', $this->asset('packages/owl-carousel/owl.theme.min.css')); + } + + /** + * Load Isotope assets + */ + public function load_isotope_assets() + { + // Isotope JS file + wp_enqueue_script('mec-isotope-script', $this->asset('js/isotope.pkgd.min.js'), array(), $this->get_version(), true); + wp_enqueue_script('mec-imagesload-script', $this->asset('js/imagesload.js'), array(), $this->get_version(), true); + } + + /** + * Load Time Picker assets + */ + public function load_time_picker_assets() + { + // Include CSS + wp_enqueue_style('mec-time-picker', $this->asset('packages/timepicker/jquery.timepicker.min.css')); + + // Include JS + wp_enqueue_script('mec-time-picker', $this->asset('packages/timepicker/jquery.timepicker.min.js')); + } + + /** + * Load Month Picker assets + */ + public function load_month_picker_assets() + { + // IncludeS files + wp_enqueue_style('mec-month-picker-style', $this->asset('packages/month-picker/MonthPicker.css')); + + $dates = []; + $d = array( + 'days' => ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"], + 'months' => ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], + ); + + foreach ($d as $type => $values) { + foreach ($values as $k => $value) { + + switch ($type) { + case 'days': + $day_min = date_i18n('D', strtotime($value)); + + $dates['days'][$k] = date_i18n('l', strtotime($value)); + $dates['daysShort'][$k] = $day_min; + $dates['daysMin'][$k] = $day_min; + break; + case 'months': + $dates['months'][$k] = date_i18n('F', strtotime($value)); + $dates['monthsShort'][$k] = date_i18n('M', strtotime($value)); + break; + } + } + } + + $data = array( + 'dates' => $dates, + ); + echo ''; + wp_enqueue_script('mec-month-picker-js', $this->asset('packages/month-picker/MonthPicker.js')); + } + + function get_client_ip() + { + if (isset($_SERVER['HTTP_CLIENT_IP'])) $ipaddress = sanitize_text_field($_SERVER['HTTP_CLIENT_IP']); + elseif (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) $ipaddress = sanitize_text_field($_SERVER['HTTP_X_FORWARDED_FOR']); + elseif (isset($_SERVER['HTTP_X_FORWARDED'])) $ipaddress = sanitize_text_field($_SERVER['HTTP_X_FORWARDED']); + elseif (isset($_SERVER['HTTP_FORWARDED_FOR'])) $ipaddress = sanitize_text_field($_SERVER['HTTP_FORWARDED_FOR']); + elseif (isset($_SERVER['HTTP_FORWARDED'])) $ipaddress = sanitize_text_field($_SERVER['HTTP_FORWARDED']); + elseif (isset($_SERVER['REMOTE_ADDR'])) $ipaddress = sanitize_text_field($_SERVER['REMOTE_ADDR']); + else $ipaddress = 'UNKNOWN'; + + $ips = explode(',', $ipaddress); + if (count($ips) > 1) $ipaddress = $ips[0]; + + return $ipaddress; + } + + public function get_timezone_by_ip() + { + // Client IP + $ip = $this->get_client_ip(); + + $cache_key = 'mec_visitor_timezone_' . $ip; + $cache = $this->getCache(); + + // Get From Cache + if ($cache->has($cache_key)) return $cache->get($cache_key); + + // First Provider + $JSON = $this->get_web_page('http://ip-api.com/json/' . $ip, 3); + $data = json_decode($JSON, true); + + // Second Provider + if (!trim($JSON) or (is_array($data) and !isset($data['timezone']))) { + $JSON = $this->get_web_page('https://ipapi.co/' . $ip . '/json/', 3); + $data = json_decode($JSON, true); + } + + // Second provider returns X instead of false in case of error! + $timezone = (isset($data['timezone']) and strtolower($data['timezone']) != 'x') ? $data['timezone'] : false; + + // Add to Cache + $cache->set($cache_key, $timezone); + + return $timezone; + } + + public function is_ajax() + { + return (defined('DOING_AJAX') && DOING_AJAX); + } + + public function load_sed_assets($settings = array()) + { + if (!is_array($settings) || !count($settings)) $settings = $this->get_settings(); + + // Load Map assets + if (isset($settings['google_maps_status']) and $settings['google_maps_status']) $this->load_map_assets(); + + // Include FlipCount library + wp_enqueue_script('mec-flipcount-script'); + } + + public function is_sold($event, $date = '') + { + if (is_object($event)) { + $event_id = $event->data->ID; + $tickets = (isset($event->data->tickets) and is_array($event->data->tickets)) ? $event->data->tickets : []; + + $timestamp = (trim($date) ? $date : ((isset($event->date['start']) and isset($event->date['start']['timestamp'])) ? $event->date['start']['timestamp'] : 0)); + } else { + $event_id = $event; + $tickets = get_post_meta($event_id, 'mec_tickets', true); + if (!is_array($tickets)) $tickets = []; + + $timestamp = is_numeric($date) ? $date : (int) strtotime($date); + } + + // No Tickets + if (!count($tickets) or !$timestamp) return false; + + // MEC Cache + $cache = $this->getCache(); + + return $cache->rememberOnce($event_id . ':' . $timestamp, function () use ($event_id, $timestamp) { + $book = $this->getBook(); + $availability = $book->get_tickets_availability($event_id, $timestamp); + + $sold = false; + if (is_array($availability) and count($availability)) { + $remained_tickets = 0; + foreach ($availability as $ticket_id => $remained) { + if (is_numeric($ticket_id) and $remained >= 0) $remained_tickets += $remained; + if (is_numeric($ticket_id) and $remained == -1) { + $remained_tickets = -1; + break; + } + } + + // Soldout + if ($remained_tickets === 0) $sold = true; + } + + return $sold; + }); + } + + public function get_date_periods($date_start, $date_end, $type = 'daily') + { + $periods = []; + + $time_start = strtotime($date_start); + $time_end = strtotime($date_end); + + if ($type == 'daily') { + while ($time_start < $time_end) { + $periods[] = array('start' => date("Y-m-d H:i:s", $time_start), 'end' => date("Y-m-d H:i:s", ($time_start + 86399)), 'label' => date("Y-m-d", $time_start)); + $time_start += 86400; + } + } elseif ($type == 'weekly') { + } elseif ($type == 'monthly') { + $start_year = date('Y', $time_start); + $start_month = date('m', $time_start); + $start_id = (int) $start_year . $start_month; + + $end_year = date('Y', $time_end); + $end_month = date('m', $time_end); + $end_id = (int) $end_year . $end_month; + + while ($start_id <= $end_id) { + $periods[] = array('start' => $start_year . "-" . $start_month . "-01 00:00:00", 'end' => $start_year . "-" . $start_month . "-" . date('t', strtotime($start_year . "-" . $start_month . "-01 00:00:00")) . " 23:59:59", 'label' => date('Y F', strtotime($start_year . "-" . $start_month . "-01 00:00:00"))); + + if ($start_month == '12') { + $start_month = '01'; + $start_year++; + } else { + $start_month = (int) $start_month + 1; + if (strlen($start_month) == 1) $start_month = '0' . $start_month; + } + + $start_id = (int) $start_year . $start_month; + } + } elseif ($type == 'yearly') { + $start_year = date('Y', $time_start); + $end_year = date('Y', $time_end); + + while ($start_year <= $end_year) { + $periods[] = array('start' => $start_year . "-01-01 00:00:00", 'end' => $start_year . "-12-31 23:59:59", 'label' => $start_year); + $start_year++; + } + } + + return $periods; + } + + public function get_messages() + { + if ($this->getPRO()) { + $messages = array( + 'taxonomies' => array( + 'category' => array('name' => __('Taxonomies', 'modern-events-calendar-lite')), + 'messages' => array( + 'taxonomy_categories' => array('label' => __('Category Plural Label', 'modern-events-calendar-lite'), 'default' => __('Categories', 'modern-events-calendar-lite')), + 'taxonomy_category' => array('label' => __('Category Singular Label', 'modern-events-calendar-lite'), 'default' => __('Category', 'modern-events-calendar-lite')), + 'taxonomy_labels' => array('label' => __('Label Plural Label', 'modern-events-calendar-lite'), 'default' => __('Labels', 'modern-events-calendar-lite')), + 'taxonomy_label' => array('label' => __('Label Singular Label', 'modern-events-calendar-lite'), 'default' => __('label', 'modern-events-calendar-lite')), + 'taxonomy_locations' => array('label' => __('Location Plural Label', 'modern-events-calendar-lite'), 'default' => __('Locations', 'modern-events-calendar-lite')), + 'taxonomy_location' => array('label' => __('Location Singular Label', 'modern-events-calendar-lite'), 'default' => __('Location', 'modern-events-calendar-lite')), + 'taxonomy_organizers' => array('label' => __('Organizer Plural Label', 'modern-events-calendar-lite'), 'default' => __('Organizers', 'modern-events-calendar-lite')), + 'taxonomy_organizer' => array('label' => __('Organizer Singular Label', 'modern-events-calendar-lite'), 'default' => __('Organizer', 'modern-events-calendar-lite')), + 'taxonomy_speakers' => array('label' => __('Speaker Plural Label', 'modern-events-calendar-lite'), 'default' => __('Speakers', 'modern-events-calendar-lite')), + 'taxonomy_speaker' => array('label' => __('Speaker Singular Label', 'modern-events-calendar-lite'), 'default' => __('Speaker', 'modern-events-calendar-lite')), + 'taxonomy_sponsors' => array('label' => __('Sponsor Plural Label', 'modern-events-calendar-lite'), 'default' => __('Sponsors', 'modern-events-calendar-lite')), + 'taxonomy_sponsor' => array('label' => __('Sponsor Singular Label', 'modern-events-calendar-lite'), 'default' => __('Sponsor', 'modern-events-calendar-lite')), + ) + ), + 'weekdays' => array( + 'category' => array('name' => __('Weekdays', 'modern-events-calendar-lite')), + 'messages' => array( + 'weekdays_su' => array('label' => __('Sunday abbreviation', 'modern-events-calendar-lite'), 'default' => __('SU', 'modern-events-calendar-lite')), + 'weekdays_mo' => array('label' => __('Monday abbreviation', 'modern-events-calendar-lite'), 'default' => __('MO', 'modern-events-calendar-lite')), + 'weekdays_tu' => array('label' => __('Tuesday abbreviation', 'modern-events-calendar-lite'), 'default' => __('TU', 'modern-events-calendar-lite')), + 'weekdays_we' => array('label' => __('Wednesday abbreviation', 'modern-events-calendar-lite'), 'default' => __('WE', 'modern-events-calendar-lite')), + 'weekdays_th' => array('label' => __('Thursday abbreviation', 'modern-events-calendar-lite'), 'default' => __('TH', 'modern-events-calendar-lite')), + 'weekdays_fr' => array('label' => __('Friday abbreviation', 'modern-events-calendar-lite'), 'default' => __('FR', 'modern-events-calendar-lite')), + 'weekdays_sa' => array('label' => __('Saturday abbreviation', 'modern-events-calendar-lite'), 'default' => __('SA', 'modern-events-calendar-lite')), + ) + ), + 'booking' => array( + 'category' => array('name' => __('Booking', 'modern-events-calendar-lite')), + 'messages' => array( + 'booking' => array('label' => __('Booking (Singular)', 'modern-events-calendar-lite'), 'default' => __('Booking', 'modern-events-calendar-lite')), + 'bookings' => array('label' => __('Bookings (Plural)', 'modern-events-calendar-lite'), 'default' => __('Bookings', 'modern-events-calendar-lite')), + 'book_success_message' => array('label' => __('Booking Success Message', 'modern-events-calendar-lite'), 'default' => __('Thank you for booking. Your tickets are booked, booking verification might be needed, please check your email.', 'modern-events-calendar-lite')), + 'booking_restriction_message1' => array('label' => __('Booking Restriction Message 1', 'modern-events-calendar-lite'), 'default' => __('You selected %s tickets to book but maximum number of tikets per user is %s tickets.', 'modern-events-calendar-lite')), + 'booking_restriction_message2' => array('label' => __('Booking Restriction Message 2', 'modern-events-calendar-lite'), 'default' => __('You have already booked %s tickets and the maximum number of tickets per user is %s.', 'modern-events-calendar-lite')), + 'booking_restriction_message3' => array('label' => __('Booking IP Restriction Message', 'modern-events-calendar-lite'), 'default' => __('Maximum allowed number of tickets that you can book is %s.', 'modern-events-calendar-lite')), + 'booking_button' => array('label' => __('Booking Button', 'modern-events-calendar-lite'), 'default' => __('Book Now', 'modern-events-calendar-lite')), + 'ticket' => array('label' => __('Ticket (Singular)', 'modern-events-calendar-lite'), 'default' => __('Ticket', 'modern-events-calendar-lite')), + 'tickets' => array('label' => __('Tickets (Plural)', 'modern-events-calendar-lite'), 'default' => __('Tickets', 'modern-events-calendar-lite')), + ) + ), + 'others' => array( + 'category' => array('name' => __('Others', 'modern-events-calendar-lite')), + 'messages' => array( + 'register_button' => array('label' => __('Register Button', 'modern-events-calendar-lite'), 'default' => __('REGISTER', 'modern-events-calendar-lite')), + 'view_detail' => array('label' => __('View Detail Button', 'modern-events-calendar-lite'), 'default' => __('View Detail', 'modern-events-calendar-lite')), + 'event_detail' => array('label' => __('Event Detail Button', 'modern-events-calendar-lite'), 'default' => __('Event Detail', 'modern-events-calendar-lite')), + 'read_more_link' => array('label' => __('Event Link', 'modern-events-calendar-lite'), 'default' => __('Event Link', 'modern-events-calendar-lite')), + 'more_info_link' => array('label' => __('More Info Link', 'modern-events-calendar-lite'), 'default' => __('More Info', 'modern-events-calendar-lite')), + 'event_cost' => array('label' => __('Event Cost', 'modern-events-calendar-lite'), 'default' => __('Event Cost', 'modern-events-calendar-lite')), + 'cost' => array('label' => __('Cost', 'modern-events-calendar-lite'), 'default' => __('Cost', 'modern-events-calendar-lite')), + 'other_organizers' => array('label' => __('Other Organizers', 'modern-events-calendar-lite'), 'default' => __('Other Organizers', 'modern-events-calendar-lite')), + 'other_locations' => array('label' => __('Other Locations', 'modern-events-calendar-lite'), 'default' => __('Other Locations', 'modern-events-calendar-lite')), + 'all_day' => array('label' => __('All Day', 'modern-events-calendar-lite'), 'default' => __('All Day', 'modern-events-calendar-lite')), + 'expired' => array('label' => __('Expired', 'modern-events-calendar-lite'), 'default' => __('Expired', 'modern-events-calendar-lite')), + 'ongoing' => array('label' => __('Ongoing', 'modern-events-calendar-lite'), 'default' => __('Ongoing', 'modern-events-calendar-lite')), + ) + ), + ); + } else { + $messages = array( + 'taxonomies' => array( + 'category' => array('name' => __('Taxonomies', 'modern-events-calendar-lite')), + 'messages' => array( + 'taxonomy_categories' => array('label' => __('Category Plural Label', 'modern-events-calendar-lite'), 'default' => __('Categories', 'modern-events-calendar-lite')), + 'taxonomy_category' => array('label' => __('Category Singular Label', 'modern-events-calendar-lite'), 'default' => __('Category', 'modern-events-calendar-lite')), + 'taxonomy_labels' => array('label' => __('Label Plural Label', 'modern-events-calendar-lite'), 'default' => __('Labels', 'modern-events-calendar-lite')), + 'taxonomy_label' => array('label' => __('Label Singular Label', 'modern-events-calendar-lite'), 'default' => __('label', 'modern-events-calendar-lite')), + 'taxonomy_locations' => array('label' => __('Location Plural Label', 'modern-events-calendar-lite'), 'default' => __('Locations', 'modern-events-calendar-lite')), + 'taxonomy_location' => array('label' => __('Location Singular Label', 'modern-events-calendar-lite'), 'default' => __('Location', 'modern-events-calendar-lite')), + 'taxonomy_organizers' => array('label' => __('Organizer Plural Label', 'modern-events-calendar-lite'), 'default' => __('Organizers', 'modern-events-calendar-lite')), + 'taxonomy_organizer' => array('label' => __('Organizer Singular Label', 'modern-events-calendar-lite'), 'default' => __('Organizer', 'modern-events-calendar-lite')), + 'taxonomy_speakers' => array('label' => __('Speaker Plural Label', 'modern-events-calendar-lite'), 'default' => __('Speakers', 'modern-events-calendar-lite')), + 'taxonomy_speaker' => array('label' => __('Speaker Singular Label', 'modern-events-calendar-lite'), 'default' => __('Speaker', 'modern-events-calendar-lite')), + ) + ), + 'weekdays' => array( + 'category' => array('name' => __('Weekdays', 'modern-events-calendar-lite')), + 'messages' => array( + 'weekdays_su' => array('label' => __('Sunday abbreviation', 'modern-events-calendar-lite'), 'default' => __('SU', 'modern-events-calendar-lite')), + 'weekdays_mo' => array('label' => __('Monday abbreviation', 'modern-events-calendar-lite'), 'default' => __('MO', 'modern-events-calendar-lite')), + 'weekdays_tu' => array('label' => __('Tuesday abbreviation', 'modern-events-calendar-lite'), 'default' => __('TU', 'modern-events-calendar-lite')), + 'weekdays_we' => array('label' => __('Wednesday abbreviation', 'modern-events-calendar-lite'), 'default' => __('WE', 'modern-events-calendar-lite')), + 'weekdays_th' => array('label' => __('Thursday abbreviation', 'modern-events-calendar-lite'), 'default' => __('TH', 'modern-events-calendar-lite')), + 'weekdays_fr' => array('label' => __('Friday abbreviation', 'modern-events-calendar-lite'), 'default' => __('FR', 'modern-events-calendar-lite')), + 'weekdays_sa' => array('label' => __('Saturday abbreviation', 'modern-events-calendar-lite'), 'default' => __('SA', 'modern-events-calendar-lite')), + ) + ), + 'others' => array( + 'category' => array('name' => __('Others', 'modern-events-calendar-lite')), + 'messages' => array( + 'register_button' => array('label' => __('Register Button', 'modern-events-calendar-lite'), 'default' => __('REGISTER', 'modern-events-calendar-lite')), + 'view_detail' => array('label' => __('View Detail Button', 'modern-events-calendar-lite'), 'default' => __('View Detail', 'modern-events-calendar-lite')), + 'event_detail' => array('label' => __('Event Detail Button', 'modern-events-calendar-lite'), 'default' => __('Event Detail', 'modern-events-calendar-lite')), + 'read_more_link' => array('label' => __('Event Link', 'modern-events-calendar-lite'), 'default' => __('Event Link', 'modern-events-calendar-lite')), + 'more_info_link' => array('label' => __('More Info Link', 'modern-events-calendar-lite'), 'default' => __('More Info', 'modern-events-calendar-lite')), + 'event_cost' => array('label' => __('Event Cost', 'modern-events-calendar-lite'), 'default' => __('Event Cost', 'modern-events-calendar-lite')), + 'cost' => array('label' => __('Cost', 'modern-events-calendar-lite'), 'default' => __('Cost', 'modern-events-calendar-lite')), + 'other_organizers' => array('label' => __('Other Organizers', 'modern-events-calendar-lite'), 'default' => __('Other Organizers', 'modern-events-calendar-lite')), + 'other_locations' => array('label' => __('Other Locations', 'modern-events-calendar-lite'), 'default' => __('Other Locations', 'modern-events-calendar-lite')), + 'all_day' => array('label' => __('All Day', 'modern-events-calendar-lite'), 'default' => __('All Day', 'modern-events-calendar-lite')), + 'expired' => array('label' => __('Expired', 'modern-events-calendar-lite'), 'default' => __('Expired', 'modern-events-calendar-lite')), + 'ongoing' => array('label' => __('Ongoing', 'modern-events-calendar-lite'), 'default' => __('Ongoing', 'modern-events-calendar-lite')), + ) + ), + ); + } + + return apply_filters('mec_messages', $messages); + } + + /** + * For showing dynamic messages based on their default value and the inserted value in backend (if any) + * @param $message_key string + * @param $default string + * @return string + */ + public function m($message_key, $default) + { + $message_values = $this->get_messages_options(); + + // Message is not set from backend + if (!isset($message_values[$message_key]) or (!trim($message_values[$message_key]))) return $default; + + // Return the dynamic message inserted in backend + return stripslashes($message_values[$message_key]); + } + + /** + * Get Weather from the data provider + * @param $apikey + * @param $lat + * @param $lng + * @param $datetime + * @return bool|array + */ + public function get_weather_darksky($apikey, $lat, $lng, $datetime) + { + $locale = substr(get_locale(), 0, 2); + + // Set the language to English if it's not included in available languages + if (!in_array($locale, array( + 'ar', + 'az', + 'be', + 'bg', + 'bs', + 'ca', + 'cs', + 'da', + 'de', + 'el', + 'en', + 'es', + 'et', + 'fi', + 'fr', + 'hr', + 'hu', + 'id', + 'is', + 'it', + 'ja', + 'ka', + 'ko', + 'kw', + 'nb', + 'nl', + 'no', + 'pl', + 'pt', + 'ro', + 'ru', + 'sk', + 'sl', + 'sr', + 'sv', + 'tet', + 'tr', + 'uk', + 'x-pig-latin', + 'zh', + 'zh-tw' + ))) $locale = 'en'; + + // Dark Sky Provider + $JSON = $this->get_web_page('https://api.darksky.net/forecast/' . $apikey . '/' . $lat . ',' . $lng . ',' . strtotime($datetime) . '?exclude=minutely,hourly,daily,alerts&units=ca&lang=' . $locale); + $data = json_decode($JSON, true); + + return $data['currently'] ?? false; + } + + /** + * Get Weather from the data provider + * @param $apikey + * @param $lat + * @param $lng + * @param $datetime + * @return bool|array + */ + public function get_weather_visualcrossing($apikey, $lat, $lng, $datetime) + { + $locale = substr(get_locale(), 0, 2); + + // Set the language to English if it's not included in available languages + if (!in_array($locale, array( + 'de', + 'en', + 'es', + 'fi', + 'fr', + 'it', + 'ja', + 'ko', + 'pt', + 'ru', + 'zn' + ))) $locale = 'en'; + + // Visual Crossing Provider + $JSON = $this->get_web_page('https://weather.visualcrossing.com/VisualCrossingWebServices/rest/services/timeline/' . $lat . ',' . $lng . '/' . date('Y-m-d\TH:i:s', strtotime($datetime)) . '?key=' . $apikey . '&include=current&unitGroup=metric&lang=' . $locale); + $data = json_decode($JSON, true); + + return $data['currentConditions'] ?? false; + } + + /** + * Get Weather from the data provider + * @param $apikey + * @param $lat + * @param $lng + * @param $datetime + * @return bool|array + */ + public function get_weather_wa($apikey, $lat, $lng, $datetime) + { + $locale = substr(get_locale(), 0, 2); + + // Set the language to English if it's not included in available languages + if (!in_array($locale, array( + 'ar', + 'bn', + 'bg', + 'zh', + 'zh_tw', + 'cs', + 'da', + 'nl', + 'fi', + 'fr', + 'de', + 'el', + 'hi', + 'hu', + 'it', + 'ja', + 'jv', + 'ko', + 'zh_cmn', + 'mr', + 'pl', + 'pt', + 'pa', + 'ro', + 'ru', + 'si', + 'si', + 'sk', + 'es', + 'sv', + 'ta', + 'te', + 'tr', + 'uk', + 'ur', + 'vi', + 'zh_wuu', + 'zh_hsn', + 'zh_yue', + 'zu' + ))) $locale = 'en'; + + // Dark Sky Provider + $JSON = $this->get_web_page('https://api.weatherapi.com/v1/current.json?key=' . $apikey . '&q=' . $lat . ',' . $lng . '&lang=' . $locale); + $data = json_decode($JSON, true); + + return $data['current'] ?? false; + } + + /** + * Convert weather unit + * @author Webnus + * @param $value + * @param $mode + * @return false|float + */ + function weather_unit_convert($value, $mode) + { + if (func_num_args() < 2) return false; + $mode = strtoupper($mode); + + if ($mode == 'F_TO_C') return round(((floatval($value) - 32) * 5 / 9)); + else if ($mode == 'C_TO_F') return round(((1.8 * floatval($value)) + 32)); + else if ($mode == 'M_TO_KM') return round(1.609344 * floatval($value)); + else if ($mode == 'KM_TO_M') return round(0.6214 * floatval($value)); + return false; + } + + /** + * Get Integrated plugins to import events + * @return array + */ + public function get_integrated_plugins_for_import() + { + return array( + 'eventon' => esc_html__('EventON', 'modern-events-calendar-lite'), + 'the-events-calendar' => esc_html__('The Events Calendar', 'modern-events-calendar-lite'), + 'weekly-class' => esc_html__('Events Schedule WP Plugin', 'modern-events-calendar-lite'), + 'calendarize-it' => esc_html__('Calendarize It', 'modern-events-calendar-lite'), + 'event-espresso' => esc_html__('Event Espresso', 'modern-events-calendar-lite'), + 'events-manager-recurring' => esc_html__('Events Manager (Recurring)', 'modern-events-calendar-lite'), + 'events-manager-single' => esc_html__('Events Manager (Single)', 'modern-events-calendar-lite'), + 'wp-event-manager' => esc_html__('WP Event Manager', 'modern-events-calendar-lite'), + ); + } + + public function get_original_event($event_id) + { + // If WPML Plugin is installed and activated + if (class_exists('SitePress')) { + $trid = apply_filters('wpml_element_trid', NULL, $event_id, 'post_mec-events'); + $translations = apply_filters('wpml_get_element_translations', NULL, $trid, 'post_mec-events'); + + if (!is_array($translations) or !count($translations)) return $event_id; + + $original_id = $event_id; + foreach ($translations as $translation) { + if (isset($translation->original) and $translation->original) { + $original_id = $translation->element_id; + break; + } + } + + return $original_id; + } + // Poly Lang is installed and activated + elseif (function_exists('pll_default_language')) { + $def = pll_default_language(); + + $translations = pll_get_post_translations($event_id); + if (!is_array($translations) or !count($translations)) return $event_id; + + if (isset($translations[$def]) and is_numeric($translations[$def])) return $translations[$def]; + } + + return $event_id; + } + + public function is_multilingual() + { + $multilingual = false; + + // WPML + if (class_exists('SitePress')) $multilingual = true; + + // Polylang + if (function_exists('pll_default_language')) $multilingual = true; + + return $multilingual; + } + + public function get_current_locale() + { + return get_locale(); + } + + public function get_current_lang_code() + { + // WPML + if (class_exists('SitePress')) return $this->get_current_locale(); + // Polylang, etc. + else { + $ex = explode('_', $this->get_current_locale()); + return $ex[0]; + } + } + + public function get_backend_active_locale() + { + // WPML + if (class_exists('SitePress')) { + $languages = apply_filters('wpml_active_languages', array()); + if (is_array($languages) and count($languages)) { + foreach ($languages as $language) { + if (isset($language['active']) and $language['active']) return $language['default_locale']; + } + } + } + + // Polylang + if (function_exists('pll_default_language')) { + global $polylang; + return $polylang->pref_lang->locale; + } + + return $this->get_current_locale(); + } + + public function get_post_locale($post_id) + { + // WPML + if (class_exists('SitePress')) { + $lang = apply_filters('wpml_post_language_details', null, $post_id); + return $lang['locale'] ?? ''; + } + + // Polylang + if (function_exists('pll_get_post_language')) { + return pll_get_post_language( $post_id, 'locale' ); + } + + return ''; + } + + /** + * To check is a date is valid or not + * @param string $date + * @param string $format + * @return bool + */ + public function validate_date($date, $format = 'Y-m-d') + { + $d = DateTime::createFromFormat($format, $date); + return $d && $d->format($format) == $date; + } + + public function parse_ics($feed) + { + try { + return new ICal($feed, array( + 'defaultSpan' => 2, // Default value + 'defaultTimeZone' => 'UTC', + 'defaultWeekStart' => 'MO', // Default value + 'disableCharacterReplacement' => false, // Default value + 'skipRecurrence' => true, // Default value + 'useTimeZoneWithRRules' => false, // Default value + )); + } catch (\Exception $e) { + return $e->getMessage(); + } + } + + public function get_pro_link() + { + $link = 'https://webnus.net/mec-purchase/?ref=17/'; + return apply_filters('MEC_upgrade_link', $link); + } + + /** + * Get Label for booking confirmation + * @author Webnus + * @param int $confirmed + * @return string + */ + public function get_confirmation_label($confirmed = 1) + { + if ($confirmed == '1') $label = esc_html__('Confirmed', 'modern-events-calendar-lite'); + elseif ($confirmed == '-1') $label = esc_html__('Rejected', 'modern-events-calendar-lite'); + else $label = esc_html__('Pending', 'modern-events-calendar-lite'); + + return $label; + } + + /** + * Get Label for events status + * @author Webnus + * @param string $label + * @param boolean $return_class + * @return string|array + */ + public function get_event_label_status($label = 'empty', $return_class = true) + { + if (!trim($label)) $label = 'empty'; + switch ($label) { + case 'publish': + $label = esc_html__('Confirmed', 'modern-events-calendar-lite'); + $status_class = 'mec-book-confirmed'; + break; + case 'pending': + $label = esc_html__('Pending', 'modern-events-calendar-lite'); + $status_class = 'mec-book-pending'; + break; + case 'trash': + $label = esc_html__('Rejected', 'modern-events-calendar-lite'); + $status_class = 'mec-book-pending'; + break; + default: + $label = esc_html__(ucwords($label), 'modern-events-calendar-lite'); + $status_class = 'mec-book-other'; + break; + } + + return !$return_class ? $label : array('label' => $label, 'status_class' => $status_class); + } + + /** + * Get Label for booking verification + * @author Webnus + * @param int $verified + * @return string + */ + public function get_verification_label($verified = 1) + { + if ($verified == '1') $label = esc_html__('Verified', 'modern-events-calendar-lite'); + elseif ($verified == '-1') $label = esc_html__('Canceled', 'modern-events-calendar-lite'); + else $label = esc_html__('Waiting', 'modern-events-calendar-lite'); + + return $label; + } + + /** + * Added Block Editor Custome Category + * @author Webnus + * @param array $categories + * @return array + */ + public function add_custom_block_cateogry($categories) + { + $categories = array_merge(array(array('slug' => 'mec.block.category', 'title' => esc_html__('M.E. Calender', 'modern-events-calendar-lite'), 'icon' => 'calendar-alt')), $categories); + return $categories; + } + + /** + * Advanced Repeating MEC Active + * @author Webnus + * @param array $days + * @param string $item + */ + public function mec_active($days = array(), $item = '') + { + if (is_array($days) and in_array($item, $days)) echo 'mec-active'; + } + + /** + * Advanced repeat sorting by start of week day number + * @author Webnus + * @param int $start_of_week + * @param $day + * @return string|boolean + */ + public function advanced_repeating_sort_day($start_of_week = 1, $day = 1) + { + if (func_num_args() < 2) return false; + + $start_of_week = intval($start_of_week); + $day = intval($day) == 0 ? intval($day) : intval($day) - 1; + + // KEEP IT FOR TRANSLATORS + array(__('Sun', 'modern-events-calendar-lite'), esc_html__('Mon', 'modern-events-calendar-lite'), esc_html__('Tue', 'modern-events-calendar-lite'), esc_html__('Wed', 'modern-events-calendar-lite'), esc_html__('Thu', 'modern-events-calendar-lite'), esc_html__('Fri', 'modern-events-calendar-lite'), esc_html__('Sat', 'modern-events-calendar-lite')); + + // DO NOT MAKE THEM TRANSLATE-ABLE + $days = array('Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'); + + $s1 = array_splice($days, $start_of_week, count($days)); + $s2 = array_splice($days, 0, $start_of_week); + $merge = array_merge($s1, $s2); + + return $merge[$day]; + } + + public function get_ical_rrules($event, $only_rrule = false) + { + if (is_numeric($event)) { + $render = $this->getRender(); + $event = $render->data($event); + } + + $recurrence = []; + if (isset($event->mec->repeat) and $event->mec->repeat) { + $repeat_options = (isset($event->meta) and isset($event->meta['mec_repeat']) and is_array($event->meta['mec_repeat'])) ? $event->meta['mec_repeat'] : []; + + $finish_time = $event->time['end']; + $finish_time = str_replace(array('h:', 'H:', 'H'), 'h', $finish_time); + $finish_time = str_replace(array('h ', 'h'), ':', $finish_time); + + $finish = ''; + if ($event->mec->end != '0000-00-00') { + $time_format = 'Ymd\\THi00\\Z'; + $finish_datetime = strtotime($event->mec->end . ' ' . $finish_time); + + $gmt_offset_seconds = $this->get_gmt_offset_seconds($finish_datetime, $event); + $finish = gmdate($time_format, ($finish_datetime - $gmt_offset_seconds)); + } + + $freq = ''; + $interval = '1'; + $bysetpos = ''; + $byday = ''; + $wkst = ''; + $count = ''; + + $repeat_type = $event->meta['mec_repeat_type']; + $week_day_mapping = array('1' => 'MO', '2' => 'TU', '3' => 'WE', '4' => 'TH', '5' => 'FR', '6' => 'SA', '7' => 'SU'); + + if ($repeat_type == 'daily') { + $freq = 'DAILY'; + $interval = $event->mec->rinterval; + } elseif ($repeat_type == 'weekly') { + $freq = 'WEEKLY'; + $interval = ($event->mec->rinterval / 7); + } elseif ($repeat_type == 'monthly') { + $freq = 'MONTHLY'; + $interval = $event->mec->rinterval; + } elseif ($repeat_type == 'yearly') $freq = 'YEARLY'; + elseif ($repeat_type == 'weekday') { + $mec_weekdays = explode(',', trim($event->mec->weekdays, ',')); + foreach ($mec_weekdays as $mec_weekday) $byday .= $week_day_mapping[$mec_weekday] . ','; + + $byday = trim($byday, ', '); + $freq = 'WEEKLY'; + } elseif ($repeat_type == 'weekend') { + $mec_weekdays = explode(',', trim($event->mec->weekdays, ',')); + foreach ($mec_weekdays as $mec_weekday) $byday .= $week_day_mapping[$mec_weekday] . ','; + + $byday = trim($byday, ', '); + $freq = 'WEEKLY'; + } elseif ($repeat_type == 'certain_weekdays') { + $mec_weekdays = explode(',', trim($event->mec->weekdays, ',')); + foreach ($mec_weekdays as $mec_weekday) $byday .= $week_day_mapping[$mec_weekday] . ','; + + $byday = trim($byday, ', '); + $freq = 'WEEKLY'; + } elseif ($repeat_type == 'advanced') { + $advanced_days = is_array($event->meta['mec_advanced_days']) ? $event->meta['mec_advanced_days'] : []; + + $first_rule = $advanced_days[0] ?? NULL; + $ex = explode('.', $first_rule); + + $w = $ex[1] ?? NULL; + if ($w === 'l') $w = -1; + + $byday_mapping = array('MON' => 'MO', 'TUE' => 'TU', 'WED' => 'WE', 'THU' => 'TH', 'FRI' => 'FR', 'SAT' => 'SA', 'SUN' => 'SU'); + $byday = $w . $byday_mapping[strtoupper($ex[0])]; + + $wkst_mapping = array('SU', 'MO', 'TU', 'WE', 'TH', 'FR', 'SA'); + $wkst = $wkst_mapping[$this->get_first_day_of_week()]; + + $freq = 'MONTHLY'; + } elseif ($repeat_type == 'custom_days') { + $freq = ''; + $mec_periods = explode(',', trim($event->mec->days, ',')); + + // Add main occurrence + if (isset($event->meta, $event->meta['mec_start_datetime'], $event->meta['mec_end_datetime'])) { + $main_occ_start = strtotime($event->meta['mec_start_datetime']); + $main_occ_end = strtotime($event->meta['mec_end_datetime']); + + array_unshift($mec_periods, date('Y-m-d', $main_occ_start) . ':' . date('Y-m-d', $main_occ_end) . ':' . date('h-i-A', $main_occ_start) . ':' . date('h-i-A', $main_occ_end)); + } + + $days = ''; + foreach ($mec_periods as $mec_period) { + $mec_days = explode(':', trim($mec_period, ': ')); + if (!isset($mec_days[1])) continue; + + $time_start = $event->time['start']; + if (isset($mec_days[2])) $time_start = str_replace('-', ':', str_replace('-AM', ' AM', str_replace('-PM', ' PM', $mec_days[2]))); + + $time_end = $event->time['end']; + if (isset($mec_days[3])) $time_end = str_replace('-', ':', str_replace('-AM', ' AM', str_replace('-PM', ' PM', $mec_days[3]))); + + $start_time = strtotime($mec_days[0] . ' ' . $time_start); + $end_time = strtotime($mec_days[1] . ' ' . $time_end); + + // All Day Event + if (isset($event->meta['mec_date']) and isset($event->meta['mec_date']['allday']) and $event->meta['mec_date']['allday']) { + $start_time = strtotime("Today", $start_time); + $end_time = strtotime('Tomorrow', $end_time); + } + + $gmt_offset_seconds = $this->get_gmt_offset_seconds($start_time, $event); + + $days .= gmdate('Ymd\\THi00\\Z', ($start_time - $gmt_offset_seconds)) . '/' . gmdate('Ymd\\THi00\\Z', ($end_time - $gmt_offset_seconds)) . ','; + } + + // Add RDATE + $recurrence[] = trim('RDATE;VALUE=PERIOD:' . trim($days, ', '), '; '); + } + + // Add RRULE + if (trim($freq)) { + $rrule = 'RRULE:FREQ=' . $freq . ';' + . ($interval > 1 ? 'INTERVAL=' . $interval . ';' : '') + . ($count != '' ? 'COUNT=' . $count : (($finish != '0000-00-00' and $finish != '') ? 'UNTIL=' . $finish . ';' : '')) + . ($wkst != '' ? 'WKST=' . $wkst . ';' : '') + . ($bysetpos != '' ? 'BYSETPOS=' . $bysetpos . ';' : '') + . ($byday != '' ? 'BYDAY=' . $byday . ';' : ''); + + $recurrence[] = trim($rrule, '; '); + } + + if (trim($event->mec->not_in_days)) { + $mec_not_in_days = explode(',', trim($event->mec->not_in_days, ',')); + $seconds_start = $event->mec->time_start; + + $not_in_days = ''; + foreach ($mec_not_in_days as $mec_not_in_day) { + $timestamp = strtotime($mec_not_in_day) + $seconds_start; + + $gmt_offset_seconds = $this->get_gmt_offset_seconds($timestamp, $event); + $not_in_days .= gmdate('Ymd\THis\Z', $timestamp - $gmt_offset_seconds) . ','; + } + + // Add EXDATE + $recurrence[] = trim('EXDATE:' . trim($not_in_days, ', '), '; '); + } + } + + if ($only_rrule) { + $rrule = ''; + if (is_array($recurrence) and count($recurrence)) { + foreach ($recurrence as $recur) { + if (strpos($recur, 'RRULE') !== false) $rrule = $recur; + } + } + + return $rrule; + } else return $recurrence; + } + + public static function get_upcoming_events($limit = 12) + { + MEC::import('app.skins.list'); + + // Get list skin + $list = new MEC_skin_list(); + + // Attributes + $atts = [ + 'show_past_events' => 1, + 'start_date_type' => 'today', + 'sk-options' => [ + 'list' => ['limit' => 20] + ], + ]; + + // Initialize the skin + $list->initialize($atts); + + // Fetch the events + $list->fetch(); + + return $list->events; + } + + /** + * Do the shortcode and return its output + * @author Webnus + * @param integer $shortcode_id + * @return string + */ + public static function get_shortcode_events($shortcode_id) + { + // Get Render + $render = new MEC_render(); + $atts = apply_filters('mec_calendar_atts', $render->parse($shortcode_id, array())); + + $skin = isset($atts['skin']) ? $atts['skin'] : $render->get_default_layout(); + + $path = MEC::import('app.skins.' . $skin, true, true); + $skin_path = apply_filters('mec_skin_path', $skin); + + if ($skin_path != $skin and $render->file->exists($skin_path)) $path = $skin_path; + if (!$render->file->exists($path)) { + return esc_html__('Skin controller does not exist.', 'modern-events-calendar-lite'); + } + + include_once $path; + + $skin_class_name = 'MEC_skin_' . $skin; + + // Create Skin Object Class + $SKO = new $skin_class_name(); + + // Initialize the skin + $SKO->initialize($atts); + + // Fetch the events + $SKO->fetch(); + + // Return the Events + return $SKO->events; + } + + /** + * User limited for booking an event + * @author Webnus + * @param string $user_email + * @param array $ticket_info + * @param integer $limit + * @return array|boolean + */ + public function booking_permitted($user_email, $ticket_info, $limit) + { + if (!is_array($ticket_info) or is_array($ticket_info) and count($ticket_info) < 2) return false; + + $user_email = sanitize_email($user_email); + $user = $this->getUser()->by_email($user_email); + $user_id = isset($user->ID) ? $user->ID : 0; + + // It's the first booking of this email + if (!$user_id) return true; + + $event_id = isset($ticket_info['event_id']) ? intval($ticket_info['event_id']) : 0; + $count = isset($ticket_info['count']) ? intval($ticket_info['count']) : 0; + + $timestamp = isset($ticket_info['date']) ? $ticket_info['date'] : ''; + if (!is_numeric($timestamp)) $timestamp = strtotime($timestamp); + + $year = date('Y', $timestamp); + $month = date('m', $timestamp); + $day = date('d', $timestamp); + $hour = date('H', $timestamp); + $minutes = date('i', $timestamp); + + $permission = true; + $query = new WP_Query(array( + 'post_type' => $this->get_book_post_type(), + 'author' => $user_id, + 'posts_per_page' => -1, + 'post_status' => array('publish', 'pending', 'draft', 'future', 'private'), + 'year' => $year, + 'monthnum' => $month, + 'day' => $day, + 'hour' => $hour, + 'minute' => $minutes, + 'meta_query' => array( + array('key' => 'mec_event_id', 'value' => $event_id, 'compare' => '='), + array('key' => 'mec_verified', 'value' => '-1', 'compare' => '!='), // Don't include canceled bookings + array('key' => 'mec_confirmed', 'value' => '-1', 'compare' => '!='), // Don't include rejected bookings + ) + )); + + $bookings = 0; + if ($query->have_posts()) { + while ($query->have_posts()) { + $query->the_post(); + + $ticket_ids_string = trim(get_post_meta(get_the_ID(), 'mec_ticket_id', true), ', '); + $ticket_ids_count = count(explode(',', $ticket_ids_string)); + + $bookings += $ticket_ids_count; + } + } + + if (($bookings + $count) > $limit) $permission = false; + + return array('booking_count' => $bookings, 'permission' => $permission); + } + + public function booking_permitted_by_ip($event_id, $limit, $ticket_info = array()) + { + if (!is_array($ticket_info) or count($ticket_info) < 2) return false; + + $count = isset($ticket_info['count']) ? intval($ticket_info['count']) : 0; + + $timestamp = isset($ticket_info['date']) ? $ticket_info['date'] : ''; + if (!is_numeric($timestamp) && $timestamp) $timestamp = strtotime($timestamp); + + $year = date('Y', $timestamp); + $month = date('m', $timestamp); + $day = date('d', $timestamp); + $hour = date('H', $timestamp); + $minutes = date('i', $timestamp); + + $attendee_ip = $this->get_client_ip(); + + $args = array( + 'post_type' => $this->get_book_post_type(), + 'posts_per_page' => -1, + 'post_status' => array('publish', 'pending', 'draft', 'future', 'private'), + 'year' => $year, + 'monthnum' => $month, + 'day' => $day, + 'hour' => $hour, + 'minute' => $minutes, + 'meta_query' => array( + array( + 'key' => 'mec_event_id', + 'value' => $event_id, + 'compare' => '=', + ), + array( + 'key' => 'mec_verified', + 'value' => '-1', + 'compare' => '!=', + ), + array( + 'key' => 'mec_confirmed', + 'value' => '-1', + 'compare' => '!=', + ), + array( + 'key' => 'mec_attendees', + 'value' => $attendee_ip, + 'compare' => 'LIKE', + ), + ), + ); + + $bookings = 0; + $permission = true; + $mec_books = get_posts($args); + + foreach ($mec_books as $mec_book) { + $get_attendees = get_post_meta($mec_book->ID, 'mec_attendees', true); + if (is_array($get_attendees)) { + foreach ($get_attendees as $attendee) { + if (isset($attendee['buyerip']) and trim($attendee['buyerip'], '') == $attendee_ip) { + $bookings += isset($attendee['count']) ? intval($attendee['count']) : 0; + } + } + } + } + + if (($bookings + $count) > $limit) $permission = false; + + return array('booking_count' => $bookings, 'permission' => $permission); + } + + /** + * Return SoldOut Or A Few Tickets Label + * @author Webnus + * @param string|object $event + * @param string $date + * @return string|boolean + */ + public function get_flags($event, $date = NULL) + { + if (is_object($event)) { + $event_id = $event->data->ID; + + if (is_array($date) and isset($date['start']) and isset($date['start']['timestamp'])) $timestamp = $date['start']['timestamp']; + elseif (is_array($event->date) and isset($event->date['start']) and isset($event->date['start']['timestamp'])) $timestamp = $event->date['start']['timestamp']; + else $timestamp = $event->data->time['start_timestamp']; + } else { + $event_id = $event; + $timestamp = $date ? strtotime($date) : 0; + } + + if ((!isset($event_id) or !trim($event_id)) or !trim($timestamp)) return false; + + // MEC Settings + $settings = $this->get_settings(); + + // Booking on single page is disabled + if (!isset($settings['booking_status']) or (isset($settings['booking_status']) and !$settings['booking_status'])) return false; + + // Original Event ID for Multilingual Websites + $event_id = $this->get_original_event($event_id); + + // No Tickets + $tickets = get_post_meta($event_id, 'mec_tickets', true); + if (!is_array($tickets) or (is_array($tickets) and !count($tickets))) return false; + + // MEC Cache + $cache = $this->getCache(); + + // Return from Cache + if ($cache->has('flag-' . $event_id . ':' . $timestamp)) return $cache->get('flag-' . $event_id . ':' . $timestamp); + + $total_event_seats = 0; + foreach ($tickets as $ticket_id => $ticket) { + if (!is_numeric($ticket_id)) continue; + + $bookings_limit_unlimited = isset($ticket['unlimited']) ? $ticket['unlimited'] : 0; + if (!$bookings_limit_unlimited and $total_event_seats >= 0 and isset($ticket['limit']) and is_numeric($ticket['limit']) and $ticket['limit'] >= 0) $total_event_seats += $ticket['limit']; + else $total_event_seats = -1; + } + + // Convert Timestamp + $timestamp = $this->get_start_time_of_multiple_days($event_id, $timestamp); + + $book = $this->getBook(); + $availability = $book->get_tickets_availability($event_id, $timestamp); + + if (!is_array($availability) or (is_array($availability) and !count($availability))) return false; + + $sale_stopped = false; + $remained_tickets = 0; + + foreach ($availability as $ticket_id => $remained) { + if (is_numeric($ticket_id) and $remained >= 0) $remained_tickets += $remained; + if (is_numeric($ticket_id) and isset($availability['stop_selling_' . $ticket_id]) and $availability['stop_selling_' . $ticket_id]) $sale_stopped = true; + + // Unlimited Tickets + if (is_numeric($ticket_id) and $remained == -1) { + $remained_tickets = -1; + break; + } + } + + if (isset($availability['total']) and $availability['total'] >= 0 and $remained_tickets >= 0) $remained_tickets = (int) min($availability['total'], $remained_tickets); + + $add_css_class = $remained_tickets ? 'mec-few-tickets' : ''; + $output_tag = ' %%title%% '; + + // Return Sale Has ended + if ($sale_stopped) { + $flag = str_replace('%%title%%', esc_html__('Sale has ended', 'modern-events-calendar-lite'), $output_tag) . ''; + $cache->set('flag-' . $event_id . ':' . $timestamp, $flag); + + return $flag; + } + // Return Sold Out Label + else if ($remained_tickets === 0) { + $flag = str_replace('%%title%%', esc_html__('Sold Out', 'modern-events-calendar-lite'), $output_tag) . ''; + $cache->set('flag-' . $event_id . ':' . $timestamp, $flag); + + return $flag; + } + + // Booking Options + $booking_options = get_post_meta($event_id, 'mec_booking', true); + + $bookings_last_few_tickets_percentage_inherite = isset($booking_options['last_few_tickets_percentage_inherit']) ? $booking_options['last_few_tickets_percentage_inherit'] : 1; + $bookings_last_few_tickets_percentage = ((isset($booking_options['last_few_tickets_percentage']) and trim($booking_options['last_few_tickets_percentage']) != '') ? $booking_options['last_few_tickets_percentage'] : NULL); + + $total_bookings_limit = (isset($booking_options['bookings_limit']) and trim($booking_options['bookings_limit'])) ? $booking_options['bookings_limit'] : 100; + $bookings_limit_unlimited = isset($booking_options['bookings_limit_unlimited']) ? $booking_options['bookings_limit_unlimited'] : 0; + if ($bookings_limit_unlimited == '1') $total_bookings_limit = -1; + + // Get Per Occurrence + $total_bookings_limit = MEC_feature_occurrences::param($event_id, $timestamp, 'bookings_limit', $total_bookings_limit); + + if (count($tickets) === 1) { + $ticket = reset($tickets); + if (isset($ticket['limit']) and trim($ticket['limit'])) $total_bookings_limit = $ticket['limit']; + + $bookings_limit_unlimited = isset($ticket['unlimited']) ? $ticket['unlimited'] : 0; + if ($bookings_limit_unlimited == '1') $total_bookings_limit = -1; + } + + if ($total_event_seats >= 0 and $total_bookings_limit >= 0 and $total_event_seats < $total_bookings_limit) $total_bookings_limit = $total_event_seats; + + // Percentage + $percentage = ((isset($settings['booking_last_few_tickets_percentage']) and trim($settings['booking_last_few_tickets_percentage']) != '') ? $settings['booking_last_few_tickets_percentage'] : 15); + if (!$bookings_last_few_tickets_percentage_inherite and $bookings_last_few_tickets_percentage) $percentage = (int) $bookings_last_few_tickets_percentage; + + // Return A Few Ticket Label + if (($total_bookings_limit > 0) and ($remained_tickets > 0 and $remained_tickets <= (($percentage * $total_bookings_limit) / 100))) { + $flag = str_replace('%%title%%', esc_html__('Last Few Tickets', 'modern-events-calendar-lite'), $output_tag); + $cache->set('flag-' . $event_id . ':' . $timestamp, $flag); + + return $flag; + } + + $cache->set('flag-' . $event_id . ':' . $timestamp, false); + return false; + } + + public function is_soldout($event, $date) + { + return (bool) $this->get_flags($event, $date); + } + + /** + * Add Query String To URL + * @param string $url + * @param string $key + * @param string $value + * @resourse wp-mix.com + * @return string + */ + public function add_query_string($url, $key, $value) + { + $url = preg_replace('/([?&])' . $key . '=.*?(&|$)/i', '$1$2$4', $url); + + if (substr($url, strlen($url) - 1) == "?" or substr($url, strlen($url) - 1) == "&") + $url = substr($url, 0, -1); + + if (strpos($url, '?') === false) { + return ($url . '?' . $key . '=' . $value); + } else { + return ($url . '&' . $key . '=' . $value); + } + } + + /** + * Check Is DateTime Format Validation + * @param string $format + * @param string $date + * @return boolean + */ + public function check_date_time_validation($format, $date) + { + if (func_num_args() < 2) return false; + + $check = DateTime::createFromFormat($format, $date); + + return $check && $check->format($format) === $date; + } + + public function get_start_of_multiple_days($event_id, $date) + { + if (is_null($date) || trim($date) == '') return NULL; + + if (is_numeric($date)) { + + $date = date('Y-m-d', $date); + } + + $cache = $this->getCache(); + return $cache->rememberOnce('start-multiple-days-' . $event_id . '-' . $date, function () use ($event_id, $date) { + $db = $this->getDB(); + return $db->select("SELECT `dstart` FROM `#__mec_dates` WHERE `post_id`='" . $event_id . "' AND ((`dstart`='" . esc_sql($date) . "') OR (`dstart`<'" . esc_sql($date) . "' AND `dend`>='" . esc_sql($date) . "')) ORDER BY `dstart` DESC LIMIT 1", 'loadResult'); + }); + } + + public function get_start_time_of_multiple_days($event_id, $time) + { + if (is_null($time) || !trim($time)) return NULL; + + // Cache + $cache = $this->getCache(); + + // Get Start Time + $new_time = $cache->rememberOnce('start-multiple-days-start-time' . $event_id . ':' . $time, function () use ($event_id, $time) { + // Database + $db = $this->getDB(); + + return $db->select("SELECT `tstart` FROM `#__mec_dates` WHERE `post_id`=" . $event_id . " AND ((`tstart`=" . esc_sql($time) . ") OR (`tstart`<" . esc_sql($time) . " AND `tend`>" . esc_sql($time) . ")) ORDER BY `tstart` DESC LIMIT 1", 'loadResult'); + }); + + return ($new_time ? $new_time : $time); + } + + public function is_midnight_event($event) + { + // Settings + $settings = $this->get_settings(); + + $start_timestamp = strtotime($event->date['start']['date']); + $end_timestamp = strtotime($event->date['end']['date']); + + $diff = $this->date_diff($event->date['start']['date'], $event->date['end']['date']); + $days = (isset($diff->days) and !$diff->invert) ? $diff->days : 0; + + $time = $event->data->time['end_raw']; + + // Midnight Hour + $midnight_hour = (isset($settings['midnight_hour']) and $settings['midnight_hour']) ? $settings['midnight_hour'] : 0; + $midnight = $end_timestamp + (3600 * $midnight_hour); + + // End Date is before Midnight + if ($days == 1 and $start_timestamp < $end_timestamp and $midnight >= strtotime($event->date['end']['date'] . ' ' . $time)) return true; + + return false; + } + + public function mec_content_html($text, $max_length) + { + $tags = []; + $result = ""; + $is_open = false; + $grab_open = false; + $is_close = false; + $in_double_quotes = false; + $in_single_quotes = false; + $tag = ""; + $i = 0; + $stripped = 0; + $stripped_text = strip_tags($text); + + while ($i < strlen($text) && $stripped < strlen($stripped_text) && $stripped < $max_length) { + $symbol = $text[$i]; + $result .= $symbol; + switch ($symbol) { + case '<': + $is_open = true; + $grab_open = true; + break; + + case '"': + if ($in_double_quotes) $in_double_quotes = false; + else $in_double_quotes = true; + break; + + case "'": + if ($in_single_quotes) $in_single_quotes = false; + else $in_single_quotes = true; + break; + + case '/': + if ($is_open && !$in_double_quotes && !$in_single_quotes) { + $is_close = true; + $is_open = false; + $grab_open = false; + } + + break; + + case ' ': + if ($is_open) $grab_open = false; + else $stripped++; + + break; + + case '>': + if ($is_open) { + $is_open = false; + $grab_open = false; + array_push($tags, $tag); + $tag = ""; + } elseif ($is_close) { + $is_close = false; + array_pop($tags); + $tag = ""; + } + + break; + + default: + if ($grab_open || $is_close) $tag .= $symbol; + if (!$is_open && !$is_close) $stripped++; + } + + $i++; + } + + while ($tags) $result .= ""; + + return $result; + } + + public function get_users_dropdown($current = array(), $notifications = 'booking_notification') + { + ob_start(); + $users_stat = count_users(); + + if (is_array($users_stat) and isset($users_stat['total_users']) and $users_stat['total_users'] > 500): + ?> + + + + getDB(); + $users_list = $db->select(substr(trim($query), 0, -2), 'loadObjectList'); + } + + return array_keys($users_list); + } + + public function get_roles_dropdown($current = array(), $notifications = 'booking_notification') + { + global $wp_roles; + $roles = $wp_roles->get_names(); + ob_start(); + ?> + + $role, + )); + + if (count($curren_get_users)) { + foreach ($curren_get_users as $user) { + if (isset($user->data->user_email) and !in_array($user->data->user_email, $user_list)) $user_list[] = $user->data->user_email; + } + } + } + + return $user_list; + } + + public function get_normal_labels($event, $display_label = false) + { + $output = ''; + + if ($display_label != false and is_object($event) and isset($event->data->labels) and !empty($event->data->labels)) { + foreach ($event->data->labels as $label) { + if (isset($label['style']) and !trim($label['style']) and isset($label['name']) and trim($label['name'])) $output .= '' . trim($label['name']) . ''; + } + } + + // Ongoing Event + if ($display_label and $this->is_ongoing($event)) $output .= '' . $this->m('ongoing', esc_html__('Ongoing', 'modern-events-calendar-lite')) . ''; + // Expired Event + elseif ($display_label and $this->is_expired($event)) $output .= '' . $this->m('expired', esc_html__('Expired', 'modern-events-calendar-lite')) . ''; + // Upcoming Event + elseif ($display_label and is_object($event) and isset($event->date, $event->date['start'], $event->date['start']['timestamp'])) { + // Settings + $settings = $this->get_settings(); + + // Remaining Time + $remaining = $event->date['start']['timestamp'] - current_time('timestamp'); + + // Remaining Time + if ($remaining > 0 and isset($settings['remaining_time_label']) and $settings['remaining_time_label']) { + // Months + if ($remaining >= 7776000) $remaining_str = sprintf(esc_html__('%s months', 'modern-events-calendar-lite'), number_format_i18n(round($remaining / 2592000), 0)); + // Days + else if ($remaining >= 172800) $remaining_str = sprintf(esc_html__('%s days', 'modern-events-calendar-lite'), number_format_i18n(round($remaining / 86400), 0)); + // Hours + else if ($remaining >= 7200) $remaining_str = sprintf(esc_html__('%s hours', 'modern-events-calendar-lite'), number_format_i18n(round($remaining / 3600), 0)); + // Minutes + else $remaining_str = sprintf(esc_html__('%s minutes', 'modern-events-calendar-lite'), number_format_i18n(round($remaining / 60), 0)); + + $output .= '' . $remaining_str . ''; + } + } + + return $output ? '' . MEC_kses::element($output) . '' : $output; + } + + public function display_cancellation_reason($event, $display_reason = false) + { + if (!is_object($event)) return ''; + + $event_id = $event->ID; + if (isset($event->requested_id)) $event_id = $event->requested_id; // Requested Event in Multilingual Websites + + $start_timestamp = (isset($event->data->time['start_timestamp']) ? $event->data->time['start_timestamp'] : (isset($event->date['start']['timestamp']) ? $event->date['start']['timestamp'] : strtotime($event->date['start']['date']))); + + // All Params + $params = MEC_feature_occurrences::param($event_id, $start_timestamp, '*'); + + $event_status = (isset($event->data->meta['mec_event_status']) and trim($event->data->meta['mec_event_status'])) ? $event->data->meta['mec_event_status'] : 'EventScheduled'; + $event_status = (isset($params['event_status']) and trim($params['event_status']) != '') ? $params['event_status'] : $event_status; + + $reason = get_post_meta($event_id, 'mec_cancelled_reason', true); + $reason = (isset($params['cancelled_reason']) and trim($params['cancelled_reason']) != '') ? $params['cancelled_reason'] : $reason; + + $output = ''; + if (isset($event_status) and $event_status == 'EventCancelled' && $display_reason != false and isset($reason) and !empty($reason)) { + $output = '
        ' . MEC_kses::element($reason) . '
        '; + } + + return $output; + } + + public function standardize_format($date = '', $format = 'Y-m-d') + { + if (!trim($date)) return ''; + + $date = str_replace('.', '-', $date); + $f = explode('&', trim($format)); + + if (isset($f[1])) $return = date($f[1], strtotime($date)); + else $return = date($format, strtotime($date)); + + return $return; + } + + public function timepicker($args) + { + $method = isset($args['method']) ? $args['method'] : 24; + $time_hour = isset($args['time_hour']) ? $args['time_hour'] : NULL; + $time_minutes = isset($args['time_minutes']) ? $args['time_minutes'] : NULL; + $time_ampm = isset($args['time_ampm']) ? $args['time_ampm'] : NULL; + $name = isset($args['name']) ? $args['name'] : 'mec[date]'; + $id_key = isset($args['id_key']) ? $args['id_key'] : ''; + + $hour_key = isset($args['hour_key']) ? $args['hour_key'] : 'hour'; + $minutes_key = isset($args['minutes_key']) ? $args['minutes_key'] : 'minutes'; + $ampm_key = isset($args['ampm_key']) ? $args['ampm_key'] : 'ampm'; + + if ($method == 24) { + if ($time_ampm == 'PM' and $time_hour != 12) $time_hour += 12; + if ($time_ampm == 'AM' and $time_hour == 12) $time_hour += 12; + ?> + + : + + + + : + + +is_ongoing($event)) return '
        ' . $this->m('ongoing', esc_html__('Ongoing...', 'modern-events-calendar-lite')) . '
        '; + elseif ($this->is_expired($event)) return '
        ' . $this->m('expired', esc_html__('Expired!', 'modern-events-calendar-lite')) . '
        '; + + return ''; + } + + public function is_ongoing($event) + { + $date = (($event and isset($event->date)) ? $event->date : array()); + + $start_date = (isset($date['start']) and isset($date['start']['date'])) ? $date['start']['date'] : NULL; + $end_date = (isset($date['end']) and isset($date['end']['date'])) ? $date['end']['date'] : NULL; + + if (!$start_date or !$end_date) return false; + + $start_time = NULL; + if (isset($date['start']['hour'])) { + $s_hour = $date['start']['hour']; + if (isset($date['start']['ampm']) and strtoupper($date['start']['ampm']) == 'AM' and $s_hour == '0') $s_hour = 12; + + $start_time = sprintf("%02d", $s_hour) . ':'; + $start_time .= sprintf("%02d", $date['start']['minutes']); + if (isset($date['start']['ampm'])) $start_time .= ' ' . trim($date['start']['ampm']); + } elseif (isset($event->data->time) and is_array($event->data->time) and isset($event->data->time['start_timestamp'])) $start_time = date('H:i', $event->data->time['start_timestamp']); + + $end_time = NULL; + if (isset($date['end']['hour'])) { + $e_hour = $date['end']['hour']; + if (isset($date['end']['ampm']) and strtoupper($date['end']['ampm']) == 'AM' and $e_hour == '0') $e_hour = 12; + + $end_time = sprintf("%02d", $e_hour) . ':'; + $end_time .= sprintf("%02d", $date['end']['minutes']); + if ($date['end']['ampm']) $end_time .= ' ' . trim($date['end']['ampm']); + } elseif (isset($event->data->time) and is_array($event->data->time) and isset($event->data->time['end_timestamp'])) $end_time = date('H:i', $event->data->time['end_timestamp']); + + if (!$start_time or !$end_time) return false; + + $allday = get_post_meta($event->ID, 'mec_allday', true); + if ($allday) { + $start_time = '12:01 AM'; + $end_time = '11:59 PM'; + } + + // Timezone + $TZO = $this->get_TZO($event); + + $d1 = new DateTime($start_date . ' ' . $start_time, $TZO); + $d2 = new DateTime('now', $TZO); + $d3 = new DateTime($end_date . ' ' . $end_time, $TZO); + + // The event is ongoing + if ($d1 <= $d2 and $d3 > $d2) return true; + return false; + } + + public function is_expired($event) + { + $date = (($event and isset($event->date)) ? $event->date : array()); + + $end_date = (isset($date['end']) and isset($date['end']['date'])) ? $date['end']['date'] : NULL; + if (!$end_date) return false; + + $e_hour = (isset($date['end']['hour']) ? $date['end']['hour'] : 11); + if (isset($date['end']['ampm']) and strtoupper($date['end']['ampm']) == 'AM' and $e_hour == '0') $e_hour = 12; + + $end_time = sprintf("%02d", $e_hour) . ':'; + $end_time .= sprintf("%02d", (isset($date['end']['minutes']) ? $date['end']['minutes'] : 59)); + $end_time .= ' ' . (isset($date['end']['ampm']) ? trim($date['end']['ampm']) : 'PM'); + + $allday = isset($date['allday']) ? $date['allday'] : 0; + if ($allday) $end_time = '11:59 PM'; + + // Timezone + $TZO = $this->get_TZO($event); + + $d1 = new DateTime('now', $TZO); + $d2 = new DateTime($end_date . ' ' . $end_time, $TZO); + + // The event is expired + if ($d2 < $d1) return true; + return false; + } + + public function is_started($event) + { + $date = (($event and isset($event->date)) ? $event->date : array()); + + $start_date = (isset($date['start']) and isset($date['start']['date'])) ? $date['start']['date'] : NULL; + if (!$start_date) return false; + + $s_hour = (isset($date['start']['hour']) ? $date['start']['hour'] : NULL); + if (isset($date['start']['ampm']) and strtoupper($date['start']['ampm']) == 'AM' and $s_hour == '0') $s_hour = 12; + + $start_time = sprintf("%02d", $s_hour) . ':'; + $start_time .= sprintf("%02d", (isset($date['start']['minutes']) ? $date['start']['minutes'] : NULL)); + $start_time .= ' ' . (isset($date['start']['ampm']) ? trim($date['start']['ampm']) : NULL); + + $allday = (isset($date['allday']) ? $date['allday'] : 0); + if ($allday) $start_time = '12:01 AM'; + + // Timezone + $TZO = $this->get_TZO($event); + + $d1 = new DateTime($start_date . ' ' . $start_time, $TZO); + $d2 = new DateTime('now', $TZO); + + // The event is started + if ($d1 <= $d2) return true; + return false; + } + + public function array_key_first($arr) + { + if (!function_exists('array_key_first')) { + reset($arr); + return key($arr); + } else return array_key_first($arr); + } + + public function array_key_last($arr) + { + if (!function_exists('array_key_last')) { + end($arr); + return key($arr); + } else return array_key_last($arr); + } + + public function is_day_first($format = '') + { + if (!trim($format)) $format = get_option('date_format'); + $chars = str_split($format); + + $status = true; + foreach ($chars as $char) { + if (in_array($char, array('d', 'D', 'j', 'l', 'N', 'S', 'w', 'z'))) { + $status = true; + break; + } elseif (in_array($char, array('F', 'm', 'M', 'n'))) { + $status = false; + break; + } + } + + return $status; + } + + public function is_year_first($format = '') + { + if (!trim($format)) $format = get_option('date_format'); + $chars = str_split($format); + + $status = true; + foreach ($chars as $char) { + if (in_array($char, array('Y', 'y', 'o'))) { + $status = true; + break; + } elseif (in_array($char, array('F', 'm', 'M', 'n', 'd', 'D', 'j', 'l', 'N', 'S', 'w', 'z'))) { + $status = false; + break; + } + } + + return $status; + } + + public function timezones($selected) + { + $output = wp_timezone_choice($selected); + + $ex = explode('ID; + + // Event Repeat Type + $repeat_type = (!empty($event->meta['mec_repeat_type']) ? $event->meta['mec_repeat_type'] : ''); + + $md_start = $this->get_start_of_multiple_days($event_id, $occurrence); + if ($md_start) $occurrence = $md_start; + + $md_start_time = $this->get_start_time_of_multiple_days($event_id, $occurrence_time); + if ($md_start_time) $occurrence_time = $md_start_time; + + if (strtotime($occurrence) and in_array($repeat_type, array('certain_weekdays', 'custom_days', 'weekday', 'weekend', 'advanced'))) $occurrence = date('Y-m-d', strtotime($occurrence)); + elseif (strtotime($occurrence)) { + $new_occurrence = date('Y-m-d', strtotime('-1 day', strtotime($occurrence))); + if (in_array($repeat_type, array('monthly')) and date('m', strtotime($new_occurrence)) != date('m', strtotime($occurrence))) $new_occurrence = date('Y-m-d', strtotime($occurrence)); + + $occurrence = $new_occurrence; + } else $occurrence = NULL; + + $render = $this->getRender(); + return $render->dates($event_id, ($event->data ?? NULL), $maximum, (trim($occurrence_time) ? date('Y-m-d H:i:s', $occurrence_time) : $occurrence)); + } + + public function get_post_thumbnail_url($post = NULL, $size = 'post-thumbnail') + { + if (function_exists('get_the_post_thumbnail_url')) return get_the_post_thumbnail_url($post, $size); + else { + $post_thumbnail_id = get_post_thumbnail_id($post); + if (!$post_thumbnail_id) return false; + + $image = wp_get_attachment_image_src($post_thumbnail_id, $size); + return $image['0'] ?? false; + } + } + + public function is_multipleday_occurrence($event, $check_same_month = false) + { + // Multiple Day Flag + if (isset($event->data) and isset($event->data->multipleday)) return (bool) $event->data->multipleday; + + $start_date = ((isset($event->date) and isset($event->date['start']) and isset($event->date['start']['date'])) ? $event->date['start']['date'] : NULL); + $end_date = ((isset($event->date) and isset($event->date['end']) and isset($event->date['end']['date'])) ? $event->date['end']['date'] : NULL); + + if ($check_same_month) { + $multipleday = (!is_null($start_date) and $start_date !== $end_date); + return ($multipleday and (date('m', strtotime($start_date)) == date('m', strtotime($end_date)))); + } + + return (!is_null($start_date) and $start_date !== $end_date); + } + + public function get_wp_user_fields() + { + $meta_keys = get_transient('mec-user-meta-keys'); + if (!empty($meta_keys)) { + + return $meta_keys; + } + + $db = $this->getDB(); + $raw_fields = $db->select("SELECT DISTINCT `meta_key` FROM `#__usermeta` WHERE `meta_value` NOT LIKE '%{%'"); + + $forbidden = array( + 'nickname', + 'syntax_highlighting', + 'comment_shortcuts', + 'admin_color', + 'use_ssl', + 'show_admin_bar_front', + 'wp_user_level', + 'user_last_view_date', + 'user_last_view_date_events', + 'wc_last_active', + 'last_update', + 'last_activity', + 'locale', + 'show_welcome_panel', + 'rich_editing', + 'nav_menu_recently_edited', + ); + + $fields = []; + foreach ($raw_fields as $raw_field) { + $key = $raw_field->meta_key; + + if (substr($key, 0, 1) === '_') continue; + if (substr($key, 0, 4) === 'icl_') continue; + if (substr($key, 0, 4) === 'mec_') continue; + if (substr($key, 0, 3) === 'wp_') continue; + if (substr($key, 0, 10) === 'dismissed_') continue; + if (in_array($key, $forbidden)) continue; + + $fields[$key] = trim(ucwords(str_replace('_', ' ', str_replace('-', ' ', $key)))); + } + + set_transient('mec-user-meta-keys', $fields, 36000); + + return $fields; + } + + public function get_wp_user_fields_dropdown($name, $value) + { + $fields = $this->get_wp_user_fields(); + + $dropdown = ''; + + return $dropdown; + } + + public function wizard_import_dummy_events() + { + if (apply_filters('mec_activation_import_events', true)) { + // Create Default Events + $events = array( + array('title' => 'One Time Multiple Day Event', 'start' => date('Y-m-d', strtotime('+5 days')), 'end' => date('Y-m-d', strtotime('+7 days')), 'finish' => date('Y-m-d', strtotime('+7 days')), 'repeat_type' => '', 'repeat_status' => 0, 'interval' => NULL, 'meta' => array('mec_color' => 'dd823b')), + array('title' => 'Daily each 3 days', 'start' => date('Y-m-d'), 'end' => date('Y-m-d'), 'repeat_type' => 'daily', 'repeat_status' => 1, 'interval' => 3, 'meta' => array('mec_color' => 'a3b745')), + array('title' => 'Weekly on Mondays', 'start' => date('Y-m-d', strtotime('Next Monday')), 'end' => date('Y-m-d', strtotime('Next Monday')), 'repeat_type' => 'weekly', 'repeat_status' => 1, 'interval' => 7, 'meta' => array('mec_color' => 'e14d43')), + array('title' => 'Monthly on 27th', 'start' => date('Y-m-27'), 'end' => date('Y-m-27'), 'repeat_type' => 'monthly', 'repeat_status' => 1, 'interval' => NULL, 'year' => '*', 'month' => '*', 'day' => ',27,', 'week' => '*', 'weekday' => '*', 'meta' => array('mec_color' => '00a0d2')), + array('title' => 'Yearly on August 20th and 21st', 'start' => date('Y-08-20'), 'end' => date('Y-08-21'), 'repeat_type' => 'yearly', 'repeat_status' => 1, 'interval' => NULL, 'year' => '*', 'month' => ',08,', 'day' => ',20,21,', 'week' => '*', 'weekday' => '*', 'meta' => array('mec_color' => 'fdd700')), + ); + + // Import Events + $this->save_events($events); + } + } + + public function wizard_import_dummy_shortcodes() + { + if (apply_filters('mec_activation_import_shortcodes', true)) { + // Search Form Options + $sf_options = array('category' => array('type' => 'dropdown'), 'text_search' => array('type' => 'text_input')); + + // Create Default Calendars + $calendars = array( + array('title' => 'Full Calendar', 'meta' => array('skin' => 'full_calendar', 'show_past_events' => 1, 'sk-options' => array('full_calendar' => array('start_date_type' => 'today', 'default_view' => 'list', 'monthly' => 1, 'weekly' => 1, 'daily' => 1, 'list' => 1)), 'sf-options' => array('full_calendar' => array('month_filter' => array('type' => 'dropdown'), 'text_search' => array('type' => 'text_input'))), 'sf_status' => 1)), + array('title' => 'Monthly View', 'meta' => array('skin' => 'monthly_view', 'show_past_events' => 1, 'sk-options' => array('monthly_view' => array('start_date_type' => 'start_current_month', 'next_previous_button' => 1)), 'sf-options' => array('monthly_view' => $sf_options), 'sf_status' => 1)), + array('title' => 'Weekly View', 'meta' => array('skin' => 'weekly_view', 'show_past_events' => 1, 'sk-options' => array('weekly_view' => array('start_date_type' => 'start_current_month', 'next_previous_button' => 1)), 'sf-options' => array('weekly_view' => $sf_options), 'sf_status' => 1)), + array('title' => 'Daily View', 'meta' => array('skin' => 'daily_view', 'show_past_events' => 1, 'sk-options' => array('daily_view' => array('start_date_type' => 'start_current_month', 'next_previous_button' => 1)), 'sf-options' => array('daily_view' => $sf_options), 'sf_status' => 1)), + array('title' => 'Map View', 'meta' => array('skin' => 'map', 'show_past_events' => 1, 'sk-options' => array('map' => array('limit' => 200)), 'sf-options' => array('map' => $sf_options), 'sf_status' => 1)), + array('title' => 'Upcoming events (List)', 'meta' => array('skin' => 'list', 'show_past_events' => 0, 'sk-options' => array('list' => array('load_more_button' => 1)), 'sf-options' => array('list' => $sf_options), 'sf_status' => 1)), + array('title' => 'Upcoming events (Grid)', 'meta' => array('skin' => 'grid', 'show_past_events' => 0, 'sk-options' => array('grid' => array('load_more_button' => 1)), 'sf-options' => array('grid' => $sf_options), 'sf_status' => 1)), + array('title' => 'Carousel View', 'meta' => array('skin' => 'carousel', 'show_past_events' => 0, 'sk-options' => array('carousel' => array('count' => 3, 'limit' => 12)), 'sf-options' => array('carousel' => $sf_options), 'sf_status' => 0)), + array('title' => 'Countdown View', 'meta' => array('skin' => 'countdown', 'show_past_events' => 0, 'sk-options' => array('countdown' => array('style' => 'style3', 'event_id' => '-1')), 'sf-options' => array('countdown' => $sf_options), 'sf_status' => 0)), + array('title' => 'Slider View', 'meta' => array('skin' => 'slider', 'show_past_events' => 0, 'sk-options' => array('slider' => array('style' => 't1', 'limit' => 6, 'autoplay' => 3000)), 'sf-options' => array('slider' => $sf_options), 'sf_status' => 0)), + array('title' => 'Masonry View', 'meta' => array('skin' => 'masonry', 'show_past_events' => 0, 'sk-options' => array('masonry' => array('limit' => 24, 'filter_by' => 'category')), 'sf-options' => array('masonry' => $sf_options), 'sf_status' => 0)), + array('title' => 'Agenda View', 'meta' => array('skin' => 'agenda', 'show_past_events' => 0, 'sk-options' => array('agenda' => array('load_more_button' => 1)), 'sf-options' => array('agenda' => $sf_options), 'sf_status' => 1)), + array('title' => 'Timetable View', 'meta' => array('skin' => 'timetable', 'show_past_events' => 0, 'sk-options' => array('timetable' => array('next_previous_button' => 1)), 'sf-options' => array('timetable' => $sf_options), 'sf_status' => 1)), + array('title' => 'Tile View', 'meta' => array('skin' => 'tile', 'show_past_events' => 0, 'sk-options' => array('tile' => array('next_previous_button' => 1)), 'sf-options' => array('tile' => $sf_options), 'sf_status' => 1)), + array('title' => 'Timeline View', 'meta' => array('skin' => 'timeline', 'show_past_events' => 0, 'sk-options' => array('timeline' => array('load_more_button' => 1)), 'sf-options' => array('timeline' => $sf_options), 'sf_status' => 0)), + ); + + foreach ($calendars as $calendar) { + // Calendar exists + if (post_exists($calendar['title'], 'MEC')) continue; + + $post = array('post_title' => $calendar['title'], 'post_content' => 'MEC', 'post_type' => 'mec_calendars', 'post_status' => 'publish'); + $post_id = wp_insert_post($post); + + update_post_meta($post_id, 'label', ''); + update_post_meta($post_id, 'category', ''); + update_post_meta($post_id, 'location', ''); + update_post_meta($post_id, 'organizer', ''); + update_post_meta($post_id, 'tag', ''); + update_post_meta($post_id, 'author', ''); + + foreach ($calendar['meta'] as $key => $value) update_post_meta($post_id, $key, $value); + } + } + } + + public function save_wizard_options() + { + $wpnonce = isset($_REQUEST['_wpnonce']) ? sanitize_text_field($_REQUEST['_wpnonce']) : NULL; + + // Check if our nonce is set. + if (!trim($wpnonce)) $this->response(array('success' => 0, 'code' => 'NONCE_MISSING')); + + // Verify that the nonce is valid. + if (!wp_verify_nonce($wpnonce, 'mec_options_wizard')) $this->response(array('success' => 0, 'code' => 'NONCE_IS_INVALID')); + + // Current User is not Permitted + if (!current_user_can('mec_settings') and !current_user_can('administrator')) $this->response(array('success' => 0, 'code' => 'ADMIN_ONLY')); + + $mec = isset($_REQUEST['mec']) ? $this->sanitize_deep_array($_REQUEST['mec']) : []; + + $filtered = []; + foreach ($mec as $key => $value) $filtered[$key] = (is_array($value) ? $value : array()); + + $current = get_option('mec_options', array()); + $final = $current; + + // Merge new options with previous options + foreach ($filtered as $key => $value) { + if (is_array($value)) { + foreach ($value as $k => $v) { + // Define New Array + if (!isset($final[$key])) $final[$key] = []; + + // Overwrite Old Value + $final[$key][$k] = $v; + } + } + // Overwrite Old Value + else $final[$key] = $value; + } + + update_option('mec_options', $final); + + // Print the response + $this->response(array('success' => 1)); + } + + public function is_user_booked($user_id, $event_id, $timestamp) + { + $bookings = $this->get_bookings($event_id, $timestamp, 1, $user_id); + return (bool) count($bookings); + } + + public function get_event_attendees($id, $occurrence = NULL, $verified = true) + { + $bookings = $this->get_bookings($id, $occurrence, '-1', NULL, $verified); + + // Attendees + $attendees = []; + foreach ($bookings as $booking) { + $atts = get_post_meta($booking->ID, 'mec_attendees', true); + $atts = apply_filters('mec_filter_event_bookings', $atts, $booking->ID, $occurrence); + + if (isset($atts['attachments'])) unset($atts['attachments']); + + foreach ($atts as $key => $value) { + if (!is_numeric($key)) continue; + + $atts[$key]['book_id'] = $booking->ID; + $atts[$key]['key'] = ($key + 1); + } + + $attendees = array_merge($attendees, $atts); + } + + $attendees = apply_filters('mec_attendees_list_data', $attendees, $id, $occurrence); + usort($attendees, function ($a, $b) { + return strcmp($a['name'], $b['name']); + }); + + return $attendees; + } + + public function mysql2date($format, $date, $timezone) + { + if (empty($date)) return false; + + $datetime = date_create($date, $timezone); + if (false === $datetime) return false; + + // Returns a sum of timestamp with timezone offset. Ideally should never be used. + if ('G' === $format || 'U' === $format) return $datetime->getTimestamp() + $datetime->getOffset(); + + return $datetime->format($format); + } + + public function is_second_booking($event_id, $email) + { + $attendees = $this->get_event_attendees($event_id, NULL, false); + if (!is_array($attendees)) $attendees = []; + + $found = false; + foreach ($attendees as $attendee) { + if ($email and isset($attendee['email']) and trim(strtolower($email)) == trim(strtolower($attendee['email']))) { + $found = true; + break; + } + } + + return $found; + } + + public function get_from_mapped_field($reg_field, $default_value = '') + { + $current_user_id = get_current_user_id(); + if (!$current_user_id) return $default_value; + + $mapped_field = (isset($reg_field['mapping']) and trim($reg_field['mapping']) != '') ? $reg_field['mapping'] : ''; + if (!$mapped_field) return $default_value; + + $value = get_user_meta($current_user_id, $mapped_field, true); + return ($value ? $value : $default_value); + } + + public function get_master_location_id($event, $occurrence = NULL) + { + // Event ID + if (is_numeric($event)) { + $location_id = get_post_meta($event, 'mec_location_id', true); + + // Get From Occurrence + if ($occurrence) $location_id = MEC_feature_occurrences::param($event, $occurrence, 'location_id', $location_id); + } + // Event Object + else { + $meta = (isset($event->data, $event->data->meta) ? $event->data->meta : (isset($event->meta) ? $event->meta : [])); + $location_id = (isset($meta['mec_location_id'])) ? $meta['mec_location_id'] : ''; + + // Get From Occurrence + if (isset($event->date) and isset($event->date['start']) and isset($event->date['start']['timestamp'])) $location_id = MEC_feature_occurrences::param($event->ID, $event->date['start']['timestamp'], 'location_id', $location_id); + } + + if (trim($location_id) === '' or $location_id == 1) $location_id = 0; + + return apply_filters('wpml_object_id', $location_id, 'mec_location', true); + } + + public function get_master_organizer_id($event, $occurrence = NULL) + { + // Event ID + if (is_numeric($event)) { + $organizer_id = get_post_meta($event, 'mec_organizer_id', true); + + // Get From Occurrence + if ($occurrence) $organizer_id = MEC_feature_occurrences::param($event, $occurrence, 'organizer_id', $organizer_id); + } + // Event Object + else { + $organizer_id = (isset($event->data) and isset($event->data->meta) and isset($event->data->meta['mec_organizer_id'])) ? $event->data->meta['mec_organizer_id'] : ''; + + // Get From Occurrence + if (isset($event->date) and isset($event->date['start']) and isset($event->date['start']['timestamp'])) $organizer_id = MEC_feature_occurrences::param($event->ID, $event->date['start']['timestamp'], 'organizer_id', $organizer_id); + } + + if (trim($organizer_id) === '' or $organizer_id == 1) $organizer_id = 0; + + $organizer_id = apply_filters('wpml_object_id', $organizer_id, 'mec_organizer', true); + return $organizer_id; + } + + public function get_location_data($location_id) + { + $term = get_term($location_id); + if (!isset($term->term_id) or $location_id == 1) return []; + + return array( + 'id' => $term->term_id, + 'name' => $term->name, + 'address' => get_metadata('term', $term->term_id, 'address', true), + 'opening_hour' => get_metadata('term', $term->term_id, 'opening_hour', true), + 'latitude' => get_metadata('term', $term->term_id, 'latitude', true), + 'longitude' => get_metadata('term', $term->term_id, 'longitude', true), + 'url' => get_metadata('term', $term->term_id, 'url', true), + 'tel' => get_metadata('term', $term->term_id, 'tel', true), + 'thumbnail' => get_metadata('term', $term->term_id, 'thumbnail', true) + ); + } + + public function get_organizer_data($organizer_id) + { + $term = get_term($organizer_id); + if (!isset($term->term_id) or $organizer_id == 1) return []; + + return array( + 'id' => $term->term_id, + 'name' => $term->name, + 'tel' => get_metadata('term', $term->term_id, 'tel', true), + 'email' => get_metadata('term', $term->term_id, 'email', true), + 'url' => get_metadata('term', $term->term_id, 'url', true), + 'page_label' => get_metadata('term', $term->term_id, 'page_label', true), + 'thumbnail' => get_metadata('term', $term->term_id, 'thumbnail', true) + ); + } + + public function is_uncategorized($term_id) + { + $term = get_term($term_id); + $name = strtolower($term->name); + + return ($name === 'uncategorized' or $name === esc_html__('Uncategorized')); + } + + public function get_thankyou_page_id($event_id = NULL) + { + // Global Settings + $settings = $this->get_settings(); + + // Global Thank-You Page + $thankyou_page_id = (isset($settings['booking_thankyou_page']) and is_numeric($settings['booking_thankyou_page']) and trim($settings['booking_thankyou_page'])) ? $settings['booking_thankyou_page'] : 0; + + // Get by Event + if ($event_id) { + $booking_options = get_post_meta($event_id, 'mec_booking', true); + if (!is_array($booking_options)) $booking_options = []; + + $bookings_thankyou_page_inherit = isset($booking_options['thankyou_page_inherit']) ? $booking_options['thankyou_page_inherit'] : 1; + if (!$bookings_thankyou_page_inherit) { + if (isset($booking_options['booking_thankyou_page']) and $booking_options['booking_thankyou_page']) $thankyou_page_id = $booking_options['booking_thankyou_page']; + else $thankyou_page_id = 0; + } + } + + return $thankyou_page_id; + } + + public function get_thankyou_page_time($transaction_id = NULL) + { + // Global Settings + $settings = $this->get_settings(); + + // Global Time + $thankyou_page_time = (isset($settings['booking_thankyou_page_time']) and is_numeric($settings['booking_thankyou_page_time'])) ? (int) $settings['booking_thankyou_page_time'] : 2000; + + // Get by Event + if ($transaction_id) { + // Booking + $book = $this->getBook(); + $transaction = $book->get_transaction($transaction_id); + + $event_id = $transaction['event_id'] ?? 0; + if ($event_id) { + $booking_options = get_post_meta($event_id, 'mec_booking', true); + if (!is_array($booking_options)) $booking_options = []; + + $bookings_thankyou_page_inherit = $booking_options['thankyou_page_inherit'] ?? 1; + if (!$bookings_thankyou_page_inherit) { + if (isset($booking_options['booking_thankyou_page_time']) and $booking_options['booking_thankyou_page_time']) $thankyou_page_time = (int) $booking_options['booking_thankyou_page_time']; + } + } + } + + return max($thankyou_page_time, 0); + } + + public function is_first_occurrence_passed($event) + { + // Event ID + if (is_numeric($event)) $event_id = $event; + // Event Object + else $event_id = $event->ID; + + $now = current_time('timestamp', 0); + + $db = $this->getDB(); + $first = $db->select("SELECT `tstart` FROM `#__mec_dates` WHERE `post_id`='" . $event_id . "' ORDER BY `tstart` ASC LIMIT 1", 'loadResult'); + + return ($first and $first < $now); + } + + public function preview() + { + // Elementor + if (isset($_GET['action']) and sanitize_text_field($_GET['action']) === 'elementor') return true; + + // Default + return false; + } + + public function display_featured_image_caption($event) + { + if (is_numeric($event)) $event_id = $event; + else $event_id = $event->ID; + + $caption = apply_filters('the_post_thumbnail_caption', get_the_post_thumbnail_caption($event_id)); + return (trim($caption) ? '' . esc_html($caption) . '' : ''); + } + + public function get_event_cost($event, $render = true) + { + $cost_auto_calculate = (isset($event->data->meta) and isset($event->data->meta['mec_cost_auto_calculate']) and trim($event->data->meta['mec_cost_auto_calculate'])) ? $event->data->meta['mec_cost_auto_calculate'] : 0; + if ($cost_auto_calculate) $cost = $this->get_cheapest_ticket_price($event); + else { + $cost = (isset($event->data->meta) and isset($event->data->meta['mec_cost']) and trim($event->data->meta['mec_cost'])) ? $event->data->meta['mec_cost'] : ''; + if (isset($event->date) and isset($event->date['start']) and isset($event->date['start']['timestamp'])) $cost = MEC_feature_occurrences::param($event->ID, $event->date['start']['timestamp'], 'cost', $cost); + } + + $event_id = $event->ID; + if (isset($event->requested_id)) $event_id = $event->requested_id; + + if (!$render) return $cost; + return (is_numeric($cost) ? $this->render_price($cost, $event_id) : $cost); + } + + public function get_cheapest_ticket_price($event) + { + $tickets = (isset($event->data->tickets) and is_array($event->data->tickets)) ? $event->data->tickets : []; + + // Booking Library + $book = $this->getBook(); + + $timestamp = isset($event->date, $event->date['start'], $event->date['start']['timestamp']) ? $event->date['start']['timestamp'] : NULL; + + $min = NULL; + foreach ($tickets as $ticket) { + $price = $book->get_ticket_price($ticket, current_time('Y-m-d'), $event->ID, $timestamp); + + if (is_null($min)) $min = $price; + else $min = min($min, $price); + } + + return $min; + } + + public function get_time_components($event, $type = 'start') + { + $date = $event->date[$type]['date']; + $hour = $event->date[$type]['hour']; + $minutes = $event->date[$type]['minutes']; + $ampm = $event->date[$type]['ampm']; + + if ($hour == '0' and $type === 'start') { + $hour = 12; + $ampm = 'AM'; + } elseif ($hour == '0' and $type === 'end') { + $hour = 12; + } + + return array( + 'date' => $date, + 'hour' => $hour, + 'minutes' => $minutes, + 'ampm' => $ampm, + ); + } + + public function event_date_updated($event_id, $prev_start_datetime, $prev_end_datetime) + { + $prev_start_timestamp = strtotime($prev_start_datetime); + + $new_start_datetime = get_post_meta($event_id, 'mec_start_datetime', true); + $new_start_timestamp = strtotime($new_start_datetime); + + $new_end_datetime = get_post_meta($event_id, 'mec_end_datetime', true); + $new_end_timestamp = strtotime($new_end_datetime); + + // Libraries + $db = $this->getDB(); + $book = $this->getBook(); + + $bookings = $this->get_bookings($event_id, $prev_start_timestamp, -1, NULL, false); + foreach ($bookings as $booking) { + $db->q("UPDATE `#__mec_bookings` SET `timestamp`='" . esc_sql($new_start_timestamp) . "', `date`='" . date('Y-m-d H:i:s', $new_start_timestamp) . "' WHERE `id`='" . esc_sql($booking->mec_booking_record_id) . "' AND `event_id`='" . esc_sql($event_id) . "'"); + $db->q("UPDATE `#__posts` SET `post_date`='" . esc_sql(date('Y-m-d H:i:s', $new_start_timestamp)) . "', `post_date_gmt`='" . esc_sql(get_gmt_from_date(date('Y-m-d H:i:s', $new_start_timestamp))) . "' WHERE `ID`='" . esc_sql($booking->ID) . "'"); + + update_post_meta($booking->ID, 'mec_date', $new_start_timestamp . ':' . $new_end_timestamp); + update_post_meta($booking->ID, 'mec_attention_time', $new_start_timestamp . ':' . $new_end_timestamp); + update_post_meta($booking->ID, 'mec_attention_time_start', $new_start_timestamp); + update_post_meta($booking->ID, 'mec_attention_time_end', $new_end_timestamp); + + $transaction_id = get_post_meta($booking->ID, 'mec_transaction_id', true); + + $transaction = $book->get_transaction($transaction_id); + $transaction['date'] = $new_start_timestamp . ':' . $new_end_timestamp; + + $book->update_transaction($transaction_id, $transaction); + } + } + + public function get_mec_events_data($post_id) + { + // Cache + $cache = $this->getCache(); + + // Return From Cache + return $cache->rememberOnce('mec-events-data-' . $post_id, function () use ($post_id) { + $db = $this->getDB(); + return $db->select("SELECT * FROM `#__mec_events` WHERE `post_id`='$post_id'", "loadObject"); + }); + } + + public function sanitize_deep_array($inputs, $type = 'text', $excludes = array(), $path = '') + { + if (!is_array($inputs)) return $inputs; + + $sanitized = []; + foreach ($inputs as $key => $val) { + $p = $path . $key . '.'; + if ((is_array($excludes) and in_array(trim($p, '. '), $excludes)) or (is_array($excludes) and !count($excludes))) { + $sanitized[$key] = $val; + continue; + } + + if (is_array($val)) $sanitized[$key] = $this->sanitize_deep_array($val, $type, $excludes, $p); + elseif ($type == 'int') $sanitized[$key] = (int) $val; + elseif ($type == 'url') $sanitized[$key] = esc_url($val); + elseif ($type == 'email') $sanitized[$key] = sanitize_email($val); + elseif ($type == 'page') $sanitized[$key] = MEC_kses::page($val); + else { + $sanitized[$key] = sanitize_text_field($val); + } + } + + return $sanitized; + } + + public function can_display_booking_progress_bar($settings) + { + $display_progress_bar = true; + if (!isset($settings['booking_display_progress_bar']) or (isset($settings['booking_display_progress_bar']) and !$settings['booking_display_progress_bar'])) $display_progress_bar = false; + + return $display_progress_bar; + } + + public function display_progress_bar($event) + { + return $this->module('progress-bar.single', array('event' => $event)); + } + + /** + * @param stdClass $event + * @param array $dates + * @return array + */ + public function remove_canceled_dates($event, $dates = []) + { + $filtered_dates = []; + + $i = 0; + foreach ($dates as $date) { + $i++; + + // Do not remove current date + if ($i === 1) { + $filtered_dates[] = $date; + continue; + } + + if (!isset($date['start']) or !isset($date['start']['timestamp'])) continue; + + $start_timestamp = isset($date['start']['timestamp']) ? $date['start']['timestamp'] : NULL; + if ($this->is_occurrence_cenceled($event, $start_timestamp)) continue; + + $filtered_dates[] = $date; + } + + return $filtered_dates; + } + + public function is_occurrence_cenceled($event, $start_timestamp = '') + { + if (is_null($start_timestamp) or !trim($start_timestamp)) return false; + + // All Params + $params = MEC_feature_occurrences::param($event->ID, $start_timestamp, '*'); + + $event_status = (isset($event->data->meta['mec_event_status']) and trim($event->data->meta['mec_event_status'])) ? $event->data->meta['mec_event_status'] : 'EventScheduled'; + $event_status = (isset($params['event_status']) and trim($params['event_status']) != '') ? $params['event_status'] : $event_status; + + if ($event_status === 'EventCancelled') return true; + + return false; + } + + /** + * @param $info + * @return bool|mixed|void + */ + public function debug_email($info) + { + // Convert to String + if (is_array($info) || is_object($info)) $info = print_r($info, true); + + // Global Settings + $settings = $this->get_settings(); + + // Receiver + $to = $settings['gateways_debug_email'] ?? ''; + + // Receiver is not valid + if (!trim($to) || !is_email($to)) return; + + $subject = 'MEC - PayPal Standard Debug: ' . current_time('Y-m-d H:i:s'); + $message = 'Timestamp: ' . current_time('Y-m-d H:i:s') . "\n\n\n" . $info; + + // Add Request to Message + $message .= "\n\n\n" . '[Request]' . "\n\n" . print_r($_REQUEST, true); + + return wp_mail($to, $subject, $message); + } + + public function get_event_color_dot($event, $only_color_code = false) + { + $category_color = ''; + if (is_object($event) and isset($event->data->categories) and is_array($event->data->categories) and count($event->data->categories)) { + foreach ($event->data->categories as $category) { + $category_color = (isset($category['color']) && trim($category['color'])) ? $category['color'] : ''; + if ($category_color) break; + } + } + + $event_color = (isset($event->data, $event->data->meta, $event->data->meta['mec_color']) and trim($event->data->meta['mec_color'])) ? '#' . $event->data->meta['mec_color'] : ''; + + // Event Color has more priority + $color = trim($event_color) ? $event_color : $category_color; + + // Only color code + if ($only_color_code) return $color; + + // No Color + if (trim($color) === '') return ''; + return ''; + } + + /** + * @param $attendee_id + * @param $template + * @return string + */ + public function get_certificate_link($attendee_id, $template) + { + $link = get_permalink($template); + $record = $this->get_mec_attendee_record($attendee_id); + + $key = $attendee_id . '-' . $record->mec_booking_id . '-' . $record->transaction_id . '-' . $record->ticket_id; + + return $this->add_qs_var('key', $key, $link); + } + + /** + * @param $attendee_id + * @return mixed + */ + public function get_mec_attendee_record($attendee_id) + { + return $this->getDB() + ->select("SELECT * FROM `#__mec_booking_attendees` AS a LEFT JOIN `#__mec_bookings` AS b ON a.`mec_booking_id` = b.`id` WHERE a.`id`='" . esc_sql($attendee_id) . "'", 'loadObject'); + } + + /** + * @param $attendees + * @param $event_id + * @param $occurrence + * @param bool $checkbox + * @return string + */ + public function get_attendees_table($attendees, $event_id, $occurrence, $checkbox = true) + { + // Database + $db = $this->getDB(); + + // Settings + $settings = $this->get_settings(); + + $tickets = get_post_meta($event_id, 'mec_tickets', true); + + $html = '
        + ' . ($checkbox ? '
        + + + +
        ' : '') + . ' +
        + ' . esc_html__('Name', 'modern-events-calendar-lite') . ' +
        + +
        + ' . esc_html($this->m('ticket', esc_html__('Ticket', 'modern-events-calendar-lite'))) . ' +
        +
        + ' . esc_html__('Variations', 'modern-events-calendar-lite') . ' +
        '; + + $html = apply_filters('mec_attendees_list_header_html', $html, $event_id, $occurrence); + $html .= '
        '; + + foreach ($attendees as $attendee) { + $mec_attendee_id = ''; + + // Attendee ID for Certificate + if ($occurrence && isset($settings['certificate_status']) && $settings['certificate_status'] && isset($attendee['id']) && isset($attendee['book_id'])) { + $mec_booking_id = $db->select("SELECT `id` FROM `#__mec_bookings` WHERE `event_id`='" . esc_sql($event_id) . "' AND `booking_id`='" . esc_sql($attendee['book_id']) . "' AND `timestamp`='" . esc_sql($occurrence) . "' ORDER BY `id` ASC LIMIT 1", 'loadResult'); + $mec_attendee_id = $db->select("SELECT `id` FROM `#__mec_booking_attendees` WHERE `mec_booking_id`='" . esc_sql($mec_booking_id) . "' AND `ticket_id`='" . esc_sql($attendee['id']) . "'", "loadResult"); + } + + $html .= '
        '; + if ($checkbox) $html .= '
        ' . esc_html($attendee['name'] . ':.:' . $attendee['email']) . ',
        '; + $html .= '
        ' . get_avatar($attendee['email']) . $attendee['name'] . '
        '; + $html .= ''; + $html .= '
        ' . ((isset($attendee['id']) and isset($tickets[$attendee['id']]['name'])) ? $tickets[$attendee['id']]['name'] : esc_html__('Unknown', 'modern-events-calendar-lite')) . '
        '; + + $variations = '
        '; + if (isset($attendee['variations']) and is_array($attendee['variations']) and count($attendee['variations'])) { + $ticket_variations = $this->ticket_variations($event_id, $attendee['id']); + + foreach ($attendee['variations'] as $variation_id => $variation_count) { + if (!$variation_count || $variation_count < 0) continue; + + $variation_title = (isset($ticket_variations[$variation_id]) and isset($ticket_variations[$variation_id]['title'])) ? $ticket_variations[$variation_id]['title'] : ''; + if (!trim($variation_title)) continue; + + $variations .= '+ ' . esc_html($variation_title) . ' + (' . esc_html($variation_count) . ')'; + } + } + + $variations .= '
        '; + + $html .= $variations; + $html = apply_filters('mec_attendees_list_html', $html, $attendee, $attendee['key'], $attendee['book_id'], $occurrence); + $html .= '
        '; + } + + return $html; + } + + /** + * @param array $dates + * @param stdClass $event + * @return array + */ + public function maybe_use_last_date($dates, $event) + { + // Only when one date is found + if (count($dates) === 1 && isset($dates[0]['end']['timestamp']) && $dates[0]['end']['timestamp']) { + // Event repeat status + $repeat_status = $event->data->meta['mec_repeat_status'] ?? 0; + + // First and only date is expired + if ($repeat_status && current_time('timestamp') > $dates[0]['end']['timestamp']) { + // DB + $db = $this->getDB(); + + $mec_date = $db->select("SELECT dstart, dend FROM `#__mec_dates` WHERE `post_id`='" . esc_sql($event->ID) . "' ORDER BY `id` DESC LIMIT 1", 'loadObject'); + if (isset($mec_date->dstart, $mec_date->dend)) { + // Render Library + $render = $this->getRender(); + + $dates = []; + $dates[] = $render->add_timestamps([ + 'start' => [ + 'date' => $mec_date->dstart, + 'hour' => $event->data->meta['mec_date']['start']['hour'], + 'minutes' => $event->data->meta['mec_date']['start']['minutes'], + 'ampm' => $event->data->meta['mec_date']['start']['ampm'] + ], + 'end' => [ + 'date' => $mec_date->dend, + 'hour' => $event->data->meta['mec_date']['end']['hour'], + 'minutes' => $event->data->meta['mec_date']['end']['minutes'], + 'ampm' => $event->data->meta['mec_date']['end']['ampm'] + ], + 'allday' => $event->data->meta['mec_allday'] ?? 0, + 'hide_time' => $event->data->meta['mec_hide_time'] ?? 0, + 'past' => 1 + ]); + } + } + } + + return $dates; + } + + public function generate_download_csv($rows, $filename) + { + header('Content-Type: text/csv; charset=utf-8'); + header('Content-Disposition: attachment; filename=' . $filename); + + $delimiter = "\t"; + $output = fopen('php://output', 'w'); + + fprintf($output, chr(0xEF) . chr(0xBB) . chr(0xBF)); + + foreach ($rows as $row) { + fputcsv($output, $row, $delimiter); + } + } + + public function generate_download_excel($rows, $filename) + { + include_once MEC_ABSPATH . 'app' . DS . 'api' . DS . 'XLSX' . DS . 'xlsxwriter.class.php'; + + $writer = new MEC_XLSXWriter(); + $writer->writeSheet($rows); + $writer->writeToFile($filename); + + // Download + if (file_exists($filename)) { + header('Content-Description: File Transfer'); + header('Content-Type: application/octet-stream'); + header('Content-Disposition: attachment; filename="' . basename($filename) . '"'); + header('Expires: 0'); + header('Cache-Control: must-revalidate'); + header('Pragma: public'); + header('Content-Length: ' . filesize($filename)); + + readfile($filename); + unlink($filename); + exit; + } + } + + /** + * @param array $icons + * @return MEC_icons + */ + public function icons(array $icons = []): MEC_icons + { + // Import Library + MEC::import('app.libraries.icons'); + + return (new MEC_icons($icons)); + } + + public function add_global_exceptional_days($days = []) + { + // Force Array + if (!is_array($days)) $days = []; + + // MEC Settings + $settings = $this->get_settings(); + + // Global Exceptional Days + $global = isset($settings['global_exceptional_days']) && is_array($settings['global_exceptional_days']) ? $settings['global_exceptional_days'] : []; + + foreach ($global as $key => $day) { + if (!is_numeric($key)) continue; + $days[] = $this->standardize_format($day); + } + + return array_unique($days); + } + + public function get_organizer_id_by_email($email) + { + $db = $this->getDB(); + $term_ids = $db->select("SELECT term_id FROM `#__termmeta` WHERE `meta_key`='email' AND `meta_value`='" . esc_sql($email) . "' LIMIT 20", 'loadColumn'); + + $organizer_id = ''; + foreach ($term_ids as $term_id) { + $term = get_term((int) $term_id); + if ($term->taxonomy === 'mec_organizer') { + $organizer_id = $term->term_id; + break; + } + } + + return $organizer_id; + } + + /** + * @param $event_id + * @return bool + */ + public function hide_end_time_status($event_id): bool + { + // Settings + $settings = $this->get_settings(); + + // Global Status + $hide_end_time_global = isset($settings['hide_event_end_time']) && $settings['hide_event_end_time']; + if ($hide_end_time_global) return true; + + $event_status = get_post_meta($event_id, 'mec_hide_end_time', true); + if (is_null($event_status) || (is_string($event_status) && trim($event_status) === '')) $event_status = 0; + + return (bool) $event_status; + } + + /** + * @param $start_date + * @param $end_date + * @return int + */ + public function get_days_diff($start_date, $end_date) + { + $event_period = $this->date_diff($start_date, $end_date); + return $event_period ? $event_period->days : 0; + } + + /** + * @param $event_id + * @param $occurrence + * @param $occurrence_time + * @return array + */ + public function get_start_date_to_get_event_dates($event_id, $occurrence, $occurrence_time = null) + { + $repeat_type = get_post_meta($event_id, 'mec_repeat_type', true); + + $md_start = $this->get_start_of_multiple_days($event_id, $occurrence); + if ($md_start) $occurrence = $md_start; + + $md_start_time = $this->get_start_time_of_multiple_days($event_id, $occurrence_time); + if ($md_start_time) $occurrence_time = $md_start_time; + + if (strtotime($occurrence) and in_array($repeat_type, array('certain_weekdays', 'custom_days', 'weekday', 'weekend'))) $occurrence = date('Y-m-d', strtotime($occurrence)); + elseif (strtotime($occurrence)) { + $new_occurrence = date('Y-m-d', strtotime('-1 day', strtotime($occurrence))); + if ($repeat_type == 'monthly' and date('m', strtotime($new_occurrence)) != date('m', strtotime($occurrence))) $new_occurrence = date('Y-m-d', strtotime($occurrence)); + + $occurrence = $new_occurrence; + } else $occurrence = NULL; + + return [$occurrence, $occurrence_time]; + } + + public function adjust_event_dates_for_booking($event, $dates, $occurrence = null) + { + // Remove First Date if it is already started! + if (count($dates) > 1 && !$occurrence) { + $all_dates = $dates; + + // Global Settings + $settings = $this->get_settings(); + + foreach ($dates as $d => $date) { + $start_date = (isset($date['start']) and isset($date['start']['date'])) ? $date['start']['date'] : current_time('Y-m-d H:i:s'); + $end_date = (isset($date['end']) and isset($date['end']['date'])) ? $date['end']['date'] : current_time('Y-m-d H:i:s'); + + $s_time = sprintf("%02d", $date['start']['hour']) . ':'; + $s_time .= sprintf("%02d", $date['start']['minutes']); + $s_time .= trim($date['start']['ampm']); + + $start_time = date('D M j Y G:i:s', strtotime($start_date . ' ' . $s_time)); + + $e_time = sprintf("%02d", $date['end']['hour']) . ':'; + $e_time .= sprintf("%02d", $date['end']['minutes']); + $e_time .= trim($date['end']['ampm']); + + $end_time = date('D M j Y G:i:s', strtotime($end_date . ' ' . $e_time)); + + $d1 = new DateTime($start_time); + $d2 = new DateTime(current_time("D M j Y G:i:s")); + $d3 = new DateTime($end_time); + + // Booking OnGoing Event Option + $ongoing_event_book = isset($settings['booking_ongoing']) && $settings['booking_ongoing'] == '1'; + if ($ongoing_event_book) { + if ($d3 < $d2) { + unset($dates[$d]); + } + } else { + if ($d1 < $d2) { + unset($dates[$d]); + } + } + } + + if (count($dates) === 0) $dates = array(end($all_dates)); + } + + $dates = $this->remove_canceled_dates($event, array_values($dates)); + return $this->maybe_use_last_date($dates, $event); + } + + public function display_not_found_message($echo = true) + { + // Default Message + $message = esc_html__('No event found!', 'modern-events-calendar-lite'); + + // Global Settings + $settings = $this->get_settings(); + + // Get Message from Settings + if (isset($settings['not_found_message']) && trim($settings['not_found_message'])) $message = stripslashes($settings['not_found_message']); + + // Display the Message + if ($echo) echo $message; + else return $message; + } + + public function random_string_generator($length = 12) + { + return wp_generate_password($length, false); + } + + public function get_days_in_previous_month($month, $year) + { + return date('t', strtotime('-1 month', strtotime($year . '-' . $month . '-10'))); + } + + public function is_new_version_available() + { + $url = add_query_arg( + ['category' => 'mec'], + MEC_API_UPDATE . '/updates/?action=get_metadata&slug=modern-events-calendar-lite' + ); + + $response = wp_remote_get($url); + $status = wp_remote_retrieve_response_code($response); + + if ($status !== 200) return false; + + $body = wp_remote_retrieve_body($response); + if ($body === '') return false; + + $JSON = json_decode($body); + if (!is_object($JSON) || !isset($JSON->version)) return false; + + if ($JSON->version > MEC_VERSION) return $JSON->version; + + return false; + } + + public function get_book_datetime_string($timestamps, $event_id, $book_id) + { + list($start_timestamp, $end_timestamp) = explode(':', $timestamps); + + // Date & Time Format + $date_format = get_option('date_format'); + $time_format = get_option('time_format'); + + $allday = get_post_meta($event_id, 'mec_allday', true); + $hide_time = get_post_meta($event_id, 'mec_hide_time', true); + $hide_end_time = $this->hide_end_time_status($event_id); + + if (trim($timestamps) && strpos($timestamps, ':') !== false) { + if (trim($start_timestamp) != trim($end_timestamp)) { + return sprintf(esc_html__('%s to %s', 'modern-events-calendar-lite'), $this->date_i18n($date_format . ((!$allday and !$hide_time) ? ' ' . $time_format : ''), $start_timestamp), $this->date_i18n($date_format . ((!$allday and !$hide_time and !$hide_end_time) ? ' ' . $time_format : ''), $end_timestamp)); + } else return get_the_date($date_format . ((!$allday and !$hide_time) ? ' ' . $time_format : ''), $book_id); + } + + return get_the_date($date_format . ((!$allday and !$hide_time) ? ' ' . $time_format : ''), $book_id); + } + + public function convert_term_name_to_id($names, $taxonomy) + { + if (!is_array($names)) { + $term = get_term_by('name', $names, $taxonomy); + return $term ? $term->term_id : null; + } + + $ids = []; + foreach ($names as $name) { + $id = $this->convert_term_name_to_id($name, $taxonomy); + if (!$id) continue; + + $ids[] = $id; + } + + return $ids; + } + + public function is_mobile() + { + $useragent = $_SERVER['HTTP_USER_AGENT']; + return preg_match('/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i', $useragent) || preg_match('/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i', substr($useragent, 0, 4)); + } + + public function get_raw_post_description($post_id) + { + if (function_exists('kc_add_map')) { + $post = get_post($post_id); + return strip_tags(strip_shortcodes(apply_filters('the_content', $post->post_content))); + } + + return strip_tags(strip_shortcodes(get_post_field('post_content', $post_id))); + } +} diff --git a/app/libraries/meetup.php b/app/libraries/meetup.php new file mode 100755 index 0000000..631b5ae --- /dev/null +++ b/app/libraries/meetup.php @@ -0,0 +1,242 @@ + + */ +class MEC_meetup extends MEC_base +{ + /** + * @var MEC_main + */ + private $main; + + public function __construct() + { + $this->main = $this->getMain(); + } + + /** + * @return string + */ + public function get_redirect_url(): string + { + return $this->main->URL('backend').'admin.php?page=MEC-ix&tab=MEC-meetup-import&mec-ix-action=meetup-import-start'; + } + + public function get_token() + { + // Get MEC IX options + $ix = $this->main->get_ix_options(); + + // Refresh Token + $refresh_token = $ix['meetup_refresh_token'] ?? ''; + + $response = wp_remote_post('https://secure.meetup.com/oauth2/access', [ + 'body' => [ + 'client_id' => $ix['meetup_public_key'] ?? '', + 'client_secret' => $ix['meetup_secret_key'] ?? '', + 'grant_type' => 'refresh_token', + 'refresh_token' => $refresh_token + ], + ]); + + // Error Happened + if(is_wp_error($response)) return ''; + + // Response Body + $body = json_decode(wp_remote_retrieve_body($response)); + + return $body->access_token ?? ''; + } + + public function get_tokens_by_code(string $code = '') + { + // Get MEC IX options + $ix = $this->main->get_ix_options(); + + $response = wp_remote_post('https://secure.meetup.com/oauth2/access', [ + 'body' => [ + 'client_id' => $ix['meetup_public_key'] ?? '', + 'client_secret' => $ix['meetup_secret_key'] ?? '', + 'grant_type' => 'authorization_code', + 'redirect_uri' => $this->get_redirect_url(), + 'code' => $code, + ], + ]); + + // Error Happened + if(is_wp_error($response)) return ''; + + // Response Body + $body = json_decode(wp_remote_retrieve_body($response)); + + $token = $body->access_token ?? ''; + $refresh = $body->refresh_token ?? ''; + + $this->main->save_ix_options([ + 'meetup_refresh_token' => $refresh + ]); + + return $token; + } + + /** + * Get Meetup Event by id. + * + * @return array + */ + public function get_event($token, $event_id = 0) + { + $query = 'query ($event_id: ID!) { + event(id: $event_id) { + id + title + dateTime + endTime + description + shortDescription + recurrenceDescription + duration + timezone + eventUrl + status + venue { + id + name + address + city + state + country + lat + lng + postalCode + zoom + } + onlineVenue { + type + url + } + isOnline + imageUrl + series { + weeklyRecurrence { + weeklyInterval + weeklyDaysOfWeek + } + monthlyRecurrence { + monthlyWeekOfMonth + monthlyDayOfWeek + } + endDate + description + } + feeSettings { + amount + currency + } + hosts { + id + name + email + lat + lon + city + state + country + } + group { + id + name + description + emailListAddress + urlname + logo { + baseUrl + } + } + } + }'; + + $variables = ['event_id' => $event_id]; + return $this->query($token, $query, $variables); + } + + /** + * Get Meetup Events By Group ID With pagination + * + * @return array Group ID + */ + public function get_group_events($token, $meetup_group_id = '') + { + $query = 'query ($urlname: String!, $items_num: Int!) { + groupByUrlname(urlname: $urlname) { + id + name + upcomingEvents(input: {first: $items_num}) { + pageInfo { + hasNextPage + endCursor + } + count + edges { + node { + id + token + title + eventUrl + dateTime + endTime + } + } + } + } + }'; + $variables = ['urlname' => $meetup_group_id, 'items_num' => 999]; + return $this->query($token, $query, $variables); + } + + /** + * Get Meetup Authorized User Data + * + * @return array + */ + public function get_group_name($token, $meetup_group_id) + { + $query = ' + query ($urlname: String!) { + groupByUrlname(urlname: $urlname) { + id + name + } + }'; + + $variables = ['urlname' => $meetup_group_id]; + return $this->query($token, $query, $variables); + } + + public function query(string $token, string $query, array $variables = []) + { + $headers = ['Content-Type: application/json']; + $headers[] = 'Authorization: Bearer ' . $token; + + $data = @file_get_contents( + 'https://api.meetup.com/gql', + false, + stream_context_create([ + 'http' => [ + 'method' => 'POST', + 'header' => $headers, + 'content' => json_encode(['query' => $query, 'variables' => $variables]), + ] + ]) + ); + + // No Data + if($data === false) return []; + + return json_decode($data, true); + } +} diff --git a/app/libraries/notifications.php b/app/libraries/notifications.php new file mode 100755 index 0000000..b16e83d --- /dev/null +++ b/app/libraries/notifications.php @@ -0,0 +1,2647 @@ + + */ +class MEC_notifications extends MEC_base +{ + public $main; + public $PT; + public $notif_settings; + public $settings; + public $styling; + public $book; + public $u; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Main + $this->main = $this->getMain(); + + // MEC Book Post Type Name + $this->PT = $this->main->get_book_post_type(); + + // MEC Notification Settings + $this->notif_settings = $this->main->get_notifications(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + + // Styling + $this->styling = $this->main->get_styling(); + + // MEC Book + $this->book = $this->getBook(); + + // MEC User + $this->u = $this->getUser(); + } + + /** + * Send email verification notification + * @param int $book_id + * @param string $mode + * @return boolean + * @author Webnus + */ + public function email_verification($book_id, $mode = 'auto') + { + if (!$book_id) return false; + + $booker = $this->u->booking($book_id); + if (!isset($booker->user_email)) return false; + + $verification_status = get_post_meta($book_id, 'mec_verified', true); + if ($verification_status == 1) return false; // Already Verified + + $price = get_post_meta($book_id, 'mec_price', true); + + // Event ID + $event_id = get_post_meta($book_id, 'mec_event_id', true); + + list($auto_verify_free, $auto_verify_paid) = $this->book->get_auto_verification_status($event_id, $book_id); + + // Auto verification for free bookings is enabled so don't send the verification email + if ($mode == 'auto' and $price <= 0 and $auto_verify_free) return false; + + // Auto verification for paid bookings is enabled so don't send the verification email + if ($mode == 'auto' and $price > 0 and $auto_verify_paid) return false; + + // Notification Settings + $notif_settings = $this->get_notification_content($book_id); + + $subject = isset($notif_settings['email_verification']['subject']) ? esc_html__($notif_settings['email_verification']['subject'], 'modern-events-calendar-lite') : esc_html__('Please verify your email.', 'modern-events-calendar-lite'); + $subject = $this->content($this->get_subject($subject, 'email_verification', $event_id, $book_id), $book_id); + + $headers = ['Content-Type: text/html; charset=UTF-8']; + + $recipients_str = $notif_settings['email_verification']['recipients'] ?? ''; + $recipients = trim($recipients_str) ? explode(',', $recipients_str) : []; + + $users = $notif_settings['email_verification']['receiver_users'] ?? []; + $users_down = $this->main->get_emails_by_users($users); + $recipients = array_merge($users_down, $recipients); + + $roles = $notif_settings['email_verification']['receiver_roles'] ?? []; + $user_roles = $this->main->get_emails_by_roles($roles); + $recipients = array_merge($user_roles, $recipients); + + // Unique Recipients + $recipients = array_map('trim', $recipients); + $recipients = array_unique($recipients); + + // Recipient Type + $CCBCC = $this->get_cc_bcc_method(); + + foreach ($recipients as $recipient) + { + // Skip if it's not a valid email + if (trim($recipient) == '' or !filter_var($recipient, FILTER_VALIDATE_EMAIL)) continue; + + $headers[] = $CCBCC . ': ' . $recipient; + } + + // Attendees + $attendees = get_post_meta($book_id, 'mec_attendees', true); + if (!is_array($attendees) or !count($attendees)) $attendees = [get_post_meta($book_id, 'mec_attendee', true)]; + + // Do not send email twice! + $done_emails = []; + + // Book Data + $key = get_post_meta($book_id, 'mec_verification_key', true); + $link = trim(get_permalink($event_id), '/') . '/verify/' . $key . '/'; + + // Changing some sender email info. + $this->mec_sender_email_notification_filter(); + + // Set Email Type to HTML + add_filter('wp_mail_content_type', [$this->main, 'html_email_type']); + + // Send the emails + foreach ($attendees as $attendee) + { + $to = $attendee['email'] ?? ''; + if (!trim($to) or in_array($to, $done_emails) or !filter_var($to, FILTER_VALIDATE_EMAIL)) continue; + + $message = $notif_settings['email_verification']['content'] ?? ''; + $message = $this->content($this->get_content($message, 'email_verification', $event_id, $book_id), $book_id, $attendee); + + $message = str_replace('%%verification_link%%', $link, $message); + $message = str_replace('%%link%%', $link, $message); + + // Remove remained placeholders + $message = preg_replace('/%%.*%%/', '', $message); + + $message = $this->add_template($message); + + // Filter the email + $mail_arg = [ + 'to' => $to, + 'subject' => $subject, + 'message' => $message, + 'headers' => $headers, + 'attachments' => [], + ]; + + $mail_arg = apply_filters('mec_before_send_email_verification', $mail_arg, $book_id, 'email_verification'); + + // Send the mail + wp_mail($mail_arg['to'], html_entity_decode(stripslashes($mail_arg['subject']), ENT_HTML5), wpautop(stripslashes($mail_arg['message'])), $mail_arg['headers'], $mail_arg['attachments']); + + // For prevention of email repeat send + $done_emails[] = $to; + } + + // Remove the HTML Email filter + remove_filter('wp_mail_content_type', [$this->main, 'html_email_type']); + + return true; + } + + /** + * Send booking notification + * @param int $book_id + * @return boolean + * @author Webnus + */ + public function booking_notification($book_id) + { + if (!$book_id) return false; + + $booking_notification = apply_filters('mec_booking_notification', true); + if (!$booking_notification) return false; + + $booker = $this->u->booking($book_id); + if (!isset($booker->user_email)) return false; + + // Notification Settings + $notif_settings = $this->get_notification_content($book_id); + + // Booking Notification is disabled + if (isset($notif_settings['booking_notification']['status']) and !$notif_settings['booking_notification']['status']) return false; + + // Event ID + $event_id = get_post_meta($book_id, 'mec_event_id', true); + + $subject = isset($notif_settings['booking_notification']['subject']) ? esc_html__($notif_settings['booking_notification']['subject'], 'modern-events-calendar-lite') : esc_html__('Your booking is received.', 'modern-events-calendar-lite'); + $subject = $this->content($this->get_subject($subject, 'booking_notification', $event_id, $book_id), $book_id); + + $headers = ['Content-Type: text/html; charset=UTF-8']; + + $recipients_str = $notif_settings['booking_notification']['recipients'] ?? ''; + $recipients = trim($recipients_str) ? explode(',', $recipients_str) : []; + + $users = $notif_settings['booking_notification']['receiver_users'] ?? []; + $users_down = $this->main->get_emails_by_users($users); + $recipients = array_merge($users_down, $recipients); + + $roles = $notif_settings['booking_notification']['receiver_roles'] ?? []; + $user_roles = $this->main->get_emails_by_roles($roles); + $recipients = array_merge($user_roles, $recipients); + + // Unique Recipients + $recipients = array_map('trim', $recipients); + $recipients = array_unique($recipients); + + // Recipient Type + $CCBCC = $this->get_cc_bcc_method(); + + foreach ($recipients as $recipient) + { + // Skip if it's not a valid email + if (trim($recipient) == '' or !filter_var($recipient, FILTER_VALIDATE_EMAIL)) continue; + + $headers[] = $CCBCC . ': ' . $recipient; + } + + // Send the notification to event organizer + if (isset($notif_settings['booking_notification']['send_to_organizer']) and $notif_settings['booking_notification']['send_to_organizer'] == 1) + { + $organizer_email = $this->get_booking_organizer_email($book_id); + if ($organizer_email !== false) $headers[] = $CCBCC . ': ' . trim($organizer_email); + } + + // Send the notification to additional organizers + if (isset($notif_settings['booking_notification']['send_to_additional_organizers']) and $notif_settings['booking_notification']['send_to_additional_organizers'] == 1) + { + $additional_organizer_emails = $this->get_booking_additional_organizers_emails($book_id); + if (is_array($additional_organizer_emails) and count($additional_organizer_emails)) + { + foreach ($additional_organizer_emails as $additional_organizer_email) $headers[] = $CCBCC . ': ' . trim($additional_organizer_email); + } + } + + // Attendees + $attendees = get_post_meta($book_id, 'mec_attendees', true); + if (!is_array($attendees) or !count($attendees)) $attendees = [get_post_meta($book_id, 'mec_attendee', true)]; + + // Do not send email twice! + $done_emails = []; + + // Changing some sender email info. + $this->mec_sender_email_notification_filter(); + + // Set Email Type to HTML + add_filter('wp_mail_content_type', [$this->main, 'html_email_type']); + + // Send the emails + foreach ($attendees as $attendee) + { + $to = $attendee['email'] ?? ''; + if (!trim($to) or in_array($to, $done_emails) or !filter_var($to, FILTER_VALIDATE_EMAIL)) continue; + + $message = $notif_settings['booking_notification']['content'] ?? ''; + $message = $this->content($this->get_content($message, 'booking_notification', $event_id, $book_id), $book_id, $attendee); + + // Remove remained placeholders + $message = preg_replace('/%%.*%%/', '', $message); + + $message = $this->add_template($message); + + // Filter the email + $mail_arg = [ + 'to' => $to, + 'subject' => $subject, + 'message' => $message, + 'headers' => $headers, + 'attachments' => [], + ]; + + $mail_arg = apply_filters('mec_before_send_booking_notification', $mail_arg, $book_id, 'booking_notification'); + + // Send the mail + wp_mail($mail_arg['to'], html_entity_decode(stripslashes($mail_arg['subject']), ENT_HTML5), wpautop(stripslashes($mail_arg['message'])), $mail_arg['headers'], $mail_arg['attachments']); + + // For prevention of email repeat send + $done_emails[] = $to; + } + + // Remove the HTML Email filter + remove_filter('wp_mail_content_type', [$this->main, 'html_email_type']); + + return true; + } + + /** + * Send booking confirmation notification + * @param int $book_id + * @param string $mode + * @return boolean + * @author Webnus + */ + public function booking_confirmation($book_id, $mode = 'manually') + { + if (!$book_id) return false; + + // Notification Settings + $notif_settings = $this->get_notification_content($book_id); + + // Booking Confirmation is disabled + if (isset($notif_settings['booking_confirmation']['status']) and !$notif_settings['booking_confirmation']['status']) return false; + + $confirmation_notification = apply_filters('mec_booking_confirmation', true); + if (!$confirmation_notification) return false; + + $booker = $this->u->booking($book_id); + if (!isset($booker->user_email)) return false; + + $send_in_automode = isset($this->settings['booking_auto_confirm_send_email']) && $this->settings['booking_auto_confirm_send_email'] == '1'; + + // Don't send the confirmation email + if ($mode == 'auto' and !$send_in_automode) return false; + + $timestamp = time(); + + $last_confirmation_email = get_post_meta($book_id, 'mec_last_confirmation_email', true); + if ($last_confirmation_email and is_numeric($last_confirmation_email) and ($timestamp - $last_confirmation_email) < 10) return false; + + update_post_meta($book_id, 'mec_last_confirmation_email', $timestamp); + + // Event ID + $event_id = get_post_meta($book_id, 'mec_event_id', true); + + $subject = isset($notif_settings['booking_confirmation']['subject']) ? esc_html__($notif_settings['booking_confirmation']['subject'], 'modern-events-calendar-lite') : esc_html__('Your booking is confirmed.', 'modern-events-calendar-lite'); + $subject = $this->content($this->get_subject($subject, 'booking_confirmation', $event_id, $book_id), $book_id); + + $headers = ['Content-Type: text/html; charset=UTF-8']; + + $recipients_str = $notif_settings['booking_confirmation']['recipients'] ?? ''; + $recipients = trim($recipients_str) ? explode(',', $recipients_str) : []; + + $users = $notif_settings['booking_confirmation']['receiver_users'] ?? []; + $users_down = $this->main->get_emails_by_users($users); + $recipients = array_merge($users_down, $recipients); + + $roles = $notif_settings['booking_confirmation']['receiver_roles'] ?? []; + $user_roles = $this->main->get_emails_by_roles($roles); + $recipients = array_merge($user_roles, $recipients); + + // Unique Recipients + $recipients = array_map('trim', $recipients); + $recipients = array_unique($recipients); + + // Recipient Type + $CCBCC = $this->get_cc_bcc_method(); + + foreach ($recipients as $recipient) + { + // Skip if it's not a valid email + if (trim($recipient) == '' or !filter_var($recipient, FILTER_VALIDATE_EMAIL)) continue; + + $headers[] = $CCBCC . ': ' . $recipient; + } + + // Attendees + $attendees = get_post_meta($book_id, 'mec_attendees', true); + if (!is_array($attendees) || !count($attendees)) $attendees = [get_post_meta($book_id, 'mec_attendee', true)]; + + // Do not send email twice! + $done_emails = []; + + // Changing some sender email info. + $this->mec_sender_email_notification_filter(); + + // Set Email Type to HTML + add_filter('wp_mail_content_type', [$this->main, 'html_email_type']); + + // Send the emails + foreach ($attendees as $attendee) + { + $to = $attendee['email'] ?? ''; + + if (!trim($to)) continue; + if (in_array($to, $done_emails) or !filter_var($to, FILTER_VALIDATE_EMAIL)) continue; + + $message = $notif_settings['booking_confirmation']['content'] ?? ''; + $message = $this->content($this->get_content($message, 'booking_confirmation', $event_id, $book_id), $book_id, $attendee); + + // Remove remained placeholders + $message = preg_replace('/%%.*%%/', '', $message); + + $message = $this->add_template($message); + + // Filter the email + $mail_arg = [ + 'to' => $to, + 'subject' => $subject, + 'message' => $message, + 'headers' => $headers, + 'attachments' => [], + ]; + + $mail_arg = apply_filters('mec_before_send_booking_confirmation', $mail_arg, $book_id, 'booking_confirmation'); + + // Send the mail + wp_mail($mail_arg['to'], html_entity_decode(stripslashes($mail_arg['subject']), ENT_HTML5), wpautop(stripslashes($mail_arg['message'])), $mail_arg['headers'], $mail_arg['attachments']); + + // Send One Single Email Only To First Attendee + if (isset($notif_settings['booking_confirmation']['send_single_one_email'])) break; + + // For prevention of email repeat send + $done_emails[] = $to; + } + + // Remove the HTML Email filter + remove_filter('wp_mail_content_type', [$this->main, 'html_email_type']); + + return true; + } + + /** + * Send booking cancellation + * @param int $book_id + * @return void + * @author Webnus + */ + public function booking_cancellation($book_id) + { + if (!$book_id) return; + + $cancellation_notification = apply_filters('mec_booking_cancellation', true); + if (!$cancellation_notification) return; + + $booker = $this->u->booking($book_id); + + // Notification Settings + $notif_settings = $this->get_notification_content($book_id); + + // Cancelling Notification is disabled + if (!isset($notif_settings['cancellation_notification']['status']) || !$notif_settings['cancellation_notification']['status']) return; + + $tos = []; + + // Send the notification to admin + if (isset($notif_settings['cancellation_notification']['send_to_admin']) and $notif_settings['cancellation_notification']['send_to_admin'] == 1) + { + $tos[] = get_bloginfo('admin_email'); + } + + // Send the notification to event organizer + if (isset($notif_settings['cancellation_notification']['send_to_organizer']) and $notif_settings['cancellation_notification']['send_to_organizer'] == 1) + { + $organizer_email = $this->get_booking_organizer_email($book_id); + if ($organizer_email !== false) $tos[] = trim($organizer_email); + } + + // Send the notification to additional organizers + if (isset($notif_settings['cancellation_notification']['send_to_additional_organizers']) and $notif_settings['cancellation_notification']['send_to_additional_organizers'] == 1) + { + $additional_organizer_emails = $this->get_booking_additional_organizers_emails($book_id); + if (is_array($additional_organizer_emails) and count($additional_organizer_emails)) + { + foreach ($additional_organizer_emails as $additional_organizer_email) $tos[] = trim($additional_organizer_email); + } + } + + // Send the notification to event user + if (isset($notif_settings['cancellation_notification']['send_to_user']) and $notif_settings['cancellation_notification']['send_to_user'] == 1) + { + if (isset($booker->user_email) and $booker->user_email) + { + // Attendees + $attendees = get_post_meta($book_id, 'mec_attendees', true); + if (!is_array($attendees) || !count($attendees)) $attendees = [get_post_meta($book_id, 'mec_attendee', true)]; + + // Prevent duplicate send + $done_emails = []; + + // Send the emails + foreach ($attendees as $attendee) + { + if (isset($attendee['email']) and !in_array($attendee['email'], $done_emails)) + { + $tos[] = $attendee; + $done_emails[] = $attendee['email']; + } + } + } + } + + // No Recipient + if (!count($tos)) return; + + $headers = ['Content-Type: text/html; charset=UTF-8']; + + $recipients_str = $notif_settings['cancellation_notification']['recipients'] ?? ''; + $recipients = trim($recipients_str) ? explode(',', $recipients_str) : []; + + $users = $notif_settings['cancellation_notification']['receiver_users'] ?? []; + $users_down = $this->main->get_emails_by_users($users); + $recipients = array_merge($users_down, $recipients); + + $roles = $notif_settings['cancellation_notification']['receiver_roles'] ?? []; + $user_roles = $this->main->get_emails_by_roles($roles); + $recipients = array_merge($user_roles, $recipients); + + // Unique Recipients + $recipients = array_map('trim', $recipients); + $recipients = array_unique($recipients); + + // Recipient Type + $CCBCC = $this->get_cc_bcc_method(); + + foreach ($recipients as $recipient) + { + // Skip if it's not a valid email + if (trim($recipient) == '' or !filter_var($recipient, FILTER_VALIDATE_EMAIL)) continue; + + $headers[] = $CCBCC . ': ' . $recipient; + } + + // Event ID + $event_id = get_post_meta($book_id, 'mec_event_id', true); + + $subject = isset($notif_settings['cancellation_notification']['subject']) ? esc_html__($notif_settings['cancellation_notification']['subject'], 'modern-events-calendar-lite') : esc_html__('booking canceled.', 'modern-events-calendar-lite'); + $subject = $this->content($this->get_subject($subject, 'cancellation_notification', $event_id, $book_id), $book_id); + + // Changing some sender email info. + $this->mec_sender_email_notification_filter(); + + // Set Email Type to HTML + add_filter('wp_mail_content_type', [$this->main, 'html_email_type']); + + // Send the mail + $i = 1; + foreach ($tos as $to) + { + $mailto = (is_array($to) and isset($to['email'])) ? $to['email'] : $to; + + if (!trim($mailto) or !filter_var($mailto, FILTER_VALIDATE_EMAIL)) continue; + if ($i > 1) $headers = ['Content-Type: text/html; charset=UTF-8']; + + $message = $notif_settings['cancellation_notification']['content'] ?? ''; + $message = $this->content($this->get_content($message, 'cancellation_notification', $event_id, $book_id), $book_id, (is_array($to) ? $to : null)); + + // Book Data + $message = str_replace('%%admin_link%%', $this->link(['post_type' => $this->main->get_book_post_type()], $this->main->URL('admin') . 'edit.php'), $message); + + // Remove remained placeholders + $message = preg_replace('/%%.*%%/', '', $message); + + $message = $this->add_template($message); + + // Filter the email + $mail_arg = [ + 'to' => $mailto, + 'subject' => $subject, + 'message' => $message, + 'headers' => $headers, + 'attachments' => [], + ]; + + $mail_arg = apply_filters('mec_before_send_booking_cancellation', $mail_arg, $book_id, 'booking_cancellation'); + + // Send the mail + wp_mail($mail_arg['to'], html_entity_decode(stripslashes($mail_arg['subject']), ENT_HTML5), wpautop(stripslashes($mail_arg['message'])), $mail_arg['headers'], $mail_arg['attachments']); + + $i++; + } + + // Remove the HTML Email filter + remove_filter('wp_mail_content_type', [$this->main, 'html_email_type']); + } + + /** + * Send booking rejection + * @param int $book_id + * @return void + * @author Webnus + */ + public function booking_rejection($book_id) + { + if (!$book_id) return; + + $rejection_notification = apply_filters('mec_booking_rejection', true); + if (!$rejection_notification) return; + + $booker = $this->u->booking($book_id); + + // Notification Settings + $notif_settings = $this->get_notification_content($book_id); + + // Rejection Notification is disabled + if (!isset($notif_settings['booking_rejection']['status']) || !$notif_settings['booking_rejection']['status']) return; + + $tos = []; + + // Send the notification to admin + if (isset($notif_settings['booking_rejection']['send_to_admin']) and $notif_settings['booking_rejection']['send_to_admin'] == 1) + { + $tos[] = get_bloginfo('admin_email'); + } + + // Send the notification to event organizer + if (isset($notif_settings['booking_rejection']['send_to_organizer']) and $notif_settings['booking_rejection']['send_to_organizer'] == 1) + { + $organizer_email = $this->get_booking_organizer_email($book_id); + if ($organizer_email !== false) $tos[] = trim($organizer_email); + } + + // Send the notification to additional organizers + if (isset($notif_settings['booking_rejection']['send_to_additional_organizers']) and $notif_settings['booking_rejection']['send_to_additional_organizers'] == 1) + { + $additional_organizer_emails = $this->get_booking_additional_organizers_emails($book_id); + if (is_array($additional_organizer_emails) and count($additional_organizer_emails)) + { + foreach ($additional_organizer_emails as $additional_organizer_email) $tos[] = trim($additional_organizer_email); + } + } + + // Send the notification to event user + if (isset($notif_settings['booking_rejection']['send_to_user']) and $notif_settings['booking_rejection']['send_to_user'] == 1) + { + if (isset($booker->user_email) and $booker->user_email) + { + // Attendees + $attendees = get_post_meta($book_id, 'mec_attendees', true); + if (!is_array($attendees) or !count($attendees)) $attendees = [get_post_meta($book_id, 'mec_attendee', true)]; + + // Prevent duplicate send + $done_emails = []; + + // Send the emails + foreach ($attendees as $attendee) + { + if (isset($attendee['email']) and !in_array($attendee['email'], $done_emails)) + { + $tos[] = $attendee; + $done_emails[] = $attendee['email']; + } + } + } + } + + // No Recipient + if (!count($tos)) return; + + $headers = ['Content-Type: text/html; charset=UTF-8']; + + $recipients_str = $notif_settings['booking_rejection']['recipients'] ?? ''; + $recipients = trim($recipients_str) ? explode(',', $recipients_str) : []; + + $users = $notif_settings['booking_rejection']['receiver_users'] ?? []; + $users_down = $this->main->get_emails_by_users($users); + $recipients = array_merge($users_down, $recipients); + + $roles = $notif_settings['booking_rejection']['receiver_roles'] ?? []; + $user_roles = $this->main->get_emails_by_roles($roles); + $recipients = array_merge($user_roles, $recipients); + + // Unique Recipients + $recipients = array_map('trim', $recipients); + $recipients = array_unique($recipients); + + // Recipient Type + $CCBCC = $this->get_cc_bcc_method(); + + foreach ($recipients as $recipient) + { + // Skip if it's not a valid email + if (trim($recipient) == '' or !filter_var($recipient, FILTER_VALIDATE_EMAIL)) continue; + + $headers[] = $CCBCC . ': ' . $recipient; + } + + // Event ID + $event_id = get_post_meta($book_id, 'mec_event_id', true); + + $subject = isset($notif_settings['booking_rejection']['subject']) ? esc_html__($notif_settings['booking_rejection']['subject'], 'modern-events-calendar-lite') : esc_html__('booking rejected.', 'modern-events-calendar-lite'); + $subject = $this->content($this->get_subject($subject, 'booking_rejection', $event_id, $book_id), $book_id); + + // Changing some sender email info. + $this->mec_sender_email_notification_filter(); + + // Set Email Type to HTML + add_filter('wp_mail_content_type', [$this->main, 'html_email_type']); + + // Send the mail + $i = 1; + foreach ($tos as $to) + { + $mailto = (is_array($to) and isset($to['email'])) ? $to['email'] : $to; + + if (!trim($mailto) or !filter_var($mailto, FILTER_VALIDATE_EMAIL)) continue; + if ($i > 1) $headers = ['Content-Type: text/html; charset=UTF-8']; + + $message = $notif_settings['booking_rejection']['content'] ?? ''; + $message = $this->content($this->get_content($message, 'booking_rejection', $event_id, $book_id), $book_id, (is_array($to) ? $to : null)); + + // Book Data + $message = str_replace('%%admin_link%%', $this->link(['post_type' => $this->main->get_book_post_type()], $this->main->URL('admin') . 'edit.php'), $message); + + // Remove remained placeholders + $message = preg_replace('/%%.*%%/', '', $message); + + $message = $this->add_template($message); + + // Filter the email + $mail_arg = [ + 'to' => $mailto, + 'subject' => $subject, + 'message' => $message, + 'headers' => $headers, + 'attachments' => [], + ]; + + $mail_arg = apply_filters('mec_before_send_booking_rejection', $mail_arg, $book_id, 'booking_rejection'); + + // Send the mail + wp_mail($mail_arg['to'], html_entity_decode(stripslashes($mail_arg['subject']), ENT_HTML5), wpautop(stripslashes($mail_arg['message'])), $mail_arg['headers'], $mail_arg['attachments']); + + $i++; + } + + // Remove the HTML Email filter + remove_filter('wp_mail_content_type', [$this->main, 'html_email_type']); + } + + /** + * Send admin notification + * @param int $book_id + * @return void + * @author Webnus + */ + public function admin_notification($book_id) + { + if (!$book_id) return; + + // Notification Settings + $notif_settings = $this->get_notification_content($book_id); + + // Admin Notification is disabled + if (isset($notif_settings['admin_notification']['status']) and !$notif_settings['admin_notification']['status']) return; + + // Event ID + $event_id = get_post_meta($book_id, 'mec_event_id', true); + + $to = get_bloginfo('admin_email'); + $subject = isset($notif_settings['admin_notification']['subject']) ? esc_html__($notif_settings['admin_notification']['subject'], 'modern-events-calendar-lite') : esc_html__('A new booking is received.', 'modern-events-calendar-lite'); + $subject = $this->content($this->get_subject($subject, 'admin_notification', $event_id, $book_id), $book_id); + + $headers = ['Content-Type: text/html; charset=UTF-8']; + + $recipients_str = $notif_settings['admin_notification']['recipients'] ?? ''; + $recipients = trim($recipients_str) ? explode(',', $recipients_str) : []; + + $users = $notif_settings['admin_notification']['receiver_users'] ?? []; + $users_down = $this->main->get_emails_by_users($users); + $recipients = array_merge($users_down, $recipients); + + $roles = $notif_settings['admin_notification']['receiver_roles'] ?? []; + $user_roles = $this->main->get_emails_by_roles($roles); + $recipients = array_merge($user_roles, $recipients); + + // Unique Recipients + $recipients = array_map('trim', $recipients); + $recipients = array_unique($recipients); + + // Don't send the email to admin + if (isset($notif_settings['admin_notification']['send_to_admin']) and !$notif_settings['admin_notification']['send_to_admin']) + { + if (count($recipients)) + { + $to = current($recipients); + unset($recipients[0]); + } + else if (isset($notif_settings['admin_notification']['send_to_organizer']) and $notif_settings['admin_notification']['send_to_organizer'] == 1) + { + $organizer_email = $this->get_booking_organizer_email($book_id); + if ($organizer_email !== false) $to = $organizer_email; + } + else return; + } + + // Recipient Type + $CCBCC = $this->get_cc_bcc_method(); + + foreach ($recipients as $recipient) + { + // Skip if it's not a valid email + if (trim($recipient) == '' or !filter_var($recipient, FILTER_VALIDATE_EMAIL)) continue; + + $headers[] = $CCBCC . ': ' . $recipient; + } + + // Send the notification to event organizer + if (isset($notif_settings['admin_notification']['send_to_organizer']) and $notif_settings['admin_notification']['send_to_organizer'] == 1) + { + $organizer_email = $this->get_booking_organizer_email($book_id); + if ($organizer_email !== false and $organizer_email != $to) $headers[] = $CCBCC . ': ' . trim($organizer_email); + } + + // Send the notification to additional organizers + if (isset($notif_settings['admin_notification']['send_to_additional_organizers']) and $notif_settings['admin_notification']['send_to_additional_organizers'] == 1) + { + $additional_organizer_emails = $this->get_booking_additional_organizers_emails($book_id); + if (is_array($additional_organizer_emails) and count($additional_organizer_emails)) + { + foreach ($additional_organizer_emails as $additional_organizer_email) + { + if ($additional_organizer_email != $to) $headers[] = $CCBCC . ': ' . trim($additional_organizer_email); + } + } + } + + $message = $notif_settings['admin_notification']['content'] ?? ''; + $message = $this->content($this->get_content($message, 'admin_notification', $event_id, $book_id), $book_id); + + // Book Data + $message = str_replace('%%admin_link%%', $this->link(['post_type' => $this->main->get_book_post_type()], $this->main->URL('admin') . 'edit.php'), $message); + + // Changing some sender email info. + $this->mec_sender_email_notification_filter(); + + // Set Email Type to HTML + add_filter('wp_mail_content_type', [$this->main, 'html_email_type']); + + // Remove remained placeholders + $message = preg_replace('/%%.*%%/', '', $message); + + $message = $this->add_template($message); + + // Filter the email + $mail_arg = [ + 'to' => $to, + 'subject' => $subject, + 'message' => $message, + 'headers' => $headers, + 'attachments' => [], + ]; + + $mail_arg = apply_filters('mec_before_send_admin_notification', $mail_arg, $book_id, 'admin_notification'); + + // Send the mail + wp_mail($mail_arg['to'], html_entity_decode(stripslashes($mail_arg['subject']), ENT_HTML5), wpautop(stripslashes($mail_arg['message'])), $mail_arg['headers'], $mail_arg['attachments']); + + // Remove the HTML Email filter + remove_filter('wp_mail_content_type', [$this->main, 'html_email_type']); + } + + /** + * Send booking reminder notification + * @param int $book_id + * @param string $timestamps + * @return boolean + * @author Webnus + */ + public function booking_reminder($book_id, $timestamps = null) + { + if (!$book_id) return false; + + $booker = $this->u->booking($book_id); + if (!isset($booker->user_email)) return false; + + // Notification Settings + $notif_settings = $this->get_notification_content($book_id); + + // Event ID + $event_id = get_post_meta($book_id, 'mec_event_id', true); + + $subject = isset($notif_settings['booking_reminder']['subject']) ? esc_html__($notif_settings['booking_reminder']['subject'], 'modern-events-calendar-lite') : esc_html__('Booking Reminder', 'modern-events-calendar-lite'); + $subject = $this->content($this->get_subject($subject, 'booking_reminder', $event_id, $book_id), $book_id); + + $headers = ['Content-Type: text/html; charset=UTF-8']; + + $recipients_str = $notif_settings['booking_reminder']['recipients'] ?? ''; + $recipients = trim($recipients_str) ? explode(',', $recipients_str) : []; + + $users = $notif_settings['booking_reminder']['receiver_users'] ?? []; + $users_down = $this->main->get_emails_by_users($users); + $recipients = array_merge($users_down, $recipients); + + $roles = $notif_settings['booking_reminder']['receiver_roles'] ?? []; + $user_roles = $this->main->get_emails_by_roles($roles); + $recipients = array_merge($user_roles, $recipients); + + // Unique Recipients + $recipients = array_map('trim', $recipients); + $recipients = array_unique($recipients); + + // Recipient Type + $CCBCC = $this->get_cc_bcc_method(); + + foreach ($recipients as $recipient) + { + // Skip if it's not a valid email + if (trim($recipient) == '' or !filter_var($recipient, FILTER_VALIDATE_EMAIL)) continue; + + $headers[] = $CCBCC . ': ' . $recipient; + } + + // Attendees + $attendees = get_post_meta($book_id, 'mec_attendees', true); + if (!is_array($attendees) or !count($attendees)) $attendees = [get_post_meta($book_id, 'mec_attendee', true)]; + + // Do not send email twice! + $done_emails = []; + + // Changing some sender email info. + $this->mec_sender_email_notification_filter(); + + // Set Email Type to HTML + add_filter('wp_mail_content_type', [$this->main, 'html_email_type']); + + // Send the emails + foreach ($attendees as $attendee) + { + if (isset($attendee[0]['MEC_TYPE_OF_DATA'])) continue; + + $to = $attendee['email'] ?? ''; + + if (!trim($to)) continue; + if (in_array($to, $done_emails) or !filter_var($to, FILTER_VALIDATE_EMAIL)) continue; + + $message = $notif_settings['booking_reminder']['content'] ?? ''; + + $message = str_replace('%%zoom_join%%', get_post_meta($event_id, 'mec_zoom_join_url', true), $message); + $message = str_replace('%%zoom_link%%', get_post_meta($event_id, 'mec_zoom_link_url', true), $message); + $message = str_replace('%%zoom_password%%', get_post_meta($event_id, 'mec_zoom_password', true), $message); + $message = str_replace('%%zoom_embed%%', get_post_meta($event_id, 'mec_zoom_embed', true), $message); + + $message = $this->content($this->get_content($message, 'booking_reminder', $event_id, $book_id), $book_id, $attendee, $timestamps); + + // Remove remained placeholders + $message = preg_replace('/%%.*%%/', '', $message); + + $message = $this->add_template($message); + + // Filter the email + $mail_arg = [ + 'to' => $to, + 'subject' => $subject, + 'message' => $message, + 'headers' => $headers, + 'attachments' => [], + ]; + + $mail_arg = apply_filters('mec_before_send_booking_reminder', $mail_arg, $book_id, 'booking_reminder'); + + // Send the mail + wp_mail($mail_arg['to'], html_entity_decode(stripslashes($mail_arg['subject']), ENT_HTML5), wpautop(stripslashes($mail_arg['message'])), $mail_arg['headers'], $mail_arg['attachments']); + + $done_emails[] = $to; + } + + // Remove the HTML Email filter + remove_filter('wp_mail_content_type', [$this->main, 'html_email_type']); + + return true; + } + + /** + * Send new event notification + * @param int $event_id + * @param boolean $update + * @return boolean + * @author Webnus + */ + public function new_event($event_id, $update = false) + { + if (!$event_id) return false; + + // If this is an autosave, our form has not been submitted, so we don't want to do anything. + if (defined('DOING_AUTOSAVE') and DOING_AUTOSAVE) return false; + + // MEC Event Post Type + $event_PT = $this->main->get_main_post_type(); + + // If it's not a MEC Event + if (get_post_type($event_id) != $event_PT) return false; + + // If it's an update request, then don't send any notification + if ($update) return false; + + // New event notification is disabled + if (!isset($this->notif_settings['new_event']['status']) or (isset($this->notif_settings['new_event']['status']) and !$this->notif_settings['new_event']['status'])) return false; + + $status = get_post_status($event_id); + + // Don't send the email if it is draft or an auto draft post + if ($status == 'auto-draft' or $status == 'draft') return false; + + $already_sent = get_post_meta($event_id, 'mec_new_event_notif_sent', true); + if ($already_sent) return false; + + $to = (!isset($this->notif_settings['new_event']['send_to_admin']) or (isset($this->notif_settings['new_event']['send_to_admin']) and $this->notif_settings['new_event']['send_to_admin'])) ? get_bloginfo('admin_email') : null; + + $disabled_send_notification_if_current_user_or_author_is_superadmin = isset($this->notif_settings['new_event']['disable_send_notification_if_current_user_or_author_is_admin']) && $this->notif_settings['new_event']['disable_send_notification_if_current_user_or_author_is_admin']; + if ($disabled_send_notification_if_current_user_or_author_is_superadmin && current_user_can('manage_options')) $to = null; + + $recipients_str = $this->notif_settings['new_event']['recipients'] ?? ''; + $recipients = trim($recipients_str) ? explode(',', $recipients_str) : []; + + $users = $this->notif_settings['new_event']['receiver_users'] ?? []; + $users_down = $this->main->get_emails_by_users($users); + $recipients = array_merge($users_down, $recipients); + + $roles = $this->notif_settings['new_event']['receiver_roles'] ?? []; + $user_roles = $this->main->get_emails_by_roles($roles); + $recipients = array_merge($user_roles, $recipients); + + // Unique Recipients + $recipients = array_map('trim', $recipients); + $recipients = array_unique($recipients); + + if (is_null($to) and !count($recipients)) return false; + else if (is_null($to)) + { + $to = current($recipients); + unset($recipients[0]); + } + + $subject = (isset($this->notif_settings['new_event']['subject']) and trim($this->notif_settings['new_event']['subject'])) ? esc_html__($this->notif_settings['new_event']['subject'], 'modern-events-calendar-lite') : esc_html__('A new event is added.', 'modern-events-calendar-lite'); + $subject = $this->get_subject($subject, 'new_event', $event_id); + + $headers = ['Content-Type: text/html; charset=UTF-8']; + + // Recipient Type + $CCBCC = $this->get_cc_bcc_method(); + + foreach ($recipients as $recipient) + { + // Skip if it's not a valid email + if (trim($recipient) == '' or !filter_var($recipient, FILTER_VALIDATE_EMAIL)) continue; + + $headers[] = $CCBCC . ': ' . $recipient; + } + + // Date Format + $date_format = get_option('date_format'); + + $message = (isset($this->notif_settings['new_event']['content']) and trim($this->notif_settings['new_event']['content'])) ? $this->notif_settings['new_event']['content'] : ''; + $message = $this->get_content($message, 'new_event', $event_id); + + // Site Data + $message = str_replace('%%blog_name%%', get_bloginfo('name'), $message); + $message = str_replace('%%blog_url%%', get_bloginfo('url'), $message); + $message = str_replace('%%blog_description%%', get_bloginfo('description'), $message); + + // Event Data + $message = str_replace('%%admin_link%%', $this->link(['post_type' => $event_PT], $this->main->URL('admin') . 'edit.php'), $message); + $message = str_replace('%%event_title%%', get_the_title($event_id), $message); + $message = str_replace('%%event_link%%', get_post_permalink($event_id), $message); + $message = str_replace('%%event_description%%', $this->main->get_raw_post_description($event_id), $message); + + $event_tags = get_the_terms($event_id, apply_filters('mec_taxonomy_tag', '')); + $message = str_replace('%%event_tags%%', (is_array($event_tags) ? join(', ', wp_list_pluck($event_tags, 'name')) : ''), $message); + + $event_labels = get_the_terms($event_id, 'mec_label'); + $message = str_replace('%%event_labels%%', (is_array($event_labels) ? join(', ', wp_list_pluck($event_labels, 'name')) : ''), $message); + + $event_categories = get_the_terms($event_id, 'mec_category'); + $message = str_replace('%%event_categories%%', (is_array($event_categories) ? join(', ', wp_list_pluck($event_categories, 'name')) : ''), $message); + + $mec_cost = get_post_meta($event_id, 'mec_cost', true); + $message = str_replace('%%event_cost%%', (is_numeric($mec_cost) ? $this->main->render_price($mec_cost, $event_id) : $mec_cost), $message); + + $message = str_replace('%%event_start_date%%', $this->main->date_i18n($date_format, strtotime(get_post_meta($event_id, 'mec_start_date', true))), $message); + $message = str_replace('%%event_end_date%%', $this->main->date_i18n($date_format, strtotime(get_post_meta($event_id, 'mec_end_date', true))), $message); + $message = str_replace('%%event_timezone%%', $this->main->get_timezone($event_id), $message); + $message = str_replace('%%event_note%%', get_post_meta($event_id, 'mec_note', true), $message); + + $status_obj = get_post_status_object($status); + $message = str_replace('%%event_status%%', (($status_obj and isset($status_obj->label)) ? $status_obj->label : $status), $message); + + // Data Fields + $event_fields = $this->main->get_event_fields(); + $event_fields_data = get_post_meta($event_id, 'mec_fields', true); + if (!is_array($event_fields_data)) $event_fields_data = []; + + foreach ($event_fields as $f => $event_field) + { + if (!is_numeric($f)) continue; + + $field_value = $event_fields_data[$f] ?? ''; + if ((!is_array($field_value) and trim($field_value) === '') or (is_array($field_value) and !count($field_value))) + { + $message = str_replace('%%event_field_' . $f . '%%', '', $message); + $message = str_replace('%%event_field_' . $f . '_with_name%%', '', $message); + + continue; + } + + $event_field_name = $event_field['label'] ?? ''; + if (is_array($field_value)) $field_value = implode(', ', $field_value); + + $message = str_replace('%%event_field_' . $f . '%%', trim($field_value, ', '), $message); + $message = str_replace('%%event_field_' . $f . '_with_name%%', trim((trim($event_field_name) ? $event_field_name . ': ' : '') . trim($field_value, ', ')), $message); + } + + $message = str_replace('%%zoom_join%%', get_post_meta($event_id, 'mec_zoom_join_url', true), $message); + $message = str_replace('%%zoom_link%%', get_post_meta($event_id, 'mec_zoom_link_url', true), $message); + $message = str_replace('%%zoom_password%%', get_post_meta($event_id, 'mec_zoom_password', true), $message); + $message = str_replace('%%zoom_embed%%', get_post_meta($event_id, 'mec_zoom_embed', true), $message); + + // Remove remained placeholders + $message = preg_replace('/%%.*%%/', '', $message); + + // Notification Subject + $subject = str_replace('%%event_title%%', get_the_title($event_id), $subject); + + // Changing some sender email info. + $this->mec_sender_email_notification_filter(); + + // Set Email Type to HTML + add_filter('wp_mail_content_type', [$this->main, 'html_email_type']); + + // Send the mail + wp_mail($to, html_entity_decode(stripslashes($subject), ENT_HTML5), wpautop(stripslashes($message)), $headers); + + // Remove the HTML Email filter + remove_filter('wp_mail_content_type', [$this->main, 'html_email_type']); + + update_post_meta($event_id, 'mec_new_event_notif_sent', 1); + + return true; + } + + /** + * Send suggest event notification + * + * @param array $attendee + * @param int $event_id + * @param int $book_id + * @return boolean + */ + public function suggest_event($attendee, $event_id, $book_id) + { + if (!is_array($attendee) || !count($attendee) || !$event_id || !$book_id) return false; + + // If it's not a MEC Event + if (get_post_type($event_id) != $this->main->get_main_post_type()) return false; + + $status = get_post_status($event_id); + + // Don't send the email if it is draft or an auto draft post + if ($status === 'auto-draft' || $status === 'draft') return false; + + // Recipient + $to = $attendee['email'] ?? ''; + + if (!is_email($to)) return false; + + $recipients_str = $this->notif_settings['suggest_event']['recipients'] ?? ''; + $recipients = trim($recipients_str) ? explode(',', $recipients_str) : []; + + $users = $this->notif_settings['suggest_event']['receiver_users'] ?? []; + $users_down = $this->main->get_emails_by_users($users); + $recipients = array_merge($users_down, $recipients); + + $roles = $this->notif_settings['suggest_event']['receiver_roles'] ?? []; + $user_roles = $this->main->get_emails_by_roles($roles); + $recipients = array_merge($user_roles, $recipients); + + // Unique Recipients + $recipients = array_map('trim', $recipients); + $recipients = array_unique($recipients); + + $subject = (isset($this->notif_settings['suggest_event']['subject']) and trim($this->notif_settings['suggest_event']['subject'])) ? esc_html__($this->notif_settings['suggest_event']['subject'], 'modern-events-calendar-lite') : esc_html__("Discover more events you'll love!", 'modern-events-calendar-lite'); + $subject = $this->get_subject($subject, 'suggest_event', $event_id); + + $message = (isset($this->notif_settings['suggest_event']['content']) and trim($this->notif_settings['suggest_event']['content'])) ? $this->notif_settings['suggest_event']['content'] : ''; + $message = $this->get_content($message, 'suggest_event', $event_id); + + if (trim($message) === '' || trim($subject) === '') return false; + + $headers = ['Content-Type: text/html; charset=UTF-8']; + + // Recipient Type + $CCBCC = $this->get_cc_bcc_method(); + + foreach ($recipients as $recipient) + { + // Skip if it's not a valid email + if (trim($recipient) == '' or !filter_var($recipient, FILTER_VALIDATE_EMAIL)) continue; + + $headers[] = $CCBCC . ': ' . $recipient; + } + + $start_timestamp = strtotime(get_post_meta($event_id, 'mec_start_datetime', true)); + $end_timestamp = strtotime(get_post_meta($event_id, 'mec_end_datetime', true)); + + $message = $this->content_event($message, $event_id, $start_timestamp, $end_timestamp); + + // Remove remained placeholders + $message = preg_replace('/%%.*%%/', '', $message); + + // Changing some sender email info. + $this->mec_sender_email_notification_filter(); + + // Set Email Type to HTML + add_filter('wp_mail_content_type', [$this->main, 'html_email_type']); + + // Send the mail + wp_mail($to, html_entity_decode(stripslashes($subject), ENT_HTML5), wpautop(stripslashes($message)), $headers); + + // Remove the HTML Email filter + remove_filter('wp_mail_content_type', [$this->main, 'html_email_type']); + + update_post_meta($event_id, 'mec_new_event_notif_sent', 1); + + return true; + } + + /** + * Send new event published notification + * @param string $new + * @param string $old + * @param WP_Post $post + * @return boolean + * @author Webnus + */ + public function user_event_publishing($new, $old, $post) + { + // MEC Event Post Type + $event_PT = $this->main->get_main_post_type(); + + // User event publishing notification is disabled + if (!isset($this->notif_settings['user_event_publishing']['status']) || !$this->notif_settings['user_event_publishing']['status']) return false; + + if ($new == 'publish' && $old != 'publish' && $post->post_type == $event_PT) + { + $email = get_post_meta($post->ID, 'fes_guest_email', true); + $owner = get_userdata($post->post_author); + + // Not Set Guest User Email + if (!trim($email) || !filter_var($email, FILTER_VALIDATE_EMAIL)) + { + $email = (is_object($owner) ? $owner->user_email : ''); + } + + if (!trim($email) || !filter_var($email, FILTER_VALIDATE_EMAIL)) return false; + + $guest_name = get_post_meta($post->ID, 'fes_guest_name', true); + if (!trim($guest_name)) $guest_name = $owner->first_name . ' ' . $owner->last_name; + + $to = $email; + $subject = (isset($this->notif_settings['user_event_publishing']['subject']) and trim($this->notif_settings['user_event_publishing']['subject'])) ? esc_html__($this->notif_settings['user_event_publishing']['subject'], 'modern-events-calendar-lite') : esc_html__('Your event is published.', 'modern-events-calendar-lite'); + $subject = $this->get_subject($subject, 'user_event_publishing', $post->ID); + + $headers = ['Content-Type: text/html; charset=UTF-8']; + + $recipients_str = $this->notif_settings['user_event_publishing']['recipients'] ?? ''; + $recipients = trim($recipients_str) ? explode(',', $recipients_str) : []; + + $users = $this->notif_settings['user_event_publishing']['receiver_users'] ?? []; + $users_down = $this->main->get_emails_by_users($users); + $recipients = array_merge($users_down, $recipients); + + $roles = $this->notif_settings['user_event_publishing']['receiver_roles'] ?? []; + $user_roles = $this->main->get_emails_by_roles($roles); + $recipients = array_merge($user_roles, $recipients); + + // Unique Recipients + $recipients = array_map('trim', $recipients); + $recipients = array_unique($recipients); + + // Recipient Type + $CCBCC = $this->get_cc_bcc_method(); + + foreach ($recipients as $recipient) + { + // Skip if it's not a valid email + if (trim($recipient) == '' or !filter_var($recipient, FILTER_VALIDATE_EMAIL)) continue; + + $headers[] = $CCBCC . ': ' . $recipient; + } + + $message = (isset($this->notif_settings['user_event_publishing']['content']) and trim($this->notif_settings['user_event_publishing']['content'])) ? $this->notif_settings['user_event_publishing']['content'] : ''; + $message = $this->get_content($message, 'user_event_publishing', $post->ID); + + // User Data + $message = str_replace('%%name%%', $guest_name, $message); + + // Site Data + $message = str_replace('%%blog_name%%', get_bloginfo('name'), $message); + $message = str_replace('%%blog_url%%', get_bloginfo('url'), $message); + $message = str_replace('%%blog_description%%', get_bloginfo('description'), $message); + + // Date Format + $date_format = get_option('date_format'); + + // Event Data + $message = str_replace('%%admin_link%%', $this->link(['post_type' => $event_PT], $this->main->URL('admin') . 'edit.php'), $message); + $message = str_replace('%%event_title%%', get_the_title($post->ID), $message); + $message = str_replace('%%event_description%%', $this->main->get_raw_post_description($post->ID), $message); + + $event_tags = get_the_terms($post->ID, apply_filters('mec_taxonomy_tag', '')); + $message = str_replace('%%event_tags%%', (is_array($event_tags) ? join(', ', wp_list_pluck($event_tags, 'name')) : ''), $message); + + $event_labels = get_the_terms($post->ID, 'mec_label'); + $message = str_replace('%%event_labels%%', (is_array($event_labels) ? join(', ', wp_list_pluck($event_labels, 'name')) : ''), $message); + + $event_categories = get_the_terms($post->ID, 'mec_category'); + $message = str_replace('%%event_categories%%', (is_array($event_categories) ? join(', ', wp_list_pluck($event_categories, 'name')) : ''), $message); + + $mec_cost = get_post_meta($post->ID, 'mec_cost', true); + $message = str_replace('%%event_cost%%', (is_numeric($mec_cost) ? $this->main->render_price($mec_cost, $post->ID) : $mec_cost), $message); + + $mec_start_date = get_post_meta($post->ID, 'mec_start_date', true); + $mec_end_date = get_post_meta($post->ID, 'mec_end_date', true); + + if (!$mec_start_date and !$mec_end_date) + { + $mec = isset($_POST['mec']) ? $this->main->sanitize_deep_array($_POST['mec']) : []; + + $mec_start_date = (isset($mec['date']) and isset($mec['date']['start']) and isset($mec['date']['start']['date']) and trim($mec['date']['start']['date'])) ? $this->main->standardize_format(sanitize_text_field($mec['date']['start']['date'])) : null; + $mec_end_date = (isset($mec['date']) and isset($mec['date']['end']) and isset($mec['date']['end']['date']) and trim($mec['date']['end']['date'])) ? $this->main->standardize_format(sanitize_text_field($mec['date']['end']['date'])) : null; + } + + $message = str_replace('%%event_link%%', get_post_permalink($post->ID), $message); + $message = str_replace('%%event_start_date%%', $this->main->date_i18n($date_format, $mec_start_date), $message); + $message = str_replace('%%event_end_date%%', $this->main->date_i18n($date_format, $mec_end_date), $message); + $message = str_replace('%%event_timezone%%', $this->main->get_timezone($post->ID), $message); + $message = str_replace('%%event_note%%', get_post_meta($post->ID, 'mec_note', true), $message); + + $status_obj = get_post_status_object($new); + $message = str_replace('%%event_status%%', (($status_obj and isset($status_obj->label)) ? $status_obj->label : $new), $message); + + // Data Fields + $event_fields = $this->main->get_event_fields(); + + $event_fields_data = get_post_meta($post->ID, 'mec_fields', true); + if (!is_array($event_fields_data)) $event_fields_data = []; + + foreach ($event_fields as $f => $event_field) + { + if (!is_numeric($f)) continue; + + $field_value = $event_fields_data[$f] ?? ''; + if (!is_array($field_value) and trim($field_value) === '') + { + $message = str_replace('%%event_field_' . $f . '%%', '', $message); + $message = str_replace('%%event_field_' . $f . '_with_name%%', '', $message); + + continue; + } + + $event_field_name = $event_field['label'] ?? ''; + if (is_array($field_value)) $field_value = implode(', ', $field_value); + + $message = str_replace('%%event_field_' . $f . '%%', trim($field_value, ', '), $message); + $message = str_replace('%%event_field_' . $f . '_with_name%%', trim((trim($event_field_name) ? $event_field_name . ': ' : '') . trim($field_value, ', ')), $message); + } + + $message = str_replace('%%zoom_join%%', get_post_meta($post->ID, 'mec_zoom_join_url', true), $message); + $message = str_replace('%%zoom_link%%', get_post_meta($post->ID, 'mec_zoom_link_url', true), $message); + $message = str_replace('%%zoom_password%%', get_post_meta($post->ID, 'mec_zoom_password', true), $message); + $message = str_replace('%%zoom_embed%%', get_post_meta($post->ID, 'mec_zoom_embed', true), $message); + + $message = apply_filters('mec_notifications_user_event_publishing_render_content', $message, $post->ID, $post, $new, $old); + + // Remove remained placeholders + $message = preg_replace('/%%.*%%/', '', $message); + + // Notification Subject + $subject = str_replace('%%event_title%%', get_the_title($post->ID), $subject); + $subject = apply_filters('mec_notifications_user_event_publishing_render_subject', $subject, $post->ID, $post, $new, $old); + + // Changing some sender email info. + $this->mec_sender_email_notification_filter(); + + // Set Email Type to HTML + add_filter('wp_mail_content_type', [$this->main, 'html_email_type']); + + // Send the mail + wp_mail($to, html_entity_decode(stripslashes($subject), ENT_HTML5), wpautop(stripslashes($message)), $headers); + + // Remove the HTML Email filter + remove_filter('wp_mail_content_type', [$this->main, 'html_email_type']); + } + + return true; + } + + public function event_soldout($event_id, $book_id) + { + if (!$book_id) return; + + $event_soldout = apply_filters('mec_event_soldout_notification', true); + if (!$event_soldout) return; + + // Event Soldout Notification is disabled + if (!isset($this->notif_settings['event_soldout']['status']) or (isset($this->notif_settings['event_soldout']['status']) and !$this->notif_settings['event_soldout']['status'])) return; + + $tos = []; + + // Send the notification to admin + if (isset($this->notif_settings['event_soldout']['send_to_admin']) and $this->notif_settings['event_soldout']['send_to_admin'] == 1) + { + $tos[] = get_bloginfo('admin_email'); + } + + // Send the notification to event organizer + if (isset($this->notif_settings['event_soldout']['send_to_organizer']) and $this->notif_settings['event_soldout']['send_to_organizer'] == 1) + { + $organizer_email = $this->get_booking_organizer_email($book_id); + if ($organizer_email !== false) $tos[] = trim($organizer_email); + } + + // Send the notification to additional organizers + if (isset($this->notif_settings['event_soldout']['send_to_additional_organizers']) and $this->notif_settings['event_soldout']['send_to_additional_organizers'] == 1) + { + $additional_organizer_emails = $this->get_booking_additional_organizers_emails($book_id); + if (is_array($additional_organizer_emails) and count($additional_organizer_emails)) + { + foreach ($additional_organizer_emails as $additional_organizer_email) $tos[] = trim($additional_organizer_email); + } + } + + // No Recipient + if (!count($tos)) return; + + $headers = ['Content-Type: text/html; charset=UTF-8']; + + $recipients_str = $this->notif_settings['event_soldout']['recipients'] ?? ''; + $recipients = trim($recipients_str) ? explode(',', $recipients_str) : []; + + $users = $this->notif_settings['event_soldout']['receiver_users'] ?? []; + $users_down = $this->main->get_emails_by_users($users); + $recipients = array_merge($users_down, $recipients); + + $roles = $this->notif_settings['event_soldout']['receiver_roles'] ?? []; + $user_roles = $this->main->get_emails_by_roles($roles); + $recipients = array_merge($user_roles, $recipients); + + // Unique Recipients + $recipients = array_map('trim', $recipients); + $recipients = array_unique($recipients); + + // Recipient Type + $CCBCC = $this->get_cc_bcc_method(); + + foreach ($recipients as $recipient) + { + // Skip if it's not a valid email + if (trim($recipient) == '' or !filter_var($recipient, FILTER_VALIDATE_EMAIL)) continue; + + $headers[] = $CCBCC . ': ' . $recipient; + } + + $subject = isset($this->notif_settings['event_soldout']['subject']) ? esc_html__($this->notif_settings['event_soldout']['subject'], 'modern-events-calendar-lite') : esc_html__('Event is soldout!', 'modern-events-calendar-lite'); + $subject = $this->content($this->get_subject($subject, 'event_soldout', $event_id, $book_id), $book_id); + + // Changing some sender email info. + $this->mec_sender_email_notification_filter(); + + // Set Email Type to HTML + add_filter('wp_mail_content_type', [$this->main, 'html_email_type']); + + // Send the mail + $i = 1; + foreach ($tos as $to) + { + $mailto = (is_array($to) and isset($to['email'])) ? $to['email'] : $to; + + if (!trim($mailto) or !filter_var($mailto, FILTER_VALIDATE_EMAIL)) continue; + if ($i > 1) $headers = ['Content-Type: text/html; charset=UTF-8']; + + $message = $this->notif_settings['event_soldout']['content'] ?? ''; + $message = $this->content($this->get_content($message, 'event_soldout', $event_id, $book_id), $book_id, (is_array($to) ? $to : null)); + + // Book Data + $message = str_replace('%%admin_link%%', $this->link(['post_type' => $this->main->get_book_post_type()], $this->main->URL('admin') . 'edit.php'), $message); + + // Remove remained placeholders + $message = preg_replace('/%%.*%%/', '', $message); + + $message = $this->add_template($message); + + // Filter the email + $mail_arg = [ + 'to' => $mailto, + 'subject' => $subject, + 'message' => $message, + 'headers' => $headers, + 'attachments' => [], + ]; + + $mail_arg = apply_filters('mec_before_send_event_soldout', $mail_arg, $book_id, 'event_soldout'); + + // Send the mail + wp_mail($mail_arg['to'], html_entity_decode(stripslashes($mail_arg['subject']), ENT_HTML5), wpautop(stripslashes($mail_arg['message'])), $mail_arg['headers'], $mail_arg['attachments']); + + $i++; + } + + // Remove the HTML Email filter + remove_filter('wp_mail_content_type', [$this->main, 'html_email_type']); + } + + public function event_finished($event_id, $timestamps) + { + if (!$event_id) return false; + + // Event Finished notification is disabled + if (!isset($this->notif_settings['event_finished']['status']) or (isset($this->notif_settings['event_finished']['status']) and !$this->notif_settings['event_finished']['status'])) return false; + + list($start_timestamp, $end_timestamp) = explode(':', $timestamps); + + // Attendees + $attendees = $this->main->get_event_attendees($event_id, $start_timestamp); + + // No Attendee + if (!is_array($attendees) or !count($attendees)) return false; + + $headers = ['Content-Type: text/html; charset=UTF-8']; + + $recipients_str = $this->notif_settings['event_finished']['recipients'] ?? ''; + $recipients = trim($recipients_str) ? explode(',', $recipients_str) : []; + + $users = $this->notif_settings['event_finished']['receiver_users'] ?? []; + $users_down = $this->main->get_emails_by_users($users); + $recipients = array_merge($users_down, $recipients); + + $roles = $this->notif_settings['event_finished']['receiver_roles'] ?? []; + $user_roles = $this->main->get_emails_by_roles($roles); + $recipients = array_merge($user_roles, $recipients); + + // Unique Recipients + $recipients = array_map('trim', $recipients); + $recipients = array_unique($recipients); + + // Recipient Type + $CCBCC = $this->get_cc_bcc_method(); + + foreach ($recipients as $recipient) + { + // Skip if it's not a valid email + if (trim($recipient) == '' or !filter_var($recipient, FILTER_VALIDATE_EMAIL)) continue; + + $headers[] = $CCBCC . ': ' . $recipient; + } + + // Changing some sender email info. + $this->mec_sender_email_notification_filter(); + + // Set Email Type to HTML + add_filter('wp_mail_content_type', [$this->main, 'html_email_type']); + + // Do not send email twice! + $done_emails = []; + + // Send the Emails + foreach ($attendees as $attendee) + { + // Book ID + $book_id = $attendee['book_id']; + + // To Address + $to = $attendee['email'] ?? ''; + + if (!trim($to)) continue; + if (in_array($to, $done_emails) or !filter_var($to, FILTER_VALIDATE_EMAIL)) continue; + + $subject = isset($this->notif_settings['event_finished']['subject']) ? esc_html__($this->notif_settings['event_finished']['subject'], 'modern-events-calendar-lite') : esc_html__('Thanks for your attention!', 'modern-events-calendar-lite'); + $subject = $this->content($this->get_subject($subject, 'event_finished', $event_id, $book_id), $book_id, $attendee, $timestamps); + + $message = $this->notif_settings['event_finished']['content'] ?? ''; + + $message = str_replace('%%zoom_join%%', get_post_meta($event_id, 'mec_zoom_join_url', true), $message); + $message = str_replace('%%zoom_link%%', get_post_meta($event_id, 'mec_zoom_link_url', true), $message); + $message = str_replace('%%zoom_password%%', get_post_meta($event_id, 'mec_zoom_password', true), $message); + $message = str_replace('%%zoom_embed%%', get_post_meta($event_id, 'mec_zoom_embed', true), $message); + + $message = $this->content($this->get_content($message, 'event_finished', $event_id, $book_id), $book_id, $attendee, $timestamps); + + // Remove remained placeholders + $message = preg_replace('/%%.*%%/', '', $message); + $message = $this->add_template($message); + + // Filter the email + $mail_arg = [ + 'to' => $to, + 'subject' => $subject, + 'message' => $message, + 'headers' => $headers, + 'attachments' => [], + ]; + + $mail_arg = apply_filters('mec_before_send_booking_reminder', $mail_arg, $book_id, 'booking_reminder'); + + // Send the mail + wp_mail($mail_arg['to'], html_entity_decode(stripslashes($mail_arg['subject']), ENT_HTML5), wpautop(stripslashes($mail_arg['message'])), $mail_arg['headers'], $mail_arg['attachments']); + + $done_emails[] = $to; + } + + // Remove the HTML Email filter + remove_filter('wp_mail_content_type', [$this->main, 'html_email_type']); + + return true; + } + + public function auto_email($book_id, $subject, $message, $timestamps = null) + { + if (!$book_id) return false; + + $booker = $this->u->booking($book_id); + if (!isset($booker->user_email)) return false; + + // Subject + $subject = $this->content($subject, $book_id); + + $headers = ['Content-Type: text/html; charset=UTF-8']; + + // Attendees + $attendees = get_post_meta($book_id, 'mec_attendees', true); + if (!is_array($attendees) || !count($attendees)) $attendees = [get_post_meta($book_id, 'mec_attendee', true)]; + + // Do not send email twice! + $done_emails = []; + + // Changing some sender email info. + $this->mec_sender_email_notification_filter(); + + // Set Email Type to HTML + add_filter('wp_mail_content_type', [$this->main, 'html_email_type']); + + // Send the emails + foreach ($attendees as $attendee) + { + if (isset($attendee[0]['MEC_TYPE_OF_DATA'])) continue; + + $to = $attendee['email'] ?? ''; + + if (!trim($to)) continue; + if (in_array($to, $done_emails) or !filter_var($to, FILTER_VALIDATE_EMAIL)) continue; + + // Message + $message = $this->content($message, $book_id, $attendee, $timestamps); + + // Remove remained placeholders + $message = preg_replace('/%%.*%%/', '', $message); + + // Add Template + $message = $this->add_template($message); + + // Filter the email + $mail_arg = [ + 'to' => $to, + 'subject' => $subject, + 'message' => $message, + 'headers' => $headers, + 'attachments' => [], + ]; + + $mail_arg = apply_filters('mec_before_send_auto_email', $mail_arg, $book_id, 'auto_email'); + + // Send the mail + wp_mail($mail_arg['to'], html_entity_decode(stripslashes($mail_arg['subject']), ENT_HTML5), wpautop(stripslashes($mail_arg['message'])), $mail_arg['headers'], $mail_arg['attachments']); + + $done_emails[] = $to; + } + + // Remove the HTML Email filter + remove_filter('wp_mail_content_type', [$this->main, 'html_email_type']); + + return true; + } + + /** + * @param $booking_attendee_id + * @param $template + * @return bool + */ + public function certificate_send($booking_attendee_id, $template) + { + if (!$booking_attendee_id) return false; + + $mec_book = $this->main->get_mec_attendee_record($booking_attendee_id); + if (!isset($mec_book->booking_id)) return false; + + $book_id = $mec_book->booking_id; + + $booker = $this->u->get($mec_book->user_id); + if (!isset($booker->user_email)) return false; + + // Notification Settings + $notif_settings = $this->get_notification_content($book_id); + + // Event ID + $event_id = get_post_meta($book_id, 'mec_event_id', true); + + // Subject + $subject = isset($notif_settings['certificate_send']['subject']) ? esc_html__($notif_settings['certificate_send']['subject'], 'modern-events-calendar-lite') : esc_html__('Download your certificate.', 'modern-events-calendar-lite'); + $subject = $this->content($this->get_subject($subject, 'certificate_send', $event_id, $book_id), $book_id); + + $headers = ['Content-Type: text/html; charset=UTF-8']; + + // Changing some sender email info. + $this->mec_sender_email_notification_filter(); + + // Set Email Type to HTML + add_filter('wp_mail_content_type', [$this->main, 'html_email_type']); + + // Message + $message = $notif_settings['certificate_send']['content'] ?? ''; + $message = $this->content($message, $book_id); + + $certificate_link = $this->main->get_certificate_link($booking_attendee_id, $template); + + // Certificate Link + $message = str_replace('%%certificate_link%%', $certificate_link, $message); + + // Remove remained placeholders + $message = preg_replace('/%%.*%%/', '', $message); + + // Add Template + $message = $this->add_template($message); + + // Filter the email + $mail_arg = [ + 'to' => $booker->user_email, + 'subject' => $subject, + 'message' => $message, + 'headers' => $headers, + 'attachments' => [], + ]; + + $mail_arg = apply_filters('mec_before_send_auto_email', $mail_arg, $book_id, 'auto_email'); + + // Send the mail + wp_mail($mail_arg['to'], html_entity_decode(stripslashes($mail_arg['subject']), ENT_HTML5), wpautop(stripslashes($mail_arg['message'])), $mail_arg['headers'], $mail_arg['attachments']); + + // Remove the HTML Email filter + remove_filter('wp_mail_content_type', [$this->main, 'html_email_type']); + + return true; + } + + public function booking_moved($book_id) + { + if (!$book_id) return false; + + $booker = $this->u->booking($book_id); + if (!isset($booker->user_email)) return false; + + // Notification Settings + $notif_settings = $this->get_notification_content($book_id); + + // Booking Moved is disabled + if (!isset($notif_settings['booking_moved']['status']) || !$notif_settings['booking_moved']['status']) return false; + + // Event ID + $event_id = get_post_meta($book_id, 'mec_event_id', true); + + $subject = isset($notif_settings['booking_moved']['subject']) ? esc_html__($notif_settings['booking_moved']['subject'], 'modern-events-calendar-lite') : esc_html__('Your booking has been rescheduled.', 'modern-events-calendar-lite'); + $subject = $this->content($this->get_subject($subject, 'booking_moved', $event_id, $book_id), $book_id); + + $headers = ['Content-Type: text/html; charset=UTF-8']; + + $recipients_str = $notif_settings['booking_moved']['recipients'] ?? ''; + $recipients = trim($recipients_str) ? explode(',', $recipients_str) : []; + + $users = $notif_settings['booking_moved']['receiver_users'] ?? []; + $users_down = $this->main->get_emails_by_users($users); + $recipients = array_merge($users_down, $recipients); + + $roles = $notif_settings['booking_moved']['receiver_roles'] ?? []; + $user_roles = $this->main->get_emails_by_roles($roles); + $recipients = array_merge($user_roles, $recipients); + + // Unique Recipients + $recipients = array_map('trim', $recipients); + $recipients = array_unique($recipients); + + // Recipient Type + $CCBCC = $this->get_cc_bcc_method(); + + foreach ($recipients as $recipient) + { + // Skip if it's not a valid email + if (trim($recipient) == '' or !filter_var($recipient, FILTER_VALIDATE_EMAIL)) continue; + + $headers[] = $CCBCC . ': ' . $recipient; + } + + // Attendees + $attendees = get_post_meta($book_id, 'mec_attendees', true); + if (!is_array($attendees) || !count($attendees)) $attendees = [get_post_meta($book_id, 'mec_attendee', true)]; + + // Do not send email twice! + $done_emails = []; + + // Changing some sender email info. + $this->mec_sender_email_notification_filter(); + + // Set Email Type to HTML + add_filter('wp_mail_content_type', [$this->main, 'html_email_type']); + + // Send the emails + foreach ($attendees as $attendee) + { + $to = $attendee['email'] ?? ''; + if (!trim($to) || in_array($to, $done_emails) || !filter_var($to, FILTER_VALIDATE_EMAIL)) continue; + + $message = $notif_settings['booking_moved']['content'] ?? ''; + + $prev_timestamps = get_post_meta($book_id, 'mec_date_prev', true); + $prev_datetime = $this->main->get_book_datetime_string($prev_timestamps, $event_id, $book_id); + + $message = str_replace('%%book_datetime_prev%%', $prev_datetime, $message); + + $message = $this->content($this->get_content($message, 'booking_moved', $event_id, $book_id), $book_id, $attendee); + + // Remove remained placeholders + $message = preg_replace('/%%.*%%/', '', $message); + + $message = $this->add_template($message); + + // Filter the email + $mail_arg = [ + 'to' => $to, + 'subject' => $subject, + 'message' => $message, + 'headers' => $headers, + 'attachments' => [], + ]; + + $mail_arg = apply_filters('mec_before_send_booking_moved', $mail_arg, $book_id, 'booking_moved'); + + // Send the mail + wp_mail($mail_arg['to'], html_entity_decode(stripslashes($mail_arg['subject']), ENT_HTML5), wpautop(stripslashes($mail_arg['message'])), $mail_arg['headers'], $mail_arg['attachments']); + + // For prevention of email repeat send + $done_emails[] = $to; + } + + // Remove the HTML Email filter + remove_filter('wp_mail_content_type', [$this->main, 'html_email_type']); + + return true; + } + + /** + * Generate a link based on parameters + * @param array $vars + * @param string $url + * @return string + * @author Webnus + */ + public function link($vars = [], $url = null) + { + if (!trim($url)) $url = $this->main->URL() . $this->main->get_main_slug() . '/'; + foreach ($vars as $key => $value) $url = $this->main->add_qs_var($key, $value, $url); + + return $url; + } + + /** + * Generate content of email + * @param string $message + * @param int $book_id + * @param array $attendee + * @param string $timestamps + * @return string + * @author Webnus + */ + public function content($message, $book_id, $attendee = [], $timestamps = '') + { + if (!$book_id) return false; + + // Disable Cache + $cache = $this->getCache(); + $cache->disable(); + + $booker = $this->u->booking($book_id); + $event_id = get_post_meta($book_id, 'mec_event_id', true); + + $first_name = isset($booker->first_name) ? $booker->first_name : ''; + $last_name = isset($booker->last_name) ? $booker->last_name : ''; + $name = (isset($booker->first_name) ? trim($booker->first_name . ' ' . (isset($booker->last_name) ? $booker->last_name : '')) : ''); + $email = (isset($booker->user_email) ? $booker->user_email : ''); + + // DB + $db = $this->getDB(); + + /** + * Get the data from Attendee instead of main booker user + */ + if (isset($attendee['name']) and trim($attendee['name'])) + { + $name = esc_html($attendee['name']); + $attendee_ex_name = explode(' ', $name); + + $first_name = $attendee_ex_name[0] ?? ''; + unset($attendee_ex_name[0]); + + $last_name = implode(' ', $attendee_ex_name); + $email = $attendee['email'] ?? $email; + } + + // Booker Data + $message = str_replace('%%first_name%%', $first_name, $message); + $message = str_replace('%%last_name%%', $last_name, $message); + $message = str_replace('%%name%%', $name, $message); + $message = str_replace('%%user_email%%', $email, $message); + $message = str_replace('%%user_id%%', ($booker->ID ?? ''), $message); + + // Site Data + $message = str_replace('%%blog_name%%', get_bloginfo('name'), $message); + $message = str_replace('%%blog_url%%', get_bloginfo('url'), $message); + $message = str_replace('%%blog_description%%', get_bloginfo('description'), $message); + + // Book Data + $transaction_id = get_post_meta($book_id, 'mec_transaction_id', true); + $transaction = $this->book->get_transaction($transaction_id); + + // Date & Time Format + $date_format = get_option('date_format'); + $time_format = get_option('time_format'); + + if (!trim($timestamps)) $timestamps = get_post_meta($book_id, 'mec_date', true); + list($start_timestamp, $end_timestamp) = explode(':', $timestamps); + + // Event Data + $message = $this->content_event($message, $event_id, $start_timestamp, $end_timestamp); + + // Book Date + if (trim($timestamps) and strpos($timestamps, ':') !== false) + { + if (trim($start_timestamp) != trim($end_timestamp) and date('Y-m-d', $start_timestamp) != date('Y-m-d', $end_timestamp)) + { + $book_date = sprintf(esc_html__('%s to %s', 'modern-events-calendar-lite'), $this->main->date_i18n($date_format, $start_timestamp), $this->main->date_i18n($date_format, $end_timestamp)); + } + else $book_date = get_the_date($date_format, $book_id); + } + else $book_date = get_the_date($date_format, $book_id); + + $message = str_replace('%%book_date%%', $book_date, $message); + + // Book Time + $event_start_time = $this->main->get_time($start_timestamp); + $event_end_time = $this->main->get_time($end_timestamp); + + $allday = get_post_meta($event_id, 'mec_allday', true); + $hide_time = get_post_meta($event_id, 'mec_hide_time', true); + $hide_end_time = $this->main->hide_end_time_status($event_id); + $event_time = $allday ? $this->main->m('all_day', esc_html__('All Day', 'modern-events-calendar-lite')) : (!$hide_end_time ? sprintf(esc_html__('%s to %s', 'modern-events-calendar-lite'), $event_start_time, $event_end_time) : $event_start_time); + + // Condition for check some parameter simple hide event time + if (!$hide_time) $message = str_replace('%%book_time%%', $event_time, $message); + else $message = str_replace('%%book_time%%', '', $message); + + // Book Date & Time + $book_datetime = $this->main->get_book_datetime_string($timestamps, $event_id, $book_id); + + $message = str_replace('%%book_datetime%%', $book_datetime, $message); + + // Other Date & Times + $other_dates = ((isset($transaction['other_dates']) and is_array($transaction['other_dates'])) ? $transaction['other_dates'] : []); + $other_dates_datetime = ''; + + foreach ($other_dates as $other_date) + { + list($other_start_timestamp, $other_end_timestamp) = explode(':', $other_date); + + if (trim($other_start_timestamp) != trim($other_end_timestamp)) $other_dates_datetime .= sprintf(esc_html__('%s to %s', 'modern-events-calendar-lite'), $this->main->date_i18n($date_format . ((!$allday and !$hide_time) ? ' ' . $time_format : ''), $other_start_timestamp), $this->main->date_i18n($date_format . ((!$allday and !$hide_time and !$hide_end_time) ? ' ' . $time_format : ''), $other_end_timestamp)) . "
        "; + else $other_dates_datetime .= $this->main->date_i18n($date_format . ((!$allday and !$hide_time) ? ' ' . $time_format : ''), $other_start_timestamp) . "
        "; + } + + $event_booking_options = get_post_meta($event_id, 'mec_booking', true); + if (!is_array($event_booking_options)) $event_booking_options = []; + + $book_all_occurrences = 0; + if (isset($event_booking_options['bookings_all_occurrences'])) $book_all_occurrences = (int) $event_booking_options['bookings_all_occurrences']; + + if ($book_all_occurrences && !trim($other_dates_datetime)) + { + $next_occurrences = $this->getRender()->dates($event_id, null, 10, date('Y-m-d', strtotime('-1 day', strtotime($start_timestamp)))); + foreach ($next_occurrences as $next_occurrence) + { + $other_dates_datetime .= $this->main->date_label($next_occurrence['start'], $next_occurrence['end'], $date_format . ' ' . $time_format, ' - ', false, 0, $event_id) . "
        "; + } + } + + $message = str_replace('%%book_other_datetimes%%', $other_dates_datetime, $message); + + // Order Time + $order_time = get_post_meta($book_id, 'mec_booking_time', true); + $message = str_replace('%%book_order_time%%', $this->main->date_i18n($date_format . ' ' . $time_format, strtotime($order_time)), $message); + + $message = str_replace('%%invoice_link%%', $this->book->get_invoice_link($transaction_id), $message); + + $cancellation_key = get_post_meta($book_id, 'mec_cancellation_key', true); + $cancellation_link = trim(get_permalink($event_id), '/') . '/cancel/' . $cancellation_key . '/'; + + $message = str_replace('%%cancellation_link%%', $cancellation_link, $message); + + // Booking Price + $price = get_post_meta($book_id, 'mec_price', true); + $message = str_replace('%%book_price%%', $this->main->render_price(($price ?: 0), $event_id), $message); + + // Booking Payable + $payable = get_post_meta($book_id, 'mec_payable', true); + $message = str_replace('%%book_payable%%', $this->main->render_price(($payable ?: 0), $event_id), $message); + + // Total Attendees + $message = str_replace('%%total_attendees%%', $this->book->get_total_attendees($book_id), $message); + + // Attendee Price + if (isset($attendee['email'])) + { + $attendee_price = $this->book->get_attendee_price($transaction, $attendee['email']); + $message = str_replace('%%attendee_price%%', $this->main->render_price(($attendee_price ?: $price), $event_id), $message); + } + + $mec_date = explode(':', get_post_meta($book_id, 'mec_date', true)); + + // Booked Tickets + if (count($mec_date) == 2 && isset($mec_date[0])) + { + $booked_tickets = $this->book->get_tickets_availability($event_id, $mec_date[0], 'reservation'); + $message = str_replace('%%amount_tickets%%', $booked_tickets, $message); + } + + // Attendee Full Information + if (strpos($message, '%%attendee_full_info%%') !== false || strpos($message, '%%attendees_full_info%%') !== false) + { + $attendees_full_info = $this->get_full_attendees_info($book_id); + + $message = str_replace('%%attendee_full_info%%', $attendees_full_info, $message); + $message = str_replace('%%attendees_full_info%%', $attendees_full_info, $message); + } + + // Ticket Variations + if (isset($attendee['variations']) and is_array($attendee['variations']) and count($attendee['variations'])) + { + $ticket_variations = $this->main->ticket_variations($event_id, $attendee['id']); + + $ticket_variations_str = ''; + foreach ($attendee['variations'] as $variation_id => $count) + { + if (!isset($ticket_variations[$variation_id])) continue; + + $title = $ticket_variations[$variation_id]['title'] ?? ''; + $ticket_variations_str .= $title . ': ' . $count . "
        "; + + $message = str_replace('%%ticket_variations_' . $variation_id . '_title%%', $title, $message); + $message = str_replace('%%ticket_variations_' . $variation_id . '_count%%', (int) $count, $message); + } + + $message = str_replace('%%ticket_variations%%', $ticket_variations_str, $message); + } + + // Booking IDs + $message = str_replace('%%booking_id%%', $book_id, $message); + $message = str_replace('%%booking_transaction_id%%', $transaction_id, $message); + + // Payment Gateway + $message = str_replace('%%payment_gateway%%', get_post_meta($book_id, 'mec_gateway_label', true), $message); + + // Booking Fixed Fields + $bfixed_fields = $this->main->get_bfixed_fields($event_id); + $all_bfixed_fields = ''; + + if (is_array($bfixed_fields) and count($bfixed_fields) and isset($transaction['fields']) and is_array($transaction['fields']) and count($transaction['fields'])) + { + foreach ($bfixed_fields as $b => $bfixed_field) + { + if (!is_numeric($b)) continue; + + $bfixed_field_name = $bfixed_field['label'] ?? ''; + $bfixed_value = $transaction['fields'][$b] ?? ''; + + if (is_array($bfixed_value)) $bfixed_value = implode(', ', $bfixed_value); + if (trim($bfixed_value) === '') continue; + + $name_and_value = trim((trim($bfixed_field_name) ? stripslashes($bfixed_field_name) . ': ' : '') . trim(stripslashes($bfixed_value), ', ')); + $all_bfixed_fields .= $name_and_value . "
        "; + + $message = str_replace('%%booking_field_' . $b . '%%', trim(stripslashes($bfixed_value), ', '), $message); + $message = str_replace('%%booking_field_' . $b . '_with_name%%', $name_and_value, $message); + } + } + + // All Booking Fields + $message = str_replace('%%all_bfixed_fields%%', $all_bfixed_fields, $message); + + $local_timezone = get_post_meta($book_id, 'mec_local_timezone', true); + if (is_string($local_timezone) and trim($local_timezone)) + { + $gmt_offset_seconds = $this->main->get_gmt_offset_seconds(date('Y-m-d', $start_timestamp), $event_id); + $gmt_start_time = strtotime(date('Y-m-d H:i:s', $start_timestamp)) - $gmt_offset_seconds; + $gmt_end_time = strtotime(date('Y-m-d H:i:s', $end_timestamp)) - $gmt_offset_seconds; + + $user_timezone = new DateTimeZone($local_timezone); + $gmt_timezone = new DateTimeZone('GMT'); + $gmt_datetime = new DateTime(date('Y-m-d H:i:s', $gmt_start_time), $gmt_timezone); + $offset = $user_timezone->getOffset($gmt_datetime); + + $user_start_time = $gmt_start_time + $offset; + $user_end_time = $gmt_end_time + $offset; + + $message = str_replace('%%event_start_date_local%%', $this->main->date_i18n($date_format, $user_start_time), $message); + $message = str_replace('%%event_end_date_local%%', $this->main->date_i18n($date_format, $user_end_time), $message); + $message = str_replace('%%event_start_time_local%%', date_i18n($time_format, $user_start_time), $message); + $message = str_replace('%%event_end_time_local%%', date_i18n($time_format, $user_end_time), $message); + } + else + { + $message = str_replace('%%event_start_date_local%%', 'N/A', $message); + $message = str_replace('%%event_end_date_local%%', 'N/A', $message); + $message = str_replace('%%event_start_time_local%%', 'N/A', $message); + $message = str_replace('%%event_end_time_local%%', 'N/A', $message); + } + + $ticket_names = []; + $ticket_times = []; + $ticket_private_descriptions = []; + + $ticket_ids_str = get_post_meta($book_id, 'mec_ticket_id', true); + $tickets = get_post_meta($event_id, 'mec_tickets', true); + + $ticket_ids = explode(',', $ticket_ids_str); + $ticket_ids = array_filter($ticket_ids); + + if (!is_array($tickets)) $tickets = []; + + foreach ($ticket_ids as $value) + { + foreach ($tickets as $ticket => $ticket_info) + { + if ($ticket != $value) continue; + + $ticket_names[] = $ticket_info['name']; + $ticket_private_descriptions[] = $ticket_info['private_description'] ?? ''; + + $ticket_start_hour = $ticket_info['ticket_start_time_hour'] ?? ''; + $ticket_start_minute = $ticket_info['ticket_start_time_minute'] ?? ''; + $ticket_start_ampm = $ticket_info['ticket_start_time_ampm'] ?? ''; + $ticket_end_hour = $ticket_info['ticket_end_time_hour'] ?? ''; + $ticket_end_minute = $ticket_info['ticket_end_time_minute'] ?? ''; + $ticket_end_ampm = $ticket_info['ticket_end_time_ampm'] ?? ''; + + $ticket_start_minute_s = $ticket_start_minute; + $ticket_end_minute_s = $ticket_end_minute; + + if ($ticket_start_minute == '0') $ticket_start_minute_s = '00'; + if ($ticket_start_minute == '5') $ticket_start_minute_s = '05'; + if ($ticket_end_minute == '0') $ticket_end_minute_s = '00'; + if ($ticket_end_minute == '5') $ticket_end_minute_s = '05'; + + $ticket_start_seconds = $this->main->time_to_seconds($this->main->to_24hours($ticket_start_hour, $ticket_start_ampm), $ticket_start_minute_s); + $ticket_end_seconds = $this->main->time_to_seconds($this->main->to_24hours($ticket_end_hour, $ticket_end_ampm), $ticket_end_minute_s); + + $ticket_times[] = $this->main->get_time($ticket_start_seconds) . ' ' . esc_html__('to', 'modern-events-calendar-lite') . ' ' . $this->main->get_time($ticket_end_seconds); + } + } + + // Private Description + $private_description_status = (!isset($this->settings['booking_private_description']) || $this->settings['booking_private_description']); + + $ticket_times = array_unique($ticket_times); + $message = str_replace('%%ticket_time%%', implode(',', $ticket_times), $message); + $message = str_replace('%%ticket_name%%', implode(',', $ticket_names), $message); + + if ($private_description_status) $message = str_replace('%%ticket_private_description%%', implode(',', array_unique($ticket_private_descriptions)), $message); + + $ticket_name_time = ''; + foreach ($ticket_names as $t_i => $ticket_name) + { + $ticket_name_time .= $ticket_name . (isset($ticket_times[$t_i]) ? ' (' . $ticket_times[$t_i] . '), ' : ', '); + } + + $message = str_replace('%%ticket_name_time%%', trim($ticket_name_time, ', '), $message); + + $gmt_offset_seconds = $this->main->get_gmt_offset_seconds($start_timestamp, $event_id); + $event_title = get_the_title($event_id); + $event_info = get_post($event_id); + $event_content = trim($event_info->post_content) ? strip_shortcodes(strip_tags($event_info->post_content)) : $event_title; + $event_content = apply_filters('mec_add_content_to_export_google_calendar_details', $event_content, $event_id); + + $location_id = $this->main->get_master_location_id($event_id, $start_timestamp); + $google_calendar_location = get_term_meta($location_id, 'address', true); + + // Recurring Rules + $rrule = $this->main->get_ical_rrules($event_id, true); + + $google_calendar_link = '' . esc_html__('+ Add to Google Calendar', 'modern-events-calendar-lite') . ''; + $ical_export_link = '' . esc_html__('+ iCal / Outlook export', 'modern-events-calendar-lite') . ''; + + $message = str_replace('%%google_calendar_link%%', $google_calendar_link, $message); + $message = str_replace('%%ics_link%%', $ical_export_link, $message); + + // Next Occurrences + $next_occurrences = $db->select("SELECT `tstart`, `tend` FROM `#__mec_dates` WHERE `post_id`='" . $event_id . "' AND `tstart`>='" . $start_timestamp . "' ORDER BY `tstart` ASC LIMIT 20", 'loadAssocList'); + + $google_calendar_links = ''; + $book_date_next_occurrences = ''; + $book_datetime_next_occurrences = ''; + + // Occurrences + foreach ($next_occurrences as $next_occurrence) + { + // Book Date + if (isset($next_occurrence['tstart']) and trim($next_occurrence['tstart']) and isset($next_occurrence['tend']) and trim($next_occurrence['tend'])) + { + if (trim($next_occurrence['tstart']) != trim($next_occurrence['tend'])) + { + $book_date_next_occurrences .= sprintf(esc_html__('%s to %s', 'modern-events-calendar-lite'), $this->main->date_i18n($date_format, $next_occurrence['tstart']), $this->main->date_i18n($date_format, $next_occurrence['tend'])) . '
        '; + $book_datetime_next_occurrences .= sprintf(esc_html__('%s to %s', 'modern-events-calendar-lite'), $this->main->date_i18n($date_format . ((!$allday and !$hide_time) ? ' ' . $time_format : ''), $next_occurrence['tstart']), $this->main->date_i18n($date_format . ((!$allday and !$hide_time and !$hide_end_time) ? ' ' . $time_format : ''), $next_occurrence['tend'])) . '
        '; + } + else + { + $book_date_next_occurrences .= $this->main->date_i18n($date_format, $next_occurrence['tstart']) . '
        '; + $book_datetime_next_occurrences .= $this->main->date_i18n($date_format . ((!$allday and !$hide_time) ? ' ' . $time_format : ''), $next_occurrence['tstart']) . '
        '; + } + } + else + { + $book_date_next_occurrences .= $this->main->date_i18n($date_format, $next_occurrence['tstart']) . '
        '; + $book_datetime_next_occurrences .= $this->main->date_i18n($date_format . ((!$allday and !$hide_time) ? ' ' . $time_format : ''), $next_occurrence['tstart']) . '
        '; + } + + $google_calendar_links .= '' . sprintf(esc_html__('+ %s to Google Calendar', 'modern-events-calendar-lite'), date($date_format . ' ' . $time_format, $next_occurrence['tstart'])) . '
        '; + } + + $message = str_replace('%%google_calendar_link_next_occurrences%%', $google_calendar_links, $message); + $message = str_replace('%%book_date_next_occurrences%%', $book_date_next_occurrences, $message); + $message = str_replace('%%book_datetime_next_occurrences%%', $book_datetime_next_occurrences, $message); + + // Downloadable File + $dl_file = $this->book->get_dl_file_link($book_id); + $message = str_replace('%%dl_file%%', $dl_file, $message); + + // Enable Cache + $cache->enable(); + + return apply_filters('mec_render_message_email', $message, $book_id, $attendee, $timestamps); + } + + public function content_event($message, $event_id, $start_timestamp, $end_timestamp) + { + // Occurrence Params + $params = MEC_feature_occurrences::param($event_id, $start_timestamp, '*'); + + // Date & Time Format + $date_format = get_option('date_format'); + $time_format = get_option('time_format'); + + // Event Data + $organizer_id = $this->main->get_master_organizer_id($event_id, $start_timestamp); + $location_id = $this->main->get_master_location_id($event_id, $start_timestamp); + $speaker_id = wp_get_post_terms($event_id, 'mec_speaker', ''); + + $organizer = get_term($organizer_id, 'mec_organizer'); + $location = get_term($location_id, 'mec_location'); + + // Data Fields + $event_fields = $this->main->get_event_fields(); + $event_fields_data = get_post_meta($event_id, 'mec_fields', true); + if (!is_array($event_fields_data)) $event_fields_data = []; + + foreach ($event_fields as $f => $event_field) + { + if (!is_numeric($f)) continue; + + $event_field_name = $event_field['label'] ?? ''; + $field_value = $event_fields_data[$f] ?? ''; + if ((!is_array($field_value) and trim($field_value) === '') or (is_array($field_value) and !count($field_value))) + { + $message = str_replace('%%event_field_' . $f . '%%', '', $message); + $message = str_replace('%%event_field_' . $f . '_with_name%%', '', $message); + + continue; + } + + if (is_array($field_value)) $field_value = implode(', ', $field_value); + + $message = str_replace('%%event_field_' . $f . '%%', trim(stripslashes($field_value), ', '), $message); + $message = str_replace('%%event_field_' . $f . '_with_name%%', trim((trim($event_field_name) ? stripslashes($event_field_name) . ': ' : '') . trim(stripslashes($field_value), ', ')), $message); + } + + $message = str_replace('%%event_title%%', get_the_title($event_id), $message); + $message = str_replace('%%event_description%%', $this->main->get_raw_post_description($event_id), $message); + + $event_tags = get_the_terms($event_id, apply_filters('mec_taxonomy_tag', '')); + $message = str_replace('%%event_tags%%', (is_array($event_tags) ? join(', ', wp_list_pluck($event_tags, 'name')) : ''), $message); + + $event_labels = get_the_terms($event_id, 'mec_label'); + $message = str_replace('%%event_labels%%', (is_array($event_labels) ? join(', ', wp_list_pluck($event_labels, 'name')) : ''), $message); + + $event_categories = get_the_terms($event_id, 'mec_category'); + $message = str_replace('%%event_categories%%', (is_array($event_categories) ? join(', ', wp_list_pluck($event_categories, 'name')) : ''), $message); + + $mec_cost = get_post_meta($event_id, 'mec_cost', true); + $mec_cost = (isset($params['cost']) and trim($params['cost']) != '') ? preg_replace("/[^0-9.]/", '', $params['cost']) : $mec_cost; + + $read_more = get_post_meta($event_id, 'mec_read_more', true); + $read_more = (isset($params['read_more']) and trim($params['read_more']) != '') ? $params['read_more'] : $read_more; + + $more_info = get_post_meta($event_id, 'mec_more_info', true); + $more_info = (isset($params['more_info']) and trim($params['more_info']) != '') ? $params['more_info'] : $more_info; + + $event_link = $this->main->get_event_date_permalink(get_permalink($event_id), date('Y-m-d', $start_timestamp)); + + // Add Time + $repeat_type = get_post_meta($event_id, 'mec_repeat_type', true); + if ($repeat_type === 'custom_days') $event_link = $this->main->add_qs_var('time', $start_timestamp, $event_link); + + $message = str_replace('%%event_cost%%', (is_numeric($mec_cost) ? $this->main->render_price($mec_cost, $event_id) : $mec_cost), $message); + $message = str_replace('%%event_link%%', $event_link, $message); + $message = str_replace('%%event_more_info%%', esc_url($read_more), $message); + $message = str_replace('%%event_other_info%%', esc_url($more_info), $message); + $message = str_replace('%%event_start_date%%', $this->main->date_i18n($date_format, $start_timestamp), $message); + $message = str_replace('%%event_end_date%%', $this->main->date_i18n($date_format, $end_timestamp), $message); + $message = str_replace('%%event_start_time%%', date_i18n($time_format, $start_timestamp), $message); + $message = str_replace('%%event_end_time%%', date_i18n($time_format, $end_timestamp), $message); + $message = str_replace('%%event_timezone%%', $this->main->get_timezone($event_id), $message); + + $online_link = MEC_feature_occurrences::param($event_id, $start_timestamp, 'moved_online_link', get_post_meta($event_id, 'mec_moved_online_link', true)); + $message = str_replace('%%online_link%%', esc_url($online_link), $message); + + $featured_image = ''; + $thumbnail_url = $this->main->get_post_thumbnail_url($event_id, 'medium'); + if (trim($thumbnail_url)) $featured_image = ''; + + $message = str_replace('%%event_featured_image%%', $featured_image, $message); + + $message = str_replace('%%event_organizer_name%%', ($organizer->name ?? ''), $message); + $message = str_replace('%%event_organizer_tel%%', get_term_meta($organizer_id, 'tel', true), $message); + $message = str_replace('%%event_organizer_email%%', get_term_meta($organizer_id, 'email', true), $message); + $message = str_replace('%%event_organizer_url%%', get_term_meta($organizer_id, 'url', true), $message); + + $additional_organizers_name = ''; + $additional_organizers_tel = ''; + $additional_organizers_email = ''; + $additional_organizers_url = ''; + + $additional_organizers_ids = get_post_meta($event_id, 'mec_additional_organizer_ids', true); + if (!is_array($additional_organizers_ids)) $additional_organizers_ids = []; + + foreach ($additional_organizers_ids as $additional_organizers_id) + { + $additional_organizer = get_term($additional_organizers_id, 'mec_organizer'); + if (isset($additional_organizer->name)) + { + $additional_organizers_name .= $additional_organizer->name . ', '; + $additional_organizers_tel .= get_term_meta($additional_organizers_id, 'tel', true) . '
        '; + $additional_organizers_email .= get_term_meta($additional_organizers_id, 'email', true) . '
        '; + $additional_organizers_url .= get_term_meta($additional_organizers_id, 'url', true) . '
        '; + } + } + + $message = str_replace('%%event_other_organizers_name%%', trim($additional_organizers_name, ', '), $message); + $message = str_replace('%%event_other_organizers_tel%%', trim($additional_organizers_tel, ', '), $message); + $message = str_replace('%%event_other_organizers_email%%', trim($additional_organizers_email, ', '), $message); + $message = str_replace('%%event_other_organizers_url%%', trim($additional_organizers_url, ', '), $message); + + $speaker_name = []; + foreach ($speaker_id as $speaker) $speaker_name[] = $speaker->name ?? null; + + $message = str_replace('%%event_speaker_name%%', (isset($speaker_name) ? implode(', ', $speaker_name) : ''), $message); + $message = str_replace('%%event_location_name%%', ($location->name ?? get_term_meta($location_id, 'address', true)), $message); + $message = str_replace('%%event_location_address%%', get_term_meta($location_id, 'address', true), $message); + + $additional_locations_name = ''; + $additional_locations_address = ''; + + $additional_locations_ids = get_post_meta($event_id, 'mec_additional_location_ids', true); + if (!is_array($additional_locations_ids)) $additional_locations_ids = []; + + foreach ($additional_locations_ids as $additional_locations_id) + { + $additional_location = get_term($additional_locations_id, 'mec_location'); + if (isset($additional_location->name)) + { + $additional_locations_name .= $additional_location->name . ', '; + $additional_locations_address .= get_term_meta($additional_locations_id, 'address', true) . '
        '; + } + } + + $message = str_replace('%%event_other_locations_name%%', trim($additional_locations_name, ', '), $message); + $message = str_replace('%%event_other_locations_address%%', trim($additional_locations_address, ', '), $message); + + $message = str_replace('%%zoom_join%%', get_post_meta($event_id, 'mec_zoom_join_url', true), $message); + $message = str_replace('%%zoom_link%%', get_post_meta($event_id, 'mec_zoom_link_url', true), $message); + $message = str_replace('%%zoom_password%%', get_post_meta($event_id, 'mec_zoom_password', true), $message); + return str_replace('%%zoom_embed%%', get_post_meta($event_id, 'mec_zoom_embed', true), $message); + } + + /** + * Get Booking Organizer Email by Book ID + * @param int $book_id + * @return string + * @author Webnus + */ + public function get_booking_organizer_email($book_id) + { + $event_id = get_post_meta($book_id, 'mec_event_id', true); + $mec_date = explode(':', get_post_meta($book_id, 'mec_date', true)); + + $organizer_id = $this->main->get_master_organizer_id($event_id, $mec_date[0]); + $email = get_term_meta($organizer_id, 'email', true); + + return trim($email) ? $email : false; + } + + /** + * Get Emails of Additional Organizers + * @param int $book_id + * @return array + * @author Webnus + */ + public function get_booking_additional_organizers_emails($book_id) + { + $event_id = get_post_meta($book_id, 'mec_event_id', true); + + $organizer_ids = get_post_meta($event_id, 'mec_additional_organizer_ids', true); + if (!is_array($organizer_ids)) $organizer_ids = []; + + $emails = []; + + $organizer_ids = array_unique($organizer_ids); + foreach ($organizer_ids as $organizer_id) + { + $email = get_term_meta($organizer_id, 'email', true); + if ($email and is_email($email)) $emails[] = $email; + } + + return array_unique($emails); + } + + /** + * Get full attendees info + * @param $book_id + * @return string + */ + public function get_full_attendees_info($book_id) + { + $attendees_full_info = ''; + + $attendees = get_post_meta($book_id, 'mec_attendees', true); + if (!is_array($attendees) || !count($attendees)) $attendees = [get_post_meta($book_id, 'mec_attendee', true)]; + + $event_id = get_post_meta($book_id, 'mec_event_id', true); + $reg_fields = $this->main->get_reg_fields($event_id); + $reg_fields = apply_filters('mec_notification_reg_fields', $reg_fields, $event_id, $book_id); + + $attachments = (isset($attendees['attachments']) and is_array($attendees['attachments'])) ? $attendees['attachments'] : []; + $attachment_field = []; + if (count($attachments)) + { + foreach ($reg_fields as $reg_field_id => $reg_field) + { + if (!is_numeric($reg_field_id)) continue; + if ($reg_field['type'] !== 'file') continue; + + $attachment_field = $reg_field; + break; + } + } + + foreach ($attendees as $key => $attendee) + { + if ($key === 'attachments') continue; + + $reg_form = $attendee['reg'] ?? []; + + $attendees_full_info .= esc_html__('Name', 'modern-events-calendar-lite') . ': ' . ((isset($attendee['name']) and trim($attendee['name'])) ? esc_html($attendee['name']) : '---') . "\r\n"; + $attendees_full_info .= esc_html__('Email', 'modern-events-calendar-lite') . ': ' . ((isset($attendee['email']) and trim($attendee['email'])) ? $attendee['email'] : '---') . "\r\n"; + + if (is_array($reg_form) and count($reg_form)) + { + foreach ($reg_form as $field_id => $value) + { + // Placeholder Keys + if (!is_numeric($field_id)) continue; + + $reg_fields = apply_filters('mec_booking_notification_reg_fields', $reg_fields, $field_id); + + $type = $reg_fields[$field_id]['type']; + + $label = isset($reg_fields[$field_id]) ? $reg_fields[$field_id]['label'] : ''; + if (trim($label) == '') continue; + + if ($type == 'agreement') + { + $label = sprintf(esc_html__($label, 'modern-events-calendar-lite'), '' . get_the_title($reg_fields[$field_id]['page']) . ''); + $attendees_full_info .= $label . ': ' . ($value == '1' ? esc_html__('Yes', 'modern-events-calendar-lite') : esc_html__('No', 'modern-events-calendar-lite')) . "\r\n"; + } + else + { + $attendees_full_info .= esc_html__($label, 'modern-events-calendar-lite') . ': ' . (is_string($value) ? $value : (is_array($value) ? implode(', ', $value) : '---')) . "\r\n"; + } + } + } + + $attendees_full_info .= "\r\n"; + } + + // Attachment + if (count($attachments)) + { + $attendees_full_info .= esc_html__($attachment_field['label'], 'modern-events-calendar-lite') . ': ' . esc_url($attachments[0]['url']) . '' . "\r\n"; + } + + return $attendees_full_info; + } + + /** + * Add filters for sender name and sender email + */ + public function mec_sender_email_notification_filter() + { + // MEC Notification Sender Email + add_filter('wp_mail_from_name', [$this, 'notification_sender_name']); + add_filter('wp_mail_from', [$this, 'notification_sender_email']); + } + + /** + * Change Notification Sender Name + * @param string $sender_name + * @return string + */ + public function notification_sender_name($sender_name) + { + return (isset($this->settings['booking_sender_name']) and trim($this->settings['booking_sender_name'])) ? stripslashes(trim($this->settings['booking_sender_name'])) : $sender_name; + } + + /** + * Change Notification Sender Email + * @param string $sender_email + * @return string + */ + public function notification_sender_email($sender_email) + { + return (isset($this->settings['booking_sender_email']) and trim($this->settings['booking_sender_email'])) ? trim($this->settings['booking_sender_email']) : $sender_email; + } + + /** + * Add template to the email content + * @param string $content + * @return string + */ + public function add_template($content) + { + // MEC Template is disabled + if (isset($this->settings['notif_template_disable']) and $this->settings['notif_template_disable']) return apply_filters('mec_email_template', $content); + + $style = $this->main->get_styling(); + $bg = $style['notification_bg'] ?? '#f6f6f6'; + + return ' + + + +
        +
        + ' . MEC_kses::page($content) . ' +
        +
        '; + } + + /** + * Get notification subject + * @param $value + * @param $notification_key + * @param $event_id + * @param $book_id + * @return mixed + */ + public function get_subject($value, $notification_key, $event_id, $book_id = null) + { + // Translated Event + if ($book_id) + { + $transaction_id = get_post_meta($book_id, 'mec_transaction_id', true); + $transaction = $this->book->get_transaction($transaction_id); + + // Use Translated Event for Content & Subject + if (isset($transaction['translated_event_id']) && $transaction['translated_event_id'] && $transaction['translated_event_id'] != $event_id) $event_id = $transaction['translated_event_id']; + } + + $custom_subject = apply_filters('mec_notification_get_subject', '', $notification_key, $event_id); + if (!empty($custom_subject)) return $custom_subject; + + $values = get_post_meta($event_id, 'mec_notifications', true); + if (!is_array($values) or !count($values)) return $value; + + $notification = $values[$notification_key] ?? []; + + if (!is_array($notification) or !count($notification)) return $value; + if (!isset($notification['status']) or !$notification['status']) return $value; + + return ((isset($notification['subject']) and trim($notification['subject'])) ? $notification['subject'] : $value); + } + + /** + * Get Notification Content + * @param $value + * @param $notification_key + * @param $event_id + * @param $book_id + * @return mixed + */ + public function get_content($value, $notification_key, $event_id, $book_id = null) + { + // Translated Event + if ($book_id) + { + $transaction_id = get_post_meta($book_id, 'mec_transaction_id', true); + $transaction = $this->book->get_transaction($transaction_id); + + // Use Translated Event for Content & Subject + if (isset($transaction['translated_event_id']) && $transaction['translated_event_id'] && $transaction['translated_event_id'] != $event_id) $event_id = $transaction['translated_event_id']; + } + + $custom_message = apply_filters('mec_notification_get_content', '', $notification_key, $event_id); + if (!empty($custom_message)) return $custom_message; + + $values = get_post_meta($event_id, 'mec_notifications', true); + if (!is_array($values) or !count($values)) return $value; + + $notification = $values[$notification_key] ?? []; + + if (!is_array($notification) or !count($notification)) return $value; + if (!isset($notification['status']) or !$notification['status']) return $value; + + return ((isset($notification['content']) and trim($notification['content'])) ? $notification['content'] : $value); + } + + /** + * @return string + */ + public function get_cc_bcc_method() + { + return ((isset($this->settings['booking_recipients_method']) and trim($this->settings['booking_recipients_method'])) ? strtoupper($this->settings['booking_recipients_method']) : 'BCC'); + } + + public function get_notification_content($book_id = '') + { + $locale = null; + if (trim($book_id)) $locale = get_post_meta($book_id, 'mec_locale', true); + + return $this->main->get_notifications($locale); + } +} diff --git a/app/libraries/parser.php b/app/libraries/parser.php new file mode 100755 index 0000000..bf72431 --- /dev/null +++ b/app/libraries/parser.php @@ -0,0 +1,261 @@ + + */ +class MEC_parser extends MEC_base +{ + public $main; + public $render; + public $settings; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // MEC main library + $this->main = $this->getMain(); + + // MEC render library + $this->render = $this->getRender(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + } + + /** + * A wrapper function for getting WP_Query object + * @author Webnus + * @global object $wp_query + * @return object + */ + public function get_wp_query() + { + global $wp_query; + return $wp_query; + } + + /** + * load MEC Rewrite Rules + * @author Webnus + * @param WP_Rewrite $wp_rewrite + */ + public function load_rewrites(WP_Rewrite $wp_rewrite) + { + // Don't add rewrite rules if archive page of MEC is disabled + if(!$this->main->get_archive_status()) return; + + if(!$wp_rewrite instanceof WP_Rewrite) + { + global $wp_rewrite; + } + + $rules = $this->get_rewrite_rules(); + $wp_rewrite->rules = $rules + $wp_rewrite->rules; + } + + public function get_rewrite_rules() + { + // MEC main slug + $slug = $this->main->get_main_slug(); + + // MEC main post type name + $PT = $this->main->get_main_post_type(); + + return array( + // '(?:'.$slug.')/(\d{4}-\d{2})/?$'=>'index.php?post_type='.$PT.'&MecDisplay=month&MecDate=$matches[1]', + // '(?:'.$slug.')/(?:yearly)/?$'=>'index.php?post_type='.$PT.'&MecDisplay=year', + // '(?:'.$slug.')/(?:monthly)/?$'=>'index.php?post_type='.$PT.'&MecDisplay=month', + // '(?:'.$slug.')/(?:weekly)/?$'=>'index.php?post_type='.$PT.'&MecDisplay=week', + // '(?:'.$slug.')/(?:daily)/?$'=>'index.php?post_type='.$PT.'&MecDisplay=day', + // '(?:'.$slug.')/(?:timetable)/?$'=>'index.php?post_type='.$PT.'&MecDisplay=timetable', + // '(?:'.$slug.')/(?:map)/?$'=>'index.php?post_type='.$PT.'&MecDisplay=map', + // '(?:'.$slug.')/(?:list)/?$'=>'index.php?post_type='.$PT.'&MecDisplay=list', + // '(?:'.$slug.')/(?:grid)/?$'=>'index.php?post_type='.$PT.'&MecDisplay=grid', + // '(?:'.$slug.')/(?:agenda)/?$'=>'index.php?post_type='.$PT.'&MecDisplay=agenda', + // '(?:'.$slug.')/(?:masonry)/?$'=>'index.php?post_type='.$PT.'&MecDisplay=masonry', + '(?:'.$slug.')/?$'=>'index.php?post_type='.$PT.'&MecDisplay=default', + '(?:'.$slug.')/(feed|rdf|rss|rss2|atom)/?$'=>'index.php?post_type='.$PT.'&feed=$matches[1]', + ); + } + + /** + * Adds MEC query vars to the WordPress + * @author Webnus + * @param array $qvars + * @return array + */ + public function add_query_vars($qvars) + { + $qvars[] = 'MecDisplay'; + $qvars[] = 'MecMethod'; + $qvars[] = 'MecDate'; + + return $qvars; + } + + /** + * @author Webnus + * @param object $query + */ + public function WPQ_parse($query) + { + // MEC Archive Page + if($query->get('MecDisplay') != '') + { + $query->MEC_archive = true; + $query->MEC_single = false; + + $query->set('posts_per_page', 1); + } + } + + /** + * @author Webnus + * @param string $template + * @return string + */ + public function template($template) + { + // We're in an embed post + if(is_embed()) return $template; + + $PT = $this->main->get_main_post_type(); + if(is_single() && get_post_type() == $PT) + { + // Block Themes + if(function_exists('wp_is_block_theme') && wp_is_block_theme()) + { + add_filter('the_content', [$this, 'block_theme_single_content']); + + return $template; + } + + $template = locate_template('single-'.$PT.'.php'); + if($template == '') $template = MEC_ABSPATH.'templates'.DS.'single-mec-events.php'; + } + elseif(is_post_type_archive($PT) && !is_search()) + { + // Block Themes + if(function_exists('wp_is_block_theme') && wp_is_block_theme()) + { + return $template; + } + + $template = locate_template('archive-'.$PT.'.php'); + if($template == '') $template = MEC_ABSPATH.'templates'.DS.'archive-mec-events.php'; + + add_action('mec_before_main_content', function() + { + // MEC factory library + $factory = $this->getFactory(); + + $factory->filter('the_content', [$this, 'archive_content']); + $factory->filter('mec_archive_title', [$this, 'archive_title']); + $factory->filter('post_thumbnail_html', [$this, 'archive_thumbnail']); + }); + } + elseif(is_tax('mec_category')) + { + // Block Themes + if(function_exists('wp_is_block_theme') && wp_is_block_theme()) + { + return $template; + } + + $template = locate_template('taxonomy-mec-category.php'); + if($template == '') $template = MEC_ABSPATH.'templates'.DS.'taxonomy-mec-category.php'; + } + + return $template; + } + + /** + * @author Webnus + * @param string $content + * @return string|boolean + */ + public function archive_content($content) + { + // only run it once + remove_filter('the_content', array($this, 'archive_content')); + + // WP_Query + $wp_query = $this->get_wp_query(); + + if($wp_query->get('MecDisplay') == 'list') return $this->render->vlist(); + elseif($wp_query->get('MecDisplay') == 'grid') return $this->render->vgrid(); + elseif($wp_query->get('MecDisplay') == 'agenda') return $this->render->vagenda(); + elseif($wp_query->get('MecDisplay') == 'month') return $this->render->vmonth(); + elseif($wp_query->get('MecDisplay') == 'year') return $this->render->vyear(); + elseif($wp_query->get('MecDisplay') == 'week') return $this->render->vweek(); + elseif($wp_query->get('MecDisplay') == 'day') return $this->render->vday(); + elseif($wp_query->get('MecDisplay') == 'timetable') return $this->render->vtimetable(); + elseif($wp_query->get('MecDisplay') == 'masonry') return $this->render->vmasonry(); + elseif($wp_query->get('MecDisplay') == 'map') return $this->render->vmap(); + elseif($wp_query->get('MecDisplay') == 'default') return $this->render->vdefault(); + + return false; + } + + /** + * @author Webnus + * @param string $title + * @return string + */ + public function archive_title($title) + { + // only run it once + remove_filter('mec_archive_title', [$this, 'archive_title']); + + return $this->main->get_archive_title(false); + } + + /** + * @author Webnus + * @param string $html + * @return string + */ + public function archive_thumbnail($html) + { + // only run it once + remove_filter('post_thumbnail_html', [$this, 'archive_thumbnail']); + + return $this->main->get_archive_thumbnail(); + } + + /** + * @author Webnus + * @param string $content + * @return string + */ + public function single_content($content) + { + // MEC Single Page + if(!is_singular($this->main->get_main_post_type())) return $content; + + $event_id = get_the_ID(); + return $this->render->vsingle(['id'=>$event_id, 'content'=>$content]); + } + + public function archive_document_title($title) + { + if(is_post_type_archive($this->main->get_main_post_type()) && !is_search()) + { + return $this->main->get_archive_title(); + } + + return $title; + } + + public function block_theme_single_content($content) + { + remove_filter('the_content', [$this, 'block_theme_single_content']); + return $this->single_content($content); + } +} \ No newline at end of file diff --git a/app/libraries/partial.php b/app/libraries/partial.php new file mode 100755 index 0000000..21e0623 --- /dev/null +++ b/app/libraries/partial.php @@ -0,0 +1,112 @@ + + */ +class MEC_partial extends MEC_base +{ + /** + * @var MEC_main + */ + public $main; + + /** + * @var array + */ + public $settings; + + public function __construct() + { + // Import MEC Main + $this->main = $this->getMain(); + + // General Options + $this->settings = $this->main->get_settings(); + } + + public function is_enabled() + { + return isset($this->settings['booking_partial_payment']) && $this->settings['booking_partial_payment']; + } + + public function is_payable_per_event_enabled() + { + return $this->is_enabled() && isset($this->settings['booking_payable_per_event']) && $this->settings['booking_payable_per_event']; + } + + public function is_fes_pp_section_enabled() + { + return $this->is_payable_per_event_enabled() && (!isset($this->settings['fes_section_booking_pp']) || $this->settings['fes_section_booking_pp']); + } + + /** + * @param $payable + * @param string $type + * @return array + */ + public function validate_payable_options($payable, $type) + { + // Payable Type Validation + if(!in_array($type, ['percent', 'amount'])) $type = 'percent'; + + // Payable Validation + if($type === 'percent') + { + $payable = (int) $payable; + $payable = max(1, min($payable, 100)); + } + else $payable = max(1, $payable); + + return [$payable, $type]; + } + + /** + * @param int $total + * @param int $event_id + * @return int + */ + public function calculate($total, $event_id) + { + list($payable_amount, $payable_type) = $this->get_validated_payable_options($event_id); + + $payable = $total; + if($payable_type === 'percent') + { + $payable = $total * ($payable_amount / 100); + } + elseif($payable_type === 'amount') + { + $payable = min($total, $payable_amount); + } + + return $payable; + } + + /** + * Get Payable Options + * @param int $event_id + * @return array + */ + public function get_validated_payable_options($event_id) + { + // Global Options + $payable = $this->settings['booking_payable'] ?? 100; + $payable_type = $this->settings['booking_payable_type'] ?? 'percent'; + + $booking_options = get_post_meta($event_id, 'mec_booking', true); + if(!is_array($booking_options)) $booking_options = []; + + // Event Options + $payable_inherit = !isset($booking_options['bookings_payable_inherit']) || $booking_options['bookings_payable_inherit']; + if(!$payable_inherit) + { + if(isset($booking_options['bookings_payable']) && trim($booking_options['bookings_payable']) !== '') $payable = $booking_options['bookings_payable']; + if(isset($booking_options['bookings_payable_type']) && trim($booking_options['bookings_payable_type']) !== '') $payable_type = $booking_options['bookings_payable_type']; + } + + return $this->validate_payable_options($payable, $payable_type); + } +} \ No newline at end of file diff --git a/app/libraries/qrcode.php b/app/libraries/qrcode.php new file mode 100755 index 0000000..b770f15 --- /dev/null +++ b/app/libraries/qrcode.php @@ -0,0 +1,3224 @@ + + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + + + +/* + * Version: 1.1.4 + * Build: 2010100721 + */ + +/* + * PHP QR Code encoder + * + * Common constants + * + * Based on libqrencode C library distributed under LGPL 2.1 + * Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi + * + * PHP QR Code is distributed under LGPL 3 + * Copyright (C) 2010 Dominik Dzienia + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +// Encoding modes + +define('QR_MODE_NUL', -1); +define('QR_MODE_NUM', 0); +define('QR_MODE_AN', 1); +define('QR_MODE_8', 2); +define('QR_MODE_KANJI', 3); +define('QR_MODE_STRUCTURE', 4); + +// Levels of error correction. + +define('QR_ECLEVEL_L', 0); +define('QR_ECLEVEL_M', 1); +define('QR_ECLEVEL_Q', 2); +define('QR_ECLEVEL_H', 3); + +// Supported output formats + +define('QR_FORMAT_TEXT', 0); +define('QR_FORMAT_PNG', 1); + +class qrstr { + public static function set(&$srctab, $x, $y, $repl, $replLen = false) { + $srctab[$y] = substr_replace($srctab[$y], ($replLen !== false)?substr($repl,0,$replLen):$repl, $x, ($replLen !== false)?$replLen:strlen($repl)); + } +} + +/* + * PHP QR Code encoder + * + * Config file, tuned-up for merged verion + */ + +define('QR_CACHEABLE', false); // use cache - more disk reads but less CPU power, masks and format templates are stored there +define('QR_CACHE_DIR', false); // used when QR_CACHEABLE === true +define('QR_LOG_DIR', false); // default error logs dir + +define('QR_FIND_BEST_MASK', true); // if true, estimates best mask (spec. default, but extremally slow; set to false to significant performance boost but (propably) worst quality code +define('QR_FIND_FROM_RANDOM', 2); // if false, checks all masks available, otherwise value tells count of masks need to be checked, mask id are got randomly +define('QR_DEFAULT_MASK', 2); // when QR_FIND_BEST_MASK === false + +define('QR_PNG_MAXIMUM_SIZE', 1024); // maximum allowed png image width (in pixels), tune to make sure GD and PHP can handle such big images + +/* + * PHP QR Code encoder + * + * Toolset, handy and debug utilites. + * + * PHP QR Code is distributed under LGPL 3 + * Copyright (C) 2010 Dominik Dzienia + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +class QRtools { + + //---------------------------------------------------------------------- + public static function binarize($frame) + { + $len = count($frame); + foreach ($frame as &$frameLine) { + + for($i=0; $i<$len; $i++) { + $frameLine[$i] = (ord($frameLine[$i])&1)?'1':'0'; + } + } + + return $frame; + } + + //---------------------------------------------------------------------- + public function tcpdfBarcodeArray($code, $mode = 'QR,L', $tcPdfVersion = '4.5.037') + { + $barcode_array = []; + + if (!is_array($mode)) + $mode = explode(',', $mode); + + $eccLevel = 'L'; + + if (count($mode) > 1) { + $eccLevel = $mode[1]; + } + + $qrTab = QRcode::text($code, false, $eccLevel); + $size = count($qrTab); + + $barcode_array['num_rows'] = $size; + $barcode_array['num_cols'] = $size; + $barcode_array['bcode'] = []; + + foreach ($qrTab as $line) { + $arrAdd = []; + foreach(str_split($line) as $char) + $arrAdd[] = ($char=='1')?1:0; + $barcode_array['bcode'][] = $arrAdd; + } + + return $barcode_array; + } + + //---------------------------------------------------------------------- + public function clearCache() + { + self::$frames = []; + } + + //---------------------------------------------------------------------- + public function buildCache() + { + QRtools::markTime('before_build_cache'); + + $mask = new QRmask(); + for ($a=1; $a <= QRSPEC_VERSION_MAX; $a++) { + $frame = QRspec::newFrame($a); + if (QR_IMAGE) { + $fileName = QR_CACHE_DIR.'frame_'.$a.'.png'; + QRimage::png(self::binarize($frame), $fileName, 1, 0); + } + + $width = count($frame); + $bitMask = array_fill(0, $width, array_fill(0, $width, 0)); + for ($maskNo=0; $maskNo<8; $maskNo++) + $mask->makeMaskNo($maskNo, $width, $frame, $bitMask, true); + } + + QRtools::markTime('after_build_cache'); + } + + //---------------------------------------------------------------------- + public static function log($outfile, $err) + { + if (QR_LOG_DIR !== false) { + if ($err != '') { + $err = date('Y-m-d H:i:s').': '.$err; + if ($outfile !== false) { + MEC_file::write(QR_LOG_DIR.basename($outfile).'-errors.txt', $err); + } else { + MEC_file::write(QR_LOG_DIR.'errors.txt', $err); + } + } + } + } + + //---------------------------------------------------------------------- + public function dumpMask($frame) + { + $width = count($frame); + for($y=0;$y<$width;$y++) { + for($x=0;$x<$width;$x++) { + echo ord($frame[$y][$x]).','; + } + } + } + + //---------------------------------------------------------------------- + public static function markTime($markerId) + { + list($usec, $sec) = explode(" ", microtime()); + $time = ((float)$usec + (float)$sec); + + if (!isset($GLOBALS['qr_time_bench'])) + $GLOBALS['qr_time_bench'] = []; + + $GLOBALS['qr_time_bench'][$markerId] = $time; + } + +} + +//########################################################################## + +QRtools::markTime('start'); + +/* + * PHP QR Code encoder + * + * QR Code specifications + * + * Based on libqrencode C library distributed under LGPL 2.1 + * Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi + * + * PHP QR Code is distributed under LGPL 3 + * Copyright (C) 2010 Dominik Dzienia + * + * The following data / specifications are taken from + * "Two dimensional symbol -- QR-code -- Basic Specification" (JIS X0510:2004) + * or + * "Automatic identification and data capture techniques -- + * QR Code 2005 bar code symbology specification" (ISO/IEC 18004:2006) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +define('QRSPEC_VERSION_MAX', 40); +define('QRSPEC_WIDTH_MAX', 177); + +define('QRCAP_WIDTH', 0); +define('QRCAP_WORDS', 1); +define('QRCAP_REMINDER', 2); +define('QRCAP_EC', 3); + +class QRspec { + + public static $capacity = array( + array( 0, 0, 0, array( 0, 0, 0, 0)), + array( 21, 26, 0, array( 7, 10, 13, 17)), // 1 + array( 25, 44, 7, array( 10, 16, 22, 28)), + array( 29, 70, 7, array( 15, 26, 36, 44)), + array( 33, 100, 7, array( 20, 36, 52, 64)), + array( 37, 134, 7, array( 26, 48, 72, 88)), // 5 + array( 41, 172, 7, array( 36, 64, 96, 112)), + array( 45, 196, 0, array( 40, 72, 108, 130)), + array( 49, 242, 0, array( 48, 88, 132, 156)), + array( 53, 292, 0, array( 60, 110, 160, 192)), + array( 57, 346, 0, array( 72, 130, 192, 224)), //10 + array( 61, 404, 0, array( 80, 150, 224, 264)), + array( 65, 466, 0, array( 96, 176, 260, 308)), + array( 69, 532, 0, array( 104, 198, 288, 352)), + array( 73, 581, 3, array( 120, 216, 320, 384)), + array( 77, 655, 3, array( 132, 240, 360, 432)), //15 + array( 81, 733, 3, array( 144, 280, 408, 480)), + array( 85, 815, 3, array( 168, 308, 448, 532)), + array( 89, 901, 3, array( 180, 338, 504, 588)), + array( 93, 991, 3, array( 196, 364, 546, 650)), + array( 97, 1085, 3, array( 224, 416, 600, 700)), //20 + array(101, 1156, 4, array( 224, 442, 644, 750)), + array(105, 1258, 4, array( 252, 476, 690, 816)), + array(109, 1364, 4, array( 270, 504, 750, 900)), + array(113, 1474, 4, array( 300, 560, 810, 960)), + array(117, 1588, 4, array( 312, 588, 870, 1050)), //25 + array(121, 1706, 4, array( 336, 644, 952, 1110)), + array(125, 1828, 4, array( 360, 700, 1020, 1200)), + array(129, 1921, 3, array( 390, 728, 1050, 1260)), + array(133, 2051, 3, array( 420, 784, 1140, 1350)), + array(137, 2185, 3, array( 450, 812, 1200, 1440)), //30 + array(141, 2323, 3, array( 480, 868, 1290, 1530)), + array(145, 2465, 3, array( 510, 924, 1350, 1620)), + array(149, 2611, 3, array( 540, 980, 1440, 1710)), + array(153, 2761, 3, array( 570, 1036, 1530, 1800)), + array(157, 2876, 0, array( 570, 1064, 1590, 1890)), //35 + array(161, 3034, 0, array( 600, 1120, 1680, 1980)), + array(165, 3196, 0, array( 630, 1204, 1770, 2100)), + array(169, 3362, 0, array( 660, 1260, 1860, 2220)), + array(173, 3532, 0, array( 720, 1316, 1950, 2310)), + array(177, 3706, 0, array( 750, 1372, 2040, 2430)) //40 + ); + + //---------------------------------------------------------------------- + public static function getDataLength($version, $level) + { + return self::$capacity[$version][QRCAP_WORDS] - self::$capacity[$version][QRCAP_EC][$level]; + } + + //---------------------------------------------------------------------- + public static function getECCLength($version, $level) + { + return self::$capacity[$version][QRCAP_EC][$level]; + } + + //---------------------------------------------------------------------- + public static function getWidth($version) + { + return self::$capacity[$version][QRCAP_WIDTH]; + } + + //---------------------------------------------------------------------- + public static function getRemainder($version) + { + return self::$capacity[$version][QRCAP_REMINDER]; + } + + //---------------------------------------------------------------------- + public static function getMinimumVersion($size, $level) + { + + for($i=1; $i<= QRSPEC_VERSION_MAX; $i++) { + $words = self::$capacity[$i][QRCAP_WORDS] - self::$capacity[$i][QRCAP_EC][$level]; + if($words >= $size) + return $i; + } + + return -1; + } + + //###################################################################### + + public static $lengthTableBits = array( + array(10, 12, 14), + array( 9, 11, 13), + array( 8, 16, 16), + array( 8, 10, 12) + ); + + //---------------------------------------------------------------------- + public static function lengthIndicator($mode, $version) + { + if ($mode == QR_MODE_STRUCTURE) + return 0; + + if ($version <= 9) { + $l = 0; + } else if ($version <= 26) { + $l = 1; + } else { + $l = 2; + } + + return self::$lengthTableBits[$mode][$l]; + } + + //---------------------------------------------------------------------- + public static function maximumWords($mode, $version) + { + if($mode == QR_MODE_STRUCTURE) + return 3; + + if($version <= 9) { + $l = 0; + } else if($version <= 26) { + $l = 1; + } else { + $l = 2; + } + + $bits = self::$lengthTableBits[$mode][$l]; + $words = (1 << $bits) - 1; + + if($mode == QR_MODE_KANJI) { + $words *= 2; // the number of bytes is required + } + + return $words; + } + + // Error correction code ----------------------------------------------- + // Table of the error correction code (Reed-Solomon block) + // See Table 12-16 (pp.30-36), JIS X0510:2004. + + public static $eccTable = array( + array(array( 0, 0), array( 0, 0), array( 0, 0), array( 0, 0)), + array(array( 1, 0), array( 1, 0), array( 1, 0), array( 1, 0)), // 1 + array(array( 1, 0), array( 1, 0), array( 1, 0), array( 1, 0)), + array(array( 1, 0), array( 1, 0), array( 2, 0), array( 2, 0)), + array(array( 1, 0), array( 2, 0), array( 2, 0), array( 4, 0)), + array(array( 1, 0), array( 2, 0), array( 2, 2), array( 2, 2)), // 5 + array(array( 2, 0), array( 4, 0), array( 4, 0), array( 4, 0)), + array(array( 2, 0), array( 4, 0), array( 2, 4), array( 4, 1)), + array(array( 2, 0), array( 2, 2), array( 4, 2), array( 4, 2)), + array(array( 2, 0), array( 3, 2), array( 4, 4), array( 4, 4)), + array(array( 2, 2), array( 4, 1), array( 6, 2), array( 6, 2)), //10 + array(array( 4, 0), array( 1, 4), array( 4, 4), array( 3, 8)), + array(array( 2, 2), array( 6, 2), array( 4, 6), array( 7, 4)), + array(array( 4, 0), array( 8, 1), array( 8, 4), array(12, 4)), + array(array( 3, 1), array( 4, 5), array(11, 5), array(11, 5)), + array(array( 5, 1), array( 5, 5), array( 5, 7), array(11, 7)), //15 + array(array( 5, 1), array( 7, 3), array(15, 2), array( 3, 13)), + array(array( 1, 5), array(10, 1), array( 1, 15), array( 2, 17)), + array(array( 5, 1), array( 9, 4), array(17, 1), array( 2, 19)), + array(array( 3, 4), array( 3, 11), array(17, 4), array( 9, 16)), + array(array( 3, 5), array( 3, 13), array(15, 5), array(15, 10)), //20 + array(array( 4, 4), array(17, 0), array(17, 6), array(19, 6)), + array(array( 2, 7), array(17, 0), array( 7, 16), array(34, 0)), + array(array( 4, 5), array( 4, 14), array(11, 14), array(16, 14)), + array(array( 6, 4), array( 6, 14), array(11, 16), array(30, 2)), + array(array( 8, 4), array( 8, 13), array( 7, 22), array(22, 13)), //25 + array(array(10, 2), array(19, 4), array(28, 6), array(33, 4)), + array(array( 8, 4), array(22, 3), array( 8, 26), array(12, 28)), + array(array( 3, 10), array( 3, 23), array( 4, 31), array(11, 31)), + array(array( 7, 7), array(21, 7), array( 1, 37), array(19, 26)), + array(array( 5, 10), array(19, 10), array(15, 25), array(23, 25)), //30 + array(array(13, 3), array( 2, 29), array(42, 1), array(23, 28)), + array(array(17, 0), array(10, 23), array(10, 35), array(19, 35)), + array(array(17, 1), array(14, 21), array(29, 19), array(11, 46)), + array(array(13, 6), array(14, 23), array(44, 7), array(59, 1)), + array(array(12, 7), array(12, 26), array(39, 14), array(22, 41)), //35 + array(array( 6, 14), array( 6, 34), array(46, 10), array( 2, 64)), + array(array(17, 4), array(29, 14), array(49, 10), array(24, 46)), + array(array( 4, 18), array(13, 32), array(48, 14), array(42, 32)), + array(array(20, 4), array(40, 7), array(43, 22), array(10, 67)), + array(array(19, 6), array(18, 31), array(34, 34), array(20, 61)),//40 + ); + + //---------------------------------------------------------------------- + // CACHEABLE!!! + + public static function getEccSpec($version, $level, array &$spec) + { + if (count($spec) < 5) { + $spec = array(0,0,0,0,0); + } + + $b1 = self::$eccTable[$version][$level][0]; + $b2 = self::$eccTable[$version][$level][1]; + $data = self::getDataLength($version, $level); + $ecc = self::getECCLength($version, $level); + + if($b2 == 0) { + $spec[0] = $b1; + $spec[1] = (int)($data / $b1); + $spec[2] = (int)($ecc / $b1); + $spec[3] = 0; + $spec[4] = 0; + } else { + $spec[0] = $b1; + $spec[1] = (int)($data / ($b1 + $b2)); + $spec[2] = (int)($ecc / ($b1 + $b2)); + $spec[3] = $b2; + $spec[4] = $spec[1] + 1; + } + } + + // Alignment pattern --------------------------------------------------- + + // Positions of alignment patterns. + // This array includes only the second and the third position of the + // alignment patterns. Rest of them can be calculated from the distance + // between them. + + // See Table 1 in Appendix E (pp.71) of JIS X0510:2004. + + public static $alignmentPattern = array( + array( 0, 0), + array( 0, 0), array(18, 0), array(22, 0), array(26, 0), array(30, 0), // 1- 5 + array(34, 0), array(22, 38), array(24, 42), array(26, 46), array(28, 50), // 6-10 + array(30, 54), array(32, 58), array(34, 62), array(26, 46), array(26, 48), //11-15 + array(26, 50), array(30, 54), array(30, 56), array(30, 58), array(34, 62), //16-20 + array(28, 50), array(26, 50), array(30, 54), array(28, 54), array(32, 58), //21-25 + array(30, 58), array(34, 62), array(26, 50), array(30, 54), array(26, 52), //26-30 + array(30, 56), array(34, 60), array(30, 58), array(34, 62), array(30, 54), //31-35 + array(24, 50), array(28, 54), array(32, 58), array(26, 54), array(30, 58), //35-40 + ); + + + /** -------------------------------------------------------------------- + * Put an alignment marker. + * @param frame + * @param width + * @param ox,oy center coordinate of the pattern + */ + public static function putAlignmentMarker(array &$frame, $ox, $oy) + { + $finder = array( + "\xa1\xa1\xa1\xa1\xa1", + "\xa1\xa0\xa0\xa0\xa1", + "\xa1\xa0\xa1\xa0\xa1", + "\xa1\xa0\xa0\xa0\xa1", + "\xa1\xa1\xa1\xa1\xa1" + ); + + $yStart = $oy-2; + $xStart = $ox-2; + + for($y=0; $y<5; $y++) { + QRstr::set($frame, $xStart, $yStart+$y, $finder[$y]); + } + } + + //---------------------------------------------------------------------- + public static function putAlignmentPattern($version, &$frame, $width) + { + if($version < 2) + return; + + $d = self::$alignmentPattern[$version][1] - self::$alignmentPattern[$version][0]; + if($d < 0) { + $w = 2; + } else { + $w = (int)(($width - self::$alignmentPattern[$version][0]) / $d + 2); + } + + if($w * $w - 3 == 1) { + $x = self::$alignmentPattern[$version][0]; + $y = self::$alignmentPattern[$version][0]; + self::putAlignmentMarker($frame, $x, $y); + return; + } + + $cx = self::$alignmentPattern[$version][0]; + for($x=1; $x<$w - 1; $x++) { + self::putAlignmentMarker($frame, 6, $cx); + self::putAlignmentMarker($frame, $cx, 6); + $cx += $d; + } + + $cy = self::$alignmentPattern[$version][0]; + for($y=0; $y<$w-1; $y++) { + $cx = self::$alignmentPattern[$version][0]; + for($x=0; $x<$w-1; $x++) { + self::putAlignmentMarker($frame, $cx, $cy); + $cx += $d; + } + $cy += $d; + } + } + + // Version information pattern ----------------------------------------- + + // Version information pattern (BCH coded). + // See Table 1 in Appendix D (pp.68) of JIS X0510:2004. + + // size: [QRSPEC_VERSION_MAX - 6] + + public static $versionPattern = array( + 0x07c94, 0x085bc, 0x09a99, 0x0a4d3, 0x0bbf6, 0x0c762, 0x0d847, 0x0e60d, + 0x0f928, 0x10b78, 0x1145d, 0x12a17, 0x13532, 0x149a6, 0x15683, 0x168c9, + 0x177ec, 0x18ec4, 0x191e1, 0x1afab, 0x1b08e, 0x1cc1a, 0x1d33f, 0x1ed75, + 0x1f250, 0x209d5, 0x216f0, 0x228ba, 0x2379f, 0x24b0b, 0x2542e, 0x26a64, + 0x27541, 0x28c69 + ); + + //---------------------------------------------------------------------- + public static function getVersionPattern($version) + { + if($version < 7 || $version > QRSPEC_VERSION_MAX) + return 0; + + return self::$versionPattern[$version -7]; + } + + // Format information -------------------------------------------------- + // See calcFormatInfo in tests/test_qrspec.c (orginal qrencode c lib) + + public static $formatInfo = array( + array(0x77c4, 0x72f3, 0x7daa, 0x789d, 0x662f, 0x6318, 0x6c41, 0x6976), + array(0x5412, 0x5125, 0x5e7c, 0x5b4b, 0x45f9, 0x40ce, 0x4f97, 0x4aa0), + array(0x355f, 0x3068, 0x3f31, 0x3a06, 0x24b4, 0x2183, 0x2eda, 0x2bed), + array(0x1689, 0x13be, 0x1ce7, 0x19d0, 0x0762, 0x0255, 0x0d0c, 0x083b) + ); + + public static function getFormatInfo($mask, $level) + { + if($mask < 0 || $mask > 7) + return 0; + + if($level < 0 || $level > 3) + return 0; + + return self::$formatInfo[$level][$mask]; + } + + // Frame --------------------------------------------------------------- + // Cache of initial frames. + + public static $frames = []; + + /** -------------------------------------------------------------------- + * Put a finder pattern. + * @param frame + * @param width + * @param ox,oy upper-left coordinate of the pattern + */ + public static function putFinderPattern(&$frame, $ox, $oy) + { + $finder = array( + "\xc1\xc1\xc1\xc1\xc1\xc1\xc1", + "\xc1\xc0\xc0\xc0\xc0\xc0\xc1", + "\xc1\xc0\xc1\xc1\xc1\xc0\xc1", + "\xc1\xc0\xc1\xc1\xc1\xc0\xc1", + "\xc1\xc0\xc1\xc1\xc1\xc0\xc1", + "\xc1\xc0\xc0\xc0\xc0\xc0\xc1", + "\xc1\xc1\xc1\xc1\xc1\xc1\xc1" + ); + + for($y=0; $y<7; $y++) { + QRstr::set($frame, $ox, $oy+$y, $finder[$y]); + } + } + + //---------------------------------------------------------------------- + public static function createFrame($version) + { + $width = self::$capacity[$version][QRCAP_WIDTH]; + $frameLine = str_repeat ("\0", $width); + $frame = array_fill(0, $width, $frameLine); + + // Finder pattern + self::putFinderPattern($frame, 0, 0); + self::putFinderPattern($frame, $width - 7, 0); + self::putFinderPattern($frame, 0, $width - 7); + + // Separator + $yOffset = $width - 7; + + for($y=0; $y<7; $y++) { + $frame[$y][7] = "\xc0"; + $frame[$y][$width - 8] = "\xc0"; + $frame[$yOffset][7] = "\xc0"; + $yOffset++; + } + + $setPattern = str_repeat("\xc0", 8); + + QRstr::set($frame, 0, 7, $setPattern); + QRstr::set($frame, $width-8, 7, $setPattern); + QRstr::set($frame, 0, $width - 8, $setPattern); + + // Format info + $setPattern = str_repeat("\x84", 9); + QRstr::set($frame, 0, 8, $setPattern); + QRstr::set($frame, $width - 8, 8, $setPattern, 8); + + $yOffset = $width - 8; + + for($y=0; $y<8; $y++,$yOffset++) { + $frame[$y][8] = "\x84"; + $frame[$yOffset][8] = "\x84"; + } + + // Timing pattern + + for($i=1; $i<$width-15; $i++) { + $frame[6][7+$i] = chr(0x90 | ($i & 1)); + $frame[7+$i][6] = chr(0x90 | ($i & 1)); + } + + // Alignment pattern + self::putAlignmentPattern($version, $frame, $width); + + // Version information + if($version >= 7) { + $vinf = self::getVersionPattern($version); + + $v = $vinf; + + for($x=0; $x<6; $x++) { + for($y=0; $y<3; $y++) { + $frame[($width - 11)+$y][$x] = chr(0x88 | ($v & 1)); + $v = $v >> 1; + } + } + + $v = $vinf; + for($y=0; $y<6; $y++) { + for($x=0; $x<3; $x++) { + $frame[$y][$x+($width - 11)] = chr(0x88 | ($v & 1)); + $v = $v >> 1; + } + } + } + + // and a little bit... + $frame[$width - 8][8] = "\x81"; + + return $frame; + } + + //---------------------------------------------------------------------- + public static function debug($frame, $binary_mode = false) + { + if ($binary_mode) { + + foreach ($frame as &$frameLine) { + $frameLine = join('  ', explode('0', $frameLine)); + $frameLine = join('██', explode('1', $frameLine)); + } + + ?> + +


                '; + echo join("
                ", $frame); + echo '






    '; + + } else { + + foreach ($frame as &$frameLine) { + $frameLine = join(' ', explode("\xc0", $frameLine)); + $frameLine = join('', explode("\xc1", $frameLine)); + $frameLine = join(' ', explode("\xa0", $frameLine)); + $frameLine = join('', explode("\xa1", $frameLine)); + $frameLine = join('', explode("\x84", $frameLine)); //format 0 + $frameLine = join('', explode("\x85", $frameLine)); //format 1 + $frameLine = join('', explode("\x81", $frameLine)); //special bit + $frameLine = join(' ', explode("\x90", $frameLine)); //clock 0 + $frameLine = join('', explode("\x91", $frameLine)); //clock 1 + $frameLine = join(' ', explode("\x88", $frameLine)); //version + $frameLine = join('', explode("\x89", $frameLine)); //version + $frameLine = join('♦', explode("\x01", $frameLine)); + $frameLine = join('⋅', explode("\0", $frameLine)); + } + + ?> + + "; + echo join("
    ", $frame); + echo "
    "; + + } + } + + //---------------------------------------------------------------------- + public static function serial($frame) + { + return gzcompress(join("\n", $frame), 9); + } + + //---------------------------------------------------------------------- + public static function unserial($code) + { + return explode("\n", gzuncompress($code)); + } + + //---------------------------------------------------------------------- + public static function newFrame($version) + { + if($version < 1 || $version > QRSPEC_VERSION_MAX) + return null; + + if(!isset(self::$frames[$version])) { + + $fileName = QR_CACHE_DIR.'frame_'.$version.'.dat'; + + if (QR_CACHEABLE) { + if (file_exists($fileName)) { + self::$frames[$version] = self::unserial(MEC_file::read($fileName)); + } else { + self::$frames[$version] = self::createFrame($version); + MEC_file::write($fileName, self::serial(self::$frames[$version])); + } + } else { + self::$frames[$version] = self::createFrame($version); + } + } + + if(is_null(self::$frames[$version])) + return null; + + return self::$frames[$version]; + } + + //---------------------------------------------------------------------- + public static function rsBlockNum($spec) { return $spec[0] + $spec[3]; } + public static function rsBlockNum1($spec) { return $spec[0]; } + public static function rsDataCodes1($spec) { return $spec[1]; } + public static function rsEccCodes1($spec) { return $spec[2]; } + public static function rsBlockNum2($spec) { return $spec[3]; } + public static function rsDataCodes2($spec) { return $spec[4]; } + public static function rsEccCodes2($spec) { return $spec[2]; } + public static function rsDataLength($spec) { return ($spec[0] * $spec[1]) + ($spec[3] * $spec[4]); } + public static function rsEccLength($spec) { return ($spec[0] + $spec[3]) * $spec[2]; } + +} + +/* + * PHP QR Code encoder + * + * Image output of code using GD2 + * + * PHP QR Code is distributed under LGPL 3 + * Copyright (C) 2010 Dominik Dzienia + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +define('QR_IMAGE', true); + +class QRimage { + + //---------------------------------------------------------------------- + public static function png($frame, $filename = false, $pixelPerPoint = 4, $outerFrame = 4,$saveandprint=FALSE) + { + $image = self::image($frame, $pixelPerPoint, $outerFrame); + + if ($filename === false) { + header("Content-type: image/png"); + imagepng($image); + } else { + if($saveandprint===TRUE){ + imagepng($image, $filename); + header("Content-type: image/png"); + imagepng($image); + }else{ + imagepng($image, $filename); + } + } + + imagedestroy($image); + } + + //---------------------------------------------------------------------- + public static function jpg($frame, $filename = false, $pixelPerPoint = 8, $outerFrame = 4, $q = 85) + { + $image = self::image($frame, $pixelPerPoint, $outerFrame); + + if ($filename === false) { + header("Content-type: image/jpeg"); + imagejpeg($image, null, $q); + } else { + imagejpeg($image, $filename, $q); + } + + imagedestroy($image); + } + + //---------------------------------------------------------------------- + private static function image($frame, $pixelPerPoint = 4, $outerFrame = 4) + { + $h = count($frame); + $w = strlen($frame[0]); + + $imgW = $w + 2*$outerFrame; + $imgH = $h + 2*$outerFrame; + + $base_image = imagecreate($imgW, $imgH); + + $col[0] = imagecolorallocate($base_image,255,255,255); + $col[1] = imagecolorallocate($base_image,0,0,0); + + imagefill($base_image, 0, 0, $col[0]); + + for($y=0; $y<$h; $y++) { + for($x=0; $x<$w; $x++) { + if ($frame[$y][$x] == '1') { + imagesetpixel($base_image,$x+$outerFrame,$y+$outerFrame,$col[1]); + } + } + } + + $target_image = imagecreate($imgW * $pixelPerPoint, $imgH * $pixelPerPoint); + imagecopyresized($target_image, $base_image, 0, 0, 0, 0, $imgW * $pixelPerPoint, $imgH * $pixelPerPoint, $imgW, $imgH); + imagedestroy($base_image); + + return $target_image; + } +} + +/* + * PHP QR Code encoder + * + * Input encoding class + * + * Based on libqrencode C library distributed under LGPL 2.1 + * Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi + * + * PHP QR Code is distributed under LGPL 3 + * Copyright (C) 2010 Dominik Dzienia + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +define('STRUCTURE_HEADER_BITS', 20); +define('MAX_STRUCTURED_SYMBOLS', 16); + +class QRinputItem { + + public $mode; + public $size; + public $data; + public $bstream; + + public function __construct($mode, $size, $data, $bstream = null) + { + $setData = array_slice($data, 0, $size); + + if (count($setData) < $size) { + $setData = array_merge($setData, array_fill(0,$size-count($setData),0)); + } + + if(!QRinput::check($mode, $size, $setData)) { + throw new Exception('Error m:'.$mode.',s:'.$size.',d:'.join(',', $setData)); + return null; + } + + $this->mode = $mode; + $this->size = $size; + $this->data = $setData; + $this->bstream = $bstream; + } + + //---------------------------------------------------------------------- + public function encodeModeNum($version) + { + try { + + $words = (int)($this->size / 3); + $bs = new QRbitstream(); + + $val = 0x1; + $bs->appendNum(4, $val); + $bs->appendNum(QRspec::lengthIndicator(QR_MODE_NUM, $version), $this->size); + + for($i=0; $i<$words; $i++) { + $val = (ord($this->data[$i*3 ]) - ord('0')) * 100; + $val += (ord($this->data[$i*3+1]) - ord('0')) * 10; + $val += (ord($this->data[$i*3+2]) - ord('0')); + $bs->appendNum(10, $val); + } + + if($this->size - $words * 3 == 1) { + $val = ord($this->data[$words*3]) - ord('0'); + $bs->appendNum(4, $val); + } else if($this->size - $words * 3 == 2) { + $val = (ord($this->data[$words*3 ]) - ord('0')) * 10; + $val += (ord($this->data[$words*3+1]) - ord('0')); + $bs->appendNum(7, $val); + } + + $this->bstream = $bs; + return 0; + + } catch (Exception $e) { + return -1; + } + } + + //---------------------------------------------------------------------- + public function encodeModeAn($version) + { + try { + $words = (int)($this->size / 2); + $bs = new QRbitstream(); + + $bs->appendNum(4, 0x02); + $bs->appendNum(QRspec::lengthIndicator(QR_MODE_AN, $version), $this->size); + + for($i=0; $i<$words; $i++) { + $val = (int)QRinput::lookAnTable(ord($this->data[$i*2 ])) * 45; + $val += (int)QRinput::lookAnTable(ord($this->data[$i*2+1])); + + $bs->appendNum(11, $val); + } + + if($this->size & 1) { + $val = QRinput::lookAnTable(ord($this->data[$words * 2])); + $bs->appendNum(6, $val); + } + + $this->bstream = $bs; + return 0; + + } catch (Exception $e) { + return -1; + } + } + + //---------------------------------------------------------------------- + public function encodeMode8($version) + { + try { + $bs = new QRbitstream(); + + $bs->appendNum(4, 0x4); + $bs->appendNum(QRspec::lengthIndicator(QR_MODE_8, $version), $this->size); + + for($i=0; $i<$this->size; $i++) { + $bs->appendNum(8, ord($this->data[$i])); + } + + $this->bstream = $bs; + return 0; + + } catch (Exception $e) { + return -1; + } + } + + //---------------------------------------------------------------------- + public function encodeModeKanji($version) + { + try { + + $bs = new QRbitrtream(); + + $bs->appendNum(4, 0x8); + $bs->appendNum(QRspec::lengthIndicator(QR_MODE_KANJI, $version), (int)($this->size / 2)); + + for($i=0; $i<$this->size; $i+=2) { + $val = (ord($this->data[$i]) << 8) | ord($this->data[$i+1]); + if($val <= 0x9ffc) { + $val -= 0x8140; + } else { + $val -= 0xc140; + } + + $h = ($val >> 8) * 0xc0; + $val = ($val & 0xff) + $h; + + $bs->appendNum(13, $val); + } + + $this->bstream = $bs; + return 0; + + } catch (Exception $e) { + return -1; + } + } + + //---------------------------------------------------------------------- + public function encodeModeStructure() + { + try { + $bs = new QRbitstream(); + + $bs->appendNum(4, 0x03); + $bs->appendNum(4, ord($this->data[1]) - 1); + $bs->appendNum(4, ord($this->data[0]) - 1); + $bs->appendNum(8, ord($this->data[2])); + + $this->bstream = $bs; + return 0; + + } catch (Exception $e) { + return -1; + } + } + + //---------------------------------------------------------------------- + public function estimateBitStreamSizeOfEntry($version) + { + $bits = 0; + + if($version == 0) + $version = 1; + + switch($this->mode) { + case QR_MODE_NUM: $bits = QRinput::estimateBitsModeNum($this->size); break; + case QR_MODE_AN: $bits = QRinput::estimateBitsModeAn($this->size); break; + case QR_MODE_8: $bits = QRinput::estimateBitsMode8($this->size); break; + case QR_MODE_KANJI: $bits = QRinput::estimateBitsModeKanji($this->size);break; + case QR_MODE_STRUCTURE: return STRUCTURE_HEADER_BITS; + default: + return 0; + } + + $l = QRspec::lengthIndicator($this->mode, $version); + $m = 1 << $l; + $num = (int)(($this->size + $m - 1) / $m); + + $bits += $num * (4 + $l); + + return $bits; + } + + //---------------------------------------------------------------------- + public function encodeBitStream($version) + { + try { + + unset($this->bstream); + $words = QRspec::maximumWords($this->mode, $version); + + if($this->size > $words) { + + $st1 = new QRinputItem($this->mode, $words, $this->data); + $st2 = new QRinputItem($this->mode, $this->size - $words, array_slice($this->data, $words)); + + $st1->encodeBitStream($version); + $st2->encodeBitStream($version); + + $this->bstream = new QRbitstream(); + $this->bstream->append($st1->bstream); + $this->bstream->append($st2->bstream); + + unset($st1); + unset($st2); + + } else { + + $ret = 0; + + switch($this->mode) { + case QR_MODE_NUM: $ret = $this->encodeModeNum($version); break; + case QR_MODE_AN: $ret = $this->encodeModeAn($version); break; + case QR_MODE_8: $ret = $this->encodeMode8($version); break; + case QR_MODE_KANJI: $ret = $this->encodeModeKanji($version);break; + case QR_MODE_STRUCTURE: $ret = $this->encodeModeStructure(); break; + + default: + break; + } + + if($ret < 0) + return -1; + } + + return $this->bstream->size(); + + } catch (Exception $e) { + return -1; + } + } +} + +//########################################################################## + +class QRinput { + + public $items; + + private $version; + private $level; + + //---------------------------------------------------------------------- + public function __construct($version = 0, $level = QR_ECLEVEL_L) + { + if ($version < 0 || $version > QRSPEC_VERSION_MAX || $level > QR_ECLEVEL_H) { + throw new Exception('Invalid version no'); + return NULL; + } + + $this->version = $version; + $this->level = $level; + } + + //---------------------------------------------------------------------- + public function getVersion() + { + return $this->version; + } + + //---------------------------------------------------------------------- + public function setVersion($version) + { + if($version < 0 || $version > QRSPEC_VERSION_MAX) { + throw new Exception('Invalid version no'); + return -1; + } + + $this->version = $version; + + return 0; + } + + //---------------------------------------------------------------------- + public function getErrorCorrectionLevel() + { + return $this->level; + } + + //---------------------------------------------------------------------- + public function setErrorCorrectionLevel($level) + { + if($level > QR_ECLEVEL_H) { + throw new Exception('Invalid ECLEVEL'); + return -1; + } + + $this->level = $level; + + return 0; + } + + //---------------------------------------------------------------------- + public function appendEntry(QRinputItem $entry) + { + $this->items[] = $entry; + } + + //---------------------------------------------------------------------- + public function append($mode, $size, $data) + { + try { + $entry = new QRinputItem($mode, $size, $data); + $this->items[] = $entry; + return 0; + } catch (Exception $e) { + return -1; + } + } + + //---------------------------------------------------------------------- + + public function insertStructuredAppendHeader($size, $index, $parity) + { + if($size > MAX_STRUCTURED_SYMBOLS ) { + throw new Exception('insertStructuredAppendHeader wrong size'); + } + + if($index <= 0 || $index > MAX_STRUCTURED_SYMBOLS ) { + throw new Exception('insertStructuredAppendHeader wrong index'); + } + + $buf = array($size, $index, $parity); + + try { + $entry = new QRinputItem(QR_MODE_STRUCTURE, 3, buf); + array_unshift($this->items, $entry); + return 0; + } catch (Exception $e) { + return -1; + } + } + + //---------------------------------------------------------------------- + public function calcParity() + { + $parity = 0; + + foreach($this->items as $item) { + if($item->mode != QR_MODE_STRUCTURE) { + for($i=$item->size-1; $i>=0; $i--) { + $parity ^= $item->data[$i]; + } + } + } + + return $parity; + } + + //---------------------------------------------------------------------- + public static function checkModeNum($size, $data) + { + for($i=0; $i<$size; $i++) { + if((ord($data[$i]) < ord('0')) || (ord($data[$i]) > ord('9'))){ + return false; + } + } + + return true; + } + + //---------------------------------------------------------------------- + public static function estimateBitsModeNum($size) + { + $w = (int)$size / 3; + $bits = $w * 10; + + switch($size - $w * 3) { + case 1: + $bits += 4; + break; + case 2: + $bits += 7; + break; + default: + break; + } + + return $bits; + } + + //---------------------------------------------------------------------- + public static $anTable = array( + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + 36, -1, -1, -1, 37, 38, -1, -1, -1, -1, 39, 40, -1, 41, 42, 43, + 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 44, -1, -1, -1, -1, -1, + -1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, + 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 + ); + + //---------------------------------------------------------------------- + public static function lookAnTable($c) + { + return (($c > 127)?-1:self::$anTable[$c]); + } + + //---------------------------------------------------------------------- + public static function checkModeAn($size, $data) + { + for($i=0; $i<$size; $i++) { + if (self::lookAnTable(ord($data[$i])) == -1) { + return false; + } + } + + return true; + } + + //---------------------------------------------------------------------- + public static function estimateBitsModeAn($size) + { + $w = (int)($size / 2); + $bits = $w * 11; + + if($size & 1) { + $bits += 6; + } + + return $bits; + } + + //---------------------------------------------------------------------- + public static function estimateBitsMode8($size) + { + return $size * 8; + } + + //---------------------------------------------------------------------- + public function estimateBitsModeKanji($size) + { + return (int)(($size / 2) * 13); + } + + //---------------------------------------------------------------------- + public static function checkModeKanji($size, $data) + { + if($size & 1) + return false; + + for($i=0; $i<$size; $i+=2) { + $val = (ord($data[$i]) << 8) | ord($data[$i+1]); + if($val < 0x8140 + || ($val > 0x9ffc && $val < 0xe040) + || $val > 0xebbf) { + return false; + } + } + + return true; + } + + /*********************************************************************** + * Validation + **********************************************************************/ + + public static function check($mode, $size, $data) + { + if($size <= 0) + return false; + + switch($mode) { + case QR_MODE_NUM: return self::checkModeNum($size, $data); break; + case QR_MODE_AN: return self::checkModeAn($size, $data); break; + case QR_MODE_KANJI: return self::checkModeKanji($size, $data); break; + case QR_MODE_8: return true; break; + case QR_MODE_STRUCTURE: return true; break; + + default: + break; + } + + return false; + } + + + //---------------------------------------------------------------------- + public function estimateBitStreamSize($version) + { + $bits = 0; + + foreach($this->items as $item) { + $bits += $item->estimateBitStreamSizeOfEntry($version); + } + + return $bits; + } + + //---------------------------------------------------------------------- + public function estimateVersion() + { + $version = 0; + $prev = 0; + do { + $prev = $version; + $bits = $this->estimateBitStreamSize($prev); + $version = QRspec::getMinimumVersion((int)(($bits + 7) / 8), $this->level); + if ($version < 0) { + return -1; + } + } while ($version > $prev); + + return $version; + } + + //---------------------------------------------------------------------- + public static function lengthOfCode($mode, $version, $bits) + { + $payload = $bits - 4 - QRspec::lengthIndicator($mode, $version); + switch($mode) { + case QR_MODE_NUM: + $chunks = (int)($payload / 10); + $remain = $payload - $chunks * 10; + $size = $chunks * 3; + if($remain >= 7) { + $size += 2; + } else if($remain >= 4) { + $size += 1; + } + break; + case QR_MODE_AN: + $chunks = (int)($payload / 11); + $remain = $payload - $chunks * 11; + $size = $chunks * 2; + if($remain >= 6) + $size++; + break; + case QR_MODE_8: + $size = (int)($payload / 8); + break; + case QR_MODE_KANJI: + $size = (int)(($payload / 13) * 2); + break; + case QR_MODE_STRUCTURE: + $size = (int)($payload / 8); + break; + default: + $size = 0; + break; + } + + $maxsize = QRspec::maximumWords($mode, $version); + if($size < 0) $size = 0; + if($size > $maxsize) $size = $maxsize; + + return $size; + } + + //---------------------------------------------------------------------- + public function createBitStream() + { + $total = 0; + + foreach($this->items as $item) { + $bits = $item->encodeBitStream($this->version); + + if($bits < 0) + return -1; + + $total += $bits; + } + + return $total; + } + + //---------------------------------------------------------------------- + public function convertData() + { + $ver = $this->estimateVersion(); + if($ver > $this->getVersion()) { + $this->setVersion($ver); + } + + for(;;) { + $bits = $this->createBitStream(); + + if($bits < 0) + return -1; + + $ver = QRspec::getMinimumVersion((int)(($bits + 7) / 8), $this->level); + if($ver < 0) { + throw new Exception('WRONG VERSION'); + return -1; + } else if($ver > $this->getVersion()) { + $this->setVersion($ver); + } else { + break; + } + } + + return 0; + } + + //---------------------------------------------------------------------- + public function appendPaddingBit(&$bstream) + { + $bits = $bstream->size(); + $maxwords = QRspec::getDataLength($this->version, $this->level); + $maxbits = $maxwords * 8; + + if ($maxbits == $bits) { + return 0; + } + + if ($maxbits - $bits < 5) { + return $bstream->appendNum($maxbits - $bits, 0); + } + + $bits += 4; + $words = (int)(($bits + 7) / 8); + + $padding = new QRbitstream(); + $ret = $padding->appendNum($words * 8 - $bits + 4, 0); + + if($ret < 0) + return $ret; + + $padlen = $maxwords - $words; + + if($padlen > 0) { + + $padbuf = []; + for($i=0; $i<$padlen; $i++) { + $padbuf[$i] = ($i&1)?0x11:0xec; + } + + $ret = $padding->appendBytes($padlen, $padbuf); + + if($ret < 0) + return $ret; + + } + + $ret = $bstream->append($padding); + + return $ret; + } + + //---------------------------------------------------------------------- + public function mergeBitStream() + { + if($this->convertData() < 0) { + return null; + } + + $bstream = new QRbitstream(); + + foreach($this->items as $item) { + $ret = $bstream->append($item->bstream); + if($ret < 0) { + return null; + } + } + + return $bstream; + } + + //---------------------------------------------------------------------- + public function getBitStream() + { + + $bstream = $this->mergeBitStream(); + + if($bstream == null) { + return null; + } + + $ret = $this->appendPaddingBit($bstream); + if($ret < 0) { + return null; + } + + return $bstream; + } + + //---------------------------------------------------------------------- + public function getByteStream() + { + $bstream = $this->getBitStream(); + if($bstream == null) { + return null; + } + + return $bstream->toByte(); + } +} + +/* + * PHP QR Code encoder + * + * Bitstream class + * + * Based on libqrencode C library distributed under LGPL 2.1 + * Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi + * + * PHP QR Code is distributed under LGPL 3 + * Copyright (C) 2010 Dominik Dzienia + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +class QRbitstream { + + public $data = []; + + //---------------------------------------------------------------------- + public function size() + { + return count($this->data); + } + + //---------------------------------------------------------------------- + public function allocate($setLength) + { + $this->data = array_fill(0, $setLength, 0); + return 0; + } + + //---------------------------------------------------------------------- + public function newFromNum($bits, $num) + { + $bstream = new QRbitstream(); + $bstream->allocate($bits); + + $mask = 1 << ($bits - 1); + for($i=0; $i<$bits; $i++) { + if($num & $mask) { + $bstream->data[$i] = 1; + } else { + $bstream->data[$i] = 0; + } + $mask = $mask >> 1; + } + + return $bstream; + } + + //---------------------------------------------------------------------- + public function newFromBytes($size, $data) + { + $bstream = new QRbitstream(); + $bstream->allocate($size * 8); + $p=0; + + for($i=0; $i<$size; $i++) { + $mask = 0x80; + for($j=0; $j<8; $j++) { + if($data[$i] & $mask) { + $bstream->data[$p] = 1; + } else { + $bstream->data[$p] = 0; + } + $p++; + $mask = $mask >> 1; + } + } + + return $bstream; + } + + //---------------------------------------------------------------------- + public function append(QRbitstream $arg) + { + if (is_null($arg)) { + return -1; + } + + if($arg->size() == 0) { + return 0; + } + + if($this->size() == 0) { + $this->data = $arg->data; + return 0; + } + + $this->data = array_values(array_merge($this->data, $arg->data)); + + return 0; + } + + //---------------------------------------------------------------------- + public function appendNum($bits, $num) + { + if ($bits == 0) + return 0; + + $b = QRbitstream::newFromNum($bits, $num); + + if(is_null($b)) + return -1; + + $ret = $this->append($b); + unset($b); + + return $ret; + } + + //---------------------------------------------------------------------- + public function appendBytes($size, $data) + { + if ($size == 0) + return 0; + + $b = QRbitstream::newFromBytes($size, $data); + + if(is_null($b)) + return -1; + + $ret = $this->append($b); + unset($b); + + return $ret; + } + + //---------------------------------------------------------------------- + public function toByte() + { + + $size = $this->size(); + + if($size == 0) { + return []; + } + + $data = array_fill(0, (int)(($size + 7) / 8), 0); + $bytes = (int)($size / 8); + + $p = 0; + + for($i=0; $i<$bytes; $i++) { + $v = 0; + for($j=0; $j<8; $j++) { + $v = $v << 1; + $v |= $this->data[$p]; + $p++; + } + $data[$i] = $v; + } + + if($size & 7) { + $v = 0; + for($j=0; $j<($size & 7); $j++) { + $v = $v << 1; + $v |= $this->data[$p]; + $p++; + } + $data[$bytes] = $v; + } + + return $data; + } +} + +/* + * PHP QR Code encoder + * + * Input splitting classes + * + * Based on libqrencode C library distributed under LGPL 2.1 + * Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi + * + * PHP QR Code is distributed under LGPL 3 + * Copyright (C) 2010 Dominik Dzienia + * + * The following data / specifications are taken from + * "Two dimensional symbol -- QR-code -- Basic Specification" (JIS X0510:2004) + * or + * "Automatic identification and data capture techniques -- + * QR Code 2005 bar code symbology specification" (ISO/IEC 18004:2006) + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +class QRsplit { + + public $dataStr = ''; + public $input; + public $modeHint; + + //---------------------------------------------------------------------- + public function __construct($dataStr, $input, $modeHint) + { + $this->dataStr = $dataStr; + $this->input = $input; + $this->modeHint = $modeHint; + } + + //---------------------------------------------------------------------- + public function isdigitat($str, $pos) + { + if ($pos >= strlen($str)) + return false; + + return ((ord($str[$pos]) >= ord('0'))&&(ord($str[$pos]) <= ord('9'))); + } + + //---------------------------------------------------------------------- + public function isalnumat($str, $pos) + { + if ($pos >= strlen($str)) + return false; + + return (QRinput::lookAnTable(ord($str[$pos])) >= 0); + } + + //---------------------------------------------------------------------- + public function identifyMode($pos) + { + if ($pos >= strlen($this->dataStr)) + return QR_MODE_NUL; + + $c = $this->dataStr[$pos]; + + if(self::isdigitat($this->dataStr, $pos)) { + return QR_MODE_NUM; + } else if(self::isalnumat($this->dataStr, $pos)) { + return QR_MODE_AN; + } else if($this->modeHint == QR_MODE_KANJI) { + + if ($pos+1 < strlen($this->dataStr)) + { + $d = $this->dataStr[$pos+1]; + $word = (ord($c) << 8) | ord($d); + if(($word >= 0x8140 && $word <= 0x9ffc) || ($word >= 0xe040 && $word <= 0xebbf)) { + return QR_MODE_KANJI; + } + } + } + + return QR_MODE_8; + } + + //---------------------------------------------------------------------- + public function eatNum() + { + $ln = QRspec::lengthIndicator(QR_MODE_NUM, $this->input->getVersion()); + + $p = 0; + while(self::isdigitat($this->dataStr, $p)) { + $p++; + } + + $run = $p; + $mode = $this->identifyMode($p); + + if($mode == QR_MODE_8) { + $dif = QRinput::estimateBitsModeNum($run) + 4 + $ln + + QRinput::estimateBitsMode8(1) // + 4 + l8 + - QRinput::estimateBitsMode8($run + 1); // - 4 - l8 + if($dif > 0) { + return $this->eat8(); + } + } + if($mode == QR_MODE_AN) { + $dif = QRinput::estimateBitsModeNum($run) + 4 + $ln + + QRinput::estimateBitsModeAn(1) // + 4 + la + - QRinput::estimateBitsModeAn($run + 1);// - 4 - la + if($dif > 0) { + return $this->eatAn(); + } + } + + $ret = $this->input->append(QR_MODE_NUM, $run, str_split($this->dataStr)); + if($ret < 0) + return -1; + + return $run; + } + + //---------------------------------------------------------------------- + public function eatAn() + { + $la = QRspec::lengthIndicator(QR_MODE_AN, $this->input->getVersion()); + $ln = QRspec::lengthIndicator(QR_MODE_NUM, $this->input->getVersion()); + + $p = 0; + + while(self::isalnumat($this->dataStr, $p)) { + if(self::isdigitat($this->dataStr, $p)) { + $q = $p; + while(self::isdigitat($this->dataStr, $q)) { + $q++; + } + + $dif = QRinput::estimateBitsModeAn($p) // + 4 + la + + QRinput::estimateBitsModeNum($q - $p) + 4 + $ln + - QRinput::estimateBitsModeAn($q); // - 4 - la + + if($dif < 0) { + break; + } else { + $p = $q; + } + } else { + $p++; + } + } + + $run = $p; + + if(!self::isalnumat($this->dataStr, $p)) { + $dif = QRinput::estimateBitsModeAn($run) + 4 + $la + + QRinput::estimateBitsMode8(1) // + 4 + l8 + - QRinput::estimateBitsMode8($run + 1); // - 4 - l8 + if($dif > 0) { + return $this->eat8(); + } + } + + $ret = $this->input->append(QR_MODE_AN, $run, str_split($this->dataStr)); + if($ret < 0) + return -1; + + return $run; + } + + //---------------------------------------------------------------------- + public function eatKanji() + { + $p = 0; + + while($this->identifyMode($p) == QR_MODE_KANJI) { + $p += 2; + } + + $ret = $this->input->append(QR_MODE_KANJI, $p, str_split($this->dataStr)); + if($ret < 0) + return -1; + + return $run; + } + + //---------------------------------------------------------------------- + public function eat8() + { + $la = QRspec::lengthIndicator(QR_MODE_AN, $this->input->getVersion()); + $ln = QRspec::lengthIndicator(QR_MODE_NUM, $this->input->getVersion()); + + $p = 1; + $dataStrLen = strlen($this->dataStr); + + while($p < $dataStrLen) { + + $mode = $this->identifyMode($p); + if($mode == QR_MODE_KANJI) { + break; + } + if($mode == QR_MODE_NUM) { + $q = $p; + while(self::isdigitat($this->dataStr, $q)) { + $q++; + } + $dif = QRinput::estimateBitsMode8($p) // + 4 + l8 + + QRinput::estimateBitsModeNum($q - $p) + 4 + $ln + - QRinput::estimateBitsMode8($q); // - 4 - l8 + if($dif < 0) { + break; + } else { + $p = $q; + } + } else if($mode == QR_MODE_AN) { + $q = $p; + while(self::isalnumat($this->dataStr, $q)) { + $q++; + } + $dif = QRinput::estimateBitsMode8($p) // + 4 + l8 + + QRinput::estimateBitsModeAn($q - $p) + 4 + $la + - QRinput::estimateBitsMode8($q); // - 4 - l8 + if($dif < 0) { + break; + } else { + $p = $q; + } + } else { + $p++; + } + } + + $run = $p; + $ret = $this->input->append(QR_MODE_8, $run, str_split($this->dataStr)); + + if($ret < 0) + return -1; + + return $run; + } + + //---------------------------------------------------------------------- + public function splitString() + { + while (strlen($this->dataStr) > 0) + { + if($this->dataStr == '') + return 0; + + $mode = $this->identifyMode(0); + + switch ($mode) { + case QR_MODE_NUM: $length = $this->eatNum(); break; + case QR_MODE_AN: $length = $this->eatAn(); break; + case QR_MODE_KANJI: + if ($hint == QR_MODE_KANJI) + $length = $this->eatKanji(); + else $length = $this->eat8(); + break; + default: $length = $this->eat8(); break; + + } + + if($length == 0) return 0; + if($length < 0) return -1; + + $this->dataStr = substr($this->dataStr, $length); + } + } + + //---------------------------------------------------------------------- + public function toUpper() + { + $stringLen = strlen($this->dataStr); + $p = 0; + + while ($p<$stringLen) { + $mode = self::identifyMode(substr($this->dataStr, $p), $this->modeHint); + if($mode == QR_MODE_KANJI) { + $p += 2; + } else { + if (ord($this->dataStr[$p]) >= ord('a') && ord($this->dataStr[$p]) <= ord('z')) { + $this->dataStr[$p] = chr(ord($this->dataStr[$p]) - 32); + } + $p++; + } + } + + return $this->dataStr; + } + + //---------------------------------------------------------------------- + public static function splitStringToQRinput($string, QRinput $input, $modeHint, $casesensitive = true) + { + if(is_null($string) || $string == '\0' || $string == '') { + throw new Exception('empty string!!!'); + } + + $split = new QRsplit($string, $input, $modeHint); + + if(!$casesensitive) + $split->toUpper(); + + return $split->splitString(); + } +} + +/* + * PHP QR Code encoder + * + * Reed-Solomon error correction support + * + * Copyright (C) 2002, 2003, 2004, 2006 Phil Karn, KA9Q + * (libfec is released under the GNU Lesser General Public License.) + * + * Based on libqrencode C library distributed under LGPL 2.1 + * Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi + * + * PHP QR Code is distributed under LGPL 3 + * Copyright (C) 2010 Dominik Dzienia + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +class QRrsItem { + + public $mm; // Bits per symbol + public $nn; // Symbols per block (= (1<= $this->nn) { + $x -= $this->nn; + $x = ($x >> $this->mm) + ($x & $this->nn); + } + + return $x; + } + + //---------------------------------------------------------------------- + public static function init_rs_char($symsize, $gfpoly, $fcr, $prim, $nroots, $pad) + { + // Common code for intializing a Reed-Solomon control block (char or int symbols) + // Copyright 2004 Phil Karn, KA9Q + // May be used under the terms of the GNU Lesser General Public License (LGPL) + + $rs = null; + + // Check parameter ranges + if($symsize < 0 || $symsize > 8) return $rs; + if($fcr < 0 || $fcr >= (1<<$symsize)) return $rs; + if($prim <= 0 || $prim >= (1<<$symsize)) return $rs; + if($nroots < 0 || $nroots >= (1<<$symsize)) return $rs; // Can't have more roots than symbol values! + if($pad < 0 || $pad >= ((1<<$symsize) -1 - $nroots)) return $rs; // Too much padding + + $rs = new QRrsItem(); + $rs->mm = $symsize; + $rs->nn = (1<<$symsize)-1; + $rs->pad = $pad; + + $rs->alpha_to = array_fill(0, $rs->nn+1, 0); + $rs->index_of = array_fill(0, $rs->nn+1, 0); + + // PHP style macro replacement ;) + $NN =& $rs->nn; + $A0 =& $NN; + + // Generate Galois field lookup tables + $rs->index_of[0] = $A0; // log(zero) = -inf + $rs->alpha_to[$A0] = 0; // alpha**-inf = 0 + $sr = 1; + + for($i=0; $i<$rs->nn; $i++) { + $rs->index_of[$sr] = $i; + $rs->alpha_to[$i] = $sr; + $sr <<= 1; + if($sr & (1<<$symsize)) { + $sr ^= $gfpoly; + } + $sr &= $rs->nn; + } + + if($sr != 1){ + // field generator polynomial is not primitive! + $rs = NULL; + return $rs; + } + + /* Form RS code generator polynomial from its roots */ + $rs->genpoly = array_fill(0, $nroots+1, 0); + + $rs->fcr = $fcr; + $rs->prim = $prim; + $rs->nroots = $nroots; + $rs->gfpoly = $gfpoly; + + /* Find prim-th root of 1, used in decoding */ + for($iprim=1;($iprim % $prim) != 0;$iprim += $rs->nn) + ; // intentional empty-body loop! + + $rs->iprim = (int)($iprim / $prim); + $rs->genpoly[0] = 1; + + for ($i = 0,$root=$fcr*$prim; $i < $nroots; $i++, $root += $prim) { + $rs->genpoly[$i+1] = 1; + + // Multiply rs->genpoly[] by @**(root + x) + for ($j = $i; $j > 0; $j--) { + if ($rs->genpoly[$j] != 0) { + $rs->genpoly[$j] = $rs->genpoly[$j-1] ^ $rs->alpha_to[$rs->modnn($rs->index_of[$rs->genpoly[$j]] + $root)]; + } else { + $rs->genpoly[$j] = $rs->genpoly[$j-1]; + } + } + // rs->genpoly[0] can never be zero + $rs->genpoly[0] = $rs->alpha_to[$rs->modnn($rs->index_of[$rs->genpoly[0]] + $root)]; + } + + // convert rs->genpoly[] to index form for quicker encoding + for ($i = 0; $i <= $nroots; $i++) + $rs->genpoly[$i] = $rs->index_of[$rs->genpoly[$i]]; + + return $rs; + } + + //---------------------------------------------------------------------- + public function encode_rs_char($data, &$parity) + { + $MM =& $this->mm; + $NN =& $this->nn; + $ALPHA_TO =& $this->alpha_to; + $INDEX_OF =& $this->index_of; + $GENPOLY =& $this->genpoly; + $NROOTS =& $this->nroots; + $FCR =& $this->fcr; + $PRIM =& $this->prim; + $IPRIM =& $this->iprim; + $PAD =& $this->pad; + $A0 =& $NN; + + $parity = array_fill(0, $NROOTS, 0); + + for($i=0; $i< ($NN-$NROOTS-$PAD); $i++) { + + $feedback = $INDEX_OF[$data[$i] ^ $parity[0]]; + if($feedback != $A0) { + // feedback term is non-zero + + // This line is unnecessary when GENPOLY[NROOTS] is unity, as it must + // always be for the polynomials constructed by init_rs() + $feedback = $this->modnn($NN - $GENPOLY[$NROOTS] + $feedback); + + for($j=1;$j<$NROOTS;$j++) { + $parity[$j] ^= $ALPHA_TO[$this->modnn($feedback + $GENPOLY[$NROOTS-$j])]; + } + } + + // Shift + array_shift($parity); + if($feedback != $A0) { + array_push($parity, $ALPHA_TO[$this->modnn($feedback + $GENPOLY[0])]); + } else { + array_push($parity, 0); + } + } + } +} + +//########################################################################## + +class QRrs { + + public static $items = []; + + //---------------------------------------------------------------------- + public static function init_rs($symsize, $gfpoly, $fcr, $prim, $nroots, $pad) + { + foreach(self::$items as $rs) { + if($rs->pad != $pad) continue; + if($rs->nroots != $nroots) continue; + if($rs->mm != $symsize) continue; + if($rs->gfpoly != $gfpoly) continue; + if($rs->fcr != $fcr) continue; + if($rs->prim != $prim) continue; + + return $rs; + } + + $rs = QRrsItem::init_rs_char($symsize, $gfpoly, $fcr, $prim, $nroots, $pad); + array_unshift(self::$items, $rs); + + return $rs; + } +} + +/* + * PHP QR Code encoder + * + * Masking + * + * Based on libqrencode C library distributed under LGPL 2.1 + * Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi + * + * PHP QR Code is distributed under LGPL 3 + * Copyright (C) 2010 Dominik Dzienia + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +define('N1', 3); +define('N2', 3); +define('N3', 40); +define('N4', 10); + +class QRmask { + + public $runLength = []; + + //---------------------------------------------------------------------- + public function __construct() + { + $this->runLength = array_fill(0, QRSPEC_WIDTH_MAX + 1, 0); + } + + //---------------------------------------------------------------------- + public function writeFormatInformation($width, &$frame, $mask, $level) + { + $blacks = 0; + $format = QRspec::getFormatInfo($mask, $level); + + for($i=0; $i<8; $i++) { + if($format & 1) { + $blacks += 2; + $v = 0x85; + } else { + $v = 0x84; + } + + $frame[8][$width - 1 - $i] = chr($v); + if($i < 6) { + $frame[$i][8] = chr($v); + } else { + $frame[$i + 1][8] = chr($v); + } + $format = $format >> 1; + } + + for($i=0; $i<7; $i++) { + if($format & 1) { + $blacks += 2; + $v = 0x85; + } else { + $v = 0x84; + } + + $frame[$width - 7 + $i][8] = chr($v); + if($i == 0) { + $frame[8][7] = chr($v); + } else { + $frame[8][6 - $i] = chr($v); + } + + $format = $format >> 1; + } + + return $blacks; + } + + //---------------------------------------------------------------------- + public function mask0($x, $y) { return ($x+$y)&1; } + public function mask1($x, $y) { return ($y&1); } + public function mask2($x, $y) { return ($x%3); } + public function mask3($x, $y) { return ($x+$y)%3; } + public function mask4($x, $y) { return (((int)($y/2))+((int)($x/3)))&1; } + public function mask5($x, $y) { return (($x*$y)&1)+($x*$y)%3; } + public function mask6($x, $y) { return ((($x*$y)&1)+($x*$y)%3)&1; } + public function mask7($x, $y) { return ((($x*$y)%3)+(($x+$y)&1))&1; } + + //---------------------------------------------------------------------- + private function generateMaskNo($maskNo, $width, $frame) + { + $bitMask = array_fill(0, $width, array_fill(0, $width, 0)); + + for($y=0; $y<$width; $y++) { + for($x=0; $x<$width; $x++) { + if(ord($frame[$y][$x]) & 0x80) { + $bitMask[$y][$x] = 0; + } else { + $maskFunc = call_user_func(array($this, 'mask'.$maskNo), $x, $y); + $bitMask[$y][$x] = ($maskFunc == 0)?1:0; + } + + } + } + + return $bitMask; + } + + //---------------------------------------------------------------------- + public function serial($bitFrame) + { + $codeArr = []; + + foreach ($bitFrame as $line) + $codeArr[] = join('', $line); + + return gzcompress(join("\n", $codeArr), 9); + } + + //---------------------------------------------------------------------- + public function unserial($code) + { + $codeArr = []; + + $codeLines = explode("\n", gzuncompress($code)); + foreach ($codeLines as $line) + $codeArr[] = str_split($line); + + return $codeArr; + } + + //---------------------------------------------------------------------- + public function makeMaskNo($maskNo, $width, $s, &$d, $maskGenOnly = false) + { + $b = 0; + $bitMask = []; + + $fileName = QR_CACHE_DIR.'mask_'.$maskNo.DIRECTORY_SEPARATOR.'mask_'.$width.'_'.$maskNo.'.dat'; + + if (QR_CACHEABLE) { + if (file_exists($fileName)) { + $bitMask = self::unserial(MEC_file::read($fileName)); + } else { + $bitMask = $this->generateMaskNo($maskNo, $width, $s, $d); + if (!file_exists(QR_CACHE_DIR.'mask_'.$maskNo)) + mkdir(QR_CACHE_DIR.'mask_'.$maskNo); + MEC_file::write($fileName, self::serial($bitMask)); + } + } else { + $bitMask = $this->generateMaskNo($maskNo, $width, $s, $d); + } + + if ($maskGenOnly) + return; + + $d = $s; + + for($y=0; $y<$width; $y++) { + for($x=0; $x<$width; $x++) { + if($bitMask[$y][$x] == 1) { + $d[$y][$x] = chr(ord($s[$y][$x]) ^ (int)$bitMask[$y][$x]); + } + $b += (int)(ord($d[$y][$x]) & 1); + } + } + + return $b; + } + + //---------------------------------------------------------------------- + public function makeMask($width, $frame, $maskNo, $level) + { + $masked = array_fill(0, $width, str_repeat("\0", $width)); + $this->makeMaskNo($maskNo, $width, $frame, $masked); + $this->writeFormatInformation($width, $masked, $maskNo, $level); + + return $masked; + } + + //---------------------------------------------------------------------- + public function calcN1N3($length) + { + $demerit = 0; + + for($i=0; $i<$length; $i++) { + + if($this->runLength[$i] >= 5) { + $demerit += (N1 + ($this->runLength[$i] - 5)); + } + if($i & 1) { + if(($i >= 3) && ($i < ($length-2)) && ($this->runLength[$i] % 3 == 0)) { + $fact = (int)($this->runLength[$i] / 3); + if(($this->runLength[$i-2] == $fact) && + ($this->runLength[$i-1] == $fact) && + ($this->runLength[$i+1] == $fact) && + ($this->runLength[$i+2] == $fact)) { + if(($this->runLength[$i-3] < 0) || ($this->runLength[$i-3] >= (4 * $fact))) { + $demerit += N3; + } else if((($i+3) >= $length) || ($this->runLength[$i+3] >= (4 * $fact))) { + $demerit += N3; + } + } + } + } + } + return $demerit; + } + + //---------------------------------------------------------------------- + public function evaluateSymbol($width, $frame) + { + $head = 0; + $demerit = 0; + + for($y=0; $y<$width; $y++) { + $head = 0; + $this->runLength[0] = 1; + + $frameY = $frame[$y]; + + if ($y>0) + $frameYM = $frame[$y-1]; + + for($x=0; $x<$width; $x++) { + if(($x > 0) && ($y > 0)) { + $b22 = ord($frameY[$x]) & ord($frameY[$x-1]) & ord($frameYM[$x]) & ord($frameYM[$x-1]); + $w22 = ord($frameY[$x]) | ord($frameY[$x-1]) | ord($frameYM[$x]) | ord($frameYM[$x-1]); + + if(($b22 | ($w22 ^ 1))&1) { + $demerit += N2; + } + } + if(($x == 0) && (ord($frameY[$x]) & 1)) { + $this->runLength[0] = -1; + $head = 1; + $this->runLength[$head] = 1; + } else if($x > 0) { + if((ord($frameY[$x]) ^ ord($frameY[$x-1])) & 1) { + $head++; + $this->runLength[$head] = 1; + } else { + $this->runLength[$head]++; + } + } + } + + $demerit += $this->calcN1N3($head+1); + } + + for($x=0; $x<$width; $x++) { + $head = 0; + $this->runLength[0] = 1; + + for($y=0; $y<$width; $y++) { + if($y == 0 && (ord($frame[$y][$x]) & 1)) { + $this->runLength[0] = -1; + $head = 1; + $this->runLength[$head] = 1; + } else if($y > 0) { + if((ord($frame[$y][$x]) ^ ord($frame[$y-1][$x])) & 1) { + $head++; + $this->runLength[$head] = 1; + } else { + $this->runLength[$head]++; + } + } + } + + $demerit += $this->calcN1N3($head+1); + } + + return $demerit; + } + + + //---------------------------------------------------------------------- + public function mask($width, $frame, $level) + { + $minDemerit = PHP_INT_MAX; + $bestMaskNum = 0; + $bestMask = []; + + $checked_masks = array(0,1,2,3,4,5,6,7); + + if (QR_FIND_FROM_RANDOM !== false) { + + $howManuOut = 8-(QR_FIND_FROM_RANDOM % 9); + for ($i = 0; $i < $howManuOut; $i++) { + $remPos = rand (0, count($checked_masks)-1); + unset($checked_masks[$remPos]); + $checked_masks = array_values($checked_masks); + } + + } + + $bestMask = $frame; + + foreach($checked_masks as $i) { + $mask = array_fill(0, $width, str_repeat("\0", $width)); + + $demerit = 0; + $blacks = 0; + $blacks = $this->makeMaskNo($i, $width, $frame, $mask); + $blacks += $this->writeFormatInformation($width, $mask, $i, $level); + $blacks = (int)(100 * $blacks / ($width * $width)); + $demerit = (int)((int)(abs($blacks - 50) / 5) * N4); + $demerit += $this->evaluateSymbol($width, $mask); + + if($demerit < $minDemerit) { + $minDemerit = $demerit; + $bestMask = $mask; + $bestMaskNum = $i; + } + } + + return $bestMask; + } +} + +/* + * PHP QR Code encoder + * + * Main encoder classes. + * + * Based on libqrencode C library distributed under LGPL 2.1 + * Copyright (C) 2006, 2007, 2008, 2009 Kentaro Fukuchi + * + * PHP QR Code is distributed under LGPL 3 + * Copyright (C) 2010 Dominik Dzienia + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +class QRrsblock { + public $dataLength; + public $data = []; + public $eccLength; + public $ecc = []; + + public function __construct($dl, $data, $el, &$ecc, QRrsItem $rs) + { + $rs->encode_rs_char($data, $ecc); + + $this->dataLength = $dl; + $this->data = $data; + $this->eccLength = $el; + $this->ecc = $ecc; + } +} + +//########################################################################## + +class QRrawcode { + public $version; + public $datacode = []; + public $ecccode = []; + public $blocks; + public $rsblocks = []; //of RSblock + public $count; + public $dataLength; + public $eccLength; + public $b1; + + //---------------------------------------------------------------------- + public function __construct(QRinput $input) + { + $spec = array(0,0,0,0,0); + + $this->datacode = $input->getByteStream(); + if(is_null($this->datacode)) { + throw new Exception('null imput string'); + } + + QRspec::getEccSpec($input->getVersion(), $input->getErrorCorrectionLevel(), $spec); + + $this->version = $input->getVersion(); + $this->b1 = QRspec::rsBlockNum1($spec); + $this->dataLength = QRspec::rsDataLength($spec); + $this->eccLength = QRspec::rsEccLength($spec); + $this->ecccode = array_fill(0, $this->eccLength, 0); + $this->blocks = QRspec::rsBlockNum($spec); + + $ret = $this->init($spec); + if($ret < 0) { + throw new Exception('block alloc error'); + return null; + } + + $this->count = 0; + } + + //---------------------------------------------------------------------- + public function init(array $spec) + { + $dl = QRspec::rsDataCodes1($spec); + $el = QRspec::rsEccCodes1($spec); + $rs = QRrs::init_rs(8, 0x11d, 0, 1, $el, 255 - $dl - $el); + + + $blockNo = 0; + $dataPos = 0; + $eccPos = 0; + for($i=0; $iecccode,$eccPos); + $this->rsblocks[$blockNo] = new QRrsblock($dl, array_slice($this->datacode, $dataPos), $el, $ecc, $rs); + $this->ecccode = array_merge(array_slice($this->ecccode,0, $eccPos), $ecc); + + $dataPos += $dl; + $eccPos += $el; + $blockNo++; + } + + if(QRspec::rsBlockNum2($spec) == 0) + return 0; + + $dl = QRspec::rsDataCodes2($spec); + $el = QRspec::rsEccCodes2($spec); + $rs = QRrs::init_rs(8, 0x11d, 0, 1, $el, 255 - $dl - $el); + + if($rs == NULL) return -1; + + for($i=0; $iecccode,$eccPos); + $this->rsblocks[$blockNo] = new QRrsblock($dl, array_slice($this->datacode, $dataPos), $el, $ecc, $rs); + $this->ecccode = array_merge(array_slice($this->ecccode,0, $eccPos), $ecc); + + $dataPos += $dl; + $eccPos += $el; + $blockNo++; + } + + return 0; + } + + //---------------------------------------------------------------------- + public function getCode() + { + if($this->count < $this->dataLength) { + $row = $this->count % $this->blocks; + $col = $this->count / $this->blocks; + if($col >= $this->rsblocks[0]->dataLength) { + $row += $this->b1; + } + $ret = $this->rsblocks[$row]->data[$col]; + } else if($this->count < $this->dataLength + $this->eccLength) { + $row = ($this->count - $this->dataLength) % $this->blocks; + $col = ($this->count - $this->dataLength) / $this->blocks; + $ret = $this->rsblocks[$row]->ecc[$col]; + } else { + return 0; + } + $this->count++; + + return $ret; + } +} + +//########################################################################## + +class QRcode { + + public $version; + public $width; + public $data; + + //---------------------------------------------------------------------- + public function encodeMask(QRinput $input, $mask) + { + if($input->getVersion() < 0 || $input->getVersion() > QRSPEC_VERSION_MAX) { + throw new Exception('wrong version'); + } + if($input->getErrorCorrectionLevel() > QR_ECLEVEL_H) { + throw new Exception('wrong level'); + } + + $raw = new QRrawcode($input); + + QRtools::markTime('after_raw'); + + $version = $raw->version; + $width = QRspec::getWidth($version); + $frame = QRspec::newFrame($version); + + $filler = new FrameFiller($width, $frame); + if(is_null($filler)) { + return NULL; + } + + // inteleaved data and ecc codes + for($i=0; $i<$raw->dataLength + $raw->eccLength; $i++) { + $code = $raw->getCode(); + $bit = 0x80; + for($j=0; $j<8; $j++) { + $addr = $filler->next(); + $filler->setFrameAt($addr, 0x02 | (($bit & $code) != 0)); + $bit = $bit >> 1; + } + } + + QRtools::markTime('after_filler'); + + unset($raw); + + // remainder bits + $j = QRspec::getRemainder($version); + for($i=0; $i<$j; $i++) { + $addr = $filler->next(); + $filler->setFrameAt($addr, 0x02); + } + + $frame = $filler->frame; + unset($filler); + + + // masking + $maskObj = new QRmask(); + if($mask < 0) { + + if (QR_FIND_BEST_MASK) { + $masked = $maskObj->mask($width, $frame, $input->getErrorCorrectionLevel()); + } else { + $masked = $maskObj->makeMask($width, $frame, (intval(QR_DEFAULT_MASK) % 8), $input->getErrorCorrectionLevel()); + } + } else { + $masked = $maskObj->makeMask($width, $frame, $mask, $input->getErrorCorrectionLevel()); + } + + if($masked == NULL) { + return NULL; + } + + QRtools::markTime('after_mask'); + + $this->version = $version; + $this->width = $width; + $this->data = $masked; + + return $this; + } + + //---------------------------------------------------------------------- + public function encodeInput(QRinput $input) + { + return $this->encodeMask($input, -1); + } + + //---------------------------------------------------------------------- + public function encodeString8bit($string, $version, $level) + { + if(string == NULL) { + throw new Exception('empty string!'); + return NULL; + } + + $input = new QRinput($version, $level); + if($input == NULL) return NULL; + + $ret = $input->append($input, QR_MODE_8, strlen($string), str_split($string)); + if($ret < 0) { + unset($input); + return NULL; + } + return $this->encodeInput($input); + } + + //---------------------------------------------------------------------- + public function encodeString($string, $version, $level, $hint, $casesensitive) + { + + if($hint != QR_MODE_8 && $hint != QR_MODE_KANJI) { + throw new Exception('bad hint'); + return NULL; + } + + $input = new QRinput($version, $level); + if($input == NULL) return NULL; + + $ret = QRsplit::splitStringToQRinput($string, $input, $hint, $casesensitive); + if($ret < 0) { + return NULL; + } + + return $this->encodeInput($input); + } + + //-------------------------------------- Created by hoseinrafiei@gmail.com -------------------------------// + public function getImgResult($text, $outfile = false, $level = QR_ECLEVEL_L, $size = 3, $margin = 4, $saveandprint=false) + { + $enc = QRencode::factory($level, $size, $margin); + return $enc->getEncodedPNG($text, $outfile, $saveandprint=false); + } + + //---------------------------------------------------------------------- + public function getEncodedPNG($intext, $outfile = false,$saveandprint=false) + { + try { + + ob_start(); + $tab = $this->encode($intext); + $err = ob_get_contents(); + ob_end_clean(); + + if ($err != '') + QRtools::log($outfile, $err); + + $maxSize = (int)(QR_PNG_MAXIMUM_SIZE / (count($tab)+2*$this->margin)); + + QRimage::png($tab, $outfile, min(max(1, $this->size), $maxSize), $this->margin,$saveandprint); + + } catch (Exception $e) { + + QRtools::log($outfile, $e->getMessage()); + + } + } + + //---------------------------------------------------------------------- + public function png($text, $outfile = false, $level = QR_ECLEVEL_L, $size = 3, $margin = 4, $saveandprint=false) + { + $enc = QRencode::factory($level, $size, $margin); + return $enc->encodePNG($text, $outfile, $saveandprint=false); + } + + //---------------------------------------------------------------------- + public function text($text, $outfile = false, $level = QR_ECLEVEL_L, $size = 3, $margin = 4) + { + $enc = QRencode::factory($level, $size, $margin); + return $enc->encode($text, $outfile); + } + + //---------------------------------------------------------------------- + public function raw($text, $outfile = false, $level = QR_ECLEVEL_L, $size = 3, $margin = 4) + { + $enc = QRencode::factory($level, $size, $margin); + return $enc->encodeRAW($text, $outfile); + } +} + +//########################################################################## + +class FrameFiller { + + public $width; + public $frame; + public $x; + public $y; + public $dir; + public $bit; + + //---------------------------------------------------------------------- + public function __construct($width, &$frame) + { + $this->width = $width; + $this->frame = $frame; + $this->x = $width - 1; + $this->y = $width - 1; + $this->dir = -1; + $this->bit = -1; + } + + //---------------------------------------------------------------------- + public function setFrameAt($at, $val) + { + $this->frame[$at['y']][$at['x']] = chr($val); + } + + //---------------------------------------------------------------------- + public function getFrameAt($at) + { + return ord($this->frame[$at['y']][$at['x']]); + } + + //---------------------------------------------------------------------- + public function next() + { + do { + + if($this->bit == -1) { + $this->bit = 0; + return array('x'=>$this->x, 'y'=>$this->y); + } + + $x = $this->x; + $y = $this->y; + $w = $this->width; + + if($this->bit == 0) { + $x--; + $this->bit++; + } else { + $x++; + $y += $this->dir; + $this->bit--; + } + + if($this->dir < 0) { + if($y < 0) { + $y = 0; + $x -= 2; + $this->dir = 1; + if($x == 6) { + $x--; + $y = 9; + } + } + } else { + if($y == $w) { + $y = $w - 1; + $x -= 2; + $this->dir = -1; + if($x == 6) { + $x--; + $y -= 8; + } + } + } + if($x < 0 || $y < 0) return null; + + $this->x = $x; + $this->y = $y; + + } while(ord($this->frame[$y][$x]) & 0x80); + + return array('x'=>$x, 'y'=>$y); + } + +} + +//########################################################################## + +class QRencode { + + public $casesensitive = true; + public $eightbit = false; + + public $version = 0; + public $size = 3; + public $margin = 4; + + public $structured = 0; // not supported yet + + public $level = QR_ECLEVEL_L; + public $hint = QR_MODE_8; + + //---------------------------------------------------------------------- + public static function factory($level = QR_ECLEVEL_L, $size = 3, $margin = 4) + { + $enc = new QRencode(); + $enc->size = $size; + $enc->margin = $margin; + + switch ($level.'') { + case '0': + case '1': + case '2': + case '3': + $enc->level = $level; + break; + case 'l': + case 'L': + $enc->level = QR_ECLEVEL_L; + break; + case 'm': + case 'M': + $enc->level = QR_ECLEVEL_M; + break; + case 'q': + case 'Q': + $enc->level = QR_ECLEVEL_Q; + break; + case 'h': + case 'H': + $enc->level = QR_ECLEVEL_H; + break; + } + + return $enc; + } + + //---------------------------------------------------------------------- + public function encodeRAW($intext, $outfile = false) + { + $code = new QRcode(); + + if($this->eightbit) { + $code->encodeString8bit($intext, $this->version, $this->level); + } else { + $code->encodeString($intext, $this->version, $this->level, $this->hint, $this->casesensitive); + } + + return $code->data; + } + + //---------------------------------------------------------------------- + public function encode($intext, $outfile = false) + { + $code = new QRcode(); + + if($this->eightbit) { + $code->encodeString8bit($intext, $this->version, $this->level); + } else { + $code->encodeString($intext, $this->version, $this->level, $this->hint, $this->casesensitive); + } + + QRtools::markTime('after_encode'); + + if ($outfile!== false) { + MEC_file::write($outfile, join("\n", QRtools::binarize($code->data))); + } else { + return QRtools::binarize($code->data); + } + } + + //---------------------------------------------------------------------- + public function encodePNG($intext, $outfile = false,$saveandprint=false) + { + try { + + ob_start(); + $tab = $this->encode($intext); + $err = ob_get_contents(); + ob_end_clean(); + + if ($err != '') + QRtools::log($outfile, $err); + + $maxSize = (int)(QR_PNG_MAXIMUM_SIZE / (count($tab)+2*$this->margin)); + + QRimage::png($tab, $outfile, min(max(1, $this->size), $maxSize), $this->margin,$saveandprint); + + } catch (Exception $e) { + + QRtools::log($outfile, $e->getMessage()); + + } + } +} \ No newline at end of file diff --git a/app/libraries/render.php b/app/libraries/render.php new file mode 100755 index 0000000..44aa145 --- /dev/null +++ b/app/libraries/render.php @@ -0,0 +1,1887 @@ + + */ +class MEC_render extends MEC_base +{ + public $db; + public $main; + public $file; + public $settings; + public $post_atts; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Add image size for list and carousel + add_image_size('thumblist', '300', '300', true); + add_image_size('thumbrelated', '500', '500', true); + add_image_size('meccarouselthumb', '474', '324', true); + add_image_size('gridsquare', '391', '260', true); + add_image_size('tileview', '300', '400', true); + + // Import MEC skin class + MEC::import('app.libraries.skins'); + + // MEC main library + $this->main = $this->getMain(); + + // MEC file library + $this->file = $this->getFile(); + + // MEC DB library + $this->db = $this->getDB(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + } + + /** + * Do the shortcode and return its output + * @author Webnus + * @param array $atts + * @return string + */ + public function shortcode($atts) + { + $calendar_id = isset($atts['id']) ? (int) $atts['id'] : 0; + $atts['id'] = $calendar_id; + + global $MEC_Shortcode_id; + $MEC_Shortcode_id = $calendar_id; + $atts = apply_filters('mec_calendar_atts', $this->parse($calendar_id, $atts)); + + $skin = $atts['skin'] ?? $this->get_default_layout(); + return $this->skin($skin, $atts); + } + + /** + * Do the shortcode and return its json output + * @author Webnus + * @param array $atts + * @return string + */ + public function shortcode_json($atts) + { + $calendar_id = $atts['id'] ?? 0; + $atts = apply_filters('mec_calendar_atts', $this->parse($calendar_id, $atts)); + + $skin = $atts['skin'] ?? $this->get_default_layout(); + $json = $this->skin($skin, $atts); + + $path = MEC::import('app.skins.'.$skin, true, true); + $skin_path = apply_filters('mec_skin_path', $skin); + + if($skin_path != $skin and $this->file->exists($skin_path)) $path = $skin_path; + if(!$this->file->exists($path)) + { + return esc_html__('Skin controller does not exist.', 'modern-events-calendar-lite'); + } + + include_once $path; + + $skin_class_name = 'MEC_skin_'.$skin; + + // Create Skin Object Class + $SKO = new $skin_class_name(); + + // Initialize the skin + $SKO->initialize($atts); + + $atts['content_html'] = $SKO->output(); + + if( 'full_calendar' == $skin ) { + + $default_atts = $SKO->prepare_skin_options( $skin, $atts ); + $default_view = $default_atts['default_view'] ?? 'list'; + + $skin_class_name = 'MEC_skin_'.$default_view; + + // Create Skin Object Class + $default_SKO = new $skin_class_name(); + + // Initialize the skin + $default_SKO->initialize($default_atts); + + // Fetch the events + $atts['content_json'] = $default_SKO->fetch(); + }else{ + + // Fetch the events + $atts['content_json'] = $SKO->fetch(); + } + + return $atts; + } + + /** + * Do the widget and return its output + * @author Webnus + * @param int $calendar_id + * @param array $atts + * @return string + */ + public function widget($calendar_id, $atts = array()) + { + $atts = apply_filters('mec_calendar_atts', $this->parse($calendar_id, $atts)); + + $skin = $atts['skin'] ?? $this->get_default_layout(); + return $this->skin($skin, $atts); + } + + /** + * Do the yearly_view skin and returns its output + * @author Webnus + * @param array $atts + * @return string + */ + public function vyear($atts = array()) + { + $atts = apply_filters('mec_vyear_atts', $atts); + $skin = 'yearly_view'; + + return $this->skin($skin, $atts); + } + + /** + * Do the monthly_view skin and returns its output + * @author Webnus + * @param array $atts + * @return string + */ + public function vmonth($atts = array()) + { + $atts = apply_filters('mec_vmonth_atts', $atts); + $skin = 'monthly_view'; + + return $this->skin($skin, $atts); + } + + /** + * Do the full_calendar skin and returns its output + * @author Webnus + * @param array $atts + * @return string + */ + public function vfull($atts = array()) + { + $atts = apply_filters('mec_vfull_atts', $atts); + $skin = 'full_calendar'; + + return $this->skin($skin, $atts); + } + + /** + * Do the default_full_calendar skin and returns its output (archive page) + * @author Webnus + * @param array $atts + * @return string + */ + public function vdefaultfull($atts = array()) + { + $atts = apply_filters('mec_vdefaultfull_atts', $atts); + $skin = 'default_full_calendar'; + + return $this->skin($skin, $atts); + } + + + /** + * Do the weekly_view skin and returns its output + * @author Webnus + * @param array $atts + * @return string + */ + public function vweek($atts = array()) + { + $atts = apply_filters('mec_vweek_atts', $atts); + $skin = 'weekly_view'; + + return $this->skin($skin, $atts); + } + + /** + * Do the timetable skin and returns its output + * @author Webnus + * @param array $atts + * @return string + */ + public function vtimetable($atts = array()) + { + $atts = apply_filters('mec_vtimetable_atts', $atts); + $skin = 'timetable'; + + return $this->skin($skin, $atts); + } + + /** + * Do the Masonry skin and returns its output + * @author Webnus + * @param array $atts + * @return string + */ + public function vmasonry($atts = array()) + { + $atts = apply_filters('mec_vmasonry_atts', $atts); + $skin = 'masonry'; + + return $this->skin($skin, $atts); + } + + /** + * Do the daily_view skin and returns its output + * @author Webnus + * @param array $atts + * @return string + */ + public function vday($atts = array()) + { + $atts = apply_filters('mec_vday_atts', $atts); + $skin = 'daily_view'; + + return $this->skin($skin, $atts); + } + + /** + * Do the map skin and returns its output + * @author Webnus + * @param array $atts + * @return string + */ + public function vmap($atts = array()) + { + $atts = apply_filters('mec_vmap_atts', $atts); + $skin = 'map'; + + return $this->skin($skin, $atts); + } + + /** + * Do the list skin and returns its output + * @author Webnus + * @param array $atts + * @return string + */ + public function vlist($atts = array()) + { + $atts = apply_filters('mec_vlist_atts', $atts); + $skin = 'list'; + + return $this->skin($skin, $atts); + } + + /** + * Do the tile skin and returns its output + * @author Webnus + * @param array $atts + * @return string + */ + public function vtile($atts = array()) + { + $atts = apply_filters('mec_vtile_atts', $atts); + $skin = 'tile'; + + return $this->skin($skin, $atts); + } + + /** + * Do the custom skin and returns its output + * @author Webnus + * @param array $atts + * @param string $type + * @param boolean $category + * @return string + */ + public function vcustom($atts, $type = 'archive', $category = false) + { + $k = 'custom_'.$type; + + $shortcode = (isset($this->settings[$k]) && !empty($this->settings[$k])) ? stripslashes($this->settings[$k]) : ''; + + // Add Category + if($category and is_tax('mec_category') and get_queried_object_id()) $shortcode = str_replace(']', ' category="'.get_queried_object_id().'"]', $shortcode); + + if(trim($shortcode)) return do_shortcode($shortcode); + return ''; + } + + /** + * Do the grid skin and returns its output + * @author Webnus + * @param array $atts + * @return string + */ + public function vgrid($atts = array()) + { + $atts = apply_filters('mec_vgrid_atts', $atts); + $skin = 'grid'; + + return $this->skin($skin, $atts); + } + + /** + * Do the agenda skin and returns its output + * @author Webnus + * @param array $atts + * @return string + */ + public function vagenda($atts = array()) + { + $atts = apply_filters('mec_vagenda_atts', $atts); + $skin = 'agenda'; + + return $this->skin($skin, $atts); + } + + /** + * Do the agenda skin and returns its output + * @author Webnus + * @param array $atts + * @return string + */ + public function vgeneral_calendar($atts = array()) + { + $atts = array('is_categoy_page' => is_tax( 'mec_category' )); + $atts = apply_filters('mec_vgeneral_calendar_atts', $atts); + $skin = 'general_calendar'; + + return $this->skin($skin, $atts); + } + + public function get_skins() + { + return [ + 'monthly_view', + 'full_calendar', + 'yearly_view', + 'weekly_view', + 'daily_view', + 'timetable', + 'masonry', + 'list', + 'grid', + 'agenda', + 'map', + 'general_calendar', + 'custom' + ]; + } + + /** + * Do the default archive skin and returns its output + * @author Webnus + * @param array $atts + * @return string + */ + public function vdefault($atts = array()) + { + $skins = $this->get_skins(); + foreach($skins as $skin) + { + $skin_style = (isset($this->settings[$skin . '_archive_skin']) and trim($this->settings[$skin . '_archive_skin']) != '') ? $this->settings[$skin . '_archive_skin'] : null; + if(!empty($skin_style)) + { + $atts['sk-options'][ $skin ]['style'] = $skin_style; + } + } + + $monthly_skin = (isset($this->settings['monthly_view_archive_skin']) and trim($this->settings['monthly_view_archive_skin']) != '') ? $this->settings['monthly_view_archive_skin'] : 'clean'; + $list_skin = (isset($this->settings['list_archive_skin']) and trim($this->settings['list_archive_skin']) != '') ? $this->settings['list_archive_skin'] : 'standard'; + $grid_skin = (isset($this->settings['grid_archive_skin']) and trim($this->settings['grid_archive_skin']) != '') ? $this->settings['grid_archive_skin'] : 'classic'; + $timetable_skin = (isset($this->settings['timetable_archive_skin']) and trim($this->settings['timetable_archive_skin']) != '') ? $this->settings['timetable_archive_skin'] : 'modern'; + + if(!isset($this->settings['default_skin_archive']) or (isset($this->settings['default_skin_archive']) and trim($this->settings['default_skin_archive']) == '')) + { + return $this->vdefaultfull($atts); + } + + if($this->settings['default_skin_archive'] == 'monthly_view') $content = $this->vmonth(array_merge($atts, array('sk-options'=>array('monthly_view'=>array('style'=>$monthly_skin))))); + elseif($this->settings['default_skin_archive'] == 'full_calendar') $content = $this->vdefaultfull($atts); + elseif($this->settings['default_skin_archive'] == 'yearly_view') $content = $this->vyear($atts); + elseif($this->settings['default_skin_archive'] == 'weekly_view') $content = $this->vweek($atts); + elseif($this->settings['default_skin_archive'] == 'daily_view') $content = $this->vday($atts); + elseif($this->settings['default_skin_archive'] == 'timetable') $content = $this->vtimetable(array_merge($atts, array('sk-options'=>array('timetable'=>array('style'=>$timetable_skin))))); + elseif($this->settings['default_skin_archive'] == 'masonry') $content = $this->vmasonry($atts); + elseif($this->settings['default_skin_archive'] == 'list') $content = $this->vlist(array_merge($atts, array('sk-options'=>array('list'=>array('style'=>$list_skin))))); + elseif($this->settings['default_skin_archive'] == 'grid') $content = $this->vgrid(array_merge($atts, array('sk-options'=>array('grid'=>array('style'=>$grid_skin))))); + elseif($this->settings['default_skin_archive'] == 'agenda') $content = $this->vagenda($atts); + elseif($this->settings['default_skin_archive'] == 'map') $content = $this->vmap($atts); + elseif($this->settings['default_skin_archive'] == 'general_calendar') $content = $this->vgeneral_calendar($atts); + elseif($this->settings['default_skin_archive'] == 'custom') $content = $this->vcustom($atts); + else $content = apply_filters('mec_default_skin_content', ''); + + return $content; + } + + /** + * Do the single skin and returns its output + * @author Webnus + * @param array $atts + * @return string + */ + public function vsingle($atts) + { + // Force to array + if(!is_array($atts)) $atts = []; + + // Get event ID + $event_id = $atts['id'] ?? 0; + + $defaults = array('maximum_dates'=>$this->settings['booking_maximum_dates'] ?? 6); + $atts = apply_filters('mec_vsingle_atts', $this->parse($event_id, wp_parse_args($atts, $defaults))); + + $skin = 'single'; + return $this->skin($skin, $atts); + } + + /** + * Do the category archive skin and returns its output + * @author Webnus + * @param array $atts + * @return string + */ + public function vcategory($atts = array()) + { + // Skin + $skin = (isset($this->settings['default_skin_category']) and trim($this->settings['default_skin_category']) != '') ? $this->settings['default_skin_category'] : 'list'; + + $skins = $this->get_skins(); + foreach($skins as $sk) + { + $skin_style = (isset($this->settings[$sk . '_archive_skin']) and trim($this->settings[$sk . '_archive_skin']) != '') ? $this->settings[$sk . '_archive_skin'] : null; + if(!empty($skin_style)) + { + $atts['sk-options'][ $sk ]['style'] = $skin_style; + } + } + + // Show Only Expired Events + if(isset($this->settings['category_events_method']) and $this->settings['category_events_method'] == 2) $atts['show_only_past_events'] = 1; + + $monthly_skin = (isset($this->settings['monthly_view_category_skin']) and trim($this->settings['monthly_view_category_skin']) != '') ? $this->settings['monthly_view_category_skin'] : 'classic'; + $list_skin = (isset($this->settings['list_category_skin']) and trim($this->settings['list_category_skin']) != '') ? $this->settings['list_category_skin'] : 'standard'; + $grid_skin = (isset($this->settings['grid_category_skin']) and trim($this->settings['grid_category_skin']) != '') ? $this->settings['grid_category_skin'] : 'classic'; + $timetable_skin = (isset($this->settings['timetable_category_skin']) and trim($this->settings['timetable_category_skin']) != '') ? $this->settings['timetable_category_skin'] : 'modern'; + + if($skin == 'full_calendar') $content = $this->vfull($atts); + elseif($skin == 'yearly_view') $content = $this->vyear($atts); + elseif($skin == 'masonry') $content = $this->vmasonry($atts); + elseif($skin == 'timetable') $content = $this->vtimetable(array_merge($atts, array('sk-options'=>array('timetable'=>array('style'=>$timetable_skin))))); + elseif($skin == 'monthly_view') $content = $this->vmonth(array_merge($atts, array('sk-options'=>array('monthly_view'=>array('style'=>$monthly_skin))))); + elseif($skin == 'weekly_view') $content = $this->vweek($atts); + elseif($skin == 'daily_view') $content = $this->vday($atts); + elseif($skin == 'list') $content = $this->vlist(array_merge($atts, array('sk-options'=>array('list'=>array('style'=>$list_skin))))); + elseif($skin == 'grid') $content = $this->vgrid(array_merge($atts, array('sk-options'=>array('grid'=>array('style'=>$grid_skin))))); + elseif($skin == 'agenda') $content = $this->vagenda($atts); + elseif($skin == 'map') $content = $this->vmap($atts); + elseif($skin == 'general_calendar') $content = $this->vgeneral_calendar($atts); + elseif($skin == 'custom') $content = $this->vcustom($atts,'archive_category', true); + else $content = apply_filters('mec_default_skin_content', ''); + + return $content; + } + + /** + * Merge args + * @author Webnus + * @param int $post_id + * @param array $atts + * @return array + */ + public function parse($post_id, $atts = array()) + { + if($this->post_atts) return wp_parse_args($atts, $this->post_atts); + + $post_atts = []; + if($post_id) $post_atts = $this->main->get_post_meta($post_id); + + return wp_parse_args($atts, $post_atts); + } + + /** + * Run the skin and returns its output + * @author Webnus + * @param string $skin + * @param array $atts + * @return string + */ + public function skin($skin, $atts = array()) + { + // Pro is Required for Some Skins + if(!$this->main->getPRO() and in_array($skin, array('agenda', 'yearly_view', 'timetable', 'masonry', 'map', 'available_spot'))) + { + return ''; + } + + $path = MEC::import('app.skins.'.$skin, true, true); + $skin_path = apply_filters('mec_skin_path', $skin); + + if($skin_path != $skin and $this->file->exists($skin_path)) $path = $skin_path; + if(!$this->file->exists($path)) + { + return esc_html__('Skin controller does not exist.', 'modern-events-calendar-lite'); + } + + include_once $path; + + $skin_class_name = 'MEC_skin_'.$skin; + + // Create Skin Object Class + $SKO = new $skin_class_name(); + + // Initialize the skin + $SKO->initialize($atts); + + // Search Events If Not Found In Current Month + $c = 0; + $break = false; + + do + { + if($c > 12 || $skin !== 'monthly_view') $break = true; + + if($c && !$break) + { + if(intval($SKO->month) == 12) + { + $SKO->year = intval($SKO->year)+1; + $SKO->month = '01'; + } + else $SKO->month = sprintf("%02d", intval($SKO->month)+1); + + $SKO->start_date = date('Y-m-d', strtotime($SKO->year.'-'.$SKO->month.'-01')); + + $day = current_time('d'); + $SKO->active_day = $SKO->year.'-'.$SKO->month.'-'.$day; + } + + // Fetch the events + $events = $SKO->fetch(); + + if($break) break; + + // Auto Rotation is Disabled + if(!isset($atts['auto_month_rotation']) || !$atts['auto_month_rotation']) break; + + $c++; + } + while(!count($events)); + + // Return the output + return $SKO->output(); + } + + /** + * Returns default skin + * @author Webnus + * @return string + */ + public function get_default_layout() + { + return apply_filters('mec_default_layout', 'list'); + } + + /** + * Renders and returns all event data + * @param int $post_id + * @param string $content + * @return \stdClass + * @throws Exception + * @author Webnus + */ + public function data($post_id, $content = NULL) + { + $cached = wp_cache_get($post_id, 'mec-events-data'); + if($cached) return $cached; + + $data = new stdClass(); + + // Post Data + $data->ID = $post_id; + $data->title = get_the_title($post_id); + $data->content = is_null($content) ? $this->main->get_post_content($post_id) : $content; + + // All Post Data + $post = get_post($post_id); + $data->post = $post; + + // All Meta Data + $meta = $this->main->get_post_meta($post_id, true); + if(isset($meta['mec_notifications'])) unset($meta['mec_notifications']); + if(isset($meta['mec_fees']) and is_array($meta['mec_fees']) and isset($meta['mec_fees'][':i:'])) unset($meta['mec_fees'][':i:']); + + $data->meta = $meta; + + // All MEC Data + $data->mec = $this->main->get_mec_events_data($post_id); + + $allday = $data->meta['mec_allday'] ?? 0; + $hide_time = $data->meta['mec_hide_time'] ?? 0; + $hide_end_time = $this->main->hide_end_time_status($post_id); + + $start_timestamp = ((isset($meta['mec_start_day_seconds']) and isset($meta['mec_start_date'])) ? (strtotime($meta['mec_start_date'])+$meta['mec_start_day_seconds']) : (isset($meta['mec_start_date']) ? strtotime($meta['mec_start_date']) : 0)); + $end_timestamp = ((isset($meta['mec_end_day_seconds']) and isset($meta['mec_end_date'])) ? (strtotime($meta['mec_end_date'])+$meta['mec_end_day_seconds']) : (isset($meta['mec_end_date']) ? strtotime($meta['mec_end_date']) : 0)); + + $start_time = $this->main->get_time($start_timestamp); + $end_time = $this->main->get_time($end_timestamp); + + if($hide_time) + { + $data->time = array( + 'start'=>'', + 'end'=>'', + 'start_raw'=>$start_time, + 'end_raw'=>$end_time, + 'start_timestamp'=>$start_timestamp, + 'end_timestamp'=>$end_timestamp, + ); + } + elseif($allday) + { + $data->time = array( + 'start'=>$this->main->m('all_day', esc_html__('All Day' , 'modern-events-calendar-lite')), + 'end'=>'', + 'start_raw'=>$start_time, + 'end_raw'=>$end_time, + 'start_timestamp'=>$start_timestamp, + 'end_timestamp'=>$end_timestamp, + ); + } + else + { + $data->time = array( + 'start'=>$start_time, + 'end'=>($hide_end_time ? '' : $end_time), + 'start_raw'=>$start_time, + 'end_raw'=>$end_time, + 'start_timestamp'=>$start_timestamp, + 'end_timestamp'=>$end_timestamp, + ); + } + + // Hourly Schedules + $meta_hourly_schedules = $meta['mec_hourly_schedules'] ?? []; + $first_key = key($meta_hourly_schedules); + + $hourly_schedules = []; + if(count($meta_hourly_schedules) and !isset($meta_hourly_schedules[$first_key]['schedules'])) + { + $hourly_schedules[] = array( + 'title' => esc_html__('Day 1', 'modern-events-calendar-lite'), + 'schedules'=>$meta_hourly_schedules + ); + } + else $hourly_schedules = $meta_hourly_schedules; + + $data->hourly_schedules = $hourly_schedules; + + $tickets = (isset($meta['mec_tickets']) and is_array($meta['mec_tickets'])) ? $meta['mec_tickets'] : []; + if(isset($tickets[':i:'])) unset($tickets[':i:']); + + $new_tickets = []; + foreach($tickets as $ticket_id => $ticket) + { + if(!is_numeric($ticket_id)) continue; + + $ticket['id'] = $ticket_id; + $new_tickets[$ticket_id] = $ticket; + } + + $data->tickets = $new_tickets; + $data->color = $meta['mec_color'] ?? ''; + $data->permalink = ((isset($meta['mec_read_more']) and filter_var($meta['mec_read_more'], FILTER_VALIDATE_URL)) ? $meta['mec_read_more'] : get_post_permalink($post_id)); + + // Thumbnails + $thumbnail = get_the_post_thumbnail($post, 'thumbnail', array('data-mec-postid'=>$post_id)); + $thumblist = get_the_post_thumbnail($post, 'thumblist' , array('data-mec-postid'=>$post_id)); + $gridsquare = get_the_post_thumbnail($post, 'gridsquare' , array('data-mec-postid'=>$post_id)); + $meccarouselthumb = get_the_post_thumbnail($post, 'meccarouselthumb' , array('data-mec-postid'=>$post_id)); + $medium = get_the_post_thumbnail($post, 'medium', array('data-mec-postid'=>$post_id)); + $large = get_the_post_thumbnail($post, 'large', array('data-mec-postid'=>$post_id)); + $full = get_the_post_thumbnail($post, 'full', array('data-mec-postid'=>$post_id)); + $tileview = get_the_post_thumbnail($post, 'tileview', array('data-mec-postid'=>$post_id)); + + if(trim($thumbnail) == '' and trim($medium) != '') $thumbnail = preg_replace("/height=\"[0-9]*\"/", 'height="150"', preg_replace("/width=\"[0-9]*\"/", 'width="150"', $medium)); + elseif(trim($thumbnail) == '' and trim($large) != '') $thumbnail = preg_replace("/height=\"[0-9]*\"/", 'height="150"', preg_replace("/width=\"[0-9]*\"/", 'width="150"', $large)); + + $dataThumbnails = apply_filters('mec-render-data-thumbnails', [ + 'thumbnail'=>$thumbnail, + 'thumblist'=>$thumblist, + 'gridsquare'=>$gridsquare, + 'meccarouselthumb'=>$meccarouselthumb, + 'medium'=>$medium, + 'large'=>$large, + 'full'=>$full, + 'tileview'=>$tileview + ], $post_id); + + $data->thumbnails = $dataThumbnails; + + // Featured image URLs + $dataFeaturedImage = apply_filters('mec-render-data-featured-image', array( + 'thumbnail'=>esc_url($this->main->get_post_thumbnail_url($post_id, 'thumbnail')), + 'thumblist'=>esc_url($this->main->get_post_thumbnail_url($post_id, 'thumblist' )), + 'gridsquare'=>esc_url($this->main->get_post_thumbnail_url($post_id, 'gridsquare' )), + 'meccarouselthumb'=>esc_url($this->main->get_post_thumbnail_url($post_id, 'meccarouselthumb')), + 'medium'=>esc_url($this->main->get_post_thumbnail_url($post_id, 'medium')), + 'large'=>esc_url($this->main->get_post_thumbnail_url($post_id, 'large')), + 'full'=>esc_url($this->main->get_post_thumbnail_url($post_id, 'full')), + 'tileview'=>esc_url($this->main->get_post_thumbnail_url($post_id, 'tileview')) + ), $post_id); + + $data->featured_image = $dataFeaturedImage; + + $taxonomies = array('mec_label', 'mec_location', 'mec_category', apply_filters('mec_taxonomy_tag', '')); + + if(!isset($this->settings['organizers_status']) || $this->settings['organizers_status']) $taxonomies[] = 'mec_organizer'; + if($this->getPRO() and isset($this->settings['sponsors_status']) and $this->settings['sponsors_status']) $taxonomies[] = 'mec_sponsor'; + + $terms = wp_get_post_terms($post_id, $taxonomies, array('fields'=>'all')); + foreach($terms as $term) + { + // First Validation + if(!isset($term->taxonomy)) continue; + + if($term->taxonomy == 'mec_label') $data->labels[$term->term_id] = array('id'=>$term->term_id, 'name'=>$term->name, 'color'=>get_metadata('term', $term->term_id, 'color', true), 'style'=>get_metadata('term', $term->term_id, 'style', true)); + elseif($term->taxonomy == 'mec_organizer') $data->organizers[$term->term_id] = array('id'=>$term->term_id, 'name'=>$term->name, 'tel'=>get_metadata('term', $term->term_id, 'tel', true), 'email'=>get_metadata('term', $term->term_id, 'email', true), 'url'=>get_metadata('term', $term->term_id, 'url', true), 'page_label'=>get_metadata('term', $term->term_id, 'page_label', true), 'thumbnail'=>get_metadata('term', $term->term_id, 'thumbnail', true)); + elseif($term->taxonomy == 'mec_location') + { + $locations = array('id'=>$term->term_id, 'name'=>$term->name, 'address'=>get_metadata('term', $term->term_id, 'address', true), 'opening_hour'=>get_metadata('term', $term->term_id, 'opening_hour', true), 'latitude'=>get_metadata('term', $term->term_id, 'latitude', true), 'longitude'=>get_metadata('term', $term->term_id, 'longitude', true), 'url'=>get_metadata('term', $term->term_id, 'url', true), 'tel'=>get_metadata('term', $term->term_id, 'tel', true), 'thumbnail'=>get_metadata('term', $term->term_id, 'thumbnail', true)); + $data->locations[$term->term_id] = apply_filters('mec_map_load_location_terms', $locations, $term); + } + elseif($term->taxonomy == 'mec_category') + { + $data->categories[$term->term_id] = array( + 'id'=>$term->term_id, + 'name'=>$term->name, + 'icon'=>get_metadata('term', $term->term_id, 'mec_cat_icon', true), + 'color'=>get_metadata('term', $term->term_id, 'mec_cat_color', true), + ); + } + elseif($term->taxonomy == apply_filters('mec_taxonomy_tag', '')) $data->tags[$term->term_id] = array('id'=>$term->term_id, 'name'=>$term->name); + elseif($term->taxonomy == 'mec_sponsor') + { + $data->sponsors[$term->term_id] = array( + 'id'=>$term->term_id, + 'name'=>$term->name, + 'link'=>get_metadata('term', $term->term_id, 'link', true), + 'logo'=>get_metadata('term', $term->term_id, 'logo', true) + ); + } + } + + // Speakers + if(isset($this->settings['speakers_status']) and $this->settings['speakers_status']) + { + $terms = wp_get_post_terms($post_id, 'mec_speaker', [ + 'fields' => 'all', + 'orderby' => 'meta_value_num', + 'meta_key' => 'mec_index' + ]); + + foreach($terms as $term) + { + $speaker_type = get_metadata('term', $term->term_id, 'type', true); + + $data->speakers[$term->term_id] = array( + 'id'=>$term->term_id, + 'name'=>$term->name, + 'type'=>$speaker_type ?: 'person', + 'job_title'=>get_metadata('term', $term->term_id, 'job_title', true), + 'tel'=>get_metadata('term', $term->term_id, 'tel', true), + 'email'=>get_metadata('term', $term->term_id, 'email', true), + 'facebook'=>get_metadata('term', $term->term_id, 'facebook', true), + 'twitter'=>get_metadata('term', $term->term_id, 'twitter', true), + 'gplus'=>get_metadata('term', $term->term_id, 'gplus', true), + 'thumbnail'=>get_metadata('term', $term->term_id, 'thumbnail', true) + ); + } + } + + // Event Fields + $fields = $this->main->get_event_fields(); + if(!is_array($fields)) $fields = []; + + $fields_data = (isset($data->meta['mec_fields']) and is_array($data->meta['mec_fields'])) ? $data->meta['mec_fields'] : get_post_meta($post_id, 'mec_fields', true); + if(!is_array($fields_data)) $fields_data = []; + + foreach($fields as $f => $field) + { + if(!is_numeric($f)) continue; + if(!isset($field['label'])) continue; + + $field_value = isset($fields_data[$f]) ? (is_array($fields_data[$f]) ? implode(', ', $fields_data[$f]) : $fields_data[$f]) : ''; + $data->fields[] = array( + 'id' => $f, + 'type' => ($field['type'] ?? NULL), + 'label' => esc_html__(stripslashes($field['label']), 'modern-events-calendar-lite'), + 'value' => stripslashes($field_value), + ); + } + + // Timezone Object + $data->TZO = $this->main->get_TZO($post_id); + + // Add mec event past index to array. + $end_date = (isset($data->meta['mec_date']['end']) and isset($data->meta['mec_date']['end']['date'])) ? $data->meta['mec_date']['end']['date'] : current_time('Y-m-d H:i:s'); + + $e_time = ''; + $e_time .= sprintf("%02d", ($data->meta['mec_date']['end']['hour'] ?? '6')).':'; + $e_time .= sprintf("%02d", ($data->meta['mec_date']['end']['minutes'] ?? '0')); + $e_time .= isset($data->meta['mec_date']['end']['ampm']) ? trim($data->meta['mec_date']['end']['ampm']) : 'PM'; + + $end_time = date('D M j Y G:i:s', strtotime($end_date.' '.$e_time)); + + $d1 = new DateTime(current_time("D M j Y G:i:s")); + $d2 = new DateTime($end_time); + + if($d2 < $d1) $data->meta['event_past'] = true; + else $data->meta['event_past'] = false; + + // Apply Filters + $data = apply_filters('mec_render_event_data', $data, $post_id); + + // Set to cache + wp_cache_set($post_id, $data, 'mec-events-data', 43200); + + //Edited Occurrences + $settings = $this->main->get_settings(); + $edit_per_occurrences=[]; + + if(isset($settings['per_occurrences_status']) and $settings['per_occurrences_status']) + { + $occ = new MEC_feature_occurrences(); + $occurrences = $occ->get_all_occurrences($post_id); + + foreach ($occurrences as $occurrence) + { + $date_start=date('Y-m-d', $occurrence['occurrence']); + $params=json_decode($occurrence['params'], true); + $params['location'] = (isset($params['location_id']) ? $this->main->get_location_data($params['location_id']) : array()); + $params['organizer'] = (isset($params['organizer_id']) ? $this->main->get_organizer_data($params['organizer_id']) : array()); + $edit_per_occurrences[$date_start]=$params; + } + } + + $data->edited_occurrences=$edit_per_occurrences; + + return $data; + } + + /** + * @param $event + * @param MEC_skins $skin + * @param int $serie + * @return mixed + */ + public function after_render($event, $skin, $serie = 1) + { + // If event is custom days and current date is available + if(isset($event->data) and isset($event->data->meta) and isset($event->data->meta['mec_repeat_type']) and $event->data->meta['mec_repeat_type'] === 'custom_days' and isset($event->data->mec) and isset($event->data->mec->days) and isset($event->date) and is_array($event->date) and isset($event->date['start']) and isset($event->date['start']['date'])) + { + // Time is already available + if(isset($event->date['start']['hour'])) + { + $hide_time = $event->data->meta['mec_hide_time'] ?? 0; + $hide_end_time = $this->main->hide_end_time_status($event->ID); + + $s_hour = $event->date['start']['hour']; + if(strtoupper($event->date['start']['ampm']) == 'AM' and $s_hour == '0') $s_hour = 12; + + $e_hour = $event->date['end']['hour']; + if(strtoupper($event->date['end']['ampm']) == 'AM' and $e_hour == '0') $e_hour = 12; + + $start_time = $event->date['start']['date'].' '.sprintf("%02d", $s_hour).':'.sprintf("%02d", $event->date['start']['minutes']).' '.$event->date['start']['ampm']; + $end_time = $event->date['end']['date'].' '.sprintf("%02d", $e_hour).':'.sprintf("%02d", $event->date['end']['minutes']).' '.$event->date['end']['ampm']; + + $start_timestamp = strtotime($start_time); + $end_timestamp = strtotime($end_time); + + $st = $this->main->get_time($start_timestamp); + $et = $this->main->get_time($end_timestamp); + + $allday = $event->data->meta['mec_allday'] ?? 0; + if($allday) + { + $st = $this->main->m('all_day', esc_html__('All Day' , 'modern-events-calendar-lite')); + $et = ''; + } + + $event->data->time = array( + 'start'=>($hide_time ? '' : $st), + 'end'=>(($hide_time or $hide_end_time) ? '' : $et), + 'start_raw'=>$st, + 'end_raw'=>$et, + 'start_timestamp'=>$start_timestamp, + 'end_timestamp'=>$end_timestamp, + ); + } + // Detect the time when not available + else + { + $multiple_day_show_method = \MEC\Settings\Settings::getInstance()->get_settings('multiple_day_show_method'); + $days_str = $event->data->mec->days; + + if(trim($days_str)) + { + $original_start_date = $event->data->meta['mec_start_date']; + $p_start_date = $event->date['start']['date']; + $allday = $event->data->meta['mec_allday'] ?? 0; + + // Do not change the hour if it is the first serie of the event + if(!($original_start_date == $p_start_date and $serie == 1)) + { + if($original_start_date == $p_start_date ) $serie -= 1; + $periods = explode(',', $days_str); + + $datetime_timestamp = strtotime($p_start_date); + + $p = 0; + foreach($periods as $period) + { + $ex = explode(':', $period); + $s_date = $ex[0] ?? false; + $e_date = $ex[1] ?? false; + + if(!$s_date || ($p_start_date!== $s_date && 'all_days' !== $multiple_day_show_method)) continue; + + $sd_timestamp = strtotime($s_date); + if($e_date) + { + $ed_timestamp = strtotime($e_date); + if(!($datetime_timestamp >= $sd_timestamp && $datetime_timestamp <= $ed_timestamp && isset($ex[2]) && isset($ex[3]))) continue; + } + + $p++; + if($p !== $serie) continue; + + $pos = strpos($ex[2], '-'); + if($pos !== false) $ex[2] = substr_replace($ex[2], ':', $pos, 1); + + $pos = strpos($ex[3], '-'); + if($pos !== false) $ex[3] = substr_replace($ex[3], ':', $pos, 1); + + $start_time = $s_date . ' ' . str_replace('-', ' ', $ex[2]); + $end_time = $e_date . ' ' . str_replace('-', ' ', $ex[3]); + + $this->add_time_to_event($event, $start_time, $end_time, $allday); + } + } + + // Do not show expired occurrences + if(!$skin->args['mec-past-events']) + { + $periods = explode(',', $days_str); + $current_time = current_time('timestamp'); + + if($event->data->time['start_timestamp'] < $current_time) + { + foreach($periods as $period) + { + $ex = explode(':', $period); + $s_date = $ex[0] ?? ''; + $e_date = $ex[1] ?? ''; + + if(!$s_date or !$e_date) continue; + + $s_time = $ex[2] ?? ''; + $e_time = $ex[3] ?? ''; + + $pos = strpos($s_time, '-'); + if($pos !== false) $s_time = substr_replace($s_time, ':', $pos, 1); + + $pos = strpos($e_time, '-'); + if($pos !== false) $e_time = substr_replace($e_time, ':', $pos, 1); + + $start_time = trim($s_date . ' ' . str_replace('-', ' ', $s_time)); + $end_time = trim($e_date . ' ' . str_replace('-', ' ', $e_time)); + + if(strtotime($start_time) < $current_time) continue; + + $this->add_time_to_event($event, $start_time, $end_time, $allday); + } + } + } + } + } + } + // If not custom days + elseif(isset($event->data) and isset($event->data->time) and isset($event->data->time['start_raw']) and isset($event->data->time['end_raw']) and isset($event->date) and isset($event->date['start']) and isset($event->date['end'])) + { + $start_time = $event->date['start']['date'].' '.$event->data->time['start_raw']; + $end_time = $event->date['end']['date'].' '.$event->data->time['end_raw']; + + $start_timestamp = strtotime($start_time); + $end_timestamp = strtotime($end_time); + + if((!$start_timestamp or !$end_timestamp) and isset($event->data->meta['mec_date']) and isset($event->data->meta['mec_date']['start']) and isset($event->data->meta['mec_date']['start']['hour']) and isset($event->data->meta['mec_date']['end']) and isset($event->data->meta['mec_date']['end']['hour'])) + { + $start_time = $event->date['start']['date'].' '.sprintf("%02d", $event->data->meta['mec_date']['start']['hour']).':'.sprintf("%02d", $event->data->meta['mec_date']['start']['minutes']).' '.$event->data->meta['mec_date']['start']['ampm']; + $end_time = $event->date['end']['date'].' '.sprintf("%02d", $event->data->meta['mec_date']['end']['hour']).':'.sprintf("%02d", $event->data->meta['mec_date']['end']['minutes']).' '.$event->data->meta['mec_date']['end']['ampm']; + + $start_timestamp = strtotime($start_time); + $end_timestamp = strtotime($end_time); + } + + if($start_timestamp and $end_timestamp) + { + $event->data->time['start_timestamp'] = $start_timestamp; + $event->data->time['end_timestamp'] = $end_timestamp; + } + } + + // Fill Start and End Dates + if(!isset($event->date['start']['hour']) or !isset($event->date['end']['hour'])) + { + $s_hour = $s_minutes = $s_ampm = $e_hour = $e_minutes = $e_ampm = NULL; + + if(isset($event->data->meta['mec_date']) and isset($event->data->meta['mec_date']['start']) and is_array($event->data->meta['mec_date']['start'])) + { + $s_hour = sprintf("%02d", $event->data->meta['mec_date']['start']['hour']); + $s_minutes = sprintf("%02d", $event->data->meta['mec_date']['start']['minutes']); + $s_ampm = strtolower($event->data->meta['mec_date']['start']['ampm']); + } + + if(isset($event->data->meta['mec_date']) and isset($event->data->meta['mec_date']['end']) and is_array($event->data->meta['mec_date']['end'])) + { + $e_hour = sprintf("%02d", $event->data->meta['mec_date']['end']['hour']); + $e_minutes = sprintf("%02d", $event->data->meta['mec_date']['end']['minutes']); + $e_ampm = strtolower($event->data->meta['mec_date']['end']['ampm']); + } + + if(isset($event->data->time) and isset($event->data->time['start_timestamp']) and $event->data->time['start_timestamp']) + { + $s_hour = date('h', $event->data->time['start_timestamp']); + $s_minutes = date('i', $event->data->time['start_timestamp']); + $s_ampm = date('a', $event->data->time['start_timestamp']); + } + + if(isset($event->data->time) and isset($event->data->time['end_timestamp']) and $event->data->time['end_timestamp']) + { + $e_hour = date('h', $event->data->time['end_timestamp']); + $e_minutes = date('i', $event->data->time['end_timestamp']); + $e_ampm = date('a', $event->data->time['end_timestamp']); + } + + $start_time = $event->date['start']['date'].' '.sprintf("%02d", $s_hour).':'.sprintf("%02d", $s_minutes).' '.$s_ampm; + $end_time = $event->date['end']['date'].' '.sprintf("%02d", $e_hour).':'.sprintf("%02d", $e_minutes).' '.$e_ampm; + + if($s_hour and $s_minutes and $s_ampm and strtotime($start_time)) + { + $d = ((isset($event->date['start']) and is_array($event->date['start'])) ? $event->date['start'] : array()); + $event->date['start'] = array_merge($d, array( + 'hour' => sprintf("%02d", $s_hour), + 'minutes' => sprintf("%02d", $s_minutes), + 'ampm' => $s_ampm, + 'timestamp' => strtotime($start_time), + )); + } + + if($e_hour and $e_minutes and $e_ampm and strtotime($end_time)) + { + $d = ((isset($event->date['end']) and is_array($event->date['end'])) ? $event->date['end'] : array()); + $event->date['end'] = array_merge($d, array( + 'hour' => sprintf("%02d", $e_hour), + 'minutes' => sprintf("%02d", $e_minutes), + 'ampm' => $e_ampm, + 'timestamp' => strtotime($end_time), + )); + } + } + + if($skin->skin != 'single' and !($skin->multiple_days_method == 'first_day' or ($skin->multiple_days_method == 'first_day_listgrid' and in_array($skin->skin, array('list', 'grid', 'slider', 'carousel', 'agenda', 'tile'))))) + { + // MEC Cache + $cache = $this->getCache(); + + // Cache Key + $key = $event->data->ID.'-'.$event->date['end']['date']; + + // Is Midnight Event + $midnight = $this->main->is_midnight_event($event); + + // Improve Time for Multiple Day Events + if($cache->has($key) or ($event->date['start']['date'] !== $event->date['end']['date'] and !$midnight)) + { + $allday = $event->data->meta['mec_allday'] ?? 0; + $hide_time = $event->data->meta['mec_hide_time'] ?? 0; + $hide_end_time = $this->main->hide_end_time_status($event->ID); + + // Get From Cache (Last Day) + if($cache->has($key) and $event->date['start']['date'] === $event->date['end']['date']) + { + list($new_start_time, $new_end_time) = $cache->get($key); + + // Delete the Cache + $cache->delete($key); + } + // Get From Cache (Between Days) + elseif($cache->has($key) and $event->date['start']['date'] !== $event->date['end']['date']) + { + $new_start_time = $this->main->get_time(0); + $new_end_time = $this->main->get_time((24*3600)); + + $allday = 1; + } + // First Day + else + { + $new_start_time = $event->data->time['start_raw']; + $new_end_time = $skin->skin === 'general_calendar' ? $event->data->time['end_raw'] : $this->main->get_time((24*3600)); + $second_start_time = $this->main->get_time(0); + $second_end_time = $event->data->time['end_raw']; + + // Set to Cache + $cache->set($key, array($second_start_time, $second_end_time)); + } + + // Flag to Multiple Day + $event->data->multipleday = 1; + + $event->data->time['start_raw'] = $new_start_time; + $event->data->time['end_raw'] = $new_end_time; + + if($hide_time) + { + $event->data->time['start'] = ''; + $event->data->time['end'] = ''; + } + elseif($allday) + { + $event->data->time['start'] = $this->main->m('all_day', esc_html__('All Day' , 'modern-events-calendar-lite')); + $event->data->time['end'] = ''; + } + else + { + $event->data->time['start'] = $new_start_time; + $event->data->time['end'] = ($hide_end_time ? '' : $new_end_time); + } + } + } + + return $event; + } + + public function add_time_to_event(&$event, $start_datetime, $end_datetime, $allday = false) + { + $hide_time = $event->data->meta['mec_hide_time'] ?? 0; + $hide_end_time = $this->main->hide_end_time_status($event->ID); + + $start_timestamp = strtotime($start_datetime); + $end_timestamp = strtotime($end_datetime); + + $st = $this->main->get_time($start_timestamp); + $et = $this->main->get_time($end_timestamp); + + if($allday) + { + $st = $this->main->m('all_day', esc_html__('All Day' , 'modern-events-calendar-lite')); + $et = ''; + } + + $event->data->time = [ + 'start'=>($hide_time ? '' : $st), + 'end'=>(($hide_time or $hide_end_time) ? '' : $et), + 'start_raw'=>$st, + 'end_raw'=>$et, + 'start_timestamp'=>$start_timestamp, + 'end_timestamp'=>$end_timestamp, + ]; + } + + /** + * Renders and Returns event dats + * @author Webnus + * @param int $event_id + * @param object $event + * @param int $maximum + * @param string $today + * @return array + */ + public function dates($event_id, $event = NULL, $maximum = 6, $today = '') + { + if(!$today) $today = date('Y-m-d'); + + // Original Start Date + $original_start_date = $today; + $dates = []; + + // Get event data if it is NULL + if(is_null($event)) + { + $event = new stdClass(); + $event->meta = $this->main->get_post_meta($event_id, true); + $event->mec = $this->db->select("SELECT * FROM `#__mec_events` WHERE `post_id`='$event_id'", "loadObject"); + } + + $start_date = $event->meta['mec_date']['start'] ?? []; + $end_date = $event->meta['mec_date']['end'] ?? []; + $first_occurrence = $event->meta['mec_start_date'] ?? $today; + + // Return empty array if date is not valid + if(!isset($start_date['date']) or !strtotime($start_date['date'])) return $dates; + + // Return empty array if mec data is not exists on mec_events table + if(!isset($event->mec->end)) return $dates; + + $allday = $event->meta['mec_allday'] ?? 0; + $hide_time = $event->meta['mec_hide_time'] ?? 0; + + $event_period = $this->main->date_diff($start_date['date'], $end_date['date']); + $event_period_days = $event_period ? $event_period->days : 0; + + $finish_date = array('date'=>$event->mec->end, 'hour'=>$event->meta['mec_date']['end']['hour'], 'minutes'=>$event->meta['mec_date']['end']['minutes'], 'ampm'=>$event->meta['mec_date']['end']['ampm']); + + $exceptional_days = (isset($event->mec->not_in_days) and trim($event->mec->not_in_days)) ? explode(',', trim($event->mec->not_in_days, ', ')) : []; + $exceptional_days = $this->main->add_global_exceptional_days($exceptional_days); + + // Event Passed + $past = $this->main->is_past($finish_date['date'], $today); + + // Event is not passed for custom days + if($past and isset($event->meta['mec_repeat_type']) and $event->meta['mec_repeat_type'] == 'custom_days') $past = 0; + + // Normal event + if(isset($event->mec->repeat) and $event->mec->repeat == '0') + { + $dates[] = $this->add_timestamps(array( + 'start'=>$start_date, + 'end'=>$end_date, + 'allday'=>$allday, + 'hide_time'=>$hide_time, + 'past'=>$past + )); + } + elseif($past) + { + $dates[] = $this->add_timestamps(array( + 'start'=>$start_date, + 'end'=>$end_date, + 'allday'=>$allday, + 'hide_time'=>$hide_time, + 'past'=>$past + )); + } + else + { + $repeat_type = $event->meta['mec_repeat_type']; + + if(in_array($repeat_type, array('daily', 'weekly'))) + { + $repeat_interval = $event->meta['mec_repeat_interval']; + + $date_interval = $this->main->date_diff($start_date['date'], date('Y-m-d', strtotime($today))); + $passed_days = $date_interval ? $date_interval->days : 0; + + // Check if date interval is negative (It means the event didn't start yet) + if($date_interval and $date_interval->invert == 1) $remained_days_to_next_repeat = $passed_days; + else $remained_days_to_next_repeat = $repeat_interval - fmod($passed_days, $repeat_interval); + + $start_date = date('Y-m-d', strtotime('+'.$remained_days_to_next_repeat.' Days', strtotime($today))); + + if( + !$this->main->is_date_after($finish_date['date'], $start_date) && + $this->main->is_date_after($first_occurrence, $start_date, true) && + !in_array($start_date, $exceptional_days) + ) $dates[] = $this->add_timestamps(array( + 'start'=>array('date'=>$start_date, 'hour'=>$event->meta['mec_date']['start']['hour'], 'minutes'=>$event->meta['mec_date']['start']['minutes'], 'ampm'=>$event->meta['mec_date']['start']['ampm']), + 'end'=>array('date'=>date('Y-m-d', strtotime('+'.$event_period_days.' Days', strtotime($start_date))), 'hour'=>$event->meta['mec_date']['end']['hour'], 'minutes'=>$event->meta['mec_date']['end']['minutes'], 'ampm'=>$event->meta['mec_date']['end']['ampm']), + 'allday'=>$allday, + 'hide_time'=>$hide_time, + 'past'=>0 + )); + + for($i = 2; $i <= $maximum; $i++) + { + $start_date = date('Y-m-d', strtotime('+'.$repeat_interval.' Days', strtotime($start_date))); + + // Event Not Started + if(!$this->main->is_date_after($first_occurrence, $start_date, true)) continue; + + // Event finished + if($this->main->is_past($finish_date['date'], $start_date)) break; + + if(!in_array($start_date, $exceptional_days)) $dates[] = $this->add_timestamps(array( + 'start'=>array('date'=>$start_date, 'hour'=>$event->meta['mec_date']['start']['hour'], 'minutes'=>$event->meta['mec_date']['start']['minutes'], 'ampm'=>$event->meta['mec_date']['start']['ampm']), + 'end'=>array('date'=>date('Y-m-d', strtotime('+'.$event_period_days.' Days', strtotime($start_date))), 'hour'=>$event->meta['mec_date']['end']['hour'], 'minutes'=>$event->meta['mec_date']['end']['minutes'], 'ampm'=>$event->meta['mec_date']['end']['ampm']), + 'allday'=>$allday, + 'hide_time'=>$hide_time, + 'past'=>0 + )); + } + } + elseif(in_array($repeat_type, array('weekday', 'weekend', 'certain_weekdays'))) + { + $date_interval = $this->main->date_diff($start_date['date'], $today); + $passed_days = $date_interval ? $date_interval->days : 0; + + // Check if date interval is negative (It means the event didn't start yet) + if($date_interval and $date_interval->invert == 1) $today = date('Y-m-d', strtotime('+'.$passed_days.' Days', strtotime($original_start_date))); + + $event_days = explode(',', trim($event->mec->weekdays, ', ')); + + $today_id = date('N', strtotime($today)); + $found = 0; + $i = 0; + + while($found < $maximum) + { + if($this->main->is_past($finish_date['date'], $today)) break; + + if(!in_array($today_id, $event_days)) + { + $today = date('Y-m-d', strtotime('+1 Days', strtotime($today))); + $today_id = date('N', strtotime($today)); + + $i++; + continue; + } + + $start_date = $today; + if(!in_array($start_date, $exceptional_days)) $dates[] = $this->add_timestamps(array( + 'start'=>array('date'=>$start_date, 'hour'=>$event->meta['mec_date']['start']['hour'], 'minutes'=>$event->meta['mec_date']['start']['minutes'], 'ampm'=>$event->meta['mec_date']['start']['ampm']), + 'end'=>array('date'=>date('Y-m-d', strtotime('+'.$event_period_days.' Days', strtotime($start_date))), 'hour'=>$event->meta['mec_date']['end']['hour'], 'minutes'=>$event->meta['mec_date']['end']['minutes'], 'ampm'=>$event->meta['mec_date']['end']['ampm']), + 'allday'=>$allday, + 'hide_time'=>$hide_time, + 'past'=>0 + )); + + $today = date('Y-m-d', strtotime('+1 Days', strtotime($today))); + $today_id = date('N', strtotime($today)); + + $found++; + $i++; + } + } + elseif($repeat_type == 'monthly') + { + $repeat_interval = ((isset($event->meta) and isset($event->meta['mec_repeat_interval'])) ? max(1, $event->meta['mec_repeat_interval']) : 1); + + // Start from Event Start Date + if(strtotime($start_date['date']) > strtotime($original_start_date)) $original_start_date = $start_date['date']; + + $event_days = explode(',', trim($event->mec->day, ', ')); + $event_start_day = $event_days[0]; + + $diff = $this->main->date_diff($start_date['date'], $end_date['date']); + $event_period_days = $diff->days; + + $found = 0; + $i = 0; + + while($found < $maximum) + { + $t = strtotime('+'.$i.' Months', strtotime($original_start_date)); + if(!$t) break; + + $today = date('Y-m-d', $t); + if($this->main->is_past($finish_date['date'], $today)) break; + + $year = date('Y', strtotime($today)); + $month = date('m', strtotime($today)); + $day = $event_start_day; + $hour = isset($event->meta['mec_date']['end']['hour']) ? sprintf('%02d', $event->meta['mec_date']['end']['hour']) : '06'; + $minutes = isset($event->meta['mec_date']['end']['minutes']) ? sprintf('%02d', $event->meta['mec_date']['end']['minutes']) : '00'; + $ampm = isset($event->meta['mec_date']['end']['ampm']) ? strtoupper($event->meta['mec_date']['end']['ampm']) : 'PM'; + + // Fix for 31st, 30th, 29th of some months + while(!checkdate((int) $month, (int) $day, (int) $year)) $day--; + + $start_date = $year.'-'.$month.'-'.$day; + $end_time = $hour.':'.$minutes.' '.$ampm; + + // Wrong Date & Time + if(!strtotime($start_date.' '.$end_time)) break; + + if(strtotime($start_date.' '.$end_time) < strtotime($original_start_date)) + { + $i += $repeat_interval; + continue; + } + + if(!in_array($start_date, $exceptional_days)) $dates[] = $this->add_timestamps(array( + 'start'=>array('date'=>$start_date, 'hour'=>$event->meta['mec_date']['start']['hour'], 'minutes'=>$event->meta['mec_date']['start']['minutes'], 'ampm'=>$event->meta['mec_date']['start']['ampm']), + 'end'=>array('date'=>date('Y-m-d', strtotime('+'.$event_period_days.' Days', strtotime($start_date))), 'hour'=>$event->meta['mec_date']['end']['hour'], 'minutes'=>$event->meta['mec_date']['end']['minutes'], 'ampm'=>$event->meta['mec_date']['end']['ampm']), + 'allday'=>$allday, + 'hide_time'=>$hide_time, + 'past'=>0 + )); + + $found++; + $i += $repeat_interval; + } + } + elseif($repeat_type == 'yearly') + { + // Start from Event Start Date + if(strtotime($start_date['date']) > strtotime($original_start_date)) $original_start_date = $start_date['date']; + + $event_days = explode(',', trim($event->mec->day, ', ')); + $event_months = explode(',', trim($event->mec->month, ', ')); + + $event_start_day = $event_days[0]; + $event_period_days = $this->main->date_diff($start_date['date'], $end_date['date'])->days; + + $event_start_year = date('Y', strtotime($original_start_date)); + $event_start_month = date('n', strtotime($original_start_date)); + + $found = 0; + $i = 0; + + while($found < $maximum) + { + $today = date('Y-m-d', strtotime($event_start_year.'-'.$event_start_month.'-'.$event_start_day)); + if($this->main->is_past($finish_date['date'], $today)) break; + + $year = date('Y', strtotime($today)); + $month = date('m', strtotime($today)); + + if(!in_array($month, $event_months)) + { + if($event_start_month == '12') + { + $event_start_month = 1; + $event_start_year += 1; + } + else $event_start_month += 1; + + $i++; + continue; + } + + $day = $event_start_day; + + // Fix for 31st, 30th, 29th of some months + while(!checkdate($month, $day, $year)) $day--; + + $event_date = $year.'-'.$month.'-'.$day; + if(strtotime($event_date) >= strtotime($original_start_date)) + { + $start_date = $event_date; + if(!in_array($start_date, $exceptional_days)) $dates[] = $this->add_timestamps(array( + 'start'=>array('date'=>$start_date, 'hour'=>$event->meta['mec_date']['start']['hour'], 'minutes'=>$event->meta['mec_date']['start']['minutes'], 'ampm'=>$event->meta['mec_date']['start']['ampm']), + 'end'=>array('date'=>date('Y-m-d', strtotime('+'.$event_period_days.' Days', strtotime($start_date))), 'hour'=>$event->meta['mec_date']['end']['hour'], 'minutes'=>$event->meta['mec_date']['end']['minutes'], 'ampm'=>$event->meta['mec_date']['end']['ampm']), + 'allday'=>$allday, + 'hide_time'=>$hide_time, + 'past'=>0 + )); + + $found++; + } + + if($event_start_month == '12') + { + $event_start_month = 1; + $event_start_year += 1; + } + else $event_start_month += 1; + + $i++; + } + } + elseif($repeat_type == 'custom_days') + { + $custom_days = explode(',', $event->mec->days); + + // Add current time if we're checking today's events + if($today == current_time('Y-m-d')) $today .= ' '.current_time('H:i:s'); + + $found = 0; + if((strtotime($event->mec->start) + $event->meta['mec_start_day_seconds']) >= strtotime($today) and !in_array($event->mec->start, $exceptional_days)) + { + $dates[] = $this->add_timestamps(array( + 'start'=>array('date'=>$event->mec->start, 'hour'=>$event->meta['mec_date']['start']['hour'], 'minutes'=>$event->meta['mec_date']['start']['minutes'], 'ampm'=>$event->meta['mec_date']['start']['ampm']), + 'end'=>array('date'=>$event->mec->end, 'hour'=>$event->meta['mec_date']['end']['hour'], 'minutes'=>$event->meta['mec_date']['end']['minutes'], 'ampm'=>$event->meta['mec_date']['end']['ampm']), + 'allday'=>$allday, + 'hide_time'=>$hide_time, + 'past'=>0 + )); + + $found++; + } + + foreach($custom_days as $custom_day) + { + // Found maximum dates + if($found >= $maximum) break; + + $cday = explode(':', $custom_day); + + $c_start = $cday[0]; + if(isset($cday[2])) $c_start .= ' '.str_replace('-', ' ', substr_replace($cday[2], ':', strpos($cday[2], '-'), 1)); + + // Date is past + if(strtotime($c_start) < strtotime($today)) continue; + + $cday_start_hour = $event->meta['mec_date']['start']['hour']; + $cday_start_minutes = $event->meta['mec_date']['start']['minutes']; + $cday_start_ampm = $event->meta['mec_date']['start']['ampm']; + + $cday_end_hour = $event->meta['mec_date']['end']['hour']; + $cday_end_minutes = $event->meta['mec_date']['end']['minutes']; + $cday_end_ampm = $event->meta['mec_date']['end']['ampm']; + + if(isset($cday[2]) and isset($cday[3])) + { + $cday_start_ex = explode('-', $cday[2]); + $cday_start_hour = $cday_start_ex[0]; + $cday_start_minutes = $cday_start_ex[1]; + $cday_start_ampm = $cday_start_ex[2]; + + $cday_end_ex = explode('-', $cday[3]); + $cday_end_hour = $cday_end_ex[0]; + $cday_end_minutes = $cday_end_ex[1]; + $cday_end_ampm = $cday_end_ex[2]; + } + + if(!in_array($cday[0], $exceptional_days)) $dates[] = $this->add_timestamps(array( + 'start'=>array('date'=>$cday[0], 'hour'=>$cday_start_hour, 'minutes'=>$cday_start_minutes, 'ampm'=>$cday_start_ampm), + 'end'=>array('date'=>$cday[1], 'hour'=>$cday_end_hour, 'minutes'=>$cday_end_minutes, 'ampm'=>$cday_end_ampm), + 'allday'=>$allday, + 'hide_time'=>$hide_time, + 'past'=>0 + )); + + $found++; + } + + // No future date found so the event is passed + if(!count($dates)) + { + $dates[] = $this->add_timestamps(array( + 'start'=>$start_date, + 'end'=>$finish_date, + 'allday'=>$allday, + 'hide_time'=>$hide_time, + 'past'=>$past + )); + } + } + elseif($repeat_type == 'advanced') + { + // Start from Event Start Date + if(strtotime($start_date['date']) > strtotime($today)) $today = $start_date['date']; + + // Get user specifed days of month for repeat + $advanced_days = get_post_meta($event_id, 'mec_advanced_days', true); + + // Generate dates for event + $event_info = array('start' => $start_date, 'end' => $end_date, 'allday' => $allday, 'hide_time' => $hide_time, 'finish_date' => $finish_date['date'], 'exceptional_days' => $exceptional_days, 'mec_repeat_end' => ((isset($event->meta['mec_repeat']) and isset($event->meta['mec_repeat']['end'])) ? $event->meta['mec_repeat']['end'] : ''), 'occurrences' => ((isset($event->meta['mec_repeat']) and isset($event->meta['mec_repeat']['end_at_occurrences'])) ? $event->meta['mec_repeat']['end_at_occurrences'] : '')); + + $dates = $this->generate_advanced_days($advanced_days, $event_info, $maximum, $today); + } + } + + return $dates; + } + + /** + * Render advanced dates + * @author Webnus + * @param array $advanced_days + * @param array $event_info + * @param int $maximum + * @param string $referer_date + * @param string $mode + * @return array + */ + public function generate_advanced_days($advanced_days = array(), $event_info = array(), $maximum = 6, $referer_date = NULL, $mode = 'render') + { + if(!count($advanced_days)) return []; + if(!trim($referer_date)) $referer_date = date('Y-m-d', current_time('timestamp', 0)); + + $levels = array('first', 'second', 'third', 'fourth', 'last'); + $year = date('Y', strtotime($event_info['start']['date'])); + $dates = []; + + // Set last month for include current month results + $month = date('m', strtotime('first day of last month', strtotime($event_info['start']['date']))); + + if($month == '12') $year = $year - 1; + + $maximum = intval($maximum); + $i = 0; + + // Event info + $exceptional_days = array_key_exists('exceptional_days', $event_info) ? $event_info['exceptional_days'] : []; + $start_date = $event_info['start']; + $end_date = $event_info['end']; + $allday = array_key_exists('allday', $event_info) ? $event_info['allday'] : 0; + $hide_time = array_key_exists('hide_time', $event_info) ? $event_info['hide_time'] : 0; + $finish_date = array_key_exists('finish_date', $event_info) ? $event_info['finish_date'] : '0000-00-00'; + $event_period = $this->main->date_diff($start_date['date'], $end_date['date']); + $event_period_days = $event_period ? $event_period->days : 0; + $mec_repeat_end = array_key_exists('mec_repeat_end', $event_info) ? $event_info['mec_repeat_end'] : ''; + $occurrences = array_key_exists('occurrences', $event_info) ? $event_info['occurrences'] : 0; + + // Include default start date to results + if(!$this->main->is_past($start_date['date'], $referer_date) and !in_array($start_date['date'], $exceptional_days)) + { + $dates[] = $this->add_timestamps(array( + 'start' => $start_date, + 'end' => $end_date, + 'allday' => $allday, + 'hide_time' => $hide_time, + 'past' => 0, + )); + + if($mode == 'render') $i++; + } + + while($i < $maximum) + { + $start = NULL; + + foreach($advanced_days as $day) + { + if($i >= $maximum) break; + + // Explode $day value for example (Sun.1) to Sun and 1 + $d = explode('.', $day); + + // Set indexes for {$levels} index if number day is Last(Sun.l) then indexes set 4th {$levels} index + $index = intval($d[1]) ? (intval($d[1]) - 1) : 4; + + // Generate date + $date = date('Y-m-t', strtotime("{$year}-{$month}-01")); + + // Generate start date for example "first Sun of next month" + $start = date('Y-m-d', strtotime("{$levels[$index]} {$d[0]} of next month", strtotime($date))); + $end = date('Y-m-d', strtotime("+{$event_period_days} Days", strtotime($start))); + + // Occurence equals to the main start date + if($start === $start_date['date']) continue; + + // When ends repeat date set + if($mode == 'render' and $this->main->is_past($finish_date, $start)) continue; + + // Jump to next level if start date is past + if($this->main->is_past($start, $referer_date) or in_array($start, $exceptional_days)) continue; + + // Add dates + $dates[] = $this->add_timestamps(array( + 'start' => array( + 'date' => $start, + 'hour' => $start_date['hour'], + 'minutes' => $start_date['minutes'], + 'ampm' => $start_date['ampm'], + ), + 'end' => array( + 'date' => $end, + 'hour' => $end_date['hour'], + 'minutes' => $end_date['minutes'], + 'ampm' => $end_date['ampm'], + ), + 'allday' => $allday, + 'hide_time' => $hide_time, + 'past' => 0, + )); + + $i++; + } + + // When ends repeat date set + if($mode == 'render' and $this->main->is_past($finish_date, $start)) break; + + // Change month and years for next resualts + if(intval($month) == 12) + { + $year = intval($year) + 1; + $month = '00'; + } + + $month = sprintf("%02d", intval($month) + 1); + } + + if(($mode == 'render') and (trim($mec_repeat_end) == 'occurrences') and (count($dates) > $occurrences)) + { + $max = strtotime(reset($dates)['start']['date']); + $pos = 0; + + for($i = 1; $i < count($dates); $i++) + { + if(strtotime($dates[$i]['start']['date']) > $max) + { + $max = strtotime($dates[$i]['start']['date']); + $pos = $i; + } + } + + unset($dates[$pos]); + } + + // Remove Duplicates + $uniques = []; + $timestamps = []; + + foreach($dates as $key => $date) + { + $start_timestamp = $date['start']['timestamp']; + $end_timestamp = $date['end']['timestamp']; + $timestamp_key = $start_timestamp.'-'.$end_timestamp; + + if(isset($timestamps[$timestamp_key])) continue; + + $timestamps[$timestamp_key] = true; + $uniques[] = $date; + } + + // Sort + usort($uniques, array($this, 'sort_dates')); + + return $uniques; + } + + public function sort_dates($a, $b) + { + $a_timestamp = $a['start']['timestamp']; + $b_timestamp = $b['end']['timestamp']; + + if($a_timestamp == $b_timestamp) return 0; + return ($a_timestamp > $b_timestamp) ? +1 : -1; + } + + /** + * Render markers + * @author Webnus + * @param array $events + * @param string $skin_style + * @return array + */ + public function markers($events, $skin_style = 'classic') + { + $date_format = (isset($this->settings['google_maps_date_format1']) and trim($this->settings['google_maps_date_format1'])) ? $this->settings['google_maps_date_format1'] : 'M d Y'; + + $requested_location_id = isset($_REQUEST['sf'], $_REQUEST['sf']['location']) ? $_REQUEST['sf']['location'] : null; + + $markers = []; + foreach($events as $event) + { + if(!is_object($event)) continue; + if(!isset($event->data->locations) or (isset($event->data->locations) and !is_array($event->data->locations))) continue; + + $locations = []; + + $main_location_id = get_post_meta($event->ID, 'mec_location_id', true); + if(isset($event->date, $event->date['start'], $event->date['start']['timestamp'])) $main_location_id = MEC_feature_occurrences::param($event->ID, $event->date['start']['timestamp'], 'location_id', $main_location_id); + + $main_location_id = apply_filters('wpml_object_id', $main_location_id, 'mec_location', true); + + if($main_location_id && $main_location_id > 1) $locations[] = $main_location_id; + + $additional_location_ids = get_post_meta($event->ID, 'mec_additional_location_ids', true); + if(!is_array($additional_location_ids)) $additional_location_ids = []; + + $locations = array_merge($locations, $additional_location_ids); + $locations = array_unique($locations); + + if($requested_location_id && !is_array($requested_location_id)) + { + if($main_location_id !== $requested_location_id && !in_array($requested_location_id, $additional_location_ids)) continue; + $locations = [$requested_location_id]; + } + + // No Locations + if(!count($locations)) continue; + + foreach($locations as $location_id) + { + $location_id = (int) $location_id; + + $latitude = get_term_meta($location_id, 'latitude', true); + $longitude = get_term_meta($location_id, 'longitude', true); + + // No latitude/Longitude + if(trim($latitude) == '' or trim($longitude) == '') continue; + + $location = get_term($location_id); + $name = $location->name ?? ''; + + $latitude = floatval($latitude); + $longitude = floatval($longitude); + + $key = $latitude.','.$longitude; + if(!isset($markers[$key])) + { + $markers[$key] = array( + 'latitude'=>$latitude, + 'longitude'=>$longitude, + 'name'=>$name, + 'address'=>get_term_meta($location_id, 'address', true), + 'event_ids'=>array($event->data->ID), + 'lightbox'=>$this->main->get_marker_lightbox($event, $date_format, $skin_style), + ); + } + else + { + $markers[$key]['event_ids'][] = $event->data->ID; + $markers[$key]['lightbox'] .= $this->main->get_marker_lightbox($event, $date_format, $skin_style); + } + } + } + + $points = []; + foreach($markers as $key=>$marker) + { + $points[$key] = $marker; + + $points[$key]['lightbox'] = '
    '.(trim($marker['address']) ? esc_html($marker['address']) : esc_html($marker['name'])).'
    '.MEC_kses::element($marker['lightbox']).'
    '; + $points[$key]['count'] = count($marker['event_ids']); + $points[$key]['infowindow'] = $this->main->get_marker_infowindow($marker); + } + + return apply_filters('mec_render_markers', $points); + } + + public function add_timestamps($date) + { + $start = (isset($date['start']) and is_array($date['start'])) ? $date['start'] : []; + $end = (isset($date['end']) and is_array($date['end'])) ? $date['end'] : []; + + if(!count($start) or !count($end)) return $date; + + $s_hour = $start['hour']; + if(strtoupper($start['ampm']) == 'AM' and $s_hour == '0') $s_hour = 12; + + $e_hour = $end['hour']; + if(strtoupper($end['ampm']) == 'AM' and $e_hour == '0') $e_hour = 12; + + $allday = ($date['allday'] ?? 0); + + // All Day Event + if($allday) + { + $s_hour = 12; + $start['minutes'] = 1; + $start['ampm'] = 'AM'; + + $e_hour = 11; + $end['minutes'] = 59; + $end['ampm'] = 'PM'; + } + + $start_time = $start['date'].' '.sprintf("%02d", $s_hour).':'.sprintf("%02d", $start['minutes']).' '.$start['ampm']; + $end_time = $end['date'].' '.sprintf("%02d", $e_hour).':'.sprintf("%02d", $end['minutes']).' '.$end['ampm']; + + $start['timestamp'] = strtotime($start_time); + $end['timestamp'] = strtotime($end_time); + + $hide_time = $date['hide_time'] ?? 0; + $past = $date['past'] ?? 0; + + return array( + 'start' => $start, + 'end' => $end, + 'allday' => $allday, + 'hide_time' => $hide_time, + 'past' => $past, + ); + } +} diff --git a/app/libraries/restful.php b/app/libraries/restful.php new file mode 100755 index 0000000..7e698c9 --- /dev/null +++ b/app/libraries/restful.php @@ -0,0 +1,117 @@ + + */ +class MEC_restful extends MEC_base +{ + /** + * @var MEC_main + */ + private $main; + + /** + * @var MEC_db + */ + private $db; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Main + $this->main = $this->getMain(); + + // Database + $this->db = $this->getDB(); + } + + public function get_endpoint_url() + { + return get_rest_url(null, $this->get_namespace()); + } + + public function get_namespace() + { + return 'mec/v1.0'; + } + + public function get_api_version() + { + return '1'; + } + + public function permission(WP_REST_Request $request) + { + // Validate API Token + if(!$this->is_api_token_valid($request, $request->get_header('mec-token'))) return new WP_Error('invalid_api_token', esc_html__('Invalid API Token!', 'modern-events-calendar-lite')); + + // Validate User Token + if(!$this->is_user_token_valid($request, $request->get_header('mec-user'))) return new WP_Error('invalid_user_token', esc_html__('Invalid User Token!', 'modern-events-calendar-lite')); + + return true; + } + + public function guest(WP_REST_Request $request) + { + // Validate API Token + if(!$this->is_api_token_valid($request, $request->get_header('mec-token'))) return new WP_Error('invalid_api_token', esc_html__('Invalid API Token!', 'modern-events-calendar-lite')); + + // Set Current User if Token Provided + $this->is_user_token_valid($request, $request->get_header('mec-user')); + + return true; + } + + public function response(array $response): WP_REST_Response + { + $data = $response['data'] ?? []; + $status = $response['status'] ?? 200; + + $wp = new WP_REST_Response($data); + $wp->set_status($status); + + return $wp; + } + + public function is_api_token_valid(WP_REST_Request $request, $token = null) + { + // Check Token + if(trim($token)) + { + $settings = $this->main->get_settings(); + + $tokens = []; + foreach($settings['api_keys'] as $k => $t) + { + if(!is_numeric($k)) continue; + $tokens[] = $t['key']; + } + + if(in_array($token, $tokens)) return true; + } + + return false; + } + + public function is_user_token_valid(WP_REST_Request $request, $token = null) + { + // Check User + if(trim($token)) + { + $user_id = $this->db->select("SELECT `user_id` FROM `#__usermeta` WHERE `meta_key`='mec_token' AND `meta_value`='".esc_sql($token)."'", 'loadResult'); + if(!$user_id) return false; + + // Set Current User + wp_set_current_user($user_id); + return true; + } + + return false; + } +} diff --git a/app/libraries/schedule.php b/app/libraries/schedule.php new file mode 100755 index 0000000..f86a89d --- /dev/null +++ b/app/libraries/schedule.php @@ -0,0 +1,162 @@ + + */ +class MEC_schedule extends MEC_base +{ + private $db; + private $main; + private $render; + + public function __construct() + { + $this->db = $this->getDB(); + $this->main = $this->getMain(); + $this->render = $this->getRender(); + } + + public function cron() + { + // Get All Events + $events = $this->main->get_events(); + + // Append Schedule for Events + foreach($events as $event) + { + $maximum = 50; + $repeat_type = get_post_meta($event->ID, 'mec_repeat_type', true); + + // Reschedule Schedule for Normal and Custom Days Events + if($repeat_type === '' or $repeat_type === 'custom_days') $this->reschedule($event->ID, 200); + else $this->append($event->ID, $maximum); + } + } + + public function reschedule($event_id, $maximum = 200) + { + // Clean Current Schedule + $this->clean($event_id); + + // Event Start Date + $start = get_post_meta($event_id, 'mec_start_date', true); + + if(trim($start) == '' or $start == '0000-00-00') $start = date('Y-m-d', strtotime('-1 Year')); + else $start = date('Y-m-d', strtotime('-1 Day', strtotime($start))); + + // New Schedule + $this->schedule($event_id, $start, $maximum); + } + + public function append($event_id, $maximum = 25) + { + // Get Start Date + $start = $this->time($event_id, 'max', 'Y-m-d'); + + // Don't create dates more than next 7 years! + if(strtotime($start) > strtotime('+7 years', current_time('timestamp', 0))) return; + + // Append Schedule + $this->schedule($event_id, $start, $maximum); + } + + public function schedule($event_id, $start, $maximum = 100) + { + // Get event dates + $dates = $this->render->dates($event_id, NULL, $maximum, $start); + + // No new date found! + if(!is_array($dates) || !count($dates)) return false; + + // All Day Event + $allday = get_post_meta($event_id, 'mec_allday', true); + + // Public Event + $public = get_post_meta($event_id, 'mec_public', true); + if(trim($public) === '') $public = 1; + + // Create Public Column If Not Exists + if(!$this->db->columns('mec_dates', 'public')) $this->db->q("ALTER TABLE `#__mec_dates` ADD `public` INT(4) UNSIGNED NOT NULL DEFAULT 1 AFTER `tend`;"); + + foreach($dates as $date) + { + $sd = $date['start']['date']; + $ed = $date['end']['date']; + + $start_hour = isset($date['start']['hour']) ? sprintf("%02d", $date['start']['hour']) : '08'; + $start_minute = isset($date['start']['minutes']) ? sprintf("%02d", $date['start']['minutes']) : '00'; + $start_ampm = $date['start']['ampm'] ?? 'AM'; + + if($start_hour == '00') + { + $start_hour = ''; + $start_minute = ''; + $start_ampm = ''; + } + + $start_time = $start_hour.':'.$start_minute.' '.$start_ampm; + + $end_hour = isset($date['end']['hour']) ? sprintf("%02d", $date['end']['hour']) : '06'; + $end_minute = isset($date['end']['minutes']) ? sprintf("%02d", $date['end']['minutes']) : '00'; + $end_ampm = $date['end']['ampm'] ?? 'PM'; + + if($end_hour == '00') + { + $end_hour = ''; + $end_minute = ''; + $end_ampm = ''; + } + + $end_time = $end_hour.':'.$end_minute.' '.$end_ampm; + + // All Day Event + if($allday) + { + $start_time = '12:01 AM'; + $end_time = '11:59 PM'; + } + + $st = strtotime(trim($date['start']['date'].' '.$start_time, ' :')); + $et = strtotime(trim($date['end']['date'].' '.$end_time, ' :')); + + $date_id = $this->db->select("SELECT `id` FROM `#__mec_dates` WHERE `post_id`='$event_id' AND `tstart`='$st' AND `tend`='$et'", 'loadResult'); + + // Add new Date + if(!$date_id) $this->db->q("INSERT INTO `#__mec_dates` (`post_id`,`dstart`,`dend`,`tstart`,`tend`,`public`) VALUES ('$event_id','$sd','$ed','$st','$et','$public');"); + // Update Existing Record + else $this->db->q("UPDATE `#__mec_dates` SET `tstart`='$st', `tend`='$et', `public`='$public' WHERE `id`='$date_id';"); + } + + return true; + } + + public function clean($event_id) + { + // Remove All Scheduled Dates + return $this->db->q("DELETE FROM `#__mec_dates` WHERE `post_id`='$event_id'"); + } + + public function time($event_id, $type = 'max', $format = 'Y-m-d') + { + $time = $this->db->select("SELECT ".(strtolower($type) == 'min' ? 'MIN' : 'MAX')."(`tstart`) FROM `#__mec_dates` WHERE `post_id`='$event_id'", 'loadResult'); + if(!$time) $time = time(); + + return date($format, $time); + } + + public function get_reschedule_maximum($repeat_type) + { + if($repeat_type == 'daily') return 370; + elseif($repeat_type == 'weekday') return 270; + elseif($repeat_type == 'advanced') return 250; + elseif($repeat_type == 'weekend') return 200; + elseif($repeat_type == 'certain_weekdays') return 200; + elseif($repeat_type == 'weekly') return 100; + elseif($repeat_type == 'monthly') return 50; + elseif($repeat_type == 'yearly') return 50; + else return 50; + } +} \ No newline at end of file diff --git a/app/libraries/search.php b/app/libraries/search.php new file mode 100755 index 0000000..11f6cb3 --- /dev/null +++ b/app/libraries/search.php @@ -0,0 +1,502 @@ + + */ +class MEC_search extends MEC_base +{ + private $main; + private $settings; + + public function __construct() + { + $this->main = $this->getMain(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + } + + public function refine() + { + // Variables + $sf = isset($_POST['sf']) ? $this->main->sanitize_deep_array($_POST['sf']) : []; + $id = isset($_POST['id']) ? sanitize_text_field($_POST['id']) : ''; + $start_date = isset($_POST['mec_start_date']) ? sanitize_text_field($_POST['mec_start_date']) : current_time('Y-m-d'); + $current_field = isset($_POST['last_field']) ? sanitize_text_field($_POST['last_field']) : ''; + $category_type = isset($_POST['category_type']) ? sanitize_text_field($_POST['category_type']) : 'dropdown'; + $location_type = isset($_POST['location_type']) ? sanitize_text_field($_POST['location_type']) : 'dropdown'; + $organizer_type = isset($_POST['organizer_type']) ? sanitize_text_field($_POST['organizer_type']) : 'dropdown'; + $speaker_type = isset($_POST['speaker_type']) ? sanitize_text_field($_POST['speaker_type']) : 'dropdown'; + $label_type = isset($_POST['label_type']) ? sanitize_text_field($_POST['label_type']) : 'dropdown'; + $event_ids = []; + + // Import + self::import('app.libraries.walker'); + if(!function_exists('wp_terms_checklist')) include ABSPATH.'wp-admin/includes/template.php'; + + // Taxonomy Query + $tax_query = array( + 'relation'=>'AND' + ); + + // Add event label to filter + if(isset($sf['label']) and trim($sf['label'], ', ') != '') + { + $tax_query[] = array( + 'taxonomy'=>'mec_label', + 'field'=>'term_id', + 'terms'=>explode(',', trim(sanitize_text_field($sf['label']), ', ')) + ); + } + + // Add event category to filter + if(isset($sf['category']) and trim($sf['category'], ', ') != '') + { + $tax_query[] = array( + 'taxonomy'=>'mec_category', + 'field'=>'term_id', + 'terms'=>explode(',', trim(sanitize_text_field($sf['category']), ', ')) + ); + } + + // Add event location to filter + if(isset($sf['location']) and trim($sf['location'], ', ') != '') + { + $tax_query[] = array( + 'taxonomy'=>'mec_location', + 'field'=>'term_id', + 'terms'=>explode(',', trim(sanitize_text_field($sf['location']), ', ')) + ); + } + + // Add event address to filter + if(isset($sf['address']) and trim($sf['address'], ', ') != '') + { + $get_locations_id = $this->get_locations_id(sanitize_text_field($sf['address'])); + $tax_query[] = array( + 'taxonomy'=>'mec_location', + 'field'=>'term_id', + 'terms'=>$get_locations_id, + ); + } + + // Add event organizer to filter + if(isset($sf['organizer']) and trim($sf['organizer'], ', ') != '') + { + $tax_query[] = array( + 'taxonomy'=>'mec_organizer', + 'field'=>'term_id', + 'terms'=>explode(',', trim(sanitize_text_field($sf['organizer']), ', ')) + ); + } + + // Add event speaker to filter + if(isset($sf['speaker']) and trim($sf['speaker'], ', ') != '') + { + $tax_query[] = array( + 'taxonomy'=>'mec_speaker', + 'field'=>'term_id', + 'terms'=>explode(',', trim(sanitize_text_field($sf['speaker']), ', ')) + ); + } + + // Event type + if(isset($sf['event_type']) and trim($sf['event_type'], ', ') != '') + { + $tax_query[] = array( + 'taxonomy'=>'mec_event_type', + 'field'=>'term_id', + 'terms'=>explode(',', trim(sanitize_text_field($sf['event_type']), ', ')) + ); + } + + // Event Type 2 + if(isset($sf['event_type_2']) and trim($sf['event_type_2'], ', ') != '') + { + $tax_query[] = array( + 'taxonomy'=>'mec_event_type_2', + 'field'=>'term_id', + 'terms'=>explode(',', trim(sanitize_text_field($sf['event_type_2']), ', ')) + ); + } + + // Add event tags to filter + if(apply_filters('mec_taxonomy_tag', '') !== 'post_tag' and isset($sf['tag']) and trim($sf['tag'], ', ') != '') + { + if(is_numeric($sf['tag'])) + { + $tax_query[] = array( + 'taxonomy'=>'mec_tag', + 'field'=>'term_id', + 'terms'=>explode(',', trim(sanitize_text_field($sf['tag']), ', ')) + ); + } + else + { + $tax_query[] = array( + 'taxonomy'=>'mec_tag', + 'field'=>'name', + 'terms'=>explode(',', trim(sanitize_text_field($sf['tag']), ', ')) + ); + } + } + + $tax_query = apply_filters('mec_map_tax_query', $tax_query, $sf); + + // Meta Query + $meta_query = array( + 'relation' => 'AND', + ); + + // Event Min Cost + if(isset($sf['cost-min']) and trim($sf['cost-min']) != '') + { + $meta_query[] = array( + 'key' => 'mec_cost', + 'value' => sanitize_text_field($sf['cost-min']), + 'type' => 'numeric', + 'compare' => '>=', + ); + } + + // Event Max Cost + if(isset($sf['cost-max']) and trim($sf['cost-max']) != '') + { + $meta_query[] = array( + 'key' => 'mec_cost', + 'value' => sanitize_text_field($sf['cost-max']), + 'type' => 'numeric', + 'compare' => '<=', + ); + } + + $meta_query = apply_filters('mec_map_meta_query', $meta_query, $sf); + + // Search Arguments + $args = array( + 'post_type' => $this->main->get_main_post_type(), + 'post_status' => 'publish', + 'posts_per_page' => '-1', + 's' => ((isset($sf['s']) and trim($sf['s'])) ? sanitize_text_field($sf['s']) : NULL), + 'tax_query' => $tax_query, + 'meta_query' => $meta_query, + ); + + // Query + $query = new WP_Query($args); + + // The Loop + if($query->have_posts()) + { + while($query->have_posts()) + { + $query->the_post(); + $event_ids[] = get_the_ID(); + } + } + + // Restore Original Post Data + wp_reset_postdata(); + + $categories = []; + $locations = []; + $organizers = []; + $speakers = []; + $tags = []; + $labels = []; + + $upcoming_ids = $this->main->get_upcoming_event_ids(strtotime($start_date)); + foreach($event_ids as $event_id) + { + // Expired Event + if(!in_array($event_id, $upcoming_ids)) continue; + + $e_categories = wp_get_post_terms($event_id, 'mec_category'); + if(!is_array($e_categories)) $e_categories = []; + + foreach($e_categories as $e_category) $categories[] = $e_category->term_id; + + $e_locations = wp_get_post_terms($event_id, 'mec_location'); + if(!is_array($e_locations)) $e_locations = []; + + foreach($e_locations as $e_location) $locations[] = $e_location->term_id; + + $e_organizers = wp_get_post_terms($event_id, 'mec_organizer'); + if(!is_array($e_organizers)) $e_organizers = []; + + foreach($e_organizers as $e_organizer) $organizers[] = $e_organizer->term_id; + + if((isset($this->settings['speakers_status']) and $this->settings['speakers_status'])) + { + $e_speakers = wp_get_post_terms($event_id, 'mec_speaker'); + if(!is_array($e_speakers)) $e_speakers = []; + + foreach($e_speakers as $e_speaker) $speakers[] = $e_speaker->term_id; + } + + $e_labels = wp_get_post_terms($event_id, 'mec_label'); + if(!is_array($e_labels)) $e_labels = []; + + foreach($e_labels as $e_label) $labels[] = $e_label->term_id; + + $e_tags = wp_get_post_terms($event_id, apply_filters('mec_taxonomy_tag', '')); + if(!is_array($e_tags)) $e_tags = []; + + foreach($e_tags as $e_tag) $tags[] = $e_tag->term_id; + } + + $categories = array_unique($categories); + $locations = array_unique($locations); + $organizers = array_unique($organizers); + $speakers = array_unique($speakers); + $tags = array_unique($tags); + $labels = array_unique($labels); + + $categories_html = ''; + $locations_html = ''; + $organizers_html = ''; + $speakers_html = ''; + $tags_html = ''; + $labels_html = ''; + + // Categories + if($category_type == 'dropdown') + { + $label = $this->main->m('taxonomy_category', esc_html__('Category', 'modern-events-calendar-lite')); + + $categories_html .= wp_dropdown_categories(array + ( + 'echo'=>false, + 'taxonomy'=>'mec_category', + 'name'=>' ', + 'include'=>($current_field === 'category' ? '' : array_unique($categories)), + 'id'=>'mec_sf_category_'.$id, + 'hierarchical'=>true, + 'show_option_none'=>$label, + 'option_none_value'=>'', + 'selected'=>(isset($sf['category']) ? sanitize_text_field($sf['category']) : ''), + 'orderby'=>'name', + 'order'=>'ASC', + 'show_count'=>0, + 'child_of'=>(!count($categories) ? -1 : 0), + )); + } + elseif($category_type == 'checkboxes' and wp_count_terms(array('taxonomy' => 'mec_category'))) + { + $selected = (isset($sf['category']) and trim($sf['category'], ', ')) ? explode(',', trim(sanitize_text_field($sf['category']), ', ')) : []; + $categories_html .= wp_terms_checklist(0, array + ( + 'echo'=>false, + 'taxonomy'=>'mec_category', + 'selected_cats'=>$selected, + 'checked_ontop'=>false, + 'walker'=>(new MEC_walker(array( + 'include'=>($current_field === 'category' ? '' : array_unique($categories)), + 'id' => $id, + ))), + 'descendants_and_self'=>(!count($categories) ? -1 : 0), + )); + } + elseif($category_type == 'simple-checkboxes' and wp_count_terms(array('taxonomy' => 'mec_category'))) + { + $selected = (isset($sf['category']) and trim($sf['category'], ', ')) ? explode(',', trim(sanitize_text_field($sf['category']), ', ')) : []; + foreach($categories as $category_id) + { + $term = get_term($category_id); + $categories_html .= '
  • + +
  • '; + } + } + + // Locations + $label = $this->main->m('taxonomy_location', esc_html__('Location', 'modern-events-calendar-lite')); + + if($location_type == 'dropdown') + { + $locations_html .= wp_dropdown_categories(array + ( + 'echo'=>false, + 'taxonomy'=>'mec_location', + 'name'=>' ', + 'include'=>($current_field === 'location' ? '' : array_unique($locations)), + 'id'=>'mec_sf_location_'.$id, + 'hierarchical'=>true, + 'show_option_none'=>$label, + 'option_none_value'=>'', + 'selected'=>$sf['location'] ?? '', + 'orderby'=>'name', + 'order'=>'ASC', + 'show_count'=>0, + 'child_of'=>(!count($locations) ? -1 : 0), + )); + } + elseif($location_type == 'simple-checkboxes' and wp_count_terms(array('taxonomy' => 'mec_location'))) + { + $selected = (isset($sf['location']) and trim($sf['location'], ', ')) ? explode(',', trim(sanitize_text_field($sf['location']), ', ')) : []; + foreach($locations as $location_id) + { + $term = get_term($location_id); + $locations_html .= '
  • + +
  • '; + } + } + + // Organizers + $label = $this->main->m('taxonomy_organizer', esc_html__('Organizer', 'modern-events-calendar-lite')); + + if($organizer_type == 'dropdown') + { + $organizers_html .= wp_dropdown_categories(array + ( + 'echo'=>false, + 'taxonomy'=>'mec_organizer', + 'name'=>' ', + 'include'=>($current_field === 'organizer' ? '' : array_unique($organizers)), + 'id'=>'mec_sf_organizer_'.$id, + 'hierarchical'=>true, + 'show_option_none'=>$label, + 'option_none_value'=>'', + 'selected'=>(isset($sf['organizer']) ? sanitize_text_field($sf['organizer']) : ''), + 'orderby'=>'name', + 'order'=>'ASC', + 'show_count'=>0, + 'child_of'=>(!count($organizers) ? -1 : 0), + )); + } + elseif($organizer_type == 'simple-checkboxes' and wp_count_terms(array('taxonomy' => 'mec_organizer'))) + { + $selected = (isset($sf['organizer']) and trim($sf['organizer'], ', ')) ? explode(',', trim(sanitize_text_field($sf['organizer']), ', ')) : []; + foreach($organizers as $organizer_id) + { + $term = get_term($organizer_id); + $organizers_html .= '
  • + +
  • '; + } + } + + // Speakers + $label = $this->main->m('taxonomy_speaker', esc_html__('Speaker', 'modern-events-calendar-lite')); + + if($speaker_type == 'dropdown') + { + $speakers_html .= wp_dropdown_categories(array + ( + 'echo'=>false, + 'taxonomy'=>'mec_speaker', + 'name'=>' ', + 'include'=>($current_field === 'speaker' ? '' : array_unique($speakers)), + 'id'=>'mec_sf_speaker_'.$id, + 'hierarchical'=>true, + 'show_option_none'=>$label, + 'option_none_value'=>'', + 'selected'=>(isset($sf['speaker']) ? sanitize_text_field($sf['speaker']) : ''), + 'orderby'=>'name', + 'order'=>'ASC', + 'show_count'=>0, + 'child_of'=>(!count($speakers) ? -1 : 0), + )); + } + elseif($speaker_type == 'simple-checkboxes' and wp_count_terms(array('taxonomy' => 'mec_speaker'))) + { + $selected = (isset($sf['speaker']) and trim($sf['speaker'], ', ')) ? explode(',', trim(sanitize_text_field($sf['speaker']), ', ')) : []; + foreach($speakers as $speaker_id) + { + $term = get_term($speaker_id); + $speakers_html .= '
  • + +
  • '; + } + } + + // Tags + $label = $this->main->m('taxonomy_tag', esc_html__('Tag', 'modern-events-calendar-lite')); + + $tags_html .= wp_dropdown_categories(array + ( + 'echo'=>false, + 'taxonomy'=>apply_filters('mec_taxonomy_tag', ''), + 'name'=>' ', + 'include'=>($current_field === 'tag' ? '' : array_unique($tags)), + 'id'=>'mec_sf_tag_'.$id, + 'hierarchical'=>true, + 'show_option_none'=>$label, + 'option_none_value'=>'', + 'selected'=>(isset($sf['tag']) ? sanitize_text_field($sf['tag']) : ''), + 'orderby'=>'name', + 'order'=>'ASC', + 'show_count'=>0, + 'child_of'=>(!count($tags) ? -1 : 0), + )); + + // Labels + $label = $this->main->m('taxonomy_label', esc_html__('Label', 'modern-events-calendar-lite')); + + if($label_type == 'dropdown') + { + $labels_html .= wp_dropdown_categories(array + ( + 'echo'=>false, + 'taxonomy'=>'mec_label', + 'name'=>' ', + 'include'=>($current_field === 'label' ? '' : array_unique($labels)), + 'id'=>'mec_sf_label_'.$id, + 'hierarchical'=>true, + 'show_option_none'=>$label, + 'option_none_value'=>'', + 'selected'=>(isset($sf['label']) ? sanitize_text_field($sf['label']) : ''), + 'orderby'=>'name', + 'order'=>'ASC', + 'show_count'=>0, + 'child_of'=>(!count($labels) ? -1 : 0), + )); + } + elseif($label_type == 'simple-checkboxes' and wp_count_terms(array('taxonomy' => 'mec_label'))) + { + $selected = (isset($sf['label']) and trim($sf['label'], ', ')) ? explode(',', trim(sanitize_text_field($sf['label']), ', ')) : []; + foreach($labels as $label_id) + { + $term = get_term($label_id); + $labels_html .= '
  • + +
  • '; + } + } + + $output = array( + 'success' => 1, + 'categories' => (isset($sf['category']) and trim($sf['category'], ', ')) ? '' : $categories_html, + 'locations' => $current_field === 'location' ? '' : $locations_html, + 'organizers' => $current_field === 'organizer' ? '' : $organizers_html, + 'speakers' => $current_field === 'speaker' ? '' : $speakers_html, + 'tags' => $current_field === 'tag' ? '' : $tags_html, + 'labels' => $current_field === 'label' ? '' : $labels_html, + ); + + echo json_encode($output); + exit; + } + + public function get_locations_id($address = '') + { + if(!trim($address)) return []; + + $address = str_replace(' ', ',', $address); + $locations = explode(',', $address); + $query = "SELECT `term_id` FROM `#__termmeta` WHERE `meta_key` = 'address'"; + + foreach($locations as $location) if(trim($location)) $query .= " AND `meta_value` LIKE '%" . trim($location) . "%'"; + + $db = $this->getDB(); + $locations_id = $db->select($query, 'loadAssocList'); + return array_map(function($value) + { + return intval($value['term_id']); + }, $locations_id); + } +} \ No newline at end of file diff --git a/app/libraries/skins.php b/app/libraries/skins.php new file mode 100755 index 0000000..309e30a --- /dev/null +++ b/app/libraries/skins.php @@ -0,0 +1,2553 @@ + + */ +class MEC_skins extends MEC_base +{ + /** + * Default skin + * @var string + */ + public $skin = 'list'; + + /** + * @var array + */ + public $atts = []; + + /** + * @var array + */ + public $args = []; + + /** + * @var int + */ + public $maximum_dates = 6; + + /** + * Offset for don't load duplicated events in list/grid views on load more action + * @var int + */ + public $offset = 0; + + /** + * Offset for next load more action + * @var int + */ + public $next_offset = 0; + + /** + * Display Booking Method + * @var int + */ + public $booking_button = 0; + + /** + * Single Event Display Method + * @var string + */ + public $sed_method = '0'; + + /** + * Order Method + * @var string + */ + public $order_method = 'ASC'; + + public $factory; + public $main; + public $db; + public $file; + public $render; + public $found; + public $multiple_days_method; + public $hide_time_method; + public $skin_options; + public $style; + public $show_only_expired_events; + public $maximum_date_range = ''; + public $limit; + public $paged; + public $start_date; + public $end_date; + public $show_ongoing_events; + public $include_ongoing_events; + public $maximum_date = ''; + public $html_class; + public $sf; + public $sf_status; + public $sf_display_label; + public $sf_reset_button; + public $sf_refine; + public $sf_options; + public $id; + public $events; + public $widget; + public $count; + public $settings; + public $ml_settings; + public $layout; + public $year; + public $month; + public $day; + public $next_previous_button; + public $active_date; + public $today; + public $weeks; + public $week; + public $week_of_days; + public $events_str; + public $active_day; + public $load_more_button; + public $pagination = 'loadmore'; + public $month_divider; + public $toggle_month_divider; + public $image_popup; + public $map_on_top; + public $geolocation; + public $geolocation_focus; + public $include_events_times; + public $localtime; + public $reason_for_cancellation; + public $display_label; + public $display_price; + public $display_detailed_time; + public $display_progress_bar = false; + public $cache; + public $from_full_calendar = false; + public $unique_event_ids = []; + + /** + * Has More Events + * @var bool + */ + public $has_more_events = true; + + /** + * Auto Month Rotation + * @var bool + */ + public $auto_month_rotation = true; + + /** + * @var MEC_icons + */ + public $icons; + + public $loading_more = false; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // MEC factory library + $this->factory = $this->getFactory(); + + // MEC main library + $this->main = $this->getMain(); + + // MEC file library + $this->file = $this->getFile(); + + // MEC db library + $this->db = $this->getDB(); + + // MEC render library + $this->render = $this->getRender(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + + // Found Events + $this->found = 0; + + // How to show multiple days events + $this->multiple_days_method = $this->main->get_multiple_days_method(); + + // Hide event on start or on end + $this->hide_time_method = $this->main->get_hide_time_method(); + + // Cache + $this->cache = $this->getCache(); + + // Icons + $this->icons = $this->main->icons(); + } + + /** + * Registers skin actions into WordPress hooks + * @author Webnus + */ + public function actions() + { + } + + /** + * Loads all skins + * @author Webnus + */ + public function load() + { + $skins = $this->main->get_skins(); + foreach($skins as $skin=>$skin_name) + { + $path = MEC::import('app.skins.'.$skin, true, true); + $skin_path = apply_filters('mec_skin_path', $skin); + + if($skin_path != $skin and $this->file->exists($skin_path)) $path = $skin_path; + if(!$this->file->exists($path)) continue; + + include_once $path; + + $skin_class_name = 'MEC_skin_'.$skin; + + // Create Skin Object Class + $SKO = new $skin_class_name(); + + // init the actions + $SKO->actions(); + } + + // Init Single Skin + include_once MEC::import('app.skins.single', true, true); + + // Register the actions + $SKO = new MEC_skin_single(); + $SKO->actions(); + } + + /** + * Get path of one skin file + * @author Webnus + * @param string $file + * @return string + */ + public function get_path($file = 'tpl') + { + return MEC::import('app.skins.'.$this->skin.'.'.$file, true, true); + } + + /** + * Returns path of skin tpl + * @author Webnus + * @return string + */ + public function get_tpl_path() + { + $path = $this->get_path(); + + // Apply filters + $settings = $this->main->get_settings(); + + if('single' === $this->skin) + { + $single_style = $settings['single_single_style'] ?? ''; + $single_style = apply_filters( 'mec_filter_single_style', $single_style ); + $filtered_path = apply_filters('mec_get_skin_tpl_path', $this->skin, $single_style, $path); + } + else + { + $filtered_path = apply_filters('mec_get_skin_tpl_path', $this->skin, $this->style, $path); + } + + if($filtered_path != $this->skin and $this->file->exists($filtered_path)) $path = $filtered_path; + + return $path; + } + + /** + * Returns path of skin render file + * @author Webnus + * @return string + */ + public function get_render_path() + { + $path = $this->get_path('render'); + + // Apply filters + $filtered_path = apply_filters('mec_get_skin_render_path', $this->skin); + if($filtered_path != $this->skin and $this->file->exists($filtered_path)) $path = $filtered_path; + + return $path; + } + + /** + * Returns calendar file path of calendar views + * @author Webnus + * @param string $style + * @return string + */ + public function get_calendar_path($style = 'calendar') + { + $path = $this->get_path($style); + + // Apply filters + $filtered_path = apply_filters('mec_get_skin_calendar_path', $this->skin); + if($filtered_path != $this->skin and $this->file->exists($filtered_path)) $path = $filtered_path; + + return $path; + } + + /** + * Generates skin output + * @author Webnus + * @return string + */ + public function output() + { + if(!$this->main->getPRO() and in_array($this->skin, array('agenda', 'yearly_view', 'timetable', 'masonry', 'map', 'available_spot'))) + { + return ''; + } + + // Include needed assets for loading single event details page + if($this->sed_method === 'm1') $this->main->load_sed_assets($this->settings); + + $custom_output = apply_filters('mec_skin_output_html', null, $this); + if(!is_null($custom_output)) return $custom_output; + + ob_start(); + include $this->get_tpl_path(); + return ob_get_clean(); + } + + /** + * Returns keyword query for adding to WP_Query + * @author Webnus + * @return null|string + */ + public function keyword_query() + { + // Add keyword to filters + if(isset($this->atts['s']) and trim($this->atts['s']) != '') return $this->atts['s']; + else return NULL; + } + + /** + * Returns taxonomy query for adding to WP_Query + * @author Webnus + * @return array + */ + public function tax_query() + { + $tax_query = array('relation'=>'AND'); + + // Include label to filter + if(isset($this->atts['label']) and trim($this->atts['label'], ', ') != '') + { + $tax_query[] = array( + 'taxonomy'=>'mec_label', + 'field'=>'term_id', + 'terms'=>explode(',', trim($this->atts['label'], ', ')) + ); + } + + // Exclude label from filter + if(isset($this->atts['ex_label']) and trim($this->atts['ex_label'], ', ') != '') + { + $tax_query[] = array( + 'taxonomy'=>'mec_label', + 'field'=>'term_id', + 'operator'=>'NOT IN', + 'terms'=>explode(',', trim($this->atts['ex_label'], ', ')) + ); + } + + // Include category to filter + if(isset($this->atts['category']) and trim($this->atts['category'], ', ') != '') + { + $tax_query[] = array( + 'taxonomy'=>'mec_category', + 'field'=>'term_id', + 'terms'=>explode(',', trim($this->atts['category'], ', ')) + ); + } + + // Exclude category from filter + if(isset($this->atts['ex_category']) and trim($this->atts['ex_category'], ', ') != '') + { + $tax_query[] = array( + 'taxonomy'=>'mec_category', + 'field'=>'term_id', + 'operator'=>'NOT IN', + 'terms'=>explode(',', trim($this->atts['ex_category'], ', ')) + ); + } + + // Include location to filter + if(isset($this->atts['location']) and trim($this->atts['location'], ', ') != '') + { + $tax_query[] = array( + 'taxonomy'=>'mec_location', + 'field'=>'term_id', + 'terms'=>explode(',', trim($this->atts['location'], ', ')) + ); + } + + // Exclude location from filter + if(isset($this->atts['ex_location']) and trim($this->atts['ex_location'], ', ') != '') + { + $tax_query[] = array( + 'taxonomy'=>'mec_location', + 'field'=>'term_id', + 'operator'=>'NOT IN', + 'terms'=>explode(',', trim($this->atts['ex_location'], ', ')) + ); + } + + // Add event address to filter + if(isset($this->atts['address']) and trim($this->atts['address'], ', ') != '') + { + $get_locations_id = $this->get_locations_id($this->atts['address']); + $tax_query[] = array( + 'taxonomy'=>'mec_location', + 'field'=>'term_id', + 'terms'=>$get_locations_id, + ); + } + + // Include organizer to filter + if(isset($this->atts['organizer']) and trim($this->atts['organizer'], ', ') != '') + { + $tax_query[] = array( + 'taxonomy'=>'mec_organizer', + 'field'=>'term_id', + 'terms'=>explode(',', trim($this->atts['organizer'], ', ')) + ); + } + + // Exclude location from filter + if(isset($this->atts['ex_organizer']) and trim($this->atts['ex_organizer'], ', ') != '') + { + $tax_query[] = array( + 'taxonomy'=>'mec_organizer', + 'field'=>'term_id', + 'operator'=>'NOT IN', + 'terms'=>explode(',', trim($this->atts['ex_organizer'], ', ')) + ); + } + + // Include sponsor to filter + if(isset($this->atts['sponsor']) and trim($this->atts['sponsor'], ', ') != '') + { + $tax_query[] = array( + 'taxonomy'=>'mec_sponsor', + 'field'=>'term_id', + 'terms'=>explode(',', trim($this->atts['sponsor'], ', ')) + ); + } + + // Include speaker to filter + if(isset($this->atts['speaker']) and trim($this->atts['speaker'], ', ') != '') + { + $tax_query[] = array( + 'taxonomy'=>'mec_speaker', + 'field'=>'term_id', + 'terms'=>explode(',', trim($this->atts['speaker'], ', ')) + ); + } + + // Include Event Type 1 + if(isset($this->atts['event_type']) and trim($this->atts['event_type'], ', ') != '') + { + $tax_query[] = array( + 'taxonomy'=>'mec_event_type', + 'field'=>'term_id', + 'terms'=>explode(',', trim($this->atts['event_type'], ', ')) + ); + } + + // Include Event Type 2 + if(isset($this->atts['event_type_2']) and trim($this->atts['event_type_2'], ', ') != '') + { + $tax_query[] = array( + 'taxonomy'=>'mec_event_type_2', + 'field'=>'term_id', + 'terms'=>explode(',', trim($this->atts['event_type_2'], ', ')) + ); + } + + // Include tags to filter + if(apply_filters('mec_taxonomy_tag', '') !== 'post_tag' and isset($this->atts['tag']) and trim($this->atts['tag'], ', ') != '') + { + if(is_numeric($this->atts['tag'])) + { + $tax_query[] = array( + 'taxonomy'=>'mec_tag', + 'field'=>'term_id', + 'terms'=>explode(',', trim($this->atts['tag'], ', ')) + ); + } + else + { + $tax_query[] = array( + 'taxonomy'=>'mec_tag', + 'field'=>'name', + 'terms'=>explode(',', trim($this->atts['tag'], ', ')) + ); + } + } + + // Exclude tags from filter + if(isset($this->atts['ex_tag']) and trim($this->atts['ex_tag'], ', ') != '') + { + if(is_numeric($this->atts['ex_tag'])) + { + $tax_query[] = array( + 'taxonomy'=>apply_filters('mec_taxonomy_tag', ''), + 'field'=>'term_id', + 'operator'=>'NOT IN', + 'terms'=>explode(',', trim($this->atts['ex_tag'], ', ')) + ); + } + else + { + $tax_query[] = array( + 'taxonomy'=>apply_filters('mec_taxonomy_tag', ''), + 'field'=>'name', + 'operator'=>'NOT IN', + 'terms'=>explode(',', trim($this->atts['ex_tag'], ', ')) + ); + } + } + + return apply_filters('mec_map_tax_query', $tax_query, $this->atts); + } + + /** + * Returns meta query for adding to WP_Query + * @author Webnus + * @return array + */ + public function meta_query() + { + $meta_query = []; + $meta_query['relation'] = 'AND'; + + // Event Min Cost + if(isset($this->atts['cost-min']) and trim($this->atts['cost-min']) != '') + { + $meta_query[] = array( + 'key' => 'mec_cost', + 'value' => $this->atts['cost-min'], + 'type' => 'numeric', + 'compare' => '>=', + ); + } + + // Event Max Cost + if(isset($this->atts['cost-max']) and trim($this->atts['cost-max']) != '') + { + $meta_query[] = array( + 'key' => 'mec_cost', + 'value' => $this->atts['cost-max'], + 'type' => 'numeric', + 'compare' => '<=', + ); + } + + // Event Fields + if(isset($this->atts['fields']) and is_array($this->atts['fields']) and count($this->atts['fields'])) + { + foreach($this->atts['fields'] as $field_id => $field_value) + { + if(is_array($field_value) and isset($field_value['date_min'], $field_value['date_max']) and trim($field_value['date_min']) and trim($field_value['date_max'])) + { + $meta_query[] = array( + 'key' => 'mec_fields_'.$field_id, + 'value' => array($field_value['date_min'], $field_value['date_max']), + 'type' => 'DATE', + 'compare' => 'BETWEEN', + ); + } + elseif(is_string($field_value) and trim($field_value) !== '') + { + $meta_query[] = array( + 'key' => 'mec_fields_'.$field_id, + 'value' => $field_value, + 'compare' => 'LIKE', + ); + } + } + } + + // Event Status + if(isset($this->atts['event_status']) && !empty($this->atts['event_status']) && trim($this->atts['event_status']) != 'all'){ + + $meta_query[] = array( + 'key' => 'mec_event_status', + 'value' => $this->atts['event_status'], + 'compare' => '=', + ); + } + + return apply_filters('mec_map_meta_query', $meta_query, $this->atts); + } + + /** + * Returns tag query for adding to WP_Query + * @author Webnus + * @return string + */ + public function tag_query() + { + $tag = ''; + + // Add event tags to filter + if(isset($this->atts['tag']) and trim($this->atts['tag'], ', ') != '') + { + if(is_numeric($this->atts['tag'])) + { + $term = get_term_by('id', $this->atts['tag'], apply_filters('mec_taxonomy_tag', '')); + if($term) $tag = $term->slug; + } + else + { + $tags = explode(',', $this->atts['tag']); + foreach($tags as $t) + { + $term = get_term_by('name', $t, apply_filters('mec_taxonomy_tag', '')); + if($term) $tag .= $term->slug.','; + } + } + } + + return trim($tag, ', '); + } + + /** + * Returns author query for adding to WP_Query + * @author Webnus + * @return array + */ + public function author_query() + { + $author = ''; + + // Add event authors to filter + if(isset($this->atts['author']) and trim($this->atts['author'], ', ') != '') + { + $author = $this->atts['author']; + } + + return $author; + } + + public function author_query_ex() + { + $author = []; + + // Exclude event authors from filter + if(isset($this->atts['ex_author']) and trim($this->atts['ex_author'], ', ') != '') + { + $author = explode(',', $this->atts['ex_author']); + } + + return $author; + } + + /** + * Set the current day for filtering events in WP_Query + * @author Webnus + * @param String $today + * @return void + */ + public function setToday($today = NULL) + { + if(is_null($today)) $today = date('Y-m-d'); + + $this->args['mec-today'] = $today; + $this->args['mec-now'] = strtotime($this->args['mec-today']); + + $this->args['mec-year'] = date('Y', $this->args['mec-now']); + $this->args['mec-month'] = date('m', $this->args['mec-now']); + $this->args['mec-day'] = date('d', $this->args['mec-now']); + + $this->args['mec-week'] = (int) ((date('d', $this->args['mec-now']) - 1) / 7) + 1; + $this->args['mec-weekday'] = date('N', $this->args['mec-now']); + } + + /** + * Join MEC table with WP_Query for filtering the events + * @author Webnus + * @param string $join + * @param object $wp_query + * @return string + */ + public function join($join, $wp_query) + { + if(is_string($wp_query->query_vars['post_type']) and $wp_query->query_vars['post_type'] == $this->main->get_main_post_type() and $wp_query->get('mec-init', false)) + { + $join .= $this->db->_prefix(" LEFT JOIN `#__mec_events` AS mece ON #__posts.ID = mece.post_id LEFT JOIN `#__mec_dates` AS mecd ON #__posts.ID = mecd.post_id"); + } + + return $join; + } + + /** + * @param string $start + * @param string $end + * @param boolean $exclude + * @return array + */ + public function period($start, $end, $exclude = false) + { + // Search till the end of End Date! + if(!$this->show_only_expired_events and $this->order_method === 'ASC' and date('H:i:s', strtotime($end)) == '00:00:00') $end .= ' 23:59:59'; + + // Search From last second of start date + if($this->show_only_expired_events or $this->order_method === 'DESC') + { + if(date('Y-m-d', strtotime($start)) !== current_time('Y-m-d') and date('H:i:s', strtotime($start)) == '00:00:00') $start .= ' 23:59:59'; + elseif(date('Y-m-d', strtotime($start)) === current_time('Y-m-d') and date('H:i:s', strtotime($start)) == '00:00:00') $start .= ' '.current_time('H:i:s'); + } + + $seconds_start = strtotime($start); + $seconds_end = strtotime($end); + + $order = "`tstart` ASC, `id` ASC"; + $where_OR = "(`tstart`>='".$seconds_start."' AND `tend`<='".$seconds_end."') OR (`tstart`<='".$seconds_end."' AND `tend`>='".$seconds_end."') OR (`tstart`<='".$seconds_start."' AND `tend`>='".$seconds_start."')"; + // (Start: In, Finish: In) OR (Start: Before or In, Finish: After) OR (Start: Before, Finish: In or After) + + if($this->show_only_expired_events or $this->order_method === 'DESC') + { + $column = 'tstart'; + + if($this->hide_time_method == 'plus1') $seconds_start -= 3600; + elseif($this->hide_time_method == 'plus2') $seconds_start -= 7200; + elseif($this->hide_time_method == 'plus10') $seconds_start -= 36000; + elseif($this->hide_time_method == 'end') $column = 'tend'; + + $order = "`tstart` DESC, `id` DESC"; + + $where_OR = "`".$column."`<'".$seconds_start."'"; + if($column != 'tend') $where_OR .= " AND `tend`<'".$seconds_start."'"; + + // Fix for Tile skin + if($this->skin === 'tile' && $this->next_previous_button) $where_OR .= " AND `tstart`>='".$seconds_end."'"; + } + elseif($this->show_ongoing_events) + { + $now = current_time('timestamp'); + if(in_array($this->skin, ['list', 'grid']) && !(strpos($this->style, 'fluent') === false || strpos($this->style, 'liquid') === false)) + { + if($this->skin_options['start_date_type'] != 'today') + { + $startDateTime = strtotime($this->start_date) + (int) $this->main->get_gmt_offset_seconds(); + $now = max($startDateTime, $now); + } + + $where_OR = "(`tstart`>'".$now."' AND `tend`<='".$seconds_end."')"; + } + else + { + $where_OR = "(`tstart`<='".$now."' AND `tend`>='".$now."')"; + } + } + + $where_AND = "1 AND `public`=1 AND `status`='publish'"; + + // Exclude Events + if(isset($this->atts['exclude']) and is_array($this->atts['exclude']) and count($this->atts['exclude'])) $where_AND .= " AND `post_id` NOT IN (".implode(',', $this->atts['exclude']).")"; + + // Include Events + if(isset($this->atts['include']) and is_array($this->atts['include']) and count($this->atts['include'])) $where_AND .= " AND `post_id` IN (".implode(',', $this->atts['include']).")"; + + $query = "SELECT * FROM `#__mec_dates` WHERE (".$where_OR.") AND (".$where_AND.") ORDER BY ".$order; + $mec_dates = $this->db->select($query); + + // Today and Now + $today = current_time('Y-m-d'); + $now = current_time('timestamp'); + + // Midnight Hour + $midnight_hour = (isset($this->settings['midnight_hour']) and $this->settings['midnight_hour']) ? $this->settings['midnight_hour'] : 0; + + // Local Time Filter + $local_time_start = NULL; + $local_time_start_datetime = NULL; + $local_time_end = NULL; + + if(isset($this->atts['time-start']) and trim($this->atts['time-start'])) $local_time_start = $this->atts['time-start']; + if(isset($this->atts['time-end']) and trim($this->atts['time-end'])) $local_time_end = $this->atts['time-end']; + + // Local Timezone + $local_timezone = NULL; + if($local_time_start or $local_time_end) + { + $local_timezone = $this->main->get_timezone_by_ip(); + if(!trim($local_timezone)) $local_timezone = $this->main->get_timezone(); + } + + $include_ongoing_events = $this->include_ongoing_events; + if($this->loading_more) $include_ongoing_events = 0; + + $dates = []; + foreach($mec_dates as $mec_date) + { + $s = strtotime($mec_date->dstart); + $e = strtotime($mec_date->dend); + + // Skip Events Based on Local Start Time Search + if($local_time_start) + { + $local_time_start_datetime = $mec_date->dstart.' '.$local_time_start; + + // Local Current Time + $local = new DateTime($local_time_start_datetime, new DateTimeZone($local_timezone)); + + $event_timezone = $this->main->get_timezone($mec_date->post_id); + $local_time_in_event_timezone = $local->setTimezone(new DateTimeZone($event_timezone))->format('Y-m-d H:i:s'); + + if(strtotime($local_time_in_event_timezone) > $mec_date->tstart) continue; + } + + // Skip Events Based on Local End Time Search + if($local_time_end) + { + $local_time_end_datetime = ($this->atts['date-range-end'] ?? $mec_date->dstart).' '.$local_time_end; + + // End Time is Earlier than Start Time so Add 1 Day to the End Date + if($local_time_start_datetime and strtotime($local_time_end_datetime) <= strtotime($local_time_start_datetime)) $local_time_end_datetime = date('Y-m-d', strtotime('+1 Day', strtotime($mec_date->dend))).' '.$local_time_end; + + // Local Current Time + $local = new DateTime($local_time_end_datetime, new DateTimeZone($local_timezone)); + + $event_timezone = $this->main->get_timezone($mec_date->post_id); + $local_time_in_event_timezone = $local->setTimezone(new DateTimeZone($event_timezone))->format('Y-m-d H:i:s'); + + if(strtotime($local_time_in_event_timezone) < $mec_date->tend) continue; + } + + // Hide Events Based on Start Time + if(!$include_ongoing_events and !$this->show_ongoing_events and !$this->show_only_expired_events and !$this->args['mec-past-events'] and $s <= strtotime($today)) + { + if($this->hide_time_method == 'start' and $now >= $mec_date->tstart) continue; + elseif($this->hide_time_method == 'plus1' and $now >= $mec_date->tstart+3600) continue; + elseif($this->hide_time_method == 'plus2' and $now >= $mec_date->tstart+7200) continue; + elseif($this->hide_time_method == 'plus10' and $now >= $mec_date->tstart+36000) continue; + } + + // Hide Events Based on End Time + if(!$this->show_only_expired_events and !$this->args['mec-past-events'] and $e <= strtotime($today)) + { + if($this->hide_time_method == 'end' and $now >= $mec_date->tend) continue; + } + + if(($this->multiple_days_method == 'first_day' or ($this->multiple_days_method == 'first_day_listgrid' and in_array($this->skin, array('list', 'grid', 'slider', 'carousel', 'agenda', 'tile'))))) + { + // Hide Shown Events on AJAX + if(defined('DOING_AJAX') and DOING_AJAX and $s != $e and $s < strtotime($start) and !$include_ongoing_events and !$this->show_only_expired_events and $this->order_method === 'ASC') continue; + + $d = date('Y-m-d', $s); + + if(!isset($dates[$d])) $dates[$d] = []; + $dates[$d][] = $mec_date->post_id; + } + else + { + $diff = $this->main->date_diff($mec_date->dstart, $mec_date->dend); + $days_long = (isset($diff->days) and !$diff->invert) ? $diff->days : 0; + + while($s <= $e) + { + if((!$this->show_only_expired_events and $this->order_method === 'ASC' and $seconds_start <= $s and $s <= $seconds_end) or (($this->show_only_expired_events or $this->order_method === 'DESC') and $seconds_start >= $s and $s >= $seconds_end)) + { + $d = date('Y-m-d', $s); + if(!isset($dates[$d])) $dates[$d] = []; + + // Check for exclude events + if($exclude) + { + $current_id = !isset($current_id) ? 0 : $current_id; + + if(!isset($not_in_day)) + { + $query = "SELECT `post_id`,`not_in_days` FROM `#__mec_events`"; + $not_in_day = $this->db->select($query); + } + + if(array_key_exists($mec_date->post_id, $not_in_day) and trim($not_in_day[$mec_date->post_id]->not_in_days)) + { + $days = $not_in_day[$mec_date->post_id]->not_in_days; + $current_id = $mec_date->post_id; + } + else $days = ''; + + if(strpos($days, $d) === false) + { + $midnight = $s+(3600*$midnight_hour); + if($days_long == '1' and $midnight >= $mec_date->tend) break; + + $dates[$d][] = $mec_date->post_id; + } + } + else + { + $midnight = $s+(3600*$midnight_hour); + if($days_long == '1' and $midnight >= $mec_date->tend) break; + + $dates[$d][] = $mec_date->post_id; + } + } + + $s += 86400; + } + } + } + + $one_occurrence_sql = "SELECT `post_id`, `tstart` FROM `#__mec_dates` WHERE `tstart` >= $now AND `tstart` <= $seconds_end ORDER BY `tstart` ASC"; + if($this->hide_time_method == 'end') $one_occurrence_sql = "SELECT `post_id`, `tstart` FROM `#__mec_dates` WHERE `tend` >= $now AND `tstart` <= $seconds_end ORDER BY `tstart` ASC"; + if($include_ongoing_events) $one_occurrence_sql = "SELECT `post_id`, `tstart` FROM `#__mec_dates` WHERE (`tstart` >= $now AND `tstart` <= $seconds_end) OR (`tstart` <= $now AND `tend` >= $now) ORDER BY `tstart` ASC"; + + // Show only one occurrence of events + $first_event = $this->db->select($one_occurrence_sql); + + // Force to Show Only Once Occurrence Based on Shortcode Options + $shortcode_display_one_occurrence = isset($this->atts['show_only_one_occurrence']) && $this->atts['show_only_one_occurrence']; + + $did_one_occurrence = []; + foreach($dates as $date => $event_ids) + { + if(!is_array($event_ids) || !count($event_ids)) continue; + + // Add to Unique Event IDs + $this->unique_event_ids = array_merge($this->unique_event_ids, $event_ids); + + foreach($event_ids as $index => $event_id) + { + $one_occurrence = get_post_meta($event_id, 'one_occurrence', true); + if($one_occurrence != '1' && !$shortcode_display_one_occurrence) continue; + + if(isset($first_event[$event_id]->tstart) and date('Y-m-d', strtotime($date)) != date('Y-m-d', $first_event[$event_id]->tstart)) + { + $dates[$date][$index] = ''; + } + else + { + if(in_array($event_id, $did_one_occurrence)) $dates[$date][$index] = ''; + else $did_one_occurrence[] = $event_id; + } + } + } + + // Remove Global Exceptional Dates + $global_exceptional_dates = isset($this->settings['global_exceptional_days']) && is_array($this->settings['global_exceptional_days']) ? $this->settings['global_exceptional_days'] : []; + foreach($global_exceptional_dates as $k => $e) + { + if(!is_numeric($k)) continue; + $e = $this->main->standardize_format($e); + + if(isset($dates[$e])) unset($dates[$e]); + } + + // Make the event ids Unique + $this->unique_event_ids = array_unique($this->unique_event_ids); + + // Initialize Metadata of Events + $this->cache_mec_events(); + + return $dates; + } + + /** + * Perform the search + * @return array of objects \stdClass + * @throws Exception + * @author Webnus + */ + public function search() + { + global $MEC_Events_dates; + if($this->show_only_expired_events) + { + $apply_sf_date = isset($_REQUEST['apply_sf_date']) ? sanitize_text_field($_REQUEST['apply_sf_date']) : 1; + $sf = (isset($_REQUEST['sf']) and is_array($_REQUEST['sf'])) ? $this->main->sanitize_deep_array($_REQUEST['sf']) : []; + + $start = ((isset($this->sf) || $sf) and $apply_sf_date) ? date('Y-m-t', strtotime($this->start_date)) : $this->start_date; + $end = date('Y-m-01', strtotime('-15 Years', strtotime($start))); + } + elseif($this->order_method === 'DESC') + { + $start = $this->start_date; + $end = date('Y-m-01', strtotime('-15 Years', strtotime($start))); + } + else + { + $start = $this->start_date; + $end = date('Y-m-t', strtotime('+15 Years', strtotime($start))); + } + + // Set a certain maximum date from shortcode page. + if(trim($this->maximum_date) == '' and (isset($this->maximum_date_range) and trim($this->maximum_date_range))) $this->maximum_date = $this->maximum_date_range; + + // Date Events + $dates = $this->period($start, $end, true); + + // Limit + $this->args['posts_per_page'] = apply_filters('mec_skins_search_posts_per_page', 100); + $dates = apply_filters('mec_event_dates_search', $dates, $start, $end, $this); + + $last_timestamp = NULL; + $last_event_id = NULL; + + $i = 0; + $found = 0; + $events = []; + $qs = []; + + foreach($dates as $date=>$IDs) + { + // No Event + if(!is_array($IDs) or (is_array($IDs) and !count($IDs))) continue; + + // Check Finish Date + if(isset($this->maximum_date) and trim($this->maximum_date) and ((strtotime($date) > strtotime($this->maximum_date) and $this->order_method === 'ASC') or (strtotime($date) < strtotime($this->maximum_date) and $this->order_method === 'DESC'))) break; + + // Include Available Events + $this->args['post__in'] = array_unique($IDs); + + // Count of events per day + $IDs_count = array_count_values($IDs); + + // Extending the end date + $this->end_date = $date; + + // Continue to load rest of events in the first date + if($i === 0 and $this->start_date === $date) $this->args['offset'] = $this->offset; + // Load all events in the rest of dates + else + { + $this->offset = 0; + $this->args['offset'] = 0; + } + + // The Query + $this->args = apply_filters('mec_skin_query_args', $this->args, $this); + + // Query Key + $q_key = base64_encode(json_encode($this->args)); + + // Get From Cache + if(isset($qs[$q_key])) $query = $qs[$q_key]; + // Search & Cache + else + { + $query = new WP_Query($this->args); + $qs[$q_key] = $query; + } + + if($query->have_posts()) + { + if(!isset($events[$date])) $events[$date] = []; + + // Day Events + $d = []; + + // The Loop + while($query->have_posts()) + { + $query->the_post(); + $ID = get_the_ID(); + + $ID_count = $IDs_count[$ID] ?? 1; + for($i = 1; $i <= $ID_count; $i++) + { + $rendered = $this->render->data($ID); + + $data = new stdClass(); + $data->ID = $ID; + $data->data = $rendered; + + $data->date = array + ( + 'start' => array('date'=>$date), + 'end' => array('date'=>$this->main->get_end_date($date, $rendered)) + ); + + $event_data = $this->render->after_render($data, $this, $i); + $date_times = $this->get_event_datetimes($event_data); + + $last_timestamp = $event_data->data->time['start_timestamp']; + $last_event_id = $ID; + + // global variable for use dates + $MEC_Events_dates[$ID][] = $date_times; + + $d[] = $event_data; + $found++; + } + + if($found >= $this->limit) + { + // Next Offset + $this->next_offset = ($query->post_count-($query->current_post+1)) >= 0 ? ($query->current_post+1)+$this->offset : 0; + + usort($d, [$this, 'sort_day_events']); + $events[$date] = $d; + + // Restore original Post Data + wp_reset_postdata(); + + break 2; + } + } + + usort($d, [$this, 'sort_day_events']); + $events[$date] = $d; + } + + // Restore original Post Data + wp_reset_postdata(); + + $i++; + } + + // Initialize Occurrences' Data + MEC_feature_occurrences::fetch($events); + + // Set Offset for Last Page + if($found < $this->limit) + { + // Next Offset + $this->next_offset = $found + ((isset($date) and $this->start_date === $date) ? $this->offset : 0); + } + + // Set found events + $this->found = $found; + + // Has More Events + if($last_timestamp and $last_event_id) $this->has_more_events = (boolean) $this->db->select("SELECT COUNT(id) FROM `#__mec_dates` WHERE `tstart` > ".$last_timestamp." OR (`tstart` = ".$last_timestamp." AND `post_id`!='".$last_event_id."')", 'loadResult'); + + $event_include=array(); + $occurrences_status = (isset($this->settings['per_occurrences_status']) and $this->settings['per_occurrences_status'] ); + if(isset($this->atts['location']) and trim($this->atts['location'], ', ') != '' and $occurrences_status) + { + $include_location = explode(',', trim($this->atts['location'], ', ')); + foreach ($events as $date=>$event_details){ + foreach($event_details as $event) + { + $location_id = $this->main->get_master_location_id($event); + if (in_array($location_id, $include_location) || in_array($event->data->meta['mec_location_id'], $include_location)) { + $event_include[$date]=$event_details; + } + } + } + } + + if(isset($this->atts['organizer']) and trim($this->atts['organizer'], ', ') != '' and $occurrences_status) + { + $include_organizer = explode(',', trim($this->atts['organizer'], ', ')); + foreach ($events as $date=>$event_details){ + foreach($event_details as $event) + { + $organizer_id = $this->main->get_master_organizer_id($event); + if (in_array($organizer_id, $include_organizer) || in_array($event->data->meta['mec_organizer_id'], $include_organizer)) { + $event_include[$date]=$event_details; + } + } + } + } + + if(count($event_include)>0){ + $events = $event_include; + } + + return $events; + } + + public function get_event_datetimes($event) + { + $start_date = $event->date['start']['date']; + $start_time = $event->data->time['start']; + $start_datetime = esc_html__('All Day', 'modern-events-calendar-lite') !== $start_time ? "$start_date $start_time" : $start_date; + $start_timestamp = strtotime( $start_datetime ); + + $end_date = $event->date['end']['date']; + $end_time = $event->data->time['end']; + $end_datetime = esc_html__('All Day', 'modern-events-calendar-lite') !== $end_time ? "$end_date $end_time" : $end_date; + $end_timestamp = strtotime( $end_datetime ); + + return [ + 'start' => [ + 'date' => $start_date, + 'time' => $start_time, + 'timestamp' => $start_timestamp, + ], + 'end' => [ + 'date' => $end_date, + 'time' => $end_time, + 'timestamp' => $end_timestamp, + ], + ]; + } + + /** + * Run the search command + * @return array of objects + * @throws Exception + * @author Webnus + */ + public function fetch() + { + // Events! :) + return $this->events = $this->search(); + } + + /** + * Draw Monthly Calendar + * @author Webnus + * @param string|int $month + * @param string|int $year + * @param array $events + * @param string $style + * @return string + */ + public function draw_monthly_calendar($year, $month, $events = array(), $style = 'calendar') + { + $calendar_path = $this->get_calendar_path($style); + + // Generate Month + ob_start(); + include $calendar_path; + return ob_get_clean(); + } + + /** + * @param object $event + * @return string + */ + public function get_event_classes($event) + { + // Labels are not set + if(!isset($event->data) || !isset($event->data->labels)) return NULL; + + // No Labels + if(!is_array($event->data->labels) or (is_array($event->data->labels) and !count($event->data->labels))) return NULL; + + $classes = ''; + foreach($event->data->labels as $label) + { + if(!isset($label['style']) || !trim($label['style'])) continue; + $classes .= ' '.$label['style']; + } + + return trim($classes); + } + + /** + * Generates Search Form + * @author Webnus + * @return string + */ + public function sf_search_form() + { + // If no fields specified + if(!count($this->sf_options)) return ''; + + $display_style = $fields = ''; + $first_row = 'not-started'; + $display_form = []; + + foreach($this->sf_options as $field=>$options) + { + // Event Fields is disabled + if($field === 'fields' and (!isset($this->settings['display_event_fields_search']) or (isset($this->settings['display_event_fields_search']) and !$this->settings['display_event_fields_search']))) continue; + + $display_form[] = $options['type'] ?? ($field === 'fields' ? 'fields' : NULL); + $fields_array = array('category', 'location', 'organizer', 'speaker', 'tag', 'label'); + $fields_array = apply_filters('mec_filter_fields_search_array', $fields_array); + + if(in_array($field, $fields_array) and $first_row == 'not-started') + { + $first_row = 'started'; + if($this->sf_options['category']['type'] == "0" and $this->sf_options['location']['type'] == '0' and $this->sf_options['organizer']['type'] == '0' and (isset($this->sf_options['speaker']['type']) && $this->sf_options['speaker']['type'] == '0') and (isset($this->sf_options['tag']['type']) && $this->sf_options['tag']['type'] == '0') and $this->sf_options['label']['type'] == '0') + { + $display_style = 'style="display: none;"'; + } + + $fields .= '
    '; + } + + if(!in_array($field, $fields_array) and $first_row == 'started') + { + $first_row = 'finished'; + $fields .= '
    '; + } + + $fields .= $this->sf_search_field($field, $options, $this->sf_display_label); + } + + $fields = apply_filters('mec_filter_fields_search_form', $fields, $this); + + $form = ''; + if(trim($fields) && (in_array('dropdown', $display_form) || in_array('simple-checkboxes', $display_form) || in_array('checkboxes', $display_form) || in_array('text_input', $display_form) || in_array('address_input', $display_form) || in_array('minmax', $display_form) || in_array('local-time-picker', $display_form) || in_array('fields', $display_form))) + { + $form .= '
    '; + $form .= $fields; + + // Reset Button + if($this->sf_reset_button) $form .='
    '; + + $form = apply_filters('mec_sf_search_form_end', $form, $this); + + $form .= '
    '; + } + + return apply_filters('mec_sf_search_form', $form, $this); + } + + /** + * Generate a certain search field + * @author Webnus + * @param string $field + * @param array $options + * @param int $display_label + * @return string + */ + public function sf_search_field($field, $options, $display_label = null) + { + $type = $options['type'] ?? ''; + + // Field is disabled + if(!trim($type) and $field !== 'fields') return ''; + + // Status of Speakers Feature + $speakers_status = isset($this->settings['speakers_status']) && $this->settings['speakers_status']; + + // Import + self::import('app.libraries.walker'); + if(!function_exists('wp_terms_checklist')) include ABSPATH.'wp-admin/includes/template.php'; + + $output = ''; + if($field == 'category') + { + $label = $this->main->m('taxonomy_category', esc_html__('Category', 'modern-events-calendar-lite')); + + if($type == 'dropdown') + { + $output .=''; + } + elseif($type == 'checkboxes' and wp_count_terms(array('taxonomy' => 'mec_category'))) + { + $output .= ''; + } + elseif($type == 'simple-checkboxes' and wp_count_terms(array('taxonomy' => 'mec_category'))) + { + $output .= ''; + } + } + elseif($field == 'location') + { + $label = $this->main->m('taxonomy_location', esc_html__('Location', 'modern-events-calendar-lite')); + + if($type == 'dropdown') + { + $output .= ''; + } + elseif($type == 'simple-checkboxes' and wp_count_terms(array('taxonomy' => 'mec_location'))) + { + $output .= ''; + } + } + elseif($field == 'organizer' && (!isset($this->settings['organizers_status']) || $this->settings['organizers_status'])) + { + $label = $this->main->m('taxonomy_organizer', esc_html__('Organizer', 'modern-events-calendar-lite')); + + if($type == 'dropdown') + { + $output .= ''; + } + elseif($type == 'simple-checkboxes' and wp_count_terms(array('taxonomy' => 'mec_organizer'))) + { + $output .= ''; + } + } + elseif($field == 'speaker' and $speakers_status) + { + $label = $this->main->m('taxonomy_speaker', esc_html__('Speaker', 'modern-events-calendar-lite')); + + if($type == 'dropdown') + { + $output .= ''; + } + elseif($type == 'simple-checkboxes' and wp_count_terms(array('taxonomy' => 'mec_speaker'))) + { + $output .= ''; + } + } + elseif($field == 'tag') + { + $label = $this->main->m('taxonomy_tag', esc_html__('Tag', 'modern-events-calendar-lite')); + + if($type == 'dropdown') + { + $output .= ''; + } + } + elseif($field == 'label') + { + $label = $this->main->m('taxonomy_label', esc_html__('Label', 'modern-events-calendar-lite')); + + if($type == 'dropdown') + { + $output .= ''; + } + elseif($type == 'simple-checkboxes' and wp_count_terms(array('taxonomy' => 'mec_label'))) + { + $output .= ''; + } + } + elseif($field == 'month_filter') + { + $label = esc_html__('Date', 'modern-events-calendar-lite'); + if($type == 'dropdown') + { + $time = isset($this->start_date) ? strtotime($this->start_date) : ''; + $now = current_time('timestamp'); + + $skins = ['list', 'grid', 'agenda', 'map']; + if(isset($this->skin_options['default_view']) and $this->skin_options['default_view'] == 'list') $skins[] = 'full_calendar'; + + $item = esc_html__('Select', 'modern-events-calendar-lite'); + $option = in_array($this->skin, $skins) ? '' : ''; + + $output .= ''; + } + elseif($type == 'date-range-picker') + { + $min_date = $this->start_date ?? NULL; + + $output .= ''; + } + } + elseif($field == 'time_filter') + { + $label = esc_html__('Time', 'modern-events-calendar-lite'); + if($type == 'local-time-picker') + { + $this->main->load_time_picker_assets(); + + $output .= ''; + } + } + elseif($field == 'text_search') + { + $label = esc_html__('Text', 'modern-events-calendar-lite'); + if($type == 'text_input') + { + $placeholder = $options['placeholder'] ?? ''; + + $output .= ''; + } + } + elseif($field == 'address_search') + { + $label = esc_html__('Address', 'modern-events-calendar-lite'); + if($type == 'address_input') + { + $placeholder = $options['placeholder'] ?? ''; + + $output .= ''; + } + } + elseif($field == 'event_cost') + { + $label = esc_html__('Cost', 'modern-events-calendar-lite'); + if($type == 'minmax') + { + $output .= '
    '; + if($display_label == 1) $output .=''; + $output .= $this->icons->display('credit-card').' + + +
    '; + } + } + elseif($field == 'fields') + { + $event_fields = $this->main->get_event_fields(); + foreach($options as $field_id => $field_options) + { + $event_field = $event_fields[$field_id] ?? []; + $label = $event_field['label'] ?? ''; + $type = $field_options['type'] ?? ''; + + // Disabled Field + if(!$label or !$type) continue; + + $field_values = (isset($event_field['options']) and is_array($event_field['options'])) ? $event_field['options'] : []; + + if($type === 'text_input') + { + $output .= ''; + } + elseif($type === 'dropdown') + { + $output .= ''; + } + elseif($type === 'date-range-picker') + { + $min_date = $this->start_date ?? NULL; + + $output .= ''; + } + } + } + + return apply_filters('mec_search_fields_to_box', $output, $field, $type, $this->atts, $this->id); + } + + public function sf_only_valid_terms($taxonomy, $existing_terms = []) + { + if($this->show_only_expired_events) $event_ids = $this->main->get_expired_event_ids(current_time('timestamp'), 'publish'); + elseif(isset($this->args['mec-past-events']) and $this->args['mec-past-events']) $event_ids = $this->main->get_all_event_ids('publish'); + elseif($this->show_ongoing_events) $event_ids = $this->main->get_ongoing_event_ids(current_time('timestamp'), 'publish'); + elseif($this->include_ongoing_events) + { + $ongoing_ids = $this->main->get_ongoing_event_ids(current_time('timestamp'), 'publish'); + $upcoming_ids = $this->main->get_upcoming_event_ids(current_time('timestamp'), 'publish'); + + $event_ids = array_merge($ongoing_ids, $upcoming_ids); + $event_ids = array_unique($event_ids); + } + else $event_ids = $this->main->get_upcoming_event_ids(current_time('timestamp'), 'publish'); + + $terms = []; + + $post_terms = wp_get_object_terms($event_ids, $taxonomy); + if(is_array($post_terms)) foreach($post_terms as $post_term) $terms[] = $post_term->term_id; + + $existing_terms = array_unique($existing_terms); + $terms = array_unique($terms); + + // No Terms + if(!count($terms)) return [-1]; + + $exclude = []; + + if($taxonomy === 'mec_category' && isset($this->atts['ex_category']) && trim($this->atts['ex_category'])) $exclude = explode(',', trim($this->atts['ex_category'], ', ')); + else if($taxonomy === 'mec_location' && isset($this->atts['ex_location']) && trim($this->atts['ex_location'])) $exclude = explode(',', trim($this->atts['ex_location'], ', ')); + else if($taxonomy === 'mec_organizer' && isset($this->atts['ex_organizer']) && trim($this->atts['ex_organizer'])) $exclude = explode(',', trim($this->atts['ex_organizer'], ', ')); + else if($taxonomy === 'mec_label' && isset($this->atts['ex_label']) && trim($this->atts['ex_label'])) $exclude = explode(',', trim($this->atts['ex_label'], ', ')); + else if($taxonomy === 'mec_tag' && isset($this->atts['ex_tag']) && trim($this->atts['ex_tag'])) $exclude = explode(',', trim($this->atts['ex_tag'], ', ')); + + // Exclude Terms + if(count($exclude)) + { + foreach($exclude as $ex_id) + { + if(in_array($ex_id, $terms)) unset($terms[array_search($ex_id, $terms)]); + } + } + + // No Existing Terms + if(!count($existing_terms)) return $terms; + + // Intersect + $intersect = array_intersect($existing_terms, $terms); + + // No Intersect + if(!count($intersect)) return $terms; + + // Return + return $intersect; + } + + public function sf_apply($atts, $sf = array(), $apply_sf_date = 1) + { + // Return normal atts if sf is empty + if(!count($sf)) return $atts; + + // Apply Text Search Query + if(isset($sf['s'])) $atts['s'] = $sf['s']; + + // Apply Address Search Query + if(isset($sf['address'])) $atts['address'] = $sf['address']; + + // Apply Category Query + if(isset($sf['category']) and trim($sf['category'])) $atts['category'] = $sf['category']; + + // Apply Location Query + if(isset($sf['location'])) $atts['location'] = $sf['location']; + + // Apply Organizer Query + if(isset($sf['organizer']) and trim($sf['organizer'])) $atts['organizer'] = $sf['organizer']; + + // Apply speaker Query + if(isset($sf['speaker']) and trim($sf['speaker'])) $atts['speaker'] = $sf['speaker']; + + // Apply tag Query + if(isset($sf['tag']) and trim($sf['tag'])) $atts['tag'] = $sf['tag']; + + // Apply Label Query + if(isset($sf['label']) and trim($sf['label'])) $atts['label'] = $sf['label']; + + // Apply Event Cost Query + if(isset($sf['cost-min'])) $atts['cost-min'] = $sf['cost-min']; + if(isset($sf['cost-max'])) $atts['cost-max'] = $sf['cost-max']; + + // Event Status + if(isset($sf['event_status'])) $atts['event_status'] = $sf['event_status']; + + // Apply Local Time Query + if(isset($sf['time-start'])) $atts['time-start'] = $sf['time-start']; + if(isset($sf['time-end'])) $atts['time-end'] = $sf['time-end']; + + // Apply Event Fields + if(isset($sf['fields']) and is_array($sf['fields']) and count($sf['fields'])) $atts['fields'] = $sf['fields']; + + // Apply SF Date or Not + if($apply_sf_date == 1) + { + // Apply Month of Month Filter + if(isset($sf['month']) and trim($sf['month'])) $_REQUEST['mec_month'] = $sf['month']; + + // Apply Year of Month Filter + if(isset($sf['year']) and trim($sf['year'])) $_REQUEST['mec_year'] = $sf['year']; + + // Apply to Start Date + if(isset($sf['month']) and trim($sf['month']) and isset($sf['year']) and trim($sf['year'])) + { + $start_date = $sf['year'].'-'.$sf['month'].'-'.($sf['day'] ?? '01'); + $_REQUEST['mec_start_date'] = $start_date; + + $skins = $this->main->get_skins(); + foreach($skins as $skin=>$label) + { + $atts['sk-options'][$skin]['start_date_type'] = 'date'; + $atts['sk-options'][$skin]['start_date'] = $start_date; + } + } + + // Apply Start and End Dates + if(isset($sf['start']) and trim($sf['start']) and isset($sf['end']) and trim($sf['end'])) + { + $start = $this->main->standardize_format($sf['start']); + $_REQUEST['mec_start_date'] = $start; + + $end = $this->main->standardize_format($sf['end']); + $_REQUEST['mec_maximum_date'] = $end; + $this->maximum_date = $end; + + $skins = $this->main->get_skins(); + foreach($skins as $skin=>$label) + { + $atts['sk-options'][$skin]['start_date_type'] = 'date'; + $atts['sk-options'][$skin]['start_date'] = $start; + } + + $atts['date-range-start'] = $start; + $atts['date-range-end'] = $end; + } + } + + return apply_filters('add_to_search_box_query', $atts, $sf); + } + + /** + * Get Locations ID + * @param string $address + * @return array + */ + public function get_locations_id($address = '') + { + if(!trim($address)) return []; + + $address = str_replace(' ', ',', $address); + $locations = explode(',', $address); + $query = "SELECT `term_id` FROM `#__termmeta` WHERE `meta_key` = 'address'"; + + foreach($locations as $location) if(trim($location)) $query .= " AND `meta_value` LIKE '%" . trim($location) . "%'"; + + $locations_id = $this->db->select($query, 'loadAssocList'); + return array_map(function($value) + { + return intval($value['term_id']); + }, $locations_id); + } + + public function sort_day_events($a, $b) + { + if(isset($a->date['start']['timestamp'], $b->date['start']['timestamp'])) + { + $a_timestamp = $a->date['start']['timestamp']; + $b_timestamp = $b->date['start']['timestamp']; + } + else + { + $a_start_date = $a->date['start']['date']; + $b_start_date = $b->date['start']['date']; + + $a_timestamp = strtotime($a_start_date.' '.$a->data->time['start_raw']); + $b_timestamp = strtotime($b_start_date.' '.$b->data->time['start_raw']); + } + + if($a_timestamp == $b_timestamp) return 0; + + if($this->order_method === 'DESC') return ($a_timestamp < $b_timestamp) ? +1 : -1; + else return ($a_timestamp > $b_timestamp) ? +1 : -1; + } + + public function sort_dates($a, $b) + { + $a_timestamp = strtotime($a); + $b_timestamp = strtotime($b); + + if($a_timestamp == $b_timestamp) return 0; + return ($a_timestamp > $b_timestamp) ? +1 : -1; + } + + public function booking_button($event, $type = 'button') + { + if(!$this->booking_button) return ''; + if(!$this->main->can_show_booking_module($event)) return ''; + if($this->main->is_sold($event, $event->data->time['start_timestamp']) and isset($this->settings['single_date_method']) and $this->settings['single_date_method'] !== 'referred') return ''; + + $link = $this->main->get_event_date_permalink($event, $event->date['start']['date']); + $link = $this->main->add_qs_var('method', 'mec-booking-modal', $link); + + $modal = 'data-featherlight="iframe" data-featherlight-iframe-height="450" data-featherlight-iframe-width="700"'; + $title = $this->main->m('booking_button', esc_html__('Book Event', 'modern-events-calendar-lite')); + + $booking_options = (isset($event->data, $event->data->meta, $event->data->meta['mec_booking'], $event->data->meta['mec_booking']) and is_array($event->data->meta['mec_booking'])) ? $event->data->meta['mec_booking'] : []; + $booking_button_label = (isset($booking_options['bookings_booking_button_label']) and trim($booking_options['bookings_booking_button_label'])) ? $booking_options['bookings_booking_button_label'] : ''; + + if(trim($booking_button_label)) $title = $booking_button_label; + + if($type === 'button') return ''.esc_html($title).''; + else return ''; + } + + public function display_custom_data($event) + { + $output = ''; + + $status = isset($this->skin_options['custom_data']) && $this->skin_options['custom_data']; + if($status and is_object($event)) + { + $single = new MEC_skin_single(); + + ob_start(); + $single->display_data_fields($event, false, true); + $output .= ob_get_clean(); + } + + return $output; + } + + public function display_detailed_time($event) + { + // Event Date + $date = ($event->date ?? array()); + + $to = $date['end']['date']; + $from = $this->main->get_start_of_multiple_days($event->ID, $to); + + $start_time = NULL; + if(isset($date['start']['hour'])) + { + $s_hour = $date['start']['hour']; + if(strtoupper($date['start']['ampm']) == 'AM' and $s_hour == '0') $s_hour = 12; + + $start_time = sprintf("%02d", $s_hour).':'; + $start_time .= sprintf("%02d", $date['start']['minutes']); + $start_time .= ' '.trim($date['start']['ampm']); + } + elseif(isset($event->data->time) and is_array($event->data->time) and isset($event->data->time['start_timestamp'])) $start_time = date('H:i', $event->data->time['start_timestamp']); + + $end_time = NULL; + if(isset($date['end']['hour'])) + { + $e_hour = $date['end']['hour']; + if(strtoupper($date['end']['ampm']) == 'AM' and $e_hour == '0') $e_hour = 12; + + $end_time = sprintf("%02d", $e_hour).':'; + $end_time .= sprintf("%02d", $date['end']['minutes']); + $end_time .= ' '.trim($date['end']['ampm']); + } + elseif(isset($event->data->time) and is_array($event->data->time) and isset($event->data->time['end_timestamp'])) $end_time = date('H:i', $event->data->time['end_timestamp']); + + $date_format = get_option('date_format'); + $time_format = get_option('time_format'); + + $output = '
    '; + $output .= '
    '.sprintf(esc_html__('Start from: %s - %s', 'modern-events-calendar-lite'), date_i18n($date_format, strtotime($from)), date_i18n($time_format, strtotime($from.' '.$start_time))).'
    '; + $output .= '
    '.sprintf(esc_html__('End at: %s - %s', 'modern-events-calendar-lite'), date_i18n($date_format, strtotime($to)), date_i18n($time_format, strtotime($to.' '.$end_time))).'
    '; + $output .= '
    '; + + return $output; + } + + public function display_categories($event) + { + $output = ''; + + $status = isset($this->skin_options['display_categories']) && $this->skin_options['display_categories']; + if($status and is_object($event) and isset($event->data->categories) and count($event->data->categories)) + { + foreach($event->data->categories as $category) + { + if(isset($category['name']) and trim($category['name'])) + { + $color = ((isset($category['color']) and trim($category['color'])) ? $category['color'] : ''); + + $color_html = ''; + if($color) $color_html .= ' '; + + $output .= '
  • ' . trim($category['name']) . $color_html .'
  • '; + } + } + } + + return $output ? '
    '.$this->icons->display('folder').'
      ' . $output . '
    ' : $output; + } + + public function display_organizers($event) + { + $output = ''; + + $status = isset($this->skin_options['display_organizer']) && $this->skin_options['display_organizer'] && (!isset($this->settings['organizers_status']) || $this->settings['organizers_status']); + if($status and is_object($event) and isset($event->data->organizers) and count($event->data->organizers)) + { + $organizers = []; + + // Occurrence + $occurrence = isset($event->date, $event->date['start'], $event->date['start']['timestamp']) ? $event->date['start']['timestamp'] : NULL; + + // Main Organizer + if(isset($event->data, $event->data->meta, $event->data->meta['mec_organizer_id']) and $event->data->meta['mec_organizer_id'] > 1) + { + $organizers[] = $occurrence + ? MEC_feature_occurrences::param($event->ID, $occurrence, 'organizer_id', $event->data->meta['mec_organizer_id']) + : $event->data->meta['mec_organizer_id']; + } + + // Additional Organizers + $additional_organizers = isset($event->data->meta['mec_additional_organizer_ids']) && is_array($event->data->meta['mec_additional_organizer_ids']) && count($event->data->meta['mec_additional_organizer_ids']) ? $event->data->meta['mec_additional_organizer_ids'] : []; + $organizers = array_merge($organizers, $additional_organizers); + + // Unique + $organizers = array_unique($organizers); + + foreach($organizers as $organizer_id) + { + $term = get_term($organizer_id, 'mec_organizer'); + if(!isset($term->term_id)) continue; + + $url = get_term_meta($organizer_id, 'url', true); + $name = $term->name; + + $organizer_url = !empty($url) ? 'href="'. esc_url($url) .'" target="_blank"' : ''; + if(trim($name)) + { + $name_url = trim($organizer_url) ? '' . esc_html(trim($name)) . '' : '' . esc_html(trim($name)) . ''; + $output .= '
  • '.$name_url.'
  • '; + } + } + } + + return $output ? '
    '.$this->icons->display('user').'
      ' . $output . '
    ' : $output; + } + + public function display_cost($event) + { + $output = ''; + if($this->display_price) + { + $cost = $this->main->get_event_cost($event); + if($cost) + { + $output .= '
    + '.$this->icons->display('wallet').' + '.$cost.' +
    '; + } + } + + return $output; + } + + public function get_register_button_title( $event, $event_start_date ){ + + $soldout = $this->main->get_flags($event, $event_start_date); + + $can_register = (is_array($event->data->tickets) and count($event->data->tickets) and !strpos($soldout, '%%soldout%%') and !$this->booking_button and !$this->main->is_expired($event)); + + if($can_register) + { + $title = $this->main->m('register_button', esc_html__('REGISTER', 'modern-events-calendar-lite')); + } + else + { + $title = $this->main->m('view_detail', esc_html__('View Detail', 'modern-events-calendar-lite')); + } + + return $title; + } + + public function get_sed_method() + { + // SED Method + $sed_method = $this->skin_options['sed_method'] ?? '0'; + + // Fix Backend Editors Like Elementor + if(is_admin() && !wp_doing_ajax()) $sed_method = '0'; + + return $sed_method; + } + + /** + * @param $event + * @param null $title + * @param null $class + * @param null $attributes + * @return string|null + */ + public function display_link($event, $title = NULL, $class = NULL, $attributes = NULL) + { + $link_for_title = false; + + // Event Title + if(is_null($title)) + { + $title = apply_filters('mec_occurrence_event_title', $event->data->title, $event); + $link_for_title = true; + } + + // Link Class + if(is_null($class)) $class = 'mec-color-hover'; + + // Single Event Display Method + $method = $this->skin_options['sed_method'] ?? false; + + // Occurrence Type + $one_occurrence = (isset($this->atts['show_only_one_occurrence']) && $this->atts['show_only_one_occurrence']); + + // Repeat Type + $repeat_label = ''; + if($one_occurrence and $link_for_title) + { + $repeat_type = (isset($event->data) and isset($event->data->meta) and isset($event->data->meta['mec_repeat_type'])) ? $event->data->meta['mec_repeat_type'] : ''; + + // Change to switch case for translate-ability + switch ($repeat_type) { + case 'daily': + $repeat_label = ''.esc_html__('Daily' , 'modern-events-calendar-lite').''; + break; + case 'weekly': + $repeat_label = ''.esc_html__('Weekly' , 'modern-events-calendar-lite').''; + break; + case 'monthly': + $repeat_label = ''.esc_html__('Monthly' , 'modern-events-calendar-lite').''; + break; + case 'yearly': + $repeat_label = ''.esc_html__('Yearly' , 'modern-events-calendar-lite').''; + break; + case 'weekend': + $repeat_label = ''.esc_html__('Every Weekend' , 'modern-events-calendar-lite').''; + break; + case 'weekday': + $repeat_label = ''.esc_html__('Every Weekday' , 'modern-events-calendar-lite').''; + break; + case 'certain_weekdays': + case 'custom_days': + case 'advanced': + $repeat_label = ''.esc_html__('Repeating Event' , 'modern-events-calendar-lite').''; + break; + } + } + + // Link is disabled + if($method == 'no' and in_array($class, array('mec-booking-button', 'mec-detail-button', 'mec-booking-button mec-bg-color-hover mec-border-color-hover', 'mec-event-link'))) return ''; + elseif($method == 'no') return MEC_kses::form($title.$repeat_label); + else + { + $sed_method = $this->skin_options['sed_method'] ?? ''; + switch($sed_method) + { + case '0': + + $sed_method = '_self'; + break; + case 'new': + + $sed_method = '_blank'; + break; + } + + $sed_method = ($sed_method ?: '_self'); + } + + $target = (!empty($sed_method) ? 'target="'.esc_attr($sed_method).'" rel="noopener"' : ''); + $target = apply_filters('mec_event_link_change_target', $target, $event->data->ID); + + return ''.MEC_kses::form($title).''.MEC_kses::element($repeat_label); + } + + public function get_end_date() + { + $end_date_type = (isset($this->skin_options['end_date_type']) and trim($this->skin_options['end_date_type'])) ? trim($this->skin_options['end_date_type']) : 'date'; + + if($end_date_type === 'today') $maximum_date = current_time('Y-m-d'); + elseif($end_date_type === 'tomorrow') $maximum_date = date('Y-m-d', strtotime('Tomorrow')); + else $maximum_date = (isset($this->skin_options['maximum_date_range']) and trim($this->skin_options['maximum_date_range'])) ? trim($this->skin_options['maximum_date_range']) : ''; + + return $maximum_date; + } + + public function get_label_captions($event, $extra_class = null) + { + $captions = ''; + if(isset($event->data->labels) and is_array($event->data->labels) and count($event->data->labels)) + { + foreach($event->data->labels as $label) + { + if(!isset($label['style']) || !trim($label['style'])) continue; + + $captions .= ''; + if($label['style'] == 'mec-label-featured') $captions .= esc_html__($label['name'], 'modern-events-calendar-lite'); + elseif($label['style'] == 'mec-label-canceled') $captions .= esc_html__($label['name'], 'modern-events-calendar-lite'); + elseif($label['style'] == 'mec-label-custom' and isset($label['name']) and trim($label['name'])) $captions .= esc_html__($label['name'], 'modern-events-calendar-lite'); + $captions .= ''; + + break; + } + } + + return $captions; + } + + public function cache_mec_events(): bool + { + // First Validation + if(!is_array($this->unique_event_ids) || !count($this->unique_event_ids)) return false; + + // Cache + $cache = $this->getCache(); + + // Db + $db = $this->getDB(); + + // Records + $records = $db->select("SELECT * FROM `#__mec_events` WHERE `post_id` IN (".implode(',', $this->unique_event_ids).")"); + + // Cache Data + foreach($records as $record) $cache->set('mec-events-data-'.$record->post_id, $record); + + return true; + } + + /** + * @param $event + * @param bool $only_color_code + * @return string + */ + public function get_event_color_dot($event, $only_color_code = false) + { + return $this->main->get_event_color_dot($event, $only_color_code); + } + + public function display_status_bar($event) + { + if(!is_object($event)) return ''; + + // Status Bar is Disabled + if(!isset($this->skin_options['status_bar']) || !$this->skin_options['status_bar']) return ''; + + $event_id = $event->ID; + if(isset($event->requested_id)) $event_id = $event->requested_id; // Requested Event in Multilingual Websites + + $start_timestamp = $event->data->time['start_timestamp'] ?? ($event->date['start']['timestamp'] ?? strtotime($event->date['start']['date'])); + + // All Params + $params = MEC_feature_occurrences::param($event_id, $start_timestamp, '*'); + + $event_status = (isset($event->data->meta['mec_event_status']) and trim($event->data->meta['mec_event_status'])) ? $event->data->meta['mec_event_status'] : 'EventScheduled'; + $event_status = (isset($params['event_status']) and trim($params['event_status']) != '') ? $params['event_status'] : $event_status; + + $output = ''; + + // Ongoing Icon + if($this->main->is_ongoing($event)) $output .= '
  • '.$this->main->svg('mec-live-now').' '.esc_html__('Live Now', 'modern-events-calendar-lite').'
  • '; + + if($event_status === 'EventScheduled') $output .= '
  • '.$this->main->svg('ontime').' '.esc_html__('On Schedule', 'modern-events-calendar-lite').'
  • '; + elseif($event_status === 'EventRescheduled') $output .= '
  • '.$this->main->svg('ontime').' '.esc_html__('Rescheduled', 'modern-events-calendar-lite').'
  • '; + elseif($event_status === 'EventPostponed') $output .= '
  • '.$this->main->svg('delay').' '.esc_html__('Delayed', 'modern-events-calendar-lite').'
  • '; + elseif($event_status === 'EventCancelled') $output .= '
  • '.$this->main->svg('cancel').' '.esc_html__('Cancelled', 'modern-events-calendar-lite').'
  • '; + elseif($event_status === 'EventMovedOnline') $output .= '
  • '.$this->main->svg('camrecorder').' '.esc_html__('Virtual', 'modern-events-calendar-lite').'
  • '; + + return trim($output) ? '
      '.$output.'
    ' : ''; + } + + public function get_pagination_bar() + { + if($this->pagination === 'loadmore' and $this->found >= $this->limit) + { + return '
    +
    '.esc_html__('Load More', 'modern-events-calendar-lite').'
    +
    '; + } + + if($this->pagination === 'scroll' and $this->found >= $this->limit) + { + return '
    '; + } + + if($this->pagination === 'nextprev' and $this->found >= $this->limit) + { + $offset = $this->end_date.':'.$this->next_offset; + + return '
    + + + '.esc_html__('Prev', 'modern-events-calendar-lite').' + + + '.esc_html__('Next', 'modern-events-calendar-lite').' + + +
    '; + } + + return ''; + } + + /** + * Display Powered By MEC URL + * + * @return string + */ + public function display_credit_url() + { + $status = (isset($this->settings['display_credit_url']) && $this->settings['display_credit_url']); + + // Disabled + if(!$status) return ''; + + // Powered By Feature + return '
    '.sprintf(esc_html__('Powered by %s', 'modern-events-calendar-lite'), 'Modern Events Calendar').'
    '; + } + + /** + * Subscribe + To Calendar + * + * @return string + */ + public function subscribe_to_calendar() + { + if($this->from_full_calendar) return ''; + + $ical_status = isset($this->settings['ical_feed']) && $this->settings['ical_feed']; + if(!$ical_status) return ''; + + $status = isset($this->settings['ical_feed_subscribe_to_calendar']) && $this->settings['ical_feed_subscribe_to_calendar']; + if(!$status) return ''; + + $base_url = trim($this->main->URL(), '/ '); + + $webcal_base_url = str_replace(['http://', 'https://'], 'webcal://', $base_url); + $webcal_feed_url = $webcal_base_url . '/?mec-ical-feed=1'; + + $feed_url = $base_url . '/?mec-ical-feed=1'; + $outlook = 'owa?path=/calendar/action/compose&rru=addsubscription&url=' . $feed_url . '&name=' . get_bloginfo('name') . ' ' . get_the_title($this->id); + + return ''; + } +} diff --git a/app/libraries/syncSchedule.php b/app/libraries/syncSchedule.php new file mode 100755 index 0000000..4ca18b4 --- /dev/null +++ b/app/libraries/syncSchedule.php @@ -0,0 +1,43 @@ + + */ +class MEC_syncSchedule extends MEC_base +{ + private $main; + + public function __construct() + { + $this->main = $this->getMain(); + } + + public function sync() + { + $ix = $this->main->get_ix_options(); + + // To run crons by force + $internal_cron_system = true; + + if(isset($ix['sync_g_import_auto']) and $ix['sync_g_import_auto'] == '1') + { + $sync_g_import = MEC_ABSPATH.'app'.DS.'crons'.DS.'g-import.php'; + if(file_exists($sync_g_import)) include_once $sync_g_import; + } + + if(isset($ix['sync_g_export_auto']) and $ix['sync_g_export_auto'] == '1') + { + $sync_g_export = MEC_ABSPATH.'app'.DS.'crons'.DS.'g-export.php'; + if(file_exists($sync_g_export)) include_once $sync_g_export; + } + + if(isset($ix['sync_meetup_import_auto']) and $ix['sync_meetup_import_auto'] == '1') + { + $sync_meetup_import = MEC_ABSPATH.'app'.DS.'crons'.DS.'meetup-import.php'; + if(file_exists($sync_meetup_import)) include_once $sync_meetup_import; + } + } +} \ No newline at end of file diff --git a/app/libraries/ticketVariations.php b/app/libraries/ticketVariations.php new file mode 100755 index 0000000..cc7db3d --- /dev/null +++ b/app/libraries/ticketVariations.php @@ -0,0 +1,86 @@ + + */ +class MEC_ticketVariations extends MEC_base +{ + /** + * @var MEC_main + */ + public $main; + public $settings; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Main + $this->main = $this->getMain(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + } + + public function item($args) + { + $name_prefix = $args['name_prefix'] ?? 'mec[ticket_variations]'; + $id_prefix = $args['id_prefix'] ?? 'ticket_variation'; + $ticket_variation = $args['value'] ?? []; + $i = $args['i'] ?? ':i:'; + ?> +
    +
    + +
    +
    + + + +
    +
    +
    +

    + + +

    +
    +
    + +
    +
    + + + +
    +
    +
    +

    + + +

    +
    +
    + +
    +
    + +
    +
    +
    +
    +
      +
    • %%ticket_variations__title%%
    • +
    • %%ticket_variations__count%%
    • +
    +
    +
    +
    + + */ +class MEC_tickets extends MEC_base +{ + /** + * @var MEC_main + */ + public $main; + public $settings; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // Import MEC Main + $this->main = $this->getMain(); + + // MEC Settings + $this->settings = $this->main->get_settings(); + } + + public function builder($args) + { + $object_id = $args['object_id'] ?? null; + $tickets = $args['tickets'] ?? []; + $name_prefix = $args['name_prefix'] ?? 'mec[tickets]'; + $basic_class = $args['basic_class'] ?? 'mec-basvanced-basic'; + $advanced_class = $args['advanced_class'] ?? 'mec-basvanced-advanced w-hidden'; + $price_per_date_display = $args['perice_per_date_display'] ?? true; + + // MEC Main + $main = $this->getMain(); + + // Settings + $settings = $main->get_settings(); + + // This date format used for datepicker + $datepicker_format = (isset($settings['datepicker_format']) and trim($settings['datepicker_format'])) ? $settings['datepicker_format'] : 'Y-m-d'; + + // Private Description + $private_description_status = (!isset($settings['booking_private_description']) || $settings['booking_private_description']); + if(is_admin()) $private_description_status = true; + + // Variations Per Ticket + $variations_per_ticket_status = isset($settings['ticket_variations_per_ticket']) && $settings['ticket_variations_per_ticket']; + if(isset($settings['ticket_variations_status']) and !$settings['ticket_variations_status']) $variations_per_ticket_status = false; + + // Ticket Availability Date + $availability_dates_status = isset($settings['booking_ticket_availability_dates']) && $settings['booking_ticket_availability_dates']; + + // Ticket Times Status + $ticket_times_status = !((isset($settings['disable_ticket_times']) and $settings['disable_ticket_times'])); + + // Family Tickets Status + $family_ticket_status = isset($settings['booking_family_ticket']) && $settings['booking_family_ticket']; + ?> +
    +
    + +
    +
    + $ticket) + { + if(!is_numeric($key)) continue; + $i = max($i, $key); + ?> +
    + +
    :
    +
    + +
    + +
    + +
    + + +
    +
    + + timepicker(array( + 'method' => ($settings['time_format'] ?? 12), + 'time_hour' => ($ticket['ticket_start_time_hour'] ?? 8), + 'time_minutes' => ($ticket['ticket_start_time_minute'] ?? 0), + 'time_ampm' => ($ticket['ticket_start_time_ampm'] ?? 'AM'), + 'name' => $name_prefix.'['.esc_attr($key).']', + 'hour_key' => 'ticket_start_time_hour', + 'minutes_key' => 'ticket_start_time_minute', + 'ampm_key' => 'ticket_start_time_ampm', + 'include_h0' => true, + )); ?> +
    +
    + + timepicker(array( + 'method' => ($settings['time_format'] ?? 12), + 'time_hour' => ($ticket['ticket_end_time_hour'] ?? 6), + 'time_minutes' => ($ticket['ticket_end_time_minute'] ?? 0), + 'time_ampm' => ($ticket['ticket_end_time_ampm'] ?? 'PM'), + 'name' => $name_prefix.'['.esc_attr($key).']', + 'hour_key' => 'ticket_end_time_hour', + 'minutes_key' => 'ticket_end_time_minute', + 'ampm_key' => 'ticket_end_time_ampm', + )); ?> +
    +
    + + +
    + +
    + +
    + + +
    +
    +

    +
    + +
    +
    + +
    + + + +
    +
    +

    +

    +
    + +
    +
    + + + +
    +
    +

    +

    +
    + +
    +
    +
    +
    +
    + + + + + +
    +
    +
    +

    +
    +
    + +
    + + + +
    +
    +
    +
    + + +
    +
    +
    +

    +
    +
    + +
    +
    +
    + + +
    +
    +
    +

    +
    +
    + +
    +
    +
    +
    + + + + ', + '', + ob_get_clean(), + '', + '' + ); ?> +
    +
    + +
    + +
    +
    +
    + +
    +
    + + $price_date) : + if (!is_numeric($p)) { + continue; + } + $j = max($j, $p); + ?> +
    +
    + + + + + +
    +
    + + +
    + +
    +
    +
    + + + + + +
    +
    +
    +
    + + + + getTicketVariations(); + ?> +
    +
    +

    +
    +
    + +
    +
    +
    + +
    +
    + $ticket_variation) + { + if(!is_numeric($tvk)) continue; + + $tvi = max($tvi, $tvk); + $TicketVariations->item(array( + 'name_prefix' => $name_prefix.'['.esc_attr($key).'][variations]', + 'id_prefix' => 'variation_per_ticket'.esc_attr($key), + 'i' => $tvi, + 'value' => $ticket_variation, + )); + } + ?> +
    +
    +
    +
    + item(array( + 'name_prefix' => $name_prefix.'['.esc_attr($key).'][variations]', + 'id_prefix' => 'variation_per_ticket'.esc_attr($key), + 'i' => ':v:', + 'value' => array(), + )); + ?> +
    +
    +
    + + + + +
    +
    +
    +


    +

    +
    + + +
    +
    +
    + + +
    + +
    + +
    + +
    +
    + +
    : :i:
    +
    + +
    +
    + +
    + +
    +
    + + timepicker(array( + 'method' => ($settings['time_format'] ?? 12), + 'time_hour' => 8, + 'time_minutes' => 0, + 'time_ampm' => 'AM', + 'name' => $name_prefix.'[:i:]', + 'hour_key' => 'ticket_start_time_hour', + 'minutes_key' => 'ticket_start_time_minute', + 'ampm_key' => 'ticket_start_time_ampm', + 'include_h0' => true, + )); ?> +
    +
    + + timepicker(array( + 'method' => ($settings['time_format'] ?? 12), + 'time_hour' => 6, + 'time_minutes' => 0, + 'time_ampm' => 'PM', + 'name' => $name_prefix.'[:i:]', + 'hour_key' => 'ticket_end_time_hour', + 'minutes_key' => 'ticket_end_time_minute', + 'ampm_key' => 'ticket_end_time_ampm', + )); ?> +
    +
    + +
    + +
    + +
    + + +
    +
    +

    +
    + +
    +
    + +
    + + + +
    +
    +

    +

    +
    + +
    +
    + + + +
    +
    +

    +

    +
    + +
    +
    +
    +
    +
    + + + + + +
    +
    +
    +

    +
    +
    + +
    + + + +
    +
    +
    +
    + + +
    +
    +
    +

    +
    +
    + +
    +
    +
    + + +
    +
    +
    +

    +
    +
    + +
    +
    +
    +
    + + + + ', + '', + ob_get_clean(), + '', + '' + ); ?> +
    +
    + +
    + +
    +
    +

    + +
    +
    +
    + +
    +
    +
    + + + + + +
    +
    +
    +
    + + + + getTicketVariations(); + ?> +
    +
    +

    +
    +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    + item(array( + 'name_prefix' => $name_prefix.'[:i:][variations]', + 'id_prefix' => 'variation_per_ticket:i:', + 'i' => ':v:', + 'value' => array(), + )); + ?> +
    +
    +
    + + + +
    +
    +
    +


    +

    +
    + + +
    +
    +
    + + +
    +
    + + */ +class MEC_transaction extends MEC_base +{ + public $transaction_id; + public $transaction; + public $settings; + public $ml_settings; + + /** + * @var MEC_book + */ + private $book; + + /** + * @var MEC_Main + */ + private $main; + + /** + * Constructor method + * @author Webnus + * @param $transaction_id + */ + public function __construct($transaction_id) + { + $this->main = $this->getMain(); + $this->transaction_id = $transaction_id; + $this->settings = $this->main->get_settings(); + $this->ml_settings = $this->main->get_ml_settings(); + + $this->book = $this->getBook(); + $this->transaction = $this->book->get_transaction($transaction_id); + } + + public function get_total() + { + return $this->transaction['total'] ?? NULL; + } + + public function get_discount() + { + return $this->transaction['discount'] ?? NULL; + } + + public function get_price() + { + return $this->transaction['price'] ?? 0; + } + + public function get_payable() + { + return $this->transaction['payable'] ?? 0; + } + + public function get_price_html() + { + $total = $this->get_total(); + $payable = $this->get_payable(); + + if($total == $payable) return ''.esc_html($this->render_price($payable)).''; + else return ''.esc_html($this->render_price($total)).'
    '.esc_html($this->render_price($payable)).'
    '; + } + + public function render_price($amount) + { + return $this->main->render_price($amount, $this->get_event_id()); + } + + public function is_free() + { + return !$this->get_payable(); + } + + public function get_event_id() + { + return $this->transaction['event_id'] ?? 0; + } + + public function get_array() + { + return $this->transaction; + } + + /** + * @return WP_Post + */ + public function get_event() + { + return get_post($this->get_event_id()); + } + + public function get_event_link() + { + $event = $this->get_event(); + return ''.MEC_kses::element($event->post_title).''; + } + + public function get_event_featured_image() + { + $event = $this->get_event(); + return get_the_post_thumbnail($event); + } + + public function get_tickets() + { + $tickets = ((isset($this->transaction['tickets']) and is_array($this->transaction['tickets'])) ? $this->transaction['tickets'] : array()); + + // Remove Useless Key + if(isset($tickets['attachments'])) unset($tickets['attachments']); + + return $tickets; + } + + public function get_event_tickets() + { + $tickets = get_post_meta($this->get_event_id(), 'mec_tickets', true); + if(!is_array($tickets)) $tickets = []; + + return $tickets; + } + + public function get_tickets_html() + { + $html = '
      '; + $event_tickets = $this->get_event_tickets(); + + $tickets = $this->get_tickets(); + $rendered = []; + + foreach($tickets as $t) + { + $ticket_id = $t['id']; + + $ticket = $event_tickets[$ticket_id] ?? []; + $count = $t['count']; + + if(!isset($rendered[$ticket_id])) $rendered[$ticket_id] = ['count' => 0, 'names' => []]; + + $rendered[$ticket_id]['name'] = $ticket['name']; + $rendered[$ticket_id]['count'] += $count; + $rendered[$ticket_id]['names'][] = $t['name']; + } + + foreach($rendered as $ticket_id => $row) + { + $names = array_unique($row['names']); + + $names_html = ''; + foreach($names as $name) $names_html .= '
      '.esc_html(stripslashes($name)).'
      '; + + $html .= '
    • '.esc_html(stripslashes($row['name'])).($row['count'] > 1 ? esc_html(' ('.$row['count'].')') : '').'
      '.$names_html.'
    • '; + } + + $html .= '
    '; + return $html; + } + + public function get_dates() + { + $all_dates = (isset($this->transaction['all_dates']) and is_array($this->transaction['all_dates'])) ? $this->transaction['all_dates'] : []; + $date = $this->transaction['date'] ?? NULL; + + return (count($all_dates) ? $all_dates : array($date)); + } + + public function get_dates_html() + { + $html = '
      '; + + $date_format = (isset($this->ml_settings['booking_date_format1']) and trim($this->ml_settings['booking_date_format1'])) ? $this->ml_settings['booking_date_format1'] : get_option('date_format'); + $time_format = get_option('time_format'); + + $timestamps = $this->get_dates(); + foreach($timestamps as $timestamp) + { + if(!$timestamp) continue; + $times = explode(':', $timestamp); + + $html .= '
    • '.sprintf(esc_html__('%s to %s', 'modern-events-calendar-lite'), $this->main->date_i18n($date_format.' '.$time_format, $times[0]), $this->main->date_i18n($date_format.' '.$time_format, $times[1])).'
    • '; + } + + $html .= '
    '; + return $html; + } + + public function get_coupon() + { + return $this->transaction['coupon'] ?? NULL; + } + + public function get_price_details() + { + return (isset($this->transaction['price_details']) and is_array($this->transaction['price_details'])) ? $this->transaction['price_details'] : []; + } + + public function get_price_details_html() + { + $price_details = $this->get_price_details(); + + $html = '
      '; + foreach($price_details['details'] as $detail) + { + $html .= '
    • + '.esc_html($detail['description']).' + '.MEC_kses::element($this->main->render_price($detail['amount'], $this->get_event_id())).' +
    • '; + } + + $html .= '
    '; + return $html; + } +} \ No newline at end of file diff --git a/app/libraries/user.php b/app/libraries/user.php new file mode 100755 index 0000000..76f9c64 --- /dev/null +++ b/app/libraries/user.php @@ -0,0 +1,249 @@ + + */ +class MEC_user extends MEC_base +{ + /** + * @var MEC_main + */ + public $main; + + /** + * @var MEC_db + */ + public $db; + + /** + * @var array + */ + public $settings; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // MEC Main library + $this->main = $this->getMain(); + + // MEC DB Library + $this->db = $this->getDB(); + + // MEC settings + $this->settings = $this->main->get_settings(); + } + + public function register($attendee, $args) + { + $name = $attendee['name'] ?? ''; + $raw = (isset($attendee['reg']) and is_array($attendee['reg'])) ? $attendee['reg'] : []; + + $email = $attendee['email'] ?? ''; + if(!filter_var($email, FILTER_VALIDATE_EMAIL)) return false; + + $reg = []; + foreach($raw as $k => $v) $reg[$k] = (is_array($v) ? $v : stripslashes($v)); + + $existed_user_id = $this->main->email_exists($email); + + // User already exist + if($existed_user_id !== false) + { + // Map Data + $event_id = $args['event_id'] ?? 0; + if($event_id) $this->save_mapped_data($event_id, $existed_user_id, $reg); + + return $existed_user_id; + } + + // Update WordPress user first name and last name + if(strpos($name, ',') !== false) $ex = explode(',', $name); + else $ex = explode(' ', $name); + + $first_name = $ex[0] ?? ''; + $last_name = ''; + + if(isset($ex[1])) + { + unset($ex[0]); + $last_name = implode(' ', $ex); + } + + // Register in MEC + $MEC_method = isset($args['register_in_mec']) && $args['register_in_mec']; + + // Registration is disabled + if($MEC_method || (isset($this->settings['booking_registration']) && !$this->settings['booking_registration'])) + { + $existed_user_id = $this->db->select("SELECT `id` FROM `#__mec_users` WHERE `email`='".$this->db->escape($email)."'", 'loadResult'); + + // User already exist + if($existed_user_id) return $existed_user_id; + + $now = date('Y-m-d H:i:s'); + $user_id = (int) $this->db->q("INSERT INTO `#__mec_users` (`first_name`,`last_name`,`email`,`reg`,`created_at`,`updated_at`) VALUES ('".$this->db->escape($first_name)."','".$this->db->escape($last_name)."','".$this->db->escape($email)."','".$this->db->escape(json_encode($reg))."','".$now."','".$now."')", "INSERT"); + + // Make sure we won't create MEC users with id lower than 1 million + // To avoid conflicts with wp users of course + if($user_id < 1000000) + { + $new_id = $user_id + 1000000; + $this->db->q("UPDATE `#__mec_users` SET `id`='".esc_sql($new_id)."' WHERE `id`='".esc_sql($user_id)."'"); + + $user_id = $new_id; + } + } + else + { + $username = $email; + $password = wp_generate_password(12, true, true); + $auto = true; + + if(isset($args['username']) and trim($args['username'])) $username = $args['username']; + if(isset($args['password']) and trim($args['password'])) + { + $password = $args['password']; + $auto = false; + } + + if ( ! validate_username( $username ) ) { + $username = 'user-' . mt_rand( 100000000, 999999999999 ); + while( username_exists( $username ) ) { + $username = 'user-' . mt_rand( 100000000, 999999999999 ); + } + } + + $user_id = $this->main->register_user($username, $email, $password, $auto); + + $user = new stdClass(); + $user->ID = $user_id; + $user->first_name = $first_name; + $user->last_name = $last_name; + + wp_update_user($user); + update_user_meta($user_id, 'mec_name', $name); + update_user_meta($user_id, 'mec_reg', $reg); + update_user_meta($user_id, 'nickname', $name); + + // Map Data + $event_id = $args['event_id'] ?? 0; + if($event_id) $this->save_mapped_data($event_id, $user_id, $reg); + + // Set the User Role + $role = (isset($this->settings['booking_user_role']) and trim($this->settings['booking_user_role'])) ? $this->settings['booking_user_role'] : 'subscriber'; + + $wpuser = new WP_User($user_id); + $wpuser->set_role($role); + } + + return $user_id; + } + + public function save_mapped_data($event_id, $user_id, $reg) + { + $reg_fields = $this->main->get_reg_fields($event_id); + + foreach($reg as $reg_id => $reg_value) + { + $reg_field = $reg_fields[$reg_id] ?? []; + if(isset($reg_field['mapping']) and trim($reg_field['mapping'])) + { + $reg_value = maybe_unserialize($reg_value); + $meta_value = is_array($reg_value) ? implode(',', $reg_value) : $reg_value; + + update_user_meta($user_id, $reg_field['mapping'], $meta_value); + } + } + } + + public function assign($booking_id, $user_id) + { + // Registration is disabled + if(isset($this->settings['booking_registration']) and !$this->settings['booking_registration'] and !get_user_by('ID', $user_id)) update_post_meta($booking_id, 'mec_user_id', $user_id); + else update_post_meta($booking_id, 'mec_user_id', 'wp'); + } + + public function get($id) + { + // Registration is disabled + if(isset($this->settings['booking_registration']) and !$this->settings['booking_registration']) + { + $user = $this->mec($id); + if(!$user) $user = $this->wp($id); + } + else + { + $user = $this->wp($id); + if(!$user) $user = $this->mec($id); + } + + return $user; + } + + public function mec($id) + { + $data = $this->db->select("SELECT * FROM `#__mec_users` WHERE `id`=".((int) $id), 'loadObject'); + if(!$data) return NULL; + + $user = new stdClass(); + $user->ID = $data->id; + $user->first_name = stripslashes($data->first_name); + $user->last_name = stripslashes($data->last_name); + $user->display_name = trim(stripslashes($data->first_name).' '.stripslashes($data->last_name)); + $user->email = $data->email; + $user->user_email = $data->email; + $user->user_registered = $data->created_at; + $user->data = $user; + + return $user; + } + + public function wp($id) + { + return get_userdata($id); + } + + public function booking($id) + { + $mec_user_id = get_post_meta($id, 'mec_user_id', true); + if(trim($mec_user_id) and is_numeric($mec_user_id)) return $this->mec($mec_user_id); + + return $this->wp(get_post($id)->post_author); + } + + public function by_email($email) + { + return $this->get($this->id('email', $email)); + } + + public function id($field, $value) + { + $id = NULL; + + // Registration is disabled + if(isset($this->settings['booking_registration']) and !$this->settings['booking_registration']) + { + $id = $this->db->select("SELECT `id` FROM `#__mec_users` WHERE `".$field."`='".$this->db->escape($value)."'", 'loadResult'); + if(!$id) + { + $user = get_user_by($field, $value); + if(isset($user->ID)) $id = $user->ID; + } + } + else + { + $user = get_user_by($field, $value); + if(isset($user->ID)) $id = $user->ID; + + if(!$id) $id = $this->db->select("SELECT `id` FROM `#__mec_users` WHERE `".$field."`='".$this->db->escape($value)."'", 'loadResult'); + } + + return $id; + } +} \ No newline at end of file diff --git a/app/libraries/walker.php b/app/libraries/walker.php new file mode 100755 index 0000000..a1bc1a8 --- /dev/null +++ b/app/libraries/walker.php @@ -0,0 +1,166 @@ + + */ +class MEC_walker extends Walker +{ + public $tree_type = 'category'; + public $db_fields = [ + 'parent' => 'parent', + 'id' => 'term_id', + ]; + + public $mec_id = []; + public $mec_include = []; + public $mec_exclude = []; + + /** + * Constructor method + * @param array $params + * @author Webnus + */ + public function __construct($params = []) + { + $this->mec_id = $params['id'] ?? ''; + $this->mec_include = $params['include'] ?? []; + $this->mec_exclude = $params['exclude'] ?? []; + } + + /** + * Starts the list before the elements are added. + * + * @see Walker:start_lvl() + * + * @since 2.5.1 + * + * @param string $output Used to append additional content (passed by reference). + * @param int $depth Depth of category. Used for tab indentation. + * @param array $args An array of arguments. @see wp_terms_checklist() + */ + public function start_lvl(&$output, $depth = 0, $args = array()) + { + $indent = str_repeat("\t", $depth); + $output .= "$indent
      \n"; + } + + /** + * Ends the list of after the elements are added. + * + * @see Walker::end_lvl() + * + * @since 2.5.1 + * + * @param string $output Used to append additional content (passed by reference). + * @param int $depth Depth of category. Used for tab indentation. + * @param array $args An array of arguments. @see wp_terms_checklist() + */ + public function end_lvl(&$output, $depth = 0, $args = array()) + { + $indent = str_repeat("\t", $depth); + $output .= "$indent
    \n"; + } + + /** + * Start the element output. + * + * @see Walker::start_el() + * + * @since 2.5.1 + * + * @param string $output Used to append additional content (passed by reference). + * @param WP_Term $data_object The current term object. + * @param int $depth Depth of the term in reference to parents. Default 0. + * @param array $args An array of arguments. @see wp_terms_checklist() + * @param int $current_object_id ID of the current term. + */ + public function start_el(&$output, $data_object, $depth = 0, $args = array(), $current_object_id = 0) + { + // Term is not Included + if(is_array($this->mec_include) and count($this->mec_include) and !in_array($data_object->term_id, $this->mec_include)) return; + + // Term is Excluded + if(is_array($this->mec_exclude) and count($this->mec_exclude) and in_array($data_object->term_id, $this->mec_exclude)) return; + + if(empty($args['taxonomy'])) $taxonomy = 'category'; + else $taxonomy = $args['taxonomy']; + + $args['popular_cats'] = !empty($args['popular_cats']) ? array_map('intval', $args['popular_cats']) : []; + $class = in_array($data_object->term_id, $args['popular_cats'], true) ? ' class="popular-category"' : ''; + $args['selected_cats'] = !empty($args['selected_cats']) ? array_map('intval', $args['selected_cats']) : []; + + $is_selected = in_array($data_object->term_id, $args['selected_cats'], true); + $selected = selected( $is_selected, true, false ); + + $output .= "\n'; + } + + /** + * Ends the element output, if needed. + * + * @param string $output Used to append additional content (passed by reference). + * @param WP_Term $data_object The current term object. + * @param int $depth Depth of the term in reference to parents. Default 0. + * @param array $args An array of arguments. + * @see Walker::end_el() + * + * @since 2.5.1 + * + * @see wp_terms_checklist() + */ + public function end_el(&$output, $data_object, $depth = 0, $args = array()) + { + $output .= ""; + } + + /** + * @param WP_Term $element + * @param $children_elements + * @param $max_depth + * @param $depth + * @param $args + * @param $output + * @return void + */ + public function display_element( $element, &$children_elements, $max_depth, $depth, $args, &$output ) + { + if (!$element) { + return; + } + + $id_field = $this->db_fields['id']; + $id = $element->$id_field; + + // Display this element. + $this->has_children = ! empty( $children_elements[ $id ] ); + if ( isset( $args[0] ) && is_array( $args[0] ) ) { + $args[0]['has_children'] = $this->has_children; // Back-compat. + } + + $this->start_el( $output, $element, $depth, ...array_values( $args ) ); + + // End this element. + $this->end_el( $output, $element, $depth, ...array_values( $args ) ); + } + + public function walk( $elements, $max_depth, ...$args ) + { + $output = ''; + return $output; + } +} \ No newline at end of file diff --git a/app/libraries/wc.php b/app/libraries/wc.php new file mode 100755 index 0000000..0667e65 --- /dev/null +++ b/app/libraries/wc.php @@ -0,0 +1,549 @@ + + */ +class MEC_wc extends MEC_base +{ + public $ticket_names = []; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + } + + /** + * @throws WC_Data_Exception + * @throws Exception + */ + public function cart($event_id, $date, $other_dates, $tickets, $transaction_id = NULL) + { + $translated_event_id = (isset($_REQUEST['translated_event_id']) ? sanitize_text_field($_REQUEST['translated_event_id']) : 0); + if(!trim($translated_event_id)) $translated_event_id = $event_id; + + $dates = array($date); + if(is_array($other_dates) and count($other_dates)) $dates = array_merge($dates, $other_dates); + + $db = $this->getDB(); + + // Added to cart after ticket selection + if(!$transaction_id) + { + foreach($tickets as $ticket_id => $count) + { + if(trim($ticket_id) == '') continue; + + $ticket_key = $translated_event_id.':'.$ticket_id; + + // Get Product ID + $product_id = $db->select("SELECT `post_id` FROM `#__postmeta` WHERE `meta_key`='mec_ticket' AND `meta_value`='".$ticket_key."'", 'loadResult'); + + // Create Product if Doesn't Exist + if(!$product_id) $product_id = $this->create($translated_event_id, $ticket_id); + // Update Existing Product + else $this->update($product_id, $translated_event_id, $ticket_id); + + // Add to Cart + WC()->cart->add_to_cart($product_id, ($count * max(1, count($dates))), 0, array(), array( + 'mec_event_id' => $event_id, + 'mec_date' => $date, + 'mec_other_dates' => $other_dates, + )); + + // Add to Ticket Names + $this->ticket_names[] = $this->get_ticket_name($product_id); + } + } + // Added to cart after MEC booking form + else + { + foreach($tickets as $info) + { + $ticket_id = $info['id'] ?? ''; + if(trim($ticket_id) == '') continue; + + $ticket_key = $translated_event_id.':'.$ticket_id; + + // Get Product ID + $product_id = $db->select("SELECT `post_id` FROM `#__postmeta` WHERE `meta_key`='mec_ticket' AND `meta_value`='".$ticket_key."'", 'loadResult'); + + // Create Product if Doesn't Exist + if(!$product_id) $product_id = $this->create($translated_event_id, $ticket_id); + // Update Existing Product + else $this->update($product_id, $translated_event_id, $ticket_id); + + // Ticket Count + $count = $info['count'] ?? 1; + + // Add to Cart + WC()->cart->add_to_cart($product_id, ($count * max(1, count($dates))), 0, array(), array( + 'mec_event_id' => $event_id, + 'mec_date' => $date, + 'mec_other_dates' => $other_dates, + 'mec_transaction_id' => $transaction_id, + )); + + // Add to Ticket Names + $this->ticket_names[] = $this->get_ticket_name($product_id); + } + } + + return $this; + } + + public function next() + { + // Main + $main = $this->getMain(); + + // MEC Settings + $settings = $main->get_settings(); + + // Checkout URL + if(isset($settings['wc_after_add']) and $settings['wc_after_add'] == 'checkout') return array('type' => 'url', 'url' => wc_get_checkout_url()); + // Optional Checkout URL + if(isset($settings['wc_after_add']) and $settings['wc_after_add'] == 'optional_cart') return array('type' => 'message', 'message' => '
    '); + // Optional Cart URL + if(isset($settings['wc_after_add']) and $settings['wc_after_add'] == 'optional_chckout') return array('type' => 'message', 'message' => '
    '); + // Cart URL + else return array('type' => 'url', 'url' => wc_get_cart_url()); + } + + /** + * @throws WC_Data_Exception + */ + public function create($event_id, $ticket_id) + { + $tickets = get_post_meta($event_id, 'mec_tickets', true); + if(!is_array($tickets)) $tickets = []; + + $ticket = $tickets[$ticket_id] ?? []; + + $product = new WC_Product(); + $product->set_name(get_the_title($event_id).': '.$ticket['name']); + $product->set_description($ticket['description']); + $product->set_short_description(get_the_title($event_id)); + $product->set_regular_price($ticket['price']); + $product->set_price($ticket['price']); + $product->set_catalog_visibility('hidden'); + $product->set_virtual(true); + + $product_id = $product->save(); + + // Set the relation + update_post_meta($product_id, 'mec_ticket', $event_id.':'.$ticket_id); + + // Trigger Action + do_action('mec_wc_product_created', $product_id, $event_id, $ticket_id); + + return $product_id; + } + + /** + * @throws WC_Data_Exception + */ + public function update($product_id, $event_id, $ticket_id) + { + $tickets = get_post_meta($event_id, 'mec_tickets', true); + if(!is_array($tickets)) $tickets = []; + + $ticket = $tickets[$ticket_id] ?? []; + + $product = new WC_Product($product_id); + $product->set_name(get_the_title($event_id).': '.$ticket['name']); + $product->set_description($ticket['description']); + $product->set_short_description(get_the_title($event_id)); + $product->set_regular_price($ticket['price']); + $product->set_price($ticket['price']); + $product->set_catalog_visibility('hidden'); + + // Trigger Action + do_action('mec_wc_product_updated', $product_id, $event_id, $ticket_id); + + return $product->save(); + } + + /** + * @throws Exception + */ + public function meta($item_id, $item) + { + if($item instanceof WC_Order_Item_Product) + { + if(isset($item->legacy_values['mec_event_id'])) wc_add_order_item_meta($item_id, 'mec_event_id', $item->legacy_values['mec_event_id']); + if(isset($item->legacy_values['mec_date'])) wc_add_order_item_meta($item_id, 'mec_date', $item->legacy_values['mec_date']); + if(isset($item->legacy_values['mec_other_dates'])) wc_add_order_item_meta($item_id, 'mec_other_dates', implode(',', $item->legacy_values['mec_other_dates'])); + if(isset($item->legacy_values['mec_transaction_id'])) wc_add_order_item_meta($item_id, 'mec_transaction_id', $item->legacy_values['mec_transaction_id']); + } + } + + /** + * @throws Exception + */ + public function get_event_id($order_id) + { + $event_id = 0; + $order = wc_get_order($order_id); + + $items = $order->get_items(); + foreach($items as $item_id => $item) + { + $meta = wc_get_order_item_meta($item_id, 'mec_event_id'); + if(trim($meta)) + { + $event_id = $meta; + break; + } + } + + return $event_id; + } + + /** + * @throws Exception + */ + public function paid($order_id) + { + if(!$order_id) return; + + // Main + $main = $this->getMain(); + + // MEC Settings + $settings = $main->get_settings(); + + // Auto Complete + $autocomplete = !isset($settings['wc_autoorder_complete']) || $settings['wc_autoorder_complete']; + + // Auto Order Complete is not Enabled + if(!$autocomplete) return; + + // It is not a MEC Order + if(!$this->get_event_id($order_id)) return; + + $order = wc_get_order($order_id); + + $status = $order->get_status(); + if($status === 'processing') $order->update_status('completed'); + } + + /** + * @throws Exception + */ + public function completed($order_id) + { + $created_booking_ids = get_post_meta($order_id, 'mec_booking_ids', true); + if(!is_array($created_booking_ids)) $created_booking_ids = []; + + // It's already done + if(count($created_booking_ids) == 1 and get_post($created_booking_ids[0])) return false; + if(count($created_booking_ids) > 1) return false; + + $event_id = $this->get_event_id($order_id); + + // It is not a MEC Order + if(!$event_id) return false; + + // WC order + $order = wc_get_order($order_id); + + // MEC Order + $mec = []; + $original_bought_tickets = []; + + $items = $order->get_items(); + foreach($items as $item_id => $item) + { + $event_id = wc_get_order_item_meta($item_id, 'mec_event_id'); + $date = wc_get_order_item_meta($item_id, 'mec_date'); + $transaction_id = wc_get_order_item_meta($item_id, 'mec_transaction_id'); + + $other_dates_meta = wc_get_order_item_meta($item_id, 'mec_other_dates'); + $other_dates = []; + + if(is_string($other_dates_meta) and trim($other_dates_meta)) $other_dates = explode(',', $other_dates_meta); + elseif(is_array($other_dates_meta)) $other_dates = $other_dates_meta; + + $dates = array($date); + if(is_array($other_dates)) $dates = array_merge($dates, $other_dates); + + if(!trim($event_id) or !trim($date)) continue; + if(!isset($mec[$event_id])) $mec[$event_id] = []; + + $product_id = $item->get_product_id(); + + $key = get_post_meta($product_id, 'mec_ticket', true); + if(!trim($key)) continue; + + list($e, $mec_ticket_id) = explode(':', $key); + + $product_ids = []; + for($i = 1; $i <= ($item->get_quantity() / count($dates)); $i++) + { + $product_ids[] = $product_id; + + if(!isset($original_bought_tickets[$event_id])) $original_bought_tickets[$event_id] = []; + if(!isset($original_bought_tickets[$event_id][$mec_ticket_id])) $original_bought_tickets[$event_id][$mec_ticket_id] = 1; + else $original_bought_tickets[$event_id][$mec_ticket_id] += 1; + } + + $booking_key = $date.'-'.implode(',', $dates).'-'.$transaction_id; + if(isset($mec[$event_id][$booking_key], $mec[$event_id][$booking_key]['product_ids']) and is_array($mec[$event_id][$booking_key]['product_ids'])) + { + $mec[$event_id][$booking_key]['product_ids'] = array_merge($mec[$event_id][$booking_key]['product_ids'], $product_ids); + } + else + { + $mec[$event_id][$booking_key] = array( + 'date' => $date, + 'other_dates' => $other_dates, + 'transaction_id' => $transaction_id, + 'product_ids' => $product_ids, + ); + } + } + + if(!count($mec)) return false; + + // Libraries + $main = $this->getMain(); + $book = $this->getBook(); + $gateway = new MEC_gateway_woocommerce(); + + // MEC User + $u = $this->getUser(); + + // Create Bookings + $book_ids = []; + foreach($mec as $event_id => $bs) + { + foreach($bs as $b) + { + $bought_tickets = $original_bought_tickets[$event_id]; + $transaction_id = $b['transaction_id'] ?? 0; + + $date = $b['date']; + $other_dates = (isset($b['other_dates']) and is_array($b['other_dates'])) ? $b['other_dates'] : []; + + $all_dates = []; + if(count($other_dates)) $all_dates = array_merge(array($date), $other_dates); + + $timestamps = count($all_dates) ? $all_dates : array($date); + $event_tickets = get_post_meta($event_id, 'mec_tickets', true); + + $tickets = []; + if(!$transaction_id) + { + $product_ids = $b['product_ids']; + + $raw_tickets = []; + foreach($product_ids as $product_id) + { + $key = get_post_meta($product_id, 'mec_ticket', true); + if(!trim($key)) continue; + + list($e, $mec_ticket_id) = explode(':', $key); + + if(!isset($raw_tickets[$mec_ticket_id])) $raw_tickets[$mec_ticket_id] = 1; + else $raw_tickets[$mec_ticket_id] += 1; + + $ticket = []; + $ticket['name'] = $order->get_formatted_billing_full_name(); + $ticket['email'] = $order->get_billing_email(); + $ticket['id'] = $mec_ticket_id; + $ticket['count'] = 1; + $ticket['reg'] = []; + $ticket['variations'] = []; + + $tickets[] = $ticket; + } + + // Calculate price of bookings + $price_details = $book->get_price_details($raw_tickets, $event_id, $event_tickets, array(), $timestamps, false); + + $booking = []; + $booking['tickets'] = $tickets; + $booking['first_for_all'] = 1; + $booking['date'] = $date; + $booking['all_dates'] = $all_dates; + $booking['other_dates'] = $other_dates; + $booking['timestamps'] = $timestamps; + $booking['event_id'] = $event_id; + $booking['price_details'] = $price_details; + $booking['total'] = $price_details['total']; + $booking['discount'] = 0; + $booking['price'] = $price_details['total']; + $booking['payable'] = $price_details['total']; + $booking['coupon'] = NULL; + + // Save Transaction + $transactionObject = new \MEC\Transactions\Transaction( 0, $booking ); + $transaction_id = $transactionObject->update_data(); + } + + // Transaction + $transaction = $book->get_transaction($transaction_id); + + // Calculate price of bookings + $price_details = $book->get_price_details($original_bought_tickets[$event_id], $event_id, $event_tickets, array(), $timestamps, false); + + $transaction['price_details'] = $price_details; + $transaction['total'] = $price_details['total']; + $transaction['price'] = $price_details['total']; + $transaction['payable'] = $price_details['total']; + + $book->update_transaction($transaction_id, $transaction); + + // Apply Coupon + $coupons = $order->get_coupon_codes(); + if(count($coupons)) + { + $wc_discount = $order->get_total_discount(); + $wc_before_discount = $order->get_subtotal(); + + $mec_before_discount = $transaction['total']; + $mec_discount = round((($mec_before_discount * $wc_discount) / $wc_before_discount), 2); + + $transaction['price_details']['details'][] = array( + 'amount' => $mec_discount, + 'description' => esc_html__('Discount by WC Coupon', 'modern-events-calendar-lite'), + 'type' => 'discount', + 'coupon' => implode(', ', $coupons) + ); + + $transaction['discount'] = $mec_discount; + $transaction['price'] = $mec_before_discount - $mec_discount; + $transaction['payable'] = $mec_before_discount - $mec_discount; + $transaction['coupon'] = implode(', ', $coupons); + + $book->update_transaction($transaction_id, $transaction); + } + + // Attendees + $attendees = $transaction['tickets'] ?? $tickets; + + $attention_date = $transaction['date'] ?? ''; + $attention_times = explode(':', $attention_date); + $date = date('Y-m-d H:i:s', trim($attention_times[0])); + + $ticket_ids = ''; + $attendees_info = []; + + $bought_attendees = []; + foreach($attendees as $i => $attendee) + { + if(!is_numeric($i)) continue; + + $attendee_ticket_id = $attendee['id']; + + if(!isset($bought_tickets[$attendee_ticket_id])) continue; + + $bought_tickets[$attendee_ticket_id] -= 1; + if($bought_tickets[$attendee_ticket_id] == 0) unset($bought_tickets[$attendee_ticket_id]); + + $bought_attendees[] = $attendee; + + $ticket_ids .= $attendee_ticket_id . ','; + if(!array_key_exists($attendee['email'], $attendees_info)) $attendees_info[$attendee['email']] = ['count' => $attendee['count']]; + else $attendees_info[$attendee['email']]['count'] = ($attendees_info[$attendee['email']]['count'] + $attendee['count']); + } + + if(isset($transaction['attachments']) && count($transaction['attachments'])) + { + $bought_attendees['attachments'] = $transaction['attachments']; + } + + // Update Transaction + $transaction['tickets'] = $bought_attendees; + $transaction['order_id'] = $order_id; + $book->update_transaction($transaction_id, $transaction); + + // Apply only those attendees who bought tickets + $attendees = $bought_attendees; + + $main_attendee = $attendees[0] ?? []; + $name = $main_attendee['name'] ?? ''; + + $ticket_ids = ',' . trim($ticket_ids, ', ') . ','; + $user_id = $gateway->register_user($main_attendee, $transaction); + + $book_subject = $name.' - '.($main_attendee['email'] ?? $u->get($user_id)->user_email); + $book_id = $book->add( + array( + 'post_author' => $user_id, + 'post_type' => $main->get_book_post_type(), + 'post_title' => $book_subject, + 'post_date' => $date, + 'attendees_info' => $attendees_info, + 'mec_attendees' => $attendees, + 'mec_gateway' => 'MEC_gateway_woocommerce', + 'mec_gateway_label' => $gateway->title() + ), + $transaction_id, + $ticket_ids + ); + + // Assign User + $u->assign($book_id, $user_id); + + update_post_meta($book_id, 'mec_order_id', $order_id); + + // Add WC coupon code + if(count($coupons)) update_post_meta($book_id, 'mec_coupon_code', implode(', ', $coupons)); + + $book_ids[] = $book_id; + + // Fires after completely creating a new booking + do_action('mec_booking_completed', $book_id); + } + } + + update_post_meta($order_id, 'mec_booking_ids', $book_ids); + + // Redirection + $thankyou_page_id = $main->get_thankyou_page_id($event_id); + if($thankyou_page_id and !is_admin()) + { + $redirect_to = $book->get_thankyou_page($thankyou_page_id, ($transaction_id ?? NULL)); + + wp_redirect($redirect_to); + exit; + } + + return true; + } + + public function cancelled($order_id) + { + $booking_ids = get_post_meta($order_id, 'mec_booking_ids', true); + if(!is_array($booking_ids)) $booking_ids = []; + + // No Related Bookings + if(!count($booking_ids)) return; + + $book = $this->getBook(); + foreach($booking_ids as $booking_id) + { + $book->cancel($booking_id); + $book->reject($booking_id); + } + } + + public function get_ticket_name($product_id) + { + $mec_ticket = get_post_meta($product_id, 'mec_ticket', true); + list($event_id, $ticket_id) = explode(':', $mec_ticket); + + $tickets = get_post_meta($event_id, 'mec_tickets', true); + if(!is_array($tickets)) $tickets = []; + + $ticket = $tickets[$ticket_id] ?? []; + return $ticket['name'] ?? ''; + } +} \ No newline at end of file diff --git a/app/modules/attendees-list/details.php b/app/modules/attendees-list/details.php new file mode 100755 index 0000000..0be2fff --- /dev/null +++ b/app/modules/attendees-list/details.php @@ -0,0 +1,112 @@ +get_settings(); + +// BuddyPress' integration is disabled +if(!isset($settings['bp_status']) || !$settings['bp_status']) return; + +// Attendees Module is disabled +if(!isset($settings['bp_attendees_module']) || !$settings['bp_attendees_module']) return; + +// BuddyPress is not installed or activated +if(!function_exists('is_plugin_active')) +{ + include_once(ABSPATH . 'wp-admin/includes/plugin.php'); +} + +if(!(function_exists('bp_activity_add') || is_plugin_active('buddypress/bp-loader.php'))) return; + +$date = $event->date; +$timestamp = (isset($date['start']) and isset($date['start']['timestamp'])) ? $date['start']['timestamp'] : current_time('timestamp'); + +$limit = $settings['bp_attendees_module_limit'] ?? 30; +$bookings = $this->get_bookings($event->data->ID, $timestamp, $limit); + +// Book Library +$book = $this->getBook(); + +// Start Date belongs to future but booking module cannot show so return without any output +if(!$this->can_show_booking_module($event) and $timestamp > time()) return; + +$attendees = []; +foreach($bookings as $booking) +{ + if(!isset($attendees[$booking->post_author])) $attendees[$booking->post_author] = []; + $attendees[$booking->post_author][] = $booking->ID; +} + +// MEC User +$u = $this->getUser(); +?> +
    +

    + +

    + +
      + $attendee_bookings): ?> +
    • + + get($attendee_id); + + $name = $user->display_name; + if(!$name or is_email($name)) $name = trim($user->first_name.' '.$user->last_name); + + $total_attendees = 0; + foreach($attendee_bookings as $booking_id) $total_attendees += $book->get_total_attendees($booking_id); + ?> + + + +
      + $mec_attendee) + { + if(!is_numeric($mec_attendee_key)) continue; + + $email = $mec_attendee['email'] ?? NULL; + if(!$email) continue; + + if(!isset($un_attendees[$email])) $un_attendees[$email] = $mec_attendee; + else $un_attendees[$email]['count'] += $mec_attendee['count']; + } + } + + // For Display Sorting Output. + foreach($un_attendees as $mec_attendee) + { + ?> +
      + '. get_avatar($mec_attendee['email'], '50') .'
      '; + echo '
      '. (!is_email($mec_attendee['name']) ? $mec_attendee['name'] : 'N/A') .'
      '; + echo ''. sprintf(_n('%s ticket', '%s tickets', $mec_attendee['count'], 'modern-events-calendar-lite'), $mec_attendee['count']) . ''; + ?> +
      + +
    + + + + + \ No newline at end of file diff --git a/app/modules/attendees-list/index.html b/app/modules/attendees-list/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/modules/booking/default.php b/app/modules/booking/default.php new file mode 100755 index 0000000..00f505f --- /dev/null +++ b/app/modules/booking/default.php @@ -0,0 +1,1086 @@ +getPRO()) return; + +// MEC Settings +$settings = $this->get_settings(); +$ml_settings = $this->get_ml_settings(); + +// Booking module is disabled +if(!isset($settings['booking_status']) or (isset($settings['booking_status']) and !$settings['booking_status'])) return; + +// Skip First Step +$skip_step1 = isset($settings['booking_skip_step1']) && $settings['booking_skip_step1']; + +$event = $event[0]; +$uniqueid = !empty($uniqueid) ? apply_filters('mec_booking_uniqueid_value', $uniqueid) : $event->data->ID; + +$tickets = $event->data->tickets ?? []; +$dates = $event->dates ?? $event->date; + +// No Dates +if(!count($dates)) return; + +// No Tickets +if(!count($tickets)) return; + +$display_progress_bar = $this->can_display_booking_progress_bar($settings); + +// Redirect Payment Thank you +$thankyou_message = apply_filters('mec_booking_redirect_payment_thankyou', ''); +if(trim($thankyou_message)) +{ + // Used in Message Template + $message = $thankyou_message; + + include MEC::import('app.modules.booking.steps.message', true, true); + return; +} + +// Abort Booking Module +$abort = apply_filters('mec_booking_module_abort', false, $event); +if($abort !== false) +{ + echo MEC_kses::full($abort); + return; +} + +// Shortcode Options +if(!isset($from_shortcode)) $from_shortcode = false; +if(!isset($ticket_id)) $ticket_id = NULL; + +$book = $this->getBook(); + +// User Booking Limits +list($user_ticket_limit, $user_ticket_unlimited) = $book->get_user_booking_limit($event->data->ID); + +// Generate JavaScript code of Booking Module +$javascript = ''; + +$do_skip = false; +if($skip_step1 and count($tickets) === 1 and count($dates) === 1 and $user_ticket_limit == 1 and !$user_ticket_unlimited) +{ + $do_skip = true; + $javascript .= ''; +} + +$javascript = apply_filters('mec-javascript-code-of-booking-module', $javascript, $uniqueid); + +// Include javascript code into the footer +if($this->is_ajax()) echo ($javascript); +else +{ + $factory = $this->getFactory(); + $factory->params('footer', $javascript); +} +?> +
    + +
    +
    diff --git a/app/modules/booking/index.html b/app/modules/booking/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/modules/booking/steps/checkout.php b/app/modules/booking/steps/checkout.php new file mode 100755 index 0000000..b65bf10 --- /dev/null +++ b/app/modules/booking/steps/checkout.php @@ -0,0 +1,237 @@ +ID; +$requested_event_id = $event->requested_id ?? $event_id; + +$gateways = $this->main->get_gateways(); + +$date_ex = explode(':', $date); +$occurrence = $date_ex[0]; + +$booking_options = get_post_meta($event_id, 'mec_booking', true); +if(!is_array($booking_options)) $booking_options = []; + +$gateway_settings = $this->main->get_gateways_options(); + +$active_gateways = []; +foreach($gateways as $gateway) +{ + if(!$gateway->enabled()) continue; + + // Gateway is disabled per event + if(isset($gateway_settings['gateways_per_event']) and $gateway_settings['gateways_per_event']) + { + if(isset($booking_options['gateways_'.$gateway->id().'_disabled']) and $booking_options['gateways_'.$gateway->id().'_disabled']) continue; + } + + $active_gateways[] = $gateway; + + // When Stripe Connect is enabled and organizer is connected then skip other gateways + if($gateway->id() == 7 and get_user_meta(get_post_field('post_author', $event_id), 'mec_stripe_id', true)) // Stripe Connect + { + $active_gateways = array($gateway); + break; + } +} + +$mecFluentEnable = class_exists('MEC_Fluent\Core\pluginBase\MecFluent') && (isset($this->settings['single_single_style']) and $this->settings['single_single_style'] == 'fluent'); +if($mecFluentEnable) +{ + $ticketsDetails = []; + foreach($raw_tickets as $ticket_id => $count) + { + if(!isset($event_tickets[$ticket_id])) continue; + + $ticketPrice = isset($event_tickets[$ticket_id]['price']) ? $this->book->get_ticket_price($event_tickets[$ticket_id], current_time('Y-m-d'), $event_id, $occurrence) : 0; + $ticketsDetails[$ticket_id]['name'] = $event_tickets[$ticket_id]['name']; + $ticketsDetails[$ticket_id]['count'] = $count; + $ticketsDetails[$ticket_id]['price'] = ($ticketPrice*$count); + } +} + +$first_gateway_id = NULL; + +$free_booking = isset($price_details['total']) && $price_details['total'] == 0; +$paid_booking = !$free_booking; +?> + +
    + + +
      +
    • +
    • +
    • +
    • +
    + +

    + + +
    + + +
    +
    + + + +
    +
    + +
    + + + +
    + +
    +
    + + +
    + +
    + main->svg('form/subtotal-icon'); ?> +
    + + main->render_price($detail['amount'], $requested_event_id)); ?> +
    +
    + +
    + +
    + + main->render_price($price_details['total'], $requested_event_id)); ?> +
    +
    + + +
      + +
    • + main->svg('form/subtotal-icon'); ?> +
      + + main->render_price($detail['amount'], $requested_event_id)); ?> +
      +
    • + +
    + + +
    + + +
    +
    + settings['coupons_status']) and $this->settings['coupons_status']): ?> +
    +
    + + main->svg('form/discount-icon'); ?> + + + + + + +
    +
    +
    + +
    +
    +
      + settings['coupons_status']) and $this->settings['coupons_status']): ?> +
    • + + main->render_price(($price_details['discount'] ?? 0), $requested_event_id, false)); ?> +
    • + +
    • + + main->render_price($price_details['total'], $requested_event_id)); ?> +
    • + getPartialPayment()->is_enabled()): ?> +
    • + + main->render_price($price_details['payable'], $requested_event_id)); ?> +
    • + +
    +
    +
    + + +
    +

    +
    + id(); ?> + + +
    + +
    + +
    + comment()); ?> + checkout_form($transaction_id); ?> +
    + +
    +
    + + + +

    + main->svg('form/lock-icon').' '.esc_html__('Your transaction is secured with SSL encryption.', 'modern-events-calendar-lite'); ?> +

    + + +
    +
    + + + + + + + +
    + +
    +
    +
    + +
    + +
    + + + + +
    diff --git a/app/modules/booking/steps/form.php b/app/modules/booking/steps/form.php new file mode 100755 index 0000000..3a7bd5c --- /dev/null +++ b/app/modules/booking/steps/form.php @@ -0,0 +1,53 @@ +ID; +$requested_event_id = $event->requested_id ?? $event_id; + +$reg_fields = \MEC\Base::get_main()->get_reg_fields($event_id, $translated_event_id); +$bfixed_fields = \MEC\Base::get_main()->get_bfixed_fields($event_id, $translated_event_id); + +$custom_view_fields = apply_filters('mec_have_custom_view_fields', false, $bfixed_fields, 'booking_fixed_fields', $event_id); + +$mainClass = new \MEC_main(); +$set = $mainClass->get_options(); + +if(!$custom_view_fields || + isset($set['default_form']['form_id']) && is_plugin_active('mec-form-builder/mec-form-builder.php')) +{ + \MEC\BookingForm\Attendees::output( + $event, + $date, + $tickets, + $reg_fields, + $bfixed_fields, + $uniqueid, + $all_dates + ); +} +else +{ + do_action( + 'mec_booking_attendee_form_custom_view', + $event, + $event_id, + array( + 'date' => $date, + 'uniqueid' => $uniqueid, + 'tickets' => $tickets, + ) + ); +} + + diff --git a/app/modules/booking/steps/index.html b/app/modules/booking/steps/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/modules/booking/steps/message.php b/app/modules/booking/steps/message.php new file mode 100755 index 0000000..857638c --- /dev/null +++ b/app/modules/booking/steps/message.php @@ -0,0 +1,51 @@ +ID; + +/** @var MEC_main $main */ +$main = $this instanceof MEC_main ? $this : MEC::getInstance('app.libraries.main'); + +// Transaction ID +$transaction_id = $_REQUEST['mec_stripe_redirect_transaction_id'] ?? ''; +if(!trim($transaction_id)) $transaction_id = $_REQUEST['mec_stripe_connect_redirect_transaction_id'] ?? ''; + +$had_payment = false; +if(trim($transaction_id)) +{ + $book = $main->getBook(); + $transaction = $book->get_transaction($transaction_id); + + // Had Payment + if(isset($transaction['total'])) $had_payment = (bool) $transaction['total']; +} +?> +
    + +
      +
    • +
    • + +
    • + +
    • +
    + + +
    + + +
    +
    + +
    +
    + + + + +
    \ No newline at end of file diff --git a/app/modules/booking/steps/tickets.php b/app/modules/booking/steps/tickets.php new file mode 100755 index 0000000..4091e8a --- /dev/null +++ b/app/modules/booking/steps/tickets.php @@ -0,0 +1,330 @@ +ID; + +global $post; +if($post and $post->post_type == $this->get_main_post_type()) $translated_event_id = $post->ID; +else $translated_event_id = $event_id; + +$tickets = isset($event->data->tickets) ? $event->data->tickets : []; +$dates = isset($event->dates) ? $event->dates : array($event->date); + +if(isset($settings['booking_start_from_first_upcoming_date']) && $settings['booking_start_from_first_upcoming_date']) +{ + $maximum_dates = isset($settings['booking_maximum_dates']) && trim($settings['booking_maximum_dates']) ? $settings['booking_maximum_dates'] : 12; + list($occurrence, $occurrence_time) = $this->get_start_date_to_get_event_dates($event_id, current_time('Y-m-d')); + + $dates = $this->getRender()->dates($event_id, $event->data, $maximum_dates, ($occurrence_time ? date('Y-m-d H:i:s', $occurrence_time) : $occurrence)); + $dates = $this->adjust_event_dates_for_booking($event, $dates); +} + +$booking_options = get_post_meta($event_id, 'mec_booking', true); +if(!is_array($booking_options)) $booking_options = []; + +// WC System +$WC_status = (isset($settings['wc_status']) and $settings['wc_status'] and class_exists('WooCommerce')); +$WC_booking_form = (isset($settings['wc_booking_form']) and $settings['wc_booking_form']); + +if($ticket_id) +{ + $new_tickets = []; + foreach($tickets as $t_id => $ticket) + { + if((int) $t_id === (int) $ticket_id) + { + $new_tickets[$t_id] = $ticket; + } + } + + if(count($new_tickets)) $tickets = $new_tickets; +} + +$occurrence_time = $dates[0]['start']['timestamp'] ?? strtotime($dates[0]['start']['date']); + +$default_ticket_number = 0; +if(count($tickets) == 1) $default_ticket_number = 1; + +$book = $this->getBook(); +$availability = $book->get_tickets_availability($event_id, $occurrence_time); + +$date_format = (isset($ml_settings['booking_date_format1']) and trim($ml_settings['booking_date_format1'])) ? $ml_settings['booking_date_format1'] : 'Y-m-d'; +if(isset($event->data->meta['mec_repeat_type']) and $event->data->meta['mec_repeat_type'] === 'custom_days') $date_format .= ' '.get_option('time_format'); + +$midnight_event = $this->is_midnight_event($event); + +$book_all_occurrences = 0; +if(isset($event->data) and isset($event->data->meta) and isset($event->data->meta['mec_booking']) and isset($event->data->meta['mec_booking']['bookings_all_occurrences'])) $book_all_occurrences = (int) $event->data->meta['mec_booking']['bookings_all_occurrences']; + +// User Booking Limits +list($user_ticket_limit, $user_ticket_unlimited) = $book->get_user_booking_limit($event_id); + +// Show Booking Form Interval +$show_booking_form_interval = (isset($settings['show_booking_form_interval'])) ? $settings['show_booking_form_interval'] : 0; +if(isset($booking_options['show_booking_form_interval']) and trim($booking_options['show_booking_form_interval']) != '') $show_booking_form_interval = $booking_options['show_booking_form_interval']; + +if($show_booking_form_interval) +{ + $filtered_dates = []; + foreach($dates as $date) + { + $date_diff = $this->date_diff(date('Y-m-d h:i a', current_time('timestamp')), date('Y-m-d h:i a', $date['start']['timestamp'])); + if(isset($date_diff->days) and !$date_diff->invert) + { + $minute = $date_diff->days * 24 * 60; + $minute += $date_diff->h * 60; + $minute += $date_diff->i; + + if($minute > $show_booking_form_interval) continue; + } + + $filtered_dates[] = $date; + } + + $dates = $filtered_dates; +} + +$available_spots = 0; +$total_spots = -1; +foreach($availability as $ticket_id=>$count) +{ + if(!is_numeric($ticket_id)) + { + $total_spots = $count; + continue; + } + + if($count != '-1') $available_spots += $count; + else + { + $available_spots = -1; + break; + } +} + +if($total_spots > 0) $available_spots = min($available_spots, $total_spots); + +// Date Selection Method +$date_selection = (isset($settings['booking_date_selection']) and trim($settings['booking_date_selection'])) ? $settings['booking_date_selection'] : 'dropdown'; +if(isset($settings['booking_date_selection_per_event']) and $settings['booking_date_selection_per_event'] and isset($booking_options['bookings_date_selection']) and trim($booking_options['bookings_date_selection']) and $booking_options['bookings_date_selection'] !== 'global') +{ + $date_selection = $booking_options['bookings_date_selection']; +} + +// Omit End Dates +$omit_end_dates = isset($settings['booking_omit_end_date']) && $settings['booking_omit_end_date']; + +// Modal Booking +$modal_booking = isset($_GET['method']) && sanitize_text_field($_GET['method']) === 'mec-booking-modal'; +wp_enqueue_script('mec-niceselect-script'); +?> +
    + + +
      +
    • +
    • + +
    • + +
    • +
    • + +
    + +

    data->post->post_title : esc_html__('Book Event', 'modern-events-calendar-lite')); ?>

    + + + 1): ?> +
    + timestamp($dates[0]['start'], $dates[0]['end']); $default_selected_datetime_ex = explode(':', $default_selected_datetime); ?> + + + +
    +
    *
    +
    +
    + svg('form/calendar-icon'); ?> + date_i18n($date_format, $default_selected_datetime_ex[0]); ?> + + svg('form/up-icon'); ?> + svg('form/down-icon'); ?> + +
    +
    display_calendar($event, $uniqueid, $dates[0]['start']['date'], $default_selected_datetime); ?>
    +
    +
    + +
    +
    *
    +
    +
    display_calendar($event, $uniqueid, $dates[0]['start']['date'], $default_selected_datetime); ?>
    +
    +
    + + + +
    +
    date_label($dates[0]['start'], $dates[0]['end'], $date_format, ' - ', false, ($dates[0]['allday'] ?? 0))); ?>
    + +
    + + + + +
    + + + +
    + +
    + +
    +
    + svg('form/calendar-icon'); ?> + +
    +
    +
    + +
    + +
    + +
    date_label($date['start'], $date['end'], $date_format, ' - ', false))."
    "; ?>
    +
    + + + '.MEC_kses::element($this->date_label($dates[0]['start'], $dates[0]['end'], $date_format, ' - ', false)).''; ?> + + + +
    + $ticket): ?> + 0) + { + $maximum_purchase = (int) $ticket['maximum_ticket']; + } + + $ticket_limit = $availability[$ticket_id] ?? -1; + if($ticket_limit === '0' and count($dates) <= 1) continue; + ?> +
    + +
    +
    +
    svg('form/ticket-icon'); ?>
    +
    +
    +
    + + get_ticket_price_label($ticket, current_time('Y-m-d'), $event_id, $occurrence_time) : ''; + $price_label = apply_filters('mec_filter_price_label', $price_label, $ticket, $event_id, $book); + ?> +
    +
    +
    +
    + + +

    + +

    + + +
    m('tickets', esc_html__('Tickets', 'modern-events-calendar-lite')), (($ticket['unlimited'] and $ticket_limit == '-1') ? ''.esc_html__('Unlimited', 'modern-events-calendar-lite').'' : ($ticket_limit != '-1' ? ''.$ticket_limit.'' : ''.esc_html__('Unlimited', 'modern-events-calendar-lite').''))); ?>
    + +
    +
    +

    + + "'.esc_html($ticket['name']).'"' : ''; + $ticket_message_sales = $stop_selling_message ? sprintf($stop_selling_message, $str_replace) : sprintf(esc_html__('The %s ticket sales has ended!', 'modern-events-calendar-lite'), $str_replace); + $ticket_message_sold_out = sprintf(esc_html__('The %s ticket is sold out. You can try another ticket or another date.', 'modern-events-calendar-lite'), $str_replace); + $ticket_message_sold_out_multiple = sprintf(esc_html__('The %s ticket is sold out or not available for some of dates. You can try another ticket or another date.', 'modern-events-calendar-lite'), $str_replace); + ?> + +
    +
    + +
    + + +
    + +
    +
    + +
    + + + +
    + +
    + +
    + + 1)) && $this->getCaptcha()->status('booking')) echo $this->getCaptcha()->field(); ?> + + + + + + + + + + + + '.((!$user_ticket_unlimited and $user_ticket_limit == 1 and count($tickets) == 1) ? 1 : 0).''); ?> + +
    + +
    +
    + + + + diff --git a/app/modules/countdown/details.php b/app/modules/countdown/details.php new file mode 100755 index 0000000..261e38a --- /dev/null +++ b/app/modules/countdown/details.php @@ -0,0 +1,460 @@ +get_settings(); + +// Countdown on single page is disabled +if (!isset($settings['countdown_status']) || !$settings['countdown_status']) return; + +$event = $event[0]; +$date = $event->date; + +$start_date = (isset($date['start']) and isset($date['start']['date'])) ? $date['start']['date'] : current_time('Y-m-d'); +$end_date = (isset($date['end']) and isset($date['end']['date'])) ? $date['end']['date'] : current_time('Y-m-d'); + +$s_time = ''; +if (!empty($date)) { + $s_hour = $date['start']['hour']; + if (strtoupper($date['start']['ampm']) == 'AM' and $s_hour == '0') $s_hour = 12; + + $s_time .= sprintf("%02d", $s_hour) . ':'; + $s_time .= sprintf("%02d", $date['start']['minutes']); + $s_time .= ' ' . trim($date['start']['ampm']); +} + +$e_time = ''; +if (!empty($date)) { + $e_hour = $date['end']['hour']; + if (strtoupper($date['end']['ampm']) == 'AM' and $e_hour == '0') $e_hour = 12; + + $e_time .= sprintf("%02d", $e_hour) . ':'; + $e_time .= sprintf("%02d", $date['end']['minutes']); + $e_time .= ' ' . trim($date['end']['ampm']); +} + +$start_time = date('D M j Y G:i:s', strtotime($start_date . ' ' . $s_time)); +$end_time = date('D M j Y G:i:s', strtotime($end_date . ' ' . $e_time)); + +// Timezone +$TZO = $this->get_TZO($event); + +$d1 = new DateTime($start_time, $TZO); +$d2 = new DateTime('now', $TZO); +$d3 = new DateTime($end_time, $TZO); + +$countdown_method = get_post_meta($event->ID, 'mec_countdown_method', true); +if (trim($countdown_method) == '') $countdown_method = 'global'; + +if ($countdown_method == 'global') $ongoing = (isset($settings['hide_time_method']) and trim($settings['hide_time_method']) == 'end'); +else $ongoing = $countdown_method == 'end'; + +$disable_for_ongoing = (isset($settings['countdown_disable_for_ongoing_events']) and $settings['countdown_disable_for_ongoing_events']); + +if ($d3 < $d2) { + echo '

    ' . esc_html__('The event is finished.', 'modern-events-calendar-lite') . '

    '; + return; +} elseif (($d1 < $d2 and !$ongoing) or ($d1 < $d2 and $disable_for_ongoing)) { + echo '

    ' . esc_html__('The event is ongoing.', 'modern-events-calendar-lite') . '

    '; + return; +} + +$gmt_offset = $this->get_gmt_offset($event, strtotime($start_date . ' ' . $s_time)); +if (isset($_SERVER['HTTP_USER_AGENT']) and strpos($_SERVER['HTTP_USER_AGENT'], 'Safari') === false) $gmt_offset = ' : ' . $gmt_offset; +if (isset($_SERVER['HTTP_USER_AGENT']) and strpos($_SERVER['HTTP_USER_AGENT'], 'Edge') == true) $gmt_offset = substr(trim($gmt_offset), 0, 3); +if (isset($_SERVER['HTTP_USER_AGENT']) and strpos($_SERVER['HTTP_USER_AGENT'], 'Trident') == true) $gmt_offset = substr(trim($gmt_offset), 2, 3); + +$datetime = $ongoing ? $end_time : $start_time; + +// Generating javascript code of countdown default module +$defaultjs = ''; + +// Generating javascript code of countdown flip module +$flipjs = ''; +$flipjsDivi = ''; +if (!function_exists('is_plugin_active')) include_once(ABSPATH . 'wp-admin/includes/plugin.php'); +?> + + is_ajax()) echo MEC_kses::full($defaultjs); + elseif (is_plugin_active('mec-single-builder/mec-single-builder.php')) echo MEC_kses::full($defaultjs); + else $factory->params('footer', $defaultjs); + ?> +
    +
    +
      +
    • + + 00 +

      +
    • +
    • + + 00 +

      +
    • +
    • + + 00 +

      +
    • +
    • + + 00 +

      +
    • +
    +
    +
    + + is_ajax()) echo MEC_kses::full($flipjs); + elseif (is_plugin_active('mec-single-builder/mec-single-builder.php')) { + wp_enqueue_script('mec-flipcount-script'); + echo MEC_kses::full($flipjs); + } elseif (is_plugin_active('divi-single-builder/divi-single-builder.php') || is_plugin_active('mec-divi-single-builder/divi-single-builder.php')) { + wp_enqueue_script('mec-flipcount-script'); + $factory->params('footer', $flipjsDivi); + } else { + // Include FlipCount library + wp_enqueue_script('mec-flipcount-script'); + + // Include the JS code + $factory->params('footer', $flipjs); + } + if (is_plugin_active('mec-gutenberg-single-builder/mec-gutenberg-single-builder.php') && str_contains($_SERVER['REQUEST_URI'],'gsb')){?> + +
    + +
    +
    +get_settings(); + +// Expired? +if($this->is_expired($event) and isset($settings['export_module_hide_expired']) and $settings['export_module_hide_expired']) return; + +// Export module on single page is disabled +if(!isset($settings['export_module_status']) || !$settings['export_module_status']) return; + +$title = isset($event->data->title) ? $event->data->title : ''; +$location_id = $this->get_master_location_id($event); +$location_data = ($location_id ? $this->get_location_data($location_id) : array()); +$location = (($location_id and $location_data) ? '&location='.urlencode($location_data['address']) : ''); +$occurrence = isset($_GET['occurrence']) ? sanitize_text_field($_GET['occurrence']) : ''; +$occurrence_end_date = trim($occurrence) ? $this->get_end_date_by_occurrence($event->data->ID, (isset($event->date['start']['date']) ? $event->date['start']['date'] : $occurrence)) : ''; + +$content = (isset($event->data->post->post_content) and trim($event->data->post->post_content)) ? $event->data->post->post_content : $title; +$content = preg_replace('#]*href="((?!/)[^"]+)">[^<]+#', '$0 ( $1 )', $content); +$content = strip_shortcodes(strip_tags($content)); +$content = apply_filters('mec_add_content_to_export_google_calendar_details', $content, $event->data->ID); + +$start_date_temp = $start_hour_temp = ''; +if(!empty($event->date)) +{ + $start_date_temp = isset($event->date['start']['date']) ? $event->date['start']['date'] : NULL; + $start_hour_temp = isset($event->date['start']['hour']) ? $event->date['start']['hour'] : NULL; +} + +$start_minutes_temp = isset($event->date['start']['minutes']) ? $event->date['start']['minutes'] : NULL; +$start_ampm_temp = isset($event->date['start']['ampm']) ? $event->date['start']['ampm'] : NULL; + +$end_date_temp = isset($event->date['end']['date']) ? $event->date['end']['date'] : NULL; +$end_hour_temp = isset($event->date['end']['hour']) ? $event->date['end']['hour'] : NULL; +$end_minutes_temp = isset($event->date['end']['minutes']) ? $event->date['end']['minutes'] : NULL; +$end_ampm_temp = isset($event->date['end']['ampm']) ? $event->date['end']['ampm'] : NULL; + +if($start_hour_temp == 0 && $start_ampm_temp == 'AM') $start_hour_temp = '12'; +if($end_hour_temp == 0 && $end_ampm_temp == 'AM') $end_hour_temp = '12'; + +if((is_null($start_date_temp) or is_null($start_hour_temp) or is_null($start_minutes_temp) or is_null($start_ampm_temp) or is_null($end_date_temp) or is_null($end_hour_temp) or is_null($end_minutes_temp) or is_null($end_ampm_temp)) and !trim($occurrence)) +{ + return; +} + +$allday = isset($event->data->meta['mec_allday']) ? $event->data->meta['mec_allday'] : 0; +if($allday) +{ + $start_hour_temp = 12; + $start_minutes_temp = 0; + $start_ampm_temp = 'AM'; + + $end_hour_temp = 12; + $end_minutes_temp = 0; + $end_ampm_temp = 'AM'; + + if(trim($occurrence_end_date)) $occurrence_end_date = date('Y-m-d', strtotime('+1 day', strtotime($occurrence_end_date))); + $end_date_temp = date('Y-m-d', strtotime('+1 day', strtotime($end_date_temp))); +} +$start_time = strtotime((trim($occurrence) ? $occurrence : $start_date_temp).' '.sprintf("%02d", $start_hour_temp).':'.sprintf("%02d", $start_minutes_temp).' '.$start_ampm_temp); +$end_time = strtotime((trim($occurrence_end_date) ? $occurrence_end_date : $end_date_temp).' '.sprintf("%02d", $end_hour_temp).':'.sprintf("%02d", $end_minutes_temp).' '.$end_ampm_temp); +$gmt_offset_seconds = $this->get_gmt_offset_seconds($start_time, $event); + +// Recurring Rules +$rrule = $this->get_ical_rrules($event->data, true); + +$description = "$content"; + +ob_start(); +do_action('mec_add_to_calander_event_description', $event); +$description .= html_entity_decode(ob_get_clean()); +?> +
    +
    +
    +
      +
    • +
    • +
    +
    +
    +
    \ No newline at end of file diff --git a/app/modules/export/index.html b/app/modules/export/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/modules/googlemap/details.php b/app/modules/googlemap/details.php new file mode 100755 index 0000000..006d6a0 --- /dev/null +++ b/app/modules/googlemap/details.php @@ -0,0 +1,153 @@ +getPRO()) return; + +// MEC Settings +$settings = $this->get_settings(); + +// Google Maps on single page is disabled +if(!isset($settings['google_maps_status']) || !$settings['google_maps_status']) return; + +$event = $event[0]; +$uniqueid = $uniqueid ?? $event->data->ID; + +// Map is disabled for this event +$dont_show_map = ((isset($event->data->meta['mec_dont_show_map']) and is_numeric($event->data->meta['mec_dont_show_map'])) ? $event->data->meta['mec_dont_show_map'] : 0); +if(isset($event->date) and isset($event->date['start']) and isset($event->date['start']['timestamp'])) $dont_show_map = MEC_feature_occurrences::param($event->ID, $event->date['start']['timestamp'], 'dont_show_map', $dont_show_map); + +if($dont_show_map) return; + +// Event ID +$event_id = $event->ID; + +$location_id = $this->get_master_location_id($event); +$location = ($location_id ? $this->get_location_data($location_id) : array()); + +// Event location geo point +$latitude = $location['latitude'] ?? ''; +$longitude = $location['longitude'] ?? ''; +$address = $location['address'] ?? ''; + +// Try to get the latitude and longitude on the fly +if(!trim($latitude) or !trim($longitude)) +{ + $geo_point = $this->get_lat_lng($address); + + $latitude = $geo_point[0]; + $longitude = $geo_point[1]; + + if($location_id) + { + update_term_meta($location_id, 'latitude', $latitude); + update_term_meta($location_id, 'longitude', $longitude); + } +} + +// Still Latitude and Longitude are wrong! +if(!trim($latitude) or !trim($longitude)) return; + +// Include Map Assets such as JS and CSS libraries +if(!$this->is_ajax()) $this->load_map_assets(); + +// Get Direction Status +$get_direction = (isset($settings['google_maps_get_direction_status']) and in_array($settings['google_maps_get_direction_status'], array(0,1,2))) ? $settings['google_maps_get_direction_status'] : 0; + +$additional_location_ids = get_post_meta($event_id, 'mec_additional_location_ids', true); +$event_locations = array_keys((array)$event->data->locations); + +$map_data = new stdClass; +$map_data->id = $uniqueid; +$map_data->atts = array( + 'location_map_zoom' => $settings['google_maps_zoomlevel'] ?? 14, + 'location_center_lat' => null, + 'location_center_long' => null, + 'use_orig_map' => true +); + +$map_data->events = array($event_id => $event); +$map_data->render = $render; +$map_data->geolocation = '0'; +$map_data->sf_status = null; + +$current_event = (isset($map_data->events[$event_id]) ? array($map_data->events[$event_id]) : array()); +$map_data->events = apply_filters('mec_location_load_additional', $current_event, $additional_location_ids, $event_locations); + +$scrollwheel = apply_filters( 'mec_google_map_scroll_wheel', false ); + +// Initialize MEC Google Maps jQuery plugin +$javascript = ''; +$javascript = apply_filters('mec_map_load_script', $javascript, $map_data, $settings); + +if(!function_exists('is_plugin_active')) include_once(ABSPATH . 'wp-admin/includes/plugin.php'); + +// Include javascript code into the footer +if($this->is_ajax()) echo MEC_kses::full($javascript); +elseif (is_plugin_active( 'mec-single-builder/mec-single-builder.php')) echo MEC_kses::full($javascript); +else $factory->params('footer', $javascript); +?> + +
    + + + + + +
    + + +
    +
    +
    + + X +
    +
    + +
    +
    +
    +get_settings(); + +// Social networds on single page is disabled +if(!isset($settings['social_network_status']) || !$settings['social_network_status']) return; + +$url = isset($event->data->permalink) ? $event->data->permalink : ''; +if(trim($url) == '') return; + +$socials = $this->get_social_networks(); +?> +
    + +
    + +
    +
    \ No newline at end of file diff --git a/app/modules/links/index.html b/app/modules/links/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/modules/links/list.php b/app/modules/links/list.php new file mode 100755 index 0000000..7b7e18e --- /dev/null +++ b/app/modules/links/list.php @@ -0,0 +1,23 @@ +get_settings(); + +// Social on single page is disabled +if(!isset($settings['social_network_status']) || !$settings['social_network_status']) return; + +$url = isset($event->data->permalink) ? $event->data->permalink : ''; +if(trim($url) == '') return; + +// Get social networks +$socials = $this->get_social_networks(); + +foreach($socials as $social) +{ + if(!isset($settings['sn'][$social['id']]) || !$settings['sn'][$social['id']]) continue; + if(is_callable($social['function'])) echo call_user_func($social['function'], $url, $event, $social); +} \ No newline at end of file diff --git a/app/modules/local-time/details.php b/app/modules/local-time/details.php new file mode 100755 index 0000000..f3977c8 --- /dev/null +++ b/app/modules/local-time/details.php @@ -0,0 +1,57 @@ +get_settings(); +$ml_settings = $this->get_ml_settings(); + +// The module is disabled +if(!isset($settings['local_time_module_status']) || !$settings['local_time_module_status']) return; + +// Get the visitor Timezone +$timezone = $this->get_timezone_by_ip(); + +// Timezone is not detected! +if(!$timezone) return; + +// Date Formats +$date_format1 = (isset($ml_settings['single_date_format1']) and trim($ml_settings['single_date_format1'])) ? $ml_settings['single_date_format1'] : 'M d Y'; +$time_format = get_option('time_format', 'H:i'); + +$occurrence = isset($_GET['occurrence']) ? sanitize_text_field($_GET['occurrence']) : ''; +$occurrence_end_date = trim($occurrence) ? $this->get_end_date_by_occurrence($event->data->ID, (isset($event->date['start']['date']) ? $event->date['start']['date'] : $occurrence)) : ''; + +$gmt_offset_seconds = $this->get_gmt_offset_seconds((trim($occurrence) ? $occurrence : $event->date['start']['date']), $event); + +$start_time_components = $this->get_time_components($event, 'start'); +$end_time_components = $this->get_time_components($event, 'end'); + +$gmt_start_time = strtotime((trim($occurrence) ? $occurrence : $start_time_components['date']).' '.sprintf("%02d", $start_time_components['hour']).':'.sprintf("%02d", $start_time_components['minutes']).' '.$start_time_components['ampm']) - $gmt_offset_seconds; +$gmt_end_time = strtotime((trim($occurrence_end_date) ? $occurrence_end_date : $end_time_components['date']).' '.sprintf("%02d", $end_time_components['hour']).':'.sprintf("%02d", $end_time_components['minutes']).' '.$end_time_components['ampm']) - $gmt_offset_seconds; + +$user_timezone = new DateTimeZone($timezone); +$gmt_timezone = new DateTimeZone('GMT'); +$gmt_datetime = new DateTime(date('Y-m-d H:i:s', $gmt_start_time), $gmt_timezone); +$offset = $user_timezone->getOffset($gmt_datetime); + +$user_start_time = $gmt_start_time + $offset; +$user_end_time = $gmt_end_time + $offset; + +$allday = isset($event->data->meta['mec_allday']) ? $event->data->meta['mec_allday'] : 0; +$hide_time = isset($event->data->meta['mec_hide_time']) ? $event->data->meta['mec_hide_time'] : 0; +$hide_end_time = $this->hide_end_time_status($event->ID); +?> +
    + display('clock') : ''); ?>

    +
      +
    • '.esc_html($timezone).''); ?>
    • +
    • date_label(array('date'=>date('Y-m-d', $user_start_time)), array('date'=>date('Y-m-d', $user_end_time)), $date_format1)); ?>
    • + +
    • '.($allday ? $this->m('all_day', esc_html__('All Day' , 'modern-events-calendar-lite')) : ($hide_end_time ? date($time_format, $user_start_time) : date($time_format, $user_start_time).' - '.date($time_format, $user_end_time))).''); ?>
    • + +
    +
    \ No newline at end of file diff --git a/app/modules/local-time/index.html b/app/modules/local-time/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/modules/local-time/type1.php b/app/modules/local-time/type1.php new file mode 100755 index 0000000..446258e --- /dev/null +++ b/app/modules/local-time/type1.php @@ -0,0 +1,54 @@ +get_settings(); +$ml_settings = $this->get_ml_settings(); + +// The module is disabled +if(!isset($settings['local_time_module_status']) || !$settings['local_time_module_status']) return; + +// Get the visitor Timezone +$timezone = $this->get_timezone_by_ip(); + +// Timezone is not detected! +if(!$timezone) return; + +$start_time = isset($event->data->time['start_raw']) ? $event->data->time['start_raw'] : ''; +$end_time = isset($event->data->time['end_raw']) ? $event->data->time['end_raw'] : ''; + +// Date Formats +$date_format1 = (isset($ml_settings['single_date_format1']) and trim($ml_settings['single_date_format1'])) ? $ml_settings['single_date_format1'] : 'M d Y'; +$time_format = get_option('time_format', 'H:i'); + +$gmt_offset_seconds = $this->get_gmt_offset_seconds($event->date['start']['date'], $event); + +$gmt_start_time = strtotime($event->date['start']['date'].' '.$start_time) - $gmt_offset_seconds; +$gmt_end_time = strtotime($event->date['end']['date'].' '.$end_time) - $gmt_offset_seconds; + +$user_timezone = new DateTimeZone($timezone); +$gmt_timezone = new DateTimeZone('GMT'); +$gmt_datetime = new DateTime(date('Y-m-d H:i:s', $gmt_start_time), $gmt_timezone); +$offset = $user_timezone->getOffset($gmt_datetime); + +$user_start_time = $gmt_start_time + $offset; +$user_end_time = $gmt_end_time + $offset; + +$allday = isset($event->data->meta['mec_allday']) ? $event->data->meta['mec_allday'] : 0; +$hide_time = isset($event->data->meta['mec_hide_time']) ? $event->data->meta['mec_hide_time'] : 0; +$hide_end_time = $this->hide_end_time_status($event->ID); +?> +
    + + + + +
    date_label(array('date'=>date('Y-m-d', $user_start_time)), array('date'=>date('Y-m-d', $user_end_time)), $date_format1)); ?>
    + +
    '.($allday ? $this->m('all_day', esc_html__('All Day' , 'modern-events-calendar-lite')) : ($hide_end_time ? date($time_format, $user_start_time) : date($time_format, $user_start_time).' - '.date($time_format, $user_end_time))).''); ?>
    + +
    \ No newline at end of file diff --git a/app/modules/local-time/type2.php b/app/modules/local-time/type2.php new file mode 100755 index 0000000..04c90fe --- /dev/null +++ b/app/modules/local-time/type2.php @@ -0,0 +1,88 @@ +get_settings(); +$ml_settings = $this->get_ml_settings(); + +// The module is disabled +if(!isset($settings['local_time_module_status']) || !$settings['local_time_module_status']) return; + +// Get the visitor Timezone +$timezone = $this->get_timezone_by_ip(); + +// Timezone is not detected! +if(!$timezone) return; + +$start_time = isset($event->data->time['start_raw']) ? $event->data->time['start_raw'] : ''; +$end_time = isset($event->data->time['end_raw']) ? $event->data->time['end_raw'] : ''; + +// Date Formats +$date_format1 = (isset($ml_settings['single_date_format1']) and trim($ml_settings['single_date_format1'])) ? $ml_settings['single_date_format1'] : 'M d Y'; +$time_format = get_option('time_format', 'H:i'); + +$gmt_offset_seconds = $this->get_gmt_offset_seconds($event->date['start']['date'], $event); + +/** + * TODO: Convert to class + */ +$event_id = $event->ID; + +global $MEC_Events_dates, $MEC_Events_dates_localtime, $MEC_Shortcode_id; +if(!isset($MEC_Events_dates_localtime[$MEC_Shortcode_id]) || empty($MEC_Events_dates_localtime[$MEC_Shortcode_id])) +{ + $MEC_Events_dates_localtime[$MEC_Shortcode_id] = $MEC_Events_dates; +} + +$dates = []; +if(isset($MEC_Events_dates_localtime[$MEC_Shortcode_id][$event_id]) && is_array($MEC_Events_dates_localtime[$MEC_Shortcode_id][$event_id])) +{ + $k = $this->array_key_first($MEC_Events_dates_localtime[$MEC_Shortcode_id][$event_id]); + if(isset($MEC_Events_dates_localtime[$MEC_Shortcode_id][$event_id][$k])) + { + $dates = $MEC_Events_dates_localtime[$MEC_Shortcode_id][$event_id][$k]; + $start_time = $dates['start']['time'] ?? $start_time; + $end_time = $dates['end']['time'] ?? $end_time; + + unset($MEC_Events_dates_localtime[$MEC_Shortcode_id][$event_id][$k]); + } +} + +$allday = isset($event->data->meta['mec_allday']) ? $event->data->meta['mec_allday'] : 0; +$hide_time = isset($event->data->meta['mec_hide_time']) ? $event->data->meta['mec_hide_time'] : 0; +$hide_end_time = $this->hide_end_time_status($event->ID); + +if($allday) +{ + $start_time = '00:00:01'; + $start_time = '23:59:59'; +} + +$start_date = ($dates['start']['date'] ?? $event->date['start']['date']); +$end_date = ($dates['end']['date'] ?? $event->date['end']['date']); + +$gmt_start_time = strtotime($start_date.' '.$start_time) - $gmt_offset_seconds; +$gmt_end_time = strtotime($end_date.' '.$end_time) - $gmt_offset_seconds; + +$user_timezone = new DateTimeZone($timezone); +$gmt_timezone = new DateTimeZone('GMT'); +$gmt_datetime = new DateTime(date('Y-m-d H:i:s', $gmt_start_time), $gmt_timezone); +$offset = $user_timezone->getOffset($gmt_datetime); + +$user_start_time = $gmt_start_time + $offset; +$user_end_time = $gmt_end_time + $offset; +?> +
    +
    + display('clock') : ''); ?> + +
    date_label(array('date'=>date('Y-m-d', $user_start_time)), array('date'=>date('Y-m-d', $user_end_time)), $date_format1)); ?>
    + +
    '.($allday ? $this->m('all_day', esc_html__('All Day' , 'modern-events-calendar-lite')) : ($hide_end_time ? date($time_format, $user_start_time) : date($time_format, $user_start_time).' - '.date($time_format, $user_end_time))).''); ?>
    + +
    +
    \ No newline at end of file diff --git a/app/modules/local-time/type3.php b/app/modules/local-time/type3.php new file mode 100755 index 0000000..69b22b3 --- /dev/null +++ b/app/modules/local-time/type3.php @@ -0,0 +1,52 @@ +get_settings(); +$ml_settings = $this->get_ml_settings(); + +// The module is disabled +if(!isset($settings['local_time_module_status']) || !$settings['local_time_module_status']) return; + +// Get the visitor Timezone +$timezone = $this->get_timezone_by_ip(); + +// Timezone is not detected! +if(!$timezone) return; + +$start_time = isset($event->data->time['start_raw']) ? $event->data->time['start_raw'] : ''; +$end_time = isset($event->data->time['end_raw']) ? $event->data->time['end_raw'] : ''; + +// Date Formats +$date_format1 = (isset($ml_settings['single_date_format1']) and trim($ml_settings['single_date_format1'])) ? $ml_settings['single_date_format1'] : 'M d Y'; +$time_format = get_option('time_format', 'H:i'); + +$gmt_offset_seconds = $this->get_gmt_offset_seconds($event->date['start']['date'], $event); + +$gmt_start_time = strtotime($event->date['start']['date'].' '.$start_time) - $gmt_offset_seconds; +$gmt_end_time = strtotime($event->date['end']['date'].' '.$end_time) - $gmt_offset_seconds; + +$user_timezone = new DateTimeZone($timezone); +$gmt_timezone = new DateTimeZone('GMT'); +$gmt_datetime = new DateTime(date('Y-m-d H:i:s', $gmt_start_time), $gmt_timezone); +$offset = $user_timezone->getOffset($gmt_datetime); + +$user_start_time = $gmt_start_time + $offset; +$user_end_time = $gmt_end_time + $offset; + +$allday = isset($event->data->meta['mec_allday']) ? $event->data->meta['mec_allday'] : 0; +$hide_time = isset($event->data->meta['mec_hide_time']) ? $event->data->meta['mec_hide_time'] : 0; +$hide_end_time = $this->hide_end_time_status($event->ID); +?> +
    +
    +
    date_label(array('date'=>date('Y-m-d', $user_start_time)), array('date'=>date('Y-m-d', $user_end_time)), $date_format1)); ?>
    + +
    '.($allday ? $this->m('all_day', esc_html__('All Day' , 'modern-events-calendar-lite')) : ($hide_end_time ? date($time_format, $user_start_time) : date($time_format, $user_start_time).' - '.date($time_format, $user_end_time))).''); ?>
    + +
    +
    \ No newline at end of file diff --git a/app/modules/next-event/details.php b/app/modules/next-event/details.php new file mode 100755 index 0000000..4b44ab6 --- /dev/null +++ b/app/modules/next-event/details.php @@ -0,0 +1,174 @@ +get_settings(); + +// The module is disabled +if(!isset($settings['next_event_module_status']) || !$settings['next_event_module_status']) return; + +// Next Event Method +$method = $settings['next_event_module_method'] ?? 'occurrence'; + +// Display Active Occurrence Button +$active_button = isset($settings['next_event_module_active_button']) && $settings['next_event_module_active_button']; + +// Multiple Occurrences +if($method == 'multiple') +{ + include MEC::import('app.modules.next-event.multiple', true, true); + return; +} + +// Date Format +$date_format1 = $settings['next_event_module_date_format1'] ?? 'M d Y'; + +$date = []; +if(!empty($event->date)) $date = $event->date; + +$start_date = (isset($date['start']) and isset($date['start']['date'])) ? $date['start']['date'] : date('Y-m-d'); +if(isset($_GET['occurrence']) and trim($_GET['occurrence'])) $start_date = sanitize_text_field($_GET['occurrence']); + +$next_date = []; +$next_time = []; + +// Show next occurrence from other events +if($method == 'event') +{ + $start_hour = (isset($date['start']) and isset($date['start']['hour'])) ? $date['start']['hour'] : 8; + $start_minutes = (isset($date['start']) and isset($date['start']['minutes'])) ? $date['start']['minutes'] : 0; + $start_ampm = (isset($date['start']) and isset($date['start']['ampm'])) ? $date['start']['ampm'] : 'AM'; + + $next = $this->get_next_event(array + ( + 'show_past_events'=>0, + 'sk-options'=>array + ( + 'list'=>array + ( + 'start_date_type'=>'date', + 'start_date'=>$start_date, + 'limit'=>1, + ) + ), + 'seconds_date'=>$start_date, + 'seconds'=>$this->time_to_seconds($this->to_24hours($start_hour, $start_ampm), $start_minutes), + 'exclude'=>array($event->ID), + 'include'=>NULL, + )); + + $p = get_post($event->ID); + setup_postdata($GLOBALS['post'] =& $p); + + // Nothing Found! + if(!isset($next->data)) return false; + + $next_date = $next->date; + $next_time = $next->data->time; +} +else +{ + // Nothing Found! + if(!isset($event->dates) || !is_array($event->dates) || !count($event->dates)) return false; + + $custom_days = false; + if(isset($event->data->meta['mec_repeat_type']) and $event->data->meta['mec_repeat_type'] === 'custom_days') $custom_days = true; + + if(isset($date['start']['hour']) and isset($date['start']['minutes']) and isset($date['start']['ampm'])) + { + $s_hour = $date['start']['hour']; + if(strtoupper($date['start']['ampm']) == 'AM' and $s_hour == '0') $s_hour = 12; + + $start_date .= ' '.sprintf("%02d", $s_hour).':'.sprintf("%02d", $date['start']['minutes']).' '.$date['start']['ampm']; + } + + $next = $event; + + // Occurrences + $found = false; + + foreach($event->dates as $occ) + { + $start_datetime = $occ['start']['date']; + if($custom_days) + { + $s_hour = $occ['start']['hour']; + if(strtoupper($occ['start']['ampm']) == 'AM' and $s_hour == '0') $s_hour = 12; + + $start_time = sprintf("%02d", $s_hour).':'.sprintf("%02d", $occ['start']['minutes']).' '.$occ['start']['ampm']; + $start_datetime .= ' '.$start_time; + } + + if(strtotime($start_datetime) > strtotime($start_date)) + { + $found = true; + $next_date = $occ; + $next_time = $next->data->time; + + if($custom_days) + { + $end_datetime = $occ['end']['date']; + $e_hour = $occ['end']['hour']; + if(strtoupper($occ['end']['ampm']) == 'AM' and $e_hour == '0') $e_hour = 12; + + $end_time = sprintf("%02d", $e_hour).':'.sprintf("%02d", $occ['end']['minutes']).' '.$occ['end']['ampm']; + $end_datetime .= ' '.$end_time; + + $next_time = array( + 'start' => $this->get_time(strtotime($start_datetime)), + 'end' => $this->get_time(strtotime($end_datetime)), + 'start_raw' => $start_time, + 'end_raw' => $end_time, + ); + } + + break; + } + } + + // Nothing Found! + if(!$found) return false; +} + +$time_comment = isset($next->data->meta['mec_comment']) ? $next->data->meta['mec_comment'] : ''; +$allday = isset($next->data->meta['mec_allday']) ? $next->data->meta['mec_allday'] : 0; + +$midnight_event = $this->is_midnight_event($next); +if($midnight_event) $next_date['end']['date'] = date('Y-m-d', strtotime('-1 Day', strtotime($next_date['end']['date']))); +?> +
    +
    +

    +
      +
    • + data->title); ?> +
    • +
    • + +
      +
      date_label($next_date['start'], ($next_date['end'] ?? NULL), $date_format1)); ?>
      +
    • + data->time) and trim($next->data->time['start'])): ?> +
    • + +
      + +
      + data->time) and trim($next->data->time['start'])): ?> +
      + +
      m('all_day', esc_html__('All Day' , 'modern-events-calendar-lite'))); ?>
      + +
      +
    • + +
    +
    + + + +
    \ No newline at end of file diff --git a/app/modules/next-event/index.html b/app/modules/next-event/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/modules/next-event/multiple.php b/app/modules/next-event/multiple.php new file mode 100755 index 0000000..5fa81ac --- /dev/null +++ b/app/modules/next-event/multiple.php @@ -0,0 +1,90 @@ +get_settings(); + +// The module is disabled +if(!isset($settings['next_event_module_status']) || !$settings['next_event_module_status']) return; + +// Next Event Method +$method = ($settings['next_event_module_method'] ?? 'occurrence'); +$maximum = (isset($settings['next_event_module_multiple_count']) ? (int) $settings['next_event_module_multiple_count'] : 10); + +// Display Active Occurrence Button +$active_button = isset($settings['next_event_module_active_button']) && $settings['next_event_module_active_button']; + +// Not Multiple Occurrences +if($method != 'multiple') +{ + include MEC::import('app.modules.next-event.details', true, true); + return; +} + +// Date Format +$date_format1 = $settings['next_event_module_date_format1'] ?? 'M d Y'; +$time_format = get_option('time_format'); + +$date = []; +if(!empty($event->date)) $date = $event->date; + +$occurrence = (isset($date['start']) and isset($date['start']['date'])) ? $date['start']['date'] : date('Y-m-d'); +if(isset($_GET['occurrence']) and trim($_GET['occurrence'])) $occurrence = sanitize_text_field($_GET['occurrence']); + +$occurrence_time = isset($_GET['time']) ? (int) sanitize_text_field($_GET['time']) : ''; + +// Event Dates +$dates = $this->get_event_next_occurrences($event, $occurrence, $maximum, $occurrence_time); + +MEC_feature_occurrences::fetch_single($event, $dates); + +// Midnight Event +$midnight = $this->is_midnight_event($event); + +// Remove Current Occurrence +if(is_array($date) and isset($date['start']) and isset($date['start']['timestamp']) and is_array($dates) and isset($dates[0]) and isset($dates[0]['start']) and isset($dates[0]['start']['timestamp']) and $dates[0]['start']['timestamp'] == $date['start']['timestamp']) unset($dates[0]); + +// Nothing Found! +if(!is_array($dates) || !count($dates)) return false; + +$time_comment = isset($event->data->meta['mec_comment']) ? $event->data->meta['mec_comment'] : ''; +$allday = isset($event->data->meta['mec_allday']) ? $event->data->meta['mec_allday'] : 0; +$hide_time = isset($event->data->meta['mec_hide_time']) ? $event->data->meta['mec_hide_time'] : 0; +$hide_end_time = $this->hide_end_time_status($event->ID); +?> + \ No newline at end of file diff --git a/app/modules/progress-bar/index.html b/app/modules/progress-bar/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/modules/progress-bar/single.php b/app/modules/progress-bar/single.php new file mode 100755 index 0000000..22f8d8a --- /dev/null +++ b/app/modules/progress-bar/single.php @@ -0,0 +1,59 @@ +get_settings(); + +// Module is not enabled +if(!isset($settings['progress_bar_status']) or !$settings['progress_bar_status']) return ''; + +$date = $event->date; + +$start_datetime = isset($date['start'], $date['start']['timestamp']) ? $date['start']['timestamp'] : null; +$end_datetime = isset($date['end'], $date['end']['timestamp']) ? $date['end']['timestamp'] : null; + +// Invalid Date & Time +if(!$start_datetime or !$end_datetime) return ''; + +$start = date('D M j Y G:i:s', $start_datetime); +$end = date('D M j Y G:i:s', $end_datetime); + +// Timezone +$TZO = $this->get_TZO($event); + +$d1 = new DateTime($start, $TZO); +$d2 = new DateTime('now', $TZO); +$d3 = new DateTime($end, $TZO); + +// Event is Finished +if($d3 < $d2) return ''; +// Event is not Started +elseif($d1 > $d2) return ''; + +$duration = $d3->getTimestamp() - $d1->getTimestamp(); +$passed = $d2->getTimestamp() - $d1->getTimestamp(); + +// Generating javascript code of countdown default module +$js = ''; + +if(!function_exists('is_plugin_active')) include_once ABSPATH . 'wp-admin/includes/plugin.php'; + +if($this->is_ajax() || is_plugin_active('mec-single-builder/mec-single-builder.php')) echo MEC_kses::full($js); +else $factory->params('footer', $js); +?> +
    + + + + +
    diff --git a/app/modules/qrcode/details.php b/app/modules/qrcode/details.php new file mode 100755 index 0000000..a6f54d1 --- /dev/null +++ b/app/modules/qrcode/details.php @@ -0,0 +1,41 @@ +getPRO()) return; + +// MEC Settings +$settings = $this->get_settings(); + +// The module is disabled +if(isset($settings['qrcode_module_status']) and !$settings['qrcode_module_status']) return; + +$url = get_post_permalink($event->ID); +if(isset($_REQUEST['occurrence'])) $url = $this->add_qs_var('occurrence', sanitize_text_field($_REQUEST['occurrence']), $url); + +$file_name = 'qr_'.md5($url).'.png'; + +$upload_dir = wp_upload_dir(); +$file_path = $upload_dir['basedir'] .DS. 'mec' .DS. $file_name; + +$file = $this->getFile(); +if(!$file->exists($file_path)) +{ + if(!$file->exists(dirname($file_path))) + { + $folder = $this->getFolder(); + $folder->create(dirname($file_path)); + } + + $QRcode = $this->getQRcode(); + $QRcode->png($url, $file_path, 'L', 4, 2); +} + +$image_url = $upload_dir['baseurl'].'/mec/'.$file_name; +?> +
    + <?php echo esc_html__('QR Code', 'modern-events-calendar-lite'); ?> +
    \ No newline at end of file diff --git a/app/modules/qrcode/index.html b/app/modules/qrcode/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/modules/qrcode/invoice.php b/app/modules/qrcode/invoice.php new file mode 100755 index 0000000..af1d9b2 --- /dev/null +++ b/app/modules/qrcode/invoice.php @@ -0,0 +1,35 @@ +getPRO()) return; + +// MEC Settings +$settings = $this->get_settings(); + +// The module is disabled +if(isset($settings['qrcode_module_status']) and !$settings['qrcode_module_status']) return; + +$url = get_post_permalink($event->ID); +$file_name = 'qr_'.md5($url).'.png'; + +$upload_dir = wp_upload_dir(); +$file_path = $upload_dir['basedir'] .DS. 'mec' .DS. $file_name; + +$file = $this->getFile(); +if(!$file->exists($file_path)) +{ + if(!$file->exists(dirname($file_path))) + { + $folder = $this->getFolder(); + $folder->create(dirname($file_path)); + } + + $QRcode = $this->getQRcode(); + $QRcode->png($url, $file_path, 'L', 4, 2); +} + +echo esc_html($file_path); \ No newline at end of file diff --git a/app/modules/speakers/details.php b/app/modules/speakers/details.php new file mode 100755 index 0000000..89794a5 --- /dev/null +++ b/app/modules/speakers/details.php @@ -0,0 +1,126 @@ +get_settings(); + +// The module is disabled +if(!isset($settings['speakers_status']) || !$settings['speakers_status']) return; + +// Event Speakers +$speakers = (isset($event->data->speakers) and is_array($event->data->speakers)) ? $event->data->speakers : []; + +// No Speaker +if(!count($speakers)) return false; + +$id_speaker_page = ""; +$name_speaker = ""; +foreach($speakers as $speaker) +{ + $id_speaker_page = $speaker['id']; + $name_speaker = $speaker['name']; + break; +} + +$type_link=$settings['advanced_speaker']['speaker_type_link']??'dialog'; +?> +
    +

    m('taxonomy_speaker', esc_html__('Speaker', 'modern-events-calendar-lite'))); else: echo esc_html($this->m('taxonomy_speakers', esc_html__('Speakers', 'modern-events-calendar-lite'))); endif; ?>

    + +
    diff --git a/app/modules/speakers/index.html b/app/modules/speakers/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/modules/sponsors/details.php b/app/modules/sponsors/details.php new file mode 100755 index 0000000..03d90bd --- /dev/null +++ b/app/modules/sponsors/details.php @@ -0,0 +1,45 @@ +getPRO()) return; + +// MEC Settings +$settings = $this->get_settings(); + +// The module is disabled +if(!isset($settings['sponsors_status']) || !$settings['sponsors_status']) return; + +// Event Sponsors +$sponsors = (isset($event->data->sponsors) and is_array($event->data->sponsors)) ? $event->data->sponsors : []; + +// No Sponsor +if(!count($sponsors)) return false; +?> +
    +

    m('taxonomy_sponsor', esc_html__('Sponsor', 'modern-events-calendar-lite'))); else: echo esc_html($this->m('taxonomy_sponsors', esc_html__('Sponsors', 'modern-events-calendar-lite'))); endif; ?>

    + +
    \ No newline at end of file diff --git a/app/modules/sponsors/index.html b/app/modules/sponsors/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/modules/weather/darksky.php b/app/modules/weather/darksky.php new file mode 100755 index 0000000..2c2f8ce --- /dev/null +++ b/app/modules/weather/darksky.php @@ -0,0 +1,71 @@ +date['start']['date']).' '.sprintf("%02d", $event->date['start']['hour']).':'.sprintf("%02d", $event->date['start']['minutes']).' '.$event->date['start']['ampm']; + +$weather = $this->get_weather_darksky($dark_sky, $lat, $lng, $date); +$imperial = (isset($settings['weather_module_imperial_units']) && $settings['weather_module_imperial_units']); + +// Weather not found! +if(!is_array($weather) || !count($weather)) return; +?> +
    +

    + + +
    + +
    +
    + +
    +
    + + +
    + + + +
    + + + weather_unit_convert($weather['temperature'], 'C_TO_F')); ?> + + +
    + + +
    + + + + + +
    + + +
    : weather_unit_convert($weather['windSpeed'], 'KM_TO_M')); ?>
    + + + +
    :
    + + + +
    : weather_unit_convert($weather['visibility'], 'KM_TO_M')); ?>
    + + +
    +
    + +
    + +
    \ No newline at end of file diff --git a/app/modules/weather/details.php b/app/modules/weather/details.php new file mode 100755 index 0000000..9526ade --- /dev/null +++ b/app/modules/weather/details.php @@ -0,0 +1,41 @@ +getPRO()) return; + +// MEC Settings +$settings = $this->get_settings(); + +// The module is disabled +if(!isset($settings['weather_module_status']) || !$settings['weather_module_status']) return; + +$dark_sky = (isset($settings['weather_module_api_key']) and trim($settings['weather_module_api_key'])) ? $settings['weather_module_api_key'] : ''; +$visual_crossing = (isset($settings['weather_module_vs_api_key']) and trim($settings['weather_module_vs_api_key'])) ? $settings['weather_module_vs_api_key'] : ''; +$weather_api = (isset($settings['weather_module_wa_api_key']) and trim($settings['weather_module_wa_api_key'])) ? $settings['weather_module_wa_api_key'] : ''; + +// No API key +if(!trim($dark_sky) and !trim($weather_api) and !trim($visual_crossing)) return; + +// Location ID +$location_id = $this->get_master_location_id($event); + +// Location is not Set +if(!$location_id) return; + +// Location +$location = $this->get_location_data($location_id); + +$lat = $location['latitude'] ?? 0; +$lng = $location['longitude'] ?? 0; + +// Cannot find the geo point +if(!$lat or !$lng) return; + +if(trim($weather_api)) include MEC::import('app.modules.weather.weatherapi', true, true); +elseif(trim($visual_crossing)) include MEC::import('app.modules.weather.visualcrossing', true, true); +elseif(trim($dark_sky)) include MEC::import('app.modules.weather.darksky', true, true); diff --git a/app/modules/weather/index.html b/app/modules/weather/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/modules/weather/visualcrossing.php b/app/modules/weather/visualcrossing.php new file mode 100755 index 0000000..a2ca347 --- /dev/null +++ b/app/modules/weather/visualcrossing.php @@ -0,0 +1,71 @@ +date['start']['date']).' '.sprintf("%02d", $event->date['start']['hour']).':'.sprintf("%02d", $event->date['start']['minutes']).' '.$event->date['start']['ampm']; + +$weather = $this->get_weather_visualcrossing($visual_crossing, $lat, $lng, $date); +$imperial = isset($settings['weather_module_imperial_units']) && $settings['weather_module_imperial_units']; + +// Weather not found! +if(!is_array($weather) || !count($weather)) return; +?> +
    +

    + + +
    + +
    +
    + +
    +
    + + +
    + + + +
    + + + weather_unit_convert($weather['temp'], 'C_TO_F')); ?> + + +
    + + +
    + + + + + +
    + + +
    : weather_unit_convert($weather['windspeed'], 'KM_TO_M')); ?>
    + + + +
    :
    + + + +
    : weather_unit_convert($weather['visibility'], 'KM_TO_M')); ?>
    + + +
    +
    + +
    + +
    \ No newline at end of file diff --git a/app/modules/weather/weatherapi.php b/app/modules/weather/weatherapi.php new file mode 100755 index 0000000..f81f9cc --- /dev/null +++ b/app/modules/weather/weatherapi.php @@ -0,0 +1,74 @@ +get_weather_wa($weather_api, $lat, $lng, $date); +$imperial = (isset($settings['weather_module_imperial_units']) && $settings['weather_module_imperial_units']); + +// Weather not found! +if(!is_array($weather) || !count($weather)) return; +?> +
    +

    + + +
    + +
    + + +
    + <?php echo esc_attr($weather['condition']['text']); ?> +
    + + +
    + + +
    + + + +
    + + + + + +
    + + +
    + + + + + +
    + + +
    :
    + + + +
    :
    + + + +
    :
    + + +
    +
    + +
    + +
    \ No newline at end of file diff --git a/app/skins/agenda.php b/app/skins/agenda.php new file mode 100755 index 0000000..23c4785 --- /dev/null +++ b/app/skins/agenda.php @@ -0,0 +1,292 @@ + + */ +class MEC_skin_agenda extends MEC_skins +{ + /** + * @var string + */ + public $skin = 'agenda'; + + public $date_format_clean_1; + public $date_format_clean_2; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + parent::__construct(); + + // MEC Render + $this->render = $this->getRender(); + } + + /** + * Registers skin actions into WordPress + * @author Webnus + */ + public function actions() + { + $this->factory->action('wp_ajax_mec_agenda_load_more', array($this, 'load_more')); + $this->factory->action('wp_ajax_nopriv_mec_agenda_load_more', array($this, 'load_more')); + } + + /** + * Initialize the skin + * @author Webnus + * @param array $atts + */ + public function initialize($atts) + { + $this->atts = $atts; + + // Skin Options + $this->skin_options = (isset($this->atts['sk-options']) and isset($this->atts['sk-options'][$this->skin])) ? $this->atts['sk-options'][$this->skin] : []; + + // Icons + $this->icons = $this->main->icons( + isset($this->atts['icons']) && is_array($this->atts['icons']) ? $this->atts['icons'] : [] + ); + + // Date Formats + $this->date_format_clean_1 = (isset($this->skin_options['clean_date_format1']) and trim($this->skin_options['clean_date_format1'])) ? $this->skin_options['clean_date_format1'] : 'l'; + $this->date_format_clean_2 = (isset($this->skin_options['clean_date_format2']) and trim($this->skin_options['clean_date_format2'])) ? $this->skin_options['clean_date_format2'] : 'F j'; + + // Search Form Options + $this->sf_options = (isset($this->atts['sf-options']) and isset($this->atts['sf-options'][$this->skin])) ? $this->atts['sf-options'][$this->skin] : []; + + // Search Form Status + $this->sf_status = $this->atts['sf_status'] ?? true; + $this->sf_display_label = $this->atts['sf_display_label'] ?? false; + $this->sf_reset_button = $this->atts['sf_reset_button'] ?? false; + $this->sf_refine = $this->atts['sf_refine'] ?? false; + + // Generate an ID for the sking + $this->id = $this->atts['id'] ?? mt_rand(100, 999); + + // Set the ID + if(!isset($this->atts['id'])) $this->atts['id'] = $this->id; + + // Show "Load More" button or not + $this->load_more_button = $this->skin_options['load_more_button'] ?? true; + + // Pagination + $this->pagination = $this->skin_options['pagination'] ?? (!$this->load_more_button ? '0' : 'loadmore'); + + // Show Month Divider or not + $this->month_divider = $this->skin_options['month_divider'] ?? true; + + // The style + $this->style = $this->skin_options['style'] ?? 'clean'; + if($this->style == 'fluent' and !is_plugin_active('mec-fluent-layouts/mec-fluent-layouts.php')) $this->style = 'clean'; + + // reason_for_cancellation + $this->reason_for_cancellation = $this->skin_options['reason_for_cancellation'] ?? false; + + // display_label + $this->display_label = $this->skin_options['display_label'] ?? false; + + // Override the style if the style forced by us in a widget etc + if(isset($this->atts['style']) and trim($this->atts['style']) != '') $this->style = $this->atts['style']; + + // HTML class + $this->html_class = ''; + if(isset($this->atts['html-class']) and trim($this->atts['html-class']) != '') $this->html_class = $this->atts['html-class']; + + // Booking Button + $this->booking_button = isset($this->skin_options['booking_button']) ? (int) $this->skin_options['booking_button'] : 0; + + // SED Method + $this->sed_method = $this->get_sed_method(); + + // Order Method + $this->order_method = (isset($this->skin_options['order_method']) and trim($this->skin_options['order_method'])) ? $this->skin_options['order_method'] : 'ASC'; + + // Image popup + $this->image_popup = $this->skin_options['image_popup'] ?? '0'; + + // From Widget + $this->widget = isset($this->atts['widget']) && trim($this->atts['widget']); + + // Init MEC + $this->args['mec-init'] = true; + $this->args['mec-skin'] = $this->skin; + + // Post Type + $this->args['post_type'] = $this->main->get_main_post_type(); + + // Post Status + $this->args['post_status'] = 'publish'; + + // Keyword Query + $this->args['s'] = $this->keyword_query(); + + // Taxonomy + $this->args['tax_query'] = $this->tax_query(); + + // Meta + $this->args['meta_query'] = $this->meta_query(); + + // Tag + if(apply_filters('mec_taxonomy_tag', '') === 'post_tag') $this->args['tag'] = $this->tag_query(); + + // Author + $this->args['author'] = $this->author_query(); + $this->args['author__not_in'] = $this->author_query_ex(); + + // Pagination Options + $this->paged = get_query_var('paged', 1); + $this->limit = (isset($this->skin_options['limit']) and trim($this->skin_options['limit'])) ? $this->skin_options['limit'] : 12; + + $this->args['posts_per_page'] = $this->limit; + $this->args['paged'] = $this->paged; + + // Sort Options + $this->args['orderby'] = 'mec_start_day_seconds ID'; + $this->args['order'] = (in_array($this->order_method, array('ASC', 'DESC')) ? $this->order_method : 'ASC'); + $this->args['meta_key'] = 'mec_start_day_seconds'; + + // Exclude Posts + if(isset($this->atts['exclude']) and is_array($this->atts['exclude']) and count($this->atts['exclude'])) $this->args['post__not_in'] = $this->atts['exclude']; + + // Include Posts + if(isset($this->atts['include']) and is_array($this->atts['include']) and count($this->atts['include'])) $this->args['post__in'] = $this->atts['include']; + + // Show Only Expired Events + $this->show_only_expired_events = (isset($this->atts['show_only_past_events']) and trim($this->atts['show_only_past_events'])) ? '1' : '0'; + + // Maximum Date Range. + $this->maximum_date_range = $this->get_end_date(); + + // Show Past Events + if($this->show_only_expired_events) + { + $this->atts['show_past_events'] = '1'; + $this->args['order'] = 'DESC'; + } + + // Show Past Events + $this->args['mec-past-events'] = isset($this->atts['show_past_events']) ? $this->atts['show_past_events'] : '0'; + + // Start Date + $this->start_date = $this->get_start_date(); + + // We will extend the end date in the loop + $this->end_date = $this->start_date; + + // Show Ongoing Events + $this->show_ongoing_events = (isset($this->atts['show_only_ongoing_events']) and trim($this->atts['show_only_ongoing_events'])) ? '1' : '0'; + if($this->show_ongoing_events) + { + $this->args['mec-show-ongoing-events'] = $this->show_ongoing_events; + $this->maximum_date = $this->start_date; + } + + // Include Ongoing Events + $this->include_ongoing_events = (isset($this->atts['show_ongoing_events']) and trim($this->atts['show_ongoing_events'])) ? '1' : '0'; + if($this->include_ongoing_events) $this->args['mec-include-ongoing-events'] = $this->include_ongoing_events; + + // Set start time + if(isset($this->atts['seconds'])) + { + $this->args['mec-seconds'] = $this->atts['seconds']; + $this->args['mec-seconds-date'] = $this->atts['seconds_date'] ?? $this->start_date; + } + + // Apply Maximum Date + $apply_sf_date = isset($_REQUEST['apply_sf_date']) ? sanitize_text_field($_REQUEST['apply_sf_date']) : 0; + $month = (isset($this->sf) && isset($this->sf['month']) && trim($this->sf['month'])) ? $this->sf['month'] : ($_REQUEST['mec_month'] ?? ''); + if($apply_sf_date == 1 and trim($month)) $this->maximum_date = date('Y-m-t', strtotime($this->start_date)); + + // Found Events + $this->found = 0; + } + + /** + * Returns start day of skin for filtering events + * @author Webnus + * @return string + */ + public function get_start_date() + { + // Default date + $date = current_time('Y-m-d'); + + if(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'today') $date = current_time('Y-m-d'); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'tomorrow') $date = date('Y-m-d', strtotime('Tomorrow')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'yesterday') $date = date('Y-m-d', strtotime('Yesterday')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_last_month') $date = date('Y-m-d', strtotime('first day of last month')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_current_month') $date = date('Y-m-d', strtotime('first day of this month')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_next_month') $date = date('Y-m-d', strtotime('first day of next month')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'date') $date = date('Y-m-d', strtotime($this->skin_options['start_date'])); + + // Hide past events + if(isset($this->atts['show_past_events']) and !trim($this->atts['show_past_events'])) + { + $today = current_time('Y-m-d'); + if(strtotime($date) < strtotime($today)) $date = $today; + } + + // Show only expired events + if(isset($this->show_only_expired_events) and $this->show_only_expired_events) + { + $now = date('Y-m-d H:i:s', current_time('timestamp')); + if(strtotime($date) > strtotime($now)) $date = $now; + } + + // MEC Next Page + if(isset($_REQUEST['mec_next_page']) and trim($_REQUEST['mec_next_page'])) + { + $ex = explode(':', $_REQUEST['mec_next_page']); + + if(strtotime($ex[0])) $date = $ex[0]; + if(isset($ex[1])) $this->offset = $ex[1]; + } + + return $date; + } + + /** + * Load more events for AJAX request + * @author Webnus + * @return void + */ + public function load_more() + { + $this->sf = (isset($_REQUEST['sf']) and is_array($_REQUEST['sf'])) ? $this->main->sanitize_deep_array($_REQUEST['sf']) : []; + $apply_sf_date = isset($_REQUEST['apply_sf_date']) ? sanitize_text_field($_REQUEST['apply_sf_date']) : 1; + $atts = $this->sf_apply(((isset($_REQUEST['atts']) and is_array($_REQUEST['atts'])) ? $this->main->sanitize_deep_array($_REQUEST['atts']) : array()), $this->sf, $apply_sf_date); + + // Initialize the skin + $this->initialize($atts); + + // Override variables + $this->start_date = isset($_REQUEST['mec_start_date']) ? sanitize_text_field($_REQUEST['mec_start_date']) : date('y-m-d'); + $this->end_date = $this->start_date; + $this->offset = isset($_REQUEST['mec_offset']) ? sanitize_text_field($_REQUEST['mec_offset']) : 0; + + // Apply Maximum Date + $month = (isset($this->sf['month']) && trim($this->sf['month'])) ? $this->sf['month'] : ($_REQUEST['mec_month'] ?? ''); + if($apply_sf_date == 1 and trim($month)) $this->maximum_date = date('Y-m-t', strtotime($this->start_date)); + + // Return the events + $this->atts['return_items'] = true; + $this->loading_more = true; + + // Fetch the events + $this->fetch(); + + // Return the output + $output = $this->output(); + + echo json_encode($output); + exit; + } +} diff --git a/app/skins/agenda/index.html b/app/skins/agenda/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/skins/agenda/render.php b/app/skins/agenda/render.php new file mode 100755 index 0000000..d185aeb --- /dev/null +++ b/app/skins/agenda/render.php @@ -0,0 +1,73 @@ +main->get_settings(); +$this->localtime = $this->skin_options['include_local_time'] ?? false; +$display_label = $this->skin_options['display_label'] ?? false; +$reason_for_cancellation = $this->skin_options['reason_for_cancellation'] ?? false; +?> +events as $date=>$events): ?> + + month_divider and $month_id != $current_month_divider): $current_month_divider = $month_id; ?> +
    main->date_i18n('F Y', strtotime($date))); ?>
    + +
    + +
    + icons->display('calendar'); ?> + main->date_i18n($this->date_format_clean_1, strtotime($date))); ?> + main->date_i18n($this->date_format_clean_2, strtotime($date))); ?> +
    + +
    + main->get_master_location_id($event); + $location = ($location_id ? $this->main->get_location_data($location_id) : array()); + + $organizer_id = $this->main->get_master_organizer_id($event); + $organizer = ($organizer_id ? $this->main->get_organizer_data($organizer_id) : array()); + + $start_time = (isset($event->data->time) ? $event->data->time['start'] : ''); + $end_time = (isset($event->data->time) ? $event->data->time['end'] : ''); + $event_color = $this->get_event_color_dot($event); + $event_start_date = !empty($event->date['start']['date']) ? $event->date['start']['date'] : ''; + + // MEC Schema + do_action('mec_schema', $event); + + if($this->style == 'clean'): ?> +
    + icons->display('clock'); ?> + + '.esc_html($start_time).''; + if(trim($end_time)) echo ' - '.esc_html($end_time).''; + } + ?> + + + display_link($event)); ?> + main->display_cancellation_reason($event, $reason_for_cancellation); ?> + main->get_flags($event).$event_color); ?> + get_label_captions($event, 'mec-fc-style')); ?> + data->ID); ?> + booking_button($event)); ?> + localtime) echo MEC_kses::full($this->main->module('local-time.type2', array('event' => $event))); ?> + + display_custom_data($event)); ?> + +
    + + +
    +
    +
    +get_render_path(); + +ob_start(); +include $render_path; +$items_html = ob_get_clean(); + +if(isset($this->atts['return_items']) and $this->atts['return_items']) +{ + echo json_encode(array('html' => $items_html, 'end_date' => $this->end_date, 'offset' => $this->next_offset, 'count' => $this->found, 'current_month_divider' => $current_month_divider, 'has_more_event' => (int) $this->has_more_events)); + exit; +} + +$sed_method = $this->sed_method; +if($sed_method == 'new') $sed_method = '0'; + +// Generating javascript code tpl +$javascript = ''; + +// Include javascript code into the page +if($this->main->is_ajax() or $this->main->preview()) echo MEC_kses::full($javascript); +else $this->factory->params('footer', $javascript); + +$styling = $this->main->get_styling(); +$event_colorskin = (isset($styling['mec_colorskin']) || isset($styling['color'])) ? 'colorskin-custom' : ''; + +$dark_mode = $styling['dark_mode'] ?? ''; +if($dark_mode == 1) $set_dark = 'mec-dark-mode'; +else $set_dark = ''; + +do_action('mec_start_skin', $this->id); +do_action('mec_agenda_skin_head'); +?> +
    + + sf_status) echo MEC_kses::full($this->sf_search_form()); ?> + + found): ?> +
    +
    +
    + +
    +
    +
    +
    + main->display_not_found_message(); ?> +
    + +
    + main->display_not_found_message(); ?> +
    + + + get_pagination_bar(); ?> + +
    +display_credit_url(); \ No newline at end of file diff --git a/app/skins/available_spot.php b/app/skins/available_spot.php new file mode 100755 index 0000000..c699bec --- /dev/null +++ b/app/skins/available_spot.php @@ -0,0 +1,122 @@ + + */ +class MEC_skin_available_spot extends MEC_skins +{ + /** + * @var string + */ + public $skin = 'available_spot'; + + public $event_id; + public $date_format1; + public $date_format2; + public $date_format_fluent_1; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + parent::__construct(); + } + + /** + * Registers skin actions into WordPress + * @author Webnus + */ + public function actions() + { + } + + /** + * Initialize the skin + * @author Webnus + * @param array $atts + */ + public function initialize($atts) + { + $this->atts = $atts; + $this->skin_options = (isset($this->atts['sk-options']) and isset($this->atts['sk-options'][$this->skin])) ? $this->atts['sk-options'][$this->skin] : []; + + // Icons + $this->icons = $this->main->icons( + isset($this->atts['icons']) && is_array($this->atts['icons']) ? $this->atts['icons'] : [] + ); + + $this->style = $this->skin_options['style'] ?? 'classic'; + + // Date Formats + $this->date_format1 = (isset($this->skin_options['date_format1']) and trim($this->skin_options['date_format1'])) ? $this->skin_options['date_format1'] : 'j'; + $this->date_format2 = (isset($this->skin_options['date_format2']) and trim($this->skin_options['date_format2'])) ? $this->skin_options['date_format2'] : 'F'; + + // Fluent view - Date Formats + $this->date_format_fluent_1 = (isset($this->skin_options['fluent_date_format1']) and trim($this->skin_options['fluent_date_format1'])) ? $this->skin_options['fluent_date_format1'] : 'F d'; + + // reason_for_cancellation + $this->reason_for_cancellation = $this->skin_options['reason_for_cancellation'] ?? false; + + // display_label + $this->display_label = $this->skin_options['display_label'] ?? false; + + // Search Form Status + $this->sf_status = false; + + $this->id = mt_rand(100, 999); + + // Set the ID + if(!isset($this->atts['id'])) $this->atts['id'] = $this->id; + + // HTML class + $this->html_class = ''; + if(isset($this->atts['html-class']) and trim($this->atts['html-class']) != '') $this->html_class = $this->atts['html-class']; + + // From Widget + $this->widget = isset($this->atts['widget']) && trim($this->atts['widget']); + + // Init MEC + $this->args['mec-skin'] = $this->skin; + + // Event ID + $this->event_id = $this->skin_options['event_id'] ?? '-1'; + if(!get_post($this->event_id)) $this->event_id = '-1'; + + do_action('mec-available-spot-initialize-end', $this); + } + + /** + * Search and returns the filtered events + * @author Webnus + * @return array of objects + */ + public function search() + { + $events = []; + + // Get next upcoming event ID + if($this->event_id == '-1') + { + $events[] = $this->main->get_next_upcoming_event(); + } + else + { + $rendered = $this->render->data($this->event_id, ($this->atts['content'] ?? '')); + + $data = new stdClass(); + $data->ID = $this->event_id; + $data->data = $rendered; + $data->dates = $this->render->dates($this->event_id, $rendered, $this->maximum_dates); + $data->date = $data->dates[0] ?? []; + + $events[] = $this->render->after_render($data, $this); + } + + return $events; + } +} diff --git a/app/skins/available_spot/index.html b/app/skins/available_spot/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/skins/available_spot/tpl.php b/app/skins/available_spot/tpl.php new file mode 100755 index 0000000..b0c211c --- /dev/null +++ b/app/skins/available_spot/tpl.php @@ -0,0 +1,212 @@ +main->get_styling(); +$event = $this->events[0]; +$settings = $this->main->get_settings(); +$this->localtime = $this->skin_options['include_local_time'] ?? false; +$display_label = $this->skin_options['display_label'] ?? false; +$reason_for_cancellation = $this->skin_options['reason_for_cancellation'] ?? false; + +$dark_mode = $styling['dark_mode'] ?? ''; +if($dark_mode == 1) $set_dark = 'mec-dark-mode'; +else $set_dark = ''; + +// Event is not valid! +if(!isset($event->data)) return; + +$event_colorskin = (isset($styling['mec_colorskin']) || isset($styling['color'])) ? 'colorskin-custom' : ''; + +$location_id = $this->main->get_master_location_id($event); +$event_location = ($location_id ? $this->main->get_location_data($location_id) : array()); + +$organizer_id = $this->main->get_master_organizer_id($event); +$event_organizer = ($organizer_id ? $this->main->get_organizer_data($organizer_id) : array()); + +$event_date = (isset($event->date['start']) ? $event->date['start']['date'] : $event->data->meta['mec_start_date']); +$event_thumb_url = $event->data->featured_image['large']; +$start_date = (isset($event->date['start']) and isset($event->date['start']['date'])) ? $event->date['start']['date'] : date('Y-m-d H:i:s'); +$end_date = (isset($event->date['end']) and isset($event->date['end']['date'])) ? $event->date['end']['date'] : date('Y-m-d H:i:s'); + +$event_time = ''; +if(isset($event->data->time['start_raw'])) $event_time = $event->data->time['start_raw']; +else +{ + $event_time .= sprintf("%02d", ($event->data->meta['mec_date']['start']['hour'] ?? 8)).':'; + $event_time .= sprintf("%02d", ($event->data->meta['mec_date']['start']['minutes'] ?? 0)); + $event_time .= ($event->data->meta['mec_date']['start']['ampm'] ?? 'AM'); +} + +$event_etime = ''; +if(isset($event->data->time['end_raw'])) $event_etime = $event->data->time['end_raw']; +else +{ + $event_etime .= sprintf("%02d", ($event->data->meta['mec_date']['end']['hour'] ?? 6)).':'; + $event_etime .= sprintf("%02d", ($event->data->meta['mec_date']['end']['minutes'] ?? 0)); + $event_etime .= ($event->data->meta['mec_date']['end']['ampm'] ?? 'PM'); +} + +$event_start_date = !empty($event->date['start']['date']) ? $event->date['start']['date'] : ''; + +$start_time = date('D M j Y G:i:s', strtotime($start_date.' '.date('H:i:s', strtotime($event_time)))); +$end_time = date('D M j Y G:i:s', strtotime($end_date.' '.date('H:i:s', strtotime($event_etime)))); + +$d1 = new DateTime($start_time); +$d2 = new DateTime(current_time("D M j Y G:i:s")); +$d3 = new DateTime($end_time); + +$ongoing = (isset($settings['hide_time_method']) and trim($settings['hide_time_method']) == 'end'); + +// Skip if event is expired +if($ongoing) if($d3 < $d2) $ongoing = false; +if($d1 < $d2 and !$ongoing) return; + +$gmt_offset = $this->main->get_gmt_offset($event, strtotime($start_date)); +if(isset($_SERVER['HTTP_USER_AGENT']) and strpos($_SERVER['HTTP_USER_AGENT'], 'Safari') === false) $gmt_offset = ' : '.$gmt_offset; +if(isset($_SERVER['HTTP_USER_AGENT']) and strpos($_SERVER['HTTP_USER_AGENT'], 'Edge') == true) $gmt_offset = ''; + +// Generating javascript code of countdown module +$javascript = ''; + +// Include javascript code into the page +if($this->main->is_ajax() or $this->main->preview()) echo MEC_kses::full($javascript); +else $this->factory->params('footer', $javascript); + +$occurrence_time = $event->date['start']['timestamp'] ?? strtotime($event->date['start']['date']); + +$book = $this->getBook(); +$availability = $book->get_tickets_availability($event->data->ID, $occurrence_time); +$event_color = $this->get_event_color_dot($event); + +$spots = 0; +$total_spots = -1; +foreach($availability as $ticket_id=>$count) +{ + if(!is_numeric($ticket_id)) + { + $total_spots = $count; + continue; + } + + if($count != '-1') $spots += $count; + else + { + $spots = -1; + break; + } +} + +if($total_spots >= 0) $spots = min($spots, $total_spots); + +do_action('mec_start_skin', $this->id); +do_action('mec_available_spot_skin_head'); +?> +
    +
    + +
    +
    + + +
    + + + get_label_captions($event)); ?> + +
    +
    +
    +
    +
    +
    +
      +
    • + 00 +

      +
    • +
    • + 00 +

      +
    • +
    • + 00 +

      +
    • +
    • + 00 +

      +
    • +
    +
    +
    +
    + +
    + +
    +
    +
    main->date_i18n($this->date_format1, strtotime($event_date))); ?>
    +
    main->date_i18n($this->date_format2, strtotime($event_date))); ?>
    +
    data->time) and isset($event->data->time['start'])) ? esc_html($event->data->time['start']) : ''; ?>data->time) and isset($event->data->time['end']) and trim($event->data->time['end'])) ? esc_html(' - '.$event->data->time['end']) : ''; ?>
    + localtime) echo MEC_kses::full($this->main->module('local-time.type3', array('event' => $event))); ?> +
    +
    + +
    + icons->display('location-pin'); ?> +
    +
    +
    +
    +
    + +
    +
    +
    +

    display_link($event)); ?>main->get_flags($event).$event_color); ?>

    + main->get_normal_labels($event, $display_label).$this->main->display_cancellation_reason($event, $reason_for_cancellation)); ?> + data->ID ); ?> + data->post); + + // Safe Excerpt for UTF-8 Strings + if(!trim($excerpt)) + { + $ex = explode(' ', strip_tags(strip_shortcodes($event->data->post->post_content))); + $words = array_slice($ex, 0, 30); + + $excerpt = implode(' ', $words); + } + ?> +
    +

    +
    +
    + +
    +
    +
    + +
    + display_credit_url(); ?> +
    diff --git a/app/skins/carousel.php b/app/skins/carousel.php new file mode 100755 index 0000000..7e48d0e --- /dev/null +++ b/app/skins/carousel.php @@ -0,0 +1,253 @@ + + */ +class MEC_skin_carousel extends MEC_skins +{ + /** + * @var string + */ + public $skin = 'carousel'; + public $date_format_type1_1; + public $date_format_type1_2; + public $date_format_type1_3; + public $date_format_type2_1; + public $date_format_type3_1; + public $archive_link; + public $head_text; + public $autoplay; + public $autoplay_status; + public $loop; + public $count_tablet; + public $count_mobile; + public $navigation; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + parent::__construct(); + } + + /** + * Registers skin actions into WordPress + * @author Webnus + */ + public function actions() + { + } + + /** + * Initialize the skin + * @author Webnus + * @param array $atts + */ + public function initialize($atts) + { + $this->atts = $atts; + + // Skin Options + $this->skin_options = (isset($this->atts['sk-options']) and isset($this->atts['sk-options'][$this->skin])) ? $this->atts['sk-options'][$this->skin] : []; + + // Icons + $this->icons = $this->main->icons( + isset($this->atts['icons']) && is_array($this->atts['icons']) ? $this->atts['icons'] : [] + ); + + // Date Formats + $this->date_format_type1_1 = (isset($this->skin_options['type1_date_format1']) and trim($this->skin_options['type1_date_format1'])) ? $this->skin_options['type1_date_format1'] : 'd'; + $this->date_format_type1_2 = (isset($this->skin_options['type1_date_format2']) and trim($this->skin_options['type1_date_format2'])) ? $this->skin_options['type1_date_format2'] : 'F'; + $this->date_format_type1_3 = (isset($this->skin_options['type1_date_format3']) and trim($this->skin_options['type1_date_format3'])) ? $this->skin_options['type1_date_format3'] : 'Y'; + + $this->date_format_type2_1 = (isset($this->skin_options['type2_date_format1']) and trim($this->skin_options['type2_date_format1'])) ? $this->skin_options['type2_date_format1'] : 'M d, Y'; + $this->date_format_type3_1 = (isset($this->skin_options['type3_date_format1']) and trim($this->skin_options['type3_date_format1'])) ? $this->skin_options['type3_date_format1'] : 'M d, Y'; + + // Search Form Status + $this->sf_status = false; + + $this->navigation = isset($this->skin_options['navigation']) && $this->skin_options['navigation']; + + // Generate an ID for the sking + $this->id = $this->atts['id'] ?? mt_rand(100, 999); + + // Set the ID + if(!isset($this->atts['id'])) $this->atts['id'] = $this->id; + + // The style + $this->style = $this->skin_options['style'] ?? 'type1'; + if($this->style == 'fluent' and !is_plugin_active('mec-fluent-layouts/mec-fluent-layouts.php')) $this->style = 'type1'; + + // The archive link + $this->archive_link = $this->skin_options['archive_link'] ?? ''; + + // The Head text + $this->head_text = $this->skin_options['head_text'] ?? ''; + + // Auto Play + $this->autoplay_status = !isset($this->skin_options['autoplay_status']) || trim($this->skin_options['autoplay_status']); + $this->autoplay = (isset($this->skin_options['autoplay']) and trim($this->skin_options['autoplay'])) ? $this->skin_options['autoplay'] : 3000; + + // Loop + $this->loop = !isset($this->skin_options['loop_status']) || trim($this->skin_options['loop_status']); + + // Override the style if the style forced by us in a widget etc + if(isset($this->atts['style']) and trim($this->atts['style']) != '') $this->style = $this->atts['style']; + + // HTML class + $this->html_class = ''; + if(isset($this->atts['html-class']) and trim($this->atts['html-class']) != '') $this->html_class = $this->atts['html-class']; + + // Booking Button + $this->booking_button = isset($this->skin_options['booking_button']) ? (int) $this->skin_options['booking_button'] : 0; + + // SED Method + $this->sed_method = $this->get_sed_method(); + + // Image popup + $this->image_popup = $this->skin_options['image_popup'] ?? '0'; + + // reason_for_cancellation + $this->reason_for_cancellation = $this->skin_options['reason_for_cancellation'] ?? false; + + // Event Times + $this->include_events_times = $this->skin_options['include_events_times'] ?? false; + $this->localtime = $this->skin_options['include_local_time'] ?? false; + + // display_label + $this->display_label = $this->skin_options['display_label'] ?? false; + + // From Widget + $this->widget = isset($this->atts['widget']) && trim($this->atts['widget']); + if($this->widget) + { + $this->skin_options['count'] = '1'; + } + + // The count in row + $this->count = $this->skin_options['count'] ?? '3'; + $this->count_tablet = $this->skin_options['count_tablet'] ?? '2'; + $this->count_mobile = $this->skin_options['count_mobile'] ?? '1'; + + // Init MEC + $this->args['mec-init'] = true; + $this->args['mec-skin'] = $this->skin; + + // Post Type + $this->args['post_type'] = $this->main->get_main_post_type(); + + // Post Status + $this->args['post_status'] = 'publish'; + + // Keyword Query + $this->args['s'] = $this->keyword_query(); + + // Taxonomy + $this->args['tax_query'] = $this->tax_query(); + + // Meta + $this->args['meta_query'] = $this->meta_query(); + + // Tag + if(apply_filters('mec_taxonomy_tag', '') === 'post_tag') $this->args['tag'] = $this->tag_query(); + + // Author + $this->args['author'] = $this->author_query(); + $this->args['author__not_in'] = $this->author_query_ex(); + + // Pagination Options + $this->paged = get_query_var('paged', 1); + $this->limit = (isset($this->skin_options['limit']) and trim($this->skin_options['limit'])) ? $this->skin_options['limit'] : 12; + + $this->args['posts_per_page'] = $this->limit; + $this->args['paged'] = $this->paged; + + // Sort Options + $this->args['orderby'] = 'mec_start_day_seconds ID'; + $this->args['order'] = 'ASC'; + $this->args['meta_key'] = 'mec_start_day_seconds'; + + // Show Only Expired Events + $this->show_only_expired_events = (isset($this->atts['show_only_past_events']) and trim($this->atts['show_only_past_events'])) ? '1' : '0'; + + // Show Past Events + if($this->show_only_expired_events) + { + $this->atts['show_past_events'] = '1'; + $this->args['order'] = 'DESC'; + } + + // Show Past Events + $this->args['mec-past-events'] = $this->atts['show_past_events'] ?? '0'; + + // Start Date + $this->start_date = $this->get_start_date(); + + // We will extend the end date in the loop + $this->end_date = $this->start_date; + + // Show Ongoing Events + $this->show_ongoing_events = (isset($this->atts['show_only_ongoing_events']) and trim($this->atts['show_only_ongoing_events'])) ? '1' : '0'; + if($this->show_ongoing_events) + { + $this->args['mec-show-ongoing-events'] = $this->show_ongoing_events; + if((strpos($this->style, 'fluent') === false && strpos($this->style, 'liquid') === false)) + { + $this->maximum_date = $this->start_date; + } + } + + // Include Ongoing Events + $this->include_ongoing_events = (isset($this->atts['show_ongoing_events']) and trim($this->atts['show_ongoing_events'])) ? '1' : '0'; + if($this->include_ongoing_events) $this->args['mec-include-ongoing-events'] = $this->include_ongoing_events; + + // Apply Maximum Date + $apply_sf_date = isset($_REQUEST['apply_sf_date']) ? sanitize_text_field($_REQUEST['apply_sf_date']) : 0; + if($apply_sf_date == 1) $this->maximum_date = date('Y-m-t', strtotime($this->start_date)); + + // Found Events + $this->found = 0; + + do_action('mec-carousel-initialize-end', $this); + } + + /** + * Returns start day of skin for filtering events + * @author Webnus + * @return string + */ + public function get_start_date() + { + // Default date + $date = current_time('Y-m-d'); + + if(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'today') $date = current_time('Y-m-d'); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'tomorrow') $date = date('Y-m-d', strtotime('Tomorrow')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'yesterday') $date = date('Y-m-d', strtotime('Yesterday')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_last_month') $date = date('Y-m-d', strtotime('first day of last month')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_current_month') $date = date('Y-m-d', strtotime('first day of this month')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_next_month') $date = date('Y-m-d', strtotime('first day of next month')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'date') $date = date('Y-m-d', strtotime($this->skin_options['start_date'])); + + // Hide past events + if(isset($this->atts['show_past_events']) and !trim($this->atts['show_past_events'])) + { + $today = current_time('Y-m-d'); + if(strtotime($date) < strtotime($today)) $date = $today; + } + + // Show only expired events + if(isset($this->show_only_expired_events) and $this->show_only_expired_events) + { + $now = date('Y-m-d H:i:s', current_time('timestamp', 0)); + if(strtotime($date) > strtotime($now)) $date = $now; + } + + return $date; + } +} diff --git a/app/skins/carousel/index.html b/app/skins/carousel/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/skins/carousel/render.php b/app/skins/carousel/render.php new file mode 100755 index 0000000..8f77faf --- /dev/null +++ b/app/skins/carousel/render.php @@ -0,0 +1,192 @@ +main->get_styling(); +$event_colorskin = (isset($styling['mec_colorskin']) or isset($styling['color'])) ? 'colorskin-custom' : ''; +$settings = $this->main->get_settings(); +$display_label = isset($this->skin_options['display_label']) ? $this->skin_options['display_label'] : false; +$reason_for_cancellation = isset($this->skin_options['reason_for_cancellation']) ? $this->skin_options['reason_for_cancellation'] : false; +?> +
    + +
    \ No newline at end of file diff --git a/app/skins/carousel/tpl.php b/app/skins/carousel/tpl.php new file mode 100755 index 0000000..3e27c7d --- /dev/null +++ b/app/skins/carousel/tpl.php @@ -0,0 +1,67 @@ +get_render_path(); +$styling = $this->main->get_styling(); + +$dark_mode = $styling['dark_mode'] ?? ''; +if($dark_mode == 1) $set_dark = 'mec-dark-mode'; +else $set_dark = ''; + +ob_start(); +include $render_path; +$items_html = ob_get_clean(); + +// Include OWL Assets +$this->main->load_owl_assets(); + +$sed_method = $this->sed_method; +if($sed_method == 'new') $sed_method = '0'; + +// Generating javascript code tpl +$loop = ($this->found > 1 ? $this->loop : false); +$javascript = ''; + +// Include javascript code into the page +if($this->main->is_ajax() or $this->main->preview()) echo MEC_kses::full($javascript); +else $this->factory->params('footer', $javascript); + +do_action('mec_start_skin', $this->id); +do_action('mec_carousel_skin_head'); +?> + \ No newline at end of file diff --git a/app/skins/countdown.php b/app/skins/countdown.php new file mode 100755 index 0000000..b5e2460 --- /dev/null +++ b/app/skins/countdown.php @@ -0,0 +1,132 @@ + + */ +class MEC_skin_countdown extends MEC_skins +{ + /** + * @var string + */ + public $skin = 'countdown'; + + public $event_id; + public $date_format_style11; + public $date_format_style21; + public $date_format_style31; + public $date_format_style32; + public $date_format_style33; + public $bg_color; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + parent::__construct(); + } + + /** + * Registers skin actions into WordPress + * @author Webnus + */ + public function actions() + { + } + + /** + * Initialize the skin + * @author Webnus + * @param array $atts + */ + public function initialize($atts) + { + $this->atts = $atts; + $this->skin_options = (isset($this->atts['sk-options']) and isset($this->atts['sk-options'][$this->skin])) ? $this->atts['sk-options'][$this->skin] : []; + + // Icons + $this->icons = $this->main->icons( + isset($this->atts['icons']) && is_array($this->atts['icons']) ? $this->atts['icons'] : [] + ); + + // Date Formats + $this->date_format_style11 = (isset($this->skin_options['date_format_style11']) and trim($this->skin_options['date_format_style11'])) ? $this->skin_options['date_format_style11'] : 'j F Y'; + $this->date_format_style21 = (isset($this->skin_options['date_format_style21']) and trim($this->skin_options['date_format_style21'])) ? $this->skin_options['date_format_style21'] : 'j F Y'; + + $this->date_format_style31 = (isset($this->skin_options['date_format_style31']) and trim($this->skin_options['date_format_style31'])) ? $this->skin_options['date_format_style31'] : 'd'; + $this->date_format_style32 = (isset($this->skin_options['date_format_style32']) and trim($this->skin_options['date_format_style32'])) ? $this->skin_options['date_format_style32'] : 'F'; + $this->date_format_style33 = (isset($this->skin_options['date_format_style33']) and trim($this->skin_options['date_format_style33'])) ? $this->skin_options['date_format_style33'] : 'Y'; + + // Background Color + $this->bg_color = (isset($this->skin_options['bg_color']) and trim($this->skin_options['bg_color'])) ? $this->skin_options['bg_color'] : '#437df9'; + + // Search Form Status + $this->sf_status = false; + + $this->id = mt_rand(100, 999); + + // Set the ID + if(!isset($this->atts['id'])) $this->atts['id'] = $this->id; + + // The style + $this->style = $this->skin_options['style'] ?? 'style1'; + if($this->style == 'fluent' and !is_plugin_active('mec-fluent-layouts/mec-fluent-layouts.php')) $this->style = 'style1'; + + // reason_for_cancellation + $this->reason_for_cancellation = $this->skin_options['reason_for_cancellation'] ?? false; + + // display_label + $this->display_label = $this->skin_options['display_label'] ?? false; + + // Override the style if the style forced by us in a widget etc + if(isset($this->atts['style']) and trim($this->atts['style']) != '') $this->style = $this->atts['style']; + + // HTML class + $this->html_class = ''; + if(isset($this->atts['html-class']) and trim($this->atts['html-class']) != '') $this->html_class = $this->atts['html-class']; + + // From Widget + $this->widget = isset($this->atts['widget']) && trim($this->atts['widget']); + + // Init MEC + $this->args['mec-skin'] = $this->skin; + + // Event ID + $this->event_id = $this->skin_options['event_id'] ?? '-1'; + if(!get_post($this->event_id)) $this->event_id = '-1'; + } + + /** + * Search and returns the filtered events + * @author Webnus + * @return array of objects + */ + public function search() + { + $events = []; + + // Get next upcoming event ID + if($this->event_id == '-1') + { + $events[] = $this->main->get_next_upcoming_event(); + } + else + { + $rendered = $this->render->data($this->event_id, ($this->atts['content'] ?? '')); + + $data = new stdClass(); + $data->ID = $this->event_id; + $data->data = $rendered; + $data->dates = $this->render->dates($this->event_id, $rendered, $this->maximum_dates); + $data->date = $data->dates[0] ?? []; + + $events[] = $this->render->after_render($data, $this); + } + + return $events; + } +} diff --git a/app/skins/countdown/index.html b/app/skins/countdown/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/skins/countdown/tpl.php b/app/skins/countdown/tpl.php new file mode 100755 index 0000000..5aab534 --- /dev/null +++ b/app/skins/countdown/tpl.php @@ -0,0 +1,251 @@ +main->get_styling(); +$event = $this->events[0]; +$settings = $this->main->get_settings(); +$this->localtime = $this->skin_options['include_local_time'] ?? false; +$display_label = $this->skin_options['display_label'] ?? false; +$reason_for_cancellation = $this->skin_options['reason_for_cancellation'] ?? false; + +$dark_mode = $styling['dark_mode'] ?? ''; +if($dark_mode == 1) $set_dark = 'mec-dark-mode'; +else $set_dark = ''; + +// Event is not valid! +if(!isset($event->data)) return; + +$event_colorskin = (isset($styling['mec_colorskin']) || isset($styling['color'])) ? 'colorskin-custom' : ''; + +$location_id = $this->main->get_master_location_id($event); +$event_location = ($location_id ? $this->main->get_location_data($location_id) : array()); + +$organizer_id = $this->main->get_master_organizer_id($event); +$event_organizer = ($organizer_id ? $this->main->get_organizer_data($organizer_id) : array()); + +$event_date = (isset($event->date['start']) ? $event->date['start']['date'] : $event->data->meta['mec_start_date']); +$event_title = apply_filters('mec_occurrence_event_title', $event->data->title, $event); + +$start_date = (isset($event->date['start']) and isset($event->date['start']['date'])) ? $event->date['start']['date'] : date('Y-m-d H:i:s'); +$end_date = (isset($event->date['end']) and isset($event->date['end']['date'])) ? $event->date['end']['date'] : date('Y-m-d H:i:s'); + +$event_time = ''; +if(isset($event->data->time['start_raw'])) $event_time = $event->data->time['start_raw']; +else +{ + $event_time .= sprintf("%02d", ($event->data->meta['mec_date']['start']['hour'] ?? 8)).':'; + $event_time .= sprintf("%02d", ($event->data->meta['mec_date']['start']['minutes'] ?? 0)); + $event_time .= ($event->data->meta['mec_date']['start']['ampm'] ?? 'AM'); +} + +$event_etime = ''; +if(isset($event->data->time['end_raw'])) $event_etime = $event->data->time['end_raw']; +else +{ + $event_etime .= sprintf("%02d", ($event->data->meta['mec_date']['end']['hour'] ?? 6)).':'; + $event_etime .= sprintf("%02d", ($event->data->meta['mec_date']['end']['minutes'] ?? 0)); + $event_etime .= ($event->data->meta['mec_date']['end']['ampm'] ?? 'PM'); +} + +$start_time = date('D M j Y G:i:s', strtotime($start_date.' '.date('H:i:s', strtotime($event_time)))); +$end_time = date('D M j Y G:i:s', strtotime($end_date.' '.date('H:i:s', strtotime($event_etime)))); + +// Timezone +$TZO = $this->main->get_TZO($event); + +$d1 = new DateTime($start_time, $TZO); +$d2 = new DateTime(current_time("D M j Y G:i:s"), $TZO); +$d3 = new DateTime($end_time, $TZO); + +$countdown_method = get_post_meta($event->ID, 'mec_countdown_method', true); +if(trim($countdown_method) == '') $countdown_method = 'global'; + +if($countdown_method == 'global') $ongoing = (isset($settings['hide_time_method']) and trim($settings['hide_time_method']) == 'end'); +else $ongoing = $countdown_method == 'end'; + +if($ongoing and $d3 < $d2) $ongoing = false; + +// Skip if event is ongoing +if($d1 < $d2 and !$ongoing) return; + +$gmt_offset = $this->main->get_gmt_offset($event, strtotime($start_date)); +if(isset($_SERVER['HTTP_USER_AGENT']) and strpos($_SERVER['HTTP_USER_AGENT'], 'Safari') === false) $gmt_offset = ' : '.$gmt_offset; +if(isset($_SERVER['HTTP_USER_AGENT']) and strpos($_SERVER['HTTP_USER_AGENT'], 'Edge') == true) $gmt_offset = substr(trim($gmt_offset), 0 , 3); +if(isset($_SERVER['HTTP_USER_AGENT']) and strpos($_SERVER['HTTP_USER_AGENT'], 'Trident') == true) $gmt_offset = substr(trim($gmt_offset), 2 , 3); + +// Generating javascript code of countdown module +$javascript = ''; + +// Include javascript code into the page +if($this->main->is_ajax() or $this->main->preview()) echo MEC_kses::full($javascript); +else $this->factory->params('footer', $javascript); + +do_action('mec_start_skin', $this->id); +do_action('mec_countdown_skin_head'); +?> + +
    +style == 'style1'): ?> +
    +
    +
    '.esc_html__('Next', 'modern-events-calendar-lite').''); ?>
    +

    main->get_flags($event)); ?> get_label_captions($event ,'mec-fc-style')); ?>

    + main->get_normal_labels($event, $display_label).$this->main->display_cancellation_reason($event, $reason_for_cancellation)); ?>data->ID ); ?> +
    +
    +
    +
    main->date_i18n($this->date_format_style11, strtotime($event_date))); ?>
    +
    +
    +
    +
      +
    • + 00 +

      +
    • +
    • + 00 +

      +
    • +
    • + 00 +

      +
    • +
    • + 00 +

      +
    • +
    +
    + localtime) echo MEC_kses::full($this->main->module('local-time.type3', array('event' => $event))); ?> +
    +
    + display_link($event, $this->main->m('event_detail', esc_html__('EVENT DETAIL', 'modern-events-calendar-lite')), 'mec-event-button')); ?> +
    +
    +
    + style == 'style2'): ?> +
    +
    +
    '.esc_html__('Next', 'modern-events-calendar-lite').''); ?>
    +

    main->get_flags($event)); ?> get_label_captions($event,'mec-fc-style')); ?>

    + main->get_normal_labels($event, $display_label).$this->main->display_cancellation_reason($event, $reason_for_cancellation)); ?>data->ID ); ?> +
    +
    +
    +
    main->date_i18n($this->date_format_style21, strtotime($event_date))); ?>
    +
    +
    +
    +
      +
      +
    • + 00 +

      +
    • +
      +
      +
    • + 00 +

      +
    • +
      +
      +
    • + 00 +

      +
    • +
      +
      +
    • + 00 +

      +
    • +
      +
    +
    + localtime) echo MEC_kses::full($this->main->module('local-time.type3', array('event' => $event))); ?> +
    +
    + display_link($event, $this->main->m('event_detail', esc_html__('EVENT DETAIL', 'modern-events-calendar-lite')), 'mec-event-button')); ?> +
    +
    + style == 'style3'): ?> +
    +
    +
    +
    '.esc_html__('Next', 'modern-events-calendar-lite').''); ?>
    +
    + localtime) echo MEC_kses::full($this->main->module('local-time.type3', array('event' => $event))); ?> +
    +
    + main->date_i18n($this->date_format_style31, strtotime($event_date))); ?> + main->date_i18n($this->date_format_style32, strtotime($event_date))); ?> + main->date_i18n($this->date_format_style33, strtotime($event_date))); ?> +
    + +
    +
      +
      +
    • + 00 +

      +
    • +
      +
      +
    • + 00 +

      +
    • +
      +
      +
    • + 00 +

      +
    • +
      +
      +
    • + 00 +

      +
    • +
      +
    +
    +
    +
    +
    +
    + display_link($event, $event->data->thumbnails['meccarouselthumb'], '')); ?> +
    +
    +
    + + display_credit_url(); ?> +
    \ No newline at end of file diff --git a/app/skins/cover.php b/app/skins/cover.php new file mode 100755 index 0000000..c7e2da3 --- /dev/null +++ b/app/skins/cover.php @@ -0,0 +1,124 @@ + + */ +class MEC_skin_cover extends MEC_skins +{ + /** + * @var string + */ + public $skin = 'cover'; + + public $event_id; + public $date_format_clean1; + public $date_format_clean2; + public $date_format_clean3; + public $date_format_classic1; + public $date_format_classic2; + public $date_format_modern1; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + parent::__construct(); + } + + /** + * Registers skin actions into WordPress + * @author Webnus + */ + public function actions() + { + } + + /** + * Initialize the skin + * @author Webnus + * @param array $atts + */ + public function initialize($atts) + { + $this->atts = $atts; + $this->skin_options = (isset($this->atts['sk-options']) and isset($this->atts['sk-options'][$this->skin])) ? $this->atts['sk-options'][$this->skin] : []; + + // Icons + $this->icons = $this->main->icons( + isset($this->atts['icons']) && is_array($this->atts['icons']) ? $this->atts['icons'] : [] + ); + + // Date Formats + $this->date_format_clean1 = (isset($this->skin_options['date_format_clean1']) and trim($this->skin_options['date_format_clean1'])) ? $this->skin_options['date_format_clean1'] : 'd'; + $this->date_format_clean2 = (isset($this->skin_options['date_format_clean2']) and trim($this->skin_options['date_format_clean2'])) ? $this->skin_options['date_format_clean2'] : 'M'; + $this->date_format_clean3 = (isset($this->skin_options['date_format_clean3']) and trim($this->skin_options['date_format_clean3'])) ? $this->skin_options['date_format_clean3'] : 'Y'; + + $this->date_format_classic1 = (isset($this->skin_options['date_format_classic1']) and trim($this->skin_options['date_format_classic1'])) ? $this->skin_options['date_format_classic1'] : 'F d'; + $this->date_format_classic2 = (isset($this->skin_options['date_format_classic2']) and trim($this->skin_options['date_format_classic2'])) ? $this->skin_options['date_format_classic2'] : 'l'; + + $this->date_format_modern1 = (isset($this->skin_options['date_format_modern1']) and trim($this->skin_options['date_format_modern1'])) ? $this->skin_options['date_format_modern1'] : 'l, F d Y'; + + // Search Form Status + $this->sf_status = false; + + $this->id = mt_rand(100, 999); + + // Set the ID + if(!isset($this->atts['id'])) $this->atts['id'] = $this->id; + + // The style + $this->style = $this->skin_options['style'] ?? 'classic'; + if($this->style == 'fluent' and !is_plugin_active('mec-fluent-layouts/mec-fluent-layouts.php')) $this->style = 'classic'; + + // Override the style if the style forced by us in a widget etc + if(isset($this->atts['style']) and trim($this->atts['style']) != '') $this->style = $this->atts['style']; + + // reason_for_cancellation + $this->reason_for_cancellation = $this->skin_options['reason_for_cancellation'] ?? false; + + // display_label + $this->display_label = $this->skin_options['display_label'] ?? false; + + // HTML class + $this->html_class = ''; + if(isset($this->atts['html-class']) and trim($this->atts['html-class']) != '') $this->html_class = $this->atts['html-class']; + + // From Widget + $this->widget = isset($this->atts['widget']) && trim($this->atts['widget']); + + // Init MEC + $this->args['mec-skin'] = $this->skin; + + $this->event_id = $this->skin_options['event_id'] ?? 0; + $this->maximum_dates = $this->atts['maximum_dates'] ?? 6; + } + + /** + * Search and returns the filtered events + * @return array of objects + * @throws Exception + * @author Webnus + */ + public function search() + { + if(!get_post($this->event_id)) return []; + + $events = []; + $rendered = $this->render->data($this->event_id, ($this->atts['content'] ?? '')); + + $data = new stdClass(); + $data->ID = $this->event_id; + $data->data = $rendered; + $data->dates = $this->render->dates($this->event_id, $rendered, $this->maximum_dates); + $data->date = $data->dates[0] ?? []; + + $events[] = $this->render->after_render($data, $this); + + return $events; + } +} diff --git a/app/skins/cover/index.html b/app/skins/cover/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/skins/cover/tpl.php b/app/skins/cover/tpl.php new file mode 100755 index 0000000..9d92072 --- /dev/null +++ b/app/skins/cover/tpl.php @@ -0,0 +1,85 @@ +main->get_styling(); +$event = $this->events[0]; +$settings = $this->main->get_settings(); +$this->localtime = $this->skin_options['include_local_time'] ?? false; +$display_label = $this->skin_options['display_label'] ?? false; +$reason_for_cancellation = $this->skin_options['reason_for_cancellation'] ?? false; + +$dark_mode = $styling['dark_mode'] ?? ''; +if($dark_mode == 1) $set_dark = 'mec-dark-mode'; +else $set_dark = ''; + +// Event is not valid! +if(!isset($event->data)) return; + +$event_colorskin = (isset($styling['mec_colorskin']) || isset($styling['color'])) ? 'colorskin-custom' : ''; + +$location_id = $this->main->get_master_location_id($event); +$event_location = ($location_id ? $this->main->get_location_data($location_id) : array()); + +$organizer_id = $this->main->get_master_organizer_id($event); +$event_organizer = ($organizer_id ? $this->main->get_organizer_data($organizer_id) : array()); + +$event_date = (isset($event->date['start']) ? $event->date['start']['date'] : $event->data->meta['mec_start_date']); +$event_link = (isset($event->data->permalink) and trim($event->data->permalink)) ? $this->main->get_event_date_permalink($event, $event_date) : get_permalink($event->data->ID); +$event_color = $this->get_event_color_dot($event); +$event_thumb = $event->data->thumbnails['large']; +$event_thumb_url = $event->data->featured_image['large']; +$event_start_date = !empty($event->date['start']['date']) ? $event->date['start']['date'] : ''; + +do_action('mec_start_skin', $this->id); +do_action('mec_cover_skin_head'); +?> +
    +style == 'modern' and $event_thumb_url): ?> +
    + +
    +
    + get_label_captions($event,'mec-fc-style')); ?> +
    main->date_i18n($this->date_format_modern1, strtotime($event_date))).((isset($event->data->time) and trim($event->data->time['start'])) ? ' - '.esc_html($event->data->time['start']) : ''); ?>
    + localtime) echo MEC_kses::full($this->main->module('local-time.type3', array('event' => $event))); ?> +

    data->title, $event).$this->main->get_flags($event).$event_color); ?>

    + main->get_normal_labels($event, $display_label).$this->main->display_cancellation_reason($event, $reason_for_cancellation)); ?>data->ID ); ?> +
    +
    +
    +
    + +
    +
    +
    + style == 'classic'): ?> +
    + +
    + main->date_i18n($this->date_format_classic1, strtotime($event_date))); ?> main->date_i18n($this->date_format_classic2, strtotime($event_date))); ?> +
    + localtime) echo MEC_kses::full($this->main->module('local-time.type2', array('event' => $event))); ?> +

    data->title, $event).$this->main->get_flags($event).$event_color); ?>main->get_normal_labels($event, $display_label).$this->main->display_cancellation_reason($event, $reason_for_cancellation)); ?>data->ID); ?>get_label_captions($event,'mec-fc-style')); ?>

    +
    display_link($event, $this->main->m('event_detail', esc_html__('EVENT DETAIL', 'modern-events-calendar-lite')), 'mec-event-button')); ?>
    +
    + style == 'clean'): ?> +
    +

    display_link($event, NULL, '')); ?>main->get_flags($event).$event_color); ?>main->get_normal_labels($event, $display_label).$this->main->display_cancellation_reason($event, $reason_for_cancellation)); ?>data->ID); ?>get_label_captions($event,'mec-fc-style')); ?>

    + localtime) echo MEC_kses::full($this->main->module('local-time.type3', array('event' => $event))); ?> +
    +
    +
    +
    main->date_i18n($this->date_format_clean1, strtotime($event_date))); ?>
    +
    main->date_i18n($this->date_format_clean2, strtotime($event_date))); ?>
    +
    main->date_i18n($this->date_format_clean3, strtotime($event_date))); ?>
    +
    + +
    + + display_credit_url(); ?> +
    diff --git a/app/skins/custom.php b/app/skins/custom.php new file mode 100755 index 0000000..96efb8d --- /dev/null +++ b/app/skins/custom.php @@ -0,0 +1,295 @@ + + */ +class MEC_skin_custom extends MEC_skins +{ + /** + * @var string + */ + public $skin = 'custom'; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + parent::__construct(); + } + + /** + * Registers skin actions into WordPress + * @author Webnus + */ + public function actions() + { + $this->factory->action('wp_ajax_mec_custom_load_more', array($this, 'load_more')); + $this->factory->action('wp_ajax_nopriv_mec_custom_load_more', array($this, 'load_more')); + } + + /** + * Initialize the skin + * @author Webnus + * @param array $atts + */ + public function initialize($atts) + { + $this->atts = $atts; + + // Skin Options + $this->skin_options = (isset($this->atts['sk-options']) and isset($this->atts['sk-options'][$this->skin])) ? $this->atts['sk-options'][$this->skin] : []; + + // Icons + $this->icons = $this->main->icons( + isset($this->atts['icons']) && is_array($this->atts['icons']) ? $this->atts['icons'] : [] + ); + + // The style + $this->style = $this->skin_options['style'] ?? 'modern'; + if($this->style == 'fluent' and !is_plugin_active('mec-fluent-layouts/mec-fluent-layouts.php')) $this->style = 'modern'; + + $this->month_divider = isset($this->skin_options['month_divider']) ? $this->skin_options['month_divider'] : true; + + // Search Form Options + $this->sf_options = (isset($this->atts['sf-options']) and isset($this->atts['sf-options'][$this->skin])) ? $this->atts['sf-options'][$this->skin] : []; + + // Search Form Status + $this->sf_status = isset($this->atts['sf_status']) ? $this->atts['sf_status'] : true; + $this->sf_display_label = isset($this->atts['sf_display_label']) ? $this->atts['sf_display_label'] : false; + $this->sf_reset_button = isset($this->atts['sf_reset_button']) ? $this->atts['sf_reset_button'] : false; + $this->sf_refine = isset($this->atts['sf_refine']) ? $this->atts['sf_refine'] : false; + + // Generate an ID for the sking + $this->id = isset($this->atts['id']) ? $this->atts['id'] : mt_rand(100, 999); + + // Set the ID + if(!isset($this->atts['id'])) $this->atts['id'] = $this->id; + + // Show "Load More" button or not + $this->load_more_button = isset($this->skin_options['load_more_button']) ? $this->skin_options['load_more_button'] : true; + + // Pagination + $this->pagination = isset($this->skin_options['pagination']) ? $this->skin_options['pagination'] : (!$this->load_more_button ? '0' : 'loadmore'); + + // Override the style if the style forced by us in a widget etc + if(isset($this->atts['style']) and trim($this->atts['style']) != '') $this->style = $this->atts['style']; + + // HTML class + $this->html_class = ''; + if(isset($this->atts['html-class']) and trim($this->atts['html-class']) != '') $this->html_class = $this->atts['html-class']; + + // Booking Button + $this->booking_button = isset($this->skin_options['booking_button']) ? (int) $this->skin_options['booking_button'] : 0; + + // SED Method + $this->sed_method = $this->get_sed_method(); + + // Image popup + $this->image_popup = $this->skin_options['image_popup'] ?? '0'; + + // From Widget + $this->widget = isset($this->atts['widget']) && trim($this->atts['widget']); + if($this->widget) + { + $this->skin_options['count'] = '1'; + $this->load_more_button = false; + $this->pagination = '0'; + } + + // The count in row + $this->count = $this->skin_options['count'] ?? '3'; + + // Map geolocation + $this->geolocation = ((isset($this->skin_options['map_on_top']) and (isset($this->skin_options['set_geolocation']))) and ($this->skin_options['map_on_top'] == '1' and $this->skin_options['set_geolocation'] == '1')) ? true : false; + + // Map on top + $this->map_on_top = $this->skin_options['map_on_top'] ?? false; + + // Init MEC + $this->args['mec-init'] = true; + $this->args['mec-skin'] = $this->skin; + + // Post Type + $this->args['post_type'] = $this->main->get_main_post_type(); + + // Post Status + $this->args['post_status'] = 'publish'; + + // Keyword Query + $this->args['s'] = $this->keyword_query(); + + // Taxonomy + $this->args['tax_query'] = $this->tax_query(); + + // Meta + $this->args['meta_query'] = $this->meta_query(); + + // Tag + if(apply_filters('mec_taxonomy_tag', '') === 'post_tag') $this->args['tag'] = $this->tag_query(); + + // Author + $this->args['author'] = $this->author_query(); + $this->args['author__not_in'] = $this->author_query_ex(); + + // Pagination Options + $this->paged = get_query_var('paged', 1); + $this->limit = (isset($this->skin_options['limit']) and trim($this->skin_options['limit'])) ? $this->skin_options['limit'] : 12; + + $this->args['posts_per_page'] = $this->limit; + $this->args['paged'] = $this->paged; + + // Sort Options + $this->args['orderby'] = 'mec_start_day_seconds ID'; + $this->args['order'] = 'ASC'; + $this->args['meta_key'] = 'mec_start_day_seconds'; + + // Exclude Posts + if(isset($this->atts['exclude']) and is_array($this->atts['exclude']) and count($this->atts['exclude'])) $this->args['post__not_in'] = $this->atts['exclude']; + + // Include Posts + if(isset($this->atts['include']) and is_array($this->atts['include']) and count($this->atts['include'])) $this->args['post__in'] = $this->atts['include']; + + // Show Only Expired Events + $this->show_only_expired_events = (isset($this->atts['show_only_past_events']) and trim($this->atts['show_only_past_events'])) ? '1' : '0'; + + // Show Past Events + if($this->show_only_expired_events) + { + $this->atts['show_past_events'] = '1'; + $this->args['order'] = 'DESC'; + } + + // Show Past Events + $this->args['mec-past-events'] = $this->atts['show_past_events'] ?? '0'; + + // Start Date + $this->start_date = $this->get_start_date(); + + // We will extend the end date in the loop + $this->end_date = $this->start_date; + + // Show Ongoing Events + $this->show_ongoing_events = (isset($this->atts['show_only_ongoing_events']) and trim($this->atts['show_only_ongoing_events'])) ? '1' : '0'; + if($this->show_ongoing_events) + { + $this->args['mec-show-ongoing-events'] = $this->show_ongoing_events; + $this->maximum_date = $this->start_date; + } + + // Include Ongoing Events + $this->include_ongoing_events = (isset($this->atts['show_ongoing_events']) and trim($this->atts['show_ongoing_events'])) ? '1' : '0'; + if($this->include_ongoing_events) $this->args['mec-include-ongoing-events'] = $this->include_ongoing_events; + + // Set start time + if(isset($this->atts['seconds'])) + { + $this->args['mec-seconds'] = $this->atts['seconds']; + $this->args['mec-seconds-date'] = $this->atts['seconds_date'] ?? $this->start_date; + } + + // Apply Maximum Date + $apply_sf_date = isset($_REQUEST['apply_sf_date']) ? sanitize_text_field($_REQUEST['apply_sf_date']) : 0; + $month = (isset($this->sf) && isset($this->sf['month']) && trim($this->sf['month'])) ? $this->sf['month'] : (isset($_REQUEST['mec_month']) ? $_REQUEST['mec_month'] : ''); + if($apply_sf_date == 1 and trim($month)) $this->maximum_date = date('Y-m-t', strtotime($this->start_date)); + + // Found Events + $this->found = 0; + } + + /** + * Returns start day of skin for filtering events + * @author Webnus + * @return string + */ + public function get_start_date() + { + // Default date + $date = current_time('Y-m-d'); + + if(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'today') $date = current_time('Y-m-d'); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'tomorrow') $date = date('Y-m-d', strtotime('Tomorrow')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'yesterday') $date = date('Y-m-d', strtotime('Yesterday')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_last_month') $date = date('Y-m-d', strtotime('first day of last month')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_current_month') $date = date('Y-m-d', strtotime('first day of this month')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_next_month') $date = date('Y-m-d', strtotime('first day of next month')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'date') $date = date('Y-m-d', strtotime($this->skin_options['start_date'])); + + // Hide past events + if(isset($this->atts['show_past_events']) and !trim($this->atts['show_past_events'])) + { + $today = current_time('Y-m-d'); + if(strtotime($date) < strtotime($today)) $date = $today; + } + + // Show only expired events + if(isset($this->show_only_expired_events) and $this->show_only_expired_events) + { + $now = date('Y-m-d H:i:s', current_time('timestamp', 0)); + if(strtotime($date) > strtotime($now)) $date = $now; + } + + return $date; + } + + /** + * Load more events for AJAX request + * @author Webnus + * @return void + */ + public function load_more() + { + $this->sf = (isset($_REQUEST['sf']) and is_array($_REQUEST['sf'])) ? $this->main->sanitize_deep_array($_REQUEST['sf']) : []; + $apply_sf_date = isset($_REQUEST['apply_sf_date']) ? sanitize_text_field($_REQUEST['apply_sf_date']) : 1; + $atts = $this->sf_apply(((isset($_REQUEST['atts']) and is_array($_REQUEST['atts'])) ? $this->main->sanitize_deep_array($_REQUEST['atts']) : array()), $this->sf, $apply_sf_date); + + // Initialize the skin + $this->initialize($atts); + + // Override variables + $this->start_date = isset($_REQUEST['mec_start_date']) ? sanitize_text_field($_REQUEST['mec_start_date']) : date('y-m-d'); + $this->end_date = $this->start_date; + $this->offset = isset($_REQUEST['mec_offset']) ? sanitize_text_field($_REQUEST['mec_offset']) : 0; + + // Apply Maximum Date + $month = (isset($this->sf) && isset($this->sf['month']) && trim($this->sf['month'])) ? $this->sf['month'] : (isset($_REQUEST['mec_month']) ? $_REQUEST['mec_month'] : ''); + if($apply_sf_date == 1 and trim($month)) $this->maximum_date = date('Y-m-t', strtotime($this->start_date)); + + // Return the events + $this->atts['return_items'] = true; + $this->loading_more = true; + + // Fetch the events + $this->fetch(); + + // Return the output + $output = $this->output(); + + echo json_encode($output); + exit; + } + + /** + * Generates skin output + * @author Webnus + * @return string + */ + public function output(){ + + $booking_button_status = (bool)($this->skin_options['booking_button'] ?? 0); + if( $booking_button_status ){ + + add_filter( 'mec_shortcode_designer_readmore_button_status', '__return_true' ); + } + + $html = parent::output(); + + remove_filter( 'mec_shortcode_designer_readmore_button_status', '__return_true' ); + + return $html; + } +} diff --git a/app/skins/custom/index.html b/app/skins/custom/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/skins/custom/render.php b/app/skins/custom/render.php new file mode 100755 index 0000000..0ed965c --- /dev/null +++ b/app/skins/custom/render.php @@ -0,0 +1,139 @@ +main->get_styling(); +$event_colorskin = (isset($styling['mec_colorskin']) || isset($styling['color'])) ? 'colorskin-custom' : ''; +$settings = $this->main->get_settings(); +$current_month_divider = isset($_REQUEST['current_month_divider']) ? sanitize_text_field($_REQUEST['current_month_divider']) : 0; + +global $MEC_Shortcode_id; +$MEC_Shortcode_id = !empty($MEC_Shortcode_id) ? $MEC_Shortcode_id : $this->atts['id']; + +// colorful +$colorful_flag = $colorful_class = ''; +if($this->style == 'colorful') +{ + $colorful_flag = true; + $this->style = 'modern'; + $colorful_class = ' mec-event-custom-colorful'; +} + +global $mec_enqueue_custom_css; +$is_load_more = 'mec_custom_load_more' === ($_REQUEST['action'] ?? '') ? true : false; +$with_css = $is_load_more ? false : true; + +?> +
    +
    + count; + + if($count == 0 or $count == 5) $col = 4; + else $col = 12 / $count; + global $post; + global $mec_old_post; + $mec_old_post = $post; + + $rcount = 1; + if(!empty($this->events)) + { + foreach($this->events as $date => $events) + { + $month_id = date('Ym', strtotime($date)); + foreach($events as $event) + { + global $post; + $post = $event->data->post; + + if($this->count == '1' and $this->month_divider and $month_id != $current_month_divider): $current_month_divider = $month_id; ?> +
    main->date_i18n('F Y', strtotime($date))); ?>
    + ' : ''; + echo '
    '; + echo '
    '; + + if( isset( $mec_enqueue_custom_css[ $this->style ] ) ) { + + $with_css = false; + }else{ + + $mec_enqueue_custom_css[ $this->style ] = true; + } + + echo Plugin::instance()->frontend->get_builder_content_for_display($this->style, $with_css); + echo '
    '; + + if($rcount == $count) + { + echo '
    '; + $rcount = 0; + } + + $rcount++; + } + } + } + + global $post; + global $mec_old_post; + $post = $mec_old_post; + ?> +
    + + $value) + { + foreach($value as $keyy => $valuee) $map_eventss[] = $valuee; + } +} + +if(isset($this->map_on_top) and $this->map_on_top): +if(isset($map_eventss) and !empty($map_eventss)) +{ + // Include Map Assets such as JS and CSS libraries + $this->main->load_map_assets(); + + $map_javascript = ''; + + $map_data = new stdClass; + $map_data->id = $this->id; + $map_data->atts = $this->atts; + $map_data->events = $map_eventss; + $map_data->render = $this->render; + $map_data->geolocation = $this->geolocation; + $map_data->sf_status = null; + $map_data->main = $this->main; + + $map_javascript = apply_filters('mec_map_load_script', $map_javascript, $map_data, $settings); + + // Include javascript code into the page + if($this->main->is_ajax()) echo MEC_kses::full($map_javascript); + else $this->factory->params('footer', $map_javascript); +} +endif; \ No newline at end of file diff --git a/app/skins/custom/tpl.php b/app/skins/custom/tpl.php new file mode 100755 index 0000000..ada0695 --- /dev/null +++ b/app/skins/custom/tpl.php @@ -0,0 +1,87 @@ +get_render_path(); + +ob_start(); +include $render_path; +$items_html = ob_get_clean(); + +if(isset($this->atts['return_items']) and $this->atts['return_items']) +{ + echo json_encode(array('html' => $items_html, 'end_date' => $this->end_date, 'offset' => $this->next_offset, 'count' => $this->found, 'has_more_event' => (int) $this->has_more_events)); + exit; +} + +$sed_method = $this->sed_method; +if($sed_method == 'new') $sed_method = '0'; + +// Generating javascript code tpl +$javascript = ''; + +// Include javascript code into the page +if($this->main->is_ajax() or $this->main->preview()) echo MEC_kses::full($javascript); +else $this->factory->params('footer', $javascript); + +do_action('mec_start_skin', $this->id); +do_action('mec_custom_skin_head'); +?> +
    + + sf_status) echo MEC_kses::full($this->sf_search_form()); ?> + + found): ?> + map_on_top == '1'): ?> +
    +
    + settings['default_maps_view'])?$this->settings['default_maps_view']:'google'; + do_action('mec_map_inner_element_tools', array('map' => $map)); + ?> +
    + +
    + +
    + +
    +
    + main->display_not_found_message(); ?> +
    + +
    + main->display_not_found_message(); ?> +
    + + + get_pagination_bar(); ?> + +
    +display_credit_url(); \ No newline at end of file diff --git a/app/skins/daily_view.php b/app/skins/daily_view.php new file mode 100755 index 0000000..4150fd1 --- /dev/null +++ b/app/skins/daily_view.php @@ -0,0 +1,424 @@ + + */ +class MEC_skin_daily_view extends MEC_skins +{ + /** + * @var string + */ + public $skin = 'daily_view'; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + parent::__construct(); + } + + /** + * Registers skin actions into WordPress + * @author Webnus + */ + public function actions() + { + $this->factory->action('wp_ajax_mec_daily_view_load_month', array($this, 'load_month')); + $this->factory->action('wp_ajax_nopriv_mec_daily_view_load_month', array($this, 'load_month')); + } + + /** + * Initialize the skin + * @author Webnus + * @param array $atts + */ + public function initialize($atts) + { + $this->atts = $atts; + + // Skin Options + $this->skin_options = (isset($this->atts['sk-options']) and isset($this->atts['sk-options'][$this->skin])) ? $this->atts['sk-options'][$this->skin] : []; + + // Icons + $this->icons = $this->main->icons( + isset($this->atts['icons']) && is_array($this->atts['icons']) ? $this->atts['icons'] : [] + ); + + $this->style = $this->skin_options['style'] ?? 'classic'; + + // Search Form Options + $this->sf_options = (isset($this->atts['sf-options']) and isset($this->atts['sf-options'][$this->skin])) ? $this->atts['sf-options'][$this->skin] : []; + + // Search Form Status + $this->sf_status = $this->atts['sf_status'] ?? true; + $this->sf_display_label = isset($this->atts['sf_display_label']) ? $this->atts['sf_display_label'] : false; + $this->sf_reset_button = isset($this->atts['sf_reset_button']) ? $this->atts['sf_reset_button'] : false; + $this->sf_refine = isset($this->atts['sf_refine']) ? $this->atts['sf_refine'] : false; + + // Generate an ID for the skin + $this->id = isset($this->atts['id']) ? $this->atts['id'] : mt_rand(100, 999); + + // Set the ID + if(!isset($this->atts['id'])) $this->atts['id'] = $this->id; + + // Next/Previous Month + $this->next_previous_button = isset($this->skin_options['next_previous_button']) ? $this->skin_options['next_previous_button'] : true; + + // HTML class + $this->html_class = ''; + if(isset($this->atts['html-class']) and trim($this->atts['html-class']) != '') $this->html_class = $this->atts['html-class']; + + // Booking Button + $this->booking_button = isset($this->skin_options['booking_button']) ? (int) $this->skin_options['booking_button'] : 0; + + // SED Method + $this->sed_method = $this->get_sed_method(); + + // Image popup + $this->image_popup = $this->skin_options['image_popup'] ?? '0'; + + // reason_for_cancellation + $this->reason_for_cancellation = $this->skin_options['reason_for_cancellation'] ?? false; + + // display_label + $this->display_label = $this->skin_options['display_label'] ?? false; + + // From Widget + $this->widget = isset($this->atts['widget']) && trim($this->atts['widget']); + + // From Full Calendar + $this->from_full_calendar = (isset($this->skin_options['from_fc']) and trim($this->skin_options['from_fc'])); + + // Display Price + $this->display_price = (isset($this->skin_options['display_price']) and trim($this->skin_options['display_price'])); + + // Detailed Time + $this->display_detailed_time = (isset($this->skin_options['detailed_time']) and trim($this->skin_options['detailed_time'])); + + // Init MEC + $this->args['mec-init'] = true; + $this->args['mec-skin'] = $this->skin; + + // Post Type + $this->args['post_type'] = $this->main->get_main_post_type(); + + // Post Status + $this->args['post_status'] = 'publish'; + + // Keyword Query + $this->args['s'] = $this->keyword_query(); + + // Taxonomy + $this->args['tax_query'] = $this->tax_query(); + + // Meta + $this->args['meta_query'] = $this->meta_query(); + + // Tag + if(apply_filters('mec_taxonomy_tag', '') === 'post_tag') $this->args['tag'] = $this->tag_query(); + + // Author + $this->args['author'] = $this->author_query(); + $this->args['author__not_in'] = $this->author_query_ex(); + + // Pagination Options + $this->paged = get_query_var('paged', 1); + $this->limit = (isset($this->skin_options['limit']) and trim($this->skin_options['limit'])) ? $this->skin_options['limit'] : 12; + + $this->args['posts_per_page'] = $this->limit; + $this->args['paged'] = $this->paged; + + // Sort Options + $this->args['orderby'] = 'mec_start_day_seconds ID'; + $this->args['order'] = 'ASC'; + $this->args['meta_key'] = 'mec_start_day_seconds'; + + // Show Only Expired Events + $this->show_only_expired_events = (isset($this->atts['show_only_past_events']) and trim($this->atts['show_only_past_events'])) ? '1' : '0'; + + // Show Past Events + if($this->show_only_expired_events) $this->atts['show_past_events'] = '1'; + + // Show Past Events + $this->args['mec-past-events'] = isset($this->atts['show_past_events']) ? $this->atts['show_past_events'] : '0'; + + // Start Date + list($this->year, $this->month, $this->day) = $this->get_start_date(); + + $this->start_date = $this->year.'-'.$this->month.'-01'; + $this->active_day = $this->year.'-'.$this->month.'-'.$this->day; + + // Set the maximum date in current month + if($this->show_only_expired_events) $this->maximum_date = date('Y-m-d H:i:s', current_time('timestamp')); + + // We will extend the end date in the loop + $this->end_date = $this->start_date; + + // Show Ongoing Events + $this->show_ongoing_events = (isset($this->atts['show_only_ongoing_events']) and trim($this->atts['show_only_ongoing_events'])) ? '1' : '0'; + if($this->show_ongoing_events) $this->args['mec-show-ongoing-events'] = $this->show_ongoing_events; + + // Include Ongoing Events + $this->include_ongoing_events = (isset($this->atts['show_ongoing_events']) and trim($this->atts['show_ongoing_events'])) ? '1' : '0'; + if($this->include_ongoing_events) $this->args['mec-include-ongoing-events'] = $this->include_ongoing_events; + + // Auto Month Rotation + $this->auto_month_rotation = !isset($this->settings['auto_month_rotation']) || $this->settings['auto_month_rotation']; + + do_action('mec-daily-initialize-end', $this); + } + + /** + * Search and returns the filtered events + * @author Webnus + * @return array of objects + */ + public function search() + { + if($this->show_only_expired_events) + { + $start = date('Y-m-d H:i:s', current_time('timestamp')); + $end = $this->start_date; + } + else + { + $start = $this->start_date; + $end = date('Y-m-t', strtotime($this->start_date)); + } + + // Date Events + $dates = $this->period($start, $end, true); + + $s = $this->start_date; + + $sorted = []; + while(date('m', strtotime($s)) == $this->month) + { + if(isset($dates[$s])) $sorted[$s] = $dates[$s]; + else $sorted[$s] = []; + + $s = date('Y-m-d', strtotime('+1 Day', strtotime($s))); + } + + $dates = $sorted; + + // Limit + $this->args['posts_per_page'] = $this->limit; + + $events = []; + $qs = []; + + foreach($dates as $date=>$IDs) + { + // Check Finish Date + if(isset($this->maximum_date) and trim($this->maximum_date) and strtotime($date) > strtotime($this->maximum_date)) + { + $events[$date] = []; + continue; + } + + // Include Available Events + $this->args['post__in'] = array_unique($IDs); + + // Count of events per day + $IDs_count = array_count_values($IDs); + + // Extending the end date + $this->end_date = $date; + + // The Query + $this->args = apply_filters('mec_skin_query_args', $this->args, $this); + + // Query Key + $q_key = base64_encode(json_encode($this->args)); + + // Get From Cache + if(isset($qs[$q_key])) $query = $qs[$q_key]; + // Search & Cache + else + { + $query = new WP_Query($this->args); + $qs[$q_key] = $query; + } + + if(is_array($IDs) and count($IDs) and $query->have_posts()) + { + if(!isset($events[$date])) $events[$date] = []; + + // Day Events + $d = []; + + // The Loop + while($query->have_posts()) + { + $query->the_post(); + $ID = get_the_ID(); + + $ID_count = isset($IDs_count[$ID]) ? $IDs_count[$ID] : 1; + for($i = 1; $i <= $ID_count; $i++) + { + $rendered = $this->render->data($ID); + + $data = new stdClass(); + $data->ID = $ID; + $data->data = $rendered; + + $data->date = array + ( + 'start' => array('date' => $date), + 'end' => array('date' => $this->main->get_end_date($date, $rendered)) + ); + + $d[] = $this->render->after_render($data, $this, $i); + } + } + + usort($d, [$this, 'sort_day_events']); + $events[$date] = $d; + } + else + { + $events[$date] = []; + } + + // Restore original Post Data + wp_reset_postdata(); + } + + // Initialize Occurrences' Data + MEC_feature_occurrences::fetch($events); + + return $events; + } + + /** + * Returns start day of skin for filtering events + * @author Webnus + * @return array + */ + public function get_start_date() + { + // Default date + $date = current_time('Y-m-d'); + + if(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'today') $date = current_time('Y-m-d'); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'tomorrow') $date = date('Y-m-d', strtotime('Tomorrow')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'yesterday') $date = date('Y-m-d', strtotime('Yesterday')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_last_month') $date = date('Y-m-d', strtotime('first day of last month')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_current_month') $date = date('Y-m-d', strtotime('first day of this month')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_next_month') $date = date('Y-m-d', strtotime('first day of next month')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'date') $date = date('Y-m-d', strtotime($this->skin_options['start_date'])); + + // Hide past events + if(isset($this->atts['show_past_events']) and !trim($this->atts['show_past_events'])) + { + $today = current_time('Y-m-d'); + if(strtotime($date) < strtotime($today)) $date = $today; + } + + // Show only expired events + if(isset($this->show_only_expired_events) and $this->show_only_expired_events) + { + $yesterday = date('Y-m-d', strtotime('Yesterday')); + if(strtotime($date) > strtotime($yesterday)) $date = $yesterday; + } + + $time = strtotime($date); + return array(date('Y', $time), date('m', $time), date('d', $time)); + } + + /** + * Returns label of dates + * @author Webnus + * @return string + */ + public function get_date_labels() + { + $labels = ''; + } + + /** + * Load month for AJAX request + * @author Webnus + * @return void + */ + public function load_month() + { + $this->sf = (isset($_REQUEST['sf']) and is_array($_REQUEST['sf'])) ? $this->main->sanitize_deep_array($_REQUEST['sf']) : []; + $apply_sf_date = isset($_REQUEST['apply_sf_date']) ? sanitize_text_field($_REQUEST['apply_sf_date']) : 1; + $atts = $this->sf_apply(((isset($_REQUEST['atts']) and is_array($_REQUEST['atts'])) ? $this->main->sanitize_deep_array($_REQUEST['atts']) : array()), $this->sf, $apply_sf_date); + + $navigator_click = isset($_REQUEST['navigator_click']) && sanitize_text_field($_REQUEST['navigator_click']); + + // Initialize the skin + $this->initialize($atts); + + // Daily view search repeat if not found in current month + $c = 0; + $break = false; + + do + { + if($c > 12) $break=true; + if($c and !$break) + { + if(intval($this->month == 12)) + { + $this->year = intval($this->year)+1; + $this->month = '01'; + } + + $this->month = sprintf("%02d", intval($this->month)+1); + } + else + { + // Start Date + $this->year = isset($_REQUEST['mec_year']) ? sanitize_text_field($_REQUEST['mec_year']) : current_time('Y'); + $this->month = isset($_REQUEST['mec_month']) ? sanitize_text_field($_REQUEST['mec_month']) : current_time('m'); + } + + $this->day = '1'; + + $this->start_date = $this->year.'-'.$this->month.'-01'; + + // We will extend the end date in the loop + $this->end_date = $this->start_date; + + // Return the events + $this->atts['return_items'] = true; + + // Fetch the events + $this->fetch(); + + // Break the loop if not result + if($break) break; + if($navigator_click) break; + + // Auto Rotation is Disabled + if(!$this->auto_month_rotation) break; + + $c++; + + } + while(!array_filter($this->events) and count($this->sf)); + + // Return the output + $output = $this->output(); + + echo json_encode($output); + exit; + } +} diff --git a/app/skins/daily_view/index.html b/app/skins/daily_view/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/skins/daily_view/render.php b/app/skins/daily_view/render.php new file mode 100755 index 0000000..d877965 --- /dev/null +++ b/app/skins/daily_view/render.php @@ -0,0 +1,60 @@ +localtime = isset($this->skin_options['include_local_time']) ? $this->skin_options['include_local_time'] : false; +$display_label = isset($this->skin_options['display_label']) ? $this->skin_options['display_label'] : false; +$reason_for_cancellation = isset($this->skin_options['reason_for_cancellation']) ? $this->skin_options['reason_for_cancellation'] : false; +?> +
      + events as $date=>$events): ?> +
    • + + + main->get_master_location_id($event); + $location = ($location_id ? $this->main->get_location_data($location_id) : array()); + + $start_time = (isset($event->data->time) ? $event->data->time['start'] : ''); + $end_time = (isset($event->data->time) ? $event->data->time['end'] : ''); + $event_color = $this->get_event_color_dot($event); + $event_start_date = !empty($event->date['start']['date']) ? $event->date['start']['date'] : ''; + + $mec_data = $this->display_custom_data($event); + $custom_data_class = !empty($mec_data) ? 'mec-custom-data' : ''; + + // MEC Schema + do_action('mec_schema', $event); + ?> +
      +
      +
      data->thumbnails['thumbnail']); ?>
      +
      + get_label_captions($event)); ?> + + display_detailed_time and $this->main->is_multipleday_occurrence($event)): ?> +
      icons->display('clock-o'); ?> display_detailed_time($event)); ?>
      + +
      icons->display('clock-o'); ?>
      + + +

      display_link($event)); ?>display_custom_data($event)); ?>main->get_flags($event).$event_color.$this->main->get_normal_labels($event, $display_label).$this->main->display_cancellation_reason($event, $reason_for_cancellation)); ?>data->ID); ?>

      + localtime) echo MEC_kses::full($this->main->module('local-time.type3', array('event' => $event))); ?> +
      + display_categories($event)); ?> + display_organizers($event)); ?> + display_cost($event)); ?> + booking_button($event)); ?> +
      +
      +
      + + +
      + +
    • + +
    + \ No newline at end of file diff --git a/app/skins/daily_view/tpl.php b/app/skins/daily_view/tpl.php new file mode 100755 index 0000000..0ced81d --- /dev/null +++ b/app/skins/daily_view/tpl.php @@ -0,0 +1,146 @@ +get_render_path(); + +// before/after Month +$_1month_before = strtotime('-1 Month', strtotime($this->start_date)); +$_1month_after = strtotime('+1 Month', strtotime($this->start_date)); + +// Current month time +$current_month_time = strtotime($this->start_date); + +$date_labels = $this->get_date_labels(); + +// Generate Events +ob_start(); +include $render_path; +$date_events = ob_get_clean(); + +$navigator_html = ''; + +// Generate Month Navigator +if($this->next_previous_button) +{ + // Show previous month handler if showing past events allowed + if(!isset($this->atts['show_past_events']) or + (isset($this->atts['show_past_events']) and $this->atts['show_past_events']) or + (isset($this->atts['show_past_events']) and !$this->atts['show_past_events'] and strtotime(date('Y-m-t', $_1month_before)) >= time()) + ) + { + $navigator_html .= '
    '; + } + + $navigator_html .= '

    '.esc_html($this->main->date_i18n('Y F', $current_month_time)).'

    '; + + // Show next month handler if needed + if(!$this->show_only_expired_events or + ($this->show_only_expired_events and strtotime(date('Y-m-01', $_1month_after)) <= time()) + ) + { + $navigator_html .= '
    '; + } +} + +$month_html = '
    +
    '.MEC_kses::element($date_labels).'
    +
    '.MEC_kses::full($date_events).'
    '; + +// Return the data if called by AJAX +if(isset($this->atts['return_items']) and $this->atts['return_items']) +{ + echo json_encode(array( + 'month' => $month_html, + 'navigator' => $navigator_html, + 'previous_month' => array('label' => $this->main->date_i18n('Y F', $_1month_before), 'id' => date('Ym', $_1month_before), 'year' => date('Y', $_1month_before), 'month' => date('m', $_1month_before)), + 'current_month' => array('label' => $this->main->date_i18n('Y F', $current_month_time), 'id' => date('Ym', $current_month_time), 'year' => date('Y', $current_month_time), 'month' => date('m', $current_month_time)), + 'next_month' => array('label' => $this->main->date_i18n('Y F', $_1month_after), 'id' => date('Ym', $_1month_after), 'year' => date('Y', $_1month_after), 'month' => date('m', $_1month_after)), + )); + exit; +} + +// Include OWL Assets +$this->main->load_owl_assets(); + +$sed_method = $this->sed_method; +if($sed_method == 'new') $sed_method = '0'; + +// Generating javascript code tpl +$javascript = ''; + +// Include javascript code into the page +if($this->main->is_ajax() or $this->main->preview()) echo MEC_kses::full($javascript); +else $this->factory->params('footer', $javascript); + +$styling = $this->main->get_styling(); +$event_colorskin = (isset($styling['mec_colorskin']) || isset($styling['color'])) ? 'colorskin-custom' : ''; + +$dark_mode = $styling['dark_mode'] ?? ''; +if($dark_mode == 1) $set_dark = 'mec-dark-mode'; +else $set_dark = ''; + +do_action('mec_start_skin', $this->id); +do_action('mec_daily_skin_head'); +?> +
    + + sf_status) echo MEC_kses::full($this->sf_search_form()); ?> + +
    + next_previous_button): ?> +
    +
    +
    + +

    main->date_i18n('Y F', $current_month_time)); ?>

    + + +
    +
    + +
    +
    +
    + + subscribe_to_calendar(); ?> + display_credit_url(); ?> + +
    \ No newline at end of file diff --git a/app/skins/default_full_calendar.php b/app/skins/default_full_calendar.php new file mode 100755 index 0000000..d98774c --- /dev/null +++ b/app/skins/default_full_calendar.php @@ -0,0 +1,265 @@ + + */ +class MEC_skin_default_full_calendar extends MEC_skins +{ + /** + * @var string + */ + public $skin = 'default_full_calendar'; + + public $default_view; + public $monthly_style; + public $yearly; + public $monthly; + public $weekly; + public $daily; + public $list; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + parent::__construct(); + } + + /** + * Registers skin actions into WordPress + * @author Webnus + */ + public function actions() + { + $this->factory->action('wp_ajax_mec_full_calendar_switch_skin', array($this, 'switch_skin')); + $this->factory->action('wp_ajax_nopriv_mec_full_calendar_switch_skin', array($this, 'switch_skin')); + } + + /** + * Initialize the skin + * @author Webnus + * @param array $atts + */ + public function initialize($atts) + { + $this->atts = $atts; + + // Skin Options + $this->skin_options = (isset($this->atts['sk-options']) and isset($this->atts['sk-options'][$this->skin])) ? $this->atts['sk-options'][$this->skin] : []; + + // Icons + $this->icons = $this->main->icons( + isset($this->atts['icons']) && is_array($this->atts['icons']) ? $this->atts['icons'] : [] + ); + + $this->style = $this->skin_options['style'] ?? 'classic'; + + // Search Form Options + $this->sf_options = (isset($this->atts['sf-options']) and isset($this->atts['sf-options'][$this->skin])) ? $this->atts['sf-options'][$this->skin] : []; + + // Search Form Status + $this->sf_status = $this->atts['sf_status'] ?? true; + $this->sf_display_label = isset($this->atts['sf_display_label']) ? $this->atts['sf_display_label'] : false; + $this->sf_reset_button = isset($this->atts['sf_reset_button']) ? $this->atts['sf_reset_button'] : false; + $this->sf_refine = isset($this->atts['sf_refine']) ? $this->atts['sf_refine'] : false; + + // Show Only Expired Events + $this->show_only_expired_events = (isset($this->atts['show_only_past_events']) and trim($this->atts['show_only_past_events'])) ? '1' : '0'; + + // Start Date + $this->start_date = $this->get_start_date(); + + // Generate an ID for the skin + $this->id = isset($this->atts['id']) ? $this->atts['id'] : mt_rand(100, 999); + + // Booking Button + $this->booking_button = isset($this->skin_options['booking_button']) ? (int) $this->skin_options['booking_button'] : 0; + + // SED Method + $this->sed_method = $this->get_sed_method(); + + // Image popup + $this->image_popup = $this->skin_options['image_popup'] ?? '0'; + + // Default View of Full Calendar + $this->default_view = $this->skin_options['default_view'] ?? 'list'; + if(isset($this->skin_options[$this->default_view]) and !$this->skin_options[$this->default_view]) $this->default_view = 'list'; + + // Default style for Monthly View + $this->monthly_style = $this->skin_options['monthly_style'] ?? 'clean'; + if(isset($this->skin_options[$this->monthly_style]) and !$this->skin_options[$this->monthly_style]) $this->monthly_style = 'clean'; + + + $this->yearly = isset($this->skin_options['yearly']) ? $this->skin_options['yearly'] : true; + $this->monthly = isset($this->skin_options['monthly']) ? $this->skin_options['monthly'] : true; + $this->weekly = isset($this->skin_options['weekly']) ? $this->skin_options['weekly'] : true; + $this->daily = isset($this->skin_options['daily']) ? $this->skin_options['daily'] : true; + $this->list = isset($this->skin_options['list']) ? $this->skin_options['list'] : true; + + // If all of skins are disabled + if(!$this->monthly and !$this->weekly and !$this->daily and !$this->list and !$this->yearly) + { + $this->monthly = true; + $this->list = true; + } + + // Set the ID + if(!isset($this->atts['id'])) $this->atts['id'] = $this->id; + } + + public function get_start_date() + { + // Default date + $date = current_time('Y-m-d'); + + if(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'today') $date = current_time('Y-m-d'); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'tomorrow') $date = date('Y-m-d', strtotime('Tomorrow')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'yesterday') $date = date('Y-m-d', strtotime('Yesterday')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_last_month') $date = date('Y-m-d', strtotime('first day of last month')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_current_month') $date = date('Y-m-d', strtotime('first day of this month')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_next_month') $date = date('Y-m-d', strtotime('first day of next month')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'date') $date = date('Y-m-d', strtotime($this->skin_options['start_date'])); + + // Hide past events + if(isset($this->atts['show_past_events']) and !trim($this->atts['show_past_events'])) + { + $today = current_time('Y-m-d'); + if(strtotime($date) < strtotime($today)) $date = $today; + } + + // Show only expired events + if(isset($this->show_expired_events) and $this->show_expired_events) + { + $now = date('Y-m-d H:i:s', current_time('timestamp', 0)); + if(strtotime($date) > strtotime($now)) $date = $now; + } + + return $date; + } + + public function search() + { + } + + public function load_skin($skin = 'list') + { + switch($skin) + { + case 'yearly': + + $atts = $this->atts; + + $start_date_type = isset($this->skin_options['start_date_type']) ? $this->skin_options['start_date_type'] : 'start_current_year'; + + if($start_date_type == 'start_current_month') $start_date_type = 'start_current_year'; + elseif($start_date_type == 'start_next_month') $start_date_type = 'start_next_year'; + else $start_date_type = 'date'; + + $atts['sk-options']['yearly_view']['start_date_type'] = $start_date_type; + $atts['sk-options']['yearly_view']['start_date'] = isset($this->skin_options['start_date']) ? $this->skin_options['start_date'] : current_time('Y-01-01'); + $atts['sk-options']['yearly_view']['style'] = 'modern'; + $atts['sk-options']['yearly_view']['sed_method'] = isset($this->skin_options['sed_method']) ? $this->skin_options['sed_method'] : '0'; + $atts['sk-options']['yearly_view']['image_popup'] = isset($this->skin_options['image_popup']) ? $this->skin_options['image_popup'] : '0'; + $atts['sk-options']['yearly_view']['limit'] = isset($this->skin_options['limit']) ? $this->skin_options['limit'] : 12; + $atts['sf_status'] = false; + + $output = $this->render->vyear($atts); + + break; + + case 'monthly': + + $atts = $this->atts; + $atts['sk-options']['monthly_view']['start_date_type'] = isset($this->skin_options['start_date_type']) ? $this->skin_options['start_date_type'] : ''; + $atts['sk-options']['monthly_view']['start_date'] = isset($this->skin_options['start_date']) ? $this->skin_options['start_date'] : ''; + $atts['sk-options']['monthly_view']['style'] = $this->monthly_style; + $atts['sk-options']['monthly_view']['sed_method'] = isset($this->skin_options['sed_method']) ? $this->skin_options['sed_method'] : '0'; + $atts['sk-options']['monthly_view']['image_popup'] = isset($this->skin_options['image_popup']) ? $this->skin_options['image_popup'] : '0'; + $atts['sk-options']['monthly_view']['limit'] = isset($this->skin_options['limit']) ? $this->skin_options['limit'] : 12; + $atts['sf_status'] = false; + + $output = $this->render->vmonth($atts); + + break; + + case 'weekly': + + $atts = $this->atts; + $atts['sk-options']['weekly_view']['start_date_type'] = isset($this->skin_options['start_date_type']) ? $this->skin_options['start_date_type'] : ''; + $atts['sk-options']['weekly_view']['start_date'] = isset($this->skin_options['start_date']) ? $this->skin_options['start_date'] : ''; + $atts['sk-options']['weekly_view']['sed_method'] = isset($this->skin_options['sed_method']) ? $this->skin_options['sed_method'] : '0'; + $atts['sk-options']['weekly_view']['image_popup'] = isset($this->skin_options['image_popup']) ? $this->skin_options['image_popup'] : '0'; + $atts['sk-options']['weekly_view']['limit'] = isset($this->skin_options['limit']) ? $this->skin_options['limit'] : 12; + $atts['sf_status'] = false; + + $output = $this->render->vweek($atts); + + break; + + case 'daily': + + $atts = $this->atts; + $atts['sk-options']['daily_view']['start_date_type'] = isset($this->skin_options['start_date_type']) ? $this->skin_options['start_date_type'] : ''; + $atts['sk-options']['daily_view']['start_date'] = isset($this->skin_options['start_date']) ? $this->skin_options['start_date'] : ''; + $atts['sk-options']['daily_view']['sed_method'] = isset($this->skin_options['sed_method']) ? $this->skin_options['sed_method'] : '0'; + $atts['sk-options']['daily_view']['image_popup'] = isset($this->skin_options['image_popup']) ? $this->skin_options['image_popup'] : '0'; + $atts['sk-options']['daily_view']['limit'] = isset($this->skin_options['limit']) ? $this->skin_options['limit'] : 12; + $atts['sf_status'] = false; + + $output = $this->render->vday($atts); + + break; + + case 'list': + default: + + $atts = $this->atts; + $atts['sk-options']['list']['start_date_type'] = isset($this->skin_options['start_date_type']) ? $this->skin_options['start_date_type'] : ''; + $atts['sk-options']['list']['start_date'] = isset($this->skin_options['start_date']) ? $this->skin_options['start_date'] : ''; + $atts['sk-options']['list']['style'] = 'standard'; + $atts['sk-options']['list']['sed_method'] = isset($this->skin_options['sed_method']) ? $this->skin_options['sed_method'] : '0'; + $atts['sk-options']['list']['image_popup'] = isset($this->skin_options['image_popup']) ? $this->skin_options['image_popup'] : '0'; + $atts['sk-options']['list']['display_price'] = isset($this->skin_options['display_price']) ? $this->skin_options['display_price'] : 0; + $atts['sk-options']['list']['limit'] = isset($this->skin_options['limit']) ? $this->skin_options['limit'] : 12; + $atts['sf_status'] = false; + + $output = $this->render->vlist($atts); + + break; + } + + return $output; + } + + /** + * Load skin for AJAX request + * @author Webnus + * @return void + */ + public function switch_skin() + { + $this->sf = (isset($_REQUEST['sf']) and is_array($_REQUEST['sf'])) ? $this->main->sanitize_deep_array($_REQUEST['sf']) : []; + $apply_sf_date = isset($_REQUEST['apply_sf_date']) ? sanitize_text_field($_REQUEST['apply_sf_date']) : 1; + $atts = $this->sf_apply(((isset($_REQUEST['atts']) and is_array($_REQUEST['atts'])) ? $this->main->sanitize_deep_array($_REQUEST['atts']) : array()), $this->sf, $apply_sf_date); + + $skin = isset($_REQUEST['skin']) ? sanitize_text_field($_REQUEST['skin']) : 'list'; + + // Single Event Display + $atts['sed_method'] = isset($_REQUEST['sed']) ? sanitize_text_field($_REQUEST['sed']) : 0; + $atts['image_popup'] = isset($_REQUEST['image']) ? sanitize_text_field($_REQUEST['image']) : 0; + + // Initialize the skin + $this->initialize($atts); + + // Return the output + $output = $this->load_skin($skin); + + echo json_encode($output); + exit; + } +} diff --git a/app/skins/default_full_calendar/index.html b/app/skins/default_full_calendar/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/skins/default_full_calendar/tpl.php b/app/skins/default_full_calendar/tpl.php new file mode 100755 index 0000000..270a4dd --- /dev/null +++ b/app/skins/default_full_calendar/tpl.php @@ -0,0 +1,98 @@ +main->load_owl_assets(); + +$sed_method = $this->sed_method; +if($sed_method == 'new') $sed_method = '0'; + +// Generating javascript code tpl +$javascript = ''; + +// Include javascript code into the page +if($this->main->is_ajax() or $this->main->preview()) echo MEC_kses::full($javascript); +else $this->factory->params('footer', $javascript); + +$styling = $this->main->get_styling(); +$event_colorskin = (isset($styling['mec_colorskin'] ) || isset($styling['color'])) ? 'colorskin-custom' : ''; + +$dark_mode = $styling['dark_mode'] ?? ''; +if($dark_mode == 1) $set_dark = 'mec-dark-mode'; +else $set_dark = ''; + +do_action('mec_start_skin', $this->id); +do_action('mec_full_skin_head'); +?> +
    + +
    + sf_status): ?> + "dropdown"); + $sf_text_search = array( "type"=> "text_input" ); + + $sf_month_filter_status = true; + $sf_text_search_status = true; + + $sf_columns = 7; + ?> +
    + +
    + sf_search_field('month_filter', $sf_month_filter , 0)); ?> +
    + +
    + + sf_search_field('text_search', $sf_text_search , 0)); ?> + +
    + +
    +
    +
    + yearly): ?> + monthly): ?> + weekly): ?> + daily): ?> + list): ?> +
    +
    +
    + +
    + load_skin($this->default_view)); ?> +
    + +
    + \ No newline at end of file diff --git a/app/skins/full_calendar.php b/app/skins/full_calendar.php new file mode 100755 index 0000000..ceb35a4 --- /dev/null +++ b/app/skins/full_calendar.php @@ -0,0 +1,458 @@ + + */ +class MEC_skin_full_calendar extends MEC_skins +{ + /** + * @var string + */ + public $skin = 'full_calendar'; + + public $include_local_time; + public $reason_for_cancellation; + public $display_label; + public $default_view; + public $monthly_style; + public $yearly; + public $monthly; + public $weekly; + public $daily; + public $list; + public $list_date_end; + public $list_maximum_date; + public $grid; + public $grid_date_end; + public $grid_maximum_date; + public $tile; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + parent::__construct(); + } + + /** + * Registers skin actions into WordPress + * @author Webnus + */ + public function actions() + { + $this->factory->action('wp_ajax_mec_full_calendar_switch_skin', array($this, 'switch_skin')); + $this->factory->action('wp_ajax_nopriv_mec_full_calendar_switch_skin', array($this, 'switch_skin')); + } + + /** + * Initialize the skin + * @author Webnus + * @param array $atts + */ + public function initialize($atts) + { + $this->atts = $atts; + + // Skin Options + $this->skin_options = (isset($this->atts['sk-options']) and isset($this->atts['sk-options'][$this->skin])) ? $this->atts['sk-options'][$this->skin] : []; + + // Icons + $this->icons = $this->main->icons( + isset($this->atts['icons']) && is_array($this->atts['icons']) ? $this->atts['icons'] : [] + ); + + $this->style = $this->skin_options['style'] ?? 'classic'; + + // Search Form Options + $this->sf_options = (isset($this->atts['sf-options']) and isset($this->atts['sf-options'][$this->skin])) ? $this->atts['sf-options'][$this->skin] : []; + + // Next/Previous Month + $this->next_previous_button = isset($this->skin_options['next_previous_button']) && $this->skin_options['next_previous_button'] ? true : false; + + // Search Form Status + $this->sf_status = isset($this->atts['sf_status']) ? $this->atts['sf_status'] : true; + $this->sf_display_label = isset($this->atts['sf_display_label']) ? $this->atts['sf_display_label'] : false; + $this->sf_reset_button = isset($this->atts['sf_reset_button']) ? $this->atts['sf_reset_button'] : false; + $this->sf_refine = isset($this->atts['sf_refine']) ? $this->atts['sf_refine'] : false; + + // Show Only Expired Events + $this->show_only_expired_events = (isset($this->atts['show_only_past_events']) and trim($this->atts['show_only_past_events'])) ? '1' : '0'; + + // Show Past Events + $this->args['mec-past-events'] = isset($this->atts['show_past_events']) ? $this->atts['show_past_events'] : '0'; + + // Show Ongoing Events + $this->show_ongoing_events = (isset($this->atts['show_only_ongoing_events']) and trim($this->atts['show_only_ongoing_events'])) ? '1' : '0'; + + // Include Ongoing Events + $this->include_ongoing_events = (isset($this->atts['show_ongoing_events']) and trim($this->atts['show_ongoing_events'])) ? '1' : '0'; + + // Include Local Time + $this->include_local_time = (isset($this->skin_options['include_local_time']) and trim($this->skin_options['include_local_time'])) ? '1' : '0'; + + // Start Date + $this->start_date = $this->get_start_date(); + + // Generate an ID for the skin + $this->id = $this->atts['id'] ?? mt_rand(100, 999); + + // Booking Button + $this->booking_button = isset($this->skin_options['booking_button']) ? (int) $this->skin_options['booking_button'] : 0; + + // SED Method + $this->sed_method = $this->get_sed_method(); + + // Image popup + $this->image_popup = $this->skin_options['image_popup'] ?? '0'; + + // reason_for_cancellation + $this->reason_for_cancellation = isset($this->skin_options['reason_for_cancellation']) ? $this->skin_options['reason_for_cancellation'] : false; + + // display_label + $this->display_label = isset($this->skin_options['display_label']) ? $this->skin_options['display_label'] : false; + + // Default View of Full Calendar + $this->default_view = isset($this->skin_options['default_view']) ? $this->skin_options['default_view'] : 'list'; + + // Default style for Monthly View + $this->monthly_style = isset($this->skin_options['monthly_style']) ? $this->skin_options['monthly_style'] : 'clean'; + if(isset($this->skin_options[$this->monthly_style]) and !$this->skin_options[$this->monthly_style]) $this->monthly_style = 'clean'; + + $this->yearly = (isset($this->skin_options['yearly']) and $this->getPRO()) ? $this->skin_options['yearly'] : false; + $this->monthly = isset($this->skin_options['monthly']) ? $this->skin_options['monthly'] : true; + $this->weekly = isset($this->skin_options['weekly']) ? $this->skin_options['weekly'] : true; + $this->daily = isset($this->skin_options['daily']) ? $this->skin_options['daily'] : true; + $this->list = isset($this->skin_options['list']) ? $this->skin_options['list'] : true; + $this->grid = isset($this->skin_options['grid']) ? $this->skin_options['grid'] : true; + $this->tile = isset($this->skin_options['tile']) ? $this->skin_options['tile'] : true; + + // If all the skins are disabled + if(!$this->monthly and !$this->weekly and !$this->daily and !$this->list and !$this->yearly and !$this->grid and !$this->tile) + { + $this->monthly = true; + $this->list = true; + } + + // Validate Default View + if(isset($this->{$this->default_view}) and !$this->{$this->default_view}) $this->default_view = 'list'; + + // Set the ID + if(!isset($this->atts['id'])) $this->atts['id'] = $this->id; + + do_action('mec-full-calendar-initialize-end', $this); + } + + public function get_start_date() + { + // Default date + $date = current_time('Y-m-d'); + + if(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'today') $date = current_time('Y-m-d'); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'tomorrow') $date = date('Y-m-d', strtotime('Tomorrow')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'yesterday') $date = date('Y-m-d', strtotime('Yesterday')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_last_month') $date = date('Y-m-d', strtotime('first day of last month')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_current_month') $date = date('Y-m-d', strtotime('first day of this month')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_next_month') $date = date('Y-m-d', strtotime('first day of next month')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'date') $date = date('Y-m-d', strtotime($this->skin_options['start_date'])); + + // Hide past events + if(isset($this->atts['show_past_events']) and !trim($this->atts['show_past_events'])) + { + $today = current_time('Y-m-d'); + if(strtotime($date) < strtotime($today)) $date = $today; + } + + // Show only expired events + if(isset($this->show_expired_events) and $this->show_expired_events) + { + $now = date('Y-m-d H:i:s', current_time('timestamp')); + if(strtotime($date) > strtotime($now)) $date = $now; + } + + return $date; + } + + public function search() + { + } + + public function prepare_skin_options( $skin, $atts ) { + + switch($skin) + { + case 'yearly': + + $start_date_type = isset($this->skin_options['start_date_type']) ? $this->skin_options['start_date_type'] : 'start_current_year'; + + if($start_date_type == 'start_current_month') $start_date_type = 'start_current_year'; + elseif($start_date_type == 'start_next_month') $start_date_type = 'start_next_year'; + else $start_date_type = 'date'; + + $atts['sk-options']['yearly_view']['start_date_type'] = $start_date_type; + $atts['sk-options']['yearly_view']['start_date'] = (isset($this->skin_options['start_date']) and trim($this->skin_options['start_date'])) ? $this->skin_options['start_date'] : current_time('Y-01-01'); + $atts['sk-options']['yearly_view']['style'] = 'modern'; + $atts['sk-options']['yearly_view']['sed_method'] = isset($this->skin_options['sed_method']) ? $this->skin_options['sed_method'] : '0'; + $atts['sk-options']['yearly_view']['image_popup'] = isset($this->skin_options['image_popup']) ? $this->skin_options['image_popup'] : '0'; + $atts['sk-options']['yearly_view']['display_price'] = isset($this->skin_options['display_price']) ? $this->skin_options['display_price'] : 0; + $atts['sk-options']['yearly_view']['limit'] = isset($this->skin_options['limit']) ? $this->skin_options['limit'] : 12; + $atts['sk-options']['yearly_view']['modern_date_format1'] = isset($this->skin_options['date_format_yearly_1']) ? $this->skin_options['date_format_yearly_1'] : 'l'; + $atts['sk-options']['yearly_view']['modern_date_format2'] = isset($this->skin_options['date_format_yearly_2']) ? $this->skin_options['date_format_yearly_2'] : 'F j'; + $atts['sk-options']['yearly_view']['display_label'] = isset($this->skin_options['display_label']) ? $this->skin_options['display_label'] : false; + $atts['sk-options']['yearly_view']['reason_for_cancellation'] = isset($this->skin_options['reason_for_cancellation']) ? $this->skin_options['reason_for_cancellation'] : false; + $atts['sk-options']['yearly_view']['include_local_time'] = $this->include_local_time; + $atts['sk-options']['yearly_view']['booking_button'] = isset($this->skin_options['booking_button']) ? $this->skin_options['booking_button'] : 0; + $atts['sk-options']['yearly_view']['from_fc'] = 1; + $atts['sf_status'] = false; + + $atts = apply_filters('mec-full-calendar-load-skin-yearly', $atts, $this, 'yearly_view'); + + break; + + case 'monthly': + + $start_date_type = isset($this->skin_options['start_date_type']) ? $this->skin_options['start_date_type'] : 'today'; + if($start_date_type == 'today') $start_date_type = 'start_current_month'; + + $atts['sk-options']['monthly_view']['start_date_type'] = $start_date_type; + $atts['sk-options']['monthly_view']['start_date'] = $this->skin_options['start_date'] ?? ''; + $atts['sk-options']['monthly_view']['style'] = $this->monthly_style; + $atts['sk-options']['monthly_view']['sed_method'] = $this->skin_options['sed_method'] ?? '0'; + $atts['sk-options']['monthly_view']['image_popup'] = $this->skin_options['image_popup'] ?? '0'; + $atts['sk-options']['monthly_view']['display_price'] = $this->skin_options['display_price'] ?? 0; + $atts['sk-options']['monthly_view']['limit'] = $this->skin_options['limit'] ?? 12; + $atts['sk-options']['monthly_view']['display_label'] = $this->skin_options['display_label'] ?? false; + $atts['sk-options']['monthly_view']['mobile_clean_style'] = $this->skin_options['mobile_clean_style'] ?? false; + $atts['sk-options']['monthly_view']['reason_for_cancellation'] = $this->skin_options['reason_for_cancellation'] ?? false; + $atts['sk-options']['monthly_view']['include_local_time'] = $this->include_local_time; + $atts['sk-options']['monthly_view']['activate_first_date'] = $this->skin_options['activate_first_date'] ?? '0'; + $atts['sk-options']['monthly_view']['activate_current_day'] = $this->skin_options['activate_current_day'] ?? '1'; + $atts['sk-options']['monthly_view']['display_all'] = $this->skin_options['display_all'] ?? 0; + $atts['sk-options']['monthly_view']['booking_button'] = $this->skin_options['booking_button'] ?? 0; + $atts['sk-options']['monthly_view']['from_fc'] = 1; + $atts['sf_status'] = false; + + $atts = apply_filters('mec-full-calendar-load-skin-monthly', $atts, $this, 'monthly_view'); + + break; + + case 'weekly': + + $start_date_type = isset($this->skin_options['start_date_type']) ? $this->skin_options['start_date_type'] : 'today'; + if($start_date_type == 'today') $start_date_type = 'start_current_month'; + + $atts['sk-options']['weekly_view']['start_date_type'] = $start_date_type; + $atts['sk-options']['weekly_view']['start_date'] = isset($this->skin_options['start_date']) ? $this->skin_options['start_date'] : ''; + $atts['sk-options']['weekly_view']['sed_method'] = isset($this->skin_options['sed_method']) ? $this->skin_options['sed_method'] : '0'; + $atts['sk-options']['weekly_view']['image_popup'] = isset($this->skin_options['image_popup']) ? $this->skin_options['image_popup'] : '0'; + $atts['sk-options']['weekly_view']['display_price'] = isset($this->skin_options['display_price']) ? $this->skin_options['display_price'] : 0; + $atts['sk-options']['weekly_view']['limit'] = isset($this->skin_options['limit']) ? $this->skin_options['limit'] : 12; + $atts['sk-options']['weekly_view']['display_label'] = isset($this->skin_options['display_label']) ? $this->skin_options['display_label'] : false; + $atts['sk-options']['weekly_view']['reason_for_cancellation'] = isset($this->skin_options['reason_for_cancellation']) ? $this->skin_options['reason_for_cancellation'] : false; + $atts['sk-options']['weekly_view']['include_local_time'] = $this->include_local_time; + $atts['sk-options']['weekly_view']['booking_button'] = isset($this->skin_options['booking_button']) ? $this->skin_options['booking_button'] : 0; + $atts['sk-options']['weekly_view']['from_fc'] = 1; + $atts['sf_status'] = false; + + $atts = apply_filters('mec-full-calendar-load-skin-weekly', $atts, $this, 'weekly_view'); + + break; + + case 'daily': + + $atts['sk-options']['daily_view']['start_date_type'] = isset($this->skin_options['start_date_type']) ? $this->skin_options['start_date_type'] : ''; + $atts['sk-options']['daily_view']['start_date'] = isset($this->skin_options['start_date']) ? $this->skin_options['start_date'] : ''; + $atts['sk-options']['daily_view']['sed_method'] = isset($this->skin_options['sed_method']) ? $this->skin_options['sed_method'] : '0'; + $atts['sk-options']['daily_view']['image_popup'] = isset($this->skin_options['image_popup']) ? $this->skin_options['image_popup'] : '0'; + $atts['sk-options']['daily_view']['display_price'] = isset($this->skin_options['display_price']) ? $this->skin_options['display_price'] : 0; + $atts['sk-options']['daily_view']['limit'] = isset($this->skin_options['limit']) ? $this->skin_options['limit'] : 12; + $atts['sk-options']['daily_view']['display_label'] = isset($this->skin_options['display_label']) ? $this->skin_options['display_label'] : false; + $atts['sk-options']['daily_view']['reason_for_cancellation'] = isset($this->skin_options['reason_for_cancellation']) ? $this->skin_options['reason_for_cancellation'] : false; + $atts['sk-options']['daily_view']['include_local_time'] = $this->include_local_time; + $atts['sk-options']['daily_view']['booking_button'] = isset($this->skin_options['booking_button']) ? $this->skin_options['booking_button'] : 0; + $atts['sk-options']['daily_view']['from_fc'] = 1; + $atts['sf_status'] = false; + + $atts = apply_filters('mec-full-calendar-load-skin-daily', $atts, $this, 'daily_view'); + + break; + + case 'grid': + + // Maximum Date Range. + $end_date_type = (isset($this->skin_options['end_date_type_grid']) and trim($this->skin_options['end_date_type_grid'])) ? trim($this->skin_options['end_date_type_grid']) : 'date'; + + if($end_date_type === 'today') $maximum_date = current_time('Y-m-d'); + elseif($end_date_type === 'tomorrow') $maximum_date = date('Y-m-d', strtotime('Tomorrow')); + else $maximum_date = (isset($this->skin_options['maximum_date_range_grid']) and trim($this->skin_options['maximum_date_range_grid'])) ? trim($this->skin_options['maximum_date_range_grid']) : ''; + + $atts['sk-options']['grid']['start_date_type'] = isset($this->skin_options['start_date_type']) ? $this->skin_options['start_date_type'] : ''; + $atts['sk-options']['grid']['start_date'] = isset($this->skin_options['start_date']) ? $this->skin_options['start_date'] : ''; + $atts['sk-options']['grid']['end_date_type'] = $end_date_type; + $atts['sk-options']['grid']['maximum_date_range'] = $maximum_date; + $atts['sk-options']['grid']['order_method'] = ((isset($this->skin_options['order_method_grid']) and trim($this->skin_options['order_method_grid'])) ? $this->skin_options['order_method_grid'] : 'ASC'); + $atts['sk-options']['grid']['style'] = 'modern'; + $atts['sk-options']['grid']['sed_method'] = isset($this->skin_options['sed_method']) ? $this->skin_options['sed_method'] : '0'; + $atts['sk-options']['grid']['image_popup'] = isset($this->skin_options['image_popup']) ? $this->skin_options['image_popup'] : '0'; + $atts['sk-options']['grid']['display_price'] = isset($this->skin_options['display_price']) ? $this->skin_options['display_price'] : 0; + $atts['sk-options']['grid']['limit'] = isset($this->skin_options['limit']) ? $this->skin_options['limit'] : 12; + $atts['sk-options']['grid']['modern_date_format1'] = 'd'; + $atts['sk-options']['grid']['modern_date_format2'] = 'F'; + $atts['sk-options']['grid']['modern_date_format3'] = 'l'; + $atts['sk-options']['grid']['count'] = '3'; + $atts['sk-options']['grid']['display_label'] = isset($this->skin_options['display_label']) ? $this->skin_options['display_label'] : false; + $atts['sk-options']['grid']['reason_for_cancellation'] = isset($this->skin_options['reason_for_cancellation']) ? $this->skin_options['reason_for_cancellation'] : false; + $atts['sk-options']['grid']['include_local_time'] = $this->include_local_time; + $atts['sk-options']['grid']['booking_button'] = isset($this->skin_options['booking_button']) ? $this->skin_options['booking_button'] : 0; + $atts['sk-options']['grid']['from_fc'] = 1; + $atts['sf_status'] = false; + + $atts = apply_filters('mec-full-calendar-load-skin-grid', $atts, $this, 'grid'); + + break; + + case 'tile': + + $atts['sk-options']['tile']['start_date_type'] = isset($this->skin_options['start_date_type']) ? $this->skin_options['start_date_type'] : ''; + $atts['sk-options']['tile']['start_date'] = isset($this->skin_options['start_date']) ? $this->skin_options['start_date'] : ''; + $atts['sk-options']['tile']['style'] = 'clean'; + $atts['sk-options']['tile']['sed_method'] = isset($this->skin_options['sed_method']) ? $this->skin_options['sed_method'] : '0'; + $atts['sk-options']['tile']['image_popup'] = isset($this->skin_options['image_popup']) ? $this->skin_options['image_popup'] : '0'; + $atts['sk-options']['tile']['display_price'] = isset($this->skin_options['display_price']) ? $this->skin_options['display_price'] : 0; + $atts['sk-options']['tile']['limit'] = isset($this->skin_options['limit']) ? $this->skin_options['limit'] : 12; + $atts['sk-options']['tile']['clean_date_format1'] = 'j'; + $atts['sk-options']['tile']['clean_date_format2'] = 'M'; + $atts['sk-options']['tile']['display_label'] = isset($this->skin_options['display_label']) ? $this->skin_options['display_label'] : false; + $atts['sk-options']['tile']['reason_for_cancellation'] = isset($this->skin_options['reason_for_cancellation']) ? $this->skin_options['reason_for_cancellation'] : false; + $atts['sk-options']['tile']['include_local_time'] = $this->include_local_time; + $atts['sk-options']['tile']['booking_button'] = isset($this->skin_options['booking_button']) ? $this->skin_options['booking_button'] : 0; + $atts['sk-options']['tile']['from_fc'] = 1; + $atts['sf_status'] = false; + + $atts = apply_filters('mec-full-calendar-load-skin-tile', $atts, $this, 'tile'); + + break; + + case 'list': + default: + + // Maximum Date Range. + $end_date_type = (isset($this->skin_options['end_date_type_list']) and trim($this->skin_options['end_date_type_list'])) ? trim($this->skin_options['end_date_type_list']) : 'date'; + + if($end_date_type === 'today') $maximum_date = current_time('Y-m-d'); + elseif($end_date_type === 'tomorrow') $maximum_date = date('Y-m-d', strtotime('Tomorrow')); + else $maximum_date = (isset($this->skin_options['maximum_date_range_list']) and trim($this->skin_options['maximum_date_range_list'])) ? trim($this->skin_options['maximum_date_range_list']) : ''; + + $atts['sk-options']['list']['start_date_type'] = isset($this->skin_options['start_date_type']) ? $this->skin_options['start_date_type'] : ''; + $atts['sk-options']['list']['start_date'] = isset($this->skin_options['start_date']) ? $this->skin_options['start_date'] : ''; + $atts['sk-options']['list']['end_date_type'] = $end_date_type; + $atts['sk-options']['list']['maximum_date_range'] = $maximum_date; + $atts['sk-options']['list']['order_method'] = ((isset($this->skin_options['order_method_list']) and trim($this->skin_options['order_method_list'])) ? $this->skin_options['order_method_list'] : 'ASC'); + $atts['sk-options']['list']['style'] = 'standard'; + $atts['sk-options']['list']['sed_method'] = isset($this->skin_options['sed_method']) ? $this->skin_options['sed_method'] : '0'; + $atts['sk-options']['list']['image_popup'] = isset($this->skin_options['image_popup']) ? $this->skin_options['image_popup'] : '0'; + $atts['sk-options']['list']['display_price'] = isset($this->skin_options['display_price']) ? $this->skin_options['display_price'] : 0; + $atts['sk-options']['list']['limit'] = isset($this->skin_options['limit']) ? $this->skin_options['limit'] : 12; + $atts['sk-options']['list']['standard_date_format1'] = isset($this->skin_options['date_format_list']) ? $this->skin_options['date_format_list'] : 'd M'; + $atts['sk-options']['list']['display_label'] = isset($this->skin_options['display_label']) ? $this->skin_options['display_label'] : false; + $atts['sk-options']['list']['reason_for_cancellation'] = isset($this->skin_options['reason_for_cancellation']) ? $this->skin_options['reason_for_cancellation'] : false; + $atts['sk-options']['list']['include_local_time'] = $this->include_local_time; + $atts['sk-options']['list']['booking_button'] = isset($this->skin_options['booking_button']) ? $this->skin_options['booking_button'] : 0; + $atts['sk-options']['list']['from_fc'] = 1; + $atts['sf_status'] = false; + + $atts = apply_filters('mec-full-calendar-load-skin-list', $atts, $this, 'list'); + + break; + } + + return $atts; + } + + public function load_skin($skin = 'list') { + + $atts = $this->atts; + + $atts = $this->prepare_skin_options( $skin, $atts ); + + switch($skin) + { + case 'yearly': + + $output = $this->render->vyear($atts); + + break; + case 'monthly': + + // Month Rotation + $atts['auto_month_rotation'] = 1; + + $output = $this->render->vmonth($atts); + + break; + case 'weekly': + + $output = $this->render->vweek($atts); + + break; + + case 'daily': + + $output = $this->render->vday($atts); + + break; + + case 'grid': + + $output = $this->render->vgrid($atts); + + break; + + case 'tile': + + $output = $this->render->vtile($atts); + + break; + + case 'list': + default: + + $output = $this->render->vlist($atts); + + break; + } + + return $output; + } + + /** + * Load skin for AJAX request + * @author Webnus + * @return void + */ + public function switch_skin() + { + $this->sf = (isset($_REQUEST['sf']) and is_array($_REQUEST['sf'])) ? $this->main->sanitize_deep_array($_REQUEST['sf']) : []; + $apply_sf_date = isset($_REQUEST['apply_sf_date']) ? sanitize_text_field($_REQUEST['apply_sf_date']) : 1; + $atts = $this->sf_apply(((isset($_REQUEST['atts']) and is_array($_REQUEST['atts'])) ? $this->main->sanitize_deep_array($_REQUEST['atts']) : array()), $this->sf, $apply_sf_date); + + $skin = isset($_REQUEST['skin']) ? sanitize_text_field($_REQUEST['skin']) : 'list'; + + // Single Event Display + $atts['sed_method'] = isset($_REQUEST['sed']) ? sanitize_text_field($_REQUEST['sed']) : 0; + $atts['image_popup'] = isset($_REQUEST['image']) ? sanitize_text_field($_REQUEST['image']) : 0; + + // Initialize the skin + $this->initialize($atts); + + // Return the output + $output = $this->load_skin($skin); + + echo $output; + exit; + } +} diff --git a/app/skins/full_calendar/index.html b/app/skins/full_calendar/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/skins/full_calendar/tpl.php b/app/skins/full_calendar/tpl.php new file mode 100755 index 0000000..3503ace --- /dev/null +++ b/app/skins/full_calendar/tpl.php @@ -0,0 +1,187 @@ +main->load_owl_assets(); + +$sed_method = $this->sed_method; +if($sed_method == 'new') $sed_method = '0'; + +// Generating javascript code tpl +$javascript = ''; + +// Include javascript code into the page +if($this->main->is_ajax() or $this->main->preview()) echo MEC_kses::full($javascript); +else $this->factory->params('footer', $javascript); + +$styling = $this->main->get_styling(); +$event_colorskin = (isset($styling['mec_colorskin'] ) || isset($styling['color'])) ? 'colorskin-custom' : ''; + +$dark_mode = $styling['dark_mode'] ?? ''; +if($dark_mode == 1) $set_dark = 'mec-dark-mode'; +else $set_dark = ''; + +if($this->sf_display_label) $label_all_set = 'mec-there-labels'; +else $label_all_set = ''; + +do_action('mec_start_skin', $this->id); +do_action('mec_full_skin_head'); +?> +
    + +
    + sf_status): ?> + sf_options['month_filter']) ? $this->sf_options['month_filter'] : array()); + $sf_category = (isset($this->sf_options['category']) ? $this->sf_options['category'] : array()); + $sf_location = (isset($this->sf_options['location']) ? $this->sf_options['location'] : array()); + $sf_organizer = (isset($this->sf_options['organizer']) ? $this->sf_options['organizer'] : array()); + $sf_speaker = (isset($this->sf_options['speaker']) ? $this->sf_options['speaker'] : array()); + $sf_tag = (isset($this->sf_options['tag']) ? $this->sf_options['tag'] : array()); + $sf_label = (isset($this->sf_options['label']) ? $this->sf_options['label'] : array()); + $sf_text_search = (isset($this->sf_options['text_search']) ? $this->sf_options['text_search'] : array()); + $sf_address_search = (isset($this->sf_options['address_search']) ? $this->sf_options['address_search'] : array()); + $sf_event_cost = (isset($this->sf_options['event_cost']) ? $this->sf_options['event_cost'] : array()); + $sf_local_time = (isset($this->sf_options['time_filter']) ? $this->sf_options['time_filter'] : array()); + $sf_fields = ((isset($this->sf_options['fields']) and is_array($this->sf_options['fields'])) ? $this->sf_options['fields'] : array()); + + $sf_month_filter_status = (isset($sf_month_filter['type']) and trim($sf_month_filter['type'])); + $sf_category_status = (isset($sf_category['type']) and trim($sf_category['type'])); + $sf_location_status = (isset($sf_location['type']) and trim($sf_location['type'])); + $sf_organizer_status = (isset($sf_organizer['type']) and trim($sf_organizer['type'])); + $sf_speaker_status = (isset($sf_speaker['type']) and trim($sf_speaker['type'])); + $sf_tag_status = (isset($sf_tag['type']) and trim($sf_tag['type'])); + $sf_label_status = (isset($sf_label['type']) and trim($sf_label['type'])); + $sf_text_search_status = (isset($sf_text_search['type']) and trim($sf_text_search['type'])); + $sf_address_search_status = (isset($sf_address_search['type']) and trim($sf_address_search['type'])); + $sf_event_cost_status = (isset($sf_event_cost['type']) and trim($sf_event_cost['type'])); + $sf_local_time_status = (isset($sf_local_time['type']) and trim($sf_local_time['type'])); + + $sf_fields_status = false; + if(is_array($sf_fields) and count($sf_fields)) + { + foreach($sf_fields as $sf_field) if(isset($sf_field['type']) and $sf_field['type']) $sf_fields_status = true; + } + + // Status of Speakers Feature + $speakers_status = (!isset($this->settings['speakers_status']) or (isset($this->settings['speakers_status']) and !$this->settings['speakers_status'])) ? false : true; + $sf_columns = 12; + ?> + +
    + + + +
    + + sf_search_field('category', $sf_category , $this->sf_display_label)); ?> + + + sf_search_field('location', $sf_location , $this->sf_display_label)); ?> + + + sf_search_field('organizer', $sf_organizer , $this->sf_display_label)); ?> + + + sf_search_field('speaker', $sf_speaker , $this->sf_display_label)); ?> + + + sf_search_field('tag', $sf_tag , $this->sf_display_label)); ?> + + + sf_search_field('label', $sf_label , $this->sf_display_label)); ?> + +
    +
    + +
    + sf_search_field('fields', $sf_fields , $this->sf_display_label)); ?> +
    + +
    + + sf_search_field('address_search', $sf_address_search , $this->sf_display_label)); ?> + + + sf_search_field('event_cost', $sf_event_cost , $this->sf_display_label)); ?> + +
    +
    + + sf_search_field('text_search', $sf_text_search , $this->sf_display_label)); ?> + + + sf_search_field('month_filter', $sf_month_filter , $this->sf_display_label)); ?> + + + sf_search_field('time_filter', $sf_local_time , $this->sf_display_label)); ?> + + sf_reset_button): ?> +
    + +
    +
    + yearly): ?> + monthly): ?> + weekly): ?> + daily): ?> + list): ?> + grid): ?> + tile): ?> +
    +
    +
    + +
    +
    + yearly): ?> + monthly): ?> + weekly): ?> + daily): ?> + list): ?> + grid): ?> + tile): ?> +
    +
    + sf_status): ?> +
    + +
    + load_skin($this->default_view)); ?> +
    + + subscribe_to_calendar(); ?> +
    \ No newline at end of file diff --git a/app/skins/general_calendar.php b/app/skins/general_calendar.php new file mode 100755 index 0000000..925647c --- /dev/null +++ b/app/skins/general_calendar.php @@ -0,0 +1,699 @@ + + */ +class MEC_skin_general_calendar extends MEC_skins +{ + /** + * @var string + */ + public $skin = 'general_calendar'; + public $activate_first_date = false; + public $display_all = false; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + parent::__construct(); + } + + /** + * Registers skin actions into WordPress + * @author Webnus + */ + public function actions() + { + $this->factory->action('wp_ajax_mec_general_calendar_load_month', array($this, 'load_month')); + $this->factory->action('wp_ajax_nopriv_mec_general_calendar_load_month', array($this, 'load_month')); + $this->factory->action('rest_api_init', array($this, 'mec_general_calendar_get_events_api')); + } + + public function mec_general_calendar_get_events_api() + { + register_rest_route( 'mec/v1', '/events', array( + 'methods' => 'GET', + 'callback' => array($this, 'get_general_calendar_events'), + 'permission_callback' => '__return_true', + )); + } + + public function switch_language( $locale ) + { + $language = false; + + if(function_exists('PLL')) $language = PLL()->curlang->locale; + if($language) switch_to_locale($language); + } + + /** + * @param WP_REST_Request $request + * @return array + */ + public function get_general_calendar_events($request) + { + // Params + $startParam = $request->get_param('startParam'); + $endParam = $request->get_param('endParam'); + $categories = $request->get_param('categories') ? $request->get_param('categories') : NULL; + $multiCategories = $request->get_param('multiCategories') ? json_decode($request->get_param('multiCategories')) : NULL; + $location = $request->get_param('location') ? $request->get_param('location') : NULL; + $organizer = $request->get_param('organizer') ? $request->get_param('organizer') : NULL; + $speaker = $request->get_param('speaker') ? $request->get_param('speaker') : NULL; + $label = $request->get_param('label') ? $request->get_param('label') : NULL; + $tag = $request->get_param('tag') ? $request->get_param('tag') : NULL; + $cost_min = $request->get_param('cost_min') ? $request->get_param('cost_min') : NULL; + $cost_max = $request->get_param('cost_max') ? $request->get_param('cost_max') : NULL; + $show_past_events = $request->get_param('show_past_events'); + $show_only_past_events = $request->get_param('show_only_past_events'); + $show_only_one_occurrence = $request->get_param('show_only_one_occurrence'); + $display_label = $request->get_param('display_label'); + $reason_for_cancellation = $request->get_param('reason_for_cancellation'); + $is_category_page = $request->get_param('is_category_page') ? $request->get_param('is_category_page') : NULL; + $cat_id = $request->get_param('cat_id') ? $request->get_param('cat_id') : NULL; + $local_time = $request->get_param('local_time') ? $request->get_param('local_time') : NULL; + $filter_category = $request->get_param('filter_category') ? explode(',', $request->get_param('filter_category')) : NULL; + $filter_location = $request->get_param('filter_location') ? explode(',', $request->get_param('filter_location')) : NULL; + $filter_organizer = $request->get_param('filter_organizer') ? explode(',', $request->get_param('filter_organizer')) : NULL; + $filter_label = $request->get_param('filter_label') ? explode(',', $request->get_param('filter_label')) : NULL; + $filter_tag = $request->get_param('filter_tag') ? explode(',', $request->get_param('filter_tag')) : NULL; + $filter_author = $request->get_param('filter_author') ? explode(',', $request->get_param('filter_author')) : NULL; + $locale = $request->get_param('locale') ; + $type_event = $request->get_param('type_event') ; + + $this->switch_language($locale); + + // Attributes + $atts = array( + 'show_past_events' => $show_past_events, + 'show_only_past_events' => $show_only_past_events, + 'show_only_one_occurrence' => $show_only_one_occurrence, + 'start_date_type' => 'start_current_month', + 'show_ongoing_events' => '1', + 'sk-options'=> array( + 'general_calendar' => array('limit'=>100) + ), + ); + + // Initialize the skin + $this->initialize($atts); + + // Fetch the events + $upcoming_events = $this->get_events( + $startParam, + $endParam, + $categories, + $multiCategories, + $location, + $organizer, + $speaker, + $label, + $tag, + $cost_min, + $cost_max, + $is_category_page, + $cat_id, + $show_only_one_occurrence, + $filter_category, + $filter_location, + $filter_organizer, + $filter_label, + $filter_tag, + $filter_author, + $locale, + $type_event + ); + + $localtime = $this->skin_options['include_local_time'] ?? false; + $events = []; + foreach($upcoming_events as $content) + { + $event_a = []; + foreach($content as $event) + { + $loc = ''; + if(isset($event->data->locations) && !empty($event->data->locations)) + { + foreach($event->data->locations as $location) if($location['address']) $loc = $location['address']; + } + + $labels = ''; + if(isset($event->data->labels) && !empty($event->data->labels) && $display_label) + { + foreach($event->data->labels as $label) $labels .= '' . trim($label['name']) . ''; + } + + $event_title = $event->data->title; + $event_link = $this->main->get_event_date_permalink($event, $event->date['start']['date']); + $event_color = $this->get_event_color_dot($event, true); + $event_content = $event->data->content; + $event_date_start = $this->main->date_i18n('c', $event->date['start']['timestamp']); + $event_date_start_str = $event->date['start']['timestamp']; + $event_date_end = $this->main->date_i18n('c', $event->date['end']['timestamp']); + $event_date_end_str = $event->date['end']['timestamp']; + $event_image = $event->data->featured_image['full']; + $gridsquare = get_the_post_thumbnail($event->data->ID, 'gridsquare' , array('data-mec-postid' => $event->data->ID)); + $event_time = $event->data->time; + + $event_a['id'] = $event->data->ID; + $event_a['title'] = html_entity_decode($event_title); + $event_a['start'] = $event_date_start; + $event_a['end'] = $event_date_end; + $event_a['startStr'] = $event_date_start_str; + $event_a['endStr'] = $event_date_end_str; + $event_a['image'] = $event_image; + $event_a['url'] = $event_link; + $event_a['backgroundColor'] = $event_color; + $event_a['borderColor'] = $event_color; + $event_a['description'] = $event_content; + $event_a['localtime'] = $localtime; + $event_a['location'] = $loc; + $event_a['start_date'] = date_i18n(get_option('date_format'), $event_date_start_str); + $event_a['start_time'] = $event_time['start']; + $event_a['end_date'] = date_i18n(get_option('date_format'), $event_date_end_str); + $event_a['end_time'] = $event_time['end']; + $event_a['startDateStr'] = strtotime($event_a['start_date']); + $event_a['endDateStr'] = strtotime($event_a['end_date']); + $event_a['startDay'] = date_i18n("l", $event_date_start_str); + $event_a['labels'] = $labels; + $event_a['reason_for_cancellation'] = $this->main->display_cancellation_reason($event, $reason_for_cancellation); + $event_a['locaTimeHtml'] = ($local_time == '1' ? $this->main->module('local-time.type2', array('event' => $event)) : ''); + $event_a['gridsquare'] = $gridsquare; + + $event_a = apply_filters('mec_general_calendar_event_data', $event_a, $event); + $events[] = $event_a; + } + } + + return array_values( + array_reduce($events, function($r, $a){ + if (!isset($r[$a['id'] . $a['endStr']])) $r[$a['id'] . $a['endStr']] = $a; + return $r; + }, []) + ); + } + + /** + * Initialize the skin + * @author Webnus + * @param array $atts + */ + public function initialize($atts) + { + $this->atts = $atts; + + // Skin Options + $this->skin_options = (isset($this->atts['sk-options']) and isset($this->atts['sk-options'][$this->skin])) ? $this->atts['sk-options'][$this->skin] : []; + + // Icons + $this->icons = $this->main->icons( + isset($this->atts['icons']) && is_array($this->atts['icons']) ? $this->atts['icons'] : [] + ); + + // Search Form Options + $this->sf_options = (isset($this->atts['sf-options']) and isset($this->atts['sf-options'][$this->skin])) ? $this->atts['sf-options'][$this->skin] : []; + + // Search Form Status + $this->sf_status = $this->atts['sf_status'] ?? true; + $this->sf_display_label = $this->atts['sf_display_label'] ?? false; + $this->sf_reset_button = $this->atts['sf_reset_button'] ?? false; + $this->sf_refine = $this->atts['sf_refine'] ?? false; + + // The events + $this->events_str = ''; + + // Generate an ID for the skin + $this->id = $this->atts['id'] ?? mt_rand(100, 999); + + // Set the ID + if(!isset($this->atts['id'])) $this->atts['id'] = $this->id; + + // The style + $this->style = $this->skin_options['style'] ?? 'modern'; + if($this->style == 'fluent' and !is_plugin_active('mec-fluent-layouts/mec-fluent-layouts.php')) $this->style = 'modern'; + + // Next/Previous Month + $this->next_previous_button = isset($this->skin_options['next_previous_button']) ? $this->skin_options['next_previous_button'] : true; + + // Display All Events + $this->display_all = (((in_array($this->style, array('clean', 'modern')) and isset($this->skin_options['display_all']))) && $this->skin_options['display_all']); + + // Override the style if the style forced by us in a widget etc + if(isset($this->atts['style']) and trim($this->atts['style']) != '') $this->style = $this->atts['style']; + + // HTML class + $this->html_class = ''; + if(isset($this->atts['html-class']) and trim($this->atts['html-class']) != '') $this->html_class = $this->atts['html-class']; + + // Booking Button + $this->booking_button = isset($this->skin_options['booking_button']) ? (int) $this->skin_options['booking_button'] : 0; + + // SED Method + $this->sed_method = $this->get_sed_method(); + + // reason_for_cancellation + $this->reason_for_cancellation = $this->skin_options['reason_for_cancellation'] ?? false; + + // display_label + $this->display_label = $this->skin_options['display_label'] ?? false; + + // Image popup + $this->image_popup = $this->skin_options['image_popup'] ?? '0'; + + // From Widget + $this->widget = isset($this->atts['widget']) && trim($this->atts['widget']); + + // From Full Calendar + $this->from_full_calendar = (isset($this->skin_options['from_fc']) and trim($this->skin_options['from_fc'])); + + // Display Price + $this->display_price = (isset($this->skin_options['display_price']) and trim($this->skin_options['display_price'])); + + // Detailed Time + $this->display_detailed_time = (isset($this->skin_options['detailed_time']) and trim($this->skin_options['detailed_time'])); + + // Init MEC + $this->args['mec-init'] = true; + $this->args['mec-skin'] = $this->skin; + + // Post Type + $this->args['post_type'] = $this->main->get_main_post_type(); + + // Post Status + $this->args['post_status'] = 'publish'; + + // Keyword Query + $this->args['s'] = $this->keyword_query(); + + // Taxonomy + $this->args['tax_query'] = $this->tax_query(); + + // Meta + $this->args['meta_query'] = $this->meta_query(); + + // Tag + if(apply_filters('mec_taxonomy_tag', '') === 'post_tag') $this->args['tag'] = $this->tag_query(); + + // Author + $this->args['author'] = $this->author_query(); + $this->args['author__not_in'] = $this->author_query_ex(); + + // Pagination Options + $this->paged = get_query_var('paged', 1); + $this->limit = (isset($this->skin_options['limit']) and trim($this->skin_options['limit'])) ? $this->skin_options['limit'] : 12; + + $this->args['posts_per_page'] = $this->limit; + $this->args['paged'] = $this->paged; + + // Sort Options + $this->args['orderby'] = 'mec_start_day_seconds ID'; + $this->args['order'] = 'ASC'; + $this->args['meta_key'] = 'mec_start_day_seconds'; + + // Show Only Expired Events + $this->show_only_expired_events = (isset($this->atts['show_only_past_events']) and trim($this->atts['show_only_past_events'])) ? '1' : '0'; + + // Show Past Events + if($this->show_only_expired_events) $this->atts['show_past_events'] = '1'; + + // Show Past Events + $this->args['mec-past-events'] = $this->atts['show_past_events'] ?? '0'; + + // Start Date + list($this->year, $this->month, $this->day) = $this->get_start_date(); + + $this->start_date = date('Y-m-d', strtotime($this->year.'-'.$this->month.'-'.$this->day)); + + // We will extend the end date in the loop + $this->end_date = $this->start_date; + + // Activate First Date With Event + $this->activate_first_date = (isset($this->skin_options['activate_first_date']) and $this->skin_options['activate_first_date']); + } + + /** + * /** + * Search and returns the filtered events + * @author Webnus + * @param $start + * @param $end + * @param null $categories + * @param null $multiCategories + * @param null $location + * @param null $organizer + * @param null $speaker + * @param null $label + * @param null $tag + * @param null $cost_min + * @param null $cost_max + * @param null $is_category_page + * @param null $cat_id + * @param null $show_only_one_occurrence + * @param null $filter_category + * @param null $filter_location + * @param null $filter_organizer + * @param null $filter_label + * @param null $filter_tag + * @param null $filter_author + * @param string $locale + * @param null $type_event + * @return array of objects + */ + public function get_events($start, $end, $categories = null, $multiCategories = null, $location = null, $organizer = null, $speaker = null, $label = null, $tag = null, $cost_min = null, $cost_max = null, $is_category_page = null, $cat_id = null, $show_only_one_occurrence = null, $filter_category = null, $filter_location = null, $filter_organizer = null, $filter_label = null, $filter_tag = null, $filter_author = null, $locale = 'en',$type_event = null) + { + $start = date('Y-m-d', strtotime($start)); + $end = date('Y-m-d', strtotime($end)); + + if($this->show_only_expired_events) + { + $start = date('Y-m-d H:i:s', current_time('timestamp', 0)); + $end = date('Y-m-d', strtotime('first day of this month')); + + $this->weeks = $this->main->split_to_weeks($end, $start); + + $this->week_of_days = []; + foreach($this->weeks as $week_number=>$week) foreach($week as $day) $this->week_of_days[$day] = $week_number; + + $end = $this->main->array_key_first($this->week_of_days); + } + + // Taxonomy Query + $tax_query = array( + 'relation' => 'AND' + ); + + if (!is_null($is_category_page) && $is_category_page != 'undefined' && !is_null($cat_id) && $cat_id != 'undefined' ){ + $tax_query[] = array( + 'taxonomy' => 'mec_category', + 'field' => 'id', + 'terms' => array($cat_id), + 'operator' => 'IN' + ); + } + + if (!is_null($categories) && $categories != 'undefined' ){ + $tax_query[] = array( + 'taxonomy' => 'mec_category', + 'field' => 'id', + 'terms' => array($categories), + 'operator' => 'IN' + ); + } + + if (!is_null($multiCategories) && $multiCategories != 'undefined' && count($multiCategories) > 0 ){ + $tax_query[] = array( + 'taxonomy' => 'mec_category', + 'field' => 'id', + 'terms' => $multiCategories, + 'operator' => 'IN' + ); + } + + if (!is_null($filter_category) && $filter_category != 'undefined' ){ + $tax_query[] = array( + 'taxonomy' => 'mec_category', + 'field' => 'id', + 'terms' => is_array($filter_category) ? $filter_category : array($filter_category), + 'operator' => 'IN' + ); + } + + if (!is_null($location) && $location != 'undefined'){ + $tax_query[] = array( + 'taxonomy' => 'mec_location', + 'field' => 'id', + 'terms' => array($location), + 'operator' => 'IN' + ); + } + + if (!is_null($filter_location) && $filter_location != 'undefined'){ + $tax_query[] = array( + 'taxonomy' => 'mec_location', + 'field' => 'id', + 'terms' => is_array($filter_location) ? $filter_location : array($filter_location), + 'operator' => 'IN' + ); + } + + if (!is_null($organizer) && $organizer != 'undefined'){ + $tax_query[] = array( + 'taxonomy' => 'mec_organizer', + 'field' => 'id', + 'terms' => array($organizer), + 'operator' => 'IN' + ); + } + + if (!is_null($filter_organizer) && $filter_organizer != 'undefined'){ + $tax_query[] = array( + 'taxonomy' => 'mec_organizer', + 'field' => 'id', + 'terms' => is_array($filter_organizer) ? $filter_organizer : array($filter_organizer), + 'operator' => 'IN' + ); + } + + if (!is_null($speaker) && $speaker != 'undefined'){ + $tax_query[] = array( + 'taxonomy' => 'mec_speaker', + 'field' => 'id', + 'terms' => array($speaker), + 'operator' => 'IN' + ); + } + + if (!is_null($label) && $label != 'undefined'){ + $tax_query[] = array( + 'taxonomy' => 'mec_label', + 'field' => 'id', + 'terms' => array($label), + 'operator' => 'IN' + ); + } + + if (!is_null($filter_label) && $filter_label != 'undefined'){ + $tax_query[] = array( + 'taxonomy' => 'mec_label', + 'field' => 'id', + 'terms' => is_array($filter_label) ? $filter_label : array($filter_label), + 'operator' => 'IN' + ); + } + + if (!is_null($filter_author) && $filter_author != 'undefined'){ + $tax_query[] = array( + 'taxonomy' => 'mec_author', + 'field' => 'id', + 'terms' => is_array($filter_author) ? $filter_author : array($filter_author), + 'operator' => 'IN' + ); + } + + $mec_tag_query = NULL; + if (!is_null($tag) && $tag != 'undefined'){ + $term = get_term_by('id', $tag, apply_filters('mec_taxonomy_tag', '')); + if($term) $mec_tag_query = $term->slug; + } + + if (!is_null($filter_tag) && $filter_tag != 'undefined'){ + $term = get_term_by('id', $filter_tag, apply_filters('mec_taxonomy_tag', '')); + if($term) $mec_tag_query = $term->slug; + } + + // Meta Query + $meta_query = array( + 'relation' => 'AND', + ); + if (!is_null($cost_min) && $cost_min != 'undefined'){ + $meta_query[] = array( + 'key' => 'mec_cost', + 'value' => $cost_min, + 'type' => 'numeric', + 'compare' => '>=', + ); + } + if (!is_null($cost_max) && $cost_max != 'undefined'){ + $meta_query[] = array( + 'key' => 'mec_cost', + 'value' => $cost_max, + 'type' => 'numeric', + 'compare' => '<=', + ); + } + + if (!is_null($type_event) && $type_event != 'undefined'&& $type_event != 'all'){ + $meta_query[] = array( + 'key' => 'mec_event_status', + 'value' => $type_event, + 'compare' => '=', + ); + } + + $this->args['tax_query'] = $tax_query; + $this->args['meta_query'] = $meta_query; + $this->args['tag'] = $mec_tag_query; + $this->args['lang'] = $locale; + + $dates = $this->period($start, $end, true); + ksort($dates); + + if($this->show_only_expired_events && $this->loadMoreRunning) $this->show_only_expired_events = '1'; + + // Limit + $this->args['posts_per_page'] = $this->limit; + + $i = 0; + $found = 0; + $events = []; + + foreach($dates as $date=>$IDs) + { + // No Event + if(!is_array($IDs) or (is_array($IDs) and !count($IDs))) continue; + + // Check Finish Date + if(isset($this->maximum_date) and trim($this->maximum_date) and strtotime($date) > strtotime($this->maximum_date)) break; + + // Include Available Events + $this->args['post__in'] = $IDs; + + // Count of events per day + $IDs_count = array_count_values($IDs); + + // Extending the end date + $this->end_date = $date; + + // Continue to load rest of events in the first date + if($i === 0) $this->args['offset'] = $this->offset; + // Load all events in the rest of dates + else + { + $this->offset = 0; + $this->args['offset'] = 0; + } + + // The Query + $this->args['posts_per_page'] = 1000; + $this->args = apply_filters('mec_skin_query_args', $this->args, $this); + + $query = new WP_Query($this->args); + if($query->have_posts()) + { + if(!isset($events[$date])) $events[$date] = []; + + // Day Events + $d = []; + + // The Loop + while($query->have_posts()) + { + $query->the_post(); + $ID = get_the_ID(); + + $one_occurrence = get_post_meta($ID, 'one_occurrence', true); + if ( $show_only_one_occurrence != '0' and !is_null($show_only_one_occurrence) ) { + if ($one_occurrence != '1') { + if ( !isset($IDs_count[$ID]) ) continue; + } else { + continue; + } + } + + $ID_count = $IDs_count[$ID] ?? 1; + for($i = 1; $i <= $ID_count; $i++) + { + $rendered = $this->render->data($ID); + + $data = new stdClass(); + $data->ID = $ID; + $data->data = $rendered; + + $data->date = array + ( + 'start' => array('date' => $this->main->get_start_of_multiple_days($ID, $date)), + 'end' => array('date' => $this->main->get_end_date($date, $rendered)) + ); + $d[] = $this->render->after_render($data, $this, $i); + + $found++; + } + + if($found >= 1000) + { + // Next Offset + $this->next_offset = ($query->post_count-($query->current_post+1)) >= 0 ? ($query->current_post+1)+$this->offset : 0; + + usort($d, [$this, 'sort_day_events']); + $events[$date] = $d; + + // Restore original Post Data + wp_reset_postdata(); + + break 2; + } + } + + usort($d, [$this, 'sort_day_events']); + $events[$date] = $d; + } + + // Restore original Post Data + wp_reset_postdata(); + $i++; + } + + // Initialize Occurrences' Data + MEC_feature_occurrences::fetch($events); + + // Set Offset for Last Page + if($found < $this->limit) + { + // Next Offset + $this->next_offset = $found + ((isset($date) and $this->start_date === $date) ? $this->offset : 0); + } + + // Set found events + $this->found = $found; + return $events; + } + + /** + * Returns start day of skin for filtering events + * @author Webnus + * @return array + */ + public function get_start_date() + { + // Default date + $date = current_time('Y-m-d'); + + if(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_current_month') $date = date('Y-m-d', strtotime('first day of this month')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_next_month') $date = date('Y-m-d', strtotime('first day of next month')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_last_month') $date = date('Y-m-d', strtotime('first day of last month')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'date') $date = date('Y-m-d', strtotime($this->skin_options['start_date'])); + + // Hide past events + if(isset($this->atts['show_past_events']) and !trim($this->atts['show_past_events'])) + { + $today = current_time('Y-m-d'); + if(strtotime($date) < strtotime($today)) $date = $today; + } + + // Show only expired events + if(isset($this->show_only_expired_events) and $this->show_only_expired_events) + { + $yesterday = date('Y-m-d', strtotime('Yesterday')); + if(strtotime($date) > strtotime($yesterday)) $date = $yesterday; + } + + $time = strtotime($date); + return array(date('Y', $time), date('m', $time), date('d', $time)); + } +} diff --git a/app/skins/general_calendar/render.php b/app/skins/general_calendar/render.php new file mode 100755 index 0000000..9fd1925 --- /dev/null +++ b/app/skins/general_calendar/render.php @@ -0,0 +1,3 @@ +id); +do_action('mecgeneral_calendar_skin_head'); + +// Month picker Assets +$this->main->load_month_picker_assets(); + +// Shortcode Options +$local_time = (isset($this->skin_options['include_local_time']) and !empty( $this->skin_options['include_local_time'] )) ? $this->skin_options['include_local_time'] : false; +$display_label = (isset($this->skin_options['display_label']) and !empty( $this->skin_options['display_label'] )) ? $this->skin_options['display_label'] : false; +$reason_for_cancellation = (isset($this->skin_options['reason_for_cancellation']) and !empty( $this->skin_options['reason_for_cancellation'] )) ? $this->skin_options['reason_for_cancellation'] : false; +$more_event = (isset($this->skin_options['more_event']) and !empty( $this->skin_options['more_event'] )) ? (int) $this->skin_options['more_event'] : 10; +//var_dump($more_event); + +$sed_method = ''; +if(isset($this->skin_options['sed_method']) and !empty($this->skin_options['sed_method'])) $sed_method = ($this->skin_options['sed_method'] == 'new') ? '_blank' : ($this->skin_options['sed_method'] == '0' ? '_self' : $this->skin_options['sed_method']); + +// Shortcode Filters +$filter_category = get_post_meta($this->id, 'category', true) ? get_post_meta($this->id, 'category', true) : ''; +$filter_location = get_post_meta($this->id, 'location', true) ? get_post_meta($this->id, 'location', true) : ''; +$filter_organizer = get_post_meta($this->id, 'organizer', true) ? get_post_meta($this->id, 'organizer', true) : ''; +$filter_label = get_post_meta($this->id, 'label', true) ? get_post_meta($this->id, 'label', true) : ''; +$filter_tag = get_post_meta($this->id, 'tag', true) ? get_post_meta($this->id, 'tag', true) : ''; +$filter_author = get_post_meta($this->id, 'author', true) ? get_post_meta($this->id, 'author', true) : ''; +$show_past_events = ($this->atts['show_past_events'] ?? '0'); +$show_only_past_events = ($this->atts['show_only_past_events'] ?? '0'); +$show_only_one_occurrence = (isset($this->atts['show_only_one_occurrence']) && $this->atts['show_only_one_occurrence'] != '0') ? '1' : '0'; +$mec_tax_input = (isset($this->atts['mec_tax_input']) && $this->atts['mec_tax_input'] != '0') ? $this->atts['mec_tax_input'] : ''; + +// WordPress Options +$lang = !empty(substr(get_locale(), 0, strpos(get_locale(), "_"))) ? substr(get_locale(), 0, strpos(get_locale(), "_")) : get_locale(); +$direction = is_rtl() ? 'rtl' : 'ltr'; +$border_direction = is_rtl() ? 'border-right-width' : 'border-left-width'; +$border_direction_style = is_rtl() ? 'border-left-style' : 'border-right-style'; +$is_category_page = is_tax('mec_category'); +$cat_id = ''; +if($is_category_page) +{ + $category = get_queried_object(); + $cat_id = $category->term_id; +} + +$week_start_day = (int) get_option('start_of_week'); +if(!function_exists('mec_general_calendar_find_event')) +{ + // Search Options + function mec_general_calendar_find_event($sf_options, $find_filter) + { + if($find_filter === 'find' and is_array($sf_options)) + { + if( + (isset($sf_options['category']) && $sf_options['category']['type'] != '0' && !is_null($sf_options['category']['type'])) || + (isset($sf_options['location']) && $sf_options['location']['type'] != '0' && !is_null($sf_options['location']['type'])) || + (isset($sf_options['organizer']) && $sf_options['organizer']['type'] != '0' && !is_null($sf_options['organizer']['type'])) || + (isset($sf_options['speaker']) && $sf_options['speaker']['type'] != '0' && !is_null($sf_options['speaker']['type'])) || + (isset($sf_options['tag']) && $sf_options['tag']['type'] != '0' && !is_null($sf_options['tag']['type'])) || + (isset($sf_options['label']) && $sf_options['label']['type'] != '0' && !is_null($sf_options['label']['type'])) || + (isset($sf_options['event_cost']) && $sf_options['event_cost']['type'] != '0' && !is_null($sf_options['event_cost']['type'])) || + (isset($sf_options['text_search']) && $sf_options['text_search']['type'] != '0' && !is_null($sf_options['text_search']['type'])) || + (isset($sf_options['address_search']) && $sf_options['address_search']['type'] != '0' && !is_null($sf_options['address_search']['type'])) + ) return true; + else return false; + } + + if($find_filter === 'filter' and is_array($sf_options)) + { + if( + (isset($sf_options['category']) && $sf_options['category']['type'] != '0' && !is_null($sf_options['category']['type'])) || + (isset($sf_options['location']) && $sf_options['location']['type'] != '0' && !is_null($sf_options['location']['type'])) || + (isset($sf_options['organizer']) && $sf_options['organizer']['type'] != '0' && !is_null($sf_options['organizer']['type'])) || + (isset($sf_options['speaker']) && $sf_options['speaker']['type'] != '0' && !is_null($sf_options['speaker']['type'])) || + (isset($sf_options['tag']) && $sf_options['tag']['type'] != '0' && !is_null($sf_options['tag']['type'])) || + (isset($sf_options['label']) && $sf_options['label']['type'] != '0' && !is_null($sf_options['label']['type'])) || + (isset($sf_options['event_cost']) && $sf_options['event_cost']['type'] != '0' && !is_null($sf_options['event_cost']['type'])) || + (isset($sf_options['address_search']) && $sf_options['address_search']['type'] != '0' && !is_null($sf_options['address_search']['type'])) + ) return true; + else return false; + } + + return false; + } +} +wp_enqueue_script('mec-niceselect-script'); +?> +
    + +
    +
    +
    + sf_options) && isset($this->sf_options['category']) && $this->sf_options['category']['type'] != '0') ? MEC_kses::form($this->sf_search_field('category', array('type' => $this->sf_options['category']['type']))) : ''); + echo ((is_array($this->sf_options) && isset($this->sf_options['location']) && $this->sf_options['location']['type'] != '0') ? MEC_kses::form($this->sf_search_field('location', array('type' => $this->sf_options['location']['type']))) : ''); + echo ((is_array($this->sf_options) && isset($this->sf_options['organizer']) && $this->sf_options['organizer']['type'] != '0') ? MEC_kses::form($this->sf_search_field('organizer', array('type' => $this->sf_options['organizer']['type']))) : ''); + echo ((is_array($this->sf_options) && isset($this->sf_options['speaker']) && $this->sf_options['speaker']['type'] != '0') ? MEC_kses::form($this->sf_search_field('speaker', array('type' => $this->sf_options['speaker']['type']))) : ''); + echo ((is_array($this->sf_options) && isset($this->sf_options['tag']) && $this->sf_options['tag']['type'] != '0') ? MEC_kses::form($this->sf_search_field('tag', array('type' => $this->sf_options['tag']['type']))) : ''); + echo ((is_array($this->sf_options) && isset($this->sf_options['label']) && $this->sf_options['label']['type'] != '0') ? MEC_kses::form($this->sf_search_field('label', array('type' => $this->sf_options['label']['type']))) : ''); + echo ((is_array($this->sf_options) && isset($this->sf_options['address_search']) && $this->sf_options['address_search']['type'] != '0') ? MEC_kses::form($this->sf_search_field('address_search', array('type' => $this->sf_options['address_search']['type']))) : ''); + echo ((is_array($this->sf_options) && isset($this->sf_options['event_cost']) && $this->sf_options['event_cost']['type'] != '0') ? MEC_kses::form($this->sf_search_field('event_cost', array('type' => $this->sf_options['event_cost']['type']))) : ''); + echo ($this->sf_reset_button ? '
    ' : ''); + ?> +
    +
    +
    +display_credit_url(); ?> + + + document.addEventListener("DOMContentLoaded", function () { + var calendarEl = document.getElementById("mec-gCalendar-wrap"); + var calendar = new FullCalendar.Calendar(calendarEl, { + initialView: "dayGridMonth", + initialDate: "'. esc_js($this->get_start_date()[0].'-'.$this->get_start_date()[1].'-'.$this->get_start_date()[2]) .'", + editable: false, + selectable: false, + businessHours: false, + height: "auto", + eventLimit: false, + direction: "'. $direction .'", + locale: "'. esc_js($lang) .'", + lang: "'. esc_js($lang) .'", + '; +if (mec_general_calendar_find_event($this->sf_options, 'find')) : +$javascript .=' + customButtons: { + findEvents: { + text: "'. esc_html__('Find Events', 'modern-events-calendar-lite') .'", + click: function() { + jQuery(".mec-gCalendar-filters").css("display" , "none") + var eventSource = []; + eventSource = calendar.getEventSources(); + jQuery.each(eventSource, function (key, value) { + value.remove(); + }); + calendar.addEventSource({ + url: "'. get_rest_url() .'mec/v1/events", + method: "GET", + startParam: "startParam", + endParam: "endParam", + textColor: "#000", + ajax: true, + extraParams: { + show_past_events: "'. esc_js($show_past_events).'", + show_only_past_events: "'. esc_js($show_only_past_events).'", + show_only_one_occurrence: "'. esc_js($show_only_one_occurrence).'", + categories: (jQuery("select[id^=\"mec_sf_category\"]").length > 0) ? jQuery("select[id^=\"mec_sf_category\"]").val() : "", + multiCategories: (jQuery(".select2-hidden-accessible").length > 0) ? JSON.stringify(jQuery(".select2-hidden-accessible").val()) : "", + location: jQuery("select[id^=\"mec_sf_location\"]").val(), + organizer: jQuery("select[id^=\"mec_sf_organizer\"]").val(), + speaker: jQuery("select[id^=\"mec_sf_speaker\"]").val(), + tag: jQuery("select[id^=\"mec_sf_tag\"]").val(), + label: jQuery("select[id^=\"mec_sf_label\"]").val(), + cost_min: jQuery("input[id^=\"mec_sf_event_cost_min\"]").val(), + cost_max: jQuery("input[id^=\"mec_sf_event_cost_max\"]").val(), + display_label: "'. esc_js($display_label) .'", + reason_for_cancellation: "'. esc_js($reason_for_cancellation) .'", + is_category_page: "'. esc_js($is_category_page) .'", + cat_id: "'. esc_js($cat_id) .'", + local_time: "'. esc_js($local_time) .'", + filter_category: "'. esc_js($filter_category) .'", + filter_location: "'. esc_js($filter_location) .'", + filter_organizer: "'. esc_js($filter_organizer) .'", + filter_label: "'. esc_js($filter_label) .'", + filter_tag: "'. esc_js($filter_tag) .'", + filter_author: "'. esc_js($filter_author) .'", + locale: "'. esc_js($lang) .'", + lang: "'. esc_js($lang) .'", + }, + }); + calendar.refetchEvents(); + } + }, + '; +if (mec_general_calendar_find_event($this->sf_options, 'filter')) : +$javascript .=' + filterEvents: { + text: "'. esc_html__('Filter', 'modern-events-calendar-lite') .'", + click: function() { + jQuery(".mec-gCalendar-filters").fadeToggle( "fast", "linear" ); + } + } + '; +endif; +$javascript .=' + }, + '; +endif; +$javascript .=' + firstDay: "'.esc_js($week_start_day).'", + headerToolbar: { + left: "title,prevYear,prev,today,next,nextYear", + center: "", + '; +if (mec_general_calendar_find_event($this->sf_options, 'find')): +$javascript .=' + right: "filterEvents,findEvents" + '; +else : +$javascript .=' + right: "" + '; +endif; +$javascript .=' + }, + buttonText: { + today: "'. esc_html__('Today', 'modern-events-calendar-lite') .'" + }, + eventDidMount: function(info) { + var searchField = jQuery(".mec-gCalendar-search-text"); + if (searchField.length > 0) { + var searchTerms = jQuery(".mec-gCalendar-search-text").val(); + if (searchTerms.length > 0){ + if (info.event._def.title.toLowerCase().indexOf(searchTerms) >= 0 || info.event._def.extendedProps.description.toLowerCase().indexOf(searchTerms) >= 0) { + info.event.setProp("display","block") + } else { + info.event.setProp("display","none") + } + } else { + info.event.setProp("display","block") + } + } else { + info.event.setProp("display","block") + } + var backgroundColor = info.backgroundColor == "#" ? "#00acf8" : info.backgroundColor; + var borderColor = info.borderColor == "#" ? "#00acf8" : info.borderColor; + jQuery(info.el).css("padding", "8px 3px"); + jQuery(info.el).css("font-size", "12px"); + jQuery(info.el).css("font-weight", "400"); + jQuery(info.el).css("border-radius", "0"); + jQuery(info.el).css("border-top", "none"); + jQuery(info.el).css("border-bottom", "none"); + jQuery(info.el).css("'.$border_direction.'", "3px"); + jQuery(info.el).css("'.$border_direction_style.'", "none"); + jQuery(info.el).css("background-color", "#fff"); + jQuery(info.el).css("border-color", borderColor); + jQuery(info.el).css("white-space", "normal"); + jQuery(info.el).css("font-family", "-apple-system,BlinkMacSystemFont,\"Segoe UI\",Roboto,sans-serif"); + // jQuery(info.el).css("z-index", "1"); + jQuery(info.el).css("line-height", "1.2"); + jQuery(info.el).css("margin-top", "0"); + jQuery(info.el).attr("target", "'. esc_js($sed_method) .'"); + '; +if ( $sed_method == 'no' ) : +$javascript .=' + jQuery(info.el).css({ + "cursor": "default", + "pointer-events": "none", + "text-decoration": "none", + }); + '; +endif; +$javascript .=' + jQuery(info.el).attr("data-event-id", info.event._def.publicId); + jQuery(info.el).append(""); + jQuery(info.el).append(info.event._def.extendedProps.reason_for_cancellation); + jQuery(info.el).append(info.event._def.extendedProps.locaTimeHtml); + jQuery(info.el).append(info.event._def.extendedProps.labels); + '; +if ( $sed_method == 'm1') : +$javascript .=' + jQuery(info.el).attr("rel", "noopener"); + jQuery("#mec_skin_'.esc_attr($this->id).'").mecGeneralCalendarView( + { + id: "'. esc_attr($this->id) .'", + atts: "'. http_build_query(array('atts' => $this->atts), '', '&') .'", + ajax_url: "'. admin_url('admin-ajax.php', NULL) .'", + sed_method: "'. esc_js($sed_method) .'", + image_popup: "'. esc_js($this->image_popup) .'", + sf: + { + reset: "'. ($this->sf_reset_button ? 1 : 0) .'", + refine: "'. ($this->sf_refine ? 1 : 0) .'", + }, + }); + '; +endif; +$title_and_location_pattern = apply_filters( 'mec_skin_general_calendar_title_and_location_structure', 'Title + Location' ); +$javascript .=' + jQuery(".fc-daygrid-event-harness").mouseleave(function(e) { + jQuery(".mec-gCalendar-tooltip").remove(); + }); + }, + eventMouseEnter: function(info) { + var Image = info.event._def.extendedProps.image ? "
    " + info.event._def.extendedProps.gridsquare + "
    " : ""; + var dateText = info.event._def.extendedProps.startDateStr != info.event._def.extendedProps.endDateStr ? "'.addslashes($this->icons->display('calendar')).'
    " + info.event._def.extendedProps.start_date + "" + "" + info.event._def.extendedProps.end_date + "
    " : "'.addslashes($this->icons->display('calendar')).'
    " + info.event._def.extendedProps.start_date + "" + "" + info.event._def.extendedProps.startDay + "
    "; + + var dateTime = "'.addslashes($this->icons->display('clock')).'
    " + info.event._def.extendedProps.start_time + "" + "" + info.event._def.extendedProps.end_time + "
    "; + + var Location = info.event._def.extendedProps.location ? "
    '.addslashes($this->icons->display('location-pin')).'" + info.event._def.extendedProps.location + "
    " : ""; + + var Title = ""; + + var tooltip = "
    " + Image + + "
    " + + "
    " + dateText + "
    " + + "
    " + dateTime + "
    " + + "
    " + '. $title_and_location_pattern .' + + "
    "; + if ( jQuery(info.el).parent().find(".mec-gCalendar-tooltip").length < 1 ) jQuery(info.el).parent().append(tooltip); + '; +if ($sed_method == 'm1') : +$javascript .= ' + jQuery("#mec_skin_'.esc_attr($this->id).' .mec-gCalendar-tooltip-title a").off("click").on("click", function (e) { + e.preventDefault(); + var sed_method = jQuery(this).attr("target"); + if ("_blank" === sed_method || "_self" === sed_method || "no" === sed_method) { + + return; + } + e.preventDefault(); + var href = jQuery(this).attr("href"); + + var id = jQuery(this).data("event-id"); + var occurrence = get_parameter_by_name("occurrence", href); + var time = get_parameter_by_name("time", href); + + if( "undefined" == typeof id ){ + return; + } + mecSingleEventDisplayer.getSinglePage(id, occurrence, time, "'. admin_url('admin-ajax.php', NULL) .'", "'. esc_js($sed_method) .'", "'. esc_js($this->image_popup) .'"); + }); + '; +endif; +$javascript .= ' + }, + dayMaxEvents: ' .esc_js($more_event) .', + timeZone:"' .get_option('gmt_offset') .'", + events: { + url: "'.get_rest_url() .'mec/v1/events", + method: "GET", + startParam: "startParam", + endParam: "endParam", + textColor: "#000", + ajax: true, + extraParams: { + show_past_events: "' . esc_js($show_past_events) . '", + show_only_past_events: "' . esc_js($show_only_past_events) . '", + show_only_one_occurrence: "' . esc_js($show_only_one_occurrence) . '", + categories: (jQuery("select[id^=\"mec_sf_category\"]").lenght > 0) ? jQuery("select[id^=\"mec_sf_category\"]").val() : "", + multiCategories: (jQuery(".select2-hidden-accessible").lenght > 0) ? jQuery(".select2-hidden-accessible").val() : "", + location: jQuery("select[id^=\"mec_sf_location\"]").val(), + organizer: jQuery("select[id^=\"mec_sf_organizer\"]").val(), + speaker: jQuery("select[id^=\"mec_sf_speaker\"]").val(), + tag: jQuery("select[id^=\"mec_sf_tag\"]").val(), + label: jQuery("select[id^=\"mec_sf_label\"]").val(), + cost_min: jQuery("input[id^=\"mec_sf_event_cost_min\"]").val(), + cost_max: jQuery("input[id^=\"mec_sf_event_cost_max\"]").val(), + display_label: "' . esc_js($display_label) . '", + reason_for_cancellation: "' . esc_js($reason_for_cancellation) . '", + is_category_page: "' . esc_js($is_category_page) . '", + cat_id: "' . esc_js($cat_id) . '", + local_time: "' . esc_js($local_time) . '", + filter_category: "' . esc_js($filter_category) . '", + filter_location: "' . esc_js($filter_location) . '", + filter_organizer: "' . esc_js($filter_organizer) . '", + filter_label: "' . esc_js($filter_label) . '", + filter_tag: "' . esc_js($filter_tag) . '", + filter_author: "' . esc_js($filter_author) . '", + locale: "' . esc_js($lang) . '", + lang: "' . esc_js($lang) . '", + }, + failure: function() { + alert("there was an error while fetching events!"); + }, + }, + forceEventDuration: true, + loading: function(bool) { + document.getElementById("gCalendar-loading").style.display = + bool ? "block" : "none"; + }, + }); + calendar.render(); + + const calendarHeaderFirstChild = jQuery(".fc-header-toolbar").find(".fc-toolbar-chunk h2"); + const calendarHeaderLastChild = jQuery(".fc-header-toolbar").find(".fc-toolbar-chunk:last-child"); + const calendarHeaderButton = calendarHeaderLastChild.find(".fc-button-group"); + '; + // Search Bar Filter +if (is_array($this->sf_options) and $this->sf_options['text_search']['type'] != '0') : +$javascript .=' + jQuery( "
    '.addslashes($this->icons->display('magnifier')).'sf_options) and $this->sf_options['text_search']['placeholder']) ? esc_html__($this->sf_options['text_search']['placeholder']) : esc_html__('Search for events', 'modern-events-calendar-lite')) .'\" />
    " ).insertBefore( ".fc-header-toolbar .fc-toolbar-chunk:last-child .fc-button-group" ); + + jQuery(".mec-gCalendar-search-text").keypress(function(event){ + var keycode = (event.keyCode ? event.keyCode : event.which); + if(keycode == "13"){ + jQuery(".fc-findEvents-button").trigger("click"); + } + }); + '; +endif; + + // Month Filter +if (is_array($this->sf_options) and $this->sf_options['month_filter']['type'] != '0') : +$javascript .=' + calendarHeaderFirstChild.append(""); + jQuery("#gCalendarMonthFilterButton").on("changeDate", function(ev) { + var s = new Date(ev.date.valueOf()); + let ye = new Intl.DateTimeFormat("en", { year: "numeric" }).format(s); + let mo = new Intl.DateTimeFormat("en", { month: "2-digit" }).format(s); + let da = new Intl.DateTimeFormat("en", { day: "2-digit" }).format(s); + jQuery("#gCalendarMonthFilterButton").monthPicker("hide"); + calendar.gotoDate(`${ye}-${mo}-${da}`) + }) + setTimeout(function(){ jQuery(".datepicker").appendTo(".gCalendarMonthFilterButton"); }, 1000); + '; +endif; + +if (mec_general_calendar_find_event($this->sf_options, 'filter') ) : +$javascript .=' + setTimeout(function(){ jQuery(".mec-gCalendar-filters").appendTo(calendarHeaderButton); }, 1000); + jQuery("").appendTo("button.fc-filterEvents-button.fc-button.fc-button-primary"); + if ( jQuery(".mec-gCalendar-filters-wrap").length > 0 ) jQuery(".mec-gCalendar-filters-wrap .mec-dropdown-search").find("select").niceSelect(); + + jQuery(document).on("click", function(e) { + var button = jQuery(".fc-filterEvents-button"); + var wrap = jQuery(".mec-gCalendar-filters"); + if ((!button.is(e.target) && button.has(e.target).length === 0) && (!wrap.is(e.target) && wrap.has(e.target).length === 0)) { + wrap.hide(); + if ( jQuery(".mec-searchbar-category-wrap select").length > 0 ) jQuery(".mec-searchbar-category-wrap select").select2("close"); + } else { + } + }); + jQuery(document).ready(function ($) { + jQuery(".mec-gCalendar-filters-wrap").find(".mec-search-reset-button").parents().eq(2).addClass("mec-there-reset-button"); + jQuery(".mec-gCalendar-filters-wrap").find(".mec-search-reset-button").on("click", function() { + reset() + }) + function reset() { + var $event_cost_min = $("#mec_sf_event_cost_min_'. esc_attr($this->id).'"); + var $event_cost_max = $("#mec_sf_event_cost_max_'. esc_attr($this->id).'"); + var $time_start = $("#mec_sf_timepicker_start_'. esc_attr($this->id).'"); + var $time_end = $("#mec_sf_timepicker_end_'. esc_attr($this->id).'"); + var $s = $("#mec_sf_s_'. esc_attr($this->id).'"); + var $address = $("#mec_sf_address_s_'. esc_attr($this->id).'"); + var $date_start = $("#mec_sf_date_start_'. esc_attr($this->id).'"); + var $date_end = $("#mec_sf_date_end_'. esc_attr($this->id).'"); + var $event_type = $("#mec_sf_event_type_'. esc_attr($this->id).'"); + var $event_type_2 = $("#mec_sf_event_type_2_'. esc_attr($this->id).'"); + var $attribute = $("#mec_sf_attribute_'. esc_attr($this->id).'"); + var $category = jQuery("#mec_sf_category_'. esc_attr($this->id).'"); + var $location = jQuery("#mec_sf_location_'. esc_attr($this->id).'"); + var $organizer = jQuery("#mec_sf_organizer_'. esc_attr($this->id).'"); + var $speaker = jQuery("#mec_sf_speaker_'. esc_attr($this->id).'"); + var $tag = jQuery("#mec_sf_tag_'. esc_attr($this->id).'"); + var $label = jQuery("#mec_sf_label_'. esc_attr($this->id).'"); + var $month = $("#mec_sf_month_'. esc_attr($this->id).'"); + var $year = $("#mec_sf_year_'. esc_attr($this->id).'"); + var $month_or_year = $("#mec_sf_month_'. esc_attr($this->id).'" + ", " + "#mec_sf_year_'. esc_attr($this->id) .'"); + + if ($category.length && $category.prop("tagName") && $category.prop("tagName").toLowerCase() === "div") { + $category.find("select").each(function () { + jQuery(this).val(null).trigger("change"); + }); + $category.find("select").select2(); + } else { + if ($category.length) { + $category.val(null); + $category.niceSelect("update") + } + } + + + if ($location.length) $location.val(null); + if ($organizer.length) $organizer.val(null); + if ($speaker.length) $speaker.val(null); + if ($tag.length) $tag.val(null); + if ($label.length) $label.val(null); + if ($s.length) $s.val(null); + if ($address.length) $address.val(null); + if ($month.length) $month.val(null); + if ($year.length) $year.val(null); + if ($event_cost_min.length) $event_cost_min.val(null); + if ($event_cost_max.length) $event_cost_max.val(null); + if ($date_start.length) $date_start.val(null); + if ($date_end.length) $date_end.val(null); + if ($time_start.length) $time_start.val(null); + if ($time_end.length) $time_end.val(null); + + function get_fields(){ + return [ + "state", + "city", + "region", + "region", + "street", + "postal_code", + ]; + } + var fields = get_fields(); + $.each(fields,function(i,field){ + + if( jQuery("#mec_sf_"+ field +"_'. esc_attr($this->id) .'").length ){ + + jQuery("#mec_sf_"+ field +"_'. esc_attr($this->id) .'").val(null); + if( jQuery("#mec_sf_"+ field +"_'. esc_attr($this->id) .'").is("select") ){ + jQuery("#mec_sf_"+ field +"_'. esc_attr($this->id) .'").niceSelect("update"); + } + } + }); + + // Search Again + setTimeout(function () { + jQuery(".fc-findEvents-button").trigger("click"); + }, 1); + } + }); + '; +endif; +$javascript .=' + }); +'; + +$factory = new MEC_factory(); +$factory->params('footer', $javascript); \ No newline at end of file diff --git a/app/skins/grid.php b/app/skins/grid.php new file mode 100755 index 0000000..5541445 --- /dev/null +++ b/app/skins/grid.php @@ -0,0 +1,655 @@ + + */ +class MEC_skin_grid extends MEC_skins +{ + /** + * @var string + */ + public $skin = 'grid'; + + public $date_format_classic_1; + public $date_format_clean_1; + public $date_format_clean_2; + public $date_format_minimal_1; + public $date_format_minimal_2; + public $date_format_modern_1; + public $date_format_modern_2; + public $date_format_modern_3; + public $date_format_simple_1; + public $date_format_novel_1; + public $date_format_fluent_1; + public $loadMoreRunning; + public $widget_autoplay = true; + public $widget_autoplay_time = 3000; + public $widget_loop = true; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + parent::__construct(); + } + + /** + * Registers skin actions into WordPress + * @author Webnus + */ + public function actions() + { + $this->factory->action('wp_ajax_mec_grid_load_more', array($this, 'load_more')); + $this->factory->action('wp_ajax_nopriv_mec_grid_load_more', array($this, 'load_more')); + + // Fluent view + $this->factory->action('wp_ajax_mec_grid_load_month', array($this, 'load_month')); + $this->factory->action('wp_ajax_nopriv_mec_grid_load_month', array($this, 'load_month')); + } + + /** + * Initialize the skin + * @author Webnus + * @param array $atts + */ + public function initialize($atts) + { + $this->atts = $atts; + + // Skin Options + $this->skin_options = (isset($this->atts['sk-options']) and isset($this->atts['sk-options'][$this->skin])) ? $this->atts['sk-options'][$this->skin] : []; + + // Icons + $this->icons = $this->main->icons( + isset($this->atts['icons']) && is_array($this->atts['icons']) ? $this->atts['icons'] : [] + ); + + // Next/Previous Month + $this->next_previous_button = isset($this->skin_options['next_previous_button']) && $this->skin_options['next_previous_button']; + + // The style + $this->style = $this->skin_options['style'] ?? 'modern'; + if($this->style == 'fluent' and !is_plugin_active('mec-fluent-layouts/mec-fluent-layouts.php')) $this->style = 'modern'; + + // Date Formats + $this->date_format_classic_1 = (isset($this->skin_options['classic_date_format1']) and trim($this->skin_options['classic_date_format1'])) ? $this->skin_options['classic_date_format1'] : 'd F Y'; + + $this->date_format_clean_1 = (isset($this->skin_options['clean_date_format1']) and trim($this->skin_options['clean_date_format1'])) ? $this->skin_options['clean_date_format1'] : 'd'; + $this->date_format_clean_2 = (isset($this->skin_options['clean_date_format2']) and trim($this->skin_options['clean_date_format2'])) ? $this->skin_options['clean_date_format2'] : 'F'; + + $this->date_format_minimal_1 = (isset($this->skin_options['minimal_date_format1']) and trim($this->skin_options['minimal_date_format1'])) ? $this->skin_options['minimal_date_format1'] : 'd'; + $this->date_format_minimal_2 = (isset($this->skin_options['minimal_date_format2']) and trim($this->skin_options['minimal_date_format2'])) ? $this->skin_options['minimal_date_format2'] : 'M'; + + $this->date_format_modern_1 = (isset($this->skin_options['modern_date_format1']) and trim($this->skin_options['modern_date_format1'])) ? $this->skin_options['modern_date_format1'] : 'd'; + $this->date_format_modern_2 = (isset($this->skin_options['modern_date_format2']) and trim($this->skin_options['modern_date_format2'])) ? $this->skin_options['modern_date_format2'] : 'F'; + $this->date_format_modern_3 = (isset($this->skin_options['modern_date_format3']) and trim($this->skin_options['modern_date_format3'])) ? $this->skin_options['modern_date_format3'] : 'l'; + + $this->date_format_simple_1 = (isset($this->skin_options['simple_date_format1']) and trim($this->skin_options['simple_date_format1'])) ? $this->skin_options['simple_date_format1'] : 'M d Y'; + + $this->date_format_novel_1 = (isset($this->skin_options['novel_date_format1']) and trim($this->skin_options['novel_date_format1'])) ? $this->skin_options['novel_date_format1'] : 'd F Y'; + + // Fluent view - Date Formats + $this->date_format_fluent_1 = (isset($this->skin_options['fluent_date_format1']) and trim($this->skin_options['fluent_date_format1'])) ? $this->skin_options['fluent_date_format1'] : 'D, F d, Y'; + + // Date Formats of colorful style + if($this->style == 'colorful') + { + $this->date_format_modern_1 = (isset($this->skin_options['colorful_date_format1']) and trim($this->skin_options['colorful_date_format1'])) ? $this->skin_options['colorful_date_format1'] : 'd'; + $this->date_format_modern_2 = (isset($this->skin_options['colorful_date_format2']) and trim($this->skin_options['colorful_date_format2'])) ? $this->skin_options['colorful_date_format2'] : 'F'; + $this->date_format_modern_3 = (isset($this->skin_options['colorful_date_format3']) and trim($this->skin_options['colorful_date_format3'])) ? $this->skin_options['colorful_date_format3'] : 'l'; + } + + // Event Times + $this->include_events_times = isset($this->skin_options['include_events_times']) ? $this->skin_options['include_events_times'] : false; + $this->localtime = isset($this->skin_options['include_local_time']) ? $this->skin_options['include_local_time'] : false; + + // Search Form Options + $this->sf_options = (isset($this->atts['sf-options']) and isset($this->atts['sf-options'][$this->skin])) ? $this->atts['sf-options'][$this->skin] : []; + + // Search Form Status + $this->sf_status = isset($this->atts['sf_status']) ? $this->atts['sf_status'] : true; + $this->sf_display_label = isset($this->atts['sf_display_label']) ? $this->atts['sf_display_label'] : false; + $this->sf_reset_button = isset($this->atts['sf_reset_button']) ? $this->atts['sf_reset_button'] : false; + $this->sf_refine = isset($this->atts['sf_refine']) ? $this->atts['sf_refine'] : false; + + // Generate an ID for the sking + $this->id = isset($this->atts['id']) ? $this->atts['id'] : mt_rand(100, 999); + + // Set the ID + if(!isset($this->atts['id'])) $this->atts['id'] = $this->id; + + // Show "Load More" button or not + $this->load_more_button = isset($this->skin_options['load_more_button']) ? $this->skin_options['load_more_button'] : true; + + // Pagination + $this->pagination = isset($this->skin_options['pagination']) ? $this->skin_options['pagination'] : (!$this->load_more_button ? '0' : 'loadmore'); + + // Override the style if the style forced by us in a widget etc + if(isset($this->atts['style']) and trim($this->atts['style']) != '') $this->style = $this->atts['style']; + + // HTML class + $this->html_class = ''; + if(isset($this->atts['html-class']) and trim($this->atts['html-class']) != '') $this->html_class = $this->atts['html-class']; + + // Booking Button + $this->booking_button = isset($this->skin_options['booking_button']) ? (int) $this->skin_options['booking_button'] : 0; + + // SED Method + $this->sed_method = $this->get_sed_method(); + + // Order Method + $this->order_method = (isset($this->skin_options['order_method']) and trim($this->skin_options['order_method'])) ? $this->skin_options['order_method'] : 'ASC'; + + // Image popup + $this->image_popup = $this->skin_options['image_popup'] ?? '0'; + + // From Widget + $this->widget = isset($this->atts['widget']) && trim($this->atts['widget']); + if($this->widget) + { + $this->skin_options['count'] = '1'; + $this->load_more_button = false; + $this->pagination = '0'; + $this->widget_autoplay = (!isset($this->atts['widget_autoplay']) or (isset($this->atts['widget_autoplay']) and $this->atts['widget_autoplay'])); + $this->widget_autoplay_time = (isset($this->atts['widget_autoplay_time']) and $this->atts['widget_autoplay_time']) ? $this->atts['widget_autoplay_time'] : 3000; + $this->widget_loop = (!isset($this->atts['widget_loop']) or (isset($this->atts['widget_loop']) and $this->atts['widget_loop'])); + } + + // From Full Calendar + $this->from_full_calendar = (isset($this->skin_options['from_fc']) and trim($this->skin_options['from_fc'])); + + // Display Price + $this->display_price = (isset($this->skin_options['display_price']) and trim($this->skin_options['display_price'])); + + // The count in row + $this->count = isset($this->skin_options['count']) ? $this->skin_options['count'] : '3'; + + // Map on top + $this->map_on_top = isset($this->skin_options['map_on_top']) ? $this->skin_options['map_on_top'] : false; + + // Map geolocation + $this->geolocation = ((isset($this->skin_options['map_on_top']) and (isset($this->skin_options['set_geolocation']))) and ($this->skin_options['map_on_top'] == '1' and $this->skin_options['set_geolocation'] == '1')); + + // Geolocation Focus + $this->geolocation_focus = isset($this->skin_options['set_geolocation_focus']) ? $this->skin_options['set_geolocation_focus'] : 0; + + // reason_for_cancellation + $this->reason_for_cancellation = isset($this->skin_options['reason_for_cancellation']) ? $this->skin_options['reason_for_cancellation'] : false; + + // display_label + $this->display_label = isset($this->skin_options['display_label']) ? $this->skin_options['display_label'] : false; + + // Init MEC + $this->args['mec-init'] = true; + $this->args['mec-skin'] = $this->skin; + + // Post Type + $this->args['post_type'] = $this->main->get_main_post_type(); + + // Post Status + $this->args['post_status'] = 'publish'; + + // Keyword Query + $this->args['s'] = $this->keyword_query(); + + // Taxonomy + $this->args['tax_query'] = $this->tax_query(); + + // Meta + $this->args['meta_query'] = $this->meta_query(); + + // Tag + if(apply_filters('mec_taxonomy_tag', '') === 'post_tag') $this->args['tag'] = $this->tag_query(); + + // Author + $this->args['author'] = $this->author_query(); + $this->args['author__not_in'] = $this->author_query_ex(); + + // Pagination Options + $this->paged = get_query_var('paged', 1); + $this->limit = (isset($this->skin_options['limit']) and trim($this->skin_options['limit'])) ? $this->skin_options['limit'] : 12; + + $this->args['posts_per_page'] = $this->limit; + $this->args['paged'] = $this->paged; + + // Sort Options + $this->args['orderby'] = 'mec_start_day_seconds ID'; + $this->args['order'] = (in_array($this->order_method, array('ASC', 'DESC')) ? $this->order_method : 'ASC'); + $this->args['meta_key'] = 'mec_start_day_seconds'; + + // Exclude Posts + if(isset($this->atts['exclude']) and is_array($this->atts['exclude']) and count($this->atts['exclude'])) $this->args['post__not_in'] = $this->atts['exclude']; + + // Include Posts + if(isset($this->atts['include']) and is_array($this->atts['include']) and count($this->atts['include'])) $this->args['post__in'] = $this->atts['include']; + + // Show Only Expired Events + $this->show_only_expired_events = (isset($this->atts['show_only_past_events']) and trim($this->atts['show_only_past_events'])) ? '1' : '0'; + + // Maximum Date Range. + $this->maximum_date_range = $this->get_end_date(); + + // Show Past Events + if($this->show_only_expired_events) + { + $this->atts['show_past_events'] = '1'; + $this->args['order'] = 'DESC'; + } + + // Show Past Events + $this->args['mec-past-events'] = isset($this->atts['show_past_events']) ? $this->atts['show_past_events'] : '0'; + + // Start Date + if (strpos($this->style, 'fluent') === false && strpos($this->style, 'liquid') === false) + { + // Start Date + $this->start_date = $this->get_start_date(); + } + else + { + // Start Date + list($this->year, $this->month, $this->day) = $this->get_start_date(); + $this->start_date = date('Y-m-d', strtotime($this->year.'-'.$this->month.'-'.$this->day)); + $this->active_day = $this->year . '-' . $this->month.'-' . $this->day; + } + + // We will extend the end date in the loop + $this->end_date = $this->start_date; + + // Show Ongoing Events + $this->show_ongoing_events = (isset($this->atts['show_only_ongoing_events']) and trim($this->atts['show_only_ongoing_events'])) ? '1' : '0'; + if($this->show_ongoing_events) + { + $this->args['mec-show-ongoing-events'] = $this->show_ongoing_events; + if(strpos($this->style, 'fluent') === false && strpos($this->style, 'liquid') === false) $this->maximum_date = $this->start_date; + } + + // Include Ongoing Events + $this->include_ongoing_events = (isset($this->atts['show_ongoing_events']) and trim($this->atts['show_ongoing_events'])) ? '1' : '0'; + if($this->include_ongoing_events) $this->args['mec-include-ongoing-events'] = $this->include_ongoing_events; + + // Set start time + if(isset($this->atts['seconds'])) + { + $this->args['mec-seconds'] = $this->atts['seconds']; + $this->args['mec-seconds-date'] = isset($this->atts['seconds_date']) ? $this->atts['seconds_date'] : $this->start_date; + } + + // Apply Maximum Date + if(strpos($this->style, 'fluent') === false && strpos($this->style, 'liquid') === false) + { + $apply_sf_date = isset($_REQUEST['apply_sf_date']) ? sanitize_text_field($_REQUEST['apply_sf_date']) : 0; + $month = (isset($this->sf) && isset($this->sf['month']) && trim($this->sf['month'])) ? $this->sf['month'] : (isset($_REQUEST['mec_month']) ? $_REQUEST['mec_month'] : ''); + if($apply_sf_date == 1 and trim($month) and $this->order_method === 'ASC') $this->maximum_date = date('Y-m-t', strtotime($this->start_date)); + } + + // Found Events + $this->found = 0; + + // Detect Load More Running + $this->loadMoreRunning = false; + + // Auto Month Rotation + $this->auto_month_rotation = !isset($this->settings['auto_month_rotation']) || $this->settings['auto_month_rotation']; + + do_action('mec-grid-initialize-end', $this); + } + + /** + * Search and returns the filtered events + * @author Webnus + * @return array of objects + */ + public function search() + { + if( false === strpos($this->style, 'fluent' ) && false === strpos($this->style, 'liquid') ) + { + return parent::search(); + } + else + { + if($this->show_only_expired_events) + { + if($this->loadMoreRunning) + { + $start = $this->start_date; + + if($this->month == date('m', current_time('timestamp'))) $end = date('Y-m-d', current_time('timestamp')); + else $end = date('Y-m-t', strtotime($this->start_date)); + } + else + { + $now = current_time('timestamp'); + $startDateTime = strtotime(date($this->year.$this->month.'t')) + (int) $this->main->get_gmt_offset_seconds(); + $now = min($startDateTime, $now); + + $start = date('Y-m-d H:i:s', $now); + $end = date('Y-m-d', strtotime($this->year.$this->month.'01')); + } + } + else + { + $start = $this->start_date; + $end = date('Y-m-t', strtotime($this->start_date)); + } + + // Date Events + if($this->show_only_expired_events && $this->loadMoreRunning) $this->show_only_expired_events = '0'; + + $dates = $this->period($start, $end, true); + ksort($dates); + + if($this->show_only_expired_events && $this->loadMoreRunning) $this->show_only_expired_events = '1'; + + // Limit + $this->args['posts_per_page'] = $this->limit; + + $i = 0; + $found = 0; + $events = []; + $qs = []; + + foreach($dates as $date=>$IDs) + { + // No Event + if(!is_array($IDs) or !count($IDs)) continue; + + // Check Finish Date + if(isset($this->maximum_date) and trim($this->maximum_date) and strtotime($date) > strtotime($this->maximum_date)) break; + + // Include Available Events + $this->args['post__in'] = array_unique($IDs); + + // Count of events per day + $IDs_count = array_count_values($IDs); + + // Extending the end date + $this->end_date = $date; + + // Continue to load rest of events in the first date + if($i === 0) $this->args['offset'] = $this->offset; + // Load all events in the rest of dates + else + { + $this->offset = 0; + $this->args['offset'] = 0; + } + + // The Query + $this->args = apply_filters('mec_skin_query_args', $this->args, $this); + + // Query Key + $q_key = base64_encode(json_encode($this->args)); + + // Get From Cache + if(isset($qs[$q_key])) $query = $qs[$q_key]; + // Search & Cache + else + { + $query = new WP_Query($this->args); + $qs[$q_key] = $query; + } + + if($query->have_posts()) + { + if(!isset($events[$date])) $events[$date] = []; + + // Day Events + $d = []; + + // The Loop + while($query->have_posts()) + { + $query->the_post(); + $ID = get_the_ID(); + + $ID_count = isset($IDs_count[$ID]) ? $IDs_count[$ID] : 1; + for($i = 1; $i <= $ID_count; $i++) + { + $rendered = $this->render->data($ID); + + $data = new stdClass(); + $data->ID = $ID; + $data->data = $rendered; + + $data->date = array + ( + 'start' => array('date' => $date), + 'end' => array('date' => $this->main->get_end_date($date, $rendered)) + ); + + $d[] = $this->render->after_render($data, $this, $i); + $found++; + } + + if($found >= $this->limit) + { + // Next Offset + $this->next_offset = ($query->post_count-($query->current_post+1)) >= 0 ? ($query->current_post+1)+$this->offset : 0; + + usort($d, [$this, 'sort_day_events']); + $events[$date] = $d; + + // Restore original Post Data + wp_reset_postdata(); + + break 2; + } + } + + usort($d, [$this, 'sort_day_events']); + $events[$date] = $d; + } + + // Restore original Post Data + wp_reset_postdata(); + $i++; + } + + // Initialize Occurrences' Data + MEC_feature_occurrences::fetch($events); + + // Set Offset for Last Page + if($found < $this->limit) + { + // Next Offset + $this->next_offset = $found + ((isset($date) and $this->start_date === $date) ? $this->offset : 0); + } + + // Set found events + $this->found = $found; + + return $events; + } + } + + /** + * Returns start day of skin for filtering events + * @author Webnus + * @return string|array + */ + public function get_start_date() + { + // Default date + $date = current_time('Y-m-d'); + + if(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'today') $date = current_time('Y-m-d'); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'tomorrow') $date = date('Y-m-d', strtotime('Tomorrow')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'yesterday') $date = date('Y-m-d', strtotime('Yesterday')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_last_month') $date = date('Y-m-d', strtotime('first day of last month')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_current_month') $date = date('Y-m-d', strtotime('first day of this month')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_next_month') $date = date('Y-m-d', strtotime('first day of next month')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'date') $date = date('Y-m-d', strtotime($this->skin_options['start_date'])); + + // Hide past events + if(isset($this->atts['show_past_events']) and !trim($this->atts['show_past_events'])) + { + $today = current_time('Y-m-d'); + if(strtotime($date) < strtotime($today)) $date = $today; + } + + // Show only expired events + if(isset($this->show_only_expired_events) and $this->show_only_expired_events) + { + $now = date('Y-m-d H:i:s', current_time('timestamp')); + if(strtotime($date) > strtotime($now)) $date = $now; + } + + // MEC Next Page + if(isset($_REQUEST['mec_next_page']) and trim($_REQUEST['mec_next_page'])) + { + $ex = explode(':', $_REQUEST['mec_next_page']); + + if(strtotime($ex[0])) $date = $ex[0]; + if(isset($ex[1])) $this->offset = $ex[1]; + } + + if(strpos($this->style, 'fluent') === false && strpos($this->style, 'liquid') === false) return $date; + else + { + $time = strtotime($date); + return array(date('Y', $time), date('m', $time), date('d', $time)); + } + } + + /** + * Load more events for AJAX request + * @author Webnus + * @return void + */ + public function load_more() + { + $this->sf = (isset($_REQUEST['sf']) and is_array($_REQUEST['sf'])) ? $this->main->sanitize_deep_array($_REQUEST['sf']) : []; + $apply_sf_date = isset($_REQUEST['apply_sf_date']) ? sanitize_text_field($_REQUEST['apply_sf_date']) : 1; + $atts = $this->sf_apply(((isset($_REQUEST['atts']) and is_array($_REQUEST['atts'])) ? $this->main->sanitize_deep_array($_REQUEST['atts']) : array()), $this->sf, $apply_sf_date); + + // Initialize the skin + $this->initialize($atts); + + // Override variables + if(strpos($this->style, 'fluent') === false && strpos($this->style, 'liquid') === false) + { + $this->start_date = isset($_REQUEST['mec_start_date']) ? sanitize_text_field($_REQUEST['mec_start_date']) : date('y-m-d'); + } + else + { + $this->maximum_date = isset($_REQUEST['mec_maximum_date']) ? sanitize_text_field($_REQUEST['mec_maximum_date']) : ''; + $mecStartDate = isset($_REQUEST['mec_start_date']) ? sanitize_text_field($_REQUEST['mec_start_date']) : date('y-m-d'); + $this->start_date = strtotime($mecStartDate) > strtotime($this->maximum_date) ? $this->maximum_date : $mecStartDate; + $this->year = isset($_REQUEST['mec_year']) ? sanitize_text_field($_REQUEST['mec_year']) : NULL; + $this->month = isset($_REQUEST['mec_month']) ? sanitize_text_field($_REQUEST['mec_month']) : NULL; + $this->loadMoreRunning = true; + } + + $this->end_date = $this->start_date; + $this->offset = isset($_REQUEST['mec_offset']) ? sanitize_text_field($_REQUEST['mec_offset']) : 0; + + // Apply Maximum Date + $month = (isset($this->sf) && isset($this->sf['month']) && trim($this->sf['month'])) ? $this->sf['month'] : (isset($_REQUEST['mec_month']) ? $_REQUEST['mec_month'] : ''); + if($apply_sf_date == 1 and trim($month) and $this->order_method === 'ASC') $this->maximum_date = date('Y-m-t', strtotime($this->start_date)); + + // Return the events + $this->atts['return_items'] = true; + $this->loading_more = true; + + // Fetch the events + $this->fetch(); + + // Return the output + $output = $this->output(); + + echo json_encode($output); + exit; + } + + /** + * Load month for AJAX request / Fluent view + * @author Webnus + * @return void + */ + public function load_month() + { + $this->sf = (isset($_REQUEST['sf']) and is_array($_REQUEST['sf'])) ? $this->main->sanitize_deep_array($_REQUEST['sf']) : []; + $apply_sf_date = isset($_REQUEST['apply_sf_date']) ? sanitize_text_field($_REQUEST['apply_sf_date']) : 1; + $atts = $this->sf_apply(((isset($_REQUEST['atts']) and is_array($_REQUEST['atts'])) ? $this->main->sanitize_deep_array($_REQUEST['atts']) : array()), $this->sf, $apply_sf_date); + + $navigator_click = isset($_REQUEST['navigator_click']) && sanitize_text_field($_REQUEST['navigator_click']); + + // Initialize the skin + $this->initialize($atts); + + // Search Events If Not Found In Current Month + $c = 0; + $break = false; + + do + { + if($c > 12) $break = true; + if($c and !$break) + { + if(intval($this->month) == 12) + { + $this->year = intval($this->year)+1; + $this->month = '01'; + } + + $this->month = sprintf("%02d", intval($this->month)+1); + } + else + { + // Start Date + $this->year = isset($_REQUEST['mec_year']) ? sanitize_text_field($_REQUEST['mec_year']) : current_time('Y'); + $this->month = isset($_REQUEST['mec_month']) ? sanitize_text_field($_REQUEST['mec_month']) : current_time('m'); + } + + if($this->show_only_expired_events) + { + $this->start_date = date('Y-m-d', strtotime($this->year.'-'.$this->month.'-01')); + $this->active_day = date('Y-m-t', strtotime($this->year.'-'.$this->month.'-01')); + } + else + { + $this->start_date = date('Y-m-d', strtotime($this->year.'-'.$this->month.'-01')); + + $day = current_time('d'); + $this->active_day = $this->year.'-'.$this->month.'-'.$day; + + // If date is not valid then use the first day of month + if(!$this->main->validate_date($this->active_day)) $this->active_day = $this->year.'-'.$this->month.'-01'; + } + + // We will extend the end date in the loop + $this->end_date = $this->start_date; + + // Return the events + $this->atts['return_items'] = true; + + // Fetch the events + $this->fetch(); + + // Break the loop if not result + if($break) break; + + // Set active day to current day if not result + if(count($this->events)) $this->active_day = key($this->events); + if($navigator_click) break; + + // Auto Rotation is Disabled + if(!$this->auto_month_rotation) break; + + $c++; + } + while(!count($this->events)); + + // Return the output + $output = $this->output(); + + echo json_encode($output); + exit; + } +} diff --git a/app/skins/grid/index.html b/app/skins/grid/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/skins/grid/render.php b/app/skins/grid/render.php new file mode 100755 index 0000000..7e72d9b --- /dev/null +++ b/app/skins/grid/render.php @@ -0,0 +1,345 @@ +main->get_styling(); +$event_colorskin = (isset($styling['mec_colorskin'] ) || isset($styling['color'])) ? 'colorskin-custom' : ''; +$settings = $this->main->get_settings(); +$display_label = $this->skin_options['display_label'] ?? false; +$reason_for_cancellation = $this->skin_options['reason_for_cancellation'] ?? false; +$map_events = []; + +// colorful +$colorful_flag = $colorful_class = ''; +if($this->style == 'colorful') +{ + $colorful_flag = true; + $this->style = 'modern'; + $colorful_class = ' mec-event-grid-colorful'; +} +?> +
    +
    + count; + $grid_div = $this->count; + $grid_limit = $this->limit; + + if($count == 0 or $count == 5) $col = 4; + else $col = 12 / $count; + + $close_row = true; + $rcount = 1 ; + + foreach($this->events as $date): + foreach($date as $event): + + $map_events[] = $event; + if($rcount == 1) + { + echo '
    '; + $close_row = true; + } + + echo '
    '; + + $location_id = $this->main->get_master_location_id($event); + $location = ($location_id ? $this->main->get_location_data($location_id) : array()); + + $organizer_id = $this->main->get_master_organizer_id($event); + $organizer = ($organizer_id ? $this->main->get_organizer_data($organizer_id) : array()); + $event_color = $this->get_event_color_dot($event); + $start_time = (isset($event->data->time) ? $event->data->time['start'] : ''); + $end_time = (isset($event->data->time) ? $event->data->time['end'] : ''); + $event_start_date = !empty($event->date['start']['date']) ? $event->date['start']['date'] : ''; + $mec_data = $this->display_custom_data($event); + $custom_data_class = !empty($mec_data) ? 'mec-custom-data' : ''; + + // colorful + $colorful_bg_color = ($colorful_flag && isset($event->data->meta['mec_color'])) ? ' style="background: #' . esc_attr($event->data->meta['mec_color']) . '"' : ''; + + // MEC Schema + do_action('mec_schema', $event); + + echo '
    '; + ?> + style == 'modern'): ?> +
    + +
    main->date_i18n($this->date_format_modern_1, strtotime($event->date['start']['date']))); ?>
    +
    main->date_i18n($this->date_format_modern_2, strtotime($event->date['start']['date']))); ?>
    + +
    main->dateify($event, $this->date_format_modern_1 .' '. $this->date_format_modern_2)); ?>
    + +
    + '.$this->icons->display('location-pin'). esc_html($location['name']) . '
    ' : ''); ?> + display_categories($event)); ?> + display_organizers($event)); ?> + get_label_captions($event)); ?> +
    +
    main->date_i18n($this->date_format_modern_3, strtotime($event->date['start']['date']))); ?>
    +
    +
    + main->get_flags($event); ?> +

    display_link($event)); ?>display_custom_data($event)); ?>main->get_normal_labels($event, $display_label).$this->main->display_cancellation_reason($event, $reason_for_cancellation)); ?>data->ID ); ?>

    + localtime) echo MEC_kses::full($this->main->module('local-time.type3', array('event' => $event))); ?> + include_events_times and trim($start_time)) echo MEC_kses::element($this->main->display_time($start_time, $end_time)); ?> +

    + display_cost($event)); ?> +
    + + style == 'classic'): ?> +
    display_link($event, $event->data->thumbnails['medium'], '')); ?>
    + +
    + +
    + main->date_i18n($this->date_format_classic_1, strtotime($event->date['start']['date']))); ?> + localtime) echo MEC_kses::full($this->main->module('local-time.type3', array('event' => $event))); ?> + include_events_times and trim($start_time)) echo MEC_kses::element($this->main->display_time($start_time, $end_time)); ?> +
    + +
    + main->dateify($event, $this->date_format_classic_1)); ?> + localtime) echo MEC_kses::full($this->main->module('local-time.type3', array('event' => $event))); ?> + include_events_times and trim($start_time)) echo MEC_kses::element($this->main->display_time($start_time, $end_time)); ?> +
    + + + main->get_flags($event); ?> +

    display_link($event)); ?>display_custom_data($event)); ?>main->get_normal_labels($event, $display_label).$this->main->display_cancellation_reason($event, $reason_for_cancellation)); ?>data->ID ); ?>

    + get_label_captions($event)); ?> +

    + display_categories($event)); ?> + display_organizers($event)); ?> + display_cost($event)); ?> + +
    + + style == 'minimal'): ?> +
    main->date_i18n($this->date_format_minimal_1, strtotime($event->date['start']['date']))); ?>main->date_i18n($this->date_format_minimal_2, strtotime($event->date['start']['date']))); ?>
    +
    +

    display_link($event)); ?>display_custom_data($event)); ?>main->get_flags($event).$event_color); echo MEC_kses::element($this->main->get_normal_labels($event, $display_label).$this->main->display_cancellation_reason($event, $reason_for_cancellation)); ?>data->ID); ?>get_label_captions($event,'mec-fc-style')); ?>

    + localtime) echo MEC_kses::full($this->main->module('local-time.type2', array('event' => $event))); ?> + include_events_times) echo MEC_kses::element($this->main->display_time($start_time, $end_time)); ?> +
    + '.$this->icons->display('location-pin'). esc_html($location['name']) . '
    ' : ''); ?> + display_categories($event)); ?> + display_organizers($event)); ?> + display_cost($event)); ?> + booking_button($event)); ?> +
    +
    + style == 'clean'): ?> +
    + +
    main->date_i18n($this->date_format_clean_1, strtotime($event->date['start']['date']))); ?>
    +
    main->date_i18n($this->date_format_clean_2, strtotime($event->date['start']['date']))); ?>
    + localtime) echo MEC_kses::full($this->main->module('local-time.type3', array('event' => $event))); ?> + include_events_times and trim($start_time)) echo MEC_kses::element($this->main->display_time($start_time, $end_time)); ?> + + +
    main->dateify($event, $this->date_format_clean_1.' '.$this->date_format_clean_2)); ?>
    + + localtime) echo MEC_kses::full($this->main->module('local-time.type3', array('event' => $event))); ?> + include_events_times and trim($start_time)) echo MEC_kses::element($this->main->display_time($start_time, $end_time)); ?> + +
    + '. $this->icons->display('location-pin') . esc_html($location['name']) . '
    ' : ''); ?> + display_categories($event)); ?> + display_organizers($event)); ?> + display_cost($event)); ?> + get_label_captions($event)); ?> +
    +
    +
    display_link($event, $event->data->thumbnails['medium'], '')); ?>
    +
    + + + main->get_flags($event); ?> +

    display_link($event)); ?>display_custom_data($event)); ?>main->get_normal_labels($event, $display_label).$this->main->display_cancellation_reason($event, $reason_for_cancellation)); ?>data->ID ); ?>

    +

    +
    + + style == 'novel'): ?> +
    +
    +
    display_link($event, $event->data->thumbnails['thumblist'], '')); ?>
    +
    + main->get_flags($event); ?> +

    display_link($event)); ?>display_custom_data($event)); ?>main->get_normal_labels($event, $display_label).$this->main->display_cancellation_reason($event, $reason_for_cancellation)); ?>data->ID ); ?>

    + +
    main->date_i18n($this->date_format_novel_1, strtotime($event->date['start']['date']))); ?>
    + +
    main->dateify($event, $this->date_format_novel_1)); ?>
    + + include_events_times and trim($start_time)) echo MEC_kses::element($this->main->display_time($start_time, $end_time, array('class' => 'mec-event-detail'))); + if(isset($location['address'])) echo '
    '.esc_html($location['address']).'
    '; + if($this->localtime) echo MEC_kses::full($this->main->module('local-time.type1', array('event' => $event, 'display_svg' => true ))); + echo MEC_kses::element($this->display_categories($event)); + echo MEC_kses::element($this->display_organizers($event)); + echo MEC_kses::element($this->display_cost($event)); + ?> + get_label_captions($event)); ?> + +
    +
    + style == 'simple'): ?> + +
    main->dateify($event, $this->date_format_simple_1)); ?>
    +

    display_link($event)); ?>display_custom_data($event)); ?>main->get_flags($event).$event_color); echo MEC_kses::element($this->main->get_normal_labels($event, $display_label).$this->main->display_cancellation_reason($event, $reason_for_cancellation)); ?>data->ID); ?>get_label_captions($event,'mec-fc-style')); ?>

    +
    + + localtime) echo MEC_kses::full($this->main->module('local-time.type3', array('event' => $event))); ?> + include_events_times and trim($start_time)) echo MEC_kses::element($this->main->display_time($start_time, $end_time)); ?> + display_categories($event)); ?> + display_organizers($event)); ?> + display_cost($event)); ?> +
    + booking_button($event)); ?> +
    '; + + if($rcount == $count) + { + echo ''; + $rcount = 0; + $close_row = false; + } + + $rcount++; + ?> + + + '; ?> + + + +map_on_top) and $this->map_on_top and isset($map_events) and !empty($map_events)) +{ + // Include Map Assets such as JS and CSS libraries + $this->main->load_map_assets(); + + // It changing geolocation focus, because after done filtering, if it doesn't. then the map position will not set correctly. + if((isset($_REQUEST['action']) and sanitize_text_field($_REQUEST['action']) == 'mec_grid_load_more') and isset($_REQUEST['sf'])) $this->geolocation_focus = true; + + $map_javascript = ''; + + $map_data = new stdClass; + $map_data->id = $this->id; + $map_data->atts = $this->atts; + $map_data->events = $map_events; + $map_data->render = $this->render; + $map_data->geolocation = $this->geolocation; + $map_data->sf_status = null; + $map_data->main = $this->main; + + $map_javascript = apply_filters('mec_map_load_script', $map_javascript, $this, $settings); + + // Include javascript code into the page + if($this->main->is_ajax()) echo MEC_kses::full($map_javascript); + else $this->factory->params('footer', $map_javascript); +} \ No newline at end of file diff --git a/app/skins/grid/tpl.php b/app/skins/grid/tpl.php new file mode 100755 index 0000000..c448f5f --- /dev/null +++ b/app/skins/grid/tpl.php @@ -0,0 +1,100 @@ +get_render_path(); +$styling = $this->main->get_styling(); + +$dark_mode = $styling['dark_mode'] ?? ''; +if($dark_mode == 1) $set_dark = 'mec-dark-mode'; +else $set_dark = ''; + +ob_start(); +include $render_path; +$items_html = ob_get_clean(); + +if(isset($this->atts['return_items']) and $this->atts['return_items']) +{ + echo json_encode(array('html' => $items_html, 'end_date' => $this->end_date, 'offset' => $this->next_offset, 'count' => $this->found, 'has_more_event' => (int) $this->has_more_events)); + exit; +} + +$sed_method = $this->sed_method; +if($sed_method == 'new') $sed_method = '0'; + +// Generating javascript code tpl +$javascript = ''; + +// Include javascript code into the page +if($this->main->is_ajax() or $this->main->preview()) echo MEC_kses::full($javascript); +else $this->factory->params('footer', $javascript); + +do_action('mec_start_skin', $this->id); +do_action('mec_grid_skin_head'); +?> +
    + + sf_status) echo MEC_kses::full($this->sf_search_form()); ?> + + found): ?> + map_on_top == '1'): ?> +
    +
    + settings['default_maps_view'])?$this->settings['default_maps_view']:'google'; + do_action('mec_map_inner_element_tools', array('map' => $map)); + ?> +
    + +
    + +
    + +
    +
    + main->display_not_found_message(); ?> +
    + +
    + main->display_not_found_message(); ?> +
    + + + get_pagination_bar(); ?> + +
    +display_credit_url(); \ No newline at end of file diff --git a/app/skins/index.html b/app/skins/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/skins/list.php b/app/skins/list.php new file mode 100755 index 0000000..0fcbcdf --- /dev/null +++ b/app/skins/list.php @@ -0,0 +1,657 @@ + + */ +class MEC_skin_list extends MEC_skins +{ + /** + * @var string + */ + public $skin = 'list'; + + public $date_format_classic_1; + public $date_format_minimal_1; + public $date_format_minimal_2; + public $date_format_minimal_3; + public $date_format_modern_1; + public $date_format_modern_2; + public $date_format_modern_3; + public $date_format_standard_1; + public $date_format_acc_1; + public $date_format_acc_2; + public $display_price; + public $display_available_tickets; + public $date_format_fluent_1; + public $reason_for_cancellation; + public $display_label; + public $loadMoreRunning; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + parent::__construct(); + + // MEC Render + $this->render = $this->getRender(); + } + + /** + * Registers skin actions into WordPress + * @author Webnus + */ + public function actions() + { + $this->factory->action('wp_ajax_mec_list_load_more', [$this, 'load_more']); + $this->factory->action('wp_ajax_nopriv_mec_list_load_more', [$this, 'load_more']); + + // Fluent View + $this->factory->action('wp_ajax_mec_list_load_month', [$this, 'load_month']); + $this->factory->action('wp_ajax_nopriv_mec_list_load_month', [$this, 'load_month']); + } + + /** + * Initialize the skin + * @author Webnus + * @param array $atts + */ + public function initialize($atts) + { + $this->atts = $atts; + + // Skin Options + $this->skin_options = (isset($this->atts['sk-options']) and isset($this->atts['sk-options'][$this->skin])) ? $this->atts['sk-options'][$this->skin] : []; + + // Icons + $this->icons = $this->main->icons( + isset($this->atts['icons']) && is_array($this->atts['icons']) ? $this->atts['icons'] : [] + ); + + // Next/Previous Month + $this->next_previous_button = isset($this->skin_options['next_previous_button']) && $this->skin_options['next_previous_button']; + + // Date Formats + $this->date_format_classic_1 = (isset($this->skin_options['classic_date_format1']) and trim($this->skin_options['classic_date_format1'])) ? $this->skin_options['classic_date_format1'] : 'M d Y'; + + $this->date_format_minimal_1 = (isset($this->skin_options['minimal_date_format1']) and trim($this->skin_options['minimal_date_format1'])) ? $this->skin_options['minimal_date_format1'] : 'd'; + $this->date_format_minimal_2 = (isset($this->skin_options['minimal_date_format2']) and trim($this->skin_options['minimal_date_format2'])) ? $this->skin_options['minimal_date_format2'] : 'M'; + $this->date_format_minimal_3 = (isset($this->skin_options['minimal_date_format3']) and trim($this->skin_options['minimal_date_format3'])) ? $this->skin_options['minimal_date_format3'] : 'l'; + + $this->date_format_modern_1 = (isset($this->skin_options['modern_date_format1']) and trim($this->skin_options['modern_date_format1'])) ? $this->skin_options['modern_date_format1'] : 'd'; + $this->date_format_modern_2 = (isset($this->skin_options['modern_date_format2']) and trim($this->skin_options['modern_date_format2'])) ? $this->skin_options['modern_date_format2'] : 'F'; + $this->date_format_modern_3 = (isset($this->skin_options['modern_date_format3']) and trim($this->skin_options['modern_date_format3'])) ? $this->skin_options['modern_date_format3'] : 'l'; + + $this->date_format_standard_1 = (isset($this->skin_options['standard_date_format1']) and trim($this->skin_options['standard_date_format1'])) ? $this->skin_options['standard_date_format1'] : 'd M'; + + $this->date_format_acc_1 = (isset($this->skin_options['accordion_date_format1']) and trim($this->skin_options['accordion_date_format1'])) ? $this->skin_options['accordion_date_format1'] : 'd'; + $this->date_format_acc_2 = (isset($this->skin_options['accordion_date_format2']) and trim($this->skin_options['accordion_date_format2'])) ? $this->skin_options['accordion_date_format2'] : 'F'; + + // Fluent view - Date Formats + $this->date_format_fluent_1 = (isset($this->skin_options['fluent_date_format1']) and trim($this->skin_options['fluent_date_format1'])) ? $this->skin_options['fluent_date_format1'] : 'F d, Y'; + + // Search Form Options + $this->sf_options = (isset($this->atts['sf-options']) and isset($this->atts['sf-options'][$this->skin])) ? $this->atts['sf-options'][$this->skin] : []; + + // Search Form Status + $this->sf_status = $this->atts['sf_status'] ?? true; + $this->sf_display_label = $this->atts['sf_display_label'] ?? false; + $this->sf_reset_button = $this->atts['sf_reset_button'] ?? false; + $this->sf_refine = $this->atts['sf_refine'] ?? false; + + // Generate an ID for the skin + $this->id = $this->atts['id'] ?? mt_rand(100, 999); + + // Set the ID + if(!isset($this->atts['id'])) $this->atts['id'] = $this->id; + + // Show "Load More" button or not + $this->load_more_button = $this->skin_options['load_more_button'] ?? true; + + // Pagination + $this->pagination = $this->skin_options['pagination'] ?? (!$this->load_more_button ? '0' : 'loadmore'); + + // Show Month Divider or not + $this->month_divider = $this->skin_options['month_divider'] ?? true; + + // Toggle Month Divider or not + $this->toggle_month_divider = $this->skin_options['toggle_month_divider'] ?? 0; + + // Map on top + $this->map_on_top = $this->skin_options['map_on_top'] ?? false; + + // Map geolocation + $this->geolocation = ((isset($this->skin_options['map_on_top']) and (isset($this->skin_options['set_geolocation']))) and ($this->skin_options['map_on_top'] == '1' and $this->skin_options['set_geolocation'] == '1')); + + // Reason for Cancellation + $this->reason_for_cancellation = $this->skin_options['reason_for_cancellation'] ?? false; + + // Display Label + $this->display_label = $this->skin_options['display_label'] ?? false; + + // Event Times + $this->include_events_times = $this->skin_options['include_events_times'] ?? false; + $this->localtime = $this->skin_options['include_local_time'] ?? false; + + // Geolocation Focus + $this->geolocation_focus = $this->skin_options['set_geolocation_focus'] ?? 0; + + // The style + $this->style = $this->skin_options['style'] ?? 'modern'; + if($this->style == 'fluent' and !is_plugin_active('mec-fluent-layouts/mec-fluent-layouts.php')) $this->style = 'modern'; + + // Override the style if the style forced by us in a widget etc + if(isset($this->atts['style']) and trim($this->atts['style']) != '') $this->style = $this->atts['style']; + + // HTML class + $this->html_class = ''; + if(isset($this->atts['html-class']) and trim($this->atts['html-class']) != '') $this->html_class = $this->atts['html-class']; + + // Booking Button + $this->booking_button = isset($this->skin_options['booking_button']) ? (int) $this->skin_options['booking_button'] : 0; + + // SED Method + $this->sed_method = $this->get_sed_method(); + if($this->style === 'accordion') $this->sed_method = 0; + + // Order Method + $this->order_method = (isset($this->skin_options['order_method']) and trim($this->skin_options['order_method'])) ? $this->skin_options['order_method'] : 'ASC'; + + // Image popup + $this->image_popup = $this->skin_options['image_popup'] ?? 0; + + // From Widget + $this->widget = isset($this->atts['widget']) && trim($this->atts['widget']); + + // From Full Calendar + $this->from_full_calendar = (isset($this->skin_options['from_fc']) and trim($this->skin_options['from_fc'])); + + // Display Price + $this->display_price = (isset($this->skin_options['display_price']) and trim($this->skin_options['display_price'])); + + // Fluent & Liquid view - Available Tickets + $this->display_available_tickets = (isset($this->skin_options['display_available_tickets']) and trim($this->skin_options['display_available_tickets'])) ? $this->skin_options['display_available_tickets'] : ''; + + // Progress Bar + $this->display_progress_bar = (isset($this->skin_options['display_progress_bar']) and trim($this->skin_options['display_progress_bar'])); + + // Init MEC + $this->args['mec-init'] = true; + $this->args['mec-skin'] = $this->skin; + + // Post Type + $this->args['post_type'] = $this->main->get_main_post_type(); + + // Post Status + $this->args['post_status'] = 'publish'; + + // Keyword Query + $this->args['s'] = $this->keyword_query(); + + // Taxonomy + $this->args['tax_query'] = $this->tax_query(); + + // Meta + $this->args['meta_query'] = $this->meta_query(); + + // Tag + if(apply_filters('mec_taxonomy_tag', '') === 'post_tag') $this->args['tag'] = $this->tag_query(); + + // Author + $this->args['author'] = $this->author_query(); + $this->args['author__not_in'] = $this->author_query_ex(); + + // Pagination Options + $this->paged = get_query_var('paged', 1); + $this->limit = (isset($this->skin_options['limit']) and trim($this->skin_options['limit'])) ? $this->skin_options['limit'] : 12; + + $this->args['posts_per_page'] = $this->limit; + $this->args['paged'] = $this->paged; + + // Sort Options + $this->args['orderby'] = 'mec_start_day_seconds ID'; + $this->args['order'] = (in_array($this->order_method, array('ASC', 'DESC')) ? $this->order_method : 'ASC'); + $this->args['meta_key'] = 'mec_start_day_seconds'; + + // Exclude Posts + if(isset($this->atts['exclude']) and is_array($this->atts['exclude']) and count($this->atts['exclude'])) $this->args['post__not_in'] = $this->atts['exclude']; + + // Include Posts + if(isset($this->atts['include']) and is_array($this->atts['include']) and count($this->atts['include'])) $this->args['post__in'] = $this->atts['include']; + + // Show Only Expired Events + $this->show_only_expired_events = (isset($this->atts['show_only_past_events']) and trim($this->atts['show_only_past_events'])) ? '1' : '0'; + + // Maximum Date Range. + $this->maximum_date_range = $this->get_end_date(); + + // Show Past Events + if($this->show_only_expired_events) + { + $this->atts['show_past_events'] = '1'; + $this->args['order'] = 'DESC'; + } + + // Show Past Events + $this->args['mec-past-events'] = $this->atts['show_past_events'] ?? '0'; + + if(strpos($this->style, 'fluent') === false && strpos($this->style, 'liquid') === false) + { + // Start Date + $this->start_date = $this->get_start_date(); + } + else + { + // Start Date + list($this->year, $this->month, $this->day) = $this->get_start_date(); + + $this->start_date = date('Y-m-d', strtotime($this->year.'-'.$this->month.'-'.$this->day)); + $this->active_day = $this->year . '-' . $this->month.'-' . $this->day; + } + + // We will extend the end date in the loop + $this->end_date = $this->start_date; + + // Show Ongoing Events + $this->show_ongoing_events = (isset($this->atts['show_only_ongoing_events']) and trim($this->atts['show_only_ongoing_events'])) ? '1' : '0'; + if($this->show_ongoing_events) + { + $this->args['mec-show-ongoing-events'] = $this->show_ongoing_events; + if((strpos($this->style, 'fluent') === false && strpos($this->style, 'liquid') === false)) + { + $this->maximum_date = $this->start_date; + } + } + + // Include Ongoing Events + $this->include_ongoing_events = (isset($this->atts['show_ongoing_events']) and trim($this->atts['show_ongoing_events'])) ? '1' : '0'; + if($this->include_ongoing_events) $this->args['mec-include-ongoing-events'] = $this->include_ongoing_events; + + // Set start time + if(isset($this->atts['seconds'])) + { + $this->args['mec-seconds'] = $this->atts['seconds']; + $this->args['mec-seconds-date'] = $this->atts['seconds_date'] ?? $this->start_date; + } + + // Apply Maximum Date + if(strpos($this->style, 'fluent') === false && strpos($this->style, 'liquid') === false) + { + $apply_sf_date = isset($_REQUEST['apply_sf_date']) ? sanitize_text_field($_REQUEST['apply_sf_date']) : 0; + $month = (isset($this->sf['month']) && trim($this->sf['month'])) ? $this->sf['month'] : ($_REQUEST['mec_month'] ?? ''); + if($apply_sf_date == 1 and trim($month) and $this->order_method === 'ASC') $this->maximum_date = date('Y-m-t', strtotime($this->start_date)); + } + + // Found Events + $this->found = 0; + + // Detect Load More Running + $this->loadMoreRunning = false; + + // Auto Month Rotation + $this->auto_month_rotation = !isset($this->settings['auto_month_rotation']) || $this->settings['auto_month_rotation']; + + do_action('mec-list-initialize-end', $this); + } + + /** + * Search and returns the filtered events + * @author Webnus + * @return array of objects + */ + public function search() + { + if(strpos($this->style, 'fluent') === false && strpos($this->style, 'liquid') === false) + { + return parent::search(); + } + else + { + if($this->show_only_expired_events) + { + if($this->loadMoreRunning) + { + $start = $this->start_date; + + if($this->month == date('m', current_time('timestamp'))) $end = date('Y-m-d', current_time('timestamp')); + else $end = date('Y-m-t', strtotime($this->start_date)); + } + else + { + $now = current_time('timestamp'); + $startDateTime = strtotime(date($this->year.$this->month.'t')) + (int) $this->main->get_gmt_offset_seconds(); + $now = min($startDateTime, $now); + + $start = date('Y-m-d H:i:s', $now); + $end = date('Y-m-d', strtotime($this->year.$this->month.'01')); + } + } + else + { + $start = $this->start_date; + $end = date('Y-m-t', strtotime($this->start_date)); + + // Set a certain maximum date from shortcode page. + if(trim($this->maximum_date) == '' and (isset($this->maximum_date_range) and trim($this->maximum_date_range))) $this->maximum_date = $this->maximum_date_range; + } + + // Date Events + if($this->show_only_expired_events && $this->loadMoreRunning) $this->show_only_expired_events = '0'; + + $dates = $this->period($start, $end, true); + ksort($dates); + + if($this->show_only_expired_events && $this->loadMoreRunning) $this->show_only_expired_events = '1'; + + // Limit + $this->args['posts_per_page'] = $this->limit; + + $i = 0; + $found = 0; + $events = []; + $qs = []; + + foreach($dates as $date=>$IDs) + { + // No Event + if(!is_array($IDs) or !count($IDs)) continue; + + // Check Finish Date + if(isset($this->maximum_date) and trim($this->maximum_date) and strtotime($date) > strtotime($this->maximum_date)) break; + + // Include Available Events + $this->args['post__in'] = array_unique($IDs); + + // Count of events per day + $IDs_count = array_count_values($IDs); + + // Extending the end date + $this->end_date = $date; + + // Continue to load rest of events in the first date + if($i === 0) $this->args['offset'] = $this->offset; + // Load all events in the rest of dates + else + { + $this->offset = 0; + $this->args['offset'] = 0; + } + + // The Query + $this->args = apply_filters('mec_skin_query_args', $this->args, $this); + + // Query Key + $q_key = base64_encode(json_encode($this->args)); + + // Get From Cache + if(isset($qs[$q_key])) $query = $qs[$q_key]; + // Search & Cache + else + { + $query = new WP_Query($this->args); + $qs[$q_key] = $query; + } + + if($query->have_posts()) + { + if(!isset($events[$date])) $events[$date] = []; + + // Day Events + $d = []; + + // The Loop + while($query->have_posts()) + { + $query->the_post(); + $ID = get_the_ID(); + + $ID_count = isset($IDs_count[$ID]) ? $IDs_count[$ID] : 1; + for($i = 1; $i <= $ID_count; $i++) + { + $rendered = $this->render->data($ID); + + $data = new stdClass(); + $data->ID = $ID; + $data->data = $rendered; + + $data->date = array + ( + 'start' => array('date' => $date), + 'end' => array('date' => $this->main->get_end_date($date, $rendered)) + ); + + $d[] = $this->render->after_render($data, $this, $i); + $found++; + } + + if($found >= $this->limit) + { + // Next Offset + $this->next_offset = ($query->post_count-($query->current_post+1)) >= 0 ? ($query->current_post+1)+$this->offset : 0; + + usort($d, [$this, 'sort_day_events']); + $events[$date] = $d; + + // Restore original Post Data + wp_reset_postdata(); + + break 2; + } + } + + usort($d, [$this, 'sort_day_events']); + $events[$date] = $d; + } + + // Restore original Post Data + wp_reset_postdata(); + $i++; + } + + // Initialize Occurrences' Data + MEC_feature_occurrences::fetch($events); + + // Set Offset for Last Page + if($found < $this->limit) + { + // Next Offset + $this->next_offset = $found + ((isset($date) and $this->start_date === $date) ? $this->offset : 0); + } + + // Set found events + $this->found = $found; + + return $events; + } + } + + /** + * Returns start day of skin for filtering events + * @author Webnus + * @return string|array + */ + public function get_start_date() + { + // Default date + $date = current_time('Y-m-d'); + + if(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'today') $date = current_time('Y-m-d'); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'tomorrow') $date = date('Y-m-d', strtotime('Tomorrow')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'yesterday') $date = date('Y-m-d', strtotime('Yesterday')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_last_month') $date = date('Y-m-d', strtotime('first day of last month')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_current_month') $date = date('Y-m-d', strtotime('first day of this month')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_next_month') $date = date('Y-m-d', strtotime('first day of next month')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'date') $date = date('Y-m-d', strtotime($this->skin_options['start_date'])); + + // Hide past events + if(isset($this->atts['show_past_events']) and !trim($this->atts['show_past_events'])) + { + $today = current_time('Y-m-d'); + if(strtotime($date) < strtotime($today)) $date = $today; + } + + // Show only expired events + if(isset($this->show_only_expired_events) and $this->show_only_expired_events) + { + $now = date('Y-m-d H:i:s', current_time('timestamp')); + if(strtotime($date) > strtotime($now)) $date = $now; + } + + // MEC Next Page + if(isset($_REQUEST['mec_next_page']) and trim($_REQUEST['mec_next_page'])) + { + $ex = explode(':', $_REQUEST['mec_next_page']); + + if(strtotime($ex[0])) $date = $ex[0]; + if(isset($ex[1])) $this->offset = $ex[1]; + } + + if(strpos($this->style, 'fluent') === false && strpos($this->style, 'liquid') === false) return $date; + else + { + $time = strtotime($date); + return array(date('Y', $time), date('m', $time), date('d', $time)); + } + } + + /** + * Load more events for AJAX request + * @author Webnus + * @return void + */ + public function load_more() + { + $this->sf = (isset($_REQUEST['sf']) and is_array($_REQUEST['sf'])) ? $this->main->sanitize_deep_array($_REQUEST['sf']) : []; + $apply_sf_date = isset($_REQUEST['apply_sf_date']) ? sanitize_text_field($_REQUEST['apply_sf_date']) : 1; + $atts = $this->sf_apply(((isset($_REQUEST['atts']) and is_array($_REQUEST['atts'])) ? $this->main->sanitize_deep_array($_REQUEST['atts']) : array()), $this->sf, $apply_sf_date); + + // Initialize the skin + $this->initialize($atts); + + // Override variables + if(strpos($this->style, 'fluent') === false && strpos($this->style, 'liquid') === false) + { + $this->start_date = isset($_REQUEST['mec_start_date']) ? sanitize_text_field($_REQUEST['mec_start_date']) : date('y-m-d'); + } + else + { + $this->maximum_date = isset($_REQUEST['mec_maximum_date']) ? sanitize_text_field($_REQUEST['mec_maximum_date']) : ''; + $mecStartDate = isset($_REQUEST['mec_start_date']) ? sanitize_text_field($_REQUEST['mec_start_date']) : date('y-m-d'); + $this->start_date = strtotime($mecStartDate) > strtotime($this->maximum_date) ? $this->maximum_date : $mecStartDate; + $this->year = isset($_REQUEST['mec_year']) ? sanitize_text_field($_REQUEST['mec_year']) : NULL; + $this->month = isset($_REQUEST['mec_month']) ? sanitize_text_field($_REQUEST['mec_month']) : NULL; + $this->loadMoreRunning = true; + } + + $this->end_date = $this->start_date; + $this->offset = isset($_REQUEST['mec_offset']) ? sanitize_text_field($_REQUEST['mec_offset']) : 0; + + // Apply Maximum Date + $month = (isset($this->sf['month']) && trim($this->sf['month'])) ? $this->sf['month'] : ($_REQUEST['mec_month'] ?? ''); + if($apply_sf_date == 1 and trim($month) and $this->order_method === 'ASC') $this->maximum_date = date('Y-m-t', strtotime($this->start_date)); + + // Return the events + $this->atts['return_items'] = true; + if(!$apply_sf_date) $this->loading_more = true; + + // Fetch the events + $this->fetch(); + + // Return the output + $output = $this->output(); + + echo json_encode($output); + exit; + } + + /** + * Load month for AJAX request / Fluent View + * @author Webnus + * @return void + */ + public function load_month() + { + $this->sf = (isset($_REQUEST['sf']) and is_array($_REQUEST['sf'])) ? $this->main->sanitize_deep_array($_REQUEST['sf']) : []; + $apply_sf_date = isset($_REQUEST['apply_sf_date']) ? sanitize_text_field($_REQUEST['apply_sf_date']) : 1; + $atts = $this->sf_apply(((isset($_REQUEST['atts']) and is_array($_REQUEST['atts'])) ? $this->main->sanitize_deep_array($_REQUEST['atts']) : array()), $this->sf, $apply_sf_date); + + $navigator_click = isset($_REQUEST['navigator_click']) && sanitize_text_field($_REQUEST['navigator_click']); + + // Initialize the skin + $this->initialize($atts); + + // Search Events If Not Found In Current Month + $c = 0; + $break = false; + + do + { + if($c > 12) $break = true; + if($c and !$break) + { + if(intval($this->month) == 12) + { + $this->year = intval($this->year)+1; + $this->month = '01'; + } + + $this->month = sprintf("%02d", intval($this->month)+1); + } + else + { + // Start Date + $this->year = isset($_REQUEST['mec_year']) ? sanitize_text_field($_REQUEST['mec_year']) : current_time('Y'); + $this->month = isset($_REQUEST['mec_month']) ? sanitize_text_field($_REQUEST['mec_month']) : current_time('m'); + } + + if($this->show_only_expired_events) + { + $this->start_date = date('Y-m-d', strtotime($this->year.'-'.$this->month.'-01')); + $this->active_day = date('Y-m-t', strtotime($this->year.'-'.$this->month.'-01')); + } + else + { + $this->start_date = date('Y-m-d', strtotime($this->year.'-'.$this->month.'-01')); + + $day = current_time('d'); + $this->active_day = $this->year.'-'.$this->month.'-'.$day; + + // If date is not valid then use the first day of month + if(!$this->main->validate_date($this->active_day, 'Y-m-d')) $this->active_day = $this->year.'-'.$this->month.'-01'; + } + + // We will extend the end date in the loop + $this->end_date = $this->start_date; + + // Return the events + $this->atts['return_items'] = true; + + // Fetch the events + $this->fetch(); + + // Break the loop if not result + if($break) break; + + // Set active day to current day if not result + if(count($this->events)) $this->active_day = key($this->events); + if($navigator_click) break; + + // Auto Rotation is Disabled + if(!$this->auto_month_rotation) break; + + $c++; + } + while(!count($this->events)); + + // Return the output + $output = $this->output(); + + echo json_encode($output); + exit; + } +} diff --git a/app/skins/list/index.html b/app/skins/list/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/skins/list/render.php b/app/skins/list/render.php new file mode 100755 index 0000000..b650dd6 --- /dev/null +++ b/app/skins/list/render.php @@ -0,0 +1,369 @@ +main->get_styling(); +$settings = $this->main->get_settings(); +$current_month_divider = isset($_REQUEST['current_month_divider']) ? sanitize_text_field($_REQUEST['current_month_divider']) : 0; +$display_label = $this->skin_options['display_label'] ?? false; +$reason_for_cancellation = $this->skin_options['reason_for_cancellation'] ?? false; +$event_colorskin = (isset($styling['mec_colorskin']) || isset($styling['color'])) ? 'colorskin-custom' : ''; +$map_events = []; +?> +
    +
    + events as $date=>$events): ?> + + month_divider and $month_id != $current_month_divider): $current_month_divider = $month_id; ?> +
    main->date_i18n('F Y', strtotime($date))); ?>
    + + + main->get_master_location_id($event); + $location = ($location_id ? $this->main->get_location_data($location_id) : array()); + + $organizer_id = $this->main->get_master_organizer_id($event); + $organizer = ($organizer_id ? $this->main->get_organizer_data($organizer_id) : array()); + $start_time = (isset($event->data->time) ? $event->data->time['start'] : ''); + $end_time = (isset($event->data->time) ? $event->data->time['end'] : ''); + $event_color = $this->get_event_color_dot($event); + $event_start_date = !empty($event->date['start']['date']) ? $event->date['start']['date'] : ''; + $mec_data = $this->display_custom_data($event); + $custom_data_class = !empty($mec_data) ? 'mec-custom-data' : ''; + + // MEC Schema + do_action('mec_schema', $event); + ?> +
    + style == 'modern'): ?> +
    + + main->is_multipleday_occurrence($event, true)): ?> +
    +
    + main->date_i18n($this->date_format_modern_1, strtotime($event->date['start']['date']))); ?> - + main->date_i18n($this->date_format_modern_1, strtotime($event->date['end']['date']))); ?> +
    +
    main->date_i18n($this->date_format_modern_2, strtotime($event->date['start']['date']))); ?>
    +
    main->date_i18n($this->date_format_modern_3, strtotime($event->date['start']['date']))); ?>
    +
    + main->is_multipleday_occurrence($event)): ?> +
    +
    main->date_i18n($this->date_format_modern_1, strtotime($event->date['start']['date']))); ?>
    +
    main->date_i18n($this->date_format_modern_2, strtotime($event->date['start']['date']))); ?>
    +
    main->date_i18n($this->date_format_modern_3, strtotime($event->date['start']['date']))); ?>
    +
    +
    +
    main->date_i18n($this->date_format_modern_1, strtotime($event->date['end']['date']))); ?>
    +
    main->date_i18n($this->date_format_modern_2, strtotime($event->date['end']['date']))); ?>
    +
    main->date_i18n($this->date_format_modern_3, strtotime($event->date['end']['date']))); ?>
    +
    + +
    +
    main->date_i18n($this->date_format_modern_1, strtotime($event->date['start']['date']))); ?>
    +
    main->date_i18n($this->date_format_modern_2, strtotime($event->date['start']['date']))); ?>
    +
    main->date_i18n($this->date_format_modern_3, strtotime($event->date['start']['date']))); ?>
    +
    + +
    +
    + + main->get_flags($event); ?> +

    display_link($event)); ?>main->get_normal_labels($event, $display_label).$this->main->display_cancellation_reason($event, $reason_for_cancellation)); ?>display_custom_data($event)); ?>data->ID); ?>get_label_captions($event,'mec-fc-style')); ?>

    + localtime) echo MEC_kses::full($this->main->module('local-time.type2', array('event' => $event))); ?> +
    +
    + include_events_times and trim($start_time)) echo MEC_kses::element($this->main->display_time($start_time, $end_time)); ?> + display_categories($event)); ?> + display_organizers($event)); ?> + display_cost($event)); ?> +
    +
      main->module('links.list', array('event' => $event))); ?>
    +
    +
    + booking_button($event, 'icon')); ?> + display_link($event, ((is_array($event->data->tickets) and count($event->data->tickets) and !strpos($soldout, '%%soldout%%') and !$this->booking_button and !$this->main->is_expired($event)) ? $this->main->m('register_button', esc_html__('REGISTER', 'modern-events-calendar-lite')) : $this->main->m('view_detail', esc_html__('View Detail', 'modern-events-calendar-lite'))), 'mec-booking-button')); ?> + +
    + style == 'classic'): ?> +
    display_link($event, $event->data->thumbnails['thumbnail'])); ?>
    + +
    icons->display('calendar'); ?> main->date_i18n($this->date_format_classic_1, strtotime($event->date['start']['date']))); ?>
    + +
    icons->display('calendar'); ?> main->dateify($event, $this->date_format_classic_1)); ?>
    +
    include_events_times and trim($start_time)) { echo $this->icons->display('clock'); echo MEC_kses::element($this->main->display_time($start_time, $end_time)); } ?>
    + + get_label_captions($event)); ?> + localtime) echo MEC_kses::full($this->main->module('local-time.type2', array('event' => $event))); ?> +

    display_link($event)); ?>display_custom_data($event)); ?>main->get_flags($event).$event_color.$this->main->get_normal_labels($event, $display_label).$this->main->display_cancellation_reason($event, $reason_for_cancellation)); ?>data->ID ); ?>

    +
    icons->display('map-marker'); ?>
    + display_categories($event)); ?> + display_organizers($event)); ?> + display_cost($event)); ?> + skin_options); ?> + booking_button($event)); ?> + style == 'minimal'): ?> + get_label_captions($event)); ?> +
    + main->is_multipleday_occurrence($event, true)): ?> +
    + main->date_i18n($this->date_format_minimal_1, strtotime($event->date['start']['date']))); ?> - main->date_i18n($this->date_format_minimal_1, strtotime($event->date['end']['date']))); ?> + main->date_i18n($this->date_format_minimal_2, strtotime($event->date['start']['date']))); ?> +
    + main->is_multipleday_occurrence($event)): ?> +
    + main->date_i18n($this->date_format_minimal_1, strtotime($event->date['start']['date']))); ?> + main->date_i18n($this->date_format_minimal_2, strtotime($event->date['start']['date']))); ?> +
    +
    + main->date_i18n($this->date_format_minimal_1, strtotime($event->date['end']['date']))); ?> + main->date_i18n($this->date_format_minimal_2, strtotime($event->date['end']['date']))); ?> +
    + +
    + main->date_i18n($this->date_format_minimal_1, strtotime($event->date['start']['date']))); ?> + main->date_i18n($this->date_format_minimal_2, strtotime($event->date['start']['date']))); ?> +
    + + + include_events_times and trim($start_time)) echo MEC_kses::element($this->main->display_time($start_time, $end_time)); ?> +

    display_link($event)); ?>display_custom_data($event)); ?>main->get_flags($event).$event_color.$this->main->get_normal_labels($event, $display_label).$this->main->display_cancellation_reason($event, $reason_for_cancellation)); ?>data->ID ); ?>

    +
    + main->date_i18n($this->date_format_minimal_3, strtotime($event->date['start']['date']))); ?>, ' . esc_html($location['name']) .'' : ''); ?>localtime) echo MEC_kses::full($this->main->module('local-time.type2', array('event' => $event))); ?> +
    + + display_categories($event)); ?> + display_organizers($event)); ?> + display_cost($event)); ?> + booking_button($event)); ?> +
    +
    display_link($event, $this->main->m('event_detail', esc_html__('EVENT DETAIL', 'modern-events-calendar-lite')), 'mec-detail-button')); ?>
    + style == 'standard'): ?> + data->post); + + // Safe Excerpt for UTF-8 Strings + if(!trim($excerpt)) + { + $ex = explode(' ', strip_tags(strip_shortcodes($event->data->post->post_content))); + $words = array_slice($ex, 0, 10); + + $excerpt = implode(' ', $words); + if(trim($excerpt)) $excerpt .= ' […]'; + } + ?> +
    + data->thumbnails['thumblist'])) : ?> +
    +
    display_link($event, $event->data->thumbnails['thumblist'], '')); ?>
    +
    + + +
    +
    + main->get_flags($event); ?> + display_status_bar($event)); ?> +

    display_link($event)); ?>display_custom_data($event)); ?>main->get_normal_labels($event, $display_label).$this->main->display_cancellation_reason($event, $reason_for_cancellation)); ?>data->ID ); ?>

    +
    +
    +
    +
    +
    +
    + + icons->display('calendar'); ?>main->date_i18n($this->date_format_standard_1, strtotime($event->date['start']['date']))); ?> + + icons->display('calendar'); ?>main->dateify($event, $this->date_format_standard_1)); ?> + +
    + get_label_captions($event)); ?> + main->display_time($start_time, $end_time, ['display_svg' => true, 'icon' => ($this->icons->has('clock') ? $this->icons->display('clock') : '')])); ?> + localtime) echo MEC_kses::full($this->main->module('local-time.type1', array('event' => $event, 'display_svg' => true ))); ?> + +
    + icons->has('location-pin') ? $this->icons->display('location-pin') : ''; ?> + + +
    + +
    + + display_categories($event)); ?> + display_organizers($event)); ?> + display_cost($event)); ?> + +
    +
    +
    + + style == 'accordion'): ?> + +
    + +
    +
    + toggle_month_divider == '1'): ?> + + +
    + +
    main->date_i18n($this->date_format_acc_1, strtotime($event->date['start']['date']))); ?>
    +
    main->date_i18n($this->date_format_acc_2, strtotime($event->date['start']['date']))); ?>
    + +
    main->dateify($event, $this->date_format_acc_1.' '.$this->date_format_acc_2)); ?>
    + + main->display_time($start_time, $end_time)); ?> +
    +

    + data->title), + $event, + $this + ); + ?>main->get_flags($event).$event_color); ?>

    + get_label_captions($event,'mec-fc-style')); ?> + main->get_normal_labels($event, $display_label).$this->main->display_cancellation_reason($event, $reason_for_cancellation)); ?>data->ID); ?> +
    + +
    +
    + style === 'admin'): ?> +
    + main->is_multipleday_occurrence($event, true)): ?> +
    +
    + main->date_i18n($this->date_format_modern_1, strtotime($event->date['start']['date']))); ?> - + main->date_i18n($this->date_format_modern_1, strtotime($event->date['end']['date']))); ?> +
    +
    main->date_i18n($this->date_format_modern_2, strtotime($event->date['start']['date']))); ?>
    +
    main->date_i18n($this->date_format_modern_3, strtotime($event->date['start']['date']))); ?>
    +
    + main->is_multipleday_occurrence($event)): ?> +
    +
    main->date_i18n($this->date_format_modern_1, strtotime($event->date['start']['date']))); ?>
    +
    main->date_i18n($this->date_format_modern_2, strtotime($event->date['start']['date']))); ?>
    +
    main->date_i18n($this->date_format_modern_3, strtotime($event->date['start']['date']))); ?>
    +
    +
    +
    main->date_i18n($this->date_format_modern_1, strtotime($event->date['end']['date']))); ?>
    +
    main->date_i18n($this->date_format_modern_2, strtotime($event->date['end']['date']))); ?>
    +
    main->date_i18n($this->date_format_modern_3, strtotime($event->date['end']['date']))); ?>
    +
    + +
    +
    main->date_i18n($this->date_format_modern_1, strtotime($event->date['start']['date']))); ?>
    +
    main->date_i18n($this->date_format_modern_2, strtotime($event->date['start']['date']))); ?>
    +
    main->date_i18n($this->date_format_modern_3, strtotime($event->date['start']['date']))); ?>
    +
    + +
    +
    + main->get_flags($event); ?> +

    + + data->title, $event); ?> + + main->get_normal_labels($event, $display_label).$this->main->display_cancellation_reason($event, $reason_for_cancellation)); ?> + data->ID); ?> + get_label_captions($event,'mec-fc-style')); ?> +

    +
    +
    + include_events_times and trim($start_time)) echo MEC_kses::element($this->main->display_time($start_time, $end_time)); ?> + display_categories($event)); ?> + display_organizers($event)); ?> + display_cost($event)); ?> +
    +
    +
    + date['start']['timestamp']) && current_user_can(current_user_can('administrator') ? 'manage_options' : 'mec_bookings') && $total_attendees = $this->main->get_total_attendees_by_event_occurrence($event->data->ID, $event->date['start']['timestamp'])): ?> + () + +
    + +
    + + +
    +
    + +map_on_top) and $this->map_on_top and isset($map_events) and !empty($map_events)) +{ + // Include Map Assets such as JS and CSS libraries + $this->main->load_map_assets(); + + // It changing geolocation focus, because after done filtering, if it doesn't. then the map position will not set correctly. + if((isset($_REQUEST['action']) and sanitize_text_field($_REQUEST['action']) == 'mec_list_load_more') and isset($_REQUEST['sf'])) $this->geolocation_focus = true; + + $map_javascript = ''; + + $map_javascript = apply_filters('mec_map_load_script', $map_javascript, $this, $settings); + + // Include javascript code into the page + if($this->main->is_ajax()) echo MEC_kses::full($map_javascript); + else $this->factory->params('footer', $map_javascript); +} diff --git a/app/skins/list/tpl.php b/app/skins/list/tpl.php new file mode 100755 index 0000000..b7a3e79 --- /dev/null +++ b/app/skins/list/tpl.php @@ -0,0 +1,108 @@ +get_render_path(); +$styling = $this->main->get_styling(); + +$dark_mode = $styling['dark_mode'] ?? ''; +if($dark_mode == 1) $set_dark = 'mec-dark-mode'; +else $set_dark = ''; + +ob_start(); +include $render_path; +$items_html = ob_get_clean(); + +if(isset($this->atts['return_items']) and $this->atts['return_items']) +{ + echo json_encode(array('html' => $items_html, 'end_date' => $this->end_date, 'offset' => $this->next_offset, 'count' => $this->found, 'current_month_divider' => $current_month_divider, 'has_more_event' => (int) $this->has_more_events)); + exit; +} + +$sed_method = $this->sed_method; +if($sed_method == 'new') $sed_method = '0'; + +// Generating javascript code tpl +$javascript = ''; + +// Do not include JS due to loading in display only views such as MEC Dashboard +if(isset($this->skin_options['ignore_js']) and $this->skin_options['ignore_js']) $javascript = ''; + +// Include javascript code into the page +if($this->main->is_ajax() or $this->main->preview()) echo MEC_kses::full($javascript); +else $this->factory->params('footer', $javascript); + +do_action('mec_start_skin', $this->id); +do_action('mec_list_skin_head'); +?> +
    + + sf_status) echo MEC_kses::full($this->sf_search_form()); ?> + + found): ?> + map_on_top == '1'): ?> +
    +
    + settings['default_maps_view'] ?? 'google'; + do_action('mec_map_inner_element_tools', array('map' => $map)); + ?> +
    + +
    + +
    + +
    +
    + main->display_not_found_message(); ?> +
    + +
    + main->display_not_found_message(); ?> +
    + + + get_pagination_bar(); ?> + +
    +display_credit_url(); \ No newline at end of file diff --git a/app/skins/map.php b/app/skins/map.php new file mode 100755 index 0000000..11a3fc4 --- /dev/null +++ b/app/skins/map.php @@ -0,0 +1,253 @@ + + */ +class MEC_skin_map extends MEC_skins +{ + /** + * @var string + */ + public $skin = 'map'; + public $geolocation; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + parent::__construct(); + } + + /** + * Registers skin actions into WordPress + * @author Webnus + */ + public function actions() + { + $this->factory->action('wp_ajax_mec_map_get_markers', array($this, 'get_markers')); + $this->factory->action('wp_ajax_nopriv_mec_map_get_markers', array($this, 'get_markers')); + } + + /** + * Initialize the skin + * @author Webnus + * @param array $atts + */ + public function initialize($atts) + { + $this->atts = $atts; + + // Skin Options + $this->skin_options = (isset($this->atts['sk-options']) and isset($this->atts['sk-options'][$this->skin])) ? $this->atts['sk-options'][$this->skin] : []; + + // Icons + $this->icons = $this->main->icons( + isset($this->atts['icons']) && is_array($this->atts['icons']) ? $this->atts['icons'] : [] + ); + + // Search Form Options + $this->sf_options = (isset($this->atts['sf-options']) and isset($this->atts['sf-options'][$this->skin])) ? $this->atts['sf-options'][$this->skin] : []; + + $this->style = $this->skin_options['style'] ?? 'classic'; + + // Next/Previous Month + $this->next_previous_button = isset($this->skin_options['next_previous_button']) && $this->skin_options['next_previous_button']; + + // Search Form Status + $this->sf_status = $this->atts['sf_status'] ?? true; + $this->sf_display_label = $this->atts['sf_display_label'] ?? false; + $this->sf_reset_button = $this->atts['sf_reset_button'] ?? false; + $this->sf_refine = $this->atts['sf_refine'] ?? false; + + // Generate an ID for the skin + $this->id = $this->atts['id'] ?? mt_rand(100, 999); + + // Set the ID + if(!isset($this->atts['id'])) $this->atts['id'] = $this->id; + + // HTML class + $this->html_class = ''; + if(isset($this->atts['html-class']) and trim($this->atts['html-class']) != '') $this->html_class = $this->atts['html-class']; + + // From Widget + $this->widget = isset($this->atts['widget']) && trim($this->atts['widget']); + + // Init MEC + $this->args['mec-skin'] = $this->skin; + + // Post Type + $this->args['post_type'] = $this->main->get_main_post_type(); + + // Post Status + $this->args['post_status'] = 'publish'; + + // Keyword Query + $this->args['s'] = $this->keyword_query(); + + // Taxonomy + $this->args['tax_query'] = $this->tax_query(); + + // Meta + $this->args['meta_query'] = $this->meta_query(); + + // Tag + if(apply_filters('mec_taxonomy_tag', '') === 'post_tag') $this->args['tag'] = $this->tag_query(); + + // Author + $this->args['author'] = $this->author_query(); + $this->args['author__not_in'] = $this->author_query_ex(); + + // Pagination Options + $this->paged = get_query_var('paged', 1); + $this->limit = (isset($this->skin_options['limit']) and trim($this->skin_options['limit'])) ? $this->skin_options['limit'] : 200; + + $this->args['posts_per_page'] = $this->limit; + $this->args['paged'] = $this->paged; + + // Sort Options + $this->args['orderby'] = 'mec_start_day_seconds ID'; + $this->args['order'] = 'ASC'; + $this->args['meta_key'] = 'mec_start_day_seconds'; + + // Show Past Events + $this->args['mec-past-events'] = $this->atts['show_past_events'] ?? 0; + + // Geolocation + $this->geolocation = $this->skin_options['geolocation'] ?? 0; + + // Geolocation Focus + $this->geolocation_focus = $this->skin_options['geolocation_focus'] ?? 0; + + // Start Date + $this->start_date = $this->get_start_date(); + + // End Date + $this->end_date = ((isset($this->atts['date-range-end']) and trim($this->atts['date-range-end'])) ? $this->atts['date-range-end'] : NULL); + if(!$this->end_date and isset($this->sf['month']) and trim($this->sf['month']) and isset($this->sf['year']) and trim($this->sf['year'])) $this->end_date = date('Y-m-t', strtotime($this->sf['year'].'-'.$this->sf['month'].'-01')); + } + + /** + * Returns start day of skin for filtering events + * @author Webnus + * @return string + */ + public function get_start_date() + { + // Default date + $date = current_time('Y-m-d'); + + if(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'today') $date = current_time('Y-m-d'); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'tomorrow') $date = date('Y-m-d', strtotime('Tomorrow')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'yesterday') $date = date('Y-m-d', strtotime('Yesterday')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_last_month') $date = date('Y-m-d', strtotime('first day of last month')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_current_month') $date = date('Y-m-d', strtotime('first day of this month')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_next_month') $date = date('Y-m-d', strtotime('first day of next month')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'date') $date = date('Y-m-d', strtotime($this->skin_options['start_date'])); + + // Hide past events + if(isset($this->atts['show_past_events']) and !trim($this->atts['show_past_events'])) + { + $today = current_time('Y-m-d'); + if(strtotime($date) < strtotime($today)) $date = $today; + } + + return $date; + } + + /** + * Search and returns the filtered events + * @author Webnus + * @return array + */ + public function search() + { + $events = []; + $sorted = []; + + $yesterday = ($this->end_date ? $this->start_date : date('Y-m-d', strtotime('Yesterday', strtotime($this->start_date)))); + + // The Query + $this->args = apply_filters('mec_skin_query_args', $this->args, $this); + $query = new WP_Query($this->args); + + if($query->have_posts()) + { + // The Loop + while($query->have_posts()) + { + $query->the_post(); + + $event_id = get_the_ID(); + $rendered = $this->render->data($event_id); + + $data = new stdClass(); + $data->ID = $event_id; + $data->data = $rendered; + $data->dates = $this->render->dates($event_id, $rendered, 1, $yesterday); + $data->date = $data->dates[0] ?? []; + + if(strtotime($data->date['end']['date']) < strtotime($this->start_date)) continue; + if($this->end_date and strtotime($data->date['start']['date']) > strtotime($this->end_date)) continue; + + if($this->hide_time_method == 'end' and strtotime($data->date['end']['date']) < strtotime($this->start_date)) continue; + elseif($this->hide_time_method != 'end') + { + if((isset($this->atts['show_past_events']) and !$this->atts['show_past_events']) and strtotime($data->date['start']['date']) < strtotime($this->start_date)) continue; + } + + // Caclculate event start time + $event_start_time = (isset($data->date['start']) ? strtotime($data->date['start']['date']) : 0) + $rendered->meta['mec_start_day_seconds']; + + // Add the event into the to be sorted array + if(!isset($sorted[$event_start_time])) $sorted[$event_start_time] = []; + $sorted[$event_start_time][] = $this->render->after_render($data, $this); + } + + ksort($sorted, SORT_NUMERIC); + } + + // Add sorted events to the results + foreach($sorted as $sorted_events) + { + if(!is_array($sorted_events)) continue; + foreach($sorted_events as $sorted_event) $events[$sorted_event->ID] = $sorted_event; + } + + // Restore original Post Data + wp_reset_postdata(); + + return $events; + } + + /** + * Get markers for AJAX request + * @author Webnus + * @return void + */ + public function get_markers() + { + $this->sf = (isset($_REQUEST['sf']) and is_array($_REQUEST['sf'])) ? $this->main->sanitize_deep_array($_REQUEST['sf']) : []; + $apply_sf_date = isset($_REQUEST['apply_sf_date']) ? sanitize_text_field($_REQUEST['apply_sf_date']) : 1; + $atts = $this->sf_apply(((isset($_REQUEST['atts']) and is_array($_REQUEST['atts'])) ? $this->main->sanitize_deep_array($_REQUEST['atts']) : array()), $this->sf, $apply_sf_date); + + // Initialize the skin + $this->initialize($atts); + + // Return the events + $this->atts['return_items'] = true; + + // Fetch the events + $this->fetch(); + + // Return the output + $output = $this->output(); + + echo json_encode($output); + exit; + } +} diff --git a/app/skins/map/index.html b/app/skins/map/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/skins/map/tpl.php b/app/skins/map/tpl.php new file mode 100755 index 0000000..52e8eca --- /dev/null +++ b/app/skins/map/tpl.php @@ -0,0 +1,100 @@ +main->get_settings(); +$settings['view_mode'] = $this->atts['location_view_mode'] ?? 'normal'; +$settings['map'] = $settings['default_maps_view'] ?? 'google'; + +// Return the data if called by AJAX +if(isset($this->atts['return_items']) and $this->atts['return_items']) +{ + echo json_encode(array('markers' => $this->render->markers($this->events, $this->style))); + exit; +} + +$events_data = $this->render->markers($this->events, $this->style); +if(count($this->events)) +{ + // Include Map Assets such as JS and CSS libraries + $this->main->load_map_assets(false, $settings); + + $javascript = ''; + + $javascript = apply_filters('mec_map_load_script', $javascript, $this, $settings); + + // Include javascript code into the page + if($this->main->is_ajax() or $this->main->preview()) echo MEC_kses::full($javascript); + else $this->factory->params('footer', $javascript); +} + +do_action('mec_start_skin', $this->id); +do_action('mec_map_skin_head'); +?> + +
    + + sf_status) echo MEC_kses::full($this->sf_search_form()); ?> + + + events)): ?> +
    + +
    + +

    + + +
    + +
    +
    +
    +
    + sf_status) echo MEC_kses::full($this->sf_search_form()); ?> +
    +
    +
    +
    +
    + events)): ?> +
    + +
    + +

    + +
    +
    +
    +
    + +display_credit_url(); diff --git a/app/skins/masonry.php b/app/skins/masonry.php new file mode 100755 index 0000000..825b19b --- /dev/null +++ b/app/skins/masonry.php @@ -0,0 +1,340 @@ + + */ +class MEC_skin_masonry extends MEC_skins +{ + /** + * @var string + */ + public $skin = 'masonry'; + public $date_format_1 = 'j'; + public $date_format_2 = 'F'; + public $filter_by = 'category'; + public $masonry_like_grid; + public $fit_to_row; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + parent::__construct(); + } + + /** + * Registers skin actions into WordPress + * @author Webnus + */ + public function actions() + { + $this->factory->action('wp_ajax_mec_masonry_load_more', array($this, 'load_more')); + $this->factory->action('wp_ajax_nopriv_mec_masonry_load_more', array($this, 'load_more')); + } + + /** + * Initialize the skin + * @author Webnus + * @param array $atts + */ + public function initialize($atts) + { + $this->atts = $atts; + + // Skin Options + $this->skin_options = (isset($this->atts['sk-options']) and isset($this->atts['sk-options'][$this->skin])) ? $this->atts['sk-options'][$this->skin] : []; + + // Icons + $this->icons = $this->main->icons( + isset($this->atts['icons']) && is_array($this->atts['icons']) ? $this->atts['icons'] : [] + ); + + // Date Formats + $this->date_format_1 = (isset($this->skin_options['date_format1']) and trim($this->skin_options['date_format1'])) ? $this->skin_options['date_format1'] : 'j'; + $this->date_format_2 = (isset($this->skin_options['date_format2']) and trim($this->skin_options['date_format2'])) ? $this->skin_options['date_format2'] : 'F'; + + // Filter By + $this->filter_by = (isset($this->skin_options['filter_by']) and trim($this->skin_options['filter_by'])) ? $this->skin_options['filter_by'] : ''; + + // Search Form Options + $this->sf_options = $this->atts['sf-options'][$this->skin] ?? []; + + // Search Form Status + $this->sf_status = $this->atts['sf_status'] ?? true; + $this->sf_display_label = $this->atts['sf_display_label'] ?? false; + $this->sf_reset_button = $this->atts['sf_reset_button'] ?? false; + $this->sf_refine = $this->atts['sf_refine'] ?? false; + + // Generate an ID for the sking + $this->id = $this->atts['id'] ?? mt_rand(100, 999); + + // Set the ID + if(!isset($this->atts['id'])) $this->atts['id'] = $this->id; + + // Show "Load More" button or not + $this->load_more_button = $this->skin_options['load_more_button'] ?? true; + + // Pagination + $this->pagination = $this->skin_options['pagination'] ?? (!$this->load_more_button ? '0' : 'loadmore'); + + // Show Masonry like grid + $this->masonry_like_grid = $this->skin_options['masonry_like_grid'] ?? true; + + // Show "Sort by date" button or not + $this->fit_to_row = $this->skin_options['fit_to_row'] ?? true; + + // HTML class + $this->html_class = ''; + if(isset($this->atts['html-class']) and trim($this->atts['html-class']) != '') $this->html_class = $this->atts['html-class']; + + // Booking Button + $this->booking_button = isset($this->skin_options['booking_button']) ? (int) $this->skin_options['booking_button'] : 0; + + // SED Method + $this->sed_method = $this->get_sed_method(); + + // Order Method + $this->order_method = (isset($this->skin_options['order_method']) and trim($this->skin_options['order_method'])) ? $this->skin_options['order_method'] : 'ASC'; + + // Image popup + $this->image_popup = $this->skin_options['image_popup'] ?? '0'; + + // reason_for_cancellation + $this->reason_for_cancellation = $this->skin_options['reason_for_cancellation'] ?? false; + + // display_label + $this->display_label = $this->skin_options['display_label'] ?? false; + + // From Widget + $this->widget = isset($this->atts['widget']) && trim($this->atts['widget']); + + // Init MEC + $this->args['mec-init'] = true; + $this->args['mec-skin'] = $this->skin; + + // Post Type + $this->args['post_type'] = $this->main->get_main_post_type(); + + // Post Status + $this->args['post_status'] = 'publish'; + + // Keyword Query + $this->args['s'] = $this->keyword_query(); + + // Taxonomy + $this->args['tax_query'] = $this->tax_query(); + + // Meta + $this->args['meta_query'] = $this->meta_query(); + + // Tag + if(apply_filters('mec_taxonomy_tag', '') === 'post_tag') $this->args['tag'] = $this->tag_query(); + + // Author + $this->args['author'] = $this->author_query(); + $this->args['author__not_in'] = $this->author_query_ex(); + + // Pagination Options + $this->paged = get_query_var('paged', 1); + $this->limit = (isset($this->skin_options['limit']) and trim($this->skin_options['limit'])) ? $this->skin_options['limit'] : 24; + + $this->args['posts_per_page'] = $this->limit; + $this->args['paged'] = $this->paged; + + // Sort Options + $this->args['orderby'] = 'mec_start_day_seconds ID'; + $this->args['order'] = (in_array($this->order_method, array('ASC', 'DESC')) ? $this->order_method : 'ASC'); + $this->args['meta_key'] = 'mec_start_day_seconds'; + + // Exclude Posts + if(isset($this->atts['exclude']) and is_array($this->atts['exclude']) and count($this->atts['exclude'])) $this->args['post__not_in'] = $this->atts['exclude']; + + // Include Posts + if(isset($this->atts['include']) and is_array($this->atts['include']) and count($this->atts['include'])) $this->args['post__in'] = $this->atts['include']; + + // Show Only Expired Events + $this->show_only_expired_events = (isset($this->atts['show_only_past_events']) and trim($this->atts['show_only_past_events'])) ? '1' : '0'; + + // Maximum Date Range. + $this->maximum_date_range = $this->get_end_date(); + + if($this->show_only_expired_events) + { + $this->atts['show_past_events'] = '1'; + $this->args['order'] = 'DESC'; + } + + // Show Past Events + $this->args['mec-past-events'] = isset($this->atts['show_past_events']) ? $this->atts['show_past_events'] : '0'; + + // Start Date + $this->start_date = $this->get_start_date(); + + // We will extend the end date in the loop + $this->end_date = $this->start_date; + + // Show Ongoing Events + $this->show_ongoing_events = (isset($this->atts['show_only_ongoing_events']) and trim($this->atts['show_only_ongoing_events'])) ? '1' : '0'; + if($this->show_ongoing_events) + { + $this->args['mec-show-ongoing-events'] = $this->show_ongoing_events; + if((strpos($this->style, 'fluent') === false && strpos($this->style, 'liquid') === false)) + { + $this->maximum_date = $this->start_date; + } + } + + // Include Ongoing Events + $this->include_ongoing_events = (isset($this->atts['show_ongoing_events']) and trim($this->atts['show_ongoing_events'])) ? '1' : '0'; + if($this->include_ongoing_events) $this->args['mec-include-ongoing-events'] = $this->include_ongoing_events; + + // Set start time + if(isset($this->atts['seconds'])) + { + $this->args['mec-seconds'] = $this->atts['seconds']; + $this->args['mec-seconds-date'] = isset($this->atts['seconds_date']) ? $this->atts['seconds_date'] : $this->start_date; + } + + // Apply Maximum Date + $apply_sf_date = isset($_REQUEST['apply_sf_date']) ? sanitize_text_field($_REQUEST['apply_sf_date']) : 0; + $month = (isset($this->sf) && isset($this->sf['month']) && trim($this->sf['month'])) ? $this->sf['month'] : (isset($_REQUEST['mec_month']) ? $_REQUEST['mec_month'] : ''); + if($apply_sf_date == 1 and trim($month)) $this->maximum_date = date('Y-m-t', strtotime($this->start_date)); + + // Found Events + $this->found = 0; + + do_action('mec-masonry-initialize-end', $this); + } + + /** + * Returns start day of skin for filtering events + * @author Webnus + * @return string + */ + public function get_start_date() + { + // Default date + $date = current_time('Y-m-d'); + + if(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'today') $date = current_time('Y-m-d'); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'tomorrow') $date = date('Y-m-d', strtotime('Tomorrow')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'yesterday') $date = date('Y-m-d', strtotime('Yesterday')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_last_month') $date = date('Y-m-d', strtotime('first day of last month')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_current_month') $date = date('Y-m-d', strtotime('first day of this month')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_next_month') $date = date('Y-m-d', strtotime('first day of next month')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'date') $date = date('Y-m-d', strtotime($this->skin_options['start_date'])); + + // Hide past events + if(isset($this->atts['show_past_events']) and !trim($this->atts['show_past_events'])) + { + $today = current_time('Y-m-d'); + if(strtotime($date) < strtotime($today)) $date = $today; + } + + // Show only expired events + if(isset($this->show_only_expired_events) and $this->show_only_expired_events) + { + $now = date('Y-m-d H:i:s', current_time('timestamp')); + if(strtotime($date) > strtotime($now)) $date = $now; + } + + // MEC Next Page + if(isset($_REQUEST['mec_next_page']) and trim($_REQUEST['mec_next_page'])) + { + $ex = explode(':', $_REQUEST['mec_next_page']); + + if(strtotime($ex[0])) $date = $ex[0]; + if(isset($ex[1])) $this->offset = $ex[1]; + } + + return $date; + } + + /** + * Load more events for AJAX request + * @author Webnus + * @return void + */ + public function load_more() + { + $this->sf = (isset($_REQUEST['sf']) and is_array($_REQUEST['sf'])) ? $this->main->sanitize_deep_array($_REQUEST['sf']) : []; + + $mec_filter_by = isset($_REQUEST['mec_filter_by']) ? sanitize_text_field($_REQUEST['mec_filter_by']) : ''; + $mec_filter_value = isset($_REQUEST['mec_filter_value']) ? sanitize_text_field($_REQUEST['mec_filter_value']) : ''; + if($mec_filter_by and ($mec_filter_value and $mec_filter_value != '*')) $this->sf[$mec_filter_by] = $mec_filter_value; + + $apply_sf_date = isset($_REQUEST['apply_sf_date']) ? sanitize_text_field($_REQUEST['apply_sf_date']) : 1; + $atts = $this->sf_apply(((isset($_REQUEST['atts']) and is_array($_REQUEST['atts'])) ? $this->main->sanitize_deep_array($_REQUEST['atts']) : array()), $this->sf, $apply_sf_date); + + // Initialize the skin + $this->initialize($atts); + + // Override variables + $this->start_date = isset($_REQUEST['mec_start_date']) ? sanitize_text_field($_REQUEST['mec_start_date']) : date('y-m-d'); + $this->end_date = $this->start_date; + $this->offset = isset($_REQUEST['mec_offset']) ? sanitize_text_field($_REQUEST['mec_offset']) : 0; + + // Apply Maximum Date + $month = (isset($this->sf) && isset($this->sf['month']) && trim($this->sf['month'])) ? $this->sf['month'] : (isset($_REQUEST['mec_month']) ? $_REQUEST['mec_month'] : ''); + if($apply_sf_date == 1 and trim($month)) $this->maximum_date = date('Y-m-t', strtotime($this->start_date)); + + // Return the events + $this->atts['return_items'] = true; + $this->loading_more = true; + + // Fetch the events + $this->fetch(); + + // Return the output + $output = $this->output(); + + echo json_encode($output); + exit; + } + + public function filter_by() + { + $output = '
    '.esc_html__('All', 'modern-events-calendar-lite').''; + + $taxonomy = $this->filter_by_get_taxonomy(); + $terms = get_terms($taxonomy, array + ( + 'hide_empty' => true, + 'include' => ((isset($this->atts[$this->filter_by]) and trim($this->atts[$this->filter_by])) ? $this->atts[$this->filter_by] : ''), + )); + + foreach($terms as $term) $output .= ''.esc_html($term->name).''; + + $output .= '
    '; + return $output; + } + + public function filter_by_get_taxonomy() + { + if($this->filter_by == 'label') $taxonomy = 'mec_label'; + elseif($this->filter_by == 'location') $taxonomy = 'mec_location'; + elseif($this->filter_by == 'organizer') $taxonomy = 'mec_organizer'; + else $taxonomy = 'mec_category'; + + return $taxonomy; + } + + public function filter_by_classes($event_id) + { + $output = ''; + + $taxonomy = $this->filter_by_get_taxonomy(); + $terms = wp_get_post_terms($event_id, $taxonomy, array + ( + 'hide_empty' => true, + )); + + foreach($terms as $term) $output .= ' mec-t'.$term->term_id; + return trim($output); + } +} diff --git a/app/skins/masonry/index.html b/app/skins/masonry/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/skins/masonry/render.php b/app/skins/masonry/render.php new file mode 100755 index 0000000..d304ea0 --- /dev/null +++ b/app/skins/masonry/render.php @@ -0,0 +1,162 @@ +main->get_styling(); +$event_colorskin = (isset($styling['mec_colorskin']) || isset($styling['color'])) ? 'colorskin-custom' : ''; +$settings = $this->main->get_settings(); +$this->localtime = isset($this->skin_options['include_local_time']) ? $this->skin_options['include_local_time'] : false; +$display_label = isset($this->skin_options['display_label']) ? $this->skin_options['display_label'] : false; +$reason_for_cancellation = isset($this->skin_options['reason_for_cancellation']) ? $this->skin_options['reason_for_cancellation'] : false; +?> +
    +
    + events as $date): + foreach($date as $event): + + $location_id = $this->main->get_master_location_id($event); + $location = ($location_id ? $this->main->get_location_data($location_id) : array()); + + $organizer_id = $this->main->get_master_organizer_id($event); + $organizer = ($organizer_id ? $this->main->get_organizer_data($organizer_id) : array()); + + $event_color = $this->get_event_color_dot($event); + $start_time = (isset($event->data->time) ? $event->data->time['start'] : ''); + $end_time = (isset($event->data->time) ? $event->data->time['end'] : ''); + $event_start_date = !empty($event->date['start']['date']) ? $event->date['start']['date'] : ''; + + $mec_data = $this->display_custom_data($event); + $custom_data_class = !empty($mec_data) ? 'mec-custom-data' : ''; + + // MEC Schema + do_action('mec_schema', $event); + + $masonry_filter = ''; + if($this->filter_by == 'category') + { + if(isset($event->data->categories) && !empty($event->data->categories)) + { + $masonry_filter = "["; + foreach($event->data->categories as $key => $value) $masonry_filter .= '"' . $value['id'] . '",'; + + $masonry_filter .= "]"; + $masonry_filter = str_replace(",]", "]", $masonry_filter); + } + } + elseif($this->filter_by == 'label') + { + if(isset($event->data->labels) && !empty($event->data->labels)) + { + $masonry_filter = "["; + foreach($event->data->labels as $key => $value) $masonry_filter .= '"' . $value['id'] . '",'; + + $masonry_filter .= "]"; + $masonry_filter = str_replace(",]", "]", $masonry_filter); + } + } + elseif($this->filter_by == 'organizer') + { + if(isset($event->data->organizers) && !empty($event->data->organizers)) + { + $masonry_filter = "["; + foreach($event->data->organizers as $key => $value) $masonry_filter .= '"' . $value['id'] . '",'; + + $masonry_filter .= "]"; + $masonry_filter = str_replace(",]", "]", $masonry_filter); + } + } + elseif($this->filter_by == 'location') + { + if(isset($event->data->locations) && !empty($event->data->locations)) + { + $masonry_filter = "["; + foreach($event->data->locations as $key => $value) $masonry_filter .= '"' . $value['id'] . '",'; + + $masonry_filter .= "]"; + $masonry_filter = str_replace(",]", "]", $masonry_filter); + } + } + + if(empty($masonry_filter)) $masonry_filter = "[\"\"]"; + ?> +
    +
    + +
    + data->featured_image) and $this->masonry_like_grid): ?> +
    display_link($event, get_the_post_thumbnail($event->data->ID , 'thumblist'), '')); ?>
    + data->featured_image) and isset($event->data->featured_image['full']) and trim($event->data->featured_image['full'])): ?> +
    display_link($event, get_the_post_thumbnail($event->data->ID , 'full'), '')); ?>
    + + + get_label_captions($event)); ?> + +
    +
    + +
    + +
    main->date_i18n($this->date_format_1, strtotime($event->date['start']['date']))); ?>
    +
    main->date_i18n($this->date_format_2, strtotime($event->date['start']['date']))); ?>
    + +
    main->dateify($event, $this->date_format_1)); ?>
    +
    main->dateify($event, $this->date_format_2)); ?>
    + +
    + localtime) echo MEC_kses::full($this->main->module('local-time.type2', array('event' => $event))); ?> +
    + + +
    +
    + icons->display('location-pin'); ?> +
    +
    +
    +
    +
    +
    + + +
    + + data->post); + + // Safe Excerpt for UTF-8 Strings + if(!trim($excerpt)) + { + $excerpt_count = apply_filters('MEC_masonry_excerpt', '9'); + $ex = explode(' ', strip_tags(strip_shortcodes($event->data->post->post_content))); + $words = array_slice($ex, 0, apply_filters('MEC_masonry_excerpt', '9')); + + $excerpt = implode(' ', $words); + } + ?> +
    + main->get_flags($event); ?> +

    display_link($event)); ?>display_custom_data($event)); ?> data->ID ); ?>

    + main->get_normal_labels($event, $display_label).$this->main->display_cancellation_reason($event, $reason_for_cancellation)); ?> + display_categories($event)); ?> + display_organizers($event)); ?> +
    +

    +
    +
    + +
    +
    + +
    +
    + + +
    +
    \ No newline at end of file diff --git a/app/skins/masonry/tpl.php b/app/skins/masonry/tpl.php new file mode 100755 index 0000000..9c7769d --- /dev/null +++ b/app/skins/masonry/tpl.php @@ -0,0 +1,94 @@ +get_render_path(); + +ob_start(); +include $render_path; +$items_html = ob_get_clean(); + +if(isset($this->atts['return_items']) and $this->atts['return_items']) +{ + echo json_encode(array('html' => $items_html, 'end_date' => $this->end_date, 'offset' => $this->next_offset, 'count' => $this->found, 'has_more_event' => (int) $this->has_more_events)); + exit; +} + +$sed_method = $this->sed_method; +if($sed_method == 'new') $sed_method = '0'; + +// Inclue Isotope Assets +$this->main->load_isotope_assets(); + +// Generating javascript code tpl +$javascript = ''; + +// Include javascript code into the page +if($this->main->is_ajax() or $this->main->preview()) echo MEC_kses::full($javascript); +else $this->factory->params('footer', $javascript); + +$styling = $this->main->get_styling(); +$event_colorskin = (isset($styling['mec_colorskin']) || isset($styling['color'])) ? ' colorskin-custom ' : ''; + +$dark_mode = $styling['dark_mode'] ?? ''; +if($dark_mode == 1) $set_dark = 'mec-dark-mode'; +else $set_dark = ''; + +do_action('mec_start_skin', $this->id); +do_action('mec_masonry_skin_head'); +?> +
    + filter_by)) echo MEC_kses::element($this->filter_by()); ?> + + found): ?> +
    + +
    +
    + main->display_not_found_message(); ?> +
    + +
    + main->display_not_found_message(); ?> +
    + + + get_pagination_bar(); ?> +
    +display_credit_url(); ?> + + */ +class MEC_skin_monthly_view extends MEC_skins +{ + /** + * @var string + */ + public $skin = 'monthly_view'; + public $activate_first_date = false; + public $activate_current_day = true; + public $display_all = false; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + parent::__construct(); + } + + /** + * Registers skin actions into WordPress + * @author Webnus + */ + public function actions() + { + $this->factory->action('wp_ajax_mec_monthly_view_load_month', array($this, 'load_month')); + $this->factory->action('wp_ajax_nopriv_mec_monthly_view_load_month', array($this, 'load_month')); + } + + /** + * Initialize the skin + * @author Webnus + * @param array $atts + */ + public function initialize($atts) + { + $this->atts = $atts; + + // Skin Options + $this->skin_options = (isset($this->atts['sk-options']) and isset($this->atts['sk-options'][$this->skin])) ? $this->atts['sk-options'][$this->skin] : []; + + // Icons + $this->icons = $this->main->icons( + isset($this->atts['icons']) && is_array($this->atts['icons']) ? $this->atts['icons'] : [] + ); + + // Search Form Options + $this->sf_options = (isset($this->atts['sf-options']) and isset($this->atts['sf-options'][$this->skin])) ? $this->atts['sf-options'][$this->skin] : []; + + // Search Form Status + $this->sf_status = $this->atts['sf_status'] ?? true; + $this->sf_display_label = $this->atts['sf_display_label'] ?? false; + $this->sf_reset_button = $this->atts['sf_reset_button'] ?? false; + $this->sf_refine = $this->atts['sf_refine'] ?? false; + + // The events + $this->events_str = ''; + + // Generate an ID for the skin + $this->id = $this->atts['id'] ?? mt_rand(100, 999); + + // Set the ID + if(!isset($this->atts['id'])) $this->atts['id'] = $this->id; + + // The style + $this->style = $this->skin_options['style'] ?? 'modern'; + if($this->style == 'fluent' and !is_plugin_active('mec-fluent-layouts/mec-fluent-layouts.php')) $this->style = 'modern'; + + // Next/Previous Month + $this->next_previous_button = $this->skin_options['next_previous_button'] ?? true; + + // Display All Events + $this->display_all = in_array($this->style, array('clean', 'modern')) && isset($this->skin_options['display_all']) && $this->skin_options['display_all']; + + // Override the style if the style forced by us in a widget etc + if(isset($this->atts['style']) and trim($this->atts['style']) != '') $this->style = $this->atts['style']; + + // Responsive Style + if(isset($this->skin_options['mobile_clean_style']) && $this->skin_options['mobile_clean_style'] && $this->main->is_mobile()) + { + $this->style = 'clean'; + } + + // HTML class + $this->html_class = ''; + if(isset($this->atts['html-class']) and trim($this->atts['html-class']) != '') $this->html_class = $this->atts['html-class']; + + // Booking Button + $this->booking_button = isset($this->skin_options['booking_button']) ? (int) $this->skin_options['booking_button'] : 0; + + // SED Method + $this->sed_method = $this->get_sed_method(); + + // reason_for_cancellation + $this->reason_for_cancellation = $this->skin_options['reason_for_cancellation'] ?? false; + + // display_label + $this->display_label = $this->skin_options['display_label'] ?? false; + + // Image popup + $this->image_popup = $this->skin_options['image_popup'] ?? '0'; + + // From Widget + $this->widget = isset($this->atts['widget']) && trim($this->atts['widget']); + + // From Full Calendar + $this->from_full_calendar = (isset($this->skin_options['from_fc']) and trim($this->skin_options['from_fc'])); + + // Display Price + $this->display_price = (isset($this->skin_options['display_price']) and trim($this->skin_options['display_price'])); + + // Detailed Time + $this->display_detailed_time = (isset($this->skin_options['detailed_time']) and trim($this->skin_options['detailed_time'])); + + // Init MEC + $this->args['mec-init'] = true; + $this->args['mec-skin'] = $this->skin; + + // Post Type + $this->args['post_type'] = $this->main->get_main_post_type(); + + // Post Status + $this->args['post_status'] = 'publish'; + + // Keyword Query + $this->args['s'] = $this->keyword_query(); + + // Taxonomy + $this->args['tax_query'] = $this->tax_query(); + + // Meta + $this->args['meta_query'] = $this->meta_query(); + + // Tag + if(apply_filters('mec_taxonomy_tag', '') === 'post_tag') $this->args['tag'] = $this->tag_query(); + + // Author + $this->args['author'] = $this->author_query(); + $this->args['author__not_in'] = $this->author_query_ex(); + + // Pagination Options + $this->paged = get_query_var('paged', 1); + $this->limit = (isset($this->skin_options['limit']) and trim($this->skin_options['limit'])) ? $this->skin_options['limit'] : 12; + + $this->args['posts_per_page'] = $this->limit; + $this->args['paged'] = $this->paged; + + // Sort Options + $this->args['orderby'] = 'mec_start_day_seconds ID'; + $this->args['order'] = 'ASC'; + $this->args['meta_key'] = 'mec_start_day_seconds'; + + // Show Only Expired Events + $this->show_only_expired_events = (isset($this->atts['show_only_past_events']) and trim($this->atts['show_only_past_events'])) ? '1' : '0'; + + // Show Past Events + if($this->show_only_expired_events) $this->atts['show_past_events'] = '1'; + + // Show Past Events + $this->args['mec-past-events'] = $this->atts['show_past_events'] ?? '0'; + + // Activate First Date With Event + $this->activate_first_date = (isset($this->skin_options['activate_first_date']) and $this->skin_options['activate_first_date']); + + // Start Date + list($this->year, $this->month, $this->day) = $this->get_start_date(); + + // Activate Current Day + $this->activate_current_day = (!isset($this->skin_options['activate_current_day']) || $this->skin_options['activate_current_day']); + + $this->start_date = date('Y-m-d', strtotime($this->year.'-'.$this->month.'-'.$this->day)); + $this->active_day = $this->year.'-'.$this->month.'-'.current_time('d'); + + if(!$this->activate_current_day and $this->month != current_time('m')) $this->active_day = $this->start_date; + + // We will extend the end date in the loop + $this->end_date = $this->start_date; + + // Show Ongoing Events + $this->show_ongoing_events = (isset($this->atts['show_only_ongoing_events']) and trim($this->atts['show_only_ongoing_events'])) ? '1' : '0'; + if($this->show_ongoing_events) $this->args['mec-show-ongoing-events'] = $this->show_ongoing_events; + + // Include Ongoing Events + $this->include_ongoing_events = (isset($this->atts['show_ongoing_events']) and trim($this->atts['show_ongoing_events'])) ? '1' : '0'; + if($this->include_ongoing_events) $this->args['mec-include-ongoing-events'] = $this->include_ongoing_events; + + // Auto Month Rotation + $this->auto_month_rotation = !isset($this->settings['auto_month_rotation']) || $this->settings['auto_month_rotation']; + } + + /** + * Search and returns the filtered events + * @author Webnus + * @return array of objects + */ + public function search() + { + if($this->show_only_expired_events) + { + $start = date('Y-m-d H:i:s', current_time('timestamp')); + $end = date('Y-m-d', strtotime('first day of this month')); + + $this->weeks = $this->main->split_to_weeks($end, $start); + + $this->week_of_days = []; + foreach($this->weeks as $week_number=>$week) foreach($week as $day) $this->week_of_days[$day] = $week_number; + + $end = $this->main->array_key_first($this->week_of_days); + } + else + { + $start = $this->start_date; + $end = date('Y-m-t', strtotime($this->start_date)); + + $this->weeks = $this->main->split_to_weeks($start, $end); + + $this->week_of_days = []; + foreach($this->weeks as $week_number=>$week) foreach($week as $day) $this->week_of_days[$day] = $week_number; + + $start = $this->main->array_key_first($this->week_of_days); + $end = $this->main->array_key_last($this->week_of_days); + } + + // Date Events + $dates = $this->period($start, $end, true); + + // Limit + $this->args['posts_per_page'] = $this->limit; + + $events = []; + $qs = []; + + foreach($dates as $date=>$IDs) + { + // No Event + if(!is_array($IDs) or !count($IDs)) + { + $events[$date] = []; + continue; + } + + // Include Available Events + $this->args['post__in'] = array_unique($IDs); + + // Count of events per day + $IDs_count = array_count_values($IDs); + + // The Query + $this->args = apply_filters('mec_skin_query_args', $this->args, $this); + + // Query Key + $q_key = base64_encode(json_encode($this->args)); + + // Get From Cache + if(isset($qs[$q_key])) $query = $qs[$q_key]; + // Search & Cache + else + { + $query = new WP_Query($this->args); + $qs[$q_key] = $query; + } + + if($query->have_posts()) + { + if(!isset($events[$date])) $events[$date] = []; + + if($this->activate_first_date and $this->active_day and strtotime($date) >= current_time('timestamp') and date('m', strtotime($date)) == $this->month) + { + $this->active_day = $date; + $this->activate_first_date = false; + } + + // Day Events + $d = []; + + // The Loop + while($query->have_posts()) + { + $query->the_post(); + $ID = get_the_ID(); + + $ID_count = $IDs_count[$ID] ?? 1; + for($i = 1; $i <= $ID_count; $i++) + { + $rendered = $this->render->data($ID); + + $data = new stdClass(); + $data->ID = $ID; + $data->data = $rendered; + + $data->date = array + ( + 'start' => array('date' => $date), + 'end' => array('date' => $this->main->get_end_date($date, $rendered)) + ); + + $d[] = $this->render->after_render($data, $this, $i); + } + } + + usort($d, [$this, 'sort_day_events']); + $events[$date] = $d; + } + + // Restore original Post Data + wp_reset_postdata(); + } + + // Initialize Occurrences' Data + MEC_feature_occurrences::fetch($events); + + return $events; + } + + /** + * Returns start day of skin for filtering events + * @author Webnus + * @return array + */ + public function get_start_date() + { + // Default date + $date = current_time('Y-m-d'); + + if(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_current_month') $date = date('Y-m-d', strtotime('first day of this month')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_next_month') $date = date('Y-m-d', strtotime('first day of next month')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'start_last_month') $date = date('Y-m-d', strtotime('first day of last month')); + elseif(isset($this->skin_options['start_date_type']) and $this->skin_options['start_date_type'] == 'date') $date = date('Y-m-d', strtotime($this->skin_options['start_date'])); + + // Hide past events + if(isset($this->atts['show_past_events']) and !trim($this->atts['show_past_events'])) + { + $today = current_time('Y-m-d'); + if(strtotime($date) < strtotime($today)) $date = $today; + } + + // Show only expired events + if(isset($this->show_only_expired_events) and $this->show_only_expired_events) + { + $yesterday = date('Y-m-d', strtotime('Yesterday')); + if(strtotime($date) > strtotime($yesterday)) $date = $yesterday; + } + + $time = strtotime($date); + return [date('Y', $time), date('m', $time), date('d', $time)]; + } + + /** + * Load month for AJAX request + * @author Webnus + * @return void + */ + public function load_month() + { + $this->sf = (isset($_REQUEST['sf']) and is_array($_REQUEST['sf'])) ? $this->main->sanitize_deep_array($_REQUEST['sf']) : []; + $apply_sf_date = isset($_REQUEST['apply_sf_date']) ? sanitize_text_field($_REQUEST['apply_sf_date']) : 1; + $atts = $this->sf_apply(((isset($_REQUEST['atts']) and is_array($_REQUEST['atts'])) ? $this->main->sanitize_deep_array($_REQUEST['atts']) : array()), $this->sf, $apply_sf_date); + + $navigator_click = isset($_REQUEST['navigator_click']) && sanitize_text_field($_REQUEST['navigator_click']); + + // Initialize the skin + $this->initialize($atts); + + // Search Events If Not Found In Current Month + $c = 0; + $break = false; + + do + { + if($c > 12) $break = true; + if($c and !$break) + { + if(intval($this->month) == 12) + { + $this->year = intval($this->year)+1; + $this->month = '01'; + } + + $this->month = sprintf("%02d", intval($this->month)+1); + } + else + { + // Start Date + $this->year = isset($_REQUEST['mec_year']) ? sanitize_text_field($_REQUEST['mec_year']) : current_time('Y'); + $this->month = isset($_REQUEST['mec_month']) ? sanitize_text_field($_REQUEST['mec_month']) : current_time('m'); + } + + if($this->show_only_expired_events) + { + $this->start_date = date('Y-m-d', strtotime($this->year.'-'.$this->month.'-01')); + $this->active_day = date('Y-m-t', strtotime($this->year.'-'.$this->month.'-01')); + } + else + { + $this->start_date = date('Y-m-d', strtotime($this->year.'-'.$this->month.'-01')); + + $day = current_time('d'); + $this->active_day = $this->year.'-'.$this->month.'-'.$day; + + if(!$this->activate_current_day && !$this->activate_first_date && $this->month != current_time('m')) $this->active_day = ''; + } + + // We will extend the end date in the loop + $this->end_date = $this->start_date; + + // Return the events + $this->atts['return_items'] = true; + + // Fetch the events + $this->fetch(); + + // Break the loop if not result + if($break) break; + if($navigator_click) break; + + // Auto Rotation is Disabled + if(!$this->auto_month_rotation) break; + + $c++; + } + while(!count($this->events)); + + // Return the output + $output = $this->output(); + + echo json_encode($output); + exit; + } + + public function day_label($time) + { + // No Label when all events are set to display + if($this->display_all) return ''; + + $date_suffix = (isset($this->settings['date_suffix']) && $this->settings['date_suffix'] == '0') ? $this->main->date_i18n('jS', $time) : $this->main->date_i18n('j', $time); + + if($this->main->is_day_first()) + { + return '
    '.sprintf(esc_html__('Events for %s %s', 'modern-events-calendar-lite'), ' '.esc_html($date_suffix).'', esc_html($this->main->date_i18n('F', $time))).'
    '; + } + else return '
    '.sprintf(esc_html__('Events for %s', 'modern-events-calendar-lite'), esc_html($this->main->date_i18n('F', $time))).'

    '.esc_html($date_suffix).'

    '; + } +} diff --git a/app/skins/monthly_view/calendar.php b/app/skins/monthly_view/calendar.php new file mode 100755 index 0000000..3e5746a --- /dev/null +++ b/app/skins/monthly_view/calendar.php @@ -0,0 +1,271 @@ +main->get_weekday_abbr_labels(); +echo '
    '.MEC_kses::element(implode('
    ', $headings)).'
    '; + +// Start day of week +$week_start = $this->main->get_first_day_of_week(); + +$this->localtime = $this->skin_options['include_local_time'] ?? false; +$display_label = $this->skin_options['display_label'] ?? false; +$reason_for_cancellation = $this->skin_options['reason_for_cancellation'] ?? false; + +// days and weeks vars +$running_day = date('w', mktime(0, 0, 0, $month, 1, $year)); +$days_in_month = date('t', mktime(0, 0, 0, $month, 1, $year)); +$days_in_previous_month = $this->main->get_days_in_previous_month($month, $year); + +$days_in_this_week = 1; +$day_counter = 0; + +if($week_start == 1) // Monday +{ + if($running_day != 0) $running_day = $running_day - 1; + else $running_day = 6; +} +elseif($week_start == 6) // Saturday +{ + if($running_day != 6) $running_day = $running_day + 1; + else $running_day = 0; +} +elseif($week_start == 5) // Friday +{ + if($running_day < 4) $running_day = $running_day + 2; + elseif($running_day == 5) $running_day = 0; + elseif($running_day == 6) $running_day = 1; +} + +$events_str = ''; +?> +
    + active_day) == $day_id) ? ' mec-selected-day' : ''; + + // Print events + if(isset($events[$today]) and count($events[$today])) + { + echo '
    '.MEC_kses::full(apply_filters('mec_filter_list_day_value', $list_day, $today, $this)).''; + do_action('monthly_box_hook', $events[$today]); + echo '
    '; + + $events_str .= '
    '.MEC_kses::element($this->day_label($time)); + + foreach($events[$today] as $event) + { + $location_id = $this->main->get_master_location_id($event); + $location = ($location_id ? $this->main->get_location_data($location_id) : array()); + + $start_time = (isset($event->data->time) ? $event->data->time['start'] : ''); + $end_time = (isset($event->data->time) ? $event->data->time['end'] : ''); + $startDate = !empty($event->data->meta['mec_date']['start']['date'] ) ? $event->data->meta['mec_date']['start']['date'] : ''; + $endDate = !empty($event->data->meta['mec_date']['end']['date'] ) ? $event->data->meta['mec_date']['end']['date'] : '' ; + $event_start_date = !empty($event->date['start']['date']) ? $event->date['start']['date'] : ''; + + // MEC Schema + do_action('mec_schema', $event); + + $events_str .= '
    '; + $content_style = !empty($event->data->thumbnails['thumblist']) ? 'width: calc(100% - 85px)' : 'width: 100%'; + $events_str .= '
    '.MEC_kses::element($event->data->thumbnails['thumbnail']).'
    '; + $events_str .= MEC_kses::element($this->get_label_captions($event)); + + if($this->display_detailed_time and $this->main->is_multipleday_occurrence($event)) $events_str .= '
    '.$this->icons->display('clock-o').' '.MEC_kses::element($this->display_detailed_time($event)).'
    '; + elseif(trim($start_time)) $events_str .= '
    '.$this->icons->display('clock-o').' '.esc_html($start_time.(trim($end_time) ? ' - '.$end_time : '')).'
    '; + + $event_color = $this->get_event_color_dot($event); + $events_str .= '

    '.MEC_kses::element($this->display_link($event).$this->main->get_flags($event).MEC_kses::embed($this->display_custom_data($event)).$event_color.$this->main->get_normal_labels($event, $display_label).$this->main->display_cancellation_reason($event, $reason_for_cancellation)); + if(has_filter('mec_monthly_virtual_badge')) $events_str .= MEC_kses::full(apply_filters('mec_monthly_virtual_badge', '', $event->data->ID)); + $events_str .='

    '; + + if($this->localtime) $events_str .= MEC_kses::full($this->main->module('local-time.type3', array('event' => $event))); + $events_str .= '
    +
    '.(isset($location['name']) ? esc_html($location['name']) : '').'
    + '.MEC_kses::element($this->display_organizers($event)).' +
    '; + $events_str .= MEC_kses::element($this->booking_button($event)); + $events_str .= '
    '; + } + + $events_str .= '
    '; + } + else + { + echo '
    '.apply_filters( 'mec_filter_list_day_value', $list_day, $today, $this ).'
    '; + } + + $days_in_this_week++; + } + + // keep going with days .... + for($list_day = 1; $list_day <= $days_in_month; $list_day++) + { + $time = strtotime($year.'-'.$month.'-'.$list_day); + + $today = date('Y-m-d', $time); + $day_id = date('Ymd', $time); + $selected_day = (str_replace('-', '', $this->active_day) == $day_id) ? ' mec-selected-day' : ''; + + // Print events + if(isset($events[$today]) and count($events[$today])) + { + echo '
    '.MEC_kses::full(apply_filters('mec_filter_list_day_value', $list_day, $today, $this)).''; + do_action('monthly_box_hook', $events[$today]); + echo '
    '; + + $events_str .= '
    '.MEC_kses::element($this->day_label($time)); + + foreach($events[$today] as $event) + { + $location_id = $this->main->get_master_location_id($event); + $location = ($location_id ? $this->main->get_location_data($location_id) : array()); + + $start_time = (isset($event->data->time) ? $event->data->time['start'] : ''); + $end_time = (isset($event->data->time) ? $event->data->time['end'] : ''); + $startDate = !empty($event->data->meta['mec_date']['start']['date'] ) ? $event->data->meta['mec_date']['start']['date'] : ''; + $endDate = !empty($event->data->meta['mec_date']['end']['date'] ) ? $event->data->meta['mec_date']['end']['date'] : '' ; + $event_start_date = !empty($event->date['start']['date']) ? $event->date['start']['date'] : ''; + + // MEC Schema + do_action('mec_schema', $event); + + $events_str .= '
    '; + $content_style = !empty($event->data->thumbnails['thumblist']) ? 'width: calc(100% - 85px)' : 'width: 100%'; + $events_str .= '
    '.MEC_kses::element($event->data->thumbnails['thumbnail']).'
    '; + $events_str .= MEC_kses::element($this->get_label_captions($event)); + + if($this->display_detailed_time and $this->main->is_multipleday_occurrence($event)) $events_str .= '
    '.$this->icons->display('clock-o').' '.MEC_kses::element($this->display_detailed_time($event)).'
    '; + elseif(trim($start_time)) $events_str .= '
    '.$this->icons->display('clock-o').' '.esc_html($start_time.(trim($end_time) ? ' - '.$end_time : '')).'
    '; + + $event_color = $this->get_event_color_dot($event); + $events_str .= '

    '.MEC_kses::element($this->display_link($event).$this->main->get_flags($event).MEC_kses::embed($this->display_custom_data($event)).$event_color.$this->main->get_normal_labels($event, $display_label).$this->main->display_cancellation_reason($event, $reason_for_cancellation)); + if(has_filter('mec_monthly_virtual_badge')) $events_str .= MEC_kses::full(apply_filters('mec_monthly_virtual_badge', '', $event->data->ID)); + $events_str .='

    '; + + if($this->localtime) $events_str .= MEC_kses::full($this->main->module('local-time.type3', array('event' => $event))); + $events_str .= '
    +
    '.(isset($location['name']) ? esc_html($location['name']) : '').'
    + '.MEC_kses::element($this->display_organizers($event)).' +
    '; + $events_str .= MEC_kses::full($this->booking_button($event)); + $events_str .= '
    '; + } + + $events_str .= '
    '; + } + else + { + echo '
    '.MEC_kses::full(apply_filters('mec_filter_list_day_value', $list_day, $today, $this)).'
    '; + + $events_str .= '
    '.MEC_kses::element($this->day_label($time)); + $events_str .= '
    '; + $events_str .= '
    '.esc_html__('No Events', 'modern-events-calendar-lite').'
    '; + $events_str .= '
    '; + $events_str .= '
    '; + } + + if($running_day == 6) + { + echo '
    '; + + echo '
    '; + echo MEC_kses::full($events_str); + echo '
    '; + + if((($day_counter+1) != $days_in_month) or (($day_counter+1) == $days_in_month and $days_in_this_week == 7)) + { + echo '
    '; + $events_str = ''; + } + + $running_day = -1; + $days_in_this_week = 0; + } + + $days_in_this_week++; $running_day++; $day_counter++; + } + + // finish the rest of the days in the week + if($days_in_this_week > 1 && $days_in_this_week < 8) + { + for($x = 1; $x <= (8 - $days_in_this_week); $x++) + { + $list_day = $x; + $time = strtotime(($month == 12 ? ($year + 1) : $year).'-'.($month == 12 ? 1 : ($month + 1)).'-'.$list_day); + + $today = date('Y-m-d', $time); + $day_id = date('Ymd', $time); + $selected_day = (str_replace('-', '', $this->active_day) == $day_id) ? ' mec-selected-day' : ''; + + // Print events + if(isset($events[$today]) and count($events[$today])) + { + echo '
    '.MEC_kses::full(apply_filters('mec_filter_list_day_value', $list_day, $today, $this)).''; + do_action('monthly_box_hook', $events[$today]); + echo '
    '; + + $events_str .= '
    '.MEC_kses::element($this->day_label($time)); + + foreach($events[$today] as $event) + { + $location_id = $this->main->get_master_location_id($event); + $location = ($location_id ? $this->main->get_location_data($location_id) : array()); + + $start_time = (isset($event->data->time) ? $event->data->time['start'] : ''); + $end_time = (isset($event->data->time) ? $event->data->time['end'] : ''); + $startDate = !empty($event->data->meta['mec_date']['start']['date'] ) ? $event->data->meta['mec_date']['start']['date'] : ''; + $endDate = !empty($event->data->meta['mec_date']['end']['date'] ) ? $event->data->meta['mec_date']['end']['date'] : '' ; + $event_start_date = !empty($event->date['start']['date']) ? $event->date['start']['date'] : ''; + + // MEC Schema + do_action('mec_schema', $event); + + $events_str .= '
    '; + $content_style = !empty($event->data->thumbnails['thumblist']) ? 'width: calc(100% - 85px)' : 'width: 100%'; + $events_str .= '
    '.MEC_kses::element($event->data->thumbnails['thumbnail']).'
    '; + $events_str .= MEC_kses::element($this->get_label_captions($event)); + + if($this->display_detailed_time and $this->main->is_multipleday_occurrence($event)) $events_str .= '
    '.$this->icons->display('clock-o').' '.MEC_kses::element($this->display_detailed_time($event)).'
    '; + elseif(trim($start_time)) $events_str .= '
    '.$this->icons->display('clock-o').' '.esc_html($start_time.(trim($end_time) ? ' - '.$end_time : '')).'
    '; + + $event_color = $this->get_event_color_dot($event); + $events_str .= '

    '.MEC_kses::element($this->display_link($event).$this->main->get_flags($event).MEC_kses::embed($this->display_custom_data($event)).$event_color.$this->main->get_normal_labels($event, $display_label).$this->main->display_cancellation_reason($event, $reason_for_cancellation)); + if(has_filter('mec_monthly_virtual_badge')) $events_str .= MEC_kses::full(apply_filters('mec_monthly_virtual_badge', '', $event->data->ID)); + $events_str .='

    '; + + if($this->localtime) $events_str .= MEC_kses::full($this->main->module('local-time.type3', array('event' => $event))); + $events_str .= '
    +
    '.(isset($location['name']) ? esc_html($location['name']) : '').'
    + '.MEC_kses::element($this->display_organizers($event)).' +
    '; + $events_str .= MEC_kses::full($this->booking_button($event)); + $events_str .= '
    '; + } + + $events_str .= '
    '; + } + else + { + echo '
    '.esc_html($x).'
    '; + } + } + } + ?> +
    +
    + +
    diff --git a/app/skins/monthly_view/calendar_admin.php b/app/skins/monthly_view/calendar_admin.php new file mode 100755 index 0000000..d81e2e9 --- /dev/null +++ b/app/skins/monthly_view/calendar_admin.php @@ -0,0 +1,148 @@ +main->get_weekday_abbr_labels(); +echo '
    '.MEC_kses::full(implode('
    ', $headings)).'
    '; + +// Start day of week +$week_start = $this->main->get_first_day_of_week(); + +// Single Event Display Method +$target_set = false; +$target_url = 'target="_blank"'; + +$display_label = false; +$reason_for_cancellation = false; + +// days and weeks vars +$running_day = date('w', mktime(0, 0, 0, $month, 1, $year)); +$days_in_month = date('t', mktime(0, 0, 0, $month, 1, $year)); +$days_in_previous_month = $this->main->get_days_in_previous_month($month, $year); + +$days_in_this_week = 1; +$day_counter = 0; + +if($week_start == 1) // Monday +{ + if($running_day != 0) $running_day = $running_day - 1; + else $running_day = 6; +} +elseif($week_start == 6) // Saturday +{ + if($running_day != 6) $running_day = $running_day + 1; + else $running_day = 0; +} +elseif($week_start == 5) // Friday +{ + if($running_day < 4) $running_day = $running_day + 2; + elseif($running_day == 5) $running_day = 0; + elseif($running_day == 6) $running_day = 1; +} +?> +
    + '.($days_in_previous_month - ($running_day-1-$x)).''; + $days_in_this_week++; + } + + // keep going with days .... + for($list_day = 1; $list_day <= $days_in_month; $list_day++) + { + $time = strtotime($year.'-'.$month.'-'.$list_day); + + $today = date('Y-m-d', $time); + $day_id = date('Ymd', $time); + $selected_day = (str_replace('-', '', $this->active_day) == $day_id) ? ' mec-selected-day' : ''; + $selected_day_date = (str_replace('-', '', $this->active_day) == $day_id) ? 'mec-color' : ''; + + // Print events + if(isset($events[$today]) and count($events[$today])) + { + echo '
    '.apply_filters('mec_filter_list_day_value', $list_day, $today, $this).'
    '; + foreach($events[$today] as $event) + { + $start_time = (isset($event->data->time) ? $event->data->time['start'] : ''); + $occurrence = strtotime($today.' '.$start_time); + $event_unique = (isset($event->data->time) ? $event->data->ID.$event->data->time['start_timestamp'] : $event->data->ID); + + $attendees = $this->main->get_event_attendees($event->ID, $occurrence); + $attendees_count = count($attendees); + + echo ''; + + $this->getFactory()->params('footer', function() use($event, $occurrence) + { + ?> + + '; + } + else + { + echo '
    '.apply_filters('mec_filter_list_day_value', $list_day, $today, $this).'
    '; + echo ''; + } + + if($running_day == 6) + { + echo '
    '; + + if((($day_counter+1) != $days_in_month) or (($day_counter+1) == $days_in_month and $days_in_this_week == 7)) + { + echo '
    '; + } + + $running_day = -1; + $days_in_this_week = 0; + } + + $days_in_this_week++; $running_day++; $day_counter++; + } + + // finish the rest of the days in the week + if($days_in_this_week > 1 && $days_in_this_week < 8) + { + for($x = 1; $x <= (8 - $days_in_this_week); $x++) + { + echo '
    '.esc_html($x).'
    '; + } + } + ?> +
    diff --git a/app/skins/monthly_view/calendar_clean.php b/app/skins/monthly_view/calendar_clean.php new file mode 100755 index 0000000..0c04dd0 --- /dev/null +++ b/app/skins/monthly_view/calendar_clean.php @@ -0,0 +1,359 @@ +main->get_weekday_abbr_labels(); +echo '
    '.MEC_kses::element(implode('
    ', $headings)).'
    '; + +// Start day of week +$week_start = $this->main->get_first_day_of_week(); + +$this->localtime = $this->skin_options['include_local_time'] ?? false; +$display_label = $this->skin_options['display_label'] ?? false; +$reason_for_cancellation = $this->skin_options['reason_for_cancellation'] ?? false; + +// days and weeks vars +$running_day = date('w', mktime(0, 0, 0, $month, 1, $year)); +$days_in_month = date('t', mktime(0, 0, 0, $month, 1, $year)); +$days_in_previous_month = $this->main->get_days_in_previous_month($month, $year); + +$days_in_this_week = 1; +$day_counter = 0; +$styles_str = ''; + +if($week_start == 1) // Monday +{ + if($running_day != 0) $running_day = $running_day - 1; + else $running_day = 6; +} +elseif($week_start == 6) // Saturday +{ + if($running_day != 6) $running_day = $running_day + 1; + else $running_day = 0; +} +elseif($week_start == 5) // Friday +{ + if($running_day < 4) $running_day = $running_day + 2; + elseif($running_day == 5) $running_day = 0; + elseif($running_day == 6) $running_day = 1; +} + +$events_str = ''; +if($this->display_all) $events_str .= '

    '.esc_html__('Events', 'modern-events-calendar-lite').'

    '; + +$date_format = get_option('date_format'); +?> +
    + active_day) == $day_id) ? ' mec-selected-day' : ''; + + // Print events + if(isset($events[$today]) && count($events[$today])) + { + echo '
    '.MEC_kses::full(apply_filters('mec_filter_list_day_value', $list_day, $today, $this)).'
    '; + $events_str .= '
    display_all) ? ' style="display: block;"' : '').'>'.MEC_kses::element($this->day_label($time)); + + foreach($events[$today] as $event) + { + $location_id = $this->main->get_master_location_id($event); + $location = ($location_id ? $this->main->get_location_data($location_id) : array()); + + $start_time = (isset($event->data->time) ? $event->data->time['start'] : ''); + $end_time = (isset($event->data->time) ? $event->data->time['end'] : ''); + $startDate = !empty($event->data->meta['mec_date']['start']['date']) ? $event->data->meta['mec_date']['start']['date'] : ''; + $endDate = !empty($event->data->meta['mec_date']['end']['date']) ? $event->data->meta['mec_date']['end']['date'] : '' ; + $event_start_date = !empty($event->date['start']['date']) ? $event->date['start']['date'] : ''; + + $events_filter = $after_time_filter = ''; + + $start_datetime = isset($event->date['start']) && !empty($event->date['start']) ? $event->date['start'] : []; + $end_datetime = isset($event->date['end']) && !empty($event->date['end']) ? $event->date['end'] : []; + $start_timestamp = $start_datetime['timestamp'] ?? (isset($start_datetime['date']) ? strtotime($start_datetime['date']) : ''); + + $multiple_day_show_method = \MEC\Settings\Settings::getInstance()->get_settings('multiple_day_show_method'); + + if('first_day_listgrid' === $multiple_day_show_method) $date_label = $this->main->date_label( $start_datetime, $end_datetime, $date_format ); + else $date_label = $this->main->date_i18n( $date_format, $start_timestamp ); + + $midnight_event = $this->main->is_midnight_event($event); + + if($midnight_event) $event_date = $this->main->dateify( $event, $date_format ); + else $event_date = $date_label; + + // MEC Schema + do_action('mec_schema', $event); + + $events_str .= '
    '; + $content_style = !empty($event->data->thumbnails['thumblist']) ? 'width: calc(100% - 85px)' : 'width: 100%'; + $events_str .= '
    '.MEC_kses::element($event->data->thumbnails['thumblist']).'
    '; + $events_str .= $this->get_label_captions($event); + + if($this->display_all) $events_str .= '
    '.MEC_kses::element( $event_date ).'
    '; + + if($this->display_detailed_time && $this->main->is_multipleday_occurrence($event)) $events_str .= '
    '.$this->icons->display('clock-o').' '.MEC_kses::element($this->display_detailed_time($event)).'
    '; + elseif(trim($start_time)) $events_str .= '
    '.$this->icons->display('clock-o').' '.MEC_kses::element($start_time.(trim($end_time) ? ' - '.$end_time : '')).'
    '; + + if(has_filter('monthly_event_after_time')) $after_time_filter = apply_filters('monthly_event_after_time', $events_str, $event); + + $events_str .= $after_time_filter; + $event_color = $this->get_event_color_dot($event); + $events_str .= '

    '.MEC_kses::element($this->display_link($event).$this->main->get_flags($event).$event_color.$this->main->get_normal_labels($event, $display_label).$this->main->display_cancellation_reason($event, $reason_for_cancellation)); + if(has_filter('mec_monthly_virtual_badge')) $events_str .= apply_filters('mec_monthly_virtual_badge', '', $event->data->ID); + $events_str .= '

    '; + + $events_str .= apply_filters('mec_calendar_clean_after_title', '', $event->ID, $event); + + if($this->localtime) $events_str .= MEC_kses::full($this->main->module('local-time.type3', array('event' => $event))); + $events_str .= '
    +
    '.(isset($location['name']) ? esc_html($location['name']) : '').'
    + '.MEC_kses::element($this->display_organizers($event)).' +
    '; + $events_str .= MEC_kses::element($this->booking_button($event)); + $events_str .= MEC_kses::embed($this->display_custom_data($event)); + $events_str .= MEC_kses::element($this->display_cost($event)); + + if(has_filter('monthly_event_right_box')) $events_filter = apply_filters('monthly_event_right_box', $events_str, $event); + + $events_str .= MEC_kses::full($events_filter); + $events_str .= '
    '; + } + + $events_str .= '
    '; + } + else + { + echo '
    '.apply_filters('mec_filter_list_day_value', $list_day, $today, $this).'
    '; + } + + $days_in_this_week++; + } + + // keep going with days .... + for($list_day = 1; $list_day <= $days_in_month; $list_day++) + { + $time = strtotime($year.'-'.$month.'-'.$list_day); + + $today = date('Y-m-d', $time); + $day_id = date('Ymd', $time); + $selected_day = (str_replace('-', '', $this->active_day) == $day_id) ? ' mec-selected-day' : ''; + + // Print events + if(isset($events[$today]) && count($events[$today])) + { + echo '
    '.MEC_kses::full(apply_filters('mec_filter_list_day_value', $list_day, $today, $this)).'
    '; + $events_str .= '
    display_all) ? ' style="display: block;"' : '').'>'.MEC_kses::element($this->day_label($time)); + + foreach($events[$today] as $event) + { + $location_id = $this->main->get_master_location_id($event); + $location = ($location_id ? $this->main->get_location_data($location_id) : array()); + + $start_time = (isset($event->data->time) ? $event->data->time['start'] : ''); + $end_time = (isset($event->data->time) ? $event->data->time['end'] : ''); + $startDate = !empty($event->data->meta['mec_date']['start']['date'] ) ? $event->data->meta['mec_date']['start']['date'] : ''; + $endDate = !empty($event->data->meta['mec_date']['end']['date'] ) ? $event->data->meta['mec_date']['end']['date'] : '' ; + $event_start_date = !empty($event->date['start']['date']) ? $event->date['start']['date'] : ''; + + $events_filter = $after_time_filter = ''; + + $start_datetime = isset($event->date['start']) && !empty($event->date['start']) ? $event->date['start'] : []; + $end_datetime = isset($event->date['end']) && !empty($event->date['end']) ? $event->date['end'] : []; + $start_timestamp = $start_datetime['timestamp'] ?? (isset($start_datetime['date']) ? strtotime($start_datetime['date']) : ''); + + $multiple_day_show_method = \MEC\Settings\Settings::getInstance()->get_settings('multiple_day_show_method'); + + if('first_day_listgrid' === $multiple_day_show_method) $date_label = $this->main->date_label( $start_datetime, $end_datetime, $date_format ); + else $date_label = $this->main->date_i18n( $date_format, $start_timestamp ); + + $midnight_event = $this->main->is_midnight_event($event); + + if($midnight_event) $event_date = $this->main->dateify( $event, $date_format ); + else $event_date = $date_label; + + // MEC Schema + do_action('mec_schema', $event); + + $events_str .= '
    '; + $content_style = !empty($event->data->thumbnails['thumblist']) ? 'width: calc(100% - 85px)' : 'width: 100%'; + $events_str .= '
    '.MEC_kses::element($event->data->thumbnails['thumblist']).'
    '; + $events_str .= MEC_kses::element($this->get_label_captions($event)); + + if($this->display_all) $events_str .= '
    '.MEC_kses::element( $event_date ).'
    '; + + if($this->display_detailed_time && $this->main->is_multipleday_occurrence($event)) $events_str .= '
    '.$this->icons->display('clock-o').' '.MEC_kses::element($this->display_detailed_time($event)).'
    '; + elseif(trim($start_time)) $events_str .= '
    '.$this->icons->display('clock-o').' '.esc_html($start_time.(trim($end_time) ? ' - '.$end_time : '')).'
    '; + + if(has_filter('monthly_event_after_time')) $after_time_filter = apply_filters('monthly_event_after_time', $events_str, $event); + + $events_str .= $after_time_filter; + $event_color = $this->get_event_color_dot($event); + $events_str .= '

    '.MEC_kses::element($this->display_link($event).$this->main->get_flags($event).MEC_kses::embed($this->display_custom_data($event)).$event_color.$this->main->get_normal_labels($event, $display_label).$this->main->display_cancellation_reason($event, $reason_for_cancellation)); + if(has_filter('mec_monthly_virtual_badge')) $events_str .= apply_filters('mec_monthly_virtual_badge', '', $event->data->ID); + $events_str .='

    '; + + $events_str .= apply_filters('mec_calendar_clean_after_title', '', $event->ID, $event); + + if($this->localtime) $events_str .= MEC_kses::full($this->main->module('local-time.type3', array('event' => $event))); + $events_str .= '
    +
    '.esc_html((isset($location['name']) ? $location['name'] : '')).'
    + '.MEC_kses::element($this->display_organizers($event)).' +
    '; + $events_str .= MEC_kses::element($this->booking_button($event)); + $events_str .= MEC_kses::element($this->display_cost($event)); + + if(has_filter('monthly_event_right_box')) $events_filter = apply_filters('monthly_event_right_box', $events_str, $event); + + $events_str .= MEC_kses::full($events_filter); + $events_str .= '
    '; + } + + $events_str .= '
    '; + } + else + { + echo '
    '.MEC_kses::full(apply_filters('mec_filter_list_day_value', $list_day, $today, $this)).'
    '; + + if(!$this->display_all) + { + $events_str .= '
    display_all) ? ' style="display: block;"' : '').'>'.MEC_kses::element($this->day_label($time)); + $events_str .= '
    '; + $events_str .= '
    '.esc_html__('No Events', 'modern-events-calendar-lite').'
    '; + $events_str .= '
    '; + $events_str .= '
    '; + } + } + + echo ''; + + if($running_day == 6) + { + echo '
    '; + + if((($day_counter+1) != $days_in_month) or (($day_counter+1) == $days_in_month && $days_in_this_week == 7)) + { + echo '
    '; + } + + $running_day = -1; + $days_in_this_week = 0; + } + + $days_in_this_week++; $running_day++; $day_counter++; + } + + // finish the rest of the days in the week + if($days_in_this_week > 1 && $days_in_this_week < 8) + { + for($x = 1; $x <= (8 - $days_in_this_week); $x++) + { + $list_day = $x; + $time = strtotime(($month == 12 ? ($year + 1) : $year).'-'.($month == 12 ? 1 : ($month + 1)).'-'.$list_day); + + $today = date('Y-m-d', $time); + $day_id = date('Ymd', $time); + $selected_day = (str_replace('-', '', $this->active_day) == $day_id) ? ' mec-selected-day' : ''; + + // Print events + if(isset($events[$today]) && count($events[$today])) + { + echo '
    '.MEC_kses::full(apply_filters('mec_filter_list_day_value', $list_day, $today, $this)).'
    '; + $events_str .= '
    display_all) ? ' style="display: block;"' : '').'>'.MEC_kses::element($this->day_label($time)); + + foreach($events[$today] as $event) + { + $location_id = $this->main->get_master_location_id($event); + $location = ($location_id ? $this->main->get_location_data($location_id) : array()); + + $start_time = (isset($event->data->time) ? $event->data->time['start'] : ''); + $end_time = (isset($event->data->time) ? $event->data->time['end'] : ''); + $startDate = !empty($event->data->meta['mec_date']['start']['date'] ) ? $event->data->meta['mec_date']['start']['date'] : ''; + $endDate = !empty($event->data->meta['mec_date']['end']['date'] ) ? $event->data->meta['mec_date']['end']['date'] : '' ; + $event_start_date = !empty($event->date['start']['date']) ? $event->date['start']['date'] : ''; + + $events_filter = $after_time_filter = ''; + + $start_datetime = isset($event->date['start']) && !empty($event->date['start']) ? $event->date['start'] : []; + $end_datetime = isset($event->date['end']) && !empty($event->date['end']) ? $event->date['end'] : []; + $start_timestamp = $start_datetime['timestamp'] ?? (isset($start_datetime['date']) ? strtotime($start_datetime['date']) : ''); + + $multiple_day_show_method = \MEC\Settings\Settings::getInstance()->get_settings('multiple_day_show_method'); + + if('first_day_listgrid' === $multiple_day_show_method) $date_label = $this->main->date_label($start_datetime, $end_datetime, $date_format); + else $date_label = $this->main->date_i18n($date_format, $start_timestamp); + + $midnight_event = $this->main->is_midnight_event($event); + + if($midnight_event) $event_date = $this->main->dateify($event, $date_format); + else $event_date = $date_label; + + // MEC Schema + do_action('mec_schema', $event); + + $events_str .= '
    '; + $content_style = !empty($event->data->thumbnails['thumblist']) ? 'width: calc(100% - 85px)' : 'width: 100%'; + $events_str .= '
    '.MEC_kses::element($event->data->thumbnails['thumblist']).'
    '; + $events_str .= MEC_kses::element($this->get_label_captions($event)); + + if($this->display_all) $events_str .= '
    '.MEC_kses::element( $event_date ).'
    '; + + if($this->display_detailed_time && $this->main->is_multipleday_occurrence($event)) $events_str .= '
    '.$this->icons->display('clock-o').' '.MEC_kses::element($this->display_detailed_time($event)).'
    '; + elseif(trim($start_time)) $events_str .= '
    '.$this->icons->display('clock-o').' '.esc_html($start_time.(trim($end_time) ? ' - '.$end_time : '')).'
    '; + + if(has_filter('monthly_event_after_time')) $after_time_filter = apply_filters('monthly_event_after_time', $events_str, $event); + + $events_str .= $after_time_filter; + $event_color = $this->get_event_color_dot($event); + + $events_str .= '

    '.MEC_kses::element($this->display_link($event).$this->main->get_flags($event).$event_color.$this->main->get_normal_labels($event, $display_label).$this->main->display_cancellation_reason($event, $reason_for_cancellation)); + if(has_filter('mec_monthly_virtual_badge')) $events_str .= apply_filters('mec_monthly_virtual_badge', '', $event->data->ID); + $events_str .='

    '; + + $events_str .= apply_filters('mec_calendar_clean_after_title', '', $event->ID, $event); + + if($this->localtime) $events_str .= MEC_kses::full($this->main->module('local-time.type3', array('event' => $event))); + $events_str .= '
    +
    '.esc_html(($location['name'] ?? '')).'
    + '.MEC_kses::element($this->display_organizers($event)).' +
    '; + $events_str .= MEC_kses::element($this->booking_button($event)); + $events_str .= MEC_kses::embed($this->display_custom_data($event)); + $events_str .= MEC_kses::element($this->display_cost($event)); + + if(has_filter('monthly_event_right_box')) $events_filter = apply_filters('monthly_event_right_box', $events_str, $event); + + $events_str .= MEC_kses::full($events_filter); + $events_str .= '
    '; + } + + $events_str .= '
    '; + } + else + { + echo '
    '.esc_html($x).'
    '; + } + } + } + + if(trim($styles_str)) $this->factory->params('footer', ''); + ?> +
    +style == 'classic'): ?> +
    + +
    +events_str = $events_str; +endif; diff --git a/app/skins/monthly_view/calendar_novel.php b/app/skins/monthly_view/calendar_novel.php new file mode 100755 index 0000000..ee53fc4 --- /dev/null +++ b/app/skins/monthly_view/calendar_novel.php @@ -0,0 +1,214 @@ +main->get_weekday_abbr_labels(); +echo '
    '.MEC_kses::element(implode('
    ', $headings)).'
    '; + +// Start day of week +$week_start = $this->main->get_first_day_of_week(); + +$display_label = $this->skin_options['display_label'] ?? false; +$reason_for_cancellation = $this->skin_options['reason_for_cancellation'] ?? false; + +// Single Event Display Method +$target_set = $this->skin_options['sed_method'] ?? false; +$target_url = $target_set === 'new' ? 'target="_blank"' : ''; + +// days and weeks vars +$running_day = date('w', mktime(0, 0, 0, $month, 1, $year)); +$days_in_month = date('t', mktime(0, 0, 0, $month, 1, $year)); +$days_in_previous_month = $this->main->get_days_in_previous_month($month, $year); + +$days_in_this_week = 1; +$day_counter = 0; + +if($week_start == 1) // Monday +{ + if($running_day != 0) $running_day = $running_day - 1; + else $running_day = 6; +} +elseif($week_start == 6) // Saturday +{ + if($running_day != 6) $running_day = $running_day + 1; + else $running_day = 0; +} +elseif($week_start == 5) // Friday +{ + if($running_day < 4) $running_day = $running_day + 2; + elseif($running_day == 5) $running_day = 0; + elseif($running_day == 6) $running_day = 1; +} +?> +
    + active_day) == $day_id) ? ' mec-selected-day' : ''; + $selected_day_date = (str_replace('-', '', $this->active_day) == $day_id) ? ' mec-bg-color' : ''; + + // Print events + if(isset($events[$today]) && count($events[$today])) + { + echo '
    '.MEC_kses::full(apply_filters( 'mec_filter_list_day_value', $list_day, $today, $this)).'
    '; + foreach($events[$today] as $event) + { + $event_color = $this->get_event_color_dot($event, true); + $start_date = (isset($event->date['start']['date']) ? str_replace ( '-', '', $event->date['start']['date'] ) : ''); + $end_date = (isset($event->date['end']['date']) ? str_replace ( '-', '', $event->date['end']['date'] ) : ''); + + // MEC Schema + do_action('mec_schema', $event); + + if($target_set !== 'no') echo ''; + + echo '
    '; + echo '

    '.MEC_kses::element(apply_filters('mec_occurrence_event_title', $event->data->title, $event)).'

    '.$this->main->get_normal_labels($event, $display_label).$this->main->display_cancellation_reason($event, $reason_for_cancellation); + echo MEC_kses::element($this->get_label_captions($event)); + + do_action('mec_shortcode_virtual_badge', $event->data->ID); + + echo MEC_kses::element($this->display_cost($event)); + echo MEC_kses::element($this->display_organizers($event)); + echo MEC_kses::embed($this->display_custom_data($event)); + + echo '
    '; + if($target_set !== 'no') echo '
    '; + } + + echo '
    '; + } + else + { + echo '
    '.($days_in_previous_month - ($running_day-1-$x)).'
    '; + } + + $days_in_this_week++; + } + + // keep going with days .... + for($list_day = 1; $list_day <= $days_in_month; $list_day++) + { + $time = strtotime($year.'-'.$month.'-'.$list_day); + + $today = date('Y-m-d', $time); + $day_id = date('Ymd', $time); + $selected_day = (str_replace('-', '', $this->active_day) == $day_id) ? ' mec-selected-day' : ''; + $selected_day_date = (str_replace('-', '', $this->active_day) == $day_id) ? ' mec-bg-color' : ''; + + // Print events + if(isset($events[$today]) && count($events[$today])) + { + echo '
    '.MEC_kses::full(apply_filters( 'mec_filter_list_day_value', $list_day, $today, $this)).'
    '; + foreach($events[$today] as $event) + { + $event_color = $this->get_event_color_dot($event, true); + $start_date = (isset($event->date['start']['date']) ? str_replace ( '-', '', $event->date['start']['date'] ) : ''); + $end_date = (isset($event->date['end']['date']) ? str_replace ( '-', '', $event->date['end']['date'] ) : ''); + + // MEC Schema + do_action('mec_schema', $event); + + if($target_set !== 'no') echo ''; + + echo '
    '; + echo '

    '.MEC_kses::element(apply_filters('mec_occurrence_event_title', $event->data->title, $event)).'

    '.$this->main->get_normal_labels($event, $display_label).$this->main->display_cancellation_reason($event, $reason_for_cancellation); + echo MEC_kses::element($this->get_label_captions($event)); + + do_action('mec_shortcode_virtual_badge', $event->data->ID); + + echo MEC_kses::element($this->display_cost($event)); + echo MEC_kses::element($this->display_organizers($event)); + echo MEC_kses::embed($this->display_custom_data($event)); + + echo '
    '; + if($target_set !== 'no') echo '
    '; + } + + echo '
    '; + } + else + { + echo '
    '.MEC_kses::full(apply_filters('mec_filter_list_day_value', $list_day, $today, $this)).'
    '; + echo ''; + } + + if($running_day == 6) + { + echo '
    '; + + if((($day_counter+1) != $days_in_month) or (($day_counter+1) == $days_in_month && $days_in_this_week == 7)) + { + echo '
    '; + } + + $running_day = -1; + $days_in_this_week = 0; + } + + $days_in_this_week++; $running_day++; $day_counter++; + } + + // finish the rest of the days in the week + if($days_in_this_week > 1 && $days_in_this_week < 8) + { + for($x = 1; $x <= (8 - $days_in_this_week); $x++) + { + $list_day = $x; + $time = strtotime(($month == 12 ? ($year + 1) : $year).'-'.($month == 12 ? 1 : ($month + 1)).'-'.$list_day); + + $today = date('Y-m-d', $time); + $day_id = date('Ymd', $time); + $selected_day = (str_replace('-', '', $this->active_day) == $day_id) ? ' mec-selected-day' : ''; + $selected_day_date = (str_replace('-', '', $this->active_day) == $day_id) ? ' mec-bg-color' : ''; + + // Print events + if(isset($events[$today]) && count($events[$today])) + { + echo '
    '.MEC_kses::full(apply_filters( 'mec_filter_list_day_value', $list_day, $today, $this)).'
    '; + foreach($events[$today] as $event) + { + $event_color = $this->get_event_color_dot($event, true); + $start_date = (isset($event->date['start']['date']) ? str_replace ( '-', '', $event->date['start']['date'] ) : ''); + $end_date = (isset($event->date['end']['date']) ? str_replace ( '-', '', $event->date['end']['date'] ) : ''); + + // MEC Schema + do_action('mec_schema', $event); + + if($target_set !== 'no') echo ''; + + echo '
    '; + echo '

    '.MEC_kses::element(apply_filters('mec_occurrence_event_title', $event->data->title, $event)).'

    '.$this->main->get_normal_labels($event, $display_label).$this->main->display_cancellation_reason($event, $reason_for_cancellation); + echo MEC_kses::element($this->get_label_captions($event)); + + do_action('mec_shortcode_virtual_badge', $event->data->ID); + + echo MEC_kses::element($this->display_cost($event)); + echo MEC_kses::element($this->display_organizers($event)); + echo MEC_kses::embed($this->display_custom_data($event)); + + echo '
    '; + if($target_set !== 'no') echo '
    '; + } + + echo '
    '; + } + else + { + echo '
    '.esc_html($x).'
    '; + } + } + } + ?> +
    diff --git a/app/skins/monthly_view/calendar_simple.php b/app/skins/monthly_view/calendar_simple.php new file mode 100755 index 0000000..ef9f088 --- /dev/null +++ b/app/skins/monthly_view/calendar_simple.php @@ -0,0 +1,296 @@ +main->get_weekday_abbr_labels(); +echo '
    '.implode('
    ', $headings).'
    '; + +// Start day of week +$week_start = $this->main->get_first_day_of_week(); + +// Single Event Display Method +$sed_method = $this->skin_options['sed_method'] ?? false; +$target_url = ($sed_method === 'new') ? 'target="_blank"' : ''; + +$this->localtime = $this->skin_options['include_local_time'] ?? false; +$display_label = $this->skin_options['display_label'] ?? false; +$reason_for_cancellation = $this->skin_options['reason_for_cancellation'] ?? false; + +// days and weeks vars +$running_day = date('w', mktime(0, 0, 0, $month, 1, $year)); +$days_in_month = date('t', mktime(0, 0, 0, $month, 1, $year)); +$days_in_previous_month = $this->main->get_days_in_previous_month($month, $year); + +$days_in_this_week = 1; +$day_counter = 0; + +if($week_start == 1) // Monday +{ + if($running_day != 0) $running_day = $running_day - 1; + else $running_day = 6; +} +elseif($week_start == 6) // Saturday +{ + if($running_day != 6) $running_day = $running_day + 1; + else $running_day = 0; +} +elseif($week_start == 5) // Friday +{ + if($running_day < 4) $running_day = $running_day + 2; + elseif($running_day == 5) $running_day = 0; + elseif($running_day == 6) $running_day = 1; +} +?> +
    + active_day) == $day_id) ? ' mec-selected-day' : ''; + $selected_day_date = (str_replace('-', '', $this->active_day) == $day_id) ? ' mec-bg-color' : ''; + + // Print events + if(isset($events[$today]) && count($events[$today])) + { + echo '
    '.apply_filters('mec_filter_list_day_value', $list_day, $today, $this).'
    '; + foreach($events[$today] as $event) + { + $start_time = (isset($event->data->time) ? $event->data->time['start'] : ''); + $end_time = (isset($event->data->time) ? $event->data->time['end'] : ''); + + $event_unique = (isset($event->data->time) ? $event->data->ID.$event->data->time['start_timestamp'] : $event->data->ID); + + // Event Content + if(!$this->cache->has($event->data->ID.'_content')) + { + if(get_post_meta($event->data->ID, '_elementor_edit_mode', true) && class_exists('\Elementor\Plugin')) $event_content = get_the_excerpt($event->data->ID); + else $event_content = isset($event->data->content) && trim($event->data->content) != '' ? mb_substr(strip_tags($event->data->content, ' + + +
    +

    PHP ICS Parser example

    +
      +
    • + eventCount ?> + The number of events +
    • +
    • + freeBusyCount ?> + The number of free/busy time slots +
    • +
    • + todoCount ?> + The number of todos +
    • +
    • + alarmCount ?> + The number of alarms +
    • +
    + + true, + 'range' => true, + 'all' => true, + ); + ?> + + eventsFromInterval('1 week'); + + if ($events) { + echo '

    Events in the next 7 days:

    '; + } + + $count = 1; + ?> +
    + +
    +
    +
    +

    iCalDateToDateTime($event->dtstart_array[3]); + echo $event->summary . ' (' . $dtstart->format('d-m-Y H:i') . ')'; + ?>

    + printData() ?> +
    +
    +
    + 1 && $count % 3 === 0) { + echo '
    '; + } + + $count++; + ?> + +
    + + + eventsFromRange('2017-03-01 12:00:00', '2017-04-31 17:00:00'); + + if ($events) { + echo '

    Events March through April:

    '; + } + + $count = 1; + ?> +
    + +
    +
    +
    +

    iCalDateToDateTime($event->dtstart_array[3]); + echo $event->summary . ' (' . $dtstart->format('d-m-Y H:i') . ')'; + ?>

    + printData() ?> +
    +
    +
    + 1 && $count % 3 === 0) { + echo '
    '; + } + + $count++; + ?> + +
    + + + sortEventsWithOrder($ical->events()); + + if ($events) { + echo '

    All Events:

    '; + } + ?> +
    + +
    +
    +
    +

    iCalDateToDateTime($event->dtstart_array[3]); + echo $event->summary . ' (' . $dtstart->format('d-m-Y H:i') . ')'; + ?>

    + printData() ?> +
    +
    +
    + 1 && $count % 3 === 0) { + echo '
    '; + } + + $count++; + ?> + +
    + +
    + + diff --git a/app/vendor/johngrogg/ics-parser/phpunit.xml b/app/vendor/johngrogg/ics-parser/phpunit.xml new file mode 100755 index 0000000..640908b --- /dev/null +++ b/app/vendor/johngrogg/ics-parser/phpunit.xml @@ -0,0 +1,7 @@ + + + + tests + + + diff --git a/app/vendor/johngrogg/ics-parser/rector.php b/app/vendor/johngrogg/ics-parser/rector.php new file mode 100755 index 0000000..d63ba56 --- /dev/null +++ b/app/vendor/johngrogg/ics-parser/rector.php @@ -0,0 +1,83 @@ +parameters(); + + $parameters->set(Option::IMPORT_SHORT_CLASSES, false); + + $parameters->set(Option::PHP_VERSION_FEATURES, '5.6'); + + $parameters->set(Option::AUTOLOAD_PATHS, array(__DIR__ . '/vendor/autoload.php')); + + $parameters->set(Option::EXCLUDE_RECTORS, array( + Rector\CodeQuality\Rector\Class_\CompleteDynamicPropertiesRector::class, + Rector\CodeQuality\Rector\Concat\JoinStringConcatRector::class, + Rector\CodeQuality\Rector\FuncCall\ChangeArrayPushToArrayAssignRector::class, + Rector\CodeQuality\Rector\FuncCall\CompactToVariablesRector::class, + Rector\CodeQuality\Rector\FuncCall\IntvalToTypeCastRector::class, + Rector\CodeQuality\Rector\Identical\BooleanNotIdenticalToNotIdenticalRector::class, + Rector\CodeQuality\Rector\Identical\SimplifyBoolIdenticalTrueRector::class, + Rector\CodeQuality\Rector\If_\CombineIfRector::class, + Rector\CodeQuality\Rector\If_\ExplicitBoolCompareRector::class, + Rector\CodeQuality\Rector\If_\SimplifyIfElseToTernaryRector::class, + Rector\CodeQuality\Rector\If_\SimplifyIfReturnBoolRector::class, + Rector\CodeQuality\Rector\Isset_\IssetOnPropertyObjectToPropertyExistsRector::class, + Rector\CodeQuality\Rector\Return_\SimplifyUselessVariableRector::class, + Rector\CodingStyle\Rector\ClassConst\VarConstantCommentRector::class, + Rector\CodingStyle\Rector\Encapsed\EncapsedStringsToSprintfRector::class, + Rector\CodingStyle\Rector\FuncCall\ConsistentPregDelimiterRector::class, + Rector\CodingStyle\Rector\Function_\CamelCaseFunctionNamingToUnderscoreRector::class, + Rector\CodingStyle\Rector\String_\SymplifyQuoteEscapeRector::class, + Rector\DeadCode\Rector\Assign\RemoveUnusedVariableAssignRector::class, + Rector\DeadCode\Rector\ClassConst\RemoveUnusedClassConstantRector::class, + Rector\DeadCode\Rector\ClassMethod\RemoveUnusedParameterRector::class, + Rector\Naming\Rector\Property\UnderscoreToCamelCasePropertyNameRector::class, + Rector\Naming\Rector\Variable\UnderscoreToCamelCaseVariableNameRector::class, + Rector\Php56\Rector\FuncCall\PowToExpRector::class, + Rector\Php70\Rector\FuncCall\NonVariableToVariableOnFunctionCallRector::class, + Rector\Php70\Rector\MethodCall\ThisCallOnStaticMethodToStaticCallRector::class, + Rector\Php70\Rector\StaticCall\StaticCallOnNonStaticToInstanceCallRector::class, + Rector\Php71\Rector\FuncCall\CountOnNullRector::class, + Rector\Php73\Rector\FuncCall\JsonThrowOnErrorRector::class, + Rector\TypeDeclaration\Rector\FunctionLike\ParamTypeDeclarationRector::class, + // PHP 5.6 incompatible + Rector\CodeQuality\Rector\Ternary\ArrayKeyExistsTernaryThenValueToCoalescingRector::class, // PHP 7 + Rector\Php70\Rector\If_\IfToSpaceshipRector::class, + Rector\Php70\Rector\Ternary\TernaryToSpaceshipRector::class, + Rector\Php71\Rector\BinaryOp\IsIterableRector::class, + Rector\Php71\Rector\List_\ListToArrayDestructRector::class, + Rector\Php71\Rector\TryCatch\MultiExceptionCatchRector::class, + Rector\Php73\Rector\FuncCall\ArrayKeyFirstLastRector::class, + Rector\Php73\Rector\BinaryOp\IsCountableRector::class, + )); + + $parameters->set(Option::SETS, array( + SetList::CODE_QUALITY, + SetList::CODING_STYLE, + SetList::DEAD_CODE, + SetList::LARAVEL_50, + SetList::LARAVEL_51, + SetList::LARAVEL_52, + SetList::LARAVEL_53, + SetList::LARAVEL_54, + SetList::PHP_56, + SetList::PHP_70, + SetList::PHP_71, + SetList::PHP_72, + SetList::PHP_73, + SetList::PHP_74, + )); + + $services = $containerConfigurator->services(); + + $services->set(TernaryToElvisRector::class); +}; diff --git a/app/vendor/johngrogg/ics-parser/src/ICal/Event.php b/app/vendor/johngrogg/ics-parser/src/ICal/Event.php new file mode 100755 index 0000000..2262819 --- /dev/null +++ b/app/vendor/johngrogg/ics-parser/src/ICal/Event.php @@ -0,0 +1,204 @@ +%s: %s

    '; + + /** + * https://www.kanzaki.com/docs/ical/summary.html + * + * @var $summary + */ + public $summary; + + /** + * https://www.kanzaki.com/docs/ical/dtstart.html + * + * @var $dtstart + */ + public $dtstart; + + /** + * https://www.kanzaki.com/docs/ical/dtend.html + * + * @var $dtend + */ + public $dtend; + + /** + * https://www.kanzaki.com/docs/ical/duration.html + * + * @var $duration + */ + public $duration; + + /** + * https://www.kanzaki.com/docs/ical/dtstamp.html + * + * @var $dtstamp + */ + public $dtstamp; + + /** + * https://www.kanzaki.com/docs/ical/uid.html + * + * @var $uid + */ + public $uid; + + /** + * https://www.kanzaki.com/docs/ical/created.html + * + * @var $created + */ + public $created; + + /** + * https://www.kanzaki.com/docs/ical/lastModified.html + * + * @var $lastmodified + */ + public $lastmodified; + + /** + * https://www.kanzaki.com/docs/ical/description.html + * + * @var $description + */ + public $description; + + /** + * https://www.kanzaki.com/docs/ical/location.html + * + * @var $location + */ + public $location; + + /** + * https://www.kanzaki.com/docs/ical/sequence.html + * + * @var $sequence + */ + public $sequence; + + /** + * https://www.kanzaki.com/docs/ical/status.html + * + * @var $status + */ + public $status; + + /** + * https://www.kanzaki.com/docs/ical/transp.html + * + * @var $transp + */ + public $transp; + + /** + * https://www.kanzaki.com/docs/ical/organizer.html + * + * @var $organizer + */ + public $organizer; + + /** + * https://www.kanzaki.com/docs/ical/attendee.html + * + * @var $attendee + */ + public $attendee; + + /** + * Creates the Event object + * + * @param array $data + * @return void + */ + public function __construct(array $data = array()) + { + foreach ($data as $key => $value) { + $variable = self::snakeCase($key); + $this->{$variable} = self::prepareData($value); + } + } + + /** + * Prepares the data for output + * + * @param mixed $value + * @return mixed + */ + protected function prepareData($value) + { + if (is_string($value)) { + return stripslashes(trim(str_replace('\n', "\n", $value))); + } elseif (is_array($value)) { + return array_map('self::prepareData', $value); + } + + return $value; + } + + /** + * Returns Event data excluding anything blank + * within an HTML template + * + * @param string $html HTML template to use + * @return string + */ + public function printData($html = self::HTML_TEMPLATE) + { + $data = array( + 'SUMMARY' => $this->summary, + 'DTSTART' => $this->dtstart, + 'DTEND' => $this->dtend, + 'DTSTART_TZ' => $this->dtstart_tz, + 'DTEND_TZ' => $this->dtend_tz, + 'DURATION' => $this->duration, + 'DTSTAMP' => $this->dtstamp, + 'UID' => $this->uid, + 'CREATED' => $this->created, + 'LAST-MODIFIED' => $this->lastmodified, + 'DESCRIPTION' => $this->description, + 'LOCATION' => $this->location, + 'SEQUENCE' => $this->sequence, + 'STATUS' => $this->status, + 'TRANSP' => $this->transp, + 'ORGANISER' => $this->organizer, + 'ATTENDEE(S)' => $this->attendee, + ); + + // Remove any blank values + $data = array_filter($data); + + $output = ''; + + foreach ($data as $key => $value) { + $output .= sprintf($html, $key, $value); + } + + return $output; + } + + /** + * Converts the given input to snake_case + * + * @param string $input + * @param string $glue + * @param string $separator + * @return string + */ + protected static function snakeCase($input, $glue = '_', $separator = '-') + { + $input = preg_split('/(?<=[a-z])(?=[A-Z])/x', $input); + $input = implode($glue, $input); + $input = str_replace($separator, $glue, $input); + + return strtolower($input); + } +} diff --git a/app/vendor/johngrogg/ics-parser/src/ICal/ICal.php b/app/vendor/johngrogg/ics-parser/src/ICal/ICal.php new file mode 100755 index 0000000..53d217c --- /dev/null +++ b/app/vendor/johngrogg/ics-parser/src/ICal/ICal.php @@ -0,0 +1,2633 @@ + + * @license https://opensource.org/licenses/mit-license.php MIT License + * @version 2.2.2 + */ + +namespace ICal; + +class ICal +{ + // phpcs:disable Generic.Arrays.DisallowLongArraySyntax + + const DATE_TIME_FORMAT = 'Ymd\THis'; + const DATE_TIME_FORMAT_PRETTY = 'F Y H:i:s'; + const ICAL_DATE_TIME_TEMPLATE = 'TZID=%s:'; + const ISO_8601_WEEK_START = 'MO'; + const RECURRENCE_EVENT = 'Generated recurrence event'; + const SECONDS_IN_A_WEEK = 604800; + const TIME_FORMAT = 'His'; + const TIME_ZONE_UTC = 'UTC'; + const UNIX_FORMAT = 'U'; + const UNIX_MIN_YEAR = 1970; + + /** + * Tracks the number of alarms in the current iCal feed + * + * @var integer + */ + public $alarmCount = 0; + + /** + * Tracks the number of events in the current iCal feed + * + * @var integer + */ + public $eventCount = 0; + + /** + * Tracks the free/busy count in the current iCal feed + * + * @var integer + */ + public $freeBusyCount = 0; + + /** + * Tracks the number of todos in the current iCal feed + * + * @var integer + */ + public $todoCount = 0; + + /** + * The value in years to use for indefinite, recurring events + * + * @var integer + */ + public $defaultSpan = 2; + + /** + * Enables customisation of the default time zone + * + * @var string + */ + public $defaultTimeZone; + + /** + * The two letter representation of the first day of the week + * + * @var string + */ + public $defaultWeekStart = self::ISO_8601_WEEK_START; + + /** + * Toggles whether to skip the parsing of recurrence rules + * + * @var boolean + */ + public $skipRecurrence = false; + + /** + * Toggles whether to disable all character replacement. + * + * @var boolean + */ + public $disableCharacterReplacement = false; + + /** + * With this being non-null the parser will ignore all events more than roughly this many days after now. + * + * @var integer + */ + public $filterDaysBefore; + + /** + * With this being non-null the parser will ignore all events more than roughly this many days before now. + * + * @var integer + */ + public $filterDaysAfter; + + /** + * The parsed calendar + * + * @var array + */ + public $cal = array(); + + /** + * Tracks the VFREEBUSY component + * + * @var integer + */ + protected $freeBusyIndex = 0; + + /** + * Variable to track the previous keyword + * + * @var string + */ + protected $lastKeyword; + + /** + * Cache valid IANA time zone IDs to avoid unnecessary lookups + * + * @var array + */ + protected $validIanaTimeZones = array(); + + /** + * Event recurrence instances that have been altered + * + * @var array + */ + protected $alteredRecurrenceInstances = array(); + + /** + * An associative array containing weekday conversion data + * + * The order of the days in the array follow the ISO-8601 specification of a week. + * + * @var array + */ + protected $weekdays = array( + 'MO' => 'monday', + 'TU' => 'tuesday', + 'WE' => 'wednesday', + 'TH' => 'thursday', + 'FR' => 'friday', + 'SA' => 'saturday', + 'SU' => 'sunday', + ); + + /** + * An associative array containing frequency conversion terms + * + * @var array + */ + protected $frequencyConversion = array( + 'DAILY' => 'day', + 'WEEKLY' => 'week', + 'MONTHLY' => 'month', + 'YEARLY' => 'year', + ); + + /** + * Holds the username and password for HTTP basic authentication + * + * @var array + */ + protected $httpBasicAuth = array(); + + /** + * Holds the custom User Agent string header + * + * @var string + */ + protected $httpUserAgent; + + /** + * Holds the custom Accept Language string header + * + * @var string + */ + protected $httpAcceptLanguage; + + /** + * Define which variables can be configured + * + * @var array + */ + private static $configurableOptions = array( + 'defaultSpan', + 'defaultTimeZone', + 'defaultWeekStart', + 'disableCharacterReplacement', + 'filterDaysAfter', + 'filterDaysBefore', + 'skipRecurrence', + ); + + /** + * CLDR time zones mapped to IANA time zones. + * + * @var array + */ + private static $cldrTimeZonesMap = array( + '(UTC-12:00) International Date Line West' => 'Etc/GMT+12', + '(UTC-11:00) Coordinated Universal Time-11' => 'Etc/GMT+11', + '(UTC-10:00) Hawaii' => 'Pacific/Honolulu', + '(UTC-09:00) Alaska' => 'America/Anchorage', + '(UTC-08:00) Pacific Time (US & Canada)' => 'America/Los_Angeles', + '(UTC-07:00) Arizona' => 'America/Phoenix', + '(UTC-07:00) Chihuahua, La Paz, Mazatlan' => 'America/Chihuahua', + '(UTC-07:00) Mountain Time (US & Canada)' => 'America/Denver', + '(UTC-06:00) Central America' => 'America/Guatemala', + '(UTC-06:00) Central Time (US & Canada)' => 'America/Chicago', + '(UTC-06:00) Guadalajara, Mexico City, Monterrey' => 'America/Mexico_City', + '(UTC-06:00) Saskatchewan' => 'America/Regina', + '(UTC-05:00) Bogota, Lima, Quito, Rio Branco' => 'America/Bogota', + '(UTC-05:00) Chetumal' => 'America/Cancun', + '(UTC-05:00) Eastern Time (US & Canada)' => 'America/New_York', + '(UTC-05:00) Indiana (East)' => 'America/Indianapolis', + '(UTC-04:00) Asuncion' => 'America/Asuncion', + '(UTC-04:00) Atlantic Time (Canada)' => 'America/Halifax', + '(UTC-04:00) Caracas' => 'America/Caracas', + '(UTC-04:00) Cuiaba' => 'America/Cuiaba', + '(UTC-04:00) Georgetown, La Paz, Manaus, San Juan' => 'America/La_Paz', + '(UTC-04:00) Santiago' => 'America/Santiago', + '(UTC-03:30) Newfoundland' => 'America/St_Johns', + '(UTC-03:00) Brasilia' => 'America/Sao_Paulo', + '(UTC-03:00) Cayenne, Fortaleza' => 'America/Cayenne', + '(UTC-03:00) City of Buenos Aires' => 'America/Buenos_Aires', + '(UTC-03:00) Greenland' => 'America/Godthab', + '(UTC-03:00) Montevideo' => 'America/Montevideo', + '(UTC-03:00) Salvador' => 'America/Bahia', + '(UTC-02:00) Coordinated Universal Time-02' => 'Etc/GMT+2', + '(UTC-01:00) Azores' => 'Atlantic/Azores', + '(UTC-01:00) Cabo Verde Is.' => 'Atlantic/Cape_Verde', + '(UTC) Coordinated Universal Time' => 'Etc/GMT', + '(UTC+00:00) Casablanca' => 'Africa/Casablanca', + '(UTC+00:00) Dublin, Edinburgh, Lisbon, London' => 'Europe/London', + '(UTC+00:00) Monrovia, Reykjavik' => 'Atlantic/Reykjavik', + '(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna' => 'Europe/Berlin', + '(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague' => 'Europe/Budapest', + '(UTC+01:00) Brussels, Copenhagen, Madrid, Paris' => 'Europe/Paris', + '(UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb' => 'Europe/Warsaw', + '(UTC+01:00) West Central Africa' => 'Africa/Lagos', + '(UTC+02:00) Amman' => 'Asia/Amman', + '(UTC+02:00) Athens, Bucharest' => 'Europe/Bucharest', + '(UTC+02:00) Beirut' => 'Asia/Beirut', + '(UTC+02:00) Cairo' => 'Africa/Cairo', + '(UTC+02:00) Chisinau' => 'Europe/Chisinau', + '(UTC+02:00) Damascus' => 'Asia/Damascus', + '(UTC+02:00) Harare, Pretoria' => 'Africa/Johannesburg', + '(UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius' => 'Europe/Kiev', + '(UTC+02:00) Jerusalem' => 'Asia/Jerusalem', + '(UTC+02:00) Kaliningrad' => 'Europe/Kaliningrad', + '(UTC+02:00) Tripoli' => 'Africa/Tripoli', + '(UTC+02:00) Windhoek' => 'Africa/Windhoek', + '(UTC+03:00) Baghdad' => 'Asia/Baghdad', + '(UTC+03:00) Istanbul' => 'Europe/Istanbul', + '(UTC+03:00) Kuwait, Riyadh' => 'Asia/Riyadh', + '(UTC+03:00) Minsk' => 'Europe/Minsk', + '(UTC+03:00) Moscow, St. Petersburg, Volgograd' => 'Europe/Moscow', + '(UTC+03:00) Nairobi' => 'Africa/Nairobi', + '(UTC+03:30) Tehran' => 'Asia/Tehran', + '(UTC+04:00) Abu Dhabi, Muscat' => 'Asia/Dubai', + '(UTC+04:00) Baku' => 'Asia/Baku', + '(UTC+04:00) Izhevsk, Samara' => 'Europe/Samara', + '(UTC+04:00) Port Louis' => 'Indian/Mauritius', + '(UTC+04:00) Tbilisi' => 'Asia/Tbilisi', + '(UTC+04:00) Yerevan' => 'Asia/Yerevan', + '(UTC+04:30) Kabul' => 'Asia/Kabul', + '(UTC+05:00) Ashgabat, Tashkent' => 'Asia/Tashkent', + '(UTC+05:00) Ekaterinburg' => 'Asia/Yekaterinburg', + '(UTC+05:00) Islamabad, Karachi' => 'Asia/Karachi', + '(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi' => 'Asia/Calcutta', + '(UTC+05:30) Sri Jayawardenepura' => 'Asia/Colombo', + '(UTC+05:45) Kathmandu' => 'Asia/Katmandu', + '(UTC+06:00) Astana' => 'Asia/Almaty', + '(UTC+06:00) Dhaka' => 'Asia/Dhaka', + '(UTC+06:30) Yangon (Rangoon)' => 'Asia/Rangoon', + '(UTC+07:00) Bangkok, Hanoi, Jakarta' => 'Asia/Bangkok', + '(UTC+07:00) Krasnoyarsk' => 'Asia/Krasnoyarsk', + '(UTC+07:00) Novosibirsk' => 'Asia/Novosibirsk', + '(UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi' => 'Asia/Shanghai', + '(UTC+08:00) Irkutsk' => 'Asia/Irkutsk', + '(UTC+08:00) Kuala Lumpur, Singapore' => 'Asia/Singapore', + '(UTC+08:00) Perth' => 'Australia/Perth', + '(UTC+08:00) Taipei' => 'Asia/Taipei', + '(UTC+08:00) Ulaanbaatar' => 'Asia/Ulaanbaatar', + '(UTC+09:00) Osaka, Sapporo, Tokyo' => 'Asia/Tokyo', + '(UTC+09:00) Pyongyang' => 'Asia/Pyongyang', + '(UTC+09:00) Seoul' => 'Asia/Seoul', + '(UTC+09:00) Yakutsk' => 'Asia/Yakutsk', + '(UTC+09:30) Adelaide' => 'Australia/Adelaide', + '(UTC+09:30) Darwin' => 'Australia/Darwin', + '(UTC+10:00) Brisbane' => 'Australia/Brisbane', + '(UTC+10:00) Canberra, Melbourne, Sydney' => 'Australia/Sydney', + '(UTC+10:00) Guam, Port Moresby' => 'Pacific/Port_Moresby', + '(UTC+10:00) Hobart' => 'Australia/Hobart', + '(UTC+10:00) Vladivostok' => 'Asia/Vladivostok', + '(UTC+11:00) Chokurdakh' => 'Asia/Srednekolymsk', + '(UTC+11:00) Magadan' => 'Asia/Magadan', + '(UTC+11:00) Solomon Is., New Caledonia' => 'Pacific/Guadalcanal', + '(UTC+12:00) Anadyr, Petropavlovsk-Kamchatsky' => 'Asia/Kamchatka', + '(UTC+12:00) Auckland, Wellington' => 'Pacific/Auckland', + '(UTC+12:00) Coordinated Universal Time+12' => 'Etc/GMT-12', + '(UTC+12:00) Fiji' => 'Pacific/Fiji', + "(UTC+13:00) Nuku'alofa" => 'Pacific/Tongatapu', + '(UTC+13:00) Samoa' => 'Pacific/Apia', + '(UTC+14:00) Kiritimati Island' => 'Pacific/Kiritimati', + ); + + /** + * Maps Windows (non-CLDR) time zone ID to IANA ID. This is pragmatic but not 100% precise as one Windows zone ID + * maps to multiple IANA IDs (one for each territory). For all practical purposes this should be good enough, though. + * + * Source: http://unicode.org/repos/cldr/trunk/common/supplemental/windowsZones.xml + * + * @var array + */ + private static $windowsTimeZonesMap = array( + 'AUS Central Standard Time' => 'Australia/Darwin', + 'AUS Eastern Standard Time' => 'Australia/Sydney', + 'Afghanistan Standard Time' => 'Asia/Kabul', + 'Alaskan Standard Time' => 'America/Anchorage', + 'Aleutian Standard Time' => 'America/Adak', + 'Altai Standard Time' => 'Asia/Barnaul', + 'Arab Standard Time' => 'Asia/Riyadh', + 'Arabian Standard Time' => 'Asia/Dubai', + 'Arabic Standard Time' => 'Asia/Baghdad', + 'Argentina Standard Time' => 'America/Buenos_Aires', + 'Astrakhan Standard Time' => 'Europe/Astrakhan', + 'Atlantic Standard Time' => 'America/Halifax', + 'Aus Central W. Standard Time' => 'Australia/Eucla', + 'Azerbaijan Standard Time' => 'Asia/Baku', + 'Azores Standard Time' => 'Atlantic/Azores', + 'Bahia Standard Time' => 'America/Bahia', + 'Bangladesh Standard Time' => 'Asia/Dhaka', + 'Belarus Standard Time' => 'Europe/Minsk', + 'Bougainville Standard Time' => 'Pacific/Bougainville', + 'Canada Central Standard Time' => 'America/Regina', + 'Cape Verde Standard Time' => 'Atlantic/Cape_Verde', + 'Caucasus Standard Time' => 'Asia/Yerevan', + 'Cen. Australia Standard Time' => 'Australia/Adelaide', + 'Central America Standard Time' => 'America/Guatemala', + 'Central Asia Standard Time' => 'Asia/Almaty', + 'Central Brazilian Standard Time' => 'America/Cuiaba', + 'Central Europe Standard Time' => 'Europe/Budapest', + 'Central European Standard Time' => 'Europe/Warsaw', + 'Central Pacific Standard Time' => 'Pacific/Guadalcanal', + 'Central Standard Time (Mexico)' => 'America/Mexico_City', + 'Central Standard Time' => 'America/Chicago', + 'Chatham Islands Standard Time' => 'Pacific/Chatham', + 'China Standard Time' => 'Asia/Shanghai', + 'Cuba Standard Time' => 'America/Havana', + 'Dateline Standard Time' => 'Etc/GMT+12', + 'E. Africa Standard Time' => 'Africa/Nairobi', + 'E. Australia Standard Time' => 'Australia/Brisbane', + 'E. Europe Standard Time' => 'Europe/Chisinau', + 'E. South America Standard Time' => 'America/Sao_Paulo', + 'Easter Island Standard Time' => 'Pacific/Easter', + 'Eastern Standard Time (Mexico)' => 'America/Cancun', + 'Eastern Standard Time' => 'America/New_York', + 'Egypt Standard Time' => 'Africa/Cairo', + 'Ekaterinburg Standard Time' => 'Asia/Yekaterinburg', + 'FLE Standard Time' => 'Europe/Kiev', + 'Fiji Standard Time' => 'Pacific/Fiji', + 'GMT Standard Time' => 'Europe/London', + 'GTB Standard Time' => 'Europe/Bucharest', + 'Georgian Standard Time' => 'Asia/Tbilisi', + 'Greenland Standard Time' => 'America/Godthab', + 'Greenwich Standard Time' => 'Atlantic/Reykjavik', + 'Haiti Standard Time' => 'America/Port-au-Prince', + 'Hawaiian Standard Time' => 'Pacific/Honolulu', + 'India Standard Time' => 'Asia/Calcutta', + 'Iran Standard Time' => 'Asia/Tehran', + 'Israel Standard Time' => 'Asia/Jerusalem', + 'Jordan Standard Time' => 'Asia/Amman', + 'Kaliningrad Standard Time' => 'Europe/Kaliningrad', + 'Korea Standard Time' => 'Asia/Seoul', + 'Libya Standard Time' => 'Africa/Tripoli', + 'Line Islands Standard Time' => 'Pacific/Kiritimati', + 'Lord Howe Standard Time' => 'Australia/Lord_Howe', + 'Magadan Standard Time' => 'Asia/Magadan', + 'Magallanes Standard Time' => 'America/Punta_Arenas', + 'Marquesas Standard Time' => 'Pacific/Marquesas', + 'Mauritius Standard Time' => 'Indian/Mauritius', + 'Middle East Standard Time' => 'Asia/Beirut', + 'Montevideo Standard Time' => 'America/Montevideo', + 'Morocco Standard Time' => 'Africa/Casablanca', + 'Mountain Standard Time (Mexico)' => 'America/Chihuahua', + 'Mountain Standard Time' => 'America/Denver', + 'Myanmar Standard Time' => 'Asia/Rangoon', + 'N. Central Asia Standard Time' => 'Asia/Novosibirsk', + 'Namibia Standard Time' => 'Africa/Windhoek', + 'Nepal Standard Time' => 'Asia/Katmandu', + 'New Zealand Standard Time' => 'Pacific/Auckland', + 'Newfoundland Standard Time' => 'America/St_Johns', + 'Norfolk Standard Time' => 'Pacific/Norfolk', + 'North Asia East Standard Time' => 'Asia/Irkutsk', + 'North Asia Standard Time' => 'Asia/Krasnoyarsk', + 'North Korea Standard Time' => 'Asia/Pyongyang', + 'Omsk Standard Time' => 'Asia/Omsk', + 'Pacific SA Standard Time' => 'America/Santiago', + 'Pacific Standard Time (Mexico)' => 'America/Tijuana', + 'Pacific Standard Time' => 'America/Los_Angeles', + 'Pakistan Standard Time' => 'Asia/Karachi', + 'Paraguay Standard Time' => 'America/Asuncion', + 'Romance Standard Time' => 'Europe/Paris', + 'Russia Time Zone 10' => 'Asia/Srednekolymsk', + 'Russia Time Zone 11' => 'Asia/Kamchatka', + 'Russia Time Zone 3' => 'Europe/Samara', + 'Russian Standard Time' => 'Europe/Moscow', + 'SA Eastern Standard Time' => 'America/Cayenne', + 'SA Pacific Standard Time' => 'America/Bogota', + 'SA Western Standard Time' => 'America/La_Paz', + 'SE Asia Standard Time' => 'Asia/Bangkok', + 'Saint Pierre Standard Time' => 'America/Miquelon', + 'Sakhalin Standard Time' => 'Asia/Sakhalin', + 'Samoa Standard Time' => 'Pacific/Apia', + 'Sao Tome Standard Time' => 'Africa/Sao_Tome', + 'Saratov Standard Time' => 'Europe/Saratov', + 'Singapore Standard Time' => 'Asia/Singapore', + 'South Africa Standard Time' => 'Africa/Johannesburg', + 'Sri Lanka Standard Time' => 'Asia/Colombo', + 'Sudan Standard Time' => 'Africa/Tripoli', + 'Syria Standard Time' => 'Asia/Damascus', + 'Taipei Standard Time' => 'Asia/Taipei', + 'Tasmania Standard Time' => 'Australia/Hobart', + 'Tocantins Standard Time' => 'America/Araguaina', + 'Tokyo Standard Time' => 'Asia/Tokyo', + 'Tomsk Standard Time' => 'Asia/Tomsk', + 'Tonga Standard Time' => 'Pacific/Tongatapu', + 'Transbaikal Standard Time' => 'Asia/Chita', + 'Turkey Standard Time' => 'Europe/Istanbul', + 'Turks And Caicos Standard Time' => 'America/Grand_Turk', + 'US Eastern Standard Time' => 'America/Indianapolis', + 'US Mountain Standard Time' => 'America/Phoenix', + 'UTC' => 'Etc/GMT', + 'UTC+12' => 'Etc/GMT-12', + 'UTC+13' => 'Etc/GMT-13', + 'UTC-02' => 'Etc/GMT+2', + 'UTC-08' => 'Etc/GMT+8', + 'UTC-09' => 'Etc/GMT+9', + 'UTC-11' => 'Etc/GMT+11', + 'Ulaanbaatar Standard Time' => 'Asia/Ulaanbaatar', + 'Venezuela Standard Time' => 'America/Caracas', + 'Vladivostok Standard Time' => 'Asia/Vladivostok', + 'W. Australia Standard Time' => 'Australia/Perth', + 'W. Central Africa Standard Time' => 'Africa/Lagos', + 'W. Europe Standard Time' => 'Europe/Berlin', + 'W. Mongolia Standard Time' => 'Asia/Hovd', + 'West Asia Standard Time' => 'Asia/Tashkent', + 'West Bank Standard Time' => 'Asia/Hebron', + 'West Pacific Standard Time' => 'Pacific/Port_Moresby', + 'Yakutsk Standard Time' => 'Asia/Yakutsk', + ); + + /** + * If `$filterDaysBefore` or `$filterDaysAfter` are set then the events are filtered according to the window defined + * by this field and `$windowMaxTimestamp`. + * + * @var integer + */ + private $windowMinTimestamp; + + /** + * If `$filterDaysBefore` or `$filterDaysAfter` are set then the events are filtered according to the window defined + * by this field and `$windowMinTimestamp`. + * + * @var integer + */ + private $windowMaxTimestamp; + + /** + * `true` if either `$filterDaysBefore` or `$filterDaysAfter` are set. + * + * @var boolean + */ + private $shouldFilterByWindow = false; + + /** + * Creates the ICal object + * + * @param mixed $files + * @param array $options + * @return void + */ + public function __construct($files = false, array $options = array()) + { + ini_set('auto_detect_line_endings', '1'); + + foreach ($options as $option => $value) { + if (in_array($option, self::$configurableOptions)) { + $this->{$option} = $value; + } + } + + // Fallback to use the system default time zone + if (!isset($this->defaultTimeZone) || !$this->isValidTimeZoneId($this->defaultTimeZone)) { + $this->defaultTimeZone = date_default_timezone_get(); + } + + // Ideally you would use `PHP_INT_MIN` from PHP 7 + $php_int_min = -2147483648; + + $this->windowMinTimestamp = is_null($this->filterDaysBefore) ? $php_int_min : (new \DateTime('now'))->sub(new \DateInterval('P' . $this->filterDaysBefore . 'D'))->getTimestamp(); + $this->windowMaxTimestamp = is_null($this->filterDaysAfter) ? PHP_INT_MAX : (new \DateTime('now'))->add(new \DateInterval('P' . $this->filterDaysAfter . 'D'))->getTimestamp(); + + $this->shouldFilterByWindow = !is_null($this->filterDaysBefore) || !is_null($this->filterDaysAfter); + + if ($files !== false) { + $files = is_array($files) ? $files : array($files); + + foreach ($files as $file) { + if (!is_array($file) && $this->isFileOrUrl($file)) { + $lines = $this->fileOrUrl($file); + } else { + $lines = is_array($file) ? $file : array($file); + } + + $this->initLines($lines); + } + } + } + + /** + * Initialises lines from a string + * + * @param string $string + * @return ICal + */ + public function initString($string) + { + $string = str_replace(array("\r\n", "\n\r", "\r"), "\n", $string); + + if (empty($this->cal)) { + $lines = explode("\n", $string); + + $this->initLines($lines); + } else { + trigger_error('ICal::initString: Calendar already initialised in constructor', E_USER_NOTICE); + } + + return $this; + } + + /** + * Initialises lines from a file + * + * @param string $file + * @return ICal + */ + public function initFile($file) + { + if (empty($this->cal)) { + $lines = $this->fileOrUrl($file); + + $this->initLines($lines); + } else { + trigger_error('ICal::initFile: Calendar already initialised in constructor', E_USER_NOTICE); + } + + return $this; + } + + /** + * Initialises lines from a URL + * + * @param string $url + * @param string $username + * @param string $password + * @param string $userAgent + * @param string $acceptLanguage + * @return ICal + */ + public function initUrl($url, $username = null, $password = null, $userAgent = null, $acceptLanguage = null) + { + if (!is_null($username) && !is_null($password)) { + $this->httpBasicAuth['username'] = $username; + $this->httpBasicAuth['password'] = $password; + } + + if (!is_null($userAgent)) { + $this->httpUserAgent = $userAgent; + } + + if (!is_null($acceptLanguage)) { + $this->httpAcceptLanguage = $acceptLanguage; + } + + $this->initFile($url); + + return $this; + } + + /** + * Initialises the parser using an array + * containing each line of iCal content + * + * @param array $lines + * @return void + */ + protected function initLines(array $lines) + { + $lines = $this->unfold($lines); + + if (stristr($lines[0], 'BEGIN:VCALENDAR') !== false) { + $component = ''; + foreach ($lines as $line) { + $line = rtrim($line); // Trim trailing whitespace + $line = $this->removeUnprintableChars($line); + + if (empty($line)) { + continue; + } + + if (!$this->disableCharacterReplacement) { + $line = $this->cleanData($line); + } + + $add = $this->keyValueFromString($line); + + if ($add === false) { + continue; + } + + $keyword = $add[0]; + $values = $add[1]; // May be an array containing multiple values + + if (!is_array($values)) { + if (!empty($values)) { + $values = array($values); // Make an array as not already + $blankArray = array(); // Empty placeholder array + array_push($values, $blankArray); + } else { + $values = array(); // Use blank array to ignore this line + } + } elseif (empty($values[0])) { + $values = array(); // Use blank array to ignore this line + } + + // Reverse so that our array of properties is processed first + $values = array_reverse($values); + + foreach ($values as $value) { + switch ($line) { + // https://www.kanzaki.com/docs/ical/vtodo.html + case 'BEGIN:VTODO': + if (!is_array($value)) { + $this->todoCount++; + } + + $component = 'VTODO'; + + break; + + // https://www.kanzaki.com/docs/ical/vevent.html + case 'BEGIN:VEVENT': + if (!is_array($value)) { + $this->eventCount++; + } + + $component = 'VEVENT'; + + break; + + // https://www.kanzaki.com/docs/ical/vfreebusy.html + case 'BEGIN:VFREEBUSY': + if (!is_array($value)) { + $this->freeBusyIndex++; + } + + $component = 'VFREEBUSY'; + + break; + + case 'BEGIN:VALARM': + if (!is_array($value)) { + $this->alarmCount++; + } + + $component = 'VALARM'; + + break; + + case 'END:VALARM': + $component = 'VEVENT'; + + break; + + case 'BEGIN:DAYLIGHT': + case 'BEGIN:STANDARD': + case 'BEGIN:VCALENDAR': + case 'BEGIN:VTIMEZONE': + $component = $value; + + break; + + case 'END:DAYLIGHT': + case 'END:STANDARD': + case 'END:VCALENDAR': + case 'END:VFREEBUSY': + case 'END:VTIMEZONE': + case 'END:VTODO': + $component = 'VCALENDAR'; + + break; + + case 'END:VEVENT': + if ($this->shouldFilterByWindow) { + $this->removeLastEventIfOutsideWindowAndNonRecurring(); + } + + $component = 'VCALENDAR'; + + break; + + default: + $this->addCalendarComponentWithKeyAndValue($component, $keyword, $value); + + break; + } + } + } + + $this->processEvents(); + + if (!$this->skipRecurrence) { + $this->processRecurrences(); + + // Apply changes to altered recurrence instances + if (!empty($this->alteredRecurrenceInstances)) { + $events = $this->cal['VEVENT']; + + foreach ($this->alteredRecurrenceInstances as $alteredRecurrenceInstance) { + if (isset($alteredRecurrenceInstance['altered-event'])) { + $alteredEvent = $alteredRecurrenceInstance['altered-event']; + $key = key($alteredEvent); + $events[$key] = $alteredEvent[$key]; + } + } + + $this->cal['VEVENT'] = $events; + } + } + + if ($this->shouldFilterByWindow) { + $this->reduceEventsToMinMaxRange(); + } + + $this->processDateConversions(); + } + } + + /** + * Removes the last event (i.e. most recently parsed) if its start date is outside the window spanned by + * `$windowMinTimestamp` / `$windowMaxTimestamp`. + * + * @return void + */ + protected function removeLastEventIfOutsideWindowAndNonRecurring() + { + $events = $this->cal['VEVENT']; + + if (!empty($events)) { + $lastIndex = count($events) - 1; + $lastEvent = $events[$lastIndex]; + + if ((!isset($lastEvent['RRULE']) || $lastEvent['RRULE'] === '') && $this->doesEventStartOutsideWindow($lastEvent)) { + $this->eventCount--; + + unset($events[$lastIndex]); + } + + $this->cal['VEVENT'] = $events; + } + } + + /** + * Reduces the number of events to the defined minimum and maximum range + * + * @return void + */ + protected function reduceEventsToMinMaxRange() + { + $events = (isset($this->cal['VEVENT'])) ? $this->cal['VEVENT'] : array(); + + if (!empty($events)) { + foreach ($events as $key => $anEvent) { + if ($anEvent === null) { + unset($events[$key]); + + continue; + } + + if ($this->doesEventStartOutsideWindow($anEvent)) { + $this->eventCount--; + + unset($events[$key]); + + continue; + } + } + + $this->cal['VEVENT'] = $events; + } + } + + /** + * Determines whether the event start date is outside `$windowMinTimestamp` / `$windowMaxTimestamp`. + * Returns `true` for invalid dates. + * + * @param array $event + * @return boolean + */ + protected function doesEventStartOutsideWindow(array $event) + { + return !$this->isValidDate($event['DTSTART']) || $this->isOutOfRange($event['DTSTART'], $this->windowMinTimestamp, $this->windowMaxTimestamp); + } + + /** + * Determines whether a valid iCalendar date is within a given range + * + * @param string $calendarDate + * @param integer $minTimestamp + * @param integer $maxTimestamp + * @return boolean + */ + protected function isOutOfRange($calendarDate, $minTimestamp, $maxTimestamp) + { + $timestamp = strtotime(explode('T', $calendarDate)[0]); + + return $timestamp < $minTimestamp || $timestamp > $maxTimestamp; + } + + /** + * Unfolds an iCal file in preparation for parsing + * (https://icalendar.org/iCalendar-RFC-5545/3-1-content-lines.html) + * + * @param array $lines + * @return array + */ + protected function unfold(array $lines) + { + $string = implode(PHP_EOL, $lines); + $string = preg_replace('/' . PHP_EOL . '[ \t]/', '', $string); + + $lines = explode(PHP_EOL, $string); + + return $lines; + } + + /** + * Add one key and value pair to the `$this->cal` array + * + * @param string $component + * @param string|boolean $keyword + * @param string $value + * @return void + */ + protected function addCalendarComponentWithKeyAndValue($component, $keyword, $value) + { + if ($keyword == false) { + $keyword = $this->lastKeyword; + } + + switch ($component) { + case 'VALARM': + $key1 = 'VEVENT'; + $key2 = ($this->eventCount - 1); + $key3 = $component; + + if (!isset($this->cal[$key1][$key2][$key3]["{$keyword}_array"])) { + $this->cal[$key1][$key2][$key3]["{$keyword}_array"] = array(); + } + + if (is_array($value)) { + // Add array of properties to the end + array_push($this->cal[$key1][$key2][$key3]["{$keyword}_array"], $value); + } else { + if (!isset($this->cal[$key1][$key2][$key3][$keyword])) { + $this->cal[$key1][$key2][$key3][$keyword] = $value; + } + + if ($this->cal[$key1][$key2][$key3][$keyword] !== $value) { + $this->cal[$key1][$key2][$key3][$keyword] .= ',' . $value; + } + } + break; + + case 'VEVENT': + $key1 = $component; + $key2 = ($this->eventCount - 1); + + if (!isset($this->cal[$key1][$key2]["{$keyword}_array"])) { + $this->cal[$key1][$key2]["{$keyword}_array"] = array(); + } + + if (is_array($value)) { + // Add array of properties to the end + array_push($this->cal[$key1][$key2]["{$keyword}_array"], $value); + } else { + if (!isset($this->cal[$key1][$key2][$keyword])) { + $this->cal[$key1][$key2][$keyword] = $value; + } + + if ($keyword === 'EXDATE') { + if (trim($value) === $value) { + $array = array_filter(explode(',', $value)); + $this->cal[$key1][$key2]["{$keyword}_array"][] = $array; + } else { + $value = explode(',', implode(',', $this->cal[$key1][$key2]["{$keyword}_array"][1]) . trim($value)); + $this->cal[$key1][$key2]["{$keyword}_array"][1] = $value; + } + } else { + $this->cal[$key1][$key2]["{$keyword}_array"][] = $value; + + if ($keyword === 'DURATION') { + $duration = new \DateInterval($value); + array_push($this->cal[$key1][$key2]["{$keyword}_array"], $duration); + } + } + + if ($this->cal[$key1][$key2][$keyword] !== $value) { + $this->cal[$key1][$key2][$keyword] .= ',' . $value; + } + } + break; + + case 'VFREEBUSY': + $key1 = $component; + $key2 = ($this->freeBusyIndex - 1); + $key3 = $keyword; + + if ($keyword === 'FREEBUSY') { + if (is_array($value)) { + $this->cal[$key1][$key2][$key3][][] = $value; + } else { + $this->freeBusyCount++; + + end($this->cal[$key1][$key2][$key3]); + $key = key($this->cal[$key1][$key2][$key3]); + + $value = explode('/', $value); + $this->cal[$key1][$key2][$key3][$key][] = $value; + } + } else { + $this->cal[$key1][$key2][$key3][] = $value; + } + break; + + case 'VTODO': + $this->cal[$component][$this->todoCount - 1][$keyword] = $value; + + break; + + default: + $this->cal[$component][$keyword] = $value; + + break; + } + + $this->lastKeyword = $keyword; + } + + /** + * Gets the key value pair from an iCal string + * + * @param string $text + * @return array|boolean + */ + protected function keyValueFromString($text) + { + $text = htmlspecialchars($text, ENT_NOQUOTES, 'UTF-8'); + + $colon = strpos($text, ':'); + $quote = strpos($text, '"'); + if ($colon === false) { + $matches = array(); + } elseif ($quote === false || $colon < $quote) { + list($before, $after) = explode(':', $text, 2); + $matches = array($text, $before, $after); + } else { + list($before, $text) = explode('"', $text, 2); + $text = '"' . $text; + $matches = str_getcsv($text, ':'); + $combinedValue = ''; + + foreach (array_keys($matches) as $key) { + if ($key === 0) { + if (!empty($before)) { + $matches[$key] = $before . '"' . $matches[$key] . '"'; + } + } else { + if ($key > 1) { + $combinedValue .= ':'; + } + + $combinedValue .= $matches[$key]; + } + } + + $matches = array_slice($matches, 0, 2); + $matches[1] = $combinedValue; + array_unshift($matches, $before . $text); + } + + if (count($matches) === 0) { + return false; + } + + if (preg_match('/^([A-Z-]+)([;][\w\W]*)?$/', $matches[1])) { + $matches = array_splice($matches, 1, 2); // Remove first match and re-align ordering + + // Process properties + if (preg_match('/([A-Z-]+)[;]([\w\W]*)/', $matches[0], $properties)) { + // Remove first match + array_shift($properties); + // Fix to ignore everything in keyword after a ; (e.g. Language, TZID, etc.) + $matches[0] = $properties[0]; + array_shift($properties); // Repeat removing first match + + $formatted = array(); + foreach ($properties as $property) { + // Match semicolon separator outside of quoted substrings + preg_match_all('~[^' . PHP_EOL . '";]+(?:"[^"\\\]*(?:\\\.[^"\\\]*)*"[^' . PHP_EOL . '";]*)*~', $property, $attributes); + // Remove multi-dimensional array and use the first key + $attributes = (count($attributes) === 0) ? array($property) : reset($attributes); + + if (is_array($attributes)) { + foreach ($attributes as $attribute) { + // Match equals sign separator outside of quoted substrings + preg_match_all( + '~[^' . PHP_EOL . '"=]+(?:"[^"\\\]*(?:\\\.[^"\\\]*)*"[^' . PHP_EOL . '"=]*)*~', + $attribute, + $values + ); + // Remove multi-dimensional array and use the first key + $value = (count($values) === 0) ? null : reset($values); + + if (is_array($value) && isset($value[1])) { + // Remove double quotes from beginning and end only + $formatted[$value[0]] = trim($value[1], '"'); + } + } + } + } + + // Assign the keyword property information + $properties[0] = $formatted; + + // Add match to beginning of array + array_unshift($properties, $matches[1]); + $matches[1] = $properties; + } + + return $matches; + } else { + return false; // Ignore this match + } + } + + /** + * Returns a `DateTime` object from an iCal date time format + * + * @param string $icalDate + * @return \DateTime + * @throws \Exception + */ + public function iCalDateToDateTime($icalDate) + { + /** + * iCal times may be in 3 formats, (https://www.kanzaki.com/docs/ical/dateTime.html) + * + * UTC: Has a trailing 'Z' + * Floating: No time zone reference specified, no trailing 'Z', use local time + * TZID: Set time zone as specified + * + * Use DateTime class objects to get around limitations with `mktime` and `gmmktime`. + * Must have a local time zone set to process floating times. + */ + $pattern = '/^(?:TZID=)?([^:]*|".*")'; // [1]: Time zone + $pattern .= ':?'; // Time zone delimiter + $pattern .= '([0-9]{8})'; // [2]: YYYYMMDD + $pattern .= 'T?'; // Time delimiter + $pattern .= '(?(?<=T)([0-9]{6}))'; // [3]: HHMMSS (filled if delimiter present) + $pattern .= '(Z?)/'; // [4]: UTC flag + + preg_match($pattern, $icalDate, $date); + + if (empty($date)) { + throw new \Exception('Invalid iCal date format.'); + } + + // A Unix timestamp usually cannot represent a date prior to 1 Jan 1970. + // PHP, on the other hand, uses negative numbers for that. Thus we don't + // need to special case them. + + if ($date[4] === 'Z') { + $dateTimeZone = new \DateTimeZone(self::TIME_ZONE_UTC); + } elseif (!empty($date[1])) { + $dateTimeZone = $this->timeZoneStringToDateTimeZone($date[1]); + } else { + $dateTimeZone = new \DateTimeZone($this->defaultTimeZone); + } + + // The exclamation mark at the start of the format string indicates that if a + // time portion is not included, the time in the returned DateTime should be + // set to 00:00:00. Without it, the time would be set to the current system time. + $dateFormat = '!Ymd'; + $dateBasic = $date[2]; + if (!empty($date[3])) { + $dateBasic .= "T{$date[3]}"; + $dateFormat .= '\THis'; + } + + return \DateTime::createFromFormat($dateFormat, $dateBasic, $dateTimeZone); + } + + /** + * Returns a Unix timestamp from an iCal date time format + * + * @param string $icalDate + * @return integer + */ + public function iCalDateToUnixTimestamp($icalDate) + { + return $this->iCalDateToDateTime($icalDate)->getTimestamp(); + } + + /** + * Returns a date adapted to the calendar time zone depending on the event `TZID` + * + * @param array $event + * @param string $key + * @param string $format + * @return string|boolean + */ + public function iCalDateWithTimeZone(array $event, $key, $format = self::DATE_TIME_FORMAT) + { + if (!isset($event["{$key}_array"]) || !isset($event[$key])) { + return false; + } + + $dateArray = $event["{$key}_array"]; + + if ($key === 'DURATION') { + $dateTime = $this->parseDuration($event['DTSTART'], $dateArray[2], null); + } else { + // When constructing from a Unix Timestamp, no time zone needs passing. + $dateTime = new \DateTime("@{$dateArray[2]}"); + } + + // Set the time zone we wish to use when running `$dateTime->format`. + $dateTime->setTimezone(new \DateTimeZone($this->calendarTimeZone())); + + if (is_null($format)) { + return $dateTime; + } + + return $dateTime->format($format); + } + + /** + * Performs admin tasks on all events as read from the iCal file. + * Adds a Unix timestamp to all `{DTSTART|DTEND|RECURRENCE-ID}_array` arrays + * Tracks modified recurrence instances + * + * @return void + */ + protected function processEvents() + { + $checks = null; + $events = (isset($this->cal['VEVENT'])) ? $this->cal['VEVENT'] : array(); + + if (!empty($events)) { + foreach ($events as $key => $anEvent) { + foreach (array('DTSTART', 'DTEND', 'RECURRENCE-ID') as $type) { + if (isset($anEvent[$type])) { + $date = $anEvent["{$type}_array"][1]; + + if (isset($anEvent["{$type}_array"][0]['TZID'])) { + $timeZone = $this->escapeParamText($anEvent["{$type}_array"][0]['TZID']); + $date = sprintf(self::ICAL_DATE_TIME_TEMPLATE, $timeZone) . $date; + } + + $anEvent["{$type}_array"][2] = $this->iCalDateToUnixTimestamp($date); + $anEvent["{$type}_array"][3] = $date; + } + } + + if (isset($anEvent['RECURRENCE-ID'])) { + $uid = $anEvent['UID']; + + if (!isset($this->alteredRecurrenceInstances[$uid])) { + $this->alteredRecurrenceInstances[$uid] = array(); + } + + $recurrenceDateUtc = $this->iCalDateToUnixTimestamp($anEvent['RECURRENCE-ID_array'][3]); + $this->alteredRecurrenceInstances[$uid][$key] = $recurrenceDateUtc; + } + + $events[$key] = $anEvent; + } + + $eventKeysToRemove = array(); + + foreach ($events as $key => $event) { + $checks[] = !isset($event['RECURRENCE-ID']); + $checks[] = isset($event['UID']); + $checks[] = isset($event['UID']) && isset($this->alteredRecurrenceInstances[$event['UID']]); + + if ((bool) array_product($checks)) { + $eventDtstartUnix = $this->iCalDateToUnixTimestamp($event['DTSTART_array'][3]); + + // phpcs:ignore CustomPHPCS.ControlStructures.AssignmentInCondition + if (($alteredEventKey = array_search($eventDtstartUnix, $this->alteredRecurrenceInstances[$event['UID']])) !== false) { + $eventKeysToRemove[] = $alteredEventKey; + + $alteredEvent = array_replace_recursive($events[$key], $events[$alteredEventKey]); + $this->alteredRecurrenceInstances[$event['UID']]['altered-event'] = array($key => $alteredEvent); + } + } + + unset($checks); + } + + foreach ($eventKeysToRemove as $eventKeyToRemove) { + $events[$eventKeyToRemove] = null; + } + + $this->cal['VEVENT'] = $events; + } + } + + /** + * Processes recurrence rules + * + * @return void + */ + protected function processRecurrences() + { + $events = (isset($this->cal['VEVENT'])) ? $this->cal['VEVENT'] : array(); + + // If there are no events, then we have nothing to process. + if (empty($events)) { + return; + } + + $allEventRecurrences = array(); + $eventKeysToRemove = array(); + + foreach ($events as $key => $anEvent) { + if (!isset($anEvent['RRULE']) || $anEvent['RRULE'] === '') { + continue; + } + + // Tag as generated by a recurrence rule + $anEvent['RRULE_array'][2] = self::RECURRENCE_EVENT; + + // Create new initial starting point. + $initialEventDate = $this->icalDateToDateTime($anEvent['DTSTART_array'][3]); + + // Separate the RRULE stanzas, and explode the values that are lists. + $rrules = array(); + foreach (explode(';', $anEvent['RRULE']) as $s) { + list($k, $v) = explode('=', $s); + if (in_array($k, array('BYSETPOS', 'BYDAY', 'BYMONTHDAY', 'BYMONTH', 'BYYEARDAY', 'BYWEEKNO'))) { + $rrules[$k] = explode(',', $v); + } else { + $rrules[$k] = $v; + } + } + + // Get frequency + $frequency = $rrules['FREQ']; + + // Reject RRULE if BYDAY stanza is invalid: + // > The BYDAY rule part MUST NOT be specified with a numeric value + // > when the FREQ rule part is not set to MONTHLY or YEARLY. + // > Furthermore, the BYDAY rule part MUST NOT be specified with a + // > numeric value with the FREQ rule part set to YEARLY when the + // > BYWEEKNO rule part is specified. + if (isset($rrules['BYDAY'])) { + $checkByDays = function ($carry, $weekday) { + return $carry && substr($weekday, -2) === $weekday; + }; + if (!in_array($frequency, array('MONTHLY', 'YEARLY'))) { + if (!array_reduce($rrules['BYDAY'], $checkByDays, true)) { + error_log("ICal::ProcessRecurrences: A {$frequency} RRULE may not contain BYDAY values with numeric prefixes"); + + continue; + } + } elseif ($frequency === 'YEARLY' && !empty($rrules['BYWEEKNO'])) { + if (!array_reduce($rrules['BYDAY'], $checkByDays, true)) { + error_log('ICal::ProcessRecurrences: A YEARLY RRULE with a BYWEEKNO part may not contain BYDAY values with numeric prefixes'); + + continue; + } + } + } + + // Get Interval + $interval = (empty($rrules['INTERVAL'])) ? 1 : $rrules['INTERVAL']; + + // Throw an error if this isn't an integer. + if (!is_int($this->defaultSpan)) { + trigger_error('ICal::defaultSpan: User defined value is not an integer', E_USER_NOTICE); + } + + // Compute EXDATEs + $exdates = $this->parseExdates($anEvent); + + // Determine if the initial date is also an EXDATE + $initialDateIsExdate = array_reduce($exdates, function ($carry, $exdate) use ($initialEventDate) { + return $carry || $exdate->getTimestamp() == $initialEventDate->getTimestamp(); + }, false); + + if ($initialDateIsExdate) { + $eventKeysToRemove[] = $key; + } + + /** + * Determine at what point we should stop calculating recurrences + * by looking at the UNTIL or COUNT rrule stanza, or, if neither + * if set, using a fallback. + * + * If the initial date is also an EXDATE, it shouldn't be included + * in the count. + * + * Syntax: + * UNTIL={enddate} + * COUNT= + * + * Where: + * enddate = || + */ + $count = 1; + $countLimit = (isset($rrules['COUNT'])) ? intval($rrules['COUNT']) : 0; + $until = date_create()->modify("{$this->defaultSpan} years")->setTime(23, 59, 59)->getTimestamp(); + + if (isset($rrules['UNTIL'])) { + $until = min($until, $this->iCalDateToUnixTimestamp($rrules['UNTIL'])); + } + + $eventRecurrences = array(); + + $frequencyRecurringDateTime = clone $initialEventDate; + while ($frequencyRecurringDateTime->getTimestamp() <= $until) { + $candidateDateTimes = array(); + + // phpcs:ignore Squiz.ControlStructures.SwitchDeclaration.MissingDefault + switch ($frequency) { + case 'DAILY': + if (!empty($rrules['BYMONTHDAY'])) { + if (!isset($monthDays)) { + // This variable is unset when we change months (see below) + $monthDays = $this->getDaysOfMonthMatchingByMonthDayRRule($rrules['BYMONTHDAY'], $frequencyRecurringDateTime); + } + + if (!in_array($frequencyRecurringDateTime->format('j'), $monthDays)) { + break; + } + } + + $candidateDateTimes[] = clone $frequencyRecurringDateTime; + + break; + + case 'WEEKLY': + $initialDayOfWeek = $frequencyRecurringDateTime->format('N'); + $matchingDays = array($initialDayOfWeek); + + if (!empty($rrules['BYDAY'])) { + // setISODate() below uses the ISO-8601 specification of weeks: start on + // a Monday, end on a Sunday. However, RRULEs (or the caller of the + // parser) may state an alternate WeeKSTart. + $wkstTransition = 7; + + if (empty($rrules['WKST'])) { + if ($this->defaultWeekStart !== self::ISO_8601_WEEK_START) { + $wkstTransition = array_search($this->defaultWeekStart, array_keys($this->weekdays)); + } + } elseif ($rrules['WKST'] !== self::ISO_8601_WEEK_START) { + $wkstTransition = array_search($rrules['WKST'], array_keys($this->weekdays)); + } + + $matchingDays = array_map( + function ($weekday) use ($initialDayOfWeek, $wkstTransition, $interval) { + $day = array_search($weekday, array_keys($this->weekdays)); + + if ($day < $initialDayOfWeek) { + $day += 7; + } + + if ($day >= $wkstTransition) { + $day += 7 * ($interval - 1); + } + + // Ignoring alternate week starts, $day at this point will have a + // value between 0 and 6. But setISODate() expects a value of 1 to 7. + // Even with alternate week starts, we still need to +1 to set the + // correct weekday. + $day++; + + return $day; + }, + $rrules['BYDAY'] + ); + } + + sort($matchingDays); + + foreach ($matchingDays as $day) { + $clonedDateTime = clone $frequencyRecurringDateTime; + $candidateDateTimes[] = $clonedDateTime->setISODate( + $frequencyRecurringDateTime->format('o'), + $frequencyRecurringDateTime->format('W'), + $day + ); + } + break; + + case 'MONTHLY': + $matchingDays = array(); + + if (!empty($rrules['BYMONTHDAY'])) { + $matchingDays = $this->getDaysOfMonthMatchingByMonthDayRRule($rrules['BYMONTHDAY'], $frequencyRecurringDateTime); + if (!empty($rrules['BYDAY'])) { + $matchingDays = array_filter( + $this->getDaysOfMonthMatchingByDayRRule($rrules['BYDAY'], $frequencyRecurringDateTime), + function ($monthDay) use ($matchingDays) { + return in_array($monthDay, $matchingDays); + } + ); + } + } elseif (!empty($rrules['BYDAY'])) { + $matchingDays = $this->getDaysOfMonthMatchingByDayRRule($rrules['BYDAY'], $frequencyRecurringDateTime); + } + + if (!empty($rrules['BYSETPOS'])) { + $matchingDays = $this->filterValuesUsingBySetPosRRule($rrules['BYSETPOS'], $matchingDays); + } + + foreach ($matchingDays as $day) { + // Skip invalid dates (e.g. 30th February) + if ($day > $frequencyRecurringDateTime->format('t')) { + continue; + } + + $clonedDateTime = clone $frequencyRecurringDateTime; + $candidateDateTimes[] = $clonedDateTime->setDate( + $frequencyRecurringDateTime->format('Y'), + $frequencyRecurringDateTime->format('m'), + $day + ); + } + break; + + case 'YEARLY': + $matchingDays = array(); + + if (!empty($rrules['BYMONTH'])) { + $bymonthRecurringDatetime = clone $frequencyRecurringDateTime; + foreach ($rrules['BYMONTH'] as $byMonth) { + $bymonthRecurringDatetime->setDate( + $frequencyRecurringDateTime->format('Y'), + $byMonth, + $frequencyRecurringDateTime->format('d') + ); + + // Determine the days of the month affected + // (The interaction between BYMONTHDAY and BYDAY is resolved later.) + $monthDays = array(); + if (!empty($rrules['BYMONTHDAY'])) { + $monthDays = $this->getDaysOfMonthMatchingByMonthDayRRule($rrules['BYMONTHDAY'], $bymonthRecurringDatetime); + } elseif (!empty($rrules['BYDAY'])) { + $monthDays = $this->getDaysOfMonthMatchingByDayRRule($rrules['BYDAY'], $bymonthRecurringDatetime); + } else { + $monthDays[] = $bymonthRecurringDatetime->format('d'); + } + + // And add each of them to the list of recurrences + foreach ($monthDays as $day) { + $matchingDays[] = $bymonthRecurringDatetime->setDate( + $frequencyRecurringDateTime->format('Y'), + $bymonthRecurringDatetime->format('m'), + $day + )->format('z') + 1; + } + } + } elseif (!empty($rrules['BYWEEKNO'])) { + $matchingDays = $this->getDaysOfYearMatchingByWeekNoRRule($rrules['BYWEEKNO'], $frequencyRecurringDateTime); + } elseif (!empty($rrules['BYYEARDAY'])) { + $matchingDays = $this->getDaysOfYearMatchingByYearDayRRule($rrules['BYYEARDAY'], $frequencyRecurringDateTime); + } elseif (!empty($rrules['BYMONTHDAY'])) { + $matchingDays = $this->getDaysOfYearMatchingByMonthDayRRule($rrules['BYMONTHDAY'], $frequencyRecurringDateTime); + } + + if (!empty($rrules['BYDAY'])) { + if (!empty($rrules['BYYEARDAY']) || !empty($rrules['BYMONTHDAY']) || !empty($rrules['BYWEEKNO'])) { + $matchingDays = array_filter( + $this->getDaysOfYearMatchingByDayRRule($rrules['BYDAY'], $frequencyRecurringDateTime), + function ($yearDay) use ($matchingDays) { + return in_array($yearDay, $matchingDays); + } + ); + } elseif (count($matchingDays) === 0) { + $matchingDays = $this->getDaysOfYearMatchingByDayRRule($rrules['BYDAY'], $frequencyRecurringDateTime); + } + } + + if (count($matchingDays) === 0) { + $matchingDays = array($frequencyRecurringDateTime->format('z') + 1); + } else { + sort($matchingDays); + } + + if (!empty($rrules['BYSETPOS'])) { + $matchingDays = $this->filterValuesUsingBySetPosRRule($rrules['BYSETPOS'], $matchingDays); + } + + foreach ($matchingDays as $day) { + $clonedDateTime = clone $frequencyRecurringDateTime; + $candidateDateTimes[] = $clonedDateTime->setDate( + $frequencyRecurringDateTime->format('Y'), + 1, + $day + ); + } + break; + } + + foreach ($candidateDateTimes as $candidate) { + $timestamp = $candidate->getTimestamp(); + if ($timestamp <= $initialEventDate->getTimestamp()) { + continue; + } + + if ($timestamp > $until) { + break; + } + + // Exclusions + $isExcluded = array_filter($exdates, function ($exdate) use ($timestamp) { + return $exdate->getTimestamp() == $timestamp; + }); + + if (isset($this->alteredRecurrenceInstances[$anEvent['UID']])) { + if (in_array($timestamp, $this->alteredRecurrenceInstances[$anEvent['UID']])) { + $isExcluded = true; + } + } + + if (!$isExcluded) { + $eventRecurrences[] = $candidate; + $this->eventCount++; + } + + // Count all evaluated candidates including excluded ones + if (isset($rrules['COUNT'])) { + $count++; + + // If RRULE[COUNT] is reached then break + if ($count >= $countLimit) { + break 2; + } + } + } + + // Move forwards $interval $frequency. + $monthPreMove = $frequencyRecurringDateTime->format('m'); + $frequencyRecurringDateTime->modify("{$interval} {$this->frequencyConversion[$frequency]}"); + + // As noted in Example #2 on https://www.php.net/manual/en/datetime.modify.php, + // there are some occasions where adding months doesn't give the month you might + // expect. For instance: January 31st + 1 month == March 3rd (March 2nd on a leap + // year.) The following code crudely rectifies this. + if ($frequency === 'MONTHLY') { + $monthDiff = $frequencyRecurringDateTime->format('m') - $monthPreMove; + + if (($monthDiff > 0 && $monthDiff > $interval) || ($monthDiff < 0 && $monthDiff > $interval - 12)) { + $frequencyRecurringDateTime->modify('-1 month'); + } + } + + // $monthDays is set in the DAILY frequency if the BYMONTHDAY stanza is present in + // the RRULE. The variable only needs to be updated when we change months, so we + // unset it here, prompting a recreation next iteration. + if (isset($monthDays) && $frequencyRecurringDateTime->format('m') !== $monthPreMove) { + unset($monthDays); + } + } + + unset($monthDays); // Unset it here as well, so it doesn't bleed into the calculation of the next recurring event. + + // Determine event length + $eventLength = 0; + if (isset($anEvent['DURATION'])) { + $clonedDateTime = clone $initialEventDate; + $endDate = $clonedDateTime->add($anEvent['DURATION_array'][2]); + $eventLength = $endDate->getTimestamp() - $anEvent['DTSTART_array'][2]; + } elseif (isset($anEvent['DTEND_array'])) { + $eventLength = $anEvent['DTEND_array'][2] - $anEvent['DTSTART_array'][2]; + } + + // Whether or not the initial date was UTC + $initialDateWasUTC = substr($anEvent['DTSTART'], -1) === 'Z'; + + // Build the param array + $dateParamArray = array(); + if ( + !$initialDateWasUTC + && isset($anEvent['DTSTART_array'][0]['TZID']) + && $this->isValidTimeZoneId($anEvent['DTSTART_array'][0]['TZID']) + ) { + $dateParamArray['TZID'] = $anEvent['DTSTART_array'][0]['TZID']; + } + + // Populate the `DT{START|END}[_array]`s + $eventRecurrences = array_map( + function ($recurringDatetime) use ($anEvent, $eventLength, $initialDateWasUTC, $dateParamArray) { + $tzidPrefix = (isset($dateParamArray['TZID'])) ? 'TZID=' . $this->escapeParamText($dateParamArray['TZID']) . ':' : ''; + + foreach (array('DTSTART', 'DTEND') as $dtkey) { + $anEvent[$dtkey] = $recurringDatetime->format(self::DATE_TIME_FORMAT) . (($initialDateWasUTC) ? 'Z' : ''); + + $anEvent["{$dtkey}_array"] = array( + $dateParamArray, // [0] Array of params (incl. TZID) + $anEvent[$dtkey], // [1] ICalDateTime string w/o TZID + $recurringDatetime->getTimestamp(), // [2] Unix Timestamp + "{$tzidPrefix}{$anEvent[$dtkey]}", // [3] Full ICalDateTime string + ); + + if ($dtkey !== 'DTEND') { + $recurringDatetime->modify("{$eventLength} seconds"); + } + } + + return $anEvent; + }, + $eventRecurrences + ); + + $allEventRecurrences = array_merge($allEventRecurrences, $eventRecurrences); + } + + // Nullify the initial events that are also EXDATEs + foreach ($eventKeysToRemove as $eventKeyToRemove) { + $events[$eventKeyToRemove] = null; + } + + $events = array_merge($events, $allEventRecurrences); + + $this->cal['VEVENT'] = $events; + } + + /** + * Resolves values from indices of the range 1 -> $limit. + * + * For instance, if passed [1, 4, -16] and 28, this will return [1, 4, 13]. + * + * @param array $indexes + * @param integer $limit + * @return array + */ + protected function resolveIndicesOfRange(array $indexes, $limit) + { + $matching = array(); + foreach ($indexes as $index) { + if ($index > 0 && $index <= $limit) { + $matching[] = $index; + } elseif ($index < 0 && -$index <= $limit) { + $matching[] = $index + $limit + 1; + } + } + + sort($matching); + + return $matching; + } + + /** + * Find all days of a month that match the BYDAY stanza of an RRULE. + * + * With no {ordwk}, then return the day number of every {weekday} + * within the month. + * + * With a +ve {ordwk}, then return the {ordwk} {weekday} within the + * month. + * + * With a -ve {ordwk}, then return the {ordwk}-to-last {weekday} + * within the month. + * + * RRule Syntax: + * BYDAY={bywdaylist} + * + * Where: + * bywdaylist = {weekdaynum}[,{weekdaynum}...] + * weekdaynum = [[+]{ordwk} || -{ordwk}]{weekday} + * ordwk = 1 to 53 + * weekday = SU || MO || TU || WE || TH || FR || SA + * + * @param array $byDays + * @param \DateTime $initialDateTime + * @return array + */ + protected function getDaysOfMonthMatchingByDayRRule(array $byDays, $initialDateTime) + { + $matchingDays = array(); + + foreach ($byDays as $weekday) { + $bydayDateTime = clone $initialDateTime; + + $ordwk = intval(substr($weekday, 0, -2)); + + // Quantise the date to the first instance of the requested day in a month + // (Or last if we have a -ve {ordwk}) + $bydayDateTime->modify( + (($ordwk < 0) ? 'Last' : 'First') . + ' ' . + $this->weekdays[substr($weekday, -2)] . // e.g. "Monday" + ' of ' . + $initialDateTime->format('F') // e.g. "June" + ); + + if ($ordwk < 0) { // -ve {ordwk} + $bydayDateTime->modify((++$ordwk) . ' week'); + $matchingDays[] = $bydayDateTime->format('j'); + } elseif ($ordwk > 0) { // +ve {ordwk} + $bydayDateTime->modify((--$ordwk) . ' week'); + $matchingDays[] = $bydayDateTime->format('j'); + } else { // No {ordwk} + while ($bydayDateTime->format('n') === $initialDateTime->format('n')) { + $matchingDays[] = $bydayDateTime->format('j'); + $bydayDateTime->modify('+1 week'); + } + } + } + + // Sort into ascending order + sort($matchingDays); + + return $matchingDays; + } + + /** + * Find all days of a month that match the BYMONTHDAY stanza of an RRULE. + * + * RRUle Syntax: + * BYMONTHDAY={bymodaylist} + * + * Where: + * bymodaylist = {monthdaynum}[,{monthdaynum}...] + * monthdaynum = ([+] || -) {ordmoday} + * ordmoday = 1 to 31 + * + * @param array $byMonthDays + * @param \DateTime $initialDateTime + * @return array + */ + protected function getDaysOfMonthMatchingByMonthDayRRule(array $byMonthDays, $initialDateTime) + { + return $this->resolveIndicesOfRange($byMonthDays, $initialDateTime->format('t')); + } + + /** + * Find all days of a year that match the BYDAY stanza of an RRULE. + * + * With no {ordwk}, then return the day number of every {weekday} + * within the year. + * + * With a +ve {ordwk}, then return the {ordwk} {weekday} within the + * year. + * + * With a -ve {ordwk}, then return the {ordwk}-to-last {weekday} + * within the year. + * + * RRule Syntax: + * BYDAY={bywdaylist} + * + * Where: + * bywdaylist = {weekdaynum}[,{weekdaynum}...] + * weekdaynum = [[+]{ordwk} || -{ordwk}]{weekday} + * ordwk = 1 to 53 + * weekday = SU || MO || TU || WE || TH || FR || SA + * + * @param array $byDays + * @param \DateTime $initialDateTime + * @return array + */ + protected function getDaysOfYearMatchingByDayRRule(array $byDays, $initialDateTime) + { + $matchingDays = array(); + + foreach ($byDays as $weekday) { + $bydayDateTime = clone $initialDateTime; + + $ordwk = intval(substr($weekday, 0, -2)); + + // Quantise the date to the first instance of the requested day in a year + // (Or last if we have a -ve {ordwk}) + $bydayDateTime->modify( + (($ordwk < 0) ? 'Last' : 'First') . + ' ' . + $this->weekdays[substr($weekday, -2)] . // e.g. "Monday" + ' of ' . (($ordwk < 0) ? 'December' : 'January') . + ' ' . $initialDateTime->format('Y') // e.g. "2018" + ); + + if ($ordwk < 0) { // -ve {ordwk} + $bydayDateTime->modify((++$ordwk) . ' week'); + $matchingDays[] = $bydayDateTime->format('z') + 1; + } elseif ($ordwk > 0) { // +ve {ordwk} + $bydayDateTime->modify((--$ordwk) . ' week'); + $matchingDays[] = $bydayDateTime->format('z') + 1; + } else { // No {ordwk} + while ($bydayDateTime->format('Y') === $initialDateTime->format('Y')) { + $matchingDays[] = $bydayDateTime->format('z') + 1; + $bydayDateTime->modify('+1 week'); + } + } + } + + // Sort into ascending order + sort($matchingDays); + + return $matchingDays; + } + + /** + * Find all days of a year that match the BYYEARDAY stanza of an RRULE. + * + * RRUle Syntax: + * BYYEARDAY={byyrdaylist} + * + * Where: + * byyrdaylist = {yeardaynum}[,{yeardaynum}...] + * yeardaynum = ([+] || -) {ordyrday} + * ordyrday = 1 to 366 + * + * @param array $byYearDays + * @param \DateTime $initialDateTime + * @return array + */ + protected function getDaysOfYearMatchingByYearDayRRule(array $byYearDays, $initialDateTime) + { + // `\DateTime::format('L')` returns 1 if leap year, 0 if not. + $daysInThisYear = $initialDateTime->format('L') ? 366 : 365; + + return $this->resolveIndicesOfRange($byYearDays, $daysInThisYear); + } + + /** + * Find all days of a year that match the BYWEEKNO stanza of an RRULE. + * + * Unfortunately, the RFC5545 specification does not specify exactly + * how BYWEEKNO should expand on the initial DTSTART when provided + * without any other stanzas. + * + * A comparison of expansions used by other ics parsers may be found + * at https://github.com/s0600204/ics-parser-1/wiki/byweekno + * + * This method uses the same expansion as the python-dateutil module. + * + * RRUle Syntax: + * BYWEEKNO={bywknolist} + * + * Where: + * bywknolist = {weeknum}[,{weeknum}...] + * weeknum = ([+] || -) {ordwk} + * ordwk = 1 to 53 + * + * @param array $byWeekNums + * @param \DateTime $initialDateTime + * @return array + */ + protected function getDaysOfYearMatchingByWeekNoRRule(array $byWeekNums, $initialDateTime) + { + // `\DateTime::format('L')` returns 1 if leap year, 0 if not. + $isLeapYear = $initialDateTime->format('L'); + $firstDayOfTheYear = date_create("first day of January {$initialDateTime->format('Y')}")->format('D'); + $weeksInThisYear = ($firstDayOfTheYear === 'Thu' || $isLeapYear && $firstDayOfTheYear === 'Wed') ? 53 : 52; + + $matchingWeeks = $this->resolveIndicesOfRange($byWeekNums, $weeksInThisYear); + $matchingDays = array(); + $byweekDateTime = clone $initialDateTime; + foreach ($matchingWeeks as $weekNum) { + $dayNum = $byweekDateTime->setISODate( + $initialDateTime->format('Y'), + $weekNum, + 1 + )->format('z') + 1; + for ($x = 0; $x < 7; ++$x) { + $matchingDays[] = $x + $dayNum; + } + } + + sort($matchingDays); + + return $matchingDays; + } + + /** + * Find all days of a year that match the BYMONTHDAY stanza of an RRULE. + * + * RRule Syntax: + * BYMONTHDAY={bymodaylist} + * + * Where: + * bymodaylist = {monthdaynum}[,{monthdaynum}...] + * monthdaynum = ([+] || -) {ordmoday} + * ordmoday = 1 to 31 + * + * @param array $byMonthDays + * @param \DateTime $initialDateTime + * @return array + */ + protected function getDaysOfYearMatchingByMonthDayRRule(array $byMonthDays, $initialDateTime) + { + $matchingDays = array(); + $monthDateTime = clone $initialDateTime; + for ($month = 1; $month < 13; $month++) { + $monthDateTime->setDate( + $initialDateTime->format('Y'), + $month, + 1 + ); + + $monthDays = $this->getDaysOfMonthMatchingByMonthDayRRule($byMonthDays, $monthDateTime); + foreach ($monthDays as $day) { + $matchingDays[] = $monthDateTime->setDate( + $initialDateTime->format('Y'), + $monthDateTime->format('m'), + $day + )->format('z') + 1; + } + } + + return $matchingDays; + } + + /** + * Filters a provided values-list by applying a BYSETPOS RRule. + * + * Where a +ve {daynum} is provided, the {ordday} position'd value as + * measured from the start of the list of values should be retained. + * + * Where a -ve {daynum} is provided, the {ordday} position'd value as + * measured from the end of the list of values should be retained. + * + * RRule Syntax: + * BYSETPOS={bysplist} + * + * Where: + * bysplist = {setposday}[,{setposday}...] + * setposday = {daynum} + * daynum = [+ || -] {ordday} + * ordday = 1 to 366 + * + * @param array $bySetPos + * @param array $valuesList + * @return array + */ + protected function filterValuesUsingBySetPosRRule(array $bySetPos, array $valuesList) + { + $filteredMatches = array(); + + foreach ($bySetPos as $setPosition) { + if ($setPosition < 0) { + $setPosition = count($valuesList) + ++$setPosition; + } + + // Positioning starts at 1, array indexes start at 0 + if (isset($valuesList[$setPosition - 1])) { + $filteredMatches[] = $valuesList[$setPosition - 1]; + } + } + + return $filteredMatches; + } + + /** + * Processes date conversions using the time zone + * + * Add keys `DTSTART_tz` and `DTEND_tz` to each Event + * These keys contain dates adapted to the calendar + * time zone depending on the event `TZID`. + * + * @return void + * @throws \Exception + */ + protected function processDateConversions() + { + $events = (isset($this->cal['VEVENT'])) ? $this->cal['VEVENT'] : array(); + + if (!empty($events)) { + foreach ($events as $key => $anEvent) { + if (is_null($anEvent) || !$this->isValidDate($anEvent['DTSTART'])) { + unset($events[$key]); + $this->eventCount--; + + continue; + } + + $events[$key]['DTSTART_tz'] = $this->iCalDateWithTimeZone($anEvent, 'DTSTART'); + + if ($this->iCalDateWithTimeZone($anEvent, 'DTEND')) { + $events[$key]['DTEND_tz'] = $this->iCalDateWithTimeZone($anEvent, 'DTEND'); + } elseif ($this->iCalDateWithTimeZone($anEvent, 'DURATION')) { + $events[$key]['DTEND_tz'] = $this->iCalDateWithTimeZone($anEvent, 'DURATION'); + } else { + $events[$key]['DTEND_tz'] = $events[$key]['DTSTART_tz']; + } + } + + $this->cal['VEVENT'] = $events; + } + } + + /** + * Returns an array of Events. + * Every event is a class with the event + * details being properties within it. + * + * @return array + */ + public function events() + { + $array = $this->cal; + $array = isset($array['VEVENT']) ? $array['VEVENT'] : array(); + + $events = array(); + + if (!empty($array)) { + foreach ($array as $event) { + $events[] = new Event($event); + } + } + + return $events; + } + + /** + * Returns the calendar name + * + * @return string + */ + public function calendarName() + { + return isset($this->cal['VCALENDAR']['X-WR-CALNAME']) ? $this->cal['VCALENDAR']['X-WR-CALNAME'] : ''; + } + + /** + * Returns the calendar description + * + * @return string + */ + public function calendarDescription() + { + return isset($this->cal['VCALENDAR']['X-WR-CALDESC']) ? $this->cal['VCALENDAR']['X-WR-CALDESC'] : ''; + } + + /** + * Returns the calendar time zone + * + * @param boolean $ignoreUtc + * @return string + */ + public function calendarTimeZone($ignoreUtc = false) + { + if (isset($this->cal['VCALENDAR']['X-WR-TIMEZONE'])) { + $timeZone = $this->cal['VCALENDAR']['X-WR-TIMEZONE']; + } elseif (isset($this->cal['VTIMEZONE']['TZID'])) { + $timeZone = $this->cal['VTIMEZONE']['TZID']; + } else { + $timeZone = $this->defaultTimeZone; + } + + // Validate the time zone, falling back to the time zone set in the PHP environment. + $timeZone = $this->timeZoneStringToDateTimeZone($timeZone)->getName(); + + if ($ignoreUtc && strtoupper($timeZone) === self::TIME_ZONE_UTC) { + return null; + } + + return $timeZone; + } + + /** + * Returns an array of arrays with all free/busy events. + * Every event is an associative array and each property + * is an element it. + * + * @return array + */ + public function freeBusyEvents() + { + $array = $this->cal; + + return isset($array['VFREEBUSY']) ? $array['VFREEBUSY'] : array(); + } + + /** + * Returns a boolean value whether the + * current calendar has events or not + * + * @return boolean + */ + public function hasEvents() + { + return (count($this->events()) > 0) ?: false; + } + + /** + * Returns a sorted array of the events in a given range, + * or an empty array if no events exist in the range. + * + * Events will be returned if the start or end date is contained within the + * range (inclusive), or if the event starts before and end after the range. + * + * If a start date is not specified or of a valid format, then the start + * of the range will default to the current time and date of the server. + * + * If an end date is not specified or of a valid format, then the end of + * the range will default to the current time and date of the server, + * plus 20 years. + * + * Note that this function makes use of Unix timestamps. This might be a + * problem for events on, during, or after 29 Jan 2038. + * See https://en.wikipedia.org/wiki/Unix_time#Representing_the_number + * + * @param string|null $rangeStart + * @param string|null $rangeEnd + * @return array + * @throws \Exception + */ + public function eventsFromRange($rangeStart = null, $rangeEnd = null) + { + // Sort events before processing range + $events = $this->sortEventsWithOrder($this->events()); + + if (empty($events)) { + return array(); + } + + $extendedEvents = array(); + + if (!is_null($rangeStart)) { + try { + $rangeStart = new \DateTime($rangeStart, new \DateTimeZone($this->defaultTimeZone)); + } catch (\Exception $exception) { + error_log("ICal::eventsFromRange: Invalid date passed ({$rangeStart})"); + $rangeStart = false; + } + } else { + $rangeStart = new \DateTime('now', new \DateTimeZone($this->defaultTimeZone)); + } + + if (!is_null($rangeEnd)) { + try { + $rangeEnd = new \DateTime($rangeEnd, new \DateTimeZone($this->defaultTimeZone)); + } catch (\Exception $exception) { + error_log("ICal::eventsFromRange: Invalid date passed ({$rangeEnd})"); + $rangeEnd = false; + } + } else { + $rangeEnd = new \DateTime('now', new \DateTimeZone($this->defaultTimeZone)); + $rangeEnd->modify('+20 years'); + } + + // If start and end are identical and are dates with no times... + if ($rangeEnd->format('His') == 0 && $rangeStart->getTimestamp() === $rangeEnd->getTimestamp()) { + $rangeEnd->modify('+1 day'); + } + + $rangeStart = $rangeStart->getTimestamp(); + $rangeEnd = $rangeEnd->getTimestamp(); + + foreach ($events as $anEvent) { + $eventStart = $anEvent->dtstart_array[2]; + $eventEnd = (isset($anEvent->dtend_array[2])) ? $anEvent->dtend_array[2] : null; + + if ( + ($eventStart >= $rangeStart && $eventStart < $rangeEnd) // Event start date contained in the range + || ($eventEnd !== null + && ( + ($eventEnd > $rangeStart && $eventEnd <= $rangeEnd) // Event end date contained in the range + || ($eventStart < $rangeStart && $eventEnd > $rangeEnd) // Event starts before and finishes after range + ) + ) + ) { + $extendedEvents[] = $anEvent; + } + } + + if (empty($extendedEvents)) { + return array(); + } + + return $extendedEvents; + } + + /** + * Returns a sorted array of the events following a given string, + * or `false` if no events exist in the range. + * + * @param string $interval + * @return array + */ + public function eventsFromInterval($interval) + { + $rangeStart = new \DateTime('now', new \DateTimeZone($this->defaultTimeZone)); + $rangeEnd = new \DateTime('now', new \DateTimeZone($this->defaultTimeZone)); + + $dateInterval = \DateInterval::createFromDateString($interval); + $rangeEnd->add($dateInterval); + + return $this->eventsFromRange($rangeStart->format('Y-m-d'), $rangeEnd->format('Y-m-d')); + } + + /** + * Sorts events based on a given sort order + * + * @param array $events + * @param integer $sortOrder Either SORT_ASC, SORT_DESC, SORT_REGULAR, SORT_NUMERIC, SORT_STRING + * @return array + */ + public function sortEventsWithOrder(array $events, $sortOrder = SORT_ASC) + { + $extendedEvents = array(); + $timestamp = array(); + + foreach ($events as $key => $anEvent) { + $extendedEvents[] = $anEvent; + $timestamp[$key] = $anEvent->dtstart_array[2]; + } + + array_multisort($timestamp, $sortOrder, $extendedEvents); + + return $extendedEvents; + } + + /** + * Checks if a time zone is valid (IANA, CLDR, or Windows) + * + * @param string $timeZone + * @return boolean + */ + protected function isValidTimeZoneId($timeZone) + { + return $this->isValidIanaTimeZoneId($timeZone) !== false + || $this->isValidCldrTimeZoneId($timeZone) !== false + || $this->isValidWindowsTimeZoneId($timeZone) !== false; + } + + /** + * Checks if a time zone is a valid IANA time zone + * + * @param string $timeZone + * @return boolean + */ + protected function isValidIanaTimeZoneId($timeZone) + { + if (in_array($timeZone, $this->validIanaTimeZones)) { + return true; + } + + $valid = array(); + $tza = timezone_abbreviations_list(); + + foreach ($tza as $zone) { + foreach ($zone as $item) { + $valid[$item['timezone_id']] = true; + } + } + + unset($valid['']); + + if (isset($valid[$timeZone]) || in_array($timeZone, timezone_identifiers_list(\DateTimeZone::ALL_WITH_BC))) { + $this->validIanaTimeZones[] = $timeZone; + + return true; + } + + return false; + } + + /** + * Checks if a time zone is a valid CLDR time zone + * + * @param string $timeZone + * @return boolean + */ + public function isValidCldrTimeZoneId($timeZone) + { + return array_key_exists(html_entity_decode($timeZone), self::$cldrTimeZonesMap); + } + + /** + * Checks if a time zone is a recognised Windows (non-CLDR) time zone + * + * @param string $timeZone + * @return boolean + */ + public function isValidWindowsTimeZoneId($timeZone) + { + return array_key_exists(html_entity_decode($timeZone), self::$windowsTimeZonesMap); + } + + /** + * Parses a duration and applies it to a date + * + * @param string $date + * @param string $duration + * @param string $format + * @return integer|\DateTime + */ + protected function parseDuration($date, $duration, $format = self::UNIX_FORMAT) + { + $dateTime = date_create($date); + $dateTime->modify("{$duration->y} year"); + $dateTime->modify("{$duration->m} month"); + $dateTime->modify("{$duration->d} day"); + $dateTime->modify("{$duration->h} hour"); + $dateTime->modify("{$duration->i} minute"); + $dateTime->modify("{$duration->s} second"); + + if (is_null($format)) { + $output = $dateTime; + } elseif ($format === self::UNIX_FORMAT) { + $output = $dateTime->getTimestamp(); + } else { + $output = $dateTime->format($format); + } + + return $output; + } + + /** + * Removes unprintable ASCII and UTF-8 characters + * + * @param string $data + * @return string + */ + protected function removeUnprintableChars($data) + { + return preg_replace('/[\x00-\x1F\x7F\xA0]/u', '', $data); + } + + /** + * Provides a polyfill for PHP 7.2's `mb_chr()`, which is a multibyte safe version of `chr()`. + * Multibyte safe. + * + * @param integer $code + * @return string + */ + protected function mb_chr($code) // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps + { + if (function_exists('mb_chr')) { + return mb_chr($code); + } else { + if (($code %= 0x200000) < 0x80) { + $s = chr($code); + } elseif ($code < 0x800) { + $s = chr(0xc0 | $code >> 6) . chr(0x80 | $code & 0x3f); + } elseif ($code < 0x10000) { + $s = chr(0xe0 | $code >> 12) . chr(0x80 | $code >> 6 & 0x3f) . chr(0x80 | $code & 0x3f); + } else { + $s = chr(0xf0 | $code >> 18) . chr(0x80 | $code >> 12 & 0x3f) . chr(0x80 | $code >> 6 & 0x3f) . chr(0x80 | $code & 0x3f); + } + + return $s; + } + } + + /** + * Replace all occurrences of the search string with the replacement string. + * Multibyte safe. + * + * @param string|array $search + * @param string|array $replace + * @param string|array $subject + * @param string $encoding + * @param integer $count + * @return array|string + */ + protected static function mb_str_replace($search, $replace, $subject, $encoding = null, &$count = 0) // phpcs:ignore PSR1.Methods.CamelCapsMethodName.NotCamelCaps + { + if (is_array($subject)) { + // Call `mb_str_replace()` for each subject in the array, recursively + foreach ($subject as $key => $value) { + $subject[$key] = self::mb_str_replace($search, $replace, $value, $encoding, $count); + } + } else { + // Normalize $search and $replace so they are both arrays of the same length + $searches = is_array($search) ? array_values($search) : array($search); + $replacements = is_array($replace) ? array_values($replace) : array($replace); + $replacements = array_pad($replacements, count($searches), ''); + + foreach ($searches as $key => $search) { + if (is_null($encoding)) { + $encoding = mb_detect_encoding($search, 'UTF-8', true); + } + + $replace = $replacements[$key]; + $searchLen = mb_strlen($search, $encoding); + + $sb = array(); + while (($offset = mb_strpos($subject, $search, 0, $encoding)) !== false) { + $sb[] = mb_substr($subject, 0, $offset, $encoding); + $subject = mb_substr($subject, $offset + $searchLen, null, $encoding); + ++$count; + } + + $sb[] = $subject; + $subject = implode($replace, $sb); + } + } + + return $subject; + } + + /** + * Places double-quotes around texts that have characters not permitted + * in parameter-texts, but are permitted in quoted-texts. + * + * @param string $candidateText + * @return string + */ + protected function escapeParamText($candidateText) + { + if (strpbrk($candidateText, ':;,') !== false) { + return '"' . $candidateText . '"'; + } + + return $candidateText; + } + + /** + * Replaces curly quotes and other special characters + * with their standard equivalents + * + * @param string $data + * @return string + */ + protected function cleanData($data) + { + $replacementChars = array( + "\xe2\x80\x98" => "'", // ‘ + "\xe2\x80\x99" => "'", // ’ + "\xe2\x80\x9a" => "'", // ‚ + "\xe2\x80\x9b" => "'", // ‛ + "\xe2\x80\x9c" => '"', // “ + "\xe2\x80\x9d" => '"', // ” + "\xe2\x80\x9e" => '"', // „ + "\xe2\x80\x9f" => '"', // ‟ + "\xe2\x80\x93" => '-', // – + "\xe2\x80\x94" => '--', // — + "\xe2\x80\xa6" => '...', // … + "\xc2\xa0" => ' ', + ); + // Replace UTF-8 characters + $cleanedData = strtr($data, $replacementChars); + + // Replace Windows-1252 equivalents + $charsToReplace = array_map(function ($code) { + return $this->mb_chr($code); + }, array(133, 145, 146, 147, 148, 150, 151, 194)); + $cleanedData = $this->mb_str_replace($charsToReplace, $replacementChars, $cleanedData); + + return $cleanedData; + } + + /** + * Parses a list of excluded dates + * to be applied to an Event + * + * @param array $event + * @return array + */ + public function parseExdates(array $event) + { + if (empty($event['EXDATE_array'])) { + return array(); + } else { + $exdates = $event['EXDATE_array']; + } + + $output = array(); + $currentTimeZone = new \DateTimeZone($this->defaultTimeZone); + + foreach ($exdates as $subArray) { + end($subArray); + $finalKey = key($subArray); + + foreach (array_keys($subArray) as $key) { + if ($key === 'TZID') { + $currentTimeZone = $this->timeZoneStringToDateTimeZone($subArray[$key]); + } elseif (is_numeric($key)) { + $icalDate = $subArray[$key]; + + if (substr($icalDate, -1) === 'Z') { + $currentTimeZone = new \DateTimeZone(self::TIME_ZONE_UTC); + } + + $output[] = new \DateTime($icalDate, $currentTimeZone); + + if ($key === $finalKey) { + // Reset to default + $currentTimeZone = new \DateTimeZone($this->defaultTimeZone); + } + } + } + } + + return $output; + } + + /** + * Checks if a date string is a valid date + * + * @param string $value + * @return boolean + * @throws \Exception + */ + public function isValidDate($value) + { + if (!$value) { + return false; + } + + try { + new \DateTime($value); + + return true; + } catch (\Exception $exception) { + return false; + } + } + + /** + * Checks if a filename exists as a file or URL + * + * @param string $filename + * @return boolean + */ + protected function isFileOrUrl($filename) + { + return (file_exists($filename) || filter_var($filename, FILTER_VALIDATE_URL)) ?: false; + } + + /** + * Reads an entire file or URL into an array + * + * @param string $filename + * @return array + * @throws \Exception + */ + protected function fileOrUrl($filename) + { + $options = array(); + if (!empty($this->httpBasicAuth) || !empty($this->httpUserAgent) || !empty($this->httpAcceptLanguage)) { + $options['http'] = array(); + $options['http']['header'] = array(); + + if (!empty($this->httpBasicAuth)) { + $username = $this->httpBasicAuth['username']; + $password = $this->httpBasicAuth['password']; + $basicAuth = base64_encode("{$username}:{$password}"); + + array_push($options['http']['header'], "Authorization: Basic {$basicAuth}"); + } + + if (!empty($this->httpUserAgent)) { + array_push($options['http']['header'], "User-Agent: {$this->httpUserAgent}"); + } + + if (!empty($this->httpAcceptLanguage)) { + array_push($options['http']['header'], "Accept-language: {$this->httpAcceptLanguage}"); + } + } + + $context = stream_context_create($options); + + // phpcs:ignore CustomPHPCS.ControlStructures.AssignmentInCondition + if (($lines = file($filename, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES, $context)) === false) { + throw new \Exception("The file path or URL '{$filename}' does not exist."); + } + + return $lines; + } + + /** + * Returns a `DateTimeZone` object based on a string containing a time zone name. + * Falls back to the default time zone if string passed not a recognised time zone. + * + * @param string $timeZoneString + * @return \DateTimeZone + */ + public function timeZoneStringToDateTimeZone($timeZoneString) + { + // Some time zones contain characters that are not permitted in param-texts, + // but are within quoted texts. We need to remove the quotes as they're not + // actually part of the time zone. + $timeZoneString = trim($timeZoneString, '"'); + $timeZoneString = html_entity_decode($timeZoneString); + + if ($this->isValidIanaTimeZoneId($timeZoneString)) { + return new \DateTimeZone($timeZoneString); + } + + if ($this->isValidCldrTimeZoneId($timeZoneString)) { + return new \DateTimeZone(self::$cldrTimeZonesMap[$timeZoneString]); + } + + if ($this->isValidWindowsTimeZoneId($timeZoneString)) { + return new \DateTimeZone(self::$windowsTimeZonesMap[$timeZoneString]); + } + + return new \DateTimeZone($this->defaultTimeZone); + } +} diff --git a/app/vendor/johngrogg/ics-parser/tests/RecurrencesTest.php b/app/vendor/johngrogg/ics-parser/tests/RecurrencesTest.php new file mode 100755 index 0000000..6b3b2ef --- /dev/null +++ b/app/vendor/johngrogg/ics-parser/tests/RecurrencesTest.php @@ -0,0 +1,531 @@ +originalTimeZone = date_default_timezone_get(); + } + + public function tearDown() + { + date_default_timezone_set($this->originalTimeZone); + } + + public function testYearlyFullDayTimeZoneBerlin() + { + $checks = array( + array('index' => 0, 'dateString' => '20000301', 'message' => '1st event, CET: '), + array('index' => 1, 'dateString' => '20010301T000000', 'message' => '2nd event, CET: '), + array('index' => 2, 'dateString' => '20020301T000000', 'message' => '3rd event, CET: '), + ); + $this->assertVEVENT( + 'Europe/Berlin', + array( + 'DTSTART;VALUE=DATE:20000301', + 'DTEND;VALUE=DATE:20000302', + 'RRULE:FREQ=YEARLY;WKST=SU;COUNT=3', + ), + 3, + $checks + ); + } + + public function testMonthlyFullDayTimeZoneBerlin() + { + $checks = array( + array('index' => 0, 'dateString' => '20000301', 'message' => '1st event, CET: '), + array('index' => 1, 'dateString' => '20000401T000000', 'message' => '2nd event, CEST: '), + array('index' => 2, 'dateString' => '20000501T000000', 'message' => '3rd event, CEST: '), + ); + $this->assertVEVENT( + 'Europe/Berlin', + array( + 'DTSTART;VALUE=DATE:20000301', + 'DTEND;VALUE=DATE:20000302', + 'RRULE:FREQ=MONTHLY;BYMONTHDAY=1;WKST=SU;COUNT=3', + ), + 3, + $checks + ); + } + + public function testMonthlyFullDayTimeZoneBerlinSummerTime() + { + $checks = array( + array('index' => 0, 'dateString' => '20180701', 'message' => '1st event, CEST: '), + array('index' => 1, 'dateString' => '20180801T000000', 'message' => '2nd event, CEST: '), + array('index' => 2, 'dateString' => '20180901T000000', 'message' => '3rd event, CEST: '), + ); + $this->assertVEVENT( + 'Europe/Berlin', + array( + 'DTSTART;VALUE=DATE:20180701', + 'DTEND;VALUE=DATE:20180702', + 'RRULE:FREQ=MONTHLY;BYMONTHDAY=1;WKST=SU;COUNT=3', + ), + 3, + $checks + ); + } + + public function testMonthlyFullDayTimeZoneBerlinFromFile() + { + $checks = array( + array('index' => 0, 'dateString' => '20180701', 'message' => '1st event, CEST: '), + array('index' => 1, 'dateString' => '20180801T000000', 'message' => '2nd event, CEST: '), + array('index' => 2, 'dateString' => '20180901T000000', 'message' => '3rd event, CEST: '), + ); + $this->assertEventFile( + 'Europe/Berlin', + './tests/ical/ical-monthly.ics', + 25, + $checks + ); + } + + public function testIssue196FromFile() + { + $checks = array( + array('index' => 0, 'dateString' => '20191105T190000', 'timezone' => 'Europe/Berlin', 'message' => '1st event, CEST: '), + array('index' => 1, 'dateString' => '20191106T190000', 'timezone' => 'Europe/Berlin', 'message' => '2nd event, CEST: '), + array('index' => 2, 'dateString' => '20191107T190000', 'timezone' => 'Europe/Berlin', 'message' => '3rd event, CEST: '), + array('index' => 3, 'dateString' => '20191108T190000', 'timezone' => 'Europe/Berlin', 'message' => '4th event, CEST: '), + array('index' => 4, 'dateString' => '20191109T170000', 'timezone' => 'Europe/Berlin', 'message' => '5th event, CEST: '), + array('index' => 5, 'dateString' => '20191110T180000', 'timezone' => 'Europe/Berlin', 'message' => '6th event, CEST: '), + ); + $this->assertEventFile( + 'UTC', + './tests/ical/issue-196.ics', + 7, + $checks + ); + } + + public function testWeeklyFullDayTimeZoneBerlin() + { + $checks = array( + array('index' => 0, 'dateString' => '20000301', 'message' => '1st event, CET: '), + array('index' => 1, 'dateString' => '20000308T000000', 'message' => '2nd event, CET: '), + array('index' => 2, 'dateString' => '20000315T000000', 'message' => '3rd event, CET: '), + array('index' => 3, 'dateString' => '20000322T000000', 'message' => '4th event, CET: '), + array('index' => 4, 'dateString' => '20000329T000000', 'message' => '5th event, CEST: '), + array('index' => 5, 'dateString' => '20000405T000000', 'message' => '6th event, CEST: '), + ); + $this->assertVEVENT( + 'Europe/Berlin', + array( + 'DTSTART;VALUE=DATE:20000301', + 'DTEND;VALUE=DATE:20000302', + 'RRULE:FREQ=WEEKLY;WKST=SU;COUNT=6', + ), + 6, + $checks + ); + } + + public function testDailyFullDayTimeZoneBerlin() + { + $checks = array( + array('index' => 0, 'dateString' => '20000301', 'message' => '1st event, CET: '), + array('index' => 1, 'dateString' => '20000302T000000', 'message' => '2nd event, CET: '), + array('index' => 30, 'dateString' => '20000331T000000', 'message' => '31st event, CEST: '), + ); + $this->assertVEVENT( + 'Europe/Berlin', + array( + 'DTSTART;VALUE=DATE:20000301', + 'DTEND;VALUE=DATE:20000302', + 'RRULE:FREQ=DAILY;WKST=SU;COUNT=31', + ), + 31, + $checks + ); + } + + public function testWeeklyFullDayTimeZoneBerlinLocal() + { + $checks = array( + array('index' => 0, 'dateString' => '20000301T000000', 'message' => '1st event, CET: '), + array('index' => 1, 'dateString' => '20000308T000000', 'message' => '2nd event, CET: '), + array('index' => 2, 'dateString' => '20000315T000000', 'message' => '3rd event, CET: '), + array('index' => 3, 'dateString' => '20000322T000000', 'message' => '4th event, CET: '), + array('index' => 4, 'dateString' => '20000329T000000', 'message' => '5th event, CEST: '), + array('index' => 5, 'dateString' => '20000405T000000', 'message' => '6th event, CEST: '), + ); + $this->assertVEVENT( + 'Europe/Berlin', + array( + 'DTSTART;TZID=Europe/Berlin:20000301T000000', + 'DTEND;TZID=Europe/Berlin:20000302T000000', + 'RRULE:FREQ=WEEKLY;WKST=SU;COUNT=6', + ), + 6, + $checks + ); + } + + public function testRFCDaily10NewYork() + { + $checks = array( + array('index' => 0, 'dateString' => '19970902T090000', 'timezone' => 'America/New_York', 'message' => '1st event, EDT: '), + array('index' => 1, 'dateString' => '19970903T090000', 'timezone' => 'America/New_York', 'message' => '2nd event, EDT: '), + array('index' => 9, 'dateString' => '19970911T090000', 'timezone' => 'America/New_York', 'message' => '10th event, EDT: '), + ); + $this->assertVEVENT( + 'Europe/Berlin', + array( + 'DTSTART;TZID=America/New_York:19970902T090000', + 'RRULE:FREQ=DAILY;COUNT=10', + ), + 10, + $checks + ); + } + + public function testRFCDaily10Berlin() + { + $checks = array( + array('index' => 0, 'dateString' => '19970902T090000', 'timezone' => 'Europe/Berlin', 'message' => '1st event, CEST: '), + array('index' => 1, 'dateString' => '19970903T090000', 'timezone' => 'Europe/Berlin', 'message' => '2nd event, CEST: '), + array('index' => 9, 'dateString' => '19970911T090000', 'timezone' => 'Europe/Berlin', 'message' => '10th event, CEST: '), + ); + $this->assertVEVENT( + 'Europe/Berlin', + array( + 'DTSTART;TZID=Europe/Berlin:19970902T090000', + 'RRULE:FREQ=DAILY;COUNT=10', + ), + 10, + $checks + ); + } + + public function testStartDateIsExdateUsingUntil() + { + $checks = array( + array('index' => 0, 'dateString' => '20190918T095000', 'timezone' => 'Europe/London', 'message' => '1st event: '), + array('index' => 1, 'dateString' => '20191002T095000', 'timezone' => 'Europe/London', 'message' => '2nd event: '), + array('index' => 2, 'dateString' => '20191016T095000', 'timezone' => 'Europe/London', 'message' => '3rd event: '), + ); + $this->assertVEVENT( + 'Europe/London', + array( + 'DTSTART;TZID=Europe/London:20190911T095000', + 'RRULE:FREQ=WEEKLY;WKST=SU;UNTIL=20191027T235959Z;BYDAY=WE', + 'EXDATE;TZID=Europe/London:20191023T095000', + 'EXDATE;TZID=Europe/London:20191009T095000', + 'EXDATE;TZID=Europe/London:20190925T095000', + 'EXDATE;TZID=Europe/London:20190911T095000', + ), + 3, + $checks + ); + } + + public function testStartDateIsExdateUsingCount() + { + $checks = array( + array('index' => 0, 'dateString' => '20190918T095000', 'timezone' => 'Europe/London', 'message' => '1st event: '), + array('index' => 1, 'dateString' => '20191002T095000', 'timezone' => 'Europe/London', 'message' => '2nd event: '), + array('index' => 2, 'dateString' => '20191016T095000', 'timezone' => 'Europe/London', 'message' => '3rd event: '), + ); + $this->assertVEVENT( + 'Europe/London', + array( + 'DTSTART;TZID=Europe/London:20190911T095000', + 'RRULE:FREQ=WEEKLY;WKST=SU;COUNT=7;BYDAY=WE', + 'EXDATE;TZID=Europe/London:20191023T095000', + 'EXDATE;TZID=Europe/London:20191009T095000', + 'EXDATE;TZID=Europe/London:20190925T095000', + 'EXDATE;TZID=Europe/London:20190911T095000', + ), + 3, + $checks + ); + } + + public function testCountWithExdate() + { + $checks = array( + array('index' => 0, 'dateString' => '20200323T050000', 'timezone' => 'Europe/Paris', 'message' => '1st event: '), + array('index' => 1, 'dateString' => '20200324T050000', 'timezone' => 'Europe/Paris', 'message' => '2nd event: '), + array('index' => 2, 'dateString' => '20200327T050000', 'timezone' => 'Europe/Paris', 'message' => '3rd event: '), + ); + $this->assertVEVENT( + 'Europe/London', + array( + 'DTSTART;TZID=Europe/Paris:20200323T050000', + 'DTEND;TZID=Europe/Paris:20200323T070000', + 'RRULE:FREQ=DAILY;COUNT=5', + 'EXDATE;TZID=Europe/Paris:20200326T050000', + 'EXDATE;TZID=Europe/Paris:20200325T050000', + 'DTSTAMP:20200318T141057Z', + ), + 3, + $checks + ); + } + + public function testRFCDaily10BerlinFromNewYork() + { + $checks = array( + array('index' => 0, 'dateString' => '19970902T090000', 'timezone' => 'Europe/Berlin', 'message' => '1st event, CEST: '), + array('index' => 1, 'dateString' => '19970903T090000', 'timezone' => 'Europe/Berlin', 'message' => '2nd event, CEST: '), + array('index' => 9, 'dateString' => '19970911T090000', 'timezone' => 'Europe/Berlin', 'message' => '10th event, CEST: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=Europe/Berlin:19970902T090000', + 'RRULE:FREQ=DAILY;COUNT=10', + ), + 10, + $checks + ); + } + + public function testExdatesInDifferentTimezone() + { + $checks = array( + array('index' => 0, 'dateString' => '20170503T190000', 'message' => '1st event: '), + array('index' => 1, 'dateString' => '20170510T190000', 'message' => '2nd event: '), + array('index' => 9, 'dateString' => '20170712T190000', 'message' => '10th event: '), + array('index' => 19, 'dateString' => '20171004T190000', 'message' => '20th event: '), + ); + $this->assertVEVENT( + 'America/Chicago', + array( + 'DTSTART;TZID=America/Chicago:20170503T190000', + 'RRULE:FREQ=WEEKLY;BYDAY=WE;WKST=SU;UNTIL=20180101', + 'EXDATE:20170601T000000Z', + 'EXDATE:20170803T000000Z', + 'EXDATE:20170824T000000Z', + 'EXDATE:20171026T000000Z', + 'EXDATE:20171102T000000Z', + 'EXDATE:20171123T010000Z', + 'EXDATE:20171221T010000Z', + ), + 28, + $checks + ); + } + + public function testYearlyWithBySetPos() + { + $checks = array( + array('index' => 0, 'dateString' => '19970306T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19970313T090000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19970325T090000', 'message' => '3rd occurrence: '), + array('index' => 3, 'dateString' => '19980305T090000', 'message' => '4th occurrence: '), + array('index' => 4, 'dateString' => '19980312T090000', 'message' => '5th occurrence: '), + array('index' => 5, 'dateString' => '19980326T090000', 'message' => '6th occurrence: '), + array('index' => 9, 'dateString' => '20000307T090000', 'message' => '10th occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970306T090000', + 'RRULE:FREQ=YEARLY;COUNT=10;BYMONTH=3;BYDAY=TU,TH;BYSETPOS=2,4,-2', + ), + 10, + $checks + ); + } + + public function testDailyWithByMonthDay() + { + $checks = array( + array('index' => 0, 'dateString' => '20000206T120000', 'message' => '1st event: '), + array('index' => 1, 'dateString' => '20000211T120000', 'message' => '2nd event: '), + array('index' => 2, 'dateString' => '20000216T120000', 'message' => '3rd event: '), + array('index' => 4, 'dateString' => '20000226T120000', 'message' => '5th event, transition from February to March: '), + array('index' => 5, 'dateString' => '20000301T120000', 'message' => '6th event, transition to March from February: '), + array('index' => 11, 'dateString' => '20000331T120000', 'message' => '12th event, transition from March to April: '), + array('index' => 12, 'dateString' => '20000401T120000', 'message' => '13th event, transition to April from March: '), + ); + $this->assertVEVENT( + 'Europe/Berlin', + array( + 'DTSTART:20000206T120000', + 'DTEND:20000206T130000', + 'RRULE:FREQ=DAILY;BYMONTHDAY=1,6,11,16,21,26,31;COUNT=16', + ), + 16, + $checks + ); + } + + public function testYearlyWithByMonthDay() + { + $checks = array( + array('index' => 0, 'dateString' => '20001214T120000', 'message' => '1st event: '), + array('index' => 1, 'dateString' => '20001221T120000', 'message' => '2nd event: '), + array('index' => 2, 'dateString' => '20010107T120000', 'message' => '3rd event: '), + array('index' => 3, 'dateString' => '20010114T120000', 'message' => '4th event: '), + array('index' => 6, 'dateString' => '20010214T120000', 'message' => '7th event: '), + ); + $this->assertVEVENT( + 'Europe/Berlin', + array( + 'DTSTART:20001214T120000', + 'DTEND:20001214T130000', + 'RRULE:FREQ=YEARLY;BYMONTHDAY=7,14,21;COUNT=8', + ), + 8, + $checks + ); + } + + public function testYearlyWithByMonthDayAndByDay() + { + $checks = array( + array('index' => 0, 'dateString' => '20001214T120000', 'message' => '1st event: '), + array('index' => 1, 'dateString' => '20001221T120000', 'message' => '2nd event: '), + array('index' => 2, 'dateString' => '20010607T120000', 'message' => '3rd event: '), + array('index' => 3, 'dateString' => '20010614T120000', 'message' => '4th event: '), + array('index' => 6, 'dateString' => '20020214T120000', 'message' => '7th event: '), + ); + $this->assertVEVENT( + 'Europe/Berlin', + array( + 'DTSTART:20001214T120000', + 'DTEND:20001214T130000', + 'RRULE:FREQ=YEARLY;BYMONTHDAY=7,14,21;BYDAY=TH;COUNT=8', + ), + 8, + $checks + ); + } + + public function testYearlyWithByMonthAndByMonthDay() + { + $checks = array( + array('index' => 0, 'dateString' => '20001214T120000', 'message' => '1st event: '), + array('index' => 1, 'dateString' => '20001221T120000', 'message' => '2nd event: '), + array('index' => 2, 'dateString' => '20010607T120000', 'message' => '3rd event: '), + array('index' => 3, 'dateString' => '20010614T120000', 'message' => '4th event: '), + array('index' => 6, 'dateString' => '20011214T120000', 'message' => '7th event: '), + ); + $this->assertVEVENT( + 'Europe/Berlin', + array( + 'DTSTART:20001214T120000', + 'DTEND:20001214T130000', + 'RRULE:FREQ=YEARLY;BYMONTH=12,6;BYMONTHDAY=7,14,21;COUNT=8', + ), + 8, + $checks + ); + } + + public function assertVEVENT($defaultTimezone, $veventParts, $count, $checks) + { + $options = $this->getOptions($defaultTimezone); + + $testIcal = implode(PHP_EOL, $this->getIcalHeader()); + $testIcal .= PHP_EOL; + $testIcal .= implode(PHP_EOL, $this->formatIcalEvent($veventParts)); + $testIcal .= PHP_EOL; + $testIcal .= implode(PHP_EOL, $this->getIcalFooter()); + + $ical = new ICal(false, $options); + $ical->initString($testIcal); + + $events = $ical->events(); + + $this->assertCount($count, $events); + + foreach ($checks as $check) { + $this->assertEvent($events[$check['index']], $check['dateString'], $check['message'], isset($check['timezone']) ? $check['timezone'] : $defaultTimezone); + } + } + + public function assertEventFile($defaultTimezone, $file, $count, $checks) + { + $options = $this->getOptions($defaultTimezone); + + $ical = new ICal($file, $options); + + $events = $ical->events(); + + $this->assertCount($count, $events); + + $events = $ical->sortEventsWithOrder($events); + + foreach ($checks as $check) { + $this->assertEvent($events[$check['index']], $check['dateString'], $check['message'], isset($check['timezone']) ? $check['timezone'] : $defaultTimezone); + } + } + + public function assertEvent($event, $expectedDateString, $message, $timeZone = null) + { + if (!is_null($timeZone)) { + date_default_timezone_set($timeZone); + } + + $expectedTimeStamp = strtotime($expectedDateString); + + $this->assertEquals($expectedTimeStamp, $event->dtstart_array[2], $message . 'timestamp mismatch (expected ' . $expectedDateString . ' vs actual ' . $event->dtstart . ')'); + $this->assertAttributeEquals($expectedDateString, 'dtstart', $event, $message . 'dtstart mismatch (timestamp is okay)'); + } + + public function getOptions($defaultTimezone) + { + $options = array( + 'defaultSpan' => 2, // Default value + 'defaultTimeZone' => $defaultTimezone, // Default value: UTC + 'defaultWeekStart' => 'MO', // Default value + 'disableCharacterReplacement' => false, // Default value + 'filterDaysAfter' => null, // Default value + 'filterDaysBefore' => null, // Default value + 'skipRecurrence' => false, // Default value + ); + + return $options; + } + + public function formatIcalEvent($veventParts) + { + return array_merge( + array( + 'BEGIN:VEVENT', + 'CREATED:' . gmdate('Ymd\THis\Z'), + 'UID:M2CD-1-1-5FB000FB-BBE4-4F3F-9E7E-217F1FF97209', + ), + $veventParts, + array( + 'SUMMARY:test', + 'LAST-MODIFIED:' . gmdate('Ymd\THis\Z', filemtime(__FILE__)), + 'END:VEVENT', + ) + ); + } + + public function getIcalHeader() + { + return array( + 'BEGIN:VCALENDAR', + 'VERSION:2.0', + 'PRODID:-//Google Inc//Google Calendar 70.9054//EN', + 'X-WR-CALNAME:Private', + 'X-APPLE-CALENDAR-COLOR:#FF2968', + 'X-WR-CALDESC:', + ); + } + + public function getIcalFooter() + { + return array('END:VCALENDAR'); + } +} diff --git a/app/vendor/johngrogg/ics-parser/tests/SingleEventsTest.php b/app/vendor/johngrogg/ics-parser/tests/SingleEventsTest.php new file mode 100755 index 0000000..3794c1f --- /dev/null +++ b/app/vendor/johngrogg/ics-parser/tests/SingleEventsTest.php @@ -0,0 +1,501 @@ +originalTimeZone = date_default_timezone_get(); + } + + public function tearDown() + { + date_default_timezone_set($this->originalTimeZone); + } + + public function testFullDayTimeZoneBerlin() + { + $checks = array( + array('index' => 0, 'dateString' => '20000301', 'message' => '1st event, CET: '), + ); + $this->assertVEVENT( + 'Europe/Berlin', + 'DTSTART;VALUE=DATE:20000301', + 'DTEND;VALUE=DATE:20000302', + 1, + $checks + ); + } + + public function testSeveralFullDaysTimeZoneBerlin() + { + $checks = array( + array('index' => 0, 'dateString' => '20000301', 'message' => '1st event, CET: '), + ); + $this->assertVEVENT( + 'Europe/Berlin', + 'DTSTART;VALUE=DATE:20000301', + 'DTEND;VALUE=DATE:20000304', + 1, + $checks + ); + } + + public function testEventTimeZoneUTC() + { + $checks = array( + array('index' => 0, 'dateString' => '20180626T070000Z', 'message' => '1st event, UTC: '), + ); + $this->assertVEVENT( + 'Europe/Berlin', + 'DTSTART:20180626T070000Z', + 'DTEND:20180626T110000Z', + 1, + $checks + ); + } + + public function testEventTimeZoneBerlin() + { + $checks = array( + array('index' => 0, 'dateString' => '20180626T070000', 'message' => '1st event, CEST: '), + ); + $this->assertVEVENT( + 'Europe/Berlin', + 'DTSTART:20180626T070000', + 'DTEND:20180626T110000', + 1, + $checks + ); + } + + public function assertVEVENT($defaultTimezone, $dtstart, $dtend, $count, $checks) + { + $options = $this->getOptions($defaultTimezone); + + $testIcal = implode(PHP_EOL, $this->getIcalHeader()); + $testIcal .= PHP_EOL; + $testIcal .= implode(PHP_EOL, $this->formatIcalEvent($dtstart, $dtend)); + $testIcal .= PHP_EOL; + $testIcal .= implode(PHP_EOL, $this->getIcalTimezones()); + $testIcal .= PHP_EOL; + $testIcal .= implode(PHP_EOL, $this->getIcalFooter()); + + date_default_timezone_set('UTC'); + + $ical = new ICal(false, $options); + $ical->initString($testIcal); + + $events = $ical->events(); + + $this->assertCount($count, $events); + + foreach ($checks as $check) { + $this->assertEvent( + $events[$check['index']], + $check['dateString'], + $check['message'], + isset($check['timezone']) ? $check['timezone'] : $defaultTimezone + ); + } + } + + public function getOptions($defaultTimezone) + { + $options = array( + 'defaultSpan' => 2, // Default value + 'defaultTimeZone' => $defaultTimezone, // Default value: UTC + 'defaultWeekStart' => 'MO', // Default value + 'disableCharacterReplacement' => false, // Default value + 'filterDaysAfter' => null, // Default value + 'filterDaysBefore' => null, // Default value + 'skipRecurrence' => false, // Default value + ); + + return $options; + } + + public function getIcalHeader() + { + return array( + 'BEGIN:VCALENDAR', + 'VERSION:2.0', + 'PRODID:-//Google Inc//Google Calendar 70.9054//EN', + 'X-WR-CALNAME:Private', + 'X-APPLE-CALENDAR-COLOR:#FF2968', + 'X-WR-CALDESC:', + ); + } + + public function formatIcalEvent($dtstart, $dtend) + { + return array( + 'BEGIN:VEVENT', + 'CREATED:20090213T195947Z', + 'UID:M2CD-1-1-5FB000FB-BBE4-4F3F-9E7E-217F1FF97209', + $dtstart, + $dtend, + 'SUMMARY:test', + 'LAST-MODIFIED:20110429T222101Z', + 'DTSTAMP:20170630T105724Z', + 'SEQUENCE:0', + 'END:VEVENT', + ); + } + + public function getIcalTimezones() + { + return array( + 'BEGIN:VTIMEZONE', + 'TZID:Europe/Berlin', + 'X-LIC-LOCATION:Europe/Berlin', + 'BEGIN:STANDARD', + 'DTSTART:18930401T000000', + 'RDATE:18930401T000000', + 'TZNAME:CEST', + 'TZOFFSETFROM:+005328', + 'TZOFFSETTO:+0100', + 'END:STANDARD', + 'BEGIN:DAYLIGHT', + 'DTSTART:19160430T230000', + 'RDATE:19160430T230000', + 'RDATE:19400401T020000', + 'RDATE:19430329T020000', + 'RDATE:19460414T020000', + 'RDATE:19470406T030000', + 'RDATE:19480418T020000', + 'RDATE:19490410T020000', + 'RDATE:19800406T020000', + 'TZNAME:CEST', + 'TZOFFSETFROM:+0100', + 'TZOFFSETTO:+0200', + 'END:DAYLIGHT', + 'BEGIN:STANDARD', + 'DTSTART:19161001T010000', + 'RDATE:19161001T010000', + 'RDATE:19421102T030000', + 'RDATE:19431004T030000', + 'RDATE:19441002T030000', + 'RDATE:19451118T030000', + 'RDATE:19461007T030000', + 'TZNAME:CET', + 'TZOFFSETFROM:+0200', + 'TZOFFSETTO:+0100', + 'END:STANDARD', + 'BEGIN:DAYLIGHT', + 'DTSTART:19170416T020000', + 'RRULE:FREQ=YEARLY;UNTIL=19180415T010000Z;BYMONTH=4;BYDAY=3MO', + 'TZNAME:CEST', + 'TZOFFSETFROM:+0100', + 'TZOFFSETTO:+0200', + 'END:DAYLIGHT', + 'BEGIN:STANDARD', + 'DTSTART:19170917T030000', + 'RRULE:FREQ=YEARLY;UNTIL=19180916T010000Z;BYMONTH=9;BYDAY=3MO', + 'TZNAME:CET', + 'TZOFFSETFROM:+0200', + 'TZOFFSETTO:+0100', + 'END:STANDARD', + 'BEGIN:DAYLIGHT', + 'DTSTART:19440403T020000', + 'RRULE:FREQ=YEARLY;UNTIL=19450402T010000Z;BYMONTH=4;BYDAY=1MO', + 'TZNAME:CEST', + 'TZOFFSETFROM:+0100', + 'TZOFFSETTO:+0200', + 'END:DAYLIGHT', + 'BEGIN:DAYLIGHT', + 'DTSTART:19450524T020000', + 'RDATE:19450524T020000', + 'RDATE:19470511T030000', + 'TZNAME:CEMT', + 'TZOFFSETFROM:+0200', + 'TZOFFSETTO:+0300', + 'END:DAYLIGHT', + 'BEGIN:DAYLIGHT', + 'DTSTART:19450924T030000', + 'RDATE:19450924T030000', + 'RDATE:19470629T030000', + 'TZNAME:CEST', + 'TZOFFSETFROM:+0300', + 'TZOFFSETTO:+0200', + 'END:DAYLIGHT', + 'BEGIN:STANDARD', + 'DTSTART:19460101T000000', + 'RDATE:19460101T000000', + 'RDATE:19800101T000000', + 'TZNAME:CEST', + 'TZOFFSETFROM:+0100', + 'TZOFFSETTO:+0100', + 'END:STANDARD', + 'BEGIN:STANDARD', + 'DTSTART:19471005T030000', + 'RRULE:FREQ=YEARLY;UNTIL=19491002T010000Z;BYMONTH=10;BYDAY=1SU', + 'TZNAME:CET', + 'TZOFFSETFROM:+0200', + 'TZOFFSETTO:+0100', + 'END:STANDARD', + 'BEGIN:STANDARD', + 'DTSTART:19800928T030000', + 'RRULE:FREQ=YEARLY;UNTIL=19950924T010000Z;BYMONTH=9;BYDAY=-1SU', + 'TZNAME:CET', + 'TZOFFSETFROM:+0200', + 'TZOFFSETTO:+0100', + 'END:STANDARD', + 'BEGIN:DAYLIGHT', + 'DTSTART:19810329T020000', + 'RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU', + 'TZNAME:CEST', + 'TZOFFSETFROM:+0100', + 'TZOFFSETTO:+0200', + 'END:DAYLIGHT', + 'BEGIN:STANDARD', + 'DTSTART:19961027T030000', + 'RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU', + 'TZNAME:CET', + 'TZOFFSETFROM:+0200', + 'TZOFFSETTO:+0100', + 'END:STANDARD', + 'END:VTIMEZONE', + 'BEGIN:VTIMEZONE', + 'TZID:Europe/Paris', + 'X-LIC-LOCATION:Europe/Paris', + 'BEGIN:STANDARD', + 'DTSTART:18910315T000100', + 'RDATE:18910315T000100', + 'TZNAME:PMT', + 'TZOFFSETFROM:+000921', + 'TZOFFSETTO:+000921', + 'END:STANDARD', + 'BEGIN:STANDARD', + 'DTSTART:19110311T000100', + 'RDATE:19110311T000100', + 'TZNAME:WEST', + 'TZOFFSETFROM:+000921', + 'TZOFFSETTO:+0000', + 'END:STANDARD', + 'BEGIN:DAYLIGHT', + 'DTSTART:19160614T230000', + 'RDATE:19160614T230000', + 'RDATE:19170324T230000', + 'RDATE:19180309T230000', + 'RDATE:19190301T230000', + 'RDATE:19200214T230000', + 'RDATE:19210314T230000', + 'RDATE:19220325T230000', + 'RDATE:19230526T230000', + 'RDATE:19240329T230000', + 'RDATE:19250404T230000', + 'RDATE:19260417T230000', + 'RDATE:19270409T230000', + 'RDATE:19280414T230000', + 'RDATE:19290420T230000', + 'RDATE:19300412T230000', + 'RDATE:19310418T230000', + 'RDATE:19320402T230000', + 'RDATE:19330325T230000', + 'RDATE:19340407T230000', + 'RDATE:19350330T230000', + 'RDATE:19360418T230000', + 'RDATE:19370403T230000', + 'RDATE:19380326T230000', + 'RDATE:19390415T230000', + 'RDATE:19400225T020000', + 'TZNAME:WEST', + 'TZOFFSETFROM:+0000', + 'TZOFFSETTO:+0100', + 'END:DAYLIGHT', + 'BEGIN:STANDARD', + 'DTSTART:19161002T000000', + 'RRULE:FREQ=YEARLY;UNTIL=19191005T230000Z;BYMONTH=10;BYMONTHDAY=2,3,4,5,6,', + ' 7,8;BYDAY=MO', + 'TZNAME:WET', + 'TZOFFSETFROM:+0100', + 'TZOFFSETTO:+0000', + 'END:STANDARD', + 'BEGIN:STANDARD', + 'DTSTART:19201024T000000', + 'RDATE:19201024T000000', + 'RDATE:19211026T000000', + 'RDATE:19391119T000000', + 'TZNAME:WET', + 'TZOFFSETFROM:+0100', + 'TZOFFSETTO:+0000', + 'END:STANDARD', + 'BEGIN:STANDARD', + 'DTSTART:19221008T000000', + 'RRULE:FREQ=YEARLY;UNTIL=19381001T230000Z;BYMONTH=10;BYMONTHDAY=2,3,4,5,6,', + ' 7,8;BYDAY=SU', + 'TZNAME:WET', + 'TZOFFSETFROM:+0100', + 'TZOFFSETTO:+0000', + 'END:STANDARD', + 'BEGIN:STANDARD', + 'DTSTART:19400614T230000', + 'RDATE:19400614T230000', + 'TZNAME:CEST', + 'TZOFFSETFROM:+0100', + 'TZOFFSETTO:+0200', + 'END:STANDARD', + 'BEGIN:STANDARD', + 'DTSTART:19421102T030000', + 'RDATE:19421102T030000', + 'RDATE:19431004T030000', + 'RDATE:19760926T010000', + 'RDATE:19770925T030000', + 'RDATE:19781001T030000', + 'TZNAME:CET', + 'TZOFFSETFROM:+0200', + 'TZOFFSETTO:+0100', + 'END:STANDARD', + 'BEGIN:DAYLIGHT', + 'DTSTART:19430329T020000', + 'RDATE:19430329T020000', + 'RDATE:19440403T020000', + 'RDATE:19760328T010000', + 'TZNAME:CEST', + 'TZOFFSETFROM:+0100', + 'TZOFFSETTO:+0200', + 'END:DAYLIGHT', + 'BEGIN:STANDARD', + 'DTSTART:19440825T000000', + 'RDATE:19440825T000000', + 'TZNAME:WEST', + 'TZOFFSETFROM:+0200', + 'TZOFFSETTO:+0200', + 'END:STANDARD', + 'BEGIN:DAYLIGHT', + 'DTSTART:19441008T010000', + 'RDATE:19441008T010000', + 'TZNAME:WEST', + 'TZOFFSETFROM:+0200', + 'TZOFFSETTO:+0100', + 'END:DAYLIGHT', + 'BEGIN:DAYLIGHT', + 'DTSTART:19450402T020000', + 'RDATE:19450402T020000', + 'TZNAME:WEMT', + 'TZOFFSETFROM:+0100', + 'TZOFFSETTO:+0200', + 'END:DAYLIGHT', + 'BEGIN:STANDARD', + 'DTSTART:19450916T030000', + 'RDATE:19450916T030000', + 'TZNAME:CEST', + 'TZOFFSETFROM:+0200', + 'TZOFFSETTO:+0100', + 'END:STANDARD', + 'BEGIN:STANDARD', + 'DTSTART:19770101T000000', + 'RDATE:19770101T000000', + 'TZNAME:CEST', + 'TZOFFSETFROM:+0100', + 'TZOFFSETTO:+0100', + 'END:STANDARD', + 'BEGIN:DAYLIGHT', + 'DTSTART:19770403T020000', + 'RRULE:FREQ=YEARLY;UNTIL=19800406T010000Z;BYMONTH=4;BYDAY=1SU', + 'TZNAME:CEST', + 'TZOFFSETFROM:+0100', + 'TZOFFSETTO:+0200', + 'END:DAYLIGHT', + 'BEGIN:STANDARD', + 'DTSTART:19790930T030000', + 'RRULE:FREQ=YEARLY;UNTIL=19950924T010000Z;BYMONTH=9;BYDAY=-1SU', + 'TZNAME:CET', + 'TZOFFSETFROM:+0200', + 'TZOFFSETTO:+0100', + 'END:STANDARD', + 'BEGIN:DAYLIGHT', + 'DTSTART:19810329T020000', + 'RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU', + 'TZNAME:CEST', + 'TZOFFSETFROM:+0100', + 'TZOFFSETTO:+0200', + 'END:DAYLIGHT', + 'BEGIN:STANDARD', + 'DTSTART:19961027T030000', + 'RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU', + 'TZNAME:CET', + 'TZOFFSETFROM:+0200', + 'TZOFFSETTO:+0100', + 'END:STANDARD', + 'END:VTIMEZONE', + 'BEGIN:VTIMEZONE', + 'TZID:US-Eastern', + 'LAST-MODIFIED:19870101T000000Z', + 'TZURL:http://zones.stds_r_us.net/tz/US-Eastern', + 'BEGIN:STANDARD', + 'DTSTART:19671029T020000', + 'RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10', + 'TZOFFSETFROM:-0400', + 'TZOFFSETTO:-0500', + 'TZNAME:EST', + 'END:STANDARD', + 'BEGIN:DAYLIGHT', + 'DTSTART:19870405T020000', + 'RRULE:FREQ=YEARLY;BYDAY=1SU;BYMONTH=4', + 'TZOFFSETFROM:-0500', + 'TZOFFSETTO:-0400', + 'TZNAME:EDT', + 'END:DAYLIGHT', + 'END:VTIMEZONE', + ); + } + + public function getIcalFooter() + { + return array('END:VCALENDAR'); + } + + public function assertEvent($event, $expectedDateString, $message, $timezone = null) + { + if ($timezone !== null) { + date_default_timezone_set($timezone); + } + + $expectedTimeStamp = strtotime($expectedDateString); + + $this->assertEquals( + $expectedTimeStamp, + $event->dtstart_array[2], + $message . 'timestamp mismatch (expected ' . $expectedDateString . ' vs actual ' . $event->dtstart . ')' + ); + $this->assertAttributeEquals( + $expectedDateString, + 'dtstart', + $event, + $message . 'dtstart mismatch (timestamp is okay)' + ); + } + + public function assertEventFile($defaultTimezone, $file, $count, $checks) + { + $options = $this->getOptions($defaultTimezone); + + date_default_timezone_set('UTC'); + + $ical = new ICal($file, $options); + + $events = $ical->events(); + + $this->assertCount($count, $events); + + foreach ($checks as $check) { + $this->assertEvent( + $events[$check['index']], + $check['dateString'], + $check['message'], + isset($check['timezone']) ? $check['timezone'] : $defaultTimezone + ); + } + } +} diff --git a/app/vendor/johngrogg/ics-parser/tests/ical/ical-monthly.ics b/app/vendor/johngrogg/ics-parser/tests/ical/ical-monthly.ics new file mode 100755 index 0000000..9ac5494 --- /dev/null +++ b/app/vendor/johngrogg/ics-parser/tests/ical/ical-monthly.ics @@ -0,0 +1,18 @@ +BEGIN:VCALENDAR +PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN +VERSION:2.0 +X-WR-CALNAME:Private +X-APPLE-CALENDAR-COLOR:#FF2968 +X-WR-CALDESC: +BEGIN:VEVENT +CREATED:20090213T195947Z +UID:M2CD-1-1-5FB000FB-BBE4-4F3F-9E7E-217F1FF97208 +RRULE:FREQ=MONTHLY;BYMONTHDAY=1;WKST=SU;COUNT=25 +DTSTART;VALUE=DATE:20180701 +DTEND;VALUE=DATE:20180702 +SUMMARY:Monthly +LAST-MODIFIED:20110429T222101Z +DTSTAMP:20170630T105724Z +SEQUENCE:0 +END:VEVENT +END:VCALENDAR diff --git a/app/vendor/johngrogg/ics-parser/tests/ical/issue-196.ics b/app/vendor/johngrogg/ics-parser/tests/ical/issue-196.ics new file mode 100755 index 0000000..7603969 --- /dev/null +++ b/app/vendor/johngrogg/ics-parser/tests/ical/issue-196.ics @@ -0,0 +1,64 @@ +BEGIN:VCALENDAR +PRODID:-//Mozilla.org/NONSGML Mozilla Calendar V1.1//EN +VERSION:2.0 +X-WR-CALNAME:Test-Calendar +X-WR-TIMEZONE:Europe/Berlin +BEGIN:VTIMEZONE +TZID:Europe/Berlin +BEGIN:DAYLIGHT +TZOFFSETFROM:+0100 +TZOFFSETTO:+0200 +TZNAME:CEST +DTSTART:19700329T020000 +RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3 +END:DAYLIGHT +BEGIN:STANDARD +TZOFFSETFROM:+0200 +TZOFFSETTO:+0100 +TZNAME:CET +DTSTART:19701025T030000 +RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10 +END:STANDARD +END:VTIMEZONE +BEGIN:VEVENT +CREATED:20180101T152047Z +LAST-MODIFIED:20181202T202056Z +DTSTAMP:20181202T202056Z +UID:529b1ea3-8de8-484d-b878-c20c7fb72bf5 +SUMMARY:test +RRULE:FREQ=DAILY;UNTIL=20191111T180000Z +DTSTART;TZID=Europe/Berlin:20191105T190000 +DTEND;TZID=Europe/Berlin:20191105T220000 +TRANSP:OPAQUE +SEQUENCE:24 +X-MOZ-GENERATION:37 +END:VEVENT +BEGIN:VEVENT +CREATED:20181202T202042Z +LAST-MODIFIED:20181202T202053Z +DTSTAMP:20181202T202053Z +UID:529b1ea3-8de8-484d-b878-c20c7fb72bf5 +SUMMARY:test +RECURRENCE-ID;TZID=Europe/Berlin:20191109T190000 +DTSTART;TZID=Europe/Berlin:20191109T170000 +DTEND;TZID=Europe/Berlin:20191109T220000 +TRANSP:OPAQUE +SEQUENCE:25 +X-MOZ-GENERATION:37 +DURATION:PT0S +END:VEVENT +BEGIN:VEVENT +CREATED:20181202T202053Z +LAST-MODIFIED:20181202T202056Z +DTSTAMP:20181202T202056Z +UID:529b1ea3-8de8-484d-b878-c20c7fb72bf5 +SUMMARY:test +RECURRENCE-ID;TZID=Europe/Berlin:20191110T190000 +DTSTART;TZID=Europe/Berlin:20191110T180000 +DTEND;TZID=Europe/Berlin:20191110T220000 +TRANSP:OPAQUE +SEQUENCE:25 +X-MOZ-GENERATION:37 +DURATION:PT0S +END:VEVENT +END:VCALENDAR diff --git a/app/vendor/johngrogg/ics-parser/tests/rfc5545RecurrenceExamplesTest.php b/app/vendor/johngrogg/ics-parser/tests/rfc5545RecurrenceExamplesTest.php new file mode 100755 index 0000000..f4c81d9 --- /dev/null +++ b/app/vendor/johngrogg/ics-parser/tests/rfc5545RecurrenceExamplesTest.php @@ -0,0 +1,1033 @@ +originalTimeZone = date_default_timezone_get(); + } + + public function tearDown() + { + date_default_timezone_set($this->originalTimeZone); + } + + // Page 123, Test 1 :: Daily, 10 Occurences + public function test_page123_test1() + { + $checks = array( + array('index' => 0, 'dateString' => '19970902T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19970903T090000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19970904T090000', 'message' => '3rd occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970902T090000', + 'RRULE:FREQ=DAILY;COUNT=10', + ), + 10, + $checks + ); + } + + // Page 123, Test 2 :: Daily, until December 24th + public function test_page123_test2() + { + $checks = array( + array('index' => 0, 'dateString' => '19970902T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19970903T090000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19970904T090000', 'message' => '3rd occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970902T090000', + 'RRULE:FREQ=DAILY;UNTIL=19971224T000000Z', + ), + 113, + $checks + ); + } + + // Page 124, Test 1 :: Daily, every other day, Forever + // + // UNTIL rule does not exist in original example + public function test_page124_test1() + { + $checks = array( + array('index' => 0, 'dateString' => '19970902T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19970904T090000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19970906T090000', 'message' => '3rd occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970902T090000', + 'RRULE:FREQ=DAILY;INTERVAL=2;UNTIL=19971201Z', + ), + 45, + $checks + ); + } + + // Page 124, Test 2 :: Daily, 10-day intervals, 5 occurrences + public function test_page124_test2() + { + $checks = array( + array('index' => 0, 'dateString' => '19970902T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19970912T090000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19970922T090000', 'message' => '3rd occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970902T090000', + 'RRULE:FREQ=DAILY;INTERVAL=10;COUNT=5', + ), + 5, + $checks + ); + } + + // Page 124, Test 3a :: Every January day, for 3 years (Variant A) + public function test_page124_test3a() + { + $checks = array( + array('index' => 0, 'dateString' => '19980101T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19980102T090000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19980103T090000', 'message' => '3rd occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19980101T090000', + 'RRULE:FREQ=YEARLY;UNTIL=20000131T140000Z;BYMONTH=1;BYDAY=SU,MO,TU,WE,TH,FR,SA', + ), + 93, + $checks + ); + } + +/* Requires support for BYMONTH under DAILY [No ticket] + * + // Page 124, Test 3b :: Every January day, for 3 years (Variant B) + public function test_page124_test3b() + { + $checks = array( + array('index' => 0, 'dateString' => '19980101T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19980102T090000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19980103T090000', 'message' => '3rd occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19980101T090000', + 'RRULE:FREQ=DAILY;UNTIL=20000131T140000Z;BYMONTH=1', + ), + 93, + $checks + ); + } +*/ + + // Page 124, Test 4 :: Weekly, 10 occurrences + public function test_page124_test4() + { + $checks = array( + array('index' => 0, 'dateString' => '19970902T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19970909T090000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19970916T090000', 'message' => '3rd occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970902T090000', + 'RRULE:FREQ=WEEKLY;COUNT=10', + ), + 10, + $checks + ); + } + + // Page 125, Test 1 :: Weekly, until December 24th + public function test_page125_test1() + { + $checks = array( + array('index' => 0, 'dateString' => '19970902T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19970909T090000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19970916T090000', 'message' => '3rd occurrence: '), + array('index' => 16, 'dateString' => '19971223T090000', 'message' => 'last occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970902T090000', + 'RRULE:FREQ=WEEKLY;UNTIL=19971224T000000Z', + ), + 17, + $checks + ); + } + + // Page 125, Test 2 :: Every other week, forever + // + // UNTIL rule does not exist in original example + public function test_page125_test2() + { + $checks = array( + array('index' => 0, 'dateString' => '19970902T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19970916T090000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19970930T090000', 'message' => '3rd occurrence: '), + array('index' => 3, 'dateString' => '19971014T090000', 'message' => '4th occurrence: '), + array('index' => 4, 'dateString' => '19971028T090000', 'message' => '5th occurrence: '), + array('index' => 5, 'dateString' => '19971111T090000', 'message' => '6th occurrence: '), + array('index' => 6, 'dateString' => '19971125T090000', 'message' => '7th occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970902T090000', + 'RRULE:FREQ=WEEKLY;INTERVAL=2;WKST=SU;UNTIL=19971201Z', + ), + 7, + $checks + ); + } + + // Page 125, Test 3a :: Tuesday & Thursday every week, for five weeks (Variant A) + public function test_page125_test3a() + { + $checks = array( + array('index' => 0, 'dateString' => '19970902T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19970904T090000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19970909T090000', 'message' => '3rd occurrence: '), + array('index' => 9, 'dateString' => '19971002T090000', 'message' => 'final occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970902T090000', + 'RRULE:FREQ=WEEKLY;UNTIL=19971007T000000Z;WKST=SU;BYDAY=TU,TH', + ), + 10, + $checks + ); + } + + // Page 125, Test 3b :: Tuesday & Thursday every week, for five weeks (Variant B) + public function test_page125_test3b() + { + $checks = array( + array('index' => 0, 'dateString' => '19970902T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19970904T090000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19970909T090000', 'message' => '3rd occurrence: '), + array('index' => 9, 'dateString' => '19971002T090000', 'message' => 'final occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970902T090000', + 'RRULE:FREQ=WEEKLY;COUNT=10;WKST=SU;BYDAY=TU,TH', + ), + 10, + $checks + ); + } + + // Page 125, Test 4 :: Monday, Wednesday & Friday of every other week until December 24th + public function test_page125_test4() + { + $checks = array( + array('index' => 0, 'dateString' => '19970901T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19970903T090000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19970905T090000', 'message' => '3rd occurrence: '), + array('index' => 24, 'dateString' => '19971222T090000', 'message' => 'final occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970901T090000', + 'RRULE:FREQ=WEEKLY;INTERVAL=2;UNTIL=19971224T000000Z;WKST=SU;BYDAY=MO,WE,FR', + ), + 25, + $checks + ); + } + + // Page 126, Test 1 :: Tuesday & Thursday, every other week, for 8 occurrences + public function test_page126_test1() + { + $checks = array( + array('index' => 0, 'dateString' => '19970902T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19970904T090000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19970916T090000', 'message' => '3rd occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970902T090000', + 'RRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=8;WKST=SU;BYDAY=TU,TH', + ), + 8, + $checks + ); + } + + // Page 126, Test 2 :: First Friday of the Month, for 10 occurrences + public function test_page126_test2() + { + $checks = array( + array('index' => 0, 'dateString' => '19970905T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19971003T090000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19971107T090000', 'message' => '3rd occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970905T090000', + 'RRULE:FREQ=MONTHLY;COUNT=10;BYDAY=1FR', + ), + 10, + $checks + ); + } + + // Page 126, Test 3 :: First Friday of the Month, until 24th December + public function test_page126_test3() + { + $checks = array( + array('index' => 0, 'dateString' => '19970905T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19971003T090000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19971107T090000', 'message' => '3rd occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970905T090000', + 'RRULE:FREQ=MONTHLY;UNTIL=19971224T000000Z;BYDAY=1FR', + ), + 4, + $checks + ); + } + + // Page 126, Test 4 :: First and last Sunday, every other Month, for 10 occurrences + public function test_page126_test4() + { + $checks = array( + array('index' => 0, 'dateString' => '19970907T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19970928T090000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19971102T090000', 'message' => '3rd occurrence: '), + array('index' => 3, 'dateString' => '19971130T090000', 'message' => '4th occurrence: '), + array('index' => 4, 'dateString' => '19980104T090000', 'message' => '5th occurrence: '), + array('index' => 5, 'dateString' => '19980125T090000', 'message' => '6th occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970907T090000', + 'RRULE:FREQ=MONTHLY;INTERVAL=2;COUNT=10;BYDAY=1SU,-1SU', + ), + 10, + $checks + ); + } + + // Page 126, Test 5 :: Second-to-last Monday of the Month, for six months + public function test_page126_test5() + { + $checks = array( + array('index' => 0, 'dateString' => '19970922T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19971020T090000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19971117T090000', 'message' => '3rd occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970922T090000', + 'RRULE:FREQ=MONTHLY;COUNT=6;BYDAY=-2MO', + ), + 6, + $checks + ); + } + + // Page 127, Test 1 :: Third-to-last day of the month, forever + // + // UNTIL rule does not exist in original example. + public function test_page127_test1() + { + $checks = array( + array('index' => 0, 'dateString' => '19970928T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19971029T090000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19971128T090000', 'message' => '3rd occurrence: '), + array('index' => 3, 'dateString' => '19971229T090000', 'message' => '4th occurrence: '), + array('index' => 4, 'dateString' => '19980129T090000', 'message' => '5th occurrence: '), + array('index' => 5, 'dateString' => '19980226T090000', 'message' => '6th occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970928T090000', + 'RRULE:FREQ=MONTHLY;BYMONTHDAY=-3;UNTIL=19980401', + ), + 7, + $checks + ); + } + + // Page 127, Test 2 :: 2nd and 15th of each Month, for 10 occurrences + public function test_page127_test2() + { + $checks = array( + array('index' => 0, 'dateString' => '19970902T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19970915T090000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19971002T090000', 'message' => '3rd occurrence: '), + array('index' => 3, 'dateString' => '19971015T090000', 'message' => '4th occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970902T090000', + 'RRULE:FREQ=MONTHLY;COUNT=10;BYMONTHDAY=2,15', + ), + 10, + $checks + ); + } + + // Page 127, Test 3 :: First and last day of the month, for 10 occurrences + public function test_page127_test3() + { + $checks = array( + array('index' => 0, 'dateString' => '19970930T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19971001T090000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19971031T090000', 'message' => '3rd occurrence: '), + array('index' => 3, 'dateString' => '19971101T090000', 'message' => '4th occurrence: '), + array('index' => 4, 'dateString' => '19971130T090000', 'message' => '5th occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970930T090000', + 'RRULE:FREQ=MONTHLY;COUNT=10;BYMONTHDAY=1,-1', + ), + 10, + $checks + ); + } + + // Page 127, Test 4 :: 10th through 15th, every 18 months, for 10 occurrences + public function test_page127_test4() + { + $checks = array( + array('index' => 0, 'dateString' => '19970910T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19970911T090000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19970912T090000', 'message' => '3rd occurrence: '), + array('index' => 6, 'dateString' => '19990310T090000', 'message' => '7th occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970910T090000', + 'RRULE:FREQ=MONTHLY;INTERVAL=18;COUNT=10;BYMONTHDAY=10,11,12,13,14,15', + ), + 10, + $checks + ); + } + + // Page 127, Test 5 :: Every Tuesday, every other Month, forever + // + // UNTIL rule does not exist in original example. + public function test_page127_test5() + { + $checks = array( + array('index' => 0, 'dateString' => '19970902T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19970909T090000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19970916T090000', 'message' => '3rd occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970902T090000', + 'RRULE:FREQ=MONTHLY;INTERVAL=2;BYDAY=TU;UNTIL=19980101', + ), + 9, + $checks + ); + } + + // Page 128, Test 1 :: June & July of each Year, for 10 occurrences + public function test_page128_test1() + { + $checks = array( + array('index' => 0, 'dateString' => '19970610T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19970710T090000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19980610T090000', 'message' => '3rd occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970610T090000', + 'RRULE:FREQ=YEARLY;COUNT=10;BYMONTH=6,7', + ), + 10, + $checks + ); + } + + // Page 128, Test 2 :: January, February, & March, every other Year, for 10 occurrences + public function test_page128_test2() + { + $checks = array( + array('index' => 0, 'dateString' => '19970310T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19990110T090000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19990210T090000', 'message' => '3rd occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970310T090000', + 'RRULE:FREQ=YEARLY;INTERVAL=2;COUNT=10;BYMONTH=1,2,3', + ), + 10, + $checks + ); + } + + // Page 128, Test 3 :: Every third Year on the 1st, 100th, & 200th day for 10 occurrences + public function test_page128_test3() + { + $checks = array( + array('index' => 0, 'dateString' => '19970101T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19970410T090000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19970719T090000', 'message' => '3rd occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970101T090000', + 'RRULE:FREQ=YEARLY;INTERVAL=3;COUNT=10;BYYEARDAY=1,100,200', + ), + 10, + $checks + ); + } + + // Page 128, Test 4 :: 20th Monday of a Year, forever + // + // COUNT rule does not exist in original example. + public function test_page128_test4() + { + $checks = array( + array('index' => 0, 'dateString' => '19970519T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19980518T090000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19990517T090000', 'message' => '3rd occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970519T090000', + 'RRULE:FREQ=YEARLY;BYDAY=20MO;COUNT=4', + ), + 4, + $checks + ); + } + + // Page 129, Test 1 :: Monday of Week 20, where the default start of the week is Monday, forever + // + // COUNT rule does not exist in original example. + public function test_page129_test1() + { + $checks = array( + array('index' => 0, 'dateString' => '19970512T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19980511T090000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19990517T090000', 'message' => '3rd occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970512T090000', + 'RRULE:FREQ=YEARLY;BYWEEKNO=20;BYDAY=MO;COUNT=4', + ), + 4, + $checks + ); + } + + // Page 129, Test 2 :: Every Thursday in March, forever + // + // UNTIL rule does not exist in original example. + public function test_page129_test2() + { + $checks = array( + array('index' => 0, 'dateString' => '19970313T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19970320T090000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19970327T090000', 'message' => '3rd occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970313T090000', + 'RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=TH;UNTIL=19990401Z', + ), + 11, + $checks + ); + } + + // Page 129, Test 3 :: Every Thursday in June, July, & August, forever + // + // UNTIL rule does not exist in original example. + public function test_page129_test3() + { + $checks = array( + array('index' => 0, 'dateString' => '19970605T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19970612T090000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19970619T090000', 'message' => '3rd occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970605T090000', + 'RRULE:FREQ=YEARLY;BYDAY=TH;BYMONTH=6,7,8;UNTIL=19970901Z', + ), + 13, + $checks + ); + } + +/* Requires support for BYMONTHDAY and BYDAY in the same MONTHLY RRULE [No ticket] + * + // Page 129, Test 4 :: Every Friday 13th, forever + // + // COUNT rule does not exist in original example. + public function test_page129_test4() + { + $checks = array( + array('index' => 0, 'dateString' => '19980213T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19980313T090000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19981113T090000', 'message' => '3rd occurrence: '), + array('index' => 3, 'dateString' => '19990813T090000', 'message' => '4th occurrence: '), + array('index' => 4, 'dateString' => '20001013T090000', 'message' => '5th occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970902T090000', + 'EXDATE;TZID=America/New_York:19970902T090000', + 'RRULE:FREQ=MONTHLY;BYDAY=FR;BYMONTHDAY=13;COUNT=5', + ), + 5, + $checks + ); + } +*/ + + // Page 130, Test 1 :: The first Saturday that follows the first Sunday of the month, forever: + // + // COUNT rule does not exist in original example. + public function test_page130_test1() + { + $checks = array( + array('index' => 0, 'dateString' => '19970913T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19971011T090000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19971108T090000', 'message' => '3rd occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970913T090000', + 'RRULE:FREQ=MONTHLY;BYDAY=SA;BYMONTHDAY=7,8,9,10,11,12,13;COUNT=7', + ), + 7, + $checks + ); + } + + // Page 130, Test 2 :: The first Tuesday after a Monday in November, every 4 Years (U.S. Presidential Election Day), forever + // + // COUNT rule does not exist in original example. + public function test_page130_test2() + { + $checks = array( + array('index' => 0, 'dateString' => '19961105T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '20001107T090000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '20041102T090000', 'message' => '3rd occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19961105T090000', + 'RRULE:FREQ=YEARLY;INTERVAL=4;BYMONTH=11;BYDAY=TU;BYMONTHDAY=2,3,4,5,6,7,8;COUNT=4', + ), + 4, + $checks + ); + } + + // Page 130, Test 3 :: Third instance of either a Tuesday, Wednesday, or Thursday of a Month, for 3 months. + public function test_page130_test3() + { + $checks = array( + array('index' => 0, 'dateString' => '19970904T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19971007T090000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19971106T090000', 'message' => '3rd occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970904T090000', + 'RRULE:FREQ=MONTHLY;COUNT=3;BYDAY=TU,WE,TH;BYSETPOS=3', + ), + 3, + $checks + ); + } + + // Page 130, Test 4 :: Second-to-last weekday of the month, indefinitely + // + // UNTIL rule does not exist in original example. + public function test_page130_test4() + { + $checks = array( + array('index' => 0, 'dateString' => '19970929T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19971030T090000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19971127T090000', 'message' => '3rd occurrence: '), + array('index' => 3, 'dateString' => '19971230T090000', 'message' => '4th occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970929T090000', + 'RRULE:FREQ=MONTHLY;BYDAY=MO,TU,WE,TH,FR;BYSETPOS=-2;UNTIL=19980101', + ), + 4, + $checks + ); + } + +/* Requires support of HOURLY frequency [#101] + * + // Page 131, Test 1 :: Every 3 hours from 09:00 to 17:00 on a specific day + public function test_page131_test1() + { + $checks = array( + array('index' => 0, 'dateString' => '19970902T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19970902T120000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19970902T150000', 'message' => '3rd occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970902T090000', + 'FREQ=HOURLY;INTERVAL=3;UNTIL=19970902T170000Z', + ), + 3, + $checks + ); + } +*/ + +/* Requires support of MINUTELY frequency [#101] + * + // Page 131, Test 2 :: Every 15 minutes for 6 occurrences + public function test_page131_test2() + { + $checks = array( + array('index' => 0, 'dateString' => '19970902T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19970902T091500', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19970902T093000', 'message' => '3rd occurrence: '), + array('index' => 3, 'dateString' => '19970902T094500', 'message' => '4th occurrence: '), + array('index' => 4, 'dateString' => '19970902T100000', 'message' => '5th occurrence: '), + array('index' => 5, 'dateString' => '19970902T101500', 'message' => '6th occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970902T090000', + 'RRULE:FREQ=MINUTELY;INTERVAL=15;COUNT=6', + ), + 6, + $checks + ); + } +*/ + +/* Requires support of MINUTELY frequency [#101] + * + // Page 131, Test 3 :: Every hour and a half for 4 occurrences + public function test_page131_test3() + { + $checks = array( + array('index' => 0, 'dateString' => '19970902T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19970902T103000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19970902T120000', 'message' => '3rd occurrence: '), + array('index' => 3, 'dateString' => '19970902T133000', 'message' => '4th occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970902T090000', + 'RRULE:FREQ=MINUTELY;INTERVAL=90;COUNT=4', + ), + 4, + $checks + ); + } +*/ + +/* Requires support of BYHOUR and BYMINUTE under DAILY [#11] + * + // Page 131, Test 4a :: Every 20 minutes from 9:00 to 16:40 every day, using DAILY + // + // UNTIL rule does not exist in original example + public function test_page131_test4a() + { + $checks = array( + array('index' => 0, 'dateString' => '19970902T090000', 'message' => '1st occurrence, Day 1: '), + array('index' => 1, 'dateString' => '19970902T092000', 'message' => '2nd occurrence, Day 1: '), + array('index' => 2, 'dateString' => '19970902T094000', 'message' => '3rd occurrence, Day 1: '), + array('index' => 3, 'dateString' => '19970902T100000', 'message' => '4th occurrence, Day 1: '), + array('index' => 20, 'dateString' => '19970902T164000', 'message' => 'Last occurrence, Day 1: '), + array('index' => 21, 'dateString' => '19970903T090000', 'message' => '1st occurrence, Day 2: '), + array('index' => 41, 'dateString' => '19970903T164000', 'message' => 'Last occurrence, Day 2: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970902T090000', + 'RRULE:FREQ=DAILY;BYHOUR=9,10,11,12,13,14,15,16;BYMINUTE=0,20,40;UNTIL=19970904T000000Z', + ), + 42, + $checks + ); + } +*/ + +/* Requires support of MINUTELY frequency [#101] + * + // Page 131, Test 4b :: Every 20 minutes from 9:00 to 16:40 every day, using MINUTELY + // + // UNTIL rule does not exist in original example + public function test_page131_test4b() + { + $checks = array( + array('index' => 0, 'dateString' => '19970902T090000', 'message' => '1st occurrence, Day 1: '), + array('index' => 1, 'dateString' => '19970902T092000', 'message' => '2nd occurrence, Day 1: '), + array('index' => 2, 'dateString' => '19970902T094000', 'message' => '3rd occurrence, Day 1: '), + array('index' => 3, 'dateString' => '19970902T100000', 'message' => '4th occurrence, Day 1: '), + array('index' => 20, 'dateString' => '19970902T164000', 'message' => 'Last occurrence, Day 1: '), + array('index' => 21, 'dateString' => '19970903T090000', 'message' => '1st occurrence, Day 2: '), + array('index' => 41, 'dateString' => '19970903T164000', 'message' => 'Last occurrence, Day 2: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970902T090000', + 'RRULE:FREQ=MINUTELY;INTERVAL=20;BYHOUR=9,10,11,12,13,14,15,16;UNTIL=19970904T000000Z', + ), + 42, + $checks + ); + } +*/ + + // Page 131, Test 5a :: Changing the passed WKST rule, before... + public function test_page131_test5a() + { + $checks = array( + array('index' => 0, 'dateString' => '19970805T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19970810T090000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19970819T090000', 'message' => '3rd occurrence: '), + array('index' => 3, 'dateString' => '19970824T090000', 'message' => '4th occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970805T090000', + 'RRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=MO', + ), + 4, + $checks + ); + } + + // Page 131, Test 5b :: ...and after + public function test_page131_test5b() + { + $checks = array( + array('index' => 0, 'dateString' => '19970805T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '19970817T090000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '19970819T090000', 'message' => '3rd occurrence: '), + array('index' => 3, 'dateString' => '19970831T090000', 'message' => '4th occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:19970805T090000', + 'RRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU', + ), + 4, + $checks + ); + } + + // Page 132, Test 1 :: Automatically ignoring an invalid date (30 February) + public function test_page132_test1() + { + $checks = array( + array('index' => 0, 'dateString' => '20070115T090000', 'message' => '1st occurrence: '), + array('index' => 1, 'dateString' => '20070130T090000', 'message' => '2nd occurrence: '), + array('index' => 2, 'dateString' => '20070215T090000', 'message' => '3rd occurrence: '), + array('index' => 3, 'dateString' => '20070315T090000', 'message' => '4th occurrence: '), + array('index' => 4, 'dateString' => '20070330T090000', 'message' => '5th occurrence: '), + ); + $this->assertVEVENT( + 'America/New_York', + array( + 'DTSTART;TZID=America/New_York:20070115T090000', + 'RRULE:FREQ=MONTHLY;BYMONTHDAY=15,30;COUNT=5', + ), + 5, + $checks + ); + } + + public function assertVEVENT($defaultTimezone, $veventParts, $count, $checks) + { + $options = $this->getOptions($defaultTimezone); + + $testIcal = implode(PHP_EOL, $this->getIcalHeader()); + $testIcal .= PHP_EOL; + $testIcal .= implode(PHP_EOL, $this->formatIcalEvent($veventParts)); + $testIcal .= PHP_EOL; + $testIcal .= implode(PHP_EOL, $this->getIcalFooter()); + + $ical = new ICal(false, $options); + $ical->initString($testIcal); + + $events = $ical->events(); + + $this->assertCount($count, $events); + + foreach ($checks as $check) { + $this->assertEvent($events[$check['index']], $check['dateString'], $check['message'], isset($check['timezone']) ? $check['timezone'] : $defaultTimezone); + } + } + + public function assertEvent($event, $expectedDateString, $message, $timeZone = null) + { + if (!is_null($timeZone)) { + date_default_timezone_set($timeZone); + } + + $expectedTimeStamp = strtotime($expectedDateString); + + $this->assertEquals($expectedTimeStamp, $event->dtstart_array[2], $message . 'timestamp mismatch (expected ' . $expectedDateString . ' vs actual ' . $event->dtstart . ')'); + $this->assertAttributeEquals($expectedDateString, 'dtstart', $event, $message . 'dtstart mismatch (timestamp is okay)'); + } + + public function getOptions($defaultTimezone) + { + $options = array( + 'defaultSpan' => 2, // Default value: 2 + 'defaultTimeZone' => $defaultTimezone, // Default value: UTC + 'defaultWeekStart' => 'MO', // Default value + 'disableCharacterReplacement' => false, // Default value + 'filterDaysAfter' => null, // Default value + 'filterDaysBefore' => null, // Default value + 'skipRecurrence' => false, // Default value + ); + + return $options; + } + + public function formatIcalEvent($veventParts) + { + return array_merge( + array( + 'BEGIN:VEVENT', + 'CREATED:' . gmdate('Ymd\THis\Z'), + 'UID:RFC5545-examples-test', + ), + $veventParts, + array( + 'SUMMARY:test', + 'LAST-MODIFIED:' . gmdate('Ymd\THis\Z', filemtime(__FILE__)), + 'END:VEVENT', + ) + ); + } + + public function getIcalHeader() + { + return array( + 'BEGIN:VCALENDAR', + 'VERSION:2.0', + 'PRODID:-//Google Inc//Google Calendar 70.9054//EN', + 'X-WR-CALNAME:Private', + 'X-APPLE-CALENDAR-COLOR:#FF2968', + 'X-WR-CALDESC:', + ); + } + + public function getIcalFooter() + { + return array('END:VCALENDAR'); + } +} diff --git a/app/widgets/MEC.php b/app/widgets/MEC.php new file mode 100755 index 0000000..14bda9d --- /dev/null +++ b/app/widgets/MEC.php @@ -0,0 +1,169 @@ + + */ +class MEC_MEC_widget extends WP_Widget +{ + /** + * @var MEC_render + */ + public $render; + + /** + * @var MEC_main + */ + public $main; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + // MEC Render Class + $this->render = MEC::getInstance('app.libraries.render'); + + // MEC Main Class + $this->main = MEC::getInstance('app.libraries.main'); + + parent::__construct('MEC_MEC_widget', esc_html__('Modern Events Calendar', 'modern-events-calendar-lite'), array('description'=>__('Show events based on created shortcodes.', 'modern-events-calendar-lite'))); + } + + /** + * How to display the widget on the screen. + * @param array $args + * @param array $instance + * @author Webnus + * @return void + */ + public function widget($args, $instance) + { + // Include OWL Assets. It's needed if Widget is set to load grid view + $this->main->load_owl_assets(); + + // Before Widget + echo $args['before_widget'] ?? ''; + + // Print the widget title + if(!empty($instance['title'])) + { + echo ($args['before_title'] ?? '').apply_filters('widget_title', $instance['title']).($args['after_title'] ?? ''); + } + + $calendar_id = $instance['calendar_id'] ?? 0; + + // Get Skin Options + $sk_options = get_post_meta($calendar_id, 'sk-options', true); + $sk_options_list_style = (isset($sk_options['list']) and isset($sk_options['list']['style'])) ? trim($sk_options['list']['style']) : 'classic'; + + $current_hide = $instance['current_hide'] ?? ''; + $autoplay = $instance['autoplay'] ?? 1; + $autoplay_time = $instance['autoplay_time'] ?? 3000; + $loop = $instance['loop'] ?? 1; + + // Print the skin output + echo MEC_kses::full($this->render->widget($calendar_id, array( + 'html-class'=>'mec-widget '.$current_hide, + 'style'=>$sk_options_list_style, + 'widget'=>true, + 'widget_autoplay'=>$autoplay, + 'widget_loop'=>$loop, + 'widget_autoplay_time'=>$autoplay_time, + ))); + + // After Widget + echo $args['after_widget'] ?? ''; + } + + /** + * Displays the widget settings controls on the widget panel. + * @param array $instance + * @author Webnus + * @return void + */ + public function form($instance) + { + $calendars = get_posts(array('post_type'=>'mec_calendars', 'posts_per_page'=>'-1', 'meta_query'=>array(array('key'=>'skin', 'value'=>array('list', 'grid', 'monthly_view'), 'compare'=>'IN')))); + + $current_hide = $instance['current_hide'] ?? ''; + $autoplay = $instance['autoplay'] ?? 1; + $autoplay_time = $instance['autoplay_time'] ?? 3000; + $loop = $instance['loop'] ?? 1; + + $monthly_view_options = false; + $grid_view_options = false; + + echo '

    ' + .'' + .'' + .'

    '; + + if(count($calendars)) + { + echo '

    ' + .'' + .'

    '; + + // Monthly View Options + echo '

    '; + + // Grid Options + echo '
    +

    + + + +

    +

    + + +

    +

    + + + +

    +
    '; + } + else + { + echo '

    '.esc_html__('Create some calendars first.').'

    '; + } + } + + /** + * Update the widget settings. + * @author Webnus + * @param array $new_instance + * @param array $old_instance + * @return array + */ + public function update($new_instance, $old_instance) + { + $instance = []; + $instance['title'] = isset($new_instance['title']) ? strip_tags($new_instance['title']) : ''; + $instance['calendar_id'] = isset($new_instance['calendar_id']) ? intval($new_instance['calendar_id']) : 0; + $instance['current_hide'] = isset($new_instance['current_hide']) ? strip_tags($new_instance['current_hide']) : ''; + $instance['autoplay'] = isset($new_instance['autoplay']) ? sanitize_text_field($new_instance['autoplay']) : 0; + $instance['autoplay_time'] = isset($new_instance['autoplay_time']) ? sanitize_text_field($new_instance['autoplay_time']) : 3000; + $instance['loop'] = isset($new_instance['loop']) ? sanitize_text_field($new_instance['loop']) : 0; + + return $instance; + } +} \ No newline at end of file diff --git a/app/widgets/index.html b/app/widgets/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/widgets/single.php b/app/widgets/single.php new file mode 100755 index 0000000..4e236ce --- /dev/null +++ b/app/widgets/single.php @@ -0,0 +1,148 @@ + + */ +class MEC_single_widget extends WP_Widget +{ + /** + * Unique identifier. + */ + protected $widget_slug = 'MEC_single_widget'; + + /** + * Constructor method + * @author Webnus + */ + public function __construct() + { + parent::__construct($this->get_widget_slug(), esc_html__('MEC Single Sidebar Items', 'modern-events-calendar-lite'), array('classname' => $this->get_widget_slug() . '-class', 'description' => esc_html__('To manage event details page elements.', 'modern-events-calendar-lite'))); + + // Refreshing the widget's cached output with each new post + add_action('save_post', array($this, 'flush_widget_cache')); + add_action('deleted_post', array($this, 'flush_widget_cache')); + add_action('switch_theme', array($this, 'flush_widget_cache')); + } + + /** + * @return string + */ + public function get_widget_slug() + { + return $this->widget_slug; + } + + /** + * How to display the widget on the screen. + * @author Webnus + * @param array $args + * @param array $instance + */ + public function widget($args, $instance) + { + /** @var MEC_main $main */ + $main = MEC::getInstance('app.libraries.main'); + + // Not Single Event Page + if(!is_singular($main->get_main_post_type())) return; + + // General Settings + $settings = $main->get_settings(); + + $layout = ($settings['single_single_style'] ?? 'modern'); + echo MEC_kses::full($this->get_layout_output($layout, $settings)); + } + + public function get_layout_output($layout, $settings) + { + $single = $GLOBALS['mec-widget-single'] ?? NULL; + $event = $GLOBALS['mec-widget-event'] ?? NULL; + + if(!$single or !$event) return NULL; + + $occurrence = $GLOBALS['mec-widget-occurrence'] ?? NULL; + $occurrence_full = $GLOBALS['mec-widget-occurrence_full'] ?? NULL; + $occurrence_end_date = $GLOBALS['mec-widget-occurrence_end_date'] ?? NULL; + $occurrence_end_full = $GLOBALS['mec-widget-occurrence_end_full'] ?? NULL; + $cost = $GLOBALS['mec-widget-cost'] ?? NULL; + $more_info = $GLOBALS['mec-widget-more_info'] ?? NULL; + $location_id = $GLOBALS['mec-widget-location_id'] ?? NULL; + $location = $GLOBALS['mec-widget-location'] ?? NULL; + $organizer_id = $GLOBALS['mec-widget-organizer_id'] ?? NULL; + $organizer = $GLOBALS['mec-widget-organizer'] ?? NULL; + $more_info_target = $GLOBALS['mec-widget-more_info_target'] ?? NULL; + $more_info_title = $GLOBALS['mec-widget-more_info_title'] ?? NULL; + $banner_module = $GLOBALS['mec-banner_module'] ?? 0; + $icons = $GLOBALS['mec-icons'] ?? $single->main->icons(); + + $path = MEC::import('app.widgets.single.'.$layout, true, true); + + ob_start(); + include file_exists($path) ? $path : MEC::import('app.widgets.single.default', true, true); + return ob_get_clean(); + } + + /** + * @param array $instance + * @return void + */ + public function form($instance) + { + ?> +

    Settings -> Single Event -> Sidebar page.'); ?>

    + get_widget_slug(), 'widget'); + } + + /** + * Update the widget settings. + * @author Webnus + * @param array $new_instance + * @param array $old_instance + * @return array + */ + public function update($new_instance, $old_instance) + { + $this->flush_widget_cache(); + + $alloptions = wp_cache_get('alloptions', 'options'); + if(isset($alloptions['MEC_single_widget'])) delete_option('MEC_single_widget'); + + return []; + } + + public function is_enabled($k) + { + /** @var MEC_main $main */ + $main = MEC::getInstance('app.libraries.main'); + + // General Settings + $general = $main->get_settings(); + + // Return from General Settings + if(isset($general['ss_'.$k])) return (bool) $general['ss_'.$k]; + + // Widget Settings + $settings = $this->get_settings(); + + $arr = end($settings); + $ids = []; + + if(is_array($arr) or is_object($arr)) + { + foreach($arr as $key=>$value) + { + if($key === $k) $ids[] = $value; + } + } + + return isset($ids[0]) && $ids[0] === 'on'; + } +} diff --git a/app/widgets/single/default.php b/app/widgets/single/default.php new file mode 100755 index 0000000..23c735e --- /dev/null +++ b/app/widgets/single/default.php @@ -0,0 +1,214 @@ +is_enabled('data_time') || $this->is_enabled('local_time') || $this->is_enabled('event_cost') || $this->is_enabled('more_info') || $this->is_enabled('event_label') || $this->is_enabled('event_location') || $this->is_enabled('event_categories') || $this->is_enabled('event_orgnizer') || $this->is_enabled('register_btn')): ?> +
    + data->meta['mec_date']['start']) and !empty($event->data->meta['mec_date']['start']) and $this->is_enabled('data_time')) + { + $single->display_datetime_widget($event, $occurrence_full, $occurrence_end_full); + } + + // Local Time Module + if($this->is_enabled('local_time')) echo MEC_kses::full($single->main->module('local-time.details', array('event' => $event, 'icons' => $icons))); + ?> + + is_enabled('event_cost')) + { + ?> +
    + display('wallet'); ?> +

    main->m('cost', esc_html__('Cost', 'modern-events-calendar-lite'))); ?>

    +
    +
    + + + is_enabled('more_info')) + { + ?> +
    + display('info'); ?> +

    main->m('more_info_link', esc_html__('More Info', 'modern-events-calendar-lite'))); ?>

    +
    +
    + + + data->labels) and !empty($event->data->labels) and $this->is_enabled('event_label')) + { + $single->display_labels_widget($event); + } + ?> + + data ); ?> + data ); ?> + data); ?> + + is_enabled('event_location')) + { + $single->display_location_widget($event); // Show Location Widget + $single->show_other_locations($event); // Show Additional Locations + } + ?> + + data->categories) and !empty($event->data->categories) and $this->is_enabled('event_categories')) + { + ?> +
    + display('folder'); ?> +
    main->m('taxonomy_categories', esc_html__('Category', 'modern-events-calendar-lite'))); ?>
    +
    + data->categories as $category) + { + $color = ((isset($category['color']) and trim($category['color'])) ? $category['color'] : ''); + + $color_html = ''; + if($color) $color_html .= ' '; + + $icon = $category['icon'] ?? ''; + $icon = isset($icon) && $icon != '' ? '' : ''; + + echo '
    '; + } + ?> +
    + + + + is_enabled('event_orgnizer')) + { + ?> +
    + display('home'); ?> +

    main->m('taxonomy_organizer', esc_html__('Organizer', 'modern-events-calendar-lite'))); ?>

    + + + <?php echo (isset($organizer['name']) ? esc_attr($organizer['name']) : ''); ?> + +
    + +
    + + + display('link'); ?> +
    +
    + + display('home'); ?> +
    + +
    + +
    + display('phone'); ?> +
    + +
    + +
    + display('envelope'); ?> +
    + +
    + +
    + display('sitemap'); ?> +
    + + +
    + data, 'mec_organizer'); if($organizer_description_setting == '1' and is_array($organizer_terms) and count($organizer_terms)): foreach($organizer_terms as $organizer_term) { if ($organizer_term->term_id == $organizer['id'] ) { if(isset($organizer_term->description) && !empty($organizer_term->description)): ?> +

    description);?>

    + +
    + +
    + show_other_organizers($event); // Show Additional Organizers + } + ?> + + + main->can_show_booking_module($event) and $this->is_enabled('register_btn')): ?> + + main->m('register_button', esc_html__('REGISTER', 'modern-events-calendar-lite'))); ?> + is_enabled('register_btn') == 'on' and $more_info and !$single->main->is_expired($event)): ?> + main->m('register_button', esc_html__('REGISTER', 'modern-events-calendar-lite'))); ?> + + + + + +is_enabled('event_speakers')) echo MEC_kses::full($single->main->module('speakers.details', array('event' => $event, 'icons' => $icons))); ?> + + +is_enabled('event_sponsors')) echo MEC_kses::full($single->main->module('sponsors.details', array('event' => $event, 'icons' => $icons))); ?> + + +is_enabled('attende_module')) echo MEC_kses::full($single->main->module('attendees-list.details', array('event' => $event, 'icons' => $icons))); ?> + + +is_enabled('next_module')) echo MEC_kses::full($single->main->module('next-event.details', array('event' => $event, 'icons' => $icons))); ?> + + +is_enabled('links_module')) echo MEC_kses::full($single->main->module('links.details', array('event' => $event, 'icons' => $icons))); ?> + + +is_enabled('weather_module')) echo MEC_kses::full($single->main->module('weather.details', array('event' => $event, 'icons' => $icons))); ?> + + +is_enabled('google_map')): ?> +
    + main->module('googlemap.details', array('event' => $single->events, 'icons' => $icons))); ?> +
    + + + +is_enabled('qrcode_module')) echo MEC_kses::full($single->main->module('qrcode.details', array('event' => $event, 'icons' => $icons))); ?> + + +is_enabled('public_download_module')) $single->display_public_download_module($event); ?> + + +is_enabled('custom_fields_module')) $single->display_data_fields($event, true); ?> diff --git a/app/widgets/single/index.html b/app/widgets/single/index.html new file mode 100755 index 0000000..e69de29 diff --git a/app/widgets/single/modern.php b/app/widgets/single/modern.php new file mode 100755 index 0000000..35f3337 --- /dev/null +++ b/app/widgets/single/modern.php @@ -0,0 +1,184 @@ +is_enabled('event_orgnizer') || $this->is_enabled('register_btn')): ?> +
    + is_enabled('event_orgnizer')) + { + ?> +
    + display('home'); ?> +

    main->m('taxonomy_organizer', esc_html__('Organizer', 'modern-events-calendar-lite'))); ?>

    + + + <?php echo (isset($organizer['name']) ? esc_attr($organizer['name']) : ''); ?> + + +
    + +
    + + + display('link'); ?> +
    +
    + + display('home'); ?> +
    + +
    + +
    + display('phone'); ?> +
    + +
    + +
    + display('envelope'); ?> +
    + +
    + +
    + display('sitemap'); ?> +
    + +
    + data, 'mec_organizer'); if($organizer_description_setting == '1' and is_array($organizer_terms) and count($organizer_terms)): foreach($organizer_terms as $organizer_term) { if ($organizer_term->term_id == $organizer['id'] ) { if(isset($organizer_term->description) && !empty($organizer_term->description)): ?> +
    +

    description); ?>

    +
    + +
    + +
    + show_other_organizers($event); // Show Additional Organizers + } + ?> + + + main->can_show_booking_module($event) and $this->is_enabled('register_btn')): ?> + uniqueid; + if(isset($settings['single_booking_style']) and $settings['single_booking_style'] == 'modal' ){ + $data_lity_class = 'mec-booking-data-lity'; + $target_id = 'mec-events-meta-group-booking-box-'.$single->uniqueid; + } ?> + main->m('register_button', esc_html__('REGISTER', 'modern-events-calendar-lite'))); ?> + main->is_expired($event)): ?> + main->m('register_button', esc_html__('REGISTER', 'modern-events-calendar-lite'))); ?> + +
    + + + +is_enabled('event_speakers')) echo MEC_kses::full($single->main->module('speakers.details', array('event' => $event, 'icons' => $icons))); ?> + + +is_enabled('event_sponsors')) echo MEC_kses::full($single->main->module('sponsors.details', array('event' => $event, 'icons' => $icons))); ?> + + +is_enabled('local_time')) echo MEC_kses::full($single->main->module('local-time.details', array('event' => $event, 'icons' => $icons))); ?> + +is_enabled('event_location') || $this->is_enabled('event_categories') || $this->is_enabled('more_info')): ?> +
    + + is_enabled('event_location')) + { + $single->display_location_widget($event); // Show Location Widget + $single->show_other_locations($event); // Show Additional Locations + } + ?> + + data->categories) and !empty($event->data->categories) and $this->is_enabled('event_categories')) + { + ?> +
    + display('folder'); ?> +
    main->m('taxonomy_categories', esc_html__('Category', 'modern-events-calendar-lite'))); ?>
    +
    + data->categories as $category) + { + $color = ((isset($category['color']) and trim($category['color'])) ? $category['color'] : ''); + + $color_html = ''; + if($color) $color_html .= ' '; + + $icon = $category['icon'] ?? ''; + $icon = isset($icon) && $icon != '' ? '' : ''; + + echo '
    '; + } + ?> +
    +
    + + + is_enabled('more_info')) + { + ?> +
    + display('info'); ?> +

    main->m('more_info_link', esc_html__('More Info', 'modern-events-calendar-lite'))); ?>

    +
    +
    + + +
    + + + +is_enabled('attende_module')) echo MEC_kses::full($single->main->module('attendees-list.details', array('event' => $event, 'icons' => $icons))); ?> + + +is_enabled('next_module')) echo MEC_kses::full($single->main->module('next-event.details', array('event' => $event, 'icons' => $icons))); ?> + + +is_enabled('weather_module')) echo MEC_kses::full($single->main->module('weather.details', array('event' => $event, 'icons' => $icons))); ?> + + +is_enabled('qrcode_module')) echo MEC_kses::full($single->main->module('qrcode.details', array('event' => $event, 'icons' => $icons))); ?> + + +is_enabled('public_download_module')) $single->display_public_download_module($event); ?> + + +is_enabled('custom_fields_module')) $single->display_data_fields($event, true); ?> diff --git a/assets/css/a11y-backend.css b/assets/css/a11y-backend.css new file mode 100755 index 0000000..96b65fa --- /dev/null +++ b/assets/css/a11y-backend.css @@ -0,0 +1,164 @@ +.mec-sed-methods li a:focus-visible, +.mec-sed-methods li.active a:focus-visible, +.mec-add-booking-tabs-left a:focus-visible, +.mec-add-event-tabs-left a:focus-visible, +#webnus-dashboard select:focus-visible, +#webnus-dashboard input:focus-visible { + outline: #000 auto 1px; +} + + +.mec-add-event-tabs-wrap .select2-container:focus, +.mec-create-shortcode-tab-content .select2-container:focus, +.mec-sed-methods li.active:focus, +.post-type-mec-books.taxonomy-mec_coupon input[type=number]:focus, +.post-type-mec-books.taxonomy-mec_coupon input[type=search]:focus, +.post-type-mec-books.taxonomy-mec_coupon input[type=text]:focus, +.post-type-mec-books.taxonomy-mec_coupon input[type=url]:focus, +.post-type-mec-books.taxonomy-mec_coupon select:focus, +.post-type-mec-books.taxonomy-mec_coupon textarea:focus, +.post-type-mec-events.taxonomy-mec_category input[type=number]:focus, +.post-type-mec-events.taxonomy-mec_category input[type=search]:focus, +.post-type-mec-events.taxonomy-mec_category input[type=text]:focus, +.post-type-mec-events.taxonomy-mec_category input[type=url]:focus, +.post-type-mec-events.taxonomy-mec_category select:focus, +.post-type-mec-events.taxonomy-mec_category textarea:focus, +.post-type-mec-events.taxonomy-mec_label input[type=number]:focus, +.post-type-mec-events.taxonomy-mec_label input[type=search]:focus, +.post-type-mec-events.taxonomy-mec_label input[type=text]:focus, +.post-type-mec-events.taxonomy-mec_label input[type=url]:focus, +.post-type-mec-events.taxonomy-mec_label select:focus, +.post-type-mec-events.taxonomy-mec_label textarea:focus, +.post-type-mec-events.taxonomy-post_tag input[type=number]:focus, +.post-type-mec-events.taxonomy-post_tag input[type=search]:focus, +.post-type-mec-events.taxonomy-post_tag input[type=text]:focus, +.post-type-mec-events.taxonomy-post_tag input[type=url]:focus, +.post-type-mec-events.taxonomy-post_tag select:focus, +.post-type-mec-events.taxonomy-post_tag textarea:focus, +.taxonomy-mec_location input[type=number]:focus, +.taxonomy-mec_location input[type=search]:focus, +.taxonomy-mec_location input[type=text]:focus, +.taxonomy-mec_location input[type=url]:focus, +.taxonomy-mec_location select:focus, +.taxonomy-mec_location textarea:focus, +.taxonomy-mec_organizer input[type=number]:focus, +.taxonomy-mec_organizer input[type=search]:focus, +.taxonomy-mec_organizer input[type=text]:focus, +.taxonomy-mec_organizer input[type=url]:focus, +.taxonomy-mec_organizer select:focus, +.taxonomy-mec_organizer textarea:focus, +.taxonomy-mec_speaker input[type=number]:focus, +.taxonomy-mec_speaker input[type=search]:focus, +.taxonomy-mec_speaker input[type=text]:focus, +.taxonomy-mec_speaker input[type=url]:focus, +.taxonomy-mec_speaker select:focus, +.taxonomy-mec_speaker textare a:focus, +.post-type-mec-books.taxonomy-mec_coupon .button:focus, +.post-type-mec-books.taxonomy-mec_coupon .button-secondary:focus, +.post-type-mec-events.taxonomy-mec_category .button:focus, +.post-type-mec-events.taxonomy-mec_category .button-secondary:focus, +.post-type-mec-events.taxonomy-mec_label .button:focus, +.post-type-mec-events.taxonomy-mec_label .button-secondary:focus, +.post-type-mec-events.taxonomy-post_tag .button:focus, +.post-type-mec-events.taxonomy-post_tag .button-secondary:focus, +.taxonomy-mec_location .button:focus, +.taxonomy-mec_location .button-secondary:focus, +.taxonomy-mec_organizer .button:focus, +.taxonomy-mec_organizer .button-secondary:focus, +.taxonomy-mec_speaker .button:focus, +#mec_add_fee_button:focus, +#mec_add_ticket_variation_button:focus, +#mec_meta_box_downloadable_file_options #mec_downloadable_file_remove_image_button:focus, +#taxes_option #mec_fees_list .mec-form-row .button:focus, +#ticket_variations_option #mec_ticket_variations_list .mec-form-row .button:focus, +.mec-export-settings:focus, +.mec-import-settings:focus, +.mec-meta-box-fields .mec-form-row .button:not(.wp-color-result):focus, +.mec-occurrences-wrapper .button:not(.wp-color-result):focus, +.mec-calendar-metabox .mec-form-row input[type=checkbox]:focus, +.mec-meta-box-fields .mec-form-row input[type=checkbox]:focus, +.mec-attendees-wrapper select:focus, +.mec-calendar-metabox .wn-mec-select:focus, +.mec-form-row input[type=date]:focus, +.mec-form-row input[type=email]:focus, +.mec-form-row input[type=number]:focus, +.mec-form-row input[type=tel]:focus, +.mec-form-row input[type=text]:focus, +.mec-form-row input[type=url]:focus, +.mec-form-row select:focus, +.mec-form-row textarea:focus, +.mec-form-row.mec-skin-list-date-format-container input[type=text]:focus, +.mec-occurrences-wrapper input[type=date]:focus, +.mec-occurrences-wrapper input[type=email]:focus, +.mec-occurrences-wrapper input[type=number]:focus, +.mec-occurrences-wrapper input[type=tel]:focus, +.mec-occurrences-wrapper input[type=text]:focus, +.mec-occurrences-wrapper input[type=url]:focus, +.mec-occurrences-wrapper select:focus, +.mec-occurrences-wrapper textarea:focus, +.mec-add-booking-tabs-left a:focus, +.mec-add-event-tabs-left a:focus, +.mec-create-shortcode-tabs-left a:focus, +#mec-event-data input[type=date]:focus, +#mec-event-data input[type=email]:focus, +#mec-event-data input[type=tel]:focus, +#mec-event-data input[type=text]:focus, +#mec-event-data input[type=url]:focus, +#mec-event-data select:focus, +#mec-event-data textarea:focus, +#mec_exceptions_not_in_days_date:focus, +#mec_meta_box_date_form input[type=text]:focus, +#mec_select_tags.mec-create-shortcode-tab-content input[type=text]:focus, +#mec_settings_weather_module_api_key:focus, +#webnus-dashboard .mec-intro-section .mec-intro-section-link-tag.button-primary:focus, +#webnus-dashboard .total-bookings button:focus, +#webnus-dashboard .w-box.total-bookings ul li a:focus, +#webnus-dashboard .mec-intro-section .mec-intro-section-link-tag:focus, +button.fserv-button-submit:focus, +.post-type-mec-events #mec_metabox_label input[type=checkbox]:focus, +.post-type-mec-events .components-panel__body input[type=checkbox]:focus { + outline: #000 auto 1px; +} + +.mec-sed-methods li.active, +.mec-sed-methods li.active a, +.mec-add-booking-tabs-left a.mec-tab-active, +.mec-add-event-tabs-left a.mec-tab-active, +.mec-create-shortcode-tabs-left a.mec-tab-active, +.mec-add-booking-tabs-left a, +.mec-add-event-tabs-left a, +.mec-create-shortcode-tabs-left a, +.post-type-mec-books.taxonomy-mec_coupon .button, +.post-type-mec-books.taxonomy-mec_coupon .button-secondary, +.post-type-mec-events.taxonomy-mec_category .button, +.post-type-mec-events.taxonomy-mec_category .button-secondary, +.post-type-mec-events.taxonomy-mec_label .button, +.post-type-mec-events.taxonomy-mec_label .button-secondary, +.post-type-mec-events.taxonomy-post_tag .button, +.post-type-mec-events.taxonomy-post_tag .button-secondary, +.taxonomy-mec_location .button, +.taxonomy-mec_location .button-secondary, +.taxonomy-mec_organizer .button, +.taxonomy-mec_organizer .button-secondary, +.taxonomy-mec_speaker .button, +.taxonomy-mec_category .wp-color-result-text { + color: #000; +} + +#mec_calendar_filter .description { + color: #000 !important; +} + +.mec-switcher input { + margin: 0 0 0 0 !important; + bottom: -1px; + left: -1px; + visibility: unset; + width: 63px !important; + height: 36px !important; + border-radius: 40px; +} + +#mec_calendar_display_options .mec-col-4 input[type=checkbox] { + margin-left: 0!important; +} \ No newline at end of file diff --git a/assets/css/a11y-backend.min.css b/assets/css/a11y-backend.min.css new file mode 100755 index 0000000..7e2efcb --- /dev/null +++ b/assets/css/a11y-backend.min.css @@ -0,0 +1 @@ +#webnus-dashboard input:focus-visible,#webnus-dashboard select:focus-visible,.mec-add-booking-tabs-left a:focus-visible,.mec-add-event-tabs-left a:focus-visible,.mec-sed-methods li a:focus-visible,.mec-sed-methods li.active a:focus-visible{outline:#000 auto 1px}#mec-event-data input[type=date]:focus,#mec-event-data input[type=email]:focus,#mec-event-data input[type=tel]:focus,#mec-event-data input[type=text]:focus,#mec-event-data input[type=url]:focus,#mec-event-data select:focus,#mec-event-data textarea:focus,#mec_add_fee_button:focus,#mec_add_ticket_variation_button:focus,#mec_exceptions_not_in_days_date:focus,#mec_meta_box_date_form input[type=text]:focus,#mec_meta_box_downloadable_file_options #mec_downloadable_file_remove_image_button:focus,#mec_select_tags.mec-create-shortcode-tab-content input[type=text]:focus,#mec_settings_weather_module_api_key:focus,#taxes_option #mec_fees_list .mec-form-row .button:focus,#ticket_variations_option #mec_ticket_variations_list .mec-form-row .button:focus,#webnus-dashboard .mec-intro-section .mec-intro-section-link-tag.button-primary:focus,#webnus-dashboard .mec-intro-section .mec-intro-section-link-tag:focus,#webnus-dashboard .total-bookings button:focus,#webnus-dashboard .w-box.total-bookings ul li a:focus,.mec-add-booking-tabs-left a:focus,.mec-add-event-tabs-left a:focus,.mec-add-event-tabs-wrap .select2-container:focus,.mec-attendees-wrapper select:focus,.mec-calendar-metabox .mec-form-row input[type=checkbox]:focus,.mec-calendar-metabox .wn-mec-select:focus,.mec-create-shortcode-tab-content .select2-container:focus,.mec-create-shortcode-tabs-left a:focus,.mec-export-settings:focus,.mec-form-row input[type=date]:focus,.mec-form-row input[type=email]:focus,.mec-form-row input[type=number]:focus,.mec-form-row input[type=tel]:focus,.mec-form-row input[type=text]:focus,.mec-form-row input[type=url]:focus,.mec-form-row select:focus,.mec-form-row textarea:focus,.mec-form-row.mec-skin-list-date-format-container input[type=text]:focus,.mec-import-settings:focus,.mec-meta-box-fields .mec-form-row .button:not(.wp-color-result):focus,.mec-meta-box-fields .mec-form-row input[type=checkbox]:focus,.mec-occurrences-wrapper .button:not(.wp-color-result):focus,.mec-occurrences-wrapper input[type=date]:focus,.mec-occurrences-wrapper input[type=email]:focus,.mec-occurrences-wrapper input[type=number]:focus,.mec-occurrences-wrapper input[type=tel]:focus,.mec-occurrences-wrapper input[type=text]:focus,.mec-occurrences-wrapper input[type=url]:focus,.mec-occurrences-wrapper select:focus,.mec-occurrences-wrapper textarea:focus,.mec-sed-methods li.active:focus,.post-type-mec-books.taxonomy-mec_coupon .button-secondary:focus,.post-type-mec-books.taxonomy-mec_coupon .button:focus,.post-type-mec-books.taxonomy-mec_coupon input[type=number]:focus,.post-type-mec-books.taxonomy-mec_coupon input[type=search]:focus,.post-type-mec-books.taxonomy-mec_coupon input[type=text]:focus,.post-type-mec-books.taxonomy-mec_coupon input[type=url]:focus,.post-type-mec-books.taxonomy-mec_coupon select:focus,.post-type-mec-books.taxonomy-mec_coupon textarea:focus,.post-type-mec-events #mec_metabox_label input[type=checkbox]:focus,.post-type-mec-events .components-panel__body input[type=checkbox]:focus,.post-type-mec-events.taxonomy-mec_category .button-secondary:focus,.post-type-mec-events.taxonomy-mec_category .button:focus,.post-type-mec-events.taxonomy-mec_category input[type=number]:focus,.post-type-mec-events.taxonomy-mec_category input[type=search]:focus,.post-type-mec-events.taxonomy-mec_category input[type=text]:focus,.post-type-mec-events.taxonomy-mec_category input[type=url]:focus,.post-type-mec-events.taxonomy-mec_category select:focus,.post-type-mec-events.taxonomy-mec_category textarea:focus,.post-type-mec-events.taxonomy-mec_label .button-secondary:focus,.post-type-mec-events.taxonomy-mec_label .button:focus,.post-type-mec-events.taxonomy-mec_label input[type=number]:focus,.post-type-mec-events.taxonomy-mec_label input[type=search]:focus,.post-type-mec-events.taxonomy-mec_label input[type=text]:focus,.post-type-mec-events.taxonomy-mec_label input[type=url]:focus,.post-type-mec-events.taxonomy-mec_label select:focus,.post-type-mec-events.taxonomy-mec_label textarea:focus,.post-type-mec-events.taxonomy-post_tag .button-secondary:focus,.post-type-mec-events.taxonomy-post_tag .button:focus,.post-type-mec-events.taxonomy-post_tag input[type=number]:focus,.post-type-mec-events.taxonomy-post_tag input[type=search]:focus,.post-type-mec-events.taxonomy-post_tag input[type=text]:focus,.post-type-mec-events.taxonomy-post_tag input[type=url]:focus,.post-type-mec-events.taxonomy-post_tag select:focus,.post-type-mec-events.taxonomy-post_tag textarea:focus,.taxonomy-mec_location .button-secondary:focus,.taxonomy-mec_location .button:focus,.taxonomy-mec_location input[type=number]:focus,.taxonomy-mec_location input[type=search]:focus,.taxonomy-mec_location input[type=text]:focus,.taxonomy-mec_location input[type=url]:focus,.taxonomy-mec_location select:focus,.taxonomy-mec_location textarea:focus,.taxonomy-mec_organizer .button-secondary:focus,.taxonomy-mec_organizer .button:focus,.taxonomy-mec_organizer input[type=number]:focus,.taxonomy-mec_organizer input[type=search]:focus,.taxonomy-mec_organizer input[type=text]:focus,.taxonomy-mec_organizer input[type=url]:focus,.taxonomy-mec_organizer select:focus,.taxonomy-mec_organizer textarea:focus,.taxonomy-mec_speaker .button:focus,.taxonomy-mec_speaker input[type=number]:focus,.taxonomy-mec_speaker input[type=search]:focus,.taxonomy-mec_speaker input[type=text]:focus,.taxonomy-mec_speaker input[type=url]:focus,.taxonomy-mec_speaker select:focus,.taxonomy-mec_speaker textare a:focus,button.fserv-button-submit:focus{outline:#000 auto 1px}.mec-add-booking-tabs-left a,.mec-add-booking-tabs-left a.mec-tab-active,.mec-add-event-tabs-left a,.mec-add-event-tabs-left a.mec-tab-active,.mec-create-shortcode-tabs-left a,.mec-create-shortcode-tabs-left a.mec-tab-active,.mec-sed-methods li.active,.mec-sed-methods li.active a,.post-type-mec-books.taxonomy-mec_coupon .button,.post-type-mec-books.taxonomy-mec_coupon .button-secondary,.post-type-mec-events.taxonomy-mec_category .button,.post-type-mec-events.taxonomy-mec_category .button-secondary,.post-type-mec-events.taxonomy-mec_label .button,.post-type-mec-events.taxonomy-mec_label .button-secondary,.post-type-mec-events.taxonomy-post_tag .button,.post-type-mec-events.taxonomy-post_tag .button-secondary,.taxonomy-mec_category .wp-color-result-text,.taxonomy-mec_location .button,.taxonomy-mec_location .button-secondary,.taxonomy-mec_organizer .button,.taxonomy-mec_organizer .button-secondary,.taxonomy-mec_speaker .button{color:#000}#mec_calendar_filter .description{color:#000!important}.mec-switcher input{margin:0!important;bottom:-1px;left:-1px;visibility:unset;width:63px!important;height:36px!important;border-radius:40px}#mec_calendar_display_options .mec-col-4 input[type=checkbox]{margin-left:0!important} \ No newline at end of file diff --git a/assets/css/a11y.css b/assets/css/a11y.css new file mode 100755 index 0000000..6a36c14 --- /dev/null +++ b/assets/css/a11y.css @@ -0,0 +1,119 @@ +.mec-calendar.mec-calendar-daily .mec-calendar-d-table .mec-daily-view-day, +.mec-calendar.mec-calendar-weekly .mec-calendar-d-table dl dt.mec-weekly-disabled.mec-table-nullday span { + font-weight: 300; +} + +.mec-load-more-button, +.mec-wrap .mec-totalcal-box i, +.mec-event-footer .mec-booking-button, +.mec-event-sharing-wrap li a, +.mec-event-sharing-wrap:hover li ul li a, +.mec-price-details, +.mec-price-details span, +.mec-event-footer .mec-modal-booking-button, +.mec-wrap .mec-totalcal-box .mec-totalcal-view span.mec-totalcalview-selected, +.event-carousel-type2-head .mec-event-carousel-content-type2 .mec-event-date-info, +.event-carousel-type2-head .mec-event-footer-carousel-type2 .mec-booking-button, +.mec-checkboxes-search .mec-searchbar-category-wrap, +.mec-wrap .mec-totalcal-box .mec-totalcal-view span, +.mec-wrap .mec-totalcal-box input, +.mec-wrap .mec-totalcal-box select, +.mec-wrap .mec-totalcal-box .mec-totalcal-view span, +.mec-wrap .mec-totalcal-box label, +.mec-calendar .mec-event-article .mec-event-detail, +.mec-calendar .mec-calendar-side .mec-next-month a, +.mec-calendar .mec-calendar-side .mec-previous-month a, +.mec-calendar .mec-table-nullday, +.mec-single-event .mec-current, +.mec-single-event .mec-event-meta .mec-events-event-categories a, +.mec-single-event .mec-event-meta dd, +.mec-single-event .mec-next-event-details abbr, +.mec-yearly-view-wrap .mec-agenda-date-wrap i, +.mec-yearly-view-wrap .mec-agenda-date-wrap span.mec-agenda-day, +.mec-calendar.mec-calendar-daily .mec-calendar-d-table .mec-daily-view-day, +.mec-calendar.mec-calendar-weekly .mec-calendar-d-table dl dt span, +.mec-skin-tile-month-navigator-container .mec-next-month, +.mec-skin-tile-month-navigator-container .mec-previous-month, +.mec-events-agenda-wrap span.mec-agenda-day, +.mec-events-agenda-wrap .mec-agenda-time, +.mec-event-grid-modern .event-grid-modern-head .mec-event-day, +.mec-event-grid-modern .mec-event-content p, +.mec-event-grid-clean .mec-event-content p, +.mec-event-grid-classic .mec-event-content p, +.mec-event-list-modern .mec-event-date .event-f, +.mec-event-list-modern .mec-event-date .event-da, +.mec-wrap .mec-time-details, +.mec-wrap .mec-event-detail, +.mec-wrap .mec-event-loc-place, +.mec-skin-tile-month-navigator-container .mec-next-month a, +.mec-skin-tile-month-navigator-container .mec-previous-month a, +.mec-skin-tile-month-navigator-container .mec-next-month, +.mec-skin-tile-month-navigator-container .mec-previous-month, +.mec-yearly-view-wrap .mec-yearly-title-sec .mec-next-year, +.mec-yearly-view-wrap .mec-yearly-title-sec .mec-previous-year, +.mec-yearly-view-wrap .mec-yearly-title-sec .mec-next-year a, +.mec-yearly-view-wrap .mec-yearly-title-sec .mec-previous-year a, +.mec-calendar.mec-calendar-daily .mec-calendar-a-month .mec-next-month, +.mec-calendar.mec-calendar-daily .mec-calendar-a-month .mec-previous-month, +.mec-calendar.mec-calendar-daily .mec-calendar-a-month .mec-next-month a, +.mec-calendar.mec-calendar-daily .mec-calendar-a-month .mec-previous-month a, +.mec-calendar.mec-calendar-daily .mec-calendar-d-top h2, +.mec-calendar.mec-calendar-daily .mec-calendar-d-top h3, +.mec-calendar.mec-calendar-daily .mec-today-container .mec-today-count, +.mec-calendar.mec-calendar-timetable .mec-calendar-d-table dl dt.mec-timetable-has-no-event, +.mec-calendar.mec-calendar-timetable .mec-calendar-d-table dl dt.mec-timetable-has-no-event:hover, +.mec-events-meta-group-countdown .countdown-w .block-w li, +.mec-countdown-details .countdown-w .clockdiv li p, +.mec-event-schedule-content dl dt.mec-schedule-description, +.mec-single-event .mec-speakers-details ul li .mec-speaker-job-title, +.mec-single-event .mec-event-meta dd a, +.mec-single-event .mec-address, +.mec-next-month a, +.mec-previous-month a, +.mec-single-event .mec-event-meta dd.mec-organizer-email a, +.mec-single-event .mec-events-meta-date dd span, +.mec-single-event .mec-single-event-additional-organizers dd span, +.mec-single-event .mec-single-event-organizer dd span, +.mec-related-event-content, +.mec-single-event .mec-events-meta-group-booking .mec-event-ticket-available, +.mec-wrap .button, +.mec-wrap a.button:not(.owl-dot), +.mec-wrap button:not(.owl-dot):not(.gm-control-active):not(.mejs), +.mec-wrap input[type=button], +.mec-wrap input[type=reset], +.mec-wrap input[type=submit] { + color: #000; +} + +.mec-event-grid-modern .mec-event-footer .mec-modal-booking-button:hover, +.mec-wrap .mec-av-spot-wrap p, +.mec-event-tile-view ul.mec-categories li.mec-category a, +.mec-event-tile-view .mec-event-loc-place, +.mec-skin-grid-container .mec-event-grid-novel .mec-event-address, +.mec-skin-grid-container .mec-event-grid-novel .mec-event-detail, +.mec-skin-grid-container .mec-event-grid-novel .mec-event-month, +.mec-skin-grid-container .mec-event-grid-novel ul.mec-categories li.mec-category a, +.mec-skin-grid-container .mec-event-grid-novel ul.mec-categories li.mec-category a:before, +.mec-skin-grid-container .mec-event-grid-novel .mec-shortcode-organizers a, +.mec-skin-grid-container .mec-event-grid-novel .mec-shortcode-organizers i:before, +.mec-event-grid-colorful ul.mec-categories li.mec-category a, +.mec-event-grid-colorful .mec-event-content .mec-grid-event-location, +.mec-event-grid-colorful .event-grid-modern-head .mec-event-day, +.mec-event-grid-colorful ul.mec-categories li.mec-category a, +.mec-wrap .mec-skin-grid-events-container .mec-time-details, +.mec-wrap .mec-skin-grid-events-container .mec-event-loc-place, +.mec-wrap .mec-event-grid-classic .mec-time-details { + color: #fff; +} + +.mec-wrap select:focus-visible, +.mec-wrap input:focus-visible { + outline: #000 auto 1px; +} + +.mec-booking .mec-event-tickets-list .mec-ticket-available-spots .plus:focus, +.mec-booking .mec-event-tickets-list .mec-ticket-available-spots .minus:focus, +.mec-calendar .mec-calendar-side .mec-next-month:focus, +.mec-calendar .mec-calendar-side .mec-previous-month:focus { + outline: #000 auto 1px; +} \ No newline at end of file diff --git a/assets/css/a11y.min.css b/assets/css/a11y.min.css new file mode 100755 index 0000000..ada0e11 --- /dev/null +++ b/assets/css/a11y.min.css @@ -0,0 +1 @@ +.mec-calendar.mec-calendar-daily .mec-calendar-d-table .mec-daily-view-day,.mec-calendar.mec-calendar-weekly .mec-calendar-d-table dl dt.mec-weekly-disabled.mec-table-nullday span{font-weight:300}.event-carousel-type2-head .mec-event-carousel-content-type2 .mec-event-date-info,.event-carousel-type2-head .mec-event-footer-carousel-type2 .mec-booking-button,.mec-calendar .mec-calendar-side .mec-next-month a,.mec-calendar .mec-calendar-side .mec-previous-month a,.mec-calendar .mec-event-article .mec-event-detail,.mec-calendar .mec-table-nullday,.mec-calendar.mec-calendar-daily .mec-calendar-a-month .mec-next-month,.mec-calendar.mec-calendar-daily .mec-calendar-a-month .mec-next-month a,.mec-calendar.mec-calendar-daily .mec-calendar-a-month .mec-previous-month,.mec-calendar.mec-calendar-daily .mec-calendar-a-month .mec-previous-month a,.mec-calendar.mec-calendar-daily .mec-calendar-d-table .mec-daily-view-day,.mec-calendar.mec-calendar-daily .mec-calendar-d-top h2,.mec-calendar.mec-calendar-daily .mec-calendar-d-top h3,.mec-calendar.mec-calendar-daily .mec-today-container .mec-today-count,.mec-calendar.mec-calendar-timetable .mec-calendar-d-table dl dt.mec-timetable-has-no-event,.mec-calendar.mec-calendar-timetable .mec-calendar-d-table dl dt.mec-timetable-has-no-event:hover,.mec-calendar.mec-calendar-weekly .mec-calendar-d-table dl dt span,.mec-checkboxes-search .mec-searchbar-category-wrap,.mec-countdown-details .countdown-w .clockdiv li p,.mec-event-footer .mec-booking-button,.mec-event-footer .mec-modal-booking-button,.mec-event-grid-classic .mec-event-content p,.mec-event-grid-clean .mec-event-content p,.mec-event-grid-modern .event-grid-modern-head .mec-event-day,.mec-event-grid-modern .mec-event-content p,.mec-event-list-modern .mec-event-date .event-da,.mec-event-list-modern .mec-event-date .event-f,.mec-event-schedule-content dl dt.mec-schedule-description,.mec-event-sharing-wrap li a,.mec-event-sharing-wrap:hover li ul li a,.mec-events-agenda-wrap .mec-agenda-time,.mec-events-agenda-wrap span.mec-agenda-day,.mec-events-meta-group-countdown .countdown-w .block-w li,.mec-load-more-button,.mec-next-month a,.mec-previous-month a,.mec-price-details,.mec-price-details span,.mec-related-event-content,.mec-single-event .mec-address,.mec-single-event .mec-current,.mec-single-event .mec-event-meta .mec-events-event-categories a,.mec-single-event .mec-event-meta dd,.mec-single-event .mec-event-meta dd a,.mec-single-event .mec-event-meta dd.mec-organizer-email a,.mec-single-event .mec-events-meta-date dd span,.mec-single-event .mec-events-meta-group-booking .mec-event-ticket-available,.mec-single-event .mec-next-event-details abbr,.mec-single-event .mec-single-event-additional-organizers dd span,.mec-single-event .mec-single-event-organizer dd span,.mec-single-event .mec-speakers-details ul li .mec-speaker-job-title,.mec-skin-tile-month-navigator-container .mec-next-month,.mec-skin-tile-month-navigator-container .mec-next-month a,.mec-skin-tile-month-navigator-container .mec-previous-month,.mec-skin-tile-month-navigator-container .mec-previous-month a,.mec-wrap .button,.mec-wrap .mec-event-detail,.mec-wrap .mec-event-loc-place,.mec-wrap .mec-time-details,.mec-wrap .mec-totalcal-box .mec-totalcal-view span,.mec-wrap .mec-totalcal-box .mec-totalcal-view span.mec-totalcalview-selected,.mec-wrap .mec-totalcal-box i,.mec-wrap .mec-totalcal-box input,.mec-wrap .mec-totalcal-box label,.mec-wrap .mec-totalcal-box select,.mec-wrap a.button:not(.owl-dot),.mec-wrap button:not(.owl-dot):not(.gm-control-active):not(.mejs),.mec-wrap input[type=button],.mec-wrap input[type=reset],.mec-wrap input[type=submit],.mec-yearly-view-wrap .mec-agenda-date-wrap i,.mec-yearly-view-wrap .mec-agenda-date-wrap span.mec-agenda-day,.mec-yearly-view-wrap .mec-yearly-title-sec .mec-next-year,.mec-yearly-view-wrap .mec-yearly-title-sec .mec-next-year a,.mec-yearly-view-wrap .mec-yearly-title-sec .mec-previous-year,.mec-yearly-view-wrap .mec-yearly-title-sec .mec-previous-year a{color:#000}.mec-event-grid-colorful .event-grid-modern-head .mec-event-day,.mec-event-grid-colorful .mec-event-content .mec-grid-event-location,.mec-event-grid-colorful ul.mec-categories li.mec-category a,.mec-event-grid-modern .mec-event-footer .mec-modal-booking-button:hover,.mec-event-tile-view .mec-event-loc-place,.mec-event-tile-view ul.mec-categories li.mec-category a,.mec-skin-grid-container .mec-event-grid-novel .mec-event-address,.mec-skin-grid-container .mec-event-grid-novel .mec-event-detail,.mec-skin-grid-container .mec-event-grid-novel .mec-event-month,.mec-skin-grid-container .mec-event-grid-novel .mec-shortcode-organizers a,.mec-skin-grid-container .mec-event-grid-novel .mec-shortcode-organizers i:before,.mec-skin-grid-container .mec-event-grid-novel ul.mec-categories li.mec-category a,.mec-skin-grid-container .mec-event-grid-novel ul.mec-categories li.mec-category a:before,.mec-wrap .mec-av-spot-wrap p,.mec-wrap .mec-event-grid-classic .mec-time-details,.mec-wrap .mec-skin-grid-events-container .mec-event-loc-place,.mec-wrap .mec-skin-grid-events-container .mec-time-details{color:#fff}.mec-wrap input:focus-visible,.mec-wrap select:focus-visible{outline:#000 auto 1px}.mec-booking .mec-event-tickets-list .mec-ticket-available-spots .minus:focus,.mec-booking .mec-event-tickets-list .mec-ticket-available-spots .plus:focus,.mec-calendar .mec-calendar-side .mec-next-month:focus,.mec-calendar .mec-calendar-side .mec-previous-month:focus{outline:#000 auto 1px} \ No newline at end of file diff --git a/assets/css/admin-calendar.min.css b/assets/css/admin-calendar.min.css new file mode 100755 index 0000000..79c8c9a --- /dev/null +++ b/assets/css/admin-calendar.min.css @@ -0,0 +1,288 @@ +.mec-calendar .mec-calendar-side { + width: 590px; + display: table-cell; + padding: 40px; + position: relative; + text-align: center; + box-shadow: 0 1px 5px 6px rgba(0, 0, 0, .005) inset +} + +.mec-calendar .mec-calendar-header { + position: relative; + margin-top: 8px; + margin-bottom: 16px +} + +.mec-calendar .mec-calendar-header h2 { + text-transform: uppercase; + font-size: 22px; + font-weight: 700; + color: #333 +} + +.mec-calendar dl { + display: table; + margin: 0; + border: none; + padding: 0; + table-layout: fixed +} + +.mec-calendar dt { + display: table-cell; + transition: .66s; + color: #a4aab1; + background: #fff; + border-radius: 44px; + font-size: 16px; + width: 80px; + height: 80px; + line-height: 80px; + text-align: center +} + +.mec-calendar .mec-calendar-side .mec-next-month, +.mec-calendar .mec-calendar-side .mec-previous-month { + cursor: pointer; + position: absolute; + top: 0; + min-width: 50px; + height: 50px; + line-height: 50px; + text-align: center; + background: #fff; + color: #a9a9a9; + font-size: 12px; + letter-spacing: 1px; + text-transform: uppercase; + padding-left: 10px; + padding-right: 10px; + border: 1px solid #efefef; + border-top: none; + box-shadow: 0 2px 0 0 rgba(0, 0, 0, .015); + transition: .33s +} + +.mec-calendar .mec-calendar-side .mec-next-month i, +.mec-calendar .mec-calendar-side .mec-previous-month i { + font-size: 12px; + color: #40d9f1; + cursor: pointer +} + +.mec-calendar .mec-calendar-side .mec-next-month:hover, +.mec-calendar .mec-calendar-side .mec-previous-month:hover { + background-color: #f9f9f9; + color: #40d9f1 +} + +.mec-box-calendar.mec-calendar .mec-has-event a, +.mec-box-calendar.mec-calendar dt { + border-radius: 0 +} + +.mec-box-calendar.mec-calendar .mec-calendar-header { + margin-top: 2px; + margin-bottom: 30px +} + +.mec-box-calendar.mec-calendar dt { + border-bottom: 1px solid #eaeaea; + border-left: 1px solid #eaeaea +} + +.mec-box-calendar.mec-calendar .mec-calendar-side .mec-next-month, +.mec-box-calendar.mec-calendar .mec-calendar-side .mec-previous-month { + border-radius: 2px; + top: 40px; + border: 1px solid #eee; + height: 30px; + line-height: 30px; + z-index: 1 +} + +.mec-calendar.mec-event-calendar-classic, +.mec-calendar.mec-event-calendar-classic .mec-calendar-side { + border: none; + padding: 0; + width: 100%; + height: 100%; + box-shadow: none +} + +.mec-calendar.mec-event-calendar-classic .mec-calendar-side { + display: block +} + +.mec-calendar.mec-event-calendar-classic dl.mec-calendar-row, +.mec-calendar.mec-event-calendar-classic dl.mec-calendar-table-head { + width: 100% +} + +.mec-calendar.mec-event-calendar-classic dl.mec-calendar-table-head { + background: #f5f6f7 +} + +.mec-calendar.mec-event-calendar-classic dl.mec-calendar-table-head .mec-calendar-day-head { + background: 0 0; + height: unset; + line-height: 36px; + border-top: 1px solid #eaeaea +} + +.mec-calendar.mec-event-calendar-classic dl dt { + width: 15%; + height: 136px; + line-height: 1.2; + text-align: left; + padding: 5px 7px; + position: relative +} + +.mec-box-calendar.mec-calendar.mec-event-calendar-classic .mec-calendar-side .mec-next-month, +.mec-box-calendar.mec-calendar.mec-event-calendar-classic .mec-calendar-side .mec-previous-month { + top: 0 +} + +.mec-box-calendar.mec-calendar.mec-event-calendar-classic .mec-calendar-side .mec-next-month { + right: 0 +} + +.mec-event-container-simple .mec-monthly-tooltip h4 { + font-size: 13px; + font-weight: 500; + margin: 0; + color: #444; + border: none +} + +.mec-event-container-simple .mec-monthly-tooltip.event-single-link-simple { + padding: 0 2px; + display: block +} + +.mec-calendar.mec-event-container-simple dl dt.mec-calendar-day { + color: #000 +} + +.mec-calendar.mec-event-container-simple dl dt.mec-calendar-day div:first-child { + margin-bottom: 10px +} + +.mec-calendar.mec-event-container-simple .mec-calendar-row dt, +.mec-calendar.mec-event-container-simple .mec-calendar-row dt:last-child, +.mec-calendar.mec-event-container-simple .mec-calendar-table-head dt, +.mec-calendar.mec-event-container-simple .mec-calendar-table-head dt:last-child { + border-width: 2px +} + +@font-face { + font-family: simple-line-icons; + src: url("../fonts/Simple-Line-Icons.eot?v=2.3.1"); + src: url("../fonts/Simple-Line-Icons.eot?v=2.3.1#iefix") format("embedded-opentype"), url("../fonts/Simple-Line-Icons.woff2?v=2.3.1") format("woff2"), url("../fonts/Simple-Line-Icons.woff?v=2.3.1") format("woff"), url("../fonts/Simple-Line-Icons.ttf?v=2.3.1") format("truetype"), url("../fonts/Simple-Line-Icons.svg?v=2.3.1#simple-line-icons") format("svg"); + font-weight: 400; + font-style: normal +} + +[class*=mec-sl-] { + font-family: simple-line-icons; + speak: none; + font-style: normal; + font-weight: 400; + font-variant: normal; + text-transform: none; + line-height: 1; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale +} + +.mec-sl-angle-right:before { + content: "\e606" +} + +.mec-sl-angle-left:before { + content: "\e605" +} + +.mec-load-month-link { + color: #a9a9a9; + font-size: 12px; + font-weight: 400; + letter-spacing: 1px; + text-transform: uppercase; + text-decoration: unset; + transition: .33s +} + +.mec-wrap * { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box +} + +.mec-calendar.mec-event-container-simple dl dt.mec-selected-day, +.mec-calendar.mec-event-container-simple dl dt.mec-selected-day:hover { + color: #40d9f1; + border-bottom: 2px solid #40d9f1; + background: #fff +} + +.mec-calendar.mec-event-calendar-classic .mec-selected-day, +.mec-calendar.mec-event-calendar-classic dt.mec-selected-day:hover { + font-weight: 700; + background: #fafafa; + border-bottom: none +} + +.mec-color, +.mec-color-before :before, +.mec-color-hover:hover, +.mec-wrap .mec-color, +.mec-wrap .mec-color-before :before, +.mec-wrap .mec-color-hover:hover { + color: #40d9f1; + margin: 0; + width: unset; + height: unset +} + +.mec-box-calendar.mec-calendar dl dt:last-child { + border-right: 1px solid #eaeaea +} + +.mec-subscribe-to-calendar-container { + display: none +} + +.mec-admin-calendar-attendees-count { + font-size: 14px; + font-weight: 500; + color: #40d9f1 +} + +.mec-admin-calendar-attendees-count:hover { + text-decoration: underline; + cursor: pointer +} + +.mec-add-event-popup .lity-container { + width: 900px; + height: auto; + max-height: 70vh; + max-width: unset +} + +.mec-add-event-popup .lity-content { + background: #fff; + max-height: 400px; + overflow-y: scroll !important +} + +.mec-add-event-popup .lity-container .mec-attendees-head { + padding: 0 20px 18px; + margin-top: 25px +} + +.mec-attendees-content:not(:last-child) { + border-bottom: 1px solid #eee +} \ No newline at end of file diff --git a/assets/css/admin-upcoming.min.css b/assets/css/admin-upcoming.min.css new file mode 100755 index 0000000..db4c933 --- /dev/null +++ b/assets/css/admin-upcoming.min.css @@ -0,0 +1 @@ +#posts-filter, ul.subsubsub, .mec-credit-url{display: none} \ No newline at end of file diff --git a/assets/css/backend.css b/assets/css/backend.css new file mode 100755 index 0000000..0c324ae --- /dev/null +++ b/assets/css/backend.css @@ -0,0 +1,13908 @@ +body.toplevel_page_mec-intro, +body.m-e-calendar_page_MEC-settings, +body.mec_invoice_page_api-key-app, +body.m-e-calendar_page_MEC-addons, +body.m-e-calendar_page_MEC-report, +body.m-e-calendar_page_MEC-ix { + background: #fff; +} + +body.toplevel_page_mec-intro #webnus-dashboard .mec-cmsg-2-notification-box-wrap { + margin-top: 0 !important; +} + +#mec_location_thumbnail_img img, +#mec_organizer_thumbnail_img img, +#mec_sponsor_thumbnail_img img, +#mec_thumbnail_img img { + max-width: 250px; +} + +.taxonomy-mec_label .column-id, +.taxonomy-mec_location .column-id, +.taxonomy-mec_organizer .column-id, +.taxonomy-mec_speaker .column-id, +.taxonomy-mec_sponsor .column-id { + width: 40px; +} + +.taxonomy-mec_label .column-primary, +.taxonomy-mec_location .column-primary, +.taxonomy-mec_organizer .column-primary, +.taxonomy-mec_speaker .column-primary, +.taxonomy-mec_sponsor .column-primary { + width: 250px; +} + +.mec-color { + width: 16px; + height: 16px; + display: inline-block; + border-radius: 50%; + margin: 6px 10px 6px 0; + vertical-align: middle; +} + +.mec-send-email-button { + background: #008aff; + color: #fff; + width: 100%; + display: block; + text-align: center; + font-size: 20px; + padding: 10px 0; + margin-top: 18px; + font-weight: 700; + border-radius: 4px; + cursor: pointer; +} + +.mec-send-email-button:hover { + opacity: 0.9; +} + +.mec-event-color-container, +.mec-event-title-container { + display: inline-block; +} + +.mec-meta-box-colors-container .mec-form-row { + padding: 0 !important; +} + +.mec-meta-box-colors-container .mec-form-row .wp-picker-container { + margin: 10px 0; +} + +.mec-available-color-row { + margin-top: 0; +} + +.mec-available-color-row .mec-color { + cursor: pointer; +} + +.mec-widget-container a { + text-decoration: none; +} + +.mec-widget-container label { + padding-right: 15px; +} + +.mec-util-hidden { + display: none; +} + +.button.mec-util-hidden { + display: none; +} + +.wns-be-container { + max-width: 1020px; + background-color: #f7f8f9; + background-repeat: repeat-x; + border: 1px solid #dcdfe1; + border-radius: 15px; + overflow: hidden; + margin: 25px auto; + overflow: visible; + box-shadow: 0 1px 4px rgb(0 0 0 / 1%); + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; +} + +.wns-be-sidebar { + width: 230px; + float: left; + position: relative; +} + +.wns-be-sidebar ul.wns-be-group-menu, +.wns-be-sidebar ul.wns-be-group-menu li { + list-style: none; + margin: 0; + transition: all 0.2s ease; +} + +.wns-be-sidebar .wns-be-group-menu li a { + display: block; + position: relative; + outline: 0; + padding: 13px 4px 13px 20px; + background: #e3e5e7; + background: 0 0; + border: none; + color: #3f454a; + font-size: 14px; + font-weight: 600; + text-decoration: none; + transition: all 0.2s ease; +} + +.wns-be-sidebar .wns-be-group-menu>li:hover>a { + color: #07bbe9; + background: #fff; + opacity: 1; +} + +.wns-be-sidebar .wns-be-group-menu>li.active>a { + text-shadow: none; + background: #ecf9fd; + color: #07bbe9; + border-top: 1px solid #ccecf4; +} + +.wns-be-sidebar .wns-be-group-menu>li:first-child>a { + border-top: none; +} + +.wns-be-main { + background: #fff; + margin-left: 230px; + border-left: 1px solid #e6e9eb; + padding-bottom: 84px; + box-shadow: inset 0 1px 0 #fff; + min-height: 1110px; + position: relative; + z-index: 2; +} + +.wns-be-main .wns-saved-settings { + margin: 0; + border-bottom: 1px solid #dedede; + background: #dff0d8; + color: #468847; + padding: 8px 35px 8px 14px; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6); +} + +.wns-be-container .dpr-btn { + display: inline-block; + font-size: 13px; + padding: 0 16px 1px; + height: 36px; + margin-right: 3px; + line-height: 35px; + color: #555; + border: 1px solid #ccc; + background: #f7f7f7; + text-decoration: none; + transition: 0.24s all ease; + -webkit-transition: 0.24s all ease; +} + +.wns-be-container .dpr-btn:hover { + background: #fcfcfc; + border-color: #999; + color: #303030; +} + +.wns-be-container .dpr-btn.dpr-save-btn { + display: inline-block; + text-decoration: none; + padding: 0 16px; + height: 36px; + line-height: 36px; + font-weight: 500; + font-size: 14px; + border-radius: 20px; + box-shadow: 0 1px 2px rgb(0 0 0 / 2%); + text-shadow: none; + margin-right: 5px; + background: #fff; + color: #0ec3f3; + border: 1px solid #d1e5ec; + letter-spacing: 0.2px; + transition: 0.24s all ease; +} + +.wns-be-container .dpr-btn.dpr-save-btn { + box-shadow: 0 0 0 4px #e4ffe6; + text-shadow: none; + margin-right: 5px; + background: #64e385; + color: #fff; + border: none; + cursor: pointer; + padding: 1px 22px; +} + +.wns-be-container .dpr-btn.dpr-save-btn:hover { + box-shadow: 0 0 0 6px rgb(100 227 133 / 28%); + background: #54d274; + border-color: #4ac76a; +} + +.wns-be-container .wns-be-group-tab h2, +.wns-be-container .wns-be-group-tab h4 { + margin-bottom: 27px; + margin-top: 0; + padding: 12px 15px 12px 15px; + font-size: 21px; + line-height: 27px; + letter-spacing: -0.4px; + font-weight: 700; + position: relative; +} + +.wns-be-container .wns-be-group-tab h4, +.wns-be-container .wns-be-group-tab h5 { + margin: 5px 0 10px; +} + +.wns-be-container .wns-be-group-tab h2:before, +.wns-be-container .wns-be-group-tab h4:before { + content: ""; + width: 4px; + height: 16px; + margin-right: 5px; + background-color: #07bbe9; + display: block; + position: absolute; + left: 0; + top: 19px; +} + +.wns-be-container .wns-be-group-tab h5 { + font-size: 15px; + font-weight: 700; + margin: 30px 0 25px; + position: relative; +} + +.wns-be-container .wns-be-group-tab h5::after { + content: ""; + display: inline-block; + width: 100%; + height: 1px; + border-bottom: 1px solid #eee; + position: absolute; + top: 9px; + margin-left: 10px; +} + +.wns-be-group-tab #booking_form_option h5 { + font-size: 16px; + font-weight: 400; + margin: 35px 5px 10px; +} + +.wns-be-container .wns-be-group-tab p { + font-size: 12px; + line-height: 1.6; + color: #8d9599; + font-weight: 400; + margin: 0; +} + +.wns-be-sidebar .wns-be-group-tab-link-a span { + display: block; +} + +.wns-be-sidebar .wns-be-group-tab-link-a span.wns-be-group-menu-title { + padding-left: 24px; + padding-top: 1px; + font-size: 14px; + font-weight: 600; +} + +.wns-be-sidebar li.active ul.subsection { + padding-top: 8px; + padding-bottom: 12px; + background: #fff; + border-bottom: 1px solid #e6e9eb; + margin: 0; +} + +.wns-be-sidebar li .subsection a { + background: #fff; + color: #686f73; + opacity: 1; + font-size: 13px; + font-weight: 400; + cursor: pointer; + padding: 8px 4px 8px 46px; +} + +.wns-be-sidebar li .subsection a:hover { + background: #fafafa; + color: #242525; +} + +.wns-be-container li a:active, +.wns-be-container li a:focus { + outline: 0; + box-shadow: none; +} + +.wns-be-sidebar .wns-be-group-menu li .subsection li.active a { + color: #00b0dd; + position: relative; + z-index: 99; + font-weight: 500; +} + +.wns-be-sidebar .wns-be-group-menu li .subsection li.active a:after, +.wns-be-sidebar .wns-be-group-menu li .subsection li.active a:before { + position: absolute; + z-index: 9999; + content: " "; + height: 0; + width: 0; + border: 8px solid transparent; + border-right-color: #fff; + right: -1px; + top: 10px; +} + +.wns-be-sidebar .wns-be-group-menu li .subsection li.active a:before { + border-right-color: #d7d8d9; + right: 0; +} + +.wns-be-sidebar li a i { + color: #a0abb5; + vertical-align: middle; + font-size: 16px; + position: absolute; + margin-top: 2px; +} + +.wns-be-sidebar .wns-be-group-menu li.active>a i, +.wns-be-sidebar .wns-be-group-menu li:hover>a i { + color: #07bbe9; +} + +.wns-be-sidebar .has-sub span.extra-icon { + float: right; + padding: 4px 7px 4px; + margin-left: 4px; + margin-right: 10px; + font-family: sans-serif; + font-size: 9px; + font-weight: 600; + line-height: 9px; + border-radius: 10px; + -moz-border-radius: 10px; + -webkit-border-radius: 10px; + border: 0 solid transparent; +} + +.wns-be-sidebar .has-sub span.extra-icon i { + margin-left: -3px; + margin-top: 2px; + color: #bac6d0; + font-size: 10px; +} + +.wns-be-sidebar .wns-be-group-tab-link-a span.extra-icon i { + right: 10px; + font-size: 10px; +} + +.wns-be-sidebar .wns-be-group-menu li.active>a span.extra-icon i { + margin-top: 1px; +} + +.wns-be-container #wns-be-footer { + border-top: 1px solid #dedede; + z-index: 999; + padding: 25px 20px 20px; + background: #fafafa !important; + height: 44px; + text-align: right; + border-radius: 0 0 14px 14px; +} + +.wns-be-container #wns-be-content { + padding: 0px 20px 40px 40px; +} + +.wns-be-container #wns-be-infobar { + background: #fff; + border-bottom: 1px solid #e6e9eb; + padding: 20px; + text-align: right; + box-shadow: inset 0 1px 0 #fcfcfc; + height: 79px; + box-sizing: border-box; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + position: relative; + border-radius: 14px 14px 0 0; +} + +.wns-be-container #wns-be-infobar:before { + content: ""; + width: 93px; + height: 77px; + display: block; + position: absolute; + left: 0; + top: 0; + background: #fff url(../img/mec-logo-icon.png) no-repeat center; + background-size: 50px; + z-index: 997; + border-radius: 14px 0 0 0; +} + +.wns-be-container .notice-yellow { + margin: 0; + border-bottom: 1px solid #dedede; + background-color: #fcf8e3; + color: #c09853; + padding: 8px 35px 8px 14px; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); +} + +.wns-be-container .notice-red, +.wns-be-container .wns-be-field-errors { + margin: 0; + border-bottom: 1px solid #dedede; + background-color: #f2dede; + color: #b94a48; + padding: 8px 35px 8px 14px; + text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5); +} + +.wns-be-container #mec_styling_form .button, +.wns-be-container #mec_styling_form .button-secondary { + border-color: #e6e9eb; + background: #fff; + vertical-align: top; + border-radius: 4px; + box-shadow: 0 3px 10px -1px rgb(0 0 0 / 1%); + transition: all 0.2s ease; +} + +.wns-be-container .wp-color-result-text { + border-color: #e6e9eb; +} + +.wns-be-container #mec_styling_form .button-secondary:hover, +.wns-be-container #mec_styling_form .button.hover, +.wns-be-container #mec_styling_form .button:hover { + background: #f0f9fc; + border-color: #d1e5ec; +} + +.wns-be-container #mec_styling_form .wp-color-result:hover { + background: #f0f9fc; +} + +@media (max-width: 1280px) { + .wns-be-container { + width: 98%; + } + + .wns-be-container #wns-be-content { + padding: 5px 20px 20px; + } + + .wns-be-sidebar li .subsection a { + padding-left: 24px; + } + + .wns-be-main { + margin-left: 210px; + } + + .wns-be-sidebar { + width: 210px; + } + + .mec-form-row .mec-col-8 label, + .mec-form-row .mec-col-9 label { + padding-right: 14px; + } + + .wns-be-container #wns-be-content { + padding: 5px 10px 0; + } + + .mec-container { + padding: 8px; + } +} + +@media (max-width: 1024px) { + .wns-be-main .mec-form-row .mec-col-3 { + min-width: 200px; + } + + .wns-be-main .mec-form-row .mec-col-9 { + width: calc(100% - 210px); + } +} + +@media (max-width: 860px) { + .wns-be-main .mec-form-row .mec-col-3 { + max-width: 100% !important; + width: 100% !important; + margin-bottom: 10px !important; + } + + .wns-be-main .mec-form-row .mec-col-9 { + width: 100% !important; + } + + .mec-container { + padding-left: 0 !important; + } + + .wns-be-container #wns-be-infobar:before { + display: none; + } + + .mec-search-settings-wrap { + margin-top: 0 !important; + } + + #wns-be-infobar.sticky { + top: 0 !important; + } + + #mec-search-settings { + margin-bottom: 10px !important; + } +} + +@media (max-width: 640px) { + .wns-be-sidebar { + width: 150px; + } + + .wns-be-main { + margin-left: 150px; + } +} + +@media (max-width: 480px) { + a.dpr-btn.dpr-save-btn { + display: block !important; + text-align: center !important; + margin-top: 20px !important; + } + + .mec-search-settings-wrap { + text-align: center !important; + display: block !important; + } + + #mec-search-settings { + margin: 0 !important; + width: 100% !important; + } + + .wns-be-container #wns-be-infobar { + height: auto !important; + } + + .wns-be-container .wns-be-sidebar { + width: 100%; + position: unset; + float: none; + } + + .wns-be-container .wns-be-main { + margin-left: 0; + width: 100%; + position: unset; + } + + .wns-be-container { + margin-top: 50px; + } + + .wns-be-container #wns-be-infobar:before { + width: 100%; + } + + .wns-be-container #wns-be-infobar { + height: 150px; + } + + #mec-search-settings { + margin-top: 80px; + width: 181px; + } +} + +body.post-type-mec-events th.column-primary { + width: 35%; +} + +body.post-type-mec-events th.column-start_date { + width: 100px; +} + +body.post-type-mec-events th.column-end_date { + width: 100px; +} + +body.post-type-mec-events th.column-repeat { + width: 75px; +} + +body.post-type-mec-events th.column-author { + width: 150px; +} + +body.post-type-mec-books th.column-primary { + width: 20%; +} + +body.post-type-mec-books th.column-event { + width: 170px; +} + +body.post-type-mec-books th.column-bdate { + width: 120px; +} + +body.post-type-mec-books th.column-confirmation { + width: 120px; +} + +body.post-type-mec-books th.column-verification { + width: 120px; +} + +body.post-type-mec-books th.column-author { + width: 150px; +} + +.mec-meta-box-labels-container .mec-form-row { + overflow: auto; +} + +.mec-form-row.mec-last-tooltip { + padding-bottom: 100px !important; +} + +.mec-tooltip { + display: inline-block; + position: relative; + margin-right: 10px; + cursor: help; + bottom: 0; + /* padding-right: 10px; */ +} + +.mec-tooltip:last-child { + margin-right: 0; +} + +.mec-tooltip:hover:after { + background: #313130; + border-radius: 5px; + bottom: 24px; + color: #fff; + content: attr(title); + left: -75px; + padding: 10px; + position: absolute; + z-index: 98; + width: 240px; +} + +.mec-tooltip:hover:before { + border: solid; + border-color: #313130 transparent; + border-width: 6px 6px 0; + bottom: 18px; + content: ""; + left: 30%; + position: absolute; + z-index: 99; +} + +.mec-tooltip .dashicons-before:before { + font-size: 24px; + color: #40d9f1; + width: 24px; + height: 38px; + line-height: 38px; + padding: 0; +} + +.mec-tooltip a:focus { + box-shadow: none; +} + +.mec-form-row .bootstrap_unvalid { + display: block; + border: 2px solid red; + position: relative; + display: inline-block; + border-bottom: 1px dotted #000; +} + +.mec-tooltiptext { + visibility: hidden; + width: 120px; + background-color: red; + color: #fff; + text-align: center; + border-radius: 6px; + padding: 5px 0; + position: absolute; + z-index: 1; +} + +.ui-datepicker { + background-color: #fff; + border: 1px solid #66afe9; + border-radius: 4px; + box-shadow: 0 0 8px rgba(102, 175, 233, 0.6); + display: none; + margin-top: 4px; + padding: 10px; + width: 240px; +} + +.ui-datepicker a, +.ui-datepicker a:hover { + text-decoration: none; + cursor: pointer; +} + +.ui-datepicker a:hover, +.ui-datepicker td:hover a { + color: #2c6396; + -webkit-transition: color 0.1s ease-in-out; + -moz-transition: color 0.1s ease-in-out; + -o-transition: color 0.1s ease-in-out; + transition: color 0.1s ease-in-out; +} + +.ui-datepicker .ui-datepicker-header { + margin-bottom: 4px; + text-align: center; +} + +.ui-datepicker .ui-datepicker-title { + font-weight: 700; +} + +.ui-datepicker .ui-datepicker-next, +.ui-datepicker .ui-datepicker-prev { + cursor: default; + font-family: dashicons; + -webkit-font-smoothing: antialiased; + font-style: normal; + font-weight: 400; + height: 20px; + line-height: 1.4; + margin-top: 2px; + width: 20px; +} + +.ui-datepicker .ui-datepicker-prev { + float: left; + text-align: left; +} + +.ui-datepicker .ui-datepicker-next { + float: right; + text-align: center; +} + +.ui-datepicker .ui-datepicker-prev:before { + content: "\f341"; +} + +.ui-datepicker .ui-datepicker-next:before { + content: "\f345"; +} + +.ui-datepicker .ui-icon { + display: none; +} + +.ui-datepicker .ui-datepicker-calendar { + table-layout: fixed; + width: 100%; +} + +.ui-datepicker .ui-datepicker-calendar td, +.ui-datepicker .ui-datepicker-calendar th { + text-align: center; + padding: 4px 0; +} + +.ui-datepicker .ui-datepicker-calendar td { + border-radius: 4px; + -webkit-transition: background-color 0.1s ease-in-out, color 0.1s ease-in-out; + -moz-transition: background-color 0.1s ease-in-out, color 0.1s ease-in-out; + -o-transition: background-color 0.1s ease-in-out, color 0.1s ease-in-out; + transition: background-color 0.1s ease-in-out, color 0.1s ease-in-out; +} + +.ui-datepicker .ui-datepicker-calendar td:hover { + background-color: #eee; + cursor: pointer; +} + +.ui-datepicker .ui-datepicker-calendar td a { + text-decoration: none; +} + +.ui-datepicker .ui-datepicker-current-day { + background-color: #4289cc; +} + +.ui-datepicker .ui-datepicker-current-day a { + color: #fff; +} + +.ui-datepicker .ui-datepicker-calendar .ui-datepicker-unselectable:hover { + background-color: #fff; + cursor: default; +} + +.mec-col-1, +.mec-col-10, +.mec-col-11, +.mec-col-12, +.mec-col-2, +.mec-col-3, +.mec-col-4, +.mec-col-5, +.mec-col-6, +.mec-col-7, +.mec-col-8, +.mec-col-9 { + position: relative; + min-height: 1px; + padding: 0; + margin: 0; +} + +@media (min-width: 783px) { + + .mec-col-1, + .mec-col-10, + .mec-col-11, + .mec-col-12, + .mec-col-2, + .mec-col-3, + .mec-col-4, + .mec-col-5, + .mec-col-6, + .mec-col-7, + .mec-col-8, + .mec-col-9 { + float: left; + } + + .mec-col-12 { + width: 99%; + } + + .mec-col-11 { + width: 90.66666667%; + } + + .mec-col-10 { + width: 82.33333333%; + } + + .mec-col-9 { + width: 74%; + } + + .mec-col-8 { + width: 65.66666667%; + } + + .mec-col-7 { + width: 57.33333333%; + } + + .mec-col-6 { + width: 49%; + } + + .mec-col-5 { + width: 40.66666667%; + } + + .mec-col-4 { + width: 32.33333333%; + } + + .mec-col-3 { + width: 24%; + } + + .mec-col-2 { + width: 15.66666667%; + } + + .mec-col-1 { + width: 7.33333333%; + } +} + +#mec-occurrences .mec-occurrences-list, +#mec_bfixed_form_fields, +#mec_event_form_fields, +#mec_orgz_form_row, +#mec_reg_form_fields { + background: #f7f8f9; + padding: 20px; + margin: 0 0 20px 0; + border-radius: 3px; + min-height: 150px; + border: 2px dashed #dcdee0; +} + +#mec-occurrences .mec-occurrences-list li, +#mec_bfixed_form_fields li, +#mec_event_form_fields li, +#mec_orgz_form_row li, +#mec_reg_form_fields li { + border-radius: 5px; + padding: 25px; + background: #fff; + position: relative; + transition: all 0.3s ease; + border: 1px solid #f1f3f5; + box-shadow: 0 1px 5px rgb(0 0 0 / 2%); +} + +#mec_reg_form_fields li div input, +#mec_reg_form_fields li div select { + display: block; +} + +#mec_bfixed_form_fields li ul, +#mec_event_form_fields li ul, +#mec_reg_form_fields li ul { + padding-top: 15px; + padding-bottom: 15px; + margin: 1px; +} + +#mec_bfixed_form_fields li ul li, +#mec_event_form_fields li ul li, +#mec_reg_form_fields li ul li { + padding: 7px 30px 7px 46px; +} + +#mec_bfixed_form_fields span.mec_bfixed_field_type, +#mec_bfixed_form_fields span.mec_event_field_type, +#mec_event_form_fields span.mec_event_field_type, +#mec_orgz_form_row span.mec_orgz_item_name, +#mec_reg_form_fields span.mec_reg_field_type { + font-size: 12px; + font-weight: 600; + color: #07bbe9; + text-transform: capitalize; + letter-spacing: 0.3px; + padding-left: 20px; +} + +#mec-occurrences .mec-occurrences-list .mec-occurrences-delete-button, +#mec_bfixed_form_fields span.mec_bfixed_field_option_sort, +#mec_bfixed_form_fields span.mec_bfixed_field_remove, +#mec_bfixed_form_fields span.mec_bfixed_field_sort, +#mec_event_form_fields span.mec_event_field_option_sort, +#mec_event_form_fields span.mec_event_field_remove, +#mec_event_form_fields span.mec_event_field_sort, +#mec_orgz_form_row span.mec-additional-organizer-remove, +#mec_orgz_form_row span.mec-additional-organizer-sort, +#mec_reg_form_fields span.mec_reg_field_option_sort, +#mec_reg_form_fields span.mec_reg_field_remove, +#mec_reg_form_fields span.mec_reg_field_sort { + font-size: 0; + color: #fff; +} + +#mec-occurrences .mec-occurrences-list .mec-occurrences-delete-button, +#mec_bfixed_form_fields span.mec_bfixed_field_remove, +#mec_event_form_fields span.mec_event_field_remove, +#mec_orgz_form_row span.mec-additional-organizer-remove, +#mec_reg_form_fields span.mec_reg_field_remove { + position: absolute; + right: 0; + top: 0; + background: #fff; +} + +#mec-occurrences .mec-occurrences-list .mec-occurrences-delete-button:before, +#mec_bfixed_form_fields span.mec_bfixed_field_option_sort:before, +#mec_bfixed_form_fields span.mec_bfixed_field_remove:before, +#mec_bfixed_form_fields span.mec_bfixed_field_sort:before, +#mec_event_form_fields span.mec_event_field_option_sort:before, +#mec_event_form_fields span.mec_event_field_remove:before, +#mec_event_form_fields span.mec_event_field_sort:before, +#mec_orgz_form_row span.mec-additional-organizer-remove:before, +#mec_orgz_form_row span.mec-additional-organizer-sort:before, +#mec_reg_form_fields span.mec_reg_field_option_sort:before, +#mec_reg_form_fields span.mec_reg_field_remove:before, +#mec_reg_form_fields span.mec_reg_field_sort:before { + position: absolute; + left: 20px; + top: 23px; + width: 20px; + height: 20px; + display: block; + cursor: move; + font-family: simple-line-icons; + content: "\e023"; + font-size: 15px; + color: #07bbe9; +} + +#mec-occurrences .mec-occurrences-list .mec-occurrences-delete-button:before { + font-weight: 400; +} + +#mec-occurrences .mec-occurrences-list .mec-occurrences-delete-button:before, +#mec_bfixed_form_fields span.mec_bfixed_field_remove:before, +#mec_event_form_fields span.mec_event_field_remove:before, +#mec_orgz_form_row span.mec-additional-organizer-remove:before, +#mec_reg_form_fields span.mec_reg_field_remove:before { + content: "\e082"; + width: 20px; + height: 20px; + left: auto; + right: 15px; + color: #f96666; + cursor: pointer; + font-size: 18px; +} + +#mec_bfixed_form_fields span.mec_bfixed_field_option_sort:before, +#mec_event_form_fields span.mec_event_field_option_sort:before, +#mec_reg_form_fields span.mec_reg_field_option_sort:before { + font-size: 13px; + left: 15px; + top: 25px; + width: 15px; + height: 15px; +} + +#mec_bfixed_form_fields p.mec_bfixed_field_options, +#mec_event_form_fields p.mec_event_field_options, +#mec_reg_form_fields p.mec_reg_field_options { + margin: 12px 0 8px; +} + +#mec_bfixed_form_fields input[type="number"], +#mec_bfixed_form_fields input[type="text"], +#mec_bfixed_form_fields select, +#mec_bfixed_form_fields textarea, +#mec_event_form_fields input[type="number"], +#mec_event_form_fields input[type="text"], +#mec_event_form_fields select, +#mec_event_form_fields textarea, +#mec_reg_form_fields input[type="number"], +#mec_reg_form_fields input[type="text"], +#mec_reg_form_fields select, +#mec_reg_form_fields textarea { + min-width: 260px; + min-height: 34px; + margin-bottom: 7px; + margin-top: 7px; +} + +#mec_bfixed_form_fields textarea, +#mec_event_form_fields textarea, +#mec_reg_form_fields textarea { + min-height: 66px; +} + +#mec_bfixed_form_field_types button, +#mec_bfixed_form_fields button, +#mec_event_form_field_types button, +#mec_event_form_fields button, +#mec_reg_form_field_types button, +#mec_reg_form_fields button { + position: relative; + outline: 0; + background: #fff; + border: 1px solid #e6e9eb; + border-radius: 50px; + padding: 9px 21px 10px 31px; + line-height: 1; + font-size: 12px; + font-weight: 600; + color: #07bbe9; + letter-spacing: 0.4px; + height: auto; + cursor: pointer; + margin-top: 5px; + text-transform: capitalize; + box-shadow: 0 0 3px rgba(0, 0, 0, 0.03); +} + +#mec_bfixed_form_field_types button:hover, +#mec_bfixed_form_fields button:hover, +#mec_event_form_field_types button:hover, +#mec_event_form_fields button:hover, +#mec_reg_form_field_types button:hover, +#mec_reg_form_fields button:hover { + border-color: #07bbe9; + box-shadow: 0 0 7px rgba(0, 0, 0, 0.1); +} + +#mec_bfixed_form_field_types button:before, +#mec_bfixed_form_fields button:before, +#mec_event_form_field_types button:before, +#mec_event_form_fields button:before, +#mec_reg_form_field_types button:before, +#mec_reg_form_fields button:before { + position: absolute; + left: 10px; + color: #07bbe9; + content: "\e095"; + font-family: simple-line-icons; + font-size: 13px; + display: inline-block; + top: 9px; +} + +#mec_bfixed_form_field_types button.red:hover, +#mec_bfixed_form_fields button.red:hover, +#mec_event_form_field_types button.red:hover, +#mec_event_form_fields button.red:hover, +#mec_reg_form_field_types button.red:hover, +#mec_reg_form_fields button.red:hover { + border-color: #ea6485; + box-shadow: 0 0 7px rgba(0, 0, 0, 0.1); +} + +#mec_bfixed_form_field_types button.red:before, +#mec_bfixed_form_fields button.red:before, +#mec_event_form_field_types button.red:before, +#mec_event_form_fields button.red:before, +#mec_reg_form_field_types button.red:before, +#mec_reg_form_fields button.red:before { + position: absolute; + left: 12px; + color: #ea6485; + content: "\e095"; + font-family: simple-line-icons; + font-size: 13px; + display: inline-block; +} + +.mec_form_fields .notification_placeholder, +#mec_bfixed_form_fields .mec_bfixed_notification_placeholder, +#mec_event_form_fields .mec_event_notification_placeholder { + padding: 2px; + display: block; + margin: 10px 0 20px; +} + +@media (max-width: 768px) { + + #mec_bfixed_form_fields input[type="number"], + #mec_bfixed_form_fields input[type="text"], + #mec_bfixed_form_fields select, + #mec_bfixed_form_fields textarea, + #mec_event_form_fields input[type="number"], + #mec_event_form_fields input[type="text"], + #mec_event_form_fields select, + #mec_event_form_fields textarea, + #mec_reg_form_fields input[type="number"], + #mec_reg_form_fields input[type="text"], + #mec_reg_form_fields select, + #mec_reg_form_fields textarea { + min-width: 80px; + width: 100%; + } +} + +.mec-form-row { + padding: 5px 5px 35px; +} + +.wns-be-main .mec-form-row { + padding: 0 5px 20px; + width: 100%; + clear: both; + min-height: 50px; + box-sizing: border-box; +} + +#taxes_option #mec_fees_list .mec-form-row, +#ticket_variations_option #mec_ticket_variations_list .mec-form-row { + padding: 10px; +} + +.post-type-mec-events .mec-form-row { + padding: 0 0 20px 0; +} + +.mec-form-row .mec-col-3 { + margin: 0; + padding-right: 10px; +} + +.mec-form-row label.mec-col-3 { + cursor: default; +} + +.wns-be-main .mec-form-row .mec-col-3:not([name*="mec[settings][tickets]"]):not([for*="mec_tickets_unlimited"]) { + min-width: 290px; + padding: 1px 0 0; + margin: 0; +} + +.wns-be-main .mec-form-row .mec-col-9 { + width: calc(100% - 290px); + float: right; +} + +.mec-form-row .mec-col-9 .mec-box { + position: relative; + border: 1px solid #e6e9eb; + padding: 20px; + margin: 0; + background: #fff; + max-width: 80%; + border-radius: 8px; + box-shadow: 0 1px 3px rgb(0 0 0 / 1%); +} + +.mec-form-row .mec-col-9 .mec-box label { + display: block; + padding: 20px 20px 4px; +} + +.mec-form-row .mec-col-9 .mec-box .mec-tooltip { + position: absolute; + display: block; + width: fit-content; + left: auto; + right: 20px; + bottom: 20px; +} + +#booking_option .mec-form-row .mec-col-8 { + margin: 0; +} + +.mec-options-fields { + padding-top: 25px; + overflow: hidden; + animation: fadeEffect 0.31s; + min-height: 450px; +} + +#mec_booking_form .mec-options-fields, +#mec_integrations_form .mec-options-fields, +#mec_modules_form .mec-options-fields, +#mec_notifications_form .mec-options-fields, +#mec_settings_form .mec-options-fields, +#mec_single_form .mec-options-fields { + display: none; +} + +.mec-options-fields.active { + display: block !important; +} + +@keyframes fadeEffect { + from { + opacity: 0; + margin-left: 12px; + } + + to { + opacity: 1; + margin-left: 0; + } +} + +.mec-form-row:after, +.mec-form-row:before { + content: " "; + display: table; +} + +.mec-form-row:after { + clear: both; +} + +.mec-form-row input[type="number"], +.mec-form-row input[type="text"], +.mec-form-row input[type="url"], +.mec-form-row select, +.mec-form-row textarea { + height: 38px; + box-sizing: border-box; + margin-bottom: 8px; + padding: 0 6px; + box-shadow: none; + border-radius: 2px; + box-shadow: inset 0 1px 5px rgba(0, 0, 0, 0.05); + margin: 0 1% 0 0; +} + +#mec-notifications .mec-form-row .mec-form-row input[type="text"], +#mec-notifications .mec-form-row .mec-form-row input[type="url"], +#mec-notifications .mec-form-row .mec-form-row select, +#mec-notifications .mec-form-row .mec-form-row textarea, +#mec-notifications .mec-form-row input[type="number"] { + width: 100%; + max-width: 290px; +} + +#mec_location_new_container .mec-form-row input[type="text"], +#mec_organizer_new_container .mec-form-row input[type="text"], +#mec_sponsor_new_container .mec-form-row input[type="text"] { + min-width: 200px; +} + +#mec-notifications .mec-form-row .mec-form-row textarea { + max-width: 100%; +} + +.wns-be-main .mec-form-row input[type="number"]:not([name*="mec[settings][tickets]"]), +.wns-be-main .mec-form-row input[type="password"]:not([name*="mec[settings][tickets]"]), +.wns-be-main .mec-form-row input[type="text"]:not([name*="mec[settings][tickets]"]), +.wns-be-main .mec-form-row input[type="url"]:not([name*="mec[settings][tickets]"]), +.wns-be-main .mec-form-row select:not([name*="mec[settings][tickets]"]), +.wns-be-main .mec-form-row textarea:not([name*="mec[settings][tickets]"]) { + width: 100%; + max-width: 290px; + margin-left: -1px; + margin-right: -1px; + margin-bottom: 0; +} + +.wns-be-main .mec-form-row textarea:not([name*="mec[settings][tickets]"]) { + max-width: unset; +} + +.wns-be-main .mec-form-row .wp-editor-area { + max-width: 100%; + background: #fff; + margin: 0; +} + +#mec_bfixed_form_fields input[type="number"], +#mec_bfixed_form_fields input[type="text"], +#mec_bfixed_form_fields select, +#mec_bfixed_form_fields textarea, +#mec_event_form_fields input[type="number"], +#mec_event_form_fields input[type="text"], +#mec_event_form_fields select, +#mec_event_form_fields textarea, +#mec_reg_form_fields input[type="number"], +#mec_reg_form_fields input[type="text"], +#mec_reg_form_fields select, +#mec_reg_form_fields textarea, +.wns-be-main .mec-form-row input[type="email"], +.wns-be-main .mec-form-row input[type="number"], +.wns-be-main .mec-form-row input[type="password"], +.wns-be-main .mec-form-row input[type="search"], +.wns-be-main .mec-form-row input[type="text"], +.wns-be-main .mec-form-row input[type="url"], +.wns-be-main .mec-form-row select { + border-radius: 5px; + min-height: 38px; + border: none; + background-color: #f7f8f9; + box-shadow: inset 0 1px 2px rgb(0 0 0 / 7%); + margin-bottom: 15px !important; +} + +.select2-container--default .select2-selection--multiple, +.select2-container--default.select2-container--focus .select2-selection--multiple { + border-radius: 5px; + min-height: 38px; + border: none; + background-color: #f7f8f9; + box-shadow: inset 0 1px 2px rgb(0 0 0 / 7%); +} + +.select2-container--default .select2-selection--multiple .select2-selection__rendered { + padding: 5px 0px; + min-height: 28px; + display: inline-block; + margin: 0; +} + +.select2-container--default .select2-selection--multiple .select2-selection__choice__remove { + line-height: 1.2; +} + +.select2-container .select2-search--inline .select2-search__field { + min-height: unset; + margin: 0; + height: 39px; +} + +.select2-container--default .select2-selection--multiple input[type="search"] { + border-radius: unset; + min-height: 2; + border: none; + background-color: transparent; + box-shadow: none; + margin: 0 !important; +} + +.select2-container--default .select2-selection--multiple { + line-height: 17px; +} + +.select2-container--default .select2-selection--multiple .select2-selection__rendered li { + margin-bottom: 0; +} + +.post-type-mec-events .mec-add-event-tabs-wrap .select2-container, +.post-type-mec-events .mec-create-shortcode-tab-content .select2-container, +.wns-be-main .mec-form-row .mec-create-shortcode-tab-content .select2-container { + border: none; + background-color: #f7f8f9; + border-radius: 5px; + line-height: 38px; + padding-left: 10px; + min-height: 38px; + box-shadow: inset 0 1px 2px rgb(0 0 0 / 7%); +} + +.mec-add-event-tabs-wrap .select2-container .select2-selection--multiple, +.mec-create-shortcode-tab-content .select2-container .select2-selection--multiple, +.wns-be-main .mec-form-row .select2-container .select2-selection--multiple { + min-height: 38px; + padding: 0; + border: none; + box-shadow: none; + background: 0 0; + border: none !important; + box-shadow: none !important; +} + +.post-type-mec-events .select2-dropdown, +.wns-be-main .mec-form-row .select2-dropdown { + border: 1px solid #ddd !important; +} + +.post-type-mec-events .select2-container--default .select2-selection--single .select2-selection__rendered { + padding-left: 0; +} + +.wns-be-main .mec-form-row input[type="search"] { + line-height: 2 !important; +} + +.wns-be-main .mec-form-row .select2-container { + width: 100% !important; + max-width: 290px !important; +} + +.wns-be-main #mec_messages_form_container input[type="text"] { + max-width: 100%; +} + +.mec-form-row input[type="radio"] { + margin: 0 6px 0 0; +} + +.mec-form-row select { + margin-top: 0; +} + +.mec-form-row select { + min-width: 80px; +} + +.cancellation-period-box { + max-width: 290px; +} + +.mec-form-row .cancellation-period-box input[type="number"] { + width: 48%; +} + +.mec-form-row .cancellation-period-box input[type="number"]:first-child { + margin-right: calc(2% + 4px); +} + +#mec_meta_box_repeat_form .mec-form-row select { + min-width: 65px; +} + +.ui-datepicker select { + min-width: 60px; +} + +#mec_styles_CSS { + max-width: 100%; +} + +.mec-book-status-form select { + display: block; + width: 99%; + margin-top: 10px; + margin-bottom: 10px; +} + +.mec-form-row label { + vertical-align: top; + text-align: left; + margin-top: 0; + margin-bottom: 0; + line-height: 38px; + font-weight: 600; + padding: 0 !important; + display: inline-block; +} + +.mec-form-row input[type="checkbox"]+label { + padding-top: 1px; +} + +.mec-meta-box-labels-container .mec-form-row label { + padding-top: 0; + line-height: 2.1; +} + +#mec_reg_form_fields label, +#mec_reg_form_fields p.description { + display: block; +} + +.mec-form-row label.mec-col-2, +.mec-form-row label.mec-col-4 { + padding-top: 10px; +} + +#mec-event-data .mec-form-row label { + display: block; +} + +#mec_bfixed_form_fields input[type="checkbox"], +#mec_reg_form_fields input[type="checkbox"], +.mec-form-row input[type="checkbox"] { + width: 22px; + height: 22px; + min-height: 0; + background: #f7f8f9; + border: none; + margin: -1px 5px 0 0; + vertical-align: middle; + box-shadow: inset 0 1px 2px rgb(0 0 0 / 7%); +} + +#mec_bfixed_form_fields input[type="checkbox"]:checked, +#mec_reg_form_fields input[type="checkbox"]:checked, +.mec-form-row input[type="checkbox"]:checked { + background: #64e385; + border-color: #64e385; +} + +#mec_bfixed_form_fields input[type="checkbox"]:checked:before, +#mec_reg_form_fields input[type="checkbox"]:checked:before, +.mec-form-row input[type="checkbox"]:checked:before { + content: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIxNC42ODgiIHZpZXdCb3g9IjAgMCAyMCAxNC42ODgiPg0KICA8ZyBpZD0idGlja18xXyIgZGF0YS1uYW1lPSJ0aWNrICgxKSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAtNjcuOTk4KSI+DQogICAgPGcgaWQ9Ikdyb3VwXzEiIGRhdGEtbmFtZT0iR3JvdXAgMSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCA2Ny45OTcpIj4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzEiIGRhdGEtbmFtZT0iUGF0aCAxIiBkPSJNMTkuNzA3LDY4LjI5YTEsMSwwLDAsMC0xLjQxNCwwTDYuMzEyLDgwLjI3MSwxLjcwNyw3NS42NjZBMSwxLDAsMCwwLC4yOTIsNzcuMDhMNS42LDgyLjM5MmExLDEsMCwwLDAsMS40MTQsMEwxOS43MDcsNjkuN0ExLDEsMCwwLDAsMTkuNzA3LDY4LjI5WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAtNjcuOTk3KSIgZmlsbD0iI2ZmZiIvPg0KICAgIDwvZz4NCiAgPC9nPg0KPC9zdmc+DQo="); + line-height: 22px; + width: 15px; + float: none; + margin: 0; +} + +.post-type-mec-events #mec_metabox_label input[type="checkbox"], +.post-type-mec-events .components-panel__body input[type="checkbox"] { + border-radius: 4px; + box-shadow: inset 0 1px 2px rgb(0 0 0 / 10%); +} + +.post-type-mec-events #mec_metabox_label input[type="checkbox"]:focus, +.post-type-mec-events .components-panel__body input[type="checkbox"]:focus { + outline: unset; + box-shadow: unset; +} + +.post-type-mec-events #mec_metabox_label input[type="checkbox"]+label, +.post-type-mec-events .components-panel__body input[type="checkbox"]+label { + padding-top: 1px; +} + +.post-type-mec-events #mec_metabox_label input[type="checkbox"], +.post-type-mec-events .components-panel__body input[type="checkbox"] { + width: 22px; + height: 22px; + min-height: 0; + background: #f7f8f9; + border: none; + box-shadow: inset 0 1px 2px rgb(0 0 0 / 7%); +} + +.post-type-mec-events #mec_metabox_label input[type="checkbox"]:checked, +.post-type-mec-events .components-panel__body input[type="checkbox"]:checked { + background: #64e385; + border-color: #64e385; + color: #64e385; +} + +.post-type-mec-events #mec_metabox_label input[type="checkbox"]:checked:before, +.post-type-mec-events .components-panel__body input[type="checkbox"]:checked:before { + color: #64e385; + line-height: 16px; + width: 15px; + float: none; + margin: 2px; +} + +#mec_settings_fes_thankyou_page_url, +.mec-form-row .mec-col-4 input[type="number"], +.mec-form-row .mec-col-4 input[type="text"], +.mec-form-row .mec-col-4 select, +.mec-form-row .mec-col-4 textarea { + width: 82% !important; + max-width: 290px; +} + +#mec_calendar_display_options .mec-col-4 input { + margin-left: 20px !important; + width: 80%; +} + +.mec-form-row .description { + display: inline-block; + border-left: 1px dashed #ccc; + line-height: 32px; + padding-left: 12px; + margin-top: 5px; + color: #555; +} + +.mec-form-row .description code { + font-style: normal; +} + +.mec-form-row .time-dv { + font-size: 14px; + font-weight: 700; + margin-right: 1%; + line-height: 38px; +} + +.mec-meta-box-fields { + margin: 30px 10px; +} + +.mec-meta-box-fields>.mec-meta-box-fields { + margin-left: 0; +} + +.mec-meta-box-fields .mec-title { + margin: 5px 0; +} + +.mec-meta-box-fields h4.mec-title { + margin: 40px 0 16px; +} + +.post-type-mec-events h4, +.post-type-mec-events h5, +.post-type-mec_calendars .mec-meta-box-fields h3 { + text-transform: capitalize; + border-bottom: 1px solid #e5e5e5; + padding-bottom: 6px; + margin: 40px 0 16px; + font-size: 15px; + font-weight: 600; +} + +.mec-meta-box-fields .mec-dashicons { + font-size: 20px; + line-height: 22px; + color: #07bbe9; +} + +.mec-form-row .mec-box, +.mec-meta-box-fields .mec-box, +#mec_tickets .mec-box { + background: #fff; + padding: 20px 10px 10px; + margin: 10px 0; + border-radius: 8px; + border: 1px solid #e6e9eb; + box-shadow: 0 1px 4px -1px rgb(0 0 0 / 1%); +} + +.meta-box-sortables .mec-meta-box-fields .mec-box { + padding: 15px; +} + +.mec-form-row .mec-box { + max-width: 960px; +} + +.mec-form-row .mec-box .button, +.mec-meta-box-fields .mec-box .button:not(.mec_add_price_date_button) { + float: right; +} + +#mec_gateways_form .mec-form-row:first-child, +#mec_notifications_form_container .mec-form-row:nth-child(2) { + overflow: hidden; +} + +#mec_gateways_form .mec-tooltip { + float: right; +} + +.mec-container { + background: #fff; + padding: 15px 0 15px 15px; +} + +#mec_booking_form .mec-container, +#mec_single_form .mec-container { + padding: 0; +} + +.nav-tab-active { + background: #fff; + border-bottom: 1px solid #fff; +} + +#mec_social_networks .mec-form-row { + margin-bottom: 0; +} + +#mec_styles_form #mec_styles_CSS { + height: 200px; + margin-bottom: 5px; + font-family: Consolas, Monaco, monospace; + font-size: 13px; + width: 97%; + background: #f9f9f9; + outline: 0; +} + +#mec_calendar_filter .description { + max-width: 500px; + display: block; + margin: 0 0 5px 0; + padding: 0; + border: none; + clear: both; +} + +#mec_calendar_display_options #mec-all-month>div { + display: inline-block; + min-width: 120px; +} + +.mec-sed-methods li a { + text-decoration: unset; +} + +.mec-sed-methods li { + display: inline-block; + padding: 8px 12px; + border: 1px solid #ddd; + margin: 0 5px 5px 0; + cursor: pointer; + border-radius: 3px; + box-shadow: 0 2px 15px -2px rgba(0, 0, 0, 0.1); +} + +.mec-sed-methods li a:hover, +.mec-sed-methods li:hover { + border-color: #07bbe9; + color: #07bbe9; +} + +.mec-sed-methods li.active, +.mec-sed-methods li.active a { + border-color: #07bbe9; + background-color: #ecf9fd; + color: #07bbe9; + font-weight: 600; + cursor: default; + box-shadow: none; +} + +.meta-box-sortables .mec-switcher input+label { + max-width: 52px; + width: 52px; + height: 30px; + margin: 4px 0; +} + +.meta-box-sortables .mec-switcher input+label:after, +.meta-box-sortables .mec-switcher input+label:before { + top: 0; + left: 0; + bottom: 0; + right: 0; +} + +.meta-box-sortables .mec-switcher input+label:after { + width: 24px; + height: 24px; +} + +.meta-box-sortables .mec-switcher input:checked+label:before { + box-shadow: 2px 2px 12px -2px #4fdc73 inset; + background: #64e385; + border-color: #64e385; +} + +.meta-box-sortables .mec-switcher input:checked+label:after { + margin-left: 24px; +} + +.mec-switcher input:checked+label:after { + margin-left: 16px; +} + +#mec_gateways_form input[type="text"], +#mec_gateways_form select, +#mec_gateways_form textarea { + width: calc(100% - 30px); +} + +#mec_gateways_form textarea { + min-height: 65px; +} + +#mec_gateways_form li .mec-gateway-options-form, +#payment_gateways_option li .mec-gateway-options-form { + padding: 35px 10px 5px 10px; + background-color: #fff; + border: 1px solid #e6e9eb; + border-left: 6px solid #e6e9eb; + margin-bottom: 40px; + margin-top: -5px; + border-top-right-radius: 4px; + border-bottom-right-radius: 4px; + box-shadow: 0 1px 4px -1px rgba(0, 0, 0, 0.05); +} + +#payment_gateways_option #mec_gateways6_container_toggle.mec-gateway-options-form { + padding: 10px 10px 10px 17px; +} + +#payment_gateways_option #mec_gateways6_container_toggle.mec-gateway-options-form p { + border-radius: 4px; + max-width: 90%; +} + +#mec_gateways_form_container .mec-form-row input[type="number"], +#mec_gateways_form_container .mec-form-row select { + width: 100%; +} + +div#mec_gateways_form_container .mec-required.mec-mandatory { + border: 1px solid red; +} + +#mec_payment_options_wrapper .mec-form-row .mec-col-4 select { + margin-top: 0; +} + +#mec_payment_options_wrapper .mec-col-9 .mec-form-row { + padding-bottom: 0; +} + +#mec_payment_options_wrapper .mec-col-9 .mec-form-row .mec-col-4 { + width: 103px; + margin-left: -5px; +} + +#booking_notification_section label { + display: inline-block; + min-width: 160px; +} + +div#booking_notification_section iframe { + height: 300px !important; +} + +@media (max-width: 536px) { + + #booking_notification_section input[type="text"], + #booking_notification_section select { + min-width: 100%; + } +} + +#booking_notification_section ul li:last-child .wp-editor-container { + margin-bottom: 0; +} + +#mec_messages_form_container ul li label { + display: block; + font-weight: 400; +} + +#mec_messages_form_container ul li input { + display: block; + width: 100%; +} + +.mec-message-categories li.mec-acc-label { + font-size: 15px; + font-weight: 400; + padding: 0 30px; + cursor: pointer; + background-color: #fff; + border: none; + border-bottom: 1px solid #e6e6e6; + margin: 0; + letter-spacing: 0.2px; + position: relative; +} + +.mec-message-categories li.mec-acc-label .mec-acc-cat-name { + line-height: 65px; + font-size: 17px; + transition: all 0.2s ease; +} + +.mec-message-categories li.mec-acc-label .mec-acc-cat-name:hover { + color: #07bbe9; +} + +.mec-message-categories ul { + margin: 15px 5px; +} + +.webnus-icons-list li { + width: 40px; + display: inline-block; + list-style: none; + padding: 0; +} + +.webnus-icons-list input { + visibility: hidden; + margin: 0; + padding: 0; + width: 1px; + height: 1px; + -moz-opacity: 0; + -khtml-opacity: 0; + opacity: 0; + cursor: pointer; +} + +.webnus-icons-list li label { + color: #777; + display: inline-block !important; + float: none !important; + width: 33px !important; + text-align: center; + font-size: 23px !important; + font-weight: 400 !important; + padding: 5px 0 !important; + border: 1px solid #eee !important; +} + +.mec-webnus-icon { + float: left; + margin-right: 10px; +} + +.mec-webnus-icon i { + font-size: 24px; + color: #222; +} + +.mec-accordion ul { + display: none; +} + +.mec-switcher input { + position: absolute; + margin-left: -9999px; + visibility: hidden; +} + +.mec-switcher input+label { + display: inline-block; + position: relative; + cursor: pointer; + outline: 0; + padding: 2px; + width: 50px; + height: 22px; + background-color: #e5e9ee; + border-radius: 60px; +} + +.mec-switcher input+label { + max-width: 52px; + width: 52px; + height: 30px; + margin: 4px 0; +} + +.mec-switcher input+label:after, +.mec-switcher input+label:before { + display: block; + position: absolute; + top: 0; + left: 0; + bottom: 0; + content: ""; +} + +.mec-switcher input+label:before { + right: 1px; + background-color: #f1f1f1; + border-radius: 60px; + transition: background 0.4s; +} + +.mec-switcher input+label:after { + width: 24px; + background-color: #fff; + border-radius: 100%; + transition: margin 0.4s; + border: 1px solid transparent; + box-shadow: 0 0 5px rgb(0 0 0 / 4%); +} + +.mec-switcher input+label:after { + margin-top: 2px; + margin-left: 2px; + width: 24px; + height: 24px; +} + +.wns-be-group-tab .mec-switcher input[value="1"]+label, +.wns-be-group-tab .mec-switcher input[value="1"]+label:before { + box-shadow: 2px 2px 12px -2px #4fdc73 inset; + position: relative; + background: #64e385; + border-color: #64e385; +} + +.wns-be-group-tab .mec-switcher input+label:before { + right: 1px; + background-color: #f1f1f1; + border-radius: 60px; + transition: background 0.4s; +} + +.wns-be-group-tab .mec-switcher input[value="1"]+label:after { + margin-left: 24px; +} + +.mec-switcher label { + display: block; +} + +.mec-sed-methods li { + display: inline-block; + padding: 10px; + border: 1px solid #ddd; + margin: 0 5px 5px 0; + cursor: pointer; +} + +#wpwrap .mec-button-primary { + border-bottom: none; + letter-spacing: 0.5px; + line-height: 18px; + height: 46px; + transition: all 0.5s ease; + color: #fff; + padding: 12px 25px; + display: block; + text-align: center; + font-size: 14px; + background: 0 0; + background-color: #008aff; + text-shadow: none; + border: 0; + box-shadow: none; + display: inline-block; + margin: 25px 0 12px; + min-width: 146px; +} + +#wpwrap .mec-button-primary:hover { + background-color: #41c9de; +} + +#wpwrap .mec-button-primary.loading { + background-color: #73c02a; +} + +#wpwrap .mec-button-primary:before { + content: "\f00c"; + font-family: fontawesome; + margin-right: 4px; + font-size: 16px; + display: none; +} + +#wpwrap .mec-button-primary.loading:before { + display: inline-block; +} + +.mec-image-select-wrap { + clear: both; + overflow: hidden; + padding: 10px 0; + margin: 0; +} + +.mec-image-select-wrap li { + float: left; + display: block; + margin-right: 5px; + margin-bottom: 0; +} + +.mec-image-select-wrap li input[type="radio"] { + display: none; +} + +.mec-form-row .mec-image-select-wrap li label { + padding: 5px 0 0; + display: block; +} + +@media (max-width: 1280px) { + .mec-image-select-wrap li { + margin-right: 20px; + } +} + +@media (max-width: 480px) { + .mec-image-select-wrap li { + margin-right: 18px; + } +} + +.mec-image-select-wrap li input { + display: none; +} + +.mec-image-select-wrap li span { + width: 35px; + height: 35px; + display: block; + margin: 3px; + border-radius: 2px; + border: 3px solid transparent; + transition: all 0.2s ease; +} + +.mec-image-select-wrap li input:checked+span { + border-color: #fff; + box-shadow: 0 0 14px rgba(0, 0, 0, 0.25); +} + +.mec-image-select-wrap li input:checked+span:after { + content: "\e080"; + font-family: simple-line-icons; + font-size: 18px; + line-height: 18px; + display: inline-block; + color: #fff; + padding: 8px 9px; + max-width: 100%; + max-height: 100%; + font-weight: 400; +} + +.m-e-calendar_page_MEC-ix #wpwrap .mec-button-primary.mec-btn-2 { + margin: 0 0 0 12px; +} + +.m-e-calendar_page_MEC-ix #wpwrap input[type="file"] { + padding-top: 12px; + padding-bottom: 12px; +} + +.m-e-calendar_page_MEC-ix #wpwrap .mec-form-row select { + min-height: 46px; +} + +.mec-image-select-wrap .mec-colorskin-1 { + background-color: #40d9f1; +} + +.mec-image-select-wrap .mec-colorskin-2 { + background-color: #0093d0; +} + +.mec-image-select-wrap .mec-colorskin-3 { + background-color: #e53f51; +} + +.mec-image-select-wrap .mec-colorskin-4 { + background-color: #f1c40f; +} + +.mec-image-select-wrap .mec-colorskin-5 { + background-color: #e64883; +} + +.mec-image-select-wrap .mec-colorskin-6 { + background-color: #45ab48; +} + +.mec-image-select-wrap .mec-colorskin-7 { + background-color: #9661ab; +} + +.mec-image-select-wrap .mec-colorskin-8 { + background-color: #0aad80; +} + +.mec-image-select-wrap .mec-colorskin-9 { + background-color: #0ab1f0; +} + +.mec-image-select-wrap .mec-colorskin-10 { + background-color: #ff5a00; +} + +.mec-image-select-wrap .mec-colorskin-11 { + background-color: #c3512f; +} + +.mec-image-select-wrap .mec-colorskin-12 { + background-color: #55606e; +} + +.mec-image-select-wrap .mec-colorskin-13 { + background-color: #fe8178; +} + +.mec-image-select-wrap .mec-colorskin-14 { + background-color: #7c6853; +} + +.mec-image-select-wrap .mec-colorskin-15 { + background-color: #bed431; +} + +.mec-image-select-wrap .mec-colorskin-16 { + background-color: #2d5c88; +} + +.mec-image-select-wrap .mec-colorskin-17 { + background-color: #77da55; +} + +.mec-image-select-wrap .mec-colorskin-18 { + background-color: #2997ab; +} + +.mec-image-select-wrap .mec-colorskin-19 { + background-color: #734854; +} + +.mec-image-select-wrap .mec-colorskin-20 { + background-color: #a81010; +} + +.mec-image-select-wrap .mec-colorskin-21 { + background-color: #4ccfad; +} + +.mec-image-select-wrap .mec-colorskin-22 { + background-color: #3a609f; +} + +.mec-image-select-wrap .mec-colorskin-23 { + background-color: #333; +} + +.mec-image-select-wrap .mec-colorskin-24 { + background-color: #d2d2d2; +} + +.mec-image-select-wrap .mec-colorskin-25 { + background-color: #636363; +} + +@media screen and (max-width: 782px) { + .mec-form-row .description { + max-width: 500px; + display: block; + margin: 0 0 5px 0; + padding: 0; + border: none; + } + + .mec-col-1, + .mec-col-10, + .mec-col-11, + .mec-col-12, + .mec-col-2, + .mec-col-3, + .mec-col-4, + .mec-col-5, + .mec-col-6, + .mec-col-7, + .mec-col-8, + .mec-col-9 { + margin-bottom: 5px; + display: block; + } + + .mec-form-row .mec-box .button, + .mec-meta-box-fields .mec-box .button { + float: left; + } + + .mec-form-row .time-dv { + padding: 0 4px; + } + + .mec-form-row .mec-col-4 input[type="text"], + .mec-form-row .mec-col-4 select { + width: auto; + min-width: 192px; + } + + .mec-tooltip .dashicons-before:before { + font-size: 32px; + } +} + +#frmb-0-clear-all, +#frmb-0-save, +#frmb-0-view-data { + display: none; +} + +#mec_sn_googlecal { + margin-bottom: 0; +} + +#mec_fee_row1 .button { + margin-right: 10px; +} + +h4.mec-form-subtitle { + font-size: 15px; + margin-top: 0; +} + +h5.mec-form-second-title { + font-size: 15px; + margin-top: 0; +} + +#webnus-dashboard * { + box-sizing: border-box; +} + +#webnus-dashboard.about-wrap { + max-width: 1040px; + margin: 25px auto 20px; +} + +@media (max-width: 1280px) { + #webnus-dashboard.about-wrap { + max-width: 1024px; + } +} + +#webnus-dashboard .change-log { + word-wrap: break-word; +} + +#webnus-dashboard .welcome-head img { + background: #fff; + padding: 15px; + border-radius: 8px 8px 0 0; + width: 216px; + margin: 0 0 0 auto; + display: block; + border: 1px solid #e3e5e7; + border-bottom: none; +} + +.w-welcome { + position: relative; + margin-top: 30px; + margin-bottom: 10px; + font-size: 19px; +} + +.w-box { + position: relative; + background: #fff; + padding: 5px 25px; + margin-top: 30px; +} + +.w-theme-version { + box-shadow: 0 2px 5px -5px #00000021; + text-shadow: none; + background: #f7f8f9; + text-align: center; + display: block; + padding: 10px 0; + color: #8e9596; + font-size: 12px; + font-weight: 400; + margin-top: 0; + border-radius: 0 0 8px 8px; + font-family: monospace; + width: 216px; + margin: 0 0 0 auto; + border: 1px solid #e3e5e7; + border-top: none; +} + +.w-box { + padding: 0; + min-height: 310px; + box-shadow: none; + border-radius: 15px; + border: 1px solid #e3e5e7; +} + +.w-box.upcoming-events .mec-load-more-wrap { + display: none; +} + +.w-box.print-events { + min-height: 134px; +} + +.w-box.gateways { + max-height: 390px; +} + +.w-box.gateways canvas { + max-height: 280px !important; +} + +.w-box-head { + font-weight: 600; + padding: 20px 72px; + position: relative; + border-bottom: 2px solid #ccecf4; + font-size: 20px; +} + +.w-box-head span { + position: absolute; + left: 0; + padding: 0 25px; + line-height: 58px; + background: #008aff; + height: 100%; + top: 0; + color: #fff; +} + +.w-box-child, +.w-box-content { + padding: 20px 30px 30px; + line-height: 24px; + font-size: 14px; +} + +.mec-count-child { + width: 50%; + margin: 0 auto; + color: #01c6d9; +} + +#webnus-dashboard .w-button a { + color: #fff !important; + border-radius: 0; + padding: 10px 24px; + font-size: 12px; + letter-spacing: 1px; + font-weight: 600; + background: #008aff; + margin: 10px 0; + display: inline-block; + text-transform: uppercase; +} + +#webnus-dashboard .w-box .w-button a:hover { + background: #222; + background: linear-gradient(95deg, #555 0, #222 50%, #000 100%); + box-shadow: 0 5px 21px -5px rgba(0, 0, 0, 0.5); +} + +.w-system-info { + margin-bottom: 7px; +} + +.w-system-info:first-child { + margin-top: 20px; +} + +.w-system-info>span { + display: inline-block; + min-width: 145px; + line-height: 20px; + font-size: 13px; +} + +#webnus-dashboard .w-current { + min-width: 110px; +} + +#webnus-dashboard .w-min { + min-width: 65px; +} + +.w-icon { + color: #fff; + padding: 3px; + border-radius: 4px; + margin-right: 10px; + vertical-align: middle; +} + +.w-icon-green { + background: #27ae60; +} + +.w-icon-red { + background: #e74c3c; +} + +.extra .w-box-head { + padding: 30px 30px 10px; + border-bottom: 1px solid #fff; + border-radius: 11px 11px 0 0; +} + +.doc .w-box-head { + color: #4cbf67; +} + +#webnus-dashboard .doc .w-button a { + background: #4cbf67; + background: linear-gradient(95deg, #6fe08a 0, #58cf74 50%, #36cb58 100%); + margin: 35px 0 17px; + box-shadow: 0 5px 10px -5px #4cbf67; + background-color: #fff; +} + +#webnus-dashboard .support .w-button a { + background: #ff876c; + background: linear-gradient(95deg, #ff876c 0, #ff7455 50%, #ff5a35 100%); + margin: 13px 0 18px; + box-shadow: 0 5px 10px -5px #ff876c; +} + +.doc .w-box-content { + background: url(../img/document.png) no-repeat right center; +} + +.doc .w-box-content p, +.w-box.support .w-box-content p { + width: 54%; + color: #666; + margin-top: 10px; + max-width: 380px; +} + +.w-box-child p { + color: #666; + margin-top: 10px; +} + +.w-box.support { + background: #fff url(../img/support.png) no-repeat top right; +} + +.w-box.support .w-box-head { + width: 50%; + color: #ff876c; +} + +.w-box-content pre { + text-align: left; + background: #f5f6f7; + font-size: 13px; + padding: 20px 25px; + height: 480px; + overflow-y: scroll; + white-space: break-spaces; + border-radius: 11px; + font-family: monospace; + margin: 0 0 10px; +} + +#webnus-dashboard .button:not(.mec-intro-section-link-tag) { + border: 0; + background: 0 0; + box-shadow: none; + color: #e74c3c; + font-weight: 700; +} + +.w-box .state { + position: absolute; + top: 0; + left: -100vw; +} + +#webnus-dashboard .button:hover { + color: #222; +} + +.w-box .state:checked~.content { + -webkit-transform: none; + -ms-transform: none; + transform: none; +} + +.w-box .state:checked~.backdrop { + bottom: 0; + opacity: 1; + z-index: 1; +} + +.w-box .lightbox { + position: fixed; + top: 0; + right: 0; + left: 0; + height: 0; + padding: 0 20px; +} + +.w-box .lightbox .content { + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; + display: flex; + -webkit-box-orient: vertical; + -webkit-box-direction: normal; + -webkit-flex-direction: column; + -ms-flex-direction: column; + flex-direction: column; + overflow: hidden; + position: relative; + z-index: 2; + max-width: 500px; + max-height: 95vh; + margin: 20px auto; + padding: 20px; + background: #fff; + -webkit-transform: translateY(-200%); + -ms-transform: translateY(-200%); + transform: translateY(-200%); + -webkit-transition: 0.3s -webkit-transform ease-in-out; + transition: 0.3s transform ease-in-out; + border: 1px solid rgba(0, 0, 0, 0.1); +} + +.w-box .lightbox .main { + -webkit-box-flex: 1; + -webkit-flex-grow: 1; + -ms-flex-positive: 1; + flex-grow: 1; +} + +.w-box .lightbox .backdrop { + position: fixed; + z-index: -1; + top: 0; + right: 0; + bottom: 100%; + left: 0; + opacity: 0; + background: rgba(0, 0, 0, 0.3); + -webkit-transition: 0.3s opacity ease-in-out; + transition: 0.3s opacity ease-in-out; +} + +.content .main p { + color: #bf3737; +} + +p.mec_dash_count { + font-size: 60px; + font-weight: 100; + margin: 0; + color: #38d5ed; +} + +.w-col-sm-3 .w-box.doc { + text-align: center; + min-height: auto; +} + +.w-Knowledgebase { + color: #8e5cea; +} + +.mec-view-all-articles a { + margin: 30px 0 17px; + display: inline-block; + color: #fff !important; + border-radius: 0; + padding: 10px 24px; + font-size: 12px; + letter-spacing: 1px; + font-weight: 600; + background: #8e5cea; + display: inline-block; + text-transform: uppercase; + transition: all 0.24s ease; + -webkit-transition: all 0.24s ease; +} + +.mec-view-all-articles a:hover { + background-color: #222; +} + +.w-box.upcoming-events .mec-event-article { + margin-bottom: 15px; + padding-bottom: 10px; +} + +.w-box.upcoming-events .mec-event-article .mec-event-label-captions { + padding: 2px 5px; + border-radius: 3px; + color: #fff; + font-size: 0.86em; +} + +.w-box.upcoming-events .mec-event-article .mec-event-date { + font-size: 13px; + background-color: #38d5ed; + color: #fff; + text-align: center; + border-radius: 6px; + width: 50px; + padding-bottom: 2px; + float: left; + margin-right: 10px; + text-transform: uppercase; + letter-spacing: 1px; + font-family: monospace; +} + +.w-box.upcoming-events .mec-event-article .mec-event-date:beforex { + content: "\e075"; + font-family: simple-line-icons; + font-size: 18px; + line-height: 15px; + color: #bdeaf1; + float: left; + margin-right: 11px; +} + +.w-box.upcoming-events .mec-event-article .mec-event-date span { + font-weight: 700; + border-radius: 6px 6px 0 0; + padding: 3px 0 1px; + font-size: 18px; + display: block; + background: #61dcef; + font-family: arial, sans-serif; +} + +.w-box.upcoming-events .mec-event-article .mec-event-date span.mec-multiple-dates { + font-size: 11px; +} + +.w-box.upcoming-events .mec-event-article h4.mec-event-title { + margin: 0; + font-size: 16px; + line-height: 28px; +} + +.w-box.upcoming-events .mec-event-article .mec-shortcode-virtual-badge, +.w-box.upcoming-events .mec-event-article .mec-shortcode-zoom-badge { + font-size: 11px; + line-height: 1.62; + background: #222; + padding: 2px 9px; + border-radius: 12px; + color: #fff; + margin: 0 0 0 5px; +} + +.w-box.upcoming-events .mec-event-article .mec-shortcode-virtual-badge i, +.w-box.upcoming-events .mec-event-article .mec-shortcode-zoom-badge i { + padding: 0 5px 0 0; +} + +#webnus-dashboard .w-box.upcoming-events .mec-event-article h4.mec-event-title a { + color: #5f676b; +} + +#webnus-dashboard .w-box.upcoming-events .mec-event-article h4.mec-event-title a:hover { + text-decoration: underline; +} + +.w-box.upcoming-events .mec-event-article .mec-event-detail { + font-size: 13px; + color: #979899; +} + +.w-box.upcoming-events .mec-event-article .mec-detail-button { + display: none; +} + +.w-box.total-bookings ul li { + display: inline-block; + background: #f3f4f5; + margin-right: 5px; + border-radius: 50px; + padding: 0 5px; + transition: all 0.2s ease; +} + +.w-box.total-bookings ul li.selected { + background: #fff; + border: 1px solid #e9e9e9; +} + +.w-box.total-bookings ul li a { + padding: 6px 12px; + display: inline-block; + border-radius: 3px; + text-transform: none; + font-size: 13px; + letter-spacing: 0.4px; + transition: all 0.1s ease; + font-weight: 600; + text-decoration: none; +} + +.w-box.total-bookings ul li.active { + background: #38d5ed; +} + +.w-box.total-bookings ul li:hover { + background: #38d5ed; +} + +#webnus-dashboard .w-box.total-bookings ul li a { + color: #000; +} + +#webnus-dashboard .w-box.total-bookings ul li.active a, +#webnus-dashboard .w-box.total-bookings ul li:hover a { + color: #fff; +} + +#webnus-dashboard .w-box.total-bookings ul li a:focus { + box-shadow: unset; + outline: unset; + outline-offset: 0; +} + +.info-msg, +.mec-error, +.mec-success, +.warning-msg { + margin: 10px 0; + padding: 10px; + border-radius: 11px; +} + +.post-type-mec-events.taxonomy-mec_speaker .warning-msg p { + color: #9f6000; +} + +.info-msg { + color: #059; + background-color: #bef; +} + +.info-msg-link { + background: #fff; + padding: 4px 12px 6px; + border-radius: 3px; + line-height: 1; + font-weight: 600; + color: #008aff; +} + +.mec-success { + color: #270; + background-color: #dff2bf; +} + +.warning-msg { + color: #9f6000; + background-color: #feefb3; +} + +.mec-error { + color: #d8000c !important; + background-color: #ffbaba; +} + +.w-row .fs-notifier.success.show.visible { + font-size: 12px !important; +} + +.w-row .fs-notifier.success.show.visible a { + font-size: 25px !important; + margin-top: -3px; +} + +.mec-certain-day>div, +.mec-select-deselect-actions li, +.mec-xi-facebook-import-events .mec-select-deselect-actions li, +.mec-xi-google-import-events .mec-select-deselect-actions li { + display: inline-block; + position: relative; + outline: 0; + background: #fff; + border: 1px solid #e2e2e2; + border-radius: 50px; + padding: 11px 21px 11px 21px; + line-height: 1; + font-size: 11px; + font-weight: 600; + color: #444; + letter-spacing: 2px; + height: auto; + cursor: pointer; + margin-top: 5px; + text-transform: uppercase; + box-shadow: 0 0 3px rgba(0, 0, 0, 0.03); +} + +#mec-exceptional-days .mec-certain-day>div, +#mec_exceptions_in_days_container .mec-certain-day>div { + padding: 0 15px; + margin: 0 5px 10px 0; +} + +.mec-certain-day .mec-in-days-day, +.mec-certain-day>div .mec-not-in-days-day { + line-height: 36px; +} + +.mec-certain-day>div:hover, +.mec-select-deselect-actions li:hover, +.mec-xi-facebook-import-events .mec-select-deselect-actions li:hover, +.mec-xi-google-import-events .mec-select-deselect-actions li:hover { + border-color: #07bbe9; + box-shadow: 0 0 7px rgba(0, 0, 0, 0.1); +} + +.mec-not-in-days-remove { + border: 1px solid #ff4b64; + border-radius: 20px; + padding: 0 0 0 1px; + color: #ff4b64; + width: 11px; + height: 12px; + text-align: center; + line-height: 12px; + display: inline-block; + margin-right: -5px; + margin-left: 6px; +} + +.mec-xi-facebook-import-events .mec-success, +.mec-xi-google-import-events .mec-success { + width: 460px; +} + +.mec-xi-facebook-import-events .mec-select-deselect-actions li, +.mec-xi-google-import-events .mec-select-deselect-actions li { + display: inline-block; + cursor: pointer; +} + +.lity-content>div { + overflow: auto; +} + +.mce-mec-mce-items { + text-transform: capitalize !important; +} + +#mec_setting_contextual li { + list-style: none !important; + font-size: 12px; + margin: 0; + padding: 6px; +} + +.mec-bbf-field-container { + margin-bottom: 10px; +} + +.mec-bbf-field-container label { + display: block; +} + +.kc-components ul.kc-components-list li .cpicon.mec-kingcomposer-icon, +.kc-element-icon .cpicon.mec-kingcomposer-icon { + background: url(../img/ico-mec-vc.png) no-repeat center center; + background-size: auto; + background-repeat: no-repeat; +} + +.mec-archive-skinsm.mec-category-skins, +.mec-carousel-archive-link, +.mec-carousel-head-text, +.mec-toggle-month-divider { + display: none; +} + +span.mec-archive-skins, +span.mec-category-skins { + vertical-align: text-bottom; +} + +.mec-archive-skins input, +.mec-archive-skins select, +.mec-category-skins input, +.mec-category-skins select { + min-width: 225px; + vertical-align: baseline; +} + +#mec_settings_default_skin_archive, +#mec_settings_default_skin_category { + min-width: 225px; +} + +.w-welcome p span { + background: #fff; + padding: 4px 10px; +} + +#mec_masonry_skin_options_container .mec-form-row .description { + margin-left: 0; + padding-left: 0; + border: none; + margin-top: -4px; +} + +@media (max-width: 1280px) { + + span.mec-archive-skins, + span.mec-category-skins { + margin-left: 0; + } +} + +.mec-shortcode-virtual-badge i { + padding: 0 5px 0 7px; +} + +.mec-search-form-options-container input[type="text"] { + margin-top: 10px; +} + +@media (min-width: 760px) and (max-width: 1280px) { + + .mec-virtual-event-wrap .mec-form-row .mec-col-1, + .mec-zoom-event-wrap .mec-form-row .mec-col-1 { + width: 12%; + } + + .mec-virtual-event-wrap .mec-form-row .mec-col-4, + .mec-virtual-event-wrap .mec-form-row .mec-col-6, + .mec-zoom-event-wrap .mec-form-row .mec-col-4, + .mec-zoom-event-wrap .mec-form-row .mec-col-6 { + width: 40%; + } + + .mec-virtual-event-wrap .mec-form-row .mec-col-3, + .mec-virtual-event-wrap .mec-form-row .mec-col-5, + .mec-zoom-event-wrap .mec-form-row .mec-col-3, + .mec-zoom-event-wrap .mec-form-row .mec-col-5 { + width: 45%; + } + + .mec-virtual-event-wrap .mec-form-row .mec-col-2, + .mec-zoom-event-wrap .mec-form-row .mec-col-2 { + width: 21%; + } +} + +#mec_zoom_checkall { + background: #fff; + border: 1px solid #282828; + border-radius: 60px; + padding: 6px 32px 8px; + margin: 30px 0 0; + cursor: pointer; + display: block; + transition: all 0.3s ease; + -webkit-transition: all 0.3s ease; + -moz-transition: all 0.3s ease; + -ms-transition: all 0.3s ease; + -o-transition: all 0.3s ease; +} + +#mec_zoom_checkall:focus { + box-shadow: inset; + outline: 0; +} + +#mec_zoom_checkall:hover { + background: #282828; + color: #fff; +} + +/*! + * Bootstrap v3.3.7 (http://getbootstrap.com) + * Copyright 2011-2016 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */ +#webnus-dashboard button, +#webnus-dashboard input, +#webnus-dashboard select, +#webnus-dashboard textarea { + font-family: inherit; + font-size: inherit; + line-height: inherit; +} + +#webnus-dashboard a { + color: #337ab7; + text-decoration: none; +} + +#webnus-dashboard a:focus, +#webnus-dashboard a:hover { + color: #23527c; +} + +#webnus-dashboard a:focus { + outline: -webkit-focus-ring-color auto 5px; + outline-offset: -2px; +} + +#webnus-dashboard figure { + margin: 0; +} + +#webnus-dashboard img { + vertical-align: middle; +} + +.w-img-responsive { + display: block; + max-width: 100%; + height: auto; +} + +.w-img-rounded { + border-radius: 6px; +} + +.w-img-thumbnail { + padding: 4px; + line-height: 1w-42857143; + background-color: #fff; + border: 1px solid #ddd; + border-radius: 4px; + -webkit-transition: all 0w-2s ease-in-out; + -o-transition: all 0w-2s ease-in-out; + transition: all 0w-2s ease-in-out; + display: inline-block; + max-width: 100%; + height: auto; +} + +.w-img-circle { + border-radius: 50%; +} + +hr { + margin-top: 20px; + margin-bottom: 20px; + border: 0; + border-top: 1px solid #eee; +} + +.w-sr-only { + position: absolute; + width: 1px; + height: 1px; + margin: -1px; + padding: 0; + overflow: hidden; + clip: rect(0, 0, 0, 0); + border: 0; +} + +.w-sr-only-focusable:active, +.w-sr-only-focusable:focus { + position: static; + width: auto; + height: auto; + margin: 0; + overflow: visible; + clip: auto; +} + +.w-container, +.w-container-fluid { + margin-right: auto; + margin-left: auto; + padding-left: 15px; + padding-right: 15px; +} + +[role="button"] { + cursor: pointer; +} + +@media (min-width: 768px) { + .w-container { + width: 750px; + } +} + +@media (min-width: 992px) { + .w-container { + width: 970px; + } +} + +@media (min-width: 1200px) { + .w-container { + width: 1170px; + } +} + +.w-row { + margin-left: -15px; + margin-right: -15px; +} + +.w-col-lg-1, +.w-col-lg-10, +.w-col-lg-11, +.w-col-lg-12, +.w-col-lg-2, +.w-col-lg-3, +.w-col-lg-4, +.w-col-lg-5, +.w-col-lg-6, +.w-col-lg-7, +.w-col-lg-8, +.w-col-lg-9, +.w-col-md-1, +.w-col-md-10, +.w-col-md-11, +.w-col-md-12, +.w-col-md-2, +.w-col-md-3, +.w-col-md-4, +.w-col-md-5, +.w-col-md-6, +.w-col-md-7, +.w-col-md-8, +.w-col-md-9, +.w-col-sm-1, +.w-col-sm-10, +.w-col-sm-11, +.w-col-sm-12, +.w-col-sm-2, +.w-col-sm-3, +.w-col-sm-4, +.w-col-sm-5, +.w-col-sm-6, +.w-col-sm-7, +.w-col-sm-8, +.w-col-sm-9, +.w-col-xs-1, +.w-col-xs-10, +.w-col-xs-11, +.w-col-xs-12, +.w-col-xs-2, +.w-col-xs-3, +.w-col-xs-4, +.w-col-xs-5, +.w-col-xs-6, +.w-col-xs-7, +.w-col-xs-8, +.w-col-xs-9 { + position: relative; + min-height: 1px; + padding-left: 15px; + padding-right: 15px; +} + +.w-col-xs-1, +.w-col-xs-10, +.w-col-xs-11, +.w-col-xs-12, +.w-col-xs-2, +.w-col-xs-3, +.w-col-xs-4, +.w-col-xs-5, +.w-col-xs-6, +.w-col-xs-7, +.w-col-xs-8, +.w-col-xs-9 { + float: left; +} + +.w-col-xs-12 { + width: 100%; +} + +.w-col-xs-11 { + width: 91.66666667%; +} + +.w-col-xs-10 { + width: 83.33333333%; +} + +.w-col-xs-9 { + width: 75%; +} + +.w-col-xs-8 { + width: 66.66666667%; +} + +.w-col-xs-7 { + width: 58.33333333%; +} + +.w-col-xs-6 { + width: 50%; +} + +.w-col-xs-5 { + width: 41.66666667%; +} + +.w-col-xs-4 { + width: 33.33333333%; +} + +.w-col-xs-3 { + width: 25%; +} + +.w-col-xs-2 { + width: 16.66666667%; +} + +.w-col-xs-1 { + width: 8.33333333%; +} + +.w-col-xs-pull-12 { + right: 100%; +} + +.w-col-xs-pull-11 { + right: 91.66666667%; +} + +.w-col-xs-pull-10 { + right: 83.33333333%; +} + +.w-col-xs-pull-9 { + right: 75%; +} + +.w-col-xs-pull-8 { + right: 66.66666667%; +} + +.w-col-xs-pull-7 { + right: 58.33333333%; +} + +.w-col-xs-pull-6 { + right: 50%; +} + +.w-col-xs-pull-5 { + right: 41.66666667%; +} + +.w-col-xs-pull-4 { + right: 33.33333333%; +} + +.w-col-xs-pull-3 { + right: 25%; +} + +.w-col-xs-pull-2 { + right: 16.66666667%; +} + +.w-col-xs-pull-1 { + right: 8.33333333%; +} + +.w-col-xs-pull-0 { + right: auto; +} + +.w-col-xs-push-12 { + left: 100%; +} + +.w-col-xs-push-11 { + left: 91.66666667%; +} + +.w-col-xs-push-10 { + left: 83.33333333%; +} + +.w-col-xs-push-9 { + left: 75%; +} + +.w-col-xs-push-8 { + left: 66.66666667%; +} + +.w-col-xs-push-7 { + left: 58.33333333%; +} + +.w-col-xs-push-6 { + left: 50%; +} + +.w-col-xs-push-5 { + left: 41.66666667%; +} + +.w-col-xs-push-4 { + left: 33.33333333%; +} + +.w-col-xs-push-3 { + left: 25%; +} + +.w-col-xs-push-2 { + left: 16.66666667%; +} + +.w-col-xs-push-1 { + left: 8.33333333%; +} + +.w-col-xs-push-0 { + left: auto; +} + +.w-col-xs-offset-12 { + margin-left: 100%; +} + +.w-col-xs-offset-11 { + margin-left: 91.66666667%; +} + +.w-col-xs-offset-10 { + margin-left: 83.33333333%; +} + +.w-col-xs-offset-9 { + margin-left: 75%; +} + +.w-col-xs-offset-8 { + margin-left: 66.66666667%; +} + +.w-col-xs-offset-7 { + margin-left: 58.33333333%; +} + +.w-col-xs-offset-6 { + margin-left: 50%; +} + +.w-col-xs-offset-5 { + margin-left: 41.66666667%; +} + +.w-col-xs-offset-4 { + margin-left: 33.33333333%; +} + +.w-col-xs-offset-3 { + margin-left: 25%; +} + +.w-col-xs-offset-2 { + margin-left: 16.66666667%; +} + +.w-col-xs-offset-1 { + margin-left: 8.33333333%; +} + +.w-col-xs-offset-0 { + margin-left: 0; +} + +@media (min-width: 768px) { + + .w-col-sm-1, + .w-col-sm-10, + .w-col-sm-11, + .w-col-sm-12, + .w-col-sm-2, + .w-col-sm-3, + .w-col-sm-4, + .w-col-sm-5, + .w-col-sm-6, + .w-col-sm-7, + .w-col-sm-8, + .w-col-sm-9 { + float: left; + } + + .w-col-sm-12 { + width: 100%; + } + + .w-col-sm-11 { + width: 91.66666667%; + } + + .w-col-sm-10 { + width: 83.33333333%; + } + + .w-col-sm-9 { + width: 75%; + } + + .w-col-sm-8 { + width: 66.66666667%; + } + + .w-col-sm-7 { + width: 58.33333333%; + } + + .w-col-sm-6 { + width: 50%; + } + + .w-col-sm-5 { + width: 41.66666667%; + } + + .w-col-sm-4 { + width: 33.33333333%; + } + + .w-col-sm-3 { + width: 25%; + } + + .w-col-sm-2 { + width: 16.66666667%; + } + + .w-col-sm-1 { + width: 8.33333333%; + } + + .w-col-sm-pull-12 { + right: 100%; + } + + .w-col-sm-pull-11 { + right: 91.66666667%; + } + + .w-col-sm-pull-10 { + right: 83.33333333%; + } + + .w-col-sm-pull-9 { + right: 75%; + } + + .w-col-sm-pull-8 { + right: 66.66666667%; + } + + .w-col-sm-pull-7 { + right: 58.33333333%; + } + + .w-col-sm-pull-6 { + right: 50%; + } + + .w-col-sm-pull-5 { + right: 41.66666667%; + } + + .w-col-sm-pull-4 { + right: 33.33333333%; + } + + .w-col-sm-pull-3 { + right: 25%; + } + + .w-col-sm-pull-2 { + right: 16.66666667%; + } + + .w-col-sm-pull-1 { + right: 8.33333333%; + } + + .w-col-sm-pull-0 { + right: auto; + } + + .w-col-sm-push-12 { + left: 100%; + } + + .w-col-sm-push-11 { + left: 91.66666667%; + } + + .w-col-sm-push-10 { + left: 83.33333333%; + } + + .w-col-sm-push-9 { + left: 75%; + } + + .w-col-sm-push-8 { + left: 66.66666667%; + } + + .w-col-sm-push-7 { + left: 58.33333333%; + } + + .w-col-sm-push-6 { + left: 50%; + } + + .w-col-sm-push-5 { + left: 41.66666667%; + } + + .w-col-sm-push-4 { + left: 33.33333333%; + } + + .w-col-sm-push-3 { + left: 25%; + } + + .w-col-sm-push-2 { + left: 16.66666667%; + } + + .w-col-sm-push-1 { + left: 8.33333333%; + } + + .w-col-sm-push-0 { + left: auto; + } + + .w-col-sm-offset-12 { + margin-left: 100%; + } + + .w-col-sm-offset-11 { + margin-left: 91.66666667%; + } + + .w-col-sm-offset-10 { + margin-left: 83.33333333%; + } + + .w-col-sm-offset-9 { + margin-left: 75%; + } + + .w-col-sm-offset-8 { + margin-left: 66.66666667%; + } + + .w-col-sm-offset-7 { + margin-left: 58.33333333%; + } + + .w-col-sm-offset-6 { + margin-left: 50%; + } + + .w-col-sm-offset-5 { + margin-left: 41.66666667%; + } + + .w-col-sm-offset-4 { + margin-left: 33.33333333%; + } + + .w-col-sm-offset-3 { + margin-left: 25%; + } + + .w-col-sm-offset-2 { + margin-left: 16.66666667%; + } + + .w-col-sm-offset-1 { + margin-left: 8.33333333%; + } + + .w-col-sm-offset-0 { + margin-left: 0; + } +} + +@media (min-width: 992px) { + + .w-col-md-1, + .w-col-md-10, + .w-col-md-11, + .w-col-md-12, + .w-col-md-2, + .w-col-md-3, + .w-col-md-4, + .w-col-md-5, + .w-col-md-6, + .w-col-md-7, + .w-col-md-8, + .w-col-md-9 { + float: left; + } + + .w-col-md-12 { + width: 100%; + } + + .w-col-md-11 { + width: 91.66666667%; + } + + .w-col-md-10 { + width: 83.33333333%; + } + + .w-col-md-9 { + width: 75%; + } + + .w-col-md-8 { + width: 66.66666667%; + } + + .w-col-md-7 { + width: 58.33333333%; + } + + .w-col-md-6 { + width: 50%; + } + + .w-col-md-5 { + width: 41.66666667%; + } + + .w-col-md-4 { + width: 33.33333333%; + } + + .w-col-md-3 { + width: 25%; + } + + .w-col-md-2 { + width: 16.66666667%; + } + + .w-col-md-1 { + width: 8.33333333%; + } + + .w-col-md-pull-12 { + right: 100%; + } + + .w-col-md-pull-11 { + right: 91.66666667%; + } + + .w-col-md-pull-10 { + right: 83.33333333%; + } + + .w-col-md-pull-9 { + right: 75%; + } + + .w-col-md-pull-8 { + right: 66.66666667%; + } + + .w-col-md-pull-7 { + right: 58.33333333%; + } + + .w-col-md-pull-6 { + right: 50%; + } + + .w-col-md-pull-5 { + right: 41.66666667%; + } + + .w-col-md-pull-4 { + right: 33.33333333%; + } + + .w-col-md-pull-3 { + right: 25%; + } + + .w-col-md-pull-2 { + right: 16.66666667%; + } + + .w-col-md-pull-1 { + right: 8.33333333%; + } + + .w-col-md-pull-0 { + right: auto; + } + + .w-col-md-push-12 { + left: 100%; + } + + .w-col-md-push-11 { + left: 91.66666667%; + } + + .w-col-md-push-10 { + left: 83.33333333%; + } + + .w-col-md-push-9 { + left: 75%; + } + + .w-col-md-push-8 { + left: 66.66666667%; + } + + .w-col-md-push-7 { + left: 58.33333333%; + } + + .w-col-md-push-6 { + left: 50%; + } + + .w-col-md-push-5 { + left: 41.66666667%; + } + + .w-col-md-push-4 { + left: 33.33333333%; + } + + .w-col-md-push-3 { + left: 25%; + } + + .w-col-md-push-2 { + left: 16.66666667%; + } + + .w-col-md-push-1 { + left: 8.33333333%; + } + + .w-col-md-push-0 { + left: auto; + } + + .w-col-md-offset-12 { + margin-left: 100%; + } + + .w-col-md-offset-11 { + margin-left: 91.66666667%; + } + + .w-col-md-offset-10 { + margin-left: 83.33333333%; + } + + .w-col-md-offset-9 { + margin-left: 75%; + } + + .w-col-md-offset-8 { + margin-left: 66.66666667%; + } + + .w-col-md-offset-7 { + margin-left: 58.33333333%; + } + + .w-col-md-offset-6 { + margin-left: 50%; + } + + .w-col-md-offset-5 { + margin-left: 41.66666667%; + } + + .w-col-md-offset-4 { + margin-left: 33.33333333%; + } + + .w-col-md-offset-3 { + margin-left: 25%; + } + + .w-col-md-offset-2 { + margin-left: 16.66666667%; + } + + .w-col-md-offset-1 { + margin-left: 8.33333333%; + } + + .w-col-md-offset-0 { + margin-left: 0; + } +} + +@media (min-width: 1200px) { + + .w-col-lg-1, + .w-col-lg-10, + .w-col-lg-11, + .w-col-lg-12, + .w-col-lg-2, + .w-col-lg-3, + .w-col-lg-4, + .w-col-lg-5, + .w-col-lg-6, + .w-col-lg-7, + .w-col-lg-8, + .w-col-lg-9 { + float: left; + } + + .w-col-lg-12 { + width: 100%; + } + + .w-col-lg-11 { + width: 91.66666667%; + } + + .w-col-lg-10 { + width: 83.33333333%; + } + + .w-col-lg-9 { + width: 75%; + } + + .w-col-lg-8 { + width: 66.66666667%; + } + + .w-col-lg-7 { + width: 58.33333333%; + } + + .w-col-lg-6 { + width: 50%; + } + + .w-col-lg-5 { + width: 41.66666667%; + } + + .w-col-lg-4 { + width: 33.33333333%; + } + + .w-col-lg-3 { + width: 25%; + } + + .w-col-lg-2 { + width: 16.66666667%; + } + + .w-col-lg-1 { + width: 8.33333333%; + } + + .w-col-lg-pull-12 { + right: 100%; + } + + .w-col-lg-pull-11 { + right: 91.66666667%; + } + + .w-col-lg-pull-10 { + right: 83.33333333%; + } + + .w-col-lg-pull-9 { + right: 75%; + } + + .w-col-lg-pull-8 { + right: 66.66666667%; + } + + .w-col-lg-pull-7 { + right: 58.33333333%; + } + + .w-col-lg-pull-6 { + right: 50%; + } + + .w-col-lg-pull-5 { + right: 41.66666667%; + } + + .w-col-lg-pull-4 { + right: 33.33333333%; + } + + .w-col-lg-pull-3 { + right: 25%; + } + + .w-col-lg-pull-2 { + right: 16.66666667%; + } + + .w-col-lg-pull-1 { + right: 8.33333333%; + } + + .w-col-lg-pull-0 { + right: auto; + } + + .w-col-lg-push-12 { + left: 100%; + } + + .w-col-lg-push-11 { + left: 91.66666667%; + } + + .w-col-lg-push-10 { + left: 83.33333333%; + } + + .w-col-lg-push-9 { + left: 75%; + } + + .w-col-lg-push-8 { + left: 66.66666667%; + } + + .w-col-lg-push-7 { + left: 58.33333333%; + } + + .w-col-lg-push-6 { + left: 50%; + } + + .w-col-lg-push-5 { + left: 41.66666667%; + } + + .w-col-lg-push-4 { + left: 33.33333333%; + } + + .w-col-lg-push-3 { + left: 25%; + } + + .w-col-lg-push-2 { + left: 16.66666667%; + } + + .w-col-lg-push-1 { + left: 8.33333333%; + } + + .w-col-lg-push-0 { + left: auto; + } + + .w-col-lg-offset-12 { + margin-left: 100%; + } + + .w-col-lg-offset-11 { + margin-left: 91.66666667%; + } + + .w-col-lg-offset-10 { + margin-left: 83.33333333%; + } + + .w-col-lg-offset-9 { + margin-left: 75%; + } + + .w-col-lg-offset-8 { + margin-left: 66.66666667%; + } + + .w-col-lg-offset-7 { + margin-left: 58.33333333%; + } + + .w-col-lg-offset-6 { + margin-left: 50%; + } + + .w-col-lg-offset-5 { + margin-left: 41.66666667%; + } + + .w-col-lg-offset-4 { + margin-left: 33.33333333%; + } + + .w-col-lg-offset-3 { + margin-left: 25%; + } + + .w-col-lg-offset-2 { + margin-left: 16.66666667%; + } + + .w-col-lg-offset-1 { + margin-left: 8.33333333%; + } + + .w-col-lg-offset-0 { + margin-left: 0; + } +} + +.w-clearfix:after, +.w-clearfix:before, +.w-container-fluid:after, +.w-container-fluid:before, +.w-container:after, +.w-container:before, +.w-row:after, +.w-row:before { + content: " "; + display: table; +} + +.w-clearfix:after, +.w-container-fluid:after, +.w-container:after, +.w-row:after { + clear: both; +} + +.w-center-block { + display: block; + margin-left: auto; + margin-right: auto; +} + +.w-pull-right { + float: right !important; +} + +.w-pull-left { + float: left !important; +} + +.w-hide { + display: none !important; +} + +.w-show { + display: block !important; +} + +.w-invisible { + visibility: hidden; +} + +.w-text-hide { + font: 0/0 a; + color: transparent; + text-shadow: none; + background-color: transparent; + border: 0; +} + +.w-hidden { + display: none !important; +} + +.w-affix { + position: fixed; +} + +.mec-image-popup-wrap { + display: none; +} + +#wns-be-infobar.sticky { + position: fixed; + top: 32px; + background: #fff; + z-index: 999; + width: 82%; +} + +.wns-be-main .wns-saved-settings.sticky { + position: fixed; + width: 62.5%; + top: 111px; + z-index: 999999999999999999; +} + +textarea.mec-import-settings-content { + display: block; + width: 100%; + min-height: 120px; + margin-bottom: 25px; + padding: 10px 15px; +} + +.mec-import-options-notification { + display: inline-block; +} + +.mec-import-options-notification .mec-message-import-error, +.mec-import-options-notification .mec-message-import-success { + display: inline-block; + padding: 15px 12px; + margin-left: 12px; + opacity: 0; + visibility: hidden; + font-weight: 700; +} + +.mec-import-options-notification .mec-message-import-success { + opacity: 1; + visibility: visible; + border: 2px solid green; +} + +.mec-import-options-notification .mec-message-import-error { + opacity: 1; + visibility: visible; + border: 2px solid #e62117; +} + +.mec-export-settings:focus, +.mec-import-settings:focus { + color: #07bbe9; +} + +.mec-import-settings-wrap { + position: relative; +} + +.mec-import-settings-wrap textarea { + max-width: unset !important; +} + +.mec-loarder-wrap { + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + background: rgba(202, 202, 202, 0.7); + z-index: 9999; +} + +.mec-loarder-wrap.mec-settings-loader { + top: 34px; +} + +.mec-loarder { + position: absolute; + width: 64px; + height: 64px; + top: calc(50% - 32px); + left: calc(50% - 36px); +} + +.mec-loarder div { + display: inline-block; + position: absolute; + left: 6px; + width: 4px; + background: #fff; + animation: mec-loarder 1.2s cubic-bezier(0, 0.5, 0.5, 1) infinite; +} + +.mec-loarder div:first-child { + left: 27px; + animation-delay: -0.24s; + background: #0075ff; +} + +.mec-loarder div:nth-child(2) { + left: 36px; + animation-delay: -0.12s; + background: #028bff; +} + +.mec-loarder div:nth-child(3) { + left: 45px; + animation-delay: 0; + background: #32a0ff; +} + +@keyframes mec-loarder { + 0% { + top: 6px; + height: 51px; + } + + 100%, + 50% { + top: 19px; + height: 26px; + } +} + +.w-box.support-page.searchbox { + background: #40d8f0; + color: #fff; + min-height: 260px; + text-align: center; + border-radius: 11px; +} + +#webnus-dashboard .search-form input { + background: rgba(255, 255, 255, 0.2); + border: none; + width: 50%; + outline: 0; + color: rgba(255, 255, 255, 0.7); + font-size: 18px; + border-radius: 4px 0 0 4px; + box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.03); + -webkit-transition: background 0.4s, box-shadow 0.2s; + transition: background 0.4s, box-shadow 0.2s; + padding: 20px 32px; + margin: 0; +} + +#webnus-dashboard .search-form button { + background: rgba(255, 255, 255, 0.2); + border: none; + padding: 20px 32px; + margin-left: -2px; + color: #fff; + border-radius: 0 4px 4px 0; + font-size: 18px; + cursor: pointer; + -webkit-transition: background 0.4s, box-shadow 0.2s; + transition: background 0.4s, box-shadow 0.2s; +} + +#webnus-dashboard .search-form button:hover { + background: #fff; + color: #3a3c4c; +} + +.w-box.support-page.searchbox p { + font-size: 30px; +} + +.search-form input::-webkit-input-placeholder { + color: rgba(255, 255, 255, 0.7); +} + +.search-form input::-moz-placeholder { + color: rgba(255, 255, 255, 0.7); +} + +.search-form input:-ms-input-placeholder { + color: rgba(255, 255, 255, 0.7); +} + +.search-form input:-moz-placeholder { + color: rgba(255, 255, 255, 0.7); +} + +#webnus-dashboard .search-form input:active, +#webnus-dashboard .search-form input:focus { + box-shadow: 0 10px 20px rgba(0, 0, 0, 0.14); + background: #fff; + color: #3a3c4c; +} + +#webnus-dashboard .search-form input:active::-webkit-input-placeholder, +#webnus-dashboard .search-form input:focus::-webkit-input-placeholder { + color: #3a3c4c; +} + +#webnus-dashboard .search-form input:active::-moz-placeholder, +#webnus-dashboard .search-form input:focus::-moz-placeholder { + color: #3a3c4c; +} + +#webnus-dashboard .search-form input:active:-ms-input-placeholder, +#webnus-dashboard .search-form input:focus:-ms-input-placeholder { + color: #3a3c4c; +} + +#webnus-dashboard .search-form input:active:-moz-placeholder, +#webnus-dashboard .search-form input:focus:-moz-placeholder { + color: #3a3c4c; +} + +#webnus-dashboard .w-box.support-page.mec-ticksy { + text-align: center; + min-height: 260px; +} + +#webnus-dashboard .w-box.support-page.mec-ticksy p { + font-size: 20px; + width: 70%; + margin: 0 auto; + margin-bottom: 40px; + margin-top: 40px; +} + +#webnus-dashboard .support-box a, +#webnus-dashboard .w-box.support-page.mec-ticksy a { + color: #fff; + font-weight: 500; + border-radius: 50px; + text-shadow: none; + background: #40d8f0; + border: none; + transition: 0.24s; + padding: 12px 30px; + cursor: pointer; + margin-bottom: 40px; + display: inline-block; +} + +#webnus-dashboard .support-box a:hover, +#webnus-dashboard .w-box.support-page.mec-ticksy a:hover { + background: #222; + box-shadow: 0 5px 23px -7px rgba(0, 0, 0, 0.5); +} + +#webnus-dashboard .support-box a { + margin: 40px 4px 0 4px; +} + +.mec-faq-accordion>.mec-faq-accordion-content { + display: none; +} + +#webnus-dashboard .mec-faq-accordion-trigger a { + font-size: 15px; + padding: 15px; + background: #f0f1f2; + display: block; + color: #222; + line-height: 17px; + outline: 0; + border-radius: 8px; +} + +.mec-faq-accordion-trigger { + margin-bottom: 5px; + position: relative; +} + +#webnus-dashboard .mec-faq-accordion-trigger a:after { + font-family: simple-line-icons; + content: "\e095"; + position: absolute; + right: 12px; + font-weight: 700; +} + +.mec-faq-accordion-content { + padding: 5px 14px 25px; +} + +#webnus-dashboard .mec-faq-accordion-trigger a.active:after { + content: "\e082"; +} + +#webnus-dashboard .support-page-links a { + color: #fff; + border-radius: 50px; + padding: 13px 24px; + font-size: 12px; + letter-spacing: 1px; + font-weight: 600; + text-transform: uppercase; + transition: all 0.2s ease; +} + +#webnus-dashboard .support-page-links a:hover, +#webnus-dashboard .w-box.support-page.videobox .w-button a:hover { + background: #222; + box-shadow: 0 2px 5px -1px rgba(0, 0, 0, 0.1); +} + +#webnus-dashboard .support-page-links { + display: inline-block; + margin: 12px 4px 16px 0; +} + +.support-page-links.link-to-doc a { + background: #d09d5f; +} + +.support-page-links.link-to-videos a { + background: #ff876c; +} + +.support-page-links.link-to-articles a { + background: #69ca8a; +} + +.w-box.support-page.articles-box .w-box-content a { + display: block; + padding: 6px 0; +} + +#webnus-dashboard .w-box.support-page.videobox .w-button a { + color: #fff; + font-size: 10px; + padding: 5px 15px; + min-height: 10px; + font-weight: 500; + border-radius: 22px; + box-shadow: 0 3px 10px -9px #ff5a35; + text-shadow: none; + background: #ff876c; + border: none; + transition: 0.24s; +} + +.w-box.support-page.articles-box, +.w-box.support-page.faq-box { + min-height: 500px; +} + +.w-box.support-page.videobox { + border-radius: 11px; + min-height: 282px; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.01) !important; +} + +.w-box.support-page.videobox .w-box-content { + padding: 15px; +} + +.w-box.support-page.videobox .w-box-head { + font-size: 15px; + text-align: center; + padding: 20px 0 0; +} + +#webnus-dashboard .w-box.support-page.videobox .w-button a i { + margin-right: 6px; +} + +.support-page .w-box-content ul { + margin-top: 5px; + padding-left: 5px; +} + +.support-page .w-box-content ul li { + font-size: 13px; +} + +.support-page .w-box-content ul li i { + font-size: 13px; + vertical-align: text-bottom; + margin-right: 3px; + color: #40d8f0; +} + +.w-box.mec-activation { + background: #fff url(../img/dp-dsb-support.jpg) no-repeat top right; +} + +.w-box.mec-activation .w-box-head { + width: 75%; +} + +.w-box.mec-activation .w-box-content { + padding: 10px 30px; +} + +.w-box.mec-activation input[type="radio"] { + display: none; +} + +.w-box.mec-activation input[type="radio"]+label { + color: #000; + font-size: 13px; + line-height: 14px !important; + color: #7b7b7b; +} + +.w-box.mec-activation input[type="radio"].checked+label { + color: #40d8f0; +} + +.mec-form-row input[type="radio"], +.w-box.mec-activation input[type="radio"]+label span { + display: inline-block; + margin: -2px 6px 0 0; + vertical-align: middle; + cursor: pointer; + height: 22px; + width: 22px; + text-align: center; + background-color: #fff; + border: 2px solid #e1e2e3; + border-radius: 100%; + box-shadow: none; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + position: relative; + transition: all 0.3s ease; +} + +.mec-form-row input[type="radio"]:checked, +.w-box.mec-activation input[type="radio"].checked+label span { + border-color: #afebf5; +} + +.mec-form-row input[type="radio"]:before, +.w-box.mec-activation input[type="radio"]+label span:after { + content: ""; + display: block; + margin: 0; + position: absolute; + top: 4px; + left: 4px; + width: 10px; + height: 10px; + background: 0 0; + border-radius: 100%; + transition: all 0.2s ease; + transform: scale(0.1); +} + +.mec-form-row input[type="radio"]:checked:before, +.w-box.mec-activation input[type="radio"].checked+label span:after { + background: #38d5ed; + transform: scale(1); +} + +.w-box.mec-activation .LicenseType label { + padding-right: 20px; + font-weight: 500; +} + +.w-box.mec-activation .LicenseField { + display: inline-block; + position: relative; + margin-top: 20px; +} + +.w-box.mec-activation input[name="MECPurchaseCode"] { + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.07); + min-width: 220px; + background: #f7f8f9; + border: none; + border-radius: 33px; + width: 500px; + min-height: 50px; + margin: 0; + padding-left: 20px; + text-align: left; +} + +#webnus-dashboard .w-box.mec-activation input[type="submit"] { + height: 40px; + line-height: 40px; + font-weight: 600; + border: none; + cursor: pointer; + padding: 0 30px; + border-radius: 33px; + color: #fff; + letter-spacing: 1px; + text-transform: uppercase; + font-size: 12px; + text-shadow: none; + background: #64e385; + transition: all 0.28s ease; + position: absolute; + right: 5px; + top: 5px; + font-size: 12px; +} + +#webnus-dashboard .w-box.mec-activation input[type="submit"]:hover { + background: #45ce68; +} + +#webnus-dashboard .w-box.mec-activation input[type="submit"].delete { + background: #c2c2c2; + color: #000; +} + +#webnus-dashboard .w-box.mec-activation input[type="submit"].delete:hover { + background: #ccc; +} + +#MECActivation .MECPurchaseStatus, +.addon-activation-form .MECPurchaseStatus { + display: inline-block; + width: 40px; + height: 40px; + text-align: center; + padding-top: 9px; + color: #fff; + font-weight: 700; + font-size: 18px; + border-radius: 50%; + padding-top: 8px; + position: absolute; + right: -51px; + top: calc(50% - 20px); +} + +.MECPurchaseStatus:after, +.MECPurchaseStatus:before { + position: absolute; + border-radius: 50px; + background: #fff; + content: ""; + transform: rotate(45deg); +} + +.MECPurchaseStatus.PurchaseError:before { + width: 22px; + height: 4px; + right: 9px; + top: 18px; + transform: rotate(45deg); +} + +.MECPurchaseStatus.PurchaseError:after { + width: 22px; + height: 4px; + right: 9px; + top: 18px; + transform: rotate(-45deg); +} + +.MECPurchaseStatus.PurchaseSuccess:before { + width: 13px; + height: 4px; + right: 19px; + top: 21px; + transform: rotate(45deg); +} + +.MECPurchaseStatus.PurchaseSuccess:after { + width: 22px; + height: 4px; + right: 5px; + top: 18px; + transform: rotate(-45deg); +} + +#MECActivation .MECPurchaseStatus.PurchaseError, +.addon-activation-form .MECPurchaseStatus.PurchaseError { + background: #ff876c; +} + +#MECActivation .MECPurchaseStatus.PurchaseSuccess, +.addon-activation-form .MECPurchaseStatus.PurchaseSuccess { + background: #64e385; +} + +.wna-spinner-wrap { + position: absolute; + background: #000; + width: 509px; + height: 64px; + top: -8px; + border-radius: 50px; + z-index: 999; + background-color: #fff; + opacity: 0.9; +} + +.wna-spinner { + width: 40px; + height: 40px; + position: relative; + margin: 6px auto; +} + +.wna-spinner .double-bounce1, +.wna-spinner .double-bounce2 { + width: 100%; + height: 100%; + border-radius: 50%; + background-color: #40d8f0; + opacity: 0.6; + position: absolute; + top: 0; + left: 0; + -webkit-animation: sk-bounce 2s infinite ease-in-out; + animation: sk-bounce 2s infinite ease-in-out; +} + +.wna-spinner .double-bounce2 { + -webkit-animation-delay: -1s; + animation-delay: -1s; +} + +#MECActivation .MECLicenseMessage, +.addon-activation-form .MECLicenseMessage { + padding-top: 24px; + margin-bottom: -24px; + color: #f64; + max-width: 570px; +} + +.MECLicenseMessage.mec-message-hidden { + display: none; +} + +#webnus-dashboard .w-box.mec-activation input[type="submit"].mec_revoke { + background: #e0e0e0; + color: #222; +} + +.box-addons-activation { + margin-top: 24px; + margin-bottom: 24px; +} + +.box-addon-activation-toggle-content, +.box-addon-activation-toggle-head { + display: none; +} + +.addon-activation-form h3 { + font-size: 15px; + font-weight: 400; + margin: 34px 0 -7px; +} + +.box-addon-activation-toggle-head { + line-height: 1.5; + font-size: 14px; + margin-top: 14px; + cursor: pointer; + padding: 10px 18px; + border: 1px solid #d3d5d7; + border-radius: 25px; + transition: all 0.2s ease; +} + +.box-addon-activation-toggle-head:hover { + border-color: #a5d9e1; +} + +.box-addon-activation-toggle-head i { + margin-right: 7px; + cursor: pointer; + font-size: 13px; + font-weight: normal; +} + +#mec-advanced-wraper div:first-child>ul { + display: block; + margin: 5px 0; + padding: 5px 0; + width: 390px; + border: 1px solid #e1e2e3; + border-radius: 2px; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05); +} + +#mec-advanced-wraper div:first-child>ul span { + display: none; +} + +#mec-advanced-wraper div:first-child>ul * { + display: inline-block; + background: #fff; + font-size: 12px; + color: #717273; + text-align: center; +} + +#mec-advanced-wraper div:first-child>ul>li { + width: 60px; + font-weight: 700; + margin: 0 10px 0 0; + padding: 4px 0; + border-right: 1px solid #e1e2e3; +} + +#mec-advanced-wraper div:first-child>ul>ul>li { + margin: 0; + padding: 2px 10px; + cursor: pointer; + border-radius: 2px; + transition: all 0.18s ease; +} + +#mec-advanced-wraper div:first-child>ul>ul>li:hover, +.mec-active { + background: #07bbe9 !important; + color: #fff !important; +} + +@-webkit-keyframes sk-bounce { + + 0%, + 100% { + -webkit-transform: scale(0); + } + + 50% { + -webkit-transform: scale(1); + } +} + +@keyframes sk-bounce { + + 0%, + 100% { + transform: scale(0); + -webkit-transform: scale(0); + } + + 50% { + transform: scale(1); + -webkit-transform: scale(1); + } +} + +.w-col-sm-3 .w-box.addon { + min-height: 372px; + text-align: center; + border-radius: 9px; + box-shadow: 0 1px 2px 0 rgb(0 0 0 / 1%); +} + +.m-e-calendar_page_MEC-addons .welcome-content .w-col-sm-3 { + width: 33.33%; + clear: none !important; + min-height: 380px; +} + +@media (min-width: 768px) and (max-width: 1281px) { + .m-e-calendar_page_MEC-addons .welcome-content .w-col-sm-3 { + width: 50%; + } +} + +@media (max-width: 767px) { + .m-e-calendar_page_MEC-addons .welcome-content .w-col-sm-3 { + width: 100%; + } +} + +.w-box-child.mec-addon-box { + padding: 0; +} + +.mec-addon-box-head { + border-bottom: 1px solid #f7f8f9; + padding: 20px 20px 8px; + margin-bottom: 14px; + position: relative; +} + +.mec-addon-box-version { + position: relative; + border-radius: 1px; + padding: 0 8px; + font-family: monospace; + background: #f4f7f7; + color: #00a1b7; + font-size: 11px; + letter-spacing: 0.2px; + line-height: 21px; + display: inline-block; + margin: 10px 0; +} + +.mec-addon-box-head img { + display: block; + width: 100%; + height: 60px; + margin-bottom: 10px; + margin-top: 10px; +} + +.mec-addon-box-title { + font-weight: 600; + font-size: 18px; + line-height: 36px; + color: #27272a; + letter-spacing: -0.2px; +} + +.mec-addon-box-title a span { + color: #444; + font-size: 15px; +} + +.mec-addon-box-content { + padding: 0 20px; +} + +.mec-addon-box-content p { + color: #6e757b; + font-size: 14px; + letter-spacing: 0.1px; +} + +.mec-addon-box-mec-version { + background: #f3f3f3; + padding: 10px; + font-size: 13px; +} + +.mec-addon-box-pro { + display: inline-block; + background: #ff7d5f; + color: #fff; + font-weight: 600; + font-size: 11px; + letter-spacing: 0.2px; + line-height: 21px; + padding: 0 8px; + border-radius: 3px; +} + +.mec-addon-box-pro-lite { + background: #4cbf67; + color: #fff; + font-weight: 600; + font-size: 11px; + letter-spacing: 0.2px; + line-height: 21px; + padding: 0 8px; + border-radius: 3px; + display: inline-block; +} + +#webnus-dashboard .addons-page-links { + display: inline-block; + margin: 12px 4px 16px 0; +} + +#webnus-dashboard .addons-page-links a { + background-color: #fff; + color: #fff; + border-radius: 2px; + padding: 13px 24px; + font-size: 12px; + letter-spacing: 1px; + font-weight: 600; + text-transform: uppercase; +} + +.addons-page-links.link-to-purchase a { + background: #4cbf67; + background: linear-gradient(95deg, #6fe08a 0, #58cf74 50%, #36cb58 100%); + box-shadow: 0 5px 10px -5px #4cbf67; +} + +.addons-page-links.link-to-install-addons a { + background: #b092e6; + background: linear-gradient(95deg, #b092e6 0, #9b70e8 50%, #8e5cea 100%); + box-shadow: 0 5px 10px -5px #b092e6; +} + +#webnus-dashboard .addons-page-links a:hover, +#webnus-dashboard .w-box.addons-page.videobox .w-button a:hover { + background: #222; + background: linear-gradient(95deg, #555 0, #222 50%, #000 100%); + box-shadow: 0 5px 21px -5px rgba(0, 0, 0, 0.5); +} + +.mec-addon-box-footer { + background: #f7f8f9; + border-radius: 0 0 9px 9px; + padding: 10px 1px 8px; + margin-top: 25px; + text-align: center; + position: absolute; + left: 0; + right: 0; + bottom: 0; +} + +#webnus-dashboard .mec-addon-box-footer a { + margin-top: 10px; + display: inline-block; + text-shadow: none; + border: none; + transition: 0.24s; + position: relative; + margin-right: 7px; + font-size: 12px; + font-weight: 500; + border-radius: 8px; + padding: 9px 18px 8px; + width: 53px; + height: 34px; + line-height: 21px; + background: 0 0; + margin: 0; + box-shadow: none; +} + +#webnus-dashboard .mec-addon-box-footer a:last-of-type { + margin-right: 0; +} + +#webnus-dashboard .mec-addon-box-footer a.mec-addon-box-intro:hover { + background-color: #ff3535; + background: linear-gradient(95deg, #ff6c6c 0, #f55 50%, #ff3535 100%); +} + +#webnus-dashboard .mec-addon-box-footer a:hover { + background: #00cae6; + cursor: pointer !important; +} + +#webnus-dashboard .mec-addon-box-footer a i { + color: #00cae6; + font-size: 16px; +} + +#webnus-dashboard .mec-addon-box-footer a:hover i { + color: #fff; +} + +#mec_tickets .mec-box { + position: relative; + padding: 20px; +} + +#mec_fees_list input[type="text"].mec-col-12, +#mec_ticket_variations_list input[type="text"].mec-col-12 { + max-width: 625px; +} + +#taxes_option .mec-form-row input[type="text"].mec-col-12, +#ticket_variations_option input[type="text"].mec-col-12 { + max-width: 575px; +} + +.mec-booking-tab-content .mec-form-row textarea { + max-width: 762px; +} + +#mec_tickets .button.remove { + padding: 0; + min-height: 28px; + height: 28px; + width: 28px; + margin: 0; + border-radius: 50%; + position: absolute; + top: 20px; + right: 20px; + color: #fff; + box-shadow: none; + background: #fff; + border-color: #ea6485; + font-size: 20px; + line-height: 1.5; +} + +#mec_tickets .button.remove svg { + fill: #ea6485 !important; +} + +#mec_tickets .button.remove:hover { + color: #fff; + border-color: #ea6485; + background: #ea6485; +} + +#mec_tickets .button.remove:hover svg { + fill: #fff !important; +} + +@media (max-width: 480px) { + #mec_tickets .button.remove { + top: 5px; + right: 5px; + } +} + +.mec-ticket-id { + font-size: 12px; + line-height: 12px; + font-weight: 400; + color: #07bbe9; + padding: 0 0 8px; + margin-bottom: 14px; + cursor: default; +} + +.mec-ticket-end-time.mec-col-12 .mec-time-span, +.mec-ticket-start-time.mec-col-12 .mec-time-span { + min-width: 80px; + display: inline-block; +} + +.mec-ticket-start-time { + margin-bottom: 20px; +} + +.mec-ticket-time { + min-width: 69px; + display: inline-block; +} + +.mec-stop-selling-tickets { + min-width: 185px; +} + +#mec_meta_box_hourly_schedule_days .mec-form-row input[type="text"], +#mec_meta_box_tickets_form .mec-form-row input[type="text"] { + max-width: 290px; +} + +@media (max-width: 1366px) { + #mec_meta_box_hourly_schedule_days .mec-box.mec-form-row input[type="text"] { + max-width: 150px; + min-width: 110px; + } +} + +#mec_exceptions_not_in_days_date { + width: 100%; +} + +#mec-event-data input[type="date"], +#mec-event-data input[type="email"], +#mec-event-data input[type="tel"], +#mec-event-data input[type="text"], +#mec-event-data input[type="url"], +#mec-event-data select, +#mec-event-data textarea, +#mec_exceptions_not_in_days_date, +#mec_meta_box_date_form input[type="text"], +#mec_meta_box_date_form input[type="url"], +#mec_select_tags.mec-create-shortcode-tab-content input[type="text"], +#mec_settings_weather_module_api_key { + max-width: 290px; +} + +#mec-event-data input[type="text"].mec_date_picker.mec-col-4 #mec_meta_box_calendar_skin_options input[type="text"].mec_date_picker.mec-col-4 { + max-width: 32.33333333%; +} + +#payment_gateways_option .mec-col-4 input[type="number"], +#payment_gateways_option .mec-col-4 input[type="text"], +#payment_gateways_option .mec-col-4 select, +#payment_gateways_option .mec-col-4 textarea { + width: 90%; +} + +.mec-form-repeating-event-row .mec-col-6 input[type="text"] { + width: 35%; +} + +.addons-page-error, +.addons-page-notice { + display: block; + margin-top: 15px; + margin-bottom: 0; + background: #fff; + border-left: 4px solid #00a0d2; + box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1); + padding: 1px 12px; +} + +.addons-page-error p, +.addons-page-notice p { + margin: 0.5em 0; + padding: 2px; + font-size: 13px; +} + +.addons-page-error { + border-left-color: #dc3232; +} + +.mec-addon-box-comingsoon { + background: 0 0; + padding: 8px 11px; + color: #5a5a5a; + font-size: 14px; + font-weight: 500; + text-align: center; +} + +.mec-addons .w-row .w-col-sm-3:nth-child(4n + 1) { + clear: left; +} + +@media (min-width: 960px) { + #webnus-dashboard .mec-addon-box-footer .w-button { + text-align: right; + } +} + +@media (min-width: 1401px) { + .mec-addon-box-title a span { + font-size: 17px; + } +} + +.mec-pro-notice { + margin-top: 24px; + line-height: 30px; +} + +.mec-pro-notice .info-msg { + padding: 50px 30px; + margin-bottom: 0; +} + +#webnus-dashboard .mec-pro-notice .info-msg { + background: #fff; + box-shadow: 0 1px 2px rgb(0 0 0 / 1%); + text-align: center; + color: #55595d; +} + +#webnus-dashboard a.info-msg-link { + background: #e66f52; + background: linear-gradient(95deg, #ff8162 0, #e66f52 50%, #ff4c20 100%); + box-shadow: 0 5px 10px -5px #e66f52; + border-radius: 2px; + padding: 12px 50px; + font-size: 16px; + line-height: 24px; + border: none; + margin: 20px auto 0; + color: #fff; + transition: all 0.3s ease; + display: inline-block; +} + +#webnus-dashboard a.info-msg-link:hover { + background: #222; + background: linear-gradient(95deg, #555 0, #222 50%, #000 100%); + box-shadow: 0 5px 21px -5px rgba(0, 0, 0, 0.5); +} + +#webnus-dashboard .info-msg p { + width: 70%; + margin: 0 auto; + line-height: 1.8; +} + +#webnus-dashboard .info-msg-coupon { + font-size: 13px; + color: #777; + max-width: 600px; + line-height: 1.68; + margin: 25px auto 0; +} + +#webnus-dashboard .info-msg-coupon strong { + font-weight: 700; + color: #19ce18; +} + +.info-msg .socialfollow { + padding-top: 20px; +} + +.info-msg .socialfollow a { + margin: 0 2px; + display: inline-block; +} + +.info-msg .socialfollow a i { + background: #96a4b1; + color: #fff; + padding: 6px; + border-radius: 3px; + font-size: 18px; + box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1); + transition: all 0.25s; +} + +.info-msg .socialfollow a:hover i { + background: #008aff; +} + +.mec-intro-section .w-box-content { + text-align: center; +} + +.mec-intro-section .w-box-content.mec-intro-section-welcome { + max-width: 600px; + margin: 0 auto; +} + +.mec-intro-section .w-box-content.mec-intro-section-welcome h3 { + font-size: 26px; +} + +a.mec-intro-section-link-tag.button.button-hero { + margin: 0 10px 40px; +} + +a.mec-intro-section-link-tag.button.button-primary.button-hero { + color: #fff !important; +} + +a.mec-intro-section-link-tag.button.button-secondary.button-hero { + color: #1dbfd8 !important; +} + +.mec-intro-section-ifarme iframe { + border: 1px solid #e7e7e7; + border-radius: 9px; + padding: 15px; + box-shadow: 0 3px 10px -6px rgb(0 0 0 / 12%); +} + +.w-box-content.mec-intro-section-welcome p { + margin-bottom: 0; +} + +.mec-tooltip a:focus { + box-shadow: none; +} + +#mec_booking_form .mec-options-fields, +#mec_modules_form .mec-options-fields, +#mec_settings_form .mec-options-fields, +#mec_single_form .mec-options-fields { + padding-bottom: 0 !important; +} + +#mec_taxes_fees_container_toggle { + margin-bottom: 60px; +} + +#mec_taxes_fees_container_toggle { + margin-bottom: 60px; +} + +.wns-be-sidebar li { + position: relative; +} + +.wns-be-sidebar li .submneu-hover { + position: absolute; + top: -1px; + right: -222px; + width: 220px; + z-index: 9; + background: #fff; + border: 1px; + border-style: solid; + border-color: #dedede; + margin: 0; + overflow: visible; + opacity: 0; + visibility: hidden; + transition: all 0.23s ease; + padding-top: 8px; + padding-bottom: 12px; +} + +.wns-be-sidebar li:hover .submneu-hover { + opacity: 1; + visibility: visible; +} + +.wns-be-sidebar li .submneu-hover a { + background: #fff; + color: #636363; + opacity: 1; + font-size: 12px; + padding: 6px 4px 6px 26px; +} + +.wns-be-sidebar li .submneu-hover a:hover { + background: #f6f6f6; + color: #222; +} + +.wns-be-sidebar li .submneu-hover:before { + position: absolute; + z-index: 999; + content: " "; + height: 0; + width: 0; + border: 7px solid transparent; + border-right-color: #fff; + left: -15px; + top: 14px; + border-right-color: #c5c5c5; + right: 0; +} + +.wns-be-sidebar li .submneu-hover:after { + position: absolute; + z-index: 999; + content: " "; + height: 0; + width: 0; + border: 7px solid transparent; + border-right-color: #fff; + left: -14px; + top: 14px; +} + +.wns-be-sidebar li a:focus, +.wns-be-sidebar li:focus { + outline: -webkit-focus-ring-color auto 0; + border: 0; + box-shadow: none; +} + +@media (max-width: 480px) { + .wns-be-sidebar li .submneu-hover { + width: 175px; + right: 0; + } + + .wns-be-sidebar li .submneu-hover a { + font-size: 11px; + padding: 5px 5px 5px 20px; + } +} + +.mec-tooltip:hover:after, +.mec-tooltip:hover:before { + display: none; +} + +.mec-tooltip { + bottom: 0; +} + +.mec-tooltip .box { + min-width: 300px; + max-width: 600px; + display: inline-block; + left: 36px; + top: calc(50% - 9px); + transform: translateY(-50%); + padding: 0; + margin-top: 8px; + background-color: #535a61; + color: #fff; + font-weight: 300; + font-size: 14px; + letter-spacing: 0.5px; + line-height: 1.3; + position: absolute; + z-index: 9999999; + box-sizing: border-box; + border-radius: 6px; + box-shadow: 0 4px 32px -10px #444b50; + visibility: hidden; + opacity: 0; + transition: opacity 0.23s; +} + +#webnus-dashboard .mec-tooltip .box p, +.mec-tooltip .box p { + color: #fff; + font-size: 14px; + line-height: 1.3; + margin: 0; + font-style: normal; +} + +.mec-tooltip:hover .box { + visibility: visible; + opacity: 1; +} + +.mec-tooltip:hover .box { + padding: 20px; + border-radius: 8px; +} + +.mec-tooltip .box h5 { + color: #fff; + font-size: 17px; + font-weight: 600; + margin: -30px -20px; + padding: 15px 0; + text-align: center; + margin-bottom: 10px; + background: #3a3f44; + border-bottom: 1px solid #30353a; + border-radius: 6px 6px 0 0; + z-index: 9999; +} + +.mec-tooltip .box h5:after { + display: none; +} + +#webnus-dashboard .mec-tooltip .box p a, +.mec-tooltip .box p a { + color: #40d9f1; + margin-top: 10px; + margin-left: 0; + font-weight: 400; + position: relative; + text-decoration: none; + display: block; + width: max-content; +} + +.mec-tooltip .box a:hover { + color: #f90; +} + +.mec-tooltip .box:after { + display: block; + position: absolute !important; + top: 100% !important; + right: 50% !important; + margin-top: -6px !important; + margin-right: -6px !important; + width: 12px !important; + height: 24px !important; + overflow: hidden !important; + transform: rotate(-90deg) !important; +} + +.mec-tooltip .box:before { + display: block; + content: "" !important; + position: absolute !important; + width: 12px; + height: 12px; + left: -10px !important; + top: 50% !important; + transform: translate(50%, -50%) rotate(-45deg) !important; + background-color: #535a61 !important; + box-shadow: 0 8px 9px -4px #535a61 !important; + z-index: 0 !important; +} + +.mec-tooltip .box.top { + left: 50%; + top: 0; + transform: translate(-50%, -100%); + margin-top: 0; + margin-left: -10px; +} + +.mec-tooltip .box.top:after { + top: 50% !important; + right: 100% !important; +} + +.mec-tooltip .box.top:before { + left: 50% !important; + top: 100% !important; +} + +.mec-tooltip .box.bottom { + left: 50%; + top: auto; + bottom: 0; + transform: translate(-50%, 100%); + margin-bottom: -20px; + margin-left: -10px; +} + +.mec-tooltip .box.bottom:after { + top: 0 !important; + right: 50% !important; + background-color: #3a3f44 !important; +} + +.mec-tooltip .box.bottom:before { + left: 50% !important; + top: -7px !important; + transform: translateX(-50%); + background-color: #3a3f44 !important; +} + +.mec-tooltip .box.left { + left: auto; + right: 36px; + top: calc(50% - 9px); + transform: translateY(-50%); +} + +.mec-tooltip .box.left:before { + right: 0 !important; + left: auto !important; + top: 50% !important; +} + +form#mec_reg_fields_form input[type="radio"]:before { + content: ""; + display: inline-block; + background: #fff; + border-radius: 18px; + width: 14px; + height: 14px; + margin: -1px 0 0 -2px; + cursor: pointer; + border: 2px solid #e1e7ed; + box-shadow: 0 2px 15px -3px rgba(69, 77, 89, 0.32); +} + +form#mec_reg_fields_form input[type="radio"]:checked:before { + border: 7px solid #ccecf4; + background: #fff; + box-shadow: 0 3px 16px -3px #008aff; + width: 4px; + height: 4px; +} + +form#mec_reg_fields_form input[type="radio"] { + min-height: 0; + margin-right: 6px; +} + +form#mec_reg_fields_form label { + margin-right: 20px; +} + +@media (min-width: 1200px) and (max-width: 1366px) { + .mec-tooltip .box { + min-width: 290px; + } + + .mec-tooltip .box h5 { + font-size: 15px; + } + + .mec-tooltip .box .content { + font-size: 12px; + } +} + +@media (max-width: 1366px) { + .wns-be-container .wns-be-group-tab p { + margin-top: 0; + } +} + +.mec-addons-notification-box-wrap .w-col-sm-12, +.mec-cmsg-notification-box-wrap .w-col-sm-12 { + padding: 0; +} + +.mec-addons-notification-box-wrap img { + width: auto; +} + +.mec-addons-notification-box-image { + width: 555px; + display: inline-block; + vertical-align: top; +} + +.mec-addons-notification-box-content { + width: calc(100% - 559px); + display: inline-block; +} + +.mec-addons-notification-box-content p { + margin-top: 1%; + line-height: 1.5; + font-size: 16px; +} + +.mec-addons-notification-box-content .w-box-content { + padding-top: 0; + padding-bottom: 0; +} + +.mec-addons-notification-box-content ol { + font-size: 16px; +} + +.mec-addons-notification-box-content a { + background: #38d5ed; + color: #fff !important; + padding: 10px 26px; + margin-top: 5px; + display: inline-block; + border-radius: 3px; + text-transform: capitalize; + font-size: 16px; + letter-spacing: 0.4px; + transition: all 0.1s ease; + font-weight: 600; + text-decoration: none; +} + +.mec-addons-notification-box-content a:hover { + background: #000; +} + +.w-clearfix.w-box.mec-addons-notification-box-wrap span, +.w-clearfix.w-box.mec-cmsg-2-notification-box-wrap span, +.w-clearfix.w-box.mec-cmsg-notification-box-wrap span { + right: 0; + left: unset; + cursor: pointer; + background: 0 0; + padding: 0 16px; +} + +.w-clearfix.w-box.mec-addons-notification-box-wrap span i, +.w-clearfix.w-box.mec-cmsg-2-notification-box-wrap span i, +.w-clearfix.w-box.mec-cmsg-notification-box-wrap span i { + font-size: 28px; + vertical-align: sub; + color: #f2113e; +} + +.mec-custom-msg-notification-wrap, +.wns-be-container .mec-addons-notification-wrap { + padding: 0; + margin: 0; +} + +.mec-custom-msg-notification-wrap .w-col-sm-12, +.wns-be-container .mec-addons-notification-wrap .w-col-sm-12 { + padding: 0; +} + +.wns-be-container .w-box { + margin-top: 0; +} + +.wns-be-container.mec-addons-notification-set-box { + margin-right: 15px; + margin-top: 50px; + margin-bottom: 27px; +} + +@media (max-width: 1200px) { + + .mec-addons-notification-box-content, + .mec-addons-notification-box-image { + width: 100%; + display: block; + } + + .mec-addons-notification-box-image { + text-align: center; + } +} + +@media (max-width: 768px) { + .mec-addons-notification-box-image img { + width: 100%; + height: auto; + } +} + +.mec-details-addons-container { + margin-top: 20px; +} + +.mec-details-addons-wrap img { + float: left; + width: 19%; + margin-right: 17px; +} + +.mec-details-addons-wrap { + clear: both; + margin-bottom: 80px; + display: block; + position: relative; +} + +.mec-details-addons-wrap a { + text-decoration: none; +} + +.mec-details-addons-wrap p { + float: left; + width: 340px; + margin-top: 0; + margin-bottom: 30px; +} + +.mec-details-addons-title { + font-weight: 700; +} + +.mec-details-addons-title a { + color: #444; +} + +body .crisp-client .crisp-1rjpbb7 .crisp-1rf4xdh .crisp-ewasyx { + border-radius: 10px !important; + box-shadow: 0 4px 38px rgba(0, 0, 0, 0.14) !important; +} + +body .crisp-client .crisp-1rjpbb7 .crisp-13qutdl, +body .crisp-client .crisp-1rjpbb7 .crisp-13qutdl *, +body .crisp-client .crisp-1rjpbb7 .crisp-9dgo7z, +body .crisp-client .crisp-1rjpbb7 .crisp-9dgo7z * { + font-family: proxima-nova, -apple-system, BlinkMacSystemFont, "Segoe UI", + Catamaran, sans-serif !important; +} + +body .crisp-client .crisp-1rjpbb7 .crisp-145mbcr, +body .crisp-client .crisp-1rjpbb7 .crisp-1jrqqbm:hover { + background-color: #fff !important; +} + +body .crisp-client .crisp-1rjpbb7 .crisp-14u434g { + border-color: #e7e8e9 !important; +} + +body .crisp-client .crisp-1rjpbb7 .crisp-1rf4xdh .crisp-ewasyx .crisp-1784wh6 .crisp-1xmtdlg .crisp-1bkorcf .crisp-1vzg1qq { + font-size: 20px !important; + width: 14px !important; + height: 19px !important; + opacity: 0.85; +} + +body .crisp-client .crisp-1rjpbb7 .crisp-1rf4xdh .crisp-ewasyx .crisp-1784wh6 .crisp-1xmtdlg .crisp-1bkorcf .crisp-1vzg1qq:hover { + opacity: 0.99; +} + +body .crisp-client .crisp-1rjpbb7 .crisp-1rf4xdh .crisp-ewasyx .crisp-zyxrmn .crisp-1bu0ive .crisp-1sps3eb .crisp-1vd2grm .crisp-12w4w1a { + font-size: 13px !important; +} + +body .crisp-client .crisp-1rjpbb7 .crisp-1rf4xdh .crisp-ewasyx .crisp-zyxrmn .crisp-1bu0ive .crisp-1sps3eb .crisp-1vd2grm .crisp-12w4w1a::-webkit-input-placeholder { + color: #717273 !important; +} + +body .crisp-client .crisp-1rjpbb7 .crisp-1rf4xdh .crisp-ewasyx .crisp-zyxrmn .crisp-1bu0ive .crisp-z7oo2o .crisp-lgu84d .crisp-1ohjrf0 .crisp-dqw9ko .crisp-bhspdv[data-from="visitor"] .crisp-z89v5n .crisp-162m9xf { + background-color: #008aff !important; + color: #fff !important; + box-shadow: none !important; + border-radius: 5px !important; + padding: 15px 25px 15px !important; +} + +body .crisp-client .crisp-1rjpbb7 .crisp-1rf4xdh .crisp-ewasyx .crisp-zyxrmn .crisp-1bu0ive .crisp-z7oo2o .crisp-lgu84d .crisp-1ohjrf0 .crisp-dqw9ko .crisp-bhspdv[data-from="visitor"] .crisp-z89v5n .crisp-162m9xf .crisp-1o2g4mc { + color: #fff !important; + font-size: 13px !important; + letter-spacing: 0.3px !important; +} + +body .crisp-client .crisp-1rjpbb7 .crisp-1rf4xdh .crisp-ewasyx .crisp-zyxrmn .crisp-1bu0ive .crisp-z7oo2o .crisp-lgu84d .crisp-1ohjrf0 .crisp-dqw9ko .crisp-bhspdv .crisp-z89v5n .crisp-162m9xf { + background-color: #f1f2f3 !important; + border-radius: 5px !important; + padding: 15px 25px 15px !important; + box-shadow: none !important; + color: #121314 !important; +} + +body .crisp-client .crisp-1rjpbb7 .crisp-1rf4xdh .crisp-ewasyx .crisp-zyxrmn .crisp-1bu0ive .crisp-z7oo2o .crisp-lgu84d .crisp-1ohjrf0 .crisp-dqw9ko .crisp-bhspdv[data-type="audio"] .crisp-z89v5n .crisp-162m9xf { + background-color: #d1d7dc !important; +} + +body .crisp-client .crisp-1rjpbb7 .crisp-1rf4xdh .crisp-ewasyx .crisp-zyxrmn .crisp-1bu0ive .crisp-z7oo2o .crisp-lgu84d .crisp-1ohjrf0 .crisp-dqw9ko .crisp-bhspdv[data-from="operator"] .crisp-z89v5n .crisp-1o2g4mc { + color: #121314 !important; + -webkit-text-fill-color: #121314 !important; + font-size: 13px !important; + letter-spacing: 0.3px !important; +} + +body .crisp-client .crisp-1rjpbb7 .crisp-1rf4xdh .crisp-ewasyx .crisp-zyxrmn .crisp-1bu0ive .crisp-z7oo2o .crisp-lgu84d .crisp-1ohjrf0 .crisp-dqw9ko .crisp-bhspdv .crisp-mkirz6 .crisp-12qaym5 .crisp-39hskb { + opacity: 0.4; + margin-right: 5px !important; +} + +body .crisp-client .crisp-1rjpbb7 .crisp-1rf4xdh .crisp-ewasyx .crisp-zyxrmn .crisp-1bu0ive .crisp-z7oo2o .crisp-lgu84d .crisp-1ohjrf0 .crisp-dqw9ko .crisp-bhspdv .crisp-mkirz6 .crisp-12qaym5 .crisp-ehr6mw { + opacity: 0.68; + font-size: 12px !important; +} + +body .crisp-client .crisp-1rjpbb7 .crisp-1rf4xdh .crisp-ewasyx .crisp-1784wh6 .crisp-1xmtdlg { + background-image: linear-gradient(125deg, + #008aff -10%, + #0066b1 100%) !important; + height: 110px !important; + padding-top: 35px !important; +} + +body .crisp-client .crisp-1rjpbb7 .crisp-1rf4xdh .crisp-ewasyx .crisp-1784wh6 .crisp-1xmtdlg .crisp-rhv8pz .crisp-1uw6f17, +body .crisp-client .crisp-1rjpbb7 .crisp-1rf4xdh .crisp-ewasyx .crisp-1784wh6 .crisp-1xmtdlg .crisp-rhv8pz .crisp-85evuk, +body .crisp-client .crisp-1rjpbb7 .crisp-1rf4xdh .crisp-ewasyx .crisp-1784wh6 .crisp-1xmtdlg .crisp-rhv8pz .crisp-nu40j6 { + font-size: 17px !important; + line-height: 28px !important; + padding-top: 10px !important; +} + +body .crisp-client .crisp-1rjpbb7 .crisp-1rf4xdh .crisp-kquevr .crisp-x94m06 { + background-color: #008aff !important; + background-image: linear-gradient(125deg, + #008aff -10%, + #008af0 100%) !important; + box-shadow: 0 5px 34px -6px #008aff !important; +} + +body .crisp-client .crisp-1rjpbb7 .crisp-4oo1n4 { + background-color: transparent !important; +} + +body .crisp-client .crisp-1rjpbb7 .crisp-1rf4xdh .crisp-ewasyx[data-chat-status="ongoing"] .crisp-1784wh6 .crisp-1xmtdlg .crisp-172kolj { + margin-top: -10px !important; +} + +body .crisp-client .crisp-1rjpbb7[data-last-operator-face="false"] .crisp-1rf4xdh .crisp-kquevr .crisp-x94m06 .crisp-16qgsyi .crisp-101bp3x[data-is-ongoing="false"] { + background-image: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1OCIgaGVpZ2h0PSI1NSIgdmlld0JveD0iMCAwIDU4IDU1Ij4NCiAgPGcgaWQ9ImNoYXQtc3ZncmVwby1jb21fMV8iIGRhdGEtbmFtZT0iY2hhdC1zdmdyZXBvLWNvbSAoMSkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTEuNSkiPg0KICAgIDxwYXRoIGlkPSJQYXRoXzEiIGRhdGEtbmFtZT0iUGF0aCAxIiBkPSJNMjksMS41YzE2LjAxNiwwLDI5LDExLjY0MSwyOSwyNmEyNC4wMSwyNC4wMSwwLDAsMS00LjgsMTQuMzE4Yy40LDQuNzQ1LDEuNTQyLDExLjQyOCw0LjgsMTQuNjgyLDAsMC05Ljk0My0xLjQtMTYuNjc3LTUuNDYybC0uMDIyLjAwOWMtMi43NjQtMS44LTUuNTMyLTMuNjU2LTYuMS00LjEyNmExLDEsMCwwLDAtMS4zMy0uMjc3LDEuMDE3LDEuMDE3LDAsMCwwLS40ODkuODQ4Yy0uMDEuNjIyLjAwNS43ODQsNS41ODUsNC40MjFBMzEuOTE0LDMxLjkxNCwwLDAsMSwyOSw1My41Yy0xNi4wMTYsMC0yOS0xMS42NDEtMjktMjZTMTIuOTg0LDEuNSwyOSwxLjVaIiBmaWxsPSIjZmZmIi8+DQogICAgPGNpcmNsZSBpZD0iRWxsaXBzZV8xIiBkYXRhLW5hbWU9IkVsbGlwc2UgMSIgY3g9IjMiIGN5PSIzIiByPSIzIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMiAyNC41KSIgZmlsbD0iIzAwOGFmZiIvPg0KICAgIDxjaXJjbGUgaWQ9IkVsbGlwc2VfMiIgZGF0YS1uYW1lPSJFbGxpcHNlIDIiIGN4PSIzIiBjeT0iMyIgcj0iMyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjYgMjQuNSkiIGZpbGw9IiMwMDhhZmYiLz4NCiAgICA8Y2lyY2xlIGlkPSJFbGxpcHNlXzMiIGRhdGEtbmFtZT0iRWxsaXBzZSAzIiBjeD0iMyIgY3k9IjMiIHI9IjMiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDQwIDI0LjUpIiBmaWxsPSIjMDA4YWZmIi8+DQogIDwvZz4NCjwvc3ZnPg0K) !important; + height: 31px !important; + top: 16px !important; + left: 14px !important; +} + +body .csh-category-item a h6 { + text-align: left; +} + +.mec-form-row.mec-syn-schedule { + background: #fff; + padding: 20px; + border: 1px solid #eee; + margin-bottom: 10px; + border-radius: 3px; +} + +.mec-form-row.mec-syn-schedule p { + padding-left: 26px; +} + +.mec-form-row.mec-syn-schedule h2 { + margin-top: 0; +} + +.mec-form-row.mec-syn-schedule h4 { + margin: 10px 0; +} + +li.wns-be-group-menu-li.mec-settings-menu a svg { + position: absolute; + margin-top: 2px; +} + +li.wns-be-group-menu-li.mec-settings-menu a svg { + fill: #a0abb5; + stroke: #a0abb5; +} + +li.wns-be-group-menu-li.mec-settings-menu:hover a svg { + fill: #07bbe9; + stroke: #07bbe9; +} + +li.wns-be-group-menu-li.mec-settings-menu.active a svg { + fill: #07bbe9; + stroke: #07bbe9; +} + +li.wns-be-group-menu-li.mec-settings-menu .mec-settings-submenu { + position: absolute; + top: -1px; + right: -222px; + width: 220px; + z-index: 9; + background: #fff; + border: 1px; + border-style: solid; + border-color: #e6e9eb; + margin: 0; + overflow: visible; + opacity: 0; + visibility: hidden; + transition: all 0.23s ease; + padding-top: 8px; + padding-bottom: 12px; + border-radius: 0 2px 2px 0; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03); +} + +li.wns-be-group-menu-li.mec-settings-menu:hover>.mec-settings-submenu { + visibility: visible; + opacity: 1; +} + +.mec-settings-menu .mec-settings-submenu:before { + position: absolute; + z-index: 999; + content: " "; + height: 0; + width: 0; + border: 7px solid transparent; + border-right-color: #fff; + left: -15px; + top: 14px; + border-right-color: #d6d9db; + right: 0; +} + +.mec-settings-menu .mec-settings-submenu:after { + position: absolute; + z-index: 999; + content: " "; + height: 0; + width: 0; + border: 7px solid transparent; + border-right-color: #fff; + left: -14px; + top: 14px; +} + +.wns-be-sidebar .mec-settings-menu .mec-settings-submenu a { + background: #fff; + color: #666c75; + opacity: 1; + font-size: 13px; + font-weight: 400; + padding: 6px 4px 5px 26px; +} + +.wns-be-sidebar .mec-settings-menu .mec-settings-submenu a:hover { + color: #000; + background: #f7f8f9; +} + +.mec-form-row.mec-skin-countdown-date-format-container input[type="text"], +.mec-form-row.mec-skin-grid-date-format-container input[type="text"], +.mec-form-row.mec-skin-list-date-format-container input[type="text"], +.mec-skin-options-container input[type="text"] { + max-width: unset; +} + +.wn-mec-select { + width: 32.33333333% !important; + clear: unset !important; +} + +.wn-mec-select { + -webkit-tap-highlight-color: transparent; + background-color: #fff; + border-radius: 3px; + border: 1px solid #ddd; + margin-bottom: 8px; + position: relative; + text-align: left !important; + -webkit-transition: all 0.2s ease-in-out; + transition: all 0.2s ease-in-out; + box-shadow: 0 3px 13px -5px rgba(0, 0, 0, 0.1), + inset 0 1px 2px rgba(0, 0, 0, 0.07); +} + +.wn-mec-select:hover { + border-color: #dbdbdb; +} + +.wn-mec-select.open .list { + overflow: unset; + width: 100%; + margin: 0; +} + +.wn-mec-select .list { + background-color: #fff; + border-radius: 2px; + box-shadow: 0 2px 33px -2px rgba(0, 0, 0, 0.2), + inset 0 1px 2px rgba(0, 0, 0, 0.07); + box-sizing: border-box; + margin-top: 4px; + opacity: 0; + overflow: hidden; + padding: 0; + pointer-events: none; + position: absolute; + top: 100%; + left: 0; + -webkit-transform-origin: 50% 0; + -ms-transform-origin: 50% 0; + transform-origin: 50% 0; + -webkit-transform: scale(0.75) translateY(-21px); + -ms-transform: scale(0.75) translateY(-21px); + transform: scale(0.75) translateY(-21px); + -webkit-transition: all 0.2s cubic-bezier(0.5, 0, 0, 1.25), + opacity 0.15s ease-out; + transition: all 0.2s cubic-bezier(0.5, 0, 0, 1.25), opacity 0.15s ease-out; + z-index: 9; +} + +.wn-mec-select { + -webkit-tap-highlight-color: transparent; + background-color: #fff; + border-radius: 5px; + border: solid 1px #e8e8e8; + box-sizing: border-box; + clear: both; + cursor: pointer; + display: block; + float: left; + font-family: inherit; + font-size: 14px; + font-weight: 400; + height: 42px; + line-height: 40px; + outline: 0; + padding-left: 18px; + padding-right: 30px; + position: relative; + text-align: left !important; + -webkit-transition: all 0.2s ease-in-out; + transition: all 0.2s ease-in-out; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + white-space: nowrap; + width: auto; +} + +.wn-mec-select:hover { + border-color: #dbdbdb; +} + +.wn-mec-select:after { + border-bottom: 2px solid #999; + border-right: 2px solid #999; + content: ""; + display: block; + height: 5px; + margin-top: -4px; + pointer-events: none; + position: absolute; + right: 12px; + top: 50%; + -webkit-transform-origin: 66% 66%; + -ms-transform-origin: 66% 66%; + transform-origin: 66% 66%; + -webkit-transform: rotate(45deg); + -ms-transform: rotate(45deg); + transform: rotate(45deg); + -webkit-transition: all 0.15s ease-in-out; + transition: all 0.15s ease-in-out; + width: 5px; +} + +.wn-mec-select.open:after { + -webkit-transform: rotate(-135deg); + -ms-transform: rotate(-135deg); + transform: rotate(-135deg); +} + +.wn-mec-select.open .list { + opacity: 1; + pointer-events: auto; + -webkit-transform: scale(1) translateY(0); + -ms-transform: scale(1) translateY(0); + transform: scale(1) translateY(0); +} + +.wn-mec-select.disabled { + border-color: #ededed; + color: #999; + pointer-events: none; +} + +.wn-mec-select.disabled:after { + border-color: #ccc; +} + +.wn-mec-select.wide { + width: 100%; +} + +.wn-mec-select.wide .list { + left: 0 !important; + right: 0 !important; +} + +.wn-mec-select.right { + float: right; +} + +.wn-mec-select.right .list { + left: auto; + right: 0; +} + +.wn-mec-select.small { + font-size: 12px; + height: 36px; + line-height: 34px; +} + +.wn-mec-select.small:after { + height: 4px; + width: 4px; +} + +.wn-mec-select .list { + background-color: #fff; + border-radius: 5px; + box-shadow: 0 0 0 1px rgba(68, 68, 68, 0.11); + box-sizing: border-box; + margin-top: 4px; + opacity: 0; + overflow: hidden; + padding: 0; + pointer-events: none; + position: absolute; + top: 100%; + left: 0; + -webkit-transform-origin: 50% 0; + -ms-transform-origin: 50% 0; + transform-origin: 50% 0; + -webkit-transform: scale(0.75) translateY(-21px); + -ms-transform: scale(0.75) translateY(-21px); + transform: scale(0.75) translateY(-21px); + -webkit-transition: all 0.2s cubic-bezier(0.5, 0, 0, 1.25), + opacity 0.15s ease-out; + transition: all 0.2s cubic-bezier(0.5, 0, 0, 1.25), opacity 0.15s ease-out; + z-index: 9; +} + +.wn-mec-select .list:hover .option:not(:hover) { + background-color: transparent !important; +} + +.wn-mec-select .option { + cursor: pointer; + font-weight: 400; + list-style: none; + min-height: 40px; + outline: 0; + text-align: left; + position: relative; + font-size: 12px !important; + padding: 1px 12px !important; + margin: 0 !important; + line-height: 28px !important; + min-height: 28px !important; + -webkit-transition: all 0.2s ease-in-out; + transition: all 0.2s ease-in-out; +} + +.wn-mec-select .option .wn-hover-img-sh img { + position: absolute; + padding: 3px; + top: -1px; + left: 100%; + box-shadow: 0 4px 42px -5px rgba(0, 0, 0, 0.16); + visibility: hidden; + opacity: 0; + border: 1px solid #e3e3e3; + border-radius: 2px; + z-index: 99999999; + background: #fff; +} + +.wn-mec-select .option:hover .wn-hover-img-sh img { + visibility: visible; + opacity: 1; +} + +.wn-mec-select .option.focus, +.wn-mec-select .option.selected.focus, +.wn-mec-select .option:hover { + background-color: #f6f6f6; +} + +.wn-mec-select .option.selected { + font-weight: 700; +} + +.wn-mec-select .option.disabled { + background-color: transparent; + color: #999; + cursor: default; +} + +.no-csspointerevents .wn-mec-select .list { + display: none; +} + +.no-csspointerevents .wn-mec-select.open .list { + display: block; +} + +.mec-custom-nice-select ul.list li.option { + width: 30% !important; + float: left !important; + min-height: 135px !important; + height: 135px; + margin: 1.66% !important; + box-sizing: border-box; + text-align: center; + padding: 10px !important; + border-radius: 8px; + border: 1px solid transparent; + box-shadow: none; + background: #fff0 !important; +} + +.mec-custom-nice-select ul.list li.option:hover { + box-shadow: 0 1px 8px rgba(0, 0, 0, 0.025), 0 0 0 1px #f3f4f5; +} + +.mec-custom-nice-select .list .option:hover, +.mec-custom-nice-select ul.list li.option:hover { + background: #fff !important; +} + +.mec-custom-nice-select .list:hover .option:not(:hover), +.mec-custom-nice-select ul.list:hover li.option { + background: #fff !important; +} + +.mec-custom-nice-select ul.list { + min-width: 600px !important; + padding: 20px 10px !important; + background: #fcfbfd; + border: 1px solid #e9e9e9; + box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05); +} + +.mec-custom-nice-select ul.list li.option.selected { + border: 1px solid #40d9f16b; + box-shadow: 0 1px 8px -3px #40d9f152 inset; + color: #00cae6; + padding: 12px 0 0 0 !important; +} + +.mec-custom-nice-select .wn-img-sh img { + margin: 4px 0 1px 1px; + line-height: 1; + max-width: 68px; + max-height: 56px; + filter: grayscale(1); + -webkit-filter: grayscale(1); + transition: all 0.22s ease; + -webkit-transition: all 0.22s ease; + -moz-transition: all 0.22s ease; + -ms-transition: all 0.22s ease; + -o-transition: all 0.22s ease; +} + +.wn-mec-select .option.focus .wn-img-sh img, +.wn-mec-select .option.selected.focus .wn-img-sh img, +.wn-mec-select .option:hover .wn-img-sh img { + background-color: #f6f6f6; + filter: grayscale(0); + -webkit-filter: grayscale(0); +} + +@media (max-width: 768px) { + .wn-mec-select { + width: 45% !important; + } + + .mec-custom-nice-select ul.list { + margin-left: -24px !important; + min-width: 404px !important; + } + + .mec-custom-nice-select ul.list li.option { + width: 46.6% !important; + } + + .wn-hover-img-sh { + display: none; + } +} + +@media (max-width: 480px) { + .wn-mec-select { + width: 100% !important; + } + + .mec-custom-nice-select ul.list { + min-width: 337px !important; + } +} + +@media (max-width: 320px) { + .mec-custom-nice-select ul.list li.option { + width: 100% !important; + } + + .mec-custom-nice-select ul.list { + min-width: 298px !important; + } +} + +.mec-sed-methods li { + line-height: 28px; + padding-left: 38px; + position: relative; +} + +.mec-sed-methods li:before { + margin-right: 0; +} + +.mec-sed-methods li:before { + border-radius: 18px; +} + +.mec-custom-nice-select ul.list li .wn-mec-text:after, +.mec-sed-methods li:before { + content: ""; + position: absolute; + display: inline-block; + background: #fff; + border-radius: 2px; + width: 12px; + height: 12px; + margin: -1px 0 0 -1px; + cursor: pointer; + border: 2px solid #e1e7ed; + border-radius: 50%; +} + +.mec-custom-nice-select ul.list li .wn-mec-text { + position: relative; + padding-top: 0; + padding-bottom: 28px; +} + +.mec-custom-nice-select ul.list li .wn-mec-text:after { + left: calc(50% - 7px); + top: auto; + bottom: 1px; +} + +.mec-custom-nice-select ul.list li .wn-img-sh { + line-height: 1; +} + +.mec-sed-methods li:before { + left: 9px; + top: calc(50% - 7px); +} + +.mec-custom-nice-select ul.list li.option.selected .wn-mec-text:after, +.mec-sed-methods li.active:before { + width: 4px; + height: 4px; + border: 7px solid #07bbe9; + background: #fff; + box-shadow: 0 3px 16px -3px #07bbe9; +} + +#menu-posts-mec-books .wp-menu-image img, +#toplevel_page_mec-intro .wp-menu-image img { + width: 18px !important; + padding-top: 7px !important; +} + +.mec-add-booking-tabs-wrap, +.mec-add-event-tabs-wrap, +.mec-create-shortcode-tabs-wrap { + display: flex; + display: -webkit-box; + display: -webkit-flex; + display: -ms-flexbox; +} + +.mec-add-booking-tabs-left, +.mec-add-event-tabs-left { + min-width: 200px; +} + +@media (max-width: 1366px) { + + .mec-add-booking-tabs-left, + .mec-add-event-tabs-left { + min-width: 137px; + } +} + +.mec-add-booking-tabs-left, +.mec-add-event-tabs-left, +.mec-create-shortcode-tabs-left { + flex: 1; +} + +.mec-add-booking-tabs-right, +.mec-add-event-tabs-right, +.mec-create-shortcode-tabs-right { + flex: 6; +} + +a.mec-add-booking-tabs-link, +a.mec-add-event-tabs-link, +a.mec-create-shortcode-tabs-link { + display: block; +} + +.mec-booking-tab-content, +.mec-create-shortcode-tab-content, +.mec-event-tab-content { + display: none; + transition: all 0.3s ease; +} + +.mec-booking-tab-content.mec-tab-active, +.mec-create-shortcode-tab-content.mec-tab-active, +.mec-event-tab-content.mec-tab-active { + display: block; +} + +.mec-add-booking-tabs-wrap, +.mec-add-event-tabs-wrap { + background: #fff; + margin: -6px -12px -12px; +} + +.mec-create-shortcode-tabs-wrap { + margin: -30px -22px -42px; +} + +.mec-add-booking-tabs-left, +.mec-add-event-tabs-left, +.mec-create-shortcode-tabs-left { + background: #f7f8f9; +} + +.mec-add-booking-tabs-left a, +.mec-add-event-tabs-left a, +.mec-create-shortcode-tabs-left a { + display: block; + position: relative; + outline: 0; + padding: 13px 4px 13px 15px; + background: #e3e5e7; + background: 0 0; + border: solid; + border-width: 1px 0 1px 0; + border-color: transparent; + color: #3f454a; + font-size: 13px; + font-weight: 600; + text-decoration: none; + border-radius: 0; + transition: all 0.2s ease; +} + +.mec-add-booking-tabs-left a:first-of-type, +.mec-add-event-tabs-left a:first-of-type, +.mec-create-shortcode-tabs-left a:first-of-type { + border-top: none; +} + +.mec-add-booking-tabs-left a:hover, +.mec-add-event-tabs-left a:hover, +.mec-create-shortcode-tabs-left a:hover { + background: #fff; + color: #07bbe9; +} + +.mec-add-booking-tabs-left a:focus, +.mec-add-event-tabs-left a:focus, +.mec-create-shortcode-tabs-left a:focus { + box-shadow: none; + outline: unset; +} + +.mec-add-booking-tabs-left a.mec-tab-active, +.mec-add-event-tabs-left a.mec-tab-active, +.mec-create-shortcode-tabs-left a.mec-tab-active { + background: #ecf9fd; + color: #07bbe9; + border-color: #ccecf4; + position: relative; + padding-left: 17px; +} + +.inside div div>a.mec-tab-active:after, +.inside div div>a.mec-tab-active:before { + position: absolute; + z-index: 9 !important; + content: " "; + height: 0; + width: 0; + border: 8px solid transparent; + border-right-color: #fff; + right: -1px; + top: 13px; +} + +.inside div div>a.mec-tab-active:before { + border-right-color: #d7d8d9; + right: 0; +} + +.mec-add-booking-tabs-right, +.mec-add-event-tabs-right, +.mec-create-shortcode-tabs-right { + padding: 0 30px 40px; + border-left: 1px solid #e2e2e2; +} + +.mec-booking-tab-content.mec-tab-active, +.mec-create-shortcode-tab-content.mec-tab-active, +.mec-event-tab-content.mec-tab-active { + animation: fadeEffect2 0.31s; +} + +@media (max-width: 1366px) { + + .mec-add-booking-tabs-right, + .mec-add-event-tabs-right, + .mec-create-shortcode-tabs-right { + padding: 0 15px 20px; + } + + .mec-form-row select { + min-width: 60px; + } +} + +@media (min-width: 1199px) and (max-width: 1280px) { + + .mec-add-booking-tabs-right, + .mec-add-event-tabs-right, + .mec-create-shortcode-tabs-right { + padding: 0 0 0 10px; + } + + #mec_meta_box_hourly_schedule_days { + padding: 0 40px 0 0; + } + + #mec_meta_box_hourly_schedule_days .mec-form-row.mec-box { + margin-right: -40px; + } + + #mec_comment, + #mec_cost, + #mec_countdown_method, + #mec_event_timezone, + #mec_public, + #mec_repeat_type { + min-width: 220px; + width: 220px; + } + + #mec_meta_box_hourly_schedule_days .mec-box.mec-form-row input[type="text"] { + max-width: 120px; + } + + .mec-form-row .mec-time-picker select { + min-width: 60px; + } + + #mec_countdown_method, + #mec_repeat_type { + min-width: 220px; + width: 220px; + } + + #mec_exceptions_in_days_container .mec-col-4 { + width: 25%; + } + + #mec_exceptions_in_days_container .mec-col-3 { + width: 50%; + } + + #mec_exceptions_in_days_container .mec-col-5 { + width: 20%; + } + + #mec_exceptions_in_days_container input[type="text"] { + width: 95%; + } + + #mec_repeat_certain_weekdays_container label:not(.mec-col-3) { + display: block; + padding-left: 25%; + } +} + +@media (max-width: 1023px) { + + .post-type-mec-events h4, + .post-type-mec_calendars .mec-meta-box-fields h3 { + margin-top: 20px; + } + + .post-type-mec-events .mec-form-row { + padding-bottom: 20px; + } + + .post-type-mec-events .mec-form-row .mec-form-row { + padding: 0; + } + + .post-type-mec-events .mec-form-row .mec-col-1, + .post-type-mec-events .mec-form-row .mec-col-10, + .post-type-mec-events .mec-form-row .mec-col-11, + .post-type-mec-events .mec-form-row .mec-col-12, + .post-type-mec-events .mec-form-row .mec-col-2, + .post-type-mec-events .mec-form-row .mec-col-3, + .post-type-mec-events .mec-form-row .mec-col-4, + .post-type-mec-events .mec-form-row .mec-col-5, + .post-type-mec-events .mec-form-row .mec-col-6, + .post-type-mec-events .mec-form-row .mec-col-7, + .post-type-mec-events .mec-form-row .mec-col-8, + .post-type-mec-events .mec-form-row .mec-col-9 { + display: block; + width: 100%; + margin: 20px 0 0 0; + max-width: 285px; + } + + .post-type-mec-events .mec-add-booking-tabs-left, + .post-type-mec-events .mec-add-event-tabs-left { + min-width: 180px; + } + + .post-type-mec-events .mec-add-booking-tabs-left a, + .post-type-mec-events .mec-add-event-tabs-left a, + .post-type-mec-events .mec-create-shortcode-tabs-left a { + padding-left: 10px; + } + + #mec_repeat_type, + .post-type-mec-events #mec_settings_fes_thankyou_page_url, + .post-type-mec-events .mec-form-row .mec-col-4 input[type="number"], + .post-type-mec-events .mec-form-row .mec-col-4 input[type="text"], + .post-type-mec-events .mec-form-row .mec-col-4 select, + .post-type-mec-events .mec-form-row .mec-col-4 textarea { + width: 100%; + max-width: 255px; + } + + #mec-exceptional-days .mec-certain-day>div, + #mec_exceptions_in_days_container .mec-certain-day>div { + width: 100%; + max-width: 255px; + padding: 12px; + margin: 20px 10px 0 0; + border-radius: 8px; + } + + .mec-certain-day .mec-in-days-day, + .mec-certain-day>div .mec-not-in-days-day { + line-height: 21px; + font-size: 10px; + } + + #mec_repeat_certain_weekdays_container label { + display: block; + margin: 20px 0 20px 0; + } +} + +@media (max-width: 640px) { + + .mec-add-booking-tabs-wrap, + .mec-add-event-tabs-wrap, + .mec-create-shortcode-tabs-wrap { + display: block; + } + + .post-type-mec-events .mec-add-booking-tabs-left, + .post-type-mec-events .mec-add-event-tabs-left { + min-width: 100%; + width: 100% !important; + display: block !important; + float: unset; + margin: 0; + flex: unset; + height: auto; + } + + .post-type-mec-events .mec-add-booking-tabs-right, + .post-type-mec-events .mec-add-event-tabs-right, + .post-type-mec-events .mec-create-shortcode-tabs-right { + display: block; + min-width: 100%; + width: 100%; + margin: 0; + flex: unset; + } + + .post-type-mec-events .mec-add-booking-tabs-left a, + .post-type-mec-events .mec-add-event-tabs-left a, + .post-type-mec-events .mec-create-shortcode-tabs-left a { + font-size: 14px; + padding: 14px 10px 14px 15px; + line-height: 1.2; + letter-spacing: 0; + } + + .mec-add-booking-tabs-right, + .mec-add-event-tabs-right, + .mec-create-shortcode-tabs-right { + padding-left: 10px; + padding-right: 10px; + } + + #mec_tickets .mec-box { + max-width: 290px; + } +} + +@keyframes fadeEffect2 { + from { + opacity: 0; + transform: translateX(11px); + } + + to { + opacity: 1; + transform: translateX(0); + } +} + +.mec-form-row .mec-col-8 label, +.mec-form-row .mec-col-9 label { + padding-right: 20px; +} + +@media (min-width: 860px) and (max-width: 1280px) { + .mec-form-row .mec-col-9 label { + padding-right: 12px; + } +} + +#mec-event-data .mec-form-row label { + margin-right: 14px; +} + +.mec-form-row input[type="date"]::-webkit-calendar-picker-indicator { + background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjA0QjQ2N0QwQjQ4MzExRUE4RDdFREZDRTUxMUVERTM5IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjA0QjQ2N0QxQjQ4MzExRUE4RDdFREZDRTUxMUVERTM5Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6MDRCNDY3Q0VCNDgzMTFFQThEN0VERkNFNTExRURFMzkiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6MDRCNDY3Q0ZCNDgzMTFFQThEN0VERkNFNTExRURFMzkiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz6WW71PAAAGIklEQVR42qRXS28bVRQ+586Mx3ZC1DSpVFojRU2CqMIGiSKxAVoUduzoDjYIlhU/Av4AYsdjRXfkD0Cjom6QqIqEqEhRo1aRkkZpkpY6j7GduQ++c2dsj1+BlInGztxvzj3nfudpPlM/otc2W2QjJmU0rZ0uUytUpBxNnN9p/FYhctF0+XUi2nPGkX7WJOfwxNRzqXxtbfI4eUvm7xY1o4iiI0d/vFiisL2BgTAz0yvbCRnLhP0uNEtqrgUseZRcwPPvJewaldSA8o48vo+Tj0U+CnrkOgZwvkEzEmGm1PF9fzK5Y3U/YlllsjRUv19zXl7571HyAjooc/kmYerpcmPO0Mfa0SyxEtji44ynOjPuayjecd7M46/MQOdGyIs9ThnzMLD0XRrwIdeetmoLm41fWiG95Ar792tydLLrOPkAlpW027hbG3+T37lf/5EtvYcXUuhfBjWp9wHRBO63c5lbEkQj2B92uaHy4l2EAQ66GFgbmiD4id/9q661ooAtf8rsvmUEilAHEqcgtJvvNq3YPTkJA8PksT9ZFxD8+4my9pvAOqOMxIMoJHfPZoJkJNiYat3duOac6hxt1N3GR8lnt0O623s+c2CVZEGaZ8Oks1mElvxu7hGYaQjpHLpH3q/YFQE7Oh5Y6gFTaHhAXlasxmoWpZO5L9Ow4DTv+UBZBAkWNO+CqhkbSOzaXWWyzY+n3WcACdVscnklz5CHYsmv1L/RyUJ/cs7zdT3Ey8pTgw/QgNNuS4XjNMvffwvBNmwDH+pdeZ3J+1qDdW15vS0iBhjZWzF9ge8HWl7zNLluYhP/9/jvFANXyL+ufF4jZvOCZsK8isp77+sixf10n7QQjJT39bBtjzdA5chtLG61n7kgk6UvDy29z4HL4c/ifkN0hYV+cA3Bc7stKAfossgSSF06+3HOu8QovE8eThDlv4pu1TbUOpqySDNUKMSDQRIo6QgVRHbFcID1mCITUGgNKLI9uBbcCC59xUi+DsiHBq0XOLb3utqOUYV+LglH9XJASRAsRNqt4xHVj59Exqw3AlrYi0PaiwNqBKoX12Y9iQSP/GkD4xZC0yt/GPFCvZzhUBoMtmPftRwMEEtpupy2auzadLraXtlNoXLhKQYLbjrWRx0cXNf24wxPSmWw5aZPNXSNOi5ytXqZpjTwSqs3PsJi0I61LG29EFG9GtyaeqgvxU17TrAkDjbvnq/eKcTYrbcemi5eHoI/OLgUt7r4n+cqd04llmZ3mjBSDQ4kYtERLLz4OKGt0xGKA9+RgiSGSRV7+UlCVvka72lEvHRx04vLGW2f/PzTBk3VtddRrGlhMXVaIdME5sLJ3ZQOTPQBNqj58uzcxsXtZEkqmQ7IB9ihLeA2x6FQqyG4cRuvbh8uNZSigzBCALhBBtrjkwjjQItQ+kPXWY6eBuEi/lmOlC8kvTh38ZLH3QC+y+GiIl4OqbeZ9RggQZgcVIXe1ep48jPkz/oGw7x1yoytIq1o59AH1Wp1rNHBSXA9tip87zYyvFzpx8dXLVTvqySvhUMNsN6+1ERrrNQVQs57H4K6cR35GrapffICb16RpO7glOHrrQyvjHXxQHB0/j1ugV0LpcFwAzS4n6hiZoIvEp2znwcSigfGJhxpMmseLc0dvFjcvRuLvdEdNyl2+0DOALwE863TM/jnJqhfQa6v4AfJzUNOZ/aVlhqIUpoO4PuU4XFsqFrSM866m9hxBXSvWPx/wHpGqA96Vfa5AH9HnMjYNI96dbkwaVzcCw/nAK+xHzp4Hp89eD04nENzX6v4cYrnrVWXXQF/Fh7MQfWasmogCNsmaT+qwD0g4gYsuYqnWlboeKMUumUr86LycxdwdRUb+zQTvAzcgL0jLXFkbkQUX5UKyFTE2bvZD0a5B8SAUu6dPf+7AInssja2VPSZRud2Ni/NKse5M2VQqkO4BxSzZLmV8Wwpa8S9OHsK3X6+Lc7F/JidOwvkc7z3FbIgzd7smy1c35TEg7NGrg6Ucs88UsCliOLHH1+Td8HYFl++W//QxfT9iSee/3lJWy5X6aMwtK3rTVWJUU4/g4GzdLLp73ku8cEDxNmXUZhc/0eAAQAVgX0RHvvILQAAAABJRU5ErkJggg==); + background-position: center; + background-size: cover; + width: 10px; + height: 12px; + display: block; +} + +.mec-attendees-wrapper select, +.mec-calendar-metabox .wn-mec-select, +.mec-form-row input[type="date"], +.mec-form-row input[type="email"], +.mec-form-row input[type="number"], +.mec-form-row input[type="password"], +.mec-form-row input[type="tel"], +.mec-form-row input[type="text"], +.mec-form-row input[type="url"], +.mec-form-row select, +.mec-form-row textarea, +.mec-form-row.mec-skin-list-date-format-container input[type="text"], +.mec-occurrences-wrapper input[type="date"], +.mec-occurrences-wrapper input[type="email"], +.mec-occurrences-wrapper input[type="number"], +.mec-occurrences-wrapper input[type="tel"], +.mec-occurrences-wrapper input[type="text"], +.mec-occurrences-wrapper input[type="url"], +.mec-occurrences-wrapper select, +.mec-occurrences-wrapper textarea { + border: none; + background-color: #f7f8f9; + border-radius: 5px; + height: 38px; + line-height: 38px; + padding-left: 10px; + vertical-align: top; + box-shadow: inset 0 1px 2px rgb(0 0 0 / 7%); +} + +.mec-calendar-metabox .wn-mec-select, +.mec-form-row select, +.post-type-mec-events .mec-form-row select, +.post-type-mec_calendars .mec-form-row select, +.wns-be-main .mec-form-row select { + appearance: none; + -webkit-appearance: none; + -moz-appearance: none; + cursor: pointer; + min-height: 34px; + line-height: 34px; + background-color: #f7f8f9; + border-radius: 5px; + padding-right: 24px; + box-shadow: 0 1px 3px rgb(0 0 0 / 2%); + transition: all 0.23s ease; + background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0ZWQgYnkgSWNvTW9vbi5pbyAtLT4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHdpZHRoPSIxNyIgaGVpZ2h0PSIxNyIgdmlld0JveD0iMCAwIDE3IDE3Ij4KPGc+CjwvZz4KCTxwYXRoIGQ9Ik0xNi4zNTQgNS4wNzVsLTcuODU1IDcuODU0LTcuODUzLTcuODU0IDAuNzA3LTAuNzA3IDcuMTQ1IDcuMTQ2IDcuMTQ4LTcuMTQ3IDAuNzA4IDAuNzA4eiIgZmlsbD0iIzAwMDAwMCIgLz4KPC9zdmc+Cg==); + background-repeat: no-repeat; + background-size: 26px 10px; + background-position: right center; + min-width: 160px; + border: 1px solid #e6e9eb; +} + +.post-type-mec-events .mec-form-row .mec-time-picker select, +.post-type-mec-events .wn-ticket-time select { + min-width: 60px; +} + +.wns-be-main .mec-col-4 select { + min-width: unset; +} + +.mec-form-row .nice-select { + background-image: unset; +} + +.mec-calendar-metabox .wn-mec-select.open .list { + border-radius: 0 0 2px 2px; + box-shadow: 0 0 0 1px #ddd, 0 2px 6px rgba(0, 0, 0, 0.07); +} + +.mec-calendar-metabox .mec-custom-nice-select.open ul.list { + border-radius: 5px; + box-shadow: 0 2px 6px rgb(0 0 0 / 3%); + margin-left: 0 !important; + transform: translateX(-50%); + left: 50%; +} + +.mec-custom-nice-select ul.list li.option.selected .wn-mec-text:after { + border: 6px solid #40d9f1; + box-shadow: 0 3px 16px -3px #40d9f1; +} + +.mec-form-row label+span.mec-tooltip { + bottom: 0; +} + +.mec-form-row textarea+span.mec-tooltip { + bottom: auto; + vertical-align: top; + top: 12px; +} + +.mec-form-row span+span.mec-tooltip { + bottom: 0; + vertical-align: middle; +} + +.mec-form-row .tooltip-move-up span+span.mec-tooltip i { + margin-top: -40px; +} + +.mec-form-row .mec-col-8 input[type="text"], +.mec-form-row .mec-col-8 select, +.mec-form-row .mec-col-8 span.mec-archive-skins { + vertical-align: top; +} + +.mec-form-row .mec-col-8 span.mec-archive-skins input[type="text"] { + max-width: 225px; +} + +.mec-form-row input:disabled { + opacity: 0.6; + background: #f6f6f6; +} + +.wns-be-group-tab h5 { + font-size: 16px; + font-weight: 600; + color: #444; + margin: 0 0 40px 0; +} + +.mec-form-row textarea { + height: auto; + margin-bottom: 0; + min-height: 60px; +} + +.mec-form-row .wp-picker-container input[type="text"].wp-color-picker { + height: 25px; + vertical-align: top; + width: 4rem; + margin: -1px 0 0 0 !important; +} + +.mec-form-row .wp-picker-container label { + margin: 0; +} + +.mec-image-select-wrap li span:hover { + border-color: #fff; + box-shadow: 0 1px 8px rgba(0, 0, 0, 0.12); +} + +.mec-message-categories li.mec-acc-label:after { + content: "\e604"; + font-family: simple-line-icons; + speak: none; + font-style: normal; + font-weight: 400; + display: block; + font-size: 13px; + color: #999; + position: absolute; + right: 27px; + top: 26px; +} + +.mec-message-categories>li.mec-acc-label[data-status="open"]:after { + content: "\e607"; + color: #07bbe9; +} + +.mec-message-categories>li.mec-acc-label[data-status="open"] { + color: #07bbe9; +} + +.mec-message-categories>li.mec-acc-label:last-of-type { + border-bottom: none; +} + +.mec-message-categories>li.mec-acc-label[data-status="open"] { + border-bottom: 1px solid #e6e6e6; +} + +.mec-form-row ul.mec-message-categories { + border-radius: 5px; + overflow: hidden; + margin-top: 30px; + background: #f5f5f5; + border: 2px solid #e6e6e6; + max-width: 700px; +} + +.mec-form-row ul.mec-message-categories li ul { + padding: 10px 40px 40px; + margin: 0 -30px 0; + background: #fff; + box-shadow: inset 0 6px 7px -2px rgb(0 0 0 / 4%); + border-top: 1px solid #eee; + cursor: default; +} + +.mec-form-row ul.mec-message-categories ul label { + margin: 0; + font-size: 14px; + color: #888; + cursor: default; +} + +#mec_calendar_display_options .mec-tooltip { + bottom: 1px; +} + +#mec_add_fee_button, +#mec_add_ticket_variation_button, +#mec_meta_box_downloadable_file_options #mec_downloadable_file_remove_image_button, +#taxes_option #mec_fees_list .mec-form-row .button, +#ticket_variations_option #mec_ticket_variations_list .mec-form-row .button, +.mec-export-settings, +.mec-import-settings, +.mec-meta-box-fields .mec-form-row .button:not(.wp-color-result), +.mec-form-row .button:not(.wp-color-result), +.mec-occurrences-wrapper .button:not(.wp-color-result), +#database_setup_button { + border-radius: 25px; + border: 1px solid #d1e5ec; + text-shadow: none; + padding: 0 12px; + height: 38px; + letter-spacing: 0.2px; + margin-right: 5px; + background: #fff; + color: #07bbe9; + box-shadow: 0 1px 5px -1px rgb(0 0 0 / 5%); + transition: all 0.2s ease; + cursor: pointer; + display: inline-block; + line-height: 36px; + text-decoration: none; +} + +#mec_add_fee_button:hover, +#mec_add_ticket_variation_button:hover, +#mec_meta_box_downloadable_file_options #mec_downloadable_file_remove_image_button:hover, +.mec-meta-box-fields .mec-form-row .button:not(.wp-color-result):hover, +.mec-occurrences-wrapper .button:not(.wp-color-result):hover, +.button:not(.wp-color-result):hover .mec-export-settings:hover, +.mec-import-settings:hover { + background: #f0f9fc; + color: #07bbe9; +} + +#taxes_option #mec_fees_list .mec-form-row .button, +#ticket_variations_option #mec_ticket_variations_list .mec-form-row .button { + margin: 0; +} + +#mec-hourly-schedule .mec-form-row .mec-col-1 .button, +#mec-hourly-schedule .mec-form-row.mec-box .button, +#mec_faq_list .mec-faq-actions .mec-faq-remove, +#taxes_option #mec_fees_list .mec-form-row .button, +#ticket_variations_option #mec_ticket_variations_list .mec-form-row .button, +.mec-dash-remove-btn { + color: #ea6485 !important; + border-color: #ea6485 !important; +} + +#mec-hourly-schedule .mec-form-row .mec-col-1 .button:hover, +#mec-hourly-schedule .mec-form-row.mec-box .button:hover, +#mec_faq_list .mec-faq-actions .mec-faq-remove:hover, +#taxes_option #mec_fees_list .mec-form-row .button:hover, +#ticket_variations_option #mec_ticket_variations_list .mec-form-row .button:hover, +.mec-dash-remove-btn:hover { + background: rgb(234 100 133 / 0.1) !important; +} + +#mec-hourly-schedule .mec-hourly-schedule-form-speakers { + margin-top: 20px; +} + +#mec_meta_box_downloadable_file_options #mec_downloadable_file_remove_image_button, +#mec_meta_box_downloadable_file_options #mec_public_download_module_file_remove_image_button { + margin-top: 12px; +} + +#mec_meta_box_downloadable_file_options input[type="file"] { + max-width: 166px; + text-align: center; + transition: all 0.2s ease; + border-radius: 5px !important; + border: 2px dashed #b8e9f3; + margin-bottom: 12px; + height: 44px; + text-decoration: none; + padding: 0 15px 1px; + text-transform: none; + letter-spacing: 0; + font-weight: 600; + color: #40d9f1; + box-shadow: 0 2px 6px -3px #cfeff5; + display: block; +} + +#mec_meta_box_downloadable_file_options input[type="file"]:hover { + box-shadow: 0 2px 16px -3px #cfeff5; +} + +#mec_meta_box_downloadable_file_options input[type="file"]::-webkit-file-upload-button { + visibility: hidden; + width: 1px; + height: 38px; +} + +#mec_meta_box_downloadable_file_options input[type="file"]::-moz-file-upload-button { + visibility: hidden; + width: 1px; + height: 38px; +} + +.mec-attendees-wrapper .mec-attendees-list { + margin: 22px 0 0; +} + +.mec-attendees-wrapper .mec-attendees-list .w-clearfix:first-child { + background: #fff; + border-bottom: 1px solid #cfeff5; +} + +.mec-attendees-wrapper .mec-attendees-list .w-clearfix:first-child div span { + line-height: 1; + font-weight: 600; +} + +.mec-attendees-wrapper .mec-attendees-list .w-clearfix { + display: flex; + background: #f8feff; + padding: 10px; + text-align: left; +} + +.mec-attendees-wrapper .mec-attendees-list .w-clearfix .w-col-xs-3:first-child { + width: 100%; + max-width: 30%; + padding: 0; +} + +.mec-attendees-wrapper .mec-attendees-list .w-clearfix .w-col-xs-3 a { + text-decoration: unset; +} + +.mec-attendees-wrapper .mec-attendees-list .w-clearfix:nth-child(odd) { + background: #fff; +} + +#mec-read-more .mec-form-row span.mec-tooltip { + top: 2px; + left: -4px; +} + +#mec-occurrences .mec-occurrences-list { + margin-top: 12px; +} + +#mec-occurrences .mec-occurrences-list h3 { + margin: 0 0 30px 0; +} + +#mec-occurrences .mec-occurrences-list .mec-form-row { + margin-bottom: 0; +} + +#mec-occurrences .mec-occurrences-list .mec-form-row label { + display: inline-block; + margin: 0; + width: 141px; +} + +#mec-occurrences .mec-occurrences-list .mec-form-row label.label-radio, +#mec-occurrences .mec-occurrences-list .mec-form-row label.label-checkbox { + display: block; + width: 100%; +} + +#mec-occurrences .mec-occurrences-list .mec-form-row .event-status-schema label { + width: auto; + min-width: 160px; +} + +#mec-occurrences .mec-occurrences-list .mec-form-row .event-status-schema p { + border: unset; + padding-left: 0; + margin-left: 0; +} + +#mec-search-settings { + border-radius: 21px; + min-height: 32px; + box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06); + margin-right: 10px; + color: #7c838a; + font-size: 13px; + width: 260px; + background: #f7f8f9; + border: none; + z-index: 1; + transition: all 0.18s ease; + outline: 0; + line-height: 36px; + padding: 2px 10px 1px 38px; +} + +#mec-search-settings:focus { + background: #fff; + box-shadow: 0 1px 6px rgba(0, 0, 0, 0.07), 0 0 0 1px #e6e6e6; + width: 270px; +} + +.mec-search-settings-wrap { + display: inline-block; + position: relative; +} + +.mec-search-settings-wrap i { + position: absolute; + left: 16px; + top: 13px; + font-size: 13px; + color: #7e8c98; + display: block; + z-index: 2; +} + +#mec-search-settings::-webkit-input-placeholder { + color: #7c838a; +} + +#mec-search-settings::-moz-placeholder { + color: #7c838a; +} + +#mec-search-settings:-ms-input-placeholder { + color: #7c838a; +} + +#mec-search-settings:-moz-placeholder { + color: #7c838a; +} + +#wns-be-content .noresults label, +#wns-be-content .results .results .noresults label { + color: #000; +} + +#wns-be-content .results .results .results label, +#wns-be-content .results label, +#wns-be-content ul li.enable, +#wns-be-content ul li.enable label { + color: #07bbe9; +} + +#wns-be-content ul li.disable, +#wns-be-content ul li.disable label { + color: #e7e7e7; +} + +.ui-datepicker.ui-widget { + border: 1px solid #e8e8e8; + box-shadow: 0 1px 9px rgba(0, 0, 0, 0.12); +} + +.ui-datepicker.ui-widget select { + font-weight: 600; + font-size: 12px; + border-radius: 2px; + padding: 2px 10px; + margin: 1px 3px 5px; +} + +.ui-datepicker.ui-widget table { + border-spacing: 2px; +} + +.ui-datepicker.ui-widget td, +.ui-datepicker.ui-widget tr { + padding: 0; + background: 0 0 !important; +} + +.ui-datepicker.ui-widget td a { + color: #777; + font-weight: 600; + width: 30px; + height: 30px; + line-height: 30px; + display: inline-block; + border-radius: 33px; + padding: 0; + background: #fff; + transition: all 0.2s ease; +} + +.ui-datepicker.ui-widget td a.ui-state-active, +.ui-datepicker.ui-widget td a:hover { + background: #40d9f1; + color: #fff; +} + +.ui-datepicker.ui-widget .ui-datepicker-next, +.ui-datepicker.ui-widget .ui-datepicker-prev { + color: #40d9f1; + width: 30px; + height: 30px; + line-height: 30px; + display: inline-block; + text-align: center; + border-radius: 33px; + background: #ecfcff; + transition: all 0.2s ease; +} + +.ui-datepicker.ui-widget .ui-datepicker-next:hover, +.ui-datepicker.ui-widget .ui-datepicker-prev:hover { + background: #fff; + box-shadow: 0 0 7px -3px rgba(0, 0, 0, 0.4); +} + +#mec-wrap { + width: 92%; + margin: 20px auto; + max-width: 1200px; +} + +#mec-wrap .nav-tab-wrapper { + margin-bottom: 0; + position: relative; + z-index: 8; + padding: 0; + border-radius: 10px; + border: none; + margin-top: 35px; + clear: both; + background: #fff; + border: 1px solid #e3e5e7; +} + +#mec-wrap .nav-tab-wrapper .nav-tab { + position: relative; + padding: 28px 17px; + border: none; + background: transparent; + margin: 0; + font-size: 13px; + color: #444; + outline: 0; + letter-spacing: -0.1px; + box-shadow: none; + transition: all 0.2s ease; +} + +#mec-wrap .nav-tab-wrapper .nav-tab:hover { + color: #07bbe9; +} + +#mec-wrap .nav-tab-wrapper .nav-tab:after { + content: ""; + display: inline-block; + width: 1px; + height: 30%; + position: absolute; + right: 0; + top: 35%; + background: #e9e9e9; +} + +#mec-wrap .nav-tab-wrapper .nav-tab-active, +#mec-wrap .nav-tab-wrapper .nav-tab-active:focus, +#mec-wrap .nav-tab-wrapper .nav-tab-active:focus:active, +#mec-wrap .nav-tab-wrapper .nav-tab-active:hover { + background: #ecf9fd; + outline: 0; + z-index: 2; + border: 1px solid #ccecf4; + color: #07bbe9; + border-radius: 5px; + margin: -1px; +} + +#mec-wrap .nav-tab-wrapper .nav-tab-active:after { + content: ""; + position: absolute; + display: block; + background: 0 0; + top: auto; + height: auto; + bottom: -20px; + left: 50%; + margin-left: -10px; + width: 0; + border-width: 10px; + border-style: solid; + border-color: #ecf9fd transparent transparent; +} + +#mec-wrap .mec-container { + padding: 25px 40px 40px; +} + +.m-e-calendar_page_MEC-ix #mec-wrap .mec-container, +#mec-wrap .mec-container.booking-report-container { + border: 1px solid #e3e5e7; + border-top: none; + border-radius: 0 0 10px 10px; + margin: -2px 6px 0 6px; +} + +#wpwrap .mec-button-primary { + box-shadow: 0 0 0 4px #e4ffe6; + text-shadow: none; + margin-right: 5px; + background: #64e385; + color: #fff; + border: none; + cursor: pointer; + padding: 2px 22px; + border-radius: 22px; + font-weight: 500; + line-height: 39px; +} + +#wpwrap .mec-button-primary:hover { + box-shadow: 0 0 0 4px rgb(0 0 0 / 10%); + background: #4d5051; + border-color: #4d5051; + cursor: pointer; +} + +#mec-wrap .nav-tab-wrapper .nav-tab-active:before { + content: ""; + position: absolute; + display: block; + background: 0 0; + top: auto; + height: auto; + bottom: -24px; + left: 50%; + margin-left: -12px; + width: 0; + border-width: 12px; + border-style: solid; + border-color: #ccecf4 transparent transparent; +} + +.ui-datepicker.ui-widget select { + border-color: #e7e8e9; +} + +.wn-p-t-right { + min-width: 300px; + max-width: 400px; + display: inline-block; + top: -8px; + left: 50%; + margin-top: 0; + transform: translate(-50%, -100%); + padding: 0; + background-color: #535a61; + color: #fff; + font-weight: 300; + font-size: 14px; + letter-spacing: 0.5px; + line-height: 1.5; + position: absolute; + z-index: 99999999; + box-sizing: border-box; + border-radius: 6px; + box-shadow: 0 4px 45px -8px #444b50; + visibility: hidden; + opacity: 0; + transition: opacity 0.23s; + padding: 20px; + border-radius: 8px; +} + +.wn-p-t-right i { + position: absolute !important; + top: 100%; + right: 50%; + margin-top: -6px !important; + margin-right: -6px !important; + width: 12px; + height: 24px; + overflow: hidden; + transform: rotate(-90deg); +} + +.wn-p-t-right i:after { + content: ""; + position: absolute; + width: 12px; + height: 12px; + left: 0; + top: 50%; + transform: translate(50%, -50%) rotate(-45deg); + background-color: #535a61; + box-shadow: 0 8px 9px -4px #535a61; +} + +.wn-p-t-right .wn-p-t-text-content h5 { + color: #fff; + font-size: 17px; + font-weight: 600; + margin: -20px; + padding: 15px 0; + text-align: center; + margin-bottom: 10px; + background: #3a3f44; + border-bottom: 1px solid #32363a; + border-radius: 6px 6px 0 0; +} + +.mec-addon-box-footer a:hover .wn-p-t-right { + visibility: visible; + opacity: 1; +} + +#mec_organizer_user+.select2-container, +#mec_speaker_user+.select2-container { + min-width: 224px !important; +} + +.mec-add-event-tabs-wrap .select2-container, +.mec-create-shortcode-tab-content .select2-container, +.wns-be-main .mec-form-row .select2-container { + min-height: 38px; + height: auto; + box-sizing: border-box; + padding: 0 6px 0 10px; + border-radius: 5px; + box-shadow: inset 0 1px 2px rgb(0 0 0 / 7%); + background-color: #f7f8f9; + color: #32373c; + outline: 0; + transition: 50ms border-color ease-in-out; + min-width: 200px; + width: 100% !important; + max-width: 290px !important; + font-size: 14px; +} + +.mec-add-event-tabs-wrap .select2-selection, +.mec-create-shortcode-tab-content .select2-selection, +.wns-be-main .mec-form-row .select2-selection { + border: none; + background: 0 0; + padding-top: 3px; + width: 100%; + height: 100%; +} + +.mec-add-event-tabs-wrap .select2-container--default.select2-container--focus .select2-selection, +.mec-create-shortcode-tab-content .select2-container--default.select2-container--focus .select2-selection, +.wns-be-main .mec-form-row .select2-container--default.select2-container--focus .select2-selection { + border: none !important; + outline: 0; +} + +.mec-add-event-tabs-wrap .select2-container--default .select2-selection--single .select2-selection__arrow, +.mec-create-shortcode-tab-content .select2-container--default .select2-selection--single .select2-selection__arrow, +.wns-be-main .mec-form-row .select2-container--default .select2-selection--single .select2-selection__arrow { + top: 5px; + right: 4px; +} + +.fs-webform-container div .fserv-container { + width: 100% !important; + max-width: none !important; + min-height: 238px !important; + box-shadow: 0 1px 6px rgb(0 0 0 / 1%) !important; + border-radius: 15px !important; + padding: 15px 0 0 !important; + margin-bottom: 0 !important; + margin-top: 30px !important; + background: url(https://webnus.net/modern-events-calendar/wp-content/uploads/2019/11/illustration.svg) no-repeat top right; + background-size: 330px; + border: 1px solid #e3e5e7; +} + +.fserv-container .fserv-form-name { + font-weight: 600 !important; + position: relative !important; + font-size: 20px !important; + padding: 30px 30px 10px !important; + text-align: left !important; + margin: 0 !important; + line-height: 1; +} + +.fserv-form-description { + padding: 10px 30px !important; + margin: 1em 0 0 !important; + line-height: 1.5 !important; + font-size: 16px !important; +} + +.fserv-container form { + padding: 0 !important; + padding-left: 28px !important; +} + +.fserv-container .fserv-label { + display: none !important; +} + +.fserv-field { + display: inline-block; + padding: 0 !important; + min-width: 260px; + margin: 0 !important; + margin-right: 25px !important; +} + +.fserv-container label.fserv-form-description { + cursor: default; +} + +.fserv-field input.fserv-input-text { + border-radius: 5px !important; + border: none !important; + background-color: #f7f8f9 !important; + box-shadow: inset 0 1px 2px rgb(0 0 0 / 7%) !important; +} + +.fserv-field+div:not(.fserv-field) { + margin: 0 !important; + border: none !important; + text-align: left !important; + padding-left: 4px !important; + margin-top: 0 !important; + padding-top: 0 !important; + display: inline-block; + margin-right: 10px !important; +} + +.fserv-container .powered-by { + display: none !important; +} + +@media (max-width: 1366px) { + #webnus-dashboard .fserv-container form { + padding: 0 !important; + padding: 0 28px 40px 28px !important; + } + + #webnus-dashboard .fserv-form .fserv-field { + width: 33% !important; + } + + #webnus-dashboard .fserv-form .fserv-button-submit { + margin-left: -2px !important; + } +} + +@media (max-width: 960px) { + #webnus-dashboard .fserv-container form { + padding: 0 !important; + padding: 0 28px 40px 28px !important; + } + + #webnus-dashboard .fserv-form .fserv-field { + width: 100% !important; + } + + #webnus-dashboard .fserv-form .fserv-button-submit { + margin-left: -2px !important; + } +} + +#webnus-dashboard .mec-intro-section .mec-intro-section-link-tag { + font-weight: 500; + border-radius: 60px; + text-shadow: none; + box-shadow: 0 0 0 3px rgb(227 249 253 / 15%); + background: #fff; + background: linear-gradient(95deg, #fff 0, #fff 50%, #fff 100%) !important; + border: 1px solid #c0e5ea; + transition: 0.24s; +} + +#webnus-dashboard .mec-intro-section .mec-intro-section-link-tag.button-primary, +#webnus-dashboard .total-bookings button, +button.fserv-button-submit { + color: #fff !important; + font-weight: 500 !important; + border-radius: 60px !important; + box-shadow: 0 0 0 4px rgb(56 213 237 / 1%) !important; + text-shadow: none !important; + background: #38d5ed !important; + border: none !important; + transition: 0.24s !important; +} + +#webnus-dashboard button.fserv-button-submit { + background: #64e385 !important; + box-shadow: 0 0 0 3px #64e3851a !important; +} + +#webnus-dashboard button.fserv-button-submit:hover { + background: #46d26a !important; + box-shadow: 0 0 0 4px #64e38536 !important; +} + +#webnus-dashboard .total-bookings button { + line-height: 39px; + padding: 0 36px; +} + +#webnus-dashboard .mec-intro-section .mec-intro-section-link-tag.button-primary:hover { + color: #fff !important; + background: #1fcae4 !important; + box-shadow: 0 0 0 4px rgb(56 213 237 / 15%) !important; +} + +#webnus-dashboard .total-bookings button:hover, +button.fserv-button-submit:hover { + background: #26bbd2 !important; + box-shadow: 0 0 0 4px rgb(56 213 237 / 15%) !important; + cursor: pointer !important; +} + +#webnus-dashboard .mec-intro-section .mec-intro-section-link-tag:hover { + box-shadow: 0 0 0 4px rgb(56 213 237 / 8%) !important; + color: #02a3bb !important; + cursor: pointer !important; +} + +.fserv-container input::-webkit-input-placeholder { + font-family: inherit !important; + font-size: 14px; +} + +.fserv-container input::-moz-placeholder { + font-family: inherit !important; + font-size: 14px; +} + +.fserv-container input:-ms-input-placeholder { + font-family: inherit !important; + font-size: 14px; +} + +.fserv-container input:-moz-placeholder { + font-family: inherit !important; + font-size: 14px; +} + +input.fserv-input-text { + height: 38px; + box-sizing: border-box; + margin-bottom: 8px; + padding: 0 6px; + box-shadow: none; + border-radius: 2px; + box-shadow: inset 0 1px 5px rgba(0, 0, 0, 0.05); +} + +.fserv-field label.error { + display: none !important; +} + +.fs-notifier { + position: fixed !important; + top: 40px !important; + width: 300px !important; + max-width: 300px !important; + margin: 0 !important; + right: 20px !important; + left: unset !important; +} + +.post-type-mec-events .lity { + background: #edf0f3; +} + +.post-type-mec-events .lity-container { + width: 60vw; + max-width: 883px; + margin: 0 auto; + border-radius: 7px; +} + +.post-type-mec-events .lity-content:after { + display: none; +} + +.mec-manage-events-lightbox { + box-shadow: 0 3px 20px rgba(0, 0, 0, 0.05); +} + +.w-clearfix.mec-attendees-content img { + display: inline-block; + width: 25px; + height: 25px; + vertical-align: middle; + margin-right: 7px; +} + +.post-type-mec-events .mec-attendees-list-head { + background: #008aff; + color: #fff; + text-align: center; + padding: 17px 0; + text-transform: capitalize; + font-size: 26px; + font-weight: 700; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important; + border-radius: 7px 7px 0 0; + line-height: 43px; + box-shadow: 0 3px 15px rgba(0, 138, 255, 0.25); + z-index: 99; +} + +.mec-attendees-list-wrap { + display: flex; + width: 100%; + flex-direction: column; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important; + background: #fff; + box-shadow: 0 3px 20px rgba(0, 0, 0, 0.05); + border-radius: 0 0 5px 5px; + overflow: hidden; +} + +.mec-attendees-list-left { + flex: 1; + background: #f6f8fa; + padding: 0; + border-radius: 0; + position: relative; +} + +.mec-attendees-list-right, +.mec-send-email-form-wrap { + flex: 1; + border-radius: 0 0 5px 5px; + padding: 0 20px 20px; + background: #f2f4f7; +} + +.mec-attendees-list-left-menu a { + display: inline-block; + line-height: 22px; + font-size: 12px; + color: #000; + font-weight: 500; + border-bottom: 1px solid #eaebec; + border-left: 1px solid #eaebec; + padding-bottom: 0; + padding: 7px 6px; + margin-bottom: 0; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important; + transition: all 0.2s ease; + text-decoration: none; + text-align: center; +} + +.mec-attendees-list-left-menu a.selected-day { + color: #008aff; +} + +.mec-attendees-list-left-menu .owl-item:last-child a { + border-right: 1px solid #eaebec; +} + +.mec-attendees-list-right table { + width: 100%; +} + +.w-clearfix.mec-attendees-head { + margin-top: 30px; + border-bottom: 2px solid #ccecf4; + padding-bottom: 18px; + margin-bottom: 3px; +} + +.w-clearfix.mec-attendees-content [class^="w-col-xs-"], +.w-clearfix.mec-attendees-head [class^="w-col-xs-"] { + padding: 0; +} + +.w-clearfix.mec-attendees-head span { + font-weight: 600; + color: #000; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important; + font-size: 17px; +} + +.w-clearfix.mec-attendees-content { + background: #fff; + margin-bottom: 2px; + padding: 10px 20px; +} + +.mec-attendees-list-left-menu { + height: 36px; + margin-left: 35px; + margin-right: 36px; +} + +.mec-attendees-list-left-menu a:active, +.mec-attendees-list-left-menu a:focus, +.mec-attendees-list-left-menu a:visited { + outline: 0; + box-shadow: none; +} + +.mec-attendees-list-left-menu .owl-item { + display: inline-block; +} + +.mec-attendees-list-left-menu .owl-stage { + min-width: 800px !important; +} + +.owl-nav.disabled .owl-next { + position: absolute; + right: 0; + top: 0; +} + +.owl-nav.disabled .owl-prev { + position: absolute; + left: 0; + top: 0; +} + +.owl-nav.disabled button { + background: #fff; + box-shadow: none; + border: 1px solid #ccc; + height: 36px; + width: 36px; + font-size: 54px; + line-height: 54px; +} + +.owl-nav.disabled button span { + margin-top: -18px; + display: block; +} + +.mec-cover-loader:after { + content: ""; + position: absolute; + top: 0; + right: 0; + left: 0; + bottom: 0; + background: rgba(255, 255, 255, 0.5); + z-index: 99999; +} + +.mec-loader { + background: rgba(0, 0, 0, 0); + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + z-index: 9; +} + +.mec-loader, +.mec-loader:after { + border-radius: 50%; + width: 5em; + height: 5em; + z-index: 999999999999; +} + +.mec-loader { + font-size: 10px; + text-indent: -9999em; + border-top: 0.5em solid rgba(0, 0, 0, 0.2); + border-right: 0.5em solid rgba(0, 0, 0, 0.2); + border-bottom: 0.5em solid rgba(0, 0, 0, 0.2); + border-left: 0.5em solid #fff; + -webkit-transform: translateZ(0); + -ms-transform: translateZ(0); + transform: translateZ(0); + -webkit-animation: mecloader 1.1s infinite linear; + animation: mecloader 1.1s infinite linear; +} + +@media (max-width: 992px) { + .post-type-mec-events .lity-container { + width: 80vw; + } +} + +@-webkit-keyframes mecloader { + 0% { + -webkit-transform: rotate(0); + transform: rotate(0); + } + + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} + +@keyframes mecloader { + 0% { + -webkit-transform: rotate(0); + transform: rotate(0); + } + + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} + +.mec-report-backtoselect-wrap, +.mec-report-sendmail-form-wrap { + display: none; +} + +.mec-report-select-event-wrap .select2, +.mec-select-wrap .select2 { + width: 100% !important; +} + +.mec-report-select-event-wrap .select2-container--default .select2-selection--single, +.mec-select-wrap .select2-container--default .select2-selection--single { + border-radius: 4px; + border: 1px solid #e2e3e4; + height: 40px; + padding-top: 5px; + padding-left: 8px; + width: 100%; + box-shadow: none; +} + +.mec-report-select-event-wrap .select2-container--default .select2-selection--single .select2-selection__arrow, +.mec-select-wrap .select2-container--default .select2-selection--single .select2-selection__arrow { + height: 36px; +} + +.mec-report-select-event-wrap .select2-container--open .select2-dropdown--below, +.mec-select-wrap .select2-container--open .select2-dropdown--below { + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); + border-color: #d7d8d9; +} + +.select2-container--default .select2-search--dropdown { + padding: 12px; +} + +.select2-container--default .select2-search--dropdown .select2-search__field { + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02) inset; + border-color: #e3e5e7; + border-radius: 4px; +} + +.mec-report-select-event-wrap input, +.mec-report-select-event-wrap select, +.mec-select-wrap input[type="text"], +.mec-select-wrap select .mec-report-select-event-wrap input[type="text"] { + border: 1px solid #e2e3e4; + height: 40px; + font-size: 13px; + font-weight: 400; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important; + margin-bottom: 15px; + border-radius: 4px; + box-shadow: none; + max-width: 150px; +} + +#certificate_select { + border: 1px solid #e2e3e4; + height: 34px; + font-size: 13px; + font-weight: 400; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important; + margin-bottom: 15px; + border-radius: 4px; + box-shadow: none; + max-width: 300px; + min-width: 200px; + margin: 0 !important; + vertical-align: bottom; +} + +.mec-report-select-event-wrap .select2-container--default, +.mec-select-wrap .select2-container--default { + max-width: 400px; +} + +.select2-dropdown.select2-dropdown { + border-color: #e3e5e7 !important; + box-shadow: none !important; +} + +.mec-report-select-event-wrap select.mec-reports-selectbox-dates, +.mec-select-wrap select.mec-reports-selectbox-dates { + min-width: 260px; + margin: 0 0 0 10px; + padding-left: 15px; +} + +.mec-report-sendmail-form-wrap, +.mec-report-sendmail-wrap { + padding: 30px 15px; + background: #fff; + border: 1px solid #e2e3e4; + margin: 15px 0 5px; + border-radius: 10px; + box-shadow: 0 1px 4px rgba(0, 0, 0, 0.01); +} + +.mec-report-sendmail-wrap .w-col-sm-12:before { + background: url(../img/email-document.png) no-repeat left top; + content: ""; + display: block; + width: 90px; + height: 70px; + z-index: 100; + float: left; +} + +.mec-report-sendmail-wrap p { + margin: 0 0 15px; + font-size: 15px; + color: #7d8284; +} + +.mec-report-backtoselect-wrap button, +.mec-report-sendmail-wrap .w-col-sm-12 button, +.mec-send-email-form-wrap .mec-send-email-button { + background: #19cde9; + border: none; + color: #fff; + font-size: 13px !important; + padding: 8px 18px; + border-radius: 4px; + cursor: pointer; + box-shadow: 0 1px 2px rgba(25, 205, 233, 0.05); + transition: all 0.2s ease; +} + +.mec-report-backtoselect-wrap button:hover, +.mec-report-sendmail-wrap .w-col-sm-12 button:hover, +.mec-send-email-form-wrap .mec-send-email-button:hover { + background: #04bfdc; + box-shadow: 0 1px 2px rgba(25, 205, 233, 0.05); +} + +.mec-report-backtoselect-wrap button { + margin-top: 15px; +} + +.mec-report-selected-event-attendees-wrap { + background-color: #fff; + border: 1px solid #e1e2e3; + padding: 0; + margin: 20px 0; + border-radius: 7px; + display: none; +} + +.mec-report-selected-event-attendees-wrap .w-col-sm-12 { + width: calc(100% - 30px); +} + +.mec-report-sendmail-wrap { + display: none; +} + +#mec_report_mass_action_form .mec-form-row { + padding: 0; +} + +.mec-report-selected-event-attendees-wrap .w-clearfix.mec-attendees-head { + background: #f5f6f7; + border-bottom: 1px solid #e1e2e3; + padding: 15px; + margin: 0; + border-radius: 5px 5px 0 0; +} + +.mec-report-selected-event-attendees-wrap .w-clearfix.mec-attendees-content { + margin: 0; + padding: 8px 15px; + border-bottom: 1px solid #e4eef0; + font-size: 13px; + line-height: 25px; +} + +.mec-report-selected-event-attendees-wrap .w-clearfix.mec-attendees-content:hover { + background: #f3fdfe; +} + +.mec-report-selected-event-attendees-wrap .w-clearfix.mec-attendees-content:last-child { + border-bottom: none; + border-radius: 0 0 6px 6px; +} + +.mec-report-selected-event-attendees-wrap .w-clearfix.mec-attendees-content img { + border-radius: 25px; + margin-left: 8px; +} + +.mec-report-selected-event-attendees-wrap input[type="checkbox"] { + border-radius: 3px; + margin-top: 0; +} + +.mec-report-selected-event-attendees-wrap .mec-attendees-head .w-col-xs-2.name { + padding-left: 10px; +} + +.mec-report-selected-event-attendees-wrap .checkin_status span { + font-weight: 600; +} + +.mec-report-selected-event-attendees-wrap .w-col-sm-12>p { + text-align: center; +} + +.mec-attendees-list-right, +.mec-send-email-form-wrap { + flex: 1; + border-radius: 0; + padding: 0; + background: 0 0; + max-width: 674px; + margin: 0 auto; +} + +.mec-report-sendmail-form-wrap { + padding: 0 30px 45px; +} + +.mec-send-email-form-wrap h2 { + background: url(../img/email-document.png) no-repeat center top; + padding-top: 70px; + font-size: 22px; + font-weight: 600; + text-align: center; + padding-bottom: 10px; + padding-left: 10px; + margin-bottom: 0; +} + +#webnus-dashboard .mec-send-email-form-wrap .wp-editor-tools button { + font-size: 13px; + font-weight: 400; + color: #444; + line-height: 1; + margin-bottom: 0; +} + +#webnus-dashboard .mec-send-email-form-wrap .wp-editor-tabs button { + min-height: 30px; +} + +.mec-send-email-form-wrap input.widefat { + min-height: 40px; + border: 1px solid #e2e3e4; + border-radius: 2px; + box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02); +} + +.mec-send-email-form-wrap input.widefat:focus { + border: 1px solid #96e3ef; +} + +.mec-send-email-form-wrap h4.mec-send-email-count { + font-weight: 400; + text-align: center; + margin-bottom: 30px; + margin-top: 0; + padding-top: 0; +} + +.mec-send-email-form-wrap .mec-send-email-button { + min-height: 40px; + line-height: 40px; + padding: 0; + font-size: 17px !important; + font-weight: 600; +} + +.mec-send-email-form-wrap .mce-menubtn.mce-fixed-width span { + height: 20px; + padding-top: 2px; +} + +.lity.mec-add-shortcode-popup { + background-color: #b7e4e3; +} + +.lity.mec-add-shortcode-popup .lity-content { + box-shadow: 0 3px 20px 0 rgba(91, 188, 190, 0.55); + border-radius: 10px; + height: 100%; +} + +.mec-add-shortcode-popup .lity-container { + width: 930px; + height: 620px; +} + +.mec-add-shortcode-popup .lity-content:after { + display: none; +} + +.mec-add-shortcode-popup div#mec_popup_shortcode { + background: #fff; + overflow: hidden; + display: flex; + width: 100%; + border-radius: 10px; + height: 100%; +} + +.mec-steps-container { + width: 92px; + text-align: center; + background: #fff; +} + +.mec-steps-panel { + width: calc(100% - 92px); + background: #eef4f5; +} + +.mec-steps-container ul { + text-align: center; + display: block; + margin-top: 62px; +} + +.mec-steps-container ul li { + width: 22px; + height: 70px; + margin: 0 auto; + position: relative; +} + +.mec-steps-container ul li span { + border-radius: 50px; + background-color: rgba(26, 175, 251, 0.16); + width: 22px; + height: 22px; + display: inline-block; + padding-top: 2px; + font-size: 11px; + font-weight: 700; + color: #1aaffb; + box-sizing: border-box; +} + +.mec-steps-container ul li:after, +.mec-steps-container ul li:before { + content: ""; + display: block; + height: 24px; + width: 2px; + background: rgba(26, 175, 251, 0.16); + margin-left: calc(50% - 1px); +} + +.mec-steps-panel .mec-form-row input[type="checkbox"], +.mec-steps-panel .mec-form-row input[type="radio"] { + background: #fff; +} + +.mec-box .mec-steps-panel .mec-form-row input[type="radio"], +.mec-steps-panel .mec-form-row .mec-box input[type="checkbox"] { + background: #f7f8f9; +} + +.mec-steps-panel .mec-form-row .mec-box input[type="checkbox"]:checked, +.mec-steps-panel .mec-form-row .mec-box input[type="radio"]:checked { + background: #fff; +} + +.mec-steps-container ul li:first-of-type:before, +.mec-steps-container ul li:last-of-type:after { + display: none; +} + +.mec-steps-container ul li:first-of-type { + height: 46px; +} + +li.mec-step.mec-step-passed span, +li.mec-step.mec-step-passed:after, +li.mec-step.mec-step-passed:before { + background-color: #2dcb73; + color: #fff; +} + +.mec-steps-container img { + margin-top: 30px; +} + +.mec-steps-header { + display: flex; + background: #fff; + border-radius: 5px; + box-shadow: 0 3px 22px 0 rgb(11 121 125 / 1%); + padding: 12px 22px; + margin: -15px -15px 65px; +} + +.mec-steps-header-settings { + width: 65px; +} + +.mec-steps-header-dashboard { + width: fit-content; + margin-right: 22px; +} + +.mec-steps-header-userinfo { + width: calc(100% - 65px); +} + +.mec-steps-panel { + padding: 35px; + position: relative; + display: flex; + flex-direction: column; + justify-content: space-between; +} + +.mec-steps-header-userinfo span { + display: inline-block; + vertical-align: middle; +} + +.mec-steps-header-userinfo span img { + height: 40px; + border-radius: 50px; + margin-right: 8px; + vertical-align: middle; +} + +.mec-steps-header-userinfo span.mec-steps-header-name { + font-size: 14px; + color: #778182; + font-weight: 600; + text-transform: capitalize; +} + +span.mec-steps-header-add-text { + color: #839294; + font-size: 12px; + margin-left: 5px; +} + +.mec-steps-header-dashboard a, +.mec-steps-header-settings a { + height: 100%; + display: block; + padding-top: 11px; + text-decoration: none; + font-size: 12px; + color: #707070; +} + +.mec-steps-header-dashboard a i, +.mec-steps-header-settings a i { + color: #1aaffb; + font-size: 16px; + vertical-align: text-top; + margin-right: 5px; +} + +.mec-next-previous-buttons { + clear: both; +} + +.mec-next-previous-buttons button.mec-button-next { + float: right; + background: #008aff; + border: none; + color: #fff; + cursor: pointer; + width: 123px; + text-align: left; + padding: 8px 18px 9px; + border-radius: 3px; + font-size: 14px; + box-shadow: 0 5px 10px 0 rgba(0, 138, 255, 0.3); + transition: all 0.3s ease; + outline: 0; +} + +.mec-next-previous-buttons button:hover { + background: #000; + box-shadow: 0 5px 10px 0 rgba(0, 0, 0, 0.3); +} + +.mec-next-previous-buttons button.mec-button-next img { + position: absolute; + top: 16px; + right: 18px; +} + +.mec-next-previous-buttons button { + position: relative; +} + +.mec-next-previous-buttons button.mec-button-prev { + background: #fff; + border: none; + color: #000; + cursor: pointer; + width: 123px; + text-align: right; + padding: 8px 15px 9px; + border-radius: 3px; + font-size: 14px; + box-shadow: 0 5px 10px 0 rgba(11, 121, 125, 0.01); + transition: all 0.3s ease; + outline: 0; +} + +.mec-next-previous-buttons button.mec-button-prev img { + position: absolute; + top: 16px; + left: 18px; +} + +.mec-next-previous-buttons button.mec-button-prev:hover { + background: #000; + box-shadow: 0 5px 10px 0 rgba(0, 0, 0, 0.3); + color: #fff; +} + +.mec-next-previous-buttons button.mec-button-new { + background: #008aff; + float: right; + border: none; + color: #fff; + cursor: pointer; + width: 154px; + text-align: left; + padding: 8px 18px 9px; + border-radius: 3px; + font-size: 14px; + box-shadow: 0 5px 10px 0 rgba(0, 138, 255, 0.3); + transition: all 0.3s ease; + outline: 0; +} + +.mec-next-previous-buttons button.mec-button-new:hover { + background: #000; + box-shadow: 0 5px 10px 0 rgba(0, 0, 0, 0.3); +} + +.mec-next-previous-buttons button.mec-button-new img { + vertical-align: sub; + margin-left: -3px; + margin-right: 8px; +} + +div#mec_popup_shortcode_form { + height: calc(100% - 37px); +} + +.mec-steps-content-container { + display: flex; + flex-direction: column; + height: 100%; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-1 { + background: url(../../assets/img/popup/first-step.png) no-repeat 90% 70%; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-1 .popup-sh-name-required { + color: red; + display: none; + font-style: italic; + font-size: 12px; + margin-top: 8px; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-1 .mec-steps-content.mec-steps-content-1 { + top: 50%; + position: absolute; + width: 360px; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-1 .mec-steps-content.mec-steps-content-1 input[name="shortcode[name]"] { + width: 360px; + height: 46px; + border: none; + border-radius: 3px; + padding-left: 36px; + font-size: 12px; + color: #b1b2b4; + box-shadow: 0 3px 22px 0 rgba(11, 121, 125, 0.01); +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-1 .mec-steps-content.mec-steps-content-1 input[name="shortcode[name]"]::-webkit-input-placeholder { + color: #b1b2b4; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-1 .mec-steps-content.mec-steps-content-1 input[name="shortcode[name]"]:-ms-input-placeholder { + color: #b1b2b4; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-1 .mec-steps-content.mec-steps-content-1 input[name="shortcode[name]"]::placeholder { + color: #b1b2b4; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-1 .mec-steps-content.mec-steps-content-1:before { + content: ""; + width: 14px; + height: 14px; + background: url(../../assets/img/popup/add-sh-icon.png) no-repeat center center; + position: absolute; + top: 17px; + left: 17px; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-2 .mec-steps-content.mec-steps-content-2 ul { + height: 386px; + overflow-x: hidden; + overflow-y: scroll; + margin-top: -22px; + margin-bottom: 0; + position: relative; + padding: 0 50px 150px 50px; + background: #fcfbfd !important; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-2 .mec-steps-content.mec-steps-content-2 ul li { + width: 30% !important; + float: left !important; + min-height: 135px !important; + height: 150px; + margin: 1.66% !important; + box-sizing: border-box; + text-align: center; + padding: 12px !important; + border-radius: 8px; + border: 1px solid transparent; + box-shadow: none; + background: #fff0 !important; + cursor: pointer; + transition: all 0.22s ease; + -webkit-transition: all 0.22s ease; + -moz-transition: all 0.22s ease; + -ms-transition: all 0.22s ease; + -o-transition: all 0.22s ease; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-2 .mec-steps-content.mec-steps-content-2 ul li.active { + border: 1px solid #40d9f16b !important; + box-shadow: 0 1px 8px -3px #40d9f152 inset !important; + color: #00cae6 !important; + padding: 12px 0 0 0 !important; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-2 .mec-steps-content.mec-steps-content-2 ul li:hover { + box-shadow: 0 1px 8px rgb(0 0 0 / 3%), 0 0 0 1px #f3f4f5; + background: #fff !important; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-2 .mec-steps-content.mec-steps-content-2 ul li:hover { + background: #fcfbfd; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-2 .mec-step-popup-skin-img img { + margin: 4px 0 1px 1px; + line-height: 1; + max-width: 68px; + max-height: 56px; + filter: grayscale(1); + -webkit-filter: grayscale(1); + transition: all 0.22s ease; + -webkit-transition: all 0.22s ease; + -moz-transition: all 0.22s ease; + -ms-transition: all 0.22s ease; + -o-transition: all 0.22s ease; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-2 li.active .mec-step-popup-skin-img img, +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-2 li:hover .mec-step-popup-skin-img img { + filter: grayscale(0); + -webkit-filter: grayscale(0); +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-2 .mec-step-popup-skin-text input { + display: block; + margin: 0 auto; + margin-top: 6px; + border: 2px solid #e1e7ed; + box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.05); + position: relative; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-2 .mec-step-popup-skin-img { + padding-top: 16px; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-2 .mec-steps-content.mec-steps-content-2 ul li .mec-step-popup-skin-text input { + display: none; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-2 .mec-step-popup-skin-text:before { + width: 14px; + height: 14px; + content: ""; + border-radius: 50px; + background: #fff; + display: block; + position: absolute; + left: calc(50% - 7px); + top: 24px; + z-index: 99; + border: 2px solid #e1e7ed; + box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.05); +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-2 .mec-step-popup-skin-text { + position: relative; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-2 li.active .mec-step-popup-skin-text:before { + background: #008aff; + border: none; + box-shadow: 0 5px 10px 0 rgba(0, 138, 255, 0.3); + width: 16px; + height: 16px; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-2 li.active .mec-step-popup-skin-text:after { + width: 4px; + height: 4px; + display: block; + content: ""; + position: absolute; + background: #fff; + left: calc(50% - 1px); + top: 30px; + z-index: 999; + border-radius: 50px; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-3 span.wn-hover-img-sh { + display: block; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-3 .mec-skin-styles { + height: 386px; + overflow-x: hidden; + padding-left: 60px; + padding-bottom: 19px; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-3 .mec-skin-styles label { + width: 193px !important; + float: left !important; + margin: 1.66% !important; + text-align: center; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-3 .mec-skin-styles label span { + width: 193px !important; + float: left !important; + min-height: 135px !important; + height: 150px; + box-sizing: border-box; + border-radius: 5px; + border: 2px solid #c4edff; + background: #fff !important; + cursor: pointer; + margin-bottom: 5px; + margin-top: -6px; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-3 .mec-skin-styles label.active span { + border-color: #00acf8; + box-shadow: 0 3px 5px rgba(0, 172, 248, 0.2); +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-3 .mec-skin-styles label div { + font-size: 14px; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-3 .mec-skin-styles label.active div { + color: #008aff; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-3 .mec-skin-styles input { + opacity: 0; + display: none; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-3 .mec-steps-content.mec-steps-content-3 { + margin-top: -18px; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-3 span.wn-hover-img-sh img { + width: 189px; + height: 146px; + border-radius: 5px; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 { + background: url(../../assets/img/popup/fourth-step.png) no-repeat 90% 70%; +} + +.mec-add-shortcode-popup .mec-steps-content.mec-steps-content-4 .nice-select { + border: none; + box-shadow: 0 3px 22px 0 rgba(11, 121, 125, 0.01); +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .mec-steps-content.mec-steps-content-4 { + top: 40%; + position: absolute; + width: 330px; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .mec-steps-content.mec-steps-content-4 h3 { + font-size: 13px; + font-weight: 400; + color: #707070; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .mec-steps-content.mec-steps-content-4 .mec-multiple-skin-options div { + border: 2px dashed #dce2e3; + border-radius: 3px; + padding: 20px 20px 6px; + background: #fcfcfc; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .mec-steps-content.mec-steps-content-4 .mec-multiple-skin-options div label { + display: block; + margin-bottom: 14px; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .mec-steps-content.mec-steps-content-4 .mec-multiple-skin-options div label.active input { + background: #fff; + box-shadow: none; + border: 1px solid #cacece; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .wn-mec-select-popup { + box-shadow: 0 3px 13px -5px rgba(0, 0, 0, 0.1), + inset 0 1px 2px rgba(0, 0, 0, 0.07); + clear: unset !important; + -webkit-tap-highlight-color: transparent; + background-color: #fff; + border-radius: 5px; + border: solid 1px #e8e8e8; + box-sizing: border-box; + clear: both; + cursor: pointer; + display: block; + float: left; + font-family: inherit; + font-size: 14px; + font-weight: 400; + height: 42px; + line-height: 40px; + outline: 0; + padding-left: 18px; + padding-right: 30px; + position: relative; + text-align: left !important; + -webkit-transition: all 0.2s ease-in-out; + transition: all 0.2s ease-in-out; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + white-space: nowrap; + width: 300px !important; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .wn-mec-select-popup:hover { + border-color: #dbdbdb; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .wn-mec-select-popup.open .list { + overflow: unset; + width: 100%; + margin: 0; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .wn-mec-select-popup .list { + background-color: #fff; + border-radius: 5px; + box-shadow: 0 0 0 1px rgba(68, 68, 68, 0.11); + box-sizing: border-box; + margin-top: 4px; + opacity: 0; + overflow: hidden; + padding: 0; + pointer-events: none; + position: absolute; + top: 100%; + left: 0; + -webkit-transform-origin: 50% 0; + -ms-transform-origin: 50% 0; + transform-origin: 50% 0; + -webkit-transform: scale(0.75) translateY(-21px); + -ms-transform: scale(0.75) translateY(-21px); + transform: scale(0.75) translateY(-21px); + -webkit-transition: all 0.2s cubic-bezier(0.5, 0, 0, 1.25), + opacity 0.15s ease-out; + transition: all 0.2s cubic-bezier(0.5, 0, 0, 1.25), opacity 0.15s ease-out; + z-index: 9; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .wn-mec-select-popup:after { + border-bottom: 2px solid #999; + border-right: 2px solid #999; + content: ""; + display: block; + height: 5px; + margin-top: -4px; + pointer-events: none; + position: absolute; + right: 12px; + top: 50%; + -webkit-transform-origin: 66% 66%; + -ms-transform-origin: 66% 66%; + transform-origin: 66% 66%; + -webkit-transform: rotate(45deg); + -ms-transform: rotate(45deg); + transform: rotate(45deg); + -webkit-transition: all 0.15s ease-in-out; + transition: all 0.15s ease-in-out; + width: 5px; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .wn-mec-select-popup.open:after { + -webkit-transform: rotate(-135deg); + -ms-transform: rotate(-135deg); + transform: rotate(-135deg); +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .wn-mec-select-popup.open .list { + opacity: 1; + pointer-events: auto; + -webkit-transform: scale(1) translateY(0); + -ms-transform: scale(1) translateY(0); + transform: scale(1) translateY(0); +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .wn-mec-select-popup.disabled { + border-color: #ededed; + color: #999; + pointer-events: none; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .wn-mec-select-popup.disabled:after { + border-color: #ccc; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .wn-mec-select-popup .list:hover .option:not(:hover) { + background-color: transparent !important; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .wn-mec-select-popup .option { + cursor: pointer; + font-weight: 400; + list-style: none; + min-height: 40px; + outline: 0; + text-align: left; + position: relative; + font-size: 12px !important; + padding: 1px 12px !important; + margin: 0 !important; + line-height: 28px !important; + min-height: 28px !important; + -webkit-transition: all 0.2s ease-in-out; + transition: all 0.2s ease-in-out; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .wn-mec-select-popup .option .wn-hover-img-sh img { + position: absolute; + padding: 3px; + top: -1px; + left: 100%; + box-shadow: 0 4px 42px -5px rgba(0, 0, 0, 0.16); + visibility: hidden; + opacity: 0; + border: 1px solid #e3e3e3; + border-radius: 2px; + z-index: 99999999; + background: #fff; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .wn-mec-select-popup .option:hover .wn-hover-img-sh img { + visibility: visible; + opacity: 1; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .wn-mec-select-popup .option.focus, +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .wn-mec-select-popup .option.selected.focus, +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .wn-mec-select-popup .option:hover { + background-color: #f6f6f6; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .wn-mec-select-popup .option.selected { + font-weight: 700; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .wn-mec-select-popup .option.disabled { + background-color: transparent; + color: #999; + cursor: default; +} + +.mec-add-shortcode-popup .no-csspointerevents .wn-mec-select-popup .list { + display: none; +} + +.mec-add-shortcode-popup .no-csspointerevents .wn-mec-select-popup.open .list { + display: block; +} + +.mec-add-shortcode-popup .mec-steps-content.mec-steps-content-4 label input { + background: #fff; + position: relative; + width: 24px; + height: 24px; + border: 1px solid #cacece; +} + +.mec-add-shortcode-popup .mec-steps-content.mec-steps-content-4 label input:before { + display: none; +} + +.mec-add-shortcode-popup .mec-steps-content.mec-steps-content-4 label.active input { + background: #008aff; + box-shadow: 0 5px 10px 0 rgba(0, 138, 255, 0.3); + border: none; +} + +.mec-add-shortcode-popup .mec-steps-content.mec-steps-content-4 label.active input:before { + background: #fff; + width: 6px; + height: 6px; + top: 6px; + left: 6px; + position: absolute; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-5 { + background: url(../../assets/img/popup/fifth-step.png) no-repeat 90% 70%; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-5 .mec-steps-content.mec-steps-content-5 { + width: 360px; + margin-top: 16px; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-5 .mec-steps-content.mec-steps-content-5 .mec-switcher label { + color: #707070; + font-size: 14px; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-5 .mec-steps-content.mec-steps-content-5 .mec-switcher p { + color: #8a8a8a; + font-style: italic; + font-size: 12px; + margin-top: 7px; + margin-bottom: 0; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-5 .mec-steps-content.mec-steps-content-5 .mec-switcher { + padding-bottom: 30px; + margin-bottom: 34px; + border-bottom: 2px dashed #dce2e3; + position: relative; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-5 .mec-steps-content.mec-steps-content-5 .mec-switcher:last-of-type { + padding-bottom: 0; + margin-bottom: 0; + border: none; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-5 .mec-steps-content.mec-steps-content-5 .mec-switcher div:last-of-type label { + position: absolute; + top: -4px; + right: 0; + width: 52px; + height: 26px; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-5 .mec-steps-content.mec-steps-content-5 .mec-switcher input:checked+label:after { + margin-left: 26px; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-5 .mec-steps-content.mec-steps-content-5 .mec-switcher input+label:after, +.mec-add-shortcode-popup .mec-switcher input+label:before { + display: block; + position: absolute; + top: 2px; + left: 1px; + bottom: 2px; + content: ""; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-5 .mec-steps-content.mec-steps-content-5 .mec-switcher input+label:after { + width: 26px; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-6 { + background: url(../../assets/img/popup/sixth-step.png) no-repeat 90% 70%; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-6 .mec-steps-content.mec-steps-content-6 { + margin-top: 56px; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-6 .mec-popup-shortcode { + width: 325px; + border: 2px dashed #dce2e3; + background: #fcfcfc; + padding: 42px 42px 47px; + text-align: center; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-6 .mec-popup-shortcode h3 { + font-size: 16px; + font-weight: 400; + color: #707070; + margin-top: 7px; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-6 .mec-popup-shortcode-code { + border-radius: 3px; + background: rgba(154, 214, 222, 0.35); + width: 243px; + margin: 0 auto; + padding: 14px 17px; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-6 .mec-popup-shortcode-code code { + background: 0 0; + color: #000; + font-size: 14px; + font-weight: 600; + margin-left: -11px; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-6 .mec-popup-shortcode-code button { + border: none; + background: #fff; + border-radius: 3px; + padding: 3px 8px 6px; + margin-left: 46px; + cursor: pointer; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-6 .mec-popup-shortcode-code button:hover { + background: #000; + color: #fff; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-6 .mec-steps-6-results p { + width: 325px; + text-align: center; + font-size: 12px; + margin-top: 5px; + color: #8a8a8a; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-6 .mec-steps-6-loading { + width: 325px; + border: 2px dashed #dce2e3; + background: #fcfcfc; + padding: 42px 42px 47px; + text-align: center; + height: 182px; + position: relative; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-6 .mec-steps-6-loading .mec-loader { + position: absolute; + left: 136px; + top: 65px; +} + +.mec-add-event-popup button.lity-close, +.mec-add-shortcode-popup button.lity-close { + right: 0; + top: -52px; + border-radius: 50%; + width: 37px; + height: 37px; + background: #fff; + color: #a2afbc; + text-shadow: none; + padding-top: 1px; + transition: all 0.2s ease; + position: absolute; + box-shadow: 0 3px 8px 0 rgba(91, 188, 190, 0.55); +} + +.mec-add-event-popup button.lity-close:hover, +.mec-add-shortcode-popup button.lity-close:hover { + background: #ff6262; + color: #fff; + box-shadow: 0 3px 8px 0 rgb(249 162 162 / 55%); +} + +.mec-skin-styles.mec-styles-full_calendar h3 { + padding-left: 12px; +} + +.lity.mec-add-event-popup { + background-color: #b7e4e3; +} + +.mec-add-event-popup .lity-container { + width: 930px; + height: 620px; + max-width: unset; +} + +.mec-add-event-popup div#mec_popup_event { + background: #fff; + overflow: hidden; + display: flex; + width: 100%; + border-radius: 10px; + height: 100%; +} + +.lity.mec-add-event-popup .lity-content { + box-shadow: 0 3px 20px 0 rgba(91, 188, 190, 0.55); + border-radius: 10px; + height: 100%; +} + +div#mec_popup_event_form { + height: calc(100% - 37px); +} + +.mec-add-event-popup .mec-steps-container ul { + margin-top: 42px; +} + +.mec-add-event-popup .mec-steps-container ul li:first-of-type { + height: 41px; +} + +.mec-add-shortcode-popup .mec-steps-container ul li:after, +.mec-add-shortcode-popup .mec-steps-container ul li:before { + height: 24px; +} + +.mec-add-event-popup .mec-steps-container ul li:after, +.mec-add-event-popup .mec-steps-container ul li:before { + height: 19px; +} + +.mec-add-event-popup .mec-steps-container ul li { + height: 60px; +} + +.mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup { + box-shadow: 0 3px 22px 0 rgba(11, 121, 125, 0.01); + border: none; + clear: unset !important; + -webkit-tap-highlight-color: transparent; + background-color: #fff; + border-radius: 3px; + box-sizing: border-box; + cursor: pointer; + display: block; + float: left; + font-family: inherit; + font-size: 12px; + font-weight: 400; + line-height: 40px; + outline: 0; + padding-left: 18px; + padding-right: 30px; + position: relative; + text-align: left !important; + -webkit-transition: all 0.2s ease-in-out; + transition: all 0.2s ease-in-out; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + white-space: nowrap; + height: 46px; + margin-right: 6px; + padding-top: 3px; + color: #707070; +} + +.mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup.open { + border-radius: 3px 3px 0 0; +} + +.mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup:hover { + border-color: #dbdbdb; +} + +.mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup.open .list { + overflow: unset; + width: 100%; + margin: 0; +} + +.mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup .list { + background-color: #fff; + border-radius: 0 0 3px 3px; + box-shadow: 0 0 0 0 rgba(68, 68, 68, 0.11); + box-sizing: border-box; + margin-top: 4px; + opacity: 0; + overflow: hidden; + padding: 0; + pointer-events: none; + position: absolute; + top: 100%; + left: 0; + -webkit-transform-origin: 50% 0; + -ms-transform-origin: 50% 0; + transform-origin: 50% 0; + -webkit-transform: scale(0.75) translateY(-21px); + -ms-transform: scale(0.75) translateY(-21px); + transform: scale(0.75) translateY(-21px); + -webkit-transition: all 0.2s cubic-bezier(0.5, 0, 0, 1.25), + opacity 0.15s ease-out; + transition: all 0.2s cubic-bezier(0.5, 0, 0, 1.25), opacity 0.15s ease-out; + z-index: 9; + margin-top: 1px !important; +} + +.mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup:after { + border-bottom: 2px solid #00acf8; + border-right: 2px solid #00acf8; + content: ""; + display: block; + height: 5px; + margin-top: -4px; + pointer-events: none; + position: absolute; + right: 15px; + top: 50%; + -webkit-transform-origin: 66% 66%; + -ms-transform-origin: 66% 66%; + transform-origin: 66% 66%; + -webkit-transform: rotate(45deg); + -ms-transform: rotate(45deg); + transform: rotate(45deg); + -webkit-transition: all 0.15s ease-in-out; + transition: all 0.15s ease-in-out; + width: 5px; +} + +.mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup.open:after { + -webkit-transform: rotate(-135deg); + -ms-transform: rotate(-135deg); + transform: rotate(-135deg); +} + +.mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup.open .list { + opacity: 1; + pointer-events: auto; + -webkit-transform: scale(1) translateY(0); + -ms-transform: scale(1) translateY(0); + transform: scale(1) translateY(0); +} + +.mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup.disabled { + border-color: #ededed; + color: #999; + pointer-events: none; +} + +.mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup.disabled:after { + border-color: #ccc; +} + +.mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup .list:hover .option:not(:hover) { + background-color: transparent !important; +} + +.mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup .option { + cursor: pointer; + font-weight: 400; + list-style: none; + min-height: 40px; + outline: 0; + text-align: left; + position: relative; + font-size: 12px !important; + padding: 1px 12px !important; + margin: 0 !important; + line-height: 22px !important; + min-height: 22px !important; + -webkit-transition: all 0.2s ease-in-out; + transition: all 0.2s ease-in-out; +} + +.mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup .option.focus, +.mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup .option.selected.focus, +.mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup .option:hover { + background-color: #f6f6f6; +} + +.mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup .option.selected { + font-weight: 700; +} + +.mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup .option.disabled { + background-color: transparent; + color: #999; + cursor: default; +} + +.mec-add-event-popup .no-csspointerevents .wn-mec-select-popup .list { + display: none; +} + +.mec-add-event-popup .no-csspointerevents .wn-mec-select-popup.open .list { + display: block; +} + +.mec-add-event-popup .mec-steps-content-container.mec-steps-content-1 { + background: url(../../assets/img/popup/add-event-first-step.png) no-repeat 100% 70%; +} + +.mec-add-event-popup .mec-steps-content-container.mec-steps-content-1 .mec-steps-content.mec-steps-content-1 #mec_event_name { + width: 100%; + height: 46px; + border: none; + border-radius: 3px; + padding-left: 36px; + font-size: 13px; + color: #3c434a; + box-shadow: 0 3px 22px 0 rgba(11, 121, 125, 0.01); +} + +.mec-add-event-popup .mec-steps-content-container.mec-steps-content-1 .mec-steps-content.mec-steps-content-1 #mec_event_name::-webkit-input-placeholder { + color: #b1b2b4; +} + +.mec-add-event-popup .mec-steps-content-container.mec-steps-content-1 .mec-steps-content.mec-steps-content-1 #mec_event_name:-ms-input-placeholder { + color: #b1b2b4; +} + +.mec-add-event-popup .mec-steps-content-container.mec-steps-content-1 .mec-steps-content.mec-steps-content-1 #mec_event_name::placeholder { + color: #b1b2b4; +} + +.mec-add-event-popup .mec-steps-content-container.mec-steps-content-1 .mec-steps-content.mec-steps-content-1:before { + content: ""; + width: 14px; + height: 14px; + background: url(../../assets/img/popup/calendar_icon.png) no-repeat center center; + position: absolute; + top: 17px; + left: 17px; +} + +.mec-add-event-popup .mec-steps-content-container.mec-steps-content-1 .mec-steps-content.mec-steps-content-1 { + top: 210px; + position: absolute; + width: 370px; +} + +.mec-add-event-popup .mec-steps-content-container.mec-steps-content-1 .popup-sh-name-required { + color: red; + display: none; + font-style: italic; + font-size: 12px; + margin-top: 8px; +} + +.mec-add-event-popup .mec-meta-box-colors-container { + background: #fff; + padding: 17px; + border-radius: 3px; + box-shadow: 0 3px 22px rgba(11, 121, 125, 0.01); + margin-top: 15px; +} + +.mec-add-event-popup .wp-picker-container .wp-color-result.button { + border-color: #f1f2f4; + border-radius: 3px; + box-shadow: 0 2px 2px rgba(0, 0, 0, 0.04); +} + +.mec-add-event-popup .mec-recent-color-sec { + display: block !important; + font-size: 12px; + color: #707070; +} + +.mec-add-event-popup .mec-form-row.mec-available-color-row { + border: 2px dashed #dce2e3; + padding: 13px 20px !important; + background: #fcfcfc; + border-radius: 3px; +} + +.mec-add-event-popup .wp-color-result-text { + background: #f7f7f7; + border-radius: unset; + border-left: none; + color: #555; + display: block; + line-height: 2.54545455; + padding: 0 6px; + text-align: center; +} + +.mec-add-event-popup .mec-form-row.mec-available-color-row .mec-color { + width: 10px; + height: 10px; + position: absolute; + left: 11px; + z-index: 99; +} + +.mec-add-event-popup span.mec-color-meta-box-popup { + display: inline-block !important; + width: 20px; + height: 20px; + border-radius: 50px; + position: absolute; + top: 1px; + left: 6px; + z-index: 9; +} + +.mec-add-event-popup span.mec-recent-color-sec-wrap { + width: 20px; + height: 20px; + display: inline-block; + margin-right: 12px; + margin-top: 7px; + margin-left: -6px; + position: relative; +} + +.mec-add-event-popup .mec-steps-content-container.mec-steps-content-2 { + background: url(../../assets/img/popup/sixth-step.png) no-repeat 95% 70%; +} + +.mec-add-event-popup .mec-steps-content-container.mec-steps-content-2 #mec_meta_box_date_form .mec-col-4 { + width: auto; +} + +.mec-add-event-popup .mec-steps-content-container.mec-steps-content-2 #mec_meta_box_date_form .mec-col-4:before { + content: ""; + width: 14px; + height: 14px; + background: url(../../assets/img/popup/calendar_icon.png) no-repeat center center; + position: absolute; + top: 17px; + left: 17px; +} + +.mec-add-event-popup .mec-steps-content-container.mec-steps-content-2 #mec_meta_box_date_form .mec-col-4 input { + padding-left: 36px; + width: 148px; + padding: 22px 17px 22px 34px; +} + +.mec-add-event-popup .mec-steps-content-container.mec-steps-content-2 #mec_meta_box_date_form input#mec_end_date_popup, +.mec-add-event-popup .mec-steps-content-container.mec-steps-content-2 #mec_meta_box_date_form input#mec_start_date_popup, +.mec-add-event-popup .mec-steps-content-container.mec-steps-content-2 #mec_meta_box_date_form select { + height: 46px; + border: none; + border-radius: 3px; + padding-left: 36px; + font-size: 12px; + color: #707070; + box-shadow: 0 3px 22px 0 rgba(11, 121, 125, 0.01); +} + +.mec-add-event-popup .mec-steps-content-container.mec-steps-content-2 #mec_meta_box_date_form input#mec_end_date::placeholder, +.mec-add-event-popup .mec-steps-content-container.mec-steps-content-2 #mec_meta_box_date_form input#mec_start_date::placeholder { + color: #b1b2b4; +} + +.mec-add-event-popup .mec-steps-content-container.mec-steps-content-2 #mec_meta_box_date_form input#mec_end_date::placeholder, +.mec-add-event-popup .mec-steps-content-container.mec-steps-content-2 #mec_meta_box_date_form input#mec_start_date::placeholder { + color: #b1b2b4; +} + +.mec-add-event-popup .mec-steps-content-container.mec-steps-content-2 #mec_meta_box_date_form input#mec_end_date::placeholder, +.mec-add-event-popup .mec-steps-content-container.mec-steps-content-2 #mec_meta_box_date_form input#mec_start_date::placeholder { + color: #b1b2b4; +} + +.mec-add-event-popup .mec-form-row .time-dv { + float: left; + margin-left: -2px; + margin-right: 4px; + margin-top: 12px; + color: #b1b2b4; +} + +.mec-add-event-popup .mec-steps-content.mec-steps-content-2 { + margin-top: 60px; +} + +.mec-add-event-popup .mec-steps-content.mec-steps-content-2 .mec-form-row.mec-all-day-event label { + font-size: 14px; + color: #707070; +} + +.mec-add-event-popup .mec-steps-content.mec-steps-content-2 .mec-form-row.mec-all-day-event { + margin-top: 13px !important; +} + +.mec-add-event-popup .mec-steps-content.mec-steps-content-3, +.mec-add-event-popup .mec-steps-content.mec-steps-content-4 { + margin-top: -9px; +} + +.mec-add-event-popup .mec-steps-content-container.mec-steps-content-3 { + background: url(../../assets/img/popup/fifth-step.png) no-repeat 90% 70%; +} + +.mec-add-event-popup .mec-steps-content-container.mec-steps-content-4 { + background: url(../../assets/img/popup/add-organizer.png) no-repeat 95% 70%; +} + +.nice-select.mec_popup_location_id.wn-mec-select-popup, +.nice-select.mec_popup_organizer_id.wn-mec-select-popup { + position: relative; + width: 200px; + padding-left: 36px; +} + +.nice-select.mec_popup_location_id.wn-mec-select-popup:before { + content: ""; + width: 14px; + height: 14px; + background: url(../../assets/img/popup/pointer.png) no-repeat center center; + position: absolute; + top: 17px; + left: 17px; +} + +.nice-select.mec_popup_organizer_id.wn-mec-select-popup:before { + content: ""; + width: 14px; + height: 14px; + background: url(../../assets/img/popup/pointer.png) no-repeat center center; + position: absolute; + top: 17px; + left: 17px; +} + +#mec_popup_event button#mec_popup_add_location:before, +#mec_popup_event button#mec_popup_add_organizer:before { + content: ""; + width: 15px; + height: 15px; + background: url(../../assets/img/popup/plus.png) no-repeat center center; + position: absolute; + top: 16px; + left: 15px; +} + +.mec-add-event-popup .mec-steps-content-container .nice-select.mec_popup_location_id.wn-mec-select-popup.open .list li, +.mec-add-event-popup .mec-steps-content-container .nice-select.mec_popup_organizer_id.wn-mec-select-popup.open .list li { + line-height: 32px !important; + min-height: 32px !important; +} + +#mec_popup_event .mec-steps-content .mec-tooltip { + bottom: 8px; +} + +#mec-location .mec-form-row span+span.mec-tooltip i, +#mec-organizer .mec-form-row span+span.mec-tooltip i { + margin-top: -18px; +} + +#mec_popup_event .mec-steps-content .mec-tooltip .dashicons-before:before { + color: #008aff; +} + +#mec_popup_event button#mec_organizer_thumbnail_button, +#mec_popup_event button#mec_popup_add_location, +#mec_popup_event button#mec_popup_add_organizer { + background: #008aff; + border-radius: 3px; + border: none; + color: #fff; + width: 146px; + height: 46px; + margin-left: 10px; + box-shadow: 0 3px 3px 0 rgba(0, 138, 255, 0.22); + font-size: 14px; + cursor: pointer; + transition: all 0.2s ease; + outline: 0; + position: relative; + padding-left: 20px; +} + +#mec_popup_event button#mec_organizer_thumbnail_button:hover, +#mec_popup_event button#mec_popup_add_location:hover, +#mec_popup_event button#mec_popup_add_organizer:hover { + background: #000; + box-shadow: 0 5px 10px 0 rgba(0, 0, 0, 0.3); +} + +#mec_popup_event label[for="mec_location_dont_show_map"] { + font-size: 14px; + display: inline-block; +} + +#mec_popup_event input#mec_location_dont_show_map { + margin-top: 9px !important; +} + +#mec_popup_event .wn-mec-select-popup .current { + width: 100%; + display: inline-block; + overflow: hidden; +} + +#mec_popup_event div#mec_location_new_container, +#mec_popup_event div#mec_organizer_new_container { + border-top: 2px dashed #dce2e3; + width: 360px; + padding-top: 25px; + margin-top: 20px; +} + +#mec_popup_event div#mec_location_new_container input, +#mec_popup_event div#mec_organizer_new_container input { + width: 100%; + height: 46px; + border: none; + border-radius: 3px; + padding-left: 17px; + font-size: 12px; + color: #b1b2b4; + box-shadow: 0 3px 22px 0 rgba(11, 121, 125, 0.01); +} + +#mec_popup_event div#mec_location_new_container .description, +#mec_popup_event div#mec_organizer_new_container .description { + border: none; + padding: 0; + margin: 0; + margin-left: 16px; + line-height: 19px; + font-size: 12px; + color: #707070; + font-style: normal; + margin-top: -4px; + display: block; +} + +#mec_popup_event .mec-form-row.mec-lat-lng-row input { + width: 44% !important; +} + +#mec_popup_event .mec-form-row.mec-lat-lng-row input:first-of-type { + margin-right: 10px; +} + +#mec_popup_event div#mec_organizer_new_container { + margin-top: 30px; +} + +#mec_popup_event div#mec_organizer_new_container .mec-form-row:first-of-type .mec-col-6:first-of-type { + margin-right: 14px !important; +} + +#mec_popup_event div#mec_organizer_new_container .mec-form-row:first-of-type .mec-col-6 { + width: 48%; + margin: 0; +} + +#mec_popup_event button#mec_organizer_thumbnail_button:before { + content: ""; + width: 15px; + height: 15px; + background: url(../../assets/img/popup/picture.png) no-repeat center center; + position: absolute; + top: 16px; + left: 15px; +} + +#mec_popup_event button#mec_organizer_thumbnail_button { + width: 96%; + padding-left: 30px; +} + +.mec-add-event-popup .mec-steps-content.mec-steps-content-4 div#mec_organizer_thumbnail_img { + position: absolute; + right: 10px; + top: -20px; +} + +.mec-add-event-popup .mec-steps-content.mec-steps-content-4 div#mec_organizer_thumbnail_img img { + max-width: 110px; +} + +.mec-add-event-popup .mec-steps-content-container.mec-steps-content-5 { + background: url(../../assets/img/popup/fourth-step.png) no-repeat 90% 70%; +} + +.mec-add-event-popup .mec-steps-content-container.mec-steps-content-5 .mec-categories-add-new input { + height: 30px; + border: none; + border-radius: 3px; + padding-left: 10px; + margin-left: 20px; + font-size: 12px; + color: #b1b2b4; + box-shadow: 0 3px 22px 0 rgba(11, 121, 125, 0.01); + width: 186px; + float: right; + margin-top: -4px; +} + +.mec-add-event-popup .mec-steps-content.mec-steps-content-5 { + width: 326px; + margin-top: 48px; +} + +.mec-add-event-popup .mec-steps-content.mec-steps-content-5 .mec-categories-tabs ul li { + display: inline-block; + background: #fff; + border: none; + cursor: pointer; + padding: 12px 18px; + border-radius: 3px; + transition: all 0.3s ease; + outline: 0; + text-align: center; + margin-right: 10px; + height: 42px; + color: #008aff; + font-size: 14px; + box-shadow: 0 3px 22px 0 rgba(11, 121, 125, 0.01); +} + +.mec-add-event-popup .mec-steps-content.mec-steps-content-5 .mec-categories-tabs ul li.mec-categories-tab-selected, +.mec-add-event-popup .mec-steps-content.mec-steps-content-5 .mec-categories-tabs ul li:hover { + background: #008aff; + color: #fff; + box-shadow: 0 3px 3px 0 rgba(0, 138, 255, 0.3); +} + +.mec-add-event-popup .mec-categories-tab-contents { + background: #fff; + padding: 20px; + border: 2px dashed #dce2e3; + margin-bottom: 13px; + margin-top: -5px; +} + +.mec-add-event-popup .mec-categories-tab-contents ul, +.mec-add-event-popup .mec-categories-tab-contents ul li:last-of-type { + margin: 0; +} + +.mec-add-event-popup .mec-categories-tab-contents ul li .children { + margin: 7px 0 7px 30px; +} + +.mec-add-event-popup .mec-categories-tab-contents ul li { + font-size: 14px; + color: #707070; +} + +.mec-add-event-popup .mec-categories-tab-contents.mec-form-row input[type="checkbox"] { + margin-top: 0; +} + +.mec-add-event-popup .mec-categories-tab-contents { + max-height: 200px; + overflow: hidden; + overflow-y: scroll; +} + +.mec-add-event-popup .nice-select.mec_popup_location_id .list, +.mec-add-event-popup .nice-select.mec_popup_organizer_id .list { + max-height: 240px !important; + overflow: hidden !important; + overflow-y: scroll !important; +} + +.mec-add-event-popup .mec-categories-tab-contents::-webkit-scrollbar, +.mec-add-event-popup .nice-select.mec_popup_location_id .list::-webkit-scrollbar, +.mec-add-event-popup .nice-select.mec_popup_organizer_id .list::-webkit-scrollbar, +#mec_popup_event div#mec_location_new_container::-webkit-scrollbar, +#mec_popup_event div#mec_organizer_new_container::-webkit-scrollbar, +#mec_popup_event div#mec_sponsor_new_container::-webkit-scrollbar { + width: 5px; +} + +.mec-add-event-popup .mec-categories-tab-contents::-webkit-scrollbar-track, +.mec-add-event-popup .nice-select.mec_popup_location_id .list::-webkit-scrollbar-track, +.mec-add-event-popup .nice-select.mec_popup_organizer_id .list::-webkit-scrollbar-track, +#mec_popup_event div#mec_location_new_container::-webkit-scrollbar-track, +#mec_popup_event div#mec_organizer_new_container::-webkit-scrollbar-track, +#mec_popup_event div#mec_sponsor_new_container::-webkit-scrollbar-track { + box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.1); +} + +.mec-add-event-popup .mec-categories-tab-contents::-webkit-scrollbar-thumb, +.mec-add-event-popup .nice-select.mec_popup_location_id .list::-webkit-scrollbar-thumb, +.mec-add-event-popup .nice-select.mec_popup_organizer_id .list::-webkit-scrollbar-thumb, +#mec_popup_event div#mec_location_new_container::-webkit-scrollbar-thumb, +#mec_popup_event div#mec_organizer_new_container::-webkit-scrollbar-thumb, +#mec_popup_event div#mec_sponsor_new_container::-webkit-scrollbar-thumb { + background-color: #008aff; + outline: 0 solid #fff; +} + +.mec-add-event-popup span#mec_popup_new_category_button { + cursor: pointer; + position: relative; + padding-left: 18px; + font-size: 14px; +} + +.mec-add-event-popup span#mec_popup_new_category_button:before { + content: ""; + width: 15px; + height: 15px; + background: url(../../assets/img/popup/plus-blue.png) no-repeat center center; + position: absolute; + top: 3px; + left: 0; +} + +.mec-add-event-popup .mec-steps-content-container.mec-steps-content-5 .mec-categories-add-new input::placeholder { + color: #b1b2b4; + font-size: 13px; +} + +.mec-add-event-popup .mec-steps-content-container.mec-steps-content-5 .mec-categories-add-new input::placeholder { + color: #b1b2b4; + font-size: 13px; +} + +.mec-add-event-popup .mec-steps-content-container.mec-steps-content-5 .mec-categories-add-new input::placeholder { + color: #b1b2b4; + font-size: 13px; +} + +.mec-add-event-popup .mec-steps-content-container.mec-steps-content-5 .mec-categories-add-new input { + color: #3c434a; + font-size: 13px; +} + +.mec-add-event-popup .mec-steps-content.mec-steps-content-6.mec-steps-content-active { + margin-top: -10px; + height: 70%; +} + +.mec-add-event-popup .mec-steps-content.mec-steps-content-6 .mce-tinymce.mce-container.mce-panel { + height: 100%; + border: 1px solid #ececec !important; + box-shadow: 0 3px 22px 0 rgba(11, 121, 125, 0.01) !important; + border-radius: 3px !important; + overflow: hidden; +} + +.mec-add-event-popup .mec-steps-content.mec-steps-content-6 .mce-container-body.mce-stack-layout { + height: 100%; + background: #f5f5f5; +} + +.mec-add-event-popup .mec-steps-content.mec-steps-content-6 .mce-container * { + border: none !important; + box-shadow: none !important; +} + +.mec-add-event-popup .mec-steps-content.mec-steps-content-6 .mce-edit-area.mce-container.mce-panel.mce-stack-layout-item { + height: 90%; +} + +.mec-add-event-popup .mec-steps-content.mec-steps-content-6 .mce-statusbar.mce-container.mce-panel.mce-stack-layout-item.mce-last { + display: none !important; +} + +.mec-add-event-popup .mce-edit-area.mce-container.mce-panel.mce-stack-layout-item iframe { + height: 100% !important; +} + +.mec-add-event-popup .mec-steps-content.mec-steps-content-7.mec-steps-content-active { + height: 70%; + background: #fff; + border: 2px dashed #dce2e3; + border-radius: 3px; + text-align: center; + vertical-align: middle; + margin-top: -10px; + position: relative; +} + +.mec-add-event-popup .mec-event-popup-featured-image-wrapper { + display: flex; + justify-content: center; + align-items: center; + height: 100%; +} + +.mec-add-event-popup button#mec_popup_upload_image_button { + background: #008aff; + color: #fff; + box-shadow: 0 3px 3px 0 rgba(0, 138, 255, 0.3); + display: inline-block; + border: none; + cursor: pointer; + padding: 12px 18px; + border-radius: 3px; + transition: all 0.3s ease; + outline: 0; + text-align: center; + height: 42px; + font-size: 14px; + margin-right: 0; +} + +.mec-add-event-popup div#mec_event_popup_featured_image_preview img { + max-height: 300px; + max-width: 740px; + margin-top: 20px; + margin-bottom: 0; +} + +.mec-add-event-popup button#mec_popup_upload_image_button:hover { + background: #000; + box-shadow: 0 3px 3px 0 rgba(0, 0, 0, 0.3); +} + +.mec-add-event-popup .mec-event-popup-featured-image-wrapper span i { + border-radius: 50px; + color: #bb353f; + right: 10px; + top: 10px; + font-size: 30px; + position: absolute; + cursor: pointer; +} + +.mec-add-event-popup .mec-steps-content.mec-steps-content-8 { + height: 100%; +} + +.mec-add-event-popup .mec-steps-content.mec-steps-content-8 .mec-steps-8-results .mec-steps-8-results-wrap { + display: flex; + justify-content: center; + align-items: center; + flex-direction: column; + height: 100%; +} + +.mec-add-event-popup .mec-steps-content.mec-steps-content-8 .mec-steps-8-loading .mec-loader { + left: calc(50% - 2.5em); + top: calc(50% - 2.5em); +} + +.mec-add-event-popup .mec-steps-content.mec-steps-content-8 .mec-steps-8-results { + height: 100%; +} + +.mec-add-event-popup .mec-steps-content.mec-steps-content-8 a.mec-button-view { + display: inline-block; + background: #fff; + border: none; + cursor: pointer; + padding: 12px 22px 12px 36px; + border-radius: 3px; + transition: all 0.3s ease; + outline: 0; + text-align: center; + margin-right: 10px; + height: 46px; + font-size: 14px; + box-shadow: 0 3px 3px 0 rgba(0, 0, 0, 0.04); + text-decoration: none; + color: #000; + position: relative; + line-height: 22px; +} + +.mec-add-event-popup .mec-steps-content.mec-steps-content-8 a.mec-button-view:hover { + background-color: #000; + color: #fff; +} + +.mec-add-event-popup .mec-steps-content.mec-steps-content-8 a.mec-button-view:before { + content: ""; + width: 15px; + height: 15px; + background: url(../../assets/img/popup/eye.png) no-repeat center center; + position: absolute; + top: 16px; + left: 15px; +} + +.mec-add-event-popup .mec-steps-content.mec-steps-content-8 button.mec-button-new { + background: #008aff; + color: #fff; + box-shadow: 0 3px 3px 0 rgba(0, 138, 255, 0.3); + display: inline-block; + border: none; + cursor: pointer; + padding: 11px 22px 11px 36px; + border-radius: 3px; + transition: all 0.3s ease; + outline: 0; + text-align: center; + height: 46px; + font-size: 14px; + margin-right: 0; + position: relative; + line-height: 22px; +} + +.mec-add-event-popup .mec-steps-content.mec-steps-content-8 button.mec-button-new:hover { + background: #000; + box-shadow: 0 3px 3px 0 rgba(0, 0, 0, 0.3); +} + +.mec-add-event-popup .mec-steps-content.mec-steps-content-8 button.mec-button-new:before { + content: ""; + width: 15px; + height: 15px; + background: url(../../assets/img/popup/plus.png) no-repeat center center; + position: absolute; + top: 16px; + left: 15px; +} + +.mec-add-event-popup .mec-steps-content.mec-steps-content-8 .mec-popup-final-buttons { + margin-top: 22px; +} + +.mec-add-event-popup .mec-steps-content.mec-steps-content-8 .mec-steps-8-results-wrap h3 { + font-size: 26px; + font-weight: 400; +} + +.mec-add-event-popup .mec-steps-content-container .mec-time-picker .wn-mec-select-popup { + width: 64px; +} + +.mec-add-event-popup .mec-steps-content-container .mec-time-picker .wn-mec-select-popup .list { + overflow: scroll !important; + height: 288px; + margin-top: 4px !important; + box-shadow: 0 1px 9px rgba(0, 0, 0, 0.1); + border-radius: 0; +} + +.mec-add-event-popup .mec-steps-content-container .mec-time-picker .wn-mec-select-popup .list::-webkit-scrollbar-track { + background-color: #f6f6f6; +} + +.mec-add-event-popup .mec-steps-content-container .mec-time-picker .wn-mec-select-popup .list::-webkit-scrollbar { + width: 3px; + background-color: #f6f6f6; +} + +.mec-add-event-popup .mec-steps-content-container .mec-time-picker .wn-mec-select-popup .list::-webkit-scrollbar-thumb { + background-color: rgba(26, 175, 251, 0.16); +} + +.mec-add-event-popup .mec-steps-content-container .mec-time-picker .wn-mec-select-popup:last-child .list { + overflow: unset !important; + height: unset; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-1 .mec-steps-content.mec-steps-content-1 input[name="shortcode[name]"] { + color: #3c434a !important; +} + +@media (max-width: 1280px) { + + .mec-add-event-popup .lity-container, + .mec-add-shortcode-popup .lity-container { + height: calc(100% - 110px); + margin-bottom: -80px; + } + + .mec-add-event-popup .post-type-mec-events .mec-form-row { + padding-bottom: 12px; + } + + .mec-add-event-popup .mec-steps-panel .mec-add-event-popup .mec-steps-panel, + .mec-add-shortcode-popup .mec-steps-panel .mec-add-event-popup .mec-steps-panel { + padding: 14px; + } + + .mec-add-event-popup .mec-steps-container img, + .mec-add-event-popup .mec-steps-container ul, + .mec-add-shortcode-popup .mec-steps-container img, + .mec-add-shortcode-popup .mec-steps-container ul { + margin-top: 14px; + } + + .mec-add-event-popup .mec-add-event-popup .mec-steps-container ul li:first-of-type, + .mec-add-shortcode-popup .mec-add-event-popup .mec-steps-container ul li:first-of-type { + height: 28px; + } + + .mec-add-event-popup .mec-add-event-popup .mec-steps-container ul li, + .mec-add-shortcode-popup .mec-add-event-popup .mec-steps-container ul li { + height: 46px; + } + + .mec-add-event-popup .mec-add-event-popup .mec-steps-container ul li:after, + .mec-add-event-popup .mec-add-event-popup .mec-steps-container ul li:before, + .mec-add-shortcode-popup .mec-add-event-popup .mec-steps-container ul li:after, + .mec-add-shortcode-popup .mec-add-event-popup .mec-steps-container ul li:before { + height: 12px; + } + + .mec-add-event-popup .mec-steps-content-container.mec-steps-content-1 .mec-steps-content.mec-steps-content-1 { + top: 150px; + } + + #mec_popup_event div#mec_location_new_container, + #mec_popup_event div#mec_organizer_new_container, + #mec_popup_event div#mec_sponsor_new_container { + padding-top: 12px; + margin-top: 12px; + } + + #mec_popup_event div#mec_location_new_container input, + #mec_popup_event div#mec_organizer_new_container input, + #mec_popup_event div#mec_sponsor_new_container input { + margin: 0 0 3px 0; + } +} + +@media (max-width: 960px) { + .mec-steps-content-container { + background-image: unset !important; + } + + #mec_popup_event div#mec_location_new_container, + #mec_popup_event div#mec_organizer_new_container, + #mec_popup_event div#mec_sponsor_new_container, + .mec-add-event-popup .mec-steps-content-container .mec-steps-content, + .mec-add-shortcode-popup .mec-steps-content-container .mec-steps-content { + width: 100% !important; + max-width: 100%; + position: unset !important; + margin: 0 !important; + } + + .mec-add-event-popup .lity-container, + .mec-add-shortcode-popup .lity-container, + .mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-1 .mec-steps-content.mec-steps-content-1 input[name="shortcode[name]"] { + width: 100%; + max-width: 100%; + } + + .mec-add-event-popup .mec-steps-panel, + .mec-add-shortcode-popup .mec-steps-panel { + overflow-x: scroll; + padding: 14px; + } + + .mec-add-event-popup .mec-steps-header, + .mec-add-shortcode-popup .mec-steps-header { + margin-bottom: 30px; + } + + .mec-add-event-popup .mec-steps-header span.mec-steps-header-add-text, + .mec-add-shortcode-popup .mec-steps-header span.mec-steps-header-add-text { + display: block; + margin-top: 10px; + width: 100%; + } + + .mec-add-event-popup .mec-col-4, + .mec-add-shortcode-popup .mec-col-4 { + width: 100% !important; + max-width: 100% !important; + } + + .mec-add-event-popup #mec_popup_event button#mec_organizer_thumbnail_button, + .mec-add-event-popup #mec_popup_event button#mec_popup_add_location, + .mec-add-event-popup #mec_popup_event button#mec_popup_add_organizer, + .mec-add-shortcode-popup #mec_popup_event button#mec_organizer_thumbnail_button, + .mec-add-shortcode-popup #mec_popup_event button#mec_popup_add_location, + .mec-add-shortcode-popup #mec_popup_event button#mec_popup_add_organizer { + margin: 10px 0 0 0; + } + + .mec-add-event-popup .mec-col-1, + .mec-add-event-popup .mec-col-10, + .mec-add-event-popup .mec-col-11, + .mec-add-event-popup .mec-col-12, + .mec-add-event-popup .mec-col-2, + .mec-add-event-popup .mec-col-3, + .mec-add-event-popup .mec-col-4, + .mec-add-event-popup .mec-col-5, + .mec-add-event-popup .mec-col-6, + .mec-add-event-popup .mec-col-7, + .mec-add-event-popup .mec-col-8, + .mec-add-event-popup .mec-col-9, + .mec-add-shortcode-popup .mec-col-1, + .mec-add-shortcode-popup .mec-col-10, + .mec-add-shortcode-popup .mec-col-11, + .mec-add-shortcode-popup .mec-col-12, + .mec-add-shortcode-popup .mec-col-2, + .mec-add-shortcode-popup .mec-col-3, + .mec-add-shortcode-popup .mec-col-4, + .mec-add-shortcode-popup .mec-col-5, + .mec-add-shortcode-popup .mec-col-6, + .mec-add-shortcode-popup .mec-col-7, + .mec-add-shortcode-popup .mec-col-8, + .mec-add-shortcode-popup .mec-col-9 { + margin: 0 0 10px 0; + } + + .mec-add-event-popup .mec-steps-content h3, + .mec-add-shortcode-popup .mec-steps-content h3 { + font-size: 18px !important; + } + + .mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-2 .mec-steps-content.mec-steps-content-2 ul, + .mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-3 .mec-skin-styles { + height: 480px; + width: 100%; + } +} + +@media (max-width: 320px) { + + .mec-add-event-popup .mec-steps-container, + .mec-add-shortcode-popup .mec-steps-container { + display: none; + } + + .mec-add-event-popup .mec-steps-panel, + .mec-add-shortcode-popup .mec-steps-panel { + width: 100% !important; + } +} + +#mec_popup_event input[type="checkbox"] { + margin-right: 9px; +} + +#mec_popup_event input#mec_location_dont_show_map { + margin-top: 0 !important; +} + +#mec_popup_settings #mec_next_previous_events_container_toggle label, +#mec_popup_settings #mec_related_events_container_toggle label { + padding: 0; +} + +#mec_popup_event input[type="checkbox"]:checked, +#mec_popup_event input[type="radio"]:checked, +#mec_popup_settings input[type="checkbox"]:checked, +#mec_popup_settings input[type="radio"]:checked, +#mec_popup_shortcode input[type="checkbox"]:checked, +#mec_popup_shortcode input[type="radio"]:checked { + background: #64e385; + border-color: #64e385; +} + +#mec_popup_event input[type="checkbox"]:checked:before, +#mec_popup_event input[type="radio"]:checked:before, +#mec_popup_settings input[type="checkbox"]:checked:before, +#mec_popup_settings input[type="radio"]:checked:before, +#mec_popup_shortcode input[type="checkbox"]:checked:before, +#mec_popup_shortcode input[type="radio"]:checked:before { + content: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIxNC42ODgiIHZpZXdCb3g9IjAgMCAyMCAxNC42ODgiPg0KICA8ZyBpZD0idGlja18xXyIgZGF0YS1uYW1lPSJ0aWNrICgxKSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAtNjcuOTk4KSI+DQogICAgPGcgaWQ9Ikdyb3VwXzEiIGRhdGEtbmFtZT0iR3JvdXAgMSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCA2Ny45OTcpIj4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzEiIGRhdGEtbmFtZT0iUGF0aCAxIiBkPSJNMTkuNzA3LDY4LjI5YTEsMSwwLDAsMC0xLjQxNCwwTDYuMzEyLDgwLjI3MSwxLjcwNyw3NS42NjZBMSwxLDAsMCwwLC4yOTIsNzcuMDhMNS42LDgyLjM5MmExLDEsMCwwLDAsMS40MTQsMEwxOS43MDcsNjkuN0ExLDEsMCwwLDAsMTkuNzA3LDY4LjI5WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAtNjcuOTk3KSIgZmlsbD0iI2ZmZiIvPg0KICAgIDwvZz4NCiAgPC9nPg0KPC9zdmc+DQo="); + line-height: 16px; + width: 15px; + float: none; + margin: 2px; + display: block; +} + +#mec_popup_shortcode .mec-steps-content.mec-steps-content-4 label input[type="radio"]:before { + background: unset; + margin: -2px 0 0 0; +} + +.mec-add-event-popup .mec-steps-content.mec-steps-content-5 { + width: 366px; + margin-top: 48px; +} + +#mec_popup_event div#mec_location_new_container, +#mec_popup_event div#mec_organizer_new_container, +#mec_popup_event div#mec_sponsor_new_container { + border-top: 2px dashed #dce2e3; + width: 375px; + padding-top: 25px; + margin-top: 0; + overflow-y: scroll; + overflow-x: hidden; + max-height: 240px; +} + +#mec_popup_event div#mec_location_new_container .mec-form-row, +#mec_popup_event div#mec_organizer_new_container .mec-form-row, +#mec_popup_event div#mec_sponsor_new_container .mec-form-row { + padding-bottom: 20px; +} + +#mec_popup_event div#mec_location_new_container .description, +#mec_popup_event div#mec_organizer_new_container .description, +#mec_popup_event div#mec_sponsor_new_container .description { + margin: 9px 0; +} + +#mec_popup_event div#mec_location_new_container .mec-form-row.mec-thumbnail-row, +#mec_popup_event div#mec_organizer_new_container .mec-form-row.mec-thumbnail-row, +#mec_popup_event div#mec_sponsor_new_container .mec-form-row.mec-thumbnail-row { + padding: 0; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-5 .mec-steps-content.mec-steps-content-5 .mec-switcher div:last-of-type label { + position: absolute; + top: -12px; + max-width: 52px; + width: 100%; + height: 30px; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-5 .mec-switcher input+label { + background: #e5e9ee; + box-shadow: unset; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-5 .mec-switcher input+label:after { + margin-left: 0; + margin-top: -1px; + border-color: #e5e9ee; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-5 .mec-switcher input[value="1"]:checked+label, +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-5 .mec-switcher input[value="1"]:checked+label:before { + box-shadow: 2px 2px 12px -2px #4fdc73 inset; + position: relative; + background: #64e385; + border-color: #64e385; +} + +.lity.mec-add-event-popup .lity-content, +.lity.mec-settings .lity-content { + box-shadow: 0 3px 20px 0 rgb(91 188 190 / 55%); + border-radius: 10px; + height: 100%; + overflow: hidden; +} + +.mec-settings .lity-container { + width: 930px; + height: 620px; + max-width: unset; +} + +#mec_popup_settings #mec_next_previous_events_container_toggle label:first-child, +#mec_popup_settings #mec_related_events_container_toggle label:first-child { + display: block; + margin: 0 0 20px 0; +} + +#mec_popup_event .mec-categories-tab-contents, +#mec_popup_settings #mec_settings_weekdays .mec-box, +#mec_popup_settings #mec_settings_weekends .mec-box { + background: rgb(220 226 227 / 0.3); +} + +#mec_popup_settings .mec-switcher input+label { + max-width: 62px !important; + width: 100%; + height: 33px; +} + +#mec_popup_settings .mec-image-select-wrap li input:checked+span:after { + padding: 5px; +} + +.ac-mec-events.ac-search-enabled .tablenav .ac-search> :not(#ac-s).lity-hide { + display: none; +} + +.tablenav .actions .input-field { + float: left; + margin-right: 6px; +} + +.tablenav .actions .input-field .select2-selection { + height: 30px; +} + +.mec-go-pro-content-title { + font-size: 20px; + font-weight: 600; + margin-bottom: 12px; +} + +.mec-go-pro-features-wrap p { + font-size: 14px; +} + +.mec-go-pro-features-wrap .mec-addons-notification-box-content { + width: calc(100% - 590px); + display: inline-block; + padding-left: 20px; +} + +.mec-go-pro-features-wrap ul { + float: left; + width: 50%; + margin: 0 0 12px; +} + +.mec-go-pro-features-wrap ul li { + margin-bottom: 1px; + font-size: 13px; + color: #717479; + padding-left: 18px; + position: relative; +} + +.mec-go-pro-features-wrap ul li:before { + position: absolute; + left: -1px; + top: 6px; + color: #36da74; + font-size: 13px; + font-weight: 700; + vertical-align: middle; + font-family: simple-line-icons; + border-radius: 50%; + padding: 0; + width: 13px; + height: 13px; + line-height: 13px; + z-index: 3; + background: rgba(64, 241, 147, 0.12); + content: "\e080"; +} + +/* +.post-type-mec-books.taxonomy-mec_coupon .metabox-prefs .screen-options label, +.post-type-mec-events.taxonomy-mec_category .metabox-prefs .screen-options label, +.post-type-mec-events.taxonomy-mec_label .metabox-prefs .screen-options label, +.post-type-mec-events.taxonomy-post_tag .metabox-prefs .screen-options label, +.taxonomy-mec_location .metabox-prefs .screen-options label, +.taxonomy-mec_organizer .metabox-prefs .screen-options label, +.taxonomy-mec_speaker .metabox-prefs .screen-options label, +.taxonomy-mec_sponsor .metabox-prefs .screen-options label { + margin-top: -15px; +} + +.post-type-mec-books.taxonomy-mec_coupon #mec_thumbnail_img img, +.post-type-mec-events.taxonomy-mec_category #mec_thumbnail_img img, +.post-type-mec-events.taxonomy-mec_label #mec_thumbnail_img img, +.post-type-mec-events.taxonomy-post_tag #mec_thumbnail_img img, +.taxonomy-mec_location #mec_thumbnail_img img, +.taxonomy-mec_organizer #mec_thumbnail_img img, +.taxonomy-mec_speaker #mec_thumbnail_img img, +.taxonomy-mec_sponsor #mec_thumbnail_img img { + margin: 0 0 20px 0; + border: solid 1px #ddd; + border-radius: 2px; +} + +.post-type-mec-books.taxonomy-mec_coupon .form-wrap label, +.post-type-mec-events.taxonomy-mec_category .form-wrap label, +.post-type-mec-events.taxonomy-mec_label .form-wrap label, +.post-type-mec-events.taxonomy-post_tag .form-wrap label, +.taxonomy-mec_location .form-wrap label, +.taxonomy-mec_organizer .form-wrap label, +.taxonomy-mec_speaker .form-wrap label, +.taxonomy-mec_sponsor .form-wrap label { + padding: 0; + margin: 10px 0; +} + +.post-type-mec-books.taxonomy-mec_coupon input[type='number'], +.post-type-mec-books.taxonomy-mec_coupon input[type='search'], +.post-type-mec-books.taxonomy-mec_coupon input[type='text'], +.post-type-mec-books.taxonomy-mec_coupon input[type='url'], +.post-type-mec-books.taxonomy-mec_coupon select, +.post-type-mec-books.taxonomy-mec_coupon textarea, +.post-type-mec-events.taxonomy-mec_category input[type='number'], +.post-type-mec-events.taxonomy-mec_category input[type='search'], +.post-type-mec-events.taxonomy-mec_category input[type='text'], +.post-type-mec-events.taxonomy-mec_category input[type='url'], +.post-type-mec-events.taxonomy-mec_category select, +.post-type-mec-events.taxonomy-mec_category textarea, +.post-type-mec-events.taxonomy-mec_label input[type='number'], +.post-type-mec-events.taxonomy-mec_label input[type='search'], +.post-type-mec-events.taxonomy-mec_label input[type='text'], +.post-type-mec-events.taxonomy-mec_label input[type='url'], +.post-type-mec-events.taxonomy-mec_label select, +.post-type-mec-events.taxonomy-mec_label textarea, +.post-type-mec-events.taxonomy-post_tag input[type='number'], +.post-type-mec-events.taxonomy-post_tag input[type='search'], +.post-type-mec-events.taxonomy-post_tag input[type='text'], +.post-type-mec-events.taxonomy-post_tag input[type='url'], +.post-type-mec-events.taxonomy-post_tag select, +.post-type-mec-events.taxonomy-post_tag textarea, +.taxonomy-mec_location input[type='number'], +.taxonomy-mec_location input[type='search'], +.taxonomy-mec_location input[type='text'], +.taxonomy-mec_location input[type='url'], +.taxonomy-mec_location select, +.taxonomy-mec_location textarea, +.taxonomy-mec_organizer input[type='number'], +.taxonomy-mec_organizer input[type='search'], +.taxonomy-mec_organizer input[type='text'], +.taxonomy-mec_organizer input[type='url'], +.taxonomy-mec_organizer select, +.taxonomy-mec_organizer textarea, +.taxonomy-mec_speaker input[type='number'], +.taxonomy-mec_speaker input[type='search'], +.taxonomy-mec_speaker input[type='text'], +.taxonomy-mec_speaker input[type='url'], +.taxonomy-mec_speaker select, +.taxonomy-mec_speaker textarea, +.taxonomy-mec_sponsor input[type='number'], +.taxonomy-mec_sponsor input[type='search'], +.taxonomy-mec_sponsor input[type='text'], +.taxonomy-mec_sponsor input[type='url'], +.taxonomy-mec_sponsor select, +.taxonomy-mec_sponsor textarea { + border-radius: 5px; + min-height: 38px; + border: none; + background-color: #fff; + box-shadow: inset 0 1px 2px rgb(0 0 0 / 7%); +} + +.post-type-mec-books.taxonomy-mec_coupon select, +.post-type-mec-events.taxonomy-mec_category select, +.post-type-mec-events.taxonomy-mec_label select, +.post-type-mec-events.taxonomy-post_tag select, +.taxonomy-mec_location select, +.taxonomy-mec_organizer select, +.taxonomy-mec_speaker select, +.taxonomy-mec_sponsor select { + appearance: none; + -webkit-appearance: none; + -moz-appearance: none; + cursor: pointer; + min-height: 39px; + line-height: 39px; + background-color: #fff; + border-radius: 2px; + padding-left: 8px; + box-shadow: 0 1px 3px rgb(0 0 0 / 2%); + transition: all 0.23s ease; + background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0ZWQgYnkgSWNvTW9vbi5pbyAtLT4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHdpZHRoPSIxNyIgaGVpZ2h0PSIxNyIgdmlld0JveD0iMCAwIDE3IDE3Ij4KPGc+CjwvZz4KCTxwYXRoIGQ9Ik0xNi4zNTQgNS4wNzVsLTcuODU1IDcuODU0LTcuODUzLTcuODU0IDAuNzA3LTAuNzA3IDcuMTQ1IDcuMTQ2IDcuMTQ4LTcuMTQ3IDAuNzA4IDAuNzA4eiIgZmlsbD0iIzAwMDAwMCIgLz4KPC9zdmc+Cg==); + background-repeat: no-repeat; + background-size: 26px 10px; + background-position: right center; + min-width: 160px; + border: 1px solid #e6e9eb; +} + +.post-type-mec-books.taxonomy-mec_coupon table.fixed, +.post-type-mec-events.taxonomy-mec_category table.fixed, +.post-type-mec-events.taxonomy-mec_label table.fixed, +.post-type-mec-events.taxonomy-post_tag table.fixed, +.taxonomy-mec_location table.fixed, +.taxonomy-mec_organizer table.fixed, +.taxonomy-mec_speaker table.fixed, +.taxonomy-mec_sponsor table.fixed { + margin-top: 21px; +} + +.taxonomy-mec_category .wp-color-result-text { + all: unset; + color: #fff; + font-weight: 500; + line-height: 1.4; +} + +.taxonomy-mec_category .wp-picker-input-wrap label { + margin-top: 0 !important; +} + +.post-type-mec-books.taxonomy-mec_coupon textarea, +.post-type-mec-events.taxonomy-mec_category textarea, +.post-type-mec-events.taxonomy-mec_label textarea, +.post-type-mec-events.taxonomy-post_tag textarea, +.taxonomy-mec_location textarea, +.taxonomy-mec_organizer textarea, +.taxonomy-mec_speaker textarea, +.taxonomy-mec_sponsor textarea { + min-height: 86px; +} + +.post-type-mec-books.taxonomy-mec_coupon .button, +.post-type-mec-books.taxonomy-mec_coupon .button-secondary, +.post-type-mec-events.taxonomy-mec_category .button, +.post-type-mec-events.taxonomy-mec_category .button-secondary, +.post-type-mec-events.taxonomy-mec_label .button, +.post-type-mec-events.taxonomy-mec_label .button-secondary, +.post-type-mec-events.taxonomy-post_tag .button, +.post-type-mec-events.taxonomy-post_tag .button-secondary, +.taxonomy-mec_location .button, +.taxonomy-mec_location .button-secondary, +.taxonomy-mec_organizer .button, +.taxonomy-mec_organizer .button-secondary, +.taxonomy-mec_speaker .button, +.taxonomy-mec_sponsor .button, +.taxonomy-mec_sponsor .button-secondary { + color: #fff; + font-weight: 500; + border-radius: 60px; + box-shadow: 0 0 0 4px rgb(56 213 237 / 1%); + text-shadow: none; + background: #38d5ed; + border: none; + transition: 0.24s; + line-height: 1.4; + padding: 9px 36px 12px; +} + +.post-type-mec-books.taxonomy-mec_coupon .mec_upload_image_button, +.post-type-mec-events.taxonomy-mec_category .mec_upload_image_button, +.post-type-mec-events.taxonomy-mec_label .mec_upload_image_button, +.post-type-mec-events.taxonomy-post_tag .mec_upload_image_button, +.taxonomy-mec_location .mec_upload_image_button, +.taxonomy-mec_organizer .mec_upload_image_button, +.taxonomy-mec_speaker .mec_upload_image_button, +.taxonomy-mec_sponsor .mec_upload_image_button { + margin-bottom: 20px; +} + +.post-type-mec-books.taxonomy-mec_coupon .button-secondary:focus, +.post-type-mec-books.taxonomy-mec_coupon .button-secondary:hover, +.post-type-mec-books.taxonomy-mec_coupon .button.focus, +.post-type-mec-books.taxonomy-mec_coupon .button:focus, +.post-type-mec-books.taxonomy-mec_coupon .button:hover, +.post-type-mec-events.taxonomy-mec_category .button-secondary:focus, +.post-type-mec-events.taxonomy-mec_category .button-secondary:hover, +.post-type-mec-events.taxonomy-mec_category .button.focus, +.post-type-mec-events.taxonomy-mec_category .button:focus, +.post-type-mec-events.taxonomy-mec_category .button:hover, +.post-type-mec-events.taxonomy-mec_label .button-secondary:focus, +.post-type-mec-events.taxonomy-mec_label .button-secondary:hover, +.post-type-mec-events.taxonomy-mec_label .button.focus, +.post-type-mec-events.taxonomy-mec_label .button:focus, +.post-type-mec-events.taxonomy-mec_label .button:hover, +.post-type-mec-events.taxonomy-post_tag .button-secondary:focus, +.post-type-mec-events.taxonomy-post_tag .button-secondary:hover, +.post-type-mec-events.taxonomy-post_tag .button.focus, +.post-type-mec-events.taxonomy-post_tag .button:focus, +.post-type-mec-events.taxonomy-post_tag .button:hover, +.taxonomy-mec_location .button-secondary:focus, +.taxonomy-mec_location .button-secondary:hover, +.taxonomy-mec_location .button.focus, +.taxonomy-mec_location .button:focus, +.taxonomy-mec_location .button:hover, +.taxonomy-mec_organizer .button-secondary:focus, +.taxonomy-mec_organizer .button-secondary:hover, +.taxonomy-mec_organizer .button.focus, +.taxonomy-mec_organizer .button:focus, +.taxonomy-mec_organizer .button:hover, +.taxonomy-mec_speaker .button-secondary:focus, +.taxonomy-mec_speaker .button-secondary:hover, +.taxonomy-mec_speaker .button.focus, +.taxonomy-mec_speaker .button:focus, +.taxonomy-mec_speaker .button:hover, +.taxonomy-mec_sponsor .button-secondary:focus, +.taxonomy-mec_sponsor .button-secondary:hover, +.taxonomy-mec_sponsor .button.focus, +.taxonomy-mec_sponsor .button:focus, +.taxonomy-mec_sponsor .button:hover { + background: #26bbd2; + box-shadow: 0 0 0 4px rgb(56 213 237 / 15%); + cursor: pointer; + color: #fff; +} */ + +.post-type-mec-events #TB_window { + height: 470px !important; + top: calc(50% - 235px) !important; +} + +.post-type-mec-events #TB_ajaxContent { + width: calc(100% - 30px) !important; +} + +.m-e-calendar_page_MEC-support #wpwrap .welcome-content .fserv-container .fserv-form-description { + position: relative !important; +} + +.taxonomy-mec_category #TB_window { + overflow: hidden; +} + +@media (max-width: 480px) { + + .m-e-calendar_page_MEC-support #wpwrap .welcome-content .fserv-container .fserv-form-description, + .m-e-calendar_page_MEC-support #wpwrap .welcome-content .fserv-container form { + padding-left: 90px !important; + } + + .m-e-calendar_page_MEC-support #wpwrap .welcome-content .fserv-container form .fserv-field { + width: 40% !important; + } + + .m-e-calendar_page_MEC-support #wpwrap .welcome-content .fserv-container:before { + top: 100px; + left: 10px; + } +} + +.post-type-mec-events.taxonomy-mec_label .button.wp-color-result { + background: 0 0; + text-align: right; + padding: 0 0 0 32px; + border-radius: 4px; + box-shadow: unset; + border: 1px solid #ddd; +} + +.post-type-mec-events.taxonomy-mec_label .button.wp-color-result .wp-color-result-text { + height: 30px; +} + +.post-type-mec-events.taxonomy-mec_label .wp-picker-container input[type="text"].wp-color-picker { + width: 70px; + margin-top: -10px; + height: 32px; +} + +.post-type-mec-events.taxonomy-mec_label .wp-picker-default { + height: 32px; + padding-top: 2px; + padding-bottom: 2px; +} + +.post-type-mec-events.taxonomy-mec_label .wp-picker-container .iris-picker { + margin-top: -10px; +} + +.mec-admin-dark-mode #mec-wrap .nav-tab-wrapper .nav-tab, +.mec-admin-dark-mode #mec-wrap .nav-tab-wrapper, +.mec-admin-dark-mode.m-e-calendar_page_MEC-ix #mec-wrap .nav-tab-wrapper { + background: #1f1f1f; +} + +.mec-admin-dark-mode.m-e-calendar_page_MEC-ix #mec-wrap .nav-tab-wrapper, +.mec-admin-dark-mode.m-e-calendar_page_MEC-ix #mec-wrap .nav-tab-wrapper .nav-tab, +.mec-admin-dark-mode.m-e-calendar_page_MEC-ix #mec-wrap .mec-container { + border-color: #353535; +} + +.mec-admin-dark-mode.m-e-calendar_page_MEC-ix #mec-wrap .nav-tab-wrapper .nav-tab-active { + background: #404040 !important; +} + +.mec-admin-dark-mode.m-e-calendar_page_MEC-ix #mec-wrap .nav-tab-wrapper .nav-tab:not(.nav-tab-active):after { + background: #4f4f4f; +} + +.mec-admin-dark-mode.m-e-calendar_page_MEC-ix #mec-wrap .nav-tab-wrapper .nav-tab-active:after { + border-color: #404040 transparent transparent; +} + +.mec-admin-dark-mode.m-e-calendar_page_MEC-ix #mec-wrap .nav-tab-wrapper .nav-tab-active:before { + border-color: #404040 transparent transparent; +} + +.mec-admin-dark-mode #mec_bfixed_form_fields li, +.mec-admin-dark-mode #mec_calendar_filter, +.mec-admin-dark-mode #mec_calendar_filter .mec-add-booking-tabs-left, +.mec-admin-dark-mode #mec_calendar_filter .mec-add-booking-tabs-wrap, +.mec-admin-dark-mode #mec_calendar_filter .mec-add-event-tabs-left, +.mec-admin-dark-mode #mec_calendar_filter .mec-add-event-tabs-wrap, +.mec-admin-dark-mode #mec_calendar_filter .mec-create-shortcode-tabs-left, +.mec-admin-dark-mode #mec_metabox_booking, +.mec-admin-dark-mode #mec_metabox_booking .mec-add-booking-tabs-left, +.mec-admin-dark-mode #mec_metabox_booking .mec-add-booking-tabs-wrap, +.mec-admin-dark-mode #mec_metabox_booking .mec-add-event-tabs-left, +.mec-admin-dark-mode #mec_metabox_booking .mec-add-event-tabs-wrap, +.mec-admin-dark-mode #mec_metabox_booking .mec-create-shortcode-tabs-left, +.mec-admin-dark-mode #mec_metabox_details, +.mec-admin-dark-mode #mec_metabox_details .mec-add-booking-tabs-left, +.mec-admin-dark-mode #mec_metabox_details .mec-add-booking-tabs-wrap, +.mec-admin-dark-mode #mec_metabox_details .mec-add-event-tabs-left, +.mec-admin-dark-mode #mec_metabox_details .mec-add-event-tabs-wrap, +.mec-admin-dark-mode #mec_metabox_details .mec-add-event-tabs-wrap .select2-container, +.mec-admin-dark-mode #mec_metabox_details .mec-create-shortcode-tab-content .select2-container, +.mec-admin-dark-mode #mec_metabox_details .mec-create-shortcode-tabs-left, +.mec-admin-dark-mode #webnus-dashboard .mec-pro-notice .info-msg, +.mec-admin-dark-mode .mec-attendees-wrapper .mec-attendees-list .w-clearfix:nth-child(odd), +.mec-admin-dark-mode .w-box, +.mec-admin-dark-mode .w-box-content pre, +.mec-admin-dark-mode .w-clearfix.w-box.mec-addons-notification-box-wrap span, +.mec-admin-dark-mode .w-clearfix.w-box.mec-cmsg-2-notification-box-wrap span, +.mec-admin-dark-mode .w-clearfix.w-box.mec-cmsg-notification-box-wrap span, +.mec-admin-dark-mode .wns-be-main, +.mec-admin-dark-mode .wns-be-main .mec-container, +.mec-admin-dark-mode .wns-be-sidebar .wns-be-group-menu>li.active>a, +.mec-admin-dark-mode.m-e-calendar_page_MEC-ix .mec-container, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_bfixed_form_fields button, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_bfixed_form_fields li, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_event_form_fields button, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_event_form_fields li, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_reg_form_field_types button, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_reg_form_fields li, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wns-be-container #wns-be-content, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wns-be-container #wns-be-infobar, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wns-be-main, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wp-editor-container, +.mec-admin-dark-mode.m-e-calendar_page_MEC-support #webnus-dashboard .mec-pro-notice .info-msg, +.mec-admin-dark-mode.post-type-mec-books #major-publishing-actions, +.mec-admin-dark-mode.post-type-mec-books #screen-meta, +.mec-admin-dark-mode.post-type-mec-books #screen-meta-links .show-settings, +.mec-admin-dark-mode.post-type-mec-books .postbox, +.mec-admin-dark-mode.post-type-mec-events #major-publishing-actions, +.mec-admin-dark-mode.post-type-mec-events #mec_event_form_fields li, +.mec-admin-dark-mode.post-type-mec-events #mec_reg_form_fields li, +.mec-admin-dark-mode.post-type-mec-events #post-status-info, +.mec-admin-dark-mode.post-type-mec-events #screen-meta, +.mec-admin-dark-mode.post-type-mec-events #screen-meta-links .show-settings, +.mec-admin-dark-mode.post-type-mec-events .categorydiv div.tabs-panel, +.mec-admin-dark-mode.post-type-mec-events .components-popover__content, +.mec-admin-dark-mode.post-type-mec-events .customlinkdiv div.tabs-panel, +.mec-admin-dark-mode.post-type-mec-events .postbox, +.mec-admin-dark-mode.post-type-mec-events .posttypediv div.tabs-panel, +.mec-admin-dark-mode.post-type-mec-events .taxonomydiv div.tabs-panel, +.mec-admin-dark-mode.post-type-mec-events .wp-switch-editor, +.mec-admin-dark-mode.post-type-mec-events .wp-tab-active, +.mec-admin-dark-mode.post-type-mec-events .wp-tab-panel, +.mec-admin-dark-mode.post-type-mec-events div.mce-panel, +.mec-admin-dark-mode.post-type-mec-events div.mce-toolbar-grp, +.mec-admin-dark-mode.post-type-mec-events ul.add-menu-item-tabs li.tabs, +.mec-admin-dark-mode.post-type-mec-events ul.category-tabs li.tabs, +.mec-admin-dark-mode.post-type-mec_calendars #major-publishing-actions, +.mec-admin-dark-mode.post-type-mec_calendars #post-status-info, +.mec-admin-dark-mode.post-type-mec_calendars #screen-meta, +.mec-admin-dark-mode.post-type-mec_calendars #screen-meta-links .show-settings, +.mec-admin-dark-mode.post-type-mec_calendars .categorydiv div.tabs-panel, +.mec-admin-dark-mode.post-type-mec_calendars .customlinkdiv div.tabs-panel, +.mec-admin-dark-mode.post-type-mec_calendars .postbox, +.mec-admin-dark-mode.post-type-mec_calendars .posttypediv div.tabs-panel, +.mec-admin-dark-mode.post-type-mec_calendars .taxonomydiv div.tabs-panel, +.mec-admin-dark-mode.post-type-mec_calendars .wp-switch-editor, +.mec-admin-dark-mode.post-type-mec_calendars .wp-tab-active, +.mec-admin-dark-mode.post-type-mec_calendars .wp-tab-panel, +.mec-admin-dark-mode.post-type-mec_calendars div.mce-panel, +.mec-admin-dark-mode.post-type-mec_calendars div.mce-toolbar-grp, +.mec-admin-dark-mode.post-type-mec_calendars ul.add-menu-item-tabs li.tabs, +.mec-admin-dark-mode.post-type-mec_calendars ul.category-tabs li.tabs { + background: #1f1f1f; + color: #fff; +} + + +.mec-admin-dark-mode .mec-form-row .mec-box, +.mec-admin-dark-mode .mec-form-row input[type="checkbox"], +.mec-admin-dark-mode .mec-form-row ul.mec-message-categories li ul, +.mec-admin-dark-mode .mec-meta-box-fields .mec-box, +.mec-admin-dark-mode.m-e-calendar_page_MEC-support #webnus-dashboard .mec-faq-accordion-trigger a { + background: #333; + border-color: #353535; + box-shadow: 0 1px 6px -2px #000; +} + +.mec-admin-dark-mode .wns-be-container .dpr-btn.dpr-save-btn, +.mec-admin-dark-mode #wpwrap .mec-button-primary { + box-shadow: none; + background: #5e7a65; +} + +.mec-admin-dark-mode .wns-be-container .dpr-btn.dpr-save-btn:hover, +.mec-admin-dark-mode #wpwrap .mec-button-primary:hover { + box-shadow: none; + background: #559164; + border-color: none; +} + +.mec-admin-dark-mode #mec-wrap .nav-tab-wrapper .nav-tab { + border-radius: 7px; +} + +.mec-admin-dark-mode #mec_bfixed_form_fields, +.mec-admin-dark-mode #mec_bfixed_form_fields #mec_bfixed_form_fields li, +.mec-admin-dark-mode #mec_calendar_filter .mec-add-booking-tabs-left a, +.mec-admin-dark-mode #mec_calendar_filter .mec-add-event-tabs-left a, +.mec-admin-dark-mode #mec_calendar_filter .mec-create-shortcode-tabs-left a, +.mec-admin-dark-mode #mec_metabox_booking .mec-add-booking-tabs-left a, +.mec-admin-dark-mode #mec_metabox_booking .mec-add-event-tabs-left a, +.mec-admin-dark-mode #mec_metabox_booking .mec-create-shortcode-tabs-left a, +.mec-admin-dark-mode #mec_metabox_details .mec-add-booking-tabs-left a, +.mec-admin-dark-mode #mec_metabox_details .mec-add-event-tabs-left a, +.mec-admin-dark-mode #mec_metabox_details .mec-create-shortcode-tabs-left a, +.mec-admin-dark-mode.m-e-calendar_page_MEC-ix .mec-form-row.mec-syn-schedule, +.mec-admin-dark-mode.post-type-mec-events #mec_event_form_fields, +.mec-admin-dark-mode.post-type-mec-events #mec_reg_form_fields, +.mec-admin-dark-mode.post-type-mec-events .select2-search--dropdown, +.mec-admin-dark-mode.post-type-mec_calendars .select2-search--dropdown { + background: #282828; + border-color: #353535; +} + +.mec-admin-dark-mode .select2-container--default .select2-selection--multiple .select2-selection__choice { + color: #000; +} + +.mec-admin-dark-mode.post-type-mec-books ul#adminmenu a.wp-has-current-submenu:after, +.mec-admin-dark-mode.post-type-mec-books ul#adminmenu>li.current>a.current:after, +.mec-admin-dark-mode.post-type-mec-events ul#adminmenu a.wp-has-current-submenu:after, +.mec-admin-dark-mode.post-type-mec-events ul#adminmenu>li.current>a.current:after, +.mec-admin-dark-mode.post-type-mec_calendars ul#adminmenu a.wp-has-current-submenu:after, +.mec-admin-dark-mode.post-type-mec_calendars ul#adminmenu>li.current>a.current:after, +.mec-admin-dark-mode.toplevel_page_mec-intro ul#adminmenu a.wp-has-current-submenu:after, +.mec-admin-dark-mode.toplevel_page_mec-intro ul#adminmenu>li.current>a.current:after { + border-right-color: #23282d; +} + +.mec-admin-dark-mode #mec_calendar_filter .mec-add-booking-tabs-left a.mec-tab-active, +.mec-admin-dark-mode #mec_calendar_filter .mec-add-event-tabs-left a.mec-tab-active, +.mec-admin-dark-mode #mec_calendar_filter .mec-create-shortcode-tabs-left a.mec-tab-active, +.mec-admin-dark-mode #mec_metabox_booking .mec-add-booking-tabs-left a.mec-tab-active, +.mec-admin-dark-mode #mec_metabox_booking .mec-add-event-tabs-left a.mec-tab-active, +.mec-admin-dark-mode #mec_metabox_booking .mec-create-shortcode-tabs-left a.mec-tab-active, +.mec-admin-dark-mode #mec_metabox_details .mec-add-booking-tabs-left a.mec-tab-active, +.mec-admin-dark-mode #mec_metabox_details .mec-add-event-tabs-left a.mec-tab-active, +.mec-admin-dark-mode #mec_metabox_details .mec-create-shortcode-tabs-left a.mec-tab-active, +.mec-admin-dark-mode.m-e-calendar_page_MEC-report .select2-dropdown, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_gateways_form li .mec-gateway-options-form, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #payment_gateways_option li .mec-gateway-options-form, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .select2-container--default .select2-selection--multiple, +.mec-admin-dark-mode.post-type-mec_calendars .mec-custom-nice-select ul.list { + background: #000; + box-shadow: 0 2px 12px -5px #000; +} + +.mec-admin-dark-mode .extra .w-box-head, +.mec-admin-dark-mode .mec-attendees-wrapper .mec-attendees-list .w-clearfix:first-child, +.mec-admin-dark-mode .mec-form-row ul.mec-message-categories, +.mec-admin-dark-mode .mec-message-categories li.mec-acc-label, +.mec-admin-dark-mode.m-e-calendar_page_MEC-report .mce-btn-group:not(:first-child), +.mec-admin-dark-mode.m-e-calendar_page_MEC-report .select2-container--default .select2-search--dropdown .select2-search__field, +.mec-admin-dark-mode.m-e-calendar_page_MEC-report .select2-dropdown, +.mec-admin-dark-mode.m-e-calendar_page_MEC-report .wp-editor-container, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec-occurrences .mec-occurrences-list li, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_bfixed_form_fields button, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_bfixed_form_fields li, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_event_form_fields button, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_event_form_fields li, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_reg_form_field_types button, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_reg_form_fields li, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .html-active .switch-html, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .mec-custom-msg-notification-set-box.extra, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .select2-container--default .select2-selection--multiple, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .select2-container--default .select2-selection--multiple .select2-selection__choice, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .tmce-active .switch-tmce, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wns-be-container #wns-be-content, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wns-be-container #wns-be-footer, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wns-be-container #wns-be-infobar, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wns-be-container #wns-be-infobar:before, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wns-be-main, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wp-core-ui .quicktags-toolbar input.button.button-small, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wp-editor-container, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wp-switch-editor, +.mec-admin-dark-mode.post-type-mec-books #screen-meta, +.mec-admin-dark-mode.post-type-mec-books #screen-meta-links .show-settings, +.mec-admin-dark-mode.post-type-mec-books .postbox, +.mec-admin-dark-mode.post-type-mec-books .postbox .hndle, +.mec-admin-dark-mode.post-type-mec-books .postbox hr, +.mec-admin-dark-mode.post-type-mec-books .wp-heading-inline+.page-title-action, +.mec-admin-dark-mode.post-type-mec-events #major-publishing-actions, +.mec-admin-dark-mode.post-type-mec-events #post-status-info, +.mec-admin-dark-mode.post-type-mec-events #screen-meta, +.mec-admin-dark-mode.post-type-mec-events #screen-meta-links .show-settings, +.mec-admin-dark-mode.post-type-mec-events .categorydiv div.tabs-panel, +.mec-admin-dark-mode.post-type-mec-events .components-popover__content, +.mec-admin-dark-mode.post-type-mec-events .customlinkdiv div.tabs-panel, +.mec-admin-dark-mode.post-type-mec-events .edit-post-meta-boxes-area #poststuff .stuffbox>h3, +.mec-admin-dark-mode.post-type-mec-events .edit-post-meta-boxes-area #poststuff h2.hndle, +.mec-admin-dark-mode.post-type-mec-events .edit-post-meta-boxes-area #poststuff h3.hndle, +.mec-admin-dark-mode.post-type-mec-events .postbox, +.mec-admin-dark-mode.post-type-mec-events .postbox h2, +.mec-admin-dark-mode.post-type-mec-events .posttypediv div.tabs-panel, +.mec-admin-dark-mode.post-type-mec-events .taxonomydiv div.tabs-panel, +.mec-admin-dark-mode.post-type-mec-events .wp-editor-container, +.mec-admin-dark-mode.post-type-mec-events .wp-switch-editor, +.mec-admin-dark-mode.post-type-mec-events .wp-tab-active, +.mec-admin-dark-mode.post-type-mec-events .wp-tab-panel, +.mec-admin-dark-mode.post-type-mec-events div.mce-panel, +.mec-admin-dark-mode.post-type-mec-events div.mce-toolbar-grp, +.mec-admin-dark-mode.post-type-mec-events ul.add-menu-item-tabs li.tabs, +.mec-admin-dark-mode.post-type-mec-events ul.category-tabs li.tabs, +.mec-admin-dark-mode.post-type-mec_calendars #major-publishing-actions, +.mec-admin-dark-mode.post-type-mec_calendars #post-status-info, +.mec-admin-dark-mode.post-type-mec_calendars #screen-meta, +.mec-admin-dark-mode.post-type-mec_calendars #screen-meta-links .show-settings, +.mec-admin-dark-mode.post-type-mec_calendars .categorydiv div.tabs-panel, +.mec-admin-dark-mode.post-type-mec_calendars .customlinkdiv div.tabs-panel, +.mec-admin-dark-mode.post-type-mec_calendars .mec-custom-nice-select ul.list, +.mec-admin-dark-mode.post-type-mec_calendars .mec-custom-nice-select ul.list li.option, +.mec-admin-dark-mode.post-type-mec_calendars .mec-sed-methods li, +.mec-admin-dark-mode.post-type-mec_calendars .postbox, +.mec-admin-dark-mode.post-type-mec_calendars .postbox h2, +.mec-admin-dark-mode.post-type-mec_calendars .posttypediv div.tabs-panel, +.mec-admin-dark-mode.post-type-mec_calendars .taxonomydiv div.tabs-panel, +.mec-admin-dark-mode.post-type-mec_calendars .wp-editor-container, +.mec-admin-dark-mode.post-type-mec_calendars .wp-switch-editor, +.mec-admin-dark-mode.post-type-mec_calendars .wp-tab-active, +.mec-admin-dark-mode.post-type-mec_calendars .wp-tab-panel, +.mec-admin-dark-mode.post-type-mec_calendars div.mce-panel, +.mec-admin-dark-mode.post-type-mec_calendars div.mce-toolbar-grp, +.mec-admin-dark-mode.post-type-mec_calendars ul.add-menu-item-tabs li.tabs, +.mec-admin-dark-mode.post-type-mec_calendars ul.category-tabs li.tabs, +.mec-admin-dark-mode .mec-cmsg-2-notification-box-wrap, +.mec-admin-dark-mode .mec-cmsg-notification-box-wrap, +.mec-admin-dark-mode .w-box { + border-color: #353535; +} + +.mec-admin-dark-mode .notice.notice-warning.is-dismissible { + color: #353535; +} + +.mec-admin-dark-mode #mec_bfixed_form_fields input[type="checkbox"], +.mec-admin-dark-mode #mec_calendar_filter .mec-calendar-metabox .wn-mec-select, +.mec-admin-dark-mode #mec_calendar_filter .mec-form-row input[type="number"], +.mec-admin-dark-mode #mec_calendar_filter .mec-form-row input[type="text"], +.mec-admin-dark-mode #mec_calendar_filter .mec-form-row input[type="url"], +.mec-admin-dark-mode #mec_calendar_filter .mec-form-row select, +.mec-admin-dark-mode #mec_calendar_filter .mec-form-row textarea, +.mec-admin-dark-mode #mec_metabox_booking .mec-add-event-tabs-wrap .select2-container, +.mec-admin-dark-mode #mec_metabox_booking .mec-calendar-metabox .mec-form-row input[type="checkbox"], +.mec-admin-dark-mode #mec_metabox_booking .mec-calendar-metabox .wn-mec-select, +.mec-admin-dark-mode #mec_metabox_booking .mec-create-shortcode-tab-content .select2-container, +.mec-admin-dark-mode #mec_metabox_booking .mec-form-row input[type="number"], +.mec-admin-dark-mode #mec_metabox_booking .mec-form-row input[type="text"], +.mec-admin-dark-mode #mec_metabox_booking .mec-form-row input[type="url"], +.mec-admin-dark-mode #mec_metabox_booking .mec-form-row select, +.mec-admin-dark-mode #mec_metabox_booking .mec-form-row textarea, +.mec-admin-dark-mode #mec_metabox_booking .mec-form-row.mec-skin-list-date-format-container input[type="text"], +.mec-admin-dark-mode #mec_metabox_booking .mec-meta-box-fields .mec-form-row input[type="checkbox"], +.mec-admin-dark-mode #mec_metabox_details .mec-add-event-tabs-wrap .select2-container, +.mec-admin-dark-mode #mec_metabox_details .mec-calendar-metabox .mec-form-row input[type="checkbox"], +.mec-admin-dark-mode #mec_metabox_details .mec-calendar-metabox .wn-mec-select, +.mec-admin-dark-mode #mec_metabox_details .mec-create-shortcode-tab-content .select2-container, +.mec-admin-dark-mode #mec_metabox_details .mec-form-row input[type="number"], +.mec-admin-dark-mode #mec_metabox_details .mec-form-row input[type="text"], +.mec-admin-dark-mode #mec_metabox_details .mec-form-row input[type="url"], +.mec-admin-dark-mode #mec_metabox_details .mec-form-row select, +.mec-admin-dark-mode #mec_metabox_details .mec-form-row textarea, +.mec-admin-dark-mode #mec_metabox_details .mec-form-row.mec-skin-list-date-format-container input[type="text"], +.mec-admin-dark-mode #mec_metabox_details .mec-meta-box-fields .mec-form-row input[type="checkbox"], +.mec-admin-dark-mode #mec_reg_form_fields input[type="checkbox"], +.mec-admin-dark-mode .mec-addon-box-version, +.mec-admin-dark-mode .mec-calendar-metabox .wn-mec-select, +.mec-admin-dark-mode .mec-form-row input[type="checkbox"], +.mec-admin-dark-mode .mec-form-row input[type="number"], +.mec-admin-dark-mode .mec-form-row input[type="radio"], +.mec-admin-dark-mode .mec-form-row input[type="text"], +.mec-admin-dark-mode .mec-form-row input[type="url"], +.mec-admin-dark-mode .mec-form-row select, +.mec-admin-dark-mode .mec-form-row textarea, +.mec-admin-dark-mode .mec-form-row.mec-skin-list-date-format-container input[type="text"], +.mec-admin-dark-mode.m-e-calendar_page_MEC-addons, +.mec-admin-dark-mode.m-e-calendar_page_MEC-go-pro, +.mec-admin-dark-mode.m-e-calendar_page_MEC-report .html-active .switch-html, +.mec-admin-dark-mode.m-e-calendar_page_MEC-report .mec-report-select-event-wrap .select2-container--default .select2-selection--single, +.mec-admin-dark-mode.m-e-calendar_page_MEC-report .mec-report-sendmail-form-wrap, +.mec-admin-dark-mode.m-e-calendar_page_MEC-report .mec-report-sendmail-wrap, +.mec-admin-dark-mode.m-e-calendar_page_MEC-report .mec-send-email-form-wrap input.widefat, +.mec-admin-dark-mode.m-e-calendar_page_MEC-report .select2-container--default .select2-results__option--highlighted[aria-selected], +.mec-admin-dark-mode.m-e-calendar_page_MEC-report .select2-container--default .select2-search--dropdown .select2-search__field, +.mec-admin-dark-mode.m-e-calendar_page_MEC-report .tmce-active .switch-tmce, +.mec-admin-dark-mode.m-e-calendar_page_MEC-report .wp-switch-editor, +.mec-admin-dark-mode.m-e-calendar_page_MEC-report div.mce-toolbar-grp, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec-invoice-custom-css, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_bfixed_form_fields input[type="number"], +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_bfixed_form_fields input[type="text"], +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_bfixed_form_fields select, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_bfixed_form_fields textarea, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_event_form_fields button, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_event_form_fields input[type="number"], +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_event_form_fields input[type="text"], +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_event_form_fields select, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_event_form_fields textarea, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_reg_form_field_types button, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_reg_form_fields button, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_reg_form_fields input[type="number"], +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_reg_form_fields input[type="text"], +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_reg_form_fields select, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_reg_form_fields textarea, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #titlediv #title, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .mec-add-event-tabs-wrap .select2-container, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .mec-add-event-tabs-wrap .select2-container span, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .mec-create-shortcode-tab-content .select2-container, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .mec-create-shortcode-tab-content .select2-container span, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .quicktags-toolbar, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .select2-container--default .select2-selection--multiple, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .select2-container--default.select2-container--focus .select2-selection--multiple, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .select2-dropdown, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .select2-results__option[aria-selected], +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wns-be-main .mec-form-row input[type="email"], +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wns-be-main .mec-form-row input[type="number"], +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wns-be-main .mec-form-row input[type="password"], +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wns-be-main .mec-form-row input[type="search"], +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wns-be-main .mec-form-row input[type="text"], +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wns-be-main .mec-form-row input[type="url"], +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wns-be-main .mec-form-row select, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wp-core-ui .quicktags-toolbar input.button.button-small, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings input[type="checkbox"], +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings input[type="color"], +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings input[type="date"], +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings input[type="datetime-local"], +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings input[type="datetime"], +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings input[type="email"], +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings input[type="month"], +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings input[type="number"], +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings input[type="password"], +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings input[type="radio"], +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings input[type="search"], +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings input[type="tel"], +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings input[type="text"], +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings input[type="time"], +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings input[type="url"], +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings input[type="week"], +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings select, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings textarea, +.mec-admin-dark-mode.post-type-mec-books .wn-mec-select, +.mec-admin-dark-mode.post-type-mec-books input[type="checkbox"], +.mec-admin-dark-mode.post-type-mec-books input[type="email"], +.mec-admin-dark-mode.post-type-mec-books input[type="number"], +.mec-admin-dark-mode.post-type-mec-books input[type="text"], +.mec-admin-dark-mode.post-type-mec-books input[type="url"], +.mec-admin-dark-mode.post-type-mec-books select, +.mec-admin-dark-mode.post-type-mec-books textarea, +.mec-admin-dark-mode.post-type-mec-events #mec_event_form_fields button, +.mec-admin-dark-mode.post-type-mec-events #mec_reg_form_field_types button, +.mec-admin-dark-mode.post-type-mec-events #mec_reg_form_fields button, +.mec-admin-dark-mode.post-type-mec-events #titlediv #title, +.mec-admin-dark-mode.post-type-mec-events .components-form-token-field__input-container, +.mec-admin-dark-mode.post-type-mec-events .components-panel__body, +.mec-admin-dark-mode.post-type-mec-events .mec-add-event-tabs-wrap .select2-container span, +.mec-admin-dark-mode.post-type-mec-events .mec-certain-day>div, +.mec-admin-dark-mode.post-type-mec-events .mec-create-shortcode-tab-content .select2-container span, +.mec-admin-dark-mode.post-type-mec-events .mec-xi-facebook-import-events .mec-select-deselect-actions li, +.mec-admin-dark-mode.post-type-mec-events .mec-xi-google-import-events .mec-select-deselect-actions li, +.mec-admin-dark-mode.post-type-mec-events .select2-dropdown, +.mec-admin-dark-mode.post-type-mec-events .select2-results__option[aria-selected], +.mec-admin-dark-mode.post-type-mec-events .wp-admin p label input[type="checkbox"], +.mec-admin-dark-mode.post-type-mec-events input[type="checkbox"], +.mec-admin-dark-mode.post-type-mec-events input[type="color"], +.mec-admin-dark-mode.post-type-mec-events input[type="date"], +.mec-admin-dark-mode.post-type-mec-events input[type="datetime-local"], +.mec-admin-dark-mode.post-type-mec-events input[type="datetime"], +.mec-admin-dark-mode.post-type-mec-events input[type="email"], +.mec-admin-dark-mode.post-type-mec-events input[type="month"], +.mec-admin-dark-mode.post-type-mec-events input[type="number"], +.mec-admin-dark-mode.post-type-mec-events input[type="password"], +.mec-admin-dark-mode.post-type-mec-events input[type="radio"], +.mec-admin-dark-mode.post-type-mec-events input[type="search"], +.mec-admin-dark-mode.post-type-mec-events input[type="tel"], +.mec-admin-dark-mode.post-type-mec-events input[type="text"], +.mec-admin-dark-mode.post-type-mec-events input[type="time"], +.mec-admin-dark-mode.post-type-mec-events input[type="url"], +.mec-admin-dark-mode.post-type-mec-events input[type="week"], +.mec-admin-dark-mode.post-type-mec-events select, +.mec-admin-dark-mode.post-type-mec-events textarea, +.mec-admin-dark-mode.post-type-mec_calendars #titlediv #title, +.mec-admin-dark-mode.post-type-mec_calendars .mec-add-event-tabs-wrap .select2-container, +.mec-admin-dark-mode.post-type-mec_calendars .mec-add-event-tabs-wrap .select2-container span, +.mec-admin-dark-mode.post-type-mec_calendars .mec-create-shortcode-tab-content .select2-container, +.mec-admin-dark-mode.post-type-mec_calendars .mec-create-shortcode-tab-content .select2-container span, +.mec-admin-dark-mode.post-type-mec_calendars .select2-container--default .select2-selection--multiple .select2-selection__choice, +.mec-admin-dark-mode.post-type-mec_calendars .select2-dropdown, +.mec-admin-dark-mode.post-type-mec_calendars .select2-results__option[aria-selected], +.mec-admin-dark-mode.post-type-mec_calendars input[type="checkbox"], +.mec-admin-dark-mode.post-type-mec_calendars input[type="color"], +.mec-admin-dark-mode.post-type-mec_calendars input[type="date"], +.mec-admin-dark-mode.post-type-mec_calendars input[type="datetime-local"], +.mec-admin-dark-mode.post-type-mec_calendars input[type="datetime"], +.mec-admin-dark-mode.post-type-mec_calendars input[type="email"], +.mec-admin-dark-mode.post-type-mec_calendars input[type="month"], +.mec-admin-dark-mode.post-type-mec_calendars input[type="number"], +.mec-admin-dark-mode.post-type-mec_calendars input[type="password"], +.mec-admin-dark-mode.post-type-mec_calendars input[type="radio"], +.mec-admin-dark-mode.post-type-mec_calendars input[type="search"], +.mec-admin-dark-mode.post-type-mec_calendars input[type="tel"], +.mec-admin-dark-mode.post-type-mec_calendars input[type="text"], +.mec-admin-dark-mode.post-type-mec_calendars input[type="time"], +.mec-admin-dark-mode.post-type-mec_calendars input[type="url"], +.mec-admin-dark-mode.post-type-mec_calendars input[type="week"], +.mec-admin-dark-mode.post-type-mec_calendars select, +.mec-admin-dark-mode.post-type-mec_calendars textarea, +.mec-admin-dark-mode.toplevel_page_mec-intro .w-box.mec-activation input[name="MECPurchaseCode"], +.mec-admin-dark-mode.toplevel_page_mec-intro .w-box.mec-activation input[type="radio"]+label span, +.mec-select-deselect-actions li, +.mec-admin-dark-mode .mec-backend-tab { + background: #1d1d1d; + border-color: #353535; + color: #d2d2d2; +} + +.mec-admin-dark-mode .mec-b-active-tab { + background: #505050; + color: #dbdbdb; +} + +.mec-admin-dark-mode #mec_metabox_booking .mec-form-row input[type="checkbox"]:checked, +.mec-admin-dark-mode #mec_metabox_details .mec-form-row input[type="checkbox"]:checked, +.mec-admin-dark-mode .mec-custom-nice-select ul.list li .wn-mec-text:after, +.mec-admin-dark-mode .mec-sed-methods li:before { + box-shadow: 0 1px 6px -2px #000; + border-color: #353535; + background: #222; +} + +.mec-admin-dark-mode .mec-sed-methods li.active, +.mec-admin-dark-mode .mec-switcher input+label, +.mec-admin-dark-mode .mec-switcher input+label:before, +.mec-admin-dark-mode.m-e-calendar_page_MEC-report .select2-container--default .select2-results__option { + background-color: #000; +} + +.mec-admin-dark-mode .wn-mec-select .option.focus .wn-img-sh img, +.mec-admin-dark-mode .wn-mec-select .option.selected.focus .wn-img-sh img, +.mec-admin-dark-mode .wn-mec-select .option:hover .wn-img-sh img { + background: 0 0; +} + +.mec-admin-dark-mode .ui-datepicker { + background-color: #000; + border: 1px solid #000; + box-shadow: 0 0 8px rgba(33, 33, 33, 0.6); +} + +.mec-admin-dark-mode .ui-datepicker.ui-widget td a, +.mec-admin-dark-mode .w-box.upcoming-events .mec-event-article .mec-detail-button, +.mec-admin-dark-mode.post-type-mec-events, +.mec-admin-dark-mode.post-type-mec-events .postbox h2, +.mec-admin-dark-mode.post-type-mec_calendars .postbox h2 { + color: #d2d2d2; + background: #282828; +} + +.mec-admin-dark-mode #mec-advanced-wraper div:first-child>ul * { + background: #282828; +} + +.mec-admin-dark-mode #mec-advanced-wraper div:first-child>ul>ul>li, +.mec-admin-dark-mode #mec_styles_form #mec_styles_CSS, +.mec-admin-dark-mode .mec-attendees-wrapper .mec-attendees-list .w-clearfix, +.mec-admin-dark-mode .mec-message-categories li.mec-acc-label, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_bfixed_form_fields, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_event_form_fields, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_reg_form_fields { + background: #000; +} + +.mec-admin-dark-mode #mec-advanced-wraper div:first-child>ul>ul>li:hover, +.mec-admin-dark-mode .mec-active, +.mec-admin-dark-mode.post-type-mec-events .select2-container--default .select2-results__option--highlighted[aria-selected] { + background: #888 !important; +} + +.mec-admin-dark-mode.post-type-mec_calendars .mec-calendar-metabox .wn-mec-select .list { + border-radius: 0 0 2px 2px; + box-shadow: 0 0 0 1px #353535, 0 2px 6px rgba(0, 0, 0, 0.07); +} + +.mec-admin-dark-mode #mec_calendar_filter .mec-add-booking-tabs-right, +.mec-admin-dark-mode #mec_calendar_filter .mec-add-event-tabs-right, +.mec-admin-dark-mode #mec_calendar_filter .mec-create-shortcode-tabs-right, +.mec-admin-dark-mode #mec_calendar_filter .ui-sortable-handle, +.mec-admin-dark-mode #mec_gateways_form li .mec-gateway-options-form, +.mec-admin-dark-mode #mec_metabox_booking .mec-add-booking-tabs-right, +.mec-admin-dark-mode #mec_metabox_booking .mec-add-event-tabs-right, +.mec-admin-dark-mode #mec_metabox_booking .mec-create-shortcode-tabs-right, +.mec-admin-dark-mode #mec_metabox_booking .ui-sortable-handle, +.mec-admin-dark-mode #mec_metabox_details .mec-add-booking-tabs-right, +.mec-admin-dark-mode #mec_metabox_details .mec-add-event-tabs-right, +.mec-admin-dark-mode #mec_metabox_details .mec-create-shortcode-tabs-right, +.mec-admin-dark-mode #mec_metabox_details .ui-sortable-handle, +.mec-admin-dark-mode #payment_gateways_option li .mec-gateway-options-form, +.mec-admin-dark-mode .mec-meta-box-fields h4 { + border-color: #000 !important; +} + +.mec-admin-dark-mode .wns-be-container, +.mec-admin-dark-mode.m-e-calendar_page_MEC-report .mec-report-selected-event-attendees-wrap .w-clearfix.mec-attendees-content, +.mec-admin-dark-mode.post-type-mec-events #wp-content-editor-tools, +.mec-admin-dark-mode.post-type-mec_calendars, +.mec-admin-dark-mode.post-type-mec_calendars .wn-mec-select .list { + background-color: #282828; + border-color: #353535; +} + +.mec-admin-dark-mode .mec-intro-section-ifarme iframe, +.mec-admin-dark-mode.m-e-calendar_page_MEC-report .mec-report-selected-event-attendees-wrap .w-clearfix.mec-attendees-head, +.mec-admin-dark-mode.m-e-calendar_page_MEC-support .fserv-container, +.mec-admin-dark-mode.m-e-calendar_page_MEC-support .fserv-container *, +.mec-admin-dark-mode.toplevel_page_mec-intro .fserv-container, +.mec-admin-dark-mode.toplevel_page_mec-intro .fserv-container * { + background: #1f1f1f !important; + border-color: #353535 !important; +} + +.mec-admin-dark-mode .fserv-field input.fserv-input-text { + background: #000 !important; +} + +.mec-admin-dark-mode .block-editor-block-types-list__item-icon, +.mec-admin-dark-mode .block-editor-block-types-list__item-title, +.mec-admin-dark-mode .w-box.upcoming-events .mec-event-article h4.mec-event-title, +.mec-admin-dark-mode.m-e-calendar_page_MEC-report .mec-report-selected-event-attendees-wrap .w-clearfix.mec-attendees-content, +.mec-admin-dark-mode.m-e-calendar_page_MEC-report .select2-container--default .select2-selection--single .select2-selection__rendered, +.mec-admin-dark-mode.m-e-calendar_page_MEC-support .about-wrap h3, +.mec-admin-dark-mode.m-e-calendar_page_MEC-support .fserv-container .fserv-form-name, +.mec-admin-dark-mode.toplevel_page_mec-intro .about-wrap h3, +.mec-admin-dark-mode.toplevel_page_mec-intro .fserv-container .fserv-form-name { + color: #d2d2d2 !important; +} + +.mec-admin-dark-mode .wns-be-sidebar li a:hover, +.mec-admin-dark-mode .wns-be-sidebar li:hover, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .html-active .switch-html, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .tmce-active .switch-tmce, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wp-switch-editor, +.mec-admin-dark-mode.post-type-mec_calendars .wn-mec-select .option:hover { + background: #000; + color: #d2d2d2; +} + +.mec-admin-dark-mode .wns-be-sidebar li a, +.mec-admin-dark-mode.m-e-calendar_page_MEC-ix h1, +.mec-admin-dark-mode.m-e-calendar_page_MEC-ix h2, +.mec-admin-dark-mode.m-e-calendar_page_MEC-ix h3, +.mec-admin-dark-mode.m-e-calendar_page_MEC-ix h4, +.mec-admin-dark-mode.m-e-calendar_page_MEC-report .mec-report-selected-event-attendees-wrap .w-clearfix.mec-attendees-head span, +.mec-admin-dark-mode.m-e-calendar_page_MEC-report h2, +.mec-admin-dark-mode.m-e-calendar_page_MEC-report h4, +.mec-admin-dark-mode.m-e-calendar_page_MEC-support #webnus-dashboard .mec-faq-accordion-trigger a, +.mec-admin-dark-mode.post-type-mec-books .postbox h1, +.mec-admin-dark-mode.post-type-mec-books .postbox h2, +.mec-admin-dark-mode.post-type-mec-books .postbox h3, +.mec-admin-dark-mode.post-type-mec-events .components-panel__body-toggle.components-button, +.mec-admin-dark-mode.post-type-mec-events .wrap h1.wp-heading-inline, +.mec-admin-dark-mode.post-type-mec_calendars .mec-custom-nice-select ul.list li.option .wn-mec-text { + color: #d2d2d2; +} + +.mec-admin-dark-mode .wns-be-sidebar .wns-be-group-menu>li.active>a, +.mec-admin-dark-mode .wns-be-sidebar .wns-be-group-menu>li.active>a:hover { + border: none; +} + +.mec-admin-dark-mode .wns-be-sidebar li.active ul.subsection { + background: #282828; + border-bottom: 1px solid #353535; +} + +.mec-admin-dark-mode .wns-be-sidebar li .subsection a { + background: #282828; + color: #636363; + opacity: 1; + font-size: 12px; + padding: 6px 4px 6px 46px; +} + +.mec-admin-dark-mode .wns-be-sidebar .wns-be-group-menu>li.active>a, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wns-be-container #wns-be-infobar, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wns-be-main { + box-shadow: 0 2px 12px -5px #000; +} + +.mec-admin-dark-mode .wns-be-sidebar .mec-settings-menu .mec-settings-submenu a, +.mec-admin-dark-mode li.wns-be-group-menu-li.mec-settings-menu .mec-settings-submenu, +.mec-admin-dark-mode.post-type-mec_calendars .wn-mec-select .option.focus, +.mec-admin-dark-mode.post-type-mec_calendars .wn-mec-select .option.selected.focus, +.mec-admin-dark-mode.post-type-mec_calendars .wn-mec-select .option:hover { + background: #000; + color: #d2d2d2; + border-color: #353535; +} + +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings, +.mec-admin-dark-mode.post-type-mec_calendars .mec-custom-nice-select ul.list li.option { + background: #000 !important; + color: #fff !important; +} + +.mec-admin-dark-mode.m-e-calendar_page_MEC-addons, +.mec-admin-dark-mode.m-e-calendar_page_MEC-addons .about-wrap h1, +.mec-admin-dark-mode.m-e-calendar_page_MEC-go-pro, +.mec-admin-dark-mode.m-e-calendar_page_MEC-go-pro h1, +.mec-admin-dark-mode.m-e-calendar_page_MEC-ix, +.mec-admin-dark-mode.m-e-calendar_page_MEC-ix h1, +.mec-admin-dark-mode.m-e-calendar_page_MEC-report, +.mec-admin-dark-mode.m-e-calendar_page_MEC-report h1, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings div.mce-panel, +.mec-admin-dark-mode.m-e-calendar_page_MEC-support, +.mec-admin-dark-mode.m-e-calendar_page_MEC-support h1, +.mec-admin-dark-mode.post-type-mec-books, +.mec-admin-dark-mode.post-type-mec-books h1, +.mec-admin-dark-mode.post-type-mec_calendars, +.mec-admin-dark-mode.post-type-mec_calendars .wrap h1.wp-heading-inline, +.mec-admin-dark-mode.toplevel_page_mec-intro, +.mec-admin-dark-mode.toplevel_page_mec-intro .about-wrap h1 { + background: #282828 !important; + color: #d2d2d2; +} + +.mec-admin-dark-mode .w-theme-version { + background: #1f1f1f; +} + +.mec-admin-dark-mode .mec-sed-methods li.active, +.mec-admin-dark-mode .wns-be-container .wns-be-group-tab h2, +.mec-admin-dark-mode .wns-be-container .wns-be-group-tab h4, +.mec-admin-dark-mode.m-e-calendar_page_MEC-ix #mec-wrap .nav-tab-wrapper .nav-tab, +.mec-admin-dark-mode.m-e-calendar_page_MEC-ix #mec-wrap .nav-tab-wrapper, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .select2-container--default .select2-selection--multiple .select2-selection__choice { + color: #d2d2d2; +} + +.mec-admin-dark-mode .wns-be-sidebar .wns-be-group-menu li a:hover { + color: #07bbe9; +} + +.mec-admin-dark-mode.m-e-calendar_page_MEC-ix #mec-wrap .nav-tab-wrapper .nav-tab-active { + background: #008aff; + background: linear-gradient(95deg, #36a2ff 0, #008aff 50%, #0072ff 100%); +} + +.mec-admin-dark-mode .wns-be-container #wns-be-infobar:before { + content: ""; + width: 261px; + height: 78px; + display: block; + position: absolute; + left: 0; + top: 0; + background: #1f1f1f url(../img/webnus-logo2.png) no-repeat center; + border-bottom: 1px solid #dedede; + background-size: 220px; + z-index: 997; +} + +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .mec-custom-msg-notification-set-box.extra, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wns-be-container #wns-be-footer, +.mec-admin-dark-mode.post-type-mec-books #titlediv #title, +.mec-admin-dark-mode.post-type-mec-books .postbox h1 { + background: #1f1f1f !important; +} + +.mec-admin-dark-mode .mec-settings-menu .mec-settings-submenu:after, +.mec-admin-dark-mode .wns-be-sidebar .wns-be-group-menu li .subsection li.active a:after, +.mec-admin-dark-mode .wns-be-sidebar .wns-be-group-menu li .subsection li.active a:before { + border-right-color: #353535; +} + +.mec-admin-dark-mode .mec-switcher input:checked+label:before { + background-color: #d2d2d2; + box-shadow: 2px 2px 12px -2px #ccc inset; +} + +.mec-admin-dark-mode .mec-switcher input:checked+label { + box-shadow: 0 3px 11px -7px #000; +} + +.mec-admin-dark-mode .lity.mec-add-event-popup, +.mec-admin-dark-mode .lity.mec-add-shortcode-popup, +.mec-admin-dark-mode .mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup, +.mec-admin-dark-mode .mec-add-shortcode-popup div#mec_popup_shortcode { + background: #282828; +} + +.mec-admin-dark-mode .lity.mec-add-event-popup .lity-content, +.mec-admin-dark-mode .lity.mec-add-shortcode-popup .lity-content { + box-shadow: 0 3px 20px 0 rgba(0, 0, 0, 0.55); +} + +.mec-admin-dark-mode .mec-add-event-popup .mec-meta-box-colors-container, +.mec-admin-dark-mode .mec-steps-container, +.mec-admin-dark-mode .mec-steps-header { + background: #000; +} + +.mec-admin-dark-mode .mec-add-event-popup div#mec_popup_event, +.mec-admin-dark-mode .mec-steps-panel { + background: #1f1f1f; +} + +.mec-admin-dark-mode button.lity-close { + background: #000; + box-shadow: 0 3px 8px 0 rgba(0, 0, 0, 0.55); +} + +.mec-admin-dark-mode .mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-2 .mec-steps-content.mec-steps-content-2 ul li { + border: 2px solid #282828; + background: #000 !important; +} + +.mec-admin-dark-mode .mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-2 .mec-step-popup-skin-text:before, +.mec-admin-dark-mode .mec-add-shortcode-popup .mec-steps-content.mec-steps-content-4 label input { + background: #282828; + border-color: #1f1f1f; + box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.05); +} + +.mec-admin-dark-mode .mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-2 .mec-steps-content.mec-steps-content-2 ul li.active { + box-shadow: 0 3px 5px rgba(0, 0, 0, 0.2); +} + +.mec-admin-dark-mode .nicescroll-cursors { + background-color: #000 !important; +} + +.mec-admin-dark-mode .mec-add-event-popup .mec-categories-tab-contents, +.mec-admin-dark-mode .mec-add-event-popup .mec-form-row.mec-available-color-row, +.mec-admin-dark-mode .mec-add-event-popup .mec-steps-content.mec-steps-content-7.mec-steps-content-active, +.mec-admin-dark-mode .mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .mec-steps-content.mec-steps-content-4 .mec-multiple-skin-options div, +.mec-admin-dark-mode .mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-6 .mec-popup-shortcode { + border-color: #282828; + background: #000; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-6 .mec-popup-shortcode-code { + background: rgba(266, 266, 266, 0.35); +} + +.mec-admin-dark-mode .mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-6 .mec-popup-shortcode-code code, +.mec-admin-dark-mode .mec-steps-content h3 { + color: #d2d2d2; +} + +.mec-admin-dark-mode .mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup .option.focus, +.mec-admin-dark-mode .mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup .option.selected.focus, +.mec-admin-dark-mode .mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup .option:hover { + background: #000; +} + +.mec-admin-dark-mode .mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup .list { + background: #282828; +} + +.mec-admin-dark-mode .mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup .list::-webkit-scrollbar-track { + background-color: #333; +} + +.mec-admin-dark-mode .mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup .list::-webkit-scrollbar { + width: 3px; + background-color: #333; +} + +.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-6 .mec-popup-shortcode-code button { + margin-left: unset; +} + +.mec-admin-dark-mode .wp-picker-container .wp-color-result.button { + background: inherit; +} + +.mec-admin-dark-mode .mec-add-event-popup .mec-steps-content.mec-steps-content-6 .mce-container-body.mce-stack-layout { + background: #000; + border-color: #000 !important; +} + +.mec-admin-dark-mode .mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .wn-mec-select-popup { + background-color: #000; + border-color: #282828; +} + +.mec-admin-dark-mode #wns-be-content .noresults label, +.mec-admin-dark-mode #wns-be-content .results .results .noresults label, +.mec-admin-dark-mode #wns-be-content ul li.disable, +.mec-admin-dark-mode #wns-be-content ul li.disable label { + color: #666; +} + +.mec-admin-dark-mode #wns-be-content .results .results .results label, +.mec-admin-dark-mode #wns-be-content .results label, +.mec-admin-dark-mode #wns-be-content ul li.enable, +.mec-admin-dark-mode #wns-be-content ul li.enable label { + color: #fff; +} + +.mec-admin-dark-mode.post-type-mec-books table.widefat, +.mec-admin-dark-mode.post-type-mec_calendars table.widefat, +.post-type-mec-events.mec-admin-dark-mode table.widefat { + background: #1f1f1f; + border-color: #353535; + color: #d2d2d2; +} + +.mec-admin-dark-mode.post-type-mec-books .striped>tbody> :nth-child(odd), +.mec-admin-dark-mode.post-type-mec-books ul.striped> :nth-child(odd), +.mec-admin-dark-mode.post-type-mec-events .striped>tbody> :nth-child(odd), +.mec-admin-dark-mode.post-type-mec-events ul.striped> :nth-child(odd), +.mec-admin-dark-mode.post-type-mec_calendars .striped>tbody> :nth-child(odd), +.mec-admin-dark-mode.post-type-mec_calendars ul.striped> :nth-child(odd) { + background: #282828; + border-color: #353535; + color: #d2d2d2; +} + +.mec-admin-dark-mode.post-type-mec-books .widefat td, +.mec-admin-dark-mode.post-type-mec-books .widefat th, +.mec-admin-dark-mode.post-type-mec-events .widefat td, +.mec-admin-dark-mode.post-type-mec-events .widefat th, +.mec-admin-dark-mode.post-type-mec_calendars .widefat td, +.mec-admin-dark-mode.post-type-mec_calendars .widefat th { + border-color: #000; + color: #d2d2d2; +} + +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings ul#adminmenu a.wp-has-current-submenu:after, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings ul#adminmenu>li.current>a.current:after, +.mec-admin-dark-mode.post-type-mec-events ul#adminmenu a.wp-has-current-submenu:after, +.mec-admin-dark-mode.post-type-mec-events ul#adminmenu>li.current>a.current:after, +.mec-admin-dark-mode.post-type-mec_calendars ul#adminmenu a.wp-has-current-submenu:after, +.mec-admin-dark-mode.post-type-mec_calendars ul#adminmenu>li.current>a.current:after { + border-right-color: #1f1f1f; +} + +.mec-admin-dark-mode #mec_add_fee_button, +.mec-admin-dark-mode #mec_add_ticket_variation_button, +.mec-admin-dark-mode #mec_bfixed_form_field_types button, +.mec-admin-dark-mode #mec_bfixed_form_fields button, +.mec-admin-dark-mode #mec_event_form_field_types button, +.mec-admin-dark-mode #mec_event_form_fields button, +.mec-admin-dark-mode #mec_meta_box_downloadable_file_options #mec_downloadable_file_remove_image_button, +.mec-admin-dark-mode #mec_reg_form_field_types button, +.mec-admin-dark-mode #mec_reg_form_fields button, +.mec-admin-dark-mode #taxes_option #mec_fees_list .mec-form-row .button, +.mec-admin-dark-mode #ticket_variations_option #mec_ticket_variations_list .mec-form-row .button, +.mec-admin-dark-mode .mec-export-settings, +.mec-admin-dark-mode .mec-import-settings, +.mec-admin-dark-mode .mec-meta-box-fields .mec-form-row .button:not(.wp-color-result), +.mec-admin-dark-mode .mec-occurrences-wrapper .button:not(.wp-color-result), +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .button, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .button-secondary, +.mec-admin-dark-mode.post-type-mec-books .button, +.mec-admin-dark-mode.post-type-mec-books .wp-heading-inline+.page-title-action, +.mec-admin-dark-mode.post-type-mec-events .button, +.mec-admin-dark-mode.post-type-mec-events .button-secondary, +.mec-admin-dark-mode.post-type-mec-events .wp-heading-inline+.page-title-action, +.mec-admin-dark-mode.post-type-mec_calendars .button, +.mec-admin-dark-mode.post-type-mec_calendars .wp-heading-inline+.page-title-action { + color: #d2d2d2 !important; + border-color: #353535 !important; + background: #000; +} + +.mec-admin-dark-mode #mec_add_fee_button:hover, +.mec-admin-dark-mode #mec_add_ticket_variation_button:hover, +.mec-admin-dark-mode #mec_bfixed_form_field_types button:hover, +.mec-admin-dark-mode #mec_bfixed_form_fields button:hover, +.mec-admin-dark-mode #mec_event_form_field_types button:hover, +.mec-admin-dark-mode #mec_event_form_fields button:hover, +.mec-admin-dark-mode #mec_meta_box_downloadable_file_options #mec_downloadable_file_remove_image_button:hover, +.mec-admin-dark-mode #mec_reg_form_field_types button:hover, +.mec-admin-dark-mode #mec_reg_form_fields button:hover, +.mec-admin-dark-mode #taxes_option #mec_fees_list .mec-form-row .button:hover, +.mec-admin-dark-mode #ticket_variations_option #mec_ticket_variations_list .mec-form-row .button:hover, +.mec-admin-dark-mode .mec-export-settings:hover, +.mec-admin-dark-mode .mec-import-settings:hover, +.mec-admin-dark-mode .mec-meta-box-fields .mec-form-row .button:not(.wp-color-result):hover, +.mec-admin-dark-mode .mec-occurrences-wrapper .button:not(.wp-color-result):hover, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .button-secondary:hover, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .button.hover, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .button:hover, +.mec-admin-dark-mode.post-type-mec-events .button-secondary:hover, +.mec-admin-dark-mode.post-type-mec-events .button.hover, +.mec-admin-dark-mode.post-type-mec-events .button:hover, +.mec-admin-dark-mode.post-type-mec_calendars .button-secondary:hover, +.mec-admin-dark-mode.post-type-mec_calendars .button.hover, +.mec-admin-dark-mode.post-type-mec_calendars .button:hover { + background: #111; + border-color: #333 !important; + color: #fff; +} + +.mec-admin-dark-mode.post-type-mec-events .mec-form-row .button:not(.wp-color-result) { + height: 37px; + margin-top: 1px; + box-shadow: inset 0 2px 4px #282828, inset 0 -2px 4px rgba(0, 0, 0, 0.05), + 0 2px 2px rgba(0, 0, 0, 0.06); +} + +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wp-color-result-text, +.mec-admin-dark-mode.post-type-mec-events .wp-color-result-text { + border-left: 1px solid #353535; + color: #d2d2d2; + background: #000; +} + +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec-search-settings { + color: #d2d2d2; + background: #282828; +} + +.mec-admin-dark-mode.taxonomy-mec_category .button, +.mec-admin-dark-mode.taxonomy-mec_label .button, +.mec-admin-dark-mode.taxonomy-mec_location .button, +.mec-admin-dark-mode.taxonomy-mec_organizer .button, +.mec-admin-dark-mode.taxonomy-mec_speaker .button, +.mec-admin-dark-mode.taxonomy-mec_sponsor .button, +.mec-admin-dark-mode.taxonomy-mec_tag .button { + box-shadow: 0 3px 10px -4px #000 !important; +} + +.mec-admin-dark-mode.post-type-mec_calendars .mec-switcher input+label:after, +.mec-admin-dark-mode.post-type-mec_calendars .wn-mec-select .option .wn-hover-img-sh img { + background: #282828; +} + +.mec-admin-dark-mode .attachment-info, +.mec-admin-dark-mode .media-frame-toolbar .media-toolbar { + border-color: #282828; +} + +.mec-admin-dark-mode #webnus-dashboard .welcome-head img, +.mec-admin-dark-mode .mce-content-body { + background-color: #000 !important; +} + +.mec-admin-dark-mode .w-box.upcoming-events .mec-event-article { + border-bottom: 1px solid #444; +} + +.mec-admin-dark-mode #webnus-dashboard a, +.mec-admin-dark-mode #webnus-dashboard pre, +.mec-admin-dark-mode .extra .w-box-head, +.mec-admin-dark-mode .mec-addons-notification-box-content.mec-new-addons a, +.mec-admin-dark-mode .mec-form-row label, +.mec-admin-dark-mode .mec-form-row span, +.mec-admin-dark-mode .mec-meta-box-fields h4, +.mec-admin-dark-mode .mec-meta-box-fields label, +.mec-admin-dark-mode .mec-meta-box-fields p, +.mec-admin-dark-mode .mec-meta-box-fields span, +.mec-admin-dark-mode .mec-meta-box-fields strong, +.mec-admin-dark-mode .mec-new-addons .mec-addons-notification-title, +.mec-admin-dark-mode .mec-new-addons p, +.mec-admin-dark-mode .mec-new-addons strong, +.mec-admin-dark-mode .w-box-content p, +.mec-admin-dark-mode .w-box.doc, +.mec-admin-dark-mode .w-box.total-bookings ul li, +.mec-admin-dark-mode .w-box.total-bookings ul li a, +.mec-admin-dark-mode .wns-be-sidebar .mec-settings-menu .mec-settings-submenu a, +.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_reg_form_field_types button { + color: #d2d2d2 !important; +} + +.mec-admin-dark-mode .mec-addons-notification-box-content.mec-new-addons a { + box-shadow: 0 0 0 3px rgb(255 255 255 / 24%) !important; +} + +.mec-admin-dark-mode #webnus-dashboard .mec-event-detail { + color: #444; +} + +.mec-admin-dark-mode #webnus-dashboard .mec-intro-section .mec-intro-section-link-tag { + border-color: #2d2d2d; +} + +.mec-admin-dark-mode #webnus-dashboard .mec-intro-section .mec-intro-section-link-tag { + color: #282828 !important; +} + +.mec-admin-dark-mode #webnus-dashboard .mec-intro-section .mec-intro-section-link-tag:hover { + color: #fff !important; +} + +.mec-admin-dark-mode #webnus-dashboard .mec-intro-section .mec-intro-section-link-tag:nth-child(2):hover, +.mec-admin-dark-mode #webnus-dashboard .mec-intro-section .mec-intro-section-link-tag:nth-child(3):hover { + color: #999 !important; +} + +.mec-admin-dark-mode .mec-addons-notification-box-content.mec-new-addons a, +.mec-admin-dark-mode .w-box.total-bookings ul li { + background: #333; + box-shadow: 0 2px 3px -2px #000; +} + +.mec-admin-dark-mode .mec-addons-notification-box-content.mec-new-addons a:hover, +.mec-admin-dark-mode .w-box.total-bookings ul li:hover { + background: #000; +} + +.mec-admin-dark-mode #webnus-dashboard .total-bookings input[type="text"], +.mec-admin-dark-mode #webnus-dashboard .total-bookings select { + background: #000; + color: #999; + border-color: #111; +} + +.mec-admin-dark-mode #mec_category-add-toggle, +.mec-admin-dark-mode #sample-permalink a, +.mec-admin-dark-mode #set-post-thumbnail, +.mec-admin-dark-mode .button-link, +.mec-admin-dark-mode .category-tabs a, +.mec-admin-dark-mode .mec-add-booking-tabs-left a, +.mec-admin-dark-mode .mec-add-event-tabs-left a, +.mec-admin-dark-mode .mec-create-shortcode-tabs-left a, +.mec-admin-dark-mode.post-type-mec-events .wp-list-table .row-title, +.mec-admin-dark-mode.post-type-mec_calendars .wp-list-table .row-title { + color: #888 !important; +} + +.mec-admin-dark-mode .mec-add-booking-tabs-left a.mec-tab-active, +.mec-admin-dark-mode .mec-add-event-tabs-left a.mec-tab-active, +.mec-admin-dark-mode .mec-create-shortcode-tabs-left a.mec-tab-active { + color: #00b0dd; +} + +.mec-admin-dark-mode #TB_title, +.mec-admin-dark-mode #TB_window { + background: #000; +} + +.mec-admin-dark-mode #webnus-dashboard .welcome-head img, +.mec-admin-dark-mode .webnus-icons-list li:hover { + background: #111; +} + +.mec-admin-dark-mode #TB_window i { + color: #999; +} + +.mec-admin-dark-mode #TB_title, +.mec-admin-dark-mode .webnus-icons-list li label { + border: unset !important; +} + +.mec-admin-dark-mode.post-type-mec-books .notice-success, +.mec-admin-dark-mode.post-type-mec-books div.updated, +.mec-admin-dark-mode.post-type-mec-events .notice-success, +.mec-admin-dark-mode.post-type-mec-events div.updated, +.mec-admin-dark-mode.post-type-mec_calendars .notice-success, +.mec-admin-dark-mode.post-type-mec_calendars div.updated { + background: #111; + border-top: unset; + border-bottom: unset; +} + +.mec-admin-dark-mode.post-type-mec-books input, +.mec-admin-dark-mode.post-type-mec-events input, +.mec-admin-dark-mode.post-type-mec_calendars input { + background: #000; + color: #888; +} + +.mec-admin-dark-mode.post-type-mec-books .subsubsub a, +.mec-admin-dark-mode.post-type-mec-events .media-router .media-menu-item, +.mec-admin-dark-mode.post-type-mec-events .subsubsub a, +.mec-admin-dark-mode.post-type-mec_calendars .subsubsub a { + color: #2271b1; +} + +.mec-admin-dark-mode.post-type-mec-books .subsubsub a:hover, +.mec-admin-dark-mode.post-type-mec-events .media-router .media-menu-item:hover, +.mec-admin-dark-mode.post-type-mec-events .subsubsub a:hover, +.mec-admin-dark-mode.post-type-mec_calendars .subsubsub a:hover { + color: #135e96; +} + +.mec-admin-dark-mode #mec_calendar_filter .mec-create-shortcode-tabs-left a, +.mec-admin-dark-mode #mec_metabox_booking .mec-add-booking-tabs-left a, +.mec-admin-dark-mode #mec_metabox_details .mec-add-event-tabs-left a, +.mec-admin-dark-mode.post-type-mec-events #set-post-thumbnail, +.mec-admin-dark-mode.post-type-mec-events .attachment-info .filename { + color: #888; +} + +.mec-admin-dark-mode #mec_calendar_filter .mec-create-shortcode-tabs-left a:hover, +.mec-admin-dark-mode #mec_metabox_booking .mec-add-booking-tabs-left a:hover, +.mec-admin-dark-mode #mec_metabox_details .mec-add-event-tabs-left a:hover, +.mec-admin-dark-mode.post-type-mec-events #set-post-thumbnail:hover { + color: #a9a9a9; +} + +.mec-admin-dark-mode #webnus-dashboard .welcome-head img, +.mec-admin-dark-mode .w-theme-version, +.mec-admin-dark-mode.post-type-mec_calendars .mec-switcher input+label:after { + border-color: #444; +} + +.mec-admin-dark-mode.post-type-mec-books .postbox-header, +.mec-admin-dark-mode.post-type-mec-events .postbox-header, +.mec-admin-dark-mode.post-type-mec_calendars .postbox-header { + border-color: #000; +} + +.mec-admin-dark-mode.post-type-mec-events .inside div div>a.mec-tab-active:after, +.mec-admin-dark-mode.post-type-mec-events .inside div div>a.mec-tab-active:before, +.mec-admin-dark-mode.post-type-mec_calendars .inside div div>a.mec-tab-active:after, +.mec-admin-dark-mode.post-type-mec_calendars .inside div div>a.mec-tab-active:before { + border-right-color: #2d2d2d; +} + +.mec-admin-dark-mode .mec-form-row input[type="radio"] { + box-shadow: 0 1px 10px -2px #000; +} + +.mec-admin-dark-mode.post-type-mec-books .form-wrap label, +.mec-admin-dark-mode.post-type-mec-books .media-frame-title h1, +.mec-admin-dark-mode.post-type-mec-books h2, +.mec-admin-dark-mode.post-type-mec-events .form-wrap label, +.mec-admin-dark-mode.post-type-mec-events .media-frame-title h1, +.mec-admin-dark-mode.post-type-mec-events h2 { + color: #d2d2d2; +} + +.mec-admin-dark-mode.post-type-mec-books.taxonomy-mec_coupon .button, +.mec-admin-dark-mode.post-type-mec-events.taxonomy-post_tag .button { + box-shadow: 0 3px 10px -4px #000; +} + +.mec-admin-dark-mode.post-type-mec-events .attachments-browser .media-toolbar, +.mec-admin-dark-mode.post-type-mec-events .media-frame-content, +.mec-admin-dark-mode.post-type-mec-events .media-modal-content { + background: #2d2d2d; + color: #888; +} + +.mec-admin-dark-mode.post-type-mec-events .media-router .active, +.mec-admin-dark-mode.post-type-mec-events .media-router .media-menu-item.active:last-child, +.mec-admin-dark-mode.post-type-mec-events .media-sidebar, +.mec-admin-dark-mode.post-type-mec-events .quicktags-toolbar { + background: #222; +} + +.mec-admin-dark-mode.post-type-mec-events .attachments-browser .media-toolbar, +.mec-admin-dark-mode.post-type-mec-events .media-frame-content, +.mec-admin-dark-mode.post-type-mec-events .media-modal-content, +.mec-admin-dark-mode.post-type-mec-events .media-router .active, +.mec-admin-dark-mode.post-type-mec-events .media-router .media-menu-item.active:last-child, +.mec-admin-dark-mode.post-type-mec-events .media-sidebar, +.mec-admin-dark-mode.post-type-mec-events .quicktags-toolbar { + border-color: #000; +} + +.mec-admin-dark-mode.post-type-mec-events .wp-core-ui .attachment-preview { + background: #000; +} + +.mec-admin-dark-mode.m-e-calendar_page_MEC-addons .mec-addon-box-footer, +.mec-admin-dark-mode.m-e-calendar_page_MEC-addons .mec-addon-box-head, +.mec-admin-dark-mode.m-e-calendar_page_MEC-addons .w-col-sm-3 .w-box.addon { + border-color: #444; +} + +.mec-admin-dark-mode.m-e-calendar_page_MEC-addons .mec-addon-box-footer { + background: #444; +} + +.mec-admin-dark-mode.m-e-calendar_page_MEC-addons .mec-addon-box-title span { + color: #d2d2d2; +} + +.mec-admin-dark-mode.m-e-calendar_page_MEC-wizard { + background: #282828 !important; +} + +.mec-admin-dark-mode.m-e-calendar_page_MEC-wizard .mec-wizard-wrap { + background: #1f1f1f; +} + +.mec-admin-dark-mode.m-e-calendar_page_MEC-wizard .mec-wizard-wrap .mec-wizard-starter-video a, +.mec-admin-dark-mode.m-e-calendar_page_MEC-wizard .mec-wizard-wrap button { + background: #000; + border-color: #353535; + transition: all 0.2s ease; +} + +.mec-admin-dark-mode.m-e-calendar_page_MEC-wizard .mec-wizard-wrap .mec-wizard-starter-video a:hover, +.mec-admin-dark-mode.m-e-calendar_page_MEC-wizard .mec-wizard-wrap button:hover { + border-color: #515151; +} + +.mec-admin-dark-mode.m-e-calendar_page_MEC-wizard .mec-wizard-back-box .mec-wizard-back-button { + background: 0 0; + box-shadow: unset; +} + +.mec-admin-dark-mode.m-e-calendar_page_MEC-wizard .mec-wizard-wrap svg path { + fill: #7b7b7b; + stroke: #7b7b7b; + transition: all 0.2s ease; +} + +.mec-admin-dark-mode.m-e-calendar_page_MEC-wizard .mec-wizard-wrap a p, +.mec-admin-dark-mode.m-e-calendar_page_MEC-wizard .mec-wizard-wrap button span { + color: #7b7b7b; + transition: all 0.2s ease; +} + +.mec-admin-dark-mode.m-e-calendar_page_MEC-wizard .mec-wizard-wrap a:hover p, +.mec-admin-dark-mode.m-e-calendar_page_MEC-wizard .mec-wizard-wrap button:hover span { + color: #fff; +} + +.mec-admin-dark-mode.m-e-calendar_page_MEC-wizard .mec-wizard-wrap a:hover svg path, +.mec-admin-dark-mode.m-e-calendar_page_MEC-wizard .mec-wizard-wrap button:hover svg path { + fill: #fff; + stroke: #fff; +} + +.mec-attendees-wrapper .mec-attendees-list .mec-booking-attendees-tooltip, +.post-type-mec-books .attendees .mec-booking-attendees-tooltip { + position: relative; +} + +.mec-attendees-wrapper .mec-attendees-list strong, +.post-type-mec-books .attendees strong { + line-height: 26px; + padding-left: 26px; +} + +.mec-attendees-wrapper .mec-attendees-list .mec-booking-attendees-tooltip:before, +.post-type-mec-books .attendees .mec-booking-attendees-tooltip:before { + position: absolute; + content: "\e001"; + font-family: simple-line-icons; + margin: 12px 0; + top: -30px; + left: 0; + font-size: 18px; + line-height: 12px; + color: #40d9f1; + padding: 0 60px 5px 0; +} + +.mec-attendees-wrapper .mec-attendees-list .mec-booking-attendees-tooltip ul, +.post-type-mec-books .attendees .mec-booking-attendees-tooltip ul { + position: absolute; + min-width: 300px; + max-width: 600px; + display: inline-block; + left: 60px; + top: 50%; + transform: translateY(-50%); + background-color: #535a61; + color: #fff; + font-weight: 300; + font-size: 14px; + letter-spacing: 0.5px; + line-height: 1.3; + z-index: 9999999; + box-sizing: border-box; + box-shadow: 0 4px 45px -8px #444b50; + visibility: hidden; + opacity: 0; + transition: opacity 0.23s; + padding: 23px 20px 20px 20px; + border-radius: 8px; + margin-top: -13px; +} + +.mec-attendees-wrapper .mec-attendees-list .mec-booking-attendees-tooltip ul:before, +.post-type-mec-books .attendees .mec-booking-attendees-tooltip ul:before { + display: block; + content: "" !important; + position: absolute !important; + width: 12px; + height: 12px; + left: -10px !important; + top: 50% !important; + transform: translate(50%, -50%) rotate(-45deg) !important; + background-color: #535a61 !important; + box-shadow: 0 8px 9px -4px #535a61 !important; + z-index: 0 !important; +} + +.mec-attendees-wrapper .mec-attendees-list .mec-booking-attendees-tooltip:hover ul, +.post-type-mec-books .attendees .mec-booking-attendees-tooltip:hover ul { + visibility: visible; + opacity: 1; +} + +.mec-attendees-wrapper .mec-attendees-list .mec-booking-attendees-tooltip ul a, +.post-type-mec-books .attendees .mec-booking-attendees-tooltip ul a { + color: #40d9f1; + margin-bottom: 14px; + margin-left: 0; + font-weight: 400; + font-size: 14px; + letter-spacing: 0.5px; + position: relative; + text-decoration: none; + display: block; + width: max-content; +} + +.mec-attendees-wrapper .mec-attendees-list .mec-booking-attendees-tooltip ul li:last-child a, +.post-type-mec-books .attendees .mec-booking-attendees-tooltip ul li:last-child a { + margin-bottom: 0; +} + +.mec-metabox-head-version img, +.mec-metabox-head-version p { + float: left; +} + +.mec-metabox-head-version a { + float: right; +} + +.mec-metabox-head-version p { + margin-top: 3px; + margin-left: 5px; + margin-bottom: 34px; +} + +h3.mec-metabox-feed-head { + border-top: 1px solid #ccc; +} + +div#mec_widget_news_features .inside { + padding: 0; +} + +.mec-metabox-head-wrap { + padding: 0 12px; +} + +#dashboard-widgets h3.mec-metabox-feed-head { + padding: 8px 12px; + border-top: 1px solid #eee; + border-bottom: 1px solid #eee; + font-weight: 700; +} + +.mec-metabox-feed-content { + padding: 0 12px; +} + +.mec-metabox-feed-content ul li a { + font-weight: 600; + display: block; +} + +.mec-metabox-feed-content ul li p { + margin: 3px 0 24px; +} + +.mec-metabox-footer a span { + font-size: 17px; + vertical-align: middle; + margin-left: 2px; +} + +.mec-metabox-footer a { + text-decoration: none; + border-right: 1px solid #eee; + padding-right: 10px; + margin-right: 12px; +} + +.mec-metabox-footer { + padding: 11px 12px 10px; + border-top: 1px solid #eee; +} + +.mec-metabox-footer a:last-of-type { + border: none; +} + +.mec-metabox-upcoming-wrap h3 { + border-top: none !important; + padding-top: 13px !important; +} + +.mec-metabox-head-wrap { + box-shadow: 0 5px 8px rgba(0, 0, 0, 0.05); +} + +.mec-metabox-upcoming-wrap ul li span { + float: left; +} + +.mec-metabox-upcoming-wrap ul li .mec-metabox-upcoming-event { + float: left; + margin-left: 10px; +} + +.mec-metabox-upcoming-wrap ul li .mec-metabox-upcoming-event-date { + float: right; +} + +.mec-metabox-upcoming-wrap ul { + padding: 0 12px; + background: #f7f7f7; + margin: 0; +} + +.mec-metabox-upcoming-wrap ul li { + border-bottom: 1px solid #eee; + padding: 14px 0; + margin-bottom: 0; +} + +.mec-metabox-upcoming-wrap ul li:last-of-type { + border: none; +} + +.mec-metabox-upcoming-wrap h3 { + margin-bottom: 0 !important; +} + +.mec-metabox-upcoming-wrap ul li .mec-metabox-upcoming-event a { + font-weight: 600; +} + +.mec-metabox-head-version a span { + vertical-align: middle; +} + +.mec-metabox-head-version a { + padding-left: 6px !important; +} + +#mec_widget_total_bookings .w-box.total-bookings ul li:first-child { + margin-left: 1px; +} + +#mec_widget_total_bookings .w-box.total-bookings ul li { + margin-right: 4px; +} + +#mec_widget_total_bookings .w-box.total-bookings ul li:last-child { + margin-right: 0; +} + +#mec_widget_total_bookings .w-box.total-bookings ul li a { + color: #000; +} + +#mec_widget_total_bookings .w-box.total-bookings ul li:hover a { + color: #fff; +} + +#mec_widget_total_bookings { + overflow: hidden; +} + +#mec_widget_total_bookings .inside, +#mec_widget_total_bookings .w-box { + margin: 0; + padding-bottom: 0; +} + +#mec_widget_total_bookings .w-col-sm-12 { + padding: 0; +} + +#mec_widget_total_bookings .w-box-content button { + color: #fff !important; + font-weight: 500 !important; + border-radius: 2px !important; + box-shadow: 0 3px 10px -4px #008aff !important; + text-shadow: none !important; + background: #008aff !important; + background: linear-gradient(95deg, + #36a2ff 0, + #008aff 50%, + #0072ff 100%) !important; + border: none !important; + transition: 0.24s !important; + line-height: 39px; + padding: 0 36px; + width: calc(33% - 7px); + margin-bottom: 14px; +} + +#mec_widget_total_bookings .w-box-content input[type="text"], +#mec_widget_total_bookings .w-box-content select { + border: solid 1px #ddd; + border-radius: 2px; + height: 40px; + line-height: 38px; + padding-left: 10px; + box-shadow: 0 3px 10px -2px rgba(0, 0, 0, 0.05), + inset 0 1px 2px rgba(0, 0, 0, 0.02); +} + +#mec_widget_total_bookings .w-box-content input[type="text"] { + width: calc(50% - 5px); +} + +#mec_widget_total_bookings .w-box-content select { + width: calc(33% - 2px); + margin-bottom: 24px; + margin-top: 20px; +} + +div#mec-schema .mec-form-row label { + display: inline-block; + width: 141px; +} + +.event-status-schema { + background: rgb(247 248 249 / 10%); + padding: 20px 40px; + margin: 10px 0 35px; + border-radius: 4px; + border: 1px solid #e6e6e6; +} + +@media (min-width: 1281px) { + .event-status-schema { + max-width: 70%; + } +} + +.event-status-schema p { + margin-bottom: 35px; +} + +div#mec_cancelled_reason_wrapper label { + width: 100% !important; +} + +.mec-fluent-hidden { + display: none; +} + +#webnus-dashboard .total-bookings input[type="text"] { + height: 38px; + line-height: 38px; + padding-left: 10px; + border-radius: 5px; + border: none; + background-color: #f7f8f9; + box-shadow: inset 0 1px 2px rgb(0 0 0 / 7%); +} + +#webnus-dashboard .total-bookings select { + appearance: none; + -webkit-appearance: none; + -moz-appearance: none; + cursor: pointer; + min-height: 34px; + line-height: 34px; + background-color: #f7f8f9; + border-radius: 2px; + padding-left: 8px; + box-shadow: 0 1px 3px rgb(0 0 0 / 2%); + transition: all 0.23s ease; + background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0ZWQgYnkgSWNvTW9vbi5pbyAtLT4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHdpZHRoPSIxNyIgaGVpZ2h0PSIxNyIgdmlld0JveD0iMCAwIDE3IDE3Ij4KPGc+CjwvZz4KCTxwYXRoIGQ9Ik0xNi4zNTQgNS4wNzVsLTcuODU1IDcuODU0LTcuODUzLTcuODU0IDAuNzA3LTAuNzA3IDcuMTQ1IDcuMTQ2IDcuMTQ4LTcuMTQ3IDAuNzA4IDAuNzA4eiIgZmlsbD0iIzAwMDAwMCIgLz4KPC9zdmc+Cg==); + background-repeat: no-repeat; + background-size: 26px 10px; + background-position: right center; + min-width: 160px; + border: 1px solid #e6e9eb; +} + +#webnus-dashboard select { + margin-top: -5px; +} + +#mec_styles_CSS { + line-height: 1.6; +} + +.mec-search-forms-options-container label.mec-col-12 { + margin-bottom: 10px; +} + +@media (max-width: 480px) { + .toplevel_page_mec-intro .mec-intro-section-ifarme iframe { + width: auto !important; + height: auto !important; + } + + .w-box.mec-activation input[name="MECPurchaseCode"] { + min-width: 200px !important; + width: 330px; + } + + .w-box.mec-activation { + background: #fff; + } + + .mec-addons { + padding-right: 15px; + } + + .mec-report-wrap { + margin-top: 20px; + } + + .mec-report-select-event-wrap .select2-container--default, + .mec-report-select-event-wrap select.mec-reports-selectbox-dates { + max-width: 100%; + width: 100%; + margin: 10px 0; + } + + .mec-report-selected-event-attendees-wrap .w-clearfix.mec-attendees-content, + .mec-report-selected-event-attendees-wrap .w-clearfix.mec-attendees-head { + padding: 10px; + } + + .mec-report-selected-event-attendees-wrap .w-clearfix.mec-attendees-head span { + font-size: 13px; + } + + .mec-report-selected-event-attendees-wrap .mec-attendees-content .w-col-xs-3 { + word-wrap: break-word; + } + + .mec-report-selected-event-attendees-wrap .w-col-xs-3.name img { + display: block; + } + + .mec-report-selected-event-attendees-wrap input[type="checkbox"], + .mec-report-selected-event-attendees-wrap input[type="radio"] { + height: 0.85rem; + width: 0.85rem; + } + + .wns-be-container .dpr-btn.dpr-save-btn { + margin: 0 !important; + } + + #mec_booking_form .mec-container { + padding-left: 0; + padding-right: 0; + } + + #mec_event_form_fields, + #mec_reg_form_fields { + padding: 10px; + } + + .mec-search-forms-options-container .mec-form-row select { + width: 100%; + } + + #mec_skin_monthly_view_start_date_container { + display: unset; + } + + #mec_calendar_display_options input[type="number"], + #mec_calendar_display_options input[type="text"], + #mec_calendar_display_options select { + max-width: 100% !important; + width: 100%; + margin: 10px 0; + } + + #mec_select_tags.mec-create-shortcode-tab-content input[type="text"] { + width: auto; + } + + #mec_tickets .mec-box { + padding: 20px 7px; + } + + .fserv-container form, + .fserv-form-description { + padding: 10px 15px !important; + } + + .fserv-field { + display: inline-block; + width: 25% !important; + padding: 0 !important; + margin: 0 !important; + margin-right: 10px !important; + } + + #webnus-dashboard .total-bookings button { + margin: 15px 0; + } +} + +.mec-skin-styles.mec-styles-custom { + padding-left: 0 !important; + top: 40%; + position: absolute; + width: 330px; + height: auto !important; + overflow: visible !important; +} + +.mec-skin-styles.mec-styles-custom .nice-select { + box-shadow: 0 3px 13px -5px rgba(0, 0, 0, 0.1), + inset 0 1px 2px rgba(0, 0, 0, 0.07); + clear: unset !important; + -webkit-tap-highlight-color: transparent; + background-color: #fff; + border-radius: 5px; + border: solid 1px #e8e8e8; + box-sizing: border-box; + clear: both; + cursor: pointer; + display: block; + float: left; + font-family: inherit; + font-size: 14px; + font-weight: 400; + height: 42px; + line-height: 40px; + outline: 0; + padding-left: 18px; + padding-right: 30px; + position: relative; + text-align: left !important; + -webkit-transition: all 0.2s ease-in-out; + transition: all 0.2s ease-in-out; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + white-space: nowrap; + width: 300px !important; +} + +.mec-styles-custom h3 { + font-size: 13px; + font-weight: 400; + color: #707070; +} + +.post-type-mec_calendars .mec-form-row .select2-selection { + height: auto; +} + +.mec-form-row .mec-col-12 ul li span { + display: inline-block; + background: #f7f8f9; + padding: 8px 15px; + margin-right: 5px; + border-radius: 3px; + border: 1px dashed #d7d8d9; + font-family: monospace; + letter-spacing: 0.4px; +} + +.post-type-mec-events .ui-datepicker.ui-widget .ui-state-disabled .ui-state-default { + color: #ccc; + width: 30px; + height: 30px; + line-height: 30px; + display: inline-block; +} + +.post-type-mec-events .ui-datepicker.ui-widget .ui-button, +.post-type-mec-events .ui-datepicker.ui-widget .ui-button.ui-state-disabled:active, +.post-type-mec-events .ui-datepicker.ui-widget .ui-button.ui-state-disabled:hover, +.post-type-mec-events .ui-datepicker.ui-widget .ui-state-default, +.post-type-mec-events .ui-datepicker.ui-widget .ui-widget-content .ui-state-default, +.post-type-mec-events .ui-datepicker.ui-widget .ui-widget-header .ui-state-default, +.post-type-mec_calendars .ui-datepicker.ui-widget .ui-button, +.post-type-mec_calendars .ui-datepicker.ui-widget .ui-button.ui-state-disabled:active, +.post-type-mec_calendars .ui-datepicker.ui-widget .ui-button.ui-state-disabled:hover, +.post-type-mec_calendars .ui-datepicker.ui-widget .ui-state-default, +.post-type-mec_calendars .ui-datepicker.ui-widget .ui-widget-content .ui-state-default, +.post-type-mec_calendars .ui-datepicker.ui-widget .ui-widget-header .ui-state-default { + border: 0; + background-color: #fff; + font-weight: 400; + color: #212121; + text-align: center; +} + +.post-type-mec-events .ui-datepicker.ui-widget td a.ui-state-active, +.post-type-mec-events .ui-datepicker.ui-widget td a:hover, +.post-type-mec_calendars .ui-datepicker.ui-widget td a.ui-state-active, +.post-type-mec_calendars .ui-datepicker.ui-widget td a:hover { + background: #40d9f1; + color: #fff; +} + +.post-type-mec-events .ui-datepicker.ui-widget .ui-widget-header, +.post-type-mec_calendars .ui-datepicker.ui-widget .ui-widget-header { + border: 0; + background: unset; + background-color: #fff; +} + +.post-type-mec-events .ui-datepicker.ui-widget .ui-icon, +.post-type-mec-events .ui-datepicker.ui-widget .ui-widget-content .ui-icon, +.post-type-mec_calendars .ui-datepicker.ui-widget .ui-icon, +.post-type-mec_calendars .ui-datepicker.ui-widget .ui-widget-content .ui-icon { + background-image: unset; +} + +.post-type-mec-events .ui-datepicker.ui-widget select, +.post-type-mec_calendars .ui-datepicker.ui-widget select { + font-weight: 600; + font-size: 12px; + border-radius: 2px; + padding: 2px 10px; + margin: 1px 3px 5px; +} + +.mec-update-warning+p { + display: none; +} + +#mec_sf_timetable_address_search_placeholder, +#mec_sf_timetable_txt_search_placeholder { + margin-top: 4px; +} + +body.rtl .wns-be-sidebar { + width: 260px; + float: right; + position: relative; +} + +body.rtl .wns-be-main { + margin-left: 0; + border-left: 0; + margin-right: 260px; + border-right: 1px solid #dedede; +} + +body.rtl .w-box.mec-activation .LicenseField { + direction: rtl; +} + +body.rtl .w-box.mec-activation input[name="MECPurchaseCode"] { + text-align: right; + padding-right: 20px; +} + +body.rtl #MECActivation .MECPurchaseStatus, +body.rtl .addon-activation-form .MECPurchaseStatus { + right: auto; + left: -51px; +} + +body.rtl #webnus-dashboard .w-box.mec-activation input[type="submit"] { + right: auto; + left: 5px; +} + +body.rtl .wns-be-sidebar .wns-be-group-menu li a { + padding: 13px 20px 13px 4px; +} + +body.rtl .wns-be-sidebar .wns-be-group-tab-link-a span.wns-be-group-menu-title { + padding-left: 0; + padding-right: 24px; +} + +body.rtl .wns-be-sidebar .has-sub span.extra-icon { + float: left; +} + +body.rtl .wns-be-sidebar .wns-be-group-tab-link-a span.extra-icon i { + right: auto; + left: 10px; +} + +body.rtl .wns-be-sidebar .wns-be-group-menu li .subsection li.active a:after, +body.rtl .wns-be-sidebar .wns-be-group-menu li .subsection li.active a:before { + position: absolute; + z-index: 999; + content: " "; + height: 0; + width: 0; + border: 7px solid transparent; + border-right-color: transparent; + border-left-color: #fff; + right: auto; + left: -1px; + top: 10px; +} + +body.rtl .wns-be-sidebar .wns-be-group-menu li .subsection li.active a:before { + border-right-color: transparent; + border-left-color: #c5c5c5; + right: auto; + left: 0; +} + +body.rtl .mec-col-1, +body.rtl .mec-col-10, +body.rtl .mec-col-11, +body.rtl .mec-col-12, +body.rtl .mec-col-2, +body.rtl .mec-col-3, +body.rtl .mec-col-4, +body.rtl .mec-col-5, +body.rtl .mec-col-6, +body.rtl .mec-col-7, +body.rtl .mec-col-8, +body.rtl .mec-col-9 { + float: right; + margin: 0; +} + +body.rtl .wns-be-sidebar li .submneu-hover { + right: auto; + left: -222px; +} + +body.rtl .wns-be-sidebar li .submneu-hover:after { + position: absolute; + z-index: 999; + content: " "; + height: 0; + width: 0; + border: 7px solid transparent; + border-right-color: #fff; + left: auto; + right: -1px; + top: 14px; +} + +body.rtl #mec_styles_form #mec_styles_CSS { + direction: ltr; +} + +body.rtl .w-box.mec-activation { + -moz-transform: scaleY(-1); + -o-transform: scaleY(-1); + -webkit-transform: scaleY(-1); + transform: scaleX(-1); +} + +body.rtl .w-box.mec-activation .w-box-content, +body.rtl .w-box.mec-activation .w-box-head { + -moz-transform: scaleY(-1); + -o-transform: scaleY(-1); + -webkit-transform: scaleY(-1); + transform: scaleX(-1); + display: block; +} + +body.rtl .w-box.mec-activation .w-box-head { + width: 100%; +} + +body.rtl .wns-be-container #wns-be-infobar:before { + left: auto; + right: 0; +} + +body.rtl .wns-be-container .dpr-btn.dpr-save-btn { + float: left; +} + +body.rtl .wns-be-container .wns-be-group-tab h2:before, +body.rtl .wns-be-container .wns-be-group-tab h4:before { + left: auto; + right: 0; + margin-right: 0; + margin-left: 5px; +} + +body.rtl #mec_gateways_form .mec-tooltip { + float: left; +} + +body.rtl .fserv-container .fserv-form-name { + text-align: right !important; +} + +body.rtl #webnus-dashboard .mec-activation .w-box-head { + max-width: calc(100% - 250px); + margin-right: 250px; + text-align: right; +} + +body.rtl #webnus-dashboard .w-box.mec-activation .LicenseType label { + padding-left: 20px; + padding-right: 0; + font-weight: 500; +} + +body.rtl #webnus-dashboard .w-box.mec-activation input[type="radio"]+label span { + margin-right: 0; + margin-left: 6px; +} + +body.rtl #webnus-dashboard .upcoming-events .w-box-content .mec-event-article { + display: block; +} + +body.rtl #webnus-dashboard .upcoming-events .w-box-content .mec-event-article .col-md-9.col-sm-9 { + float: unset; +} + +body.rtl #webnus-dashboard .total-bookings input[type="text"], +body.rtl #webnus-dashboard .total-bookings select { + min-width: 125px; + margin: 0; +} + +body.rtl.post-type-mec-events .mec-form-row input[type="number"], +body.rtl.post-type-mec-events .mec-form-row input[type="text"], +body.rtl.post-type-mec-events .mec-form-row input[type="url"], +body.rtl.post-type-mec-events .mec-form-row select, +body.rtl.post-type-mec-events .mec-form-row textarea, +body.rtl.post-type-mec_calendars .mec-form-row input[type="number"], +body.rtl.post-type-mec_calendars .mec-form-row input[type="text"], +body.rtl.post-type-mec_calendars .mec-form-row input[type="url"], +body.rtl.post-type-mec_calendars .mec-form-row select, +body.rtl.post-type-mec_calendars .mec-form-row textarea { + margin: 0 0 0 1%; +} + +body.rtl .mec-form-row .mec-col-8 label, +body.rtl .mec-form-row .mec-col-9 label { + padding-left: 10px; +} + +body.rtl .mec-form-row label { + text-align: right; +} + +body.rtl .mec-form-row .mec-col-3 { + margin: 0; + padding-left: 10px; + padding-right: 0; +} + +body.rtl .mec-calendar-metabox .mec-form-row input[type="checkbox"], +body.rtl .mec-meta-box-fields .mec-form-row input[type="checkbox"] { + margin-left: 6px; + margin-right: 0; +} + +body.rtl .mec-form-row input[type="radio"] { + margin: 0 0 0 6px; +} + +body.rtl .mec-form-row .description { + border-left: 0; + border-right: 1px dashed #ccc; + padding-left: 0; + padding-right: 12px; +} + +body.rtl #mec_add_fee_button, +body.rtl #mec_add_ticket_variation_button, +body.rtl #mec_meta_box_downloadable_file_options #mec_downloadable_file_remove_image_button, +body.rtl #taxes_option #mec_fees_list .mec-form-row .button, +body.rtl #ticket_variations_option #mec_ticket_variations_list .mec-form-row .button, +body.rtl .mec-export-settings, +body.rtl .mec-import-settings, +body.rtl .mec-meta-box-fields .mec-form-row .button:not(.wp-color-result), +body.rtl .mec-occurrences-wrapper .button:not(.wp-color-result) { + margin-right: 0; + margin-left: 5px; +} + +body.rtl .mec-add-booking-tabs-right, +body.rtl .mec-add-event-tabs-right, +body.rtl .mec-create-shortcode-tabs-right { + border-left: 0; + border-right: 1px solid #e2e2e2; +} + +body.rtl .mec-add-booking-tabs-left a, +body.rtl .mec-add-event-tabs-left a, +body.rtl .mec-create-shortcode-tabs-left a { + padding: 13px 20px 13px 4px; +} + +body.rtl .mec-add-booking-tabs-left a.mec-tab-active, +body.rtl .mec-add-event-tabs-left a.mec-tab-active, +body.rtl .mec-create-shortcode-tabs-left a.mec-tab-active { + padding-left: 0; + padding-right: 22px; +} + +body.rtl .mec-calendar-metabox .wn-mec-select, +body.rtl .mec-form-row select, +body.rtl .post-type-mec-events .mec-form-row select, +body.rtl .post-type-mec_calendars .mec-form-row select, +body.rtl .wns-be-main .mec-form-row select { + background-position: left center !important; +} + +body.rtl .mec-calendar-metabox .wn-mec-select, +body.rtl .mec-form-row select, +body.rtl .post-type-mec-events .mec-form-row select, +body.rtl .post-type-mec_calendars .mec-form-row select, +body.rtl .wns-be-main .mec-form-row select { + text-align: right !important; +} + +body.rtl #mec_calendar_display_options .mec-col-4 input { + margin-left: 0 !important; + margin-right: 20px !important; +} + +body.rtl .meta-box-sortables .mec-switcher input:checked+label:after { + right: auto; + left: 2px; + margin-left: 0; +} + +body.rtl .mec-sed-methods li { + margin: 0 0 5px 5px; +} + +body.rtl .wn-mec-select:after { + left: 10px; + right: auto; +} + +body.rtl .inside div div>a.mec-tab-active:after, +body.rtl .inside div div>a.mec-tab-active:before { + border-right: 0; + border-left-color: #fff; +} + +body.rtl .inside div div>a.mec-tab-active:after { + right: auto; + left: -1px; +} + +body.rtl .inside div div>a.mec-tab-active:before { + border-right: 0; + border-left-color: #d7d8d9; + right: auto; + left: 0; +} + +body.rtl #mec_tickets .button.remove { + right: auto; + left: 20px; + line-height: 1.8; +} + +body.rtl .mec-calendar-metabox .wn-mec-select, +body.rtl .mec-form-row input[type="date"], +body.rtl .mec-form-row input[type="email"], +body.rtl .mec-form-row input[type="number"], +body.rtl .mec-form-row input[type="tel"], +body.rtl .mec-form-row input[type="text"], +body.rtl .mec-form-row input[type="url"], +body.rtl .mec-form-row select, +body.rtl .mec-form-row textarea, +body.rtl .mec-form-row.mec-skin-list-date-format-container input[type="text"], +body.rtl .mec-occurrences-wrapper input[type="date"], +body.rtl .mec-occurrences-wrapper input[type="email"], +body.rtl .mec-occurrences-wrapper input[type="number"], +body.rtl .mec-occurrences-wrapper input[type="tel"], +body.rtl .mec-occurrences-wrapper input[type="text"], +body.rtl .mec-occurrences-wrapper input[type="url"], +body.rtl .mec-occurrences-wrapper select, +body.rtl .mec-occurrences-wrapper textarea { + padding: 0 10px; +} + +body.rtl #mec-occurrences .mec-occurrences-list li, +body.rtl #mec_bfixed_form_fields li, +body.rtl #mec_event_form_fields li, +body.rtl #mec_reg_form_fields li { + border-radius: 11px 3px 3px 3px; +} + +body.rtl #mec-occurrences .mec-occurrences-list .mec-occurrences-delete-button, +body.rtl #mec_bfixed_form_fields span.mec_bfixed_field_remove, +body.rtl #mec_event_form_fields span.mec_event_field_remove, +body.rtl #mec_reg_form_fields span.mec_reg_field_remove { + position: absolute; + right: auto; + left: 47px; + top: 0; + background: #fff; +} + +body.rtl #mec-occurrences .mec-occurrences-list .mec-occurrences-delete-button:before, +body.rtl #mec_bfixed_form_fields span.mec_bfixed_field_option_sort:before, +body.rtl #mec_bfixed_form_fields span.mec_bfixed_field_remove:before, +body.rtl #mec_bfixed_form_fields span.mec_bfixed_field_sort:before, +body.rtl #mec_event_form_fields span.mec_event_field_option_sort:before, +body.rtl #mec_event_form_fields span.mec_event_field_remove:before, +body.rtl #mec_event_form_fields span.mec_event_field_sort:before, +body.rtl #mec_reg_form_fields span.mec_reg_field_option_sort:before, +body.rtl #mec_reg_form_fields span.mec_reg_field_remove:before, +body.rtl #mec_reg_form_fields span.mec_reg_field_sort:before { + left: auto; + right: 20px; + top: 7px; +} + +body.rtl #mec_bfixed_form_fields span.mec_bfixed_field_type, +body.rtl #mec_bfixed_form_fields span.mec_event_field_type, +body.rtl #mec_event_form_fields span.mec_event_field_type, +body.rtl #mec_reg_form_fields span.mec_reg_field_type { + padding-left: 0; + padding-right: 25px; +} + +body.rtl .wns-be-main .mec-form-row .mec-col-3 { + padding: 0; +} + +body.rtl .wns-be-main .mec-form-row .mec-col-9 { + float: left; +} + +body.rtl .mec-form-row .mec-col-9 .mec-box .mec-tooltip { + left: 15px; + right: auto; +} + +body.rtl .mec-tooltip .box { + left: auto !important; + right: 30px !important; +} + +body.rtl .mec-tooltip .box:before { + left: auto !important; + right: 0 !important; +} + +body.rtl .mec-tooltip .box.left { + left: 30px !important; + right: auto !important; +} + +body.rtl .mec-tooltip .box.left:before { + left: -12px !important; + right: auto !important; +} + +body.rtl .mec-form-row .cancellation-period-box input[type="number"]:first-child { + margin-left: calc(2% + 4px); + margin-right: 0; +} + +body.rtl .support-page .w-box-content ul li i { + margin: 0 0 0 10px; + float: right; +} + +body.rtl .support-page .w-box-content ul li .mec-sl-arrow-right-circle:before { + content: "\e07a"; +} + +body.rtl #webnus-dashboard .w-box.support-page.videobox .w-button a i { + float: left; + line-height: 24px; +} + +body.rtl #webnus-dashboard .mec-faq-accordion-trigger a { + padding-right: 34px; + font-size: 15px; +} + +form .wbmec-mandatory { + color: red; +} + +input.mec-error, +select.mec-error, +textarea.mec-error { + border-color: red; +} + +.mec-copied { + position: absolute; + top: 0; + width: 40%; + opacity: 0; + z-index: -9; + transition: all 0.33s cubic-bezier(); +} + +.mec-copied.mec-copied-done { + opacity: 1; + left: 135px; + z-index: 9; +} + +.m-e-calendar_page_MEC-settings .mec-addons-notification-box-image img { + max-width: 555px; +} + +.m-e-calendar_page_MEC-settings .mec-custom-msg-notification-wrap, +.m-e-calendar_page_MEC-settings .wns-be-container .mec-addons-notification-wrap { + max-width: 1020px; +} + +#mec-event-gallery ul#mec_meta_box_event_gallery { + display: flex; + flex-flow: row wrap; +} + +#mec-event-gallery ul#mec_meta_box_event_gallery li { + flex: 0 1 calc(33.333333% - 10px); + margin-right: 10px; + position: relative; +} + +#mec-event-gallery ul#mec_meta_box_event_gallery li img { + width: 100% !important; + height: 75px; + object-fit: cover; +} + +#mec-event-gallery ul#mec_meta_box_event_gallery li span.mec-event-gallery-delete { + padding: 0; + min-height: 20px; + height: 20px; + width: 20px; + margin: 0; + border-radius: 50%; + position: absolute; + top: 2px; + right: 2px; + box-shadow: none; + background: #fff; + border-color: #e3e4e5; + font-size: 0px; + cursor: pointer; + transition: 0.2s; +} + +#mec-event-gallery ul#mec_meta_box_event_gallery li span.mec-event-gallery-delete:before { + content: ""; + width: 20px; + height: 20px; + display: block; + background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgZm9jdXNhYmxlPSJmYWxzZSIgd2lkdGg9IjFlbSIgaGVpZ2h0PSIxZW0iIHN0eWxlPSItbXMtdHJhbnNmb3JtOiByb3RhdGUoMzYwZGVnKTsgLXdlYmtpdC10cmFuc2Zvcm06IHJvdGF0ZSgzNjBkZWcpOyB0cmFuc2Zvcm06IHJvdGF0ZSgzNjBkZWcpOyIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDIwIDIwIiBmaWxsPSIjZWE2NDg1Ij48cGF0aCBkPSJNMTQuOTUgNi40NkwxMS40MSAxMGwzLjU0IDMuNTRsLTEuNDEgMS40MUwxMCAxMS40MmwtMy41MyAzLjUzbC0xLjQyLTEuNDJMOC41OCAxMEw1LjA1IDYuNDdsMS40Mi0xLjQyTDEwIDguNThsMy41NC0zLjUzeiIvPjwvc3ZnPg=="); + background-position: center; +} + +#mec-event-gallery ul#mec_meta_box_event_gallery li span.mec-event-gallery-delete:hover { + color: #fff; + border-color: #ea6485; + background: #ea6485; +} + +#mec-event-gallery ul#mec_meta_box_event_gallery li span.mec-event-gallery-delete:hover:before { + background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgZm9jdXNhYmxlPSJmYWxzZSIgd2lkdGg9IjFlbSIgaGVpZ2h0PSIxZW0iIHN0eWxlPSItbXMtdHJhbnNmb3JtOiByb3RhdGUoMzYwZGVnKTsgLXdlYmtpdC10cmFuc2Zvcm06IHJvdGF0ZSgzNjBkZWcpOyB0cmFuc2Zvcm06IHJvdGF0ZSgzNjBkZWcpOyIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDIwIDIwIiBmaWxsPSIjZmZmZmZmIj48cGF0aCBkPSJNMTQuOTUgNi40NkwxMS40MSAxMGwzLjU0IDMuNTRsLTEuNDEgMS40MUwxMCAxMS40MmwtMy41MyAzLjUzbC0xLjQyLTEuNDJMOC41OCAxMEw1LjA1IDYuNDdsMS40Mi0xLjQyTDEwIDguNThsMy41NC0zLjUzeiIvPjwvc3ZnPg=="); +} + +.mec-show-hide-password { + cursor: pointer; +} + +.mec-show-hide-password:hover { + text-decoration: underline; +} + +.mec-in-days-add-mode #mec_cancel_in_days, +.mec-in-days-add-mode #mec_edit_in_days, +.mec-in-days-edit-mode #mec_add_in_days { + display: none; +} + +.mec-in-days-add-mode #mec_add_in_days, +.mec-in-days-edit-mode #mec_cancel_in_days, +.mec-in-days-edit-mode #mec_edit_in_days { + display: inline; +} + +ul.system-information li { + display: flex; +} + +ul.system-information li .mec-si-label { + width: 250px; + font-weight: 500; +} + +div[id*="mec_event_fields"] div[aria-label="Fullscreen"] { + display: none; +} + +.mec-backend-tab-wrap { + margin-bottom: 40px; +} + +.mec-backend-tab { + display: inline-block; + padding: 4px; + border: 1px solid #e3e4e5; + border-radius: 6px; + background: #fff; + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; +} + +.mec-backend-tab-item { + display: inline-block; + padding: 11px 33px; + line-height: 1; + font-size: 14px; + font-weight: 400; + border-radius: 5px; + border: 1px solid transparent; + cursor: pointer; + transition: all 0.2s ease; +} + +.mec-backend-tab-item:hover { + color: #07bbe9; +} + +.mec-b-active-tab { + background: #ecf9fd; + color: #07bbe9; + cursor: default; + font-weight: 600; +} + +#mec_export_module_options { + margin: 0; +} + +.mec-hourly-schedule-form-speakers-label { + line-height: 38px; + margin-right: 10px; +} + +.wp-picker-container button { + margin: 4px 6px; +} + +#mec_meta_box_event_banner_options #mec_banner_thumbnail_img { + margin-bottom: 20px; +} + +.mec-label { + line-height: 38px; +} + +.mec-metabox-visibility label.post-attributes-label, +#mec_sb_choose_single_page label.post-attributes-label { + display: block; + margin-bottom: 4px; +} + +.mec-metabox-visibility select, +#mec_sb_choose_single_page select { + width: 100%; +} + +.mec-image-picker-page { + display: flex; + flex-wrap: wrap; + gap: 20px; +} + +.mec-image-picker-page .mec-image-picker-wrapper { + box-sizing: border-box; + max-width: 332px; + flex-basis: calc(100% / 2); + border: 1px solid #e3e5e7; + border-radius: 4px; + padding: 10px; + max-height: 46px; + display: flex; + flex-wrap: wrap; + flex-direction: row; + align-items: center; + justify-content: space-between; + position: relative; + padding-right: 43px; +} + +.mec-image-picker-page .mec-image-picker-wrapper .mec-icon-default { + display: flex; + flex-wrap: wrap; + flex-direction: row; + align-items: center; +} + +.mec-image-picker-page .mec-image-picker-wrapper .mec-icon-default .default { + display: flex; + margin: 2px 5px 0 0; +} + +.mec-image-picker-page .mec-image-picker-wrapper .mec-icon-default .default i { + font-size: 14px; + color: #686f73; +} + +.mec-image-picker-page .mec-image-picker-wrapper .mec-icon-default label { + font-size: 13px; + line-height: 17px; + font-weight: 400; + color: #686f73; +} + +.mec-image-picker-page .mec-image-picker-wrapper .mec-icon-uploader button { + font-size: 11px; + font-weight: 400; + line-height: 24px; + border: 1px solid; + border-radius: 4px; + height: unset; + min-height: unset; + margin: 0 10px 0 0; + padding: 0 10px 0 28px; + background-repeat: no-repeat; + background-position: 10px center; +} + +.mec-image-picker-page .mec-image-picker-wrapper .mec-icon-uploader button.mec-image-picker-upload { + color: #07bbe9; + border-color: #ccecf4; + background-color: #ecf9fd; + background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNCIgaGVpZ2h0PSIxMS41NjUiIHZpZXdCb3g9IjAgMCAxNCAxMS41NjUiPg0KICA8cGF0aCBpZD0ibWVjLXVwbG9hZC1pY29uIiBkPSJNMTEsOTY0LjM2MmE0LjIxOSw0LjIxOSwwLDAsMSw0LjE2NiwzLjQyOSwzLjQ5MSwzLjQ5MSwwLDAsMS0uNjY2LDYuOTE5SDEyLjgyNmEuNDU3LjQ1NywwLDEsMSwwLS45MTNIMTQuNWEyLjU4OCwyLjU4OCwwLDAsMCwuMjM4LTUuMTY0LjQ1Ny40NTcsMCwwLDEtLjQwOS0uNCwzLjM1LDMuMzUsMCwxLDAtNi42NTMuNzg5LjQ1Ni40NTYsMCwwLDEtLjQ1Mi41MTRINy4wNDNhMi4xMywyLjEzLDAsMCwwLDAsNC4yNjFoMi4xM2EuNDU3LjQ1NywwLDEsMSwwLC45MTNINy4wNDNhMy4wMzUsMy4wMzUsMCwwLDEtLjI3Ni02LjA1OEE0LjIxNCw0LjIxNCwwLDAsMSwxMSw5NjQuMzYyWm0wLDUuMTc0YS40MDkuNDA5LDAsMCwxLC4zMDkuMTE5bDEuNjc0LDEuNTIyYS40NjEuNDYxLDAsMCwxLC4wMjkuNjQ3LjQ3OC40NzgsMCwwLDEtLjY0Ny4wMjlsLS45MDgtLjgyOHY0LjQ0NmEuNDU3LjQ1NywwLDEsMS0uOTEzLDB2LTQuNDQ2bC0uOTA4LjgyN2EuNDg4LjQ4OCwwLDAsMS0uNjQ3LS4wMjkuNDYuNDYsMCwwLDEsLjAyOS0uNjQ3bDEuNjc0LTEuNTIyYS4zODUuMzg1LDAsMCwxLC4zMDktLjExOVoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC00IC05NjQuMzYyKSIgZmlsbD0iIzA3YmJlOSIvPg0KPC9zdmc+DQo="); +} + +.mec-image-picker-page .mec-image-picker-wrapper .mec-icon-uploader button.mec-image-picker-remove { + color: #e95271; + border-color: #f3c2c9; + background-color: #feebee; + background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI5LjkyNSIgaGVpZ2h0PSIxMyIgdmlld0JveD0iMCAwIDkuOTI1IDEzIj4NCiAgPHBhdGggaWQ9InRyYXNoLWljb24iIGQ9Ik0xMC4yMDksMS44NjhhMS44LDEuOCwwLDAsMC0zLjQ4OCwwSDMuNXYuOWg5LjkyNXYtLjlIMTAuMjA5Wk04LjQ2MywxLjRhLjkxOS45MTksMCwwLDEsLjc5LjQ2Nkg3LjY4OEEuODkxLjg5MSwwLDAsMSw4LjQ2MywxLjRabTMuNjA5LDIuMjU2aC45djguNDg5QTEuMzU1LDEuMzU1LDAsMCwxLDExLjYyMSwxMy41SDUuM2ExLjM1NSwxLjM1NSwwLDAsMS0xLjM1My0xLjM1M1YzLjY1OGguOXY4LjQ4OUEuNDUyLjQ1MiwwLDAsMCw1LjMsMTIuNmg2LjMxNmEuNDUyLjQ1MiwwLDAsMCwuNDUxLS40NTFWMy42NThabS00LjUxMS45djYuMjE4aC0uOVY0LjU2Wm0yLjcwNywwdjYuMjE4aC0uOVY0LjU2WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTMuNSAtMC41KSIgZmlsbD0iI2U5NTI3MSIvPg0KPC9zdmc+DQo="); +} + +.mec-image-picker-page .mec-image-picker-wrapper .mec-image-picker-preview-wrapper { + background-color: #fafbfc; + width: 42px; + height: 44px; + border-left: 1px solid #e3e5e7; + display: block; + position: absolute; + right: 0; + top: 0; + border-radius: 0 4px 4px 0; + display: flex; + align-items: center; + justify-content: center; +} + +.mec-image-picker-page .mec-image-picker-wrapper .mec-image-picker-preview-wrapper .mec-image-picker-preview, +.mec-image-picker-page .mec-image-picker-wrapper .mec-image-picker-preview-wrapper .mec-image-picker-preview img { + display: block; + max-width: 24px; +} + +button#mec_add_not_in_days { + margin-left: 20px; +} + +.mec-hourly-schedule-schedules .mec-form-row { + cursor: grab; +} + +.mec-hourly-schedule-schedules .mec-form-row.ui-sortable-helper { + cursor: grabbing; +} + +.taxonomy-add-new { + margin: 0; + line-height: 30px; +} + +/* Newsletter */ +.fserv-form-loaded .fs-webform-container .fserv-form-name { + text-align: left !important +} + +/* Extra Content 2 */ +#webnus-dashboard .mec-cmsg-2-notification-box-wrap, +#webnus-dashboard .mec-cmsg-notification-box-wrap { + margin-top: 30px !important; +} + +body[class^="page_MEC-settings"] .w-clearfix.w-box.mec-cmsg-notification-box-wrap { + margin-top: 0; +} + +body[class*="page_MEC-settings"] .mec-custom-msg-notification-set-box.extra, +body[class*="page_MEC-settings"] .mec-custom-msg-2-notification-set-box.extra { + font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Oxygen, Roboto, sans-serif; + max-width: 1018px; + border-radius: 11px; + overflow: hidden; + margin-right: auto; + margin-left: auto; + margin-top: 25px; + margin-bottom: 27px +} + +.mec-addons-key-features ul { + margin: 5px 0 15px; +} + +.mec-addons-key-features ul li { + margin-bottom: 1px; + font-size: 13px; + color: #717479; + padding-left: 18px; + position: relative; +} + +.mec-addons-notification-box-content.mec-new-addons p { + font-size: 14px; +} + +.mec-new-addons .mec-addons-notification-title { + font-size: 20px; + font-weight: 600; + margin-bottom: 12px; +} + +.mec-addons-key-features ul li:before { + position: absolute; + left: -1px; + top: 6px; + color: #36da74; + background: none; + font-size: 13px; + font-weight: bold; + vertical-align: middle; + font-family: "simple-line-icons"; + border-radius: 50%; + padding: 0; + width: 13px; + height: 13px; + line-height: 13px; + z-index: 3; + background: rgba(64, 241, 147, 0.12); + content: "\e080"; +} + +.mec-addons-notification-box-content.mec-new-addons a { + background: #1fcae4; + color: #fff !important; + padding: 6px 20px; + margin-top: 3px; + margin-bottom: 12px; + display: inline-block; + border-radius: 60px; + text-transform: none; + font-size: 13px; + letter-spacing: .4px; + transition: all .1s ease; + font-weight: 600; + text-decoration: none; + box-shadow: 0 0 0 3px rgb(56 213 237 / 8%) !important; +} + +.mec-addons-notification-box-content.mec-new-addons a:hover { + background: #1fcae4; + box-shadow: 0 0 0 4px rgb(56 213 237 / 15%) !important; +} + +.mec-new-addons-wrap .mec-addons-notification-box-image { + width: 590px; + display: inline-block; + vertical-align: top; +} + +body[class*="page_MEC-settings"] .mec-new-addons-wrap .mec-addons-notification-box-image { + width: 450px; +} + +.mec-new-addons-wrap .mec-addons-notification-box-content { + width: calc(100% - 590px); + display: inline-block; + padding-left: 20px; +} + +.mec-new-addons-wrap .mec-addons-notification-box-image img { + max-width: 590px; +} + +body[class*="page_MEC-settings"] .mec-new-addons-wrap .mec-addons-notification-box-image img { + max-width: 450px; +} + +body[class*="page_MEC-settings"] .mec-new-addons-wrap .mec-addons-notification-box-content { + width: calc(100% - 470px); +} + +.mec-new-addons-wrap .w-box-content code { + display: block; + margin-bottom: 6px; +} + +@media(max-width:480px) { + + .mec-new-addons-wrap .mec-addons-notification-box-content { + width: 100%; + padding: 0; + } + + .mec-addons-notification-box-content .w-box-content { + padding-top: 30px; + padding-bottom: 30px; + padding-left: 0; + } + + .mec-new-addons-wrap .mec-addons-notification-box-image { + width: 100% !important; + } + + body[class*="page_MEC-settings"] .mec-new-addons-wrap .mec-addons-notification-box-content { + width: 100% !important; + padding: 0 !important; + } + + body[class*="page_MEC-settings"] .mec-new-addons-wrap .mec-addons-notification-box-content .w-box-content { + padding: 0; + } + +} + +#webnus-dashboard .mec-new-addons-wrap { + margin-top: 30px !important; +} + +#webnus-dashboard .info-msg.w-box.mec-intro-section.version-info-message { + margin-bottom: 25px; + min-height: auto; +} + +#webnus-dashboard .info-msg.w-box.mec-intro-section.version-info-message a.info-msg-link { + line-height: 40px; + font-weight: 600; + border: none; + cursor: pointer; + padding: 0 30px; + border-radius: 33px; + color: #fff; + letter-spacing: 1px; + text-transform: uppercase; + font-size: 12px; + text-shadow: none; + background: #64e385; + transition: all .28s ease; + box-shadow: 0 5px 10px -5px #64e385; +} + +tr[data-slug="mec"] a.open-plugin-details-modal { + display: none; +} + +#mec_restful_container_toggle .mec-api-key-wrapper code { + line-height: 38px; + margin-left: 20px; +} \ No newline at end of file diff --git a/assets/css/backend.min.css b/assets/css/backend.min.css new file mode 100755 index 0000000..8229f91 --- /dev/null +++ b/assets/css/backend.min.css @@ -0,0 +1,5 @@ +body.m-e-calendar_page_MEC-addons,body.m-e-calendar_page_MEC-ix,body.m-e-calendar_page_MEC-report,body.m-e-calendar_page_MEC-settings,body.mec_invoice_page_api-key-app,body.toplevel_page_mec-intro{background:#fff}body.toplevel_page_mec-intro #webnus-dashboard .mec-cmsg-2-notification-box-wrap{margin-top:0!important}#mec_location_thumbnail_img img,#mec_organizer_thumbnail_img img,#mec_sponsor_thumbnail_img img,#mec_thumbnail_img img{max-width:250px}.taxonomy-mec_label .column-id,.taxonomy-mec_location .column-id,.taxonomy-mec_organizer .column-id,.taxonomy-mec_speaker .column-id,.taxonomy-mec_sponsor .column-id{width:40px}.taxonomy-mec_label .column-primary,.taxonomy-mec_location .column-primary,.taxonomy-mec_organizer .column-primary,.taxonomy-mec_speaker .column-primary,.taxonomy-mec_sponsor .column-primary{width:250px}.mec-color{width:16px;height:16px;display:inline-block;border-radius:50%;margin:6px 10px 6px 0;vertical-align:middle}.mec-send-email-button{background:#008aff;color:#fff;width:100%;display:block;text-align:center;font-size:20px;padding:10px 0;margin-top:18px;font-weight:700;border-radius:4px;cursor:pointer}.mec-send-email-button:hover{opacity:.9}.mec-event-color-container,.mec-event-title-container{display:inline-block}.mec-meta-box-colors-container .mec-form-row{padding:0!important}.mec-meta-box-colors-container .mec-form-row .wp-picker-container{margin:10px 0}.mec-available-color-row{margin-top:0}.mec-available-color-row .mec-color{cursor:pointer}.mec-widget-container a{text-decoration:none}.mec-widget-container label{padding-right:15px}.mec-util-hidden{display:none}.button.mec-util-hidden{display:none}.wns-be-container{max-width:1020px;background-color:#f7f8f9;background-repeat:repeat-x;border:1px solid #dcdfe1;border-radius:15px;overflow:hidden;margin:25px auto;overflow:visible;box-shadow:0 1px 4px rgb(0 0 0 / 1%);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif}.wns-be-sidebar{width:230px;float:left;position:relative}.wns-be-sidebar ul.wns-be-group-menu,.wns-be-sidebar ul.wns-be-group-menu li{list-style:none;margin:0;transition:all .2s ease}.wns-be-sidebar .wns-be-group-menu li a{display:block;position:relative;outline:0;padding:13px 4px 13px 20px;background:#e3e5e7;background:0 0;border:none;color:#3f454a;font-size:14px;font-weight:600;text-decoration:none;transition:all .2s ease}.wns-be-sidebar .wns-be-group-menu>li:hover>a{color:#07bbe9;background:#fff;opacity:1}.wns-be-sidebar .wns-be-group-menu>li.active>a{text-shadow:none;background:#ecf9fd;color:#07bbe9;border-top:1px solid #ccecf4}.wns-be-sidebar .wns-be-group-menu>li:first-child>a{border-top:none}.wns-be-main{background:#fff;margin-left:230px;border-left:1px solid #e6e9eb;padding-bottom:84px;box-shadow:inset 0 1px 0 #fff;min-height:1110px;position:relative;z-index:2}.wns-be-main .wns-saved-settings{margin:0;border-bottom:1px solid #dedede;background:#dff0d8;color:#468847;padding:8px 35px 8px 14px;text-shadow:0 1px 0 rgba(255,255,255,.6)}.wns-be-container .dpr-btn{display:inline-block;font-size:13px;padding:0 16px 1px;height:36px;margin-right:3px;line-height:35px;color:#555;border:1px solid #ccc;background:#f7f7f7;text-decoration:none;transition:.24s all ease;-webkit-transition:.24s all ease}.wns-be-container .dpr-btn:hover{background:#fcfcfc;border-color:#999;color:#303030}.wns-be-container .dpr-btn.dpr-save-btn{display:inline-block;text-decoration:none;padding:0 16px;height:36px;line-height:36px;font-weight:500;font-size:14px;border-radius:20px;box-shadow:0 1px 2px rgb(0 0 0 / 2%);text-shadow:none;margin-right:5px;background:#fff;color:#0ec3f3;border:1px solid #d1e5ec;letter-spacing:.2px;transition:.24s all ease}.wns-be-container .dpr-btn.dpr-save-btn{box-shadow:0 0 0 4px #e4ffe6;text-shadow:none;margin-right:5px;background:#64e385;color:#fff;border:none;cursor:pointer;padding:1px 22px}.wns-be-container .dpr-btn.dpr-save-btn:hover{box-shadow:0 0 0 6px rgb(100 227 133 / 28%);background:#54d274;border-color:#4ac76a}.wns-be-container .wns-be-group-tab h2,.wns-be-container .wns-be-group-tab h4{margin-bottom:27px;margin-top:0;padding:12px 15px 12px 15px;font-size:21px;line-height:27px;letter-spacing:-.4px;font-weight:700;position:relative}.wns-be-container .wns-be-group-tab h4,.wns-be-container .wns-be-group-tab h5{margin:5px 0 10px}.wns-be-container .wns-be-group-tab h2:before,.wns-be-container .wns-be-group-tab h4:before{content:"";width:4px;height:16px;margin-right:5px;background-color:#07bbe9;display:block;position:absolute;left:0;top:19px}.wns-be-container .wns-be-group-tab h5{font-size:15px;font-weight:700;margin:30px 0 25px;position:relative}.wns-be-container .wns-be-group-tab h5::after{content:"";display:inline-block;width:100%;height:1px;border-bottom:1px solid #eee;position:absolute;top:9px;margin-left:10px}.wns-be-group-tab #booking_form_option h5{font-size:16px;font-weight:400;margin:35px 5px 10px}.wns-be-container .wns-be-group-tab p{font-size:12px;line-height:1.6;color:#8d9599;font-weight:400;margin:0}.wns-be-sidebar .wns-be-group-tab-link-a span{display:block}.wns-be-sidebar .wns-be-group-tab-link-a span.wns-be-group-menu-title{padding-left:24px;padding-top:1px;font-size:14px;font-weight:600}.wns-be-sidebar li.active ul.subsection{padding-top:8px;padding-bottom:12px;background:#fff;border-bottom:1px solid #e6e9eb;margin:0}.wns-be-sidebar li .subsection a{background:#fff;color:#686f73;opacity:1;font-size:13px;font-weight:400;cursor:pointer;padding:8px 4px 8px 46px}.wns-be-sidebar li .subsection a:hover{background:#fafafa;color:#242525}.wns-be-container li a:active,.wns-be-container li a:focus{outline:0;box-shadow:none}.wns-be-sidebar .wns-be-group-menu li .subsection li.active a{color:#00b0dd;position:relative;z-index:99;font-weight:500}.wns-be-sidebar .wns-be-group-menu li .subsection li.active a:after,.wns-be-sidebar .wns-be-group-menu li .subsection li.active a:before{position:absolute;z-index:9999;content:" ";height:0;width:0;border:8px solid transparent;border-right-color:#fff;right:-1px;top:10px}.wns-be-sidebar .wns-be-group-menu li .subsection li.active a:before{border-right-color:#d7d8d9;right:0}.wns-be-sidebar li a i{color:#a0abb5;vertical-align:middle;font-size:16px;position:absolute;margin-top:2px}.wns-be-sidebar .wns-be-group-menu li.active>a i,.wns-be-sidebar .wns-be-group-menu li:hover>a i{color:#07bbe9}.wns-be-sidebar .has-sub span.extra-icon{float:right;padding:4px 7px 4px;margin-left:4px;margin-right:10px;font-family:sans-serif;font-size:9px;font-weight:600;line-height:9px;border-radius:10px;-moz-border-radius:10px;-webkit-border-radius:10px;border:0 solid transparent}.wns-be-sidebar .has-sub span.extra-icon i{margin-left:-3px;margin-top:2px;color:#bac6d0;font-size:10px}.wns-be-sidebar .wns-be-group-tab-link-a span.extra-icon i{right:10px;font-size:10px}.wns-be-sidebar .wns-be-group-menu li.active>a span.extra-icon i{margin-top:1px}.wns-be-container #wns-be-footer{border-top:1px solid #dedede;z-index:999;padding:25px 20px 20px;background:#fafafa!important;height:44px;text-align:right;border-radius:0 0 14px 14px}.wns-be-container #wns-be-content{padding:0 20px 40px 40px}.wns-be-container #wns-be-infobar{background:#fff;border-bottom:1px solid #e6e9eb;padding:20px;text-align:right;box-shadow:inset 0 1px 0 #fcfcfc;height:79px;box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;position:relative;border-radius:14px 14px 0 0}.wns-be-container #wns-be-infobar:before{content:"";width:93px;height:77px;display:block;position:absolute;left:0;top:0;background:#fff url(../img/mec-logo-icon.png) no-repeat center;background-size:50px;z-index:997;border-radius:14px 0 0 0}.wns-be-container .notice-yellow{margin:0;border-bottom:1px solid #dedede;background-color:#fcf8e3;color:#c09853;padding:8px 35px 8px 14px;text-shadow:0 1px 0 rgba(255,255,255,.5)}.wns-be-container .notice-red,.wns-be-container .wns-be-field-errors{margin:0;border-bottom:1px solid #dedede;background-color:#f2dede;color:#b94a48;padding:8px 35px 8px 14px;text-shadow:0 1px 0 rgba(255,255,255,.5)}.wns-be-container #mec_styling_form .button,.wns-be-container #mec_styling_form .button-secondary{border-color:#e6e9eb;background:#fff;vertical-align:top;border-radius:4px;box-shadow:0 3px 10px -1px rgb(0 0 0 / 1%);transition:all .2s ease}.wns-be-container .wp-color-result-text{border-color:#e6e9eb}.wns-be-container #mec_styling_form .button-secondary:hover,.wns-be-container #mec_styling_form .button.hover,.wns-be-container #mec_styling_form .button:hover{background:#f0f9fc;border-color:#d1e5ec}.wns-be-container #mec_styling_form .wp-color-result:hover{background:#f0f9fc}@media (max-width:1280px){.wns-be-container{width:98%}.wns-be-container #wns-be-content{padding:5px 20px 20px}.wns-be-sidebar li .subsection a{padding-left:24px}.wns-be-main{margin-left:210px}.wns-be-sidebar{width:210px}.mec-form-row .mec-col-8 label,.mec-form-row .mec-col-9 label{padding-right:14px}.wns-be-container #wns-be-content{padding:5px 10px 0}.mec-container{padding:8px}}@media (max-width:1024px){.wns-be-main .mec-form-row .mec-col-3{min-width:200px}.wns-be-main .mec-form-row .mec-col-9{width:calc(100% - 210px)}}@media (max-width:860px){.wns-be-main .mec-form-row .mec-col-3{max-width:100%!important;width:100%!important;margin-bottom:10px!important}.wns-be-main .mec-form-row .mec-col-9{width:100%!important}.mec-container{padding-left:0!important}.wns-be-container #wns-be-infobar:before{display:none}.mec-search-settings-wrap{margin-top:0!important}#wns-be-infobar.sticky{top:0!important}#mec-search-settings{margin-bottom:10px!important}}@media (max-width:640px){.wns-be-sidebar{width:150px}.wns-be-main{margin-left:150px}}@media (max-width:480px){a.dpr-btn.dpr-save-btn{display:block!important;text-align:center!important;margin-top:20px!important}.mec-search-settings-wrap{text-align:center!important;display:block!important}#mec-search-settings{margin:0!important;width:100%!important}.wns-be-container #wns-be-infobar{height:auto!important}.wns-be-container .wns-be-sidebar{width:100%;position:unset;float:none}.wns-be-container .wns-be-main{margin-left:0;width:100%;position:unset}.wns-be-container{margin-top:50px}.wns-be-container #wns-be-infobar:before{width:100%}.wns-be-container #wns-be-infobar{height:150px}#mec-search-settings{margin-top:80px;width:181px}}body.post-type-mec-events th.column-primary{width:35%}body.post-type-mec-events th.column-start_date{width:100px}body.post-type-mec-events th.column-end_date{width:100px}body.post-type-mec-events th.column-repeat{width:75px}body.post-type-mec-events th.column-author{width:150px}body.post-type-mec-books th.column-primary{width:20%}body.post-type-mec-books th.column-event{width:170px}body.post-type-mec-books th.column-bdate{width:120px}body.post-type-mec-books th.column-confirmation{width:120px}body.post-type-mec-books th.column-verification{width:120px}body.post-type-mec-books th.column-author{width:150px}.mec-meta-box-labels-container .mec-form-row{overflow:auto}.mec-form-row.mec-last-tooltip{padding-bottom:100px!important}.mec-tooltip{display:inline-block;position:relative;margin-right:10px;cursor:help;bottom:0}.mec-tooltip:last-child{margin-right:0}.mec-tooltip:hover:after{background:#313130;border-radius:5px;bottom:24px;color:#fff;content:attr(title);left:-75px;padding:10px;position:absolute;z-index:98;width:240px}.mec-tooltip:hover:before{border:solid;border-color:#313130 transparent;border-width:6px 6px 0;bottom:18px;content:"";left:30%;position:absolute;z-index:99}.mec-tooltip .dashicons-before:before{font-size:24px;color:#40d9f1;width:24px;height:38px;line-height:38px;padding:0}.mec-tooltip a:focus{box-shadow:none}.mec-form-row .bootstrap_unvalid{display:block;border:2px solid red;position:relative;display:inline-block;border-bottom:1px dotted #000}.mec-tooltiptext{visibility:hidden;width:120px;background-color:red;color:#fff;text-align:center;border-radius:6px;padding:5px 0;position:absolute;z-index:1}.ui-datepicker{background-color:#fff;border:1px solid #66afe9;border-radius:4px;box-shadow:0 0 8px rgba(102,175,233,.6);display:none;margin-top:4px;padding:10px;width:240px}.ui-datepicker a,.ui-datepicker a:hover{text-decoration:none;cursor:pointer}.ui-datepicker a:hover,.ui-datepicker td:hover a{color:#2c6396;-webkit-transition:color .1s ease-in-out;-moz-transition:color .1s ease-in-out;-o-transition:color .1s ease-in-out;transition:color .1s ease-in-out}.ui-datepicker .ui-datepicker-header{margin-bottom:4px;text-align:center}.ui-datepicker .ui-datepicker-title{font-weight:700}.ui-datepicker .ui-datepicker-next,.ui-datepicker .ui-datepicker-prev{cursor:default;font-family:dashicons;-webkit-font-smoothing:antialiased;font-style:normal;font-weight:400;height:20px;line-height:1.4;margin-top:2px;width:20px}.ui-datepicker .ui-datepicker-prev{float:left;text-align:left}.ui-datepicker .ui-datepicker-next{float:right;text-align:center}.ui-datepicker .ui-datepicker-prev:before{content:"\f341"}.ui-datepicker .ui-datepicker-next:before{content:"\f345"}.ui-datepicker .ui-icon{display:none}.ui-datepicker .ui-datepicker-calendar{table-layout:fixed;width:100%}.ui-datepicker .ui-datepicker-calendar td,.ui-datepicker .ui-datepicker-calendar th{text-align:center;padding:4px 0}.ui-datepicker .ui-datepicker-calendar td{border-radius:4px;-webkit-transition:background-color .1s ease-in-out,color .1s ease-in-out;-moz-transition:background-color .1s ease-in-out,color .1s ease-in-out;-o-transition:background-color .1s ease-in-out,color .1s ease-in-out;transition:background-color .1s ease-in-out,color .1s ease-in-out}.ui-datepicker .ui-datepicker-calendar td:hover{background-color:#eee;cursor:pointer}.ui-datepicker .ui-datepicker-calendar td a{text-decoration:none}.ui-datepicker .ui-datepicker-current-day{background-color:#4289cc}.ui-datepicker .ui-datepicker-current-day a{color:#fff}.ui-datepicker .ui-datepicker-calendar .ui-datepicker-unselectable:hover{background-color:#fff;cursor:default}.mec-col-1,.mec-col-10,.mec-col-11,.mec-col-12,.mec-col-2,.mec-col-3,.mec-col-4,.mec-col-5,.mec-col-6,.mec-col-7,.mec-col-8,.mec-col-9{position:relative;min-height:1px;padding:0;margin:0}@media (min-width:783px){.mec-col-1,.mec-col-10,.mec-col-11,.mec-col-12,.mec-col-2,.mec-col-3,.mec-col-4,.mec-col-5,.mec-col-6,.mec-col-7,.mec-col-8,.mec-col-9{float:left}.mec-col-12{width:99%}.mec-col-11{width:90.66666667%}.mec-col-10{width:82.33333333%}.mec-col-9{width:74%}.mec-col-8{width:65.66666667%}.mec-col-7{width:57.33333333%}.mec-col-6{width:49%}.mec-col-5{width:40.66666667%}.mec-col-4{width:32.33333333%}.mec-col-3{width:24%}.mec-col-2{width:15.66666667%}.mec-col-1{width:7.33333333%}}#mec-occurrences .mec-occurrences-list,#mec_bfixed_form_fields,#mec_event_form_fields,#mec_orgz_form_row,#mec_reg_form_fields{background:#f7f8f9;padding:20px;margin:0 0 20px 0;border-radius:3px;min-height:150px;border:2px dashed #dcdee0}#mec-occurrences .mec-occurrences-list li,#mec_bfixed_form_fields li,#mec_event_form_fields li,#mec_orgz_form_row li,#mec_reg_form_fields li{border-radius:5px;padding:25px;background:#fff;position:relative;transition:all .3s ease;border:1px solid #f1f3f5;box-shadow:0 1px 5px rgb(0 0 0 / 2%)}#mec_reg_form_fields li div input,#mec_reg_form_fields li div select{display:block}#mec_bfixed_form_fields li ul,#mec_event_form_fields li ul,#mec_reg_form_fields li ul{padding-top:15px;padding-bottom:15px;margin:1px}#mec_bfixed_form_fields li ul li,#mec_event_form_fields li ul li,#mec_reg_form_fields li ul li{padding:7px 30px 7px 46px}#mec_bfixed_form_fields span.mec_bfixed_field_type,#mec_bfixed_form_fields span.mec_event_field_type,#mec_event_form_fields span.mec_event_field_type,#mec_orgz_form_row span.mec_orgz_item_name,#mec_reg_form_fields span.mec_reg_field_type{font-size:12px;font-weight:600;color:#07bbe9;text-transform:capitalize;letter-spacing:.3px;padding-left:20px}#mec-occurrences .mec-occurrences-list .mec-occurrences-delete-button,#mec_bfixed_form_fields span.mec_bfixed_field_option_sort,#mec_bfixed_form_fields span.mec_bfixed_field_remove,#mec_bfixed_form_fields span.mec_bfixed_field_sort,#mec_event_form_fields span.mec_event_field_option_sort,#mec_event_form_fields span.mec_event_field_remove,#mec_event_form_fields span.mec_event_field_sort,#mec_orgz_form_row span.mec-additional-organizer-remove,#mec_orgz_form_row span.mec-additional-organizer-sort,#mec_reg_form_fields span.mec_reg_field_option_sort,#mec_reg_form_fields span.mec_reg_field_remove,#mec_reg_form_fields span.mec_reg_field_sort{font-size:0;color:#fff}#mec-occurrences .mec-occurrences-list .mec-occurrences-delete-button,#mec_bfixed_form_fields span.mec_bfixed_field_remove,#mec_event_form_fields span.mec_event_field_remove,#mec_orgz_form_row span.mec-additional-organizer-remove,#mec_reg_form_fields span.mec_reg_field_remove{position:absolute;right:0;top:0;background:#fff}#mec-occurrences .mec-occurrences-list .mec-occurrences-delete-button:before,#mec_bfixed_form_fields span.mec_bfixed_field_option_sort:before,#mec_bfixed_form_fields span.mec_bfixed_field_remove:before,#mec_bfixed_form_fields span.mec_bfixed_field_sort:before,#mec_event_form_fields span.mec_event_field_option_sort:before,#mec_event_form_fields span.mec_event_field_remove:before,#mec_event_form_fields span.mec_event_field_sort:before,#mec_orgz_form_row span.mec-additional-organizer-remove:before,#mec_orgz_form_row span.mec-additional-organizer-sort:before,#mec_reg_form_fields span.mec_reg_field_option_sort:before,#mec_reg_form_fields span.mec_reg_field_remove:before,#mec_reg_form_fields span.mec_reg_field_sort:before{position:absolute;left:20px;top:23px;width:20px;height:20px;display:block;cursor:move;font-family:simple-line-icons;content:"\e023";font-size:15px;color:#07bbe9}#mec-occurrences .mec-occurrences-list .mec-occurrences-delete-button:before{font-weight:400}#mec-occurrences .mec-occurrences-list .mec-occurrences-delete-button:before,#mec_bfixed_form_fields span.mec_bfixed_field_remove:before,#mec_event_form_fields span.mec_event_field_remove:before,#mec_orgz_form_row span.mec-additional-organizer-remove:before,#mec_reg_form_fields span.mec_reg_field_remove:before{content:"\e082";width:20px;height:20px;left:auto;right:15px;color:#f96666;cursor:pointer;font-size:18px}#mec_bfixed_form_fields span.mec_bfixed_field_option_sort:before,#mec_event_form_fields span.mec_event_field_option_sort:before,#mec_reg_form_fields span.mec_reg_field_option_sort:before{font-size:13px;left:15px;top:25px;width:15px;height:15px}#mec_bfixed_form_fields p.mec_bfixed_field_options,#mec_event_form_fields p.mec_event_field_options,#mec_reg_form_fields p.mec_reg_field_options{margin:12px 0 8px}#mec_bfixed_form_fields input[type=number],#mec_bfixed_form_fields input[type=text],#mec_bfixed_form_fields select,#mec_bfixed_form_fields textarea,#mec_event_form_fields input[type=number],#mec_event_form_fields input[type=text],#mec_event_form_fields select,#mec_event_form_fields textarea,#mec_reg_form_fields input[type=number],#mec_reg_form_fields input[type=text],#mec_reg_form_fields select,#mec_reg_form_fields textarea{min-width:260px;min-height:34px;margin-bottom:7px;margin-top:7px}#mec_bfixed_form_fields textarea,#mec_event_form_fields textarea,#mec_reg_form_fields textarea{min-height:66px}#mec_bfixed_form_field_types button,#mec_bfixed_form_fields button,#mec_event_form_field_types button,#mec_event_form_fields button,#mec_reg_form_field_types button,#mec_reg_form_fields button{position:relative;outline:0;background:#fff;border:1px solid #e6e9eb;border-radius:50px;padding:9px 21px 10px 31px;line-height:1;font-size:12px;font-weight:600;color:#07bbe9;letter-spacing:.4px;height:auto;cursor:pointer;margin-top:5px;text-transform:capitalize;box-shadow:0 0 3px rgba(0,0,0,.03)}#mec_bfixed_form_field_types button:hover,#mec_bfixed_form_fields button:hover,#mec_event_form_field_types button:hover,#mec_event_form_fields button:hover,#mec_reg_form_field_types button:hover,#mec_reg_form_fields button:hover{border-color:#07bbe9;box-shadow:0 0 7px rgba(0,0,0,.1)}#mec_bfixed_form_field_types button:before,#mec_bfixed_form_fields button:before,#mec_event_form_field_types button:before,#mec_event_form_fields button:before,#mec_reg_form_field_types button:before,#mec_reg_form_fields button:before{position:absolute;left:10px;color:#07bbe9;content:"\e095";font-family:simple-line-icons;font-size:13px;display:inline-block;top:9px}#mec_bfixed_form_field_types button.red:hover,#mec_bfixed_form_fields button.red:hover,#mec_event_form_field_types button.red:hover,#mec_event_form_fields button.red:hover,#mec_reg_form_field_types button.red:hover,#mec_reg_form_fields button.red:hover{border-color:#ea6485;box-shadow:0 0 7px rgba(0,0,0,.1)}#mec_bfixed_form_field_types button.red:before,#mec_bfixed_form_fields button.red:before,#mec_event_form_field_types button.red:before,#mec_event_form_fields button.red:before,#mec_reg_form_field_types button.red:before,#mec_reg_form_fields button.red:before{position:absolute;left:12px;color:#ea6485;content:"\e095";font-family:simple-line-icons;font-size:13px;display:inline-block}#mec_bfixed_form_fields .mec_bfixed_notification_placeholder,#mec_event_form_fields .mec_event_notification_placeholder,.mec_form_fields .notification_placeholder{padding:2px;display:block;margin:10px 0 20px}@media (max-width:768px){#mec_bfixed_form_fields input[type=number],#mec_bfixed_form_fields input[type=text],#mec_bfixed_form_fields select,#mec_bfixed_form_fields textarea,#mec_event_form_fields input[type=number],#mec_event_form_fields input[type=text],#mec_event_form_fields select,#mec_event_form_fields textarea,#mec_reg_form_fields input[type=number],#mec_reg_form_fields input[type=text],#mec_reg_form_fields select,#mec_reg_form_fields textarea{min-width:80px;width:100%}}.mec-form-row{padding:5px 5px 35px}.wns-be-main .mec-form-row{padding:0 5px 20px;width:100%;clear:both;min-height:50px;box-sizing:border-box}#taxes_option #mec_fees_list .mec-form-row,#ticket_variations_option #mec_ticket_variations_list .mec-form-row{padding:10px}.post-type-mec-events .mec-form-row{padding:0 0 20px 0}.mec-form-row .mec-col-3{margin:0;padding-right:10px}.mec-form-row label.mec-col-3{cursor:default}.wns-be-main .mec-form-row .mec-col-3:not([name*="mec[settings][tickets]"]):not([for*=mec_tickets_unlimited]){min-width:290px;padding:1px 0 0;margin:0}.wns-be-main .mec-form-row .mec-col-9{width:calc(100% - 290px);float:right}.mec-form-row .mec-col-9 .mec-box{position:relative;border:1px solid #e6e9eb;padding:20px;margin:0;background:#fff;max-width:80%;border-radius:8px;box-shadow:0 1px 3px rgb(0 0 0 / 1%)}.mec-form-row .mec-col-9 .mec-box label{display:block;padding:20px 20px 4px}.mec-form-row .mec-col-9 .mec-box .mec-tooltip{position:absolute;display:block;width:fit-content;left:auto;right:20px;bottom:20px}#booking_option .mec-form-row .mec-col-8{margin:0}.mec-options-fields{padding-top:25px;overflow:hidden;animation:fadeEffect .31s;min-height:450px}#mec_booking_form .mec-options-fields,#mec_integrations_form .mec-options-fields,#mec_modules_form .mec-options-fields,#mec_notifications_form .mec-options-fields,#mec_settings_form .mec-options-fields,#mec_single_form .mec-options-fields{display:none}.mec-options-fields.active{display:block!important}@keyframes fadeEffect{from{opacity:0;margin-left:12px}to{opacity:1;margin-left:0}}.mec-form-row:after,.mec-form-row:before{content:" ";display:table}.mec-form-row:after{clear:both}.mec-form-row input[type=number],.mec-form-row input[type=text],.mec-form-row input[type=url],.mec-form-row select,.mec-form-row textarea{height:38px;box-sizing:border-box;margin-bottom:8px;padding:0 6px;box-shadow:none;border-radius:2px;box-shadow:inset 0 1px 5px rgba(0,0,0,.05);margin:0 1% 0 0}#mec-notifications .mec-form-row .mec-form-row input[type=text],#mec-notifications .mec-form-row .mec-form-row input[type=url],#mec-notifications .mec-form-row .mec-form-row select,#mec-notifications .mec-form-row .mec-form-row textarea,#mec-notifications .mec-form-row input[type=number]{width:100%;max-width:290px}#mec_location_new_container .mec-form-row input[type=text],#mec_organizer_new_container .mec-form-row input[type=text],#mec_sponsor_new_container .mec-form-row input[type=text]{min-width:200px}#mec-notifications .mec-form-row .mec-form-row textarea{max-width:100%}.wns-be-main .mec-form-row input[type=number]:not([name*="mec[settings][tickets]"]),.wns-be-main .mec-form-row input[type=password]:not([name*="mec[settings][tickets]"]),.wns-be-main .mec-form-row input[type=text]:not([name*="mec[settings][tickets]"]),.wns-be-main .mec-form-row input[type=url]:not([name*="mec[settings][tickets]"]),.wns-be-main .mec-form-row select:not([name*="mec[settings][tickets]"]),.wns-be-main .mec-form-row textarea:not([name*="mec[settings][tickets]"]){width:100%;max-width:290px;margin-left:-1px;margin-right:-1px;margin-bottom:0}.wns-be-main .mec-form-row textarea:not([name*="mec[settings][tickets]"]){max-width:unset}.wns-be-main .mec-form-row .wp-editor-area{max-width:100%;background:#fff;margin:0}#mec_bfixed_form_fields input[type=number],#mec_bfixed_form_fields input[type=text],#mec_bfixed_form_fields select,#mec_bfixed_form_fields textarea,#mec_event_form_fields input[type=number],#mec_event_form_fields input[type=text],#mec_event_form_fields select,#mec_event_form_fields textarea,#mec_reg_form_fields input[type=number],#mec_reg_form_fields input[type=text],#mec_reg_form_fields select,#mec_reg_form_fields textarea,.wns-be-main .mec-form-row input[type=email],.wns-be-main .mec-form-row input[type=number],.wns-be-main .mec-form-row input[type=password],.wns-be-main .mec-form-row input[type=search],.wns-be-main .mec-form-row input[type=text],.wns-be-main .mec-form-row input[type=url],.wns-be-main .mec-form-row select{border-radius:5px;min-height:38px;border:none;background-color:#f7f8f9;box-shadow:inset 0 1px 2px rgb(0 0 0 / 7%);margin-bottom:15px!important}.select2-container--default .select2-selection--multiple,.select2-container--default.select2-container--focus .select2-selection--multiple{border-radius:5px;min-height:38px;border:none;background-color:#f7f8f9;box-shadow:inset 0 1px 2px rgb(0 0 0 / 7%)}.select2-container--default .select2-selection--multiple .select2-selection__rendered{padding:5px 0;min-height:28px;display:inline-block;margin:0}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{line-height:1.2}.select2-container .select2-search--inline .select2-search__field{min-height:unset;margin:0;height:39px}.select2-container--default .select2-selection--multiple input[type=search]{border-radius:unset;min-height:2;border:none;background-color:transparent;box-shadow:none;margin:0!important}.select2-container--default .select2-selection--multiple{line-height:17px}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{margin-bottom:0}.post-type-mec-events .mec-add-event-tabs-wrap .select2-container,.post-type-mec-events .mec-create-shortcode-tab-content .select2-container,.wns-be-main .mec-form-row .mec-create-shortcode-tab-content .select2-container{border:none;background-color:#f7f8f9;border-radius:5px;line-height:38px;padding-left:10px;min-height:38px;box-shadow:inset 0 1px 2px rgb(0 0 0 / 7%)}.mec-add-event-tabs-wrap .select2-container .select2-selection--multiple,.mec-create-shortcode-tab-content .select2-container .select2-selection--multiple,.wns-be-main .mec-form-row .select2-container .select2-selection--multiple{min-height:38px;padding:0;border:none;box-shadow:none;background:0 0;border:none!important;box-shadow:none!important}.post-type-mec-events .select2-dropdown,.wns-be-main .mec-form-row .select2-dropdown{border:1px solid #ddd!important}.post-type-mec-events .select2-container--default .select2-selection--single .select2-selection__rendered{padding-left:0}.wns-be-main .mec-form-row input[type=search]{line-height:2!important}.wns-be-main .mec-form-row .select2-container{width:100%!important;max-width:290px!important}.wns-be-main #mec_messages_form_container input[type=text]{max-width:100%}.mec-form-row input[type=radio]{margin:0 6px 0 0}.mec-form-row select{margin-top:0}.mec-form-row select{min-width:80px}.cancellation-period-box{max-width:290px}.mec-form-row .cancellation-period-box input[type=number]{width:48%}.mec-form-row .cancellation-period-box input[type=number]:first-child{margin-right:calc(2% + 4px)}#mec_meta_box_repeat_form .mec-form-row select{min-width:65px}.ui-datepicker select{min-width:60px}#mec_styles_CSS{max-width:100%}.mec-book-status-form select{display:block;width:99%;margin-top:10px;margin-bottom:10px}.mec-form-row label{vertical-align:top;text-align:left;margin-top:0;margin-bottom:0;line-height:38px;font-weight:600;padding:0!important;display:inline-block}.mec-form-row input[type=checkbox]+label{padding-top:1px}.mec-meta-box-labels-container .mec-form-row label{padding-top:0;line-height:2.1}#mec_reg_form_fields label,#mec_reg_form_fields p.description{display:block}.mec-form-row label.mec-col-2,.mec-form-row label.mec-col-4{padding-top:10px}#mec-event-data .mec-form-row label{display:block}#mec_bfixed_form_fields input[type=checkbox],#mec_reg_form_fields input[type=checkbox],.mec-form-row input[type=checkbox]{width:22px;height:22px;min-height:0;background:#f7f8f9;border:none;margin:-1px 5px 0 0;vertical-align:middle;box-shadow:inset 0 1px 2px rgb(0 0 0 / 7%)}#mec_bfixed_form_fields input[type=checkbox]:checked,#mec_reg_form_fields input[type=checkbox]:checked,.mec-form-row input[type=checkbox]:checked{background:#64e385;border-color:#64e385}#mec_bfixed_form_fields input[type=checkbox]:checked:before,#mec_reg_form_fields input[type=checkbox]:checked:before,.mec-form-row input[type=checkbox]:checked:before{content:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIxNC42ODgiIHZpZXdCb3g9IjAgMCAyMCAxNC42ODgiPg0KICA8ZyBpZD0idGlja18xXyIgZGF0YS1uYW1lPSJ0aWNrICgxKSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAtNjcuOTk4KSI+DQogICAgPGcgaWQ9Ikdyb3VwXzEiIGRhdGEtbmFtZT0iR3JvdXAgMSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCA2Ny45OTcpIj4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzEiIGRhdGEtbmFtZT0iUGF0aCAxIiBkPSJNMTkuNzA3LDY4LjI5YTEsMSwwLDAsMC0xLjQxNCwwTDYuMzEyLDgwLjI3MSwxLjcwNyw3NS42NjZBMSwxLDAsMCwwLC4yOTIsNzcuMDhMNS42LDgyLjM5MmExLDEsMCwwLDAsMS40MTQsMEwxOS43MDcsNjkuN0ExLDEsMCwwLDAsMTkuNzA3LDY4LjI5WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAtNjcuOTk3KSIgZmlsbD0iI2ZmZiIvPg0KICAgIDwvZz4NCiAgPC9nPg0KPC9zdmc+DQo=");line-height:22px;width:15px;float:none;margin:0}.post-type-mec-events #mec_metabox_label input[type=checkbox],.post-type-mec-events .components-panel__body input[type=checkbox]{border-radius:4px;box-shadow:inset 0 1px 2px rgb(0 0 0 / 10%)}.post-type-mec-events #mec_metabox_label input[type=checkbox]:focus,.post-type-mec-events .components-panel__body input[type=checkbox]:focus{outline:unset;box-shadow:unset}.post-type-mec-events #mec_metabox_label input[type=checkbox]+label,.post-type-mec-events .components-panel__body input[type=checkbox]+label{padding-top:1px}.post-type-mec-events #mec_metabox_label input[type=checkbox],.post-type-mec-events .components-panel__body input[type=checkbox]{width:22px;height:22px;min-height:0;background:#f7f8f9;border:none;box-shadow:inset 0 1px 2px rgb(0 0 0 / 7%)}.post-type-mec-events #mec_metabox_label input[type=checkbox]:checked,.post-type-mec-events .components-panel__body input[type=checkbox]:checked{background:#64e385;border-color:#64e385;color:#64e385}.post-type-mec-events #mec_metabox_label input[type=checkbox]:checked:before,.post-type-mec-events .components-panel__body input[type=checkbox]:checked:before{color:#64e385;line-height:16px;width:15px;float:none;margin:2px}#mec_settings_fes_thankyou_page_url,.mec-form-row .mec-col-4 input[type=number],.mec-form-row .mec-col-4 input[type=text],.mec-form-row .mec-col-4 select,.mec-form-row .mec-col-4 textarea{width:82%!important;max-width:290px}#mec_calendar_display_options .mec-col-4 input{margin-left:20px!important;width:80%}.mec-form-row .description{display:inline-block;border-left:1px dashed #ccc;line-height:32px;padding-left:12px;margin-top:5px;color:#555}.mec-form-row .description code{font-style:normal}.mec-form-row .time-dv{font-size:14px;font-weight:700;margin-right:1%;line-height:38px}.mec-meta-box-fields{margin:30px 10px}.mec-meta-box-fields>.mec-meta-box-fields{margin-left:0}.mec-meta-box-fields .mec-title{margin:5px 0}.mec-meta-box-fields h4.mec-title{margin:40px 0 16px}.post-type-mec-events h4,.post-type-mec-events h5,.post-type-mec_calendars .mec-meta-box-fields h3{text-transform:capitalize;border-bottom:1px solid #e5e5e5;padding-bottom:6px;margin:40px 0 16px;font-size:15px;font-weight:600}.mec-meta-box-fields .mec-dashicons{font-size:20px;line-height:22px;color:#07bbe9}#mec_tickets .mec-box,.mec-form-row .mec-box,.mec-meta-box-fields .mec-box{background:#fff;padding:20px 10px 10px;margin:10px 0;border-radius:8px;border:1px solid #e6e9eb;box-shadow:0 1px 4px -1px rgb(0 0 0 / 1%)}.meta-box-sortables .mec-meta-box-fields .mec-box{padding:15px}.mec-form-row .mec-box{max-width:960px}.mec-form-row .mec-box .button,.mec-meta-box-fields .mec-box .button:not(.mec_add_price_date_button){float:right}#mec_gateways_form .mec-form-row:first-child,#mec_notifications_form_container .mec-form-row:nth-child(2){overflow:hidden}#mec_gateways_form .mec-tooltip{float:right}.mec-container{background:#fff;padding:15px 0 15px 15px}#mec_booking_form .mec-container,#mec_single_form .mec-container{padding:0}.nav-tab-active{background:#fff;border-bottom:1px solid #fff}#mec_social_networks .mec-form-row{margin-bottom:0}#mec_styles_form #mec_styles_CSS{height:200px;margin-bottom:5px;font-family:Consolas,Monaco,monospace;font-size:13px;width:97%;background:#f9f9f9;outline:0}#mec_calendar_filter .description{max-width:500px;display:block;margin:0 0 5px 0;padding:0;border:none;clear:both}#mec_calendar_display_options #mec-all-month>div{display:inline-block;min-width:120px}.mec-sed-methods li a{text-decoration:unset}.mec-sed-methods li{display:inline-block;padding:8px 12px;border:1px solid #ddd;margin:0 5px 5px 0;cursor:pointer;border-radius:3px;box-shadow:0 2px 15px -2px rgba(0,0,0,.1)}.mec-sed-methods li a:hover,.mec-sed-methods li:hover{border-color:#07bbe9;color:#07bbe9}.mec-sed-methods li.active,.mec-sed-methods li.active a{border-color:#07bbe9;background-color:#ecf9fd;color:#07bbe9;font-weight:600;cursor:default;box-shadow:none}.meta-box-sortables .mec-switcher input+label{max-width:52px;width:52px;height:30px;margin:4px 0}.meta-box-sortables .mec-switcher input+label:after,.meta-box-sortables .mec-switcher input+label:before{top:0;left:0;bottom:0;right:0}.meta-box-sortables .mec-switcher input+label:after{width:24px;height:24px}.meta-box-sortables .mec-switcher input:checked+label:before{box-shadow:2px 2px 12px -2px #4fdc73 inset;background:#64e385;border-color:#64e385}.meta-box-sortables .mec-switcher input:checked+label:after{margin-left:24px}.mec-switcher input:checked+label:after{margin-left:16px}#mec_gateways_form input[type=text],#mec_gateways_form select,#mec_gateways_form textarea{width:calc(100% - 30px)}#mec_gateways_form textarea{min-height:65px}#mec_gateways_form li .mec-gateway-options-form,#payment_gateways_option li .mec-gateway-options-form{padding:35px 10px 5px 10px;background-color:#fff;border:1px solid #e6e9eb;border-left:6px solid #e6e9eb;margin-bottom:40px;margin-top:-5px;border-top-right-radius:4px;border-bottom-right-radius:4px;box-shadow:0 1px 4px -1px rgba(0,0,0,.05)}#payment_gateways_option #mec_gateways6_container_toggle.mec-gateway-options-form{padding:10px 10px 10px 17px}#payment_gateways_option #mec_gateways6_container_toggle.mec-gateway-options-form p{border-radius:4px;max-width:90%}#mec_gateways_form_container .mec-form-row input[type=number],#mec_gateways_form_container .mec-form-row select{width:100%}div#mec_gateways_form_container .mec-required.mec-mandatory{border:1px solid red}#mec_payment_options_wrapper .mec-form-row .mec-col-4 select{margin-top:0}#mec_payment_options_wrapper .mec-col-9 .mec-form-row{padding-bottom:0}#mec_payment_options_wrapper .mec-col-9 .mec-form-row .mec-col-4{width:103px;margin-left:-5px}#booking_notification_section label{display:inline-block;min-width:160px}div#booking_notification_section iframe{height:300px!important}@media (max-width:536px){#booking_notification_section input[type=text],#booking_notification_section select{min-width:100%}}#booking_notification_section ul li:last-child .wp-editor-container{margin-bottom:0}#mec_messages_form_container ul li label{display:block;font-weight:400}#mec_messages_form_container ul li input{display:block;width:100%}.mec-message-categories li.mec-acc-label{font-size:15px;font-weight:400;padding:0 30px;cursor:pointer;background-color:#fff;border:none;border-bottom:1px solid #e6e6e6;margin:0;letter-spacing:.2px;position:relative}.mec-message-categories li.mec-acc-label .mec-acc-cat-name{line-height:65px;font-size:17px;transition:all .2s ease}.mec-message-categories li.mec-acc-label .mec-acc-cat-name:hover{color:#07bbe9}.mec-message-categories ul{margin:15px 5px}.webnus-icons-list li{width:40px;display:inline-block;list-style:none;padding:0}.webnus-icons-list input{visibility:hidden;margin:0;padding:0;width:1px;height:1px;-moz-opacity:0;-khtml-opacity:0;opacity:0;cursor:pointer}.webnus-icons-list li label{color:#777;display:inline-block!important;float:none!important;width:33px!important;text-align:center;font-size:23px!important;font-weight:400!important;padding:5px 0!important;border:1px solid #eee!important}.mec-webnus-icon{float:left;margin-right:10px}.mec-webnus-icon i{font-size:24px;color:#222}.mec-accordion ul{display:none}.mec-switcher input{position:absolute;margin-left:-9999px;visibility:hidden}.mec-switcher input+label{display:inline-block;position:relative;cursor:pointer;outline:0;padding:2px;width:50px;height:22px;background-color:#e5e9ee;border-radius:60px}.mec-switcher input+label{max-width:52px;width:52px;height:30px;margin:4px 0}.mec-switcher input+label:after,.mec-switcher input+label:before{display:block;position:absolute;top:0;left:0;bottom:0;content:""}.mec-switcher input+label:before{right:1px;background-color:#f1f1f1;border-radius:60px;transition:background .4s}.mec-switcher input+label:after{width:24px;background-color:#fff;border-radius:100%;transition:margin .4s;border:1px solid transparent;box-shadow:0 0 5px rgb(0 0 0 / 4%)}.mec-switcher input+label:after{margin-top:2px;margin-left:2px;width:24px;height:24px}.wns-be-group-tab .mec-switcher input[value="1"]+label,.wns-be-group-tab .mec-switcher input[value="1"]+label:before{box-shadow:2px 2px 12px -2px #4fdc73 inset;position:relative;background:#64e385;border-color:#64e385}.wns-be-group-tab .mec-switcher input+label:before{right:1px;background-color:#f1f1f1;border-radius:60px;transition:background .4s}.wns-be-group-tab .mec-switcher input[value="1"]+label:after{margin-left:24px}.mec-switcher label{display:block}.mec-sed-methods li{display:inline-block;padding:10px;border:1px solid #ddd;margin:0 5px 5px 0;cursor:pointer}#wpwrap .mec-button-primary{border-bottom:none;letter-spacing:.5px;line-height:18px;height:46px;transition:all .5s ease;color:#fff;padding:12px 25px;display:block;text-align:center;font-size:14px;background:0 0;background-color:#008aff;text-shadow:none;border:0;box-shadow:none;display:inline-block;margin:25px 0 12px;min-width:146px}#wpwrap .mec-button-primary:hover{background-color:#41c9de}#wpwrap .mec-button-primary.loading{background-color:#73c02a}#wpwrap .mec-button-primary:before{content:"\f00c";font-family:fontawesome;margin-right:4px;font-size:16px;display:none}#wpwrap .mec-button-primary.loading:before{display:inline-block}.mec-image-select-wrap{clear:both;overflow:hidden;padding:10px 0;margin:0}.mec-image-select-wrap li{float:left;display:block;margin-right:5px;margin-bottom:0}.mec-image-select-wrap li input[type=radio]{display:none}.mec-form-row .mec-image-select-wrap li label{padding:5px 0 0;display:block}@media (max-width:1280px){.mec-image-select-wrap li{margin-right:20px}}@media (max-width:480px){.mec-image-select-wrap li{margin-right:18px}}.mec-image-select-wrap li input{display:none}.mec-image-select-wrap li span{width:35px;height:35px;display:block;margin:3px;border-radius:2px;border:3px solid transparent;transition:all .2s ease}.mec-image-select-wrap li input:checked+span{border-color:#fff;box-shadow:0 0 14px rgba(0,0,0,.25)}.mec-image-select-wrap li input:checked+span:after{content:"\e080";font-family:simple-line-icons;font-size:18px;line-height:18px;display:inline-block;color:#fff;padding:8px 9px;max-width:100%;max-height:100%;font-weight:400}.m-e-calendar_page_MEC-ix #wpwrap .mec-button-primary.mec-btn-2{margin:0 0 0 12px}.m-e-calendar_page_MEC-ix #wpwrap input[type=file]{padding-top:12px;padding-bottom:12px}.m-e-calendar_page_MEC-ix #wpwrap .mec-form-row select{min-height:46px}.mec-image-select-wrap .mec-colorskin-1{background-color:#40d9f1}.mec-image-select-wrap .mec-colorskin-2{background-color:#0093d0}.mec-image-select-wrap .mec-colorskin-3{background-color:#e53f51}.mec-image-select-wrap .mec-colorskin-4{background-color:#f1c40f}.mec-image-select-wrap .mec-colorskin-5{background-color:#e64883}.mec-image-select-wrap .mec-colorskin-6{background-color:#45ab48}.mec-image-select-wrap .mec-colorskin-7{background-color:#9661ab}.mec-image-select-wrap .mec-colorskin-8{background-color:#0aad80}.mec-image-select-wrap .mec-colorskin-9{background-color:#0ab1f0}.mec-image-select-wrap .mec-colorskin-10{background-color:#ff5a00}.mec-image-select-wrap .mec-colorskin-11{background-color:#c3512f}.mec-image-select-wrap .mec-colorskin-12{background-color:#55606e}.mec-image-select-wrap .mec-colorskin-13{background-color:#fe8178}.mec-image-select-wrap .mec-colorskin-14{background-color:#7c6853}.mec-image-select-wrap .mec-colorskin-15{background-color:#bed431}.mec-image-select-wrap .mec-colorskin-16{background-color:#2d5c88}.mec-image-select-wrap .mec-colorskin-17{background-color:#77da55}.mec-image-select-wrap .mec-colorskin-18{background-color:#2997ab}.mec-image-select-wrap .mec-colorskin-19{background-color:#734854}.mec-image-select-wrap .mec-colorskin-20{background-color:#a81010}.mec-image-select-wrap .mec-colorskin-21{background-color:#4ccfad}.mec-image-select-wrap .mec-colorskin-22{background-color:#3a609f}.mec-image-select-wrap .mec-colorskin-23{background-color:#333}.mec-image-select-wrap .mec-colorskin-24{background-color:#d2d2d2}.mec-image-select-wrap .mec-colorskin-25{background-color:#636363}@media screen and (max-width:782px){.mec-form-row .description{max-width:500px;display:block;margin:0 0 5px 0;padding:0;border:none}.mec-col-1,.mec-col-10,.mec-col-11,.mec-col-12,.mec-col-2,.mec-col-3,.mec-col-4,.mec-col-5,.mec-col-6,.mec-col-7,.mec-col-8,.mec-col-9{margin-bottom:5px;display:block}.mec-form-row .mec-box .button,.mec-meta-box-fields .mec-box .button{float:left}.mec-form-row .time-dv{padding:0 4px}.mec-form-row .mec-col-4 input[type=text],.mec-form-row .mec-col-4 select{width:auto;min-width:192px}.mec-tooltip .dashicons-before:before{font-size:32px}}#frmb-0-clear-all,#frmb-0-save,#frmb-0-view-data{display:none}#mec_sn_googlecal{margin-bottom:0}#mec_fee_row1 .button{margin-right:10px}h4.mec-form-subtitle{font-size:15px;margin-top:0}h5.mec-form-second-title{font-size:15px;margin-top:0}#webnus-dashboard *{box-sizing:border-box}#webnus-dashboard.about-wrap{max-width:1040px;margin:25px auto 20px}@media (max-width:1280px){#webnus-dashboard.about-wrap{max-width:1024px}}#webnus-dashboard .change-log{word-wrap:break-word}#webnus-dashboard .welcome-head img{background:#fff;padding:15px;border-radius:8px 8px 0 0;width:216px;margin:0 0 0 auto;display:block;border:1px solid #e3e5e7;border-bottom:none}.w-welcome{position:relative;margin-top:30px;margin-bottom:10px;font-size:19px}.w-box{position:relative;background:#fff;padding:5px 25px;margin-top:30px}.w-theme-version{box-shadow:0 2px 5px -5px #00000021;text-shadow:none;background:#f7f8f9;text-align:center;display:block;padding:10px 0;color:#8e9596;font-size:12px;font-weight:400;margin-top:0;border-radius:0 0 8px 8px;font-family:monospace;width:216px;margin:0 0 0 auto;border:1px solid #e3e5e7;border-top:none}.w-box{padding:0;min-height:310px;box-shadow:none;border-radius:15px;border:1px solid #e3e5e7}.w-box.upcoming-events .mec-load-more-wrap{display:none}.w-box.print-events{min-height:134px}.w-box.gateways{max-height:390px}.w-box.gateways canvas{max-height:280px!important}.w-box-head{font-weight:600;padding:20px 72px;position:relative;border-bottom:2px solid #ccecf4;font-size:20px}.w-box-head span{position:absolute;left:0;padding:0 25px;line-height:58px;background:#008aff;height:100%;top:0;color:#fff}.w-box-child,.w-box-content{padding:20px 30px 30px;line-height:24px;font-size:14px}.mec-count-child{width:50%;margin:0 auto;color:#01c6d9}#webnus-dashboard .w-button a{color:#fff!important;border-radius:0;padding:10px 24px;font-size:12px;letter-spacing:1px;font-weight:600;background:#008aff;margin:10px 0;display:inline-block;text-transform:uppercase}#webnus-dashboard .w-box .w-button a:hover{background:#222;background:linear-gradient(95deg,#555 0,#222 50%,#000 100%);box-shadow:0 5px 21px -5px rgba(0,0,0,.5)}.w-system-info{margin-bottom:7px}.w-system-info:first-child{margin-top:20px}.w-system-info>span{display:inline-block;min-width:145px;line-height:20px;font-size:13px}#webnus-dashboard .w-current{min-width:110px}#webnus-dashboard .w-min{min-width:65px}.w-icon{color:#fff;padding:3px;border-radius:4px;margin-right:10px;vertical-align:middle}.w-icon-green{background:#27ae60}.w-icon-red{background:#e74c3c}.extra .w-box-head{padding:30px 30px 10px;border-bottom:1px solid #fff;border-radius:11px 11px 0 0}.doc .w-box-head{color:#4cbf67}#webnus-dashboard .doc .w-button a{background:#4cbf67;background:linear-gradient(95deg,#6fe08a 0,#58cf74 50%,#36cb58 100%);margin:35px 0 17px;box-shadow:0 5px 10px -5px #4cbf67;background-color:#fff}#webnus-dashboard .support .w-button a{background:#ff876c;background:linear-gradient(95deg,#ff876c 0,#ff7455 50%,#ff5a35 100%);margin:13px 0 18px;box-shadow:0 5px 10px -5px #ff876c}.doc .w-box-content{background:url(../img/document.png) no-repeat right center}.doc .w-box-content p,.w-box.support .w-box-content p{width:54%;color:#666;margin-top:10px;max-width:380px}.w-box-child p{color:#666;margin-top:10px}.w-box.support{background:#fff url(../img/support.png) no-repeat top right}.w-box.support .w-box-head{width:50%;color:#ff876c}.w-box-content pre{text-align:left;background:#f5f6f7;font-size:13px;padding:20px 25px;height:480px;overflow-y:scroll;white-space:break-spaces;border-radius:11px;font-family:monospace;margin:0 0 10px}#webnus-dashboard .button:not(.mec-intro-section-link-tag){border:0;background:0 0;box-shadow:none;color:#e74c3c;font-weight:700}.w-box .state{position:absolute;top:0;left:-100vw}#webnus-dashboard .button:hover{color:#222}.w-box .state:checked~.content{-webkit-transform:none;-ms-transform:none;transform:none}.w-box .state:checked~.backdrop{bottom:0;opacity:1;z-index:1}.w-box .lightbox{position:fixed;top:0;right:0;left:0;height:0;padding:0 20px}.w-box .lightbox .content{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;overflow:hidden;position:relative;z-index:2;max-width:500px;max-height:95vh;margin:20px auto;padding:20px;background:#fff;-webkit-transform:translateY(-200%);-ms-transform:translateY(-200%);transform:translateY(-200%);-webkit-transition:.3s -webkit-transform ease-in-out;transition:.3s transform ease-in-out;border:1px solid rgba(0,0,0,.1)}.w-box .lightbox .main{-webkit-box-flex:1;-webkit-flex-grow:1;-ms-flex-positive:1;flex-grow:1}.w-box .lightbox .backdrop{position:fixed;z-index:-1;top:0;right:0;bottom:100%;left:0;opacity:0;background:rgba(0,0,0,.3);-webkit-transition:.3s opacity ease-in-out;transition:.3s opacity ease-in-out}.content .main p{color:#bf3737}p.mec_dash_count{font-size:60px;font-weight:100;margin:0;color:#38d5ed}.w-col-sm-3 .w-box.doc{text-align:center;min-height:auto}.w-Knowledgebase{color:#8e5cea}.mec-view-all-articles a{margin:30px 0 17px;display:inline-block;color:#fff!important;border-radius:0;padding:10px 24px;font-size:12px;letter-spacing:1px;font-weight:600;background:#8e5cea;display:inline-block;text-transform:uppercase;transition:all .24s ease;-webkit-transition:all .24s ease}.mec-view-all-articles a:hover{background-color:#222}.w-box.upcoming-events .mec-event-article{margin-bottom:15px;padding-bottom:10px}.w-box.upcoming-events .mec-event-article .mec-event-label-captions{padding:2px 5px;border-radius:3px;color:#fff;font-size:.86em}.w-box.upcoming-events .mec-event-article .mec-event-date{font-size:13px;background-color:#38d5ed;color:#fff;text-align:center;border-radius:6px;width:50px;padding-bottom:2px;float:left;margin-right:10px;text-transform:uppercase;letter-spacing:1px;font-family:monospace}.w-box.upcoming-events .mec-event-article .mec-event-date:beforex{content:"\e075";font-family:simple-line-icons;font-size:18px;line-height:15px;color:#bdeaf1;float:left;margin-right:11px}.w-box.upcoming-events .mec-event-article .mec-event-date span{font-weight:700;border-radius:6px 6px 0 0;padding:3px 0 1px;font-size:18px;display:block;background:#61dcef;font-family:arial,sans-serif}.w-box.upcoming-events .mec-event-article .mec-event-date span.mec-multiple-dates{font-size:11px}.w-box.upcoming-events .mec-event-article h4.mec-event-title{margin:0;font-size:16px;line-height:28px}.w-box.upcoming-events .mec-event-article .mec-shortcode-virtual-badge,.w-box.upcoming-events .mec-event-article .mec-shortcode-zoom-badge{font-size:11px;line-height:1.62;background:#222;padding:2px 9px;border-radius:12px;color:#fff;margin:0 0 0 5px}.w-box.upcoming-events .mec-event-article .mec-shortcode-virtual-badge i,.w-box.upcoming-events .mec-event-article .mec-shortcode-zoom-badge i{padding:0 5px 0 0}#webnus-dashboard .w-box.upcoming-events .mec-event-article h4.mec-event-title a{color:#5f676b}#webnus-dashboard .w-box.upcoming-events .mec-event-article h4.mec-event-title a:hover{text-decoration:underline}.w-box.upcoming-events .mec-event-article .mec-event-detail{font-size:13px;color:#979899}.w-box.upcoming-events .mec-event-article .mec-detail-button{display:none}.w-box.total-bookings ul li{display:inline-block;background:#f3f4f5;margin-right:5px;border-radius:50px;padding:0 5px;transition:all .2s ease}.w-box.total-bookings ul li.selected{background:#fff;border:1px solid #e9e9e9}.w-box.total-bookings ul li a{padding:6px 12px;display:inline-block;border-radius:3px;text-transform:none;font-size:13px;letter-spacing:.4px;transition:all .1s ease;font-weight:600;text-decoration:none}.w-box.total-bookings ul li.active{background:#38d5ed}.w-box.total-bookings ul li:hover{background:#38d5ed}#webnus-dashboard .w-box.total-bookings ul li a{color:#000}#webnus-dashboard .w-box.total-bookings ul li.active a,#webnus-dashboard .w-box.total-bookings ul li:hover a{color:#fff}#webnus-dashboard .w-box.total-bookings ul li a:focus{box-shadow:unset;outline:unset;outline-offset:0}.info-msg,.mec-error,.mec-success,.warning-msg{margin:10px 0;padding:10px;border-radius:11px}.post-type-mec-events.taxonomy-mec_speaker .warning-msg p{color:#9f6000}.info-msg{color:#059;background-color:#bef}.info-msg-link{background:#fff;padding:4px 12px 6px;border-radius:3px;line-height:1;font-weight:600;color:#008aff}.mec-success{color:#270;background-color:#dff2bf}.warning-msg{color:#9f6000;background-color:#feefb3}.mec-error{color:#d8000c!important;background-color:#ffbaba}.w-row .fs-notifier.success.show.visible{font-size:12px!important}.w-row .fs-notifier.success.show.visible a{font-size:25px!important;margin-top:-3px}.mec-certain-day>div,.mec-select-deselect-actions li,.mec-xi-facebook-import-events .mec-select-deselect-actions li,.mec-xi-google-import-events .mec-select-deselect-actions li{display:inline-block;position:relative;outline:0;background:#fff;border:1px solid #e2e2e2;border-radius:50px;padding:11px 21px 11px 21px;line-height:1;font-size:11px;font-weight:600;color:#444;letter-spacing:2px;height:auto;cursor:pointer;margin-top:5px;text-transform:uppercase;box-shadow:0 0 3px rgba(0,0,0,.03)}#mec-exceptional-days .mec-certain-day>div,#mec_exceptions_in_days_container .mec-certain-day>div{padding:0 15px;margin:0 5px 10px 0}.mec-certain-day .mec-in-days-day,.mec-certain-day>div .mec-not-in-days-day{line-height:36px}.mec-certain-day>div:hover,.mec-select-deselect-actions li:hover,.mec-xi-facebook-import-events .mec-select-deselect-actions li:hover,.mec-xi-google-import-events .mec-select-deselect-actions li:hover{border-color:#07bbe9;box-shadow:0 0 7px rgba(0,0,0,.1)}.mec-not-in-days-remove{border:1px solid #ff4b64;border-radius:20px;padding:0 0 0 1px;color:#ff4b64;width:11px;height:12px;text-align:center;line-height:12px;display:inline-block;margin-right:-5px;margin-left:6px}.mec-xi-facebook-import-events .mec-success,.mec-xi-google-import-events .mec-success{width:460px}.mec-xi-facebook-import-events .mec-select-deselect-actions li,.mec-xi-google-import-events .mec-select-deselect-actions li{display:inline-block;cursor:pointer}.lity-content>div{overflow:auto}.mce-mec-mce-items{text-transform:capitalize!important}#mec_setting_contextual li{list-style:none!important;font-size:12px;margin:0;padding:6px}.mec-bbf-field-container{margin-bottom:10px}.mec-bbf-field-container label{display:block}.kc-components ul.kc-components-list li .cpicon.mec-kingcomposer-icon,.kc-element-icon .cpicon.mec-kingcomposer-icon{background:url(../img/ico-mec-vc.png) no-repeat center center;background-size:auto;background-repeat:no-repeat}.mec-archive-skinsm.mec-category-skins,.mec-carousel-archive-link,.mec-carousel-head-text,.mec-toggle-month-divider{display:none}span.mec-archive-skins,span.mec-category-skins{vertical-align:text-bottom}.mec-archive-skins input,.mec-archive-skins select,.mec-category-skins input,.mec-category-skins select{min-width:225px;vertical-align:baseline}#mec_settings_default_skin_archive,#mec_settings_default_skin_category{min-width:225px}.w-welcome p span{background:#fff;padding:4px 10px}#mec_masonry_skin_options_container .mec-form-row .description{margin-left:0;padding-left:0;border:none;margin-top:-4px}@media (max-width:1280px){span.mec-archive-skins,span.mec-category-skins{margin-left:0}}.mec-shortcode-virtual-badge i{padding:0 5px 0 7px}.mec-search-form-options-container input[type=text]{margin-top:10px}@media (min-width:760px) and (max-width:1280px){.mec-virtual-event-wrap .mec-form-row .mec-col-1,.mec-zoom-event-wrap .mec-form-row .mec-col-1{width:12%}.mec-virtual-event-wrap .mec-form-row .mec-col-4,.mec-virtual-event-wrap .mec-form-row .mec-col-6,.mec-zoom-event-wrap .mec-form-row .mec-col-4,.mec-zoom-event-wrap .mec-form-row .mec-col-6{width:40%}.mec-virtual-event-wrap .mec-form-row .mec-col-3,.mec-virtual-event-wrap .mec-form-row .mec-col-5,.mec-zoom-event-wrap .mec-form-row .mec-col-3,.mec-zoom-event-wrap .mec-form-row .mec-col-5{width:45%}.mec-virtual-event-wrap .mec-form-row .mec-col-2,.mec-zoom-event-wrap .mec-form-row .mec-col-2{width:21%}}#mec_zoom_checkall{background:#fff;border:1px solid #282828;border-radius:60px;padding:6px 32px 8px;margin:30px 0 0;cursor:pointer;display:block;transition:all .3s ease;-webkit-transition:all .3s ease;-moz-transition:all .3s ease;-ms-transition:all .3s ease;-o-transition:all .3s ease}#mec_zoom_checkall:focus{box-shadow:inset;outline:0}#mec_zoom_checkall:hover{background:#282828;color:#fff}/*! + * Bootstrap v3.3.7 (http://getbootstrap.com) + * Copyright 2011-2016 Twitter, Inc. + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) + */#webnus-dashboard button,#webnus-dashboard input,#webnus-dashboard select,#webnus-dashboard textarea{font-family:inherit;font-size:inherit;line-height:inherit}#webnus-dashboard a{color:#337ab7;text-decoration:none}#webnus-dashboard a:focus,#webnus-dashboard a:hover{color:#23527c}#webnus-dashboard a:focus{outline:-webkit-focus-ring-color auto 5px;outline-offset:-2px}#webnus-dashboard figure{margin:0}#webnus-dashboard img{vertical-align:middle}.w-img-responsive{display:block;max-width:100%;height:auto}.w-img-rounded{border-radius:6px}.w-img-thumbnail{padding:4px;line-height:1w-42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all 0w-2s ease-in-out;-o-transition:all 0w-2s ease-in-out;transition:all 0w-2s ease-in-out;display:inline-block;max-width:100%;height:auto}.w-img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.w-sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);border:0}.w-sr-only-focusable:active,.w-sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}.w-container,.w-container-fluid{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}[role=button]{cursor:pointer}@media (min-width:768px){.w-container{width:750px}}@media (min-width:992px){.w-container{width:970px}}@media (min-width:1200px){.w-container{width:1170px}}.w-row{margin-left:-15px;margin-right:-15px}.w-col-lg-1,.w-col-lg-10,.w-col-lg-11,.w-col-lg-12,.w-col-lg-2,.w-col-lg-3,.w-col-lg-4,.w-col-lg-5,.w-col-lg-6,.w-col-lg-7,.w-col-lg-8,.w-col-lg-9,.w-col-md-1,.w-col-md-10,.w-col-md-11,.w-col-md-12,.w-col-md-2,.w-col-md-3,.w-col-md-4,.w-col-md-5,.w-col-md-6,.w-col-md-7,.w-col-md-8,.w-col-md-9,.w-col-sm-1,.w-col-sm-10,.w-col-sm-11,.w-col-sm-12,.w-col-sm-2,.w-col-sm-3,.w-col-sm-4,.w-col-sm-5,.w-col-sm-6,.w-col-sm-7,.w-col-sm-8,.w-col-sm-9,.w-col-xs-1,.w-col-xs-10,.w-col-xs-11,.w-col-xs-12,.w-col-xs-2,.w-col-xs-3,.w-col-xs-4,.w-col-xs-5,.w-col-xs-6,.w-col-xs-7,.w-col-xs-8,.w-col-xs-9{position:relative;min-height:1px;padding-left:15px;padding-right:15px}.w-col-xs-1,.w-col-xs-10,.w-col-xs-11,.w-col-xs-12,.w-col-xs-2,.w-col-xs-3,.w-col-xs-4,.w-col-xs-5,.w-col-xs-6,.w-col-xs-7,.w-col-xs-8,.w-col-xs-9{float:left}.w-col-xs-12{width:100%}.w-col-xs-11{width:91.66666667%}.w-col-xs-10{width:83.33333333%}.w-col-xs-9{width:75%}.w-col-xs-8{width:66.66666667%}.w-col-xs-7{width:58.33333333%}.w-col-xs-6{width:50%}.w-col-xs-5{width:41.66666667%}.w-col-xs-4{width:33.33333333%}.w-col-xs-3{width:25%}.w-col-xs-2{width:16.66666667%}.w-col-xs-1{width:8.33333333%}.w-col-xs-pull-12{right:100%}.w-col-xs-pull-11{right:91.66666667%}.w-col-xs-pull-10{right:83.33333333%}.w-col-xs-pull-9{right:75%}.w-col-xs-pull-8{right:66.66666667%}.w-col-xs-pull-7{right:58.33333333%}.w-col-xs-pull-6{right:50%}.w-col-xs-pull-5{right:41.66666667%}.w-col-xs-pull-4{right:33.33333333%}.w-col-xs-pull-3{right:25%}.w-col-xs-pull-2{right:16.66666667%}.w-col-xs-pull-1{right:8.33333333%}.w-col-xs-pull-0{right:auto}.w-col-xs-push-12{left:100%}.w-col-xs-push-11{left:91.66666667%}.w-col-xs-push-10{left:83.33333333%}.w-col-xs-push-9{left:75%}.w-col-xs-push-8{left:66.66666667%}.w-col-xs-push-7{left:58.33333333%}.w-col-xs-push-6{left:50%}.w-col-xs-push-5{left:41.66666667%}.w-col-xs-push-4{left:33.33333333%}.w-col-xs-push-3{left:25%}.w-col-xs-push-2{left:16.66666667%}.w-col-xs-push-1{left:8.33333333%}.w-col-xs-push-0{left:auto}.w-col-xs-offset-12{margin-left:100%}.w-col-xs-offset-11{margin-left:91.66666667%}.w-col-xs-offset-10{margin-left:83.33333333%}.w-col-xs-offset-9{margin-left:75%}.w-col-xs-offset-8{margin-left:66.66666667%}.w-col-xs-offset-7{margin-left:58.33333333%}.w-col-xs-offset-6{margin-left:50%}.w-col-xs-offset-5{margin-left:41.66666667%}.w-col-xs-offset-4{margin-left:33.33333333%}.w-col-xs-offset-3{margin-left:25%}.w-col-xs-offset-2{margin-left:16.66666667%}.w-col-xs-offset-1{margin-left:8.33333333%}.w-col-xs-offset-0{margin-left:0}@media (min-width:768px){.w-col-sm-1,.w-col-sm-10,.w-col-sm-11,.w-col-sm-12,.w-col-sm-2,.w-col-sm-3,.w-col-sm-4,.w-col-sm-5,.w-col-sm-6,.w-col-sm-7,.w-col-sm-8,.w-col-sm-9{float:left}.w-col-sm-12{width:100%}.w-col-sm-11{width:91.66666667%}.w-col-sm-10{width:83.33333333%}.w-col-sm-9{width:75%}.w-col-sm-8{width:66.66666667%}.w-col-sm-7{width:58.33333333%}.w-col-sm-6{width:50%}.w-col-sm-5{width:41.66666667%}.w-col-sm-4{width:33.33333333%}.w-col-sm-3{width:25%}.w-col-sm-2{width:16.66666667%}.w-col-sm-1{width:8.33333333%}.w-col-sm-pull-12{right:100%}.w-col-sm-pull-11{right:91.66666667%}.w-col-sm-pull-10{right:83.33333333%}.w-col-sm-pull-9{right:75%}.w-col-sm-pull-8{right:66.66666667%}.w-col-sm-pull-7{right:58.33333333%}.w-col-sm-pull-6{right:50%}.w-col-sm-pull-5{right:41.66666667%}.w-col-sm-pull-4{right:33.33333333%}.w-col-sm-pull-3{right:25%}.w-col-sm-pull-2{right:16.66666667%}.w-col-sm-pull-1{right:8.33333333%}.w-col-sm-pull-0{right:auto}.w-col-sm-push-12{left:100%}.w-col-sm-push-11{left:91.66666667%}.w-col-sm-push-10{left:83.33333333%}.w-col-sm-push-9{left:75%}.w-col-sm-push-8{left:66.66666667%}.w-col-sm-push-7{left:58.33333333%}.w-col-sm-push-6{left:50%}.w-col-sm-push-5{left:41.66666667%}.w-col-sm-push-4{left:33.33333333%}.w-col-sm-push-3{left:25%}.w-col-sm-push-2{left:16.66666667%}.w-col-sm-push-1{left:8.33333333%}.w-col-sm-push-0{left:auto}.w-col-sm-offset-12{margin-left:100%}.w-col-sm-offset-11{margin-left:91.66666667%}.w-col-sm-offset-10{margin-left:83.33333333%}.w-col-sm-offset-9{margin-left:75%}.w-col-sm-offset-8{margin-left:66.66666667%}.w-col-sm-offset-7{margin-left:58.33333333%}.w-col-sm-offset-6{margin-left:50%}.w-col-sm-offset-5{margin-left:41.66666667%}.w-col-sm-offset-4{margin-left:33.33333333%}.w-col-sm-offset-3{margin-left:25%}.w-col-sm-offset-2{margin-left:16.66666667%}.w-col-sm-offset-1{margin-left:8.33333333%}.w-col-sm-offset-0{margin-left:0}}@media (min-width:992px){.w-col-md-1,.w-col-md-10,.w-col-md-11,.w-col-md-12,.w-col-md-2,.w-col-md-3,.w-col-md-4,.w-col-md-5,.w-col-md-6,.w-col-md-7,.w-col-md-8,.w-col-md-9{float:left}.w-col-md-12{width:100%}.w-col-md-11{width:91.66666667%}.w-col-md-10{width:83.33333333%}.w-col-md-9{width:75%}.w-col-md-8{width:66.66666667%}.w-col-md-7{width:58.33333333%}.w-col-md-6{width:50%}.w-col-md-5{width:41.66666667%}.w-col-md-4{width:33.33333333%}.w-col-md-3{width:25%}.w-col-md-2{width:16.66666667%}.w-col-md-1{width:8.33333333%}.w-col-md-pull-12{right:100%}.w-col-md-pull-11{right:91.66666667%}.w-col-md-pull-10{right:83.33333333%}.w-col-md-pull-9{right:75%}.w-col-md-pull-8{right:66.66666667%}.w-col-md-pull-7{right:58.33333333%}.w-col-md-pull-6{right:50%}.w-col-md-pull-5{right:41.66666667%}.w-col-md-pull-4{right:33.33333333%}.w-col-md-pull-3{right:25%}.w-col-md-pull-2{right:16.66666667%}.w-col-md-pull-1{right:8.33333333%}.w-col-md-pull-0{right:auto}.w-col-md-push-12{left:100%}.w-col-md-push-11{left:91.66666667%}.w-col-md-push-10{left:83.33333333%}.w-col-md-push-9{left:75%}.w-col-md-push-8{left:66.66666667%}.w-col-md-push-7{left:58.33333333%}.w-col-md-push-6{left:50%}.w-col-md-push-5{left:41.66666667%}.w-col-md-push-4{left:33.33333333%}.w-col-md-push-3{left:25%}.w-col-md-push-2{left:16.66666667%}.w-col-md-push-1{left:8.33333333%}.w-col-md-push-0{left:auto}.w-col-md-offset-12{margin-left:100%}.w-col-md-offset-11{margin-left:91.66666667%}.w-col-md-offset-10{margin-left:83.33333333%}.w-col-md-offset-9{margin-left:75%}.w-col-md-offset-8{margin-left:66.66666667%}.w-col-md-offset-7{margin-left:58.33333333%}.w-col-md-offset-6{margin-left:50%}.w-col-md-offset-5{margin-left:41.66666667%}.w-col-md-offset-4{margin-left:33.33333333%}.w-col-md-offset-3{margin-left:25%}.w-col-md-offset-2{margin-left:16.66666667%}.w-col-md-offset-1{margin-left:8.33333333%}.w-col-md-offset-0{margin-left:0}}@media (min-width:1200px){.w-col-lg-1,.w-col-lg-10,.w-col-lg-11,.w-col-lg-12,.w-col-lg-2,.w-col-lg-3,.w-col-lg-4,.w-col-lg-5,.w-col-lg-6,.w-col-lg-7,.w-col-lg-8,.w-col-lg-9{float:left}.w-col-lg-12{width:100%}.w-col-lg-11{width:91.66666667%}.w-col-lg-10{width:83.33333333%}.w-col-lg-9{width:75%}.w-col-lg-8{width:66.66666667%}.w-col-lg-7{width:58.33333333%}.w-col-lg-6{width:50%}.w-col-lg-5{width:41.66666667%}.w-col-lg-4{width:33.33333333%}.w-col-lg-3{width:25%}.w-col-lg-2{width:16.66666667%}.w-col-lg-1{width:8.33333333%}.w-col-lg-pull-12{right:100%}.w-col-lg-pull-11{right:91.66666667%}.w-col-lg-pull-10{right:83.33333333%}.w-col-lg-pull-9{right:75%}.w-col-lg-pull-8{right:66.66666667%}.w-col-lg-pull-7{right:58.33333333%}.w-col-lg-pull-6{right:50%}.w-col-lg-pull-5{right:41.66666667%}.w-col-lg-pull-4{right:33.33333333%}.w-col-lg-pull-3{right:25%}.w-col-lg-pull-2{right:16.66666667%}.w-col-lg-pull-1{right:8.33333333%}.w-col-lg-pull-0{right:auto}.w-col-lg-push-12{left:100%}.w-col-lg-push-11{left:91.66666667%}.w-col-lg-push-10{left:83.33333333%}.w-col-lg-push-9{left:75%}.w-col-lg-push-8{left:66.66666667%}.w-col-lg-push-7{left:58.33333333%}.w-col-lg-push-6{left:50%}.w-col-lg-push-5{left:41.66666667%}.w-col-lg-push-4{left:33.33333333%}.w-col-lg-push-3{left:25%}.w-col-lg-push-2{left:16.66666667%}.w-col-lg-push-1{left:8.33333333%}.w-col-lg-push-0{left:auto}.w-col-lg-offset-12{margin-left:100%}.w-col-lg-offset-11{margin-left:91.66666667%}.w-col-lg-offset-10{margin-left:83.33333333%}.w-col-lg-offset-9{margin-left:75%}.w-col-lg-offset-8{margin-left:66.66666667%}.w-col-lg-offset-7{margin-left:58.33333333%}.w-col-lg-offset-6{margin-left:50%}.w-col-lg-offset-5{margin-left:41.66666667%}.w-col-lg-offset-4{margin-left:33.33333333%}.w-col-lg-offset-3{margin-left:25%}.w-col-lg-offset-2{margin-left:16.66666667%}.w-col-lg-offset-1{margin-left:8.33333333%}.w-col-lg-offset-0{margin-left:0}}.w-clearfix:after,.w-clearfix:before,.w-container-fluid:after,.w-container-fluid:before,.w-container:after,.w-container:before,.w-row:after,.w-row:before{content:" ";display:table}.w-clearfix:after,.w-container-fluid:after,.w-container:after,.w-row:after{clear:both}.w-center-block{display:block;margin-left:auto;margin-right:auto}.w-pull-right{float:right!important}.w-pull-left{float:left!important}.w-hide{display:none!important}.w-show{display:block!important}.w-invisible{visibility:hidden}.w-text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.w-hidden{display:none!important}.w-affix{position:fixed}.mec-image-popup-wrap{display:none}#wns-be-infobar.sticky{position:fixed;top:32px;background:#fff;z-index:999;width:82%}.wns-be-main .wns-saved-settings.sticky{position:fixed;width:62.5%;top:111px;z-index:999999999999999999}textarea.mec-import-settings-content{display:block;width:100%;min-height:120px;margin-bottom:25px;padding:10px 15px}.mec-import-options-notification{display:inline-block}.mec-import-options-notification .mec-message-import-error,.mec-import-options-notification .mec-message-import-success{display:inline-block;padding:15px 12px;margin-left:12px;opacity:0;visibility:hidden;font-weight:700}.mec-import-options-notification .mec-message-import-success{opacity:1;visibility:visible;border:2px solid green}.mec-import-options-notification .mec-message-import-error{opacity:1;visibility:visible;border:2px solid #e62117}.mec-export-settings:focus,.mec-import-settings:focus{color:#07bbe9}.mec-import-settings-wrap{position:relative}.mec-import-settings-wrap textarea{max-width:unset!important}.mec-loarder-wrap{position:absolute;top:0;bottom:0;left:0;right:0;background:rgba(202,202,202,.7);z-index:9999}.mec-loarder-wrap.mec-settings-loader{top:34px}.mec-loarder{position:absolute;width:64px;height:64px;top:calc(50% - 32px);left:calc(50% - 36px)}.mec-loarder div{display:inline-block;position:absolute;left:6px;width:4px;background:#fff;animation:mec-loarder 1.2s cubic-bezier(0,.5,.5,1) infinite}.mec-loarder div:first-child{left:27px;animation-delay:-.24s;background:#0075ff}.mec-loarder div:nth-child(2){left:36px;animation-delay:-.12s;background:#028bff}.mec-loarder div:nth-child(3){left:45px;animation-delay:0;background:#32a0ff}@keyframes mec-loarder{0%{top:6px;height:51px}100%,50%{top:19px;height:26px}}.w-box.support-page.searchbox{background:#40d8f0;color:#fff;min-height:260px;text-align:center;border-radius:11px}#webnus-dashboard .search-form input{background:rgba(255,255,255,.2);border:none;width:50%;outline:0;color:rgba(255,255,255,.7);font-size:18px;border-radius:4px 0 0 4px;box-shadow:0 1px 2px 0 rgba(0,0,0,.03);-webkit-transition:background .4s,box-shadow .2s;transition:background .4s,box-shadow .2s;padding:20px 32px;margin:0}#webnus-dashboard .search-form button{background:rgba(255,255,255,.2);border:none;padding:20px 32px;margin-left:-2px;color:#fff;border-radius:0 4px 4px 0;font-size:18px;cursor:pointer;-webkit-transition:background .4s,box-shadow .2s;transition:background .4s,box-shadow .2s}#webnus-dashboard .search-form button:hover{background:#fff;color:#3a3c4c}.w-box.support-page.searchbox p{font-size:30px}.search-form input::-webkit-input-placeholder{color:rgba(255,255,255,.7)}.search-form input::-moz-placeholder{color:rgba(255,255,255,.7)}.search-form input:-ms-input-placeholder{color:rgba(255,255,255,.7)}.search-form input:-moz-placeholder{color:rgba(255,255,255,.7)}#webnus-dashboard .search-form input:active,#webnus-dashboard .search-form input:focus{box-shadow:0 10px 20px rgba(0,0,0,.14);background:#fff;color:#3a3c4c}#webnus-dashboard .search-form input:active::-webkit-input-placeholder,#webnus-dashboard .search-form input:focus::-webkit-input-placeholder{color:#3a3c4c}#webnus-dashboard .search-form input:active::-moz-placeholder,#webnus-dashboard .search-form input:focus::-moz-placeholder{color:#3a3c4c}#webnus-dashboard .search-form input:active:-ms-input-placeholder,#webnus-dashboard .search-form input:focus:-ms-input-placeholder{color:#3a3c4c}#webnus-dashboard .search-form input:active:-moz-placeholder,#webnus-dashboard .search-form input:focus:-moz-placeholder{color:#3a3c4c}#webnus-dashboard .w-box.support-page.mec-ticksy{text-align:center;min-height:260px}#webnus-dashboard .w-box.support-page.mec-ticksy p{font-size:20px;width:70%;margin:0 auto;margin-bottom:40px;margin-top:40px}#webnus-dashboard .support-box a,#webnus-dashboard .w-box.support-page.mec-ticksy a{color:#fff;font-weight:500;border-radius:50px;text-shadow:none;background:#40d8f0;border:none;transition:.24s;padding:12px 30px;cursor:pointer;margin-bottom:40px;display:inline-block}#webnus-dashboard .support-box a:hover,#webnus-dashboard .w-box.support-page.mec-ticksy a:hover{background:#222;box-shadow:0 5px 23px -7px rgba(0,0,0,.5)}#webnus-dashboard .support-box a{margin:40px 4px 0 4px}.mec-faq-accordion>.mec-faq-accordion-content{display:none}#webnus-dashboard .mec-faq-accordion-trigger a{font-size:15px;padding:15px;background:#f0f1f2;display:block;color:#222;line-height:17px;outline:0;border-radius:8px}.mec-faq-accordion-trigger{margin-bottom:5px;position:relative}#webnus-dashboard .mec-faq-accordion-trigger a:after{font-family:simple-line-icons;content:"\e095";position:absolute;right:12px;font-weight:700}.mec-faq-accordion-content{padding:5px 14px 25px}#webnus-dashboard .mec-faq-accordion-trigger a.active:after{content:"\e082"}#webnus-dashboard .support-page-links a{color:#fff;border-radius:50px;padding:13px 24px;font-size:12px;letter-spacing:1px;font-weight:600;text-transform:uppercase;transition:all .2s ease}#webnus-dashboard .support-page-links a:hover,#webnus-dashboard .w-box.support-page.videobox .w-button a:hover{background:#222;box-shadow:0 2px 5px -1px rgba(0,0,0,.1)}#webnus-dashboard .support-page-links{display:inline-block;margin:12px 4px 16px 0}.support-page-links.link-to-doc a{background:#d09d5f}.support-page-links.link-to-videos a{background:#ff876c}.support-page-links.link-to-articles a{background:#69ca8a}.w-box.support-page.articles-box .w-box-content a{display:block;padding:6px 0}#webnus-dashboard .w-box.support-page.videobox .w-button a{color:#fff;font-size:10px;padding:5px 15px;min-height:10px;font-weight:500;border-radius:22px;box-shadow:0 3px 10px -9px #ff5a35;text-shadow:none;background:#ff876c;border:none;transition:.24s}.w-box.support-page.articles-box,.w-box.support-page.faq-box{min-height:500px}.w-box.support-page.videobox{border-radius:11px;min-height:282px;box-shadow:0 1px 2px rgba(0,0,0,.01)!important}.w-box.support-page.videobox .w-box-content{padding:15px}.w-box.support-page.videobox .w-box-head{font-size:15px;text-align:center;padding:20px 0 0}#webnus-dashboard .w-box.support-page.videobox .w-button a i{margin-right:6px}.support-page .w-box-content ul{margin-top:5px;padding-left:5px}.support-page .w-box-content ul li{font-size:13px}.support-page .w-box-content ul li i{font-size:13px;vertical-align:text-bottom;margin-right:3px;color:#40d8f0}.w-box.mec-activation{background:#fff url(../img/dp-dsb-support.jpg) no-repeat top right}.w-box.mec-activation .w-box-head{width:75%}.w-box.mec-activation .w-box-content{padding:10px 30px}.w-box.mec-activation input[type=radio]{display:none}.w-box.mec-activation input[type=radio]+label{color:#000;font-size:13px;line-height:14px!important;color:#7b7b7b}.w-box.mec-activation input[type=radio].checked+label{color:#40d8f0}.mec-form-row input[type=radio],.w-box.mec-activation input[type=radio]+label span{display:inline-block;margin:-2px 6px 0 0;vertical-align:middle;cursor:pointer;height:22px;width:22px;text-align:center;background-color:#fff;border:2px solid #e1e2e3;border-radius:100%;box-shadow:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;position:relative;transition:all .3s ease}.mec-form-row input[type=radio]:checked,.w-box.mec-activation input[type=radio].checked+label span{border-color:#afebf5}.mec-form-row input[type=radio]:before,.w-box.mec-activation input[type=radio]+label span:after{content:"";display:block;margin:0;position:absolute;top:4px;left:4px;width:10px;height:10px;background:0 0;border-radius:100%;transition:all .2s ease;transform:scale(.1)}.mec-form-row input[type=radio]:checked:before,.w-box.mec-activation input[type=radio].checked+label span:after{background:#38d5ed;transform:scale(1)}.w-box.mec-activation .LicenseType label{padding-right:20px;font-weight:500}.w-box.mec-activation .LicenseField{display:inline-block;position:relative;margin-top:20px}.w-box.mec-activation input[name=MECPurchaseCode]{box-shadow:inset 0 1px 2px rgba(0,0,0,.07);min-width:220px;background:#f7f8f9;border:none;border-radius:33px;width:500px;min-height:50px;margin:0;padding-left:20px;text-align:left}#webnus-dashboard .w-box.mec-activation input[type=submit]{height:40px;line-height:40px;font-weight:600;border:none;cursor:pointer;padding:0 30px;border-radius:33px;color:#fff;letter-spacing:1px;text-transform:uppercase;font-size:12px;text-shadow:none;background:#64e385;transition:all .28s ease;position:absolute;right:5px;top:5px;font-size:12px}#webnus-dashboard .w-box.mec-activation input[type=submit]:hover{background:#45ce68}#webnus-dashboard .w-box.mec-activation input[type=submit].delete{background:#c2c2c2;color:#000}#webnus-dashboard .w-box.mec-activation input[type=submit].delete:hover{background:#ccc}#MECActivation .MECPurchaseStatus,.addon-activation-form .MECPurchaseStatus{display:inline-block;width:40px;height:40px;text-align:center;padding-top:9px;color:#fff;font-weight:700;font-size:18px;border-radius:50%;padding-top:8px;position:absolute;right:-51px;top:calc(50% - 20px)}.MECPurchaseStatus:after,.MECPurchaseStatus:before{position:absolute;border-radius:50px;background:#fff;content:"";transform:rotate(45deg)}.MECPurchaseStatus.PurchaseError:before{width:22px;height:4px;right:9px;top:18px;transform:rotate(45deg)}.MECPurchaseStatus.PurchaseError:after{width:22px;height:4px;right:9px;top:18px;transform:rotate(-45deg)}.MECPurchaseStatus.PurchaseSuccess:before{width:13px;height:4px;right:19px;top:21px;transform:rotate(45deg)}.MECPurchaseStatus.PurchaseSuccess:after{width:22px;height:4px;right:5px;top:18px;transform:rotate(-45deg)}#MECActivation .MECPurchaseStatus.PurchaseError,.addon-activation-form .MECPurchaseStatus.PurchaseError{background:#ff876c}#MECActivation .MECPurchaseStatus.PurchaseSuccess,.addon-activation-form .MECPurchaseStatus.PurchaseSuccess{background:#64e385}.wna-spinner-wrap{position:absolute;background:#000;width:509px;height:64px;top:-8px;border-radius:50px;z-index:999;background-color:#fff;opacity:.9}.wna-spinner{width:40px;height:40px;position:relative;margin:6px auto}.wna-spinner .double-bounce1,.wna-spinner .double-bounce2{width:100%;height:100%;border-radius:50%;background-color:#40d8f0;opacity:.6;position:absolute;top:0;left:0;-webkit-animation:sk-bounce 2s infinite ease-in-out;animation:sk-bounce 2s infinite ease-in-out}.wna-spinner .double-bounce2{-webkit-animation-delay:-1s;animation-delay:-1s}#MECActivation .MECLicenseMessage,.addon-activation-form .MECLicenseMessage{padding-top:24px;margin-bottom:-24px;color:#f64;max-width:570px}.MECLicenseMessage.mec-message-hidden{display:none}#webnus-dashboard .w-box.mec-activation input[type=submit].mec_revoke{background:#e0e0e0;color:#222}.box-addons-activation{margin-top:24px;margin-bottom:24px}.box-addon-activation-toggle-content,.box-addon-activation-toggle-head{display:none}.addon-activation-form h3{font-size:15px;font-weight:400;margin:34px 0 -7px}.box-addon-activation-toggle-head{line-height:1.5;font-size:14px;margin-top:14px;cursor:pointer;padding:10px 18px;border:1px solid #d3d5d7;border-radius:25px;transition:all .2s ease}.box-addon-activation-toggle-head:hover{border-color:#a5d9e1}.box-addon-activation-toggle-head i{margin-right:7px;cursor:pointer;font-size:13px;font-weight:400}#mec-advanced-wraper div:first-child>ul{display:block;margin:5px 0;padding:5px 0;width:390px;border:1px solid #e1e2e3;border-radius:2px;box-shadow:0 1px 3px rgba(0,0,0,.05)}#mec-advanced-wraper div:first-child>ul span{display:none}#mec-advanced-wraper div:first-child>ul *{display:inline-block;background:#fff;font-size:12px;color:#717273;text-align:center}#mec-advanced-wraper div:first-child>ul>li{width:60px;font-weight:700;margin:0 10px 0 0;padding:4px 0;border-right:1px solid #e1e2e3}#mec-advanced-wraper div:first-child>ul>ul>li{margin:0;padding:2px 10px;cursor:pointer;border-radius:2px;transition:all .18s ease}#mec-advanced-wraper div:first-child>ul>ul>li:hover,.mec-active{background:#07bbe9!important;color:#fff!important}@-webkit-keyframes sk-bounce{0%,100%{-webkit-transform:scale(0)}50%{-webkit-transform:scale(1)}}@keyframes sk-bounce{0%,100%{transform:scale(0);-webkit-transform:scale(0)}50%{transform:scale(1);-webkit-transform:scale(1)}}.w-col-sm-3 .w-box.addon{min-height:372px;text-align:center;border-radius:9px;box-shadow:0 1px 2px 0 rgb(0 0 0 / 1%)}.m-e-calendar_page_MEC-addons .welcome-content .w-col-sm-3{width:33.33%;clear:none!important;min-height:380px}@media (min-width:768px) and (max-width:1281px){.m-e-calendar_page_MEC-addons .welcome-content .w-col-sm-3{width:50%}}@media (max-width:767px){.m-e-calendar_page_MEC-addons .welcome-content .w-col-sm-3{width:100%}}.w-box-child.mec-addon-box{padding:0}.mec-addon-box-head{border-bottom:1px solid #f7f8f9;padding:20px 20px 8px;margin-bottom:14px;position:relative}.mec-addon-box-version{position:relative;border-radius:1px;padding:0 8px;font-family:monospace;background:#f4f7f7;color:#00a1b7;font-size:11px;letter-spacing:.2px;line-height:21px;display:inline-block;margin:10px 0}.mec-addon-box-head img{display:block;width:100%;height:60px;margin-bottom:10px;margin-top:10px}.mec-addon-box-title{font-weight:600;font-size:18px;line-height:36px;color:#27272a;letter-spacing:-.2px}.mec-addon-box-title a span{color:#444;font-size:15px}.mec-addon-box-content{padding:0 20px}.mec-addon-box-content p{color:#6e757b;font-size:14px;letter-spacing:.1px}.mec-addon-box-mec-version{background:#f3f3f3;padding:10px;font-size:13px}.mec-addon-box-pro{display:inline-block;background:#ff7d5f;color:#fff;font-weight:600;font-size:11px;letter-spacing:.2px;line-height:21px;padding:0 8px;border-radius:3px}.mec-addon-box-pro-lite{background:#4cbf67;color:#fff;font-weight:600;font-size:11px;letter-spacing:.2px;line-height:21px;padding:0 8px;border-radius:3px;display:inline-block}#webnus-dashboard .addons-page-links{display:inline-block;margin:12px 4px 16px 0}#webnus-dashboard .addons-page-links a{background-color:#fff;color:#fff;border-radius:2px;padding:13px 24px;font-size:12px;letter-spacing:1px;font-weight:600;text-transform:uppercase}.addons-page-links.link-to-purchase a{background:#4cbf67;background:linear-gradient(95deg,#6fe08a 0,#58cf74 50%,#36cb58 100%);box-shadow:0 5px 10px -5px #4cbf67}.addons-page-links.link-to-install-addons a{background:#b092e6;background:linear-gradient(95deg,#b092e6 0,#9b70e8 50%,#8e5cea 100%);box-shadow:0 5px 10px -5px #b092e6}#webnus-dashboard .addons-page-links a:hover,#webnus-dashboard .w-box.addons-page.videobox .w-button a:hover{background:#222;background:linear-gradient(95deg,#555 0,#222 50%,#000 100%);box-shadow:0 5px 21px -5px rgba(0,0,0,.5)}.mec-addon-box-footer{background:#f7f8f9;border-radius:0 0 9px 9px;padding:10px 1px 8px;margin-top:25px;text-align:center;position:absolute;left:0;right:0;bottom:0}#webnus-dashboard .mec-addon-box-footer a{margin-top:10px;display:inline-block;text-shadow:none;border:none;transition:.24s;position:relative;margin-right:7px;font-size:12px;font-weight:500;border-radius:8px;padding:9px 18px 8px;width:53px;height:34px;line-height:21px;background:0 0;margin:0;box-shadow:none}#webnus-dashboard .mec-addon-box-footer a:last-of-type{margin-right:0}#webnus-dashboard .mec-addon-box-footer a.mec-addon-box-intro:hover{background-color:#ff3535;background:linear-gradient(95deg,#ff6c6c 0,#f55 50%,#ff3535 100%)}#webnus-dashboard .mec-addon-box-footer a:hover{background:#00cae6;cursor:pointer!important}#webnus-dashboard .mec-addon-box-footer a i{color:#00cae6;font-size:16px}#webnus-dashboard .mec-addon-box-footer a:hover i{color:#fff}#mec_tickets .mec-box{position:relative;padding:20px}#mec_fees_list input[type=text].mec-col-12,#mec_ticket_variations_list input[type=text].mec-col-12{max-width:625px}#taxes_option .mec-form-row input[type=text].mec-col-12,#ticket_variations_option input[type=text].mec-col-12{max-width:575px}.mec-booking-tab-content .mec-form-row textarea{max-width:762px}#mec_tickets .button.remove{padding:0;min-height:28px;height:28px;width:28px;margin:0;border-radius:50%;position:absolute;top:20px;right:20px;color:#fff;box-shadow:none;background:#fff;border-color:#ea6485;font-size:20px;line-height:1.5}#mec_tickets .button.remove svg{fill:#ea6485!important}#mec_tickets .button.remove:hover{color:#fff;border-color:#ea6485;background:#ea6485}#mec_tickets .button.remove:hover svg{fill:#fff!important}@media (max-width:480px){#mec_tickets .button.remove{top:5px;right:5px}}.mec-ticket-id{font-size:12px;line-height:12px;font-weight:400;color:#07bbe9;padding:0 0 8px;margin-bottom:14px;cursor:default}.mec-ticket-end-time.mec-col-12 .mec-time-span,.mec-ticket-start-time.mec-col-12 .mec-time-span{min-width:80px;display:inline-block}.mec-ticket-start-time{margin-bottom:20px}.mec-ticket-time{min-width:69px;display:inline-block}.mec-stop-selling-tickets{min-width:185px}#mec_meta_box_hourly_schedule_days .mec-form-row input[type=text],#mec_meta_box_tickets_form .mec-form-row input[type=text]{max-width:290px}@media (max-width:1366px){#mec_meta_box_hourly_schedule_days .mec-box.mec-form-row input[type=text]{max-width:150px;min-width:110px}}#mec_exceptions_not_in_days_date{width:100%}#mec-event-data input[type=date],#mec-event-data input[type=email],#mec-event-data input[type=tel],#mec-event-data input[type=text],#mec-event-data input[type=url],#mec-event-data select,#mec-event-data textarea,#mec_exceptions_not_in_days_date,#mec_meta_box_date_form input[type=text],#mec_meta_box_date_form input[type=url],#mec_select_tags.mec-create-shortcode-tab-content input[type=text],#mec_settings_weather_module_api_key{max-width:290px}#mec-event-data input[type=text].mec_date_picker.mec-col-4 #mec_meta_box_calendar_skin_options input[type=text].mec_date_picker.mec-col-4{max-width:32.33333333%}#payment_gateways_option .mec-col-4 input[type=number],#payment_gateways_option .mec-col-4 input[type=text],#payment_gateways_option .mec-col-4 select,#payment_gateways_option .mec-col-4 textarea{width:90%}.mec-form-repeating-event-row .mec-col-6 input[type=text]{width:35%}.addons-page-error,.addons-page-notice{display:block;margin-top:15px;margin-bottom:0;background:#fff;border-left:4px solid #00a0d2;box-shadow:0 1px 1px 0 rgba(0,0,0,.1);padding:1px 12px}.addons-page-error p,.addons-page-notice p{margin:.5em 0;padding:2px;font-size:13px}.addons-page-error{border-left-color:#dc3232}.mec-addon-box-comingsoon{background:0 0;padding:8px 11px;color:#5a5a5a;font-size:14px;font-weight:500;text-align:center}.mec-addons .w-row .w-col-sm-3:nth-child(4n+1){clear:left}@media (min-width:960px){#webnus-dashboard .mec-addon-box-footer .w-button{text-align:right}}@media (min-width:1401px){.mec-addon-box-title a span{font-size:17px}}.mec-pro-notice{margin-top:24px;line-height:30px}.mec-pro-notice .info-msg{padding:50px 30px;margin-bottom:0}#webnus-dashboard .mec-pro-notice .info-msg{background:#fff;box-shadow:0 1px 2px rgb(0 0 0 / 1%);text-align:center;color:#55595d}#webnus-dashboard a.info-msg-link{background:#e66f52;background:linear-gradient(95deg,#ff8162 0,#e66f52 50%,#ff4c20 100%);box-shadow:0 5px 10px -5px #e66f52;border-radius:2px;padding:12px 50px;font-size:16px;line-height:24px;border:none;margin:20px auto 0;color:#fff;transition:all .3s ease;display:inline-block}#webnus-dashboard a.info-msg-link:hover{background:#222;background:linear-gradient(95deg,#555 0,#222 50%,#000 100%);box-shadow:0 5px 21px -5px rgba(0,0,0,.5)}#webnus-dashboard .info-msg p{width:70%;margin:0 auto;line-height:1.8}#webnus-dashboard .info-msg-coupon{font-size:13px;color:#777;max-width:600px;line-height:1.68;margin:25px auto 0}#webnus-dashboard .info-msg-coupon strong{font-weight:700;color:#19ce18}.info-msg .socialfollow{padding-top:20px}.info-msg .socialfollow a{margin:0 2px;display:inline-block}.info-msg .socialfollow a i{background:#96a4b1;color:#fff;padding:6px;border-radius:3px;font-size:18px;box-shadow:0 2px 3px rgba(0,0,0,.1);transition:all .25s}.info-msg .socialfollow a:hover i{background:#008aff}.mec-intro-section .w-box-content{text-align:center}.mec-intro-section .w-box-content.mec-intro-section-welcome{max-width:600px;margin:0 auto}.mec-intro-section .w-box-content.mec-intro-section-welcome h3{font-size:26px}a.mec-intro-section-link-tag.button.button-hero{margin:0 10px 40px}a.mec-intro-section-link-tag.button.button-primary.button-hero{color:#fff!important}a.mec-intro-section-link-tag.button.button-secondary.button-hero{color:#1dbfd8!important}.mec-intro-section-ifarme iframe{border:1px solid #e7e7e7;border-radius:9px;padding:15px;box-shadow:0 3px 10px -6px rgb(0 0 0 / 12%)}.w-box-content.mec-intro-section-welcome p{margin-bottom:0}.mec-tooltip a:focus{box-shadow:none}#mec_booking_form .mec-options-fields,#mec_modules_form .mec-options-fields,#mec_settings_form .mec-options-fields,#mec_single_form .mec-options-fields{padding-bottom:0!important}#mec_taxes_fees_container_toggle{margin-bottom:60px}#mec_taxes_fees_container_toggle{margin-bottom:60px}.wns-be-sidebar li{position:relative}.wns-be-sidebar li .submneu-hover{position:absolute;top:-1px;right:-222px;width:220px;z-index:9;background:#fff;border:1px;border-style:solid;border-color:#dedede;margin:0;overflow:visible;opacity:0;visibility:hidden;transition:all .23s ease;padding-top:8px;padding-bottom:12px}.wns-be-sidebar li:hover .submneu-hover{opacity:1;visibility:visible}.wns-be-sidebar li .submneu-hover a{background:#fff;color:#636363;opacity:1;font-size:12px;padding:6px 4px 6px 26px}.wns-be-sidebar li .submneu-hover a:hover{background:#f6f6f6;color:#222}.wns-be-sidebar li .submneu-hover:before{position:absolute;z-index:999;content:" ";height:0;width:0;border:7px solid transparent;border-right-color:#fff;left:-15px;top:14px;border-right-color:#c5c5c5;right:0}.wns-be-sidebar li .submneu-hover:after{position:absolute;z-index:999;content:" ";height:0;width:0;border:7px solid transparent;border-right-color:#fff;left:-14px;top:14px}.wns-be-sidebar li a:focus,.wns-be-sidebar li:focus{outline:-webkit-focus-ring-color auto 0;border:0;box-shadow:none}@media (max-width:480px){.wns-be-sidebar li .submneu-hover{width:175px;right:0}.wns-be-sidebar li .submneu-hover a{font-size:11px;padding:5px 5px 5px 20px}}.mec-tooltip:hover:after,.mec-tooltip:hover:before{display:none}.mec-tooltip{bottom:0}.mec-tooltip .box{min-width:300px;max-width:600px;display:inline-block;left:36px;top:calc(50% - 9px);transform:translateY(-50%);padding:0;margin-top:8px;background-color:#535a61;color:#fff;font-weight:300;font-size:14px;letter-spacing:.5px;line-height:1.3;position:absolute;z-index:9999999;box-sizing:border-box;border-radius:6px;box-shadow:0 4px 32px -10px #444b50;visibility:hidden;opacity:0;transition:opacity .23s}#webnus-dashboard .mec-tooltip .box p,.mec-tooltip .box p{color:#fff;font-size:14px;line-height:1.3;margin:0;font-style:normal}.mec-tooltip:hover .box{visibility:visible;opacity:1}.mec-tooltip:hover .box{padding:20px;border-radius:8px}.mec-tooltip .box h5{color:#fff;font-size:17px;font-weight:600;margin:-30px -20px;padding:15px 0;text-align:center;margin-bottom:10px;background:#3a3f44;border-bottom:1px solid #30353a;border-radius:6px 6px 0 0;z-index:9999}.mec-tooltip .box h5:after{display:none}#webnus-dashboard .mec-tooltip .box p a,.mec-tooltip .box p a{color:#40d9f1;margin-top:10px;margin-left:0;font-weight:400;position:relative;text-decoration:none;display:block;width:max-content}.mec-tooltip .box a:hover{color:#f90}.mec-tooltip .box:after{display:block;position:absolute!important;top:100%!important;right:50%!important;margin-top:-6px!important;margin-right:-6px!important;width:12px!important;height:24px!important;overflow:hidden!important;transform:rotate(-90deg)!important}.mec-tooltip .box:before{display:block;content:""!important;position:absolute!important;width:12px;height:12px;left:-10px!important;top:50%!important;transform:translate(50%,-50%) rotate(-45deg)!important;background-color:#535a61!important;box-shadow:0 8px 9px -4px #535a61!important;z-index:0!important}.mec-tooltip .box.top{left:50%;top:0;transform:translate(-50%,-100%);margin-top:0;margin-left:-10px}.mec-tooltip .box.top:after{top:50%!important;right:100%!important}.mec-tooltip .box.top:before{left:50%!important;top:100%!important}.mec-tooltip .box.bottom{left:50%;top:auto;bottom:0;transform:translate(-50%,100%);margin-bottom:-20px;margin-left:-10px}.mec-tooltip .box.bottom:after{top:0!important;right:50%!important;background-color:#3a3f44!important}.mec-tooltip .box.bottom:before{left:50%!important;top:-7px!important;transform:translateX(-50%);background-color:#3a3f44!important}.mec-tooltip .box.left{left:auto;right:36px;top:calc(50% - 9px);transform:translateY(-50%)}.mec-tooltip .box.left:before{right:0!important;left:auto!important;top:50%!important}form#mec_reg_fields_form input[type=radio]:before{content:"";display:inline-block;background:#fff;border-radius:18px;width:14px;height:14px;margin:-1px 0 0 -2px;cursor:pointer;border:2px solid #e1e7ed;box-shadow:0 2px 15px -3px rgba(69,77,89,.32)}form#mec_reg_fields_form input[type=radio]:checked:before{border:7px solid #ccecf4;background:#fff;box-shadow:0 3px 16px -3px #008aff;width:4px;height:4px}form#mec_reg_fields_form input[type=radio]{min-height:0;margin-right:6px}form#mec_reg_fields_form label{margin-right:20px}@media (min-width:1200px) and (max-width:1366px){.mec-tooltip .box{min-width:290px}.mec-tooltip .box h5{font-size:15px}.mec-tooltip .box .content{font-size:12px}}@media (max-width:1366px){.wns-be-container .wns-be-group-tab p{margin-top:0}}.mec-addons-notification-box-wrap .w-col-sm-12,.mec-cmsg-notification-box-wrap .w-col-sm-12{padding:0}.mec-addons-notification-box-wrap img{width:auto}.mec-addons-notification-box-image{width:555px;display:inline-block;vertical-align:top}.mec-addons-notification-box-content{width:calc(100% - 559px);display:inline-block}.mec-addons-notification-box-content p{margin-top:1%;line-height:1.5;font-size:16px}.mec-addons-notification-box-content .w-box-content{padding-top:0;padding-bottom:0}.mec-addons-notification-box-content ol{font-size:16px}.mec-addons-notification-box-content a{background:#38d5ed;color:#fff!important;padding:10px 26px;margin-top:5px;display:inline-block;border-radius:3px;text-transform:capitalize;font-size:16px;letter-spacing:.4px;transition:all .1s ease;font-weight:600;text-decoration:none}.mec-addons-notification-box-content a:hover{background:#000}.w-clearfix.w-box.mec-addons-notification-box-wrap span,.w-clearfix.w-box.mec-cmsg-2-notification-box-wrap span,.w-clearfix.w-box.mec-cmsg-notification-box-wrap span{right:0;left:unset;cursor:pointer;background:0 0;padding:0 16px}.w-clearfix.w-box.mec-addons-notification-box-wrap span i,.w-clearfix.w-box.mec-cmsg-2-notification-box-wrap span i,.w-clearfix.w-box.mec-cmsg-notification-box-wrap span i{font-size:28px;vertical-align:sub;color:#f2113e}.mec-custom-msg-notification-wrap,.wns-be-container .mec-addons-notification-wrap{padding:0;margin:0}.mec-custom-msg-notification-wrap .w-col-sm-12,.wns-be-container .mec-addons-notification-wrap .w-col-sm-12{padding:0}.wns-be-container .w-box{margin-top:0}.wns-be-container.mec-addons-notification-set-box{margin-right:15px;margin-top:50px;margin-bottom:27px}@media (max-width:1200px){.mec-addons-notification-box-content,.mec-addons-notification-box-image{width:100%;display:block}.mec-addons-notification-box-image{text-align:center}}@media (max-width:768px){.mec-addons-notification-box-image img{width:100%;height:auto}}.mec-details-addons-container{margin-top:20px}.mec-details-addons-wrap img{float:left;width:19%;margin-right:17px}.mec-details-addons-wrap{clear:both;margin-bottom:80px;display:block;position:relative}.mec-details-addons-wrap a{text-decoration:none}.mec-details-addons-wrap p{float:left;width:340px;margin-top:0;margin-bottom:30px}.mec-details-addons-title{font-weight:700}.mec-details-addons-title a{color:#444}body .crisp-client .crisp-1rjpbb7 .crisp-1rf4xdh .crisp-ewasyx{border-radius:10px!important;box-shadow:0 4px 38px rgba(0,0,0,.14)!important}body .crisp-client .crisp-1rjpbb7 .crisp-13qutdl,body .crisp-client .crisp-1rjpbb7 .crisp-13qutdl *,body .crisp-client .crisp-1rjpbb7 .crisp-9dgo7z,body .crisp-client .crisp-1rjpbb7 .crisp-9dgo7z *{font-family:proxima-nova,-apple-system,BlinkMacSystemFont,"Segoe UI",Catamaran,sans-serif!important}body .crisp-client .crisp-1rjpbb7 .crisp-145mbcr,body .crisp-client .crisp-1rjpbb7 .crisp-1jrqqbm:hover{background-color:#fff!important}body .crisp-client .crisp-1rjpbb7 .crisp-14u434g{border-color:#e7e8e9!important}body .crisp-client .crisp-1rjpbb7 .crisp-1rf4xdh .crisp-ewasyx .crisp-1784wh6 .crisp-1xmtdlg .crisp-1bkorcf .crisp-1vzg1qq{font-size:20px!important;width:14px!important;height:19px!important;opacity:.85}body .crisp-client .crisp-1rjpbb7 .crisp-1rf4xdh .crisp-ewasyx .crisp-1784wh6 .crisp-1xmtdlg .crisp-1bkorcf .crisp-1vzg1qq:hover{opacity:.99}body .crisp-client .crisp-1rjpbb7 .crisp-1rf4xdh .crisp-ewasyx .crisp-zyxrmn .crisp-1bu0ive .crisp-1sps3eb .crisp-1vd2grm .crisp-12w4w1a{font-size:13px!important}body .crisp-client .crisp-1rjpbb7 .crisp-1rf4xdh .crisp-ewasyx .crisp-zyxrmn .crisp-1bu0ive .crisp-1sps3eb .crisp-1vd2grm .crisp-12w4w1a::-webkit-input-placeholder{color:#717273!important}body .crisp-client .crisp-1rjpbb7 .crisp-1rf4xdh .crisp-ewasyx .crisp-zyxrmn .crisp-1bu0ive .crisp-z7oo2o .crisp-lgu84d .crisp-1ohjrf0 .crisp-dqw9ko .crisp-bhspdv[data-from=visitor] .crisp-z89v5n .crisp-162m9xf{background-color:#008aff!important;color:#fff!important;box-shadow:none!important;border-radius:5px!important;padding:15px 25px 15px!important}body .crisp-client .crisp-1rjpbb7 .crisp-1rf4xdh .crisp-ewasyx .crisp-zyxrmn .crisp-1bu0ive .crisp-z7oo2o .crisp-lgu84d .crisp-1ohjrf0 .crisp-dqw9ko .crisp-bhspdv[data-from=visitor] .crisp-z89v5n .crisp-162m9xf .crisp-1o2g4mc{color:#fff!important;font-size:13px!important;letter-spacing:.3px!important}body .crisp-client .crisp-1rjpbb7 .crisp-1rf4xdh .crisp-ewasyx .crisp-zyxrmn .crisp-1bu0ive .crisp-z7oo2o .crisp-lgu84d .crisp-1ohjrf0 .crisp-dqw9ko .crisp-bhspdv .crisp-z89v5n .crisp-162m9xf{background-color:#f1f2f3!important;border-radius:5px!important;padding:15px 25px 15px!important;box-shadow:none!important;color:#121314!important}body .crisp-client .crisp-1rjpbb7 .crisp-1rf4xdh .crisp-ewasyx .crisp-zyxrmn .crisp-1bu0ive .crisp-z7oo2o .crisp-lgu84d .crisp-1ohjrf0 .crisp-dqw9ko .crisp-bhspdv[data-type=audio] .crisp-z89v5n .crisp-162m9xf{background-color:#d1d7dc!important}body .crisp-client .crisp-1rjpbb7 .crisp-1rf4xdh .crisp-ewasyx .crisp-zyxrmn .crisp-1bu0ive .crisp-z7oo2o .crisp-lgu84d .crisp-1ohjrf0 .crisp-dqw9ko .crisp-bhspdv[data-from=operator] .crisp-z89v5n .crisp-1o2g4mc{color:#121314!important;-webkit-text-fill-color:#121314!important;font-size:13px!important;letter-spacing:.3px!important}body .crisp-client .crisp-1rjpbb7 .crisp-1rf4xdh .crisp-ewasyx .crisp-zyxrmn .crisp-1bu0ive .crisp-z7oo2o .crisp-lgu84d .crisp-1ohjrf0 .crisp-dqw9ko .crisp-bhspdv .crisp-mkirz6 .crisp-12qaym5 .crisp-39hskb{opacity:.4;margin-right:5px!important}body .crisp-client .crisp-1rjpbb7 .crisp-1rf4xdh .crisp-ewasyx .crisp-zyxrmn .crisp-1bu0ive .crisp-z7oo2o .crisp-lgu84d .crisp-1ohjrf0 .crisp-dqw9ko .crisp-bhspdv .crisp-mkirz6 .crisp-12qaym5 .crisp-ehr6mw{opacity:.68;font-size:12px!important}body .crisp-client .crisp-1rjpbb7 .crisp-1rf4xdh .crisp-ewasyx .crisp-1784wh6 .crisp-1xmtdlg{background-image:linear-gradient(125deg,#008aff -10%,#0066b1 100%)!important;height:110px!important;padding-top:35px!important}body .crisp-client .crisp-1rjpbb7 .crisp-1rf4xdh .crisp-ewasyx .crisp-1784wh6 .crisp-1xmtdlg .crisp-rhv8pz .crisp-1uw6f17,body .crisp-client .crisp-1rjpbb7 .crisp-1rf4xdh .crisp-ewasyx .crisp-1784wh6 .crisp-1xmtdlg .crisp-rhv8pz .crisp-85evuk,body .crisp-client .crisp-1rjpbb7 .crisp-1rf4xdh .crisp-ewasyx .crisp-1784wh6 .crisp-1xmtdlg .crisp-rhv8pz .crisp-nu40j6{font-size:17px!important;line-height:28px!important;padding-top:10px!important}body .crisp-client .crisp-1rjpbb7 .crisp-1rf4xdh .crisp-kquevr .crisp-x94m06{background-color:#008aff!important;background-image:linear-gradient(125deg,#008aff -10%,#008af0 100%)!important;box-shadow:0 5px 34px -6px #008aff!important}body .crisp-client .crisp-1rjpbb7 .crisp-4oo1n4{background-color:transparent!important}body .crisp-client .crisp-1rjpbb7 .crisp-1rf4xdh .crisp-ewasyx[data-chat-status=ongoing] .crisp-1784wh6 .crisp-1xmtdlg .crisp-172kolj{margin-top:-10px!important}body .crisp-client .crisp-1rjpbb7[data-last-operator-face=false] .crisp-1rf4xdh .crisp-kquevr .crisp-x94m06 .crisp-16qgsyi .crisp-101bp3x[data-is-ongoing=false]{background-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI1OCIgaGVpZ2h0PSI1NSIgdmlld0JveD0iMCAwIDU4IDU1Ij4NCiAgPGcgaWQ9ImNoYXQtc3ZncmVwby1jb21fMV8iIGRhdGEtbmFtZT0iY2hhdC1zdmdyZXBvLWNvbSAoMSkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDAgLTEuNSkiPg0KICAgIDxwYXRoIGlkPSJQYXRoXzEiIGRhdGEtbmFtZT0iUGF0aCAxIiBkPSJNMjksMS41YzE2LjAxNiwwLDI5LDExLjY0MSwyOSwyNmEyNC4wMSwyNC4wMSwwLDAsMS00LjgsMTQuMzE4Yy40LDQuNzQ1LDEuNTQyLDExLjQyOCw0LjgsMTQuNjgyLDAsMC05Ljk0My0xLjQtMTYuNjc3LTUuNDYybC0uMDIyLjAwOWMtMi43NjQtMS44LTUuNTMyLTMuNjU2LTYuMS00LjEyNmExLDEsMCwwLDAtMS4zMy0uMjc3LDEuMDE3LDEuMDE3LDAsMCwwLS40ODkuODQ4Yy0uMDEuNjIyLjAwNS43ODQsNS41ODUsNC40MjFBMzEuOTE0LDMxLjkxNCwwLDAsMSwyOSw1My41Yy0xNi4wMTYsMC0yOS0xMS42NDEtMjktMjZTMTIuOTg0LDEuNSwyOSwxLjVaIiBmaWxsPSIjZmZmIi8+DQogICAgPGNpcmNsZSBpZD0iRWxsaXBzZV8xIiBkYXRhLW5hbWU9IkVsbGlwc2UgMSIgY3g9IjMiIGN5PSIzIiByPSIzIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgxMiAyNC41KSIgZmlsbD0iIzAwOGFmZiIvPg0KICAgIDxjaXJjbGUgaWQ9IkVsbGlwc2VfMiIgZGF0YS1uYW1lPSJFbGxpcHNlIDIiIGN4PSIzIiBjeT0iMyIgcj0iMyIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMjYgMjQuNSkiIGZpbGw9IiMwMDhhZmYiLz4NCiAgICA8Y2lyY2xlIGlkPSJFbGxpcHNlXzMiIGRhdGEtbmFtZT0iRWxsaXBzZSAzIiBjeD0iMyIgY3k9IjMiIHI9IjMiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDQwIDI0LjUpIiBmaWxsPSIjMDA4YWZmIi8+DQogIDwvZz4NCjwvc3ZnPg0K)!important;height:31px!important;top:16px!important;left:14px!important}body .csh-category-item a h6{text-align:left}.mec-form-row.mec-syn-schedule{background:#fff;padding:20px;border:1px solid #eee;margin-bottom:10px;border-radius:3px}.mec-form-row.mec-syn-schedule p{padding-left:26px}.mec-form-row.mec-syn-schedule h2{margin-top:0}.mec-form-row.mec-syn-schedule h4{margin:10px 0}li.wns-be-group-menu-li.mec-settings-menu a svg{position:absolute;margin-top:2px}li.wns-be-group-menu-li.mec-settings-menu a svg{fill:#a0abb5;stroke:#a0abb5}li.wns-be-group-menu-li.mec-settings-menu:hover a svg{fill:#07bbe9;stroke:#07bbe9}li.wns-be-group-menu-li.mec-settings-menu.active a svg{fill:#07bbe9;stroke:#07bbe9}li.wns-be-group-menu-li.mec-settings-menu .mec-settings-submenu{position:absolute;top:-1px;right:-222px;width:220px;z-index:9;background:#fff;border:1px;border-style:solid;border-color:#e6e9eb;margin:0;overflow:visible;opacity:0;visibility:hidden;transition:all .23s ease;padding-top:8px;padding-bottom:12px;border-radius:0 2px 2px 0;box-shadow:0 2px 4px rgba(0,0,0,.03)}li.wns-be-group-menu-li.mec-settings-menu:hover>.mec-settings-submenu{visibility:visible;opacity:1}.mec-settings-menu .mec-settings-submenu:before{position:absolute;z-index:999;content:" ";height:0;width:0;border:7px solid transparent;border-right-color:#fff;left:-15px;top:14px;border-right-color:#d6d9db;right:0}.mec-settings-menu .mec-settings-submenu:after{position:absolute;z-index:999;content:" ";height:0;width:0;border:7px solid transparent;border-right-color:#fff;left:-14px;top:14px}.wns-be-sidebar .mec-settings-menu .mec-settings-submenu a{background:#fff;color:#666c75;opacity:1;font-size:13px;font-weight:400;padding:6px 4px 5px 26px}.wns-be-sidebar .mec-settings-menu .mec-settings-submenu a:hover{color:#000;background:#f7f8f9}.mec-form-row.mec-skin-countdown-date-format-container input[type=text],.mec-form-row.mec-skin-grid-date-format-container input[type=text],.mec-form-row.mec-skin-list-date-format-container input[type=text],.mec-skin-options-container input[type=text]{max-width:unset}.wn-mec-select{width:32.33333333%!important;clear:unset!important}.wn-mec-select{-webkit-tap-highlight-color:transparent;background-color:#fff;border-radius:3px;border:1px solid #ddd;margin-bottom:8px;position:relative;text-align:left!important;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;box-shadow:0 3px 13px -5px rgba(0,0,0,.1),inset 0 1px 2px rgba(0,0,0,.07)}.wn-mec-select:hover{border-color:#dbdbdb}.wn-mec-select.open .list{overflow:unset;width:100%;margin:0}.wn-mec-select .list{background-color:#fff;border-radius:2px;box-shadow:0 2px 33px -2px rgba(0,0,0,.2),inset 0 1px 2px rgba(0,0,0,.07);box-sizing:border-box;margin-top:4px;opacity:0;overflow:hidden;padding:0;pointer-events:none;position:absolute;top:100%;left:0;-webkit-transform-origin:50% 0;-ms-transform-origin:50% 0;transform-origin:50% 0;-webkit-transform:scale(.75) translateY(-21px);-ms-transform:scale(.75) translateY(-21px);transform:scale(.75) translateY(-21px);-webkit-transition:all .2s cubic-bezier(.5, 0, 0, 1.25),opacity .15s ease-out;transition:all .2s cubic-bezier(.5, 0, 0, 1.25),opacity .15s ease-out;z-index:9}.wn-mec-select{-webkit-tap-highlight-color:transparent;background-color:#fff;border-radius:5px;border:solid 1px #e8e8e8;box-sizing:border-box;clear:both;cursor:pointer;display:block;float:left;font-family:inherit;font-size:14px;font-weight:400;height:42px;line-height:40px;outline:0;padding-left:18px;padding-right:30px;position:relative;text-align:left!important;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;width:auto}.wn-mec-select:hover{border-color:#dbdbdb}.wn-mec-select:after{border-bottom:2px solid #999;border-right:2px solid #999;content:"";display:block;height:5px;margin-top:-4px;pointer-events:none;position:absolute;right:12px;top:50%;-webkit-transform-origin:66% 66%;-ms-transform-origin:66% 66%;transform-origin:66% 66%;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);-webkit-transition:all .15s ease-in-out;transition:all .15s ease-in-out;width:5px}.wn-mec-select.open:after{-webkit-transform:rotate(-135deg);-ms-transform:rotate(-135deg);transform:rotate(-135deg)}.wn-mec-select.open .list{opacity:1;pointer-events:auto;-webkit-transform:scale(1) translateY(0);-ms-transform:scale(1) translateY(0);transform:scale(1) translateY(0)}.wn-mec-select.disabled{border-color:#ededed;color:#999;pointer-events:none}.wn-mec-select.disabled:after{border-color:#ccc}.wn-mec-select.wide{width:100%}.wn-mec-select.wide .list{left:0!important;right:0!important}.wn-mec-select.right{float:right}.wn-mec-select.right .list{left:auto;right:0}.wn-mec-select.small{font-size:12px;height:36px;line-height:34px}.wn-mec-select.small:after{height:4px;width:4px}.wn-mec-select .list{background-color:#fff;border-radius:5px;box-shadow:0 0 0 1px rgba(68,68,68,.11);box-sizing:border-box;margin-top:4px;opacity:0;overflow:hidden;padding:0;pointer-events:none;position:absolute;top:100%;left:0;-webkit-transform-origin:50% 0;-ms-transform-origin:50% 0;transform-origin:50% 0;-webkit-transform:scale(.75) translateY(-21px);-ms-transform:scale(.75) translateY(-21px);transform:scale(.75) translateY(-21px);-webkit-transition:all .2s cubic-bezier(.5, 0, 0, 1.25),opacity .15s ease-out;transition:all .2s cubic-bezier(.5, 0, 0, 1.25),opacity .15s ease-out;z-index:9}.wn-mec-select .list:hover .option:not(:hover){background-color:transparent!important}.wn-mec-select .option{cursor:pointer;font-weight:400;list-style:none;min-height:40px;outline:0;text-align:left;position:relative;font-size:12px!important;padding:1px 12px!important;margin:0!important;line-height:28px!important;min-height:28px!important;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.wn-mec-select .option .wn-hover-img-sh img{position:absolute;padding:3px;top:-1px;left:100%;box-shadow:0 4px 42px -5px rgba(0,0,0,.16);visibility:hidden;opacity:0;border:1px solid #e3e3e3;border-radius:2px;z-index:99999999;background:#fff}.wn-mec-select .option:hover .wn-hover-img-sh img{visibility:visible;opacity:1}.wn-mec-select .option.focus,.wn-mec-select .option.selected.focus,.wn-mec-select .option:hover{background-color:#f6f6f6}.wn-mec-select .option.selected{font-weight:700}.wn-mec-select .option.disabled{background-color:transparent;color:#999;cursor:default}.no-csspointerevents .wn-mec-select .list{display:none}.no-csspointerevents .wn-mec-select.open .list{display:block}.mec-custom-nice-select ul.list li.option{width:30%!important;float:left!important;min-height:135px!important;height:135px;margin:1.66%!important;box-sizing:border-box;text-align:center;padding:10px!important;border-radius:8px;border:1px solid transparent;box-shadow:none;background:#fff0!important}.mec-custom-nice-select ul.list li.option:hover{box-shadow:0 1px 8px rgba(0,0,0,.025),0 0 0 1px #f3f4f5}.mec-custom-nice-select .list .option:hover,.mec-custom-nice-select ul.list li.option:hover{background:#fff!important}.mec-custom-nice-select .list:hover .option:not(:hover),.mec-custom-nice-select ul.list:hover li.option{background:#fff!important}.mec-custom-nice-select ul.list{min-width:600px!important;padding:20px 10px!important;background:#fcfbfd;border:1px solid #e9e9e9;box-shadow:0 1px 4px rgba(0,0,0,.05)}.mec-custom-nice-select ul.list li.option.selected{border:1px solid #40d9f16b;box-shadow:0 1px 8px -3px #40d9f152 inset;color:#00cae6;padding:12px 0 0 0!important}.mec-custom-nice-select .wn-img-sh img{margin:4px 0 1px 1px;line-height:1;max-width:68px;max-height:56px;filter:grayscale(1);-webkit-filter:grayscale(1);transition:all .22s ease;-webkit-transition:all .22s ease;-moz-transition:all .22s ease;-ms-transition:all .22s ease;-o-transition:all .22s ease}.wn-mec-select .option.focus .wn-img-sh img,.wn-mec-select .option.selected.focus .wn-img-sh img,.wn-mec-select .option:hover .wn-img-sh img{background-color:#f6f6f6;filter:grayscale(0);-webkit-filter:grayscale(0)}@media (max-width:768px){.wn-mec-select{width:45%!important}.mec-custom-nice-select ul.list{margin-left:-24px!important;min-width:404px!important}.mec-custom-nice-select ul.list li.option{width:46.6%!important}.wn-hover-img-sh{display:none}}@media (max-width:480px){.wn-mec-select{width:100%!important}.mec-custom-nice-select ul.list{min-width:337px!important}}@media (max-width:320px){.mec-custom-nice-select ul.list li.option{width:100%!important}.mec-custom-nice-select ul.list{min-width:298px!important}}.mec-sed-methods li{line-height:28px;padding-left:38px;position:relative}.mec-sed-methods li:before{margin-right:0}.mec-sed-methods li:before{border-radius:18px}.mec-custom-nice-select ul.list li .wn-mec-text:after,.mec-sed-methods li:before{content:"";position:absolute;display:inline-block;background:#fff;border-radius:2px;width:12px;height:12px;margin:-1px 0 0 -1px;cursor:pointer;border:2px solid #e1e7ed;border-radius:50%}.mec-custom-nice-select ul.list li .wn-mec-text{position:relative;padding-top:0;padding-bottom:28px}.mec-custom-nice-select ul.list li .wn-mec-text:after{left:calc(50% - 7px);top:auto;bottom:1px}.mec-custom-nice-select ul.list li .wn-img-sh{line-height:1}.mec-sed-methods li:before{left:9px;top:calc(50% - 7px)}.mec-custom-nice-select ul.list li.option.selected .wn-mec-text:after,.mec-sed-methods li.active:before{width:4px;height:4px;border:7px solid #07bbe9;background:#fff;box-shadow:0 3px 16px -3px #07bbe9}#menu-posts-mec-books .wp-menu-image img,#toplevel_page_mec-intro .wp-menu-image img{width:18px!important;padding-top:7px!important}.mec-add-booking-tabs-wrap,.mec-add-event-tabs-wrap,.mec-create-shortcode-tabs-wrap{display:flex;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox}.mec-add-booking-tabs-left,.mec-add-event-tabs-left{min-width:200px}@media (max-width:1366px){.mec-add-booking-tabs-left,.mec-add-event-tabs-left{min-width:137px}}.mec-add-booking-tabs-left,.mec-add-event-tabs-left,.mec-create-shortcode-tabs-left{flex:1}.mec-add-booking-tabs-right,.mec-add-event-tabs-right,.mec-create-shortcode-tabs-right{flex:6}a.mec-add-booking-tabs-link,a.mec-add-event-tabs-link,a.mec-create-shortcode-tabs-link{display:block}.mec-booking-tab-content,.mec-create-shortcode-tab-content,.mec-event-tab-content{display:none;transition:all .3s ease}.mec-booking-tab-content.mec-tab-active,.mec-create-shortcode-tab-content.mec-tab-active,.mec-event-tab-content.mec-tab-active{display:block}.mec-add-booking-tabs-wrap,.mec-add-event-tabs-wrap{background:#fff;margin:-6px -12px -12px}.mec-create-shortcode-tabs-wrap{margin:-30px -22px -42px}.mec-add-booking-tabs-left,.mec-add-event-tabs-left,.mec-create-shortcode-tabs-left{background:#f7f8f9}.mec-add-booking-tabs-left a,.mec-add-event-tabs-left a,.mec-create-shortcode-tabs-left a{display:block;position:relative;outline:0;padding:13px 4px 13px 15px;background:#e3e5e7;background:0 0;border:solid;border-width:1px 0 1px 0;border-color:transparent;color:#3f454a;font-size:13px;font-weight:600;text-decoration:none;border-radius:0;transition:all .2s ease}.mec-add-booking-tabs-left a:first-of-type,.mec-add-event-tabs-left a:first-of-type,.mec-create-shortcode-tabs-left a:first-of-type{border-top:none}.mec-add-booking-tabs-left a:hover,.mec-add-event-tabs-left a:hover,.mec-create-shortcode-tabs-left a:hover{background:#fff;color:#07bbe9}.mec-add-booking-tabs-left a:focus,.mec-add-event-tabs-left a:focus,.mec-create-shortcode-tabs-left a:focus{box-shadow:none;outline:unset}.mec-add-booking-tabs-left a.mec-tab-active,.mec-add-event-tabs-left a.mec-tab-active,.mec-create-shortcode-tabs-left a.mec-tab-active{background:#ecf9fd;color:#07bbe9;border-color:#ccecf4;position:relative;padding-left:17px}.inside div div>a.mec-tab-active:after,.inside div div>a.mec-tab-active:before{position:absolute;z-index:9!important;content:" ";height:0;width:0;border:8px solid transparent;border-right-color:#fff;right:-1px;top:13px}.inside div div>a.mec-tab-active:before{border-right-color:#d7d8d9;right:0}.mec-add-booking-tabs-right,.mec-add-event-tabs-right,.mec-create-shortcode-tabs-right{padding:0 30px 40px;border-left:1px solid #e2e2e2}.mec-booking-tab-content.mec-tab-active,.mec-create-shortcode-tab-content.mec-tab-active,.mec-event-tab-content.mec-tab-active{animation:fadeEffect2 .31s}@media (max-width:1366px){.mec-add-booking-tabs-right,.mec-add-event-tabs-right,.mec-create-shortcode-tabs-right{padding:0 15px 20px}.mec-form-row select{min-width:60px}}@media (min-width:1199px) and (max-width:1280px){.mec-add-booking-tabs-right,.mec-add-event-tabs-right,.mec-create-shortcode-tabs-right{padding:0 0 0 10px}#mec_meta_box_hourly_schedule_days{padding:0 40px 0 0}#mec_meta_box_hourly_schedule_days .mec-form-row.mec-box{margin-right:-40px}#mec_comment,#mec_cost,#mec_countdown_method,#mec_event_timezone,#mec_public,#mec_repeat_type{min-width:220px;width:220px}#mec_meta_box_hourly_schedule_days .mec-box.mec-form-row input[type=text]{max-width:120px}.mec-form-row .mec-time-picker select{min-width:60px}#mec_countdown_method,#mec_repeat_type{min-width:220px;width:220px}#mec_exceptions_in_days_container .mec-col-4{width:25%}#mec_exceptions_in_days_container .mec-col-3{width:50%}#mec_exceptions_in_days_container .mec-col-5{width:20%}#mec_exceptions_in_days_container input[type=text]{width:95%}#mec_repeat_certain_weekdays_container label:not(.mec-col-3){display:block;padding-left:25%}}@media (max-width:1023px){.post-type-mec-events h4,.post-type-mec_calendars .mec-meta-box-fields h3{margin-top:20px}.post-type-mec-events .mec-form-row{padding-bottom:20px}.post-type-mec-events .mec-form-row .mec-form-row{padding:0}.post-type-mec-events .mec-form-row .mec-col-1,.post-type-mec-events .mec-form-row .mec-col-10,.post-type-mec-events .mec-form-row .mec-col-11,.post-type-mec-events .mec-form-row .mec-col-12,.post-type-mec-events .mec-form-row .mec-col-2,.post-type-mec-events .mec-form-row .mec-col-3,.post-type-mec-events .mec-form-row .mec-col-4,.post-type-mec-events .mec-form-row .mec-col-5,.post-type-mec-events .mec-form-row .mec-col-6,.post-type-mec-events .mec-form-row .mec-col-7,.post-type-mec-events .mec-form-row .mec-col-8,.post-type-mec-events .mec-form-row .mec-col-9{display:block;width:100%;margin:20px 0 0 0;max-width:285px}.post-type-mec-events .mec-add-booking-tabs-left,.post-type-mec-events .mec-add-event-tabs-left{min-width:180px}.post-type-mec-events .mec-add-booking-tabs-left a,.post-type-mec-events .mec-add-event-tabs-left a,.post-type-mec-events .mec-create-shortcode-tabs-left a{padding-left:10px}#mec_repeat_type,.post-type-mec-events #mec_settings_fes_thankyou_page_url,.post-type-mec-events .mec-form-row .mec-col-4 input[type=number],.post-type-mec-events .mec-form-row .mec-col-4 input[type=text],.post-type-mec-events .mec-form-row .mec-col-4 select,.post-type-mec-events .mec-form-row .mec-col-4 textarea{width:100%;max-width:255px}#mec-exceptional-days .mec-certain-day>div,#mec_exceptions_in_days_container .mec-certain-day>div{width:100%;max-width:255px;padding:12px;margin:20px 10px 0 0;border-radius:8px}.mec-certain-day .mec-in-days-day,.mec-certain-day>div .mec-not-in-days-day{line-height:21px;font-size:10px}#mec_repeat_certain_weekdays_container label{display:block;margin:20px 0 20px 0}}@media (max-width:640px){.mec-add-booking-tabs-wrap,.mec-add-event-tabs-wrap,.mec-create-shortcode-tabs-wrap{display:block}.post-type-mec-events .mec-add-booking-tabs-left,.post-type-mec-events .mec-add-event-tabs-left{min-width:100%;width:100%!important;display:block!important;float:unset;margin:0;flex:unset;height:auto}.post-type-mec-events .mec-add-booking-tabs-right,.post-type-mec-events .mec-add-event-tabs-right,.post-type-mec-events .mec-create-shortcode-tabs-right{display:block;min-width:100%;width:100%;margin:0;flex:unset}.post-type-mec-events .mec-add-booking-tabs-left a,.post-type-mec-events .mec-add-event-tabs-left a,.post-type-mec-events .mec-create-shortcode-tabs-left a{font-size:14px;padding:14px 10px 14px 15px;line-height:1.2;letter-spacing:0}.mec-add-booking-tabs-right,.mec-add-event-tabs-right,.mec-create-shortcode-tabs-right{padding-left:10px;padding-right:10px}#mec_tickets .mec-box{max-width:290px}}@keyframes fadeEffect2{from{opacity:0;transform:translateX(11px)}to{opacity:1;transform:translateX(0)}}.mec-form-row .mec-col-8 label,.mec-form-row .mec-col-9 label{padding-right:20px}@media (min-width:860px) and (max-width:1280px){.mec-form-row .mec-col-9 label{padding-right:12px}}#mec-event-data .mec-form-row label{margin-right:14px}.mec-form-row input[type=date]::-webkit-calendar-picker-indicator{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjA0QjQ2N0QwQjQ4MzExRUE4RDdFREZDRTUxMUVERTM5IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjA0QjQ2N0QxQjQ4MzExRUE4RDdFREZDRTUxMUVERTM5Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6MDRCNDY3Q0VCNDgzMTFFQThEN0VERkNFNTExRURFMzkiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6MDRCNDY3Q0ZCNDgzMTFFQThEN0VERkNFNTExRURFMzkiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz6WW71PAAAGIklEQVR42qRXS28bVRQ+586Mx3ZC1DSpVFojRU2CqMIGiSKxAVoUduzoDjYIlhU/Av4AYsdjRXfkD0Cjom6QqIqEqEhRo1aRkkZpkpY6j7GduQ++c2dsj1+BlInGztxvzj3nfudpPlM/otc2W2QjJmU0rZ0uUytUpBxNnN9p/FYhctF0+XUi2nPGkX7WJOfwxNRzqXxtbfI4eUvm7xY1o4iiI0d/vFiisL2BgTAz0yvbCRnLhP0uNEtqrgUseZRcwPPvJewaldSA8o48vo+Tj0U+CnrkOgZwvkEzEmGm1PF9fzK5Y3U/YlllsjRUv19zXl7571HyAjooc/kmYerpcmPO0Mfa0SyxEtji44ynOjPuayjecd7M46/MQOdGyIs9ThnzMLD0XRrwIdeetmoLm41fWiG95Ar792tydLLrOPkAlpW027hbG3+T37lf/5EtvYcXUuhfBjWp9wHRBO63c5lbEkQj2B92uaHy4l2EAQ66GFgbmiD4id/9q661ooAtf8rsvmUEilAHEqcgtJvvNq3YPTkJA8PksT9ZFxD8+4my9pvAOqOMxIMoJHfPZoJkJNiYat3duOac6hxt1N3GR8lnt0O623s+c2CVZEGaZ8Oks1mElvxu7hGYaQjpHLpH3q/YFQE7Oh5Y6gFTaHhAXlasxmoWpZO5L9Ow4DTv+UBZBAkWNO+CqhkbSOzaXWWyzY+n3WcACdVscnklz5CHYsmv1L/RyUJ/cs7zdT3Ey8pTgw/QgNNuS4XjNMvffwvBNmwDH+pdeZ3J+1qDdW15vS0iBhjZWzF9ge8HWl7zNLluYhP/9/jvFANXyL+ufF4jZvOCZsK8isp77+sixf10n7QQjJT39bBtjzdA5chtLG61n7kgk6UvDy29z4HL4c/ifkN0hYV+cA3Bc7stKAfossgSSF06+3HOu8QovE8eThDlv4pu1TbUOpqySDNUKMSDQRIo6QgVRHbFcID1mCITUGgNKLI9uBbcCC59xUi+DsiHBq0XOLb3utqOUYV+LglH9XJASRAsRNqt4xHVj59Exqw3AlrYi0PaiwNqBKoX12Y9iQSP/GkD4xZC0yt/GPFCvZzhUBoMtmPftRwMEEtpupy2auzadLraXtlNoXLhKQYLbjrWRx0cXNf24wxPSmWw5aZPNXSNOi5ytXqZpjTwSqs3PsJi0I61LG29EFG9GtyaeqgvxU17TrAkDjbvnq/eKcTYrbcemi5eHoI/OLgUt7r4n+cqd04llmZ3mjBSDQ4kYtERLLz4OKGt0xGKA9+RgiSGSRV7+UlCVvka72lEvHRx04vLGW2f/PzTBk3VtddRrGlhMXVaIdME5sLJ3ZQOTPQBNqj58uzcxsXtZEkqmQ7IB9ihLeA2x6FQqyG4cRuvbh8uNZSigzBCALhBBtrjkwjjQItQ+kPXWY6eBuEi/lmOlC8kvTh38ZLH3QC+y+GiIl4OqbeZ9RggQZgcVIXe1ep48jPkz/oGw7x1yoytIq1o59AH1Wp1rNHBSXA9tip87zYyvFzpx8dXLVTvqySvhUMNsN6+1ERrrNQVQs57H4K6cR35GrapffICb16RpO7glOHrrQyvjHXxQHB0/j1ugV0LpcFwAzS4n6hiZoIvEp2znwcSigfGJhxpMmseLc0dvFjcvRuLvdEdNyl2+0DOALwE863TM/jnJqhfQa6v4AfJzUNOZ/aVlhqIUpoO4PuU4XFsqFrSM866m9hxBXSvWPx/wHpGqA96Vfa5AH9HnMjYNI96dbkwaVzcCw/nAK+xHzp4Hp89eD04nENzX6v4cYrnrVWXXQF/Fh7MQfWasmogCNsmaT+qwD0g4gYsuYqnWlboeKMUumUr86LycxdwdRUb+zQTvAzcgL0jLXFkbkQUX5UKyFTE2bvZD0a5B8SAUu6dPf+7AInssja2VPSZRud2Ni/NKse5M2VQqkO4BxSzZLmV8Wwpa8S9OHsK3X6+Lc7F/JidOwvkc7z3FbIgzd7smy1c35TEg7NGrg6Ucs88UsCliOLHH1+Td8HYFl++W//QxfT9iSee/3lJWy5X6aMwtK3rTVWJUU4/g4GzdLLp73ku8cEDxNmXUZhc/0eAAQAVgX0RHvvILQAAAABJRU5ErkJggg==);background-position:center;background-size:cover;width:10px;height:12px;display:block}.mec-attendees-wrapper select,.mec-calendar-metabox .wn-mec-select,.mec-form-row input[type=date],.mec-form-row input[type=email],.mec-form-row input[type=number],.mec-form-row input[type=password],.mec-form-row input[type=tel],.mec-form-row input[type=text],.mec-form-row input[type=url],.mec-form-row select,.mec-form-row textarea,.mec-form-row.mec-skin-list-date-format-container input[type=text],.mec-occurrences-wrapper input[type=date],.mec-occurrences-wrapper input[type=email],.mec-occurrences-wrapper input[type=number],.mec-occurrences-wrapper input[type=tel],.mec-occurrences-wrapper input[type=text],.mec-occurrences-wrapper input[type=url],.mec-occurrences-wrapper select,.mec-occurrences-wrapper textarea{border:none;background-color:#f7f8f9;border-radius:5px;height:38px;line-height:38px;padding-left:10px;vertical-align:top;box-shadow:inset 0 1px 2px rgb(0 0 0 / 7%)}.mec-calendar-metabox .wn-mec-select,.mec-form-row select,.post-type-mec-events .mec-form-row select,.post-type-mec_calendars .mec-form-row select,.wns-be-main .mec-form-row select{appearance:none;-webkit-appearance:none;-moz-appearance:none;cursor:pointer;min-height:34px;line-height:34px;background-color:#f7f8f9;border-radius:5px;padding-right:24px;box-shadow:0 1px 3px rgb(0 0 0 / 2%);transition:all .23s ease;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0ZWQgYnkgSWNvTW9vbi5pbyAtLT4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHdpZHRoPSIxNyIgaGVpZ2h0PSIxNyIgdmlld0JveD0iMCAwIDE3IDE3Ij4KPGc+CjwvZz4KCTxwYXRoIGQ9Ik0xNi4zNTQgNS4wNzVsLTcuODU1IDcuODU0LTcuODUzLTcuODU0IDAuNzA3LTAuNzA3IDcuMTQ1IDcuMTQ2IDcuMTQ4LTcuMTQ3IDAuNzA4IDAuNzA4eiIgZmlsbD0iIzAwMDAwMCIgLz4KPC9zdmc+Cg==);background-repeat:no-repeat;background-size:26px 10px;background-position:right center;min-width:160px;border:1px solid #e6e9eb}.post-type-mec-events .mec-form-row .mec-time-picker select,.post-type-mec-events .wn-ticket-time select{min-width:60px}.wns-be-main .mec-col-4 select{min-width:unset}.mec-form-row .nice-select{background-image:unset}.mec-calendar-metabox .wn-mec-select.open .list{border-radius:0 0 2px 2px;box-shadow:0 0 0 1px #ddd,0 2px 6px rgba(0,0,0,.07)}.mec-calendar-metabox .mec-custom-nice-select.open ul.list{border-radius:5px;box-shadow:0 2px 6px rgb(0 0 0 / 3%);margin-left:0!important;transform:translateX(-50%);left:50%}.mec-custom-nice-select ul.list li.option.selected .wn-mec-text:after{border:6px solid #40d9f1;box-shadow:0 3px 16px -3px #40d9f1}.mec-form-row label+span.mec-tooltip{bottom:0}.mec-form-row textarea+span.mec-tooltip{bottom:auto;vertical-align:top;top:12px}.mec-form-row span+span.mec-tooltip{bottom:0;vertical-align:middle}.mec-form-row .tooltip-move-up span+span.mec-tooltip i{margin-top:-40px}.mec-form-row .mec-col-8 input[type=text],.mec-form-row .mec-col-8 select,.mec-form-row .mec-col-8 span.mec-archive-skins{vertical-align:top}.mec-form-row .mec-col-8 span.mec-archive-skins input[type=text]{max-width:225px}.mec-form-row input:disabled{opacity:.6;background:#f6f6f6}.wns-be-group-tab h5{font-size:16px;font-weight:600;color:#444;margin:0 0 40px 0}.mec-form-row textarea{height:auto;margin-bottom:0;min-height:60px}.mec-form-row .wp-picker-container input[type=text].wp-color-picker{height:25px;vertical-align:top;width:4rem;margin:-1px 0 0 0!important}.mec-form-row .wp-picker-container label{margin:0}.mec-image-select-wrap li span:hover{border-color:#fff;box-shadow:0 1px 8px rgba(0,0,0,.12)}.mec-message-categories li.mec-acc-label:after{content:"\e604";font-family:simple-line-icons;speak:none;font-style:normal;font-weight:400;display:block;font-size:13px;color:#999;position:absolute;right:27px;top:26px}.mec-message-categories>li.mec-acc-label[data-status=open]:after{content:"\e607";color:#07bbe9}.mec-message-categories>li.mec-acc-label[data-status=open]{color:#07bbe9}.mec-message-categories>li.mec-acc-label:last-of-type{border-bottom:none}.mec-message-categories>li.mec-acc-label[data-status=open]{border-bottom:1px solid #e6e6e6}.mec-form-row ul.mec-message-categories{border-radius:5px;overflow:hidden;margin-top:30px;background:#f5f5f5;border:2px solid #e6e6e6;max-width:700px}.mec-form-row ul.mec-message-categories li ul{padding:10px 40px 40px;margin:0 -30px 0;background:#fff;box-shadow:inset 0 6px 7px -2px rgb(0 0 0 / 4%);border-top:1px solid #eee;cursor:default}.mec-form-row ul.mec-message-categories ul label{margin:0;font-size:14px;color:#888;cursor:default}#mec_calendar_display_options .mec-tooltip{bottom:1px}#database_setup_button,#mec_add_fee_button,#mec_add_ticket_variation_button,#mec_meta_box_downloadable_file_options #mec_downloadable_file_remove_image_button,#taxes_option #mec_fees_list .mec-form-row .button,#ticket_variations_option #mec_ticket_variations_list .mec-form-row .button,.mec-export-settings,.mec-form-row .button:not(.wp-color-result),.mec-import-settings,.mec-meta-box-fields .mec-form-row .button:not(.wp-color-result),.mec-occurrences-wrapper .button:not(.wp-color-result){border-radius:25px;border:1px solid #d1e5ec;text-shadow:none;padding:0 12px;height:38px;letter-spacing:.2px;margin-right:5px;background:#fff;color:#07bbe9;box-shadow:0 1px 5px -1px rgb(0 0 0 / 5%);transition:all .2s ease;cursor:pointer;display:inline-block;line-height:36px;text-decoration:none}#mec_add_fee_button:hover,#mec_add_ticket_variation_button:hover,#mec_meta_box_downloadable_file_options #mec_downloadable_file_remove_image_button:hover,.button:not(.wp-color-result):hover .mec-export-settings:hover,.mec-import-settings:hover,.mec-meta-box-fields .mec-form-row .button:not(.wp-color-result):hover,.mec-occurrences-wrapper .button:not(.wp-color-result):hover{background:#f0f9fc;color:#07bbe9}#taxes_option #mec_fees_list .mec-form-row .button,#ticket_variations_option #mec_ticket_variations_list .mec-form-row .button{margin:0}#mec-hourly-schedule .mec-form-row .mec-col-1 .button,#mec-hourly-schedule .mec-form-row.mec-box .button,#mec_faq_list .mec-faq-actions .mec-faq-remove,#taxes_option #mec_fees_list .mec-form-row .button,#ticket_variations_option #mec_ticket_variations_list .mec-form-row .button,.mec-dash-remove-btn{color:#ea6485!important;border-color:#ea6485!important}#mec-hourly-schedule .mec-form-row .mec-col-1 .button:hover,#mec-hourly-schedule .mec-form-row.mec-box .button:hover,#mec_faq_list .mec-faq-actions .mec-faq-remove:hover,#taxes_option #mec_fees_list .mec-form-row .button:hover,#ticket_variations_option #mec_ticket_variations_list .mec-form-row .button:hover,.mec-dash-remove-btn:hover{background:rgb(234 100 133 / .1)!important}#mec-hourly-schedule .mec-hourly-schedule-form-speakers{margin-top:20px}#mec_meta_box_downloadable_file_options #mec_downloadable_file_remove_image_button,#mec_meta_box_downloadable_file_options #mec_public_download_module_file_remove_image_button{margin-top:12px}#mec_meta_box_downloadable_file_options input[type=file]{max-width:166px;text-align:center;transition:all .2s ease;border-radius:5px!important;border:2px dashed #b8e9f3;margin-bottom:12px;height:44px;text-decoration:none;padding:0 15px 1px;text-transform:none;letter-spacing:0;font-weight:600;color:#40d9f1;box-shadow:0 2px 6px -3px #cfeff5;display:block}#mec_meta_box_downloadable_file_options input[type=file]:hover{box-shadow:0 2px 16px -3px #cfeff5}#mec_meta_box_downloadable_file_options input[type=file]::-webkit-file-upload-button{visibility:hidden;width:1px;height:38px}#mec_meta_box_downloadable_file_options input[type=file]::-moz-file-upload-button{visibility:hidden;width:1px;height:38px}.mec-attendees-wrapper .mec-attendees-list{margin:22px 0 0}.mec-attendees-wrapper .mec-attendees-list .w-clearfix:first-child{background:#fff;border-bottom:1px solid #cfeff5}.mec-attendees-wrapper .mec-attendees-list .w-clearfix:first-child div span{line-height:1;font-weight:600}.mec-attendees-wrapper .mec-attendees-list .w-clearfix{display:flex;background:#f8feff;padding:10px;text-align:left}.mec-attendees-wrapper .mec-attendees-list .w-clearfix .w-col-xs-3:first-child{width:100%;max-width:30%;padding:0}.mec-attendees-wrapper .mec-attendees-list .w-clearfix .w-col-xs-3 a{text-decoration:unset}.mec-attendees-wrapper .mec-attendees-list .w-clearfix:nth-child(odd){background:#fff}#mec-read-more .mec-form-row span.mec-tooltip{top:2px;left:-4px}#mec-occurrences .mec-occurrences-list{margin-top:12px}#mec-occurrences .mec-occurrences-list h3{margin:0 0 30px 0}#mec-occurrences .mec-occurrences-list .mec-form-row{margin-bottom:0}#mec-occurrences .mec-occurrences-list .mec-form-row label{display:inline-block;margin:0;width:141px}#mec-occurrences .mec-occurrences-list .mec-form-row label.label-checkbox,#mec-occurrences .mec-occurrences-list .mec-form-row label.label-radio{display:block;width:100%}#mec-occurrences .mec-occurrences-list .mec-form-row .event-status-schema label{width:auto;min-width:160px}#mec-occurrences .mec-occurrences-list .mec-form-row .event-status-schema p{border:unset;padding-left:0;margin-left:0}#mec-search-settings{border-radius:21px;min-height:32px;box-shadow:inset 0 1px 2px rgba(0,0,0,.06);margin-right:10px;color:#7c838a;font-size:13px;width:260px;background:#f7f8f9;border:none;z-index:1;transition:all .18s ease;outline:0;line-height:36px;padding:2px 10px 1px 38px}#mec-search-settings:focus{background:#fff;box-shadow:0 1px 6px rgba(0,0,0,.07),0 0 0 1px #e6e6e6;width:270px}.mec-search-settings-wrap{display:inline-block;position:relative}.mec-search-settings-wrap i{position:absolute;left:16px;top:13px;font-size:13px;color:#7e8c98;display:block;z-index:2}#mec-search-settings::-webkit-input-placeholder{color:#7c838a}#mec-search-settings::-moz-placeholder{color:#7c838a}#mec-search-settings:-ms-input-placeholder{color:#7c838a}#mec-search-settings:-moz-placeholder{color:#7c838a}#wns-be-content .noresults label,#wns-be-content .results .results .noresults label{color:#000}#wns-be-content .results .results .results label,#wns-be-content .results label,#wns-be-content ul li.enable,#wns-be-content ul li.enable label{color:#07bbe9}#wns-be-content ul li.disable,#wns-be-content ul li.disable label{color:#e7e7e7}.ui-datepicker.ui-widget{border:1px solid #e8e8e8;box-shadow:0 1px 9px rgba(0,0,0,.12)}.ui-datepicker.ui-widget select{font-weight:600;font-size:12px;border-radius:2px;padding:2px 10px;margin:1px 3px 5px}.ui-datepicker.ui-widget table{border-spacing:2px}.ui-datepicker.ui-widget td,.ui-datepicker.ui-widget tr{padding:0;background:0 0!important}.ui-datepicker.ui-widget td a{color:#777;font-weight:600;width:30px;height:30px;line-height:30px;display:inline-block;border-radius:33px;padding:0;background:#fff;transition:all .2s ease}.ui-datepicker.ui-widget td a.ui-state-active,.ui-datepicker.ui-widget td a:hover{background:#40d9f1;color:#fff}.ui-datepicker.ui-widget .ui-datepicker-next,.ui-datepicker.ui-widget .ui-datepicker-prev{color:#40d9f1;width:30px;height:30px;line-height:30px;display:inline-block;text-align:center;border-radius:33px;background:#ecfcff;transition:all .2s ease}.ui-datepicker.ui-widget .ui-datepicker-next:hover,.ui-datepicker.ui-widget .ui-datepicker-prev:hover{background:#fff;box-shadow:0 0 7px -3px rgba(0,0,0,.4)}#mec-wrap{width:92%;margin:20px auto;max-width:1200px}#mec-wrap .nav-tab-wrapper{margin-bottom:0;position:relative;z-index:8;padding:0;border-radius:10px;border:none;margin-top:35px;clear:both;background:#fff;border:1px solid #e3e5e7}#mec-wrap .nav-tab-wrapper .nav-tab{position:relative;padding:28px 17px;border:none;background:0 0;margin:0;font-size:13px;color:#444;outline:0;letter-spacing:-.1px;box-shadow:none;transition:all .2s ease}#mec-wrap .nav-tab-wrapper .nav-tab:hover{color:#07bbe9}#mec-wrap .nav-tab-wrapper .nav-tab:after{content:"";display:inline-block;width:1px;height:30%;position:absolute;right:0;top:35%;background:#e9e9e9}#mec-wrap .nav-tab-wrapper .nav-tab-active,#mec-wrap .nav-tab-wrapper .nav-tab-active:focus,#mec-wrap .nav-tab-wrapper .nav-tab-active:focus:active,#mec-wrap .nav-tab-wrapper .nav-tab-active:hover{background:#ecf9fd;outline:0;z-index:2;border:1px solid #ccecf4;color:#07bbe9;border-radius:5px;margin:-1px}#mec-wrap .nav-tab-wrapper .nav-tab-active:after{content:"";position:absolute;display:block;background:0 0;top:auto;height:auto;bottom:-20px;left:50%;margin-left:-10px;width:0;border-width:10px;border-style:solid;border-color:#ecf9fd transparent transparent}#mec-wrap .mec-container{padding:25px 40px 40px}#mec-wrap .mec-container.booking-report-container,.m-e-calendar_page_MEC-ix #mec-wrap .mec-container{border:1px solid #e3e5e7;border-top:none;border-radius:0 0 10px 10px;margin:-2px 6px 0 6px}#wpwrap .mec-button-primary{box-shadow:0 0 0 4px #e4ffe6;text-shadow:none;margin-right:5px;background:#64e385;color:#fff;border:none;cursor:pointer;padding:2px 22px;border-radius:22px;font-weight:500;line-height:39px}#wpwrap .mec-button-primary:hover{box-shadow:0 0 0 4px rgb(0 0 0 / 10%);background:#4d5051;border-color:#4d5051;cursor:pointer}#mec-wrap .nav-tab-wrapper .nav-tab-active:before{content:"";position:absolute;display:block;background:0 0;top:auto;height:auto;bottom:-24px;left:50%;margin-left:-12px;width:0;border-width:12px;border-style:solid;border-color:#ccecf4 transparent transparent}.ui-datepicker.ui-widget select{border-color:#e7e8e9}.wn-p-t-right{min-width:300px;max-width:400px;display:inline-block;top:-8px;left:50%;margin-top:0;transform:translate(-50%,-100%);padding:0;background-color:#535a61;color:#fff;font-weight:300;font-size:14px;letter-spacing:.5px;line-height:1.5;position:absolute;z-index:99999999;box-sizing:border-box;border-radius:6px;box-shadow:0 4px 45px -8px #444b50;visibility:hidden;opacity:0;transition:opacity .23s;padding:20px;border-radius:8px}.wn-p-t-right i{position:absolute!important;top:100%;right:50%;margin-top:-6px!important;margin-right:-6px!important;width:12px;height:24px;overflow:hidden;transform:rotate(-90deg)}.wn-p-t-right i:after{content:"";position:absolute;width:12px;height:12px;left:0;top:50%;transform:translate(50%,-50%) rotate(-45deg);background-color:#535a61;box-shadow:0 8px 9px -4px #535a61}.wn-p-t-right .wn-p-t-text-content h5{color:#fff;font-size:17px;font-weight:600;margin:-20px;padding:15px 0;text-align:center;margin-bottom:10px;background:#3a3f44;border-bottom:1px solid #32363a;border-radius:6px 6px 0 0}.mec-addon-box-footer a:hover .wn-p-t-right{visibility:visible;opacity:1}#mec_organizer_user+.select2-container,#mec_speaker_user+.select2-container{min-width:224px!important}.mec-add-event-tabs-wrap .select2-container,.mec-create-shortcode-tab-content .select2-container,.wns-be-main .mec-form-row .select2-container{min-height:38px;height:auto;box-sizing:border-box;padding:0 6px 0 10px;border-radius:5px;box-shadow:inset 0 1px 2px rgb(0 0 0 / 7%);background-color:#f7f8f9;color:#32373c;outline:0;transition:50ms border-color ease-in-out;min-width:200px;width:100%!important;max-width:290px!important;font-size:14px}.mec-add-event-tabs-wrap .select2-selection,.mec-create-shortcode-tab-content .select2-selection,.wns-be-main .mec-form-row .select2-selection{border:none;background:0 0;padding-top:3px;width:100%;height:100%}.mec-add-event-tabs-wrap .select2-container--default.select2-container--focus .select2-selection,.mec-create-shortcode-tab-content .select2-container--default.select2-container--focus .select2-selection,.wns-be-main .mec-form-row .select2-container--default.select2-container--focus .select2-selection{border:none!important;outline:0}.mec-add-event-tabs-wrap .select2-container--default .select2-selection--single .select2-selection__arrow,.mec-create-shortcode-tab-content .select2-container--default .select2-selection--single .select2-selection__arrow,.wns-be-main .mec-form-row .select2-container--default .select2-selection--single .select2-selection__arrow{top:5px;right:4px}.fs-webform-container div .fserv-container{width:100%!important;max-width:none!important;min-height:238px!important;box-shadow:0 1px 6px rgb(0 0 0 / 1%)!important;border-radius:15px!important;padding:15px 0 0!important;margin-bottom:0!important;margin-top:30px!important;background:url(https://webnus.net/modern-events-calendar/wp-content/uploads/2019/11/illustration.svg) no-repeat top right;background-size:330px;border:1px solid #e3e5e7}.fserv-container .fserv-form-name{font-weight:600!important;position:relative!important;font-size:20px!important;padding:30px 30px 10px!important;text-align:left!important;margin:0!important;line-height:1}.fserv-form-description{padding:10px 30px!important;margin:1em 0 0!important;line-height:1.5!important;font-size:16px!important}.fserv-container form{padding:0!important;padding-left:28px!important}.fserv-container .fserv-label{display:none!important}.fserv-field{display:inline-block;padding:0!important;min-width:260px;margin:0!important;margin-right:25px!important}.fserv-container label.fserv-form-description{cursor:default}.fserv-field input.fserv-input-text{border-radius:5px!important;border:none!important;background-color:#f7f8f9!important;box-shadow:inset 0 1px 2px rgb(0 0 0 / 7%)!important}.fserv-field+div:not(.fserv-field){margin:0!important;border:none!important;text-align:left!important;padding-left:4px!important;margin-top:0!important;padding-top:0!important;display:inline-block;margin-right:10px!important}.fserv-container .powered-by{display:none!important}@media (max-width:1366px){#webnus-dashboard .fserv-container form{padding:0!important;padding:0 28px 40px 28px!important}#webnus-dashboard .fserv-form .fserv-field{width:33%!important}#webnus-dashboard .fserv-form .fserv-button-submit{margin-left:-2px!important}}@media (max-width:960px){#webnus-dashboard .fserv-container form{padding:0!important;padding:0 28px 40px 28px!important}#webnus-dashboard .fserv-form .fserv-field{width:100%!important}#webnus-dashboard .fserv-form .fserv-button-submit{margin-left:-2px!important}}#webnus-dashboard .mec-intro-section .mec-intro-section-link-tag{font-weight:500;border-radius:60px;text-shadow:none;box-shadow:0 0 0 3px rgb(227 249 253 / 15%);background:#fff;background:linear-gradient(95deg,#fff 0,#fff 50%,#fff 100%)!important;border:1px solid #c0e5ea;transition:.24s}#webnus-dashboard .mec-intro-section .mec-intro-section-link-tag.button-primary,#webnus-dashboard .total-bookings button,button.fserv-button-submit{color:#fff!important;font-weight:500!important;border-radius:60px!important;box-shadow:0 0 0 4px rgb(56 213 237 / 1%)!important;text-shadow:none!important;background:#38d5ed!important;border:none!important;transition:.24s!important}#webnus-dashboard button.fserv-button-submit{background:#64e385!important;box-shadow:0 0 0 3px #64e3851a!important}#webnus-dashboard button.fserv-button-submit:hover{background:#46d26a!important;box-shadow:0 0 0 4px #64e38536!important}#webnus-dashboard .total-bookings button{line-height:39px;padding:0 36px}#webnus-dashboard .mec-intro-section .mec-intro-section-link-tag.button-primary:hover{color:#fff!important;background:#1fcae4!important;box-shadow:0 0 0 4px rgb(56 213 237 / 15%)!important}#webnus-dashboard .total-bookings button:hover,button.fserv-button-submit:hover{background:#26bbd2!important;box-shadow:0 0 0 4px rgb(56 213 237 / 15%)!important;cursor:pointer!important}#webnus-dashboard .mec-intro-section .mec-intro-section-link-tag:hover{box-shadow:0 0 0 4px rgb(56 213 237 / 8%)!important;color:#02a3bb!important;cursor:pointer!important}.fserv-container input::-webkit-input-placeholder{font-family:inherit!important;font-size:14px}.fserv-container input::-moz-placeholder{font-family:inherit!important;font-size:14px}.fserv-container input:-ms-input-placeholder{font-family:inherit!important;font-size:14px}.fserv-container input:-moz-placeholder{font-family:inherit!important;font-size:14px}input.fserv-input-text{height:38px;box-sizing:border-box;margin-bottom:8px;padding:0 6px;box-shadow:none;border-radius:2px;box-shadow:inset 0 1px 5px rgba(0,0,0,.05)}.fserv-field label.error{display:none!important}.fs-notifier{position:fixed!important;top:40px!important;width:300px!important;max-width:300px!important;margin:0!important;right:20px!important;left:unset!important}.post-type-mec-events .lity{background:#edf0f3}.post-type-mec-events .lity-container{width:60vw;max-width:883px;margin:0 auto;border-radius:7px}.post-type-mec-events .lity-content:after{display:none}.mec-manage-events-lightbox{box-shadow:0 3px 20px rgba(0,0,0,.05)}.w-clearfix.mec-attendees-content img{display:inline-block;width:25px;height:25px;vertical-align:middle;margin-right:7px}.post-type-mec-events .mec-attendees-list-head{background:#008aff;color:#fff;text-align:center;padding:17px 0;text-transform:capitalize;font-size:26px;font-weight:700;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif!important;border-radius:7px 7px 0 0;line-height:43px;box-shadow:0 3px 15px rgba(0,138,255,.25);z-index:99}.mec-attendees-list-wrap{display:flex;width:100%;flex-direction:column;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif!important;background:#fff;box-shadow:0 3px 20px rgba(0,0,0,.05);border-radius:0 0 5px 5px;overflow:hidden}.mec-attendees-list-left{flex:1;background:#f6f8fa;padding:0;border-radius:0;position:relative}.mec-attendees-list-right,.mec-send-email-form-wrap{flex:1;border-radius:0 0 5px 5px;padding:0 20px 20px;background:#f2f4f7}.mec-attendees-list-left-menu a{display:inline-block;line-height:22px;font-size:12px;color:#000;font-weight:500;border-bottom:1px solid #eaebec;border-left:1px solid #eaebec;padding-bottom:0;padding:7px 6px;margin-bottom:0;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif!important;transition:all .2s ease;text-decoration:none;text-align:center}.mec-attendees-list-left-menu a.selected-day{color:#008aff}.mec-attendees-list-left-menu .owl-item:last-child a{border-right:1px solid #eaebec}.mec-attendees-list-right table{width:100%}.w-clearfix.mec-attendees-head{margin-top:30px;border-bottom:2px solid #ccecf4;padding-bottom:18px;margin-bottom:3px}.w-clearfix.mec-attendees-content [class^=w-col-xs-],.w-clearfix.mec-attendees-head [class^=w-col-xs-]{padding:0}.w-clearfix.mec-attendees-head span{font-weight:600;color:#000;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif!important;font-size:17px}.w-clearfix.mec-attendees-content{background:#fff;margin-bottom:2px;padding:10px 20px}.mec-attendees-list-left-menu{height:36px;margin-left:35px;margin-right:36px}.mec-attendees-list-left-menu a:active,.mec-attendees-list-left-menu a:focus,.mec-attendees-list-left-menu a:visited{outline:0;box-shadow:none}.mec-attendees-list-left-menu .owl-item{display:inline-block}.mec-attendees-list-left-menu .owl-stage{min-width:800px!important}.owl-nav.disabled .owl-next{position:absolute;right:0;top:0}.owl-nav.disabled .owl-prev{position:absolute;left:0;top:0}.owl-nav.disabled button{background:#fff;box-shadow:none;border:1px solid #ccc;height:36px;width:36px;font-size:54px;line-height:54px}.owl-nav.disabled button span{margin-top:-18px;display:block}.mec-cover-loader:after{content:"";position:absolute;top:0;right:0;left:0;bottom:0;background:rgba(255,255,255,.5);z-index:99999}.mec-loader{background:rgba(0,0,0,0);position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);z-index:9}.mec-loader,.mec-loader:after{border-radius:50%;width:5em;height:5em;z-index:999999999999}.mec-loader{font-size:10px;text-indent:-9999em;border-top:.5em solid rgba(0,0,0,.2);border-right:.5em solid rgba(0,0,0,.2);border-bottom:.5em solid rgba(0,0,0,.2);border-left:.5em solid #fff;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0);-webkit-animation:mecloader 1.1s infinite linear;animation:mecloader 1.1s infinite linear}@media (max-width:992px){.post-type-mec-events .lity-container{width:80vw}}@-webkit-keyframes mecloader{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes mecloader{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.mec-report-backtoselect-wrap,.mec-report-sendmail-form-wrap{display:none}.mec-report-select-event-wrap .select2,.mec-select-wrap .select2{width:100%!important}.mec-report-select-event-wrap .select2-container--default .select2-selection--single,.mec-select-wrap .select2-container--default .select2-selection--single{border-radius:4px;border:1px solid #e2e3e4;height:40px;padding-top:5px;padding-left:8px;width:100%;box-shadow:none}.mec-report-select-event-wrap .select2-container--default .select2-selection--single .select2-selection__arrow,.mec-select-wrap .select2-container--default .select2-selection--single .select2-selection__arrow{height:36px}.mec-report-select-event-wrap .select2-container--open .select2-dropdown--below,.mec-select-wrap .select2-container--open .select2-dropdown--below{box-shadow:0 2px 8px rgba(0,0,0,.12);border-color:#d7d8d9}.select2-container--default .select2-search--dropdown{padding:12px}.select2-container--default .select2-search--dropdown .select2-search__field{box-shadow:0 2px 8px rgba(0,0,0,.02) inset;border-color:#e3e5e7;border-radius:4px}.mec-report-select-event-wrap input,.mec-report-select-event-wrap select,.mec-select-wrap input[type=text],.mec-select-wrap select .mec-report-select-event-wrap input[type=text]{border:1px solid #e2e3e4;height:40px;font-size:13px;font-weight:400;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif!important;margin-bottom:15px;border-radius:4px;box-shadow:none;max-width:150px}#certificate_select{border:1px solid #e2e3e4;height:34px;font-size:13px;font-weight:400;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif!important;margin-bottom:15px;border-radius:4px;box-shadow:none;max-width:300px;min-width:200px;margin:0!important;vertical-align:bottom}.mec-report-select-event-wrap .select2-container--default,.mec-select-wrap .select2-container--default{max-width:400px}.select2-dropdown.select2-dropdown{border-color:#e3e5e7!important;box-shadow:none!important}.mec-report-select-event-wrap select.mec-reports-selectbox-dates,.mec-select-wrap select.mec-reports-selectbox-dates{min-width:260px;margin:0 0 0 10px;padding-left:15px}.mec-report-sendmail-form-wrap,.mec-report-sendmail-wrap{padding:30px 15px;background:#fff;border:1px solid #e2e3e4;margin:15px 0 5px;border-radius:10px;box-shadow:0 1px 4px rgba(0,0,0,.01)}.mec-report-sendmail-wrap .w-col-sm-12:before{background:url(../img/email-document.png) no-repeat left top;content:"";display:block;width:90px;height:70px;z-index:100;float:left}.mec-report-sendmail-wrap p{margin:0 0 15px;font-size:15px;color:#7d8284}.mec-report-backtoselect-wrap button,.mec-report-sendmail-wrap .w-col-sm-12 button,.mec-send-email-form-wrap .mec-send-email-button{background:#19cde9;border:none;color:#fff;font-size:13px!important;padding:8px 18px;border-radius:4px;cursor:pointer;box-shadow:0 1px 2px rgba(25,205,233,.05);transition:all .2s ease}.mec-report-backtoselect-wrap button:hover,.mec-report-sendmail-wrap .w-col-sm-12 button:hover,.mec-send-email-form-wrap .mec-send-email-button:hover{background:#04bfdc;box-shadow:0 1px 2px rgba(25,205,233,.05)}.mec-report-backtoselect-wrap button{margin-top:15px}.mec-report-selected-event-attendees-wrap{background-color:#fff;border:1px solid #e1e2e3;padding:0;margin:20px 0;border-radius:7px;display:none}.mec-report-selected-event-attendees-wrap .w-col-sm-12{width:calc(100% - 30px)}.mec-report-sendmail-wrap{display:none}#mec_report_mass_action_form .mec-form-row{padding:0}.mec-report-selected-event-attendees-wrap .w-clearfix.mec-attendees-head{background:#f5f6f7;border-bottom:1px solid #e1e2e3;padding:15px;margin:0;border-radius:5px 5px 0 0}.mec-report-selected-event-attendees-wrap .w-clearfix.mec-attendees-content{margin:0;padding:8px 15px;border-bottom:1px solid #e4eef0;font-size:13px;line-height:25px}.mec-report-selected-event-attendees-wrap .w-clearfix.mec-attendees-content:hover{background:#f3fdfe}.mec-report-selected-event-attendees-wrap .w-clearfix.mec-attendees-content:last-child{border-bottom:none;border-radius:0 0 6px 6px}.mec-report-selected-event-attendees-wrap .w-clearfix.mec-attendees-content img{border-radius:25px;margin-left:8px}.mec-report-selected-event-attendees-wrap input[type=checkbox]{border-radius:3px;margin-top:0}.mec-report-selected-event-attendees-wrap .mec-attendees-head .w-col-xs-2.name{padding-left:10px}.mec-report-selected-event-attendees-wrap .checkin_status span{font-weight:600}.mec-report-selected-event-attendees-wrap .w-col-sm-12>p{text-align:center}.mec-attendees-list-right,.mec-send-email-form-wrap{flex:1;border-radius:0;padding:0;background:0 0;max-width:674px;margin:0 auto}.mec-report-sendmail-form-wrap{padding:0 30px 45px}.mec-send-email-form-wrap h2{background:url(../img/email-document.png) no-repeat center top;padding-top:70px;font-size:22px;font-weight:600;text-align:center;padding-bottom:10px;padding-left:10px;margin-bottom:0}#webnus-dashboard .mec-send-email-form-wrap .wp-editor-tools button{font-size:13px;font-weight:400;color:#444;line-height:1;margin-bottom:0}#webnus-dashboard .mec-send-email-form-wrap .wp-editor-tabs button{min-height:30px}.mec-send-email-form-wrap input.widefat{min-height:40px;border:1px solid #e2e3e4;border-radius:2px;box-shadow:0 1px 4px rgba(0,0,0,.02)}.mec-send-email-form-wrap input.widefat:focus{border:1px solid #96e3ef}.mec-send-email-form-wrap h4.mec-send-email-count{font-weight:400;text-align:center;margin-bottom:30px;margin-top:0;padding-top:0}.mec-send-email-form-wrap .mec-send-email-button{min-height:40px;line-height:40px;padding:0;font-size:17px!important;font-weight:600}.mec-send-email-form-wrap .mce-menubtn.mce-fixed-width span{height:20px;padding-top:2px}.lity.mec-add-shortcode-popup{background-color:#b7e4e3}.lity.mec-add-shortcode-popup .lity-content{box-shadow:0 3px 20px 0 rgba(91,188,190,.55);border-radius:10px;height:100%}.mec-add-shortcode-popup .lity-container{width:930px;height:620px}.mec-add-shortcode-popup .lity-content:after{display:none}.mec-add-shortcode-popup div#mec_popup_shortcode{background:#fff;overflow:hidden;display:flex;width:100%;border-radius:10px;height:100%}.mec-steps-container{width:92px;text-align:center;background:#fff}.mec-steps-panel{width:calc(100% - 92px);background:#eef4f5}.mec-steps-container ul{text-align:center;display:block;margin-top:62px}.mec-steps-container ul li{width:22px;height:70px;margin:0 auto;position:relative}.mec-steps-container ul li span{border-radius:50px;background-color:rgba(26,175,251,.16);width:22px;height:22px;display:inline-block;padding-top:2px;font-size:11px;font-weight:700;color:#1aaffb;box-sizing:border-box}.mec-steps-container ul li:after,.mec-steps-container ul li:before{content:"";display:block;height:24px;width:2px;background:rgba(26,175,251,.16);margin-left:calc(50% - 1px)}.mec-steps-panel .mec-form-row input[type=checkbox],.mec-steps-panel .mec-form-row input[type=radio]{background:#fff}.mec-box .mec-steps-panel .mec-form-row input[type=radio],.mec-steps-panel .mec-form-row .mec-box input[type=checkbox]{background:#f7f8f9}.mec-steps-panel .mec-form-row .mec-box input[type=checkbox]:checked,.mec-steps-panel .mec-form-row .mec-box input[type=radio]:checked{background:#fff}.mec-steps-container ul li:first-of-type:before,.mec-steps-container ul li:last-of-type:after{display:none}.mec-steps-container ul li:first-of-type{height:46px}li.mec-step.mec-step-passed span,li.mec-step.mec-step-passed:after,li.mec-step.mec-step-passed:before{background-color:#2dcb73;color:#fff}.mec-steps-container img{margin-top:30px}.mec-steps-header{display:flex;background:#fff;border-radius:5px;box-shadow:0 3px 22px 0 rgb(11 121 125 / 1%);padding:12px 22px;margin:-15px -15px 65px}.mec-steps-header-settings{width:65px}.mec-steps-header-dashboard{width:fit-content;margin-right:22px}.mec-steps-header-userinfo{width:calc(100% - 65px)}.mec-steps-panel{padding:35px;position:relative;display:flex;flex-direction:column;justify-content:space-between}.mec-steps-header-userinfo span{display:inline-block;vertical-align:middle}.mec-steps-header-userinfo span img{height:40px;border-radius:50px;margin-right:8px;vertical-align:middle}.mec-steps-header-userinfo span.mec-steps-header-name{font-size:14px;color:#778182;font-weight:600;text-transform:capitalize}span.mec-steps-header-add-text{color:#839294;font-size:12px;margin-left:5px}.mec-steps-header-dashboard a,.mec-steps-header-settings a{height:100%;display:block;padding-top:11px;text-decoration:none;font-size:12px;color:#707070}.mec-steps-header-dashboard a i,.mec-steps-header-settings a i{color:#1aaffb;font-size:16px;vertical-align:text-top;margin-right:5px}.mec-next-previous-buttons{clear:both}.mec-next-previous-buttons button.mec-button-next{float:right;background:#008aff;border:none;color:#fff;cursor:pointer;width:123px;text-align:left;padding:8px 18px 9px;border-radius:3px;font-size:14px;box-shadow:0 5px 10px 0 rgba(0,138,255,.3);transition:all .3s ease;outline:0}.mec-next-previous-buttons button:hover{background:#000;box-shadow:0 5px 10px 0 rgba(0,0,0,.3)}.mec-next-previous-buttons button.mec-button-next img{position:absolute;top:16px;right:18px}.mec-next-previous-buttons button{position:relative}.mec-next-previous-buttons button.mec-button-prev{background:#fff;border:none;color:#000;cursor:pointer;width:123px;text-align:right;padding:8px 15px 9px;border-radius:3px;font-size:14px;box-shadow:0 5px 10px 0 rgba(11,121,125,.01);transition:all .3s ease;outline:0}.mec-next-previous-buttons button.mec-button-prev img{position:absolute;top:16px;left:18px}.mec-next-previous-buttons button.mec-button-prev:hover{background:#000;box-shadow:0 5px 10px 0 rgba(0,0,0,.3);color:#fff}.mec-next-previous-buttons button.mec-button-new{background:#008aff;float:right;border:none;color:#fff;cursor:pointer;width:154px;text-align:left;padding:8px 18px 9px;border-radius:3px;font-size:14px;box-shadow:0 5px 10px 0 rgba(0,138,255,.3);transition:all .3s ease;outline:0}.mec-next-previous-buttons button.mec-button-new:hover{background:#000;box-shadow:0 5px 10px 0 rgba(0,0,0,.3)}.mec-next-previous-buttons button.mec-button-new img{vertical-align:sub;margin-left:-3px;margin-right:8px}div#mec_popup_shortcode_form{height:calc(100% - 37px)}.mec-steps-content-container{display:flex;flex-direction:column;height:100%}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-1{background:url(../../assets/img/popup/first-step.png) no-repeat 90% 70%}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-1 .popup-sh-name-required{color:red;display:none;font-style:italic;font-size:12px;margin-top:8px}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-1 .mec-steps-content.mec-steps-content-1{top:50%;position:absolute;width:360px}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-1 .mec-steps-content.mec-steps-content-1 input[name="shortcode[name]"]{width:360px;height:46px;border:none;border-radius:3px;padding-left:36px;font-size:12px;color:#b1b2b4;box-shadow:0 3px 22px 0 rgba(11,121,125,.01)}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-1 .mec-steps-content.mec-steps-content-1 input[name="shortcode[name]"]::-webkit-input-placeholder{color:#b1b2b4}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-1 .mec-steps-content.mec-steps-content-1 input[name="shortcode[name]"]:-ms-input-placeholder{color:#b1b2b4}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-1 .mec-steps-content.mec-steps-content-1 input[name="shortcode[name]"]::placeholder{color:#b1b2b4}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-1 .mec-steps-content.mec-steps-content-1:before{content:"";width:14px;height:14px;background:url(../../assets/img/popup/add-sh-icon.png) no-repeat center center;position:absolute;top:17px;left:17px}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-2 .mec-steps-content.mec-steps-content-2 ul{height:386px;overflow-x:hidden;overflow-y:scroll;margin-top:-22px;margin-bottom:0;position:relative;padding:0 50px 150px 50px;background:#fcfbfd!important}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-2 .mec-steps-content.mec-steps-content-2 ul li{width:30%!important;float:left!important;min-height:135px!important;height:150px;margin:1.66%!important;box-sizing:border-box;text-align:center;padding:12px!important;border-radius:8px;border:1px solid transparent;box-shadow:none;background:#fff0!important;cursor:pointer;transition:all .22s ease;-webkit-transition:all .22s ease;-moz-transition:all .22s ease;-ms-transition:all .22s ease;-o-transition:all .22s ease}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-2 .mec-steps-content.mec-steps-content-2 ul li.active{border:1px solid #40d9f16b!important;box-shadow:0 1px 8px -3px #40d9f152 inset!important;color:#00cae6!important;padding:12px 0 0 0!important}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-2 .mec-steps-content.mec-steps-content-2 ul li:hover{box-shadow:0 1px 8px rgb(0 0 0 / 3%),0 0 0 1px #f3f4f5;background:#fff!important}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-2 .mec-steps-content.mec-steps-content-2 ul li:hover{background:#fcfbfd}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-2 .mec-step-popup-skin-img img{margin:4px 0 1px 1px;line-height:1;max-width:68px;max-height:56px;filter:grayscale(1);-webkit-filter:grayscale(1);transition:all .22s ease;-webkit-transition:all .22s ease;-moz-transition:all .22s ease;-ms-transition:all .22s ease;-o-transition:all .22s ease}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-2 li.active .mec-step-popup-skin-img img,.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-2 li:hover .mec-step-popup-skin-img img{filter:grayscale(0);-webkit-filter:grayscale(0)}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-2 .mec-step-popup-skin-text input{display:block;margin:0 auto;margin-top:6px;border:2px solid #e1e7ed;box-shadow:0 3px 6px 0 rgba(0,0,0,.05);position:relative}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-2 .mec-step-popup-skin-img{padding-top:16px}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-2 .mec-steps-content.mec-steps-content-2 ul li .mec-step-popup-skin-text input{display:none}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-2 .mec-step-popup-skin-text:before{width:14px;height:14px;content:"";border-radius:50px;background:#fff;display:block;position:absolute;left:calc(50% - 7px);top:24px;z-index:99;border:2px solid #e1e7ed;box-shadow:0 3px 6px 0 rgba(0,0,0,.05)}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-2 .mec-step-popup-skin-text{position:relative}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-2 li.active .mec-step-popup-skin-text:before{background:#008aff;border:none;box-shadow:0 5px 10px 0 rgba(0,138,255,.3);width:16px;height:16px}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-2 li.active .mec-step-popup-skin-text:after{width:4px;height:4px;display:block;content:"";position:absolute;background:#fff;left:calc(50% - 1px);top:30px;z-index:999;border-radius:50px}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-3 span.wn-hover-img-sh{display:block}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-3 .mec-skin-styles{height:386px;overflow-x:hidden;padding-left:60px;padding-bottom:19px}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-3 .mec-skin-styles label{width:193px!important;float:left!important;margin:1.66%!important;text-align:center}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-3 .mec-skin-styles label span{width:193px!important;float:left!important;min-height:135px!important;height:150px;box-sizing:border-box;border-radius:5px;border:2px solid #c4edff;background:#fff!important;cursor:pointer;margin-bottom:5px;margin-top:-6px}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-3 .mec-skin-styles label.active span{border-color:#00acf8;box-shadow:0 3px 5px rgba(0,172,248,.2)}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-3 .mec-skin-styles label div{font-size:14px}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-3 .mec-skin-styles label.active div{color:#008aff}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-3 .mec-skin-styles input{opacity:0;display:none}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-3 .mec-steps-content.mec-steps-content-3{margin-top:-18px}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-3 span.wn-hover-img-sh img{width:189px;height:146px;border-radius:5px}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4{background:url(../../assets/img/popup/fourth-step.png) no-repeat 90% 70%}.mec-add-shortcode-popup .mec-steps-content.mec-steps-content-4 .nice-select{border:none;box-shadow:0 3px 22px 0 rgba(11,121,125,.01)}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .mec-steps-content.mec-steps-content-4{top:40%;position:absolute;width:330px}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .mec-steps-content.mec-steps-content-4 h3{font-size:13px;font-weight:400;color:#707070}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .mec-steps-content.mec-steps-content-4 .mec-multiple-skin-options div{border:2px dashed #dce2e3;border-radius:3px;padding:20px 20px 6px;background:#fcfcfc}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .mec-steps-content.mec-steps-content-4 .mec-multiple-skin-options div label{display:block;margin-bottom:14px}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .mec-steps-content.mec-steps-content-4 .mec-multiple-skin-options div label.active input{background:#fff;box-shadow:none;border:1px solid #cacece}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .wn-mec-select-popup{box-shadow:0 3px 13px -5px rgba(0,0,0,.1),inset 0 1px 2px rgba(0,0,0,.07);clear:unset!important;-webkit-tap-highlight-color:transparent;background-color:#fff;border-radius:5px;border:solid 1px #e8e8e8;box-sizing:border-box;clear:both;cursor:pointer;display:block;float:left;font-family:inherit;font-size:14px;font-weight:400;height:42px;line-height:40px;outline:0;padding-left:18px;padding-right:30px;position:relative;text-align:left!important;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;width:300px!important}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .wn-mec-select-popup:hover{border-color:#dbdbdb}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .wn-mec-select-popup.open .list{overflow:unset;width:100%;margin:0}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .wn-mec-select-popup .list{background-color:#fff;border-radius:5px;box-shadow:0 0 0 1px rgba(68,68,68,.11);box-sizing:border-box;margin-top:4px;opacity:0;overflow:hidden;padding:0;pointer-events:none;position:absolute;top:100%;left:0;-webkit-transform-origin:50% 0;-ms-transform-origin:50% 0;transform-origin:50% 0;-webkit-transform:scale(.75) translateY(-21px);-ms-transform:scale(.75) translateY(-21px);transform:scale(.75) translateY(-21px);-webkit-transition:all .2s cubic-bezier(.5, 0, 0, 1.25),opacity .15s ease-out;transition:all .2s cubic-bezier(.5, 0, 0, 1.25),opacity .15s ease-out;z-index:9}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .wn-mec-select-popup:after{border-bottom:2px solid #999;border-right:2px solid #999;content:"";display:block;height:5px;margin-top:-4px;pointer-events:none;position:absolute;right:12px;top:50%;-webkit-transform-origin:66% 66%;-ms-transform-origin:66% 66%;transform-origin:66% 66%;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);-webkit-transition:all .15s ease-in-out;transition:all .15s ease-in-out;width:5px}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .wn-mec-select-popup.open:after{-webkit-transform:rotate(-135deg);-ms-transform:rotate(-135deg);transform:rotate(-135deg)}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .wn-mec-select-popup.open .list{opacity:1;pointer-events:auto;-webkit-transform:scale(1) translateY(0);-ms-transform:scale(1) translateY(0);transform:scale(1) translateY(0)}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .wn-mec-select-popup.disabled{border-color:#ededed;color:#999;pointer-events:none}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .wn-mec-select-popup.disabled:after{border-color:#ccc}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .wn-mec-select-popup .list:hover .option:not(:hover){background-color:transparent!important}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .wn-mec-select-popup .option{cursor:pointer;font-weight:400;list-style:none;min-height:40px;outline:0;text-align:left;position:relative;font-size:12px!important;padding:1px 12px!important;margin:0!important;line-height:28px!important;min-height:28px!important;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .wn-mec-select-popup .option .wn-hover-img-sh img{position:absolute;padding:3px;top:-1px;left:100%;box-shadow:0 4px 42px -5px rgba(0,0,0,.16);visibility:hidden;opacity:0;border:1px solid #e3e3e3;border-radius:2px;z-index:99999999;background:#fff}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .wn-mec-select-popup .option:hover .wn-hover-img-sh img{visibility:visible;opacity:1}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .wn-mec-select-popup .option.focus,.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .wn-mec-select-popup .option.selected.focus,.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .wn-mec-select-popup .option:hover{background-color:#f6f6f6}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .wn-mec-select-popup .option.selected{font-weight:700}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .wn-mec-select-popup .option.disabled{background-color:transparent;color:#999;cursor:default}.mec-add-shortcode-popup .no-csspointerevents .wn-mec-select-popup .list{display:none}.mec-add-shortcode-popup .no-csspointerevents .wn-mec-select-popup.open .list{display:block}.mec-add-shortcode-popup .mec-steps-content.mec-steps-content-4 label input{background:#fff;position:relative;width:24px;height:24px;border:1px solid #cacece}.mec-add-shortcode-popup .mec-steps-content.mec-steps-content-4 label input:before{display:none}.mec-add-shortcode-popup .mec-steps-content.mec-steps-content-4 label.active input{background:#008aff;box-shadow:0 5px 10px 0 rgba(0,138,255,.3);border:none}.mec-add-shortcode-popup .mec-steps-content.mec-steps-content-4 label.active input:before{background:#fff;width:6px;height:6px;top:6px;left:6px;position:absolute}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-5{background:url(../../assets/img/popup/fifth-step.png) no-repeat 90% 70%}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-5 .mec-steps-content.mec-steps-content-5{width:360px;margin-top:16px}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-5 .mec-steps-content.mec-steps-content-5 .mec-switcher label{color:#707070;font-size:14px}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-5 .mec-steps-content.mec-steps-content-5 .mec-switcher p{color:#8a8a8a;font-style:italic;font-size:12px;margin-top:7px;margin-bottom:0}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-5 .mec-steps-content.mec-steps-content-5 .mec-switcher{padding-bottom:30px;margin-bottom:34px;border-bottom:2px dashed #dce2e3;position:relative}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-5 .mec-steps-content.mec-steps-content-5 .mec-switcher:last-of-type{padding-bottom:0;margin-bottom:0;border:none}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-5 .mec-steps-content.mec-steps-content-5 .mec-switcher div:last-of-type label{position:absolute;top:-4px;right:0;width:52px;height:26px}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-5 .mec-steps-content.mec-steps-content-5 .mec-switcher input:checked+label:after{margin-left:26px}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-5 .mec-steps-content.mec-steps-content-5 .mec-switcher input+label:after,.mec-add-shortcode-popup .mec-switcher input+label:before{display:block;position:absolute;top:2px;left:1px;bottom:2px;content:""}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-5 .mec-steps-content.mec-steps-content-5 .mec-switcher input+label:after{width:26px}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-6{background:url(../../assets/img/popup/sixth-step.png) no-repeat 90% 70%}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-6 .mec-steps-content.mec-steps-content-6{margin-top:56px}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-6 .mec-popup-shortcode{width:325px;border:2px dashed #dce2e3;background:#fcfcfc;padding:42px 42px 47px;text-align:center}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-6 .mec-popup-shortcode h3{font-size:16px;font-weight:400;color:#707070;margin-top:7px}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-6 .mec-popup-shortcode-code{border-radius:3px;background:rgba(154,214,222,.35);width:243px;margin:0 auto;padding:14px 17px}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-6 .mec-popup-shortcode-code code{background:0 0;color:#000;font-size:14px;font-weight:600;margin-left:-11px}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-6 .mec-popup-shortcode-code button{border:none;background:#fff;border-radius:3px;padding:3px 8px 6px;margin-left:46px;cursor:pointer}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-6 .mec-popup-shortcode-code button:hover{background:#000;color:#fff}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-6 .mec-steps-6-results p{width:325px;text-align:center;font-size:12px;margin-top:5px;color:#8a8a8a}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-6 .mec-steps-6-loading{width:325px;border:2px dashed #dce2e3;background:#fcfcfc;padding:42px 42px 47px;text-align:center;height:182px;position:relative}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-6 .mec-steps-6-loading .mec-loader{position:absolute;left:136px;top:65px}.mec-add-event-popup button.lity-close,.mec-add-shortcode-popup button.lity-close{right:0;top:-52px;border-radius:50%;width:37px;height:37px;background:#fff;color:#a2afbc;text-shadow:none;padding-top:1px;transition:all .2s ease;position:absolute;box-shadow:0 3px 8px 0 rgba(91,188,190,.55)}.mec-add-event-popup button.lity-close:hover,.mec-add-shortcode-popup button.lity-close:hover{background:#ff6262;color:#fff;box-shadow:0 3px 8px 0 rgb(249 162 162 / 55%)}.mec-skin-styles.mec-styles-full_calendar h3{padding-left:12px}.lity.mec-add-event-popup{background-color:#b7e4e3}.mec-add-event-popup .lity-container{width:930px;height:620px;max-width:unset}.mec-add-event-popup div#mec_popup_event{background:#fff;overflow:hidden;display:flex;width:100%;border-radius:10px;height:100%}.lity.mec-add-event-popup .lity-content{box-shadow:0 3px 20px 0 rgba(91,188,190,.55);border-radius:10px;height:100%}div#mec_popup_event_form{height:calc(100% - 37px)}.mec-add-event-popup .mec-steps-container ul{margin-top:42px}.mec-add-event-popup .mec-steps-container ul li:first-of-type{height:41px}.mec-add-shortcode-popup .mec-steps-container ul li:after,.mec-add-shortcode-popup .mec-steps-container ul li:before{height:24px}.mec-add-event-popup .mec-steps-container ul li:after,.mec-add-event-popup .mec-steps-container ul li:before{height:19px}.mec-add-event-popup .mec-steps-container ul li{height:60px}.mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup{box-shadow:0 3px 22px 0 rgba(11,121,125,.01);border:none;clear:unset!important;-webkit-tap-highlight-color:transparent;background-color:#fff;border-radius:3px;box-sizing:border-box;cursor:pointer;display:block;float:left;font-family:inherit;font-size:12px;font-weight:400;line-height:40px;outline:0;padding-left:18px;padding-right:30px;position:relative;text-align:left!important;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;height:46px;margin-right:6px;padding-top:3px;color:#707070}.mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup.open{border-radius:3px 3px 0 0}.mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup:hover{border-color:#dbdbdb}.mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup.open .list{overflow:unset;width:100%;margin:0}.mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup .list{background-color:#fff;border-radius:0 0 3px 3px;box-shadow:0 0 0 0 rgba(68,68,68,.11);box-sizing:border-box;margin-top:4px;opacity:0;overflow:hidden;padding:0;pointer-events:none;position:absolute;top:100%;left:0;-webkit-transform-origin:50% 0;-ms-transform-origin:50% 0;transform-origin:50% 0;-webkit-transform:scale(.75) translateY(-21px);-ms-transform:scale(.75) translateY(-21px);transform:scale(.75) translateY(-21px);-webkit-transition:all .2s cubic-bezier(.5, 0, 0, 1.25),opacity .15s ease-out;transition:all .2s cubic-bezier(.5, 0, 0, 1.25),opacity .15s ease-out;z-index:9;margin-top:1px!important}.mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup:after{border-bottom:2px solid #00acf8;border-right:2px solid #00acf8;content:"";display:block;height:5px;margin-top:-4px;pointer-events:none;position:absolute;right:15px;top:50%;-webkit-transform-origin:66% 66%;-ms-transform-origin:66% 66%;transform-origin:66% 66%;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);-webkit-transition:all .15s ease-in-out;transition:all .15s ease-in-out;width:5px}.mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup.open:after{-webkit-transform:rotate(-135deg);-ms-transform:rotate(-135deg);transform:rotate(-135deg)}.mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup.open .list{opacity:1;pointer-events:auto;-webkit-transform:scale(1) translateY(0);-ms-transform:scale(1) translateY(0);transform:scale(1) translateY(0)}.mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup.disabled{border-color:#ededed;color:#999;pointer-events:none}.mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup.disabled:after{border-color:#ccc}.mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup .list:hover .option:not(:hover){background-color:transparent!important}.mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup .option{cursor:pointer;font-weight:400;list-style:none;min-height:40px;outline:0;text-align:left;position:relative;font-size:12px!important;padding:1px 12px!important;margin:0!important;line-height:22px!important;min-height:22px!important;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup .option.focus,.mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup .option.selected.focus,.mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup .option:hover{background-color:#f6f6f6}.mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup .option.selected{font-weight:700}.mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup .option.disabled{background-color:transparent;color:#999;cursor:default}.mec-add-event-popup .no-csspointerevents .wn-mec-select-popup .list{display:none}.mec-add-event-popup .no-csspointerevents .wn-mec-select-popup.open .list{display:block}.mec-add-event-popup .mec-steps-content-container.mec-steps-content-1{background:url(../../assets/img/popup/add-event-first-step.png) no-repeat 100% 70%}.mec-add-event-popup .mec-steps-content-container.mec-steps-content-1 .mec-steps-content.mec-steps-content-1 #mec_event_name{width:100%;height:46px;border:none;border-radius:3px;padding-left:36px;font-size:13px;color:#3c434a;box-shadow:0 3px 22px 0 rgba(11,121,125,.01)}.mec-add-event-popup .mec-steps-content-container.mec-steps-content-1 .mec-steps-content.mec-steps-content-1 #mec_event_name::-webkit-input-placeholder{color:#b1b2b4}.mec-add-event-popup .mec-steps-content-container.mec-steps-content-1 .mec-steps-content.mec-steps-content-1 #mec_event_name:-ms-input-placeholder{color:#b1b2b4}.mec-add-event-popup .mec-steps-content-container.mec-steps-content-1 .mec-steps-content.mec-steps-content-1 #mec_event_name::placeholder{color:#b1b2b4}.mec-add-event-popup .mec-steps-content-container.mec-steps-content-1 .mec-steps-content.mec-steps-content-1:before{content:"";width:14px;height:14px;background:url(../../assets/img/popup/calendar_icon.png) no-repeat center center;position:absolute;top:17px;left:17px}.mec-add-event-popup .mec-steps-content-container.mec-steps-content-1 .mec-steps-content.mec-steps-content-1{top:210px;position:absolute;width:370px}.mec-add-event-popup .mec-steps-content-container.mec-steps-content-1 .popup-sh-name-required{color:red;display:none;font-style:italic;font-size:12px;margin-top:8px}.mec-add-event-popup .mec-meta-box-colors-container{background:#fff;padding:17px;border-radius:3px;box-shadow:0 3px 22px rgba(11,121,125,.01);margin-top:15px}.mec-add-event-popup .wp-picker-container .wp-color-result.button{border-color:#f1f2f4;border-radius:3px;box-shadow:0 2px 2px rgba(0,0,0,.04)}.mec-add-event-popup .mec-recent-color-sec{display:block!important;font-size:12px;color:#707070}.mec-add-event-popup .mec-form-row.mec-available-color-row{border:2px dashed #dce2e3;padding:13px 20px!important;background:#fcfcfc;border-radius:3px}.mec-add-event-popup .wp-color-result-text{background:#f7f7f7;border-radius:unset;border-left:none;color:#555;display:block;line-height:2.54545455;padding:0 6px;text-align:center}.mec-add-event-popup .mec-form-row.mec-available-color-row .mec-color{width:10px;height:10px;position:absolute;left:11px;z-index:99}.mec-add-event-popup span.mec-color-meta-box-popup{display:inline-block!important;width:20px;height:20px;border-radius:50px;position:absolute;top:1px;left:6px;z-index:9}.mec-add-event-popup span.mec-recent-color-sec-wrap{width:20px;height:20px;display:inline-block;margin-right:12px;margin-top:7px;margin-left:-6px;position:relative}.mec-add-event-popup .mec-steps-content-container.mec-steps-content-2{background:url(../../assets/img/popup/sixth-step.png) no-repeat 95% 70%}.mec-add-event-popup .mec-steps-content-container.mec-steps-content-2 #mec_meta_box_date_form .mec-col-4{width:auto}.mec-add-event-popup .mec-steps-content-container.mec-steps-content-2 #mec_meta_box_date_form .mec-col-4:before{content:"";width:14px;height:14px;background:url(../../assets/img/popup/calendar_icon.png) no-repeat center center;position:absolute;top:17px;left:17px}.mec-add-event-popup .mec-steps-content-container.mec-steps-content-2 #mec_meta_box_date_form .mec-col-4 input{padding-left:36px;width:148px;padding:22px 17px 22px 34px}.mec-add-event-popup .mec-steps-content-container.mec-steps-content-2 #mec_meta_box_date_form input#mec_end_date_popup,.mec-add-event-popup .mec-steps-content-container.mec-steps-content-2 #mec_meta_box_date_form input#mec_start_date_popup,.mec-add-event-popup .mec-steps-content-container.mec-steps-content-2 #mec_meta_box_date_form select{height:46px;border:none;border-radius:3px;padding-left:36px;font-size:12px;color:#707070;box-shadow:0 3px 22px 0 rgba(11,121,125,.01)}.mec-add-event-popup .mec-steps-content-container.mec-steps-content-2 #mec_meta_box_date_form input#mec_end_date::placeholder,.mec-add-event-popup .mec-steps-content-container.mec-steps-content-2 #mec_meta_box_date_form input#mec_start_date::placeholder{color:#b1b2b4}.mec-add-event-popup .mec-steps-content-container.mec-steps-content-2 #mec_meta_box_date_form input#mec_end_date::placeholder,.mec-add-event-popup .mec-steps-content-container.mec-steps-content-2 #mec_meta_box_date_form input#mec_start_date::placeholder{color:#b1b2b4}.mec-add-event-popup .mec-steps-content-container.mec-steps-content-2 #mec_meta_box_date_form input#mec_end_date::placeholder,.mec-add-event-popup .mec-steps-content-container.mec-steps-content-2 #mec_meta_box_date_form input#mec_start_date::placeholder{color:#b1b2b4}.mec-add-event-popup .mec-form-row .time-dv{float:left;margin-left:-2px;margin-right:4px;margin-top:12px;color:#b1b2b4}.mec-add-event-popup .mec-steps-content.mec-steps-content-2{margin-top:60px}.mec-add-event-popup .mec-steps-content.mec-steps-content-2 .mec-form-row.mec-all-day-event label{font-size:14px;color:#707070}.mec-add-event-popup .mec-steps-content.mec-steps-content-2 .mec-form-row.mec-all-day-event{margin-top:13px!important}.mec-add-event-popup .mec-steps-content.mec-steps-content-3,.mec-add-event-popup .mec-steps-content.mec-steps-content-4{margin-top:-9px}.mec-add-event-popup .mec-steps-content-container.mec-steps-content-3{background:url(../../assets/img/popup/fifth-step.png) no-repeat 90% 70%}.mec-add-event-popup .mec-steps-content-container.mec-steps-content-4{background:url(../../assets/img/popup/add-organizer.png) no-repeat 95% 70%}.nice-select.mec_popup_location_id.wn-mec-select-popup,.nice-select.mec_popup_organizer_id.wn-mec-select-popup{position:relative;width:200px;padding-left:36px}.nice-select.mec_popup_location_id.wn-mec-select-popup:before{content:"";width:14px;height:14px;background:url(../../assets/img/popup/pointer.png) no-repeat center center;position:absolute;top:17px;left:17px}.nice-select.mec_popup_organizer_id.wn-mec-select-popup:before{content:"";width:14px;height:14px;background:url(../../assets/img/popup/pointer.png) no-repeat center center;position:absolute;top:17px;left:17px}#mec_popup_event button#mec_popup_add_location:before,#mec_popup_event button#mec_popup_add_organizer:before{content:"";width:15px;height:15px;background:url(../../assets/img/popup/plus.png) no-repeat center center;position:absolute;top:16px;left:15px}.mec-add-event-popup .mec-steps-content-container .nice-select.mec_popup_location_id.wn-mec-select-popup.open .list li,.mec-add-event-popup .mec-steps-content-container .nice-select.mec_popup_organizer_id.wn-mec-select-popup.open .list li{line-height:32px!important;min-height:32px!important}#mec_popup_event .mec-steps-content .mec-tooltip{bottom:8px}#mec-location .mec-form-row span+span.mec-tooltip i,#mec-organizer .mec-form-row span+span.mec-tooltip i{margin-top:-18px}#mec_popup_event .mec-steps-content .mec-tooltip .dashicons-before:before{color:#008aff}#mec_popup_event button#mec_organizer_thumbnail_button,#mec_popup_event button#mec_popup_add_location,#mec_popup_event button#mec_popup_add_organizer{background:#008aff;border-radius:3px;border:none;color:#fff;width:146px;height:46px;margin-left:10px;box-shadow:0 3px 3px 0 rgba(0,138,255,.22);font-size:14px;cursor:pointer;transition:all .2s ease;outline:0;position:relative;padding-left:20px}#mec_popup_event button#mec_organizer_thumbnail_button:hover,#mec_popup_event button#mec_popup_add_location:hover,#mec_popup_event button#mec_popup_add_organizer:hover{background:#000;box-shadow:0 5px 10px 0 rgba(0,0,0,.3)}#mec_popup_event label[for=mec_location_dont_show_map]{font-size:14px;display:inline-block}#mec_popup_event input#mec_location_dont_show_map{margin-top:9px!important}#mec_popup_event .wn-mec-select-popup .current{width:100%;display:inline-block;overflow:hidden}#mec_popup_event div#mec_location_new_container,#mec_popup_event div#mec_organizer_new_container{border-top:2px dashed #dce2e3;width:360px;padding-top:25px;margin-top:20px}#mec_popup_event div#mec_location_new_container input,#mec_popup_event div#mec_organizer_new_container input{width:100%;height:46px;border:none;border-radius:3px;padding-left:17px;font-size:12px;color:#b1b2b4;box-shadow:0 3px 22px 0 rgba(11,121,125,.01)}#mec_popup_event div#mec_location_new_container .description,#mec_popup_event div#mec_organizer_new_container .description{border:none;padding:0;margin:0;margin-left:16px;line-height:19px;font-size:12px;color:#707070;font-style:normal;margin-top:-4px;display:block}#mec_popup_event .mec-form-row.mec-lat-lng-row input{width:44%!important}#mec_popup_event .mec-form-row.mec-lat-lng-row input:first-of-type{margin-right:10px}#mec_popup_event div#mec_organizer_new_container{margin-top:30px}#mec_popup_event div#mec_organizer_new_container .mec-form-row:first-of-type .mec-col-6:first-of-type{margin-right:14px!important}#mec_popup_event div#mec_organizer_new_container .mec-form-row:first-of-type .mec-col-6{width:48%;margin:0}#mec_popup_event button#mec_organizer_thumbnail_button:before{content:"";width:15px;height:15px;background:url(../../assets/img/popup/picture.png) no-repeat center center;position:absolute;top:16px;left:15px}#mec_popup_event button#mec_organizer_thumbnail_button{width:96%;padding-left:30px}.mec-add-event-popup .mec-steps-content.mec-steps-content-4 div#mec_organizer_thumbnail_img{position:absolute;right:10px;top:-20px}.mec-add-event-popup .mec-steps-content.mec-steps-content-4 div#mec_organizer_thumbnail_img img{max-width:110px}.mec-add-event-popup .mec-steps-content-container.mec-steps-content-5{background:url(../../assets/img/popup/fourth-step.png) no-repeat 90% 70%}.mec-add-event-popup .mec-steps-content-container.mec-steps-content-5 .mec-categories-add-new input{height:30px;border:none;border-radius:3px;padding-left:10px;margin-left:20px;font-size:12px;color:#b1b2b4;box-shadow:0 3px 22px 0 rgba(11,121,125,.01);width:186px;float:right;margin-top:-4px}.mec-add-event-popup .mec-steps-content.mec-steps-content-5{width:326px;margin-top:48px}.mec-add-event-popup .mec-steps-content.mec-steps-content-5 .mec-categories-tabs ul li{display:inline-block;background:#fff;border:none;cursor:pointer;padding:12px 18px;border-radius:3px;transition:all .3s ease;outline:0;text-align:center;margin-right:10px;height:42px;color:#008aff;font-size:14px;box-shadow:0 3px 22px 0 rgba(11,121,125,.01)}.mec-add-event-popup .mec-steps-content.mec-steps-content-5 .mec-categories-tabs ul li.mec-categories-tab-selected,.mec-add-event-popup .mec-steps-content.mec-steps-content-5 .mec-categories-tabs ul li:hover{background:#008aff;color:#fff;box-shadow:0 3px 3px 0 rgba(0,138,255,.3)}.mec-add-event-popup .mec-categories-tab-contents{background:#fff;padding:20px;border:2px dashed #dce2e3;margin-bottom:13px;margin-top:-5px}.mec-add-event-popup .mec-categories-tab-contents ul,.mec-add-event-popup .mec-categories-tab-contents ul li:last-of-type{margin:0}.mec-add-event-popup .mec-categories-tab-contents ul li .children{margin:7px 0 7px 30px}.mec-add-event-popup .mec-categories-tab-contents ul li{font-size:14px;color:#707070}.mec-add-event-popup .mec-categories-tab-contents.mec-form-row input[type=checkbox]{margin-top:0}.mec-add-event-popup .mec-categories-tab-contents{max-height:200px;overflow:hidden;overflow-y:scroll}.mec-add-event-popup .nice-select.mec_popup_location_id .list,.mec-add-event-popup .nice-select.mec_popup_organizer_id .list{max-height:240px!important;overflow:hidden!important;overflow-y:scroll!important}#mec_popup_event div#mec_location_new_container::-webkit-scrollbar,#mec_popup_event div#mec_organizer_new_container::-webkit-scrollbar,#mec_popup_event div#mec_sponsor_new_container::-webkit-scrollbar,.mec-add-event-popup .mec-categories-tab-contents::-webkit-scrollbar,.mec-add-event-popup .nice-select.mec_popup_location_id .list::-webkit-scrollbar,.mec-add-event-popup .nice-select.mec_popup_organizer_id .list::-webkit-scrollbar{width:5px}#mec_popup_event div#mec_location_new_container::-webkit-scrollbar-track,#mec_popup_event div#mec_organizer_new_container::-webkit-scrollbar-track,#mec_popup_event div#mec_sponsor_new_container::-webkit-scrollbar-track,.mec-add-event-popup .mec-categories-tab-contents::-webkit-scrollbar-track,.mec-add-event-popup .nice-select.mec_popup_location_id .list::-webkit-scrollbar-track,.mec-add-event-popup .nice-select.mec_popup_organizer_id .list::-webkit-scrollbar-track{box-shadow:inset 0 0 6px rgba(0,0,0,.1)}#mec_popup_event div#mec_location_new_container::-webkit-scrollbar-thumb,#mec_popup_event div#mec_organizer_new_container::-webkit-scrollbar-thumb,#mec_popup_event div#mec_sponsor_new_container::-webkit-scrollbar-thumb,.mec-add-event-popup .mec-categories-tab-contents::-webkit-scrollbar-thumb,.mec-add-event-popup .nice-select.mec_popup_location_id .list::-webkit-scrollbar-thumb,.mec-add-event-popup .nice-select.mec_popup_organizer_id .list::-webkit-scrollbar-thumb{background-color:#008aff;outline:0 solid #fff}.mec-add-event-popup span#mec_popup_new_category_button{cursor:pointer;position:relative;padding-left:18px;font-size:14px}.mec-add-event-popup span#mec_popup_new_category_button:before{content:"";width:15px;height:15px;background:url(../../assets/img/popup/plus-blue.png) no-repeat center center;position:absolute;top:3px;left:0}.mec-add-event-popup .mec-steps-content-container.mec-steps-content-5 .mec-categories-add-new input::placeholder{color:#b1b2b4;font-size:13px}.mec-add-event-popup .mec-steps-content-container.mec-steps-content-5 .mec-categories-add-new input::placeholder{color:#b1b2b4;font-size:13px}.mec-add-event-popup .mec-steps-content-container.mec-steps-content-5 .mec-categories-add-new input::placeholder{color:#b1b2b4;font-size:13px}.mec-add-event-popup .mec-steps-content-container.mec-steps-content-5 .mec-categories-add-new input{color:#3c434a;font-size:13px}.mec-add-event-popup .mec-steps-content.mec-steps-content-6.mec-steps-content-active{margin-top:-10px;height:70%}.mec-add-event-popup .mec-steps-content.mec-steps-content-6 .mce-tinymce.mce-container.mce-panel{height:100%;border:1px solid #ececec!important;box-shadow:0 3px 22px 0 rgba(11,121,125,.01)!important;border-radius:3px!important;overflow:hidden}.mec-add-event-popup .mec-steps-content.mec-steps-content-6 .mce-container-body.mce-stack-layout{height:100%;background:#f5f5f5}.mec-add-event-popup .mec-steps-content.mec-steps-content-6 .mce-container *{border:none!important;box-shadow:none!important}.mec-add-event-popup .mec-steps-content.mec-steps-content-6 .mce-edit-area.mce-container.mce-panel.mce-stack-layout-item{height:90%}.mec-add-event-popup .mec-steps-content.mec-steps-content-6 .mce-statusbar.mce-container.mce-panel.mce-stack-layout-item.mce-last{display:none!important}.mec-add-event-popup .mce-edit-area.mce-container.mce-panel.mce-stack-layout-item iframe{height:100%!important}.mec-add-event-popup .mec-steps-content.mec-steps-content-7.mec-steps-content-active{height:70%;background:#fff;border:2px dashed #dce2e3;border-radius:3px;text-align:center;vertical-align:middle;margin-top:-10px;position:relative}.mec-add-event-popup .mec-event-popup-featured-image-wrapper{display:flex;justify-content:center;align-items:center;height:100%}.mec-add-event-popup button#mec_popup_upload_image_button{background:#008aff;color:#fff;box-shadow:0 3px 3px 0 rgba(0,138,255,.3);display:inline-block;border:none;cursor:pointer;padding:12px 18px;border-radius:3px;transition:all .3s ease;outline:0;text-align:center;height:42px;font-size:14px;margin-right:0}.mec-add-event-popup div#mec_event_popup_featured_image_preview img{max-height:300px;max-width:740px;margin-top:20px;margin-bottom:0}.mec-add-event-popup button#mec_popup_upload_image_button:hover{background:#000;box-shadow:0 3px 3px 0 rgba(0,0,0,.3)}.mec-add-event-popup .mec-event-popup-featured-image-wrapper span i{border-radius:50px;color:#bb353f;right:10px;top:10px;font-size:30px;position:absolute;cursor:pointer}.mec-add-event-popup .mec-steps-content.mec-steps-content-8{height:100%}.mec-add-event-popup .mec-steps-content.mec-steps-content-8 .mec-steps-8-results .mec-steps-8-results-wrap{display:flex;justify-content:center;align-items:center;flex-direction:column;height:100%}.mec-add-event-popup .mec-steps-content.mec-steps-content-8 .mec-steps-8-loading .mec-loader{left:calc(50% - 2.5em);top:calc(50% - 2.5em)}.mec-add-event-popup .mec-steps-content.mec-steps-content-8 .mec-steps-8-results{height:100%}.mec-add-event-popup .mec-steps-content.mec-steps-content-8 a.mec-button-view{display:inline-block;background:#fff;border:none;cursor:pointer;padding:12px 22px 12px 36px;border-radius:3px;transition:all .3s ease;outline:0;text-align:center;margin-right:10px;height:46px;font-size:14px;box-shadow:0 3px 3px 0 rgba(0,0,0,.04);text-decoration:none;color:#000;position:relative;line-height:22px}.mec-add-event-popup .mec-steps-content.mec-steps-content-8 a.mec-button-view:hover{background-color:#000;color:#fff}.mec-add-event-popup .mec-steps-content.mec-steps-content-8 a.mec-button-view:before{content:"";width:15px;height:15px;background:url(../../assets/img/popup/eye.png) no-repeat center center;position:absolute;top:16px;left:15px}.mec-add-event-popup .mec-steps-content.mec-steps-content-8 button.mec-button-new{background:#008aff;color:#fff;box-shadow:0 3px 3px 0 rgba(0,138,255,.3);display:inline-block;border:none;cursor:pointer;padding:11px 22px 11px 36px;border-radius:3px;transition:all .3s ease;outline:0;text-align:center;height:46px;font-size:14px;margin-right:0;position:relative;line-height:22px}.mec-add-event-popup .mec-steps-content.mec-steps-content-8 button.mec-button-new:hover{background:#000;box-shadow:0 3px 3px 0 rgba(0,0,0,.3)}.mec-add-event-popup .mec-steps-content.mec-steps-content-8 button.mec-button-new:before{content:"";width:15px;height:15px;background:url(../../assets/img/popup/plus.png) no-repeat center center;position:absolute;top:16px;left:15px}.mec-add-event-popup .mec-steps-content.mec-steps-content-8 .mec-popup-final-buttons{margin-top:22px}.mec-add-event-popup .mec-steps-content.mec-steps-content-8 .mec-steps-8-results-wrap h3{font-size:26px;font-weight:400}.mec-add-event-popup .mec-steps-content-container .mec-time-picker .wn-mec-select-popup{width:64px}.mec-add-event-popup .mec-steps-content-container .mec-time-picker .wn-mec-select-popup .list{overflow:scroll!important;height:288px;margin-top:4px!important;box-shadow:0 1px 9px rgba(0,0,0,.1);border-radius:0}.mec-add-event-popup .mec-steps-content-container .mec-time-picker .wn-mec-select-popup .list::-webkit-scrollbar-track{background-color:#f6f6f6}.mec-add-event-popup .mec-steps-content-container .mec-time-picker .wn-mec-select-popup .list::-webkit-scrollbar{width:3px;background-color:#f6f6f6}.mec-add-event-popup .mec-steps-content-container .mec-time-picker .wn-mec-select-popup .list::-webkit-scrollbar-thumb{background-color:rgba(26,175,251,.16)}.mec-add-event-popup .mec-steps-content-container .mec-time-picker .wn-mec-select-popup:last-child .list{overflow:unset!important;height:unset}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-1 .mec-steps-content.mec-steps-content-1 input[name="shortcode[name]"]{color:#3c434a!important}@media (max-width:1280px){.mec-add-event-popup .lity-container,.mec-add-shortcode-popup .lity-container{height:calc(100% - 110px);margin-bottom:-80px}.mec-add-event-popup .post-type-mec-events .mec-form-row{padding-bottom:12px}.mec-add-event-popup .mec-steps-panel .mec-add-event-popup .mec-steps-panel,.mec-add-shortcode-popup .mec-steps-panel .mec-add-event-popup .mec-steps-panel{padding:14px}.mec-add-event-popup .mec-steps-container img,.mec-add-event-popup .mec-steps-container ul,.mec-add-shortcode-popup .mec-steps-container img,.mec-add-shortcode-popup .mec-steps-container ul{margin-top:14px}.mec-add-event-popup .mec-add-event-popup .mec-steps-container ul li:first-of-type,.mec-add-shortcode-popup .mec-add-event-popup .mec-steps-container ul li:first-of-type{height:28px}.mec-add-event-popup .mec-add-event-popup .mec-steps-container ul li,.mec-add-shortcode-popup .mec-add-event-popup .mec-steps-container ul li{height:46px}.mec-add-event-popup .mec-add-event-popup .mec-steps-container ul li:after,.mec-add-event-popup .mec-add-event-popup .mec-steps-container ul li:before,.mec-add-shortcode-popup .mec-add-event-popup .mec-steps-container ul li:after,.mec-add-shortcode-popup .mec-add-event-popup .mec-steps-container ul li:before{height:12px}.mec-add-event-popup .mec-steps-content-container.mec-steps-content-1 .mec-steps-content.mec-steps-content-1{top:150px}#mec_popup_event div#mec_location_new_container,#mec_popup_event div#mec_organizer_new_container,#mec_popup_event div#mec_sponsor_new_container{padding-top:12px;margin-top:12px}#mec_popup_event div#mec_location_new_container input,#mec_popup_event div#mec_organizer_new_container input,#mec_popup_event div#mec_sponsor_new_container input{margin:0 0 3px 0}}@media (max-width:960px){.mec-steps-content-container{background-image:unset!important}#mec_popup_event div#mec_location_new_container,#mec_popup_event div#mec_organizer_new_container,#mec_popup_event div#mec_sponsor_new_container,.mec-add-event-popup .mec-steps-content-container .mec-steps-content,.mec-add-shortcode-popup .mec-steps-content-container .mec-steps-content{width:100%!important;max-width:100%;position:unset!important;margin:0!important}.mec-add-event-popup .lity-container,.mec-add-shortcode-popup .lity-container,.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-1 .mec-steps-content.mec-steps-content-1 input[name="shortcode[name]"]{width:100%;max-width:100%}.mec-add-event-popup .mec-steps-panel,.mec-add-shortcode-popup .mec-steps-panel{overflow-x:scroll;padding:14px}.mec-add-event-popup .mec-steps-header,.mec-add-shortcode-popup .mec-steps-header{margin-bottom:30px}.mec-add-event-popup .mec-steps-header span.mec-steps-header-add-text,.mec-add-shortcode-popup .mec-steps-header span.mec-steps-header-add-text{display:block;margin-top:10px;width:100%}.mec-add-event-popup .mec-col-4,.mec-add-shortcode-popup .mec-col-4{width:100%!important;max-width:100%!important}.mec-add-event-popup #mec_popup_event button#mec_organizer_thumbnail_button,.mec-add-event-popup #mec_popup_event button#mec_popup_add_location,.mec-add-event-popup #mec_popup_event button#mec_popup_add_organizer,.mec-add-shortcode-popup #mec_popup_event button#mec_organizer_thumbnail_button,.mec-add-shortcode-popup #mec_popup_event button#mec_popup_add_location,.mec-add-shortcode-popup #mec_popup_event button#mec_popup_add_organizer{margin:10px 0 0 0}.mec-add-event-popup .mec-col-1,.mec-add-event-popup .mec-col-10,.mec-add-event-popup .mec-col-11,.mec-add-event-popup .mec-col-12,.mec-add-event-popup .mec-col-2,.mec-add-event-popup .mec-col-3,.mec-add-event-popup .mec-col-4,.mec-add-event-popup .mec-col-5,.mec-add-event-popup .mec-col-6,.mec-add-event-popup .mec-col-7,.mec-add-event-popup .mec-col-8,.mec-add-event-popup .mec-col-9,.mec-add-shortcode-popup .mec-col-1,.mec-add-shortcode-popup .mec-col-10,.mec-add-shortcode-popup .mec-col-11,.mec-add-shortcode-popup .mec-col-12,.mec-add-shortcode-popup .mec-col-2,.mec-add-shortcode-popup .mec-col-3,.mec-add-shortcode-popup .mec-col-4,.mec-add-shortcode-popup .mec-col-5,.mec-add-shortcode-popup .mec-col-6,.mec-add-shortcode-popup .mec-col-7,.mec-add-shortcode-popup .mec-col-8,.mec-add-shortcode-popup .mec-col-9{margin:0 0 10px 0}.mec-add-event-popup .mec-steps-content h3,.mec-add-shortcode-popup .mec-steps-content h3{font-size:18px!important}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-2 .mec-steps-content.mec-steps-content-2 ul,.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-3 .mec-skin-styles{height:480px;width:100%}}@media (max-width:320px){.mec-add-event-popup .mec-steps-container,.mec-add-shortcode-popup .mec-steps-container{display:none}.mec-add-event-popup .mec-steps-panel,.mec-add-shortcode-popup .mec-steps-panel{width:100%!important}}#mec_popup_event input[type=checkbox]{margin-right:9px}#mec_popup_event input#mec_location_dont_show_map{margin-top:0!important}#mec_popup_settings #mec_next_previous_events_container_toggle label,#mec_popup_settings #mec_related_events_container_toggle label{padding:0}#mec_popup_event input[type=checkbox]:checked,#mec_popup_event input[type=radio]:checked,#mec_popup_settings input[type=checkbox]:checked,#mec_popup_settings input[type=radio]:checked,#mec_popup_shortcode input[type=checkbox]:checked,#mec_popup_shortcode input[type=radio]:checked{background:#64e385;border-color:#64e385}#mec_popup_event input[type=checkbox]:checked:before,#mec_popup_event input[type=radio]:checked:before,#mec_popup_settings input[type=checkbox]:checked:before,#mec_popup_settings input[type=radio]:checked:before,#mec_popup_shortcode input[type=checkbox]:checked:before,#mec_popup_shortcode input[type=radio]:checked:before{content:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIxNC42ODgiIHZpZXdCb3g9IjAgMCAyMCAxNC42ODgiPg0KICA8ZyBpZD0idGlja18xXyIgZGF0YS1uYW1lPSJ0aWNrICgxKSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAtNjcuOTk4KSI+DQogICAgPGcgaWQ9Ikdyb3VwXzEiIGRhdGEtbmFtZT0iR3JvdXAgMSIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCA2Ny45OTcpIj4NCiAgICAgIDxwYXRoIGlkPSJQYXRoXzEiIGRhdGEtbmFtZT0iUGF0aCAxIiBkPSJNMTkuNzA3LDY4LjI5YTEsMSwwLDAsMC0xLjQxNCwwTDYuMzEyLDgwLjI3MSwxLjcwNyw3NS42NjZBMSwxLDAsMCwwLC4yOTIsNzcuMDhMNS42LDgyLjM5MmExLDEsMCwwLDAsMS40MTQsMEwxOS43MDcsNjkuN0ExLDEsMCwwLDAsMTkuNzA3LDY4LjI5WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAtNjcuOTk3KSIgZmlsbD0iI2ZmZiIvPg0KICAgIDwvZz4NCiAgPC9nPg0KPC9zdmc+DQo=");line-height:16px;width:15px;float:none;margin:2px;display:block}#mec_popup_shortcode .mec-steps-content.mec-steps-content-4 label input[type=radio]:before{background:unset;margin:-2px 0 0 0}.mec-add-event-popup .mec-steps-content.mec-steps-content-5{width:366px;margin-top:48px}#mec_popup_event div#mec_location_new_container,#mec_popup_event div#mec_organizer_new_container,#mec_popup_event div#mec_sponsor_new_container{border-top:2px dashed #dce2e3;width:375px;padding-top:25px;margin-top:0;overflow-y:scroll;overflow-x:hidden;max-height:240px}#mec_popup_event div#mec_location_new_container .mec-form-row,#mec_popup_event div#mec_organizer_new_container .mec-form-row,#mec_popup_event div#mec_sponsor_new_container .mec-form-row{padding-bottom:20px}#mec_popup_event div#mec_location_new_container .description,#mec_popup_event div#mec_organizer_new_container .description,#mec_popup_event div#mec_sponsor_new_container .description{margin:9px 0}#mec_popup_event div#mec_location_new_container .mec-form-row.mec-thumbnail-row,#mec_popup_event div#mec_organizer_new_container .mec-form-row.mec-thumbnail-row,#mec_popup_event div#mec_sponsor_new_container .mec-form-row.mec-thumbnail-row{padding:0}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-5 .mec-steps-content.mec-steps-content-5 .mec-switcher div:last-of-type label{position:absolute;top:-12px;max-width:52px;width:100%;height:30px}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-5 .mec-switcher input+label{background:#e5e9ee;box-shadow:unset}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-5 .mec-switcher input+label:after{margin-left:0;margin-top:-1px;border-color:#e5e9ee}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-5 .mec-switcher input[value="1"]:checked+label,.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-5 .mec-switcher input[value="1"]:checked+label:before{box-shadow:2px 2px 12px -2px #4fdc73 inset;position:relative;background:#64e385;border-color:#64e385}.lity.mec-add-event-popup .lity-content,.lity.mec-settings .lity-content{box-shadow:0 3px 20px 0 rgb(91 188 190 / 55%);border-radius:10px;height:100%;overflow:hidden}.mec-settings .lity-container{width:930px;height:620px;max-width:unset}#mec_popup_settings #mec_next_previous_events_container_toggle label:first-child,#mec_popup_settings #mec_related_events_container_toggle label:first-child{display:block;margin:0 0 20px 0}#mec_popup_event .mec-categories-tab-contents,#mec_popup_settings #mec_settings_weekdays .mec-box,#mec_popup_settings #mec_settings_weekends .mec-box{background:rgb(220 226 227 / .3)}#mec_popup_settings .mec-switcher input+label{max-width:62px!important;width:100%;height:33px}#mec_popup_settings .mec-image-select-wrap li input:checked+span:after{padding:5px}.ac-mec-events.ac-search-enabled .tablenav .ac-search>:not(#ac-s).lity-hide{display:none}.tablenav .actions .input-field{float:left;margin-right:6px}.tablenav .actions .input-field .select2-selection{height:30px}.mec-go-pro-content-title{font-size:20px;font-weight:600;margin-bottom:12px}.mec-go-pro-features-wrap p{font-size:14px}.mec-go-pro-features-wrap .mec-addons-notification-box-content{width:calc(100% - 590px);display:inline-block;padding-left:20px}.mec-go-pro-features-wrap ul{float:left;width:50%;margin:0 0 12px}.mec-go-pro-features-wrap ul li{margin-bottom:1px;font-size:13px;color:#717479;padding-left:18px;position:relative}.mec-go-pro-features-wrap ul li:before{position:absolute;left:-1px;top:6px;color:#36da74;font-size:13px;font-weight:700;vertical-align:middle;font-family:simple-line-icons;border-radius:50%;padding:0;width:13px;height:13px;line-height:13px;z-index:3;background:rgba(64,241,147,.12);content:"\e080"}.post-type-mec-events #TB_window{height:470px!important;top:calc(50% - 235px)!important}.post-type-mec-events #TB_ajaxContent{width:calc(100% - 30px)!important}.m-e-calendar_page_MEC-support #wpwrap .welcome-content .fserv-container .fserv-form-description{position:relative!important}.taxonomy-mec_category #TB_window{overflow:hidden}@media (max-width:480px){.m-e-calendar_page_MEC-support #wpwrap .welcome-content .fserv-container .fserv-form-description,.m-e-calendar_page_MEC-support #wpwrap .welcome-content .fserv-container form{padding-left:90px!important}.m-e-calendar_page_MEC-support #wpwrap .welcome-content .fserv-container form .fserv-field{width:40%!important}.m-e-calendar_page_MEC-support #wpwrap .welcome-content .fserv-container:before{top:100px;left:10px}}.post-type-mec-events.taxonomy-mec_label .button.wp-color-result{background:0 0;text-align:right;padding:0 0 0 32px;border-radius:4px;box-shadow:unset;border:1px solid #ddd}.post-type-mec-events.taxonomy-mec_label .button.wp-color-result .wp-color-result-text{height:30px}.post-type-mec-events.taxonomy-mec_label .wp-picker-container input[type=text].wp-color-picker{width:70px;margin-top:-10px;height:32px}.post-type-mec-events.taxonomy-mec_label .wp-picker-default{height:32px;padding-top:2px;padding-bottom:2px}.post-type-mec-events.taxonomy-mec_label .wp-picker-container .iris-picker{margin-top:-10px}.mec-admin-dark-mode #mec-wrap .nav-tab-wrapper,.mec-admin-dark-mode #mec-wrap .nav-tab-wrapper .nav-tab,.mec-admin-dark-mode.m-e-calendar_page_MEC-ix #mec-wrap .nav-tab-wrapper{background:#1f1f1f}.mec-admin-dark-mode.m-e-calendar_page_MEC-ix #mec-wrap .mec-container,.mec-admin-dark-mode.m-e-calendar_page_MEC-ix #mec-wrap .nav-tab-wrapper,.mec-admin-dark-mode.m-e-calendar_page_MEC-ix #mec-wrap .nav-tab-wrapper .nav-tab{border-color:#353535}.mec-admin-dark-mode.m-e-calendar_page_MEC-ix #mec-wrap .nav-tab-wrapper .nav-tab-active{background:#404040!important}.mec-admin-dark-mode.m-e-calendar_page_MEC-ix #mec-wrap .nav-tab-wrapper .nav-tab:not(.nav-tab-active):after{background:#4f4f4f}.mec-admin-dark-mode.m-e-calendar_page_MEC-ix #mec-wrap .nav-tab-wrapper .nav-tab-active:after{border-color:#404040 transparent transparent}.mec-admin-dark-mode.m-e-calendar_page_MEC-ix #mec-wrap .nav-tab-wrapper .nav-tab-active:before{border-color:#404040 transparent transparent}.mec-admin-dark-mode #mec_bfixed_form_fields li,.mec-admin-dark-mode #mec_calendar_filter,.mec-admin-dark-mode #mec_calendar_filter .mec-add-booking-tabs-left,.mec-admin-dark-mode #mec_calendar_filter .mec-add-booking-tabs-wrap,.mec-admin-dark-mode #mec_calendar_filter .mec-add-event-tabs-left,.mec-admin-dark-mode #mec_calendar_filter .mec-add-event-tabs-wrap,.mec-admin-dark-mode #mec_calendar_filter .mec-create-shortcode-tabs-left,.mec-admin-dark-mode #mec_metabox_booking,.mec-admin-dark-mode #mec_metabox_booking .mec-add-booking-tabs-left,.mec-admin-dark-mode #mec_metabox_booking .mec-add-booking-tabs-wrap,.mec-admin-dark-mode #mec_metabox_booking .mec-add-event-tabs-left,.mec-admin-dark-mode #mec_metabox_booking .mec-add-event-tabs-wrap,.mec-admin-dark-mode #mec_metabox_booking .mec-create-shortcode-tabs-left,.mec-admin-dark-mode #mec_metabox_details,.mec-admin-dark-mode #mec_metabox_details .mec-add-booking-tabs-left,.mec-admin-dark-mode #mec_metabox_details .mec-add-booking-tabs-wrap,.mec-admin-dark-mode #mec_metabox_details .mec-add-event-tabs-left,.mec-admin-dark-mode #mec_metabox_details .mec-add-event-tabs-wrap,.mec-admin-dark-mode #mec_metabox_details .mec-add-event-tabs-wrap .select2-container,.mec-admin-dark-mode #mec_metabox_details .mec-create-shortcode-tab-content .select2-container,.mec-admin-dark-mode #mec_metabox_details .mec-create-shortcode-tabs-left,.mec-admin-dark-mode #webnus-dashboard .mec-pro-notice .info-msg,.mec-admin-dark-mode .mec-attendees-wrapper .mec-attendees-list .w-clearfix:nth-child(odd),.mec-admin-dark-mode .w-box,.mec-admin-dark-mode .w-box-content pre,.mec-admin-dark-mode .w-clearfix.w-box.mec-addons-notification-box-wrap span,.mec-admin-dark-mode .w-clearfix.w-box.mec-cmsg-2-notification-box-wrap span,.mec-admin-dark-mode .w-clearfix.w-box.mec-cmsg-notification-box-wrap span,.mec-admin-dark-mode .wns-be-main,.mec-admin-dark-mode .wns-be-main .mec-container,.mec-admin-dark-mode .wns-be-sidebar .wns-be-group-menu>li.active>a,.mec-admin-dark-mode.m-e-calendar_page_MEC-ix .mec-container,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_bfixed_form_fields button,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_bfixed_form_fields li,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_event_form_fields button,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_event_form_fields li,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_reg_form_field_types button,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_reg_form_fields li,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wns-be-container #wns-be-content,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wns-be-container #wns-be-infobar,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wns-be-main,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wp-editor-container,.mec-admin-dark-mode.m-e-calendar_page_MEC-support #webnus-dashboard .mec-pro-notice .info-msg,.mec-admin-dark-mode.post-type-mec-books #major-publishing-actions,.mec-admin-dark-mode.post-type-mec-books #screen-meta,.mec-admin-dark-mode.post-type-mec-books #screen-meta-links .show-settings,.mec-admin-dark-mode.post-type-mec-books .postbox,.mec-admin-dark-mode.post-type-mec-events #major-publishing-actions,.mec-admin-dark-mode.post-type-mec-events #mec_event_form_fields li,.mec-admin-dark-mode.post-type-mec-events #mec_reg_form_fields li,.mec-admin-dark-mode.post-type-mec-events #post-status-info,.mec-admin-dark-mode.post-type-mec-events #screen-meta,.mec-admin-dark-mode.post-type-mec-events #screen-meta-links .show-settings,.mec-admin-dark-mode.post-type-mec-events .categorydiv div.tabs-panel,.mec-admin-dark-mode.post-type-mec-events .components-popover__content,.mec-admin-dark-mode.post-type-mec-events .customlinkdiv div.tabs-panel,.mec-admin-dark-mode.post-type-mec-events .postbox,.mec-admin-dark-mode.post-type-mec-events .posttypediv div.tabs-panel,.mec-admin-dark-mode.post-type-mec-events .taxonomydiv div.tabs-panel,.mec-admin-dark-mode.post-type-mec-events .wp-switch-editor,.mec-admin-dark-mode.post-type-mec-events .wp-tab-active,.mec-admin-dark-mode.post-type-mec-events .wp-tab-panel,.mec-admin-dark-mode.post-type-mec-events div.mce-panel,.mec-admin-dark-mode.post-type-mec-events div.mce-toolbar-grp,.mec-admin-dark-mode.post-type-mec-events ul.add-menu-item-tabs li.tabs,.mec-admin-dark-mode.post-type-mec-events ul.category-tabs li.tabs,.mec-admin-dark-mode.post-type-mec_calendars #major-publishing-actions,.mec-admin-dark-mode.post-type-mec_calendars #post-status-info,.mec-admin-dark-mode.post-type-mec_calendars #screen-meta,.mec-admin-dark-mode.post-type-mec_calendars #screen-meta-links .show-settings,.mec-admin-dark-mode.post-type-mec_calendars .categorydiv div.tabs-panel,.mec-admin-dark-mode.post-type-mec_calendars .customlinkdiv div.tabs-panel,.mec-admin-dark-mode.post-type-mec_calendars .postbox,.mec-admin-dark-mode.post-type-mec_calendars .posttypediv div.tabs-panel,.mec-admin-dark-mode.post-type-mec_calendars .taxonomydiv div.tabs-panel,.mec-admin-dark-mode.post-type-mec_calendars .wp-switch-editor,.mec-admin-dark-mode.post-type-mec_calendars .wp-tab-active,.mec-admin-dark-mode.post-type-mec_calendars .wp-tab-panel,.mec-admin-dark-mode.post-type-mec_calendars div.mce-panel,.mec-admin-dark-mode.post-type-mec_calendars div.mce-toolbar-grp,.mec-admin-dark-mode.post-type-mec_calendars ul.add-menu-item-tabs li.tabs,.mec-admin-dark-mode.post-type-mec_calendars ul.category-tabs li.tabs{background:#1f1f1f;color:#fff}.mec-admin-dark-mode .mec-form-row .mec-box,.mec-admin-dark-mode .mec-form-row input[type=checkbox],.mec-admin-dark-mode .mec-form-row ul.mec-message-categories li ul,.mec-admin-dark-mode .mec-meta-box-fields .mec-box,.mec-admin-dark-mode.m-e-calendar_page_MEC-support #webnus-dashboard .mec-faq-accordion-trigger a{background:#333;border-color:#353535;box-shadow:0 1px 6px -2px #000}.mec-admin-dark-mode #wpwrap .mec-button-primary,.mec-admin-dark-mode .wns-be-container .dpr-btn.dpr-save-btn{box-shadow:none;background:#5e7a65}.mec-admin-dark-mode #wpwrap .mec-button-primary:hover,.mec-admin-dark-mode .wns-be-container .dpr-btn.dpr-save-btn:hover{box-shadow:none;background:#559164;border-color:none}.mec-admin-dark-mode #mec-wrap .nav-tab-wrapper .nav-tab{border-radius:7px}.mec-admin-dark-mode #mec_bfixed_form_fields,.mec-admin-dark-mode #mec_bfixed_form_fields #mec_bfixed_form_fields li,.mec-admin-dark-mode #mec_calendar_filter .mec-add-booking-tabs-left a,.mec-admin-dark-mode #mec_calendar_filter .mec-add-event-tabs-left a,.mec-admin-dark-mode #mec_calendar_filter .mec-create-shortcode-tabs-left a,.mec-admin-dark-mode #mec_metabox_booking .mec-add-booking-tabs-left a,.mec-admin-dark-mode #mec_metabox_booking .mec-add-event-tabs-left a,.mec-admin-dark-mode #mec_metabox_booking .mec-create-shortcode-tabs-left a,.mec-admin-dark-mode #mec_metabox_details .mec-add-booking-tabs-left a,.mec-admin-dark-mode #mec_metabox_details .mec-add-event-tabs-left a,.mec-admin-dark-mode #mec_metabox_details .mec-create-shortcode-tabs-left a,.mec-admin-dark-mode.m-e-calendar_page_MEC-ix .mec-form-row.mec-syn-schedule,.mec-admin-dark-mode.post-type-mec-events #mec_event_form_fields,.mec-admin-dark-mode.post-type-mec-events #mec_reg_form_fields,.mec-admin-dark-mode.post-type-mec-events .select2-search--dropdown,.mec-admin-dark-mode.post-type-mec_calendars .select2-search--dropdown{background:#282828;border-color:#353535}.mec-admin-dark-mode .select2-container--default .select2-selection--multiple .select2-selection__choice{color:#000}.mec-admin-dark-mode.post-type-mec-books ul#adminmenu a.wp-has-current-submenu:after,.mec-admin-dark-mode.post-type-mec-books ul#adminmenu>li.current>a.current:after,.mec-admin-dark-mode.post-type-mec-events ul#adminmenu a.wp-has-current-submenu:after,.mec-admin-dark-mode.post-type-mec-events ul#adminmenu>li.current>a.current:after,.mec-admin-dark-mode.post-type-mec_calendars ul#adminmenu a.wp-has-current-submenu:after,.mec-admin-dark-mode.post-type-mec_calendars ul#adminmenu>li.current>a.current:after,.mec-admin-dark-mode.toplevel_page_mec-intro ul#adminmenu a.wp-has-current-submenu:after,.mec-admin-dark-mode.toplevel_page_mec-intro ul#adminmenu>li.current>a.current:after{border-right-color:#23282d}.mec-admin-dark-mode #mec_calendar_filter .mec-add-booking-tabs-left a.mec-tab-active,.mec-admin-dark-mode #mec_calendar_filter .mec-add-event-tabs-left a.mec-tab-active,.mec-admin-dark-mode #mec_calendar_filter .mec-create-shortcode-tabs-left a.mec-tab-active,.mec-admin-dark-mode #mec_metabox_booking .mec-add-booking-tabs-left a.mec-tab-active,.mec-admin-dark-mode #mec_metabox_booking .mec-add-event-tabs-left a.mec-tab-active,.mec-admin-dark-mode #mec_metabox_booking .mec-create-shortcode-tabs-left a.mec-tab-active,.mec-admin-dark-mode #mec_metabox_details .mec-add-booking-tabs-left a.mec-tab-active,.mec-admin-dark-mode #mec_metabox_details .mec-add-event-tabs-left a.mec-tab-active,.mec-admin-dark-mode #mec_metabox_details .mec-create-shortcode-tabs-left a.mec-tab-active,.mec-admin-dark-mode.m-e-calendar_page_MEC-report .select2-dropdown,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_gateways_form li .mec-gateway-options-form,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #payment_gateways_option li .mec-gateway-options-form,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .select2-container--default .select2-selection--multiple,.mec-admin-dark-mode.post-type-mec_calendars .mec-custom-nice-select ul.list{background:#000;box-shadow:0 2px 12px -5px #000}.mec-admin-dark-mode .extra .w-box-head,.mec-admin-dark-mode .mec-attendees-wrapper .mec-attendees-list .w-clearfix:first-child,.mec-admin-dark-mode .mec-cmsg-2-notification-box-wrap,.mec-admin-dark-mode .mec-cmsg-notification-box-wrap,.mec-admin-dark-mode .mec-form-row ul.mec-message-categories,.mec-admin-dark-mode .mec-message-categories li.mec-acc-label,.mec-admin-dark-mode .w-box,.mec-admin-dark-mode.m-e-calendar_page_MEC-report .mce-btn-group:not(:first-child),.mec-admin-dark-mode.m-e-calendar_page_MEC-report .select2-container--default .select2-search--dropdown .select2-search__field,.mec-admin-dark-mode.m-e-calendar_page_MEC-report .select2-dropdown,.mec-admin-dark-mode.m-e-calendar_page_MEC-report .wp-editor-container,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec-occurrences .mec-occurrences-list li,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_bfixed_form_fields button,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_bfixed_form_fields li,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_event_form_fields button,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_event_form_fields li,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_reg_form_field_types button,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_reg_form_fields li,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .html-active .switch-html,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .mec-custom-msg-notification-set-box.extra,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .select2-container--default .select2-selection--multiple,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .select2-container--default .select2-selection--multiple .select2-selection__choice,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .tmce-active .switch-tmce,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wns-be-container #wns-be-content,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wns-be-container #wns-be-footer,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wns-be-container #wns-be-infobar,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wns-be-container #wns-be-infobar:before,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wns-be-main,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wp-core-ui .quicktags-toolbar input.button.button-small,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wp-editor-container,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wp-switch-editor,.mec-admin-dark-mode.post-type-mec-books #screen-meta,.mec-admin-dark-mode.post-type-mec-books #screen-meta-links .show-settings,.mec-admin-dark-mode.post-type-mec-books .postbox,.mec-admin-dark-mode.post-type-mec-books .postbox .hndle,.mec-admin-dark-mode.post-type-mec-books .postbox hr,.mec-admin-dark-mode.post-type-mec-books .wp-heading-inline+.page-title-action,.mec-admin-dark-mode.post-type-mec-events #major-publishing-actions,.mec-admin-dark-mode.post-type-mec-events #post-status-info,.mec-admin-dark-mode.post-type-mec-events #screen-meta,.mec-admin-dark-mode.post-type-mec-events #screen-meta-links .show-settings,.mec-admin-dark-mode.post-type-mec-events .categorydiv div.tabs-panel,.mec-admin-dark-mode.post-type-mec-events .components-popover__content,.mec-admin-dark-mode.post-type-mec-events .customlinkdiv div.tabs-panel,.mec-admin-dark-mode.post-type-mec-events .edit-post-meta-boxes-area #poststuff .stuffbox>h3,.mec-admin-dark-mode.post-type-mec-events .edit-post-meta-boxes-area #poststuff h2.hndle,.mec-admin-dark-mode.post-type-mec-events .edit-post-meta-boxes-area #poststuff h3.hndle,.mec-admin-dark-mode.post-type-mec-events .postbox,.mec-admin-dark-mode.post-type-mec-events .postbox h2,.mec-admin-dark-mode.post-type-mec-events .posttypediv div.tabs-panel,.mec-admin-dark-mode.post-type-mec-events .taxonomydiv div.tabs-panel,.mec-admin-dark-mode.post-type-mec-events .wp-editor-container,.mec-admin-dark-mode.post-type-mec-events .wp-switch-editor,.mec-admin-dark-mode.post-type-mec-events .wp-tab-active,.mec-admin-dark-mode.post-type-mec-events .wp-tab-panel,.mec-admin-dark-mode.post-type-mec-events div.mce-panel,.mec-admin-dark-mode.post-type-mec-events div.mce-toolbar-grp,.mec-admin-dark-mode.post-type-mec-events ul.add-menu-item-tabs li.tabs,.mec-admin-dark-mode.post-type-mec-events ul.category-tabs li.tabs,.mec-admin-dark-mode.post-type-mec_calendars #major-publishing-actions,.mec-admin-dark-mode.post-type-mec_calendars #post-status-info,.mec-admin-dark-mode.post-type-mec_calendars #screen-meta,.mec-admin-dark-mode.post-type-mec_calendars #screen-meta-links .show-settings,.mec-admin-dark-mode.post-type-mec_calendars .categorydiv div.tabs-panel,.mec-admin-dark-mode.post-type-mec_calendars .customlinkdiv div.tabs-panel,.mec-admin-dark-mode.post-type-mec_calendars .mec-custom-nice-select ul.list,.mec-admin-dark-mode.post-type-mec_calendars .mec-custom-nice-select ul.list li.option,.mec-admin-dark-mode.post-type-mec_calendars .mec-sed-methods li,.mec-admin-dark-mode.post-type-mec_calendars .postbox,.mec-admin-dark-mode.post-type-mec_calendars .postbox h2,.mec-admin-dark-mode.post-type-mec_calendars .posttypediv div.tabs-panel,.mec-admin-dark-mode.post-type-mec_calendars .taxonomydiv div.tabs-panel,.mec-admin-dark-mode.post-type-mec_calendars .wp-editor-container,.mec-admin-dark-mode.post-type-mec_calendars .wp-switch-editor,.mec-admin-dark-mode.post-type-mec_calendars .wp-tab-active,.mec-admin-dark-mode.post-type-mec_calendars .wp-tab-panel,.mec-admin-dark-mode.post-type-mec_calendars div.mce-panel,.mec-admin-dark-mode.post-type-mec_calendars div.mce-toolbar-grp,.mec-admin-dark-mode.post-type-mec_calendars ul.add-menu-item-tabs li.tabs,.mec-admin-dark-mode.post-type-mec_calendars ul.category-tabs li.tabs{border-color:#353535}.mec-admin-dark-mode .notice.notice-warning.is-dismissible{color:#353535}.mec-admin-dark-mode #mec_bfixed_form_fields input[type=checkbox],.mec-admin-dark-mode #mec_calendar_filter .mec-calendar-metabox .wn-mec-select,.mec-admin-dark-mode #mec_calendar_filter .mec-form-row input[type=number],.mec-admin-dark-mode #mec_calendar_filter .mec-form-row input[type=text],.mec-admin-dark-mode #mec_calendar_filter .mec-form-row input[type=url],.mec-admin-dark-mode #mec_calendar_filter .mec-form-row select,.mec-admin-dark-mode #mec_calendar_filter .mec-form-row textarea,.mec-admin-dark-mode #mec_metabox_booking .mec-add-event-tabs-wrap .select2-container,.mec-admin-dark-mode #mec_metabox_booking .mec-calendar-metabox .mec-form-row input[type=checkbox],.mec-admin-dark-mode #mec_metabox_booking .mec-calendar-metabox .wn-mec-select,.mec-admin-dark-mode #mec_metabox_booking .mec-create-shortcode-tab-content .select2-container,.mec-admin-dark-mode #mec_metabox_booking .mec-form-row input[type=number],.mec-admin-dark-mode #mec_metabox_booking .mec-form-row input[type=text],.mec-admin-dark-mode #mec_metabox_booking .mec-form-row input[type=url],.mec-admin-dark-mode #mec_metabox_booking .mec-form-row select,.mec-admin-dark-mode #mec_metabox_booking .mec-form-row textarea,.mec-admin-dark-mode #mec_metabox_booking .mec-form-row.mec-skin-list-date-format-container input[type=text],.mec-admin-dark-mode #mec_metabox_booking .mec-meta-box-fields .mec-form-row input[type=checkbox],.mec-admin-dark-mode #mec_metabox_details .mec-add-event-tabs-wrap .select2-container,.mec-admin-dark-mode #mec_metabox_details .mec-calendar-metabox .mec-form-row input[type=checkbox],.mec-admin-dark-mode #mec_metabox_details .mec-calendar-metabox .wn-mec-select,.mec-admin-dark-mode #mec_metabox_details .mec-create-shortcode-tab-content .select2-container,.mec-admin-dark-mode #mec_metabox_details .mec-form-row input[type=number],.mec-admin-dark-mode #mec_metabox_details .mec-form-row input[type=text],.mec-admin-dark-mode #mec_metabox_details .mec-form-row input[type=url],.mec-admin-dark-mode #mec_metabox_details .mec-form-row select,.mec-admin-dark-mode #mec_metabox_details .mec-form-row textarea,.mec-admin-dark-mode #mec_metabox_details .mec-form-row.mec-skin-list-date-format-container input[type=text],.mec-admin-dark-mode #mec_metabox_details .mec-meta-box-fields .mec-form-row input[type=checkbox],.mec-admin-dark-mode #mec_reg_form_fields input[type=checkbox],.mec-admin-dark-mode .mec-addon-box-version,.mec-admin-dark-mode .mec-backend-tab,.mec-admin-dark-mode .mec-calendar-metabox .wn-mec-select,.mec-admin-dark-mode .mec-form-row input[type=checkbox],.mec-admin-dark-mode .mec-form-row input[type=number],.mec-admin-dark-mode .mec-form-row input[type=radio],.mec-admin-dark-mode .mec-form-row input[type=text],.mec-admin-dark-mode .mec-form-row input[type=url],.mec-admin-dark-mode .mec-form-row select,.mec-admin-dark-mode .mec-form-row textarea,.mec-admin-dark-mode .mec-form-row.mec-skin-list-date-format-container input[type=text],.mec-admin-dark-mode.m-e-calendar_page_MEC-addons,.mec-admin-dark-mode.m-e-calendar_page_MEC-go-pro,.mec-admin-dark-mode.m-e-calendar_page_MEC-report .html-active .switch-html,.mec-admin-dark-mode.m-e-calendar_page_MEC-report .mec-report-select-event-wrap .select2-container--default .select2-selection--single,.mec-admin-dark-mode.m-e-calendar_page_MEC-report .mec-report-sendmail-form-wrap,.mec-admin-dark-mode.m-e-calendar_page_MEC-report .mec-report-sendmail-wrap,.mec-admin-dark-mode.m-e-calendar_page_MEC-report .mec-send-email-form-wrap input.widefat,.mec-admin-dark-mode.m-e-calendar_page_MEC-report .select2-container--default .select2-results__option--highlighted[aria-selected],.mec-admin-dark-mode.m-e-calendar_page_MEC-report .select2-container--default .select2-search--dropdown .select2-search__field,.mec-admin-dark-mode.m-e-calendar_page_MEC-report .tmce-active .switch-tmce,.mec-admin-dark-mode.m-e-calendar_page_MEC-report .wp-switch-editor,.mec-admin-dark-mode.m-e-calendar_page_MEC-report div.mce-toolbar-grp,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec-invoice-custom-css,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_bfixed_form_fields input[type=number],.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_bfixed_form_fields input[type=text],.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_bfixed_form_fields select,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_bfixed_form_fields textarea,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_event_form_fields button,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_event_form_fields input[type=number],.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_event_form_fields input[type=text],.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_event_form_fields select,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_event_form_fields textarea,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_reg_form_field_types button,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_reg_form_fields button,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_reg_form_fields input[type=number],.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_reg_form_fields input[type=text],.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_reg_form_fields select,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_reg_form_fields textarea,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #titlediv #title,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .mec-add-event-tabs-wrap .select2-container,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .mec-add-event-tabs-wrap .select2-container span,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .mec-create-shortcode-tab-content .select2-container,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .mec-create-shortcode-tab-content .select2-container span,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .quicktags-toolbar,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .select2-container--default .select2-selection--multiple,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .select2-container--default.select2-container--focus .select2-selection--multiple,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .select2-dropdown,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .select2-results__option[aria-selected],.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wns-be-main .mec-form-row input[type=email],.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wns-be-main .mec-form-row input[type=number],.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wns-be-main .mec-form-row input[type=password],.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wns-be-main .mec-form-row input[type=search],.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wns-be-main .mec-form-row input[type=text],.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wns-be-main .mec-form-row input[type=url],.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wns-be-main .mec-form-row select,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wp-core-ui .quicktags-toolbar input.button.button-small,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings input[type=checkbox],.mec-admin-dark-mode.m-e-calendar_page_MEC-settings input[type=color],.mec-admin-dark-mode.m-e-calendar_page_MEC-settings input[type=date],.mec-admin-dark-mode.m-e-calendar_page_MEC-settings input[type=datetime-local],.mec-admin-dark-mode.m-e-calendar_page_MEC-settings input[type=datetime],.mec-admin-dark-mode.m-e-calendar_page_MEC-settings input[type=email],.mec-admin-dark-mode.m-e-calendar_page_MEC-settings input[type=month],.mec-admin-dark-mode.m-e-calendar_page_MEC-settings input[type=number],.mec-admin-dark-mode.m-e-calendar_page_MEC-settings input[type=password],.mec-admin-dark-mode.m-e-calendar_page_MEC-settings input[type=radio],.mec-admin-dark-mode.m-e-calendar_page_MEC-settings input[type=search],.mec-admin-dark-mode.m-e-calendar_page_MEC-settings input[type=tel],.mec-admin-dark-mode.m-e-calendar_page_MEC-settings input[type=text],.mec-admin-dark-mode.m-e-calendar_page_MEC-settings input[type=time],.mec-admin-dark-mode.m-e-calendar_page_MEC-settings input[type=url],.mec-admin-dark-mode.m-e-calendar_page_MEC-settings input[type=week],.mec-admin-dark-mode.m-e-calendar_page_MEC-settings select,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings textarea,.mec-admin-dark-mode.post-type-mec-books .wn-mec-select,.mec-admin-dark-mode.post-type-mec-books input[type=checkbox],.mec-admin-dark-mode.post-type-mec-books input[type=email],.mec-admin-dark-mode.post-type-mec-books input[type=number],.mec-admin-dark-mode.post-type-mec-books input[type=text],.mec-admin-dark-mode.post-type-mec-books input[type=url],.mec-admin-dark-mode.post-type-mec-books select,.mec-admin-dark-mode.post-type-mec-books textarea,.mec-admin-dark-mode.post-type-mec-events #mec_event_form_fields button,.mec-admin-dark-mode.post-type-mec-events #mec_reg_form_field_types button,.mec-admin-dark-mode.post-type-mec-events #mec_reg_form_fields button,.mec-admin-dark-mode.post-type-mec-events #titlediv #title,.mec-admin-dark-mode.post-type-mec-events .components-form-token-field__input-container,.mec-admin-dark-mode.post-type-mec-events .components-panel__body,.mec-admin-dark-mode.post-type-mec-events .mec-add-event-tabs-wrap .select2-container span,.mec-admin-dark-mode.post-type-mec-events .mec-certain-day>div,.mec-admin-dark-mode.post-type-mec-events .mec-create-shortcode-tab-content .select2-container span,.mec-admin-dark-mode.post-type-mec-events .mec-xi-facebook-import-events .mec-select-deselect-actions li,.mec-admin-dark-mode.post-type-mec-events .mec-xi-google-import-events .mec-select-deselect-actions li,.mec-admin-dark-mode.post-type-mec-events .select2-dropdown,.mec-admin-dark-mode.post-type-mec-events .select2-results__option[aria-selected],.mec-admin-dark-mode.post-type-mec-events .wp-admin p label input[type=checkbox],.mec-admin-dark-mode.post-type-mec-events input[type=checkbox],.mec-admin-dark-mode.post-type-mec-events input[type=color],.mec-admin-dark-mode.post-type-mec-events input[type=date],.mec-admin-dark-mode.post-type-mec-events input[type=datetime-local],.mec-admin-dark-mode.post-type-mec-events input[type=datetime],.mec-admin-dark-mode.post-type-mec-events input[type=email],.mec-admin-dark-mode.post-type-mec-events input[type=month],.mec-admin-dark-mode.post-type-mec-events input[type=number],.mec-admin-dark-mode.post-type-mec-events input[type=password],.mec-admin-dark-mode.post-type-mec-events input[type=radio],.mec-admin-dark-mode.post-type-mec-events input[type=search],.mec-admin-dark-mode.post-type-mec-events input[type=tel],.mec-admin-dark-mode.post-type-mec-events input[type=text],.mec-admin-dark-mode.post-type-mec-events input[type=time],.mec-admin-dark-mode.post-type-mec-events input[type=url],.mec-admin-dark-mode.post-type-mec-events input[type=week],.mec-admin-dark-mode.post-type-mec-events select,.mec-admin-dark-mode.post-type-mec-events textarea,.mec-admin-dark-mode.post-type-mec_calendars #titlediv #title,.mec-admin-dark-mode.post-type-mec_calendars .mec-add-event-tabs-wrap .select2-container,.mec-admin-dark-mode.post-type-mec_calendars .mec-add-event-tabs-wrap .select2-container span,.mec-admin-dark-mode.post-type-mec_calendars .mec-create-shortcode-tab-content .select2-container,.mec-admin-dark-mode.post-type-mec_calendars .mec-create-shortcode-tab-content .select2-container span,.mec-admin-dark-mode.post-type-mec_calendars .select2-container--default .select2-selection--multiple .select2-selection__choice,.mec-admin-dark-mode.post-type-mec_calendars .select2-dropdown,.mec-admin-dark-mode.post-type-mec_calendars .select2-results__option[aria-selected],.mec-admin-dark-mode.post-type-mec_calendars input[type=checkbox],.mec-admin-dark-mode.post-type-mec_calendars input[type=color],.mec-admin-dark-mode.post-type-mec_calendars input[type=date],.mec-admin-dark-mode.post-type-mec_calendars input[type=datetime-local],.mec-admin-dark-mode.post-type-mec_calendars input[type=datetime],.mec-admin-dark-mode.post-type-mec_calendars input[type=email],.mec-admin-dark-mode.post-type-mec_calendars input[type=month],.mec-admin-dark-mode.post-type-mec_calendars input[type=number],.mec-admin-dark-mode.post-type-mec_calendars input[type=password],.mec-admin-dark-mode.post-type-mec_calendars input[type=radio],.mec-admin-dark-mode.post-type-mec_calendars input[type=search],.mec-admin-dark-mode.post-type-mec_calendars input[type=tel],.mec-admin-dark-mode.post-type-mec_calendars input[type=text],.mec-admin-dark-mode.post-type-mec_calendars input[type=time],.mec-admin-dark-mode.post-type-mec_calendars input[type=url],.mec-admin-dark-mode.post-type-mec_calendars input[type=week],.mec-admin-dark-mode.post-type-mec_calendars select,.mec-admin-dark-mode.post-type-mec_calendars textarea,.mec-admin-dark-mode.toplevel_page_mec-intro .w-box.mec-activation input[name=MECPurchaseCode],.mec-admin-dark-mode.toplevel_page_mec-intro .w-box.mec-activation input[type=radio]+label span,.mec-select-deselect-actions li{background:#1d1d1d;border-color:#353535;color:#d2d2d2}.mec-admin-dark-mode .mec-b-active-tab{background:#505050;color:#dbdbdb}.mec-admin-dark-mode #mec_metabox_booking .mec-form-row input[type=checkbox]:checked,.mec-admin-dark-mode #mec_metabox_details .mec-form-row input[type=checkbox]:checked,.mec-admin-dark-mode .mec-custom-nice-select ul.list li .wn-mec-text:after,.mec-admin-dark-mode .mec-sed-methods li:before{box-shadow:0 1px 6px -2px #000;border-color:#353535;background:#222}.mec-admin-dark-mode .mec-sed-methods li.active,.mec-admin-dark-mode .mec-switcher input+label,.mec-admin-dark-mode .mec-switcher input+label:before,.mec-admin-dark-mode.m-e-calendar_page_MEC-report .select2-container--default .select2-results__option{background-color:#000}.mec-admin-dark-mode .wn-mec-select .option.focus .wn-img-sh img,.mec-admin-dark-mode .wn-mec-select .option.selected.focus .wn-img-sh img,.mec-admin-dark-mode .wn-mec-select .option:hover .wn-img-sh img{background:0 0}.mec-admin-dark-mode .ui-datepicker{background-color:#000;border:1px solid #000;box-shadow:0 0 8px rgba(33,33,33,.6)}.mec-admin-dark-mode .ui-datepicker.ui-widget td a,.mec-admin-dark-mode .w-box.upcoming-events .mec-event-article .mec-detail-button,.mec-admin-dark-mode.post-type-mec-events,.mec-admin-dark-mode.post-type-mec-events .postbox h2,.mec-admin-dark-mode.post-type-mec_calendars .postbox h2{color:#d2d2d2;background:#282828}.mec-admin-dark-mode #mec-advanced-wraper div:first-child>ul *{background:#282828}.mec-admin-dark-mode #mec-advanced-wraper div:first-child>ul>ul>li,.mec-admin-dark-mode #mec_styles_form #mec_styles_CSS,.mec-admin-dark-mode .mec-attendees-wrapper .mec-attendees-list .w-clearfix,.mec-admin-dark-mode .mec-message-categories li.mec-acc-label,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_bfixed_form_fields,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_event_form_fields,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_reg_form_fields{background:#000}.mec-admin-dark-mode #mec-advanced-wraper div:first-child>ul>ul>li:hover,.mec-admin-dark-mode .mec-active,.mec-admin-dark-mode.post-type-mec-events .select2-container--default .select2-results__option--highlighted[aria-selected]{background:#888!important}.mec-admin-dark-mode.post-type-mec_calendars .mec-calendar-metabox .wn-mec-select .list{border-radius:0 0 2px 2px;box-shadow:0 0 0 1px #353535,0 2px 6px rgba(0,0,0,.07)}.mec-admin-dark-mode #mec_calendar_filter .mec-add-booking-tabs-right,.mec-admin-dark-mode #mec_calendar_filter .mec-add-event-tabs-right,.mec-admin-dark-mode #mec_calendar_filter .mec-create-shortcode-tabs-right,.mec-admin-dark-mode #mec_calendar_filter .ui-sortable-handle,.mec-admin-dark-mode #mec_gateways_form li .mec-gateway-options-form,.mec-admin-dark-mode #mec_metabox_booking .mec-add-booking-tabs-right,.mec-admin-dark-mode #mec_metabox_booking .mec-add-event-tabs-right,.mec-admin-dark-mode #mec_metabox_booking .mec-create-shortcode-tabs-right,.mec-admin-dark-mode #mec_metabox_booking .ui-sortable-handle,.mec-admin-dark-mode #mec_metabox_details .mec-add-booking-tabs-right,.mec-admin-dark-mode #mec_metabox_details .mec-add-event-tabs-right,.mec-admin-dark-mode #mec_metabox_details .mec-create-shortcode-tabs-right,.mec-admin-dark-mode #mec_metabox_details .ui-sortable-handle,.mec-admin-dark-mode #payment_gateways_option li .mec-gateway-options-form,.mec-admin-dark-mode .mec-meta-box-fields h4{border-color:#000!important}.mec-admin-dark-mode .wns-be-container,.mec-admin-dark-mode.m-e-calendar_page_MEC-report .mec-report-selected-event-attendees-wrap .w-clearfix.mec-attendees-content,.mec-admin-dark-mode.post-type-mec-events #wp-content-editor-tools,.mec-admin-dark-mode.post-type-mec_calendars,.mec-admin-dark-mode.post-type-mec_calendars .wn-mec-select .list{background-color:#282828;border-color:#353535}.mec-admin-dark-mode .mec-intro-section-ifarme iframe,.mec-admin-dark-mode.m-e-calendar_page_MEC-report .mec-report-selected-event-attendees-wrap .w-clearfix.mec-attendees-head,.mec-admin-dark-mode.m-e-calendar_page_MEC-support .fserv-container,.mec-admin-dark-mode.m-e-calendar_page_MEC-support .fserv-container *,.mec-admin-dark-mode.toplevel_page_mec-intro .fserv-container,.mec-admin-dark-mode.toplevel_page_mec-intro .fserv-container *{background:#1f1f1f!important;border-color:#353535!important}.mec-admin-dark-mode .fserv-field input.fserv-input-text{background:#000!important}.mec-admin-dark-mode .block-editor-block-types-list__item-icon,.mec-admin-dark-mode .block-editor-block-types-list__item-title,.mec-admin-dark-mode .w-box.upcoming-events .mec-event-article h4.mec-event-title,.mec-admin-dark-mode.m-e-calendar_page_MEC-report .mec-report-selected-event-attendees-wrap .w-clearfix.mec-attendees-content,.mec-admin-dark-mode.m-e-calendar_page_MEC-report .select2-container--default .select2-selection--single .select2-selection__rendered,.mec-admin-dark-mode.m-e-calendar_page_MEC-support .about-wrap h3,.mec-admin-dark-mode.m-e-calendar_page_MEC-support .fserv-container .fserv-form-name,.mec-admin-dark-mode.toplevel_page_mec-intro .about-wrap h3,.mec-admin-dark-mode.toplevel_page_mec-intro .fserv-container .fserv-form-name{color:#d2d2d2!important}.mec-admin-dark-mode .wns-be-sidebar li a:hover,.mec-admin-dark-mode .wns-be-sidebar li:hover,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .html-active .switch-html,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .tmce-active .switch-tmce,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wp-switch-editor,.mec-admin-dark-mode.post-type-mec_calendars .wn-mec-select .option:hover{background:#000;color:#d2d2d2}.mec-admin-dark-mode .wns-be-sidebar li a,.mec-admin-dark-mode.m-e-calendar_page_MEC-ix h1,.mec-admin-dark-mode.m-e-calendar_page_MEC-ix h2,.mec-admin-dark-mode.m-e-calendar_page_MEC-ix h3,.mec-admin-dark-mode.m-e-calendar_page_MEC-ix h4,.mec-admin-dark-mode.m-e-calendar_page_MEC-report .mec-report-selected-event-attendees-wrap .w-clearfix.mec-attendees-head span,.mec-admin-dark-mode.m-e-calendar_page_MEC-report h2,.mec-admin-dark-mode.m-e-calendar_page_MEC-report h4,.mec-admin-dark-mode.m-e-calendar_page_MEC-support #webnus-dashboard .mec-faq-accordion-trigger a,.mec-admin-dark-mode.post-type-mec-books .postbox h1,.mec-admin-dark-mode.post-type-mec-books .postbox h2,.mec-admin-dark-mode.post-type-mec-books .postbox h3,.mec-admin-dark-mode.post-type-mec-events .components-panel__body-toggle.components-button,.mec-admin-dark-mode.post-type-mec-events .wrap h1.wp-heading-inline,.mec-admin-dark-mode.post-type-mec_calendars .mec-custom-nice-select ul.list li.option .wn-mec-text{color:#d2d2d2}.mec-admin-dark-mode .wns-be-sidebar .wns-be-group-menu>li.active>a,.mec-admin-dark-mode .wns-be-sidebar .wns-be-group-menu>li.active>a:hover{border:none}.mec-admin-dark-mode .wns-be-sidebar li.active ul.subsection{background:#282828;border-bottom:1px solid #353535}.mec-admin-dark-mode .wns-be-sidebar li .subsection a{background:#282828;color:#636363;opacity:1;font-size:12px;padding:6px 4px 6px 46px}.mec-admin-dark-mode .wns-be-sidebar .wns-be-group-menu>li.active>a,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wns-be-container #wns-be-infobar,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wns-be-main{box-shadow:0 2px 12px -5px #000}.mec-admin-dark-mode .wns-be-sidebar .mec-settings-menu .mec-settings-submenu a,.mec-admin-dark-mode li.wns-be-group-menu-li.mec-settings-menu .mec-settings-submenu,.mec-admin-dark-mode.post-type-mec_calendars .wn-mec-select .option.focus,.mec-admin-dark-mode.post-type-mec_calendars .wn-mec-select .option.selected.focus,.mec-admin-dark-mode.post-type-mec_calendars .wn-mec-select .option:hover{background:#000;color:#d2d2d2;border-color:#353535}.mec-admin-dark-mode.m-e-calendar_page_MEC-settings,.mec-admin-dark-mode.post-type-mec_calendars .mec-custom-nice-select ul.list li.option{background:#000!important;color:#fff!important}.mec-admin-dark-mode.m-e-calendar_page_MEC-addons,.mec-admin-dark-mode.m-e-calendar_page_MEC-addons .about-wrap h1,.mec-admin-dark-mode.m-e-calendar_page_MEC-go-pro,.mec-admin-dark-mode.m-e-calendar_page_MEC-go-pro h1,.mec-admin-dark-mode.m-e-calendar_page_MEC-ix,.mec-admin-dark-mode.m-e-calendar_page_MEC-ix h1,.mec-admin-dark-mode.m-e-calendar_page_MEC-report,.mec-admin-dark-mode.m-e-calendar_page_MEC-report h1,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings div.mce-panel,.mec-admin-dark-mode.m-e-calendar_page_MEC-support,.mec-admin-dark-mode.m-e-calendar_page_MEC-support h1,.mec-admin-dark-mode.post-type-mec-books,.mec-admin-dark-mode.post-type-mec-books h1,.mec-admin-dark-mode.post-type-mec_calendars,.mec-admin-dark-mode.post-type-mec_calendars .wrap h1.wp-heading-inline,.mec-admin-dark-mode.toplevel_page_mec-intro,.mec-admin-dark-mode.toplevel_page_mec-intro .about-wrap h1{background:#282828!important;color:#d2d2d2}.mec-admin-dark-mode .w-theme-version{background:#1f1f1f}.mec-admin-dark-mode .mec-sed-methods li.active,.mec-admin-dark-mode .wns-be-container .wns-be-group-tab h2,.mec-admin-dark-mode .wns-be-container .wns-be-group-tab h4,.mec-admin-dark-mode.m-e-calendar_page_MEC-ix #mec-wrap .nav-tab-wrapper,.mec-admin-dark-mode.m-e-calendar_page_MEC-ix #mec-wrap .nav-tab-wrapper .nav-tab,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .select2-container--default .select2-selection--multiple .select2-selection__choice{color:#d2d2d2}.mec-admin-dark-mode .wns-be-sidebar .wns-be-group-menu li a:hover{color:#07bbe9}.mec-admin-dark-mode.m-e-calendar_page_MEC-ix #mec-wrap .nav-tab-wrapper .nav-tab-active{background:#008aff;background:linear-gradient(95deg,#36a2ff 0,#008aff 50%,#0072ff 100%)}.mec-admin-dark-mode .wns-be-container #wns-be-infobar:before{content:"";width:261px;height:78px;display:block;position:absolute;left:0;top:0;background:#1f1f1f url(../img/webnus-logo2.png) no-repeat center;border-bottom:1px solid #dedede;background-size:220px;z-index:997}.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .mec-custom-msg-notification-set-box.extra,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wns-be-container #wns-be-footer,.mec-admin-dark-mode.post-type-mec-books #titlediv #title,.mec-admin-dark-mode.post-type-mec-books .postbox h1{background:#1f1f1f!important}.mec-admin-dark-mode .mec-settings-menu .mec-settings-submenu:after,.mec-admin-dark-mode .wns-be-sidebar .wns-be-group-menu li .subsection li.active a:after,.mec-admin-dark-mode .wns-be-sidebar .wns-be-group-menu li .subsection li.active a:before{border-right-color:#353535}.mec-admin-dark-mode .mec-switcher input:checked+label:before{background-color:#d2d2d2;box-shadow:2px 2px 12px -2px #ccc inset}.mec-admin-dark-mode .mec-switcher input:checked+label{box-shadow:0 3px 11px -7px #000}.mec-admin-dark-mode .lity.mec-add-event-popup,.mec-admin-dark-mode .lity.mec-add-shortcode-popup,.mec-admin-dark-mode .mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup,.mec-admin-dark-mode .mec-add-shortcode-popup div#mec_popup_shortcode{background:#282828}.mec-admin-dark-mode .lity.mec-add-event-popup .lity-content,.mec-admin-dark-mode .lity.mec-add-shortcode-popup .lity-content{box-shadow:0 3px 20px 0 rgba(0,0,0,.55)}.mec-admin-dark-mode .mec-add-event-popup .mec-meta-box-colors-container,.mec-admin-dark-mode .mec-steps-container,.mec-admin-dark-mode .mec-steps-header{background:#000}.mec-admin-dark-mode .mec-add-event-popup div#mec_popup_event,.mec-admin-dark-mode .mec-steps-panel{background:#1f1f1f}.mec-admin-dark-mode button.lity-close{background:#000;box-shadow:0 3px 8px 0 rgba(0,0,0,.55)}.mec-admin-dark-mode .mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-2 .mec-steps-content.mec-steps-content-2 ul li{border:2px solid #282828;background:#000!important}.mec-admin-dark-mode .mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-2 .mec-step-popup-skin-text:before,.mec-admin-dark-mode .mec-add-shortcode-popup .mec-steps-content.mec-steps-content-4 label input{background:#282828;border-color:#1f1f1f;box-shadow:0 3px 6px 0 rgba(0,0,0,.05)}.mec-admin-dark-mode .mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-2 .mec-steps-content.mec-steps-content-2 ul li.active{box-shadow:0 3px 5px rgba(0,0,0,.2)}.mec-admin-dark-mode .nicescroll-cursors{background-color:#000!important}.mec-admin-dark-mode .mec-add-event-popup .mec-categories-tab-contents,.mec-admin-dark-mode .mec-add-event-popup .mec-form-row.mec-available-color-row,.mec-admin-dark-mode .mec-add-event-popup .mec-steps-content.mec-steps-content-7.mec-steps-content-active,.mec-admin-dark-mode .mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .mec-steps-content.mec-steps-content-4 .mec-multiple-skin-options div,.mec-admin-dark-mode .mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-6 .mec-popup-shortcode{border-color:#282828;background:#000}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-6 .mec-popup-shortcode-code{background:rgba(266,266,266,.35)}.mec-admin-dark-mode .mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-6 .mec-popup-shortcode-code code,.mec-admin-dark-mode .mec-steps-content h3{color:#d2d2d2}.mec-admin-dark-mode .mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup .option.focus,.mec-admin-dark-mode .mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup .option.selected.focus,.mec-admin-dark-mode .mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup .option:hover{background:#000}.mec-admin-dark-mode .mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup .list{background:#282828}.mec-admin-dark-mode .mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup .list::-webkit-scrollbar-track{background-color:#333}.mec-admin-dark-mode .mec-add-event-popup .mec-steps-content-container .wn-mec-select-popup .list::-webkit-scrollbar{width:3px;background-color:#333}.mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-6 .mec-popup-shortcode-code button{margin-left:unset}.mec-admin-dark-mode .wp-picker-container .wp-color-result.button{background:inherit}.mec-admin-dark-mode .mec-add-event-popup .mec-steps-content.mec-steps-content-6 .mce-container-body.mce-stack-layout{background:#000;border-color:#000!important}.mec-admin-dark-mode .mec-add-shortcode-popup .mec-steps-content-container.mec-steps-content-4 .wn-mec-select-popup{background-color:#000;border-color:#282828}.mec-admin-dark-mode #wns-be-content .noresults label,.mec-admin-dark-mode #wns-be-content .results .results .noresults label,.mec-admin-dark-mode #wns-be-content ul li.disable,.mec-admin-dark-mode #wns-be-content ul li.disable label{color:#666}.mec-admin-dark-mode #wns-be-content .results .results .results label,.mec-admin-dark-mode #wns-be-content .results label,.mec-admin-dark-mode #wns-be-content ul li.enable,.mec-admin-dark-mode #wns-be-content ul li.enable label{color:#fff}.mec-admin-dark-mode.post-type-mec-books table.widefat,.mec-admin-dark-mode.post-type-mec_calendars table.widefat,.post-type-mec-events.mec-admin-dark-mode table.widefat{background:#1f1f1f;border-color:#353535;color:#d2d2d2}.mec-admin-dark-mode.post-type-mec-books .striped>tbody>:nth-child(odd),.mec-admin-dark-mode.post-type-mec-books ul.striped>:nth-child(odd),.mec-admin-dark-mode.post-type-mec-events .striped>tbody>:nth-child(odd),.mec-admin-dark-mode.post-type-mec-events ul.striped>:nth-child(odd),.mec-admin-dark-mode.post-type-mec_calendars .striped>tbody>:nth-child(odd),.mec-admin-dark-mode.post-type-mec_calendars ul.striped>:nth-child(odd){background:#282828;border-color:#353535;color:#d2d2d2}.mec-admin-dark-mode.post-type-mec-books .widefat td,.mec-admin-dark-mode.post-type-mec-books .widefat th,.mec-admin-dark-mode.post-type-mec-events .widefat td,.mec-admin-dark-mode.post-type-mec-events .widefat th,.mec-admin-dark-mode.post-type-mec_calendars .widefat td,.mec-admin-dark-mode.post-type-mec_calendars .widefat th{border-color:#000;color:#d2d2d2}.mec-admin-dark-mode.m-e-calendar_page_MEC-settings ul#adminmenu a.wp-has-current-submenu:after,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings ul#adminmenu>li.current>a.current:after,.mec-admin-dark-mode.post-type-mec-events ul#adminmenu a.wp-has-current-submenu:after,.mec-admin-dark-mode.post-type-mec-events ul#adminmenu>li.current>a.current:after,.mec-admin-dark-mode.post-type-mec_calendars ul#adminmenu a.wp-has-current-submenu:after,.mec-admin-dark-mode.post-type-mec_calendars ul#adminmenu>li.current>a.current:after{border-right-color:#1f1f1f}.mec-admin-dark-mode #mec_add_fee_button,.mec-admin-dark-mode #mec_add_ticket_variation_button,.mec-admin-dark-mode #mec_bfixed_form_field_types button,.mec-admin-dark-mode #mec_bfixed_form_fields button,.mec-admin-dark-mode #mec_event_form_field_types button,.mec-admin-dark-mode #mec_event_form_fields button,.mec-admin-dark-mode #mec_meta_box_downloadable_file_options #mec_downloadable_file_remove_image_button,.mec-admin-dark-mode #mec_reg_form_field_types button,.mec-admin-dark-mode #mec_reg_form_fields button,.mec-admin-dark-mode #taxes_option #mec_fees_list .mec-form-row .button,.mec-admin-dark-mode #ticket_variations_option #mec_ticket_variations_list .mec-form-row .button,.mec-admin-dark-mode .mec-export-settings,.mec-admin-dark-mode .mec-import-settings,.mec-admin-dark-mode .mec-meta-box-fields .mec-form-row .button:not(.wp-color-result),.mec-admin-dark-mode .mec-occurrences-wrapper .button:not(.wp-color-result),.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .button,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .button-secondary,.mec-admin-dark-mode.post-type-mec-books .button,.mec-admin-dark-mode.post-type-mec-books .wp-heading-inline+.page-title-action,.mec-admin-dark-mode.post-type-mec-events .button,.mec-admin-dark-mode.post-type-mec-events .button-secondary,.mec-admin-dark-mode.post-type-mec-events .wp-heading-inline+.page-title-action,.mec-admin-dark-mode.post-type-mec_calendars .button,.mec-admin-dark-mode.post-type-mec_calendars .wp-heading-inline+.page-title-action{color:#d2d2d2!important;border-color:#353535!important;background:#000}.mec-admin-dark-mode #mec_add_fee_button:hover,.mec-admin-dark-mode #mec_add_ticket_variation_button:hover,.mec-admin-dark-mode #mec_bfixed_form_field_types button:hover,.mec-admin-dark-mode #mec_bfixed_form_fields button:hover,.mec-admin-dark-mode #mec_event_form_field_types button:hover,.mec-admin-dark-mode #mec_event_form_fields button:hover,.mec-admin-dark-mode #mec_meta_box_downloadable_file_options #mec_downloadable_file_remove_image_button:hover,.mec-admin-dark-mode #mec_reg_form_field_types button:hover,.mec-admin-dark-mode #mec_reg_form_fields button:hover,.mec-admin-dark-mode #taxes_option #mec_fees_list .mec-form-row .button:hover,.mec-admin-dark-mode #ticket_variations_option #mec_ticket_variations_list .mec-form-row .button:hover,.mec-admin-dark-mode .mec-export-settings:hover,.mec-admin-dark-mode .mec-import-settings:hover,.mec-admin-dark-mode .mec-meta-box-fields .mec-form-row .button:not(.wp-color-result):hover,.mec-admin-dark-mode .mec-occurrences-wrapper .button:not(.wp-color-result):hover,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .button-secondary:hover,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .button.hover,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .button:hover,.mec-admin-dark-mode.post-type-mec-events .button-secondary:hover,.mec-admin-dark-mode.post-type-mec-events .button.hover,.mec-admin-dark-mode.post-type-mec-events .button:hover,.mec-admin-dark-mode.post-type-mec_calendars .button-secondary:hover,.mec-admin-dark-mode.post-type-mec_calendars .button.hover,.mec-admin-dark-mode.post-type-mec_calendars .button:hover{background:#111;border-color:#333!important;color:#fff}.mec-admin-dark-mode.post-type-mec-events .mec-form-row .button:not(.wp-color-result){height:37px;margin-top:1px;box-shadow:inset 0 2px 4px #282828,inset 0 -2px 4px rgba(0,0,0,.05),0 2px 2px rgba(0,0,0,.06)}.mec-admin-dark-mode.m-e-calendar_page_MEC-settings .wp-color-result-text,.mec-admin-dark-mode.post-type-mec-events .wp-color-result-text{border-left:1px solid #353535;color:#d2d2d2;background:#000}.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec-search-settings{color:#d2d2d2;background:#282828}.mec-admin-dark-mode.taxonomy-mec_category .button,.mec-admin-dark-mode.taxonomy-mec_label .button,.mec-admin-dark-mode.taxonomy-mec_location .button,.mec-admin-dark-mode.taxonomy-mec_organizer .button,.mec-admin-dark-mode.taxonomy-mec_speaker .button,.mec-admin-dark-mode.taxonomy-mec_sponsor .button,.mec-admin-dark-mode.taxonomy-mec_tag .button{box-shadow:0 3px 10px -4px #000!important}.mec-admin-dark-mode.post-type-mec_calendars .mec-switcher input+label:after,.mec-admin-dark-mode.post-type-mec_calendars .wn-mec-select .option .wn-hover-img-sh img{background:#282828}.mec-admin-dark-mode .attachment-info,.mec-admin-dark-mode .media-frame-toolbar .media-toolbar{border-color:#282828}.mec-admin-dark-mode #webnus-dashboard .welcome-head img,.mec-admin-dark-mode .mce-content-body{background-color:#000!important}.mec-admin-dark-mode .w-box.upcoming-events .mec-event-article{border-bottom:1px solid #444}.mec-admin-dark-mode #webnus-dashboard a,.mec-admin-dark-mode #webnus-dashboard pre,.mec-admin-dark-mode .extra .w-box-head,.mec-admin-dark-mode .mec-addons-notification-box-content.mec-new-addons a,.mec-admin-dark-mode .mec-form-row label,.mec-admin-dark-mode .mec-form-row span,.mec-admin-dark-mode .mec-meta-box-fields h4,.mec-admin-dark-mode .mec-meta-box-fields label,.mec-admin-dark-mode .mec-meta-box-fields p,.mec-admin-dark-mode .mec-meta-box-fields span,.mec-admin-dark-mode .mec-meta-box-fields strong,.mec-admin-dark-mode .mec-new-addons .mec-addons-notification-title,.mec-admin-dark-mode .mec-new-addons p,.mec-admin-dark-mode .mec-new-addons strong,.mec-admin-dark-mode .w-box-content p,.mec-admin-dark-mode .w-box.doc,.mec-admin-dark-mode .w-box.total-bookings ul li,.mec-admin-dark-mode .w-box.total-bookings ul li a,.mec-admin-dark-mode .wns-be-sidebar .mec-settings-menu .mec-settings-submenu a,.mec-admin-dark-mode.m-e-calendar_page_MEC-settings #mec_reg_form_field_types button{color:#d2d2d2!important}.mec-admin-dark-mode .mec-addons-notification-box-content.mec-new-addons a{box-shadow:0 0 0 3px rgb(255 255 255 / 24%)!important}.mec-admin-dark-mode #webnus-dashboard .mec-event-detail{color:#444}.mec-admin-dark-mode #webnus-dashboard .mec-intro-section .mec-intro-section-link-tag{border-color:#2d2d2d}.mec-admin-dark-mode #webnus-dashboard .mec-intro-section .mec-intro-section-link-tag{color:#282828!important}.mec-admin-dark-mode #webnus-dashboard .mec-intro-section .mec-intro-section-link-tag:hover{color:#fff!important}.mec-admin-dark-mode #webnus-dashboard .mec-intro-section .mec-intro-section-link-tag:nth-child(2):hover,.mec-admin-dark-mode #webnus-dashboard .mec-intro-section .mec-intro-section-link-tag:nth-child(3):hover{color:#999!important}.mec-admin-dark-mode .mec-addons-notification-box-content.mec-new-addons a,.mec-admin-dark-mode .w-box.total-bookings ul li{background:#333;box-shadow:0 2px 3px -2px #000}.mec-admin-dark-mode .mec-addons-notification-box-content.mec-new-addons a:hover,.mec-admin-dark-mode .w-box.total-bookings ul li:hover{background:#000}.mec-admin-dark-mode #webnus-dashboard .total-bookings input[type=text],.mec-admin-dark-mode #webnus-dashboard .total-bookings select{background:#000;color:#999;border-color:#111}.mec-admin-dark-mode #mec_category-add-toggle,.mec-admin-dark-mode #sample-permalink a,.mec-admin-dark-mode #set-post-thumbnail,.mec-admin-dark-mode .button-link,.mec-admin-dark-mode .category-tabs a,.mec-admin-dark-mode .mec-add-booking-tabs-left a,.mec-admin-dark-mode .mec-add-event-tabs-left a,.mec-admin-dark-mode .mec-create-shortcode-tabs-left a,.mec-admin-dark-mode.post-type-mec-events .wp-list-table .row-title,.mec-admin-dark-mode.post-type-mec_calendars .wp-list-table .row-title{color:#888!important}.mec-admin-dark-mode .mec-add-booking-tabs-left a.mec-tab-active,.mec-admin-dark-mode .mec-add-event-tabs-left a.mec-tab-active,.mec-admin-dark-mode .mec-create-shortcode-tabs-left a.mec-tab-active{color:#00b0dd}.mec-admin-dark-mode #TB_title,.mec-admin-dark-mode #TB_window{background:#000}.mec-admin-dark-mode #webnus-dashboard .welcome-head img,.mec-admin-dark-mode .webnus-icons-list li:hover{background:#111}.mec-admin-dark-mode #TB_window i{color:#999}.mec-admin-dark-mode #TB_title,.mec-admin-dark-mode .webnus-icons-list li label{border:unset!important}.mec-admin-dark-mode.post-type-mec-books .notice-success,.mec-admin-dark-mode.post-type-mec-books div.updated,.mec-admin-dark-mode.post-type-mec-events .notice-success,.mec-admin-dark-mode.post-type-mec-events div.updated,.mec-admin-dark-mode.post-type-mec_calendars .notice-success,.mec-admin-dark-mode.post-type-mec_calendars div.updated{background:#111;border-top:unset;border-bottom:unset}.mec-admin-dark-mode.post-type-mec-books input,.mec-admin-dark-mode.post-type-mec-events input,.mec-admin-dark-mode.post-type-mec_calendars input{background:#000;color:#888}.mec-admin-dark-mode.post-type-mec-books .subsubsub a,.mec-admin-dark-mode.post-type-mec-events .media-router .media-menu-item,.mec-admin-dark-mode.post-type-mec-events .subsubsub a,.mec-admin-dark-mode.post-type-mec_calendars .subsubsub a{color:#2271b1}.mec-admin-dark-mode.post-type-mec-books .subsubsub a:hover,.mec-admin-dark-mode.post-type-mec-events .media-router .media-menu-item:hover,.mec-admin-dark-mode.post-type-mec-events .subsubsub a:hover,.mec-admin-dark-mode.post-type-mec_calendars .subsubsub a:hover{color:#135e96}.mec-admin-dark-mode #mec_calendar_filter .mec-create-shortcode-tabs-left a,.mec-admin-dark-mode #mec_metabox_booking .mec-add-booking-tabs-left a,.mec-admin-dark-mode #mec_metabox_details .mec-add-event-tabs-left a,.mec-admin-dark-mode.post-type-mec-events #set-post-thumbnail,.mec-admin-dark-mode.post-type-mec-events .attachment-info .filename{color:#888}.mec-admin-dark-mode #mec_calendar_filter .mec-create-shortcode-tabs-left a:hover,.mec-admin-dark-mode #mec_metabox_booking .mec-add-booking-tabs-left a:hover,.mec-admin-dark-mode #mec_metabox_details .mec-add-event-tabs-left a:hover,.mec-admin-dark-mode.post-type-mec-events #set-post-thumbnail:hover{color:#a9a9a9}.mec-admin-dark-mode #webnus-dashboard .welcome-head img,.mec-admin-dark-mode .w-theme-version,.mec-admin-dark-mode.post-type-mec_calendars .mec-switcher input+label:after{border-color:#444}.mec-admin-dark-mode.post-type-mec-books .postbox-header,.mec-admin-dark-mode.post-type-mec-events .postbox-header,.mec-admin-dark-mode.post-type-mec_calendars .postbox-header{border-color:#000}.mec-admin-dark-mode.post-type-mec-events .inside div div>a.mec-tab-active:after,.mec-admin-dark-mode.post-type-mec-events .inside div div>a.mec-tab-active:before,.mec-admin-dark-mode.post-type-mec_calendars .inside div div>a.mec-tab-active:after,.mec-admin-dark-mode.post-type-mec_calendars .inside div div>a.mec-tab-active:before{border-right-color:#2d2d2d}.mec-admin-dark-mode .mec-form-row input[type=radio]{box-shadow:0 1px 10px -2px #000}.mec-admin-dark-mode.post-type-mec-books .form-wrap label,.mec-admin-dark-mode.post-type-mec-books .media-frame-title h1,.mec-admin-dark-mode.post-type-mec-books h2,.mec-admin-dark-mode.post-type-mec-events .form-wrap label,.mec-admin-dark-mode.post-type-mec-events .media-frame-title h1,.mec-admin-dark-mode.post-type-mec-events h2{color:#d2d2d2}.mec-admin-dark-mode.post-type-mec-books.taxonomy-mec_coupon .button,.mec-admin-dark-mode.post-type-mec-events.taxonomy-post_tag .button{box-shadow:0 3px 10px -4px #000}.mec-admin-dark-mode.post-type-mec-events .attachments-browser .media-toolbar,.mec-admin-dark-mode.post-type-mec-events .media-frame-content,.mec-admin-dark-mode.post-type-mec-events .media-modal-content{background:#2d2d2d;color:#888}.mec-admin-dark-mode.post-type-mec-events .media-router .active,.mec-admin-dark-mode.post-type-mec-events .media-router .media-menu-item.active:last-child,.mec-admin-dark-mode.post-type-mec-events .media-sidebar,.mec-admin-dark-mode.post-type-mec-events .quicktags-toolbar{background:#222}.mec-admin-dark-mode.post-type-mec-events .attachments-browser .media-toolbar,.mec-admin-dark-mode.post-type-mec-events .media-frame-content,.mec-admin-dark-mode.post-type-mec-events .media-modal-content,.mec-admin-dark-mode.post-type-mec-events .media-router .active,.mec-admin-dark-mode.post-type-mec-events .media-router .media-menu-item.active:last-child,.mec-admin-dark-mode.post-type-mec-events .media-sidebar,.mec-admin-dark-mode.post-type-mec-events .quicktags-toolbar{border-color:#000}.mec-admin-dark-mode.post-type-mec-events .wp-core-ui .attachment-preview{background:#000}.mec-admin-dark-mode.m-e-calendar_page_MEC-addons .mec-addon-box-footer,.mec-admin-dark-mode.m-e-calendar_page_MEC-addons .mec-addon-box-head,.mec-admin-dark-mode.m-e-calendar_page_MEC-addons .w-col-sm-3 .w-box.addon{border-color:#444}.mec-admin-dark-mode.m-e-calendar_page_MEC-addons .mec-addon-box-footer{background:#444}.mec-admin-dark-mode.m-e-calendar_page_MEC-addons .mec-addon-box-title span{color:#d2d2d2}.mec-admin-dark-mode.m-e-calendar_page_MEC-wizard{background:#282828!important}.mec-admin-dark-mode.m-e-calendar_page_MEC-wizard .mec-wizard-wrap{background:#1f1f1f}.mec-admin-dark-mode.m-e-calendar_page_MEC-wizard .mec-wizard-wrap .mec-wizard-starter-video a,.mec-admin-dark-mode.m-e-calendar_page_MEC-wizard .mec-wizard-wrap button{background:#000;border-color:#353535;transition:all .2s ease}.mec-admin-dark-mode.m-e-calendar_page_MEC-wizard .mec-wizard-wrap .mec-wizard-starter-video a:hover,.mec-admin-dark-mode.m-e-calendar_page_MEC-wizard .mec-wizard-wrap button:hover{border-color:#515151}.mec-admin-dark-mode.m-e-calendar_page_MEC-wizard .mec-wizard-back-box .mec-wizard-back-button{background:0 0;box-shadow:unset}.mec-admin-dark-mode.m-e-calendar_page_MEC-wizard .mec-wizard-wrap svg path{fill:#7b7b7b;stroke:#7b7b7b;transition:all .2s ease}.mec-admin-dark-mode.m-e-calendar_page_MEC-wizard .mec-wizard-wrap a p,.mec-admin-dark-mode.m-e-calendar_page_MEC-wizard .mec-wizard-wrap button span{color:#7b7b7b;transition:all .2s ease}.mec-admin-dark-mode.m-e-calendar_page_MEC-wizard .mec-wizard-wrap a:hover p,.mec-admin-dark-mode.m-e-calendar_page_MEC-wizard .mec-wizard-wrap button:hover span{color:#fff}.mec-admin-dark-mode.m-e-calendar_page_MEC-wizard .mec-wizard-wrap a:hover svg path,.mec-admin-dark-mode.m-e-calendar_page_MEC-wizard .mec-wizard-wrap button:hover svg path{fill:#fff;stroke:#fff}.mec-attendees-wrapper .mec-attendees-list .mec-booking-attendees-tooltip,.post-type-mec-books .attendees .mec-booking-attendees-tooltip{position:relative}.mec-attendees-wrapper .mec-attendees-list strong,.post-type-mec-books .attendees strong{line-height:26px;padding-left:26px}.mec-attendees-wrapper .mec-attendees-list .mec-booking-attendees-tooltip:before,.post-type-mec-books .attendees .mec-booking-attendees-tooltip:before{position:absolute;content:"\e001";font-family:simple-line-icons;margin:12px 0;top:-30px;left:0;font-size:18px;line-height:12px;color:#40d9f1;padding:0 60px 5px 0}.mec-attendees-wrapper .mec-attendees-list .mec-booking-attendees-tooltip ul,.post-type-mec-books .attendees .mec-booking-attendees-tooltip ul{position:absolute;min-width:300px;max-width:600px;display:inline-block;left:60px;top:50%;transform:translateY(-50%);background-color:#535a61;color:#fff;font-weight:300;font-size:14px;letter-spacing:.5px;line-height:1.3;z-index:9999999;box-sizing:border-box;box-shadow:0 4px 45px -8px #444b50;visibility:hidden;opacity:0;transition:opacity .23s;padding:23px 20px 20px 20px;border-radius:8px;margin-top:-13px}.mec-attendees-wrapper .mec-attendees-list .mec-booking-attendees-tooltip ul:before,.post-type-mec-books .attendees .mec-booking-attendees-tooltip ul:before{display:block;content:""!important;position:absolute!important;width:12px;height:12px;left:-10px!important;top:50%!important;transform:translate(50%,-50%) rotate(-45deg)!important;background-color:#535a61!important;box-shadow:0 8px 9px -4px #535a61!important;z-index:0!important}.mec-attendees-wrapper .mec-attendees-list .mec-booking-attendees-tooltip:hover ul,.post-type-mec-books .attendees .mec-booking-attendees-tooltip:hover ul{visibility:visible;opacity:1}.mec-attendees-wrapper .mec-attendees-list .mec-booking-attendees-tooltip ul a,.post-type-mec-books .attendees .mec-booking-attendees-tooltip ul a{color:#40d9f1;margin-bottom:14px;margin-left:0;font-weight:400;font-size:14px;letter-spacing:.5px;position:relative;text-decoration:none;display:block;width:max-content}.mec-attendees-wrapper .mec-attendees-list .mec-booking-attendees-tooltip ul li:last-child a,.post-type-mec-books .attendees .mec-booking-attendees-tooltip ul li:last-child a{margin-bottom:0}.mec-metabox-head-version img,.mec-metabox-head-version p{float:left}.mec-metabox-head-version a{float:right}.mec-metabox-head-version p{margin-top:3px;margin-left:5px;margin-bottom:34px}h3.mec-metabox-feed-head{border-top:1px solid #ccc}div#mec_widget_news_features .inside{padding:0}.mec-metabox-head-wrap{padding:0 12px}#dashboard-widgets h3.mec-metabox-feed-head{padding:8px 12px;border-top:1px solid #eee;border-bottom:1px solid #eee;font-weight:700}.mec-metabox-feed-content{padding:0 12px}.mec-metabox-feed-content ul li a{font-weight:600;display:block}.mec-metabox-feed-content ul li p{margin:3px 0 24px}.mec-metabox-footer a span{font-size:17px;vertical-align:middle;margin-left:2px}.mec-metabox-footer a{text-decoration:none;border-right:1px solid #eee;padding-right:10px;margin-right:12px}.mec-metabox-footer{padding:11px 12px 10px;border-top:1px solid #eee}.mec-metabox-footer a:last-of-type{border:none}.mec-metabox-upcoming-wrap h3{border-top:none!important;padding-top:13px!important}.mec-metabox-head-wrap{box-shadow:0 5px 8px rgba(0,0,0,.05)}.mec-metabox-upcoming-wrap ul li span{float:left}.mec-metabox-upcoming-wrap ul li .mec-metabox-upcoming-event{float:left;margin-left:10px}.mec-metabox-upcoming-wrap ul li .mec-metabox-upcoming-event-date{float:right}.mec-metabox-upcoming-wrap ul{padding:0 12px;background:#f7f7f7;margin:0}.mec-metabox-upcoming-wrap ul li{border-bottom:1px solid #eee;padding:14px 0;margin-bottom:0}.mec-metabox-upcoming-wrap ul li:last-of-type{border:none}.mec-metabox-upcoming-wrap h3{margin-bottom:0!important}.mec-metabox-upcoming-wrap ul li .mec-metabox-upcoming-event a{font-weight:600}.mec-metabox-head-version a span{vertical-align:middle}.mec-metabox-head-version a{padding-left:6px!important}#mec_widget_total_bookings .w-box.total-bookings ul li:first-child{margin-left:1px}#mec_widget_total_bookings .w-box.total-bookings ul li{margin-right:4px}#mec_widget_total_bookings .w-box.total-bookings ul li:last-child{margin-right:0}#mec_widget_total_bookings .w-box.total-bookings ul li a{color:#000}#mec_widget_total_bookings .w-box.total-bookings ul li:hover a{color:#fff}#mec_widget_total_bookings{overflow:hidden}#mec_widget_total_bookings .inside,#mec_widget_total_bookings .w-box{margin:0;padding-bottom:0}#mec_widget_total_bookings .w-col-sm-12{padding:0}#mec_widget_total_bookings .w-box-content button{color:#fff!important;font-weight:500!important;border-radius:2px!important;box-shadow:0 3px 10px -4px #008aff!important;text-shadow:none!important;background:#008aff!important;background:linear-gradient(95deg,#36a2ff 0,#008aff 50%,#0072ff 100%)!important;border:none!important;transition:.24s!important;line-height:39px;padding:0 36px;width:calc(33% - 7px);margin-bottom:14px}#mec_widget_total_bookings .w-box-content input[type=text],#mec_widget_total_bookings .w-box-content select{border:solid 1px #ddd;border-radius:2px;height:40px;line-height:38px;padding-left:10px;box-shadow:0 3px 10px -2px rgba(0,0,0,.05),inset 0 1px 2px rgba(0,0,0,.02)}#mec_widget_total_bookings .w-box-content input[type=text]{width:calc(50% - 5px)}#mec_widget_total_bookings .w-box-content select{width:calc(33% - 2px);margin-bottom:24px;margin-top:20px}div#mec-schema .mec-form-row label{display:inline-block;width:141px}.event-status-schema{background:rgb(247 248 249 / 10%);padding:20px 40px;margin:10px 0 35px;border-radius:4px;border:1px solid #e6e6e6}@media (min-width:1281px){.event-status-schema{max-width:70%}}.event-status-schema p{margin-bottom:35px}div#mec_cancelled_reason_wrapper label{width:100%!important}.mec-fluent-hidden{display:none}#webnus-dashboard .total-bookings input[type=text]{height:38px;line-height:38px;padding-left:10px;border-radius:5px;border:none;background-color:#f7f8f9;box-shadow:inset 0 1px 2px rgb(0 0 0 / 7%)}#webnus-dashboard .total-bookings select{appearance:none;-webkit-appearance:none;-moz-appearance:none;cursor:pointer;min-height:34px;line-height:34px;background-color:#f7f8f9;border-radius:2px;padding-left:8px;box-shadow:0 1px 3px rgb(0 0 0 / 2%);transition:all .23s ease;background-image:url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0ZWQgYnkgSWNvTW9vbi5pbyAtLT4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHdpZHRoPSIxNyIgaGVpZ2h0PSIxNyIgdmlld0JveD0iMCAwIDE3IDE3Ij4KPGc+CjwvZz4KCTxwYXRoIGQ9Ik0xNi4zNTQgNS4wNzVsLTcuODU1IDcuODU0LTcuODUzLTcuODU0IDAuNzA3LTAuNzA3IDcuMTQ1IDcuMTQ2IDcuMTQ4LTcuMTQ3IDAuNzA4IDAuNzA4eiIgZmlsbD0iIzAwMDAwMCIgLz4KPC9zdmc+Cg==);background-repeat:no-repeat;background-size:26px 10px;background-position:right center;min-width:160px;border:1px solid #e6e9eb}#webnus-dashboard select{margin-top:-5px}#mec_styles_CSS{line-height:1.6}.mec-search-forms-options-container label.mec-col-12{margin-bottom:10px}@media (max-width:480px){.toplevel_page_mec-intro .mec-intro-section-ifarme iframe{width:auto!important;height:auto!important}.w-box.mec-activation input[name=MECPurchaseCode]{min-width:200px!important;width:330px}.w-box.mec-activation{background:#fff}.mec-addons{padding-right:15px}.mec-report-wrap{margin-top:20px}.mec-report-select-event-wrap .select2-container--default,.mec-report-select-event-wrap select.mec-reports-selectbox-dates{max-width:100%;width:100%;margin:10px 0}.mec-report-selected-event-attendees-wrap .w-clearfix.mec-attendees-content,.mec-report-selected-event-attendees-wrap .w-clearfix.mec-attendees-head{padding:10px}.mec-report-selected-event-attendees-wrap .w-clearfix.mec-attendees-head span{font-size:13px}.mec-report-selected-event-attendees-wrap .mec-attendees-content .w-col-xs-3{word-wrap:break-word}.mec-report-selected-event-attendees-wrap .w-col-xs-3.name img{display:block}.mec-report-selected-event-attendees-wrap input[type=checkbox],.mec-report-selected-event-attendees-wrap input[type=radio]{height:.85rem;width:.85rem}.wns-be-container .dpr-btn.dpr-save-btn{margin:0!important}#mec_booking_form .mec-container{padding-left:0;padding-right:0}#mec_event_form_fields,#mec_reg_form_fields{padding:10px}.mec-search-forms-options-container .mec-form-row select{width:100%}#mec_skin_monthly_view_start_date_container{display:unset}#mec_calendar_display_options input[type=number],#mec_calendar_display_options input[type=text],#mec_calendar_display_options select{max-width:100%!important;width:100%;margin:10px 0}#mec_select_tags.mec-create-shortcode-tab-content input[type=text]{width:auto}#mec_tickets .mec-box{padding:20px 7px}.fserv-container form,.fserv-form-description{padding:10px 15px!important}.fserv-field{display:inline-block;width:25%!important;padding:0!important;margin:0!important;margin-right:10px!important}#webnus-dashboard .total-bookings button{margin:15px 0}}.mec-skin-styles.mec-styles-custom{padding-left:0!important;top:40%;position:absolute;width:330px;height:auto!important;overflow:visible!important}.mec-skin-styles.mec-styles-custom .nice-select{box-shadow:0 3px 13px -5px rgba(0,0,0,.1),inset 0 1px 2px rgba(0,0,0,.07);clear:unset!important;-webkit-tap-highlight-color:transparent;background-color:#fff;border-radius:5px;border:solid 1px #e8e8e8;box-sizing:border-box;clear:both;cursor:pointer;display:block;float:left;font-family:inherit;font-size:14px;font-weight:400;height:42px;line-height:40px;outline:0;padding-left:18px;padding-right:30px;position:relative;text-align:left!important;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;width:300px!important}.mec-styles-custom h3{font-size:13px;font-weight:400;color:#707070}.post-type-mec_calendars .mec-form-row .select2-selection{height:auto}.mec-form-row .mec-col-12 ul li span{display:inline-block;background:#f7f8f9;padding:8px 15px;margin-right:5px;border-radius:3px;border:1px dashed #d7d8d9;font-family:monospace;letter-spacing:.4px}.post-type-mec-events .ui-datepicker.ui-widget .ui-state-disabled .ui-state-default{color:#ccc;width:30px;height:30px;line-height:30px;display:inline-block}.post-type-mec-events .ui-datepicker.ui-widget .ui-button,.post-type-mec-events .ui-datepicker.ui-widget .ui-button.ui-state-disabled:active,.post-type-mec-events .ui-datepicker.ui-widget .ui-button.ui-state-disabled:hover,.post-type-mec-events .ui-datepicker.ui-widget .ui-state-default,.post-type-mec-events .ui-datepicker.ui-widget .ui-widget-content .ui-state-default,.post-type-mec-events .ui-datepicker.ui-widget .ui-widget-header .ui-state-default,.post-type-mec_calendars .ui-datepicker.ui-widget .ui-button,.post-type-mec_calendars .ui-datepicker.ui-widget .ui-button.ui-state-disabled:active,.post-type-mec_calendars .ui-datepicker.ui-widget .ui-button.ui-state-disabled:hover,.post-type-mec_calendars .ui-datepicker.ui-widget .ui-state-default,.post-type-mec_calendars .ui-datepicker.ui-widget .ui-widget-content .ui-state-default,.post-type-mec_calendars .ui-datepicker.ui-widget .ui-widget-header .ui-state-default{border:0;background-color:#fff;font-weight:400;color:#212121;text-align:center}.post-type-mec-events .ui-datepicker.ui-widget td a.ui-state-active,.post-type-mec-events .ui-datepicker.ui-widget td a:hover,.post-type-mec_calendars .ui-datepicker.ui-widget td a.ui-state-active,.post-type-mec_calendars .ui-datepicker.ui-widget td a:hover{background:#40d9f1;color:#fff}.post-type-mec-events .ui-datepicker.ui-widget .ui-widget-header,.post-type-mec_calendars .ui-datepicker.ui-widget .ui-widget-header{border:0;background:unset;background-color:#fff}.post-type-mec-events .ui-datepicker.ui-widget .ui-icon,.post-type-mec-events .ui-datepicker.ui-widget .ui-widget-content .ui-icon,.post-type-mec_calendars .ui-datepicker.ui-widget .ui-icon,.post-type-mec_calendars .ui-datepicker.ui-widget .ui-widget-content .ui-icon{background-image:unset}.post-type-mec-events .ui-datepicker.ui-widget select,.post-type-mec_calendars .ui-datepicker.ui-widget select{font-weight:600;font-size:12px;border-radius:2px;padding:2px 10px;margin:1px 3px 5px}.mec-update-warning+p{display:none}#mec_sf_timetable_address_search_placeholder,#mec_sf_timetable_txt_search_placeholder{margin-top:4px}body.rtl .wns-be-sidebar{width:260px;float:right;position:relative}body.rtl .wns-be-main{margin-left:0;border-left:0;margin-right:260px;border-right:1px solid #dedede}body.rtl .w-box.mec-activation .LicenseField{direction:rtl}body.rtl .w-box.mec-activation input[name=MECPurchaseCode]{text-align:right;padding-right:20px}body.rtl #MECActivation .MECPurchaseStatus,body.rtl .addon-activation-form .MECPurchaseStatus{right:auto;left:-51px}body.rtl #webnus-dashboard .w-box.mec-activation input[type=submit]{right:auto;left:5px}body.rtl .wns-be-sidebar .wns-be-group-menu li a{padding:13px 20px 13px 4px}body.rtl .wns-be-sidebar .wns-be-group-tab-link-a span.wns-be-group-menu-title{padding-left:0;padding-right:24px}body.rtl .wns-be-sidebar .has-sub span.extra-icon{float:left}body.rtl .wns-be-sidebar .wns-be-group-tab-link-a span.extra-icon i{right:auto;left:10px}body.rtl .wns-be-sidebar .wns-be-group-menu li .subsection li.active a:after,body.rtl .wns-be-sidebar .wns-be-group-menu li .subsection li.active a:before{position:absolute;z-index:999;content:" ";height:0;width:0;border:7px solid transparent;border-right-color:transparent;border-left-color:#fff;right:auto;left:-1px;top:10px}body.rtl .wns-be-sidebar .wns-be-group-menu li .subsection li.active a:before{border-right-color:transparent;border-left-color:#c5c5c5;right:auto;left:0}body.rtl .mec-col-1,body.rtl .mec-col-10,body.rtl .mec-col-11,body.rtl .mec-col-12,body.rtl .mec-col-2,body.rtl .mec-col-3,body.rtl .mec-col-4,body.rtl .mec-col-5,body.rtl .mec-col-6,body.rtl .mec-col-7,body.rtl .mec-col-8,body.rtl .mec-col-9{float:right;margin:0}body.rtl .wns-be-sidebar li .submneu-hover{right:auto;left:-222px}body.rtl .wns-be-sidebar li .submneu-hover:after{position:absolute;z-index:999;content:" ";height:0;width:0;border:7px solid transparent;border-right-color:#fff;left:auto;right:-1px;top:14px}body.rtl #mec_styles_form #mec_styles_CSS{direction:ltr}body.rtl .w-box.mec-activation{-moz-transform:scaleY(-1);-o-transform:scaleY(-1);-webkit-transform:scaleY(-1);transform:scaleX(-1)}body.rtl .w-box.mec-activation .w-box-content,body.rtl .w-box.mec-activation .w-box-head{-moz-transform:scaleY(-1);-o-transform:scaleY(-1);-webkit-transform:scaleY(-1);transform:scaleX(-1);display:block}body.rtl .w-box.mec-activation .w-box-head{width:100%}body.rtl .wns-be-container #wns-be-infobar:before{left:auto;right:0}body.rtl .wns-be-container .dpr-btn.dpr-save-btn{float:left}body.rtl .wns-be-container .wns-be-group-tab h2:before,body.rtl .wns-be-container .wns-be-group-tab h4:before{left:auto;right:0;margin-right:0;margin-left:5px}body.rtl #mec_gateways_form .mec-tooltip{float:left}body.rtl .fserv-container .fserv-form-name{text-align:right!important}body.rtl #webnus-dashboard .mec-activation .w-box-head{max-width:calc(100% - 250px);margin-right:250px;text-align:right}body.rtl #webnus-dashboard .w-box.mec-activation .LicenseType label{padding-left:20px;padding-right:0;font-weight:500}body.rtl #webnus-dashboard .w-box.mec-activation input[type=radio]+label span{margin-right:0;margin-left:6px}body.rtl #webnus-dashboard .upcoming-events .w-box-content .mec-event-article{display:block}body.rtl #webnus-dashboard .upcoming-events .w-box-content .mec-event-article .col-md-9.col-sm-9{float:unset}body.rtl #webnus-dashboard .total-bookings input[type=text],body.rtl #webnus-dashboard .total-bookings select{min-width:125px;margin:0}body.rtl.post-type-mec-events .mec-form-row input[type=number],body.rtl.post-type-mec-events .mec-form-row input[type=text],body.rtl.post-type-mec-events .mec-form-row input[type=url],body.rtl.post-type-mec-events .mec-form-row select,body.rtl.post-type-mec-events .mec-form-row textarea,body.rtl.post-type-mec_calendars .mec-form-row input[type=number],body.rtl.post-type-mec_calendars .mec-form-row input[type=text],body.rtl.post-type-mec_calendars .mec-form-row input[type=url],body.rtl.post-type-mec_calendars .mec-form-row select,body.rtl.post-type-mec_calendars .mec-form-row textarea{margin:0 0 0 1%}body.rtl .mec-form-row .mec-col-8 label,body.rtl .mec-form-row .mec-col-9 label{padding-left:10px}body.rtl .mec-form-row label{text-align:right}body.rtl .mec-form-row .mec-col-3{margin:0;padding-left:10px;padding-right:0}body.rtl .mec-calendar-metabox .mec-form-row input[type=checkbox],body.rtl .mec-meta-box-fields .mec-form-row input[type=checkbox]{margin-left:6px;margin-right:0}body.rtl .mec-form-row input[type=radio]{margin:0 0 0 6px}body.rtl .mec-form-row .description{border-left:0;border-right:1px dashed #ccc;padding-left:0;padding-right:12px}body.rtl #mec_add_fee_button,body.rtl #mec_add_ticket_variation_button,body.rtl #mec_meta_box_downloadable_file_options #mec_downloadable_file_remove_image_button,body.rtl #taxes_option #mec_fees_list .mec-form-row .button,body.rtl #ticket_variations_option #mec_ticket_variations_list .mec-form-row .button,body.rtl .mec-export-settings,body.rtl .mec-import-settings,body.rtl .mec-meta-box-fields .mec-form-row .button:not(.wp-color-result),body.rtl .mec-occurrences-wrapper .button:not(.wp-color-result){margin-right:0;margin-left:5px}body.rtl .mec-add-booking-tabs-right,body.rtl .mec-add-event-tabs-right,body.rtl .mec-create-shortcode-tabs-right{border-left:0;border-right:1px solid #e2e2e2}body.rtl .mec-add-booking-tabs-left a,body.rtl .mec-add-event-tabs-left a,body.rtl .mec-create-shortcode-tabs-left a{padding:13px 20px 13px 4px}body.rtl .mec-add-booking-tabs-left a.mec-tab-active,body.rtl .mec-add-event-tabs-left a.mec-tab-active,body.rtl .mec-create-shortcode-tabs-left a.mec-tab-active{padding-left:0;padding-right:22px}body.rtl .mec-calendar-metabox .wn-mec-select,body.rtl .mec-form-row select,body.rtl .post-type-mec-events .mec-form-row select,body.rtl .post-type-mec_calendars .mec-form-row select,body.rtl .wns-be-main .mec-form-row select{background-position:left center!important}body.rtl .mec-calendar-metabox .wn-mec-select,body.rtl .mec-form-row select,body.rtl .post-type-mec-events .mec-form-row select,body.rtl .post-type-mec_calendars .mec-form-row select,body.rtl .wns-be-main .mec-form-row select{text-align:right!important}body.rtl #mec_calendar_display_options .mec-col-4 input{margin-left:0!important;margin-right:20px!important}body.rtl .meta-box-sortables .mec-switcher input:checked+label:after{right:auto;left:2px;margin-left:0}body.rtl .mec-sed-methods li{margin:0 0 5px 5px}body.rtl .wn-mec-select:after{left:10px;right:auto}body.rtl .inside div div>a.mec-tab-active:after,body.rtl .inside div div>a.mec-tab-active:before{border-right:0;border-left-color:#fff}body.rtl .inside div div>a.mec-tab-active:after{right:auto;left:-1px}body.rtl .inside div div>a.mec-tab-active:before{border-right:0;border-left-color:#d7d8d9;right:auto;left:0}body.rtl #mec_tickets .button.remove{right:auto;left:20px;line-height:1.8}body.rtl .mec-calendar-metabox .wn-mec-select,body.rtl .mec-form-row input[type=date],body.rtl .mec-form-row input[type=email],body.rtl .mec-form-row input[type=number],body.rtl .mec-form-row input[type=tel],body.rtl .mec-form-row input[type=text],body.rtl .mec-form-row input[type=url],body.rtl .mec-form-row select,body.rtl .mec-form-row textarea,body.rtl .mec-form-row.mec-skin-list-date-format-container input[type=text],body.rtl .mec-occurrences-wrapper input[type=date],body.rtl .mec-occurrences-wrapper input[type=email],body.rtl .mec-occurrences-wrapper input[type=number],body.rtl .mec-occurrences-wrapper input[type=tel],body.rtl .mec-occurrences-wrapper input[type=text],body.rtl .mec-occurrences-wrapper input[type=url],body.rtl .mec-occurrences-wrapper select,body.rtl .mec-occurrences-wrapper textarea{padding:0 10px}body.rtl #mec-occurrences .mec-occurrences-list li,body.rtl #mec_bfixed_form_fields li,body.rtl #mec_event_form_fields li,body.rtl #mec_reg_form_fields li{border-radius:11px 3px 3px 3px}body.rtl #mec-occurrences .mec-occurrences-list .mec-occurrences-delete-button,body.rtl #mec_bfixed_form_fields span.mec_bfixed_field_remove,body.rtl #mec_event_form_fields span.mec_event_field_remove,body.rtl #mec_reg_form_fields span.mec_reg_field_remove{position:absolute;right:auto;left:47px;top:0;background:#fff}body.rtl #mec-occurrences .mec-occurrences-list .mec-occurrences-delete-button:before,body.rtl #mec_bfixed_form_fields span.mec_bfixed_field_option_sort:before,body.rtl #mec_bfixed_form_fields span.mec_bfixed_field_remove:before,body.rtl #mec_bfixed_form_fields span.mec_bfixed_field_sort:before,body.rtl #mec_event_form_fields span.mec_event_field_option_sort:before,body.rtl #mec_event_form_fields span.mec_event_field_remove:before,body.rtl #mec_event_form_fields span.mec_event_field_sort:before,body.rtl #mec_reg_form_fields span.mec_reg_field_option_sort:before,body.rtl #mec_reg_form_fields span.mec_reg_field_remove:before,body.rtl #mec_reg_form_fields span.mec_reg_field_sort:before{left:auto;right:20px;top:7px}body.rtl #mec_bfixed_form_fields span.mec_bfixed_field_type,body.rtl #mec_bfixed_form_fields span.mec_event_field_type,body.rtl #mec_event_form_fields span.mec_event_field_type,body.rtl #mec_reg_form_fields span.mec_reg_field_type{padding-left:0;padding-right:25px}body.rtl .wns-be-main .mec-form-row .mec-col-3{padding:0}body.rtl .wns-be-main .mec-form-row .mec-col-9{float:left}body.rtl .mec-form-row .mec-col-9 .mec-box .mec-tooltip{left:15px;right:auto}body.rtl .mec-tooltip .box{left:auto!important;right:30px!important}body.rtl .mec-tooltip .box:before{left:auto!important;right:0!important}body.rtl .mec-tooltip .box.left{left:30px!important;right:auto!important}body.rtl .mec-tooltip .box.left:before{left:-12px!important;right:auto!important}body.rtl .mec-form-row .cancellation-period-box input[type=number]:first-child{margin-left:calc(2% + 4px);margin-right:0}body.rtl .support-page .w-box-content ul li i{margin:0 0 0 10px;float:right}body.rtl .support-page .w-box-content ul li .mec-sl-arrow-right-circle:before{content:"\e07a"}body.rtl #webnus-dashboard .w-box.support-page.videobox .w-button a i{float:left;line-height:24px}body.rtl #webnus-dashboard .mec-faq-accordion-trigger a{padding-right:34px;font-size:15px}form .wbmec-mandatory{color:red}input.mec-error,select.mec-error,textarea.mec-error{border-color:red}.mec-copied{position:absolute;top:0;width:40%;opacity:0;z-index:-9;transition:all .33s cubic-bezier()}.mec-copied.mec-copied-done{opacity:1;left:135px;z-index:9}.m-e-calendar_page_MEC-settings .mec-addons-notification-box-image img{max-width:555px}.m-e-calendar_page_MEC-settings .mec-custom-msg-notification-wrap,.m-e-calendar_page_MEC-settings .wns-be-container .mec-addons-notification-wrap{max-width:1020px}#mec-event-gallery ul#mec_meta_box_event_gallery{display:flex;flex-flow:row wrap}#mec-event-gallery ul#mec_meta_box_event_gallery li{flex:0 1 calc(33.333333% - 10px);margin-right:10px;position:relative}#mec-event-gallery ul#mec_meta_box_event_gallery li img{width:100%!important;height:75px;object-fit:cover}#mec-event-gallery ul#mec_meta_box_event_gallery li span.mec-event-gallery-delete{padding:0;min-height:20px;height:20px;width:20px;margin:0;border-radius:50%;position:absolute;top:2px;right:2px;box-shadow:none;background:#fff;border-color:#e3e4e5;font-size:0px;cursor:pointer;transition:.2s}#mec-event-gallery ul#mec_meta_box_event_gallery li span.mec-event-gallery-delete:before{content:"";width:20px;height:20px;display:block;background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgZm9jdXNhYmxlPSJmYWxzZSIgd2lkdGg9IjFlbSIgaGVpZ2h0PSIxZW0iIHN0eWxlPSItbXMtdHJhbnNmb3JtOiByb3RhdGUoMzYwZGVnKTsgLXdlYmtpdC10cmFuc2Zvcm06IHJvdGF0ZSgzNjBkZWcpOyB0cmFuc2Zvcm06IHJvdGF0ZSgzNjBkZWcpOyIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDIwIDIwIiBmaWxsPSIjZWE2NDg1Ij48cGF0aCBkPSJNMTQuOTUgNi40NkwxMS40MSAxMGwzLjU0IDMuNTRsLTEuNDEgMS40MUwxMCAxMS40MmwtMy41MyAzLjUzbC0xLjQyLTEuNDJMOC41OCAxMEw1LjA1IDYuNDdsMS40Mi0xLjQyTDEwIDguNThsMy41NC0zLjUzeiIvPjwvc3ZnPg==");background-position:center}#mec-event-gallery ul#mec_meta_box_event_gallery li span.mec-event-gallery-delete:hover{color:#fff;border-color:#ea6485;background:#ea6485}#mec-event-gallery ul#mec_meta_box_event_gallery li span.mec-event-gallery-delete:hover:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgZm9jdXNhYmxlPSJmYWxzZSIgd2lkdGg9IjFlbSIgaGVpZ2h0PSIxZW0iIHN0eWxlPSItbXMtdHJhbnNmb3JtOiByb3RhdGUoMzYwZGVnKTsgLXdlYmtpdC10cmFuc2Zvcm06IHJvdGF0ZSgzNjBkZWcpOyB0cmFuc2Zvcm06IHJvdGF0ZSgzNjBkZWcpOyIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDIwIDIwIiBmaWxsPSIjZmZmZmZmIj48cGF0aCBkPSJNMTQuOTUgNi40NkwxMS40MSAxMGwzLjU0IDMuNTRsLTEuNDEgMS40MUwxMCAxMS40MmwtMy41MyAzLjUzbC0xLjQyLTEuNDJMOC41OCAxMEw1LjA1IDYuNDdsMS40Mi0xLjQyTDEwIDguNThsMy41NC0zLjUzeiIvPjwvc3ZnPg==")}.mec-show-hide-password{cursor:pointer}.mec-show-hide-password:hover{text-decoration:underline}.mec-in-days-add-mode #mec_cancel_in_days,.mec-in-days-add-mode #mec_edit_in_days,.mec-in-days-edit-mode #mec_add_in_days{display:none}.mec-in-days-add-mode #mec_add_in_days,.mec-in-days-edit-mode #mec_cancel_in_days,.mec-in-days-edit-mode #mec_edit_in_days{display:inline}ul.system-information li{display:flex}ul.system-information li .mec-si-label{width:250px;font-weight:500}div[id*=mec_event_fields] div[aria-label=Fullscreen]{display:none}.mec-backend-tab-wrap{margin-bottom:40px}.mec-backend-tab{display:inline-block;padding:4px;border:1px solid #e3e4e5;border-radius:6px;background:#fff;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif}.mec-backend-tab-item{display:inline-block;padding:11px 33px;line-height:1;font-size:14px;font-weight:400;border-radius:5px;border:1px solid transparent;cursor:pointer;transition:all .2s ease}.mec-backend-tab-item:hover{color:#07bbe9}.mec-b-active-tab{background:#ecf9fd;color:#07bbe9;cursor:default;font-weight:600}#mec_export_module_options{margin:0}.mec-hourly-schedule-form-speakers-label{line-height:38px;margin-right:10px}.wp-picker-container button{margin:4px 6px}#mec_meta_box_event_banner_options #mec_banner_thumbnail_img{margin-bottom:20px}.mec-label{line-height:38px}#mec_sb_choose_single_page label.post-attributes-label,.mec-metabox-visibility label.post-attributes-label{display:block;margin-bottom:4px}#mec_sb_choose_single_page select,.mec-metabox-visibility select{width:100%}.mec-image-picker-page{display:flex;flex-wrap:wrap;gap:20px}.mec-image-picker-page .mec-image-picker-wrapper{box-sizing:border-box;max-width:332px;flex-basis:calc(100% / 2);border:1px solid #e3e5e7;border-radius:4px;padding:10px;max-height:46px;display:flex;flex-wrap:wrap;flex-direction:row;align-items:center;justify-content:space-between;position:relative;padding-right:43px}.mec-image-picker-page .mec-image-picker-wrapper .mec-icon-default{display:flex;flex-wrap:wrap;flex-direction:row;align-items:center}.mec-image-picker-page .mec-image-picker-wrapper .mec-icon-default .default{display:flex;margin:2px 5px 0 0}.mec-image-picker-page .mec-image-picker-wrapper .mec-icon-default .default i{font-size:14px;color:#686f73}.mec-image-picker-page .mec-image-picker-wrapper .mec-icon-default label{font-size:13px;line-height:17px;font-weight:400;color:#686f73}.mec-image-picker-page .mec-image-picker-wrapper .mec-icon-uploader button{font-size:11px;font-weight:400;line-height:24px;border:1px solid;border-radius:4px;height:unset;min-height:unset;margin:0 10px 0 0;padding:0 10px 0 28px;background-repeat:no-repeat;background-position:10px center}.mec-image-picker-page .mec-image-picker-wrapper .mec-icon-uploader button.mec-image-picker-upload{color:#07bbe9;border-color:#ccecf4;background-color:#ecf9fd;background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxNCIgaGVpZ2h0PSIxMS41NjUiIHZpZXdCb3g9IjAgMCAxNCAxMS41NjUiPg0KICA8cGF0aCBpZD0ibWVjLXVwbG9hZC1pY29uIiBkPSJNMTEsOTY0LjM2MmE0LjIxOSw0LjIxOSwwLDAsMSw0LjE2NiwzLjQyOSwzLjQ5MSwzLjQ5MSwwLDAsMS0uNjY2LDYuOTE5SDEyLjgyNmEuNDU3LjQ1NywwLDEsMSwwLS45MTNIMTQuNWEyLjU4OCwyLjU4OCwwLDAsMCwuMjM4LTUuMTY0LjQ1Ny40NTcsMCwwLDEtLjQwOS0uNCwzLjM1LDMuMzUsMCwxLDAtNi42NTMuNzg5LjQ1Ni40NTYsMCwwLDEtLjQ1Mi41MTRINy4wNDNhMi4xMywyLjEzLDAsMCwwLDAsNC4yNjFoMi4xM2EuNDU3LjQ1NywwLDEsMSwwLC45MTNINy4wNDNhMy4wMzUsMy4wMzUsMCwwLDEtLjI3Ni02LjA1OEE0LjIxNCw0LjIxNCwwLDAsMSwxMSw5NjQuMzYyWm0wLDUuMTc0YS40MDkuNDA5LDAsMCwxLC4zMDkuMTE5bDEuNjc0LDEuNTIyYS40NjEuNDYxLDAsMCwxLC4wMjkuNjQ3LjQ3OC40NzgsMCwwLDEtLjY0Ny4wMjlsLS45MDgtLjgyOHY0LjQ0NmEuNDU3LjQ1NywwLDEsMS0uOTEzLDB2LTQuNDQ2bC0uOTA4LjgyN2EuNDg4LjQ4OCwwLDAsMS0uNjQ3LS4wMjkuNDYuNDYsMCwwLDEsLjAyOS0uNjQ3bDEuNjc0LTEuNTIyYS4zODUuMzg1LDAsMCwxLC4zMDktLjExOVoiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC00IC05NjQuMzYyKSIgZmlsbD0iIzA3YmJlOSIvPg0KPC9zdmc+DQo=")}.mec-image-picker-page .mec-image-picker-wrapper .mec-icon-uploader button.mec-image-picker-remove{color:#e95271;border-color:#f3c2c9;background-color:#feebee;background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI5LjkyNSIgaGVpZ2h0PSIxMyIgdmlld0JveD0iMCAwIDkuOTI1IDEzIj4NCiAgPHBhdGggaWQ9InRyYXNoLWljb24iIGQ9Ik0xMC4yMDksMS44NjhhMS44LDEuOCwwLDAsMC0zLjQ4OCwwSDMuNXYuOWg5LjkyNXYtLjlIMTAuMjA5Wk04LjQ2MywxLjRhLjkxOS45MTksMCwwLDEsLjc5LjQ2Nkg3LjY4OEEuODkxLjg5MSwwLDAsMSw4LjQ2MywxLjRabTMuNjA5LDIuMjU2aC45djguNDg5QTEuMzU1LDEuMzU1LDAsMCwxLDExLjYyMSwxMy41SDUuM2ExLjM1NSwxLjM1NSwwLDAsMS0xLjM1My0xLjM1M1YzLjY1OGguOXY4LjQ4OUEuNDUyLjQ1MiwwLDAsMCw1LjMsMTIuNmg2LjMxNmEuNDUyLjQ1MiwwLDAsMCwuNDUxLS40NTFWMy42NThabS00LjUxMS45djYuMjE4aC0uOVY0LjU2Wm0yLjcwNywwdjYuMjE4aC0uOVY0LjU2WiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTMuNSAtMC41KSIgZmlsbD0iI2U5NTI3MSIvPg0KPC9zdmc+DQo=")}.mec-image-picker-page .mec-image-picker-wrapper .mec-image-picker-preview-wrapper{background-color:#fafbfc;width:42px;height:44px;border-left:1px solid #e3e5e7;display:block;position:absolute;right:0;top:0;border-radius:0 4px 4px 0;display:flex;align-items:center;justify-content:center}.mec-image-picker-page .mec-image-picker-wrapper .mec-image-picker-preview-wrapper .mec-image-picker-preview,.mec-image-picker-page .mec-image-picker-wrapper .mec-image-picker-preview-wrapper .mec-image-picker-preview img{display:block;max-width:24px}button#mec_add_not_in_days{margin-left:20px}.mec-hourly-schedule-schedules .mec-form-row{cursor:grab}.mec-hourly-schedule-schedules .mec-form-row.ui-sortable-helper{cursor:grabbing}.taxonomy-add-new{margin:0;line-height:30px}.fserv-form-loaded .fs-webform-container .fserv-form-name{text-align:left!important}#webnus-dashboard .mec-cmsg-2-notification-box-wrap,#webnus-dashboard .mec-cmsg-notification-box-wrap{margin-top:30px!important}body[class^=page_MEC-settings] .w-clearfix.w-box.mec-cmsg-notification-box-wrap{margin-top:0}body[class*=page_MEC-settings] .mec-custom-msg-2-notification-set-box.extra,body[class*=page_MEC-settings] .mec-custom-msg-notification-set-box.extra{font-family:-apple-system,BlinkMacSystemFont,\"Segoe UI\",Oxygen,Roboto,sans-serif;max-width:1018px;border-radius:11px;overflow:hidden;margin-right:auto;margin-left:auto;margin-top:25px;margin-bottom:27px}.mec-addons-key-features ul{margin:5px 0 15px}.mec-addons-key-features ul li{margin-bottom:1px;font-size:13px;color:#717479;padding-left:18px;position:relative}.mec-addons-notification-box-content.mec-new-addons p{font-size:14px}.mec-new-addons .mec-addons-notification-title{font-size:20px;font-weight:600;margin-bottom:12px}.mec-addons-key-features ul li:before{position:absolute;left:-1px;top:6px;color:#36da74;background:0 0;font-size:13px;font-weight:700;vertical-align:middle;font-family:simple-line-icons;border-radius:50%;padding:0;width:13px;height:13px;line-height:13px;z-index:3;background:rgba(64,241,147,.12);content:"\e080"}.mec-addons-notification-box-content.mec-new-addons a{background:#1fcae4;color:#fff!important;padding:6px 20px;margin-top:3px;margin-bottom:12px;display:inline-block;border-radius:60px;text-transform:none;font-size:13px;letter-spacing:.4px;transition:all .1s ease;font-weight:600;text-decoration:none;box-shadow:0 0 0 3px rgb(56 213 237 / 8%)!important}.mec-addons-notification-box-content.mec-new-addons a:hover{background:#1fcae4;box-shadow:0 0 0 4px rgb(56 213 237 / 15%)!important}.mec-new-addons-wrap .mec-addons-notification-box-image{width:590px;display:inline-block;vertical-align:top}body[class*=page_MEC-settings] .mec-new-addons-wrap .mec-addons-notification-box-image{width:450px}.mec-new-addons-wrap .mec-addons-notification-box-content{width:calc(100% - 590px);display:inline-block;padding-left:20px}.mec-new-addons-wrap .mec-addons-notification-box-image img{max-width:590px}body[class*=page_MEC-settings] .mec-new-addons-wrap .mec-addons-notification-box-image img{max-width:450px}body[class*=page_MEC-settings] .mec-new-addons-wrap .mec-addons-notification-box-content{width:calc(100% - 470px)}.mec-new-addons-wrap .w-box-content code{display:block;margin-bottom:6px}@media(max-width:480px){.mec-new-addons-wrap .mec-addons-notification-box-content{width:100%;padding:0}.mec-addons-notification-box-content .w-box-content{padding-top:30px;padding-bottom:30px;padding-left:0}.mec-new-addons-wrap .mec-addons-notification-box-image{width:100%!important}body[class*=page_MEC-settings] .mec-new-addons-wrap .mec-addons-notification-box-content{width:100%!important;padding:0!important}body[class*=page_MEC-settings] .mec-new-addons-wrap .mec-addons-notification-box-content .w-box-content{padding:0}}#webnus-dashboard .mec-new-addons-wrap{margin-top:30px!important}#webnus-dashboard .info-msg.w-box.mec-intro-section.version-info-message{margin-bottom:25px;min-height:auto}#webnus-dashboard .info-msg.w-box.mec-intro-section.version-info-message a.info-msg-link{line-height:40px;font-weight:600;border:none;cursor:pointer;padding:0 30px;border-radius:33px;color:#fff;letter-spacing:1px;text-transform:uppercase;font-size:12px;text-shadow:none;background:#64e385;transition:all .28s ease;box-shadow:0 5px 10px -5px #64e385}tr[data-slug=mec] a.open-plugin-details-modal{display:none}#mec_restful_container_toggle .mec-api-key-wrapper code{line-height:38px;margin-left:20px} \ No newline at end of file diff --git a/assets/css/dyncss.css b/assets/css/dyncss.css new file mode 100755 index 0000000..e69de29 diff --git a/assets/css/frontend.css b/assets/css/frontend.css new file mode 100755 index 0000000..422be6a --- /dev/null +++ b/assets/css/frontend.css @@ -0,0 +1,27342 @@ +/*---------------------------------- + Plug-in Name: Modern Events Calendar + Author: WEBNUS + Author URI: https://webnus.net/ + Description: Modern Events Calendar + License: GNU General Public License +/*-----------------------------------------------------------------------------------*/ + +/* #CSS Base & Typography + ================================================== */ +/* .mec-wrap, +.mec-wrap div:not([class^="elementor-"]), +.lity-container { + font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; +} */ + +.mec-wrap { + position: relative; +} + +.mec-wrap h1, +.mec-wrap h2, +.mec-wrap h3, +.mec-wrap h4, +.mec-wrap h5, +.mec-wrap h6, +.entry-content .mec-wrap h1, +.entry-content .mec-wrap h2, +.entry-content .mec-wrap h3, +.entry-content .mec-wrap h4, +.entry-content .mec-wrap h5, +.entry-content .mec-wrap h6 { + color: #171c24; + font-weight: 300; + font-style: inherit; + letter-spacing: normal; + clear: none; +} + +.mec-wrap h1 { + font-size: 50px; + line-height: 1.16; + margin-bottom: 12px; + letter-spacing: -1px; +} + +.mec-wrap h2 { + font-size: 36px; + line-height: 1.14; + margin-bottom: 10px; +} + +.mec-wrap h3 { + font-size: 28px; + line-height: 1.2; + margin-bottom: 8px; +} + +.mec-wrap h4 { + font-size: 24px; + line-height: 1.2; + margin-bottom: 10px; +} + +.mec-wrap h5 { + font-size: 18px; + line-height: 1.3; + margin-bottom: 7px; +} + +.mec-wrap h6 { + font-size: 16px; + line-height: 1.3; + margin-bottom: 4px; +} + +.mec-wrap .subheader { + color: #849098; +} + +.mec-wrap h1 strong { + font-weight: 700; +} + +.mec-wrap :not(.elementor-widget-container) > p { + margin: 0 0 20px 0; + color: #616161; + font-size: 14px; + line-height: 1.8; +} + +.mec-wrap .read-more-text p span.more-text { + display: none; +} + +.mec-wrap .mec-event-article .mec-color-hover { + box-shadow: none; + border: none; +} + +.mec-wrap abbr, +.mec-wrap acronym { + cursor: auto; + border: none; +} + +.entry-content .mec-wrap a { + box-shadow: none; +} + +.mec-single-event-description.mec-events-content ul li, +.mec-single-event-description.mec-events-content ol li { + color: #616161; + font-size: 14px; + line-height: 1.8; + font-weight: 300; +} + +/* Buttons Default */ +.mec-wrap .button, +.mec-wrap + button:not(.owl-dot):not(.gm-control-active):not(.mejs):not(.owl-prev):not( + .owl-next + ):not(.mec-googlemap-details button):not(.mec-googlemap-skin button), +.mec-wrap input[type="submit"], +.mec-wrap input[type="reset"], +.mec-wrap input[type="button"], +.lity-content .button, +.lity-content + button:not(.owl-dot):not(.gm-control-active):not(.mejs):not(.owl-prev):not( + .owl-next + ):not(.mec-googlemap-details button):not(.mec-googlemap-skin button), +.lity-content input[type="submit"], +.lity-content input[type="reset"], +.lity-content input[type="button"], +.lity-content input[type="submit"], +.mec-nextprev-next-button, +.mec-nextprev-prev-button { + position: relative; + border: 1px solid #ccecf4; + border-radius: 4px; + box-shadow: 0 1px 0 0 #fcfcfc; + color: #07bbe9; + display: inline-block; + font-size: 14px; + line-height: 18px; + text-transform: capitalize; + font-weight: 600; + text-decoration: none; + cursor: pointer; + margin-bottom: 20px; + margin-right: 10px; + padding: 10px 24px 10px; + background: #ecf9fd; + -webkit-transition: all 0.21s ease; + -moz-transition: all 0.21s ease; + transition: all 0.21s ease; +} + +.mec-wrap .button:hover, +.mec-wrap a.button:hover, +.mec-wrap + button:not(.owl-dot):not(.gm-control-active):not(.mejs):not(.owl-prev):not( + .owl-next + ):hover, +.mec-wrap input[type="submit"]:hover, +.mec-wrap input[type="reset"]:hover, +.mec-wrap input[type="button"]:hover, +.lity-content .button:hover, +.lity-content + button:not(.owl-dot):not(.gm-control-active):not(.mejs):not(.owl-prev):not( + .owl-next + ):hover, +.lity-content input[type="submit"]:hover, +.lity-content input[type="reset"]:hover, +.lity-content input[type="button"]:hover, +.lity-content input[type="submit"]:hover { + border: 1px solid #38d5ed; + box-shadow: 0 1px 0 0 #fafafa; +} + +.mec-wrap .button svg, +.mec-wrap + button:not(.owl-dot):not(.gm-control-active):not(.mejs):not(.owl-prev):not( + .owl-next + ):not(.et-fb-button) + svg, +.mec-wrap input[type="submit"] svg, +.mec-wrap input[type="reset"] svg, +.mec-wrap input[type="button"] svg, +.lity-content .button svg, +.lity-content + button:not(.owl-dot):not(.gm-control-active):not(.mejs):not(.owl-prev):not( + .owl-next + ):not(.et-fb-button) + svg, +.lity-content input[type="submit"] svg, +.lity-content input[type="reset"] svg, +.lity-content input[type="button"] svg, +.mec-nextprev-next-button svg, +.mec-nextprev-prev-button svg { + margin-left: 30px; +} + +.mec-wrap .button svg.back, +.mec-wrap + button:not(.owl-dot):not(.gm-control-active):not(.mejs):not(.owl-prev):not( + .owl-next + ):not(.et-fb-button) + svg.back { + margin-right: 30px; + margin-left: 0; +} + +/* Form Builder Button */ +.mec-booking-form-container button { + display: block; +} + +/* Distance (Vertical Spaces) */ +.vertical-space, +.vertical-space1, +.vertical-space2, +.vertical-space3, +.vertical-space4, +.vertical-space5 { + display: block; + width: 100%; + margin: 0; + clear: both; + border: 0 none; + height: 20px; +} + +.vertical-space2 { + height: 40px; +} + +.vertical-space3 { + height: 60px; +} + +.vertical-space4 { + height: 80px; +} + +.vertical-space5 { + height: 100px; +} + +* + html hr.vertical-space, +* + html hr.vertical-space1, +* + html hr .vertical-space2, +* + html hr.vertical-space3, +* + html hr.vertical-space4, +* + html hr.vertical-space5 { + height: 0; + margin: 10px 0; + background: #fff; + border: 1px solid #fff; +} + +* + html hr.vertical-space2 { + margin: 20px 0; +} + +* + html hr.vertical-space3 { + margin: 30px 0; +} + +* + html hr.vertical-space4 { + margin: 40px 0; +} + +* + html hr.vertical-space5 { + margin: 50px 0; +} + +@media only screen and (max-width: 479px) { + .vertical-space, + .vertical-space1 { + height: 8px; + } + + .vertical-space2 { + height: 14px; + } + + .vertical-space3 { + height: 28px; + } + + .vertical-space4 { + height: 40px; + } + + .vertical-space5 { + height: 60px; + } +} + +@media only screen and (max-width: 960px) { + .vertical-space, + .vertical-space1 { + height: 12px; + } + + .vertical-space2 { + height: 18px; + } + + .vertical-space3 { + height: 36px; + } + + .vertical-space4 { + height: 50px; + } + + .vertical-space5 { + height: 80px; + } +} + +.mec-wrap abbr { + cursor: auto; + border-bottom: 0; +} + +/* Rotating Keyframe */ +@-webkit-keyframes rotating { + from { + -ms-transform: rotate(0deg); + -moz-transform: rotate(0deg); + -webkit-transform: rotate(0deg); + -o-transform: rotate(0deg); + transform: rotate(0deg); + } + + to { + -ms-transform: rotate(360deg); + -moz-transform: rotate(360deg); + -webkit-transform: rotate(360deg); + -o-transform: rotate(360deg); + transform: rotate(360deg); + } +} + +@keyframes rotating { + from { + -ms-transform: rotate(0deg); + -moz-transform: rotate(0deg); + -webkit-transform: rotate(0deg); + -o-transform: rotate(0deg); + transform: rotate(0deg); + } + + to { + -ms-transform: rotate(360deg); + -moz-transform: rotate(360deg); + -webkit-transform: rotate(360deg); + -o-transform: rotate(360deg); + transform: rotate(360deg); + } +} + +/* --------------------- + + + + /* # Modern Events Calendar (WP Plugin) Styles + ================================================== */ +.mec-wrap { + font: 14px/25px; + font-weight: 400; + color: #626262; +} + +.mec-wrap .mec-events a { + border-bottom: none; +} + +.mec-wrap .mec-container a { + box-shadow: none; +} + +.mec-event-content p { + font-weight: 300; +} + +.mec-wrap .mec-clear:before, +.mec-wrap .mec-clear:after { + content: " "; + display: table; +} + +.mec-wrap .mec-clear:after { + clear: both; +} + +.mec-events-button { + background: #fff; + padding: 12px 28px; + font-size: 15px; + font-weight: 400; + letter-spacing: 0; + border: 1px solid #e3e3e3; + border-radius: 2px; + text-shadow: none; + margin-right: 10px; + box-shadow: 0 2px 0 0 rgb(0 0 0 / 3%); + transition: 0.3s; +} + +.mec-wrap .mec-events-button:hover { + color: #fff; +} + +.mec-no-event { + display: none; +} + +/* MEC Current Day Event Toggle + -------------------------- */ +#mec-active-current { + display: block; +} + +.current-hide #mec-active-current { + display: none !important; +} + +/* MEC Events Grid Classic + -------------------------- */ +.mec-event-grid-classic .mec-event-article { + position: relative; + border: 2px solid #e3e3e3; + box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.016); + margin-bottom: 30px; + max-width: none; +} + +.mec-event-grid-classic .mec-event-content { + color: #767676; + padding: 0 20px 5px; + text-align: center; + min-height: 125px; +} + +.mec-event-grid-classic .mec-event-title { + color: #202020; + margin: 10px 0; + font-weight: bold; + font-size: 20px; + letter-spacing: 1px; + text-transform: uppercase; +} + +.mec-event-grid-classic .mec-event-title a { + color: #202020; + transition: all 0.24s ease; +} + +.mec-event-grid-classic .mec-event-date { + font-weight: 400; + font-size: 11px; + text-transform: uppercase; + letter-spacing: 1px; + color: #fff; + padding: 3px 20px; + margin: 0 -20px 20px -20px; + text-align: center; +} + +.widget_mec_mec_widget .mec-event-grid-classic .mec-event-date { + margin: 0; +} + +.mec-event-grid-classic .mec-event-content p { + font-size: 15px; + color: #8a8a8a; +} + +.mec-event-grid-classic .mec-event-content .mec-grid-event-location { + margin: 0; + font-size: 12px; + font-weight: 400; + line-height: 16px; +} + +.mec-event-grid-classic .mec-event-detail { + display: none; +} + +.mec-event-grid-classic .mec-price-details { + font-size: 12px; + font-weight: 400; +} + +.mec-event-grid-classic img { + margin-bottom: 0; + width: 100%; +} + +.mec-event-footer { + position: relative; + border-top: 1px solid #efefef; + padding: 20px; + min-height: 80px; + margin: 0; + background: #fafafa; +} + +.mec-event-sharing-wrap { + left: 15px; + position: absolute; + list-style: none; + margin: 0; + padding-left: 0; +} + +.mec-event-sharing-wrap .mec-event-sharing { + position: absolute; + padding: 8px 0 2px; + left: -6px; + bottom: 54px; + margin: 0; + margin-top: 6px; + border-radius: 5px; + min-width: 50px; + visibility: hidden; + opacity: 0; + border: 1px solid #e2e2e2; + background: #fff; + box-shadow: 0 0 9px 0 rgba(0, 0, 0, 0.06); + z-index: 99; + -webkit-transition: all 0.18s ease; + transition: all 0.18s ease; +} + +.mec-event-sharing-wrap .mec-event-sharing:after, +.mec-event-sharing-wrap .mec-event-sharing:before { + content: ""; + display: block; + position: absolute; + bottom: -10px; + left: 50%; + margin-left: -10px; + width: 0; + height: 0; + border-style: solid; + border-width: 10px; +} + +.mec-event-sharing-wrap .mec-event-sharing:before { + bottom: -21px; + border-color: #e2e2e2 transparent transparent transparent; +} + +.mec-event-sharing-wrap .mec-event-sharing:after { + bottom: -19px; + border-color: #ffffff transparent transparent transparent; +} + +.mec-event-sharing-wrap:hover .mec-event-sharing { + opacity: 1; + visibility: visible; +} + +.mec-event-sharing-wrap li { + text-align: center; + border: 0; + display: block; + margin-right: 2px; + overflow: hidden; + margin: 0 auto 6px; + width: 38px; +} + +.mec-event-sharing-wrap li.mec-event-share { + height: 38px; +} + +.mec-event-sharing-wrap:hover > li { + cursor: pointer; + background-color: #40d9f1; +} + +.mec-event-sharing-wrap:hover li a { + color: #fff; +} + +.mec-event-sharing-wrap > li:first-of-type { + border: 1px solid #d9d9d9; +} + +.mec-event-sharing-wrap:hover li ul li a, +.mec-event-sharing-wrap li a { + border: none; + color: #767676; + display: block; +} + +.mec-event-sharing-wrap li a .mec-social-title { + padding-right: 10px; + display: none; +} + +.mec-event-sharing-wrap li i { + width: 36px; + height: 36px; + display: table-cell; + vertical-align: middle; +} + +.mec-event-sharing-wrap li svg { + height: 16px; +} + +.mec-event-sharing-wrap .mec-event-sharing li a { + display: block; +} + +.mec-event-sharing-wrap .mec-event-sharing li:hover a { + color: #40d9f1; +} + +.mec-event-sharing .mec-event-share:hover .event-sharing-icon { + background: #40d9f1; + border-width: 0 1px 0; + cursor: pointer; +} + +.mec-event-sharing .mec-event-map { + border-width: 1px 0 1px; +} + +.mec-event-footer .mec-booking-button { + box-shadow: none; + transition: all 0.21s ease; + font-size: 11px; + font-weight: 500; + letter-spacing: 1px; + text-transform: uppercase; + background: #fff; + color: #767676; + border: 1px solid #e8e8e8; + position: absolute; + top: 20px; + right: 15px; + padding: 0 16px; + line-height: 37px; + height: 38px; + border-radius: 2px; +} + +.mec-event-footer .mec-booking-button:hover { + background: #191919; + color: #fff; + border-color: #191919; +} + +@media only screen and (max-width: 960px) { + .mec-event-grid-classic { + margin-bottom: 30px; + } +} + +.mec-widget .mec-event-grid-classic.mec-owl-carousel { + padding: 36px 0 16px; +} + +.mec-widget .mec-event-grid-classic.mec-owl-carousel .owl-nav { + margin: 5px 0; + width: 100%; + position: absolute; + top: 15px; + padding: 0; +} + +/* Events Grid Widget */ +.mec-skin-grid-container.mec-widget { + padding-top: 18px; +} + +.mec-widget .mec-event-grid-classic.mec-owl-carousel { + padding: 20px 0 16px; +} + +.mec-widget .mec-event-grid-classic.mec-owl-carousel .owl-nav { + margin: 0; + width: 100%; + position: absolute; + top: 0; + padding: 0; +} + +.mec-widget .mec-event-grid-classic.mec-owl-carousel .owl-nav div { + position: absolute; + background: #fff; + line-height: 0; + width: 34px; + height: 26px; + padding: 6px; + text-align: center; + margin-top: -17px; + border-radius: 3px; + border: 1px solid #e2e2e2; + text-align: center; + box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.028); + transition: all 0.33s ease; +} + +.mec-skin-grid-container .mec-categories { + padding: 0; +} + +.mec-skin-grid-container .mec-categories li { + list-style: none; +} + +.mec-skin-grid-container .mec-categories li a { + color: #000; + text-align: left; + transition: all 0.23s ease; + -webkit-transition: all 0.23s ease; +} + +.mec-widget .mec-event-grid-classic.mec-owl-carousel .owl-nav i { + font-size: 12px; + color: #40d9f1; + cursor: pointer; +} + +.mec-widget .mec-event-grid-classic.mec-owl-carousel .owl-nav .owl-next { + right: 0; +} + +.mec-widget .mec-event-grid-classic.mec-owl-carousel .owl-nav .owl-prev { + left: 0; +} + +.mec-widget .mec-event-grid-classic.mec-owl-carousel .mec-event-sharing { + display: none; +} + +.mec-widget .mec-event-grid-classic.mec-owl-carousel .mec-event-footer { + text-align: center; +} + +.mec-widget + .mec-event-grid-classic.mec-owl-carousel + .mec-event-footer + .mec-booking-button { + position: static; + padding: 11px 16px; +} + +.widget .mec-event-footer ul.mec-event-sharing-wrap li a.mec-event-share-icon { + padding: 0; +} + +@media screen and (min-width: 56.875em) { + .mec-widget .mec-month-container dl { + margin-bottom: 0; + } +} + +.mec-widget .mec-event-grid-classic.owl-carousel .mec-event-footer { + text-align: right; +} + +.mec-widget .mec-event-grid-classic.owl-carousel .mec-event-sharing-wrap { + left: 5px; + padding-left: 5px; +} + +.mec-widget + .mec-event-grid-classic.owl-carousel + .mec-event-sharing-wrap + .mec-event-sharing { + left: 0; +} + +.mec-widget .mec-event-sharing-wrap .mec-event-sharing { + position: absolute; + top: auto; + bottom: 52px; + margin: 0; + margin-top: 0; + border-radius: 5px; +} + +.mec-widget .mec-event-sharing-wrap .mec-event-sharing:after { + top: auto; + bottom: -17px; + border-color: #fff transparent transparent transparent; +} + +.mec-widget .mec-event-sharing-wrap .mec-event-sharing:before { + top: auto; + bottom: -18px; + border-color: #e2e2e2 transparent transparent transparent; +} + +/* Widgets View List and Grid */ +.mec-widget .mec-event-grid-classic.mec-owl-carousel .owl-nav button { + position: absolute; + background: #fff; + padding: 6px; + margin-top: -17px; + border-radius: 3px; + border: 1px solid #e2e2e2; + box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.028); +} + +.mec-widget .mec-event-grid-classic.mec-owl-carousel .owl-nav button:hover { + background: #40d9f1; + border-color: #40d9f1; +} + +.mec-widget .mec-event-grid-classic.mec-owl-carousel .owl-nav button:hover i { + color: #fff; +} + +.mec-widget .mec-event-grid-classic.mec-owl-carousel .mec-booking-button { + width: 40%; + float: right; + color: #202020; + height: 36px; + line-height: 14px; + font-size: 12px; + width: auto; +} + +.mec-widget .mec-event-grid-classic.mec-owl-carousel .mec-booking-button:hover { + color: #fff; +} + +.mec-widget .mec-event-list-modern .col-md-2.col-sm-2, +.mec-widget .mec-event-list-modern .col-md-6.col-sm-6 { + padding: 0; + width: 100%; + display: block; + position: unset; +} + +.mec-widget .mec-event-list-modern .col-md-4.col-sm-4 .mec-booking-button { + width: 80%; + height: 46px; + line-height: 22px; + padding: 11px 20px; + float: right; +} + +.mec-widget .mec-event-list-modern .col-md-4.col-sm-4.mec-btn-wrapper { + top: auto; + bottom: 5%; +} + +@media (max-width: 480px) { + .mec-widget .mec-event-list-modern .col-md-4.col-sm-4 { + padding: 0; + } + + .mec-widget .mec-event-list-modern .col-md-4.col-sm-4 .mec-booking-button { + width: 100%; + } +} + +.mec-widget .mec-event-list-modern .mec-month-divider { + margin: 30px 0 10px 0; +} + +.mec-widget .mec-event-list-minimal .mec-event-date span { + font-size: 12px; +} + +.mec-widget .mec-event-list-minimal .mec-event-date:after { + height: 29px; +} + +.mec-widget .mec-event-list-minimal .col-md-9, +.mec-widget .mec-event-list-minimal .col-md-3 { + display: block; + width: 100%; + text-align: left; +} + +.mec-widget .mec-event-list-modern .col-md-4.col-sm-4.mec-btn-wrapper { + position: relative; +} + +.mec-widget .mec-event-list-modern .col-md-4.col-sm-4 .mec-booking-button { + width: 100%; + text-align: center; +} + +.mec-widget .mec-event-list-minimal .mec-event-date:first-child { + margin-right: 24px; +} + +/* MEC Events Grid Clean + -------------------------- */ +.mec-event-grid-clean { + margin-bottom: 10px; + max-width: none; +} + +.mec-event-grid-clean .mec-event-article { + margin-bottom: 30px; + position: relative; + border: 1px solid #e2e2e2; + text-align: center; + padding: 15px 15px 0; + background: #fff; + box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.016); +} + +.mec-event-grid-clean .mec-event-content { + background: #fff; + color: #767676; + padding: 25px 16px 0; + text-align: left; +} + +.mec-event-grid-clean .mec-event-title { + color: #202020; + margin: 0 0 10px 0; + font-weight: bold; + font-size: 21px; + text-transform: capitalize; +} + +.mec-event-grid-clean .mec-event-title a { + color: #202020; + transition: all 0.24s ease; +} + +.mec-event-grid-clean .mec-event-date { + font-weight: 400; + font-size: 11px; + text-transform: uppercase; + letter-spacing: 1px; + background-color: #40d9f1; + color: #fff; + padding: 3px 0; + margin: 0; + text-align: center; +} + +.mec-event-grid-clean .mec-event-content p { + font-size: 15px; + color: #9a9a9a; + line-height: 1.54; +} + +.mec-event-grid-clean img { + margin-bottom: 0; + width: 100%; +} + +.mec-event-grid-clean .event-grid-t2-head { + margin-bottom: 10px; + color: #fff; + padding: 9px 14px 6px; + text-align: left; +} + +.mec-event-grid-clean .event-grid-t2-head .mec-event-date { + font-size: 50px; + line-height: 50px; + float: left; + margin-right: 11px; +} + +.mec-event-grid-clean .event-grid-t2-head .mec-event-month { + text-transform: uppercase; + font-size: 17px; + line-height: 20px; + padding-top: 4px; +} + +.mec-event-grid-clean .event-grid-t2-head .mec-event-detail { + font-size: 12px; +} + +.mec-event-grid-clean .event-grid-t2-head .mec-categories li a { + margin-bottom: 10px; + color: #fff; +} + +.mec-event-grid-clean .event-grid-t2-head .mec-categories li a:hover { + color: #000; +} + +.mec-event-grid-clean .mec-event-sharing-wrap { + left: 0; + padding-left: 0; +} + +.mec-event-grid-clean .mec-event-footer { + position: relative; + border-top: 2px solid; + padding: 20px 0; + margin: 0 14px; + text-align: left; + background: none; +} + +.mec-event-grid-clean .mec-event-footer .mec-booking-button { + right: 0; +} + +.mec-event-grid-clean .row { + margin-bottom: 30px; +} + +/* MEC Events Grid Modern + -------------------------- */ +.mec-event-grid-modern { + margin-bottom: 10px; + max-width: none; +} + +.mec-event-grid-modern .mec-event-article { + position: relative; + border: 1px solid #e2e2e2; + text-align: center; + margin-bottom: 30px; + padding: 45px 15px 10px; + background: #fff; + box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.016); +} + +.mec-event-grid-modern .mec-event-content { + color: #767676; + padding: 0 15px 10px; + text-align: left; +} + +.mec-event-grid-modern .mec-event-title { + color: #202020; + margin: 0 0 10px 0; + font-weight: bold; + font-size: 24px; + text-transform: none; + letter-spacing: -1px; +} + +.mec-event-grid-modern .mec-event-title a { + color: #202020; + transition: all 0.24s ease; +} + +.mec-event-grid-modern .mec-event-content .mec-categories-wrapper, +.mec-event-grid-modern .mec-event-content .mec-shortcode-organizers { + margin-bottom: 10px; +} + +.mec-event-grid-modern .mec-event-content p, +.mec-event-grid-modern .mec-event-content .mec-categories-wrapper, +.mec-event-grid-modern .mec-event-content .mec-shortcode-organizers { + font-size: 15px; + color: #9a9a9a; + line-height: 1.54; +} + +.mec-event-grid-modern img { + margin-bottom: 0; + width: 100%; +} + +.mec-event-grid-modern .event-grid-modern-head { + margin-bottom: 0; + padding: 9px 14px 6px; + text-align: left; +} + +.mec-event-grid-modern .event-grid-modern-head .mec-event-date { + font-size: 50px; + line-height: 50px; + float: left; + margin-right: 11px; +} + +.mec-event-grid-modern .event-grid-modern-head .mec-event-month { + text-transform: uppercase; + font-size: 17px; + line-height: 20px; + padding-top: 4px; + margin-bottom: 5px; +} + +.mec-event-grid-modern .event-grid-modern-head .mec-event-detail { + font-size: 12px; +} + +.mec-event-grid-modern .event-grid-modern-head .mec-event-day { + margin-top: 9px; + color: #c0c0c0; + font-size: 35px; + font-weight: 100; + text-transform: uppercase; + letter-spacing: -1px; +} + +.mec-event-grid-modern .mec-event-footer { + position: relative; + height: 90px; + padding: 20px 0; + border: none; + margin: 0 14px; + text-align: left; + background: none; +} + +.mec-event-grid-modern .mec-event-footer .mec-booking-button { + right: auto; + left: 0; +} + +.mec-event-grid-modern .mec-event-sharing-wrap { + left: auto; + right: 0; + padding-left: 0; +} + +.mec-event-grid-modern .mec-event-sharing { + left: auto; + right: -6px; +} + +.mec-event-grid-modern .mec-event-sharing-wrap li { + border-radius: 55px; +} + +.mec-event-grid-modern .row { + margin-bottom: 0; +} + +@media only screen and (max-width: 479px) { + .mec-event-grid-modern .mec-event-article { + padding-bottom: 30px; + } + + .mec-event-grid-modern .mec-event-sharing { + top: 60px; + left: 0; + right: auto; + } + + .mec-event-grid-modern .mec-event-footer .mec-booking-button { + top: 0; + } +} + +/* MEC Events Sold Out + ------------------------------------ */ +span.mec-event-title-soldout { + font-size: 8px; + font-weight: 700; + letter-spacing: 0.5px; + text-transform: uppercase; + background: #e63360; + color: #fff; + padding: 3px 8px; + line-height: 1; + border-radius: 15px; + white-space: nowrap; + vertical-align: middle; +} + +/* MEC Repeating Label + ------------------------------------ */ +.mec-repeating-label { + background: #222; + color: #fff; + padding: 3px 8px; + font-size: 8px; + font-weight: 700; + letter-spacing: 0.5px; + border-radius: 40px; + display: inline-block; +} + +/* MEC Events Grid Modern Colorful + ------------------------------------ */ +.mec-event-grid-colorful .mec-event-article { + min-height: 400px; + border: none; + box-shadow: none; + background: #40d9f1; + padding-top: 25px; + margin: 0; + color: #fff; +} + +.mec-event-grid-colorful .mec-event-content { + background: none; +} + +.mec-event-grid-colorful .mec-event-content p, +.mec-event-grid-colorful .event-grid-modern-head, +.mec-event-grid-colorful .mec-event-sharing-wrap > li > a, +.mec-event-grid-colorful .event-grid-modern-head .mec-event-day, +.mec-event-grid-colorful .mec-event-title a, +.mec-event-grid-colorful .event-grid-modern-head .mec-event-date, +.mec-event-grid-colorful ul.mec-categories li.mec-category a { + color: #fff; +} + +.mec-event-grid-colorful .mec-event-footer .mec-booking-button, +.mec-event-grid-colorful .mec-event-footer .mec-modal-booking-button { + border: none; +} + +.mec-event-grid-colorful .mec-event-sharing-wrap > li { + border-color: #fff; +} + +.mec-event-grid-colorful .mec-event-sharing-wrap:hover > li { + background: #333; + border-color: #333; +} + +.mec-event-grid-colorful .mec-event-title a.mec-color-hover:hover { + color: #fff; + text-decoration: underline; +} + +.mec-event-grid-colorful .mec-event-title .event-color { + display: none; +} + +.mec-event-grid-colorful div[class^="col-md-"] { + padding: 0 1px 1px 0; + margin: 0; +} + +.mec-event-grid-colorful .mec-event-article .mec-time-details, +.mec-event-grid-colorful .mec-event-article .mec-price-details { + color: #fff; +} + +@media only screen and (min-width: 768px) { + .mec-wrap.mec-sm959.mec-event-grid-colorful + .event-grid-modern-head + .mec-event-day { + font-size: 26px; + } + + .mec-wrap.mec-sm959.mec-event-grid-colorful + .event-grid-modern-head + .mec-event-month { + font-size: 15px; + } + + .mec-wrap.mec-sm959.mec-event-grid-colorful + .event-grid-modern-head + .mec-event-date { + font-size: 50px; + } + + .mec-wrap.mec-sm959.mec-event-grid-colorful .mec-event-title { + font-size: 21px; + } + + .mec-wrap.mec-sm959.mec-event-grid-colorful .mec-event-content p { + font-size: 13px; + } + + .mec-wrap + .mec-event-grid-colorful + .col-md-3.col-sm-3 + .mec-event-sharing-wrap { + bottom: 100px; + } +} + +@media only screen and (min-width: 768px) and (max-width: 1200px) { + .mec-wrap.mec-sm959.mec-event-grid-colorful div[class^="col-md-"] { + width: 50%; + } +} + +/* MEC Event-list Minimal + -------------------------- */ +.mec-event-list-minimal .mec-event-article { + border-bottom: 1px solid #efefef; + padding: 24px 0 16px; +} + +.mec-event-list-minimal .mec-wrap .col-md-9 { + padding: 0; +} + +.mec-event-list-minimal .mec-event-date { + position: relative; + float: left; + margin-right: 30px; + color: #fff; + width: 52px; + padding: 6px 4px 3px; + text-align: center; + text-transform: uppercase; + border-radius: 3px; +} + +.mec-event-list-minimal .mec-event-date { + min-width: 52px; + width: fit-content; +} + +.mec-event-list-minimal .mec-event-date:nth-child(2) { + margin: 0 30px 0 -20px; +} + +.mec-event-list-minimal .mec-event-date span { + display: block; + font-size: 24px; + font-weight: 700; + text-align: center; + margin-bottom: 4px; +} + +.mec-event-list-minimal .mec-event-date:after { + display: block; + content: ""; + position: absolute; + width: 50px; + left: 1px; + top: 1px; + height: 34px; + background: rgba(255, 255, 255, 0.1); + box-shadow: 0 4px 4px rgba(0, 0, 0, 0.02); +} + +.mec-event-list-minimal .mec-event-date:after { + width: 100%; +} + +.mec-event-list-minimal .mec-event-title { + margin-top: 0; + margin-bottom: 10px; + font-weight: 700; + font-size: 18px; + text-transform: uppercase; + letter-spacing: 0; + padding-top: 10px; +} + +.mec-event-list-minimal .mec-time-details, +.mec-event-list-minimal .mec-event-detail, +.mec-event-list-minimal .mec-price-details, +.mec-event-list-minimal .mec-categories-wrapper, +.mec-event-list-minimal .mec-shortcode-organizers { + font-size: 15px; + font-weight: 300; + line-height: 1; + letter-spacing: 0; + color: #9a9a9a; + margin-bottom: 10px; +} + +.mec-event-list-minimal .btn-wrapper { + text-align: right; + padding-right: 0; + padding-top: 6px; + text-align: center; +} + +.mec-event-list-minimal .btn-wrapper .mec-detail-button { + border-bottom: 0; + margin-bottom: 14px; + margin-right: 0; + box-shadow: none; +} + +.mec-event-list-minimal a.mec-detail-button { + text-align: center; + display: inline-block; + background: #ededed; + color: #191919; + padding: 12px; + border-radius: 2px; + font-size: 11px; + font-weight: 700; + text-transform: uppercase; + letter-spacing: 2px; + transition: all 0.24s ease; +} + +.mec-event-list-minimal a.mec-detail-button:hover { + background: #292929; + color: #fff; +} + +.vc_col-sm-4 .mec-event-list-minimal .mec-event-date, +.vc_col-sm-6 .mec-event-list-minimal .mec-event-date { + margin-right: 12px; +} + +.vc_col-sm-4 .mec-event-list-minimal .mec-event-title, +.vc_col-sm-6 .mec-event-list-minimal .mec-event-title { + font-size: 15px; + letter-spacing: 2px; +} + +@media only screen and (min-width: 480px) and (max-width: 767px) { + .mec-event-list-minimal .btn-wrapper { + padding-left: 0; + } + + .mec-event-list-minimal .mec-event-date { + margin-right: 10px; + } +} + +@media only screen and (max-width: 767px) { + .mec-event-list-minimal .btn-wrapper .mec-detail-button { + display: block; + text-align: center; + margin: 0; + margin-top: 16px; + padding: 8px; + } + + .mec-event-list-minimal .btn-wrapper { + margin: 12px 0; + } +} + +@media only screen and (max-width: 479px) { + .mec-event-list-minimal .mec-event-date { + float: none; + width: 160px; + margin: 8px auto; + } + + .mec-event-list-minimal .mec-event-date span { + display: inline; + padding-right: 25px; + margin-right: 7px; + font-size: inherit; + } + + .mec-event-list-minimal .mec-event-date:after { + width: 45%; + box-shadow: 4px 0 4px rgba(0, 0, 0, 0.02); + } + + .mec-event-list-minimal .btn-wrapper { + text-align: center; + padding-left: 0; + } + + .mec-event-list-minimal { + text-align: center; + } + + .mec-event-list-minimal .mec-event-detail { + margin-bottom: 10px; + } +} + +@media only screen and (min-width: 479px) { + .mec-event-list-minimal .mec-event-article { + display: flex; + align-items: center; + justify-content: space-between; + } +} + +/* MEC Event-list Modern + -------------------------- */ +.mec-wrap .mec-event-list-modern .mec-event-title { + margin-top: 0; + margin-bottom: 10px; +} + +.mec-event-list-modern .mec-event-article { + border-bottom: 1px solid #efefef; + padding: 30px 0 10px; +} + +.mec-event-list-modern .mec-event-article:last-child { + border-bottom: none; +} + +.mec-event-list-modern .mec-event-title a { + color: #191919; + transition: all 0.24s ease; + box-shadow: none; +} + +.mec-event-list-modern .mec-event-date { + text-transform: uppercase; + padding: 10px 0; +} + +.mec-event-list-modern .mec-event-date .event-d { + font-size: 48px; + display: table-cell; + padding: 10px 0 0; +} + +.mec-event-list-modern .mec-event-date .event-d.mec-multiple-dates { + font-size: 20px; + padding: 0; +} + +.mec-event-list-modern .mec-event-date.mec-multiple-date-event:first-child { + padding: 10px 0 6px 0; + position: relative; + width: fit-content; +} + +.mec-event-list-modern + .mec-event-date.mec-multiple-date-event:first-child:after { + content: ""; + position: absolute; + bottom: 0; + left: 0; + width: 100%; + height: 1px; + background: silver; +} + +.mec-event-list-modern .mec-event-date.mec-multiple-date-event:last-child { + padding: 5px 0 10px 0; +} + +.mec-event-list-modern .mec-event-date.mec-multiple-date-event .event-d { + font-size: 20px; + padding: 0; +} + +.mec-event-list-modern .mec-event-date.mec-multiple-date-event .event-da { + font-size: 20px; + margin: 0; +} + +.mec-event-list-modern .mec-event-date .event-f { + font-size: 13px; + display: table-cell; + vertical-align: middle; + padding-left: 7px; + font-weight: 500; + letter-spacing: 3px; + color: #777; +} + +.mec-event-list-modern .mec-event-detail { + font-weight: 300; + color: #8a8a8a; +} + +.mec-event-list-modern .mec-event-detail .mec-time-details { + display: inline; +} + +.mec-event-list-modern .mec-event-date .event-da { + margin-top: 9px; + color: silver; + font-size: 28px; + font-weight: 100; + text-transform: uppercase; + letter-spacing: -1px; + text-align: left; +} + +.mec-event-list-modern .mec-btn-wrapper .mec-booking-button { + border-radius: 1px; + letter-spacing: 2px; + border: 1px solid #e6e6e6; + color: #333; + background-color: #fff; + padding: 13px 20px; + font-weight: 700; + font-size: 11px; + box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.016); + transition: all 0.28s ease; +} + +.mec-event-list-modern .mec-btn-wrapper .mec-booking-button:hover { + border-color: #222; + background: #222; + color: #fff; +} + +.mec-event-list-modern .mec-event-title { + font-weight: 700; + font-size: 20px; + text-transform: uppercase; + letter-spacing: 1px; +} + +.mec-event-list-modern .mec-event-detail, +.mec-event-list-modern .mec-price-details, +.mec-event-list-modern .mec-shortcode-organizers, +.mec-event-list-modern .mec-categories-wrapper { + color: #9a9a9a; + font-size: 15px; + font-weight: 300; + line-height: 25px; +} + +.mec-event-list-modern .mec-btn-wrapper { + text-align: right; + padding: 10px 0; + text-transform: uppercase; +} + +.mec-event-list-modern .mec-event-sharing { + position: relative; + margin: 10px 0; + padding-left: 0; +} + +.mec-event-list-modern .mec-event-sharing > li { + display: inline-block; + border: none; + border-radius: 50%; + margin-right: 10px; + margin-bottom: 5px; +} + +/* +.mec-event-list-modern .mec-event-sharing .telegram { + min-width: 36px; + min-height: 36px; + line-height: 36px; + padding: 9px 1px 10px; + border-radius: 60px; +} + +.mec-event-list-modern .mec-event-sharing>li .telegram { + padding-top: 8px; + padding-bottom: 9px; + border-radius: 50%; + border: 1px solid #ddd; +} */ + +/* .mec-event-list-modern .mec-event-sharing .telegram .svg-inline--fa.fa-telegram.fa-w-16 { + width: 3.246rem; + padding: 2px 10px 0 10px; + margin-bottom: -2px; +} + +.mec-event-list-modern .mec-event-sharing .telegram .svg-inline--fa.fa-telegram.fa-w-16 path { + fill: #767676; +} + +.mec-event-list-modern .mec-event-sharing li:hover .telegram { + background-color: #40d9f1; +} + +.mec-event-list-modern .mec-event-sharing li:hover .telegram .svg-inline--fa.fa-telegram.fa-w-16 path { + fill: #fff; +} */ + +.mec-event-list-modern .mec-event-sharing > li:hover { + display: inline-block; +} + +.mec-event-list-modern .mec-event-sharing > li:hover a i { + color: #fff; + background: #40d9f1; + border-color: #40d9f1; +} + +.mec-event-list-modern .mec-event-sharing > li i { + width: 36px; + display: inline-block; + line-height: 35px; + color: #767676; + text-align: center; + border-radius: 50%; + border: 1px solid #ddd; + font-size: 14px; + margin-right: 3px; + transition: all ease 300ms; +} + +.mec-event-list-modern .mec-event-sharing > li i svg { + height: 16px; + vertical-align: middle; +} + +.mec-event-list-modern .mec-event-sharing > li .mec-social-title { + color: #767676; + font-size: 14px; +} + +.mec-event-list-modern + .mec-event-sharing + .mec-event-share:hover + .mec-event-sharing-icon { + background: #40d9f1; + border-color: #40d9f1; + cursor: pointer; + border-radius: 50%; +} + +.mec-event-list-modern .mec-event-sharing li:hover a i { + background: #40d9f1; +} + +/* +.mec-event-list-modern .mec-event-sharing li .fa-telegram { + fill: #000; + max-width: 20px !important; + width: 20px !important; + max-height: 20px !important; + height: 20px; + position: relative; + padding: 0 !important; + margin-bottom: -4px !important; +} + +.mec-event-list-modern .mec-event-sharing li .fa-telegram * { + transform: scale(0.04); +} + +.mec-event-list-modern .mec-event-sharing li .svg-inline--fa.fa-telegram.fa-w-16 path { + fill: #767676; +} + +.mec-event-list-modern .mec-event-sharing li .telegram { + width: 36px !important; + height: 36px !important; + padding: 9px 7px 9px; +} */ + +@media only screen and (min-width: 768px) { + .mec-event-list-modern .mec-event-article { + position: relative; + min-height: 160px; + overflow: visible; + } + + .mec-event-list-modern .col-md-2.col-sm-2 { + width: 210px; + position: absolute; + left: 0; + top: 20px; + padding: 0; + } + + .mec-event-list-modern .col-md-4.col-sm-4.mec-btn-wrapper { + padding: 0; + position: absolute; + right: 0; + top: 30%; + } + + .mec-event-list-modern .col-md-6.col-sm-6 { + width: 100%; + padding-left: 225px; + padding-right: 195px; + } +} + +@media only screen and (max-width: 767px) { + .mec-event-list-modern .mec-btn-wrapper .mec-booking-button { + letter-spacing: 1px; + border: 1px solid #e1e1e1; + } + + .mec-event-list-modern .mec-btn-wrapper { + padding: 0 0 12px; + } + + .mec-event-list-modern .mec-event-sharing { + margin-bottom: 0; + } + + .mec-event-list-modern .mec-event-sharing li { + margin-bottom: 7px; + } +} + +/* MEC Event-grid Minimal + -------------------------- */ +.mec-event-grid-minimal .mec-event-article { + margin: 15px 0; + min-height: 80px; + display: table; +} + +.mec-event-grid-minimal .event-detail-wrap { + display: table-cell; + vertical-align: middle; +} + +.mec-event-grid-minimal .mec-event-date { + width: 70px; + float: left; + margin-right: 20px; + padding: 12px 16px 10px; + text-align: center; + text-transform: uppercase; + border-radius: 4px; + border: 1px solid #e6e6e6; + transition: all 0.37s ease-in-out; + box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.016); +} + +.mec-event-grid-minimal .mec-event-date span { + display: block; + font-size: 24px; + font-weight: 700; + text-align: center; + margin-bottom: 4px; + color: #2a2a2a; + transition: color 0.3s ease; +} + +.mec-event-grid-minimal .mec-event-title { + margin-top: 0; + margin-bottom: 10px; + font-weight: 700; + line-height: 21px; + font-size: 16px; + text-transform: uppercase; + transition: color 0.3s ease; +} + +.mec-event-grid-minimal .mec-event-title a { + color: #191919; + transition: color 0.3s ease; +} + +.mec-event-grid-minimal .mec-time-details, +.mec-event-grid-minimal .mec-event-detail .mec-event-loc-place, +.mec-event-grid-minimal .mec-event-detail .mec-categories-wrapper, +.mec-event-grid-minimal + .mec-event-detail + .mec-categories-wrapper + ul.mec-categories + li.mec-category + a, +.mec-event-grid-minimal .mec-event-detail .mec-shortcode-organizers, +.mec-event-grid-minimal .mec-event-detail .mec-price-details { + font-size: 15px; + font-weight: 300; + line-height: 1; + letter-spacing: 0; + color: #9a9a9a; + margin-bottom: 10px; +} + +.mec-event-grid-minimal .mec-event-date:hover { + color: #fff; +} + +.mec-event-grid-minimal .mec-event-date:hover span { + color: #fff; +} + +.mec-wrap .mec-event-grid-minimal .mec-event-date:hover { + color: #fff; +} + +/* MEC Event-list Classic + -------------------------- */ +.mec-event-list-classic .mec-event-article { + padding: 12px 0; + margin-bottom: 20px; +} + +.mec-event-list-classic .mec-event-image { + float: left; + width: 86px; + margin-right: 20px; +} + +.mec-event-list-classic .mec-event-date, +.mec-event-list-classic .mec-event-time { + font-weight: 400; + font-size: 13px; + letter-spacing: 0; + line-height: 18px; + text-align: left; + display: initial; + margin-right: 12px; +} + +.mec-event-list-classic .mec-event-time .mec-time-details, +.mec-event-list-classic .mec-event-time i { + display: inline; + margin-right: 3px; +} + +.mec-event-list-classic .mec-event-date span { + font-weight: 500; + margin-bottom: 6px; +} + +.mec-event-list-classic .mec-event-title { + font-size: 15px; + margin: 10px 0 12px; + font-weight: 700; + text-transform: uppercase; +} + +.mec-event-list-classic .mec-event-title a { + color: #494949; + transition: color 0.3s ease; +} + +.mec-event-list-classic .mec-event-detail, +.mec-event-list-classic .mec-price-details { + color: #777; + font-weight: 400; + line-height: 12px; + font-size: 12px; + overflow: hidden; +} + +@media only screen and (max-width: 480px) { + .mec-event-list-classic .mec-event-detail { + float: right; + width: calc(100% - 104px); + } +} + +.mec-event-list-classic a.magicmore { + padding: 10px 16px; + color: #fff; + background: #222; + letter-spacing: 2px; + font-size: 11px; +} + +.mec-event-list-classic a.magicmore:after { + content: ""; + display: none; +} + +.mec-event-list-classic a.magicmore:hover { + color: #40d9f1; +} + +/* MEC Event-grid Simple + -------------------------- */ +.mec-event-grid-simple .mec-event-article { + position: relative; + margin-bottom: 30px; +} + +.mec-event-grid-simple .mec-event-article:after { + border-right: 1px solid #e6e6e6; + height: 60px; + position: absolute; + top: 50%; + margin-top: -30px; + right: -1px; +} + +.mec-event-grid-simple .row div:last-child .mec-event-article:after { + border: none; +} + +.mec-event-grid-simple .row { + margin: 15px 0 30px; + text-align: center; +} + +.mec-event-grid-simple .mec-event-date { + padding: 0; + margin: 0; + text-transform: capitalize; + font-size: 12px; + font-weight: 700; +} + +.mec-event-grid-simple .mec-event-title { + margin-top: 0; + margin-bottom: 10px; + font-weight: 700; + line-height: 21px; + font-size: 15px; + padding-top: 5px; + padding-left: 5px; + padding-right: 5px; + text-transform: uppercase; + transition: color 0.37s ease; +} + +.mec-event-grid-simple .mec-event-title a { + color: #494949; + transition: color 0.3s ease; +} + +.mec-event-grid-simple .mec-event-detail { + font-weight: 400; + line-height: 1; + letter-spacing: 0; + font-size: 13px; + color: #777; +} + +.mec-event-grid-simple .mec-event-detail .mec-time-details { + margin-top: 7px; +} + +.mec-event-grid-simple .mec-event-title:hover { + color: #40d9f1; +} + +.mec-event-grid-simple .mec-event-date:hover { + background: transparent; +} + +.event-last:after { + display: none; +} + +@media only screen and (max-width: 767px) { + .mec-event-grid-simple .mec-event-article { + padding-bottom: 20px; + margin-bottom: 20px; + border-bottom: 1px solid #eee; + } + + .mec-event-grid-simple .mec-event-article:after { + border: none; + } +} + +/* MEC Event-grid Novel */ +.mec-event-grid-novel .mec-event-article { + position: relative; + margin-bottom: 30px; + padding: 60px 5% 60px 7%; + border: 1px solid rgba(255, 255, 255, 0.12); + border-radius: 10px; + background-color: #0050fd; + -webkit-transition: all 0.3s ease; + -o-transition: all 0.3s ease; + transition: all 0.3s ease; + z-index: 1; +} + +.mec-event-grid-novel .mec-event-article .novel-grad-bg { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + border-radius: 10px; + opacity: 0; + z-index: -1; + -webkit-transition: all 0.3s ease; + -o-transition: all 0.3s ease; + transition: all 0.3s ease; +} + +.mec-event-grid-novel .mec-event-article:hover { + -webkit-box-shadow: 0 13px 36px 0 rgba(0, 0, 0, 0.23); + box-shadow: 0 13px 36px 0 rgba(0, 0, 0, 0.23); + border-color: transparent; +} + +.mec-event-grid-novel .mec-event-article:hover .novel-grad-bg { + background-image: -webkit-gradient( + linear, + left top, + right top, + from(rgb(38, 46, 50)), + to(rgb(14, 16, 21)) + ); + background-image: -webkit-linear-gradient( + left, + rgb(38, 46, 50) 0%, + rgb(14, 16, 21) 100% + ); + background-image: -o-linear-gradient( + left, + rgb(38, 46, 50) 0%, + rgb(14, 16, 21) 100% + ); + background-image: linear-gradient( + 90deg, + rgb(38, 46, 50) 0%, + rgb(14, 16, 21) 100% + ); + opacity: 1; +} + +.mec-event-grid-novel .mec-event-image { + float: left; + width: 150px; + height: 150px; +} + +.mec-event-grid-novel .mec-event-image img { + width: 150px; + height: 150px; + border-radius: 50%; +} + +.mec-event-grid-novel .mec-event-detail-wrap { + margin-left: 200px; +} + +.mec-event-grid-novel .mec-event-content h4 { + position: relative; + margin-bottom: 10px; + display: inline-block; +} + +.mec-event-grid-novel .mec-event-content h4 a { + font-size: 24px; + line-height: 35px; + color: #fafcff; +} + +.mec-event-grid-novel + .mec-event-content + h4.mec-gCalendar-search-text-wrap + input[type="text"]:before { + content: ""; + position: absolute; + top: 8px; + left: -30px; + width: 17px; + height: 17px; + background: #5cd0ed; + opacity: 0.4; + border-radius: 50%; + padding-right: 5px; +} + +.mec-skin-grid-container .mec-event-grid-novel .mec-categories li a { + color: #fff; +} + +.mec-event-grid-novel .mec-local-time-details, +.mec-event-grid-novel .mec-event-month, +.mec-event-grid-novel .mec-event-detail, +.mec-event-grid-novel .mec-event-address { + position: relative; + padding-left: 35px; + font-size: 15px; + line-height: 30px; + color: rgba(255, 255, 255, 0.4); +} + +.mec-event-grid-novel .mec-price-details { + position: relative; + padding-left: 7px; + font-size: 15px; + line-height: 30px; + color: rgba(255, 255, 255, 0.4); +} + +.mec-event-grid-novel .mec-price-details i { + margin-right: 8px; +} + +.mec-event-grid-novel .mec-local-time-details:before, +.mec-event-grid-novel .mec-event-month::before, +.mec-event-grid-novel .mec-event-detail::before, +.mec-event-grid-novel .mec-event-address::before, +.mec-event-grid-novel .mec-categories-wrapper::before { + position: absolute; + top: 6px; + left: 6px; + font-size: 17px; + font-family: "simple-line-icons"; + font-style: normal; + font-weight: normal; + font-variant: normal; + text-transform: none; + line-height: 1; +} + +.mec-event-grid-novel .mec-local-time-details::before { + content: "\e007"; +} + +.mec-event-grid-novel .mec-event-month::before { + content: "\e075"; +} + +.mec-event-grid-novel .mec-event-detail::before { + content: "\e081"; +} + +.mec-event-grid-novel .mec-event-address::before { + content: "\e096"; +} + +.mec-event-grid-novel .mec-categories-wrapper::before { + content: "\e089"; +} + +.mec-event-grid-novel .mec-event-footer { + clear: both; + padding: 20px 0; + border-top: none; + background: transparent; +} + +.mec-event-grid-novel .mec-event-footer .mec-booking-button { + right: 0; + left: auto; + height: 38px; + width: 148px; + padding: 0 20px; + font-size: 14px; + font-weight: normal; + line-height: 38px; + text-align: center; + color: #fff; + background: transparent; + border-color: rgba(255, 255, 255, 0.1); + border-radius: 50px; +} + +.mec-event-grid-novel .mec-event-footer .mec-booking-button:hover { + background-color: rgba(255, 255, 255, 0.1); +} + +.mec-event-grid-novel .mec-event-sharing-wrap { + left: 0; + cursor: pointer; + padding-left: 0; +} + +.mec-event-grid-novel .mec-event-sharing-wrap > li { + border-color: rgba(255, 255, 255, 0.1); + border-radius: 50%; +} + +.mec-event-grid-novel .mec-event-sharing-wrap li.mec-event-share { + position: absolute; + z-index: 2; +} + +.mec-event-grid-novel .mec-event-sharing-wrap .mec-event-sharing { + top: -6px; + left: 0; + padding: 5px 10px 2px 50px; + min-width: 150px; + width: inherit; + height: 38px; + background-color: rgba(255, 255, 255, 0.1); + -webkit-box-shadow: none; + box-shadow: none; + border: none; + border-radius: 50px; + backdrop-filter: blur(10px); +} + +.mec-event-grid-novel .mec-event-sharing-wrap:hover > li { + background-color: rgba(255, 255, 255, 0.1); +} + +.mec-event-grid-novel .mec-event-sharing-wrap .mec-event-sharing::before, +.mec-event-grid-novel .mec-event-sharing-wrap .mec-event-sharing::after { + display: none; +} + +.mec-event-grid-novel .mec-event-sharing .mec-event-social-icon, +.mec-event-grid-novel .mec-event-sharing .mec-event-social-icon a, +.mec-event-grid-novel .mec-event-sharing-wrap .mec-event-sharing li i { + display: inline; +} + +.mec-event-grid-novel .mec-event-sharing .mec-event-social-icon a { + padding: 0 10px; +} + +.mec-event-grid-novel .mec-event-sharing-wrap > li a { + color: #fff; +} + +.mec-event-grid-novel .mec-event-sharing-wrap .mec-event-sharing li a { + color: rgba(255, 255, 255, 0.4); +} + +.mec-event-grid-novel .mec-event-sharing-wrap .mec-event-sharing li a:hover { + color: rgba(255, 255, 255, 1); +} + +/* Fix Icons */ +.mec-event-grid-novel .mec-event-sharing-wrap li.mec-event-social-icon { + margin: 0; + width: auto; +} + +.mec-event-grid-novel .mec-event-sharing-wrap .mec-event-sharing { + display: flex; + align-items: center; + padding-top: 0; +} + +.mec-event-grid-novel .mec-event-sharing-wrap .mec-event-sharing li a { + display: flex; + align-items: center; + width: 31px; +} + +.mec-event-grid-novel .mec-event-sharing-wrap li.mec-event-social-icon a i { + width: auto; + height: auto; +} + +.mec-event-grid-novel .mec-event-sharing-wrap li.mec-event-social-icon a svg { + fill: rgba(255, 255, 255, 0.4); + padding: 0; + width: 36px; + height: 36px; + border-radius: 0; + margin: 0; +} + +@media only screen and (max-width: 1200px) { + .mec-event-grid-novel .row .col-md-6.col-sm-6 { + width: 100%; + float: none; + } + + .mec-event-grid-novel .mec-event-image { + float: none; + margin-top: -20px; + margin-bottom: 20px; + } + + .mec-event-grid-novel .mec-event-detail-wrap { + margin-left: 20px; + } + + .mec-event-grid-novel .mec-event-footer { + margin-top: 30px; + } +} + +@media only screen and (max-width: 767px) { + .mec-event-grid-novel .mec-event-footer { + margin-top: 0; + padding-top: 30px; + margin-bottom: 24px; + } + + .mec-event-grid-novel .mec-event-footer .mec-booking-button { + display: block; + position: relative; + } + + .mec-event-grid-novel .mec-event-sharing-wrap { + left: 0; + bottom: -55px; + padding-left: 0; + } + + .mec-event-grid-novel .mec-event-content h4 a { + font-size: 20px; + line-height: 1.3; + } +} + +.mec-event-grid-novel .mec-event-sharing-wrap { + padding-left: 0; +} + +.mec-event-grid-novel .mec-event-sharing-wrap .mec-event-sharing { + width: fit-content; + z-index: 1; +} + +@media (min-width: 1280px) { + .mec-event-grid-novel .col-md-4.col-sm-4 .mec-event-article img { + width: 100px; + height: 100px; + } + + .mec-event-grid-novel .col-md-4.col-sm-4 .mec-event-detail-wrap { + margin-left: 150px; + } + + .mec-event-grid-novel .col-md-3.col-sm-3 .mec-event-content .mec-event-image, + .mec-event-grid-novel + .col-md-3.col-sm-3 + .mec-event-content + .mec-event-detail-wrap { + width: 100%; + } + + .mec-event-grid-novel + .col-md-3.col-sm-3 + .mec-event-content + .mec-event-detail-wrap { + margin-left: 20px; + } +} + +@media (min-width: 760px) and (max-width: 1024px) { + .mec-event-grid-novel .col-md-4.col-sm-4 { + width: 100%; + } + + .mec-event-grid-novel .mec-event-image { + float: left; + } + + .mec-event-grid-novel .col-md-4.col-sm-4 .mec-event-article img { + width: 100px; + height: 100px; + } +} + +/* MEC Event Cover Modern + -------------------------- */ +.mec-event-cover-modern { + position: relative; +} + +.mec-event-cover-modern .mec-event-cover-a { + background: transparent; + position: absolute; + color: #fff; + bottom: 0; + left: 0; + text-decoration: none; +} + +.mec-event-cover-modern .mec-event-cover-a .mec-event-overlay { + transition: all 0.5s; + opacity: 0.8; + width: 100%; + height: 100%; + position: absolute; +} + +.mec-event-cover-modern .mec-event-cover-a:hover .mec-event-overlay { + opacity: 1; +} + +.mec-event-cover-modern .mec-event-detail { + padding: 40px; + position: relative; +} + +.mec-event-cover-modern .mec-event-cover-a:hover .mec-event-tag { + color: #333; + transition: all 0.5s; +} + +.mec-event-cover-modern .mec-event-cover-a .mec-event-title:hover { + text-decoration: underline; +} + +.mec-event-cover-modern .mec-event-tag { + background: #fff; + display: inline-block; + padding: 5px 9px; + font-size: 11px; + font-weight: 600; + text-transform: uppercase; + letter-spacing: 1px; + margin-bottom: 24px; +} + +.mec-event-cover-modern .mec-event-date { + text-transform: uppercase; + font-size: 17px; + font-weight: 300; +} + +.mec-event-cover-modern .mec-event-title { + color: #fff; + text-transform: uppercase; + font-size: 40px; + font-weight: 700; + margin: 6px 0; +} + +.mec-event-cover-modern .mec-event-place { + font-weight: 400; + font-size: 18px; +} + +@media only screen and (max-width: 767px) { + .mec-event-cover-modern .mec-event-cover-a { + width: 100%; + } +} + +/* MEC Event Cover Classic + -------------------------- */ +.mec-event-cover-classic { + position: relative; + overflow: hidden; + background: #fff; + padding: 6px; + border: 1px solid #e8e8e8; +} + +.mec-event-cover-classic .mec-event-overlay { + position: absolute; + left: 6px; + right: 6px; + bottom: 6px; + top: 6px; + width: auto; + height: auto; + background-color: rgba(36, 36, 36, 0.4); + transition: all 0.33s ease-in-out; +} + +.mec-event-cover-classic:hover .mec-event-overlay { + background-color: rgba(36, 36, 36, 0.6); +} + +.mec-event-cover-classic .mec-event-content { + font-size: 15px; + color: #fff; + position: absolute; + bottom: 0; + padding: 50px 35px; + transition: all 0.33s ease-in-out; +} + +.mec-event-cover-classic .mec-event-date { + font-size: 14px; + text-transform: uppercase; + font-weight: 400; + line-height: 1.6; + text-align: left; +} + +.mec-event-cover-classic .mec-event-date span { + display: block; + font-weight: 700; + font-size: 16px; +} + +.mec-event-cover-classic .mec-event-title { + color: #fff; + margin: 20px 0 38px; + font-size: 24px; + font-weight: bold; + text-transform: uppercase; + font-style: normal; +} + +.mec-event-cover-classic .mec-btn-wrapper { + text-align: left; +} + +.mec-event-cover-classic .mec-event-icon { + font-size: 18px; + float: left; + margin-right: 14px; + color: #fff; + padding: 13px; +} + +.mec-event-cover-classic .mec-event-button { + color: #fff; + background-color: #191919; + border: 2px #191919 solid; + padding: 12px 20px; + letter-spacing: 3px; + font-size: 12px; + font-weight: bold; + font-style: normal; + transition: all 0.22s ease; + text-decoration: none; +} + +.mec-event-cover-classic .mec-event-button:hover { + color: #191919; + background-color: #fff; + border-color: #fff; + border-radius: 1px; +} + +.mec-event-cover-classic .mec-event-image img { + min-width: 100%; +} + +@media only screen and (max-width: 960px) { + .mec-event-cover-classic .mec-event-content { + padding: 20px; + } + + .mec-event-cover-classic .mec-event-button { + font-size: 11px; + padding: 7px 10px; + letter-spacing: 1px; + } + + .mec-event-cover-classic .mec-event-title { + font-size: 19px; + margin: 15px 0 25px; + } + + .mec-event-cover-classic .mec-event-date { + font-size: 12px; + } +} + +@media only screen and (max-width: 767px) { + .mec-event-cover-classic { + margin-bottom: 30px; + } +} + +@media only screen and (max-width: 479px) { + .mec-event-cover-classic .mec-event-content { + padding: 15px; + font-size: 15px; + } + + .mec-event-cover-classic .mec-event-title { + font-size: 15px; + margin: 10px 0; + } + + .mec-event-cover-classic .mec-event-button { + font-size: 10px; + padding: 6px; + letter-spacing: 1px; + } + + .mec-event-cover-classic .mec-event-icon { + padding: 10px; + } +} + +/* MEC LOAD MORE BUTTON + -------------------------- */ +.mec-load-more-wrap { + text-align: center; + display: block; + width: 100%; + padding-top: 20px; + text-align: center; + position: relative; +} + +.mec-load-more-button { + box-shadow: none; + transition: all 0.21s ease; + font-size: 12px; + font-weight: 500; + letter-spacing: 1px; + text-transform: uppercase; + background: #fff; + color: #767676; + border: 2px solid #e8e8e8; + border-radius: 50px; + padding: 0 28px; + margin-bottom: 20px; + cursor: pointer; + line-height: 40px; + height: 42px; + display: inline-block; +} + +.mec-load-more-button:hover { + background: #191919; + color: #fff; + border-color: #191919; +} + +.mec-load-more-loading { + content: url("../img/ajax-loader.gif"); + cursor: wait; + background: transparent; + border-style: none; +} + +.mec-load-more-loading:hover { + background: transparent; +} + +.mec-modal-preloader, +.mec-month-navigator-loading { + width: 100%; + height: 100%; + background: no-repeat rgba(255, 255, 255, 0.88) url("../img/ajax-loader.gif") + center; + border-style: none; + position: absolute; + left: 0; + right: 0; + bottom: 0; + top: 0; + z-index: 9; +} + +.mec-event-calendar-classic .mec-calendar-side .mec-calendar-table { + min-height: 1024px; +} + +.mec-calendar-side .mec-calendar-table { + min-height: 450px; +} + +.mec-skin-weekly-view-events-container.mec-month-navigator-loading { + margin-top: 0; +} + +.mec-calendar.mec-event-calendar-classic .mec-calendar-side { + display: block; +} + +.mec-skin-daily-view-events-container.mec-month-navigator-loading { + margin-top: 0; +} + +@media only screen and (min-width: 961px) { + .mec-wrap.mec-sm959 .mec-calendar-side .mec-calendar-table { + min-height: 1px; + } +} + +@media only screen and (max-width: 479px) { + .mec-calendar-side .mec-calendar-table { + min-height: 1px; + } +} + +/* MEC Event Cover Clean + -------------------------- */ +.mec-event-cover-clean { + position: relative; + border: 1px solid #e6e6e6; + padding: 8px; +} + +.mec-event-cover-clean .mec-event-overlay { + height: 100%; + background-color: rgba(36, 36, 36, 0.4); + position: absolute; + width: 100%; + left: 0; + border: 8px solid #fff; + top: 0; + transition: all 0.5s ease-in-out; +} + +.mec-event-cover-clean .mec-event-content { + color: #fff; + position: absolute; + bottom: 20px; + padding: 40px 60px; + transition: all 0.5s ease-in-out; +} + +.mec-event-cover-clean .mec-event-title { + color: #fff; + font-weight: 700; + margin: 46px 0 19px; + font-size: 29px; + text-transform: uppercase; + text-shadow: 0 0 1px rgba(0, 0, 0, 0.5); +} + +.mec-event-cover-clean .mec-event-title a { + color: #fff; + transition: all 0.5s; + text-decoration: none; + outline: none; + border: none; + box-shadow: none; +} + +.mec-event-cover-clean .mec-event-title a:hover { + text-decoration: underline; +} + +.mec-event-cover-clean .mec-event-date { + position: absolute; + top: -20px; + right: 60px; + color: #fff; + width: 60px; + padding: 14px 10px; + z-index: 1; +} + +.mec-event-cover-clean .mec-event-date div { + text-align: center; + text-transform: uppercase; + letter-spacing: 1px; + line-height: 16px; +} + +.mec-event-cover-clean .mec-event-date .dday { + padding-bottom: 15px; + border-bottom: 1px solid rgba(255, 255, 255, 0.5); + margin-bottom: 13px; + font-size: 24px; +} + +.mec-event-cover-clean .mec-event-date .dmonth { + letter-spacing: 2px; +} + +.mec-event-cover-clean .mec-event-place { + font-size: 18px; +} + +.mec-event-cover-clean .mec-event-image img { + width: 100%; +} + +@media only screen and (max-width: 768px) { + .mec-event-cover-clean .mec-event-content { + padding: 20px; + bottom: 5px; + } + + .mec-event-cover-clean .mec-event-title { + font-size: 23px; + } + + .mec-event-cover-clean .mec-event-date { + right: 20px; + padding: 10px; + width: 50px; + } +} + +@media only screen and (max-width: 479px) { + .mec-event-cover-clean .mec-event-content { + padding: 10px; + } + + .mec-event-cover-clean .mec-event-title { + font-size: 19px; + padding-right: 25px; + } + + .mec-event-cover-clean .mec-event-date { + right: -20px; + top: -10px; + } + + .mec-event-cover-clean .mec-event-detail { + font-size: 12px; + } +} + +/* MEC Events List Default Loop + --------------------------------- */ +.mec-month-divider { + text-align: center; + margin: 60px 0 40px 0; +} + +.widget .mec-month-divider { + margin: 10px 0; +} + +.mec-month-divider span { + text-transform: uppercase; + font-size: 22px; + font-weight: bold; + padding-bottom: 5px; + color: #313131; + border-bottom: 4px solid #ebebeb; + width: 100%; + display: block; + padding-bottom: 10px; + position: relative; +} + +.mec-month-divider span:before { + border-bottom: 4px solid #40d9f1; + font-size: 6px; + content: ""; + text-align: center; + position: absolute; + bottom: -4px; + margin-left: -30px; + left: 50%; + width: 60px; +} + +.widget .mec-month-divider span { + font-size: 13px; +} + +.mec-event-list-standard .mec-events-pagination { + margin-top: 60px; + border-top: 4px solid #ebebeb; + min-height: 80px; + padding-top: 20px; +} + +.mec-event-list-standard .mec-events-pagination .mec-events-pag-previous { + float: left; + margin-left: 0; +} + +.mec-event-list-standard .mec-events-pagination .mec-events-pag-next { + float: right; + margin-right: 0; +} + +.mec-event-list-standard .mec-event-article { + position: relative; + display: block; + margin-bottom: 25px; + background-color: #fff; + border: 1px solid #e9e9e9; + box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.016); +} + +.mec-event-list-standard .mec-topsec { + display: table; + width: 100%; +} + +.mec-event-list-standard .col-md-3.mec-event-image-wrap { + padding-left: 0; +} + +.mec-event-list-standard .mec-event-content { + padding-top: 15px; + padding-right: 30px; +} + +.mec-event-list-standard ul.mec-event-status-icons { + list-style: none; + padding: 0; + margin-bottom: 10px; +} + +.mec-event-list-standard ul.mec-event-status-icons li { + display: inline-flex; + align-items: inherit; + justify-content: center; + font-size: 12px; + font-weight: 400; + line-height: 16px; + border-radius: 5px; + padding: 2px 5px; + margin-right: 10px; +} + +.mec-event-list-standard ul.mec-event-status-icons li img { + margin-right: 5px; +} + +.mec-event-list-standard + ul.mec-event-status-icons + li.mec-event-status-scheduled { + color: #58aa22; + background: #e9f8d7; +} + +.mec-event-list-standard ul.mec-event-status-icons li.mec-event-status-ongoing { + color: #1aa82a; + background: #e4f6df; +} + +.mec-event-list-standard + ul.mec-event-status-icons + li.mec-event-status-postponed { + color: #a1830d; + background: #fff3b7; +} + +.mec-event-list-standard + ul.mec-event-status-icons + li.mec-event-status-cancelled { + color: #bb1313; + background: #fed8d8; +} + +.mec-event-list-standard + ul.mec-event-status-icons + li.mec-event-status-movedonline { + color: #f35e04; + background: #feebd7; +} + +.mec-event-list-standard .mec-event-title { + font-size: 29px; + font-weight: 600; + letter-spacing: -1px; + margin: 0 0 10px; +} + +.mec-event-list-standard .mec-event-title a { + color: #292929; + text-decoration: none; + transition: color 0.3s ease; +} + +.mec-event-list-standard .mec-col-table-c { + display: table-cell; + height: 100%; + vertical-align: middle; + float: none !important; +} + +.mec-event-list-standard .mec-col-table-c.mec-event-meta-wrap { + padding: 20px; +} + +.mec-event-list-standard .mec-col-table-c.mec-event-image-wrap { + vertical-align: top; +} + +.mec-topsec .mec-event-image { + line-height: 1px; +} + +.mec-topsec .mec-event-image a { + display: block; +} + +.mec-event-list-standard .mec-event-meta-wrap { + border-left: 1px solid #eee; +} + +.mec-event-list-standard .mec-time-details { + text-transform: uppercase; + font-size: 12px; + font-weight: 400; + line-height: 17px; + color: #707070; + padding-top: 0; + text-align: left; +} + +.mec-event-list-standard .mec-event-meta .mec-venue-details span { + font-size: 12px; + font-weight: 400; + line-height: 17px; + color: #707070; + padding-top: 0; + text-align: left; +} + +.mec-event-list-standard + .mec-event-meta + .mec-venue-details + .mec-event-address + span { + font-style: normal; + letter-spacing: 0; + font-size: 12px; + font-weight: 400; + color: #707172; + margin-left: 29px; +} + +.mec-event-list-standard .mec-event-meta span.mec-event-d, +.mec-event-list-standard .mec-event-meta span.mec-event-m { + font-size: 13px; + font-weight: 600; + line-height: 17px; + padding-right: 6px; + color: #414243; + text-transform: uppercase; +} + +.mec-event-list-standard .mec-event-meta span.mec-event-d .mec-start-date-label, +.mec-event-list-standard .mec-event-meta .mec-time-details .mec-start-time, +.mec-event-list-standard .mec-event-meta .mec-time-details .mec-end-time, +.mec-event-list-standard .mec-event-meta .mec-venue-details span { + vertical-align: middle; +} + +.mec-event-list-standard .mec-event-meta svg { + vertical-align: middle; + margin-right: 12px; + width: 20px; + height: 20px; +} + +.mec-event-list-standard .mec-local-time-details, +.mec-event-list-standard .mec-venue-details, +.mec-event-list-standard .mec-date-details, +.mec-event-list-standard .mec-time-details, +.mec-event-list-standard .mec-categories-wrapper, +.mec-event-list-standard .mec-shortcode-organizers { + position: relative; + margin-bottom: 10px; +} + +.mec-event-list-standard .mec-local-time-details .mec-local-title { + font-size: 13px; + font-weight: 400; + line-height: 17px; + color: #414243; + margin-left: -3px; +} + +.mec-event-list-standard .mec-local-time-details .mec-local-date, +.mec-event-list-standard .mec-local-time-details .mec-local-time { + font-style: normal; + letter-spacing: 0; + font-size: 11px; + color: #8a8a8a; + font-weight: 300; + line-height: 1.6; + margin-left: 29px; +} + +.mec-event-list-standard .mec-date-details i, +.mec-event-list-standard .mec-categories-wrapper i, +.mec-event-list-standard .mec-shortcode-organizers i { + margin-right: 12px; +} + +.mec-event-list-standard .mec-categories-wrapper i:before, +.mec-event-list-standard + .mec-event-meta-wrap + .mec-event-meta + .mec-price-details + i:before { + font-size: 16px; +} + +.mec-event-list-standard .mec-event-title .mec-labels-normal { + line-height: 18px; + height: 18px; + display: inline-block; + vertical-align: middle; +} + +.mec-event-list-standard .mec-event-title .mec-labels-normal .mec-label-normal { + vertical-align: bottom; +} + +.mec-event-list-standard .mec-event-description { + font-size: 14px; +} + +.mec-event-list-minimal .mec-event-title a { + color: #292929; + transition: color 0.3s ease; +} + +.mec-event-meta-wrap .mec-price-details { + margin-bottom: 10px; +} + +.mec-price-details i { + margin-right: 4px; + line-height: 16px; +} + +.mec-event-meta-wrap .mec-event-meta .mec-price-details i:before { + font-size: 15px; +} + +.mec-event-list-standard .mec-price-details { + font-size: 12px; + font-weight: 400; + line-height: 17px; + color: #707070; + padding-top: 0; + text-align: left; +} + +.mec-event-list-standard .mec-price-details i { + margin-right: 10px; +} + +.mec-month-side .mec-price-details { + margin-left: 2px; +} + +.tooltipster-sidetip.tooltipster-shadow:not(.uael-tooltipster-active) + .tooltipster-content + .mec-price-details + i, +.mec-month-side .mec-price-details i { + padding-top: 4px; + vertical-align: unset; +} + +.mec-event-list-standard ul.mec-categories { + position: relative; + margin-bottom: 10px; +} + +/* .mec-event-list-standard ul.mec-categories li.mec-category a:before { + font-size: 16px !important; + content: "\f105"; + position: absolute; + font-family: fontawesome; + left: 8px; + font-size: 15px; +} */ + +@media only screen and (max-width: 960px) { + .mec-event-list-standard .mec-topsec { + display: block; + } + + .mec-event-list-standard .mec-col-table-c.mec-event-image-wrap { + display: block; + width: 40%; + } + + .mec-event-list-standard .mec-col-table-c.mec-event-content-wrap { + display: block; + min-height: 230px; + } + + .mec-event-list-standard .mec-event-meta-wrap { + display: block; + border-left: none; + border-top: 1px solid #eee; + width: 100%; + float: none; + padding-top: 20px; + } +} + +@media only screen and (min-width: 480px) and (max-width: 960px) { + .mec-event-list-standard .mec-col-table-c.mec-event-image-wrap, + .mec-event-list-standard .mec-col-table-c.mec-event-content-wrap { + display: table-cell; + } +} + +@media only screen and (max-width: 479px) { + .mec-event-list-standard .mec-col-table-c.mec-event-image-wrap, + .mec-event-list-standard .mec-col-table-c.mec-event-image-wrap img { + float: none; + width: 100%; + padding: 0; + } + + .mec-event-list-standard .mec-col-table-c.mec-event-content-wrap { + padding: 10px 10px 10px 30px; + } +} + +/* Local Time + -------------------------- */ +.mec-localtime-details { + color: #777; + font-weight: 400; + line-height: 12px; + font-size: 12px; +} + +.mec-localtime-details .mec-localtitle, +.mec-localtime-details .mec-localdate, +.mec-localtime-details .mec-localtime { + display: inline-block; +} + +.mec-localtime-details .mec-start-date-label { + padding-right: 5px; +} + +.mec-localtime-details .mec-localtime { + padding-left: 5px; +} + +.mec-event-list-minimal .mec-localtime-details { + display: inline-flex; + font-size: 15px; + font-weight: 300; + line-height: 1; + letter-spacing: 0; + color: #9a9a9a; + padding-left: 9px; +} + +.mec-event-grid-clean .mec-localtime-details, +.mec-event-grid-classic .mec-localtime-details { + color: #fff; + font-weight: 400; + font-size: 11px; + text-transform: uppercase; + letter-spacing: -0.02em; + color: #fff; + padding: 0 0; + line-height: 18px; + margin-top: -3px; +} + +.tooltipster-box .mec-localtime-details, +.mec-event-grid-colorful .mec-localtime-details, +.mec-event-grid-clean .mec-localtime-details { + line-height: 22px; + padding-top: 10px; +} + +.mec-event-grid-colorful .mec-localtime-details { + color: #fff; +} + +.mec-event-grid-classic .mec-localtime-details { + text-align: center; +} + +.mec-event-grid-minimal .mec-localtime-details { + line-height: 22px; +} + +.mec-wrap .mec-yearly-view-wrap .mec-localtime-wrap i { + display: inline-block; + margin-left: -1px; +} + +.mec-timetable-t2-content .mec-local-time-details { + padding-left: 19px; +} + +.mec-timetable-t2-content .mec-local-time-details { + position: relative; +} + +.mec-timetable-t2-content .mec-local-time-details:before { + content: "\e007"; + font-family: "simple-line-icons"; + position: absolute; + font-size: 12px; + margin-right: 4px; + left: 0; +} + +.mec-masonry .mec-masonry-col6 .mec-localtime-details { + margin-top: 10px; + line-height: 21px; +} + +.mec-masonry .mec-masonry-col6 .mec-localtime-details i { + height: auto; +} + +.mec-event-cover-classic .mec-localtime-details { + color: #fff; + margin-top: 12px; +} + +.mec-event-cover-classic .mec-localtime-details i { + padding-right: 8px; +} + +.mec-event-cover-clean .mec-localtime-details { + color: #fff; + margin-bottom: 20px; +} + +.mec-event-cover-modern .mec-localtime-details { + color: #fff; + margin: 10px 0; + font-weight: 400; + font-size: 18px; +} + +.mec-event-countdown-style3 .mec-localtime-details, +.mec-event-countdown-style2 .mec-localtime-details, +.mec-event-countdown-style1 .mec-localtime-details { + color: #fff; + padding: 8px 5px 0; + font-size: 14px; + line-height: 25px; +} + +.mec-event-countdown-style1 .mec-localtime-details { + text-align: center; +} + +.mec-event-hover-carousel-type4 .mec-localtime-details { + display: block; + color: #fff; + font-size: 11px; +} + +.mec-event-footer-carousel-type3 .mec-localtime-details span, +.mec-event-footer-carousel-type3 .mec-localtime-details .mec-localdate, +.mec-event-footer-carousel-type3 .mec-localtime-details .mec-localtime, +.mec-event-footer-carousel-type3 .mec-localtime-details .mec-localtitle { + display: inline-flex; + line-height: 20px; + text-align: left; + margin: 0 !important; + font-size: 12px; + color: #777; + line-height: 28px; +} + +.mec-owl-crousel-skin-type1 .mec-localtime-details { + margin-top: -7px; + margin-bottom: 12px; +} + +.mec-wrap .mec-slider-t5 .mec-localtime-details { + margin-top: 14px; + line-height: 20px; +} + +.mec-wrap .mec-slider-t5 .mec-localtime-details i { + font-size: 18px; + height: 20px; +} + +.mec-timeline-event-local-time .mec-localtime-details { + font-size: 13px; + font-weight: 500; + vertical-align: middle; + margin-left: 6px; + color: inherit; + line-height: 24px; +} + +.mec-timeline-event-local-time .mec-localtime-details i { + font-size: 17px; + vertical-align: middle; + margin-left: -7px; + padding-right: 3px; +} + +/* Register Button for Shortcodes + Modal Booking + -------------------------- */ +.mec-booking-modal { + background-color: #e6f7ff; +} + +.mec-booking-modal + .mec-booking-shortcode + .mec-book-form-gateway-label + input[type="radio"]:before { + top: -1px; +} + +.mec-modal-booking-button { + box-shadow: none; + transition: all 0.21s ease; + font-size: 11px; + font-weight: 500; + letter-spacing: 1px; + text-transform: uppercase; + background: #fff; + color: #767676; + border: 1px solid #e8e8e8; + padding: 12px 16px; + line-height: 37px; + height: 38px; + margin: 12px 0; +} + +.mec-modal-booking-button:hover { + background: #191919; + color: #fff; + border-color: #191919; +} + +.mec-modal-booking-button.mec-mb-icon i { + font-size: 14px; +} + +/* Custom Style */ +.mec-event-list-classic .mec-modal-booking-button { + height: 0; + line-height: 1; + margin: 7px 0 0; + display: inline-table; + letter-spacing: 0; + padding: 12px 14px; +} + +/* Category on Griv view Novel style */ +.mec-event-grid-novel .mec-categories-wrapper { + position: relative; + color: rgba(255, 255, 255, 0.4); + padding-left: 35px; +} + +.mec-event-grid-novel ul.mec-categories { + line-height: 30px; + font-size: 15px; +} + +.mec-event-grid-novel .mec-categories-wrapper i { + display: none; +} + +.mec-event-grid-novel ul.mec-categories li.mec-category a { + color: rgba(255, 255, 255, 0.4); + line-height: 30px; + font-size: 15px; +} + +.mec-event-grid-novel ul.mec-organizers li.mec-organizer-item span { + padding-left: 35px; + color: rgba(255, 255, 255, 0.4); + line-height: 30px; + font-size: 15px; +} + +.mec-timetable-t2-col .mec-modal-booking-button, +.mec-event-container-classic .mec-modal-booking-button, +.mec-calendar-events-side .mec-modal-booking-button, +.mec-event-grid-minimal .mec-modal-booking-button, +.mec-event-list-minimal .mec-modal-booking-button { + margin: 0; + color: #282828; + font-size: 12px; + transition: all 0.5s ease; + -webkit-transition: all 0.5s ease; + position: relative; + padding: 0 0 0 24px; + background: 0 0; + text-align: left; + display: inline; + border: 0; + font-weight: 700; +} + +.mec-timetable-t2-col .mec-modal-booking-button { + color: #fff; + padding-left: 19px; +} + +.mec-timetable-t2-col .mec-modal-booking-button:hover { + color: #282828; +} + +.mec-event-list-minimal .mec-modal-booking-button { + margin: 0 4px 0 84px; +} + +.mec-event-container-classic .mec-modal-booking-button:before, +.mec-calendar-events-side .mec-modal-booking-button:before, +.mec-event-grid-minimal .mec-modal-booking-button:before, +.mec-event-list-minimal .mec-modal-booking-button:before { + content: ""; + position: absolute; + background: #7a7272; + width: 18px; + height: 1px; + left: 0; + top: 45%; + transition: all 0.1s ease; + -webkit-transition: all 0.1s ease; +} + +.mec-skin-carousel-container .mec-modal-booking-button { + line-height: 70px; +} + +.mec-event-list-modern .mec-modal-booking-button.mec-mb-icon { + border-radius: 1px; + letter-spacing: 2px; + border: 1px solid #e6e6e6; + color: #333; + background-color: #fff; + padding: 13px 12px 13px 14px; + font-weight: 700; + box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.016); + transition: all 0.28s ease; + line-height: unset; +} + +.mec-event-list-modern .mec-modal-booking-button.mec-mb-icon:hover { + border-color: #222; + background: #222; + color: #fff; +} + +.mec-event-footer .mec-modal-booking-button { + position: absolute; + top: 20px; + right: 125px; + margin: 0; + padding: 0 16px; + line-height: 37px; + border-radius: 2px; + margin-right: 5px; +} + +.mec-skin-carousel-container + .mec-event-footer-carousel-type2 + .mec-modal-booking-button { + font-size: 12px; + line-height: 17px; + height: 41px; +} + +.mec-skin-carousel-container + .mec-event-footer-carousel-type3 + .mec-modal-booking-button { + line-height: 36px; + font-size: 12px; + padding: 0 10px; + letter-spacing: 0; + float: right; + margin: 0 5px 0 0; + height: unset; +} + +.mec-skin-carousel-container + .mec-owl-crousel-skin-type4 + .mec-modal-booking-button { + color: #fff; + background-color: #191919; + border: 2px #191919 solid; + padding: 10px 14px; + letter-spacing: 1.5px; + font-size: 11px; + font-weight: 700; + font-style: normal; + transition: all 0.22s ease; + text-decoration: none; + margin: 0 0 0 12px; +} + +.mec-skin-carousel-container + .mec-owl-crousel-skin-type4 + .mec-modal-booking-button:hover { + color: #191919; + background-color: #fff; + border: 2px #fff solid; +} + +.mec-event-grid-modern .mec-event-footer .mec-modal-booking-button { + right: auto; + left: 110px; +} + +.mec-events-agenda .mec-modal-booking-button, +.mec-event-grid-simple .mec-modal-booking-button { + margin: 0; + font-size: 12px; + transition: all 0.5s ease; + -webkit-transition: all 0.5s ease; + position: relative; + padding: 0; + background: 0 0; + text-align: left; + display: inline; + border: 0; + font-weight: 700; +} + +.mec-events-agenda .mec-modal-booking-button { + display: block; + height: unset; + padding-left: 173px; + line-height: 14px; + margin-bottom: 7px; +} + +.mec-yearly-view-wrap .mec-modal-booking-button { + margin: 0; + padding-left: 14px; + text-transform: capitalize; +} + +.mec-event-grid-novel .mec-event-footer .mec-modal-booking-button.mec-mb-icon { + right: auto; + left: 50px; + width: 36px; + height: 36px; + display: table-cell; + vertical-align: middle; + padding: 0 10px; + border-color: rgba(255, 255, 255, 0.1); + background-color: rgba(0, 0, 0, 0); + color: #fff; + border-radius: 36px; +} + +.mec-event-grid-novel + .mec-event-footer + .mec-modal-booking-button.mec-mb-icon:hover { + background-color: rgba(255, 255, 255, 0.1); +} + +.mec-events-yearlu .mec-modal-booking-button:hover, +.mec-events-agenda .mec-modal-booking-button:hover, +.mec-event-grid-simple .mec-modal-booking-button:hover { + color: #191919; +} + +.mec-event-masonry .mec-event-footer .mec-modal-booking-button { + font-size: 12px; + padding: 0 31px; + line-height: 49px; + height: 50px; + top: 0; + box-shadow: 0 5px 11px -3px rgba(0, 0, 0, 0.05); + right: auto; + left: 155px; +} + +.mec-timeline-event .mec-modal-booking-button { + position: absolute; + top: 0; + right: 0; + display: inline-block; + padding: 7px 20px 7px; + line-height: 22px; + height: unset; + border: unset; + text-transform: capitalize; + font-weight: 500; + font-size: 13px; + letter-spacing: 0; + margin: 0; + border-radius: 0 0 0 10px; +} + +.mec-timeline-event .mec-modal-booking-button:hover { + background: #191919; + color: #fff; +} + +.mec-skin-daily-view-events-container .mec-modal-booking-button, +.mec-weekly-view-dates-events .mec-event-article .mec-modal-booking-button { + position: absolute; + top: 50%; + transform: translateY(-50%); + right: 15px; + line-height: 26px; + height: 49px; + border: unset; + text-align: center; + display: inline-block; + background: #ededed; + color: #191919; + padding: 12px; + border-radius: 2px; + font-size: 11px; + font-weight: 700; + text-transform: uppercase; + letter-spacing: 2px; + transition: all 0.24s ease; + margin: 0; +} + +.mec-skin-daily-view-events-container .mec-modal-booking-button:hover, +.mec-weekly-view-dates-events + .mec-event-article + .mec-modal-booking-button:hover { + background: #292929; + color: #fff; +} + +@media (max-width: 1023px) { + .mec-skin-daily-view-events-container .mec-modal-booking-button, + .mec-weekly-view-dates-events .mec-event-article .mec-modal-booking-button { + position: relative; + top: unset; + transform: unset; + margin: 14px 16px 0; + padding: 8px; + line-height: 20px; + height: 35px; + } +} + +@media (max-width: 768px) { + .featherlight .featherlight-inner { + width: 100%; + } + + .mec-events-agenda .mec-modal-booking-button { + padding: 0; + } +} + +@media (max-width: 480px) { + .mec-booking-modal .mec-events-meta-group-booking-shortcode { + padding: 20px; + } + + .mec-booking-modal .mec-booking-shortcode .mec-book-reg-field-name, + .mec-booking-modal .mec-booking-shortcode .mec-book-reg-field-mec_email { + width: 100%; + } + + .mec-booking-modal .mec-booking-shortcode button#mec-book-form-btn-step-2 { + margin-left: 20px; + } + + .mec-booking-modal + .mec-booking-shortcode + .mec-click-pay + button[type="submit"] { + bottom: 22px; + } + + .mec-calendar-events-side .mec-modal-booking-button:before, + .mec-event-container-classic .mec-modal-booking-button:before, + .mec-event-grid-minimal .mec-modal-booking-button:before, + .mec-event-list-minimal .mec-modal-booking-button:before { + display: none; + } + + .mec-calendar-events-side .mec-modal-booking-button, + .mec-event-container-classic .mec-modal-booking-button, + .mec-event-grid-minimal .mec-modal-booking-button, + .mec-event-list-minimal .mec-modal-booking-button, + .mec-timetable-t2-col .mec-modal-booking-button { + margin: 0; + padding: 0; + } + + .mec-event-grid-modern .mec-event-footer .mec-booking-button { + top: 20px; + } +} + +/* MEC Event- Single + -------------------------- */ +.mec-wrap .mec-events-cal-links { + margin-bottom: 0; +} + +.mec-single-event #mec-wrap { + padding: 0; + margin-top: 35px; +} + +.single-mec-events .mec-wrap.mec-no-access-error h1, +.mec-wrap .mec-single-title { + margin-top: 0; + margin-bottom: 30px; + font-weight: 700; + font-size: 33px; +} + +.mec-single-event .mec-event-content { + padding: 40px 0 30px; + margin-bottom: 10px; +} + +.mec-single-event .mec-frontbox, +.mec-single-event .mec-events-meta-group-booking, +.mec-events-meta-group-booking .mec-booking-shortcode { + margin-bottom: 30px; + padding: 40px; + background: #fff; + border: 1px solid #e6e7e8; +} + +.mec-events-meta-group.mec-events-meta-group-gmap { + margin-bottom: 30px; +} + +.lity-content .mec-events-meta-group-booking { + padding: 40px; + background: #fff; + border: 1px solid #e6e7e8; +} + +.mec-single-event .mec-frontbox, +.lity-content .mec-events-meta-group-booking, +.mec-single-event .mec-events-meta-group-booking, +.mec-events-meta-group-booking .mec-booking-shortcode, +.mec-single-event .mec-events-meta-group-countdown, +.mec-single-event .mec-events-meta-group-gmap, +.mec-single-modern .mec-single-event-bar { + border-radius: 3px; + overflow: hidden; + margin-bottom: 30px; +} + +.mec-wrap #main-content { + overflow: hidden; + padding-top: 35px; +} + +.mec-single-event .mec-map-get-direction-address-cnt { + position: relative; +} + +.mec-single-event + .mec-map-get-direction-address-cnt + input.mec-map-get-direction-address { + width: 100%; + height: 46px; + padding: 13px 10px; + margin-bottom: 0; + background: #fcfcfc; + border: 1px solid #e0e0e0; + border-radius: 0; + box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.081); +} + +.mec-single-event + .mec-map-get-direction-address-cnt + input.mec-map-get-direction-address:focus { + color: #444; + background: #fff; + border-color: #b0b0b0; + box-shadow: 0 0 3px rgba(0, 0, 0, 0.2); +} + +.mec-single-event .mec-map-get-direction-btn-cnt input { + width: 100%; +} + +.mec-single-event .mec-map-get-direction-reset { + position: absolute; + z-index: 2; + top: 5px; + right: 10px; + font-size: 11px; + cursor: pointer; +} + +/* Tags */ +.mec-events-meta-group-tags { + margin-top: 20px; +} + +.mec-events-meta-group-tags a { + display: inline-block; + color: #444; + font-size: 11px; + text-transform: uppercase; + letter-spacing: 1.5px; + font-weight: 500; + padding: 3px 7px; + border: 1px solid #ddd; + border-radius: 2px; + background: #fff; + margin: 1px 3px; +} + +.mec-events-meta-group-tags a:hover { + text-decoration: underline; + background: #f9f9f9; +} + +.mec-local-time-details li { + list-style: none; + font-size: 14px; + font-weight: 300; +} + +.mec-single-event:not(.mec-single-modern) .mec-local-time-details { + padding: 12px 14px 8px; + margin-bottom: 12px; + vertical-align: baseline; + position: relative; + border: none; +} + +.mec-single-event:not(.mec-single-modern) .mec-local-time-details ul { + margin: 0; + padding-left: 35px; +} + +.mec-single-event:not(.mec-single-modern) .mec-local-time-details h3 { + border: none; + padding-left: 15px; +} + +.mec-single-event:not(.mec-single-modern) .mec-local-time-details h3:before { + display: none; +} + +.mec-single-event.mec-single-modern i.mec-sl-speedometer { + display: none; +} + +.mec-single-modern .mec-local-time-details.mec-frontbox i { + display: none; +} + +/* Booking */ +.lity-content .mec-events-meta-group-booking, +.mec-single-event .mec-events-meta-group-booking, +.mec-events-meta-group-booking .mec-booking-shortcode { + z-index: 1; + overflow: visible; +} + +.lity-content + .mec-events-meta-group-booking + ul.mec-book-tickets-reg-fields-container, +.mec-single-event + .mec-events-meta-group-booking + ul.mec-book-tickets-reg-fields-container, +.mec-events-meta-group-booking + .mec-booking-shortcode + ul.mec-book-tickets-reg-fields-container, +.lity-content + .mec-events-meta-group-booking + .mec-paypal-credit-card-payment-fields, +.mec-single-event + .mec-events-meta-group-booking + .mec-paypal-credit-card-payment-fields, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-paypal-credit-card-payment-fields { + margin: 0px -41.835px; + overflow: hidden; + clear: both; +} + +.mec-events-meta-group-booking + .mec-booking-shortcode + ul.mec-book-tickets-reg-fields-container + li, +.mec-single-event + .mec-events-meta-group-booking + .mec-paypal-credit-card-payment-fields + li, +.mec-single-event + .mec-events-meta-group-booking + .mec-paypal-credit-card-payment-fields + li { + margin-left: 41.835px; + margin-right: 41.835px; +} + +.lity-content .mec-events-meta-group-booking ul, +.mec-single-event .mec-events-meta-group-booking ul, +.mec-events-meta-group-booking .mec-booking-shortcode ul { + list-style: none; + padding-left: 0; + margin-left: 0; +} + +.lity-content + .mec-events-meta-group-booking + ul.mec-book-tickets-reg-fields-container { + margin: 0; +} + +.lity-content + .mec-events-meta-group-booking + ul.mec-book-tickets-reg-fields-container + .col-md-6 { + float: left; +} + +.lity-content .mec-events-meta-group-booking ul li, +.mec-single-event .mec-events-meta-group-booking ul li, +.mec-single-event + .mec-events-meta-group-booking + .mec-book-ticket-variation-wrapper, +.mec-events-meta-group-booking .mec-booking-shortcode ul li:not(.option), +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-book-ticket-variation-wrapper { + padding: 0; + list-style: none; + margin-top: 0; + margin-bottom: 30px; +} + +.lity-content .mec-events-meta-group-booking ul li.col-md-6:first-child, +.mec-single-event .mec-events-meta-group-booking ul li.col-md-6:first-child { + width: calc(50% - 10px); + margin-right: 10px; + margin-left: 0; +} + +.lity-content .mec-events-meta-group-booking ul li.col-md-6:nth-child(2), +.mec-single-event .mec-events-meta-group-booking ul li.col-md-6:nth-child(2) { + width: calc(50% - 10px); + margin-right: 0; + margin-left: 10px; +} + +.lity-content + .mec-events-meta-group-booking + .mec-booking-form-container + > .col-md-12, +.mec-events-meta-group-booking .mec-booking-shortcode .col-md-12, +.mec-single-event + .mec-events-meta-group-booking + .mec-booking-form-container + > .col-md-12 { + display: flex; + align-items: center; + padding: 0 0 30px 0; + margin-bottom: 30px; + border-bottom: 1px solid #f0f1f2; +} + +.lity-content + .mec-events-meta-group-booking + .col-md-12 + .mec-ticket-icon-wrapper, +.mec-single-event + .mec-events-meta-group-booking + .col-md-12 + .mec-ticket-icon-wrapper, +.mec-events-meta-group-booking + .mec-booking-shortcode + .col-md-12 + .mec-ticket-icon-wrapper { + margin-right: 25px; +} + +.lity-content + .mec-events-meta-group-booking + .col-md-12 + .mec-ticket-name-description-wrapper + .mec-ticket-price-wrapper + span, +.mec-single-event + .mec-events-meta-group-booking + .col-md-12 + .mec-ticket-name-description-wrapper + .mec-ticket-price-wrapper + span, +.mec-events-meta-group-booking + .mec-booking-shortcode + .col-md-12 + .mec-ticket-name-description-wrapper + .mec-ticket-price-wrapper + span { + display: block; + font-size: 14px; + font-weight: 400; + line-height: 19px; + color: #606367; + margin-bottom: 4px; +} + +.lity-content + .mec-events-meta-group-booking + .col-md-12 + .mec-ticket-name-description-wrapper + .mec-ticket-price-wrapper + span.mec-ticket-price, +.mec-single-event + .mec-events-meta-group-booking + .col-md-12 + .mec-ticket-name-description-wrapper + .mec-ticket-price-wrapper + span.mec-ticket-price, +.mec-events-meta-group-booking + .mec-booking-shortcode + .col-md-12 + .mec-ticket-name-description-wrapper + .mec-ticket-price-wrapper + span.mec-ticket-price { + font-size: 18px; + font-weight: 600; + line-height: 24px; + color: #212224; + margin: 0; +} + +.lity-content + .mec-events-meta-group-booking + [id*="mec_booking_quantity_wrapper_"], +.mec-single-event + .mec-events-meta-group-booking + [id*="mec_booking_quantity_wrapper_"], +.mec-events-meta-group-booking + .mec-booking-shortcode + [id*="mec_booking_quantity_wrapper_"] { + font-size: 13px; + font-weight: 400; + line-height: 16px; + color: #8e9195; + display: block; + margin-bottom: 5px; + text-align: end; +} + +.lity-content .mec-events-meta-group-booking .mec-first-for-all-wrapper, +.mec-single-event .mec-events-meta-group-booking .mec-first-for-all-wrapper, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-first-for-all-wrapper { + clear: both; + margin-bottom: 26px; +} + +.lity-content .mec-events-meta-group-booking li h4, +.mec-single-event .mec-events-meta-group-booking li h4, +.mec-events-meta-group-booking .mec-booking-shortcode li h4 { + font-size: 19px; +} + +.lity-content .mec-events-meta-group-booking input, +.mec-single-event .mec-events-meta-group-booking input, +.mec-events-meta-group-booking .mec-booking-shortcode input, +.lity-content .mec-events-meta-group-booking button, +.mec-single-event .mec-events-meta-group-booking button, +.mec-events-meta-group-booking .mec-booking-shortcode button { + border-radius: 0; + margin-bottom: 6px; +} + +.lity-content + .mec-events-meta-group-booking + button.mec-book-form-back-button#mec-book-form-back-btn-step-2, +.mec-wrap + .mec-single-event + .mec-events-meta-group-booking + button.mec-book-form-back-button#mec-book-form-back-btn-step-2, +.mec-events-meta-group-booking + .mec-booking-shortcode + button.mec-book-form-back-button#mec-book-form-back-btn-step-2, +.lity-content + .mec-events-meta-group-booking + button.mec-book-form-back-button#mec-book-form-back-btn-step-3, +.mec-wrap + .mec-single-event + .mec-events-meta-group-booking + button.mec-book-form-back-button#mec-book-form-back-btn-step-3, +.mec-events-meta-group-booking + .mec-booking-shortcode + button.mec-book-form-back-button#mec-book-form-back-btn-step-3 { + color: #636f72; + background: #f6f7f8; + border: 1px solid #e7e8e9; + float: left; + margin: 0; +} + +.lity-content + .mec-events-meta-group-booking + button.mec-book-form-back-button#mec-book-form-back-btn-step-2:hover, +.mec-wrap + .mec-single-event + .mec-events-meta-group-booking + button.mec-book-form-back-button#mec-book-form-back-btn-step-2:hover, +.mec-events-meta-group-booking + .mec-booking-shortcode + button.mec-book-form-back-button#mec-book-form-back-btn-step-2:hover, +.lity-content + .mec-events-meta-group-booking + button.mec-book-form-back-button#mec-book-form-back-btn-step-2:hover, +.mec-wrap + .mec-single-event + .mec-events-meta-group-booking + button.mec-book-form-back-button#mec-book-form-back-btn-step-2:hover, +.mec-events-meta-group-booking + .mec-booking-shortcode + button.mec-book-form-back-button#mec-book-form-back-btn-step-3:hover { + border: 1px solid #d9dadc; +} + +.lity-content + .mec-events-meta-group-booking + button.mec-book-form-back-button#mec-book-form-back-btn-step-2 + img.mec-svg-icon, +.mec-wrap + .mec-single-event + .mec-events-meta-group-booking + button.mec-book-form-back-button#mec-book-form-back-btn-step-2 + img.mec-svg-icon, +.mec-events-meta-group-booking + .mec-booking-shortcode + button.mec-book-form-back-button#mec-book-form-back-btn-step-2 + img.mec-svg-icon, +.lity-content + .mec-events-meta-group-booking + button.mec-book-form-back-button#mec-book-form-back-btn-step-3 + img.mec-svg-icon, +.mec-wrap + .mec-single-event + .mec-events-meta-group-booking + button.mec-book-form-back-button#mec-book-form-back-btn-step-3 + img.mec-svg-icon, +.mec-events-meta-group-booking + .mec-booking-shortcode + button.mec-book-form-back-button#mec-book-form-back-btn-step-3 + img.mec-svg-icon, +.mec-nextprev-prev-button svg { + margin-left: unset; + margin-right: 30px; +} + +mec-book-form-pay-button button#mec-book-form-back-btn-step-3 { + float: none; +} + +/* Booking Occurrences list */ +.mec-next-occ-booking, +.mec-next-occ-booking-p { + padding-left: 15px; +} + +/* Sell all occurrences by one booking */ +.mec-events-meta-group-booking .mec-next-occ-booking-p, +.mec-events-meta-group-booking .mec-next-occ-booking { + padding: 0; + font-size: 12px; + letter-spacing: 0; + margin: 3px 0; + padding: 5px 1em 3px 0; +} + +/* Registration */ +.mec-book-username-password-wrapper { + padding: 0 15px; +} + +.lity-container .mec-next-occ-booking, +.lity-container .mec-next-occ-booking-p { + padding-left: 0; +} + +.mec-ssl-protection-message { + display: none; +} + +/* Pay Buttons Position */ +.lity-content .mec-events-meta-group-booking .mec-click-pay, +.mec-single-event .mec-events-meta-group-booking .mec-click-pay, +.mec-events-meta-group-booking .mec-booking-shortcode .mec-click-pay { + max-width: 100%; +} + +.lity-content + .mec-events-meta-group-booking + .mec-click-pay + #mec_woo_add_to_cart_btn_r, +.mec-single-event + .mec-events-meta-group-booking + .mec-click-pay + #mec_woo_add_to_cart_btn_r, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-click-pay + #mec_woo_add_to_cart_btn_r, +.lity-content + .mec-events-meta-group-booking + .mec-click-pay + button.mec-book-form-next-button, +.mec-single-event + .mec-events-meta-group-booking + .mec-click-pay + button.mec-book-form-next-button, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-click-pay + button.mec-book-form-next-button { + float: right; + margin: 30px 0 0 0 !important; + background: #47dc6e !important; + border-color: #47dc6e !important; + color: #fff !important; + font-weight: 700 !important; +} + +.lity-content + .mec-events-meta-group-booking + .mec-click-pay + #mec_woo_add_to_cart_btn_r:hover, +.mec-single-event + .mec-events-meta-group-booking + .mec-click-pay + #mec_woo_add_to_cart_btn_r:hover, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-click-pay + #mec_woo_add_to_cart_btn_r:hover, +.lity-content + .mec-events-meta-group-booking + .mec-click-pay + button.mec-book-form-next-button:hover, +.mec-single-event + .mec-events-meta-group-booking + .mec-click-pay + button.mec-book-form-next-button:hover, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-click-pay + button.mec-book-form-next-button:hover { + background: #54d274; +} + +.lity-container .mec-click-pay { + max-width: 400px; +} + +.lity-container .mec-click-pay #mec_woo_add_to_cart_btn_r, +.lity-container .mec-book-form-btn-wrap button.mec-book-form-next-button { + float: right; +} + +.lity-container button.mec-book-form-next-button { + float: right; +} + +.lity-container .mec-click-pay #mec_woo_add_to_cart_btn_r:hover, +.lity-container .mec-click-pay button.mec-book-form-next-button:hover { + background: #000; +} + +/* Free booking with coupon */ +.lity-content .mec-events-meta-group-booking .mec-click-next, +.mec-single-event .mec-events-meta-group-booking .mec-click-next, +.mec-events-meta-group-booking .mec-booking-shortcode .mec-click-next { + float: right; + position: relative; + width: calc(100% - 186px); +} + +.lity-container .mec-click-next { + float: right; + position: relative; + width: calc(100% - 186px); +} + +.mec-single-event .mec-book-form-coupon button { + margin-left: 0; +} + +.mec-single-event .mec-book-form-gateway-checkout button { + margin-left: 0; +} + +.mec-single-event .mec-single-event .mec-book-form-gateway-checkout button { + margin-right: 20px; +} + +/* .mec-single-event button#mec-book-form-back-btn-step-3 { + margin-left: 0; +} */ + +/* MEC Progress */ +.lity-content .mec-booking-progress-bar, +.mec-booking-shortcode .mec-booking-progress-bar, +.mec-single-event .mec-booking-progress-bar, +.mec-booking-progress-bar { + display: flex; + flex-wrap: wrap; + margin: 60px 0 25px; + position: relative; + padding: 0; +} + +.lity-content .mec-booking-progress-bar li, +.mec-booking-shortcode .mec-booking-progress-bar li, +.mec-wrap .mec-booking-progress-bar li { + margin: 28px 0 15px !important; + text-align: center; + font-size: 15px; + font-weight: 700; + color: #000; + position: relative; + flex: 1; + align-items: center; + justify-content: center; + list-style: none; + z-index: 99999; +} + +.lity-content .mec-booking-progress-bar li .progress-index, +.mec-booking-shortcode .mec-booking-progress-bar li .progress-index, +.mec-wrap .mec-booking-progress-bar li .progress-index { + font-size: 14px; + font-weight: 600; + line-height: 24px; + color: var(--mec-color-skin); + position: absolute; + width: 24px; + height: 24px; + background: var(--mec-color-skin-rgba-1); + border-radius: 50%; + top: -39px; + left: calc(50% - 12px); + z-index: 1; +} + +.lity-content .mec-booking-progress-bar li.mec-active .progress-index, +.mec-booking-shortcode .mec-booking-progress-bar li.mec-active .progress-index, +.mec-wrap .mec-booking-progress-bar li.mec-active .progress-index { + background: #54d274; + border-color: #54d274; + color: #fff; +} + +.lity-content .mec-booking-progress-bar li:before, +.mec-booking-shortcode .mec-booking-progress-bar li:before, +.mec-wrap .mec-booking-progress-bar li:before { + content: ""; + position: absolute; + width: calc(50% - 12px); + height: 2px; + background: var(--mec-color-skin-rgba-1); + top: -28px; + left: 0; +} + +.lity-content .mec-booking-progress-bar li:after, +.mec-booking-shortcode .mec-booking-progress-bar li:after, +.mec-wrap .mec-booking-progress-bar li:after { + content: ""; + position: absolute; + width: calc(50% - 12px); + height: 2px; + background: var(--mec-color-skin-rgba-1); + top: -28px; + left: calc(50% + 12px); +} + +.lity-content .mec-booking-progress-bar li.mec-active, +.mec-booking-shortcode .mec-booking-progress-bar li.mec-active, +.mec-wrap .mec-booking-progress-bar li.mec-active { + color: #54d274; +} + +.lity-content .mec-booking-progress-bar li.mec-active:before, +.mec-booking-shortcode .mec-booking-progress-bar li.mec-active:before, +.mec-wrap .mec-booking-progress-bar li.mec-active:before, +.lity-content .mec-booking-progress-bar li.mec-active:after, +.mec-booking-shortcode .mec-booking-progress-bar li.mec-active:after, +.mec-wrap .mec-booking-progress-bar li.mec-active:after { + background: #54d274; +} + +.mec-single-event .row-done .mec-booking-progress-bar:after { + background: #54d274; +} + +@media (max-width: 480px) { + .lity-content .mec-booking-progress-bar li, + .mec-booking-shortcode .mec-booking-progress-bar li, + .mec-wrap .mec-booking-progress-bar li { + font-size: 12px; + } +} + +@media (max-width: 390px) { + .lity-content .mec-booking-progress-bar li, + .mec-booking-shortcode .mec-booking-progress-bar li, + .mec-wrap .mec-booking-progress-bar li { + font-size: 8px; + } + + .lity-content .mec-booking-progress-bar li.mec-active:after, + .mec-booking-shortcode .mec-booking-progress-bar li.mec-active:after, + .mec-wrap .mec-booking-progress-bar li.mec-active:after { + font-size: 14px; + } +} + +.mec-wrap .mec-booking-progress-bar li.mec-active:last-child:before { + width: 50%; +} + +.mec-booking .mec-event-tickets-list .mec-event-ticket-available { + margin-top: 12px; +} + +.mec-booking + .mec-event-tickets-list + .mec-ticket-style-row + input[type="number"] { + display: block; + margin: 0 0 10px auto; + box-shadow: unset; + border: 1px solid #e3e5e7; + border-radius: 4px; + background: #fff; + min-width: 80px; + width: 80px !important; + min-height: 40px; + height: 40px; +} + +.mec-booking + .mec-event-tickets-list + .mec-ticket-style-row + input::-webkit-outer-spin-button, +.mec-booking + .mec-event-tickets-list + .mec-ticket-style-row + input::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; +} + +.mec-booking + .mec-event-tickets-list + .mec-ticket-style-row + .mec-ticket-style-row-section-3 { + margin-left: auto; +} + +.mec-booking + .mec-event-tickets-list + .mec-ticket-style-row + .mec-event-ticket-input-wrapper { + position: relative; +} + +.mec-booking + .mec-event-tickets-list + .mec-ticket-style-row + input[type="number"] { + -moz-appearance: textfield; +} + +.mec-booking .mec-event-tickets-list .mec-ticket-style-row .plus, +.mec-booking .mec-event-tickets-list .mec-ticket-style-row .minus { + position: absolute; + right: 5px; + line-height: 1; + height: 14px; +} + +.mec-booking .mec-event-tickets-list .mec-ticket-style-row .plus { + top: 5px; +} + +.mec-booking .mec-event-tickets-list .mec-ticket-style-row .minus { + top: auto; + bottom: 5px; +} + +.mec-booking .mec-event-tickets-list .mec-ticket-style-row .plus:hover, +.mec-booking .mec-event-tickets-list .mec-ticket-style-row .minus:hover { + background: #dbdbdb; +} + +.mec-booking .mec-event-tickets-list .mec-ticket-style-row a { + text-decoration: none; +} + +.mec-booking .mec-event-tickets-list .mec-ticket-style-row { + margin-bottom: 30px; +} + +.mec-ticket-style-row.mec-ticket-available-spots { + display: flex; + flex-direction: row; + align-items: center; + justify-content: flex-start; + align-content: stretch; + flex-wrap: nowrap; +} + +.mec-booking .mec-event-tickets-list .mec-ticket-style-row > div { + width: unset; +} + +@media (max-width: 480px) { + .mec-ticket-style-row.mec-ticket-available-spots { + max-width: 100%; + display: flex; + flex-direction: unset; + align-items: unset; + justify-content: unset; + align-content: unset; + flex-wrap: unset; + } + + .mec-wrap .mec-booking .mec-event-tickets-list .mec-ticket-style-row > div { + width: 100%; + margin-bottom: 10px; + } +} + +.mec-booking + .mec-event-tickets-list + .mec-ticket-style-row + .mec-ticket-style-row-section-1 { + width: unset; + margin: 5px 25px 0 0; +} + +.mec-booking + .mec-event-tickets-list + .mec-ticket-style-row + .mec-event-ticket-available, +.mec-booking .mec-event-tickets-list .mec-ticket-style-row > div { + border: 0; + display: block; + box-shadow: unset; + margin: 0; +} + +.mec-booking + .mec-event-tickets-list + .mec-ticket-style-row + .mec-event-ticket-available { + font-size: 13px; + font-weight: 400; + line-height: 16px; + color: #8e9195; + text-align: right; +} + +.mec-booking + .mec-event-tickets-list + .mec-ticket-style-row + .mec-event-ticket-name { + font-size: 14px; + font-weight: 400; + line-height: 19px; + color: #606367; + margin-bottom: 4px; +} + +.mec-booking + .mec-event-tickets-list + .mec-ticket-style-row + .mec-event-ticket-price { + font-size: 18px; + font-weight: 600; + line-height: 24px; + color: #212224; +} + +.mec-booking + .mec-event-tickets-list + .mec-ticket-style-row + .mec-ticket-style-row-section-3 + div, +.mec-booking + .mec-event-tickets-list + .mec-ticket-style-row + .mec-event-ticket-description, +.mec-booking + .mec-event-tickets-list + .mec-ticket-style-row + .mec-event-ticket-price { + margin: 0; +} + +.mec-single-event .mec-book-form-price, +.mec-single-event .mec-book-form-gateways, +.mec-single-event form.mec-click-next, +.mec-single-event .mec-book-first, +.mec-single-event .mec-event-tickets-list { + padding-left: 0; + padding-right: 0; +} + +.lity-content .mec-book-first .mec-booking-calendar-wrapper, +.mec-booking-calendar-wrapper, +.mec-single-fluent-wrap .mec-booking-calendar-wrapper, +.mec-booking-shortcode .mec-book-first .mec-booking-calendar-wrapper { + display: flex; + justify-content: space-between; + align-items: center; + padding-bottom: 30px; + margin-bottom: 30px; + border-bottom: 1px solid #f0f1f2; +} + +@media only screen and (max-width: 767px) { + .lity-content .mec-events-meta-group-booking select, + .mec-single-event .mec-events-meta-group-booking select, + .mec-events-meta-group-booking .mec-booking-shortcode select { + width: unset !important; + } +} + +@media only screen and (max-width: 479px) { + .lity-content .mec-book-first .mec-booking-calendar-wrapper, + .mec-single-event .mec-book-first .mec-booking-calendar-wrapper, + .mec-single-fluent-wrap .mec-book-first .mec-booking-calendar-wrapper, + .mec-booking-shortcode .mec-book-first .mec-booking-calendar-wrapper { + flex-direction: column; + align-items: flex-start; + } + + .mec-booking + .mec-event-tickets-list + .mec-ticket-style-row + .mec-ticket-style-row-section-1 { + display: none; + } +} + +.lity-content + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-label, +.mec-single-event + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-label, +.mec-single-fluent-wrap + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-label, +.mec-booking-shortcode + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-label { + font-size: 14px; + font-weight: 400; + color: #606367; +} + +.lity-content + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-label + span.mec-required, +.mec-single-event + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-label + span.mec-required, +.mec-single-fluent-wrap + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-label + span.mec-required, +.mec-booking-shortcode + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-label + span.mec-required { + color: #ec3365; +} + +.lity-content + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-calendar-dropdown, +.mec-single-event + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-calendar-dropdown, +.mec-single-fluent-wrap + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-calendar-dropdown, +.mec-booking-shortcode + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-calendar-dropdown, +.lity-content + .mec-book-first + .mec-select-date-dropdown-wrapper + .mec-select-date-dropdown, +.mec-single-event + .mec-book-first + .mec-select-date-dropdown-wrapper + .mec-select-date-dropdown, +.mec-booking-shortcode + .mec-book-first + .mec-select-date-dropdown-wrapper + .mec-select-date-dropdown { + border: 1px solid #e3e5e7; + border-radius: 3px; + max-width: 300px; + width: auto; + height: 42px; + display: flex; + background-color: #fff; +} + +.lity-content + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-calendar-dropdown + span.mec-select-date-calendar-icon, +.mec-single-event + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-calendar-dropdown + span.mec-select-date-calendar-icon, +.mec-single-event + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-calendar-dropdown + span.mec-select-date-calendar-icon, +.mec-booking-shortcode + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-calendar-dropdown + span.mec-select-date-calendar-icon, +.lity-content + .mec-book-first + .mec-select-date-dropdown-wrapper + .mec-select-date-dropdown + span.mec-select-date-calendar-icon, +.mec-single-event + .mec-book-first + .mec-select-date-dropdown-wrapper + .mec-select-date-dropdown + span.mec-select-date-calendar-icon, +.mec-booking-shortcode + .mec-book-first + .mec-select-date-dropdown-wrapper + .mec-select-date-dropdown + span.mec-select-date-calendar-icon { + display: flex; + justify-content: center; + align-items: center; + border-right: 1px solid #e3e5e7; + background: #fafafa; + min-width: 40px; +} + +.lity-content + .mec-book-first + .mec-select-date-dropdown-wrapper + .mec-select-date-dropdown + .mec-custom-nice-select, +.mec-single-event + .mec-book-first + .mec-select-date-dropdown-wrapper + .mec-select-date-dropdown + .mec-custom-nice-select, +.mec-booking-shortcode + .mec-book-first + .mec-select-date-dropdown-wrapper + .mec-select-date-dropdown + .mec-custom-nice-select { + margin: 0; + border: none; +} + +.lity-content + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-calendar-dropdown + .mec-select-date-calendar-formatted-date, +.mec-single-event + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-calendar-dropdown + .mec-select-date-calendar-formatted-date, +.mec-single-fluent-wrap + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-calendar-dropdown + .mec-select-date-calendar-formatted-date, +.mec-booking-shortcode + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-calendar-dropdown + .mec-select-date-calendar-formatted-date { + font-size: 13px; + line-height: 40px; + padding: 0 12px; + width: 240px; +} + +.lity-content + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-calendar-dropdown + span.mec-select-date-calendar-icons, +.mec-single-event + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-calendar-dropdown + span.mec-select-date-calendar-icons, +.mec-single-fluent-wrap + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-calendar-dropdown + span.mec-select-date-calendar-icons, +.mec-booking-shortcode + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-calendar-dropdown + span.mec-select-date-calendar-icons { + cursor: pointer; + line-height: 33px; + position: relative; + right: 10px; +} + +.lity-content + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-calendar-container, +.mec-single-event + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-calendar-container, +.mec-single-fluent-wrap + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-calendar-container, +.mec-booking-shortcode + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-calendar-container { + position: absolute; + right: 40px; + z-index: 99; +} + +.lity-content + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-calendar-container + .mec-booking-calendar.mec-wrap, +.mec-single-event + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-calendar-container + .mec-booking-calendar.mec-wrap, +.mec-single-fluent-wrap + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-calendar-container + .mec-booking-calendar.mec-wrap, +.mec-booking-shortcode + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-calendar-container + .mec-booking-calendar.mec-wrap { + border: 1px solid #e3e5e7; + border-radius: 5px; +} + +.lity-content + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-calendar-container + .mec-booking-calendar-month-navigation + .mec-next-month, +.mec-single-event + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-calendar-container + .mec-booking-calendar-month-navigation + .mec-next-month, +.mec-single-event + .mec-book-first + .mec-select-date-express-calendar-wrapper + .mec-select-date-calendar-container + .mec-booking-calendar-month-navigation + .mec-next-month, +.mec-single-fluent-wrap + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-calendar-container + .mec-booking-calendar-month-navigation + .mec-next-month, +.mec-booking-shortcode + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-calendar-container + .mec-booking-calendar-month-navigation + .mec-next-month, +.lity-content + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-calendar-container + .mec-booking-calendar-month-navigation + .mec-previous-month, +.mec-single-event + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-calendar-container + .mec-booking-calendar-month-navigation + .mec-previous-month, +.mec-single-event + .mec-book-first + .mec-select-date-express-calendar-wrapper + .mec-select-date-calendar-container + .mec-booking-calendar-month-navigation + .mec-next-month, +.mec-single-fluent-wrap + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-calendar-container + .mec-booking-calendar-month-navigation + .mec-previous-month, +.mec-booking-shortcode + .mec-book-first + .mec-booking-calendar-wrapper + .mec-select-date-calendar-container + .mec-booking-calendar-month-navigation + .mec-previous-month { + border: none; + box-shadow: none; + line-height: 40px; + margin: 0; + border-radius: 5px; + padding: 0 20px; +} + +.mec-single-event label.mec-fill-attendees { + margin-left: 0; +} + +.lity-content .mec-booking .mec-book-form-btn-wrap, +.mec-wrap .mec-booking .mec-book-form-btn-wrap { + padding-top: 30px; + border-top: 1px solid #f0f1f2; +} + +.lity-content .mec-booking .mec-book-form-btn-wrap:after, +.mec-wrap .mec-booking .mec-book-form-btn-wrap:after { + content: ""; + display: block; + clear: both; +} + +.mec-events-meta-group-booking #mec-book-form-btn-step-1, +.mec-events-meta-group-booking #mec-book-form-btn-step-2 { + margin: 0; + float: right; +} + +.mec-wrap .mec-booking-form-container .col-md-12 { + padding-left: 0; +} + +.mec-wrap .mec-events-meta-group-booking .mec-wrap-checkout.row { + margin: 0; +} + +.lity-content + .mec-events-meta-group-booking + .mec-wrap-checkout.row + .mec-book-form-gateways + .mec-book-form-gateways-title, +.mec-wrap + .mec-events-meta-group-booking + .mec-wrap-checkout.row + .mec-book-form-gateways + .mec-book-form-gateways-title, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-wrap-checkout.row + .mec-book-form-gateways + .mec-book-form-gateways-title { + font-size: 18px; + font-weight: 600; + line-height: 24px; + color: #212224; + margin-bottom: 20px; +} + +.lity-content + .mec-events-meta-group-booking + .mec-wrap-checkout.row + .mec-book-form-gateways + .mec-book-form-gateways-radio-buttons, +.mec-wrap + .mec-events-meta-group-booking + .mec-wrap-checkout.row + .mec-book-form-gateways + .mec-book-form-gateways-radio-buttons, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-wrap-checkout.row + .mec-book-form-gateways + .mec-book-form-gateways-radio-buttons { + display: flex; + flex-wrap: wrap; + padding-bottom: 20px; +} + +.lity-content + .mec-events-meta-group-booking + .mec-wrap-checkout.row + .mec-book-form-gateways + .mec-book-form-gateways-radio-buttons + .mec-book-form-gateway-option, +.mec-wrap + .mec-events-meta-group-booking + .mec-wrap-checkout.row + .mec-book-form-gateways + .mec-book-form-gateways-radio-buttons + .mec-book-form-gateway-option, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-wrap-checkout.row + .mec-book-form-gateways + .mec-book-form-gateways-radio-buttons + .mec-book-form-gateway-option { + flex: calc(50% - 20px); + max-width: calc(50% - 10px); + border: 1px solid #e6e7e8; + border-radius: 3px; + margin-bottom: 20px; + padding: 14.5px 20px 14.5px 15px; + display: flex; + justify-content: flex-start; + align-items: center; + cursor: pointer; +} + +.lity-content + .mec-events-meta-group-booking + .mec-wrap-checkout.row + .mec-book-form-gateways + .mec-book-form-gateways-radio-buttons + .mec-book-form-gateway-option:has(input:checked), +.mec-wrap + .mec-events-meta-group-booking + .mec-wrap-checkout.row + .mec-book-form-gateways + .mec-book-form-gateways-radio-buttons + .mec-book-form-gateway-option:has(input:checked), +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-wrap-checkout.row + .mec-book-form-gateways + .mec-book-form-gateways-radio-buttons + .mec-book-form-gateway-option:has(input:checked) { + border: 1px solid var(--mec-color-skin-rgba-2); +} + +@media only screen and (max-width: 767px) { + .lity-content + .mec-events-meta-group-booking + .mec-events-meta-group-booking + .mec-wrap-checkout.row + .mec-book-form-gateways + .mec-book-form-gateways-radio-buttons + .mec-book-form-gateway-option, + .mec-wrap + .mec-events-meta-group-booking + .mec-wrap-checkout.row + .mec-book-form-gateways + .mec-book-form-gateways-radio-buttons + .mec-book-form-gateway-option, + .mec-events-meta-group-booking + .mec-booking-shortcode + .mec-wrap-checkout.row + .mec-book-form-gateways + .mec-book-form-gateways-radio-buttons + .mec-book-form-gateway-option { + flex: 100%; + max-width: 100%; + } + + .lity-content + .mec-events-meta-group-booking + .mec-wrap-checkout.row + .mec-book-form-gateways + .mec-book-form-gateways-radio-buttons + .mec-book-form-gateway-option:nth-child(2n + 1), + .mec-wrap + .mec-events-meta-group-booking + .mec-wrap-checkout.row + .mec-book-form-gateways + .mec-book-form-gateways-radio-buttons + .mec-book-form-gateway-option:nth-child(2n + 1), + .mec-events-meta-group-booking + .mec-booking-shortcode + .mec-wrap-checkout.row + .mec-book-form-gateways + .mec-book-form-gateways-radio-buttons + .mec-book-form-gateway-option:nth-child(2n + 1) { + margin-right: 0 !important; + } +} + +.lity-content + .mec-events-meta-group-booking + .mec-wrap-checkout.row + .mec-book-form-gateways + .mec-book-form-gateways-radio-buttons + .mec-book-form-gateway-option:nth-child(2n + 1), +.mec-wrap + .mec-events-meta-group-booking + .mec-wrap-checkout.row + .mec-book-form-gateways + .mec-book-form-gateways-radio-buttons + .mec-book-form-gateway-option:nth-child(2n + 1), +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-wrap-checkout.row + .mec-book-form-gateways + .mec-book-form-gateways-radio-buttons + .mec-book-form-gateway-option:nth-child(2n + 1) { + margin-right: 20px; +} + +.lity-content + .mec-events-meta-group-booking + .mec-wrap-checkout.row + .mec-book-form-gateways + .mec-book-form-gateways-radio-buttons + .mec-book-form-gateway-option + .mec-book-form-gateway-option-svg, +.mec-wrap + .mec-events-meta-group-booking + .mec-wrap-checkout.row + .mec-book-form-gateways + .mec-book-form-gateways-radio-buttons + .mec-book-form-gateway-option + .mec-book-form-gateway-option-svg, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-wrap-checkout.row + .mec-book-form-gateways + .mec-book-form-gateways-radio-buttons + .mec-book-form-gateway-option + .mec-book-form-gateway-option-svg { + display: flex; + margin-right: 10px; +} + +.lity-content + .mec-events-meta-group-booking + .mec-wrap-checkout.row + .mec-book-form-gateways + .mec-book-form-gateways-radio-buttons + .mec-book-form-gateway-option + .mec-book-form-gateway-option-title, +.mec-wrap + .mec-events-meta-group-booking + .mec-wrap-checkout.row + .mec-book-form-gateways + .mec-book-form-gateways-radio-buttons + .mec-book-form-gateway-option + .mec-book-form-gateway-option-title, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-wrap-checkout.row + .mec-book-form-gateways + .mec-book-form-gateways-radio-buttons + .mec-book-form-gateway-option + .mec-book-form-gateway-option-title { + font-size: 14px; + font-weight: 600; + line-height: 18px; +} + +.lity-content + .mec-events-meta-group-booking + .mec-wrap-checkout.row + .mec-book-form-gateways + .mec-book-form-gateways-radio-buttons + .mec-book-form-gateway-option + .mec-book-form-gateway-option-radio, +.mec-wrap + .mec-events-meta-group-booking + .mec-wrap-checkout.row + .mec-book-form-gateways + .mec-book-form-gateways-radio-buttons + .mec-book-form-gateway-option + .mec-book-form-gateway-option-radio, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-wrap-checkout.row + .mec-book-form-gateways + .mec-book-form-gateways-radio-buttons + .mec-book-form-gateway-option + .mec-book-form-gateway-option-radio { + margin-left: auto; +} + +.lity-content + .mec-events-meta-group-booking + .mec-wrap-checkout.row + .mec-book-form-gateways + .mec-book-form-gateways-radio-buttons + .mec-book-form-gateway-option + .mec-book-form-gateway-option-radio + input, +.mec-wrap + .mec-events-meta-group-booking + .mec-wrap-checkout.row + .mec-book-form-gateways + .mec-book-form-gateways-radio-buttons + .mec-book-form-gateway-option + .mec-book-form-gateway-option-radio + input, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-wrap-checkout.row + .mec-book-form-gateways + .mec-book-form-gateways-radio-buttons + .mec-book-form-gateway-option + .mec-book-form-gateway-option-radio + input { + left: -2px; +} + +.lity-content + .mec-wrap-checkout + .mec-book-form-gateways + .mec-book-form-gateway-label, +.mec-wrap + .mec-wrap-checkout + .mec-book-form-gateways + .mec-book-form-gateway-label, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-wrap-checkout + .mec-book-form-gateways + .mec-book-form-gateway-label { + padding-left: 3px; +} + +.mec-events-progress-bar { + display: flex; + align-items: center; + margin-top: 40px; +} + +.mec-event-list-standard .mec-events-progress-bar { + position: absolute; + margin-top: 15px; + left: calc(50% - 210px); +} + +.mec-single-modern .mec-events-progress-bar { + justify-content: flex-end; + padding: 0 20px; + margin-top: 10px; +} + +.mec-events-progress-bar .mec-progress-bar-time-passed, +.mec-events-progress-bar .mec-progress-bar-time-remained { + font-size: 10px; + line-height: 14px; + margin: 0 10px 0 0; + color: #959ca7; + width: 50px; + text-align: center; +} + +.mec-events-progress-bar .mec-progress-bar-time-remained { + margin: 0 0 0 10px; +} + +.mec-events-progress-bar progress { + width: 300px; + height: 4px; + border-radius: 3px; + position: relative; +} + +.mec-events-progress-bar progress:after { + content: ""; + width: 12px; + height: 12px; + display: block; + border-radius: 100%; + background-color: #38d5ed; + position: absolute; + top: -4px; +} + +.mec-events-progress-bar progress::-webkit-progress-bar { + background-color: #e6e7e8; + border-radius: 3px; +} + +.mec-events-progress-bar progress::-webkit-progress-value { + background-color: #38d5ed; + border-radius: 3px; +} + +.lity-content .mec-events-meta-group-booking .mec-event-ticket-available, +.mec-single-event .mec-events-meta-group-booking .mec-event-ticket-available, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-event-ticket-available { + display: block; + margin-bottom: 20px; + margin-top: -17px; + font-size: 11px; + color: #8a8a8a; +} + +.lity-content + .mec-events-meta-group-booking + .mec-booking-checkout-coupon-total-wrapper, +.mec-single-event + .mec-events-meta-group-booking + .mec-booking-checkout-coupon-total-wrapper, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-booking-checkout-coupon-total-wrapper { + display: flex; + justify-content: space-between; + margin: 30px 0 40px; +} + +@media only screen and (max-width: 767px) { + .lity-content + .mec-events-meta-group-booking + .mec-booking-checkout-coupon-total-wrapper, + .mec-single-event + .mec-events-meta-group-booking + .mec-booking-checkout-coupon-total-wrapper, + .mec-events-meta-group-booking + .mec-booking-shortcode + .mec-booking-checkout-coupon-total-wrapper { + flex-direction: column; + } + + .lity-content + .mec-events-meta-group-booking + .mec-book-form-coupon + form + span.mec-booking-coupon-field-wrapper + input, + .mec-single-event + .mec-events-meta-group-booking + .mec-book-form-coupon + form + span.mec-booking-coupon-field-wrapper + input, + .mec-events-meta-group-booking + .mec-booking-shortcode + .mec-book-form-coupon + form + span.mec-booking-coupon-field-wrapper + input { + width: 100%; + } + + .lity-content + .mec-events-meta-group-booking + .mec-book-form-coupon + form + button, + .mec-single-event + .mec-events-meta-group-booking + .mec-book-form-coupon + form + button, + .mec-events-meta-group-booking + .mec-booking-shortcode + .mec-book-form-coupon + form + button { + left: unset !important; + right: 5px; + } +} + +.lity-content + .mec-events-meta-group-booking + .mec-booking-checkout-coupon-total-wrapper + .mec-booking-checkout-total-wrapper + ul, +.mec-single-event + .mec-events-meta-group-booking + .mec-booking-checkout-coupon-total-wrapper + .mec-booking-checkout-total-wrapper + ul, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-booking-checkout-coupon-total-wrapper + .mec-booking-checkout-total-wrapper + ul { + display: flex; + align-items: center; +} + +.lity-content + .mec-events-meta-group-booking + .mec-booking-checkout-coupon-total-wrapper + .mec-booking-checkout-total-wrapper + ul + li, +.mec-single-event + .mec-events-meta-group-booking + .mec-booking-checkout-coupon-total-wrapper + .mec-booking-checkout-total-wrapper + ul + li, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-booking-checkout-coupon-total-wrapper + .mec-booking-checkout-total-wrapper + ul + li { + margin-bottom: 0; + text-align: right; +} + +.lity-content + .mec-events-meta-group-booking + .mec-booking-checkout-coupon-total-wrapper + .mec-booking-checkout-total-wrapper + ul + li, +.mec-single-event + .mec-events-meta-group-booking + .mec-booking-checkout-coupon-total-wrapper + .mec-booking-checkout-total-wrapper + ul + li, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-booking-checkout-coupon-total-wrapper + .mec-booking-checkout-total-wrapper + ul + li { + padding-left: 30px; + margin-left: 30px; + border-left: 1px dashed #e6e7e8; +} + +.lity-content + .mec-events-meta-group-booking + .mec-booking-checkout-coupon-total-wrapper + .mec-booking-checkout-total-wrapper + ul + li:first-child, +.mec-single-event + .mec-events-meta-group-booking + .mec-booking-checkout-coupon-total-wrapper + .mec-booking-checkout-total-wrapper + ul + li:first-child, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-booking-checkout-coupon-total-wrapper + .mec-booking-checkout-total-wrapper + ul + li:first-child { + padding-left: unset; + margin-left: unset; + border-left: none; +} + +.lity-content + .mec-events-meta-group-booking + .mec-booking-checkout-coupon-total-wrapper + .mec-booking-checkout-total-wrapper + ul + li + span, +.mec-single-event + .mec-events-meta-group-booking + .mec-booking-checkout-coupon-total-wrapper + .mec-booking-checkout-total-wrapper + ul + li + span, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-booking-checkout-coupon-total-wrapper + .mec-booking-checkout-total-wrapper + ul + li + span { + display: block; + font-size: 14px; + font-weight: 400; + line-height: 19px; + color: #606367; + margin-bottom: 4px; +} + +.lity-content + .mec-events-meta-group-booking + .mec-booking-checkout-coupon-total-wrapper + .mec-booking-checkout-total-wrapper + ul + li + span:last-child, +.mec-single-event + .mec-events-meta-group-booking + .mec-booking-checkout-coupon-total-wrapper + .mec-booking-checkout-total-wrapper + ul + li + span:last-child, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-booking-checkout-coupon-total-wrapper + .mec-booking-checkout-total-wrapper + ul + li + span:last-child { + font-size: 18px; + font-weight: 600; + line-height: 24px; + color: #212224; + margin: 0; +} + +.lity-content + .mec-events-meta-group-booking + .mec-booking-checkout-coupon-total-wrapper + .mec-booking-checkout-total-wrapper + ul + li + span.mec-book-price-total, +.mec-single-event + .mec-events-meta-group-booking + .mec-booking-checkout-coupon-total-wrapper + .mec-booking-checkout-total-wrapper + ul + li + span.mec-book-price-total, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-booking-checkout-coupon-total-wrapper + .mec-booking-checkout-total-wrapper + ul + li + span.mec-book-price-total { + font-weight: 700; +} + +@media only screen and (max-width: 767px) { + .lity-content + .mec-events-meta-group-booking + .mec-booking-checkout-coupon-total-wrapper + .mec-booking-checkout-total-wrapper + ul, + .mec-single-event + .mec-events-meta-group-booking + .mec-booking-checkout-coupon-total-wrapper + .mec-booking-checkout-total-wrapper + ul, + .mec-events-meta-group-booking + .mec-booking-shortcode + .mec-booking-checkout-coupon-total-wrapper + .mec-booking-checkout-total-wrapper + ul { + margin-top: 30px; + } +} + +.lity-content .mec-events-meta-group-booking .mec-book-form-coupon form, +.mec-single-event .mec-events-meta-group-booking .mec-book-form-coupon form, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-book-form-coupon + form { + margin: 0; + position: relative; +} + +.lity-content + .mec-events-meta-group-booking + .mec-booking-checkout-coupon-wrapper, +.mec-single-event + .mec-events-meta-group-booking + .mec-booking-checkout-coupon-wrapper, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-booking-checkout-coupon-wrapper { + width: 330px; +} + +.lity-content + .mec-events-meta-group-booking + .mec-book-form-coupon + form + span.mec-booking-coupon-field-wrapper, +.mec-single-event + .mec-events-meta-group-booking + .mec-book-form-coupon + form + span.mec-booking-coupon-field-wrapper, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-book-form-coupon + form + span.mec-booking-coupon-field-wrapper { + display: flex; + border: 1px solid #e3e5e7; + border-radius: 3px; + max-width: 330px; +} + +.lity-content + .mec-events-meta-group-booking + .mec-book-form-coupon + form + span.mec-booking-coupon-field-wrapper + .mec-booking-coupon-field-icon, +.mec-single-event + .mec-events-meta-group-booking + .mec-book-form-coupon + form + span.mec-booking-coupon-field-wrapper + .mec-booking-coupon-field-icon, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-book-form-coupon + form + span.mec-booking-coupon-field-wrapper + .mec-booking-coupon-field-icon { + display: flex; + justify-content: center; + align-items: center; + border-right: 1px solid #e3e5e7; + background: #fafafa; + min-width: 40px; +} + +.lity-content + .mec-events-meta-group-booking + .mec-book-form-coupon + form + span.mec-booking-coupon-field-wrapper + input, +.mec-single-event + .mec-events-meta-group-booking + .mec-book-form-coupon + form + span.mec-booking-coupon-field-wrapper + input, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-book-form-coupon + form + span.mec-booking-coupon-field-wrapper + input { + border: none; + line-height: 48px; + height: unset; +} + +.lity-content .mec-events-meta-group-booking .mec-book-form-coupon form button, +.mec-single-event + .mec-events-meta-group-booking + .mec-book-form-coupon + form + button, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-book-form-coupon + form + button { + margin: 0 !important; + position: absolute !important; + top: 6px; + left: auto; + right: 6px; + padding: 9px 18px 10px !important; +} + +.lity-content + .mec-events-meta-group-booking + .mec-book-form-coupon + form + button.loading, +.mec-single-event + .mec-events-meta-group-booking + .mec-book-form-coupon + form + button.loading, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-book-form-coupon + form + button.loading { + color: #ecf9fd !important; +} + +.lity-content + .mec-events-meta-group-booking + .mec-book-form-coupon + form + button.loading:after, +.mec-single-event + .mec-events-meta-group-booking + .mec-book-form-coupon + form + button.loading:after, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-book-form-coupon + form + button.loading:after { + position: absolute; + left: calc(50% - 10px); +} + +.lity-content .mec-events-meta-group-booking label, +.mec-single-event .mec-events-meta-group-booking label, +.mec-events-meta-group-booking .mec-booking-shortcode label, +.lity-content .mec-events-meta-group-booking h5, +.mec-single-event .mec-events-meta-group-booking h5, +.mec-events-meta-group-booking .mec-booking-shortcode h5 { + color: #606367; + font-size: 14px; + font-weight: 400; + line-height: 19px; + letter-spacing: 0; + margin: 0 0 4px 0; + display: block; + clear: none; + padding: 0 1em 5px 0; +} + +.lity-content .mec-events-meta-group-booking h5 span, +.mec-single-event .mec-events-meta-group-booking h5 span, +.mec-events-meta-group-booking .mec-booking-shortcode h5 span { + display: inline-block; +} + +.lity-content .mec-events-meta-group-booking h5 span.mec-ticket-variation-name, +.mec-single-event + .mec-events-meta-group-booking + h5 + span.mec-ticket-variation-name, +.mec-events-meta-group-booking + .mec-booking-shortcode + h5 + span.mec-ticket-variation-name { + padding-right: 5px; + text-transform: capitalize; +} + +.lity-content .mec-events-meta-group-booking input::-webkit-input-placeholder, +.mec-single-event + .mec-events-meta-group-booking + input::-webkit-input-placeholder, +.mec-events-meta-group-booking + .mec-booking-shortcode + input::-webkit-input-placeholder { + color: #aaa; +} + +.lity-content .mec-events-meta-group-booking input:-moz-placeholder, +.mec-single-event .mec-events-meta-group-booking input:-moz-placeholder, +.mec-events-meta-group-booking .mec-booking-shortcode input:-moz-placeholder { + color: #aaa; +} + +.lity-content .mec-events-meta-group-booking input[type="text"], +.mec-single-event .mec-events-meta-group-booking input[type="text"], +.mec-events-meta-group-booking .mec-booking-shortcode input[type="text"], +.lity-content .mec-events-meta-group-booking input[type="date"], +.mec-single-event .mec-events-meta-group-booking input[type="date"], +.mec-events-meta-group-booking .mec-booking-shortcode input[type="date"], +.lity-content .mec-events-meta-group-booking input[type="number"], +.mec-single-event .mec-events-meta-group-booking input[type="number"], +.mec-events-meta-group-booking .mec-booking-shortcode input[type="number"], +.lity-content .mec-events-meta-group-booking input[type="email"], +.mec-single-event .mec-events-meta-group-booking input[type="email"], +.mec-events-meta-group-booking .mec-booking-shortcode input[type="email"], +.lity-content .mec-events-meta-group-booking input[type="password"], +.mec-single-event .mec-events-meta-group-booking input[type="password"], +.mec-events-meta-group-booking .mec-booking-shortcode input[type="password"], +.lity-content .mec-events-meta-group-booking input[type="tel"], +.mec-single-event .mec-events-meta-group-booking input[type="tel"], +.mec-events-meta-group-booking .mec-booking-shortcode input[type="tel"], +.lity-content .mec-events-meta-group-booking textarea, +.mec-single-event .mec-events-meta-group-booking textarea, +.mec-events-meta-group-booking .mec-booking-shortcode textarea, +.lity-content .mec-events-meta-group-booking select, +.mec-single-event .mec-events-meta-group-booking select, +.mec-events-meta-group-booking .mec-booking-shortcode select { + display: block; + background: #fff; + min-height: 40px; + min-width: 180px; + font-size: 13px; + line-height: 38px; + color: #606367; + border: 1px solid #e3e5e7; + border-radius: 3px; + padding: 0 12px; + width: 100%; + margin-bottom: 0; + box-shadow: unset; + clear: both; +} + +.lity-content + .mec-events-meta-group-booking + select:not(#mec_paypal_credit_card_card_type), +.mec-single-event + .mec-events-meta-group-booking + select:not(#mec_paypal_credit_card_card_type), +.mec-events-meta-group-booking + .mec-booking-shortcode + select:not(#mec_paypal_credit_card_card_type) { + width: 100%; + -webkit-appearance: none; + background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMS40MjQiIGhlaWdodD0iNi40MiIgdmlld0JveD0iMCAwIDExLjQyNCA2LjQyIj4NCiAgPGcgaWQ9Ikdyb3VwXzY1NjI3IiBkYXRhLW5hbWU9Ikdyb3VwIDY1NjI3IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwLjIxMiAwLjIxMikiPg0KICAgIDxwYXRoIGlkPSJhbmdsZS1sZWZ0IiBkPSJNLjk5LDUuNWw1LDUuMDA1LS41LjVMMCw1LjUsNS41LDAsNiwuNS45OSw1LjVaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwIDUuOTk1KSByb3RhdGUoLTkwKSIgZmlsbD0iIzYzNmY3MiIgc3Ryb2tlPSIjNjM2ZjcyIiBzdHJva2Utd2lkdGg9IjAuMyIvPg0KICA8L2c+DQo8L3N2Zz4NCg=="); + background-position: calc(100% - 12px) center; + background-repeat: no-repeat; +} + +.mec-events-meta-group-booking + .mec-booking-shortcode + ul.mec-book-tickets-reg-fields-container + li { + width: calc(100% - 83.665px); + float: left; +} + +.lity-content .mec-events-meta-group-booking .mec-book-ticket-variation-wrapper, +.mec-single-event + .mec-events-meta-group-booking + .mec-book-ticket-variation-wrapper, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-book-ticket-variation-wrapper { + width: 100%; +} + +.lity-content + .mec-events-meta-group-booking + .mec-paypal-credit-card-payment-fields + li, +.mec-single-event + .mec-events-meta-group-booking + .mec-paypal-credit-card-payment-fields + li, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-paypal-credit-card-payment-fields + li { + width: 50%; + float: left; +} + +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-paypal-credit-card-payment-fields + li, +.mec-events-meta-group-booking + .mec-booking-shortcode + ul.mec-book-tickets-reg-fields-container + li:first-child, +.mec-events-meta-group-booking + .mec-booking-shortcode + ul.mec-book-tickets-reg-fields-container + li:nth-child(2), +.mec-single-event + .mec-events-meta-group-booking + .mec-paypal-credit-card-payment-fields + li { + width: calc(50% - 83.665px); +} + +.lity-content + .mec-events-meta-group-booking + .mec-paypal-credit-card-payment-fields, +.mec-single-event + .mec-events-meta-group-booking + .mec-paypal-credit-card-payment-fields, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-paypal-credit-card-payment-fields { + padding-top: 20px; +} + +.lity-content + .mec-events-meta-group-booking + .mec-paypal-credit-card-payment-fields + li.mec-paypal-credit-card-expiration-date-month + select, +.mec-single-event + .mec-events-meta-group-booking + .mec-paypal-credit-card-payment-fields + li.mec-paypal-credit-card-expiration-date-month + select, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-paypal-credit-card-payment-fields + li.mec-paypal-credit-card-expiration-date-month + select { + width: calc(50% - 24px) !important; + display: inline-block; + min-width: unset; +} + +@media only screen and (max-width: 768px) { + .mec-events-meta-group-booking + .mec-booking-shortcode + ul.mec-book-tickets-reg-fields-container + li:first-child, + .lity-content + .mec-events-meta-group-booking + .mec-paypal-credit-card-payment-fields + li:nth-child(2n + 1), + .mec-single-event + .mec-events-meta-group-booking + .mec-paypal-credit-card-payment-fields + li:nth-child(2n + 1), + .mec-events-meta-group-booking + .mec-booking-shortcode + .mec-paypal-credit-card-payment-fields + li:nth-child(2n + 1), + .mec-events-meta-group-booking + .mec-booking-shortcode + ul.mec-book-tickets-reg-fields-container + li:nth-child(2) { + width: calc(100% - 83.665px); + max-width: unset; + } + + .lity-content + .mec-events-meta-group-booking + ul.mec-book-tickets-reg-fields-container + li + input, + .lity-content + .mec-events-meta-group-booking + .mec-book-ticket-variation-wrapper + input, + .mec-single-event + .mec-events-meta-group-booking + ul.mec-book-tickets-reg-fields-container + li + input, + .mec-single-event + .mec-events-meta-group-booking + .mec-book-ticket-variation-wrapper + input, + .mec-events-meta-group-booking + .mec-booking-shortcode + ul.mec-book-tickets-reg-fields-container + li + input, + .mec-events-meta-group-booking + .mec-booking-shortcode + .mec-book-ticket-variation-wrapper + input { + max-width: unset !important; + } + + .lity-content + .mec-events-meta-group-booking + ul.mec-book-tickets-reg-fields-container + li:nth-child(2n) + input, + .lity-content + .mec-events-meta-group-booking + .mec-book-ticket-variation-wrapper:nth-child(2n) + input, + .mec-single-event + .mec-events-meta-group-booking + ul.mec-book-tickets-reg-fields-container + li:nth-child(2n) + input, + .mec-single-event + .mec-events-meta-group-booking + .mec-book-ticket-variation-wrapper:nth-child(2n) + input, + .mec-events-meta-group-booking + .mec-booking-shortcode + ul.mec-book-tickets-reg-fields-container + li:nth-child(2n) + input, + .mec-events-meta-group-booking + .mec-booking-shortcode + .mec-book-ticket-variation-wrapper:nth-child(2n) + input { + margin-left: 0px; + } +} + +.wbmec-mandatory { + padding-left: 5px; + font-size: 14px; + color: red; +} + +.lity-content .mec-events-meta-group-booking .mec-booking-email-field-wrapper, +.mec-single-event + .mec-events-meta-group-booking + .mec-booking-email-field-wrapper, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-booking-email-field-wrapper, +.lity-content .mec-events-meta-group-booking .mec-booking-name-field-wrapper, +.mec-single-event + .mec-events-meta-group-booking + .mec-booking-name-field-wrapper, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-booking-name-field-wrapper, +.lity-content .mec-events-meta-group-booking .mec-stripe-name-and-email-wrapper, +.mec-single-event + .mec-events-meta-group-booking + .mec-stripe-name-and-email-wrapper, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-stripe-name-and-email-wrapper, +.lity-content .mec-events-meta-group-booking .mec-field-wrapper, +.mec-single-event .mec-events-meta-group-booking .mec-field-wrapper, +.mec-events-meta-group-booking .mec-booking-shortcode .mec-field-wrapper { + display: flex; + align-items: flex-start; +} + +.lity-content + .mec-events-meta-group-booking + .mec-booking-email-field-wrapper + span.mec-booking-email-field-icon, +.mec-single-event + .mec-events-meta-group-booking + .mec-booking-email-field-wrapper + span.mec-booking-email-field-icon, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-booking-email-field-wrapper + span.mec-booking-email-field-icon, +.lity-content + .mec-events-meta-group-booking + .mec-booking-name-field-wrapper + span.mec-booking-name-field-icon, +.mec-single-event + .mec-events-meta-group-booking + .mec-booking-name-field-wrapper + span.mec-booking-name-field-icon, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-booking-name-field-wrapper + span.mec-booking-name-field-icon, +.lity-content + .mec-events-meta-group-booking + .mec-stripe-name-and-email-wrapper + span.mec-booking-email-field-icon, +.mec-single-event + .mec-events-meta-group-booking + .mec-stripe-name-and-email-wrapper + span.mec-booking-email-field-icon, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-stripe-name-and-email-wrapper + span.mec-booking-email-field-icon, +.lity-content + .mec-events-meta-group-booking + .mec-field-wrapper + span.mec-field-icon, +.mec-single-event + .mec-events-meta-group-booking + .mec-field-wrapper + span.mec-field-icon, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-field-wrapper + span.mec-field-icon { + border: 1px solid #e3e5e7; + background: #fafafa; + border-radius: 3px 0 0 3px; + min-width: 40px; + height: 40px; + display: flex; + justify-content: center; + align-items: center; +} + +.lity-content + .mec-events-meta-group-booking + .mec-booking-email-field-wrapper + input, +.mec-single-event + .mec-events-meta-group-booking + .mec-booking-email-field-wrapper + input, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-booking-email-field-wrapper + input, +.lity-content + .mec-events-meta-group-booking + .mec-stripe-name-and-email-wrapper + input, +.mec-single-event + .mec-events-meta-group-booking + .mec-stripe-name-and-email-wrapper + input, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-stripe-name-and-email-wrapper + input { + border-left: none; + border-radius: 0 3px 3px 0; +} + +.lity-content + .mec-events-meta-group-booking + .mec-booking-name-field-wrapper + input, +.mec-single-event + .mec-events-meta-group-booking + .mec-booking-name-field-wrapper + input, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-booking-name-field-wrapper + input, +.lity-content .mec-events-meta-group-booking .mec-field-wrapper input, +.mec-single-event .mec-events-meta-group-booking .mec-field-wrapper input, +.mec-events-meta-group-booking .mec-booking-shortcode .mec-field-wrapper input { + border-left: none; + border-radius: 0 3px 3px 0; +} + +.lity-content .mec-events-meta-group-booking .mec-red-notification input, +.mec-single-event .mec-events-meta-group-booking .mec-red-notification input, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-red-notification + input, +.lity-content .mec-events-meta-group-booking .mec-red-notification textarea, +.mec-single-event .mec-events-meta-group-booking .mec-red-notification textarea, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-red-notification + textarea, +.lity-content .mec-events-meta-group-booking .mec-red-notification select, +.mec-single-event .mec-events-meta-group-booking .mec-red-notification select, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-red-notification + select { + border: 1px solid #ff3c3c !important; +} + +.mec-single-event + .mec-events-meta-group-booking + .mec-red-notification + input[type="radio"], +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-red-notification + input[type="radio"], +.mec-single-event + .mec-events-meta-group-booking + .mec-red-notification + input[type="checkbox"], +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-red-notification + input[type="checkbox"], +.lity-content + .mec-events-meta-group-booking + .mec-red-notification + input[type="checkbox"], +.lity-content + .mec-events-meta-group-booking + .mec-red-notification + input[type="radio"] { + outline: 1px solid #ff3c3c !important; +} + +/* Modal booking - required forms */ +.lity-content .mec-book-ticket-container .mec-red-notification input, +.lity-content .mec-book-ticket-container .mec-red-notification select, +.lity-content .mec-book-ticket-container .mec-red-notification textarea { + border: 1px solid #ff3c3c !important; +} + +.mec-booking .woocommerce-notices-wrapper .woocommerce-message { + color: #089740; + background-color: #effdef; + margin: 0; + line-height: 40px; + border: 0; + border-radius: 5px; +} + +.mec-booking .woocommerce-notices-wrapper .woocommerce-message a { + margin: 0; +} + +@media only screen and (max-width: 479px) { + .lity-content .mec-events-meta-group-booking input[type="text"], + .mec-single-event .mec-events-meta-group-booking input[type="text"], + .mec-events-meta-group-booking .mec-booking-shortcode input[type="text"], + .lity-content .mec-events-meta-group-booking input[type="date"], + .mec-single-event .mec-events-meta-group-booking input[type="date"], + .mec-events-meta-group-booking .mec-booking-shortcode input[type="date"], + .lity-content .mec-events-meta-group-booking input[type="number"], + .mec-single-event .mec-events-meta-group-booking input[type="number"], + .mec-events-meta-group-booking .mec-booking-shortcode input[type="number"], + .lity-content .mec-events-meta-group-booking input[type="email"], + .mec-single-event .mec-events-meta-group-booking input[type="email"], + .mec-events-meta-group-booking .mec-booking-shortcode input[type="email"], + .lity-content .mec-events-meta-group-booking input[type="password"], + .mec-single-event .mec-events-meta-group-booking input[type="password"], + .mec-events-meta-group-booking .mec-booking-shortcode input[type="password"], + .lity-content .mec-events-meta-group-booking input[type="tel"], + .mec-single-event .mec-events-meta-group-booking input[type="tel"], + .mec-events-meta-group-booking .mec-booking-shortcode input[type="tel"], + .lity-content .mec-events-meta-group-booking textarea, + .mec-single-event .mec-events-meta-group-booking textarea, + .mec-events-meta-group-booking .mec-booking-shortcode textarea, + .lity-content .mec-events-meta-group-booking select, + .mec-single-event .mec-events-meta-group-booking select, + .mec-events-meta-group-booking .mec-booking-shortcode select { + width: 100%; + } + + .lity-content .mec-events-meta-group-booking, + .mec-single-event .mec-events-meta-group-booking, + .mec-events-meta-group-booking .mec-booking-shortcode { + padding: 20px 10px; + } +} + +.lity-content .mec-events-meta-group-booking input[type="text"]:focus, +.mec-single-event .mec-events-meta-group-booking input[type="text"]:focus, +.mec-events-meta-group-booking .mec-booking-shortcode input[type="text"]:focus, +.lity-content .mec-events-meta-group-booking input[type="number"]:focus, +.mec-single-event .mec-events-meta-group-booking input[type="number"]:focus, +.mec-events-meta-group-booking .mec-booking-shortcodec, +.lity-content .mec-events-meta-group-booking input[type="number"]:focus, +.mec-single-event .mec-events-meta-group-booking input[type="number"]:focus, +.mec-events-meta-group-booking + .mec-booking-shortcode + input[type="number"]:focus, +.lity-content .mec-events-meta-group-booking input[type="email"]:focus, +.mec-single-event .mec-events-meta-group-booking input[type="email"]:focus, +.mec-events-meta-group-booking .mec-booking-shortcode input[type="email"]:focus, +.lity-content .mec-events-meta-group-booking input[type="password"]:focus, +.mec-single-event .mec-events-meta-group-booking input[type="password"]:focus, +.mec-events-meta-group-booking + .mec-booking-shortcode + input[type="password"]:focus, +.lity-content .mec-events-meta-group-booking input[type="tel"]:focus, +.mec-single-event .mec-events-meta-group-booking input[type="tel"]:focus, +.mec-events-meta-group-booking .mec-booking-shortcode input[type="tel"]:focus, +.lity-content .mec-events-meta-group-booking textarea:focus, +.mec-single-event .mec-events-meta-group-booking textarea:focus, +.mec-events-meta-group-booking .mec-booking-shortcode textarea:focus, +.lity-content .mec-events-meta-group-booking select:focus, +.mec-single-event .mec-events-meta-group-booking select:focus, +.mec-events-meta-group-booking .mec-booking-shortcode select:focus { + outline: none; +} + +.lity-content .mec-events-meta-group-booking input[type="checkbox"], +.mec-single-event .mec-events-meta-group-booking input[type="checkbox"], +.mec-events-meta-group-booking .mec-booking-shortcode input[type="checkbox"], +.lity-content .mec-events-meta-group-booking input[type="radio"], +.mec-single-event .mec-events-meta-group-booking input[type="radio"], +.mec-events-meta-group-booking .mec-booking-shortcode input[type="radio"] { + margin-right: 6px; + margin-top: 5px; + min-height: 20px; + clear: none; + margin: 0; +} + +.lity-content .mec-events-meta-group-booking input[type="radio"]:before, +.mec-single-event .mec-events-meta-group-booking input[type="radio"]:before, +.mec-events-meta-group-booking + .mec-booking-shortcode + input[type="radio"]:before, +.lity-container .mec-events-meta-group-booking input[type="radio"]:before { + content: ""; + display: inline-block; + background: #fff; + border-radius: 50%; + width: 18px; + height: 18px; + cursor: pointer; + border: 2px solid #e1e7ed; + position: absolute; + top: -2px; + left: -2px; +} + +.mec-single-event + .mec-events-meta-group-booking + input[type="radio"]:checked:before, +.mec-events-meta-group-booking + .mec-booking-shortcode + input[type="radio"]:checked:before, +.lity-container + .mec-events-meta-group-booking + input[type="radio"]:checked:before { + background: #38d5ed; + border: 4px solid #fff; + box-shadow: 0 0 0 2px #afebf5; + width: 14px; + height: 14px; + top: 0px; + left: 0px; +} + +.lity-content .mec-events-meta-group-booking input[type="radio"], +.mec-single-event .mec-events-meta-group-booking input[type="radio"], +.mec-events-meta-group-booking .mec-booking-shortcode input[type="radio"], +.lity-container .mec-events-meta-group-booking input[type="radio"] { + min-height: 0; + margin: 0; + position: relative; + top: 3px; + left: 3px; + width: 14px; + height: 14px; +} + +.lity-content .mec-events-meta-group-booking input[type="checkbox"], +.mec-single-event .mec-events-meta-group-booking input[type="checkbox"], +.mec-events-meta-group-booking .mec-booking-shortcode input[type="checkbox"] { + float: left; +} + +.mec-events-meta-group-booking ul.mec-book-price-details { + list-style: none; + padding: 0; + overflow: hidden; + display: flex; + align-items: center; +} + +.mec-events-meta-group-booking ul.mec-book-price-details li { + list-style: none; + margin: 0; + border-right: 1px dashed #e6e7e8; + padding-right: 30px !important; + margin-right: 30px; + text-align: center; +} + +.mec-events-meta-group-booking + ul.mec-book-price-details + li.mec-book-price-detail.mec-book-price-detail-type-tickets { + display: flex; + align-items: center; +} + +.mec-events-meta-group-booking ul.mec-book-price-details li span { + display: block; + font-size: 14px; + font-weight: 400; + line-height: 19px; + color: #606367; + margin-bottom: 4px; +} + +.mec-events-meta-group-booking + ul.mec-book-price-details + li + span.mec-book-price-detail-icon { + margin: 0 30px 0 0; + width: 48px; +} + +.mec-events-meta-group-booking + ul.mec-book-price-details + li + span.mec-book-price-detail-amount { + font-size: 18px; + font-weight: 600; + line-height: 24px; + color: #212224; + margin-bottom: 0; +} + +.mec-events-meta-group-booking ul.mec-book-price-details li:last-child { + border-right: none; +} + +@media only screen and (max-width: 767px) { + .mec-events-meta-group-booking ul.mec-book-price-details { + flex-direction: column; + } + + .mec-events-meta-group-booking ul.mec-book-price-details li { + border-right: none; + padding-right: 0 !important; + margin-right: 0; + border-bottom: 1px dashed #e6e7e8; + padding-bottom: 30px !important; + margin-bottom: 30px; + } + + .lity-content + .mec-events-meta-group-booking + .mec-booking-checkout-coupon-total-wrapper + .mec-booking-checkout-total-wrapper + ul, + .mec-single-event + .mec-events-meta-group-booking + .mec-booking-checkout-coupon-total-wrapper + .mec-booking-checkout-total-wrapper + ul, + .mec-events-meta-group-booking + .mec-booking-shortcode + .mec-booking-checkout-coupon-total-wrapper + .mec-booking-checkout-total-wrapper + ul { + flex-direction: column; + } + + .lity-content + .mec-events-meta-group-booking + .mec-booking-checkout-coupon-total-wrapper + .mec-booking-checkout-total-wrapper + ul + li, + .mec-single-event + .mec-events-meta-group-booking + .mec-booking-checkout-coupon-total-wrapper + .mec-booking-checkout-total-wrapper + ul + li, + .mec-events-meta-group-booking + .mec-booking-shortcode + .mec-booking-checkout-coupon-total-wrapper + .mec-booking-checkout-total-wrapper + ul + li { + padding-left: 0; + margin-left: 0; + border-left: none; + padding-bottom: 30px; + margin-bottom: 30px; + border-bottom: 1px dashed #e6e7e8; + } +} + +.lity-content .mec-events-meta-group-booking .mec_book_first_for_all, +.mec-single-event .mec-events-meta-group-booking .mec_book_first_for_all, +.mec-events-meta-group-booking .mec-booking-shortcode .mec_book_first_for_all, +.lity-container .mec-events-meta-group-booking .mec_book_first_for_all, +.lity-content .mec-events-meta-group-booking input[type="checkbox"], +.mec-single-event .mec-events-meta-group-booking input[type="checkbox"], +.mec-events-meta-group-booking .mec-booking-shortcode input[type="checkbox"], +.mec-single-event + .mec-events-meta-group-booking + .mec-booking-dates-checkboxes + input[type="checkbox"], +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-booking-dates-checkboxes + input[type="checkbox"], +.lity-content + .mec-events-meta-group-booking + .mec-booking-dates-checkboxes + input[type="checkbox"], +.mec-booking input[type="checkbox"], +.mec-wrap .mec-simple-checkboxes-search ul li label input[type="checkbox"] { + -webkit-appearance: none; + appearance: none; + font: inherit; + width: 20px; + height: 20px; + min-height: unset; + padding: 0; + border: 1px solid #e3e5e7; + border-radius: 4px; + display: flex; + margin: 0 10px 0 1px; + overflow: hidden; +} + +.lity-content .mec-events-meta-group-booking .mec_book_first_for_all:before, +.mec-single-event .mec-events-meta-group-booking .mec_book_first_for_all:before, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec_book_first_for_all:before, +.lity-container .mec-events-meta-group-booking .mec_book_first_for_all:before, +.lity-content .mec-events-meta-group-booking input[type="checkbox"]:before, +.mec-single-event .mec-events-meta-group-booking input[type="checkbox"]:before, +.mec-events-meta-group-booking + .mec-booking-shortcode + input[type="checkbox"]:before, +.mec-single-event + .mec-events-meta-group-booking + .mec-booking-dates-checkboxes + input[type="checkbox"]:before, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-booking-dates-checkboxes + input[type="checkbox"]:before, +.lity-content + .mec-events-meta-group-booking + .mec-booking-dates-checkboxes + input[type="checkbox"]:before, +.mec-booking input[type="checkbox"]:before, +.mec-wrap + .mec-simple-checkboxes-search + ul + li + label + input[type="checkbox"]:before { + content: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMCIgaGVpZ2h0PSI4IiB2aWV3Qm94PSIwIDAgMTAgOCI+DQogIDxwYXRoIGlkPSJEb25lIiBkPSJNOS4xNzUsMGEuOC44LDAsMCwwLS42NjUuMzA2bC01LjIsNS42NDdMMS4zODgsMy44MzNhLjcuNywwLDAsMC0uNjczLS4yMTIsMS4zODIsMS4zODIsMCwwLDAtLjcuNy44NjIuODYyLDAsMCwwLC4yMjYuNzI0TDIuNzk1LDcuNzkxYS43OTIuNzkyLDAsMCwwLDEuMDYyLjAxTDkuNzY5LDEuMzI5QS44MzIuODMyLDAsMCwwLDkuOTYuNTIxLDEsMSwwLDAsMCw5LjE3NSwwWiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAwKSIgZmlsbD0iI2ZmZiIvPg0KPC9zdmc+DQo="); + min-width: 18px; + height: auto; + line-height: 16px; + border-radius: 2px; + transform: scale(0); + transition: 120ms transform ease-in-out; + background-color: var(--mec-color-skin); + display: flex; + justify-content: center; +} + +.mec-single-event + .mec-events-meta-group-booking + .mec_book_first_for_all:checked, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec_book_first_for_all:checked, +.lity-container .mec-events-meta-group-booking .mec_book_first_for_all:checked, +.lity-content .mec-events-meta-group-booking input[type="checkbox"]:checked, +.mec-single-event .mec-events-meta-group-booking input[type="checkbox"]:checked, +.mec-events-meta-group-booking + .mec-booking-shortcode + input[type="checkbox"]:checked, +.mec-single-event + .mec-events-meta-group-booking + .mec-booking-dates-checkboxes + input[type="checkbox"]:checked, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-booking-dates-checkboxes + input[type="checkbox"]:checked, +.lity-content + .mec-events-meta-group-booking + .mec-booking-dates-checkboxes + input[type="checkbox"]:checked, +.mec-booking input[type="checkbox"]:checked, +.mec-wrap + .mec-simple-checkboxes-search + ul + li + label + input[type="checkbox"]:checked { + border: 1px solid var(--mec-color-skin) !important; +} + +.mec-single-event + .mec-events-meta-group-booking + .mec_book_first_for_all:checked:before, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec_book_first_for_all:checked:before, +.lity-container + .mec-events-meta-group-booking + .mec_book_first_for_all:checked:before, +.mec-single-event + .mec-events-meta-group-booking + input[type="checkbox"]:checked:before, +.mec-events-meta-group-booking + .mec-booking-shortcode + input[type="checkbox"]:checked:before, +.mec-single-event + .mec-events-meta-group-booking + .mec-booking-dates-checkboxes + input[type="checkbox"]:checked:before, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-booking-dates-checkboxes + input[type="checkbox"]:checked:before, +.lity-content + .mec-events-meta-group-booking + .mec-booking-dates-checkboxes + input[type="checkbox"]:checked:before, +.mec-booking input[type="checkbox"]:checked:before, +.mec-wrap + .mec-simple-checkboxes-search + ul + li + label + input[type="checkbox"]:checked:before { + transform: scale(1); +} + +.lity-content .mec-events-meta-group-booking label.wn-checkbox-label, +.mec-single-event .mec-events-meta-group-booking label.wn-checkbox-label, +.mec-events-meta-group-booking .mec-booking-shortcode label.wn-checkbox-label, +.lity-container .mec-events-meta-group-booking label.wn-checkbox-label { + display: none; +} + +.mec-single-event a.button:after, +.lity-content .mec-events-meta-group-booking button[type="submit"]:after, +.mec-single-event .mec-events-meta-group-booking button[type="submit"]:after, +.mec-events-meta-group-booking + .mec-booking-shortcode + button[type="submit"]:after, +.mec-wrap .mec-events-meta-group-booking button[type="submit"]:after { + display: none; + font-family: "simple-line-icons"; + content: "\e098"; + margin-left: 4px; + -webkit-animation: rotating 1.2s linear infinite; + -moz-animation: rotating 1.2s linear infinite; + -ms-animation: rotating 1.2s linear infinite; + -o-animation: rotating 1.2s linear infinite; + animation: rotating 1.2s linear infinite; +} + +.mec-single-event a.button.loading:after, +.lity-content + .mec-events-meta-group-booking + button[type="submit"].loading:after, +.mec-single-event + .mec-events-meta-group-booking + button[type="submit"].loading:after, +.mec-events-meta-group-booking + .mec-booking-shortcode + button[type="submit"].loading:after, +.mec-wrap .mec-events-meta-group-booking button[type="submit"].loading:after { + display: inline-block; +} + +.mec-single-event .mec-event-export-module { + display: block; +} + +.mec-single-event + .mec-event-export-module.mec-frontbox + .mec-event-exporting + .mec-export-details + ul { + display: table; + width: 100%; +} + +.mec-single-event + .mec-event-export-module.mec-frontbox + .mec-event-exporting + .mec-export-details + ul + li { + display: table-cell; +} + +.mec-single-event + .mec-event-export-module.mec-frontbox + .mec-event-exporting + .mec-export-details + ul + li:last-child { + text-align: right; +} + +.mec-single-event + .mec-event-export-module.mec-frontbox + .mec-event-exporting + .mec-export-details + ul + li + a:hover { + color: #fff; +} + +.mec-single-event + .mec-event-export-module.mec-frontbox + .mec-event-exporting + .mec-export-details + ul { + padding-left: 0; + margin: 15px 5px; +} + +.mec-single-event .mec-event-export-module.mec-frontbox .mec-event-exporting { + padding-left: 0; + margin: 0; +} + +.mec-ticket-price { + margin-left: 10px; + font-size: 13px; + font-weight: 300; +} + +.mec-book-reg-field-checkbox label, +.mec-book-reg-field-radio label { + line-height: 1.36; +} + +.mec-book-reg-field-checkbox input[type="checkbox"] { + float: left; + margin-right: 10px !important; +} + +.mec-book-reg-field-radio input[type="radio"] { + float: left; + margin-right: 12px !important; +} + +.mec-book-ticket-container .wbmec-mandatory, +.mec-book-ticket-container .mec-reg-mandatory:nth-child(2) label:after, +.mec-book-ticket-container .mec-reg-mandatory:nth-child(3) label:after { + content: ""; + color: red; + width: 50px; + height: 50px; + font-size: 14px; + padding-left: 5px; +} + +@media only screen and (max-width: 767px) { + .mec-single-event + .mec-event-export-module.mec-frontbox + .mec-event-exporting + .mec-export-details + ul + li { + width: 100%; + min-height: 40px; + margin-bottom: 15px; + text-align: center; + float: none; + display: block; + } + + .mec-single-event + .mec-event-export-module.mec-frontbox + .mec-event-exporting + .mec-export-details + ul + li + a { + width: 100%; + padding-left: 0; + padding-right: 0; + text-align: center; + display: block; + font-size: 12px; + } +} + +@media only screen and (max-width: 767px) { + .lity-content + .mec-events-meta-group-booking + .mec-single-event + .mec-events-meta-group-booking, + .mec-events-meta-group-booking .mec-booking-shortcode { + margin-bottom: 30px; + } +} + +.mec-single-modern .col-md-4 .mec-sponsors-details h3, +.mec-sponsors-details .mec-events-single-section-title, +.mec-single-event .mec-event-meta h3, +.mec-single-event .mec-event-meta dt { + text-transform: uppercase; + font-size: 16px; + font-weight: bold; + padding-bottom: 5px; + display: inline; + color: #000; + padding-left: 10px; +} + +.mec-single-event-sponsor span, +.mec-single-event .mec-event-meta h6 { + font-size: 14px; + padding-bottom: 5px; + display: inline-block; + color: #8d8d8d; + margin: 0; + padding: 0; +} + +.mec-single-event .mec-event-meta dd, +.mec-single-event .mec-event-meta .mec-events-event-categories a { + font-size: 14px; + color: #8d8d8d; +} + +.mec-single-event .mec-event-meta .mec-location dd.author { + color: #3c3b3b; +} + +.mec-single-event .mec-event-meta dd { + margin: 0; + padding-left: 35px; +} + +.mec-single-event .mec-event-meta dd.mec-events-event-categories { + min-height: 35px; + line-height: 35px; +} + +/* Fix booking modal */ +@media only screen and (max-width: 480px) { + .single-mec-events .lity-container { + width: 100%; + } + + .single-mec-events .lity-content .mec-events-meta-group-booking { + padding: 20px; + width: 85%; + margin: 0 auto; + } +} + +/*.mec-single-event .mec-event-meta dd.mec-events-event-categories:before { font-family: 'FontAwesome'; color: #40d9f1;font-size: 16px; content: "\f105"; padding: 10px; padding-left: 0; }*/ +.mec-single-event .mec-event-meta dd.mec-events-event-categories:first-of-type { + padding-top: 5px; +} + +.mec-single-event .mec-event-meta dd.mec-events-event-categories:last-of-type { + border-bottom: 0; +} + +.mec-single-event .mec-event-meta dd a { + color: #8d8d8d; + transition: all 0.2s ease; + -ms-word-wrap: break-word; + word-wrap: break-word; +} + +.mec-single-event .mec-event-meta dd a i:before { + font-size: 16px !important; +} + +.mec-single-event .mec-event-meta dd a i { + margin-right: 8px; +} + +.mec-single-event .mec-event-meta dl { + margin-bottom: 0; +} + +.mec-single-event .mec-event-meta .mec-events-event-cost { + font-size: 14px; + font-weight: 300; +} + +.mec-single-event .mec-event-meta .mec-events-address .mec-address, +.mec-single-event .mec-event-meta .mec-location-opening-hour span, +.mec-single-event .mec-event-meta .mec-location-url span { + font-size: 12px; + color: #a9a9a9; + display: block; +} + +.mec-single-event .mec-event-meta .mec-location-opening-hour, +.mec-single-event .mec-event-meta .mec-location-url, +.mec-single-event .mec-event-meta .mec-location-tel { + margin-top: 10px; +} + +.mec-single-event .mec-event-meta .mec-location-description { + margin-top: 15px; + padding: 0; +} + +.mec-single-event .mec-event-meta .mec-events-meta-group-venue .author { + margin-bottom: 0; + color: #8d8d8d; + font-size: 13px; +} + +.mec-single-event .mec-events-event-image { + margin-bottom: 0; +} + +.mec-single-event .mec-events-event-image img { + border-radius: 5px; + max-width: 100%; + height: auto; +} + +.mec-event-gallery-wrapper { + display: flex; + flex-direction: row; +} + +.mec-event-gallery-wrapper .mec-event-gallery-image-list-wrapper { + min-width: 90px; + margin-right: 30px; +} + +.mec-event-gallery-wrapper .mec-event-gallery-image-list-wrapper ul { + list-style: none; + padding: 0; +} + +.mec-event-gallery-wrapper .mec-event-gallery-image-list-wrapper ul li { + display: flex; + margin-bottom: 15px; + cursor: pointer; +} + +.mec-event-gallery-wrapper .mec-event-gallery-image-list-wrapper ul li img { + width: 90px; + border-radius: 5px; +} + +.mec-event-gallery-wrapper .mec-event-gallery-image img { + border-radius: 5px; +} + +@media (max-width: 960px) { + .mec-event-gallery-wrapper { + flex-direction: column-reverse; + } + + .mec-event-gallery-wrapper .mec-event-gallery-image { + margin-bottom: 10px; + } + + .mec-event-gallery-wrapper .mec-event-gallery-image-list-wrapper { + margin-right: 0; + } + + .mec-event-gallery-wrapper .mec-event-gallery-image-list-wrapper ul { + display: flex; + flex-flow: row wrap; + } + + .mec-event-gallery-wrapper .mec-event-gallery-image-list-wrapper ul li { + margin-bottom: 15px; + margin-right: 15px; + flex: 1 1 calc(15% - 20px); + } +} + +#mec-event-gallery ul#mec_meta_box_event_gallery { + display: flex; + flex-flow: row wrap; + list-style: none; + padding: 0; +} + +#mec-event-gallery ul#mec_meta_box_event_gallery li { + flex: 0 1 calc(33.333333% - 10px); + margin-right: 10px; + position: relative; +} + +#mec-event-gallery ul#mec_meta_box_event_gallery li img { + width: 100% !important; + height: 75px; + object-fit: cover; +} + +#mec-event-gallery + ul#mec_meta_box_event_gallery + li + span.mec-event-gallery-delete { + padding: 0; + min-height: 20px; + height: 20px; + width: 20px; + margin: 0; + border-radius: 50%; + position: absolute; + top: 2px; + right: 2px; + box-shadow: none; + background: #fff; + border-color: #e3e4e5; + font-size: 0px; + cursor: pointer; + transition: 0.2s; +} + +#mec-event-gallery + ul#mec_meta_box_event_gallery + li + span.mec-event-gallery-delete:before { + content: ""; + width: 20px; + height: 20px; + display: block; + background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgZm9jdXNhYmxlPSJmYWxzZSIgd2lkdGg9IjFlbSIgaGVpZ2h0PSIxZW0iIHN0eWxlPSItbXMtdHJhbnNmb3JtOiByb3RhdGUoMzYwZGVnKTsgLXdlYmtpdC10cmFuc2Zvcm06IHJvdGF0ZSgzNjBkZWcpOyB0cmFuc2Zvcm06IHJvdGF0ZSgzNjBkZWcpOyIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDIwIDIwIiBmaWxsPSIjZWE2NDg1Ij48cGF0aCBkPSJNMTQuOTUgNi40NkwxMS40MSAxMGwzLjU0IDMuNTRsLTEuNDEgMS40MUwxMCAxMS40MmwtMy41MyAzLjUzbC0xLjQyLTEuNDJMOC41OCAxMEw1LjA1IDYuNDdsMS40Mi0xLjQyTDEwIDguNThsMy41NC0zLjUzeiIvPjwvc3ZnPg=="); + background-position: center; +} + +#mec-event-gallery + ul#mec_meta_box_event_gallery + li + span.mec-event-gallery-delete:hover { + color: #fff; + border-color: #ea6485; + background: #ea6485; +} + +#mec-event-gallery + ul#mec_meta_box_event_gallery + li + span.mec-event-gallery-delete:hover:before { + background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgZm9jdXNhYmxlPSJmYWxzZSIgd2lkdGg9IjFlbSIgaGVpZ2h0PSIxZW0iIHN0eWxlPSItbXMtdHJhbnNmb3JtOiByb3RhdGUoMzYwZGVnKTsgLXdlYmtpdC10cmFuc2Zvcm06IHJvdGF0ZSgzNjBkZWcpOyB0cmFuc2Zvcm06IHJvdGF0ZSgzNjBkZWcpOyIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDIwIDIwIiBmaWxsPSIjZmZmZmZmIj48cGF0aCBkPSJNMTQuOTUgNi40NkwxMS40MSAxMGwzLjU0IDMuNTRsLTEuNDEgMS40MUwxMCAxMS40MmwtMy41MyAzLjUzbC0xLjQyLTEuNDJMOC41OCAxMEw1LjA1IDYuNDdsMS40Mi0xLjQyTDEwIDguNThsMy41NC0zLjUzeiIvPjwvc3ZnPg=="); +} + +.mec-single-event h2.mec-single-event-title { + margin-bottom: 30px; + font-weight: 700; + font-size: 33px; +} + +.mec-single-event .mec-booking-button { + border-bottom: none; + letter-spacing: 0.5px; + line-height: 48px; + height: 76px; + transition: all 0.5s ease; + color: #fff; + padding: 16px; + display: block; + text-align: center; + font-size: 16px; + border-radius: 2px; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15); +} + +.mec-single-event .mec-booking-button:hover { + background-color: #101010 !important; +} + +.mec-single-event .mec-event-tags a { + display: inline-block; + color: #444; + font-size: 11px; + text-transform: uppercase; + letter-spacing: 1.5px; + font-weight: 500; + padding: 3px 7px; + border: 1px solid #ddd; + border-radius: 2px; + background: #fff; + margin: 1px 3px; +} + +.mec-single-event .mec-event-tags:before { + font-size: 24px; + color: #303030; + margin-right: 5px; + content: "\f02c"; + font-family: fontawesome; +} + +.mec-single-event .mec-event-tags { + padding-top: 13px; +} + +.mec-single-event .mec-event-sharing { + margin: 30px 0 10px; +} + +.mec-single-event .mec-street-address, +.mec-region.mec-events-abbr { + font-style: normal; + font-size: 13px; +} + +.mec-single-event-date:before, +.mec-single-event-time:before, +.mec-events-meta-group.mec-events-meta-group-venue:before { + color: #40d9f1; +} + +.mec-single-event .mec-event-social { + text-align: center; +} + +.mec-single-event .mec-event-social h3 { + text-transform: uppercase; + font-size: 15px; + font-weight: bold; + padding-bottom: 5px; + color: #313131; + border-bottom: 4px solid #ebebeb; + width: 100%; + display: block; + padding-bottom: 10px; + position: relative; +} + +.mec-single-event .mec-social-single:before { + padding: 13px 35px; + border-bottom: 4px solid #40d9f1; + font-size: 6px; + content: ""; + text-align: center; + position: absolute; + bottom: -4px; + margin-left: 39px; +} + +.mec-single-event .mec-event-social .event-sharing { + margin-top: 30px; +} + +.mec-single-event .mec-event-social ul { + list-style: none; + margin-left: 0; + padding: 0; + display: flex; + align-items: center; + justify-content: center; + flex-wrap: wrap; +} + +.mec-single-event .mec-event-social li.mec-event-social-icon { + display: inline-block; +} + +.mec-single-event .mec-event-social li.mec-event-social-icon a { + display: inline-block; + color: #fff; + width: 40px; + height: 40px; + padding: 6px; + font-size: 18px; + margin-right: 5px; + margin-bottom: 5px; + border-radius: 2px; +} + +.mec-single-event .mec-event-social a.facebook { + background: #3b5996; +} + +.mec-single-event .mec-event-social a.facebook:hover { + background: #28385c; +} + +.mec-single-event .mec-event-social a.twitter svg { + width: 22px; + height: 22px; + margin-top: 0px; + padding: 0; +} + +.mec-single-event .mec-event-social a.twitter { + background: #e1e1e1; + padding: 9px !important; +} + +.mec-single-event .mec-event-social a.twitter:hover { + background: #e1e1e1; +} + +.mec-single-event .mec-event-social a.twitter:hover { + background: #373737; +} + +.mec-single-event .mec-event-social a.twitter:hover svg path { + fill: #fff; +} + +.mec-single-event .mec-event-social a.vimeo { + background: #0dadd6; +} + +.mec-single-event .mec-event-social a.vimeo:hover { + background: #0a85a3; +} + +.mec-single-event .mec-event-social a.dribble { + background: #d53e68; +} + +.mec-single-event .mec-event-social a.dribble:hover { + background: #bf4c78; +} + +.mec-single-event .mec-event-social a.youtube { + background: #cb322c; +} + +.mec-single-event .mec-event-social a.youtube:hover { + background: #992622; +} + +.mec-single-event .mec-event-social a.pinterest { + background: #cb2027; +} + +.mec-single-event .mec-event-social a.pinterest:hover { + background: #99181d; +} + +.mec-single-event .mec-event-social a.google { + background: #c3391c; +} + +.mec-single-event .mec-event-social a.google:hover { + background: #99181f; +} + +.mec-single-event .mec-event-social a.linkedin { + background: #0073b2; +} + +.mec-single-event .mec-event-social a.linkedin:hover { + background: #005380; +} + +.mec-single-event .mec-event-social a.email { + background: #ff5d5e; +} + +.mec-single-event .mec-event-social a.email:hover { + background: #cc4949; +} + +.mec-single-event .mec-event-social a.vk { + background: #5b88bd; +} + +.mec-single-event .mec-event-social a.vk:hover { + background: #3d608a; +} + +.mec-single-event .mec-event-social a.tumblr { + background: #34465d; +} + +.mec-single-event .mec-event-social a.tumblr:hover { + background: #273649; +} + +.mec-single-event .mec-event-social a.telegram { + background: #0088cc; +} + +.mec-single-event .mec-event-social a.telegram:hover { + background: rgb(16, 118, 190); +} + +.mec-single-event .mec-event-social a.whatsapp { + background: #25d366; +} + +.mec-single-event .mec-event-social a.whatsapp:hover { + background: #23ac55; +} + +.mec-single-event .mec-event-social a.flipboard { + background: #e12828; +} + +.mec-single-event .mec-event-social a.flipboard:hover { + background: #af1e1e; +} + +.mec-single-event .mec-event-social a.pocket { + background: #ef4056; +} + +.mec-single-event .mec-event-social a.pocket:hover { + background: #8d1717; +} + +.mec-single-event .mec-event-social a.reddit { + background: #ff5700; +} + +.mec-single-event .mec-event-social a.reddit:hover { + background: #c94909; +} + +.mec-single-event .mec-event-social a.telegram svg, +.mec-single-event .mec-event-social a.flipboard svg { + height: 18px; + margin-top: 5px; +} + +.mec-single-event .mec-event-social li.mec-event-social-icon a svg { + display: unset; +} + +.mec-single-event .mec-event-social a.rss { + background: #f29a1d; +} + +.mec-single-event .mec-event-social a.rss:hover { + background: #cc7400; +} + +.mec-single-event .mec-event-social a.instagram { + background: #457399; +} + +.mec-single-event .mec-event-social a.instagram:hover { + background: #2e4d66; +} + +.mec-single-event .mec-event-social a.linkedin { + background: #457399; +} + +.mec-single-event .mec-event-social a.linkedin:hover { + background: #2e4d66; +} + +.mec-single-event .mec-event-social a.other-social { + background: #ff5d5e; +} + +.mec-single-event .mec-event-social a.other-social:hover { + background: #cc4949; +} + +.mec-single-event .mec-event-social { + text-align: center; +} + +.lity-content .mec-events-meta-group-booking form, +.mec-single-event .mec-events-meta-group-booking form, +.mec-events-meta-group-booking .mec-booking-shortcode form, +.mec-events-meta-group-booking .mec-booking-shortcode .mec-wrap-checkout { + margin: 0; +} + +.mec-single-event .mec-frontbox-title, +.mec-single-event .mec-wrap-checkout h4, +.lity-content .mec-events-meta-group-booking .mec-wrap-checkout h4, +.mec-single-event .mec-events-meta-group-booking .mec-wrap-checkout h4, +.mec-events-meta-group-booking .mec-booking-shortcode .mec-wrap-checkout h4, +.lity-content .mec-events-meta-group-booking form > h4, +.mec-single-event .mec-events-meta-group-booking form > h4, +.mec-events-meta-group-booking .mec-booking-shortcode form > h4 { + text-transform: uppercase; + font-size: 15px; + font-weight: bold; + color: #313131; + border-bottom: 4px solid #ebebeb; + width: 100%; + display: block; + padding-bottom: 10px; + position: relative; + text-align: center; + margin: 0 0 40px 0; +} + +.mec-single-event .mec-frontbox-title:before, +.mec-single-event .mec-wrap-checkout h4:before, +.lity-content .mec-events-meta-group-booking .mec-wrap-checkout h4:before, +.mec-single-event .mec-events-meta-group-booking .mec-wrap-checkout h4:before, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-wrap-checkout + h4:before, +.lity-content .mec-events-meta-group-booking form > h4:before, +.mec-single-event .mec-events-meta-group-booking form > h4:before, +.mec-events-meta-group-booking .mec-booking-shortcode form > h4:before { + padding: 1px 35px; + border-bottom: 4px solid #40d9f1; + font-size: 6px; + content: ""; + text-align: center; + position: absolute; + bottom: -4px; + margin-left: -35px; + left: 50%; +} + +.lity-content .mec-events-meta-group-booking input[data-stripe="exp-month"], +.mec-single-event .mec-events-meta-group-booking input[data-stripe="exp-month"], +.mec-events-meta-group-booking + .mec-booking-shortcode + input[data-stripe="exp-month"], +.lity-content .mec-events-meta-group-booking input[data-stripe="exp-year"], +.mec-single-event .mec-events-meta-group-booking input[data-stripe="exp-year"], +.mec-events-meta-group-booking + .mec-booking-shortcode + input[data-stripe="exp-year"] { + width: 47% !important; + margin-right: 12px; + margin-top: 5px; + display: inline-block !important; +} + +@media (max-width: 768px) { + .mec-single-event + .mec-events-meta-group-booking + input[data-stripe="exp-month"], + .mec-events-meta-group-booking + .mec-booking-shortcode + input[data-stripe="exp-month"], + .mec-single-event + .mec-events-meta-group-booking + input[data-stripe="exp-year"], + .mec-events-meta-group-booking + .mec-booking-shortcode + input[data-stripe="exp-year"] { + width: 100% !important; + margin-right: 0; + display: block !important; + } +} + +/* Booking Checkboxes */ +.lity-content .mec-events-meta-group-booking .mec-booking-dates-checkboxes, +.mec-single-event .mec-events-meta-group-booking .mec-booking-dates-checkboxes, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-booking-dates-checkboxes { + margin-bottom: 22px; +} + +.mec-single-event + .mec-events-meta-group-booking + .mec-booking-dates-checkboxes + label, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-booking-dates-checkboxes + label, +.lity-content + .mec-events-meta-group-booking + .mec-booking-dates-checkboxes + label { + margin-bottom: 3px; + line-height: 20px; +} + +.lity-content + .mec-events-meta-group-booking + .mec-booking-dates-checkboxes + label { + display: flex; +} + +.lity-content + .mec-events-meta-group-booking + .mec-booking-dates-checkboxes + input[type="checkbox"] { + margin-top: -1px; +} + +.mec-events-meta-group-booking-shortcode .mec-booking-dates-checkboxes label { + display: flex; + align-items: center; +} + +.mec-events-meta-group-booking-shortcode + .mec-booking-dates-checkboxes + input[type="checkbox"] { + margin-top: 1px; +} + +.mec-event-meta i:before { + font-size: 20px !important; + vertical-align: middle; +} + +.mec-event-meta .mec-single-event-organizer dl dd i:before, +.mec-event-meta .mec-single-event-additional-organizers dl dd i:before, +.mec-event-meta .mec-single-event-location dl dd i:before { + font-size: 14px !important; +} + +#mec-wrap .mec-events-day-time-slot .mec-events-content { + float: left; + width: 33%; + padding: 0 15px; +} + +#mec-wrap .mec-events-day-time-slot .mec-events-event-image { + padding-left: 0; +} + +#mec-events-content .mec-events-abbr { + color: #8d8d8d; + font-size: 14px; +} + +.mec-single-event .mec-events-content { + margin-bottom: 30px; +} + +.mec-single-event .mec-organizer-url a { + word-wrap: break-word; +} + +.mec-single-event #headline { + margin: 0 0 10px; +} + +.mec-single-event #headline h2 { + padding: 0; +} + +.mec-single-event + .mec-events-meta-group.mec-events-meta-group-gmap + .mec-events-venue-map { + margin-top: 0; + padding: 8px; + border: 1px solid #e5e5e5; + border-radius: 7px; +} + +#mec-events-gmap-0 { + height: 325px !important; +} + +.mec-events-list .mec-events-day-time-slot .mec-events-event-meta { + width: 33%; + float: left; + padding: 40px; + height: auto; + margin: 0; +} + +.mec-events-day-time-slot .mec-events-content.description.entry-summary { + font-size: 15px; + font-weight: 300; + color: #8d8d8d; +} + +.mec-events-day-time-slot .type-mec_events h2 { + font-size: 28px; + padding-bottom: 20px; +} + +.mec-events-day .mec-events-day-time-slot .type-mec_events { + margin: 0; +} + +.mec-events-day .mec-events-day-time-slot h5 { + background-color: #8d8d8d; +} + +.mec-single-event + .mec-event-meta + .mec-single-event-organizer + .mec-events-single-section-title, +.mec-single-event + .mec-event-meta + .mec-single-event-additional-organizers + .mec-events-single-section-title, +.mec-single-event .mec-events-meta-date h3, +.mec-single-event + .mec-event-meta + .mec-single-event-location + .mec-events-single-section-title, +.mec-single-event + .mec-event-meta + .mec-single-event-additional-locations + .mec-events-single-section-title { + padding: 0 0 5px 10px; + margin-top: 0; + display: inline-block; +} + +.mec-events-single-section-title a span { + font-size: 12px; +} + +.mec-single-event-additional-locations .mec-single-event-location { + padding: 0; +} + +.mec-single-event .mec-events-meta-date h3 { + width: 100%; +} + +.mec-single-event .mec-events-event-image { + border: 0; +} + +.mec-single-event .mec-events-venue-map { + padding: 0; +} + +.mec-single-event-date, +.mec-single-event-time, +.mec-single-event-location, +.mec-single-event-additional-locations, +.mec-single-event-category, +.mec-single-event-sponsor, +.mec-single-event-label, +.mec-single-event-sponsor, +.mec-single-event-organizer, +.mec-single-event-additional-organizers, +.mec-events-meta-date, +.mec-event-cost, +.mec-event-website, +.mec-event-more-info, +.mec-local-time-details { + padding: 12px 14px 8px; + margin-bottom: 12px; + vertical-align: baseline; + position: relative; +} + +.mec-single-event-sponsor ul { + margin: 0; + padding: 0; + list-style: none; +} + +.mec-single-event-sponsor ul li { + margin-bottom: 35px; +} + +.mec-single-event-sponsor ul li:last-child { + margin-bottom: 0; +} + +.mec-wrap .mec-single-modern .col-md-4 .mec-sponsors-details h3, +.mec-wrap .mec-single-event-sponsor h3 { + padding: 0 0 20px 0; + margin: 0; + display: block; +} + +.mec-single-event .mec-single-event-organizer dd, +.mec-single-event .mec-single-event-additional-organizers dd, +.mec-single-event .mec-events-meta-date dd { + padding-left: 0; + margin-bottom: 10px; +} + +.mec-single-event .mec-single-event-location dd { + padding-left: 0; +} + +.mec-single-event .mec-single-event-location dd.author > a { + font-size: 16px; + font-weight: 300; +} + +.mec-single-event .mec-event-meta dd.mec-organizer-email a, +.mec-single-event .mec-single-event-organizer dd span, +.mec-single-event .mec-single-event-additional-organizers dd span, +.mec-single-event .mec-events-meta-date dd span, +.mec-single-event .mec-single-event-location dd span { + display: block; + padding-left: 0px; + color: #8d8d8d; +} + +.mec-single-event .mec-events-meta-date i, +.mec-single-event .mec-single-event-additional-organizers i, +.mec-single-event .mec-single-event-location dl dd i, +.mec-single-event .mec-single-event-organizer dl dd i { + margin-right: 10px; + margin-left: 12px; +} + +.mec-events-meta-group.mec-events-meta-group-venue dl { + margin-bottom: 0; +} + +address.mec-events-address { + line-height: 19px; + font-style: normal; + font-size: 12px; +} + +.mec-single-event .mec-event-content dt { + margin-top: 5px; +} + +.mec-single-event + .mec-single-event-additional-organizers + .mec-single-event-additional-organizer { + margin-bottom: 15px; + padding-bottom: 5px; +} + +.mec-single-event + .mec-single-event-additional-organizers + .mec-single-event-additional-organizer:last-child { + margin-bottom: 0; + padding-bottom: 0; +} + +.mec-event-category-color { + width: 9px; + height: 9px; + display: inline-block; + vertical-align: middle; + margin: 0 0 0 4px; + border-radius: 9px; +} + +/* Hourly Schedule */ +.mec-event-schedule-content { + border-left: 4px solid #f0f0f0; + padding-top: 10px; + margin-top: 30px; + margin-left: 25px; + margin-bottom: 20px; + color: #8a8a8a; +} + +.mec-event-schedule-content dl { + padding-left: 24px; + font-size: 12px; + position: relative; + margin-bottom: 35px; +} + +.mec-event-schedule-content dl:before { + content: ""; + display: block; + position: absolute; + left: 0; + top: 4px; + width: 20px; + height: 0; + border-top: 4px solid #f0f0f0; +} + +.mec-event-schedule-content dl dt { + margin: 0 0 10px; + line-height: 1.16; +} + +.mec-event-schedule-content dl dt.mec-schedule-title { + font-size: 13px; + color: #5a5a5a; + font-weight: 700; +} + +.mec-event-schedule-content dl dt.mec-schedule-description { + font-weight: 300; +} + +.mec-event-schedule-content .mec-schedule-speakers { + padding: 10px; +} + +.mec-wrap .mec-event-schedule-content h6 { + font-size: 13px; + color: #5a5a5a; + font-weight: 700; + display: inline-block; +} + +.mec-wrap .mec-event-schedule-content a { + font-weight: 400; + color: #5a5a5a; + transition: all 0.1s ease; +} + +/* Speaker Widget */ +.single-mec-events .mec-speakers-details ul { + padding: 0; + margin-left: 0; +} + +.mec-single-event .mec-speakers-details ul li { + list-style: none; + padding: 5px 5px 18px 5px; + margin-top: 14px; +} + +.mec-single-event .mec-speakers-details ul li a { + -webkit-transition: 0.2s all ease; + transition: 0.2s all ease; +} + +.mec-single-event .mec-speakers-details ul li .mec-speaker-avatar a img { + float: left; + border-radius: 50%; + transition: 0.2s all ease; + border: 2px solid transparent; + width: 68px; + height: 68px; + object-fit: cover; +} + +.mec-single-event .mec-speakers-details ul li .mec-speaker-avatar a:hover img { + border-color: #40d9f1; +} + +.mec-single-event .mec-speakers-details .speaker-details { + display: inline-block; +} + +.mec-single-event .mec-speakers-details ul li .mec-speaker-name { + display: inline-block; + margin-top: 10px; + font-size: 15px; + line-height: 1.8; + text-transform: capitalize; + font-weight: 700 !important; + padding-left: 8px; +} + +.mec-single-event .mec-speakers-details ul li .mec-speaker-job-title { + display: block; + font-size: 12px; + margin-top: -1px; + padding-left: 8px; + color: #888; +} + +/* Location */ +.mec-sponsor img, +.mec-single-event-location img, +.mec-single-event-organizer img, +.mec-single-event-additional-organizers img { + margin-bottom: 5px; + width: 100%; +} + +.mec-qrcode-details { + text-align: center; +} + +/* time */ +.mec-time-comment { + font-size: 11px; +} + +/* buddy */ +.mec-wrap .mec-attendees-list-details p { + font-weight: 300; + margin: 20px 0 0 0; + color: #8d8d8d; +} + +.mec-wrap .mec-attendees-list-details li { + list-style: none; + display: block; + margin-top: 15px; +} + +.mec-wrap .mec-attendees-list-details li .mec-attendee-avatar { + display: inline-block; +} + +.mec-wrap .mec-attendees-list-details li .mec-attendee-profile-link { + display: inline-block; + vertical-align: top; + margin-left: 10px; +} + +.mec-attendees-list-details ul { + margin-bottom: 0; +} + +.mec-attendees-list-details .mec-attendee-profile-link a { + color: #8d8d8d; + display: block; +} + +.mec-attendees-list-details .mec-attendee-profile-link span { + display: inline-block; + color: #000; + vertical-align: middle; + cursor: pointer; +} + +.mec-attendees-list-details span.mec-attendee-profile-ticket-number { + border-radius: 50px; + width: 20px; + height: 20px; + font-size: 12px; + text-align: center; + color: #fff; + margin-right: 4px; + line-height: 20px; +} + +#wrap .mec-attendees-list-details span.mec-attendee-profile-ticket-number { + line-height: 19px; +} + +.mec-attendees-list-details .mec-attendee-profile-link span i { + vertical-align: middle; + font-size: 9px; + font-weight: bold; + margin-left: 5px; +} + +.mec-attendees-list-details .mec-attendees-toggle { + border: 1px solid #e6e6e6; + background: #fafafa; + padding: 15px 15px 0; + border-radius: 3px; + margin: 12px 0 20px 52px; + position: relative; + font-size: 13px; + box-shadow: 0 3px 1px 0 rgba(0, 0, 0, 0.02); +} + +.mec-attendees-list-details .mec-attendees-toggle:before, +.mec-attendees-list-details .mec-attendees-toggle:after { + content: ""; + display: block; + position: absolute; + left: 50px; + width: 0; + height: 0; + border-style: solid; + border-width: 10px; +} + +.mec-attendees-list-details .mec-attendees-toggle:after { + top: -20px; + border-color: transparent transparent #fafafa transparent; +} + +.mec-attendees-list-details .mec-attendees-toggle:before { + top: -21px; + border-color: transparent transparent #e1e1e1 transparent; +} + +.mec-attendees-list-details .mec-attendees-toggle .mec-attendees-item { + padding-bottom: 15px; +} + +.mec-attendees-list-details .mec-attendee-avatar img { + border-radius: 3px; +} + +.mec-attendee-avatar-sec { + float: left; + width: 50px; + margin-right: 12px; +} + +.mec-attendee-profile-name-sec, +.mec-attendee-profile-ticket-sec { + float: left; + width: calc(100% - 62px); + margin-top: 3px; +} + +/* MEC Events Calendar Clean + ----------------------------------------- */ +.mec-calendar { + margin-bottom: 20px; + border: 1px solid #e8e8e8; + width: 100%; + box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.016); +} + +.mec-calendar .mec-calendar-topsec { + display: table; + background: #fff; +} + +.mec-calendar .mec-calendar-topsec .mec-calendar-side .mec-calendar-table { + border-top: 1px solid #eaeaea; +} + +.mec-calendar .mec-calendar-topsec .mec-calendar-events-sec { + display: none; +} + +.mec-calendar .mec-calendar-side { + width: 590px; + display: table-cell; + padding: 40px; + position: relative; + text-align: center; + box-shadow: 0 1px 5px 6px rgba(0, 0, 0, 0.005) inset; +} + +.mec-calendar .mec-calendar-events-side { + display: table-cell; + height: 100%; + border-left: 1px solid #efefef; + padding: 40px; + width: 100%; +} + +.mec-calendar .mec-calendar-events-side .mec-table-side-day { + width: 46px; + height: 46px; + margin: 0 auto 20px; + position: relative; + text-align: center; + line-height: 44px; + border: 1px solid #40d9f1; + border-radius: 50%; + font-size: 14px; + font-weight: 600; + padding: 0; +} + +.mec-calendar .mec-calendar-events-side .mec-table-side-title { + text-align: center; + font-size: 11px; + text-transform: uppercase; + letter-spacing: 3px; + margin-bottom: 14px; +} + +.mec-calendar .mec-calendar-header { + position: relative; + width: 560px; + margin-top: 8px; + margin-bottom: 16px; +} + +.mec-calendar.mec-event-calendar-classic .mec-calendar-header { + width: unset; +} + +.mec-calendar .mec-calendar-header h2 { + text-transform: uppercase; + font-size: 22px; + font-weight: 700; + color: #333; +} + +.mec-calendar .mec-event-footer { + width: auto; + min-height: 60px; +} + +.mec-calendar dl { + display: table; + margin: 0; + border: none; + padding: 0; + table-layout: fixed; +} + +.mec-calendar dt { + display: table-cell; + transition: all 0.66s ease; + color: #a4aab1; + background: #fff; + border-radius: 44px; + font-size: 14px; + width: 80px; + height: 80px; + line-height: 80px; + text-align: center; +} + +/* Fix MEC Calendars on the Neve theme */ +.excerpt-wrap .mec-wrap dt, +.nv-content-wrap .mec-wrap dt { + display: table-cell; +} + +.mec-calendar .mec-calendar-table .mec-no-event { + display: none; +} + +.mec-calendar .mec-calendar-table-head dt { + font-weight: 600; + text-transform: uppercase; + font-size: 15px; + color: #636f72; +} + +.mec-calendar .mec-calendar-row dt:hover { + background: #f4f4f4; +} + +.mec-calendar .mec-table-nullday { + color: #cacaca; +} + +.mec-calendar.mec-box-calendar .mec-table-nullday:last-child { + border-right: 1px solid #eaeaea; +} + +.mec-calendar .mec-prev-month:hover, +.mec-calendar .mec-next-month:hover { + background: #f4f4f4; +} + +.mec-calendar .mec-selected-day, +.mec-calendar .mec-selected-day:hover { + background: #40d9f1; + color: #fff; +} + +.mec-calendar .mec-selected-day a { + color: #fff; +} + +.mec-calendar .mec-has-event { + position: relative; +} + +.mec-calendar .mec-calendar-row dt.mec-has-event:hover { + background: #40d9f1; +} + +.mec-calendar .mec-has-event a { + cursor: pointer; + display: block; + width: 100%; + height: 100%; + border-radius: 50%; + color: #4d4d4d; + transition: all 0.25s ease; + text-decoration: none; + box-shadow: none; +} + +.mec-calendar .mec-calendar-row dt.mec-has-event:hover a, +.mec-calendar .mec-calendar-row dt.mec-has-event.mec-selected-day a { + color: #fff; +} + +.mec-calendar .mec-has-event:after { + background-color: #40d9f1; + border-radius: 50%; + display: block; + content: ""; + width: 8px; + height: 8px; + bottom: 10px; + left: calc(50% - 4px); + position: absolute; + transition: all 0.25s ease; +} + +.mec-calendar .mec-calendar-row dt.mec-has-event:hover:after { + background-color: #fff; +} + +.mec-calendar .mec-has-event.mec-selected-day:after { + display: none; +} + +.mec-calendar .mec-event-article { + display: flex; + text-align: left; + margin-bottom: 0; + padding-bottom: 25px; + padding-top: 26px; + border-top: 1px solid #efefef; + transition: all 0.33s ease; +} + +@media only screen and (max-width: 479px) { + .mec-calendar.mec-calendar-weekly .mec-event-article, + .mec-calendar.mec-calendar-daily .mec-event-artile { + flex-direction: column; + gap: 15px; + } +} + +.mec-weekly-contents-wrapper, +.mec-daily-contents-wrapper { + display: flex; +} + +.mec-calendar .mec-month-side .mec-event-article { + padding-left: 5px; + padding-right: 5px; +} + +.mec-calendar .mec-event-article:hover { + background-color: #fafafa; +} + +.mec-calendar .mec-event-article .mec-event-time { + font-size: 11px; + line-height: 1.1; + margin: 0; +} + +.mec-calendar .mec-event-article .mec-event-title { + font-size: 13px; + padding: 0; + margin: 10px 0 8px; + font-weight: 700; + text-transform: uppercase; +} + +.mec-calendar .mec-event-article .mec-event-title a { + text-decoration: none; + color: #494949; + transition: color 0.3s ease; +} + +.mec-calendar .mec-event-article .mec-event-title a:hover { + color: #40d9f1; +} + +.mec-calendar .mec-event-list-classic .mec-event-image img { + width: 65px; + height: auto; +} + +.mec-calendar .mec-event-article .mec-event-image { + max-width: 70px; + margin-right: 15px; + height: auto; +} + +.mec-calendar .mec-event-article .mec-localtime-details div, +.mec-calendar .mec-event-article .mec-event-detail, +.mec-calendar .mec-event-article .mec-categories-wrapper, +.mec-calendar + .mec-event-article + .mec-categories-wrapper + ul.mec-categories + li.mec-category + a, +.mec-calendar .mec-event-article .mec-shortcode-organizers, +.mec-calendar + .mec-event-article + .mec-shortcode-organizers + .mec-organizer-item + span { + font-size: 13px; + line-height: 1.3; + color: #9a9a9a; + margin-bottom: 0; +} + +.mec-calendar .mec-calendar-side .mec-previous-month, +.mec-calendar .mec-calendar-side .mec-next-month { + cursor: pointer; + position: absolute; + top: 0; + min-width: 50px; + height: 50px; + line-height: 50px; + text-align: center; + background: #fff; + color: #a9a9a9; + font-size: 12px; + letter-spacing: 1px; + text-transform: uppercase; + padding-left: 10px; + padding-right: 10px; + border: 1px solid #efefef; + border-top: none; + box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.015); + transition: all 0.33s ease; +} + +.mec-calendar .mec-calendar-side .mec-previous-month i, +.mec-calendar .mec-calendar-side .mec-next-month i { + font-size: 12px; + color: #40d9f1; + cursor: pointer; +} + +.mec-calendar .mec-calendar-side .mec-previous-month:hover, +.mec-calendar .mec-calendar-side .mec-next-month:hover { + background-color: #f9f9f9; + color: #40d9f1; +} + +.mec-calendar .mec-calendar-side .mec-previous-month { + left: 0; + border-bottom-right-radius: 6px; + border-left: none; +} + +.mec-calendar .mec-calendar-side .mec-next-month { + right: 0; + border-bottom-left-radius: 6px; + border-right: none; +} + +/* Page with sidebar fix */ +@media only screen and (min-width: 961px) { + .mec-wrap.mec-sm959 + .mec-calendar:not(.mec-event-calendar-classic):not(.mec-calendar-weekly) + .mec-has-event:after { + width: 6px; + height: 6px; + bottom: 6px; + } + + .mec-wrap.mec-sm959 + .mec-calendar:not(.mec-event-calendar-classic):not(.mec-calendar-weekly) + .mec-calendar-side { + width: 370px; + } + + .mec-wrap.mec-sm959 + .mec-calendar:not(.mec-event-calendar-classic):not(.mec-calendar-weekly) + .mec-calendar-header { + position: relative; + width: 350px; + margin-top: 30px; + margin-bottom: 20px; + padding-top: 20px; + } + + .mec-wrap.mec-sm959 + .mec-calendar:not(.mec-event-calendar-classic):not(.mec-calendar-weekly) + dt { + width: 50px; + height: 50px; + line-height: 50px; + } +} + +@media only screen and (max-width: 1200px) { + .mec-calendar .mec-has-event:after { + width: 6px; + height: 6px; + bottom: 6px; + } + + .mec-calendar .mec-calendar-side { + width: 370px; + } + + .mec-calendar .mec-calendar-header { + position: relative; + width: 350px; + margin-top: 30px; + } + + .mec-calendar dt { + width: 50px; + height: 50px; + line-height: 50px; + } +} + +@media only screen and (max-width: 767px) { + .mec-calendar .mec-calendar-header h2 { + font-size: 18px; + } + + .mec-calendar .mec-calendar-topsec { + width: 100%; + } + + .mec-calendar .mec-calendar-side { + width: 100%; + display: block; + padding: 30px; + } + + .mec-calendar .mec-calendar-header { + width: auto; + } + + .mec-calendar .mec-calendar-events-side { + width: 100%; + display: block; + height: 100%; + border-left: none; + border-top: 1px solid #efefef; + padding: 20px; + } + + .mec-calendar dl { + width: 100%; + } + + .mec-calendar dt { + width: 14%; + height: 60px; + line-height: 60px; + border-radius: 50px; + } +} + +@media only screen and (max-width: 479px) { + .mec-calendar .mec-has-event:after { + width: 4px; + height: 4px; + } + + .mec-calendar .mec-calendar-header h2 { + font-size: 16px; + margin-top: 33px; + } + + .mec-calendar dt { + height: 38px; + line-height: 38px; + } + + .mec-calendar .mec-event-list-classic .mec-event-title, + .mec-calendar .mec-event-list-classic .mec-event-detail { + font-size: 12px; + } + + .mec-calendar .mec-event-list-classic .mec-event-time { + font-size: 10px; + } +} + +/* MEC Events Calendar Modern + --------------------------------------------- */ +.mec-box-calendar.mec-calendar .mec-has-event a, +.mec-box-calendar.mec-calendar dt { + border-radius: 0; +} + +.mec-box-calendar.mec-calendar .mec-calendar-header { + margin-top: 2px; + margin-bottom: 30px; +} + +.mec-box-calendar.mec-calendar dt { + border-bottom: 1px solid #eaeaea; + border-left: 1px solid #eaeaea; +} + +.mec-box-calendar.mec-calendar dl dt:last-child { + border-right: 1px solid #eaeaea; +} + +.mec-box-calendar.mec-calendar .mec-calendar-side .mec-previous-month, +.mec-box-calendar.mec-calendar .mec-calendar-side .mec-next-month { + border-radius: 2px; + top: 40px; + border: 1px solid #eee; + height: 30px; + line-height: 30px; + z-index: 1; +} + +.mec-box-calendar.mec-calendar .mec-calendar-side .mec-previous-month { + left: 40px; +} + +.mec-box-calendar.mec-calendar .mec-calendar-side .mec-next-month { + right: 40px; +} + +.mec-box-calendar.mec-calendar .mec-calendar-side { + box-shadow: none; +} + +.mec-box-calendar.mec-calendar .mec-calendar-events-side { + border: none; +} + +.mec-box-calendar.mec-calendar .mec-calendar-events-side .mec-table-side-day { + border-radius: 2px; +} + +.mec-box-calendar.mec-calendar h4.mec-month-label { + position: relative; + width: 560px; + margin-top: 2px; + margin-bottom: 30px; + text-transform: uppercase; + font-size: 22px; + font-weight: 700; + color: #333; +} + +.mec-widget .mec-box-calendar.mec-calendar h4.mec-month-label { + width: 100%; + margin-top: 8px; + font-size: 13px; +} + +@media only screen and (max-width: 1200px) { + .mec-box-calendar.mec-calendar .mec-calendar-side .mec-previous-month { + left: 42px; + } + + .mec-box-calendar.mec-calendar .mec-calendar-side .mec-next-month { + right: 42px; + } + + .mec-calendar .mec-calendar-header h2 { + font-size: 17px; + margin-top: 7px; + } +} + +@media only screen and (max-width: 767px) { + .mec-box-calendar.mec-calendar .mec-calendar-side .mec-previous-month, + .mec-box-calendar.mec-calendar .mec-calendar-side .mec-next-month { + top: 28px; + font-size: 10px; + } + + .mec-box-calendar.mec-calendar .mec-calendar-side .mec-previous-month { + left: 30px; + } + + .mec-box-calendar.mec-calendar .mec-calendar-side .mec-next-month { + right: 30px; + } + + .mec-calendar .mec-calendar-header h2 { + font-size: 15px; + } +} + +@media only screen and (max-width: 479px) { + .mec-box-calendar.mec-calendar .mec-calendar-side .mec-previous-month, + .mec-box-calendar.mec-calendar .mec-calendar-side .mec-next-month { + font-size: 0; + padding: 4px 8px; + text-align: center; + min-width: 33px; + } + + .mec-box-calendar.mec-calendar .mec-calendar-side .mec-previous-month { + left: 10px; + } + + .mec-box-calendar.mec-calendar .mec-calendar-side .mec-next-month { + right: 10px; + } +} + +/* MEC Events Calendar Classic + ------------------------------------------------ */ +.mec-calendar.mec-event-calendar-classic, +.mec-calendar.mec-event-calendar-classic .mec-calendar-side { + border: none; + padding: 0; + width: 100%; + height: 100%; + box-shadow: none; +} + +.mec-calendar.mec-event-calendar-classic .mec-calendar-side { + display: block; +} + +.mec-calendar.mec-event-calendar-classic dl.mec-calendar-table-head, +.mec-calendar.mec-event-calendar-classic dl.mec-calendar-row { + width: 100%; +} + +.mec-calendar.mec-event-calendar-classic dl.mec-calendar-table-head { + background: #f5f6f7; +} + +.mec-calendar.mec-event-calendar-classic + dl.mec-calendar-table-head + .mec-calendar-day-head { + background: transparent; + height: unset; + line-height: 36px; + border-top-width: 1px; + border-top-style: solid; + border-top-color: #eaeaea; +} + +.mec-calendar.mec-event-calendar-classic dl dt { + width: 15%; + height: 136px; + line-height: 1.2; + text-align: left; + padding: 5px 7px; + position: relative; +} + +.mec-box-calendar.mec-calendar.mec-event-calendar-classic + .mec-calendar-side + .mec-previous-month, +.mec-box-calendar.mec-calendar.mec-event-calendar-classic + .mec-calendar-side + .mec-next-month { + top: 0; +} + +.mec-calendar.mec-event-calendar-classic .mec-has-event:after { + bottom: auto; + top: 24px; + left: 7px; + margin: 0; +} + +.mec-box-calendar.mec-calendar.mec-event-calendar-classic + .mec-calendar-side + .mec-previous-month { + left: 0; +} + +.mec-box-calendar.mec-calendar.mec-event-calendar-classic + .mec-calendar-side + .mec-next-month { + right: 0; +} + +/* Shortcode next previous link disable for accessibility*/ +.mec-next-month a, +.mec-previous-month a { + pointer-events: none; + line-height: 15px; +} + +.mec-calendar.mec-event-calendar-classic .mec-calendar-events-sec { + text-align: left; + background: #fafafa; + border: 1px solid #eaeaea; + border-top: none; + padding: 10px 20px; +} + +.mec-calendar.mec-event-calendar-classic .mec-calendar-events-sec { + display: none; +} + +.mec-calendar.mec-event-calendar-classic + .mec-calendar-events-sec + .mec-event-article:hover { + background-color: #fcfcfc; +} + +.mec-calendar.mec-event-calendar-classic .mec-selected-day, +.mec-calendar.mec-event-calendar-classic dt.mec-selected-day:hover { + color: #40d9f1; + font-weight: 700; + background: #fafafa; + border-bottom: none; +} + +.mec-wrap + .mec-calendar.mec-event-calendar-classic:not(.mec-event-container-simple) + .mec-selected-day:hover { + color: #fff !important; +} + +.mec-calendar.mec-event-calendar-classic + .mec-calendar-events-sec + .mec-table-side-title, +.mec-calendar.mec-event-calendar-classic + .mec-calendar-events-sec + .mec-table-side-day { + display: inline-block; + margin: 0; + margin-bottom: 15px; + font-weight: 700; +} + +.mec-calendar.mec-event-calendar-classic + .mec-calendar-events-sec + .mec-table-side-day { + margin-left: 4px; +} + +.mec-calendar.mec-event-calendar-classic .mec-calendar-row dt.mec-has-event a { + color: #4d4d4d; +} + +.mec-calendar.mec-event-calendar-classic + .mec-calendar-row + dt.mec-has-event:not(.mec-selected-day):hover + a { + color: #fff; +} + +@media only screen and (max-width: 1200px) { + .mec-calendar.mec-event-calendar-classic dl dt { + height: 100px; + } +} + +@media only screen and (max-width: 767px) { + .mec-calendar.mec-event-calendar-classic dl dt { + height: 40px; + } +} + +@media only screen and (max-width: 479px) { + .mec-calendar.mec-event-calendar-classic .mec-calendar-events-sec { + padding: 10px; + } +} + +/* Monthly Calendar/Novel + ------------------------------------------------ */ +.mec-calendar .mec-event-article.mec-single-event-novel { + padding: 4px 8px; + min-height: 25px; + margin: 0 -3px; + border-radius: 0; + display: block; +} + +.mec-calendar .mec-event-article.mec-single-event-novel h4 { + margin: 0; + font-size: 13px; + line-height: 1.5; + font-weight: 500; + text-transform: capitalize; + margin: 0 0 2px 0; +} + +.mec-calendar + .mec-event-article.mec-single-event-novel + .mec-shortcode-organizers + i, +.mec-calendar + .mec-event-article.mec-single-event-novel + .mec-shortcode-organizers + ul + li + span { + color: #000; +} + +.mec-calendar.mec-event-container-novel dl dt { + padding: 3px; +} + +.mec-calendar.mec-event-calendar-classic .mec-calendar-novel-selected-day { + display: inline-block; + padding: 4px; + margin-left: 1px; +} + +.mec-wrap .mec-calendar.mec-event-container-novel .mec-selected-day:hover { + color: #fff !important; +} + +.mec-calendar.mec-event-calendar-classic + .mec-selected-day + .mec-calendar-novel-selected-day { + color: #fff; +} + +.mec-calendar.mec-event-calendar-classic.mec-event-container-novel + .mec-selected-day, +.mec-calendar.mec-event-calendar-classic.mec-event-container-novel + dt.mec-selected-day:hover { + border-bottom: 1px solid #eaeaea; +} + +.mec-calendar.mec-event-calendar-classic.mec-event-container-novel + .mec-calendar-side + .mec-calendar-table { + min-height: auto; +} + +.mec-single-event-novel.light h4 { + color: #000 !important; +} + +.mec-single-event-novel.dark h4 { + color: #fff !important; +} + +@media only screen and (max-width: 768px) { + .mec-calendar .mec-event-article.mec-single-event-novel { + padding: 2px; + min-height: 5px; + } + + .mec-calendar .mec-event-article.mec-single-event-novel h4 { + display: block; + font-size: 13px; + } +} + +@media only screen and (max-width: 480px) { + .mec-calendar .mec-event-article.mec-single-event-novel h4 { + font-size: 11px; + } +} + +/* Monthly Calendar/Simple + ------------------------------------------------ */ +.mec-event-container-simple .event-single-content-simple { + display: none; +} + +.mec-event-calendar-classic.mec-event-container-simple + .mec-calendar-side + .mec-calendar-table { + min-height: unset; +} + +.mec-event-container-simple .mec-monthly-tooltip h4 { + font-size: 13px; + font-weight: 500; + margin: 0; + color: #444; +} + +.mec-event-container-simple .mec-monthly-tooltip h4:hover { + text-decoration: underline; + color: #111; +} + +.mec-event-container-simple .mec-monthly-tooltip.event-single-link-simple { + border-bottom: 1px dashed #e3e3e3; + padding: 5px 2px; + display: block; +} + +.mec-event-container-simple + .simple-skin-ended:nth-last-of-type(2) + .mec-monthly-tooltip.event-single-link-simple { + border-bottom: none; +} + +.mec-event-container-simple + .mec-calendar-day + .ended-relative:nth-last-child(1 of .ended-relative) + .mec-monthly-tooltip.event-single-link-simple { + border: none; +} + +.mec-calendar.mec-event-container-simple dl dt.mec-calendar-day { + font-size: 30px; + color: #000; +} + +.mec-calendar.mec-event-container-simple .mec-calendar-row dt:hover { + background: unset; +} + +.mec-calendar.mec-event-container-simple .mec-calendar-row dt, +.mec-calendar.mec-event-container-simple .mec-calendar-row dt:last-child, +.mec-calendar.mec-event-container-simple .mec-calendar-table-head dt, +.mec-calendar.mec-event-container-simple + .mec-calendar-table-head + dt:last-child { + border-width: 2px; +} + +.mec-calendar.mec-event-container-simple dl dt.mec-selected-day, +.mec-calendar.mec-event-container-simple dl dt.mec-selected-day:hover { + border-bottom: 2px solid #40d9f1; + background: unset; +} + +.mec-calendar.mec-event-container-simple .mec-calendar-table-head dt { + border-top-width: 2px !important; +} + +@media (max-width: 768px) { + .mec-calendar.mec-event-container-simple, + .mec-calendar.mec-event-container-novel { + overflow-x: scroll; + } + + .mec-calendar.mec-event-container-simple .mec-calendar-side, + .mec-calendar.mec-event-container-novel .mec-calendar-side { + min-width: 100%; + } + + .mec-event-container-simple .mec-calendar-side, + .mec-event-container-novel .mec-calendar-side { + min-width: 650px !important; + } +} + +.mec-wrap.colorskin-custom + .mec-calendar.mec-event-container-simple + .mec-selected-day:hover { + background: #f4f4f4; +} + +.mec-tooltip-event-title { + font-size: 16px; + font-weight: bold; + color: #000; + margin-bottom: 2px; +} + +.tooltipster-sidetip.tooltipster-shadow:not(.uael-tooltipster-active) + .tooltipster-content + .mec-price-details, +.mec-tooltip-event-time { + font-size: 12px; + color: #888; + margin-bottom: 8px; + margin-top: 5px; +} + +.tooltipster-sidetip.tooltipster-shadow:not(.uael-tooltipster-active) + .tooltipster-content { + padding: 17px; +} + +.mec-tooltip-event-content { + clear: both; +} + +.mec-tooltip-event-featured { + float: left; + margin-right: 13px; + margin-bottom: 1px; +} + +.mec-tooltip-event-featured img { + max-width: 120px; +} + +.mec-tooltip-event-desc { + font-size: 14px; + color: #444; + line-height: 18px; +} + +.mec-tooltip-event-desc p { + font-size: 13px; + line-height: 1.4; + margin-bottom: 10px; +} + +.tooltipster-sidetip.tooltipster-shadow:not(.uael-tooltipster-active) + .tooltipster-box { + border-radius: 3px !important; + border: 1px solid #e2e3e4 !important; + background: #fff !important; + box-shadow: 0 -1px 30px -2px rgba(0, 0, 0, 0.15) !important; +} + +.tooltipster-box .mec-tooltip-event-desc { + margin-bottom: 12px; +} + +.tooltipster-sidetip:not(.uael-tooltipster-active) .tooltipster-arrow { + overflow: visible !important; +} + +.tooltipster-sidetip.tooltipster-shadow:not(.uael-tooltipster-active) + .tooltipster-arrow-border { + border-width: 12px !important; +} + +.tooltipster-sidetip.tooltipster-shadow.tooltipster-right:not( + .uael-tooltipster-active + ) + .tooltipster-arrow-border { + border-right-color: #e2e3e4 !important; +} + +.tooltipster-sidetip:not(.uael-tooltipster-active) .tooltipster-arrow-border { + left: -12px !important; + z-index: 9999999999 !important; +} + +.tooltipster-sidetip.tooltipster-shadow:not(.uael-tooltipster-active) + .tooltipster-arrow-background { + display: block !important; +} + +.tooltipster-sidetip:not(.uael-tooltipster-active) + .tooltipster-arrow-background { + border-width: 11px !important; + z-index: 99999999999 !important; +} + +.tooltipster-sidetip.tooltipster-right:not(.uael-tooltipster-active) + .tooltipster-arrow-background { + left: -9px !important; + top: 1px !important; + border-right-color: #ffffff !important; +} + +.tooltipster-sidetip.tooltipster-top:not(.uael-tooltipster-active) + .tooltipster-arrow-background { + border-top-color: #ffffff !important; + left: 0 !important; + top: -1px !important; +} + +.tooltipster-sidetip.tooltipster-top:not(.uael-tooltipster-active) + .tooltipster-arrow-border { + left: -1px !important; +} + +.tooltipster-sidetip.tooltipster-shadow.tooltipster-top:not( + .uael-tooltipster-active + ) + .tooltipster-arrow-border { + border-top-color: #e2e3e4 !important; +} + +.tooltipster-sidetip.tooltipster-shadow.tooltipster-bottom:not( + .uael-tooltipster-active + ) + .tooltipster-arrow-border { + left: -1px !important; + top: -11px !important; +} + +.tooltipster-sidetip.tooltipster-shadow.tooltipster-bottom:not( + .uael-tooltipster-active + ) + .tooltipster-arrow-border { + border-bottom-color: #e2e3e4 !important; +} + +.tooltipster-sidetip.tooltipster-bottom:not(.uael-tooltipster-active) + .tooltipster-arrow-background { + top: -9px !important; + border-bottom-color: #ffffff !important; +} + +.tooltipster-sidetip.tooltipster-left:not(.uael-tooltipster-active) + .tooltipster-arrow-background { + border-left-color: #ffffff !important; + left: -2px !important; + top: 0 !important; +} + +.tooltipster-sidetip.tooltipster-shadow.tooltipster-left:not( + .uael-tooltipster-active + ) + .tooltipster-arrow-border { + border-left-color: #e2e3e4 !important; + left: -1px !important; + top: -1px !important; +} + +@media (max-width: 768px) { + .mec-event-container-simple .mec-monthly-tooltip.event-single-link-simple h4 { + font-size: 13px; + } +} + +@media (max-width: 480px) { + .mec-event-container-simple .mec-monthly-tooltip.event-single-link-simple h4 { + font-size: 11px; + } +} + +/* MEC Events - Calendar Daily + -------------------------------- */ +.mec-calendar.mec-calendar-daily .mec-calendar-day-events .mec-event-article { + padding-left: 15px; + padding-right: 15px; + position: relative; +} + +.mec-calendar.mec-calendar-daily .mec-calendar-a-month { + text-align: center; + background-color: #fff; + border-bottom: 2px solid #f4f4f4; + position: relative; +} + +.mec-calendar.mec-calendar-daily .mec-calendar-a-month h4 { + color: #444; + font-size: 18px; + line-height: 1.2; + padding: 15px 0 11px; + margin: 0; + font-weight: 700; + letter-spacing: 1px; + text-transform: uppercase; + border-bottom: 1px solid #e6e6e6; +} + +.mec-calendar.mec-calendar-daily .mec-calendar-d-top { + text-align: center; + padding: 10px 0; + position: relative; + background-color: #fafafa; +} + +.mec-calendar.mec-calendar-daily .mec-previous-month, +.mec-calendar.mec-calendar-daily .mec-next-month { + position: absolute; + top: 50%; + left: 50%; + margin-top: -25px; + min-width: 50px; + height: 50px; + line-height: 50px; + text-align: center; + background: #fff; + border: 1px solid #e2e2e2; + border-radius: 50px; + box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.015); + transition: all 0.33s ease; + cursor: pointer; +} + +.mec-calendar.mec-calendar-daily .mec-previous-month i, +.mec-calendar.mec-calendar-daily .mec-next-month i { + font-size: 14px; + cursor: pointer; +} + +.mec-calendar.mec-calendar-daily .mec-previous-month:hover, +.mec-calendar.mec-calendar-daily .mec-next-month:hover { + border-color: #d0d0d0; + color: #444; + box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.075); +} + +.mec-calendar.mec-calendar-daily .mec-previous-month { + margin-left: -150px; +} + +.mec-calendar.mec-calendar-daily .mec-next-month { + margin-left: 100px; +} + +.mec-calendar.mec-calendar-daily .mec-calendar-a-month .mec-previous-month, +.mec-calendar.mec-calendar-daily .mec-calendar-a-month .mec-next-month { + min-height: 28px; + height: 28px; + line-height: 28px; + width: 28px; + margin-top: -14px; + border-radius: 3px; +} + +.mec-calendar.mec-calendar-daily .mec-calendar-d-top h2, +.mec-calendar.mec-calendar-daily .mec-calendar-d-top h3 { + margin-top: 9px; + color: #b9b9b9; + font-size: 30px; + font-weight: 100; + text-transform: uppercase; + margin-bottom: 12px; + line-height: 1; +} + +.mec-calendar.mec-calendar-daily .mec-calendar-d-top h2 { + font-size: 81px; + color: #444; + margin-bottom: 10px; + line-height: 1.1; +} + +.mec-calendar.mec-calendar-daily .mec-calendar-d-table { + overflow: hidden; + background: #fff; + min-height: 60px; + border-top: 1px solid #e6e6e6; + border-bottom: 2px solid #f3f3f3; + padding: 0 50px; + position: relative; +} + +@media only screen and (min-width: 479px) { + .mec-calendar.mec-calendar-daily .mec-calendar-d-table { + padding: 0 55px; + } +} + +.mec-calendar.mec-calendar-daily .mec-calendar-d-table dl { + width: 1310px; + display: block; +} + +.mec-calendar.mec-calendar-weekly .mec-calendar-d-table dl { + display: none; +} + +.mec-calendar.mec-calendar-weekly + .mec-calendar-d-table + dl.mec-weekly-view-week-active { + display: flex; +} + +.mec-calendar.mec-calendar-daily .mec-calendar-d-table dl dt, +.mec-calendar.mec-calendar-daily .mec-calendar-d-table a { + display: block; + background: #fff; + width: 42px; + height: 60px; + line-height: 60px; + text-align: center; + float: left; + border-right: 1px solid #e6e6e6; + border-bottom: 1px solid #e6e6e6; + border-radius: 0; +} + +.mec-calendar.mec-calendar-daily .mec-calendar-d-table dl dt:hover, +.mec-calendar.mec-calendar-daily + .mec-calendar-d-table + .mec-daily-view-day:hover { + background: #fafafa; + box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.065) inset; + cursor: pointer; +} + +.mec-calendar.mec-calendar-daily .mec-calendar-d-table .mec-daily-view-day { + cursor: default; + background: #fff; + color: #c1c1c1; + line-height: 59px; + text-align: center; + border-right: 1px solid #e6e6e6; + border-bottom: 1px solid #e6e6e6; +} + +.mec-calendar.mec-calendar-daily + .mec-calendar-d-table + .mec-daily-view-day.mec-has-event { + cursor: pointer; + font-weight: 700; + color: #4a4a4a; +} + +.mec-calendar.mec-calendar-daily + .mec-calendar-d-table + dl + dt.mec-table-d-current, +.mec-calendar.mec-calendar-daily + .mec-calendar-d-table + .mec-daily-view-day.mec-daily-view-day-active { + font-weight: 700; + background: #fafafa; + color: #40d9f1; +} + +.mec-calendar.mec-calendar-daily .mec-calendar-d-table a.mec-table-d-prev, +.mec-calendar.mec-calendar-daily .mec-calendar-d-table a.mec-table-d-next { + float: none; + font-size: 14px; + width: 55px; + position: absolute; + top: 0; + left: 0; + cursor: pointer; +} + +.mec-calendar.mec-calendar-daily .mec-calendar-d-table a.mec-table-d-next { + left: auto; + right: 0; + border-left: 1px solid #e6e6e6; + border-right: none; +} + +.mec-calendar.mec-calendar-daily .mec-today-container .mec-today-count { + font-size: 12px; + color: #888; + text-align: center; +} + +@media only screen and (max-width: 479px) { + .mec-calendar.mec-calendar-daily .mec-previous-month { + margin-left: -130px; + } + + .mec-calendar.mec-calendar-daily .mec-next-month { + margin-left: 80px; + } + + .mec-calendar.mec-calendar-daily .mec-calendar-a-month h4 { + font-size: 14px; + letter-spacing: 0; + } +} + +.widget .mec-calendar.mec-calendar-daily .mec-calendar-a-month h4 { + font-size: 14px; + letter-spacing: 0; +} + +.widget .mec-calendar.mec-calendar-daily .mec-previous-month { + margin-left: -130px; +} + +.widget .mec-calendar.mec-calendar-daily .mec-next-month { + margin-left: 80px; +} + +.mec-util-hidden { + display: none; +} + +.mec-frontbox.mec-util-hidden { + display: none !important; +} + +.mec-daily-view-dates-events { + padding: 0; + background-color: #fff; +} + +.mec-daily-view-date-events, +.mec-weekly-view-date-events { + list-style: none; + margin: 0; +} + +/* MEC Events - Calendar Weekly + -------------------------------- */ +.mec-calendar.mec-calendar-weekly .mec-calendar-d-table { + padding: 0; +} + +.mec-calendar.mec-calendar-weekly .mec-calendar-d-table dl { + width: calc(100% - 1px); +} + +.mec-calendar.mec-calendar-weekly .mec-calendar-d-table dl dt { + width: 100%; + height: 70px; + line-height: normal; + cursor: default; +} + +.mec-calendar.mec-calendar-weekly .mec-calendar-d-table dl dt:hover { + background: #fff; + cursor: default; +} + +.mec-calendar-weekly article:hover li { + background: transparent; +} + +.mec-calendar.mec-calendar-weekly .mec-calendar-d-table dl dt:last-child { + border-right: none; +} + +.mec-calendar.mec-calendar-weekly .mec-calendar-d-table dl dt span { + font-size: 12px; + font-weight: 700; + text-transform: uppercase; + display: block; + margin: 15px 0 6px; +} + +.mec-calendar.mec-calendar-weekly .mec-calendar-d-table a.mec-table-d-prev, +.mec-calendar.mec-calendar-weekly .mec-calendar-d-table a.mec-table-d-next { + display: none; +} + +ul.mec-weekly-view-dates-events, +ul.mec-weekly-view-dates-events li { + padding: 0; + margin: 0; + line-height: initial; + background: #fff; +} + +.mec-calendar.mec-calendar-weekly .mec-event-list-weekly-date { + width: 64px; + height: 64px; + margin-right: 10px; + font-size: 11px; + text-transform: uppercase; + float: left; + text-align: center; + padding-top: 2px; +} + +.mec-calendar.mec-calendar-weekly .mec-event-list-weekly-date span { + font-size: 40px; + line-height: 30px; + font-weight: 700; + display: block; + margin-bottom: 6px; + letter-spacing: 1px; +} + +.mec-calendar.mec-calendar-weekly .mec-calendar-a-month .mec-previous-month { + margin-left: 0; + left: 12px; +} + +.mec-calendar.mec-calendar-weekly .mec-calendar-a-month .mec-next-month { + margin-left: 0; + left: auto; + right: 12px; +} + +@media only screen and (max-width: 479px) { + .mec-calendar.mec-calendar-weekly .mec-calendar-d-table dl dt span { + font-size: 9px; + letter-spacing: 0; + } + + .mec-calendar.mec-calendar-weekly .mec-event-list-weekly-date { + width: 100%; + height: 36px; + margin-bottom: 12px; + line-height: 1; + font-size: 10px; + margin-right: 5px; + text-align: left; + } + + .mec-calendar.mec-calendar-weekly .mec-event-list-weekly-date span { + font-size: 18px; + margin-bottom: 5px; + } +} + +.widget .mec-calendar.mec-calendar-weekly .mec-calendar-d-table dl dt span { + font-size: 9px; + letter-spacing: 0; +} + +.widget .mec-calendar.mec-calendar-weekly .mec-event-list-weekly-date { + width: 100%; + height: 36px; + margin-bottom: 12px; + line-height: 1; + font-size: 10px; + margin-right: 5px; + text-align: left; +} + +.widget .mec-calendar.mec-calendar-weekly .mec-event-list-weekly-date span { + font-size: 18px; + margin-bottom: 5px; +} + +.mec-week-events-container .mec-weekly-view-dates-events li.mec-no-event-found { + list-style: none !important; +} + +li.mec-no-event-found .mec-event-title { + text-align: center; +} + +/* MEC Events - Calendar Widget + -------------------------------- */ +.mec-widget .mec-calendar { + max-width: 100%; +} + +.mec-widget .mec-calendar dl dt, +.mec-wrap.mec-sm959.mec-widget .mec-calendar.mec-event-calendar-classic dl dt { + height: 40px; +} + +.mec-widget .mec-calendar .mec-calendar-events-sec { + padding: 10px; +} + +.mec-widget .mec-calendar .mec-calendar-header h2 { + font-size: 13px; + margin-top: 8px; +} + +.mec-widget .mec-calendar .mec-event-list-classic .mec-event-image { + margin-right: 12px; +} + +.mec-widget .mec-calendar .mec-has-event:after { + width: 4px; + height: 4px; +} + +.mec-widget + .mec-calendar.mec-event-calendar-classic + .mec-calendar-events-sec + .mec-table-side-title { + font-size: 14px; +} + +.mec-widget .mec-calendar .mec-event-article .mec-event-image { + margin-right: 11px; +} + +.mec-widget .mec-box-calendar.mec-calendar .mec-calendar-header { + margin-bottom: 20px; +} + +.mec-widget + .mec-box-calendar.mec-calendar + .mec-calendar-side + .mec-previous-month, +.mec-widget .mec-box-calendar.mec-calendar .mec-calendar-side .mec-next-month { + font-size: 0; + padding: 4px; + text-align: center; + min-width: 33px; +} + +.mec-widget .mec-event-calendar-classic .mec-calendar-side .mec-calendar-table { + min-height: 200px; +} + +/* List Widget */ +.mec-widget .mec-event-list-classic { + margin-bottom: 8px; + padding: 8px 0; +} + +.mec-widget .mec-event-list-classic .mec-event-article { + margin-bottom: 0; + padding: 10px 0; + position: relative; + min-height: 86px; + padding-left: 80px; +} + +.mec-widget .mec-event-list-classic .mec-event-date { + font-size: 10px; + line-height: 14px; + text-transform: uppercase; +} + +.mec-widget .mec-event-list-classic .mec-event-title { + font-size: 13px; +} + +.mec-widget .mec-event-list-classic .mec-event-detail { + font-size: 11px; +} + +.mec-widget .mec-event-list-classic .mec-event-image { + width: 68px; + position: absolute; + left: 0; +} + +.mec-event-list-classic .mec-event-image img { + width: 100%; +} + +.mec-widget .mec-event-list-classic .mec-event-detail { + overflow: visible; +} + +.event-color { + width: 14px; + display: inline-block; + vertical-align: middle; + height: 14px; + margin-left: 5px; + border-radius: 50%; +} + +/* MEC Events - Map view + -------------------------------- */ +/* lightbox */ +.mec-map-lightbox-wp { + padding: 15px 15px 0; + background-color: #fff; +} + +.mec-map-view-event-detail.mec-event-detail { + background-color: #e9e9e9; + padding: 8px 15px; +} + +.mec-map-lightbox-wp.mec-event-list-classic .mec-event-article { + padding: 0 0 15px; + margin: 0; +} + +.mec-map-lightbox-wp.mec-event-list-classic .mec-event-image { + width: 70px; + margin-right: 15px; +} + +/* infobox */ +.mec-marker-infowindow-wp { + padding: 10px; +} + +.mec-marker-infowindow-wp .mec-marker-infowindow-count { + width: 60px; + height: 60px; + display: block; + text-align: center; + line-height: 60px; + border: 1px solid #40d9f1; + border-radius: 50%; + font-size: 32px; + color: #40d9f1; + float: left; + margin-right: 11px; +} + +.mec-marker-infowindow-wp .mec-marker-infowindow-content { + overflow: hidden; + padding-top: 6px; +} + +.mec-marker-infowindow-wp .mec-marker-infowindow-content span { + display: block; + color: #222; +} + +.mec-marker-infowindow-wp .mec-marker-infowindow-content span:first-child { + font-size: 15px; + font-weight: 700; +} + +/* marker */ +.mec-marker-wrap { + display: inline-block; + width: 35px; + height: 35px; + margin: 15px 0 0 4px; + border-radius: 50% 50% 50% 0; + background: #00cae9; + animation-name: mec-map-bounce; + animation-fill-mode: both; + animation-duration: 1s; + border: 1px solid #fff; + cursor: pointer; +} + +.mec-marker-wrap .mec-marker { + margin-top: 5px; + display: block; + -webkit-transform: rotate(45deg) translate(1px, 0); + transform: rotate(45deg) translate(1px, 0); + text-align: center; + color: #fff; + font-size: 17px; +} + +.mec-marker-wrap .mec-marker-pulse-wrap { + -webkit-transform: rotate(45deg); + transform: rotate(45deg); + display: inline-block; + margin-left: -11px; + margin-top: 0; +} + +.mec-marker-wrap .mec-marker-pulse { + display: inline-block; + background: #01cae947; + border-radius: 50%; + height: 12px; + width: 14px; + margin-left: 3px; + -webkit-transform: rotateX(55deg); + transform: rotateX(55deg); + z-index: -2; +} + +.mec-marker-wrap .mec-marker-pulse:after { + content: ""; + border-radius: 50%; + height: 40px; + width: 40px; + position: absolute; + margin: -13px 0 0 -13px; + animation: pulsate 1s ease-out; + animation-iteration-count: infinite; + opacity: 0; + box-shadow: 0 0 1px 2px #00cae9; + animation-delay: 1.1s; +} + +@keyframes pulsate { + 0% { + transform: scale(0.1, 0.1); + opacity: 0; + } + + 50% { + opacity: 1; + } + + 100% { + transform: scale(1.2, 1.2); + opacity: 0; + } +} + +@keyframes mec-map-bounce { + 0% { + opacity: 0; + transform: translateY(-2000px) rotate(-45deg); + } + + 60% { + opacity: 1; + transform: translateY(30px) rotate(-45deg); + } + + 80% { + transform: translateY(-10px) rotate(-45deg); + } + + 100% { + transform: translateY(0) rotate(-45deg); + } +} + +.mec-skin-grid-container .mec-skin-map-container, +.mec-skin-list-container .mec-skin-map-container { + margin-bottom: 20px; +} + +/* Mec Countdown + -------------------------------- */ + +.mec-single-event .mec-events-meta-group-countdown { + color: #c9c9c9; + text-align: center; + margin-bottom: 30px; + padding: 20px 30px; + background: #fff; + border: 1px solid #e6e6e6; + box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.016); +} + +.mec-events-meta-group-countdown .countdown-w { + text-align: center; + font-size: 36px; + margin: 0 auto; + padding: 40px 0 0; + position: relative; + display: table; + table-layout: fixed; +} + +.mec-events-meta-group-countdown .countdown-w .icon-w { + font-size: 24px; +} + +.mec-events-meta-group-countdown .countdown-w .label-w { + font-size: 15px; + font-weight: 300; + letter-spacing: 1px; + text-transform: uppercase; + position: relative; +} + +.mec-events-meta-group-countdown .countdown-w .block-w { + display: table-cell; + margin: 0 20px 10px; + position: relative; + height: 70px; + width: 190px; + font-size: 72px; + transition: all 0.3s ease-in-out; + line-height: 1.2; +} + +.mec-events-meta-group-countdown .countdown-w .block-w.done-w { + border: 0 none; +} + +.mec-events-meta-group-countdown .countdown-w .block-w li { + font-size: 50px; +} + +.mec-events-meta-group-countdown .countdown-w span { + padding: 24px 0 20px; +} + +.mec-events-meta-group-countdown .countdown-w .div-d { + display: none; +} + +.mec-events-meta-group-countdown .countdown-w .countdown-message { + display: none; +} + +.mec-events-meta-group-countdown .countdown-w .block-w i { + display: none; +} + +#countdown { + list-style: none; + margin-bottom: 0; + margin-top: 0; + margin-left: 0; + padding-left: 0; +} + +.mec-events-meta-group-countdown .mec-end-counts h3 { + display: inherit; + text-align: center; + font-size: 16px; + right: 50%; +} + +.mec-countdown-details .countdown-w .clockdiv li p { + margin-top: 23px; +} + +@media (min-width: 481px) and (max-width: 768px) { + .mec-events-meta-group-countdown .countdown-w { + padding: 0; + } + + .mec-events-meta-group-countdown .countdown-w .label-w { + font-size: 12px; + letter-spacing: 0; + } + + .mec-events-meta-group-countdown .countdown-w span { + font-size: 34px; + } +} + +@media (min-width: 320px) and (max-width: 480px) { + .mec-events-meta-group-countdown .countdown-w .label-w { + font-size: 10px; + } + + .mec-events-meta-group-countdown .countdown-w span { + font-size: 28px; + } + + .mec-countdown-details .countdown-w .clockdiv li p { + margin-top: 16px; + } +} + +@media (max-width: 320px) { + .mec-events-meta-group-countdown .countdown-w .label-w { + font-size: 9px; + letter-spacing: 0; + } + + .mec-events-meta-group-countdown .countdown-w span { + font-size: 22px; + } +} + +/* Mec Warning + -------------------------------- */ +.info-msg, +.mec-success, +.warning-msg, +.mec-error { + margin: 30px 0 20px 0; + padding: 10px; + border-radius: 5px; + font-size: 13px; + line-height: 22px; +} + +.info-msg { + color: #07bbe9; + background-color: #ecf9fe; +} + +.mec-cart .mec-success, +.mec-success { + color: #2ca84c; + background-color: #e8f9ed; +} + +.warning-msg { + color: #cf7909; + background-color: #fef7e7; +} + +.mec-error { + color: #cb2916 !important; + background-color: #fef2f2; +} + +/* Mec Frontend Submission + -------------------------------- */ +.mec-fes-form, +.mec-fes-list { + background: #f8feff; + padding: 30px 3%; + color: #798f96; +} + +.mec-fes-list ul, +.mec-fes-list .mec-fes-list-top-actions { + margin: 0 auto 15px; + max-width: 960px; + list-style: none; + padding-left: 40px; +} + +.mec-fes-form-cntt .dashicons-editor-help { + display: none; +} + +.mec-fes-list ul li * { + text-decoration: none !important; +} + +.mec-fes-list ul li { + padding: 20px 15px; + border-radius: 3px; + margin-bottom: 15px; + border: 1px solid #cfeff5; + box-shadow: 0 2px 6px -4px #cfeff5; + background: #fff; + line-height: normal; +} + +.mec-fes-list ul li a { + box-shadow: none; + color: #181818; +} + +.mec-fes-list ul li a:hover { + color: #40d9f1; +} + +.mec-fes-list ul li .mec-event-title { + font-size: 17px; + font-weight: 600; + width: calc(100% - 250px); + display: inline-block; +} + +@media (max-width: 680px) { + .mec-fes-list ul li .mec-event-title { + width: 100%; + font-size: 13px; + margin: 0 0 20px 0; + display: block; + } + + .mec-fes-list ul li { + padding: 10px 12px 40px; + } +} + +@media (max-width: 480px) { + .mec-fes-list .mec-fes-list-top-actions, + .mec-fes-list ul { + padding-left: 0; + } +} + +.mec-fes-form .mec-required { + color: #ff3c3c; +} + +.mec-fes-list .mec-event-status { + color: #fff !important; + border-color: transparent !important; +} + +.mec-fes-list .mec-book-confirmed, +.mec-fes-form .mec-book-confirmed { + background: #50d477 !important; +} + +.mec-fes-list .mec-book-pending, +.mec-fes-form .mec-book-pending { + background: #fcbe69 !important; +} + +.mec-fes-list .mec-book-rejected, +.mec-fes-form .mec-book-rejected { + background: #fe686a !important; +} + +.mec-fes-list .mec-book-other, +.mec-fes-form .mec-book-other { + background: #40d9f1 !important; +} + +.mec-fes-list ul li .mec-fes-event-remove, +.mec-fes-list ul li .mec-fes-event-view, +.mec-fes-list ul li .mec-fes-event-edit { + font-size: 11px; + padding: 0; + border: 0; + background: #f7f8f9; + float: right; + margin-left: 5px; + border-radius: 2px; + transition: all 0.2s ease; +} + +.mec-fes-list ul li .mec-fes-event-remove, +.mec-fes-list ul li .mec-fes-event-view a, +.mec-fes-list ul li .mec-fes-event-edit a, +.mec-fes-list ul li .mec-fes-event-export a { + padding: 4px 8px; + display: inline-block; + border: 1px solid #e7e8e9; + border-radius: 2px; + color: #789; + position: relative; +} + +@media (max-width: 600px) { + .mec-fes-list ul li .mec-fes-event-remove, + .mec-fes-list ul li .mec-fes-event-view a, + .mec-fes-list ul li .mec-fes-event-export a, + .mec-fes-list ul li .mec-fes-event-edit a { + font-size: 10px; + } +} + +.mec-fes-list ul li .mec-fes-event-remove:hover { + cursor: pointer; + background: #f96f8a; + border-color: #f96f8a; + color: #fff; +} + +.mec-fes-list ul li .mec-fes-event-view a:hover, +.mec-fes-list ul li .mec-fes-event-edit a:hover, +.mec-fes-list ul li .mec-fes-event-export a:hover { + background: #40d9f1; + color: #fff; + border-color: #40d9f1; +} + +.single-mec-events .pmpro_content_message a, +.single-mec-events .pmpro_content_message a:link, +.mec-fes-form-top-actions a, +.mec-fes-list-top-actions a { + position: relative; + border: none; + border-radius: 3px; + color: #fff !important; + display: inline-block; + font-size: 13px; + line-height: 1; + text-transform: none; + font-weight: 400; + text-decoration: none; + cursor: pointer; + margin-bottom: 20px !important; + margin-right: 10px; + line-height: 1; + letter-spacing: 0; + padding: 15px 22px; + background: #39c36e; + box-shadow: 0 1px 7px -3px #39c36e !important; + -webkit-transition: all 0.21s ease; + -moz-transition: all 0.21s ease; + transition: all 0.21s ease; + text-decoration: unset; +} + +.single-mec-events .pmpro_content_message a:hover, +.single-mec-events .pmpro_content_message a:hover:link, +.mec-fes-list-top-actions a:hover, +.mec-fes-form-top-actions a:hover { + background: #222; + color: #fff; +} + +.mec-fes-list-top-actions a { + font-weight: 600; + text-transform: capitalize; +} + +.mec-fes-form-top-actions a:before { + content: ""; + border: solid #fff; + border-width: 0 2px 2px 0; + display: inline-block; + padding: 6px; + margin-right: 5px; + vertical-align: sub; + transform: rotate(135deg); + -webkit-transform: rotate(135deg); +} + +.mec-fes-form .mec-form-row, +.mec-fes-list .mec-form-row { + margin-bottom: 10px; + clear: both; +} + +.mec-fes-form label { + font-size: 13px; + display: block; + color: #798f96; + font-weight: 400; + padding: 0 0 4px 2px; +} + +.mec-fes-form input + label { + padding-top: 8px; + padding-left: 3px; + margin: 0; + display: inline-block; + vertical-align: top; +} + +#wrap .mec-fes-form input + label { + padding-top: 0; +} + +.mec-fes-form .post-status { + float: right !important; + margin: 0 5px; + color: #fff; + padding: 0 10px; + border-radius: 12px; + font-style: italic; + font-size: 18px; +} + +.mec-fes-form #mec-event-data input[type="date"], +.mec-fes-form input[type="text"], +.mec-fes-form input[type="url"], +.mec-fes-form input[type="number"], +.mec-fes-form input[type="email"], +.mec-fes-form input[type="password"], +.mec-fes-form input[type="tel"], +.mec-fes-form textarea, +.mec-fes-form select { + min-width: inherit; + width: auto; + display: inline; + min-height: 30px; + font-size: 13px; + padding: 10px; + margin-bottom: 20px; + clear: both; + background: #fff; + border: 1px solid #cfeff5; + box-shadow: 0 2px 5px rgba(207, 239, 245, 0.38) inset; + border-radius: 3px; + height: 40px; + max-width: 280px; + color: #798f96; + font-family: inherit; +} + +.lity-content + .mec-events-meta-group-booking + input[type="date"]::-webkit-calendar-picker-indicator, +.lity-content + #mec_fes_form + input[type="date"]::-webkit-calendar-picker-indicator, +.mec-single-event + .mec-events-meta-group-booking + input[type="date"]::-webkit-calendar-picker-indicator, +.mec-events-meta-group-booking + .mec-booking-shortcode + input[type="date"]::-webkit-calendar-picker-indicator, +#mec_fes_form input[type="date"]::-webkit-calendar-picker-indicator { + background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjA0QjQ2N0QwQjQ4MzExRUE4RDdFREZDRTUxMUVERTM5IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjA0QjQ2N0QxQjQ4MzExRUE4RDdFREZDRTUxMUVERTM5Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6MDRCNDY3Q0VCNDgzMTFFQThEN0VERkNFNTExRURFMzkiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6MDRCNDY3Q0ZCNDgzMTFFQThEN0VERkNFNTExRURFMzkiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz6WW71PAAAGIklEQVR42qRXS28bVRQ+586Mx3ZC1DSpVFojRU2CqMIGiSKxAVoUduzoDjYIlhU/Av4AYsdjRXfkD0Cjom6QqIqEqEhRo1aRkkZpkpY6j7GduQ++c2dsj1+BlInGztxvzj3nfudpPlM/otc2W2QjJmU0rZ0uUytUpBxNnN9p/FYhctF0+XUi2nPGkX7WJOfwxNRzqXxtbfI4eUvm7xY1o4iiI0d/vFiisL2BgTAz0yvbCRnLhP0uNEtqrgUseZRcwPPvJewaldSA8o48vo+Tj0U+CnrkOgZwvkEzEmGm1PF9fzK5Y3U/YlllsjRUv19zXl7571HyAjooc/kmYerpcmPO0Mfa0SyxEtji44ynOjPuayjecd7M46/MQOdGyIs9ThnzMLD0XRrwIdeetmoLm41fWiG95Ar792tydLLrOPkAlpW027hbG3+T37lf/5EtvYcXUuhfBjWp9wHRBO63c5lbEkQj2B92uaHy4l2EAQ66GFgbmiD4id/9q661ooAtf8rsvmUEilAHEqcgtJvvNq3YPTkJA8PksT9ZFxD8+4my9pvAOqOMxIMoJHfPZoJkJNiYat3duOac6hxt1N3GR8lnt0O623s+c2CVZEGaZ8Oks1mElvxu7hGYaQjpHLpH3q/YFQE7Oh5Y6gFTaHhAXlasxmoWpZO5L9Ow4DTv+UBZBAkWNO+CqhkbSOzaXWWyzY+n3WcACdVscnklz5CHYsmv1L/RyUJ/cs7zdT3Ey8pTgw/QgNNuS4XjNMvffwvBNmwDH+pdeZ3J+1qDdW15vS0iBhjZWzF9ge8HWl7zNLluYhP/9/jvFANXyL+ufF4jZvOCZsK8isp77+sixf10n7QQjJT39bBtjzdA5chtLG61n7kgk6UvDy29z4HL4c/ifkN0hYV+cA3Bc7stKAfossgSSF06+3HOu8QovE8eThDlv4pu1TbUOpqySDNUKMSDQRIo6QgVRHbFcID1mCITUGgNKLI9uBbcCC59xUi+DsiHBq0XOLb3utqOUYV+LglH9XJASRAsRNqt4xHVj59Exqw3AlrYi0PaiwNqBKoX12Y9iQSP/GkD4xZC0yt/GPFCvZzhUBoMtmPftRwMEEtpupy2auzadLraXtlNoXLhKQYLbjrWRx0cXNf24wxPSmWw5aZPNXSNOi5ytXqZpjTwSqs3PsJi0I61LG29EFG9GtyaeqgvxU17TrAkDjbvnq/eKcTYrbcemi5eHoI/OLgUt7r4n+cqd04llmZ3mjBSDQ4kYtERLLz4OKGt0xGKA9+RgiSGSRV7+UlCVvka72lEvHRx04vLGW2f/PzTBk3VtddRrGlhMXVaIdME5sLJ3ZQOTPQBNqj58uzcxsXtZEkqmQ7IB9ihLeA2x6FQqyG4cRuvbh8uNZSigzBCALhBBtrjkwjjQItQ+kPXWY6eBuEi/lmOlC8kvTh38ZLH3QC+y+GiIl4OqbeZ9RggQZgcVIXe1ep48jPkz/oGw7x1yoytIq1o59AH1Wp1rNHBSXA9tip87zYyvFzpx8dXLVTvqySvhUMNsN6+1ERrrNQVQs57H4K6cR35GrapffICb16RpO7glOHrrQyvjHXxQHB0/j1ugV0LpcFwAzS4n6hiZoIvEp2znwcSigfGJhxpMmseLc0dvFjcvRuLvdEdNyl2+0DOALwE863TM/jnJqhfQa6v4AfJzUNOZ/aVlhqIUpoO4PuU4XFsqFrSM866m9hxBXSvWPx/wHpGqA96Vfa5AH9HnMjYNI96dbkwaVzcCw/nAK+xHzp4Hp89eD04nENzX6v4cYrnrVWXXQF/Fh7MQfWasmogCNsmaT+qwD0g4gYsuYqnWlboeKMUumUr86LycxdwdRUb+zQTvAzcgL0jLXFkbkQUX5UKyFTE2bvZD0a5B8SAUu6dPf+7AInssja2VPSZRud2Ni/NKse5M2VQqkO4BxSzZLmV8Wwpa8S9OHsK3X6+Lc7F/JidOwvkc7z3FbIgzd7smy1c35TEg7NGrg6Ucs88UsCliOLHH1+Td8HYFl++W//QxfT9iSee/3lJWy5X6aMwtK3rTVWJUU4/g4GzdLLp73ku8cEDxNmXUZhc/0eAAQAVgX0RHvvILQAAAABJRU5ErkJggg=="); + background-position: center; + background-size: cover; + width: 10px; + height: 12px; + display: block; +} + +.mec-fes-form input { + background: #fff; + border-radius: 3px; +} + +.mec-fes-form textarea { + height: 80px; +} + +.mec-fes-form input::-webkit-input-placeholder { + color: #798f96; +} + +.mec-fes-form input::-moz-placeholder { + color: #798f96; +} + +.mec-fes-form input:-ms-input-placeholder { + color: #798f96; +} + +.mec-fes-form input:-moz-placeholder { + color: #798f96; +} + +#mec-excerpt .mec-form-row .widefat { + max-width: 100%; +} + +#mec_more_info_target { + width: 100%; +} + +@media only screen and (min-width: 961px) { + .mec-fes-form #mec-event-data input[type="date"], + .mec-fes-form input[type="text"], + .mec-fes-form input[type="url"], + .mec-fes-form input[type="email"], + .mec-fes-form input[type="tel"], + .mec-fes-form input[type="password"], + .mec-fes-form #mec-event-data select, + .mec-fes-form textarea { + width: 100%; + display: inline-block; + } +} + +@media only screen and (max-width: 768px) { + .mec-fes-form #mec-event-data input[type="date"], + .mec-fes-form input[type="text"], + .mec-fes-form input[type="url"], + .mec-fes-form input[type="email"], + .mec-fes-form input[type="password"], + .mec-fes-form #mec-event-data select, + .mec-fes-form textarea { + width: 100%; + } +} + +.mec-fes-form input[type="text"]#mec_fes_title { + padding: 5px 10px; + min-height: 32px; + height: 50px; + background: #fff !important; + max-width: 100%; + font-size: 19px; + font-weight: 400; +} + +.mec-fes-form input[type="checkbox"], +.mec-fes-form input[type="radio"] { + display: inline !important; + float: left; + margin: 5px 5px 0 0; +} + +.mec-fes-form input[type="text"]:focus, +.mec-fes-form input[type="number"]:focus, +.mec-fes-form input[type="email"]:focus, +.mec-fes-form input[type="url"]:focus, +.mec-fes-form input[type="password"]:focus, +.mec-fes-form input[type="tel"]:focus, +.mec-fes-form textarea:focus, +.mec-fes-form select:focus { + border: 1px solid #aaa; + color: #444; + background: #fff; + -moz-box-shadow: 0 0 3px rgba(0, 0, 0, 0.2); + -webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.2); + box-shadow: 0 0 3px rgba(0, 0, 0, 0.2); + outline: none; +} + +.mec-form-row .mec-color { + cursor: pointer; +} + +.mec-form-row.mec-available-color-row span { + margin: 10px; + width: 14px; + height: 14px; + display: inline-block; + margin-right: 6px; + border-radius: 20px 20px 20px 20px; + vertical-align: middle; +} + +.mec-form-row.mec-available-color-row span:first-of-type { + margin-left: 0; +} + +.mec-fes-form.mec-fes-form .mec-tooltip { + display: inline; +} + +.mec-fes-form-cntt .dashicons-editor-help { + display: block; +} + +.mec-fes-form .mec-tooltip:hover:after, +.mec-fes-form .mec-tooltip:hover:before { + display: none; +} + +.mec-fes-form.mec-fes-form .mec-tooltip { + display: inline-flex; + bottom: 7px; +} + +.mec-fes-form .mec-tooltip .box { + min-width: 300px; + max-width: 600px; + display: inline-block; + left: 26px; + top: 50%; + transform: translateY(-50%); + padding: 0; + margin-top: 8px; + background-color: #535a61; + color: #fff; + font-weight: 300; + font-size: 14px; + letter-spacing: 0.5px; + line-height: 1.3; + position: absolute; + z-index: 9999999; + box-sizing: border-box; + border-radius: 6px; + box-shadow: 0 4px 45px -8px #444b50; + visibility: hidden; + opacity: 0; + transition: opacity 0.23s; +} + +#webnus-dashboard .mec-fes-form .mec-tooltip .box p, +.mec-fes-form .mec-tooltip .box p { + color: #fff !important; + font-size: 14px; + line-height: 1.3; + margin: 0; +} + +.mec-fes-form .mec-tooltip:hover .box { + visibility: visible; + opacity: 1; +} + +.mec-fes-form .mec-tooltip:hover .box { + padding: 20px; + border-radius: 8px; +} + +.mec-fes-form .mec-tooltip .box h5 { + color: #fff; + font-size: 17px; + font-weight: 600; + margin: -30px -20px; + padding: 20px 0; + text-align: center; + margin-bottom: 10px; + background: #3a3f44; + border-bottom: 1px solid #32363a; + border-radius: 6px 6px 0 0; + z-index: 9999; +} + +#webnus-dashboard .mec-fes-form .mec-tooltip .box p a, +.mec-fes-form .mec-tooltip .box p a { + color: #40d9f1; + margin-top: 10px; + margin-left: 0; + font-weight: 400; + position: relative; + text-decoration: none; + display: block; + width: max-content; +} + +.mec-fes-form .mec-tooltip .box a:hover { + color: #f90; +} + +.mec-fes-form .mec-tooltip .box:after { + display: block; + position: absolute !important; + top: 100% !important; + right: 50% !important; + margin-top: -6px !important; + margin-right: -6px !important; + width: 12px !important; + height: 24px !important; + overflow: hidden !important; + transform: rotate(-90deg) !important; +} + +.mec-fes-form .mec-tooltip .box:before { + display: block; + content: "" !important; + position: absolute !important; + width: 12px; + height: 12px; + left: -10px !important; + top: 50% !important; + transform: translate(50%, -50%) rotate(-45deg) !important; + background-color: #535a61 !important; + box-shadow: 0 8px 9px -4px #535a61 !important; + z-index: 0 !important; +} + +.mec-fes-form .mec-tooltip .box.top { + left: 50%; + top: 0; + transform: translate(-50%, -100%); + margin-top: 0; + margin-left: -10px; +} + +.mec-fes-form .mec-tooltip .box.top:after { + top: 50% !important; + right: 100% !important; +} + +.mec-fes-form .mec-tooltip .box.top:before { + left: 50% !important; + top: 100% !important; +} + +.mec-fes-form .mec-tooltip .box.bottom { + left: 50%; + top: auto; + bottom: 0; + transform: translate(-50%, 100%); + margin-bottom: -20px; + margin-left: -10px; +} + +.mec-fes-form .mec-tooltip .box.bottom:after { + top: 0 !important; + right: 50% !important; + background-color: #3a3f44 !important; +} + +.mec-fes-form .mec-tooltip .box.bottom:before { + left: 50% !important; + top: -7px !important; + transform: translateX(-50%); + background-color: #3a3f44 !important; +} + +.mec-fes-form .mec-tooltip .box.left { + left: auto; + right: 26px; + top: 50%; + transform: translateY(-50%); +} + +.mec-fes-form .mec-tooltip .box.left:before { + right: 0 !important; + left: auto !important; + top: 50% !important; +} + +.mec-fes-form .mec-tooltip { + display: inline-block; + position: relative; + margin-right: 10px; + cursor: help; + bottom: 5px; + left: 3px; +} + +.mec-fes-form .mec-tooltip:last-child { + margin-right: 0; +} + +.mec-fes-form .mec-tooltip:hover:after { + background: #313130; + border-radius: 5px; + bottom: 24px; + color: #fff; + content: attr(title); + left: -75px; + padding: 10px; + position: absolute; + z-index: 98; + width: 240px; +} + +.mec-fes-form .mec-tooltip:hover:before { + border: solid; + border-color: #313130 transparent; + border-width: 6px 6px 0; + bottom: 18px; + content: ""; + left: 30%; + position: absolute; + z-index: 99; +} + +.mec-fes-form .mec-tooltip .dashicons-before:before { + font-size: 24px; + color: #008aff; + line-height: 37px; +} + +.mec-fes-form .mec-tooltip a:focus { + box-shadow: none; +} + +.mec-form-row .bootstrap_unvalid { + display: block; + border: 2px solid red; + position: relative; + display: inline-block; + border-bottom: 1px dotted #000; +} + +.mec-fes-form .mec-tooltiptext { + visibility: hidden; + width: 120px; + background-color: red; + color: #fff; + text-align: center; + border-radius: 6px; + padding: 5px 0; + position: absolute; + z-index: 1; +} + +.mec-fes-form .mec-tooltip .content p a { + display: none; +} + +@media only screen and (min-width: 961px) { + .mec-fes-form .mec-fes-form-cntt, + .mec-fes-form .mec-fes-form-sdbr { + width: 68%; + float: left; + padding-right: 20px; + } + + .mec-fes-form .mec-fes-form-sdbr { + width: 32%; + padding-right: 0; + padding-left: 20px; + } + + .mec-fes-submit-mobile { + display: none; + } +} + +.mec-fes-form .mec-meta-box-fields { + padding: 0 20px 20px; + border: 1px solid #cfeff5; + margin-bottom: 20px !important; + box-shadow: 0 2px 6px -3px #cfeff5; + border-radius: 3px; + background: #fff; +} + +.mec-fes-form .mec-meta-box-fields h4, +.mec-fes-form .mec-meta-box-fields h4 label { + margin: 0 -20px; + font-size: 15px; + font-weight: 600; + letter-spacing: 0; + color: #40d9f1; + text-transform: capitalize; + padding: 15px 20px; + margin-bottom: 20px; +} + +.mec-fes-form .mec-meta-box-fields h4 label { + padding: 0; + margin: 0; +} + +.mec-fes-sub-button { + width: 100%; +} + +.mec-available-color-row span.color-selected { + border: 3px solid #fff; + box-sizing: content-box; + box-shadow: 0 0 0 2px #40d9f1, 0 2px 8px -1px #40d9f1; +} + +.mec-fes-loading:before { + content: url("../img/ajax-loader.gif"); + background: transparent; + border-style: none; + display: block; + margin-left: 47%; +} + +.mec-fes-form + #mec_meta_box_hourly_schedule_days + .mec-form-row + input[type="text"] { + width: 190px; + margin-right: 1.4%; +} + +.mec-fes-form + #mec_meta_box_hourly_schedule_days + .mec-form-row + input[type="text"].mec-col-1, +.mec-fes-form + #mec_meta_box_hourly_schedule_days + .mec-form-row + input[type="text"].mec-col-2 { + width: 120px; + margin-right: 10px; +} + +.mec-fes-form + #mec_meta_box_hourly_schedule_days + .mec-form-row + input[type="text"].widefat { + width: 100%; +} + +.mec-fes-form #mec_meta_box_hourly_schedule_days .mec-form-row { + border-bottom: none; + padding-bottom: 10px; +} + +.mec-fes-form + #mec_meta_box_hourly_schedule_days + .mec-form-row + input[type="text"].mec-col-6 { + width: 39%; +} + +.mec-fes-form #mec_meta_box_hourly_schedule_days .mec-form-row button { + margin-right: 0; + padding: 9px 26px; +} + +.mec-fes-form + #mec_meta_box_hourly_schedule_days + .mec-form-row + button.mec-add-hourly-schedule-button { + font-size: 12px; + height: 30px; + line-height: 25px; +} + +.mec-fes-form #mec_meta_box_hourly_schedule_days .mec-form-row .description { + display: inline-block; + border-left: 1px dashed #bfcacc; + margin-left: 12px; + line-height: 28px; + padding-left: 12px; + margin-top: 5px; + font-style: italic; +} + +@media only screen and (max-width: 768px) { + .mec-fes-form + #mec_meta_box_hourly_schedule_days + .mec-form-row + input[type="text"] { + width: 100% !important; + } +} + +#mec_fes_form_message { + max-width: 838px; + margin: 10px auto; + display: block !important; + text-align: center; +} + +/* FES Attendees */ +.mec-fes-form + .mec-attendees-wrapper + .mec-attendees-list + .mec-booking-attendees-tooltip { + position: relative; +} + +.mec-fes-form .mec-attendees-wrapper .mec-attendees-list strong, +.post-type-mec-books .attendees strong { + line-height: 26px; + padding-left: 26px; +} + +.mec-fes-form + .mec-attendees-wrapper + .mec-attendees-list + .mec-booking-attendees-tooltip:before { + position: absolute; + content: "\e001"; + font-family: simple-line-icons; + margin: 12px 0; + top: -30px; + left: 0; + font-size: 18px; + line-height: 12px; + color: #40d9f1; + padding: 0 60px 5px 0; +} + +.mec-fes-form + .mec-attendees-wrapper + .mec-attendees-list + .mec-booking-attendees-tooltip + ul { + position: absolute; + min-width: 300px; + max-width: 600px; + display: inline-block; + left: 60px; + top: 50%; + transform: translateY(-50%); + background-color: #535a61; + color: #fff; + font-weight: 300; + font-size: 14px; + letter-spacing: 0.5px; + line-height: 1.3; + z-index: 9999999; + box-sizing: border-box; + box-shadow: 0 4px 45px -8px #444b50; + visibility: hidden; + opacity: 0; + transition: opacity 0.23s; + padding: 23px 20px 20px 20px; + border-radius: 8px; + margin-top: -13px; +} + +.mec-fes-form + .mec-attendees-wrapper + .mec-attendees-list + .mec-booking-attendees-tooltip + ul:before { + display: block; + content: "" !important; + position: absolute !important; + width: 12px; + height: 12px; + left: -10px !important; + top: 50% !important; + transform: translate(50%, -50%) rotate(-45deg) !important; + background-color: #535a61 !important; + box-shadow: 0 8px 9px -4px #535a61 !important; + z-index: 0 !important; +} + +.mec-fes-form + .mec-attendees-wrapper + .mec-attendees-list + .mec-booking-attendees-tooltip:hover + ul { + visibility: visible; + opacity: 1; +} + +.mec-fes-form + .mec-attendees-wrapper + .mec-attendees-list + .mec-booking-attendees-tooltip + ul + li { + list-style: none; +} + +.mec-fes-form + .mec-attendees-wrapper + .mec-attendees-list + .mec-booking-attendees-tooltip + ul + a { + color: #40d9f1; + margin-bottom: 14px; + margin-left: 0; + font-weight: 400; + font-size: 14px; + letter-spacing: 0.5px; + position: relative; + text-decoration: none; + display: block; + width: max-content; +} + +.mec-fes-form + .mec-attendees-wrapper + .mec-attendees-list + .mec-booking-attendees-tooltip + ul + li:last-child + a { + margin-bottom: 0; +} + +.mec-fes-form .mec-attendees-wrapper .mec-attendees-list { + margin: 0; +} + +.mec-fes-form + .mec-attendees-wrapper + .mec-attendees-list + .w-clearfix:first-child { + background: #fff; + border-bottom: 1px solid #cfeff5; +} + +.mec-fes-form + .mec-attendees-wrapper + .mec-attendees-list + .w-clearfix:first-child + div + span { + line-height: 1; + font-weight: 600; + font-size: 13px; +} + +.mec-fes-form .mec-attendees-wrapper .mec-attendees-list .w-clearfix { + display: flex; + background: #f8feff; + padding: 10px; + text-align: left; +} + +.mec-fes-form + .mec-attendees-wrapper + .mec-attendees-list + .w-clearfix + .w-col-xs-3 { + width: 25%; + word-wrap: break-word; +} + +.mec-fes-form + .mec-attendees-wrapper + .mec-attendees-list + .w-clearfix + .w-col-xs-3:first-child { + width: 45%; +} + +.mec-fes-form + .mec-attendees-wrapper + .mec-attendees-list + .w-clearfix + .w-col-xs-3:nth-child(2) { + width: 15%; +} + +.mec-fes-form + .mec-attendees-wrapper + .mec-attendees-list + .w-clearfix + .w-col-xs-3:nth-child(3) { + width: 25%; +} + +.mec-fes-form + .mec-attendees-wrapper + .mec-attendees-list + .w-clearfix + .w-col-xs-3:nth-child(4) { + width: 20%; +} + +.mec-fes-form + .mec-attendees-wrapper + .mec-attendees-list + .w-clearfix:not(:first-child) + .w-col-xs-3 { + font-size: 13px; + display: block; + color: #798f96; + font-weight: 400; + padding: 0; +} + +.mec-fes-form + .mec-attendees-wrapper + .mec-attendees-list + .w-clearfix + .w-col-xs-3 + a { + text-decoration: unset; +} + +.mec-fes-form + .mec-attendees-wrapper + .mec-attendees-list + .w-clearfix:nth-child(odd) { + background: #fff; +} + +/* FES Pagination */ +.mec-pagination { + display: block; + margin: 40px 0 0 0; +} + +.mec-pagination ul.page-numbers { + display: flex; + justify-content: center; + align-content: space-around; + flex-wrap: nowrap; + align-items: center; + flex-direction: row; +} + +.mec-pagination .page-numbers li { + margin: 0 7px; + padding: 0; + display: flex; +} + +.mec-pagination .page-numbers li .page-numbers { + text-align: center; + font-size: 14px; + line-height: 3; + width: 42px; +} + +.mec-pagination .page-numbers li .page-numbers.prev, +.mec-pagination .page-numbers li .page-numbers.next { + width: 110px; +} + +/* MEC Total Calendar + -------------------------------- */ +.mec-wrap .mec-totalcal-box { + position: relative; + border: 1px solid #efefef; + padding: 20px 5px; + margin: 0 0 20px; + background: #fafafa; + overflow: hidden; + box-shadow: 0 3px 2px 0 rgba(0, 0, 0, 0.012); + min-height: 78px; +} + +.mec-wrap .mec-totalcal-box i { + float: left; + margin: 0; + width: 36px; + height: 36px; + background: #fff; + border: 1px solid #efefef; + text-align: center; + padding: 10px 0; + font-size: 15px; + color: #888; +} + +.mec-wrap .mec-totalcal-box input, +.mec-wrap .mec-totalcal-box select, +.mec-checkboxes-search .mec-searchbar-category-wrap, +.mec-wrap .mec-totalcal-box .mec-totalcal-view span { + width: auto; + min-height: 36px; + height: 36px; + line-height: 36px; + background: #fff; + font-size: 13px; + color: #777; + border: 1px solid #efefef; + margin: 0 0 0 -1px; + float: left; + padding: 0 5px; + font-family: inherit; +} + +.mec-wrap .mec-totalcal-box .mec-totalcal-view span.mec-totalcalview-selected { + border-right-width: 2px; +} + +.mec-there-labels .mec-totalcal-view { + margin-top: 28px; +} + +.mec-wrap .mec-totalcal-box input[type="submit"] { + cursor: pointer; + padding: 0 16px; + text-transform: uppercase; + font-size: 11px; + transition: all 0.21s ease; +} + +.mec-wrap .mec-totalcal-box input[type="submit"]:hover { + background: #222; + color: #fff; +} + +.mec-wrap .mec-totalcal-box .mec-totalcal-view span { + display: inline-block; + text-transform: uppercase; + font-size: 11px; + padding: 0 12px; + cursor: pointer; +} + +.mec-wrap .mec-totalcal-box .mec-totalcal-view span:hover { + color: #40d9f1; +} + +.mec-wrap .mec-totalcal-box .mec-totalcal-view span.mec-totalcalview-selected { + color: #fff; + background: #40d9f1; + border-color: #40d9f1; +} + +.mec-wrap .mec-totalcal-box .mec-totalcal-view { + text-align: right; + float: right; +} + +.mec-wrap .mec-totalcal-box input[type="search"] { + width: calc(100% - 36px); +} + +.mec-there-reset-button .mec-totalcal-box { + padding-bottom: 48px; +} + +.mec-wrap .mec-totalcal-box .mec-search-reset-button .mec-button { + position: absolute !important; + margin: 0 !important; + bottom: 0 !important; + right: 0 !important; + padding: 9px 25px !important; + border-radius: 2px 0 0 0 !important; + background: #fff !important; + color: #767676 !important; + border-top: 1px solid !important; + border-left: 1px solid !important; + border-color: #e8e8e8 !important; + overflow: hidden !important; +} + +.mec-wrap .mec-totalcal-box .mec-search-reset-button .mec-button:hover { + background: #000 !important; + color: #fff !important; + border-color: #000 !important; +} + +.mec-full-calendar-wrap .mec-search-form .col-md-7 { + padding: 0; +} + +.mec-wrap .mec-date-search .mec-col-3, +.mec-wrap .mec-minmax-event-cost .mec-minmax-price { + width: calc(50% - 17px); +} + +.mec-wrap .mec-text-address-search.with-mec-cost { + width: calc(100% - 356px); +} + +.mec-wrap .mec-minmax-event-cost { + display: block; + float: left; + width: 50%; + margin-left: 10px; +} + +.mec-wrap .mec-minmax-event-cost.with-mec-address { + display: block; + width: 336px; + max-width: 50%; + float: right; + margin-left: 0; + margin-right: 10px; +} + +.mec-wrap .mec-checkboxes-search { + margin-left: 10px; + margin-right: 10px; + display: table-caption; +} + +.mec-wrap .mec-checkboxes-search .mec-searchbar-category-wrap { + width: calc(100% - 36px) !important; + max-width: calc(100% - 36px) !important; + padding: 0; + position: relative; + line-height: inherit; + height: auto; +} + +.mec-wrap .mec-checkboxes-search .mec-searchbar-category-wrap select { + line-height: 20px; +} + +.mec-wrap + .mec-checkboxes-search + .mec-searchbar-category-wrap + .select2-container.select2-container--default { + width: calc(100% - 36px) !important; +} + +.mec-wrap + .mec-checkboxes-search + .mec-searchbar-category-wrap + input[type="search"] { + width: calc(100% - 36px) !important; + min-height: 30px; + margin: 0; +} + +.mec-wrap + .mec-checkboxes-search + .mec-searchbar-category-wrap + .select2-container + .select2-selection--multiple + ul, +.mec-wrap + .mec-checkboxes-search + .mec-searchbar-category-wrap + .select2-container.select2-container--default { + height: auto; + overflow: unset; +} + +.mec-wrap + .mec-checkboxes-search + .mec-searchbar-category-wrap + .select2-container + .select2-selection--multiple + ul { + display: block; +} + +.mec-wrap + .mec-checkboxes-search + .mec-searchbar-category-wrap + .select2-container + .select2-selection--multiple { + border: unset; + width: 100%; + height: 0 !important; + border-radius: 0; +} + +.mec-wrap + .mec-checkboxes-search + .mec-searchbar-category-wrap + .select2-container + .select2-selection--multiple + ul + li { + line-height: 12px !important; + max-height: 20px !important; + width: auto; + margin-right: 5px; + margin-top: 5px; +} + +.mec-wrap + .mec-checkboxes-search + .mec-searchbar-category-wrap + .select2-container + .select2-selection--multiple + .select2-selection__choice { + letter-spacing: 0; + color: #777; + text-transform: capitalize; + padding: 4px 6px; + background-color: #efefef; + border-radius: 2px; + border: 0; + cursor: default; + float: left; + margin-right: 5px; + margin-top: 5px; + margin-bottom: 5px; + font-size: 11px; + text-transform: uppercase; +} + +.mec-wrap + .mec-checkboxes-search + .mec-searchbar-category-wrap + .select2-container + .select2-selection--multiple + .select2-selection__choice__remove { + color: #777; +} + +@media only screen and (min-width: 961px) and (max-width: 1200px) { + .mec-wrap .mec-totalcal-box { + padding: 37px 5px; + } +} + +@media only screen and (max-width: 960px) { + .mec-wrap .mec-totalcal-box .col-md-3, + .mec-wrap .mec-totalcal-box .col-md-4, + .mec-wrap .mec-totalcal-box .col-md-5 { + width: 100%; + float: none; + clear: both; + overflow: hidden; + } + + .mec-full-calendar-wrap .mec-search-form .col-md-3, + .mec-full-calendar-wrap .mec-search-form .col-md-4, + .mec-full-calendar-wrap .mec-search-form .col-md-5 { + display: block; + max-width: 100%; + padding: 0; + margin: 0 0 10px 0; + } + + .mec-full-calendar-wrap .mec-search-form .col-md-3 { + padding-bottom: 10px !important; + } + + .mec-wrap .mec-search-form .mec-date-search select { + width: calc(100% - 106px); + } + + .mec-wrap .mec-search-form .mec-date-search select:last-child { + width: 70px; + } + + .mec-wrap .mec-totalcal-box .mec-totalcal-view { + float: none; + } + + .mec-wrap + .mec-checkboxes-search + .mec-searchbar-category-wrap + .select2-container + .select2-selection--multiple + .select2-selection__choice { + display: block; + max-width: 100%; + white-space: break-spaces; + max-height: unset !important; + height: auto !important; + } +} + +@media only screen and (min-width: 768px) and (max-width: 960px) { + .mec-wrap .mec-totalcal-box .col-md-4 { + position: relative; + width: initial; + } + + .mec-wrap .mec-totalcal-box .col-md-5 { + padding-bottom: 0; + } + + .mec-full-calendar-wrap .mec-search-form .col-md-5 { + margin-top: 20px; + } + + .mec-wrap .mec-totalcal-box { + padding: 37px 5px; + } +} + +@media only screen and (max-width: 767px) { + .mec-wrap .mec-totalcal-box .mec-totalcal-view { + float: none; + } + + .mec-wrap .mec-totalcal-box .col-md-4 { + padding-bottom: 0; + } + + .mec-wrap .mec-text-address-search.with-mec-cost, + .mec-wrap .mec-minmax-event-cost.with-mec-address { + width: 100%; + float: left; + } + + .mec-wrap .mec-minmax-event-cost.with-mec-address { + max-width: calc(100% - 20px); + margin: 0 10px 20px 10px; + } + + .mec-wrap .mec-minmax-event-cost .mec-minmax-price { + width: calc(50% - 17px); + } +} + +@media only screen and (max-width: 479px) { + .mec-wrap .mec-totalcal-box .mec-totalcal-view span { + padding: 0 8px; + font-size: 10px; + } + + .mec-wrap .mec-totalcal-box input[type="submit"] { + padding: 0 10px; + font-size: 10px; + } +} + +@media only screen and (min-width: 961px) { + .mec-wrap.mec-sm959 .mec-totalcal-box .col-md-3, + .mec-wrap .mec-wrap.mec-sm959 .mec-totalcal-box .col-md-5 { + padding-bottom: 20px; + clear: both; + overflow: hidden; + } + + .mec-wrap.mec-sm959 .mec-totalcal-box .col-md-5 { + right: 10px; + width: initial; + } + + .mec-wrap.mec-sm959 .mec-totalcal-box .col-md-4 { + padding-bottom: 0; + width: 100%; + } +} + +@media (min-width: 961px) and (max-width: 1200px) { + .mec-full-calendar-wrap .mec-totalcal-box { + padding: 15px 10px; + } + + .mec-full-calendar-wrap .mec-totalcal-box .col-md-2 { + width: 50%; + } + + .mec-wrap .mec-totalcal-box .mec-totalcal-view span { + padding: 0 10px; + } + + .mec-search-form .mec-date-search, + .mec-search-form .mec-dropdown-search, + .mec-search-form .mec-text-input-search, + .mec-search-form .mec-text-address-search { + padding: 0 4px; + } + + .mec-full-calendar-wrap .mec-totalcal-box .col-md-2, + .mec-full-calendar-wrap .mec-totalcal-box .col-md-3, + .mec-full-calendar-wrap .mec-totalcal-box .col-md-4, + .mec-full-calendar-wrap .mec-totalcal-box .col-md-5 { + padding-bottom: 20px; + } + + .mec-full-calendar-wrap .mec-totalcal-box .col-md-2 select { + min-width: calc(100% - 36px); + } + + .mec-full-calendar-wrap .mec-totalcal-box .col-md-3 select { + min-width: calc(30% - 10px); + } + + .mec-full-calendar-wrap .mec-totalcal-box .col-md-3:last-child select { + min-width: calc(50% - 19px); + } + + .mec-full-calendar-wrap .mec-totalcal-box .mec-totalcal-view span { + font-size: 9px; + text-align: center; + } +} + +@media only screen and (max-width: 1200px) { + .post-type-archive-mec-events .mec-totalcal-box .col-md-3, + .post-type-archive-mec-events .mec-totalcal-box .col-md-4 { + width: 100%; + padding: 0; + } + + .post-type-archive-mec-events .mec-totalcal-box select:last-child { + min-width: auto; + } + + .post-type-archive-mec-events .mec-totalcal-box .col-md-5 { + position: relative; + float: right; + max-width: 100%; + left: 0; + top: 20px; + width: 100% !important; + display: block; + clear: both; + } + + .post-type-archive-mec-events .mec-totalcal-box .mec-totalcal-view { + max-width: 100%; + width: 100%; + } + + .post-type-archive-mec-events .mec-totalcal-box .mec-totalcal-view span { + width: 20.1%; + font-size: 10px; + } +} + +@media only screen and (max-width: 960px) { + .post-type-archive-mec-events .mec-totalcal-box .col-md-5 { + top: 10px; + } +} + +@media only screen and (max-width: 760px) { + .post-type-archive-mec-events .mec-totalcal-box .col-md-5 { + top: 0 !important; + } +} + +@media only screen and (max-width: 480px) { + .post-type-archive-mec-events .mec-totalcal-box .mec-totalcal-view span { + font-size: 8px; + } +} + +@media (min-width: 1201px) and (max-width: 1280px) { + .mec-full-calendar-wrap .mec-totalcal-view span { + font-size: 9px; + padding: 0 10px; + } +} + +@media (min-width: 761px) and (max-width: 1200px) { + .mec-full-calendar-wrap + .mec-search-form + .mec-dropdown-wrap + .mec-dropdown-search { + width: 33.3333%; + display: block; + float: left; + } + + .mec-full-calendar-wrap .mec-search-form .col-md-4 .mec-text-input-search { + padding: 0; + margin-bottom: 20px; + } + + .mec-full-calendar-wrap .mec-search-form .col-md-3 { + width: 100%; + } + + .mec-full-calendar-wrap .mec-search-form .mec-date-search select:last-child { + min-width: 70px; + width: 70px; + } + + .mec-full-calendar-wrap .mec-search-form .col-md-5 { + float: right; + padding: 0 0 10px 0; + } + + .mec-full-calendar-wrap .mec-totalcal-view span { + font-size: 11px; + } +} + +@media (max-width: 760px) { + .mec-full-calendar-wrap .mec-search-form .col-md-3 { + width: 100%; + } + + .mec-full-calendar-wrap .mec-search-form .mec-date-search select:last-child { + min-width: 70px; + width: 70px; + } + + .mec-full-calendar-wrap .mec-search-form .col-md-5 { + float: right; + padding: 0 0 10px 0; + } + + .mec-full-calendar-wrap .mec-totalcal-view span { + font-size: 11px; + } +} + +@media (max-width: 960px) { + .mec-full-calendar-wrap .mec-totalcal-box { + padding: 20px 20px; + } + + .mec-full-calendar-wrap .mec-totalcal-box .col-md-2 { + width: 50%; + } + + .mec-full-calendar-wrap .mec-totalcal-box .col-md-2, + .mec-full-calendar-wrap .mec-totalcal-box .col-md-3, + .mec-full-calendar-wrap .mec-totalcal-box .col-md-4 { + padding-bottom: 10px; + } + + .mec-full-calendar-wrap .mec-totalcal-box .col-md-2 select { + min-width: calc(100% - 36px); + margin-bottom: 10px; + } + + .mec-full-calendar-wrap .mec-totalcal-box .mec-totalcal-view { + margin-left: 10px; + } + + .mec-full-calendar-wrap .mec-totalcal-box .mec-totalcal-view span { + font-size: 10px; + text-align: center; + } + + .mec-full-calendar-wrap .mec-totalcal-box .col-md-2 { + width: 100%; + } + + .mec-full-calendar-wrap .mec-totalcal-box .mec-totalcal-view span { + min-width: 14.3%; + text-align: center; + font-size: 10px; + margin-right: -1px; + } +} + +@media (max-width: 780px) { + .mec-full-calendar-wrap .mec-totalcal-box .col-md-3 select { + width: calc(50% - 18px) !important; + } + + .mec-full-calendar-wrap .mec-totalcal-box .col-md-4 { + position: unset; + padding-right: 0; + } + + .mec-full-calendar-wrap .mec-search-form .col-md-3, + .mec-full-calendar-wrap .mec-search-form .col-md-4, + .mec-full-calendar-wrap .mec-search-form .col-md-5 { + margin: 0; + padding: 0; + } + + .mec-wrap .mec-totalcal-box .mec-totalcal-view span { + padding: 0 7px; + margin-top: 20px; + } +} + +@media (max-width: 480px) { + .mec-full-calendar-wrap .mec-totalcal-box { + padding: 15px 10px; + } + + .mec-full-calendar-wrap .mec-totalcal-box .mec-totalcal-view span { + min-width: 13.5%; + text-align: center; + font-size: 11px; + } +} + +@media (max-width: 411px) { + .mec-full-calendar-wrap .mec-totalcal-box .mec-totalcal-view span { + min-width: 12%; + font-size: 10px; + } +} + +@media (max-width: 320px) { + .mec-full-calendar-wrap .mec-totalcal-box .mec-totalcal-view span { + min-width: 22.5%; + font-size: 11px; + } +} + +/* FullCalendar Search field items responsive */ +.mec-totalcalview-selected:hover { + color: #fff !important; +} + +/* Cal search form */ +.mec-search-form { + padding: 20px 10px; +} + +.mec-search-form .mec-dropdown-wrap { + display: table; + width: 100%; +} + +.mec-search-form .mec-date-input-search, +.mec-search-form .mec-time-input-search, +.mec-search-form .mec-dropdown-search, +.mec-search-form .mec-text-input-search, +.mec-search-form .mec-date-search { + padding: 0 10px; + float: left; + /* min-height: 55px; */ +} + +.mec-search-form .mec-date-search, +.mec-search-form .mec-totalcal-view, +.mec-search-form .mec-time-picker-search { + padding: 0 10px; +} + +.mec-search-form .mec-text-input-search { + width: 100%; +} + +.mec-search-form .mec-full-calendar-search-ends .mec-text-input-search { + width: 50%; +} + +.mec-search-form .mec-date-search, +.mec-search-form .mec-time-picker-search { + width: 50%; + float: left; +} + +.mec-search-form .mec-date-search.with-mec-time-picker, +.mec-search-form .mec-time-picker-search.with-mec-date-search { + width: 25%; + float: left; +} + +.mec-search-form .mec-tab-loader.col-md-6 .mec-totalcal-view { + padding: 0; +} + +.mec-wrap .mec-search-form .with-mec-date-search .mec-timepicker-start, +.mec-wrap .mec-search-form .with-mec-date-search .mec-timepicker-end { + width: calc(50% - 17px); +} + +.mec-search-form .mec-text-address-search, +.mec-search-form .mec-minmax-event-cost, +.mec-search-form + .mec-full-calendar-search-ends + .mec-text-input-search.col-md-12 { + min-height: 55px; +} + +.mec-search-form + .mec-full-calendar-search-ends + .mec-text-input-search.col-md-12, +.mec-widget .mec-search-form .mec-text-input-search, +.mec-widget .mec-search-form .mec-date-search { + width: 100%; +} + +.mec-search-form + .mec-full-calendar-search-ends + .mec-text-input-search.col-md-12 { + padding: 0 10px; +} + +.mec-there-labels + .mec-search-form + .mec-full-calendar-search-ends + .mec-text-input-search.col-md-12 { + margin-top: 20px; +} + +.mec-search-form .mec-text-address-search, +.mec-search-form .mec-minmax-event-cost, +.mec-widget .mec-search-form .mec-text-input-search { + margin-top: 10px; +} + +.mec-search-form .mec-date-search { + clear: left; +} + +.mec-search-form .mec-dropdown-wrap .mec-dropdown-search { + display: table-cell; + float: none; +} + +.mec-widget .mec-search-form .mec-dropdown-wrap .mec-dropdown-search { + display: block; +} + +.mec-checkboxes-search .mec-searchbar-category-wrap, +.mec-wrap .mec-search-form .mec-dropdown-wrap .mec-dropdown-search select { + width: calc(100% - 36px); + margin-bottom: 10px; +} + +.mec-wrap .mec-search-form .mec-text-input-search input, +.mec-wrap .mec-search-form .mec-minmax-price input, +.mec-wrap .mec-search-form .mec-text-address-search input { + margin-bottom: 10px; +} + +.mec-wrap .mec-totalcal-box label { + display: block; + line-height: 1.8; + margin-bottom: 4px; + font-size: 13px; + color: #9a9a9a; +} + +.mec-wrap .mec-search-form .mec-date-search select { + width: calc(100% - 106px); +} + +.mec-wrap .mec-search-form .mec-date-search select:last-child { + width: 70px; +} + +@media only screen and (max-width: 781px) { + .mec-search-form .mec-dropdown-search, + .mec-search-form .mec-text-input-search, + .mec-search-form .mec-date-search { + width: 100%; + float: none; + } + + .mec-search-form .mec-date-search { + min-height: 55px; + } + + .mec-search-form .mec-dropdown-wrap .mec-dropdown-search { + display: block; + width: 50%; + float: left; + } + + .mec-full-calendar-wrap .mec-totalcal-box .col-md-3 { + margin-bottom: 0; + padding-bottom: 0 !important; + } +} + +@media only screen and (max-width: 479px) { + .mec-search-form .mec-dropdown-wrap .mec-dropdown-search { + display: block; + width: 100%; + float: none; + } +} + +/* Final fix full calendar shortcode */ +@media only screen and (min-width: 961px) and (max-width: 1200px) { + .post-type-archive-mec-events .mec-totalcal-box .col-md-3, + .post-type-archive-mec-events .mec-totalcal-box .col-md-4, + .post-type-archive-mec-events .mec-totalcal-box .col-md-5 { + max-width: 100%; + width: 100%; + } + + .post-type-archive-mec-events .mec-totalcal-box .col-md-4 { + padding: 0 10px; + } + + .post-type-archive-mec-events + .mec-totalcal-box + .col-md-4 + .mec-text-input-search { + margin: 0; + } + + .post-type-archive-mec-events .mec-totalcal-box .col-md-5 { + margin-bottom: 20px; + padding: 0 10px 10px 10px; + } +} + +@media only screen and (max-width: 960px) { + .mec-full-calendar-wrap .mec-totalcal-box .col-md-4, + .post-type-archive-mec-events .mec-totalcal-box .col-md-4 { + padding: 0 10px; + } + + .mec-full-calendar-wrap .mec-totalcal-box .col-md-4 { + margin-bottom: 0; + } + + .post-type-archive-mec-events + .mec-totalcal-box + .col-md-4 + .mec-text-input-search { + margin: 0; + } + + .post-type-archive-mec-events .mec-totalcal-box .mec-totalcal-view { + padding-right: 15px; + } + + .mec-full-calendar-wrap .mec-search-form .col-md-5 { + margin-bottom: 0; + } + + .post-type-archive-mec-events .mec-totalcal-box .col-md-5 { + padding: 0; + } +} + +@media only screen and (max-width: 780px) { + .post-type-archive-mec-events .mec-totalcal-box .mec-totalcal-view span { + margin-top: 10px; + margin-bottom: 10px; + } + + .mec-wrap .mec-totalcal-box .mec-totalcal-view span { + margin-top: 0; + } +} + +@media only screen and (max-width: 760px) { + .post-type-archive-mec-events .mec-totalcal-box .mec-totalcal-view span { + margin-top: 20px; + margin-bottom: 0; + } + + .mec-wrap .mec-totalcal-box .mec-totalcal-view span { + margin-top: 20px; + } + + .mec-full-calendar-wrap .mec-totalcal-box .col-md-4, + .post-type-archive-mec-events .mec-totalcal-box .col-md-4 { + padding: 0; + } +} + +@media only screen and (max-width: 1200px) { + .post-type-archive-mec-events + .mec-full-calendar-wrap + .mec-totalcal-view + span { + width: 14.333%; + font-size: 8px; + } +} + +@media only screen and (min-width: 320px) and (max-width: 960px) { + .post-type-archive-mec-events .mec-search-form .col-md-5 span { + width: 20% !important; + } +} + +.mec-search-form .mec-text-address-search { + float: left; + width: 100%; + padding: 0 10px; +} + +@media (max-width: 960px) { + .mec-search-form .mec-dropdown-search { + margin-bottom: 10px; + } + + .mec-wrap .mec-minmax-event-cost.with-mec-address, + .mec-wrap .mec-text-address-search.with-mec-cost { + margin-top: 0; + } + + .mec-search-form .mec-date-search.with-mec-time-picker, + .mec-search-form .mec-time-picker-search.with-mec-date-search { + width: 50%; + margin-bottom: 20px; + } + + .mec-full-calendar-wrap .mec-totalcal-box .mec-totalcal-view { + margin: 0; + } + + .mec-full-calendar-wrap .mec-tab-loader { + width: 100%; + display: block; + float: unset; + padding: 0 0 0 10px; + } +} + +@media (max-width: 780px) { + .mec-full-calendar-wrap .mec-totalcal-box { + padding: 10px; + } + + .mec-search-form .mec-date-search.with-mec-time-picker, + .mec-search-form .mec-time-picker-search.with-mec-date-search { + margin: 20px 0; + height: auto; + } + + .mec-search-form .mec-date-search { + min-height: unset; + } +} + +@media (max-width: 480px) { + .mec-search-form .mec-date-search.with-mec-time-picker, + .mec-search-form .mec-time-picker-search.with-mec-date-search { + width: 100%; + } + + .mec-full-calendar-wrap .mec-totalcal-box .mec-totalcal-view span { + min-width: 12%; + text-align: center; + font-size: 9px; + } + + .mec-search-form .mec-minmax-event-cost, + .mec-search-form .mec-text-address-search, + .mec-search-form .mec-full-calendar-search-ends .mec-text-input-search, + .mec-search-form .mec-date-search.with-mec-time-picker, + .mec-search-form .mec-time-picker-search.with-mec-date-search, + .mec-wrap .mec-minmax-event-cost.with-mec-address, + .mec-full-calendar-wrap .mec-totalcal-box .mec-totalcal-view span { + margin-bottom: 0; + margin-top: 10px; + min-height: auto; + } + + .mec-wrap .mec-minmax-event-cost.with-mec-address { + margin-bottom: 10px; + } + + .mec-wrap.mec-widget + .mec-search-form + .mec-time-picker-search.with-mec-date-search, + .mec-wrap.mec-widget .mec-minmax-event-cost.with-mec-address, + .mec-wrap.mec-widget .mec-text-address-search.with-mec-cost { + display: block !important; + width: 100% !important; + max-width: 100% !important; + } + + .mec-wrap.mec-widget .mec-minmax-event-cost.with-mec-address { + float: left !important; + max-width: calc(100% - 20px) !important; + margin: 0 0 0 10px !important; + } + + .mec-wrap.mec-widget + .mec-search-form + .mec-time-picker-search.with-mec-date-search { + margin-top: 20px !important; + } + + .mec-wrap.mec-widget .mec-search-form .mec-text-input-search { + padding: 10px !important; + } +} + +/* MEC Datepicker + ---------------------*/ +.ui-datepicker { + background-color: #fff; + border: 1px solid #66afe9; + border-radius: 4px; + box-shadow: 0 0 8px rgba(102, 175, 233, 0.6); + display: none; + margin-top: 4px; + padding: 10px; + width: 240px; +} + +.ui-datepicker a, +.ui-datepicker a:hover { + text-decoration: none; + cursor: pointer; +} + +.ui-datepicker a:hover, +.ui-datepicker td:hover a { + color: #2c6396; + -webkit-transition: color 0.1s ease-in-out; + -moz-transition: color 0.1s ease-in-out; + -o-transition: color 0.1s ease-in-out; + transition: color 0.1s ease-in-out; +} + +.ui-datepicker .ui-datepicker-header { + margin-bottom: 4px; + text-align: center; +} + +.ui-datepicker .ui-datepicker-title { + font-weight: 700; +} + +.ui-datepicker .ui-datepicker-prev, +.ui-datepicker .ui-datepicker-next { + cursor: default; + font-family: dashicons; + -webkit-font-smoothing: antialiased; + font-style: normal; + font-weight: normal; + height: 20px; + line-height: 1.4; + margin-top: 2px; + width: 20px; +} + +.ui-datepicker .ui-datepicker-prev { + float: left; + text-align: left; +} + +.ui-datepicker .ui-datepicker-next { + float: right; + text-align: center; +} + +.ui-datepicker .ui-datepicker-prev:before { + content: "\f341"; +} + +.ui-datepicker .ui-datepicker-next:before { + content: "\f345"; +} + +.ui-datepicker .ui-icon { + display: none; +} + +.ui-datepicker .ui-datepicker-calendar { + table-layout: fixed; + width: 100%; +} + +.ui-datepicker .ui-datepicker-calendar th, +.ui-datepicker .ui-datepicker-calendar td { + text-align: center; + padding: 4px 0; +} + +.ui-datepicker .ui-datepicker-calendar td { + border-radius: 4px; + -webkit-transition: background-color 0.1s ease-in-out, color 0.1s ease-in-out; + -moz-transition: background-color 0.1s ease-in-out, color 0.1s ease-in-out; + -o-transition: background-color 0.1s ease-in-out, color 0.1s ease-in-out; + transition: background-color 0.1s ease-in-out, color 0.1s ease-in-out; +} + +.ui-datepicker .ui-datepicker-calendar td:hover { + background-color: #eee; + cursor: pointer; +} + +.ui-datepicker .ui-datepicker-calendar td a { + text-decoration: none; +} + +.ui-datepicker .ui-datepicker-current-day { + background-color: #4289cc; +} + +.ui-datepicker .ui-datepicker-current-day a { + color: #fff; +} + +.ui-datepicker .ui-datepicker-calendar .ui-datepicker-unselectable:hover { + background-color: #fff; + cursor: default; +} + +/* MEC Events Carousel Type1 */ + +@media only screen and (max-width: 768px) { + .mec-owl-theme .owl-nav [class*="owl-"] { + display: none !important; + } +} + +.mec-owl-theme .owl-dots .owl-dot { + border: none; +} + +.event-carousel-type1-head .mec-event-image { + position: relative; + min-height: 150px; + overflow: hidden; +} + +.event-carousel-type1-head .mec-event-image img { + width: 100%; +} + +.mec-event-carousel-content .mec-event-carousel-title a { + transition: all 0.2s ease; +} + +.event-carousel-type1-head .mec-event-date-carousel { + position: absolute; + top: 25px; + left: 1px; + font-size: 41px; + width: 160px; + color: #fff; + font-weight: 500; + background-color: #40d9f1; + padding-left: 14px; + height: 97px; + line-height: 2.3; + padding-right: 85px; +} + +.event-carousel-type1-head .mec-event-date-carousel:after { + content: ""; + position: absolute; + display: inline-block; + z-index: -1; + bottom: -13px; + left: 5px; + width: 0; + border-width: 13px; + border-style: solid; + border-color: transparent transparent #40d9f1 transparent; + transform: rotate(45deg); +} + +.event-carousel-type1-head .mec-event-date-info { + font-size: 12px; + font-weight: 300; + position: absolute; + top: 27px; + left: 75px; +} + +.event-carousel-type1-head .mec-event-date-info-year { + font-size: 12px; + font-weight: 300; + position: absolute; + top: 45px; + left: 75px; +} + +.mec-event-carousel-content { + border: 1px solid #e8e8e8; + border-top: none; + margin-top: -5px; + padding: 34px 9px 11px 37px; +} + +.mec-event-carousel-content .mec-event-carousel-title a { + font-size: 23px; + font-weight: 500; + color: #000; + letter-spacing: -1px; +} + +.mec-event-carousel-content p { + font-size: 14px; + color: #7a7272; + font-weight: 300; +} + +.mec-owl-crousel-skin-type1 .owl-item .mec-event-article { + padding: 0 19px; +} + +.mec-event-carousel-type1 .owl-page.active span { + background-color: #00aeef; + height: 14px; + width: 14px; +} + +.mec-event-carousel-type1 .mec-event-carousel-content { + margin-bottom: 15px; + box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); + transition: all 0.27s ease; +} + +.mec-skin-carousel-container .mec-owl-carousel button:focus { + outline: none; +} + +.mec-event-carousel-type1 .mec-event-carousel-content:hover { + box-shadow: 0 0 35px rgba(0, 0, 0, 0.07); +} + +.mec-skin-carousel-container .mec-multiple-event .mec-event-date-carousel { + width: 255px; +} + +.mec-skin-carousel-container + .mec-multiple-event + .event-carousel-type1-head + .mec-event-date-info-year, +.mec-skin-carousel-container + .mec-multiple-event + .event-carousel-type1-head + .mec-event-date-info { + left: 175px; +} + +.mec-skin-carousel-container .mec-time-details span, +.mec-skin-carousel-container .mec-time-details { + font-size: 11px; + font-weight: 400; + line-height: 1.9; + letter-spacing: 0; + color: #000; + border-radius: 2px; + white-space: nowrap; +} + +.mec-event-carousel-type4 .mec-time-details span, +.mec-event-carousel-type4 .mec-time-details { + color: #fff; +} + +.mec-skin-carousel-container .mec-time-details span { + margin: 0; + display: inline-block; +} + +@media only screen and (min-width: 768px) and (max-width: 1000px), + (min-width: 270px) and (max-width: 448px) { + .event-carousel-type1-head .mec-event-date-carousel { + font-size: 25px; + line-height: 2.5; + padding-right: 70px; + height: 64px; + width: 120px; + } + + .event-carousel-type1-head .mec-event-date-carousel:after { + left: 7px; + } + + .event-carousel-type1-head .mec-event-date-info { + font-size: 10px; + top: 13px; + left: 55px; + } + + .event-carousel-type1-head .mec-event-date-info-year { + font-size: 10px; + top: 25px; + left: 55px; + } + + .event-carousel-type1-head .mec-event-date-carousel:after { + top: 48px; + } +} + +/* MEC Events Carousel Type2 + ---------------------------- */ +.event-carousel-type2-head { + background: #fff; + border: 1px solid #e6e6e6; +} + +.event-carousel-type2-head .mec-event-carousel-content-type2 { + margin-top: 15px; + min-height: 182px; +} + +.event-carousel-type2-head + .mec-event-carousel-content-type2 + .mec-event-date-info { + font-size: 15px; + color: #9a9a9a; + font-weight: 300; +} + +.event-carousel-type2-head + .mec-event-carousel-content-type2 + .mec-event-carousel-title { + font-size: 26px; + font-weight: bold; + color: #1c1d21; + margin-top: 15px; + letter-spacing: -1px; +} + +.mec-event-carousel-content-type2 .mec-event-carousel-title a { + color: inherit; +} + +.mec-event-carousel-type2 + .event-carousel-type2-head + .mec-event-carousel-content-type2 + p { + font-size: 16px; + font-weight: 300; + color: #444444; +} + +.event-carousel-type2-head .mec-event-footer-carousel-type2 { + margin-top: 33px; + position: relative; + display: flex; + flex-wrap: wrap; + flex-direction: row; + justify-content: flex-end; +} + +.mec-event-carousel-type2 + .mec-event-footer-carousel-type2 + .mec-event-sharing-wrap { + padding-left: 0; + position: relative; + left: 0; + margin-right: auto; +} + +.event-carousel-type2-head + .mec-event-footer-carousel-type2 + .mec-event-sharing-wrap + > li { + border: none; + -webkit-transition: all 0.25s ease; + transition: all 0.25s ease; +} + +.event-carousel-type2-head + .mec-event-footer-carousel-type2 + .mec-booking-button { + border: 1px solid #e4e4e4; + padding: 7px 23px 7px; + font-size: 12px; + text-transform: uppercase; + color: #707070; + font-weight: 500; + -webkit-transition: all 0.25s ease; + transition: all 0.25s ease; +} + +.event-carousel-type2-head + .mec-event-footer-carousel-type2 + .mec-booking-button:hover { + color: #fff; +} + +.mec-event-article .event-carousel-type2-head { + padding: 10%; + margin-right: -1px; +} + +.mec-event-carousel-type2 .mec-owl-carousel .owl-wrapper-outer { + border-right: 1px solid #e6e6e6; +} + +.event-carousel-type2-head + .mec-event-footer-carousel-type2 + .mec-booking-button { + line-height: 17px; + height: 41px; + padding: 12px 10px; +} + +.event-carousel-type2-head + .mec-event-footer-carousel-type2 + .mec-modal-booking-button { + margin: 0; + padding: 12px 10px; + margin-left: 15px; +} + +.mec-wrap .mec-event-carousel-type2 .owl-prev, +.mec-wrap .mec-event-carousel-type2 .owl-next, +.mec-wrap .mec-event-carousel-type3 .owl-prev, +.mec-wrap .mec-event-carousel-type3 .owl-next, +.mec-wrap .mec-event-carousel-type4 .owl-prev, +.mec-wrap .mec-event-carousel-type4 .owl-next { + transition: all 0.25s ease; + -webkit-transition: all 0.25s ease; + position: absolute; + top: 47%; + background-color: transparent !important; + position: absolute !important; +} + +.mec-event-carousel-type2 .owl-next { + right: -60px; +} + +.mec-event-carousel-type2 .owl-prev { + left: -60px; +} + +.mec-event-carousel-type2 .owl-prev, +.mec-event-carousel-type2 .owl-next, +.mec-event-carousel-type3 .owl-prev, +.mec-event-carousel-type3 .owl-next, +.mec-event-carousel-type4 .owl-prev, +.mec-event-carousel-type4 .owl-next { + border: none; +} + +.mec-event-carousel-type2 .owl-prev i, +.mec-event-carousel-type2 .owl-next i, +.mec-event-carousel-type3 .owl-prev i, +.mec-event-carousel-type3 .owl-next i, +.mec-event-carousel-type4 .owl-prev i, +.mec-event-carousel-type4 .owl-next i { + font-size: 40px; + color: #282828; +} + +.mec-event-carousel-type2 .owl-prev i:hover, +.mec-event-carousel-type2 .owl-next i:hover, +.mec-event-carousel-type3 .owl-prev i:hover, +.mec-event-carousel-type3 .owl-next i:hover { + color: #000; + cursor: pointer; +} + +.mec-event-footer-carousel-type2 .mec-event-sharing-wrap .mec-event-sharing { + top: auto; + bottom: 60px; +} + +.mec-event-footer-carousel-type2 + .mec-event-sharing-wrap + .mec-event-sharing:after, +.mec-event-footer-carousel-type2 + .mec-event-sharing-wrap + .mec-event-sharing:before { + top: auto; + bottom: -19px; + border-color: #e2e2e2 transparent transparent transparent; +} + +.mec-event-footer-carousel-type2 + .mec-event-sharing-wrap + .mec-event-sharing:after { + bottom: -18px; + border-color: #fff transparent transparent transparent; +} + +@media only screen and (min-width: 320px) and (max-width: 768px) { + .mec-event-carousel-type2 .owl-prev, + .mec-event-carousel-type2 .owl-next, + .mec-event-carousel-type3 .owl-prev, + .mec-event-carousel-type3 .owl-next, + .mec-event-carousel-type4 .owl-prev, + .mec-event-carousel-type4 .owl-next { + position: initial; + top: 100%; + } +} + +/* MEC Events Carousel Type3 + ----------------------------- */ +.mec-event-carousel-type3 .mec-event-article { + margin: 0 10px; +} + +.event-carousel-type3-head .mec-event-image, +.event-carousel-type3-head .mec-event-image img { + width: 100%; + height: auto; +} + +.event-carousel-type3-head .mec-event-footer-carousel-type3 { + background: #fff; + display: inline-block; + width: calc(100% - 40px); + margin-top: -74px; + position: relative; + margin-left: 20px; + margin-right: 20px; + margin-bottom: 6px; + padding: 8% 11%; + box-shadow: 0 2px 10px -2px rgba(0, 0, 0, 0.2); +} + +.event-carousel-type3-head + .mec-event-footer-carousel-type3 + .mec-booking-button { + border: 1px solid #e4e4e4; + text-transform: uppercase; + float: right; + padding: 0 10px; + font-size: 12px; + line-height: 36px; + color: #707070; + font-weight: 500; +} + +.event-carousel-type3-head + .mec-event-footer-carousel-type3 + .mec-booking-button:hover { + color: #fff; +} + +.mec-event-footer-carousel-type3 span { + font-size: 15px; + color: #9a9a9a; + font-weight: 300; +} + +.mec-event-footer-carousel-type3 .mec-event-carousel-title { + font-size: 29px; + font-weight: 700; +} + +.event-carousel-type3-head + .mec-event-footer-carousel-type3 + .mec-event-carousel-title { + font-size: 26px; + font-weight: bold; + color: #1c1d21; + margin-top: 15px; + letter-spacing: -1px; +} + +.mec-event-footer-carousel-type3 .mec-event-carousel-title a { + color: inherit; +} + +.event-carousel-type3-head .mec-event-footer-carousel-type3 p { + font-size: 16px; + font-weight: 300; + color: #444444 !important; + margin-bottom: 36px; +} + +.mec-event-carousel-type3 .owl-next { + right: -70px; +} + +.mec-event-carousel-type3 .owl-prev { + left: -70px; +} + +.mec-event-footer-carousel-type3 .mec-event-sharing-wrap { + position: static; + float: left; +} + +.mec-event-footer-carousel-type3 .mec-event-sharing-wrap .mec-event-sharing { + top: auto; + bottom: 60px; +} + +.mec-event-footer-carousel-type3 + .mec-event-sharing-wrap + .mec-event-sharing:after, +.mec-event-footer-carousel-type3 + .mec-event-sharing-wrap + .mec-event-sharing:before { + top: auto; + bottom: -19px; + border-color: #e2e2e2 transparent transparent transparent; +} + +.mec-event-footer-carousel-type3 + .mec-event-sharing-wrap + .mec-event-sharing:after { + bottom: -18px; + border-color: #fff transparent transparent transparent; +} + +.event-carousel-type3-head .mec-end-date-label { + display: inline; + margin-left: 2px; +} + +/* MEC Events Carousel Type4 + ----------------------------- */ +.event-carousel-type4-head.clearfix { + position: relative; + overflow: hidden; + background: #fff; +} + +.event-carousel-type4-head .mec-event-overlay { + position: absolute; + left: 0; + right: 0; + bottom: 0; + top: 0; + width: auto; + height: auto; + background-color: rgba(36, 36, 36, 0.4); + transition: all 0.33s ease-in-out; +} + +.mec-event-hover-carousel-type4 { + font-size: 15px; + color: #fff; + position: absolute; + bottom: 0; + padding: 50px 35px; + transition: all 0.33s ease-in-out; + opacity: 0; + visibility: hidden; +} + +.event-carousel-type4-head .mec-event-image img { + min-height: 360px; + object-fit: cover; +} + +.mec-event-carousel-type4 .mec-event-article { + margin: 0 10px; +} + +.mec-event-carousel-type4 + .mec-event-article:hover + .mec-event-hover-carousel-type4 { + opacity: 1; + visibility: visible; +} + +.mec-event-hover-carousel-type4 .mec-event-icon { + font-size: 18px; + float: left; + margin-right: 14px; + color: #fff; + padding: 13px; +} + +.mec-event-hover-carousel-type4 .mec-event-date { + font-size: 11px; + text-transform: uppercase; + font-weight: 400; + line-height: 1.6; + text-align: left; +} + +.mec-event-hover-carousel-type4 .mec-event-date span { + display: block; + font-weight: 700; + font-size: 14px; +} + +.mec-event-hover-carousel-type4 .mec-event-title { + color: #fff; + margin: 20px 0 38px; + font-size: 16px; + font-weight: 700; + text-transform: uppercase; + font-style: normal; +} + +.mec-event-hover-carousel-type4 .mec-btn-wrapper { + text-align: left; +} + +.mec-event-hover-carousel-type4 .mec-event-button { + color: #fff; + background-color: #191919; + border: 2px #191919 solid; + padding: 10px 14px; + letter-spacing: 1.5px; + font-size: 11px; + font-weight: 700; + font-style: normal; + transition: all 0.22s ease; + text-decoration: none; +} + +.mec-event-hover-carousel-type4 .mec-event-button:hover { + color: #191919; + background-color: #fff; + border-color: #fff; + border-radius: 1px; +} + +.mec-event-carousel-type4 .owl-next { + right: -70px; +} + +.mec-event-carousel-type4 .owl-prev { + left: -70px; +} + +.mec-carousel-type4-head { + margin-bottom: 25px; +} + +.mec-carousel-type4-head-title { + padding: 0 11px; + text-align: left; + font-weight: bold; + font-size: 20px; + color: #000; +} + +.mec-carousel-type4-head-link { + text-align: right; + padding: 0 11px; +} + +.mec-carousel-type4-head-link a { + background: #222; + color: #fff; + padding: 10px 38px; + transition: all 0.3s ease; +} + +.mec-carousel-type4-head-link a:hover, +.mec-carousel-type4-head-link a:visited { + color: #fff; +} + +@media (max-width: 960px) { + .mec-event-carousel-type4 .owl-stage { + left: -50px; + } +} + +/* MEC Countdown View Style1 + ----------------------------- */ +.mec-wrap .mec-event-countdown-style1 { + color: #fff; + padding: 0 !important; + display: table; + background: #437df9; +} + +.mec-wrap .mec-event-countdown-style1 .mec-event-countdown-part1 { + z-index: 5; + padding: 50px 1% 50px 4%; + display: table-cell; + float: none; + vertical-align: middle; +} + +.mec-wrap .mec-event-countdown-style1 .mec-event-countdown-part2 { + background-color: rgba(0, 0, 0, 0.05); + height: 100%; + padding-top: 0; + display: table-cell; + float: none; + position: relative; + vertical-align: middle; +} + +.mec-wrap .mec-event-countdown-style1 .mec-event-countdown-part3 { + background-color: #f8f8f8; + display: table-cell; + float: none; + text-align: center; + vertical-align: middle; +} + +.mec-wrap + .mec-event-countdown-style1 + .mec-event-countdown-part1 + .mec-event-title { + color: #fff; + font-size: 15px; + margin-top: 30px; +} + +.mec-wrap + .mec-event-countdown-style1 + .mec-event-countdown-part1 + .mec-event-upcoming { + font-size: 36px; + font-weight: bold; + line-height: 1; + margin-top: 0; +} + +.mec-wrap + .mec-event-countdown-style1 + .mec-event-countdown-part2 + .mec-event-countdown + > div { + display: inline-block; +} + +.mec-event-countdown-style1 .mec-events-meta-group-countdown { + color: #c9c9c9; + margin-bottom: 30px; + padding: 20px 30px; + background: #fff; + border: 1px solid #e6e6e6; + box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.016); +} + +.mec-event-countdown-style1 + .mec-event-countdown-part1 + .mec-event-upcoming + span { + display: block; +} + +.mec-wrap .mec-event-countdown-style1 .mec-event-countdown-part2:after { + content: ""; + position: absolute; + display: inline-block; + z-index: 1; + top: 50%; + margin-top: -11px; + right: -24px; + width: 0; + border-width: 12px; + border-style: solid; + border-color: transparent transparent transparent #4077ed; +} + +.mec-event-countdown-style1 .mec-event-countdown-part2 .mec-event-date-place { + text-align: center; + padding-bottom: 8px; +} + +.mec-event-countdown-style1 .mec-event-countdown-part2 .mec-event-date, +.mec-event-countdown-part2 .mec-event-place { + display: inline; + font-size: 14px; + padding: 0 5px; + text-align: center; +} + +.mec-event-countdown-style1 .mec-event-countdown-part3 .mec-event-button { + display: inline-block; + padding: 14px 30px; + vertical-align: middle; + font-size: 12px; + letter-spacing: 1px; + text-transform: uppercase; + color: #fff; + background: #4077ed; + transition: all 0.24s ease; +} + +.mec-event-countdown-style1 .mec-event-countdown-part3 .mec-event-button:hover { + background: #222; +} + +.mec-event-countdown-style1 .mec-event-countdown { + text-align: center; + display: table; + table-layout: fixed; + margin: 0 auto; +} + +.mec-event-countdown-style1 .mec-event-countdown .label-w { + letter-spacing: 1px; + text-transform: uppercase; + position: relative; +} + +.mec-event-countdown-style1 .mec-event-countdown .block-w { + display: table-cell; + margin: 0 20px 10px; + position: relative; + height: 70px; +} + +.mec-wrap .mec-event-countdown-style1 .mec-event-countdown li { + background-color: rgba(0, 0, 0, 0.1); + margin: 5px; + padding: 20px 0; + min-width: 94px; +} + +.mec-wrap .mec-event-countdown-style1 .mec-event-countdown li span { + font-size: 30px; +} + +.mec-wrap .mec-event-countdown-style1 .mec-event-countdown li .label-w { + font-size: 12px; + color: #fff; + margin: 8px 0 0; + line-height: 1; +} + +@media only screen and (min-width: 1200px) { + .mec-wrap.mec-sm959 .mec-event-countdown-style1 .mec-event-countdown-part1, + .mec-wrap.mec-sm959 .mec-event-countdown-style1 .mec-event-countdown-part2, + .mec-wrap.mec-sm959 .mec-event-countdown-style1 .mec-event-countdown-part3 { + width: 100%; + display: block; + padding-top: 50px; + padding-bottom: 50px; + } + + .mec-wrap.mec-sm959 + .mec-event-countdown-style1 + .mec-event-countdown-part2:after { + border-color: #4077ed transparent transparent transparent; + top: auto; + margin-top: 0; + bottom: -24px; + margin-left: -11px; + left: 50%; + } +} + +@media (max-width: 960px) { + .mec-wrap .mec-event-countdown-style1 .mec-event-countdown-part1, + .mec-wrap .mec-event-countdown-style1 .mec-event-countdown-part2, + .mec-wrap .mec-event-countdown-style1 .mec-event-countdown-part3 { + width: 100%; + display: block; + padding-top: 50px; + padding-bottom: 50px; + } + + .mec-wrap .mec-event-countdown-style1 .mec-event-countdown-part2:after { + border-color: #4077ed transparent transparent transparent; + top: auto; + margin-top: 0; + bottom: -24px; + margin-left: -11px; + left: 50%; + transform: rotate(90deg); + } +} + +@media (max-width: 480px) { + .mec-event-countdown-style1 .mec-event-countdown .block-w { + margin: 3px; + height: auto; + } + + .mec-wrap .mec-event-countdown-style1 .mec-event-countdown li { + padding: 10px 5px; + min-width: 50px; + margin: 3px 1px; + } + + .mec-wrap .mec-event-countdown-style1 .mec-event-countdown li span { + font-size: 15px; + } + + .mec-wrap .mec-event-countdown-style1 .mec-event-countdown li .label-w { + font-size: 8px; + } + + .mec-event-countdown-style1 .mec-event-countdown-part2 .mec-event-date-place { + display: inline; + } +} + +/* MEC Countdown View Style2 + ----------------------------- */ +.mec-wrap .mec-event-countdown-style2 { + color: #fff; + padding: 30px 0; + background: #437df9; + max-width: 600px; +} + +.mec-wrap .mec-event-countdown-style2 .mec-event-countdown-part1, +.mec-wrap .mec-event-countdown-style2 .mec-event-countdown-part2, +.mec-wrap .mec-event-countdown-style2 .mec-event-countdown-part3 { + width: 100%; + float: none; + vertical-align: middle; + padding: 50px 10% 50px 10%; +} + +.mec-wrap .mec-event-countdown-style2 .mec-event-countdown-part2 { + padding-top: 12%; + padding-bottom: 0; +} + +.mec-wrap + .mec-event-countdown-style2 + .mec-event-countdown-part1 + .mec-event-title { + color: #fff; + font-size: 15px; + margin-top: 30px; +} + +.mec-wrap + .mec-event-countdown-style2 + .mec-event-countdown-part1 + .mec-event-upcoming { + font-size: 36px; + font-weight: bold; + line-height: 1; + margin-top: 0; +} + +.mec-wrap + .mec-event-countdown-style2 + .mec-event-countdown-part2 + .mec-event-countdown + > div { + display: inline-block; +} + +.mec-event-countdown-style2 .mec-events-meta-group-countdown { + color: #c9c9c9; + margin-bottom: 30px; + padding: 20px 30px; + background: #fff; + box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.016); +} + +.mec-event-countdown-style2 + .mec-event-countdown-part1 + .mec-event-upcoming + span { + display: block; +} + +.mec-event-countdown-style2 .mec-event-countdown-part2 .mec-event-date-place { + text-align: left; + padding-bottom: 8px; +} + +.mec-event-countdown-style2 .mec-event-countdown-part2 .mec-event-date, +.mec-event-countdown-part2 .mec-event-place { + display: inline; + font-size: 14px; + padding: 0 8px; +} + +.mec-event-countdown-style2 .mec-event-countdown-part3 .mec-event-button { + display: inline-block; + padding: 14px 30px; + vertical-align: middle; + font-size: 12px; + letter-spacing: 1px; + text-transform: uppercase; + color: #222; + background: #fff; + transition: all 0.24s ease; +} + +.mec-event-countdown-style2 .mec-event-countdown-part3 .mec-event-button:hover { + background: #222; + color: #fff; +} + +.mec-event-countdown-style2 .mec-event-countdown { + text-align: center; + display: table; + table-layout: fixed; + margin: 0; +} + +.mec-event-countdown-style2 .mec-event-countdown .label-w { + letter-spacing: 1px; + text-transform: uppercase; + position: relative; +} + +.mec-event-countdown-style2 .mec-event-countdown .block-w { + display: table-cell; + margin: 0 20px 10px; + position: relative; + height: 70px; +} + +.mec-wrap .mec-event-countdown-style2 .mec-event-countdown li { + background-color: rgba(0, 0, 0, 0.1); + margin: 5px; + padding: 20px 0; + min-width: 94px; +} + +.mec-wrap .mec-event-countdown-style2 .mec-event-countdown li span { + font-size: 30px; +} + +.mec-wrap .mec-event-countdown-style2 .mec-event-countdown li .label-w { + font-size: 12px; + color: #fff; + margin: 8px 0 0; + line-height: 1; +} + +@media only screen and (max-width: 767px) { + .mec-wrap .mec-event-countdown-style2 .mec-event-countdown li { + min-width: 80px; + padding: 15px; + } + + .mec-wrap .mec-event-countdown-style2 .mec-event-countdown li span { + font-size: 26px; + } + + .mec-wrap .mec-event-countdown-style2 .mec-event-countdown li .label-w { + font-size: 11px; + } +} + +@media only screen and (max-width: 479px) { + .mec-wrap .mec-event-countdown-style2 .mec-event-countdown li { + min-width: 40px; + padding: 15px 10px; + margin: 2px; + } + + .mec-wrap .mec-event-countdown-style2 .mec-event-countdown li span { + font-size: 20px; + } + + .mec-wrap .mec-event-countdown-style2 .mec-event-countdown li .label-w { + font-size: 9px; + } +} + +@media (max-width: 380px) { + .mec-event-countdown-style2 .mec-event-countdown .block-w { + margin: 3px; + height: auto; + } + + .mec-wrap .mec-event-countdown-style2 .mec-event-countdown li { + padding: 10px 4px; + margin: 4px 1px; + } + + .mec-wrap .mec-event-countdown-style2 .mec-event-countdown li span { + font-size: 15px; + } + + .mec-wrap .mec-event-countdown-style2 .mec-event-countdown li .label-w { + font-size: 7px; + } +} + +/* MEC Countdown View Style3 + ----------------------------- */ +.mec-wrap .mec-event-countdown-style3 { + color: #fff; + padding: 0; + background: #282828; + display: table; + width: 100%; +} + +.mec-wrap .mec-event-countdown-style3 .mec-event-countdown-part1 { + width: 68%; + padding: 50px 1% 50px 4%; + vertical-align: middle; + display: table-cell; + position: relative; +} + +.mec-wrap .mec-event-countdown-style3 .mec-event-countdown-part2 { + width: 32%; + display: table-cell; + position: relative; + padding-bottom: 0; + padding-top: 0; +} + +.mec-wrap .mec-event-countdown-style3 .mec-event-countdown-part2 img { + width: 100%; + display: block; +} + +.mec-wrap + .mec-event-countdown-style3 + .mec-event-countdown-part1 + .mec-event-countdown-part-title + span { + font-weight: 300; + display: block; +} + +.mec-wrap + .mec-event-countdown-style3 + .mec-event-countdown-part1 + .mec-event-upcoming { + color: #fff; + font-size: 36px; + letter-spacing: -2px; + font-weight: bold; + line-height: 1; + margin-top: -10px; +} + +.mec-wrap + .mec-event-countdown-style3 + .mec-event-countdown-part2 + .mec-event-countdown + > div { + display: inline-block; +} + +.mec-event-countdown-style3 .mec-events-meta-group-countdown { + color: #c9c9c9; + margin-bottom: 30px; + padding: 20px 30px; + background: #fff; + border: 1px solid #e6e6e6; + box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.016); +} + +.mec-event-countdown-style3 .mec-event-countdown-part2 .mec-event-date-place { + text-align: center; + padding-bottom: 8px; +} + +.mec-event-countdown-style3 .mec-event-countdown-part2 .mec-event-date, +.mec-event-countdown-part2 .mec-event-place { + display: inline; + font-size: 14px; + padding: 0 5px; + text-align: center; +} + +.mec-event-countdown-style3 .mec-event-countdown-part3 .mec-event-button { + display: inline-block; + padding: 14px 30px; + vertical-align: middle; + font-size: 12px; + letter-spacing: 1px; + text-transform: uppercase; + color: #fff; + background: #4077ed; + transition: all 0.24s ease; +} + +.mec-event-countdown-style3 .mec-event-countdown-part3 .mec-event-button:hover { + background: #222; +} + +.mec-event-countdown-style3 .mec-event-countdown { + text-align: center; + display: table; + table-layout: fixed; + margin: 0 auto; + position: absolute; + top: 40px; + right: 20px; +} + +.mec-event-countdown-style3 .mec-event-countdown .label-w { + letter-spacing: 1px; + text-transform: uppercase; + position: relative; +} + +.mec-event-countdown-style3 .mec-event-countdown .block-w { + display: table-cell; + margin: 0 20px 10px; + position: relative; + height: 70px; +} + +.mec-wrap .mec-event-countdown-style3 .mec-event-countdown li { + padding: 15px; +} + +.mec-wrap .mec-event-countdown-style3 .mec-event-countdown li span { + font-size: 30px; +} + +.mec-wrap .mec-event-countdown-style3 .mec-event-countdown li .label-w { + font-size: 11px; + color: #888; + margin: 8px 0 0; + line-height: 1; +} + +.mec-event-countdown-style3 .mec-event-date { + width: 176px; + height: 96px; + background: #40d9f1; + color: #fff; + font-size: 13px; + position: absolute; + left: -27px; + top: 146px; +} + +.mec-event-countdown-style3 .mec-event-date:after { + content: ""; + position: absolute; + display: inline-block; + z-index: 1; + bottom: -18px; + left: 8px; + width: 0; + border-width: 19px; + border-style: solid; + border-color: transparent transparent #40d9f1 transparent; + transform: rotate(45deg); +} + +.mec-event-countdown-style3 .mec-event-date .mec-date1 { + font-size: 50px; + position: absolute; + top: 7px; + left: 12px; + letter-spacing: -3px; +} + +.mec-event-countdown-style3 .mec-event-date .mec-date2 { + position: absolute; + left: 80px; + top: 26px; +} + +.mec-event-countdown-style3 .mec-event-date .mec-date3 { + position: absolute; + left: 80px; + top: 45px; +} + +.mec-event-countdown-style3 .mec-event-countdown-part-details { + padding-top: 35px; + margin-bottom: 50px; + min-height: 100px; +} + +.mec-event-countdown-style3 .mec-event-countdown-part-details .mec-event-title { + font-size: 17px; + color: #fff; + line-height: 1.4; + padding-right: 20px; +} + +.mec-event-countdown-style3 .mec-event-countdown-part-details .mec-event-link { + color: #fff; + font-size: 12px; + position: relative; + padding-left: 22px; +} + +.mec-event-countdown-style3 + .mec-event-countdown-part-details + .mec-event-link:before { + content: ""; + display: inline-block; + width: 18px; + border-top: 1px solid #fff; + position: absolute; + left: 0; + top: 8px; +} + +.mec-event-countdown-style3 .mec-event-title-link { + position: absolute; + left: 190px; + top: 152px; +} + +.mec-event-countdown-style3 .mec-event-date:before, +.event-carousel-type1-head .mec-event-date-carousel:before { + content: ""; + position: absolute; + left: 0; + bottom: 0; + z-index: 2; + width: 100%; + height: 96px; + display: inline-block; + box-shadow: 0 5px 5px rgba(0, 0, 0, 0.12); + background: transparent; +} + +@media only screen and (min-width: 960px) { + .mec-wrap.mec-sm959 .mec-event-countdown-style3 .mec-event-countdown li { + padding: 10px; + } + + .mec-wrap.mec-sm959 + .mec-event-countdown-style3 + .mec-event-countdown-part1 + .mec-event-upcoming { + font-size: 31px; + } +} + +@media (max-width: 959px) { + .mec-wrap .mec-event-countdown-style3 .mec-event-countdown-part1, + .mec-wrap .mec-event-countdown-style3 .mec-event-countdown-part2 { + width: 100%; + display: block; + } + + .mec-event-countdown-style3 .mec-event-title-link { + top: 190px; + } + + .mec-event-countdown-style3 .mec-event-countdown { + top: 96px; + } + + .mec-event-countdown-style3 .mec-event-date { + left: 0; + top: 190px; + } + + .mec-event-countdown-style3 .mec-event-date:after { + display: none; + } + + .mec-wrap + .mec-event-countdown-style3 + .mec-event-countdown-part1 + .mec-event-countdown-part-title + span { + display: inline; + } + + .mec-event-countdown-style3 .mec-event-countdown-part-details { + min-height: 150px; + } +} + +@media (max-width: 767px) { + .mec-wrap + .mec-event-countdown-style3 + .mec-event-countdown-part1 + .mec-event-upcoming { + font-size: 26px; + letter-spacing: -1px; + } + + .mec-event-countdown-style3 .mec-event-title-link { + left: 130px; + } + + .mec-event-countdown-style3 .mec-event-date { + width: 120px; + font-size: 10px; + height: 63px; + } + + .mec-event-countdown-style3 .mec-event-date .mec-date1 { + font-size: 36px; + top: 3px; + left: 4px; + letter-spacing: -2px; + } + + .mec-event-countdown-style3 .mec-event-date .mec-date2 { + position: absolute; + left: 52px; + top: 12px; + } + + .mec-event-countdown-style3 .mec-event-date .mec-date3 { + position: absolute; + left: 52px; + top: 28px; + } +} + +@media (max-width: 380px) { + .mec-event-countdown-style3 .mec-event-title-link { + left: 10px; + top: 260px; + } + + .mec-event-countdown-style3 .mec-event-countdown-part-details { + min-height: 300px; + } + + .mec-event-countdown-style3 .mec-event-countdown .block-w { + margin: 3px; + height: auto; + } + + .mec-wrap .mec-event-countdown-style3 .mec-event-countdown li { + padding: 10px 5px; + } + + .mec-wrap .mec-event-countdown-style3 .mec-event-countdown li span { + font-size: 15px; + } + + .mec-wrap .mec-event-countdown-style3 .mec-event-countdown li .label-w { + font-size: 8px; + } +} + +/* MEC Slider 1 + -------------------------------- */ +.mec-slider-t1-wrap { + width: 100%; + padding: 60px 90px; + background: #f7f7f7; + min-height: 560px; + position: relative; +} + +.mec-slider-t1 { + height: 500px; + box-shadow: 0 5px 35px 0 rgba(0, 0, 0, 0.13); +} + +.mec-slider-t1 .mec-event-article { + position: relative; + height: 500px; +} + +.mec-slider-t1 .mec-slider-t1-img { + position: relative; + background-size: cover !important; + background-position: center !important; + width: 50%; + height: 100%; + float: right; + margin: 0; + overflow: hidden; +} + +.mec-slider-t1 .mec-slider-t1-content { + width: 50%; + float: left; + height: 100%; + background: #fff; + padding: 6%; +} + +.mec-slider-t1-content.mec-event-grid-modern .mec-event-article { + border: none; + padding: 0; + margin: 0; + box-shadow: none; +} + +.mec-slider-t1-content.mec-event-grid-modern .mec-event-title { + font-size: 29px; +} + +.mec-slider-t1-content.mec-event-grid-modern .mec-event-title a:hover { + text-decoration: underline; +} + +.mec-slider-t1-content.mec-event-grid-modern + .mec-event-footer + .mec-booking-button { + font-size: 12px; + padding: 0 31px; + line-height: 49px; + height: 50px; +} + +.mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-prev, +.mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-next { + opacity: 1; + width: 54px; + height: 54px; + line-height: 48px; + border-radius: 0; + text-align: center; + background: #fff; + box-shadow: 0 2px 11px 0 rgba(0, 0, 0, 0.045); + transition: all 0.25s ease; + -webkit-transition: all 0.25s ease; + position: absolute; + top: 50%; + margin-top: -27px; + cursor: pointer; +} + +.mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-prev:hover, +.mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-next:hover { + box-shadow: 0 4px 29px 0 rgba(0, 0, 0, 0.095); +} + +.mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-next { + left: auto; + right: -100px; +} + +.mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-prev { + right: auto; + left: -100px; +} + +.mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-prev i, +.mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-next i { + font-size: 12px; + color: #282828; + transition: all 0.21s ease; +} + +.mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-prev:hover i, +.mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-next:hover i { + font-size: 13px; + color: #000; + cursor: pointer; +} + +@media only screen and (min-width: 961px) { + .mec-slider-t1 { + margin: 0 auto; + max-width: 900px; + } +} + +@media only screen and (max-width: 960px) { + .mec-slider-t1 .mec-slider-t1-img, + .mec-slider-t1 .mec-slider-t1-content { + width: 100%; + float: none; + } + + .mec-slider-t1 .mec-slider-t1-img { + height: 300px; + } + + .mec-slider-t1, + .mec-slider-t1 .mec-event-article { + height: auto; + } +} + +@media only screen and (max-width: 768px) { + .mec-slider-t1-wrap { + padding: 0; + } + + .mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-prev, + .mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-next { + top: 40px; + margin-top: 0; + } + + .mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-next { + left: auto; + right: 10px; + } + + .mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-prev { + right: auto; + left: 10px; + } +} + +@media only screen and (max-width: 479px) { + .mec-slider-t1-content.mec-event-grid-modern .mec-event-title { + font-size: 22px; + } + + .mec-slider-t1-content.mec-event-grid-modern + .event-grid-modern-head + .mec-event-day { + font-size: 25px; + } +} + +/* MEC Slider 2 + -------------------------------- */ +.mec-slider-t2-wrap { + width: 100%; + padding: 0; + background: #fff; + min-height: 600px; + position: relative; +} + +.mec-slider-t2 .mec-event-article { + height: 600px; + position: relative; + border: none; + padding: 0; + margin: 0; + box-shadow: none; + background: none; +} + +.mec-slider-t2 .mec-slider-t2-img { + position: absolute; + left: 0; + top: 0; + background-size: cover !important; + background-position: center !important; + width: 70%; + height: 100%; + margin: 0; + overflow: hidden; +} + +.mec-slider-t2 .mec-slider-t2-content { + width: 50%; + position: absolute; + right: 0; + top: 60px; + bottom: 60px; + padding: 3%; +} + +.mec-slider-t2 .mec-slider-t2-content.mec-event-grid-modern * { + color: #fff; +} + +.mec-slider-t2 .mec-slider-t2-content.mec-event-grid-modern .mec-event-title { + font-size: 29px; +} + +.mec-slider-t2-content.mec-event-grid-modern .mec-event-content, +.mec-slider-t2-content.mec-event-grid-modern + .mec-event-footer + .mec-booking-button { + background: none; +} + +.mec-slider-t2-content.mec-event-grid-modern + .mec-event-footer + .mec-booking-button { + font-size: 12px; + padding: 0 31px; + line-height: 49px; + height: 50px; +} + +.mec-slider-t2-content.mec-event-grid-modern + .mec-event-footer + .mec-booking-button:hover { + background: #fff; + color: #000; + border-color: #fff; +} + +.mec-slider-t2-content.mec-event-grid-modern .mec-event-title a:hover, +.mec-slider-t2-content.mec-event-grid-modern + .mec-event-footer + .mec-booking-button:hover { + color: #111; +} + +.mec-slider-t2-wrap .mec-owl-theme .owl-nav .owl-prev, +.mec-slider-t2-wrap .mec-owl-theme .owl-nav .owl-next { + opacity: 1; + width: 44px; + height: 44px; + line-height: 38px; + border-radius: 0; + text-align: center; + background: transparent; + border: 1px solid #fff; + transition: all 0.25s ease; + -webkit-transition: all 0.25s ease; + position: absolute; + top: 84px; + cursor: pointer; +} + +.mec-slider-t2-wrap .mec-owl-theme .owl-nav .owl-prev:hover, +.mec-slider-t2-wrap .mec-owl-theme .owl-nav .owl-next:hover { + box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.075); + background: #fff; +} + +.mec-slider-t2-wrap .mec-owl-theme .owl-nav .owl-next { + right: 30px; +} + +.mec-slider-t2-wrap .mec-owl-theme .owl-nav .owl-prev { + right: 82px; +} + +.mec-slider-t2-wrap .mec-owl-theme .owl-nav .owl-prev i, +.mec-slider-t2-wrap .mec-owl-theme .owl-nav .owl-next i { + font-size: 14px; + color: #fff; + opacity: 1; + transition: all 0.25s ease; +} + +.mec-slider-t2-wrap .mec-owl-theme .owl-nav .owl-prev:hover i, +.mec-slider-t2-wrap .mec-owl-theme .owl-nav .owl-next:hover i { + color: #000; + cursor: pointer; +} + +.mec-wrap.colorskin-custom + .mec-slider-t2 + .mec-event-article + .mec-event-date.mec-color { + color: #fff; +} + +@media only screen and (min-width: 961px) { + .mec-slider-t2 { + margin: 0 auto; + max-width: 1200px; + } +} + +@media only screen and (max-width: 960px) { + .mec-slider-t2 .mec-slider-t2-img, + .mec-slider-t2 .mec-slider-t2-content { + width: 100%; + float: none; + position: static; + } + + .mec-slider-t2 .mec-slider-t2-img { + height: 300px; + } + + .mec-slider-t2 .mec-event-article { + height: auto; + } + + .mec-slider-t2-wrap .mec-owl-theme .owl-nav .owl-prev, + .mec-slider-t2-wrap .mec-owl-theme .owl-nav .owl-next { + top: 40px; + } +} + +@media only screen and (max-width: 479px) { + .mec-slider-t2-content.mec-event-grid-modern .mec-event-title { + font-size: 22px; + } +} + +/* MEC Slider 3 + -------------------------------- */ +.mec-slider-t3-wrap { + width: 100%; + padding: 0; + background: #161616; + min-height: 700px; + position: relative; +} + +.mec-slider-t3 .mec-event-article { + height: 700px; + position: relative; + border: none; + padding: 0; + margin: 0; + box-shadow: none; + background: none; +} + +.mec-slider-t3 .mec-slider-t3-img { + position: absolute; + left: 0; + top: 0; + background-size: cover !important; + background-position: center !important; + width: 100%; + height: 100%; + margin: 0; + overflow: hidden; + opacity: 0.68; + z-index: 1; +} + +.mec-slider-t3 .mec-slider-t3-content { + width: 50%; + height: auto; + vertical-align: middle; + display: table; + position: absolute; + left: 0; + top: 50%; + transform: translateY(-50%); + bottom: 0; + padding: 0 2% 0 7%; + margin: auto 0; + background: none; + z-index: 2; +} + +.mec-slider-t3 .mec-slider-t3-content.mec-event-grid-modern *:not(.mec-color) { + color: #fff; +} + +.mec-slider-t3-content.mec-event-grid-modern .mec-event-title { + font-size: 29px; +} + +.mec-slider-t3-content.mec-event-grid-modern .mec-event-content, +.mec-slider-t3-content.mec-event-grid-modern + .mec-event-footer + .mec-booking-button { + background: none; +} + +.mec-slider-t3-content.mec-event-grid-modern .mec-booking-button { + display: inline-block; + border: 1px solid; + font-weight: 500; + letter-spacing: 1px; + text-transform: uppercase; + font-size: 13px; + padding: 0 42px; + line-height: 49px; + height: 50px; + transition: all 0.21s ease; +} + +.mec-slider-t3-content.mec-event-grid-modern .mec-booking-button:hover { + background: #fff; + color: #000; + border-color: #fff; +} + +.mec-slider-t3-content.mec-event-grid-modern .mec-slider-t3-footer { + text-align: left; + padding: 15px 15px 10px; +} + +.mec-slider-t3-content.mec-event-grid-modern .mec-event-title a:hover, +.mec-slider-t3-content.mec-event-grid-modern + .mec-event-footer + .mec-booking-button:hover { + color: #40d9f1; +} + +.mec-slider-t3-content.mec-event-grid-modern + .mec-event-footer + .mec-booking-button:hover { + border-color: #40d9f1; +} + +.mec-slider-t3-wrap .mec-owl-theme .owl-nav .owl-prev, +.mec-slider-t3-wrap .mec-owl-theme .owl-nav .owl-next { + opacity: 1; + width: 44px; + height: 44px; + line-height: 38px; + border-radius: 0; + text-align: center; + background: transparent; + border: 1px solid #fff; + transition: all 0.25s ease; + -webkit-transition: all 0.25s ease; + position: absolute; + top: 50%; + margin-top: -22px; + cursor: pointer; +} + +.mec-slider-t3-wrap .mec-owl-theme .owl-nav .owl-prev:hover, +.mec-slider-t3-wrap .mec-owl-theme .owl-nav .owl-next:hover { + box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.075); + background: #fff; +} + +.mec-slider-t3-wrap .mec-owl-theme .owl-nav .owl-next { + right: 10px; +} + +.mec-slider-t3-wrap .mec-owl-theme .owl-nav .owl-prev { + right: auto; + left: 10px; +} + +.mec-slider-t3-wrap .mec-owl-theme .owl-nav .owl-prev i, +.mec-slider-t3-wrap .mec-owl-theme .owl-nav .owl-next i { + font-size: 14px; + color: #fff; + opacity: 1; + transition: all 0.25s ease; +} + +.mec-slider-t3-wrap .mec-owl-theme .owl-nav .owl-prev:hover i, +.mec-slider-t3-wrap .mec-owl-theme .owl-nav .owl-next:hover i { + color: #000; + cursor: pointer; +} + +@media only screen and (min-width: 961px) { + .mec-slider-t3-content.mec-event-grid-modern .mec-event-title { + font-size: 50px; + font-weight: 300; + } + + .mec-slider-t3-content.mec-event-grid-modern .mec-event-description { + font-size: 19px; + } +} + +.mec-event-description { + line-height: 1.7; +} + +@media only screen and (max-width: 767px) { + .mec-slider-t3-wrap .mec-owl-theme .owl-nav .owl-prev, + .mec-slider-t3-wrap .mec-owl-theme .owl-nav .owl-next { + top: 40px; + margin-top: 0; + } +} + +@media only screen and (max-width: 479px) { + .mec-slider-t3 .mec-slider-t3-content { + width: 100%; + } + + .mec-slider-t3-content.mec-event-grid-modern .mec-event-title { + font-size: 22px; + } + + .mec-slider-t1-content.mec-event-grid-modern + .event-grid-modern-head + .mec-event-day { + font-size: 25px; + } +} + +/* MEC Slider 4 + -------------------------------- */ +.mec-slider-t4-wrap { + width: 100%; + padding: 0; + background: #161616; + min-height: 700px; + position: relative; +} + +.mec-slider-t4 .mec-event-article { + height: 700px; + border: none; + padding: 0; + margin: 0; + box-shadow: none; + background: none; +} + +.mec-slider-t4 .mec-slider-t4-img { + position: absolute; + left: 0; + top: 0; + background-size: cover !important; + background-position: center !important; + width: 100%; + height: 100%; + margin: 0; + overflow: hidden; + z-index: 1; +} + +.mec-slider-t4 .mec-slider-t4-content { + width: auto; + max-width: 700px; + background: rgba(37, 37, 37, 0.94) !important; + height: auto; + vertical-align: middle; + display: table; + position: absolute; + left: 8%; + top: 19%; + padding: 3%; + margin: auto 0; + background: none; + z-index: 2; +} + +.mec-slider-t4 .mec-slider-t4-content.mec-event-grid-modern *:not(.mec-color) { + color: #fff; +} + +.mec-slider-t4-content.mec-event-grid-modern .mec-event-title { + font-size: 29px; +} + +.mec-slider-t4-content.mec-event-grid-modern .mec-event-content, +.mec-slider-t4-content.mec-event-grid-modern + .mec-event-footer + .mec-booking-button { + background: none; +} + +.mec-slider-t4-content.mec-event-grid-modern + .mec-event-footer + .mec-booking-button { + font-size: 13px; + padding: 0 42px; + line-height: 49px; + height: 50px; +} + +.mec-slider-t4-content.mec-event-grid-modern .mec-event-title a:hover { + color: #40d9f1; +} + +.mec-slider-t4-content.mec-event-grid-modern .mec-slider-t4-footer { + text-align: left; + padding: 15px 15px 10px; +} + +.mec-slider-t4-content.mec-event-grid-modern .mec-booking-button { + display: inline-block; + border: 1px solid; + font-weight: 500; + letter-spacing: 1px; + text-transform: uppercase; + font-size: 13px; + padding: 0 42px; + line-height: 49px; + height: 50px; + transition: all 0.21s ease; +} + +.mec-slider-t4-content.mec-event-grid-modern .mec-booking-button:hover { + background: #fff; + color: #000; + border-color: #fff; +} + +.mec-slider-t4-content.mec-event-grid-modern .mec-event-title a:hover, +.mec-slider-t4-content.mec-event-grid-modern + .mec-event-footer + .mec-booking-button:hover { + color: #111; +} + +.mec-slider-t4-wrap .mec-owl-theme .owl-nav .owl-prev, +.mec-slider-t4-wrap .mec-owl-theme .owl-nav .owl-next { + opacity: 1; + width: 44px; + height: 44px; + line-height: 40px; + border-radius: 0; + text-align: center; + background: transparent; + border: 1px solid #fff; + transition: all 0.25s ease; + -webkit-transition: all 0.25s ease; + position: absolute; + top: 34px; + cursor: pointer; +} + +.mec-slider-t4-wrap .mec-owl-theme .owl-nav .owl-prev:hover, +.mec-slider-t4-wrap .mec-owl-theme .owl-nav .owl-next:hover { + box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.075); + background: #fff; +} + +.mec-slider-t4-wrap .mec-owl-theme .owl-nav .owl-next { + right: 60px; +} + +.mec-slider-t4-wrap .mec-owl-theme .owl-nav .owl-prev { + right: 112px; +} + +.mec-slider-t4-wrap .mec-owl-theme .owl-nav .owl-prev i, +.mec-slider-t4-wrap .mec-owl-theme .owl-nav .owl-next i { + font-size: 14px; + color: #fff; + opacity: 1; + transition: all 0.25s ease; +} + +.mec-slider-t4-wrap .mec-owl-theme .owl-nav .owl-prev:hover i, +.mec-slider-t4-wrap .mec-owl-theme .owl-nav .owl-next:hover i { + color: #000; + cursor: pointer; +} + +@media only screen and (max-width: 767px) { + .mec-slider-t4 .mec-slider-t4-content { + width: 100%; + left: 0; + top: auto; + bottom: 0; + } + + .mec-slider-t4-content.mec-event-grid-modern .mec-event-title { + font-size: 22px; + } + + .mec-slider-t1-content.mec-event-grid-modern + .event-grid-modern-head + .mec-event-day { + font-size: 25px; + } +} + +/* MEC Slider 5 + -------------------------------- */ +.mec-slider-t5-wrap { + width: auto; + max-width: 570px; + padding: 0; + margin: 0 auto 25px; + background: #f7f7f7; + min-height: 480px; + position: relative; +} + +.mec-slider-t5 { + height: auto; + box-shadow: 0 5px 35px 0 rgba(0, 0, 0, 0.13); +} + +.mec-slider-t5 .mec-event-article { + position: relative; + height: auto; +} + +.mec-slider-t5 .mec-slider-t5-img { + position: relative; + background-size: cover !important; + background-position: center !important; + width: 100%; + height: 300px; + float: none; + margin: 0; + overflow: hidden; +} + +.mec-slider-t5 .mec-slider-t5-content { + width: 100%; + float: none; + height: 100%; + background: #fff; + padding: 0 20px 20px; + margin-bottom: 0; +} + +.mec-slider-t5 .mec-events-content p { + margin-bottom: 20px; +} + +.mec-slider-t5-content.mec-event-grid-modern .mec-event-article { + border: none; + padding: 0; + margin: 0; + box-shadow: none; +} + +.mec-slider-t5-wrap .mec-event-grid-modern .event-grid-modern-head { + margin-bottom: 10px; + padding: 14px 34px; + margin-left: -20px; + margin-right: -20px; + text-align: left; + background: #f9f9f9; + border-bottom: 1px solid #eee; +} + +.mec-slider-t5-content.mec-event-grid-modern .mec-event-title { + font-size: 29px; +} + +.mec-slider-t5 .mec-slider-t5-col6 { + width: 50%; + float: left; + height: 100%; +} + +.mec-slider-t5 .mec-slider-t5-col6 i { + font-size: 42px; + float: left; + margin-right: 7px; + height: 58px; +} + +.mec-slider-t5 .mec-slider-t5-col6 h6 { + text-transform: uppercase; + font-size: 17px; + padding: 4px 0; + display: inline; + color: #444; +} + +.mec-slider-t5 .mec-slider-t5-col6 address { + font-size: 12px; + margin-bottom: 0; +} + +.mec-slider-t5-content.mec-event-grid-modern .mec-event-title a:hover { + text-decoration: underline; +} + +.mec-slider-t5-content.mec-event-grid-modern + .mec-event-footer + .mec-booking-button { + font-size: 12px; + padding: 0 31px; + line-height: 49px; + height: 50px; + top: 0; +} + +.mec-slider-t5-wrap .mec-owl-theme .owl-nav .owl-prev, +.mec-slider-t5-wrap .mec-owl-theme .owl-nav .owl-next { + opacity: 1; + width: 44px; + height: 44px; + line-height: 40px; + border-radius: 0; + text-align: center; + background: transparent; + border: 1px solid #fff; + transition: all 0.25s ease; + -webkit-transition: all 0.25s ease; + position: absolute; + top: 34px; + cursor: pointer; +} + +.mec-slider-t5-wrap .mec-owl-theme .owl-nav .owl-prev:hover, +.mec-slider-t5-wrap .mec-owl-theme .owl-nav .owl-next:hover { + box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.075); + background: #fff; +} + +.mec-slider-t5-wrap .mec-owl-theme .owl-nav .owl-next { + right: 30px; +} + +.mec-slider-t5-wrap .mec-owl-theme .owl-nav .owl-prev { + right: 82px; +} + +.mec-slider-t5-wrap .mec-owl-theme .owl-nav .owl-prev i, +.mec-slider-t5-wrap .mec-owl-theme .owl-nav .owl-next i { + font-size: 14px; + color: #fff; + opacity: 1; + transition: all 0.25s ease; +} + +.mec-slider-t5-wrap .mec-owl-theme .owl-nav .owl-prev:hover i, +.mec-slider-t5-wrap .mec-owl-theme .owl-nav .owl-next:hover i { + color: #000; + cursor: pointer; +} + +@media only screen and (max-width: 768px) { + .mec-slider-t5 .mec-slider-t5-col6 { + width: 100%; + margin: 10px 0; + } +} + +@media only screen and (max-width: 479px) { + .mec-slider-t5-content.mec-event-grid-modern .mec-event-title { + font-size: 24px; + } +} + +/* MEC Single Modern + -------------------------------- */ +.mec-single-modern .mec-events-event-image { + text-align: center; +} + +.mec-single-modern .mec-events-event-image img { + width: 100%; +} + +.mec-single-modern .mec-single-event-bar { + margin: 20px 0 0; + padding: 15px; + display: table; + width: 100%; + background: #fff; + border: 1px solid #e6e6e6; +} + +.mec-single-modern .mec-single-event-bar > div { + display: table-cell; +} + +.mec-single-modern .mec-single-event-bar > div i { + font-size: 20px; + vertical-align: middle; +} + +.mec-single-modern .mec-single-event-bar > div .mec-time-comment { + font-size: 12px; + color: #999; +} + +.mec-single-modern .mec-single-event-bar > div h3 { + text-transform: uppercase; + font-size: 16px; + font-weight: bold; + padding-bottom: 5px; + display: inline; + color: #000; + padding-left: 10px; +} + +.mec-single-modern .mec-single-event-bar > div dd { + font-size: 14px; + color: #8d8d8d; + padding-left: 34px; + margin-bottom: 0; +} + +.mec-single-modern .col-md-4 .mec-sponsors-details, +.mec-single-modern .col-md-4 .mec-frontbox { + margin-top: -50px; + margin-bottom: 70px; + padding: 20px; + border: 1px solid #e6e6e6; + box-shadow: none; +} + +.mec-single-modern .col-md-4.mec-no-image .mec-frontbox { + margin-top: 20px; +} + +.mec-next-occurrence ul { + padding-left: 0; + margin-left: 0; +} + +.mec-next-occurrence li { + list-style: none; +} + +@media only screen and (min-width: 960px) { + .mec-single-modern .col-md-4 .mec-sponsors-details, + .mec-single-modern .col-md-4 .mec-frontbox { + margin-left: 20px; + } + + .featherlight-content .col-md-4 .mec-sponsors-details { + margin-left: 0; + margin-bottom: 15px; + } +} + +@media only screen and (max-width: 960px) { + .mec-single-modern .mec-single-event-bar > div { + display: block; + } +} + +.lity-content > div { + overflow: auto; + max-height: 80vh !important; +} + +.mec-next-event-details li { + list-style: none; + margin-top: 20px; +} + +.mec-next-event-details h6 { + text-transform: uppercase; + font-size: 13px; + padding-bottom: 5px; + display: inline; + color: #222; + padding-left: 0; +} + +.mec-next-event-details abbr { + display: block; + padding-left: 0; + color: #8d8d8d; +} + +.mec-next-event-details i { + margin-right: 10px; + margin-left: 12px; +} + +.mec-next-event-details i:before { + color: #40d9f1; +} + +.mec-next-event-details a { + text-align: center; + display: block; + background: #fff; + padding: 6px 0; + font-size: 11px; + font-weight: 400; + letter-spacing: 0; + border: 1px solid #e3e3e3; + transition: 0.3s; +} + +.mec-active-occurrence-button { + margin-top: 20px; +} + +/* MEC Single Modal + -------------------------------- */ +.mec-single-modal.mec-single-modern .mec-single-title { + text-align: center; + padding: 15px 10px 0; +} + +.admin-bar .mec-single-modal.mec-single-modern .mec-single-title { + padding-top: 40px; +} + +.mec-single-modal.mec-single-modern .mec-single-event-bar { + width: calc(100% - 30px); + margin: 0 auto 15px; + padding: 5px; +} + +.mec-single-modal.mec-single-modern .mec-events-event-image { + width: calc(100% - 30px); + margin: 0 auto; +} + +.mec-single-modal.mec-single-modern .mec-single-event-bar > div dd { + font-size: 13px; +} + +.mec-single-modal.mec-single-modern .mec-single-event-bar > div h3 { + font-size: 15px; +} + +@media only screen and (min-width: 960px) { + .mec-single-modal.mec-single-modern .col-md-4 .mec-frontbox { + margin-left: 0; + } +} + +.mec-single-modal.mec-single-modern .col-md-4 .mec-frontbox { + margin-top: 10px; + margin-bottom: 10px; +} + +.mec-single-modal.mec-single-modern .col-md-4 .mec-frontbox.mec-event-meta { + padding: 0; +} + +@media (min-width: 961px) { + .mec-single-event.mec-sticky { + position: relative; + } + + .mec-single-event.mec-sticky .col-md-4 { + position: -webkit-sticky; + position: sticky; + top: 120px; + } + + .mec-single-modern.mec-sticky .col-md-4 { + top: 170px; + } + + /* Margin on Sticky Sidebar */ + .single-mec-events .mec-sticky .col-md-8 > div:last-child { + margin-bottom: 30px; + } + + .single-mec-events .mec-single-modern.mec-sticky .col-md-8 > div:last-child { + margin-bottom: 70px; + } +} + +.mec-single-modal .mec-event-meta dd.mec-organizer-url a, +.mec-single-modal .mec-event-meta dd.mec-organizer-email a { + font-size: 12px; + display: block; +} + +.mec-organizer-description p { + padding-left: 12px; +} + +.mec-modal-wrap { + max-width: 90vw; + max-height: 90vh !important; + background: #fff; + box-shadow: 0 1px 55px rgba(0, 0, 0, 0.5); + overflow-x: hidden !important; +} + +@media (max-width: 1023px) { + .mec-modal-wrap { + max-width: 80vw; + } +} + +.mec-single-modal + .mec-event-export-module.mec-frontbox + .mec-event-exporting + .mec-export-details + ul + li, +.mec-single-modal + .mec-event-export-module.mec-frontbox + .mec-event-exporting + .mec-export-details + ul + li + a.mec-events-button { + display: block; + text-align: center; +} + +.mec-single-modal + .mec-event-export-module.mec-frontbox + .mec-event-exporting + .mec-export-details + ul + li:first-child { + margin-bottom: 20px; +} + +/* Expired and Ongoing Event Label */ +.mec-holding-status-expired { + color: #d8000c; +} + +.mec-holding-status-ongoing { + color: #0dbf52; +} + +/* Feather Light Modal */ + +body .featherlight { + z-index: 999999 !important; +} + +body .featherlight .featherlight-content { + background: transparent; + overflow: unset; + z-index: 9999; +} + +body .featherlight .featherlight-close-icon { + position: fixed; + top: 40px; + right: 40px; + background: transparent; + color: #fff; + border: 1px solid #fff; + border-radius: 0; +} + +body .featherlight .featherlight-close-icon:hover { + background: #fff; + color: #000; + border: 1px solid #000; +} + +/* filp-clock Responsive */ +@media (max-width: 320px) { + .mec-wrap span.flip-clock-divider { + width: 20px; + } + + .mec-single-event .mec-events-meta-group-countdown { + padding: 15px 12%; + } +} + +@media only screen and (min-width: 320px) and (max-width: 767px) { + .mec-wrap .flip-clock-wrapper ul { + padding: 0; + } +} + +@media (max-width: 414px) { + .mec-wrap span.flip-clock-divider { + width: 30px; + } + + .mec-single-event .mec-events-meta-group-countdown { + margin-left: 0; + padding: 15px 7%; + } +} + +@media (max-width: 480px) { + body .featherlight .featherlight-content { + width: 95%; + } + + .mec-wrap span.flip-clock-divider { + width: 7px; + } + + .mec-single-event .mec-events-meta-group-countdown { + margin-left: 0; + padding: 15px 1%; + } + + /* Close Button - Feather Light Modal */ + body .featherlight .featherlight-close-icon { + color: #000; + border-color: #000; + } +} + +@media (max-width: 1366px) { + body .mec-modal-wrap .mec-single-modal .flip-clock-divider:not(:first-child) { + width: 20px !important; + } + + body .mec-modal-wrap .mec-single-modal .mec-events-meta-group-countdown { + padding: 20px 15px; + } + + body .mec-modal-wrap .mec-single-modal .flip-clock-wrapper ul { + width: 48px; + } +} + +@media (max-width: 1280px) { + body .mec-modal-wrap .mec-single-modal .flip-clock-divider:not(:first-child) { + width: 14px !important; + } + + body .mec-modal-wrap .mec-single-modal .mec-events-meta-group-countdown { + padding: 15px 10px; + } + + body .mec-modal-wrap .mec-single-modal .flip-clock-wrapper ul { + width: 38px; + } +} + +@media (min-width: 961px) and (max-width: 1024px) { + body .mec-modal-wrap .mec-single-modal .flip-clock-divider:not(:first-child) { + width: 7px !important; + } + + body .mec-modal-wrap .mec-single-modal .mec-events-meta-group-countdown { + padding: 15px 5px; + } + + body .mec-modal-wrap .mec-single-modal .flip-clock-wrapper ul { + width: 14px; + } + + body .mec-modal-wrap .mec-single-modal .flip-clock-wrapper ul li a div { + font-size: 30px; + } +} + +@media (max-width: 640px) { + body .mec-modal-wrap .mec-single-modal.featherlight-close-icon { + top: 14px; + right: 14px; + } +} + +@media (max-width: 480px) { + .featherlight .featherlight-content, + body .mec-modal-wrap { + max-width: 100%; + } + + body .mec-modal-wrap.flip-clock-divider .flip-clock-label { + display: block; + } +} + +@media (max-width: 414px) { + body .mec-modal-wrap .mec-single-modal .flip-clock-divider:not(:first-child) { + width: 50px !important; + } + + .mec-wrap .flip-clock-divider .flip-clock-label { + display: none; + } + + body .mec-modal-wrap .mec-single-modal .mec-events-meta-group-countdown { + padding: 20px 5px 20px 65px; + } + + body + .featherlight-content + .mec-modal-wrap + .mec-single-modal + .mec-events-meta-group-countdown { + padding: 20px 2px 20px 2px !important; + } + + body + .featherlight-content + .mec-modal-wrap + .mec-single-modal + .flip-clock-divider:not(:first-child) { + width: 3px !important; + } +} + +@media (max-width: 375px) { + body .mec-modal-wrap .mec-single-modal .flip-clock-divider:not(:first-child) { + width: 50px !important; + } + + .mec-wrap .flip-clock-divider .flip-clock-label { + display: none; + } + + body .mec-modal-wrap .mec-single-modal .mec-events-meta-group-countdown { + padding: 20px 5px 20px 45px; + } +} + +@media (max-width: 320px) { + body .mec-modal-wrap .mec-single-modal .flip-clock-divider:not(:first-child) { + width: 20px !important; + } + + body .mec-modal-wrap .mec-single-modal .mec-events-meta-group-countdown { + padding: 20px 5px 20px 40px; + } +} + +/* Other themes conflict fix on MEC */ +.mec-single-event-bar dd { + margin-left: 0; +} + +/* MEC Toggle List + -------------------------------- */ +.mec-events-toggle { + max-width: 960px; + margin-left: auto; + margin-right: auto; +} + +.mec-events-toggle .mec-toggle-item { + border: 1px solid #e4e4e4; + margin-bottom: 15px; + box-shadow: 0 10px 15px #f3f3f3; +} + +.mec-events-toggle .mec-toggle-item-inner { + cursor: pointer; + position: relative; + padding: 30px 60px 30px 15px; + background: #fff; + transition: all 0.3s ease; + min-height: 100px; + display: table; + width: 100%; + border-collapse: separate; +} + +.mec-events-toggle .mec-toggle-item-inner:hover { + background: #fbfbfb; +} + +.mec-toggle-item-col { + width: 200px; + border-right: 1px solid #e3e3e3; + margin-right: 15px; + display: table-cell; + padding-right: 5px; +} + +.mec-toggle-item-col .mec-event-date { + font-size: 38px; + line-height: 40px; + float: left; + margin-right: 8px; +} + +.mec-toggle-item-col .mec-event-month, +.mec-toggle-item-col .mec-time-details { + text-transform: uppercase; + font-size: 12px; + line-height: 14px; + padding-top: 4px; + font-weight: 700; +} + +.mec-toggle-item-col .mec-event-detail { + font-size: 10px; +} + +.mec-toggle-item-col .mec-event-day { + margin-top: 9px; + color: #c0c0c0; + font-size: 35px; + font-weight: 100; + text-transform: uppercase; + letter-spacing: -1px; +} + +.mec-events-toggle .mec-toggle-title { + color: #000; + font-size: 23px; + font-weight: 600; + margin-bottom: 0; + transition: all 0.3s ease; + display: table-cell; + text-align: left; + max-width: calc(100% - 200px); + padding-left: 15px; + vertical-align: middle; +} + +.mec-events-toggle .mec-toggle-item-inner span.event-color { + width: 5px; + height: 100%; + position: absolute; + left: -1px; + top: 0; + bottom: 0; + border-radius: 0; + margin: 0; +} + +.mec-events-toggle .mec-toggle-item-inner i { + position: absolute; + font-size: 30px; + right: 25px; + top: 50%; + transform: translate(0, -50%); + cursor: pointer; +} + +.mec-events-toggle .mec-toggle-item.is-open i.mec-sl-plus:before { + content: "\e615"; +} + +.mec-events-toggle .mec-toggle-item.is-open .mec-toggle-title { + background: #f8f8f8; + cursor: pointer; +} + +.mec-events-toggle .mec-toggle-content { + border-top: 1px solid #e4e4e4; +} + +.mec-events-toggle .mec-toggle-content .mec-modal-wrap { + margin: 0; + max-width: 100%; + box-shadow: none; +} + +.mec-events-toggle .mec-toggle-content .mec-modal-wrap .mec-single-event { + margin: 0; +} + +.mec-events-toggle .mec-toggle-content h1.mec-single-title, +.mec-events-toggle .mec-toggle-content .mec-single-event-bar { + display: none; +} + +.mec-events-toggle .media-links a { + margin-bottom: 0; +} + +.mec-events-toggle .mec-toggle-content .mec-toggle-meta { + margin-bottom: 14px; +} + +.mec-events-toggle .mec-toggle-content .mec-frontbox { + padding: 12px 14px 8px; +} + +.mec-events-toggle .mec-toggle-content .mec-frontbox .mec-speakers-details { + border: none; +} + +.mec-events-toggle .mec-toggle-content .mec-frontbox .mec-speakers-details ul { + padding-left: 0; +} + +.mec-events-toggle #mec_speakers_details.mec-frontbox { + padding: 0; + margin: 0; +} + +.mec-events-toggle .mec-toggle-item h3.mec-speakers { + border: none; + text-align: left; + margin-bottom: 20px; +} + +.mec-events-toggle .mec-toggle-item h3.mec-speakers:before { + content: "\e063"; + font-family: simple-line-icons; + border: none; + position: relative; + display: inline-block; + left: 3px; + bottom: unset; + font-size: 22px; + font-weight: normal; + padding: 0 11px 0 28px; + vertical-align: middle; +} + +.mec-events-toggle .mec-event-data-fields.mec-frontbox { + border: none; + padding: 0; + overflow: visible; +} + +@media only screen and (max-width: 767px) { + .mec-toggle-item-inner .mec-toggle-item-col { + float: none; + width: 100%; + border-right: none; + margin-bottom: 5px; + display: block; + max-width: 100%; + padding-left: 15px; + } + + .mec-events-toggle .mec-toggle-title { + display: block; + width: 100%; + max-width: 100%; + } +} + +/* MEC Agenda View + -------------------------------- */ +.mec-events-agenda-wrap { + margin: 10px 0; + border: 1px solid #e9e9e9; + background: #fff; + padding-left: 20px; + box-shadow: 0 2px 2px rgba(0, 0, 0, 0.03); +} + +.mec-events-agenda { + padding: 0; + border-bottom: 1px solid #e9e9e9; +} + +.mec-agenda-date-wrap { + width: 210px; + padding-top: 15px; + float: left; + font-size: 13px; +} + +.mec-agenda-date-wrap i, +.mec-agenda-event i { + font-size: 11px; + color: #aaa; + margin-right: 4px; + margin-left: 1px; +} + +.mec-agenda-event i { + vertical-align: middle; + margin-right: 1px; +} + +.mec-agenda-events-wrap { + float: left; + width: calc(100% - 210px); + background: #f9f9f9; + padding: 15px; +} + +.mec-agenda-event { + margin-bottom: 10px; +} + +.mec-agenda-time { + font-size: 11px; + color: #707070; + padding-right: 10px; + width: 138px; + display: inline-block; +} + +.mec-agenda-event-title { + position: relative; + padding-left: 14px; +} + +.mec-agenda-event-title a { + font-size: 14px; + font-weight: 600; + color: #333; +} + +.mec-agenda-event-title span.event-color { + width: 9px; + height: 9px; + position: absolute; + left: 0; + top: 6px; + margin: 0; +} + +.mec-agenda-date-wrap span.mec-agenda-day { + color: #aaa; + font-size: 12px; +} + +@media only screen and (max-width: 767px) { + .mec-agenda-date-wrap, + .mec-agenda-events-wrap { + float: none; + width: 100%; + } + + .mec-events-agenda-wrap { + padding-left: 0; + } + + .mec-events-agenda span.mec-agenda-event-title { + display: block; + width: 100%; + } + + .mec-agenda-event-title span.event-color { + top: 7px; + } + + .mec-agenda-event-title a { + font-size: 13px; + } +} + +/* MEC Yearly View + -------------------------------- */ +.mec-yearly-view-wrap { + margin: 0 0 15px; + border: 1px solid #e6e6e6; + background: #fff; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04); + border-bottom-width: 4px; +} + +.mec-yearly-view-wrap .mec-calendar.mec-yearly-calendar { + max-width: 100%; + width: 232px; + padding: 10px; + background: #fff; + margin: 10px; + display: inline-block; +} + +.mec-yearly-view-wrap .mec-calendar.mec-yearly-calendar dl dt { + transition: none; + height: 30px; + width: 30px; + line-height: 30px; + border-radius: 0; + font-size: 12px; +} + +.mec-yearly-view-wrap + .mec-calendar.mec-yearly-calendar + .mec-calendar-events-sec { + padding: 10px; +} + +.mec-yearly-view-wrap .mec-calendar.mec-yearly-calendar .mec-has-event:after { + width: 4px; + height: 4px; + bottom: 3px; + margin-left: -2px; +} + +.mec-yearly-view-wrap .mec-calendar-side .mec-calendar-table { + min-height: 200px; +} + +.mec-calendar.mec-yearly-calendar .mec-calendar-table-head dl dt { + background: #f9f9f9; + font-size: 13px; +} + +.mec-calendar.mec-yearly-calendar .mec-calendar-table-title { + text-align: center; + font-size: 15px; + font-weight: 700; + color: #222; + margin-top: -5px; + padding-bottom: 5px; +} + +.mec-yearly-view-wrap .mec-yearly-calendar-sec { + min-height: 200px; + width: 538px; + overflow: hidden; + float: left; + background: #f8f8f8; + padding: 15px; +} + +.mec-yearly-view-wrap .mec-yearly-agenda-sec { + min-height: 200px; + width: calc(100% - 538px); + float: left; + padding: 0 0 0 20px; + overflow: hidden; +} + +.mec-yearly-view-wrap .mec-yearly-title-sec { + position: relative; + padding: 15px; + text-align: center; + border-bottom: 1px solid #e6e6e6; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02); +} + +.mec-yearly-view-wrap .mec-yearly-title-sec h2 { + font-size: 30px; + line-height: 40px; + color: #333; + margin: 0; + font-weight: 700; +} + +.mec-yearly-view-wrap .mec-yearly-title-sec .mec-previous-year, +.mec-yearly-view-wrap .mec-yearly-title-sec .mec-next-year { + position: absolute; + top: 50%; + margin-top: -15px; + min-width: 30px; + height: 30px; + line-height: 30px; + padding: 0 8px; + text-align: center; + background: #fff; + color: #666; + font-size: 14px; + border: 1px solid #eee; + border-radius: 2px; + box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.015); + transition: all 0.33s ease; + cursor: pointer; +} + +.mec-yearly-view-wrap .mec-yearly-title-sec .mec-previous-year { + right: auto; + left: 20px; + padding-right: 14px; +} + +.mec-yearly-view-wrap .mec-yearly-title-sec .mec-next-year { + left: auto; + right: 20px; + padding-left: 14px; +} + +.mec-yearly-view-wrap .mec-yearly-title-sec .mec-previous-year i, +.mec-yearly-view-wrap .mec-yearly-title-sec .mec-next-year i { + font-size: 12px; + color: #40d9f1; + cursor: pointer; +} + +.mec-yearly-view-wrap .mec-events-agenda.mec-selected { + box-shadow: -10px 0 0 0 #fffcf2, 0 -1px 0 #fbebb6; + background: #fffcf2; + border-color: #fbebb6; + color: #f9af29; +} + +.mec-yearly-agenda-sec span.mec-event-label-captions.mec-fc-style { + right: 0; + top: 0; +} + +@media only screen and (max-width: 959px) { + .mec-yearly-view-wrap .mec-yearly-calendar-sec { + width: 268px; + padding: 10px 5px; + } + + .mec-yearly-view-wrap .mec-yearly-agenda-sec { + width: calc(100% - 268px); + padding: 0 0 0 10px; + } +} + +@media only screen and (max-width: 767px) { + .mec-yearly-view-wrap .mec-yearly-calendar-sec, + .mec-yearly-view-wrap .mec-yearly-agenda-sec { + width: 100%; + float: none; + } + + .mec-yearly-view-wrap .mec-calendar.mec-yearly-calendar { + width: auto; + } + + .mec-yearly-view-wrap .mec-calendar.mec-yearly-calendar dl dt { + width: 14.2%; + } + + .mec-yearly-view-wrap .mec-yearly-title-sec h2 { + font-size: 25px; + } +} + +/* agenda in yearly view */ +.mec-yearly-view-wrap .mec-agenda-time, +.mec-yearly-view-wrap .mec-agenda-event i { + display: none; +} + +@media only screen and (min-width: 768px) { + .mec-yearly-view-wrap .mec-events-agenda-wrap { + margin-top: 0; + border: none; + padding-left: 0; + box-shadow: none; + } + + .mec-yearly-view-wrap .mec-agenda-date-wrap { + width: 174px; + font-size: 11px; + padding-top: 10px; + } + + .mec-yearly-view-wrap .mec-agenda-events-wrap { + width: calc(100% - 174px); + padding: 10px; + } + + .mec-yearly-view-wrap .mec-agenda-event-title a { + font-size: 13px; + } + + .mec-yearly-view-wrap .mec-agenda-event-title span.event-color { + width: 8px; + height: 8px; + } + + .mec-yearly-view-wrap .mec-agenda-date-wrap span.mec-agenda-day { + font-size: 11px; + } + + .mec-yearly-view-wrap .mec-yearly-calendar-sec { + box-shadow: -2px 0 5px rgba(0, 0, 0, 0.03) inset; + } +} + +@media only screen and (max-width: 1200px) { + .mec-yearly-view-wrap .mec-agenda-event-title a { + font-size: 12px; + padding-right: 6px; + } +} + +/* Timetable View + -------------------------------- */ +.mec-calendar.mec-calendar-timetable .mec-calendar-d-table { + padding-bottom: 10px; + border-bottom: none; +} + +.mec-calendar.mec-calendar-timetable .mec-calendar-d-table dl dt:hover { + cursor: pointer; +} + +.mec-calendar.mec-calendar-timetable + .mec-calendar-d-table + dl + dt.mec-timetable-has-no-event, +.mec-calendar.mec-calendar-timetable + .mec-calendar-d-table + dl + dt.mec-timetable-has-no-event:hover { + color: #bbb; + cursor: default; +} + +.mec-calendar.mec-calendar-timetable + .mec-calendar-d-table + dl + dt.mec-timetable-day-active { + background: #40d9f1; + color: #fff; + position: relative; +} + +.mec-calendar.mec-calendar-timetable + .mec-calendar-d-table + dl + dt.mec-timetable-day-active:after { + content: ""; + position: absolute; + display: block; + bottom: -20px; + left: 50%; + margin-left: -10px; + width: 0; + border-width: 10px; + border-style: solid; + border-color: #40d9f1 transparent transparent transparent; +} + +.mec-week-events-container { + background: #fff; +} + +.mec-timetable-events-list { + padding: 10px 20px; + border: none; + margin: 0; +} + +.mec-timetable-events-list .mec-timetable-event { + padding: 10px 0; + border-bottom: 1px dashed #ddd; +} + +.mec-timetable-events-list .mec-timetable-event:last-child { + border: none; +} + +.mec-timetable-event .mec-timetable-event-span { + font-size: 12px; + color: #444; + padding-right: 30px; + line-height: 22px; +} + +.mec-timetable-events-list .mec-timetable-event i { + font-size: 13px; + color: #aaa; + margin-right: 3px; + vertical-align: baseline; +} + +.mec-timetable-event .mec-timetable-event-span a { + color: #333; +} + +.mec-timetable-event .mec-timetable-event-time { + font-size: 11px; +} + +.mec-timetable-event .mec-timetable-event-time i { + vertical-align: text-bottom; +} + +.mec-timetable-event .mec-timetable-event-title { + font-size: 13px; +} + +.mec-timetable-event .mec-timetable-event-title .event-color { + width: 10px; + height: 10px; +} + +.mec-timetable-events-list .mec-timetable-event.mec-util-hidden { + display: none; +} + +.mec-timetable-events-list.mec-util-hidden { + display: none; +} + +@media only screen and (min-width: 768px) { + .mec-timetable-events-list { + display: table; + width: 100%; + margin: 10px 0 20px; + } + + .mec-timetable-events-list .mec-timetable-event { + display: table-row; + padding: 0; + border: none; + background: #fff; + } + + .mec-timetable-events-list .mec-timetable-event:hover { + background: #fafafa; + } + + .mec-timetable-event .mec-timetable-event-span { + display: table-cell; + padding: 10px 15px; + border-bottom: 1px solid #ebebeb; + } + + .mec-timetable-events-list + .mec-timetable-event:last-child + .mec-timetable-event-span { + border-bottom: none; + } +} + +@media only screen and (max-width: 767px) { + .mec-timetable-event .mec-timetable-event-title { + display: block; + width: 100%; + padding: 5px 0 10px; + font-weight: 700; + } +} + +/* Timetable View type 2 + -------------------------------- */ +.mec-timetable-t2-wrap { + border: 1px solid #e6e6e6; + background: #fafafa; + padding: 0 15px 15px; + overflow: hidden; + box-shadow: 0 3px 2px 0 rgba(0, 0, 0, 0.012); +} + +.mec-timetable-t2-col { + width: 20%; + float: left; + min-height: 20px; + padding-right: 1px; + background: none; +} + +.mec-ttt2-title { + background: #fafafa; + color: #333; + font-size: 13px; + font-weight: 600; + text-transform: uppercase; + letter-spacing: 1px; + text-align: center; + padding: 25px 10px 10px; + margin-bottom: 1px; +} + +.mec-timetable-t2-col .mec-event-article { + position: relative; +} + +.mec-timetable-t2-col .mec-event-article .event-color { + position: absolute; + width: auto; + height: auto; + left: 0; + right: 0; + top: 0; + bottom: 0; + margin: 0; + z-index: 1; + border-radius: 2px; +} + +.mec-timetable-t2-content { + position: relative; + z-index: 2; + color: #fff; + padding: 15px 15px 20px; + text-align: left; + height: auto; + margin-bottom: 1px; + overflow: hidden; +} + +.mec-timetable-t2-content .mec-event-title { + line-height: 22px; + margin-bottom: 13px; + white-space: nowrap; + padding-right: 1px; + overflow: hidden; +} + +.mec-timetable-t2-content .mec-event-title a { + color: #fff; + font-size: 15px; + font-weight: 600; + white-space: pre-line; + overflow: hidden; +} + +.mec-timetable-t2-content div { + color: #fff; + font-size: 11px; + font-weight: 400; + line-height: 19px; + white-space: nowrap; +} + +.mec-timetable-t2-content div i { + font-size: 12px; + margin-right: 4px; +} + +@media only screen and (max-width: 960px) { + .mec-timetable-t2-col { + width: 100%; + float: none; + } +} + +@media (min-width: 961px) { + .mec-timetable-col-7 { + width: 14.28%; + } + + .mec-timetable-col-6 { + width: 16.6666%; + } +} + +/* MEC Timetable Classic + -------------------------------- */ +.mec-timetable-t3-wrap td { + position: relative; + padding: 0; +} + +.mec-timetable-t3-wrap td a { + width: 100%; + display: block; + min-height: 110px; +} + +/* MEC Weather widget + -------------------------------- */ +.mec-weather-box { + padding: 15px 0; +} + +.mec-weather-head { + min-height: 90px; + padding: 5px 0; + clear: both; + overflow: hidden; + margin-bottom: 25px; + border-radius: 10px; + background: #238af5; + position: relative; +} + +.mec-weather-icon-box { + float: left; + width: 80px; + height: 80px; + border-radius: 10px; + overflow: hidden; + background: #238af5; +} + +.mec-weather-icon { + width: 80px; + height: 80px; + display: inline-block; + border-radius: 10px; +} + +.mec-weather-summary { + float: left; + width: calc(100% - 80px); + padding-left: 10px; + margin: 10px 0; + height: 60px; +} + +.mec-weather-summary-report { + font-size: 15px; + color: rgba(255, 255, 255, 0.68); + margin-bottom: 6px; +} + +.mec-weather-summary-temp { + font-weight: 300; + color: #fff; + font-size: 29px; + line-height: 1; +} + +.degrees-mode { + background: rgba(0, 0, 0, 0.2); + cursor: pointer; + font-weight: 300; + font-size: 18px; + padding: 4px 5px; + line-height: 1; + color: #fff; + position: absolute; + border-radius: 8px; + bottom: 16px; + left: 16px; +} + +.mec-weather-extras { + width: auto; + padding: 10px 15px 0 15px; + float: right; + min-height: 80px; + color: #fff; + font-size: 13px; + line-height: 1; +} + +.mec-weather-extras { + width: auto; + padding: 10px 15px 0 15px; + float: right; + min-height: 80px; + color: #fff; + font-size: 13px; + line-height: 1; +} + +.mec-weather-extras div { + line-height: 20px; + height: 20px; +} + +.mec-weather-extras span { + color: rgba(255, 255, 255, 0.68); + font-size: 12px; + text-transform: uppercase; +} + +.mec-weather-extras var { + font-size: 11px; + letter-spacing: 0.4px; +} + +/* weather icons */ +.mec-weather-icon.clear-day, +.mec-weather-icon.clear-night { + background-image: url(../img/mec-weather-icon-01.png); +} + +.mec-weather-icon.partly-sunny-day, +.mec-weather-icon.partly-sunny-night { + background-image: url(../img/mec-weather-icon-02.png); +} + +.mec-weather-icon.partly-cloudy-day, +.mec-weather-icon.partly-cloudy-night { + background-image: url(../img/mec-weather-icon-03.png); +} + +.mec-weather-icon.cloudy, +.mec-weather-icon.fog, +.mec-weather-icon.wind { + background-image: url(../img/mec-weather-icon-04.png); +} + +.mec-weather-icon.thunderstorm { + background-image: url(../img/mec-weather-icon-05.png); +} + +.mec-weather-icon.rain { + background-image: url(../img/mec-weather-icon-06.png); +} + +.mec-weather-icon.snow, +.mec-weather-icon.hail, +.mec-weather-icon.sleet { + background-image: url(../img/mec-weather-icon-07.png); +} + +/* MEC Available spot + -------------------------------- */ +.mec-av-spot-wrap { + width: auto; + max-width: 1200px; + padding: 0; + margin: 0 auto 25px; + background: #f7f7f7; + min-height: 480px; + position: relative; +} + +.mec-av-spot { + height: auto; + border: 1px solid #eee; + box-shadow: 0 6px 12px -4px rgba(0, 0, 0, 0.05); +} + +.mec-av-spot .mec-event-article { + position: relative; + height: auto; +} + +.mec-av-spot .mec-av-spot-img { + position: relative; + background-size: cover !important; + background-position: center !important; + width: 100%; + height: 330px; + float: none; + margin: 0; + overflow: hidden; +} + +.mec-av-spot .mec-av-spot-content, +.mec-av-spot .mec-av-spot-head { + width: 100%; + float: none; + height: 100%; + background: #fff; + padding: 0 20px 20px; + margin-bottom: 0; +} + +.mec-av-spot .mec-av-spot-head { + background: #222; + color: #fff; + min-height: 80px; +} + +.mec-av-spot .mec-av-spot-head .mec-av-spot-box { + padding-top: 25px; + font-size: 13px; + color: #ddd; +} + +.mec-av-spot .mec-av-spot-head .mec-av-spot-box span { + color: #40d9f1; + font-size: 40px; + font-weight: bold; + font-style: italic; +} + +.mec-av-spot .mec-av-spot-head .mec-event-countdown { + text-align: center; + padding-top: 10px; + display: table; + table-layout: fixed; + margin: 0 auto; + float: right; +} + +.mec-av-spot .mec-av-spot-head .mec-event-countdown li { + display: table-cell; + padding: 10px 20px; + position: relative; + height: 60px; +} + +.mec-av-spot .mec-av-spot-head .mec-event-countdown p { + margin-bottom: 0; +} + +.mec-av-spot .mec-events-content p { + margin-bottom: 20px; +} + +.mec-av-spot-content.mec-event-grid-modern .mec-event-article { + border: none; + padding: 0; + margin: 0; + box-shadow: none; +} + +.mec-av-spot-wrap .mec-event-grid-modern .event-grid-modern-head { + margin-bottom: 10px; + padding: 14px 34px; + margin-left: -20px; + margin-right: -20px; + text-align: left; + background: #f9f9f9; + border-bottom: 1px solid #eee; +} + +.mec-av-spot-content.mec-event-grid-modern .mec-event-title { + font-size: 29px; +} + +.mec-av-spot .mec-av-spot-col6 { + width: 50%; + float: left; + height: 100%; +} + +.mec-av-spot .mec-av-spot-col6 i { + font-size: 42px; + float: left; + margin-right: 7px; + height: 58px; +} + +.mec-av-spot .mec-av-spot-col6 h6 { + text-transform: uppercase; + font-size: 17px; + padding: 4px 0; + display: inline; + color: #444; +} + +.mec-av-spot .mec-av-spot-col6 address { + font-size: 12px; + margin-bottom: 0; +} + +.mec-av-spot-content.mec-event-grid-modern .mec-event-title a:hover { + text-decoration: underline; +} + +.mec-av-spot-content.mec-event-grid-modern + .mec-event-footer + .mec-booking-button { + font-size: 12px; + padding: 0 31px; + line-height: 49px; + height: 50px; + top: 0; + box-shadow: 0 5px 11px -3px rgba(0, 0, 0, 0.05); +} + +@media only screen and (max-width: 768px) { + .mec-av-spot .mec-av-spot-col6 { + width: 100%; + margin: 10px 0; + } +} + +@media only screen and (max-width: 479px) { + .mec-av-spot-content.mec-event-grid-modern .mec-event-title { + font-size: 24px; + } +} + +/* MEC Masonry + -------------------------------- */ +.mec-events-masonry-wrap { + display: block; + width: auto; +} + +.mec-masonry-item-wrap { + width: calc(33.33% - 30px); + padding: 0; + margin: 0 15px 30px; + min-height: 10px; + position: relative; + float: left; +} + +.mec-events-masonry-cats { + padding: 10px; + margin-bottom: 25px; + text-align: center; + clear: both; + list-style: none outside none; +} + +.mec-events-masonry-cats a { + border-radius: 2px; + padding: 6px 12px; + font-size: 13px; + line-height: 1.2; + color: #333; + font-weight: normal; + margin-top: 0 !important; + text-align: center; + display: inline-block; + width: auto; + border: 2px solid transparent; + transition: all 0.2s ease; +} + +.mec-events-masonry-cats a:hover { + border-color: #40d9f1; + color: #333; +} + +.mec-events-masonry-cats a.mec-masonry-cat-selected { + border: 2px solid #40d9f1; + color: #40d9f1; +} + +.mec-masonry { + background: #f7f7f7; + height: auto; + border: 1px solid #eee; + box-shadow: 0 6px 12px -4px rgba(0, 0, 0, 0.05); +} + +.mec-masonry .mec-event-article { + position: relative; + height: auto; +} + +.mec-masonry .mec-masonry-img { + position: relative; + width: 100%; + height: auto; + float: none; + margin: 0; + overflow: hidden; +} + +.mec-masonry .mec-masonry-img img { + width: 100%; +} + +.mec-masonry .mec-masonry-content, +.mec-masonry .mec-masonry-head { + width: 100%; + float: none; + height: 100%; + background: #fff; + padding: 0 20px 20px; + margin-bottom: 0; +} + +.mec-masonry .mec-events-content p { + margin-bottom: 20px; +} + +.mec-masonry-content.mec-event-grid-modern .mec-event-article { + border: none; + padding: 0; + margin: 0; + box-shadow: none; +} + +.mec-masonry-item-wrap .mec-event-grid-modern .event-grid-modern-head { + min-height: 79px; + margin-bottom: 10px; + padding: 14px 5%; + margin-left: -20px; + margin-right: -20px; + text-align: left; + background: #f9f9f9; + border-bottom: 1px solid #eee; +} + +.mec-masonry-content.mec-event-grid-modern .mec-event-title { + font-size: 22px; +} + +.mec-masonry-content.mec-event-grid-modern .mec-event-content { + padding-top: 20px; +} + +@media (max-width: 480px) { + .mec-masonry-content.mec-event-grid-modern .mec-labels-normal { + display: block; + } +} + +.mec-masonry-content.mec-event-grid-modern .mec-event-footer { + height: auto; + display: flex; + gap: 10px; +} + +.mec-wrap + .mec-event-masonry + .mec-masonry-content.mec-event-grid-modern + .mec-event-footer + a { + position: static; + padding: 0; + flex: auto; + text-align: center; +} + +.mec-masonry .mec-masonry-col6 .mec-event-date { + font-size: 52px; + letter-spacing: -2px; + line-height: 41px; + vertical-align: top; +} + +.mec-masonry .mec-masonry-col6 { + width: 50%; + float: left; + height: 100%; +} + +.mec-masonry .mec-masonry-col6 i { + font-size: 24px; + float: left; + margin-right: 7px; + height: 50px; +} + +.mec-masonry .mec-masonry-col6 h6, +.mec-masonry .mec-masonry-col6 .mec-event-month { + text-transform: capitalize; + font-size: 15px; + padding: 4px 0; + display: inline; + color: #444; +} + +.mec-masonry .mec-masonry-col6 address, +.mec-masonry .mec-masonry-col6 .mec-event-detail { + font-size: 11px; + margin-bottom: 0; +} + +.mec-masonry-content.mec-event-grid-modern .mec-event-title a:hover { + text-decoration: underline; +} + +.mec-masonry-content.mec-event-grid-modern + .mec-event-footer + .mec-booking-button { + font-size: 12px; + line-height: 49px; + height: 50px; + box-shadow: 0 5px 11px -3px rgba(0, 0, 0, 0.05); +} + +@media only screen and (max-width: 960px) { + .mec-masonry-item-wrap { + width: calc(50% - 30px); + } +} + +@media only screen and (max-width: 768px) { + .mec-masonry .mec-masonry-col6 { + width: 100%; + margin: 10px 0; + } + + .mec-masonry-item-wrap { + width: calc(100% - 30px); + } +} + +@media only screen and (max-width: 479px) { + .mec-masonry-content.mec-event-grid-modern .mec-event-title { + font-size: 24px; + } +} + +.mec-wrap.mec-skin-masonry-container .mec-load-more-wrap { + position: unset; +} + +/* MEC Single Page CountDown + -------------------------------- */ + +/* event countdown */ +.btn-wrapper { + text-align: center; +} + +.countdown-wrapper .btn-wrapper { + padding-top: 10px; + padding-right: 0; +} + +.countdown-wrapper h5.countdown-message { + letter-spacing: 5px; + font-weight: 500; + font-size: 18px; +} + +.countdown-wrapper p, +.blox.dar .countdown-wrapper p { + color: #888; +} + +.countdown-wrapper a.button.black { + float: right; + margin-right: 0; +} + +/* event countdown-clock */ + +.mec-wrap .threedaydigits .days .flip-clock-label { + right: -100px; +} + +@media only screen and (min-width: 320px) and (max-width: 767px) { + .mec-wrap .flip-clock-wrapper ul { + width: 29px !important; + } + + .mec-wrap .flip-clock-wrapper ul li a div div.inn { + font-size: 25px !important; + } + + .mec-wrap .flip-clock-divider .flip-clock-label { + left: 0; + font-weight: 300; + } + + .mec-wrap span.flip-clock-divider { + width: 12px; + } +} + +@media only screen and (min-width: 320px) and (max-width: 480px) { + .mec-wrap .flip-clock-wrapper ul { + width: 29px !important; + } + + .mec-wrap .flip-clock-wrapper ul li a div div.inn { + font-size: 25px !important; + } + + .mec-wrap .flip-clock-divider .flip-clock-label { + display: none; + } + + .mec-wrap span.flip-clock-divider:first-child { + width: 0; + } + + .mec-wrap span.flip-clock-divider { + width: 5px; + } + + .mec-single-event .mec-events-meta-group-countdown { + margin-left: 0; + padding: 15px 18%; + } +} + +@media screen and (min-width: 960px) and (max-width: 1200px) { + .mec-wrap .threedaydigits ul { + height: 50px; + width: 47px; + } +} + +@media screen and (min-width: 480px) and (max-width: 768px) { + .mec-wrap .threedaydigits ul { + height: 48px; + width: 26px !important; + } + + .mec-wrap .threedaydigits .flip-clock-label { + font-size: 8px; + left: -8px; + } +} + +@media screen and (min-width: 320px) and (max-width: 480px) { + .mec-wrap .threedaydigits ul { + height: 48px; + width: 22px !important; + } +} + +/* reset */ +.mec-wrap .flip-clock-wrapper * { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + -ms-box-sizing: border-box; + -o-box-sizing: border-box; + box-sizing: border-box; + -webkit-backface-visibility: hidden; + -moz-backface-visibility: hidden; + -ms-backface-visibility: hidden; + -o-backface-visibility: hidden; + backface-visibility: hidden; +} + +.mec-wrap .flip-clock-wrapper a { + cursor: pointer; + text-decoration: none; + color: #ccc; +} + +.mec-wrap .flip-clock-wrapper a:hover { + color: #fff; +} + +.mec-wrap .flip-clock-wrapper ul { + list-style: none; +} + +.mec-wrap .flip-clock-wrapper.clearfix:before, +.flip-clock-wrapper.clearfix:after { + content: " "; + display: table; +} + +.mec-wrap .flip-clock-wrapper.clearfix:after { + clear: both; +} + +.mec-wrap .flip-clock-wrapper.clearfix { + *zoom: 1; +} + +/* main */ +.mec-wrap .flip-clock-wrapper { + font: normal 11px "helvetica neue", "helvetica", sans-serif; + -webkit-user-select: none; +} + +.mec-wrap .flip-clock-meridium { + background: none !important; + box-shadow: 0 0 0 !important; + font-size: 36px !important; +} + +.mec-wrap .flip-clock-meridium a { + color: #313333; +} + +.mec-wrap .flip-clock-wrapper { + text-align: center; + position: relative; + display: inline-block; + padding-bottom: 10px; +} + +.mec-wrap .flip-clock-wrapper:before, +.flip-clock-wrapper:after { + content: " "; + /* 1 */ + display: table; + /* 2 */ +} + +.mec-wrap .flip-clock-wrapper:after { + clear: both; +} + +/* skeleton */ +.mec-wrap .flip-clock-wrapper ul { + position: relative; + float: left; + margin: 2px; + width: 50px; + height: 50px; + font-size: 80px; + font-weight: bold; + line-height: 87px; + border-radius: 3px; + background: rgba(0, 0, 0, 0.21); +} + +.mec-wrap .flip-clock-wrapper ul li { + z-index: 1; + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + line-height: 54px; + text-decoration: none !important; +} + +.mec-wrap .flip-clock-wrapper ul li:first-child { + z-index: 2; +} + +.mec-wrap .flip-clock-wrapper ul li a { + display: block; + height: 100%; + -webkit-perspective: 200px; + -moz-perspective: 200px; + perspective: 200px; + margin: 0 !important; + overflow: visible !important; + cursor: default !important; +} + +.mec-wrap .flip-clock-wrapper ul li a div { + z-index: 1; + position: absolute; + left: 0; + width: 100%; + height: 50%; + font-size: 80px; + overflow: hidden; + outline: 1px solid transparent; +} + +.mec-wrap .flip-clock-wrapper ul li a div .shadow { + position: absolute; + width: 100%; + height: 100%; + z-index: 2; +} + +.mec-wrap .flip-clock-wrapper ul li a div.up { + -webkit-transform-origin: 50% 100%; + -moz-transform-origin: 50% 100%; + -ms-transform-origin: 50% 100%; + -o-transform-origin: 50% 100%; + transform-origin: 50% 100%; + top: 0; +} + +.mec-wrap .flip-clock-wrapper ul li a div.up:after { + content: ""; + position: absolute; + top: 24px; + left: 0; + z-index: 5; + width: 100%; + height: 3px; + background-color: rgba(0, 0, 0, 0.12); +} + +.mec-wrap .flip-clock-wrapper ul li a div.down { + -webkit-transform-origin: 50% 0; + -moz-transform-origin: 50% 0; + -ms-transform-origin: 50% 0; + -o-transform-origin: 50% 0; + transform-origin: 50% 0; + bottom: 0; + border-bottom-left-radius: 3px; + border-bottom-right-radius: 3px; +} + +.mec-wrap .flip-clock-wrapper ul li a div div.inn { + position: absolute; + left: 0; + z-index: 1; + width: 100%; + height: 200%; + color: #fff; + text-shadow: 0 0 2px rgba(0, 0, 0, 0.25); + text-align: center; + background-color: #40d9f1; + border-radius: 3px; + font-size: 48px; +} + +.mec-wrap .flip-clock-wrapper ul li a div.up div.inn { + top: 0; +} + +.mec-wrap .flip-clock-wrapper ul li a div.down div.inn { + bottom: 0; +} + +/* play */ +.mec-wrap .flip-clock-wrapper ul.play li.flip-clock-before { + z-index: 3; +} + +.mec-wrap .flip-clock-wrapper .flip { + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.17); +} + +.mec-wrap .flip-clock-wrapper ul.play li.flip-clock-active { + -webkit-animation: asd 0.5s 0.5s linear both; + -moz-animation: asd 0.5s 0.5s linear both; + animation: asd 0.5s 0.5s linear both; + z-index: 5; +} + +.mec-wrap .flip-clock-divider { + float: left; + display: inline-block; + position: relative; + width: 18px; + height: 62px; +} + +.mec-wrap .flip-clock-divider:first-child { + width: 0; +} + +.mec-wrap .flip-clock-dot { + display: none; + background: #323434; + width: 10px; + height: 10px; + position: absolute; + border-radius: 50%; + box-shadow: 0 0 5px rgba(0, 0, 0, 0.5); + left: 5px; +} + +.mec-wrap .flip-clock-divider .flip-clock-label { + position: absolute; + bottom: -1.5em; + right: -71px; + color: #101010; + font-weight: bold; + text-shadow: none; + text-transform: uppercase; +} + +.mec-wrap .blox.dark .flip-clock-divider .flip-clock-label { + color: #8a8a8a; +} + +.mec-wrap .flip-clock-divider.seconds .flip-clock-label { + right: -82px; +} + +.mec-wrap .flip-clock-dot.top { + top: 30px; +} + +.mec-wrap .flip-clock-dot.bottom { + bottom: 30px; +} + +@-webkit-keyframes asd { + 0% { + z-index: 2; + } + + 20% { + z-index: 4; + } + + 100% { + z-index: 4; + } +} + +@-moz-keyframes asd { + 0% { + z-index: 2; + } + + 20% { + z-index: 4; + } + + 100% { + z-index: 4; + } +} + +@-o-keyframes asd { + 0% { + z-index: 2; + } + + 20% { + z-index: 4; + } + + 100% { + z-index: 4; + } +} + +@keyframes asd { + 0% { + z-index: 2; + } + + 20% { + z-index: 4; + } + + 100% { + z-index: 4; + } +} + +.flip-clock-wrapper ul.play li.flip-clock-active .down { + z-index: 2; + -webkit-animation: turn 0.5s 0.5s linear both; + -moz-animation: turn 0.5s 0.5s linear both; + animation: turn 0.5s 0.5s linear both; +} + +@-webkit-keyframes turn { + 0% { + -webkit-transform: rotatex(90deg); + } + + 100% { + -webkit-transform: rotatex(0deg); + } +} + +@-moz-keyframes turn { + 0% { + -moz-transform: rotatex(90deg); + } + + 100% { + -moz-transform: rotatex(0deg); + } +} + +@-o-keyframes turn { + 0% { + -o-transform: rotatex(90deg); + } + + 100% { + -o-transform: rotatex(0deg); + } +} + +@keyframes turn { + 0% { + transform: rotatex(90deg); + } + + 100% { + transform: rotatex(0deg); + } +} + +.flip-clock-wrapper ul.play li.flip-clock-before .up { + z-index: 2; + -webkit-animation: turn2 0.5s linear both; + -moz-animation: turn2 0.5s linear both; + animation: turn2 0.5s linear both; +} + +@-webkit-keyframes turn2 { + 0% { + -webkit-transform: rotatex(0deg); + } + + 100% { + -webkit-transform: rotatex(-90deg); + } +} + +@-moz-keyframes turn2 { + 0% { + -moz-transform: rotatex(0deg); + } + + 100% { + -moz-transform: rotatex(-90deg); + } +} + +@-o-keyframes turn2 { + 0% { + -o-transform: rotatex(0deg); + } + + 100% { + -o-transform: rotatex(-90deg); + } +} + +@keyframes turn2 { + 0% { + transform: rotatex(0deg); + } + + 100% { + transform: rotatex(-90deg); + } +} + +.flip-clock-wrapper ul li.flip-clock-active { + z-index: 3; +} + +/* shadow */ +.flip-clock-wrapper ul.play li.flip-clock-before .up .shadow { + background: -moz-linear-gradient( + top, + rgba(0, 0, 0, 0.1) 0%, + rgba(64, 64, 64, 0.68) 100% + ); + background: -webkit-gradient( + linear, + left top, + left bottom, + color-stop(0%, rgba(0, 0, 0, 0.1)), + color-stop(100%, rgba(64, 64, 64, 0.68)) + ); + background: linear, top, rgba(0, 0, 0, 0.1) 0%, rgba(64, 64, 64, 0.68) 100%; + background: -o-linear-gradient( + top, + rgba(0, 0, 0, 0.1) 0%, + rgba(64, 64, 64, 0.68) 100% + ); + background: -ms-linear-gradient( + top, + rgba(0, 0, 0, 0.1) 0%, + rgba(64, 64, 64, 0.68) 100% + ); + background: linear, to bottom, rgba(0, 0, 0, 0.1) 0%, + rgba(64, 64, 64, 0.68) 100%; + -webkit-animation: show 0.5s linear both; + -moz-animation: show 0.5s linear both; + animation: show 0.5s linear both; +} + +.flip-clock-wrapper ul.play li.flip-clock-active .up .shadow { + background: -moz-linear-gradient( + top, + rgba(0, 0, 0, 0.1) 0%, + rgba(64, 64, 64, 0.68) 100% + ); + background: -webkit-gradient( + linear, + left top, + left bottom, + color-stop(0%, rgba(0, 0, 0, 0.1)), + color-stop(100%, rgba(64, 64, 64, 0.68)) + ); + background: linear, top, rgba(0, 0, 0, 0.1) 0%, rgba(64, 64, 64, 0.68) 100%; + background: -o-linear-gradient( + top, + rgba(0, 0, 0, 0.1) 0%, + rgba(64, 64, 64, 0.68) 100% + ); + background: -ms-linear-gradient( + top, + rgba(0, 0, 0, 0.1) 0%, + rgba(64, 64, 64, 0.68) 100% + ); + background: linear, to bottom, rgba(0, 0, 0, 0.1) 0%, + rgba(64, 64, 64, 0.68) 100%; + -webkit-animation: hide 0.5s 0.3s linear both; + -moz-animation: hide 0.5s 0.3s linear both; + animation: hide 0.5s 0.3s linear both; +} + +/*down*/ +.flip-clock-wrapper ul.play li.flip-clock-before .down .shadow { + background: -moz-linear-gradient( + top, + rgba(64, 64, 64, 0.68) 0%, + rgba(0, 0, 0, 0.1) 100% + ); + background: -webkit-gradient( + linear, + left top, + left bottom, + color-stop(0%, rgba(64, 64, 64, 0.68)), + color-stop(100%, rgba(0, 0, 0, 0.1)) + ); + background: linear, top, rgba(64, 64, 64, 0.68) 0%, rgba(0, 0, 0, 0.1) 100%; + background: -o-linear-gradient( + top, + rgba(64, 64, 64, 0.68) 0%, + rgba(0, 0, 0, 0.1) 100% + ); + background: -ms-linear-gradient( + top, + rgba(64, 64, 64, 0.68) 0%, + rgba(0, 0, 0, 0.1) 100% + ); + background: linear, to bottom, rgba(64, 64, 64, 0.68) 0%, + rgba(0, 0, 0, 0.1) 100%; + -webkit-animation: show 0.5s linear both; + -moz-animation: show 0.5s linear both; + animation: show 0.5s linear both; +} + +.flip-clock-wrapper ul.play li.flip-clock-active .down .shadow { + background: -moz-linear-gradient( + top, + rgba(64, 64, 64, 0.68) 0%, + rgba(0, 0, 0, 0.1) 100% + ); + background: -webkit-gradient( + linear, + left top, + left bottom, + color-stop(0%, rgba(64, 64, 64, 0.68)), + color-stop(100%, rgba(0, 0, 0, 0.1)) + ); + background: linear, top, rgba(64, 64, 64, 0.68) 0%, rgba(0, 0, 0, 0.1) 100%; + background: -o-linear-gradient( + top, + rgba(64, 64, 64, 0.68) 0%, + rgba(0, 0, 0, 0.1) 100% + ); + background: -ms-linear-gradient( + top, + rgba(64, 64, 64, 0.68) 0%, + rgba(0, 0, 0, 0.1) 100% + ); + background: linear, to bottom, rgba(64, 64, 64, 0.68) 0%, + rgba(0, 0, 0, 0.1) 100%; + -webkit-animation: hide 0.5s 0.3s linear both; + -moz-animation: hide 0.5s 0.3s linear both; + animation: hide 0.5s 0.2s linear both; +} + +@-webkit-keyframes show { + 0% { + opacity: 0; + } + + 100% { + opacity: 1; + } +} + +@-moz-keyframes show { + 0% { + opacity: 0; + } + + 100% { + opacity: 1; + } +} + +@-o-keyframes show { + 0% { + opacity: 0; + } + + 100% { + opacity: 1; + } +} + +@keyframes show { + 0% { + opacity: 0; + } + + 100% { + opacity: 1; + } +} + +@-webkit-keyframes hide { + 0% { + opacity: 1; + } + + 100% { + opacity: 0; + } +} + +@-moz-keyframes hide { + 0% { + opacity: 1; + } + + 100% { + opacity: 0; + } +} + +@-o-keyframes hide { + 0% { + opacity: 1; + } + + 100% { + opacity: 0; + } +} + +@keyframes hide { + 0% { + opacity: 1; + } + + 100% { + opacity: 0; + } +} + +@media only screen and (min-width: 320px) and (max-width: 480px) { + .single-mec-events .mec-wrap .flip-clock-wrapper { + padding-bottom: 0; + max-width: 218px; + } + + .single-mec-events .mec-wrap .mec-events-meta-group-countdown { + padding: 20px 10px 20px 10px; + } + + .mec-wrap .flip-clock-wrapper ul { + width: 25px !important; + padding: 0; + } + + .single-mec-events .mec-wrap .flip-clock-wrapper .flip { + margin-bottom: 40px; + } + + .single-mec-events .mec-wrap .flip-clock-divider .flip-clock-label { + display: block; + } + + .single-mec-events .mec-wrap .flip-clock-divider.days .flip-clock-label { + left: -15px; + } + + .single-mec-events .mec-wrap .flip-clock-divider.hours .flip-clock-label { + left: 0; + } + + .single-mec-events .mec-wrap .flip-clock-divider.minutes .flip-clock-label { + left: 0; + } + + .single-mec-events .mec-wrap .flip-clock-divider.seconds .flip-clock-label { + left: -15px; + } + + .single-mec-events .mec-wrap .flip-clock-wrapper { + max-width: unset; + } +} + +/* MEC Events - Extras + -------------------------------- */ +@font-face { + font-family: "simple-line-icons"; + src: url("../fonts/Simple-Line-Icons.eot?v=2.3.1"); + src: url("../fonts/Simple-Line-Icons.eot?v=2.3.1#iefix") + format("embedded-opentype"), + url("../fonts/Simple-Line-Icons.woff2?v=2.3.1") format("woff2"), + url("../fonts/Simple-Line-Icons.woff?v=2.3.1") format("woff"), + url("../fonts/Simple-Line-Icons.ttf?v=2.3.1") format("truetype"), + url("../fonts/Simple-Line-Icons.svg?v=2.3.1#simple-line-icons") + format("svg"); + font-weight: normal; + font-style: normal; +} + +[class*="mec-sl-"] { + font-family: "simple-line-icons"; + speak: none; + font-style: normal; + font-weight: normal; + font-variant: normal; + text-transform: none; + line-height: 1; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +.mec-sl-facebook:before { + content: "\e00b"; +} + +.mec-sl-twitter:before { + content: "\e009"; +} + +.mec-sl-google-plus:before { + content: "\e60d"; +} + +.mec-sl-angle-left:before { + content: "\e605"; +} + +.mec-sl-angle-right:before { + content: "\e606"; +} + +.mec-sl-calendar:before { + content: "\e075"; +} + +.mec-sl-clock-o:before { + content: "\e081"; +} + +.mec-sl-home:before { + content: "\e069"; +} + +.mec-sl-phone:before { + content: "\e600"; +} + +.mec-sl-envelope:before { + content: "\e086"; +} + +.mec-sl-sitemap:before { + content: "\e037"; +} + +.mec-sl-map-marker:before { + content: "\e096"; +} + +.mec-sl-floder:before { + content: "\e089"; +} + +.mec-sl-wallet:before { + content: "\e02a"; +} + +/* # Color Skins + ================================================== */ +/* colorskin-1 */ +.mec-color, +.mec-color-hover:hover, +.mec-color-before *:before, +.mec-wrap .mec-color, +.mec-wrap .mec-color-hover:hover, +.mec-wrap .mec-color-before *:before { + color: #40d9f1; +} + +.mec-bg-color, +.mec-bg-color-hover:hover, +.mec-wrap .mec-bg-color, +.mec-wrap .mec-bg-color-hover:hover { + background-color: #40d9f1; +} + +.mec-box-marker, +.mec-vip-content-notice { + box-shadow: 5px 0 0 #40d9f1 inset; + padding: 5px 10px; +} + +.mec-border-color, +.mec-border-color-hover:hover, +.mec-wrap .mec-border-color, +.mec-wrap .mec-border-color-hover:hover { + border-color: #40d9f1; +} + +/* # Toggle Month Divider + ================================================== */ +.mec-toggle-month-divider.mec-skin-list-events-container { + border: 1px solid #e8e8e8; + margin-bottom: 30px; + background: #f8f8f8; + box-shadow: 0 2px 18px -1px rgba(0, 0, 0, 0.1); + border-radius: 2px; +} + +.mec-toggle-month-divider .mec-month-divider { + margin: 0; + text-align: left; + background: #fff; + position: relative; + cursor: pointer; + border-top: 1px solid #e8e8e8; +} + +.mec-toggle-month-divider .mec-month-divider span { + padding: 20px; + border-bottom: 1px solid #e8e8e8; +} + +.mec-toggle-month-divider .mec-month-divider i { + position: absolute; + right: 20px; + top: 24px; + font-size: 20px; + cursor: pointer; +} + +.mec-toggle-month-divider .mec-month-divider span:before { + display: none; +} + +.mec-toggle-month-divider .mec-month-divider + article { + margin-top: 20px; +} + +.mec-toggle-month-divider .mec-wrap .mec-month-divider:first-of-type { + border-top: none; +} + +.mec-toggle-month-divider + .mec-event-list-accordion + .mec-month-divider:not(:first-of-type) + ~ article { + display: none; +} + +.mec-skin-list-events-container:not(.mec-toggle-month-divider) + .mec-month-divider + i { + display: none; +} + +.mec-month-divider { + display: flex; + align-items: center; +} + +.mec-month-divider:before, +.mec-month-divider:after { + content: ""; + flex: 1; + height: 4px; + background: #ebebeb; +} + +.mec-month-divider h5 { + font-size: 22px; + font-weight: 700; + text-transform: uppercase; + margin: 0 20px; +} + +.mec-month-divider i { + display: none; +} + +.mec-toogle-inner-month-divider .mec-toggle-item-col .mec-event-month { + display: inline-block; + padding-top: 0; +} + +.mec-toogle-inner-month-divider .mec-toggle-item-col .mec-event-date { + font-size: 14px; + line-height: 14px; + float: none; + display: inline-block; + margin-right: 0; + font-weight: 700; +} + +.mec-events-toggle .mec-toogle-inner-month-divider.mec-toggle-item-inner { + padding: 20px 60px 30px 15px; +} + +.mec-toogle-inner-month-divider .mec-toggle-month-inner-image { + float: left; + clear: right; + width: 100px; + margin-right: 20px; + margin-left: 10px; +} + +.mec-toogle-inner-month-divider .mec-toggle-item-col .mec-event-detail { + margin-top: -6px; +} + +.mec-toogle-inner-month-divider .mec-toggle-item-col { + float: none; + width: 100%; + margin-top: 10px; + display: block; + border: none; +} + +.mec-events-toggle .mec-toogle-inner-month-divider .mec-toggle-title { + font-size: 19px; + display: block; + padding-top: 10px; +} + +@media only screen and (max-width: 768px) { + .mec-events-toggle .mec-toogle-inner-month-divider .mec-toggle-title { + font-size: 14px; + padding-top: 0; + } + + .mec-toogle-inner-month-divider .mec-toggle-item-col { + margin-top: 0; + } + + .mec-toogle-inner-month-divider .mec-toggle-month-inner-image { + width: 70px; + } +} + +/* # Featured/Canceled Label + ================================================== */ +/* .mec-wrap article:not([class^="mec-event-countdown"]):not([class^="mec-event-cover-"]).mec-label-featured:before, +.mec-wrap article:not([class^="mec-event-countdown"]):not([class^="mec-event-cover-"]).mec-label-canceled:before { + z-index: 1; + position: absolute; + top: 25px; + right: -37px; + font-size: 11px; + letter-spacing: 1px; + text-transform: uppercase; + background: #04de78; + padding: 2px 40px; + color: #fff; + -ms-transform: rotate(45deg); + -webkit-transform: rotate(45deg); + transform: rotate(45deg); + -webkit-transition: .5s cubic-bezier(.25, .5, .06, .85); + transition: .5s cubic-bezier(.25, .5, .06, .85); + content: attr(data-style); +} */ + +.mec-wrap + article:not([class^="mec-event-countdown"]):not( + [class^="mec-event-cover-"] + ).mec-label-featured, +.mec-wrap + article:not([class^="mec-event-countdown"]):not( + [class^="mec-event-cover-"] + ).mec-label-canceled, +.mec-wrap + article:not([class^="mec-event-countdown"]):not( + [class^="mec-event-cover-"] + ).mec-label-custom { + overflow: hidden; + position: relative; +} + +.mec-event-label-captions { + z-index: 1; + position: absolute; + top: 30px; + right: -37px; + font-size: 10px; + letter-spacing: 1px; + text-transform: uppercase; + background: #04de78; + padding: 2px 0; + color: #fff; + -ms-transform: rotate(45deg); + -webkit-transform: rotate(45deg); + transform: rotate(45deg); + -webkit-transition: 0.5s cubic-bezier(0.25, 0.5, 0.06, 0.85); + transition: 0.5s cubic-bezier(0.25, 0.5, 0.06, 0.85); + list-style: none; + text-align: center; + width: 150px; + max-width: 150px; +} + +.mec-event-agenda-clean .mec-event-label-captions { + top: 0; +} + +.mec-box-calendar.mec-event-calendar-classic.mec-event-container-novel + .mec-event-label-captions { + display: none; +} + +.mec-wrap + article:not([class^="mec-event-countdown"]):not( + [class^="mec-event-cover-"] + ).mec-label-canceled:before { + background: #de0404; +} + +/* Full Calendar/Weekly view */ +ul.mec-weekly-view-dates-events article:before, +.mec-daily-view-date-events article:before { + padding: 7px 40px !important; + top: 27px !important; +} + +/* Full Calendar/Yearly View */ +.mec-timeline-event .mec-fc-style, +.mec-wrap .mec-events-agenda .mec-agenda-event .mec-fc-style, +.mec-wrap .mec-event-list-modern article .mec-fc-style, +.mec-wrap .mec-event-list-accordion article .mec-fc-style, +.mec-timetable-wrap article .mec-fc-style, +.mec-event-grid-minimal article .mec-fc-style, +.mec-event-grid-classic article .mec-fc-style, +.mec-event-grid-simple article .mec-fc-style, +.mec-wrap article.mec-event-cover-modern .mec-fc-style, +.mec-wrap article.mec-event-cover-classic .mec-fc-style, +.mec-wrap article.mec-event-cover-clean .mec-fc-style, +.mec-wrap article[class^="mec-event-countdown-"] .mec-fc-style { + font-size: 9px; + letter-spacing: 0.5px; + text-transform: uppercase; + background: #04de78; + padding: 2px 7px; + color: #fff; + position: relative; + margin-left: 5px; + border-radius: 2px; +} + +.mec-timeline-event.mec-label-canceled .mec-fc-style, +.mec-wrap .mec-events-agenda .mec-agenda-event.mec-label-canceled .mec-fc-style, +.mec-wrap article.mec-event-cover-modern.mec-label-canceled .mec-fc-style { + background: #de0404; +} + +.mec-timeline-event .mec-fc-style:before, +.mec-wrap .mec-events-agenda .mec-agenda-event .mec-fc-style:before, +.mec-wrap .mec-event-list-modern article .mec-fc-style:before, +.mec-wrap .mec-event-list-accordion article .mec-fc-style:before, +.mec-timetable-wrap article .mec-fc-style:before, +.mec-event-grid-minimal article .mec-fc-style:before, +.mec-event-grid-simple article .mec-fc-style:before, +.mec-wrap article.mec-event-cover-classic .mec-fc-style:before, +.mec-wrap article.mec-event-cover-clean .mec-fc-style:before, +.mec-wrap article[class^="mec-event-countdown-"] .mec-fc-style:before { + width: 0; + height: 0; + border-top: 4px solid transparent !important; + border-right: 5px solid; + border-bottom: 4px solid transparent; + margin: 0; + top: 50%; + left: -5px; + transform: translateY(-4.5px); + position: absolute; + content: ""; + color: var(--background-color); +} + +.mec-timeline-event.mec-label-canceled .mec-fc-style:before, +.mec-wrap + .mec-events-agenda + .mec-agenda-event.mec-label-canceled + .mec-fc-style:before { + color: #de0404; +} + +/* List view/Modern & Accordion */ +.mec-wrap .mec-event-list-modern article.mec-label-featured:before, +.mec-wrap .mec-event-list-modern article.mec-label-canceled:before, +.mec-wrap .mec-event-list-accordion article.mec-label-featured:before, +.mec-wrap .mec-event-list-accordion article.mec-label-canceled:before, +.mec-event-grid-minimal article.mec-label-featured:before, +.mec-event-grid-minimal article.mec-label-canceled:before, +.mec-event-grid-simple article.mec-label-featured:before, +.mec-event-grid-simple article.mec-label-canceled:before, +.mec-event-grid-classic article.mec-label-featured:before, +.mec-event-grid-classic article.mec-label-canceled:before, +.mec-timetable-wrap article.mec-label-featured:before, +.mec-timetable-wrap article.mec-label-canceled:before { + display: none; +} + +.mec-wrap .mec-event-list-modern article .mec-fc-style, +.mec-wrap .mec-event-list-accordion article .mec-fc-style, +.mec-wrap article.mec-event-cover-classic .mec-fc-style, +.mec-wrap article.mec-event-cover-clean .mec-fc-style, +.mec-wrap article[class^="mec-event-countdown-"] .mec-fc-style { + top: -1px; + right: -3px; + font-size: 11px; + white-space: nowrap; +} + +.mec-wrap .mec-event-list-modern article.mec-label-canceled .mec-fc-style, +.mec-wrap .mec-event-list-accordion article.mec-label-canceled .mec-fc-style, +.mec-timetable-wrap article.mec-label-canceled .mec-fc-style, +.mec-event-grid-minimal article.mec-label-canceled .mec-fc-style, +.mec-event-grid-classic article.mec-label-canceled .mec-fc-style, +.mec-event-grid-simple article.mec-label-canceled .mec-fc-style, +.mec-wrap article.mec-event-cover-classic.mec-label-canceled .mec-fc-style, +.mec-wrap article.mec-event-cover-clean.mec-label-canceled .mec-fc-style, +.mec-wrap + article[class^="mec-event-countdown-"].mec-label-canceled + .mec-fc-style { + background: #de0404; +} + +.mec-wrap + .mec-event-list-modern + article.mec-label-canceled + .mec-fc-style:before, +.mec-wrap + .mec-event-list-accordion + article.mec-label-canceled + .mec-fc-style:before, +.mec-timetable-wrap article.mec-label-canceled .mec-fc-style:before, +.mec-event-grid-minimal article.mec-label-canceled .mec-fc-style:before, +.mec-event-grid-classic article.mec-label-canceled .mec-fc-style:before, +.mec-event-grid-simple article.mec-label-canceled .mec-fc-style:before, +.mec-wrap + article.mec-event-cover-classic.mec-label-canceled + .mec-fc-style:before, +.mec-wrap article.mec-event-cover-clean.mec-label-canceled .mec-fc-style:before, +.mec-wrap + article[class^="mec-event-countdown-"].mec-label-canceled + .mec-fc-style:before { + color: #de0404; +} + +/* Slider view */ +.mec-wrap + .mec-slider-t5 + article:not([class^="mec-event-countdown"]).mec-label-featured:before, +.mec-wrap + .mec-slider-t5 + article:not([class^="mec-event-countdown"]).mec-label-canceled:before { + -ms-transform: none; + -webkit-transform: none; + transform: none; + -webkit-transition: none; + transition: none; + top: 271px; + right: 0; +} + +/* Timetable view */ +.mec-timetable-wrap article .mec-fc-style { + top: -2px; + font-size: 10px; + right: 0; +} + +/* Cover View */ +.mec-wrap article.mec-event-cover-modern .mec-fc-style { + padding: 5px 9px; + font-size: 11px; + font-weight: 600; + text-transform: uppercase; + letter-spacing: 1px; + margin-bottom: 24px; + display: inline-block; + border-radius: 2px; + -ms-transform: rotate(0); + -webkit-transform: rotate(0); + transform: rotate(0); + right: 0; + top: 0; +} + +/* Grid View/Clean */ +.mec-skin-grid-events-container + .mec-wrap + .mec-event-grid-clean + .mec-event-article:before { + -ms-transform: none; + -webkit-transform: none; + transform: none !important; + -webkit-transition: none; + transition: none; + top: 22px !important; + right: 22px !important; + padding: 0 10px !important; +} + +/* Grid view/Minimal */ +.mec-event-grid-minimal article .mec-fc-style, +.mec-event-grid-simple article .mec-fc-style { + top: -4px; + font-size: 10px; + margin-left: 10px; + right: 0; +} + +.mec-event-grid-classic article .mec-fc-style { + padding: 5px 20px; + font-size: 12px; + margin-top: 8px; + display: inline-block; +} + +/* # Common Style For All Shortcodes + ================================================== */ + +/* Next & Previous Month */ +.mec-load-month-link { + color: #a9a9a9; + font-size: 12px; + font-weight: 400; + letter-spacing: 1px; + text-transform: uppercase; + text-decoration: unset; + transition: all 0.33s ease; +} + +/* Categories*/ +.mec-categories-wrapper { + font-size: 12px; + font-weight: 400; + line-height: 18px; +} + +.mec-categories-wrapper i { + margin-right: 4px; + display: inline-block; +} + +ul.mec-categories { + padding: 0; + display: inline; + vertical-align: top; +} + +ul.mec-categories li.mec-category { + list-style: none; + display: inline-block; + margin-right: 3px; + cursor: pointer; +} + +ul.mec-categories li.mec-category:not(:last-of-type):after { + content: ","; +} + +ul.mec-categories li.mec-category a { + color: #777; + text-align: left; + transition: all 0.23s ease; + -webkit-transition: all 0.23s ease; +} + +/* Tooltip for custom data fields */ +.mec-wrap [id^="mec_skin_events_"] .mec-event-data-fields { + display: inline-block; + width: 18px; + height: 18px; + position: relative; + vertical-align: middle; + cursor: pointer; + margin: 0 0 0 4px; + background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABmJLR0QA/wD/AP+gvaeTAAAD90lEQVRoge2ZzWscZRjAf8/OJpUkQrF6SJMcNB+zobVdk8WCWEwqBEou0kMKtkgPHoRUD54VFMQ/wJBYhJ6MoGvFg3rQQ7dQFJVN09RANl9UkrgRbVrFuDZpZh4PSWqYmd2Z2a8Ize+0+7zPO/N7dt7l/RjYY48HGynHRZKqRltm7mmBXo1It9jEEBqBhq2UVYSswrTYmraVVFdn248iYpd675IK+GluruXehg4KchZoCtl9SVRHJcrw0fb2pWIdiirg2uzsY2LLOyjngNpib77FOujFdd1481hn50rYzqELGJ+afxGxh0AeCdvXhxURBuNm2ydhOgUuIJ1O1xgN+0eAl0OrhUDgwp3lxVd7e3s3Aub7k05n64yG3CXgZEl2QVG+sv6uG0gkDub8UiN+CZu/fBXlAYR+oz6XTKVSUb9U3wK2hk315LcR+vc3Nr/nn1aA8cz8GdDR8lmFR9DT8Vh7Mn97Hn6YmjpQKzUZ4NGKmAVnxRIrljDNW16NeYdQbaTmXXZfHuCAYUffytfo+QQmZmebbUvmKX2SKhdrIlZr3DR/cTZ4PgHL4jz/H3mAfUp00KvBVYCqRgQ5U3mnkKi+lFQ1nGFXAeOZuWNAc1WkwtHUMXOz2xl0FSDQWx2f8NjoCWfM4z8giWrIFIMorifgnqojdKDeF7Asi69TVxm7MYkIdB85TF/PcQzDqGjeNoqa/gWoNuab3765cpUr331//3vq283PJ5/vqWjeNgKNzpjXEGpwxzZJT0zuSmwHDzsDvou5nYjHg4l4xMqdVwiPAnQ1X3L3kcOuWNfRJyuet4O/nAH3f0BkGcVzu9jXcxyAsRuT9wX6nnu24nnbKCy7dJ2Ba9Nzn4lyKu9VdhX59KlY68DOiHsis3WsekLhEHC5uQqwlcvV0QmPitvNNYRUNTI+Pf+zQEt1tAKzEDdbH3ee5rmHkIgdUf2oel4BEUa9jiI95wGJMgysV1wqOGuCNeLV4FnA5lmlXqysU3BE+MBrNwaF9sTWQ28Av1fMKjgra/a9t/M15i3g0KGW2yq8Vhmn4Cj6SqFD34JroS6z7WOBC+XXCoYIQ12x9kuFcnwXczNm63mUz8unFRDRL+9kF1/3TQtyrXQ6W2fU55II/aWb+aPIF3fra08/09Lyj19uoOV0InEw98eviy+Avl+6XmFEGPpzeeFUEHko4gXH9czsgCLDlP/U7jdFB/3GvJNQGxqAeKw9WWvtM1EZBtbC9ncicFeEIWO9JhZWfqt/8Vyfnm5SooOqeraItdMC8KGyMdIVi2WLdSjLa1ZVjUzM3EzY6AlRuhU1BW36b3+tqyBLIDMCaRUuxzueGCvHa9Y99njQ+RcbkGTacAW/agAAAABJRU5ErkJggg=="); + background-position: center center; + background-size: cover; + padding: 0; + border: none; + background-color: transparent; + overflow: visible; +} + +.mec-wrap + [id^="mec_skin_events_"] + .mec-event-data-fields + .mec-data-fields-tooltip { + position: absolute; + width: 160px; + bottom: 24px; + left: calc(50% - 80px); + background: #fff; + border-radius: 5px; + border: 1px solid #535a6121; + box-shadow: 0 4px 45px -8px #444b5061; + visibility: hidden; + opacity: 0; + transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.25s ease; + transform: scale(0.9); + z-index: 99; +} + +.mec-wrap + [id^="mec_skin_events_"] + .mec-event-data-fields:hover + .mec-data-fields-tooltip { + visibility: visible; + opacity: 1; + transform: scale(1); +} + +.mec-wrap + [id^="mec_skin_events_"] + .mec-event-data-fields + .mec-data-fields-tooltip:before { + display: block; + content: ""; + position: absolute; + width: 12px; + height: 12px; + left: calc(50% - 12px); + top: 100%; + transform: translate(50%, -50%) rotate(-45deg); + background-color: #fff; + box-shadow: 0 8px 9px -4px #535a61; + z-index: 0; +} + +.mec-wrap + [id^="mec_skin_events_"] + .mec-event-data-fields + .mec-data-fields-tooltip + .mec-data-fields-tooltip-box { + overflow: hidden; + border-radius: 11px; + padding: 12px 0; +} + +.mec-wrap + [id^="mec_skin_events_"] + .mec-event-data-fields + .mec-data-fields-tooltip + .mec-data-fields-tooltip-box + ul { + width: 100%; + height: fit-content; + overflow-y: scroll; + padding: 9px 15px; + text-align: left; +} + +.mec-wrap + [id^="mec_skin_events_"] + .mec-event-data-fields + .mec-data-fields-tooltip + .mec-data-fields-tooltip-box + ul::-webkit-scrollbar-track { + background-color: #fafafa; +} + +.mec-wrap + [id^="mec_skin_events_"] + .mec-event-data-fields + .mec-data-fields-tooltip + .mec-data-fields-tooltip-box + ul::-webkit-scrollbar { + width: 4px; + background-color: #fafafa; +} + +.mec-wrap + [id^="mec_skin_events_"] + .mec-event-data-fields + .mec-data-fields-tooltip + .mec-data-fields-tooltip-box + ul::-webkit-scrollbar-thumb { + background-color: #40d9f1; + border-radius: 4px; +} + +.mec-wrap + [id^="mec_skin_events_"] + .mec-event-data-fields + .mec-data-fields-tooltip + .mec-data-fields-tooltip-box + ul + .mec-event-data-field-item { + display: block; + width: 100%; + text-transform: none; + margin: 0 0 8px 0; + color: #616263; + font-size: 13px; + line-height: 1.5; + font-weight: 400; + padding-bottom: 8px; + border-bottom: 1px dashed #e1e2e3; +} + +.mec-wrap + [id^="mec_skin_events_"] + .mec-event-data-fields + .mec-data-fields-tooltip + .mec-data-fields-tooltip-box + ul + .mec-event-data-field-item:last-child { + border-bottom: none; +} + +.mec-wrap + [id^="mec_skin_events_"] + .mec-data-fields-tooltip + .mec-data-fields-tooltip-box + ul + .mec-event-data-field-item + a { + color: #40d9f1; + font-size: 13px; + line-height: 1.5; + font-weight: 400; +} + +.mec-wrap + [id^="mec_skin_events_"] + .mec-data-fields-tooltip + .mec-data-fields-tooltip-box + ul + .mec-event-data-field-item + a:hover { + color: #000; +} + +/* Custom Data with Label */ +.mec-wrap .mec-custom-data .mec-timetable-t2-content, +.mec-wrap .mec-custom-data .mec-timetable-t2-content .mec-event-title, +.mec-wrap + article:not([class^="mec-event-countdown"]):not( + [class^="mec-event-cover-"] + ).mec-custom-data.mec-label-canceled, +.mec-wrap + article:not([class^="mec-event-countdown"]):not( + [class^="mec-event-cover-"] + ).mec-custom-data.mec-label-featured { + overflow: visible !important; +} + +.mec-wrap + article:not([class^="mec-event-countdown"]):not( + [class^="mec-event-cover-"] + ).mec-custom-data.mec-label-canceled + .mec-event-label-captions, +.mec-wrap + article:not([class^="mec-event-countdown"]):not( + [class^="mec-event-cover-"] + ).mec-custom-data.mec-label-featured + .mec-event-label-captions { + -ms-transform: rotate(0); + -webkit-transform: rotate(0); + transform: rotate(0); + width: fit-content; + top: 7px; + right: 7px; + padding: 2px 5px; + border-radius: 4px; +} + +@media (min-width: 769px) { + .mec-wrap + [id^="mec_skin_events_"] + .mec-event-list-standard + .mec-label-custom + .mec-event-data-fields + .mec-data-fields-tooltip, + .mec-wrap + [id^="mec_skin_events_"] + .mec-event-list-standard + .mec-label-featured + .mec-event-data-fields + .mec-data-fields-tooltip, + .mec-wrap + [id^="mec_skin_events_"] + .mec-event-list-standard + .mec-label-canceled + .mec-event-data-fields + .mec-data-fields-tooltip { + bottom: calc(50% - 110px); + left: 30px; + } + + .mec-wrap + [id^="mec_skin_events_"] + .mec-event-list-standard + .mec-label-custom + .mec-event-data-fields + .mec-data-fields-tooltip:before, + .mec-wrap + [id^="mec_skin_events_"] + .mec-event-list-standard + .mec-label-featured + .mec-event-data-fields + .mec-data-fields-tooltip:before, + .mec-wrap + [id^="mec_skin_events_"] + .mec-event-list-standard + .mec-label-canceled + .mec-event-data-fields + .mec-data-fields-tooltip:before { + left: -10px; + top: calc(100% - 110px); + box-shadow: -8px -5px 9px -4px #535a61; + } +} + +/* # Speaker Modal + ================================================== */ +.mec-hourly-schedule-speaker-info { + background: #fff; + padding: 30px; + border: 1px solid #e6e6e6; +} + +.mec-hourly-schedule-speaker-thumbnail { + float: left; + max-width: 30%; + width: 30%; +} + +.mec-hourly-schedule-speaker-name { + font-weight: 700; + font-size: 26px; + line-height: 1.2; + color: #333; + text-transform: uppercase; +} + +.mec-hourly-schedule-speaker-details { + float: left; + width: 69%; + padding-left: 25px; +} + +.mec-hourly-schedule-speaker-job-title { + font-size: 16px; + line-height: 1.3; + margin-bottom: 4px; +} + +.mec-hourly-schedule-speaker-description { + font-size: 14px; + font-weight: 400; + color: #6d7683; + line-height: 1.7; + text-align: left; +} + +.mec-organizer-social-information a i, +.mec-hourly-schedule-speaker-contact-information a i { + color: #6b6b6b; + background: #ebebeb; + line-height: 29px; + margin: 9px 7px 9px 0; + width: 30px; + height: 30px; + display: inline-block; + text-align: center; + transition: all 0.2s ease; + font-size: 15px; + cursor: pointer; + border-radius: 3px; +} + +.mec-organizer-social-information a i:hover, +.mec-hourly-schedule-speaker-contact-information a i:hover { + background: #222; + color: #fff; +} + +@media only screen and (max-width: 479px) { + .mec-hourly-schedule-speaker-thumbnail { + float: none; + max-width: none; + margin-right: 0; + margin-bottom: 15px; + width: 100%; + } + + .mec-hourly-schedule-speaker-thumbnail img { + width: 100%; + } + + .mec-hourly-schedule-speaker-details { + padding-left: 0; + } + + .mec-hourly-schedule-speaker-info { + width: 90%; + margin: 0 auto; + } +} + +/* # Profile page + ================================================== */ +.mec-profile { + overflow-x: auto; +} + +.mec-profile .mec-profile-bookings { + border: 2px solid #e6e6e6; + text-align: center; + min-width: 600px; +} + +.mec-profile .mec-profile-bookings tbody tr:first-child { + background: #f7f7f7; + font-weight: bold; + text-transform: capitalize; +} + +.mec-profile .mec-profile-bookings tbody tr { + border-bottom: 1px solid #e6e6e6; + font-size: 14px; +} + +.mec-profile .mec-profile-bookings tbody tr td { + border: 1px solid #e6e6e6; + padding: 10px; + text-align: center; + word-break: initial; +} + +.mec-profile .mec-profile-bookings tbody tr td a { + text-decoration: none; +} + +.mec-profile .mec-profile-bookings tbody tr td:nth-child(1) { + width: 5%; +} + +.mec-profile .mec-profile-bookings tbody tr td:nth-child(2) { + width: 30%; + text-align: left; +} + +.mec-profile .mec-profile-bookings tbody tr td:nth-child(3) { + width: 30%; +} + +.mec-profile .mec-profile-bookings tbody tr td:nth-child(4) { + width: 7%; +} + +.mec-profile .mec-profile-bookings tbody tr td:nth-child(5) { + width: 7%; +} + +.mec-profile .mec-profile-bookings tbody tr td:nth-child(6) { + width: 7%; +} + +.mec-profile .mec-profile-bookings tbody tr td:nth-child(7) { + width: 7%; +} + +.mec-profile .mec-profile-bookings tbody tr td:nth-child(8) { + width: 7%; +} + +.mec-profile .mec-profile-bookings tbody tr td:nth-child(8) i { + color: #fe686a; +} + +.mec-profile .mec-event-status { + padding: 5px 10px; + color: #fff; + border-radius: 2px; + font-size: 12px; + line-height: 12px; + letter-spacing: 0.4px; +} + +.mec-profile .mec-event-status.mec-book-confirmed { + background: #50d477; +} + +.mec-profile .mec-event-status.mec-book-pending { + background: #fcbe69; +} + +.mec-profile .mec-event-status.mec-book-rejected { + background: #fe686a; +} + +.mec-profile .mec-event-date { + font-size: 12px; + color: #888; +} + +/* MEC Profile date and status with icon */ +.mec-event-status, +.mec-event-date { + text-align: center; +} + +.mec-event-status .mec-tooltip, +.mec-event-date .mec-tooltip { + position: relative; + width: fit-content; + margin: auto; +} + +.mec-profile i { + font-size: 15px; + color: #008aff; + vertical-align: text-bottom; + margin-right: 4px; +} + +.mec-event-status .mec-tooltip .box, +.mec-event-date .mec-tooltip .box { + min-width: 250px; + max-width: 300px; + display: inline-block; + top: -8px; + left: 50%; + margin-top: 0; + transform: translate(-50%, -100%); + padding: 0; + background-color: #000; + color: #fff; + font-weight: 400; + font-size: 14px; + letter-spacing: 0.5px; + line-height: 1.5; + position: absolute; + z-index: 99999999; + box-sizing: border-box; + border-radius: 6px; + box-shadow: 0 4px 45px -8px #535a61; + padding: 5px 10px 6px; + border-radius: 8px; + text-align: center; + font-style: normal; + opacity: 0; + visibility: hidden; + display: none; +} + +.mec-event-date .mec-tooltip .box, +.mec-event-status .mec-tooltip .box { + font-size: 13px; + letter-spacing: 1.1px; + font-weight: 500; +} + +.mec-event-status .mec-tooltip:hover .box:after, +.mec-event-date .mec-tooltip:hover .box:after { + content: ""; + position: absolute; + width: 12px; + height: 12px; + left: calc(50% - 12px); + bottom: -12px; + transform: translate(50%, -50%) rotate(-45deg); + background-color: #000; + box-shadow: 0 8px 9px -4px #535a61; +} + +.mec-event-status .mec-tooltip .box { + min-width: 100px; +} + +.mec-event-status.mec-book-confirmed .mec-tooltip:hover .box:after, +.mec-event-status.mec-book-confirmed .mec-tooltip .box { + background-color: #50d477; +} + +.mec-event-status.mec-book-rejected .mec-tooltip:hover .box:after, +.mec-event-status.mec-book-rejected .mec-tooltip .box { + background-color: #fe686a; +} + +.mec-event-status.mec-book-pending .mec-tooltip:hover .box:after, +.mec-event-status.mec-book-pending .mec-tooltip .box { + background-color: #fcbe69; +} + +.mec-event-status .mec-tooltip:hover .box, +.mec-event-date .mec-tooltip:hover .box { + opacity: 1; + visibility: visible; + display: block; +} + +.mec-profile .mec-booking-number-of-attendees { + font-size: 13px; + color: #888; +} + +.mec-profile .mec-booking-number-of-attendees i, +.mec-profile .mec-profile-bookings-view-invoice i { + font-size: 15px; + color: #008aff; + vertical-align: text-bottom; + margin-right: 4px; +} + +.mec-booking-attendees { + background: #fff; + padding: 10px; +} + +.mec-booking-attendees { + width: 850px; + text-align: center; +} + +.mec-booking-attendees-wrapper { + border: 2px solid #e6e6e6; + font-size: 14px; +} + +.mec-booking-attendees-head { + display: table; + width: 100%; + background: #f7f7f7; + border-bottom: 1px solid #e6e6e6; + font-weight: bold; +} + +.mec-booking-attendees-head span, +.mec-booking-attendees-head-content > span { + vertical-align: middle; + display: table-cell; + padding: 7px; + border-right: 1px solid #e6e6e6; + font-size: 12px; +} + +.mec-booking-attendees-head-content { + display: table; + width: 100%; + border-bottom: 1px solid #e6e6e6; +} + +.mec-booking-attendees-wrapper .mec-booking-attendees-head-content:last-child { + border: none; +} + +.mec-booking-attendees-head span:nth-child(1), +.mec-booking-attendees-head-content > span:nth-child(1) { + width: 4%; +} + +.mec-booking-attendees-head span:nth-child(2), +.mec-booking-attendees-head-content > span:nth-child(2) { + width: 20%; +} + +.mec-booking-attendees-head span:nth-child(3), +.mec-booking-attendees-head-content > span:nth-child(3) { + width: 24%; +} + +.mec-booking-attendees-head span:nth-child(4), +.mec-booking-attendees-head-content > span:nth-child(4) { + width: 26%; +} + +.mec-booking-attendees-head span:nth-child(5), +.mec-booking-attendees-head-content > span:nth-child(5) { + width: 26%; +} + +@media only screen and (max-width: 759px) { + .mec-booking-attendees { + width: 470px; + } + + .mec-booking-attendees-head span, + .mec-booking-attendees-head-content > span { + word-break: break-all; + } +} + +/* User Profile Responsive */ +@media (max-width: 1366px) { + .mec-profile .mec-profile-bookings tbody tr td:nth-child(1) { + width: 5%; + } + + .mec-profile .mec-profile-bookings tbody tr td:nth-child(2) { + width: 30%; + } + + .mec-profile .mec-profile-bookings tbody tr td:nth-child(3) { + width: 30%; + } + + .mec-profile .mec-profile-bookings tbody tr td:nth-child(4) { + width: 10%; + } + + .mec-profile .mec-profile-bookings tbody tr td:nth-child(5) { + width: 10%; + } + + .mec-profile .mec-profile-bookings tbody tr td:nth-child(6) { + width: 5%; + } + + .mec-profile .mec-profile-bookings tbody tr td:nth-child(7) { + width: 5%; + } + + .mec-profile .mec-profile-bookings tbody tr td:nth-child(8) { + width: 5%; + } +} + +@media (max-width: 1024px) { + .mec-profile .mec-profile-bookings tbody tr td:nth-child(1) { + width: 5%; + } + + .mec-profile .mec-profile-bookings tbody tr td:nth-child(2) { + width: 30%; + } + + .mec-profile .mec-profile-bookings tbody tr td:nth-child(3) { + width: 30%; + } + + .mec-profile .mec-profile-bookings tbody tr td:nth-child(4) { + width: 10%; + } + + .mec-profile .mec-profile-bookings tbody tr td:nth-child(5) { + width: 10%; + } + + .mec-profile .mec-profile-bookings tbody tr td:nth-child(6) { + width: 5%; + } + + .mec-profile .mec-profile-bookings tbody tr td:nth-child(7) { + width: 5%; + } + + .mec-profile .mec-profile-bookings tbody tr td:nth-child(8) { + width: 5%; + } +} + +@media (max-width: 780px) { + .mec-profile i, + .mec-profile .mec-profile-bookings tbody tr { + font-size: 12px; + } + + .mec-event-date .mec-tooltip .box { + min-width: 200px; + } + + .mec-event-status .mec-tooltip .box { + min-width: 90px; + } + + .mec-event-date .mec-tooltip .box, + .mec-event-status .mec-tooltip .box { + padding: 4px 5px !important; + } + + .mec-profile .mec-profile-bookings tbody tr { + font-size: 12px; + } +} + +@media (max-width: 480px) { + .mec-profile .mec-booking-number-of-attendees, + .mec-profile i, + .mec-profile .mec-profile-bookings tbody tr, + .mec-profile .mec-event-date { + font-size: 10px !important; + } + + .mec-profile .mec-event-status { + padding: 2px 4px; + font-size: 10px; + line-height: 20px; + } + + .mec-profile .mec-profile-bookings tbody tr td { + padding: 3px; + } + + .mec-event-date .mec-tooltip .box, + .mec-event-status .mec-tooltip .box { + font-size: 8px; + } + + .mec-event-date .mec-tooltip .box { + min-width: 75px; + } + + .mec-event-status .mec-tooltip .box { + min-width: 70px; + } + + .mec-event-date .mec-tooltip .box, + .mec-event-status .mec-tooltip .box { + padding: 4px 5px !important; + } +} + +/* # Woocommerce + ================================================== */ +.mec-woo-booking-checkout { + position: relative; + border: none; + border-radius: 0; + color: #fff; + display: inline-block; + font-size: 12px; + letter-spacing: 1px; + line-height: 1.5; + text-transform: uppercase; + font-weight: 600; + text-decoration: none; + cursor: pointer; + margin-bottom: 21px; + margin-right: 10px; + line-height: 1; + padding: 18px 20px 16px; + background: #39c36e; + -webkit-transition: all 0.21s ease; + -moz-transition: all 0.21s ease; + transition: all 0.21s ease; + border-radius: 0; + margin-bottom: 6px; + min-width: 170px; + margin-top: 5px; + text-align: center; +} + +.mec-woo-booking-checkout:hover { + background: #222; + color: #fff; +} + +.mec-woo-booking-checkout:focus, +.mec-woo-booking-checkout:visited { + color: #fff; +} + +/* # Booking Modal + ================================================== */ +.single-mec-events .lity-container { + max-width: 768px; + width: 768px; +} + +.lity-content .mec-events-meta-group-booking { + width: 100%; + background: #fff; + overflow-y: auto; +} + +@media only screen and (max-width: 480px) { + .lity-content .mec-events-meta-group-booking { + padding: 20px; + width: 340px; + margin: 0 auto; + } +} + +@media (max-width: 480px) { + .single-mec-events .lity-container { + max-width: 440px; + width: 440px; + margin: 0 auto !important; + } +} + +@media (max-width: 411px) { + .single-mec-events .lity-container { + max-width: 380px; + width: 380px; + } +} + +@media (max-width: 375px) { + .single-mec-events .lity-container { + max-width: 350px; + width: 350px; + } +} + +@media (max-width: 320px) { + .single-mec-events .lity-container { + max-width: 300px; + width: 300px; + } +} + +/* Booking Cover Overley */ +.mec-events-meta-group-booking { + position: relative; +} + +.mec-cover-loader:after { + content: ""; + position: absolute; + top: 0; + right: 0; + left: 0; + bottom: 0; + background: rgba(255, 255, 255, 0.5); + z-index: 99999; +} + +.mec-loader { + background: rgba(0, 0, 0, 0); + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + z-index: 9; +} + +.mec-loader, +.mec-loader:after { + border-radius: 50%; + width: 5em; + height: 5em; + z-index: 999999999999; +} + +.mec-loader { + font-size: 10px; + text-indent: -9999em; + border-top: 0.5em solid rgba(0, 0, 0, 0.2); + border-right: 0.5em solid rgba(0, 0, 0, 0.2); + border-bottom: 0.5em solid rgba(0, 0, 0, 0.2); + border-left: 0.5em solid #ffffff; + -webkit-transform: translateZ(0); + -ms-transform: translateZ(0); + transform: translateZ(0); + -webkit-animation: mecloader 1.1s infinite linear; + animation: mecloader 1.1s infinite linear; +} + +@-webkit-keyframes mecloader { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} + +@keyframes mecloader { + 0% { + -webkit-transform: rotate(0deg); + transform: rotate(0deg); + } + + 100% { + -webkit-transform: rotate(360deg); + transform: rotate(360deg); + } +} + +/* Recaptcha Style on booking page */ +.mec-google-recaptcha { + margin: 0 0 20px 16px; +} + +/* Bootstrap v3.0.3 * * Copyright 2013 Twitter, Inc * Licensed under the Apache License v2.0 * http://www.apache.org/licenses/LICENSE-2.0 * * Designed and built with all the love in the world @twitter by @mdo and @fat. */ +.mec-wrap * { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.mec-wrap *:before, +.mec-wrap *:after { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +.lity .clearfix:before, +.lity .clearfix:after, +.mec-wrap .clearfix:before, +.mec-wrap .clearfix:after { + content: "\0020"; + display: block; + overflow: hidden; + visibility: hidden; + width: 0; + height: 0; +} + +.lity .clearfix:after, +.mec-wrap .clearfix:after { + clear: both; +} + +.lity .clearfix, +.mec-wrap .clearfix { + zoom: 1; +} + +.lity .clear, +.lity .clr, +.mec-wrap .clear, +.mec-wrap .clr { + clear: both; + display: block; + overflow: hidden; + visibility: hidden; +} + +.lity .clr, +.mec-wrap .clr { + visibility: visible; + overflow: visible; +} + +.mec-container [class*="col-"] img { + max-width: 100%; +} + +.mec-container { + margin-right: auto; + margin-left: auto; + padding-left: 10px; + padding-right: 10px; +} + +.mec-container:before, +.mec-container:after { + content: " "; + display: table; +} + +.mec-container:after { + clear: both; +} + +@media only screen and (max-width: 479px) { + .mec-container { + width: 300px; + } +} + +@media only screen and (min-width: 480px) and (max-width: 767px) { + .mec-container { + width: 420px; + } +} + +@media only screen and (min-width: 768px) and (max-width: 960px) { + .mec-container { + width: 768px; + /* webnus */ + } +} + +@media only screen and (min-width: 961px) { + .mec-container { + width: 960px; + } +} + +@media only screen and (min-width: 1200px) { + .mec-container { + width: 1196px; + padding-left: 15px; + padding-right: 15px; + } +} + +@media only screen and (min-width: 1921px) { + .mec-container { + max-width: 1690px; + } +} + +.mec-wrap .row { + margin-left: -10px; + margin-right: -10px; +} + +.mec-wrap .row:before, +.mec-wrap .row:after { + content: " "; + display: table; +} + +.mec-wrap .row:after { + clear: both; +} + +.mec-wrap .col-xs-1, +.mec-wrap .col-sm-1, +.mec-wrap .col-md-1, +.mec-wrap .col-lg-1, +.mec-wrap .col-xs-2, +.mec-wrap .col-sm-2, +.mec-wrap .col-md-2, +.mec-wrap .col-lg-2, +.mec-wrap .col-xs-3, +.mec-wrap .col-sm-3, +.mec-wrap .col-md-3, +.mec-wrap .col-lg-3, +.mec-wrap .col-xs-4, +.mec-wrap .col-sm-4, +.mec-wrap .col-md-4, +.mec-wrap .col-lg-4, +.mec-wrap .col-xs-5, +.mec-wrap .col-sm-5, +.mec-wrap .col-md-5, +.mec-wrap .col-lg-5, +.mec-wrap .col-xs-6, +.mec-wrap .col-sm-6, +.mec-wrap .col-md-6, +.mec-wrap .col-lg-6, +.mec-wrap .col-xs-7, +.mec-wrap .col-sm-7, +.mec-wrap .col-md-7, +.mec-wrap .col-lg-7, +.mec-wrap .col-xs-8, +.mec-wrap .col-sm-8, +.mec-wrap .col-md-8, +.mec-wrap .col-lg-8, +.mec-wrap .col-xs-9, +.mec-wrap .col-sm-9, +.mec-wrap .col-md-9, +.mec-wrap .col-lg-9, +.mec-wrap .col-xs-10, +.mec-wrap .col-sm-10, +.mec-wrap .col-md-10, +.mec-wrap .col-lg-10, +.mec-wrap .col-xs-11, +.mec-wrap .col-sm-11, +.mec-wrap .col-md-11, +.mec-wrap .col-lg-11, +.mec-wrap .col-xs-12, +.mec-wrap .col-sm-12, +.mec-wrap .col-md-12, +.mec-wrap .col-lg-12 { + position: relative; + min-height: 1px; + padding-left: 10px; + padding-right: 10px; +} + +@media only screen and (min-width: 1200px) { + .mec-wrap .col-xs-1, + .mec-wrap .col-sm-1, + .mec-wrap .col-md-1, + .mec-wrap .col-lg-1, + .mec-wrap .col-xs-2, + .mec-wrap .col-sm-2, + .mec-wrap .col-md-2, + .mec-wrap .col-lg-2, + .mec-wrap .col-xs-3, + .mec-wrap .col-sm-3, + .mec-wrap .col-md-3, + .mec-wrap .col-lg-3, + .mec-wrap .col-xs-4, + .mec-wrap .col-sm-4, + .mec-wrap .col-md-4, + .mec-wrap .col-lg-4, + .mec-wrap .col-xs-5, + .mec-wrap .col-sm-5, + .mec-wrap .col-md-5, + .mec-wrap .col-lg-5, + .mec-wrap .col-xs-6, + .mec-wrap .col-sm-6, + .mec-wrap .col-md-6, + .mec-wrap .col-lg-6, + .mec-wrap .col-xs-7, + .mec-wrap .col-sm-7, + .mec-wrap .col-md-7, + .mec-wrap .col-lg-7, + .mec-wrap .col-xs-8, + .mec-wrap .col-sm-8, + .mec-wrap .col-md-8, + .mec-wrap .col-lg-8, + .mec-wrap .col-xs-9, + .mec-wrap .col-sm-9, + .mec-wrap .col-md-9, + .mec-wrap .col-lg-9, + .mec-wrap .col-xs-10, + .mec-wrap .col-sm-10, + .mec-wrap .col-md-10, + .mec-wrap .col-lg-10, + .mec-wrap .col-xs-11, + .mec-wrap .col-sm-11, + .mec-wrap .col-md-11, + .mec-wrap .col-lg-11, + .mec-wrap .col-xs-12, + .mec-wrap .col-sm-12, + .mec-wrap .col-md-12, + .mec-wrap .col-lg-12 { + padding-left: 15px; + padding-right: 15px; + } + + .mec-wrap .row { + margin-left: -15px; + margin-right: -15px; + } +} + +.mec-container [class*="col-"].alpha { + padding-left: 0; +} + +.mec-container [class*="col-"].omega { + padding-right: 0; +} + +.mec-wrap .col-xs-1, +.mec-wrap .col-xs-2, +.mec-wrap .col-xs-3, +.mec-wrap .col-xs-4, +.mec-wrap .col-xs-5, +.mec-wrap .col-xs-6, +.mec-wrap .col-xs-7, +.mec-wrap .col-xs-8, +.mec-wrap .col-xs-9, +.mec-wrap .col-xs-10, +.mec-wrap .col-xs-11, +.mec-wrap .col-xs-12 { + float: left; +} + +.mec-wrap .col-xs-12 { + width: 100%; +} + +.mec-wrap .col-xs-11 { + width: 91.66666666666666%; +} + +.mec-wrap .col-xs-10 { + width: 83.33333333333334%; +} + +.mec-wrap .col-xs-9 { + width: 75%; +} + +.mec-wrap .col-xs-8 { + width: 66.66666666666666%; +} + +.mec-wrap .col-xs-7 { + width: 58.333333333333336%; +} + +.mec-wrap .col-xs-6 { + width: 50%; +} + +.mec-wrap .col-xs-5 { + width: 41.66666666666667%; +} + +.mec-wrap .col-xs-4 { + width: 33.33333333333333%; +} + +.mec-wrap .col-xs-3 { + width: 25%; +} + +.mec-wrap .col-xs-2 { + width: 16.666666666666664%; +} + +.mec-wrap .col-xs-1 { + width: 8.333333333333332%; +} + +@media (min-width: 769px) { + .mec-wrap .col-sm-1, + .mec-wrap .col-sm-2, + .mec-wrap .col-sm-3, + .mec-wrap .col-sm-4, + .mec-wrap .col-sm-5, + .mec-wrap .col-sm-6, + .mec-wrap .col-sm-7, + .mec-wrap .col-sm-8, + .mec-wrap .col-sm-9, + .mec-wrap .col-sm-10, + .mec-wrap .col-sm-11, + .mec-wrap .col-sm-12 { + float: left; + } + + .mec-wrap .col-sm-12 { + width: 100%; + } + + .mec-wrap .col-sm-11 { + width: 91.66666666666666%; + } + + .mec-wrap .col-sm-10 { + width: 83.33333333333334%; + } + + .mec-wrap .col-sm-9 { + width: 75%; + } + + .mec-wrap .col-sm-8 { + width: 66.66666666666666%; + } + + .mec-wrap .col-sm-7 { + width: 58.333333333333336%; + } + + .mec-wrap .col-sm-6 { + width: 50%; + } + + .mec-wrap .col-sm-5 { + width: 41.66666666666667%; + } + + .mec-wrap .col-sm-4 { + width: 33.33333333333333%; + } + + .mec-wrap .col-sm-3 { + width: 25%; + } + + .mec-wrap .col-sm-2 { + width: 16.666666666666664%; + } + + .mec-wrap .col-sm-1 { + width: 8.333333333333332%; + } +} + +@media (min-width: 961px) { + .mec-wrap .col-md-1, + .mec-wrap .col-md-2, + .mec-wrap .col-md-3, + .mec-wrap .col-md-4, + .mec-wrap .col-md-5, + .mec-wrap .col-md-6, + .mec-wrap .col-md-7, + .mec-wrap .col-md-8, + .mec-wrap .col-md-9, + .mec-wrap .col-md-10, + .mec-wrap .col-md-11, + .mec-wrap .col-md-12 { + float: left; + } + + .mec-wrap .col-md-12 { + width: 100%; + } + + .mec-wrap .col-md-11 { + width: 91.66666666666666%; + } + + .mec-wrap .col-md-10 { + width: 83.33333333333334%; + } + + .mec-wrap .col-md-9 { + width: 75%; + } + + .mec-wrap .col-md-8 { + width: 66.66666666666666%; + } + + .mec-wrap .col-md-7 { + width: 58.333333333333336%; + } + + .mec-wrap .col-md-6 { + width: 50%; + } + + .mec-wrap .col-md-5 { + width: 41.66666666666667%; + } + + .mec-wrap .col-md-4 { + width: 33.33333333333333%; + } + + .mec-wrap .col-md-3 { + width: 25%; + } + + .mec-wrap .col-md-2 { + width: 16.666666666666664%; + } + + .mec-wrap .col-md-1 { + width: 8.333333333333332%; + } +} + +@media (min-width: 1200px) { + .mec-wrap .col-lg-1, + .mec-wrap .col-lg-2, + .mec-wrap .col-lg-3, + .mec-wrap .col-lg-4, + .mec-wrap .col-lg-5, + .mec-wrap .col-lg-6, + .mec-wrap .col-lg-7, + .mec-wrap .col-lg-8, + .mec-wrap .col-lg-9, + .mec-wrap .col-lg-10, + .mec-wrap .col-lg-11, + .mec-wrap .col-lg-12 { + float: left; + } + + .mec-wrap .col-lg-12 { + width: 100%; + } + + .mec-wrap .col-lg-11 { + width: 91.66666666666666%; + } + + .mec-wrap .col-lg-10 { + width: 83.33333333333334%; + } + + .mec-wrap .col-lg-9 { + width: 75%; + } + + .mec-wrap .col-lg-8 { + width: 66.66666666666666%; + } + + .mec-wrap .col-lg-7 { + width: 58.333333333333336%; + } + + .mec-wrap .col-lg-6 { + width: 50%; + } + + .mec-wrap .col-lg-5 { + width: 41.66666666666667%; + } + + .mec-wrap .col-lg-4 { + width: 33.33333333333333%; + } + + .mec-wrap .col-lg-3 { + width: 25%; + } + + .mec-wrap .col-lg-2 { + width: 16.666666666666664%; + } + + .mec-wrap .col-lg-1 { + width: 8.333333333333332%; + } +} + +/* WooCommerce Addon */ +#mec_woo_add_to_cart_btn { + min-width: 170px; + margin-top: 5px; + text-align: center; +} + +/* Breadcrumbs */ + +.mec-breadcrumbs { + border-radius: 2px; + padding: 9px 15px 6px; + font-size: 11px; + color: #8d8d8d; + letter-spacing: 0; + text-transform: none; + font-weight: 500; + margin: auto 15px 33px 15px; + border: 1px solid #e6e6e6; + box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.025); +} + +.mec-breadcrumbs-modern { + margin: auto 0 33px 0; +} + +.mec-breadcrumbs a { + color: #000; + padding-left: 4px; +} + +.mec-breadcrumbs a:hover { + text-decoration: underline; +} + +.mec-breadcrumbs i { + font-size: 8px; + margin: 0 0 0 4px; +} + +.mec-breadcrumbs .container { + padding-left: 20px; +} + +/* Notification single builder */ +.mec-content-notification a { + margin-left: 5px; +} + +.mec-content-notification { + background: #f7f7f7; + padding: 10px 10px 10px; + border: 1px solid #e8e8e8; +} + +.mec-content-notification p { + margin-bottom: 0; +} + +/* Advanced Repeating */ + +.mec-fes-form #mec-advanced-wraper div:first-child > ul { + border: 1px solid #cfeff5; + width: auto; + box-shadow: 0 1px 4px -2px #cfeff5; + display: block; + margin: 5px 0 10px; + padding: 5px 0; + border-radius: 2px; +} + +.mec-fes-form #mec-advanced-wraper div:first-child > ul:last-of-type { + margin-bottom: 35px; +} + +#mec-advanced-wraper div:first-child > ul span { + display: none; +} + +#mec-advanced-wraper div:first-child > ul * { + display: inline-block; + background: #fff; + font-size: 12px; + color: #717273; + text-align: center; +} + +#mec-advanced-wraper div:first-child > ul > li { + width: 60px; + font-weight: 700; + margin: 0 10px 0 0; + padding: 4px 0; + border-right: 1px solid #cfeff5; +} + +#mec-advanced-wraper div:first-child > ul > ul > li { + margin: 0; + padding: 2px 10px; + cursor: pointer; + border-radius: 2px; + transition: all 0.18s ease; +} + +.mec-fes-form #mec-advanced-wraper div:first-child > ul > ul > li:hover, +.mec-fes-form #mec-advanced-wraper div:first-child > ul > ul > li.mec-active { + background: #40d9f1 !important; + box-shadow: 0 1px 9px -3px #40d9f1; + color: #fff !important; +} + +/* Search Bar */ +.mec-search-bar-wrap .mec-search-form .mec-text-input-search { + width: 83%; +} + +.mec-search-bar-wrap + .mec-search-form + .mec-ajax-search-result + .mec-text-input-search { + width: 100%; + float: none; +} + +.mec-search-bar-wrap input#mec-search-bar-input { + width: calc(100% - 84%); + margin-left: 11px; + background: #40d9f1; + color: #fff; + font-weight: normal; +} + +.mec-text-input-search + input#mec-search-bar-input { + margin-left: -3px; +} + +.mec-search-bar-wrap input#mec-search-bar-input:hover { + background: #000; +} + +.mec-wrap.mec-search-bar-wrap .mec-totalcal-box input { + float: none; +} + +@media (max-width: 768px) { + .mec-search-bar-wrap .mec-search-form .mec-text-input-search { + display: inline-block; + } +} + +@media (max-width: 480px) { + .mec-search-bar-wrap .mec-search-form .mec-text-input-search { + width: 64%; + } + + .mec-search-bar-wrap input#mec-search-bar-input { + width: calc(100% - 67%); + } +} + +/* Ajax search bar result */ +.mec-wrap.mec-search-bar-wrap .mec-totalcal-box { + overflow: visible; +} + +.mec-ajax-search-result { + position: relative; +} + +.mec-search-bar-wrap.mec-wrap .mec-totalcal-box input[type="text"] { + width: calc(100% - 36px); +} + +.mec-search-bar-wrap.mec-wrap .mec-totalcal-box input[type="text"]:focus { + border-color: #efefef; +} + +div#mec-ajax-search-result-wrap { + position: absolute; + top: 100%; + opacity: 0; + visibility: hidden; + width: calc(100% - 2px); + min-height: 50px; + left: 0; + right: 0; + padding: 0 10px; + z-index: 9999; + transition: all 0.3s ease; +} + +.mec-ajax-search-result-events { + background: #ffffff; + padding: 10px 20px; + border: 1px solid #efefef; + border-top: none; +} + +.mec-ajax-search-result-events article:first-of-type { + border: none; +} + +article.mec-search-bar-result { + text-align: left; + margin-bottom: 0; + padding-bottom: 25px; + padding-top: 26px; + border-top: 1px solid #efefef; + transition: all 0.33s ease; + clear: both; +} + +.mec-search-bar-result .mec-event-list-search-bar-date { + width: 64px; + height: 64px; + margin-right: 10px; + font-size: 11px; + text-transform: uppercase; + float: left; + text-align: center; + padding-top: 2px; +} + +.mec-search-bar-result .mec-event-list-search-bar-date span { + font-size: 40px; + line-height: 30px; + font-weight: 700; + display: block; + margin-bottom: 6px; + letter-spacing: 1px; +} + +.mec-search-bar-result .mec-event-image { + float: left; + margin-right: 20px; + width: 65px; + height: auto; +} + +.mec-search-bar-result .mec-event-time { + font-size: 11px; + line-height: 1.1; + margin: 0; +} + +.mec-search-bar-result .mec-event-time i { + color: #40d9f1; + float: none; + width: unset; + height: unset; + font-size: inherit; + margin-right: 3px; + border: none; + padding: 0; +} + +.mec-search-bar-result .mec-event-title { + font-size: 13px; + padding: 0; + margin: 10px 0 8px; + font-weight: 700; + text-transform: uppercase; +} + +.mec-search-bar-result .mec-event-title a { + text-decoration: none; + color: #494949; + transition: color 0.3s ease; +} + +.mec-search-bar-result .mec-event-detail { + font-size: 13px; + line-height: 1.3; + color: #9a9a9a; + margin-bottom: 0; +} + +/* Modern Search bar */ +.mec-wrap.mec-modern-search-bar .mec-totalcal-box { + background: rgba(255, 255, 255, 0.87); + border: none; + padding: 35px; + border-radius: 3px; + box-shadow: 0 3px 13px rgba(0, 0, 0, 0.4); + position: relative; +} + +.mec-wrap.mec-modern-search-bar .mec-totalcal-box input[type="search"], +.mec-wrap.mec-modern-search-bar .mec-totalcal-box input[type="text"] { + height: 58px; + background: rgba(255, 255, 255, 0.99); + border-radius: 2px; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) inset; + border: 1px solid #ccc; + width: 100%; + padding-left: 45px; + padding-right: 13px; + font-size: 16px; +} + +.mec-wrap.mec-modern-search-bar .mec-totalcal-box .mec-text-input-search i { + position: absolute; + background: none; + border: none; + font-size: 21px; + left: 15px; + top: calc(50% - 19px); + color: #40d9f1; +} + +.mec-wrap.mec-modern-search-bar .mec-text-input-search { + position: relative; + height: 58px; +} + +.mec-wrap.mec-modern-search-bar .mec-totalcal-box input[type="submit"] { + height: 58px; + border: none; + border-radius: 2px; + background: #fc4a1a; + font-size: 17px; + font-weight: bold !important; +} + +.mec-wrap.mec-modern-search-bar + .mec-text-input-search + + input#mec-search-bar-input { + margin-left: 0; +} + +.mec-wrap.mec-modern-search-bar + .mec-search-form + .mec-dropdown-wrap + .mec-dropdown-search + select { + height: 45px; + background: rgba(255, 255, 255, 0.99); + border-radius: 2px; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) inset; + border: 1px solid #ccc; + padding-right: 13px; + font-size: 16px; + border-left: 0; +} + +.mec-wrap.mec-modern-search-bar .mec-search-form .mec-dropdown-wrap i { + height: 45px; + background: #ffff; + border-radius: 2px 0 0 2px; + box-shadow: none; + border: 1px solid #ccc; + font-size: 15px; + padding-top: 14px; + border-right: 0; + color: #40d9f1; + margin-right: -1px; +} + +.mec-wrap.mec-modern-search-bar .mec-search-form .mec-dropdown-wrap { + min-height: 64px; +} + +@media (max-width: 768px) { + .mec-wrap.mec-modern-search-bar .mec-search-form .mec-text-input-search { + width: 70%; + } + + .mec-wrap.mec-modern-search-bar input#mec-search-bar-input { + width: calc(100% - 72%); + } +} + +@media (max-width: 480px) { + .mec-wrap.mec-modern-search-bar input#mec-search-bar-input { + width: 92%; + padding: 0 10px; + position: relative; + display: block; + margin-left: 11px; + } + + .mec-wrap.mec-modern-search-bar .mec-search-form .mec-text-input-search { + width: 100%; + margin-bottom: 20px; + } + + .mec-wrap.mec-modern-search-bar + .mec-text-input-search + + input#mec-search-bar-input { + margin-left: 10px; + } +} + +/* Related Events */ + +.mec-wrap .mec-related-events-wrap { + margin-left: 0; + margin-right: 0; +} + +.mec-related-events { + margin-right: -15px; + margin-left: -15px; +} + +@media (max-width: 980px) { + .mec-related-events { + margin-right: -10px; + margin-left: -10px; + } +} + +.mec-related-events-wrap { + margin-top: 50px; +} + +.mec-related-events-wrap h3.mec-rec-events-title:before { + content: ""; + background: #2c2f34; + width: 46px; + height: 4px; + position: absolute; + top: 59px; + left: 0; +} + +.mec-related-events-wrap h3.mec-rec-events-title { + font-size: 21px; + font-weight: 600; + padding: 17px 0; + margin-bottom: 28px; + text-transform: uppercase; + border-bottom: 1px solid #e8e8e8; + position: relative; +} + +.mec-related-event-post figure { + margin: 0; +} + +.mec-related-event-post figure img { + width: 100%; + border-radius: 3px; + height: auto; +} + +.mec-related-event-content { + background-color: #fff; + margin: -40px 20px 15px; + border-radius: 2px; + position: relative; + max-width: 90%; + padding: 10px 12px 16px 17px; +} + +.mec-related-event-content h5 a { + font-size: 16px; + color: #121212; + font-weight: 600; + transition: all 0.3s ease; +} + +@media (max-width: 480px) { + .mec-wrap .mec-related-events .mec-related-event-post { + padding-right: 15px; + padding-left: 15px; + } +} + +/* Next / Previous Events */ +.mec-next-previous-events { + width: 100%; + height: 104px; + display: block; + padding: 0; + margin: 0; +} + +.mec-next-previous-events li { + list-style: none; + width: 50%; + display: inline-block; + margin: 40px 0 40px; +} + +.mec-next-previous-events li:last-child { + text-align: right; + float: right; +} + +.mec-next-previous-events li a { + padding: 9px 14px 9px 14px; + border: 1px solid #000; + transition: 0.3s; +} + +.mec-wrap .mec-next-previous-events li a:hover { + color: #fff !important; +} + +.mec-previous-event { + float: left; + text-align: left; +} + +.mec-next-event ul { + padding-left: 0; + margin: 0; +} + +.mec-next-previous-events .mec-previous-event i { + padding-right: 20px; +} + +.mec-next-previous-events .mec-next-event i { + padding-left: 20px; +} + +.mec-next-multiple ul { + padding: 0; + margin: 0; +} + +.mec-next-multiple ul li a { + display: block; + position: relative; + padding: 11px 14px 9px; + z-index: 9; +} + +.mec-next-multiple ul .mec-time, +.mec-next-multiple ul .mec-date { + display: inline-block; +} + +.mec-next-multiple ul .mec-time { + width: 40%; +} + +.mec-next-multiple ul .mec-date { + width: 60%; +} + +.mec-next-multiple ul .mec-date { + float: left; + text-align: left; +} + +.mec-next-multiple ul .mec-time { + text-align: right; + position: relative; + z-index: -1; +} + +.mec-next-multiple ul .mec-time dd { + margin: 0; + padding: 0; +} + +.mec-next-multiple ul .mec-date .mec-end-date-label, +.mec-next-multiple ul .mec-time .mec-events-abbr, +.mec-next-multiple ul .mec-date .mec-start-date-label { + font-size: 11px; + line-height: 24px; +} + +@media (max-width: 1280px) { + .mec-next-multiple ul li a { + padding: 7px 9px 5px; + } + + .mec-next-multiple ul .mec-time .mec-events-abbr, + .mec-next-multiple ul .mec-date .mec-start-date-label { + font-size: 12px; + } +} + +@media (max-width: 480px) { + .mec-next-previous-events li { + list-style: none; + width: 100%; + display: block; + margin: 10px 0; + float: unset; + } + + .mec-next-previous-events li a { + width: 100%; + max-width: 100%; + float: unset; + display: block; + text-align: center; + font-size: 16px; + } +} + +/* Fronrend Organizer Payment */ +.mec-fes-form-cntt #mec-organizer-payments ul { + list-style: none; + background: transparent; + margin: 0; + padding-left: 0; +} + +.mec-fes-form-cntt #mec-organizer-payments ul li h4 { + background: transparent; + letter-spacing: 0.2px; + display: inline-block; + padding-left: 0 !important; + padding-bottom: 10px !important; + margin: 0; + margin-bottom: 1px; + letter-spacing: 1px; + text-transform: capitalize; + padding-top: 1px; +} + +.mec-fes-form-cntt #mec-organizer-payments ul > li { + width: 100%; + display: inline-block; + vertical-align: top; + padding: 0; + margin: 0; +} + +.mec-fes-form #mec_gateway_options_form_stripe_connection_button { + padding: 9px 13px !important; +} + +/* Login Module */ +#mec-login-form.mec-login-form { + width: 100%; + background: #fff; + padding: 20px; + margin: 0 auto; + text-align: center; + position: relative; +} + +#mec-login-form.mec-login-form .mec-login-input { + display: block; + width: 286px; + margin: 0 auto; + margin-bottom: 12px; +} + +#mec-login-form.mec-login-form .mec-login-forgotpassword { + display: inline-block; +} + +.mec-login-forgotpassword a { + color: #000; +} + +#mec-login-form.mec-login-form .mec-login-submit { + float: right; + text-align: right; + width: 49%; + padding-right: 2px; +} + +#mec-login-form.mec-login-form .mec-login-input input { + border: none; + box-shadow: none; + background: #fff; + color: #ccc; + border-left: 1px solid #e6e6e6; + border-radius: 0; + padding: 0; + height: 100%; + background-image: none !important; + padding-left: 10px; + padding-right: 0; + width: 222px; + margin-left: 0; + clear: none; + float: left; +} + +#mec-login-form.mec-login-form .mec-login-input label { + border: 1px solid #e6e6e6; + height: 52px; + display: inline-block; + padding: 0; + border-radius: 3px; + overflow: hidden; + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04); +} + +#mec-login-form.mec-login-form + .mec-login-input + label + i:not(.mec-sl-display-controller-password) { + padding: 15px 13px 17px 16px; + vertical-align: middle; + font-size: 20px; + width: 50px; + color: #c5cad0; + background: #fafafa; + margin-right: 0; + float: left; +} + +#mec-login-form.mec-login-form .mec-login-forgotpassword { + float: left; + width: 49%; + text-align: left; + padding-top: 10px; + font-size: 13px; + padding-left: 2px; +} + +#mec-login-form.mec-login-form button { + width: 120px; + height: 44px; + font-size: 12px; + font-weight: 700; + letter-spacing: 1px; + text-transform: uppercase; + transition: all 0.22s ease; + margin: 0; + min-width: unset; +} + +.mec-login-form button { + box-shadow: 0 4px 22px -7px #40d9f1; + background-color: #40d9f1; +} + +#mec-login-form.mec-login-form .mec-login-form-footer { + width: 286px; + margin: 0 auto; + margin-top: 20px; + clear: both; + position: relative; + display: block; + min-height: 50px; +} + +#mec-login-form.mec-login-form .mec-ajax-login-loading { + position: absolute; + background: #ffffffc2; + left: 0; + right: 0; + top: 0; + bottom: 0; +} + +#mec-login-form.mec-login-form .lds-ripple { + position: absolute; + width: 64px; + height: 64px; + top: calc(50% - 23px); + left: calc(50% - 23px); +} + +#mec-login-form.mec-login-form .lds-ripple div { + position: absolute; + border: 4px solid #40d9f1; + opacity: 1; + border-radius: 50%; + animation: lds-ripple 1.2s cubic-bezier(0, 0.2, 0.1, 0.8) infinite; +} + +#mec-login-form.mec-login-form .lds-ripple div:nth-child(2) { + animation-delay: -0.5s; +} + +#mec-login-form.mec-login-form .mec-ajax-login-loading-text { + position: absolute; + min-width: 200px; + top: calc(50% - 18px); + left: calc(50% - 124px); + color: #fff; + padding: 10px 22px; + border-radius: 3px; + background: #fff; + height: 47px; +} + +#mec-login-form.mec-login-form .mec-ajax-login-loading-text strong { + color: #3fcc60; +} + +#mec-login-form.mec-login-form .mec-ajax-login-loading-text strong:before { + content: ""; + position: absolute; + top: 8px; + left: 1px; + border-right: 2px solid #3fcc60; + border-bottom: 2px solid #3acb5c; + transform: rotate(45deg); + transform-origin: 0 100%; + color: #000; + animation: checkbox-check 130ms 140ms cubic-bezier(0.4, 0, 0.23, 1) forwards; + width: 8px; + height: 14px; +} + +#mec-login-form.mec-login-form .mec-ajax-login-loading-text.error strong:after { + content: ""; + position: absolute; + top: 14px; + left: 5px; + border-bottom: 2px solid #ff5d39; + transform: rotate(45deg); + transform-origin: 0 100%; + color: #000; + animation: checkbox-check 130ms 140ms cubic-bezier(0.4, 0, 0.23, 1) forwards; + width: 14px; + height: 4px; +} + +#mec-login-form.mec-login-form .mec-ajax-login-loading-text.error strong { + color: #ff5d39; +} + +#mec-login-form.mec-login-form + .mec-ajax-login-loading-text.error + strong:before { + border-color: #ff5d39; + border-bottom: none; +} + +@keyframes lds-ripple { + 0% { + top: 28px; + left: 28px; + width: 0; + height: 0; + opacity: 1; + } + + 100% { + top: -1px; + left: -1px; + width: 58px; + height: 58px; + opacity: 0; + } +} + +/* Stripe V3 */ + +.mec-card-element-stripe { + margin-bottom: 30px; +} + +.mec-book-form-gateway-checkout + [id*="mec_do_transaction_stripe_"] + .mec-form-row.mec-stripe-name-and-email-wrapper { + width: 100%; +} + +.mec-book-form-gateway-checkout + [id*="mec_do_transaction_stripe_"] + .mec-form-row.mec-stripe-name-and-email-wrapper + .mec-form-row { + width: 50%; +} + +.mec-book-form-gateway-checkout + [id*="mec_do_transaction_stripe_"] + .mec-form-row.mec-stripe-name-and-email-wrapper + .mec-form-row:nth-child(2) { + margin-left: 12px; +} + +.mec-book-form-gateway-checkout + [id*="mec_do_transaction_stripe_"] + .mec-form-row.mec-stripe-name-and-email-wrapper + .mec-form-row + input { + max-width: unset; + margin-bottom: 20px; +} + +.mec-events-meta-group-booking .StripeElement--invalid { + border-color: #fa755a; +} + +.mec-events-meta-group-booking .StripeElement--webkit-autofill { + background-color: #fefde5 !important; +} + +/* front-end submition new edition */ + +#mec_occurrences_add { + position: relative; + top: -2px; +} + +.mec-occurrences-wrapper ul.mec-occurrences-list { + list-style: none; + padding: 0; +} + +.mec-occurrences-wrapper ul.mec-occurrences-list li.mec_occurrences_item { + border: 2px dashed #eee; +} + +.mec-occurrences-wrapper ul.mec-occurrences-list li.mec_occurrences_item { + border: 2px dashed #eee; + padding: 20px; +} + +.mec-occurrences-wrapper ul.mec-occurrences-list li.mec_occurrences_item h3 { + font-size: 1rem; +} + +.mec-occurrences-wrapper ul.mec-occurrences-list li.mec_occurrences_item h3 { + font-size: 1rem; + position: relative; +} + +.mec-occurrences-wrapper + ul.mec-occurrences-list + li.mec_occurrences_item + h3 + span.mec-occurrences-delete-button { + position: absolute; + right: 10px; + top: 0; + margin: 0; + padding: 6px 8px !important; + font-size: 11px; + line-height: 12px !important; + min-height: 10px; + height: auto; + display: block; + cursor: pointer; + color: #ea6485; + border: 2px solid #ffd2dd; + border-radius: 3px; + letter-spacing: 0.4px; +} + +.mec-occurrences-wrapper + ul.mec-occurrences-list + li.mec_occurrences_item + h3 + span.mec-occurrences-delete-button:hover { + background: #ea6485; + color: #fff; + border-color: #ea6485; + box-shadow: 0 2px 6px -3px #ea6485; +} + +ul#mec_bfixed_form_fields li .mec_bfixed_field_remove, +ul#mec_orgz_form_row li .mec-additional-organizer-remove, +ul#mec_reg_form_fields li .mec_reg_field_remove, +.mec-booking-tab-content .mec-reg-field-add-option, +.mec-booking-tab-content .mec-bfixed-field-add-option, +.mec-booking-tab-content .button, +.mec-fes-form .mec-form-row .button:not(.wp-color-result), +.mec-fes-form input[type="file"], +#mec_occurrences_add { + height: 40px; + margin-top: 1px; + text-decoration: none; + font-size: 14px; + line-height: 34px !important; + margin: 0; + padding: 0 15px 1px !important; + text-transform: none; + letter-spacing: 0; + font-weight: 600; + color: #40d9f1; + background: #fff; + border-radius: 3px; + margin-right: 8px; + border: 2px solid #cfeff5; + box-shadow: 0 2px 6px -3px #cfeff5; +} + +.mec-fes-form .mec-additional-organizers .select2-container { + margin-bottom: 0; +} + +.mec-booking-tab-content .mec-bfixed-field-add-option:hover, +.mec-booking-tab-content .mec-reg-field-add-option:hover, +.mec-booking-tab-content .button:hover, +.mec-fes-form .mec-form-row .button:not(.wp-color-result):hover { + background: #40d9f1; + color: #fff; + border-color: #40d9f1; + box-shadow: 0 2px 6px -3px #40d9f1; +} + +.mec-fes-form .mec-form-row input + button.button { + vertical-align: top; +} + +.mec-fes-form .mec-form-row .quicktags-toolbar input.button.button-small { + border-width: 1px; + padding: 0 7px; + color: #80c6d2; + font-weight: 400; + margin: 1px; + transform: none; +} + +.mec-fes-form input[type="file"] { + max-width: 166px; + text-align: center; + height: 44px; + transition: all 0.2s ease; + border-radius: 5px !important; + border: 2px dashed #b8e9f3; +} + +.mec-fes-form input[type="file"]:hover { + box-shadow: 0 2px 16px -3px #cfeff5; +} + +.mec-fes-form input[type="file"]::-webkit-file-upload-button { + visibility: hidden; + width: 1px; + height: 38px; +} + +.mec-fes-form input[type="file"]::-moz-file-upload-button { + visibility: hidden; + width: 1px; + height: 38px; +} + +.mec-fes-form .mec-meta-box-fields > label { + padding: 0; +} + +#mec_bfixed_form_fields li, +#mec_orgz_form_row li, +#mec_reg_form_fields li { + list-style: none; +} + +ul#mec_bfixed_form_fields, +ul#mec_orgz_form_row, +ul#mec_reg_form_fields { + padding: 0; + margin: 0; +} + +ul#mec_bfixed_form_fields li, +ul#mec_orgz_form_row li, +ul#mec_reg_form_fields li { + background: #f8feff; + margin: 6px -20px; + padding: 15px 25px 10px; + width: auto; + font-size: 13px; + border-top: 1px solid #e8fafd; + border-bottom: 1px solid #e8fafd; + position: relative; +} + +ul#mec_bfixed_form_fields li .mec_bfixed_field_remove, +ul#mec_orgz_form_row li .mec-additional-organizer-remove, +ul#mec_reg_form_fields li .mec_reg_field_remove { + position: absolute; + right: 10px; + top: 10px; + margin: 0; + padding: 6px 8px !important; + font-size: 11px; + line-height: 12px !important; + min-height: 10px; + height: auto; + display: block; + cursor: pointer; + color: #ea6485; + border-color: #ffd2dd; + letter-spacing: 0.4px; +} + +ul#mec_bfixed_form_fields li .mec_bfixed_field_remove:hover, +ul#mec_orgz_form_row li .mec-additional-organizer-remove:hover, +ul#mec_reg_form_fields li .mec_reg_field_remove:hover { + background: #ea6485; + color: #fff; + border-color: #ea6485; + box-shadow: 0 2px 6px -3px #ea6485; +} + +/* from backend */ +#mec_bfixed_form_fields input[type="checkbox"], +#mec_bfixed_form_fields input[type="radio"], +#mec_reg_form_fields input[type="checkbox"], +#mec_reg_form_fields input[type="radio"], +.mec-form-row input[type="checkbox"], +.mec-form-row input[type="radio"] { + background-color: #fff; + border: 1px solid #cfeff5; + box-shadow: 0 1px 3px -1px #cfeff5; + padding: 9px; + border-radius: 3px; + min-width: 24px; + min-height: 24px; + display: inline-block !important; + vertical-align: middle; + float: none; + transition: all 0.18s ease; + outline: none; + margin: 1px 4px 4px 0; + text-align: left; + cursor: pointer; + -webkit-appearance: none; + -moz-appearance: none; +} + +#mec_bfixed_form_fields input[type="checkbox"]:focus, +#mec_bfixed_form_fields input[type="radio"]:focus, +#mec_reg_form_fields input[type="checkbox"]:focus, +#mec_reg_form_fields input[type="radio"]:focus, +.mec-form-row input[type="checkbox"]:focus, +.mec-form-row input[type="radio"]:focus { + outline: none; +} + +#mec_bfixed_form_fields input[type="radio"], +#mec_reg_form_fields input[type="radio"], +.mec-form-row input[type="radio"] { + -webkit-appearance: none; + border-radius: 20px !important; + min-width: 20px; + min-height: 20px; + margin: 0 0 4px 0; + vertical-align: middle; +} + +#mec_bfixed_form_fields input[type="checkbox"]:hover, +#mec_bfixed_form_fields input[type="radio"]:hover, +#mec_reg_form_fields input[type="checkbox"]:hover, +#mec_reg_form_fields input[type="radio"]:hover, +.mec-form-row input[type="checkbox"]:hover, +.mec-form-row input[type="radio"]:hover { + border-color: #40d9f1; +} + +#mec_bfixed_form_fields input[type="checkbox"]:checked, +#mec_bfixed_form_fields input[type="radio"]:checked, +#mec_reg_form_fields input[type="checkbox"]:checked, +#mec_reg_form_fields input[type="radio"]:checked, +.mec-fes-form .mec-form-row input[type="checkbox"]:checked, +.mec-fes-form .mec-form-row input[type="radio"]:checked { + box-shadow: 0 1px 6px -2px #40d9f1; + border-color: #40d9f1; + background: #40d9f1; + border-radius: 2px; + position: relative; +} + +.mec-form-row input[type="radio"]:checked { + box-shadow: 0 1px 6px -2px #40d9f1, inset 0 0 0 3px #fff !important; +} + +#mec_bfixed_form_fields input[type="checkbox"]:checked::before, +#mec_reg_form_fields input[type="checkbox"]:checked::before, +.mec-form-row input[type="checkbox"]:checked:before { + content: ""; + font: normal; + position: absolute; + top: 12px; + left: 5px; + margin: 0; + vertical-align: middle; + line-height: 1; + border-right: 2px solid #fff !important; + border-bottom: 2px solid #fff !important; + transform: rotate(45deg); + transform-origin: 0% 100%; + color: #fff; + transition: all 0.2s ease; + animation: checkbox-check 130ms 140ms cubic-bezier(0.4, 0, 0.23, 1) forwards; +} + +@keyframes checkbox-check { + 0% { + width: 0; + height: 0; + border-color: #fff; + transform: translate3d(0, 0, 0) rotate(45deg); + } + + 33% { + width: 6px; + height: 0; + transform: translate3d(0, 0, 0) rotate(45deg); + } + + 100% { + width: 6px; + height: 12px; + border-color: #fff; + transform: translate3d(0, -12px, 0) rotate(45deg); + } +} + +/* Deep Theme and BuddyPress style on MEC Event Data */ +#wrap #mec-event-data input[type="radio"] { + position: relative; +} + +#wrap #mec-event-data input[type="radio"]:empty::before { + display: none; +} + +#mec_bfixed_form_field_types .button, +#mec_reg_form_field_types .button { + position: relative; + outline: 0; + border-radius: 50px; + padding: 2px 21px 2px 31px !important; + line-height: 1; + font-size: 11px; + font-weight: 600; + color: #40d9f1; + letter-spacing: 2px; + height: auto; + cursor: pointer; + margin-top: 5px; + text-transform: uppercase; + box-shadow: 0 2px 6px -3px #40d9f1; + border: 2px solid #cfeff5; +} + +#mec_meta_box_tickets_form [id^="mec_ticket_row"] button, +#mec_fes_organizer_remove_image_button, +#mec_fes_location_remove_image_button, +#mec_meta_box_hourly_schedule_days + [id^="mec_meta_box_hourly_schedule_day_"] + .mec-form-row.mec-box + .button, +#mec_meta_box_hourly_schedule_days + [id^="mec_meta_box_hourly_schedule_day_"] + .mec-col-1 + .button, +#mec_reg_form_field_types .button.red { + color: #ea6485; + box-shadow: 0 2px 6px -3px #ea6485; + background: #fff; + border-color: #ffd2dd; +} + +#mec_meta_box_tickets_form [id^="mec_ticket_row"] button:hover, +#mec_fes_organizer_remove_image_button:hover, +#mec_fes_location_remove_image_button:hover, +#mec_meta_box_hourly_schedule_days + [id^="mec_meta_box_hourly_schedule_day_"] + .mec-form-row.mec-box + .button:hover, +#mec_meta_box_hourly_schedule_days + [id^="mec_meta_box_hourly_schedule_day_"] + .mec-col-1 + .button:hover, +#mec_reg_form_field_types .button.red:hover { + background: #ea6485; + color: #fff; +} + +#mec_bfixed_form_field_types .button:before, +#mec_reg_form_field_types .button:before { + position: absolute; + left: 12px; + color: #40d9f1; + content: "\e095"; + font-family: simple-line-icons; + font-size: 13px; + display: inline-block; +} + +#mec_reg_form_field_types .button.red:before { + color: #ea6485; +} + +#mec_reg_form_field_types .button.red:hover:before, +#mec_bfixed_form_field_types .button:hover:before, +#mec_reg_form_field_types .button:hover:before { + color: #fff; +} + +#mec_meta_box_tickets_form [id^="mec_ticket_row"] button:hover, +#mec_fes_organizer_remove_image_button:hover, +#mec_fes_location_remove_image_button:hover, +#mec_meta_box_hourly_schedule_days + [id^="mec_meta_box_hourly_schedule_day_"] + .mec-form-row.mec-box + .button:hover, +#mec_meta_box_hourly_schedule_days + [id^="mec_meta_box_hourly_schedule_day_"] + .mec-col-1 + .button:hover, +#mec_price_per_dates_container .button:hover, +#mec_reg_form_field_types .button.red:hover { + color: #fff; + border: 2px solid #ea6485; +} + +#mec_ticket_variations_list [id^="mec_remove_ticket_variation_button"], +#mec_taxes_fees_container_toggle [id^="mec_remove_fee_button"] { + color: #ea6485; + border-color: #ffd2dd; +} + +#mec_ticket_variations_list [id^="mec_remove_ticket_variation_button"]:hover, +#mec_taxes_fees_container_toggle [id^="mec_remove_fee_button"]:hover { + color: #fff; + border: 2px solid #ea6485; + background: #ea6485; +} + +#mec_fees_list [id^="mec_remove_fee_button"], +#mec_meta_box_ticket_variations_form + .mec-form-row + [id^="mec_remove_ticket_variation_button"] { + margin-left: 14px !important; +} + +#mec_meta_box_hourly_schedule_days .mec-add-hourly-schedule-button { + line-height: 10px !important; +} + +#mec_meta_box_tickets_form [id^="mec_ticket_row"] .mec_add_price_date_button { + color: #40d9f1; + box-shadow: 0 2px 6px -3px #40d9f1; + border: 2px solid #cfeff5; +} + +#mec_meta_box_tickets_form + [id^="mec_ticket_row"] + .mec_add_price_date_button:hover, +#mec_reg_form_field_types .button:hover { + color: #fff; + border: 2px solid #40d9f1; + background: #40d9f1; +} + +.mec-fes-form #mec_reg_form_fields span.mec_reg_field_sort, +.mec-fes-form #mec_orgz_form_row span.mec-additional-organizer-sort, +.mec-fes-form #mec_bfixed_form_fields span.mec_bfixed_field_sort { + font-size: 0; + color: #fff; + padding-left: 20px; +} + +.mec-fes-form #mec_reg_form_fields .mec_reg_field_options, +.mec-fes-form #mec_bfixed_form_fields .mec_bfixed_field_option_sort, +.mec-fes-form #mec_orgz_form_row span.mec-additional-organizer-sort, +.mec-fes-form #mec_reg_form_fields span.mec_reg_field_option_sort { + font-size: 0; +} + +.mec-fes-form #mec_reg_form_fields span.mec_reg_field_option_sort:before, +.mec-fes-form #mec_reg_form_fields span.mec_reg_field_options:before, +.mec-fes-form #mec_orgz_form_row span.mec-additional-organizer-sort:before, +.mec-fes-form #mec_reg_form_fields span.mec_reg_field_sort:before, +.mec-fes-form #mec_bfixed_form_fields span.mec_bfixed_field_option_sort:before, +.mec-fes-form #mec_bfixed_form_fields span.mec_bfixed_field_sort:before { + position: absolute; + left: px; + top: 12px; + width: 80px; + height: 20px; + display: block; + cursor: move; + font-family: simple-line-icons; + content: "\e023"; + font-size: 18px; + color: #888; +} + +.mec-fes-form #mec_reg_form_fields span.mec_reg_field_option_sort:before, +.mec-fes-form #mec_reg_form_fields span.mec_reg_field_options:before, +.mec-fes-form #mec_bfixed_form_fields span.mec_bfixed_field_option_sort:before { + font-size: 13px; + left: 2px; + top: 26px; + width: 14px; + height: 14px; +} + +.mec-fes-form #mec_reg_form_fields .mec_reg_field_options, +.mec-fes-form #mec_bfixed_form_fields .mec_bfixed_field_options { + margin-top: 20px; +} + +.mec-fes-form + #mec_fes_form + #mec_bfixed_form_fields + .mec_bfixed_notification_placeholder { + font-size: 0; +} + +.mec-form-row select + span.mec-tooltip, +.mec-form-row input + span.mec-tooltip { + bottom: 10px; +} + +.mec-form-row label + span.mec-tooltip { + bottom: 8px; +} + +.mec-form-row textarea + span.mec-tooltip { + bottom: auto; + vertical-align: top; + top: 12px; +} + +.mec-form-row span + span.mec-tooltip { + bottom: 0; + vertical-align: middle; +} + +.mec-form-row .mec-col-8 span.mec-archive-skins, +.mec-form-row .mec-col-8 select, +.mec-form-row .mec-col-8 input[type="text"] { + vertical-align: top; +} + +.mec-form-row input:disabled { + opacity: 0.6; + background: #f6f6f6; +} + +.mec-form-row p { + font-size: 12px !important; + line-height: 18px !important; + color: #97b2bb !important; +} + +.mec-form-row p.description { + font-style: italic; +} + +.ui-datepicker.ui-widget { + border: 1px solid #e8e8e8; + box-shadow: 0 1px 9px rgba(0, 0, 0, 0.12); +} + +table.ui-datepicker-calendar { + margin-bottom: 0; +} + +.ui-datepicker-calendar th { + font-weight: 700; + color: #4a4b4c; +} + +.ui-datepicker-calendar tr, +.ui-datepicker-calendar td, +.ui-datepicker-calendar th { + border: none; +} + +.ui-datepicker.ui-widget select { + font-weight: 600; + font-size: 12px; + display: inline-block; + border-radius: 2px; + padding: 2px 10px; + margin: 5px 3px; + width: auto; + min-height: 20px; + height: 26px; + border: 1px solid #e3e3e3; + box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04); +} + +.ui-datepicker.ui-widget table { + border-spacing: 2px; + border: none; +} + +.ui-datepicker.ui-widget td, +.ui-datepicker.ui-widget tr { + padding: 0; + background: none !important; +} + +.ui-datepicker.ui-widget td a { + color: #9a9b9c; + font-weight: 600; + width: 30px; + height: 30px; + line-height: 30px; + display: inline-block; + border-radius: 33px; + padding: 0; + background: #fff; + transition: all 0.2s ease; +} + +.ui-datepicker.ui-widget td a:hover, +.ui-datepicker.ui-widget td a.ui-state-active { + background: #40d9f1; + color: #fff; +} + +.ui-datepicker.ui-widget .ui-datepicker-next, +.ui-datepicker.ui-widget .ui-datepicker-prev { + color: #40d9f1; + width: 30px; + height: 30px; + line-height: 30px; + display: inline-block; + text-align: center; + border-radius: 33px; + background: #ecfcff; + transition: all 0.2s ease; +} + +.ui-datepicker.ui-widget .ui-datepicker-next:hover, +.ui-datepicker.ui-widget .ui-datepicker-prev:hover { + background: #fff; + box-shadow: 0 0 7px -3px rgba(0, 0, 0, 0.4); +} + +.mec-fes-form .mec-tooltip .dashicons-before:before { + color: #40d9f1; +} + +.mec-fes-form button[type="submit"].mec-fes-sub-button { + border-radius: 3px; + background: #40d9f1; + color: #fff; + height: 54px; + font-size: 17px; + font-weight: 700; + box-shadow: 0 2px 8px -4px #40d9f1; + display: block; + transition: all 0.28s ease; + text-transform: uppercase; + margin: 20px 0 0; + padding: 14px 20px; + border: 0; + cursor: pointer; + text-align: center; + letter-spacing: 0.1em; + line-height: 1; +} + +.mec-fes-form button[type="submit"].mec-fes-sub-button:hover { + box-shadow: 0 2px 12px -2px #40d9f1; +} + +.mec-fes-form button[type="submit"].mec-fes-sub-button:focus { + margin-bottom: -2px; + background: #1dc2dc; +} + +.mec-fes-form .mec-title span.mec-dashicons { + color: #40d9f1; + float: left; + margin-right: 5px; +} + +.mec-fes-form .mec-tooltip .box h5 { + padding: 14px 2px; +} + +#mec_fes_form, +.mec-fes-form-top-actions { + max-width: 838px; + margin: 0 auto; +} + +@media only screen and (min-width: 961px) { + .mec-fes-form .mec-fes-form-cntt { + width: calc(100% - 300px); + float: left; + padding-right: 20px; + max-width: 538px; + display: block; + } + + .mec-fes-form .mec-fes-form-sdbr { + width: 300px; + } +} + +.mec-fes-form div.mce-toolbar-grp, +.mec-fes-form .quicktags-toolbar { + background: #ecfcff; + border-bottom: 1px solid #cfeff5; + box-shadow: 0 1px 0 1px #cfeff5; +} + +.mec-fes-form .quicktags-toolbar { + margin-right: -1px; + border-top: 1px solid #cfeff5; +} + +.mec-fes-form div.mce-statusbar { + border-top-color: #cfeff5; +} + +.mec-fes-form .mce-toolbar .mce-btn-group .mce-btn.mce-listbox { + border: 1px solid #cfeff5; + border-radius: 3px; +} + +.mec-fes-form .mce-tinymce.mce-container.mce-panel { + border: 1px solid #cfeff5; + box-shadow: 0 2px 6px -3px #cfeff5; + border-radius: 2px 0 2px 2px; +} + +.mec-fes-form .wp-editor-tools .wp-media-buttons { + transform: translateY(-6px); + margin-top: -6px; +} + +.mec-fes-form .wp-editor-tabs { + padding-right: 0; + margin-right: -2px; +} + +.mec-fes-form .wp-editor-tabs .wp-switch-editor { + border-radius: 3px 3px 0 0; + border-color: #cfeff5; + background: #fff; + color: #96b8bd; + border-bottom: 1px solid #ecfcff; +} + +.mec-fes-form .wp-editor-tabs .wp-switch-editor:active, +.mec-fes-form .html-active .switch-html, +.mec-fes-form .tmce-active .switch-tmce { + background: #ecfcff; + color: #40d9f1; +} + +.mec-fes-form .wp-editor-container, +.mec-fes-form div.mce-edit-area.mce-panel { + border: none; + box-shadow: none; +} + +.mec-fes-form .wp-editor-container textarea.wp-editor-area { + max-width: 100%; +} + +.mec-fes-form .mce-toolbar .mce-listbox button { + font-size: 12px; + line-height: 22px; + color: #798f96; +} + +.mec-fes-form .mce-toolbar .mce-ico { + color: #627f88; +} + +.mec-fes-form .mce-toolbar .mce-btn-group .mce-btn.mce-active, +.mec-fes-form .mce-toolbar .mce-btn-group .mce-btn:active, +.mec-fes-form .qt-dfw.active { + background: #fff; + border-color: #40d9f1; + box-shadow: inset 0 2px 6px -3px rgba(106, 231, 255, 0.7); +} + +.mec-fes-form .mce-toolbar .mce-btn-group .mce-btn.mce-active .mce-ico { + color: #40d9f1; +} + +body .mce-menu .mce-menu-item.mce-active.mce-menu-item-normal, +body.mce-menu .mce-menu-item.mce-active.mce-menu-item-preview, +body .mce-menu .mce-menu-item.mce-selected, +body .mce-menu .mce-menu-item:focus, +body .mce-menu .mce-menu-item:hover { + background: #40d9f1; + color: #fff; +} + +.mec-fes-form .mec-not-in-days-day { + display: inline-block; + padding: 4px 32px 4px 15px; + border-radius: 33px; + border: 1px solid #cfeff5; + box-shadow: 0 1px 3px -1px #cfeff5; + background: #fbfeff; + color: #40d9f1; + vertical-align: top; +} + +.mec-fes-form .mec-not-in-days-remove { + display: inline-block; + padding: 0 1px 0 0; + margin-left: -30px; + vertical-align: sub; + background: #ff918a; + color: #fff; + font-family: cursive; + width: 21px; + height: 21px; + line-height: 17px; + text-align: center; + border-radius: 20px; + cursor: pointer; +} + +.mec-fes-list ul li .mec-event-status { + float: left; + margin-right: 10px; + margin-left: 0; + font-size: 11px; + font-weight: 400; + letter-spacing: 0.3px; + border-radius: 3px; + padding: 4px 8px; +} + +.mec-fes-list ul li .mec-event-status.mec-book-confirmed:before, +.mec-fes-form .post-status.mec-book-confirmed:before { + content: ""; + margin: 0; + vertical-align: middle; + line-height: 1; + border-right: 2px solid #fff !important; + border-bottom: 2px solid #fff !important; + transform: rotate(45deg); + color: #fff; + width: 6px; + height: 12px; + float: left; + margin-right: 6px; +} + +.mec-fes-list ul li .mec-fes-event-remove:before, +.mec-fes-list ul li .mec-fes-event-view a:before, +.mec-fes-list ul li .mec-fes-event-edit a:before, +.mec-fes-list-top-actions a:before, +.mec-fes-list ul li .mec-fes-event-export a:before { + content: "\e054"; + font-family: simple-line-icons; + font-size: 13px; + vertical-align: middle; +} + +.mec-fes-list ul li .mec-fes-event-view a:before { + content: "\e087"; +} + +.mec-fes-list ul li .mec-fes-event-edit a:before { + content: "\e060"; +} + +.mec-fes-list-top-actions a:before { + content: "\e095"; + font-weight: 400; + margin-right: 6px; +} + +.mec-fes-list ul li .mec-fes-event-export a:before { + content: "\e083"; +} + +.mec-fes-form .post-status { + border-radius: 20px; +} + +.mec-fes-form .post-status.mec-book-confirmed:before { + height: 20px; + width: 9px; + margin: 3px 10px; +} + +.ui-datepicker-calendar th, +.ui-datepicker .ui-datepicker-calendar td { + height: auto; + padding: 0; +} + +.ui-datepicker-calendar th, +.ui-datepicker .ui-datepicker-calendar td a { + font-size: 14px; + line-height: 30px; +} + +.ui-datepicker.ui-widget .ui-state-disabled .ui-state-default { + color: #ccc; + width: 30px; + height: 30px; + line-height: 30px; + display: inline-block; +} + +.mec-fes-form .description { + font-size: 16px; +} + +/* FireFox Checkbox */ +.mec-fes-form input[type="file"] { + text-align: left; +} + +/* FES Export */ +.mec-fes-export-wrapper { + width: 640px; + background: #f8feff; + padding: 40px 25px; +} + +.mec-fes-export-wrapper .mec-fes-btn-date { + font-size: 16px; + line-height: 44px; + overflow: hidden; +} + +.mec-fes-export-wrapper .date-messgae { + font-family: sans-serif; + padding: 2px 18px; +} + +.mec-fes-list ul li .mec-event-export-csv, +.mec-fes-list ul li .mec-event-export-excel { + font-size: 12px; + border: 1px solid #40d9f1; + padding: 1px 4px; + background: rgba(141, 229, 243, 0.18); + border-radius: 4px; + color: #40d9f1; + font-family: sans-serif; + cursor: pointer; + display: inline-block; + height: 26px; + line-height: 22px; +} + +.mec-export-badge { + font-size: 11px; + color: #40d9f1; + width: auto; + height: 24px; + line-height: 25px; + display: inline-block; + padding: 0 8px; + text-align: center; + border-radius: 3px; + background: #ecfcff; + transition: all 0.2s ease; +} + +.mec-fes-list ul li .mec-fes-event-export { + font-size: 11px; + background: #f7f7f7; + float: right; + margin-left: 5px; +} + +.mec-fes-list ul li .mec-fes-event-export:hover { + cursor: pointer; + background: rgb(144, 240, 224); + border-color: rgb(77, 200, 204); +} + +.mec-fes-export-wrapper ul { + padding: 0; + width: 100%; + text-align: center; +} + +.mec-fes-export-wrapper ul li { + list-style: none; + display: inline-block; + width: 30%; + padding: 10px 15px 10px 32px; + border-radius: 3px; + margin-bottom: 15px; + border: 1px solid #cfeff5; + box-shadow: 0 2px 6px -4px #cfeff5; + background: #fff; + line-height: normal; + margin-right: 10px; + position: relative; + cursor: pointer; + font-size: 13px; + line-height: 1; + transition: all 0.2s ease; +} + +.mec-fes-export-wrapper ul li:nth-child(3n + 0) { + margin-right: 0; +} + +.mec-fes-export-wrapper ul li:hover { + box-shadow: 0 2px 16px -1px #c6e8ef; +} + +.mec-fes-export-wrapper ul li:before { + content: ""; + position: absolute; + display: inline-block; + background: #fff; + width: 15px; + height: 15px; + margin: -1px 0 0 5px; + cursor: pointer; + border: 2px solid #e1e7ed; + box-shadow: 0 2px 15px -3px rgba(69, 77, 89, 0.32); + border-radius: 50%; + left: 9px; + top: calc(50% - 7px); +} + +.mec-fes-export-wrapper ul li.fes-export-date-active { + color: #40d9f1; +} + +.mec-fes-export-wrapper ul li.fes-export-date-active:before { + width: 15px; + height: 15px; + border: 6px solid #40d9f1; + background: #fff; + box-shadow: 0 3px 16px -3px #40d9f1; +} + +.mec-fes-btn-export { + margin-left: 15px; + margin-top: 12px; +} + +.mec-fes-btn-export span { + position: relative; + border: none; + border-radius: 3px; + color: #fff !important; + display: inline-block; + font-size: 13px; + line-height: 1; + text-transform: none; + font-weight: 400; + text-decoration: none; + cursor: pointer; + margin-right: 4px; + line-height: 1; + letter-spacing: 0; + padding: 15px 22px; + background: #39c36e; + box-shadow: 0 1px 7px -3px #39c36e !important; + -webkit-transition: all 0.21s ease; + -moz-transition: all 0.21s ease; + transition: all 0.21s ease; + cursor: pointer; + margin-left: 6px; +} + +.mec-fes-btn-export span:hover { + background: #222; +} + +span.mec-event-export-csv:before, +.mec-event-export-excel:before { + content: "\e083"; + font-family: simple-line-icons; + font-size: 13px; + vertical-align: middle; + margin-right: 7px; + margin-top: -1px; + display: inline-block; +} + +.mec-fes-list .wn-p-t-right { + min-width: 170px; + max-width: 200px; + display: inline-block; + top: -8px; + left: 50%; + margin-top: 0; + transform: translate(-50%, -100%); + padding: 0; + background-color: #000; + color: #fff; + font-weight: 400; + font-size: 14px; + letter-spacing: 0.5px; + line-height: 1.5; + position: absolute; + z-index: 99999999; + box-sizing: border-box; + border-radius: 6px; + box-shadow: 0 4px 45px -8px #535a61; + visibility: hidden; + opacity: 0; + transition: opacity 0.23s; + padding: 5px 10px 6px; + border-radius: 8px; + text-align: center; + font-style: normal; +} + +.mec-fes-list .mec-fes-event-export:hover .wn-p-t-right, +.mec-fes-list .mec-fes-event-view:hover .wn-p-t-right, +.mec-fes-list .mec-fes-event-remove:hover .wn-p-t-right, +.mec-fes-list .mec-fes-event-edit:hover .wn-p-t-right { + visibility: visible; + opacity: 1; +} + +.mec-fes-list .wn-p-t-right i { + position: absolute !important; + top: 100%; + right: 50%; + margin-top: -6px !important; + margin-right: -6px !important; + width: 12px; + height: 24px; + overflow: hidden; + transform: rotate(-90deg); +} + +.mec-fes-list .wn-p-t-right i:after { + content: ""; + position: absolute; + width: 12px; + height: 12px; + left: 0; + top: 50%; + transform: translate(50%, -50%) rotate(-45deg); + background-color: #000; + box-shadow: 0 8px 9px -4px #535a61; +} + +/* Select 2 Styles */ +.mec-fes-form .select2-container { + min-height: 38px; + box-sizing: border-box; + margin-bottom: 8px; + padding: 0 6px; + border-radius: 2px; + border: 1px solid #ddd; + box-shadow: inset 0 1px 6px rgba(0, 0, 0, 0.07); + background-color: #fff; + color: #32373c; + outline: none; + transition: 0.05s border-color ease-in-out; + min-width: 200px; + font-size: 14px; +} + +.mec-fes-form .select2-selection { + border: none; + background: transparent; + padding-top: 2px; + width: 100%; + height: 100%; +} + +.mec-fes-form + .select2-container--default.select2-container--focus + .select2-selection { + border: none !important; + outline: 0; +} + +.mec-fes-form + .select2-container--default + .select2-selection--single + .select2-selection__arrow { + top: 5px; + right: 4px; +} + +.select2-results { + font-size: 14px; +} + +/* FES SubCategories */ +.mec-fes-category-children .mec-fes-category-children, +.mec-fes-category-children { + padding-left: 24px; +} + +/* Timeline view */ +.mec-timeline-events-container { + margin-left: 19px; + padding-top: 20px; + padding-bottom: 9px; +} + +.mec-events-timeline-wrap { + position: relative; + display: block; + overflow: visible; + padding-left: 95px; +} + +.mec-events-timeline-wrap:before { + width: 1px; + content: ""; + height: 100%; + position: absolute; + background: #b8f5ff; + left: 95px; +} + +.mec-timeline-month-divider + .mec-timeline-events-container { + padding-top: 110px; +} + +.mec-timeline-right-content { + float: right; + width: 300px; +} + +.mec-timeline-left-content { + float: left; + width: calc(100% - 300px); + padding-left: 15px; + padding-right: 15px; + position: relative; +} + +.mec-timeline-month-divider { + position: absolute; + display: block; + background: #fff; + right: calc(100% - 95px); + left: 0; + width: 190px; + text-align: center; + border: 1px solid #b8f5ff; + border-radius: 50px; + font-size: 15px; + padding: 12px 27px; + color: #40d9f1; +} + +.mec-timeline-event-date { + position: relative; +} + +.mec-timeline-events-container .mec-timeline-event-date:before { + content: ""; + width: 11px; + height: 11px; + position: absolute; + background: #40d9f1; + border-radius: 50px; + top: 8px; + left: -24px; + z-index: 9; +} + +.mec-timeline-events-container .mec-timeline-event-date:after { + content: ""; + width: 21px; + height: 21px; + position: absolute; + background: rgba(64, 217, 241, 0.3); + border-radius: 50px; + top: 3px; + left: -29px; +} + +.mec-timeline-event-date { + float: left; + width: 17%; + margin-top: 27px; +} + +.mec-timeline-event-content { + float: left; + width: 82%; + background: #fff; + box-shadow: 0 10px 30px 0 rgba(0, 0, 0, 0.1); + border-radius: 10px; + overflow: visible; + position: relative; +} + +.mec-timeline-main-content { + padding: 23px 30px; +} + +.mec-timeline-main-content h4 { + margin-bottom: 15px; +} + +.mec-timeline-main-content h4 a { + font-size: 25px; + font-weight: bold; + color: #000; + line-height: 33px; + text-decoration: none; +} + +.mec-timeline-main-content p { + font-size: 15px; + color: #515151; + line-height: 24px; + margin-bottom: 36px; +} + +a.mec-timeline-readmore { + width: 100%; + display: block; + text-align: center; + color: #fff; + text-decoration: none; + line-height: 52px; + font-size: 17px; + font-weight: bold; + -webkit-transition: all 0.2s ease; + transition: all 0.2s ease; + border-radius: 0 0 10px 10px; +} + +a.mec-timeline-readmore:hover { + background: #222; + color: #fff; +} + +.mec-timeline-event-time .mec-time-details, +.mec-timeline-event-location address span, +.mec-timeline-event-organizer .mec-organizer-item span, +.mec-timeline-event-categories ul.mec-categories li.mec-category a { + display: inline-block; + font-size: 13px; + font-weight: 500; + color: inherit; +} + +.mec-timeline-event-organizer .mec-shortcode-organizers, +.mec-timeline-event-categories .mec-categories-wrapper { + line-height: unset; +} + +.mec-timeline-event-location, +.mec-timeline-event-time, +.mec-timeline-event-local-time, +.mec-timeline-event-organizer, +.mec-timeline-event-categories { + background: rgba(64, 217, 241, 0.11); + display: inline-block; + padding: 0 20px; + border-radius: 50px; + line-height: 32px; + vertical-align: middle; +} + +.mec-timeline-event-time i, +.mec-timeline-event-organizer i, +.mec-timeline-event-categories i, +.mec-timeline-event-location i { + font-size: 16px; + margin-right: 6px; + position: relative; + top: 2px; +} + +.mec-timeline-event-location address { + font-style: normal; + margin-bottom: 0; +} + +.mec-timeline-event-details + .mec-timeline-event-details { + margin-top: 12px; +} + +.mec-timeline-event-content .col-md-4 { + padding: 0; +} + +.mec-timeline-event-content:after { + content: ""; + display: block; + position: absolute; + left: 50%; + margin-left: -10px; + width: 0; + height: 0; + border-style: solid; + border-width: 10px; +} + +.mec-timeline-event-content:after { + top: 30px; + border-color: transparent #ffffff transparent transparent; + left: -10px; +} + +.mec-timeline-event-image img { + border-radius: 0 10px 0 0; + width: 100%; +} + +.mec-timeline-event-image a { + display: block; + line-height: 0; +} + +a.mec-timeline-readmore i { + vertical-align: middle; + margin-left: 10px; + font-size: 9px; +} + +.mec-wrap .mec-timeline-event-content a.mec-timeline-readmore:hover { + background: #444; +} + +@media (min-width: 1024px) { + .mec-timeline-event { + margin: 50px 0; + } +} + +@media (max-width: 1023px) { + .mec-timeline-event { + margin: 25px 0; + } + + .mec-events-timeline-wrap { + padding-left: 20px; + } + + .mec-events-timeline-wrap:before { + left: 20px; + } +} + +@media (max-width: 1200px) and (min-width: 992px) { + .mec-timeline-event-content { + width: 81%; + } + + .mec-timeline-event-date { + width: 18%; + } +} + +@media (max-width: 992px) { + .mec-timeline-right-content, + .mec-timeline-left-content { + float: none; + width: 100%; + text-align: center; + } + + .mec-timeline-right-content .mec-timeline-event-image { + text-align: center; + } + + .mec-timeline-right-content .mec-timeline-event-image img { + max-width: 300px; + border-radius: 10px; + margin-top: 35px; + } +} + +@media (max-width: 440px) { + .mec-timeline-right-content .mec-timeline-event-image img { + margin-top: 0; + } +} + +@media (max-width: 320px) { + .mec-timeline-event-date, + .mec-timeline-event-content { + float: none; + width: 100%; + } + + .mec-timeline-event-date { + margin-bottom: 8px; + } + + .mec-timeline-event-content:after { + display: none; + } + + .mec-timeline-main-content { + padding: 23px 0; + } + + .mec-timeline-main-content p { + font-size: 13px; + } + + .mec-timeline-main-content h4 a { + font-size: 23px; + line-height: 24px; + } + + .mec-time-details span { + font-size: 11px; + } + + .mec-timeline-event-location address span { + font-size: 12px; + } + + a.mec-timeline-readmore { + line-height: 44px; + font-size: 14px; + } +} + +.mec-timeline-event-image img { + margin-bottom: -7px; + border-radius: 0 10px 10px 0; +} + +.mec-timeline-event-image a img { + margin-bottom: 0; + border-radius: 0 10px 0 0; +} + +/* Tile View */ +.mec-event-tile-view article.mec-tile-item { + height: 400px; + margin: 15px 0; + border-radius: 22px; + padding: 35px 25px; + position: relative; + color: #fff; + background-size: cover !important; + background-position: center !important; + box-shadow: 0 2px 9px rgba(0, 0, 0, 0.25); + transition: all 0.22s ease; +} + +.mec-event-tile-view article.mec-tile-item:hover { + cursor: pointer; + box-shadow: 0 4px 19px rgba(0, 0, 0, 0.5); +} + +.mec-event-tile-view article.mec-tile-item div { + position: relative; + z-index: 3; + line-height: 1.5; +} + +.mec-event-tile-view article.mec-tile-item .mec-categories-wrapper { + color: #fff; +} + +.mec-event-tile-view article.mec-tile-item .mec-categories-wrapper i { + font-size: 16px; +} + +.mec-event-tile-view + article.mec-tile-item + .mec-categories-wrapper + ul.mec-categories + li.mec-category + a, +.mec-event-tile-view article.mec-tile-item .mec-shortcode-organizers { + color: #fff; + font-size: 15px; +} + +.mec-event-tile-view article.mec-tile-item .mec-shortcode-organizers, +.mec-event-tile-view article.mec-tile-item .mec-categories-wrapper, +.mec-event-tile-view article.mec-tile-item .mec-event-loc-place { + margin-bottom: 5px; +} + +.mec-event-tile-view article.mec-tile-item:before, +.mec-event-tile-view article.mec-tile-item:after { + position: absolute; + background: -moz-linear-gradient( + 180deg, + rgba(0, 0, 0, 0.35) 0%, + rgba(0, 0, 0, 0.48) 65%, + rgba(0, 0, 0, 0.72) 100% + ); + background: -webkit-gradient( + left top, + right top, + color-stop(0%, rgba(0, 0, 0, 0.35)), + color-stop(65%, rgba(0, 0, 0, 0.48)), + color-stop(100%, rgba(0, 0, 0, 0.72)) + ); + background: -webkit-gradient( + 180deg, + rgba(0, 0, 0, 0.35) 0%, + rgba(0, 0, 0, 0.48) 65%, + rgba(0, 0, 0, 0.72) 100% + ); + background: linear-gradient( + 180deg, + rgba(0, 0, 0, 0.35) 0%, + rgba(0, 0, 0, 0.48) 65%, + rgba(0, 0, 0, 0.72) 100% + ); + content: ""; + left: 0; + right: 0; + bottom: 0; + top: 0; + width: 100%; + height: 100%; + display: block; + border-radius: 22px; + z-index: 1; +} + +.mec-event-tile-view article.mec-tile-item:after { + background-color: inherit; + background-image: none; + top: 35px; + bottom: auto; + height: 40px; + border-radius: 0 3px 3px 0; + width: 110px; + z-index: 2; + box-shadow: 2px 1px 7px rgba(0, 0, 0, 0.1); +} + +.mec-event-tile-view article.mec-tile-item .event-tile-view-head { + padding: 8px 3px; + font-size: 16px; + font-weight: 700; + margin-bottom: 50px; + text-transform: uppercase; +} + +.mec-event-tile-view article.mec-tile-item .event-tile-view-head > div { + display: inline; +} + +.mec-event-tile-view article.mec-tile-item .mec-event-time { + color: #d6d6d6; + font-size: 15px; + font-weight: 400; + line-height: 1; + padding-top: 4px; + position: absolute; + right: 1px; + top: 10px; +} + +.mec-event-tile-view article.mec-tile-item .mec-event-time i { + vertical-align: baseline; + font-size: 14px; + float: left; +} + +.mec-event-tile-view article.mec-tile-item i { + margin-right: 5px; +} + +.mec-event-tile-view article.mec-tile-item .mec-event-title { + color: #fff; + font-weight: 700; + font-size: 23px; + padding-top: 12px; +} + +.mec-event-tile-view article.mec-tile-item .mec-event-title a { + color: #fff; +} + +.mec-event-tile-view article.mec-tile-item .mec-event-title a:hover { + text-decoration: underline; +} + +.mec-event-tile-view article.mec-tile-item .mec-event-content { + position: absolute; + height: 100%; + bottom: 0; + left: 0; + right: 0; +} + +.mec-event-tile-view article.mec-tile-item .mec-tile-into-content-link { + position: absolute; + content: ""; + top: 0; + right: 0; + left: 0; + bottom: 0; + background: transparent; +} + +.mec-tile-event-content { + position: absolute !important; + bottom: 25px; + left: 25px; + right: 25px; +} + +.mec-event-tile-view article.mec-label-canceled:before, +.mec-event-tile-view article.mec-label-featured:before { + /* top: 17px !important; + left: 110px !important; */ + height: auto; +} + +.mec-skin-tile-month-navigator-container { + position: relative; + text-align: center; + font-size: 12px; + height: 80px; + background: #f7f7f7; + padding: 28px; + border-radius: 11px; + margin-bottom: 20px; +} + +.mec-skin-tile-month-navigator-container:before, +.mec-skin-tile-month-navigator-container:after { + content: ""; + display: block; + position: absolute; + left: 50%; + margin-left: -10px; + width: 0; + height: 0; + border-style: solid; + border-width: 10px; +} + +.mec-skin-tile-month-navigator-container:after { + bottom: -20px; + border-color: #f7f7f7 transparent transparent transparent; +} + +.mec-skin-tile-month-navigator-container:before { + bottom: -21px; + border-color: #ffffff transparent transparent transparent; +} + +@media only screen and (max-width: 480px) { + .mec-skin-tile-month-navigator-container { + height: 110px; + padding-top: 68px; + } +} + +.mec-skin-tile-month-navigator-container h2 { + font-size: 23px; + font-weight: 700; +} + +.mec-skin-tile-month-navigator-container .mec-previous-month, +.mec-skin-tile-month-navigator-container .mec-next-month { + position: absolute; + top: 28px; + left: 20px; + cursor: pointer; + padding: 3px 12px; + line-height: 23px; + background: #fff; + border-radius: 32px; + box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02); + transition: all 0.22s ease; +} + +.mec-skin-tile-month-navigator-container .mec-next-month { + left: auto; + right: 20px; +} + +.mec-skin-tile-month-navigator-container .mec-previous-month:hover, +.mec-skin-tile-month-navigator-container .mec-next-month:hover { + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); + color: #000; +} + +.mec-wrap .mec-event-tile-view article.mec-label-canceled:before, +.mec-wrap .mec-event-tile-view article.mec-label-featured:before { + position: absolute; + bottom: auto; + text-align: center; + right: auto; + font-size: 10px; +} + +/* Tile View Overlay */ +.mec-event-tile-view article.mec-tile-item .mec-tile-overlay { + position: absolute; + background: -moz-linear-gradient( + 180deg, + rgba(0, 0, 0, 0.35) 0, + rgba(0, 0, 0, 0.48) 65%, + rgba(0, 0, 0, 0.72) 100% + ); + background: -webkit-gradient( + left top, + right top, + color-stop(0, rgba(0, 0, 0, 0.35)), + color-stop(65%, rgba(0, 0, 0, 0.48)), + color-stop(100%, rgba(0, 0, 0, 0.72)) + ); + background: -webkit-gradient( + 180deg, + rgba(0, 0, 0, 0.35) 0, + rgba(0, 0, 0, 0.48) 65%, + rgba(0, 0, 0, 0.72) 100% + ); + background: linear-gradient( + 180deg, + rgba(0, 0, 0, 0.35) 0, + rgba(0, 0, 0, 0.48) 65%, + rgba(0, 0, 0, 0.72) 100% + ); + content: ""; + left: 0; + right: 0; + bottom: 0; + top: 0; + width: 100%; + height: 100%; + display: block; + border-radius: 22px; + z-index: 1; +} + +.mec-wrap .mec-event-tile-view .col-md-3 article.mec-label-canceled:before, +.mec-wrap .mec-event-tile-view .col-md-3 article.mec-label-featured:before { + top: 12px; + left: 103px; + z-index: 9; +} + +.mec-wrap .mec-event-tile-view .col-md-4 article.mec-label-canceled:before, +.mec-wrap .mec-event-tile-view .col-md-4 article.mec-label-featured:before { + top: 18px; + left: 125px; +} + +.mec-wrap .mec-event-tile-view .col-md-6 article.mec-label-canceled:before, +.mec-wrap .mec-event-tile-view .col-md-6 article.mec-label-featured:before { + top: 20px; + left: 200px; +} + +@media (max-width: 960px) { + .mec-wrap .mec-event-tile-view .col-sm-3 { + width: 50%; + } +} + +@media (max-width: 480px) { + .mec-wrap .mec-event-tile-view .col-sm-3 { + width: 100%; + } +} + +.mec-event-tile-view article.mec-tile-item.tile-multipleday-event:after { + width: 185px; +} + +.mec-event-tile-view + article.mec-tile-item.tile-multipleday-event + .mec-event-time { + right: auto; + top: 50px; + left: 0; +} + +/* Tile View Responsive */ +.mec-event-tile-view .col-md-6.col-sm-6 article.mec-label-canceled:before { + top: 100px; + left: 140px; +} + +.mec-event-tile-view .col-md-4.col-sm-4 article.mec-label-canceled:before { + top: 20px; + left: 140px; +} + +@media (min-width: 761px) and (max-width: 1200px) { + .mec-event-tile-view .col-md-3.col-sm-3 { + width: 50%; + } + + .mec-event-tile-view .col-md-6.col-sm-6 article.mec-label-canceled:before { + top: 80px; + left: 90px; + } + + .mec-event-tile-view .col-md-4.col-sm-4 article.mec-label-canceled:before { + top: 40px; + left: 70px; + } + + .mec-event-tile-view .col-md-3.col-sm-3 article.mec-label-canceled:before { + top: 90px; + left: 110px; + } +} + +@media (min-width: 761px) and (max-width: 1024px) { + .mec-event-tile-view .col-md-4.col-sm-4 { + width: 50%; + } + + .mec-event-tile-view .col-md-4.col-sm-4:nth-child(1n + 3) { + width: 100%; + } +} + +@media (max-width: 760px) { + .mec-event-tile-view .col-md-3.col-sm-3 { + width: 100%; + } + + .mec-event-tile-view .col-md-4.col-sm-4 { + width: 100%; + } +} + +@media (max-width: 480px) { + .mec-event-tile-view .col-md-6.col-sm-6 article.mec-label-canceled:before { + top: 100px; + left: 80px; + } +} + +/* Date style for calendar view */ +.mec-calendar .mec-event-article .mec-event-date { + font-size: 12px; + text-align: left; +} + +.mec-event-detailed-time { + display: flex; +} + +.mec-event-detailed-time i { + width: 15px; + padding-top: 7px; +} + +/* Normal Label - Default Style for All Skins */ +.mec-ongoing-normal-label { + background-color: #40d9f1; +} + +.mec-expired-normal-label { + background-color: #000; +} + +.mec-wrap .mec-labels-normal .mec-label-normal, +.mec-wrap .mec-cancellation-reason span { + position: relative; + font-size: 11px; + font-weight: 300; + margin-left: 10px; + line-height: 1.9; + letter-spacing: 1px; + color: #fff; + padding: 2px 7px; + border-radius: 2px; + white-space: nowrap; +} + +.mec-wrap .mec-cancellation-reason span, +.mec-wrap .mec-labels-normal .mec-label-normal { + white-space: normal; + display: inline-block; + line-height: 14px; +} + +.mec-remaining-time-normal-label { + background-color: var(--mec-color-skin); +} + +.mec-timetable-event .mec-labels-normal .mec-label-normal, +.tooltipster-box .mec-labels-normal .mec-label-normal, +.mec-agenda-event-title .mec-labels-normal .mec-label-normal { + font-size: 9px; + letter-spacing: 0.5px; + text-transform: uppercase; + padding: 2px 7px; + color: #fff; + position: relative; + margin-left: 5px; + border-radius: 2px; + top: 0; +} + +.mec-tile-item .mec-labels-normal .mec-label-normal, +.mec-timeline-event .mec-labels-normal .mec-label-normal, +.mec-owl-carousel:not(.mec-slider-t1) .mec-labels-normal .mec-label-normal, +.mec-av-spot .mec-labels-normal .mec-label-normal, +.mec-event-countdown-part1 .mec-labels-normal .mec-label-normal, +.mec-event-countdown-part2 .mec-labels-normal .mec-label-normal, +.mec-event-cover-modern .mec-labels-normal .mec-label-normal, +.mec-masonry-content .mec-labels-normal .mec-label-normal, +.tooltipster-box .mec-labels-normal .mec-label-normal { + margin: 0 5px 0 0; +} + +.mec-event-countdown-style3 .mec-labels-normal .mec-label-normal { + margin: 0 0 0 5px; +} + +.mec-event-footer-carousel-type3 .mec-labels-normal .mec-label-normal { + display: inline; +} + +.mec-event-carousel-type4 .mec-fc-style { + display: none; +} + +.mec-event-carousel-type4 .mec-labels-normal { + top: -20px; + position: relative; +} + +/* Cancelled Reason */ +.mec-wrap .mec-cancellation-reason { + display: inline-block; +} + +.mec-wrap .mec-cancellation-reason span { + line-height: 1.3; + background: #eb3450; + text-transform: none; + display: inline-block; + white-space: nowrap; +} + +.mec-wrap .mec-event-list-accordion .mec-labels-normal .mec-label-normal, +.mec-wrap .mec-event-list-accordion .mec-cancellation-reason span { + top: 7px; +} + +.mec-agenda-event-title .mec-cancellation-reason span, +.mec-timetable-event .mec-cancellation-reason span, +.tooltipster-box .mec-cancellation-reason span { + font-size: 9px; + letter-spacing: 0.5px; + text-transform: uppercase; + padding: 2px 7px; + color: #fff; + position: relative; + margin-left: 5px; + border-radius: 2px; + top: 0; +} + +.mec-wrap .mec-event-container-novel .mec-cancellation-reason span, +.mec-wrap .mec-event-container-novel .mec-labels-normal .mec-label-normal { + white-space: inherit; + margin-left: 0; +} + +.mec-wrap .mec-event-container-simple .mec-cancellation-reason span, +.mec-wrap .mec-event-container-simple .mec-labels-normal .mec-label-normal { + top: -5px; + white-space: inherit; + margin-left: 0; + margin-right: 3px; +} + +.mec-tile-item .mec-cancellation-reason span, +.mec-timeline-event .mec-cancellation-reason span, +.mec-owl-carousel:not(.mec-slider-t1) .mec-cancellation-reason span, +.mec-av-spot .mec-cancellation-reason span, +.mec-event-countdown-part1 .mec-cancellation-reason span, +.mec-event-countdown-part2 .mec-cancellation-reason span, +.mec-event-cover-modern .mec-cancellation-reason span, +.mec-masonry-content .mec-cancellation-reason span, +.tooltipster-box .mec-cancellation-reason span { + margin: 0 5px 0 0; +} + +.mec-owl-carousel .mec-event-footer-carousel-type3 span.mec-event-title-soldout, +.mec-owl-carousel .mec-event-footer-carousel-type3 span.mec-few-tickets { + display: inline; +} + +.mec-owl-carousel .mec-event-footer-carousel-type3 span.soldout, +.mec-owl-carousel .mec-event-footer-carousel-type3 span.mec-labels-normal { + margin-top: 0; + color: #fff; + display: unset; +} + +.mec-wrap .mec-single-event .mec-cancellation-reason span { + margin: 0; + padding: 6px 12px; + font-size: 14px; + font-weight: bold; + white-space: normal; + word-break: break-word; +} + +.featherlight-content .mec-cancellation-reason { + display: block; + width: 100%; + text-align: center; + margin-top: 20px; + margin-bottom: -10px; +} + +/* Display Custom Data Fields */ +.mec-event-data-fields { + margin-bottom: 30px; +} + +.mec-event-data-fields ul.mec-event-data-field-items { + overflow: hidden; + padding-top: 10px; + padding-left: 0; + margin-left: 0; +} + +.mec-event-data-fields .mec-event-data-field-item { + list-style: none; + margin-bottom: 10px; + border-bottom: 1px dashed #e1e2e3; + padding-bottom: 8px; + width: 100%; + float: left; +} + +.mec-event-data-fields .mec-event-data-field-item .mec-event-data-field-value { + margin: 0 0 8px 0; + color: #616263 !important; + font-size: 13px; + line-height: 1.5; + word-wrap: break-word; + white-space: break-spaces; +} + +.mec-event-data-fields .mec-event-data-field-item:last-child { + border: none; + width: 100%; +} + +.mec-event-data-fields .mec-event-data-field-item .mec-event-data-field-name { + text-transform: none; + font-size: 13px; + font-weight: 600; + padding-bottom: 5px; + color: #313131 !important; + width: 100%; + padding-bottom: 10px; + position: relative; + letter-spacing: -0.2px; +} + +@media (max-width: 768px) { + .mec-event-data-fields .mec-event-data-field-item { + width: 100%; + } +} + +.mec-wrap .col-md-4 .mec-event-data-fields .mec-event-data-field-item { + width: 100%; + display: block; +} + +/* #Organizer for all shorrcodes + ================================================== */ +.mec-shortcode-organizers { + overflow: hidden; + font-weight: 400; + line-height: 18px; + font-size: 12px; +} + +.mec-event-list-minimal .mec-shortcode-organizers { + margin-top: 6px; +} + +.mec-shortcode-organizers i { + margin-right: 4px; + display: inline-block; +} + +.mec-shortcode-organizers .mec-organizers { + display: inline-block; + list-style: none; + padding: 0; +} + +.mec-organizer-item a { + color: #777; +} + +/* List standard */ +.mec-event-list-standard .mec-shortcode-organizers .mec-sl-user:before { + font-size: 16px; +} + +.mec-shortcode-organizers { + position: relative; +} + +/* Grid View*/ +.mec-skin-grid-container .mec-organizers, +.mec-skin-grid-container .mec-shortcode-organizers { + padding: 0; + margin: 0; +} + +.mec-skin-grid-container .mec-event-grid-colorful .mec-shortcode-organizers a, +.mec-skin-grid-container + .mec-event-grid-colorful + .mec-shortcode-organizers + a:hover, +.mec-skin-grid-container .mec-event-grid-clean .mec-shortcode-organizers a, +.mec-skin-grid-container + .mec-event-grid-clean + .mec-shortcode-organizers + a:hover { + color: #fff; + font-size: 12px; +} + +.mec-skin-grid-container + .mec-event-grid-colorful + .mec-shortcode-organizers + a:hover, +.mec-skin-grid-container + .mec-event-grid-clean + .mec-shortcode-organizers + a:hover { + text-decoration: underline; +} + +.mec-skin-grid-container .mec-event-grid-novel .mec-shortcode-organizers { + position: relative; +} + +.mec-skin-grid-container .mec-event-grid-novel .mec-shortcode-organizers i { + display: block; + color: rgba(255, 255, 255, 0.4); +} + +.mec-skin-grid-container + .mec-event-grid-novel + .mec-shortcode-organizers + i:before { + position: absolute; + top: 6px; + left: 6px; + font-size: 17px; + font-family: simple-line-icons; + font-style: normal; + font-weight: 400; + font-variant: normal; + text-transform: none; + line-height: 1; +} + +.mec-skin-grid-container .mec-event-grid-novel .mec-shortcode-organizers a { + padding-left: 35px; + font-size: 15px; + line-height: 30px; + color: rgba(255, 255, 255, 0.4); +} + +.mec-skin-grid-container + .mec-event-grid-novel + .mec-shortcode-organizers + a:hover { + color: #fff; +} + +/* weekly */ +.mec-calendar-daily .mec-shortcode-organizers, +.mec-calendar-daily .mec-shortcode-organizers .mec-organizers { + padding: 0; +} + +.mec-calendar-daily .mec-organizer-item a { + font-size: 13px; + line-height: 1.3; + color: #9a9a9a; + margin-bottom: 0; +} + +/* Masonry View */ + +.mec-events-masonry-wrap .mec-shortcode-organizers, +.mec-events-masonry-wrap .mec-shortcode-organizers .mec-organizers { + padding: 0; +} + +.mec-events-timeline-wrap .mec-shortcode-organizers .mec-organizers, +.mec-events-timeline-wrap .mec-organizer-item { + margin: 0; + display: inline; +} + +.mec-events-timeline-wrap .mec-shortcode-organizers i { + line-height: 24px; + margin-right: 7px; +} + +.mec-events-timeline-wrap .mec-organizer-item:after { + content: ","; +} + +.mec-events-timeline-wrap .mec-organizer-item:last-child:after { + content: ""; + padding: 0; +} + +.mec-events-timeline-wrap .mec-organizer-item:after, +.mec-events-timeline-wrap .mec-organizer-item a { + font-weight: 500; +} + +.mec-events-timeline-wrap .mec-organizer-item a:hover { + text-decoration: underline; +} + +/* Tile View */ +.mec-event-tile-view .mec-shortcode-organizers, +.mec-event-tile-view .mec-shortcode-organizers .mec-organizers { + padding: 0; +} + +.mec-event-tile-view .mec-shortcode-organizers i { + line-height: 24px; +} + +.mec-event-tile-view .mec-shortcode-organizers i, +.mec-event-tile-view .mec-shortcode-organizers .mec-organizers a { + color: #fff; +} + +/* MEC - Dark Mode*/ +.mec-dark-mode + .mec-calendar.mec-calendar-daily + .mec-calendar-d-table + .mec-modal-preloader, +.mec-dark-mode .mec-month-navigator-loading { + background-color: rgba(40, 40, 40, 0.88); +} + +.mec-dark-mode .mec-modal-wrap, +.mec-dark-mode .mec-fes-form .mec-meta-box-fields, +.mec-dark-mode .mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-next, +.mec-dark-mode .mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-prev, +.mec-dark-mode .event-carousel-type2-head .mec-event-footer-carousel-type2 .mec-booking-button, +.mec-dark-mode .mec-timetable-events-list .mec-timetable-event, +.mec-dark-mode .mec-box-calendar.mec-calendar.mec-event-calendar-classic .mec-calendar-table-head dt, +.mec-dark-mode .mec-calendar .mec-calendar-row dt:hover, +.mec-dark-mode .mec-event-grid-classic .mec-event-content, +.mec-dark-mode .mec-map-view-event-detail.mec-event-detail, +.mec-dark-mode .mec-events-toggle .mec-toggle-content .mec-modal-wrap, +.mec-dark-mode .mec-event-footer .mec-booking-button, +/* Up Shortcode */ +.mec-dark-mode .mec-wrap .button, +.mec-dark-mode .mec-wrap a.button:not(.owl-dot):hover, +.mec-dark-mode .mec-wrap button:not(.owl-dot):hover, +.mec-dark-mode .mec-wrap input[type=button]:hover, +.mec-dark-mode .mec-wrap input[type=reset]:hover, +.mec-dark-mode .mec-wrap input[type=submit]:hover, +.mec-dark-mode .mec-hourly-schedule-speaker-contact-information a i, +.mec-dark-mode .mec-organizer-social-information a i, +.mec-dark-mode .mec-single-event .mec-event-exporting .mec-export-details a:hover, +.mec-dark-mode .mec-events-meta-group-tags a:hover, +.mec-dark-mode .mec-next-event-details a, +.mec-dark-mode .mec-event-schedule-content .mec-schedule-speakers { + background-color: #1f1f1f; + color: #d2d2d2; +} + +/* Modal Popup Scroolbar */ +.mec-dark-mode .mec-modal-wrap::-webkit-scrollbar { + width: 12px; +} + +.mec-dark-mode .mec-modal-wrap::-webkit-scrollbar-track { + background: #000; +} + +.mec-dark-mode .mec-modal-wrap::-webkit-scrollbar-thumb { + background-color: #333; + border-radius: 20px; + border: 2px solid #000; +} + +/* Modal Popup Overlay */ +.mec-dark-mode .mec-modal-preloader, +.mec-dark-mode .mec-month-navigator-loading { + background-color: #1f1f1f; +} + +.mec-dark-mode .mec-skin-tile-month-navigator-container, +.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-d-table { + background: #282828; +} + +.mec-dark-mode .mec-skin-tile-month-navigator-container:after { + border-color: #282828 transparent transparent transparent; +} + +.mec-dark-mode .mec-event-grid-novel .mec-event-article, +body.mec-dark-mode .mec-single-modern .mec-single-event-bar { + background-color: #282828; + color: #d2d2d2; +} + +.mec-dark-mode .mec-fes-form input[type=email], +.mec-dark-mode .mec-fes-form input[type=number], +.mec-dark-mode .mec-fes-form input[type=password], +.mec-dark-mode .mec-fes-form input[type=tel], +.mec-dark-mode .mec-fes-form input[type=text], +.mec-dark-mode .mec-fes-form select, +.mec-dark-mode .mec-fes-form textarea, +.mec-dark-mode .mec-fes-form, +.mec-dark-mode .mec-fes-list, +/* FES */ +.mec-dark-mode .mec-slider-t1-wrap, +.mec-dark-mode .event-carousel-type2-head, +.mec-dark-mode .mec-event-carousel-content, +.mec-dark-mode .mec-wrap .mec-event-countdown-style2, +.mec-dark-mode .mec-wrap .mec-event-countdown-style1, +.mec-dark-mode .mec-event-countdown-style1 .mec-event-countdown-part3 .mec-event-button, +.mec-dark-mode .mec-masonry-item-wrap .mec-event-grid-modern .event-grid-modern-head, +.mec-dark-mode .mec-ttt2-title, +.mec-dark-mode .mec-timetable-t2-wrap, +.mec-dark-mode .mec-timetable-events-list .mec-timetable-event, +.mec-dark-mode .mec-calendar .mec-event-article:hover, +.mec-dark-mode .mec-box-calendar.mec-calendar .mec-calendar-table-head dt, +.mec-dark-mode .mec-calendar.mec-event-calendar-classic .mec-calendar-events-sec .mec-event-article:hover, +.mec-dark-mode .mec-calendar.mec-event-calendar-classic .mec-selected-day, +.mec-dark-mode .mec-calendar.mec-event-calendar-classic dt.mec-selected-day:hover, +.mec-dark-mode .mec-yearly-view-wrap .mec-yearly-title-sec .mec-next-year:hover, +.mec-dark-mode .mec-yearly-view-wrap .mec-yearly-title-sec .mec-previous-year:hover, +.mec-dark-mode .mec-calendar.mec-yearly-calendar .mec-calendar-table-head dl dt, +.mec-dark-mode .mec-calendar .mec-calendar-side .mec-next-month, +.mec-dark-mode .mec-calendar .mec-calendar-side .mec-previous-month, +.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-d-table a, +.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-d-table dl dt, +.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-next-month, +.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-previous-month, +.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-d-table .mec-daily-view-day, +.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-d-table a.mec-table-d-next, +.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-d-table a.mec-table-d-prev, +.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-a-month, +.mec-dark-mode .mec-events-agenda-wrap, +.mec-dark-mode .mec-event-grid-classic .mec-event-content .mec-wrap .mec-totalcal-box .mec-totalcal-view span, +.mec-dark-mode .mec-wrap .mec-totalcal-box input, +.mec-dark-mode .mec-wrap .mec-totalcal-box select, +.mec-dark-mode .mec-wrap .mec-totalcal-box i, +.mec-dark-mode .mec-map-lightbox-wp, +.mec-dark-mode .mec-events-toggle .mec-toggle-item-inner, +.mec-dark-mode .mec-event-footer, +.mec-dark-mode .mec-event-list-standard .mec-topsec, +.mec-dark-mode .mec-event-list-modern .mec-btn-wrapper .mec-booking-button, +.mec-dark-mode.mec-wrap .mec-totalcal-box i, +.mec-dark-mode.mec-wrap .mec-totalcal-box .mec-totalcal-view span, +.mec-dark-mode.mec-wrap .mec-totalcal-box input, +.mec-dark-mode.mec-wrap .mec-totalcal-box select, +.mec-dark-mode .mec-event-list-minimal a.mec-detail-button, +.mec-dark-mode .mec-load-more-button, +/*up shortcodes */ +.mec-dark-mode .mec-wrap .mec-totalcal-box, +.mec-dark-mode .mec-hourly-schedule-speaker-info, +.mec-dark-mode .mec-related-event-content, +.mec-dark-mode .mec-events-meta-group-tags a, +.mec-dark-mode .lity-content .mec-events-meta-group-booking input[type=date], +.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=date], +.mec-dark-mode .lity-content .mec-events-meta-group-booking input[type=email], +.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=email], +.mec-dark-mode .lity-content .mec-events-meta-group-booking input[type=number], +.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=number], +.mec-dark-mode .lity-content .mec-events-meta-group-booking input[type=password], +.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=password], +.mec-dark-mode .lity-content .mec-events-meta-group-booking input[type=tel], +.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=tel], +.mec-dark-mode .lity-content .mec-events-meta-group-booking input[type=text], +.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=text], +.mec-dark-mode .lity-content .mec-events-meta-group-booking select, +.mec-dark-mode .mec-single-event .mec-events-meta-group-booking select, +.mec-dark-mode .lity-content .mec-events-meta-group-booking textarea, +.mec-dark-mode .mec-single-event .mec-events-meta-group-booking textarea, +.mec-dark-mode .lity-content .mec-events-meta-group-booking .mec-dark-mode .mec-single-event .mec-events-meta-group-booking, +.mec-dark-mode .mec-single-event .mec-frontbox, +.mec-dark-mode .mec-single-event .mec-events-meta-group-countdown, +.mec-dark-mode .mec-event-cost, +.mec-dark-mode .mec-event-more-info, +.mec-dark-mode .mec-event-website, +.mec-dark-mode .mec-events-meta-date, +.mec-dark-mode .mec-single-event-additional-organizers, +.mec-dark-mode .mec-single-event-category, +.mec-dark-mode .mec-single-event-sponsor, +.mec-dark-mode .mec-single-event-date, +.mec-dark-mode .mec-single-event-label, +.mec-dark-mode .mec-single-event-location, +.mec-dark-mode .mec-single-event-organizer, +.mec-dark-mode .mec-single-event-time, +.mec-dark-mode .mec-single-event .mec-speakers-details ul li, +.mec-dark-mode .mec-single-event .mec-event-exporting .mec-export-details a, +.mec-dark-mode .mec-single-modern .col-md-4 .mec-frontbox { + background-color: #282828; +} + +.mec-dark-mode .mec-fes-form input[type=email], +.mec-dark-mode .mec-fes-form input[type=number], +.mec-dark-mode .mec-fes-form input[type=password], +.mec-dark-mode .mec-fes-form input[type=tel], +.mec-dark-mode .mec-fes-form input[type=text], +.mec-dark-mode .mec-fes-form select, +.mec-dark-mode .mec-fes-form textarea, +.mec-dark-mode .mec-fes-form .mec-meta-box-fields, +.mec-dark-mode .event-carousel-type2-head .mec-event-footer-carousel-type2 .mec-booking-button, +.mec-dark-mode .event-carousel-type2-head, +.mec-dark-mode .mec-event-carousel-content, +.mec-dark-mode .mec-masonry-item-wrap .mec-event-grid-modern .event-grid-modern-head, +.mec-dark-mode .mec-timetable-t2-wrap, +.mec-dark-mode .mec-box-calendar.mec-calendar .mec-calendar-table-head dt, +.mec-dark-mode .mec-box-calendar.mec-calendar .mec-calendar-side .mec-next-month, +.mec-dark-mode .mec-box-calendar.mec-calendar .mec-calendar-side .mec-previous-month, +.mec-dark-mode .mec-calendar.mec-event-calendar-classic .mec-calendar-events-sec, +.mec-dark-mode .mec-box-calendar.mec-calendar.mec-event-calendar-classic .mec-calendar-table-head dt, +.mec-dark-mode .mec-box-calendar.mec-calendar dt, +.mec-dark-mode .mec-yearly-view-wrap, +.mec-dark-mode .mec-yearly-view-wrap .mec-yearly-title-sec, +.mec-dark-mode .mec-calendar .mec-calendar-side .mec-next-month, +.mec-dark-mode .mec-calendar .mec-calendar-side .mec-previous-month, +.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-d-table a, +.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-d-table dl dt, +.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-next-month, +.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-previous-month, +.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-d-table .mec-daily-view-day, +.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-d-table a.mec-table-d-next, +.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-d-table a.mec-table-d-prev .mec-calendar.mec-calendar-daily .mec-calendar-a-month, +.mec-dark-mode .mec-events-agenda-wrap, +.mec-dark-mode .mec-wrap .mec-totalcal-box i, +.mec-dark-mode .mec-events-toggle .mec-toggle-content, +.mec-dark-mode .mec-events-toggle .mec-toggle-item, +.mec-dark-mode .mec-events-toggle .mec-toggle-item-inner, +.mec-dark-mode .mec-event-footer .mec-booking-button, +.mec-dark-mode .mec-event-list-standard .mec-event-meta-wrap, +.mec-dark-mode .mec-event-list-standard .mec-event-article, +.mec-dark-mode .mec-event-footer, +.mec-dark-mode .mec-event-list-standard .mec-topsec, +.mec-dark-mode .mec-event-list-modern .mec-btn-wrapper .mec-booking-button, +.mec-dark-mode .mec-event-list-modern .mec-event-article, +.mec-dark-mode .mec-event-list-minimal .mec-event-article, +.mec-dark-mode .mec-wrap .mec-totalcal-box i, +.mec-dark-mode .mec-wrap .mec-totalcal-box .mec-totalcal-view span, +.mec-dark-mode .mec-wrap .mec-totalcal-box input, +.mec-dark-mode .mec-wrap .mec-totalcal-box select, +.mec-dark-mode .mec-event-list-minimal a.mec-detail-button, +.mec-dark-mode .mec-load-more-button, +/*up shortcodes */ +.mec-dark-mode .mec-wrap .mec-totalcal-box, +.mec-dark-mode .mec-events-meta-group-booking ul.mec-book-price-details, +.mec-dark-mode .mec-events-meta-group-booking ul.mec-book-price-details li, +.mec-dark-mode .mec-breadcrumbs, +.mec-dark-mode .mec-hourly-schedule-speaker-info, +.mec-dark-mode .mec-single-event .mec-event-exporting .mec-export-details a:hover, +.mec-dark-mode .mec-related-events-wrap h3.mec-rec-events-title, +.mec-dark-mode .lity-content .mec-events-meta-group-booking input[type=date], +.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=date], +.mec-dark-mode .lity-content .mec-events-meta-group-booking input[type=email], +.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=email], +.mec-dark-mode .lity-content .mec-events-meta-group-booking input[type=number], +.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=number], +.mec-dark-mode .lity-content .mec-events-meta-group-booking input[type=password], +.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=password], +.mec-dark-mode .lity-content .mec-events-meta-group-booking input[type=tel], +.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=tel], +.mec-dark-mode .lity-content .mec-events-meta-group-booking input[type=text], +.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=text], +.mec-dark-mode .lity-content .mec-events-meta-group-booking select, +.mec-dark-mode .mec-single-event .mec-events-meta-group-booking select, +.mec-dark-mode .lity-content .mec-events-meta-group-booking textarea, +.mec-dark-mode .mec-single-event .mec-events-meta-group-booking textarea, +.mec-dark-mode .lity-content .mec-events-meta-group-booking .mec-dark-mode .mec-single-event .mec-events-meta-group-booking, +.mec-dark-mode .mec-single-event .mec-frontbox, +.mec-dark-mode .mec-single-event .mec-events-meta-group-countdown, +.mec-dark-mode .mec-next-event-details a, +.mec-dark-mode .lity-content .mec-events-meta-group-booking form>h4, +.mec-dark-mode .mec-single-event .mec-events-meta-group-booking form>h4, +.mec-dark-mode .mec-single-event .mec-frontbox-title, +.mec-dark-mode .mec-event-schedule-content, +.mec-dark-mode .mec-event-schedule-content dl:before, +.mec-dark-mode .mec-events-meta-group-tags a, +.mec-dark-mode .mec-breadcrumbs { + border-color: #353535; +} + +.mec-dark-mode .mec-fes-form input[type=email], +.mec-dark-mode .mec-fes-form input[type=number], +.mec-dark-mode .mec-fes-form input[type=password], +.mec-dark-mode .mec-fes-form input[type=tel], +.mec-dark-mode .mec-fes-form input[type=text], +.mec-dark-mode .mec-fes-form select, +.mec-dark-mode .mec-fes-form textarea, +.mec-dark-mode .mec-fes-form label, +.mec-dark-mode .mec-fes-form, +.mec-dark-mode .mec-fes-list, +/* FES */ +.mec-dark-mode .mec-timeline-main-content h4 a, +.mec-dark-mode .mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-next i, +.mec-dark-mode .mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-prev i, +.mec-dark-mode .mec-event-carousel-content .mec-event-carousel-title a, +.mec-dark-mode .mec-ttt2-title, +.mec-dark-mode .mec-timetable-events-list .mec-timetable-event span a, +.mec-dark-mode .mec-timetable-event .mec-timetable-event-time, +.mec-dark-mode .mec-tooltip-event-title, +.mec-dark-mode .mec-calendar.mec-event-container-simple dl dt.mec-calendar-day, +.mec-dark-mode .mec-calendar dt, +.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-d-table .mec-daily-view-day.mec-has-event, +.mec-dark-mode .mec-calendar .mec-event-article .mec-event-title a, +.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-a-month .mec-next-month, +.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-a-month .mec-previous-month, +.mec-dark-mode .mec-event-grid-simple .mec-event-title a, +.mec-dark-mode .mec-event-grid-modern .mec-event-title a, +.mec-dark-mode .mec-event-grid-minimal .mec-event-date span, +.mec-dark-mode .mec-event-grid-minimal .mec-event-title a, +.mec-dark-mode .mec-event-grid-clean .mec-event-title a, +.mec-dark-mode .mec-event-grid-classic .mec-event-title a, +.mec-dark-mode .mec-wrap .mec-totalcal-box .mec-totalcal-view span, +.mec-dark-mode .mec-wrap .mec-totalcal-box input, +.mec-dark-mode .mec-wrap .mec-totalcal-box select, +.mec-dark-mode .mec-events-toggle .mec-toggle-item-inner i, +.mec-dark-mode .mec-event-list-standard .mec-event-title a, +.mec-dark-mode .mec-event-list-modern .mec-btn-wrapper .mec-booking-button, +.mec-dark-mode .mec-wrap .mec-event-list-modern .mec-event-title a, +.mec-dark-mode .mec-event-list-minimal .mec-event-title a, +.mec-dark-mode .mec-events-meta-group-booking ul.mec-book-price-details li, +.mec-dark-mode .mec-events-meta-group-booking ul.mec-book-price-details li span.mec-book-price-detail-amount, +.mec-dark-mode .mec-event-list-classic .mec-event-title a, +.mec-dark-mode .mec-event-list-minimal a.mec-detail-button, +.mec-dark-mode .mec-load-more-button, +/*up shortcodes */ +.mec-dark-mode .mec-wrap, +.mec-dark-mode .mec-wrap p, +.mec-dark-mode .lity-content .mec-events-meta-group-booking h5 span, +.mec-dark-mode .mec-single-event .mec-events-meta-group-booking h5 span, +.mec-dark-mode .lity-content .mec-events-meta-group-booking label, +.mec-dark-mode .mec-single-event .mec-events-meta-group-booking label, +.mec-dark-mode .lity-content .mec-events-meta-group-booking input[type=date], +.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=date], +.mec-dark-mode .lity-content .mec-events-meta-group-booking input[type=email], +.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=email], +.mec-dark-mode .lity-content .mec-events-meta-group-booking input[type=number], +.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=number], +.mec-dark-mode .lity-content .mec-events-meta-group-booking input[type=password], +.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=password], +.mec-dark-mode .lity-content .mec-events-meta-group-booking input[type=tel], +.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=tel], +.mec-dark-mode .lity-content .mec-events-meta-group-booking input[type=text], +.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=text], +.mec-dark-mode .lity-content .mec-events-meta-group-booking select, +.mec-dark-mode .mec-single-event .mec-events-meta-group-booking select, +.mec-dark-mode .lity-content .mec-events-meta-group-booking textarea, +.mec-dark-mode .mec-single-event .mec-events-meta-group-booking textarea, +.mec-dark-mode .mec-wrap .mec-event-schedule-content a, +.mec-dark-mode .mec-hourly-schedule-speaker-description, +.mec-dark-mode .mec-hourly-schedule-speaker-name, +.mec-dark-mode .mec-hourly-schedule-speaker-contact-information a i, +.mec-dark-mode .mec-organizer-social-information a i, +.mec-dark-mode .mec-related-event-content span, +.mec-dark-mode .mec-related-event-content h5 a, +.mec-dark-mode .mec-events-meta-group-tags a, +.mec-dark-mode .mec-single-event .mec-speakers-details ul li .mec-speaker-job-title, +.mec-dark-mode .mec-breadcrumbs a, +.mec-dark-mode .mec-single-event .mec-event-meta dt, +.mec-dark-mode .mec-single-event .mec-event-meta h3, +.mec-dark-mode .mec-single-modern .mec-single-event-bar>div h3, +.mec-dark-mode .entry-content .mec-wrap h1, +.mec-dark-mode .entry-content .mec-wrap h2, +.mec-dark-mode .entry-content .mec-wrap h3, +.mec-dark-mode .entry-content .mec-wrap h4, +.mec-dark-mode .entry-content .mec-wrap h5, +.mec-dark-mode .entry-content .mec-wrap h6, +.mec-dark-mode .mec-wrap h1, +.mec-dark-mode .mec-wrap h2, +.mec-dark-mode .mec-wrap h3, +.mec-dark-mode .mec-wrap h4, +.mec-dark-mode .mec-wrap h5, +.mec-dark-mode .mec-wrap h6, +.mec-dark-mode .mec-next-event-details abbr, +.mec-dark-mode .lity-content .mec-events-meta-group-booking form>h4, +.mec-dark-mode .mec-single-event .mec-events-meta-group-booking form>h4, +.mec-dark-mode .mec-single-event .mec-frontbox-title, +.mec-dark-mode .mec-wrap .mec-single-title, +.mec-dark-mode .mec-event-content p { + color: #d2d2d2; +} + +.mec-dark-mode .mec-wrap .mec-totalcal-box .mec-totalcal-view span:hover, +.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-d-table .mec-daily-view-day.mec-has-event:hover, +.mec-dark-mode .mec-calendar .mec-event-article .mec-event-title a:hover, +.mec-dark-mode .mec-event-grid-minimal .mec-event-date:hover, +.mec-dark-mode .mec-event-grid-minimal .mec-event-title a:hover, +.mec-dark-mode .mec-event-grid-classic .mec-event-title a:hover, +.mec-dark-mode .mec-event-list-classic .mec-event-title a:hover, +.mec-dark-mode .mec-event-footer .mec-booking-button:hover, +.mec-dark-mode .mec-event-list-standard .mec-event-title a:hover, +.mec-dark-mode .mec-event-list-modern .mec-btn-wrapper .mec-booking-button:hover, +.mec-dark-mode .mec-wrap .mec-event-list-modern .mec-event-title a:hover, +.mec-dark-mode .mec-event-list-minimal a.mec-detail-button:hover, +.mec-dark-mode .mec-event-list-minimal .mec-event-title a:hover, +/* Up Shortcode */ +.mec-dark-mode .mec-wrap a:hover, +.mec-dark-mode .mec-single-event .mec-event-meta dd a:hover, +.mec-dark-mode .mec-breadcrumbs a:hover { + color: #fff; +} + +.mec-dark-mode + .mec-fes-form + .mec-attendees-wrapper + .mec-attendees-list + .w-clearfix:first-child { + border-color: #333 !important; +} + +.mec-dark-mode + .mec-fes-form + .mec-attendees-wrapper + .mec-attendees-list + .w-clearfix:nth-child(odd) { + background: #1f1f1f !important; +} + +.mec-dark-mode + .mec-fes-form + .mec-attendees-wrapper + .mec-attendees-list + .w-clearfix { + background: #282828 !important; +} + +.mec-dark-mode + .lity-container + .mec-events-meta-group-booking + input[type="radio"]:before, +.mec-dark-mode + .mec-single-event + .mec-events-meta-group-booking + input[type="radio"]:before, +.mec-dark-mode + .mec-single-event + .mec-events-meta-group-booking + input[type="checkbox"], +.mec-dark-mode .mec-related-events-wrap h3.mec-rec-events-title:before { + background-color: #c4cace; +} + +.mec-dark-mode .mec-month-divider span, +.mec-dark-mode + .lity-container + .mec-events-meta-group-booking + input[type="radio"]:before, +.mec-dark-mode + .mec-single-event + .mec-events-meta-group-booking + input[type="radio"]:before, +.mec-dark-mode + .mec-single-event + .mec-events-meta-group-booking + input[type="checkbox"], +.mec-dark-mode .mec-related-events-wrap h3.mec-rec-events-title:before { + border-color: #313131; +} + +.mec-dark-mode .mec-timeline-month-divider, +.mec-dark-mode .mec-timeline-event-content, +.mec-dark-mode .mec-slider-t5-wrap, +.mec-dark-mode .mec-slider-t5-wrap .mec-event-grid-modern .event-grid-modern-head, +.mec-dark-mode .mec-slider-t5 .mec-slider-t5-content, +.mec-dark-mode .mec-slider-t1 .mec-slider-t1-content, +.mec-dark-mode .event-carousel-type3-head .mec-event-footer-carousel-type3, +.mec-dark-mode .mec-av-spot-wrap .mec-event-grid-modern .event-grid-modern-head, +.mec-dark-mode .mec-av-spot .mec-av-spot-content, +.mec-dark-mode .mec-av-spot .mec-av-spot-head, +.mec-dark-mode .mec-wrap .mec-event-countdown-style1 .mec-event-countdown-part3, +.mec-dark-mode .mec-event-cover-classic, +.mec-dark-mode .mec-masonry .mec-masonry-content, +.mec-dark-mode .mec-masonry .mec-masonry-head, +.mec-dark-mode .mec-timetable-events-list .mec-timetable-event:hover, +.mec-dark-mode .tooltipster-sidetip:not(.uael-tooltipster-active) .tooltipster-content, +.mec-dark-mode .mec-calendar.mec-event-calendar-classic .mec-calendar-events-sec, +.mec-dark-mode .mec-yearly-view-wrap .mec-yearly-title-sec .mec-next-year, +.mec-dark-mode .mec-yearly-view-wrap .mec-yearly-title-sec .mec-previous-year, +.mec-dark-mode .mec-yearly-view-wrap .mec-calendar.mec-yearly-calendar, +.mec-dark-mode .mec-yearly-view-wrap .mec-yearly-calendar-sec, +.mec-dark-mode .mec-calendar .mec-calendar-side .mec-next-month:hover, +.mec-dark-mode .mec-calendar .mec-calendar-side .mec-previous-month:hover, +.mec-dark-mode .mec-calendar dt, +.mec-dark-mode .mec-calendar .mec-calendar-topsec, +.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-d-table a:hover, +.mec-dark-mode .mec-calendar.mec-calendar-weekly .mec-calendar-d-table dl dt:hover, +.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-next-month:hover, +.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-previous-month:hover, +.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-d-table .mec-daily-view-day.mec-has-event:hover, +.mec-dark-mode .mec-calendar .mec-event-article:hover, +.mec-dark-mode .mec-wrap .mec-totalcal-box, +.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-a-month .mec-next-month, +.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-a-month .mec-previous-month, +.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-d-top, +.mec-dark-mode .mec-agenda-events-wrap, +.mec-dark-mode .mec-event-grid-modern .mec-event-content, +.mec-dark-mode .mec-event-grid-modern .mec-event-article, +.mec-dark-mode .mec-event-grid-clean .mec-event-content, +.mec-dark-mode .mec-event-grid-clean .mec-event-article, +.mec-dark-mode .mec-event-sharing-wrap .mec-event-sharing, +.mec-dark-mode .mec-events-toggle .mec-toggle-item-inner:hover, +.mec-dark-mode .mec-event-footer .mec-booking-button:hover, +.mec-dark-mode .mec-event-list-modern .mec-btn-wrapper .mec-booking-button:hover, +.mec-dark-mode .mec-event-list-minimal a.mec-detail-button:hover, +/* Up Shortcode */ +.mec-dark-mode .mec-organizer-social-information a:hover i, +.mec-dark-mode .mec-hourly-schedule-speaker-contact-information a:hover i { + background: #191919; +} + +.mec-dark-mode .mec-fes-form .mec-meta-box-fields, +/* FES */ +.mec-dark-mode .mec-timeline-month-divider, +.mec-dark-mode .mec-slider-t5-wrap .mec-event-grid-modern .event-grid-modern-head, +.mec-dark-mode .mec-event-sharing-wrap>li:first-of-type, +.mec-dark-mode .event-carousel-type3-head .mec-event-footer-carousel-type3 .mec-booking-button, +.mec-dark-mode .event-carousel-type3-head .mec-event-footer-carousel-type3, +.mec-dark-mode .mec-av-spot-wrap .mec-event-grid-modern .event-grid-modern-head, +.mec-dark-mode .mec-av-spot, +.mec-dark-mode .mec-event-cover-clean, +.mec-dark-mode .mec-event-cover-classic, +.mec-dark-mode .mec-masonry, +.mec-dark-mode .mec-calendar.mec-box-calendar .mec-table-nullday:last-child, +.mec-dark-mode .mec-calendar .mec-event-article, +.mec-dark-mode .mec-box-calendar.mec-calendar dl dt:last-child, +.mec-dark-mode .mec-yearly-view-wrap .mec-yearly-title-sec .mec-next-year, +.mec-dark-mode .mec-yearly-view-wrap .mec-yearly-title-sec .mec-previous-year, +.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-next-month:hover, +.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-previous-month:hover, +.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-a-month, +.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-d-table, +.mec-dark-mode .mec-calendar, +.mec-dark-mode .mec-wrap .mec-totalcal-box, +.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-a-month .mec-next-month, +.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-a-month .mec-previous-month, +.mec-dark-mode .mec-events-agenda, +.mec-dark-mode .mec-event-grid-modern .mec-event-article, +.mec-dark-mode .mec-event-grid-clean .mec-event-article, +.mec-dark-mode .mec-event-sharing-wrap .mec-event-sharing:after, +.mec-dark-mode .mec-event-grid-classic .mec-event-article, +.mec-dark-mode .mec-event-sharing-wrap .mec-event-sharing { + border-color: #353535; +} + +.mec-dark-mode .mec-event-sharing-wrap .mec-event-sharing:after { + border-color: #191919 transparent transparent transparent; +} + +.mec-dark-mode .mec-event-sharing-wrap .mec-event-sharing:before { + border-color: #353535 transparent transparent transparent; +} + +.mec-dark-mode + .mec-wrap + .mec-book-form-gateways + [id*="mec_book_form_gateway_checkout"] + input[type="text"], +.mec-dark-mode + .mec-wrap + .mec-book-form-gateways + [id*="mec_book_form_gateway_checkout"] + input[type="email"], +.mec-dark-mode .mec-events-meta-group-booking .StripeElement, +.mec-dark-mode + .mec-book-form-gateways + [id*="mec_book_form_gateway_checkout"] + input[type="text"] { + background: #999 !important; + border: 1px solid #353535 !important; + box-shadow: none !important; + color: #353535 !important; +} + +.mec-dark-mode + .CardField + CardField--ltr + .__PrivateStripeElement + .InputContainer + input { + color: #d2d2d2 !important; +} + +.mec-dark-mode .mec-events-toggle .mec-toggle-item { + border: 1px solid #e4e4e4; + box-shadow: 0 10px 15px #282828; +} + +.mec-dark-mode + .mec-agenda-events-wrap + .mec-event-grid-colorful + .mec-event-content { + background-color: transparent; +} + +.mec-dark-mode .mec-calendar .mec-calendar-side { + box-shadow: 0 1px 5px 6px rgba(255, 255, 255, 0.005) inset; +} + +.mec-dark-mode + .tooltipster-sidetip.tooltipster-shadow:not(.uael-tooltipster-active) + .tooltipster-box { + border: 1px solid #282828 !important; +} + +.mec-dark-mode .mec-timeline-event-content:after { + border-color: transparent #191919 transparent transparent; +} + +/* FES */ +.mec-dark-mode .mec-fes-form .mec-meta-box-fields { + box-shadow: 0 2px 6px -3px #353535; +} + +.mec-dark-mode .mec-fes-form .mec-meta-box-fields h4 { + color: #d2d2d2; + background: #000; +} + +.mec-dark-mode .mec-fes-form input[type="email"], +.mec-dark-mode .mec-fes-form input[type="number"], +.mec-dark-mode .mec-fes-form input[type="password"], +.mec-dark-mode .mec-fes-form input[type="tel"], +.mec-dark-mode .mec-fes-form input[type="text"], +.mec-dark-mode .mec-fes-form select, +.mec-dark-mode .mec-fes-form textarea { + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.38) inset; +} + +.mec-dark-mode .mec-fes-form input { + background: #353535 !important; + color: #d2d2d2 !important; +} + +.mec-dark-mode .mec-booking-tab-content .button:hover, +.mec-dark-mode .mec-booking-tab-content .mec-reg-field-add-option:hover, +.mec-dark-mode .mec-fes-form .mec-form-row .button:not(.wp-color-result):hover { + background: #353535; + color: #d2d2d2; + border-color: #353535; + box-shadow: 0 2px 6px -3px #353535; +} + +.mec-dark-mode .mec-booking-tab-content .button, +.mec-dark-mode .mec-booking-tab-content .mec-reg-field-add-option, +.mec-dark-mode .mec-fes-form .mec-form-row .button:not(.wp-color-result), +.mec-dark-mode .mec-fes-form input[type="file"], +.mec-dark-mode ul#mec_orgz_form_row li .mec-additional-organizer-remove, +.mec-dark-mode ul#mec_reg_form_fields li .mec_reg_field_remove { + color: #d2d2d2; + background: #282828; + border: 2px solid #353535; + box-shadow: 0 2px 6px -3px #353535; +} + +.mec-dark-mode #mec_reg_form_fields input[type="checkbox"], +.mec-dark-mode #mec_reg_form_fields input[type="radio"], +.mec-dark-mode .mec-form-row input[type="checkbox"], +.mec-dark-mode .mec-form-row input[type="radio"] { + background-color: #000; + border: 1px solid #353535; + box-shadow: 0 1px 3px -1px #353535; +} + +.mec-dark-mode .mec-fes-form .select2-container { + border: 1px solid #353535; + background-color: #282828; + color: #d2d2d2; +} + +.mec-dark-mode ul#mec_bfixed_form_fields li, +.mec-dark-mode ul#mec_orgz_form_row li, +.mec-dark-mode ul#mec_reg_form_fields li { + background: #000; + border-color: #000; +} + +.mec-dark-mode + #mec_meta_box_tickets_form + [id^="mec_ticket_row"] + .mec_add_price_date_button { + background: #000; + border-color: #2d2d2d; + box-shadow: 0 2px 6px -3px #2d2d2d; +} + +.mec-dark-mode #mec_reg_form_field_types .button.red { + background: #2d2d2d; + border-color: #2d2d2d; + box-shadow: 0 2px 6px -3px #2d2d2d; +} + +.mec-dark-mode #mec_bfixed_form_field_types .button, +.mec-dark-mode #mec_reg_form_field_types .button { + color: #d2d2d2; + box-shadow: 0 2px 6px -3px #2d2d2d; + border-color: #2d2d2d; +} + +.mec-dark-mode + #mec_meta_box_tickets_form + [id^="mec_ticket_row"] + .mec_add_price_date_button:hover, +.mec-dark-mode #mec_reg_form_field_types .button:hover { + background: #000; +} + +.mec-dark-mode ul#mec_bfixed_form_fields li .mec_bfixed_field_remove, +.mec-dark-mode ul#mec_orgz_form_row li .mec-additional-organizer-remove, +.mec-dark-mode ul#mec_reg_form_fields li .mec_reg_field_remove { + background: #282828; +} + +.mec-dark-mode ul#mec_bfixed_form_fields li .mec_bfixed_field_remove:hover, +.mec-dark-mode ul#mec_orgz_form_row li .mec-additional-organizer-remove:hover, +.mec-dark-mode ul#mec_reg_form_fields li .mec_reg_field_remove:hover, +.mec-dark-mode + #mec_taxes_fees_container_toggle + [id^="mec_remove_fee_button"]:hover, +.mec-dark-mode + #mec_ticket_variations_list + [id^="mec_remove_ticket_variation_button"]:hover { + color: #fff; + border: 2px solid #ea6485; + background: #ea6485; +} + +/* Booking Shortcode */ + +.mec-events-meta-group-booking-shortcode h4 { + margin-bottom: 20px; +} + +.mec-booking-shortcode .mec-event-tickets-list.mec-sell-all-occurrences { + width: 100%; +} + +.mec-booking-shortcode .mec-book-reg-field-mec_email { + width: 48%; + display: inline-block; + margin-right: 30px; +} + +.mec-booking-shortcode .mec-book-reg-field-name { + width: 48%; + display: inline-block; +} + +.mec-booking-shortcode + .mec-form-row.mec-paypal-credit-card-expiration-date-month { + width: 48%; + display: inline-block; + vertical-align: top; + margin-right: 30px; +} + +.mec-booking-shortcode .mec-form-row.mec-paypal-credit-card-cvv2 { + width: 48%; + display: inline-block; +} + +.mec-booking-shortcode + .mec-form-row.mec-paypal-credit-card-expiration-date-month + .nice-select { + width: 48%; + display: inline-block; +} + +.mec-booking-shortcode + .mec-form-row.mec-paypal-credit-card-expiration-date-month + label { + width: 100%; +} + +.mec-booking-shortcode + .mec-form-row.mec-paypal-credit-card-expiration-date-month + .nice-select:first-of-type { + margin-right: 10px; +} + +.mec-booking-shortcode .nice-select { + float: none; + border-radius: 3px; + background-color: #fff; + width: 258px; + height: 40px; + line-height: 39px; + padding-left: 15px; + padding-right: 15px; + margin: 0; + font-size: 14px; + font-weight: 400; + min-height: unset; + min-width: unset; + padding-top: 0; + padding-bottom: 0; +} + +.mec-booking-shortcode .mec-gateway-message.mec-success { + font-size: 14px; +} + +.mec-booking-shortcode .mec-form-row.mec-name-stripe { + margin-bottom: 0 !important; +} + +.mec-booking-shortcode + .mec-book-form-gateways + [id*="mec_book_form_gateway_checkout"] + input[type="text"], +.mec-events-meta-group-booking .mec-booking-shortcode .StripeElement { + box-shadow: none !important; +} + +.mec-booking-shortcode .nice-select ul { + width: 100%; +} + +.mec-booking-shortcode span.mec-event-ticket-available { + margin-top: -22px !important; + margin-bottom: 28px !important; + display: block; + font-size: 11px; + letter-spacing: 0.5px; + font-weight: 300; + color: #80abbf; +} + +.mec-booking-shortcode .mec-booking-form-container ul li { + list-style: none; +} + +.mec-booking-shortcode .mec-booking-form-container ul { + padding: 0; +} + +.mec-events-meta-group-booking-shortcode .info-msg { + margin: 24px 0 24px; +} + +@media (max-width: 980px) { + .mec-events-meta-group-booking-shortcode { + padding: 20px; + } + + .mec-booking-shortcode ul.mec-book-price-details li { + width: 100%; + border-right: 0 !important; + border-bottom: 1px solid; + } + + .mec-booking-shortcode ul.mec-book-price-details li:last-child { + width: 100%; + border-right: 0; + border-bottom: 0 solid; + } +} + +.mec-booking-shortcode span.mec-book-price-total { + font-size: 22px; + line-height: 22px; + font-weight: 700; + color: #2bbc10; + margin-top: 20px; + margin-bottom: 35px; + display: inline-block; +} + +.mec-booking-shortcode span.mec-book-price-total-description { + font-size: 18px; + line-height: 22px; + font-weight: 700; + color: #000; +} + +.mec-booking-shortcode span.mec-book-price-total-amount { + font-size: 22px; + line-height: 22px; + font-weight: 700; + color: #2bbc10; +} + +.mec-booking-shortcode .mec-book-form-price { + clear: both; + position: relative; +} + +.mec-booking-shortcode .mec-book-form-gateway-label input[type="radio"]:after { + content: ""; + display: inline-block; + width: 7px; + height: 7px; + background-color: #fff; + border-radius: 50%; + cursor: pointer; + position: absolute; + top: 4px; + left: 3px; +} + +.mec-booking-shortcode .mec-book-form-gateway-label input[type="radio"]:before { + box-shadow: none; + border: 2px solid #a8e4ff; + width: 17px; + height: 17px; + position: absolute; + top: -9px; + left: -2px; + margin: 0; + content: ""; + display: inline-block; + background: #fff; + border-radius: 18px; + cursor: pointer; + position: relative; +} + +.mec-booking-shortcode .mec-book-form-gateway-label label input { + position: relative; + cursor: pointer; + margin: 0 !important; + height: auto; + margin-right: 4px !important; +} + +.mec-booking-shortcode button#mec-book-form-btn-step-2 { + margin-left: 30px; +} + +.mec-booking-shortcode .mec-ticket-name { + display: inline-block; + background-color: #fff; + border-radius: 3px; + font-size: 12px; + line-height: 12px; + font-weight: 400; + color: #00acf8; + padding: 8px 13px; + letter-spacing: 0; +} + +.mec-booking-shortcode .mec_book_first_for_all { + display: none; +} + +.mec-booking-shortcode li.mec-first-for-all-wrapper { + margin-bottom: 20px; + clear: both; +} + +.mec-booking-shortcode label.wn-checkbox-label:before { + display: inline-block; + -moz-transform-origin: left top; + -ms-transform-origin: left top; + -o-transform-origin: left top; + -webkit-transform-origin: left top; + transform-origin: left top; + content: ""; + -webkit-transition: opacity ease 0.5; + -moz-transition: opacity ease 0.5; + transition: opacity ease 0.5; + position: absolute; + background-color: #00acf8; + width: 2px; + -webkit-transform: rotate(-138deg); + transform: rotate(-138deg); +} + +.mec-booking-shortcode label.wn-checkbox-label { + position: relative; + display: inline-block; + -moz-transition: border-color ease 0.2s; + -o-transition: border-color ease 0.2s; + -webkit-transition: border-color ease 0.2s; + transition: border-color ease 0.2s; + cursor: pointer; + vertical-align: middle; + font-size: 14px; + line-height: 19px; + font-weight: 400; + color: #00acf8; + margin: 0 0 4px !important; + padding: 0; + background-color: #fff; + border: 2px solid #a8e4ff; + width: 17px; + height: 17px; + border-radius: 3px; + margin-right: 9px !important; + box-shadow: none; +} + +.mec-booking-shortcode label.wn-checkbox-label:after { + -moz-transform: rotate(-45deg); + -ms-transform: rotate(-45deg); + -o-transform: rotate(-45deg); + -webkit-transform: rotate(-45deg); + transform: rotate(-45deg); + -moz-animation: dothabottomcheck 80ms ease 0s forwards; + -o-animation: dothabottomcheck 80ms ease 0s forwards; + -webkit-animation: dothabottomcheck 80ms ease 0s forwards; + animation: dothabottomcheck 80ms ease 0s forwards; + content: ""; + display: inline-block; + -moz-transform-origin: left top; + -ms-transform-origin: left top; + -o-transform-origin: left top; + -webkit-transform-origin: left top; + transform-origin: left top; + content: ""; + -webkit-transition: opacity ease 0.5; + -moz-transition: opacity ease 0.5; + transition: opacity ease 0.5; + position: absolute; + background-color: #00acf8; + width: 2px; +} + +.mec-booking-shortcode + input[type="checkbox"]:checked + + .wn-checkbox-label::after { + height: 5px; + left: 2px; + top: 7px; + -moz-animation: dothatopcheck 0.16s ease 0s forwards; + -o-animation: dothatopcheck 0.16s ease 0s forwards; + -webkit-animation: dothatopcheck 0.16s ease 0s forwards; + animation: dothatopcheck 0.16s ease 0s forwards; +} + +.mec-booking-shortcode + input[type="checkbox"]:checked + + .wn-checkbox-label::before { + height: 6px; + left: 7px; + top: 9px; + -moz-animation: dothatopcheck 0.16s ease 0s forwards; + -o-animation: dothatopcheck 0.16s ease 0s forwards; + -webkit-animation: dothatopcheck 0.16s ease 0s forwards; + animation: dothatopcheck 0.16s ease 0s forwards; +} + +.mec-booking-shortcode button.mec-book-form-back-button { + background-color: #afe6ff; + box-shadow: 0 2px 2px rgba(175, 230, 255, 0.27); +} + +.mec-booking-shortcode button[type="submit"]:hover, +.mec-booking-shortcode button[type="button"]:hover { + background-color: #000; + text-decoration: none; + box-shadow: 0 4px 10px rgba(1, 2, 4, 0.32); +} + +.mec-booking-shortcode a.button.loading:after, +.mec-booking-shortcode button[type="submit"].loading:after { + display: block; +} + +/* #Booking > Date Selection > Calendar + ================================================== */ +/* Date Selection */ +.mec-single-fluent-wrap .mec-booking-calendar-month-navigation, +.mec-booking-calendar-month-navigation { + position: relative; + text-align: center; + padding: 0; + max-width: 330px; +} + +.mec-single-fluent-wrap .mec-booking-calendar.mec-wrap, +.mec-booking-calendar.mec-wrap { + margin-bottom: 20px; + width: 100%; +} + +.mec-single-fluent-wrap .mec-booking-calendar.mec-wrap, +.mec-booking-calendar.mec-wrap { + max-width: 330px; + background: #ffffff; + box-shadow: 0 1px 5px 6px rgba(0, 0, 0, 0.005) inset; + border: 1px solid #efefef; + border-radius: 5px; +} + +/* Date Selection > Navigation */ +.mec-single-fluent-wrap + .mec-booking-calendar-month-navigation + .mec-calendar-header + h2, +.mec-booking-calendar-month-navigation .mec-calendar-header h2 { + font-size: 13px; + font-weight: 600; + line-height: 40px; + margin: 0 auto; + color: #4d4d4d; +} + +.mec-single-fluent-wrap + .mec-booking-calendar-month-navigation + .mec-previous-month, +.mec-single-fluent-wrap .mec-booking-calendar-month-navigation .mec-next-month, +.mec-booking-calendar-month-navigation .mec-previous-month, +.mec-booking-calendar-month-navigation .mec-next-month { + cursor: pointer; + position: absolute; + top: 0; + min-width: 40px; + height: 40px; + line-height: 40px; + text-align: center; + background: #fff; + color: #a9a9a9; + font-size: 10px; + letter-spacing: 1px; + text-transform: uppercase; + padding-left: 5px; + padding-right: 5px; + border-top: none; + transition: all 0.33s ease; + box-shadow: 0 2px 0 0 rgba(0, 0, 0, 0.015); + transition: all 0.33s ease; +} + +.mec-single-fluent-wrap + .mec-booking-calendar-month-navigation + .mec-previous-month, +.mec-booking-calendar-month-navigation .mec-previous-month { + left: 0; +} + +.mec-single-fluent-wrap .mec-booking-calendar-month-navigation .mec-next-month, +.mec-booking-calendar-month-navigation .mec-next-month { + right: 0; +} + +.mec-single-fluent-wrap + .mec-booking-calendar-month-navigation + .mec-previous-month + a, +.mec-single-fluent-wrap + .mec-booking-calendar-month-navigation + .mec-next-month + a, +.mec-booking-calendar-month-navigation .mec-previous-month a, +.mec-booking-calendar-month-navigation .mec-next-month a { + font-weight: 600; + text-decoration: none; +} + +.mec-single-fluent-wrap + .mec-booking-calendar-month-navigation + .mec-previous-month:hover + a, +.mec-single-fluent-wrap + .mec-booking-calendar-month-navigation + .mec-next-month:hover + a, +.mec-booking-calendar-month-navigation .mec-previous-month:hover a, +.mec-booking-calendar-month-navigation .mec-next-month:hover a { + color: #40d9f1; +} + +/* Date Selection > Calendar */ +.mec-events-meta-group-booking .mec-booking-calendar .mec-calendar { + margin-bottom: 15px; + width: 100%; +} + +.mec-events-meta-group-booking .mec-booking-calendar .mec-calendar dl dt { + text-align: center; + padding: 0; + line-height: 40px; + height: 40px; + border: 0; + background: transparent; + cursor: pointer; +} + +.mec-events-meta-group-booking + .mec-booking-calendar + .mec-calendar + .mec-calendar-row + dt:hover { + background: transparent; +} + +.mec-events-meta-group-booking + .mec-booking-calendar + .mec-calendar + .mec-calendar-novel-selected-day, +.mec-events-meta-group-booking + .mec-booking-calendar + .mec-calendar + .mec-calendar-novel-selected-day + span { + width: 32px; + height: 32px; + margin: auto; + line-height: 30px; + border-radius: 50%; + font-size: 12px; + font-weight: 600; + padding: 0; +} + +/* Bordered Date */ +.mec-has-event-for-booking { + position: relative; +} + +.mec-has-event-for-booking .mec-calendar-novel-selected-day { + border: 1px solid #38d5ed; + border-radius: 50px; + cursor: pointer; +} + +.mec-has-event-for-booking.mec-active .mec-calendar-novel-selected-day { + background-color: #38d5ed; + color: #fff; +} + +/* Selected Date */ +.mec-has-event-for-booking .mec-booking-tooltip, +.mec-multiple-event .mec-has-event-for-booking .mec-booking-tooltip, +.mec-has-event-for-booking .mec-booking-calendar-date { + opacity: 0; + visibility: hidden; + transition: all 0.4s ease; +} + +.mec-has-event-for-booking .mec-booking-tooltip, +.mec-multiple-event .mec-has-event-for-booking .mec-booking-tooltip { + top: 60px; +} + +.mec-has-event-for-booking .mec-booking-tooltip, +.mec-multiple-event .mec-has-event-for-booking .mec-booking-tooltip { + position: absolute; + z-index: 99; + width: 150px; + font-size: 9px; + left: calc(50% - 75px); + background: #535a61; + line-height: 29px; + border-radius: 4px; + color: #fff; + font-weight: 400; + letter-spacing: 1px; + text-transform: uppercase; + padding: 3px 5px; + box-shadow: 0 4px 15px -2px #444b50a3; +} + +.mec-has-event-for-booking:hover + .mec-booking-tooltip.multiple-time + .mec-booking-calendar-date, +.mec-has-event-for-booking:hover .mec-booking-tooltip, +.mec-has-event-for-booking:hover .mec-booking-calendar-date, +.mec-multiple-event .mec-has-event-for-booking:hover .mec-booking-tooltip, +.mec-multiple-event + .mec-has-event-for-booking:hover + .mec-booking-calendar-date { + opacity: 1; + visibility: visible; +} + +.mec-has-event-for-booking:hover .mec-booking-tooltip, +.mec-multiple-event .mec-has-event-for-booking:hover .mec-booking-tooltip { + top: 43px; +} + +.mec-has-event-for-booking .mec-booking-calendar-date:before, +.mec-multiple-event + .mec-has-event-for-booking + .mec-booking-calendar-date:before { + display: block; + content: "" !important; + position: absolute !important; + width: 12px; + height: 12px; + top: -6px; + left: calc(50% - 6px); + transform: rotate(-45deg) !important; + background-color: #535a61; + z-index: 0 !important; + box-shadow: 0 8px 9px -9px #535a61 !important; +} + +.mec-multiple-event + .mec-has-event-for-booking + .mec-booking-calendar-date-hover { + border-bottom: 1px solid #ffffff30; +} + +/* Multiple Day Events */ + +/* First Day */ +.mec-events-meta-group-booking + .mec-booking-calendar + .mec-calendar.mec-multiple-event + .first-day { + position: relative; + padding-left: 7px; +} + +.mec-events-meta-group-booking + .mec-booking-calendar + .mec-calendar.mec-multiple-event + .first-day + .mec-calendar-novel-selected-day { + border-radius: 47px; + border-top-right-radius: 0; + border-bottom-right-radius: 0; + border-right: 0; + width: 100%; +} + +.mec-events-meta-group-booking + .mec-booking-calendar + .mec-calendar.mec-multiple-event + .first-day + .mec-calendar-novel-selected-day + span { + margin-left: -7px; +} + +/* Last Day */ +.mec-events-meta-group-booking + .mec-booking-calendar + .mec-calendar.mec-multiple-event + .last-day { + position: relative; + padding-right: 7px; +} + +.mec-events-meta-group-booking + .mec-booking-calendar + .mec-calendar.mec-multiple-event + .last-day + .mec-calendar-novel-selected-day { + border-radius: 47px; + border-top-left-radius: 0; + border-bottom-left-radius: 0; + border-left: 0; + width: 100%; +} + +.mec-events-meta-group-booking + .mec-booking-calendar + .mec-calendar.mec-multiple-event + .last-day + .mec-calendar-novel-selected-day + span { + margin-right: -7px; +} + +/* Middle Day */ +.mec-events-meta-group-booking + .mec-booking-calendar + .mec-calendar.mec-multiple-event + .middle-day + .mec-calendar-novel-selected-day { + border-radius: 0; + border-right: 0; + border-left: 0; + width: 100%; +} + +/* Multiple Time in one Daye */ +.mec-booking-tooltip.multiple-time { + color: #fff; +} + +.mec-booking-tooltip.multiple-time .mec-booking-calendar-date:before { + display: none; +} + +.mec-booking-tooltip.multiple-time + .mec-booking-calendar-date:first-child:before { + display: block; +} + +.mec-booking-tooltip.multiple-time .mec-booking-calendar-date { + border: 1px dashed #68717a; + line-height: 25px; + margin: 8px 0; + border-radius: 20px; + transition: all 0.17s ease; + -webkit-transition: all 0.17s ease; + -moz-transition: all 0.17s ease; + -ms-transition: all 0.17s ease; + -o-transition: all 0.17s ease; +} + +.mec-calendar-day.mec-active + .mec-booking-tooltip.multiple-time + .mec-booking-calendar-date.mec-active, +.mec-booking-tooltip.multiple-time .mec-booking-calendar-date:hover { + background: #40d9f1; + border-color: #40d9f1; +} + +.mec-choosen-time-message { + max-width: 330px; + padding: 3px 14px; + border-radius: 4px; + background: rgb(64 217 241 / 24%); + color: #40d9f1; + transition: all 0.17s ease; + opacity: 1; + visibility: visible; + font-size: 12px; + margin-bottom: 20px; +} + +.mec-choosen-time-message .mec-choosen-time { + padding-left: 7px; +} + +.mec-choosen-time-message.disable .mec-choosen-time-message, +.mec-choosen-time-message.disable { + opacity: 0; + visibility: hidden; + padding: 0; + font-size: 0; + margin: 0; +} + +/* Booking Calendar Dark Mode */ + +.mec-dark-mode .mec-single-event .mec-events-meta-group-booking .mec-calendar, +.mec-dark-mode + .mec-single-event + .mec-events-meta-group-booking + .mec-booking-calendar-month-navigation { + background: #000; + border-color: #222; + color: #999; +} + +.mec-dark-mode .mec-booking-calendar-month-navigation .mec-next-month, +.mec-dark-mode .mec-booking-calendar-month-navigation .mec-previous-month { + background: #222; + border-color: #000; + color: #d2d2d2; +} + +.mec-dark-mode .mec-booking-calendar.mec-wrap { + border-color: #111; +} + +.mec-dark-mode + .mec-events-meta-group-booking + .mec-booking-calendar + .mec-calendar + .mec-calendar-row + dt:hover { + background: transparent !important; +} + +.mec-dark-mode .mec-calendar.mec-event-calendar-classic, +.mec-dark-mode .mec-calendar.mec-event-calendar-classic .mec-calendar-side { + height: auto; +} + +/* Light Themes */ +.is-light-theme .mec-fes-form textarea { + border: 1px solid #cfeff5; + box-shadow: 0 2px 5px rgba(207, 239, 245, 0.38) inset; +} + +.is-light-theme .mec-fes-form .select2-selection { + height: auto; +} + +.is-light-theme .mec-fes-form input[type="checkbox"]:after { + border: unset !important; +} + +.is-light-theme .mec-fes-form input[type="radio"]:after { + background: unset !important; +} + +.is-light-theme .mec-fes-form input + label { + padding-top: 0; +} + +.is-light-theme .mec-events-event-image img { + height: auto; +} + +span.mec-booking-field-required { + color: red; + margin-left: 10px; +} + +/* General Calendar */ +.mec-gCalendar { + position: relative; +} + +.mec-gCalendar-filters { + display: none; + position: absolute; + width: 518px; + background: #fff; + right: calc(50% - 119px); + top: 60px; + z-index: 9999999; + border: 1px solid #e3e4e5; + border-radius: 7px; + box-shadow: 0 2px 7px rgb(0 0 0 / 5%); +} + +.mec-gCalendar-filters-wrap { + display: flex; + flex-wrap: wrap; + justify-content: space-between; + padding: 30px; + gap: 20px 10px; + align-items: center; +} + +.mec-gCalendar-filters-wrap > div { + flex: 1 0 calc(43% - 10px); + display: inline-flex; +} + +.mec-gCalendar-filters .mec-gCalendar-filters-wrap .mec-search-reset-button { + display: block; + flex: 1 0 calc(100%); +} + +.mec-gCalendar-filters + .mec-gCalendar-filters-wrap + .mec-search-reset-button + button { + width: 100%; + border: 2px solid #e3e5e7; + border-radius: 7px; + color: #4c5765; +} + +.mec-gCalendar-filters + .mec-gCalendar-filters-wrap + .mec-search-reset-button + button:hover { + color: #e9526c; + border-color: #f37f9b; + background-color: transparent; +} + +.mec-gCalendar-filters-wrap .select2-container--default > ul { + margin-top: 2px; + width: 100%; +} + +.mec-gCalendar-filters-wrap span.select2.select2-container { + width: 100% !important; +} + +.mec-gCalendar-filters-wrap .select2-container--default > ul > li { + width: 100%; +} + +.mec-gCalendar-filters-wrap .select2-container--default { + height: 39px; +} + +.mec-gCalendar-filters-wrap span.select2-selection.select2-selection--multiple { + border: none !important; + height: 37px !important; +} + +.mec-gCalendar-filters-wrap + .select2-container--default + .select2-selection--multiple + .select2-selection__choice { + margin: 0; + background-color: #eeeeee; + font-size: 11px; +} + +.mec-gCalendar-filters-wrap + .select2-container--default + .select2-selection--multiple + .select2-selection__rendered + li { + line-height: 29px; + margin-top: 5px; + border: none; + margin-right: 5px; +} + +.mec-gCalendar-filters-wrap .mec-searchbar-category-wrap { + margin: 0 !important; + width: 182px !important; + padding: 0 !important; + height: 40px !important; + border-radius: 0 3px 3px 0; + border: 1px solid #e3e4e5 !important; +} + +.mec-gCalendar-filters-wrap .mec-dropdown-search i, +.mec-gCalendar-filters-wrap .mec-minmax-event-cost i, +.mec-gCalendar-filters-wrap .mec-checkboxes-search i, +.mec-gCalendar-filters-wrap .mec-text-address-search i { + color: #b7b7b7; + background-color: #fbfbfb; + border-radius: 3px 0 0 3px; + border: 1px solid #e3e4e5; + width: 40px; + height: 40px; + line-height: 40px; + padding: 0; + border-right: 0; + text-align: center; +} + +.mec-gCalendar-filters-wrap .mec-minmax-event-cost input, +.mec-gCalendar-filters-wrap .mec-minmax-event-cost input:focus, +.mec-gCalendar-filters-wrap .mec-text-address-search input, +.mec-gCalendar-filters-wrap .mec-text-address-search input:focus { + width: 208px; + height: 40px; + border-radius: 0; + border-right: 0; + border-color: #e3e4e5; + font-size: 12px; + border-style: solid; + border-width: 1px; + padding-left: 15px; +} + +.mec-gCalendar-filters-wrap .mec-text-address-search input:focus, +.mec-gCalendar-filters-wrap .mec-text-address-search input { + width: 415px; +} + +.mec-gCalendar-filters-wrap .mec-minmax-event-cost input:last-child, +.mec-gCalendar-filters-wrap .mec-text-address-search input:focus, +.mec-gCalendar-filters-wrap .mec-text-address-search input { + border-right: 1px solid #e3e4e5; + border-radius: 0 3px 3px 0; + border-left: none; +} + +.mec-gCalendar .mec-gCalendar-filters-wrap .mec-text-address-search i { + border-right: 1px solid #e3e4e5; +} + +.mec-gCalendar-filters-wrap ul.list li[data-value=""] { + display: none; +} + +.mec-gCalendar .fc-h-event .fc-event-title, +.mec-gCalendar .fc .fc-scroller-liquid-absolute, +.mec-gCalendar .fc .fc-scroller-harness { + overflow: visible !important; +} + +.mec-gCalendar-filters:before, +#MonthPicker_mec-gCalendar-month-filter:before, +.mec-gCalendar-filters:after, +#MonthPicker_mec-gCalendar-month-filter:after { + content: ""; + display: block; + position: absolute; + left: 50%; + margin-left: 77px; + width: 0; + height: 0; + border-style: solid; + border-width: 7px; +} + +#MonthPicker_mec-gCalendar-month-filter:before, +#MonthPicker_mec-gCalendar-month-filter:after { + margin-left: 68px; +} + +.mec-gCalendar-filters:before, +#MonthPicker_mec-gCalendar-month-filter:before { + top: -15px; + border-color: transparent transparent #e3e9f1 transparent; +} + +.mec-gCalendar-filters:after, +#MonthPicker_mec-gCalendar-month-filter:after { + top: -14px; + border-color: transparent transparent #fff transparent; +} + +.mec-gCalendar { + font-family: inherit; +} + +.mec-gCalendar-tooltip { + width: 290px; + height: auto; + position: absolute; + background: #fff; + left: calc(50% - 145px); + bottom: calc(100% - 1px); + border: 1px solid #e3e4e5; + border-radius: 7px; + opacity: 1; + box-shadow: 0 4px 13px rgb(0 0 0 / 7%); + z-index: 9997; +} + +@media (max-width: 991px) { + .mec-gCalendar-tooltip { + display: none; + } +} + +.mec-gCalendar-tooltip-image img { + width: 100%; + border-radius: 3px !important; +} + +.mec-gCalendar-tooltip-image { + padding: 10px; + padding-bottom: 8px; +} + +.mec-gCalendar a.fc-event:active { + opacity: 1; +} + +.mec-gCalendar #mec-gCalendar-wrap a.fc-event { + padding: 7px 3px; + font-size: 12px; + font-weight: 400; +} + +.mec-gCalendar-tooltip-title { + color: #000; + line-height: 24px; + font-size: 15px; + padding: 10px 25px; + font-weight: 500; +} + +.mec-gCalendar-tooltip-title span { + width: 12px; + height: 12px; + display: inline-block; + margin-left: 7px; + vertical-align: middle; + border-radius: 50px; +} + +.mec-gCalendar-tooltip-title a { + color: #000; +} + +.mec-gCalendar-tooltip-title a:hover { + text-decoration: underline; + color: #000; +} + +.mec-gCalendar-tooltip-location { + color: #707172; + font-size: 12px; + font-weight: normal; + line-height: 23px; + padding: 0 25px 15px; + margin-top: -2px; +} + +.mec-gCalendar-tooltip-location i { + margin-right: 6px; + color: #c1c7ce; +} + +.mec-gCalendar .fc-event-time { + display: none; +} + +.mec-gCalendar-tooltip-date { + background: #f7f8f9; + color: #898a8c; + font-weight: 400; + padding: 10px 24px; + display: flex; + justify-content: space-between; + font-size: 12px; +} + +.mec-gCalendar-tooltip-date-text > div > span, +.mec-gCalendar-tooltip-date-time > div > span { + display: block; + line-height: 23px; +} + +.mec-gCalendar-tooltip-date-text > div > span:last-child, +.mec-gCalendar-tooltip-date-time > div > span:last-child { + margin: 0; +} + +.mec-gCalendar-tooltip-date-text .mec-gCalendar-tooltip-date-day { + font-size: 14px; + color: #000; +} + +.mec-gCalendar-tooltip-date-text, +.mec-gCalendar-tooltip-date-time { + display: flex; + align-items: baseline; +} + +.mec-gCalendar-tooltip-date-text i, +.mec-gCalendar-tooltip-date-time i { + margin-right: 8px; + color: #c1c7ce; +} + +.mec-gCalendar-tooltip:after, +.mec-gCalendar-tooltip:before { + content: ""; + display: block; + position: absolute; + left: calc(50% - 8px); + width: 0; + height: 0; + border-style: solid; + border-width: 8px; +} + +.mec-gCalendar-tooltip:before { + bottom: -17px; + border-color: #e3e9f1 transparent transparent transparent; +} + +.mec-gCalendar-tooltip:after { + bottom: -16px; + border-color: #fff transparent transparent transparent; +} + +#mec-gCalendar-wrap .openMonthFilter i { + -moz-transition: all 0.27s ease; + -webkit-transition: all 0.27s ease; + -o-transition: all 0.27s ease; + transition: all 0.27s ease; +} + +#mec-gCalendar-wrap .openMonthFilter.open i { + transform: rotate(-180deg); +} + +.mec-gCalendar input#mec-gCalendar-month-filter { + display: none; +} + +.mec-gCalendar .fc-header-toolbar .fc-toolbar-chunk, +.mec-gCalendar + .fc-header-toolbar + .fc-toolbar-chunk + > div:not(#MonthPicker_mec-gCalendar-month-filter) { + display: flex; + align-items: center; + justify-content: space-between; +} + +.mec-gCalendar .fc-header-toolbar .fc-toolbar-chunk { + margin-bottom: 8px; +} + +.mec-gCalendar #mec-gCalendar-wrap .fc-header-toolbar.fc-toolbar { + border: 1px solid #e3e4e5; + border-radius: 7px; + padding: 18px 30px 10px; + position: relative; + flex-wrap: wrap; +} + +.mec-gCalendar #mec-gCalendar-wrap h2.fc-toolbar-title { + font-size: 22px; + font-weight: 600; + line-height: 20px; + margin-right: 20px; + position: relative; +} + +.mec-gCalendar #mec-gCalendar-wrap h2.fc-toolbar-title > span { + font-weight: 100; +} + +.mec-gCalendar h2.fc-toolbar-title i { + color: #a1a2a3; + cursor: pointer; + margin-left: 2px; + font-size: 14px; + margin-right: 0; +} + +.mec-gCalendar h2.fc-toolbar-title button { + background: transparent; + border: none; + cursor: pointer; + padding: 0; + outline: none; +} + +.mec-gCalendar table.fc-scrollgrid-sync-table tbody td { + border: none; + border-bottom: 1px solid #eee; + border-right: 1px solid #eee; +} + +.mec-gCalendar button.fc-prevYear-button.fc-button.fc-button-primary, +.mec-gCalendar button.fc-prevYear-button.fc-button.fc-button-primary:active, +.mec-gCalendar button.fc-nextYear-button.fc-button.fc-button-primary:active, +.mec-gCalendar button.fc-nextYear-button.fc-button.fc-button-primary { + background: #fff; + color: #a1a2a3; + border-radius: 7px 0 0 7px; + border-color: #e3e4e5; + padding: 3px 2px; + box-shadow: none !important; +} + +.mec-gCalendar button.fc-button span.fc-icon { + font-size: 20px; + padding: 1px 0; + width: 30px; + height: 34px; + vertical-align: middle; + position: relative; +} + +.mec-gCalendar-filters-wrap .nice-select .list { + margin: 0; + box-shadow: 0 0 0 1px rgb(68 68 68 / 11%), 0 2px 4px rgb(0 0 0 / 5%); +} + +.mec-gCalendar button.fc-button span.fc-icon:before { + vertical-align: middle; + font-size: 18px; + position: absolute; + top: calc(50% - 9px); + left: calc(50% - 9px); +} + +.mec-gCalendar button.fc-prevYear-button.fc-button.fc-button-primary { + border-right: none; +} + +.mec-gCalendar button.fc-nextYear-button.fc-button.fc-button-primary { + border-left: none; + border-radius: 0 7px 7px 0; +} + +.mec-gCalendar button.fc-prev-button.fc-button.fc-button-primary, +.mec-gCalendar button.fc-prev-button.fc-button.fc-button-primary:active, +.mec-gCalendar button.fc-next-button.fc-button.fc-button-primary:active, +.mec-gCalendar button.fc-next-button.fc-button.fc-button-primary { + background: #fff; + color: #a1a2a3; + border-right: none; + border-left: none; + border-radius: 0; + border-color: #e3e4e5; + padding: 3px 2px; + box-shadow: none !important; +} + +.mec-gCalendar button.fc-today-button.fc-button.fc-button-primary:active, +.mec-gCalendar button.fc-today-button.fc-button.fc-button-primary { + background: #fff; + color: #707070; + border-left: none; + border-right: none; + border-radius: 0; + border-color: #e3e4e5; + font-size: 13px; + text-transform: capitalize; + font-weight: 400; + opacity: 1; + padding: 9px 8px 12px; + box-shadow: none !important; + cursor: pointer; + height: 42px; +} + +.mec-gCalendar button.fc-today-button.fc-button.fc-button-primary:disabled { + cursor: auto; +} + +.mec-gCalendar button.fc-button.fc-button-primary:hover span, +.mec-gCalendar button.fc-button.fc-button-primary:hover span { + background: #f4f5f6; + color: #000; + border-radius: 7px; +} + +.mec-gCalendar + button.fc-today-button.fc-button.fc-button-primary:not(:disabled):hover { + background: #f4f5f6; + color: #000; + border-radius: 0; +} + +.mec-gCalendar button.fc-findEvents-button.fc-button.fc-button-primary, +.mec-gCalendar button.fc-findEvents-button.fc-button.fc-button-primary:active, +.mec-gCalendar button.fc-filterEvents-button.fc-button.fc-button-primary { + min-width: 100px; + border-radius: 7px !important; + margin-right: 0; + background: #00acf8; + border: none !important; + padding: 10px 15px 11px; + font-size: 13px; + font-weight: 500; + margin-left: 20px !important; + box-shadow: none !important; +} + +.mec-gCalendar + tr.fc-scrollgrid-section.fc-scrollgrid-section-header.fc-scrollgrid-section-sticky + > td { + border-radius: 7px 7px 0 0; + border: none; +} + +.mec-gCalendar button.fc-filterEvents-button.fc-button.fc-button-primary { + position: relative; + text-align: right; + padding-right: 13px; + padding-left: 32px; + min-width: auto; + background: none; + font-size: 14px; + color: #969798; + font-weight: 400; +} + +.mec-gCalendar button.fc-filterEvents-button.fc-button.fc-button-primary:active, +.mec-gCalendar button.fc-filterEvents-button.fc-button.fc-button-primary:hover { + background: #f4f5f6; + color: #000000; +} + +.mec-gCalendar button.fc-filterEvents-button.fc-button.fc-button-primary svg { + position: absolute; + left: 10px; + top: 14px; +} + +.mec-gCalendar button.fc-findEvents-button.fc-button.fc-button-primary:hover { + background: #444; +} + +.mec-gCalendar-tooltip-location, +.mec-gCalendar-tooltip-title { + white-space: normal; +} + +.mec-gCalendar + #mec-gCalendar-wrap + .mec-gCalendar-search-text-wrap + input[type="text"], +.mec-gCalendar + #mec-gCalendar-wrap + .mec-gCalendar-search-text-wrap + input[type="text"]:focus { + margin: 0; + border: none; + box-shadow: none !important; + font-size: 14px; + font-weight: 400; + line-height: 20px; + color: #949aa1; + padding-right: 5px; + padding-left: 8px; + background: #fff; + outline: none; + display: inline-block; +} + +.mec-gCalendar + .mec-gCalendar-search-text-wrap + input[type="text"]::-webkit-input-placeholder { + /* Chrome/Opera/Safari */ + color: #949aa1; +} + +.mec-gCalendar + .mec-gCalendar-search-text-wrap + input[type="text"]::-moz-placeholder { + /* Firefox 19+ */ + color: #949aa1; +} + +.mec-gCalendar + .mec-gCalendar-search-text-wrap + input[type="text"]:-ms-input-placeholder { + /* IE 10+ */ + color: #949aa1; +} + +.mec-gCalendar + .mec-gCalendar-search-text-wrap + input[type="text"]:-moz-placeholder { + /* Firefox 18- */ + color: #949aa1; +} + +.mec-gCalendar-search-text-wrap { + border-left: 1px solid #e3e4e5; + padding-left: 16px; +} + +.mec-gCalendar-search-text-wrap i { + margin-right: 0; + color: #bcc4ce; + font-size: 17px; +} + +.mec-gCalendar .fc-direction-ltr .fc-button-group > .fc-button:first-child { + margin-left: 7px !important; +} + +.mec-gCalendar .fc-direction-ltr .fc-toolbar > * > :not(:first-child) { + margin-left: 0; +} + +.mec-gCalendar .mec-localtime-wrap { + color: #000; + font-size: 11px; + margin-top: 2px; + margin-bottom: 2px; +} + +.mec-gCalendar .fc-theme-standard .fc-popover { + background: #fff; + border: 1px solid #e3e4e5; + border-radius: 7px; + box-shadow: 0 4px 13px rgb(0 0 0 / 7%); +} + +.mec-gCalendar .mec-localtime-wrap i { + display: none; +} + +.mec-gCalendar .datepicker.dropdown-menu { + top: 51px !important; + left: unset !important; + right: 0; +} + +.mec-month-picker.datepicker.dropdown-menu { + position: absolute; + min-width: 215px !important; + z-index: 999; + background: #fff; + padding: 4px 0 3px; + margin: 0; + color: #000; + border: 1px solid #e3e4e5; + border-radius: 7px; + box-shadow: 0 3px 5px rgb(0 0 0 / 3%); +} + +.mec-month-picker.datepicker.dropdown-menu *, +.mec-month-picker.datepicker.dropdown-menu * { + background: #fff; + border-radius: 7px; + border: none; + height: auto; +} + +.mec-month-picker.datepicker table caption + thead tr:first-child td, +.mec-month-picker.datepicker table caption + thead tr:first-child th, +.mec-month-picker.datepicker table colgroup + thead tr:first-child td, +.mec-month-picker.datepicker table colgroup + thead tr:first-child th, +.mec-month-picker.datepicker table thead:first-child tr:first-child td, +.mec-month-picker.datepicker table thead:first-child tr:first-child th { + border: none; +} + +.mec-month-picker.datepicker table thead:first-child tr:first-child th.switch { + font-weight: 500; +} + +.mec-month-picker.datepicker table thead:first-child tr:first-child th.next, +.mec-month-picker.datepicker table thead:first-child tr:first-child th.prev { + font-size: 0; + padding-top: 11px; +} + +.mec-month-picker.datepicker + table + thead:first-child + tr:first-child + th.next:before, +.mec-month-picker.datepicker + table + thead:first-child + tr:first-child + th.prev:before { + content: "\e606"; + font-family: simple-line-icons; + speak: none; + font-style: normal; + font-weight: 400; + font-variant: normal; + text-transform: none; + line-height: 1; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + font-size: 12px; + color: #a1a2a3; +} + +.mec-month-picker.datepicker + table + thead:first-child + tr:first-child + th.prev:before { + content: "\e605"; +} + +.mec-month-picker.datepicker table.table-condensed thead tr { + display: flex; + padding: 6px 12px 10px; + justify-content: space-between; + align-items: center; +} + +.mec-month-picker.datepicker thead tr:first-child th { + width: auto; + height: auto; +} + +.mec-month-picker.datepicker thead tr:first-child th.prev, +.mec-month-picker.datepicker thead tr:first-child th.next { + width: 34px; + height: 34px; + padding: 0 12px; +} + +.mec-month-picker.datepicker thead tr:first-child th.switch { + padding: 5px 18px; +} + +.mec-month-picker.datepicker table.table-condensed tbody tr td { + justify-content: space-between; + align-items: center; + padding: 0 9px 7px; + display: flex; + flex-direction: row; + flex-wrap: wrap; + width: auto; +} + +.mec-month-picker.datepicker td span.active:hover, +.mec-month-picker.datepicker td span.active:focus, +.mec-month-picker.datepicker td span.active:active, +.mec-month-picker.datepicker td span.active.active, +.mec-month-picker.datepicker td span.active.disabled, +.mec-month-picker.datepicker td span.active[disabled] { + background-color: #00acf8; + text-shadow: none; +} + +.mec-month-picker.datepicker td span { + width: 43px; + line-height: 41px; + font-size: 14px; +} + +.mec-month-picker.datepicker thead tr:first-child th:hover { + background: #f4f5f6; +} + +.mec-month-picker.datepicker thead tr:first-child th:hover:before { + color: #000 !important; +} + +.mec-month-picker.datepicker td span:hover { + background-color: #f4f5f6; +} + +.mec-month-picker.datepicker:after { + left: unset; + right: 11px; +} + +.mec-month-picker.datepicker:before { + left: unset; + right: 10px; +} + +#gCalendar-loading { + width: 100%; + height: 100%; + background: no-repeat rgba(255, 255, 255, 0.88) url("../img/ajax-loader.gif") + center; + border-style: none; + position: absolute; + left: 0; + right: 0; + bottom: 0; + top: 0; + z-index: 9; +} + +#gCalendar-loading.mec-modal-preloader { + display: block !important; +} + +.fc-daygrid.fc-dayGridMonth-view.fc-view { + overflow: auto; + border: 1px solid #e3e4e5; + border-radius: 7px; +} + +#mec-gCalendar-wrap table.fc-scrollgrid { + min-width: 650px; + overflow: auto; + border: none; + border-radius: unset; +} + +@media (min-width: 992px) { + #mec-gCalendar-wrap table.fc-scrollgrid, + .fc-daygrid.fc-dayGridMonth-view.fc-view { + overflow: visible; + } +} + +#mec-gCalendar-wrap table.fc-scrollgrid thead tr td { + border: none !important; + background: transparent; +} + +#mec-gCalendar-wrap table.fc-scrollgrid table { + margin-bottom: 0; +} + +#mec-gCalendar-wrap table.fc-scrollgrid tr th { + background: transparent; + padding: 20px 0 3px 10px; + text-align: left; + border-right: none !important; + border-left: none !important; + border-bottom: 1px solid #e3e4e5; + border-top: none; +} + +#mec-gCalendar-wrap table.fc-scrollgrid tr th.fc-col-header-cell { + border: none; +} + +#mec-gCalendar-wrap table.fc-scrollgrid tr th a { + font-size: 15px !important; + font-weight: 500 !important; + color: #000; + text-decoration: none; +} + +#mec-gCalendar-wrap .openMonthFilter { + position: relative; + padding: 7px 10px 2px; + display: inline-block; +} + +#mec-gCalendar-wrap.fc .fc-daygrid-day-number { + font-size: 16px; + padding: 12px 10px 2px; + color: #000; + text-decoration: none; +} + +#mec-gCalendar-wrap table.fc-scrollgrid-sync-table { + margin: 0; + border-spacing: 0; + border-collapse: separate; +} + +.mec-gCalendar table.fc-scrollgrid-sync-table tbody tr td:last-child { + border-right: none; +} + +.mec-gCalendar table.fc-scrollgrid-sync-table tbody tr:last-child td { + border-bottom: none; +} + +#mec-gCalendar-wrap span.mec-general-calendar-label { + color: #fff; + padding: 1px 4px 3px; + font-size: 11px; + border-radius: 3px; + margin: 5px 3px 2px 0; + display: inline-block; +} + +.mec-gCalendar .fc .fc-scrollgrid-section-sticky > * { + position: relative; + z-index: 1; +} + +.mec-gCalendar .fc-direction-ltr .fc-daygrid-event.fc-event-end, +.mec-gCalendar .fc-direction-rtl .fc-daygrid-event.fc-event-start, +.mec-gCalendar .fc-direction-ltr .fc-daygrid-event.fc-event-start, +.mec-gCalendar .fc-direction-rtl .fc-daygrid-event.fc-event-end { + margin-right: 0 !important; + margin-left: 0 !important; +} + +#mec-gCalendar-wrap table.fc-scrollgrid-sync-table tr td { + text-align: left; + background: #fff !important; +} + +#mec-gCalendar-wrap table.fc-scrollgrid-sync-table .fc-daygrid-day-top { + display: flex; + flex-direction: row; + padding-left: 10px; +} + +#mec-gCalendar-wrap .fc-daygrid-day.fc-day-today { + background: #fff !important; +} + +#mec-gCalendar-wrap .fc-daygrid-day.fc-day-today .fc-daygrid-day-number { + color: #00acf8; + font-size: 17px; + font-weight: 500; +} + +#mec-gCalendar-wrap .fc-scrollgrid-section-body > td { + border: none !important; +} + +#mec-gCalendar-wrap + table.fc-scrollgrid-sync-table + tbody + tr:last-child + td:first-child { + border-radius: 0 0 0 7px; +} + +#mec-gCalendar-wrap + table.fc-scrollgrid-sync-table + tbody + tr:last-child + td:last-child { + border-radius: 0 0 7px 0; +} + +.select2-container { + z-index: 99999999; +} + +@media (max-width: 1200px) { + .mec-gCalendar-search-text-wrap { + padding-left: 10px; + } + + .mec-gCalendar .mec-gCalendar-search-text-wrap input[type="text"], + .mec-gCalendar .mec-gCalendar-search-text-wrap input[type="text"]:focus { + width: 100px; + } +} + +@media (max-width: 991px) { + .mec-gCalendar .mec-gCalendar-search-text-wrap input[type="text"], + .mec-gCalendar .mec-gCalendar-search-text-wrap input[type="text"]:focus { + width: auto; + } + + .mec-gCalendar #mec-gCalendar-wrap .fc-header-toolbar.fc-toolbar { + display: block; + } + + .mec-gCalendar .fc-header-toolbar .fc-toolbar-chunk:last-child { + margin: 0; + } + + .mec-gCalendar-search-text-wrap { + border-left: none; + } +} + +@media (max-width: 990px) { + .mec-gCalendar .fc-header-toolbar .fc-toolbar-chunk:first-child > div { + width: 100%; + justify-content: flex-start !important; + position: relative; + } + + .mec-gCalendar #mec-gCalendar-wrap h2.fc-toolbar-title { + position: relative; + } +} + +@media (max-width: 480px) { + .mec-gCalendar button.fc-today-button.fc-button.fc-button-primary, + .mec-gCalendar button.fc-today-button.fc-button.fc-button-primary:active { + padding: 6px 6px 9px; + } + + .mec-gCalendar button.fc-button span.fc-icon { + font-size: 12px; + width: 20px; + height: 27px; + } + + .mec-gCalendar #mec-gCalendar-wrap h2.fc-toolbar-title { + font-size: 17px; + margin-right: 11px; + } + + .mec-gCalendar .fc-header-toolbar .fc-toolbar-chunk, + .mec-gCalendar + .fc-header-toolbar + .fc-toolbar-chunk + > div:not(#MonthPicker_mec-gCalendar-month-filter) { + flex-wrap: wrap; + } + + .mec-gCalendar + .fc-header-toolbar + .fc-toolbar-chunk:last-child + > div:not(#MonthPicker_mec-gCalendar-month-filter) { + width: 100%; + display: block; + } + + .mec-gCalendar + .fc-header-toolbar + .fc-toolbar-chunk:last-child + > div.fc-button-group { + text-align: right; + } + + .mec-gCalendar-filters-wrap .mec-text-address-search input, + .mec-gCalendar-filters-wrap .mec-text-address-search input:focus { + width: 100%; + } + + .mec-gCalendar-filters-wrap > div { + width: 100%; + } + + .mec-gCalendar-filters-wrap .nice-select { + width: 100%; + } + + .mec-gCalendar-filters { + width: 328px; + right: calc(50% - 165px); + top: 52px; + } + + .mec-gCalendar-filters:after, + .mec-gCalendar-filters:before { + margin-left: 30px; + } + + .mec-gCalendar-filters-wrap .mec-minmax-event-cost input, + .mec-gCalendar-filters-wrap .mec-minmax-event-cost input:focus { + width: 116px; + } + + .mec-month-picker.datepicker:after { + left: unset; + right: 55px; + } + + .mec-month-picker.datepicker:before { + left: unset; + right: 54px; + } + + .mec-month-picker.datepicker.dropdown-menu { + top: 40px !important; + right: -45px; + } + + .mec-gCalendar #mec-gCalendar-wrap .fc-header-toolbar.fc-toolbar { + padding: 18px 10px; + } + + .mec-gCalendar button.fc-today-button.fc-button.fc-button-primary, + .mec-gCalendar button.fc-today-button.fc-button.fc-button-primary:active { + height: 35.5px; + } + + .mec-gCalendar-search-text-wrap { + border-left: 0; + border-bottom: 1px solid #eee; + padding: 0; + margin-bottom: 10px; + } + + .mec-gCalendar-filters:after, + .mec-gCalendar-filters:before { + margin: 0; + } +} + +@media (max-width: 360px) { + .mec-gCalendar + .fc-header-toolbar + .fc-toolbar-chunk:last-child + > div.fc-button-group { + text-align: left; + } + + .mec-gCalendar + .fc-header-toolbar + .fc-toolbar-chunk:last-child + > div:not(#MonthPicker_mec-gCalendar-month-filter) { + margin-bottom: 8px; + } + + .mec-gCalendar #mec-gCalendar-wrap h2.fc-toolbar-title { + position: relative; + width: 100%; + } + + .mec-gCalendar .fc-header-toolbar .fc-toolbar-chunk:first-child > div { + justify-content: left !important; + } + + .mec-gCalendar #mec-gCalendar-wrap h2.fc-toolbar-title { + font-size: 22px; + } + + .mec-gCalendar button.fc-button span.fc-icon { + font-size: 20px; + width: 30px; + height: 34px; + } + + .mec-gCalendar button.fc-today-button.fc-button.fc-button-primary, + .mec-gCalendar button.fc-today-button.fc-button.fc-button-primary:active { + padding: 9px 8px 12px; + } + + .mec-gCalendar-filters:after, + .mec-gCalendar-filters:before { + margin-left: -100px; + } + + .mec-gCalendar-filters { + top: 60px; + } + + .mec-month-picker.datepicker.dropdown-menu { + width: 215px; + } + + .mec-month-picker.datepicker.dropdown-menu { + top: 37px !important; + right: 27px; + } + + .mec-gCalendar #mec-gCalendar-wrap h2.fc-toolbar-title { + font-size: 12px; + display: inline-block; + width: auto; + } + + #mec-gCalendar-wrap .openMonthFilter { + padding-right: 0; + } + + .mec-gCalendar button.fc-button span.fc-icon { + width: 20px; + height: 27px; + } + + .mec-gCalendar button.fc-today-button.fc-button.fc-button-primary, + .mec-gCalendar button.fc-today-button.fc-button.fc-button-primary:active { + line-height: 1; + } + + .mec-month-picker.datepicker.dropdown-menu { + right: -80px; + } + + .mec-month-picker.datepicker:after { + right: calc(50% - 3px); + } + + .mec-month-picker.datepicker:before { + right: calc(50% - 4px); + } + + .mec-gCalendar + .fc-header-toolbar + .fc-toolbar-chunk:last-child + > div.fc-button-group { + text-align: right; + } + + .mec-gCalendar-filters { + width: 300px; + right: calc(50% - 150px); + } + + .mec-gCalendar-filters-wrap { + padding: 15px; + } + + .fc-h-event .fc-event-main { + font-size: 9px; + line-height: 11px; + } +} + +/* MEC Cart */ +@media (max-width: 768px) { + .mec-cart { + overflow-x: scroll; + } +} + +.mec-cart-coupon input[type="text"] { + min-height: 40px; + font-size: 13px; + line-height: 38px; + color: #606367; + border: 1px solid #e3e5e7; + border-radius: 3px; + padding: 0 12px; + margin-bottom: 0; + box-shadow: unset; + width: 330px; + vertical-align: top; +} + +.mec-cart ul { + padding: 0; + list-style: none; +} + +.mec-cart ul h5, +.mec-cart ul h6 { + margin: 0; + font-size: 14px; + color: #000; + font-weight: inherit; +} + +.mec-cart ul h6 { + padding-left: 0; +} + +.mec-cart ul h6:before { + content: "— "; +} + +.mec-cart ul h5 { + font-weight: 400; + margin: 0 0 3px 0; +} + +.mec-cart ul h6:last-child { + margin-bottom: 12px; +} + +.mec-cart table td:nth-child(4) ul li { + margin-bottom: 5px; +} + +.mec-cart table td:nth-child(4) ul li:last-child { + margin-bottom: 12px; +} + +.mec-cart table a { + font-size: 15px; + font-weight: 400; + line-height: 20px; + color: #474849; + fill: #474849; +} + +.mec-cart table a:hover { + color: #000; +} + +.mec-cart table #mec_cart_total_payable, +.mec-cart table .mec-transaction-price { + font-size: 20px; + font-weight: 700; + line-height: 26px; + letter-spacing: -0.8px; + text-align: right; + color: #060607; + fill: #060607; +} + +.mec-cart table .mec-line-through { + text-decoration: line-through; +} + +.mec-cart table .mec-cart-remove-transactions svg:hover, +.mec-cart table .mec-cart-remove-transactions svg:hover path { + color: red !important; + fill: red !important; + cursor: pointer; +} + +.mec-cart table tr { + text-align: left; +} + +.mec-cart table tr th { + margin-bottom: 27px; + margin-top: 0; + padding: 9px 12px 9px; + font-size: 14px; + line-height: 1.8; + letter-spacing: 0; + font-weight: 600; + position: relative; + color: #000; +} + +.mec-cart table tr td { + padding: 9px 12px 9px; + font-size: 14px; + color: #000; +} + +.mec-cart table tr td a:hover { + color: #000; + text-decoration: underline; +} + +.mec-cart table tr td, +.mec-cart table tr th { + background-color: #fff !important; + border: 0 !important; + vertical-align: middle; +} + +.mec-cart table tr { + border-top: 1px solid rgba(0, 0, 0, 0.1); +} + +.mec-cart table tr th:last-child { + text-align: right; +} + +.mec-cart table tr { + border-top: 1px solid rgba(0, 0, 0, 0.1); +} + +.mec-cart table td:nth-child(1) { + width: 35px; + max-width: 35px; +} + +.mec-cart table td:nth-child(2) { + width: 135px; + max-width: 135px; +} + +.mec-cart table td:nth-child(3), +.mec-cart table td:nth-child(4) { + min-width: 200px; + width: 200px; +} + +.mec-cart table td:nth-child(5) { + font-size: 12px; +} + +.mec-cart table td:nth-child(6) { + text-align: right; + vertical-align: middle; +} + +.mec-cart .mec-cart-coupon-code { + font-size: 12px; + color: #8d9599; +} + +.mec-cart table thead tr th { + border-bottom: 1px solid #a3a3a3 !important; +} + +.mec-cart table thead tr, +.mec-cart table thead tr th { + border-top: none !important; +} + +@media only screen and (max-width: 992px) { + .mec-cart table { + min-width: 780px; + overflow-x: scroll; + } +} + +.mec-cart table tfoot tr th:last-child { + display: none; +} + +/* MEC Checkout */ +.mec-checkout .mec-checkout-list { + list-style: none; + padding: 0; + margin: 40px 0; + display: grid; + grid-template-columns: auto auto; + column-gap: 25px; + row-gap: 25px; + padding-bottom: 40px; + border-bottom: 1px solid #e6e6e6; +} + +.mec-checkout .mec-checkout-list .mec-list-items { + padding: 20px 30px; + background: #fff; + border: 1px solid #e6e6e6; + box-shadow: 0 2px 0 0 rgb(0 0 0 / 2%); +} + +.mec-checkout .mec-checkout-list .mec-list-items h3 { + margin-top: 20px; + margin-bottom: 12px; + font-size: 22px; + line-height: 27px; + letter-spacing: -0.4px; + font-weight: 700; + position: relative; +} + +.mec-checkout .mec-checkout-list .mec-list-items h5 { + font-size: 18px; + font-weight: 500; + padding-bottom: 5px; + display: inline; + color: #000; + margin: 0 0 8px 0; +} + +.mec-checkout .mec-checkout-list .mec-list-items h6 { + margin: 0; + font-size: 16px; + line-height: 23px; + color: #8d9599; + font-weight: inherit; +} + +.mec-checkout .mec-checkout-list .mec-list-items h6 { + padding-left: 0; +} + +.mec-checkout .mec-checkout-list .mec-list-items h6:before { + content: "— "; +} + +.mec-checkout .mec-checkout-list .mec-list-items ul { + list-style: none; + padding: 15px 0 0 0; +} + +.mec-checkout .mec-checkout-list .mec-list-items .mec-checkout-price-details { + color: #000; + border: none; + border-radius: 2px; + background: #f7f7f7; + padding: 15px; + margin: 15px 0 0 0; + max-width: 100%; +} + +.mec-checkout + .mec-checkout-list + .mec-list-items + .mec-checkout-price-details + li { + display: flex; + flex-wrap: nowrap; + justify-content: space-between; +} + +.mec-checkout #mec_cart_total_payable { + margin: 0 0 40px 0; + font-size: 29px; + line-height: 27px; + letter-spacing: -0.4px; + font-weight: 700; + position: relative; + color: #39c36e; +} + +.mec-checkout .mec-gateway-comment { + margin-top: 20px; + margin: 0 0 20px 0; + color: #616161; + font-size: 14px; + line-height: 1.8; +} + +.mec-checkout .mec-email-stripe input[type="email"], +.mec-checkout .mec-name-stripe input[type="text"] { + box-sizing: border-box; + height: 40px; + padding: 10px 12px; + border: 0 !important; + border-radius: 4px; + background-color: #fff; + box-shadow: 0 1px 3px 0 #e6ebf1 !important; + -webkit-transition: box-shadow 150ms ease; + transition: box-shadow 150ms ease; + margin-bottom: 20px; + background: #fff !important; + max-width: 330px; +} + +.mec-checkout label { + color: #424242; + font-weight: 700; + font-size: 13px; + letter-spacing: 0; + margin: 0 0 4px 0; + display: block; + clear: none; + padding: 7px 1em 3px 0; +} + +.mec-checkout input[type="radio"]:before { + content: ""; + display: inline-block; + background: #fff; + border-radius: 24px; + width: 13px; + height: 13px; + cursor: pointer; + margin: 1px 0 0 0; + border: 1px solid #d7d8d9; +} + +.mec-checkout input[type="radio"]:checked:before { + border: 0; + background: #000; +} + +.mec-checkout input[type="radio"] { + margin: 0 4px 0 0; + font-size: 0; +} + +.mec-checkout input[type="checkbox"] { + float: left; +} + +.mec-checkout-gateways-wrapper { + max-width: 54%; + margin-bottom: 20px; +} + +@media (max-width: 768px) { + .mec-checkout-gateways-wrapper { + max-width: 100%; + margin-bottom: 20px; + } +} + +.mec-checkout .mec-book-form-next-button { + float: right; + right: 30%; + width: 155px; + text-align: center; +} + +.mec-checkout .mec-checkout-actions .mec-checkout-cart-link.button { + background-color: #c4cace !important; + width: 155px; + text-align: center; +} + +.mec-checkout .mec-book-form-next-button:hover, +.mec-checkout .mec-checkout-actions .mec-checkout-cart-link.button:hover { + background: #000 !important; +} + +@media (max-width: 768px) { + .mec-checkout .mec-checkout-list { + display: block; + padding-bottom: 20px; + } + + .mec-checkout .mec-checkout-list .mec-list-items { + margin-bottom: 20px; + padding: 15px; + } + + .mec-checkout-gateways-wrapper { + max-width: 100%; + margin-bottom: 20px; + } + + .mec-checkout .mec-book-form-next-button { + right: 0; + } +} + +.mec-checkout-footer { + background: #f5f6f7; + padding: 30px 40px 15px; + border-radius: 5px; +} + +.mec-checkout #mec_cart_total_payable { + margin: 0 0 15px; + font-size: 26px; + line-height: 1; + letter-spacing: -0.4px; + font-weight: 700; + position: relative; + color: #000000; +} + +/* MEC Checkbox Filter */ + +.mec-wrap .mec-simple-checkboxes-search { + display: table-cell; + float: none; + padding: 0 10px; +} + +.mec-wrap .mec-simple-checkboxes-search i { + font-size: 18px; + width: unset; + height: unset; + background: none; + border: none; + display: inline-block; + padding: 0; + margin-right: 10px; +} + +.mec-wrap .mec-simple-checkboxes-search label:not(.selectit) { + font-size: 14px; + font-weight: 600; + line-height: 20px; + color: #313131; + display: inline-block; + margin-bottom: 15px; +} + +.mec-wrap .mec-simple-checkboxes-search ul { + list-style: none; + padding: 0; +} + +.mec-wrap .mec-simple-checkboxes-search ul li label { + line-height: 20px; + margin-bottom: 15px; +} + +.mec-load-more-wrap.mec-load-more-scroll-loading { + width: 100%; + height: 100%; + background: no-repeat rgba(255, 255, 255, 0.88) url("../img/ajax-loader.gif") + bottom; + border-style: none; + position: absolute; + left: 0; + right: 0; + bottom: 0; + top: 0; + z-index: 9; +} + +.mec-nextprev-wrap { + margin-top: 30px; + overflow: hidden; + clear: both; +} + +.mec-nextprev-next-button, +.mec-nextprev-prev-button { + margin-right: 0; +} + +.mec-nextprev-next-button { + float: right; + clear: both; +} + +a.mec-nextprev-next-button { + text-decoration: none !important; +} + +a.mec-nextprev-next-button:hover { + color: var(--mec-color-skin); +} + +.mec-nextprev-prev-button svg { + transform: rotate(180deg); +} + +.mec-loading-events:after { + content: ""; + background: rgba(255, 255, 255, 0.88) url("../img/ajax-loader.gif") no-repeat + center calc(100% - 100px); + position: absolute; + top: 0; + right: 0; + left: 0; + bottom: 0; + margin: 0 -10px; +} + +.mec-credit-url { + font-size: 11px; + text-align: center; + color: #919293; +} + +.mec-credit-url a { + text-decoration: none; + color: #919293; +} + +body[class*="mec-theme"] .mec-wrap a { + text-decoration: auto; +} + +.mec-ticket-name-description-wrapper h4 { + margin: 0 0 5px 0; +} + +.mec-ticket-name-description-wrapper h4 .mec-ticket-attendee-counter, +.mec-ticket-name-description-wrapper h4 .mec-ticket-name { + font-size: 16px; + font-weight: 500; +} + +.gm-style img { + max-width: unset !important; +} + +.gm-style .gm-style-mtc button { + border-radius: 0 !important; +} + +/* FAQ Styles */ + +.mec-faq-list { + list-style: none; + padding: 0; +} + +.mec-faq-list .mec-faq-item { + border-bottom: 1px solid #d4d4d4; + position: relative; +} + +.mec-faq-list .mec-faq-item .mec-faq-toggle-icon { + font-size: 12px; + position: absolute; + right: 15px; + top: 32px; + z-index: 1; + cursor: pointer; + transition: 0.3s; +} + +.mec-faq-list .mec-faq-item.close .mec-faq-toggle-icon { + transform: rotate(180deg); +} + +.mec-faq-list .mec-faq-item .mec-faq-title { + padding: 25px 15px; +} + +.mec-faq-list .mec-faq-item .mec-faq-title h4 { + font-size: 19px; + font-weight: 700; + margin: 0; + position: relative; + white-space: nowrap; +} + +.mec-faq-list .mec-faq-item .mec-faq-title h4:after { + content: ""; + position: absolute; + top: 0; + right: 0; + width: 30%; + height: 100%; + background: rgb(0, 0, 0); + background: linear-gradient( + 90deg, + rgba(0, 0, 0, 0) 0%, + rgba(255, 255, 255, 1) 95%, + rgba(255, 255, 255, 1) 100% + ); + pointer-events: none; +} + +.mec-faq-list .mec-faq-item .mec-faq-content { + padding: 0 15px 5px; + max-height: 500px; + overflow: hidden; + -webkit-transition: max-height 0.5s linear; + -moz-transition: max-height 0.5s linear; + -ms-transition: max-height 0.5s linear; + -o-transition: max-height 0.5s linear; + transition: max-height 0.5s linear; +} + +.mec-faq-list .mec-faq-item.close .mec-faq-content { + max-height: 0; + overflow: hidden; +} + +.mec-faq-list .mec-faq-item .mec-faq-content p { + color: #6d8193; + font-size: 14px; + font-weight: 400; + line-height: 1.7em; + letter-spacing: 0.2px; +} + +/* FAQ Styles End */ + +/* Trailer Styles */ + +.mec-trailer iframe { + width: 100%; +} + +/* Trailer Styles End */ + +/* Banner Styles */ + +.single-mec-events { + overflow-x: hidden; +} + +.mec-event-banner { + width: calc(100vw - 17px); + position: relative; + margin-left: calc(-50vw - 10px); + left: calc(50% + 18px); + min-height: 420px; + padding: 80px 0; + text-align: center; + margin-bottom: 30px; +} + +.mec-event-banner-inner { + max-width: 900px; + margin: 0 auto; + min-height: 260px; + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + position: relative; + z-index: 1; +} + +.mec-event-banner-title .mec-single-title { + font-size: 46px; + font-weight: 700; + line-height: 1.1; + color: #fff; +} + +.mec-event-banner-datetime { + display: flex; + justify-content: center; + gap: 20px; + margin-bottom: 20px; +} + +.mec-event-banner-datetime .mec-single-event-date, +.mec-event-banner-datetime .mec-single-event-time, +.mec-event-banner-location .mec-single-event-location { + display: flex; + align-items: baseline; + margin: 0; + padding: 0; + color: #fff; +} + +.mec-event-banner-location .mec-single-event-location { + justify-content: center; + align-items: center; + gap: 16px; +} + +.mec-event-banner-location > i { + display: none; +} + +.mec-event-banner-location img { + max-width: 90px; + margin: 0; +} + +.mec-event-banner-location .mec-single-event-location dl { + display: flex; + align-items: baseline; + gap: 7px; + flex-direction: row; +} + +.mec-event-banner-location .mec-single-event-location img + dl { + flex-direction: column; +} + +.mec-event-banner-location .mec-single-event-location dl dd { + display: flex; + align-items: baseline; + gap: 5px; +} + +.mec-event-banner-location .mec-single-event-location dl dd * { + color: #fff; +} + +.mec-event-banner-location + .mec-single-event-location + dl + dd + address.mec-events-address { + font-size: 16px; + line-height: 1.5; +} + +.mec-event-banner-datetime .mec-single-event-date h3.mec-date, +.mec-event-banner-datetime .mec-single-event-time h3.mec-time, +.mec-event-banner-location .mec-single-event-location .mec-location { + display: none; +} + +.mec-event-banner-datetime .mec-single-event-date i, +.mec-event-banner-datetime .mec-single-event-time i { + margin-right: 5px; +} + +.mec-event-banner-datetime .mec-single-event-date dl dd, +.mec-event-banner-datetime .mec-single-event-time dl dd, +.mec-event-banner-location .mec-single-event-location dl dd { + margin: 0; +} + +.mec-event-banner-datetime .mec-single-event-time .mec-time-comment { + position: absolute; + top: 15px; + left: 20px; +} + +.mec-event-banner-datetime .mec-single-event-date { + position: static; +} + +.mec-event-banner-datetime .mec-single-event-date .mec-holding-status { + position: absolute; + bottom: 0; + color: #fff; + width: 100px; + padding: 0 5px; + border: 1px solid #fff; + border-radius: 5px; + left: calc(50% - 50px); +} + +.mec-event-banner-color { + width: calc(100vw - 17px); + height: 100%; + position: absolute; + top: 0; + z-index: 0; +} + +@media only screen and (max-width: 768px) { + .mec-event-banner { + width: 100vw; + position: relative; + margin-left: -50vw; + left: 50%; + } + + .mec-event-banner-color { + width: 100vw; + } + + .mec-event-banner-inner { + min-height: 400px; + max-width: 90%; + } + + .mec-event-banner-title .mec-single-title { + font-size: 36px; + } + + .mec-event-banner-datetime { + flex-direction: column; + align-items: center; + } + + .mec-event-banner-location .mec-single-event-location { + flex-direction: column; + align-items: center; + } + + .mec-event-banner-location .mec-single-event-location dl { + flex-direction: column; + align-items: center; + } +} + +/* Banner Styles End*/ + +/* Fix Twitter icon style */ +.mec-wrap li.mec-event-social-icon a > svg { + width: 36px; + height: 36px; + border-radius: 50%; + padding: 7px; + fill: #767676; + margin-right: 3px; +} + +.mec-wrap .mec-event-list-standard li.mec-event-social-icon a.twitter svg, +.mec-wrap .mec-event-grid-classic li.mec-event-social-icon a.twitter svg, +.mec-wrap .mec-event-grid-modern li.mec-event-social-icon a.twitter svg, +.mec-wrap .mec-event-grid-clean li.mec-event-social-icon a.twitter svg { + margin: 0; + padding: 0; + height: 36px; + width: 16px; + margin-bottom: -7px; +} + +.mec-event-list-modern .mec-event-sharing > li a { + display: flex; + align-items: center; +} + +.mec-event-list-modern .mec-event-sharing > li a svg { + border: 1px solid #ddd; +} + +.mec-event-list-modern .mec-event-sharing { + display: flex; + align-items: center; + flex-wrap: wrap; +} + +/* Add to calendar Styles*/ + +.mec-subscribe-to-calendar-container { + display: flex; + flex-direction: column; + align-items: end; +} + +.mec-wrap button.mec-subscribe-to-calendar-btn { + margin-bottom: 10px !important; + margin-right: 0 !important; + width: 180px; +} + +.mec-subscribe-to-calendar-items { + width: 180px; + padding: 5px 20px; + background: #fff; + border: 1px solid #e6e7e8; + border-radius: 3px; +} + +.mec-subscribe-to-calendar-items a { + font-size: 14px; + color: #8d8d8d; + display: block; + margin: 10px 0; + transition: 0.2s; +} + +.mec-subscribe-to-calendar-items a:hover { + color: var(--mec-color-skin); +} + +/* Add to calendar Styles End*/ + +/* Ticket Variations Shortcode */ + +.mec-booking-ticket-variations ul { + list-style: none; + padding: 0; +} + +.mec-booking-ticket-variations ul li { + margin-bottom: 20px; +} + +.mec-booking-ticket-variations ul li h5 { + font-size: 16px; + margin: 0; +} + +.mec-booking-ticket-variations ul li p { + margin: 0; +} + +/* Ticket Variations Shortcode End*/ + +/* RTL General Calendar */ +.rtl .mec-gCalendar #mec-gCalendar-wrap .fc-header-toolbar.fc-toolbar { + flex-direction: row; +} + +.rtl .mec-gCalendar #mec-gCalendar-wrap h2.fc-toolbar-title { + margin-right: 0; + margin-left: 20px; +} + +.rtl .mec-gCalendar button.fc-prevYear-button.fc-button.fc-button-primary { + border-right: 1px solid #e3e4e5; + border-left: none; + border-radius: 0 7px 7px 0; +} + +.rtl .mec-gCalendar button.fc-nextYear-button.fc-button.fc-button-primary { + border-left: 1px solid #e3e4e5; + border-right: none; + border-radius: 7px 0 0 7px; +} + +.rtl .mec-gCalendar-search-text-wrap { + border-left: none; + border-right: 1px solid #e3e4e5; + padding-left: 0; + padding-right: 16px; +} + +.rtl .mec-gCalendar button.fc-filterEvents-button.fc-button.fc-button-primary { + text-align: left; + padding-right: 32px; + padding-left: 13px; +} + +.rtl + .mec-gCalendar + button.fc-filterEvents-button.fc-button.fc-button-primary + svg { + left: unset; + right: 10px; +} + +.rtl .mec-gCalendar button.fc-findEvents-button.fc-button.fc-button-primary, +.rtl + .mec-gCalendar + button.fc-findEvents-button.fc-button.fc-button-primary:active, +.rtl .mec-gCalendar button.fc-filterEvents-button.fc-button.fc-button-primary { + margin-left: 0 !important; + margin-right: 20px !important; +} + +.rtl .mec-gCalendar-filters { + right: unset; + left: calc(50% - 119px); +} + +.rtl .mec-gCalendar-filters:before, +.rtl #MonthPicker_mec-gCalendar-month-filter:before, +.rtl .mec-gCalendar-filters:after, +.rtl #MonthPicker_mec-gCalendar-month-filter:after { + left: unset; + right: 50%; + margin-left: unset; + margin-right: 77px; +} + +.rtl .mec-gCalendar-filters-wrap .mec-dropdown-search i, +.rtl .mec-gCalendar-filters-wrap .mec-minmax-event-cost i, +.rtl .mec-gCalendar-filters-wrap .mec-checkboxes-search i, +.rtl .mec-gCalendar-filters-wrap .mec-text-address-search i { + border-right: 1px solid #e3e4e5; + border-left: 0; + border-radius: 0 3px 3px 0; +} + +.rtl .mec-gCalendar-filters-wrap .mec-minmax-event-cost input:last-child, +.rtl .mec-gCalendar-filters-wrap .mec-text-address-search input:focus, +.rtl .mec-gCalendar-filters-wrap .mec-text-address-search input { + border-left: 1px solid #e3e4e5; + border-radius: 3px 0 0 3px; + border-right: 1px solid #e3e4e5; +} + +.rtl .nice-select { + padding-left: 30px; + padding-right: 18px; + text-align: right !important; + border-radius: 3px 0 0 3px; +} + +.rtl .nice-select:after { + right: unset; + left: 15px; +} + +.rtl #mec-gCalendar-wrap table.fc-scrollgrid tr th { + text-align: right; + padding: 20px 10px 3px 0; +} + +.rtl #mec-gCalendar-wrap table.fc-scrollgrid-sync-table tr td { + text-align: right; +} + +.rtl .mec-gCalendar table.fc-scrollgrid-sync-table tbody td { + border-left: 1px solid #eee; + border-right: none; +} + +.rtl .mec-gCalendar-tooltip-date-text i, +.rtl .mec-gCalendar-tooltip-date-time i { + margin-right: 0; + margin-left: 8px; +} + +.rtl + .mec-month-picker.datepicker + table + thead:first-child + tr:first-child + th.prev:before { + content: "\e606"; +} + +.rtl + .mec-month-picker.datepicker + table + thead:first-child + tr:first-child + th.next:before { + content: "\e605"; +} + +/* --------------------- */ + +/* Dynamic CSS Start */ + +/* == Custom Fonts For H Tag +---------------- */ +.mec-hourly-schedule-speaker-name, +.mec-events-meta-group-countdown .countdown-w span, +.mec-single-event .mec-event-meta dt, +.mec-hourly-schedule-speaker-job-title, +.post-type-archive-mec-events h1, +.mec-ticket-available-spots .mec-event-ticket-name, +.tax-mec_category h1, +.mec-wrap h1, +.mec-wrap h2, +.mec-wrap h3, +.mec-wrap h4, +.mec-wrap h5, +.mec-wrap h6, +.entry-content .mec-wrap h1, +.entry-content .mec-wrap h2, +.entry-content .mec-wrap h3, +.entry-content .mec-wrap h4, +.entry-content .mec-wrap h5, +.entry-content .mec-wrap h6 { + font-family: var(--mec-heading-font-family), Helvetica, Arial, sans-serif; +} + +/* == Custom Fonts For P Tag +---------------- */ +.mec-single-event .mec-event-meta .mec-events-event-cost, +.mec-event-data-fields .mec-event-data-field-item .mec-event-data-field-value, +.mec-event-data-fields .mec-event-data-field-item .mec-event-data-field-name, +.mec-wrap .info-msg div, +.mec-wrap .mec-error div, +.mec-wrap .mec-success div, +.mec-wrap .warning-msg div, +.mec-breadcrumbs .mec-current, +.mec-events-meta-group-tags, +.lity-content .mec-events-meta-group-booking .mec-event-ticket-available, +.mec-single-event .mec-events-meta-group-booking .mec-event-ticket-available, +.mec-single-modern .mec-single-event-bar > div dd, +.mec-single-event .mec-event-meta dd, +.mec-single-event .mec-event-meta dd a, +.mec-next-occ-booking span, +.mec-hourly-schedule-speaker-description, +.mec-single-event .mec-speakers-details ul li .mec-speaker-job-title, +.mec-single-event .mec-speakers-details ul li .mec-speaker-name, +.mec-event-data-field-items, +.mec-load-more-button, +.mec-events-meta-group-tags a, +.mec-events-button, +.mec-wrap abbr, +.mec-event-schedule-content dl dt, +.mec-breadcrumbs a, +.mec-breadcrumbs span .mec-event-content p, +.mec-wrap p { + font-family: var(--mec-paragraph-font-family), sans-serif; + font-weight: 300; +} + +/* == TextColors +---------------- */ +.mec-event-grid-minimal .mec-modal-booking-button:hover, +.mec-events-timeline-wrap .mec-organizer-item a, +.mec-events-timeline-wrap .mec-organizer-item:after, +.mec-events-timeline-wrap .mec-shortcode-organizers i, +.mec-timeline-event .mec-modal-booking-button, +.mec-wrap .mec-map-lightbox-wp.mec-event-list-classic .mec-event-date, +.mec-timetable-t2-col .mec-modal-booking-button:hover, +.mec-event-container-classic .mec-modal-booking-button:hover, +.mec-calendar-events-side .mec-modal-booking-button:hover, +.mec-event-grid-yearly .mec-modal-booking-button, +.mec-events-agenda .mec-modal-booking-button, +.mec-event-grid-simple .mec-modal-booking-button, +.mec-event-list-minimal .mec-modal-booking-button:hover, +.mec-timeline-month-divider, +.mec-wrap.colorskin-custom .mec-totalcal-box .mec-totalcal-view span:hover, +.mec-wrap.colorskin-custom + .mec-calendar.mec-event-calendar-classic + .mec-selected-day, +.mec-wrap.colorskin-custom .mec-color, +.mec-wrap.colorskin-custom + .mec-event-sharing-wrap + .mec-event-sharing + > li:hover + a, +.mec-wrap.colorskin-custom .mec-color-hover:hover, +.mec-wrap.colorskin-custom .mec-color-before *:before, +.mec-wrap.colorskin-custom + .mec-widget + .mec-event-grid-classic.owl-carousel + .owl-nav + i, +.mec-wrap.colorskin-custom .mec-event-list-classic a.magicmore:hover, +.mec-wrap.colorskin-custom .mec-event-grid-simple .mec-event-title:hover, +.mec-wrap.colorskin-custom + .mec-single-event + .mec-event-meta + dd.mec-events-event-categories:before, +.mec-wrap.colorskin-custom .mec-single-event-date:before, +.mec-wrap.colorskin-custom .mec-single-event-time:before, +.mec-wrap.colorskin-custom + .mec-events-meta-group.mec-events-meta-group-venue:before, +.mec-wrap.colorskin-custom + .mec-calendar + .mec-calendar-side + .mec-previous-month + i, +.mec-wrap.colorskin-custom + .mec-calendar + .mec-calendar-side + .mec-next-month:hover, +.mec-wrap.colorskin-custom + .mec-calendar + .mec-calendar-side + .mec-previous-month:hover, +.mec-wrap.colorskin-custom + .mec-calendar + .mec-calendar-side + .mec-next-month:hover, +.mec-wrap.colorskin-custom + .mec-calendar.mec-event-calendar-classic + dt.mec-selected-day:hover, +.mec-wrap.colorskin-custom .mec-infowindow-wp h5 a:hover, +.colorskin-custom .mec-events-meta-group-countdown .mec-end-counts h3, +.mec-calendar .mec-calendar-side .mec-next-month i, +.mec-wrap .mec-totalcal-box i, +.mec-calendar .mec-event-article .mec-event-title a:hover, +.mec-attendees-list-details .mec-attendee-profile-link a:hover, +.mec-wrap.colorskin-custom .mec-next-event-details li i, +.mec-next-event-details i:before, +.mec-marker-infowindow-wp .mec-marker-infowindow-count, +.mec-next-event-details a, +.mec-wrap.colorskin-custom .mec-events-masonry-cats a.mec-masonry-cat-selected, +.lity .mec-color, +.lity .mec-color-before :before, +.lity .mec-color-hover:hover, +.lity .mec-wrap .mec-color, +.lity .mec-wrap .mec-color-before :before, +.lity .mec-wrap .mec-color-hover:hover, +.leaflet-popup-content .mec-color, +.leaflet-popup-content .mec-color-before :before, +.leaflet-popup-content .mec-color-hover:hover, +.leaflet-popup-content .mec-wrap .mec-color, +.leaflet-popup-content .mec-wrap .mec-color-before :before, +.leaflet-popup-content .mec-wrap .mec-color-hover:hover, +.mec-calendar.mec-calendar-daily + .mec-calendar-d-table + .mec-daily-view-day.mec-daily-view-day-active.mec-color, +.mec-map-boxshow div .mec-map-view-event-detail.mec-event-detail i, +.mec-map-boxshow div .mec-map-view-event-detail.mec-event-detail:hover, +.mec-map-boxshow .mec-color, +.mec-map-boxshow .mec-color-before :before, +.mec-map-boxshow .mec-color-hover:hover, +.mec-map-boxshow .mec-wrap .mec-color, +.mec-map-boxshow .mec-wrap .mec-color-before :before, +.mec-map-boxshow .mec-wrap .mec-color-hover:hover, +.mec-choosen-time-message, +.mec-booking-calendar-month-navigation .mec-next-month:hover, +.mec-booking-calendar-month-navigation .mec-previous-month:hover, +.mec-yearly-view-wrap .mec-agenda-event-title a:hover, +.mec-yearly-view-wrap .mec-yearly-title-sec .mec-next-year i, +.mec-yearly-view-wrap .mec-yearly-title-sec .mec-previous-year i, +.mec-yearly-view-wrap .mec-yearly-title-sec .mec-next-year:hover, +.mec-yearly-view-wrap .mec-yearly-title-sec .mec-previous-year:hover, +.mec-av-spot .mec-av-spot-head .mec-av-spot-box span, +.mec-wrap.colorskin-custom + .mec-calendar + .mec-calendar-side + .mec-previous-month:hover + .mec-load-month-link, +.mec-wrap.colorskin-custom + .mec-calendar + .mec-calendar-side + .mec-next-month:hover + .mec-load-month-link, +.mec-yearly-view-wrap + .mec-yearly-title-sec + .mec-previous-year:hover + .mec-load-month-link, +.mec-yearly-view-wrap + .mec-yearly-title-sec + .mec-next-year:hover + .mec-load-month-link, +.mec-skin-list-events-container + .mec-data-fields-tooltip + .mec-data-fields-tooltip-box + ul + .mec-event-data-field-item + a, +.mec-wrap.mec-cart table tr td a, +.mec-marker-infowindow-wp .mec-marker-infowindow-count, +.mec-single-event .mec-speakers-details ul li .mec-speaker-name { + color: var(--mec-color-skin); +} + +.mec-event-list-standard .mec-event-meta svg path, +.mec-wrap .mec-event-sharing-wrap .mec-event-sharing > li:hover a svg { + fill: var(--mec-color-skin); +} + +/* == Backgrounds +----------------- */ +.mec-skin-carousel-container + .mec-event-footer-carousel-type3 + .mec-modal-booking-button:hover, +.mec-wrap.colorskin-custom + .mec-event-sharing + .mec-event-share:hover + .event-sharing-icon, +.mec-wrap.colorskin-custom .mec-event-grid-clean .mec-event-date, +.mec-wrap.colorskin-custom + .mec-event-list-modern + .mec-event-sharing + > li:hover + a + i, +.mec-wrap.colorskin-custom + .mec-event-list-modern + .mec-event-sharing + .mec-event-share:hover + .mec-event-sharing-icon, +.mec-wrap.colorskin-custom + .mec-event-list-modern + .mec-event-sharing + li:hover + a + i, +.mec-wrap.colorskin-custom + .mec-calendar:not(.mec-event-calendar-classic) + .mec-selected-day, +.mec-wrap.colorskin-custom .mec-calendar .mec-selected-day:hover, +.mec-wrap.colorskin-custom + .mec-calendar + .mec-calendar-row + dt.mec-has-event:hover, +.mec-wrap.colorskin-custom .mec-calendar .mec-has-event:after, +.mec-wrap.colorskin-custom .mec-bg-color, +.mec-wrap.colorskin-custom .mec-bg-color-hover:hover, +.colorskin-custom .mec-event-sharing-wrap:hover > li, +.mec-wrap.colorskin-custom + .mec-totalcal-box + .mec-totalcal-view + span.mec-totalcalview-selected, +.mec-wrap .flip-clock-wrapper ul li a div div.inn, +.mec-wrap .mec-totalcal-box .mec-totalcal-view span.mec-totalcalview-selected, +.event-carousel-type1-head .mec-event-date-carousel, +.mec-event-countdown-style3 .mec-event-date, +#wrap .mec-wrap article.mec-event-countdown-style1, +.mec-event-countdown-style1 .mec-event-countdown-part3 a.mec-event-button, +.mec-wrap .mec-event-countdown-style2, +.mec-map-get-direction-btn-cnt input[type="submit"], +.mec-booking button, +span.mec-marker-wrap, +.mec-wrap.colorskin-custom + .mec-timeline-events-container + .mec-timeline-event-date:before, +.mec-has-event-for-booking.mec-active .mec-calendar-novel-selected-day, +.mec-booking-tooltip.multiple-time .mec-booking-calendar-date.mec-active, +.mec-booking-tooltip.multiple-time .mec-booking-calendar-date:hover, +.mec-ongoing-normal-label, +.mec-calendar .mec-has-event:after, +.mec-events-progress-bar progress:after, +.mec-events-progress-bar progress::-webkit-progress-value { + background-color: var(--mec-color-skin); +} + +.mec-booking-tooltip.multiple-time .mec-booking-calendar-date:hover, +.mec-calendar-day.mec-active + .mec-booking-tooltip.multiple-time + .mec-booking-calendar-date.mec-active { + background-color: var(--mec-color-skin); +} + +/* == BorderColors +------------------ */ +.mec-skin-carousel-container + .mec-event-footer-carousel-type3 + .mec-modal-booking-button:hover, +.mec-timeline-month-divider, +.mec-wrap.colorskin-custom + .mec-single-event + .mec-speakers-details + ul + li + .mec-speaker-avatar + a:hover + img, +.mec-wrap.colorskin-custom + .mec-event-list-modern + .mec-event-sharing + > li:hover + a + i, +.mec-wrap.colorskin-custom + .mec-event-list-modern + .mec-event-sharing + .mec-event-share:hover + .mec-event-sharing-icon, +.mec-wrap.colorskin-custom + .mec-event-list-standard + .mec-month-divider + span:before, +.mec-wrap.colorskin-custom .mec-single-event .mec-social-single:before, +.mec-wrap.colorskin-custom .mec-single-event .mec-frontbox-title:before, +.mec-wrap.colorskin-custom + .mec-calendar + .mec-calendar-events-side + .mec-table-side-day, +.mec-wrap.colorskin-custom .mec-border-color, +.mec-wrap.colorskin-custom .mec-border-color-hover:hover, +.colorskin-custom .mec-single-event .mec-frontbox-title:before, +.colorskin-custom .mec-single-event .mec-wrap-checkout h4:before, +.colorskin-custom + .mec-single-event + .mec-events-meta-group-booking + form + > h4:before, +.mec-wrap.colorskin-custom + .mec-totalcal-box + .mec-totalcal-view + span.mec-totalcalview-selected, +.mec-wrap .mec-totalcal-box .mec-totalcal-view span.mec-totalcalview-selected, +.event-carousel-type1-head .mec-event-date-carousel:after, +.mec-wrap.colorskin-custom .mec-events-masonry-cats a.mec-masonry-cat-selected, +.mec-marker-infowindow-wp .mec-marker-infowindow-count, +.mec-wrap.colorskin-custom .mec-events-masonry-cats a:hover, +.mec-has-event-for-booking .mec-calendar-novel-selected-day, +.mec-booking-tooltip.multiple-time .mec-booking-calendar-date.mec-active, +.mec-booking-tooltip.multiple-time .mec-booking-calendar-date:hover, +.mec-virtual-event-history h3:before, +.mec-booking-tooltip.multiple-time .mec-booking-calendar-date:hover, +.mec-calendar-day.mec-active + .mec-booking-tooltip.multiple-time + .mec-booking-calendar-date.mec-active, +.mec-rsvp-form-box form > h4:before, +.mec-wrap .mec-box-title::before, +.mec-box-title::before, +.lity-content .mec-booking-progress-bar li.mec-active:after, +.mec-single-event .mec-frontbox-title:before, +.mec-single-event .mec-wrap-checkout h4:before, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-wrap-checkout + h4:before, +.lity-content .mec-events-meta-group-booking form > h4:before, +.mec-single-event .mec-events-meta-group-booking form > h4:before, +.mec-events-meta-group-booking .mec-booking-shortcode form > h4:before, +.lity-content .mec-events-meta-group-booking .mec-wrap-checkout h4:before, +.mec-single-event .mec-events-meta-group-booking .mec-wrap-checkout h4:before, +.mec-events-meta-group-booking + .mec-booking-shortcode + .mec-wrap-checkout + h4:before { + border-color: var(--mec-color-skin); +} + +.mec-wrap.colorskin-custom .mec-event-countdown-style3 .mec-event-date:after, +.mec-wrap.colorskin-custom .mec-month-divider span:before, +.mec-calendar.mec-event-container-simple dl dt.mec-selected-day, +.mec-calendar.mec-event-container-simple dl dt.mec-selected-day:hover { + border-bottom-color: var(--mec-color-skin); +} + +.mec-wrap.colorskin-custom + article.mec-event-countdown-style1 + .mec-event-countdown-part2:after { + border-color: transparent transparent transparent var(--mec-color-skin); +} + +.mec-wrap .button, +.mec-wrap + button:not(.owl-dot):not(.gm-control-active):not(.mejs):not(.owl-prev):not( + .owl-next + ):not(.mec-googlemap-details button):not(.mec-googlemap-skin button), +.mec-wrap input[type="submit"], +.mec-wrap input[type="reset"], +.mec-wrap input[type="button"], +.lity-content .button, +.lity-content + button:not(.owl-dot):not(.gm-control-active):not(.mejs):not(.owl-prev):not( + .owl-next + ):not(.mec-googlemap-details button):not(.mec-googlemap-skin button), +.lity-content input[type="submit"], +.lity-content input[type="reset"], +.lity-content input[type="button"], +.lity-content input[type="submit"], +.mec-nextprev-next-button, +.mec-nextprev-prev-button, +.mec-form-row .mec-book-form-next-button.mec-book-form-pay-button { + color: var(--mec-color-skin); + background: var(--mec-color-skin-rgba-1); + border-color: var(--mec-color-skin-rgba-1); +} + +.mec-wrap .button:hover, +.mec-wrap a.button:hover, +.mec-wrap + button:not(.owl-dot):not(.gm-control-active):not(.mejs):not(.owl-prev):not( + .owl-next + ):not(.mec-googlemap-details button):not(.mec-googlemap-skin button):hover, +.mec-wrap input[type="submit"]:hover, +.mec-wrap input[type="reset"]:hover, +.mec-wrap input[type="button"]:hover, +.lity-content .button:hover, +.lity-content + button:not(.owl-dot):not(.gm-control-active):not(.mejs):not(.owl-prev):not( + .owl-next + ):not(.mec-googlemap-details button):not(.mec-googlemap-skin button):hover, +.lity-content input[type="submit"]:hover, +.lity-content input[type="reset"]:hover, +.lity-content input[type="button"]:hover, +.lity-content input[type="submit"]:hover, +.mec-nextprev-next-button:hover, +.mec-nextprev-prev-button:hover { + border-color: var(--mec-color-skin); +} + +.mec-single-event + .mec-events-meta-group-booking + input[type="radio"]:checked:before, +.mec-events-meta-group-booking + .mec-booking-shortcode + input[type="radio"]:checked:before, +.lity-container + .mec-events-meta-group-booking + input[type="radio"]:checked:before { + background: var(--mec-color-skin); + box-shadow: 0 0 0 2px var(--mec-color-skin-rgba-1); +} + +.mec-wrap .button svg path, +.mec-wrap + button:not(.owl-dot):not(.gm-control-active):not(.mejs):not(.owl-prev):not( + .owl-next + ) + svg + path, +.mec-wrap input[type="submit"] svg path, +.mec-wrap input[type="reset"] svg path, +.mec-wrap input[type="button"] svg path, +.lity-content .button svg path, +.lity-content + button:not(.owl-dot):not(.gm-control-active):not(.mejs):not(.owl-prev):not( + .owl-next + ) + svg + path, +.lity-content input[type="submit"] svg path, +.lity-content input[type="reset"] svg path, +.lity-content input[type="button"] svg path, +.mec-nextprev-next-button svg path, +.mec-nextprev-prev-button svg path { + fill: var(--mec-color-skin); +} + +.mec-wrap .button svg.back path, +.mec-wrap + button:not(.owl-dot):not(.gm-control-active):not(.mejs):not(.owl-prev):not( + .owl-next + ):not(.et-fb-button) + svg.back + path { + fill: #636f72; +} + +.mec-booking-calendar-month-navigation .mec-previous-month:hover a, +.mec-booking-calendar-month-navigation .mec-next-month:hover a { + color: var(--mec-color-skin); +} + +/* == BoxShadow +------------------ */ +.mec-wrap.colorskin-custom .mec-box-shadow-color { + box-shadow: 0 4px 22px -7px var(--mec-color-skin); +} + +/* == Timeline View +------------------ */ +.mec-timeline-event .mec-modal-booking-button, +.mec-events-timeline-wrap:before, +.mec-wrap.colorskin-custom .mec-timeline-event-local-time, +.mec-wrap.colorskin-custom .mec-timeline-event-time, +.mec-wrap.colorskin-custom .mec-timeline-event-location, +.mec-wrap.colorskin-custom .mec-timeline-event-organizer, +.mec-wrap.colorskin-custom .mec-timeline-event-categories, +.mec-choosen-time-message { + background: var(--mec-color-skin-rgba-4); +} + +/* == Render Container Normal Width +------------------ */ +@media only screen and (min-width: 1200px) { + .mec-container, + body [id*="mec_skin_"].mec-fluent-wrap { + width: var(--mec-container-normal-width); + max-width: var(--mec-container-normal-width); + } +} + +/* == Render Container Large Width +------------------ */ +@media only screen and (min-width: 1921px) { + .mec-container, + body [id*="mec_skin_"].mec-fluent-wrap { + width: var(--mec-container-large-width); + max-width: var(--mec-container-large-width); + } +} + +/* == Advanced Color Options (shortcodes) +------------------ */ +.mec-wrap h1 a, +.mec-wrap h2 a, +.mec-wrap h3 a, +.mec-wrap h4 a, +.mec-wrap h5 a, +.mec-wrap h6 a, +.entry-content .mec-wrap h1 a, +.entry-content .mec-wrap h2 a, +.entry-content .mec-wrap h3 a, +.entry-content .mec-wrap h4 a, +.entry-content .mec-wrap h5 a, +.entry-content .mec-wrap h6 a, +.mec-wrap .mec-calendar .mec-event-article .mec-event-title a, +.mec-wrap .mec-event-grid-simple .mec-event-title a, +.mec-wrap .mec-event-grid-modern .mec-event-title a, +.mec-wrap .mec-event-grid-minimal .mec-event-title a, +.mec-wrap .mec-event-grid-clean .mec-event-title a, +.mec-wrap .mec-event-grid-classic .mec-event-title a, +.mec-wrap .mec-event-list-standard .mec-event-title a, +.mec-wrap .mec-wrap .mec-event-list-modern .mec-event-title a, +.mec-wrap .mec-event-list-minimal .mec-event-title a, +.mec-wrap .mec-event-list-classic .mec-event-title a { + color: var(--mec-title-color); +} + +.mec-wrap.colorskin-custom h1 a:hover, +.mec-wrap.colorskin-custom h2 a:hover, +.mec-wrap.colorskin-custom h3 a:hover, +.mec-wrap.colorskin-custom h4 a:hover, +.mec-wrap.colorskin-custom h5 a:hover, +.mec-wrap.colorskin-custom h6 a:hover, +.entry-content .mec-wrap.colorskin-custom h1 a:hover, +.entry-content .mec-wrap.colorskin-custom h2 a:hover, +.entry-content .mec-wrap.colorskin-custom h3 a:hover, +.entry-content .mec-wrap.colorskin-custom h4 a:hover, +.entry-content .mec-wrap.colorskin-custom h5 a:hover, +.entry-content .mec-wrap.colorskin-custom h6 a:hover, +.mec-wrap .mec-calendar .mec-event-article .mec-event-title a:hover, +.mec-wrap .mec-event-grid-simple .mec-event-title a:hover, +.mec-wrap .mec-event-grid-modern .mec-event-title a:hover, +.mec-wrap .mec-event-grid-minimal .mec-event-title a:hover, +.mec-wrap .mec-event-grid-clean .mec-event-title a:hover, +.mec-wrap .mec-event-grid-classic .mec-event-title a:hover, +.mec-wrap .mec-event-list-standard .mec-event-title a:hover, +.mec-wrap .mec-wrap .mec-event-list-modern .mec-event-title a:hover, +.mec-wrap .mec-event-list-minimal .mec-event-title a:hover, +.mec-wrap .mec-event-list-classic .mec-event-title a:hover { + color: var(--mec-title-color-hover); +} + +.mec-wrap.colorskin-custom .mec-event-description { + color: var(--mec-content-color); +} + +/* == FES Main Color +------------------ */ +.mec-fes-form #mec_bfixed_form_field_types .button:before, +.mec-fes-form #mec_reg_form_field_types .button:before, +.mec-fes-form #mec_bfixed_form_field_types .button, +.mec-fes-form #mec_reg_form_field_types .button, +.mec-fes-form + #mec_meta_box_tickets_form + [id^="mec_ticket_row"] + .mec_add_price_date_button, +.mec-fes-form .mec-meta-box-fields h4, +.mec-fes-form .mec-meta-box-fields h4 label, +.mec-fes-form .html-active .switch-html, +.mec-fes-form .tmce-active .switch-tmce, +.mec-fes-form .wp-editor-tabs .wp-switch-editor:active, +.mec-fes-form .mec-form-row .button:not(.wp-color-result), +.mec-fes-form .mec-title span.mec-dashicons, +.mec-fes-form .mec-form-row .quicktags-toolbar input.button.button-small, +.mec-fes-list ul li a:hover, +.mec-fes-form input[type="file"], +.mec-fes-form + .mec-attendees-wrapper + .mec-attendees-list + .mec-booking-attendees-tooltip:before { + color: var(--mec-fes-main-color); +} + +.mec-fes-form #mec_reg_form_field_types .button.red:hover, +.mec-fes-form #mec_reg_form_field_types .button:hover, +.mec-fes-list ul li .mec-fes-event-export a:hover, +.mec-fes-list ul li .mec-fes-event-view a:hover, +.mec-fes-list ul li .mec-fes-event-edit a:hover, +.mec-fes-form button[type="submit"].mec-fes-sub-button, +.mec-fes-form .mec-form-row .button:not(.wp-color-result):hover, +.mec-fes-form .mec-form-row .quicktags-toolbar input.button.button-small:hover { + background: var(--mec-fes-main-color); + color: #fff; +} + +.mec-fes-form #mec_reg_form_field_types .button.red:hover, +.mec-fes-form #mec_bfixed_form_fields input[type="checkbox"]:hover, +.mec-fes-form #mec_bfixed_form_fields input[type="radio"]:hover, +.mec-fes-form #mec_reg_form_fields input[type="checkbox"]:hover, +.mec-fes-form #mec_reg_form_fields input[type="radio"]:hover, +.mec-fes-form input[type="checkbox"]:hover, +.mec-fes-form input[type="radio"]:hover, +.mec-fes-form #mec_reg_form_field_types .button:hover, +.mec-fes-form .mec-form-row .button:not(.wp-color-result):hover, +.mec-fes-list ul li .mec-fes-event-export a:hover, +.mec-fes-list ul li .mec-fes-event-view a:hover, +.mec-fes-list ul li .mec-fes-event-edit a:hover, +.mec-fes-form input[type="file"], +.mec-fes-form + .mec-attendees-wrapper + .mec-attendees-list + .w-clearfix:first-child { + border-color: var(--mec-fes-main-color); +} + +.mec-fes-form button[type="submit"].mec-fes-sub-button { + box-shadow: 0 2px 8px -4px var(--mec-fes-main-color); +} + +.mec-fes-form button[type="submit"].mec-fes-sub-button:hover { + box-shadow: 0 2px 12px -2px var(--mec-fes-main-color); +} + +.mec-fes-form #mec_bfixed_form_fields input[type="checkbox"]:checked, +.mec-fes-form #mec_bfixed_form_fields input[type="radio"]:checked, +.mec-fes-form #mec_reg_form_fields input[type="checkbox"]:checked, +.mec-fes-form #mec_reg_form_fields input[type="radio"]:checked, +.mec-fes-form .mec-form-row input[type="checkbox"]:checked, +.mec-fes-form .mec-form-row input[type="radio"]:checked { + box-shadow: 0 1px 6px -2px var(--mec-fes-main-color) inset 0 0 0 3px #fff; + border-color: var(--mec-fes-main-color); + background: var(--mec-fes-main-color); +} + +.mec-fes-form .mec-available-color-row span.color-selected { + box-shadow: 0 0 0 2px var(--mec-fes-main-color), + 0 2px 8px -1px var(--mec-fes-main-color); +} + +.mec-fes-form + #mec_meta_box_tickets_form + [id^="mec_ticket_row"] + .mec_add_price_date_button, +.mec-fes-form .mce-tinymce.mce-container.mce-panel, +.mec-fes-form .mec-form-row .button:not(.wp-color-result):hover { + box-shadow: 0 2px 6px -3px var(--mec-fes-main-color); +} + +.mec-fes-form, +.mec-fes-list, +.mec-fes-form .html-active .switch-html, +.mec-fes-form .tmce-active .switch-tmce, +.mec-fes-form .wp-editor-tabs .wp-switch-editor:active, +.mec-fes-form .mec-attendees-wrapper .mec-attendees-list .w-clearfix { + background: var(--mec-fes-main-color-rgba-1); +} + +.mec-fes-form .mec-meta-box-fields h4, +.mec-fes-form .quicktags-toolbar, +.mec-fes-form div.mce-toolbar-grp { + background: var(--mec-fes-main-color-rgba-2); +} + +.mec-fes-form ul#mec_bfixed_form_fields li, +.mec-fes-form ul#mec_reg_form_fields li, +.mec-fes-form ul#mec_bfixed_form_fields li, +.mec-fes-form ul#mec_reg_form_fields li { + background: var(--mec-fes-main-color-rgba-3); +} + +.mec-fes-form .mce-toolbar .mce-btn-group .mce-btn.mce-listbox, +.mec-fes-form ul#mec_bfixed_form_fields li, +.mec-fes-form ul#mec_reg_form_fields li, +.mec-fes-form ul#mec_bfixed_form_fields li, +.mec-fes-form ul#mec_reg_form_fields li, +.mec-fes-form #mec_bfixed_form_fields input[type="checkbox"], +.mec-fes-form #mec_bfixed_form_fields input[type="radio"], +.mec-fes-form #mec_reg_form_fields input[type="checkbox"], +.mec-fes-form #mec_reg_form_fields input[type="radio"], +.mec-fes-form input[type="checkbox"], +.mec-fes-form input[type="radio"], +.mec-fes-form #mec-event-data input[type="date"], +.mec-fes-form input[type="email"], +.mec-fes-form input[type="number"], +.mec-fes-form input[type="password"], +.mec-fes-form input[type="tel"], +.mec-fes-form input[type="text"], +.mec-fes-form input[type="url"], +.mec-fes-form select, +.mec-fes-form textarea, +.mec-fes-list ul li, +.mec-fes-form .quicktags-toolbar, +.mec-fes-form div.mce-toolbar-grp, +.mec-fes-form .mce-tinymce.mce-container.mce-panel, +.mec-fes-form + #mec_meta_box_tickets_form + [id^="mec_ticket_row"] + .mec_add_price_date_button, +.mec-fes-form #mec_bfixed_form_field_types .button, +.mec-fes-form #mec_reg_form_field_types .button, +.mec-fes-form .mec-meta-box-fields, +.mec-fes-form .wp-editor-tabs .wp-switch-editor, +.mec-fes-form .mec-form-row .button:not(.wp-color-result) { + border-color: var(--mec-fes-main-color-rgba-4); +} + +.mec-fes-form #mec-event-data input[type="date"], +.mec-fes-form input[type="email"], +.mec-fes-form input[type="number"], +.mec-fes-form input[type="password"], +.mec-fes-form input[type="tel"], +.mec-fes-form input[type="text"], +.mec-fes-form input[type="url"], +.mec-fes-form select, +.mec-fes-form textarea { + box-shadow: 0 2px 5px var(--mec-fes-main-color-rgba-5) inset; +} + +.mec-fes-list ul li, +.mec-fes-form .mec-form-row .button:not(.wp-color-result) { + box-shadow: 0 2px 6px -4px var(--mec-fes-main-color-rgba-6); +} + +.mec-fes-form #mec_bfixed_form_field_types .button, +.mec-fes-form #mec_reg_form_field_types .button, +.mec-fes-form .mec-meta-box-fields { + box-shadow: 0 2px 6px -3px var(--mec-fes-main-color-rgba-6); +} + +.mec-fes-form .quicktags-toolbar, +.mec-fes-form div.mce-toolbar-grp { + box-shadow: 0 1px 0 1px var(--mec-fes-main-color-rgba-6); +} + +.mec-fes-form #mec_bfixed_form_fields input[type="checkbox"], +.mec-fes-form #mec_bfixed_form_fields input[type="radio"], +.mec-fes-form #mec_reg_form_fields input[type="checkbox"], +.mec-fes-form #mec_reg_form_fields input[type="radio"], +.mec-fes-form input[type="checkbox"], +.mec-fes-form input[type="radio"] { + box-shadow: 0 1px 3px -1px var(--mec-fes-main-color-rgba-6); +} + +/* == Fluent Colors +------------------ */ + +/* MAIN COLOR */ +.mec-fluent-wrap .mec-more-events-icon, +.mec-single-fluent-wrap .mec-next-event-details a, +.mec-fluent-wrap.colorskin-custom .mec-color-before *:before, +.mec-single-fluent-wrap .mec-marker-infowindow-wp .mec-marker-infowindow-count, +.mec-single-fluent-wrap .mec-single-event-organizer dd i, +.mec-single-fluent-wrap .mec-single-event-additional-organizers dd i, +.mec-single-fluent-wrap .mec-next-event-details i:before, +.mec-single-fluent-wrap .mec-next-event-details i:before, +.mec-single-fluent-wrap .mec-single-event-location i, +.mec-single-fluent-wrap + .mec-single-event-organizer + dd.mec-organizer-description:before, +.mec-single-fluent-wrap + .mec-single-event-additional-organizers + dd.mec-organizer-description:before, +.mec-single-fluent-wrap + .mec-event-schedule-content + dl + dt.mec-schedule-time:before, +.mec-single-fluent-wrap + .mec-event-schedule-content + dl + dt.mec-schedule-time:before, +.mec-single-fluent-wrap .mec-single-event-bar > div i, +.mec-single-fluent-wrap .mec-single-event-category a, +.mec-fluent-wrap + .mec-daily-view-events-left-side + .mec-daily-view-events-item + > span.mec-time, +.mec-fluent-wrap + .mec-daily-view-events-left-side + .mec-daily-view-events-item + > span.mec-time-end, +.mec-fluent-wrap + .mec-calendar.mec-calendar-daily + .mec-calendar-d-table.mec-date-labels-container + span, +.mec-fluent-wrap .mec-calendar .mec-week-events-container dl > span, +.mec-fluent-current-time-text, +.mec-fluent-wrap.mec-timetable-wrap .mec-cell .mec-time, +.mec-fluent-wrap.mec-skin-masonry-container .mec-events-masonry-cats a:hover, +.mec-fluent-wrap.mec-skin-masonry-container + .mec-events-masonry-cats + a.mec-masonry-cat-selected, +.mec-fluent-wrap .mec-date-details i:before, +.mec-fluent-wrap .mec-event-location i:before, +.mec-fluent-wrap .mec-event-carousel-type2 .owl-next i, +.mec-fluent-wrap .mec-event-carousel-type2 .owl-prev i, +.mec-fluent-wrap .mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-next i, +.mec-fluent-wrap .mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-prev i, +.mec-fluent-wrap .mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-next, +.mec-fluent-wrap .mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-prev, +.mec-fluent-wrap .mec-date-wrap i, +.mec-fluent-wrap + .mec-calendar.mec-yearly-calendar + .mec-calendar-table-head + dl + dt:first-letter, +.mec-fluent-wrap .mec-event-sharing-wrap .mec-event-sharing li:hover a, +.mec-fluent-wrap .mec-agenda-event > i, +.mec-fluent-wrap .mec-totalcal-box .nice-select:after, +.mec-fluent-wrap .mec-totalcal-box .mec-totalcal-view span, +.mec-fluent-wrap .mec-totalcal-box input, +.mec-fluent-wrap .mec-totalcal-box select, +.mec-fluent-wrap .mec-totalcal-box .nice-select, +.mec-fluent-wrap .mec-totalcal-box .nice-select .list li, +.mec-fluent-wrap .mec-text-input-search i, +.mec-fluent-wrap .mec-event-location i, +.mec-fluent-wrap .mec-event-article .mec-event-title a:hover, +.mec-fluent-wrap .mec-date-details:before, +.mec-fluent-wrap .mec-time-details:before, +.mec-fluent-wrap .mec-venue-details:before, +.mec-fluent-wrap .mec-price-details i:before, +.mec-fluent-wrap .mec-available-tickets-details i:before, +.mec-single-fluent-wrap .mec-local-time-details li:first-child:before, +.mec-single-fluent-wrap .mec-local-time-details li:nth-of-type(2):before, +.mec-single-fluent-wrap .mec-local-time-details li:last-child:before, +.mec-single-fluent-wrap .mec-events-meta-group-countdown .mec-end-counts h3 { + color: var(--mec-fluent-main-color); +} + +.mec-fluent-wrap + .mec-totalcal-box + input[type="search"]::-webkit-input-placeholder { + color: var(--mec-fluent-main-color); +} + +.mec-fluent-wrap .mec-totalcal-box input[type="search"]::-moz-placeholder { + color: var(--mec-fluent-main-color); +} + +.mec-fluent-wrap .mec-totalcal-box input[type="search"]:-ms-input-placeholder { + color: var(--mec-fluent-main-color); +} + +.mec-fluent-wrap .mec-totalcal-box input[type="search"]:-moz-placeholder { + color: var(--mec-fluent-main-color); +} + +.mec-fluent-wrap + .mec-calendar.mec-event-calendar-classic + dl + dt.mec-table-nullday, +.mec-single-fluent-body .lity-content input::-moz-placeholder, +.mec-single-fluent-body .lity-content textarea::-moz-placeholder, +.mec-single-fluent-wrap input::-moz-placeholder, +.mec-single-fluent-wrap textarea::-moz-placeholder { + color: var(--mec-fluent-main-color-rgba-1); +} + +.mec-fluent-wrap .mec-event-sharing-wrap .mec-event-social-icon i, +.mec-fluent-wrap .mec-calendar.mec-event-calendar-classic dl dt:hover { + color: var(--mec-fluent-main-color-rgba-2); +} + +.mec-fluent-wrap.mec-skin-cover-container + .mec-event-cover-fluent-type4 + .mec-booking-button:hover, +.mec-fluent-wrap.mec-skin-cover-container + .mec-event-cover-fluent-type3 + .mec-booking-button:hover, +.mec-fluent-wrap.mec-skin-cover-container + .mec-event-cover-fluent-type1 + .mec-booking-button:hover { + color: var(--mec-fluent-main-color); +} + +/* BORDER COLOR */ +/* list view */ +.mec-fluent-wrap.mec-skin-list-wrap .mec-event-article { + border-top-color: var(--mec-fluent-main-color); + border-left-color: var(--mec-fluent-main-color); + border-bottom-color: var(--mec-fluent-main-color); +} + +/* list view */ +.mec-fluent-wrap.mec-skin-grid-wrap .mec-event-article .mec-event-content { + border-right-color: var(--mec-fluent-main-color); + border-left-color: var(--mec-fluent-main-color); + border-bottom-color: var(--mec-fluent-main-color); +} + +.mec-fluent-wrap.mec-skin-grid-wrap .mec-event-article .mec-event-image { + border-right-color: var(--mec-fluent-main-color); + border-left-color: var(--mec-fluent-main-color); +} + +.mec-fluent-wrap .mec-calendar-weekly .mec-calendar-d-top, +.mec-single-fluent-wrap .mec-next-event-details a:hover, +.mec-single-fluent-wrap .mec-event-schedule-content dl:before, +.mec-single-fluent-wrap .mec-event-schedule-content dl:first-of-type:after, +.mec-single-fluent-wrap .mec-event-schedule-content dl, +.mec-single-fluent-wrap + .mec-event-export-module.mec-frontbox + .mec-event-exporting + .mec-export-details + ul + li + a:hover, +.mec-fluent-wrap .mec-calendar-weekly .mec-calendar-d-top .mec-current-week, +.mec-fluent-wrap + .mec-calendar.mec-event-calendar-classic + .mec-calendar-table-head, +.mec-fluent-wrap .mec-yearly-view-wrap .mec-year-container, +.mec-fluent-wrap.mec-events-agenda-container .mec-events-agenda-wrap, +.mec-fluent-wrap .mec-totalcal-box .mec-totalcal-view span, +.mec-fluent-wrap .mec-totalcal-box input, +.mec-fluent-wrap .mec-totalcal-box select, +.mec-fluent-wrap .mec-totalcal-box .nice-select, +.mec-fluent-wrap .mec-load-more-button:hover, +.mec-fluent-wrap .mec-skin-monthly-view-month-navigator-container, +.mec-fluent-wrap .mec-calendar-a-month, +.mec-fluent-wrap .mec-yearly-title-sec, +.mec-fluent-wrap .mec-filter-content, +.mec-fluent-wrap i.mec-filter-icon, +.mec-fluent-wrap .mec-text-input-search input[type="search"], +.mec-fluent-wrap .mec-event-sharing-wrap .mec-event-sharing, +.mec-fluent-wrap .mec-load-month, +.mec-fluent-wrap .mec-load-year { + border-color: var(--mec-fluent-main-color); +} + +.mec-fluent-current-time-first, +.mec-fluent-wrap .mec-calendar-weekly .mec-calendar-d-top .mec-load-week, +.mec-fluent-wrap .mec-calendar.mec-event-calendar-classic dl dt:first-of-type { + border-left-color: var(--mec-fluent-main-color); +} + +.mec-fluent-current-time-last, +.mec-fluent-wrap .mec-calendar-weekly .mec-calendar-d-top .mec-current-week, +.mec-fluent-wrap .mec-calendar.mec-event-calendar-classic dl dt:last-of-type { + border-right-color: var(--mec-fluent-main-color); +} + +.mec-fluent-wrap .mec-more-events, +.mec-fluent-wrap .mec-calendar.mec-event-calendar-classic dl:last-of-type dt, +.mec-fluent-wrap.mec-skin-full-calendar-container + > .mec-totalcal-box + .mec-totalcal-view + .mec-fluent-more-views-content:before, +.mec-fluent-wrap .mec-filter-content:before { + border-bottom-color: var(--mec-fluent-main-color); +} + +.mec-fluent-wrap .mec-event-sharing-wrap .mec-event-sharing:before { + border-color: var(--mec-fluent-main-color) transparent transparent transparent; +} + +.mec-fluent-wrap.mec-timetable-wrap .mec-cell, +.mec-fluent-wrap .mec-event-meta { + border-left-color: var(--mec-fluent-main-color-rgba-3); +} + +.mec-fluent-wrap .mec-daily-view-events-left-side, +.mec-fluent-wrap .mec-yearly-view-wrap .mec-yearly-calendar-sec { + border-right-color: var(--mec-fluent-main-color-rgba-3); +} + +.mec-fluent-wrap.mec-events-agenda-container .mec-agenda-events-wrap { + border-left-color: var(--mec-fluent-main-color-rgba-3); +} + +.mec-fluent-wrap dt .mec-more-events .simple-skin-ended:hover, +.mec-fluent-wrap .mec-more-events .simple-skin-ended:hover, +.mec-fluent-wrap.mec-skin-slider-container + .mec-slider-t1 + .mec-slider-t1-content, +.mec-fluent-wrap.mec-events-agenda-container .mec-events-agenda { + border-top-color: var(--mec-fluent-main-color-rgba-3); + border-bottom-color: var(--mec-fluent-main-color-rgba-3); +} + +.mec-fluent-wrap .mec-calendar.mec-calendar-daily .mec-calendar-d-table, +.mec-fluent-wrap.mec-timetable-wrap .mec-ttt2-title, +.mec-fluent-wrap.mec-timetable-wrap .mec-cell, +.mec-fluent-wrap.mec-skin-countdown-container .mec-date-wrap { + border-bottom-color: var(--mec-fluent-main-color-rgba-3); +} + +.mec-fluent-wrap .mec-skin-daily-view-events-container, +.mec-single-fluent-wrap .mec-event-social li.mec-event-social-icon a, +.mec-single-fluent-wrap .mec-marker-infowindow-wp .mec-marker-infowindow-count, +.mec-single-fluent-wrap .mec-events-meta-group-countdown .countdown-w .block-w, +.mec-single-fluent-wrap .mec-events-meta-group-booking .nice-select, +.mec-single-fluent-wrap .mec-next-event-details a, +.mec-single-fluent-wrap .mec-events-meta-group, +.mec-single-fluent-wrap .mec-events-meta-group-tags a, +.mec-single-fluent-wrap + .mec-event-export-module.mec-frontbox + .mec-event-exporting + .mec-export-details + ul + li + a, +.mec-fluent-wrap .mec-skin-weekly-view-events-container, +.mec-fluent-wrap .mec-calendar .mec-week-events-container dt, +.mec-fluent-wrap.mec-timetable-wrap .mec-timetable-t2-wrap, +.mec-fluent-wrap .mec-event-countdown li, +.mec-fluent-wrap .mec-event-countdown-style3 .mec-event-countdown li, +.mec-fluent-wrap .mec-calendar.mec-event-calendar-classic dl dt, +.mec-fluent-wrap .mec-yearly-view-wrap .mec-agenda-event, +.mec-fluent-wrap .mec-yearly-view-wrap .mec-calendar.mec-yearly-calendar, +.mec-fluent-wrap .mec-load-more-button, +.mec-fluent-wrap .mec-totalcal-box .nice-select .list, +.mec-fluent-wrap .mec-filter-content i, +.mec-single-fluent-wrap .mec-event-schedule, +.mec-single-fluent-wrap + .mec-map-get-direction-address-cnt + input.mec-map-get-direction-address, +.mec-single-fluent-wrap .mec-single-links-wrap { + border-color: var(--mec-fluent-main-color-rgba-1); +} + +.mec-fluent-wrap .mec-totalcal-box .nice-select:after { + border-right-color: var(--mec-fluent-main-color); + border-bottom-color: var(--mec-fluent-main-color); +} + +/* BOXSHADOW */ +.mec-fluent-wrap .mec-totalcal-box .nice-select .list, +.mec-single-fluent-wrap .mec-booking-button, +.mec-single-fluent-wrap .mec-events-meta-group-tags a:hover { + box-shadow: 0 2px 5px var(--mec-fluent-main-color-rgba-4); +} + +.mec-fluent-wrap .mec-booking-button:hover, +.mec-fluent-wrap .mec-load-more-button:hover, +.mec-fluent-bg-wrap .mec-fluent-wrap article .mec-booking-button:hover { + box-shadow: 0 4px 10px var(--mec-fluent-main-color-rgba-4); +} + +.mec-fluent-wrap.mec-skin-grid-wrap .mec-event-article, +.mec-single-fluent-wrap .mec-next-event-details a:hover, +.mec-single-fluent-wrap + .mec-event-export-module.mec-frontbox + .mec-event-exporting + .mec-export-details + ul + li + a:hover { + box-shadow: 0 4px 10px var(--mec-fluent-main-color-rgba-5); +} + +.mec-single-fluent-wrap + .mec-events-meta-group-booking + input[type="radio"]:checked:before { + box-shadow: 0 0 0 2px var(--mec-fluent-main-color-rgba-4); +} + +.mec-fluent-wrap .mec-skin-daily-view-events-container, +.mec-fluent-wrap.mec-timetable-wrap .mec-timetable-t2-wrap, +.mec-fluent-wrap .mec-calendar-side .mec-calendar-table, +.mec-fluent-wrap .mec-yearly-view-wrap .mec-year-container, +.mec-fluent-wrap.mec-events-agenda-container .mec-events-agenda-wrap { + box-shadow: 0 5px 33px var(--mec-fluent-main-color-rgba-1); +} + +.mec-fluent-wrap .mec-yearly-view-wrap .mec-agenda-event { + box-shadow: 0 1px 6px var(--mec-fluent-main-color-rgba-6); +} + +/* BACKGROUND */ +/* filter options */ +.mec-fluent-wrap .nicescroll-cursors, +.mec-single-fluent-wrap .mec-related-event-post .mec-date-wrap, +.mec-single-fluent-wrap .mec-next-event-details a:hover, +.mec-single-fluent-wrap .mec-events-meta-group-tags a:hover, +.mec-single-fluent-wrap + .mec-event-export-module.mec-frontbox + .mec-event-exporting + .mec-export-details + ul + li + a:hover, +.mec-fluent-wrap dt .mec-more-events .simple-skin-ended:hover, +.mec-fluent-wrap .mec-more-events .simple-skin-ended:hover, +.mec-fluent-wrap.mec-skin-countdown-container .mec-date-wrap, +.mec-fluent-wrap .mec-yearly-view-wrap .mec-yearly-agenda-sec, +.mec-fluent-wrap .mec-calendar-daily .mec-calendar-day-events, +.mec-fluent-wrap .mec-totalcal-box .nice-select .list li:hover, +.mec-fluent-wrap .mec-totalcal-box .nice-select .list li.focus, +.mec-single-fluent-wrap .mec-single-event-category a { + background-color: var(--mec-fluent-main-color-rgba-3); +} + +.mec-fluent-wrap h5.mec-more-events-header, +.mec-fluent-current-time, +.mec-single-fluent-wrap .flip-clock-wrapper ul li a div div.inn { + background-color: var(--mec-fluent-main-color); +} + +.mec-single-fluent-body .lity-content .mec-events-meta-group-booking, +.mec-fluent-wrap.mec-skin-cover-container .mec-date-wrap i, +.mec-fluent-wrap.mec-skin-carousel-container + .mec-event-carousel-type2 + .owl-next:hover, +.mec-fluent-wrap.mec-skin-carousel-container + .mec-event-carousel-type2 + .owl-prev:hover, +.mec-fluent-wrap.mec-skin-slider-container + .mec-slider-t1-wrap + .mec-owl-theme + .owl-nav + .owl-next:hover, +.mec-fluent-wrap.mec-skin-slider-container + .mec-slider-t1-wrap + .mec-owl-theme + .owl-nav + .owl-prev:hover, +.mec-fluent-wrap .mec-calendar-weekly .mec-calendar-d-top dt.active, +.mec-fluent-wrap .mec-calendar-weekly .mec-calendar-d-top .mec-current-week, +.mec-fluent-wrap.mec-skin-full-calendar-container + > .mec-totalcal-box + .mec-totalcal-view + span.mec-fluent-more-views-icon.active, +.mec-fluent-wrap.mec-skin-full-calendar-container + > .mec-totalcal-box + .mec-totalcal-view + span.mec-totalcalview-selected, +.mec-fluent-wrap i.mec-filter-icon.active, +.mec-fluent-wrap .mec-filter-content i, +.mec-single-fluent-wrap .mec-events-meta-group-countdown, +.mec-single-event-bar-seperator { + background-color: var(--mec-fluent-main-color-rgba-1); +} + +/* MAIN BOLD COLOR - SECOND COLOR */ +.mec-fluent-wrap + .mec-daily-view-events-left-side + h5.mec-daily-today-title + span:first-child, +.mec-single-fluent-wrap .mec-events-meta-group-tags .mec-event-footer a:hover, +.mec-single-fluent-wrap .mec-event-social li.mec-event-social-icon a:hover, +.mec-single-fluent-wrap + .mec-related-event-post + .mec-date-wrap + span.mec-event-day-num, +.mec-single-fluent-wrap .mec-single-event-category a:hover, +.mec-fluent-wrap.mec-skin-available-spot-container + .mec-date-wrap + span.mec-event-day-num, +.mec-fluent-wrap.mec-skin-cover-container .mec-date-wrap span.mec-event-day-num, +.mec-fluent-wrap.mec-skin-countdown-container + .mec-date-wrap + span.mec-event-day-num, +.mec-fluent-wrap.mec-skin-carousel-container + .event-carousel-type2-head + .mec-date-wrap + span.mec-event-day-num, +.mec-fluent-wrap.mec-skin-slider-container + .mec-date-wrap + span.mec-event-day-num, +.mec-fluent-wrap.mec-skin-masonry-container + .mec-masonry + .mec-date-wrap + span.mec-event-day-num, +.mec-fluent-wrap .mec-calendar-weekly .mec-calendar-d-top dt.active, +.mec-fluent-wrap .mec-calendar-weekly .mec-calendar-d-top .mec-current-week, +.mec-fluent-wrap + .mec-calendar.mec-event-calendar-classic + .mec-calendar-table-head + dt.active, +.mec-fluent-wrap .mec-color, +.mec-fluent-wrap a:hover, +.mec-wrap .mec-color-hover:hover, +.mec-fluent-wrap.mec-skin-full-calendar-container + > .mec-totalcal-box + .mec-totalcal-view + span.mec-totalcalview-selected, +.mec-fluent-wrap .mec-load-more-button, +.mec-fluent-wrap .mec-load-month i, +.mec-fluent-wrap .mec-load-year i, +.mec-fluent-wrap i.mec-filter-icon, +.mec-fluent-wrap .mec-filter-content i, +.mec-fluent-wrap .mec-event-sharing-wrap > li:first-of-type i, +.mec-fluent-wrap + .mec-available-tickets-details + span.mec-available-tickets-number { + color: var(--mec-fluent-bold-color); +} + +/* BORDER BOLD COLOR - SECOND COLOR */ +.mec-fluent-wrap.mec-skin-carousel-container + .mec-owl-theme + .owl-dots + .owl-dot.active + span, +.mec-single-fluent-wrap .mec-event-social li.mec-event-social-icon a:hover, +.mec-fluent-wrap .mec-load-month, +.mec-fluent-wrap .mec-load-year, +.mec-single-fluent-body + .lity-content + .mec-events-meta-group-booking + .mec-book-available-tickets-details + > .mec-book-available-tickets-details-header, +.mec-single-fluent-wrap + .mec-events-meta-group-booking + .mec-book-available-tickets-details + > .mec-book-available-tickets-details-header { + border-color: var(--mec-fluent-bold-color); +} + +.mec-fluent-wrap .mec-calendar .mec-daily-view-day.mec-has-event:after, +.mec-fluent-wrap.mec-skin-cover-container + .mec-event-cover-fluent-type4 + .mec-booking-button, +.mec-fluent-wrap.mec-skin-cover-container + .mec-event-cover-fluent-type3 + .mec-booking-button, +.mec-fluent-wrap.mec-skin-cover-container + .mec-event-cover-fluent-type1 + .mec-booking-button, +.mec-fluent-wrap + .mec-event-cover-fluent-type2 + .mec-event-sharing-wrap:hover + > li:first-child, +.mec-fluent-wrap.mec-skin-cover-container + .mec-event-cover-fluent-type2 + .mec-date-wrap, +.mec-fluent-wrap.mec-skin-carousel-container + .mec-owl-theme + .owl-dots + .owl-dot.active + span, +.mec-single-fluent-body .lity-content .mec-events-meta-group-booking button, +.mec-fluent-wrap.mec-single-fluent-wrap .mec-events-meta-group-booking button, +.mec-single-fluent-wrap + .mec-events-meta-group-booking + input[type="radio"]:checked:before { + background-color: var(--mec-fluent-bold-color); +} + +/* BACKGROUND HOVER COLOR */ +.mec-fluent-wrap + .mec-yearly-view-wrap + .mec-calendar.mec-yearly-calendar + .mec-has-event:after, +.mec-fluent-wrap .mec-load-more-button:hover, +.mec-fluent-wrap .mec-load-month:hover, +.mec-fluent-wrap .mec-load-year:hover, +.mec-fluent-wrap .mec-booking-button:hover, +.mec-wrap.mec-single-fluent-wrap .button:hover, +.mec-wrap.mec-single-fluent-wrap + button:not(.owl-dot):not(.gm-control-active):not(.mejs):not(.owl-prev):not( + .owl-next + ):not(.mec-googlemap-details button):not(.mec-googlemap-skin button):hover, +.mec-wrap.mec-single-fluent-wrap input[type="submit"]:hover, +.mec-wrap.mec-single-fluent-wrap input[type="reset"]:hover, +.mec-wrap.mec-single-fluent-wrap input[type="button"]:hover { + background-color: var(--mec-fluent-bg-hover-color); +} + +/* BACKGROUND COLOR */ +.mec-fluent-wrap { + background-color: var(--mec-fluent-bg-color); +} + +/* BACKGROUND SECOND BACKGROUND COLOR */ +.mec-fluent-wrap.mec-skin-masonry-container .mec-masonry .mec-date-wrap, +.mec-single-fluent-wrap .mec-event-social li.mec-event-social-icon a:hover, +.mec-fluent-wrap .mec-filter-content { + background-color: var(--mec-fluent-second-bg-color); +} + +.mec-fluent-wrap .mec-filter-content:after { + border-bottom-color: var(--mec-fluent-second-bg-color); +} + +/* Dynamic CSS End */ + +/* Saga theme compatibility */ + +@media only screen and (min-width: 1200px) { + .mec-theme-saga .mec-container, + body [id*="mec_skin_"].mec-fluent-wrap { + width: inherit; + max-width: inherit; + } +} + +.mec-theme-saga .mec-wrap h1, +.mec-theme-saga .mec-wrap h2, +.mec-theme-saga .mec-wrap h3, +.mec-theme-saga .mec-wrap h4, +.mec-theme-saga .mec-wrap h5, +.mec-theme-saga .mec-wrap h6 { + text-align: inherit; +} + +.mec-theme-saga .mec-wrap h1:after, +.mec-theme-saga .mec-wrap h2:after, +.mec-theme-saga .mec-wrap h3:after, +.mec-theme-saga .mec-wrap h4:after, +.mec-theme-saga .mec-wrap h5:after, +.mec-theme-saga .mec-wrap h6:after, +.mec-theme-saga .mec-gCalendar h1:after, +.mec-theme-saga .mec-gCalendar h2:after, +.mec-theme-saga .mec-gCalendar h3:after, +.mec-theme-saga .mec-gCalendar h4:after, +.mec-theme-saga .mec-gCalendar h5:after, +.mec-theme-saga .mec-gCalendar h6:after { + display: none; +} + +.mec-theme-saga .mec-wrap a img { + opacity: 1; + padding: 0; + border: none; + -webkit-transition: unset; + -moz-transition: unset; + -o-transition: unset; + transition: unset; + background: none; + border-color: unset; +} + +.mec-theme-saga .mec-wrap input[type="number"], +.mec-theme-saga .mec-wrap input[type="date"], +.mec-theme-saga .mec-wrap input[type="datetime"], +.mec-theme-saga .mec-wrap input[type="datetime-local"], +.mec-theme-saga .mec-wrap input[type="email"], +.mec-theme-saga .mec-wrap input[type="month"], +.mec-theme-saga .mec-wrap input[type="password"], +.mec-theme-saga .mec-wrap input[type="search"], +.mec-theme-saga .mec-wrap input[type="tel"], +.mec-theme-saga .mec-wrap input[type="text"], +.mec-theme-saga .mec-wrap input[type="time"], +.mec-theme-saga .mec-wrap input[type="url"], +.mec-theme-saga .mec-wrap input[type="week"], +.mec-theme-saga .mec-wrap textarea, +.mec-theme-saga .mec-wrap select { + opacity: 1; + -webkit-transition: unset; + -moz-transition: unset; + -o-transition: unset; + transition: unset; +} + +.mec-theme-saga .mec-wrap ul, +.mec-theme-saga .mec-wrap ol { + margin: 0; +} + +.mec-theme-saga .mec-wrap dl, +.mec-theme-saga .mec-wrap dt { + margin: 0; +} + +.mec-theme-saga .mec-single-event { + padding-top: 15px; +} + +.mec-theme-saga .mec-single-event .mec-frontbox-title, +.mec-theme-saga .mec-single-event .mec-wrap-checkout h4, +.mec-theme-saga + .lity-content + .mec-events-meta-group-booking + .mec-wrap-checkout + h4, +.mec-theme-saga + .mec-single-event + .mec-events-meta-group-booking + .mec-wrap-checkout + h4, +.mec-theme-saga + .mec-events-meta-group-booking + .mec-booking-shortcode + .mec-wrap-checkout + h4, +.mec-theme-saga .lity-content .mec-events-meta-group-booking form > h4, +.mec-single-event .mec-events-meta-group-booking form > h4, +.mec-theme-saga + .mec-events-meta-group-booking + .mec-booking-shortcode + form + > h4 { + text-align: center; +} + +/* Saga theme compatibility End*/ + +/* Fix banner */ +.mec-event-banner-inner .mec-single-event-location > i { + display: none; +} + +/* Single builder content load more */ + +span.load-more-text { + text-decoration: underline; + margin-left: 5px; + cursor: pointer; + position: relative; +} + +span.load-more-text:before { + content: ""; + width: 100px; + height: 24px; + position: absolute; + top: 0; + right: calc(100% + 5px); + background-image: linear-gradient(90deg, #0000 0%, #fff 100%); + z-index: 1; +} + +.mec-event-meta img.mec-custom-image-icon { + width: 20px; +} diff --git a/assets/css/frontend.min.css b/assets/css/frontend.min.css new file mode 100755 index 0000000..84b1567 --- /dev/null +++ b/assets/css/frontend.min.css @@ -0,0 +1 @@ +.mec-wrap{position:relative}.entry-content .mec-wrap h1,.entry-content .mec-wrap h2,.entry-content .mec-wrap h3,.entry-content .mec-wrap h4,.entry-content .mec-wrap h5,.entry-content .mec-wrap h6,.mec-wrap h1,.mec-wrap h2,.mec-wrap h3,.mec-wrap h4,.mec-wrap h5,.mec-wrap h6{color:#171c24;font-weight:300;font-style:inherit;letter-spacing:normal;clear:none}.mec-wrap h1{font-size:50px;line-height:1.16;margin-bottom:12px;letter-spacing:-1px}.mec-wrap h2{font-size:36px;line-height:1.14;margin-bottom:10px}.mec-wrap h3{font-size:28px;line-height:1.2;margin-bottom:8px}.mec-wrap h4{font-size:24px;line-height:1.2;margin-bottom:10px}.mec-wrap h5{font-size:18px;line-height:1.3;margin-bottom:7px}.mec-wrap h6{font-size:16px;line-height:1.3;margin-bottom:4px}.mec-wrap .subheader{color:#849098}.mec-wrap h1 strong{font-weight:700}.mec-wrap :not(.elementor-widget-container)>p{margin:0 0 20px 0;color:#616161;font-size:14px;line-height:1.8}.mec-wrap .read-more-text p span.more-text{display:none}.mec-wrap .mec-event-article .mec-color-hover{box-shadow:none;border:none}.mec-wrap abbr,.mec-wrap acronym{cursor:auto;border:none}.entry-content .mec-wrap a{box-shadow:none}.mec-single-event-description.mec-events-content ol li,.mec-single-event-description.mec-events-content ul li{color:#616161;font-size:14px;line-height:1.8;font-weight:300}.lity-content .button,.lity-content button:not(.owl-dot):not(.gm-control-active):not(.mejs):not(.owl-prev):not( .owl-next ):not(.mec-googlemap-details button):not(.mec-googlemap-skin button),.lity-content input[type=button],.lity-content input[type=reset],.lity-content input[type=submit],.mec-nextprev-next-button,.mec-nextprev-prev-button,.mec-wrap .button,.mec-wrap button:not(.owl-dot):not(.gm-control-active):not(.mejs):not(.owl-prev):not( .owl-next ):not(.mec-googlemap-details button):not(.mec-googlemap-skin button),.mec-wrap input[type=button],.mec-wrap input[type=reset],.mec-wrap input[type=submit]{position:relative;border:1px solid #ccecf4;border-radius:4px;box-shadow:0 1px 0 0 #fcfcfc;color:#07bbe9;display:inline-block;font-size:14px;line-height:18px;text-transform:capitalize;font-weight:600;text-decoration:none;cursor:pointer;margin-bottom:20px;margin-right:10px;padding:10px 24px 10px;background:#ecf9fd;-webkit-transition:all .21s ease;-moz-transition:all .21s ease;transition:all .21s ease}.lity-content .button:hover,.lity-content button:not(.owl-dot):not(.gm-control-active):not(.mejs):not(.owl-prev):not( .owl-next ):hover,.lity-content input[type=button]:hover,.lity-content input[type=reset]:hover,.lity-content input[type=submit]:hover,.mec-wrap .button:hover,.mec-wrap a.button:hover,.mec-wrap button:not(.owl-dot):not(.gm-control-active):not(.mejs):not(.owl-prev):not( .owl-next ):hover,.mec-wrap input[type=button]:hover,.mec-wrap input[type=reset]:hover,.mec-wrap input[type=submit]:hover{border:1px solid #38d5ed;box-shadow:0 1px 0 0 #fafafa}.lity-content .button svg,.lity-content button:not(.owl-dot):not(.gm-control-active):not(.mejs):not(.owl-prev):not( .owl-next ):not(.et-fb-button) svg,.lity-content input[type=button] svg,.lity-content input[type=reset] svg,.lity-content input[type=submit] svg,.mec-nextprev-next-button svg,.mec-nextprev-prev-button svg,.mec-wrap .button svg,.mec-wrap button:not(.owl-dot):not(.gm-control-active):not(.mejs):not(.owl-prev):not( .owl-next ):not(.et-fb-button) svg,.mec-wrap input[type=button] svg,.mec-wrap input[type=reset] svg,.mec-wrap input[type=submit] svg{margin-left:30px}.mec-wrap .button svg.back,.mec-wrap button:not(.owl-dot):not(.gm-control-active):not(.mejs):not(.owl-prev):not( .owl-next ):not(.et-fb-button) svg.back{margin-right:30px;margin-left:0}.mec-booking-form-container button{display:block}.vertical-space,.vertical-space1,.vertical-space2,.vertical-space3,.vertical-space4,.vertical-space5{display:block;width:100%;margin:0;clear:both;border:0 none;height:20px}.vertical-space2{height:40px}.vertical-space3{height:60px}.vertical-space4{height:80px}.vertical-space5{height:100px}@media only screen and (max-width:479px){.vertical-space,.vertical-space1{height:8px}.vertical-space2{height:14px}.vertical-space3{height:28px}.vertical-space4{height:40px}.vertical-space5{height:60px}}@media only screen and (max-width:960px){.vertical-space,.vertical-space1{height:12px}.vertical-space2{height:18px}.vertical-space3{height:36px}.vertical-space4{height:50px}.vertical-space5{height:80px}}.mec-wrap abbr{cursor:auto;border-bottom:0}@-webkit-keyframes rotating{from{-ms-transform:rotate(0);-moz-transform:rotate(0);-webkit-transform:rotate(0);-o-transform:rotate(0);transform:rotate(0)}to{-ms-transform:rotate(360deg);-moz-transform:rotate(360deg);-webkit-transform:rotate(360deg);-o-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes rotating{from{-ms-transform:rotate(0);-moz-transform:rotate(0);-webkit-transform:rotate(0);-o-transform:rotate(0);transform:rotate(0)}to{-ms-transform:rotate(360deg);-moz-transform:rotate(360deg);-webkit-transform:rotate(360deg);-o-transform:rotate(360deg);transform:rotate(360deg)}}.mec-wrap{font:14px/25px;font-weight:400;color:#626262}.mec-wrap .mec-events a{border-bottom:none}.mec-wrap .mec-container a{box-shadow:none}.mec-event-content p{font-weight:300}.mec-wrap .mec-clear:after,.mec-wrap .mec-clear:before{content:" ";display:table}.mec-wrap .mec-clear:after{clear:both}.mec-events-button{background:#fff;padding:12px 28px;font-size:15px;font-weight:400;letter-spacing:0;border:1px solid #e3e3e3;border-radius:2px;text-shadow:none;margin-right:10px;box-shadow:0 2px 0 0 rgb(0 0 0 / 3%);transition:.3s}.mec-wrap .mec-events-button:hover{color:#fff}.mec-no-event{display:none}#mec-active-current{display:block}.current-hide #mec-active-current{display:none!important}.mec-event-grid-classic .mec-event-article{position:relative;border:2px solid #e3e3e3;box-shadow:0 2px 0 0 rgba(0,0,0,.016);margin-bottom:30px;max-width:none}.mec-event-grid-classic .mec-event-content{color:#767676;padding:0 20px 5px;text-align:center;min-height:125px}.mec-event-grid-classic .mec-event-title{color:#202020;margin:10px 0;font-weight:700;font-size:20px;letter-spacing:1px;text-transform:uppercase}.mec-event-grid-classic .mec-event-title a{color:#202020;transition:all .24s ease}.mec-event-grid-classic .mec-event-date{font-weight:400;font-size:11px;text-transform:uppercase;letter-spacing:1px;color:#fff;padding:3px 20px;margin:0 -20px 20px -20px;text-align:center}.widget_mec_mec_widget .mec-event-grid-classic .mec-event-date{margin:0}.mec-event-grid-classic .mec-event-content p{font-size:15px;color:#8a8a8a}.mec-event-grid-classic .mec-event-content .mec-grid-event-location{margin:0;font-size:12px;font-weight:400;line-height:16px}.mec-event-grid-classic .mec-event-detail{display:none}.mec-event-grid-classic .mec-price-details{font-size:12px;font-weight:400}.mec-event-grid-classic img{margin-bottom:0;width:100%}.mec-event-footer{position:relative;border-top:1px solid #efefef;padding:20px;min-height:80px;margin:0;background:#fafafa}.mec-event-sharing-wrap{left:15px;position:absolute;list-style:none;margin:0;padding-left:0}.mec-event-sharing-wrap .mec-event-sharing{position:absolute;padding:8px 0 2px;left:-6px;bottom:54px;margin:0;margin-top:6px;border-radius:5px;min-width:50px;visibility:hidden;opacity:0;border:1px solid #e2e2e2;background:#fff;box-shadow:0 0 9px 0 rgba(0,0,0,.06);z-index:99;-webkit-transition:all .18s ease;transition:all .18s ease}.mec-event-sharing-wrap .mec-event-sharing:after,.mec-event-sharing-wrap .mec-event-sharing:before{content:"";display:block;position:absolute;bottom:-10px;left:50%;margin-left:-10px;width:0;height:0;border-style:solid;border-width:10px}.mec-event-sharing-wrap .mec-event-sharing:before{bottom:-21px;border-color:#e2e2e2 transparent transparent transparent}.mec-event-sharing-wrap .mec-event-sharing:after{bottom:-19px;border-color:#fff transparent transparent transparent}.mec-event-sharing-wrap:hover .mec-event-sharing{opacity:1;visibility:visible}.mec-event-sharing-wrap li{text-align:center;border:0;display:block;margin-right:2px;overflow:hidden;margin:0 auto 6px;width:38px}.mec-event-sharing-wrap li.mec-event-share{height:38px}.mec-event-sharing-wrap:hover>li{cursor:pointer;background-color:#40d9f1}.mec-event-sharing-wrap:hover li a{color:#fff}.mec-event-sharing-wrap>li:first-of-type{border:1px solid #d9d9d9}.mec-event-sharing-wrap li a,.mec-event-sharing-wrap:hover li ul li a{border:none;color:#767676;display:block}.mec-event-sharing-wrap li a .mec-social-title{padding-right:10px;display:none}.mec-event-sharing-wrap li i{width:36px;height:36px;display:table-cell;vertical-align:middle}.mec-event-sharing-wrap li svg{height:16px}.mec-event-sharing-wrap .mec-event-sharing li a{display:block}.mec-event-sharing-wrap .mec-event-sharing li:hover a{color:#40d9f1}.mec-event-sharing .mec-event-share:hover .event-sharing-icon{background:#40d9f1;border-width:0 1px 0;cursor:pointer}.mec-event-sharing .mec-event-map{border-width:1px 0 1px}.mec-event-footer .mec-booking-button{box-shadow:none;transition:all .21s ease;font-size:11px;font-weight:500;letter-spacing:1px;text-transform:uppercase;background:#fff;color:#767676;border:1px solid #e8e8e8;position:absolute;top:20px;right:15px;padding:0 16px;line-height:37px;height:38px;border-radius:2px}.mec-event-footer .mec-booking-button:hover{background:#191919;color:#fff;border-color:#191919}@media only screen and (max-width:960px){.mec-event-grid-classic{margin-bottom:30px}}.mec-widget .mec-event-grid-classic.mec-owl-carousel{padding:36px 0 16px}.mec-widget .mec-event-grid-classic.mec-owl-carousel .owl-nav{margin:5px 0;width:100%;position:absolute;top:15px;padding:0}.mec-skin-grid-container.mec-widget{padding-top:18px}.mec-widget .mec-event-grid-classic.mec-owl-carousel{padding:20px 0 16px}.mec-widget .mec-event-grid-classic.mec-owl-carousel .owl-nav{margin:0;width:100%;position:absolute;top:0;padding:0}.mec-widget .mec-event-grid-classic.mec-owl-carousel .owl-nav div{position:absolute;background:#fff;line-height:0;width:34px;height:26px;padding:6px;text-align:center;margin-top:-17px;border-radius:3px;border:1px solid #e2e2e2;text-align:center;box-shadow:0 2px 0 0 rgba(0,0,0,.028);transition:all .33s ease}.mec-skin-grid-container .mec-categories{padding:0}.mec-skin-grid-container .mec-categories li{list-style:none}.mec-skin-grid-container .mec-categories li a{color:#000;text-align:left;transition:all .23s ease;-webkit-transition:all .23s ease}.mec-widget .mec-event-grid-classic.mec-owl-carousel .owl-nav i{font-size:12px;color:#40d9f1;cursor:pointer}.mec-widget .mec-event-grid-classic.mec-owl-carousel .owl-nav .owl-next{right:0}.mec-widget .mec-event-grid-classic.mec-owl-carousel .owl-nav .owl-prev{left:0}.mec-widget .mec-event-grid-classic.mec-owl-carousel .mec-event-sharing{display:none}.mec-widget .mec-event-grid-classic.mec-owl-carousel .mec-event-footer{text-align:center}.mec-widget .mec-event-grid-classic.mec-owl-carousel .mec-event-footer .mec-booking-button{position:static;padding:11px 16px}.widget .mec-event-footer ul.mec-event-sharing-wrap li a.mec-event-share-icon{padding:0}@media screen and (min-width:56.875em){.mec-widget .mec-month-container dl{margin-bottom:0}}.mec-widget .mec-event-grid-classic.owl-carousel .mec-event-footer{text-align:right}.mec-widget .mec-event-grid-classic.owl-carousel .mec-event-sharing-wrap{left:5px;padding-left:5px}.mec-widget .mec-event-grid-classic.owl-carousel .mec-event-sharing-wrap .mec-event-sharing{left:0}.mec-widget .mec-event-sharing-wrap .mec-event-sharing{position:absolute;top:auto;bottom:52px;margin:0;margin-top:0;border-radius:5px}.mec-widget .mec-event-sharing-wrap .mec-event-sharing:after{top:auto;bottom:-17px;border-color:#fff transparent transparent transparent}.mec-widget .mec-event-sharing-wrap .mec-event-sharing:before{top:auto;bottom:-18px;border-color:#e2e2e2 transparent transparent transparent}.mec-widget .mec-event-grid-classic.mec-owl-carousel .owl-nav button{position:absolute;background:#fff;padding:6px;margin-top:-17px;border-radius:3px;border:1px solid #e2e2e2;box-shadow:0 2px 0 0 rgba(0,0,0,.028)}.mec-widget .mec-event-grid-classic.mec-owl-carousel .owl-nav button:hover{background:#40d9f1;border-color:#40d9f1}.mec-widget .mec-event-grid-classic.mec-owl-carousel .owl-nav button:hover i{color:#fff}.mec-widget .mec-event-grid-classic.mec-owl-carousel .mec-booking-button{width:40%;float:right;color:#202020;height:36px;line-height:14px;font-size:12px;width:auto}.mec-widget .mec-event-grid-classic.mec-owl-carousel .mec-booking-button:hover{color:#fff}.mec-widget .mec-event-list-modern .col-md-2.col-sm-2,.mec-widget .mec-event-list-modern .col-md-6.col-sm-6{padding:0;width:100%;display:block;position:unset}.mec-widget .mec-event-list-modern .col-md-4.col-sm-4 .mec-booking-button{width:80%;height:46px;line-height:22px;padding:11px 20px;float:right}.mec-widget .mec-event-list-modern .col-md-4.col-sm-4.mec-btn-wrapper{top:auto;bottom:5%}@media (max-width:480px){.mec-widget .mec-event-list-modern .col-md-4.col-sm-4{padding:0}.mec-widget .mec-event-list-modern .col-md-4.col-sm-4 .mec-booking-button{width:100%}}.mec-widget .mec-event-list-modern .mec-month-divider{margin:30px 0 10px 0}.mec-widget .mec-event-list-minimal .mec-event-date span{font-size:12px}.mec-widget .mec-event-list-minimal .mec-event-date:after{height:29px}.mec-widget .mec-event-list-minimal .col-md-3,.mec-widget .mec-event-list-minimal .col-md-9{display:block;width:100%;text-align:left}.mec-widget .mec-event-list-modern .col-md-4.col-sm-4.mec-btn-wrapper{position:relative}.mec-widget .mec-event-list-modern .col-md-4.col-sm-4 .mec-booking-button{width:100%;text-align:center}.mec-widget .mec-event-list-minimal .mec-event-date:first-child{margin-right:24px}.mec-event-grid-clean{margin-bottom:10px;max-width:none}.mec-event-grid-clean .mec-event-article{margin-bottom:30px;position:relative;border:1px solid #e2e2e2;text-align:center;padding:15px 15px 0;background:#fff;box-shadow:0 2px 0 0 rgba(0,0,0,.016)}.mec-event-grid-clean .mec-event-content{background:#fff;color:#767676;padding:25px 16px 0;text-align:left}.mec-event-grid-clean .mec-event-title{color:#202020;margin:0 0 10px 0;font-weight:700;font-size:21px;text-transform:capitalize}.mec-event-grid-clean .mec-event-title a{color:#202020;transition:all .24s ease}.mec-event-grid-clean .mec-event-date{font-weight:400;font-size:11px;text-transform:uppercase;letter-spacing:1px;background-color:#40d9f1;color:#fff;padding:3px 0;margin:0;text-align:center}.mec-event-grid-clean .mec-event-content p{font-size:15px;color:#9a9a9a;line-height:1.54}.mec-event-grid-clean img{margin-bottom:0;width:100%}.mec-event-grid-clean .event-grid-t2-head{margin-bottom:10px;color:#fff;padding:9px 14px 6px;text-align:left}.mec-event-grid-clean .event-grid-t2-head .mec-event-date{font-size:50px;line-height:50px;float:left;margin-right:11px}.mec-event-grid-clean .event-grid-t2-head .mec-event-month{text-transform:uppercase;font-size:17px;line-height:20px;padding-top:4px}.mec-event-grid-clean .event-grid-t2-head .mec-event-detail{font-size:12px}.mec-event-grid-clean .event-grid-t2-head .mec-categories li a{margin-bottom:10px;color:#fff}.mec-event-grid-clean .event-grid-t2-head .mec-categories li a:hover{color:#000}.mec-event-grid-clean .mec-event-sharing-wrap{left:0;padding-left:0}.mec-event-grid-clean .mec-event-footer{position:relative;border-top:2px solid;padding:20px 0;margin:0 14px;text-align:left;background:0 0}.mec-event-grid-clean .mec-event-footer .mec-booking-button{right:0}.mec-event-grid-clean .row{margin-bottom:30px}.mec-event-grid-modern{margin-bottom:10px;max-width:none}.mec-event-grid-modern .mec-event-article{position:relative;border:1px solid #e2e2e2;text-align:center;margin-bottom:30px;padding:45px 15px 10px;background:#fff;box-shadow:0 2px 0 0 rgba(0,0,0,.016)}.mec-event-grid-modern .mec-event-content{color:#767676;padding:0 15px 10px;text-align:left}.mec-event-grid-modern .mec-event-title{color:#202020;margin:0 0 10px 0;font-weight:700;font-size:24px;text-transform:none;letter-spacing:-1px}.mec-event-grid-modern .mec-event-title a{color:#202020;transition:all .24s ease}.mec-event-grid-modern .mec-event-content .mec-categories-wrapper,.mec-event-grid-modern .mec-event-content .mec-shortcode-organizers{margin-bottom:10px}.mec-event-grid-modern .mec-event-content .mec-categories-wrapper,.mec-event-grid-modern .mec-event-content .mec-shortcode-organizers,.mec-event-grid-modern .mec-event-content p{font-size:15px;color:#9a9a9a;line-height:1.54}.mec-event-grid-modern img{margin-bottom:0;width:100%}.mec-event-grid-modern .event-grid-modern-head{margin-bottom:0;padding:9px 14px 6px;text-align:left}.mec-event-grid-modern .event-grid-modern-head .mec-event-date{font-size:50px;line-height:50px;float:left;margin-right:11px}.mec-event-grid-modern .event-grid-modern-head .mec-event-month{text-transform:uppercase;font-size:17px;line-height:20px;padding-top:4px;margin-bottom:5px}.mec-event-grid-modern .event-grid-modern-head .mec-event-detail{font-size:12px}.mec-event-grid-modern .event-grid-modern-head .mec-event-day{margin-top:9px;color:silver;font-size:35px;font-weight:100;text-transform:uppercase;letter-spacing:-1px}.mec-event-grid-modern .mec-event-footer{position:relative;height:90px;padding:20px 0;border:none;margin:0 14px;text-align:left;background:0 0}.mec-event-grid-modern .mec-event-footer .mec-booking-button{right:auto;left:0}.mec-event-grid-modern .mec-event-sharing-wrap{left:auto;right:0;padding-left:0}.mec-event-grid-modern .mec-event-sharing{left:auto;right:-6px}.mec-event-grid-modern .mec-event-sharing-wrap li{border-radius:55px}.mec-event-grid-modern .row{margin-bottom:0}@media only screen and (max-width:479px){.mec-event-grid-modern .mec-event-article{padding-bottom:30px}.mec-event-grid-modern .mec-event-sharing{top:60px;left:0;right:auto}.mec-event-grid-modern .mec-event-footer .mec-booking-button{top:0}}span.mec-event-title-soldout{font-size:8px;font-weight:700;letter-spacing:.5px;text-transform:uppercase;background:#e63360;color:#fff;padding:3px 8px;line-height:1;border-radius:15px;white-space:nowrap;vertical-align:middle}.mec-repeating-label{background:#222;color:#fff;padding:3px 8px;font-size:8px;font-weight:700;letter-spacing:.5px;border-radius:40px;display:inline-block}.mec-event-grid-colorful .mec-event-article{min-height:400px;border:none;box-shadow:none;background:#40d9f1;padding-top:25px;margin:0;color:#fff}.mec-event-grid-colorful .mec-event-content{background:0 0}.mec-event-grid-colorful .event-grid-modern-head,.mec-event-grid-colorful .event-grid-modern-head .mec-event-date,.mec-event-grid-colorful .event-grid-modern-head .mec-event-day,.mec-event-grid-colorful .mec-event-content p,.mec-event-grid-colorful .mec-event-sharing-wrap>li>a,.mec-event-grid-colorful .mec-event-title a,.mec-event-grid-colorful ul.mec-categories li.mec-category a{color:#fff}.mec-event-grid-colorful .mec-event-footer .mec-booking-button,.mec-event-grid-colorful .mec-event-footer .mec-modal-booking-button{border:none}.mec-event-grid-colorful .mec-event-sharing-wrap>li{border-color:#fff}.mec-event-grid-colorful .mec-event-sharing-wrap:hover>li{background:#333;border-color:#333}.mec-event-grid-colorful .mec-event-title a.mec-color-hover:hover{color:#fff;text-decoration:underline}.mec-event-grid-colorful .mec-event-title .event-color{display:none}.mec-event-grid-colorful div[class^=col-md-]{padding:0 1px 1px 0;margin:0}.mec-event-grid-colorful .mec-event-article .mec-price-details,.mec-event-grid-colorful .mec-event-article .mec-time-details{color:#fff}@media only screen and (min-width:768px){.mec-wrap.mec-sm959.mec-event-grid-colorful .event-grid-modern-head .mec-event-day{font-size:26px}.mec-wrap.mec-sm959.mec-event-grid-colorful .event-grid-modern-head .mec-event-month{font-size:15px}.mec-wrap.mec-sm959.mec-event-grid-colorful .event-grid-modern-head .mec-event-date{font-size:50px}.mec-wrap.mec-sm959.mec-event-grid-colorful .mec-event-title{font-size:21px}.mec-wrap.mec-sm959.mec-event-grid-colorful .mec-event-content p{font-size:13px}.mec-wrap .mec-event-grid-colorful .col-md-3.col-sm-3 .mec-event-sharing-wrap{bottom:100px}}@media only screen and (min-width:768px) and (max-width:1200px){.mec-wrap.mec-sm959.mec-event-grid-colorful div[class^=col-md-]{width:50%}}.mec-event-list-minimal .mec-event-article{border-bottom:1px solid #efefef;padding:24px 0 16px}.mec-event-list-minimal .mec-wrap .col-md-9{padding:0}.mec-event-list-minimal .mec-event-date{position:relative;float:left;margin-right:30px;color:#fff;width:52px;padding:6px 4px 3px;text-align:center;text-transform:uppercase;border-radius:3px}.mec-event-list-minimal .mec-event-date{min-width:52px;width:fit-content}.mec-event-list-minimal .mec-event-date:nth-child(2){margin:0 30px 0 -20px}.mec-event-list-minimal .mec-event-date span{display:block;font-size:24px;font-weight:700;text-align:center;margin-bottom:4px}.mec-event-list-minimal .mec-event-date:after{display:block;content:"";position:absolute;width:50px;left:1px;top:1px;height:34px;background:rgba(255,255,255,.1);box-shadow:0 4px 4px rgba(0,0,0,.02)}.mec-event-list-minimal .mec-event-date:after{width:100%}.mec-event-list-minimal .mec-event-title{margin-top:0;margin-bottom:10px;font-weight:700;font-size:18px;text-transform:uppercase;letter-spacing:0;padding-top:10px}.mec-event-list-minimal .mec-categories-wrapper,.mec-event-list-minimal .mec-event-detail,.mec-event-list-minimal .mec-price-details,.mec-event-list-minimal .mec-shortcode-organizers,.mec-event-list-minimal .mec-time-details{font-size:15px;font-weight:300;line-height:1;letter-spacing:0;color:#9a9a9a;margin-bottom:10px}.mec-event-list-minimal .btn-wrapper{text-align:right;padding-right:0;padding-top:6px;text-align:center}.mec-event-list-minimal .btn-wrapper .mec-detail-button{border-bottom:0;margin-bottom:14px;margin-right:0;box-shadow:none}.mec-event-list-minimal a.mec-detail-button{text-align:center;display:inline-block;background:#ededed;color:#191919;padding:12px;border-radius:2px;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:2px;transition:all .24s ease}.mec-event-list-minimal a.mec-detail-button:hover{background:#292929;color:#fff}.vc_col-sm-4 .mec-event-list-minimal .mec-event-date,.vc_col-sm-6 .mec-event-list-minimal .mec-event-date{margin-right:12px}.vc_col-sm-4 .mec-event-list-minimal .mec-event-title,.vc_col-sm-6 .mec-event-list-minimal .mec-event-title{font-size:15px;letter-spacing:2px}@media only screen and (min-width:480px) and (max-width:767px){.mec-event-list-minimal .btn-wrapper{padding-left:0}.mec-event-list-minimal .mec-event-date{margin-right:10px}}@media only screen and (max-width:767px){.mec-event-list-minimal .btn-wrapper .mec-detail-button{display:block;text-align:center;margin:0;margin-top:16px;padding:8px}.mec-event-list-minimal .btn-wrapper{margin:12px 0}}@media only screen and (max-width:479px){.mec-event-list-minimal .mec-event-date{float:none;width:160px;margin:8px auto}.mec-event-list-minimal .mec-event-date span{display:inline;padding-right:25px;margin-right:7px;font-size:inherit}.mec-event-list-minimal .mec-event-date:after{width:45%;box-shadow:4px 0 4px rgba(0,0,0,.02)}.mec-event-list-minimal .btn-wrapper{text-align:center;padding-left:0}.mec-event-list-minimal{text-align:center}.mec-event-list-minimal .mec-event-detail{margin-bottom:10px}}@media only screen and (min-width:479px){.mec-event-list-minimal .mec-event-article{display:flex;align-items:center;justify-content:space-between}}.mec-wrap .mec-event-list-modern .mec-event-title{margin-top:0;margin-bottom:10px}.mec-event-list-modern .mec-event-article{border-bottom:1px solid #efefef;padding:30px 0 10px}.mec-event-list-modern .mec-event-article:last-child{border-bottom:none}.mec-event-list-modern .mec-event-title a{color:#191919;transition:all .24s ease;box-shadow:none}.mec-event-list-modern .mec-event-date{text-transform:uppercase;padding:10px 0}.mec-event-list-modern .mec-event-date .event-d{font-size:48px;display:table-cell;padding:10px 0 0}.mec-event-list-modern .mec-event-date .event-d.mec-multiple-dates{font-size:20px;padding:0}.mec-event-list-modern .mec-event-date.mec-multiple-date-event:first-child{padding:10px 0 6px 0;position:relative;width:fit-content}.mec-event-list-modern .mec-event-date.mec-multiple-date-event:first-child:after{content:"";position:absolute;bottom:0;left:0;width:100%;height:1px;background:silver}.mec-event-list-modern .mec-event-date.mec-multiple-date-event:last-child{padding:5px 0 10px 0}.mec-event-list-modern .mec-event-date.mec-multiple-date-event .event-d{font-size:20px;padding:0}.mec-event-list-modern .mec-event-date.mec-multiple-date-event .event-da{font-size:20px;margin:0}.mec-event-list-modern .mec-event-date .event-f{font-size:13px;display:table-cell;vertical-align:middle;padding-left:7px;font-weight:500;letter-spacing:3px;color:#777}.mec-event-list-modern .mec-event-detail{font-weight:300;color:#8a8a8a}.mec-event-list-modern .mec-event-detail .mec-time-details{display:inline}.mec-event-list-modern .mec-event-date .event-da{margin-top:9px;color:silver;font-size:28px;font-weight:100;text-transform:uppercase;letter-spacing:-1px;text-align:left}.mec-event-list-modern .mec-btn-wrapper .mec-booking-button{border-radius:1px;letter-spacing:2px;border:1px solid #e6e6e6;color:#333;background-color:#fff;padding:13px 20px;font-weight:700;font-size:11px;box-shadow:0 2px 0 0 rgba(0,0,0,.016);transition:all .28s ease}.mec-event-list-modern .mec-btn-wrapper .mec-booking-button:hover{border-color:#222;background:#222;color:#fff}.mec-event-list-modern .mec-event-title{font-weight:700;font-size:20px;text-transform:uppercase;letter-spacing:1px}.mec-event-list-modern .mec-categories-wrapper,.mec-event-list-modern .mec-event-detail,.mec-event-list-modern .mec-price-details,.mec-event-list-modern .mec-shortcode-organizers{color:#9a9a9a;font-size:15px;font-weight:300;line-height:25px}.mec-event-list-modern .mec-btn-wrapper{text-align:right;padding:10px 0;text-transform:uppercase}.mec-event-list-modern .mec-event-sharing{position:relative;margin:10px 0;padding-left:0}.mec-event-list-modern .mec-event-sharing>li{display:inline-block;border:none;border-radius:50%;margin-right:10px;margin-bottom:5px}.mec-event-list-modern .mec-event-sharing>li:hover{display:inline-block}.mec-event-list-modern .mec-event-sharing>li:hover a i{color:#fff;background:#40d9f1;border-color:#40d9f1}.mec-event-list-modern .mec-event-sharing>li i{width:36px;display:inline-block;line-height:35px;color:#767676;text-align:center;border-radius:50%;border:1px solid #ddd;font-size:14px;margin-right:3px;transition:all ease .3s}.mec-event-list-modern .mec-event-sharing>li i svg{height:16px;vertical-align:middle}.mec-event-list-modern .mec-event-sharing>li .mec-social-title{color:#767676;font-size:14px}.mec-event-list-modern .mec-event-sharing .mec-event-share:hover .mec-event-sharing-icon{background:#40d9f1;border-color:#40d9f1;cursor:pointer;border-radius:50%}.mec-event-list-modern .mec-event-sharing li:hover a i{background:#40d9f1}@media only screen and (min-width:768px){.mec-event-list-modern .mec-event-article{position:relative;min-height:160px;overflow:visible}.mec-event-list-modern .col-md-2.col-sm-2{width:210px;position:absolute;left:0;top:20px;padding:0}.mec-event-list-modern .col-md-4.col-sm-4.mec-btn-wrapper{padding:0;position:absolute;right:0;top:30%}.mec-event-list-modern .col-md-6.col-sm-6{width:100%;padding-left:225px;padding-right:195px}}@media only screen and (max-width:767px){.mec-event-list-modern .mec-btn-wrapper .mec-booking-button{letter-spacing:1px;border:1px solid #e1e1e1}.mec-event-list-modern .mec-btn-wrapper{padding:0 0 12px}.mec-event-list-modern .mec-event-sharing{margin-bottom:0}.mec-event-list-modern .mec-event-sharing li{margin-bottom:7px}}.mec-event-grid-minimal .mec-event-article{margin:15px 0;min-height:80px;display:table}.mec-event-grid-minimal .event-detail-wrap{display:table-cell;vertical-align:middle}.mec-event-grid-minimal .mec-event-date{width:70px;float:left;margin-right:20px;padding:12px 16px 10px;text-align:center;text-transform:uppercase;border-radius:4px;border:1px solid #e6e6e6;transition:all .37s ease-in-out;box-shadow:0 2px 0 0 rgba(0,0,0,.016)}.mec-event-grid-minimal .mec-event-date span{display:block;font-size:24px;font-weight:700;text-align:center;margin-bottom:4px;color:#2a2a2a;transition:color .3s ease}.mec-event-grid-minimal .mec-event-title{margin-top:0;margin-bottom:10px;font-weight:700;line-height:21px;font-size:16px;text-transform:uppercase;transition:color .3s ease}.mec-event-grid-minimal .mec-event-title a{color:#191919;transition:color .3s ease}.mec-event-grid-minimal .mec-event-detail .mec-categories-wrapper,.mec-event-grid-minimal .mec-event-detail .mec-categories-wrapper ul.mec-categories li.mec-category a,.mec-event-grid-minimal .mec-event-detail .mec-event-loc-place,.mec-event-grid-minimal .mec-event-detail .mec-price-details,.mec-event-grid-minimal .mec-event-detail .mec-shortcode-organizers,.mec-event-grid-minimal .mec-time-details{font-size:15px;font-weight:300;line-height:1;letter-spacing:0;color:#9a9a9a;margin-bottom:10px}.mec-event-grid-minimal .mec-event-date:hover{color:#fff}.mec-event-grid-minimal .mec-event-date:hover span{color:#fff}.mec-wrap .mec-event-grid-minimal .mec-event-date:hover{color:#fff}.mec-event-list-classic .mec-event-article{padding:12px 0;margin-bottom:20px}.mec-event-list-classic .mec-event-image{float:left;width:86px;margin-right:20px}.mec-event-list-classic .mec-event-date,.mec-event-list-classic .mec-event-time{font-weight:400;font-size:13px;letter-spacing:0;line-height:18px;text-align:left;display:initial;margin-right:12px}.mec-event-list-classic .mec-event-time .mec-time-details,.mec-event-list-classic .mec-event-time i{display:inline;margin-right:3px}.mec-event-list-classic .mec-event-date span{font-weight:500;margin-bottom:6px}.mec-event-list-classic .mec-event-title{font-size:15px;margin:10px 0 12px;font-weight:700;text-transform:uppercase}.mec-event-list-classic .mec-event-title a{color:#494949;transition:color .3s ease}.mec-event-list-classic .mec-event-detail,.mec-event-list-classic .mec-price-details{color:#777;font-weight:400;line-height:12px;font-size:12px;overflow:hidden}@media only screen and (max-width:480px){.mec-event-list-classic .mec-event-detail{float:right;width:calc(100% - 104px)}}.mec-event-list-classic a.magicmore{padding:10px 16px;color:#fff;background:#222;letter-spacing:2px;font-size:11px}.mec-event-list-classic a.magicmore:after{content:"";display:none}.mec-event-list-classic a.magicmore:hover{color:#40d9f1}.mec-event-grid-simple .mec-event-article{position:relative;margin-bottom:30px}.mec-event-grid-simple .mec-event-article:after{border-right:1px solid #e6e6e6;height:60px;position:absolute;top:50%;margin-top:-30px;right:-1px}.mec-event-grid-simple .row div:last-child .mec-event-article:after{border:none}.mec-event-grid-simple .row{margin:15px 0 30px;text-align:center}.mec-event-grid-simple .mec-event-date{padding:0;margin:0;text-transform:capitalize;font-size:12px;font-weight:700}.mec-event-grid-simple .mec-event-title{margin-top:0;margin-bottom:10px;font-weight:700;line-height:21px;font-size:15px;padding-top:5px;padding-left:5px;padding-right:5px;text-transform:uppercase;transition:color .37s ease}.mec-event-grid-simple .mec-event-title a{color:#494949;transition:color .3s ease}.mec-event-grid-simple .mec-event-detail{font-weight:400;line-height:1;letter-spacing:0;font-size:13px;color:#777}.mec-event-grid-simple .mec-event-detail .mec-time-details{margin-top:7px}.mec-event-grid-simple .mec-event-title:hover{color:#40d9f1}.mec-event-grid-simple .mec-event-date:hover{background:0 0}.event-last:after{display:none}@media only screen and (max-width:767px){.mec-event-grid-simple .mec-event-article{padding-bottom:20px;margin-bottom:20px;border-bottom:1px solid #eee}.mec-event-grid-simple .mec-event-article:after{border:none}}.mec-event-grid-novel .mec-event-article{position:relative;margin-bottom:30px;padding:60px 5% 60px 7%;border:1px solid rgba(255,255,255,.12);border-radius:10px;background-color:#0050fd;-webkit-transition:all .3s ease;-o-transition:all .3s ease;transition:all .3s ease;z-index:1}.mec-event-grid-novel .mec-event-article .novel-grad-bg{position:absolute;top:0;left:0;width:100%;height:100%;border-radius:10px;opacity:0;z-index:-1;-webkit-transition:all .3s ease;-o-transition:all .3s ease;transition:all .3s ease}.mec-event-grid-novel .mec-event-article:hover{-webkit-box-shadow:0 13px 36px 0 rgba(0,0,0,.23);box-shadow:0 13px 36px 0 rgba(0,0,0,.23);border-color:transparent}.mec-event-grid-novel .mec-event-article:hover .novel-grad-bg{background-image:-webkit-gradient(linear,left top,right top,from(#262e32),to(#0e1015));background-image:-webkit-linear-gradient(left,#262e32 0,#0e1015 100%);background-image:-o-linear-gradient(left,#262e32 0,#0e1015 100%);background-image:linear-gradient(90deg,#262e32 0,#0e1015 100%);opacity:1}.mec-event-grid-novel .mec-event-image{float:left;width:150px;height:150px}.mec-event-grid-novel .mec-event-image img{width:150px;height:150px;border-radius:50%}.mec-event-grid-novel .mec-event-detail-wrap{margin-left:200px}.mec-event-grid-novel .mec-event-content h4{position:relative;margin-bottom:10px;display:inline-block}.mec-event-grid-novel .mec-event-content h4 a{font-size:24px;line-height:35px;color:#fafcff}.mec-event-grid-novel .mec-event-content h4.mec-gCalendar-search-text-wrap input[type=text]:before{content:"";position:absolute;top:8px;left:-30px;width:17px;height:17px;background:#5cd0ed;opacity:.4;border-radius:50%;padding-right:5px}.mec-skin-grid-container .mec-event-grid-novel .mec-categories li a{color:#fff}.mec-event-grid-novel .mec-event-address,.mec-event-grid-novel .mec-event-detail,.mec-event-grid-novel .mec-event-month,.mec-event-grid-novel .mec-local-time-details{position:relative;padding-left:35px;font-size:15px;line-height:30px;color:rgba(255,255,255,.4)}.mec-event-grid-novel .mec-price-details{position:relative;padding-left:7px;font-size:15px;line-height:30px;color:rgba(255,255,255,.4)}.mec-event-grid-novel .mec-price-details i{margin-right:8px}.mec-event-grid-novel .mec-categories-wrapper::before,.mec-event-grid-novel .mec-event-address::before,.mec-event-grid-novel .mec-event-detail::before,.mec-event-grid-novel .mec-event-month::before,.mec-event-grid-novel .mec-local-time-details:before{position:absolute;top:6px;left:6px;font-size:17px;font-family:simple-line-icons;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1}.mec-event-grid-novel .mec-local-time-details::before{content:"\e007"}.mec-event-grid-novel .mec-event-month::before{content:"\e075"}.mec-event-grid-novel .mec-event-detail::before{content:"\e081"}.mec-event-grid-novel .mec-event-address::before{content:"\e096"}.mec-event-grid-novel .mec-categories-wrapper::before{content:"\e089"}.mec-event-grid-novel .mec-event-footer{clear:both;padding:20px 0;border-top:none;background:0 0}.mec-event-grid-novel .mec-event-footer .mec-booking-button{right:0;left:auto;height:38px;width:148px;padding:0 20px;font-size:14px;font-weight:400;line-height:38px;text-align:center;color:#fff;background:0 0;border-color:rgba(255,255,255,.1);border-radius:50px}.mec-event-grid-novel .mec-event-footer .mec-booking-button:hover{background-color:rgba(255,255,255,.1)}.mec-event-grid-novel .mec-event-sharing-wrap{left:0;cursor:pointer;padding-left:0}.mec-event-grid-novel .mec-event-sharing-wrap>li{border-color:rgba(255,255,255,.1);border-radius:50%}.mec-event-grid-novel .mec-event-sharing-wrap li.mec-event-share{position:absolute;z-index:2}.mec-event-grid-novel .mec-event-sharing-wrap .mec-event-sharing{top:-6px;left:0;padding:5px 10px 2px 50px;min-width:150px;width:inherit;height:38px;background-color:rgba(255,255,255,.1);-webkit-box-shadow:none;box-shadow:none;border:none;border-radius:50px;backdrop-filter:blur(10px)}.mec-event-grid-novel .mec-event-sharing-wrap:hover>li{background-color:rgba(255,255,255,.1)}.mec-event-grid-novel .mec-event-sharing-wrap .mec-event-sharing::after,.mec-event-grid-novel .mec-event-sharing-wrap .mec-event-sharing::before{display:none}.mec-event-grid-novel .mec-event-sharing .mec-event-social-icon,.mec-event-grid-novel .mec-event-sharing .mec-event-social-icon a,.mec-event-grid-novel .mec-event-sharing-wrap .mec-event-sharing li i{display:inline}.mec-event-grid-novel .mec-event-sharing .mec-event-social-icon a{padding:0 10px}.mec-event-grid-novel .mec-event-sharing-wrap>li a{color:#fff}.mec-event-grid-novel .mec-event-sharing-wrap .mec-event-sharing li a{color:rgba(255,255,255,.4)}.mec-event-grid-novel .mec-event-sharing-wrap .mec-event-sharing li a:hover{color:#fff}.mec-event-grid-novel .mec-event-sharing-wrap li.mec-event-social-icon{margin:0;width:auto}.mec-event-grid-novel .mec-event-sharing-wrap .mec-event-sharing{display:flex;align-items:center;padding-top:0}.mec-event-grid-novel .mec-event-sharing-wrap .mec-event-sharing li a{display:flex;align-items:center;width:31px}.mec-event-grid-novel .mec-event-sharing-wrap li.mec-event-social-icon a i{width:auto;height:auto}.mec-event-grid-novel .mec-event-sharing-wrap li.mec-event-social-icon a svg{fill:rgba(255,255,255,0.4);padding:0;width:36px;height:36px;border-radius:0;margin:0}@media only screen and (max-width:1200px){.mec-event-grid-novel .row .col-md-6.col-sm-6{width:100%;float:none}.mec-event-grid-novel .mec-event-image{float:none;margin-top:-20px;margin-bottom:20px}.mec-event-grid-novel .mec-event-detail-wrap{margin-left:20px}.mec-event-grid-novel .mec-event-footer{margin-top:30px}}@media only screen and (max-width:767px){.mec-event-grid-novel .mec-event-footer{margin-top:0;padding-top:30px;margin-bottom:24px}.mec-event-grid-novel .mec-event-footer .mec-booking-button{display:block;position:relative}.mec-event-grid-novel .mec-event-sharing-wrap{left:0;bottom:-55px;padding-left:0}.mec-event-grid-novel .mec-event-content h4 a{font-size:20px;line-height:1.3}}.mec-event-grid-novel .mec-event-sharing-wrap{padding-left:0}.mec-event-grid-novel .mec-event-sharing-wrap .mec-event-sharing{width:fit-content;z-index:1}@media (min-width:1280px){.mec-event-grid-novel .col-md-4.col-sm-4 .mec-event-article img{width:100px;height:100px}.mec-event-grid-novel .col-md-4.col-sm-4 .mec-event-detail-wrap{margin-left:150px}.mec-event-grid-novel .col-md-3.col-sm-3 .mec-event-content .mec-event-detail-wrap,.mec-event-grid-novel .col-md-3.col-sm-3 .mec-event-content .mec-event-image{width:100%}.mec-event-grid-novel .col-md-3.col-sm-3 .mec-event-content .mec-event-detail-wrap{margin-left:20px}}@media (min-width:760px) and (max-width:1024px){.mec-event-grid-novel .col-md-4.col-sm-4{width:100%}.mec-event-grid-novel .mec-event-image{float:left}.mec-event-grid-novel .col-md-4.col-sm-4 .mec-event-article img{width:100px;height:100px}}.mec-event-cover-modern{position:relative}.mec-event-cover-modern .mec-event-cover-a{background:0 0;position:absolute;color:#fff;bottom:0;left:0;text-decoration:none}.mec-event-cover-modern .mec-event-cover-a .mec-event-overlay{transition:all .5s;opacity:.8;width:100%;height:100%;position:absolute}.mec-event-cover-modern .mec-event-cover-a:hover .mec-event-overlay{opacity:1}.mec-event-cover-modern .mec-event-detail{padding:40px;position:relative}.mec-event-cover-modern .mec-event-cover-a:hover .mec-event-tag{color:#333;transition:all .5s}.mec-event-cover-modern .mec-event-cover-a .mec-event-title:hover{text-decoration:underline}.mec-event-cover-modern .mec-event-tag{background:#fff;display:inline-block;padding:5px 9px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:1px;margin-bottom:24px}.mec-event-cover-modern .mec-event-date{text-transform:uppercase;font-size:17px;font-weight:300}.mec-event-cover-modern .mec-event-title{color:#fff;text-transform:uppercase;font-size:40px;font-weight:700;margin:6px 0}.mec-event-cover-modern .mec-event-place{font-weight:400;font-size:18px}@media only screen and (max-width:767px){.mec-event-cover-modern .mec-event-cover-a{width:100%}}.mec-event-cover-classic{position:relative;overflow:hidden;background:#fff;padding:6px;border:1px solid #e8e8e8}.mec-event-cover-classic .mec-event-overlay{position:absolute;left:6px;right:6px;bottom:6px;top:6px;width:auto;height:auto;background-color:rgba(36,36,36,.4);transition:all .33s ease-in-out}.mec-event-cover-classic:hover .mec-event-overlay{background-color:rgba(36,36,36,.6)}.mec-event-cover-classic .mec-event-content{font-size:15px;color:#fff;position:absolute;bottom:0;padding:50px 35px;transition:all .33s ease-in-out}.mec-event-cover-classic .mec-event-date{font-size:14px;text-transform:uppercase;font-weight:400;line-height:1.6;text-align:left}.mec-event-cover-classic .mec-event-date span{display:block;font-weight:700;font-size:16px}.mec-event-cover-classic .mec-event-title{color:#fff;margin:20px 0 38px;font-size:24px;font-weight:700;text-transform:uppercase;font-style:normal}.mec-event-cover-classic .mec-btn-wrapper{text-align:left}.mec-event-cover-classic .mec-event-icon{font-size:18px;float:left;margin-right:14px;color:#fff;padding:13px}.mec-event-cover-classic .mec-event-button{color:#fff;background-color:#191919;border:2px #191919 solid;padding:12px 20px;letter-spacing:3px;font-size:12px;font-weight:700;font-style:normal;transition:all .22s ease;text-decoration:none}.mec-event-cover-classic .mec-event-button:hover{color:#191919;background-color:#fff;border-color:#fff;border-radius:1px}.mec-event-cover-classic .mec-event-image img{min-width:100%}@media only screen and (max-width:960px){.mec-event-cover-classic .mec-event-content{padding:20px}.mec-event-cover-classic .mec-event-button{font-size:11px;padding:7px 10px;letter-spacing:1px}.mec-event-cover-classic .mec-event-title{font-size:19px;margin:15px 0 25px}.mec-event-cover-classic .mec-event-date{font-size:12px}}@media only screen and (max-width:767px){.mec-event-cover-classic{margin-bottom:30px}}@media only screen and (max-width:479px){.mec-event-cover-classic .mec-event-content{padding:15px;font-size:15px}.mec-event-cover-classic .mec-event-title{font-size:15px;margin:10px 0}.mec-event-cover-classic .mec-event-button{font-size:10px;padding:6px;letter-spacing:1px}.mec-event-cover-classic .mec-event-icon{padding:10px}}.mec-load-more-wrap{text-align:center;display:block;width:100%;padding-top:20px;text-align:center;position:relative}.mec-load-more-button{box-shadow:none;transition:all .21s ease;font-size:12px;font-weight:500;letter-spacing:1px;text-transform:uppercase;background:#fff;color:#767676;border:2px solid #e8e8e8;border-radius:50px;padding:0 28px;margin-bottom:20px;cursor:pointer;line-height:40px;height:42px;display:inline-block}.mec-load-more-button:hover{background:#191919;color:#fff;border-color:#191919}.mec-load-more-loading{content:url("../img/ajax-loader.gif");cursor:wait;background:0 0;border-style:none}.mec-load-more-loading:hover{background:0 0}.mec-modal-preloader,.mec-month-navigator-loading{width:100%;height:100%;background:no-repeat rgba(255,255,255,.88) url("../img/ajax-loader.gif") center;border-style:none;position:absolute;left:0;right:0;bottom:0;top:0;z-index:9}.mec-event-calendar-classic .mec-calendar-side .mec-calendar-table{min-height:1024px}.mec-calendar-side .mec-calendar-table{min-height:450px}.mec-skin-weekly-view-events-container.mec-month-navigator-loading{margin-top:0}.mec-calendar.mec-event-calendar-classic .mec-calendar-side{display:block}.mec-skin-daily-view-events-container.mec-month-navigator-loading{margin-top:0}@media only screen and (min-width:961px){.mec-wrap.mec-sm959 .mec-calendar-side .mec-calendar-table{min-height:1px}}@media only screen and (max-width:479px){.mec-calendar-side .mec-calendar-table{min-height:1px}}.mec-event-cover-clean{position:relative;border:1px solid #e6e6e6;padding:8px}.mec-event-cover-clean .mec-event-overlay{height:100%;background-color:rgba(36,36,36,.4);position:absolute;width:100%;left:0;border:8px solid #fff;top:0;transition:all .5s ease-in-out}.mec-event-cover-clean .mec-event-content{color:#fff;position:absolute;bottom:20px;padding:40px 60px;transition:all .5s ease-in-out}.mec-event-cover-clean .mec-event-title{color:#fff;font-weight:700;margin:46px 0 19px;font-size:29px;text-transform:uppercase;text-shadow:0 0 1px rgba(0,0,0,.5)}.mec-event-cover-clean .mec-event-title a{color:#fff;transition:all .5s;text-decoration:none;outline:0;border:none;box-shadow:none}.mec-event-cover-clean .mec-event-title a:hover{text-decoration:underline}.mec-event-cover-clean .mec-event-date{position:absolute;top:-20px;right:60px;color:#fff;width:60px;padding:14px 10px;z-index:1}.mec-event-cover-clean .mec-event-date div{text-align:center;text-transform:uppercase;letter-spacing:1px;line-height:16px}.mec-event-cover-clean .mec-event-date .dday{padding-bottom:15px;border-bottom:1px solid rgba(255,255,255,.5);margin-bottom:13px;font-size:24px}.mec-event-cover-clean .mec-event-date .dmonth{letter-spacing:2px}.mec-event-cover-clean .mec-event-place{font-size:18px}.mec-event-cover-clean .mec-event-image img{width:100%}@media only screen and (max-width:768px){.mec-event-cover-clean .mec-event-content{padding:20px;bottom:5px}.mec-event-cover-clean .mec-event-title{font-size:23px}.mec-event-cover-clean .mec-event-date{right:20px;padding:10px;width:50px}}@media only screen and (max-width:479px){.mec-event-cover-clean .mec-event-content{padding:10px}.mec-event-cover-clean .mec-event-title{font-size:19px;padding-right:25px}.mec-event-cover-clean .mec-event-date{right:-20px;top:-10px}.mec-event-cover-clean .mec-event-detail{font-size:12px}}.mec-month-divider{text-align:center;margin:60px 0 40px 0}.widget .mec-month-divider{margin:10px 0}.mec-month-divider span{text-transform:uppercase;font-size:22px;font-weight:700;padding-bottom:5px;color:#313131;border-bottom:4px solid #ebebeb;width:100%;display:block;padding-bottom:10px;position:relative}.mec-month-divider span:before{border-bottom:4px solid #40d9f1;font-size:6px;content:"";text-align:center;position:absolute;bottom:-4px;margin-left:-30px;left:50%;width:60px}.widget .mec-month-divider span{font-size:13px}.mec-event-list-standard .mec-events-pagination{margin-top:60px;border-top:4px solid #ebebeb;min-height:80px;padding-top:20px}.mec-event-list-standard .mec-events-pagination .mec-events-pag-previous{float:left;margin-left:0}.mec-event-list-standard .mec-events-pagination .mec-events-pag-next{float:right;margin-right:0}.mec-event-list-standard .mec-event-article{position:relative;display:block;margin-bottom:25px;background-color:#fff;border:1px solid #e9e9e9;box-shadow:0 2px 0 0 rgba(0,0,0,.016)}.mec-event-list-standard .mec-topsec{display:table;width:100%}.mec-event-list-standard .col-md-3.mec-event-image-wrap{padding-left:0}.mec-event-list-standard .mec-event-content{padding-top:15px;padding-right:30px}.mec-event-list-standard ul.mec-event-status-icons{list-style:none;padding:0;margin-bottom:10px}.mec-event-list-standard ul.mec-event-status-icons li{display:inline-flex;align-items:inherit;justify-content:center;font-size:12px;font-weight:400;line-height:16px;border-radius:5px;padding:2px 5px;margin-right:10px}.mec-event-list-standard ul.mec-event-status-icons li img{margin-right:5px}.mec-event-list-standard ul.mec-event-status-icons li.mec-event-status-scheduled{color:#58aa22;background:#e9f8d7}.mec-event-list-standard ul.mec-event-status-icons li.mec-event-status-ongoing{color:#1aa82a;background:#e4f6df}.mec-event-list-standard ul.mec-event-status-icons li.mec-event-status-postponed{color:#a1830d;background:#fff3b7}.mec-event-list-standard ul.mec-event-status-icons li.mec-event-status-cancelled{color:#bb1313;background:#fed8d8}.mec-event-list-standard ul.mec-event-status-icons li.mec-event-status-movedonline{color:#f35e04;background:#feebd7}.mec-event-list-standard .mec-event-title{font-size:29px;font-weight:600;letter-spacing:-1px;margin:0 0 10px}.mec-event-list-standard .mec-event-title a{color:#292929;text-decoration:none;transition:color .3s ease}.mec-event-list-standard .mec-col-table-c{display:table-cell;height:100%;vertical-align:middle;float:none!important}.mec-event-list-standard .mec-col-table-c.mec-event-meta-wrap{padding:20px}.mec-event-list-standard .mec-col-table-c.mec-event-image-wrap{vertical-align:top}.mec-topsec .mec-event-image{line-height:1px}.mec-topsec .mec-event-image a{display:block}.mec-event-list-standard .mec-event-meta-wrap{border-left:1px solid #eee}.mec-event-list-standard .mec-time-details{text-transform:uppercase;font-size:12px;font-weight:400;line-height:17px;color:#707070;padding-top:0;text-align:left}.mec-event-list-standard .mec-event-meta .mec-venue-details span{font-size:12px;font-weight:400;line-height:17px;color:#707070;padding-top:0;text-align:left}.mec-event-list-standard .mec-event-meta .mec-venue-details .mec-event-address span{font-style:normal;letter-spacing:0;font-size:12px;font-weight:400;color:#707172;margin-left:29px}.mec-event-list-standard .mec-event-meta span.mec-event-d,.mec-event-list-standard .mec-event-meta span.mec-event-m{font-size:13px;font-weight:600;line-height:17px;padding-right:6px;color:#414243;text-transform:uppercase}.mec-event-list-standard .mec-event-meta .mec-time-details .mec-end-time,.mec-event-list-standard .mec-event-meta .mec-time-details .mec-start-time,.mec-event-list-standard .mec-event-meta .mec-venue-details span,.mec-event-list-standard .mec-event-meta span.mec-event-d .mec-start-date-label{vertical-align:middle}.mec-event-list-standard .mec-event-meta svg{vertical-align:middle;margin-right:12px;width:20px;height:20px}.mec-event-list-standard .mec-categories-wrapper,.mec-event-list-standard .mec-date-details,.mec-event-list-standard .mec-local-time-details,.mec-event-list-standard .mec-shortcode-organizers,.mec-event-list-standard .mec-time-details,.mec-event-list-standard .mec-venue-details{position:relative;margin-bottom:10px}.mec-event-list-standard .mec-local-time-details .mec-local-title{font-size:13px;font-weight:400;line-height:17px;color:#414243;margin-left:-3px}.mec-event-list-standard .mec-local-time-details .mec-local-date,.mec-event-list-standard .mec-local-time-details .mec-local-time{font-style:normal;letter-spacing:0;font-size:11px;color:#8a8a8a;font-weight:300;line-height:1.6;margin-left:29px}.mec-event-list-standard .mec-categories-wrapper i,.mec-event-list-standard .mec-date-details i,.mec-event-list-standard .mec-shortcode-organizers i{margin-right:12px}.mec-event-list-standard .mec-categories-wrapper i:before,.mec-event-list-standard .mec-event-meta-wrap .mec-event-meta .mec-price-details i:before{font-size:16px}.mec-event-list-standard .mec-event-title .mec-labels-normal{line-height:18px;height:18px;display:inline-block;vertical-align:middle}.mec-event-list-standard .mec-event-title .mec-labels-normal .mec-label-normal{vertical-align:bottom}.mec-event-list-standard .mec-event-description{font-size:14px}.mec-event-list-minimal .mec-event-title a{color:#292929;transition:color .3s ease}.mec-event-meta-wrap .mec-price-details{margin-bottom:10px}.mec-price-details i{margin-right:4px;line-height:16px}.mec-event-meta-wrap .mec-event-meta .mec-price-details i:before{font-size:15px}.mec-event-list-standard .mec-price-details{font-size:12px;font-weight:400;line-height:17px;color:#707070;padding-top:0;text-align:left}.mec-event-list-standard .mec-price-details i{margin-right:10px}.mec-month-side .mec-price-details{margin-left:2px}.mec-month-side .mec-price-details i,.tooltipster-sidetip.tooltipster-shadow:not(.uael-tooltipster-active) .tooltipster-content .mec-price-details i{padding-top:4px;vertical-align:unset}.mec-event-list-standard ul.mec-categories{position:relative;margin-bottom:10px}@media only screen and (max-width:960px){.mec-event-list-standard .mec-topsec{display:block}.mec-event-list-standard .mec-col-table-c.mec-event-image-wrap{display:block;width:40%}.mec-event-list-standard .mec-col-table-c.mec-event-content-wrap{display:block;min-height:230px}.mec-event-list-standard .mec-event-meta-wrap{display:block;border-left:none;border-top:1px solid #eee;width:100%;float:none;padding-top:20px}}@media only screen and (min-width:480px) and (max-width:960px){.mec-event-list-standard .mec-col-table-c.mec-event-content-wrap,.mec-event-list-standard .mec-col-table-c.mec-event-image-wrap{display:table-cell}}@media only screen and (max-width:479px){.mec-event-list-standard .mec-col-table-c.mec-event-image-wrap,.mec-event-list-standard .mec-col-table-c.mec-event-image-wrap img{float:none;width:100%;padding:0}.mec-event-list-standard .mec-col-table-c.mec-event-content-wrap{padding:10px 10px 10px 30px}}.mec-localtime-details{color:#777;font-weight:400;line-height:12px;font-size:12px}.mec-localtime-details .mec-localdate,.mec-localtime-details .mec-localtime,.mec-localtime-details .mec-localtitle{display:inline-block}.mec-localtime-details .mec-start-date-label{padding-right:5px}.mec-localtime-details .mec-localtime{padding-left:5px}.mec-event-list-minimal .mec-localtime-details{display:inline-flex;font-size:15px;font-weight:300;line-height:1;letter-spacing:0;color:#9a9a9a;padding-left:9px}.mec-event-grid-classic .mec-localtime-details,.mec-event-grid-clean .mec-localtime-details{color:#fff;font-weight:400;font-size:11px;text-transform:uppercase;letter-spacing:-.02em;color:#fff;padding:0 0;line-height:18px;margin-top:-3px}.mec-event-grid-clean .mec-localtime-details,.mec-event-grid-colorful .mec-localtime-details,.tooltipster-box .mec-localtime-details{line-height:22px;padding-top:10px}.mec-event-grid-colorful .mec-localtime-details{color:#fff}.mec-event-grid-classic .mec-localtime-details{text-align:center}.mec-event-grid-minimal .mec-localtime-details{line-height:22px}.mec-wrap .mec-yearly-view-wrap .mec-localtime-wrap i{display:inline-block;margin-left:-1px}.mec-timetable-t2-content .mec-local-time-details{padding-left:19px}.mec-timetable-t2-content .mec-local-time-details{position:relative}.mec-timetable-t2-content .mec-local-time-details:before{content:"\e007";font-family:simple-line-icons;position:absolute;font-size:12px;margin-right:4px;left:0}.mec-masonry .mec-masonry-col6 .mec-localtime-details{margin-top:10px;line-height:21px}.mec-masonry .mec-masonry-col6 .mec-localtime-details i{height:auto}.mec-event-cover-classic .mec-localtime-details{color:#fff;margin-top:12px}.mec-event-cover-classic .mec-localtime-details i{padding-right:8px}.mec-event-cover-clean .mec-localtime-details{color:#fff;margin-bottom:20px}.mec-event-cover-modern .mec-localtime-details{color:#fff;margin:10px 0;font-weight:400;font-size:18px}.mec-event-countdown-style1 .mec-localtime-details,.mec-event-countdown-style2 .mec-localtime-details,.mec-event-countdown-style3 .mec-localtime-details{color:#fff;padding:8px 5px 0;font-size:14px;line-height:25px}.mec-event-countdown-style1 .mec-localtime-details{text-align:center}.mec-event-hover-carousel-type4 .mec-localtime-details{display:block;color:#fff;font-size:11px}.mec-event-footer-carousel-type3 .mec-localtime-details .mec-localdate,.mec-event-footer-carousel-type3 .mec-localtime-details .mec-localtime,.mec-event-footer-carousel-type3 .mec-localtime-details .mec-localtitle,.mec-event-footer-carousel-type3 .mec-localtime-details span{display:inline-flex;line-height:20px;text-align:left;margin:0!important;font-size:12px;color:#777;line-height:28px}.mec-owl-crousel-skin-type1 .mec-localtime-details{margin-top:-7px;margin-bottom:12px}.mec-wrap .mec-slider-t5 .mec-localtime-details{margin-top:14px;line-height:20px}.mec-wrap .mec-slider-t5 .mec-localtime-details i{font-size:18px;height:20px}.mec-timeline-event-local-time .mec-localtime-details{font-size:13px;font-weight:500;vertical-align:middle;margin-left:6px;color:inherit;line-height:24px}.mec-timeline-event-local-time .mec-localtime-details i{font-size:17px;vertical-align:middle;margin-left:-7px;padding-right:3px}.mec-booking-modal{background-color:#e6f7ff}.mec-booking-modal .mec-booking-shortcode .mec-book-form-gateway-label input[type=radio]:before{top:-1px}.mec-modal-booking-button{box-shadow:none;transition:all .21s ease;font-size:11px;font-weight:500;letter-spacing:1px;text-transform:uppercase;background:#fff;color:#767676;border:1px solid #e8e8e8;padding:12px 16px;line-height:37px;height:38px;margin:12px 0}.mec-modal-booking-button:hover{background:#191919;color:#fff;border-color:#191919}.mec-modal-booking-button.mec-mb-icon i{font-size:14px}.mec-event-list-classic .mec-modal-booking-button{height:0;line-height:1;margin:7px 0 0;display:inline-table;letter-spacing:0;padding:12px 14px}.mec-event-grid-novel .mec-categories-wrapper{position:relative;color:rgba(255,255,255,.4);padding-left:35px}.mec-event-grid-novel ul.mec-categories{line-height:30px;font-size:15px}.mec-event-grid-novel .mec-categories-wrapper i{display:none}.mec-event-grid-novel ul.mec-categories li.mec-category a{color:rgba(255,255,255,.4);line-height:30px;font-size:15px}.mec-event-grid-novel ul.mec-organizers li.mec-organizer-item span{padding-left:35px;color:rgba(255,255,255,.4);line-height:30px;font-size:15px}.mec-calendar-events-side .mec-modal-booking-button,.mec-event-container-classic .mec-modal-booking-button,.mec-event-grid-minimal .mec-modal-booking-button,.mec-event-list-minimal .mec-modal-booking-button,.mec-timetable-t2-col .mec-modal-booking-button{margin:0;color:#282828;font-size:12px;transition:all .5s ease;-webkit-transition:all .5s ease;position:relative;padding:0 0 0 24px;background:0 0;text-align:left;display:inline;border:0;font-weight:700}.mec-timetable-t2-col .mec-modal-booking-button{color:#fff;padding-left:19px}.mec-timetable-t2-col .mec-modal-booking-button:hover{color:#282828}.mec-event-list-minimal .mec-modal-booking-button{margin:0 4px 0 84px}.mec-calendar-events-side .mec-modal-booking-button:before,.mec-event-container-classic .mec-modal-booking-button:before,.mec-event-grid-minimal .mec-modal-booking-button:before,.mec-event-list-minimal .mec-modal-booking-button:before{content:"";position:absolute;background:#7a7272;width:18px;height:1px;left:0;top:45%;transition:all .1s ease;-webkit-transition:all .1s ease}.mec-skin-carousel-container .mec-modal-booking-button{line-height:70px}.mec-event-list-modern .mec-modal-booking-button.mec-mb-icon{border-radius:1px;letter-spacing:2px;border:1px solid #e6e6e6;color:#333;background-color:#fff;padding:13px 12px 13px 14px;font-weight:700;box-shadow:0 2px 0 0 rgba(0,0,0,.016);transition:all .28s ease;line-height:unset}.mec-event-list-modern .mec-modal-booking-button.mec-mb-icon:hover{border-color:#222;background:#222;color:#fff}.mec-event-footer .mec-modal-booking-button{position:absolute;top:20px;right:125px;margin:0;padding:0 16px;line-height:37px;border-radius:2px;margin-right:5px}.mec-skin-carousel-container .mec-event-footer-carousel-type2 .mec-modal-booking-button{font-size:12px;line-height:17px;height:41px}.mec-skin-carousel-container .mec-event-footer-carousel-type3 .mec-modal-booking-button{line-height:36px;font-size:12px;padding:0 10px;letter-spacing:0;float:right;margin:0 5px 0 0;height:unset}.mec-skin-carousel-container .mec-owl-crousel-skin-type4 .mec-modal-booking-button{color:#fff;background-color:#191919;border:2px #191919 solid;padding:10px 14px;letter-spacing:1.5px;font-size:11px;font-weight:700;font-style:normal;transition:all .22s ease;text-decoration:none;margin:0 0 0 12px}.mec-skin-carousel-container .mec-owl-crousel-skin-type4 .mec-modal-booking-button:hover{color:#191919;background-color:#fff;border:2px #fff solid}.mec-event-grid-modern .mec-event-footer .mec-modal-booking-button{right:auto;left:110px}.mec-event-grid-simple .mec-modal-booking-button,.mec-events-agenda .mec-modal-booking-button{margin:0;font-size:12px;transition:all .5s ease;-webkit-transition:all .5s ease;position:relative;padding:0;background:0 0;text-align:left;display:inline;border:0;font-weight:700}.mec-events-agenda .mec-modal-booking-button{display:block;height:unset;padding-left:173px;line-height:14px;margin-bottom:7px}.mec-yearly-view-wrap .mec-modal-booking-button{margin:0;padding-left:14px;text-transform:capitalize}.mec-event-grid-novel .mec-event-footer .mec-modal-booking-button.mec-mb-icon{right:auto;left:50px;width:36px;height:36px;display:table-cell;vertical-align:middle;padding:0 10px;border-color:rgba(255,255,255,.1);background-color:rgba(0,0,0,0);color:#fff;border-radius:36px}.mec-event-grid-novel .mec-event-footer .mec-modal-booking-button.mec-mb-icon:hover{background-color:rgba(255,255,255,.1)}.mec-event-grid-simple .mec-modal-booking-button:hover,.mec-events-agenda .mec-modal-booking-button:hover,.mec-events-yearlu .mec-modal-booking-button:hover{color:#191919}.mec-event-masonry .mec-event-footer .mec-modal-booking-button{font-size:12px;padding:0 31px;line-height:49px;height:50px;top:0;box-shadow:0 5px 11px -3px rgba(0,0,0,.05);right:auto;left:155px}.mec-timeline-event .mec-modal-booking-button{position:absolute;top:0;right:0;display:inline-block;padding:7px 20px 7px;line-height:22px;height:unset;border:unset;text-transform:capitalize;font-weight:500;font-size:13px;letter-spacing:0;margin:0;border-radius:0 0 0 10px}.mec-timeline-event .mec-modal-booking-button:hover{background:#191919;color:#fff}.mec-skin-daily-view-events-container .mec-modal-booking-button,.mec-weekly-view-dates-events .mec-event-article .mec-modal-booking-button{position:absolute;top:50%;transform:translateY(-50%);right:15px;line-height:26px;height:49px;border:unset;text-align:center;display:inline-block;background:#ededed;color:#191919;padding:12px;border-radius:2px;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:2px;transition:all .24s ease;margin:0}.mec-skin-daily-view-events-container .mec-modal-booking-button:hover,.mec-weekly-view-dates-events .mec-event-article .mec-modal-booking-button:hover{background:#292929;color:#fff}@media (max-width:1023px){.mec-skin-daily-view-events-container .mec-modal-booking-button,.mec-weekly-view-dates-events .mec-event-article .mec-modal-booking-button{position:relative;top:unset;transform:unset;margin:14px 16px 0;padding:8px;line-height:20px;height:35px}}@media (max-width:768px){.featherlight .featherlight-inner{width:100%}.mec-events-agenda .mec-modal-booking-button{padding:0}}@media (max-width:480px){.mec-booking-modal .mec-events-meta-group-booking-shortcode{padding:20px}.mec-booking-modal .mec-booking-shortcode .mec-book-reg-field-mec_email,.mec-booking-modal .mec-booking-shortcode .mec-book-reg-field-name{width:100%}.mec-booking-modal .mec-booking-shortcode button#mec-book-form-btn-step-2{margin-left:20px}.mec-booking-modal .mec-booking-shortcode .mec-click-pay button[type=submit]{bottom:22px}.mec-calendar-events-side .mec-modal-booking-button:before,.mec-event-container-classic .mec-modal-booking-button:before,.mec-event-grid-minimal .mec-modal-booking-button:before,.mec-event-list-minimal .mec-modal-booking-button:before{display:none}.mec-calendar-events-side .mec-modal-booking-button,.mec-event-container-classic .mec-modal-booking-button,.mec-event-grid-minimal .mec-modal-booking-button,.mec-event-list-minimal .mec-modal-booking-button,.mec-timetable-t2-col .mec-modal-booking-button{margin:0;padding:0}.mec-event-grid-modern .mec-event-footer .mec-booking-button{top:20px}}.mec-wrap .mec-events-cal-links{margin-bottom:0}.mec-single-event #mec-wrap{padding:0;margin-top:35px}.mec-wrap .mec-single-title,.single-mec-events .mec-wrap.mec-no-access-error h1{margin-top:0;margin-bottom:30px;font-weight:700;font-size:33px}.mec-single-event .mec-event-content{padding:40px 0 30px;margin-bottom:10px}.mec-events-meta-group-booking .mec-booking-shortcode,.mec-single-event .mec-events-meta-group-booking,.mec-single-event .mec-frontbox{margin-bottom:30px;padding:40px;background:#fff;border:1px solid #e6e7e8}.mec-events-meta-group.mec-events-meta-group-gmap{margin-bottom:30px}.lity-content .mec-events-meta-group-booking{padding:40px;background:#fff;border:1px solid #e6e7e8}.lity-content .mec-events-meta-group-booking,.mec-events-meta-group-booking .mec-booking-shortcode,.mec-single-event .mec-events-meta-group-booking,.mec-single-event .mec-events-meta-group-countdown,.mec-single-event .mec-events-meta-group-gmap,.mec-single-event .mec-frontbox,.mec-single-modern .mec-single-event-bar{border-radius:3px;overflow:hidden;margin-bottom:30px}.mec-wrap #main-content{overflow:hidden;padding-top:35px}.mec-single-event .mec-map-get-direction-address-cnt{position:relative}.mec-single-event .mec-map-get-direction-address-cnt input.mec-map-get-direction-address{width:100%;height:46px;padding:13px 10px;margin-bottom:0;background:#fcfcfc;border:1px solid #e0e0e0;border-radius:0;box-shadow:inset 0 2px 5px rgba(0,0,0,.081)}.mec-single-event .mec-map-get-direction-address-cnt input.mec-map-get-direction-address:focus{color:#444;background:#fff;border-color:#b0b0b0;box-shadow:0 0 3px rgba(0,0,0,.2)}.mec-single-event .mec-map-get-direction-btn-cnt input{width:100%}.mec-single-event .mec-map-get-direction-reset{position:absolute;z-index:2;top:5px;right:10px;font-size:11px;cursor:pointer}.mec-events-meta-group-tags{margin-top:20px}.mec-events-meta-group-tags a{display:inline-block;color:#444;font-size:11px;text-transform:uppercase;letter-spacing:1.5px;font-weight:500;padding:3px 7px;border:1px solid #ddd;border-radius:2px;background:#fff;margin:1px 3px}.mec-events-meta-group-tags a:hover{text-decoration:underline;background:#f9f9f9}.mec-local-time-details li{list-style:none;font-size:14px;font-weight:300}.mec-single-event:not(.mec-single-modern) .mec-local-time-details{padding:12px 14px 8px;margin-bottom:12px;vertical-align:baseline;position:relative;border:none}.mec-single-event:not(.mec-single-modern) .mec-local-time-details ul{margin:0;padding-left:35px}.mec-single-event:not(.mec-single-modern) .mec-local-time-details h3{border:none;padding-left:15px}.mec-single-event:not(.mec-single-modern) .mec-local-time-details h3:before{display:none}.mec-single-event.mec-single-modern i.mec-sl-speedometer{display:none}.mec-single-modern .mec-local-time-details.mec-frontbox i{display:none}.lity-content .mec-events-meta-group-booking,.mec-events-meta-group-booking .mec-booking-shortcode,.mec-single-event .mec-events-meta-group-booking{z-index:1;overflow:visible}.lity-content .mec-events-meta-group-booking .mec-paypal-credit-card-payment-fields,.lity-content .mec-events-meta-group-booking ul.mec-book-tickets-reg-fields-container,.mec-events-meta-group-booking .mec-booking-shortcode .mec-paypal-credit-card-payment-fields,.mec-events-meta-group-booking .mec-booking-shortcode ul.mec-book-tickets-reg-fields-container,.mec-single-event .mec-events-meta-group-booking .mec-paypal-credit-card-payment-fields,.mec-single-event .mec-events-meta-group-booking ul.mec-book-tickets-reg-fields-container{margin:0 -41.835px;overflow:hidden;clear:both}.mec-events-meta-group-booking .mec-booking-shortcode ul.mec-book-tickets-reg-fields-container li,.mec-single-event .mec-events-meta-group-booking .mec-paypal-credit-card-payment-fields li{margin-left:41.835px;margin-right:41.835px}.lity-content .mec-events-meta-group-booking ul,.mec-events-meta-group-booking .mec-booking-shortcode ul,.mec-single-event .mec-events-meta-group-booking ul{list-style:none;padding-left:0;margin-left:0}.lity-content .mec-events-meta-group-booking ul.mec-book-tickets-reg-fields-container{margin:0}.lity-content .mec-events-meta-group-booking ul.mec-book-tickets-reg-fields-container .col-md-6{float:left}.lity-content .mec-events-meta-group-booking ul li,.mec-events-meta-group-booking .mec-booking-shortcode .mec-book-ticket-variation-wrapper,.mec-events-meta-group-booking .mec-booking-shortcode ul li:not(.option),.mec-single-event .mec-events-meta-group-booking .mec-book-ticket-variation-wrapper,.mec-single-event .mec-events-meta-group-booking ul li{padding:0;list-style:none;margin-top:0;margin-bottom:30px}.lity-content .mec-events-meta-group-booking ul li.col-md-6:first-child,.mec-single-event .mec-events-meta-group-booking ul li.col-md-6:first-child{width:calc(50% - 10px);margin-right:10px;margin-left:0}.lity-content .mec-events-meta-group-booking ul li.col-md-6:nth-child(2),.mec-single-event .mec-events-meta-group-booking ul li.col-md-6:nth-child(2){width:calc(50% - 10px);margin-right:0;margin-left:10px}.lity-content .mec-events-meta-group-booking .mec-booking-form-container>.col-md-12,.mec-events-meta-group-booking .mec-booking-shortcode .col-md-12,.mec-single-event .mec-events-meta-group-booking .mec-booking-form-container>.col-md-12{display:flex;align-items:center;padding:0 0 30px 0;margin-bottom:30px;border-bottom:1px solid #f0f1f2}.lity-content .mec-events-meta-group-booking .col-md-12 .mec-ticket-icon-wrapper,.mec-events-meta-group-booking .mec-booking-shortcode .col-md-12 .mec-ticket-icon-wrapper,.mec-single-event .mec-events-meta-group-booking .col-md-12 .mec-ticket-icon-wrapper{margin-right:25px}.lity-content .mec-events-meta-group-booking .col-md-12 .mec-ticket-name-description-wrapper .mec-ticket-price-wrapper span,.mec-events-meta-group-booking .mec-booking-shortcode .col-md-12 .mec-ticket-name-description-wrapper .mec-ticket-price-wrapper span,.mec-single-event .mec-events-meta-group-booking .col-md-12 .mec-ticket-name-description-wrapper .mec-ticket-price-wrapper span{display:block;font-size:14px;font-weight:400;line-height:19px;color:#606367;margin-bottom:4px}.lity-content .mec-events-meta-group-booking .col-md-12 .mec-ticket-name-description-wrapper .mec-ticket-price-wrapper span.mec-ticket-price,.mec-events-meta-group-booking .mec-booking-shortcode .col-md-12 .mec-ticket-name-description-wrapper .mec-ticket-price-wrapper span.mec-ticket-price,.mec-single-event .mec-events-meta-group-booking .col-md-12 .mec-ticket-name-description-wrapper .mec-ticket-price-wrapper span.mec-ticket-price{font-size:18px;font-weight:600;line-height:24px;color:#212224;margin:0}.lity-content .mec-events-meta-group-booking [id*=mec_booking_quantity_wrapper_],.mec-events-meta-group-booking .mec-booking-shortcode [id*=mec_booking_quantity_wrapper_],.mec-single-event .mec-events-meta-group-booking [id*=mec_booking_quantity_wrapper_]{font-size:13px;font-weight:400;line-height:16px;color:#8e9195;display:block;margin-bottom:5px;text-align:end}.lity-content .mec-events-meta-group-booking .mec-first-for-all-wrapper,.mec-events-meta-group-booking .mec-booking-shortcode .mec-first-for-all-wrapper,.mec-single-event .mec-events-meta-group-booking .mec-first-for-all-wrapper{clear:both;margin-bottom:26px}.lity-content .mec-events-meta-group-booking li h4,.mec-events-meta-group-booking .mec-booking-shortcode li h4,.mec-single-event .mec-events-meta-group-booking li h4{font-size:19px}.lity-content .mec-events-meta-group-booking button,.lity-content .mec-events-meta-group-booking input,.mec-events-meta-group-booking .mec-booking-shortcode button,.mec-events-meta-group-booking .mec-booking-shortcode input,.mec-single-event .mec-events-meta-group-booking button,.mec-single-event .mec-events-meta-group-booking input{border-radius:0;margin-bottom:6px}.lity-content .mec-events-meta-group-booking button.mec-book-form-back-button#mec-book-form-back-btn-step-2,.lity-content .mec-events-meta-group-booking button.mec-book-form-back-button#mec-book-form-back-btn-step-3,.mec-events-meta-group-booking .mec-booking-shortcode button.mec-book-form-back-button#mec-book-form-back-btn-step-2,.mec-events-meta-group-booking .mec-booking-shortcode button.mec-book-form-back-button#mec-book-form-back-btn-step-3,.mec-wrap .mec-single-event .mec-events-meta-group-booking button.mec-book-form-back-button#mec-book-form-back-btn-step-2,.mec-wrap .mec-single-event .mec-events-meta-group-booking button.mec-book-form-back-button#mec-book-form-back-btn-step-3{color:#636f72;background:#f6f7f8;border:1px solid #e7e8e9;float:left;margin:0}.lity-content .mec-events-meta-group-booking button.mec-book-form-back-button#mec-book-form-back-btn-step-2:hover,.mec-events-meta-group-booking .mec-booking-shortcode button.mec-book-form-back-button#mec-book-form-back-btn-step-2:hover,.mec-events-meta-group-booking .mec-booking-shortcode button.mec-book-form-back-button#mec-book-form-back-btn-step-3:hover,.mec-wrap .mec-single-event .mec-events-meta-group-booking button.mec-book-form-back-button#mec-book-form-back-btn-step-2:hover{border:1px solid #d9dadc}.lity-content .mec-events-meta-group-booking button.mec-book-form-back-button#mec-book-form-back-btn-step-2 img.mec-svg-icon,.lity-content .mec-events-meta-group-booking button.mec-book-form-back-button#mec-book-form-back-btn-step-3 img.mec-svg-icon,.mec-events-meta-group-booking .mec-booking-shortcode button.mec-book-form-back-button#mec-book-form-back-btn-step-2 img.mec-svg-icon,.mec-events-meta-group-booking .mec-booking-shortcode button.mec-book-form-back-button#mec-book-form-back-btn-step-3 img.mec-svg-icon,.mec-nextprev-prev-button svg,.mec-wrap .mec-single-event .mec-events-meta-group-booking button.mec-book-form-back-button#mec-book-form-back-btn-step-2 img.mec-svg-icon,.mec-wrap .mec-single-event .mec-events-meta-group-booking button.mec-book-form-back-button#mec-book-form-back-btn-step-3 img.mec-svg-icon{margin-left:unset;margin-right:30px}mec-book-form-pay-button button#mec-book-form-back-btn-step-3{float:none}.mec-next-occ-booking,.mec-next-occ-booking-p{padding-left:15px}.mec-events-meta-group-booking .mec-next-occ-booking,.mec-events-meta-group-booking .mec-next-occ-booking-p{padding:0;font-size:12px;letter-spacing:0;margin:3px 0;padding:5px 1em 3px 0}.mec-book-username-password-wrapper{padding:0 15px}.lity-container .mec-next-occ-booking,.lity-container .mec-next-occ-booking-p{padding-left:0}.mec-ssl-protection-message{display:none}.lity-content .mec-events-meta-group-booking .mec-click-pay,.mec-events-meta-group-booking .mec-booking-shortcode .mec-click-pay,.mec-single-event .mec-events-meta-group-booking .mec-click-pay{max-width:100%}.lity-content .mec-events-meta-group-booking .mec-click-pay #mec_woo_add_to_cart_btn_r,.lity-content .mec-events-meta-group-booking .mec-click-pay button.mec-book-form-next-button,.mec-events-meta-group-booking .mec-booking-shortcode .mec-click-pay #mec_woo_add_to_cart_btn_r,.mec-events-meta-group-booking .mec-booking-shortcode .mec-click-pay button.mec-book-form-next-button,.mec-single-event .mec-events-meta-group-booking .mec-click-pay #mec_woo_add_to_cart_btn_r,.mec-single-event .mec-events-meta-group-booking .mec-click-pay button.mec-book-form-next-button{float:right;margin:30px 0 0 0!important;background:#47dc6e!important;border-color:#47dc6e!important;color:#fff!important;font-weight:700!important}.lity-content .mec-events-meta-group-booking .mec-click-pay #mec_woo_add_to_cart_btn_r:hover,.lity-content .mec-events-meta-group-booking .mec-click-pay button.mec-book-form-next-button:hover,.mec-events-meta-group-booking .mec-booking-shortcode .mec-click-pay #mec_woo_add_to_cart_btn_r:hover,.mec-events-meta-group-booking .mec-booking-shortcode .mec-click-pay button.mec-book-form-next-button:hover,.mec-single-event .mec-events-meta-group-booking .mec-click-pay #mec_woo_add_to_cart_btn_r:hover,.mec-single-event .mec-events-meta-group-booking .mec-click-pay button.mec-book-form-next-button:hover{background:#54d274}.lity-container .mec-click-pay{max-width:400px}.lity-container .mec-book-form-btn-wrap button.mec-book-form-next-button,.lity-container .mec-click-pay #mec_woo_add_to_cart_btn_r{float:right}.lity-container button.mec-book-form-next-button{float:right}.lity-container .mec-click-pay #mec_woo_add_to_cart_btn_r:hover,.lity-container .mec-click-pay button.mec-book-form-next-button:hover{background:#000}.lity-content .mec-events-meta-group-booking .mec-click-next,.mec-events-meta-group-booking .mec-booking-shortcode .mec-click-next,.mec-single-event .mec-events-meta-group-booking .mec-click-next{float:right;position:relative;width:calc(100% - 186px)}.lity-container .mec-click-next{float:right;position:relative;width:calc(100% - 186px)}.mec-single-event .mec-book-form-coupon button{margin-left:0}.mec-single-event .mec-book-form-gateway-checkout button{margin-left:0}.mec-single-event .mec-single-event .mec-book-form-gateway-checkout button{margin-right:20px}.lity-content .mec-booking-progress-bar,.mec-booking-progress-bar,.mec-booking-shortcode .mec-booking-progress-bar,.mec-single-event .mec-booking-progress-bar{display:flex;flex-wrap:wrap;margin:60px 0 25px;position:relative;padding:0}.lity-content .mec-booking-progress-bar li,.mec-booking-shortcode .mec-booking-progress-bar li,.mec-wrap .mec-booking-progress-bar li{margin:28px 0 15px!important;text-align:center;font-size:15px;font-weight:700;color:#000;position:relative;flex:1;align-items:center;justify-content:center;list-style:none;z-index:99999}.lity-content .mec-booking-progress-bar li .progress-index,.mec-booking-shortcode .mec-booking-progress-bar li .progress-index,.mec-wrap .mec-booking-progress-bar li .progress-index{font-size:14px;font-weight:600;line-height:24px;color:var(--mec-color-skin);position:absolute;width:24px;height:24px;background:var(--mec-color-skin-rgba-1);border-radius:50%;top:-39px;left:calc(50% - 12px);z-index:1}.lity-content .mec-booking-progress-bar li.mec-active .progress-index,.mec-booking-shortcode .mec-booking-progress-bar li.mec-active .progress-index,.mec-wrap .mec-booking-progress-bar li.mec-active .progress-index{background:#54d274;border-color:#54d274;color:#fff}.lity-content .mec-booking-progress-bar li:before,.mec-booking-shortcode .mec-booking-progress-bar li:before,.mec-wrap .mec-booking-progress-bar li:before{content:"";position:absolute;width:calc(50% - 12px);height:2px;background:var(--mec-color-skin-rgba-1);top:-28px;left:0}.lity-content .mec-booking-progress-bar li:after,.mec-booking-shortcode .mec-booking-progress-bar li:after,.mec-wrap .mec-booking-progress-bar li:after{content:"";position:absolute;width:calc(50% - 12px);height:2px;background:var(--mec-color-skin-rgba-1);top:-28px;left:calc(50% + 12px)}.lity-content .mec-booking-progress-bar li.mec-active,.mec-booking-shortcode .mec-booking-progress-bar li.mec-active,.mec-wrap .mec-booking-progress-bar li.mec-active{color:#54d274}.lity-content .mec-booking-progress-bar li.mec-active:after,.lity-content .mec-booking-progress-bar li.mec-active:before,.mec-booking-shortcode .mec-booking-progress-bar li.mec-active:after,.mec-booking-shortcode .mec-booking-progress-bar li.mec-active:before,.mec-wrap .mec-booking-progress-bar li.mec-active:after,.mec-wrap .mec-booking-progress-bar li.mec-active:before{background:#54d274}.mec-single-event .row-done .mec-booking-progress-bar:after{background:#54d274}@media (max-width:480px){.lity-content .mec-booking-progress-bar li,.mec-booking-shortcode .mec-booking-progress-bar li,.mec-wrap .mec-booking-progress-bar li{font-size:12px}}@media (max-width:390px){.lity-content .mec-booking-progress-bar li,.mec-booking-shortcode .mec-booking-progress-bar li,.mec-wrap .mec-booking-progress-bar li{font-size:8px}.lity-content .mec-booking-progress-bar li.mec-active:after,.mec-booking-shortcode .mec-booking-progress-bar li.mec-active:after,.mec-wrap .mec-booking-progress-bar li.mec-active:after{font-size:14px}}.mec-wrap .mec-booking-progress-bar li.mec-active:last-child:before{width:50%}.mec-booking .mec-event-tickets-list .mec-event-ticket-available{margin-top:12px}.mec-booking .mec-event-tickets-list .mec-ticket-style-row input[type=number]{display:block;margin:0 0 10px auto;box-shadow:unset;border:1px solid #e3e5e7;border-radius:4px;background:#fff;min-width:80px;width:80px!important;min-height:40px;height:40px}.mec-booking .mec-event-tickets-list .mec-ticket-style-row input::-webkit-inner-spin-button,.mec-booking .mec-event-tickets-list .mec-ticket-style-row input::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}.mec-booking .mec-event-tickets-list .mec-ticket-style-row .mec-ticket-style-row-section-3{margin-left:auto}.mec-booking .mec-event-tickets-list .mec-ticket-style-row .mec-event-ticket-input-wrapper{position:relative}.mec-booking .mec-event-tickets-list .mec-ticket-style-row input[type=number]{-moz-appearance:textfield}.mec-booking .mec-event-tickets-list .mec-ticket-style-row .minus,.mec-booking .mec-event-tickets-list .mec-ticket-style-row .plus{position:absolute;right:5px;line-height:1;height:14px}.mec-booking .mec-event-tickets-list .mec-ticket-style-row .plus{top:5px}.mec-booking .mec-event-tickets-list .mec-ticket-style-row .minus{top:auto;bottom:5px}.mec-booking .mec-event-tickets-list .mec-ticket-style-row .minus:hover,.mec-booking .mec-event-tickets-list .mec-ticket-style-row .plus:hover{background:#dbdbdb}.mec-booking .mec-event-tickets-list .mec-ticket-style-row a{text-decoration:none}.mec-booking .mec-event-tickets-list .mec-ticket-style-row{margin-bottom:30px}.mec-ticket-style-row.mec-ticket-available-spots{display:flex;flex-direction:row;align-items:center;justify-content:flex-start;align-content:stretch;flex-wrap:nowrap}.mec-booking .mec-event-tickets-list .mec-ticket-style-row>div{width:unset}@media (max-width:480px){.mec-ticket-style-row.mec-ticket-available-spots{max-width:100%;display:flex;flex-direction:unset;align-items:unset;justify-content:unset;align-content:unset;flex-wrap:unset}.mec-wrap .mec-booking .mec-event-tickets-list .mec-ticket-style-row>div{width:100%;margin-bottom:10px}}.mec-booking .mec-event-tickets-list .mec-ticket-style-row .mec-ticket-style-row-section-1{width:unset;margin:5px 25px 0 0}.mec-booking .mec-event-tickets-list .mec-ticket-style-row .mec-event-ticket-available,.mec-booking .mec-event-tickets-list .mec-ticket-style-row>div{border:0;display:block;box-shadow:unset;margin:0}.mec-booking .mec-event-tickets-list .mec-ticket-style-row .mec-event-ticket-available{font-size:13px;font-weight:400;line-height:16px;color:#8e9195;text-align:right}.mec-booking .mec-event-tickets-list .mec-ticket-style-row .mec-event-ticket-name{font-size:14px;font-weight:400;line-height:19px;color:#606367;margin-bottom:4px}.mec-booking .mec-event-tickets-list .mec-ticket-style-row .mec-event-ticket-price{font-size:18px;font-weight:600;line-height:24px;color:#212224}.mec-booking .mec-event-tickets-list .mec-ticket-style-row .mec-event-ticket-description,.mec-booking .mec-event-tickets-list .mec-ticket-style-row .mec-event-ticket-price,.mec-booking .mec-event-tickets-list .mec-ticket-style-row .mec-ticket-style-row-section-3 div{margin:0}.mec-single-event .mec-book-first,.mec-single-event .mec-book-form-gateways,.mec-single-event .mec-book-form-price,.mec-single-event .mec-event-tickets-list,.mec-single-event form.mec-click-next{padding-left:0;padding-right:0}.lity-content .mec-book-first .mec-booking-calendar-wrapper,.mec-booking-calendar-wrapper,.mec-booking-shortcode .mec-book-first .mec-booking-calendar-wrapper,.mec-single-fluent-wrap .mec-booking-calendar-wrapper{display:flex;justify-content:space-between;align-items:center;padding-bottom:30px;margin-bottom:30px;border-bottom:1px solid #f0f1f2}@media only screen and (max-width:767px){.lity-content .mec-events-meta-group-booking select,.mec-events-meta-group-booking .mec-booking-shortcode select,.mec-single-event .mec-events-meta-group-booking select{width:unset!important}}@media only screen and (max-width:479px){.lity-content .mec-book-first .mec-booking-calendar-wrapper,.mec-booking-shortcode .mec-book-first .mec-booking-calendar-wrapper,.mec-single-event .mec-book-first .mec-booking-calendar-wrapper,.mec-single-fluent-wrap .mec-book-first .mec-booking-calendar-wrapper{flex-direction:column;align-items:flex-start}.mec-booking .mec-event-tickets-list .mec-ticket-style-row .mec-ticket-style-row-section-1{display:none}}.lity-content .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-label,.mec-booking-shortcode .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-label,.mec-single-event .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-label,.mec-single-fluent-wrap .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-label{font-size:14px;font-weight:400;color:#606367}.lity-content .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-label span.mec-required,.mec-booking-shortcode .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-label span.mec-required,.mec-single-event .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-label span.mec-required,.mec-single-fluent-wrap .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-label span.mec-required{color:#ec3365}.lity-content .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-dropdown,.lity-content .mec-book-first .mec-select-date-dropdown-wrapper .mec-select-date-dropdown,.mec-booking-shortcode .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-dropdown,.mec-booking-shortcode .mec-book-first .mec-select-date-dropdown-wrapper .mec-select-date-dropdown,.mec-single-event .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-dropdown,.mec-single-event .mec-book-first .mec-select-date-dropdown-wrapper .mec-select-date-dropdown,.mec-single-fluent-wrap .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-dropdown{border:1px solid #e3e5e7;border-radius:3px;max-width:300px;width:auto;height:42px;display:flex;background-color:#fff}.lity-content .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-dropdown span.mec-select-date-calendar-icon,.lity-content .mec-book-first .mec-select-date-dropdown-wrapper .mec-select-date-dropdown span.mec-select-date-calendar-icon,.mec-booking-shortcode .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-dropdown span.mec-select-date-calendar-icon,.mec-booking-shortcode .mec-book-first .mec-select-date-dropdown-wrapper .mec-select-date-dropdown span.mec-select-date-calendar-icon,.mec-single-event .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-dropdown span.mec-select-date-calendar-icon,.mec-single-event .mec-book-first .mec-select-date-dropdown-wrapper .mec-select-date-dropdown span.mec-select-date-calendar-icon{display:flex;justify-content:center;align-items:center;border-right:1px solid #e3e5e7;background:#fafafa;min-width:40px}.lity-content .mec-book-first .mec-select-date-dropdown-wrapper .mec-select-date-dropdown .mec-custom-nice-select,.mec-booking-shortcode .mec-book-first .mec-select-date-dropdown-wrapper .mec-select-date-dropdown .mec-custom-nice-select,.mec-single-event .mec-book-first .mec-select-date-dropdown-wrapper .mec-select-date-dropdown .mec-custom-nice-select{margin:0;border:none}.lity-content .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-dropdown .mec-select-date-calendar-formatted-date,.mec-booking-shortcode .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-dropdown .mec-select-date-calendar-formatted-date,.mec-single-event .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-dropdown .mec-select-date-calendar-formatted-date,.mec-single-fluent-wrap .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-dropdown .mec-select-date-calendar-formatted-date{font-size:13px;line-height:40px;padding:0 12px;width:240px}.lity-content .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-dropdown span.mec-select-date-calendar-icons,.mec-booking-shortcode .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-dropdown span.mec-select-date-calendar-icons,.mec-single-event .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-dropdown span.mec-select-date-calendar-icons,.mec-single-fluent-wrap .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-dropdown span.mec-select-date-calendar-icons{cursor:pointer;line-height:33px;position:relative;right:10px}.lity-content .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-container,.mec-booking-shortcode .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-container,.mec-single-event .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-container,.mec-single-fluent-wrap .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-container{position:absolute;right:40px;z-index:99}.lity-content .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-container .mec-booking-calendar.mec-wrap,.mec-booking-shortcode .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-container .mec-booking-calendar.mec-wrap,.mec-single-event .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-container .mec-booking-calendar.mec-wrap,.mec-single-fluent-wrap .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-container .mec-booking-calendar.mec-wrap{border:1px solid #e3e5e7;border-radius:5px}.lity-content .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-container .mec-booking-calendar-month-navigation .mec-next-month,.lity-content .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-container .mec-booking-calendar-month-navigation .mec-previous-month,.mec-booking-shortcode .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-container .mec-booking-calendar-month-navigation .mec-next-month,.mec-booking-shortcode .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-container .mec-booking-calendar-month-navigation .mec-previous-month,.mec-single-event .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-container .mec-booking-calendar-month-navigation .mec-next-month,.mec-single-event .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-container .mec-booking-calendar-month-navigation .mec-previous-month,.mec-single-event .mec-book-first .mec-select-date-express-calendar-wrapper .mec-select-date-calendar-container .mec-booking-calendar-month-navigation .mec-next-month,.mec-single-fluent-wrap .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-container .mec-booking-calendar-month-navigation .mec-next-month,.mec-single-fluent-wrap .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-container .mec-booking-calendar-month-navigation .mec-previous-month{border:none;box-shadow:none;line-height:40px;margin:0;border-radius:5px;padding:0 20px}.mec-single-event label.mec-fill-attendees{margin-left:0}.lity-content .mec-booking .mec-book-form-btn-wrap,.mec-wrap .mec-booking .mec-book-form-btn-wrap{padding-top:30px;border-top:1px solid #f0f1f2}.lity-content .mec-booking .mec-book-form-btn-wrap:after,.mec-wrap .mec-booking .mec-book-form-btn-wrap:after{content:"";display:block;clear:both}.mec-events-meta-group-booking #mec-book-form-btn-step-1,.mec-events-meta-group-booking #mec-book-form-btn-step-2{margin:0;float:right}.mec-wrap .mec-booking-form-container .col-md-12{padding-left:0}.mec-wrap .mec-events-meta-group-booking .mec-wrap-checkout.row{margin:0}.lity-content .mec-events-meta-group-booking .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-title,.mec-events-meta-group-booking .mec-booking-shortcode .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-title,.mec-wrap .mec-events-meta-group-booking .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-title{font-size:18px;font-weight:600;line-height:24px;color:#212224;margin-bottom:20px}.lity-content .mec-events-meta-group-booking .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons,.mec-events-meta-group-booking .mec-booking-shortcode .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons,.mec-wrap .mec-events-meta-group-booking .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons{display:flex;flex-wrap:wrap;padding-bottom:20px}.lity-content .mec-events-meta-group-booking .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option,.mec-events-meta-group-booking .mec-booking-shortcode .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option,.mec-wrap .mec-events-meta-group-booking .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option{flex:calc(50% - 20px);max-width:calc(50% - 10px);border:1px solid #e6e7e8;border-radius:3px;margin-bottom:20px;padding:14.5px 20px 14.5px 15px;display:flex;justify-content:flex-start;align-items:center;cursor:pointer}.lity-content .mec-events-meta-group-booking .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option:has(input:checked),.mec-events-meta-group-booking .mec-booking-shortcode .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option:has(input:checked),.mec-wrap .mec-events-meta-group-booking .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option:has(input:checked){border:1px solid var(--mec-color-skin-rgba-2)}@media only screen and (max-width:767px){.lity-content .mec-events-meta-group-booking .mec-events-meta-group-booking .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option,.mec-events-meta-group-booking .mec-booking-shortcode .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option,.mec-wrap .mec-events-meta-group-booking .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option{flex:100%;max-width:100%}.lity-content .mec-events-meta-group-booking .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option:nth-child(odd),.mec-events-meta-group-booking .mec-booking-shortcode .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option:nth-child(odd),.mec-wrap .mec-events-meta-group-booking .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option:nth-child(odd){margin-right:0!important}}.lity-content .mec-events-meta-group-booking .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option:nth-child(odd),.mec-events-meta-group-booking .mec-booking-shortcode .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option:nth-child(odd),.mec-wrap .mec-events-meta-group-booking .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option:nth-child(odd){margin-right:20px}.lity-content .mec-events-meta-group-booking .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option .mec-book-form-gateway-option-svg,.mec-events-meta-group-booking .mec-booking-shortcode .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option .mec-book-form-gateway-option-svg,.mec-wrap .mec-events-meta-group-booking .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option .mec-book-form-gateway-option-svg{display:flex;margin-right:10px}.lity-content .mec-events-meta-group-booking .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option .mec-book-form-gateway-option-title,.mec-events-meta-group-booking .mec-booking-shortcode .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option .mec-book-form-gateway-option-title,.mec-wrap .mec-events-meta-group-booking .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option .mec-book-form-gateway-option-title{font-size:14px;font-weight:600;line-height:18px}.lity-content .mec-events-meta-group-booking .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option .mec-book-form-gateway-option-radio,.mec-events-meta-group-booking .mec-booking-shortcode .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option .mec-book-form-gateway-option-radio,.mec-wrap .mec-events-meta-group-booking .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option .mec-book-form-gateway-option-radio{margin-left:auto}.lity-content .mec-events-meta-group-booking .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option .mec-book-form-gateway-option-radio input,.mec-events-meta-group-booking .mec-booking-shortcode .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option .mec-book-form-gateway-option-radio input,.mec-wrap .mec-events-meta-group-booking .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option .mec-book-form-gateway-option-radio input{left:-2px}.lity-content .mec-wrap-checkout .mec-book-form-gateways .mec-book-form-gateway-label,.mec-events-meta-group-booking .mec-booking-shortcode .mec-wrap-checkout .mec-book-form-gateways .mec-book-form-gateway-label,.mec-wrap .mec-wrap-checkout .mec-book-form-gateways .mec-book-form-gateway-label{padding-left:3px}.mec-events-progress-bar{display:flex;align-items:center;margin-top:40px}.mec-event-list-standard .mec-events-progress-bar{position:absolute;margin-top:15px;left:calc(50% - 210px)}.mec-single-modern .mec-events-progress-bar{justify-content:flex-end;padding:0 20px;margin-top:10px}.mec-events-progress-bar .mec-progress-bar-time-passed,.mec-events-progress-bar .mec-progress-bar-time-remained{font-size:10px;line-height:14px;margin:0 10px 0 0;color:#959ca7;width:50px;text-align:center}.mec-events-progress-bar .mec-progress-bar-time-remained{margin:0 0 0 10px}.mec-events-progress-bar progress{width:300px;height:4px;border-radius:3px;position:relative}.mec-events-progress-bar progress:after{content:"";width:12px;height:12px;display:block;border-radius:100%;background-color:#38d5ed;position:absolute;top:-4px}.mec-events-progress-bar progress::-webkit-progress-bar{background-color:#e6e7e8;border-radius:3px}.mec-events-progress-bar progress::-webkit-progress-value{background-color:#38d5ed;border-radius:3px}.lity-content .mec-events-meta-group-booking .mec-event-ticket-available,.mec-events-meta-group-booking .mec-booking-shortcode .mec-event-ticket-available,.mec-single-event .mec-events-meta-group-booking .mec-event-ticket-available{display:block;margin-bottom:20px;margin-top:-17px;font-size:11px;color:#8a8a8a}.lity-content .mec-events-meta-group-booking .mec-booking-checkout-coupon-total-wrapper,.mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-checkout-coupon-total-wrapper,.mec-single-event .mec-events-meta-group-booking .mec-booking-checkout-coupon-total-wrapper{display:flex;justify-content:space-between;margin:30px 0 40px}@media only screen and (max-width:767px){.lity-content .mec-events-meta-group-booking .mec-booking-checkout-coupon-total-wrapper,.mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-checkout-coupon-total-wrapper,.mec-single-event .mec-events-meta-group-booking .mec-booking-checkout-coupon-total-wrapper{flex-direction:column}.lity-content .mec-events-meta-group-booking .mec-book-form-coupon form span.mec-booking-coupon-field-wrapper input,.mec-events-meta-group-booking .mec-booking-shortcode .mec-book-form-coupon form span.mec-booking-coupon-field-wrapper input,.mec-single-event .mec-events-meta-group-booking .mec-book-form-coupon form span.mec-booking-coupon-field-wrapper input{width:100%}.lity-content .mec-events-meta-group-booking .mec-book-form-coupon form button,.mec-events-meta-group-booking .mec-booking-shortcode .mec-book-form-coupon form button,.mec-single-event .mec-events-meta-group-booking .mec-book-form-coupon form button{left:unset!important;right:5px}}.lity-content .mec-events-meta-group-booking .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul,.mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul,.mec-single-event .mec-events-meta-group-booking .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul{display:flex;align-items:center}.lity-content .mec-events-meta-group-booking .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul li,.mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul li,.mec-single-event .mec-events-meta-group-booking .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul li{margin-bottom:0;text-align:right}.lity-content .mec-events-meta-group-booking .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul li,.mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul li,.mec-single-event .mec-events-meta-group-booking .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul li{padding-left:30px;margin-left:30px;border-left:1px dashed #e6e7e8}.lity-content .mec-events-meta-group-booking .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul li:first-child,.mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul li:first-child,.mec-single-event .mec-events-meta-group-booking .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul li:first-child{padding-left:unset;margin-left:unset;border-left:none}.lity-content .mec-events-meta-group-booking .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul li span,.mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul li span,.mec-single-event .mec-events-meta-group-booking .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul li span{display:block;font-size:14px;font-weight:400;line-height:19px;color:#606367;margin-bottom:4px}.lity-content .mec-events-meta-group-booking .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul li span:last-child,.mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul li span:last-child,.mec-single-event .mec-events-meta-group-booking .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul li span:last-child{font-size:18px;font-weight:600;line-height:24px;color:#212224;margin:0}.lity-content .mec-events-meta-group-booking .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul li span.mec-book-price-total,.mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul li span.mec-book-price-total,.mec-single-event .mec-events-meta-group-booking .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul li span.mec-book-price-total{font-weight:700}@media only screen and (max-width:767px){.lity-content .mec-events-meta-group-booking .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul,.mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul,.mec-single-event .mec-events-meta-group-booking .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul{margin-top:30px}}.lity-content .mec-events-meta-group-booking .mec-book-form-coupon form,.mec-events-meta-group-booking .mec-booking-shortcode .mec-book-form-coupon form,.mec-single-event .mec-events-meta-group-booking .mec-book-form-coupon form{margin:0;position:relative}.lity-content .mec-events-meta-group-booking .mec-booking-checkout-coupon-wrapper,.mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-checkout-coupon-wrapper,.mec-single-event .mec-events-meta-group-booking .mec-booking-checkout-coupon-wrapper{width:330px}.lity-content .mec-events-meta-group-booking .mec-book-form-coupon form span.mec-booking-coupon-field-wrapper,.mec-events-meta-group-booking .mec-booking-shortcode .mec-book-form-coupon form span.mec-booking-coupon-field-wrapper,.mec-single-event .mec-events-meta-group-booking .mec-book-form-coupon form span.mec-booking-coupon-field-wrapper{display:flex;border:1px solid #e3e5e7;border-radius:3px;max-width:330px}.lity-content .mec-events-meta-group-booking .mec-book-form-coupon form span.mec-booking-coupon-field-wrapper .mec-booking-coupon-field-icon,.mec-events-meta-group-booking .mec-booking-shortcode .mec-book-form-coupon form span.mec-booking-coupon-field-wrapper .mec-booking-coupon-field-icon,.mec-single-event .mec-events-meta-group-booking .mec-book-form-coupon form span.mec-booking-coupon-field-wrapper .mec-booking-coupon-field-icon{display:flex;justify-content:center;align-items:center;border-right:1px solid #e3e5e7;background:#fafafa;min-width:40px}.lity-content .mec-events-meta-group-booking .mec-book-form-coupon form span.mec-booking-coupon-field-wrapper input,.mec-events-meta-group-booking .mec-booking-shortcode .mec-book-form-coupon form span.mec-booking-coupon-field-wrapper input,.mec-single-event .mec-events-meta-group-booking .mec-book-form-coupon form span.mec-booking-coupon-field-wrapper input{border:none;line-height:48px;height:unset}.lity-content .mec-events-meta-group-booking .mec-book-form-coupon form button,.mec-events-meta-group-booking .mec-booking-shortcode .mec-book-form-coupon form button,.mec-single-event .mec-events-meta-group-booking .mec-book-form-coupon form button{margin:0!important;position:absolute!important;top:6px;left:auto;right:6px;padding:9px 18px 10px!important}.lity-content .mec-events-meta-group-booking .mec-book-form-coupon form button.loading,.mec-events-meta-group-booking .mec-booking-shortcode .mec-book-form-coupon form button.loading,.mec-single-event .mec-events-meta-group-booking .mec-book-form-coupon form button.loading{color:#ecf9fd!important}.lity-content .mec-events-meta-group-booking .mec-book-form-coupon form button.loading:after,.mec-events-meta-group-booking .mec-booking-shortcode .mec-book-form-coupon form button.loading:after,.mec-single-event .mec-events-meta-group-booking .mec-book-form-coupon form button.loading:after{position:absolute;left:calc(50% - 10px)}.lity-content .mec-events-meta-group-booking h5,.lity-content .mec-events-meta-group-booking label,.mec-events-meta-group-booking .mec-booking-shortcode h5,.mec-events-meta-group-booking .mec-booking-shortcode label,.mec-single-event .mec-events-meta-group-booking h5,.mec-single-event .mec-events-meta-group-booking label{color:#606367;font-size:14px;font-weight:400;line-height:19px;letter-spacing:0;margin:0 0 4px 0;display:block;clear:none;padding:0 1em 5px 0}.lity-content .mec-events-meta-group-booking h5 span,.mec-events-meta-group-booking .mec-booking-shortcode h5 span,.mec-single-event .mec-events-meta-group-booking h5 span{display:inline-block}.lity-content .mec-events-meta-group-booking h5 span.mec-ticket-variation-name,.mec-events-meta-group-booking .mec-booking-shortcode h5 span.mec-ticket-variation-name,.mec-single-event .mec-events-meta-group-booking h5 span.mec-ticket-variation-name{padding-right:5px;text-transform:capitalize}.lity-content .mec-events-meta-group-booking input::-webkit-input-placeholder,.mec-events-meta-group-booking .mec-booking-shortcode input::-webkit-input-placeholder,.mec-single-event .mec-events-meta-group-booking input::-webkit-input-placeholder{color:#aaa}.lity-content .mec-events-meta-group-booking input:-moz-placeholder,.mec-events-meta-group-booking .mec-booking-shortcode input:-moz-placeholder,.mec-single-event .mec-events-meta-group-booking input:-moz-placeholder{color:#aaa}.lity-content .mec-events-meta-group-booking input[type=date],.lity-content .mec-events-meta-group-booking input[type=email],.lity-content .mec-events-meta-group-booking input[type=number],.lity-content .mec-events-meta-group-booking input[type=password],.lity-content .mec-events-meta-group-booking input[type=tel],.lity-content .mec-events-meta-group-booking input[type=text],.lity-content .mec-events-meta-group-booking select,.lity-content .mec-events-meta-group-booking textarea,.mec-events-meta-group-booking .mec-booking-shortcode input[type=date],.mec-events-meta-group-booking .mec-booking-shortcode input[type=email],.mec-events-meta-group-booking .mec-booking-shortcode input[type=number],.mec-events-meta-group-booking .mec-booking-shortcode input[type=password],.mec-events-meta-group-booking .mec-booking-shortcode input[type=tel],.mec-events-meta-group-booking .mec-booking-shortcode input[type=text],.mec-events-meta-group-booking .mec-booking-shortcode select,.mec-events-meta-group-booking .mec-booking-shortcode textarea,.mec-single-event .mec-events-meta-group-booking input[type=date],.mec-single-event .mec-events-meta-group-booking input[type=email],.mec-single-event .mec-events-meta-group-booking input[type=number],.mec-single-event .mec-events-meta-group-booking input[type=password],.mec-single-event .mec-events-meta-group-booking input[type=tel],.mec-single-event .mec-events-meta-group-booking input[type=text],.mec-single-event .mec-events-meta-group-booking select,.mec-single-event .mec-events-meta-group-booking textarea{display:block;background:#fff;min-height:40px;min-width:180px;font-size:13px;line-height:38px;color:#606367;border:1px solid #e3e5e7;border-radius:3px;padding:0 12px;width:100%;margin-bottom:0;box-shadow:unset;clear:both}.lity-content .mec-events-meta-group-booking select:not(#mec_paypal_credit_card_card_type),.mec-events-meta-group-booking .mec-booking-shortcode select:not(#mec_paypal_credit_card_card_type),.mec-single-event .mec-events-meta-group-booking select:not(#mec_paypal_credit_card_card_type){width:100%;-webkit-appearance:none;background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMS40MjQiIGhlaWdodD0iNi40MiIgdmlld0JveD0iMCAwIDExLjQyNCA2LjQyIj4NCiAgPGcgaWQ9Ikdyb3VwXzY1NjI3IiBkYXRhLW5hbWU9Ikdyb3VwIDY1NjI3IiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwLjIxMiAwLjIxMikiPg0KICAgIDxwYXRoIGlkPSJhbmdsZS1sZWZ0IiBkPSJNLjk5LDUuNWw1LDUuMDA1LS41LjVMMCw1LjUsNS41LDAsNiwuNS45OSw1LjVaIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgwIDUuOTk1KSByb3RhdGUoLTkwKSIgZmlsbD0iIzYzNmY3MiIgc3Ryb2tlPSIjNjM2ZjcyIiBzdHJva2Utd2lkdGg9IjAuMyIvPg0KICA8L2c+DQo8L3N2Zz4NCg==");background-position:calc(100% - 12px) center;background-repeat:no-repeat}.mec-events-meta-group-booking .mec-booking-shortcode ul.mec-book-tickets-reg-fields-container li{width:calc(100% - 83.665px);float:left}.lity-content .mec-events-meta-group-booking .mec-book-ticket-variation-wrapper,.mec-events-meta-group-booking .mec-booking-shortcode .mec-book-ticket-variation-wrapper,.mec-single-event .mec-events-meta-group-booking .mec-book-ticket-variation-wrapper{width:100%}.lity-content .mec-events-meta-group-booking .mec-paypal-credit-card-payment-fields li,.mec-events-meta-group-booking .mec-booking-shortcode .mec-paypal-credit-card-payment-fields li,.mec-single-event .mec-events-meta-group-booking .mec-paypal-credit-card-payment-fields li{width:50%;float:left}.mec-events-meta-group-booking .mec-booking-shortcode .mec-paypal-credit-card-payment-fields li,.mec-events-meta-group-booking .mec-booking-shortcode ul.mec-book-tickets-reg-fields-container li:first-child,.mec-events-meta-group-booking .mec-booking-shortcode ul.mec-book-tickets-reg-fields-container li:nth-child(2),.mec-single-event .mec-events-meta-group-booking .mec-paypal-credit-card-payment-fields li{width:calc(50% - 83.665px)}.lity-content .mec-events-meta-group-booking .mec-paypal-credit-card-payment-fields,.mec-events-meta-group-booking .mec-booking-shortcode .mec-paypal-credit-card-payment-fields,.mec-single-event .mec-events-meta-group-booking .mec-paypal-credit-card-payment-fields{padding-top:20px}.lity-content .mec-events-meta-group-booking .mec-paypal-credit-card-payment-fields li.mec-paypal-credit-card-expiration-date-month select,.mec-events-meta-group-booking .mec-booking-shortcode .mec-paypal-credit-card-payment-fields li.mec-paypal-credit-card-expiration-date-month select,.mec-single-event .mec-events-meta-group-booking .mec-paypal-credit-card-payment-fields li.mec-paypal-credit-card-expiration-date-month select{width:calc(50% - 24px)!important;display:inline-block;min-width:unset}@media only screen and (max-width:768px){.lity-content .mec-events-meta-group-booking .mec-paypal-credit-card-payment-fields li:nth-child(odd),.mec-events-meta-group-booking .mec-booking-shortcode .mec-paypal-credit-card-payment-fields li:nth-child(odd),.mec-events-meta-group-booking .mec-booking-shortcode ul.mec-book-tickets-reg-fields-container li:first-child,.mec-events-meta-group-booking .mec-booking-shortcode ul.mec-book-tickets-reg-fields-container li:nth-child(2),.mec-single-event .mec-events-meta-group-booking .mec-paypal-credit-card-payment-fields li:nth-child(odd){width:calc(100% - 83.665px);max-width:unset}.lity-content .mec-events-meta-group-booking .mec-book-ticket-variation-wrapper input,.lity-content .mec-events-meta-group-booking ul.mec-book-tickets-reg-fields-container li input,.mec-events-meta-group-booking .mec-booking-shortcode .mec-book-ticket-variation-wrapper input,.mec-events-meta-group-booking .mec-booking-shortcode ul.mec-book-tickets-reg-fields-container li input,.mec-single-event .mec-events-meta-group-booking .mec-book-ticket-variation-wrapper input,.mec-single-event .mec-events-meta-group-booking ul.mec-book-tickets-reg-fields-container li input{max-width:unset!important}.lity-content .mec-events-meta-group-booking .mec-book-ticket-variation-wrapper:nth-child(2n) input,.lity-content .mec-events-meta-group-booking ul.mec-book-tickets-reg-fields-container li:nth-child(2n) input,.mec-events-meta-group-booking .mec-booking-shortcode .mec-book-ticket-variation-wrapper:nth-child(2n) input,.mec-events-meta-group-booking .mec-booking-shortcode ul.mec-book-tickets-reg-fields-container li:nth-child(2n) input,.mec-single-event .mec-events-meta-group-booking .mec-book-ticket-variation-wrapper:nth-child(2n) input,.mec-single-event .mec-events-meta-group-booking ul.mec-book-tickets-reg-fields-container li:nth-child(2n) input{margin-left:0}}.wbmec-mandatory{padding-left:5px;font-size:14px;color:red}.lity-content .mec-events-meta-group-booking .mec-booking-email-field-wrapper,.lity-content .mec-events-meta-group-booking .mec-booking-name-field-wrapper,.lity-content .mec-events-meta-group-booking .mec-field-wrapper,.lity-content .mec-events-meta-group-booking .mec-stripe-name-and-email-wrapper,.mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-email-field-wrapper,.mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-name-field-wrapper,.mec-events-meta-group-booking .mec-booking-shortcode .mec-field-wrapper,.mec-events-meta-group-booking .mec-booking-shortcode .mec-stripe-name-and-email-wrapper,.mec-single-event .mec-events-meta-group-booking .mec-booking-email-field-wrapper,.mec-single-event .mec-events-meta-group-booking .mec-booking-name-field-wrapper,.mec-single-event .mec-events-meta-group-booking .mec-field-wrapper,.mec-single-event .mec-events-meta-group-booking .mec-stripe-name-and-email-wrapper{display:flex;align-items:flex-start}.lity-content .mec-events-meta-group-booking .mec-booking-email-field-wrapper span.mec-booking-email-field-icon,.lity-content .mec-events-meta-group-booking .mec-booking-name-field-wrapper span.mec-booking-name-field-icon,.lity-content .mec-events-meta-group-booking .mec-field-wrapper span.mec-field-icon,.lity-content .mec-events-meta-group-booking .mec-stripe-name-and-email-wrapper span.mec-booking-email-field-icon,.mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-email-field-wrapper span.mec-booking-email-field-icon,.mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-name-field-wrapper span.mec-booking-name-field-icon,.mec-events-meta-group-booking .mec-booking-shortcode .mec-field-wrapper span.mec-field-icon,.mec-events-meta-group-booking .mec-booking-shortcode .mec-stripe-name-and-email-wrapper span.mec-booking-email-field-icon,.mec-single-event .mec-events-meta-group-booking .mec-booking-email-field-wrapper span.mec-booking-email-field-icon,.mec-single-event .mec-events-meta-group-booking .mec-booking-name-field-wrapper span.mec-booking-name-field-icon,.mec-single-event .mec-events-meta-group-booking .mec-field-wrapper span.mec-field-icon,.mec-single-event .mec-events-meta-group-booking .mec-stripe-name-and-email-wrapper span.mec-booking-email-field-icon{border:1px solid #e3e5e7;background:#fafafa;border-radius:3px 0 0 3px;min-width:40px;height:40px;display:flex;justify-content:center;align-items:center}.lity-content .mec-events-meta-group-booking .mec-booking-email-field-wrapper input,.lity-content .mec-events-meta-group-booking .mec-stripe-name-and-email-wrapper input,.mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-email-field-wrapper input,.mec-events-meta-group-booking .mec-booking-shortcode .mec-stripe-name-and-email-wrapper input,.mec-single-event .mec-events-meta-group-booking .mec-booking-email-field-wrapper input,.mec-single-event .mec-events-meta-group-booking .mec-stripe-name-and-email-wrapper input{border-left:none;border-radius:0 3px 3px 0}.lity-content .mec-events-meta-group-booking .mec-booking-name-field-wrapper input,.lity-content .mec-events-meta-group-booking .mec-field-wrapper input,.mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-name-field-wrapper input,.mec-events-meta-group-booking .mec-booking-shortcode .mec-field-wrapper input,.mec-single-event .mec-events-meta-group-booking .mec-booking-name-field-wrapper input,.mec-single-event .mec-events-meta-group-booking .mec-field-wrapper input{border-left:none;border-radius:0 3px 3px 0}.lity-content .mec-events-meta-group-booking .mec-red-notification input,.lity-content .mec-events-meta-group-booking .mec-red-notification select,.lity-content .mec-events-meta-group-booking .mec-red-notification textarea,.mec-events-meta-group-booking .mec-booking-shortcode .mec-red-notification input,.mec-events-meta-group-booking .mec-booking-shortcode .mec-red-notification select,.mec-events-meta-group-booking .mec-booking-shortcode .mec-red-notification textarea,.mec-single-event .mec-events-meta-group-booking .mec-red-notification input,.mec-single-event .mec-events-meta-group-booking .mec-red-notification select,.mec-single-event .mec-events-meta-group-booking .mec-red-notification textarea{border:1px solid #ff3c3c!important}.lity-content .mec-events-meta-group-booking .mec-red-notification input[type=checkbox],.lity-content .mec-events-meta-group-booking .mec-red-notification input[type=radio],.mec-events-meta-group-booking .mec-booking-shortcode .mec-red-notification input[type=checkbox],.mec-events-meta-group-booking .mec-booking-shortcode .mec-red-notification input[type=radio],.mec-single-event .mec-events-meta-group-booking .mec-red-notification input[type=checkbox],.mec-single-event .mec-events-meta-group-booking .mec-red-notification input[type=radio]{outline:1px solid #ff3c3c!important}.lity-content .mec-book-ticket-container .mec-red-notification input,.lity-content .mec-book-ticket-container .mec-red-notification select,.lity-content .mec-book-ticket-container .mec-red-notification textarea{border:1px solid #ff3c3c!important}.mec-booking .woocommerce-notices-wrapper .woocommerce-message{color:#089740;background-color:#effdef;margin:0;line-height:40px;border:0;border-radius:5px}.mec-booking .woocommerce-notices-wrapper .woocommerce-message a{margin:0}@media only screen and (max-width:479px){.lity-content .mec-events-meta-group-booking input[type=date],.lity-content .mec-events-meta-group-booking input[type=email],.lity-content .mec-events-meta-group-booking input[type=number],.lity-content .mec-events-meta-group-booking input[type=password],.lity-content .mec-events-meta-group-booking input[type=tel],.lity-content .mec-events-meta-group-booking input[type=text],.lity-content .mec-events-meta-group-booking select,.lity-content .mec-events-meta-group-booking textarea,.mec-events-meta-group-booking .mec-booking-shortcode input[type=date],.mec-events-meta-group-booking .mec-booking-shortcode input[type=email],.mec-events-meta-group-booking .mec-booking-shortcode input[type=number],.mec-events-meta-group-booking .mec-booking-shortcode input[type=password],.mec-events-meta-group-booking .mec-booking-shortcode input[type=tel],.mec-events-meta-group-booking .mec-booking-shortcode input[type=text],.mec-events-meta-group-booking .mec-booking-shortcode select,.mec-events-meta-group-booking .mec-booking-shortcode textarea,.mec-single-event .mec-events-meta-group-booking input[type=date],.mec-single-event .mec-events-meta-group-booking input[type=email],.mec-single-event .mec-events-meta-group-booking input[type=number],.mec-single-event .mec-events-meta-group-booking input[type=password],.mec-single-event .mec-events-meta-group-booking input[type=tel],.mec-single-event .mec-events-meta-group-booking input[type=text],.mec-single-event .mec-events-meta-group-booking select,.mec-single-event .mec-events-meta-group-booking textarea{width:100%}.lity-content .mec-events-meta-group-booking,.mec-events-meta-group-booking .mec-booking-shortcode,.mec-single-event .mec-events-meta-group-booking{padding:20px 10px}}.lity-content .mec-events-meta-group-booking input[type=email]:focus,.lity-content .mec-events-meta-group-booking input[type=number]:focus,.lity-content .mec-events-meta-group-booking input[type=password]:focus,.lity-content .mec-events-meta-group-booking input[type=tel]:focus,.lity-content .mec-events-meta-group-booking input[type=text]:focus,.lity-content .mec-events-meta-group-booking select:focus,.lity-content .mec-events-meta-group-booking textarea:focus,.mec-events-meta-group-booking .mec-booking-shortcode input[type=email]:focus,.mec-events-meta-group-booking .mec-booking-shortcode input[type=number]:focus,.mec-events-meta-group-booking .mec-booking-shortcode input[type=password]:focus,.mec-events-meta-group-booking .mec-booking-shortcode input[type=tel]:focus,.mec-events-meta-group-booking .mec-booking-shortcode input[type=text]:focus,.mec-events-meta-group-booking .mec-booking-shortcode select:focus,.mec-events-meta-group-booking .mec-booking-shortcode textarea:focus,.mec-events-meta-group-booking .mec-booking-shortcodec,.mec-single-event .mec-events-meta-group-booking input[type=email]:focus,.mec-single-event .mec-events-meta-group-booking input[type=number]:focus,.mec-single-event .mec-events-meta-group-booking input[type=password]:focus,.mec-single-event .mec-events-meta-group-booking input[type=tel]:focus,.mec-single-event .mec-events-meta-group-booking input[type=text]:focus,.mec-single-event .mec-events-meta-group-booking select:focus,.mec-single-event .mec-events-meta-group-booking textarea:focus{outline:0}.lity-content .mec-events-meta-group-booking input[type=checkbox],.lity-content .mec-events-meta-group-booking input[type=radio],.mec-events-meta-group-booking .mec-booking-shortcode input[type=checkbox],.mec-events-meta-group-booking .mec-booking-shortcode input[type=radio],.mec-single-event .mec-events-meta-group-booking input[type=checkbox],.mec-single-event .mec-events-meta-group-booking input[type=radio]{margin-right:6px;margin-top:5px;min-height:20px;clear:none;margin:0}.lity-container .mec-events-meta-group-booking input[type=radio]:before,.lity-content .mec-events-meta-group-booking input[type=radio]:before,.mec-events-meta-group-booking .mec-booking-shortcode input[type=radio]:before,.mec-single-event .mec-events-meta-group-booking input[type=radio]:before{content:"";display:inline-block;background:#fff;border-radius:50%;width:18px;height:18px;cursor:pointer;border:2px solid #e1e7ed;position:absolute;top:-2px;left:-2px}.lity-container .mec-events-meta-group-booking input[type=radio]:checked:before,.mec-events-meta-group-booking .mec-booking-shortcode input[type=radio]:checked:before,.mec-single-event .mec-events-meta-group-booking input[type=radio]:checked:before{background:#38d5ed;border:4px solid #fff;box-shadow:0 0 0 2px #afebf5;width:14px;height:14px;top:0;left:0}.lity-container .mec-events-meta-group-booking input[type=radio],.lity-content .mec-events-meta-group-booking input[type=radio],.mec-events-meta-group-booking .mec-booking-shortcode input[type=radio],.mec-single-event .mec-events-meta-group-booking input[type=radio]{min-height:0;margin:0;position:relative;top:3px;left:3px;width:14px;height:14px}.lity-content .mec-events-meta-group-booking input[type=checkbox],.mec-events-meta-group-booking .mec-booking-shortcode input[type=checkbox],.mec-single-event .mec-events-meta-group-booking input[type=checkbox]{float:left}.mec-events-meta-group-booking ul.mec-book-price-details{list-style:none;padding:0;overflow:hidden;display:flex;align-items:center}.mec-events-meta-group-booking ul.mec-book-price-details li{list-style:none;margin:0;border-right:1px dashed #e6e7e8;padding-right:30px!important;margin-right:30px;text-align:center}.mec-events-meta-group-booking ul.mec-book-price-details li.mec-book-price-detail.mec-book-price-detail-type-tickets{display:flex;align-items:center}.mec-events-meta-group-booking ul.mec-book-price-details li span{display:block;font-size:14px;font-weight:400;line-height:19px;color:#606367;margin-bottom:4px}.mec-events-meta-group-booking ul.mec-book-price-details li span.mec-book-price-detail-icon{margin:0 30px 0 0;width:48px}.mec-events-meta-group-booking ul.mec-book-price-details li span.mec-book-price-detail-amount{font-size:18px;font-weight:600;line-height:24px;color:#212224;margin-bottom:0}.mec-events-meta-group-booking ul.mec-book-price-details li:last-child{border-right:none}@media only screen and (max-width:767px){.mec-events-meta-group-booking ul.mec-book-price-details{flex-direction:column}.mec-events-meta-group-booking ul.mec-book-price-details li{border-right:none;padding-right:0!important;margin-right:0;border-bottom:1px dashed #e6e7e8;padding-bottom:30px!important;margin-bottom:30px}.lity-content .mec-events-meta-group-booking .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul,.mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul,.mec-single-event .mec-events-meta-group-booking .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul{flex-direction:column}.lity-content .mec-events-meta-group-booking .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul li,.mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul li,.mec-single-event .mec-events-meta-group-booking .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul li{padding-left:0;margin-left:0;border-left:none;padding-bottom:30px;margin-bottom:30px;border-bottom:1px dashed #e6e7e8}}.lity-container .mec-events-meta-group-booking .mec_book_first_for_all,.lity-content .mec-events-meta-group-booking .mec-booking-dates-checkboxes input[type=checkbox],.lity-content .mec-events-meta-group-booking .mec_book_first_for_all,.lity-content .mec-events-meta-group-booking input[type=checkbox],.mec-booking input[type=checkbox],.mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-dates-checkboxes input[type=checkbox],.mec-events-meta-group-booking .mec-booking-shortcode .mec_book_first_for_all,.mec-events-meta-group-booking .mec-booking-shortcode input[type=checkbox],.mec-single-event .mec-events-meta-group-booking .mec-booking-dates-checkboxes input[type=checkbox],.mec-single-event .mec-events-meta-group-booking .mec_book_first_for_all,.mec-single-event .mec-events-meta-group-booking input[type=checkbox],.mec-wrap .mec-simple-checkboxes-search ul li label input[type=checkbox]{-webkit-appearance:none;appearance:none;font:inherit;width:20px;height:20px;min-height:unset;padding:0;border:1px solid #e3e5e7;border-radius:4px;display:flex;margin:0 10px 0 1px;overflow:hidden}.lity-container .mec-events-meta-group-booking .mec_book_first_for_all:before,.lity-content .mec-events-meta-group-booking .mec-booking-dates-checkboxes input[type=checkbox]:before,.lity-content .mec-events-meta-group-booking .mec_book_first_for_all:before,.lity-content .mec-events-meta-group-booking input[type=checkbox]:before,.mec-booking input[type=checkbox]:before,.mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-dates-checkboxes input[type=checkbox]:before,.mec-events-meta-group-booking .mec-booking-shortcode .mec_book_first_for_all:before,.mec-events-meta-group-booking .mec-booking-shortcode input[type=checkbox]:before,.mec-single-event .mec-events-meta-group-booking .mec-booking-dates-checkboxes input[type=checkbox]:before,.mec-single-event .mec-events-meta-group-booking .mec_book_first_for_all:before,.mec-single-event .mec-events-meta-group-booking input[type=checkbox]:before,.mec-wrap .mec-simple-checkboxes-search ul li label input[type=checkbox]:before{content:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMCIgaGVpZ2h0PSI4IiB2aWV3Qm94PSIwIDAgMTAgOCI+DQogIDxwYXRoIGlkPSJEb25lIiBkPSJNOS4xNzUsMGEuOC44LDAsMCwwLS42NjUuMzA2bC01LjIsNS42NDdMMS4zODgsMy44MzNhLjcuNywwLDAsMC0uNjczLS4yMTIsMS4zODIsMS4zODIsMCwwLDAtLjcuNy44NjIuODYyLDAsMCwwLC4yMjYuNzI0TDIuNzk1LDcuNzkxYS43OTIuNzkyLDAsMCwwLDEuMDYyLjAxTDkuNzY5LDEuMzI5QS44MzIuODMyLDAsMCwwLDkuOTYuNTIxLDEsMSwwLDAsMCw5LjE3NSwwWiIgdHJhbnNmb3JtPSJ0cmFuc2xhdGUoMCAwKSIgZmlsbD0iI2ZmZiIvPg0KPC9zdmc+DQo=");min-width:18px;height:auto;line-height:16px;border-radius:2px;transform:scale(0);transition:120ms transform ease-in-out;background-color:var(--mec-color-skin);display:flex;justify-content:center}.lity-container .mec-events-meta-group-booking .mec_book_first_for_all:checked,.lity-content .mec-events-meta-group-booking .mec-booking-dates-checkboxes input[type=checkbox]:checked,.lity-content .mec-events-meta-group-booking input[type=checkbox]:checked,.mec-booking input[type=checkbox]:checked,.mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-dates-checkboxes input[type=checkbox]:checked,.mec-events-meta-group-booking .mec-booking-shortcode .mec_book_first_for_all:checked,.mec-events-meta-group-booking .mec-booking-shortcode input[type=checkbox]:checked,.mec-single-event .mec-events-meta-group-booking .mec-booking-dates-checkboxes input[type=checkbox]:checked,.mec-single-event .mec-events-meta-group-booking .mec_book_first_for_all:checked,.mec-single-event .mec-events-meta-group-booking input[type=checkbox]:checked,.mec-wrap .mec-simple-checkboxes-search ul li label input[type=checkbox]:checked{border:1px solid var(--mec-color-skin)!important}.lity-container .mec-events-meta-group-booking .mec_book_first_for_all:checked:before,.lity-content .mec-events-meta-group-booking .mec-booking-dates-checkboxes input[type=checkbox]:checked:before,.mec-booking input[type=checkbox]:checked:before,.mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-dates-checkboxes input[type=checkbox]:checked:before,.mec-events-meta-group-booking .mec-booking-shortcode .mec_book_first_for_all:checked:before,.mec-events-meta-group-booking .mec-booking-shortcode input[type=checkbox]:checked:before,.mec-single-event .mec-events-meta-group-booking .mec-booking-dates-checkboxes input[type=checkbox]:checked:before,.mec-single-event .mec-events-meta-group-booking .mec_book_first_for_all:checked:before,.mec-single-event .mec-events-meta-group-booking input[type=checkbox]:checked:before,.mec-wrap .mec-simple-checkboxes-search ul li label input[type=checkbox]:checked:before{transform:scale(1)}.lity-container .mec-events-meta-group-booking label.wn-checkbox-label,.lity-content .mec-events-meta-group-booking label.wn-checkbox-label,.mec-events-meta-group-booking .mec-booking-shortcode label.wn-checkbox-label,.mec-single-event .mec-events-meta-group-booking label.wn-checkbox-label{display:none}.lity-content .mec-events-meta-group-booking button[type=submit]:after,.mec-events-meta-group-booking .mec-booking-shortcode button[type=submit]:after,.mec-single-event .mec-events-meta-group-booking button[type=submit]:after,.mec-single-event a.button:after,.mec-wrap .mec-events-meta-group-booking button[type=submit]:after{display:none;font-family:simple-line-icons;content:"\e098";margin-left:4px;-webkit-animation:rotating 1.2s linear infinite;-moz-animation:rotating 1.2s linear infinite;-ms-animation:rotating 1.2s linear infinite;-o-animation:rotating 1.2s linear infinite;animation:rotating 1.2s linear infinite}.lity-content .mec-events-meta-group-booking button[type=submit].loading:after,.mec-events-meta-group-booking .mec-booking-shortcode button[type=submit].loading:after,.mec-single-event .mec-events-meta-group-booking button[type=submit].loading:after,.mec-single-event a.button.loading:after,.mec-wrap .mec-events-meta-group-booking button[type=submit].loading:after{display:inline-block}.mec-single-event .mec-event-export-module{display:block}.mec-single-event .mec-event-export-module.mec-frontbox .mec-event-exporting .mec-export-details ul{display:table;width:100%}.mec-single-event .mec-event-export-module.mec-frontbox .mec-event-exporting .mec-export-details ul li{display:table-cell}.mec-single-event .mec-event-export-module.mec-frontbox .mec-event-exporting .mec-export-details ul li:last-child{text-align:right}.mec-single-event .mec-event-export-module.mec-frontbox .mec-event-exporting .mec-export-details ul li a:hover{color:#fff}.mec-single-event .mec-event-export-module.mec-frontbox .mec-event-exporting .mec-export-details ul{padding-left:0;margin:15px 5px}.mec-single-event .mec-event-export-module.mec-frontbox .mec-event-exporting{padding-left:0;margin:0}.mec-ticket-price{margin-left:10px;font-size:13px;font-weight:300}.mec-book-reg-field-checkbox label,.mec-book-reg-field-radio label{line-height:1.36}.mec-book-reg-field-checkbox input[type=checkbox]{float:left;margin-right:10px!important}.mec-book-reg-field-radio input[type=radio]{float:left;margin-right:12px!important}.mec-book-ticket-container .mec-reg-mandatory:nth-child(2) label:after,.mec-book-ticket-container .mec-reg-mandatory:nth-child(3) label:after,.mec-book-ticket-container .wbmec-mandatory{content:"";color:red;width:50px;height:50px;font-size:14px;padding-left:5px}@media only screen and (max-width:767px){.mec-single-event .mec-event-export-module.mec-frontbox .mec-event-exporting .mec-export-details ul li{width:100%;min-height:40px;margin-bottom:15px;text-align:center;float:none;display:block}.mec-single-event .mec-event-export-module.mec-frontbox .mec-event-exporting .mec-export-details ul li a{width:100%;padding-left:0;padding-right:0;text-align:center;display:block;font-size:12px}}@media only screen and (max-width:767px){.lity-content .mec-events-meta-group-booking .mec-single-event .mec-events-meta-group-booking,.mec-events-meta-group-booking .mec-booking-shortcode{margin-bottom:30px}}.mec-single-event .mec-event-meta dt,.mec-single-event .mec-event-meta h3,.mec-single-modern .col-md-4 .mec-sponsors-details h3,.mec-sponsors-details .mec-events-single-section-title{text-transform:uppercase;font-size:16px;font-weight:700;padding-bottom:5px;display:inline;color:#000;padding-left:10px}.mec-single-event .mec-event-meta h6,.mec-single-event-sponsor span{font-size:14px;padding-bottom:5px;display:inline-block;color:#8d8d8d;margin:0;padding:0}.mec-single-event .mec-event-meta .mec-events-event-categories a,.mec-single-event .mec-event-meta dd{font-size:14px;color:#8d8d8d}.mec-single-event .mec-event-meta .mec-location dd.author{color:#3c3b3b}.mec-single-event .mec-event-meta dd{margin:0;padding-left:35px}.mec-single-event .mec-event-meta dd.mec-events-event-categories{min-height:35px;line-height:35px}@media only screen and (max-width:480px){.single-mec-events .lity-container{width:100%}.single-mec-events .lity-content .mec-events-meta-group-booking{padding:20px;width:85%;margin:0 auto}}.mec-single-event .mec-event-meta dd.mec-events-event-categories:first-of-type{padding-top:5px}.mec-single-event .mec-event-meta dd.mec-events-event-categories:last-of-type{border-bottom:0}.mec-single-event .mec-event-meta dd a{color:#8d8d8d;transition:all .2s ease;-ms-word-wrap:break-word;word-wrap:break-word}.mec-single-event .mec-event-meta dd a i:before{font-size:16px!important}.mec-single-event .mec-event-meta dd a i{margin-right:8px}.mec-single-event .mec-event-meta dl{margin-bottom:0}.mec-single-event .mec-event-meta .mec-events-event-cost{font-size:14px;font-weight:300}.mec-single-event .mec-event-meta .mec-events-address .mec-address,.mec-single-event .mec-event-meta .mec-location-opening-hour span,.mec-single-event .mec-event-meta .mec-location-url span{font-size:12px;color:#a9a9a9;display:block}.mec-single-event .mec-event-meta .mec-location-opening-hour,.mec-single-event .mec-event-meta .mec-location-tel,.mec-single-event .mec-event-meta .mec-location-url{margin-top:10px}.mec-single-event .mec-event-meta .mec-location-description{margin-top:15px;padding:0}.mec-single-event .mec-event-meta .mec-events-meta-group-venue .author{margin-bottom:0;color:#8d8d8d;font-size:13px}.mec-single-event .mec-events-event-image{margin-bottom:0}.mec-single-event .mec-events-event-image img{border-radius:5px;max-width:100%;height:auto}.mec-event-gallery-wrapper{display:flex;flex-direction:row}.mec-event-gallery-wrapper .mec-event-gallery-image-list-wrapper{min-width:90px;margin-right:30px}.mec-event-gallery-wrapper .mec-event-gallery-image-list-wrapper ul{list-style:none;padding:0}.mec-event-gallery-wrapper .mec-event-gallery-image-list-wrapper ul li{display:flex;margin-bottom:15px;cursor:pointer}.mec-event-gallery-wrapper .mec-event-gallery-image-list-wrapper ul li img{width:90px;border-radius:5px}.mec-event-gallery-wrapper .mec-event-gallery-image img{border-radius:5px}@media (max-width:960px){.mec-event-gallery-wrapper{flex-direction:column-reverse}.mec-event-gallery-wrapper .mec-event-gallery-image{margin-bottom:10px}.mec-event-gallery-wrapper .mec-event-gallery-image-list-wrapper{margin-right:0}.mec-event-gallery-wrapper .mec-event-gallery-image-list-wrapper ul{display:flex;flex-flow:row wrap}.mec-event-gallery-wrapper .mec-event-gallery-image-list-wrapper ul li{margin-bottom:15px;margin-right:15px;flex:1 1 calc(15% - 20px)}}#mec-event-gallery ul#mec_meta_box_event_gallery{display:flex;flex-flow:row wrap;list-style:none;padding:0}#mec-event-gallery ul#mec_meta_box_event_gallery li{flex:0 1 calc(33.333333% - 10px);margin-right:10px;position:relative}#mec-event-gallery ul#mec_meta_box_event_gallery li img{width:100%!important;height:75px;object-fit:cover}#mec-event-gallery ul#mec_meta_box_event_gallery li span.mec-event-gallery-delete{padding:0;min-height:20px;height:20px;width:20px;margin:0;border-radius:50%;position:absolute;top:2px;right:2px;box-shadow:none;background:#fff;border-color:#e3e4e5;font-size:0px;cursor:pointer;transition:.2s}#mec-event-gallery ul#mec_meta_box_event_gallery li span.mec-event-gallery-delete:before{content:"";width:20px;height:20px;display:block;background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgZm9jdXNhYmxlPSJmYWxzZSIgd2lkdGg9IjFlbSIgaGVpZ2h0PSIxZW0iIHN0eWxlPSItbXMtdHJhbnNmb3JtOiByb3RhdGUoMzYwZGVnKTsgLXdlYmtpdC10cmFuc2Zvcm06IHJvdGF0ZSgzNjBkZWcpOyB0cmFuc2Zvcm06IHJvdGF0ZSgzNjBkZWcpOyIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDIwIDIwIiBmaWxsPSIjZWE2NDg1Ij48cGF0aCBkPSJNMTQuOTUgNi40NkwxMS40MSAxMGwzLjU0IDMuNTRsLTEuNDEgMS40MUwxMCAxMS40MmwtMy41MyAzLjUzbC0xLjQyLTEuNDJMOC41OCAxMEw1LjA1IDYuNDdsMS40Mi0xLjQyTDEwIDguNThsMy41NC0zLjUzeiIvPjwvc3ZnPg==");background-position:center}#mec-event-gallery ul#mec_meta_box_event_gallery li span.mec-event-gallery-delete:hover{color:#fff;border-color:#ea6485;background:#ea6485}#mec-event-gallery ul#mec_meta_box_event_gallery li span.mec-event-gallery-delete:hover:before{background-image:url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBhcmlhLWhpZGRlbj0idHJ1ZSIgZm9jdXNhYmxlPSJmYWxzZSIgd2lkdGg9IjFlbSIgaGVpZ2h0PSIxZW0iIHN0eWxlPSItbXMtdHJhbnNmb3JtOiByb3RhdGUoMzYwZGVnKTsgLXdlYmtpdC10cmFuc2Zvcm06IHJvdGF0ZSgzNjBkZWcpOyB0cmFuc2Zvcm06IHJvdGF0ZSgzNjBkZWcpOyIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQgbWVldCIgdmlld0JveD0iMCAwIDIwIDIwIiBmaWxsPSIjZmZmZmZmIj48cGF0aCBkPSJNMTQuOTUgNi40NkwxMS40MSAxMGwzLjU0IDMuNTRsLTEuNDEgMS40MUwxMCAxMS40MmwtMy41MyAzLjUzbC0xLjQyLTEuNDJMOC41OCAxMEw1LjA1IDYuNDdsMS40Mi0xLjQyTDEwIDguNThsMy41NC0zLjUzeiIvPjwvc3ZnPg==")}.mec-single-event h2.mec-single-event-title{margin-bottom:30px;font-weight:700;font-size:33px}.mec-single-event .mec-booking-button{border-bottom:none;letter-spacing:.5px;line-height:48px;height:76px;transition:all .5s ease;color:#fff;padding:16px;display:block;text-align:center;font-size:16px;border-radius:2px;box-shadow:0 1px 2px rgba(0,0,0,.15)}.mec-single-event .mec-booking-button:hover{background-color:#101010!important}.mec-single-event .mec-event-tags a{display:inline-block;color:#444;font-size:11px;text-transform:uppercase;letter-spacing:1.5px;font-weight:500;padding:3px 7px;border:1px solid #ddd;border-radius:2px;background:#fff;margin:1px 3px}.mec-single-event .mec-event-tags:before{font-size:24px;color:#303030;margin-right:5px;content:"\f02c";font-family:fontawesome}.mec-single-event .mec-event-tags{padding-top:13px}.mec-single-event .mec-event-sharing{margin:30px 0 10px}.mec-region.mec-events-abbr,.mec-single-event .mec-street-address{font-style:normal;font-size:13px}.mec-events-meta-group.mec-events-meta-group-venue:before,.mec-single-event-date:before,.mec-single-event-time:before{color:#40d9f1}.mec-single-event .mec-event-social{text-align:center}.mec-single-event .mec-event-social h3{text-transform:uppercase;font-size:15px;font-weight:700;padding-bottom:5px;color:#313131;border-bottom:4px solid #ebebeb;width:100%;display:block;padding-bottom:10px;position:relative}.mec-single-event .mec-social-single:before{padding:13px 35px;border-bottom:4px solid #40d9f1;font-size:6px;content:"";text-align:center;position:absolute;bottom:-4px;margin-left:39px}.mec-single-event .mec-event-social .event-sharing{margin-top:30px}.mec-single-event .mec-event-social ul{list-style:none;margin-left:0;padding:0;display:flex;align-items:center;justify-content:center;flex-wrap:wrap}.mec-single-event .mec-event-social li.mec-event-social-icon{display:inline-block}.mec-single-event .mec-event-social li.mec-event-social-icon a{display:inline-block;color:#fff;width:40px;height:40px;padding:6px;font-size:18px;margin-right:5px;margin-bottom:5px;border-radius:2px}.mec-single-event .mec-event-social a.facebook{background:#3b5996}.mec-single-event .mec-event-social a.facebook:hover{background:#28385c}.mec-single-event .mec-event-social a.twitter svg{width:22px;height:22px;margin-top:0;padding:0}.mec-single-event .mec-event-social a.twitter{background:#e1e1e1;padding:9px!important}.mec-single-event .mec-event-social a.twitter:hover{background:#e1e1e1}.mec-single-event .mec-event-social a.twitter:hover{background:#373737}.mec-single-event .mec-event-social a.twitter:hover svg path{fill:#fff}.mec-single-event .mec-event-social a.vimeo{background:#0dadd6}.mec-single-event .mec-event-social a.vimeo:hover{background:#0a85a3}.mec-single-event .mec-event-social a.dribble{background:#d53e68}.mec-single-event .mec-event-social a.dribble:hover{background:#bf4c78}.mec-single-event .mec-event-social a.youtube{background:#cb322c}.mec-single-event .mec-event-social a.youtube:hover{background:#992622}.mec-single-event .mec-event-social a.pinterest{background:#cb2027}.mec-single-event .mec-event-social a.pinterest:hover{background:#99181d}.mec-single-event .mec-event-social a.google{background:#c3391c}.mec-single-event .mec-event-social a.google:hover{background:#99181f}.mec-single-event .mec-event-social a.linkedin{background:#0073b2}.mec-single-event .mec-event-social a.linkedin:hover{background:#005380}.mec-single-event .mec-event-social a.email{background:#ff5d5e}.mec-single-event .mec-event-social a.email:hover{background:#cc4949}.mec-single-event .mec-event-social a.vk{background:#5b88bd}.mec-single-event .mec-event-social a.vk:hover{background:#3d608a}.mec-single-event .mec-event-social a.tumblr{background:#34465d}.mec-single-event .mec-event-social a.tumblr:hover{background:#273649}.mec-single-event .mec-event-social a.telegram{background:#08c}.mec-single-event .mec-event-social a.telegram:hover{background:#1076be}.mec-single-event .mec-event-social a.whatsapp{background:#25d366}.mec-single-event .mec-event-social a.whatsapp:hover{background:#23ac55}.mec-single-event .mec-event-social a.flipboard{background:#e12828}.mec-single-event .mec-event-social a.flipboard:hover{background:#af1e1e}.mec-single-event .mec-event-social a.pocket{background:#ef4056}.mec-single-event .mec-event-social a.pocket:hover{background:#8d1717}.mec-single-event .mec-event-social a.reddit{background:#ff5700}.mec-single-event .mec-event-social a.reddit:hover{background:#c94909}.mec-single-event .mec-event-social a.flipboard svg,.mec-single-event .mec-event-social a.telegram svg{height:18px;margin-top:5px}.mec-single-event .mec-event-social li.mec-event-social-icon a svg{display:unset}.mec-single-event .mec-event-social a.rss{background:#f29a1d}.mec-single-event .mec-event-social a.rss:hover{background:#cc7400}.mec-single-event .mec-event-social a.instagram{background:#457399}.mec-single-event .mec-event-social a.instagram:hover{background:#2e4d66}.mec-single-event .mec-event-social a.linkedin{background:#457399}.mec-single-event .mec-event-social a.linkedin:hover{background:#2e4d66}.mec-single-event .mec-event-social a.other-social{background:#ff5d5e}.mec-single-event .mec-event-social a.other-social:hover{background:#cc4949}.mec-single-event .mec-event-social{text-align:center}.lity-content .mec-events-meta-group-booking form,.mec-events-meta-group-booking .mec-booking-shortcode .mec-wrap-checkout,.mec-events-meta-group-booking .mec-booking-shortcode form,.mec-single-event .mec-events-meta-group-booking form{margin:0}.lity-content .mec-events-meta-group-booking .mec-wrap-checkout h4,.lity-content .mec-events-meta-group-booking form>h4,.mec-events-meta-group-booking .mec-booking-shortcode .mec-wrap-checkout h4,.mec-events-meta-group-booking .mec-booking-shortcode form>h4,.mec-single-event .mec-events-meta-group-booking .mec-wrap-checkout h4,.mec-single-event .mec-events-meta-group-booking form>h4,.mec-single-event .mec-frontbox-title,.mec-single-event .mec-wrap-checkout h4{text-transform:uppercase;font-size:15px;font-weight:700;color:#313131;border-bottom:4px solid #ebebeb;width:100%;display:block;padding-bottom:10px;position:relative;text-align:center;margin:0 0 40px 0}.lity-content .mec-events-meta-group-booking .mec-wrap-checkout h4:before,.lity-content .mec-events-meta-group-booking form>h4:before,.mec-events-meta-group-booking .mec-booking-shortcode .mec-wrap-checkout h4:before,.mec-events-meta-group-booking .mec-booking-shortcode form>h4:before,.mec-single-event .mec-events-meta-group-booking .mec-wrap-checkout h4:before,.mec-single-event .mec-events-meta-group-booking form>h4:before,.mec-single-event .mec-frontbox-title:before,.mec-single-event .mec-wrap-checkout h4:before{padding:1px 35px;border-bottom:4px solid #40d9f1;font-size:6px;content:"";text-align:center;position:absolute;bottom:-4px;margin-left:-35px;left:50%}.lity-content .mec-events-meta-group-booking input[data-stripe=exp-month],.lity-content .mec-events-meta-group-booking input[data-stripe=exp-year],.mec-events-meta-group-booking .mec-booking-shortcode input[data-stripe=exp-month],.mec-events-meta-group-booking .mec-booking-shortcode input[data-stripe=exp-year],.mec-single-event .mec-events-meta-group-booking input[data-stripe=exp-month],.mec-single-event .mec-events-meta-group-booking input[data-stripe=exp-year]{width:47%!important;margin-right:12px;margin-top:5px;display:inline-block!important}@media (max-width:768px){.mec-events-meta-group-booking .mec-booking-shortcode input[data-stripe=exp-month],.mec-events-meta-group-booking .mec-booking-shortcode input[data-stripe=exp-year],.mec-single-event .mec-events-meta-group-booking input[data-stripe=exp-month],.mec-single-event .mec-events-meta-group-booking input[data-stripe=exp-year]{width:100%!important;margin-right:0;display:block!important}}.lity-content .mec-events-meta-group-booking .mec-booking-dates-checkboxes,.mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-dates-checkboxes,.mec-single-event .mec-events-meta-group-booking .mec-booking-dates-checkboxes{margin-bottom:22px}.lity-content .mec-events-meta-group-booking .mec-booking-dates-checkboxes label,.mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-dates-checkboxes label,.mec-single-event .mec-events-meta-group-booking .mec-booking-dates-checkboxes label{margin-bottom:3px;line-height:20px}.lity-content .mec-events-meta-group-booking .mec-booking-dates-checkboxes label{display:flex}.lity-content .mec-events-meta-group-booking .mec-booking-dates-checkboxes input[type=checkbox]{margin-top:-1px}.mec-events-meta-group-booking-shortcode .mec-booking-dates-checkboxes label{display:flex;align-items:center}.mec-events-meta-group-booking-shortcode .mec-booking-dates-checkboxes input[type=checkbox]{margin-top:1px}.mec-event-meta i:before{font-size:20px!important;vertical-align:middle}.mec-event-meta .mec-single-event-additional-organizers dl dd i:before,.mec-event-meta .mec-single-event-location dl dd i:before,.mec-event-meta .mec-single-event-organizer dl dd i:before{font-size:14px!important}#mec-wrap .mec-events-day-time-slot .mec-events-content{float:left;width:33%;padding:0 15px}#mec-wrap .mec-events-day-time-slot .mec-events-event-image{padding-left:0}#mec-events-content .mec-events-abbr{color:#8d8d8d;font-size:14px}.mec-single-event .mec-events-content{margin-bottom:30px}.mec-single-event .mec-organizer-url a{word-wrap:break-word}.mec-single-event #headline{margin:0 0 10px}.mec-single-event #headline h2{padding:0}.mec-single-event .mec-events-meta-group.mec-events-meta-group-gmap .mec-events-venue-map{margin-top:0;padding:8px;border:1px solid #e5e5e5;border-radius:7px}#mec-events-gmap-0{height:325px!important}.mec-events-list .mec-events-day-time-slot .mec-events-event-meta{width:33%;float:left;padding:40px;height:auto;margin:0}.mec-events-day-time-slot .mec-events-content.description.entry-summary{font-size:15px;font-weight:300;color:#8d8d8d}.mec-events-day-time-slot .type-mec_events h2{font-size:28px;padding-bottom:20px}.mec-events-day .mec-events-day-time-slot .type-mec_events{margin:0}.mec-events-day .mec-events-day-time-slot h5{background-color:#8d8d8d}.mec-single-event .mec-event-meta .mec-single-event-additional-locations .mec-events-single-section-title,.mec-single-event .mec-event-meta .mec-single-event-additional-organizers .mec-events-single-section-title,.mec-single-event .mec-event-meta .mec-single-event-location .mec-events-single-section-title,.mec-single-event .mec-event-meta .mec-single-event-organizer .mec-events-single-section-title,.mec-single-event .mec-events-meta-date h3{padding:0 0 5px 10px;margin-top:0;display:inline-block}.mec-events-single-section-title a span{font-size:12px}.mec-single-event-additional-locations .mec-single-event-location{padding:0}.mec-single-event .mec-events-meta-date h3{width:100%}.mec-single-event .mec-events-event-image{border:0}.mec-single-event .mec-events-venue-map{padding:0}.mec-event-cost,.mec-event-more-info,.mec-event-website,.mec-events-meta-date,.mec-local-time-details,.mec-single-event-additional-locations,.mec-single-event-additional-organizers,.mec-single-event-category,.mec-single-event-date,.mec-single-event-label,.mec-single-event-location,.mec-single-event-organizer,.mec-single-event-sponsor,.mec-single-event-time{padding:12px 14px 8px;margin-bottom:12px;vertical-align:baseline;position:relative}.mec-single-event-sponsor ul{margin:0;padding:0;list-style:none}.mec-single-event-sponsor ul li{margin-bottom:35px}.mec-single-event-sponsor ul li:last-child{margin-bottom:0}.mec-wrap .mec-single-event-sponsor h3,.mec-wrap .mec-single-modern .col-md-4 .mec-sponsors-details h3{padding:0 0 20px 0;margin:0;display:block}.mec-single-event .mec-events-meta-date dd,.mec-single-event .mec-single-event-additional-organizers dd,.mec-single-event .mec-single-event-organizer dd{padding-left:0;margin-bottom:10px}.mec-single-event .mec-single-event-location dd{padding-left:0}.mec-single-event .mec-single-event-location dd.author>a{font-size:16px;font-weight:300}.mec-single-event .mec-event-meta dd.mec-organizer-email a,.mec-single-event .mec-events-meta-date dd span,.mec-single-event .mec-single-event-additional-organizers dd span,.mec-single-event .mec-single-event-location dd span,.mec-single-event .mec-single-event-organizer dd span{display:block;padding-left:0;color:#8d8d8d}.mec-single-event .mec-events-meta-date i,.mec-single-event .mec-single-event-additional-organizers i,.mec-single-event .mec-single-event-location dl dd i,.mec-single-event .mec-single-event-organizer dl dd i{margin-right:10px;margin-left:12px}.mec-events-meta-group.mec-events-meta-group-venue dl{margin-bottom:0}address.mec-events-address{line-height:19px;font-style:normal;font-size:12px}.mec-single-event .mec-event-content dt{margin-top:5px}.mec-single-event .mec-single-event-additional-organizers .mec-single-event-additional-organizer{margin-bottom:15px;padding-bottom:5px}.mec-single-event .mec-single-event-additional-organizers .mec-single-event-additional-organizer:last-child{margin-bottom:0;padding-bottom:0}.mec-event-category-color{width:9px;height:9px;display:inline-block;vertical-align:middle;margin:0 0 0 4px;border-radius:9px}.mec-event-schedule-content{border-left:4px solid #f0f0f0;padding-top:10px;margin-top:30px;margin-left:25px;margin-bottom:20px;color:#8a8a8a}.mec-event-schedule-content dl{padding-left:24px;font-size:12px;position:relative;margin-bottom:35px}.mec-event-schedule-content dl:before{content:"";display:block;position:absolute;left:0;top:4px;width:20px;height:0;border-top:4px solid #f0f0f0}.mec-event-schedule-content dl dt{margin:0 0 10px;line-height:1.16}.mec-event-schedule-content dl dt.mec-schedule-title{font-size:13px;color:#5a5a5a;font-weight:700}.mec-event-schedule-content dl dt.mec-schedule-description{font-weight:300}.mec-event-schedule-content .mec-schedule-speakers{padding:10px}.mec-wrap .mec-event-schedule-content h6{font-size:13px;color:#5a5a5a;font-weight:700;display:inline-block}.mec-wrap .mec-event-schedule-content a{font-weight:400;color:#5a5a5a;transition:all .1s ease}.single-mec-events .mec-speakers-details ul{padding:0;margin-left:0}.mec-single-event .mec-speakers-details ul li{list-style:none;padding:5px 5px 18px 5px;margin-top:14px}.mec-single-event .mec-speakers-details ul li a{-webkit-transition:.2s all ease;transition:.2s all ease}.mec-single-event .mec-speakers-details ul li .mec-speaker-avatar a img{float:left;border-radius:50%;transition:.2s all ease;border:2px solid transparent;width:68px;height:68px;object-fit:cover}.mec-single-event .mec-speakers-details ul li .mec-speaker-avatar a:hover img{border-color:#40d9f1}.mec-single-event .mec-speakers-details .speaker-details{display:inline-block}.mec-single-event .mec-speakers-details ul li .mec-speaker-name{display:inline-block;margin-top:10px;font-size:15px;line-height:1.8;text-transform:capitalize;font-weight:700!important;padding-left:8px}.mec-single-event .mec-speakers-details ul li .mec-speaker-job-title{display:block;font-size:12px;margin-top:-1px;padding-left:8px;color:#888}.mec-single-event-additional-organizers img,.mec-single-event-location img,.mec-single-event-organizer img,.mec-sponsor img{margin-bottom:5px;width:100%}.mec-qrcode-details{text-align:center}.mec-time-comment{font-size:11px}.mec-wrap .mec-attendees-list-details p{font-weight:300;margin:20px 0 0 0;color:#8d8d8d}.mec-wrap .mec-attendees-list-details li{list-style:none;display:block;margin-top:15px}.mec-wrap .mec-attendees-list-details li .mec-attendee-avatar{display:inline-block}.mec-wrap .mec-attendees-list-details li .mec-attendee-profile-link{display:inline-block;vertical-align:top;margin-left:10px}.mec-attendees-list-details ul{margin-bottom:0}.mec-attendees-list-details .mec-attendee-profile-link a{color:#8d8d8d;display:block}.mec-attendees-list-details .mec-attendee-profile-link span{display:inline-block;color:#000;vertical-align:middle;cursor:pointer}.mec-attendees-list-details span.mec-attendee-profile-ticket-number{border-radius:50px;width:20px;height:20px;font-size:12px;text-align:center;color:#fff;margin-right:4px;line-height:20px}#wrap .mec-attendees-list-details span.mec-attendee-profile-ticket-number{line-height:19px}.mec-attendees-list-details .mec-attendee-profile-link span i{vertical-align:middle;font-size:9px;font-weight:700;margin-left:5px}.mec-attendees-list-details .mec-attendees-toggle{border:1px solid #e6e6e6;background:#fafafa;padding:15px 15px 0;border-radius:3px;margin:12px 0 20px 52px;position:relative;font-size:13px;box-shadow:0 3px 1px 0 rgba(0,0,0,.02)}.mec-attendees-list-details .mec-attendees-toggle:after,.mec-attendees-list-details .mec-attendees-toggle:before{content:"";display:block;position:absolute;left:50px;width:0;height:0;border-style:solid;border-width:10px}.mec-attendees-list-details .mec-attendees-toggle:after{top:-20px;border-color:transparent transparent #fafafa transparent}.mec-attendees-list-details .mec-attendees-toggle:before{top:-21px;border-color:transparent transparent #e1e1e1 transparent}.mec-attendees-list-details .mec-attendees-toggle .mec-attendees-item{padding-bottom:15px}.mec-attendees-list-details .mec-attendee-avatar img{border-radius:3px}.mec-attendee-avatar-sec{float:left;width:50px;margin-right:12px}.mec-attendee-profile-name-sec,.mec-attendee-profile-ticket-sec{float:left;width:calc(100% - 62px);margin-top:3px}.mec-calendar{margin-bottom:20px;border:1px solid #e8e8e8;width:100%;box-shadow:0 2px 0 0 rgba(0,0,0,.016)}.mec-calendar .mec-calendar-topsec{display:table;background:#fff}.mec-calendar .mec-calendar-topsec .mec-calendar-side .mec-calendar-table{border-top:1px solid #eaeaea}.mec-calendar .mec-calendar-topsec .mec-calendar-events-sec{display:none}.mec-calendar .mec-calendar-side{width:590px;display:table-cell;padding:40px;position:relative;text-align:center;box-shadow:0 1px 5px 6px rgba(0,0,0,.005) inset}.mec-calendar .mec-calendar-events-side{display:table-cell;height:100%;border-left:1px solid #efefef;padding:40px;width:100%}.mec-calendar .mec-calendar-events-side .mec-table-side-day{width:46px;height:46px;margin:0 auto 20px;position:relative;text-align:center;line-height:44px;border:1px solid #40d9f1;border-radius:50%;font-size:14px;font-weight:600;padding:0}.mec-calendar .mec-calendar-events-side .mec-table-side-title{text-align:center;font-size:11px;text-transform:uppercase;letter-spacing:3px;margin-bottom:14px}.mec-calendar .mec-calendar-header{position:relative;width:560px;margin-top:8px;margin-bottom:16px}.mec-calendar.mec-event-calendar-classic .mec-calendar-header{width:unset}.mec-calendar .mec-calendar-header h2{text-transform:uppercase;font-size:22px;font-weight:700;color:#333}.mec-calendar .mec-event-footer{width:auto;min-height:60px}.mec-calendar dl{display:table;margin:0;border:none;padding:0;table-layout:fixed}.mec-calendar dt{display:table-cell;transition:all .66s ease;color:#a4aab1;background:#fff;border-radius:44px;font-size:14px;width:80px;height:80px;line-height:80px;text-align:center}.excerpt-wrap .mec-wrap dt,.nv-content-wrap .mec-wrap dt{display:table-cell}.mec-calendar .mec-calendar-table .mec-no-event{display:none}.mec-calendar .mec-calendar-table-head dt{font-weight:600;text-transform:uppercase;font-size:15px;color:#636f72}.mec-calendar .mec-calendar-row dt:hover{background:#f4f4f4}.mec-calendar .mec-table-nullday{color:#cacaca}.mec-calendar.mec-box-calendar .mec-table-nullday:last-child{border-right:1px solid #eaeaea}.mec-calendar .mec-next-month:hover,.mec-calendar .mec-prev-month:hover{background:#f4f4f4}.mec-calendar .mec-selected-day,.mec-calendar .mec-selected-day:hover{background:#40d9f1;color:#fff}.mec-calendar .mec-selected-day a{color:#fff}.mec-calendar .mec-has-event{position:relative}.mec-calendar .mec-calendar-row dt.mec-has-event:hover{background:#40d9f1}.mec-calendar .mec-has-event a{cursor:pointer;display:block;width:100%;height:100%;border-radius:50%;color:#4d4d4d;transition:all .25s ease;text-decoration:none;box-shadow:none}.mec-calendar .mec-calendar-row dt.mec-has-event.mec-selected-day a,.mec-calendar .mec-calendar-row dt.mec-has-event:hover a{color:#fff}.mec-calendar .mec-has-event:after{background-color:#40d9f1;border-radius:50%;display:block;content:"";width:8px;height:8px;bottom:10px;left:calc(50% - 4px);position:absolute;transition:all .25s ease}.mec-calendar .mec-calendar-row dt.mec-has-event:hover:after{background-color:#fff}.mec-calendar .mec-has-event.mec-selected-day:after{display:none}.mec-calendar .mec-event-article{display:flex;text-align:left;margin-bottom:0;padding-bottom:25px;padding-top:26px;border-top:1px solid #efefef;transition:all .33s ease}@media only screen and (max-width:479px){.mec-calendar.mec-calendar-daily .mec-event-artile,.mec-calendar.mec-calendar-weekly .mec-event-article{flex-direction:column;gap:15px}}.mec-daily-contents-wrapper,.mec-weekly-contents-wrapper{display:flex}.mec-calendar .mec-month-side .mec-event-article{padding-left:5px;padding-right:5px}.mec-calendar .mec-event-article:hover{background-color:#fafafa}.mec-calendar .mec-event-article .mec-event-time{font-size:11px;line-height:1.1;margin:0}.mec-calendar .mec-event-article .mec-event-title{font-size:13px;padding:0;margin:10px 0 8px;font-weight:700;text-transform:uppercase}.mec-calendar .mec-event-article .mec-event-title a{text-decoration:none;color:#494949;transition:color .3s ease}.mec-calendar .mec-event-article .mec-event-title a:hover{color:#40d9f1}.mec-calendar .mec-event-list-classic .mec-event-image img{width:65px;height:auto}.mec-calendar .mec-event-article .mec-event-image{max-width:70px;margin-right:15px;height:auto}.mec-calendar .mec-event-article .mec-categories-wrapper,.mec-calendar .mec-event-article .mec-categories-wrapper ul.mec-categories li.mec-category a,.mec-calendar .mec-event-article .mec-event-detail,.mec-calendar .mec-event-article .mec-localtime-details div,.mec-calendar .mec-event-article .mec-shortcode-organizers,.mec-calendar .mec-event-article .mec-shortcode-organizers .mec-organizer-item span{font-size:13px;line-height:1.3;color:#9a9a9a;margin-bottom:0}.mec-calendar .mec-calendar-side .mec-next-month,.mec-calendar .mec-calendar-side .mec-previous-month{cursor:pointer;position:absolute;top:0;min-width:50px;height:50px;line-height:50px;text-align:center;background:#fff;color:#a9a9a9;font-size:12px;letter-spacing:1px;text-transform:uppercase;padding-left:10px;padding-right:10px;border:1px solid #efefef;border-top:none;box-shadow:0 2px 0 0 rgba(0,0,0,.015);transition:all .33s ease}.mec-calendar .mec-calendar-side .mec-next-month i,.mec-calendar .mec-calendar-side .mec-previous-month i{font-size:12px;color:#40d9f1;cursor:pointer}.mec-calendar .mec-calendar-side .mec-next-month:hover,.mec-calendar .mec-calendar-side .mec-previous-month:hover{background-color:#f9f9f9;color:#40d9f1}.mec-calendar .mec-calendar-side .mec-previous-month{left:0;border-bottom-right-radius:6px;border-left:none}.mec-calendar .mec-calendar-side .mec-next-month{right:0;border-bottom-left-radius:6px;border-right:none}@media only screen and (min-width:961px){.mec-wrap.mec-sm959 .mec-calendar:not(.mec-event-calendar-classic):not(.mec-calendar-weekly) .mec-has-event:after{width:6px;height:6px;bottom:6px}.mec-wrap.mec-sm959 .mec-calendar:not(.mec-event-calendar-classic):not(.mec-calendar-weekly) .mec-calendar-side{width:370px}.mec-wrap.mec-sm959 .mec-calendar:not(.mec-event-calendar-classic):not(.mec-calendar-weekly) .mec-calendar-header{position:relative;width:350px;margin-top:30px;margin-bottom:20px;padding-top:20px}.mec-wrap.mec-sm959 .mec-calendar:not(.mec-event-calendar-classic):not(.mec-calendar-weekly) dt{width:50px;height:50px;line-height:50px}}@media only screen and (max-width:1200px){.mec-calendar .mec-has-event:after{width:6px;height:6px;bottom:6px}.mec-calendar .mec-calendar-side{width:370px}.mec-calendar .mec-calendar-header{position:relative;width:350px;margin-top:30px}.mec-calendar dt{width:50px;height:50px;line-height:50px}}@media only screen and (max-width:767px){.mec-calendar .mec-calendar-header h2{font-size:18px}.mec-calendar .mec-calendar-topsec{width:100%}.mec-calendar .mec-calendar-side{width:100%;display:block;padding:30px}.mec-calendar .mec-calendar-header{width:auto}.mec-calendar .mec-calendar-events-side{width:100%;display:block;height:100%;border-left:none;border-top:1px solid #efefef;padding:20px}.mec-calendar dl{width:100%}.mec-calendar dt{width:14%;height:60px;line-height:60px;border-radius:50px}}@media only screen and (max-width:479px){.mec-calendar .mec-has-event:after{width:4px;height:4px}.mec-calendar .mec-calendar-header h2{font-size:16px;margin-top:33px}.mec-calendar dt{height:38px;line-height:38px}.mec-calendar .mec-event-list-classic .mec-event-detail,.mec-calendar .mec-event-list-classic .mec-event-title{font-size:12px}.mec-calendar .mec-event-list-classic .mec-event-time{font-size:10px}}.mec-box-calendar.mec-calendar .mec-has-event a,.mec-box-calendar.mec-calendar dt{border-radius:0}.mec-box-calendar.mec-calendar .mec-calendar-header{margin-top:2px;margin-bottom:30px}.mec-box-calendar.mec-calendar dt{border-bottom:1px solid #eaeaea;border-left:1px solid #eaeaea}.mec-box-calendar.mec-calendar dl dt:last-child{border-right:1px solid #eaeaea}.mec-box-calendar.mec-calendar .mec-calendar-side .mec-next-month,.mec-box-calendar.mec-calendar .mec-calendar-side .mec-previous-month{border-radius:2px;top:40px;border:1px solid #eee;height:30px;line-height:30px;z-index:1}.mec-box-calendar.mec-calendar .mec-calendar-side .mec-previous-month{left:40px}.mec-box-calendar.mec-calendar .mec-calendar-side .mec-next-month{right:40px}.mec-box-calendar.mec-calendar .mec-calendar-side{box-shadow:none}.mec-box-calendar.mec-calendar .mec-calendar-events-side{border:none}.mec-box-calendar.mec-calendar .mec-calendar-events-side .mec-table-side-day{border-radius:2px}.mec-box-calendar.mec-calendar h4.mec-month-label{position:relative;width:560px;margin-top:2px;margin-bottom:30px;text-transform:uppercase;font-size:22px;font-weight:700;color:#333}.mec-widget .mec-box-calendar.mec-calendar h4.mec-month-label{width:100%;margin-top:8px;font-size:13px}@media only screen and (max-width:1200px){.mec-box-calendar.mec-calendar .mec-calendar-side .mec-previous-month{left:42px}.mec-box-calendar.mec-calendar .mec-calendar-side .mec-next-month{right:42px}.mec-calendar .mec-calendar-header h2{font-size:17px;margin-top:7px}}@media only screen and (max-width:767px){.mec-box-calendar.mec-calendar .mec-calendar-side .mec-next-month,.mec-box-calendar.mec-calendar .mec-calendar-side .mec-previous-month{top:28px;font-size:10px}.mec-box-calendar.mec-calendar .mec-calendar-side .mec-previous-month{left:30px}.mec-box-calendar.mec-calendar .mec-calendar-side .mec-next-month{right:30px}.mec-calendar .mec-calendar-header h2{font-size:15px}}@media only screen and (max-width:479px){.mec-box-calendar.mec-calendar .mec-calendar-side .mec-next-month,.mec-box-calendar.mec-calendar .mec-calendar-side .mec-previous-month{font-size:0;padding:4px 8px;text-align:center;min-width:33px}.mec-box-calendar.mec-calendar .mec-calendar-side .mec-previous-month{left:10px}.mec-box-calendar.mec-calendar .mec-calendar-side .mec-next-month{right:10px}}.mec-calendar.mec-event-calendar-classic,.mec-calendar.mec-event-calendar-classic .mec-calendar-side{border:none;padding:0;width:100%;height:100%;box-shadow:none}.mec-calendar.mec-event-calendar-classic .mec-calendar-side{display:block}.mec-calendar.mec-event-calendar-classic dl.mec-calendar-row,.mec-calendar.mec-event-calendar-classic dl.mec-calendar-table-head{width:100%}.mec-calendar.mec-event-calendar-classic dl.mec-calendar-table-head{background:#f5f6f7}.mec-calendar.mec-event-calendar-classic dl.mec-calendar-table-head .mec-calendar-day-head{background:0 0;height:unset;line-height:36px;border-top-width:1px;border-top-style:solid;border-top-color:#eaeaea}.mec-calendar.mec-event-calendar-classic dl dt{width:15%;height:136px;line-height:1.2;text-align:left;padding:5px 7px;position:relative}.mec-box-calendar.mec-calendar.mec-event-calendar-classic .mec-calendar-side .mec-next-month,.mec-box-calendar.mec-calendar.mec-event-calendar-classic .mec-calendar-side .mec-previous-month{top:0}.mec-calendar.mec-event-calendar-classic .mec-has-event:after{bottom:auto;top:24px;left:7px;margin:0}.mec-box-calendar.mec-calendar.mec-event-calendar-classic .mec-calendar-side .mec-previous-month{left:0}.mec-box-calendar.mec-calendar.mec-event-calendar-classic .mec-calendar-side .mec-next-month{right:0}.mec-next-month a,.mec-previous-month a{pointer-events:none;line-height:15px}.mec-calendar.mec-event-calendar-classic .mec-calendar-events-sec{text-align:left;background:#fafafa;border:1px solid #eaeaea;border-top:none;padding:10px 20px}.mec-calendar.mec-event-calendar-classic .mec-calendar-events-sec{display:none}.mec-calendar.mec-event-calendar-classic .mec-calendar-events-sec .mec-event-article:hover{background-color:#fcfcfc}.mec-calendar.mec-event-calendar-classic .mec-selected-day,.mec-calendar.mec-event-calendar-classic dt.mec-selected-day:hover{color:#40d9f1;font-weight:700;background:#fafafa;border-bottom:none}.mec-wrap .mec-calendar.mec-event-calendar-classic:not(.mec-event-container-simple) .mec-selected-day:hover{color:#fff!important}.mec-calendar.mec-event-calendar-classic .mec-calendar-events-sec .mec-table-side-day,.mec-calendar.mec-event-calendar-classic .mec-calendar-events-sec .mec-table-side-title{display:inline-block;margin:0;margin-bottom:15px;font-weight:700}.mec-calendar.mec-event-calendar-classic .mec-calendar-events-sec .mec-table-side-day{margin-left:4px}.mec-calendar.mec-event-calendar-classic .mec-calendar-row dt.mec-has-event a{color:#4d4d4d}.mec-calendar.mec-event-calendar-classic .mec-calendar-row dt.mec-has-event:not(.mec-selected-day):hover a{color:#fff}@media only screen and (max-width:1200px){.mec-calendar.mec-event-calendar-classic dl dt{height:100px}}@media only screen and (max-width:767px){.mec-calendar.mec-event-calendar-classic dl dt{height:40px}}@media only screen and (max-width:479px){.mec-calendar.mec-event-calendar-classic .mec-calendar-events-sec{padding:10px}}.mec-calendar .mec-event-article.mec-single-event-novel{padding:4px 8px;min-height:25px;margin:0 -3px;border-radius:0;display:block}.mec-calendar .mec-event-article.mec-single-event-novel h4{margin:0;font-size:13px;line-height:1.5;font-weight:500;text-transform:capitalize;margin:0 0 2px 0}.mec-calendar .mec-event-article.mec-single-event-novel .mec-shortcode-organizers i,.mec-calendar .mec-event-article.mec-single-event-novel .mec-shortcode-organizers ul li span{color:#000}.mec-calendar.mec-event-container-novel dl dt{padding:3px}.mec-calendar.mec-event-calendar-classic .mec-calendar-novel-selected-day{display:inline-block;padding:4px;margin-left:1px}.mec-wrap .mec-calendar.mec-event-container-novel .mec-selected-day:hover{color:#fff!important}.mec-calendar.mec-event-calendar-classic .mec-selected-day .mec-calendar-novel-selected-day{color:#fff}.mec-calendar.mec-event-calendar-classic.mec-event-container-novel .mec-selected-day,.mec-calendar.mec-event-calendar-classic.mec-event-container-novel dt.mec-selected-day:hover{border-bottom:1px solid #eaeaea}.mec-calendar.mec-event-calendar-classic.mec-event-container-novel .mec-calendar-side .mec-calendar-table{min-height:auto}.mec-single-event-novel.light h4{color:#000!important}.mec-single-event-novel.dark h4{color:#fff!important}@media only screen and (max-width:768px){.mec-calendar .mec-event-article.mec-single-event-novel{padding:2px;min-height:5px}.mec-calendar .mec-event-article.mec-single-event-novel h4{display:block;font-size:13px}}@media only screen and (max-width:480px){.mec-calendar .mec-event-article.mec-single-event-novel h4{font-size:11px}}.mec-event-container-simple .event-single-content-simple{display:none}.mec-event-calendar-classic.mec-event-container-simple .mec-calendar-side .mec-calendar-table{min-height:unset}.mec-event-container-simple .mec-monthly-tooltip h4{font-size:13px;font-weight:500;margin:0;color:#444}.mec-event-container-simple .mec-monthly-tooltip h4:hover{text-decoration:underline;color:#111}.mec-event-container-simple .mec-monthly-tooltip.event-single-link-simple{border-bottom:1px dashed #e3e3e3;padding:5px 2px;display:block}.mec-event-container-simple .simple-skin-ended:nth-last-of-type(2) .mec-monthly-tooltip.event-single-link-simple{border-bottom:none}.mec-event-container-simple .mec-calendar-day .ended-relative:nth-last-child(1of.ended-relative) .mec-monthly-tooltip.event-single-link-simple{border:none}.mec-calendar.mec-event-container-simple dl dt.mec-calendar-day{font-size:30px;color:#000}.mec-calendar.mec-event-container-simple .mec-calendar-row dt:hover{background:unset}.mec-calendar.mec-event-container-simple .mec-calendar-row dt,.mec-calendar.mec-event-container-simple .mec-calendar-row dt:last-child,.mec-calendar.mec-event-container-simple .mec-calendar-table-head dt,.mec-calendar.mec-event-container-simple .mec-calendar-table-head dt:last-child{border-width:2px}.mec-calendar.mec-event-container-simple dl dt.mec-selected-day,.mec-calendar.mec-event-container-simple dl dt.mec-selected-day:hover{border-bottom:2px solid #40d9f1;background:unset}.mec-calendar.mec-event-container-simple .mec-calendar-table-head dt{border-top-width:2px!important}@media (max-width:768px){.mec-calendar.mec-event-container-novel,.mec-calendar.mec-event-container-simple{overflow-x:scroll}.mec-calendar.mec-event-container-novel .mec-calendar-side,.mec-calendar.mec-event-container-simple .mec-calendar-side{min-width:100%}.mec-event-container-novel .mec-calendar-side,.mec-event-container-simple .mec-calendar-side{min-width:650px!important}}.mec-wrap.colorskin-custom .mec-calendar.mec-event-container-simple .mec-selected-day:hover{background:#f4f4f4}.mec-tooltip-event-title{font-size:16px;font-weight:700;color:#000;margin-bottom:2px}.mec-tooltip-event-time,.tooltipster-sidetip.tooltipster-shadow:not(.uael-tooltipster-active) .tooltipster-content .mec-price-details{font-size:12px;color:#888;margin-bottom:8px;margin-top:5px}.tooltipster-sidetip.tooltipster-shadow:not(.uael-tooltipster-active) .tooltipster-content{padding:17px}.mec-tooltip-event-content{clear:both}.mec-tooltip-event-featured{float:left;margin-right:13px;margin-bottom:1px}.mec-tooltip-event-featured img{max-width:120px}.mec-tooltip-event-desc{font-size:14px;color:#444;line-height:18px}.mec-tooltip-event-desc p{font-size:13px;line-height:1.4;margin-bottom:10px}.tooltipster-sidetip.tooltipster-shadow:not(.uael-tooltipster-active) .tooltipster-box{border-radius:3px!important;border:1px solid #e2e3e4!important;background:#fff!important;box-shadow:0 -1px 30px -2px rgba(0,0,0,.15)!important}.tooltipster-box .mec-tooltip-event-desc{margin-bottom:12px}.tooltipster-sidetip:not(.uael-tooltipster-active) .tooltipster-arrow{overflow:visible!important}.tooltipster-sidetip.tooltipster-shadow:not(.uael-tooltipster-active) .tooltipster-arrow-border{border-width:12px!important}.tooltipster-sidetip.tooltipster-shadow.tooltipster-right:not( .uael-tooltipster-active ) .tooltipster-arrow-border{border-right-color:#e2e3e4!important}.tooltipster-sidetip:not(.uael-tooltipster-active) .tooltipster-arrow-border{left:-12px!important;z-index:9999999999!important}.tooltipster-sidetip.tooltipster-shadow:not(.uael-tooltipster-active) .tooltipster-arrow-background{display:block!important}.tooltipster-sidetip:not(.uael-tooltipster-active) .tooltipster-arrow-background{border-width:11px!important;z-index:99999999999!important}.tooltipster-sidetip.tooltipster-right:not(.uael-tooltipster-active) .tooltipster-arrow-background{left:-9px!important;top:1px!important;border-right-color:#fff!important}.tooltipster-sidetip.tooltipster-top:not(.uael-tooltipster-active) .tooltipster-arrow-background{border-top-color:#fff!important;left:0!important;top:-1px!important}.tooltipster-sidetip.tooltipster-top:not(.uael-tooltipster-active) .tooltipster-arrow-border{left:-1px!important}.tooltipster-sidetip.tooltipster-shadow.tooltipster-top:not( .uael-tooltipster-active ) .tooltipster-arrow-border{border-top-color:#e2e3e4!important}.tooltipster-sidetip.tooltipster-shadow.tooltipster-bottom:not( .uael-tooltipster-active ) .tooltipster-arrow-border{left:-1px!important;top:-11px!important}.tooltipster-sidetip.tooltipster-shadow.tooltipster-bottom:not( .uael-tooltipster-active ) .tooltipster-arrow-border{border-bottom-color:#e2e3e4!important}.tooltipster-sidetip.tooltipster-bottom:not(.uael-tooltipster-active) .tooltipster-arrow-background{top:-9px!important;border-bottom-color:#fff!important}.tooltipster-sidetip.tooltipster-left:not(.uael-tooltipster-active) .tooltipster-arrow-background{border-left-color:#fff!important;left:-2px!important;top:0!important}.tooltipster-sidetip.tooltipster-shadow.tooltipster-left:not( .uael-tooltipster-active ) .tooltipster-arrow-border{border-left-color:#e2e3e4!important;left:-1px!important;top:-1px!important}@media (max-width:768px){.mec-event-container-simple .mec-monthly-tooltip.event-single-link-simple h4{font-size:13px}}@media (max-width:480px){.mec-event-container-simple .mec-monthly-tooltip.event-single-link-simple h4{font-size:11px}}.mec-calendar.mec-calendar-daily .mec-calendar-day-events .mec-event-article{padding-left:15px;padding-right:15px;position:relative}.mec-calendar.mec-calendar-daily .mec-calendar-a-month{text-align:center;background-color:#fff;border-bottom:2px solid #f4f4f4;position:relative}.mec-calendar.mec-calendar-daily .mec-calendar-a-month h4{color:#444;font-size:18px;line-height:1.2;padding:15px 0 11px;margin:0;font-weight:700;letter-spacing:1px;text-transform:uppercase;border-bottom:1px solid #e6e6e6}.mec-calendar.mec-calendar-daily .mec-calendar-d-top{text-align:center;padding:10px 0;position:relative;background-color:#fafafa}.mec-calendar.mec-calendar-daily .mec-next-month,.mec-calendar.mec-calendar-daily .mec-previous-month{position:absolute;top:50%;left:50%;margin-top:-25px;min-width:50px;height:50px;line-height:50px;text-align:center;background:#fff;border:1px solid #e2e2e2;border-radius:50px;box-shadow:0 2px 0 0 rgba(0,0,0,.015);transition:all .33s ease;cursor:pointer}.mec-calendar.mec-calendar-daily .mec-next-month i,.mec-calendar.mec-calendar-daily .mec-previous-month i{font-size:14px;cursor:pointer}.mec-calendar.mec-calendar-daily .mec-next-month:hover,.mec-calendar.mec-calendar-daily .mec-previous-month:hover{border-color:#d0d0d0;color:#444;box-shadow:0 2px 5px 0 rgba(0,0,0,.075)}.mec-calendar.mec-calendar-daily .mec-previous-month{margin-left:-150px}.mec-calendar.mec-calendar-daily .mec-next-month{margin-left:100px}.mec-calendar.mec-calendar-daily .mec-calendar-a-month .mec-next-month,.mec-calendar.mec-calendar-daily .mec-calendar-a-month .mec-previous-month{min-height:28px;height:28px;line-height:28px;width:28px;margin-top:-14px;border-radius:3px}.mec-calendar.mec-calendar-daily .mec-calendar-d-top h2,.mec-calendar.mec-calendar-daily .mec-calendar-d-top h3{margin-top:9px;color:#b9b9b9;font-size:30px;font-weight:100;text-transform:uppercase;margin-bottom:12px;line-height:1}.mec-calendar.mec-calendar-daily .mec-calendar-d-top h2{font-size:81px;color:#444;margin-bottom:10px;line-height:1.1}.mec-calendar.mec-calendar-daily .mec-calendar-d-table{overflow:hidden;background:#fff;min-height:60px;border-top:1px solid #e6e6e6;border-bottom:2px solid #f3f3f3;padding:0 50px;position:relative}@media only screen and (min-width:479px){.mec-calendar.mec-calendar-daily .mec-calendar-d-table{padding:0 55px}}.mec-calendar.mec-calendar-daily .mec-calendar-d-table dl{width:1310px;display:block}.mec-calendar.mec-calendar-weekly .mec-calendar-d-table dl{display:none}.mec-calendar.mec-calendar-weekly .mec-calendar-d-table dl.mec-weekly-view-week-active{display:flex}.mec-calendar.mec-calendar-daily .mec-calendar-d-table a,.mec-calendar.mec-calendar-daily .mec-calendar-d-table dl dt{display:block;background:#fff;width:42px;height:60px;line-height:60px;text-align:center;float:left;border-right:1px solid #e6e6e6;border-bottom:1px solid #e6e6e6;border-radius:0}.mec-calendar.mec-calendar-daily .mec-calendar-d-table .mec-daily-view-day:hover,.mec-calendar.mec-calendar-daily .mec-calendar-d-table dl dt:hover{background:#fafafa;box-shadow:0 2px 5px 0 rgba(0,0,0,.065) inset;cursor:pointer}.mec-calendar.mec-calendar-daily .mec-calendar-d-table .mec-daily-view-day{cursor:default;background:#fff;color:#c1c1c1;line-height:59px;text-align:center;border-right:1px solid #e6e6e6;border-bottom:1px solid #e6e6e6}.mec-calendar.mec-calendar-daily .mec-calendar-d-table .mec-daily-view-day.mec-has-event{cursor:pointer;font-weight:700;color:#4a4a4a}.mec-calendar.mec-calendar-daily .mec-calendar-d-table .mec-daily-view-day.mec-daily-view-day-active,.mec-calendar.mec-calendar-daily .mec-calendar-d-table dl dt.mec-table-d-current{font-weight:700;background:#fafafa;color:#40d9f1}.mec-calendar.mec-calendar-daily .mec-calendar-d-table a.mec-table-d-next,.mec-calendar.mec-calendar-daily .mec-calendar-d-table a.mec-table-d-prev{float:none;font-size:14px;width:55px;position:absolute;top:0;left:0;cursor:pointer}.mec-calendar.mec-calendar-daily .mec-calendar-d-table a.mec-table-d-next{left:auto;right:0;border-left:1px solid #e6e6e6;border-right:none}.mec-calendar.mec-calendar-daily .mec-today-container .mec-today-count{font-size:12px;color:#888;text-align:center}@media only screen and (max-width:479px){.mec-calendar.mec-calendar-daily .mec-previous-month{margin-left:-130px}.mec-calendar.mec-calendar-daily .mec-next-month{margin-left:80px}.mec-calendar.mec-calendar-daily .mec-calendar-a-month h4{font-size:14px;letter-spacing:0}}.widget .mec-calendar.mec-calendar-daily .mec-calendar-a-month h4{font-size:14px;letter-spacing:0}.widget .mec-calendar.mec-calendar-daily .mec-previous-month{margin-left:-130px}.widget .mec-calendar.mec-calendar-daily .mec-next-month{margin-left:80px}.mec-util-hidden{display:none}.mec-frontbox.mec-util-hidden{display:none!important}.mec-daily-view-dates-events{padding:0;background-color:#fff}.mec-daily-view-date-events,.mec-weekly-view-date-events{list-style:none;margin:0}.mec-calendar.mec-calendar-weekly .mec-calendar-d-table{padding:0}.mec-calendar.mec-calendar-weekly .mec-calendar-d-table dl{width:calc(100% - 1px)}.mec-calendar.mec-calendar-weekly .mec-calendar-d-table dl dt{width:100%;height:70px;line-height:normal;cursor:default}.mec-calendar.mec-calendar-weekly .mec-calendar-d-table dl dt:hover{background:#fff;cursor:default}.mec-calendar-weekly article:hover li{background:0 0}.mec-calendar.mec-calendar-weekly .mec-calendar-d-table dl dt:last-child{border-right:none}.mec-calendar.mec-calendar-weekly .mec-calendar-d-table dl dt span{font-size:12px;font-weight:700;text-transform:uppercase;display:block;margin:15px 0 6px}.mec-calendar.mec-calendar-weekly .mec-calendar-d-table a.mec-table-d-next,.mec-calendar.mec-calendar-weekly .mec-calendar-d-table a.mec-table-d-prev{display:none}ul.mec-weekly-view-dates-events,ul.mec-weekly-view-dates-events li{padding:0;margin:0;line-height:initial;background:#fff}.mec-calendar.mec-calendar-weekly .mec-event-list-weekly-date{width:64px;height:64px;margin-right:10px;font-size:11px;text-transform:uppercase;float:left;text-align:center;padding-top:2px}.mec-calendar.mec-calendar-weekly .mec-event-list-weekly-date span{font-size:40px;line-height:30px;font-weight:700;display:block;margin-bottom:6px;letter-spacing:1px}.mec-calendar.mec-calendar-weekly .mec-calendar-a-month .mec-previous-month{margin-left:0;left:12px}.mec-calendar.mec-calendar-weekly .mec-calendar-a-month .mec-next-month{margin-left:0;left:auto;right:12px}@media only screen and (max-width:479px){.mec-calendar.mec-calendar-weekly .mec-calendar-d-table dl dt span{font-size:9px;letter-spacing:0}.mec-calendar.mec-calendar-weekly .mec-event-list-weekly-date{width:100%;height:36px;margin-bottom:12px;line-height:1;font-size:10px;margin-right:5px;text-align:left}.mec-calendar.mec-calendar-weekly .mec-event-list-weekly-date span{font-size:18px;margin-bottom:5px}}.widget .mec-calendar.mec-calendar-weekly .mec-calendar-d-table dl dt span{font-size:9px;letter-spacing:0}.widget .mec-calendar.mec-calendar-weekly .mec-event-list-weekly-date{width:100%;height:36px;margin-bottom:12px;line-height:1;font-size:10px;margin-right:5px;text-align:left}.widget .mec-calendar.mec-calendar-weekly .mec-event-list-weekly-date span{font-size:18px;margin-bottom:5px}.mec-week-events-container .mec-weekly-view-dates-events li.mec-no-event-found{list-style:none!important}li.mec-no-event-found .mec-event-title{text-align:center}.mec-widget .mec-calendar{max-width:100%}.mec-widget .mec-calendar dl dt,.mec-wrap.mec-sm959.mec-widget .mec-calendar.mec-event-calendar-classic dl dt{height:40px}.mec-widget .mec-calendar .mec-calendar-events-sec{padding:10px}.mec-widget .mec-calendar .mec-calendar-header h2{font-size:13px;margin-top:8px}.mec-widget .mec-calendar .mec-event-list-classic .mec-event-image{margin-right:12px}.mec-widget .mec-calendar .mec-has-event:after{width:4px;height:4px}.mec-widget .mec-calendar.mec-event-calendar-classic .mec-calendar-events-sec .mec-table-side-title{font-size:14px}.mec-widget .mec-calendar .mec-event-article .mec-event-image{margin-right:11px}.mec-widget .mec-box-calendar.mec-calendar .mec-calendar-header{margin-bottom:20px}.mec-widget .mec-box-calendar.mec-calendar .mec-calendar-side .mec-next-month,.mec-widget .mec-box-calendar.mec-calendar .mec-calendar-side .mec-previous-month{font-size:0;padding:4px;text-align:center;min-width:33px}.mec-widget .mec-event-calendar-classic .mec-calendar-side .mec-calendar-table{min-height:200px}.mec-widget .mec-event-list-classic{margin-bottom:8px;padding:8px 0}.mec-widget .mec-event-list-classic .mec-event-article{margin-bottom:0;padding:10px 0;position:relative;min-height:86px;padding-left:80px}.mec-widget .mec-event-list-classic .mec-event-date{font-size:10px;line-height:14px;text-transform:uppercase}.mec-widget .mec-event-list-classic .mec-event-title{font-size:13px}.mec-widget .mec-event-list-classic .mec-event-detail{font-size:11px}.mec-widget .mec-event-list-classic .mec-event-image{width:68px;position:absolute;left:0}.mec-event-list-classic .mec-event-image img{width:100%}.mec-widget .mec-event-list-classic .mec-event-detail{overflow:visible}.event-color{width:14px;display:inline-block;vertical-align:middle;height:14px;margin-left:5px;border-radius:50%}.mec-map-lightbox-wp{padding:15px 15px 0;background-color:#fff}.mec-map-view-event-detail.mec-event-detail{background-color:#e9e9e9;padding:8px 15px}.mec-map-lightbox-wp.mec-event-list-classic .mec-event-article{padding:0 0 15px;margin:0}.mec-map-lightbox-wp.mec-event-list-classic .mec-event-image{width:70px;margin-right:15px}.mec-marker-infowindow-wp{padding:10px}.mec-marker-infowindow-wp .mec-marker-infowindow-count{width:60px;height:60px;display:block;text-align:center;line-height:60px;border:1px solid #40d9f1;border-radius:50%;font-size:32px;color:#40d9f1;float:left;margin-right:11px}.mec-marker-infowindow-wp .mec-marker-infowindow-content{overflow:hidden;padding-top:6px}.mec-marker-infowindow-wp .mec-marker-infowindow-content span{display:block;color:#222}.mec-marker-infowindow-wp .mec-marker-infowindow-content span:first-child{font-size:15px;font-weight:700}.mec-marker-wrap{display:inline-block;width:35px;height:35px;margin:15px 0 0 4px;border-radius:50% 50% 50% 0;background:#00cae9;animation-name:mec-map-bounce;animation-fill-mode:both;animation-duration:1s;border:1px solid #fff;cursor:pointer}.mec-marker-wrap .mec-marker{margin-top:5px;display:block;-webkit-transform:rotate(45deg) translate(1px,0);transform:rotate(45deg) translate(1px,0);text-align:center;color:#fff;font-size:17px}.mec-marker-wrap .mec-marker-pulse-wrap{-webkit-transform:rotate(45deg);transform:rotate(45deg);display:inline-block;margin-left:-11px;margin-top:0}.mec-marker-wrap .mec-marker-pulse{display:inline-block;background:#01cae947;border-radius:50%;height:12px;width:14px;margin-left:3px;-webkit-transform:rotateX(55deg);transform:rotateX(55deg);z-index:-2}.mec-marker-wrap .mec-marker-pulse:after{content:"";border-radius:50%;height:40px;width:40px;position:absolute;margin:-13px 0 0 -13px;animation:pulsate 1s ease-out;animation-iteration-count:infinite;opacity:0;box-shadow:0 0 1px 2px #00cae9;animation-delay:1.1s}@keyframes pulsate{0%{transform:scale(.1,.1);opacity:0}50%{opacity:1}100%{transform:scale(1.2,1.2);opacity:0}}@keyframes mec-map-bounce{0%{opacity:0;transform:translateY(-2000px) rotate(-45deg)}60%{opacity:1;transform:translateY(30px) rotate(-45deg)}80%{transform:translateY(-10px) rotate(-45deg)}100%{transform:translateY(0) rotate(-45deg)}}.mec-skin-grid-container .mec-skin-map-container,.mec-skin-list-container .mec-skin-map-container{margin-bottom:20px}.mec-single-event .mec-events-meta-group-countdown{color:#c9c9c9;text-align:center;margin-bottom:30px;padding:20px 30px;background:#fff;border:1px solid #e6e6e6;box-shadow:0 2px 0 0 rgba(0,0,0,.016)}.mec-events-meta-group-countdown .countdown-w{text-align:center;font-size:36px;margin:0 auto;padding:40px 0 0;position:relative;display:table;table-layout:fixed}.mec-events-meta-group-countdown .countdown-w .icon-w{font-size:24px}.mec-events-meta-group-countdown .countdown-w .label-w{font-size:15px;font-weight:300;letter-spacing:1px;text-transform:uppercase;position:relative}.mec-events-meta-group-countdown .countdown-w .block-w{display:table-cell;margin:0 20px 10px;position:relative;height:70px;width:190px;font-size:72px;transition:all .3s ease-in-out;line-height:1.2}.mec-events-meta-group-countdown .countdown-w .block-w.done-w{border:0 none}.mec-events-meta-group-countdown .countdown-w .block-w li{font-size:50px}.mec-events-meta-group-countdown .countdown-w span{padding:24px 0 20px}.mec-events-meta-group-countdown .countdown-w .div-d{display:none}.mec-events-meta-group-countdown .countdown-w .countdown-message{display:none}.mec-events-meta-group-countdown .countdown-w .block-w i{display:none}#countdown{list-style:none;margin-bottom:0;margin-top:0;margin-left:0;padding-left:0}.mec-events-meta-group-countdown .mec-end-counts h3{display:inherit;text-align:center;font-size:16px;right:50%}.mec-countdown-details .countdown-w .clockdiv li p{margin-top:23px}@media (min-width:481px) and (max-width:768px){.mec-events-meta-group-countdown .countdown-w{padding:0}.mec-events-meta-group-countdown .countdown-w .label-w{font-size:12px;letter-spacing:0}.mec-events-meta-group-countdown .countdown-w span{font-size:34px}}@media (min-width:320px) and (max-width:480px){.mec-events-meta-group-countdown .countdown-w .label-w{font-size:10px}.mec-events-meta-group-countdown .countdown-w span{font-size:28px}.mec-countdown-details .countdown-w .clockdiv li p{margin-top:16px}}@media (max-width:320px){.mec-events-meta-group-countdown .countdown-w .label-w{font-size:9px;letter-spacing:0}.mec-events-meta-group-countdown .countdown-w span{font-size:22px}}.info-msg,.mec-error,.mec-success,.warning-msg{margin:30px 0 20px 0;padding:10px;border-radius:5px;font-size:13px;line-height:22px}.info-msg{color:#07bbe9;background-color:#ecf9fe}.mec-cart .mec-success,.mec-success{color:#2ca84c;background-color:#e8f9ed}.warning-msg{color:#cf7909;background-color:#fef7e7}.mec-error{color:#cb2916!important;background-color:#fef2f2}.mec-fes-form,.mec-fes-list{background:#f8feff;padding:30px 3%;color:#798f96}.mec-fes-list .mec-fes-list-top-actions,.mec-fes-list ul{margin:0 auto 15px;max-width:960px;list-style:none;padding-left:40px}.mec-fes-form-cntt .dashicons-editor-help{display:none}.mec-fes-list ul li *{text-decoration:none!important}.mec-fes-list ul li{padding:20px 15px;border-radius:3px;margin-bottom:15px;border:1px solid #cfeff5;box-shadow:0 2px 6px -4px #cfeff5;background:#fff;line-height:normal}.mec-fes-list ul li a{box-shadow:none;color:#181818}.mec-fes-list ul li a:hover{color:#40d9f1}.mec-fes-list ul li .mec-event-title{font-size:17px;font-weight:600;width:calc(100% - 250px);display:inline-block}@media (max-width:680px){.mec-fes-list ul li .mec-event-title{width:100%;font-size:13px;margin:0 0 20px 0;display:block}.mec-fes-list ul li{padding:10px 12px 40px}}@media (max-width:480px){.mec-fes-list .mec-fes-list-top-actions,.mec-fes-list ul{padding-left:0}}.mec-fes-form .mec-required{color:#ff3c3c}.mec-fes-list .mec-event-status{color:#fff!important;border-color:transparent!important}.mec-fes-form .mec-book-confirmed,.mec-fes-list .mec-book-confirmed{background:#50d477!important}.mec-fes-form .mec-book-pending,.mec-fes-list .mec-book-pending{background:#fcbe69!important}.mec-fes-form .mec-book-rejected,.mec-fes-list .mec-book-rejected{background:#fe686a!important}.mec-fes-form .mec-book-other,.mec-fes-list .mec-book-other{background:#40d9f1!important}.mec-fes-list ul li .mec-fes-event-edit,.mec-fes-list ul li .mec-fes-event-remove,.mec-fes-list ul li .mec-fes-event-view{font-size:11px;padding:0;border:0;background:#f7f8f9;float:right;margin-left:5px;border-radius:2px;transition:all .2s ease}.mec-fes-list ul li .mec-fes-event-edit a,.mec-fes-list ul li .mec-fes-event-export a,.mec-fes-list ul li .mec-fes-event-remove,.mec-fes-list ul li .mec-fes-event-view a{padding:4px 8px;display:inline-block;border:1px solid #e7e8e9;border-radius:2px;color:#789;position:relative}@media (max-width:600px){.mec-fes-list ul li .mec-fes-event-edit a,.mec-fes-list ul li .mec-fes-event-export a,.mec-fes-list ul li .mec-fes-event-remove,.mec-fes-list ul li .mec-fes-event-view a{font-size:10px}}.mec-fes-list ul li .mec-fes-event-remove:hover{cursor:pointer;background:#f96f8a;border-color:#f96f8a;color:#fff}.mec-fes-list ul li .mec-fes-event-edit a:hover,.mec-fes-list ul li .mec-fes-event-export a:hover,.mec-fes-list ul li .mec-fes-event-view a:hover{background:#40d9f1;color:#fff;border-color:#40d9f1}.mec-fes-form-top-actions a,.mec-fes-list-top-actions a,.single-mec-events .pmpro_content_message a,.single-mec-events .pmpro_content_message a:link{position:relative;border:none;border-radius:3px;color:#fff!important;display:inline-block;font-size:13px;line-height:1;text-transform:none;font-weight:400;text-decoration:none;cursor:pointer;margin-bottom:20px!important;margin-right:10px;line-height:1;letter-spacing:0;padding:15px 22px;background:#39c36e;box-shadow:0 1px 7px -3px #39c36e!important;-webkit-transition:all .21s ease;-moz-transition:all .21s ease;transition:all .21s ease;text-decoration:unset}.mec-fes-form-top-actions a:hover,.mec-fes-list-top-actions a:hover,.single-mec-events .pmpro_content_message a:hover,.single-mec-events .pmpro_content_message a:hover:link{background:#222;color:#fff}.mec-fes-list-top-actions a{font-weight:600;text-transform:capitalize}.mec-fes-form-top-actions a:before{content:"";border:solid #fff;border-width:0 2px 2px 0;display:inline-block;padding:6px;margin-right:5px;vertical-align:sub;transform:rotate(135deg);-webkit-transform:rotate(135deg)}.mec-fes-form .mec-form-row,.mec-fes-list .mec-form-row{margin-bottom:10px;clear:both}.mec-fes-form label{font-size:13px;display:block;color:#798f96;font-weight:400;padding:0 0 4px 2px}.mec-fes-form input+label{padding-top:8px;padding-left:3px;margin:0;display:inline-block;vertical-align:top}#wrap .mec-fes-form input+label{padding-top:0}.mec-fes-form .post-status{float:right!important;margin:0 5px;color:#fff;padding:0 10px;border-radius:12px;font-style:italic;font-size:18px}.mec-fes-form #mec-event-data input[type=date],.mec-fes-form input[type=email],.mec-fes-form input[type=number],.mec-fes-form input[type=password],.mec-fes-form input[type=tel],.mec-fes-form input[type=text],.mec-fes-form input[type=url],.mec-fes-form select,.mec-fes-form textarea{min-width:inherit;width:auto;display:inline;min-height:30px;font-size:13px;padding:10px;margin-bottom:20px;clear:both;background:#fff;border:1px solid #cfeff5;box-shadow:0 2px 5px rgba(207,239,245,.38) inset;border-radius:3px;height:40px;max-width:280px;color:#798f96;font-family:inherit}#mec_fes_form input[type=date]::-webkit-calendar-picker-indicator,.lity-content #mec_fes_form input[type=date]::-webkit-calendar-picker-indicator,.lity-content .mec-events-meta-group-booking input[type=date]::-webkit-calendar-picker-indicator,.mec-events-meta-group-booking .mec-booking-shortcode input[type=date]::-webkit-calendar-picker-indicator,.mec-single-event .mec-events-meta-group-booking input[type=date]::-webkit-calendar-picker-indicator{background:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuNi1jMTQ1IDc5LjE2MzQ5OSwgMjAxOC8wOC8xMy0xNjo0MDoyMiAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENDIDIwMTkgKFdpbmRvd3MpIiB4bXBNTTpJbnN0YW5jZUlEPSJ4bXAuaWlkOjA0QjQ2N0QwQjQ4MzExRUE4RDdFREZDRTUxMUVERTM5IiB4bXBNTTpEb2N1bWVudElEPSJ4bXAuZGlkOjA0QjQ2N0QxQjQ4MzExRUE4RDdFREZDRTUxMUVERTM5Ij4gPHhtcE1NOkRlcml2ZWRGcm9tIHN0UmVmOmluc3RhbmNlSUQ9InhtcC5paWQ6MDRCNDY3Q0VCNDgzMTFFQThEN0VERkNFNTExRURFMzkiIHN0UmVmOmRvY3VtZW50SUQ9InhtcC5kaWQ6MDRCNDY3Q0ZCNDgzMTFFQThEN0VERkNFNTExRURFMzkiLz4gPC9yZGY6RGVzY3JpcHRpb24+IDwvcmRmOlJERj4gPC94OnhtcG1ldGE+IDw/eHBhY2tldCBlbmQ9InIiPz6WW71PAAAGIklEQVR42qRXS28bVRQ+586Mx3ZC1DSpVFojRU2CqMIGiSKxAVoUduzoDjYIlhU/Av4AYsdjRXfkD0Cjom6QqIqEqEhRo1aRkkZpkpY6j7GduQ++c2dsj1+BlInGztxvzj3nfudpPlM/otc2W2QjJmU0rZ0uUytUpBxNnN9p/FYhctF0+XUi2nPGkX7WJOfwxNRzqXxtbfI4eUvm7xY1o4iiI0d/vFiisL2BgTAz0yvbCRnLhP0uNEtqrgUseZRcwPPvJewaldSA8o48vo+Tj0U+CnrkOgZwvkEzEmGm1PF9fzK5Y3U/YlllsjRUv19zXl7571HyAjooc/kmYerpcmPO0Mfa0SyxEtji44ynOjPuayjecd7M46/MQOdGyIs9ThnzMLD0XRrwIdeetmoLm41fWiG95Ar792tydLLrOPkAlpW027hbG3+T37lf/5EtvYcXUuhfBjWp9wHRBO63c5lbEkQj2B92uaHy4l2EAQ66GFgbmiD4id/9q661ooAtf8rsvmUEilAHEqcgtJvvNq3YPTkJA8PksT9ZFxD8+4my9pvAOqOMxIMoJHfPZoJkJNiYat3duOac6hxt1N3GR8lnt0O623s+c2CVZEGaZ8Oks1mElvxu7hGYaQjpHLpH3q/YFQE7Oh5Y6gFTaHhAXlasxmoWpZO5L9Ow4DTv+UBZBAkWNO+CqhkbSOzaXWWyzY+n3WcACdVscnklz5CHYsmv1L/RyUJ/cs7zdT3Ey8pTgw/QgNNuS4XjNMvffwvBNmwDH+pdeZ3J+1qDdW15vS0iBhjZWzF9ge8HWl7zNLluYhP/9/jvFANXyL+ufF4jZvOCZsK8isp77+sixf10n7QQjJT39bBtjzdA5chtLG61n7kgk6UvDy29z4HL4c/ifkN0hYV+cA3Bc7stKAfossgSSF06+3HOu8QovE8eThDlv4pu1TbUOpqySDNUKMSDQRIo6QgVRHbFcID1mCITUGgNKLI9uBbcCC59xUi+DsiHBq0XOLb3utqOUYV+LglH9XJASRAsRNqt4xHVj59Exqw3AlrYi0PaiwNqBKoX12Y9iQSP/GkD4xZC0yt/GPFCvZzhUBoMtmPftRwMEEtpupy2auzadLraXtlNoXLhKQYLbjrWRx0cXNf24wxPSmWw5aZPNXSNOi5ytXqZpjTwSqs3PsJi0I61LG29EFG9GtyaeqgvxU17TrAkDjbvnq/eKcTYrbcemi5eHoI/OLgUt7r4n+cqd04llmZ3mjBSDQ4kYtERLLz4OKGt0xGKA9+RgiSGSRV7+UlCVvka72lEvHRx04vLGW2f/PzTBk3VtddRrGlhMXVaIdME5sLJ3ZQOTPQBNqj58uzcxsXtZEkqmQ7IB9ihLeA2x6FQqyG4cRuvbh8uNZSigzBCALhBBtrjkwjjQItQ+kPXWY6eBuEi/lmOlC8kvTh38ZLH3QC+y+GiIl4OqbeZ9RggQZgcVIXe1ep48jPkz/oGw7x1yoytIq1o59AH1Wp1rNHBSXA9tip87zYyvFzpx8dXLVTvqySvhUMNsN6+1ERrrNQVQs57H4K6cR35GrapffICb16RpO7glOHrrQyvjHXxQHB0/j1ugV0LpcFwAzS4n6hiZoIvEp2znwcSigfGJhxpMmseLc0dvFjcvRuLvdEdNyl2+0DOALwE863TM/jnJqhfQa6v4AfJzUNOZ/aVlhqIUpoO4PuU4XFsqFrSM866m9hxBXSvWPx/wHpGqA96Vfa5AH9HnMjYNI96dbkwaVzcCw/nAK+xHzp4Hp89eD04nENzX6v4cYrnrVWXXQF/Fh7MQfWasmogCNsmaT+qwD0g4gYsuYqnWlboeKMUumUr86LycxdwdRUb+zQTvAzcgL0jLXFkbkQUX5UKyFTE2bvZD0a5B8SAUu6dPf+7AInssja2VPSZRud2Ni/NKse5M2VQqkO4BxSzZLmV8Wwpa8S9OHsK3X6+Lc7F/JidOwvkc7z3FbIgzd7smy1c35TEg7NGrg6Ucs88UsCliOLHH1+Td8HYFl++W//QxfT9iSee/3lJWy5X6aMwtK3rTVWJUU4/g4GzdLLp73ku8cEDxNmXUZhc/0eAAQAVgX0RHvvILQAAAABJRU5ErkJggg==");background-position:center;background-size:cover;width:10px;height:12px;display:block}.mec-fes-form input{background:#fff;border-radius:3px}.mec-fes-form textarea{height:80px}.mec-fes-form input::-webkit-input-placeholder{color:#798f96}.mec-fes-form input::-moz-placeholder{color:#798f96}.mec-fes-form input:-ms-input-placeholder{color:#798f96}.mec-fes-form input:-moz-placeholder{color:#798f96}#mec-excerpt .mec-form-row .widefat{max-width:100%}#mec_more_info_target{width:100%}@media only screen and (min-width:961px){.mec-fes-form #mec-event-data input[type=date],.mec-fes-form #mec-event-data select,.mec-fes-form input[type=email],.mec-fes-form input[type=password],.mec-fes-form input[type=tel],.mec-fes-form input[type=text],.mec-fes-form input[type=url],.mec-fes-form textarea{width:100%;display:inline-block}}@media only screen and (max-width:768px){.mec-fes-form #mec-event-data input[type=date],.mec-fes-form #mec-event-data select,.mec-fes-form input[type=email],.mec-fes-form input[type=password],.mec-fes-form input[type=text],.mec-fes-form input[type=url],.mec-fes-form textarea{width:100%}}.mec-fes-form input[type=text]#mec_fes_title{padding:5px 10px;min-height:32px;height:50px;background:#fff!important;max-width:100%;font-size:19px;font-weight:400}.mec-fes-form input[type=checkbox],.mec-fes-form input[type=radio]{display:inline!important;float:left;margin:5px 5px 0 0}.mec-fes-form input[type=email]:focus,.mec-fes-form input[type=number]:focus,.mec-fes-form input[type=password]:focus,.mec-fes-form input[type=tel]:focus,.mec-fes-form input[type=text]:focus,.mec-fes-form input[type=url]:focus,.mec-fes-form select:focus,.mec-fes-form textarea:focus{border:1px solid #aaa;color:#444;background:#fff;-moz-box-shadow:0 0 3px rgba(0,0,0,.2);-webkit-box-shadow:0 0 3px rgba(0,0,0,.2);box-shadow:0 0 3px rgba(0,0,0,.2);outline:0}.mec-form-row .mec-color{cursor:pointer}.mec-form-row.mec-available-color-row span{margin:10px;width:14px;height:14px;display:inline-block;margin-right:6px;border-radius:20px 20px 20px 20px;vertical-align:middle}.mec-form-row.mec-available-color-row span:first-of-type{margin-left:0}.mec-fes-form.mec-fes-form .mec-tooltip{display:inline}.mec-fes-form-cntt .dashicons-editor-help{display:block}.mec-fes-form .mec-tooltip:hover:after,.mec-fes-form .mec-tooltip:hover:before{display:none}.mec-fes-form.mec-fes-form .mec-tooltip{display:inline-flex;bottom:7px}.mec-fes-form .mec-tooltip .box{min-width:300px;max-width:600px;display:inline-block;left:26px;top:50%;transform:translateY(-50%);padding:0;margin-top:8px;background-color:#535a61;color:#fff;font-weight:300;font-size:14px;letter-spacing:.5px;line-height:1.3;position:absolute;z-index:9999999;box-sizing:border-box;border-radius:6px;box-shadow:0 4px 45px -8px #444b50;visibility:hidden;opacity:0;transition:opacity .23s}#webnus-dashboard .mec-fes-form .mec-tooltip .box p,.mec-fes-form .mec-tooltip .box p{color:#fff!important;font-size:14px;line-height:1.3;margin:0}.mec-fes-form .mec-tooltip:hover .box{visibility:visible;opacity:1}.mec-fes-form .mec-tooltip:hover .box{padding:20px;border-radius:8px}.mec-fes-form .mec-tooltip .box h5{color:#fff;font-size:17px;font-weight:600;margin:-30px -20px;padding:20px 0;text-align:center;margin-bottom:10px;background:#3a3f44;border-bottom:1px solid #32363a;border-radius:6px 6px 0 0;z-index:9999}#webnus-dashboard .mec-fes-form .mec-tooltip .box p a,.mec-fes-form .mec-tooltip .box p a{color:#40d9f1;margin-top:10px;margin-left:0;font-weight:400;position:relative;text-decoration:none;display:block;width:max-content}.mec-fes-form .mec-tooltip .box a:hover{color:#f90}.mec-fes-form .mec-tooltip .box:after{display:block;position:absolute!important;top:100%!important;right:50%!important;margin-top:-6px!important;margin-right:-6px!important;width:12px!important;height:24px!important;overflow:hidden!important;transform:rotate(-90deg)!important}.mec-fes-form .mec-tooltip .box:before{display:block;content:""!important;position:absolute!important;width:12px;height:12px;left:-10px!important;top:50%!important;transform:translate(50%,-50%) rotate(-45deg)!important;background-color:#535a61!important;box-shadow:0 8px 9px -4px #535a61!important;z-index:0!important}.mec-fes-form .mec-tooltip .box.top{left:50%;top:0;transform:translate(-50%,-100%);margin-top:0;margin-left:-10px}.mec-fes-form .mec-tooltip .box.top:after{top:50%!important;right:100%!important}.mec-fes-form .mec-tooltip .box.top:before{left:50%!important;top:100%!important}.mec-fes-form .mec-tooltip .box.bottom{left:50%;top:auto;bottom:0;transform:translate(-50%,100%);margin-bottom:-20px;margin-left:-10px}.mec-fes-form .mec-tooltip .box.bottom:after{top:0!important;right:50%!important;background-color:#3a3f44!important}.mec-fes-form .mec-tooltip .box.bottom:before{left:50%!important;top:-7px!important;transform:translateX(-50%);background-color:#3a3f44!important}.mec-fes-form .mec-tooltip .box.left{left:auto;right:26px;top:50%;transform:translateY(-50%)}.mec-fes-form .mec-tooltip .box.left:before{right:0!important;left:auto!important;top:50%!important}.mec-fes-form .mec-tooltip{display:inline-block;position:relative;margin-right:10px;cursor:help;bottom:5px;left:3px}.mec-fes-form .mec-tooltip:last-child{margin-right:0}.mec-fes-form .mec-tooltip:hover:after{background:#313130;border-radius:5px;bottom:24px;color:#fff;content:attr(title);left:-75px;padding:10px;position:absolute;z-index:98;width:240px}.mec-fes-form .mec-tooltip:hover:before{border:solid;border-color:#313130 transparent;border-width:6px 6px 0;bottom:18px;content:"";left:30%;position:absolute;z-index:99}.mec-fes-form .mec-tooltip .dashicons-before:before{font-size:24px;color:#008aff;line-height:37px}.mec-fes-form .mec-tooltip a:focus{box-shadow:none}.mec-form-row .bootstrap_unvalid{display:block;border:2px solid red;position:relative;display:inline-block;border-bottom:1px dotted #000}.mec-fes-form .mec-tooltiptext{visibility:hidden;width:120px;background-color:red;color:#fff;text-align:center;border-radius:6px;padding:5px 0;position:absolute;z-index:1}.mec-fes-form .mec-tooltip .content p a{display:none}@media only screen and (min-width:961px){.mec-fes-form .mec-fes-form-cntt,.mec-fes-form .mec-fes-form-sdbr{width:68%;float:left;padding-right:20px}.mec-fes-form .mec-fes-form-sdbr{width:32%;padding-right:0;padding-left:20px}.mec-fes-submit-mobile{display:none}}.mec-fes-form .mec-meta-box-fields{padding:0 20px 20px;border:1px solid #cfeff5;margin-bottom:20px!important;box-shadow:0 2px 6px -3px #cfeff5;border-radius:3px;background:#fff}.mec-fes-form .mec-meta-box-fields h4,.mec-fes-form .mec-meta-box-fields h4 label{margin:0 -20px;font-size:15px;font-weight:600;letter-spacing:0;color:#40d9f1;text-transform:capitalize;padding:15px 20px;margin-bottom:20px}.mec-fes-form .mec-meta-box-fields h4 label{padding:0;margin:0}.mec-fes-sub-button{width:100%}.mec-available-color-row span.color-selected{border:3px solid #fff;box-sizing:content-box;box-shadow:0 0 0 2px #40d9f1,0 2px 8px -1px #40d9f1}.mec-fes-loading:before{content:url("../img/ajax-loader.gif");background:0 0;border-style:none;display:block;margin-left:47%}.mec-fes-form #mec_meta_box_hourly_schedule_days .mec-form-row input[type=text]{width:190px;margin-right:1.4%}.mec-fes-form #mec_meta_box_hourly_schedule_days .mec-form-row input[type=text].mec-col-1,.mec-fes-form #mec_meta_box_hourly_schedule_days .mec-form-row input[type=text].mec-col-2{width:120px;margin-right:10px}.mec-fes-form #mec_meta_box_hourly_schedule_days .mec-form-row input[type=text].widefat{width:100%}.mec-fes-form #mec_meta_box_hourly_schedule_days .mec-form-row{border-bottom:none;padding-bottom:10px}.mec-fes-form #mec_meta_box_hourly_schedule_days .mec-form-row input[type=text].mec-col-6{width:39%}.mec-fes-form #mec_meta_box_hourly_schedule_days .mec-form-row button{margin-right:0;padding:9px 26px}.mec-fes-form #mec_meta_box_hourly_schedule_days .mec-form-row button.mec-add-hourly-schedule-button{font-size:12px;height:30px;line-height:25px}.mec-fes-form #mec_meta_box_hourly_schedule_days .mec-form-row .description{display:inline-block;border-left:1px dashed #bfcacc;margin-left:12px;line-height:28px;padding-left:12px;margin-top:5px;font-style:italic}@media only screen and (max-width:768px){.mec-fes-form #mec_meta_box_hourly_schedule_days .mec-form-row input[type=text]{width:100%!important}}#mec_fes_form_message{max-width:838px;margin:10px auto;display:block!important;text-align:center}.mec-fes-form .mec-attendees-wrapper .mec-attendees-list .mec-booking-attendees-tooltip{position:relative}.mec-fes-form .mec-attendees-wrapper .mec-attendees-list strong,.post-type-mec-books .attendees strong{line-height:26px;padding-left:26px}.mec-fes-form .mec-attendees-wrapper .mec-attendees-list .mec-booking-attendees-tooltip:before{position:absolute;content:"\e001";font-family:simple-line-icons;margin:12px 0;top:-30px;left:0;font-size:18px;line-height:12px;color:#40d9f1;padding:0 60px 5px 0}.mec-fes-form .mec-attendees-wrapper .mec-attendees-list .mec-booking-attendees-tooltip ul{position:absolute;min-width:300px;max-width:600px;display:inline-block;left:60px;top:50%;transform:translateY(-50%);background-color:#535a61;color:#fff;font-weight:300;font-size:14px;letter-spacing:.5px;line-height:1.3;z-index:9999999;box-sizing:border-box;box-shadow:0 4px 45px -8px #444b50;visibility:hidden;opacity:0;transition:opacity .23s;padding:23px 20px 20px 20px;border-radius:8px;margin-top:-13px}.mec-fes-form .mec-attendees-wrapper .mec-attendees-list .mec-booking-attendees-tooltip ul:before{display:block;content:""!important;position:absolute!important;width:12px;height:12px;left:-10px!important;top:50%!important;transform:translate(50%,-50%) rotate(-45deg)!important;background-color:#535a61!important;box-shadow:0 8px 9px -4px #535a61!important;z-index:0!important}.mec-fes-form .mec-attendees-wrapper .mec-attendees-list .mec-booking-attendees-tooltip:hover ul{visibility:visible;opacity:1}.mec-fes-form .mec-attendees-wrapper .mec-attendees-list .mec-booking-attendees-tooltip ul li{list-style:none}.mec-fes-form .mec-attendees-wrapper .mec-attendees-list .mec-booking-attendees-tooltip ul a{color:#40d9f1;margin-bottom:14px;margin-left:0;font-weight:400;font-size:14px;letter-spacing:.5px;position:relative;text-decoration:none;display:block;width:max-content}.mec-fes-form .mec-attendees-wrapper .mec-attendees-list .mec-booking-attendees-tooltip ul li:last-child a{margin-bottom:0}.mec-fes-form .mec-attendees-wrapper .mec-attendees-list{margin:0}.mec-fes-form .mec-attendees-wrapper .mec-attendees-list .w-clearfix:first-child{background:#fff;border-bottom:1px solid #cfeff5}.mec-fes-form .mec-attendees-wrapper .mec-attendees-list .w-clearfix:first-child div span{line-height:1;font-weight:600;font-size:13px}.mec-fes-form .mec-attendees-wrapper .mec-attendees-list .w-clearfix{display:flex;background:#f8feff;padding:10px;text-align:left}.mec-fes-form .mec-attendees-wrapper .mec-attendees-list .w-clearfix .w-col-xs-3{width:25%;word-wrap:break-word}.mec-fes-form .mec-attendees-wrapper .mec-attendees-list .w-clearfix .w-col-xs-3:first-child{width:45%}.mec-fes-form .mec-attendees-wrapper .mec-attendees-list .w-clearfix .w-col-xs-3:nth-child(2){width:15%}.mec-fes-form .mec-attendees-wrapper .mec-attendees-list .w-clearfix .w-col-xs-3:nth-child(3){width:25%}.mec-fes-form .mec-attendees-wrapper .mec-attendees-list .w-clearfix .w-col-xs-3:nth-child(4){width:20%}.mec-fes-form .mec-attendees-wrapper .mec-attendees-list .w-clearfix:not(:first-child) .w-col-xs-3{font-size:13px;display:block;color:#798f96;font-weight:400;padding:0}.mec-fes-form .mec-attendees-wrapper .mec-attendees-list .w-clearfix .w-col-xs-3 a{text-decoration:unset}.mec-fes-form .mec-attendees-wrapper .mec-attendees-list .w-clearfix:nth-child(odd){background:#fff}.mec-pagination{display:block;margin:40px 0 0 0}.mec-pagination ul.page-numbers{display:flex;justify-content:center;align-content:space-around;flex-wrap:nowrap;align-items:center;flex-direction:row}.mec-pagination .page-numbers li{margin:0 7px;padding:0;display:flex}.mec-pagination .page-numbers li .page-numbers{text-align:center;font-size:14px;line-height:3;width:42px}.mec-pagination .page-numbers li .page-numbers.next,.mec-pagination .page-numbers li .page-numbers.prev{width:110px}.mec-wrap .mec-totalcal-box{position:relative;border:1px solid #efefef;padding:20px 5px;margin:0 0 20px;background:#fafafa;overflow:hidden;box-shadow:0 3px 2px 0 rgba(0,0,0,.012);min-height:78px}.mec-wrap .mec-totalcal-box i{float:left;margin:0;width:36px;height:36px;background:#fff;border:1px solid #efefef;text-align:center;padding:10px 0;font-size:15px;color:#888}.mec-checkboxes-search .mec-searchbar-category-wrap,.mec-wrap .mec-totalcal-box .mec-totalcal-view span,.mec-wrap .mec-totalcal-box input,.mec-wrap .mec-totalcal-box select{width:auto;min-height:36px;height:36px;line-height:36px;background:#fff;font-size:13px;color:#777;border:1px solid #efefef;margin:0 0 0 -1px;float:left;padding:0 5px;font-family:inherit}.mec-wrap .mec-totalcal-box .mec-totalcal-view span.mec-totalcalview-selected{border-right-width:2px}.mec-there-labels .mec-totalcal-view{margin-top:28px}.mec-wrap .mec-totalcal-box input[type=submit]{cursor:pointer;padding:0 16px;text-transform:uppercase;font-size:11px;transition:all .21s ease}.mec-wrap .mec-totalcal-box input[type=submit]:hover{background:#222;color:#fff}.mec-wrap .mec-totalcal-box .mec-totalcal-view span{display:inline-block;text-transform:uppercase;font-size:11px;padding:0 12px;cursor:pointer}.mec-wrap .mec-totalcal-box .mec-totalcal-view span:hover{color:#40d9f1}.mec-wrap .mec-totalcal-box .mec-totalcal-view span.mec-totalcalview-selected{color:#fff;background:#40d9f1;border-color:#40d9f1}.mec-wrap .mec-totalcal-box .mec-totalcal-view{text-align:right;float:right}.mec-wrap .mec-totalcal-box input[type=search]{width:calc(100% - 36px)}.mec-there-reset-button .mec-totalcal-box{padding-bottom:48px}.mec-wrap .mec-totalcal-box .mec-search-reset-button .mec-button{position:absolute!important;margin:0!important;bottom:0!important;right:0!important;padding:9px 25px!important;border-radius:2px 0 0 0!important;background:#fff!important;color:#767676!important;border-top:1px solid!important;border-left:1px solid!important;border-color:#e8e8e8!important;overflow:hidden!important}.mec-wrap .mec-totalcal-box .mec-search-reset-button .mec-button:hover{background:#000!important;color:#fff!important;border-color:#000!important}.mec-full-calendar-wrap .mec-search-form .col-md-7{padding:0}.mec-wrap .mec-date-search .mec-col-3,.mec-wrap .mec-minmax-event-cost .mec-minmax-price{width:calc(50% - 17px)}.mec-wrap .mec-text-address-search.with-mec-cost{width:calc(100% - 356px)}.mec-wrap .mec-minmax-event-cost{display:block;float:left;width:50%;margin-left:10px}.mec-wrap .mec-minmax-event-cost.with-mec-address{display:block;width:336px;max-width:50%;float:right;margin-left:0;margin-right:10px}.mec-wrap .mec-checkboxes-search{margin-left:10px;margin-right:10px;display:table-caption}.mec-wrap .mec-checkboxes-search .mec-searchbar-category-wrap{width:calc(100% - 36px)!important;max-width:calc(100% - 36px)!important;padding:0;position:relative;line-height:inherit;height:auto}.mec-wrap .mec-checkboxes-search .mec-searchbar-category-wrap select{line-height:20px}.mec-wrap .mec-checkboxes-search .mec-searchbar-category-wrap .select2-container.select2-container--default{width:calc(100% - 36px)!important}.mec-wrap .mec-checkboxes-search .mec-searchbar-category-wrap input[type=search]{width:calc(100% - 36px)!important;min-height:30px;margin:0}.mec-wrap .mec-checkboxes-search .mec-searchbar-category-wrap .select2-container .select2-selection--multiple ul,.mec-wrap .mec-checkboxes-search .mec-searchbar-category-wrap .select2-container.select2-container--default{height:auto;overflow:unset}.mec-wrap .mec-checkboxes-search .mec-searchbar-category-wrap .select2-container .select2-selection--multiple ul{display:block}.mec-wrap .mec-checkboxes-search .mec-searchbar-category-wrap .select2-container .select2-selection--multiple{border:unset;width:100%;height:0!important;border-radius:0}.mec-wrap .mec-checkboxes-search .mec-searchbar-category-wrap .select2-container .select2-selection--multiple ul li{line-height:12px!important;max-height:20px!important;width:auto;margin-right:5px;margin-top:5px}.mec-wrap .mec-checkboxes-search .mec-searchbar-category-wrap .select2-container .select2-selection--multiple .select2-selection__choice{letter-spacing:0;color:#777;text-transform:capitalize;padding:4px 6px;background-color:#efefef;border-radius:2px;border:0;cursor:default;float:left;margin-right:5px;margin-top:5px;margin-bottom:5px;font-size:11px;text-transform:uppercase}.mec-wrap .mec-checkboxes-search .mec-searchbar-category-wrap .select2-container .select2-selection--multiple .select2-selection__choice__remove{color:#777}@media only screen and (min-width:961px) and (max-width:1200px){.mec-wrap .mec-totalcal-box{padding:37px 5px}}@media only screen and (max-width:960px){.mec-wrap .mec-totalcal-box .col-md-3,.mec-wrap .mec-totalcal-box .col-md-4,.mec-wrap .mec-totalcal-box .col-md-5{width:100%;float:none;clear:both;overflow:hidden}.mec-full-calendar-wrap .mec-search-form .col-md-3,.mec-full-calendar-wrap .mec-search-form .col-md-4,.mec-full-calendar-wrap .mec-search-form .col-md-5{display:block;max-width:100%;padding:0;margin:0 0 10px 0}.mec-full-calendar-wrap .mec-search-form .col-md-3{padding-bottom:10px!important}.mec-wrap .mec-search-form .mec-date-search select{width:calc(100% - 106px)}.mec-wrap .mec-search-form .mec-date-search select:last-child{width:70px}.mec-wrap .mec-totalcal-box .mec-totalcal-view{float:none}.mec-wrap .mec-checkboxes-search .mec-searchbar-category-wrap .select2-container .select2-selection--multiple .select2-selection__choice{display:block;max-width:100%;white-space:break-spaces;max-height:unset!important;height:auto!important}}@media only screen and (min-width:768px) and (max-width:960px){.mec-wrap .mec-totalcal-box .col-md-4{position:relative;width:initial}.mec-wrap .mec-totalcal-box .col-md-5{padding-bottom:0}.mec-full-calendar-wrap .mec-search-form .col-md-5{margin-top:20px}.mec-wrap .mec-totalcal-box{padding:37px 5px}}@media only screen and (max-width:767px){.mec-wrap .mec-totalcal-box .mec-totalcal-view{float:none}.mec-wrap .mec-totalcal-box .col-md-4{padding-bottom:0}.mec-wrap .mec-minmax-event-cost.with-mec-address,.mec-wrap .mec-text-address-search.with-mec-cost{width:100%;float:left}.mec-wrap .mec-minmax-event-cost.with-mec-address{max-width:calc(100% - 20px);margin:0 10px 20px 10px}.mec-wrap .mec-minmax-event-cost .mec-minmax-price{width:calc(50% - 17px)}}@media only screen and (max-width:479px){.mec-wrap .mec-totalcal-box .mec-totalcal-view span{padding:0 8px;font-size:10px}.mec-wrap .mec-totalcal-box input[type=submit]{padding:0 10px;font-size:10px}}@media only screen and (min-width:961px){.mec-wrap .mec-wrap.mec-sm959 .mec-totalcal-box .col-md-5,.mec-wrap.mec-sm959 .mec-totalcal-box .col-md-3{padding-bottom:20px;clear:both;overflow:hidden}.mec-wrap.mec-sm959 .mec-totalcal-box .col-md-5{right:10px;width:initial}.mec-wrap.mec-sm959 .mec-totalcal-box .col-md-4{padding-bottom:0;width:100%}}@media (min-width:961px) and (max-width:1200px){.mec-full-calendar-wrap .mec-totalcal-box{padding:15px 10px}.mec-full-calendar-wrap .mec-totalcal-box .col-md-2{width:50%}.mec-wrap .mec-totalcal-box .mec-totalcal-view span{padding:0 10px}.mec-search-form .mec-date-search,.mec-search-form .mec-dropdown-search,.mec-search-form .mec-text-address-search,.mec-search-form .mec-text-input-search{padding:0 4px}.mec-full-calendar-wrap .mec-totalcal-box .col-md-2,.mec-full-calendar-wrap .mec-totalcal-box .col-md-3,.mec-full-calendar-wrap .mec-totalcal-box .col-md-4,.mec-full-calendar-wrap .mec-totalcal-box .col-md-5{padding-bottom:20px}.mec-full-calendar-wrap .mec-totalcal-box .col-md-2 select{min-width:calc(100% - 36px)}.mec-full-calendar-wrap .mec-totalcal-box .col-md-3 select{min-width:calc(30% - 10px)}.mec-full-calendar-wrap .mec-totalcal-box .col-md-3:last-child select{min-width:calc(50% - 19px)}.mec-full-calendar-wrap .mec-totalcal-box .mec-totalcal-view span{font-size:9px;text-align:center}}@media only screen and (max-width:1200px){.post-type-archive-mec-events .mec-totalcal-box .col-md-3,.post-type-archive-mec-events .mec-totalcal-box .col-md-4{width:100%;padding:0}.post-type-archive-mec-events .mec-totalcal-box select:last-child{min-width:auto}.post-type-archive-mec-events .mec-totalcal-box .col-md-5{position:relative;float:right;max-width:100%;left:0;top:20px;width:100%!important;display:block;clear:both}.post-type-archive-mec-events .mec-totalcal-box .mec-totalcal-view{max-width:100%;width:100%}.post-type-archive-mec-events .mec-totalcal-box .mec-totalcal-view span{width:20.1%;font-size:10px}}@media only screen and (max-width:960px){.post-type-archive-mec-events .mec-totalcal-box .col-md-5{top:10px}}@media only screen and (max-width:760px){.post-type-archive-mec-events .mec-totalcal-box .col-md-5{top:0!important}}@media only screen and (max-width:480px){.post-type-archive-mec-events .mec-totalcal-box .mec-totalcal-view span{font-size:8px}}@media (min-width:1201px) and (max-width:1280px){.mec-full-calendar-wrap .mec-totalcal-view span{font-size:9px;padding:0 10px}}@media (min-width:761px) and (max-width:1200px){.mec-full-calendar-wrap .mec-search-form .mec-dropdown-wrap .mec-dropdown-search{width:33.3333%;display:block;float:left}.mec-full-calendar-wrap .mec-search-form .col-md-4 .mec-text-input-search{padding:0;margin-bottom:20px}.mec-full-calendar-wrap .mec-search-form .col-md-3{width:100%}.mec-full-calendar-wrap .mec-search-form .mec-date-search select:last-child{min-width:70px;width:70px}.mec-full-calendar-wrap .mec-search-form .col-md-5{float:right;padding:0 0 10px 0}.mec-full-calendar-wrap .mec-totalcal-view span{font-size:11px}}@media (max-width:760px){.mec-full-calendar-wrap .mec-search-form .col-md-3{width:100%}.mec-full-calendar-wrap .mec-search-form .mec-date-search select:last-child{min-width:70px;width:70px}.mec-full-calendar-wrap .mec-search-form .col-md-5{float:right;padding:0 0 10px 0}.mec-full-calendar-wrap .mec-totalcal-view span{font-size:11px}}@media (max-width:960px){.mec-full-calendar-wrap .mec-totalcal-box{padding:20px 20px}.mec-full-calendar-wrap .mec-totalcal-box .col-md-2{width:50%}.mec-full-calendar-wrap .mec-totalcal-box .col-md-2,.mec-full-calendar-wrap .mec-totalcal-box .col-md-3,.mec-full-calendar-wrap .mec-totalcal-box .col-md-4{padding-bottom:10px}.mec-full-calendar-wrap .mec-totalcal-box .col-md-2 select{min-width:calc(100% - 36px);margin-bottom:10px}.mec-full-calendar-wrap .mec-totalcal-box .mec-totalcal-view{margin-left:10px}.mec-full-calendar-wrap .mec-totalcal-box .mec-totalcal-view span{font-size:10px;text-align:center}.mec-full-calendar-wrap .mec-totalcal-box .col-md-2{width:100%}.mec-full-calendar-wrap .mec-totalcal-box .mec-totalcal-view span{min-width:14.3%;text-align:center;font-size:10px;margin-right:-1px}}@media (max-width:780px){.mec-full-calendar-wrap .mec-totalcal-box .col-md-3 select{width:calc(50% - 18px)!important}.mec-full-calendar-wrap .mec-totalcal-box .col-md-4{position:unset;padding-right:0}.mec-full-calendar-wrap .mec-search-form .col-md-3,.mec-full-calendar-wrap .mec-search-form .col-md-4,.mec-full-calendar-wrap .mec-search-form .col-md-5{margin:0;padding:0}.mec-wrap .mec-totalcal-box .mec-totalcal-view span{padding:0 7px;margin-top:20px}}@media (max-width:480px){.mec-full-calendar-wrap .mec-totalcal-box{padding:15px 10px}.mec-full-calendar-wrap .mec-totalcal-box .mec-totalcal-view span{min-width:13.5%;text-align:center;font-size:11px}}@media (max-width:411px){.mec-full-calendar-wrap .mec-totalcal-box .mec-totalcal-view span{min-width:12%;font-size:10px}}@media (max-width:320px){.mec-full-calendar-wrap .mec-totalcal-box .mec-totalcal-view span{min-width:22.5%;font-size:11px}}.mec-totalcalview-selected:hover{color:#fff!important}.mec-search-form{padding:20px 10px}.mec-search-form .mec-dropdown-wrap{display:table;width:100%}.mec-search-form .mec-date-input-search,.mec-search-form .mec-date-search,.mec-search-form .mec-dropdown-search,.mec-search-form .mec-text-input-search,.mec-search-form .mec-time-input-search{padding:0 10px;float:left}.mec-search-form .mec-date-search,.mec-search-form .mec-time-picker-search,.mec-search-form .mec-totalcal-view{padding:0 10px}.mec-search-form .mec-text-input-search{width:100%}.mec-search-form .mec-full-calendar-search-ends .mec-text-input-search{width:50%}.mec-search-form .mec-date-search,.mec-search-form .mec-time-picker-search{width:50%;float:left}.mec-search-form .mec-date-search.with-mec-time-picker,.mec-search-form .mec-time-picker-search.with-mec-date-search{width:25%;float:left}.mec-search-form .mec-tab-loader.col-md-6 .mec-totalcal-view{padding:0}.mec-wrap .mec-search-form .with-mec-date-search .mec-timepicker-end,.mec-wrap .mec-search-form .with-mec-date-search .mec-timepicker-start{width:calc(50% - 17px)}.mec-search-form .mec-full-calendar-search-ends .mec-text-input-search.col-md-12,.mec-search-form .mec-minmax-event-cost,.mec-search-form .mec-text-address-search{min-height:55px}.mec-search-form .mec-full-calendar-search-ends .mec-text-input-search.col-md-12,.mec-widget .mec-search-form .mec-date-search,.mec-widget .mec-search-form .mec-text-input-search{width:100%}.mec-search-form .mec-full-calendar-search-ends .mec-text-input-search.col-md-12{padding:0 10px}.mec-there-labels .mec-search-form .mec-full-calendar-search-ends .mec-text-input-search.col-md-12{margin-top:20px}.mec-search-form .mec-minmax-event-cost,.mec-search-form .mec-text-address-search,.mec-widget .mec-search-form .mec-text-input-search{margin-top:10px}.mec-search-form .mec-date-search{clear:left}.mec-search-form .mec-dropdown-wrap .mec-dropdown-search{display:table-cell;float:none}.mec-widget .mec-search-form .mec-dropdown-wrap .mec-dropdown-search{display:block}.mec-checkboxes-search .mec-searchbar-category-wrap,.mec-wrap .mec-search-form .mec-dropdown-wrap .mec-dropdown-search select{width:calc(100% - 36px);margin-bottom:10px}.mec-wrap .mec-search-form .mec-minmax-price input,.mec-wrap .mec-search-form .mec-text-address-search input,.mec-wrap .mec-search-form .mec-text-input-search input{margin-bottom:10px}.mec-wrap .mec-totalcal-box label{display:block;line-height:1.8;margin-bottom:4px;font-size:13px;color:#9a9a9a}.mec-wrap .mec-search-form .mec-date-search select{width:calc(100% - 106px)}.mec-wrap .mec-search-form .mec-date-search select:last-child{width:70px}@media only screen and (max-width:781px){.mec-search-form .mec-date-search,.mec-search-form .mec-dropdown-search,.mec-search-form .mec-text-input-search{width:100%;float:none}.mec-search-form .mec-date-search{min-height:55px}.mec-search-form .mec-dropdown-wrap .mec-dropdown-search{display:block;width:50%;float:left}.mec-full-calendar-wrap .mec-totalcal-box .col-md-3{margin-bottom:0;padding-bottom:0!important}}@media only screen and (max-width:479px){.mec-search-form .mec-dropdown-wrap .mec-dropdown-search{display:block;width:100%;float:none}}@media only screen and (min-width:961px) and (max-width:1200px){.post-type-archive-mec-events .mec-totalcal-box .col-md-3,.post-type-archive-mec-events .mec-totalcal-box .col-md-4,.post-type-archive-mec-events .mec-totalcal-box .col-md-5{max-width:100%;width:100%}.post-type-archive-mec-events .mec-totalcal-box .col-md-4{padding:0 10px}.post-type-archive-mec-events .mec-totalcal-box .col-md-4 .mec-text-input-search{margin:0}.post-type-archive-mec-events .mec-totalcal-box .col-md-5{margin-bottom:20px;padding:0 10px 10px 10px}}@media only screen and (max-width:960px){.mec-full-calendar-wrap .mec-totalcal-box .col-md-4,.post-type-archive-mec-events .mec-totalcal-box .col-md-4{padding:0 10px}.mec-full-calendar-wrap .mec-totalcal-box .col-md-4{margin-bottom:0}.post-type-archive-mec-events .mec-totalcal-box .col-md-4 .mec-text-input-search{margin:0}.post-type-archive-mec-events .mec-totalcal-box .mec-totalcal-view{padding-right:15px}.mec-full-calendar-wrap .mec-search-form .col-md-5{margin-bottom:0}.post-type-archive-mec-events .mec-totalcal-box .col-md-5{padding:0}}@media only screen and (max-width:780px){.post-type-archive-mec-events .mec-totalcal-box .mec-totalcal-view span{margin-top:10px;margin-bottom:10px}.mec-wrap .mec-totalcal-box .mec-totalcal-view span{margin-top:0}}@media only screen and (max-width:760px){.post-type-archive-mec-events .mec-totalcal-box .mec-totalcal-view span{margin-top:20px;margin-bottom:0}.mec-wrap .mec-totalcal-box .mec-totalcal-view span{margin-top:20px}.mec-full-calendar-wrap .mec-totalcal-box .col-md-4,.post-type-archive-mec-events .mec-totalcal-box .col-md-4{padding:0}}@media only screen and (max-width:1200px){.post-type-archive-mec-events .mec-full-calendar-wrap .mec-totalcal-view span{width:14.333%;font-size:8px}}@media only screen and (min-width:320px) and (max-width:960px){.post-type-archive-mec-events .mec-search-form .col-md-5 span{width:20%!important}}.mec-search-form .mec-text-address-search{float:left;width:100%;padding:0 10px}@media (max-width:960px){.mec-search-form .mec-dropdown-search{margin-bottom:10px}.mec-wrap .mec-minmax-event-cost.with-mec-address,.mec-wrap .mec-text-address-search.with-mec-cost{margin-top:0}.mec-search-form .mec-date-search.with-mec-time-picker,.mec-search-form .mec-time-picker-search.with-mec-date-search{width:50%;margin-bottom:20px}.mec-full-calendar-wrap .mec-totalcal-box .mec-totalcal-view{margin:0}.mec-full-calendar-wrap .mec-tab-loader{width:100%;display:block;float:unset;padding:0 0 0 10px}}@media (max-width:780px){.mec-full-calendar-wrap .mec-totalcal-box{padding:10px}.mec-search-form .mec-date-search.with-mec-time-picker,.mec-search-form .mec-time-picker-search.with-mec-date-search{margin:20px 0;height:auto}.mec-search-form .mec-date-search{min-height:unset}}@media (max-width:480px){.mec-search-form .mec-date-search.with-mec-time-picker,.mec-search-form .mec-time-picker-search.with-mec-date-search{width:100%}.mec-full-calendar-wrap .mec-totalcal-box .mec-totalcal-view span{min-width:12%;text-align:center;font-size:9px}.mec-full-calendar-wrap .mec-totalcal-box .mec-totalcal-view span,.mec-search-form .mec-date-search.with-mec-time-picker,.mec-search-form .mec-full-calendar-search-ends .mec-text-input-search,.mec-search-form .mec-minmax-event-cost,.mec-search-form .mec-text-address-search,.mec-search-form .mec-time-picker-search.with-mec-date-search,.mec-wrap .mec-minmax-event-cost.with-mec-address{margin-bottom:0;margin-top:10px;min-height:auto}.mec-wrap .mec-minmax-event-cost.with-mec-address{margin-bottom:10px}.mec-wrap.mec-widget .mec-minmax-event-cost.with-mec-address,.mec-wrap.mec-widget .mec-search-form .mec-time-picker-search.with-mec-date-search,.mec-wrap.mec-widget .mec-text-address-search.with-mec-cost{display:block!important;width:100%!important;max-width:100%!important}.mec-wrap.mec-widget .mec-minmax-event-cost.with-mec-address{float:left!important;max-width:calc(100% - 20px)!important;margin:0 0 0 10px!important}.mec-wrap.mec-widget .mec-search-form .mec-time-picker-search.with-mec-date-search{margin-top:20px!important}.mec-wrap.mec-widget .mec-search-form .mec-text-input-search{padding:10px!important}}.ui-datepicker{background-color:#fff;border:1px solid #66afe9;border-radius:4px;box-shadow:0 0 8px rgba(102,175,233,.6);display:none;margin-top:4px;padding:10px;width:240px}.ui-datepicker a,.ui-datepicker a:hover{text-decoration:none;cursor:pointer}.ui-datepicker a:hover,.ui-datepicker td:hover a{color:#2c6396;-webkit-transition:color .1s ease-in-out;-moz-transition:color .1s ease-in-out;-o-transition:color .1s ease-in-out;transition:color .1s ease-in-out}.ui-datepicker .ui-datepicker-header{margin-bottom:4px;text-align:center}.ui-datepicker .ui-datepicker-title{font-weight:700}.ui-datepicker .ui-datepicker-next,.ui-datepicker .ui-datepicker-prev{cursor:default;font-family:dashicons;-webkit-font-smoothing:antialiased;font-style:normal;font-weight:400;height:20px;line-height:1.4;margin-top:2px;width:20px}.ui-datepicker .ui-datepicker-prev{float:left;text-align:left}.ui-datepicker .ui-datepicker-next{float:right;text-align:center}.ui-datepicker .ui-datepicker-prev:before{content:"\f341"}.ui-datepicker .ui-datepicker-next:before{content:"\f345"}.ui-datepicker .ui-icon{display:none}.ui-datepicker .ui-datepicker-calendar{table-layout:fixed;width:100%}.ui-datepicker .ui-datepicker-calendar td,.ui-datepicker .ui-datepicker-calendar th{text-align:center;padding:4px 0}.ui-datepicker .ui-datepicker-calendar td{border-radius:4px;-webkit-transition:background-color .1s ease-in-out,color .1s ease-in-out;-moz-transition:background-color .1s ease-in-out,color .1s ease-in-out;-o-transition:background-color .1s ease-in-out,color .1s ease-in-out;transition:background-color .1s ease-in-out,color .1s ease-in-out}.ui-datepicker .ui-datepicker-calendar td:hover{background-color:#eee;cursor:pointer}.ui-datepicker .ui-datepicker-calendar td a{text-decoration:none}.ui-datepicker .ui-datepicker-current-day{background-color:#4289cc}.ui-datepicker .ui-datepicker-current-day a{color:#fff}.ui-datepicker .ui-datepicker-calendar .ui-datepicker-unselectable:hover{background-color:#fff;cursor:default}@media only screen and (max-width:768px){.mec-owl-theme .owl-nav [class*=owl-]{display:none!important}}.mec-owl-theme .owl-dots .owl-dot{border:none}.event-carousel-type1-head .mec-event-image{position:relative;min-height:150px;overflow:hidden}.event-carousel-type1-head .mec-event-image img{width:100%}.mec-event-carousel-content .mec-event-carousel-title a{transition:all .2s ease}.event-carousel-type1-head .mec-event-date-carousel{position:absolute;top:25px;left:1px;font-size:41px;width:160px;color:#fff;font-weight:500;background-color:#40d9f1;padding-left:14px;height:97px;line-height:2.3;padding-right:85px}.event-carousel-type1-head .mec-event-date-carousel:after{content:"";position:absolute;display:inline-block;z-index:-1;bottom:-13px;left:5px;width:0;border-width:13px;border-style:solid;border-color:transparent transparent #40d9f1 transparent;transform:rotate(45deg)}.event-carousel-type1-head .mec-event-date-info{font-size:12px;font-weight:300;position:absolute;top:27px;left:75px}.event-carousel-type1-head .mec-event-date-info-year{font-size:12px;font-weight:300;position:absolute;top:45px;left:75px}.mec-event-carousel-content{border:1px solid #e8e8e8;border-top:none;margin-top:-5px;padding:34px 9px 11px 37px}.mec-event-carousel-content .mec-event-carousel-title a{font-size:23px;font-weight:500;color:#000;letter-spacing:-1px}.mec-event-carousel-content p{font-size:14px;color:#7a7272;font-weight:300}.mec-owl-crousel-skin-type1 .owl-item .mec-event-article{padding:0 19px}.mec-event-carousel-type1 .owl-page.active span{background-color:#00aeef;height:14px;width:14px}.mec-event-carousel-type1 .mec-event-carousel-content{margin-bottom:15px;box-shadow:0 1px 2px rgba(0,0,0,.04);transition:all .27s ease}.mec-skin-carousel-container .mec-owl-carousel button:focus{outline:0}.mec-event-carousel-type1 .mec-event-carousel-content:hover{box-shadow:0 0 35px rgba(0,0,0,.07)}.mec-skin-carousel-container .mec-multiple-event .mec-event-date-carousel{width:255px}.mec-skin-carousel-container .mec-multiple-event .event-carousel-type1-head .mec-event-date-info,.mec-skin-carousel-container .mec-multiple-event .event-carousel-type1-head .mec-event-date-info-year{left:175px}.mec-skin-carousel-container .mec-time-details,.mec-skin-carousel-container .mec-time-details span{font-size:11px;font-weight:400;line-height:1.9;letter-spacing:0;color:#000;border-radius:2px;white-space:nowrap}.mec-event-carousel-type4 .mec-time-details,.mec-event-carousel-type4 .mec-time-details span{color:#fff}.mec-skin-carousel-container .mec-time-details span{margin:0;display:inline-block}@media only screen and (min-width:768px) and (max-width:1000px),(min-width:270px) and (max-width:448px){.event-carousel-type1-head .mec-event-date-carousel{font-size:25px;line-height:2.5;padding-right:70px;height:64px;width:120px}.event-carousel-type1-head .mec-event-date-carousel:after{left:7px}.event-carousel-type1-head .mec-event-date-info{font-size:10px;top:13px;left:55px}.event-carousel-type1-head .mec-event-date-info-year{font-size:10px;top:25px;left:55px}.event-carousel-type1-head .mec-event-date-carousel:after{top:48px}}.event-carousel-type2-head{background:#fff;border:1px solid #e6e6e6}.event-carousel-type2-head .mec-event-carousel-content-type2{margin-top:15px;min-height:182px}.event-carousel-type2-head .mec-event-carousel-content-type2 .mec-event-date-info{font-size:15px;color:#9a9a9a;font-weight:300}.event-carousel-type2-head .mec-event-carousel-content-type2 .mec-event-carousel-title{font-size:26px;font-weight:700;color:#1c1d21;margin-top:15px;letter-spacing:-1px}.mec-event-carousel-content-type2 .mec-event-carousel-title a{color:inherit}.mec-event-carousel-type2 .event-carousel-type2-head .mec-event-carousel-content-type2 p{font-size:16px;font-weight:300;color:#444}.event-carousel-type2-head .mec-event-footer-carousel-type2{margin-top:33px;position:relative;display:flex;flex-wrap:wrap;flex-direction:row;justify-content:flex-end}.mec-event-carousel-type2 .mec-event-footer-carousel-type2 .mec-event-sharing-wrap{padding-left:0;position:relative;left:0;margin-right:auto}.event-carousel-type2-head .mec-event-footer-carousel-type2 .mec-event-sharing-wrap>li{border:none;-webkit-transition:all .25s ease;transition:all .25s ease}.event-carousel-type2-head .mec-event-footer-carousel-type2 .mec-booking-button{border:1px solid #e4e4e4;padding:7px 23px 7px;font-size:12px;text-transform:uppercase;color:#707070;font-weight:500;-webkit-transition:all .25s ease;transition:all .25s ease}.event-carousel-type2-head .mec-event-footer-carousel-type2 .mec-booking-button:hover{color:#fff}.mec-event-article .event-carousel-type2-head{padding:10%;margin-right:-1px}.mec-event-carousel-type2 .mec-owl-carousel .owl-wrapper-outer{border-right:1px solid #e6e6e6}.event-carousel-type2-head .mec-event-footer-carousel-type2 .mec-booking-button{line-height:17px;height:41px;padding:12px 10px}.event-carousel-type2-head .mec-event-footer-carousel-type2 .mec-modal-booking-button{margin:0;padding:12px 10px;margin-left:15px}.mec-wrap .mec-event-carousel-type2 .owl-next,.mec-wrap .mec-event-carousel-type2 .owl-prev,.mec-wrap .mec-event-carousel-type3 .owl-next,.mec-wrap .mec-event-carousel-type3 .owl-prev,.mec-wrap .mec-event-carousel-type4 .owl-next,.mec-wrap .mec-event-carousel-type4 .owl-prev{transition:all .25s ease;-webkit-transition:all .25s ease;position:absolute;top:47%;background-color:transparent!important;position:absolute!important}.mec-event-carousel-type2 .owl-next{right:-60px}.mec-event-carousel-type2 .owl-prev{left:-60px}.mec-event-carousel-type2 .owl-next,.mec-event-carousel-type2 .owl-prev,.mec-event-carousel-type3 .owl-next,.mec-event-carousel-type3 .owl-prev,.mec-event-carousel-type4 .owl-next,.mec-event-carousel-type4 .owl-prev{border:none}.mec-event-carousel-type2 .owl-next i,.mec-event-carousel-type2 .owl-prev i,.mec-event-carousel-type3 .owl-next i,.mec-event-carousel-type3 .owl-prev i,.mec-event-carousel-type4 .owl-next i,.mec-event-carousel-type4 .owl-prev i{font-size:40px;color:#282828}.mec-event-carousel-type2 .owl-next i:hover,.mec-event-carousel-type2 .owl-prev i:hover,.mec-event-carousel-type3 .owl-next i:hover,.mec-event-carousel-type3 .owl-prev i:hover{color:#000;cursor:pointer}.mec-event-footer-carousel-type2 .mec-event-sharing-wrap .mec-event-sharing{top:auto;bottom:60px}.mec-event-footer-carousel-type2 .mec-event-sharing-wrap .mec-event-sharing:after,.mec-event-footer-carousel-type2 .mec-event-sharing-wrap .mec-event-sharing:before{top:auto;bottom:-19px;border-color:#e2e2e2 transparent transparent transparent}.mec-event-footer-carousel-type2 .mec-event-sharing-wrap .mec-event-sharing:after{bottom:-18px;border-color:#fff transparent transparent transparent}@media only screen and (min-width:320px) and (max-width:768px){.mec-event-carousel-type2 .owl-next,.mec-event-carousel-type2 .owl-prev,.mec-event-carousel-type3 .owl-next,.mec-event-carousel-type3 .owl-prev,.mec-event-carousel-type4 .owl-next,.mec-event-carousel-type4 .owl-prev{position:initial;top:100%}}.mec-event-carousel-type3 .mec-event-article{margin:0 10px}.event-carousel-type3-head .mec-event-image,.event-carousel-type3-head .mec-event-image img{width:100%;height:auto}.event-carousel-type3-head .mec-event-footer-carousel-type3{background:#fff;display:inline-block;width:calc(100% - 40px);margin-top:-74px;position:relative;margin-left:20px;margin-right:20px;margin-bottom:6px;padding:8% 11%;box-shadow:0 2px 10px -2px rgba(0,0,0,.2)}.event-carousel-type3-head .mec-event-footer-carousel-type3 .mec-booking-button{border:1px solid #e4e4e4;text-transform:uppercase;float:right;padding:0 10px;font-size:12px;line-height:36px;color:#707070;font-weight:500}.event-carousel-type3-head .mec-event-footer-carousel-type3 .mec-booking-button:hover{color:#fff}.mec-event-footer-carousel-type3 span{font-size:15px;color:#9a9a9a;font-weight:300}.mec-event-footer-carousel-type3 .mec-event-carousel-title{font-size:29px;font-weight:700}.event-carousel-type3-head .mec-event-footer-carousel-type3 .mec-event-carousel-title{font-size:26px;font-weight:700;color:#1c1d21;margin-top:15px;letter-spacing:-1px}.mec-event-footer-carousel-type3 .mec-event-carousel-title a{color:inherit}.event-carousel-type3-head .mec-event-footer-carousel-type3 p{font-size:16px;font-weight:300;color:#444!important;margin-bottom:36px}.mec-event-carousel-type3 .owl-next{right:-70px}.mec-event-carousel-type3 .owl-prev{left:-70px}.mec-event-footer-carousel-type3 .mec-event-sharing-wrap{position:static;float:left}.mec-event-footer-carousel-type3 .mec-event-sharing-wrap .mec-event-sharing{top:auto;bottom:60px}.mec-event-footer-carousel-type3 .mec-event-sharing-wrap .mec-event-sharing:after,.mec-event-footer-carousel-type3 .mec-event-sharing-wrap .mec-event-sharing:before{top:auto;bottom:-19px;border-color:#e2e2e2 transparent transparent transparent}.mec-event-footer-carousel-type3 .mec-event-sharing-wrap .mec-event-sharing:after{bottom:-18px;border-color:#fff transparent transparent transparent}.event-carousel-type3-head .mec-end-date-label{display:inline;margin-left:2px}.event-carousel-type4-head.clearfix{position:relative;overflow:hidden;background:#fff}.event-carousel-type4-head .mec-event-overlay{position:absolute;left:0;right:0;bottom:0;top:0;width:auto;height:auto;background-color:rgba(36,36,36,.4);transition:all .33s ease-in-out}.mec-event-hover-carousel-type4{font-size:15px;color:#fff;position:absolute;bottom:0;padding:50px 35px;transition:all .33s ease-in-out;opacity:0;visibility:hidden}.event-carousel-type4-head .mec-event-image img{min-height:360px;object-fit:cover}.mec-event-carousel-type4 .mec-event-article{margin:0 10px}.mec-event-carousel-type4 .mec-event-article:hover .mec-event-hover-carousel-type4{opacity:1;visibility:visible}.mec-event-hover-carousel-type4 .mec-event-icon{font-size:18px;float:left;margin-right:14px;color:#fff;padding:13px}.mec-event-hover-carousel-type4 .mec-event-date{font-size:11px;text-transform:uppercase;font-weight:400;line-height:1.6;text-align:left}.mec-event-hover-carousel-type4 .mec-event-date span{display:block;font-weight:700;font-size:14px}.mec-event-hover-carousel-type4 .mec-event-title{color:#fff;margin:20px 0 38px;font-size:16px;font-weight:700;text-transform:uppercase;font-style:normal}.mec-event-hover-carousel-type4 .mec-btn-wrapper{text-align:left}.mec-event-hover-carousel-type4 .mec-event-button{color:#fff;background-color:#191919;border:2px #191919 solid;padding:10px 14px;letter-spacing:1.5px;font-size:11px;font-weight:700;font-style:normal;transition:all .22s ease;text-decoration:none}.mec-event-hover-carousel-type4 .mec-event-button:hover{color:#191919;background-color:#fff;border-color:#fff;border-radius:1px}.mec-event-carousel-type4 .owl-next{right:-70px}.mec-event-carousel-type4 .owl-prev{left:-70px}.mec-carousel-type4-head{margin-bottom:25px}.mec-carousel-type4-head-title{padding:0 11px;text-align:left;font-weight:700;font-size:20px;color:#000}.mec-carousel-type4-head-link{text-align:right;padding:0 11px}.mec-carousel-type4-head-link a{background:#222;color:#fff;padding:10px 38px;transition:all .3s ease}.mec-carousel-type4-head-link a:hover,.mec-carousel-type4-head-link a:visited{color:#fff}@media (max-width:960px){.mec-event-carousel-type4 .owl-stage{left:-50px}}.mec-wrap .mec-event-countdown-style1{color:#fff;padding:0!important;display:table;background:#437df9}.mec-wrap .mec-event-countdown-style1 .mec-event-countdown-part1{z-index:5;padding:50px 1% 50px 4%;display:table-cell;float:none;vertical-align:middle}.mec-wrap .mec-event-countdown-style1 .mec-event-countdown-part2{background-color:rgba(0,0,0,.05);height:100%;padding-top:0;display:table-cell;float:none;position:relative;vertical-align:middle}.mec-wrap .mec-event-countdown-style1 .mec-event-countdown-part3{background-color:#f8f8f8;display:table-cell;float:none;text-align:center;vertical-align:middle}.mec-wrap .mec-event-countdown-style1 .mec-event-countdown-part1 .mec-event-title{color:#fff;font-size:15px;margin-top:30px}.mec-wrap .mec-event-countdown-style1 .mec-event-countdown-part1 .mec-event-upcoming{font-size:36px;font-weight:700;line-height:1;margin-top:0}.mec-wrap .mec-event-countdown-style1 .mec-event-countdown-part2 .mec-event-countdown>div{display:inline-block}.mec-event-countdown-style1 .mec-events-meta-group-countdown{color:#c9c9c9;margin-bottom:30px;padding:20px 30px;background:#fff;border:1px solid #e6e6e6;box-shadow:0 2px 0 0 rgba(0,0,0,.016)}.mec-event-countdown-style1 .mec-event-countdown-part1 .mec-event-upcoming span{display:block}.mec-wrap .mec-event-countdown-style1 .mec-event-countdown-part2:after{content:"";position:absolute;display:inline-block;z-index:1;top:50%;margin-top:-11px;right:-24px;width:0;border-width:12px;border-style:solid;border-color:transparent transparent transparent #4077ed}.mec-event-countdown-style1 .mec-event-countdown-part2 .mec-event-date-place{text-align:center;padding-bottom:8px}.mec-event-countdown-part2 .mec-event-place,.mec-event-countdown-style1 .mec-event-countdown-part2 .mec-event-date{display:inline;font-size:14px;padding:0 5px;text-align:center}.mec-event-countdown-style1 .mec-event-countdown-part3 .mec-event-button{display:inline-block;padding:14px 30px;vertical-align:middle;font-size:12px;letter-spacing:1px;text-transform:uppercase;color:#fff;background:#4077ed;transition:all .24s ease}.mec-event-countdown-style1 .mec-event-countdown-part3 .mec-event-button:hover{background:#222}.mec-event-countdown-style1 .mec-event-countdown{text-align:center;display:table;table-layout:fixed;margin:0 auto}.mec-event-countdown-style1 .mec-event-countdown .label-w{letter-spacing:1px;text-transform:uppercase;position:relative}.mec-event-countdown-style1 .mec-event-countdown .block-w{display:table-cell;margin:0 20px 10px;position:relative;height:70px}.mec-wrap .mec-event-countdown-style1 .mec-event-countdown li{background-color:rgba(0,0,0,.1);margin:5px;padding:20px 0;min-width:94px}.mec-wrap .mec-event-countdown-style1 .mec-event-countdown li span{font-size:30px}.mec-wrap .mec-event-countdown-style1 .mec-event-countdown li .label-w{font-size:12px;color:#fff;margin:8px 0 0;line-height:1}@media only screen and (min-width:1200px){.mec-wrap.mec-sm959 .mec-event-countdown-style1 .mec-event-countdown-part1,.mec-wrap.mec-sm959 .mec-event-countdown-style1 .mec-event-countdown-part2,.mec-wrap.mec-sm959 .mec-event-countdown-style1 .mec-event-countdown-part3{width:100%;display:block;padding-top:50px;padding-bottom:50px}.mec-wrap.mec-sm959 .mec-event-countdown-style1 .mec-event-countdown-part2:after{border-color:#4077ed transparent transparent transparent;top:auto;margin-top:0;bottom:-24px;margin-left:-11px;left:50%}}@media (max-width:960px){.mec-wrap .mec-event-countdown-style1 .mec-event-countdown-part1,.mec-wrap .mec-event-countdown-style1 .mec-event-countdown-part2,.mec-wrap .mec-event-countdown-style1 .mec-event-countdown-part3{width:100%;display:block;padding-top:50px;padding-bottom:50px}.mec-wrap .mec-event-countdown-style1 .mec-event-countdown-part2:after{border-color:#4077ed transparent transparent transparent;top:auto;margin-top:0;bottom:-24px;margin-left:-11px;left:50%;transform:rotate(90deg)}}@media (max-width:480px){.mec-event-countdown-style1 .mec-event-countdown .block-w{margin:3px;height:auto}.mec-wrap .mec-event-countdown-style1 .mec-event-countdown li{padding:10px 5px;min-width:50px;margin:3px 1px}.mec-wrap .mec-event-countdown-style1 .mec-event-countdown li span{font-size:15px}.mec-wrap .mec-event-countdown-style1 .mec-event-countdown li .label-w{font-size:8px}.mec-event-countdown-style1 .mec-event-countdown-part2 .mec-event-date-place{display:inline}}.mec-wrap .mec-event-countdown-style2{color:#fff;padding:30px 0;background:#437df9;max-width:600px}.mec-wrap .mec-event-countdown-style2 .mec-event-countdown-part1,.mec-wrap .mec-event-countdown-style2 .mec-event-countdown-part2,.mec-wrap .mec-event-countdown-style2 .mec-event-countdown-part3{width:100%;float:none;vertical-align:middle;padding:50px 10% 50px 10%}.mec-wrap .mec-event-countdown-style2 .mec-event-countdown-part2{padding-top:12%;padding-bottom:0}.mec-wrap .mec-event-countdown-style2 .mec-event-countdown-part1 .mec-event-title{color:#fff;font-size:15px;margin-top:30px}.mec-wrap .mec-event-countdown-style2 .mec-event-countdown-part1 .mec-event-upcoming{font-size:36px;font-weight:700;line-height:1;margin-top:0}.mec-wrap .mec-event-countdown-style2 .mec-event-countdown-part2 .mec-event-countdown>div{display:inline-block}.mec-event-countdown-style2 .mec-events-meta-group-countdown{color:#c9c9c9;margin-bottom:30px;padding:20px 30px;background:#fff;box-shadow:0 2px 0 0 rgba(0,0,0,.016)}.mec-event-countdown-style2 .mec-event-countdown-part1 .mec-event-upcoming span{display:block}.mec-event-countdown-style2 .mec-event-countdown-part2 .mec-event-date-place{text-align:left;padding-bottom:8px}.mec-event-countdown-part2 .mec-event-place,.mec-event-countdown-style2 .mec-event-countdown-part2 .mec-event-date{display:inline;font-size:14px;padding:0 8px}.mec-event-countdown-style2 .mec-event-countdown-part3 .mec-event-button{display:inline-block;padding:14px 30px;vertical-align:middle;font-size:12px;letter-spacing:1px;text-transform:uppercase;color:#222;background:#fff;transition:all .24s ease}.mec-event-countdown-style2 .mec-event-countdown-part3 .mec-event-button:hover{background:#222;color:#fff}.mec-event-countdown-style2 .mec-event-countdown{text-align:center;display:table;table-layout:fixed;margin:0}.mec-event-countdown-style2 .mec-event-countdown .label-w{letter-spacing:1px;text-transform:uppercase;position:relative}.mec-event-countdown-style2 .mec-event-countdown .block-w{display:table-cell;margin:0 20px 10px;position:relative;height:70px}.mec-wrap .mec-event-countdown-style2 .mec-event-countdown li{background-color:rgba(0,0,0,.1);margin:5px;padding:20px 0;min-width:94px}.mec-wrap .mec-event-countdown-style2 .mec-event-countdown li span{font-size:30px}.mec-wrap .mec-event-countdown-style2 .mec-event-countdown li .label-w{font-size:12px;color:#fff;margin:8px 0 0;line-height:1}@media only screen and (max-width:767px){.mec-wrap .mec-event-countdown-style2 .mec-event-countdown li{min-width:80px;padding:15px}.mec-wrap .mec-event-countdown-style2 .mec-event-countdown li span{font-size:26px}.mec-wrap .mec-event-countdown-style2 .mec-event-countdown li .label-w{font-size:11px}}@media only screen and (max-width:479px){.mec-wrap .mec-event-countdown-style2 .mec-event-countdown li{min-width:40px;padding:15px 10px;margin:2px}.mec-wrap .mec-event-countdown-style2 .mec-event-countdown li span{font-size:20px}.mec-wrap .mec-event-countdown-style2 .mec-event-countdown li .label-w{font-size:9px}}@media (max-width:380px){.mec-event-countdown-style2 .mec-event-countdown .block-w{margin:3px;height:auto}.mec-wrap .mec-event-countdown-style2 .mec-event-countdown li{padding:10px 4px;margin:4px 1px}.mec-wrap .mec-event-countdown-style2 .mec-event-countdown li span{font-size:15px}.mec-wrap .mec-event-countdown-style2 .mec-event-countdown li .label-w{font-size:7px}}.mec-wrap .mec-event-countdown-style3{color:#fff;padding:0;background:#282828;display:table;width:100%}.mec-wrap .mec-event-countdown-style3 .mec-event-countdown-part1{width:68%;padding:50px 1% 50px 4%;vertical-align:middle;display:table-cell;position:relative}.mec-wrap .mec-event-countdown-style3 .mec-event-countdown-part2{width:32%;display:table-cell;position:relative;padding-bottom:0;padding-top:0}.mec-wrap .mec-event-countdown-style3 .mec-event-countdown-part2 img{width:100%;display:block}.mec-wrap .mec-event-countdown-style3 .mec-event-countdown-part1 .mec-event-countdown-part-title span{font-weight:300;display:block}.mec-wrap .mec-event-countdown-style3 .mec-event-countdown-part1 .mec-event-upcoming{color:#fff;font-size:36px;letter-spacing:-2px;font-weight:700;line-height:1;margin-top:-10px}.mec-wrap .mec-event-countdown-style3 .mec-event-countdown-part2 .mec-event-countdown>div{display:inline-block}.mec-event-countdown-style3 .mec-events-meta-group-countdown{color:#c9c9c9;margin-bottom:30px;padding:20px 30px;background:#fff;border:1px solid #e6e6e6;box-shadow:0 2px 0 0 rgba(0,0,0,.016)}.mec-event-countdown-style3 .mec-event-countdown-part2 .mec-event-date-place{text-align:center;padding-bottom:8px}.mec-event-countdown-part2 .mec-event-place,.mec-event-countdown-style3 .mec-event-countdown-part2 .mec-event-date{display:inline;font-size:14px;padding:0 5px;text-align:center}.mec-event-countdown-style3 .mec-event-countdown-part3 .mec-event-button{display:inline-block;padding:14px 30px;vertical-align:middle;font-size:12px;letter-spacing:1px;text-transform:uppercase;color:#fff;background:#4077ed;transition:all .24s ease}.mec-event-countdown-style3 .mec-event-countdown-part3 .mec-event-button:hover{background:#222}.mec-event-countdown-style3 .mec-event-countdown{text-align:center;display:table;table-layout:fixed;margin:0 auto;position:absolute;top:40px;right:20px}.mec-event-countdown-style3 .mec-event-countdown .label-w{letter-spacing:1px;text-transform:uppercase;position:relative}.mec-event-countdown-style3 .mec-event-countdown .block-w{display:table-cell;margin:0 20px 10px;position:relative;height:70px}.mec-wrap .mec-event-countdown-style3 .mec-event-countdown li{padding:15px}.mec-wrap .mec-event-countdown-style3 .mec-event-countdown li span{font-size:30px}.mec-wrap .mec-event-countdown-style3 .mec-event-countdown li .label-w{font-size:11px;color:#888;margin:8px 0 0;line-height:1}.mec-event-countdown-style3 .mec-event-date{width:176px;height:96px;background:#40d9f1;color:#fff;font-size:13px;position:absolute;left:-27px;top:146px}.mec-event-countdown-style3 .mec-event-date:after{content:"";position:absolute;display:inline-block;z-index:1;bottom:-18px;left:8px;width:0;border-width:19px;border-style:solid;border-color:transparent transparent #40d9f1 transparent;transform:rotate(45deg)}.mec-event-countdown-style3 .mec-event-date .mec-date1{font-size:50px;position:absolute;top:7px;left:12px;letter-spacing:-3px}.mec-event-countdown-style3 .mec-event-date .mec-date2{position:absolute;left:80px;top:26px}.mec-event-countdown-style3 .mec-event-date .mec-date3{position:absolute;left:80px;top:45px}.mec-event-countdown-style3 .mec-event-countdown-part-details{padding-top:35px;margin-bottom:50px;min-height:100px}.mec-event-countdown-style3 .mec-event-countdown-part-details .mec-event-title{font-size:17px;color:#fff;line-height:1.4;padding-right:20px}.mec-event-countdown-style3 .mec-event-countdown-part-details .mec-event-link{color:#fff;font-size:12px;position:relative;padding-left:22px}.mec-event-countdown-style3 .mec-event-countdown-part-details .mec-event-link:before{content:"";display:inline-block;width:18px;border-top:1px solid #fff;position:absolute;left:0;top:8px}.mec-event-countdown-style3 .mec-event-title-link{position:absolute;left:190px;top:152px}.event-carousel-type1-head .mec-event-date-carousel:before,.mec-event-countdown-style3 .mec-event-date:before{content:"";position:absolute;left:0;bottom:0;z-index:2;width:100%;height:96px;display:inline-block;box-shadow:0 5px 5px rgba(0,0,0,.12);background:0 0}@media only screen and (min-width:960px){.mec-wrap.mec-sm959 .mec-event-countdown-style3 .mec-event-countdown li{padding:10px}.mec-wrap.mec-sm959 .mec-event-countdown-style3 .mec-event-countdown-part1 .mec-event-upcoming{font-size:31px}}@media (max-width:959px){.mec-wrap .mec-event-countdown-style3 .mec-event-countdown-part1,.mec-wrap .mec-event-countdown-style3 .mec-event-countdown-part2{width:100%;display:block}.mec-event-countdown-style3 .mec-event-title-link{top:190px}.mec-event-countdown-style3 .mec-event-countdown{top:96px}.mec-event-countdown-style3 .mec-event-date{left:0;top:190px}.mec-event-countdown-style3 .mec-event-date:after{display:none}.mec-wrap .mec-event-countdown-style3 .mec-event-countdown-part1 .mec-event-countdown-part-title span{display:inline}.mec-event-countdown-style3 .mec-event-countdown-part-details{min-height:150px}}@media (max-width:767px){.mec-wrap .mec-event-countdown-style3 .mec-event-countdown-part1 .mec-event-upcoming{font-size:26px;letter-spacing:-1px}.mec-event-countdown-style3 .mec-event-title-link{left:130px}.mec-event-countdown-style3 .mec-event-date{width:120px;font-size:10px;height:63px}.mec-event-countdown-style3 .mec-event-date .mec-date1{font-size:36px;top:3px;left:4px;letter-spacing:-2px}.mec-event-countdown-style3 .mec-event-date .mec-date2{position:absolute;left:52px;top:12px}.mec-event-countdown-style3 .mec-event-date .mec-date3{position:absolute;left:52px;top:28px}}@media (max-width:380px){.mec-event-countdown-style3 .mec-event-title-link{left:10px;top:260px}.mec-event-countdown-style3 .mec-event-countdown-part-details{min-height:300px}.mec-event-countdown-style3 .mec-event-countdown .block-w{margin:3px;height:auto}.mec-wrap .mec-event-countdown-style3 .mec-event-countdown li{padding:10px 5px}.mec-wrap .mec-event-countdown-style3 .mec-event-countdown li span{font-size:15px}.mec-wrap .mec-event-countdown-style3 .mec-event-countdown li .label-w{font-size:8px}}.mec-slider-t1-wrap{width:100%;padding:60px 90px;background:#f7f7f7;min-height:560px;position:relative}.mec-slider-t1{height:500px;box-shadow:0 5px 35px 0 rgba(0,0,0,.13)}.mec-slider-t1 .mec-event-article{position:relative;height:500px}.mec-slider-t1 .mec-slider-t1-img{position:relative;background-size:cover!important;background-position:center!important;width:50%;height:100%;float:right;margin:0;overflow:hidden}.mec-slider-t1 .mec-slider-t1-content{width:50%;float:left;height:100%;background:#fff;padding:6%}.mec-slider-t1-content.mec-event-grid-modern .mec-event-article{border:none;padding:0;margin:0;box-shadow:none}.mec-slider-t1-content.mec-event-grid-modern .mec-event-title{font-size:29px}.mec-slider-t1-content.mec-event-grid-modern .mec-event-title a:hover{text-decoration:underline}.mec-slider-t1-content.mec-event-grid-modern .mec-event-footer .mec-booking-button{font-size:12px;padding:0 31px;line-height:49px;height:50px}.mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-next,.mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-prev{opacity:1;width:54px;height:54px;line-height:48px;border-radius:0;text-align:center;background:#fff;box-shadow:0 2px 11px 0 rgba(0,0,0,.045);transition:all .25s ease;-webkit-transition:all .25s ease;position:absolute;top:50%;margin-top:-27px;cursor:pointer}.mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-next:hover,.mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-prev:hover{box-shadow:0 4px 29px 0 rgba(0,0,0,.095)}.mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-next{left:auto;right:-100px}.mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-prev{right:auto;left:-100px}.mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-next i,.mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-prev i{font-size:12px;color:#282828;transition:all .21s ease}.mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-next:hover i,.mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-prev:hover i{font-size:13px;color:#000;cursor:pointer}@media only screen and (min-width:961px){.mec-slider-t1{margin:0 auto;max-width:900px}}@media only screen and (max-width:960px){.mec-slider-t1 .mec-slider-t1-content,.mec-slider-t1 .mec-slider-t1-img{width:100%;float:none}.mec-slider-t1 .mec-slider-t1-img{height:300px}.mec-slider-t1,.mec-slider-t1 .mec-event-article{height:auto}}@media only screen and (max-width:768px){.mec-slider-t1-wrap{padding:0}.mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-next,.mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-prev{top:40px;margin-top:0}.mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-next{left:auto;right:10px}.mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-prev{right:auto;left:10px}}@media only screen and (max-width:479px){.mec-slider-t1-content.mec-event-grid-modern .mec-event-title{font-size:22px}.mec-slider-t1-content.mec-event-grid-modern .event-grid-modern-head .mec-event-day{font-size:25px}}.mec-slider-t2-wrap{width:100%;padding:0;background:#fff;min-height:600px;position:relative}.mec-slider-t2 .mec-event-article{height:600px;position:relative;border:none;padding:0;margin:0;box-shadow:none;background:0 0}.mec-slider-t2 .mec-slider-t2-img{position:absolute;left:0;top:0;background-size:cover!important;background-position:center!important;width:70%;height:100%;margin:0;overflow:hidden}.mec-slider-t2 .mec-slider-t2-content{width:50%;position:absolute;right:0;top:60px;bottom:60px;padding:3%}.mec-slider-t2 .mec-slider-t2-content.mec-event-grid-modern *{color:#fff}.mec-slider-t2 .mec-slider-t2-content.mec-event-grid-modern .mec-event-title{font-size:29px}.mec-slider-t2-content.mec-event-grid-modern .mec-event-content,.mec-slider-t2-content.mec-event-grid-modern .mec-event-footer .mec-booking-button{background:0 0}.mec-slider-t2-content.mec-event-grid-modern .mec-event-footer .mec-booking-button{font-size:12px;padding:0 31px;line-height:49px;height:50px}.mec-slider-t2-content.mec-event-grid-modern .mec-event-footer .mec-booking-button:hover{background:#fff;color:#000;border-color:#fff}.mec-slider-t2-content.mec-event-grid-modern .mec-event-footer .mec-booking-button:hover,.mec-slider-t2-content.mec-event-grid-modern .mec-event-title a:hover{color:#111}.mec-slider-t2-wrap .mec-owl-theme .owl-nav .owl-next,.mec-slider-t2-wrap .mec-owl-theme .owl-nav .owl-prev{opacity:1;width:44px;height:44px;line-height:38px;border-radius:0;text-align:center;background:0 0;border:1px solid #fff;transition:all .25s ease;-webkit-transition:all .25s ease;position:absolute;top:84px;cursor:pointer}.mec-slider-t2-wrap .mec-owl-theme .owl-nav .owl-next:hover,.mec-slider-t2-wrap .mec-owl-theme .owl-nav .owl-prev:hover{box-shadow:0 4px 16px 0 rgba(0,0,0,.075);background:#fff}.mec-slider-t2-wrap .mec-owl-theme .owl-nav .owl-next{right:30px}.mec-slider-t2-wrap .mec-owl-theme .owl-nav .owl-prev{right:82px}.mec-slider-t2-wrap .mec-owl-theme .owl-nav .owl-next i,.mec-slider-t2-wrap .mec-owl-theme .owl-nav .owl-prev i{font-size:14px;color:#fff;opacity:1;transition:all .25s ease}.mec-slider-t2-wrap .mec-owl-theme .owl-nav .owl-next:hover i,.mec-slider-t2-wrap .mec-owl-theme .owl-nav .owl-prev:hover i{color:#000;cursor:pointer}.mec-wrap.colorskin-custom .mec-slider-t2 .mec-event-article .mec-event-date.mec-color{color:#fff}@media only screen and (min-width:961px){.mec-slider-t2{margin:0 auto;max-width:1200px}}@media only screen and (max-width:960px){.mec-slider-t2 .mec-slider-t2-content,.mec-slider-t2 .mec-slider-t2-img{width:100%;float:none;position:static}.mec-slider-t2 .mec-slider-t2-img{height:300px}.mec-slider-t2 .mec-event-article{height:auto}.mec-slider-t2-wrap .mec-owl-theme .owl-nav .owl-next,.mec-slider-t2-wrap .mec-owl-theme .owl-nav .owl-prev{top:40px}}@media only screen and (max-width:479px){.mec-slider-t2-content.mec-event-grid-modern .mec-event-title{font-size:22px}}.mec-slider-t3-wrap{width:100%;padding:0;background:#161616;min-height:700px;position:relative}.mec-slider-t3 .mec-event-article{height:700px;position:relative;border:none;padding:0;margin:0;box-shadow:none;background:0 0}.mec-slider-t3 .mec-slider-t3-img{position:absolute;left:0;top:0;background-size:cover!important;background-position:center!important;width:100%;height:100%;margin:0;overflow:hidden;opacity:.68;z-index:1}.mec-slider-t3 .mec-slider-t3-content{width:50%;height:auto;vertical-align:middle;display:table;position:absolute;left:0;top:50%;transform:translateY(-50%);bottom:0;padding:0 2% 0 7%;margin:auto 0;background:0 0;z-index:2}.mec-slider-t3 .mec-slider-t3-content.mec-event-grid-modern :not(.mec-color){color:#fff}.mec-slider-t3-content.mec-event-grid-modern .mec-event-title{font-size:29px}.mec-slider-t3-content.mec-event-grid-modern .mec-event-content,.mec-slider-t3-content.mec-event-grid-modern .mec-event-footer .mec-booking-button{background:0 0}.mec-slider-t3-content.mec-event-grid-modern .mec-booking-button{display:inline-block;border:1px solid;font-weight:500;letter-spacing:1px;text-transform:uppercase;font-size:13px;padding:0 42px;line-height:49px;height:50px;transition:all .21s ease}.mec-slider-t3-content.mec-event-grid-modern .mec-booking-button:hover{background:#fff;color:#000;border-color:#fff}.mec-slider-t3-content.mec-event-grid-modern .mec-slider-t3-footer{text-align:left;padding:15px 15px 10px}.mec-slider-t3-content.mec-event-grid-modern .mec-event-footer .mec-booking-button:hover,.mec-slider-t3-content.mec-event-grid-modern .mec-event-title a:hover{color:#40d9f1}.mec-slider-t3-content.mec-event-grid-modern .mec-event-footer .mec-booking-button:hover{border-color:#40d9f1}.mec-slider-t3-wrap .mec-owl-theme .owl-nav .owl-next,.mec-slider-t3-wrap .mec-owl-theme .owl-nav .owl-prev{opacity:1;width:44px;height:44px;line-height:38px;border-radius:0;text-align:center;background:0 0;border:1px solid #fff;transition:all .25s ease;-webkit-transition:all .25s ease;position:absolute;top:50%;margin-top:-22px;cursor:pointer}.mec-slider-t3-wrap .mec-owl-theme .owl-nav .owl-next:hover,.mec-slider-t3-wrap .mec-owl-theme .owl-nav .owl-prev:hover{box-shadow:0 4px 16px 0 rgba(0,0,0,.075);background:#fff}.mec-slider-t3-wrap .mec-owl-theme .owl-nav .owl-next{right:10px}.mec-slider-t3-wrap .mec-owl-theme .owl-nav .owl-prev{right:auto;left:10px}.mec-slider-t3-wrap .mec-owl-theme .owl-nav .owl-next i,.mec-slider-t3-wrap .mec-owl-theme .owl-nav .owl-prev i{font-size:14px;color:#fff;opacity:1;transition:all .25s ease}.mec-slider-t3-wrap .mec-owl-theme .owl-nav .owl-next:hover i,.mec-slider-t3-wrap .mec-owl-theme .owl-nav .owl-prev:hover i{color:#000;cursor:pointer}@media only screen and (min-width:961px){.mec-slider-t3-content.mec-event-grid-modern .mec-event-title{font-size:50px;font-weight:300}.mec-slider-t3-content.mec-event-grid-modern .mec-event-description{font-size:19px}}.mec-event-description{line-height:1.7}@media only screen and (max-width:767px){.mec-slider-t3-wrap .mec-owl-theme .owl-nav .owl-next,.mec-slider-t3-wrap .mec-owl-theme .owl-nav .owl-prev{top:40px;margin-top:0}}@media only screen and (max-width:479px){.mec-slider-t3 .mec-slider-t3-content{width:100%}.mec-slider-t3-content.mec-event-grid-modern .mec-event-title{font-size:22px}.mec-slider-t1-content.mec-event-grid-modern .event-grid-modern-head .mec-event-day{font-size:25px}}.mec-slider-t4-wrap{width:100%;padding:0;background:#161616;min-height:700px;position:relative}.mec-slider-t4 .mec-event-article{height:700px;border:none;padding:0;margin:0;box-shadow:none;background:0 0}.mec-slider-t4 .mec-slider-t4-img{position:absolute;left:0;top:0;background-size:cover!important;background-position:center!important;width:100%;height:100%;margin:0;overflow:hidden;z-index:1}.mec-slider-t4 .mec-slider-t4-content{width:auto;max-width:700px;background:rgba(37,37,37,.94)!important;height:auto;vertical-align:middle;display:table;position:absolute;left:8%;top:19%;padding:3%;margin:auto 0;background:0 0;z-index:2}.mec-slider-t4 .mec-slider-t4-content.mec-event-grid-modern :not(.mec-color){color:#fff}.mec-slider-t4-content.mec-event-grid-modern .mec-event-title{font-size:29px}.mec-slider-t4-content.mec-event-grid-modern .mec-event-content,.mec-slider-t4-content.mec-event-grid-modern .mec-event-footer .mec-booking-button{background:0 0}.mec-slider-t4-content.mec-event-grid-modern .mec-event-footer .mec-booking-button{font-size:13px;padding:0 42px;line-height:49px;height:50px}.mec-slider-t4-content.mec-event-grid-modern .mec-event-title a:hover{color:#40d9f1}.mec-slider-t4-content.mec-event-grid-modern .mec-slider-t4-footer{text-align:left;padding:15px 15px 10px}.mec-slider-t4-content.mec-event-grid-modern .mec-booking-button{display:inline-block;border:1px solid;font-weight:500;letter-spacing:1px;text-transform:uppercase;font-size:13px;padding:0 42px;line-height:49px;height:50px;transition:all .21s ease}.mec-slider-t4-content.mec-event-grid-modern .mec-booking-button:hover{background:#fff;color:#000;border-color:#fff}.mec-slider-t4-content.mec-event-grid-modern .mec-event-footer .mec-booking-button:hover,.mec-slider-t4-content.mec-event-grid-modern .mec-event-title a:hover{color:#111}.mec-slider-t4-wrap .mec-owl-theme .owl-nav .owl-next,.mec-slider-t4-wrap .mec-owl-theme .owl-nav .owl-prev{opacity:1;width:44px;height:44px;line-height:40px;border-radius:0;text-align:center;background:0 0;border:1px solid #fff;transition:all .25s ease;-webkit-transition:all .25s ease;position:absolute;top:34px;cursor:pointer}.mec-slider-t4-wrap .mec-owl-theme .owl-nav .owl-next:hover,.mec-slider-t4-wrap .mec-owl-theme .owl-nav .owl-prev:hover{box-shadow:0 4px 16px 0 rgba(0,0,0,.075);background:#fff}.mec-slider-t4-wrap .mec-owl-theme .owl-nav .owl-next{right:60px}.mec-slider-t4-wrap .mec-owl-theme .owl-nav .owl-prev{right:112px}.mec-slider-t4-wrap .mec-owl-theme .owl-nav .owl-next i,.mec-slider-t4-wrap .mec-owl-theme .owl-nav .owl-prev i{font-size:14px;color:#fff;opacity:1;transition:all .25s ease}.mec-slider-t4-wrap .mec-owl-theme .owl-nav .owl-next:hover i,.mec-slider-t4-wrap .mec-owl-theme .owl-nav .owl-prev:hover i{color:#000;cursor:pointer}@media only screen and (max-width:767px){.mec-slider-t4 .mec-slider-t4-content{width:100%;left:0;top:auto;bottom:0}.mec-slider-t4-content.mec-event-grid-modern .mec-event-title{font-size:22px}.mec-slider-t1-content.mec-event-grid-modern .event-grid-modern-head .mec-event-day{font-size:25px}}.mec-slider-t5-wrap{width:auto;max-width:570px;padding:0;margin:0 auto 25px;background:#f7f7f7;min-height:480px;position:relative}.mec-slider-t5{height:auto;box-shadow:0 5px 35px 0 rgba(0,0,0,.13)}.mec-slider-t5 .mec-event-article{position:relative;height:auto}.mec-slider-t5 .mec-slider-t5-img{position:relative;background-size:cover!important;background-position:center!important;width:100%;height:300px;float:none;margin:0;overflow:hidden}.mec-slider-t5 .mec-slider-t5-content{width:100%;float:none;height:100%;background:#fff;padding:0 20px 20px;margin-bottom:0}.mec-slider-t5 .mec-events-content p{margin-bottom:20px}.mec-slider-t5-content.mec-event-grid-modern .mec-event-article{border:none;padding:0;margin:0;box-shadow:none}.mec-slider-t5-wrap .mec-event-grid-modern .event-grid-modern-head{margin-bottom:10px;padding:14px 34px;margin-left:-20px;margin-right:-20px;text-align:left;background:#f9f9f9;border-bottom:1px solid #eee}.mec-slider-t5-content.mec-event-grid-modern .mec-event-title{font-size:29px}.mec-slider-t5 .mec-slider-t5-col6{width:50%;float:left;height:100%}.mec-slider-t5 .mec-slider-t5-col6 i{font-size:42px;float:left;margin-right:7px;height:58px}.mec-slider-t5 .mec-slider-t5-col6 h6{text-transform:uppercase;font-size:17px;padding:4px 0;display:inline;color:#444}.mec-slider-t5 .mec-slider-t5-col6 address{font-size:12px;margin-bottom:0}.mec-slider-t5-content.mec-event-grid-modern .mec-event-title a:hover{text-decoration:underline}.mec-slider-t5-content.mec-event-grid-modern .mec-event-footer .mec-booking-button{font-size:12px;padding:0 31px;line-height:49px;height:50px;top:0}.mec-slider-t5-wrap .mec-owl-theme .owl-nav .owl-next,.mec-slider-t5-wrap .mec-owl-theme .owl-nav .owl-prev{opacity:1;width:44px;height:44px;line-height:40px;border-radius:0;text-align:center;background:0 0;border:1px solid #fff;transition:all .25s ease;-webkit-transition:all .25s ease;position:absolute;top:34px;cursor:pointer}.mec-slider-t5-wrap .mec-owl-theme .owl-nav .owl-next:hover,.mec-slider-t5-wrap .mec-owl-theme .owl-nav .owl-prev:hover{box-shadow:0 4px 16px 0 rgba(0,0,0,.075);background:#fff}.mec-slider-t5-wrap .mec-owl-theme .owl-nav .owl-next{right:30px}.mec-slider-t5-wrap .mec-owl-theme .owl-nav .owl-prev{right:82px}.mec-slider-t5-wrap .mec-owl-theme .owl-nav .owl-next i,.mec-slider-t5-wrap .mec-owl-theme .owl-nav .owl-prev i{font-size:14px;color:#fff;opacity:1;transition:all .25s ease}.mec-slider-t5-wrap .mec-owl-theme .owl-nav .owl-next:hover i,.mec-slider-t5-wrap .mec-owl-theme .owl-nav .owl-prev:hover i{color:#000;cursor:pointer}@media only screen and (max-width:768px){.mec-slider-t5 .mec-slider-t5-col6{width:100%;margin:10px 0}}@media only screen and (max-width:479px){.mec-slider-t5-content.mec-event-grid-modern .mec-event-title{font-size:24px}}.mec-single-modern .mec-events-event-image{text-align:center}.mec-single-modern .mec-events-event-image img{width:100%}.mec-single-modern .mec-single-event-bar{margin:20px 0 0;padding:15px;display:table;width:100%;background:#fff;border:1px solid #e6e6e6}.mec-single-modern .mec-single-event-bar>div{display:table-cell}.mec-single-modern .mec-single-event-bar>div i{font-size:20px;vertical-align:middle}.mec-single-modern .mec-single-event-bar>div .mec-time-comment{font-size:12px;color:#999}.mec-single-modern .mec-single-event-bar>div h3{text-transform:uppercase;font-size:16px;font-weight:700;padding-bottom:5px;display:inline;color:#000;padding-left:10px}.mec-single-modern .mec-single-event-bar>div dd{font-size:14px;color:#8d8d8d;padding-left:34px;margin-bottom:0}.mec-single-modern .col-md-4 .mec-frontbox,.mec-single-modern .col-md-4 .mec-sponsors-details{margin-top:-50px;margin-bottom:70px;padding:20px;border:1px solid #e6e6e6;box-shadow:none}.mec-single-modern .col-md-4.mec-no-image .mec-frontbox{margin-top:20px}.mec-next-occurrence ul{padding-left:0;margin-left:0}.mec-next-occurrence li{list-style:none}@media only screen and (min-width:960px){.mec-single-modern .col-md-4 .mec-frontbox,.mec-single-modern .col-md-4 .mec-sponsors-details{margin-left:20px}.featherlight-content .col-md-4 .mec-sponsors-details{margin-left:0;margin-bottom:15px}}@media only screen and (max-width:960px){.mec-single-modern .mec-single-event-bar>div{display:block}}.lity-content>div{overflow:auto;max-height:80vh!important}.mec-next-event-details li{list-style:none;margin-top:20px}.mec-next-event-details h6{text-transform:uppercase;font-size:13px;padding-bottom:5px;display:inline;color:#222;padding-left:0}.mec-next-event-details abbr{display:block;padding-left:0;color:#8d8d8d}.mec-next-event-details i{margin-right:10px;margin-left:12px}.mec-next-event-details i:before{color:#40d9f1}.mec-next-event-details a{text-align:center;display:block;background:#fff;padding:6px 0;font-size:11px;font-weight:400;letter-spacing:0;border:1px solid #e3e3e3;transition:.3s}.mec-active-occurrence-button{margin-top:20px}.mec-single-modal.mec-single-modern .mec-single-title{text-align:center;padding:15px 10px 0}.admin-bar .mec-single-modal.mec-single-modern .mec-single-title{padding-top:40px}.mec-single-modal.mec-single-modern .mec-single-event-bar{width:calc(100% - 30px);margin:0 auto 15px;padding:5px}.mec-single-modal.mec-single-modern .mec-events-event-image{width:calc(100% - 30px);margin:0 auto}.mec-single-modal.mec-single-modern .mec-single-event-bar>div dd{font-size:13px}.mec-single-modal.mec-single-modern .mec-single-event-bar>div h3{font-size:15px}@media only screen and (min-width:960px){.mec-single-modal.mec-single-modern .col-md-4 .mec-frontbox{margin-left:0}}.mec-single-modal.mec-single-modern .col-md-4 .mec-frontbox{margin-top:10px;margin-bottom:10px}.mec-single-modal.mec-single-modern .col-md-4 .mec-frontbox.mec-event-meta{padding:0}@media (min-width:961px){.mec-single-event.mec-sticky{position:relative}.mec-single-event.mec-sticky .col-md-4{position:-webkit-sticky;position:sticky;top:120px}.mec-single-modern.mec-sticky .col-md-4{top:170px}.single-mec-events .mec-sticky .col-md-8>div:last-child{margin-bottom:30px}.single-mec-events .mec-single-modern.mec-sticky .col-md-8>div:last-child{margin-bottom:70px}}.mec-single-modal .mec-event-meta dd.mec-organizer-email a,.mec-single-modal .mec-event-meta dd.mec-organizer-url a{font-size:12px;display:block}.mec-organizer-description p{padding-left:12px}.mec-modal-wrap{max-width:90vw;max-height:90vh!important;background:#fff;box-shadow:0 1px 55px rgba(0,0,0,.5);overflow-x:hidden!important}@media (max-width:1023px){.mec-modal-wrap{max-width:80vw}}.mec-single-modal .mec-event-export-module.mec-frontbox .mec-event-exporting .mec-export-details ul li,.mec-single-modal .mec-event-export-module.mec-frontbox .mec-event-exporting .mec-export-details ul li a.mec-events-button{display:block;text-align:center}.mec-single-modal .mec-event-export-module.mec-frontbox .mec-event-exporting .mec-export-details ul li:first-child{margin-bottom:20px}.mec-holding-status-expired{color:#d8000c}.mec-holding-status-ongoing{color:#0dbf52}body .featherlight{z-index:999999!important}body .featherlight .featherlight-content{background:0 0;overflow:unset;z-index:9999}body .featherlight .featherlight-close-icon{position:fixed;top:40px;right:40px;background:0 0;color:#fff;border:1px solid #fff;border-radius:0}body .featherlight .featherlight-close-icon:hover{background:#fff;color:#000;border:1px solid #000}@media (max-width:320px){.mec-wrap span.flip-clock-divider{width:20px}.mec-single-event .mec-events-meta-group-countdown{padding:15px 12%}}@media only screen and (min-width:320px) and (max-width:767px){.mec-wrap .flip-clock-wrapper ul{padding:0}}@media (max-width:414px){.mec-wrap span.flip-clock-divider{width:30px}.mec-single-event .mec-events-meta-group-countdown{margin-left:0;padding:15px 7%}}@media (max-width:480px){body .featherlight .featherlight-content{width:95%}.mec-wrap span.flip-clock-divider{width:7px}.mec-single-event .mec-events-meta-group-countdown{margin-left:0;padding:15px 1%}body .featherlight .featherlight-close-icon{color:#000;border-color:#000}}@media (max-width:1366px){body .mec-modal-wrap .mec-single-modal .flip-clock-divider:not(:first-child){width:20px!important}body .mec-modal-wrap .mec-single-modal .mec-events-meta-group-countdown{padding:20px 15px}body .mec-modal-wrap .mec-single-modal .flip-clock-wrapper ul{width:48px}}@media (max-width:1280px){body .mec-modal-wrap .mec-single-modal .flip-clock-divider:not(:first-child){width:14px!important}body .mec-modal-wrap .mec-single-modal .mec-events-meta-group-countdown{padding:15px 10px}body .mec-modal-wrap .mec-single-modal .flip-clock-wrapper ul{width:38px}}@media (min-width:961px) and (max-width:1024px){body .mec-modal-wrap .mec-single-modal .flip-clock-divider:not(:first-child){width:7px!important}body .mec-modal-wrap .mec-single-modal .mec-events-meta-group-countdown{padding:15px 5px}body .mec-modal-wrap .mec-single-modal .flip-clock-wrapper ul{width:14px}body .mec-modal-wrap .mec-single-modal .flip-clock-wrapper ul li a div{font-size:30px}}@media (max-width:640px){body .mec-modal-wrap .mec-single-modal.featherlight-close-icon{top:14px;right:14px}}@media (max-width:480px){.featherlight .featherlight-content,body .mec-modal-wrap{max-width:100%}body .mec-modal-wrap.flip-clock-divider .flip-clock-label{display:block}}@media (max-width:414px){body .mec-modal-wrap .mec-single-modal .flip-clock-divider:not(:first-child){width:50px!important}.mec-wrap .flip-clock-divider .flip-clock-label{display:none}body .mec-modal-wrap .mec-single-modal .mec-events-meta-group-countdown{padding:20px 5px 20px 65px}body .featherlight-content .mec-modal-wrap .mec-single-modal .mec-events-meta-group-countdown{padding:20px 2px 20px 2px!important}body .featherlight-content .mec-modal-wrap .mec-single-modal .flip-clock-divider:not(:first-child){width:3px!important}}@media (max-width:375px){body .mec-modal-wrap .mec-single-modal .flip-clock-divider:not(:first-child){width:50px!important}.mec-wrap .flip-clock-divider .flip-clock-label{display:none}body .mec-modal-wrap .mec-single-modal .mec-events-meta-group-countdown{padding:20px 5px 20px 45px}}@media (max-width:320px){body .mec-modal-wrap .mec-single-modal .flip-clock-divider:not(:first-child){width:20px!important}body .mec-modal-wrap .mec-single-modal .mec-events-meta-group-countdown{padding:20px 5px 20px 40px}}.mec-single-event-bar dd{margin-left:0}.mec-events-toggle{max-width:960px;margin-left:auto;margin-right:auto}.mec-events-toggle .mec-toggle-item{border:1px solid #e4e4e4;margin-bottom:15px;box-shadow:0 10px 15px #f3f3f3}.mec-events-toggle .mec-toggle-item-inner{cursor:pointer;position:relative;padding:30px 60px 30px 15px;background:#fff;transition:all .3s ease;min-height:100px;display:table;width:100%;border-collapse:separate}.mec-events-toggle .mec-toggle-item-inner:hover{background:#fbfbfb}.mec-toggle-item-col{width:200px;border-right:1px solid #e3e3e3;margin-right:15px;display:table-cell;padding-right:5px}.mec-toggle-item-col .mec-event-date{font-size:38px;line-height:40px;float:left;margin-right:8px}.mec-toggle-item-col .mec-event-month,.mec-toggle-item-col .mec-time-details{text-transform:uppercase;font-size:12px;line-height:14px;padding-top:4px;font-weight:700}.mec-toggle-item-col .mec-event-detail{font-size:10px}.mec-toggle-item-col .mec-event-day{margin-top:9px;color:silver;font-size:35px;font-weight:100;text-transform:uppercase;letter-spacing:-1px}.mec-events-toggle .mec-toggle-title{color:#000;font-size:23px;font-weight:600;margin-bottom:0;transition:all .3s ease;display:table-cell;text-align:left;max-width:calc(100% - 200px);padding-left:15px;vertical-align:middle}.mec-events-toggle .mec-toggle-item-inner span.event-color{width:5px;height:100%;position:absolute;left:-1px;top:0;bottom:0;border-radius:0;margin:0}.mec-events-toggle .mec-toggle-item-inner i{position:absolute;font-size:30px;right:25px;top:50%;transform:translate(0,-50%);cursor:pointer}.mec-events-toggle .mec-toggle-item.is-open i.mec-sl-plus:before{content:"\e615"}.mec-events-toggle .mec-toggle-item.is-open .mec-toggle-title{background:#f8f8f8;cursor:pointer}.mec-events-toggle .mec-toggle-content{border-top:1px solid #e4e4e4}.mec-events-toggle .mec-toggle-content .mec-modal-wrap{margin:0;max-width:100%;box-shadow:none}.mec-events-toggle .mec-toggle-content .mec-modal-wrap .mec-single-event{margin:0}.mec-events-toggle .mec-toggle-content .mec-single-event-bar,.mec-events-toggle .mec-toggle-content h1.mec-single-title{display:none}.mec-events-toggle .media-links a{margin-bottom:0}.mec-events-toggle .mec-toggle-content .mec-toggle-meta{margin-bottom:14px}.mec-events-toggle .mec-toggle-content .mec-frontbox{padding:12px 14px 8px}.mec-events-toggle .mec-toggle-content .mec-frontbox .mec-speakers-details{border:none}.mec-events-toggle .mec-toggle-content .mec-frontbox .mec-speakers-details ul{padding-left:0}.mec-events-toggle #mec_speakers_details.mec-frontbox{padding:0;margin:0}.mec-events-toggle .mec-toggle-item h3.mec-speakers{border:none;text-align:left;margin-bottom:20px}.mec-events-toggle .mec-toggle-item h3.mec-speakers:before{content:"\e063";font-family:simple-line-icons;border:none;position:relative;display:inline-block;left:3px;bottom:unset;font-size:22px;font-weight:400;padding:0 11px 0 28px;vertical-align:middle}.mec-events-toggle .mec-event-data-fields.mec-frontbox{border:none;padding:0;overflow:visible}@media only screen and (max-width:767px){.mec-toggle-item-inner .mec-toggle-item-col{float:none;width:100%;border-right:none;margin-bottom:5px;display:block;max-width:100%;padding-left:15px}.mec-events-toggle .mec-toggle-title{display:block;width:100%;max-width:100%}}.mec-events-agenda-wrap{margin:10px 0;border:1px solid #e9e9e9;background:#fff;padding-left:20px;box-shadow:0 2px 2px rgba(0,0,0,.03)}.mec-events-agenda{padding:0;border-bottom:1px solid #e9e9e9}.mec-agenda-date-wrap{width:210px;padding-top:15px;float:left;font-size:13px}.mec-agenda-date-wrap i,.mec-agenda-event i{font-size:11px;color:#aaa;margin-right:4px;margin-left:1px}.mec-agenda-event i{vertical-align:middle;margin-right:1px}.mec-agenda-events-wrap{float:left;width:calc(100% - 210px);background:#f9f9f9;padding:15px}.mec-agenda-event{margin-bottom:10px}.mec-agenda-time{font-size:11px;color:#707070;padding-right:10px;width:138px;display:inline-block}.mec-agenda-event-title{position:relative;padding-left:14px}.mec-agenda-event-title a{font-size:14px;font-weight:600;color:#333}.mec-agenda-event-title span.event-color{width:9px;height:9px;position:absolute;left:0;top:6px;margin:0}.mec-agenda-date-wrap span.mec-agenda-day{color:#aaa;font-size:12px}@media only screen and (max-width:767px){.mec-agenda-date-wrap,.mec-agenda-events-wrap{float:none;width:100%}.mec-events-agenda-wrap{padding-left:0}.mec-events-agenda span.mec-agenda-event-title{display:block;width:100%}.mec-agenda-event-title span.event-color{top:7px}.mec-agenda-event-title a{font-size:13px}}.mec-yearly-view-wrap{margin:0 0 15px;border:1px solid #e6e6e6;background:#fff;box-shadow:0 2px 4px rgba(0,0,0,.04);border-bottom-width:4px}.mec-yearly-view-wrap .mec-calendar.mec-yearly-calendar{max-width:100%;width:232px;padding:10px;background:#fff;margin:10px;display:inline-block}.mec-yearly-view-wrap .mec-calendar.mec-yearly-calendar dl dt{transition:none;height:30px;width:30px;line-height:30px;border-radius:0;font-size:12px}.mec-yearly-view-wrap .mec-calendar.mec-yearly-calendar .mec-calendar-events-sec{padding:10px}.mec-yearly-view-wrap .mec-calendar.mec-yearly-calendar .mec-has-event:after{width:4px;height:4px;bottom:3px;margin-left:-2px}.mec-yearly-view-wrap .mec-calendar-side .mec-calendar-table{min-height:200px}.mec-calendar.mec-yearly-calendar .mec-calendar-table-head dl dt{background:#f9f9f9;font-size:13px}.mec-calendar.mec-yearly-calendar .mec-calendar-table-title{text-align:center;font-size:15px;font-weight:700;color:#222;margin-top:-5px;padding-bottom:5px}.mec-yearly-view-wrap .mec-yearly-calendar-sec{min-height:200px;width:538px;overflow:hidden;float:left;background:#f8f8f8;padding:15px}.mec-yearly-view-wrap .mec-yearly-agenda-sec{min-height:200px;width:calc(100% - 538px);float:left;padding:0 0 0 20px;overflow:hidden}.mec-yearly-view-wrap .mec-yearly-title-sec{position:relative;padding:15px;text-align:center;border-bottom:1px solid #e6e6e6;box-shadow:0 1px 3px rgba(0,0,0,.02)}.mec-yearly-view-wrap .mec-yearly-title-sec h2{font-size:30px;line-height:40px;color:#333;margin:0;font-weight:700}.mec-yearly-view-wrap .mec-yearly-title-sec .mec-next-year,.mec-yearly-view-wrap .mec-yearly-title-sec .mec-previous-year{position:absolute;top:50%;margin-top:-15px;min-width:30px;height:30px;line-height:30px;padding:0 8px;text-align:center;background:#fff;color:#666;font-size:14px;border:1px solid #eee;border-radius:2px;box-shadow:0 2px 0 0 rgba(0,0,0,.015);transition:all .33s ease;cursor:pointer}.mec-yearly-view-wrap .mec-yearly-title-sec .mec-previous-year{right:auto;left:20px;padding-right:14px}.mec-yearly-view-wrap .mec-yearly-title-sec .mec-next-year{left:auto;right:20px;padding-left:14px}.mec-yearly-view-wrap .mec-yearly-title-sec .mec-next-year i,.mec-yearly-view-wrap .mec-yearly-title-sec .mec-previous-year i{font-size:12px;color:#40d9f1;cursor:pointer}.mec-yearly-view-wrap .mec-events-agenda.mec-selected{box-shadow:-10px 0 0 0 #fffcf2,0 -1px 0 #fbebb6;background:#fffcf2;border-color:#fbebb6;color:#f9af29}.mec-yearly-agenda-sec span.mec-event-label-captions.mec-fc-style{right:0;top:0}@media only screen and (max-width:959px){.mec-yearly-view-wrap .mec-yearly-calendar-sec{width:268px;padding:10px 5px}.mec-yearly-view-wrap .mec-yearly-agenda-sec{width:calc(100% - 268px);padding:0 0 0 10px}}@media only screen and (max-width:767px){.mec-yearly-view-wrap .mec-yearly-agenda-sec,.mec-yearly-view-wrap .mec-yearly-calendar-sec{width:100%;float:none}.mec-yearly-view-wrap .mec-calendar.mec-yearly-calendar{width:auto}.mec-yearly-view-wrap .mec-calendar.mec-yearly-calendar dl dt{width:14.2%}.mec-yearly-view-wrap .mec-yearly-title-sec h2{font-size:25px}}.mec-yearly-view-wrap .mec-agenda-event i,.mec-yearly-view-wrap .mec-agenda-time{display:none}@media only screen and (min-width:768px){.mec-yearly-view-wrap .mec-events-agenda-wrap{margin-top:0;border:none;padding-left:0;box-shadow:none}.mec-yearly-view-wrap .mec-agenda-date-wrap{width:174px;font-size:11px;padding-top:10px}.mec-yearly-view-wrap .mec-agenda-events-wrap{width:calc(100% - 174px);padding:10px}.mec-yearly-view-wrap .mec-agenda-event-title a{font-size:13px}.mec-yearly-view-wrap .mec-agenda-event-title span.event-color{width:8px;height:8px}.mec-yearly-view-wrap .mec-agenda-date-wrap span.mec-agenda-day{font-size:11px}.mec-yearly-view-wrap .mec-yearly-calendar-sec{box-shadow:-2px 0 5px rgba(0,0,0,.03) inset}}@media only screen and (max-width:1200px){.mec-yearly-view-wrap .mec-agenda-event-title a{font-size:12px;padding-right:6px}}.mec-calendar.mec-calendar-timetable .mec-calendar-d-table{padding-bottom:10px;border-bottom:none}.mec-calendar.mec-calendar-timetable .mec-calendar-d-table dl dt:hover{cursor:pointer}.mec-calendar.mec-calendar-timetable .mec-calendar-d-table dl dt.mec-timetable-has-no-event,.mec-calendar.mec-calendar-timetable .mec-calendar-d-table dl dt.mec-timetable-has-no-event:hover{color:#bbb;cursor:default}.mec-calendar.mec-calendar-timetable .mec-calendar-d-table dl dt.mec-timetable-day-active{background:#40d9f1;color:#fff;position:relative}.mec-calendar.mec-calendar-timetable .mec-calendar-d-table dl dt.mec-timetable-day-active:after{content:"";position:absolute;display:block;bottom:-20px;left:50%;margin-left:-10px;width:0;border-width:10px;border-style:solid;border-color:#40d9f1 transparent transparent transparent}.mec-week-events-container{background:#fff}.mec-timetable-events-list{padding:10px 20px;border:none;margin:0}.mec-timetable-events-list .mec-timetable-event{padding:10px 0;border-bottom:1px dashed #ddd}.mec-timetable-events-list .mec-timetable-event:last-child{border:none}.mec-timetable-event .mec-timetable-event-span{font-size:12px;color:#444;padding-right:30px;line-height:22px}.mec-timetable-events-list .mec-timetable-event i{font-size:13px;color:#aaa;margin-right:3px;vertical-align:baseline}.mec-timetable-event .mec-timetable-event-span a{color:#333}.mec-timetable-event .mec-timetable-event-time{font-size:11px}.mec-timetable-event .mec-timetable-event-time i{vertical-align:text-bottom}.mec-timetable-event .mec-timetable-event-title{font-size:13px}.mec-timetable-event .mec-timetable-event-title .event-color{width:10px;height:10px}.mec-timetable-events-list .mec-timetable-event.mec-util-hidden{display:none}.mec-timetable-events-list.mec-util-hidden{display:none}@media only screen and (min-width:768px){.mec-timetable-events-list{display:table;width:100%;margin:10px 0 20px}.mec-timetable-events-list .mec-timetable-event{display:table-row;padding:0;border:none;background:#fff}.mec-timetable-events-list .mec-timetable-event:hover{background:#fafafa}.mec-timetable-event .mec-timetable-event-span{display:table-cell;padding:10px 15px;border-bottom:1px solid #ebebeb}.mec-timetable-events-list .mec-timetable-event:last-child .mec-timetable-event-span{border-bottom:none}}@media only screen and (max-width:767px){.mec-timetable-event .mec-timetable-event-title{display:block;width:100%;padding:5px 0 10px;font-weight:700}}.mec-timetable-t2-wrap{border:1px solid #e6e6e6;background:#fafafa;padding:0 15px 15px;overflow:hidden;box-shadow:0 3px 2px 0 rgba(0,0,0,.012)}.mec-timetable-t2-col{width:20%;float:left;min-height:20px;padding-right:1px;background:0 0}.mec-ttt2-title{background:#fafafa;color:#333;font-size:13px;font-weight:600;text-transform:uppercase;letter-spacing:1px;text-align:center;padding:25px 10px 10px;margin-bottom:1px}.mec-timetable-t2-col .mec-event-article{position:relative}.mec-timetable-t2-col .mec-event-article .event-color{position:absolute;width:auto;height:auto;left:0;right:0;top:0;bottom:0;margin:0;z-index:1;border-radius:2px}.mec-timetable-t2-content{position:relative;z-index:2;color:#fff;padding:15px 15px 20px;text-align:left;height:auto;margin-bottom:1px;overflow:hidden}.mec-timetable-t2-content .mec-event-title{line-height:22px;margin-bottom:13px;white-space:nowrap;padding-right:1px;overflow:hidden}.mec-timetable-t2-content .mec-event-title a{color:#fff;font-size:15px;font-weight:600;white-space:pre-line;overflow:hidden}.mec-timetable-t2-content div{color:#fff;font-size:11px;font-weight:400;line-height:19px;white-space:nowrap}.mec-timetable-t2-content div i{font-size:12px;margin-right:4px}@media only screen and (max-width:960px){.mec-timetable-t2-col{width:100%;float:none}}@media (min-width:961px){.mec-timetable-col-7{width:14.28%}.mec-timetable-col-6{width:16.6666%}}.mec-timetable-t3-wrap td{position:relative;padding:0}.mec-timetable-t3-wrap td a{width:100%;display:block;min-height:110px}.mec-weather-box{padding:15px 0}.mec-weather-head{min-height:90px;padding:5px 0;clear:both;overflow:hidden;margin-bottom:25px;border-radius:10px;background:#238af5;position:relative}.mec-weather-icon-box{float:left;width:80px;height:80px;border-radius:10px;overflow:hidden;background:#238af5}.mec-weather-icon{width:80px;height:80px;display:inline-block;border-radius:10px}.mec-weather-summary{float:left;width:calc(100% - 80px);padding-left:10px;margin:10px 0;height:60px}.mec-weather-summary-report{font-size:15px;color:rgba(255,255,255,.68);margin-bottom:6px}.mec-weather-summary-temp{font-weight:300;color:#fff;font-size:29px;line-height:1}.degrees-mode{background:rgba(0,0,0,.2);cursor:pointer;font-weight:300;font-size:18px;padding:4px 5px;line-height:1;color:#fff;position:absolute;border-radius:8px;bottom:16px;left:16px}.mec-weather-extras{width:auto;padding:10px 15px 0 15px;float:right;min-height:80px;color:#fff;font-size:13px;line-height:1}.mec-weather-extras{width:auto;padding:10px 15px 0 15px;float:right;min-height:80px;color:#fff;font-size:13px;line-height:1}.mec-weather-extras div{line-height:20px;height:20px}.mec-weather-extras span{color:rgba(255,255,255,.68);font-size:12px;text-transform:uppercase}.mec-weather-extras var{font-size:11px;letter-spacing:.4px}.mec-weather-icon.clear-day,.mec-weather-icon.clear-night{background-image:url(../img/mec-weather-icon-01.png)}.mec-weather-icon.partly-sunny-day,.mec-weather-icon.partly-sunny-night{background-image:url(../img/mec-weather-icon-02.png)}.mec-weather-icon.partly-cloudy-day,.mec-weather-icon.partly-cloudy-night{background-image:url(../img/mec-weather-icon-03.png)}.mec-weather-icon.cloudy,.mec-weather-icon.fog,.mec-weather-icon.wind{background-image:url(../img/mec-weather-icon-04.png)}.mec-weather-icon.thunderstorm{background-image:url(../img/mec-weather-icon-05.png)}.mec-weather-icon.rain{background-image:url(../img/mec-weather-icon-06.png)}.mec-weather-icon.hail,.mec-weather-icon.sleet,.mec-weather-icon.snow{background-image:url(../img/mec-weather-icon-07.png)}.mec-av-spot-wrap{width:auto;max-width:1200px;padding:0;margin:0 auto 25px;background:#f7f7f7;min-height:480px;position:relative}.mec-av-spot{height:auto;border:1px solid #eee;box-shadow:0 6px 12px -4px rgba(0,0,0,.05)}.mec-av-spot .mec-event-article{position:relative;height:auto}.mec-av-spot .mec-av-spot-img{position:relative;background-size:cover!important;background-position:center!important;width:100%;height:330px;float:none;margin:0;overflow:hidden}.mec-av-spot .mec-av-spot-content,.mec-av-spot .mec-av-spot-head{width:100%;float:none;height:100%;background:#fff;padding:0 20px 20px;margin-bottom:0}.mec-av-spot .mec-av-spot-head{background:#222;color:#fff;min-height:80px}.mec-av-spot .mec-av-spot-head .mec-av-spot-box{padding-top:25px;font-size:13px;color:#ddd}.mec-av-spot .mec-av-spot-head .mec-av-spot-box span{color:#40d9f1;font-size:40px;font-weight:700;font-style:italic}.mec-av-spot .mec-av-spot-head .mec-event-countdown{text-align:center;padding-top:10px;display:table;table-layout:fixed;margin:0 auto;float:right}.mec-av-spot .mec-av-spot-head .mec-event-countdown li{display:table-cell;padding:10px 20px;position:relative;height:60px}.mec-av-spot .mec-av-spot-head .mec-event-countdown p{margin-bottom:0}.mec-av-spot .mec-events-content p{margin-bottom:20px}.mec-av-spot-content.mec-event-grid-modern .mec-event-article{border:none;padding:0;margin:0;box-shadow:none}.mec-av-spot-wrap .mec-event-grid-modern .event-grid-modern-head{margin-bottom:10px;padding:14px 34px;margin-left:-20px;margin-right:-20px;text-align:left;background:#f9f9f9;border-bottom:1px solid #eee}.mec-av-spot-content.mec-event-grid-modern .mec-event-title{font-size:29px}.mec-av-spot .mec-av-spot-col6{width:50%;float:left;height:100%}.mec-av-spot .mec-av-spot-col6 i{font-size:42px;float:left;margin-right:7px;height:58px}.mec-av-spot .mec-av-spot-col6 h6{text-transform:uppercase;font-size:17px;padding:4px 0;display:inline;color:#444}.mec-av-spot .mec-av-spot-col6 address{font-size:12px;margin-bottom:0}.mec-av-spot-content.mec-event-grid-modern .mec-event-title a:hover{text-decoration:underline}.mec-av-spot-content.mec-event-grid-modern .mec-event-footer .mec-booking-button{font-size:12px;padding:0 31px;line-height:49px;height:50px;top:0;box-shadow:0 5px 11px -3px rgba(0,0,0,.05)}@media only screen and (max-width:768px){.mec-av-spot .mec-av-spot-col6{width:100%;margin:10px 0}}@media only screen and (max-width:479px){.mec-av-spot-content.mec-event-grid-modern .mec-event-title{font-size:24px}}.mec-events-masonry-wrap{display:block;width:auto}.mec-masonry-item-wrap{width:calc(33.33% - 30px);padding:0;margin:0 15px 30px;min-height:10px;position:relative;float:left}.mec-events-masonry-cats{padding:10px;margin-bottom:25px;text-align:center;clear:both;list-style:none outside none}.mec-events-masonry-cats a{border-radius:2px;padding:6px 12px;font-size:13px;line-height:1.2;color:#333;font-weight:400;margin-top:0!important;text-align:center;display:inline-block;width:auto;border:2px solid transparent;transition:all .2s ease}.mec-events-masonry-cats a:hover{border-color:#40d9f1;color:#333}.mec-events-masonry-cats a.mec-masonry-cat-selected{border:2px solid #40d9f1;color:#40d9f1}.mec-masonry{background:#f7f7f7;height:auto;border:1px solid #eee;box-shadow:0 6px 12px -4px rgba(0,0,0,.05)}.mec-masonry .mec-event-article{position:relative;height:auto}.mec-masonry .mec-masonry-img{position:relative;width:100%;height:auto;float:none;margin:0;overflow:hidden}.mec-masonry .mec-masonry-img img{width:100%}.mec-masonry .mec-masonry-content,.mec-masonry .mec-masonry-head{width:100%;float:none;height:100%;background:#fff;padding:0 20px 20px;margin-bottom:0}.mec-masonry .mec-events-content p{margin-bottom:20px}.mec-masonry-content.mec-event-grid-modern .mec-event-article{border:none;padding:0;margin:0;box-shadow:none}.mec-masonry-item-wrap .mec-event-grid-modern .event-grid-modern-head{min-height:79px;margin-bottom:10px;padding:14px 5%;margin-left:-20px;margin-right:-20px;text-align:left;background:#f9f9f9;border-bottom:1px solid #eee}.mec-masonry-content.mec-event-grid-modern .mec-event-title{font-size:22px}.mec-masonry-content.mec-event-grid-modern .mec-event-content{padding-top:20px}@media (max-width:480px){.mec-masonry-content.mec-event-grid-modern .mec-labels-normal{display:block}}.mec-masonry-content.mec-event-grid-modern .mec-event-footer{height:auto;display:flex;gap:10px}.mec-wrap .mec-event-masonry .mec-masonry-content.mec-event-grid-modern .mec-event-footer a{position:static;padding:0;flex:auto;text-align:center}.mec-masonry .mec-masonry-col6 .mec-event-date{font-size:52px;letter-spacing:-2px;line-height:41px;vertical-align:top}.mec-masonry .mec-masonry-col6{width:50%;float:left;height:100%}.mec-masonry .mec-masonry-col6 i{font-size:24px;float:left;margin-right:7px;height:50px}.mec-masonry .mec-masonry-col6 .mec-event-month,.mec-masonry .mec-masonry-col6 h6{text-transform:capitalize;font-size:15px;padding:4px 0;display:inline;color:#444}.mec-masonry .mec-masonry-col6 .mec-event-detail,.mec-masonry .mec-masonry-col6 address{font-size:11px;margin-bottom:0}.mec-masonry-content.mec-event-grid-modern .mec-event-title a:hover{text-decoration:underline}.mec-masonry-content.mec-event-grid-modern .mec-event-footer .mec-booking-button{font-size:12px;line-height:49px;height:50px;box-shadow:0 5px 11px -3px rgba(0,0,0,.05)}@media only screen and (max-width:960px){.mec-masonry-item-wrap{width:calc(50% - 30px)}}@media only screen and (max-width:768px){.mec-masonry .mec-masonry-col6{width:100%;margin:10px 0}.mec-masonry-item-wrap{width:calc(100% - 30px)}}@media only screen and (max-width:479px){.mec-masonry-content.mec-event-grid-modern .mec-event-title{font-size:24px}}.mec-wrap.mec-skin-masonry-container .mec-load-more-wrap{position:unset}.btn-wrapper{text-align:center}.countdown-wrapper .btn-wrapper{padding-top:10px;padding-right:0}.countdown-wrapper h5.countdown-message{letter-spacing:5px;font-weight:500;font-size:18px}.blox.dar .countdown-wrapper p,.countdown-wrapper p{color:#888}.countdown-wrapper a.button.black{float:right;margin-right:0}.mec-wrap .threedaydigits .days .flip-clock-label{right:-100px}@media only screen and (min-width:320px) and (max-width:767px){.mec-wrap .flip-clock-wrapper ul{width:29px!important}.mec-wrap .flip-clock-wrapper ul li a div div.inn{font-size:25px!important}.mec-wrap .flip-clock-divider .flip-clock-label{left:0;font-weight:300}.mec-wrap span.flip-clock-divider{width:12px}}@media only screen and (min-width:320px) and (max-width:480px){.mec-wrap .flip-clock-wrapper ul{width:29px!important}.mec-wrap .flip-clock-wrapper ul li a div div.inn{font-size:25px!important}.mec-wrap .flip-clock-divider .flip-clock-label{display:none}.mec-wrap span.flip-clock-divider:first-child{width:0}.mec-wrap span.flip-clock-divider{width:5px}.mec-single-event .mec-events-meta-group-countdown{margin-left:0;padding:15px 18%}}@media screen and (min-width:960px) and (max-width:1200px){.mec-wrap .threedaydigits ul{height:50px;width:47px}}@media screen and (min-width:480px) and (max-width:768px){.mec-wrap .threedaydigits ul{height:48px;width:26px!important}.mec-wrap .threedaydigits .flip-clock-label{font-size:8px;left:-8px}}@media screen and (min-width:320px) and (max-width:480px){.mec-wrap .threedaydigits ul{height:48px;width:22px!important}}.mec-wrap .flip-clock-wrapper *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;-ms-box-sizing:border-box;-o-box-sizing:border-box;box-sizing:border-box;-webkit-backface-visibility:hidden;-moz-backface-visibility:hidden;-ms-backface-visibility:hidden;-o-backface-visibility:hidden;backface-visibility:hidden}.mec-wrap .flip-clock-wrapper a{cursor:pointer;text-decoration:none;color:#ccc}.mec-wrap .flip-clock-wrapper a:hover{color:#fff}.mec-wrap .flip-clock-wrapper ul{list-style:none}.flip-clock-wrapper.clearfix:after,.mec-wrap .flip-clock-wrapper.clearfix:before{content:" ";display:table}.mec-wrap .flip-clock-wrapper.clearfix:after{clear:both}.mec-wrap .flip-clock-wrapper{font:normal 11px "helvetica neue",helvetica,sans-serif;-webkit-user-select:none}.mec-wrap .flip-clock-meridium{background:0 0!important;box-shadow:0 0 0!important;font-size:36px!important}.mec-wrap .flip-clock-meridium a{color:#313333}.mec-wrap .flip-clock-wrapper{text-align:center;position:relative;display:inline-block;padding-bottom:10px}.flip-clock-wrapper:after,.mec-wrap .flip-clock-wrapper:before{content:" ";display:table}.mec-wrap .flip-clock-wrapper:after{clear:both}.mec-wrap .flip-clock-wrapper ul{position:relative;float:left;margin:2px;width:50px;height:50px;font-size:80px;font-weight:700;line-height:87px;border-radius:3px;background:rgba(0,0,0,.21)}.mec-wrap .flip-clock-wrapper ul li{z-index:1;position:absolute;left:0;top:0;width:100%;height:100%;line-height:54px;text-decoration:none!important}.mec-wrap .flip-clock-wrapper ul li:first-child{z-index:2}.mec-wrap .flip-clock-wrapper ul li a{display:block;height:100%;-webkit-perspective:200px;-moz-perspective:200px;perspective:200px;margin:0!important;overflow:visible!important;cursor:default!important}.mec-wrap .flip-clock-wrapper ul li a div{z-index:1;position:absolute;left:0;width:100%;height:50%;font-size:80px;overflow:hidden;outline:1px solid transparent}.mec-wrap .flip-clock-wrapper ul li a div .shadow{position:absolute;width:100%;height:100%;z-index:2}.mec-wrap .flip-clock-wrapper ul li a div.up{-webkit-transform-origin:50% 100%;-moz-transform-origin:50% 100%;-ms-transform-origin:50% 100%;-o-transform-origin:50% 100%;transform-origin:50% 100%;top:0}.mec-wrap .flip-clock-wrapper ul li a div.up:after{content:"";position:absolute;top:24px;left:0;z-index:5;width:100%;height:3px;background-color:rgba(0,0,0,.12)}.mec-wrap .flip-clock-wrapper ul li a div.down{-webkit-transform-origin:50% 0;-moz-transform-origin:50% 0;-ms-transform-origin:50% 0;-o-transform-origin:50% 0;transform-origin:50% 0;bottom:0;border-bottom-left-radius:3px;border-bottom-right-radius:3px}.mec-wrap .flip-clock-wrapper ul li a div div.inn{position:absolute;left:0;z-index:1;width:100%;height:200%;color:#fff;text-shadow:0 0 2px rgba(0,0,0,.25);text-align:center;background-color:#40d9f1;border-radius:3px;font-size:48px}.mec-wrap .flip-clock-wrapper ul li a div.up div.inn{top:0}.mec-wrap .flip-clock-wrapper ul li a div.down div.inn{bottom:0}.mec-wrap .flip-clock-wrapper ul.play li.flip-clock-before{z-index:3}.mec-wrap .flip-clock-wrapper .flip{box-shadow:0 2px 5px rgba(0,0,0,.17)}.mec-wrap .flip-clock-wrapper ul.play li.flip-clock-active{-webkit-animation:asd .5s .5s linear both;-moz-animation:asd .5s .5s linear both;animation:asd .5s .5s linear both;z-index:5}.mec-wrap .flip-clock-divider{float:left;display:inline-block;position:relative;width:18px;height:62px}.mec-wrap .flip-clock-divider:first-child{width:0}.mec-wrap .flip-clock-dot{display:none;background:#323434;width:10px;height:10px;position:absolute;border-radius:50%;box-shadow:0 0 5px rgba(0,0,0,.5);left:5px}.mec-wrap .flip-clock-divider .flip-clock-label{position:absolute;bottom:-1.5em;right:-71px;color:#101010;font-weight:700;text-shadow:none;text-transform:uppercase}.mec-wrap .blox.dark .flip-clock-divider .flip-clock-label{color:#8a8a8a}.mec-wrap .flip-clock-divider.seconds .flip-clock-label{right:-82px}.mec-wrap .flip-clock-dot.top{top:30px}.mec-wrap .flip-clock-dot.bottom{bottom:30px}@-webkit-keyframes asd{0%{z-index:2}20%{z-index:4}100%{z-index:4}}@-moz-keyframes asd{0%{z-index:2}20%{z-index:4}100%{z-index:4}}@-o-keyframes asd{0%{z-index:2}20%{z-index:4}100%{z-index:4}}@keyframes asd{0%{z-index:2}20%{z-index:4}100%{z-index:4}}.flip-clock-wrapper ul.play li.flip-clock-active .down{z-index:2;-webkit-animation:turn .5s .5s linear both;-moz-animation:turn .5s .5s linear both;animation:turn .5s .5s linear both}@-webkit-keyframes turn{0%{-webkit-transform:rotatex(90deg)}100%{-webkit-transform:rotatex(0)}}@-moz-keyframes turn{0%{-moz-transform:rotatex(90deg)}100%{-moz-transform:rotatex(0)}}@-o-keyframes turn{0%{-o-transform:rotatex(90deg)}100%{-o-transform:rotatex(0)}}@keyframes turn{0%{transform:rotatex(90deg)}100%{transform:rotatex(0)}}.flip-clock-wrapper ul.play li.flip-clock-before .up{z-index:2;-webkit-animation:turn2 .5s linear both;-moz-animation:turn2 .5s linear both;animation:turn2 .5s linear both}@-webkit-keyframes turn2{0%{-webkit-transform:rotatex(0)}100%{-webkit-transform:rotatex(-90deg)}}@-moz-keyframes turn2{0%{-moz-transform:rotatex(0)}100%{-moz-transform:rotatex(-90deg)}}@-o-keyframes turn2{0%{-o-transform:rotatex(0)}100%{-o-transform:rotatex(-90deg)}}@keyframes turn2{0%{transform:rotatex(0)}100%{transform:rotatex(-90deg)}}.flip-clock-wrapper ul li.flip-clock-active{z-index:3}.flip-clock-wrapper ul.play li.flip-clock-before .up .shadow{background:-moz-linear-gradient(top,rgba(0,0,0,.1) 0,rgba(64,64,64,.68) 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,rgba(0,0,0,.1)),color-stop(100%,rgba(64,64,64,.68)));background:linear,top,rgba(0,0,0,.1) 0,rgba(64,64,64,.68) 100%;background:-o-linear-gradient(top,rgba(0,0,0,.1) 0,rgba(64,64,64,.68) 100%);background:-ms-linear-gradient(top,rgba(0,0,0,.1) 0,rgba(64,64,64,.68) 100%);background:linear,to bottom,rgba(0,0,0,.1) 0,rgba(64,64,64,.68) 100%;-webkit-animation:show .5s linear both;-moz-animation:show .5s linear both;animation:show .5s linear both}.flip-clock-wrapper ul.play li.flip-clock-active .up .shadow{background:-moz-linear-gradient(top,rgba(0,0,0,.1) 0,rgba(64,64,64,.68) 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,rgba(0,0,0,.1)),color-stop(100%,rgba(64,64,64,.68)));background:linear,top,rgba(0,0,0,.1) 0,rgba(64,64,64,.68) 100%;background:-o-linear-gradient(top,rgba(0,0,0,.1) 0,rgba(64,64,64,.68) 100%);background:-ms-linear-gradient(top,rgba(0,0,0,.1) 0,rgba(64,64,64,.68) 100%);background:linear,to bottom,rgba(0,0,0,.1) 0,rgba(64,64,64,.68) 100%;-webkit-animation:hide .5s .3s linear both;-moz-animation:hide .5s .3s linear both;animation:hide .5s .3s linear both}.flip-clock-wrapper ul.play li.flip-clock-before .down .shadow{background:-moz-linear-gradient(top,rgba(64,64,64,.68) 0,rgba(0,0,0,.1) 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,rgba(64,64,64,.68)),color-stop(100%,rgba(0,0,0,.1)));background:linear,top,rgba(64,64,64,.68) 0,rgba(0,0,0,.1) 100%;background:-o-linear-gradient(top,rgba(64,64,64,.68) 0,rgba(0,0,0,.1) 100%);background:-ms-linear-gradient(top,rgba(64,64,64,.68) 0,rgba(0,0,0,.1) 100%);background:linear,to bottom,rgba(64,64,64,.68) 0,rgba(0,0,0,.1) 100%;-webkit-animation:show .5s linear both;-moz-animation:show .5s linear both;animation:show .5s linear both}.flip-clock-wrapper ul.play li.flip-clock-active .down .shadow{background:-moz-linear-gradient(top,rgba(64,64,64,.68) 0,rgba(0,0,0,.1) 100%);background:-webkit-gradient(linear,left top,left bottom,color-stop(0,rgba(64,64,64,.68)),color-stop(100%,rgba(0,0,0,.1)));background:linear,top,rgba(64,64,64,.68) 0,rgba(0,0,0,.1) 100%;background:-o-linear-gradient(top,rgba(64,64,64,.68) 0,rgba(0,0,0,.1) 100%);background:-ms-linear-gradient(top,rgba(64,64,64,.68) 0,rgba(0,0,0,.1) 100%);background:linear,to bottom,rgba(64,64,64,.68) 0,rgba(0,0,0,.1) 100%;-webkit-animation:hide .5s .3s linear both;-moz-animation:hide .5s .3s linear both;animation:hide .5s .2s linear both}@-webkit-keyframes show{0%{opacity:0}100%{opacity:1}}@-moz-keyframes show{0%{opacity:0}100%{opacity:1}}@-o-keyframes show{0%{opacity:0}100%{opacity:1}}@keyframes show{0%{opacity:0}100%{opacity:1}}@-webkit-keyframes hide{0%{opacity:1}100%{opacity:0}}@-moz-keyframes hide{0%{opacity:1}100%{opacity:0}}@-o-keyframes hide{0%{opacity:1}100%{opacity:0}}@keyframes hide{0%{opacity:1}100%{opacity:0}}@media only screen and (min-width:320px) and (max-width:480px){.single-mec-events .mec-wrap .flip-clock-wrapper{padding-bottom:0;max-width:218px}.single-mec-events .mec-wrap .mec-events-meta-group-countdown{padding:20px 10px 20px 10px}.mec-wrap .flip-clock-wrapper ul{width:25px!important;padding:0}.single-mec-events .mec-wrap .flip-clock-wrapper .flip{margin-bottom:40px}.single-mec-events .mec-wrap .flip-clock-divider .flip-clock-label{display:block}.single-mec-events .mec-wrap .flip-clock-divider.days .flip-clock-label{left:-15px}.single-mec-events .mec-wrap .flip-clock-divider.hours .flip-clock-label{left:0}.single-mec-events .mec-wrap .flip-clock-divider.minutes .flip-clock-label{left:0}.single-mec-events .mec-wrap .flip-clock-divider.seconds .flip-clock-label{left:-15px}.single-mec-events .mec-wrap .flip-clock-wrapper{max-width:unset}}@font-face{font-family:simple-line-icons;src:url("../fonts/Simple-Line-Icons.eot?v=2.3.1");src:url("../fonts/Simple-Line-Icons.eot?v=2.3.1#iefix") format("embedded-opentype"),url("../fonts/Simple-Line-Icons.woff2?v=2.3.1") format("woff2"),url("../fonts/Simple-Line-Icons.woff?v=2.3.1") format("woff"),url("../fonts/Simple-Line-Icons.ttf?v=2.3.1") format("truetype"),url("../fonts/Simple-Line-Icons.svg?v=2.3.1#simple-line-icons") format("svg");font-weight:400;font-style:normal}[class*=mec-sl-]{font-family:simple-line-icons;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.mec-sl-facebook:before{content:"\e00b"}.mec-sl-twitter:before{content:"\e009"}.mec-sl-google-plus:before{content:"\e60d"}.mec-sl-angle-left:before{content:"\e605"}.mec-sl-angle-right:before{content:"\e606"}.mec-sl-calendar:before{content:"\e075"}.mec-sl-clock-o:before{content:"\e081"}.mec-sl-home:before{content:"\e069"}.mec-sl-phone:before{content:"\e600"}.mec-sl-envelope:before{content:"\e086"}.mec-sl-sitemap:before{content:"\e037"}.mec-sl-map-marker:before{content:"\e096"}.mec-sl-floder:before{content:"\e089"}.mec-sl-wallet:before{content:"\e02a"}.mec-color,.mec-color-before :before,.mec-color-hover:hover,.mec-wrap .mec-color,.mec-wrap .mec-color-before :before,.mec-wrap .mec-color-hover:hover{color:#40d9f1}.mec-bg-color,.mec-bg-color-hover:hover,.mec-wrap .mec-bg-color,.mec-wrap .mec-bg-color-hover:hover{background-color:#40d9f1}.mec-box-marker,.mec-vip-content-notice{box-shadow:5px 0 0 #40d9f1 inset;padding:5px 10px}.mec-border-color,.mec-border-color-hover:hover,.mec-wrap .mec-border-color,.mec-wrap .mec-border-color-hover:hover{border-color:#40d9f1}.mec-toggle-month-divider.mec-skin-list-events-container{border:1px solid #e8e8e8;margin-bottom:30px;background:#f8f8f8;box-shadow:0 2px 18px -1px rgba(0,0,0,.1);border-radius:2px}.mec-toggle-month-divider .mec-month-divider{margin:0;text-align:left;background:#fff;position:relative;cursor:pointer;border-top:1px solid #e8e8e8}.mec-toggle-month-divider .mec-month-divider span{padding:20px;border-bottom:1px solid #e8e8e8}.mec-toggle-month-divider .mec-month-divider i{position:absolute;right:20px;top:24px;font-size:20px;cursor:pointer}.mec-toggle-month-divider .mec-month-divider span:before{display:none}.mec-toggle-month-divider .mec-month-divider+article{margin-top:20px}.mec-toggle-month-divider .mec-wrap .mec-month-divider:first-of-type{border-top:none}.mec-toggle-month-divider .mec-event-list-accordion .mec-month-divider:not(:first-of-type)~article{display:none}.mec-skin-list-events-container:not(.mec-toggle-month-divider) .mec-month-divider i{display:none}.mec-month-divider{display:flex;align-items:center}.mec-month-divider:after,.mec-month-divider:before{content:"";flex:1;height:4px;background:#ebebeb}.mec-month-divider h5{font-size:22px;font-weight:700;text-transform:uppercase;margin:0 20px}.mec-month-divider i{display:none}.mec-toogle-inner-month-divider .mec-toggle-item-col .mec-event-month{display:inline-block;padding-top:0}.mec-toogle-inner-month-divider .mec-toggle-item-col .mec-event-date{font-size:14px;line-height:14px;float:none;display:inline-block;margin-right:0;font-weight:700}.mec-events-toggle .mec-toogle-inner-month-divider.mec-toggle-item-inner{padding:20px 60px 30px 15px}.mec-toogle-inner-month-divider .mec-toggle-month-inner-image{float:left;clear:right;width:100px;margin-right:20px;margin-left:10px}.mec-toogle-inner-month-divider .mec-toggle-item-col .mec-event-detail{margin-top:-6px}.mec-toogle-inner-month-divider .mec-toggle-item-col{float:none;width:100%;margin-top:10px;display:block;border:none}.mec-events-toggle .mec-toogle-inner-month-divider .mec-toggle-title{font-size:19px;display:block;padding-top:10px}@media only screen and (max-width:768px){.mec-events-toggle .mec-toogle-inner-month-divider .mec-toggle-title{font-size:14px;padding-top:0}.mec-toogle-inner-month-divider .mec-toggle-item-col{margin-top:0}.mec-toogle-inner-month-divider .mec-toggle-month-inner-image{width:70px}}.mec-wrap article:not([class^=mec-event-countdown]):not( [class^=mec-event-cover-] ).mec-label-canceled,.mec-wrap article:not([class^=mec-event-countdown]):not( [class^=mec-event-cover-] ).mec-label-custom,.mec-wrap article:not([class^=mec-event-countdown]):not( [class^=mec-event-cover-] ).mec-label-featured{overflow:hidden;position:relative}.mec-event-label-captions{z-index:1;position:absolute;top:30px;right:-37px;font-size:10px;letter-spacing:1px;text-transform:uppercase;background:#04de78;padding:2px 0;color:#fff;-ms-transform:rotate(45deg);-webkit-transform:rotate(45deg);transform:rotate(45deg);-webkit-transition:.5s cubic-bezier(.25, .5, .06, .85);transition:.5s cubic-bezier(.25, .5, .06, .85);list-style:none;text-align:center;width:150px;max-width:150px}.mec-event-agenda-clean .mec-event-label-captions{top:0}.mec-box-calendar.mec-event-calendar-classic.mec-event-container-novel .mec-event-label-captions{display:none}.mec-wrap article:not([class^=mec-event-countdown]):not( [class^=mec-event-cover-] ).mec-label-canceled:before{background:#de0404}.mec-daily-view-date-events article:before,ul.mec-weekly-view-dates-events article:before{padding:7px 40px!important;top:27px!important}.mec-event-grid-classic article .mec-fc-style,.mec-event-grid-minimal article .mec-fc-style,.mec-event-grid-simple article .mec-fc-style,.mec-timeline-event .mec-fc-style,.mec-timetable-wrap article .mec-fc-style,.mec-wrap .mec-event-list-accordion article .mec-fc-style,.mec-wrap .mec-event-list-modern article .mec-fc-style,.mec-wrap .mec-events-agenda .mec-agenda-event .mec-fc-style,.mec-wrap article.mec-event-cover-classic .mec-fc-style,.mec-wrap article.mec-event-cover-clean .mec-fc-style,.mec-wrap article.mec-event-cover-modern .mec-fc-style,.mec-wrap article[class^=mec-event-countdown-] .mec-fc-style{font-size:9px;letter-spacing:.5px;text-transform:uppercase;background:#04de78;padding:2px 7px;color:#fff;position:relative;margin-left:5px;border-radius:2px}.mec-timeline-event.mec-label-canceled .mec-fc-style,.mec-wrap .mec-events-agenda .mec-agenda-event.mec-label-canceled .mec-fc-style,.mec-wrap article.mec-event-cover-modern.mec-label-canceled .mec-fc-style{background:#de0404}.mec-event-grid-minimal article .mec-fc-style:before,.mec-event-grid-simple article .mec-fc-style:before,.mec-timeline-event .mec-fc-style:before,.mec-timetable-wrap article .mec-fc-style:before,.mec-wrap .mec-event-list-accordion article .mec-fc-style:before,.mec-wrap .mec-event-list-modern article .mec-fc-style:before,.mec-wrap .mec-events-agenda .mec-agenda-event .mec-fc-style:before,.mec-wrap article.mec-event-cover-classic .mec-fc-style:before,.mec-wrap article.mec-event-cover-clean .mec-fc-style:before,.mec-wrap article[class^=mec-event-countdown-] .mec-fc-style:before{width:0;height:0;border-top:4px solid transparent!important;border-right:5px solid;border-bottom:4px solid transparent;margin:0;top:50%;left:-5px;transform:translateY(-4.5px);position:absolute;content:"";color:var(--background-color)}.mec-timeline-event.mec-label-canceled .mec-fc-style:before,.mec-wrap .mec-events-agenda .mec-agenda-event.mec-label-canceled .mec-fc-style:before{color:#de0404}.mec-event-grid-classic article.mec-label-canceled:before,.mec-event-grid-classic article.mec-label-featured:before,.mec-event-grid-minimal article.mec-label-canceled:before,.mec-event-grid-minimal article.mec-label-featured:before,.mec-event-grid-simple article.mec-label-canceled:before,.mec-event-grid-simple article.mec-label-featured:before,.mec-timetable-wrap article.mec-label-canceled:before,.mec-timetable-wrap article.mec-label-featured:before,.mec-wrap .mec-event-list-accordion article.mec-label-canceled:before,.mec-wrap .mec-event-list-accordion article.mec-label-featured:before,.mec-wrap .mec-event-list-modern article.mec-label-canceled:before,.mec-wrap .mec-event-list-modern article.mec-label-featured:before{display:none}.mec-wrap .mec-event-list-accordion article .mec-fc-style,.mec-wrap .mec-event-list-modern article .mec-fc-style,.mec-wrap article.mec-event-cover-classic .mec-fc-style,.mec-wrap article.mec-event-cover-clean .mec-fc-style,.mec-wrap article[class^=mec-event-countdown-] .mec-fc-style{top:-1px;right:-3px;font-size:11px;white-space:nowrap}.mec-event-grid-classic article.mec-label-canceled .mec-fc-style,.mec-event-grid-minimal article.mec-label-canceled .mec-fc-style,.mec-event-grid-simple article.mec-label-canceled .mec-fc-style,.mec-timetable-wrap article.mec-label-canceled .mec-fc-style,.mec-wrap .mec-event-list-accordion article.mec-label-canceled .mec-fc-style,.mec-wrap .mec-event-list-modern article.mec-label-canceled .mec-fc-style,.mec-wrap article.mec-event-cover-classic.mec-label-canceled .mec-fc-style,.mec-wrap article.mec-event-cover-clean.mec-label-canceled .mec-fc-style,.mec-wrap article[class^=mec-event-countdown-].mec-label-canceled .mec-fc-style{background:#de0404}.mec-event-grid-classic article.mec-label-canceled .mec-fc-style:before,.mec-event-grid-minimal article.mec-label-canceled .mec-fc-style:before,.mec-event-grid-simple article.mec-label-canceled .mec-fc-style:before,.mec-timetable-wrap article.mec-label-canceled .mec-fc-style:before,.mec-wrap .mec-event-list-accordion article.mec-label-canceled .mec-fc-style:before,.mec-wrap .mec-event-list-modern article.mec-label-canceled .mec-fc-style:before,.mec-wrap article.mec-event-cover-classic.mec-label-canceled .mec-fc-style:before,.mec-wrap article.mec-event-cover-clean.mec-label-canceled .mec-fc-style:before,.mec-wrap article[class^=mec-event-countdown-].mec-label-canceled .mec-fc-style:before{color:#de0404}.mec-wrap .mec-slider-t5 article:not([class^=mec-event-countdown]).mec-label-canceled:before,.mec-wrap .mec-slider-t5 article:not([class^=mec-event-countdown]).mec-label-featured:before{-ms-transform:none;-webkit-transform:none;transform:none;-webkit-transition:none;transition:none;top:271px;right:0}.mec-timetable-wrap article .mec-fc-style{top:-2px;font-size:10px;right:0}.mec-wrap article.mec-event-cover-modern .mec-fc-style{padding:5px 9px;font-size:11px;font-weight:600;text-transform:uppercase;letter-spacing:1px;margin-bottom:24px;display:inline-block;border-radius:2px;-ms-transform:rotate(0);-webkit-transform:rotate(0);transform:rotate(0);right:0;top:0}.mec-skin-grid-events-container .mec-wrap .mec-event-grid-clean .mec-event-article:before{-ms-transform:none;-webkit-transform:none;transform:none!important;-webkit-transition:none;transition:none;top:22px!important;right:22px!important;padding:0 10px!important}.mec-event-grid-minimal article .mec-fc-style,.mec-event-grid-simple article .mec-fc-style{top:-4px;font-size:10px;margin-left:10px;right:0}.mec-event-grid-classic article .mec-fc-style{padding:5px 20px;font-size:12px;margin-top:8px;display:inline-block}.mec-load-month-link{color:#a9a9a9;font-size:12px;font-weight:400;letter-spacing:1px;text-transform:uppercase;text-decoration:unset;transition:all .33s ease}.mec-categories-wrapper{font-size:12px;font-weight:400;line-height:18px}.mec-categories-wrapper i{margin-right:4px;display:inline-block}ul.mec-categories{padding:0;display:inline;vertical-align:top}ul.mec-categories li.mec-category{list-style:none;display:inline-block;margin-right:3px;cursor:pointer}ul.mec-categories li.mec-category:not(:last-of-type):after{content:","}ul.mec-categories li.mec-category a{color:#777;text-align:left;transition:all .23s ease;-webkit-transition:all .23s ease}.mec-wrap [id^=mec_skin_events_] .mec-event-data-fields{display:inline-block;width:18px;height:18px;position:relative;vertical-align:middle;cursor:pointer;margin:0 0 0 4px;background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAABmJLR0QA/wD/AP+gvaeTAAAD90lEQVRoge2ZzWscZRjAf8/OJpUkQrF6SJMcNB+zobVdk8WCWEwqBEou0kMKtkgPHoRUD54VFMQ/wJBYhJ6MoGvFg3rQQ7dQFJVN09RANl9UkrgRbVrFuDZpZh4PSWqYmd2Z2a8Ize+0+7zPO/N7dt7l/RjYY48HGynHRZKqRltm7mmBXo1It9jEEBqBhq2UVYSswrTYmraVVFdn248iYpd675IK+GluruXehg4KchZoCtl9SVRHJcrw0fb2pWIdiirg2uzsY2LLOyjngNpib77FOujFdd1481hn50rYzqELGJ+afxGxh0AeCdvXhxURBuNm2ydhOgUuIJ1O1xgN+0eAl0OrhUDgwp3lxVd7e3s3Aub7k05n64yG3CXgZEl2QVG+sv6uG0gkDub8UiN+CZu/fBXlAYR+oz6XTKVSUb9U3wK2hk315LcR+vc3Nr/nn1aA8cz8GdDR8lmFR9DT8Vh7Mn97Hn6YmjpQKzUZ4NGKmAVnxRIrljDNW16NeYdQbaTmXXZfHuCAYUffytfo+QQmZmebbUvmKX2SKhdrIlZr3DR/cTZ4PgHL4jz/H3mAfUp00KvBVYCqRgQ5U3mnkKi+lFQ1nGFXAeOZuWNAc1WkwtHUMXOz2xl0FSDQWx2f8NjoCWfM4z8giWrIFIMorifgnqojdKDeF7Asi69TVxm7MYkIdB85TF/PcQzDqGjeNoqa/gWoNuab3765cpUr331//3vq283PJ5/vqWjeNgKNzpjXEGpwxzZJT0zuSmwHDzsDvou5nYjHg4l4xMqdVwiPAnQ1X3L3kcOuWNfRJyuet4O/nAH3f0BkGcVzu9jXcxyAsRuT9wX6nnu24nnbKCy7dJ2Ba9Nzn4lyKu9VdhX59KlY68DOiHsis3WsekLhEHC5uQqwlcvV0QmPitvNNYRUNTI+Pf+zQEt1tAKzEDdbH3ee5rmHkIgdUf2oel4BEUa9jiI95wGJMgysV1wqOGuCNeLV4FnA5lmlXqysU3BE+MBrNwaF9sTWQ28Av1fMKjgra/a9t/M15i3g0KGW2yq8Vhmn4Cj6SqFD34JroS6z7WOBC+XXCoYIQ12x9kuFcnwXczNm63mUz8unFRDRL+9kF1/3TQtyrXQ6W2fU55II/aWb+aPIF3fra08/09Lyj19uoOV0InEw98eviy+Avl+6XmFEGPpzeeFUEHko4gXH9czsgCLDlP/U7jdFB/3GvJNQGxqAeKw9WWvtM1EZBtbC9ncicFeEIWO9JhZWfqt/8Vyfnm5SooOqeraItdMC8KGyMdIVi2WLdSjLa1ZVjUzM3EzY6AlRuhU1BW36b3+tqyBLIDMCaRUuxzueGCvHa9Y99njQ+RcbkGTacAW/agAAAABJRU5ErkJggg==");background-position:center center;background-size:cover;padding:0;border:none;background-color:transparent;overflow:visible}.mec-wrap [id^=mec_skin_events_] .mec-event-data-fields .mec-data-fields-tooltip{position:absolute;width:160px;bottom:24px;left:calc(50% - 80px);background:#fff;border-radius:5px;border:1px solid #535a6121;box-shadow:0 4px 45px -8px #444b5061;visibility:hidden;opacity:0;transition:opacity .18s ease,transform .18s ease,visibility .25s ease;transform:scale(.9);z-index:99}.mec-wrap [id^=mec_skin_events_] .mec-event-data-fields:hover .mec-data-fields-tooltip{visibility:visible;opacity:1;transform:scale(1)}.mec-wrap [id^=mec_skin_events_] .mec-event-data-fields .mec-data-fields-tooltip:before{display:block;content:"";position:absolute;width:12px;height:12px;left:calc(50% - 12px);top:100%;transform:translate(50%,-50%) rotate(-45deg);background-color:#fff;box-shadow:0 8px 9px -4px #535a61;z-index:0}.mec-wrap [id^=mec_skin_events_] .mec-event-data-fields .mec-data-fields-tooltip .mec-data-fields-tooltip-box{overflow:hidden;border-radius:11px;padding:12px 0}.mec-wrap [id^=mec_skin_events_] .mec-event-data-fields .mec-data-fields-tooltip .mec-data-fields-tooltip-box ul{width:100%;height:fit-content;overflow-y:scroll;padding:9px 15px;text-align:left}.mec-wrap [id^=mec_skin_events_] .mec-event-data-fields .mec-data-fields-tooltip .mec-data-fields-tooltip-box ul::-webkit-scrollbar-track{background-color:#fafafa}.mec-wrap [id^=mec_skin_events_] .mec-event-data-fields .mec-data-fields-tooltip .mec-data-fields-tooltip-box ul::-webkit-scrollbar{width:4px;background-color:#fafafa}.mec-wrap [id^=mec_skin_events_] .mec-event-data-fields .mec-data-fields-tooltip .mec-data-fields-tooltip-box ul::-webkit-scrollbar-thumb{background-color:#40d9f1;border-radius:4px}.mec-wrap [id^=mec_skin_events_] .mec-event-data-fields .mec-data-fields-tooltip .mec-data-fields-tooltip-box ul .mec-event-data-field-item{display:block;width:100%;text-transform:none;margin:0 0 8px 0;color:#616263;font-size:13px;line-height:1.5;font-weight:400;padding-bottom:8px;border-bottom:1px dashed #e1e2e3}.mec-wrap [id^=mec_skin_events_] .mec-event-data-fields .mec-data-fields-tooltip .mec-data-fields-tooltip-box ul .mec-event-data-field-item:last-child{border-bottom:none}.mec-wrap [id^=mec_skin_events_] .mec-data-fields-tooltip .mec-data-fields-tooltip-box ul .mec-event-data-field-item a{color:#40d9f1;font-size:13px;line-height:1.5;font-weight:400}.mec-wrap [id^=mec_skin_events_] .mec-data-fields-tooltip .mec-data-fields-tooltip-box ul .mec-event-data-field-item a:hover{color:#000}.mec-wrap .mec-custom-data .mec-timetable-t2-content,.mec-wrap .mec-custom-data .mec-timetable-t2-content .mec-event-title,.mec-wrap article:not([class^=mec-event-countdown]):not( [class^=mec-event-cover-] ).mec-custom-data.mec-label-canceled,.mec-wrap article:not([class^=mec-event-countdown]):not( [class^=mec-event-cover-] ).mec-custom-data.mec-label-featured{overflow:visible!important}.mec-wrap article:not([class^=mec-event-countdown]):not( [class^=mec-event-cover-] ).mec-custom-data.mec-label-canceled .mec-event-label-captions,.mec-wrap article:not([class^=mec-event-countdown]):not( [class^=mec-event-cover-] ).mec-custom-data.mec-label-featured .mec-event-label-captions{-ms-transform:rotate(0);-webkit-transform:rotate(0);transform:rotate(0);width:fit-content;top:7px;right:7px;padding:2px 5px;border-radius:4px}@media (min-width:769px){.mec-wrap [id^=mec_skin_events_] .mec-event-list-standard .mec-label-canceled .mec-event-data-fields .mec-data-fields-tooltip,.mec-wrap [id^=mec_skin_events_] .mec-event-list-standard .mec-label-custom .mec-event-data-fields .mec-data-fields-tooltip,.mec-wrap [id^=mec_skin_events_] .mec-event-list-standard .mec-label-featured .mec-event-data-fields .mec-data-fields-tooltip{bottom:calc(50% - 110px);left:30px}.mec-wrap [id^=mec_skin_events_] .mec-event-list-standard .mec-label-canceled .mec-event-data-fields .mec-data-fields-tooltip:before,.mec-wrap [id^=mec_skin_events_] .mec-event-list-standard .mec-label-custom .mec-event-data-fields .mec-data-fields-tooltip:before,.mec-wrap [id^=mec_skin_events_] .mec-event-list-standard .mec-label-featured .mec-event-data-fields .mec-data-fields-tooltip:before{left:-10px;top:calc(100% - 110px);box-shadow:-8px -5px 9px -4px #535a61}}.mec-hourly-schedule-speaker-info{background:#fff;padding:30px;border:1px solid #e6e6e6}.mec-hourly-schedule-speaker-thumbnail{float:left;max-width:30%;width:30%}.mec-hourly-schedule-speaker-name{font-weight:700;font-size:26px;line-height:1.2;color:#333;text-transform:uppercase}.mec-hourly-schedule-speaker-details{float:left;width:69%;padding-left:25px}.mec-hourly-schedule-speaker-job-title{font-size:16px;line-height:1.3;margin-bottom:4px}.mec-hourly-schedule-speaker-description{font-size:14px;font-weight:400;color:#6d7683;line-height:1.7;text-align:left}.mec-hourly-schedule-speaker-contact-information a i,.mec-organizer-social-information a i{color:#6b6b6b;background:#ebebeb;line-height:29px;margin:9px 7px 9px 0;width:30px;height:30px;display:inline-block;text-align:center;transition:all .2s ease;font-size:15px;cursor:pointer;border-radius:3px}.mec-hourly-schedule-speaker-contact-information a i:hover,.mec-organizer-social-information a i:hover{background:#222;color:#fff}@media only screen and (max-width:479px){.mec-hourly-schedule-speaker-thumbnail{float:none;max-width:none;margin-right:0;margin-bottom:15px;width:100%}.mec-hourly-schedule-speaker-thumbnail img{width:100%}.mec-hourly-schedule-speaker-details{padding-left:0}.mec-hourly-schedule-speaker-info{width:90%;margin:0 auto}}.mec-profile{overflow-x:auto}.mec-profile .mec-profile-bookings{border:2px solid #e6e6e6;text-align:center;min-width:600px}.mec-profile .mec-profile-bookings tbody tr:first-child{background:#f7f7f7;font-weight:700;text-transform:capitalize}.mec-profile .mec-profile-bookings tbody tr{border-bottom:1px solid #e6e6e6;font-size:14px}.mec-profile .mec-profile-bookings tbody tr td{border:1px solid #e6e6e6;padding:10px;text-align:center;word-break:initial}.mec-profile .mec-profile-bookings tbody tr td a{text-decoration:none}.mec-profile .mec-profile-bookings tbody tr td:first-child{width:5%}.mec-profile .mec-profile-bookings tbody tr td:nth-child(2){width:30%;text-align:left}.mec-profile .mec-profile-bookings tbody tr td:nth-child(3){width:30%}.mec-profile .mec-profile-bookings tbody tr td:nth-child(4){width:7%}.mec-profile .mec-profile-bookings tbody tr td:nth-child(5){width:7%}.mec-profile .mec-profile-bookings tbody tr td:nth-child(6){width:7%}.mec-profile .mec-profile-bookings tbody tr td:nth-child(7){width:7%}.mec-profile .mec-profile-bookings tbody tr td:nth-child(8){width:7%}.mec-profile .mec-profile-bookings tbody tr td:nth-child(8) i{color:#fe686a}.mec-profile .mec-event-status{padding:5px 10px;color:#fff;border-radius:2px;font-size:12px;line-height:12px;letter-spacing:.4px}.mec-profile .mec-event-status.mec-book-confirmed{background:#50d477}.mec-profile .mec-event-status.mec-book-pending{background:#fcbe69}.mec-profile .mec-event-status.mec-book-rejected{background:#fe686a}.mec-profile .mec-event-date{font-size:12px;color:#888}.mec-event-date,.mec-event-status{text-align:center}.mec-event-date .mec-tooltip,.mec-event-status .mec-tooltip{position:relative;width:fit-content;margin:auto}.mec-profile i{font-size:15px;color:#008aff;vertical-align:text-bottom;margin-right:4px}.mec-event-date .mec-tooltip .box,.mec-event-status .mec-tooltip .box{min-width:250px;max-width:300px;display:inline-block;top:-8px;left:50%;margin-top:0;transform:translate(-50%,-100%);padding:0;background-color:#000;color:#fff;font-weight:400;font-size:14px;letter-spacing:.5px;line-height:1.5;position:absolute;z-index:99999999;box-sizing:border-box;border-radius:6px;box-shadow:0 4px 45px -8px #535a61;padding:5px 10px 6px;border-radius:8px;text-align:center;font-style:normal;opacity:0;visibility:hidden;display:none}.mec-event-date .mec-tooltip .box,.mec-event-status .mec-tooltip .box{font-size:13px;letter-spacing:1.1px;font-weight:500}.mec-event-date .mec-tooltip:hover .box:after,.mec-event-status .mec-tooltip:hover .box:after{content:"";position:absolute;width:12px;height:12px;left:calc(50% - 12px);bottom:-12px;transform:translate(50%,-50%) rotate(-45deg);background-color:#000;box-shadow:0 8px 9px -4px #535a61}.mec-event-status .mec-tooltip .box{min-width:100px}.mec-event-status.mec-book-confirmed .mec-tooltip .box,.mec-event-status.mec-book-confirmed .mec-tooltip:hover .box:after{background-color:#50d477}.mec-event-status.mec-book-rejected .mec-tooltip .box,.mec-event-status.mec-book-rejected .mec-tooltip:hover .box:after{background-color:#fe686a}.mec-event-status.mec-book-pending .mec-tooltip .box,.mec-event-status.mec-book-pending .mec-tooltip:hover .box:after{background-color:#fcbe69}.mec-event-date .mec-tooltip:hover .box,.mec-event-status .mec-tooltip:hover .box{opacity:1;visibility:visible;display:block}.mec-profile .mec-booking-number-of-attendees{font-size:13px;color:#888}.mec-profile .mec-booking-number-of-attendees i,.mec-profile .mec-profile-bookings-view-invoice i{font-size:15px;color:#008aff;vertical-align:text-bottom;margin-right:4px}.mec-booking-attendees{background:#fff;padding:10px}.mec-booking-attendees{width:850px;text-align:center}.mec-booking-attendees-wrapper{border:2px solid #e6e6e6;font-size:14px}.mec-booking-attendees-head{display:table;width:100%;background:#f7f7f7;border-bottom:1px solid #e6e6e6;font-weight:700}.mec-booking-attendees-head span,.mec-booking-attendees-head-content>span{vertical-align:middle;display:table-cell;padding:7px;border-right:1px solid #e6e6e6;font-size:12px}.mec-booking-attendees-head-content{display:table;width:100%;border-bottom:1px solid #e6e6e6}.mec-booking-attendees-wrapper .mec-booking-attendees-head-content:last-child{border:none}.mec-booking-attendees-head span:first-child,.mec-booking-attendees-head-content>span:first-child{width:4%}.mec-booking-attendees-head span:nth-child(2),.mec-booking-attendees-head-content>span:nth-child(2){width:20%}.mec-booking-attendees-head span:nth-child(3),.mec-booking-attendees-head-content>span:nth-child(3){width:24%}.mec-booking-attendees-head span:nth-child(4),.mec-booking-attendees-head-content>span:nth-child(4){width:26%}.mec-booking-attendees-head span:nth-child(5),.mec-booking-attendees-head-content>span:nth-child(5){width:26%}@media only screen and (max-width:759px){.mec-booking-attendees{width:470px}.mec-booking-attendees-head span,.mec-booking-attendees-head-content>span{word-break:break-all}}@media (max-width:1366px){.mec-profile .mec-profile-bookings tbody tr td:first-child{width:5%}.mec-profile .mec-profile-bookings tbody tr td:nth-child(2){width:30%}.mec-profile .mec-profile-bookings tbody tr td:nth-child(3){width:30%}.mec-profile .mec-profile-bookings tbody tr td:nth-child(4){width:10%}.mec-profile .mec-profile-bookings tbody tr td:nth-child(5){width:10%}.mec-profile .mec-profile-bookings tbody tr td:nth-child(6){width:5%}.mec-profile .mec-profile-bookings tbody tr td:nth-child(7){width:5%}.mec-profile .mec-profile-bookings tbody tr td:nth-child(8){width:5%}}@media (max-width:1024px){.mec-profile .mec-profile-bookings tbody tr td:first-child{width:5%}.mec-profile .mec-profile-bookings tbody tr td:nth-child(2){width:30%}.mec-profile .mec-profile-bookings tbody tr td:nth-child(3){width:30%}.mec-profile .mec-profile-bookings tbody tr td:nth-child(4){width:10%}.mec-profile .mec-profile-bookings tbody tr td:nth-child(5){width:10%}.mec-profile .mec-profile-bookings tbody tr td:nth-child(6){width:5%}.mec-profile .mec-profile-bookings tbody tr td:nth-child(7){width:5%}.mec-profile .mec-profile-bookings tbody tr td:nth-child(8){width:5%}}@media (max-width:780px){.mec-profile .mec-profile-bookings tbody tr,.mec-profile i{font-size:12px}.mec-event-date .mec-tooltip .box{min-width:200px}.mec-event-status .mec-tooltip .box{min-width:90px}.mec-event-date .mec-tooltip .box,.mec-event-status .mec-tooltip .box{padding:4px 5px!important}.mec-profile .mec-profile-bookings tbody tr{font-size:12px}}@media (max-width:480px){.mec-profile .mec-booking-number-of-attendees,.mec-profile .mec-event-date,.mec-profile .mec-profile-bookings tbody tr,.mec-profile i{font-size:10px!important}.mec-profile .mec-event-status{padding:2px 4px;font-size:10px;line-height:20px}.mec-profile .mec-profile-bookings tbody tr td{padding:3px}.mec-event-date .mec-tooltip .box,.mec-event-status .mec-tooltip .box{font-size:8px}.mec-event-date .mec-tooltip .box{min-width:75px}.mec-event-status .mec-tooltip .box{min-width:70px}.mec-event-date .mec-tooltip .box,.mec-event-status .mec-tooltip .box{padding:4px 5px!important}}.mec-woo-booking-checkout{position:relative;border:none;border-radius:0;color:#fff;display:inline-block;font-size:12px;letter-spacing:1px;line-height:1.5;text-transform:uppercase;font-weight:600;text-decoration:none;cursor:pointer;margin-bottom:21px;margin-right:10px;line-height:1;padding:18px 20px 16px;background:#39c36e;-webkit-transition:all .21s ease;-moz-transition:all .21s ease;transition:all .21s ease;border-radius:0;margin-bottom:6px;min-width:170px;margin-top:5px;text-align:center}.mec-woo-booking-checkout:hover{background:#222;color:#fff}.mec-woo-booking-checkout:focus,.mec-woo-booking-checkout:visited{color:#fff}.single-mec-events .lity-container{max-width:768px;width:768px}.lity-content .mec-events-meta-group-booking{width:100%;background:#fff;overflow-y:auto}@media only screen and (max-width:480px){.lity-content .mec-events-meta-group-booking{padding:20px;width:340px;margin:0 auto}}@media (max-width:480px){.single-mec-events .lity-container{max-width:440px;width:440px;margin:0 auto!important}}@media (max-width:411px){.single-mec-events .lity-container{max-width:380px;width:380px}}@media (max-width:375px){.single-mec-events .lity-container{max-width:350px;width:350px}}@media (max-width:320px){.single-mec-events .lity-container{max-width:300px;width:300px}}.mec-events-meta-group-booking{position:relative}.mec-cover-loader:after{content:"";position:absolute;top:0;right:0;left:0;bottom:0;background:rgba(255,255,255,.5);z-index:99999}.mec-loader{background:rgba(0,0,0,0);position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);z-index:9}.mec-loader,.mec-loader:after{border-radius:50%;width:5em;height:5em;z-index:999999999999}.mec-loader{font-size:10px;text-indent:-9999em;border-top:.5em solid rgba(0,0,0,.2);border-right:.5em solid rgba(0,0,0,.2);border-bottom:.5em solid rgba(0,0,0,.2);border-left:.5em solid #fff;-webkit-transform:translateZ(0);-ms-transform:translateZ(0);transform:translateZ(0);-webkit-animation:mecloader 1.1s infinite linear;animation:mecloader 1.1s infinite linear}@-webkit-keyframes mecloader{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes mecloader{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}.mec-google-recaptcha{margin:0 0 20px 16px}.mec-wrap *{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.mec-wrap :after,.mec-wrap :before{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.lity .clearfix:after,.lity .clearfix:before,.mec-wrap .clearfix:after,.mec-wrap .clearfix:before{content:"\0020";display:block;overflow:hidden;visibility:hidden;width:0;height:0}.lity .clearfix:after,.mec-wrap .clearfix:after{clear:both}.lity .clearfix,.mec-wrap .clearfix{zoom:1}.lity .clear,.lity .clr,.mec-wrap .clear,.mec-wrap .clr{clear:both;display:block;overflow:hidden;visibility:hidden}.lity .clr,.mec-wrap .clr{visibility:visible;overflow:visible}.mec-container [class*=col-] img{max-width:100%}.mec-container{margin-right:auto;margin-left:auto;padding-left:10px;padding-right:10px}.mec-container:after,.mec-container:before{content:" ";display:table}.mec-container:after{clear:both}@media only screen and (max-width:479px){.mec-container{width:300px}}@media only screen and (min-width:480px) and (max-width:767px){.mec-container{width:420px}}@media only screen and (min-width:768px) and (max-width:960px){.mec-container{width:768px}}@media only screen and (min-width:961px){.mec-container{width:960px}}@media only screen and (min-width:1200px){.mec-container{width:1196px;padding-left:15px;padding-right:15px}}@media only screen and (min-width:1921px){.mec-container{max-width:1690px}}.mec-wrap .row{margin-left:-10px;margin-right:-10px}.mec-wrap .row:after,.mec-wrap .row:before{content:" ";display:table}.mec-wrap .row:after{clear:both}.mec-wrap .col-lg-1,.mec-wrap .col-lg-10,.mec-wrap .col-lg-11,.mec-wrap .col-lg-12,.mec-wrap .col-lg-2,.mec-wrap .col-lg-3,.mec-wrap .col-lg-4,.mec-wrap .col-lg-5,.mec-wrap .col-lg-6,.mec-wrap .col-lg-7,.mec-wrap .col-lg-8,.mec-wrap .col-lg-9,.mec-wrap .col-md-1,.mec-wrap .col-md-10,.mec-wrap .col-md-11,.mec-wrap .col-md-12,.mec-wrap .col-md-2,.mec-wrap .col-md-3,.mec-wrap .col-md-4,.mec-wrap .col-md-5,.mec-wrap .col-md-6,.mec-wrap .col-md-7,.mec-wrap .col-md-8,.mec-wrap .col-md-9,.mec-wrap .col-sm-1,.mec-wrap .col-sm-10,.mec-wrap .col-sm-11,.mec-wrap .col-sm-12,.mec-wrap .col-sm-2,.mec-wrap .col-sm-3,.mec-wrap .col-sm-4,.mec-wrap .col-sm-5,.mec-wrap .col-sm-6,.mec-wrap .col-sm-7,.mec-wrap .col-sm-8,.mec-wrap .col-sm-9,.mec-wrap .col-xs-1,.mec-wrap .col-xs-10,.mec-wrap .col-xs-11,.mec-wrap .col-xs-12,.mec-wrap .col-xs-2,.mec-wrap .col-xs-3,.mec-wrap .col-xs-4,.mec-wrap .col-xs-5,.mec-wrap .col-xs-6,.mec-wrap .col-xs-7,.mec-wrap .col-xs-8,.mec-wrap .col-xs-9{position:relative;min-height:1px;padding-left:10px;padding-right:10px}@media only screen and (min-width:1200px){.mec-wrap .col-lg-1,.mec-wrap .col-lg-10,.mec-wrap .col-lg-11,.mec-wrap .col-lg-12,.mec-wrap .col-lg-2,.mec-wrap .col-lg-3,.mec-wrap .col-lg-4,.mec-wrap .col-lg-5,.mec-wrap .col-lg-6,.mec-wrap .col-lg-7,.mec-wrap .col-lg-8,.mec-wrap .col-lg-9,.mec-wrap .col-md-1,.mec-wrap .col-md-10,.mec-wrap .col-md-11,.mec-wrap .col-md-12,.mec-wrap .col-md-2,.mec-wrap .col-md-3,.mec-wrap .col-md-4,.mec-wrap .col-md-5,.mec-wrap .col-md-6,.mec-wrap .col-md-7,.mec-wrap .col-md-8,.mec-wrap .col-md-9,.mec-wrap .col-sm-1,.mec-wrap .col-sm-10,.mec-wrap .col-sm-11,.mec-wrap .col-sm-12,.mec-wrap .col-sm-2,.mec-wrap .col-sm-3,.mec-wrap .col-sm-4,.mec-wrap .col-sm-5,.mec-wrap .col-sm-6,.mec-wrap .col-sm-7,.mec-wrap .col-sm-8,.mec-wrap .col-sm-9,.mec-wrap .col-xs-1,.mec-wrap .col-xs-10,.mec-wrap .col-xs-11,.mec-wrap .col-xs-12,.mec-wrap .col-xs-2,.mec-wrap .col-xs-3,.mec-wrap .col-xs-4,.mec-wrap .col-xs-5,.mec-wrap .col-xs-6,.mec-wrap .col-xs-7,.mec-wrap .col-xs-8,.mec-wrap .col-xs-9{padding-left:15px;padding-right:15px}.mec-wrap .row{margin-left:-15px;margin-right:-15px}}.mec-container [class*=col-].alpha{padding-left:0}.mec-container [class*=col-].omega{padding-right:0}.mec-wrap .col-xs-1,.mec-wrap .col-xs-10,.mec-wrap .col-xs-11,.mec-wrap .col-xs-12,.mec-wrap .col-xs-2,.mec-wrap .col-xs-3,.mec-wrap .col-xs-4,.mec-wrap .col-xs-5,.mec-wrap .col-xs-6,.mec-wrap .col-xs-7,.mec-wrap .col-xs-8,.mec-wrap .col-xs-9{float:left}.mec-wrap .col-xs-12{width:100%}.mec-wrap .col-xs-11{width:91.66666666666666%}.mec-wrap .col-xs-10{width:83.33333333333334%}.mec-wrap .col-xs-9{width:75%}.mec-wrap .col-xs-8{width:66.66666666666666%}.mec-wrap .col-xs-7{width:58.333333333333336%}.mec-wrap .col-xs-6{width:50%}.mec-wrap .col-xs-5{width:41.66666666666667%}.mec-wrap .col-xs-4{width:33.33333333333333%}.mec-wrap .col-xs-3{width:25%}.mec-wrap .col-xs-2{width:16.666666666666664%}.mec-wrap .col-xs-1{width:8.333333333333332%}@media (min-width:769px){.mec-wrap .col-sm-1,.mec-wrap .col-sm-10,.mec-wrap .col-sm-11,.mec-wrap .col-sm-12,.mec-wrap .col-sm-2,.mec-wrap .col-sm-3,.mec-wrap .col-sm-4,.mec-wrap .col-sm-5,.mec-wrap .col-sm-6,.mec-wrap .col-sm-7,.mec-wrap .col-sm-8,.mec-wrap .col-sm-9{float:left}.mec-wrap .col-sm-12{width:100%}.mec-wrap .col-sm-11{width:91.66666666666666%}.mec-wrap .col-sm-10{width:83.33333333333334%}.mec-wrap .col-sm-9{width:75%}.mec-wrap .col-sm-8{width:66.66666666666666%}.mec-wrap .col-sm-7{width:58.333333333333336%}.mec-wrap .col-sm-6{width:50%}.mec-wrap .col-sm-5{width:41.66666666666667%}.mec-wrap .col-sm-4{width:33.33333333333333%}.mec-wrap .col-sm-3{width:25%}.mec-wrap .col-sm-2{width:16.666666666666664%}.mec-wrap .col-sm-1{width:8.333333333333332%}}@media (min-width:961px){.mec-wrap .col-md-1,.mec-wrap .col-md-10,.mec-wrap .col-md-11,.mec-wrap .col-md-12,.mec-wrap .col-md-2,.mec-wrap .col-md-3,.mec-wrap .col-md-4,.mec-wrap .col-md-5,.mec-wrap .col-md-6,.mec-wrap .col-md-7,.mec-wrap .col-md-8,.mec-wrap .col-md-9{float:left}.mec-wrap .col-md-12{width:100%}.mec-wrap .col-md-11{width:91.66666666666666%}.mec-wrap .col-md-10{width:83.33333333333334%}.mec-wrap .col-md-9{width:75%}.mec-wrap .col-md-8{width:66.66666666666666%}.mec-wrap .col-md-7{width:58.333333333333336%}.mec-wrap .col-md-6{width:50%}.mec-wrap .col-md-5{width:41.66666666666667%}.mec-wrap .col-md-4{width:33.33333333333333%}.mec-wrap .col-md-3{width:25%}.mec-wrap .col-md-2{width:16.666666666666664%}.mec-wrap .col-md-1{width:8.333333333333332%}}@media (min-width:1200px){.mec-wrap .col-lg-1,.mec-wrap .col-lg-10,.mec-wrap .col-lg-11,.mec-wrap .col-lg-12,.mec-wrap .col-lg-2,.mec-wrap .col-lg-3,.mec-wrap .col-lg-4,.mec-wrap .col-lg-5,.mec-wrap .col-lg-6,.mec-wrap .col-lg-7,.mec-wrap .col-lg-8,.mec-wrap .col-lg-9{float:left}.mec-wrap .col-lg-12{width:100%}.mec-wrap .col-lg-11{width:91.66666666666666%}.mec-wrap .col-lg-10{width:83.33333333333334%}.mec-wrap .col-lg-9{width:75%}.mec-wrap .col-lg-8{width:66.66666666666666%}.mec-wrap .col-lg-7{width:58.333333333333336%}.mec-wrap .col-lg-6{width:50%}.mec-wrap .col-lg-5{width:41.66666666666667%}.mec-wrap .col-lg-4{width:33.33333333333333%}.mec-wrap .col-lg-3{width:25%}.mec-wrap .col-lg-2{width:16.666666666666664%}.mec-wrap .col-lg-1{width:8.333333333333332%}}#mec_woo_add_to_cart_btn{min-width:170px;margin-top:5px;text-align:center}.mec-breadcrumbs{border-radius:2px;padding:9px 15px 6px;font-size:11px;color:#8d8d8d;letter-spacing:0;text-transform:none;font-weight:500;margin:auto 15px 33px 15px;border:1px solid #e6e6e6;box-shadow:0 2px 0 0 rgba(0,0,0,.025)}.mec-breadcrumbs-modern{margin:auto 0 33px 0}.mec-breadcrumbs a{color:#000;padding-left:4px}.mec-breadcrumbs a:hover{text-decoration:underline}.mec-breadcrumbs i{font-size:8px;margin:0 0 0 4px}.mec-breadcrumbs .container{padding-left:20px}.mec-content-notification a{margin-left:5px}.mec-content-notification{background:#f7f7f7;padding:10px 10px 10px;border:1px solid #e8e8e8}.mec-content-notification p{margin-bottom:0}.mec-fes-form #mec-advanced-wraper div:first-child>ul{border:1px solid #cfeff5;width:auto;box-shadow:0 1px 4px -2px #cfeff5;display:block;margin:5px 0 10px;padding:5px 0;border-radius:2px}.mec-fes-form #mec-advanced-wraper div:first-child>ul:last-of-type{margin-bottom:35px}#mec-advanced-wraper div:first-child>ul span{display:none}#mec-advanced-wraper div:first-child>ul *{display:inline-block;background:#fff;font-size:12px;color:#717273;text-align:center}#mec-advanced-wraper div:first-child>ul>li{width:60px;font-weight:700;margin:0 10px 0 0;padding:4px 0;border-right:1px solid #cfeff5}#mec-advanced-wraper div:first-child>ul>ul>li{margin:0;padding:2px 10px;cursor:pointer;border-radius:2px;transition:all .18s ease}.mec-fes-form #mec-advanced-wraper div:first-child>ul>ul>li.mec-active,.mec-fes-form #mec-advanced-wraper div:first-child>ul>ul>li:hover{background:#40d9f1!important;box-shadow:0 1px 9px -3px #40d9f1;color:#fff!important}.mec-search-bar-wrap .mec-search-form .mec-text-input-search{width:83%}.mec-search-bar-wrap .mec-search-form .mec-ajax-search-result .mec-text-input-search{width:100%;float:none}.mec-search-bar-wrap input#mec-search-bar-input{width:calc(100% - 84%);margin-left:11px;background:#40d9f1;color:#fff;font-weight:400}.mec-text-input-search+input#mec-search-bar-input{margin-left:-3px}.mec-search-bar-wrap input#mec-search-bar-input:hover{background:#000}.mec-wrap.mec-search-bar-wrap .mec-totalcal-box input{float:none}@media (max-width:768px){.mec-search-bar-wrap .mec-search-form .mec-text-input-search{display:inline-block}}@media (max-width:480px){.mec-search-bar-wrap .mec-search-form .mec-text-input-search{width:64%}.mec-search-bar-wrap input#mec-search-bar-input{width:calc(100% - 67%)}}.mec-wrap.mec-search-bar-wrap .mec-totalcal-box{overflow:visible}.mec-ajax-search-result{position:relative}.mec-search-bar-wrap.mec-wrap .mec-totalcal-box input[type=text]{width:calc(100% - 36px)}.mec-search-bar-wrap.mec-wrap .mec-totalcal-box input[type=text]:focus{border-color:#efefef}div#mec-ajax-search-result-wrap{position:absolute;top:100%;opacity:0;visibility:hidden;width:calc(100% - 2px);min-height:50px;left:0;right:0;padding:0 10px;z-index:9999;transition:all .3s ease}.mec-ajax-search-result-events{background:#fff;padding:10px 20px;border:1px solid #efefef;border-top:none}.mec-ajax-search-result-events article:first-of-type{border:none}article.mec-search-bar-result{text-align:left;margin-bottom:0;padding-bottom:25px;padding-top:26px;border-top:1px solid #efefef;transition:all .33s ease;clear:both}.mec-search-bar-result .mec-event-list-search-bar-date{width:64px;height:64px;margin-right:10px;font-size:11px;text-transform:uppercase;float:left;text-align:center;padding-top:2px}.mec-search-bar-result .mec-event-list-search-bar-date span{font-size:40px;line-height:30px;font-weight:700;display:block;margin-bottom:6px;letter-spacing:1px}.mec-search-bar-result .mec-event-image{float:left;margin-right:20px;width:65px;height:auto}.mec-search-bar-result .mec-event-time{font-size:11px;line-height:1.1;margin:0}.mec-search-bar-result .mec-event-time i{color:#40d9f1;float:none;width:unset;height:unset;font-size:inherit;margin-right:3px;border:none;padding:0}.mec-search-bar-result .mec-event-title{font-size:13px;padding:0;margin:10px 0 8px;font-weight:700;text-transform:uppercase}.mec-search-bar-result .mec-event-title a{text-decoration:none;color:#494949;transition:color .3s ease}.mec-search-bar-result .mec-event-detail{font-size:13px;line-height:1.3;color:#9a9a9a;margin-bottom:0}.mec-wrap.mec-modern-search-bar .mec-totalcal-box{background:rgba(255,255,255,.87);border:none;padding:35px;border-radius:3px;box-shadow:0 3px 13px rgba(0,0,0,.4);position:relative}.mec-wrap.mec-modern-search-bar .mec-totalcal-box input[type=search],.mec-wrap.mec-modern-search-bar .mec-totalcal-box input[type=text]{height:58px;background:rgba(255,255,255,.99);border-radius:2px;box-shadow:0 4px 8px rgba(0,0,0,.1) inset;border:1px solid #ccc;width:100%;padding-left:45px;padding-right:13px;font-size:16px}.mec-wrap.mec-modern-search-bar .mec-totalcal-box .mec-text-input-search i{position:absolute;background:0 0;border:none;font-size:21px;left:15px;top:calc(50% - 19px);color:#40d9f1}.mec-wrap.mec-modern-search-bar .mec-text-input-search{position:relative;height:58px}.mec-wrap.mec-modern-search-bar .mec-totalcal-box input[type=submit]{height:58px;border:none;border-radius:2px;background:#fc4a1a;font-size:17px;font-weight:700!important}.mec-wrap.mec-modern-search-bar .mec-text-input-search+input#mec-search-bar-input{margin-left:0}.mec-wrap.mec-modern-search-bar .mec-search-form .mec-dropdown-wrap .mec-dropdown-search select{height:45px;background:rgba(255,255,255,.99);border-radius:2px;box-shadow:0 4px 8px rgba(0,0,0,.1) inset;border:1px solid #ccc;padding-right:13px;font-size:16px;border-left:0}.mec-wrap.mec-modern-search-bar .mec-search-form .mec-dropdown-wrap i{height:45px;background:#ffff;border-radius:2px 0 0 2px;box-shadow:none;border:1px solid #ccc;font-size:15px;padding-top:14px;border-right:0;color:#40d9f1;margin-right:-1px}.mec-wrap.mec-modern-search-bar .mec-search-form .mec-dropdown-wrap{min-height:64px}@media (max-width:768px){.mec-wrap.mec-modern-search-bar .mec-search-form .mec-text-input-search{width:70%}.mec-wrap.mec-modern-search-bar input#mec-search-bar-input{width:calc(100% - 72%)}}@media (max-width:480px){.mec-wrap.mec-modern-search-bar input#mec-search-bar-input{width:92%;padding:0 10px;position:relative;display:block;margin-left:11px}.mec-wrap.mec-modern-search-bar .mec-search-form .mec-text-input-search{width:100%;margin-bottom:20px}.mec-wrap.mec-modern-search-bar .mec-text-input-search+input#mec-search-bar-input{margin-left:10px}}.mec-wrap .mec-related-events-wrap{margin-left:0;margin-right:0}.mec-related-events{margin-right:-15px;margin-left:-15px}@media (max-width:980px){.mec-related-events{margin-right:-10px;margin-left:-10px}}.mec-related-events-wrap{margin-top:50px}.mec-related-events-wrap h3.mec-rec-events-title:before{content:"";background:#2c2f34;width:46px;height:4px;position:absolute;top:59px;left:0}.mec-related-events-wrap h3.mec-rec-events-title{font-size:21px;font-weight:600;padding:17px 0;margin-bottom:28px;text-transform:uppercase;border-bottom:1px solid #e8e8e8;position:relative}.mec-related-event-post figure{margin:0}.mec-related-event-post figure img{width:100%;border-radius:3px;height:auto}.mec-related-event-content{background-color:#fff;margin:-40px 20px 15px;border-radius:2px;position:relative;max-width:90%;padding:10px 12px 16px 17px}.mec-related-event-content h5 a{font-size:16px;color:#121212;font-weight:600;transition:all .3s ease}@media (max-width:480px){.mec-wrap .mec-related-events .mec-related-event-post{padding-right:15px;padding-left:15px}}.mec-next-previous-events{width:100%;height:104px;display:block;padding:0;margin:0}.mec-next-previous-events li{list-style:none;width:50%;display:inline-block;margin:40px 0 40px}.mec-next-previous-events li:last-child{text-align:right;float:right}.mec-next-previous-events li a{padding:9px 14px 9px 14px;border:1px solid #000;transition:.3s}.mec-wrap .mec-next-previous-events li a:hover{color:#fff!important}.mec-previous-event{float:left;text-align:left}.mec-next-event ul{padding-left:0;margin:0}.mec-next-previous-events .mec-previous-event i{padding-right:20px}.mec-next-previous-events .mec-next-event i{padding-left:20px}.mec-next-multiple ul{padding:0;margin:0}.mec-next-multiple ul li a{display:block;position:relative;padding:11px 14px 9px;z-index:9}.mec-next-multiple ul .mec-date,.mec-next-multiple ul .mec-time{display:inline-block}.mec-next-multiple ul .mec-time{width:40%}.mec-next-multiple ul .mec-date{width:60%}.mec-next-multiple ul .mec-date{float:left;text-align:left}.mec-next-multiple ul .mec-time{text-align:right;position:relative;z-index:-1}.mec-next-multiple ul .mec-time dd{margin:0;padding:0}.mec-next-multiple ul .mec-date .mec-end-date-label,.mec-next-multiple ul .mec-date .mec-start-date-label,.mec-next-multiple ul .mec-time .mec-events-abbr{font-size:11px;line-height:24px}@media (max-width:1280px){.mec-next-multiple ul li a{padding:7px 9px 5px}.mec-next-multiple ul .mec-date .mec-start-date-label,.mec-next-multiple ul .mec-time .mec-events-abbr{font-size:12px}}@media (max-width:480px){.mec-next-previous-events li{list-style:none;width:100%;display:block;margin:10px 0;float:unset}.mec-next-previous-events li a{width:100%;max-width:100%;float:unset;display:block;text-align:center;font-size:16px}}.mec-fes-form-cntt #mec-organizer-payments ul{list-style:none;background:0 0;margin:0;padding-left:0}.mec-fes-form-cntt #mec-organizer-payments ul li h4{background:0 0;letter-spacing:.2px;display:inline-block;padding-left:0!important;padding-bottom:10px!important;margin:0;margin-bottom:1px;letter-spacing:1px;text-transform:capitalize;padding-top:1px}.mec-fes-form-cntt #mec-organizer-payments ul>li{width:100%;display:inline-block;vertical-align:top;padding:0;margin:0}.mec-fes-form #mec_gateway_options_form_stripe_connection_button{padding:9px 13px!important}#mec-login-form.mec-login-form{width:100%;background:#fff;padding:20px;margin:0 auto;text-align:center;position:relative}#mec-login-form.mec-login-form .mec-login-input{display:block;width:286px;margin:0 auto;margin-bottom:12px}#mec-login-form.mec-login-form .mec-login-forgotpassword{display:inline-block}.mec-login-forgotpassword a{color:#000}#mec-login-form.mec-login-form .mec-login-submit{float:right;text-align:right;width:49%;padding-right:2px}#mec-login-form.mec-login-form .mec-login-input input{border:none;box-shadow:none;background:#fff;color:#ccc;border-left:1px solid #e6e6e6;border-radius:0;padding:0;height:100%;background-image:none!important;padding-left:10px;padding-right:0;width:222px;margin-left:0;clear:none;float:left}#mec-login-form.mec-login-form .mec-login-input label{border:1px solid #e6e6e6;height:52px;display:inline-block;padding:0;border-radius:3px;overflow:hidden;box-shadow:0 2px 4px rgba(0,0,0,.04)}#mec-login-form.mec-login-form .mec-login-input label i:not(.mec-sl-display-controller-password){padding:15px 13px 17px 16px;vertical-align:middle;font-size:20px;width:50px;color:#c5cad0;background:#fafafa;margin-right:0;float:left}#mec-login-form.mec-login-form .mec-login-forgotpassword{float:left;width:49%;text-align:left;padding-top:10px;font-size:13px;padding-left:2px}#mec-login-form.mec-login-form button{width:120px;height:44px;font-size:12px;font-weight:700;letter-spacing:1px;text-transform:uppercase;transition:all .22s ease;margin:0;min-width:unset}.mec-login-form button{box-shadow:0 4px 22px -7px #40d9f1;background-color:#40d9f1}#mec-login-form.mec-login-form .mec-login-form-footer{width:286px;margin:0 auto;margin-top:20px;clear:both;position:relative;display:block;min-height:50px}#mec-login-form.mec-login-form .mec-ajax-login-loading{position:absolute;background:#ffffffc2;left:0;right:0;top:0;bottom:0}#mec-login-form.mec-login-form .lds-ripple{position:absolute;width:64px;height:64px;top:calc(50% - 23px);left:calc(50% - 23px)}#mec-login-form.mec-login-form .lds-ripple div{position:absolute;border:4px solid #40d9f1;opacity:1;border-radius:50%;animation:lds-ripple 1.2s cubic-bezier(0,.2,.1,.8) infinite}#mec-login-form.mec-login-form .lds-ripple div:nth-child(2){animation-delay:-.5s}#mec-login-form.mec-login-form .mec-ajax-login-loading-text{position:absolute;min-width:200px;top:calc(50% - 18px);left:calc(50% - 124px);color:#fff;padding:10px 22px;border-radius:3px;background:#fff;height:47px}#mec-login-form.mec-login-form .mec-ajax-login-loading-text strong{color:#3fcc60}#mec-login-form.mec-login-form .mec-ajax-login-loading-text strong:before{content:"";position:absolute;top:8px;left:1px;border-right:2px solid #3fcc60;border-bottom:2px solid #3acb5c;transform:rotate(45deg);transform-origin:0 100%;color:#000;animation:checkbox-check 130ms 140ms cubic-bezier(.4,0,.23,1) forwards;width:8px;height:14px}#mec-login-form.mec-login-form .mec-ajax-login-loading-text.error strong:after{content:"";position:absolute;top:14px;left:5px;border-bottom:2px solid #ff5d39;transform:rotate(45deg);transform-origin:0 100%;color:#000;animation:checkbox-check 130ms 140ms cubic-bezier(.4,0,.23,1) forwards;width:14px;height:4px}#mec-login-form.mec-login-form .mec-ajax-login-loading-text.error strong{color:#ff5d39}#mec-login-form.mec-login-form .mec-ajax-login-loading-text.error strong:before{border-color:#ff5d39;border-bottom:none}@keyframes lds-ripple{0%{top:28px;left:28px;width:0;height:0;opacity:1}100%{top:-1px;left:-1px;width:58px;height:58px;opacity:0}}.mec-card-element-stripe{margin-bottom:30px}.mec-book-form-gateway-checkout [id*=mec_do_transaction_stripe_] .mec-form-row.mec-stripe-name-and-email-wrapper{width:100%}.mec-book-form-gateway-checkout [id*=mec_do_transaction_stripe_] .mec-form-row.mec-stripe-name-and-email-wrapper .mec-form-row{width:50%}.mec-book-form-gateway-checkout [id*=mec_do_transaction_stripe_] .mec-form-row.mec-stripe-name-and-email-wrapper .mec-form-row:nth-child(2){margin-left:12px}.mec-book-form-gateway-checkout [id*=mec_do_transaction_stripe_] .mec-form-row.mec-stripe-name-and-email-wrapper .mec-form-row input{max-width:unset;margin-bottom:20px}.mec-events-meta-group-booking .StripeElement--invalid{border-color:#fa755a}.mec-events-meta-group-booking .StripeElement--webkit-autofill{background-color:#fefde5!important}#mec_occurrences_add{position:relative;top:-2px}.mec-occurrences-wrapper ul.mec-occurrences-list{list-style:none;padding:0}.mec-occurrences-wrapper ul.mec-occurrences-list li.mec_occurrences_item{border:2px dashed #eee}.mec-occurrences-wrapper ul.mec-occurrences-list li.mec_occurrences_item{border:2px dashed #eee;padding:20px}.mec-occurrences-wrapper ul.mec-occurrences-list li.mec_occurrences_item h3{font-size:1rem}.mec-occurrences-wrapper ul.mec-occurrences-list li.mec_occurrences_item h3{font-size:1rem;position:relative}.mec-occurrences-wrapper ul.mec-occurrences-list li.mec_occurrences_item h3 span.mec-occurrences-delete-button{position:absolute;right:10px;top:0;margin:0;padding:6px 8px!important;font-size:11px;line-height:12px!important;min-height:10px;height:auto;display:block;cursor:pointer;color:#ea6485;border:2px solid #ffd2dd;border-radius:3px;letter-spacing:.4px}.mec-occurrences-wrapper ul.mec-occurrences-list li.mec_occurrences_item h3 span.mec-occurrences-delete-button:hover{background:#ea6485;color:#fff;border-color:#ea6485;box-shadow:0 2px 6px -3px #ea6485}#mec_occurrences_add,.mec-booking-tab-content .button,.mec-booking-tab-content .mec-bfixed-field-add-option,.mec-booking-tab-content .mec-reg-field-add-option,.mec-fes-form .mec-form-row .button:not(.wp-color-result),.mec-fes-form input[type=file],ul#mec_bfixed_form_fields li .mec_bfixed_field_remove,ul#mec_orgz_form_row li .mec-additional-organizer-remove,ul#mec_reg_form_fields li .mec_reg_field_remove{height:40px;margin-top:1px;text-decoration:none;font-size:14px;line-height:34px!important;margin:0;padding:0 15px 1px!important;text-transform:none;letter-spacing:0;font-weight:600;color:#40d9f1;background:#fff;border-radius:3px;margin-right:8px;border:2px solid #cfeff5;box-shadow:0 2px 6px -3px #cfeff5}.mec-fes-form .mec-additional-organizers .select2-container{margin-bottom:0}.mec-booking-tab-content .button:hover,.mec-booking-tab-content .mec-bfixed-field-add-option:hover,.mec-booking-tab-content .mec-reg-field-add-option:hover,.mec-fes-form .mec-form-row .button:not(.wp-color-result):hover{background:#40d9f1;color:#fff;border-color:#40d9f1;box-shadow:0 2px 6px -3px #40d9f1}.mec-fes-form .mec-form-row input+button.button{vertical-align:top}.mec-fes-form .mec-form-row .quicktags-toolbar input.button.button-small{border-width:1px;padding:0 7px;color:#80c6d2;font-weight:400;margin:1px;transform:none}.mec-fes-form input[type=file]{max-width:166px;text-align:center;height:44px;transition:all .2s ease;border-radius:5px!important;border:2px dashed #b8e9f3}.mec-fes-form input[type=file]:hover{box-shadow:0 2px 16px -3px #cfeff5}.mec-fes-form input[type=file]::-webkit-file-upload-button{visibility:hidden;width:1px;height:38px}.mec-fes-form input[type=file]::-moz-file-upload-button{visibility:hidden;width:1px;height:38px}.mec-fes-form .mec-meta-box-fields>label{padding:0}#mec_bfixed_form_fields li,#mec_orgz_form_row li,#mec_reg_form_fields li{list-style:none}ul#mec_bfixed_form_fields,ul#mec_orgz_form_row,ul#mec_reg_form_fields{padding:0;margin:0}ul#mec_bfixed_form_fields li,ul#mec_orgz_form_row li,ul#mec_reg_form_fields li{background:#f8feff;margin:6px -20px;padding:15px 25px 10px;width:auto;font-size:13px;border-top:1px solid #e8fafd;border-bottom:1px solid #e8fafd;position:relative}ul#mec_bfixed_form_fields li .mec_bfixed_field_remove,ul#mec_orgz_form_row li .mec-additional-organizer-remove,ul#mec_reg_form_fields li .mec_reg_field_remove{position:absolute;right:10px;top:10px;margin:0;padding:6px 8px!important;font-size:11px;line-height:12px!important;min-height:10px;height:auto;display:block;cursor:pointer;color:#ea6485;border-color:#ffd2dd;letter-spacing:.4px}ul#mec_bfixed_form_fields li .mec_bfixed_field_remove:hover,ul#mec_orgz_form_row li .mec-additional-organizer-remove:hover,ul#mec_reg_form_fields li .mec_reg_field_remove:hover{background:#ea6485;color:#fff;border-color:#ea6485;box-shadow:0 2px 6px -3px #ea6485}#mec_bfixed_form_fields input[type=checkbox],#mec_bfixed_form_fields input[type=radio],#mec_reg_form_fields input[type=checkbox],#mec_reg_form_fields input[type=radio],.mec-form-row input[type=checkbox],.mec-form-row input[type=radio]{background-color:#fff;border:1px solid #cfeff5;box-shadow:0 1px 3px -1px #cfeff5;padding:9px;border-radius:3px;min-width:24px;min-height:24px;display:inline-block!important;vertical-align:middle;float:none;transition:all .18s ease;outline:0;margin:1px 4px 4px 0;text-align:left;cursor:pointer;-webkit-appearance:none;-moz-appearance:none}#mec_bfixed_form_fields input[type=checkbox]:focus,#mec_bfixed_form_fields input[type=radio]:focus,#mec_reg_form_fields input[type=checkbox]:focus,#mec_reg_form_fields input[type=radio]:focus,.mec-form-row input[type=checkbox]:focus,.mec-form-row input[type=radio]:focus{outline:0}#mec_bfixed_form_fields input[type=radio],#mec_reg_form_fields input[type=radio],.mec-form-row input[type=radio]{-webkit-appearance:none;border-radius:20px!important;min-width:20px;min-height:20px;margin:0 0 4px 0;vertical-align:middle}#mec_bfixed_form_fields input[type=checkbox]:hover,#mec_bfixed_form_fields input[type=radio]:hover,#mec_reg_form_fields input[type=checkbox]:hover,#mec_reg_form_fields input[type=radio]:hover,.mec-form-row input[type=checkbox]:hover,.mec-form-row input[type=radio]:hover{border-color:#40d9f1}#mec_bfixed_form_fields input[type=checkbox]:checked,#mec_bfixed_form_fields input[type=radio]:checked,#mec_reg_form_fields input[type=checkbox]:checked,#mec_reg_form_fields input[type=radio]:checked,.mec-fes-form .mec-form-row input[type=checkbox]:checked,.mec-fes-form .mec-form-row input[type=radio]:checked{box-shadow:0 1px 6px -2px #40d9f1;border-color:#40d9f1;background:#40d9f1;border-radius:2px;position:relative}.mec-form-row input[type=radio]:checked{box-shadow:0 1px 6px -2px #40d9f1,inset 0 0 0 3px #fff!important}#mec_bfixed_form_fields input[type=checkbox]:checked::before,#mec_reg_form_fields input[type=checkbox]:checked::before,.mec-form-row input[type=checkbox]:checked:before{content:"";font:normal;position:absolute;top:12px;left:5px;margin:0;vertical-align:middle;line-height:1;border-right:2px solid #fff!important;border-bottom:2px solid #fff!important;transform:rotate(45deg);transform-origin:0% 100%;color:#fff;transition:all .2s ease;animation:checkbox-check 130ms 140ms cubic-bezier(.4,0,.23,1) forwards}@keyframes checkbox-check{0%{width:0;height:0;border-color:#fff;transform:translate3d(0,0,0) rotate(45deg)}33%{width:6px;height:0;transform:translate3d(0,0,0) rotate(45deg)}100%{width:6px;height:12px;border-color:#fff;transform:translate3d(0,-12px,0) rotate(45deg)}}#wrap #mec-event-data input[type=radio]{position:relative}#wrap #mec-event-data input[type=radio]:empty::before{display:none}#mec_bfixed_form_field_types .button,#mec_reg_form_field_types .button{position:relative;outline:0;border-radius:50px;padding:2px 21px 2px 31px!important;line-height:1;font-size:11px;font-weight:600;color:#40d9f1;letter-spacing:2px;height:auto;cursor:pointer;margin-top:5px;text-transform:uppercase;box-shadow:0 2px 6px -3px #40d9f1;border:2px solid #cfeff5}#mec_fes_location_remove_image_button,#mec_fes_organizer_remove_image_button,#mec_meta_box_hourly_schedule_days [id^=mec_meta_box_hourly_schedule_day_] .mec-col-1 .button,#mec_meta_box_hourly_schedule_days [id^=mec_meta_box_hourly_schedule_day_] .mec-form-row.mec-box .button,#mec_meta_box_tickets_form [id^=mec_ticket_row] button,#mec_reg_form_field_types .button.red{color:#ea6485;box-shadow:0 2px 6px -3px #ea6485;background:#fff;border-color:#ffd2dd}#mec_fes_location_remove_image_button:hover,#mec_fes_organizer_remove_image_button:hover,#mec_meta_box_hourly_schedule_days [id^=mec_meta_box_hourly_schedule_day_] .mec-col-1 .button:hover,#mec_meta_box_hourly_schedule_days [id^=mec_meta_box_hourly_schedule_day_] .mec-form-row.mec-box .button:hover,#mec_meta_box_tickets_form [id^=mec_ticket_row] button:hover,#mec_reg_form_field_types .button.red:hover{background:#ea6485;color:#fff}#mec_bfixed_form_field_types .button:before,#mec_reg_form_field_types .button:before{position:absolute;left:12px;color:#40d9f1;content:"\e095";font-family:simple-line-icons;font-size:13px;display:inline-block}#mec_reg_form_field_types .button.red:before{color:#ea6485}#mec_bfixed_form_field_types .button:hover:before,#mec_reg_form_field_types .button.red:hover:before,#mec_reg_form_field_types .button:hover:before{color:#fff}#mec_fes_location_remove_image_button:hover,#mec_fes_organizer_remove_image_button:hover,#mec_meta_box_hourly_schedule_days [id^=mec_meta_box_hourly_schedule_day_] .mec-col-1 .button:hover,#mec_meta_box_hourly_schedule_days [id^=mec_meta_box_hourly_schedule_day_] .mec-form-row.mec-box .button:hover,#mec_meta_box_tickets_form [id^=mec_ticket_row] button:hover,#mec_price_per_dates_container .button:hover,#mec_reg_form_field_types .button.red:hover{color:#fff;border:2px solid #ea6485}#mec_taxes_fees_container_toggle [id^=mec_remove_fee_button],#mec_ticket_variations_list [id^=mec_remove_ticket_variation_button]{color:#ea6485;border-color:#ffd2dd}#mec_taxes_fees_container_toggle [id^=mec_remove_fee_button]:hover,#mec_ticket_variations_list [id^=mec_remove_ticket_variation_button]:hover{color:#fff;border:2px solid #ea6485;background:#ea6485}#mec_fees_list [id^=mec_remove_fee_button],#mec_meta_box_ticket_variations_form .mec-form-row [id^=mec_remove_ticket_variation_button]{margin-left:14px!important}#mec_meta_box_hourly_schedule_days .mec-add-hourly-schedule-button{line-height:10px!important}#mec_meta_box_tickets_form [id^=mec_ticket_row] .mec_add_price_date_button{color:#40d9f1;box-shadow:0 2px 6px -3px #40d9f1;border:2px solid #cfeff5}#mec_meta_box_tickets_form [id^=mec_ticket_row] .mec_add_price_date_button:hover,#mec_reg_form_field_types .button:hover{color:#fff;border:2px solid #40d9f1;background:#40d9f1}.mec-fes-form #mec_bfixed_form_fields span.mec_bfixed_field_sort,.mec-fes-form #mec_orgz_form_row span.mec-additional-organizer-sort,.mec-fes-form #mec_reg_form_fields span.mec_reg_field_sort{font-size:0;color:#fff;padding-left:20px}.mec-fes-form #mec_bfixed_form_fields .mec_bfixed_field_option_sort,.mec-fes-form #mec_orgz_form_row span.mec-additional-organizer-sort,.mec-fes-form #mec_reg_form_fields .mec_reg_field_options,.mec-fes-form #mec_reg_form_fields span.mec_reg_field_option_sort{font-size:0}.mec-fes-form #mec_bfixed_form_fields span.mec_bfixed_field_option_sort:before,.mec-fes-form #mec_bfixed_form_fields span.mec_bfixed_field_sort:before,.mec-fes-form #mec_orgz_form_row span.mec-additional-organizer-sort:before,.mec-fes-form #mec_reg_form_fields span.mec_reg_field_option_sort:before,.mec-fes-form #mec_reg_form_fields span.mec_reg_field_options:before,.mec-fes-form #mec_reg_form_fields span.mec_reg_field_sort:before{position:absolute;left:px;top:12px;width:80px;height:20px;display:block;cursor:move;font-family:simple-line-icons;content:"\e023";font-size:18px;color:#888}.mec-fes-form #mec_bfixed_form_fields span.mec_bfixed_field_option_sort:before,.mec-fes-form #mec_reg_form_fields span.mec_reg_field_option_sort:before,.mec-fes-form #mec_reg_form_fields span.mec_reg_field_options:before{font-size:13px;left:2px;top:26px;width:14px;height:14px}.mec-fes-form #mec_bfixed_form_fields .mec_bfixed_field_options,.mec-fes-form #mec_reg_form_fields .mec_reg_field_options{margin-top:20px}.mec-fes-form #mec_fes_form #mec_bfixed_form_fields .mec_bfixed_notification_placeholder{font-size:0}.mec-form-row input+span.mec-tooltip,.mec-form-row select+span.mec-tooltip{bottom:10px}.mec-form-row label+span.mec-tooltip{bottom:8px}.mec-form-row textarea+span.mec-tooltip{bottom:auto;vertical-align:top;top:12px}.mec-form-row span+span.mec-tooltip{bottom:0;vertical-align:middle}.mec-form-row .mec-col-8 input[type=text],.mec-form-row .mec-col-8 select,.mec-form-row .mec-col-8 span.mec-archive-skins{vertical-align:top}.mec-form-row input:disabled{opacity:.6;background:#f6f6f6}.mec-form-row p{font-size:12px!important;line-height:18px!important;color:#97b2bb!important}.mec-form-row p.description{font-style:italic}.ui-datepicker.ui-widget{border:1px solid #e8e8e8;box-shadow:0 1px 9px rgba(0,0,0,.12)}table.ui-datepicker-calendar{margin-bottom:0}.ui-datepicker-calendar th{font-weight:700;color:#4a4b4c}.ui-datepicker-calendar td,.ui-datepicker-calendar th,.ui-datepicker-calendar tr{border:none}.ui-datepicker.ui-widget select{font-weight:600;font-size:12px;display:inline-block;border-radius:2px;padding:2px 10px;margin:5px 3px;width:auto;min-height:20px;height:26px;border:1px solid #e3e3e3;box-shadow:inset 0 1px 3px rgba(0,0,0,.04)}.ui-datepicker.ui-widget table{border-spacing:2px;border:none}.ui-datepicker.ui-widget td,.ui-datepicker.ui-widget tr{padding:0;background:0 0!important}.ui-datepicker.ui-widget td a{color:#9a9b9c;font-weight:600;width:30px;height:30px;line-height:30px;display:inline-block;border-radius:33px;padding:0;background:#fff;transition:all .2s ease}.ui-datepicker.ui-widget td a.ui-state-active,.ui-datepicker.ui-widget td a:hover{background:#40d9f1;color:#fff}.ui-datepicker.ui-widget .ui-datepicker-next,.ui-datepicker.ui-widget .ui-datepicker-prev{color:#40d9f1;width:30px;height:30px;line-height:30px;display:inline-block;text-align:center;border-radius:33px;background:#ecfcff;transition:all .2s ease}.ui-datepicker.ui-widget .ui-datepicker-next:hover,.ui-datepicker.ui-widget .ui-datepicker-prev:hover{background:#fff;box-shadow:0 0 7px -3px rgba(0,0,0,.4)}.mec-fes-form .mec-tooltip .dashicons-before:before{color:#40d9f1}.mec-fes-form button[type=submit].mec-fes-sub-button{border-radius:3px;background:#40d9f1;color:#fff;height:54px;font-size:17px;font-weight:700;box-shadow:0 2px 8px -4px #40d9f1;display:block;transition:all .28s ease;text-transform:uppercase;margin:20px 0 0;padding:14px 20px;border:0;cursor:pointer;text-align:center;letter-spacing:.1em;line-height:1}.mec-fes-form button[type=submit].mec-fes-sub-button:hover{box-shadow:0 2px 12px -2px #40d9f1}.mec-fes-form button[type=submit].mec-fes-sub-button:focus{margin-bottom:-2px;background:#1dc2dc}.mec-fes-form .mec-title span.mec-dashicons{color:#40d9f1;float:left;margin-right:5px}.mec-fes-form .mec-tooltip .box h5{padding:14px 2px}#mec_fes_form,.mec-fes-form-top-actions{max-width:838px;margin:0 auto}@media only screen and (min-width:961px){.mec-fes-form .mec-fes-form-cntt{width:calc(100% - 300px);float:left;padding-right:20px;max-width:538px;display:block}.mec-fes-form .mec-fes-form-sdbr{width:300px}}.mec-fes-form .quicktags-toolbar,.mec-fes-form div.mce-toolbar-grp{background:#ecfcff;border-bottom:1px solid #cfeff5;box-shadow:0 1px 0 1px #cfeff5}.mec-fes-form .quicktags-toolbar{margin-right:-1px;border-top:1px solid #cfeff5}.mec-fes-form div.mce-statusbar{border-top-color:#cfeff5}.mec-fes-form .mce-toolbar .mce-btn-group .mce-btn.mce-listbox{border:1px solid #cfeff5;border-radius:3px}.mec-fes-form .mce-tinymce.mce-container.mce-panel{border:1px solid #cfeff5;box-shadow:0 2px 6px -3px #cfeff5;border-radius:2px 0 2px 2px}.mec-fes-form .wp-editor-tools .wp-media-buttons{transform:translateY(-6px);margin-top:-6px}.mec-fes-form .wp-editor-tabs{padding-right:0;margin-right:-2px}.mec-fes-form .wp-editor-tabs .wp-switch-editor{border-radius:3px 3px 0 0;border-color:#cfeff5;background:#fff;color:#96b8bd;border-bottom:1px solid #ecfcff}.mec-fes-form .html-active .switch-html,.mec-fes-form .tmce-active .switch-tmce,.mec-fes-form .wp-editor-tabs .wp-switch-editor:active{background:#ecfcff;color:#40d9f1}.mec-fes-form .wp-editor-container,.mec-fes-form div.mce-edit-area.mce-panel{border:none;box-shadow:none}.mec-fes-form .wp-editor-container textarea.wp-editor-area{max-width:100%}.mec-fes-form .mce-toolbar .mce-listbox button{font-size:12px;line-height:22px;color:#798f96}.mec-fes-form .mce-toolbar .mce-ico{color:#627f88}.mec-fes-form .mce-toolbar .mce-btn-group .mce-btn.mce-active,.mec-fes-form .mce-toolbar .mce-btn-group .mce-btn:active,.mec-fes-form .qt-dfw.active{background:#fff;border-color:#40d9f1;box-shadow:inset 0 2px 6px -3px rgba(106,231,255,.7)}.mec-fes-form .mce-toolbar .mce-btn-group .mce-btn.mce-active .mce-ico{color:#40d9f1}body .mce-menu .mce-menu-item.mce-active.mce-menu-item-normal,body .mce-menu .mce-menu-item.mce-selected,body .mce-menu .mce-menu-item:focus,body .mce-menu .mce-menu-item:hover,body.mce-menu .mce-menu-item.mce-active.mce-menu-item-preview{background:#40d9f1;color:#fff}.mec-fes-form .mec-not-in-days-day{display:inline-block;padding:4px 32px 4px 15px;border-radius:33px;border:1px solid #cfeff5;box-shadow:0 1px 3px -1px #cfeff5;background:#fbfeff;color:#40d9f1;vertical-align:top}.mec-fes-form .mec-not-in-days-remove{display:inline-block;padding:0 1px 0 0;margin-left:-30px;vertical-align:sub;background:#ff918a;color:#fff;font-family:cursive;width:21px;height:21px;line-height:17px;text-align:center;border-radius:20px;cursor:pointer}.mec-fes-list ul li .mec-event-status{float:left;margin-right:10px;margin-left:0;font-size:11px;font-weight:400;letter-spacing:.3px;border-radius:3px;padding:4px 8px}.mec-fes-form .post-status.mec-book-confirmed:before,.mec-fes-list ul li .mec-event-status.mec-book-confirmed:before{content:"";margin:0;vertical-align:middle;line-height:1;border-right:2px solid #fff!important;border-bottom:2px solid #fff!important;transform:rotate(45deg);color:#fff;width:6px;height:12px;float:left;margin-right:6px}.mec-fes-list ul li .mec-fes-event-edit a:before,.mec-fes-list ul li .mec-fes-event-export a:before,.mec-fes-list ul li .mec-fes-event-remove:before,.mec-fes-list ul li .mec-fes-event-view a:before,.mec-fes-list-top-actions a:before{content:"\e054";font-family:simple-line-icons;font-size:13px;vertical-align:middle}.mec-fes-list ul li .mec-fes-event-view a:before{content:"\e087"}.mec-fes-list ul li .mec-fes-event-edit a:before{content:"\e060"}.mec-fes-list-top-actions a:before{content:"\e095";font-weight:400;margin-right:6px}.mec-fes-list ul li .mec-fes-event-export a:before{content:"\e083"}.mec-fes-form .post-status{border-radius:20px}.mec-fes-form .post-status.mec-book-confirmed:before{height:20px;width:9px;margin:3px 10px}.ui-datepicker .ui-datepicker-calendar td,.ui-datepicker-calendar th{height:auto;padding:0}.ui-datepicker .ui-datepicker-calendar td a,.ui-datepicker-calendar th{font-size:14px;line-height:30px}.ui-datepicker.ui-widget .ui-state-disabled .ui-state-default{color:#ccc;width:30px;height:30px;line-height:30px;display:inline-block}.mec-fes-form .description{font-size:16px}.mec-fes-form input[type=file]{text-align:left}.mec-fes-export-wrapper{width:640px;background:#f8feff;padding:40px 25px}.mec-fes-export-wrapper .mec-fes-btn-date{font-size:16px;line-height:44px;overflow:hidden}.mec-fes-export-wrapper .date-messgae{font-family:sans-serif;padding:2px 18px}.mec-fes-list ul li .mec-event-export-csv,.mec-fes-list ul li .mec-event-export-excel{font-size:12px;border:1px solid #40d9f1;padding:1px 4px;background:rgba(141,229,243,.18);border-radius:4px;color:#40d9f1;font-family:sans-serif;cursor:pointer;display:inline-block;height:26px;line-height:22px}.mec-export-badge{font-size:11px;color:#40d9f1;width:auto;height:24px;line-height:25px;display:inline-block;padding:0 8px;text-align:center;border-radius:3px;background:#ecfcff;transition:all .2s ease}.mec-fes-list ul li .mec-fes-event-export{font-size:11px;background:#f7f7f7;float:right;margin-left:5px}.mec-fes-list ul li .mec-fes-event-export:hover{cursor:pointer;background:#90f0e0;border-color:#4dc8cc}.mec-fes-export-wrapper ul{padding:0;width:100%;text-align:center}.mec-fes-export-wrapper ul li{list-style:none;display:inline-block;width:30%;padding:10px 15px 10px 32px;border-radius:3px;margin-bottom:15px;border:1px solid #cfeff5;box-shadow:0 2px 6px -4px #cfeff5;background:#fff;line-height:normal;margin-right:10px;position:relative;cursor:pointer;font-size:13px;line-height:1;transition:all .2s ease}.mec-fes-export-wrapper ul li:nth-child(3n+0){margin-right:0}.mec-fes-export-wrapper ul li:hover{box-shadow:0 2px 16px -1px #c6e8ef}.mec-fes-export-wrapper ul li:before{content:"";position:absolute;display:inline-block;background:#fff;width:15px;height:15px;margin:-1px 0 0 5px;cursor:pointer;border:2px solid #e1e7ed;box-shadow:0 2px 15px -3px rgba(69,77,89,.32);border-radius:50%;left:9px;top:calc(50% - 7px)}.mec-fes-export-wrapper ul li.fes-export-date-active{color:#40d9f1}.mec-fes-export-wrapper ul li.fes-export-date-active:before{width:15px;height:15px;border:6px solid #40d9f1;background:#fff;box-shadow:0 3px 16px -3px #40d9f1}.mec-fes-btn-export{margin-left:15px;margin-top:12px}.mec-fes-btn-export span{position:relative;border:none;border-radius:3px;color:#fff!important;display:inline-block;font-size:13px;line-height:1;text-transform:none;font-weight:400;text-decoration:none;cursor:pointer;margin-right:4px;line-height:1;letter-spacing:0;padding:15px 22px;background:#39c36e;box-shadow:0 1px 7px -3px #39c36e!important;-webkit-transition:all .21s ease;-moz-transition:all .21s ease;transition:all .21s ease;cursor:pointer;margin-left:6px}.mec-fes-btn-export span:hover{background:#222}.mec-event-export-excel:before,span.mec-event-export-csv:before{content:"\e083";font-family:simple-line-icons;font-size:13px;vertical-align:middle;margin-right:7px;margin-top:-1px;display:inline-block}.mec-fes-list .wn-p-t-right{min-width:170px;max-width:200px;display:inline-block;top:-8px;left:50%;margin-top:0;transform:translate(-50%,-100%);padding:0;background-color:#000;color:#fff;font-weight:400;font-size:14px;letter-spacing:.5px;line-height:1.5;position:absolute;z-index:99999999;box-sizing:border-box;border-radius:6px;box-shadow:0 4px 45px -8px #535a61;visibility:hidden;opacity:0;transition:opacity .23s;padding:5px 10px 6px;border-radius:8px;text-align:center;font-style:normal}.mec-fes-list .mec-fes-event-edit:hover .wn-p-t-right,.mec-fes-list .mec-fes-event-export:hover .wn-p-t-right,.mec-fes-list .mec-fes-event-remove:hover .wn-p-t-right,.mec-fes-list .mec-fes-event-view:hover .wn-p-t-right{visibility:visible;opacity:1}.mec-fes-list .wn-p-t-right i{position:absolute!important;top:100%;right:50%;margin-top:-6px!important;margin-right:-6px!important;width:12px;height:24px;overflow:hidden;transform:rotate(-90deg)}.mec-fes-list .wn-p-t-right i:after{content:"";position:absolute;width:12px;height:12px;left:0;top:50%;transform:translate(50%,-50%) rotate(-45deg);background-color:#000;box-shadow:0 8px 9px -4px #535a61}.mec-fes-form .select2-container{min-height:38px;box-sizing:border-box;margin-bottom:8px;padding:0 6px;border-radius:2px;border:1px solid #ddd;box-shadow:inset 0 1px 6px rgba(0,0,0,.07);background-color:#fff;color:#32373c;outline:0;transition:50ms border-color ease-in-out;min-width:200px;font-size:14px}.mec-fes-form .select2-selection{border:none;background:0 0;padding-top:2px;width:100%;height:100%}.mec-fes-form .select2-container--default.select2-container--focus .select2-selection{border:none!important;outline:0}.mec-fes-form .select2-container--default .select2-selection--single .select2-selection__arrow{top:5px;right:4px}.select2-results{font-size:14px}.mec-fes-category-children,.mec-fes-category-children .mec-fes-category-children{padding-left:24px}.mec-timeline-events-container{margin-left:19px;padding-top:20px;padding-bottom:9px}.mec-events-timeline-wrap{position:relative;display:block;overflow:visible;padding-left:95px}.mec-events-timeline-wrap:before{width:1px;content:"";height:100%;position:absolute;background:#b8f5ff;left:95px}.mec-timeline-month-divider+.mec-timeline-events-container{padding-top:110px}.mec-timeline-right-content{float:right;width:300px}.mec-timeline-left-content{float:left;width:calc(100% - 300px);padding-left:15px;padding-right:15px;position:relative}.mec-timeline-month-divider{position:absolute;display:block;background:#fff;right:calc(100% - 95px);left:0;width:190px;text-align:center;border:1px solid #b8f5ff;border-radius:50px;font-size:15px;padding:12px 27px;color:#40d9f1}.mec-timeline-event-date{position:relative}.mec-timeline-events-container .mec-timeline-event-date:before{content:"";width:11px;height:11px;position:absolute;background:#40d9f1;border-radius:50px;top:8px;left:-24px;z-index:9}.mec-timeline-events-container .mec-timeline-event-date:after{content:"";width:21px;height:21px;position:absolute;background:rgba(64,217,241,.3);border-radius:50px;top:3px;left:-29px}.mec-timeline-event-date{float:left;width:17%;margin-top:27px}.mec-timeline-event-content{float:left;width:82%;background:#fff;box-shadow:0 10px 30px 0 rgba(0,0,0,.1);border-radius:10px;overflow:visible;position:relative}.mec-timeline-main-content{padding:23px 30px}.mec-timeline-main-content h4{margin-bottom:15px}.mec-timeline-main-content h4 a{font-size:25px;font-weight:700;color:#000;line-height:33px;text-decoration:none}.mec-timeline-main-content p{font-size:15px;color:#515151;line-height:24px;margin-bottom:36px}a.mec-timeline-readmore{width:100%;display:block;text-align:center;color:#fff;text-decoration:none;line-height:52px;font-size:17px;font-weight:700;-webkit-transition:all .2s ease;transition:all .2s ease;border-radius:0 0 10px 10px}a.mec-timeline-readmore:hover{background:#222;color:#fff}.mec-timeline-event-categories ul.mec-categories li.mec-category a,.mec-timeline-event-location address span,.mec-timeline-event-organizer .mec-organizer-item span,.mec-timeline-event-time .mec-time-details{display:inline-block;font-size:13px;font-weight:500;color:inherit}.mec-timeline-event-categories .mec-categories-wrapper,.mec-timeline-event-organizer .mec-shortcode-organizers{line-height:unset}.mec-timeline-event-categories,.mec-timeline-event-local-time,.mec-timeline-event-location,.mec-timeline-event-organizer,.mec-timeline-event-time{background:rgba(64,217,241,.11);display:inline-block;padding:0 20px;border-radius:50px;line-height:32px;vertical-align:middle}.mec-timeline-event-categories i,.mec-timeline-event-location i,.mec-timeline-event-organizer i,.mec-timeline-event-time i{font-size:16px;margin-right:6px;position:relative;top:2px}.mec-timeline-event-location address{font-style:normal;margin-bottom:0}.mec-timeline-event-details+.mec-timeline-event-details{margin-top:12px}.mec-timeline-event-content .col-md-4{padding:0}.mec-timeline-event-content:after{content:"";display:block;position:absolute;left:50%;margin-left:-10px;width:0;height:0;border-style:solid;border-width:10px}.mec-timeline-event-content:after{top:30px;border-color:transparent #fff transparent transparent;left:-10px}.mec-timeline-event-image img{border-radius:0 10px 0 0;width:100%}.mec-timeline-event-image a{display:block;line-height:0}a.mec-timeline-readmore i{vertical-align:middle;margin-left:10px;font-size:9px}.mec-wrap .mec-timeline-event-content a.mec-timeline-readmore:hover{background:#444}@media (min-width:1024px){.mec-timeline-event{margin:50px 0}}@media (max-width:1023px){.mec-timeline-event{margin:25px 0}.mec-events-timeline-wrap{padding-left:20px}.mec-events-timeline-wrap:before{left:20px}}@media (max-width:1200px) and (min-width:992px){.mec-timeline-event-content{width:81%}.mec-timeline-event-date{width:18%}}@media (max-width:992px){.mec-timeline-left-content,.mec-timeline-right-content{float:none;width:100%;text-align:center}.mec-timeline-right-content .mec-timeline-event-image{text-align:center}.mec-timeline-right-content .mec-timeline-event-image img{max-width:300px;border-radius:10px;margin-top:35px}}@media (max-width:440px){.mec-timeline-right-content .mec-timeline-event-image img{margin-top:0}}@media (max-width:320px){.mec-timeline-event-content,.mec-timeline-event-date{float:none;width:100%}.mec-timeline-event-date{margin-bottom:8px}.mec-timeline-event-content:after{display:none}.mec-timeline-main-content{padding:23px 0}.mec-timeline-main-content p{font-size:13px}.mec-timeline-main-content h4 a{font-size:23px;line-height:24px}.mec-time-details span{font-size:11px}.mec-timeline-event-location address span{font-size:12px}a.mec-timeline-readmore{line-height:44px;font-size:14px}}.mec-timeline-event-image img{margin-bottom:-7px;border-radius:0 10px 10px 0}.mec-timeline-event-image a img{margin-bottom:0;border-radius:0 10px 0 0}.mec-event-tile-view article.mec-tile-item{height:400px;margin:15px 0;border-radius:22px;padding:35px 25px;position:relative;color:#fff;background-size:cover!important;background-position:center!important;box-shadow:0 2px 9px rgba(0,0,0,.25);transition:all .22s ease}.mec-event-tile-view article.mec-tile-item:hover{cursor:pointer;box-shadow:0 4px 19px rgba(0,0,0,.5)}.mec-event-tile-view article.mec-tile-item div{position:relative;z-index:3;line-height:1.5}.mec-event-tile-view article.mec-tile-item .mec-categories-wrapper{color:#fff}.mec-event-tile-view article.mec-tile-item .mec-categories-wrapper i{font-size:16px}.mec-event-tile-view article.mec-tile-item .mec-categories-wrapper ul.mec-categories li.mec-category a,.mec-event-tile-view article.mec-tile-item .mec-shortcode-organizers{color:#fff;font-size:15px}.mec-event-tile-view article.mec-tile-item .mec-categories-wrapper,.mec-event-tile-view article.mec-tile-item .mec-event-loc-place,.mec-event-tile-view article.mec-tile-item .mec-shortcode-organizers{margin-bottom:5px}.mec-event-tile-view article.mec-tile-item:after,.mec-event-tile-view article.mec-tile-item:before{position:absolute;background:-moz-linear-gradient(180deg,rgba(0,0,0,.35) 0,rgba(0,0,0,.48) 65%,rgba(0,0,0,.72) 100%);background:-webkit-gradient(left top,right top,color-stop(0,rgba(0,0,0,.35)),color-stop(65%,rgba(0,0,0,.48)),color-stop(100%,rgba(0,0,0,.72)));background:-webkit-gradient(180deg,rgba(0,0,0,.35) 0,rgba(0,0,0,.48) 65%,rgba(0,0,0,.72) 100%);background:linear-gradient(180deg,rgba(0,0,0,.35) 0,rgba(0,0,0,.48) 65%,rgba(0,0,0,.72) 100%);content:"";left:0;right:0;bottom:0;top:0;width:100%;height:100%;display:block;border-radius:22px;z-index:1}.mec-event-tile-view article.mec-tile-item:after{background-color:inherit;background-image:none;top:35px;bottom:auto;height:40px;border-radius:0 3px 3px 0;width:110px;z-index:2;box-shadow:2px 1px 7px rgba(0,0,0,.1)}.mec-event-tile-view article.mec-tile-item .event-tile-view-head{padding:8px 3px;font-size:16px;font-weight:700;margin-bottom:50px;text-transform:uppercase}.mec-event-tile-view article.mec-tile-item .event-tile-view-head>div{display:inline}.mec-event-tile-view article.mec-tile-item .mec-event-time{color:#d6d6d6;font-size:15px;font-weight:400;line-height:1;padding-top:4px;position:absolute;right:1px;top:10px}.mec-event-tile-view article.mec-tile-item .mec-event-time i{vertical-align:baseline;font-size:14px;float:left}.mec-event-tile-view article.mec-tile-item i{margin-right:5px}.mec-event-tile-view article.mec-tile-item .mec-event-title{color:#fff;font-weight:700;font-size:23px;padding-top:12px}.mec-event-tile-view article.mec-tile-item .mec-event-title a{color:#fff}.mec-event-tile-view article.mec-tile-item .mec-event-title a:hover{text-decoration:underline}.mec-event-tile-view article.mec-tile-item .mec-event-content{position:absolute;height:100%;bottom:0;left:0;right:0}.mec-event-tile-view article.mec-tile-item .mec-tile-into-content-link{position:absolute;content:"";top:0;right:0;left:0;bottom:0;background:0 0}.mec-tile-event-content{position:absolute!important;bottom:25px;left:25px;right:25px}.mec-event-tile-view article.mec-label-canceled:before,.mec-event-tile-view article.mec-label-featured:before{height:auto}.mec-skin-tile-month-navigator-container{position:relative;text-align:center;font-size:12px;height:80px;background:#f7f7f7;padding:28px;border-radius:11px;margin-bottom:20px}.mec-skin-tile-month-navigator-container:after,.mec-skin-tile-month-navigator-container:before{content:"";display:block;position:absolute;left:50%;margin-left:-10px;width:0;height:0;border-style:solid;border-width:10px}.mec-skin-tile-month-navigator-container:after{bottom:-20px;border-color:#f7f7f7 transparent transparent transparent}.mec-skin-tile-month-navigator-container:before{bottom:-21px;border-color:#fff transparent transparent transparent}@media only screen and (max-width:480px){.mec-skin-tile-month-navigator-container{height:110px;padding-top:68px}}.mec-skin-tile-month-navigator-container h2{font-size:23px;font-weight:700}.mec-skin-tile-month-navigator-container .mec-next-month,.mec-skin-tile-month-navigator-container .mec-previous-month{position:absolute;top:28px;left:20px;cursor:pointer;padding:3px 12px;line-height:23px;background:#fff;border-radius:32px;box-shadow:0 1px 3px rgba(0,0,0,.02);transition:all .22s ease}.mec-skin-tile-month-navigator-container .mec-next-month{left:auto;right:20px}.mec-skin-tile-month-navigator-container .mec-next-month:hover,.mec-skin-tile-month-navigator-container .mec-previous-month:hover{box-shadow:0 2px 5px rgba(0,0,0,.1);color:#000}.mec-wrap .mec-event-tile-view article.mec-label-canceled:before,.mec-wrap .mec-event-tile-view article.mec-label-featured:before{position:absolute;bottom:auto;text-align:center;right:auto;font-size:10px}.mec-event-tile-view article.mec-tile-item .mec-tile-overlay{position:absolute;background:-moz-linear-gradient(180deg,rgba(0,0,0,.35) 0,rgba(0,0,0,.48) 65%,rgba(0,0,0,.72) 100%);background:-webkit-gradient(left top,right top,color-stop(0,rgba(0,0,0,.35)),color-stop(65%,rgba(0,0,0,.48)),color-stop(100%,rgba(0,0,0,.72)));background:-webkit-gradient(180deg,rgba(0,0,0,.35) 0,rgba(0,0,0,.48) 65%,rgba(0,0,0,.72) 100%);background:linear-gradient(180deg,rgba(0,0,0,.35) 0,rgba(0,0,0,.48) 65%,rgba(0,0,0,.72) 100%);content:"";left:0;right:0;bottom:0;top:0;width:100%;height:100%;display:block;border-radius:22px;z-index:1}.mec-wrap .mec-event-tile-view .col-md-3 article.mec-label-canceled:before,.mec-wrap .mec-event-tile-view .col-md-3 article.mec-label-featured:before{top:12px;left:103px;z-index:9}.mec-wrap .mec-event-tile-view .col-md-4 article.mec-label-canceled:before,.mec-wrap .mec-event-tile-view .col-md-4 article.mec-label-featured:before{top:18px;left:125px}.mec-wrap .mec-event-tile-view .col-md-6 article.mec-label-canceled:before,.mec-wrap .mec-event-tile-view .col-md-6 article.mec-label-featured:before{top:20px;left:200px}@media (max-width:960px){.mec-wrap .mec-event-tile-view .col-sm-3{width:50%}}@media (max-width:480px){.mec-wrap .mec-event-tile-view .col-sm-3{width:100%}}.mec-event-tile-view article.mec-tile-item.tile-multipleday-event:after{width:185px}.mec-event-tile-view article.mec-tile-item.tile-multipleday-event .mec-event-time{right:auto;top:50px;left:0}.mec-event-tile-view .col-md-6.col-sm-6 article.mec-label-canceled:before{top:100px;left:140px}.mec-event-tile-view .col-md-4.col-sm-4 article.mec-label-canceled:before{top:20px;left:140px}@media (min-width:761px) and (max-width:1200px){.mec-event-tile-view .col-md-3.col-sm-3{width:50%}.mec-event-tile-view .col-md-6.col-sm-6 article.mec-label-canceled:before{top:80px;left:90px}.mec-event-tile-view .col-md-4.col-sm-4 article.mec-label-canceled:before{top:40px;left:70px}.mec-event-tile-view .col-md-3.col-sm-3 article.mec-label-canceled:before{top:90px;left:110px}}@media (min-width:761px) and (max-width:1024px){.mec-event-tile-view .col-md-4.col-sm-4{width:50%}.mec-event-tile-view .col-md-4.col-sm-4:nth-child(1n+3){width:100%}}@media (max-width:760px){.mec-event-tile-view .col-md-3.col-sm-3{width:100%}.mec-event-tile-view .col-md-4.col-sm-4{width:100%}}@media (max-width:480px){.mec-event-tile-view .col-md-6.col-sm-6 article.mec-label-canceled:before{top:100px;left:80px}}.mec-calendar .mec-event-article .mec-event-date{font-size:12px;text-align:left}.mec-event-detailed-time{display:flex}.mec-event-detailed-time i{width:15px;padding-top:7px}.mec-ongoing-normal-label{background-color:#40d9f1}.mec-expired-normal-label{background-color:#000}.mec-wrap .mec-cancellation-reason span,.mec-wrap .mec-labels-normal .mec-label-normal{position:relative;font-size:11px;font-weight:300;margin-left:10px;line-height:1.9;letter-spacing:1px;color:#fff;padding:2px 7px;border-radius:2px;white-space:nowrap}.mec-wrap .mec-cancellation-reason span,.mec-wrap .mec-labels-normal .mec-label-normal{white-space:normal;display:inline-block;line-height:14px}.mec-remaining-time-normal-label{background-color:var(--mec-color-skin)}.mec-agenda-event-title .mec-labels-normal .mec-label-normal,.mec-timetable-event .mec-labels-normal .mec-label-normal,.tooltipster-box .mec-labels-normal .mec-label-normal{font-size:9px;letter-spacing:.5px;text-transform:uppercase;padding:2px 7px;color:#fff;position:relative;margin-left:5px;border-radius:2px;top:0}.mec-av-spot .mec-labels-normal .mec-label-normal,.mec-event-countdown-part1 .mec-labels-normal .mec-label-normal,.mec-event-countdown-part2 .mec-labels-normal .mec-label-normal,.mec-event-cover-modern .mec-labels-normal .mec-label-normal,.mec-masonry-content .mec-labels-normal .mec-label-normal,.mec-owl-carousel:not(.mec-slider-t1) .mec-labels-normal .mec-label-normal,.mec-tile-item .mec-labels-normal .mec-label-normal,.mec-timeline-event .mec-labels-normal .mec-label-normal,.tooltipster-box .mec-labels-normal .mec-label-normal{margin:0 5px 0 0}.mec-event-countdown-style3 .mec-labels-normal .mec-label-normal{margin:0 0 0 5px}.mec-event-footer-carousel-type3 .mec-labels-normal .mec-label-normal{display:inline}.mec-event-carousel-type4 .mec-fc-style{display:none}.mec-event-carousel-type4 .mec-labels-normal{top:-20px;position:relative}.mec-wrap .mec-cancellation-reason{display:inline-block}.mec-wrap .mec-cancellation-reason span{line-height:1.3;background:#eb3450;text-transform:none;display:inline-block;white-space:nowrap}.mec-wrap .mec-event-list-accordion .mec-cancellation-reason span,.mec-wrap .mec-event-list-accordion .mec-labels-normal .mec-label-normal{top:7px}.mec-agenda-event-title .mec-cancellation-reason span,.mec-timetable-event .mec-cancellation-reason span,.tooltipster-box .mec-cancellation-reason span{font-size:9px;letter-spacing:.5px;text-transform:uppercase;padding:2px 7px;color:#fff;position:relative;margin-left:5px;border-radius:2px;top:0}.mec-wrap .mec-event-container-novel .mec-cancellation-reason span,.mec-wrap .mec-event-container-novel .mec-labels-normal .mec-label-normal{white-space:inherit;margin-left:0}.mec-wrap .mec-event-container-simple .mec-cancellation-reason span,.mec-wrap .mec-event-container-simple .mec-labels-normal .mec-label-normal{top:-5px;white-space:inherit;margin-left:0;margin-right:3px}.mec-av-spot .mec-cancellation-reason span,.mec-event-countdown-part1 .mec-cancellation-reason span,.mec-event-countdown-part2 .mec-cancellation-reason span,.mec-event-cover-modern .mec-cancellation-reason span,.mec-masonry-content .mec-cancellation-reason span,.mec-owl-carousel:not(.mec-slider-t1) .mec-cancellation-reason span,.mec-tile-item .mec-cancellation-reason span,.mec-timeline-event .mec-cancellation-reason span,.tooltipster-box .mec-cancellation-reason span{margin:0 5px 0 0}.mec-owl-carousel .mec-event-footer-carousel-type3 span.mec-event-title-soldout,.mec-owl-carousel .mec-event-footer-carousel-type3 span.mec-few-tickets{display:inline}.mec-owl-carousel .mec-event-footer-carousel-type3 span.mec-labels-normal,.mec-owl-carousel .mec-event-footer-carousel-type3 span.soldout{margin-top:0;color:#fff;display:unset}.mec-wrap .mec-single-event .mec-cancellation-reason span{margin:0;padding:6px 12px;font-size:14px;font-weight:700;white-space:normal;word-break:break-word}.featherlight-content .mec-cancellation-reason{display:block;width:100%;text-align:center;margin-top:20px;margin-bottom:-10px}.mec-event-data-fields{margin-bottom:30px}.mec-event-data-fields ul.mec-event-data-field-items{overflow:hidden;padding-top:10px;padding-left:0;margin-left:0}.mec-event-data-fields .mec-event-data-field-item{list-style:none;margin-bottom:10px;border-bottom:1px dashed #e1e2e3;padding-bottom:8px;width:100%;float:left}.mec-event-data-fields .mec-event-data-field-item .mec-event-data-field-value{margin:0 0 8px 0;color:#616263!important;font-size:13px;line-height:1.5;word-wrap:break-word;white-space:break-spaces}.mec-event-data-fields .mec-event-data-field-item:last-child{border:none;width:100%}.mec-event-data-fields .mec-event-data-field-item .mec-event-data-field-name{text-transform:none;font-size:13px;font-weight:600;padding-bottom:5px;color:#313131!important;width:100%;padding-bottom:10px;position:relative;letter-spacing:-.2px}@media (max-width:768px){.mec-event-data-fields .mec-event-data-field-item{width:100%}}.mec-wrap .col-md-4 .mec-event-data-fields .mec-event-data-field-item{width:100%;display:block}.mec-shortcode-organizers{overflow:hidden;font-weight:400;line-height:18px;font-size:12px}.mec-event-list-minimal .mec-shortcode-organizers{margin-top:6px}.mec-shortcode-organizers i{margin-right:4px;display:inline-block}.mec-shortcode-organizers .mec-organizers{display:inline-block;list-style:none;padding:0}.mec-organizer-item a{color:#777}.mec-event-list-standard .mec-shortcode-organizers .mec-sl-user:before{font-size:16px}.mec-shortcode-organizers{position:relative}.mec-skin-grid-container .mec-organizers,.mec-skin-grid-container .mec-shortcode-organizers{padding:0;margin:0}.mec-skin-grid-container .mec-event-grid-clean .mec-shortcode-organizers a,.mec-skin-grid-container .mec-event-grid-clean .mec-shortcode-organizers a:hover,.mec-skin-grid-container .mec-event-grid-colorful .mec-shortcode-organizers a,.mec-skin-grid-container .mec-event-grid-colorful .mec-shortcode-organizers a:hover{color:#fff;font-size:12px}.mec-skin-grid-container .mec-event-grid-clean .mec-shortcode-organizers a:hover,.mec-skin-grid-container .mec-event-grid-colorful .mec-shortcode-organizers a:hover{text-decoration:underline}.mec-skin-grid-container .mec-event-grid-novel .mec-shortcode-organizers{position:relative}.mec-skin-grid-container .mec-event-grid-novel .mec-shortcode-organizers i{display:block;color:rgba(255,255,255,.4)}.mec-skin-grid-container .mec-event-grid-novel .mec-shortcode-organizers i:before{position:absolute;top:6px;left:6px;font-size:17px;font-family:simple-line-icons;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1}.mec-skin-grid-container .mec-event-grid-novel .mec-shortcode-organizers a{padding-left:35px;font-size:15px;line-height:30px;color:rgba(255,255,255,.4)}.mec-skin-grid-container .mec-event-grid-novel .mec-shortcode-organizers a:hover{color:#fff}.mec-calendar-daily .mec-shortcode-organizers,.mec-calendar-daily .mec-shortcode-organizers .mec-organizers{padding:0}.mec-calendar-daily .mec-organizer-item a{font-size:13px;line-height:1.3;color:#9a9a9a;margin-bottom:0}.mec-events-masonry-wrap .mec-shortcode-organizers,.mec-events-masonry-wrap .mec-shortcode-organizers .mec-organizers{padding:0}.mec-events-timeline-wrap .mec-organizer-item,.mec-events-timeline-wrap .mec-shortcode-organizers .mec-organizers{margin:0;display:inline}.mec-events-timeline-wrap .mec-shortcode-organizers i{line-height:24px;margin-right:7px}.mec-events-timeline-wrap .mec-organizer-item:after{content:","}.mec-events-timeline-wrap .mec-organizer-item:last-child:after{content:"";padding:0}.mec-events-timeline-wrap .mec-organizer-item a,.mec-events-timeline-wrap .mec-organizer-item:after{font-weight:500}.mec-events-timeline-wrap .mec-organizer-item a:hover{text-decoration:underline}.mec-event-tile-view .mec-shortcode-organizers,.mec-event-tile-view .mec-shortcode-organizers .mec-organizers{padding:0}.mec-event-tile-view .mec-shortcode-organizers i{line-height:24px}.mec-event-tile-view .mec-shortcode-organizers .mec-organizers a,.mec-event-tile-view .mec-shortcode-organizers i{color:#fff}.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-d-table .mec-modal-preloader,.mec-dark-mode .mec-month-navigator-loading{background-color:rgba(40,40,40,.88)}.mec-dark-mode .event-carousel-type2-head .mec-event-footer-carousel-type2 .mec-booking-button,.mec-dark-mode .mec-box-calendar.mec-calendar.mec-event-calendar-classic .mec-calendar-table-head dt,.mec-dark-mode .mec-calendar .mec-calendar-row dt:hover,.mec-dark-mode .mec-event-footer .mec-booking-button,.mec-dark-mode .mec-event-grid-classic .mec-event-content,.mec-dark-mode .mec-event-schedule-content .mec-schedule-speakers,.mec-dark-mode .mec-events-meta-group-tags a:hover,.mec-dark-mode .mec-events-toggle .mec-toggle-content .mec-modal-wrap,.mec-dark-mode .mec-fes-form .mec-meta-box-fields,.mec-dark-mode .mec-hourly-schedule-speaker-contact-information a i,.mec-dark-mode .mec-map-view-event-detail.mec-event-detail,.mec-dark-mode .mec-modal-wrap,.mec-dark-mode .mec-next-event-details a,.mec-dark-mode .mec-organizer-social-information a i,.mec-dark-mode .mec-single-event .mec-event-exporting .mec-export-details a:hover,.mec-dark-mode .mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-next,.mec-dark-mode .mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-prev,.mec-dark-mode .mec-timetable-events-list .mec-timetable-event,.mec-dark-mode .mec-wrap .button,.mec-dark-mode .mec-wrap a.button:not(.owl-dot):hover,.mec-dark-mode .mec-wrap button:not(.owl-dot):hover,.mec-dark-mode .mec-wrap input[type=button]:hover,.mec-dark-mode .mec-wrap input[type=reset]:hover,.mec-dark-mode .mec-wrap input[type=submit]:hover{background-color:#1f1f1f;color:#d2d2d2}.mec-dark-mode .mec-modal-wrap::-webkit-scrollbar{width:12px}.mec-dark-mode .mec-modal-wrap::-webkit-scrollbar-track{background:#000}.mec-dark-mode .mec-modal-wrap::-webkit-scrollbar-thumb{background-color:#333;border-radius:20px;border:2px solid #000}.mec-dark-mode .mec-modal-preloader,.mec-dark-mode .mec-month-navigator-loading{background-color:#1f1f1f}.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-d-table,.mec-dark-mode .mec-skin-tile-month-navigator-container{background:#282828}.mec-dark-mode .mec-skin-tile-month-navigator-container:after{border-color:#282828 transparent transparent transparent}.mec-dark-mode .mec-event-grid-novel .mec-event-article,body.mec-dark-mode .mec-single-modern .mec-single-event-bar{background-color:#282828;color:#d2d2d2}.mec-dark-mode .event-carousel-type2-head,.mec-dark-mode .lity-content .mec-events-meta-group-booking .mec-dark-mode .mec-single-event .mec-events-meta-group-booking,.mec-dark-mode .lity-content .mec-events-meta-group-booking input[type=date],.mec-dark-mode .lity-content .mec-events-meta-group-booking input[type=email],.mec-dark-mode .lity-content .mec-events-meta-group-booking input[type=number],.mec-dark-mode .lity-content .mec-events-meta-group-booking input[type=password],.mec-dark-mode .lity-content .mec-events-meta-group-booking input[type=tel],.mec-dark-mode .lity-content .mec-events-meta-group-booking input[type=text],.mec-dark-mode .lity-content .mec-events-meta-group-booking select,.mec-dark-mode .lity-content .mec-events-meta-group-booking textarea,.mec-dark-mode .mec-box-calendar.mec-calendar .mec-calendar-table-head dt,.mec-dark-mode .mec-calendar .mec-calendar-side .mec-next-month,.mec-dark-mode .mec-calendar .mec-calendar-side .mec-previous-month,.mec-dark-mode .mec-calendar .mec-event-article:hover,.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-a-month,.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-d-table .mec-daily-view-day,.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-d-table a,.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-d-table a.mec-table-d-next,.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-d-table a.mec-table-d-prev,.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-d-table dl dt,.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-next-month,.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-previous-month,.mec-dark-mode .mec-calendar.mec-event-calendar-classic .mec-calendar-events-sec .mec-event-article:hover,.mec-dark-mode .mec-calendar.mec-event-calendar-classic .mec-selected-day,.mec-dark-mode .mec-calendar.mec-event-calendar-classic dt.mec-selected-day:hover,.mec-dark-mode .mec-calendar.mec-yearly-calendar .mec-calendar-table-head dl dt,.mec-dark-mode .mec-event-carousel-content,.mec-dark-mode .mec-event-cost,.mec-dark-mode .mec-event-countdown-style1 .mec-event-countdown-part3 .mec-event-button,.mec-dark-mode .mec-event-footer,.mec-dark-mode .mec-event-grid-classic .mec-event-content .mec-wrap .mec-totalcal-box .mec-totalcal-view span,.mec-dark-mode .mec-event-list-minimal a.mec-detail-button,.mec-dark-mode .mec-event-list-modern .mec-btn-wrapper .mec-booking-button,.mec-dark-mode .mec-event-list-standard .mec-topsec,.mec-dark-mode .mec-event-more-info,.mec-dark-mode .mec-event-website,.mec-dark-mode .mec-events-agenda-wrap,.mec-dark-mode .mec-events-meta-date,.mec-dark-mode .mec-events-meta-group-tags a,.mec-dark-mode .mec-events-toggle .mec-toggle-item-inner,.mec-dark-mode .mec-fes-form,.mec-dark-mode .mec-fes-form input[type=email],.mec-dark-mode .mec-fes-form input[type=number],.mec-dark-mode .mec-fes-form input[type=password],.mec-dark-mode .mec-fes-form input[type=tel],.mec-dark-mode .mec-fes-form input[type=text],.mec-dark-mode .mec-fes-form select,.mec-dark-mode .mec-fes-form textarea,.mec-dark-mode .mec-fes-list,.mec-dark-mode .mec-hourly-schedule-speaker-info,.mec-dark-mode .mec-load-more-button,.mec-dark-mode .mec-map-lightbox-wp,.mec-dark-mode .mec-masonry-item-wrap .mec-event-grid-modern .event-grid-modern-head,.mec-dark-mode .mec-related-event-content,.mec-dark-mode .mec-single-event .mec-event-exporting .mec-export-details a,.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=date],.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=email],.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=number],.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=password],.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=tel],.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=text],.mec-dark-mode .mec-single-event .mec-events-meta-group-booking select,.mec-dark-mode .mec-single-event .mec-events-meta-group-booking textarea,.mec-dark-mode .mec-single-event .mec-events-meta-group-countdown,.mec-dark-mode .mec-single-event .mec-frontbox,.mec-dark-mode .mec-single-event .mec-speakers-details ul li,.mec-dark-mode .mec-single-event-additional-organizers,.mec-dark-mode .mec-single-event-category,.mec-dark-mode .mec-single-event-date,.mec-dark-mode .mec-single-event-label,.mec-dark-mode .mec-single-event-location,.mec-dark-mode .mec-single-event-organizer,.mec-dark-mode .mec-single-event-sponsor,.mec-dark-mode .mec-single-event-time,.mec-dark-mode .mec-single-modern .col-md-4 .mec-frontbox,.mec-dark-mode .mec-slider-t1-wrap,.mec-dark-mode .mec-timetable-events-list .mec-timetable-event,.mec-dark-mode .mec-timetable-t2-wrap,.mec-dark-mode .mec-ttt2-title,.mec-dark-mode .mec-wrap .mec-event-countdown-style1,.mec-dark-mode .mec-wrap .mec-event-countdown-style2,.mec-dark-mode .mec-wrap .mec-totalcal-box,.mec-dark-mode .mec-wrap .mec-totalcal-box i,.mec-dark-mode .mec-wrap .mec-totalcal-box input,.mec-dark-mode .mec-wrap .mec-totalcal-box select,.mec-dark-mode .mec-yearly-view-wrap .mec-yearly-title-sec .mec-next-year:hover,.mec-dark-mode .mec-yearly-view-wrap .mec-yearly-title-sec .mec-previous-year:hover,.mec-dark-mode.mec-wrap .mec-totalcal-box .mec-totalcal-view span,.mec-dark-mode.mec-wrap .mec-totalcal-box i,.mec-dark-mode.mec-wrap .mec-totalcal-box input,.mec-dark-mode.mec-wrap .mec-totalcal-box select{background-color:#282828}.mec-dark-mode .event-carousel-type2-head,.mec-dark-mode .event-carousel-type2-head .mec-event-footer-carousel-type2 .mec-booking-button,.mec-dark-mode .lity-content .mec-events-meta-group-booking .mec-dark-mode .mec-single-event .mec-events-meta-group-booking,.mec-dark-mode .lity-content .mec-events-meta-group-booking form>h4,.mec-dark-mode .lity-content .mec-events-meta-group-booking input[type=date],.mec-dark-mode .lity-content .mec-events-meta-group-booking input[type=email],.mec-dark-mode .lity-content .mec-events-meta-group-booking input[type=number],.mec-dark-mode .lity-content .mec-events-meta-group-booking input[type=password],.mec-dark-mode .lity-content .mec-events-meta-group-booking input[type=tel],.mec-dark-mode .lity-content .mec-events-meta-group-booking input[type=text],.mec-dark-mode .lity-content .mec-events-meta-group-booking select,.mec-dark-mode .lity-content .mec-events-meta-group-booking textarea,.mec-dark-mode .mec-box-calendar.mec-calendar .mec-calendar-side .mec-next-month,.mec-dark-mode .mec-box-calendar.mec-calendar .mec-calendar-side .mec-previous-month,.mec-dark-mode .mec-box-calendar.mec-calendar .mec-calendar-table-head dt,.mec-dark-mode .mec-box-calendar.mec-calendar dt,.mec-dark-mode .mec-box-calendar.mec-calendar.mec-event-calendar-classic .mec-calendar-table-head dt,.mec-dark-mode .mec-breadcrumbs,.mec-dark-mode .mec-calendar .mec-calendar-side .mec-next-month,.mec-dark-mode .mec-calendar .mec-calendar-side .mec-previous-month,.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-d-table .mec-daily-view-day,.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-d-table a,.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-d-table a.mec-table-d-next,.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-d-table a.mec-table-d-prev .mec-calendar.mec-calendar-daily .mec-calendar-a-month,.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-d-table dl dt,.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-next-month,.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-previous-month,.mec-dark-mode .mec-calendar.mec-event-calendar-classic .mec-calendar-events-sec,.mec-dark-mode .mec-event-carousel-content,.mec-dark-mode .mec-event-footer,.mec-dark-mode .mec-event-footer .mec-booking-button,.mec-dark-mode .mec-event-list-minimal .mec-event-article,.mec-dark-mode .mec-event-list-minimal a.mec-detail-button,.mec-dark-mode .mec-event-list-modern .mec-btn-wrapper .mec-booking-button,.mec-dark-mode .mec-event-list-modern .mec-event-article,.mec-dark-mode .mec-event-list-standard .mec-event-article,.mec-dark-mode .mec-event-list-standard .mec-event-meta-wrap,.mec-dark-mode .mec-event-list-standard .mec-topsec,.mec-dark-mode .mec-event-schedule-content,.mec-dark-mode .mec-event-schedule-content dl:before,.mec-dark-mode .mec-events-agenda-wrap,.mec-dark-mode .mec-events-meta-group-booking ul.mec-book-price-details,.mec-dark-mode .mec-events-meta-group-booking ul.mec-book-price-details li,.mec-dark-mode .mec-events-meta-group-tags a,.mec-dark-mode .mec-events-toggle .mec-toggle-content,.mec-dark-mode .mec-events-toggle .mec-toggle-item,.mec-dark-mode .mec-events-toggle .mec-toggle-item-inner,.mec-dark-mode .mec-fes-form .mec-meta-box-fields,.mec-dark-mode .mec-fes-form input[type=email],.mec-dark-mode .mec-fes-form input[type=number],.mec-dark-mode .mec-fes-form input[type=password],.mec-dark-mode .mec-fes-form input[type=tel],.mec-dark-mode .mec-fes-form input[type=text],.mec-dark-mode .mec-fes-form select,.mec-dark-mode .mec-fes-form textarea,.mec-dark-mode .mec-hourly-schedule-speaker-info,.mec-dark-mode .mec-load-more-button,.mec-dark-mode .mec-masonry-item-wrap .mec-event-grid-modern .event-grid-modern-head,.mec-dark-mode .mec-next-event-details a,.mec-dark-mode .mec-related-events-wrap h3.mec-rec-events-title,.mec-dark-mode .mec-single-event .mec-event-exporting .mec-export-details a:hover,.mec-dark-mode .mec-single-event .mec-events-meta-group-booking form>h4,.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=date],.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=email],.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=number],.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=password],.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=tel],.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=text],.mec-dark-mode .mec-single-event .mec-events-meta-group-booking select,.mec-dark-mode .mec-single-event .mec-events-meta-group-booking textarea,.mec-dark-mode .mec-single-event .mec-events-meta-group-countdown,.mec-dark-mode .mec-single-event .mec-frontbox,.mec-dark-mode .mec-single-event .mec-frontbox-title,.mec-dark-mode .mec-timetable-t2-wrap,.mec-dark-mode .mec-wrap .mec-totalcal-box,.mec-dark-mode .mec-wrap .mec-totalcal-box .mec-totalcal-view span,.mec-dark-mode .mec-wrap .mec-totalcal-box i,.mec-dark-mode .mec-wrap .mec-totalcal-box input,.mec-dark-mode .mec-wrap .mec-totalcal-box select,.mec-dark-mode .mec-yearly-view-wrap,.mec-dark-mode .mec-yearly-view-wrap .mec-yearly-title-sec{border-color:#353535}.mec-dark-mode .entry-content .mec-wrap h1,.mec-dark-mode .entry-content .mec-wrap h2,.mec-dark-mode .entry-content .mec-wrap h3,.mec-dark-mode .entry-content .mec-wrap h4,.mec-dark-mode .entry-content .mec-wrap h5,.mec-dark-mode .entry-content .mec-wrap h6,.mec-dark-mode .lity-content .mec-events-meta-group-booking form>h4,.mec-dark-mode .lity-content .mec-events-meta-group-booking h5 span,.mec-dark-mode .lity-content .mec-events-meta-group-booking input[type=date],.mec-dark-mode .lity-content .mec-events-meta-group-booking input[type=email],.mec-dark-mode .lity-content .mec-events-meta-group-booking input[type=number],.mec-dark-mode .lity-content .mec-events-meta-group-booking input[type=password],.mec-dark-mode .lity-content .mec-events-meta-group-booking input[type=tel],.mec-dark-mode .lity-content .mec-events-meta-group-booking input[type=text],.mec-dark-mode .lity-content .mec-events-meta-group-booking label,.mec-dark-mode .lity-content .mec-events-meta-group-booking select,.mec-dark-mode .lity-content .mec-events-meta-group-booking textarea,.mec-dark-mode .mec-breadcrumbs a,.mec-dark-mode .mec-calendar .mec-event-article .mec-event-title a,.mec-dark-mode .mec-calendar dt,.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-a-month .mec-next-month,.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-a-month .mec-previous-month,.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-d-table .mec-daily-view-day.mec-has-event,.mec-dark-mode .mec-calendar.mec-event-container-simple dl dt.mec-calendar-day,.mec-dark-mode .mec-event-carousel-content .mec-event-carousel-title a,.mec-dark-mode .mec-event-content p,.mec-dark-mode .mec-event-grid-classic .mec-event-title a,.mec-dark-mode .mec-event-grid-clean .mec-event-title a,.mec-dark-mode .mec-event-grid-minimal .mec-event-date span,.mec-dark-mode .mec-event-grid-minimal .mec-event-title a,.mec-dark-mode .mec-event-grid-modern .mec-event-title a,.mec-dark-mode .mec-event-grid-simple .mec-event-title a,.mec-dark-mode .mec-event-list-classic .mec-event-title a,.mec-dark-mode .mec-event-list-minimal .mec-event-title a,.mec-dark-mode .mec-event-list-minimal a.mec-detail-button,.mec-dark-mode .mec-event-list-modern .mec-btn-wrapper .mec-booking-button,.mec-dark-mode .mec-event-list-standard .mec-event-title a,.mec-dark-mode .mec-events-meta-group-booking ul.mec-book-price-details li,.mec-dark-mode .mec-events-meta-group-booking ul.mec-book-price-details li span.mec-book-price-detail-amount,.mec-dark-mode .mec-events-meta-group-tags a,.mec-dark-mode .mec-events-toggle .mec-toggle-item-inner i,.mec-dark-mode .mec-fes-form,.mec-dark-mode .mec-fes-form input[type=email],.mec-dark-mode .mec-fes-form input[type=number],.mec-dark-mode .mec-fes-form input[type=password],.mec-dark-mode .mec-fes-form input[type=tel],.mec-dark-mode .mec-fes-form input[type=text],.mec-dark-mode .mec-fes-form label,.mec-dark-mode .mec-fes-form select,.mec-dark-mode .mec-fes-form textarea,.mec-dark-mode .mec-fes-list,.mec-dark-mode .mec-hourly-schedule-speaker-contact-information a i,.mec-dark-mode .mec-hourly-schedule-speaker-description,.mec-dark-mode .mec-hourly-schedule-speaker-name,.mec-dark-mode .mec-load-more-button,.mec-dark-mode .mec-next-event-details abbr,.mec-dark-mode .mec-organizer-social-information a i,.mec-dark-mode .mec-related-event-content h5 a,.mec-dark-mode .mec-related-event-content span,.mec-dark-mode .mec-single-event .mec-event-meta dt,.mec-dark-mode .mec-single-event .mec-event-meta h3,.mec-dark-mode .mec-single-event .mec-events-meta-group-booking form>h4,.mec-dark-mode .mec-single-event .mec-events-meta-group-booking h5 span,.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=date],.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=email],.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=number],.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=password],.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=tel],.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=text],.mec-dark-mode .mec-single-event .mec-events-meta-group-booking label,.mec-dark-mode .mec-single-event .mec-events-meta-group-booking select,.mec-dark-mode .mec-single-event .mec-events-meta-group-booking textarea,.mec-dark-mode .mec-single-event .mec-frontbox-title,.mec-dark-mode .mec-single-event .mec-speakers-details ul li .mec-speaker-job-title,.mec-dark-mode .mec-single-modern .mec-single-event-bar>div h3,.mec-dark-mode .mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-next i,.mec-dark-mode .mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-prev i,.mec-dark-mode .mec-timeline-main-content h4 a,.mec-dark-mode .mec-timetable-event .mec-timetable-event-time,.mec-dark-mode .mec-timetable-events-list .mec-timetable-event span a,.mec-dark-mode .mec-tooltip-event-title,.mec-dark-mode .mec-ttt2-title,.mec-dark-mode .mec-wrap,.mec-dark-mode .mec-wrap .mec-event-list-modern .mec-event-title a,.mec-dark-mode .mec-wrap .mec-event-schedule-content a,.mec-dark-mode .mec-wrap .mec-single-title,.mec-dark-mode .mec-wrap .mec-totalcal-box .mec-totalcal-view span,.mec-dark-mode .mec-wrap .mec-totalcal-box input,.mec-dark-mode .mec-wrap .mec-totalcal-box select,.mec-dark-mode .mec-wrap h1,.mec-dark-mode .mec-wrap h2,.mec-dark-mode .mec-wrap h3,.mec-dark-mode .mec-wrap h4,.mec-dark-mode .mec-wrap h5,.mec-dark-mode .mec-wrap h6,.mec-dark-mode .mec-wrap p{color:#d2d2d2}.mec-dark-mode .mec-breadcrumbs a:hover,.mec-dark-mode .mec-calendar .mec-event-article .mec-event-title a:hover,.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-d-table .mec-daily-view-day.mec-has-event:hover,.mec-dark-mode .mec-event-footer .mec-booking-button:hover,.mec-dark-mode .mec-event-grid-classic .mec-event-title a:hover,.mec-dark-mode .mec-event-grid-minimal .mec-event-date:hover,.mec-dark-mode .mec-event-grid-minimal .mec-event-title a:hover,.mec-dark-mode .mec-event-list-classic .mec-event-title a:hover,.mec-dark-mode .mec-event-list-minimal .mec-event-title a:hover,.mec-dark-mode .mec-event-list-minimal a.mec-detail-button:hover,.mec-dark-mode .mec-event-list-modern .mec-btn-wrapper .mec-booking-button:hover,.mec-dark-mode .mec-event-list-standard .mec-event-title a:hover,.mec-dark-mode .mec-single-event .mec-event-meta dd a:hover,.mec-dark-mode .mec-wrap .mec-event-list-modern .mec-event-title a:hover,.mec-dark-mode .mec-wrap .mec-totalcal-box .mec-totalcal-view span:hover,.mec-dark-mode .mec-wrap a:hover{color:#fff}.mec-dark-mode .mec-fes-form .mec-attendees-wrapper .mec-attendees-list .w-clearfix:first-child{border-color:#333!important}.mec-dark-mode .mec-fes-form .mec-attendees-wrapper .mec-attendees-list .w-clearfix:nth-child(odd){background:#1f1f1f!important}.mec-dark-mode .mec-fes-form .mec-attendees-wrapper .mec-attendees-list .w-clearfix{background:#282828!important}.mec-dark-mode .lity-container .mec-events-meta-group-booking input[type=radio]:before,.mec-dark-mode .mec-related-events-wrap h3.mec-rec-events-title:before,.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=checkbox],.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=radio]:before{background-color:#c4cace}.mec-dark-mode .lity-container .mec-events-meta-group-booking input[type=radio]:before,.mec-dark-mode .mec-month-divider span,.mec-dark-mode .mec-related-events-wrap h3.mec-rec-events-title:before,.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=checkbox],.mec-dark-mode .mec-single-event .mec-events-meta-group-booking input[type=radio]:before{border-color:#313131}.mec-dark-mode .event-carousel-type3-head .mec-event-footer-carousel-type3,.mec-dark-mode .mec-agenda-events-wrap,.mec-dark-mode .mec-av-spot .mec-av-spot-content,.mec-dark-mode .mec-av-spot .mec-av-spot-head,.mec-dark-mode .mec-av-spot-wrap .mec-event-grid-modern .event-grid-modern-head,.mec-dark-mode .mec-calendar .mec-calendar-side .mec-next-month:hover,.mec-dark-mode .mec-calendar .mec-calendar-side .mec-previous-month:hover,.mec-dark-mode .mec-calendar .mec-calendar-topsec,.mec-dark-mode .mec-calendar .mec-event-article:hover,.mec-dark-mode .mec-calendar dt,.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-a-month .mec-next-month,.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-a-month .mec-previous-month,.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-d-table .mec-daily-view-day.mec-has-event:hover,.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-d-table a:hover,.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-d-top,.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-next-month:hover,.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-previous-month:hover,.mec-dark-mode .mec-calendar.mec-calendar-weekly .mec-calendar-d-table dl dt:hover,.mec-dark-mode .mec-calendar.mec-event-calendar-classic .mec-calendar-events-sec,.mec-dark-mode .mec-event-cover-classic,.mec-dark-mode .mec-event-footer .mec-booking-button:hover,.mec-dark-mode .mec-event-grid-clean .mec-event-article,.mec-dark-mode .mec-event-grid-clean .mec-event-content,.mec-dark-mode .mec-event-grid-modern .mec-event-article,.mec-dark-mode .mec-event-grid-modern .mec-event-content,.mec-dark-mode .mec-event-list-minimal a.mec-detail-button:hover,.mec-dark-mode .mec-event-list-modern .mec-btn-wrapper .mec-booking-button:hover,.mec-dark-mode .mec-event-sharing-wrap .mec-event-sharing,.mec-dark-mode .mec-events-toggle .mec-toggle-item-inner:hover,.mec-dark-mode .mec-hourly-schedule-speaker-contact-information a:hover i,.mec-dark-mode .mec-masonry .mec-masonry-content,.mec-dark-mode .mec-masonry .mec-masonry-head,.mec-dark-mode .mec-organizer-social-information a:hover i,.mec-dark-mode .mec-slider-t1 .mec-slider-t1-content,.mec-dark-mode .mec-slider-t5 .mec-slider-t5-content,.mec-dark-mode .mec-slider-t5-wrap,.mec-dark-mode .mec-slider-t5-wrap .mec-event-grid-modern .event-grid-modern-head,.mec-dark-mode .mec-timeline-event-content,.mec-dark-mode .mec-timeline-month-divider,.mec-dark-mode .mec-timetable-events-list .mec-timetable-event:hover,.mec-dark-mode .mec-wrap .mec-event-countdown-style1 .mec-event-countdown-part3,.mec-dark-mode .mec-wrap .mec-totalcal-box,.mec-dark-mode .mec-yearly-view-wrap .mec-calendar.mec-yearly-calendar,.mec-dark-mode .mec-yearly-view-wrap .mec-yearly-calendar-sec,.mec-dark-mode .mec-yearly-view-wrap .mec-yearly-title-sec .mec-next-year,.mec-dark-mode .mec-yearly-view-wrap .mec-yearly-title-sec .mec-previous-year,.mec-dark-mode .tooltipster-sidetip:not(.uael-tooltipster-active) .tooltipster-content{background:#191919}.mec-dark-mode .event-carousel-type3-head .mec-event-footer-carousel-type3,.mec-dark-mode .event-carousel-type3-head .mec-event-footer-carousel-type3 .mec-booking-button,.mec-dark-mode .mec-av-spot,.mec-dark-mode .mec-av-spot-wrap .mec-event-grid-modern .event-grid-modern-head,.mec-dark-mode .mec-box-calendar.mec-calendar dl dt:last-child,.mec-dark-mode .mec-calendar,.mec-dark-mode .mec-calendar .mec-event-article,.mec-dark-mode .mec-calendar.mec-box-calendar .mec-table-nullday:last-child,.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-a-month,.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-a-month .mec-next-month,.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-a-month .mec-previous-month,.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-calendar-d-table,.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-next-month:hover,.mec-dark-mode .mec-calendar.mec-calendar-daily .mec-previous-month:hover,.mec-dark-mode .mec-event-cover-classic,.mec-dark-mode .mec-event-cover-clean,.mec-dark-mode .mec-event-grid-classic .mec-event-article,.mec-dark-mode .mec-event-grid-clean .mec-event-article,.mec-dark-mode .mec-event-grid-modern .mec-event-article,.mec-dark-mode .mec-event-sharing-wrap .mec-event-sharing,.mec-dark-mode .mec-event-sharing-wrap .mec-event-sharing:after,.mec-dark-mode .mec-event-sharing-wrap>li:first-of-type,.mec-dark-mode .mec-events-agenda,.mec-dark-mode .mec-fes-form .mec-meta-box-fields,.mec-dark-mode .mec-masonry,.mec-dark-mode .mec-slider-t5-wrap .mec-event-grid-modern .event-grid-modern-head,.mec-dark-mode .mec-timeline-month-divider,.mec-dark-mode .mec-wrap .mec-totalcal-box,.mec-dark-mode .mec-yearly-view-wrap .mec-yearly-title-sec .mec-next-year,.mec-dark-mode .mec-yearly-view-wrap .mec-yearly-title-sec .mec-previous-year{border-color:#353535}.mec-dark-mode .mec-event-sharing-wrap .mec-event-sharing:after{border-color:#191919 transparent transparent transparent}.mec-dark-mode .mec-event-sharing-wrap .mec-event-sharing:before{border-color:#353535 transparent transparent transparent}.mec-dark-mode .mec-book-form-gateways [id*=mec_book_form_gateway_checkout] input[type=text],.mec-dark-mode .mec-events-meta-group-booking .StripeElement,.mec-dark-mode .mec-wrap .mec-book-form-gateways [id*=mec_book_form_gateway_checkout] input[type=email],.mec-dark-mode .mec-wrap .mec-book-form-gateways [id*=mec_book_form_gateway_checkout] input[type=text]{background:#999!important;border:1px solid #353535!important;box-shadow:none!important;color:#353535!important}.mec-dark-mode .CardField CardField--ltr .__PrivateStripeElement .InputContainer input{color:#d2d2d2!important}.mec-dark-mode .mec-events-toggle .mec-toggle-item{border:1px solid #e4e4e4;box-shadow:0 10px 15px #282828}.mec-dark-mode .mec-agenda-events-wrap .mec-event-grid-colorful .mec-event-content{background-color:transparent}.mec-dark-mode .mec-calendar .mec-calendar-side{box-shadow:0 1px 5px 6px rgba(255,255,255,.005) inset}.mec-dark-mode .tooltipster-sidetip.tooltipster-shadow:not(.uael-tooltipster-active) .tooltipster-box{border:1px solid #282828!important}.mec-dark-mode .mec-timeline-event-content:after{border-color:transparent #191919 transparent transparent}.mec-dark-mode .mec-fes-form .mec-meta-box-fields{box-shadow:0 2px 6px -3px #353535}.mec-dark-mode .mec-fes-form .mec-meta-box-fields h4{color:#d2d2d2;background:#000}.mec-dark-mode .mec-fes-form input[type=email],.mec-dark-mode .mec-fes-form input[type=number],.mec-dark-mode .mec-fes-form input[type=password],.mec-dark-mode .mec-fes-form input[type=tel],.mec-dark-mode .mec-fes-form input[type=text],.mec-dark-mode .mec-fes-form select,.mec-dark-mode .mec-fes-form textarea{box-shadow:0 2px 5px rgba(0,0,0,.38) inset}.mec-dark-mode .mec-fes-form input{background:#353535!important;color:#d2d2d2!important}.mec-dark-mode .mec-booking-tab-content .button:hover,.mec-dark-mode .mec-booking-tab-content .mec-reg-field-add-option:hover,.mec-dark-mode .mec-fes-form .mec-form-row .button:not(.wp-color-result):hover{background:#353535;color:#d2d2d2;border-color:#353535;box-shadow:0 2px 6px -3px #353535}.mec-dark-mode .mec-booking-tab-content .button,.mec-dark-mode .mec-booking-tab-content .mec-reg-field-add-option,.mec-dark-mode .mec-fes-form .mec-form-row .button:not(.wp-color-result),.mec-dark-mode .mec-fes-form input[type=file],.mec-dark-mode ul#mec_orgz_form_row li .mec-additional-organizer-remove,.mec-dark-mode ul#mec_reg_form_fields li .mec_reg_field_remove{color:#d2d2d2;background:#282828;border:2px solid #353535;box-shadow:0 2px 6px -3px #353535}.mec-dark-mode #mec_reg_form_fields input[type=checkbox],.mec-dark-mode #mec_reg_form_fields input[type=radio],.mec-dark-mode .mec-form-row input[type=checkbox],.mec-dark-mode .mec-form-row input[type=radio]{background-color:#000;border:1px solid #353535;box-shadow:0 1px 3px -1px #353535}.mec-dark-mode .mec-fes-form .select2-container{border:1px solid #353535;background-color:#282828;color:#d2d2d2}.mec-dark-mode ul#mec_bfixed_form_fields li,.mec-dark-mode ul#mec_orgz_form_row li,.mec-dark-mode ul#mec_reg_form_fields li{background:#000;border-color:#000}.mec-dark-mode #mec_meta_box_tickets_form [id^=mec_ticket_row] .mec_add_price_date_button{background:#000;border-color:#2d2d2d;box-shadow:0 2px 6px -3px #2d2d2d}.mec-dark-mode #mec_reg_form_field_types .button.red{background:#2d2d2d;border-color:#2d2d2d;box-shadow:0 2px 6px -3px #2d2d2d}.mec-dark-mode #mec_bfixed_form_field_types .button,.mec-dark-mode #mec_reg_form_field_types .button{color:#d2d2d2;box-shadow:0 2px 6px -3px #2d2d2d;border-color:#2d2d2d}.mec-dark-mode #mec_meta_box_tickets_form [id^=mec_ticket_row] .mec_add_price_date_button:hover,.mec-dark-mode #mec_reg_form_field_types .button:hover{background:#000}.mec-dark-mode ul#mec_bfixed_form_fields li .mec_bfixed_field_remove,.mec-dark-mode ul#mec_orgz_form_row li .mec-additional-organizer-remove,.mec-dark-mode ul#mec_reg_form_fields li .mec_reg_field_remove{background:#282828}.mec-dark-mode #mec_taxes_fees_container_toggle [id^=mec_remove_fee_button]:hover,.mec-dark-mode #mec_ticket_variations_list [id^=mec_remove_ticket_variation_button]:hover,.mec-dark-mode ul#mec_bfixed_form_fields li .mec_bfixed_field_remove:hover,.mec-dark-mode ul#mec_orgz_form_row li .mec-additional-organizer-remove:hover,.mec-dark-mode ul#mec_reg_form_fields li .mec_reg_field_remove:hover{color:#fff;border:2px solid #ea6485;background:#ea6485}.mec-events-meta-group-booking-shortcode h4{margin-bottom:20px}.mec-booking-shortcode .mec-event-tickets-list.mec-sell-all-occurrences{width:100%}.mec-booking-shortcode .mec-book-reg-field-mec_email{width:48%;display:inline-block;margin-right:30px}.mec-booking-shortcode .mec-book-reg-field-name{width:48%;display:inline-block}.mec-booking-shortcode .mec-form-row.mec-paypal-credit-card-expiration-date-month{width:48%;display:inline-block;vertical-align:top;margin-right:30px}.mec-booking-shortcode .mec-form-row.mec-paypal-credit-card-cvv2{width:48%;display:inline-block}.mec-booking-shortcode .mec-form-row.mec-paypal-credit-card-expiration-date-month .nice-select{width:48%;display:inline-block}.mec-booking-shortcode .mec-form-row.mec-paypal-credit-card-expiration-date-month label{width:100%}.mec-booking-shortcode .mec-form-row.mec-paypal-credit-card-expiration-date-month .nice-select:first-of-type{margin-right:10px}.mec-booking-shortcode .nice-select{float:none;border-radius:3px;background-color:#fff;width:258px;height:40px;line-height:39px;padding-left:15px;padding-right:15px;margin:0;font-size:14px;font-weight:400;min-height:unset;min-width:unset;padding-top:0;padding-bottom:0}.mec-booking-shortcode .mec-gateway-message.mec-success{font-size:14px}.mec-booking-shortcode .mec-form-row.mec-name-stripe{margin-bottom:0!important}.mec-booking-shortcode .mec-book-form-gateways [id*=mec_book_form_gateway_checkout] input[type=text],.mec-events-meta-group-booking .mec-booking-shortcode .StripeElement{box-shadow:none!important}.mec-booking-shortcode .nice-select ul{width:100%}.mec-booking-shortcode span.mec-event-ticket-available{margin-top:-22px!important;margin-bottom:28px!important;display:block;font-size:11px;letter-spacing:.5px;font-weight:300;color:#80abbf}.mec-booking-shortcode .mec-booking-form-container ul li{list-style:none}.mec-booking-shortcode .mec-booking-form-container ul{padding:0}.mec-events-meta-group-booking-shortcode .info-msg{margin:24px 0 24px}@media (max-width:980px){.mec-events-meta-group-booking-shortcode{padding:20px}.mec-booking-shortcode ul.mec-book-price-details li{width:100%;border-right:0!important;border-bottom:1px solid}.mec-booking-shortcode ul.mec-book-price-details li:last-child{width:100%;border-right:0;border-bottom:0 solid}}.mec-booking-shortcode span.mec-book-price-total{font-size:22px;line-height:22px;font-weight:700;color:#2bbc10;margin-top:20px;margin-bottom:35px;display:inline-block}.mec-booking-shortcode span.mec-book-price-total-description{font-size:18px;line-height:22px;font-weight:700;color:#000}.mec-booking-shortcode span.mec-book-price-total-amount{font-size:22px;line-height:22px;font-weight:700;color:#2bbc10}.mec-booking-shortcode .mec-book-form-price{clear:both;position:relative}.mec-booking-shortcode .mec-book-form-gateway-label input[type=radio]:after{content:"";display:inline-block;width:7px;height:7px;background-color:#fff;border-radius:50%;cursor:pointer;position:absolute;top:4px;left:3px}.mec-booking-shortcode .mec-book-form-gateway-label input[type=radio]:before{box-shadow:none;border:2px solid #a8e4ff;width:17px;height:17px;position:absolute;top:-9px;left:-2px;margin:0;content:"";display:inline-block;background:#fff;border-radius:18px;cursor:pointer;position:relative}.mec-booking-shortcode .mec-book-form-gateway-label label input{position:relative;cursor:pointer;margin:0!important;height:auto;margin-right:4px!important}.mec-booking-shortcode button#mec-book-form-btn-step-2{margin-left:30px}.mec-booking-shortcode .mec-ticket-name{display:inline-block;background-color:#fff;border-radius:3px;font-size:12px;line-height:12px;font-weight:400;color:#00acf8;padding:8px 13px;letter-spacing:0}.mec-booking-shortcode .mec_book_first_for_all{display:none}.mec-booking-shortcode li.mec-first-for-all-wrapper{margin-bottom:20px;clear:both}.mec-booking-shortcode label.wn-checkbox-label:before{display:inline-block;-moz-transform-origin:left top;-ms-transform-origin:left top;-o-transform-origin:left top;-webkit-transform-origin:left top;transform-origin:left top;content:"";-webkit-transition:opacity ease .5;-moz-transition:opacity ease .5;transition:opacity ease .5;position:absolute;background-color:#00acf8;width:2px;-webkit-transform:rotate(-138deg);transform:rotate(-138deg)}.mec-booking-shortcode label.wn-checkbox-label{position:relative;display:inline-block;-moz-transition:border-color ease .2s;-o-transition:border-color ease .2s;-webkit-transition:border-color ease .2s;transition:border-color ease .2s;cursor:pointer;vertical-align:middle;font-size:14px;line-height:19px;font-weight:400;color:#00acf8;margin:0 0 4px!important;padding:0;background-color:#fff;border:2px solid #a8e4ff;width:17px;height:17px;border-radius:3px;margin-right:9px!important;box-shadow:none}.mec-booking-shortcode label.wn-checkbox-label:after{-moz-transform:rotate(-45deg);-ms-transform:rotate(-45deg);-o-transform:rotate(-45deg);-webkit-transform:rotate(-45deg);transform:rotate(-45deg);-moz-animation:dothabottomcheck 80ms ease 0s forwards;-o-animation:dothabottomcheck 80ms ease 0s forwards;-webkit-animation:dothabottomcheck 80ms ease 0s forwards;animation:dothabottomcheck 80ms ease 0s forwards;content:"";display:inline-block;-moz-transform-origin:left top;-ms-transform-origin:left top;-o-transform-origin:left top;-webkit-transform-origin:left top;transform-origin:left top;content:"";-webkit-transition:opacity ease .5;-moz-transition:opacity ease .5;transition:opacity ease .5;position:absolute;background-color:#00acf8;width:2px}.mec-booking-shortcode input[type=checkbox]:checked+.wn-checkbox-label::after{height:5px;left:2px;top:7px;-moz-animation:dothatopcheck .16s ease 0s forwards;-o-animation:dothatopcheck .16s ease 0s forwards;-webkit-animation:dothatopcheck .16s ease 0s forwards;animation:dothatopcheck .16s ease 0s forwards}.mec-booking-shortcode input[type=checkbox]:checked+.wn-checkbox-label::before{height:6px;left:7px;top:9px;-moz-animation:dothatopcheck .16s ease 0s forwards;-o-animation:dothatopcheck .16s ease 0s forwards;-webkit-animation:dothatopcheck .16s ease 0s forwards;animation:dothatopcheck .16s ease 0s forwards}.mec-booking-shortcode button.mec-book-form-back-button{background-color:#afe6ff;box-shadow:0 2px 2px rgba(175,230,255,.27)}.mec-booking-shortcode button[type=button]:hover,.mec-booking-shortcode button[type=submit]:hover{background-color:#000;text-decoration:none;box-shadow:0 4px 10px rgba(1,2,4,.32)}.mec-booking-shortcode a.button.loading:after,.mec-booking-shortcode button[type=submit].loading:after{display:block}.mec-booking-calendar-month-navigation,.mec-single-fluent-wrap .mec-booking-calendar-month-navigation{position:relative;text-align:center;padding:0;max-width:330px}.mec-booking-calendar.mec-wrap,.mec-single-fluent-wrap .mec-booking-calendar.mec-wrap{margin-bottom:20px;width:100%}.mec-booking-calendar.mec-wrap,.mec-single-fluent-wrap .mec-booking-calendar.mec-wrap{max-width:330px;background:#fff;box-shadow:0 1px 5px 6px rgba(0,0,0,.005) inset;border:1px solid #efefef;border-radius:5px}.mec-booking-calendar-month-navigation .mec-calendar-header h2,.mec-single-fluent-wrap .mec-booking-calendar-month-navigation .mec-calendar-header h2{font-size:13px;font-weight:600;line-height:40px;margin:0 auto;color:#4d4d4d}.mec-booking-calendar-month-navigation .mec-next-month,.mec-booking-calendar-month-navigation .mec-previous-month,.mec-single-fluent-wrap .mec-booking-calendar-month-navigation .mec-next-month,.mec-single-fluent-wrap .mec-booking-calendar-month-navigation .mec-previous-month{cursor:pointer;position:absolute;top:0;min-width:40px;height:40px;line-height:40px;text-align:center;background:#fff;color:#a9a9a9;font-size:10px;letter-spacing:1px;text-transform:uppercase;padding-left:5px;padding-right:5px;border-top:none;transition:all .33s ease;box-shadow:0 2px 0 0 rgba(0,0,0,.015);transition:all .33s ease}.mec-booking-calendar-month-navigation .mec-previous-month,.mec-single-fluent-wrap .mec-booking-calendar-month-navigation .mec-previous-month{left:0}.mec-booking-calendar-month-navigation .mec-next-month,.mec-single-fluent-wrap .mec-booking-calendar-month-navigation .mec-next-month{right:0}.mec-booking-calendar-month-navigation .mec-next-month a,.mec-booking-calendar-month-navigation .mec-previous-month a,.mec-single-fluent-wrap .mec-booking-calendar-month-navigation .mec-next-month a,.mec-single-fluent-wrap .mec-booking-calendar-month-navigation .mec-previous-month a{font-weight:600;text-decoration:none}.mec-booking-calendar-month-navigation .mec-next-month:hover a,.mec-booking-calendar-month-navigation .mec-previous-month:hover a,.mec-single-fluent-wrap .mec-booking-calendar-month-navigation .mec-next-month:hover a,.mec-single-fluent-wrap .mec-booking-calendar-month-navigation .mec-previous-month:hover a{color:#40d9f1}.mec-events-meta-group-booking .mec-booking-calendar .mec-calendar{margin-bottom:15px;width:100%}.mec-events-meta-group-booking .mec-booking-calendar .mec-calendar dl dt{text-align:center;padding:0;line-height:40px;height:40px;border:0;background:0 0;cursor:pointer}.mec-events-meta-group-booking .mec-booking-calendar .mec-calendar .mec-calendar-row dt:hover{background:0 0}.mec-events-meta-group-booking .mec-booking-calendar .mec-calendar .mec-calendar-novel-selected-day,.mec-events-meta-group-booking .mec-booking-calendar .mec-calendar .mec-calendar-novel-selected-day span{width:32px;height:32px;margin:auto;line-height:30px;border-radius:50%;font-size:12px;font-weight:600;padding:0}.mec-has-event-for-booking{position:relative}.mec-has-event-for-booking .mec-calendar-novel-selected-day{border:1px solid #38d5ed;border-radius:50px;cursor:pointer}.mec-has-event-for-booking.mec-active .mec-calendar-novel-selected-day{background-color:#38d5ed;color:#fff}.mec-has-event-for-booking .mec-booking-calendar-date,.mec-has-event-for-booking .mec-booking-tooltip,.mec-multiple-event .mec-has-event-for-booking .mec-booking-tooltip{opacity:0;visibility:hidden;transition:all .4s ease}.mec-has-event-for-booking .mec-booking-tooltip,.mec-multiple-event .mec-has-event-for-booking .mec-booking-tooltip{top:60px}.mec-has-event-for-booking .mec-booking-tooltip,.mec-multiple-event .mec-has-event-for-booking .mec-booking-tooltip{position:absolute;z-index:99;width:150px;font-size:9px;left:calc(50% - 75px);background:#535a61;line-height:29px;border-radius:4px;color:#fff;font-weight:400;letter-spacing:1px;text-transform:uppercase;padding:3px 5px;box-shadow:0 4px 15px -2px #444b50a3}.mec-has-event-for-booking:hover .mec-booking-calendar-date,.mec-has-event-for-booking:hover .mec-booking-tooltip,.mec-has-event-for-booking:hover .mec-booking-tooltip.multiple-time .mec-booking-calendar-date,.mec-multiple-event .mec-has-event-for-booking:hover .mec-booking-calendar-date,.mec-multiple-event .mec-has-event-for-booking:hover .mec-booking-tooltip{opacity:1;visibility:visible}.mec-has-event-for-booking:hover .mec-booking-tooltip,.mec-multiple-event .mec-has-event-for-booking:hover .mec-booking-tooltip{top:43px}.mec-has-event-for-booking .mec-booking-calendar-date:before,.mec-multiple-event .mec-has-event-for-booking .mec-booking-calendar-date:before{display:block;content:""!important;position:absolute!important;width:12px;height:12px;top:-6px;left:calc(50% - 6px);transform:rotate(-45deg)!important;background-color:#535a61;z-index:0!important;box-shadow:0 8px 9px -9px #535a61!important}.mec-multiple-event .mec-has-event-for-booking .mec-booking-calendar-date-hover{border-bottom:1px solid #ffffff30}.mec-events-meta-group-booking .mec-booking-calendar .mec-calendar.mec-multiple-event .first-day{position:relative;padding-left:7px}.mec-events-meta-group-booking .mec-booking-calendar .mec-calendar.mec-multiple-event .first-day .mec-calendar-novel-selected-day{border-radius:47px;border-top-right-radius:0;border-bottom-right-radius:0;border-right:0;width:100%}.mec-events-meta-group-booking .mec-booking-calendar .mec-calendar.mec-multiple-event .first-day .mec-calendar-novel-selected-day span{margin-left:-7px}.mec-events-meta-group-booking .mec-booking-calendar .mec-calendar.mec-multiple-event .last-day{position:relative;padding-right:7px}.mec-events-meta-group-booking .mec-booking-calendar .mec-calendar.mec-multiple-event .last-day .mec-calendar-novel-selected-day{border-radius:47px;border-top-left-radius:0;border-bottom-left-radius:0;border-left:0;width:100%}.mec-events-meta-group-booking .mec-booking-calendar .mec-calendar.mec-multiple-event .last-day .mec-calendar-novel-selected-day span{margin-right:-7px}.mec-events-meta-group-booking .mec-booking-calendar .mec-calendar.mec-multiple-event .middle-day .mec-calendar-novel-selected-day{border-radius:0;border-right:0;border-left:0;width:100%}.mec-booking-tooltip.multiple-time{color:#fff}.mec-booking-tooltip.multiple-time .mec-booking-calendar-date:before{display:none}.mec-booking-tooltip.multiple-time .mec-booking-calendar-date:first-child:before{display:block}.mec-booking-tooltip.multiple-time .mec-booking-calendar-date{border:1px dashed #68717a;line-height:25px;margin:8px 0;border-radius:20px;transition:all .17s ease;-webkit-transition:all .17s ease;-moz-transition:all .17s ease;-ms-transition:all .17s ease;-o-transition:all .17s ease}.mec-booking-tooltip.multiple-time .mec-booking-calendar-date:hover,.mec-calendar-day.mec-active .mec-booking-tooltip.multiple-time .mec-booking-calendar-date.mec-active{background:#40d9f1;border-color:#40d9f1}.mec-choosen-time-message{max-width:330px;padding:3px 14px;border-radius:4px;background:rgb(64 217 241 / 24%);color:#40d9f1;transition:all .17s ease;opacity:1;visibility:visible;font-size:12px;margin-bottom:20px}.mec-choosen-time-message .mec-choosen-time{padding-left:7px}.mec-choosen-time-message.disable,.mec-choosen-time-message.disable .mec-choosen-time-message{opacity:0;visibility:hidden;padding:0;font-size:0;margin:0}.mec-dark-mode .mec-single-event .mec-events-meta-group-booking .mec-booking-calendar-month-navigation,.mec-dark-mode .mec-single-event .mec-events-meta-group-booking .mec-calendar{background:#000;border-color:#222;color:#999}.mec-dark-mode .mec-booking-calendar-month-navigation .mec-next-month,.mec-dark-mode .mec-booking-calendar-month-navigation .mec-previous-month{background:#222;border-color:#000;color:#d2d2d2}.mec-dark-mode .mec-booking-calendar.mec-wrap{border-color:#111}.mec-dark-mode .mec-events-meta-group-booking .mec-booking-calendar .mec-calendar .mec-calendar-row dt:hover{background:0 0!important}.mec-dark-mode .mec-calendar.mec-event-calendar-classic,.mec-dark-mode .mec-calendar.mec-event-calendar-classic .mec-calendar-side{height:auto}.is-light-theme .mec-fes-form textarea{border:1px solid #cfeff5;box-shadow:0 2px 5px rgba(207,239,245,.38) inset}.is-light-theme .mec-fes-form .select2-selection{height:auto}.is-light-theme .mec-fes-form input[type=checkbox]:after{border:unset!important}.is-light-theme .mec-fes-form input[type=radio]:after{background:unset!important}.is-light-theme .mec-fes-form input+label{padding-top:0}.is-light-theme .mec-events-event-image img{height:auto}span.mec-booking-field-required{color:red;margin-left:10px}.mec-gCalendar{position:relative}.mec-gCalendar-filters{display:none;position:absolute;width:518px;background:#fff;right:calc(50% - 119px);top:60px;z-index:9999999;border:1px solid #e3e4e5;border-radius:7px;box-shadow:0 2px 7px rgb(0 0 0 / 5%)}.mec-gCalendar-filters-wrap{display:flex;flex-wrap:wrap;justify-content:space-between;padding:30px;gap:20px 10px;align-items:center}.mec-gCalendar-filters-wrap>div{flex:1 0 calc(43% - 10px);display:inline-flex}.mec-gCalendar-filters .mec-gCalendar-filters-wrap .mec-search-reset-button{display:block;flex:1 0 calc(100%)}.mec-gCalendar-filters .mec-gCalendar-filters-wrap .mec-search-reset-button button{width:100%;border:2px solid #e3e5e7;border-radius:7px;color:#4c5765}.mec-gCalendar-filters .mec-gCalendar-filters-wrap .mec-search-reset-button button:hover{color:#e9526c;border-color:#f37f9b;background-color:transparent}.mec-gCalendar-filters-wrap .select2-container--default>ul{margin-top:2px;width:100%}.mec-gCalendar-filters-wrap span.select2.select2-container{width:100%!important}.mec-gCalendar-filters-wrap .select2-container--default>ul>li{width:100%}.mec-gCalendar-filters-wrap .select2-container--default{height:39px}.mec-gCalendar-filters-wrap span.select2-selection.select2-selection--multiple{border:none!important;height:37px!important}.mec-gCalendar-filters-wrap .select2-container--default .select2-selection--multiple .select2-selection__choice{margin:0;background-color:#eee;font-size:11px}.mec-gCalendar-filters-wrap .select2-container--default .select2-selection--multiple .select2-selection__rendered li{line-height:29px;margin-top:5px;border:none;margin-right:5px}.mec-gCalendar-filters-wrap .mec-searchbar-category-wrap{margin:0!important;width:182px!important;padding:0!important;height:40px!important;border-radius:0 3px 3px 0;border:1px solid #e3e4e5!important}.mec-gCalendar-filters-wrap .mec-checkboxes-search i,.mec-gCalendar-filters-wrap .mec-dropdown-search i,.mec-gCalendar-filters-wrap .mec-minmax-event-cost i,.mec-gCalendar-filters-wrap .mec-text-address-search i{color:#b7b7b7;background-color:#fbfbfb;border-radius:3px 0 0 3px;border:1px solid #e3e4e5;width:40px;height:40px;line-height:40px;padding:0;border-right:0;text-align:center}.mec-gCalendar-filters-wrap .mec-minmax-event-cost input,.mec-gCalendar-filters-wrap .mec-minmax-event-cost input:focus,.mec-gCalendar-filters-wrap .mec-text-address-search input,.mec-gCalendar-filters-wrap .mec-text-address-search input:focus{width:208px;height:40px;border-radius:0;border-right:0;border-color:#e3e4e5;font-size:12px;border-style:solid;border-width:1px;padding-left:15px}.mec-gCalendar-filters-wrap .mec-text-address-search input,.mec-gCalendar-filters-wrap .mec-text-address-search input:focus{width:415px}.mec-gCalendar-filters-wrap .mec-minmax-event-cost input:last-child,.mec-gCalendar-filters-wrap .mec-text-address-search input,.mec-gCalendar-filters-wrap .mec-text-address-search input:focus{border-right:1px solid #e3e4e5;border-radius:0 3px 3px 0;border-left:none}.mec-gCalendar .mec-gCalendar-filters-wrap .mec-text-address-search i{border-right:1px solid #e3e4e5}.mec-gCalendar-filters-wrap ul.list li[data-value=""]{display:none}.mec-gCalendar .fc .fc-scroller-harness,.mec-gCalendar .fc .fc-scroller-liquid-absolute,.mec-gCalendar .fc-h-event .fc-event-title{overflow:visible!important}#MonthPicker_mec-gCalendar-month-filter:after,#MonthPicker_mec-gCalendar-month-filter:before,.mec-gCalendar-filters:after,.mec-gCalendar-filters:before{content:"";display:block;position:absolute;left:50%;margin-left:77px;width:0;height:0;border-style:solid;border-width:7px}#MonthPicker_mec-gCalendar-month-filter:after,#MonthPicker_mec-gCalendar-month-filter:before{margin-left:68px}#MonthPicker_mec-gCalendar-month-filter:before,.mec-gCalendar-filters:before{top:-15px;border-color:transparent transparent #e3e9f1 transparent}#MonthPicker_mec-gCalendar-month-filter:after,.mec-gCalendar-filters:after{top:-14px;border-color:transparent transparent #fff transparent}.mec-gCalendar{font-family:inherit}.mec-gCalendar-tooltip{width:290px;height:auto;position:absolute;background:#fff;left:calc(50% - 145px);bottom:calc(100% - 1px);border:1px solid #e3e4e5;border-radius:7px;opacity:1;box-shadow:0 4px 13px rgb(0 0 0 / 7%);z-index:9997}@media (max-width:991px){.mec-gCalendar-tooltip{display:none}}.mec-gCalendar-tooltip-image img{width:100%;border-radius:3px!important}.mec-gCalendar-tooltip-image{padding:10px;padding-bottom:8px}.mec-gCalendar a.fc-event:active{opacity:1}.mec-gCalendar #mec-gCalendar-wrap a.fc-event{padding:7px 3px;font-size:12px;font-weight:400}.mec-gCalendar-tooltip-title{color:#000;line-height:24px;font-size:15px;padding:10px 25px;font-weight:500}.mec-gCalendar-tooltip-title span{width:12px;height:12px;display:inline-block;margin-left:7px;vertical-align:middle;border-radius:50px}.mec-gCalendar-tooltip-title a{color:#000}.mec-gCalendar-tooltip-title a:hover{text-decoration:underline;color:#000}.mec-gCalendar-tooltip-location{color:#707172;font-size:12px;font-weight:400;line-height:23px;padding:0 25px 15px;margin-top:-2px}.mec-gCalendar-tooltip-location i{margin-right:6px;color:#c1c7ce}.mec-gCalendar .fc-event-time{display:none}.mec-gCalendar-tooltip-date{background:#f7f8f9;color:#898a8c;font-weight:400;padding:10px 24px;display:flex;justify-content:space-between;font-size:12px}.mec-gCalendar-tooltip-date-text>div>span,.mec-gCalendar-tooltip-date-time>div>span{display:block;line-height:23px}.mec-gCalendar-tooltip-date-text>div>span:last-child,.mec-gCalendar-tooltip-date-time>div>span:last-child{margin:0}.mec-gCalendar-tooltip-date-text .mec-gCalendar-tooltip-date-day{font-size:14px;color:#000}.mec-gCalendar-tooltip-date-text,.mec-gCalendar-tooltip-date-time{display:flex;align-items:baseline}.mec-gCalendar-tooltip-date-text i,.mec-gCalendar-tooltip-date-time i{margin-right:8px;color:#c1c7ce}.mec-gCalendar-tooltip:after,.mec-gCalendar-tooltip:before{content:"";display:block;position:absolute;left:calc(50% - 8px);width:0;height:0;border-style:solid;border-width:8px}.mec-gCalendar-tooltip:before{bottom:-17px;border-color:#e3e9f1 transparent transparent transparent}.mec-gCalendar-tooltip:after{bottom:-16px;border-color:#fff transparent transparent transparent}#mec-gCalendar-wrap .openMonthFilter i{-moz-transition:all .27s ease;-webkit-transition:all .27s ease;-o-transition:all .27s ease;transition:all .27s ease}#mec-gCalendar-wrap .openMonthFilter.open i{transform:rotate(-180deg)}.mec-gCalendar input#mec-gCalendar-month-filter{display:none}.mec-gCalendar .fc-header-toolbar .fc-toolbar-chunk,.mec-gCalendar .fc-header-toolbar .fc-toolbar-chunk>div:not(#MonthPicker_mec-gCalendar-month-filter){display:flex;align-items:center;justify-content:space-between}.mec-gCalendar .fc-header-toolbar .fc-toolbar-chunk{margin-bottom:8px}.mec-gCalendar #mec-gCalendar-wrap .fc-header-toolbar.fc-toolbar{border:1px solid #e3e4e5;border-radius:7px;padding:18px 30px 10px;position:relative;flex-wrap:wrap}.mec-gCalendar #mec-gCalendar-wrap h2.fc-toolbar-title{font-size:22px;font-weight:600;line-height:20px;margin-right:20px;position:relative}.mec-gCalendar #mec-gCalendar-wrap h2.fc-toolbar-title>span{font-weight:100}.mec-gCalendar h2.fc-toolbar-title i{color:#a1a2a3;cursor:pointer;margin-left:2px;font-size:14px;margin-right:0}.mec-gCalendar h2.fc-toolbar-title button{background:0 0;border:none;cursor:pointer;padding:0;outline:0}.mec-gCalendar table.fc-scrollgrid-sync-table tbody td{border:none;border-bottom:1px solid #eee;border-right:1px solid #eee}.mec-gCalendar button.fc-nextYear-button.fc-button.fc-button-primary,.mec-gCalendar button.fc-nextYear-button.fc-button.fc-button-primary:active,.mec-gCalendar button.fc-prevYear-button.fc-button.fc-button-primary,.mec-gCalendar button.fc-prevYear-button.fc-button.fc-button-primary:active{background:#fff;color:#a1a2a3;border-radius:7px 0 0 7px;border-color:#e3e4e5;padding:3px 2px;box-shadow:none!important}.mec-gCalendar button.fc-button span.fc-icon{font-size:20px;padding:1px 0;width:30px;height:34px;vertical-align:middle;position:relative}.mec-gCalendar-filters-wrap .nice-select .list{margin:0;box-shadow:0 0 0 1px rgb(68 68 68 / 11%),0 2px 4px rgb(0 0 0 / 5%)}.mec-gCalendar button.fc-button span.fc-icon:before{vertical-align:middle;font-size:18px;position:absolute;top:calc(50% - 9px);left:calc(50% - 9px)}.mec-gCalendar button.fc-prevYear-button.fc-button.fc-button-primary{border-right:none}.mec-gCalendar button.fc-nextYear-button.fc-button.fc-button-primary{border-left:none;border-radius:0 7px 7px 0}.mec-gCalendar button.fc-next-button.fc-button.fc-button-primary,.mec-gCalendar button.fc-next-button.fc-button.fc-button-primary:active,.mec-gCalendar button.fc-prev-button.fc-button.fc-button-primary,.mec-gCalendar button.fc-prev-button.fc-button.fc-button-primary:active{background:#fff;color:#a1a2a3;border-right:none;border-left:none;border-radius:0;border-color:#e3e4e5;padding:3px 2px;box-shadow:none!important}.mec-gCalendar button.fc-today-button.fc-button.fc-button-primary,.mec-gCalendar button.fc-today-button.fc-button.fc-button-primary:active{background:#fff;color:#707070;border-left:none;border-right:none;border-radius:0;border-color:#e3e4e5;font-size:13px;text-transform:capitalize;font-weight:400;opacity:1;padding:9px 8px 12px;box-shadow:none!important;cursor:pointer;height:42px}.mec-gCalendar button.fc-today-button.fc-button.fc-button-primary:disabled{cursor:auto}.mec-gCalendar button.fc-button.fc-button-primary:hover span{background:#f4f5f6;color:#000;border-radius:7px}.mec-gCalendar button.fc-today-button.fc-button.fc-button-primary:not(:disabled):hover{background:#f4f5f6;color:#000;border-radius:0}.mec-gCalendar button.fc-filterEvents-button.fc-button.fc-button-primary,.mec-gCalendar button.fc-findEvents-button.fc-button.fc-button-primary,.mec-gCalendar button.fc-findEvents-button.fc-button.fc-button-primary:active{min-width:100px;border-radius:7px!important;margin-right:0;background:#00acf8;border:none!important;padding:10px 15px 11px;font-size:13px;font-weight:500;margin-left:20px!important;box-shadow:none!important}.mec-gCalendar tr.fc-scrollgrid-section.fc-scrollgrid-section-header.fc-scrollgrid-section-sticky>td{border-radius:7px 7px 0 0;border:none}.mec-gCalendar button.fc-filterEvents-button.fc-button.fc-button-primary{position:relative;text-align:right;padding-right:13px;padding-left:32px;min-width:auto;background:0 0;font-size:14px;color:#969798;font-weight:400}.mec-gCalendar button.fc-filterEvents-button.fc-button.fc-button-primary:active,.mec-gCalendar button.fc-filterEvents-button.fc-button.fc-button-primary:hover{background:#f4f5f6;color:#000}.mec-gCalendar button.fc-filterEvents-button.fc-button.fc-button-primary svg{position:absolute;left:10px;top:14px}.mec-gCalendar button.fc-findEvents-button.fc-button.fc-button-primary:hover{background:#444}.mec-gCalendar-tooltip-location,.mec-gCalendar-tooltip-title{white-space:normal}.mec-gCalendar #mec-gCalendar-wrap .mec-gCalendar-search-text-wrap input[type=text],.mec-gCalendar #mec-gCalendar-wrap .mec-gCalendar-search-text-wrap input[type=text]:focus{margin:0;border:none;box-shadow:none!important;font-size:14px;font-weight:400;line-height:20px;color:#949aa1;padding-right:5px;padding-left:8px;background:#fff;outline:0;display:inline-block}.mec-gCalendar .mec-gCalendar-search-text-wrap input[type=text]::-webkit-input-placeholder{color:#949aa1}.mec-gCalendar .mec-gCalendar-search-text-wrap input[type=text]::-moz-placeholder{color:#949aa1}.mec-gCalendar .mec-gCalendar-search-text-wrap input[type=text]:-ms-input-placeholder{color:#949aa1}.mec-gCalendar .mec-gCalendar-search-text-wrap input[type=text]:-moz-placeholder{color:#949aa1}.mec-gCalendar-search-text-wrap{border-left:1px solid #e3e4e5;padding-left:16px}.mec-gCalendar-search-text-wrap i{margin-right:0;color:#bcc4ce;font-size:17px}.mec-gCalendar .fc-direction-ltr .fc-button-group>.fc-button:first-child{margin-left:7px!important}.mec-gCalendar .fc-direction-ltr .fc-toolbar>*>:not(:first-child){margin-left:0}.mec-gCalendar .mec-localtime-wrap{color:#000;font-size:11px;margin-top:2px;margin-bottom:2px}.mec-gCalendar .fc-theme-standard .fc-popover{background:#fff;border:1px solid #e3e4e5;border-radius:7px;box-shadow:0 4px 13px rgb(0 0 0 / 7%)}.mec-gCalendar .mec-localtime-wrap i{display:none}.mec-gCalendar .datepicker.dropdown-menu{top:51px!important;left:unset!important;right:0}.mec-month-picker.datepicker.dropdown-menu{position:absolute;min-width:215px!important;z-index:999;background:#fff;padding:4px 0 3px;margin:0;color:#000;border:1px solid #e3e4e5;border-radius:7px;box-shadow:0 3px 5px rgb(0 0 0 / 3%)}.mec-month-picker.datepicker.dropdown-menu *{background:#fff;border-radius:7px;border:none;height:auto}.mec-month-picker.datepicker table caption+thead tr:first-child td,.mec-month-picker.datepicker table caption+thead tr:first-child th,.mec-month-picker.datepicker table colgroup+thead tr:first-child td,.mec-month-picker.datepicker table colgroup+thead tr:first-child th,.mec-month-picker.datepicker table thead:first-child tr:first-child td,.mec-month-picker.datepicker table thead:first-child tr:first-child th{border:none}.mec-month-picker.datepicker table thead:first-child tr:first-child th.switch{font-weight:500}.mec-month-picker.datepicker table thead:first-child tr:first-child th.next,.mec-month-picker.datepicker table thead:first-child tr:first-child th.prev{font-size:0;padding-top:11px}.mec-month-picker.datepicker table thead:first-child tr:first-child th.next:before,.mec-month-picker.datepicker table thead:first-child tr:first-child th.prev:before{content:"\e606";font-family:simple-line-icons;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-size:12px;color:#a1a2a3}.mec-month-picker.datepicker table thead:first-child tr:first-child th.prev:before{content:"\e605"}.mec-month-picker.datepicker table.table-condensed thead tr{display:flex;padding:6px 12px 10px;justify-content:space-between;align-items:center}.mec-month-picker.datepicker thead tr:first-child th{width:auto;height:auto}.mec-month-picker.datepicker thead tr:first-child th.next,.mec-month-picker.datepicker thead tr:first-child th.prev{width:34px;height:34px;padding:0 12px}.mec-month-picker.datepicker thead tr:first-child th.switch{padding:5px 18px}.mec-month-picker.datepicker table.table-condensed tbody tr td{justify-content:space-between;align-items:center;padding:0 9px 7px;display:flex;flex-direction:row;flex-wrap:wrap;width:auto}.mec-month-picker.datepicker td span.active.active,.mec-month-picker.datepicker td span.active.disabled,.mec-month-picker.datepicker td span.active:active,.mec-month-picker.datepicker td span.active:focus,.mec-month-picker.datepicker td span.active:hover,.mec-month-picker.datepicker td span.active[disabled]{background-color:#00acf8;text-shadow:none}.mec-month-picker.datepicker td span{width:43px;line-height:41px;font-size:14px}.mec-month-picker.datepicker thead tr:first-child th:hover{background:#f4f5f6}.mec-month-picker.datepicker thead tr:first-child th:hover:before{color:#000!important}.mec-month-picker.datepicker td span:hover{background-color:#f4f5f6}.mec-month-picker.datepicker:after{left:unset;right:11px}.mec-month-picker.datepicker:before{left:unset;right:10px}#gCalendar-loading{width:100%;height:100%;background:no-repeat rgba(255,255,255,.88) url("../img/ajax-loader.gif") center;border-style:none;position:absolute;left:0;right:0;bottom:0;top:0;z-index:9}#gCalendar-loading.mec-modal-preloader{display:block!important}.fc-daygrid.fc-dayGridMonth-view.fc-view{overflow:auto;border:1px solid #e3e4e5;border-radius:7px}#mec-gCalendar-wrap table.fc-scrollgrid{min-width:650px;overflow:auto;border:none;border-radius:unset}@media (min-width:992px){#mec-gCalendar-wrap table.fc-scrollgrid,.fc-daygrid.fc-dayGridMonth-view.fc-view{overflow:visible}}#mec-gCalendar-wrap table.fc-scrollgrid thead tr td{border:none!important;background:0 0}#mec-gCalendar-wrap table.fc-scrollgrid table{margin-bottom:0}#mec-gCalendar-wrap table.fc-scrollgrid tr th{background:0 0;padding:20px 0 3px 10px;text-align:left;border-right:none!important;border-left:none!important;border-bottom:1px solid #e3e4e5;border-top:none}#mec-gCalendar-wrap table.fc-scrollgrid tr th.fc-col-header-cell{border:none}#mec-gCalendar-wrap table.fc-scrollgrid tr th a{font-size:15px!important;font-weight:500!important;color:#000;text-decoration:none}#mec-gCalendar-wrap .openMonthFilter{position:relative;padding:7px 10px 2px;display:inline-block}#mec-gCalendar-wrap.fc .fc-daygrid-day-number{font-size:16px;padding:12px 10px 2px;color:#000;text-decoration:none}#mec-gCalendar-wrap table.fc-scrollgrid-sync-table{margin:0;border-spacing:0;border-collapse:separate}.mec-gCalendar table.fc-scrollgrid-sync-table tbody tr td:last-child{border-right:none}.mec-gCalendar table.fc-scrollgrid-sync-table tbody tr:last-child td{border-bottom:none}#mec-gCalendar-wrap span.mec-general-calendar-label{color:#fff;padding:1px 4px 3px;font-size:11px;border-radius:3px;margin:5px 3px 2px 0;display:inline-block}.mec-gCalendar .fc .fc-scrollgrid-section-sticky>*{position:relative;z-index:1}.mec-gCalendar .fc-direction-ltr .fc-daygrid-event.fc-event-end,.mec-gCalendar .fc-direction-ltr .fc-daygrid-event.fc-event-start,.mec-gCalendar .fc-direction-rtl .fc-daygrid-event.fc-event-end,.mec-gCalendar .fc-direction-rtl .fc-daygrid-event.fc-event-start{margin-right:0!important;margin-left:0!important}#mec-gCalendar-wrap table.fc-scrollgrid-sync-table tr td{text-align:left;background:#fff!important}#mec-gCalendar-wrap table.fc-scrollgrid-sync-table .fc-daygrid-day-top{display:flex;flex-direction:row;padding-left:10px}#mec-gCalendar-wrap .fc-daygrid-day.fc-day-today{background:#fff!important}#mec-gCalendar-wrap .fc-daygrid-day.fc-day-today .fc-daygrid-day-number{color:#00acf8;font-size:17px;font-weight:500}#mec-gCalendar-wrap .fc-scrollgrid-section-body>td{border:none!important}#mec-gCalendar-wrap table.fc-scrollgrid-sync-table tbody tr:last-child td:first-child{border-radius:0 0 0 7px}#mec-gCalendar-wrap table.fc-scrollgrid-sync-table tbody tr:last-child td:last-child{border-radius:0 0 7px 0}.select2-container{z-index:99999999}@media (max-width:1200px){.mec-gCalendar-search-text-wrap{padding-left:10px}.mec-gCalendar .mec-gCalendar-search-text-wrap input[type=text],.mec-gCalendar .mec-gCalendar-search-text-wrap input[type=text]:focus{width:100px}}@media (max-width:991px){.mec-gCalendar .mec-gCalendar-search-text-wrap input[type=text],.mec-gCalendar .mec-gCalendar-search-text-wrap input[type=text]:focus{width:auto}.mec-gCalendar #mec-gCalendar-wrap .fc-header-toolbar.fc-toolbar{display:block}.mec-gCalendar .fc-header-toolbar .fc-toolbar-chunk:last-child{margin:0}.mec-gCalendar-search-text-wrap{border-left:none}}@media (max-width:990px){.mec-gCalendar .fc-header-toolbar .fc-toolbar-chunk:first-child>div{width:100%;justify-content:flex-start!important;position:relative}.mec-gCalendar #mec-gCalendar-wrap h2.fc-toolbar-title{position:relative}}@media (max-width:480px){.mec-gCalendar button.fc-today-button.fc-button.fc-button-primary,.mec-gCalendar button.fc-today-button.fc-button.fc-button-primary:active{padding:6px 6px 9px}.mec-gCalendar button.fc-button span.fc-icon{font-size:12px;width:20px;height:27px}.mec-gCalendar #mec-gCalendar-wrap h2.fc-toolbar-title{font-size:17px;margin-right:11px}.mec-gCalendar .fc-header-toolbar .fc-toolbar-chunk,.mec-gCalendar .fc-header-toolbar .fc-toolbar-chunk>div:not(#MonthPicker_mec-gCalendar-month-filter){flex-wrap:wrap}.mec-gCalendar .fc-header-toolbar .fc-toolbar-chunk:last-child>div:not(#MonthPicker_mec-gCalendar-month-filter){width:100%;display:block}.mec-gCalendar .fc-header-toolbar .fc-toolbar-chunk:last-child>div.fc-button-group{text-align:right}.mec-gCalendar-filters-wrap .mec-text-address-search input,.mec-gCalendar-filters-wrap .mec-text-address-search input:focus{width:100%}.mec-gCalendar-filters-wrap>div{width:100%}.mec-gCalendar-filters-wrap .nice-select{width:100%}.mec-gCalendar-filters{width:328px;right:calc(50% - 165px);top:52px}.mec-gCalendar-filters:after,.mec-gCalendar-filters:before{margin-left:30px}.mec-gCalendar-filters-wrap .mec-minmax-event-cost input,.mec-gCalendar-filters-wrap .mec-minmax-event-cost input:focus{width:116px}.mec-month-picker.datepicker:after{left:unset;right:55px}.mec-month-picker.datepicker:before{left:unset;right:54px}.mec-month-picker.datepicker.dropdown-menu{top:40px!important;right:-45px}.mec-gCalendar #mec-gCalendar-wrap .fc-header-toolbar.fc-toolbar{padding:18px 10px}.mec-gCalendar button.fc-today-button.fc-button.fc-button-primary,.mec-gCalendar button.fc-today-button.fc-button.fc-button-primary:active{height:35.5px}.mec-gCalendar-search-text-wrap{border-left:0;border-bottom:1px solid #eee;padding:0;margin-bottom:10px}.mec-gCalendar-filters:after,.mec-gCalendar-filters:before{margin:0}}@media (max-width:360px){.mec-gCalendar .fc-header-toolbar .fc-toolbar-chunk:last-child>div.fc-button-group{text-align:left}.mec-gCalendar .fc-header-toolbar .fc-toolbar-chunk:last-child>div:not(#MonthPicker_mec-gCalendar-month-filter){margin-bottom:8px}.mec-gCalendar #mec-gCalendar-wrap h2.fc-toolbar-title{position:relative;width:100%}.mec-gCalendar .fc-header-toolbar .fc-toolbar-chunk:first-child>div{justify-content:left!important}.mec-gCalendar #mec-gCalendar-wrap h2.fc-toolbar-title{font-size:22px}.mec-gCalendar button.fc-button span.fc-icon{font-size:20px;width:30px;height:34px}.mec-gCalendar button.fc-today-button.fc-button.fc-button-primary,.mec-gCalendar button.fc-today-button.fc-button.fc-button-primary:active{padding:9px 8px 12px}.mec-gCalendar-filters:after,.mec-gCalendar-filters:before{margin-left:-100px}.mec-gCalendar-filters{top:60px}.mec-month-picker.datepicker.dropdown-menu{width:215px}.mec-month-picker.datepicker.dropdown-menu{top:37px!important;right:27px}.mec-gCalendar #mec-gCalendar-wrap h2.fc-toolbar-title{font-size:12px;display:inline-block;width:auto}#mec-gCalendar-wrap .openMonthFilter{padding-right:0}.mec-gCalendar button.fc-button span.fc-icon{width:20px;height:27px}.mec-gCalendar button.fc-today-button.fc-button.fc-button-primary,.mec-gCalendar button.fc-today-button.fc-button.fc-button-primary:active{line-height:1}.mec-month-picker.datepicker.dropdown-menu{right:-80px}.mec-month-picker.datepicker:after{right:calc(50% - 3px)}.mec-month-picker.datepicker:before{right:calc(50% - 4px)}.mec-gCalendar .fc-header-toolbar .fc-toolbar-chunk:last-child>div.fc-button-group{text-align:right}.mec-gCalendar-filters{width:300px;right:calc(50% - 150px)}.mec-gCalendar-filters-wrap{padding:15px}.fc-h-event .fc-event-main{font-size:9px;line-height:11px}}@media (max-width:768px){.mec-cart{overflow-x:scroll}}.mec-cart-coupon input[type=text]{min-height:40px;font-size:13px;line-height:38px;color:#606367;border:1px solid #e3e5e7;border-radius:3px;padding:0 12px;margin-bottom:0;box-shadow:unset;width:330px;vertical-align:top}.mec-cart ul{padding:0;list-style:none}.mec-cart ul h5,.mec-cart ul h6{margin:0;font-size:14px;color:#000;font-weight:inherit}.mec-cart ul h6{padding-left:0}.mec-cart ul h6:before{content:"— "}.mec-cart ul h5{font-weight:400;margin:0 0 3px 0}.mec-cart ul h6:last-child{margin-bottom:12px}.mec-cart table td:nth-child(4) ul li{margin-bottom:5px}.mec-cart table td:nth-child(4) ul li:last-child{margin-bottom:12px}.mec-cart table a{font-size:15px;font-weight:400;line-height:20px;color:#474849;fill:#474849}.mec-cart table a:hover{color:#000}.mec-cart table #mec_cart_total_payable,.mec-cart table .mec-transaction-price{font-size:20px;font-weight:700;line-height:26px;letter-spacing:-.8px;text-align:right;color:#060607;fill:#060607}.mec-cart table .mec-line-through{text-decoration:line-through}.mec-cart table .mec-cart-remove-transactions svg:hover,.mec-cart table .mec-cart-remove-transactions svg:hover path{color:red!important;fill:red!important;cursor:pointer}.mec-cart table tr{text-align:left}.mec-cart table tr th{margin-bottom:27px;margin-top:0;padding:9px 12px 9px;font-size:14px;line-height:1.8;letter-spacing:0;font-weight:600;position:relative;color:#000}.mec-cart table tr td{padding:9px 12px 9px;font-size:14px;color:#000}.mec-cart table tr td a:hover{color:#000;text-decoration:underline}.mec-cart table tr td,.mec-cart table tr th{background-color:#fff!important;border:0!important;vertical-align:middle}.mec-cart table tr{border-top:1px solid rgba(0,0,0,.1)}.mec-cart table tr th:last-child{text-align:right}.mec-cart table tr{border-top:1px solid rgba(0,0,0,.1)}.mec-cart table td:first-child{width:35px;max-width:35px}.mec-cart table td:nth-child(2){width:135px;max-width:135px}.mec-cart table td:nth-child(3),.mec-cart table td:nth-child(4){min-width:200px;width:200px}.mec-cart table td:nth-child(5){font-size:12px}.mec-cart table td:nth-child(6){text-align:right;vertical-align:middle}.mec-cart .mec-cart-coupon-code{font-size:12px;color:#8d9599}.mec-cart table thead tr th{border-bottom:1px solid #a3a3a3!important}.mec-cart table thead tr,.mec-cart table thead tr th{border-top:none!important}@media only screen and (max-width:992px){.mec-cart table{min-width:780px;overflow-x:scroll}}.mec-cart table tfoot tr th:last-child{display:none}.mec-checkout .mec-checkout-list{list-style:none;padding:0;margin:40px 0;display:grid;grid-template-columns:auto auto;column-gap:25px;row-gap:25px;padding-bottom:40px;border-bottom:1px solid #e6e6e6}.mec-checkout .mec-checkout-list .mec-list-items{padding:20px 30px;background:#fff;border:1px solid #e6e6e6;box-shadow:0 2px 0 0 rgb(0 0 0 / 2%)}.mec-checkout .mec-checkout-list .mec-list-items h3{margin-top:20px;margin-bottom:12px;font-size:22px;line-height:27px;letter-spacing:-.4px;font-weight:700;position:relative}.mec-checkout .mec-checkout-list .mec-list-items h5{font-size:18px;font-weight:500;padding-bottom:5px;display:inline;color:#000;margin:0 0 8px 0}.mec-checkout .mec-checkout-list .mec-list-items h6{margin:0;font-size:16px;line-height:23px;color:#8d9599;font-weight:inherit}.mec-checkout .mec-checkout-list .mec-list-items h6{padding-left:0}.mec-checkout .mec-checkout-list .mec-list-items h6:before{content:"— "}.mec-checkout .mec-checkout-list .mec-list-items ul{list-style:none;padding:15px 0 0 0}.mec-checkout .mec-checkout-list .mec-list-items .mec-checkout-price-details{color:#000;border:none;border-radius:2px;background:#f7f7f7;padding:15px;margin:15px 0 0 0;max-width:100%}.mec-checkout .mec-checkout-list .mec-list-items .mec-checkout-price-details li{display:flex;flex-wrap:nowrap;justify-content:space-between}.mec-checkout #mec_cart_total_payable{margin:0 0 40px 0;font-size:29px;line-height:27px;letter-spacing:-.4px;font-weight:700;position:relative;color:#39c36e}.mec-checkout .mec-gateway-comment{margin-top:20px;margin:0 0 20px 0;color:#616161;font-size:14px;line-height:1.8}.mec-checkout .mec-email-stripe input[type=email],.mec-checkout .mec-name-stripe input[type=text]{box-sizing:border-box;height:40px;padding:10px 12px;border:0!important;border-radius:4px;background-color:#fff;box-shadow:0 1px 3px 0 #e6ebf1!important;-webkit-transition:box-shadow 150ms ease;transition:box-shadow 150ms ease;margin-bottom:20px;background:#fff!important;max-width:330px}.mec-checkout label{color:#424242;font-weight:700;font-size:13px;letter-spacing:0;margin:0 0 4px 0;display:block;clear:none;padding:7px 1em 3px 0}.mec-checkout input[type=radio]:before{content:"";display:inline-block;background:#fff;border-radius:24px;width:13px;height:13px;cursor:pointer;margin:1px 0 0 0;border:1px solid #d7d8d9}.mec-checkout input[type=radio]:checked:before{border:0;background:#000}.mec-checkout input[type=radio]{margin:0 4px 0 0;font-size:0}.mec-checkout input[type=checkbox]{float:left}.mec-checkout-gateways-wrapper{max-width:54%;margin-bottom:20px}@media (max-width:768px){.mec-checkout-gateways-wrapper{max-width:100%;margin-bottom:20px}}.mec-checkout .mec-book-form-next-button{float:right;right:30%;width:155px;text-align:center}.mec-checkout .mec-checkout-actions .mec-checkout-cart-link.button{background-color:#c4cace!important;width:155px;text-align:center}.mec-checkout .mec-book-form-next-button:hover,.mec-checkout .mec-checkout-actions .mec-checkout-cart-link.button:hover{background:#000!important}@media (max-width:768px){.mec-checkout .mec-checkout-list{display:block;padding-bottom:20px}.mec-checkout .mec-checkout-list .mec-list-items{margin-bottom:20px;padding:15px}.mec-checkout-gateways-wrapper{max-width:100%;margin-bottom:20px}.mec-checkout .mec-book-form-next-button{right:0}}.mec-checkout-footer{background:#f5f6f7;padding:30px 40px 15px;border-radius:5px}.mec-checkout #mec_cart_total_payable{margin:0 0 15px;font-size:26px;line-height:1;letter-spacing:-.4px;font-weight:700;position:relative;color:#000}.mec-wrap .mec-simple-checkboxes-search{display:table-cell;float:none;padding:0 10px}.mec-wrap .mec-simple-checkboxes-search i{font-size:18px;width:unset;height:unset;background:0 0;border:none;display:inline-block;padding:0;margin-right:10px}.mec-wrap .mec-simple-checkboxes-search label:not(.selectit){font-size:14px;font-weight:600;line-height:20px;color:#313131;display:inline-block;margin-bottom:15px}.mec-wrap .mec-simple-checkboxes-search ul{list-style:none;padding:0}.mec-wrap .mec-simple-checkboxes-search ul li label{line-height:20px;margin-bottom:15px}.mec-load-more-wrap.mec-load-more-scroll-loading{width:100%;height:100%;background:no-repeat rgba(255,255,255,.88) url("../img/ajax-loader.gif") bottom;border-style:none;position:absolute;left:0;right:0;bottom:0;top:0;z-index:9}.mec-nextprev-wrap{margin-top:30px;overflow:hidden;clear:both}.mec-nextprev-next-button,.mec-nextprev-prev-button{margin-right:0}.mec-nextprev-next-button{float:right;clear:both}a.mec-nextprev-next-button{text-decoration:none!important}a.mec-nextprev-next-button:hover{color:var(--mec-color-skin)}.mec-nextprev-prev-button svg{transform:rotate(180deg)}.mec-loading-events:after{content:"";background:rgba(255,255,255,.88) url("../img/ajax-loader.gif") no-repeat center calc(100% - 100px);position:absolute;top:0;right:0;left:0;bottom:0;margin:0 -10px}.mec-credit-url{font-size:11px;text-align:center;color:#919293}.mec-credit-url a{text-decoration:none;color:#919293}body[class*=mec-theme] .mec-wrap a{text-decoration:auto}.mec-ticket-name-description-wrapper h4{margin:0 0 5px 0}.mec-ticket-name-description-wrapper h4 .mec-ticket-attendee-counter,.mec-ticket-name-description-wrapper h4 .mec-ticket-name{font-size:16px;font-weight:500}.gm-style img{max-width:unset!important}.gm-style .gm-style-mtc button{border-radius:0!important}.mec-faq-list{list-style:none;padding:0}.mec-faq-list .mec-faq-item{border-bottom:1px solid #d4d4d4;position:relative}.mec-faq-list .mec-faq-item .mec-faq-toggle-icon{font-size:12px;position:absolute;right:15px;top:32px;z-index:1;cursor:pointer;transition:.3s}.mec-faq-list .mec-faq-item.close .mec-faq-toggle-icon{transform:rotate(180deg)}.mec-faq-list .mec-faq-item .mec-faq-title{padding:25px 15px}.mec-faq-list .mec-faq-item .mec-faq-title h4{font-size:19px;font-weight:700;margin:0;position:relative;white-space:nowrap}.mec-faq-list .mec-faq-item .mec-faq-title h4:after{content:"";position:absolute;top:0;right:0;width:30%;height:100%;background:#000;background:linear-gradient(90deg,rgba(0,0,0,0) 0,#fff 95%,#fff 100%);pointer-events:none}.mec-faq-list .mec-faq-item .mec-faq-content{padding:0 15px 5px;max-height:500px;overflow:hidden;-webkit-transition:max-height .5s linear;-moz-transition:max-height .5s linear;-ms-transition:max-height .5s linear;-o-transition:max-height .5s linear;transition:max-height .5s linear}.mec-faq-list .mec-faq-item.close .mec-faq-content{max-height:0;overflow:hidden}.mec-faq-list .mec-faq-item .mec-faq-content p{color:#6d8193;font-size:14px;font-weight:400;line-height:1.7em;letter-spacing:.2px}.mec-trailer iframe{width:100%}.single-mec-events{overflow-x:hidden}.mec-event-banner{width:calc(100vw - 17px);position:relative;margin-left:calc(-50vw - 10px);left:calc(50% + 18px);min-height:420px;padding:80px 0;text-align:center;margin-bottom:30px}.mec-event-banner-inner{max-width:900px;margin:0 auto;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;position:relative;z-index:1}.mec-event-banner-title .mec-single-title{font-size:46px;font-weight:700;line-height:1.1;color:#fff}.mec-event-banner-datetime{display:flex;justify-content:center;gap:20px;margin-bottom:20px}.mec-event-banner-datetime .mec-single-event-date,.mec-event-banner-datetime .mec-single-event-time,.mec-event-banner-location .mec-single-event-location{display:flex;align-items:baseline;margin:0;padding:0;color:#fff}.mec-event-banner-location .mec-single-event-location{justify-content:center;align-items:center;gap:16px}.mec-event-banner-location>i{display:none}.mec-event-banner-location img{max-width:90px;margin:0}.mec-event-banner-location .mec-single-event-location dl{display:flex;align-items:baseline;gap:7px;flex-direction:row}.mec-event-banner-location .mec-single-event-location img+dl{flex-direction:column}.mec-event-banner-location .mec-single-event-location dl dd{display:flex;align-items:baseline;gap:5px}.mec-event-banner-location .mec-single-event-location dl dd *{color:#fff}.mec-event-banner-location .mec-single-event-location dl dd address.mec-events-address{font-size:16px;line-height:1.5}.mec-event-banner-datetime .mec-single-event-date h3.mec-date,.mec-event-banner-datetime .mec-single-event-time h3.mec-time,.mec-event-banner-location .mec-single-event-location .mec-location{display:none}.mec-event-banner-datetime .mec-single-event-date i,.mec-event-banner-datetime .mec-single-event-time i{margin-right:5px}.mec-event-banner-datetime .mec-single-event-date dl dd,.mec-event-banner-datetime .mec-single-event-time dl dd,.mec-event-banner-location .mec-single-event-location dl dd{margin:0}.mec-event-banner-datetime .mec-single-event-time .mec-time-comment{position:absolute;top:15px;left:20px}.mec-event-banner-datetime .mec-single-event-date{position:static}.mec-event-banner-datetime .mec-single-event-date .mec-holding-status{position:absolute;bottom:0;color:#fff;width:100px;padding:0 5px;border:1px solid #fff;border-radius:5px;left:calc(50% - 50px)}.mec-event-banner-color{width:calc(100vw - 17px);height:100%;position:absolute;top:0;z-index:0}@media only screen and (max-width:768px){.mec-event-banner{width:100vw;position:relative;margin-left:-50vw;left:50%}.mec-event-banner-color{width:100vw}.mec-event-banner-inner{min-height:400px;max-width:90%}.mec-event-banner-title .mec-single-title{font-size:36px}.mec-event-banner-datetime{flex-direction:column;align-items:center}.mec-event-banner-location .mec-single-event-location{flex-direction:column;align-items:center}.mec-event-banner-location .mec-single-event-location dl{flex-direction:column;align-items:center}}.mec-wrap li.mec-event-social-icon a>svg{width:36px;height:36px;border-radius:50%;padding:7px;fill:#767676;margin-right:3px}.mec-wrap .mec-event-grid-classic li.mec-event-social-icon a.twitter svg,.mec-wrap .mec-event-grid-clean li.mec-event-social-icon a.twitter svg,.mec-wrap .mec-event-grid-modern li.mec-event-social-icon a.twitter svg,.mec-wrap .mec-event-list-standard li.mec-event-social-icon a.twitter svg{margin:0;padding:0;height:36px;width:16px;margin-bottom:-7px}.mec-event-list-modern .mec-event-sharing>li a{display:flex;align-items:center}.mec-event-list-modern .mec-event-sharing>li a svg{border:1px solid #ddd}.mec-event-list-modern .mec-event-sharing{display:flex;align-items:center;flex-wrap:wrap}.mec-subscribe-to-calendar-container{display:flex;flex-direction:column;align-items:end}.mec-wrap button.mec-subscribe-to-calendar-btn{margin-bottom:10px!important;margin-right:0!important;width:180px}.mec-subscribe-to-calendar-items{width:180px;padding:5px 20px;background:#fff;border:1px solid #e6e7e8;border-radius:3px}.mec-subscribe-to-calendar-items a{font-size:14px;color:#8d8d8d;display:block;margin:10px 0;transition:.2s}.mec-subscribe-to-calendar-items a:hover{color:var(--mec-color-skin)}.mec-booking-ticket-variations ul{list-style:none;padding:0}.mec-booking-ticket-variations ul li{margin-bottom:20px}.mec-booking-ticket-variations ul li h5{font-size:16px;margin:0}.mec-booking-ticket-variations ul li p{margin:0}.rtl .mec-gCalendar #mec-gCalendar-wrap .fc-header-toolbar.fc-toolbar{flex-direction:row}.rtl .mec-gCalendar #mec-gCalendar-wrap h2.fc-toolbar-title{margin-right:0;margin-left:20px}.rtl .mec-gCalendar button.fc-prevYear-button.fc-button.fc-button-primary{border-right:1px solid #e3e4e5;border-left:none;border-radius:0 7px 7px 0}.rtl .mec-gCalendar button.fc-nextYear-button.fc-button.fc-button-primary{border-left:1px solid #e3e4e5;border-right:none;border-radius:7px 0 0 7px}.rtl .mec-gCalendar-search-text-wrap{border-left:none;border-right:1px solid #e3e4e5;padding-left:0;padding-right:16px}.rtl .mec-gCalendar button.fc-filterEvents-button.fc-button.fc-button-primary{text-align:left;padding-right:32px;padding-left:13px}.rtl .mec-gCalendar button.fc-filterEvents-button.fc-button.fc-button-primary svg{left:unset;right:10px}.rtl .mec-gCalendar button.fc-filterEvents-button.fc-button.fc-button-primary,.rtl .mec-gCalendar button.fc-findEvents-button.fc-button.fc-button-primary,.rtl .mec-gCalendar button.fc-findEvents-button.fc-button.fc-button-primary:active{margin-left:0!important;margin-right:20px!important}.rtl .mec-gCalendar-filters{right:unset;left:calc(50% - 119px)}.rtl #MonthPicker_mec-gCalendar-month-filter:after,.rtl #MonthPicker_mec-gCalendar-month-filter:before,.rtl .mec-gCalendar-filters:after,.rtl .mec-gCalendar-filters:before{left:unset;right:50%;margin-left:unset;margin-right:77px}.rtl .mec-gCalendar-filters-wrap .mec-checkboxes-search i,.rtl .mec-gCalendar-filters-wrap .mec-dropdown-search i,.rtl .mec-gCalendar-filters-wrap .mec-minmax-event-cost i,.rtl .mec-gCalendar-filters-wrap .mec-text-address-search i{border-right:1px solid #e3e4e5;border-left:0;border-radius:0 3px 3px 0}.rtl .mec-gCalendar-filters-wrap .mec-minmax-event-cost input:last-child,.rtl .mec-gCalendar-filters-wrap .mec-text-address-search input,.rtl .mec-gCalendar-filters-wrap .mec-text-address-search input:focus{border-left:1px solid #e3e4e5;border-radius:3px 0 0 3px;border-right:1px solid #e3e4e5}.rtl .nice-select{padding-left:30px;padding-right:18px;text-align:right!important;border-radius:3px 0 0 3px}.rtl .nice-select:after{right:unset;left:15px}.rtl #mec-gCalendar-wrap table.fc-scrollgrid tr th{text-align:right;padding:20px 10px 3px 0}.rtl #mec-gCalendar-wrap table.fc-scrollgrid-sync-table tr td{text-align:right}.rtl .mec-gCalendar table.fc-scrollgrid-sync-table tbody td{border-left:1px solid #eee;border-right:none}.rtl .mec-gCalendar-tooltip-date-text i,.rtl .mec-gCalendar-tooltip-date-time i{margin-right:0;margin-left:8px}.rtl .mec-month-picker.datepicker table thead:first-child tr:first-child th.prev:before{content:"\e606"}.rtl .mec-month-picker.datepicker table thead:first-child tr:first-child th.next:before{content:"\e605"}.entry-content .mec-wrap h1,.entry-content .mec-wrap h2,.entry-content .mec-wrap h3,.entry-content .mec-wrap h4,.entry-content .mec-wrap h5,.entry-content .mec-wrap h6,.mec-events-meta-group-countdown .countdown-w span,.mec-hourly-schedule-speaker-job-title,.mec-hourly-schedule-speaker-name,.mec-single-event .mec-event-meta dt,.mec-ticket-available-spots .mec-event-ticket-name,.mec-wrap h1,.mec-wrap h2,.mec-wrap h3,.mec-wrap h4,.mec-wrap h5,.mec-wrap h6,.post-type-archive-mec-events h1,.tax-mec_category h1{font-family:var(--mec-heading-font-family),Helvetica,Arial,sans-serif}.lity-content .mec-events-meta-group-booking .mec-event-ticket-available,.mec-breadcrumbs .mec-current,.mec-breadcrumbs a,.mec-breadcrumbs span .mec-event-content p,.mec-event-data-field-items,.mec-event-data-fields .mec-event-data-field-item .mec-event-data-field-name,.mec-event-data-fields .mec-event-data-field-item .mec-event-data-field-value,.mec-event-schedule-content dl dt,.mec-events-button,.mec-events-meta-group-tags,.mec-events-meta-group-tags a,.mec-hourly-schedule-speaker-description,.mec-load-more-button,.mec-next-occ-booking span,.mec-single-event .mec-event-meta .mec-events-event-cost,.mec-single-event .mec-event-meta dd,.mec-single-event .mec-event-meta dd a,.mec-single-event .mec-events-meta-group-booking .mec-event-ticket-available,.mec-single-event .mec-speakers-details ul li .mec-speaker-job-title,.mec-single-event .mec-speakers-details ul li .mec-speaker-name,.mec-single-modern .mec-single-event-bar>div dd,.mec-wrap .info-msg div,.mec-wrap .mec-error div,.mec-wrap .mec-success div,.mec-wrap .warning-msg div,.mec-wrap abbr,.mec-wrap p{font-family:var(--mec-paragraph-font-family),sans-serif;font-weight:300}.colorskin-custom .mec-events-meta-group-countdown .mec-end-counts h3,.leaflet-popup-content .mec-color,.leaflet-popup-content .mec-color-before :before,.leaflet-popup-content .mec-color-hover:hover,.leaflet-popup-content .mec-wrap .mec-color,.leaflet-popup-content .mec-wrap .mec-color-before :before,.leaflet-popup-content .mec-wrap .mec-color-hover:hover,.lity .mec-color,.lity .mec-color-before :before,.lity .mec-color-hover:hover,.lity .mec-wrap .mec-color,.lity .mec-wrap .mec-color-before :before,.lity .mec-wrap .mec-color-hover:hover,.mec-attendees-list-details .mec-attendee-profile-link a:hover,.mec-av-spot .mec-av-spot-head .mec-av-spot-box span,.mec-booking-calendar-month-navigation .mec-next-month:hover,.mec-booking-calendar-month-navigation .mec-previous-month:hover,.mec-calendar .mec-calendar-side .mec-next-month i,.mec-calendar .mec-event-article .mec-event-title a:hover,.mec-calendar-events-side .mec-modal-booking-button:hover,.mec-calendar.mec-calendar-daily .mec-calendar-d-table .mec-daily-view-day.mec-daily-view-day-active.mec-color,.mec-choosen-time-message,.mec-event-container-classic .mec-modal-booking-button:hover,.mec-event-grid-minimal .mec-modal-booking-button:hover,.mec-event-grid-simple .mec-modal-booking-button,.mec-event-grid-yearly .mec-modal-booking-button,.mec-event-list-minimal .mec-modal-booking-button:hover,.mec-events-agenda .mec-modal-booking-button,.mec-events-timeline-wrap .mec-organizer-item a,.mec-events-timeline-wrap .mec-organizer-item:after,.mec-events-timeline-wrap .mec-shortcode-organizers i,.mec-map-boxshow .mec-color,.mec-map-boxshow .mec-color-before :before,.mec-map-boxshow .mec-color-hover:hover,.mec-map-boxshow .mec-wrap .mec-color,.mec-map-boxshow .mec-wrap .mec-color-before :before,.mec-map-boxshow .mec-wrap .mec-color-hover:hover,.mec-map-boxshow div .mec-map-view-event-detail.mec-event-detail i,.mec-map-boxshow div .mec-map-view-event-detail.mec-event-detail:hover,.mec-marker-infowindow-wp .mec-marker-infowindow-count,.mec-next-event-details a,.mec-next-event-details i:before,.mec-single-event .mec-speakers-details ul li .mec-speaker-name,.mec-skin-list-events-container .mec-data-fields-tooltip .mec-data-fields-tooltip-box ul .mec-event-data-field-item a,.mec-timeline-event .mec-modal-booking-button,.mec-timeline-month-divider,.mec-timetable-t2-col .mec-modal-booking-button:hover,.mec-wrap .mec-map-lightbox-wp.mec-event-list-classic .mec-event-date,.mec-wrap .mec-totalcal-box i,.mec-wrap.colorskin-custom .mec-calendar .mec-calendar-side .mec-next-month:hover,.mec-wrap.colorskin-custom .mec-calendar .mec-calendar-side .mec-next-month:hover .mec-load-month-link,.mec-wrap.colorskin-custom .mec-calendar .mec-calendar-side .mec-previous-month i,.mec-wrap.colorskin-custom .mec-calendar .mec-calendar-side .mec-previous-month:hover,.mec-wrap.colorskin-custom .mec-calendar .mec-calendar-side .mec-previous-month:hover .mec-load-month-link,.mec-wrap.colorskin-custom .mec-calendar.mec-event-calendar-classic .mec-selected-day,.mec-wrap.colorskin-custom .mec-calendar.mec-event-calendar-classic dt.mec-selected-day:hover,.mec-wrap.colorskin-custom .mec-color,.mec-wrap.colorskin-custom .mec-color-before :before,.mec-wrap.colorskin-custom .mec-color-hover:hover,.mec-wrap.colorskin-custom .mec-event-grid-simple .mec-event-title:hover,.mec-wrap.colorskin-custom .mec-event-list-classic a.magicmore:hover,.mec-wrap.colorskin-custom .mec-event-sharing-wrap .mec-event-sharing>li:hover a,.mec-wrap.colorskin-custom .mec-events-masonry-cats a.mec-masonry-cat-selected,.mec-wrap.colorskin-custom .mec-events-meta-group.mec-events-meta-group-venue:before,.mec-wrap.colorskin-custom .mec-infowindow-wp h5 a:hover,.mec-wrap.colorskin-custom .mec-next-event-details li i,.mec-wrap.colorskin-custom .mec-single-event .mec-event-meta dd.mec-events-event-categories:before,.mec-wrap.colorskin-custom .mec-single-event-date:before,.mec-wrap.colorskin-custom .mec-single-event-time:before,.mec-wrap.colorskin-custom .mec-totalcal-box .mec-totalcal-view span:hover,.mec-wrap.colorskin-custom .mec-widget .mec-event-grid-classic.owl-carousel .owl-nav i,.mec-wrap.mec-cart table tr td a,.mec-yearly-view-wrap .mec-agenda-event-title a:hover,.mec-yearly-view-wrap .mec-yearly-title-sec .mec-next-year i,.mec-yearly-view-wrap .mec-yearly-title-sec .mec-next-year:hover,.mec-yearly-view-wrap .mec-yearly-title-sec .mec-next-year:hover .mec-load-month-link,.mec-yearly-view-wrap .mec-yearly-title-sec .mec-previous-year i,.mec-yearly-view-wrap .mec-yearly-title-sec .mec-previous-year:hover,.mec-yearly-view-wrap .mec-yearly-title-sec .mec-previous-year:hover .mec-load-month-link{color:var(--mec-color-skin)}.mec-event-list-standard .mec-event-meta svg path,.mec-wrap .mec-event-sharing-wrap .mec-event-sharing>li:hover a svg{fill:var(--mec-color-skin)}#wrap .mec-wrap article.mec-event-countdown-style1,.colorskin-custom .mec-event-sharing-wrap:hover>li,.event-carousel-type1-head .mec-event-date-carousel,.mec-booking button,.mec-booking-tooltip.multiple-time .mec-booking-calendar-date.mec-active,.mec-booking-tooltip.multiple-time .mec-booking-calendar-date:hover,.mec-calendar .mec-has-event:after,.mec-event-countdown-style1 .mec-event-countdown-part3 a.mec-event-button,.mec-event-countdown-style3 .mec-event-date,.mec-events-progress-bar progress::-webkit-progress-value,.mec-events-progress-bar progress:after,.mec-has-event-for-booking.mec-active .mec-calendar-novel-selected-day,.mec-map-get-direction-btn-cnt input[type=submit],.mec-ongoing-normal-label,.mec-skin-carousel-container .mec-event-footer-carousel-type3 .mec-modal-booking-button:hover,.mec-wrap .flip-clock-wrapper ul li a div div.inn,.mec-wrap .mec-event-countdown-style2,.mec-wrap .mec-totalcal-box .mec-totalcal-view span.mec-totalcalview-selected,.mec-wrap.colorskin-custom .mec-bg-color,.mec-wrap.colorskin-custom .mec-bg-color-hover:hover,.mec-wrap.colorskin-custom .mec-calendar .mec-calendar-row dt.mec-has-event:hover,.mec-wrap.colorskin-custom .mec-calendar .mec-has-event:after,.mec-wrap.colorskin-custom .mec-calendar .mec-selected-day:hover,.mec-wrap.colorskin-custom .mec-calendar:not(.mec-event-calendar-classic) .mec-selected-day,.mec-wrap.colorskin-custom .mec-event-grid-clean .mec-event-date,.mec-wrap.colorskin-custom .mec-event-list-modern .mec-event-sharing .mec-event-share:hover .mec-event-sharing-icon,.mec-wrap.colorskin-custom .mec-event-list-modern .mec-event-sharing li:hover a i,.mec-wrap.colorskin-custom .mec-event-list-modern .mec-event-sharing>li:hover a i,.mec-wrap.colorskin-custom .mec-event-sharing .mec-event-share:hover .event-sharing-icon,.mec-wrap.colorskin-custom .mec-timeline-events-container .mec-timeline-event-date:before,.mec-wrap.colorskin-custom .mec-totalcal-box .mec-totalcal-view span.mec-totalcalview-selected,span.mec-marker-wrap{background-color:var(--mec-color-skin)}.mec-booking-tooltip.multiple-time .mec-booking-calendar-date:hover,.mec-calendar-day.mec-active .mec-booking-tooltip.multiple-time .mec-booking-calendar-date.mec-active{background-color:var(--mec-color-skin)}.colorskin-custom .mec-single-event .mec-events-meta-group-booking form>h4:before,.colorskin-custom .mec-single-event .mec-frontbox-title:before,.colorskin-custom .mec-single-event .mec-wrap-checkout h4:before,.event-carousel-type1-head .mec-event-date-carousel:after,.lity-content .mec-booking-progress-bar li.mec-active:after,.lity-content .mec-events-meta-group-booking .mec-wrap-checkout h4:before,.lity-content .mec-events-meta-group-booking form>h4:before,.mec-booking-tooltip.multiple-time .mec-booking-calendar-date.mec-active,.mec-booking-tooltip.multiple-time .mec-booking-calendar-date:hover,.mec-box-title::before,.mec-calendar-day.mec-active .mec-booking-tooltip.multiple-time .mec-booking-calendar-date.mec-active,.mec-events-meta-group-booking .mec-booking-shortcode .mec-wrap-checkout h4:before,.mec-events-meta-group-booking .mec-booking-shortcode form>h4:before,.mec-has-event-for-booking .mec-calendar-novel-selected-day,.mec-marker-infowindow-wp .mec-marker-infowindow-count,.mec-rsvp-form-box form>h4:before,.mec-single-event .mec-events-meta-group-booking .mec-wrap-checkout h4:before,.mec-single-event .mec-events-meta-group-booking form>h4:before,.mec-single-event .mec-frontbox-title:before,.mec-single-event .mec-wrap-checkout h4:before,.mec-skin-carousel-container .mec-event-footer-carousel-type3 .mec-modal-booking-button:hover,.mec-timeline-month-divider,.mec-virtual-event-history h3:before,.mec-wrap .mec-box-title::before,.mec-wrap .mec-totalcal-box .mec-totalcal-view span.mec-totalcalview-selected,.mec-wrap.colorskin-custom .mec-border-color,.mec-wrap.colorskin-custom .mec-border-color-hover:hover,.mec-wrap.colorskin-custom .mec-calendar .mec-calendar-events-side .mec-table-side-day,.mec-wrap.colorskin-custom .mec-event-list-modern .mec-event-sharing .mec-event-share:hover .mec-event-sharing-icon,.mec-wrap.colorskin-custom .mec-event-list-modern .mec-event-sharing>li:hover a i,.mec-wrap.colorskin-custom .mec-event-list-standard .mec-month-divider span:before,.mec-wrap.colorskin-custom .mec-events-masonry-cats a.mec-masonry-cat-selected,.mec-wrap.colorskin-custom .mec-events-masonry-cats a:hover,.mec-wrap.colorskin-custom .mec-single-event .mec-frontbox-title:before,.mec-wrap.colorskin-custom .mec-single-event .mec-social-single:before,.mec-wrap.colorskin-custom .mec-single-event .mec-speakers-details ul li .mec-speaker-avatar a:hover img,.mec-wrap.colorskin-custom .mec-totalcal-box .mec-totalcal-view span.mec-totalcalview-selected{border-color:var(--mec-color-skin)}.mec-calendar.mec-event-container-simple dl dt.mec-selected-day,.mec-calendar.mec-event-container-simple dl dt.mec-selected-day:hover,.mec-wrap.colorskin-custom .mec-event-countdown-style3 .mec-event-date:after,.mec-wrap.colorskin-custom .mec-month-divider span:before{border-bottom-color:var(--mec-color-skin)}.mec-wrap.colorskin-custom article.mec-event-countdown-style1 .mec-event-countdown-part2:after{border-color:transparent transparent transparent var(--mec-color-skin)}.lity-content .button,.lity-content button:not(.owl-dot):not(.gm-control-active):not(.mejs):not(.owl-prev):not( .owl-next ):not(.mec-googlemap-details button):not(.mec-googlemap-skin button),.lity-content input[type=button],.lity-content input[type=reset],.lity-content input[type=submit],.mec-form-row .mec-book-form-next-button.mec-book-form-pay-button,.mec-nextprev-next-button,.mec-nextprev-prev-button,.mec-wrap .button,.mec-wrap button:not(.owl-dot):not(.gm-control-active):not(.mejs):not(.owl-prev):not( .owl-next ):not(.mec-googlemap-details button):not(.mec-googlemap-skin button),.mec-wrap input[type=button],.mec-wrap input[type=reset],.mec-wrap input[type=submit]{color:var(--mec-color-skin);background:var(--mec-color-skin-rgba-1);border-color:var(--mec-color-skin-rgba-1)}.lity-content .button:hover,.lity-content button:not(.owl-dot):not(.gm-control-active):not(.mejs):not(.owl-prev):not( .owl-next ):not(.mec-googlemap-details button):not(.mec-googlemap-skin button):hover,.lity-content input[type=button]:hover,.lity-content input[type=reset]:hover,.lity-content input[type=submit]:hover,.mec-nextprev-next-button:hover,.mec-nextprev-prev-button:hover,.mec-wrap .button:hover,.mec-wrap a.button:hover,.mec-wrap button:not(.owl-dot):not(.gm-control-active):not(.mejs):not(.owl-prev):not( .owl-next ):not(.mec-googlemap-details button):not(.mec-googlemap-skin button):hover,.mec-wrap input[type=button]:hover,.mec-wrap input[type=reset]:hover,.mec-wrap input[type=submit]:hover{border-color:var(--mec-color-skin)}.lity-container .mec-events-meta-group-booking input[type=radio]:checked:before,.mec-events-meta-group-booking .mec-booking-shortcode input[type=radio]:checked:before,.mec-single-event .mec-events-meta-group-booking input[type=radio]:checked:before{background:var(--mec-color-skin);box-shadow:0 0 0 2px var(--mec-color-skin-rgba-1)}.lity-content .button svg path,.lity-content button:not(.owl-dot):not(.gm-control-active):not(.mejs):not(.owl-prev):not( .owl-next ) svg path,.lity-content input[type=button] svg path,.lity-content input[type=reset] svg path,.lity-content input[type=submit] svg path,.mec-nextprev-next-button svg path,.mec-nextprev-prev-button svg path,.mec-wrap .button svg path,.mec-wrap button:not(.owl-dot):not(.gm-control-active):not(.mejs):not(.owl-prev):not( .owl-next ) svg path,.mec-wrap input[type=button] svg path,.mec-wrap input[type=reset] svg path,.mec-wrap input[type=submit] svg path{fill:var(--mec-color-skin)}.mec-wrap .button svg.back path,.mec-wrap button:not(.owl-dot):not(.gm-control-active):not(.mejs):not(.owl-prev):not( .owl-next ):not(.et-fb-button) svg.back path{fill:#636f72}.mec-booking-calendar-month-navigation .mec-next-month:hover a,.mec-booking-calendar-month-navigation .mec-previous-month:hover a{color:var(--mec-color-skin)}.mec-wrap.colorskin-custom .mec-box-shadow-color{box-shadow:0 4px 22px -7px var(--mec-color-skin)}.mec-choosen-time-message,.mec-events-timeline-wrap:before,.mec-timeline-event .mec-modal-booking-button,.mec-wrap.colorskin-custom .mec-timeline-event-categories,.mec-wrap.colorskin-custom .mec-timeline-event-local-time,.mec-wrap.colorskin-custom .mec-timeline-event-location,.mec-wrap.colorskin-custom .mec-timeline-event-organizer,.mec-wrap.colorskin-custom .mec-timeline-event-time{background:var(--mec-color-skin-rgba-4)}@media only screen and (min-width:1200px){.mec-container,body [id*=mec_skin_].mec-fluent-wrap{width:var(--mec-container-normal-width);max-width:var(--mec-container-normal-width)}}@media only screen and (min-width:1921px){.mec-container,body [id*=mec_skin_].mec-fluent-wrap{width:var(--mec-container-large-width);max-width:var(--mec-container-large-width)}}.entry-content .mec-wrap h1 a,.entry-content .mec-wrap h2 a,.entry-content .mec-wrap h3 a,.entry-content .mec-wrap h4 a,.entry-content .mec-wrap h5 a,.entry-content .mec-wrap h6 a,.mec-wrap .mec-calendar .mec-event-article .mec-event-title a,.mec-wrap .mec-event-grid-classic .mec-event-title a,.mec-wrap .mec-event-grid-clean .mec-event-title a,.mec-wrap .mec-event-grid-minimal .mec-event-title a,.mec-wrap .mec-event-grid-modern .mec-event-title a,.mec-wrap .mec-event-grid-simple .mec-event-title a,.mec-wrap .mec-event-list-classic .mec-event-title a,.mec-wrap .mec-event-list-minimal .mec-event-title a,.mec-wrap .mec-event-list-standard .mec-event-title a,.mec-wrap .mec-wrap .mec-event-list-modern .mec-event-title a,.mec-wrap h1 a,.mec-wrap h2 a,.mec-wrap h3 a,.mec-wrap h4 a,.mec-wrap h5 a,.mec-wrap h6 a{color:var(--mec-title-color)}.entry-content .mec-wrap.colorskin-custom h1 a:hover,.entry-content .mec-wrap.colorskin-custom h2 a:hover,.entry-content .mec-wrap.colorskin-custom h3 a:hover,.entry-content .mec-wrap.colorskin-custom h4 a:hover,.entry-content .mec-wrap.colorskin-custom h5 a:hover,.entry-content .mec-wrap.colorskin-custom h6 a:hover,.mec-wrap .mec-calendar .mec-event-article .mec-event-title a:hover,.mec-wrap .mec-event-grid-classic .mec-event-title a:hover,.mec-wrap .mec-event-grid-clean .mec-event-title a:hover,.mec-wrap .mec-event-grid-minimal .mec-event-title a:hover,.mec-wrap .mec-event-grid-modern .mec-event-title a:hover,.mec-wrap .mec-event-grid-simple .mec-event-title a:hover,.mec-wrap .mec-event-list-classic .mec-event-title a:hover,.mec-wrap .mec-event-list-minimal .mec-event-title a:hover,.mec-wrap .mec-event-list-standard .mec-event-title a:hover,.mec-wrap .mec-wrap .mec-event-list-modern .mec-event-title a:hover,.mec-wrap.colorskin-custom h1 a:hover,.mec-wrap.colorskin-custom h2 a:hover,.mec-wrap.colorskin-custom h3 a:hover,.mec-wrap.colorskin-custom h4 a:hover,.mec-wrap.colorskin-custom h5 a:hover,.mec-wrap.colorskin-custom h6 a:hover{color:var(--mec-title-color-hover)}.mec-wrap.colorskin-custom .mec-event-description{color:var(--mec-content-color)}.mec-fes-form #mec_bfixed_form_field_types .button,.mec-fes-form #mec_bfixed_form_field_types .button:before,.mec-fes-form #mec_meta_box_tickets_form [id^=mec_ticket_row] .mec_add_price_date_button,.mec-fes-form #mec_reg_form_field_types .button,.mec-fes-form #mec_reg_form_field_types .button:before,.mec-fes-form .html-active .switch-html,.mec-fes-form .mec-attendees-wrapper .mec-attendees-list .mec-booking-attendees-tooltip:before,.mec-fes-form .mec-form-row .button:not(.wp-color-result),.mec-fes-form .mec-form-row .quicktags-toolbar input.button.button-small,.mec-fes-form .mec-meta-box-fields h4,.mec-fes-form .mec-meta-box-fields h4 label,.mec-fes-form .mec-title span.mec-dashicons,.mec-fes-form .tmce-active .switch-tmce,.mec-fes-form .wp-editor-tabs .wp-switch-editor:active,.mec-fes-form input[type=file],.mec-fes-list ul li a:hover{color:var(--mec-fes-main-color)}.mec-fes-form #mec_reg_form_field_types .button.red:hover,.mec-fes-form #mec_reg_form_field_types .button:hover,.mec-fes-form .mec-form-row .button:not(.wp-color-result):hover,.mec-fes-form .mec-form-row .quicktags-toolbar input.button.button-small:hover,.mec-fes-form button[type=submit].mec-fes-sub-button,.mec-fes-list ul li .mec-fes-event-edit a:hover,.mec-fes-list ul li .mec-fes-event-export a:hover,.mec-fes-list ul li .mec-fes-event-view a:hover{background:var(--mec-fes-main-color);color:#fff}.mec-fes-form #mec_bfixed_form_fields input[type=checkbox]:hover,.mec-fes-form #mec_bfixed_form_fields input[type=radio]:hover,.mec-fes-form #mec_reg_form_field_types .button.red:hover,.mec-fes-form #mec_reg_form_field_types .button:hover,.mec-fes-form #mec_reg_form_fields input[type=checkbox]:hover,.mec-fes-form #mec_reg_form_fields input[type=radio]:hover,.mec-fes-form .mec-attendees-wrapper .mec-attendees-list .w-clearfix:first-child,.mec-fes-form .mec-form-row .button:not(.wp-color-result):hover,.mec-fes-form input[type=checkbox]:hover,.mec-fes-form input[type=file],.mec-fes-form input[type=radio]:hover,.mec-fes-list ul li .mec-fes-event-edit a:hover,.mec-fes-list ul li .mec-fes-event-export a:hover,.mec-fes-list ul li .mec-fes-event-view a:hover{border-color:var(--mec-fes-main-color)}.mec-fes-form button[type=submit].mec-fes-sub-button{box-shadow:0 2px 8px -4px var(--mec-fes-main-color)}.mec-fes-form button[type=submit].mec-fes-sub-button:hover{box-shadow:0 2px 12px -2px var(--mec-fes-main-color)}.mec-fes-form #mec_bfixed_form_fields input[type=checkbox]:checked,.mec-fes-form #mec_bfixed_form_fields input[type=radio]:checked,.mec-fes-form #mec_reg_form_fields input[type=checkbox]:checked,.mec-fes-form #mec_reg_form_fields input[type=radio]:checked,.mec-fes-form .mec-form-row input[type=checkbox]:checked,.mec-fes-form .mec-form-row input[type=radio]:checked{box-shadow:0 1px 6px -2px var(--mec-fes-main-color) inset 0 0 0 3px #fff;border-color:var(--mec-fes-main-color);background:var(--mec-fes-main-color)}.mec-fes-form .mec-available-color-row span.color-selected{box-shadow:0 0 0 2px var(--mec-fes-main-color),0 2px 8px -1px var(--mec-fes-main-color)}.mec-fes-form #mec_meta_box_tickets_form [id^=mec_ticket_row] .mec_add_price_date_button,.mec-fes-form .mce-tinymce.mce-container.mce-panel,.mec-fes-form .mec-form-row .button:not(.wp-color-result):hover{box-shadow:0 2px 6px -3px var(--mec-fes-main-color)}.mec-fes-form,.mec-fes-form .html-active .switch-html,.mec-fes-form .mec-attendees-wrapper .mec-attendees-list .w-clearfix,.mec-fes-form .tmce-active .switch-tmce,.mec-fes-form .wp-editor-tabs .wp-switch-editor:active,.mec-fes-list{background:var(--mec-fes-main-color-rgba-1)}.mec-fes-form .mec-meta-box-fields h4,.mec-fes-form .quicktags-toolbar,.mec-fes-form div.mce-toolbar-grp{background:var(--mec-fes-main-color-rgba-2)}.mec-fes-form ul#mec_bfixed_form_fields li,.mec-fes-form ul#mec_reg_form_fields li{background:var(--mec-fes-main-color-rgba-3)}.mec-fes-form #mec-event-data input[type=date],.mec-fes-form #mec_bfixed_form_field_types .button,.mec-fes-form #mec_bfixed_form_fields input[type=checkbox],.mec-fes-form #mec_bfixed_form_fields input[type=radio],.mec-fes-form #mec_meta_box_tickets_form [id^=mec_ticket_row] .mec_add_price_date_button,.mec-fes-form #mec_reg_form_field_types .button,.mec-fes-form #mec_reg_form_fields input[type=checkbox],.mec-fes-form #mec_reg_form_fields input[type=radio],.mec-fes-form .mce-tinymce.mce-container.mce-panel,.mec-fes-form .mce-toolbar .mce-btn-group .mce-btn.mce-listbox,.mec-fes-form .mec-form-row .button:not(.wp-color-result),.mec-fes-form .mec-meta-box-fields,.mec-fes-form .quicktags-toolbar,.mec-fes-form .wp-editor-tabs .wp-switch-editor,.mec-fes-form div.mce-toolbar-grp,.mec-fes-form input[type=checkbox],.mec-fes-form input[type=email],.mec-fes-form input[type=number],.mec-fes-form input[type=password],.mec-fes-form input[type=radio],.mec-fes-form input[type=tel],.mec-fes-form input[type=text],.mec-fes-form input[type=url],.mec-fes-form select,.mec-fes-form textarea,.mec-fes-form ul#mec_bfixed_form_fields li,.mec-fes-form ul#mec_reg_form_fields li,.mec-fes-list ul li{border-color:var(--mec-fes-main-color-rgba-4)}.mec-fes-form #mec-event-data input[type=date],.mec-fes-form input[type=email],.mec-fes-form input[type=number],.mec-fes-form input[type=password],.mec-fes-form input[type=tel],.mec-fes-form input[type=text],.mec-fes-form input[type=url],.mec-fes-form select,.mec-fes-form textarea{box-shadow:0 2px 5px var(--mec-fes-main-color-rgba-5) inset}.mec-fes-form .mec-form-row .button:not(.wp-color-result),.mec-fes-list ul li{box-shadow:0 2px 6px -4px var(--mec-fes-main-color-rgba-6)}.mec-fes-form #mec_bfixed_form_field_types .button,.mec-fes-form #mec_reg_form_field_types .button,.mec-fes-form .mec-meta-box-fields{box-shadow:0 2px 6px -3px var(--mec-fes-main-color-rgba-6)}.mec-fes-form .quicktags-toolbar,.mec-fes-form div.mce-toolbar-grp{box-shadow:0 1px 0 1px var(--mec-fes-main-color-rgba-6)}.mec-fes-form #mec_bfixed_form_fields input[type=checkbox],.mec-fes-form #mec_bfixed_form_fields input[type=radio],.mec-fes-form #mec_reg_form_fields input[type=checkbox],.mec-fes-form #mec_reg_form_fields input[type=radio],.mec-fes-form input[type=checkbox],.mec-fes-form input[type=radio]{box-shadow:0 1px 3px -1px var(--mec-fes-main-color-rgba-6)}.mec-fluent-current-time-text,.mec-fluent-wrap .mec-agenda-event>i,.mec-fluent-wrap .mec-available-tickets-details i:before,.mec-fluent-wrap .mec-calendar .mec-week-events-container dl>span,.mec-fluent-wrap .mec-calendar.mec-calendar-daily .mec-calendar-d-table.mec-date-labels-container span,.mec-fluent-wrap .mec-calendar.mec-yearly-calendar .mec-calendar-table-head dl dt:first-letter,.mec-fluent-wrap .mec-daily-view-events-left-side .mec-daily-view-events-item>span.mec-time,.mec-fluent-wrap .mec-daily-view-events-left-side .mec-daily-view-events-item>span.mec-time-end,.mec-fluent-wrap .mec-date-details i:before,.mec-fluent-wrap .mec-date-details:before,.mec-fluent-wrap .mec-date-wrap i,.mec-fluent-wrap .mec-event-article .mec-event-title a:hover,.mec-fluent-wrap .mec-event-carousel-type2 .owl-next i,.mec-fluent-wrap .mec-event-carousel-type2 .owl-prev i,.mec-fluent-wrap .mec-event-location i,.mec-fluent-wrap .mec-event-location i:before,.mec-fluent-wrap .mec-event-sharing-wrap .mec-event-sharing li:hover a,.mec-fluent-wrap .mec-more-events-icon,.mec-fluent-wrap .mec-price-details i:before,.mec-fluent-wrap .mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-next,.mec-fluent-wrap .mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-next i,.mec-fluent-wrap .mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-prev,.mec-fluent-wrap .mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-prev i,.mec-fluent-wrap .mec-text-input-search i,.mec-fluent-wrap .mec-time-details:before,.mec-fluent-wrap .mec-totalcal-box .mec-totalcal-view span,.mec-fluent-wrap .mec-totalcal-box .nice-select,.mec-fluent-wrap .mec-totalcal-box .nice-select .list li,.mec-fluent-wrap .mec-totalcal-box .nice-select:after,.mec-fluent-wrap .mec-totalcal-box input,.mec-fluent-wrap .mec-totalcal-box select,.mec-fluent-wrap .mec-venue-details:before,.mec-fluent-wrap.colorskin-custom .mec-color-before :before,.mec-fluent-wrap.mec-skin-masonry-container .mec-events-masonry-cats a.mec-masonry-cat-selected,.mec-fluent-wrap.mec-skin-masonry-container .mec-events-masonry-cats a:hover,.mec-fluent-wrap.mec-timetable-wrap .mec-cell .mec-time,.mec-single-fluent-wrap .mec-event-schedule-content dl dt.mec-schedule-time:before,.mec-single-fluent-wrap .mec-events-meta-group-countdown .mec-end-counts h3,.mec-single-fluent-wrap .mec-local-time-details li:first-child:before,.mec-single-fluent-wrap .mec-local-time-details li:last-child:before,.mec-single-fluent-wrap .mec-local-time-details li:nth-of-type(2):before,.mec-single-fluent-wrap .mec-marker-infowindow-wp .mec-marker-infowindow-count,.mec-single-fluent-wrap .mec-next-event-details a,.mec-single-fluent-wrap .mec-next-event-details i:before,.mec-single-fluent-wrap .mec-single-event-additional-organizers dd i,.mec-single-fluent-wrap .mec-single-event-additional-organizers dd.mec-organizer-description:before,.mec-single-fluent-wrap .mec-single-event-bar>div i,.mec-single-fluent-wrap .mec-single-event-category a,.mec-single-fluent-wrap .mec-single-event-location i,.mec-single-fluent-wrap .mec-single-event-organizer dd i,.mec-single-fluent-wrap .mec-single-event-organizer dd.mec-organizer-description:before{color:var(--mec-fluent-main-color)}.mec-fluent-wrap .mec-totalcal-box input[type=search]::-webkit-input-placeholder{color:var(--mec-fluent-main-color)}.mec-fluent-wrap .mec-totalcal-box input[type=search]::-moz-placeholder{color:var(--mec-fluent-main-color)}.mec-fluent-wrap .mec-totalcal-box input[type=search]:-ms-input-placeholder{color:var(--mec-fluent-main-color)}.mec-fluent-wrap .mec-totalcal-box input[type=search]:-moz-placeholder{color:var(--mec-fluent-main-color)}.mec-fluent-wrap .mec-calendar.mec-event-calendar-classic dl dt.mec-table-nullday,.mec-single-fluent-body .lity-content input::-moz-placeholder,.mec-single-fluent-body .lity-content textarea::-moz-placeholder,.mec-single-fluent-wrap input::-moz-placeholder,.mec-single-fluent-wrap textarea::-moz-placeholder{color:var(--mec-fluent-main-color-rgba-1)}.mec-fluent-wrap .mec-calendar.mec-event-calendar-classic dl dt:hover,.mec-fluent-wrap .mec-event-sharing-wrap .mec-event-social-icon i{color:var(--mec-fluent-main-color-rgba-2)}.mec-fluent-wrap.mec-skin-cover-container .mec-event-cover-fluent-type1 .mec-booking-button:hover,.mec-fluent-wrap.mec-skin-cover-container .mec-event-cover-fluent-type3 .mec-booking-button:hover,.mec-fluent-wrap.mec-skin-cover-container .mec-event-cover-fluent-type4 .mec-booking-button:hover{color:var(--mec-fluent-main-color)}.mec-fluent-wrap.mec-skin-list-wrap .mec-event-article{border-top-color:var(--mec-fluent-main-color);border-left-color:var(--mec-fluent-main-color);border-bottom-color:var(--mec-fluent-main-color)}.mec-fluent-wrap.mec-skin-grid-wrap .mec-event-article .mec-event-content{border-right-color:var(--mec-fluent-main-color);border-left-color:var(--mec-fluent-main-color);border-bottom-color:var(--mec-fluent-main-color)}.mec-fluent-wrap.mec-skin-grid-wrap .mec-event-article .mec-event-image{border-right-color:var(--mec-fluent-main-color);border-left-color:var(--mec-fluent-main-color)}.mec-fluent-wrap .mec-calendar-a-month,.mec-fluent-wrap .mec-calendar-weekly .mec-calendar-d-top,.mec-fluent-wrap .mec-calendar-weekly .mec-calendar-d-top .mec-current-week,.mec-fluent-wrap .mec-calendar.mec-event-calendar-classic .mec-calendar-table-head,.mec-fluent-wrap .mec-event-sharing-wrap .mec-event-sharing,.mec-fluent-wrap .mec-filter-content,.mec-fluent-wrap .mec-load-month,.mec-fluent-wrap .mec-load-more-button:hover,.mec-fluent-wrap .mec-load-year,.mec-fluent-wrap .mec-skin-monthly-view-month-navigator-container,.mec-fluent-wrap .mec-text-input-search input[type=search],.mec-fluent-wrap .mec-totalcal-box .mec-totalcal-view span,.mec-fluent-wrap .mec-totalcal-box .nice-select,.mec-fluent-wrap .mec-totalcal-box input,.mec-fluent-wrap .mec-totalcal-box select,.mec-fluent-wrap .mec-yearly-title-sec,.mec-fluent-wrap .mec-yearly-view-wrap .mec-year-container,.mec-fluent-wrap i.mec-filter-icon,.mec-fluent-wrap.mec-events-agenda-container .mec-events-agenda-wrap,.mec-single-fluent-wrap .mec-event-export-module.mec-frontbox .mec-event-exporting .mec-export-details ul li a:hover,.mec-single-fluent-wrap .mec-event-schedule-content dl,.mec-single-fluent-wrap .mec-event-schedule-content dl:before,.mec-single-fluent-wrap .mec-event-schedule-content dl:first-of-type:after,.mec-single-fluent-wrap .mec-next-event-details a:hover{border-color:var(--mec-fluent-main-color)}.mec-fluent-current-time-first,.mec-fluent-wrap .mec-calendar-weekly .mec-calendar-d-top .mec-load-week,.mec-fluent-wrap .mec-calendar.mec-event-calendar-classic dl dt:first-of-type{border-left-color:var(--mec-fluent-main-color)}.mec-fluent-current-time-last,.mec-fluent-wrap .mec-calendar-weekly .mec-calendar-d-top .mec-current-week,.mec-fluent-wrap .mec-calendar.mec-event-calendar-classic dl dt:last-of-type{border-right-color:var(--mec-fluent-main-color)}.mec-fluent-wrap .mec-calendar.mec-event-calendar-classic dl:last-of-type dt,.mec-fluent-wrap .mec-filter-content:before,.mec-fluent-wrap .mec-more-events,.mec-fluent-wrap.mec-skin-full-calendar-container>.mec-totalcal-box .mec-totalcal-view .mec-fluent-more-views-content:before{border-bottom-color:var(--mec-fluent-main-color)}.mec-fluent-wrap .mec-event-sharing-wrap .mec-event-sharing:before{border-color:var(--mec-fluent-main-color) transparent transparent transparent}.mec-fluent-wrap .mec-event-meta,.mec-fluent-wrap.mec-timetable-wrap .mec-cell{border-left-color:var(--mec-fluent-main-color-rgba-3)}.mec-fluent-wrap .mec-daily-view-events-left-side,.mec-fluent-wrap .mec-yearly-view-wrap .mec-yearly-calendar-sec{border-right-color:var(--mec-fluent-main-color-rgba-3)}.mec-fluent-wrap.mec-events-agenda-container .mec-agenda-events-wrap{border-left-color:var(--mec-fluent-main-color-rgba-3)}.mec-fluent-wrap .mec-more-events .simple-skin-ended:hover,.mec-fluent-wrap dt .mec-more-events .simple-skin-ended:hover,.mec-fluent-wrap.mec-events-agenda-container .mec-events-agenda,.mec-fluent-wrap.mec-skin-slider-container .mec-slider-t1 .mec-slider-t1-content{border-top-color:var(--mec-fluent-main-color-rgba-3);border-bottom-color:var(--mec-fluent-main-color-rgba-3)}.mec-fluent-wrap .mec-calendar.mec-calendar-daily .mec-calendar-d-table,.mec-fluent-wrap.mec-skin-countdown-container .mec-date-wrap,.mec-fluent-wrap.mec-timetable-wrap .mec-cell,.mec-fluent-wrap.mec-timetable-wrap .mec-ttt2-title{border-bottom-color:var(--mec-fluent-main-color-rgba-3)}.mec-fluent-wrap .mec-calendar .mec-week-events-container dt,.mec-fluent-wrap .mec-calendar.mec-event-calendar-classic dl dt,.mec-fluent-wrap .mec-event-countdown li,.mec-fluent-wrap .mec-event-countdown-style3 .mec-event-countdown li,.mec-fluent-wrap .mec-filter-content i,.mec-fluent-wrap .mec-load-more-button,.mec-fluent-wrap .mec-skin-daily-view-events-container,.mec-fluent-wrap .mec-skin-weekly-view-events-container,.mec-fluent-wrap .mec-totalcal-box .nice-select .list,.mec-fluent-wrap .mec-yearly-view-wrap .mec-agenda-event,.mec-fluent-wrap .mec-yearly-view-wrap .mec-calendar.mec-yearly-calendar,.mec-fluent-wrap.mec-timetable-wrap .mec-timetable-t2-wrap,.mec-single-fluent-wrap .mec-event-export-module.mec-frontbox .mec-event-exporting .mec-export-details ul li a,.mec-single-fluent-wrap .mec-event-schedule,.mec-single-fluent-wrap .mec-event-social li.mec-event-social-icon a,.mec-single-fluent-wrap .mec-events-meta-group,.mec-single-fluent-wrap .mec-events-meta-group-booking .nice-select,.mec-single-fluent-wrap .mec-events-meta-group-countdown .countdown-w .block-w,.mec-single-fluent-wrap .mec-events-meta-group-tags a,.mec-single-fluent-wrap .mec-map-get-direction-address-cnt input.mec-map-get-direction-address,.mec-single-fluent-wrap .mec-marker-infowindow-wp .mec-marker-infowindow-count,.mec-single-fluent-wrap .mec-next-event-details a,.mec-single-fluent-wrap .mec-single-links-wrap{border-color:var(--mec-fluent-main-color-rgba-1)}.mec-fluent-wrap .mec-totalcal-box .nice-select:after{border-right-color:var(--mec-fluent-main-color);border-bottom-color:var(--mec-fluent-main-color)}.mec-fluent-wrap .mec-totalcal-box .nice-select .list,.mec-single-fluent-wrap .mec-booking-button,.mec-single-fluent-wrap .mec-events-meta-group-tags a:hover{box-shadow:0 2px 5px var(--mec-fluent-main-color-rgba-4)}.mec-fluent-bg-wrap .mec-fluent-wrap article .mec-booking-button:hover,.mec-fluent-wrap .mec-booking-button:hover,.mec-fluent-wrap .mec-load-more-button:hover{box-shadow:0 4px 10px var(--mec-fluent-main-color-rgba-4)}.mec-fluent-wrap.mec-skin-grid-wrap .mec-event-article,.mec-single-fluent-wrap .mec-event-export-module.mec-frontbox .mec-event-exporting .mec-export-details ul li a:hover,.mec-single-fluent-wrap .mec-next-event-details a:hover{box-shadow:0 4px 10px var(--mec-fluent-main-color-rgba-5)}.mec-single-fluent-wrap .mec-events-meta-group-booking input[type=radio]:checked:before{box-shadow:0 0 0 2px var(--mec-fluent-main-color-rgba-4)}.mec-fluent-wrap .mec-calendar-side .mec-calendar-table,.mec-fluent-wrap .mec-skin-daily-view-events-container,.mec-fluent-wrap .mec-yearly-view-wrap .mec-year-container,.mec-fluent-wrap.mec-events-agenda-container .mec-events-agenda-wrap,.mec-fluent-wrap.mec-timetable-wrap .mec-timetable-t2-wrap{box-shadow:0 5px 33px var(--mec-fluent-main-color-rgba-1)}.mec-fluent-wrap .mec-yearly-view-wrap .mec-agenda-event{box-shadow:0 1px 6px var(--mec-fluent-main-color-rgba-6)}.mec-fluent-wrap .mec-calendar-daily .mec-calendar-day-events,.mec-fluent-wrap .mec-more-events .simple-skin-ended:hover,.mec-fluent-wrap .mec-totalcal-box .nice-select .list li.focus,.mec-fluent-wrap .mec-totalcal-box .nice-select .list li:hover,.mec-fluent-wrap .mec-yearly-view-wrap .mec-yearly-agenda-sec,.mec-fluent-wrap .nicescroll-cursors,.mec-fluent-wrap dt .mec-more-events .simple-skin-ended:hover,.mec-fluent-wrap.mec-skin-countdown-container .mec-date-wrap,.mec-single-fluent-wrap .mec-event-export-module.mec-frontbox .mec-event-exporting .mec-export-details ul li a:hover,.mec-single-fluent-wrap .mec-events-meta-group-tags a:hover,.mec-single-fluent-wrap .mec-next-event-details a:hover,.mec-single-fluent-wrap .mec-related-event-post .mec-date-wrap,.mec-single-fluent-wrap .mec-single-event-category a{background-color:var(--mec-fluent-main-color-rgba-3)}.mec-fluent-current-time,.mec-fluent-wrap h5.mec-more-events-header,.mec-single-fluent-wrap .flip-clock-wrapper ul li a div div.inn{background-color:var(--mec-fluent-main-color)}.mec-fluent-wrap .mec-calendar-weekly .mec-calendar-d-top .mec-current-week,.mec-fluent-wrap .mec-calendar-weekly .mec-calendar-d-top dt.active,.mec-fluent-wrap .mec-filter-content i,.mec-fluent-wrap i.mec-filter-icon.active,.mec-fluent-wrap.mec-skin-carousel-container .mec-event-carousel-type2 .owl-next:hover,.mec-fluent-wrap.mec-skin-carousel-container .mec-event-carousel-type2 .owl-prev:hover,.mec-fluent-wrap.mec-skin-cover-container .mec-date-wrap i,.mec-fluent-wrap.mec-skin-full-calendar-container>.mec-totalcal-box .mec-totalcal-view span.mec-fluent-more-views-icon.active,.mec-fluent-wrap.mec-skin-full-calendar-container>.mec-totalcal-box .mec-totalcal-view span.mec-totalcalview-selected,.mec-fluent-wrap.mec-skin-slider-container .mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-next:hover,.mec-fluent-wrap.mec-skin-slider-container .mec-slider-t1-wrap .mec-owl-theme .owl-nav .owl-prev:hover,.mec-single-event-bar-seperator,.mec-single-fluent-body .lity-content .mec-events-meta-group-booking,.mec-single-fluent-wrap .mec-events-meta-group-countdown{background-color:var(--mec-fluent-main-color-rgba-1)}.mec-fluent-wrap .mec-available-tickets-details span.mec-available-tickets-number,.mec-fluent-wrap .mec-calendar-weekly .mec-calendar-d-top .mec-current-week,.mec-fluent-wrap .mec-calendar-weekly .mec-calendar-d-top dt.active,.mec-fluent-wrap .mec-calendar.mec-event-calendar-classic .mec-calendar-table-head dt.active,.mec-fluent-wrap .mec-color,.mec-fluent-wrap .mec-daily-view-events-left-side h5.mec-daily-today-title span:first-child,.mec-fluent-wrap .mec-event-sharing-wrap>li:first-of-type i,.mec-fluent-wrap .mec-filter-content i,.mec-fluent-wrap .mec-load-month i,.mec-fluent-wrap .mec-load-more-button,.mec-fluent-wrap .mec-load-year i,.mec-fluent-wrap a:hover,.mec-fluent-wrap i.mec-filter-icon,.mec-fluent-wrap.mec-skin-available-spot-container .mec-date-wrap span.mec-event-day-num,.mec-fluent-wrap.mec-skin-carousel-container .event-carousel-type2-head .mec-date-wrap span.mec-event-day-num,.mec-fluent-wrap.mec-skin-countdown-container .mec-date-wrap span.mec-event-day-num,.mec-fluent-wrap.mec-skin-cover-container .mec-date-wrap span.mec-event-day-num,.mec-fluent-wrap.mec-skin-full-calendar-container>.mec-totalcal-box .mec-totalcal-view span.mec-totalcalview-selected,.mec-fluent-wrap.mec-skin-masonry-container .mec-masonry .mec-date-wrap span.mec-event-day-num,.mec-fluent-wrap.mec-skin-slider-container .mec-date-wrap span.mec-event-day-num,.mec-single-fluent-wrap .mec-event-social li.mec-event-social-icon a:hover,.mec-single-fluent-wrap .mec-events-meta-group-tags .mec-event-footer a:hover,.mec-single-fluent-wrap .mec-related-event-post .mec-date-wrap span.mec-event-day-num,.mec-single-fluent-wrap .mec-single-event-category a:hover,.mec-wrap .mec-color-hover:hover{color:var(--mec-fluent-bold-color)}.mec-fluent-wrap .mec-load-month,.mec-fluent-wrap .mec-load-year,.mec-fluent-wrap.mec-skin-carousel-container .mec-owl-theme .owl-dots .owl-dot.active span,.mec-single-fluent-body .lity-content .mec-events-meta-group-booking .mec-book-available-tickets-details>.mec-book-available-tickets-details-header,.mec-single-fluent-wrap .mec-event-social li.mec-event-social-icon a:hover,.mec-single-fluent-wrap .mec-events-meta-group-booking .mec-book-available-tickets-details>.mec-book-available-tickets-details-header{border-color:var(--mec-fluent-bold-color)}.mec-fluent-wrap .mec-calendar .mec-daily-view-day.mec-has-event:after,.mec-fluent-wrap .mec-event-cover-fluent-type2 .mec-event-sharing-wrap:hover>li:first-child,.mec-fluent-wrap.mec-single-fluent-wrap .mec-events-meta-group-booking button,.mec-fluent-wrap.mec-skin-carousel-container .mec-owl-theme .owl-dots .owl-dot.active span,.mec-fluent-wrap.mec-skin-cover-container .mec-event-cover-fluent-type1 .mec-booking-button,.mec-fluent-wrap.mec-skin-cover-container .mec-event-cover-fluent-type2 .mec-date-wrap,.mec-fluent-wrap.mec-skin-cover-container .mec-event-cover-fluent-type3 .mec-booking-button,.mec-fluent-wrap.mec-skin-cover-container .mec-event-cover-fluent-type4 .mec-booking-button,.mec-single-fluent-body .lity-content .mec-events-meta-group-booking button,.mec-single-fluent-wrap .mec-events-meta-group-booking input[type=radio]:checked:before{background-color:var(--mec-fluent-bold-color)}.mec-fluent-wrap .mec-booking-button:hover,.mec-fluent-wrap .mec-load-month:hover,.mec-fluent-wrap .mec-load-more-button:hover,.mec-fluent-wrap .mec-load-year:hover,.mec-fluent-wrap .mec-yearly-view-wrap .mec-calendar.mec-yearly-calendar .mec-has-event:after,.mec-wrap.mec-single-fluent-wrap .button:hover,.mec-wrap.mec-single-fluent-wrap button:not(.owl-dot):not(.gm-control-active):not(.mejs):not(.owl-prev):not( .owl-next ):not(.mec-googlemap-details button):not(.mec-googlemap-skin button):hover,.mec-wrap.mec-single-fluent-wrap input[type=button]:hover,.mec-wrap.mec-single-fluent-wrap input[type=reset]:hover,.mec-wrap.mec-single-fluent-wrap input[type=submit]:hover{background-color:var(--mec-fluent-bg-hover-color)}.mec-fluent-wrap{background-color:var(--mec-fluent-bg-color)}.mec-fluent-wrap .mec-filter-content,.mec-fluent-wrap.mec-skin-masonry-container .mec-masonry .mec-date-wrap,.mec-single-fluent-wrap .mec-event-social li.mec-event-social-icon a:hover{background-color:var(--mec-fluent-second-bg-color)}.mec-fluent-wrap .mec-filter-content:after{border-bottom-color:var(--mec-fluent-second-bg-color)}@media only screen and (min-width:1200px){.mec-theme-saga .mec-container,body [id*=mec_skin_].mec-fluent-wrap{width:inherit;max-width:inherit}}.mec-theme-saga .mec-wrap h1,.mec-theme-saga .mec-wrap h2,.mec-theme-saga .mec-wrap h3,.mec-theme-saga .mec-wrap h4,.mec-theme-saga .mec-wrap h5,.mec-theme-saga .mec-wrap h6{text-align:inherit}.mec-theme-saga .mec-gCalendar h1:after,.mec-theme-saga .mec-gCalendar h2:after,.mec-theme-saga .mec-gCalendar h3:after,.mec-theme-saga .mec-gCalendar h4:after,.mec-theme-saga .mec-gCalendar h5:after,.mec-theme-saga .mec-gCalendar h6:after,.mec-theme-saga .mec-wrap h1:after,.mec-theme-saga .mec-wrap h2:after,.mec-theme-saga .mec-wrap h3:after,.mec-theme-saga .mec-wrap h4:after,.mec-theme-saga .mec-wrap h5:after,.mec-theme-saga .mec-wrap h6:after{display:none}.mec-theme-saga .mec-wrap a img{opacity:1;padding:0;border:none;-webkit-transition:unset;-moz-transition:unset;-o-transition:unset;transition:unset;background:0 0;border-color:unset}.mec-theme-saga .mec-wrap input[type=date],.mec-theme-saga .mec-wrap input[type=datetime-local],.mec-theme-saga .mec-wrap input[type=datetime],.mec-theme-saga .mec-wrap input[type=email],.mec-theme-saga .mec-wrap input[type=month],.mec-theme-saga .mec-wrap input[type=number],.mec-theme-saga .mec-wrap input[type=password],.mec-theme-saga .mec-wrap input[type=search],.mec-theme-saga .mec-wrap input[type=tel],.mec-theme-saga .mec-wrap input[type=text],.mec-theme-saga .mec-wrap input[type=time],.mec-theme-saga .mec-wrap input[type=url],.mec-theme-saga .mec-wrap input[type=week],.mec-theme-saga .mec-wrap select,.mec-theme-saga .mec-wrap textarea{opacity:1;-webkit-transition:unset;-moz-transition:unset;-o-transition:unset;transition:unset}.mec-theme-saga .mec-wrap ol,.mec-theme-saga .mec-wrap ul{margin:0}.mec-theme-saga .mec-wrap dl,.mec-theme-saga .mec-wrap dt{margin:0}.mec-theme-saga .mec-single-event{padding-top:15px}.mec-single-event .mec-events-meta-group-booking form>h4,.mec-theme-saga .lity-content .mec-events-meta-group-booking .mec-wrap-checkout h4,.mec-theme-saga .lity-content .mec-events-meta-group-booking form>h4,.mec-theme-saga .mec-events-meta-group-booking .mec-booking-shortcode .mec-wrap-checkout h4,.mec-theme-saga .mec-events-meta-group-booking .mec-booking-shortcode form>h4,.mec-theme-saga .mec-single-event .mec-events-meta-group-booking .mec-wrap-checkout h4,.mec-theme-saga .mec-single-event .mec-frontbox-title,.mec-theme-saga .mec-single-event .mec-wrap-checkout h4{text-align:center}.mec-event-banner-inner .mec-single-event-location>i{display:none}span.load-more-text{text-decoration:underline;margin-left:5px;cursor:pointer;position:relative}span.load-more-text:before{content:"";width:100px;height:24px;position:absolute;top:0;right:calc(100% + 5px);background-image:linear-gradient(90deg,#0000 0,#fff 100%);z-index:1}.mec-event-meta img.mec-custom-image-icon{width:20px} \ No newline at end of file diff --git a/assets/css/iconfonts.css b/assets/css/iconfonts.css new file mode 100755 index 0000000..86a0983 --- /dev/null +++ b/assets/css/iconfonts.css @@ -0,0 +1,3431 @@ +/* FONTS PATH */ + +@font-face { + font-family: 'FontAwesome'; + src: url('../fonts/fontawesome-webfont.eot?v=4.2.0'); + src: url('../fonts/fontawesome-webfont.eot?#iefix&v=4.2.0') format('embedded-opentype'), + url('../fonts/fontawesome-webfont.woff?v=4.2.0') format('woff'), + url('../fonts/fontawesome-webfont.ttf?v=4.2.0') format('truetype'), + url('../fonts/fontawesome-webfont.svg?v=4.2.0#fontawesomeregular') format('svg'); +} + +@font-face { + font-family: 'simple-line-icons'; + src: url('../fonts/Simple-Line-Icons.eot'); + src: url('../fonts/Simple-Line-Icons.eot?#iefix') format('embedded-opentype'), + url('../fonts/Simple-Line-Icons.ttf') format('truetype'), + url('../fonts/Simple-Line-Icons.woff2') format('woff2'), + url('../fonts/Simple-Line-Icons.woff') format('woff'), + url('../fonts/Simple-Line-Icons.svg?#simple-line-icons') format('svg'); +} + + +[class*="mec-fa-"], +[class*="mec-li_"], +[class*="mec-sl-"] { + speak: none; + font-style: normal; + font-weight: normal; + font-variant: normal; + text-transform: none; + line-height: 1; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + +[class*="mec-fa-"] { + font-family: FontAwesome; +} + +[class*="mec-sl-"] { + font-family: 'simple-line-icons'; +} + + +/* Font Awesome icons */ +.mec-fa-glass:before { + content: "\f000"; +} + +.mec-fa-music:before { + content: "\f001"; +} + +.mec-fa-search:before { + content: "\f002"; +} + +.mec-fa-envelope-o:before { + content: "\f003"; +} + +.mec-fa-heart:before { + content: "\f004"; +} + +.mec-fa-star:before { + content: "\f005"; +} + +.mec-fa-star-o:before { + content: "\f006"; +} + +.mec-fa-user:before { + content: "\f007"; +} + +.mec-fa-film:before { + content: "\f008"; +} + +.mec-fa-th-large:before { + content: "\f009"; +} + +.mec-fa-th:before { + content: "\f00a"; +} + +.mec-fa-th-list:before { + content: "\f00b"; +} + +.mec-fa-check:before { + content: "\f00c"; +} + +.mec-fa-close:before, +.mec-fa-remove:before, +.mec-fa-times:before { + content: "\f00d"; +} + +.mec-fa-search-plus:before { + content: "\f00e"; +} + +.mec-fa-search-minus:before { + content: "\f010"; +} + +.mec-fa-power-off:before { + content: "\f011"; +} + +.mec-fa-signal:before { + content: "\f012"; +} + +.mec-fa-cog:before, +.mec-fa-gear:before { + content: "\f013"; +} + +.mec-fa-trash-o:before { + content: "\f014"; +} + +.mec-fa-home:before { + content: "\f015"; +} + +.mec-fa-file-o:before { + content: "\f016"; +} + +.mec-fa-clock-o:before { + content: "\f017"; +} + +.mec-fa-road:before { + content: "\f018"; +} + +.mec-fa-download:before { + content: "\f019"; +} + +.mec-fa-arrow-circle-o-down:before { + content: "\f01a"; +} + +.mec-fa-arrow-circle-o-up:before { + content: "\f01b"; +} + +.mec-fa-inbox:before { + content: "\f01c"; +} + +.mec-fa-play-circle-o:before { + content: "\f01d"; +} + +.mec-fa-repeat:before, +.mec-fa-rotate-right:before { + content: "\f01e"; +} + +.mec-fa-refresh:before { + content: "\f021"; +} + +.mec-fa-list-alt:before { + content: "\f022"; +} + +.mec-fa-lock:before { + content: "\f023"; +} + +.mec-fa-flag:before { + content: "\f024"; +} + +.mec-fa-headphones:before { + content: "\f025"; +} + +.mec-fa-volume-off:before { + content: "\f026"; +} + +.mec-fa-volume-down:before { + content: "\f027"; +} + +.mec-fa-volume-up:before { + content: "\f028"; +} + +.mec-fa-qrcode:before { + content: "\f029"; +} + +.mec-fa-barcode:before { + content: "\f02a"; +} + +.mec-fa-tag:before { + content: "\f02b"; +} + +.mec-fa-tags:before { + content: "\f02c"; +} + +.mec-fa-book:before { + content: "\f02d"; +} + +.mec-fa-bookmark:before { + content: "\f02e"; +} + +.mec-fa-print:before { + content: "\f02f"; +} + +.mec-fa-camera:before { + content: "\f030"; +} + +.mec-fa-font:before { + content: "\f031"; +} + +.mec-fa-bold:before { + content: "\f032"; +} + +.mec-fa-italic:before { + content: "\f033"; +} + +.mec-fa-text-height:before { + content: "\f034"; +} + +.mec-fa-text-width:before { + content: "\f035"; +} + +.mec-fa-align-left:before { + content: "\f036"; +} + +.mec-fa-align-center:before { + content: "\f037"; +} + +.mec-fa-align-right:before { + content: "\f038"; +} + +.mec-fa-align-justify:before { + content: "\f039"; +} + +.mec-fa-list:before { + content: "\f03a"; +} + +.mec-fa-dedent:before, +.mec-fa-outdent:before { + content: "\f03b"; +} + +.mec-fa-indent:before { + content: "\f03c"; +} + +.mec-fa-video-camera:before { + content: "\f03d"; +} + +.mec-fa-image:before, +.mec-fa-photo:before, +.mec-fa-picture-o:before { + content: "\f03e"; +} + +.mec-fa-pencil:before { + content: "\f040"; +} + +.mec-fa-map-marker:before { + content: "\f041"; +} + +.mec-fa-adjust:before { + content: "\f042"; +} + +.mec-fa-tint:before { + content: "\f043"; +} + +.mec-fa-edit:before, +.mec-fa-pencil-square-o:before { + content: "\f044"; +} + +.mec-fa-share-square-o:before { + content: "\f045"; +} + +.mec-fa-check-square-o:before { + content: "\f046"; +} + +.mec-fa-arrows:before { + content: "\f047"; +} + +.mec-fa-step-backward:before { + content: "\f048"; +} + +.mec-fa-fast-backward:before { + content: "\f049"; +} + +.mec-fa-backward:before { + content: "\f04a"; +} + +.mec-fa-play:before { + content: "\f04b"; +} + +.mec-fa-pause:before { + content: "\f04c"; +} + +.mec-fa-stop:before { + content: "\f04d"; +} + +.mec-fa-forward:before { + content: "\f04e"; +} + +.mec-fa-fast-forward:before { + content: "\f050"; +} + +.mec-fa-step-forward:before { + content: "\f051"; +} + +.mec-fa-eject:before { + content: "\f052"; +} + +.mec-fa-chevron-left:before { + content: "\f053"; +} + +.mec-fa-chevron-right:before { + content: "\f054"; +} + +.mec-fa-plus-circle:before { + content: "\f055"; +} + +.mec-fa-minus-circle:before { + content: "\f056"; +} + +.mec-fa-times-circle:before { + content: "\f057"; +} + +.mec-fa-check-circle:before { + content: "\f058"; +} + +.mec-fa-question-circle:before { + content: "\f059"; +} + +.mec-fa-info-circle:before { + content: "\f05a"; +} + +.mec-fa-crosshairs:before { + content: "\f05b"; +} + +.mec-fa-times-circle-o:before { + content: "\f05c"; +} + +.mec-fa-check-circle-o:before { + content: "\f05d"; +} + +.mec-fa-ban:before { + content: "\f05e"; +} + +.mec-fa-arrow-left:before { + content: "\f060"; +} + +.mec-fa-arrow-right:before { + content: "\f061"; +} + +.mec-fa-arrow-up:before { + content: "\f062"; +} + +.mec-fa-arrow-down:before { + content: "\f063"; +} + +.mec-fa-mail-forward:before, +.mec-fa-share:before { + content: "\f064"; +} + +.mec-fa-expand:before { + content: "\f065"; +} + +.mec-fa-compress:before { + content: "\f066"; +} + +.mec-fa-plus:before { + content: "\f067"; +} + +.mec-fa-minus:before { + content: "\f068"; +} + +.mec-fa-asterisk:before { + content: "\f069"; +} + +.mec-fa-exclamation-circle:before { + content: "\f06a"; +} + +.mec-fa-gift:before { + content: "\f06b"; +} + +.mec-fa-leaf:before { + content: "\f06c"; +} + +.mec-fa-fire:before { + content: "\f06d"; +} + +.mec-fa-eye:before { + content: "\f06e"; +} + +.mec-fa-eye-slash:before { + content: "\f070"; +} + +.mec-fa-exclamation-triangle:before, +.mec-fa-warning:before { + content: "\f071"; +} + +.mec-fa-plane:before { + content: "\f072"; +} + +.mec-fa-calendar:before { + content: "\f073"; +} + +.mec-fa-random:before { + content: "\f074"; +} + +.mec-fa-comment:before { + content: "\f075"; +} + +.mec-fa-magnet:before { + content: "\f076"; +} + +.mec-fa-chevron-up:before { + content: "\f077"; +} + +.mec-fa-chevron-down:before { + content: "\f078"; +} + +.mec-fa-retweet:before { + content: "\f079"; +} + +.mec-fa-shopping-cart:before { + content: "\f07a"; +} + +.mec-fa-folder:before { + content: "\f07b"; +} + +.mec-fa-folder-open:before { + content: "\f07c"; +} + +.mec-fa-arrows-v:before { + content: "\f07d"; +} + +.mec-fa-arrows-h:before { + content: "\f07e"; +} + +.mec-fa-bar-chart-o:before, +.mec-fa-bar-chart:before { + content: "\f080"; +} + +.mec-fa-twitter-square:before { + content: "\f081"; +} + +.mec-fa-facebook-square:before { + content: "\f082"; +} + +.mec-fa-camera-retro:before { + content: "\f083"; +} + +.mec-fa-key:before { + content: "\f084"; +} + +.mec-fa-cogs:before, +.mec-fa-gears:before { + content: "\f085"; +} + +.mec-fa-comments:before { + content: "\f086"; +} + +.mec-fa-thumbs-o-up:before { + content: "\f087"; +} + +.mec-fa-thumbs-o-down:before { + content: "\f088"; +} + +.mec-fa-star-half:before { + content: "\f089"; +} + +.mec-fa-heart-o:before { + content: "\f08a"; +} + +.mec-fa-sign-out:before { + content: "\f08b"; +} + +.mec-fa-linkedin-square:before { + content: "\f08c"; +} + +.mec-fa-thumb-tack:before { + content: "\f08d"; +} + +.mec-fa-external-link:before { + content: "\f08e"; +} + +.mec-fa-sign-in:before { + content: "\f090"; +} + +.mec-fa-trophy:before { + content: "\f091"; +} + +.mec-fa-github-square:before { + content: "\f092"; +} + +.mec-fa-upload:before { + content: "\f093"; +} + +.mec-fa-lemon-o:before { + content: "\f094"; +} + +.mec-fa-phone:before { + content: "\f095"; +} + +.mec-fa-square-o:before { + content: "\f096"; +} + +.mec-fa-bookmark-o:before { + content: "\f097"; +} + +.mec-fa-phone-square:before { + content: "\f098"; +} + +.mec-fa-twitter:before { + content: "\f099"; +} + +.mec-fa-facebook-f:before, +.mec-fa-facebook:before { + content: "\f09a"; +} + +.mec-fa-github:before { + content: "\f09b"; +} + +.mec-fa-unlock:before { + content: "\f09c"; +} + +.mec-fa-credit-card:before { + content: "\f09d"; +} + +.mec-fa-feed:before, +.mec-fa-rss:before { + content: "\f09e"; +} + +.mec-fa-hdd-o:before { + content: "\f0a0"; +} + +.mec-fa-bullhorn:before { + content: "\f0a1"; +} + +.mec-fa-bell:before { + content: "\f0f3"; +} + +.mec-fa-certificate:before { + content: "\f0a3"; +} + +.mec-fa-hand-o-right:before { + content: "\f0a4"; +} + +.mec-fa-hand-o-left:before { + content: "\f0a5"; +} + +.mec-fa-hand-o-up:before { + content: "\f0a6"; +} + +.mec-fa-hand-o-down:before { + content: "\f0a7"; +} + +.mec-fa-arrow-circle-left:before { + content: "\f0a8"; +} + +.mec-fa-arrow-circle-right:before { + content: "\f0a9"; +} + +.mec-fa-arrow-circle-up:before { + content: "\f0aa"; +} + +.mec-fa-arrow-circle-down:before { + content: "\f0ab"; +} + +.mec-fa-globe:before { + content: "\f0ac"; +} + +.mec-fa-wrench:before { + content: "\f0ad"; +} + +.mec-fa-tasks:before { + content: "\f0ae"; +} + +.mec-fa-filter:before { + content: "\f0b0"; +} + +.mec-fa-briefcase:before { + content: "\f0b1"; +} + +.mec-fa-arrows-alt:before { + content: "\f0b2"; +} + +.mec-fa-group:before, +.mec-fa-users:before { + content: "\f0c0"; +} + +.mec-fa-chain:before, +.mec-fa-link:before { + content: "\f0c1"; +} + +.mec-fa-cloud:before { + content: "\f0c2"; +} + +.mec-fa-flask:before { + content: "\f0c3"; +} + +.mec-fa-cut:before, +.mec-fa-scissors:before { + content: "\f0c4"; +} + +.mec-fa-copy:before, +.mec-fa-files-o:before { + content: "\f0c5"; +} + +.mec-fa-paperclip:before { + content: "\f0c6"; +} + +.mec-fa-floppy-o:before, +.mec-fa-save:before { + content: "\f0c7"; +} + +.mec-fa-square:before { + content: "\f0c8"; +} + +.mec-fa-bars:before, +.mec-fa-navicon:before, +.mec-fa-reorder:before { + content: "\f0c9"; +} + +.mec-fa-list-ul:before { + content: "\f0ca"; +} + +.mec-fa-list-ol:before { + content: "\f0cb"; +} + +.mec-fa-strikethrough:before { + content: "\f0cc"; +} + +.mec-fa-underline:before { + content: "\f0cd"; +} + +.mec-fa-table:before { + content: "\f0ce"; +} + +.mec-fa-magic:before { + content: "\f0d0"; +} + +.mec-fa-truck:before { + content: "\f0d1"; +} + +.mec-fa-pinterest:before { + content: "\f0d2"; +} + +.mec-fa-pinterest-square:before { + content: "\f0d3"; +} + +.mec-fa-google-plus-square:before { + content: "\f0d4"; +} + +.mec-fa-google-plus:before { + content: "\f0d5"; +} + +.mec-fa-money:before { + content: "\f0d6"; +} + +.mec-fa-caret-down:before { + content: "\f0d7"; +} + +.mec-fa-caret-up:before { + content: "\f0d8"; +} + +.mec-fa-caret-left:before { + content: "\f0d9"; +} + +.mec-fa-caret-right:before { + content: "\f0da"; +} + +.mec-fa-columns:before { + content: "\f0db"; +} + +.mec-fa-sort:before, +.mec-fa-unsorted:before { + content: "\f0dc"; +} + +.mec-fa-sort-desc:before, +.mec-fa-sort-down:before { + content: "\f0dd"; +} + +.mec-fa-sort-asc:before, +.mec-fa-sort-up:before { + content: "\f0de"; +} + +.mec-fa-envelope:before { + content: "\f0e0"; +} + +.mec-fa-linkedin:before { + content: "\f0e1"; +} + +.mec-fa-rotate-left:before, +.mec-fa-undo:before { + content: "\f0e2"; +} + +.mec-fa-gavel:before, +.mec-fa-legal:before { + content: "\f0e3"; +} + +.mec-fa-dashboard:before, +.mec-fa-tachometer:before { + content: "\f0e4"; +} + +.mec-fa-comment-o:before { + content: "\f0e5"; +} + +.mec-fa-comments-o:before { + content: "\f0e6"; +} + +.mec-fa-bolt:before, +.mec-fa-flash:before { + content: "\f0e7"; +} + +.mec-fa-sitemap:before { + content: "\f0e8"; +} + +.mec-fa-umbrella:before { + content: "\f0e9"; +} + +.mec-fa-clipboard:before, +.mec-fa-paste:before { + content: "\f0ea"; +} + +.mec-fa-lightbulb-o:before { + content: "\f0eb"; +} + +.mec-fa-exchange:before { + content: "\f0ec"; +} + +.mec-fa-cloud-download:before { + content: "\f0ed"; +} + +.mec-fa-cloud-upload:before { + content: "\f0ee"; +} + +.mec-fa-user-md:before { + content: "\f0f0"; +} + +.mec-fa-stethoscope:before { + content: "\f0f1"; +} + +.mec-fa-suitcase:before { + content: "\f0f2"; +} + +.mec-fa-bell-o:before { + content: "\f0a2"; +} + +.mec-fa-coffee:before { + content: "\f0f4"; +} + +.mec-fa-cutlery:before { + content: "\f0f5"; +} + +.mec-fa-file-text-o:before { + content: "\f0f6"; +} + +.mec-fa-building-o:before { + content: "\f0f7"; +} + +.mec-fa-hospital-o:before { + content: "\f0f8"; +} + +.mec-fa-ambulance:before { + content: "\f0f9"; +} + +.mec-fa-medkit:before { + content: "\f0fa"; +} + +.mec-fa-fighter-jet:before { + content: "\f0fb"; +} + +.mec-fa-beer:before { + content: "\f0fc"; +} + +.mec-fa-h-square:before { + content: "\f0fd"; +} + +.mec-fa-plus-square:before { + content: "\f0fe"; +} + +.mec-fa-angle-double-left:before { + content: "\f100"; +} + +.mec-fa-angle-double-right:before { + content: "\f101"; +} + +.mec-fa-angle-double-up:before { + content: "\f102"; +} + +.mec-fa-angle-double-down:before { + content: "\f103"; +} + +.mec-fa-angle-left:before { + content: "\f104"; +} + +.mec-fa-angle-right:before { + content: "\f105"; +} + +.mec-fa-angle-up:before { + content: "\f106"; +} + +.mec-fa-angle-down:before { + content: "\f107"; +} + +.mec-fa-desktop:before { + content: "\f108"; +} + +.mec-fa-laptop:before { + content: "\f109"; +} + +.mec-fa-tablet:before { + content: "\f10a"; +} + +.mec-fa-mobile-phone:before, +.mec-fa-mobile:before { + content: "\f10b"; +} + +.mec-fa-circle-o:before { + content: "\f10c"; +} + +.mec-fa-quote-left:before { + content: "\f10d"; +} + +.mec-fa-quote-right:before { + content: "\f10e"; +} + +.mec-fa-spinner:before { + content: "\f110"; +} + +.mec-fa-circle:before { + content: "\f111"; +} + +.mec-fa-mail-reply:before, +.mec-fa-reply:before { + content: "\f112"; +} + +.mec-fa-github-alt:before { + content: "\f113"; +} + +.mec-fa-folder-o:before { + content: "\f114"; +} + +.mec-fa-folder-open-o:before { + content: "\f115"; +} + +.mec-fa-smile-o:before { + content: "\f118"; +} + +.mec-fa-frown-o:before { + content: "\f119"; +} + +.mec-fa-meh-o:before { + content: "\f11a"; +} + +.mec-fa-gamepad:before { + content: "\f11b"; +} + +.mec-fa-keyboard-o:before { + content: "\f11c"; +} + +.mec-fa-flag-o:before { + content: "\f11d"; +} + +.mec-fa-flag-checkered:before { + content: "\f11e"; +} + +.mec-fa-terminal:before { + content: "\f120"; +} + +.mec-fa-code:before { + content: "\f121"; +} + +.mec-fa-mail-reply-all:before, +.mec-fa-reply-all:before { + content: "\f122"; +} + +.mec-fa-star-half-empty:before, +.mec-fa-star-half-full:before, +.mec-fa-star-half-o:before { + content: "\f123"; +} + +.mec-fa-location-arrow:before { + content: "\f124"; +} + +.mec-fa-crop:before { + content: "\f125"; +} + +.mec-fa-code-fork:before { + content: "\f126"; +} + +.mec-fa-chain-broken:before, +.mec-fa-unlink:before { + content: "\f127"; +} + +.mec-fa-question:before { + content: "\f128"; +} + +.mec-fa-info:before { + content: "\f129"; +} + +.mec-fa-exclamation:before { + content: "\f12a"; +} + +.mec-fa-superscript:before { + content: "\f12b"; +} + +.mec-fa-subscript:before { + content: "\f12c"; +} + +.mec-fa-eraser:before { + content: "\f12d"; +} + +.mec-fa-puzzle-piece:before { + content: "\f12e"; +} + +.mec-fa-microphone:before { + content: "\f130"; +} + +.mec-fa-microphone-slash:before { + content: "\f131"; +} + +.mec-fa-shield:before { + content: "\f132"; +} + +.mec-fa-calendar-o:before { + content: "\f133"; +} + +.mec-fa-fire-extinguisher:before { + content: "\f134"; +} + +.mec-fa-rocket:before { + content: "\f135"; +} + +.mec-fa-maxcdn:before { + content: "\f136"; +} + +.mec-fa-chevron-circle-left:before { + content: "\f137"; +} + +.mec-fa-chevron-circle-right:before { + content: "\f138"; +} + +.mec-fa-chevron-circle-up:before { + content: "\f139"; +} + +.mec-fa-chevron-circle-down:before { + content: "\f13a"; +} + +.mec-fa-html5:before { + content: "\f13b"; +} + +.mec-fa-css3:before { + content: "\f13c"; +} + +.mec-fa-anchor:before { + content: "\f13d"; +} + +.mec-fa-unlock-alt:before { + content: "\f13e"; +} + +.mec-fa-bullseye:before { + content: "\f140"; +} + +.mec-fa-ellipsis-h:before { + content: "\f141"; +} + +.mec-fa-ellipsis-v:before { + content: "\f142"; +} + +.mec-fa-rss-square:before { + content: "\f143"; +} + +.mec-fa-play-circle:before { + content: "\f144"; +} + +.mec-fa-ticket:before { + content: "\f145"; +} + +.mec-fa-minus-square:before { + content: "\f146"; +} + +.mec-fa-minus-square-o:before { + content: "\f147"; +} + +.mec-fa-level-up:before { + content: "\f148"; +} + +.mec-fa-level-down:before { + content: "\f149"; +} + +.mec-fa-check-square:before { + content: "\f14a"; +} + +.mec-fa-pencil-square:before { + content: "\f14b"; +} + +.mec-fa-external-link-square:before { + content: "\f14c"; +} + +.mec-fa-share-square:before { + content: "\f14d"; +} + +.mec-fa-compass:before { + content: "\f14e"; +} + +.mec-fa-caret-square-o-down:before, +.mec-fa-toggle-down:before { + content: "\f150"; +} + +.mec-fa-caret-square-o-up:before, +.mec-fa-toggle-up:before { + content: "\f151"; +} + +.mec-fa-caret-square-o-right:before, +.mec-fa-toggle-right:before { + content: "\f152"; +} + +.mec-fa-eur:before, +.mec-fa-euro:before { + content: "\f153"; +} + +.mec-fa-gbp:before { + content: "\f154"; +} + +.mec-fa-dollar:before, +.mec-fa-usd:before { + content: "\f155"; +} + +.mec-fa-inr:before, +.mec-fa-rupee:before { + content: "\f156"; +} + +.mec-fa-cny:before, +.mec-fa-jpy:before, +.mec-fa-rmb:before, +.mec-fa-yen:before { + content: "\f157"; +} + +.mec-fa-rouble:before, +.mec-fa-rub:before, +.mec-fa-ruble:before { + content: "\f158"; +} + +.mec-fa-krw:before, +.mec-fa-won:before { + content: "\f159"; +} + +.mec-fa-bitcoin:before, +.mec-fa-btc:before { + content: "\f15a"; +} + +.mec-fa-file:before { + content: "\f15b"; +} + +.mec-fa-file-text:before { + content: "\f15c"; +} + +.mec-fa-sort-alpha-asc:before { + content: "\f15d"; +} + +.mec-fa-sort-alpha-desc:before { + content: "\f15e"; +} + +.mec-fa-sort-amount-asc:before { + content: "\f160"; +} + +.mec-fa-sort-amount-desc:before { + content: "\f161"; +} + +.mec-fa-sort-numeric-asc:before { + content: "\f162"; +} + +.mec-fa-sort-numeric-desc:before { + content: "\f163"; +} + +.mec-fa-thumbs-up:before { + content: "\f164"; +} + +.mec-fa-thumbs-down:before { + content: "\f165"; +} + +.mec-fa-youtube-square:before { + content: "\f166"; +} + +.mec-fa-youtube:before { + content: "\f167"; +} + +.mec-fa-xing:before { + content: "\f168"; +} + +.mec-fa-xing-square:before { + content: "\f169"; +} + +.mec-fa-youtube-play:before { + content: "\f16a"; +} + +.mec-fa-dropbox:before { + content: "\f16b"; +} + +.mec-fa-stack-overflow:before { + content: "\f16c"; +} + +.mec-fa-instagram:before { + content: "\f16d"; +} + +.mec-fa-flickr:before { + content: "\f16e"; +} + +.mec-fa-adn:before { + content: "\f170"; +} + +.mec-fa-bitbucket:before { + content: "\f171"; +} + +.mec-fa-bitbucket-square:before { + content: "\f172"; +} + +.mec-fa-tumblr:before { + content: "\f173"; +} + +.mec-fa-tumblr-square:before { + content: "\f174"; +} + +.mec-fa-long-arrow-down:before { + content: "\f175"; +} + +.mec-fa-long-arrow-up:before { + content: "\f176"; +} + +.mec-fa-long-arrow-left:before { + content: "\f177"; +} + +.mec-fa-long-arrow-right:before { + content: "\f178"; +} + +.mec-fa-apple:before { + content: "\f179"; +} + +.mec-fa-windows:before { + content: "\f17a"; +} + +.mec-fa-android:before { + content: "\f17b"; +} + +.mec-fa-linux:before { + content: "\f17c"; +} + +.mec-fa-dribbble:before { + content: "\f17d"; +} + +.mec-fa-skype:before { + content: "\f17e"; +} + +.mec-fa-foursquare:before { + content: "\f180"; +} + +.mec-fa-trello:before { + content: "\f181"; +} + +.mec-fa-female:before { + content: "\f182"; +} + +.mec-fa-male:before { + content: "\f183"; +} + +.mec-fa-gittip:before, +.mec-fa-gratipay:before { + content: "\f184"; +} + +.mec-fa-sun-o:before { + content: "\f185"; +} + +.mec-fa-moon-o:before { + content: "\f186"; +} + +.mec-fa-archive:before { + content: "\f187"; +} + +.mec-fa-bug:before { + content: "\f188"; +} + +.mec-fa-vk:before { + content: "\f189"; +} + +.mec-fa-weibo:before { + content: "\f18a"; +} + +.mec-fa-renren:before { + content: "\f18b"; +} + +.mec-fa-pagelines:before { + content: "\f18c"; +} + +.mec-fa-stack-exchange:before { + content: "\f18d"; +} + +.mec-fa-arrow-circle-o-right:before { + content: "\f18e"; +} + +.mec-fa-arrow-circle-o-left:before { + content: "\f190"; +} + +.mec-fa-caret-square-o-left:before, +.mec-fa-toggle-left:before { + content: "\f191"; +} + +.mec-fa-dot-circle-o:before { + content: "\f192"; +} + +.mec-fa-wheelchair:before { + content: "\f193"; +} + +.mec-fa-vimeo-square:before { + content: "\f194"; +} + +.mec-fa-try:before, +.mec-fa-turkish-lira:before { + content: "\f195"; +} + +.mec-fa-plus-square-o:before { + content: "\f196"; +} + +.mec-fa-space-shuttle:before { + content: "\f197"; +} + +.mec-fa-slack:before { + content: "\f198"; +} + +.mec-fa-envelope-square:before { + content: "\f199"; +} + +.mec-fa-wordpress:before { + content: "\f19a"; +} + +.mec-fa-openid:before { + content: "\f19b"; +} + +.mec-fa-bank:before, +.mec-fa-institution:before, +.mec-fa-university:before { + content: "\f19c"; +} + +.mec-fa-graduation-cap:before, +.mec-fa-mortar-board:before { + content: "\f19d"; +} + +.mec-fa-yahoo:before { + content: "\f19e"; +} + +.mec-fa-google:before { + content: "\f1a0"; +} + +.mec-fa-reddit:before { + content: "\f1a1"; +} + +.mec-fa-reddit-square:before { + content: "\f1a2"; +} + +.mec-fa-stumbleupon-circle:before { + content: "\f1a3"; +} + +.mec-fa-stumbleupon:before { + content: "\f1a4"; +} + +.mec-fa-delicious:before { + content: "\f1a5"; +} + +.mec-fa-digg:before { + content: "\f1a6"; +} + +.mec-fa-pied-piper:before { + content: "\f1a7"; +} + +.mec-fa-pied-piper-alt:before { + content: "\f1a8"; +} + +.mec-fa-drupal:before { + content: "\f1a9"; +} + +.mec-fa-joomla:before { + content: "\f1aa"; +} + +.mec-fa-language:before { + content: "\f1ab"; +} + +.mec-fa-fax:before { + content: "\f1ac"; +} + +.mec-fa-building:before { + content: "\f1ad"; +} + +.mec-fa-child:before { + content: "\f1ae"; +} + +.mec-fa-paw:before { + content: "\f1b0"; +} + +.mec-fa-spoon:before { + content: "\f1b1"; +} + +.mec-fa-cube:before { + content: "\f1b2"; +} + +.mec-fa-cubes:before { + content: "\f1b3"; +} + +.mec-fa-behance:before { + content: "\f1b4"; +} + +.mec-fa-behance-square:before { + content: "\f1b5"; +} + +.mec-fa-steam:before { + content: "\f1b6"; +} + +.mec-fa-steam-square:before { + content: "\f1b7"; +} + +.mec-fa-recycle:before { + content: "\f1b8"; +} + +.mec-fa-automobile:before, +.mec-fa-car:before { + content: "\f1b9"; +} + +.mec-fa-cab:before, +.mec-fa-taxi:before { + content: "\f1ba"; +} + +.mec-fa-tree:before { + content: "\f1bb"; +} + +.mec-fa-spotify:before { + content: "\f1bc"; +} + +.mec-fa-deviantart:before { + content: "\f1bd"; +} + +.mec-fa-soundcloud:before { + content: "\f1be"; +} + +.mec-fa-database:before { + content: "\f1c0"; +} + +.mec-fa-file-pdf-o:before { + content: "\f1c1"; +} + +.mec-fa-file-word-o:before { + content: "\f1c2"; +} + +.mec-fa-file-excel-o:before { + content: "\f1c3"; +} + +.mec-fa-file-powerpoint-o:before { + content: "\f1c4"; +} + +.mec-fa-file-image-o:before, +.mec-fa-file-photo-o:before, +.mec-fa-file-picture-o:before { + content: "\f1c5"; +} + +.mec-fa-file-archive-o:before, +.mec-fa-file-zip-o:before { + content: "\f1c6"; +} + +.mec-fa-file-audio-o:before, +.mec-fa-file-sound-o:before { + content: "\f1c7"; +} + +.mec-fa-file-movie-o:before, +.mec-fa-file-video-o:before { + content: "\f1c8"; +} + +.mec-fa-file-code-o:before { + content: "\f1c9"; +} + +.mec-fa-vine:before { + content: "\f1ca"; +} + +.mec-fa-codepen:before { + content: "\f1cb"; +} + +.mec-fa-jsfiddle:before { + content: "\f1cc"; +} + +.mec-fa-life-bouy:before, +.mec-fa-life-buoy:before, +.mec-fa-life-ring:before, +.mec-fa-life-saver:before, +.mec-fa-support:before { + content: "\f1cd"; +} + +.mec-fa-circle-o-notch:before { + content: "\f1ce"; +} + +.mec-fa-ra:before, +.mec-fa-rebel:before { + content: "\f1d0"; +} + +.mec-fa-empire:before, +.mec-fa-ge:before { + content: "\f1d1"; +} + +.mec-fa-git-square:before { + content: "\f1d2"; +} + +.mec-fa-git:before { + content: "\f1d3"; +} + +.mec-fa-hacker-news:before, +.mec-fa-y-combinator-square:before, +.mec-fa-yc-square:before { + content: "\f1d4"; +} + +.mec-fa-tencent-weibo:before { + content: "\f1d5"; +} + +.mec-fa-qq:before { + content: "\f1d6"; +} + +.mec-fa-wechat:before, +.mec-fa-weixin:before { + content: "\f1d7"; +} + +.mec-fa-paper-plane:before, +.mec-fa-send:before { + content: "\f1d8"; +} + +.mec-fa-paper-plane-o:before, +.mec-fa-send-o:before { + content: "\f1d9"; +} + +.mec-fa-history:before { + content: "\f1da"; +} + +.mec-fa-circle-thin:before { + content: "\f1db"; +} + +.mec-fa-header:before { + content: "\f1dc"; +} + +.mec-fa-paragraph:before { + content: "\f1dd"; +} + +.mec-fa-sliders:before { + content: "\f1de"; +} + +.mec-fa-share-alt:before { + content: "\f1e0"; +} + +.mec-fa-share-alt-square:before { + content: "\f1e1"; +} + +.mec-fa-bomb:before { + content: "\f1e2"; +} + +.mec-fa-futbol-o:before, +.mec-fa-soccer-ball-o:before { + content: "\f1e3"; +} + +.mec-fa-tty:before { + content: "\f1e4"; +} + +.mec-fa-binoculars:before { + content: "\f1e5"; +} + +.mec-fa-plug:before { + content: "\f1e6"; +} + +.mec-fa-slideshare:before { + content: "\f1e7"; +} + +.mec-fa-twitch:before { + content: "\f1e8"; +} + +.mec-fa-yelp:before { + content: "\f1e9"; +} + +.mec-fa-newspaper-o:before { + content: "\f1ea"; +} + +.mec-fa-wifi:before { + content: "\f1eb"; +} + +.mec-fa-calculator:before { + content: "\f1ec"; +} + +.mec-fa-paypal:before { + content: "\f1ed"; +} + +.mec-fa-google-wallet:before { + content: "\f1ee"; +} + +.mec-fa-cc-visa:before { + content: "\f1f0"; +} + +.mec-fa-cc-mastercard:before { + content: "\f1f1"; +} + +.mec-fa-cc-discover:before { + content: "\f1f2"; +} + +.mec-fa-cc-amex:before { + content: "\f1f3"; +} + +.mec-fa-cc-paypal:before { + content: "\f1f4"; +} + +.mec-fa-cc-stripe:before { + content: "\f1f5"; +} + +.mec-fa-bell-slash:before { + content: "\f1f6"; +} + +.mec-fa-bell-slash-o:before { + content: "\f1f7"; +} + +.mec-fa-trash:before { + content: "\f1f8"; +} + +.mec-fa-copyright:before { + content: "\f1f9"; +} + +.mec-fa-at:before { + content: "\f1fa"; +} + +.mec-fa-eyedropper:before { + content: "\f1fb"; +} + +.mec-fa-paint-brush:before { + content: "\f1fc"; +} + +.mec-fa-birthday-cake:before { + content: "\f1fd"; +} + +.mec-fa-area-chart:before { + content: "\f1fe"; +} + +.mec-fa-pie-chart:before { + content: "\f200"; +} + +.mec-fa-line-chart:before { + content: "\f201"; +} + +.mec-fa-lastfm:before { + content: "\f202"; +} + +.mec-fa-lastfm-square:before { + content: "\f203"; +} + +.mec-fa-toggle-off:before { + content: "\f204"; +} + +.mec-fa-toggle-on:before { + content: "\f205"; +} + +.mec-fa-bicycle:before { + content: "\f206"; +} + +.mec-fa-bus:before { + content: "\f207"; +} + +.mec-fa-ioxhost:before { + content: "\f208"; +} + +.mec-fa-angellist:before { + content: "\f209"; +} + +.mec-fa-cc:before { + content: "\f20a"; +} + +.mec-fa-ils:before, +.mec-fa-shekel:before, +.mec-fa-sheqel:before { + content: "\f20b"; +} + +.mec-fa-meanpath:before { + content: "\f20c"; +} + +.mec-fa-buysellads:before { + content: "\f20d"; +} + +.mec-fa-connectdevelop:before { + content: "\f20e"; +} + +.mec-fa-dashcube:before { + content: "\f210"; +} + +.mec-fa-forumbee:before { + content: "\f211"; +} + +.mec-fa-leanpub:before { + content: "\f212"; +} + +.mec-fa-sellsy:before { + content: "\f213"; +} + +.mec-fa-shirtsinbulk:before { + content: "\f214"; +} + +.mec-fa-simplybuilt:before { + content: "\f215"; +} + +.mec-fa-skyatlas:before { + content: "\f216"; +} + +.mec-fa-cart-plus:before { + content: "\f217"; +} + +.mec-fa-cart-arrow-down:before { + content: "\f218"; +} + +.mec-fa-diamond:before { + content: "\f219"; +} + +.mec-fa-ship:before { + content: "\f21a"; +} + +.mec-fa-user-secret:before { + content: "\f21b"; +} + +.mec-fa-motorcycle:before { + content: "\f21c"; +} + +.mec-fa-street-view:before { + content: "\f21d"; +} + +.mec-fa-heartbeat:before { + content: "\f21e"; +} + +.mec-fa-venus:before { + content: "\f221"; +} + +.mec-fa-mars:before { + content: "\f222"; +} + +.mec-fa-mercury:before { + content: "\f223"; +} + +.mec-fa-intersex:before, +.mec-fa-transgender:before { + content: "\f224"; +} + +.mec-fa-transgender-alt:before { + content: "\f225"; +} + +.mec-fa-venus-double:before { + content: "\f226"; +} + +.mec-fa-mars-double:before { + content: "\f227"; +} + +.mec-fa-venus-mars:before { + content: "\f228"; +} + +.mec-fa-mars-stroke:before { + content: "\f229"; +} + +.mec-fa-mars-stroke-v:before { + content: "\f22a"; +} + +.mec-fa-mars-stroke-h:before { + content: "\f22b"; +} + +.mec-fa-neuter:before { + content: "\f22c"; +} + +.mec-fa-genderless:before { + content: "\f22d"; +} + +.mec-fa-facebook-official:before { + content: "\f230"; +} + +.mec-fa-pinterest-p:before { + content: "\f231"; +} + +.mec-fa-whatsapp:before { + content: "\f232"; +} + +.mec-fa-server:before { + content: "\f233"; +} + +.mec-fa-user-plus:before { + content: "\f234"; +} + +.mec-fa-user-times:before { + content: "\f235"; +} + +.mec-fa-bed:before, +.mec-fa-hotel:before { + content: "\f236"; +} + +.mec-fa-viacoin:before { + content: "\f237"; +} + +.mec-fa-train:before { + content: "\f238"; +} + +.mec-fa-subway:before { + content: "\f239"; +} + +.mec-fa-medium:before { + content: "\f23a"; +} + +.mec-fa-y-combinator:before, +.mec-fa-yc:before { + content: "\f23b"; +} + +.mec-fa-optin-monster:before { + content: "\f23c"; +} + +.mec-fa-opencart:before { + content: "\f23d"; +} + +.mec-fa-expeditedssl:before { + content: "\f23e"; +} + +.mec-fa-battery-4:before, +.mec-fa-battery-full:before { + content: "\f240"; +} + +.mec-fa-battery-3:before, +.mec-fa-battery-three-quarters:before { + content: "\f241"; +} + +.mec-fa-battery-2:before, +.mec-fa-battery-half:before { + content: "\f242"; +} + +.mec-fa-battery-1:before, +.mec-fa-battery-quarter:before { + content: "\f243"; +} + +.mec-fa-battery-0:before, +.mec-fa-battery-empty:before { + content: "\f244"; +} + +.mec-fa-mouse-pointer:before { + content: "\f245"; +} + +.mec-fa-i-cursor:before { + content: "\f246"; +} + +.mec-fa-object-group:before { + content: "\f247"; +} + +.mec-fa-object-ungroup:before { + content: "\f248"; +} + +.mec-fa-sticky-note:before { + content: "\f249"; +} + +.mec-fa-sticky-note-o:before { + content: "\f24a"; +} + +.mec-fa-cc-jcb:before { + content: "\f24b"; +} + +.mec-fa-cc-diners-club:before { + content: "\f24c"; +} + +.mec-fa-clone:before { + content: "\f24d"; +} + +.mec-fa-balance-scale:before { + content: "\f24e"; +} + +.mec-fa-hourglass-o:before { + content: "\f250"; +} + +.mec-fa-hourglass-1:before, +.mec-fa-hourglass-start:before { + content: "\f251"; +} + +.mec-fa-hourglass-2:before, +.mec-fa-hourglass-half:before { + content: "\f252"; +} + +.mec-fa-hourglass-3:before, +.mec-fa-hourglass-end:before { + content: "\f253"; +} + +.mec-fa-hourglass:before { + content: "\f254"; +} + +.mec-fa-hand-grab-o:before, +.mec-fa-hand-rock-o:before { + content: "\f255"; +} + +.mec-fa-hand-paper-o:before, +.mec-fa-hand-stop-o:before { + content: "\f256"; +} + +.mec-fa-hand-scissors-o:before { + content: "\f257"; +} + +.mec-fa-hand-lizard-o:before { + content: "\f258"; +} + +.mec-fa-hand-spock-o:before { + content: "\f259"; +} + +.mec-fa-hand-pointer-o:before { + content: "\f25a"; +} + +.mec-fa-hand-peace-o:before { + content: "\f25b"; +} + +.mec-fa-trademark:before { + content: "\f25c"; +} + +.mec-fa-registered:before { + content: "\f25d"; +} + +.mec-fa-creative-commons:before { + content: "\f25e"; +} + +.mec-fa-gg:before { + content: "\f260"; +} + +.mec-fa-gg-circle:before { + content: "\f261"; +} + +.mec-fa-tripadvisor:before { + content: "\f262"; +} + +.mec-fa-odnoklassniki:before { + content: "\f263"; +} + +.mec-fa-odnoklassniki-square:before { + content: "\f264"; +} + +.mec-fa-get-pocket:before { + content: "\f265"; +} + +.mec-fa-wikipedia-w:before { + content: "\f266"; +} + +.mec-fa-safari:before { + content: "\f267"; +} + +.mec-fa-chrome:before { + content: "\f268"; +} + +.mec-fa-firefox:before { + content: "\f269"; +} + +.mec-fa-opera:before { + content: "\f26a"; +} + +.mec-fa-internet-explorer:before { + content: "\f26b"; +} + +.mec-fa-television:before, +.mec-fa-tv:before { + content: "\f26c"; +} + +.mec-fa-contao:before { + content: "\f26d"; +} + +.mec-fa-500px:before { + content: "\f26e"; +} + +.mec-fa-amazon:before { + content: "\f270"; +} + +.mec-fa-calendar-plus-o:before { + content: "\f271"; +} + +.mec-fa-calendar-minus-o:before { + content: "\f272"; +} + +.mec-fa-calendar-times-o:before { + content: "\f273"; +} + +.mec-fa-calendar-check-o:before { + content: "\f274"; +} + +.mec-fa-industry:before { + content: "\f275"; +} + +.mec-fa-map-pin:before { + content: "\f276"; +} + +.mec-fa-map-signs:before { + content: "\f277"; +} + +.mec-fa-map-o:before { + content: "\f278"; +} + +.mec-fa-map:before { + content: "\f279"; +} + +.mec-fa-commenting:before { + content: "\f27a"; +} + +.mec-fa-commenting-o:before { + content: "\f27b"; +} + +.mec-fa-houzz:before { + content: "\f27c"; +} + +.mec-fa-vimeo:before { + content: "\f27d"; +} + +.mec-fa-black-tie:before { + content: "\f27e"; +} + +.mec-fa-fonticons:before { + content: "\f280"; +} + +.mec-fa-reddit-alien:before { + content: "\f281"; +} + +.mec-fa-edge:before { + content: "\f282"; +} + +.mec-fa-credit-card-alt:before { + content: "\f283"; +} + +.mec-fa-codiepie:before { + content: "\f284"; +} + +.mec-fa-modx:before { + content: "\f285"; +} + +.mec-fa-fort-awesome:before { + content: "\f286"; +} + +.mec-fa-usb:before { + content: "\f287"; +} + +.mec-fa-product-hunt:before { + content: "\f288"; +} + +.mec-fa-mixcloud:before { + content: "\f289"; +} + +.mec-fa-scribd:before { + content: "\f28a"; +} + +.mec-fa-pause-circle:before { + content: "\f28b"; +} + +.mec-fa-pause-circle-o:before { + content: "\f28c"; +} + +.mec-fa-stop-circle:before { + content: "\f28d"; +} + +.mec-fa-stop-circle-o:before { + content: "\f28e"; +} + +.mec-fa-shopping-bag:before { + content: "\f290"; +} + +.mec-fa-shopping-basket:before { + content: "\f291"; +} + +.mec-fa-hashtag:before { + content: "\f292"; +} + +.mec-fa-bluetooth:before { + content: "\f293"; +} + +.mec-fa-bluetooth-b:before { + content: "\f294"; +} + +.mec-fa-percent:before { + content: "\f295"; +} + +.mec-fa-gitlab:before { + content: "\f296"; +} + +.mec-fa-wpbeginner:before { + content: "\f297"; +} + +.mec-fa-wpforms:before { + content: "\f298"; +} + +.mec-fa-envira:before { + content: "\f299"; +} + +.mec-fa-universal-access:before { + content: "\f29a"; +} + +.mec-fa-wheelchair-alt:before { + content: "\f29b"; +} + +.mec-fa-question-circle-o:before { + content: "\f29c"; +} + +.mec-fa-blind:before { + content: "\f29d"; +} + +.mec-fa-audio-description:before { + content: "\f29e"; +} + +.mec-fa-volume-control-phone:before { + content: "\f2a0"; +} + +.mec-fa-braille:before { + content: "\f2a1"; +} + +.mec-fa-assistive-listening-systems:before { + content: "\f2a2"; +} + +.mec-fa-american-sign-language-interpreting:before, +.mec-fa-asl-interpreting:before { + content: "\f2a3"; +} + +.mec-fa-deaf:before, +.mec-fa-deafness:before, +.mec-fa-hard-of-hearing:before { + content: "\f2a4"; +} + +.mec-fa-glide:before { + content: "\f2a5"; +} + +.mec-fa-glide-g:before { + content: "\f2a6"; +} + +.mec-fa-sign-language:before, +.mec-fa-signing:before { + content: "\f2a7"; +} + +.mec-fa-low-vision:before { + content: "\f2a8"; +} + +.mec-fa-viadeo:before { + content: "\f2a9"; +} + +.mec-fa-viadeo-square:before { + content: "\f2aa"; +} + +.mec-fa-snapchat:before { + content: "\f2ab"; +} + +.mec-fa-snapchat-ghost:before { + content: "\f2ac"; +} + +.mec-fa-snapchat-square:before { + content: "\f2ad"; +} + +.mec-fa-long-arrow-alt-left:before { + content: "\f060"; +} + +.mec-fa-window-minimize:before { + content: "\f068"; +} + +.mec-fa-long-arrow-alt-right:before { + content: "\f061"; +} + + +/* Simple Line Icons */ +.mec-sl-user:before { + content: "\e005"; +} + +.mec-sl-people:before { + content: "\e001"; +} + +.mec-sl-user-female:before { + content: "\e000"; +} + +.mec-sl-user-follow:before { + content: "\e002"; +} + +.mec-sl-user-following:before { + content: "\e003"; +} + +.mec-sl-user-unfollow:before { + content: "\e004"; +} + +.mec-sl-login:before { + content: "\e066"; +} + +.mec-sl-logout:before { + content: "\e065"; +} + +.mec-sl-emotsmile:before { + content: "\e021"; +} + +.mec-sl-phone:before { + content: "\e600"; +} + +.mec-sl-call-end:before { + content: "\e048"; +} + +.mec-sl-call-in:before { + content: "\e047"; +} + +.mec-sl-call-out:before { + content: "\e046"; +} + +.mec-sl-map:before { + content: "\e033"; +} + +.mec-sl-location-pin:before { + content: "\e096"; +} + +.mec-sl-direction:before { + content: "\e042"; +} + +.mec-sl-directions:before { + content: "\e041"; +} + +.mec-sl-compass:before { + content: "\e045"; +} + +.mec-sl-layers:before { + content: "\e034"; +} + +.mec-sl-menu:before { + content: "\e601"; +} + +.mec-sl-list:before { + content: "\e067"; +} + +.mec-sl-options-vertical:before { + content: "\e602"; +} + +.mec-sl-options:before { + content: "\e603"; +} + +.mec-sl-arrow-down:before { + content: "\e604"; +} + +.mec-sl-arrow-left:before { + content: "\e605"; +} + +.mec-sl-arrow-right:before { + content: "\e606"; +} + +.mec-sl-arrow-up:before { + content: "\e607"; +} + +.mec-sl-arrow-up-circle:before { + content: "\e078"; +} + +.mec-sl-arrow-left-circle:before { + content: "\e07a"; +} + +.mec-sl-arrow-right-circle:before { + content: "\e079"; +} + +.mec-sl-arrow-down-circle:before { + content: "\e07b"; +} + +.mec-sl-check:before { + content: "\e080"; +} + +.mec-sl-clock:before { + content: "\e081"; +} + +.mec-sl-plus:before { + content: "\e095"; +} + +.mec-sl-minus:before { + content: "\e615"; +} + +.mec-sl-close:before { + content: "\e082"; +} + +.mec-sl-event:before { + content: "\e619"; +} + +.mec-sl-exclamation:before { + content: "\e617"; +} + +.mec-sl-organization:before { + content: "\e616"; +} + +.mec-sl-trophy:before { + content: "\e006"; +} + +.mec-sl-screen-smartphone:before { + content: "\e010"; +} + +.mec-sl-screen-desktop:before { + content: "\e011"; +} + +.mec-sl-plane:before { + content: "\e012"; +} + +.mec-sl-notebook:before { + content: "\e013"; +} + +.mec-sl-mustache:before { + content: "\e014"; +} + +.mec-sl-mouse:before { + content: "\e015"; +} + +.mec-sl-magnet:before { + content: "\e016"; +} + +.mec-sl-energy:before { + content: "\e020"; +} + +.mec-sl-disc:before { + content: "\e022"; +} + +.mec-sl-cursor:before { + content: "\e06e"; +} + +.mec-sl-cursor-move:before { + content: "\e023"; +} + +.mec-sl-crop:before { + content: "\e024"; +} + +.mec-sl-chemistry:before { + content: "\e026"; +} + +.mec-sl-speedometer:before { + content: "\e007"; +} + +.mec-sl-shield:before { + content: "\e00e"; +} + +.mec-sl-screen-tablet:before { + content: "\e00f"; +} + +.mec-sl-magic-wand:before { + content: "\e017"; +} + +.mec-sl-hourglass:before { + content: "\e018"; +} + +.mec-sl-graduation:before { + content: "\e019"; +} + +.mec-sl-ghost:before { + content: "\e01a"; +} + +.mec-sl-game-controller:before { + content: "\e01b"; +} + +.mec-sl-fire:before { + content: "\e01c"; +} + +.mec-sl-eyeglass:before { + content: "\e01d"; +} + +.mec-sl-envelope-open:before { + content: "\e01e"; +} + +.mec-sl-envelope-letter:before { + content: "\e01f"; +} + +.mec-sl-bell:before { + content: "\e027"; +} + +.mec-sl-badge:before { + content: "\e028"; +} + +.mec-sl-anchor:before { + content: "\e029"; +} + +.mec-sl-wallet:before { + content: "\e02a"; +} + +.mec-sl-vector:before { + content: "\e02b"; +} + +.mec-sl-speech:before { + content: "\e02c"; +} + +.mec-sl-puzzle:before { + content: "\e02d"; +} + +.mec-sl-printer:before { + content: "\e02e"; +} + +.mec-sl-present:before { + content: "\e02f"; +} + +.mec-sl-playlist:before { + content: "\e030"; +} + +.mec-sl-pin:before { + content: "\e031"; +} + +.mec-sl-picture:before { + content: "\e032"; +} + +.mec-sl-handbag:before { + content: "\e035"; +} + +.mec-sl-globe-alt:before { + content: "\e036"; +} + +.mec-sl-globe:before { + content: "\e037"; +} + +.mec-sl-folder-alt:before { + content: "\e039"; +} + +.mec-sl-folder:before { + content: "\e089"; +} + +.mec-sl-film:before { + content: "\e03a"; +} + +.mec-sl-feed:before { + content: "\e03b"; +} + +.mec-sl-drop:before { + content: "\e03e"; +} + +.mec-sl-drawer:before { + content: "\e03f"; +} + +.mec-sl-docs:before { + content: "\e040"; +} + +.mec-sl-doc:before { + content: "\e085"; +} + +.mec-sl-diamond:before { + content: "\e043"; +} + +.mec-sl-cup:before { + content: "\e044"; +} + +.mec-sl-calculator:before { + content: "\e049"; +} + +.mec-sl-bubbles:before { + content: "\e04a"; +} + +.mec-sl-briefcase:before { + content: "\e04b"; +} + +.mec-sl-book-open:before { + content: "\e04c"; +} + +.mec-sl-basket-loaded:before { + content: "\e04d"; +} + +.mec-sl-basket:before { + content: "\e04e"; +} + +.mec-sl-bag:before { + content: "\e04f"; +} + +.mec-sl-action-undo:before { + content: "\e050"; +} + +.mec-sl-action-redo:before { + content: "\e051"; +} + +.mec-sl-wrench:before { + content: "\e052"; +} + +.mec-sl-umbrella:before { + content: "\e053"; +} + +.mec-sl-trash:before { + content: "\e054"; +} + +.mec-sl-tag:before { + content: "\e055"; +} + +.mec-sl-support:before { + content: "\e056"; +} + +.mec-sl-frame:before { + content: "\e038"; +} + +.mec-sl-size-fullscreen:before { + content: "\e057"; +} + +.mec-sl-size-actual:before { + content: "\e058"; +} + +.mec-sl-shuffle:before { + content: "\e059"; +} + +.mec-sl-share-alt:before { + content: "\e05a"; +} + +.mec-sl-share:before { + content: "\e05b"; +} + +.mec-sl-rocket:before { + content: "\e05c"; +} + +.mec-sl-question:before { + content: "\e05d"; +} + +.mec-sl-pie-chart:before { + content: "\e05e"; +} + +.mec-sl-pencil:before { + content: "\e05f"; +} + +.mec-sl-note:before { + content: "\e060"; +} + +.mec-sl-loop:before { + content: "\e064"; +} + +.mec-sl-home:before { + content: "\e069"; +} + +.mec-sl-grid:before { + content: "\e06a"; +} + +.mec-sl-graph:before { + content: "\e06b"; +} + +.mec-sl-microphone:before { + content: "\e063"; +} + +.mec-sl-music-tone-alt:before { + content: "\e061"; +} + +.mec-sl-music-tone:before { + content: "\e062"; +} + +.mec-sl-earphones-alt:before { + content: "\e03c"; +} + +.mec-sl-earphones:before { + content: "\e03d"; +} + +.mec-sl-equalizer:before { + content: "\e06c"; +} + +.mec-sl-like:before { + content: "\e068"; +} + +.mec-sl-dislike:before { + content: "\e06d"; +} + +.mec-sl-control-start:before { + content: "\e06f"; +} + +.mec-sl-control-rewind:before { + content: "\e070"; +} + +.mec-sl-control-play:before { + content: "\e071"; +} + +.mec-sl-control-pause:before { + content: "\e072"; +} + +.mec-sl-control-forward:before { + content: "\e073"; +} + +.mec-sl-control-end:before { + content: "\e074"; +} + +.mec-sl-volume-1:before { + content: "\e09f"; +} + +.mec-sl-volume-2:before { + content: "\e0a0"; +} + +.mec-sl-volume-off:before { + content: "\e0a1"; +} + +.mec-sl-calendar:before { + content: "\e075"; +} + +.mec-sl-bulb:before { + content: "\e076"; +} + +.mec-sl-chart:before { + content: "\e077"; +} + +.mec-sl-ban:before { + content: "\e07c"; +} + +.mec-sl-bubble:before { + content: "\e07d"; +} + +.mec-sl-camrecorder:before { + content: "\e07e"; +} + +.mec-sl-camera:before { + content: "\e07f"; +} + +.mec-sl-cloud-download:before { + content: "\e083"; +} + +.mec-sl-cloud-upload:before { + content: "\e084"; +} + +.mec-sl-envelope:before { + content: "\e086"; +} + +.mec-sl-eye:before { + content: "\e087"; +} + +.mec-sl-flag:before { + content: "\e088"; +} + +.mec-sl-heart:before { + content: "\e08a"; +} + +.mec-sl-info:before { + content: "\e08b"; +} + +.mec-sl-key:before { + content: "\e08c"; +} + +.mec-sl-link:before { + content: "\e08d"; +} + +.mec-sl-lock:before { + content: "\e08e"; +} + +.mec-sl-lock-open:before { + content: "\e08f"; +} + +.mec-sl-magnifier:before { + content: "\e090"; +} + +.mec-sl-magnifier-add:before { + content: "\e091"; +} + +.mec-sl-magnifier-remove:before { + content: "\e092"; +} + +.mec-sl-paper-clip:before { + content: "\e093"; +} + +.mec-sl-paper-plane:before { + content: "\e094"; +} + +.mec-sl-power:before { + content: "\e097"; +} + +.mec-sl-refresh:before { + content: "\e098"; +} + +.mec-sl-reload:before { + content: "\e099"; +} + +.mec-sl-settings:before { + content: "\e09a"; +} + +.mec-sl-star:before { + content: "\e09b"; +} + +.mec-sl-symbol-female:before { + content: "\e09c"; +} + +.mec-sl-symbol-male:before { + content: "\e09d"; +} + +.mec-sl-target:before { + content: "\e09e"; +} + +.mec-sl-credit-card:before { + content: "\e025"; +} + +.mec-sl-paypal:before { + content: "\e608"; +} + +.mec-sl-social-tumblr:before { + content: "\e00a"; +} + +.mec-sl-social-twitter:before { + content: "\e009"; +} + +.mec-sl-social-facebook:before { + content: "\e00b"; +} + +.mec-sl-social-instagram:before { + content: "\e609"; +} + +.mec-sl-social-linkedin:before { + content: "\e60a"; +} + +.mec-sl-social-pinterest:before { + content: "\e60b"; +} + +.mec-sl-social-github:before { + content: "\e60c"; +} + +.mec-sl-social-google:before { + content: "\e60d"; +} + +.mec-sl-social-reddit:before { + content: "\e60e"; +} + +.mec-sl-social-skype:before { + content: "\e60f"; +} + +.mec-sl-social-dribbble:before { + content: "\e00d"; +} + +.mec-sl-social-behance:before { + content: "\e610"; +} + +.mec-sl-social-foursqare:before { + content: "\e611"; +} + +.mec-sl-social-soundcloud:before { + content: "\e612"; +} + +.mec-sl-social-spotify:before { + content: "\e613"; +} + +.mec-sl-social-stumbleupon:before { + content: "\e614"; +} + +.mec-sl-social-youtube:before { + content: "\e008"; +} + +.mec-sl-social-dropbox:before { + content: "\e00c"; +} + +.mec-sl-social-vkontakte:before { + content: "\e618"; +} + +.mec-sl-social-steam:before { + content: "\e620"; +} + +.mec-sl-sitemap:before { + content: "\e037"; +} + +.mec-sl-map-marker:before { + content: "\e096"; +} + +.mec-sl-clock-o:before { + content: "\e081"; +} \ No newline at end of file diff --git a/assets/css/index.html b/assets/css/index.html new file mode 100755 index 0000000..e69de29 diff --git a/assets/css/mec-general-calendar.css b/assets/css/mec-general-calendar.css new file mode 100755 index 0000000..eff0f4f --- /dev/null +++ b/assets/css/mec-general-calendar.css @@ -0,0 +1 @@ +.fc-icon,.fc-unselectable{-moz-user-select:none;-ms-user-select:none}.fc .fc-button,.fc-icon{text-transform:none;font-weight:400}.fc-not-allowed,.fc-not-allowed .fc-event{cursor:not-allowed}.fc .fc-button:not(:disabled),.fc a[data-navlink],.fc-event.fc-event-draggable,.fc-event[href]{cursor:pointer}.fc-unselectable{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none;-webkit-tap-highlight-color:transparent}.fc{display:flex;flex-direction:column;font-size:1em}.fc .fc-button,.fc-icon{display:inline-block;text-align:center}.fc,.fc *,.fc :after,.fc :before{box-sizing:border-box}.fc table{border-collapse:collapse;border-spacing:0;font-size:1em}.fc th{text-align:center}.fc td,.fc th{vertical-align:top;padding:0}.fc .fc-button,.fc .fc-button .fc-icon,.fc .fc-button-group,.fc .fc-timegrid-slot-label{vertical-align:middle}.fc a[data-navlink]:hover{text-decoration:underline}.fc .fc-button:hover,.fc .fc-list-event-title a,a.fc-event,a.fc-event:hover{text-decoration:none}.fc-direction-ltr{direction:ltr;text-align:left}.fc-direction-rtl{direction:rtl;text-align:right}.fc-theme-standard td,.fc-theme-standard th{border:1px solid #ddd;border:1px solid var(--fc-border-color,#ddd)}.fc-liquid-hack td,.fc-liquid-hack th{position:relative}@font-face{font-family:fcicons;src:url("data:application/x-font-ttf;charset=utf-8;base64,AAEAAAALAIAAAwAwT1MvMg8SBfAAAAC8AAAAYGNtYXAXVtKNAAABHAAAAFRnYXNwAAAAEAAAAXAAAAAIZ2x5ZgYydxIAAAF4AAAFNGhlYWQUJ7cIAAAGrAAAADZoaGVhB20DzAAABuQAAAAkaG10eCIABhQAAAcIAAAALGxvY2ED4AU6AAAHNAAAABhtYXhwAA8AjAAAB0wAAAAgbmFtZXsr690AAAdsAAABhnBvc3QAAwAAAAAI9AAAACAAAwPAAZAABQAAApkCzAAAAI8CmQLMAAAB6wAzAQkAAAAAAAAAAAAAAAAAAAABEAAAAAAAAAAAAAAAAAAAAABAAADpBgPA/8AAQAPAAEAAAAABAAAAAAAAAAAAAAAgAAAAAAADAAAAAwAAABwAAQADAAAAHAADAAEAAAAcAAQAOAAAAAoACAACAAIAAQAg6Qb//f//AAAAAAAg6QD//f//AAH/4xcEAAMAAQAAAAAAAAAAAAAAAQAB//8ADwABAAAAAAAAAAAAAgAANzkBAAAAAAEAAAAAAAAAAAACAAA3OQEAAAAAAQAAAAAAAAAAAAIAADc5AQAAAAABAWIAjQKeAskAEwAAJSc3NjQnJiIHAQYUFwEWMjc2NCcCnuLiDQ0MJAz/AA0NAQAMJAwNDcni4gwjDQwM/wANIwz/AA0NDCMNAAAAAQFiAI0CngLJABMAACUBNjQnASYiBwYUHwEHBhQXFjI3AZ4BAA0N/wAMJAwNDeLiDQ0MJAyNAQAMIw0BAAwMDSMM4uINIwwNDQAAAAIA4gC3Ax4CngATACcAACUnNzY0JyYiDwEGFB8BFjI3NjQnISc3NjQnJiIPAQYUHwEWMjc2NCcB87e3DQ0MIw3VDQ3VDSMMDQ0BK7e3DQ0MJAzVDQ3VDCQMDQ3zuLcMJAwNDdUNIwzWDAwNIwy4twwkDA0N1Q0jDNYMDA0jDAAAAgDiALcDHgKeABMAJwAAJTc2NC8BJiIHBhQfAQcGFBcWMjchNzY0LwEmIgcGFB8BBwYUFxYyNwJJ1Q0N1Q0jDA0Nt7cNDQwjDf7V1Q0N1QwkDA0Nt7cNDQwkDLfWDCMN1Q0NDCQMt7gMIw0MDNYMIw3VDQ0MJAy3uAwjDQwMAAADAFUAAAOrA1UAMwBoAHcAABMiBgcOAQcOAQcOARURFBYXHgEXHgEXHgEzITI2Nz4BNz4BNz4BNRE0JicuAScuAScuASMFITIWFx4BFx4BFx4BFREUBgcOAQcOAQcOASMhIiYnLgEnLgEnLgE1ETQ2Nz4BNz4BNz4BMxMhMjY1NCYjISIGFRQWM9UNGAwLFQkJDgUFBQUFBQ4JCRULDBgNAlYNGAwLFQkJDgUFBQUFBQ4JCRULDBgN/aoCVgQIBAQHAwMFAQIBAQIBBQMDBwQECAT9qgQIBAQHAwMFAQIBAQIBBQMDBwQECASAAVYRGRkR/qoRGRkRA1UFBAUOCQkVDAsZDf2rDRkLDBUJCA4FBQUFBQUOCQgVDAsZDQJVDRkLDBUJCQ4FBAVVAgECBQMCBwQECAX9qwQJAwQHAwMFAQICAgIBBQMDBwQDCQQCVQUIBAQHAgMFAgEC/oAZEhEZGRESGQAAAAADAFUAAAOrA1UAMwBoAIkAABMiBgcOAQcOAQcOARURFBYXHgEXHgEXHgEzITI2Nz4BNz4BNz4BNRE0JicuAScuAScuASMFITIWFx4BFx4BFx4BFREUBgcOAQcOAQcOASMhIiYnLgEnLgEnLgE1ETQ2Nz4BNz4BNz4BMxMzFRQWMzI2PQEzMjY1NCYrATU0JiMiBh0BIyIGFRQWM9UNGAwLFQkJDgUFBQUFBQ4JCRULDBgNAlYNGAwLFQkJDgUFBQUFBQ4JCRULDBgN/aoCVgQIBAQHAwMFAQIBAQIBBQMDBwQECAT9qgQIBAQHAwMFAQIBAQIBBQMDBwQECASAgBkSEhmAERkZEYAZEhIZgBEZGREDVQUEBQ4JCRUMCxkN/asNGQsMFQkIDgUFBQUFBQ4JCBUMCxkNAlUNGQsMFQkJDgUEBVUCAQIFAwIHBAQIBf2rBAkDBAcDAwUBAgICAgEFAwMHBAMJBAJVBQgEBAcCAwUCAQL+gIASGRkSgBkSERmAEhkZEoAZERIZAAABAOIAjQMeAskAIAAAExcHBhQXFjI/ARcWMjc2NC8BNzY0JyYiDwEnJiIHBhQX4uLiDQ0MJAzi4gwkDA0N4uINDQwkDOLiDCQMDQ0CjeLiDSMMDQ3h4Q0NDCMN4uIMIw0MDOLiDAwNIwwAAAABAAAAAQAAa5n0y18PPPUACwQAAAAAANivOVsAAAAA2K85WwAAAAADqwNVAAAACAACAAAAAAAAAAEAAAPA/8AAAAQAAAAAAAOrAAEAAAAAAAAAAAAAAAAAAAALBAAAAAAAAAAAAAAAAgAAAAQAAWIEAAFiBAAA4gQAAOIEAABVBAAAVQQAAOIAAAAAAAoAFAAeAEQAagCqAOoBngJkApoAAQAAAAsAigADAAAAAAACAAAAAAAAAAAAAAAAAAAAAAAAAA4ArgABAAAAAAABAAcAAAABAAAAAAACAAcAYAABAAAAAAADAAcANgABAAAAAAAEAAcAdQABAAAAAAAFAAsAFQABAAAAAAAGAAcASwABAAAAAAAKABoAigADAAEECQABAA4ABwADAAEECQACAA4AZwADAAEECQADAA4APQADAAEECQAEAA4AfAADAAEECQAFABYAIAADAAEECQAGAA4AUgADAAEECQAKADQApGZjaWNvbnMAZgBjAGkAYwBvAG4Ac1ZlcnNpb24gMS4wAFYAZQByAHMAaQBvAG4AIAAxAC4AMGZjaWNvbnMAZgBjAGkAYwBvAG4Ac2ZjaWNvbnMAZgBjAGkAYwBvAG4Ac1JlZ3VsYXIAUgBlAGcAdQBsAGEAcmZjaWNvbnMAZgBjAGkAYwBvAG4Ac0ZvbnQgZ2VuZXJhdGVkIGJ5IEljb01vb24uAEYAbwBuAHQAIABnAGUAbgBlAHIAYQB0AGUAZAAgAGIAeQAgAEkAYwBvAE0AbwBvAG4ALgAAAAMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=") format('truetype');font-weight:400;font-style:normal}.fc-icon{width:1em;height:1em;-webkit-user-select:none;user-select:none;font-family:fcicons!important;speak:none;font-style:normal;font-variant:normal;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.fc-icon-chevron-left:before{content:"\e900"}.fc-icon-chevron-right:before{content:"\e901"}.fc-icon-chevrons-left:before{content:"\e902"}.fc-icon-chevrons-right:before{content:"\e903"}.fc-icon-minus-square:before{content:"\e904"}.fc-icon-plus-square:before{content:"\e905"}.fc-icon-x:before{content:"\e906"}.fc .fc-button{overflow:visible;text-transform:none;margin:0;font-family:inherit}.fc .fc-button::-moz-focus-inner{padding:0;border-style:none}.fc .fc-button{-webkit-appearance:button;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-color:transparent;border:1px solid transparent;padding:.4em .65em;font-size:1em;line-height:1.5;border-radius:.25em}.fc .fc-button:focus{outline:0;box-shadow:0 0 0 .2rem rgba(44,62,80,.25)}.fc .fc-button-primary:focus,.fc .fc-button-primary:not(:disabled).fc-button-active:focus,.fc .fc-button-primary:not(:disabled):active:focus{box-shadow:0 0 0 .2rem rgba(76,91,106,.5)}.fc .fc-button:disabled{opacity:.65}.fc .fc-button-primary{color:#fff;color:var(--fc-button-text-color,#fff);background-color:#2C3E50;background-color:var(--fc-button-bg-color,#2C3E50);border-color:#2C3E50;border-color:var(--fc-button-border-color,#2C3E50)}.fc .fc-button-primary:hover{color:#fff;color:var(--fc-button-text-color,#fff);background-color:#1e2b37;background-color:var(--fc-button-hover-bg-color,#1e2b37);border-color:#1a252f;border-color:var(--fc-button-hover-border-color,#1a252f)}.fc .fc-button-primary:disabled{color:#fff;color:var(--fc-button-text-color,#fff);background-color:#2C3E50;background-color:var(--fc-button-bg-color,#2C3E50);border-color:#2C3E50;border-color:var(--fc-button-border-color,#2C3E50)}.fc .fc-button-primary:not(:disabled).fc-button-active,.fc .fc-button-primary:not(:disabled):active{color:#fff;color:var(--fc-button-text-color,#fff);background-color:#1a252f;background-color:var(--fc-button-active-bg-color,#1a252f);border-color:#151e27;border-color:var(--fc-button-active-border-color,#151e27)}.fc .fc-button .fc-icon{font-size:1.5em}.fc .fc-button-group{position:relative;display:inline-flex}.fc .fc-button-group>.fc-button{position:relative;flex:1 1 auto}.fc .fc-button-group>.fc-button.fc-button-active,.fc .fc-button-group>.fc-button:active,.fc .fc-button-group>.fc-button:focus,.fc .fc-button-group>.fc-button:hover{z-index:1}.fc-direction-ltr .fc-button-group>.fc-button:not(:first-child){margin-left:-1px;border-top-left-radius:0;border-bottom-left-radius:0}.fc-direction-ltr .fc-button-group>.fc-button:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.fc-direction-rtl .fc-button-group>.fc-button:not(:first-child){margin-right:-1px;border-top-right-radius:0;border-bottom-right-radius:0}.fc-direction-rtl .fc-button-group>.fc-button:not(:last-child){border-top-left-radius:0;border-bottom-left-radius:0}.fc .fc-toolbar{display:flex;justify-content:space-between;align-items:center}.fc .fc-toolbar.fc-header-toolbar{margin-bottom:1.5em}.fc .fc-toolbar.fc-footer-toolbar{margin-top:1.5em}.fc .fc-toolbar-title{font-size:1.75em;margin:0}.fc-direction-ltr .fc-toolbar>*>:not(:first-child){margin-left:.75em}.fc-direction-rtl .fc-toolbar>*>:not(:first-child){margin-right:.75em}.fc-direction-rtl .fc-toolbar-ltr{flex-direction:row-reverse}.fc .fc-scroller{-webkit-overflow-scrolling:touch;position:relative}.fc .fc-scroller-liquid{height:100%}.fc .fc-scroller-liquid-absolute{position:absolute;top:0;right:0;left:0;bottom:0}.fc .fc-scroller-harness{position:relative;overflow:hidden;direction:ltr}.fc .fc-scroller-harness-liquid{height:100%}.fc-direction-rtl .fc-scroller-harness>.fc-scroller{direction:rtl}.fc-theme-standard .fc-scrollgrid{border:1px solid #ddd;border:1px solid var(--fc-border-color,#ddd)}.fc .fc-scrollgrid,.fc .fc-scrollgrid-section-footer>*,.fc .fc-scrollgrid-section-header>*{border-bottom-width:0}.fc .fc-scrollgrid,.fc .fc-scrollgrid table{width:100%;table-layout:fixed}.fc .fc-scrollgrid table{border-top-style:hidden;border-left-style:hidden;border-right-style:hidden}.fc .fc-scrollgrid{border-collapse:separate;border-right-width:0}.fc .fc-scrollgrid-liquid{height:100%}.fc .fc-scrollgrid-section,.fc .fc-scrollgrid-section table,.fc .fc-scrollgrid-section>td{height:1px}.fc .fc-scrollgrid-section-liquid>td{height:100%}.fc .fc-scrollgrid-section>*{border-top-width:0;border-left-width:0}.fc .fc-scrollgrid-section-body table,.fc .fc-scrollgrid-section-footer table{border-bottom-style:hidden}.fc .fc-scrollgrid-section-sticky>*{background:var(--fc-page-bg-color,#fff);position:sticky;z-index:3}.fc .fc-scrollgrid-section-header.fc-scrollgrid-section-sticky>*{top:0}.fc .fc-scrollgrid-section-footer.fc-scrollgrid-section-sticky>*{bottom:0}.fc .fc-scrollgrid-sticky-shim{height:1px;margin-bottom:-1px}.fc-sticky{position:sticky}.fc .fc-view-harness{flex-grow:1;position:relative}.fc .fc-bg-event,.fc .fc-highlight,.fc .fc-non-business,.fc .fc-view-harness-active>.fc-view{position:absolute;top:0;left:0;right:0;bottom:0}.fc .fc-col-header-cell-cushion{display:inline-block;padding:2px 4px}.fc .fc-non-business{background:rgba(215,215,215,.3);background:var(--fc-non-business-color,rgba(215,215,215,.3))}.fc .fc-bg-event{background:var(--fc-bg-event-color,#8fdf82);opacity:.3;opacity:var(--fc-bg-event-opacity,.3)}.fc .fc-bg-event .fc-event-title{margin:.5em;font-size:.85em;font-size:var(--fc-small-font-size,.85em);font-style:italic}.fc .fc-highlight{background:rgba(188,232,241,.3);background:var(--fc-highlight-color,rgba(188,232,241,.3))}.fc .fc-cell-shaded,.fc .fc-day-disabled{background:rgba(208,208,208,.3);background:var(--fc-neutral-bg-color,rgba(208,208,208,.3))}.fc-event .fc-event-main{position:relative;z-index:2}.fc-event-dragging:not(.fc-event-selected){opacity:.75}.fc-event-dragging.fc-event-selected{box-shadow:0 2px 7px rgba(0,0,0,.3)}.fc-event .fc-event-resizer{display:none;position:absolute;z-index:4}.fc-event-selected .fc-event-resizer,.fc-event:hover .fc-event-resizer,.fc-h-event,.fc-v-event{display:block}.fc-event-selected .fc-event-resizer{border-radius:4px;border-radius:calc(var(--fc-event-resizer-dot-total-width,8px)/ 2);border-width:1px;border-width:var(--fc-event-resizer-dot-border-width,1px);width:8px;width:var(--fc-event-resizer-dot-total-width,8px);height:8px;height:var(--fc-event-resizer-dot-total-width,8px);border-style:solid;border-color:inherit;background:var(--fc-page-bg-color,#fff)}.fc-event-selected .fc-event-resizer:before{content:'';position:absolute;top:-20px;left:-20px;right:-20px;bottom:-20px}.fc-event-selected,.fc-event:focus{box-shadow:0 2px 5px rgba(0,0,0,.2)}.fc-event-selected:before,.fc-event:focus:before{content:"";position:absolute;z-index:3;top:0;left:0;right:0;bottom:0}.fc-event-selected:after,.fc-event:focus:after{content:"";background:rgba(0,0,0,.25);background:var(--fc-event-selected-overlay-color,rgba(0,0,0,.25));position:absolute;z-index:1;top:-1px;left:-1px;right:-1px;bottom:-1px}.fc-h-event{border:1px solid #3788d8;border:1px solid var(--fc-event-border-color,#3788d8);background-color:#3788d8;background-color:var(--fc-event-bg-color,#3788d8)}.fc-h-event .fc-event-main{color:#fff;color:var(--fc-event-text-color,#fff)}.fc-h-event .fc-event-main-frame{display:flex}.fc-h-event .fc-event-time{max-width:100%;overflow:hidden}.fc-h-event .fc-event-title-container{flex-grow:1;flex-shrink:1;min-width:0}.fc-h-event .fc-event-title{display:inline-block;vertical-align:top;left:0;right:0;max-width:100%;overflow:hidden;word-break:break-word;}.fc-h-event.fc-event-selected:before{top:-10px;bottom:-10px}.fc-direction-ltr .fc-daygrid-block-event:not(.fc-event-start),.fc-direction-rtl .fc-daygrid-block-event:not(.fc-event-end){border-top-left-radius:0;border-bottom-left-radius:0;border-left-width:0}.fc-direction-ltr .fc-daygrid-block-event:not(.fc-event-end),.fc-direction-rtl .fc-daygrid-block-event:not(.fc-event-start){border-top-right-radius:0;border-bottom-right-radius:0;border-right-width:0}.fc-h-event:not(.fc-event-selected) .fc-event-resizer{top:0;bottom:0;width:8px;width:var(--fc-event-resizer-thickness,8px)}.fc-direction-ltr .fc-h-event:not(.fc-event-selected) .fc-event-resizer-start,.fc-direction-rtl .fc-h-event:not(.fc-event-selected) .fc-event-resizer-end{cursor:w-resize;left:-4px;left:calc(-.5 * var(--fc-event-resizer-thickness,8px))}.fc-direction-ltr .fc-h-event:not(.fc-event-selected) .fc-event-resizer-end,.fc-direction-rtl .fc-h-event:not(.fc-event-selected) .fc-event-resizer-start{cursor:e-resize;right:-4px;right:calc(-.5 * var(--fc-event-resizer-thickness,8px))}.fc-h-event.fc-event-selected .fc-event-resizer{top:50%;margin-top:-4px;margin-top:calc(-.5 * var(--fc-event-resizer-dot-total-width,8px))}.fc-direction-ltr .fc-h-event.fc-event-selected .fc-event-resizer-start,.fc-direction-rtl .fc-h-event.fc-event-selected .fc-event-resizer-end{left:-4px;left:calc(-.5 * var(--fc-event-resizer-dot-total-width,8px))}.fc-direction-ltr .fc-h-event.fc-event-selected .fc-event-resizer-end,.fc-direction-rtl .fc-h-event.fc-event-selected .fc-event-resizer-start{right:-4px;right:calc(-.5 * var(--fc-event-resizer-dot-total-width,8px))}.fc .fc-popover{position:absolute;z-index:9999;box-shadow:0 2px 6px rgba(0,0,0,.15)}.fc .fc-popover-header{display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding:3px 4px}.fc .fc-popover-title{margin:0 2px}.fc .fc-popover-close{cursor:pointer;opacity:.65;font-size:1.1em}.fc-theme-standard .fc-popover{border:1px solid #ddd;border:1px solid var(--fc-border-color,#ddd);background:var(--fc-page-bg-color,#fff)}.fc-theme-standard .fc-popover-header{background:rgba(208,208,208,.3);background:var(--fc-neutral-bg-color,rgba(208,208,208,.3))}:root{--fc-daygrid-event-dot-width:8px;--fc-list-event-dot-width:10px;--fc-list-event-hover-bg-color:#f5f5f5}.fc-daygrid-day-events:after,.fc-daygrid-day-events:before,.fc-daygrid-day-frame:after,.fc-daygrid-day-frame:before,.fc-daygrid-event-harness:after,.fc-daygrid-event-harness:before{content:"";clear:both;display:table}.fc .fc-daygrid-body{position:relative;z-index:1}.fc .fc-daygrid-day.fc-day-today{background-color:rgba(255,220,40,.15);background-color:var(--fc-today-bg-color,rgba(255,220,40,.15))}.fc .fc-daygrid-day-frame{position:relative;min-height:100%}.fc .fc-daygrid-day-top{display:flex;flex-direction:row-reverse}.fc .fc-day-other .fc-daygrid-day-top{opacity:.3}.fc .fc-daygrid-day-number{position:relative;z-index:4;padding:4px}.fc .fc-daygrid-day-events{margin-top:1px}.fc .fc-daygrid-body-balanced .fc-daygrid-day-events{position:absolute;left:0;right:0}.fc .fc-daygrid-body-unbalanced .fc-daygrid-day-events{position:relative;min-height:2em}.fc .fc-daygrid-body-natural .fc-daygrid-day-events{margin-bottom:1em}.fc .fc-daygrid-event-harness{position:relative}.fc .fc-daygrid-event-harness-abs{position:absolute;top:0;left:0;right:0}.fc .fc-daygrid-bg-harness{position:absolute;top:0;bottom:0}.fc .fc-daygrid-day-bg .fc-non-business{z-index:1}.fc .fc-daygrid-day-bg .fc-bg-event{z-index:2}.fc .fc-daygrid-day-bg .fc-highlight{z-index:3}.fc .fc-daygrid-event{z-index:6;margin-top:1px}.fc .fc-daygrid-event.fc-event-mirror{z-index:7}.fc .fc-daygrid-day-bottom{font-size:.85em;padding:2px 3px 0}.fc .fc-daygrid-day-bottom:before{content:"";clear:both;display:table}.fc .fc-daygrid-more-link{position:relative;z-index:4;cursor:pointer}.fc .fc-daygrid-week-number{position:absolute;z-index:5;top:0;padding:2px;min-width:1.5em;text-align:center;background-color:rgba(208,208,208,.3);background-color:var(--fc-neutral-bg-color,rgba(208,208,208,.3));color:grey;color:var(--fc-neutral-text-color,grey)}.fc .fc-more-popover .fc-popover-body{min-width:220px;padding:10px}.fc-direction-ltr .fc-daygrid-event.fc-event-start,.fc-direction-rtl .fc-daygrid-event.fc-event-end{margin-left:2px}.fc-direction-ltr .fc-daygrid-event.fc-event-end,.fc-direction-rtl .fc-daygrid-event.fc-event-start{margin-right:2px}.fc-direction-ltr .fc-daygrid-week-number{left:0;border-radius:0 0 3px}.fc-direction-rtl .fc-daygrid-week-number{right:0;border-radius:0 0 0 3px}.fc-liquid-hack .fc-daygrid-day-frame{position:static}.fc-daygrid-event{position:relative;white-space:nowrap;border-radius:3px;font-size:.85em;font-size:var(--fc-small-font-size,.85em)}.fc-daygrid-block-event .fc-event-time{font-weight:700}.fc-daygrid-block-event .fc-event-time,.fc-daygrid-block-event .fc-event-title{padding:1px}.fc-daygrid-dot-event{display:flex;align-items:center;padding:2px 0}.fc-daygrid-dot-event .fc-event-title{flex-grow:1;flex-shrink:1;min-width:0;overflow:hidden;font-weight:700}.fc-daygrid-dot-event.fc-event-mirror,.fc-daygrid-dot-event:hover{background:rgba(0,0,0,.1)}.fc-daygrid-dot-event.fc-event-selected:before{top:-10px;bottom:-10px}.fc-daygrid-event-dot{margin:0 4px;box-sizing:content-box;width:0;height:0;border:4px solid #3788d8;border:calc(var(--fc-daygrid-event-dot-width,8px)/ 2) solid var(--fc-event-border-color,#3788d8);border-radius:4px;border-radius:calc(var(--fc-daygrid-event-dot-width,8px)/ 2)}.fc-direction-ltr .fc-daygrid-event .fc-event-time{margin-right:3px}.fc-direction-rtl .fc-daygrid-event .fc-event-time{margin-left:3px}.fc-v-event{border:1px solid #3788d8;border:1px solid var(--fc-event-border-color,#3788d8);background-color:#3788d8;background-color:var(--fc-event-bg-color,#3788d8)}.fc-v-event .fc-event-main{color:#fff;color:var(--fc-event-text-color,#fff);height:100%}.fc-v-event .fc-event-main-frame{height:100%;display:flex;flex-direction:column}.fc-v-event .fc-event-time{flex-grow:0;flex-shrink:0;max-height:100%;overflow:hidden}.fc-v-event .fc-event-title-container{flex-grow:1;flex-shrink:1;min-height:0}.fc-v-event .fc-event-title{top:0;bottom:0;max-height:100%;overflow:hidden}.fc-v-event:not(.fc-event-start){border-top-width:0;border-top-left-radius:0;border-top-right-radius:0}.fc-v-event:not(.fc-event-end){border-bottom-width:0;border-bottom-left-radius:0;border-bottom-right-radius:0}.fc-v-event.fc-event-selected:before{left:-10px;right:-10px}.fc-v-event .fc-event-resizer-start{cursor:n-resize}.fc-v-event .fc-event-resizer-end{cursor:s-resize}.fc-v-event:not(.fc-event-selected) .fc-event-resizer{height:8px;height:var(--fc-event-resizer-thickness,8px);left:0;right:0}.fc-v-event:not(.fc-event-selected) .fc-event-resizer-start{top:-4px;top:calc(var(--fc-event-resizer-thickness,8px)/ -2)}.fc-v-event:not(.fc-event-selected) .fc-event-resizer-end{bottom:-4px;bottom:calc(var(--fc-event-resizer-thickness,8px)/ -2)}.fc-v-event.fc-event-selected .fc-event-resizer{left:50%;margin-left:-4px;margin-left:calc(var(--fc-event-resizer-dot-total-width,8px)/ -2)}.fc-v-event.fc-event-selected .fc-event-resizer-start{top:-4px;top:calc(var(--fc-event-resizer-dot-total-width,8px)/ -2)}.fc-v-event.fc-event-selected .fc-event-resizer-end{bottom:-4px;bottom:calc(var(--fc-event-resizer-dot-total-width,8px)/ -2)}.fc .fc-timegrid .fc-daygrid-body{z-index:2}.fc .fc-timegrid-axis-chunk>table,.fc .fc-timegrid-body,.fc .fc-timegrid-slots{position:relative;z-index:1}.fc .fc-timegrid-divider{padding:0 0 2px}.fc .fc-timegrid-body{min-height:100%}.fc .fc-timegrid-axis-chunk{position:relative}.fc .fc-timegrid-slot{height:1.5em;border-bottom:0}.fc .fc-timegrid-slot:empty:before{content:'\00a0'}.fc .fc-timegrid-slot-minor{border-top-style:dotted}.fc .fc-timegrid-slot-label-cushion{display:inline-block;white-space:nowrap}.fc .fc-timegrid-axis-cushion,.fc .fc-timegrid-slot-label-cushion{padding:0 4px}.fc .fc-timegrid-axis-frame-liquid{height:100%}.fc .fc-timegrid-axis-frame{overflow:hidden;display:flex;align-items:center;justify-content:flex-end}.fc .fc-timegrid-axis-cushion{max-width:60px;flex-shrink:0}.fc-direction-ltr .fc-timegrid-slot-label-frame{text-align:right}.fc-direction-rtl .fc-timegrid-slot-label-frame{text-align:left}.fc-liquid-hack .fc-timegrid-axis-frame-liquid{height:auto;position:absolute;top:0;right:0;bottom:0;left:0}.fc .fc-timegrid-col.fc-day-today{background-color:rgba(255,220,40,.15);background-color:var(--fc-today-bg-color,rgba(255,220,40,.15))}.fc .fc-timegrid-col-frame{min-height:100%;position:relative}.fc-media-screen.fc-liquid-hack .fc-timegrid-col-frame{height:auto;position:absolute;top:0;right:0;bottom:0;left:0}.fc-media-screen .fc-timegrid-cols{position:absolute;top:0;left:0;right:0;bottom:0}.fc-media-screen .fc-timegrid-cols>table{height:100%}.fc-media-screen .fc-timegrid-col-bg,.fc-media-screen .fc-timegrid-col-events,.fc-media-screen .fc-timegrid-now-indicator-container{position:absolute;top:0;left:0;right:0}.fc .fc-timegrid-col-bg{z-index:2}.fc .fc-timegrid-col-bg .fc-non-business{z-index:1}.fc .fc-timegrid-col-bg .fc-bg-event{z-index:2}.fc .fc-timegrid-col-bg .fc-highlight,.fc .fc-timegrid-col-events{z-index:3}.fc .fc-timegrid-bg-harness{position:absolute;left:0;right:0}.fc .fc-timegrid-now-indicator-container{bottom:0;overflow:hidden}.fc-direction-ltr .fc-timegrid-col-events{margin:0 2.5% 0 2px}.fc-direction-rtl .fc-timegrid-col-events{margin:0 2px 0 2.5%}.fc-timegrid-event-harness{position:absolute}.fc-timegrid-event-harness>.fc-timegrid-event{position:absolute;top:0;bottom:0;left:0;right:0}.fc-timegrid-event-harness-inset .fc-timegrid-event,.fc-timegrid-event.fc-event-mirror,.fc-timegrid-more-link{box-shadow:0 0 0 1px #fff;box-shadow:0 0 0 1px var(--fc-page-bg-color,#fff)}.fc-timegrid-event,.fc-timegrid-more-link{font-size:.85em;font-size:var(--fc-small-font-size,.85em);border-radius:3px}.fc-timegrid-event{margin-bottom:1px}.fc-timegrid-event .fc-event-main{padding:1px 1px 0}.fc-timegrid-event .fc-event-time{white-space:nowrap;font-size:.85em;font-size:var(--fc-small-font-size,.85em);margin-bottom:1px}.fc-timegrid-event-short .fc-event-main-frame{flex-direction:row;overflow:hidden}.fc-timegrid-event-short .fc-event-time:after{content:'\00a0-\00a0'}.fc-timegrid-event-short .fc-event-title{font-size:.85em;font-size:var(--fc-small-font-size,.85em)}.fc-timegrid-more-link{position:absolute;z-index:9999;color:inherit;color:var(--fc-more-link-text-color,inherit);background:var(--fc-more-link-bg-color,#d0d0d0);cursor:pointer;margin-bottom:1px}.fc-timegrid-more-link-inner{padding:3px 2px;top:0}.fc-direction-ltr .fc-timegrid-more-link{right:0}.fc-direction-rtl .fc-timegrid-more-link{left:0}.fc .fc-timegrid-now-indicator-line{position:absolute;z-index:4;left:0;right:0;border-style:solid;border-color:red;border-color:var(--fc-now-indicator-color,red);border-width:1px 0 0}.fc .fc-timegrid-now-indicator-arrow{position:absolute;z-index:4;margin-top:-5px;border-style:solid;border-color:red;border-color:var(--fc-now-indicator-color,red)}.fc-direction-ltr .fc-timegrid-now-indicator-arrow{left:0;border-width:5px 0 5px 6px;border-top-color:transparent;border-bottom-color:transparent}.fc-direction-rtl .fc-timegrid-now-indicator-arrow{right:0;border-width:5px 6px 5px 0;border-top-color:transparent;border-bottom-color:transparent}.fc-theme-standard .fc-list{border:1px solid #ddd;border:1px solid var(--fc-border-color,#ddd)}.fc .fc-list-empty{background-color:rgba(208,208,208,.3);background-color:var(--fc-neutral-bg-color,rgba(208,208,208,.3));height:100%;display:flex;justify-content:center;align-items:center}.fc .fc-list-empty-cushion{margin:5em 0}.fc .fc-list-table{width:100%;border-style:hidden}.fc .fc-list-table tr>*{border-left:0;border-right:0}.fc .fc-list-sticky .fc-list-day>*{position:sticky;top:0;background:var(--fc-page-bg-color,#fff)}.fc .fc-list-table thead{position:absolute;left:-10000px}.fc .fc-list-table tbody>tr:first-child th{border-top:0}.fc .fc-list-table th{padding:0}.fc .fc-list-day-cushion,.fc .fc-list-table td{padding:8px 14px}.fc .fc-list-day-cushion:after{content:"";clear:both;display:table}.fc-theme-standard .fc-list-day-cushion{background-color:rgba(208,208,208,.3);background-color:var(--fc-neutral-bg-color,rgba(208,208,208,.3))}.fc-direction-ltr .fc-list-day-text,.fc-direction-rtl .fc-list-day-side-text{float:left}.fc-direction-ltr .fc-list-day-side-text,.fc-direction-rtl .fc-list-day-text{float:right}.fc-direction-ltr .fc-list-table .fc-list-event-graphic{padding-right:0}.fc-direction-rtl .fc-list-table .fc-list-event-graphic{padding-left:0}.fc .fc-list-event.fc-event-forced-url{cursor:pointer}.fc .fc-list-event:hover td{background-color:#f5f5f5;background-color:var(--fc-list-event-hover-bg-color,#f5f5f5)}.fc .fc-list-event-graphic,.fc .fc-list-event-time{white-space:nowrap;width:1px}.fc .fc-list-event-dot{display:inline-block;box-sizing:content-box;width:0;height:0;border:5px solid #3788d8;border:calc(var(--fc-list-event-dot-width,10px)/ 2) solid var(--fc-event-border-color,#3788d8);border-radius:5px;border-radius:calc(var(--fc-list-event-dot-width,10px)/ 2)}.fc .fc-list-event-title a{color:inherit}.fc .fc-list-event.fc-event-forced-url:hover a{text-decoration:underline}.fc-theme-bootstrap a:not([href]){color:inherit}.fc-theme-bootstrap5 a:not([href]){color:inherit;text-decoration:inherit}.fc-theme-bootstrap5 .fc-list,.fc-theme-bootstrap5 .fc-scrollgrid,.fc-theme-bootstrap5 td,.fc-theme-bootstrap5 th{border:1px solid var(--bs-gray-400)}.fc-theme-bootstrap5 .fc-scrollgrid{border-right-width:0;border-bottom-width:0}.fc-theme-bootstrap5-shaded{background-color:var(--bs-gray-200)} \ No newline at end of file diff --git a/assets/css/mecrtl.css b/assets/css/mecrtl.css new file mode 100755 index 0000000..5d6e719 --- /dev/null +++ b/assets/css/mecrtl.css @@ -0,0 +1,926 @@ +/** +* Plugin Name: Modern Events Calendar +* Plugin URI: http://webnus.net/modern-events-calendar/ +* Description: An awesome plugin for events calendar +* Author: Webnus Team +* Author URI: http://webnus.net +**/ + + /* Base + ====================================================*/ + .mec-single-event .mec-single-event-organizer i, .mec-single-event .mec-events-meta-date i { margin-left: 10px; margin-right: 12px; } + + /* margin-left 0 + ====================================================*/ + .mec-single-event .mec-frontbox-title:before, .mec-event-schedule-content, .event-color + { margin-left: 0; } + + /* custom-margin-left 0 + ====================================================*/ + .mec-event-cover-classic .mec-event-icon { margin-left: 14px; } + .event-color { margin-right: 5px; } + .mec-event-list-classic .mec-event-image { margin-left: 20px } + .mec-event-article i { margin-left: 10px;} + + /* margin-right 0 + ====================================================*/ + .mec-event-list-classic .mec-event-image, .mec-event-cover-classic .mec-event-icon { margin-right: 0; } + + /* custom-margin-right 0 + ====================================================*/ + .mec-single-event .mec-frontbox-title:before { margin-right: 39px; } + .mec-event-schedule-content { margin-right: 25px; } + + /* padding-left 0 + ====================================================*/ + .mec-single-event .mec-event-meta h3, .mec-single-event .mec-event-meta dt, .mec-event-schedule-content dl + { padding-left: 0; } + + /* custom-padding-right 0 + ====================================================*/ + .mec-single-event .mec-event-meta h3, .mec-single-event .mec-event-meta dt { padding-right: 10px; } + .mec-event-schedule-content dl { padding-right: 24px; } + + /* border-left 0 + ====================================================*/ + .mec-event-schedule-content { border: 0; } + + /* custom-border-right + ====================================================*/ + .mec-event-schedule-content { border-right: 4px solid #f0f0f0; } + + /* left auto + ====================================================*/ + .mec-event-schedule-content dl:before, .mec-event-cover-modern .mec-event-cover-a + { left: auto; } + + /* right 0 + ====================================================*/ + .mec-event-schedule-content dl:before, .mec-event-cover-modern .mec-event-cover-a { right: 0; } + + /* float right + ====================================================*/ + .mec-event-cover-classic .mec-event-icon, .mec-event-list-classic .mec-event-image { float: right; } + + /* Text align right + ====================================================*/ + .mec-event-cover-classic .mec-btn-wrapper { text-align: right; } + + /* #General + ================================================== */ + .mec-wrap .mec-calendar-topsec .mec-calendar-events-sec .mec-table-side-day { padding: 0;} + .mec-wrap article.mec-event-article.mec-clear { text-align: right;} + .mec-wrap .mec-event-article .mec-event-content p { text-align:right;} + + /* buttons */ + .mec-wrap .button, .mec-wrap button, .mec-wrap input[type=button], .mec-wrap input[type=reset], .mec-wrap input[type=submit] { margin:0;} + + /* Booking Form*/ + .mec-wrap .mec-events-meta-group-booking .mec-book-price-details li { float:right;} + .mec-wrap .mec-events-meta-group-booking .mec-book-price-details { width:330px;} + + /* map marker plus */ + .mec-wrap .mec-marker-wrap .mec-marker-pulse { margin:-15px 28px 1px 40px;} + .mec-wrap .mec-marker-wrap .mec-marker-pulse:after{ margin:-13px -13px 0 0;} + + /* #Front-End Submission + ================================================== */ + .mec-fes-list ul li .mec-fes-event-remove, .mec-fes-list ul li .mec-fes-event-view { float: left;} + .mec-fes-form input[type=checkbox], .mec-fes-form input[type=radio] { float: right; margin: 5px;} + .mec-fes-form #mec_fes_form .mec-form-row #mec_cost { float:none;} + /* .mec-meta-box-fields .mec-form-row { overflow: hidden;} */ + .mec-fes-form label {padding-right: 0;} + + /* #Search Form (top bar skin's) + ================================================== */ + /* Top Head bar */ + .mec-wrap .mec-totalcal-box i { float:right; text-align:center;} + .mec-totalcal-box .mec-date-search { float:left;} + + /* #Single Events + ================================================== */ + /* Single Event modern */ + .mec-wrap .mec-single-modern .mec-single-event-bar>div i { float:right; padding-left: 10px;} + .mec-wrap .mec-single-modern .mec-single-event-bar dd { margin: 0 30px 0 0; padding: 0;} + .mec-wrap .mec-event-meta.mec-color-before.mec-frontbox { width: 100%;} + .mec-wrap .mec-single-modern .mec-event-meta .mec-single-event-organizer dd a { float: left; position: absolute; margin-right: 5px;} + .mec-wrap .mec-single-event .mec-single-event-organizer i{ margin-top: 5px;} + + /* Side Bar Singele Page*/ + .mec-wrap .mec-single-event .mec-event-meta i { float:right; padding-left:5px;} + .mec-wrap .mec-single-event .mec-event-meta dt, .mec-wrap .mec-single-event .mec-event-meta h3 { padding-right:5px;} + .mec-wrap .mec-single-event .mec-event-meta dd { padding-right: 35px; padding-left: 0;} + .mec-wrap .mec-single-event .mec-event-meta .mec-single-event-organizer dd { padding: 0;} + .mec-wrap .mec-single-event .mec-event-meta .mec-single-event-organizer dd a { float: left; position: absolute; margin-right: 5px;} + /* Category singel event*/ + .mec-wrap .mec-single-event .mec-event-meta dd.mec-events-event-categories:after { font-family: FontAwesome; color: #40d9f1; font-size: 16px; content: "\f104"; padding-left: 10px;} + .mec-wrap .mec-single-event .mec-event-meta dd.mec-events-event-categories:before { content: ""; padding: 0;} + .mec-wrap .mec-single-event .mec-event-export-module.mec-frontbox .mec-event-exporting .mec-export-details ul li:last-child { text-align: left; padding-left:0;} + .mec-wrap .mec-single-event .mec-events-button { margin: 0;} + /* Events in full calendar */ + .mec-wrap .mec-calendar .mec-event-article .mec-event-image { float:right; margin-left: 20px; } + .mec-wrap .mec-calendar .mec-event-article .mec-event-title { text-align:right; padding: 5px; } + .mec-wrap .mec-calendar .mec-event-article .mec-event-time i { float: right;} + .mec-wrap .mec-calendar .mec-event-article .mec-event-time.mec-color { float:right;} + .mec-wrap .mec-calendar .mec-event-article .mec-event-detail { float: right;} + /*Events in weekly */ + .mec-wrap .mec-calendar.mec-calendar-weekly .mec-event-list-weekly-date { float:right;} + /* Events in listly */ + .mec-wrap .mec-event-meta-wrap { border-right: 1px solid #eee; border-left: 0;} + .mec-event-meta { float: right;} + /* Footer event list*/ + .mec-event-sharing-wrap { right: 20px; left:auto;} + .mec-event-footer .mec-booking-button { right:auto; left: 20px;} + /* Orginizer Single event */ + .mec-wrap .mec-single-event .mec-events-meta-date dd span, .mec-single-event .mec-single-event-organizer dd span { padding-bottom:20px;} + /* Single Events Sidebar */ + .single-mec-events .mec-wrap .col-md-4 {direction: rtl;float: right;} + /* Single Events */ + .single-mec-events .mec-wrap .mec-single-modern .col-md-4 {margin-top: -50px;} + .mec-events-template-default .mec-wrap .col-md-4 {margin-top: 0; float: left;} + .mec-events-template-default .mec-wrap .col-md-8 {margin-top: 0; float: right;} + .single-mec-events .mec-single-modern .mec-single-event-bar {padding: 14px 0;} + .single-mec-events .mec-single-modern .col-md-4 .mec-frontbox {margin: 0;} + .single-mec-events .mec-single-event .mec-events-meta-group-booking form>h4:before, .mec-single-event .mec-frontbox-title:before {transform: translate(-50%); margin: 0;} + .single-mec-events .mec-single-event-location,.single-mec-events .mec-single-event-organizer,.single-mec-events .mec-single-event-category {z-index: 1;} + .single-mec-events .mec-single-event .mec-booking-button {position: relative; z-index: 2;} + .single-mec-events .mec-wrap .mec-single-event .mec-event-meta dd a i:before {content: '\f104'; line-height: 32px; } + .single-mec-events .mec-wrap .mec-single-event .mec-event-meta dd.mec-events-event-categories:after {display: none;} + /* #List View + ================================================== */ + /* List View Standard */ + .mec-wrap .mec-event-list-standard .mec-event-meta-wrap { display:table-cell;} + /* List View Classic */ + .mec-wrap .mec-totalcal-box i { float: right;} + .mec-wrap i.mec-sl-map-marker { float: right; margin-left:3px;} + /* List View Minimal */ + .mec-wrap .mec-event-list-minimal .btn-wrapper .mec-detail-button { float: left;} + .mec-wrap .mec-event-list-minimal .mec-event-article .col-md-9.col-sm-9 { float: right; width: 100%;} + .mec-wrap .mec-event-list-minimal .mec-event-article .mec-event-date.mec-bg-color { float: right; margin-right: 0; margin-left: 10px;} + .mec-wrap .mec-event-list-minimal .mec-event-date span { padding-left: 25px; margin-left: 7px; padding-right: 0; margin-right: 0 } + + /* #Grid View + ================================================== */ + /*Grid View Clean */ + .mec-event-grid-clean .mec-event-footer .mec-booking-button { left:0; right:auto;} + .mec-event-grid-clean .mec-event-sharing-wrap { left:auto; right:0;} + .mec-event-grid-clean .event-grid-t2-head .mec-event-date { float:right; margin-right:0; margin-left: 11px;} + .mec-event-grid-clean .event-grid-t2-head { text-align: right;} + .mec-event-grid-clean .event-grid-t2-head .mec-event-month { text-align: right;} + .mec-event-grid-clean .event-grid-t2-head .mec-event-detail { text-align: right;} + /*Grid View Minimal*/ + .mec-event-grid-minimal .mec-event-date { margin-right:0; margin-left:20px;} + /* Grid View Modern*/ + .mec-wrap .mec-event-grid-modern .mec-event-article .event-grid-modern-head .mec-event-date.mec-color { margin-left: 11px;margin-right: 0;} + .mec-wrap .mec-event-grid-modern .mec-event-content .mec-event-title .event-color { float: right; margin: 7px; } + .mec-wrap .mec-event-grid-modern .mec-event-article h4.mec-event-title { overflow: hidden; } + /* Grid View Simple */ + .mec-wrap .mec-event-grid-simple article.mec-event-article.mec-clear { text-align:center;} + .mec-wrap .mec-event-grid-simple article.mec-event-article h4.mec-event-title { text-align: center;} + /* Grid View Colorfull*/ + .mec-wrap .mec-event-grid-modern .event-grid-modern-head .mec-event-date { float:right;} + .mec-wrap .mec-event-article h4.mec-event-title { text-align: right;} + .mec-wrap .event-grid-modern-head.clearfix { text-align:right;} + + /* #Carousel + ================================================== */ + /* Carousel Type>1 */ + .mec-wrap .event-carousel-type1-head .mec-event-date-carousel { left:auto; right: 1px;padding-left: 21px;padding-right: 25px;} + .mec-wrap .event-carousel-type1-head .mec-event-date-info-year { right:auto; left: 60px;} + .mec-wrap .event-carousel-type1-head .mec-event-date-info { right:auto; left: 60px;} + .mec-wrap .event-carousel-type1-head .mec-event-date-carousel:after { left:auto; bottom:-13px; right: 5px; transform: rotate(-45deg);} + /* Carousel Type 2 */ + .mec-wrap .event-carousel-type2-head .mec-event-footer-carousel-type2 .mec-booking-button { float:left;} + .mec-wrap .mec-event-carousel-type2 .mec-event-footer-carousel-type2 .mec-event-sharing-wrap { left:auto; right: -11px;} + /* Carousel Type>3 */ + .mec-wrap .event-carousel-type3-head .mec-event-footer-carousel-type3 .mec-booking-button { float:left;} + .mec-wrap .mec-event-footer-carousel-type3 .mec-event-sharing-wrap { left:auto; right:11%;} + + /* #Full Calendar View + ================================================== */ + /* Full Calendar View > List View */ + .mec-wrap .mec-event-list-standard .mec-date-details:before, .mec-event-list-standard .mec-time-details:before, .mec-event-list-standard .mec-venue-details:before { right:0; text-align:right;} + .mec-wrap .mec-event-meta.mec-color-before span { margin-right: 28px;} + /* Full Calendar View > Yearly View */ + .mec-wrap .mec-timetable-t2-col {float: right;} + .mec-wrap .mec-agenda-date-wrap {float: right;} + .mec-wrap .mec-agenda-events-wrap {float: left;} + .mec-wrap .mec-yearly-view-wrap .mec-yearly-calendar-sec {float: right;} + .mec-wrap .mec-yearly-agenda-sec {float: left; padding: 0 20px 0 0;} + .rtl .mec-yearly-view-wrap .mec-yearly-title-sec { direction: rtl;} + .rtl .mec-yearly-view-wrap .mec-yearly-title-sec .mec-previous-year {right: 20px;left: auto;} + .rtl .mec-yearly-view-wrap .mec-yearly-title-sec .mec-next-year {left: 20px;right: auto;direction: ltr;} + .rtl .mec-yearly-view-wrap .mec-yearly-title-sec .mec-next-year .mec-sl-angle-right:before { content: "\e605";} + .rtl .mec-yearly-view-wrap .mec-yearly-title-sec .mec-previous-year .mec-sl-angle-left:before { content: "\e606";} + + /* #Calendar/Monthly View + ================================================== */ + /* Calendar/Monthly View > Classic */ + .mec-wrap .mec-calendar.mec-event-calendar-classic .mec-calendar-events-sec { text-align:right;} + .mec-wrap .mec-skin-monthly-view-month-navigator-container .mec-calendar-events-sec h3.mec-color.mec-table-side-day { float: right;} + .rtl .mec-calendar.mec-event-calendar-classic dl dt {text-align: right;} + .rtl .mec-calendar.mec-event-calendar-classic .mec-has-event:after {left: auto;right: 7px;} + .rtl .mec-box-calendar.mec-calendar.mec-event-calendar-classic .mec-calendar-side .mec-next-month {right: auto;} + .rtl .mec-box-calendar.mec-calendar.mec-event-calendar-classic .mec-calendar-side .mec-previous-month {left: auto;} + .rtl .mec-wrap .mec-calendar .mec-event-article .mec-event-title {direction: rtl;} + + /* Calendar/Monthly View > Clean */ + .rtl .mec-calendar .mec-calendar-events-side { border-right: 1px solid #efefef;} + .rtl .mec-calendar .mec-event-article, + .rtl .mec-month-navigator { direction: ltr;} + .rtl .mec-calendar .mec-calendar-side .mec-previous-month { border-bottom-left-radius: 6px; border-bottom-right-radius: 0; border-left: 1px solid #efefef; border-right: 0; left: auto; right: 0; direction: rtl;} + .rtl .mec-wrap .mec-calendar .mec-event-article .mec-event-image { float: right; margin-left: 20px; margin-right: 0;} + .rtl .mec-wrap article:not([class^=mec-event-countdown]):not([class^=mec-event-cover-]).mec-label-canceled:before, + .rtl .mec-wrap article:not([class^=mec-event-countdown]):not([class^=mec-event-cover-]).mec-label-featured:before { z-index: 1; position: absolute; top: 25px; right: auto; left: -37px; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; background: #04de78; padding: 2px 40px; color: #fff; -ms-transform: rotate(-45deg); -webkit-transform: rotate(-45deg); transform: rotate(-45deg);} + .rtl .mec-calendar .mec-calendar-side .mec-next-month { border-bottom-right-radius: 6px; border-bottom-left-radius: 0; border-right: 1px solid #efefef; border-left: 0; left: 0; right: auto; direction: rtl;} + .rtl .mec-calendar .mec-calendar-side .mec-next-month .mec-sl-angle-right:before { content: "\e605";} + .rtl .mec-calendar .mec-calendar-side .mec-previous-month .mec-sl-angle-left:before { content: "\e606";} + .rtl .event-color, + .rtl .mec-event-article i { margin-right: 0; margin-right: 10px;} + + + /* #Slider View + ================================================== */ + .mec-calendar.mec-calendar-daily .mec-calendar-d-table dl dt { float:right; border-left: 1px solid #e6e6e6} + + /* #Map View + ================================================== */ + /* Map View */ + .mec-event-detail.mec-map-view-event-detail { text-align: right;} + .mec-event-article i { margin-left: 0; } + + /* #Cover View + ================================================== */ + .mec-wrap .mec-event-cover-clean .mec-event-date { right:auto; left:60px;} + + /* #Countdown View + ================================================== */ + /* Countdown View > Style1 */ + .mec-wrap .mec-event-countdown-style1 .mec-event-countdown-part1 { padding: 50px 4% 50px 1%;} + /* Countdown View > Style2 */ + .mec-wrap .mec-event-countdown-style2 .mec-event-countdown-part2 .mec-event-date-place { text-align: right;} + /* Countdown View > Style3 */ + .mec-wrap .mec-event-countdown-style3 .mec-event-countdown-part1 { padding: 50px 4% 50px 1%;} + .mec-wrap .mec-event-countdown-style3 .mec-event-countdown { left:20px; right:auto;} + .mec-wrap .mec-event-countdown-style3 .mec-event-title-link { left:auto; right:190px;} + .mec-event-countdown-style3 .mec-event-countdown-part-details .mec-event-title { padding-right:0;} + .mec-wrap .mec-event-countdown-style3 .mec-event-countdown-part-details .mec-event-link { padding-left:0; padding-right:22px; margin-left:22px;} + .mec-wrap .mec-event-countdown-style3 .mec-event-countdown-part-details .mec-event-link:before { right:0; left:auto;} + .mec-wrap .mec-event-countdown-style3 .mec-event-date { left: auto; right: -27px;} + .mec-wrap .mec-event-countdown-style3 .mec-event-date:after { left:auto; right:8px; transform: rotate(-45deg);} + + /* #Masonry View + ================================================== */ + .mec-wrap .mec-masonry .mec-event-content .mec-event-description {display: block; direction: rtl; text-align: right;} + .mec-wrap .mec-masonry .mec-event-grid-modern .mec-event-content .mec-event-title .event-color { float: left;} + .mec-wrap .mec-masonry .event-grid-modern-head .mec-event-date {margin: 0 0 0 11px;} + .mec-wrap .mec-masonry .mec-masonry-col6 i {float: right; margin: 0 0 0 7px;} + + /* #Tile View + ================================================== */ + .mec-event-tile-view article.mec-tile-item .mec-event-time {right: auto; left: 4px;} + + /* #Timetable + ================================================== */ + .mec-wrap .mec-timetable-t2-content { direction: rtl; text-align: right;} + .mec-wrap .mec-timetable-t2-content div {text-align: right;} + .mec-wrap .mec-timetable-t2-content div i {margin-right: 0;margin-left: 5px;} + .mec-wrap .mec-timetable-t2-content div span {float: left;text-align: right;width: calc( 100% - 22px);} + + /* #Slider View + ================================================== */ + .mec-wrap .mec-event-content .mec-event-title a.mec-color-hover { float: right;} + .mec-wrap .mec-event-content .mec-event-title .event-color { float: left;} + + /* Slider View > Type1 */ + .mec-wrap .mec-slider-t1 .mec-event-grid-modern .event-grid-modern-head .mec-event-date{ float: right; margin:0 0 0 11px;} + .mec-wrap .mec-slider-t1 .mec-event-grid-modern .event-grid-modern-head.clearfix { text-align: right;} + .mec-wrap .mec-slider-t1 .mec-event-content h4.mec-event-title { overflow: hidden; text-align: right;} + .mec-wrap .mec-slider-t1 .mec-event-content span.event-color { float: right; margin: 10px;} + .mec-wrap .mec-slider-t1 .mec-event-content .mec-event-detail { display:block; text-align:right;} + .mec-wrap .mec-event-grid-modern .mec-event-footer .mec-booking-button { left:auto; right:0;} + .mec-wrap .mec-slider-t1 .mec-slider-t1-img { float:left;} + /* Slider View > Type2 */ + .mec-wrap .mec-slider-t2 .mec-event-grid-modern .event-grid-modern-head .mec-event-date{ float: right; margin:0 0 0 11px;} + .mec-wrap .mec-slider-t2 .mec-event-grid-modern .event-grid-modern-head.clearfix { text-align: right;} + .mec-wrap .mec-slider-t2 .mec-event-content h4.mec-event-title { overflow: hidden; text-align: right;} + .mec-wrap .mec-slider-t2 .mec-event-content span.event-color { float: right; margin: 10px;} + .mec-wrap .mec-slider-t2 .mec-event-content .mec-event-detail { display:block; text-align:right;} + .mec-wrap .mec-event-grid-modern .mec-event-footer .mec-booking-button { left:auto; right:0;} + .mec-wrap .mec-event-grid-modern .mec-event-sharing-wrap { left:0; right: auto;} + .mec-wrap .mec-slider-t2-wrap .mec-owl-theme .owl-nav div.owl-prev { left:30px; right:auto;} + .mec-wrap .mec-slider-t2-wrap .mec-owl-theme .owl-nav div.owl-next { left:82px; right:auto;} + .mec-wrap .mec-slider-t2-content.mec-event-grid-modern.mec-bg-color { left:0;} + .mec-wrap .mec-slider-t2 .mec-slider-t2-img { left:auto; right:0;} + /* Slider View > Type3 */ + .mec-wrap .mec-slider-t3 .mec-slider-t3-content { width:95%;} + .mec-wrap .mec-slider-t3 .mec-event-grid-modern .event-grid-modern-head .mec-event-date{ float: right; margin:0 0 0 11px;} + .mec-wrap .mec-slider-t3 .mec-event-grid-modern .event-grid-modern-head.clearfix { text-align: right;} + .mec-wrap .mec-slider-t3 .mec-event-content h4.mec-event-title { overflow: hidden; text-align: right;} + .mec-wrap .mec-slider-t3 .mec-event-content span.event-color { float: right; margin: 10px;} + .mec-wrap .mec-slider-t3 .mec-event-content .mec-event-detail { display:block; text-align:right;} + .mec-wrap .mec-slider-t3 .mec-slider-t3-footer a.mec-booking-button { float: right; margin-bottom:11px;} + /* Slider View > Type4 */ + .mec-wrap .mec-slider-t4 .mec-event-grid-modern .event-grid-modern-head .mec-event-date{ float: right; margin:0 0 0 11px;} + .mec-wrap .mec-slider-t4 .mec-event-grid-modern .event-grid-modern-head.clearfix { text-align: right;} + .mec-wrap .mec-slider-t4 .mec-event-content h4.mec-event-title { overflow: hidden; text-align: right;} + .mec-wrap .mec-slider-t4 .mec-event-content span.event-color { float: right; margin: 10px;} + .mec-wrap .mec-slider-t4 .mec-event-content .mec-event-detail { display:block; text-align:right;} + .mec-wrap .mec-slider-t4 .mec-slider-t4-footer a.mec-booking-button { float: right; margin-bottom:11px;} + .mec-slider-t4-content.mec-event-grid-modern { left:auto; right:8%;} + .mec-wrap .mec-slider-t4-wrap .mec-owl-theme .owl-nav div.owl-prev { left:30px; right:auto;} + .mec-wrap .mec-slider-t4-wrap .mec-owl-theme .owl-nav div.owl-next { left:82px; right:auto;} + + /* #FES Form + ================================================== */ + .mec-fes-form .mec-fes-form-cntt, .mec-fes-form .mec-fes-form-sdbr {direction: rtl;text-align: right;} + .mec-fes-form .mec-fes-form-cntt { float: right; padding-right: 0; padding-left: 20px;} + .mec-fes-form .mec-fes-form-sdbr { padding-right: 20px; padding-left: 0;} + .mec-fes-form .mec-fes-form-cntt .mec-col-4, .mec-fes-form .mec-fes-form-sdbr .mec-col-4 {float: unset;} + + /* #Responsive + ================================================== */ + @media only screen and (max-width: 768px) { + + /* LIST VIEW MODERN */ + .mec-event-list-modern .col-md-2.col-sm-2 { left: auto; right:0; } + .mec-event-list-modern .col-md-4.col-sm-4.mec-btn-wrapper { right:auto; left:0;} + + /* LIST VIEW MINIMAL */ + .mec-wrap .mec-event-list-minimal .btn-wrapper .mec-detail-button { display: block; width: 100%;} + + /* COUNTDOWN VIEW */ + .mec-wrap .mec-event-countdown-style3 .mec-event-date { right:0;} + .mec-wrap .mec-event-countdown-style3 .mec-event-title-link { right:130px;} + + } + + @media only screen and (min-width: 480px) { + /* LIST VIEW MODERN */ + .mec-event-list-modern .mec-btn-wrapper .mec-booking-button { float:left;} + } + + /* Archive Page */ + .mec-wrap .mec-event-content .mec-event-title .event-color {float: right; margin-top: 10px;} + .mec-event-list-standard .mec-event-title, + .mec-wrap .mec-event-content .mec-event-title a.mec-color-hover , + .mec-wrap .mec-event-content .mec-event-description {display: flex;} + .mec-event-description { + line-height: 1.7; + } + .mec-event-list-standard .mec-date-details, + .mec-event-list-standard .mec-time-details, + .mec-event-list-standard .mec-venue-details {text-align: right; padding-right: 28px; direction: rtl;} + .mec-wrap .mec-event-meta.mec-color-before, + .mec-wrap .mec-event-meta.mec-color-before span {margin: 0; marign-left: 28px; direction: rtl; text-align: right;} + .mec-skin-daily-view-events-container .mec-owl-carousel .owl-wrapper { display: inline-flex !important;width: 100% !important; } + +/* --------------------- */ + +/** + * RTL + * * * * */ + body.rtl .mec-wrap .col-md-1, body.rtl .mec-wrap .col-md-10, body.rtl .mec-wrap .col-md-11, body.rtl .mec-wrap .col-md-12, body.rtl .mec-wrap .col-md-2, body.rtl .mec-wrap .col-md-3, body.rtl .mec-wrap .col-md-4, body.rtl .mec-wrap .col-md-5, body.rtl .mec-wrap .col-md-6, body.rtl .mec-wrap .col-md-7, body.rtl .mec-wrap .col-md-8, body.rtl .mec-wrap .col-md-9 { + float: right !important; +} + +body.rtl .ui-datepicker.ui-widget select { + width: 32%; +} + +/** SHORTCODE RTL **/ +body.rtl .mec-wrap .mec-cancellation-reason span, body.rtl .mec-wrap .mec-labels-normal .mec-label-normal { + margin-left: 0px; + margin-right: 10px; +} + +body.rtl .mec-calendar .mec-calendar-events-side .mec-table-side-title, +body.rtl .mec-event-footer .mec-booking-button, +body.rtl .mec-wrap .mec-load-more-button { + letter-spacing: 0; +} + +body.rtl .mec-wrap .mec-time-details { + direction: ltr; +} + +/* full calendar search box*/ +body.rtl .mec-wrap .mec-search-form.mec-totalcal-box .col-md-6 { + float: left !important; +} + +/* list view classic */ +body.rtl .mec-wrap .mec-event-list-classic .mec-event-date, body.rtl .mec-wrap .mec-event-list-classic .mec-event-time { + margin-right: 0; + margin-left: 5px; + padding-right: 20px; + position: relative; +} + +body.rtl .mec-wrap .mec-event-list-classic .mec-event-article i { + position: absolute; + left: auto; + right: 0; + top: 2px; + margin: 0; +} + +/* list view minimal */ +body.rtl .mec-wrap .mec-event-list-minimal .mec-event-article .col-md-9.col-sm-9 { + width: 75%; +} + +body.rtl .mec-wrap .mec-event-list-minimal .event-color, body.rtl .mec-wrap .mec-event-list-minimal .mec-event-article i { + margin: 0 0 0 10px; +} + +body.rtl .mec-wrap .mec-event-list-minimal .btn-wrapper .mec-detail-button { + letter-spacing: 0; +} + +/* list view modern */ +@media only screen and (min-width: 768px) { + body.rtl .mec-event-list-modern .col-md-2.col-sm-2 { + left: auto; + right: 0; + top: 20px; + } + + .mec-event-list-modern .col-md-6.col-sm-6 { + padding-right: 225px; + padding-left: 195px; + } + + .mec-event-list-modern .col-md-4.col-sm-4.mec-btn-wrapper { + right: auto; + left: 0; + top: 30%; + } +} + +body.rtl .mec-event-list-modern .mec-event-detail .mec-time-details, body.rtl .mec-event-list-modern .mec-event-detail { + direction: ltr; + text-align: right; +} + +body.rtl .mec-event-list-modern .mec-event-article { + direction: rtl; + text-align: right; +} + +body.rtl .mec-event-list-modern .mec-event-date .event-f, body.rtl .mec-event-list-modern .mec-btn-wrapper .mec-booking-button { + letter-spacing: 0; +} + +body.rtl .mec-event-list-modern .mec-event-sharing { + padding: 0 0 0 0; +} + +body.rtl .mec-event-list-modern .mec-event-sharing>li { + margin: 0 0 0 0; +} + +body.rtl .mec-event-list-modern .mec-event-sharing>li i { + margin: 0 0 0 10px; +} + +/* list view standard */ +body.rtl .mec-event-list-standard .mec-event-footer .mec-booking-button { + letter-spacing: 0; +} + +body.rtl .mec-event-list-standard .mec-shortcode-organizers { + padding: 0 20px 0 0; +} + +body.rtl .mec-event-list-standard .mec-shortcode-organizers .mec-sl-user:before { + left: auto; + right: 0; +} + +/* list view toggle */ +body.rtl .mec-events-toggle .mec-toggle-item-inner i { + right: auto; + left: 25px; + top: 50%; +} + +body.rtl .mec-events-toggle .mec-toggle-title { + text-align: right; + padding-left: 0; + padding-right: 15px; + float: right; +} + +/* grid view minimal */ +body.rtl .mec-event-grid-minimal .mec-event-title { + direction: rtl; +} + +body.rtl .mec-event-grid-minimal .mec-event-title a { + float: right; +} + +body.rtl .mec-event-grid-modern .mec-event-sharing { + right: auto; + left: -5px; +} + +/* grid view minimal */ +body.rtl .mec-event-grid-simple .mec-event-article:after { + right: auto; + left: -1px; +} + +body.rtl .mec-event-grid-simple .event-color { + margin: 0 10px; +} + +body.rtl .mec-event-grid-simple .mec-time-details { + text-align: center; +} + +/* grid view nover */ +body.rtl .mec-event-grid-novel .mec-event-address::before, body.rtl .mec-event-grid-novel .mec-event-detail::before, body.rtl .mec-event-grid-novel .mec-event-month::before, body.rtl .mec-event-grid-novel .mec-local-time-details:before { + left: auto; + right: 0; +} + +body.rtl .mec-event-grid-novel .mec-event-address, body.rtl .mec-event-grid-novel .mec-event-detail, body.rtl .mec-event-grid-novel .mec-event-month, body.rtl .mec-event-grid-novel .mec-local-time-details { + padding-right: 35px; + padding-left: 35px; +} + +body.rtl .mec-event-grid-novel .mec-event-image { + float: right; +} + +body.rtl .mec-event-grid-novel .col-md-4.col-sm-4 .mec-event-detail-wrap { + margin-left: 0; + margin-right: 150px; +} + +body.rtl .mec-event-grid-novel .mec-event-content h4::after, body.rtl .mec-event-grid-novel .mec-event-content h4::before { + left: auto; + right: -30px; +} + +body.rtl .mec-event-grid-novel .mec-event-content h4::after { + right: -26px; +} + +/* daily view */ +body.rtl .mec-wrap .mec-calendar .mec-event-article .mec-event-time i { + margin: 0 0 0 7px; +} + +body.rtl .mec-calendar .mec-event-article .mec-event-title a { + float: right; +} + +/* agenda view */ +body.rtl .mec-agenda-time { + margin: 0 0 0 0; + direction: ltr; + padding: 0; + text-align: right; +} + +body.rtl .mec-agenda-event-title { + float: left; + width: calc(100% - 170px); + padding: 0 20px 0 0; +} + +body.rtl .mec-agenda-event-title span.event-color { + left: auto; + right: -0; + top: 8px; +} + +/* single event */ +body.rtl .mec-hourly-schedule-speaker-thumbnail, body.rtl .mec-single-event .mec-speakers-details ul li .mec-speaker-avatar a img { + float: right; +} + +body.rtl .mec-single-event .mec-speakers-details ul li .mec-speaker-name { + padding: 0 10px 0 0; +} + +body.rtl .mec-single-event .mec-speakers-details ul li .mec-speaker-job-title { + padding: 0 80px 0 0; +} + +body.rtl .mec-hourly-schedule-speaker-details { + padding: 0 20px 0 0; +} + +body.rtl .mec-hourly-schedule-speaker-name, body.rtl .mec-hourly-schedule-speaker-job-title, body.rtl .mec-hourly-schedule-speaker-contact-information, body.rtl .mec-organizer-social-information, body.rtl .mec-hourly-schedule-speaker-description { + text-align: right; +} + +body.rtl .mec-box-calendar.mec-calendar.mec-event-calendar-classic .mec-calendar-table-head dt { + font-size: 10px !important; +} + +body.rtl .mec-wrap .mec-events-meta-group-booking .mec-booking-calendar .mec-calendar dl dt { + text-align: center !important; +} + +body.rtl .mec-wrap .mec-single-event .mec-event-meta .mec-single-event-organizer dd a { + direction: ltr; +} + +body.rtl .mec-single-event .mec-event-export-module.mec-frontbox .mec-event-exporting .mec-export-details ul { + padding: 0; +} + +/* Booking module */ +.rtl .lity-content .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-dropdown span.mec-select-date-calendar-icon, +.rtl .mec-single-event .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-dropdown span.mec-select-date-calendar-icon, +.rtl .mec-booking-shortcode .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-dropdown span.mec-select-date-calendar-icon, +.rtl .lity-content .mec-book-first .mec-select-date-dropdown-wrapper .mec-select-date-dropdown span.mec-select-date-calendar-icon, +.rtl .mec-single-event .mec-book-first .mec-select-date-dropdown-wrapper .mec-select-date-dropdown span.mec-select-date-calendar-icon, +.rtl .mec-booking-shortcode .mec-book-first .mec-select-date-dropdown-wrapper .mec-select-date-dropdown span.mec-select-date-calendar-icon { + border-right: none; + border-left: 1px solid #e3e5e7; +} + +.rtl .mec-booking .mec-event-tickets-list .mec-ticket-style-row .mec-ticket-style-row-section-1 { + margin: 5px 0 0 25px; +} + +.rtl .mec-booking .mec-event-tickets-list .mec-ticket-style-row .mec-ticket-style-row-section-3 { + margin-left: unset; + margin-right: auto; +} + +.rtl .mec-booking .mec-event-tickets-list .mec-ticket-style-row input[type="number"] { + margin: 0 auto 10px 0; +} + +.rtl .mec-booking .mec-event-tickets-list .mec-ticket-style-row .plus, +.rtl .mec-booking .mec-event-tickets-list .mec-ticket-style-row .minus { + right: unset; + left: 5px; +} + +.rtl .mec-events-meta-group-booking #mec-book-form-btn-step-1, +.rtl .mec-events-meta-group-booking #mec-book-form-btn-step-2 { + float: left; +} + +.rtl .mec-wrap .button svg, +.rtl .mec-wrap button:not(.owl-dot):not(.gm-control-active):not(.mejs):not(.owl-prev):not(.owl-next):not(.et-fb-button) svg, +.rtl .mec-wrap input[type="submit"] svg, +.rtl .mec-wrap input[type="reset"] svg, +.rtl .mec-wrap input[type="button"] svg, +.rtl .lity-content .button svg, +.rtl .lity-content button:not(.owl-dot):not(.gm-control-active):not(.mejs):not(.owl-prev):not(.owl-next) svg, +.rtl .lity-content input[type="submit"] svg, +.rtl .lity-content input[type="reset"] svg, +.rtl .lity-content input[type="button"] svg { + margin-left: unset; + margin-right: 30px; + transform: rotate(180deg); +} + +.mec-booking-shortcode button#mec-book-form-btn-step-2 { + margin-left: unset; + margin-right: 30px; +} + +.rtl .mec-single-event a.button:after, +.rtl .lity-content .mec-events-meta-group-booking button[type="submit"]:after, +.rtl .mec-single-event .mec-events-meta-group-booking button[type="submit"]:after, +.rtl .mec-events-meta-group-booking .mec-booking-shortcode button[type="submit"]:after, +.rtl .mec-wrap .mec-events-meta-group-booking button[type="submit"]:after { + margin-left: unset; + margin-right: 4px; +} + +.rtl .lity-content .mec-events-meta-group-booking button.mec-book-form-back-button#mec-book-form-back-btn-step-2, +.rtl .mec-wrap .mec-single-event .mec-events-meta-group-booking button.mec-book-form-back-button#mec-book-form-back-btn-step-2, +.rtl .mec-events-meta-group-booking .mec-booking-shortcode button.mec-book-form-back-button#mec-book-form-back-btn-step-2, +.rtl .lity-content .mec-events-meta-group-booking button.mec-book-form-back-button#mec-book-form-back-btn-step-3, +.rtl .mec-wrap .mec-single-event .mec-events-meta-group-booking button.mec-book-form-back-button#mec-book-form-back-btn-step-3, +.rtl .mec-events-meta-group-booking .mec-booking-shortcode button.mec-book-form-back-button#mec-book-form-back-btn-step-3 { + float: right; +} + +.rtl .lity-content .mec-events-meta-group-booking button.mec-book-form-back-button#mec-book-form-back-btn-step-2 img.mec-svg-icon, +.rtl .mec-wrap .mec-single-event .mec-events-meta-group-booking button.mec-book-form-back-button#mec-book-form-back-btn-step-2 img.mec-svg-icon, +.rtl .mec-events-meta-group-booking .mec-booking-shortcode button.mec-book-form-back-button#mec-book-form-back-btn-step-2 img.mec-svg-icon, +.rtl .lity-content .mec-events-meta-group-booking button.mec-book-form-back-button#mec-book-form-back-btn-step-3 img.mec-svg-icon, +.rtl .mec-wrap .mec-single-event .mec-events-meta-group-booking button.mec-book-form-back-button#mec-book-form-back-btn-step-3 img.mec-svg-icon, +.rtl .mec-events-meta-group-booking .mec-booking-shortcode button.mec-book-form-back-button#mec-book-form-back-btn-step-3 img.mec-svg-icon { + margin-right: unset; + margin-left: 30px; + transform: rotate(180deg); +} + +.rtl .lity-content .mec-events-meta-group-booking .col-md-12 .mec-ticket-icon-wrapper, +.rtl .mec-single-event .mec-events-meta-group-booking .col-md-12 .mec-ticket-icon-wrapper, +.rtl .mec-events-meta-group-booking .mec-booking-shortcode .col-md-12 .mec-ticket-icon-wrapper { + margin-right: unset; + margin-left: 25px; +} + +.rtl .lity-content .mec-events-meta-group-booking label, +.rtl .mec-single-event .mec-events-meta-group-booking label, +.rtl .mec-events-meta-group-booking .mec-booking-shortcode label, +.rtl .lity-content .mec-events-meta-group-booking h5, +.rtl .mec-single-event .mec-events-meta-group-booking h5, +.rtl .mec-events-meta-group-booking .mec-booking-shortcode h5 { + padding: 0 0 5px 1em; + text-align: right; +} + +.rtl .lity-content .mec-events-meta-group-booking p { + text-align: right; +} + +.rtl .lity-content .mec-events-meta-group-booking .mec-booking-email-field-wrapper span.mec-booking-email-field-icon, +.rtl .mec-single-event .mec-events-meta-group-booking .mec-booking-email-field-wrapper span.mec-booking-email-field-icon, +.rtl .mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-email-field-wrapper span.mec-booking-email-field-icon, +.rtl .lity-content .mec-events-meta-group-booking .mec-booking-name-field-wrapper span.mec-booking-name-field-icon, +.rtl .mec-single-event .mec-events-meta-group-booking .mec-booking-name-field-wrapper span.mec-booking-name-field-icon, +.rtl .mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-name-field-wrapper span.mec-booking-name-field-icon, +.rtl .lity-content .mec-events-meta-group-booking .mec-stripe-name-and-email-wrapper span.mec-booking-email-field-icon, +.rtl .mec-single-event .mec-events-meta-group-booking .mec-stripe-name-and-email-wrapper span.mec-booking-email-field-icon, +.rtl .mec-events-meta-group-booking .mec-booking-shortcode ..mec-stripe-name-and-email-wrapper span.mec-field-icon, +.rtl .lity-content .mec-events-meta-group-booking .mec-field-wrapper span.mec-field-icon, +.rtl .mec-single-event .mec-events-meta-group-booking .mec-field-wrapper span.mec-field-icon, +.rtl .mec-events-meta-group-booking .mec-booking-shortcode .mec-field-wrapper span.mec-field-icon { + border-radius: 0 3px 3px 0; +} + +.rtl .lity-content .mec-events-meta-group-booking .mec-booking-email-field-wrapper input, +.rtl .mec-single-event .mec-events-meta-group-booking .mec-booking-email-field-wrapper input, +.rtl .mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-email-field-wrapper input, +.rtl .lity-content .mec-events-meta-group-booking .mec-stripe-name-and-email-wrapper input, +.rtl .mec-single-event .mec-events-meta-group-booking .mec-stripe-name-and-email-wrapper input, +.rtl .mec-events-meta-group-booking .mec-booking-shortcode .mec-stripe-name-and-email-wrapper input, +.rtl .lity-content .mec-events-meta-group-booking .mec-booking-name-field-wrapper input, +.rtl .mec-single-event .mec-events-meta-group-booking .mec-booking-name-field-wrapper input, +.rtl .mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-name-field-wrapper input, +.rtl .lity-content .mec-events-meta-group-booking .mec-field-wrapper input, +.rtl .mec-single-event .mec-events-meta-group-booking .mec-field-wrapper input, +.rtl .mec-events-meta-group-booking .mec-booking-shortcode .mec-field-wrapper input { + border-left: 1px solid #e3e5e7; + border-right: none; + border-radius: 3px 0 0 3px; +} + +.rtl .lity-content .mec-events-meta-group-booking input[type="checkbox"], +.rtl .mec-single-event .mec-events-meta-group-booking input[type="checkbox"], +.rtl .mec-events-meta-group-booking .mec-booking-shortcode input[type="checkbox"] { + float: right; +} + +.rtl .lity-content .mec-events-meta-group-booking .mec_book_first_for_all, +.rtl .mec-single-event .mec-events-meta-group-booking .mec_book_first_for_all, +.rtl .mec-events-meta-group-booking .mec-booking-shortcode .mec_book_first_for_all, +.rtl .lity-container .mec-events-meta-group-booking .mec_book_first_for_all, +.rtl .lity-content .mec-events-meta-group-booking input[type="checkbox"], +.rtl .mec-single-event .mec-events-meta-group-booking input[type="checkbox"], +.rtl .mec-events-meta-group-booking .mec-booking-shortcode input[type="checkbox"], +.rtl .mec-single-event .mec-events-meta-group-booking .mec-booking-dates-checkboxes input[type="checkbox"], +.rtl .mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-dates-checkboxes input[type="checkbox"], +.rtl .lity-content .mec-events-meta-group-booking .mec-booking-dates-checkboxes input[type="checkbox"], +.rtl .mec-booking input[type="checkbox"] { + margin: 0 0 0 10px; +} + +.rtl .mec-book-reg-field-checkbox input[type="checkbox"], +.rtl .mec-book-reg-field-radio input[type="radio"] { + float: right; + margin-right: unset !important; + margin-left: 10px !important; + top: 3px; + right: 3px; +} + +.rtl .mec-events-meta-group-booking ul.mec-book-price-details li { + border-right: none; + border-left: 1px dashed #e6e7e8; + margin-right: unset; + margin-left: 30px; + padding-right: unset !important; + padding-left: 30px !important; +} + +.rtl .mec-events-meta-group-booking ul.mec-book-price-details li span.mec-book-price-detail-icon { + margin: 0 0 0 30px; +} + +.rtl .lity-content .mec-events-meta-group-booking .mec-book-form-coupon form button, +.rtl .mec-single-event .mec-events-meta-group-booking .mec-book-form-coupon form button, +.rtl .mec-events-meta-group-booking .mec-booking-shortcode .mec-book-form-coupon form button { + left: 6px; + right: auto; +} + +.rtl .lity-content .mec-events-meta-group-booking ul, +.rtl .mec-single-event .mec-events-meta-group-booking ul, +.rtl .mec-events-meta-group-booking .mec-booking-shortcode ul { + padding-left: unset; + padding-right: 0; +} + +.rtl .lity-content .mec-events-meta-group-booking .mec-book-form-coupon form span.mec-booking-coupon-field-wrapper .mec-booking-coupon-field-icon, +.rtl .mec-single-event .mec-events-meta-group-booking .mec-book-form-coupon form span.mec-booking-coupon-field-wrapper .mec-booking-coupon-field-icon, +.rtl .mec-events-meta-group-booking .mec-booking-shortcode .mec-book-form-coupon form span.mec-booking-coupon-field-wrapper .mec-booking-coupon-field-icon { + border-right: none; + border-left: 1px solid #e3e5e7; +} + +.rtl .lity-content .mec-events-meta-group-booking .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul li:first-child, +.rtl .mec-single-event .mec-events-meta-group-booking .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul li:first-child, +.rtl .mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul li:first-child { + padding-right: unset; + margin-right: unset; + border-right: unset; + padding-left: 30px; + margin-left: 30px; + border-left: 1px dashed #e6e7e8; +} + +.rtl .lity-content .mec-events-meta-group-booking .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul li, +.rtl .mec-single-event .mec-events-meta-group-booking .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul li, +.rtl .mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul li { + text-align: left; +} + +.rtl .lity-content .mec-events-meta-group-booking .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option:nth-child(2n + 1), +.rtl .mec-wrap .mec-events-meta-group-booking .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option:nth-child(2n + 1), +.rtl .mec-events-meta-group-booking .mec-booking-shortcode .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option:nth-child(2n + 1) { + margin-right: unset; + margin-left: 20px; +} + +.rtl .lity-content .mec-events-meta-group-booking .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option .mec-book-form-gateway-option-radio, +.rtl .mec-wrap .mec-events-meta-group-booking .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option .mec-book-form-gateway-option-radio, +.rtl .mec-events-meta-group-booking .mec-booking-shortcode .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option .mec-book-form-gateway-option-radio { + margin-left: unset; + margin-right: auto; +} + +.rtl .lity-content .mec-events-meta-group-booking .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option .mec-book-form-gateway-option-svg, +.rtl .mec-wrap .mec-events-meta-group-booking .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option .mec-book-form-gateway-option-svg, +.rtl .mec-events-meta-group-booking .mec-booking-shortcode .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option .mec-book-form-gateway-option-svg { + margin-right: unset; + margin-left: 10px; +} + +.rtl .lity-content .mec-events-meta-group-booking .mec-click-pay #mec_woo_add_to_cart_btn_r, +.rtl .mec-single-event .mec-events-meta-group-booking .mec-click-pay #mec_woo_add_to_cart_btn_r, +.rtl .mec-events-meta-group-booking .mec-booking-shortcode .mec-click-pay #mec_woo_add_to_cart_btn_r, +.rtl .lity-content .mec-events-meta-group-booking .mec-click-pay button.mec-book-form-next-button, +.rtl .mec-single-event .mec-events-meta-group-booking .mec-click-pay button.mec-book-form-next-button, +.rtl .mec-events-meta-group-booking .mec-booking-shortcode .mec-click-pay button.mec-book-form-next-button { + float: left; +} + +.rtl .mec-book-form-gateway-checkout [id*="mec_do_transaction_stripe_"] .mec-form-row.mec-stripe-name-and-email-wrapper .mec-form-row:nth-child(2) { + margin-left: unset; + margin-right: 12px; +} + +.rtl .lity-content .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-dropdown span.mec-select-date-calendar-icons, +.rtl .mec-single-event .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-dropdown span.mec-select-date-calendar-icons, +.rtl .mec-booking-shortcode .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-dropdown span.mec-select-date-calendar-icons { + right: unset; + left: 10px; +} + +.rtl .lity-content .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-container, +.rtl .mec-single-event .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-container, +.rtl .mec-booking-shortcode .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-container { + right: unset; + left: 40px; +} + +.rtl .mec-booking-calendar-month-navigation .mec-previous-month { + left: unset; + right: 0; +} + +.rtl .mec-booking-calendar-month-navigation .mec-next-month { + right: unset; + left: 0; +} + +.rtl .mec-select-date-calendar-container .mec-calendar.mec-event-calendar-classic dl dt { + text-align: center; +} + +.rtl .mec-booking-calendar-month-navigation .mec-previous-month a i:before { + content: "\e606"; +} + +.rtl .mec-booking-calendar-month-navigation .mec-next-month a i:before { + content: "\e605"; +} + +/* --------------------- */ diff --git a/assets/css/mecrtl.min.css b/assets/css/mecrtl.min.css new file mode 100755 index 0000000..60ab88e --- /dev/null +++ b/assets/css/mecrtl.min.css @@ -0,0 +1 @@ +.mec-single-event .mec-events-meta-date i,.mec-single-event .mec-single-event-organizer i{margin-left:10px;margin-right:12px}.event-color,.mec-event-schedule-content,.mec-single-event .mec-frontbox-title:before{margin-left:0}.mec-event-cover-classic .mec-event-icon{margin-left:14px}.event-color{margin-right:5px}.mec-event-list-classic .mec-event-image{margin-left:20px}.mec-event-article i{margin-left:10px}.mec-event-cover-classic .mec-event-icon,.mec-event-list-classic .mec-event-image{margin-right:0}.mec-single-event .mec-frontbox-title:before{margin-right:39px}.mec-event-schedule-content{margin-right:25px}.mec-event-schedule-content dl,.mec-single-event .mec-event-meta dt,.mec-single-event .mec-event-meta h3{padding-left:0}.mec-single-event .mec-event-meta dt,.mec-single-event .mec-event-meta h3{padding-right:10px}.mec-event-schedule-content dl{padding-right:24px}.mec-event-schedule-content{border:0}.mec-event-schedule-content{border-right:4px solid #f0f0f0}.mec-event-cover-modern .mec-event-cover-a,.mec-event-schedule-content dl:before{left:auto}.mec-event-cover-modern .mec-event-cover-a,.mec-event-schedule-content dl:before{right:0}.mec-event-cover-classic .mec-event-icon,.mec-event-list-classic .mec-event-image{float:right}.mec-event-cover-classic .mec-btn-wrapper{text-align:right}.mec-wrap .mec-calendar-topsec .mec-calendar-events-sec .mec-table-side-day{padding:0}.mec-wrap article.mec-event-article.mec-clear{text-align:right}.mec-wrap .mec-event-article .mec-event-content p{text-align:right}.mec-wrap .button,.mec-wrap button,.mec-wrap input[type=button],.mec-wrap input[type=reset],.mec-wrap input[type=submit]{margin:0}.mec-wrap .mec-events-meta-group-booking .mec-book-price-details li{float:right}.mec-wrap .mec-events-meta-group-booking .mec-book-price-details{width:330px}.mec-wrap .mec-marker-wrap .mec-marker-pulse{margin:-15px 28px 1px 40px}.mec-wrap .mec-marker-wrap .mec-marker-pulse:after{margin:-13px -13px 0 0}.mec-fes-list ul li .mec-fes-event-remove,.mec-fes-list ul li .mec-fes-event-view{float:left}.mec-fes-form input[type=checkbox],.mec-fes-form input[type=radio]{float:right;margin:5px}.mec-fes-form #mec_fes_form .mec-form-row #mec_cost{float:none}.mec-fes-form label{padding-right:0}.mec-wrap .mec-totalcal-box i{float:right;text-align:center}.mec-totalcal-box .mec-date-search{float:left}.mec-wrap .mec-single-modern .mec-single-event-bar>div i{float:right;padding-left:10px}.mec-wrap .mec-single-modern .mec-single-event-bar dd{margin:0 30px 0 0;padding:0}.mec-wrap .mec-event-meta.mec-color-before.mec-frontbox{width:100%}.mec-wrap .mec-single-modern .mec-event-meta .mec-single-event-organizer dd a{float:left;position:absolute;margin-right:5px}.mec-wrap .mec-single-event .mec-single-event-organizer i{margin-top:5px}.mec-wrap .mec-single-event .mec-event-meta i{float:right;padding-left:5px}.mec-wrap .mec-single-event .mec-event-meta dt,.mec-wrap .mec-single-event .mec-event-meta h3{padding-right:5px}.mec-wrap .mec-single-event .mec-event-meta dd{padding-right:35px;padding-left:0}.mec-wrap .mec-single-event .mec-event-meta .mec-single-event-organizer dd{padding:0}.mec-wrap .mec-single-event .mec-event-meta .mec-single-event-organizer dd a{float:left;position:absolute;margin-right:5px}.mec-wrap .mec-single-event .mec-event-meta dd.mec-events-event-categories:after{font-family:FontAwesome;color:#40d9f1;font-size:16px;content:"\f104";padding-left:10px}.mec-wrap .mec-single-event .mec-event-meta dd.mec-events-event-categories:before{content:"";padding:0}.mec-wrap .mec-single-event .mec-event-export-module.mec-frontbox .mec-event-exporting .mec-export-details ul li:last-child{text-align:left;padding-left:0}.mec-wrap .mec-single-event .mec-events-button{margin:0}.mec-wrap .mec-calendar .mec-event-article .mec-event-image{float:right;margin-left:20px}.mec-wrap .mec-calendar .mec-event-article .mec-event-title{text-align:right;padding:5px}.mec-wrap .mec-calendar .mec-event-article .mec-event-time i{float:right}.mec-wrap .mec-calendar .mec-event-article .mec-event-time.mec-color{float:right}.mec-wrap .mec-calendar .mec-event-article .mec-event-detail{float:right}.mec-wrap .mec-calendar.mec-calendar-weekly .mec-event-list-weekly-date{float:right}.mec-wrap .mec-event-meta-wrap{border-right:1px solid #eee;border-left:0}.mec-event-meta{float:right}.mec-event-sharing-wrap{right:20px;left:auto}.mec-event-footer .mec-booking-button{right:auto;left:20px}.mec-single-event .mec-single-event-organizer dd span,.mec-wrap .mec-single-event .mec-events-meta-date dd span{padding-bottom:20px}.single-mec-events .mec-wrap .col-md-4{direction:rtl;float:right}.single-mec-events .mec-wrap .mec-single-modern .col-md-4{margin-top:-50px}.mec-events-template-default .mec-wrap .col-md-4{margin-top:0;float:left}.mec-events-template-default .mec-wrap .col-md-8{margin-top:0;float:right}.single-mec-events .mec-single-modern .mec-single-event-bar{padding:14px 0}.single-mec-events .mec-single-modern .col-md-4 .mec-frontbox{margin:0}.mec-single-event .mec-frontbox-title:before,.single-mec-events .mec-single-event .mec-events-meta-group-booking form>h4:before{transform:translate(-50%);margin:0}.single-mec-events .mec-single-event-category,.single-mec-events .mec-single-event-location,.single-mec-events .mec-single-event-organizer{z-index:1}.single-mec-events .mec-single-event .mec-booking-button{position:relative;z-index:2}.single-mec-events .mec-wrap .mec-single-event .mec-event-meta dd a i:before{content:'\f104';line-height:32px}.single-mec-events .mec-wrap .mec-single-event .mec-event-meta dd.mec-events-event-categories:after{display:none}.mec-wrap .mec-event-list-standard .mec-event-meta-wrap{display:table-cell}.mec-wrap .mec-totalcal-box i{float:right}.mec-wrap i.mec-sl-map-marker{float:right;margin-left:3px}.mec-wrap .mec-event-list-minimal .btn-wrapper .mec-detail-button{float:left}.mec-wrap .mec-event-list-minimal .mec-event-article .col-md-9.col-sm-9{float:right;width:100%}.mec-wrap .mec-event-list-minimal .mec-event-article .mec-event-date.mec-bg-color{float:right;margin-right:0;margin-left:10px}.mec-wrap .mec-event-list-minimal .mec-event-date span{padding-left:25px;margin-left:7px;padding-right:0;margin-right:0}.mec-event-grid-clean .mec-event-footer .mec-booking-button{left:0;right:auto}.mec-event-grid-clean .mec-event-sharing-wrap{left:auto;right:0}.mec-event-grid-clean .event-grid-t2-head .mec-event-date{float:right;margin-right:0;margin-left:11px}.mec-event-grid-clean .event-grid-t2-head{text-align:right}.mec-event-grid-clean .event-grid-t2-head .mec-event-month{text-align:right}.mec-event-grid-clean .event-grid-t2-head .mec-event-detail{text-align:right}.mec-event-grid-minimal .mec-event-date{margin-right:0;margin-left:20px}.mec-wrap .mec-event-grid-modern .mec-event-article .event-grid-modern-head .mec-event-date.mec-color{margin-left:11px;margin-right:0}.mec-wrap .mec-event-grid-modern .mec-event-content .mec-event-title .event-color{float:right;margin:7px}.mec-wrap .mec-event-grid-modern .mec-event-article h4.mec-event-title{overflow:hidden}.mec-wrap .mec-event-grid-simple article.mec-event-article.mec-clear{text-align:center}.mec-wrap .mec-event-grid-simple article.mec-event-article h4.mec-event-title{text-align:center}.mec-wrap .mec-event-grid-modern .event-grid-modern-head .mec-event-date{float:right}.mec-wrap .mec-event-article h4.mec-event-title{text-align:right}.mec-wrap .event-grid-modern-head.clearfix{text-align:right}.mec-wrap .event-carousel-type1-head .mec-event-date-carousel{left:auto;right:1px;padding-left:21px;padding-right:25px}.mec-wrap .event-carousel-type1-head .mec-event-date-info-year{right:auto;left:60px}.mec-wrap .event-carousel-type1-head .mec-event-date-info{right:auto;left:60px}.mec-wrap .event-carousel-type1-head .mec-event-date-carousel:after{left:auto;bottom:-13px;right:5px;transform:rotate(-45deg)}.mec-wrap .event-carousel-type2-head .mec-event-footer-carousel-type2 .mec-booking-button{float:left}.mec-wrap .mec-event-carousel-type2 .mec-event-footer-carousel-type2 .mec-event-sharing-wrap{left:auto;right:-11px}.mec-wrap .event-carousel-type3-head .mec-event-footer-carousel-type3 .mec-booking-button{float:left}.mec-wrap .mec-event-footer-carousel-type3 .mec-event-sharing-wrap{left:auto;right:11%}.mec-event-list-standard .mec-time-details:before,.mec-event-list-standard .mec-venue-details:before,.mec-wrap .mec-event-list-standard .mec-date-details:before{right:0;text-align:right}.mec-wrap .mec-event-meta.mec-color-before span{margin-right:28px}.mec-wrap .mec-timetable-t2-col{float:right}.mec-wrap .mec-agenda-date-wrap{float:right}.mec-wrap .mec-agenda-events-wrap{float:left}.mec-wrap .mec-yearly-view-wrap .mec-yearly-calendar-sec{float:right}.mec-wrap .mec-yearly-agenda-sec{float:left;padding:0 20px 0 0}.rtl .mec-yearly-view-wrap .mec-yearly-title-sec{direction:rtl}.rtl .mec-yearly-view-wrap .mec-yearly-title-sec .mec-previous-year{right:20px;left:auto}.rtl .mec-yearly-view-wrap .mec-yearly-title-sec .mec-next-year{left:20px;right:auto;direction:ltr}.rtl .mec-yearly-view-wrap .mec-yearly-title-sec .mec-next-year .mec-sl-angle-right:before{content:"\e605"}.rtl .mec-yearly-view-wrap .mec-yearly-title-sec .mec-previous-year .mec-sl-angle-left:before{content:"\e606"}.mec-wrap .mec-calendar.mec-event-calendar-classic .mec-calendar-events-sec{text-align:right}.mec-wrap .mec-skin-monthly-view-month-navigator-container .mec-calendar-events-sec h3.mec-color.mec-table-side-day{float:right}.rtl .mec-calendar.mec-event-calendar-classic dl dt{text-align:right}.rtl .mec-calendar.mec-event-calendar-classic .mec-has-event:after{left:auto;right:7px}.rtl .mec-box-calendar.mec-calendar.mec-event-calendar-classic .mec-calendar-side .mec-next-month{right:auto}.rtl .mec-box-calendar.mec-calendar.mec-event-calendar-classic .mec-calendar-side .mec-previous-month{left:auto}.rtl .mec-wrap .mec-calendar .mec-event-article .mec-event-title{direction:rtl}.rtl .mec-calendar .mec-calendar-events-side{border-right:1px solid #efefef}.rtl .mec-calendar .mec-event-article,.rtl .mec-month-navigator{direction:ltr}.rtl .mec-calendar .mec-calendar-side .mec-previous-month{border-bottom-left-radius:6px;border-bottom-right-radius:0;border-left:1px solid #efefef;border-right:0;left:auto;right:0;direction:rtl}.rtl .mec-wrap .mec-calendar .mec-event-article .mec-event-image{float:right;margin-left:20px;margin-right:0}.rtl .mec-wrap article:not([class^=mec-event-countdown]):not([class^=mec-event-cover-]).mec-label-canceled:before,.rtl .mec-wrap article:not([class^=mec-event-countdown]):not([class^=mec-event-cover-]).mec-label-featured:before{z-index:1;position:absolute;top:25px;right:auto;left:-37px;font-size:11px;letter-spacing:1px;text-transform:uppercase;background:#04de78;padding:2px 40px;color:#fff;-ms-transform:rotate(-45deg);-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}.rtl .mec-calendar .mec-calendar-side .mec-next-month{border-bottom-right-radius:6px;border-bottom-left-radius:0;border-right:1px solid #efefef;border-left:0;left:0;right:auto;direction:rtl}.rtl .mec-calendar .mec-calendar-side .mec-next-month .mec-sl-angle-right:before{content:"\e605"}.rtl .mec-calendar .mec-calendar-side .mec-previous-month .mec-sl-angle-left:before{content:"\e606"}.rtl .event-color,.rtl .mec-event-article i{margin-right:0;margin-right:10px}.mec-calendar.mec-calendar-daily .mec-calendar-d-table dl dt{float:right;border-left:1px solid #e6e6e6}.mec-event-detail.mec-map-view-event-detail{text-align:right}.mec-event-article i{margin-left:0}.mec-wrap .mec-event-cover-clean .mec-event-date{right:auto;left:60px}.mec-wrap .mec-event-countdown-style1 .mec-event-countdown-part1{padding:50px 4% 50px 1%}.mec-wrap .mec-event-countdown-style2 .mec-event-countdown-part2 .mec-event-date-place{text-align:right}.mec-wrap .mec-event-countdown-style3 .mec-event-countdown-part1{padding:50px 4% 50px 1%}.mec-wrap .mec-event-countdown-style3 .mec-event-countdown{left:20px;right:auto}.mec-wrap .mec-event-countdown-style3 .mec-event-title-link{left:auto;right:190px}.mec-event-countdown-style3 .mec-event-countdown-part-details .mec-event-title{padding-right:0}.mec-wrap .mec-event-countdown-style3 .mec-event-countdown-part-details .mec-event-link{padding-left:0;padding-right:22px;margin-left:22px}.mec-wrap .mec-event-countdown-style3 .mec-event-countdown-part-details .mec-event-link:before{right:0;left:auto}.mec-wrap .mec-event-countdown-style3 .mec-event-date{left:auto;right:-27px}.mec-wrap .mec-event-countdown-style3 .mec-event-date:after{left:auto;right:8px;transform:rotate(-45deg)}.mec-wrap .mec-masonry .mec-event-content .mec-event-description{display:block;direction:rtl;text-align:right}.mec-wrap .mec-masonry .mec-event-grid-modern .mec-event-content .mec-event-title .event-color{float:left}.mec-wrap .mec-masonry .event-grid-modern-head .mec-event-date{margin:0 0 0 11px}.mec-wrap .mec-masonry .mec-masonry-col6 i{float:right;margin:0 0 0 7px}.mec-event-tile-view article.mec-tile-item .mec-event-time{right:auto;left:4px}.mec-wrap .mec-timetable-t2-content{direction:rtl;text-align:right}.mec-wrap .mec-timetable-t2-content div{text-align:right}.mec-wrap .mec-timetable-t2-content div i{margin-right:0;margin-left:5px}.mec-wrap .mec-timetable-t2-content div span{float:left;text-align:right;width:calc(100% - 22px)}.mec-wrap .mec-event-content .mec-event-title a.mec-color-hover{float:right}.mec-wrap .mec-event-content .mec-event-title .event-color{float:left}.mec-wrap .mec-slider-t1 .mec-event-grid-modern .event-grid-modern-head .mec-event-date{float:right;margin:0 0 0 11px}.mec-wrap .mec-slider-t1 .mec-event-grid-modern .event-grid-modern-head.clearfix{text-align:right}.mec-wrap .mec-slider-t1 .mec-event-content h4.mec-event-title{overflow:hidden;text-align:right}.mec-wrap .mec-slider-t1 .mec-event-content span.event-color{float:right;margin:10px}.mec-wrap .mec-slider-t1 .mec-event-content .mec-event-detail{display:block;text-align:right}.mec-wrap .mec-event-grid-modern .mec-event-footer .mec-booking-button{left:auto;right:0}.mec-wrap .mec-slider-t1 .mec-slider-t1-img{float:left}.mec-wrap .mec-slider-t2 .mec-event-grid-modern .event-grid-modern-head .mec-event-date{float:right;margin:0 0 0 11px}.mec-wrap .mec-slider-t2 .mec-event-grid-modern .event-grid-modern-head.clearfix{text-align:right}.mec-wrap .mec-slider-t2 .mec-event-content h4.mec-event-title{overflow:hidden;text-align:right}.mec-wrap .mec-slider-t2 .mec-event-content span.event-color{float:right;margin:10px}.mec-wrap .mec-slider-t2 .mec-event-content .mec-event-detail{display:block;text-align:right}.mec-wrap .mec-event-grid-modern .mec-event-footer .mec-booking-button{left:auto;right:0}.mec-wrap .mec-event-grid-modern .mec-event-sharing-wrap{left:0;right:auto}.mec-wrap .mec-slider-t2-wrap .mec-owl-theme .owl-nav div.owl-prev{left:30px;right:auto}.mec-wrap .mec-slider-t2-wrap .mec-owl-theme .owl-nav div.owl-next{left:82px;right:auto}.mec-wrap .mec-slider-t2-content.mec-event-grid-modern.mec-bg-color{left:0}.mec-wrap .mec-slider-t2 .mec-slider-t2-img{left:auto;right:0}.mec-wrap .mec-slider-t3 .mec-slider-t3-content{width:95%}.mec-wrap .mec-slider-t3 .mec-event-grid-modern .event-grid-modern-head .mec-event-date{float:right;margin:0 0 0 11px}.mec-wrap .mec-slider-t3 .mec-event-grid-modern .event-grid-modern-head.clearfix{text-align:right}.mec-wrap .mec-slider-t3 .mec-event-content h4.mec-event-title{overflow:hidden;text-align:right}.mec-wrap .mec-slider-t3 .mec-event-content span.event-color{float:right;margin:10px}.mec-wrap .mec-slider-t3 .mec-event-content .mec-event-detail{display:block;text-align:right}.mec-wrap .mec-slider-t3 .mec-slider-t3-footer a.mec-booking-button{float:right;margin-bottom:11px}.mec-wrap .mec-slider-t4 .mec-event-grid-modern .event-grid-modern-head .mec-event-date{float:right;margin:0 0 0 11px}.mec-wrap .mec-slider-t4 .mec-event-grid-modern .event-grid-modern-head.clearfix{text-align:right}.mec-wrap .mec-slider-t4 .mec-event-content h4.mec-event-title{overflow:hidden;text-align:right}.mec-wrap .mec-slider-t4 .mec-event-content span.event-color{float:right;margin:10px}.mec-wrap .mec-slider-t4 .mec-event-content .mec-event-detail{display:block;text-align:right}.mec-wrap .mec-slider-t4 .mec-slider-t4-footer a.mec-booking-button{float:right;margin-bottom:11px}.mec-slider-t4-content.mec-event-grid-modern{left:auto;right:8%}.mec-wrap .mec-slider-t4-wrap .mec-owl-theme .owl-nav div.owl-prev{left:30px;right:auto}.mec-wrap .mec-slider-t4-wrap .mec-owl-theme .owl-nav div.owl-next{left:82px;right:auto}.mec-fes-form .mec-fes-form-cntt,.mec-fes-form .mec-fes-form-sdbr{direction:rtl;text-align:right}.mec-fes-form .mec-fes-form-cntt{float:right;padding-right:0;padding-left:20px}.mec-fes-form .mec-fes-form-sdbr{padding-right:20px;padding-left:0}.mec-fes-form .mec-fes-form-cntt .mec-col-4,.mec-fes-form .mec-fes-form-sdbr .mec-col-4{float:unset}@media only screen and (max-width:768px){.mec-event-list-modern .col-md-2.col-sm-2{left:auto;right:0}.mec-event-list-modern .col-md-4.col-sm-4.mec-btn-wrapper{right:auto;left:0}.mec-wrap .mec-event-list-minimal .btn-wrapper .mec-detail-button{display:block;width:100%}.mec-wrap .mec-event-countdown-style3 .mec-event-date{right:0}.mec-wrap .mec-event-countdown-style3 .mec-event-title-link{right:130px}}@media only screen and (min-width:480px){.mec-event-list-modern .mec-btn-wrapper .mec-booking-button{float:left}}.mec-wrap .mec-event-content .mec-event-title .event-color{float:right;margin-top:10px}.mec-event-list-standard .mec-event-title,.mec-wrap .mec-event-content .mec-event-description,.mec-wrap .mec-event-content .mec-event-title a.mec-color-hover{display:flex}.mec-event-description{line-height:1.7}.mec-event-list-standard .mec-date-details,.mec-event-list-standard .mec-time-details,.mec-event-list-standard .mec-venue-details{text-align:right;padding-right:28px;direction:rtl}.mec-wrap .mec-event-meta.mec-color-before,.mec-wrap .mec-event-meta.mec-color-before span{margin:0;marign-left:28px;direction:rtl;text-align:right}.mec-skin-daily-view-events-container .mec-owl-carousel .owl-wrapper{display:inline-flex!important;width:100%!important}body.rtl .mec-wrap .col-md-1,body.rtl .mec-wrap .col-md-10,body.rtl .mec-wrap .col-md-11,body.rtl .mec-wrap .col-md-12,body.rtl .mec-wrap .col-md-2,body.rtl .mec-wrap .col-md-3,body.rtl .mec-wrap .col-md-4,body.rtl .mec-wrap .col-md-5,body.rtl .mec-wrap .col-md-6,body.rtl .mec-wrap .col-md-7,body.rtl .mec-wrap .col-md-8,body.rtl .mec-wrap .col-md-9{float:right!important}body.rtl .ui-datepicker.ui-widget select{width:32%}body.rtl .mec-wrap .mec-cancellation-reason span,body.rtl .mec-wrap .mec-labels-normal .mec-label-normal{margin-left:0;margin-right:10px}body.rtl .mec-calendar .mec-calendar-events-side .mec-table-side-title,body.rtl .mec-event-footer .mec-booking-button,body.rtl .mec-wrap .mec-load-more-button{letter-spacing:0}body.rtl .mec-wrap .mec-time-details{direction:ltr}body.rtl .mec-wrap .mec-search-form.mec-totalcal-box .col-md-6{float:left!important}body.rtl .mec-wrap .mec-event-list-classic .mec-event-date,body.rtl .mec-wrap .mec-event-list-classic .mec-event-time{margin-right:0;margin-left:5px;padding-right:20px;position:relative}body.rtl .mec-wrap .mec-event-list-classic .mec-event-article i{position:absolute;left:auto;right:0;top:2px;margin:0}body.rtl .mec-wrap .mec-event-list-minimal .mec-event-article .col-md-9.col-sm-9{width:75%}body.rtl .mec-wrap .mec-event-list-minimal .event-color,body.rtl .mec-wrap .mec-event-list-minimal .mec-event-article i{margin:0 0 0 10px}body.rtl .mec-wrap .mec-event-list-minimal .btn-wrapper .mec-detail-button{letter-spacing:0}@media only screen and (min-width:768px){body.rtl .mec-event-list-modern .col-md-2.col-sm-2{left:auto;right:0;top:20px}.mec-event-list-modern .col-md-6.col-sm-6{padding-right:225px;padding-left:195px}.mec-event-list-modern .col-md-4.col-sm-4.mec-btn-wrapper{right:auto;left:0;top:30%}}body.rtl .mec-event-list-modern .mec-event-detail,body.rtl .mec-event-list-modern .mec-event-detail .mec-time-details{direction:ltr;text-align:right}body.rtl .mec-event-list-modern .mec-event-article{direction:rtl;text-align:right}body.rtl .mec-event-list-modern .mec-btn-wrapper .mec-booking-button,body.rtl .mec-event-list-modern .mec-event-date .event-f{letter-spacing:0}body.rtl .mec-event-list-modern .mec-event-sharing{padding:0}body.rtl .mec-event-list-modern .mec-event-sharing>li{margin:0}body.rtl .mec-event-list-modern .mec-event-sharing>li i{margin:0 0 0 10px}body.rtl .mec-event-list-standard .mec-event-footer .mec-booking-button{letter-spacing:0}body.rtl .mec-event-list-standard .mec-shortcode-organizers{padding:0 20px 0 0}body.rtl .mec-event-list-standard .mec-shortcode-organizers .mec-sl-user:before{left:auto;right:0}body.rtl .mec-events-toggle .mec-toggle-item-inner i{right:auto;left:25px;top:50%}body.rtl .mec-events-toggle .mec-toggle-title{text-align:right;padding-left:0;padding-right:15px;float:right}body.rtl .mec-event-grid-minimal .mec-event-title{direction:rtl}body.rtl .mec-event-grid-minimal .mec-event-title a{float:right}body.rtl .mec-event-grid-modern .mec-event-sharing{right:auto;left:-5px}body.rtl .mec-event-grid-simple .mec-event-article:after{right:auto;left:-1px}body.rtl .mec-event-grid-simple .event-color{margin:0 10px}body.rtl .mec-event-grid-simple .mec-time-details{text-align:center}body.rtl .mec-event-grid-novel .mec-event-address::before,body.rtl .mec-event-grid-novel .mec-event-detail::before,body.rtl .mec-event-grid-novel .mec-event-month::before,body.rtl .mec-event-grid-novel .mec-local-time-details:before{left:auto;right:0}body.rtl .mec-event-grid-novel .mec-event-address,body.rtl .mec-event-grid-novel .mec-event-detail,body.rtl .mec-event-grid-novel .mec-event-month,body.rtl .mec-event-grid-novel .mec-local-time-details{padding-right:35px;padding-left:35px}body.rtl .mec-event-grid-novel .mec-event-image{float:right}body.rtl .mec-event-grid-novel .col-md-4.col-sm-4 .mec-event-detail-wrap{margin-left:0;margin-right:150px}body.rtl .mec-event-grid-novel .mec-event-content h4::after,body.rtl .mec-event-grid-novel .mec-event-content h4::before{left:auto;right:-30px}body.rtl .mec-event-grid-novel .mec-event-content h4::after{right:-26px}body.rtl .mec-wrap .mec-calendar .mec-event-article .mec-event-time i{margin:0 0 0 7px}body.rtl .mec-calendar .mec-event-article .mec-event-title a{float:right}body.rtl .mec-agenda-time{margin:0;direction:ltr;padding:0;text-align:right}body.rtl .mec-agenda-event-title{float:left;width:calc(100% - 170px);padding:0 20px 0 0}body.rtl .mec-agenda-event-title span.event-color{left:auto;right:0;top:8px}body.rtl .mec-hourly-schedule-speaker-thumbnail,body.rtl .mec-single-event .mec-speakers-details ul li .mec-speaker-avatar a img{float:right}body.rtl .mec-single-event .mec-speakers-details ul li .mec-speaker-name{padding:0 10px 0 0}body.rtl .mec-single-event .mec-speakers-details ul li .mec-speaker-job-title{padding:0 80px 0 0}body.rtl .mec-hourly-schedule-speaker-details{padding:0 20px 0 0}body.rtl .mec-hourly-schedule-speaker-contact-information,body.rtl .mec-hourly-schedule-speaker-description,body.rtl .mec-hourly-schedule-speaker-job-title,body.rtl .mec-hourly-schedule-speaker-name,body.rtl .mec-organizer-social-information{text-align:right}body.rtl .mec-box-calendar.mec-calendar.mec-event-calendar-classic .mec-calendar-table-head dt{font-size:10px!important}body.rtl .mec-wrap .mec-events-meta-group-booking .mec-booking-calendar .mec-calendar dl dt{text-align:center!important}body.rtl .mec-wrap .mec-single-event .mec-event-meta .mec-single-event-organizer dd a{direction:ltr}body.rtl .mec-single-event .mec-event-export-module.mec-frontbox .mec-event-exporting .mec-export-details ul{padding:0}.rtl .lity-content .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-dropdown span.mec-select-date-calendar-icon,.rtl .lity-content .mec-book-first .mec-select-date-dropdown-wrapper .mec-select-date-dropdown span.mec-select-date-calendar-icon,.rtl .mec-booking-shortcode .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-dropdown span.mec-select-date-calendar-icon,.rtl .mec-booking-shortcode .mec-book-first .mec-select-date-dropdown-wrapper .mec-select-date-dropdown span.mec-select-date-calendar-icon,.rtl .mec-single-event .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-dropdown span.mec-select-date-calendar-icon,.rtl .mec-single-event .mec-book-first .mec-select-date-dropdown-wrapper .mec-select-date-dropdown span.mec-select-date-calendar-icon{border-right:none;border-left:1px solid #e3e5e7}.rtl .mec-booking .mec-event-tickets-list .mec-ticket-style-row .mec-ticket-style-row-section-1{margin:5px 0 0 25px}.rtl .mec-booking .mec-event-tickets-list .mec-ticket-style-row .mec-ticket-style-row-section-3{margin-left:unset;margin-right:auto}.rtl .mec-booking .mec-event-tickets-list .mec-ticket-style-row input[type=number]{margin:0 auto 10px 0}.rtl .mec-booking .mec-event-tickets-list .mec-ticket-style-row .minus,.rtl .mec-booking .mec-event-tickets-list .mec-ticket-style-row .plus{right:unset;left:5px}.rtl .mec-events-meta-group-booking #mec-book-form-btn-step-1,.rtl .mec-events-meta-group-booking #mec-book-form-btn-step-2{float:left}.rtl .lity-content .button svg,.rtl .lity-content button:not(.owl-dot):not(.gm-control-active):not(.mejs):not(.owl-prev):not(.owl-next) svg,.rtl .lity-content input[type=button] svg,.rtl .lity-content input[type=reset] svg,.rtl .lity-content input[type=submit] svg,.rtl .mec-wrap .button svg,.rtl .mec-wrap button:not(.owl-dot):not(.gm-control-active):not(.mejs):not(.owl-prev):not(.owl-next):not(.et-fb-button) svg,.rtl .mec-wrap input[type=button] svg,.rtl .mec-wrap input[type=reset] svg,.rtl .mec-wrap input[type=submit] svg{margin-left:unset;margin-right:30px;transform:rotate(180deg)}.mec-booking-shortcode button#mec-book-form-btn-step-2{margin-left:unset;margin-right:30px}.rtl .lity-content .mec-events-meta-group-booking button[type=submit]:after,.rtl .mec-events-meta-group-booking .mec-booking-shortcode button[type=submit]:after,.rtl .mec-single-event .mec-events-meta-group-booking button[type=submit]:after,.rtl .mec-single-event a.button:after,.rtl .mec-wrap .mec-events-meta-group-booking button[type=submit]:after{margin-left:unset;margin-right:4px}.rtl .lity-content .mec-events-meta-group-booking button.mec-book-form-back-button#mec-book-form-back-btn-step-2,.rtl .lity-content .mec-events-meta-group-booking button.mec-book-form-back-button#mec-book-form-back-btn-step-3,.rtl .mec-events-meta-group-booking .mec-booking-shortcode button.mec-book-form-back-button#mec-book-form-back-btn-step-2,.rtl .mec-events-meta-group-booking .mec-booking-shortcode button.mec-book-form-back-button#mec-book-form-back-btn-step-3,.rtl .mec-wrap .mec-single-event .mec-events-meta-group-booking button.mec-book-form-back-button#mec-book-form-back-btn-step-2,.rtl .mec-wrap .mec-single-event .mec-events-meta-group-booking button.mec-book-form-back-button#mec-book-form-back-btn-step-3{float:right}.rtl .lity-content .mec-events-meta-group-booking button.mec-book-form-back-button#mec-book-form-back-btn-step-2 img.mec-svg-icon,.rtl .lity-content .mec-events-meta-group-booking button.mec-book-form-back-button#mec-book-form-back-btn-step-3 img.mec-svg-icon,.rtl .mec-events-meta-group-booking .mec-booking-shortcode button.mec-book-form-back-button#mec-book-form-back-btn-step-2 img.mec-svg-icon,.rtl .mec-events-meta-group-booking .mec-booking-shortcode button.mec-book-form-back-button#mec-book-form-back-btn-step-3 img.mec-svg-icon,.rtl .mec-wrap .mec-single-event .mec-events-meta-group-booking button.mec-book-form-back-button#mec-book-form-back-btn-step-2 img.mec-svg-icon,.rtl .mec-wrap .mec-single-event .mec-events-meta-group-booking button.mec-book-form-back-button#mec-book-form-back-btn-step-3 img.mec-svg-icon{margin-right:unset;margin-left:30px;transform:rotate(180deg)}.rtl .lity-content .mec-events-meta-group-booking .col-md-12 .mec-ticket-icon-wrapper,.rtl .mec-events-meta-group-booking .mec-booking-shortcode .col-md-12 .mec-ticket-icon-wrapper,.rtl .mec-single-event .mec-events-meta-group-booking .col-md-12 .mec-ticket-icon-wrapper{margin-right:unset;margin-left:25px}.rtl .lity-content .mec-events-meta-group-booking h5,.rtl .lity-content .mec-events-meta-group-booking label,.rtl .mec-events-meta-group-booking .mec-booking-shortcode h5,.rtl .mec-events-meta-group-booking .mec-booking-shortcode label,.rtl .mec-single-event .mec-events-meta-group-booking h5,.rtl .mec-single-event .mec-events-meta-group-booking label{padding:0 0 5px 1em;text-align:right}.rtl .lity-content .mec-events-meta-group-booking p{text-align:right}.rtl .lity-content .mec-events-meta-group-booking .mec-booking-email-field-wrapper span.mec-booking-email-field-icon,.rtl .lity-content .mec-events-meta-group-booking .mec-booking-name-field-wrapper span.mec-booking-name-field-icon,.rtl .lity-content .mec-events-meta-group-booking .mec-field-wrapper span.mec-field-icon,.rtl .lity-content .mec-events-meta-group-booking .mec-stripe-name-and-email-wrapper span.mec-booking-email-field-icon,.rtl .mec-events-meta-group-booking .mec-booking-shortcode ..mec-stripe-name-and-email-wrapper span.mec-field-icon,.rtl .mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-email-field-wrapper span.mec-booking-email-field-icon,.rtl .mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-name-field-wrapper span.mec-booking-name-field-icon,.rtl .mec-events-meta-group-booking .mec-booking-shortcode .mec-field-wrapper span.mec-field-icon,.rtl .mec-single-event .mec-events-meta-group-booking .mec-booking-email-field-wrapper span.mec-booking-email-field-icon,.rtl .mec-single-event .mec-events-meta-group-booking .mec-booking-name-field-wrapper span.mec-booking-name-field-icon,.rtl .mec-single-event .mec-events-meta-group-booking .mec-field-wrapper span.mec-field-icon,.rtl .mec-single-event .mec-events-meta-group-booking .mec-stripe-name-and-email-wrapper span.mec-booking-email-field-icon{border-radius:0 3px 3px 0}.rtl .lity-content .mec-events-meta-group-booking .mec-booking-email-field-wrapper input,.rtl .lity-content .mec-events-meta-group-booking .mec-booking-name-field-wrapper input,.rtl .lity-content .mec-events-meta-group-booking .mec-field-wrapper input,.rtl .lity-content .mec-events-meta-group-booking .mec-stripe-name-and-email-wrapper input,.rtl .mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-email-field-wrapper input,.rtl .mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-name-field-wrapper input,.rtl .mec-events-meta-group-booking .mec-booking-shortcode .mec-field-wrapper input,.rtl .mec-events-meta-group-booking .mec-booking-shortcode .mec-stripe-name-and-email-wrapper input,.rtl .mec-single-event .mec-events-meta-group-booking .mec-booking-email-field-wrapper input,.rtl .mec-single-event .mec-events-meta-group-booking .mec-booking-name-field-wrapper input,.rtl .mec-single-event .mec-events-meta-group-booking .mec-field-wrapper input,.rtl .mec-single-event .mec-events-meta-group-booking .mec-stripe-name-and-email-wrapper input{border-left:1px solid #e3e5e7;border-right:none;border-radius:3px 0 0 3px}.rtl .lity-content .mec-events-meta-group-booking input[type=checkbox],.rtl .mec-events-meta-group-booking .mec-booking-shortcode input[type=checkbox],.rtl .mec-single-event .mec-events-meta-group-booking input[type=checkbox]{float:right}.rtl .lity-container .mec-events-meta-group-booking .mec_book_first_for_all,.rtl .lity-content .mec-events-meta-group-booking .mec-booking-dates-checkboxes input[type=checkbox],.rtl .lity-content .mec-events-meta-group-booking .mec_book_first_for_all,.rtl .lity-content .mec-events-meta-group-booking input[type=checkbox],.rtl .mec-booking input[type=checkbox],.rtl .mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-dates-checkboxes input[type=checkbox],.rtl .mec-events-meta-group-booking .mec-booking-shortcode .mec_book_first_for_all,.rtl .mec-events-meta-group-booking .mec-booking-shortcode input[type=checkbox],.rtl .mec-single-event .mec-events-meta-group-booking .mec-booking-dates-checkboxes input[type=checkbox],.rtl .mec-single-event .mec-events-meta-group-booking .mec_book_first_for_all,.rtl .mec-single-event .mec-events-meta-group-booking input[type=checkbox]{margin:0 0 0 10px}.rtl .mec-book-reg-field-checkbox input[type=checkbox],.rtl .mec-book-reg-field-radio input[type=radio]{float:right;margin-right:unset!important;margin-left:10px!important;top:3px;right:3px}.rtl .mec-events-meta-group-booking ul.mec-book-price-details li{border-right:none;border-left:1px dashed #e6e7e8;margin-right:unset;margin-left:30px;padding-right:unset!important;padding-left:30px!important}.rtl .mec-events-meta-group-booking ul.mec-book-price-details li span.mec-book-price-detail-icon{margin:0 0 0 30px}.rtl .lity-content .mec-events-meta-group-booking .mec-book-form-coupon form button,.rtl .mec-events-meta-group-booking .mec-booking-shortcode .mec-book-form-coupon form button,.rtl .mec-single-event .mec-events-meta-group-booking .mec-book-form-coupon form button{left:6px;right:auto}.rtl .lity-content .mec-events-meta-group-booking ul,.rtl .mec-events-meta-group-booking .mec-booking-shortcode ul,.rtl .mec-single-event .mec-events-meta-group-booking ul{padding-left:unset;padding-right:0}.rtl .lity-content .mec-events-meta-group-booking .mec-book-form-coupon form span.mec-booking-coupon-field-wrapper .mec-booking-coupon-field-icon,.rtl .mec-events-meta-group-booking .mec-booking-shortcode .mec-book-form-coupon form span.mec-booking-coupon-field-wrapper .mec-booking-coupon-field-icon,.rtl .mec-single-event .mec-events-meta-group-booking .mec-book-form-coupon form span.mec-booking-coupon-field-wrapper .mec-booking-coupon-field-icon{border-right:none;border-left:1px solid #e3e5e7}.rtl .lity-content .mec-events-meta-group-booking .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul li:first-child,.rtl .mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul li:first-child,.rtl .mec-single-event .mec-events-meta-group-booking .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul li:first-child{padding-right:unset;margin-right:unset;border-right:unset;padding-left:30px;margin-left:30px;border-left:1px dashed #e6e7e8}.rtl .lity-content .mec-events-meta-group-booking .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul li,.rtl .mec-events-meta-group-booking .mec-booking-shortcode .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul li,.rtl .mec-single-event .mec-events-meta-group-booking .mec-booking-checkout-coupon-total-wrapper .mec-booking-checkout-total-wrapper ul li{text-align:left}.rtl .lity-content .mec-events-meta-group-booking .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option:nth-child(odd),.rtl .mec-events-meta-group-booking .mec-booking-shortcode .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option:nth-child(odd),.rtl .mec-wrap .mec-events-meta-group-booking .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option:nth-child(odd){margin-right:unset;margin-left:20px}.rtl .lity-content .mec-events-meta-group-booking .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option .mec-book-form-gateway-option-radio,.rtl .mec-events-meta-group-booking .mec-booking-shortcode .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option .mec-book-form-gateway-option-radio,.rtl .mec-wrap .mec-events-meta-group-booking .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option .mec-book-form-gateway-option-radio{margin-left:unset;margin-right:auto}.rtl .lity-content .mec-events-meta-group-booking .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option .mec-book-form-gateway-option-svg,.rtl .mec-events-meta-group-booking .mec-booking-shortcode .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option .mec-book-form-gateway-option-svg,.rtl .mec-wrap .mec-events-meta-group-booking .mec-wrap-checkout.row .mec-book-form-gateways .mec-book-form-gateways-radio-buttons .mec-book-form-gateway-option .mec-book-form-gateway-option-svg{margin-right:unset;margin-left:10px}.rtl .lity-content .mec-events-meta-group-booking .mec-click-pay #mec_woo_add_to_cart_btn_r,.rtl .lity-content .mec-events-meta-group-booking .mec-click-pay button.mec-book-form-next-button,.rtl .mec-events-meta-group-booking .mec-booking-shortcode .mec-click-pay #mec_woo_add_to_cart_btn_r,.rtl .mec-events-meta-group-booking .mec-booking-shortcode .mec-click-pay button.mec-book-form-next-button,.rtl .mec-single-event .mec-events-meta-group-booking .mec-click-pay #mec_woo_add_to_cart_btn_r,.rtl .mec-single-event .mec-events-meta-group-booking .mec-click-pay button.mec-book-form-next-button{float:left}.rtl .mec-book-form-gateway-checkout [id*=mec_do_transaction_stripe_] .mec-form-row.mec-stripe-name-and-email-wrapper .mec-form-row:nth-child(2){margin-left:unset;margin-right:12px}.rtl .lity-content .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-dropdown span.mec-select-date-calendar-icons,.rtl .mec-booking-shortcode .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-dropdown span.mec-select-date-calendar-icons,.rtl .mec-single-event .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-dropdown span.mec-select-date-calendar-icons{right:unset;left:10px}.rtl .lity-content .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-container,.rtl .mec-booking-shortcode .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-container,.rtl .mec-single-event .mec-book-first .mec-booking-calendar-wrapper .mec-select-date-calendar-container{right:unset;left:40px}.rtl .mec-booking-calendar-month-navigation .mec-previous-month{left:unset;right:0}.rtl .mec-booking-calendar-month-navigation .mec-next-month{right:unset;left:0}.rtl .mec-select-date-calendar-container .mec-calendar.mec-event-calendar-classic dl dt{text-align:center}.rtl .mec-booking-calendar-month-navigation .mec-previous-month a i:before{content:"\e606"}.rtl .mec-booking-calendar-month-navigation .mec-next-month a i:before{content:"\e605"}.mec-col-1,.mec-col-10,.mec-col-11,.mec-col-12,.mec-col-2,.mec-col-3,.mec-col-4,.mec-col-5,.mec-col-6,.mec-col-7,.mec-col-8,.mec-col-9{float:right;margin:0 0 0 1%} \ No newline at end of file diff --git a/assets/css/nice-select.min.css b/assets/css/nice-select.min.css new file mode 100755 index 0000000..af48bd8 --- /dev/null +++ b/assets/css/nice-select.min.css @@ -0,0 +1 @@ +.nice-select{-webkit-tap-highlight-color:transparent;background-color:#fff;border-radius:5px;border:solid 1px #e8e8e8;box-sizing:border-box;clear:both;cursor:pointer;display:block;float:left;font-family:inherit;font-size:14px;font-weight:400;height:42px;line-height:40px;outline:0;padding-left:18px;padding-right:30px;position:relative;text-align:left!important;-webkit-transition:all .2s ease-in-out;transition:all .2s ease-in-out;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;white-space:nowrap;width:auto}.nice-select:hover{border-color:#dbdbdb}.nice-select.open,.nice-select:active,.nice-select:focus{border-color:#999}.nice-select:after{border-bottom:2px solid #999;border-right:2px solid #999;content:'';display:block;height:5px;margin-top:-4px;pointer-events:none;position:absolute;right:12px;top:50%;-webkit-transform-origin:66% 66%;-ms-transform-origin:66% 66%;transform-origin:66% 66%;-webkit-transform:rotate(45deg);-ms-transform:rotate(45deg);transform:rotate(45deg);-webkit-transition:all .15s ease-in-out;transition:all .15s ease-in-out;width:5px}.nice-select.open:after{-webkit-transform:rotate(-135deg);-ms-transform:rotate(-135deg);transform:rotate(-135deg)}.nice-select.open .list{opacity:1;pointer-events:auto;-webkit-transform:scale(1) translateY(0);-ms-transform:scale(1) translateY(0);transform:scale(1) translateY(0)}.nice-select.disabled{border-color:#ededed;color:#999;pointer-events:none}.nice-select.disabled:after{border-color:#ccc}.nice-select.wide{width:100%}.nice-select.wide .list{left:0!important;right:0!important}.nice-select.right{float:right}.nice-select.right .list{left:auto;right:0}.nice-select.small{font-size:12px;height:36px;line-height:34px}.nice-select.small:after{height:4px;width:4px}.nice-select.small .option{line-height:34px;min-height:34px}.nice-select .list{background-color:#fff;border-radius:5px;box-shadow:0 0 0 1px rgba(68,68,68,.11);box-sizing:border-box;margin-top:4px;opacity:0;overflow:hidden;padding:0;pointer-events:none;position:absolute;top:100%;left:0;-webkit-transform-origin:50% 0;-ms-transform-origin:50% 0;transform-origin:50% 0;-webkit-transform:scale(.75) translateY(-21px);-ms-transform:scale(.75) translateY(-21px);transform:scale(.75) translateY(-21px);-webkit-transition:all .2s cubic-bezier(.5,0,0,1.25),opacity .15s ease-out;transition:all .2s cubic-bezier(.5,0,0,1.25),opacity .15s ease-out;z-index:9}.nice-select .list:hover .option:not(:hover){background-color:transparent!important}.nice-select .option{cursor:pointer;font-weight:400;line-height:40px;list-style:none;min-height:40px;outline:0;padding-left:18px;padding-right:29px;text-align:left;-webkit-transition:all .2s;transition:all .2s}.nice-select .option.focus,.nice-select .option.selected.focus,.nice-select .option:hover{background-color:#f6f6f6}.nice-select .option.selected{font-weight:700}.nice-select .option.disabled{background-color:transparent;color:#999;cursor:default}.no-csspointerevents .nice-select .list{display:none}.no-csspointerevents .nice-select.open .list{display:block} \ No newline at end of file diff --git a/assets/css/rtlbackend.css b/assets/css/rtlbackend.css new file mode 100755 index 0000000..5faffa5 --- /dev/null +++ b/assets/css/rtlbackend.css @@ -0,0 +1,123 @@ +/** +* Plugin Name: Modern Events Calendar +* Plugin URI: http://webnus.net/modern-events-calendar/ +* Description: An awesome plugin for events calendar +* Author: Webnus Team +* Author URI: http://webnus.net +**/ + + /* Base + ====================================================*/ + .mec-col-1, .mec-col-2, .mec-col-3, .mec-col-4, .mec-col-5, .mec-col-6, .mec-col-7, .mec-col-8, .mec-col-9, .mec-col-10, .mec-col-11, .mec-col-12 { float: right; margin: 0 0 0 1%;} + + + /* margin-left 0 + ====================================================*/ + + + + /* custom-margin-left 0 + ====================================================*/ + + + + /* margin-right 0 + ====================================================*/ + + + + /* custom-margin-right 0 + ====================================================*/ + + + + /* padding-left 0 + ====================================================*/ + + + + /* custom-padding-left 0 + ====================================================*/ + + + + /* padding-right 0 + ====================================================*/ + + + + /* custom-padding-right 0 + ====================================================*/ + + + /* border-left 0 + ====================================================*/ + + + /* custom-border-left + ====================================================*/ + + + + /* border-right 0 + ====================================================*/ + + + + /* custom-border-right + ====================================================*/ + + + + /* custom-border-right + ====================================================*/ + + + + /* left 0 + ====================================================*/ + + + + /* left auto + ====================================================*/ + + + + /* custom left + ====================================================*/ + + + + /* right 0 + ====================================================*/ + + + + /* right auto + ====================================================*/ + + + + /* custom right + ====================================================*/ + + + + /* float left + ====================================================*/ + + + + /* float right + ====================================================*/ + + + + /* Text align right + ====================================================*/ + + + + /* Text align left + ====================================================*/ \ No newline at end of file diff --git a/assets/files/sample.csv b/assets/files/sample.csv new file mode 100755 index 0000000..ff10ed1 --- /dev/null +++ b/assets/files/sample.csv @@ -0,0 +1,2 @@ +ID Event "Start Date & Time" "End Date & Time" Location "Order Time" Ticket "Transaction ID" "Total Price" Gateway Name Email "Ticket Variation" Confirmation Verification +11 "Sample Event" "November 11, 2028 8:00 am" "November 11, 2028 6:00 pm" "September 28, 2022 8:17 pm" Standard MEC10000 $100.00 "Pay Locally" "John Smith" john.smith@yahoo.com Confirmed Verified \ No newline at end of file diff --git a/assets/fonts/FontAwesome.otf b/assets/fonts/FontAwesome.otf new file mode 100755 index 0000000..59853bc Binary files /dev/null and b/assets/fonts/FontAwesome.otf differ diff --git a/assets/fonts/Simple-Line-Icons.eot b/assets/fonts/Simple-Line-Icons.eot new file mode 100755 index 0000000..f0ca6e8 Binary files /dev/null and b/assets/fonts/Simple-Line-Icons.eot differ diff --git a/assets/fonts/Simple-Line-Icons.svg b/assets/fonts/Simple-Line-Icons.svg new file mode 100755 index 0000000..45217ee --- /dev/null +++ b/assets/fonts/Simple-Line-Icons.svg @@ -0,0 +1,200 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/fonts/Simple-Line-Icons.ttf b/assets/fonts/Simple-Line-Icons.ttf new file mode 100755 index 0000000..6ecb686 Binary files /dev/null and b/assets/fonts/Simple-Line-Icons.ttf differ diff --git a/assets/fonts/Simple-Line-Icons.woff b/assets/fonts/Simple-Line-Icons.woff new file mode 100755 index 0000000..b17d694 Binary files /dev/null and b/assets/fonts/Simple-Line-Icons.woff differ diff --git a/assets/fonts/Simple-Line-Icons.woff2 b/assets/fonts/Simple-Line-Icons.woff2 new file mode 100755 index 0000000..c49fccf Binary files /dev/null and b/assets/fonts/Simple-Line-Icons.woff2 differ diff --git a/assets/fonts/fontawesome-webfont.eot b/assets/fonts/fontawesome-webfont.eot new file mode 100755 index 0000000..96f92f9 Binary files /dev/null and b/assets/fonts/fontawesome-webfont.eot differ diff --git a/assets/fonts/fontawesome-webfont.svg b/assets/fonts/fontawesome-webfont.svg new file mode 100755 index 0000000..d10ec0b --- /dev/null +++ b/assets/fonts/fontawesome-webfont.svg @@ -0,0 +1,685 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/assets/fonts/fontawesome-webfont.ttf b/assets/fonts/fontawesome-webfont.ttf new file mode 100755 index 0000000..86784df Binary files /dev/null and b/assets/fonts/fontawesome-webfont.ttf differ diff --git a/assets/fonts/fontawesome-webfont.woff b/assets/fonts/fontawesome-webfont.woff new file mode 100755 index 0000000..c7faa19 Binary files /dev/null and b/assets/fonts/fontawesome-webfont.woff differ diff --git a/assets/fonts/fontawesome-webfont.woff2 b/assets/fonts/fontawesome-webfont.woff2 new file mode 100755 index 0000000..cab8571 Binary files /dev/null and b/assets/fonts/fontawesome-webfont.woff2 differ diff --git a/assets/fonts/index.html b/assets/fonts/index.html new file mode 100755 index 0000000..e69de29 diff --git a/assets/icon.html b/assets/icon.html new file mode 100755 index 0000000..37abb76 --- /dev/null +++ b/assets/icon.html @@ -0,0 +1,837 @@ +
    + +
    +
      +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    • +
    +
    +
    \ No newline at end of file diff --git a/assets/img/ajax-loader.gif b/assets/img/ajax-loader.gif new file mode 100755 index 0000000..03f629a Binary files /dev/null and b/assets/img/ajax-loader.gif differ diff --git a/assets/img/cluster1/index.html b/assets/img/cluster1/index.html new file mode 100755 index 0000000..e69de29 diff --git a/assets/img/cluster1/m1.png b/assets/img/cluster1/m1.png new file mode 100755 index 0000000..329ff52 Binary files /dev/null and b/assets/img/cluster1/m1.png differ diff --git a/assets/img/cluster1/m2.png b/assets/img/cluster1/m2.png new file mode 100755 index 0000000..b999cbc Binary files /dev/null and b/assets/img/cluster1/m2.png differ diff --git a/assets/img/cluster1/m3.png b/assets/img/cluster1/m3.png new file mode 100755 index 0000000..9f30b30 Binary files /dev/null and b/assets/img/cluster1/m3.png differ diff --git a/assets/img/cluster1/m4.png b/assets/img/cluster1/m4.png new file mode 100755 index 0000000..0d3f826 Binary files /dev/null and b/assets/img/cluster1/m4.png differ diff --git a/assets/img/cluster1/m5.png b/assets/img/cluster1/m5.png new file mode 100755 index 0000000..61387d2 Binary files /dev/null and b/assets/img/cluster1/m5.png differ diff --git a/assets/img/document.png b/assets/img/document.png new file mode 100755 index 0000000..b20c382 Binary files /dev/null and b/assets/img/document.png differ diff --git a/assets/img/dp-dsb-support.jpg b/assets/img/dp-dsb-support.jpg new file mode 100755 index 0000000..fa1a1bb Binary files /dev/null and b/assets/img/dp-dsb-support.jpg differ diff --git a/assets/img/dp-dsb-support2.png b/assets/img/dp-dsb-support2.png new file mode 100755 index 0000000..9595749 Binary files /dev/null and b/assets/img/dp-dsb-support2.png differ diff --git a/assets/img/email-document.png b/assets/img/email-document.png new file mode 100755 index 0000000..1c65afd Binary files /dev/null and b/assets/img/email-document.png differ diff --git a/assets/img/ico-mec-vc.png b/assets/img/ico-mec-vc.png new file mode 100755 index 0000000..25ad911 Binary files /dev/null and b/assets/img/ico-mec-vc.png differ diff --git a/assets/img/index.html b/assets/img/index.html new file mode 100755 index 0000000..e69de29 diff --git a/assets/img/m-01.png b/assets/img/m-01.png new file mode 100755 index 0000000..29e7060 Binary files /dev/null and b/assets/img/m-01.png differ diff --git a/assets/img/m-02.png b/assets/img/m-02.png new file mode 100755 index 0000000..a40dd32 Binary files /dev/null and b/assets/img/m-02.png differ diff --git a/assets/img/m-03.png b/assets/img/m-03.png new file mode 100755 index 0000000..69a5e5a Binary files /dev/null and b/assets/img/m-03.png differ diff --git a/assets/img/m-04.png b/assets/img/m-04.png new file mode 100755 index 0000000..86eb5a6 Binary files /dev/null and b/assets/img/m-04.png differ diff --git a/assets/img/m-05.png b/assets/img/m-05.png new file mode 100755 index 0000000..f8e78e8 Binary files /dev/null and b/assets/img/m-05.png differ diff --git a/assets/img/map.jpg b/assets/img/map.jpg new file mode 100755 index 0000000..7e34784 Binary files /dev/null and b/assets/img/map.jpg differ diff --git a/assets/img/mec-addons-teaser1.png b/assets/img/mec-addons-teaser1.png new file mode 100755 index 0000000..f9b7b07 Binary files /dev/null and b/assets/img/mec-addons-teaser1.png differ diff --git a/assets/img/mec-booking.svg b/assets/img/mec-booking.svg new file mode 100755 index 0000000..1bfd9dc --- /dev/null +++ b/assets/img/mec-booking.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/assets/img/mec-lite-backend-go-pro.png b/assets/img/mec-lite-backend-go-pro.png new file mode 100755 index 0000000..db13c1f Binary files /dev/null and b/assets/img/mec-lite-backend-go-pro.png differ diff --git a/assets/img/mec-logo-icon.png b/assets/img/mec-logo-icon.png new file mode 100755 index 0000000..b0a462d Binary files /dev/null and b/assets/img/mec-logo-icon.png differ diff --git a/assets/img/mec-logo-icon.svg b/assets/img/mec-logo-icon.svg new file mode 100755 index 0000000..14914a2 --- /dev/null +++ b/assets/img/mec-logo-icon.svg @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/img/mec-logo-w.png b/assets/img/mec-logo-w.png new file mode 100755 index 0000000..b8667f5 Binary files /dev/null and b/assets/img/mec-logo-w.png differ diff --git a/assets/img/mec-logo-w2.png b/assets/img/mec-logo-w2.png new file mode 100755 index 0000000..b1f0c5f Binary files /dev/null and b/assets/img/mec-logo-w2.png differ diff --git a/assets/img/mec-weather-icon-01.png b/assets/img/mec-weather-icon-01.png new file mode 100755 index 0000000..57ba23c Binary files /dev/null and b/assets/img/mec-weather-icon-01.png differ diff --git a/assets/img/mec-weather-icon-02.png b/assets/img/mec-weather-icon-02.png new file mode 100755 index 0000000..d086e03 Binary files /dev/null and b/assets/img/mec-weather-icon-02.png differ diff --git a/assets/img/mec-weather-icon-03.png b/assets/img/mec-weather-icon-03.png new file mode 100755 index 0000000..b849f61 Binary files /dev/null and b/assets/img/mec-weather-icon-03.png differ diff --git a/assets/img/mec-weather-icon-04.png b/assets/img/mec-weather-icon-04.png new file mode 100755 index 0000000..952fa70 Binary files /dev/null and b/assets/img/mec-weather-icon-04.png differ diff --git a/assets/img/mec-weather-icon-05.png b/assets/img/mec-weather-icon-05.png new file mode 100755 index 0000000..6c46c0e Binary files /dev/null and b/assets/img/mec-weather-icon-05.png differ diff --git a/assets/img/mec-weather-icon-06.png b/assets/img/mec-weather-icon-06.png new file mode 100755 index 0000000..169897e Binary files /dev/null and b/assets/img/mec-weather-icon-06.png differ diff --git a/assets/img/mec-weather-icon-07.png b/assets/img/mec-weather-icon-07.png new file mode 100755 index 0000000..6e94f29 Binary files /dev/null and b/assets/img/mec-weather-icon-07.png differ diff --git a/assets/img/mec.svg b/assets/img/mec.svg new file mode 100755 index 0000000..bc535f2 --- /dev/null +++ b/assets/img/mec.svg @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/assets/img/newsletter-document.png b/assets/img/newsletter-document.png new file mode 100755 index 0000000..e725085 Binary files /dev/null and b/assets/img/newsletter-document.png differ diff --git a/assets/img/no-image.png b/assets/img/no-image.png new file mode 100755 index 0000000..e440e61 Binary files /dev/null and b/assets/img/no-image.png differ diff --git a/assets/img/popup/add-event-first-step.png b/assets/img/popup/add-event-first-step.png new file mode 100755 index 0000000..766baaf Binary files /dev/null and b/assets/img/popup/add-event-first-step.png differ diff --git a/assets/img/popup/add-organizer.png b/assets/img/popup/add-organizer.png new file mode 100755 index 0000000..0e29921 Binary files /dev/null and b/assets/img/popup/add-organizer.png differ diff --git a/assets/img/popup/add-sh-icon.png b/assets/img/popup/add-sh-icon.png new file mode 100755 index 0000000..1f7fb1b Binary files /dev/null and b/assets/img/popup/add-sh-icon.png differ diff --git a/assets/img/popup/calendar_icon.png b/assets/img/popup/calendar_icon.png new file mode 100755 index 0000000..ffbb024 Binary files /dev/null and b/assets/img/popup/calendar_icon.png differ diff --git a/assets/img/popup/char.png b/assets/img/popup/char.png new file mode 100755 index 0000000..829ab83 Binary files /dev/null and b/assets/img/popup/char.png differ diff --git a/assets/img/popup/eye.png b/assets/img/popup/eye.png new file mode 100755 index 0000000..7615205 Binary files /dev/null and b/assets/img/popup/eye.png differ diff --git a/assets/img/popup/fifth-step.png b/assets/img/popup/fifth-step.png new file mode 100755 index 0000000..7e8fc65 Binary files /dev/null and b/assets/img/popup/fifth-step.png differ diff --git a/assets/img/popup/first-step.png b/assets/img/popup/first-step.png new file mode 100755 index 0000000..9402f1d Binary files /dev/null and b/assets/img/popup/first-step.png differ diff --git a/assets/img/popup/fourth-step.png b/assets/img/popup/fourth-step.png new file mode 100755 index 0000000..86c8189 Binary files /dev/null and b/assets/img/popup/fourth-step.png differ diff --git a/assets/img/popup/index.html b/assets/img/popup/index.html new file mode 100755 index 0000000..e69de29 diff --git a/assets/img/popup/mec-logo.svg b/assets/img/popup/mec-logo.svg new file mode 100755 index 0000000..239ae94 --- /dev/null +++ b/assets/img/popup/mec-logo.svg @@ -0,0 +1,15 @@ + diff --git a/assets/img/popup/organization.png b/assets/img/popup/organization.png new file mode 100755 index 0000000..990c466 Binary files /dev/null and b/assets/img/popup/organization.png differ diff --git a/assets/img/popup/picture.png b/assets/img/popup/picture.png new file mode 100755 index 0000000..c801b3d Binary files /dev/null and b/assets/img/popup/picture.png differ diff --git a/assets/img/popup/plus-blue.png b/assets/img/popup/plus-blue.png new file mode 100755 index 0000000..bb48354 Binary files /dev/null and b/assets/img/popup/plus-blue.png differ diff --git a/assets/img/popup/plus.png b/assets/img/popup/plus.png new file mode 100755 index 0000000..f46925f Binary files /dev/null and b/assets/img/popup/plus.png differ diff --git a/assets/img/popup/pointer.png b/assets/img/popup/pointer.png new file mode 100755 index 0000000..9df8f6b Binary files /dev/null and b/assets/img/popup/pointer.png differ diff --git a/assets/img/popup/popup-new-shortcode-plus.svg b/assets/img/popup/popup-new-shortcode-plus.svg new file mode 100755 index 0000000..35e044b --- /dev/null +++ b/assets/img/popup/popup-new-shortcode-plus.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/img/popup/popup-next-icon.svg b/assets/img/popup/popup-next-icon.svg new file mode 100755 index 0000000..57433bc --- /dev/null +++ b/assets/img/popup/popup-next-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/img/popup/popup-prev-icon.svg b/assets/img/popup/popup-prev-icon.svg new file mode 100755 index 0000000..15457b2 --- /dev/null +++ b/assets/img/popup/popup-prev-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/img/popup/save.svg b/assets/img/popup/save.svg new file mode 100755 index 0000000..f4ffac4 --- /dev/null +++ b/assets/img/popup/save.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/img/popup/sixth-step.png b/assets/img/popup/sixth-step.png new file mode 100755 index 0000000..c1f6f0f Binary files /dev/null and b/assets/img/popup/sixth-step.png differ diff --git a/assets/img/skins/agenda.svg b/assets/img/skins/agenda.svg new file mode 100755 index 0000000..19fff57 --- /dev/null +++ b/assets/img/skins/agenda.svg @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/img/skins/agenda/agenda-clean.png b/assets/img/skins/agenda/agenda-clean.png new file mode 100755 index 0000000..58bc035 Binary files /dev/null and b/assets/img/skins/agenda/agenda-clean.png differ diff --git a/assets/img/skins/agenda/index.html b/assets/img/skins/agenda/index.html new file mode 100755 index 0000000..e69de29 diff --git a/assets/img/skins/available-spot/available-spot-classic.png b/assets/img/skins/available-spot/available-spot-classic.png new file mode 100755 index 0000000..1b30f7b Binary files /dev/null and b/assets/img/skins/available-spot/available-spot-classic.png differ diff --git a/assets/img/skins/available_spot.svg b/assets/img/skins/available_spot.svg new file mode 100755 index 0000000..dc5bb53 --- /dev/null +++ b/assets/img/skins/available_spot.svg @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/img/skins/carousel.svg b/assets/img/skins/carousel.svg new file mode 100755 index 0000000..bc14656 --- /dev/null +++ b/assets/img/skins/carousel.svg @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/img/skins/carousel/carousel-type-1.png b/assets/img/skins/carousel/carousel-type-1.png new file mode 100755 index 0000000..342aaa2 Binary files /dev/null and b/assets/img/skins/carousel/carousel-type-1.png differ diff --git a/assets/img/skins/carousel/carousel-type-2.png b/assets/img/skins/carousel/carousel-type-2.png new file mode 100755 index 0000000..e2e3dbb Binary files /dev/null and b/assets/img/skins/carousel/carousel-type-2.png differ diff --git a/assets/img/skins/carousel/carousel-type-3.png b/assets/img/skins/carousel/carousel-type-3.png new file mode 100755 index 0000000..a6af8b5 Binary files /dev/null and b/assets/img/skins/carousel/carousel-type-3.png differ diff --git a/assets/img/skins/carousel/carousel-type-4.png b/assets/img/skins/carousel/carousel-type-4.png new file mode 100755 index 0000000..ed98992 Binary files /dev/null and b/assets/img/skins/carousel/carousel-type-4.png differ diff --git a/assets/img/skins/carousel/index.html b/assets/img/skins/carousel/index.html new file mode 100755 index 0000000..e69de29 diff --git a/assets/img/skins/countdown.svg b/assets/img/skins/countdown.svg new file mode 100755 index 0000000..25cb603 --- /dev/null +++ b/assets/img/skins/countdown.svg @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + 02 + H + + + + 15 + M + + + + 32 + S + + + + + diff --git a/assets/img/skins/countdown/countdown-type-1.png b/assets/img/skins/countdown/countdown-type-1.png new file mode 100755 index 0000000..822f8f8 Binary files /dev/null and b/assets/img/skins/countdown/countdown-type-1.png differ diff --git a/assets/img/skins/countdown/countdown-type-2.png b/assets/img/skins/countdown/countdown-type-2.png new file mode 100755 index 0000000..0195a1b Binary files /dev/null and b/assets/img/skins/countdown/countdown-type-2.png differ diff --git a/assets/img/skins/countdown/countdown-type-3.png b/assets/img/skins/countdown/countdown-type-3.png new file mode 100755 index 0000000..1e21c31 Binary files /dev/null and b/assets/img/skins/countdown/countdown-type-3.png differ diff --git a/assets/img/skins/countdown/index.html b/assets/img/skins/countdown/index.html new file mode 100755 index 0000000..e69de29 diff --git a/assets/img/skins/cover.svg b/assets/img/skins/cover.svg new file mode 100755 index 0000000..5979e5d --- /dev/null +++ b/assets/img/skins/cover.svg @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/img/skins/cover/cover-classic.png b/assets/img/skins/cover/cover-classic.png new file mode 100755 index 0000000..50cc07f Binary files /dev/null and b/assets/img/skins/cover/cover-classic.png differ diff --git a/assets/img/skins/cover/cover-clean.png b/assets/img/skins/cover/cover-clean.png new file mode 100755 index 0000000..641a8cb Binary files /dev/null and b/assets/img/skins/cover/cover-clean.png differ diff --git a/assets/img/skins/cover/cover-modern.png b/assets/img/skins/cover/cover-modern.png new file mode 100755 index 0000000..5b18841 Binary files /dev/null and b/assets/img/skins/cover/cover-modern.png differ diff --git a/assets/img/skins/cover/index.html b/assets/img/skins/cover/index.html new file mode 100755 index 0000000..e69de29 diff --git a/assets/img/skins/custom.svg b/assets/img/skins/custom.svg new file mode 100755 index 0000000..cece276 --- /dev/null +++ b/assets/img/skins/custom.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/img/skins/daily.svg b/assets/img/skins/daily.svg new file mode 100755 index 0000000..b1e8a49 --- /dev/null +++ b/assets/img/skins/daily.svg @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 21 + + + diff --git a/assets/img/skins/daily/daily-classic.png b/assets/img/skins/daily/daily-classic.png new file mode 100755 index 0000000..74b0df1 Binary files /dev/null and b/assets/img/skins/daily/daily-classic.png differ diff --git a/assets/img/skins/fluent/fluent-agenda-view.png b/assets/img/skins/fluent/fluent-agenda-view.png new file mode 100755 index 0000000..9b7d8c9 Binary files /dev/null and b/assets/img/skins/fluent/fluent-agenda-view.png differ diff --git a/assets/img/skins/fluent/fluent-available-spot-view-type1.png b/assets/img/skins/fluent/fluent-available-spot-view-type1.png new file mode 100755 index 0000000..84d0a2e Binary files /dev/null and b/assets/img/skins/fluent/fluent-available-spot-view-type1.png differ diff --git a/assets/img/skins/fluent/fluent-available-spot-view-type2.png b/assets/img/skins/fluent/fluent-available-spot-view-type2.png new file mode 100755 index 0000000..d6025ea Binary files /dev/null and b/assets/img/skins/fluent/fluent-available-spot-view-type2.png differ diff --git a/assets/img/skins/fluent/fluent-carousel-view.png b/assets/img/skins/fluent/fluent-carousel-view.png new file mode 100755 index 0000000..b70b69a Binary files /dev/null and b/assets/img/skins/fluent/fluent-carousel-view.png differ diff --git a/assets/img/skins/fluent/fluent-countdown-view.png b/assets/img/skins/fluent/fluent-countdown-view.png new file mode 100755 index 0000000..c55c014 Binary files /dev/null and b/assets/img/skins/fluent/fluent-countdown-view.png differ diff --git a/assets/img/skins/fluent/fluent-cover-view-type1.png b/assets/img/skins/fluent/fluent-cover-view-type1.png new file mode 100755 index 0000000..49b28d8 Binary files /dev/null and b/assets/img/skins/fluent/fluent-cover-view-type1.png differ diff --git a/assets/img/skins/fluent/fluent-cover-view-type2.png b/assets/img/skins/fluent/fluent-cover-view-type2.png new file mode 100755 index 0000000..6539144 Binary files /dev/null and b/assets/img/skins/fluent/fluent-cover-view-type2.png differ diff --git a/assets/img/skins/fluent/fluent-cover-view-type3.png b/assets/img/skins/fluent/fluent-cover-view-type3.png new file mode 100755 index 0000000..ecc916e Binary files /dev/null and b/assets/img/skins/fluent/fluent-cover-view-type3.png differ diff --git a/assets/img/skins/fluent/fluent-cover-view-type4.png b/assets/img/skins/fluent/fluent-cover-view-type4.png new file mode 100755 index 0000000..4da062f Binary files /dev/null and b/assets/img/skins/fluent/fluent-cover-view-type4.png differ diff --git a/assets/img/skins/fluent/fluent-daily-view.png b/assets/img/skins/fluent/fluent-daily-view.png new file mode 100755 index 0000000..0823225 Binary files /dev/null and b/assets/img/skins/fluent/fluent-daily-view.png differ diff --git a/assets/img/skins/fluent/fluent-full-calendar-view.png b/assets/img/skins/fluent/fluent-full-calendar-view.png new file mode 100755 index 0000000..c5ae7f1 Binary files /dev/null and b/assets/img/skins/fluent/fluent-full-calendar-view.png differ diff --git a/assets/img/skins/fluent/fluent-grid-view.png b/assets/img/skins/fluent/fluent-grid-view.png new file mode 100755 index 0000000..26125bd Binary files /dev/null and b/assets/img/skins/fluent/fluent-grid-view.png differ diff --git a/assets/img/skins/fluent/fluent-list-view.png b/assets/img/skins/fluent/fluent-list-view.png new file mode 100755 index 0000000..8b27224 Binary files /dev/null and b/assets/img/skins/fluent/fluent-list-view.png differ diff --git a/assets/img/skins/fluent/fluent-masonry-view.png b/assets/img/skins/fluent/fluent-masonry-view.png new file mode 100755 index 0000000..579a9d7 Binary files /dev/null and b/assets/img/skins/fluent/fluent-masonry-view.png differ diff --git a/assets/img/skins/fluent/fluent-monthly-view.png b/assets/img/skins/fluent/fluent-monthly-view.png new file mode 100755 index 0000000..c5ae7f1 Binary files /dev/null and b/assets/img/skins/fluent/fluent-monthly-view.png differ diff --git a/assets/img/skins/fluent/fluent-slider-view.png b/assets/img/skins/fluent/fluent-slider-view.png new file mode 100755 index 0000000..ba61696 Binary files /dev/null and b/assets/img/skins/fluent/fluent-slider-view.png differ diff --git a/assets/img/skins/fluent/fluent-tile-view.png b/assets/img/skins/fluent/fluent-tile-view.png new file mode 100755 index 0000000..8b0f75f Binary files /dev/null and b/assets/img/skins/fluent/fluent-tile-view.png differ diff --git a/assets/img/skins/fluent/fluent-time-table-view.png b/assets/img/skins/fluent/fluent-time-table-view.png new file mode 100755 index 0000000..c6d4241 Binary files /dev/null and b/assets/img/skins/fluent/fluent-time-table-view.png differ diff --git a/assets/img/skins/fluent/fluent-weekly-view.png b/assets/img/skins/fluent/fluent-weekly-view.png new file mode 100755 index 0000000..0f32018 Binary files /dev/null and b/assets/img/skins/fluent/fluent-weekly-view.png differ diff --git a/assets/img/skins/fluent/fluent-yearly-view.png b/assets/img/skins/fluent/fluent-yearly-view.png new file mode 100755 index 0000000..6afb860 Binary files /dev/null and b/assets/img/skins/fluent/fluent-yearly-view.png differ diff --git a/assets/img/skins/full-calendar/full-calendar-daily.png b/assets/img/skins/full-calendar/full-calendar-daily.png new file mode 100755 index 0000000..e108635 Binary files /dev/null and b/assets/img/skins/full-calendar/full-calendar-daily.png differ diff --git a/assets/img/skins/full-calendar/full-calendar-list.png b/assets/img/skins/full-calendar/full-calendar-list.png new file mode 100755 index 0000000..8eaccc4 Binary files /dev/null and b/assets/img/skins/full-calendar/full-calendar-list.png differ diff --git a/assets/img/skins/full-calendar/full-calendar-monthly.png b/assets/img/skins/full-calendar/full-calendar-monthly.png new file mode 100755 index 0000000..0d47354 Binary files /dev/null and b/assets/img/skins/full-calendar/full-calendar-monthly.png differ diff --git a/assets/img/skins/full-calendar/full-calendar-weekly.png b/assets/img/skins/full-calendar/full-calendar-weekly.png new file mode 100755 index 0000000..3fa348a Binary files /dev/null and b/assets/img/skins/full-calendar/full-calendar-weekly.png differ diff --git a/assets/img/skins/full-calendar/full-calendar-yearly.png b/assets/img/skins/full-calendar/full-calendar-yearly.png new file mode 100755 index 0000000..ec1345b Binary files /dev/null and b/assets/img/skins/full-calendar/full-calendar-yearly.png differ diff --git a/assets/img/skins/full-calendar/index.html b/assets/img/skins/full-calendar/index.html new file mode 100755 index 0000000..e69de29 diff --git a/assets/img/skins/full_calendar.svg b/assets/img/skins/full_calendar.svg new file mode 100755 index 0000000..264bc88 --- /dev/null +++ b/assets/img/skins/full_calendar.svg @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/img/skins/general_calendar.svg b/assets/img/skins/general_calendar.svg new file mode 100755 index 0000000..096cdea --- /dev/null +++ b/assets/img/skins/general_calendar.svg @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/img/skins/grid.svg b/assets/img/skins/grid.svg new file mode 100755 index 0000000..1e2ed24 --- /dev/null +++ b/assets/img/skins/grid.svg @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/img/skins/grid/grid-classic.png b/assets/img/skins/grid/grid-classic.png new file mode 100755 index 0000000..10b797c Binary files /dev/null and b/assets/img/skins/grid/grid-classic.png differ diff --git a/assets/img/skins/grid/grid-clean.png b/assets/img/skins/grid/grid-clean.png new file mode 100755 index 0000000..edb96f4 Binary files /dev/null and b/assets/img/skins/grid/grid-clean.png differ diff --git a/assets/img/skins/grid/grid-colorful.png b/assets/img/skins/grid/grid-colorful.png new file mode 100755 index 0000000..d973f11 Binary files /dev/null and b/assets/img/skins/grid/grid-colorful.png differ diff --git a/assets/img/skins/grid/grid-minimal.png b/assets/img/skins/grid/grid-minimal.png new file mode 100755 index 0000000..b5772c8 Binary files /dev/null and b/assets/img/skins/grid/grid-minimal.png differ diff --git a/assets/img/skins/grid/grid-modern.png b/assets/img/skins/grid/grid-modern.png new file mode 100755 index 0000000..27ef431 Binary files /dev/null and b/assets/img/skins/grid/grid-modern.png differ diff --git a/assets/img/skins/grid/grid-novel.png b/assets/img/skins/grid/grid-novel.png new file mode 100755 index 0000000..ffa013c Binary files /dev/null and b/assets/img/skins/grid/grid-novel.png differ diff --git a/assets/img/skins/grid/grid-simple.png b/assets/img/skins/grid/grid-simple.png new file mode 100755 index 0000000..4759cbc Binary files /dev/null and b/assets/img/skins/grid/grid-simple.png differ diff --git a/assets/img/skins/grid/index.html b/assets/img/skins/grid/index.html new file mode 100755 index 0000000..e69de29 diff --git a/assets/img/skins/index.html b/assets/img/skins/index.html new file mode 100755 index 0000000..e69de29 diff --git a/assets/img/skins/liquid/liquid-available-spot.jpg b/assets/img/skins/liquid/liquid-available-spot.jpg new file mode 100755 index 0000000..620bdb6 Binary files /dev/null and b/assets/img/skins/liquid/liquid-available-spot.jpg differ diff --git a/assets/img/skins/liquid/liquid-carousel.jpg b/assets/img/skins/liquid/liquid-carousel.jpg new file mode 100755 index 0000000..9c73067 Binary files /dev/null and b/assets/img/skins/liquid/liquid-carousel.jpg differ diff --git a/assets/img/skins/liquid/liquid-cover.jpg b/assets/img/skins/liquid/liquid-cover.jpg new file mode 100755 index 0000000..b809190 Binary files /dev/null and b/assets/img/skins/liquid/liquid-cover.jpg differ diff --git a/assets/img/skins/liquid/liquid-daily.jpg b/assets/img/skins/liquid/liquid-daily.jpg new file mode 100755 index 0000000..c0abeee Binary files /dev/null and b/assets/img/skins/liquid/liquid-daily.jpg differ diff --git a/assets/img/skins/liquid/liquid-full-calendar.jpg b/assets/img/skins/liquid/liquid-full-calendar.jpg new file mode 100755 index 0000000..655314a Binary files /dev/null and b/assets/img/skins/liquid/liquid-full-calendar.jpg differ diff --git a/assets/img/skins/liquid/liquid-grid-large.jpg b/assets/img/skins/liquid/liquid-grid-large.jpg new file mode 100755 index 0000000..e531a3d Binary files /dev/null and b/assets/img/skins/liquid/liquid-grid-large.jpg differ diff --git a/assets/img/skins/liquid/liquid-grid-medium.jpg b/assets/img/skins/liquid/liquid-grid-medium.jpg new file mode 100755 index 0000000..c7e611b Binary files /dev/null and b/assets/img/skins/liquid/liquid-grid-medium.jpg differ diff --git a/assets/img/skins/liquid/liquid-grid-small.jpg b/assets/img/skins/liquid/liquid-grid-small.jpg new file mode 100755 index 0000000..81a548e Binary files /dev/null and b/assets/img/skins/liquid/liquid-grid-small.jpg differ diff --git a/assets/img/skins/liquid/liquid-list-large.jpg b/assets/img/skins/liquid/liquid-list-large.jpg new file mode 100755 index 0000000..62dcb64 Binary files /dev/null and b/assets/img/skins/liquid/liquid-list-large.jpg differ diff --git a/assets/img/skins/liquid/liquid-list-medium.jpg b/assets/img/skins/liquid/liquid-list-medium.jpg new file mode 100755 index 0000000..7ceadf8 Binary files /dev/null and b/assets/img/skins/liquid/liquid-list-medium.jpg differ diff --git a/assets/img/skins/liquid/liquid-list-minimal.jpg b/assets/img/skins/liquid/liquid-list-minimal.jpg new file mode 100755 index 0000000..deedcb9 Binary files /dev/null and b/assets/img/skins/liquid/liquid-list-minimal.jpg differ diff --git a/assets/img/skins/liquid/liquid-list-small.jpg b/assets/img/skins/liquid/liquid-list-small.jpg new file mode 100755 index 0000000..53460bb Binary files /dev/null and b/assets/img/skins/liquid/liquid-list-small.jpg differ diff --git a/assets/img/skins/liquid/liquid-map.jpg b/assets/img/skins/liquid/liquid-map.jpg new file mode 100755 index 0000000..f1f86c3 Binary files /dev/null and b/assets/img/skins/liquid/liquid-map.jpg differ diff --git a/assets/img/skins/liquid/liquid-slider.jpg b/assets/img/skins/liquid/liquid-slider.jpg new file mode 100755 index 0000000..776d94a Binary files /dev/null and b/assets/img/skins/liquid/liquid-slider.jpg differ diff --git a/assets/img/skins/liquid/liquid-weekly.jpg b/assets/img/skins/liquid/liquid-weekly.jpg new file mode 100755 index 0000000..9d3e3c5 Binary files /dev/null and b/assets/img/skins/liquid/liquid-weekly.jpg differ diff --git a/assets/img/skins/list.svg b/assets/img/skins/list.svg new file mode 100755 index 0000000..d41f4bc --- /dev/null +++ b/assets/img/skins/list.svg @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/img/skins/list/index.html b/assets/img/skins/list/index.html new file mode 100755 index 0000000..e69de29 diff --git a/assets/img/skins/list/list-accordion.png b/assets/img/skins/list/list-accordion.png new file mode 100755 index 0000000..16c8a0f Binary files /dev/null and b/assets/img/skins/list/list-accordion.png differ diff --git a/assets/img/skins/list/list-classic.png b/assets/img/skins/list/list-classic.png new file mode 100755 index 0000000..90af566 Binary files /dev/null and b/assets/img/skins/list/list-classic.png differ diff --git a/assets/img/skins/list/list-minimal.png b/assets/img/skins/list/list-minimal.png new file mode 100755 index 0000000..4b10b47 Binary files /dev/null and b/assets/img/skins/list/list-minimal.png differ diff --git a/assets/img/skins/list/list-modern.png b/assets/img/skins/list/list-modern.png new file mode 100755 index 0000000..5d2398d Binary files /dev/null and b/assets/img/skins/list/list-modern.png differ diff --git a/assets/img/skins/list/list-standard.png b/assets/img/skins/list/list-standard.png new file mode 100755 index 0000000..94ab1c2 Binary files /dev/null and b/assets/img/skins/list/list-standard.png differ diff --git a/assets/img/skins/map.svg b/assets/img/skins/map.svg new file mode 100755 index 0000000..f0de136 --- /dev/null +++ b/assets/img/skins/map.svg @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/img/skins/map/map-classic.jpg b/assets/img/skins/map/map-classic.jpg new file mode 100755 index 0000000..1ce1c69 Binary files /dev/null and b/assets/img/skins/map/map-classic.jpg differ diff --git a/assets/img/skins/masonry.svg b/assets/img/skins/masonry.svg new file mode 100755 index 0000000..619d6d7 --- /dev/null +++ b/assets/img/skins/masonry.svg @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/img/skins/masonry/masonry-classic.png b/assets/img/skins/masonry/masonry-classic.png new file mode 100755 index 0000000..4a0a8de Binary files /dev/null and b/assets/img/skins/masonry/masonry-classic.png differ diff --git a/assets/img/skins/monthly.svg b/assets/img/skins/monthly.svg new file mode 100755 index 0000000..096cdea --- /dev/null +++ b/assets/img/skins/monthly.svg @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/img/skins/monthly/index.html b/assets/img/skins/monthly/index.html new file mode 100755 index 0000000..e69de29 diff --git a/assets/img/skins/monthly/monthly-classic.png b/assets/img/skins/monthly/monthly-classic.png new file mode 100755 index 0000000..37d307b Binary files /dev/null and b/assets/img/skins/monthly/monthly-classic.png differ diff --git a/assets/img/skins/monthly/monthly-clean.png b/assets/img/skins/monthly/monthly-clean.png new file mode 100755 index 0000000..b5f6ab7 Binary files /dev/null and b/assets/img/skins/monthly/monthly-clean.png differ diff --git a/assets/img/skins/monthly/monthly-modern.png b/assets/img/skins/monthly/monthly-modern.png new file mode 100755 index 0000000..688725c Binary files /dev/null and b/assets/img/skins/monthly/monthly-modern.png differ diff --git a/assets/img/skins/monthly/monthly-novel.png b/assets/img/skins/monthly/monthly-novel.png new file mode 100755 index 0000000..7962410 Binary files /dev/null and b/assets/img/skins/monthly/monthly-novel.png differ diff --git a/assets/img/skins/monthly/monthly-simple.png b/assets/img/skins/monthly/monthly-simple.png new file mode 100755 index 0000000..d5e6889 Binary files /dev/null and b/assets/img/skins/monthly/monthly-simple.png differ diff --git a/assets/img/skins/popup/agenda-clean.jpg b/assets/img/skins/popup/agenda-clean.jpg new file mode 100755 index 0000000..c7f11d7 Binary files /dev/null and b/assets/img/skins/popup/agenda-clean.jpg differ diff --git a/assets/img/skins/popup/agenda-fluent.jpg b/assets/img/skins/popup/agenda-fluent.jpg new file mode 100755 index 0000000..9b0cd9e Binary files /dev/null and b/assets/img/skins/popup/agenda-fluent.jpg differ diff --git a/assets/img/skins/popup/available-spot-classic.jpg b/assets/img/skins/popup/available-spot-classic.jpg new file mode 100755 index 0000000..343dbb6 Binary files /dev/null and b/assets/img/skins/popup/available-spot-classic.jpg differ diff --git a/assets/img/skins/popup/available-spot-fluent-type1.jpg b/assets/img/skins/popup/available-spot-fluent-type1.jpg new file mode 100755 index 0000000..1e588dc Binary files /dev/null and b/assets/img/skins/popup/available-spot-fluent-type1.jpg differ diff --git a/assets/img/skins/popup/available-spot-fluent-type2.jpg b/assets/img/skins/popup/available-spot-fluent-type2.jpg new file mode 100755 index 0000000..dfdcb7c Binary files /dev/null and b/assets/img/skins/popup/available-spot-fluent-type2.jpg differ diff --git a/assets/img/skins/popup/carousel-fluent.jpg b/assets/img/skins/popup/carousel-fluent.jpg new file mode 100755 index 0000000..a83bf64 Binary files /dev/null and b/assets/img/skins/popup/carousel-fluent.jpg differ diff --git a/assets/img/skins/popup/carousel-type1.jpg b/assets/img/skins/popup/carousel-type1.jpg new file mode 100755 index 0000000..c54ad64 Binary files /dev/null and b/assets/img/skins/popup/carousel-type1.jpg differ diff --git a/assets/img/skins/popup/carousel-type2.jpg b/assets/img/skins/popup/carousel-type2.jpg new file mode 100755 index 0000000..0a84706 Binary files /dev/null and b/assets/img/skins/popup/carousel-type2.jpg differ diff --git a/assets/img/skins/popup/carousel-type3.jpg b/assets/img/skins/popup/carousel-type3.jpg new file mode 100755 index 0000000..6346b46 Binary files /dev/null and b/assets/img/skins/popup/carousel-type3.jpg differ diff --git a/assets/img/skins/popup/carousel-type4.jpg b/assets/img/skins/popup/carousel-type4.jpg new file mode 100755 index 0000000..6568e5b Binary files /dev/null and b/assets/img/skins/popup/carousel-type4.jpg differ diff --git a/assets/img/skins/popup/countdown-fluent.jpg b/assets/img/skins/popup/countdown-fluent.jpg new file mode 100755 index 0000000..c21582f Binary files /dev/null and b/assets/img/skins/popup/countdown-fluent.jpg differ diff --git a/assets/img/skins/popup/countdown-type1.jpg b/assets/img/skins/popup/countdown-type1.jpg new file mode 100755 index 0000000..be15b5a Binary files /dev/null and b/assets/img/skins/popup/countdown-type1.jpg differ diff --git a/assets/img/skins/popup/countdown-type2.jpg b/assets/img/skins/popup/countdown-type2.jpg new file mode 100755 index 0000000..5b1eb68 Binary files /dev/null and b/assets/img/skins/popup/countdown-type2.jpg differ diff --git a/assets/img/skins/popup/countdown-type3.jpg b/assets/img/skins/popup/countdown-type3.jpg new file mode 100755 index 0000000..668b65d Binary files /dev/null and b/assets/img/skins/popup/countdown-type3.jpg differ diff --git a/assets/img/skins/popup/cover-classic.jpg b/assets/img/skins/popup/cover-classic.jpg new file mode 100755 index 0000000..c5fc325 Binary files /dev/null and b/assets/img/skins/popup/cover-classic.jpg differ diff --git a/assets/img/skins/popup/cover-clean.jpg b/assets/img/skins/popup/cover-clean.jpg new file mode 100755 index 0000000..4d16b04 Binary files /dev/null and b/assets/img/skins/popup/cover-clean.jpg differ diff --git a/assets/img/skins/popup/cover-fluent-type1.jpg b/assets/img/skins/popup/cover-fluent-type1.jpg new file mode 100755 index 0000000..9cccb4a Binary files /dev/null and b/assets/img/skins/popup/cover-fluent-type1.jpg differ diff --git a/assets/img/skins/popup/cover-fluent-type2.jpg b/assets/img/skins/popup/cover-fluent-type2.jpg new file mode 100755 index 0000000..519cef4 Binary files /dev/null and b/assets/img/skins/popup/cover-fluent-type2.jpg differ diff --git a/assets/img/skins/popup/cover-fluent-type3.jpg b/assets/img/skins/popup/cover-fluent-type3.jpg new file mode 100755 index 0000000..5f0c885 Binary files /dev/null and b/assets/img/skins/popup/cover-fluent-type3.jpg differ diff --git a/assets/img/skins/popup/cover-fluent-type4.jpg b/assets/img/skins/popup/cover-fluent-type4.jpg new file mode 100755 index 0000000..fc4139f Binary files /dev/null and b/assets/img/skins/popup/cover-fluent-type4.jpg differ diff --git a/assets/img/skins/popup/cover-modern.jpg b/assets/img/skins/popup/cover-modern.jpg new file mode 100755 index 0000000..d8b4d9d Binary files /dev/null and b/assets/img/skins/popup/cover-modern.jpg differ diff --git a/assets/img/skins/popup/daily-classic.jpg b/assets/img/skins/popup/daily-classic.jpg new file mode 100755 index 0000000..f4d19de Binary files /dev/null and b/assets/img/skins/popup/daily-classic.jpg differ diff --git a/assets/img/skins/popup/daily-fluent.jpg b/assets/img/skins/popup/daily-fluent.jpg new file mode 100755 index 0000000..3ba346f Binary files /dev/null and b/assets/img/skins/popup/daily-fluent.jpg differ diff --git a/assets/img/skins/popup/grid-classic.jpg b/assets/img/skins/popup/grid-classic.jpg new file mode 100755 index 0000000..d6a1bf0 Binary files /dev/null and b/assets/img/skins/popup/grid-classic.jpg differ diff --git a/assets/img/skins/popup/grid-clean.jpg b/assets/img/skins/popup/grid-clean.jpg new file mode 100755 index 0000000..c254790 Binary files /dev/null and b/assets/img/skins/popup/grid-clean.jpg differ diff --git a/assets/img/skins/popup/grid-colorful.jpg b/assets/img/skins/popup/grid-colorful.jpg new file mode 100755 index 0000000..b9dcc09 Binary files /dev/null and b/assets/img/skins/popup/grid-colorful.jpg differ diff --git a/assets/img/skins/popup/grid-fluent.jpg b/assets/img/skins/popup/grid-fluent.jpg new file mode 100755 index 0000000..074ea5b Binary files /dev/null and b/assets/img/skins/popup/grid-fluent.jpg differ diff --git a/assets/img/skins/popup/grid-minimal.jpg b/assets/img/skins/popup/grid-minimal.jpg new file mode 100755 index 0000000..9454cd3 Binary files /dev/null and b/assets/img/skins/popup/grid-minimal.jpg differ diff --git a/assets/img/skins/popup/grid-modern.jpg b/assets/img/skins/popup/grid-modern.jpg new file mode 100755 index 0000000..756b366 Binary files /dev/null and b/assets/img/skins/popup/grid-modern.jpg differ diff --git a/assets/img/skins/popup/grid-novel.jpg b/assets/img/skins/popup/grid-novel.jpg new file mode 100755 index 0000000..ff22ce2 Binary files /dev/null and b/assets/img/skins/popup/grid-novel.jpg differ diff --git a/assets/img/skins/popup/grid-simple.jpg b/assets/img/skins/popup/grid-simple.jpg new file mode 100755 index 0000000..7d53eeb Binary files /dev/null and b/assets/img/skins/popup/grid-simple.jpg differ diff --git a/assets/img/skins/popup/index.html b/assets/img/skins/popup/index.html new file mode 100755 index 0000000..e69de29 diff --git a/assets/img/skins/popup/list-classic.jpg b/assets/img/skins/popup/list-classic.jpg new file mode 100755 index 0000000..bda04e1 Binary files /dev/null and b/assets/img/skins/popup/list-classic.jpg differ diff --git a/assets/img/skins/popup/list-fluent.jpg b/assets/img/skins/popup/list-fluent.jpg new file mode 100755 index 0000000..86f9409 Binary files /dev/null and b/assets/img/skins/popup/list-fluent.jpg differ diff --git a/assets/img/skins/popup/list-minimal.jpg b/assets/img/skins/popup/list-minimal.jpg new file mode 100755 index 0000000..64425b5 Binary files /dev/null and b/assets/img/skins/popup/list-minimal.jpg differ diff --git a/assets/img/skins/popup/list-modern.jpg b/assets/img/skins/popup/list-modern.jpg new file mode 100755 index 0000000..28896d9 Binary files /dev/null and b/assets/img/skins/popup/list-modern.jpg differ diff --git a/assets/img/skins/popup/list-standard.jpg b/assets/img/skins/popup/list-standard.jpg new file mode 100755 index 0000000..c1de904 Binary files /dev/null and b/assets/img/skins/popup/list-standard.jpg differ diff --git a/assets/img/skins/popup/list-toggle.jpg b/assets/img/skins/popup/list-toggle.jpg new file mode 100755 index 0000000..e8dee67 Binary files /dev/null and b/assets/img/skins/popup/list-toggle.jpg differ diff --git a/assets/img/skins/popup/masonry-classic.jpg b/assets/img/skins/popup/masonry-classic.jpg new file mode 100755 index 0000000..06fbbbf Binary files /dev/null and b/assets/img/skins/popup/masonry-classic.jpg differ diff --git a/assets/img/skins/popup/masonry-fluent.jpg b/assets/img/skins/popup/masonry-fluent.jpg new file mode 100755 index 0000000..129ca06 Binary files /dev/null and b/assets/img/skins/popup/masonry-fluent.jpg differ diff --git a/assets/img/skins/popup/monthly-classic.jpg b/assets/img/skins/popup/monthly-classic.jpg new file mode 100755 index 0000000..05427ae Binary files /dev/null and b/assets/img/skins/popup/monthly-classic.jpg differ diff --git a/assets/img/skins/popup/monthly-clean.jpg b/assets/img/skins/popup/monthly-clean.jpg new file mode 100755 index 0000000..2350f23 Binary files /dev/null and b/assets/img/skins/popup/monthly-clean.jpg differ diff --git a/assets/img/skins/popup/monthly-fluent.jpg b/assets/img/skins/popup/monthly-fluent.jpg new file mode 100755 index 0000000..4a8140d Binary files /dev/null and b/assets/img/skins/popup/monthly-fluent.jpg differ diff --git a/assets/img/skins/popup/monthly-modern.jpg b/assets/img/skins/popup/monthly-modern.jpg new file mode 100755 index 0000000..5008814 Binary files /dev/null and b/assets/img/skins/popup/monthly-modern.jpg differ diff --git a/assets/img/skins/popup/monthly-novel.jpg b/assets/img/skins/popup/monthly-novel.jpg new file mode 100755 index 0000000..7bcac16 Binary files /dev/null and b/assets/img/skins/popup/monthly-novel.jpg differ diff --git a/assets/img/skins/popup/monthly-simple.jpg b/assets/img/skins/popup/monthly-simple.jpg new file mode 100755 index 0000000..91f17b2 Binary files /dev/null and b/assets/img/skins/popup/monthly-simple.jpg differ diff --git a/assets/img/skins/popup/slider-fluent.jpg b/assets/img/skins/popup/slider-fluent.jpg new file mode 100755 index 0000000..eb95d71 Binary files /dev/null and b/assets/img/skins/popup/slider-fluent.jpg differ diff --git a/assets/img/skins/popup/slider-type1.jpg b/assets/img/skins/popup/slider-type1.jpg new file mode 100755 index 0000000..9c1569c Binary files /dev/null and b/assets/img/skins/popup/slider-type1.jpg differ diff --git a/assets/img/skins/popup/slider-type2.jpg b/assets/img/skins/popup/slider-type2.jpg new file mode 100755 index 0000000..e26e29c Binary files /dev/null and b/assets/img/skins/popup/slider-type2.jpg differ diff --git a/assets/img/skins/popup/slider-type3.jpg b/assets/img/skins/popup/slider-type3.jpg new file mode 100755 index 0000000..c7e73c0 Binary files /dev/null and b/assets/img/skins/popup/slider-type3.jpg differ diff --git a/assets/img/skins/popup/slider-type4.jpg b/assets/img/skins/popup/slider-type4.jpg new file mode 100755 index 0000000..5effd46 Binary files /dev/null and b/assets/img/skins/popup/slider-type4.jpg differ diff --git a/assets/img/skins/popup/slider-type5.jpg b/assets/img/skins/popup/slider-type5.jpg new file mode 100755 index 0000000..b9638e1 Binary files /dev/null and b/assets/img/skins/popup/slider-type5.jpg differ diff --git a/assets/img/skins/popup/tile-classic.jpg b/assets/img/skins/popup/tile-classic.jpg new file mode 100755 index 0000000..c554376 Binary files /dev/null and b/assets/img/skins/popup/tile-classic.jpg differ diff --git a/assets/img/skins/popup/tile-fluent.jpg b/assets/img/skins/popup/tile-fluent.jpg new file mode 100755 index 0000000..338afbe Binary files /dev/null and b/assets/img/skins/popup/tile-fluent.jpg differ diff --git a/assets/img/skins/popup/timetable-clean.jpg b/assets/img/skins/popup/timetable-clean.jpg new file mode 100755 index 0000000..cfcd5dd Binary files /dev/null and b/assets/img/skins/popup/timetable-clean.jpg differ diff --git a/assets/img/skins/popup/timetable-fluent.jpg b/assets/img/skins/popup/timetable-fluent.jpg new file mode 100755 index 0000000..6a7a374 Binary files /dev/null and b/assets/img/skins/popup/timetable-fluent.jpg differ diff --git a/assets/img/skins/popup/timetable-modern.jpg b/assets/img/skins/popup/timetable-modern.jpg new file mode 100755 index 0000000..3ef53fd Binary files /dev/null and b/assets/img/skins/popup/timetable-modern.jpg differ diff --git a/assets/img/skins/popup/weekly-classic.jpg b/assets/img/skins/popup/weekly-classic.jpg new file mode 100755 index 0000000..82b2582 Binary files /dev/null and b/assets/img/skins/popup/weekly-classic.jpg differ diff --git a/assets/img/skins/popup/weekly-fluent.jpg b/assets/img/skins/popup/weekly-fluent.jpg new file mode 100755 index 0000000..2554709 Binary files /dev/null and b/assets/img/skins/popup/weekly-fluent.jpg differ diff --git a/assets/img/skins/popup/yearly-fluent.jpg b/assets/img/skins/popup/yearly-fluent.jpg new file mode 100755 index 0000000..18272b9 Binary files /dev/null and b/assets/img/skins/popup/yearly-fluent.jpg differ diff --git a/assets/img/skins/popup/yearly-modern.jpg b/assets/img/skins/popup/yearly-modern.jpg new file mode 100755 index 0000000..b7204e8 Binary files /dev/null and b/assets/img/skins/popup/yearly-modern.jpg differ diff --git a/assets/img/skins/shortcode-designer.svg b/assets/img/skins/shortcode-designer.svg new file mode 100755 index 0000000..cece276 --- /dev/null +++ b/assets/img/skins/shortcode-designer.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/img/skins/slider.svg b/assets/img/skins/slider.svg new file mode 100755 index 0000000..296dab9 --- /dev/null +++ b/assets/img/skins/slider.svg @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/img/skins/slider/index.html b/assets/img/skins/slider/index.html new file mode 100755 index 0000000..e69de29 diff --git a/assets/img/skins/slider/slider-type-1.png b/assets/img/skins/slider/slider-type-1.png new file mode 100755 index 0000000..461a23c Binary files /dev/null and b/assets/img/skins/slider/slider-type-1.png differ diff --git a/assets/img/skins/slider/slider-type-2.png b/assets/img/skins/slider/slider-type-2.png new file mode 100755 index 0000000..c7d7289 Binary files /dev/null and b/assets/img/skins/slider/slider-type-2.png differ diff --git a/assets/img/skins/slider/slider-type-3.png b/assets/img/skins/slider/slider-type-3.png new file mode 100755 index 0000000..fc4692f Binary files /dev/null and b/assets/img/skins/slider/slider-type-3.png differ diff --git a/assets/img/skins/slider/slider-type-4.png b/assets/img/skins/slider/slider-type-4.png new file mode 100755 index 0000000..ab60149 Binary files /dev/null and b/assets/img/skins/slider/slider-type-4.png differ diff --git a/assets/img/skins/slider/slider-type-5.png b/assets/img/skins/slider/slider-type-5.png new file mode 100755 index 0000000..869083f Binary files /dev/null and b/assets/img/skins/slider/slider-type-5.png differ diff --git a/assets/img/skins/tile.svg b/assets/img/skins/tile.svg new file mode 100755 index 0000000..0d787e4 --- /dev/null +++ b/assets/img/skins/tile.svg @@ -0,0 +1,40 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/img/skins/tile/tile-classic.png b/assets/img/skins/tile/tile-classic.png new file mode 100755 index 0000000..c2b0a0c Binary files /dev/null and b/assets/img/skins/tile/tile-classic.png differ diff --git a/assets/img/skins/time-table/index.html b/assets/img/skins/time-table/index.html new file mode 100755 index 0000000..e69de29 diff --git a/assets/img/skins/time-table/time-table-clean.png b/assets/img/skins/time-table/time-table-clean.png new file mode 100755 index 0000000..117ddd2 Binary files /dev/null and b/assets/img/skins/time-table/time-table-clean.png differ diff --git a/assets/img/skins/time-table/time-table-modern.png b/assets/img/skins/time-table/time-table-modern.png new file mode 100755 index 0000000..93dd210 Binary files /dev/null and b/assets/img/skins/time-table/time-table-modern.png differ diff --git a/assets/img/skins/timeline.svg b/assets/img/skins/timeline.svg new file mode 100755 index 0000000..c96833d --- /dev/null +++ b/assets/img/skins/timeline.svg @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + 21 + + + + + + + + + + + + + + + + + + + + + + + + + 22 + + + + + + + + + + + + + + + + + + + diff --git a/assets/img/skins/timetable.svg b/assets/img/skins/timetable.svg new file mode 100755 index 0000000..a15adea --- /dev/null +++ b/assets/img/skins/timetable.svg @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/img/skins/weekly.svg b/assets/img/skins/weekly.svg new file mode 100755 index 0000000..e343173 --- /dev/null +++ b/assets/img/skins/weekly.svg @@ -0,0 +1,70 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/img/skins/weekly/weekly-classic.png b/assets/img/skins/weekly/weekly-classic.png new file mode 100755 index 0000000..84d6747 Binary files /dev/null and b/assets/img/skins/weekly/weekly-classic.png differ diff --git a/assets/img/skins/yearly.svg b/assets/img/skins/yearly.svg new file mode 100755 index 0000000..0fc5e90 --- /dev/null +++ b/assets/img/skins/yearly.svg @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/img/skins/yearly/index.html b/assets/img/skins/yearly/index.html new file mode 100755 index 0000000..e69de29 diff --git a/assets/img/skins/yearly/yearly-modern.png b/assets/img/skins/yearly/yearly-modern.png new file mode 100755 index 0000000..da83f2a Binary files /dev/null and b/assets/img/skins/yearly/yearly-modern.png differ diff --git a/assets/img/support.png b/assets/img/support.png new file mode 100755 index 0000000..8905275 Binary files /dev/null and b/assets/img/support.png differ diff --git a/assets/img/svg/calendar.svg b/assets/img/svg/calendar.svg new file mode 100755 index 0000000..af5131b --- /dev/null +++ b/assets/img/svg/calendar.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/img/svg/camrecorder.svg b/assets/img/svg/camrecorder.svg new file mode 100755 index 0000000..a85d3d8 --- /dev/null +++ b/assets/img/svg/camrecorder.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/img/svg/cancel.svg b/assets/img/svg/cancel.svg new file mode 100755 index 0000000..4d67707 --- /dev/null +++ b/assets/img/svg/cancel.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/img/svg/clock.svg b/assets/img/svg/clock.svg new file mode 100755 index 0000000..fc2ddbd --- /dev/null +++ b/assets/img/svg/clock.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/img/svg/delay.svg b/assets/img/svg/delay.svg new file mode 100755 index 0000000..5303d8d --- /dev/null +++ b/assets/img/svg/delay.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/img/svg/form/back-icon.svg b/assets/img/svg/form/back-icon.svg new file mode 100755 index 0000000..899467c --- /dev/null +++ b/assets/img/svg/form/back-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/img/svg/form/calendar-icon.svg b/assets/img/svg/form/calendar-icon.svg new file mode 100755 index 0000000..b2e8557 --- /dev/null +++ b/assets/img/svg/form/calendar-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/img/svg/form/close-icon.svg b/assets/img/svg/form/close-icon.svg new file mode 100755 index 0000000..868287e --- /dev/null +++ b/assets/img/svg/form/close-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/img/svg/form/credit-card-icon.svg b/assets/img/svg/form/credit-card-icon.svg new file mode 100755 index 0000000..e0255ab --- /dev/null +++ b/assets/img/svg/form/credit-card-icon.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/assets/img/svg/form/discount-icon.svg b/assets/img/svg/form/discount-icon.svg new file mode 100755 index 0000000..bf7d184 --- /dev/null +++ b/assets/img/svg/form/discount-icon.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/assets/img/svg/form/done-icon.svg b/assets/img/svg/form/done-icon.svg new file mode 100755 index 0000000..1b6177b --- /dev/null +++ b/assets/img/svg/form/done-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/img/svg/form/down-icon.svg b/assets/img/svg/form/down-icon.svg new file mode 100755 index 0000000..b91efbc --- /dev/null +++ b/assets/img/svg/form/down-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/img/svg/form/down-small-icon.svg b/assets/img/svg/form/down-small-icon.svg new file mode 100755 index 0000000..5f1e00e --- /dev/null +++ b/assets/img/svg/form/down-small-icon.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/img/svg/form/email-icon.svg b/assets/img/svg/form/email-icon.svg new file mode 100755 index 0000000..a92f5a9 --- /dev/null +++ b/assets/img/svg/form/email-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/img/svg/form/i-icon.svg b/assets/img/svg/form/i-icon.svg new file mode 100755 index 0000000..8b5ffdc --- /dev/null +++ b/assets/img/svg/form/i-icon.svg @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/assets/img/svg/form/left-icon.svg b/assets/img/svg/form/left-icon.svg new file mode 100755 index 0000000..5415efc --- /dev/null +++ b/assets/img/svg/form/left-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/img/svg/form/lock-icon.svg b/assets/img/svg/form/lock-icon.svg new file mode 100755 index 0000000..9376a9a --- /dev/null +++ b/assets/img/svg/form/lock-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/img/svg/form/minus-icon.svg b/assets/img/svg/form/minus-icon.svg new file mode 100755 index 0000000..67079c2 --- /dev/null +++ b/assets/img/svg/form/minus-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/img/svg/form/next-icon.svg b/assets/img/svg/form/next-icon.svg new file mode 100755 index 0000000..c87c933 --- /dev/null +++ b/assets/img/svg/form/next-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/img/svg/form/pay-locally-icon.svg b/assets/img/svg/form/pay-locally-icon.svg new file mode 100755 index 0000000..9a996a8 --- /dev/null +++ b/assets/img/svg/form/pay-locally-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/img/svg/form/paypal-icon.svg b/assets/img/svg/form/paypal-icon.svg new file mode 100755 index 0000000..8bcafe0 --- /dev/null +++ b/assets/img/svg/form/paypal-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/img/svg/form/plus-icon.svg b/assets/img/svg/form/plus-icon.svg new file mode 100755 index 0000000..b24cc16 --- /dev/null +++ b/assets/img/svg/form/plus-icon.svg @@ -0,0 +1,4 @@ + + + + diff --git a/assets/img/svg/form/right-icon.svg b/assets/img/svg/form/right-icon.svg new file mode 100755 index 0000000..56a3388 --- /dev/null +++ b/assets/img/svg/form/right-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/img/svg/form/search-icon.svg b/assets/img/svg/form/search-icon.svg new file mode 100755 index 0000000..5775750 --- /dev/null +++ b/assets/img/svg/form/search-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/img/svg/form/stripe-card-icon.svg b/assets/img/svg/form/stripe-card-icon.svg new file mode 100755 index 0000000..047f859 --- /dev/null +++ b/assets/img/svg/form/stripe-card-icon.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/assets/img/svg/form/stripe-icon.svg b/assets/img/svg/form/stripe-icon.svg new file mode 100755 index 0000000..729114d --- /dev/null +++ b/assets/img/svg/form/stripe-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/img/svg/form/subtotal-icon.svg b/assets/img/svg/form/subtotal-icon.svg new file mode 100755 index 0000000..1be5c6c --- /dev/null +++ b/assets/img/svg/form/subtotal-icon.svg @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/img/svg/form/ticket-icon.svg b/assets/img/svg/form/ticket-icon.svg new file mode 100755 index 0000000..12b6134 --- /dev/null +++ b/assets/img/svg/form/ticket-icon.svg @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/img/svg/form/up-icon.svg b/assets/img/svg/form/up-icon.svg new file mode 100755 index 0000000..ff29504 --- /dev/null +++ b/assets/img/svg/form/up-icon.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/img/svg/form/up-small-icon.svg b/assets/img/svg/form/up-small-icon.svg new file mode 100755 index 0000000..83cdb0b --- /dev/null +++ b/assets/img/svg/form/up-small-icon.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/img/svg/form/user-icon.svg b/assets/img/svg/form/user-icon.svg new file mode 100755 index 0000000..a2dff0a --- /dev/null +++ b/assets/img/svg/form/user-icon.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/assets/img/svg/local-time.svg b/assets/img/svg/local-time.svg new file mode 100755 index 0000000..0cdf58c --- /dev/null +++ b/assets/img/svg/local-time.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/img/svg/location.svg b/assets/img/svg/location.svg new file mode 100755 index 0000000..166ab03 --- /dev/null +++ b/assets/img/svg/location.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/img/svg/mec-live-now.svg b/assets/img/svg/mec-live-now.svg new file mode 100755 index 0000000..9cb3503 --- /dev/null +++ b/assets/img/svg/mec-live-now.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/img/svg/ontime.svg b/assets/img/svg/ontime.svg new file mode 100755 index 0000000..06fba3e --- /dev/null +++ b/assets/img/svg/ontime.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/assets/img/svg/share.svg b/assets/img/svg/share.svg new file mode 100755 index 0000000..4685360 --- /dev/null +++ b/assets/img/svg/share.svg @@ -0,0 +1,3 @@ + + + diff --git a/assets/img/webnus-logo.png b/assets/img/webnus-logo.png new file mode 100755 index 0000000..6da77bf Binary files /dev/null and b/assets/img/webnus-logo.png differ diff --git a/assets/img/webnus-logo2.png b/assets/img/webnus-logo2.png new file mode 100755 index 0000000..646ee3d Binary files /dev/null and b/assets/img/webnus-logo2.png differ diff --git a/assets/img/wn-ms-icon-17-n.svg b/assets/img/wn-ms-icon-17-n.svg new file mode 100755 index 0000000..7c0b38d --- /dev/null +++ b/assets/img/wn-ms-icon-17-n.svg @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/img/x-social-media-black-icon.svg b/assets/img/x-social-media-black-icon.svg new file mode 100755 index 0000000..729eab6 --- /dev/null +++ b/assets/img/x-social-media-black-icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/img/x-social-media-logo-icon.svg b/assets/img/x-social-media-logo-icon.svg new file mode 100755 index 0000000..0c03780 --- /dev/null +++ b/assets/img/x-social-media-logo-icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/img/x.png b/assets/img/x.png new file mode 100755 index 0000000..f67e320 Binary files /dev/null and b/assets/img/x.png differ diff --git a/assets/index.html b/assets/index.html new file mode 100755 index 0000000..e69de29 diff --git a/assets/js/admin-calendar.js b/assets/js/admin-calendar.js new file mode 100755 index 0000000..9114e7d --- /dev/null +++ b/assets/js/admin-calendar.js @@ -0,0 +1,123 @@ +// MEC MONTHLY VIEW PLUGIN +(function($) +{ + $.fn.mecMonthlyView = function(options) + { + var active_month; + var active_year; + + // Default Options + var settings = $.extend( + { + // These are the defaults. + today: null, + id: 0, + month_navigator: 0, + atts: '', + active_month: {}, + next_month: {}, + sf: {}, + ajax_url: '', + }, options); + + // Initialize Month Navigator + if(settings.month_navigator) + { + // Add Loading Wrapper + jQuery('.mec-wrap').append('
    '); + + active_month = settings.active_month.month; + active_year = settings.active_month.year; + + setTimeout(initMonthNavigator, 1000); + } + + function initMonthNavigator() + { + // Remove the onclick event + $("#mec_skin_" + settings.id + ' .mec-load-month').off('click'); + + // Add onclick event + $("#mec_skin_" + settings.id + ' .mec-load-month').on('click', function() + { + var year = $(this).data('mec-year'); + var month = $(this).data('mec-month'); + + setMonth(year, month); + }); + } + + function setMonth(year, month) + { + var month_id = year + "" + month; + active_month = month; + active_year = year; + + // Month exists so we just show it + if($("#mec_monthly_view_month_" + settings.id + "_" + month_id).length) + { + // Toggle Month + toggleMonth(month_id); + } + else + { + var $modalResult = $('.mec-modal-result'); + + // Add Loading Class + $modalResult.addClass('mec-month-navigator-loading'); + + $.ajax( + { + url: settings.ajax_url, + data: "action=mec_monthly_view_load_month&mec_year=" + year + "&mec_month=" + month + "&" + settings.atts, + dataType: "json", + type: "post", + success: function(response) + { + // Append Month + $("#mec_skin_events_" + settings.id).append('
    ' + response.month + '
    '); + + // Append Month Navigator + $("#mec_skin_" + settings.id + " .mec-skin-monthly-view-month-navigator-container").append('
    ' + response.navigator + '
    '); + + // Re-initialize Month Navigator + initMonthNavigator(); + + // Toggle Month + toggleMonth(response.current_month.id); + + // Remove loading Class + $modalResult.removeClass("mec-month-navigator-loading"); + + jQuery(document).trigger('load_calendar_data'); + }, + error: function(){} + }); + } + } + + function toggleMonth(month_id) + { + var $monthContainer = $("#mec_skin_" + settings.id + " .mec-month-container"); + var $currentMonth = $("#mec_monthly_view_month_" + settings.id + "_" + month_id); + + // Toggle Month Navigator + $("#mec_skin_" + settings.id + " .mec-month-navigator").hide(); + $("#mec_month_navigator_" + settings.id + "_" + month_id).show(); + + // Toggle Month + $monthContainer.hide(); + $currentMonth.show(); + + // Add selected class + $monthContainer.removeClass("mec-month-container-selected"); + $currentMonth.addClass("mec-month-container-selected"); + + // Toggle Events Side + $("#mec_skin_" + settings.id + " .mec-month-side").hide(); + $("#mec_month_side_" + settings.id + "_" + month_id).show(); + + jQuery(document).trigger('mec_toggle_month', settings, month_id); + } + }; +}(jQuery)); \ No newline at end of file diff --git a/assets/js/admin-upcoming.js b/assets/js/admin-upcoming.js new file mode 100755 index 0000000..1e8a188 --- /dev/null +++ b/assets/js/admin-upcoming.js @@ -0,0 +1,73 @@ +// MEC LIST VIEW PLUGIN +(function ($) { + $.fn.mecListView = function (options) { + // Default Options + var settings = $.extend({ + // These are the defaults. + id: 0, + atts: '', + ajax_url: '', + sf: {}, + current_month_divider: '', + end_date: '', + offset: 0, + limit: 0, + pagination: '0', + infinite_locked: false, + }, options); + + // Set onclick Listeners + setListeners(); + + function setListeners() { + // Load More + $("#mec_skin_" + settings.id + " .mec-load-more-button").on("click", function () { + loadMore(); + }); + } + + function loadMore(callback) { + // Add loading Class + $("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-load-more-loading"); + + $.ajax({ + url: settings.ajax_url, + data: "action=mec_list_load_more&mec_start_date=" + settings.end_date + "&mec_offset=" + settings.offset + "&" + settings.atts + "¤t_month_divider=" + settings.current_month_divider + "&apply_sf_date=0", + dataType: "json", + type: "post", + success: function (response) { + if (response.count === 0) { + // Remove loading Class + $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-load-more-loading"); + + // Release Lock of Infinite Scroll + settings.infinite_locked = false; + $("#mec_skin_" + settings.id + " .mec-load-more-wrap").removeClass('mec-load-more-scroll-loading'); + + // Hide Pagination + jQuery("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-util-hidden"); + + // Run Callback + if(typeof callback === 'function') callback(response); + } else { + // Show load more button + if (typeof response.has_more_event === 'undefined' || (typeof response.has_more_event !== 'undefined' && response.has_more_event)) jQuery("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-util-hidden"); + else jQuery("#mec_skin_" + settings.id + " .mec-load-more-button").addClass("mec-util-hidden"); + + // Append Items + $("#mec_skin_events_" + settings.id).append(response.html); + + // Remove loading Class + $("#mec_skin_" + settings.id + " .mec-load-more-button").removeClass("mec-load-more-loading"); + + // Update the variables + settings.end_date = response.end_date; + settings.offset = response.offset; + settings.current_month_divider = response.current_month_divider; + } + }, + error: function() {} + }); + } + }; +}(jQuery)); \ No newline at end of file diff --git a/assets/js/backend.js b/assets/js/backend.js new file mode 100755 index 0000000..9488de1 --- /dev/null +++ b/assets/js/backend.js @@ -0,0 +1,1196 @@ +jQuery(document).ready(function ($) { + // Check validation of grid skin event count + $("#mec_skin_grid_count").keyup(function () { + var valid = false; + if ( + $(this).val() == "1" || + $(this).val() == "2" || + $(this).val() == "3" || + $(this).val() == "4" || + $(this).val() == "6" || + $(this).val() == "12" + ) { + valid = true; + } + + if (valid === false) { + $(this).addClass("bootstrap_unvalid"); + $(".mec-tooltiptext").css("visibility", "visible"); + } else { + $(this).removeClass("bootstrap_unvalid"); + $(".mec-tooltiptext").css("visibility", "hidden"); + } + }); + + // MEC Accordion + $(".mec-accordion .mec-acc-label .mec-acc-cat-name").on("click", function () { + var key = $(this).parent().attr("data-key"); + var status = $(this).parent().attr("data-status"); + + // Open the accordion + if (status === "close") { + $(".mec-accordion .mec-acc-label ul").hide(); + $(".mec-accordion .mec-acc-label").attr("data-status", "close"); + $(this).parent().attr("data-status", "open"); + $("#mec-acc-" + key).show(); + } else { + $(".mec-accordion .mec-acc-label ul").hide(); + $(".mec-accordion .mec-acc-label").attr("data-status", "close"); + $("#mec-acc-" + key).hide(); + } + }); + + // MEC Select, Deselect, Toggle + $(".mec-select-deselect-actions li").on("click", function () { + var target = $(this).parent().data("for"); + var action = $(this).data("action"); + + if (action === "select-all") { + $(target + " input[type=checkbox]").each(function () { + this.checked = true; + }); + } else if (action === "deselect-all") { + $(target + " input[type=checkbox]").each(function () { + this.checked = false; + }); + } else if (action === "toggle") { + $(target + " input[type=checkbox]").each(function () { + this.checked = !this.checked; + }); + } + }); + + // MEC image popup switcher + if ($(".mec-sed-method-wrap").length > 0) { + $(".mec-sed-method-wrap").each(function () { + var sed_value = $(this).find('[id*="_sed_method_field"]').val(); + if (sed_value == "m1") { + $(this).siblings(".mec-image-popup-wrap").show(); + } + }); + } + + // MEC Single Event Display Method Switcher + $(".mec-sed-methods li").on("click", function () { + var target = $(this).parent().data("for"); + var method = $(this).data("method"); + + // Set the Method + $(target).val(method); + + // Set the active method + $(this).parent().find("li").removeClass("active"); + $(this).addClass("active"); + + // Display Image popup section + if (method == "m1") { + $(".mec-image-popup-wrap").show(); + } else { + $(".mec-image-popup-wrap").hide(); + } + }); + + // Initialize WP Color Picker + if ($.fn.wpColorPicker) jQuery(".mec-color-picker").wpColorPicker(); + + // Initialize MEC Skin Switcher + $("#mec_skin").on("change", function () { + mec_skin_toggle(); + }); + + mec_skin_toggle(); + + $(".mec-switcher").on( + "click", + 'label[for*="mec[settings]"]', + function (event) { + var id = $(this).closest(".mec-switcher").data("id"); + var status = $("#mec_sn_" + id + " .mec-status").val(); + + if (status === "1") { + $("#mec_sn_" + id + " .mec-status").val(0); + $("#mec_sn_" + id) + .removeClass("mec-enabled") + .addClass("mec-disabled"); + } else { + $("#mec_sn_" + id + " .mec-status").val(1); + $("#mec_sn_" + id) + .removeClass("mec-disabled") + .addClass("mec-enabled"); + } + } + ); + + // MEC Checkbox Toggle (Used in Date Filter Options) + $(".mec-checkbox-toggle").on("change", function () { + var id = $(this).attr("id"); + $(".mec-checkbox-toggle:not(#" + id + ")").prop("checked", false); + }); + + // MEC Setting Sticky + if ($(".wns-be-container-sticky").length > 0) { + var stickyNav = function () { + var stickyNavTop = $(".wns-be-container-sticky").offset().top; + var scrollTop = $(window).scrollTop(); + var width = $(".wns-be-container-sticky").width(); + if (scrollTop > stickyNavTop) { + $("#wns-be-infobar").addClass("sticky"); + $("#wns-be-infobar").css({ + width: width, + }); + } else { + $("#wns-be-infobar").removeClass("sticky"); + } + }; + stickyNav(); + $(window).scroll(function () { + stickyNav(); + }); + + $("#mec-search-settings").typeWatch({ + wait: 400, // 750ms + callback: function (value) { + var elements = []; + if (!value || value == "") { + $(".mec-options-fields").hide(); + $(".mec-options-fields").removeClass("active"); + $( + ".wns-be-group-tab form .mec-options-fields:first-of-type" + ).addClass("active"); + $(".subsection li").removeClass("active"); + $( + ".wns-be-sidebar .wns-be-group-menu .subsection li:first-of-type" + ).addClass("active"); + } else { + $(".mec-options-fields").filter(function () { + var search_label = $(this) + .find("label.mec-col-3") + .text() + .toLowerCase(); + var search_title = $(this) + .find("h4.mec-form-subtitle") + .text() + .toLowerCase(); + var search_title = $(this) + .find(".mec-form-row") + .text() + .toLowerCase(); + if ( + (!search_label || search_label == "") && + (!search_title || search_title == "") + ) { + return false; + } + if ( + $(this) + .find("label.mec-col-3") + .text() + .toLowerCase() + .indexOf(value) > -1 || + $(this) + .find("h4.mec-form-subtitle") + .text() + .toLowerCase() + .indexOf(value) > -1 || + $(this) + .find(".mec-form-row") + .text() + .toLowerCase() + .indexOf(value) > -1 + ) { + $(".mec-options-fields").hide(); + $(".mec-options-fields").removeClass("active"); + $( + ".wns-be-group-menu .subsection .mec-settings-menu li" + ).removeClass("active"); + elements.push($(this)); + } + }); + + $(".mec-settings-menu li").filter(function () { + var search_label = $(this).find("a").text().toLowerCase(); + var search_title = $(this).find("a span").text().toLowerCase(); + if ( + (!search_label || search_label == "") && + (!search_title || search_title == "") + ) { + return false; + } + if ( + $(this).find("a span").text().toLowerCase().indexOf(value) > -1 || + $(this).find("a span").text().toLowerCase().indexOf(value) > -1 + ) { + $(".mec-settings-menu li").removeClass("active"); + $( + ".wns-be-group-menu .subsection .mec-settings-menu li" + ).removeClass("active"); + elements.push($(this)); + } + }); + + $.each(elements, function (i, searchStr) { + searchStr.show(); + searchStr.addClass("active"); + }); + + jQuery("#wns-be-content .mec-form-row").each(function () { + if ( + value != "" && + $(this).text().search(new RegExp(value, "gi")) != -1 + ) { + jQuery(this).addClass("results"); + } else if (value != "" && $(this).text().search(value) != 1) { + jQuery(this).addClass("noresults"); + } + }); + + jQuery("#wns-be-content ul li").each(function () { + if ( + value != "" && + $(this).text().search(new RegExp(value, "gi")) != -1 + ) { + jQuery(this).addClass("enable"); + } else if (value != "" && $(this).text().search(value) != 1) { + jQuery(this).addClass("disable"); + } + }); + } + if (!value || value == "") { + jQuery(".results").removeClass("results"); + jQuery(".noresults").removeClass("noresults"); + jQuery(".enable").removeClass("enable"); + jQuery(".disable").removeClass("disable"); + } + }, + }); + } + + // Import Settings + function CheckJSON(text) { + if (typeof text != "string") text = JSON.stringify(text); + try { + JSON.parse(text); + return true; + } catch (e) { + return false; + } + } + + // Location select2 + jQuery(".mec-additional-locations select").select2(); + jQuery("#mec_location_id").select2(); + + // Organizer Select2 + jQuery(".mec-additional-organizers select").select2(); + jQuery("#mec_organizer_id").select2(); + + // Related Events Select2 + jQuery(".mec-related_events-dropdown-select2").select2({ + closeOnSelect: false, + }); + + // Add shortcode select2 + jQuery(".mec-create-shortcode-tab-content select").select2(); + + // General Calendar + jQuery("#mec_skin_general_calendar_skins").select2(); + + // Add Notification DropDown Select2 + jQuery(".mec-notification-dropdown-select2").select2({ + closeOnSelect: false, + width: "33%", + }); + + $(".mec-import-settings").on("click", function (e) { + e.preventDefault(); + var value = $(".mec-import-settings-content").val(); + if (CheckJSON(value) || value == "") { + value = jQuery.parseJSON($(".mec-import-settings-content").val()); + } else { + value = "No-JSON"; + } + $.ajax({ + url: mec_admin_localize.ajax_url, + type: "POST", + data: { + action: "import_settings", + nonce: mec_admin_localize.ajax_nonce, + content: value, + }, + beforeSend: function () { + $(".mec-import-settings-wrap").append( + '
    ' + ); + $(".mec-import-options-notification") + .find(".mec-message-import-error") + .remove(); + $(".mec-import-options-notification") + .find(".mec-message-import-success") + .remove(); + }, + success: function (response) { + $(".mec-import-options-notification").append(response); + $(".mec-loarder-wrap").remove(); + $(".mec-import-settings-content").val(""); + }, + }); + }); + + /* MEC activation */ + if ($("#MECActivation").length > 0) { + $("#MECActivation input[type=submit]").on("click", function (e) { + e.preventDefault(); + + // Define DOM + var Spinner = $(".wna-spinner-wrap"); + var LicenseField = $("#MECActivation .LicenseField"); + var PurchaseStatus = $("#MECActivation").find(".MECPurchaseStatus"); + var LicenseMessage = $("#MECActivation").find(".MECLicenseMessage"); + + // Global Actions + Spinner.remove(); + LicenseMessage.addClass("mec-message-hidden"); + PurchaseStatus.removeClass("PurchaseError"); + PurchaseStatus.removeClass("PurchaseSuccess"); + + // Basic Information + var PurchaseCode = $( + "#MECActivation input[type=password][name=MECPurchaseCode]" + ).val(); + var information = { LicenseTypeJson: "", PurchaseCodeJson: PurchaseCode }; + var ajaxAction = "activate_license"; + + if ($(this).hasClass("mec_revoke")) { + ajaxAction = "revoke_license"; + information = ""; + } + + $.ajax({ + url: mec_admin_localize.ajax_url, + type: "POST", + data: { + action: ajaxAction, + nonce: mec_admin_localize.ajax_nonce, + content: information, + }, + beforeSend: function () { + LicenseField.append( + '
    ' + ); + }, + success: function (response) { + const res = JSON.parse(response); + $(".wna-spinner-wrap").remove(); + + if (res.status === true) { + if (res.message == "success") { + PurchaseStatus.addClass("PurchaseSuccess"); + $("#MECActivation input[type=submit]") + .removeClass("mec_activate") + .addClass("mec_revoke") + .val(res.button_text); + } + + if (res.message == "revoked") { + PurchaseStatus.removeClass("PurchaseError").removeClass( + "PurchaseSuccess" + ); + $("#MECActivation input[type=submit]") + .removeClass("mec_revoke") + .addClass("mec_activate") + .val(res.button_text); + $( + "#MECActivation input[type=password][name=MECPurchaseCode]" + ).val(""); + } + } else { + $("#MECActivation input[type=submit]").text(res.button_text); + PurchaseStatus.removeClass("PurchaseSuccess").addClass( + "PurchaseError" + ); + LicenseMessage.removeClass("mec-message-hidden"); + } + }, + }); + }); + } + + /* Addons Activation */ + if ($(".box-addon-activation-toggle-head").length > 0) { + $(".box-addon-activation-toggle-head").on("click", function () { + $(".box-addon-activation-toggle-content").slideToggle("slow"); + if ($(this).find("i").hasClass("mec-sl-plus")) { + $(this).find("i").removeClass("mec-sl-plus").addClass("mec-sl-minus"); + } else if ($(this).find("i").hasClass("mec-sl-minus")) { + $(this).find("i").removeClass("mec-sl-minus").addClass("mec-sl-plus"); + } + }); + } + + /* Addons Notification */ + $(".mec-addons-notification-box-wrap span").on("click", function (e) { + e.preventDefault(); + $.ajax({ + url: mec_admin_localize.ajax_url, + type: "POST", + data: { + action: "close_notification", + nonce: mec_admin_localize.ajax_nonce, + }, + success: function (response) { + $(".mec-addons-notification-set-box").fadeOut(100, function () { + $(this).remove(); + }); + $(".mec-addons-notification-wrap").fadeOut(100, function () { + $(this).remove(); + }); + }, + }); + }); + + /* Custom msg Notification */ + $(".mec-cmsg-notification-box-wrap span").on("click", function (e) { + e.preventDefault(); + $.ajax({ + url: mec_admin_localize.ajax_url, + type: "POST", + data: { + action: "close_cmsg_notification", + nonce: mec_admin_localize.ajax_nonce, + }, + success: function (response) { + $(".mec-custom-msg-notification-set-box").fadeOut(100, function () { + $(this).remove(); + }); + $(".mec-custom-msg-notification-wrap").fadeOut(100, function () { + $(this).remove(); + }); + }, + }); + }); + + $(".mec-cmsg-2-notification-box-wrap span").on("click", function (e) { + e.preventDefault(); + $.ajax({ + url: mec_admin_localize.ajax_url, + type: "POST", + data: { + action: "close_cmsg_2_notification", + nonce: mec_admin_localize.ajax_nonce, + }, + success: function (response) { + $(".mec-custom-msg-2-notification-set-box").fadeOut(100, function () { + $(this).remove(); + }); + $(".mec-custom-msg-2-notification-wrap").fadeOut(100, function () { + $(this).remove(); + }); + }, + }); + }); + + let $event_selectbox = $(".mec-reports-selectbox-event"); + + /* Load event dates in Report page */ + if ($event_selectbox.length > 0) { + $event_selectbox.select2(); + $event_selectbox.on("change", function (e) { + e.preventDefault(); + var id = $event_selectbox.val(); + $.ajax({ + url: mec_admin_localize.ajax_url, + type: "POST", + data: { + action: "report_event_dates", + nonce: mec_admin_localize.ajax_nonce, + event_id: id, + }, + success: function (response) { + $(".mec-report-selected-event-attendees-wrap").hide(); + $(".mec-reports-selectbox-dates").remove(); + $( + ".mec-report-selected-event-attendees-wrap .w-row .w-col-sm-12" + ).html(""); + $(".mec-report-select-event-wrap .w-row .w-col-sm-12").append( + response + ); + $(".mec-report-sendmail-wrap").hide(); + $(".mec-report-backtoselect-wrap").hide(); + + $(window).trigger("mec_booking_report_change_event", response); + }, + }); + }); + + $event_selectbox.trigger("change"); + } + + $(".mec-report-backtoselect-wrap button").on("click", function (e) { + e.preventDefault(); + $(".mec-report-backtoselect-wrap").hide(); + $(".mec-report-sendmail-wrap").show(); + $(".mec-report-selected-event-attendees-wrap").show(); + $(".mec-report-sendmail-form-wrap").hide(); + }); + + // MEC Mass Action + $('#mec_report_mass_action_form').on('submit', function(e) + { + e.preventDefault(); + + const $form = $(this); + const $message = $('#mec_report_mass_message'); + + // Clear Message + $message.html(''); + + $.ajax({ + url: mec_admin_localize.ajax_url, + type: "POST", + data: $form.serialize(), + success: function (response) { + if(response.success) { + $message.html(`

    ${response.message}

    `); + } + }, + error: function () {}, + }); + }); + + // MEC fast copy by one click + $("#MECCopyCode").on("click", function () { + $(this).parent().find(".mec-copied").addClass("mec-copied-done"); + $(this).on("mouseleave", function () { + $(this).parent().find(".mec-copied").removeClass("mec-copied-done"); + }); + }); + + // Basic / Advanced Toggle + $(".mec-basvanced-toggle").each(function () { + const wrapper = $(this).data("for"); + const method = $(this).data("method"); + + $(this) + .find($(".mec-backend-tab-item")) + .on("click", function () { + // Already Active + if ($(this).hasClass("mec-b-active-tab")) return; + + $(this) + .parent() + .find($(".mec-b-active-tab")) + .removeClass("mec-b-active-tab"); + $(this).addClass("mec-b-active-tab"); + + if (method === "addition") { + $(wrapper).find($(".mec-basvanced-advanced")).toggleClass("w-hidden"); + } else { + $(wrapper).find($(".mec-basvanced-basic")).toggleClass("w-hidden"); + $(wrapper).find($(".mec-basvanced-advanced")).toggleClass("w-hidden"); + } + }); + }); + + // General Image picker + $(".mec-image-picker-wrapper").each(function () { + let $wrapper = $(this); + let $button = $wrapper.find($(".mec-image-picker-upload")); + let $preview = $wrapper.find($(".mec-image-picker-preview")); + let $previewWrapper = $wrapper.find($(".mec-image-picker-preview-wrapper")); + let $input = $wrapper.find($(".mec-image-picker-input")); + let $remove = $wrapper.find($(".mec-image-picker-remove")); + + $button.on("click", function () { + var frame; + if (frame) { + frame.open(); + return; + } + + frame = wp.media(); + frame.on("select", function () { + // Grab the selected attachment. + let attachment = frame.state().get("selection").first(); + + $preview.html(''); + $input.val(attachment.attributes.url); + + $button.toggleClass("w-hidden"); + $remove.toggleClass("w-hidden"); + $preview.toggleClass("w-hidden"); + + frame.close(); + }); + + frame.open(); + }); + + // General Image Remover + $remove.on("click", function (event) { + event.preventDefault(); + + $preview.html(""); + $input.val(""); + + $button.toggleClass("w-hidden"); + $remove.toggleClass("w-hidden"); + $preview.toggleClass("w-hidden"); + }); + }); + + // API Key + $('#mec_add_new_api_key').on('click', function() + { + const $wrapper = $('.mec-api-key-wrapper'); + const $new_id = $('#mec_next_api_key_id'); + const id = $new_id.val(); + + let key = ''; + const characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; + let counter = 0; + while (counter < 40) { + key += characters.charAt(Math.floor(Math.random() * characters.length)); + counter += 1; + } + + const html = $('#mec_api_key_template').html().replace(/:i:/g, id).replace(/:k:/g, key); + + $wrapper.append(html); + $new_id.val(parseInt(id) + 1); + }); +}); + +function mec_skin_full_calendar_skin_toggled(Context) { + var id = jQuery(Context).attr("id"); + var checked = jQuery(Context).is(":checked"); + var default_view = "list"; + + if (id === "mec_skin_full_calendar_list") { + jQuery(Context) + .parent() + .parent() + .parent() + .find(".mec-date-format") + .toggle(); + } else if (id === "mec_skin_full_calendar_grid") { + jQuery(Context) + .parent() + .parent() + .parent() + .find(".mec-date-format") + .toggle(); + default_view = "grid"; + } else if (id === "mec_skin_full_calendar_tile") { + default_view = "tile"; + } else if (id === "mec_skin_full_calendar_yearly") { + jQuery(Context) + .parent() + .parent() + .parent() + .find(".mec-date-format") + .toggle(); + default_view = "yearly"; + } else if (id === "mec_skin_full_calendar_monthly") { + jQuery("#mec_full_calendar_monthly_style").toggle(); + jQuery("#mec_full_calendar_monthly_view_options").toggle(); + default_view = "monthly"; + } else if (id === "mec_skin_full_calendar_weekly") { + default_view = "weekly"; + } else if (id === "mec_skin_full_calendar_daily") { + default_view = "daily"; + } + + var $dropdown = jQuery("#mec_skin_full_calendar_default_view"); + var current_value = $dropdown.find("option:selected").prop("value"); + var $option = $dropdown.find('option[value="' + default_view + '"]'); + + if (checked) $option.removeAttr("disabled"); + else $option.attr("disabled", "disabled"); + + if (current_value === default_view) + $dropdown.children("option:enabled").eq(0).prop("selected", true); + $dropdown.niceSelect("update"); +} + +function mec_event_attendees(ID, occurrence) { + // Set Occurrence + if (typeof occurrence === "undefined") occurrence = ""; + + jQuery.ajax({ + url: mec_admin_localize.ajax_url, + type: "POST", + dataType: "JSON", + data: { + action: "mec_attendees", + id: ID, + occurrence: occurrence, + }, + success: function (response) { + if (response.email_button != "") { + jQuery(".mec-report-selected-event-attendees-wrap").show(); + jQuery( + ".mec-report-selected-event-attendees-wrap .w-row .w-col-sm-12" + ).html(response.html); + jQuery(".mec-report-sendmail-wrap").show(); + jQuery(".mec-report-sendmail-wrap .w-row .w-col-sm-12").html( + response.email_button + ); + } else { + jQuery(".mec-report-selected-event-attendees-wrap").show(); + jQuery(".mec-report-sendmail-wrap").hide(); + jQuery( + ".mec-report-selected-event-attendees-wrap .w-row .w-col-sm-12" + ).html(response.html); + jQuery(".mec-report-sendmail-wrap .w-row .w-col-sm-12").html(""); + } + + jQuery(window).trigger("mec_booking_report_change_occurrence"); + }, + error: function () {}, + }); +} + +function mec_submit_event_email(ID) { + // Set Occurrence + if (typeof ID === "undefined") ID = ""; + + if (jQuery(".mec-send-email-count > span").text() == 0) { + alert("Please choose attendees first"); + return; + } + jQuery( + ".mec-report-sendmail-form-wrap .w-row .w-col-sm-12 #mec-send-email-editor-wrap" + ).attr("id", "mec-send-email-editor" + ID + "-wrap"); + jQuery(".mec-report-selected-event-attendees-wrap").hide(); + jQuery(".mec-report-sendmail-form-wrap").show(); + jQuery("#mec-send-email-editor" + ID + "-wrap").html( + '' + ); + jQuery("#mec-send-email-editor" + ID + "-wrap") + .parent() + .find(".mec-send-email-button") + .data("id", ID); + jQuery(".mec-report-sendmail-wrap").hide(); + jQuery(".mec-report-backtoselect-wrap").show(); + + wp.editor.initialize("editor" + ID, { + tinymce: { + wpautop: true, + toolbar1: + "formatselect bold italic | bullist numlist | blockquote | alignleft aligncenter alignright | link unlink | wp_more | spellchecker", + }, + quicktags: true, + mediaButtons: true, + }); +} + +function mec_certificate_send() { + const $checkboxes = jQuery( + ".mec-attendees-content input[type=checkbox]:checked" + ); + if ($checkboxes.length === 0) { + alert("Please choose attendees first."); + return; + } + + let template = jQuery("#certificate_select").val(); + if (!template) { + alert("Please choose a template."); + return; + } + + let attendee_ids = ""; + $checkboxes.each(function () { + attendee_ids += jQuery(this).data("attendee-id") + ","; + }); + + jQuery.ajax({ + url: mec_admin_localize.ajax_url, + type: "POST", + dataType: "JSON", + data: { + action: "mec_send_certificates", + template, + attendee_ids, + }, + success: function (response) { + $checkboxes.each(function () { + jQuery(this).removeAttr("checked"); + }); + + jQuery("#mec-certificate-message").html( + `
    ${response.message}
    ` + ); + }, + error: function () {}, + }); + + return true; +} + +function initSlider() { + jQuery(".mec-attendees-list-left-menu").owlCarousel({ + autoplay: false, + autoWidth: true, + items: 12, + responsiveClass: true, + responsive: { + 0: { + items: 1, + }, + 979: { + items: 2, + }, + 1199: { + items: 12, + }, + }, + dots: false, + nav: true, + }); +} + +function mec_skin_toggle() { + var skin = jQuery("#mec_skin").val(); + + jQuery(".mec-skin-options-container").hide(); + jQuery("#mec_" + skin + "_skin_options_container").show(); + + jQuery(".mec-search-form-options-container").hide(); + jQuery("#mec_" + skin + "_search_form_options_container").show(); + + // Show/Hide Filter Options + if (skin === "countdown" || skin === "cover" || skin === "available_spot") { + jQuery("#mec_meta_box_calendar_filter").hide(); + jQuery("#mec_meta_box_calendar_no_filter").show(); + } else { + jQuery("#mec_meta_box_calendar_no_filter").hide(); + jQuery("#mec_meta_box_calendar_filter").show(); + } + + // Show/Hide Search Widget Options + if ( + skin === "countdown" || + skin === "cover" || + skin === "available_spot" || + skin === "masonry" || + skin === "carousel" || + skin === "slider" || + skin === "timeline" + ) { + jQuery("#mec_calendar_search_form").hide(); + } else { + jQuery("#mec_calendar_search_form").show(); + } + + // Show/Hide Ongoing Events + if ( + skin === "list" || + skin === "weekly_view" || + skin === "agenda" || + skin === "timeline" || + skin === "monthly_view" || + skin === "timetable" || + skin === "slider" || + skin === "carousel" || + skin === "masonry" || + skin === "daily_view" || + skin === "tile" || + skin === "grid" || + skin === "yearly_view" || + skin === "custom" || + skin === "full_calendar" + ) { + jQuery("#mec_date_ongoing_filter").show(); + } else { + jQuery("#mec_show_only_ongoing_events").prop("checked", false); + jQuery("#mec_date_ongoing_filter").hide(); + } + + // Show/Hide Expired Events + if (skin === "map") { + jQuery("#mec_show_only_past_events").prop("checked", false); + jQuery("#mec_date_only_past_filter").hide(); + } else jQuery("#mec_date_only_past_filter").show(); + + // Trigger change event of skin style in order to show/hide related fields + jQuery("#mec_skin_" + skin + "_style").trigger("change"); +} + +function mec_skin_style_changed(skin, style, context) { + if (style.includes("fluent")) { + jQuery(".mec-" + skin + "-fluent").removeClass("mec-fluent-hidden"); + jQuery(".mec-not-" + skin + "-fluent").addClass("mec-fluent-hidden"); + } else { + jQuery(".mec-" + skin + "-fluent").addClass("mec-fluent-hidden"); + jQuery(".mec-not-" + skin + "-fluent").removeClass("mec-fluent-hidden"); + } + + jQuery(".mec-skin-" + skin + "-date-format-container").hide(); + jQuery("#mec_skin_" + skin + "_date_format_" + style + "_container").show(); + + // List Standard Progress Bar + if (skin === "list" && style === "standard") + jQuery(".mec-progress-bar-display-wrapper").removeClass("mec-util-hidden"); + else jQuery(".mec-progress-bar-display-wrapper").addClass("mec-util-hidden"); + + // List Standard Status Bar + if (skin === "list" && style === "standard") + jQuery(".mec-status-bar-display-wrapper").removeClass("mec-util-hidden"); + else jQuery(".mec-status-bar-display-wrapper").addClass("mec-util-hidden"); + + // Show Or Hide Include Events Time Switcher + if (style === "classic" || style === "minimal" || style === "modern") + jQuery(context).parent().parent().find(".mec-include-events-times").show(); + else + jQuery(context).parent().parent().find(".mec-include-events-times").hide(); + + if (style === "accordion") { + jQuery(context).parent().parent().find("#mec_skin_list_localtime").hide(); + jQuery(context).parent().parent().find(".mec-event-price-container").hide(); + } else { + jQuery(context).parent().parent().find("#mec_skin_list_localtime").show(); + jQuery(context).parent().parent().find(".mec-event-price-container").show(); + } + + let $mobile_clean_style; + if (skin === 'monthly_view') { + const $right_section = jQuery('.mec-display-events-right-section'); + $mobile_clean_style = jQuery('#mec_skin_monthly_view_mobile_clean_style_wrapper'); + + if(style === 'clean' || style === 'modern') + { + $right_section.show(); + $mobile_clean_style.hide(); + } + else + { + $right_section.hide(); + $mobile_clean_style.show(); + } + } + + if(skin === 'full_calendar') + { + $mobile_clean_style = jQuery("#mec_skin_full_calendar_mobile_clean_style_wrapper"); + const monthly_style = jQuery('#mec_skin_full_calendar_monthly_style').val(); + + if(monthly_style === 'clean' || monthly_style === 'modern') $mobile_clean_style.hide(); + else $mobile_clean_style.show(); + } + + jQuery(document).trigger("mec_skin_style_changed", [skin, style, context]); +} + +function mec_skin_map_toggle(context) { + jQuery(context) + .parent() + .parent() + .parent() + .find(".mec-set-geolocation") + .toggle(); +} + +function mec_skin_geolocation_toggle(context) { + jQuery(context) + .parent() + .parent() + .parent() + .parent() + .find(".mec-set-geolocation-focus") + .toggle(); +} + +function mec_show_widget_options(context) { + var skin = jQuery(context).find(jQuery(":selected")).data("skin"); + if (skin === "monthly_view") { + jQuery(context) + .parent() + .parent() + .find(jQuery(".mec-current-check-wrap")) + .show(); + jQuery(context) + .parent() + .parent() + .find(jQuery(".mec-grid-options-wrap")) + .hide(); + } else if (skin === "grid") { + jQuery(context) + .parent() + .parent() + .find(jQuery(".mec-current-check-wrap")) + .hide(); + jQuery(context) + .parent() + .parent() + .find(jQuery(".mec-grid-options-wrap")) + .show(); + } else { + jQuery(context) + .parent() + .parent() + .find(jQuery(".mec-current-check-wrap")) + .hide(); + jQuery(context) + .parent() + .parent() + .find(jQuery(".mec-grid-options-wrap")) + .hide(); + } +} + +// Niceselect +jQuery(document).ready(function () { + if (jQuery(".wn-mec-select").length > 0) + jQuery(".wn-mec-select").niceSelect(); + + // Send Custom Email To Attendees Button + jQuery(".mec-send-email-button").click(function () { + var $this = this; + var data_send = jQuery(".mec-attendees-content") + .find('input[type="checkbox"]:checked') + .parent() + .find(".mec-send-email-attendee-info") + .text(); + var mail_subject = jQuery("#mec-send-email-subject").val(); + var mail_content = wp.editor.getContent("editor" + jQuery(this).data("id")); + var mail_message = jQuery("#mec-send-email-message"); + var mail_copy = jQuery("#mec-send-admin-copy").is(":checked") ? 1 : 0; + + if (data_send.length == 0) + mail_message + .attr("class", "mec-util-hidden mec-error") + .html(jQuery("#mec-send-email-no-user-selected").val()) + .show(); + else if (mail_subject.length == 0) + mail_message + .attr("class", "mec-util-hidden mec-error") + .html(jQuery("#mec-send-email-empty-subject").val()) + .show(); + else if (mail_content.length == 0) + mail_message + .attr("class", "mec-util-hidden mec-error") + .html(jQuery("#mec-send-email-empty-content").val()) + .show(); + else { + mail_message.hide(); + jQuery($this).html(jQuery("#mec-send-email-label-loading").val()); + jQuery.ajax({ + url: mec_admin_localize.ajax_url, + type: "POST", + data: { + action: "mec_mass_email", + nonce: mec_admin_localize.ajax_nonce, + mail_recipients_info: data_send, + mail_subject: mail_subject, + mail_content: mail_content, + mail_copy: mail_copy, + }, + success: function (response) { + jQuery($this).html(jQuery("#mec-send-email-label").val()); + if (response == true) + mail_message + .attr("class", "mec-util-hidden mec-success") + .html(jQuery("#mec-send-email-success").val()) + .show(); + else + mail_message + .attr("class", "mec-util-hidden mec-error") + .html(jQuery("#mec-send-email-error").val()) + .show(); + }, + error: function () { + jQuery($this).html(jQuery("#mec-send-email-label").val()); + mail_message + .attr("class", "mec-util-hidden mec-error") + .html(jQuery("#mec-send-email-error").val()) + .show(); + }, + }); + } + }); + + jQuery(".mec-attendees-list-left-menu .owl-item").click(function () { + jQuery(this) + .parent() + .parent() + .parent() + .parent() + .parent() + .find(".mec-send-email-count > span") + .html(0); + }); +}); + +// MEC fast copy by one click +function mec_copy_code() { + var range = document.createRange(); + range.selectNode(document.getElementById("MECCopyCode")); + window.getSelection().removeAllRanges(); // clear current selection + window.getSelection().addRange(range); // to select text + document.execCommand("copy"); + window.getSelection().removeAllRanges(); // to deselect +} + +// Check All Send Custom Email To Attendees +function mec_send_email_check(Context) { + var all_item = jQuery(Context) + .parent() + .parent() + .parent() + .find(".mec-attendees-content"); + var item_len = all_item.find('input[type="checkbox"]').length; + var check_len = all_item.find('input[type="checkbox"]:checked').length; + var all_check = jQuery(Context) + .parent() + .parent() + .parent() + .find("#mec-send-email-check-all"); + + jQuery(".mec-send-email-count > span").html(check_len); + if (item_len === check_len) all_check.prop("checked", true); + else all_check.prop("checked", false); +} + +function mec_send_email_check_all(Context) { + var all_item = jQuery(Context) + .parent() + .parent() + .parent() + .parent() + .find(".mec-attendees-content"); + + if (jQuery(Context).is(":checked")) + all_item.find('input[type="checkbox"]').prop("checked", true); + else all_item.find('input[type="checkbox"]').prop("checked", false); + + var check_len = all_item.find('input[type="checkbox"]:checked').length; + jQuery(".mec-send-email-count > span").html(check_len); +} + +(function (wp, $) { + var items = ""; + if (typeof mec_admin_localize !== "undefined") + items = JSON.parse(mec_admin_localize.mce_items); + + // Block Editor + if (items && wp && wp.blocks) { + items.shortcodes.forEach(function (e, i) { + wp.blocks.registerBlockType(`mec/blockeditor-${i}`, { + title: items.shortcodes[i]["PN"] + .toLowerCase() + .replace(/(^([a-zA-Z\p{M}]))|([ -][a-zA-Z\p{M}])/g, function (s) { + return s.toUpperCase().replace(/-/g, " "); + }), + icon: "calendar-alt", + category: "mec.block.category", + edit: function () { + return `[MEC id="${items.shortcodes[i]["ID"]}"]`; + }, + save: function () { + return `[MEC id="${items.shortcodes[i]["ID"]}"]`; + }, + }); + }); + } +})(window.wp, jQuery); diff --git a/assets/js/chartjs.min.js b/assets/js/chartjs.min.js new file mode 100755 index 0000000..9ffb538 --- /dev/null +++ b/assets/js/chartjs.min.js @@ -0,0 +1,13 @@ +/*! + * Chart.js v3.7.1 + * https://www.chartjs.org + * (c) 2022 Chart.js Contributors + * Released under the MIT License + */ +!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Chart=e()}(this,(function(){"use strict";const t="undefined"==typeof window?function(t){return t()}:window.requestAnimationFrame;function e(e,i,s){const n=s||(t=>Array.prototype.slice.call(t));let o=!1,a=[];return function(...s){a=n(s),o||(o=!0,t.call(window,(()=>{o=!1,e.apply(i,a)})))}}function i(t,e){let i;return function(...s){return e?(clearTimeout(i),i=setTimeout(t,e,s)):t.apply(this,s),e}}const s=t=>"start"===t?"left":"end"===t?"right":"center",n=(t,e,i)=>"start"===t?e:"end"===t?i:(e+i)/2,o=(t,e,i,s)=>t===(s?"left":"right")?i:"center"===t?(e+i)/2:e;var a=new class{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,s){const n=e.listeners[s],o=e.duration;n.forEach((s=>s({chart:t,initial:e.initial,numSteps:o,currentStep:Math.min(i-e.start,o)})))}_refresh(){this._request||(this._running=!0,this._request=t.call(window,(()=>{this._update(),this._request=null,this._running&&this._refresh()})))}_update(t=Date.now()){let e=0;this._charts.forEach(((i,s)=>{if(!i.running||!i.items.length)return;const n=i.items;let o,a=n.length-1,r=!1;for(;a>=0;--a)o=n[a],o._active?(o._total>i.duration&&(i.duration=o._total),o.tick(t),r=!0):(n[a]=n[n.length-1],n.pop());r&&(s.draw(),this._notify(s,i,t,"progress")),n.length||(i.running=!1,this._notify(s,i,t,"complete"),i.initial=!1),e+=n.length})),this._lastDate=t,0===e&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){e&&e.length&&this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce(((t,e)=>Math.max(t,e._duration)),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!!(e&&e.running&&e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let s=i.length-1;for(;s>=0;--s)i[s].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}; +/*! + * @kurkle/color v0.1.9 + * https://github.com/kurkle/color#readme + * (c) 2020 Jukka Kurkela + * Released under the MIT License + */const r={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15},l="0123456789ABCDEF",h=t=>l[15&t],c=t=>l[(240&t)>>4]+l[15&t],d=t=>(240&t)>>4==(15&t);function u(t){var e=function(t){return d(t.r)&&d(t.g)&&d(t.b)&&d(t.a)}(t)?h:c;return t?"#"+e(t.r)+e(t.g)+e(t.b)+(t.a<255?e(t.a):""):t}function f(t){return t+.5|0}const g=(t,e,i)=>Math.max(Math.min(t,i),e);function p(t){return g(f(2.55*t),0,255)}function m(t){return g(f(255*t),0,255)}function x(t){return g(f(t/2.55)/100,0,1)}function b(t){return g(f(100*t),0,100)}const _=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;const y=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function v(t,e,i){const s=e*Math.min(i,1-i),n=(e,n=(e+t/30)%12)=>i-s*Math.max(Math.min(n-3,9-n,1),-1);return[n(0),n(8),n(4)]}function w(t,e,i){const s=(s,n=(s+t/60)%6)=>i-i*e*Math.max(Math.min(n,4-n,1),0);return[s(5),s(3),s(1)]}function M(t,e,i){const s=v(t,1,.5);let n;for(e+i>1&&(n=1/(e+i),e*=n,i*=n),n=0;n<3;n++)s[n]*=1-e-i,s[n]+=e;return s}function k(t){const e=t.r/255,i=t.g/255,s=t.b/255,n=Math.max(e,i,s),o=Math.min(e,i,s),a=(n+o)/2;let r,l,h;return n!==o&&(h=n-o,l=a>.5?h/(2-n-o):h/(n+o),r=n===e?(i-s)/h+(i>16&255,o>>8&255,255&o]}return t}(),T.transparent=[0,0,0,0]);const e=T[t.toLowerCase()];return e&&{r:e[0],g:e[1],b:e[2],a:4===e.length?e[3]:255}}function R(t,e,i){if(t){let s=k(t);s[e]=Math.max(0,Math.min(s[e]+s[e]*i,0===e?360:1)),s=P(s),t.r=s[0],t.g=s[1],t.b=s[2]}}function E(t,e){return t?Object.assign(e||{},t):t}function I(t){var e={r:0,g:0,b:0,a:255};return Array.isArray(t)?t.length>=3&&(e={r:t[0],g:t[1],b:t[2],a:255},t.length>3&&(e.a=m(t[3]))):(e=E(t,{r:0,g:0,b:0,a:1})).a=m(e.a),e}function z(t){return"r"===t.charAt(0)?function(t){const e=_.exec(t);let i,s,n,o=255;if(e){if(e[7]!==i){const t=+e[7];o=255&(e[8]?p(t):255*t)}return i=+e[1],s=+e[3],n=+e[5],i=255&(e[2]?p(i):i),s=255&(e[4]?p(s):s),n=255&(e[6]?p(n):n),{r:i,g:s,b:n,a:o}}}(t):C(t)}class F{constructor(t){if(t instanceof F)return t;const e=typeof t;let i;var s,n,o;"object"===e?i=I(t):"string"===e&&(o=(s=t).length,"#"===s[0]&&(4===o||5===o?n={r:255&17*r[s[1]],g:255&17*r[s[2]],b:255&17*r[s[3]],a:5===o?17*r[s[4]]:255}:7!==o&&9!==o||(n={r:r[s[1]]<<4|r[s[2]],g:r[s[3]]<<4|r[s[4]],b:r[s[5]]<<4|r[s[6]],a:9===o?r[s[7]]<<4|r[s[8]]:255})),i=n||L(t)||z(t)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var t=E(this._rgb);return t&&(t.a=x(t.a)),t}set rgb(t){this._rgb=I(t)}rgbString(){return this._valid?(t=this._rgb)&&(t.a<255?`rgba(${t.r}, ${t.g}, ${t.b}, ${x(t.a)})`:`rgb(${t.r}, ${t.g}, ${t.b})`):this._rgb;var t}hexString(){return this._valid?u(this._rgb):this._rgb}hslString(){return this._valid?function(t){if(!t)return;const e=k(t),i=e[0],s=b(e[1]),n=b(e[2]);return t.a<255?`hsla(${i}, ${s}%, ${n}%, ${x(t.a)})`:`hsl(${i}, ${s}%, ${n}%)`}(this._rgb):this._rgb}mix(t,e){const i=this;if(t){const s=i.rgb,n=t.rgb;let o;const a=e===o?.5:e,r=2*a-1,l=s.a-n.a,h=((r*l==-1?r:(r+l)/(1+r*l))+1)/2;o=1-h,s.r=255&h*s.r+o*n.r+.5,s.g=255&h*s.g+o*n.g+.5,s.b=255&h*s.b+o*n.b+.5,s.a=a*s.a+(1-a)*n.a,i.rgb=s}return i}clone(){return new F(this.rgb)}alpha(t){return this._rgb.a=m(t),this}clearer(t){return this._rgb.a*=1-t,this}greyscale(){const t=this._rgb,e=f(.3*t.r+.59*t.g+.11*t.b);return t.r=t.g=t.b=e,this}opaquer(t){return this._rgb.a*=1+t,this}negate(){const t=this._rgb;return t.r=255-t.r,t.g=255-t.g,t.b=255-t.b,this}lighten(t){return R(this._rgb,2,t),this}darken(t){return R(this._rgb,2,-t),this}saturate(t){return R(this._rgb,1,t),this}desaturate(t){return R(this._rgb,1,-t),this}rotate(t){return function(t,e){var i=k(t);i[0]=D(i[0]+e),i=P(i),t.r=i[0],t.g=i[1],t.b=i[2]}(this._rgb,t),this}}function B(t){return new F(t)}const V=t=>t instanceof CanvasGradient||t instanceof CanvasPattern;function W(t){return V(t)?t:B(t)}function N(t){return V(t)?t:B(t).saturate(.5).darken(.1).hexString()}function H(){}const j=function(){let t=0;return function(){return t++}}();function $(t){return null==t}function Y(t){if(Array.isArray&&Array.isArray(t))return!0;const e=Object.prototype.toString.call(t);return"[object"===e.substr(0,7)&&"Array]"===e.substr(-6)}function U(t){return null!==t&&"[object Object]"===Object.prototype.toString.call(t)}const X=t=>("number"==typeof t||t instanceof Number)&&isFinite(+t);function q(t,e){return X(t)?t:e}function K(t,e){return void 0===t?e:t}const G=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100:t/e,Z=(t,e)=>"string"==typeof t&&t.endsWith("%")?parseFloat(t)/100*e:+t;function J(t,e,i){if(t&&"function"==typeof t.call)return t.apply(i,e)}function Q(t,e,i,s){let n,o,a;if(Y(t))if(o=t.length,s)for(n=o-1;n>=0;n--)e.call(i,t[n],n);else for(n=0;ni;)t=t[e.substr(i,s-i)],i=s+1,s=rt(e,i);return t}function ht(t){return t.charAt(0).toUpperCase()+t.slice(1)}const ct=t=>void 0!==t,dt=t=>"function"==typeof t,ut=(t,e)=>{if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0};function ft(t){return"mouseup"===t.type||"click"===t.type||"contextmenu"===t.type}const gt=Object.create(null),pt=Object.create(null);function mt(t,e){if(!e)return t;const i=e.split(".");for(let e=0,s=i.length;et.chart.platform.getDevicePixelRatio(),this.elements={},this.events=["mousemove","mouseout","click","touchstart","touchmove"],this.font={family:"'Helvetica Neue', 'Helvetica', 'Arial', sans-serif",size:12,style:"normal",lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(t,e)=>N(e.backgroundColor),this.hoverBorderColor=(t,e)=>N(e.borderColor),this.hoverColor=(t,e)=>N(e.color),this.indexAxis="x",this.interaction={mode:"nearest",intersect:!0},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={},this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(t)}set(t,e){return xt(this,t,e)}get(t){return mt(this,t)}describe(t,e){return xt(pt,t,e)}override(t,e){return xt(gt,t,e)}route(t,e,i,s){const n=mt(this,t),o=mt(this,i),a="_"+e;Object.defineProperties(n,{[a]:{value:n[e],writable:!0},[e]:{enumerable:!0,get(){const t=this[a],e=o[s];return U(t)?Object.assign({},e,t):K(t,e)},set(t){this[a]=t}}})}}({_scriptable:t=>!t.startsWith("on"),_indexable:t=>"events"!==t,hover:{_fallback:"interaction"},interaction:{_scriptable:!1,_indexable:!1}});const _t=Math.PI,yt=2*_t,vt=yt+_t,wt=Number.POSITIVE_INFINITY,Mt=_t/180,kt=_t/2,St=_t/4,Pt=2*_t/3,Dt=Math.log10,Ct=Math.sign;function Ot(t){const e=Math.round(t);t=Lt(t,e,t/1e3)?e:t;const i=Math.pow(10,Math.floor(Dt(t))),s=t/i;return(s<=1?1:s<=2?2:s<=5?5:10)*i}function At(t){const e=[],i=Math.sqrt(t);let s;for(s=1;st-e)).pop(),e}function Tt(t){return!isNaN(parseFloat(t))&&isFinite(t)}function Lt(t,e,i){return Math.abs(t-e)=t}function Et(t,e,i){let s,n,o;for(s=0,n=t.length;sl&&h=Math.min(e,i)-s&&t<=Math.max(e,i)+s}function Ut(t){return!t||$(t.size)||$(t.family)?null:(t.style?t.style+" ":"")+(t.weight?t.weight+" ":"")+t.size+"px "+t.family}function Xt(t,e,i,s,n){let o=e[n];return o||(o=e[n]=t.measureText(n).width,i.push(n)),o>s&&(s=o),s}function qt(t,e,i,s){let n=(s=s||{}).data=s.data||{},o=s.garbageCollect=s.garbageCollect||[];s.font!==e&&(n=s.data={},o=s.garbageCollect=[],s.font=e),t.save(),t.font=e;let a=0;const r=i.length;let l,h,c,d,u;for(l=0;li.length){for(l=0;l0&&t.stroke()}}function Jt(t,e,i){return i=i||.5,!e||t&&t.x>e.left-i&&t.xe.top-i&&t.y0&&""!==o.strokeColor;let l,h;for(t.save(),t.font=n.string,function(t,e){e.translation&&t.translate(e.translation[0],e.translation[1]);$(e.rotation)||t.rotate(e.rotation);e.color&&(t.fillStyle=e.color);e.textAlign&&(t.textAlign=e.textAlign);e.textBaseline&&(t.textBaseline=e.textBaseline)}(t,o),l=0;lt[i]1;)s=o+n>>1,i(s)?o=s:n=s;return{lo:o,hi:n}}const re=(t,e,i)=>ae(t,i,(s=>t[s][e]ae(t,i,(s=>t[s][e]>=i));function he(t,e,i){let s=0,n=t.length;for(;ss&&t[n-1]>i;)n--;return s>0||n{const i="_onData"+ht(e),s=t[e];Object.defineProperty(t,e,{configurable:!0,enumerable:!1,value(...e){const n=s.apply(this,e);return t._chartjs.listeners.forEach((t=>{"function"==typeof t[i]&&t[i](...e)})),n}})})))}function ue(t,e){const i=t._chartjs;if(!i)return;const s=i.listeners,n=s.indexOf(e);-1!==n&&s.splice(n,1),s.length>0||(ce.forEach((e=>{delete t[e]})),delete t._chartjs)}function fe(t){const e=new Set;let i,s;for(i=0,s=t.length;iwindow.getComputedStyle(t,null);function be(t,e){return xe(t).getPropertyValue(e)}const _e=["top","right","bottom","left"];function ye(t,e,i){const s={};i=i?"-"+i:"";for(let n=0;n<4;n++){const o=_e[n];s[o]=parseFloat(t[e+"-"+o+i])||0}return s.width=s.left+s.right,s.height=s.top+s.bottom,s}function ve(t,e){const{canvas:i,currentDevicePixelRatio:s}=e,n=xe(i),o="border-box"===n.boxSizing,a=ye(n,"padding"),r=ye(n,"border","width"),{x:l,y:h,box:c}=function(t,e){const i=t.native||t,s=i.touches,n=s&&s.length?s[0]:i,{offsetX:o,offsetY:a}=n;let r,l,h=!1;if(((t,e,i)=>(t>0||e>0)&&(!i||!i.shadowRoot))(o,a,i.target))r=o,l=a;else{const t=e.getBoundingClientRect();r=n.clientX-t.left,l=n.clientY-t.top,h=!0}return{x:r,y:l,box:h}}(t,i),d=a.left+(c&&r.left),u=a.top+(c&&r.top);let{width:f,height:g}=e;return o&&(f-=a.width+r.width,g-=a.height+r.height),{x:Math.round((l-d)/f*i.width/s),y:Math.round((h-u)/g*i.height/s)}}const we=t=>Math.round(10*t)/10;function Me(t,e,i,s){const n=xe(t),o=ye(n,"margin"),a=me(n.maxWidth,t,"clientWidth")||wt,r=me(n.maxHeight,t,"clientHeight")||wt,l=function(t,e,i){let s,n;if(void 0===e||void 0===i){const o=pe(t);if(o){const t=o.getBoundingClientRect(),a=xe(o),r=ye(a,"border","width"),l=ye(a,"padding");e=t.width-l.width-r.width,i=t.height-l.height-r.height,s=me(a.maxWidth,o,"clientWidth"),n=me(a.maxHeight,o,"clientHeight")}else e=t.clientWidth,i=t.clientHeight}return{width:e,height:i,maxWidth:s||wt,maxHeight:n||wt}}(t,e,i);let{width:h,height:c}=l;if("content-box"===n.boxSizing){const t=ye(n,"border","width"),e=ye(n,"padding");h-=e.width+t.width,c-=e.height+t.height}return h=Math.max(0,h-o.width),c=Math.max(0,s?Math.floor(h/s):c-o.height),h=we(Math.min(h,a,l.maxWidth)),c=we(Math.min(c,r,l.maxHeight)),h&&!c&&(c=we(h/2)),{width:h,height:c}}function ke(t,e,i){const s=e||1,n=Math.floor(t.height*s),o=Math.floor(t.width*s);t.height=n/s,t.width=o/s;const a=t.canvas;return a.style&&(i||!a.style.height&&!a.style.width)&&(a.style.height=`${t.height}px`,a.style.width=`${t.width}px`),(t.currentDevicePixelRatio!==s||a.height!==n||a.width!==o)&&(t.currentDevicePixelRatio=s,a.height=n,a.width=o,t.ctx.setTransform(s,0,0,s,0,0),!0)}const Se=function(){let t=!1;try{const e={get passive(){return t=!0,!1}};window.addEventListener("test",null,e),window.removeEventListener("test",null,e)}catch(t){}return t}();function Pe(t,e){const i=be(t,e),s=i&&i.match(/^(\d+)(\.\d+)?px$/);return s?+s[1]:void 0}function De(t,e){return"native"in t?{x:t.x,y:t.y}:ve(t,e)}function Ce(t,e,i,s){const{controller:n,data:o,_sorted:a}=t,r=n._cachedMeta.iScale;if(r&&e===r.axis&&"r"!==e&&a&&o.length){const t=r._reversePixels?le:re;if(!s)return t(o,e,i);if(n._sharedOptions){const s=o[0],n="function"==typeof s.getRange&&s.getRange(e);if(n){const s=t(o,e,i-n),a=t(o,e,i+n);return{lo:s.lo,hi:a.hi}}}}return{lo:0,hi:o.length-1}}function Oe(t,e,i,s,n){const o=t.getSortedVisibleDatasetMetas(),a=i[e];for(let t=0,i=o.length;t{t[r](n[a],s)&&o.push({element:t,datasetIndex:e,index:i}),t.inRange(n.x,n.y,s)&&(l=!0)})),i.intersect&&!l?[]:o}var Ee={modes:{index(t,e,i,s){const n=De(e,t),o=i.axis||"x",a=i.intersect?Ae(t,n,o,s):Le(t,n,o,!1,s),r=[];return a.length?(t.getSortedVisibleDatasetMetas().forEach((t=>{const e=a[0].index,i=t.data[e];i&&!i.skip&&r.push({element:i,datasetIndex:t.index,index:e})})),r):[]},dataset(t,e,i,s){const n=De(e,t),o=i.axis||"xy";let a=i.intersect?Ae(t,n,o,s):Le(t,n,o,!1,s);if(a.length>0){const e=a[0].datasetIndex,i=t.getDatasetMeta(e).data;a=[];for(let t=0;tAe(t,De(e,t),i.axis||"xy",s),nearest:(t,e,i,s)=>Le(t,De(e,t),i.axis||"xy",i.intersect,s),x:(t,e,i,s)=>Re(t,e,{axis:"x",intersect:i.intersect},s),y:(t,e,i,s)=>Re(t,e,{axis:"y",intersect:i.intersect},s)}};const Ie=new RegExp(/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/),ze=new RegExp(/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/);function Fe(t,e){const i=(""+t).match(Ie);if(!i||"normal"===i[1])return 1.2*e;switch(t=+i[2],i[3]){case"px":return t;case"%":t/=100}return e*t}function Be(t,e){const i={},s=U(e),n=s?Object.keys(e):e,o=U(t)?s?i=>K(t[i],t[e[i]]):e=>t[e]:()=>t;for(const t of n)i[t]=+o(t)||0;return i}function Ve(t){return Be(t,{top:"y",right:"x",bottom:"y",left:"x"})}function We(t){return Be(t,["topLeft","topRight","bottomLeft","bottomRight"])}function Ne(t){const e=Ve(t);return e.width=e.left+e.right,e.height=e.top+e.bottom,e}function He(t,e){t=t||{},e=e||bt.font;let i=K(t.size,e.size);"string"==typeof i&&(i=parseInt(i,10));let s=K(t.style,e.style);s&&!(""+s).match(ze)&&(console.warn('Invalid font style specified: "'+s+'"'),s="");const n={family:K(t.family,e.family),lineHeight:Fe(K(t.lineHeight,e.lineHeight),i),size:i,style:s,weight:K(t.weight,e.weight),string:""};return n.string=Ut(n),n}function je(t,e,i,s){let n,o,a,r=!0;for(n=0,o=t.length;ni&&0===t?0:t+e;return{min:a(s,-Math.abs(o)),max:a(n,o)}}function Ye(t,e){return Object.assign(Object.create(t),e)}const Ue=["left","top","right","bottom"];function Xe(t,e){return t.filter((t=>t.pos===e))}function qe(t,e){return t.filter((t=>-1===Ue.indexOf(t.pos)&&t.box.axis===e))}function Ke(t,e){return t.sort(((t,i)=>{const s=e?i:t,n=e?t:i;return s.weight===n.weight?s.index-n.index:s.weight-n.weight}))}function Ge(t,e){const i=function(t){const e={};for(const i of t){const{stack:t,pos:s,stackWeight:n}=i;if(!t||!Ue.includes(s))continue;const o=e[t]||(e[t]={count:0,placed:0,weight:0,size:0});o.count++,o.weight+=n}return e}(t),{vBoxMaxWidth:s,hBoxMaxHeight:n}=e;let o,a,r;for(o=0,a=t.length;o{s[t]=Math.max(e[t],i[t])})),s}return s(t?["left","right"]:["top","bottom"])}function ei(t,e,i,s){const n=[];let o,a,r,l,h,c;for(o=0,a=t.length,h=0;ot.box.fullSize)),!0),s=Ke(Xe(e,"left"),!0),n=Ke(Xe(e,"right")),o=Ke(Xe(e,"top"),!0),a=Ke(Xe(e,"bottom")),r=qe(e,"x"),l=qe(e,"y");return{fullSize:i,leftAndTop:s.concat(o),rightAndBottom:n.concat(l).concat(a).concat(r),chartArea:Xe(e,"chartArea"),vertical:s.concat(n).concat(l),horizontal:o.concat(a).concat(r)}}(t.boxes),l=r.vertical,h=r.horizontal;Q(t.boxes,(t=>{"function"==typeof t.beforeLayout&&t.beforeLayout()}));const c=l.reduce(((t,e)=>e.box.options&&!1===e.box.options.display?t:t+1),0)||1,d=Object.freeze({outerWidth:e,outerHeight:i,padding:n,availableWidth:o,availableHeight:a,vBoxMaxWidth:o/2/c,hBoxMaxHeight:a/2}),u=Object.assign({},n);Je(u,Ne(s));const f=Object.assign({maxPadding:u,w:o,h:a,x:n.left,y:n.top},n),g=Ge(l.concat(h),d);ei(r.fullSize,f,d,g),ei(l,f,d,g),ei(h,f,d,g)&&ei(l,f,d,g),function(t){const e=t.maxPadding;function i(i){const s=Math.max(e[i]-t[i],0);return t[i]+=s,s}t.y+=i("top"),t.x+=i("left"),i("right"),i("bottom")}(f),si(r.leftAndTop,f,d,g),f.x+=f.w,f.y+=f.h,si(r.rightAndBottom,f,d,g),t.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},Q(r.chartArea,(e=>{const i=e.box;Object.assign(i,t.chartArea),i.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})}))}};function oi(t,e=[""],i=t,s,n=(()=>t[0])){ct(s)||(s=mi("_fallback",t));const o={[Symbol.toStringTag]:"Object",_cacheable:!0,_scopes:t,_rootScopes:i,_fallback:s,_getTarget:n,override:n=>oi([n,...t],e,i,s)};return new Proxy(o,{deleteProperty:(e,i)=>(delete e[i],delete e._keys,delete t[0][i],!0),get:(i,s)=>ci(i,s,(()=>function(t,e,i,s){let n;for(const o of e)if(n=mi(li(o,t),i),ct(n))return hi(t,n)?gi(i,s,t,n):n}(s,e,t,i))),getOwnPropertyDescriptor:(t,e)=>Reflect.getOwnPropertyDescriptor(t._scopes[0],e),getPrototypeOf:()=>Reflect.getPrototypeOf(t[0]),has:(t,e)=>xi(t).includes(e),ownKeys:t=>xi(t),set(t,e,i){const s=t._storage||(t._storage=n());return t[e]=s[e]=i,delete t._keys,!0}})}function ai(t,e,i,s){const n={_cacheable:!1,_proxy:t,_context:e,_subProxy:i,_stack:new Set,_descriptors:ri(t,s),setContext:e=>ai(t,e,i,s),override:n=>ai(t.override(n),e,i,s)};return new Proxy(n,{deleteProperty:(e,i)=>(delete e[i],delete t[i],!0),get:(t,e,i)=>ci(t,e,(()=>function(t,e,i){const{_proxy:s,_context:n,_subProxy:o,_descriptors:a}=t;let r=s[e];dt(r)&&a.isScriptable(e)&&(r=function(t,e,i,s){const{_proxy:n,_context:o,_subProxy:a,_stack:r}=i;if(r.has(t))throw new Error("Recursion detected: "+Array.from(r).join("->")+"->"+t);r.add(t),e=e(o,a||s),r.delete(t),hi(t,e)&&(e=gi(n._scopes,n,t,e));return e}(e,r,t,i));Y(r)&&r.length&&(r=function(t,e,i,s){const{_proxy:n,_context:o,_subProxy:a,_descriptors:r}=i;if(ct(o.index)&&s(t))e=e[o.index%e.length];else if(U(e[0])){const i=e,s=n._scopes.filter((t=>t!==i));e=[];for(const l of i){const i=gi(s,n,t,l);e.push(ai(i,o,a&&a[t],r))}}return e}(e,r,t,a.isIndexable));hi(e,r)&&(r=ai(r,n,o&&o[e],a));return r}(t,e,i))),getOwnPropertyDescriptor:(e,i)=>e._descriptors.allKeys?Reflect.has(t,i)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(t,i),getPrototypeOf:()=>Reflect.getPrototypeOf(t),has:(e,i)=>Reflect.has(t,i),ownKeys:()=>Reflect.ownKeys(t),set:(e,i,s)=>(t[i]=s,delete e[i],!0)})}function ri(t,e={scriptable:!0,indexable:!0}){const{_scriptable:i=e.scriptable,_indexable:s=e.indexable,_allKeys:n=e.allKeys}=t;return{allKeys:n,scriptable:i,indexable:s,isScriptable:dt(i)?i:()=>i,isIndexable:dt(s)?s:()=>s}}const li=(t,e)=>t?t+ht(e):e,hi=(t,e)=>U(e)&&"adapters"!==t&&(null===Object.getPrototypeOf(e)||e.constructor===Object);function ci(t,e,i){if(Object.prototype.hasOwnProperty.call(t,e))return t[e];const s=i();return t[e]=s,s}function di(t,e,i){return dt(t)?t(e,i):t}const ui=(t,e)=>!0===t?e:"string"==typeof t?lt(e,t):void 0;function fi(t,e,i,s,n){for(const o of e){const e=ui(i,o);if(e){t.add(e);const o=di(e._fallback,i,n);if(ct(o)&&o!==i&&o!==s)return o}else if(!1===e&&ct(s)&&i!==s)return null}return!1}function gi(t,e,i,s){const n=e._rootScopes,o=di(e._fallback,i,s),a=[...t,...n],r=new Set;r.add(s);let l=pi(r,a,i,o||i,s);return null!==l&&((!ct(o)||o===i||(l=pi(r,a,o,l,s),null!==l))&&oi(Array.from(r),[""],n,o,(()=>function(t,e,i){const s=t._getTarget();e in s||(s[e]={});const n=s[e];if(Y(n)&&U(i))return i;return n}(e,i,s))))}function pi(t,e,i,s,n){for(;i;)i=fi(t,e,i,s,n);return i}function mi(t,e){for(const i of e){if(!i)continue;const e=i[t];if(ct(e))return e}}function xi(t){let e=t._keys;return e||(e=t._keys=function(t){const e=new Set;for(const i of t)for(const t of Object.keys(i).filter((t=>!t.startsWith("_"))))e.add(t);return Array.from(e)}(t._scopes)),e}const bi=Number.EPSILON||1e-14,_i=(t,e)=>e"x"===t?"y":"x";function vi(t,e,i,s){const n=t.skip?e:t,o=e,a=i.skip?e:i,r=Vt(o,n),l=Vt(a,o);let h=r/(r+l),c=l/(r+l);h=isNaN(h)?0:h,c=isNaN(c)?0:c;const d=s*h,u=s*c;return{previous:{x:o.x-d*(a.x-n.x),y:o.y-d*(a.y-n.y)},next:{x:o.x+u*(a.x-n.x),y:o.y+u*(a.y-n.y)}}}function wi(t,e="x"){const i=yi(e),s=t.length,n=Array(s).fill(0),o=Array(s);let a,r,l,h=_i(t,0);for(a=0;a!t.skip))),"monotone"===e.cubicInterpolationMode)wi(t,n);else{let i=s?t[t.length-1]:t[0];for(o=0,a=t.length;o0===t||1===t,Pi=(t,e,i)=>-Math.pow(2,10*(t-=1))*Math.sin((t-e)*yt/i),Di=(t,e,i)=>Math.pow(2,-10*t)*Math.sin((t-e)*yt/i)+1,Ci={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>-t*(t-2),easeInOutQuad:t=>(t/=.5)<1?.5*t*t:-.5*(--t*(t-2)-1),easeInCubic:t=>t*t*t,easeOutCubic:t=>(t-=1)*t*t+1,easeInOutCubic:t=>(t/=.5)<1?.5*t*t*t:.5*((t-=2)*t*t+2),easeInQuart:t=>t*t*t*t,easeOutQuart:t=>-((t-=1)*t*t*t-1),easeInOutQuart:t=>(t/=.5)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2),easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>(t-=1)*t*t*t*t+1,easeInOutQuint:t=>(t/=.5)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2),easeInSine:t=>1-Math.cos(t*kt),easeOutSine:t=>Math.sin(t*kt),easeInOutSine:t=>-.5*(Math.cos(_t*t)-1),easeInExpo:t=>0===t?0:Math.pow(2,10*(t-1)),easeOutExpo:t=>1===t?1:1-Math.pow(2,-10*t),easeInOutExpo:t=>Si(t)?t:t<.5?.5*Math.pow(2,10*(2*t-1)):.5*(2-Math.pow(2,-10*(2*t-1))),easeInCirc:t=>t>=1?t:-(Math.sqrt(1-t*t)-1),easeOutCirc:t=>Math.sqrt(1-(t-=1)*t),easeInOutCirc:t=>(t/=.5)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1),easeInElastic:t=>Si(t)?t:Pi(t,.075,.3),easeOutElastic:t=>Si(t)?t:Di(t,.075,.3),easeInOutElastic(t){const e=.1125;return Si(t)?t:t<.5?.5*Pi(2*t,e,.45):.5+.5*Di(2*t-1,e,.45)},easeInBack(t){const e=1.70158;return t*t*((e+1)*t-e)},easeOutBack(t){const e=1.70158;return(t-=1)*t*((e+1)*t+e)+1},easeInOutBack(t){let e=1.70158;return(t/=.5)<1?t*t*((1+(e*=1.525))*t-e)*.5:.5*((t-=2)*t*((1+(e*=1.525))*t+e)+2)},easeInBounce:t=>1-Ci.easeOutBounce(1-t),easeOutBounce(t){const e=7.5625,i=2.75;return t<1/i?e*t*t:t<2/i?e*(t-=1.5/i)*t+.75:t<2.5/i?e*(t-=2.25/i)*t+.9375:e*(t-=2.625/i)*t+.984375},easeInOutBounce:t=>t<.5?.5*Ci.easeInBounce(2*t):.5*Ci.easeOutBounce(2*t-1)+.5};function Oi(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:t.y+i*(e.y-t.y)}}function Ai(t,e,i,s){return{x:t.x+i*(e.x-t.x),y:"middle"===s?i<.5?t.y:e.y:"after"===s?i<1?t.y:e.y:i>0?e.y:t.y}}function Ti(t,e,i,s){const n={x:t.cp2x,y:t.cp2y},o={x:e.cp1x,y:e.cp1y},a=Oi(t,n,i),r=Oi(n,o,i),l=Oi(o,e,i),h=Oi(a,r,i),c=Oi(r,l,i);return Oi(h,c,i)}const Li=new Map;function Ri(t,e,i){return function(t,e){e=e||{};const i=t+JSON.stringify(e);let s=Li.get(i);return s||(s=new Intl.NumberFormat(t,e),Li.set(i,s)),s}(e,i).format(t)}function Ei(t,e,i){return t?function(t,e){return{x:i=>t+t+e-i,setWidth(t){e=t},textAlign:t=>"center"===t?t:"right"===t?"left":"right",xPlus:(t,e)=>t-e,leftForLtr:(t,e)=>t-e}}(e,i):{x:t=>t,setWidth(t){},textAlign:t=>t,xPlus:(t,e)=>t+e,leftForLtr:(t,e)=>t}}function Ii(t,e){let i,s;"ltr"!==e&&"rtl"!==e||(i=t.canvas.style,s=[i.getPropertyValue("direction"),i.getPropertyPriority("direction")],i.setProperty("direction",e,"important"),t.prevTextDirection=s)}function zi(t,e){void 0!==e&&(delete t.prevTextDirection,t.canvas.style.setProperty("direction",e[0],e[1]))}function Fi(t){return"angle"===t?{between:Ht,compare:Wt,normalize:Nt}:{between:Yt,compare:(t,e)=>t-e,normalize:t=>t}}function Bi({start:t,end:e,count:i,loop:s,style:n}){return{start:t%i,end:e%i,loop:s&&(e-t+1)%i==0,style:n}}function Vi(t,e,i){if(!i)return[t];const{property:s,start:n,end:o}=i,a=e.length,{compare:r,between:l,normalize:h}=Fi(s),{start:c,end:d,loop:u,style:f}=function(t,e,i){const{property:s,start:n,end:o}=i,{between:a,normalize:r}=Fi(s),l=e.length;let h,c,{start:d,end:u,loop:f}=t;if(f){for(d+=l,u+=l,h=0,c=l;hb||l(n,x,p)&&0!==r(n,x),v=()=>!b||0===r(o,p)||l(o,x,p);for(let t=c,i=c;t<=d;++t)m=e[t%a],m.skip||(p=h(m[s]),p!==x&&(b=l(p,n,o),null===_&&y()&&(_=0===r(p,n)?t:i),null!==_&&v()&&(g.push(Bi({start:_,end:t,loop:u,count:a,style:f})),_=null),i=t,x=p));return null!==_&&g.push(Bi({start:_,end:d,loop:u,count:a,style:f})),g}function Wi(t,e){const i=[],s=t.segments;for(let n=0;nn&&t[o%e].skip;)o--;return o%=e,{start:n,end:o}}(i,n,o,s);if(!0===s)return Hi(t,[{start:a,end:r,loop:o}],i,e);return Hi(t,function(t,e,i,s){const n=t.length,o=[];let a,r=e,l=t[e];for(a=e+1;a<=i;++a){const i=t[a%n];i.skip||i.stop?l.skip||(s=!1,o.push({start:e%n,end:(a-1)%n,loop:s}),e=r=i.stop?a:null):(r=a,l.skip&&(e=a)),l=i}return null!==r&&o.push({start:e%n,end:r%n,loop:s}),o}(i,a,rnull===t||""===t;const Gi=!!Se&&{passive:!0};function Zi(t,e,i){t.canvas.removeEventListener(e,i,Gi)}function Ji(t,e){for(const i of t)if(i===e||i.contains(e))return!0}function Qi(t,e,i){const s=t.canvas,n=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||Ji(i.addedNodes,s),e=e&&!Ji(i.removedNodes,s);e&&i()}));return n.observe(document,{childList:!0,subtree:!0}),n}function ts(t,e,i){const s=t.canvas,n=new MutationObserver((t=>{let e=!1;for(const i of t)e=e||Ji(i.removedNodes,s),e=e&&!Ji(i.addedNodes,s);e&&i()}));return n.observe(document,{childList:!0,subtree:!0}),n}const es=new Map;let is=0;function ss(){const t=window.devicePixelRatio;t!==is&&(is=t,es.forEach(((e,i)=>{i.currentDevicePixelRatio!==t&&e()})))}function ns(t,i,s){const n=t.canvas,o=n&&pe(n);if(!o)return;const a=e(((t,e)=>{const i=o.clientWidth;s(t,e),i{const e=t[0],i=e.contentRect.width,s=e.contentRect.height;0===i&&0===s||a(i,s)}));return r.observe(o),function(t,e){es.size||window.addEventListener("resize",ss),es.set(t,e)}(t,a),r}function os(t,e,i){i&&i.disconnect(),"resize"===e&&function(t){es.delete(t),es.size||window.removeEventListener("resize",ss)}(t)}function as(t,i,s){const n=t.canvas,o=e((e=>{null!==t.ctx&&s(function(t,e){const i=qi[t.type]||t.type,{x:s,y:n}=ve(t,e);return{type:i,chart:e,native:t,x:void 0!==s?s:null,y:void 0!==n?n:null}}(e,t))}),t,(t=>{const e=t[0];return[e,e.offsetX,e.offsetY]}));return function(t,e,i){t.addEventListener(e,i,Gi)}(n,i,o),o}class rs extends Ui{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(function(t,e){const i=t.style,s=t.getAttribute("height"),n=t.getAttribute("width");if(t.$chartjs={initial:{height:s,width:n,style:{display:i.display,height:i.height,width:i.width}}},i.display=i.display||"block",i.boxSizing=i.boxSizing||"border-box",Ki(n)){const e=Pe(t,"width");void 0!==e&&(t.width=e)}if(Ki(s))if(""===t.style.height)t.height=t.width/(e||2);else{const e=Pe(t,"height");void 0!==e&&(t.height=e)}}(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e.$chartjs)return!1;const i=e.$chartjs.initial;["height","width"].forEach((t=>{const s=i[t];$(s)?e.removeAttribute(t):e.setAttribute(t,s)}));const s=i.style||{};return Object.keys(s).forEach((t=>{e.style[t]=s[t]})),e.width=e.width,delete e.$chartjs,!0}addEventListener(t,e,i){this.removeEventListener(t,e);const s=t.$proxies||(t.$proxies={}),n={attach:Qi,detach:ts,resize:ns}[e]||as;s[e]=n(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),s=i[e];if(!s)return;({attach:os,detach:os,resize:os}[e]||Zi)(t,e,s),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,s){return Me(t,e,i,s)}isAttached(t){const e=pe(t);return!(!e||!e.isConnected)}}function ls(t){return!ge()||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas?Xi:rs}var hs=Object.freeze({__proto__:null,_detectPlatform:ls,BasePlatform:Ui,BasicPlatform:Xi,DomPlatform:rs});const cs="transparent",ds={boolean:(t,e,i)=>i>.5?e:t,color(t,e,i){const s=W(t||cs),n=s.valid&&W(e||cs);return n&&n.valid?n.mix(s,i).hexString():e},number:(t,e,i)=>t+(e-t)*i};class us{constructor(t,e,i,s){const n=e[i];s=je([t.to,s,n,t.from]);const o=je([t.from,n,s]);this._active=!0,this._fn=t.fn||ds[t.type||typeof o],this._easing=Ci[t.easing]||Ci.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=o,this._to=s,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const s=this._target[this._prop],n=i-this._start,o=this._duration-n;this._start=i,this._duration=Math.floor(Math.max(o,t.duration)),this._total+=n,this._loop=!!t.loop,this._to=je([t.to,e,s,t.from]),this._from=je([t.from,s,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,s=this._prop,n=this._from,o=this._loop,a=this._to;let r;if(this._active=n!==a&&(o||e1?2-r:r,r=this._easing(Math.min(1,Math.max(0,r))),this._target[s]=this._fn(n,a,r))}wait(){const t=this._promises||(this._promises=[]);return new Promise(((e,i)=>{t.push({res:e,rej:i})}))}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let t=0;t"onProgress"!==t&&"onComplete"!==t&&"fn"!==t}),bt.set("animations",{colors:{type:"color",properties:["color","borderColor","backgroundColor"]},numbers:{type:"number",properties:["x","y","borderWidth","radius","tension"]}}),bt.describe("animations",{_fallback:"animation"}),bt.set("transitions",{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:"transparent"},visible:{type:"boolean",duration:0}}},hide:{animations:{colors:{to:"transparent"},visible:{type:"boolean",easing:"linear",fn:t=>0|t}}}});class gs{constructor(t,e){this._chart=t,this._properties=new Map,this.configure(e)}configure(t){if(!U(t))return;const e=this._properties;Object.getOwnPropertyNames(t).forEach((i=>{const s=t[i];if(!U(s))return;const n={};for(const t of fs)n[t]=s[t];(Y(s.properties)&&s.properties||[i]).forEach((t=>{t!==i&&e.has(t)||e.set(t,n)}))}))}_animateOptions(t,e){const i=e.options,s=function(t,e){if(!e)return;let i=t.options;if(!i)return void(t.options=e);i.$shared&&(t.options=i=Object.assign({},i,{$shared:!1,$animations:{}}));return i}(t,i);if(!s)return[];const n=this._createAnimations(s,i);return i.$shared&&function(t,e){const i=[],s=Object.keys(e);for(let e=0;e{t.options=i}),(()=>{})),n}_createAnimations(t,e){const i=this._properties,s=[],n=t.$animations||(t.$animations={}),o=Object.keys(e),a=Date.now();let r;for(r=o.length-1;r>=0;--r){const l=o[r];if("$"===l.charAt(0))continue;if("options"===l){s.push(...this._animateOptions(t,e));continue}const h=e[l];let c=n[l];const d=i.get(l);if(c){if(d&&c.active()){c.update(d,h,a);continue}c.cancel()}d&&d.duration?(n[l]=c=new us(d,t,l,h),s.push(c)):t[l]=h}return s}update(t,e){if(0===this._properties.size)return void Object.assign(t,e);const i=this._createAnimations(t,e);return i.length?(a.add(this._chart,i),!0):void 0}}function ps(t,e){const i=t&&t.options||{},s=i.reverse,n=void 0===i.min?e:0,o=void 0===i.max?e:0;return{start:s?o:n,end:s?n:o}}function ms(t,e){const i=[],s=t._getSortedDatasetMetas(e);let n,o;for(n=0,o=s.length;n0||!i&&e<0)return n.index}return null}function vs(t,e){const{chart:i,_cachedMeta:s}=t,n=i._stacks||(i._stacks={}),{iScale:o,vScale:a,index:r}=s,l=o.axis,h=a.axis,c=function(t,e,i){return`${t.id}.${e.id}.${i.stack||i.type}`}(o,a,s),d=e.length;let u;for(let t=0;ti[t].axis===e)).shift()}function Ms(t,e){const i=t.controller.index,s=t.vScale&&t.vScale.axis;if(s){e=e||t._parsed;for(const t of e){const e=t._stacks;if(!e||void 0===e[s]||void 0===e[s][i])return;delete e[s][i]}}}const ks=t=>"reset"===t||"none"===t,Ss=(t,e)=>e?t:Object.assign({},t);class Ps{constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.$context=void 0,this._syncList=[],this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=bs(t.vScale,t),this.addElements()}updateIndex(t){this.index!==t&&Ms(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),s=(t,e,i,s)=>"x"===t?e:"r"===t?s:i,n=e.xAxisID=K(i.xAxisID,ws(t,"x")),o=e.yAxisID=K(i.yAxisID,ws(t,"y")),a=e.rAxisID=K(i.rAxisID,ws(t,"r")),r=e.indexAxis,l=e.iAxisID=s(r,n,o,a),h=e.vAxisID=s(r,o,n,a);e.xScale=this.getScaleForId(n),e.yScale=this.getScaleForId(o),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(l),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&ue(this._data,this),t._stacked&&Ms(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(U(e))this._data=function(t){const e=Object.keys(t),i=new Array(e.length);let s,n,o;for(s=0,n=e.length;s0&&i._parsed[t-1];if(!1===this._parsing)i._parsed=s,i._sorted=!0,h=s;else{h=Y(s[t])?this.parseArrayData(i,s,t,e):U(s[t])?this.parseObjectData(i,s,t,e):this.parsePrimitiveData(i,s,t,e);const n=()=>null===l[a]||d&&l[a]t&&!e.hidden&&e._stacked&&{keys:ms(i,!0),values:null})(e,i,this.chart),l={min:Number.POSITIVE_INFINITY,max:Number.NEGATIVE_INFINITY},{min:h,max:c}=function(t){const{min:e,max:i,minDefined:s,maxDefined:n}=t.getUserBounds();return{min:s?e:Number.NEGATIVE_INFINITY,max:n?i:Number.POSITIVE_INFINITY}}(a);let d,u;function f(){u=s[d];const e=u[a.axis];return!X(u[t.axis])||h>e||c=0;--d)if(!f()){this.updateRangeFromParsed(l,t,u,r);break}return l}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let s,n,o;for(s=0,n=e.length;s=0&&tthis.getContext(i,s)),c);return f.$shared&&(f.$shared=r,n[o]=Object.freeze(Ss(f,r))),f}_resolveAnimations(t,e,i){const s=this.chart,n=this._cachedDataOpts,o=`animation-${e}`,a=n[o];if(a)return a;let r;if(!1!==s.options.animation){const s=this.chart.config,n=s.datasetAnimationScopeKeys(this._type,e),o=s.getOptionScopes(this.getDataset(),n);r=s.createResolver(o,this.getContext(t,i,e))}const l=new gs(s,r&&r.animations);return r&&r._cacheable&&(n[o]=Object.freeze(l)),l}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ks(t)||this.chart._animationsDisabled}updateElement(t,e,i,s){ks(s)?Object.assign(t,i):this._resolveAnimations(e,s).update(t,i)}updateSharedOptions(t,e,i){t&&!ks(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,s){t.active=s;const n=this.getStyle(e,s);this._resolveAnimations(e,i,s).update(t,{options:!s&&this.getSharedOptions(n)||n})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[t,e,i]of this._syncList)this[t](e,i);this._syncList=[];const s=i.length,n=e.length,o=Math.min(n,s);o&&this.parse(0,o),n>s?this._insertElements(s,n-s,t):n{for(t.length+=e,a=t.length-1;a>=o;a--)t[a]=t[a-e]};for(r(n),a=t;a{s[t]=i[t]&&i[t].active()?i[t]._to:this[t]})),s}}Ds.defaults={},Ds.defaultRoutes=void 0;const Cs={values:t=>Y(t)?t:""+t,numeric(t,e,i){if(0===t)return"0";const s=this.chart.options.locale;let n,o=t;if(i.length>1){const e=Math.max(Math.abs(i[0].value),Math.abs(i[i.length-1].value));(e<1e-4||e>1e15)&&(n="scientific"),o=function(t,e){let i=e.length>3?e[2].value-e[1].value:e[1].value-e[0].value;Math.abs(i)>=1&&t!==Math.floor(t)&&(i=t-Math.floor(t));return i}(t,i)}const a=Dt(Math.abs(o)),r=Math.max(Math.min(-1*Math.floor(a),20),0),l={notation:n,minimumFractionDigits:r,maximumFractionDigits:r};return Object.assign(l,this.options.ticks.format),Ri(t,s,l)},logarithmic(t,e,i){if(0===t)return"0";const s=t/Math.pow(10,Math.floor(Dt(t)));return 1===s||2===s||5===s?Cs.numeric.call(this,t,e,i):""}};var Os={formatters:Cs};function As(t,e){const i=t.options.ticks,s=i.maxTicksLimit||function(t){const e=t.options.offset,i=t._tickSize(),s=t._length/i+(e?0:1),n=t._maxLength/i;return Math.floor(Math.min(s,n))}(t),n=i.major.enabled?function(t){const e=[];let i,s;for(i=0,s=t.length;is)return function(t,e,i,s){let n,o=0,a=i[0];for(s=Math.ceil(s),n=0;nn)return e}return Math.max(n,1)}(n,e,s);if(o>0){let t,i;const s=o>1?Math.round((r-a)/(o-1)):null;for(Ts(e,l,h,$(s)?0:a-s,a),t=0,i=o-1;te.lineWidth,tickColor:(t,e)=>e.color,offset:!1,borderDash:[],borderDashOffset:0,borderWidth:1},title:{display:!1,text:"",padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:"",padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:Os.formatters.values,minor:{},major:{},align:"center",crossAlign:"near",showLabelBackdrop:!1,backdropColor:"rgba(255, 255, 255, 0.75)",backdropPadding:2}}),bt.route("scale.ticks","color","","color"),bt.route("scale.grid","color","","borderColor"),bt.route("scale.grid","borderColor","","borderColor"),bt.route("scale.title","color","","color"),bt.describe("scale",{_fallback:!1,_scriptable:t=>!t.startsWith("before")&&!t.startsWith("after")&&"callback"!==t&&"parser"!==t,_indexable:t=>"borderDash"!==t&&"tickBorderDash"!==t}),bt.describe("scales",{_fallback:"scale"}),bt.describe("scale.ticks",{_scriptable:t=>"backdropPadding"!==t&&"callback"!==t,_indexable:t=>"backdropPadding"!==t});const Ls=(t,e,i)=>"top"===e||"left"===e?t[e]+i:t[e]-i;function Rs(t,e){const i=[],s=t.length/e,n=t.length;let o=0;for(;oa+r)))return h}function Is(t){return t.drawTicks?t.tickLength:0}function zs(t,e){if(!t.display)return 0;const i=He(t.font,e),s=Ne(t.padding);return(Y(t.text)?t.text.length:1)*i.lineHeight+s.height}function Fs(t,e,i){let n=s(t);return(i&&"right"!==e||!i&&"right"===e)&&(n=(t=>"left"===t?"right":"right"===t?"left":t)(n)),n}class Bs extends Ds{constructor(t){super(),this.id=t.id,this.type=t.type,this.options=void 0,this.ctx=t.ctx,this.chart=t.chart,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this._margins={left:0,right:0,top:0,bottom:0},this.maxWidth=void 0,this.maxHeight=void 0,this.paddingTop=void 0,this.paddingBottom=void 0,this.paddingLeft=void 0,this.paddingRight=void 0,this.axis=void 0,this.labelRotation=void 0,this.min=void 0,this.max=void 0,this._range=void 0,this.ticks=[],this._gridLineItems=null,this._labelItems=null,this._labelSizes=null,this._length=0,this._maxLength=0,this._longestTextCache={},this._startPixel=void 0,this._endPixel=void 0,this._reversePixels=!1,this._userMax=void 0,this._userMin=void 0,this._suggestedMax=void 0,this._suggestedMin=void 0,this._ticksLength=0,this._borderValue=0,this._cache={},this._dataLimitsCached=!1,this.$context=void 0}init(t){this.options=t.setContext(this.getContext()),this.axis=t.axis,this._userMin=this.parse(t.min),this._userMax=this.parse(t.max),this._suggestedMin=this.parse(t.suggestedMin),this._suggestedMax=this.parse(t.suggestedMax)}parse(t,e){return t}getUserBounds(){let{_userMin:t,_userMax:e,_suggestedMin:i,_suggestedMax:s}=this;return t=q(t,Number.POSITIVE_INFINITY),e=q(e,Number.NEGATIVE_INFINITY),i=q(i,Number.POSITIVE_INFINITY),s=q(s,Number.NEGATIVE_INFINITY),{min:q(t,i),max:q(e,s),minDefined:X(t),maxDefined:X(e)}}getMinMax(t){let e,{min:i,max:s,minDefined:n,maxDefined:o}=this.getUserBounds();if(n&&o)return{min:i,max:s};const a=this.getMatchingVisibleMetas();for(let r=0,l=a.length;rs?s:i,s=n&&i>s?i:s,{min:q(i,q(s,i)),max:q(s,q(i,s))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){J(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:s,grace:n,ticks:o}=this.options,a=o.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=$e(this,n,s),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const r=a=n||i<=1||!this.isHorizontal())return void(this.labelRotation=s);const h=this._getLabelSizes(),c=h.widest.width,d=h.highest.height,u=jt(this.chart.width-c,0,this.maxWidth);o=t.offset?this.maxWidth/i:u/(i-1),c+6>o&&(o=u/(i-(t.offset?.5:1)),a=this.maxHeight-Is(t.grid)-e.padding-zs(t.title,this.chart.options.font),r=Math.sqrt(c*c+d*d),l=zt(Math.min(Math.asin(jt((h.highest.height+6)/o,-1,1)),Math.asin(jt(a/r,-1,1))-Math.asin(jt(d/r,-1,1)))),l=Math.max(s,Math.min(n,l))),this.labelRotation=l}afterCalculateLabelRotation(){J(this.options.afterCalculateLabelRotation,[this])}beforeFit(){J(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:s,grid:n}}=this,o=this._isVisible(),a=this.isHorizontal();if(o){const o=zs(s,e.options.font);if(a?(t.width=this.maxWidth,t.height=Is(n)+o):(t.height=this.maxHeight,t.width=Is(n)+o),i.display&&this.ticks.length){const{first:e,last:s,widest:n,highest:o}=this._getLabelSizes(),r=2*i.padding,l=It(this.labelRotation),h=Math.cos(l),c=Math.sin(l);if(a){const e=i.mirror?0:c*n.width+h*o.height;t.height=Math.min(this.maxHeight,t.height+e+r)}else{const e=i.mirror?0:h*n.width+c*o.height;t.width=Math.min(this.maxWidth,t.width+e+r)}this._calculatePadding(e,s,c,h)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,s){const{ticks:{align:n,padding:o},position:a}=this.options,r=0!==this.labelRotation,l="top"!==a&&"x"===this.axis;if(this.isHorizontal()){const a=this.getPixelForTick(0)-this.left,h=this.right-this.getPixelForTick(this.ticks.length-1);let c=0,d=0;r?l?(c=s*t.width,d=i*e.height):(c=i*t.height,d=s*e.width):"start"===n?d=e.width:"end"===n?c=t.width:(c=t.width/2,d=e.width/2),this.paddingLeft=Math.max((c-a+o)*this.width/(this.width-a),0),this.paddingRight=Math.max((d-h+o)*this.width/(this.width-h),0)}else{let i=e.height/2,s=t.height/2;"start"===n?(i=0,s=t.height):"end"===n&&(i=e.height,s=0),this.paddingTop=i+o,this.paddingBottom=s+o}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){J(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return"top"===e||"bottom"===e||"x"===t}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){let e,i;for(this.beforeTickToLabelConversion(),this.generateTickLabels(t),e=0,i=t.length;e{const i=t.gc,s=i.length/2;let n;if(s>e){for(n=0;n({width:n[t]||0,height:o[t]||0});return{first:v(0),last:v(e-1),widest:v(_),highest:v(y),widths:n,heights:o}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return $t(this._alignToPixels?Kt(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&ta*s?a/i:r/s:r*s0}_computeGridLineItems(t){const e=this.axis,i=this.chart,s=this.options,{grid:n,position:o}=s,a=n.offset,r=this.isHorizontal(),l=this.ticks.length+(a?1:0),h=Is(n),c=[],d=n.setContext(this.getContext()),u=d.drawBorder?d.borderWidth:0,f=u/2,g=function(t){return Kt(i,t,u)};let p,m,x,b,_,y,v,w,M,k,S,P;if("top"===o)p=g(this.bottom),y=this.bottom-h,w=p-f,k=g(t.top)+f,P=t.bottom;else if("bottom"===o)p=g(this.top),k=t.top,P=g(t.bottom)-f,y=p+f,w=this.top+h;else if("left"===o)p=g(this.right),_=this.right-h,v=p-f,M=g(t.left)+f,S=t.right;else if("right"===o)p=g(this.left),M=t.left,S=g(t.right)-f,_=p+f,v=this.left+h;else if("x"===e){if("center"===o)p=g((t.top+t.bottom)/2+.5);else if(U(o)){const t=Object.keys(o)[0],e=o[t];p=g(this.chart.scales[t].getPixelForValue(e))}k=t.top,P=t.bottom,y=p+f,w=y+h}else if("y"===e){if("center"===o)p=g((t.left+t.right)/2);else if(U(o)){const t=Object.keys(o)[0],e=o[t];p=g(this.chart.scales[t].getPixelForValue(e))}_=p-f,v=_-h,M=t.left,S=t.right}const D=K(s.ticks.maxTicksLimit,l),C=Math.max(1,Math.ceil(l/D));for(m=0;me.value===t));if(i>=0){return e.setContext(this.getContext(i)).lineWidth}return 0}drawGrid(t){const e=this.options.grid,i=this.ctx,s=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let n,o;const a=(t,e,s)=>{s.width&&s.color&&(i.save(),i.lineWidth=s.width,i.strokeStyle=s.color,i.setLineDash(s.borderDash||[]),i.lineDashOffset=s.borderDashOffset,i.beginPath(),i.moveTo(t.x,t.y),i.lineTo(e.x,e.y),i.stroke(),i.restore())};if(e.display)for(n=0,o=s.length;n{this.drawBackground(),this.drawGrid(t),this.drawTitle()}},{z:i+1,draw:()=>{this.drawBorder()}},{z:e,draw:t=>{this.drawLabels(t)}}]:[{z:e,draw:t=>{this.draw(t)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",s=[];let n,o;for(n=0,o=e.length;n{const s=i.split("."),n=s.pop(),o=[t].concat(s).join("."),a=e[i].split("."),r=a.pop(),l=a.join(".");bt.route(o,n,l,r)}))}(e,t.defaultRoutes);t.descriptors&&bt.describe(e,t.descriptors)}(t,o,i),this.override&&bt.override(t.id,t.overrides)),o}get(t){return this.items[t]}unregister(t){const e=this.items,i=t.id,s=this.scope;i in e&&delete e[i],s&&i in bt[s]&&(delete bt[s][i],this.override&&delete gt[i])}}var Ws=new class{constructor(){this.controllers=new Vs(Ps,"datasets",!0),this.elements=new Vs(Ds,"elements"),this.plugins=new Vs(Object,"plugins"),this.scales=new Vs(Bs,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach((e=>{const s=i||this._getRegistryForType(e);i||s.isForType(e)||s===this.plugins&&e.id?this._exec(t,s,e):Q(e,(e=>{const s=i||this._getRegistryForType(e);this._exec(t,s,e)}))}))}_exec(t,e,i){const s=ht(t);J(i["before"+s],[],i),e[t](i),J(i["after"+s],[],i)}_getRegistryForType(t){for(let e=0;et.filter((t=>!e.some((e=>t.plugin.id===e.plugin.id))));this._notify(s(e,i),t,"stop"),this._notify(s(i,e),t,"start")}}function Hs(t,e){return e||!1!==t?!0===t?{}:t:null}function js(t,e,i,s){const n=t.pluginScopeKeys(e),o=t.getOptionScopes(i,n);return t.createResolver(o,s,[""],{scriptable:!1,indexable:!1,allKeys:!0})}function $s(t,e){const i=bt.datasets[t]||{};return((e.datasets||{})[t]||{}).indexAxis||e.indexAxis||i.indexAxis||"x"}function Ys(t,e){return"x"===t||"y"===t?t:e.axis||("top"===(i=e.position)||"bottom"===i?"x":"left"===i||"right"===i?"y":void 0)||t.charAt(0).toLowerCase();var i}function Us(t){const e=t.options||(t.options={});e.plugins=K(e.plugins,{}),e.scales=function(t,e){const i=gt[t.type]||{scales:{}},s=e.scales||{},n=$s(t.type,e),o=Object.create(null),a=Object.create(null);return Object.keys(s).forEach((t=>{const e=s[t];if(!U(e))return console.error(`Invalid scale configuration for scale: ${t}`);if(e._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${t}`);const r=Ys(t,e),l=function(t,e){return t===e?"_index_":"_value_"}(r,n),h=i.scales||{};o[r]=o[r]||t,a[t]=ot(Object.create(null),[{axis:r},e,h[r],h[l]])})),t.data.datasets.forEach((i=>{const n=i.type||t.type,r=i.indexAxis||$s(n,e),l=(gt[n]||{}).scales||{};Object.keys(l).forEach((t=>{const e=function(t,e){let i=t;return"_index_"===t?i=e:"_value_"===t&&(i="x"===e?"y":"x"),i}(t,r),n=i[e+"AxisID"]||o[e]||e;a[n]=a[n]||Object.create(null),ot(a[n],[{axis:e},s[n],l[t]])}))})),Object.keys(a).forEach((t=>{const e=a[t];ot(e,[bt.scales[e.type],bt.scale])})),a}(t,e)}function Xs(t){return(t=t||{}).datasets=t.datasets||[],t.labels=t.labels||[],t}const qs=new Map,Ks=new Set;function Gs(t,e){let i=qs.get(t);return i||(i=e(),qs.set(t,i),Ks.add(i)),i}const Zs=(t,e,i)=>{const s=lt(e,i);void 0!==s&&t.add(s)};class Js{constructor(t){this._config=function(t){return(t=t||{}).data=Xs(t.data),Us(t),t}(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=Xs(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),Us(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return Gs(t,(()=>[[`datasets.${t}`,""]]))}datasetAnimationScopeKeys(t,e){return Gs(`${t}.transition.${e}`,(()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]]))}datasetElementScopeKeys(t,e){return Gs(`${t}-${e}`,(()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]]))}pluginScopeKeys(t){const e=t.id;return Gs(`${this.type}-plugin-${e}`,(()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]]))}_cachedScopes(t,e){const i=this._scopeCache;let s=i.get(t);return s&&!e||(s=new Map,i.set(t,s)),s}getOptionScopes(t,e,i){const{options:s,type:n}=this,o=this._cachedScopes(t,i),a=o.get(e);if(a)return a;const r=new Set;e.forEach((e=>{t&&(r.add(t),e.forEach((e=>Zs(r,t,e)))),e.forEach((t=>Zs(r,s,t))),e.forEach((t=>Zs(r,gt[n]||{},t))),e.forEach((t=>Zs(r,bt,t))),e.forEach((t=>Zs(r,pt,t)))}));const l=Array.from(r);return 0===l.length&&l.push(Object.create(null)),Ks.has(e)&&o.set(e,l),l}chartOptionScopes(){const{options:t,type:e}=this;return[t,gt[e]||{},bt.datasets[e]||{},{type:e},bt,pt]}resolveNamedOptions(t,e,i,s=[""]){const n={$shared:!0},{resolver:o,subPrefixes:a}=Qs(this._resolverCache,t,s);let r=o;if(function(t,e){const{isScriptable:i,isIndexable:s}=ri(t);for(const n of e){const e=i(n),o=s(n),a=(o||e)&&t[n];if(e&&(dt(a)||tn(a))||o&&Y(a))return!0}return!1}(o,e)){n.$shared=!1;r=ai(o,i=dt(i)?i():i,this.createResolver(t,i,a))}for(const t of e)n[t]=r[t];return n}createResolver(t,e,i=[""],s){const{resolver:n}=Qs(this._resolverCache,t,i);return U(e)?ai(n,e,void 0,s):n}}function Qs(t,e,i){let s=t.get(e);s||(s=new Map,t.set(e,s));const n=i.join();let o=s.get(n);if(!o){o={resolver:oi(e,i),subPrefixes:i.filter((t=>!t.toLowerCase().includes("hover")))},s.set(n,o)}return o}const tn=t=>U(t)&&Object.getOwnPropertyNames(t).reduce(((e,i)=>e||dt(t[i])),!1);const en=["top","bottom","left","right","chartArea"];function sn(t,e){return"top"===t||"bottom"===t||-1===en.indexOf(t)&&"x"===e}function nn(t,e){return function(i,s){return i[t]===s[t]?i[e]-s[e]:i[t]-s[t]}}function on(t){const e=t.chart,i=e.options.animation;e.notifyPlugins("afterRender"),J(i&&i.onComplete,[t],e)}function an(t){const e=t.chart,i=e.options.animation;J(i&&i.onProgress,[t],e)}function rn(t){return ge()&&"string"==typeof t?t=document.getElementById(t):t&&t.length&&(t=t[0]),t&&t.canvas&&(t=t.canvas),t}const ln={},hn=t=>{const e=rn(t);return Object.values(ln).filter((t=>t.canvas===e)).pop()};function cn(t,e,i){const s=Object.keys(t);for(const n of s){const s=+n;if(s>=e){const o=t[n];delete t[n],(i>0||s>e)&&(t[s+i]=o)}}}class dn{constructor(t,e){const s=this.config=new Js(e),n=rn(t),o=hn(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas can be reused.");const r=s.createResolver(s.chartOptionScopes(),this.getContext());this.platform=new(s.platform||ls(n)),this.platform.updateConfig(s);const l=this.platform.acquireContext(n,r.aspectRatio),h=l&&l.canvas,c=h&&h.height,d=h&&h.width;this.id=j(),this.ctx=l,this.canvas=h,this.width=d,this.height=c,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new Ns,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=i((t=>this.update(t)),r.resizeDelay||0),this._dataChanges=[],ln[this.id]=this,l&&h?(a.listen(this,"complete",on),a.listen(this,"progress",an),this._initialize(),this.attached&&this.update()):console.error("Failed to create chart: can't acquire context from the given item")}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:s,_aspectRatio:n}=this;return $(t)?e&&n?n:s?i/s:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():ke(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Gt(this.canvas,this.ctx),this}stop(){return a.stop(this),this}resize(t,e){a.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,s=this.canvas,n=i.maintainAspectRatio&&this.aspectRatio,o=this.platform.getMaximumSize(s,t,e,n),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),r=this.width?"resize":"attach";this.width=o.width,this.height=o.height,this._aspectRatio=this.aspectRatio,ke(this,a,!0)&&(this.notifyPlugins("resize",{size:o}),J(i.onResize,[this,o],this),this.attached&&this._doResize(r)&&this.render())}ensureScalesHaveIDs(){Q(this.options.scales||{},((t,e)=>{t.id=e}))}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,s=Object.keys(i).reduce(((t,e)=>(t[e]=!1,t)),{});let n=[];e&&(n=n.concat(Object.keys(e).map((t=>{const i=e[t],s=Ys(t,i),n="r"===s,o="x"===s;return{options:i,dposition:n?"chartArea":o?"bottom":"left",dtype:n?"radialLinear":o?"category":"linear"}})))),Q(n,(e=>{const n=e.options,o=n.id,a=Ys(o,n),r=K(n.type,e.dtype);void 0!==n.position&&sn(n.position,a)===sn(e.dposition)||(n.position=e.dposition),s[o]=!0;let l=null;if(o in i&&i[o].type===r)l=i[o];else{l=new(Ws.getScale(r))({id:o,type:r,ctx:this.ctx,chart:this}),i[l.id]=l}l.init(n,t)})),Q(s,((t,e)=>{t||delete i[e]})),Q(i,(t=>{ni.configure(this,t,t.options),ni.addBox(this,t)}))}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort(((t,e)=>t.index-e.index)),i>e){for(let t=e;te.length&&delete this._stacks,t.forEach(((t,i)=>{0===e.filter((e=>e===t._dataset)).length&&this._destroyDatasetMeta(i)}))}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,s;for(this._removeUnreferencedMetasets(),i=0,s=e.length;i{this.getDatasetMeta(e).controller.reset()}),this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),s=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),!1===this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0}))return;const n=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let o=0;for(let t=0,e=this.data.datasets.length;t{t.reset()})),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(nn("z","_idx"));const{_active:a,_lastEvent:r}=this;r?this._eventHandler(r,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){Q(this.scales,(t=>{ni.removeBox(this,t)})),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);ut(e,i)&&!!this._responsiveListeners===t.responsive||(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:s,count:n}of e){cn(t,s,"_removeElements"===i?-n:n)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=e=>new Set(t.filter((t=>t[0]===e)).map(((t,e)=>e+","+t.splice(1).join(",")))),s=i(0);for(let t=1;tt.split(","))).map((t=>({method:t[1],start:+t[2],count:+t[3]})))}_updateLayout(t){if(!1===this.notifyPlugins("beforeLayout",{cancelable:!0}))return;ni.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],Q(this.boxes,(t=>{i&&"chartArea"===t.position||(t.configure&&t.configure(),this._layers.push(...t._layers()))}),this),this._layers.forEach(((t,e)=>{t._idx=e})),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(!1!==this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})){for(let t=0,e=this.data.datasets.length;t=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,s=!i.disabled,n=this.chartArea,o={meta:t,index:t.index,cancelable:!0};!1!==this.notifyPlugins("beforeDatasetDraw",o)&&(s&&Qt(e,{left:!1===i.left?0:n.left-i.left,right:!1===i.right?this.width:n.right+i.right,top:!1===i.top?0:n.top-i.top,bottom:!1===i.bottom?this.height:n.bottom+i.bottom}),t.controller.draw(),s&&te(e),o.cancelable=!1,this.notifyPlugins("afterDatasetDraw",o))}getElementsAtEventForMode(t,e,i,s){const n=Ee.modes[e];return"function"==typeof n?n(this,t,i,s):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let s=i.filter((t=>t&&t._dataset===e)).pop();return s||(s={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(s)),s}getContext(){return this.$context||(this.$context=Ye(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return"boolean"==typeof i.hidden?!i.hidden:!e.hidden}setDatasetVisibility(t,e){this.getDatasetMeta(t).hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const s=i?"show":"hide",n=this.getDatasetMeta(t),o=n.controller._resolveAnimations(void 0,s);ct(e)?(n.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),o.update(n,{visible:i}),this.update((e=>e.datasetIndex===t?s:void 0)))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),a.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,i,s),t[i]=s},s=(t,e,i)=>{t.offsetX=e,t.offsetY=i,this._eventHandler(t)};Q(this.options.events,(t=>i(t,s)))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(i,s)=>{e.addEventListener(this,i,s),t[i]=s},s=(i,s)=>{t[i]&&(e.removeEventListener(this,i,s),delete t[i])},n=(t,e)=>{this.canvas&&this.resize(t,e)};let o;const a=()=>{s("attach",a),this.attached=!0,this.resize(),i("resize",n),i("detach",o)};o=()=>{this.attached=!1,s("resize",n),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():o()}unbindEvents(){Q(this._listeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._listeners={},Q(this._responsiveListeners,((t,e)=>{this.platform.removeEventListener(this,e,t)})),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const s=i?"set":"remove";let n,o,a,r;for("dataset"===e&&(n=this.getDatasetMeta(t[0].datasetIndex),n.controller["_"+s+"DatasetHoverStyle"]()),a=0,r=t.length;a{const i=this.getDatasetMeta(t);if(!i)throw new Error("No dataset found at index "+t);return{datasetIndex:t,element:i.data[e],index:e}}));!tt(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}_updateHoverStyles(t,e,i){const s=this.options.hover,n=(t,e)=>t.filter((t=>!e.some((e=>t.datasetIndex===e.datasetIndex&&t.index===e.index)))),o=n(e,t),a=i?t:n(t,e);o.length&&this.updateHoverStyle(o,s.mode,!1),a.length&&s.mode&&this.updateHoverStyle(a,s.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:Jt(t,this.chartArea,this._minPadding)},s=e=>(e.options.events||this.options.events).includes(t.native.type);if(!1===this.notifyPlugins("beforeEvent",i,s))return;const n=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,s),(n||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:s=[],options:n}=this,o=e,a=this._getActiveElements(t,s,i,o),r=ft(t),l=function(t,e,i,s){return i&&"mouseout"!==t.type?s?e:t:null}(t,this._lastEvent,i,r);i&&(this._lastEvent=null,J(n.onHover,[t,a,this],this),r&&J(n.onClick,[t,a,this],this));const h=!tt(a,s);return(h||e)&&(this._active=a,this._updateHoverStyles(a,s,e)),this._lastEvent=l,h}_getActiveElements(t,e,i,s){if("mouseout"===t.type)return[];if(!i)return e;const n=this.options.hover;return this.getElementsAtEventForMode(t,n.mode,n,s)}}const un=()=>Q(dn.instances,(t=>t._plugins.invalidate())),fn=!0;function gn(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}Object.defineProperties(dn,{defaults:{enumerable:fn,value:bt},instances:{enumerable:fn,value:ln},overrides:{enumerable:fn,value:gt},registry:{enumerable:fn,value:Ws},version:{enumerable:fn,value:"3.7.1"},getChart:{enumerable:fn,value:hn},register:{enumerable:fn,value:(...t)=>{Ws.add(...t),un()}},unregister:{enumerable:fn,value:(...t)=>{Ws.remove(...t),un()}}});class pn{constructor(t){this.options=t||{}}formats(){return gn()}parse(t,e){return gn()}format(t,e){return gn()}add(t,e,i){return gn()}diff(t,e,i){return gn()}startOf(t,e,i){return gn()}endOf(t,e){return gn()}}pn.override=function(t){Object.assign(pn.prototype,t)};var mn={_date:pn};function xn(t){const e=t.iScale,i=function(t,e){if(!t._cache.$bar){const i=t.getMatchingVisibleMetas(e);let s=[];for(let e=0,n=i.length;et-e)))}return t._cache.$bar}(e,t.type);let s,n,o,a,r=e._length;const l=()=>{32767!==o&&-32768!==o&&(ct(a)&&(r=Math.min(r,Math.abs(o-a)||r)),a=o)};for(s=0,n=i.length;sMath.abs(r)&&(l=r,h=a),e[i.axis]=h,e._custom={barStart:l,barEnd:h,start:n,end:o,min:a,max:r}}(t,e,i,s):e[i.axis]=i.parse(t,s),e}function _n(t,e,i,s){const n=t.iScale,o=t.vScale,a=n.getLabels(),r=n===o,l=[];let h,c,d,u;for(h=i,c=i+s;ht.x,i="left",s="right"):(e=t.base=i?1:-1)}(c,e,o)*n,d===o&&(p-=c/2),h=p+c),p===e.getPixelForValue(o)){const t=Ct(c)*e.getLineWidthForValue(o)/2;p+=t,c-=t}return{size:c,base:p,head:h,center:h+c/2}}_calculateBarIndexPixels(t,e){const i=e.scale,s=this.options,n=s.skipNull,o=K(s.maxBarThickness,1/0);let a,r;if(e.grouped){const i=n?this._getStackCount(t):e.stackCount,l="flex"===s.barThickness?function(t,e,i,s){const n=e.pixels,o=n[t];let a=t>0?n[t-1]:null,r=t=0;--i)e=Math.max(e,t[i].size(this.resolveDataElementOptions(i))/2);return e>0&&e}getLabelAndValue(t){const e=this._cachedMeta,{xScale:i,yScale:s}=e,n=this.getParsed(t),o=i.getLabelForValue(n.x),a=s.getLabelForValue(n.y),r=n._custom;return{label:e.label,value:"("+o+", "+a+(r?", "+r:"")+")"}}update(t){const e=this._cachedMeta.data;this.updateElements(e,0,e.length,t)}updateElements(t,e,i,s){const n="reset"===s,{iScale:o,vScale:a}=this._cachedMeta,r=this.resolveDataElementOptions(e,s),l=this.getSharedOptions(r),h=this.includeOptions(s,l),c=o.axis,d=a.axis;for(let r=e;r""}}}};class Dn extends Ps{constructor(t,e){super(t,e),this.enableOptionSharing=!0,this.innerRadius=void 0,this.outerRadius=void 0,this.offsetX=void 0,this.offsetY=void 0}linkScales(){}parse(t,e){const i=this.getDataset().data,s=this._cachedMeta;if(!1===this._parsing)s._parsed=i;else{let n,o,a=t=>+i[t];if(U(i[t])){const{key:t="value"}=this._parsing;a=e=>+lt(i[e],t)}for(n=t,o=t+e;nHt(t,r,l,!0)?1:Math.max(e,e*i,s,s*i),g=(t,e,s)=>Ht(t,r,l,!0)?-1:Math.min(e,e*i,s,s*i),p=f(0,h,d),m=f(kt,c,u),x=g(_t,h,d),b=g(_t+kt,c,u);s=(p-x)/2,n=(m-b)/2,o=-(p+x)/2,a=-(m+b)/2}return{ratioX:s,ratioY:n,offsetX:o,offsetY:a}}(c,h,r),p=(i.width-o)/d,m=(i.height-o)/u,x=Math.max(Math.min(p,m)/2,0),b=Z(this.options.radius,x),_=(b-Math.max(b*r,0))/this._getVisibleDatasetWeightTotal();this.offsetX=f*b,this.offsetY=g*b,s.total=this.calculateTotal(),this.outerRadius=b-_*this._getRingWeightOffset(this.index),this.innerRadius=Math.max(this.outerRadius-_*l,0),this.updateElements(n,0,n.length,t)}_circumference(t,e){const i=this.options,s=this._cachedMeta,n=this._getCircumference();return e&&i.animation.animateRotate||!this.chart.getDataVisibility(t)||null===s._parsed[t]||s.data[t].hidden?0:this.calculateCircumference(s._parsed[t]*n/yt)}updateElements(t,e,i,s){const n="reset"===s,o=this.chart,a=o.chartArea,r=o.options.animation,l=(a.left+a.right)/2,h=(a.top+a.bottom)/2,c=n&&r.animateScale,d=c?0:this.innerRadius,u=c?0:this.outerRadius,f=this.resolveDataElementOptions(e,s),g=this.getSharedOptions(f),p=this.includeOptions(s,g);let m,x=this._getRotation();for(m=0;m0&&!isNaN(t)?yt*(Math.abs(t)/e):0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],n=Ri(e._parsed[t],i.options.locale);return{label:s[t]||"",value:n}}getMaxBorderWidth(t){let e=0;const i=this.chart;let s,n,o,a,r;if(!t)for(s=0,n=i.data.datasets.length;s"spacing"!==t,_indexable:t=>"spacing"!==t},Dn.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map(((e,s)=>{const n=t.getDatasetMeta(0).controller.getStyle(s);return{text:e,fillStyle:n.backgroundColor,strokeStyle:n.borderColor,lineWidth:n.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label(t){let e=t.label;const i=": "+t.formattedValue;return Y(e)?(e=e.slice(),e[0]+=i):e+=i,e}}}}};class Cn extends Ps{initialize(){this.enableOptionSharing=!0,super.initialize()}update(t){const e=this._cachedMeta,{dataset:i,data:s=[],_dataset:n}=e,o=this.chart._animationsDisabled;let{start:a,count:r}=function(t,e,i){const s=e.length;let n=0,o=s;if(t._sorted){const{iScale:a,_parsed:r}=t,l=a.axis,{min:h,max:c,minDefined:d,maxDefined:u}=a.getUserBounds();d&&(n=jt(Math.min(re(r,a.axis,h).lo,i?s:re(e,l,a.getPixelForValue(h)).lo),0,s-1)),o=u?jt(Math.max(re(r,a.axis,c).hi+1,i?0:re(e,l,a.getPixelForValue(c)).hi+1),n,s)-n:s-n}return{start:n,count:o}}(e,s,o);this._drawStart=a,this._drawCount=r,function(t){const{xScale:e,yScale:i,_scaleRanges:s}=t,n={xmin:e.min,xmax:e.max,ymin:i.min,ymax:i.max};if(!s)return t._scaleRanges=n,!0;const o=s.xmin!==e.min||s.xmax!==e.max||s.ymin!==i.min||s.ymax!==i.max;return Object.assign(s,n),o}(e)&&(a=0,r=s.length),i._chart=this.chart,i._datasetIndex=this.index,i._decimated=!!n._decimated,i.points=s;const l=this.resolveDatasetElementOptions(t);this.options.showLine||(l.borderWidth=0),l.segment=this.options.segment,this.updateElement(i,void 0,{animated:!o,options:l},t),this.updateElements(s,a,r,t)}updateElements(t,e,i,s){const n="reset"===s,{iScale:o,vScale:a,_stacked:r,_dataset:l}=this._cachedMeta,h=this.resolveDataElementOptions(e,s),c=this.getSharedOptions(h),d=this.includeOptions(s,c),u=o.axis,f=a.axis,{spanGaps:g,segment:p}=this.options,m=Tt(g)?g:Number.POSITIVE_INFINITY,x=this.chart._animationsDisabled||n||"none"===s;let b=e>0&&this.getParsed(e-1);for(let h=e;h0&&i[u]-b[u]>m,p&&(g.parsed=i,g.raw=l.data[h]),d&&(g.options=c||this.resolveDataElementOptions(h,e.active?"active":s)),x||this.updateElement(e,h,g,s),b=i}this.updateSharedOptions(c,s,h)}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,s=t.data||[];if(!s.length)return i;const n=s[0].size(this.resolveDataElementOptions(0)),o=s[s.length-1].size(this.resolveDataElementOptions(s.length-1));return Math.max(i,n,o)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}Cn.id="line",Cn.defaults={datasetElementType:"line",dataElementType:"point",showLine:!0,spanGaps:!1},Cn.overrides={scales:{_index_:{type:"category"},_value_:{type:"linear"}}};class On extends Ps{constructor(t,e){super(t,e),this.innerRadius=void 0,this.outerRadius=void 0}getLabelAndValue(t){const e=this._cachedMeta,i=this.chart,s=i.data.labels||[],n=Ri(e._parsed[t].r,i.options.locale);return{label:s[t]||"",value:n}}update(t){const e=this._cachedMeta.data;this._updateRadius(),this.updateElements(e,0,e.length,t)}_updateRadius(){const t=this.chart,e=t.chartArea,i=t.options,s=Math.min(e.right-e.left,e.bottom-e.top),n=Math.max(s/2,0),o=(n-Math.max(i.cutoutPercentage?n/100*i.cutoutPercentage:1,0))/t.getVisibleDatasetCount();this.outerRadius=n-o*this.index,this.innerRadius=this.outerRadius-o}updateElements(t,e,i,s){const n="reset"===s,o=this.chart,a=this.getDataset(),r=o.options.animation,l=this._cachedMeta.rScale,h=l.xCenter,c=l.yCenter,d=l.getIndexAngle(0)-.5*_t;let u,f=d;const g=360/this.countVisibleElements();for(u=0;u{!isNaN(t.data[s])&&this.chart.getDataVisibility(s)&&i++})),i}_computeAngle(t,e,i){return this.chart.getDataVisibility(t)?It(this.resolveDataElementOptions(t,e).angle||i):0}}On.id="polarArea",On.defaults={dataElementType:"arc",animation:{animateRotate:!0,animateScale:!0},animations:{numbers:{type:"number",properties:["x","y","startAngle","endAngle","innerRadius","outerRadius"]}},indexAxis:"r",startAngle:0},On.overrides={aspectRatio:1,plugins:{legend:{labels:{generateLabels(t){const e=t.data;if(e.labels.length&&e.datasets.length){const{labels:{pointStyle:i}}=t.legend.options;return e.labels.map(((e,s)=>{const n=t.getDatasetMeta(0).controller.getStyle(s);return{text:e,fillStyle:n.backgroundColor,strokeStyle:n.borderColor,lineWidth:n.borderWidth,pointStyle:i,hidden:!t.getDataVisibility(s),index:s}}))}return[]}},onClick(t,e,i){i.chart.toggleDataVisibility(e.index),i.chart.update()}},tooltip:{callbacks:{title:()=>"",label:t=>t.chart.data.labels[t.dataIndex]+": "+t.formattedValue}}},scales:{r:{type:"radialLinear",angleLines:{display:!1},beginAtZero:!0,grid:{circular:!0},pointLabels:{display:!1},startAngle:0}}};class An extends Dn{}An.id="pie",An.defaults={cutout:0,rotation:0,circumference:360,radius:"100%"};class Tn extends Ps{getLabelAndValue(t){const e=this._cachedMeta.vScale,i=this.getParsed(t);return{label:e.getLabels()[t],value:""+e.getLabelForValue(i[e.axis])}}update(t){const e=this._cachedMeta,i=e.dataset,s=e.data||[],n=e.iScale.getLabels();if(i.points=s,"resize"!==t){const e=this.resolveDatasetElementOptions(t);this.options.showLine||(e.borderWidth=0);const o={_loop:!0,_fullLoop:n.length===s.length,options:e};this.updateElement(i,void 0,o,t)}this.updateElements(s,0,s.length,t)}updateElements(t,e,i,s){const n=this.getDataset(),o=this._cachedMeta.rScale,a="reset"===s;for(let r=e;r"",label:t=>"("+t.label+", "+t.formattedValue+")"}}},scales:{x:{type:"linear"},y:{type:"linear"}}};var Rn=Object.freeze({__proto__:null,BarController:Sn,BubbleController:Pn,DoughnutController:Dn,LineController:Cn,PolarAreaController:On,PieController:An,RadarController:Tn,ScatterController:Ln});function En(t,e,i){const{startAngle:s,pixelMargin:n,x:o,y:a,outerRadius:r,innerRadius:l}=e;let h=n/r;t.beginPath(),t.arc(o,a,r,s-h,i+h),l>n?(h=n/l,t.arc(o,a,l,i+h,s-h,!0)):t.arc(o,a,n,i+kt,s-kt),t.closePath(),t.clip()}function In(t,e,i,s){const n=Be(t.options.borderRadius,["outerStart","outerEnd","innerStart","innerEnd"]);const o=(i-e)/2,a=Math.min(o,s*e/2),r=t=>{const e=(i-Math.min(o,t))*s/2;return jt(t,0,Math.min(o,e))};return{outerStart:r(n.outerStart),outerEnd:r(n.outerEnd),innerStart:jt(n.innerStart,0,a),innerEnd:jt(n.innerEnd,0,a)}}function zn(t,e,i,s){return{x:i+t*Math.cos(e),y:s+t*Math.sin(e)}}function Fn(t,e,i,s,n){const{x:o,y:a,startAngle:r,pixelMargin:l,innerRadius:h}=e,c=Math.max(e.outerRadius+s+i-l,0),d=h>0?h+s+i+l:0;let u=0;const f=n-r;if(s){const t=((h>0?h-s:0)+(c>0?c-s:0))/2;u=(f-(0!==t?f*t/(t+s):f))/2}const g=(f-Math.max(.001,f*c-i/_t)/c)/2,p=r+g+u,m=n-g-u,{outerStart:x,outerEnd:b,innerStart:_,innerEnd:y}=In(e,d,c,m-p),v=c-x,w=c-b,M=p+x/v,k=m-b/w,S=d+_,P=d+y,D=p+_/S,C=m-y/P;if(t.beginPath(),t.arc(o,a,c,M,k),b>0){const e=zn(w,k,o,a);t.arc(e.x,e.y,b,k,m+kt)}const O=zn(P,m,o,a);if(t.lineTo(O.x,O.y),y>0){const e=zn(P,C,o,a);t.arc(e.x,e.y,y,m+kt,C+Math.PI)}if(t.arc(o,a,d,m-y/d,p+_/d,!0),_>0){const e=zn(S,D,o,a);t.arc(e.x,e.y,_,D+Math.PI,p-kt)}const A=zn(v,p,o,a);if(t.lineTo(A.x,A.y),x>0){const e=zn(v,M,o,a);t.arc(e.x,e.y,x,p-kt,M)}t.closePath()}function Bn(t,e,i,s,n){const{options:o}=e,{borderWidth:a,borderJoinStyle:r}=o,l="inner"===o.borderAlign;a&&(l?(t.lineWidth=2*a,t.lineJoin=r||"round"):(t.lineWidth=a,t.lineJoin=r||"bevel"),e.fullCircles&&function(t,e,i){const{x:s,y:n,startAngle:o,pixelMargin:a,fullCircles:r}=e,l=Math.max(e.outerRadius-a,0),h=e.innerRadius+a;let c;for(i&&En(t,e,o+yt),t.beginPath(),t.arc(s,n,h,o+yt,o,!0),c=0;c=yt||Ht(n,a,r),f=Yt(o,l+d,h+d);return u&&f}getCenterPoint(t){const{x:e,y:i,startAngle:s,endAngle:n,innerRadius:o,outerRadius:a}=this.getProps(["x","y","startAngle","endAngle","innerRadius","outerRadius","circumference"],t),{offset:r,spacing:l}=this.options,h=(s+n)/2,c=(o+a+l+r)/2;return{x:e+Math.cos(h)*c,y:i+Math.sin(h)*c}}tooltipPosition(t){return this.getCenterPoint(t)}draw(t){const{options:e,circumference:i}=this,s=(e.offset||0)/2,n=(e.spacing||0)/2;if(this.pixelMargin="inner"===e.borderAlign?.33:0,this.fullCircles=i>yt?Math.floor(i/yt):0,0===i||this.innerRadius<0||this.outerRadius<0)return;t.save();let o=0;if(s){o=s/2;const e=(this.startAngle+this.endAngle)/2;t.translate(Math.cos(e)*o,Math.sin(e)*o),this.circumference>=_t&&(o=s)}t.fillStyle=e.backgroundColor,t.strokeStyle=e.borderColor;const a=function(t,e,i,s){const{fullCircles:n,startAngle:o,circumference:a}=e;let r=e.endAngle;if(n){Fn(t,e,i,s,o+yt);for(let e=0;er&&o>r;return{count:s,start:l,loop:e.loop,ilen:h(a+(h?r-t:t))%o,_=()=>{f!==g&&(t.lineTo(m,g),t.lineTo(m,f),t.lineTo(m,p))};for(l&&(d=n[b(0)],t.moveTo(d.x,d.y)),c=0;c<=r;++c){if(d=n[b(c)],d.skip)continue;const e=d.x,i=d.y,s=0|e;s===u?(ig&&(g=i),m=(x*m+e)/++x):(_(),t.lineTo(e,i),u=s,x=0,f=g=i),p=i}_()}function Yn(t){const e=t.options,i=e.borderDash&&e.borderDash.length;return!(t._decimated||t._loop||e.tension||"monotone"===e.cubicInterpolationMode||e.stepped||i)?$n:jn}Vn.id="arc",Vn.defaults={borderAlign:"center",borderColor:"#fff",borderJoinStyle:void 0,borderRadius:0,borderWidth:2,offset:0,spacing:0,angle:void 0},Vn.defaultRoutes={backgroundColor:"backgroundColor"};const Un="function"==typeof Path2D;function Xn(t,e,i,s){Un&&!e.options.segment?function(t,e,i,s){let n=e._path;n||(n=e._path=new Path2D,e.path(n,i,s)&&n.closePath()),Wn(t,e.options),t.stroke(n)}(t,e,i,s):function(t,e,i,s){const{segments:n,options:o}=e,a=Yn(e);for(const r of n)Wn(t,o,r.style),t.beginPath(),a(t,e,r,{start:i,end:i+s-1})&&t.closePath(),t.stroke()}(t,e,i,s)}class qn extends Ds{constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||"monotone"===i.cubicInterpolationMode)&&!i.stepped&&!this._pointsUpdated){const s=i.spanGaps?this._loop:this._fullLoop;ki(this._points,i,t,s,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=Ni(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,s=t[e],n=this.points,o=Wi(this,{property:e,start:s,end:s});if(!o.length)return;const a=[],r=function(t){return t.stepped?Ai:t.tension||"monotone"===t.cubicInterpolationMode?Ti:Oi}(i);let l,h;for(l=0,h=o.length;l"borderDash"!==t&&"fill"!==t};class Gn extends Ds{constructor(t){super(),this.options=void 0,this.parsed=void 0,this.skip=void 0,this.stop=void 0,t&&Object.assign(this,t)}inRange(t,e,i){const s=this.options,{x:n,y:o}=this.getProps(["x","y"],i);return Math.pow(t-n,2)+Math.pow(e-o,2){oo(t)}))}var ro={id:"decimation",defaults:{algorithm:"min-max",enabled:!1},beforeElementsUpdate:(t,e,i)=>{if(!i.enabled)return void ao(t);const s=t.width;t.data.datasets.forEach(((e,n)=>{const{_data:o,indexAxis:a}=e,r=t.getDatasetMeta(n),l=o||e.data;if("y"===je([a,t.options.indexAxis]))return;if("line"!==r.type)return;const h=t.scales[r.xAxisID];if("linear"!==h.type&&"time"!==h.type)return;if(t.options.parsing)return;let{start:c,count:d}=function(t,e){const i=e.length;let s,n=0;const{iScale:o}=t,{min:a,max:r,minDefined:l,maxDefined:h}=o.getUserBounds();return l&&(n=jt(re(e,o.axis,a).lo,0,i-1)),s=h?jt(re(e,o.axis,r).hi+1,n,i)-n:i-n,{start:n,count:s}}(r,l);if(d<=(i.threshold||4*s))return void oo(e);let u;switch($(o)&&(e._data=l,delete e.data,Object.defineProperty(e,"data",{configurable:!0,enumerable:!0,get:function(){return this._decimated},set:function(t){this._data=t}})),i.algorithm){case"lttb":u=function(t,e,i,s,n){const o=n.samples||s;if(o>=i)return t.slice(e,e+i);const a=[],r=(i-2)/(o-2);let l=0;const h=e+i-1;let c,d,u,f,g,p=e;for(a[l++]=t[p],c=0;cu&&(u=f,d=t[s],g=s);a[l++]=d,p=g}return a[l++]=t[h],a}(l,c,d,s,i);break;case"min-max":u=function(t,e,i,s){let n,o,a,r,l,h,c,d,u,f,g=0,p=0;const m=[],x=e+i-1,b=t[e].x,_=t[x].x-b;for(n=e;nf&&(f=r,c=n),g=(p*g+o.x)/++p;else{const i=n-1;if(!$(h)&&!$(c)){const e=Math.min(h,c),s=Math.max(h,c);e!==d&&e!==i&&m.push({...t[e],x:g}),s!==d&&s!==i&&m.push({...t[s],x:g})}n>0&&i!==d&&m.push(t[i]),m.push(o),l=e,p=0,u=f=r,h=c=d=n}}return m}(l,c,d,s);break;default:throw new Error(`Unsupported decimation algorithm '${i.algorithm}'`)}e._decimated=u}))},destroy(t){ao(t)}};function lo(t,e,i){const s=function(t){const e=t.options,i=e.fill;let s=K(i&&i.target,i);return void 0===s&&(s=!!e.backgroundColor),!1!==s&&null!==s&&(!0===s?"origin":s)}(t);if(U(s))return!isNaN(s.value)&&s;let n=parseFloat(s);return X(n)&&Math.floor(n)===n?("-"!==s[0]&&"+"!==s[0]||(n=e+n),!(n===e||n<0||n>=i)&&n):["origin","start","end","stack","shape"].indexOf(s)>=0&&s}class ho{constructor(t){this.x=t.x,this.y=t.y,this.radius=t.radius}pathSegment(t,e,i){const{x:s,y:n,radius:o}=this;return e=e||{start:0,end:yt},t.arc(s,n,o,e.end,e.start,!0),!i.bounds}interpolate(t){const{x:e,y:i,radius:s}=this,n=t.angle;return{x:e+Math.cos(n)*s,y:i+Math.sin(n)*s,angle:n}}}function co(t){return(t.scale||{}).getPointPositionForValue?function(t){const{scale:e,fill:i}=t,s=e.options,n=e.getLabels().length,o=[],a=s.reverse?e.max:e.min,r=s.reverse?e.min:e.max;let l,h,c;if(c="start"===i?a:"end"===i?r:U(i)?i.value:e.getBaseValue(),s.grid.circular)return h=e.getPointPositionForValue(0,a),new ho({x:h.x,y:h.y,radius:e.getDistanceFromCenterForValue(c)});for(l=0;lt;e--){const t=i[e];if(!isNaN(t.x)&&!isNaN(t.y))break}return e}function fo(t,e,i){const s=[];for(let n=0;n{e=uo(t,e,n);const a=n[t],r=n[e];null!==s?(o.push({x:a.x,y:s}),o.push({x:r.x,y:s})):null!==i&&(o.push({x:i,y:a.y}),o.push({x:i,y:r.y}))})),o}(t,e),i.length?new qn({points:i,options:{tension:0},_loop:s,_fullLoop:s}):null}function xo(t,e,i){let s=t[e].fill;const n=[e];let o;if(!i)return s;for(;!1!==s&&-1===n.indexOf(s);){if(!X(s))return s;if(o=t[s],!o)return!1;if(o.visible)return s;n.push(s),s=o.fill}return!1}function bo(t,e,i){const{segments:s,points:n}=e;let o=!0,a=!1;t.beginPath();for(const r of s){const{start:s,end:l}=r,h=n[s],c=n[uo(s,l,n)];o?(t.moveTo(h.x,h.y),o=!1):(t.lineTo(h.x,i),t.lineTo(h.x,h.y)),a=!!e.pathSegment(t,r,{move:a}),a?t.closePath():t.lineTo(c.x,i)}t.lineTo(e.first().x,i),t.closePath(),t.clip()}function _o(t,e,i,s){if(s)return;let n=e[t],o=i[t];return"angle"===t&&(n=Nt(n),o=Nt(o)),{property:t,start:n,end:o}}function yo(t,e,i,s){return t&&e?s(t[i],e[i]):t?t[i]:e?e[i]:0}function vo(t,e,i){const{top:s,bottom:n}=e.chart.chartArea,{property:o,start:a,end:r}=i||{};"x"===o&&(t.beginPath(),t.rect(a,s,r-a,n-s),t.clip())}function wo(t,e,i,s){const n=e.interpolate(i,s);n&&t.lineTo(n.x,n.y)}function Mo(t,e){const{line:i,target:s,property:n,color:o,scale:a}=e,r=function(t,e,i){const s=t.segments,n=t.points,o=e.points,a=[];for(const t of s){let{start:s,end:r}=t;r=uo(s,r,n);const l=_o(i,n[s],n[r],t.loop);if(!e.segments){a.push({source:t,target:l,start:n[s],end:n[r]});continue}const h=Wi(e,l);for(const e of h){const s=_o(i,o[e.start],o[e.end],e.loop),r=Vi(t,n,s);for(const t of r)a.push({source:t,target:e,start:{[i]:yo(l,s,"start",Math.max)},end:{[i]:yo(l,s,"end",Math.min)}})}}return a}(i,s,n);for(const{source:e,target:l,start:h,end:c}of r){const{style:{backgroundColor:r=o}={}}=e,d=!0!==s;t.save(),t.fillStyle=r,vo(t,a,d&&_o(n,h,c)),t.beginPath();const u=!!i.pathSegment(t,e);let f;if(d){u?t.closePath():wo(t,s,c,n);const e=!!s.pathSegment(t,l,{move:u,reverse:!0});f=u&&e,f||wo(t,s,h,n)}t.closePath(),t.fill(f?"evenodd":"nonzero"),t.restore()}}function ko(t,e,i){const s=po(e),{line:n,scale:o,axis:a}=e,r=n.options,l=r.fill,h=r.backgroundColor,{above:c=h,below:d=h}=l||{};s&&n.points.length&&(Qt(t,i),function(t,e){const{line:i,target:s,above:n,below:o,area:a,scale:r}=e,l=i._loop?"angle":e.axis;t.save(),"x"===l&&o!==n&&(bo(t,s,a.top),Mo(t,{line:i,target:s,color:n,scale:r,property:l}),t.restore(),t.save(),bo(t,s,a.bottom)),Mo(t,{line:i,target:s,color:o,scale:r,property:l}),t.restore()}(t,{line:n,target:s,above:c,below:d,area:i,scale:o,axis:a}),te(t))}var So={id:"filler",afterDatasetsUpdate(t,e,i){const s=(t.data.datasets||[]).length,n=[];let o,a,r,l;for(a=0;a=0;--e){const i=n[e].$filler;i&&(i.line.updateControlPoints(o,i.axis),s&&ko(t.ctx,i,o))}},beforeDatasetsDraw(t,e,i){if("beforeDatasetsDraw"!==i.drawTime)return;const s=t.getSortedVisibleDatasetMetas();for(let e=s.length-1;e>=0;--e){const i=s[e].$filler;i&&ko(t.ctx,i,t.chartArea)}},beforeDatasetDraw(t,e,i){const s=e.meta.$filler;s&&!1!==s.fill&&"beforeDatasetDraw"===i.drawTime&&ko(t.ctx,s,t.chartArea)},defaults:{propagate:!0,drawTime:"beforeDatasetDraw"}};const Po=(t,e)=>{let{boxHeight:i=e,boxWidth:s=e}=t;return t.usePointStyle&&(i=Math.min(i,e),s=Math.min(s,e)),{boxWidth:s,boxHeight:i,itemHeight:Math.max(e,i)}};class Do extends Ds{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=J(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter((e=>t.filter(e,this.chart.data)))),t.sort&&(e=e.sort(((e,i)=>t.sort(e,i,this.chart.data)))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display)return void(this.width=this.height=0);const i=t.labels,s=He(i.font),n=s.size,o=this._computeTitleHeight(),{boxWidth:a,itemHeight:r}=Po(i,n);let l,h;e.font=s.string,this.isHorizontal()?(l=this.maxWidth,h=this._fitRows(o,n,a,r)+10):(h=this.maxHeight,l=this._fitCols(o,n,a,r)+10),this.width=Math.min(l,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,s){const{ctx:n,maxWidth:o,options:{labels:{padding:a}}}=this,r=this.legendHitBoxes=[],l=this.lineWidths=[0],h=s+a;let c=t;n.textAlign="left",n.textBaseline="middle";let d=-1,u=-h;return this.legendItems.forEach(((t,f)=>{const g=i+e/2+n.measureText(t.text).width;(0===f||l[l.length-1]+g+2*a>o)&&(c+=h,l[l.length-(f>0?0:1)]=0,u+=h,d++),r[f]={left:0,top:u,row:d,width:g,height:s},l[l.length-1]+=g+a})),c}_fitCols(t,e,i,s){const{ctx:n,maxHeight:o,options:{labels:{padding:a}}}=this,r=this.legendHitBoxes=[],l=this.columnSizes=[],h=o-t;let c=a,d=0,u=0,f=0,g=0;return this.legendItems.forEach(((t,o)=>{const p=i+e/2+n.measureText(t.text).width;o>0&&u+s+2*a>h&&(c+=d+a,l.push({width:d,height:u}),f+=d+a,g++,d=u=0),r[o]={left:f,top:u,col:g,width:p,height:s},d=Math.max(d,p),u+=s+a})),c+=d,l.push({width:d,height:u}),c}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:s},rtl:o}}=this,a=Ei(o,this.left,this.width);if(this.isHorizontal()){let o=0,r=n(i,this.left+s,this.right-this.lineWidths[o]);for(const l of e)o!==l.row&&(o=l.row,r=n(i,this.left+s,this.right-this.lineWidths[o])),l.top+=this.top+t+s,l.left=a.leftForLtr(a.x(r),l.width),r+=l.width+s}else{let o=0,r=n(i,this.top+t+s,this.bottom-this.columnSizes[o].height);for(const l of e)l.col!==o&&(o=l.col,r=n(i,this.top+t+s,this.bottom-this.columnSizes[o].height)),l.top=r,l.left+=this.left+s,l.left=a.leftForLtr(a.x(l.left),l.width),r+=l.height+s}}isHorizontal(){return"top"===this.options.position||"bottom"===this.options.position}draw(){if(this.options.display){const t=this.ctx;Qt(t,this),this._draw(),te(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:s}=this,{align:a,labels:r}=t,l=bt.color,h=Ei(t.rtl,this.left,this.width),c=He(r.font),{color:d,padding:u}=r,f=c.size,g=f/2;let p;this.drawTitle(),s.textAlign=h.textAlign("left"),s.textBaseline="middle",s.lineWidth=.5,s.font=c.string;const{boxWidth:m,boxHeight:x,itemHeight:b}=Po(r,f),_=this.isHorizontal(),y=this._computeTitleHeight();p=_?{x:n(a,this.left+u,this.right-i[0]),y:this.top+u+y,line:0}:{x:this.left+u,y:n(a,this.top+y+u,this.bottom-e[0].height),line:0},Ii(this.ctx,t.textDirection);const v=b+u;this.legendItems.forEach(((w,M)=>{s.strokeStyle=w.fontColor||d,s.fillStyle=w.fontColor||d;const k=s.measureText(w.text).width,S=h.textAlign(w.textAlign||(w.textAlign=r.textAlign)),P=m+g+k;let D=p.x,C=p.y;h.setWidth(this.width),_?M>0&&D+P+u>this.right&&(C=p.y+=v,p.line++,D=p.x=n(a,this.left+u,this.right-i[p.line])):M>0&&C+v>this.bottom&&(D=p.x=D+e[p.line].width+u,p.line++,C=p.y=n(a,this.top+y+u,this.bottom-e[p.line].height));!function(t,e,i){if(isNaN(m)||m<=0||isNaN(x)||x<0)return;s.save();const n=K(i.lineWidth,1);if(s.fillStyle=K(i.fillStyle,l),s.lineCap=K(i.lineCap,"butt"),s.lineDashOffset=K(i.lineDashOffset,0),s.lineJoin=K(i.lineJoin,"miter"),s.lineWidth=n,s.strokeStyle=K(i.strokeStyle,l),s.setLineDash(K(i.lineDash,[])),r.usePointStyle){const o={radius:m*Math.SQRT2/2,pointStyle:i.pointStyle,rotation:i.rotation,borderWidth:n},a=h.xPlus(t,m/2);Zt(s,o,a,e+g)}else{const o=e+Math.max((f-x)/2,0),a=h.leftForLtr(t,m),r=We(i.borderRadius);s.beginPath(),Object.values(r).some((t=>0!==t))?oe(s,{x:a,y:o,w:m,h:x,radius:r}):s.rect(a,o,m,x),s.fill(),0!==n&&s.stroke()}s.restore()}(h.x(D),C,w),D=o(S,D+m+g,_?D+P:this.right,t.rtl),function(t,e,i){se(s,i.text,t,e+b/2,c,{strikethrough:i.hidden,textAlign:h.textAlign(i.textAlign)})}(h.x(D),C,w),_?p.x+=P+u:p.y+=v})),zi(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=He(e.font),o=Ne(e.padding);if(!e.display)return;const a=Ei(t.rtl,this.left,this.width),r=this.ctx,l=e.position,h=i.size/2,c=o.top+h;let d,u=this.left,f=this.width;if(this.isHorizontal())f=Math.max(...this.lineWidths),d=this.top+c,u=n(t.align,u,this.right-f);else{const e=this.columnSizes.reduce(((t,e)=>Math.max(t,e.height)),0);d=c+n(t.align,this.top,this.bottom-e-t.labels.padding-this._computeTitleHeight())}const g=n(l,u,u+f);r.textAlign=a.textAlign(s(l)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=i.string,se(r,e.text,g,d,i)}_computeTitleHeight(){const t=this.options.title,e=He(t.font),i=Ne(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,s,n;if(Yt(t,this.left,this.right)&&Yt(e,this.top,this.bottom))for(n=this.legendHitBoxes,i=0;it.chart.options.color,boxWidth:40,padding:10,generateLabels(t){const e=t.data.datasets,{labels:{usePointStyle:i,pointStyle:s,textAlign:n,color:o}}=t.legend.options;return t._getSortedDatasetMetas().map((t=>{const a=t.controller.getStyle(i?0:void 0),r=Ne(a.borderWidth);return{text:e[t.index].label,fillStyle:a.backgroundColor,fontColor:o,hidden:!t.visible,lineCap:a.borderCapStyle,lineDash:a.borderDash,lineDashOffset:a.borderDashOffset,lineJoin:a.borderJoinStyle,lineWidth:(r.width+r.height)/4,strokeStyle:a.borderColor,pointStyle:s||a.pointStyle,rotation:a.rotation,textAlign:n||a.textAlign,borderRadius:0,datasetIndex:t.index}}),this)}},title:{color:t=>t.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:t=>!t.startsWith("on"),labels:{_scriptable:t=>!["generateLabels","filter","sort"].includes(t)}}};class Oo extends Ds{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display)return void(this.width=this.height=this.right=this.bottom=0);this.width=this.right=t,this.height=this.bottom=e;const s=Y(i.text)?i.text.length:1;this._padding=Ne(i.padding);const n=s*He(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=n:this.width=n}isHorizontal(){const t=this.options.position;return"top"===t||"bottom"===t}_drawArgs(t){const{top:e,left:i,bottom:s,right:o,options:a}=this,r=a.align;let l,h,c,d=0;return this.isHorizontal()?(h=n(r,i,o),c=e+t,l=o-i):("left"===a.position?(h=i+t,c=n(r,s,e),d=-.5*_t):(h=o-t,c=n(r,e,s),d=.5*_t),l=s-e),{titleX:h,titleY:c,maxWidth:l,rotation:d}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=He(e.font),n=i.lineHeight/2+this._padding.top,{titleX:o,titleY:a,maxWidth:r,rotation:l}=this._drawArgs(n);se(t,e.text,0,0,i,{color:e.color,maxWidth:r,rotation:l,textAlign:s(e.align),textBaseline:"middle",translation:[o,a]})}}var Ao={id:"title",_element:Oo,start(t,e,i){!function(t,e){const i=new Oo({ctx:t.ctx,options:e,chart:t});ni.configure(t,i,e),ni.addBox(t,i),t.titleBlock=i}(t,i)},stop(t){const e=t.titleBlock;ni.removeBox(t,e),delete t.titleBlock},beforeUpdate(t,e,i){const s=t.titleBlock;ni.configure(t,s,i),s.options=i},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const To=new WeakMap;var Lo={id:"subtitle",start(t,e,i){const s=new Oo({ctx:t.ctx,options:i,chart:t});ni.configure(t,s,i),ni.addBox(t,s),To.set(t,s)},stop(t){ni.removeBox(t,To.get(t)),To.delete(t)},beforeUpdate(t,e,i){const s=To.get(t);ni.configure(t,s,i),s.options=i},defaults:{align:"center",display:!1,font:{weight:"normal"},fullSize:!0,padding:0,position:"top",text:"",weight:1500},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const Ro={average(t){if(!t.length)return!1;let e,i,s=0,n=0,o=0;for(e=0,i=t.length;e-1?t.split("\n"):t}function zo(t,e){const{element:i,datasetIndex:s,index:n}=e,o=t.getDatasetMeta(s).controller,{label:a,value:r}=o.getLabelAndValue(n);return{chart:t,label:a,parsed:o.getParsed(n),raw:t.data.datasets[s].data[n],formattedValue:r,dataset:o.getDataset(),dataIndex:n,datasetIndex:s,element:i}}function Fo(t,e){const i=t.chart.ctx,{body:s,footer:n,title:o}=t,{boxWidth:a,boxHeight:r}=e,l=He(e.bodyFont),h=He(e.titleFont),c=He(e.footerFont),d=o.length,u=n.length,f=s.length,g=Ne(e.padding);let p=g.height,m=0,x=s.reduce(((t,e)=>t+e.before.length+e.lines.length+e.after.length),0);if(x+=t.beforeBody.length+t.afterBody.length,d&&(p+=d*h.lineHeight+(d-1)*e.titleSpacing+e.titleMarginBottom),x){p+=f*(e.displayColors?Math.max(r,l.lineHeight):l.lineHeight)+(x-f)*l.lineHeight+(x-1)*e.bodySpacing}u&&(p+=e.footerMarginTop+u*c.lineHeight+(u-1)*e.footerSpacing);let b=0;const _=function(t){m=Math.max(m,i.measureText(t).width+b)};return i.save(),i.font=h.string,Q(t.title,_),i.font=l.string,Q(t.beforeBody.concat(t.afterBody),_),b=e.displayColors?a+2+e.boxPadding:0,Q(s,(t=>{Q(t.before,_),Q(t.lines,_),Q(t.after,_)})),b=0,i.font=c.string,Q(t.footer,_),i.restore(),m+=g.width,{width:m,height:p}}function Bo(t,e,i,s){const{x:n,width:o}=i,{width:a,chartArea:{left:r,right:l}}=t;let h="center";return"center"===s?h=n<=(r+l)/2?"left":"right":n<=o/2?h="left":n>=a-o/2&&(h="right"),function(t,e,i,s){const{x:n,width:o}=s,a=i.caretSize+i.caretPadding;return"left"===t&&n+o+a>e.width||"right"===t&&n-o-a<0||void 0}(h,t,e,i)&&(h="center"),h}function Vo(t,e,i){const s=i.yAlign||e.yAlign||function(t,e){const{y:i,height:s}=e;return it.height-s/2?"bottom":"center"}(t,i);return{xAlign:i.xAlign||e.xAlign||Bo(t,e,i,s),yAlign:s}}function Wo(t,e,i,s){const{caretSize:n,caretPadding:o,cornerRadius:a}=t,{xAlign:r,yAlign:l}=i,h=n+o,{topLeft:c,topRight:d,bottomLeft:u,bottomRight:f}=We(a);let g=function(t,e){let{x:i,width:s}=t;return"right"===e?i-=s:"center"===e&&(i-=s/2),i}(e,r);const p=function(t,e,i){let{y:s,height:n}=t;return"top"===e?s+=i:s-="bottom"===e?n+i:n/2,s}(e,l,h);return"center"===l?"left"===r?g+=h:"right"===r&&(g-=h):"left"===r?g-=Math.max(c,u)+n:"right"===r&&(g+=Math.max(d,f)+n),{x:jt(g,0,s.width-e.width),y:jt(p,0,s.height-e.height)}}function No(t,e,i){const s=Ne(i.padding);return"center"===e?t.x+t.width/2:"right"===e?t.x+t.width-s.right:t.x+s.left}function Ho(t){return Eo([],Io(t))}function jo(t,e){const i=e&&e.dataset&&e.dataset.tooltip&&e.dataset.tooltip.callbacks;return i?t.override(i):t}class $o extends Ds{constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart||t._chart,this._chart=this.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),s=i.enabled&&e.options.animation&&i.animations,n=new gs(this.chart,s);return s._cacheable&&(this._cachedAnimations=Object.freeze(n)),n}getContext(){return this.$context||(this.$context=(t=this.chart.getContext(),e=this,i=this._tooltipItems,Ye(t,{tooltip:e,tooltipItems:i,type:"tooltip"})));var t,e,i}getTitle(t,e){const{callbacks:i}=e,s=i.beforeTitle.apply(this,[t]),n=i.title.apply(this,[t]),o=i.afterTitle.apply(this,[t]);let a=[];return a=Eo(a,Io(s)),a=Eo(a,Io(n)),a=Eo(a,Io(o)),a}getBeforeBody(t,e){return Ho(e.callbacks.beforeBody.apply(this,[t]))}getBody(t,e){const{callbacks:i}=e,s=[];return Q(t,(t=>{const e={before:[],lines:[],after:[]},n=jo(i,t);Eo(e.before,Io(n.beforeLabel.call(this,t))),Eo(e.lines,n.label.call(this,t)),Eo(e.after,Io(n.afterLabel.call(this,t))),s.push(e)})),s}getAfterBody(t,e){return Ho(e.callbacks.afterBody.apply(this,[t]))}getFooter(t,e){const{callbacks:i}=e,s=i.beforeFooter.apply(this,[t]),n=i.footer.apply(this,[t]),o=i.afterFooter.apply(this,[t]);let a=[];return a=Eo(a,Io(s)),a=Eo(a,Io(n)),a=Eo(a,Io(o)),a}_createItems(t){const e=this._active,i=this.chart.data,s=[],n=[],o=[];let a,r,l=[];for(a=0,r=e.length;at.filter(e,s,n,i)))),t.itemSort&&(l=l.sort(((e,s)=>t.itemSort(e,s,i)))),Q(l,(e=>{const i=jo(t.callbacks,e);s.push(i.labelColor.call(this,e)),n.push(i.labelPointStyle.call(this,e)),o.push(i.labelTextColor.call(this,e))})),this.labelColors=s,this.labelPointStyles=n,this.labelTextColors=o,this.dataPoints=l,l}update(t,e){const i=this.options.setContext(this.getContext()),s=this._active;let n,o=[];if(s.length){const t=Ro[i.position].call(this,s,this._eventPosition);o=this._createItems(i),this.title=this.getTitle(o,i),this.beforeBody=this.getBeforeBody(o,i),this.body=this.getBody(o,i),this.afterBody=this.getAfterBody(o,i),this.footer=this.getFooter(o,i);const e=this._size=Fo(this,i),a=Object.assign({},t,e),r=Vo(this.chart,i,a),l=Wo(i,a,r,this.chart);this.xAlign=r.xAlign,this.yAlign=r.yAlign,n={opacity:1,x:l.x,y:l.y,width:e.width,height:e.height,caretX:t.x,caretY:t.y}}else 0!==this.opacity&&(n={opacity:0});this._tooltipItems=o,this.$context=void 0,n&&this._resolveAnimations().update(this,n),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,s){const n=this.getCaretPosition(t,i,s);e.lineTo(n.x1,n.y1),e.lineTo(n.x2,n.y2),e.lineTo(n.x3,n.y3)}getCaretPosition(t,e,i){const{xAlign:s,yAlign:n}=this,{caretSize:o,cornerRadius:a}=i,{topLeft:r,topRight:l,bottomLeft:h,bottomRight:c}=We(a),{x:d,y:u}=t,{width:f,height:g}=e;let p,m,x,b,_,y;return"center"===n?(_=u+g/2,"left"===s?(p=d,m=p-o,b=_+o,y=_-o):(p=d+f,m=p+o,b=_-o,y=_+o),x=p):(m="left"===s?d+Math.max(r,h)+o:"right"===s?d+f-Math.max(l,c)-o:this.caretX,"top"===n?(b=u,_=b-o,p=m-o,x=m+o):(b=u+g,_=b+o,p=m+o,x=m-o),y=b),{x1:p,x2:m,x3:x,y1:b,y2:_,y3:y}}drawTitle(t,e,i){const s=this.title,n=s.length;let o,a,r;if(n){const l=Ei(i.rtl,this.x,this.width);for(t.x=No(this,i.titleAlign,i),e.textAlign=l.textAlign(i.titleAlign),e.textBaseline="middle",o=He(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=o.string,r=0;r0!==t))?(t.beginPath(),t.fillStyle=n.multiKeyBackground,oe(t,{x:e,y:g,w:l,h:r,radius:a}),t.fill(),t.stroke(),t.fillStyle=o.backgroundColor,t.beginPath(),oe(t,{x:i,y:g+1,w:l-2,h:r-2,radius:a}),t.fill()):(t.fillStyle=n.multiKeyBackground,t.fillRect(e,g,l,r),t.strokeRect(e,g,l,r),t.fillStyle=o.backgroundColor,t.fillRect(i,g+1,l-2,r-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:s}=this,{bodySpacing:n,bodyAlign:o,displayColors:a,boxHeight:r,boxWidth:l,boxPadding:h}=i,c=He(i.bodyFont);let d=c.lineHeight,u=0;const f=Ei(i.rtl,this.x,this.width),g=function(i){e.fillText(i,f.x(t.x+u),t.y+d/2),t.y+=d+n},p=f.textAlign(o);let m,x,b,_,y,v,w;for(e.textAlign=o,e.textBaseline="middle",e.font=c.string,t.x=No(this,p,i),e.fillStyle=i.bodyColor,Q(this.beforeBody,g),u=a&&"right"!==p?"center"===o?l/2+h:l+2+h:0,_=0,v=s.length;_0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,s=i&&i.x,n=i&&i.y;if(s||n){const i=Ro[t.position].call(this,this._active,this._eventPosition);if(!i)return;const o=this._size=Fo(this,t),a=Object.assign({},i,this._size),r=Vo(e,t,a),l=Wo(t,a,r,e);s._to===l.x&&n._to===l.y||(this.xAlign=r.xAlign,this.yAlign=r.yAlign,this.width=o.width,this.height=o.height,this.caretX=i.x,this.caretY=i.y,this._resolveAnimations().update(this,l))}}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const s={width:this.width,height:this.height},n={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const o=Ne(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(n,t,s,e),Ii(t,e.textDirection),n.y+=o.top,this.drawTitle(n,t,e),this.drawBody(n,t,e),this.drawFooter(n,t,e),zi(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,s=t.map((({datasetIndex:t,index:e})=>{const i=this.chart.getDatasetMeta(t);if(!i)throw new Error("Cannot find a dataset at index "+t);return{datasetIndex:t,element:i.data[e],index:e}})),n=!tt(i,s),o=this._positionChanged(s,e);(n||o)&&(this._active=s,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const s=this.options,n=this._active||[],o=this._getActiveElements(t,n,e,i),a=this._positionChanged(o,t),r=e||!tt(o,n)||a;return r&&(this._active=o,(s.enabled||s.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),r}_getActiveElements(t,e,i,s){const n=this.options;if("mouseout"===t.type)return[];if(!s)return e;const o=this.chart.getElementsAtEventForMode(t,n.mode,n,i);return n.reverse&&o.reverse(),o}_positionChanged(t,e){const{caretX:i,caretY:s,options:n}=this,o=Ro[n.position].call(this,t,e);return!1!==o&&(i!==o.x||s!==o.y)}}$o.positioners=Ro;var Yo={id:"tooltip",_element:$o,positioners:Ro,afterInit(t,e,i){i&&(t.tooltip=new $o({chart:t,options:i}))},beforeUpdate(t,e,i){t.tooltip&&t.tooltip.initialize(i)},reset(t,e,i){t.tooltip&&t.tooltip.initialize(i)},afterDraw(t){const e=t.tooltip,i={tooltip:e};!1!==t.notifyPlugins("beforeTooltipDraw",i)&&(e&&e.draw(t.ctx),t.notifyPlugins("afterTooltipDraw",i))},afterEvent(t,e){if(t.tooltip){const i=e.replay;t.tooltip.handleEvent(e.event,i,e.inChartArea)&&(e.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(t,e)=>e.bodyFont.size,boxWidth:(t,e)=>e.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:{beforeTitle:H,title(t){if(t.length>0){const e=t[0],i=e.chart.data.labels,s=i?i.length:0;if(this&&this.options&&"dataset"===this.options.mode)return e.dataset.label||"";if(e.label)return e.label;if(s>0&&e.dataIndex"filter"!==t&&"itemSort"!==t&&"external"!==t,_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]},Uo=Object.freeze({__proto__:null,Decimation:ro,Filler:So,Legend:Co,SubTitle:Lo,Title:Ao,Tooltip:Yo});function Xo(t,e,i,s){const n=t.indexOf(e);if(-1===n)return((t,e,i,s)=>("string"==typeof e?(i=t.push(e)-1,s.unshift({index:i,label:e})):isNaN(e)&&(i=null),i))(t,e,i,s);return n!==t.lastIndexOf(e)?i:n}class qo extends Bs{constructor(t){super(t),this._startValue=void 0,this._valueRange=0,this._addedLabels=[]}init(t){const e=this._addedLabels;if(e.length){const t=this.getLabels();for(const{index:i,label:s}of e)t[i]===s&&t.splice(i,1);this._addedLabels=[]}super.init(t)}parse(t,e){if($(t))return null;const i=this.getLabels();return((t,e)=>null===t?null:jt(Math.round(t),0,e))(e=isFinite(e)&&i[e]===t?e:Xo(i,t,K(e,t),this._addedLabels),i.length-1)}determineDataLimits(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let{min:i,max:s}=this.getMinMax(!0);"ticks"===this.options.bounds&&(t||(i=0),e||(s=this.getLabels().length-1)),this.min=i,this.max=s}buildTicks(){const t=this.min,e=this.max,i=this.options.offset,s=[];let n=this.getLabels();n=0===t&&e===n.length-1?n:n.slice(t,e+1),this._valueRange=Math.max(n.length-(i?0:1),1),this._startValue=this.min-(i?.5:0);for(let i=t;i<=e;i++)s.push({value:i});return s}getLabelForValue(t){const e=this.getLabels();return t>=0&&te.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function Ko(t,e,{horizontal:i,minRotation:s}){const n=It(s),o=(i?Math.sin(n):Math.cos(n))||.001,a=.75*e*(""+t).length;return Math.min(e/o,a)}qo.id="category",qo.defaults={ticks:{callback:qo.prototype.getLabelForValue}};class Go extends Bs{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return $(t)||("number"==typeof t||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:s,max:n}=this;const o=t=>s=e?s:t,a=t=>n=i?n:t;if(t){const t=Ct(s),e=Ct(n);t<0&&e<0?a(0):t>0&&e>0&&o(0)}if(s===n){let e=1;(n>=Number.MAX_SAFE_INTEGER||s<=Number.MIN_SAFE_INTEGER)&&(e=Math.abs(.05*n)),a(n+e),t||o(s-e)}this.min=s,this.max=n}getTickLimit(){const t=this.options.ticks;let e,{maxTicksLimit:i,stepSize:s}=t;return s?(e=Math.ceil(this.max/s)-Math.floor(this.min/s)+1,e>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${s} would result generating up to ${e} ticks. Limiting to 1000.`),e=1e3)):(e=this.computeTickLimit(),i=i||11),i&&(e=Math.min(i,e)),e}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const s=function(t,e){const i=[],{bounds:s,step:n,min:o,max:a,precision:r,count:l,maxTicks:h,maxDigits:c,includeBounds:d}=t,u=n||1,f=h-1,{min:g,max:p}=e,m=!$(o),x=!$(a),b=!$(l),_=(p-g)/(c+1);let y,v,w,M,k=Ot((p-g)/f/u)*u;if(k<1e-14&&!m&&!x)return[{value:g},{value:p}];M=Math.ceil(p/k)-Math.floor(g/k),M>f&&(k=Ot(M*k/f/u)*u),$(r)||(y=Math.pow(10,r),k=Math.ceil(k*y)/y),"ticks"===s?(v=Math.floor(g/k)*k,w=Math.ceil(p/k)*k):(v=g,w=p),m&&x&&n&&Rt((a-o)/n,k/1e3)?(M=Math.round(Math.min((a-o)/k,h)),k=(a-o)/M,v=o,w=a):b?(v=m?o:v,w=x?a:w,M=l-1,k=(w-v)/M):(M=(w-v)/k,M=Lt(M,Math.round(M),k/1e3)?Math.round(M):Math.ceil(M));const S=Math.max(Ft(k),Ft(v));y=Math.pow(10,$(r)?S:r),v=Math.round(v*y)/y,w=Math.round(w*y)/y;let P=0;for(m&&(d&&v!==o?(i.push({value:o}),v0?i:null;this._zero=!0}determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=X(t)?Math.max(0,t):null,this.max=X(e)?Math.max(0,e):null,this.options.beginAtZero&&(this._zero=!0),this.handleTickRangeOptions()}handleTickRangeOptions(){const{minDefined:t,maxDefined:e}=this.getUserBounds();let i=this.min,s=this.max;const n=e=>i=t?i:e,o=t=>s=e?s:t,a=(t,e)=>Math.pow(10,Math.floor(Dt(t))+e);i===s&&(i<=0?(n(1),o(10)):(n(a(i,-1)),o(a(s,1)))),i<=0&&n(a(s,-1)),s<=0&&o(a(i,1)),this._zero&&this.min!==this._suggestedMin&&i===a(this.min,0)&&n(a(i,-1)),this.min=i,this.max=s}buildTicks(){const t=this.options,e=function(t,e){const i=Math.floor(Dt(e.max)),s=Math.ceil(e.max/Math.pow(10,i)),n=[];let o=q(t.min,Math.pow(10,Math.floor(Dt(e.min)))),a=Math.floor(Dt(o)),r=Math.floor(o/Math.pow(10,a)),l=a<0?Math.pow(10,Math.abs(a)):1;do{n.push({value:o,major:Jo(o)}),++r,10===r&&(r=1,++a,l=a>=0?1:l),o=Math.round(r*Math.pow(10,a)*l)/l}while(an?{start:e-i,end:e}:{start:e,end:e+i}}function ia(t){const e={l:t.left+t._padding.left,r:t.right-t._padding.right,t:t.top+t._padding.top,b:t.bottom-t._padding.bottom},i=Object.assign({},e),s=[],n=[],o=t._pointLabels.length,a=t.options.pointLabels,r=a.centerPointLabels?_t/o:0;for(let d=0;de.r&&(r=(s.end-e.r)/o,t.r=Math.max(t.r,e.r+r)),n.starte.b&&(l=(n.end-e.b)/a,t.b=Math.max(t.b,e.b+l))}function na(t){return 0===t||180===t?"center":t<180?"left":"right"}function oa(t,e,i){return"right"===i?t-=e:"center"===i&&(t-=e/2),t}function aa(t,e,i){return 90===i||270===i?t-=e/2:(i>270||i<90)&&(t-=e),t}function ra(t,e,i,s){const{ctx:n}=t;if(i)n.arc(t.xCenter,t.yCenter,e,0,yt);else{let i=t.getPointPosition(0,e);n.moveTo(i.x,i.y);for(let o=1;o{const i=J(this.options.pointLabels.callback,[t,e],this);return i||0===i?i:""})).filter(((t,e)=>this.chart.getDataVisibility(e)))}fit(){const t=this.options;t.display&&t.pointLabels.display?ia(this):this.setCenterPoint(0,0,0,0)}setCenterPoint(t,e,i,s){this.xCenter+=Math.floor((t-e)/2),this.yCenter+=Math.floor((i-s)/2),this.drawingArea-=Math.min(this.drawingArea/2,Math.max(t,e,i,s))}getIndexAngle(t){return Nt(t*(yt/(this._pointLabels.length||1))+It(this.options.startAngle||0))}getDistanceFromCenterForValue(t){if($(t))return NaN;const e=this.drawingArea/(this.max-this.min);return this.options.reverse?(this.max-t)*e:(t-this.min)*e}getValueForDistanceFromCenter(t){if($(t))return NaN;const e=t/(this.drawingArea/(this.max-this.min));return this.options.reverse?this.max-e:this.min+e}getPointLabelContext(t){const e=this._pointLabels||[];if(t>=0&&t=0;n--){const e=s.setContext(t.getPointLabelContext(n)),o=He(e.font),{x:a,y:r,textAlign:l,left:h,top:c,right:d,bottom:u}=t._pointLabelItems[n],{backdropColor:f}=e;if(!$(f)){const t=Ne(e.backdropPadding);i.fillStyle=f,i.fillRect(h-t.left,c-t.top,d-h+t.width,u-c+t.height)}se(i,t._pointLabels[n],a,r+o.lineHeight/2,o,{color:e.color,textAlign:l,textBaseline:"middle"})}}(this,n),s.display&&this.ticks.forEach(((t,e)=>{if(0!==e){a=this.getDistanceFromCenterForValue(t.value);!function(t,e,i,s){const n=t.ctx,o=e.circular,{color:a,lineWidth:r}=e;!o&&!s||!a||!r||i<0||(n.save(),n.strokeStyle=a,n.lineWidth=r,n.setLineDash(e.borderDash),n.lineDashOffset=e.borderDashOffset,n.beginPath(),ra(t,i,o,s),n.closePath(),n.stroke(),n.restore())}(this,s.setContext(this.getContext(e-1)),a,n)}})),i.display){for(t.save(),o=n-1;o>=0;o--){const s=i.setContext(this.getPointLabelContext(o)),{color:n,lineWidth:l}=s;l&&n&&(t.lineWidth=l,t.strokeStyle=n,t.setLineDash(s.borderDash),t.lineDashOffset=s.borderDashOffset,a=this.getDistanceFromCenterForValue(e.ticks.reverse?this.min:this.max),r=this.getPointPosition(o,a),t.beginPath(),t.moveTo(this.xCenter,this.yCenter),t.lineTo(r.x,r.y),t.stroke())}t.restore()}}drawBorder(){}drawLabels(){const t=this.ctx,e=this.options,i=e.ticks;if(!i.display)return;const s=this.getIndexAngle(0);let n,o;t.save(),t.translate(this.xCenter,this.yCenter),t.rotate(s),t.textAlign="center",t.textBaseline="middle",this.ticks.forEach(((s,a)=>{if(0===a&&!e.reverse)return;const r=i.setContext(this.getContext(a)),l=He(r.font);if(n=this.getDistanceFromCenterForValue(this.ticks[a].value),r.showLabelBackdrop){t.font=l.string,o=t.measureText(s.label).width,t.fillStyle=r.backdropColor;const e=Ne(r.backdropPadding);t.fillRect(-o/2-e.left,-n-l.size/2-e.top,o+e.width,l.size+e.height)}se(t,s.label,0,-n,l,{color:r.color})})),t.restore()}drawTitle(){}}la.id="radialLinear",la.defaults={display:!0,animate:!0,position:"chartArea",angleLines:{display:!0,lineWidth:1,borderDash:[],borderDashOffset:0},grid:{circular:!1},startAngle:0,ticks:{showLabelBackdrop:!0,callback:Os.formatters.numeric},pointLabels:{backdropColor:void 0,backdropPadding:2,display:!0,font:{size:10},callback:t=>t,padding:5,centerPointLabels:!1}},la.defaultRoutes={"angleLines.color":"borderColor","pointLabels.color":"color","ticks.color":"color"},la.descriptors={angleLines:{_fallback:"grid"}};const ha={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},ca=Object.keys(ha);function da(t,e){return t-e}function ua(t,e){if($(e))return null;const i=t._adapter,{parser:s,round:n,isoWeekday:o}=t._parseOpts;let a=e;return"function"==typeof s&&(a=s(a)),X(a)||(a="string"==typeof s?i.parse(a,s):i.parse(a)),null===a?null:(n&&(a="week"!==n||!Tt(o)&&!0!==o?i.startOf(a,n):i.startOf(a,"isoWeek",o)),+a)}function fa(t,e,i,s){const n=ca.length;for(let o=ca.indexOf(t);o=e?i[s]:i[n]]=!0}}else t[e]=!0}function pa(t,e,i){const s=[],n={},o=e.length;let a,r;for(a=0;a=0&&(e[l].major=!0);return e}(t,s,n,i):s}class ma extends Bs{constructor(t){super(t),this._cache={data:[],labels:[],all:[]},this._unit="day",this._majorUnit=void 0,this._offsets={},this._normalized=!1,this._parseOpts=void 0}init(t,e){const i=t.time||(t.time={}),s=this._adapter=new mn._date(t.adapters.date);ot(i.displayFormats,s.formats()),this._parseOpts={parser:i.parser,round:i.round,isoWeekday:i.isoWeekday},super.init(t),this._normalized=e.normalized}parse(t,e){return void 0===t?null:ua(this,t)}beforeLayout(){super.beforeLayout(),this._cache={data:[],labels:[],all:[]}}determineDataLimits(){const t=this.options,e=this._adapter,i=t.time.unit||"day";let{min:s,max:n,minDefined:o,maxDefined:a}=this.getUserBounds();function r(t){o||isNaN(t.min)||(s=Math.min(s,t.min)),a||isNaN(t.max)||(n=Math.max(n,t.max))}o&&a||(r(this._getLabelBounds()),"ticks"===t.bounds&&"labels"===t.ticks.source||r(this.getMinMax(!1))),s=X(s)&&!isNaN(s)?s:+e.startOf(Date.now(),i),n=X(n)&&!isNaN(n)?n:+e.endOf(Date.now(),i)+1,this.min=Math.min(s,n-1),this.max=Math.max(s+1,n)}_getLabelBounds(){const t=this.getLabelTimestamps();let e=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY;return t.length&&(e=t[0],i=t[t.length-1]),{min:e,max:i}}buildTicks(){const t=this.options,e=t.time,i=t.ticks,s="labels"===i.source?this.getLabelTimestamps():this._generate();"ticks"===t.bounds&&s.length&&(this.min=this._userMin||s[0],this.max=this._userMax||s[s.length-1]);const n=this.min,o=he(s,n,this.max);return this._unit=e.unit||(i.autoSkip?fa(e.minUnit,this.min,this.max,this._getLabelCapacity(n)):function(t,e,i,s,n){for(let o=ca.length-1;o>=ca.indexOf(i);o--){const i=ca[o];if(ha[i].common&&t._adapter.diff(n,s,i)>=e-1)return i}return ca[i?ca.indexOf(i):0]}(this,o.length,e.minUnit,this.min,this.max)),this._majorUnit=i.major.enabled&&"year"!==this._unit?function(t){for(let e=ca.indexOf(t)+1,i=ca.length;e1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+o);const f="data"===s.ticks.source&&this.getDataTimestamps();for(c=u,d=0;ct-e)).map((t=>+t))}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}_tickFormatFunction(t,e,i,s){const n=this.options,o=n.time.displayFormats,a=this._unit,r=this._majorUnit,l=a&&o[a],h=r&&o[r],c=i[e],d=r&&h&&c&&c.major,u=this._adapter.format(t,s||(d?h:l)),f=n.ticks.callback;return f?J(f,[u,e,i],this):u}generateTickLabels(t){let e,i,s;for(e=0,i=t.length;e0?a:1}getDataTimestamps(){let t,e,i=this._cache.data||[];if(i.length)return i;const s=this.getMatchingVisibleMetas();if(this._normalized&&s.length)return this._cache.data=s[0].controller.getAllParsedValues(this);for(t=0,e=s.length;t=t[r].pos&&e<=t[l].pos&&({lo:r,hi:l}=re(t,"pos",e)),({pos:s,time:o}=t[r]),({pos:n,time:a}=t[l])):(e>=t[r].time&&e<=t[l].time&&({lo:r,hi:l}=re(t,"time",e)),({time:s,pos:o}=t[r]),({time:n,pos:a}=t[l]));const h=n-s;return h?o+(a-o)*(e-s)/h:o}ma.id="time",ma.defaults={bounds:"data",adapters:{},time:{parser:!1,unit:!1,round:!1,isoWeekday:!1,minUnit:"millisecond",displayFormats:{}},ticks:{source:"auto",major:{enabled:!1}}};class ba extends ma{constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=xa(e,this.min),this._tableRange=xa(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,s=[],n=[];let o,a,r,l,h;for(o=0,a=t.length;o=e&&l<=i&&s.push(l);if(s.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(o=0,a=s.length;o99?Math.round(L/10):L),t:H<12?"a":"p",tt:H<12?"am":"pm",T:H<12?"A":"P",TT:H<12?"AM":"PM",Z:utc?"UTC":(String(date).match(timezone)||[""]).pop().replace(timezoneClip,""),o:(o>0?"-":"+")+pad(100*Math.floor(Math.abs(o)/60)+Math.abs(o)%60,4),S:["th","st","nd","rd"][d%10>3?0:(d%100-d%10!=10)*d%10]};return mask.replace(token,(function($0){return $0 in flags?flags[$0]:$0.slice(1,$0.length-1)}))}}();dateFormat.masks={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:ss",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'"},dateFormat.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"]},Date.prototype.format=function(mask,utc){return dateFormat(this,mask,utc)}; \ No newline at end of file diff --git a/assets/js/events.js b/assets/js/events.js new file mode 100755 index 0000000..c00aeeb --- /dev/null +++ b/assets/js/events.js @@ -0,0 +1,1078 @@ +// Set datepicker default value. +var datepicker_format = 'yy-mm-dd'; + +jQuery(document).ready(function($) +{ + // Image picker on terms menu + $('.mec_upload_image_button').click(function(event) + { + event.preventDefault(); + + var real_ajax_url = wp.ajax.settings.url; + wp.ajax.settings.url = real_ajax_url + '?mec_fes=1'; + + var post_id = $(this).data('post-id'); + if(post_id && post_id !== -1) wp.media.model.settings.post.id = post_id; + if(post_id === -1) wp.media.model.settings.post.id = null; + + var preview_id = 'mec_thumbnail_img'; + var input_id = 'mec_thumbnail'; + + if($(this).data('preview-id')) preview_id = $(this).data('preview-id'); + if($(this).data('input-id')) input_id = $(this).data('input-id'); + + var frame; + if(frame) + { + frame.open(); + return; + } + + frame = wp.media(); + frame.on('select', function() + { + // Grab the selected attachment. + var attachment = frame.state().get('selection').first(); + + $('#'+preview_id).html(''); + $('#'+input_id).val(attachment.attributes.url); + + $('.mec_remove_image_button').toggleClass('mec-util-hidden'); + + frame.close(); + }); + + frame.open(); + }); + + // Image remover on terms menu + $('.mec_remove_image_button').click(function(event) + { + event.preventDefault(); + + var preview_id = 'mec_thumbnail_img'; + var input_id = 'mec_thumbnail'; + + if($(this).data('preview-id')) preview_id = $(this).data('preview-id'); + if($(this).data('input-id')) input_id = $(this).data('input-id'); + + $('#'+preview_id).html(''); + $('#'+input_id).val(''); + + $('.mec_remove_image_button').toggleClass('mec-util-hidden'); + }); + + // Image picker on add event menu for location + $('.mec_location_upload_image_button').click(function(event) + { + event.preventDefault(); + + var frame; + if(frame) + { + frame.open(); + return; + } + + frame = wp.media(); + frame.on('select', function() + { + // Grab the selected attachment. + var attachment = frame.state().get('selection').first(); + + $('#mec_location_thumbnail_img').html(''); + $('#mec_location_thumbnail').val(attachment.attributes.url); + + $('.mec_location_remove_image_button').toggleClass('mec-util-hidden'); + + frame.close(); + }); + + frame.open(); + }); + + // Image remover on add event menu for location + $('.mec_location_remove_image_button').click(function(event) + { + event.preventDefault(); + + $('#mec_location_thumbnail_img').html(''); + $('#mec_location_thumbnail').val(''); + + $('.mec_location_remove_image_button').toggleClass('mec-util-hidden'); + }); + + // Image picker on add event menu for organizer + $('.mec_organizer_upload_image_button').click(function(event) + { + event.preventDefault(); + + var frame; + if(frame) + { + frame.open(); + return; + } + + frame = wp.media(); + frame.on('select', function() + { + // Grab the selected attachment. + var attachment = frame.state().get('selection').first(); + + $('#mec_organizer_thumbnail_img').html(''); + $('#mec_organizer_thumbnail').val(attachment.attributes.url); + + $('.mec_organizer_remove_image_button').toggleClass('mec-util-hidden'); + + frame.close(); + }); + + frame.open(); + }); + + // Image remover on add event menu for organizer + $('.mec_organizer_remove_image_button').click(function(event) + { + event.preventDefault(); + + $('#mec_organizer_thumbnail_img').html(''); + $('#mec_organizer_thumbnail').val(''); + + $('.mec_organizer_remove_image_button').toggleClass('mec-util-hidden'); + }); + + // Image remover on frontend event submission menu + $('#mec_fes_remove_image_button').click(function(event) + { + event.preventDefault(); + + $('#mec_fes_thumbnail_img').html(''); + $('#mec_fes_thumbnail').val(''); + $('#mec_featured_image_file').val(''); + + $('#mec_fes_remove_image_button').addClass('mec-util-hidden'); + }); + + // Location Image remover on frontend event submission menu + $('#mec_fes_location_remove_image_button').click(function(event) + { + event.preventDefault(); + + $('#mec_fes_location_thumbnail_img').html(''); + $('#mec_fes_location_thumbnail').val(''); + $('#mec_fes_location_thumbnail_file').val(''); + + $('#mec_fes_location_remove_image_button').addClass('mec-util-hidden'); + }); + + // Organizer Image remover on frontend event submission menu + $('#mec_fes_organizer_remove_image_button').click(function(event) + { + event.preventDefault(); + + $('#mec_fes_organizer_thumbnail_img').html(''); + $('#mec_fes_organizer_thumbnail').val(''); + $('#mec_fes_organizer_thumbnail_file').val(''); + + $('#mec_fes_organizer_remove_image_button').addClass('mec-util-hidden'); + }); + + var date_splite; + if(typeof mec_admin_localize !== 'undefined') + { + date_splite = mec_admin_localize.datepicker_format.split('&'); + if(date_splite[0] !== undefined && date_splite.length == 2) datepicker_format = date_splite[0]; + } + else if(typeof mecdata !== 'undefined') + { + date_splite = mecdata.datepicker_format.split( '&' ); + if(date_splite[0] !== undefined && date_splite.length == 2) datepicker_format = date_splite[0]; + } + + $('[id^="mec-book-form-btn-step"]').on('click',function() + { + setTimeout(function() + { + if($.fn.datepicker) + { + if('date' !== $('.mec-date-picker').prop('type')) + { + $('.mec-date-picker').datepicker( + { + changeYear: true, + changeMonth: true, + dateFormat: datepicker_format, + gotoCurrent: true, + yearRange: 'c-3:c+5', + }); + } + + } + }, 1000); + }); + + if($.fn.datepicker) + { + $('.mec-date-picker').datepicker( + { + changeYear: true, + changeMonth: true, + dateFormat: datepicker_format, + gotoCurrent: true, + yearRange: 'c-3:c+5', + }); + + $('#mec_start_date').datepicker( + { + changeYear: true, + changeMonth: true, + dateFormat: datepicker_format, + gotoCurrent: true, + yearRange: 'c-3:c+5', + onSelect: function(value, i) + { + const end = $("#mec_end_date"); + if(value !== i.lastVal) + { + end.datepicker("option", "minDate", value); + } + + if(end.val() === '') + { + end.val(value); + } + } + }); + + $('#mec_end_date').datepicker( + { + changeYear: true, + changeMonth: true, + dateFormat: datepicker_format, + gotoCurrent: true, + yearRange: 'c-3:c+5', + onSelect: function(value, i) + { + const start = $("#mec_start_date"); + if(value !== i.lastVal) + { + start.datepicker("option", "maxDate", value); + } + + if(start.val() === '') + { + start.val(value); + } + } + }); + + $('#mec_date_repeat_end_at_date').datepicker( + { + changeYear: true, + changeMonth: true, + dateFormat: datepicker_format, + gotoCurrent: true, + yearRange: 'c-3:c+5', + }); + + $('.mec_date_picker_dynamic_format').datepicker( + { + changeYear: true, + changeMonth: true, + dateFormat: datepicker_format, + gotoCurrent: true, + yearRange: 'c-3:c+5', + }); + + $('.mec_date_picker').datepicker( + { + changeYear: true, + changeMonth: true, + dateFormat: 'yy-mm-dd', + gotoCurrent: true, + yearRange: 'c-3:c+5', + }); + + $('.mec_date_picker_dynamic_format_start').datepicker( + { + changeYear: true, + changeMonth: true, + dateFormat: datepicker_format, + gotoCurrent: true, + yearRange: 'c-1:c+5', + onSelect: function(date) + { + var selectedDate = new Date(date); + var endDate = new Date(selectedDate.getTime()); + + var $end_picker = $(this).next(); + $end_picker.datepicker("option", "minDate", endDate); + $end_picker.datepicker("option", "maxDate", '+5y'); + } + }); + + $('.mec_date_picker_dynamic_format_end').datepicker( + { + changeYear: true, + changeMonth: true, + dateFormat: datepicker_format, + gotoCurrent: true, + yearRange: 'c-1:c+5', + }); + + trigger_period_picker(); + } + + // Initialize WP Color Picker + if($.fn.wpColorPicker) jQuery('.mec-color-picker').wpColorPicker(); + + $('#mec_location_id').on('change', function() + { + mec_location_toggle(); + }); + + $('#mec_organizer_id').on('change', function() + { + mec_organizer_toggle(); + var mec_organizer_val = parseInt($(this).val()); + var mec_additional_organizer = $(this).parent().parent().find('#mec-additional-organizer-wrap'); + + if(mec_organizer_val != 1) mec_additional_organizer.show(); + else mec_additional_organizer.hide(); + }); + + mec_location_toggle(); + mec_organizer_toggle(); + + $('#mec_repeat').on('change', function() + { + mec_repeat_toggle(); + }); + + mec_repeat_toggle(); + + $('#mec_repeat_type').on('change', function() + { + mec_repeat_type_toggle(); + }); + + mec_repeat_type_toggle(); + + $('#mec_bookings_limit_unlimited').on('change', function() + { + mec_bookings_unlimited_toggle(); + }); + + $('#mec_add_in_days').on('click', function() + { + var allday = $(this).data('allday'); + + var start = $('#mec_exceptions_in_days_start_date').val(); + if(start === '') return false; + + var end = $('#mec_exceptions_in_days_end_date').val(); + if(end === '') return false; + + var start_hour = $('#mec_exceptions_in_days_start_hour').val(); + if(start_hour.length === 1) start_hour = '0'+start_hour; + + var start_minutes = $('#mec_exceptions_in_days_start_minutes').val(); + if(start_minutes.length === 1) start_minutes = '0'+start_minutes; + + var start_ampm = $('#mec_exceptions_in_days_start_ampm').val(); + if(typeof start_ampm === 'undefined') start_ampm = ''; + + var end_hour = $('#mec_exceptions_in_days_end_hour').val(); + if(end_hour.length === 1) end_hour = '0'+end_hour; + + var end_minutes = $('#mec_exceptions_in_days_end_minutes').val(); + if(end_minutes.length === 1) end_minutes = '0'+end_minutes; + + var end_ampm = $('#mec_exceptions_in_days_end_ampm').val(); + if(typeof end_ampm === 'undefined') end_ampm = ''; + + var value = start + ':' + end + ':' + start_hour + '-' + start_minutes + '-' + start_ampm + ':' + end_hour + '-' + end_minutes + '-' + end_ampm; + var label = start + ' ' + start_hour + ':' + start_minutes + ' ' + start_ampm + ' - ' + end + ' ' + end_hour + ':' + end_minutes + ' ' + end_ampm + ''; + + // Don't add exactly same occurrences + if($('#mec_in_days input[value="'+value+'"]').length > 0) return false; + + var $key = $('#mec_new_in_days_key'); + + var key = $key.val(); + var html = $('#mec_new_in_days_raw').html().replace(/:i:/g, key).replace(/:val:/g, value).replace(/:label:/g, label); + + $('#mec_in_days').append(html); + $key.val(parseInt(key)+1); + }); + + $('#mec_edit_in_days').on('click', function() + { + // Form + const $form = $('#mec-in-days-form'); + + const modify_id = $form.data('modify'); + const $row = $('#mec_in_days_row'+modify_id); + + var allday = $(this).data('allday'); + + var start = $('#mec_exceptions_in_days_start_date').val(); + if(start === '') return false; + + var end = $('#mec_exceptions_in_days_end_date').val(); + if(end === '') return false; + + var start_hour = $('#mec_exceptions_in_days_start_hour').val(); + if(start_hour.length === 1) start_hour = '0'+start_hour; + + var start_minutes = $('#mec_exceptions_in_days_start_minutes').val(); + if(start_minutes.length === 1) start_minutes = '0'+start_minutes; + + var start_ampm = $('#mec_exceptions_in_days_start_ampm').val(); + if(typeof start_ampm === 'undefined') start_ampm = ''; + + var end_hour = $('#mec_exceptions_in_days_end_hour').val(); + if(end_hour.length === 1) end_hour = '0'+end_hour; + + var end_minutes = $('#mec_exceptions_in_days_end_minutes').val(); + if(end_minutes.length === 1) end_minutes = '0'+end_minutes; + + var end_ampm = $('#mec_exceptions_in_days_end_ampm').val(); + if(typeof end_ampm === 'undefined') end_ampm = ''; + + var value = start + ':' + end + ':' + start_hour + '-' + start_minutes + '-' + start_ampm + ':' + end_hour + '-' + end_minutes + '-' + end_ampm; + var label = start + ' ' + start_hour + ':' + start_minutes + ' ' + start_ampm + ' - ' + end + ' ' + end_hour + ':' + end_minutes + ' ' + end_ampm + ''; + + $row.find($('input[type=hidden]')).val(value); + $row.find($('.mec-in-days-day')).html(label); + + // Reset Dates + $form.parent().find($('input[type=text]')).val(''); + + // Modification Mode + $form.removeClass('mec-in-days-edit-mode').addClass('mec-in-days-add-mode').removeData('modify'); + }); + + $('#mec_cancel_in_days').on('click', function() + { + // Form + let $form = $('#mec-in-days-form'); + + // Reset Dates + $form.parent().find($('input[type=text]')).val(''); + + // Modification Mode + $form.removeClass('mec-in-days-edit-mode').addClass('mec-in-days-add-mode').removeData('modify'); + }); + + $('#mec_add_not_in_days').on('click', function() + { + let date = $('#mec_exceptions_not_in_days_date').val(); + if(date === '') return false; + + let d = date.replaceAll('-', ''); + d = d.replaceAll('/', ''); + d = d.replaceAll('.', ''); + + + let $wrapper = $('#mec_not_in_days'); + let $key = $('#mec_new_not_in_days_key'); + + let c = 'mec-date-'+d; + if($wrapper.find($('.'+c)).length) return; + + let key = $key.val(); + let html = $('#mec_new_not_in_days_raw').html().replace(/:i:/g, key).replace(/:d:/g, d).replace(/:val:/g, date); + + $wrapper.append(html); + $key.val(parseInt(key)+1); + }); + + $('#mec_add_ticket_button').on('click', function() + { + let $key = $('#mec_new_ticket_key'); + let key = $key.val(); + let html = $('#mec_new_ticket_raw').html().replace(/:i:/g, key); + + $('#mec_tickets').append(html); + $key.val(parseInt(key)+1); + + $('.mec_add_price_date_button').off('click').on('click', function() + { + mec_handle_add_price_date_button(this); + }); + + $.each($(".mec-select2"), function(i,v) + { + if($(v).attr('name').search(":i:") > 0) + { + return; + } + + if(typeof $(v).data('select2-id') == 'undefined') + { + $(v).select2(); + } + }); + + trigger_period_picker(); + }); + + $('.mec_add_price_date_button').off('click').on('click', function() + { + mec_handle_add_price_date_button(this); + }); + + mec_hourly_schedule_add_day_listener(); + + $('#mec_add_fee_button').on('click', function() + { + var key = $('#mec_new_fee_key').val(); + var html = $('#mec_new_fee_raw').html().replace(/:i:/g, key); + + $('#mec_fees_list').append(html); + $('#mec_new_fee_key').val(parseInt(key)+1); + }); + + $('#mec_add_ticket_variation_button').on('click', function() + { + var key = $('#mec_new_ticket_variation_key').val(); + var html = $('#mec_new_ticket_variation_raw').html().replace(/:i:/g, key); + + $('#mec_ticket_variations_list').append(html); + $('#mec_new_ticket_variation_key').val(parseInt(key)+1); + }); + + $('.mec-form-row.mec-available-color-row span').on('click', function() + { + $('.mec-form-row.mec-available-color-row span').removeClass('color-selected'); + $(this).addClass('color-selected'); + }); + + $('#mec_reg_form_field_types button').on('click', function() + { + var type = $(this).data('type'); + + if (type == 'mec_email') { + if ($('#mec_reg_form_fields').find('input[value="mec_email"][type="hidden"]').length) { + return false; + } + } + + if (type == 'name') { + if ($('#mec_reg_form_fields').find('input[value="name"][type="hidden"]').length) { + return false; + } + } + + var key = $('#mec_new_reg_field_key').val(); + var html = $('#mec_reg_field_'+type).html().replace(/:i:/g, key); + + $('#mec_reg_form_fields').append(html); + $('#mec_new_reg_field_key').val(parseInt(key)+1); + + // Set onclick listener for add option fields + mec_reg_fields_option_listeners(); + }); + + // Set onclick listener for add option fields + mec_reg_fields_option_listeners(); + + // Advanced Repeating + $('#mec-advanced-wraper ul > ul > li').click(function() + { + if($(this).attr('class') == '') $(this).attr('class', 'mec-active'); + else $(this).attr('class', ''); + + $('#mec_date_repeat_advanced').val($('#mec-advanced-wraper div:first-child > ul').find('.mec-active').find('span').text().slice(0, -1)); + }); + + $('#mec_event_form_field_types button').on('click', function() + { + var type = $(this).data('type'); + + var key = $('#mec_new_event_field_key').val(); + var html = $('#mec_event_field_'+type).html().replace(/:i:/g, key); + + $('#mec_event_form_fields').append(html); + $('#mec_new_event_field_key').val(parseInt(key)+1); + + // Set onclick listener for add option fields + mec_event_fields_option_listeners(); + }); + + // Set onclick listener for add option fields + mec_event_fields_option_listeners(); + + $('#mec_bfixed_form_field_types button').on('click', function() + { + var type = $(this).data('type'); + + var key = $('#mec_new_bfixed_field_key').val(); + var html = $('#mec_bfixed_field_'+type).html().replace(/:i:/g, key); + + $('#mec_bfixed_form_fields').append(html); + $('#mec_new_bfixed_field_key').val(parseInt(key)+1); + + // Set onclick listener for add option fields + mec_bfixed_fields_option_listeners(); + }); + + // Set onclick listener for add option fields + mec_bfixed_fields_option_listeners(); + + // Additional Organizers + mec_additional_organizers_listeners(); + + // Show / Hide Password + $('.mec-show-hide-password').on('click', function() + { + var $input = $(this).siblings("input"); + var current = $input.attr('type'); + + if(current === 'password') $input.attr('type', 'text'); + else $input.attr('type', 'password'); + }); + + // FAQ + $('#mec_add_faq_button').on('click', function() + { + var key = $('#mec_new_faq_key').val(); + var html = $('#mec_new_faq_raw').html().replace(/:i:/g, key); + + $('#mec_faq_list').append(html); + $('#mec_new_faq_key').val(parseInt(key)+1); + }); +}); + +function trigger_period_picker() +{ + jQuery('.mec-date-picker-start').datepicker( + { + changeYear: true, + changeMonth: true, + dateFormat: 'yy-mm-dd', + gotoCurrent: true, + yearRange: 'c-1:c+5', + onSelect: function(date) + { + const selectedDate = new Date(date); + const endDate = new Date(selectedDate.getTime()); + + const $end_picker = jQuery(this).next(); + $end_picker.datepicker("option", "minDate", endDate); + $end_picker.datepicker("option", "maxDate", '+5y'); + } + }); + + jQuery('.mec-date-picker-end').datepicker( + { + changeYear: true, + changeMonth: true, + dateFormat: 'yy-mm-dd', + gotoCurrent: true, + yearRange: 'c-1:c+5', + }); +} + +function mec_location_toggle() +{ + if(jQuery('#mec_location_id').val() != '0') jQuery('#mec_location_new_container').hide(); + else jQuery('#mec_location_new_container').show(); +} + +function mec_organizer_toggle() +{ + if(jQuery('#mec_organizer_id').val() != '0') jQuery('#mec_organizer_new_container').hide(); + else jQuery('#mec_organizer_new_container').show(); +} + +function mec_repeat_toggle() +{ + if(jQuery('#mec_repeat').is(':checked')) jQuery('.mec-form-repeating-event-row').show(); + else jQuery('.mec-form-repeating-event-row').hide(); +} + +function mec_repeat_type_toggle() +{ + var repeat_type = jQuery('#mec_repeat_type').val(); + + if(repeat_type == 'certain_weekdays') + { + jQuery('#mec_repeat_interval_container').hide(); + jQuery('#mec_repeat_certain_weekdays_container').show(); + jQuery('#mec_exceptions_in_days_container').hide(); + jQuery('#mec_end_wrapper').show(); + jQuery('#mec-advanced-wraper').hide(); + } + else if(repeat_type == 'custom_days') + { + jQuery('#mec_repeat_interval_container').hide(); + jQuery('#mec_repeat_certain_weekdays_container').hide(); + jQuery('#mec_exceptions_in_days_container').show(); + jQuery('#mec_end_wrapper').hide(); + jQuery('#mec-advanced-wraper').hide(); + } + else if(repeat_type == 'advanced') + { + jQuery('#mec_repeat_interval_container').hide(); + jQuery('#mec_repeat_certain_weekdays_container').hide(); + jQuery('#mec_exceptions_in_days_container').hide(); + jQuery('#mec_end_wrapper').show(); + jQuery('#mec-advanced-wraper').show(); + } + else if(repeat_type != 'daily' && repeat_type != 'weekly' && repeat_type != 'monthly') + { + jQuery('#mec_repeat_interval_container').hide(); + jQuery('#mec_repeat_certain_weekdays_container').hide(); + jQuery('#mec_exceptions_in_days_container').hide(); + jQuery('#mec_end_wrapper').show(); + jQuery('#mec-advanced-wraper').hide(); + } + else + { + jQuery('#mec_repeat_interval_container').show(); + jQuery('#mec_repeat_certain_weekdays_container').hide(); + jQuery('#mec_exceptions_in_days_container').hide(); + jQuery('#mec_end_wrapper').show(); + jQuery('#mec-advanced-wraper').hide(); + } +} + +function mec_in_days_remove(i) +{ + jQuery('#mec_in_days_row'+i).remove(); +} + +function mec_in_days_edit(i) +{ + // Date + let $row = jQuery('#mec_in_days_row'+i); + let value = $row.find(jQuery('input[type=hidden]')).val(); + + const values = value.split(':'); + const start_times = values[2].split('-') + const end_times = values[3].split('-') + + // Form + let $form = jQuery('#mec-in-days-form'); + + // Set Dates + jQuery('#mec_exceptions_in_days_start_date').val(values[0]); + jQuery('#mec_exceptions_in_days_end_date').val(values[1]); + + // Set Times + jQuery('#mec_exceptions_in_days_start_hour').val(parseInt(start_times[0])); + jQuery('#mec_exceptions_in_days_start_minutes').val(parseInt(start_times[1])); + jQuery('#mec_exceptions_in_days_start_ampm').val(start_times[2]); + + jQuery('#mec_exceptions_in_days_end_hour').val(parseInt(end_times[0])); + jQuery('#mec_exceptions_in_days_end_minutes').val(parseInt(end_times[1])); + jQuery('#mec_exceptions_in_days_end_ampm').val(end_times[2]); + + // Modification Mode + $form.removeClass('mec-in-days-add-mode').addClass('mec-in-days-edit-mode').data('modify', i); +} + +function mec_not_in_days_remove(i) +{ + jQuery('#mec_not_in_days_row'+i).remove(); +} + +function mec_bookings_unlimited_toggle() +{ + jQuery('#mec_bookings_limit').toggleClass('mec-util-hidden'); +} + +function mec_hourly_schedule_add_day_listener() +{ + jQuery('.mec-add-hourly-schedule-day-button').each(function() + { + jQuery(this).off('click').on('click', function() + { + var k = jQuery(this).data('key'); + var raw = jQuery(this).data('raw'); + var append = jQuery(this).data('append'); + + var key = jQuery(k).val(); + var html = jQuery(raw).html().replace(/:d:/g, key).replace(/:dd:/g, parseInt(key)+1); + + jQuery(append).append(html); + jQuery(k).val(parseInt(key)+1); + + mec_hourly_schedule_listeners(); + }); + + mec_hourly_schedule_listeners(); + }); +} + +function mec_bookings_after_occurrence_cancel_listener() +{ + jQuery('.mec-occurrences-bookings-after-occurrences-cancel').off('change').on('change', function() + { + const $dropdown = jQuery(this); + const value = $dropdown.val(); + const $moveWrapper = $dropdown.next(); + + if(value === 'move' || value === 'move_notify') + { + $moveWrapper.removeClass('w-hidden'); + } + else + { + $moveWrapper.addClass('w-hidden'); + } + }); +} + +function mec_hourly_schedule_listeners() +{ + jQuery('.mec-add-hourly-schedule-button').off('click').on('click', function() + { + var prefix = jQuery(this).data('prefix'); + var day = jQuery(this).data('day'); + var $key = jQuery('#'+prefix+'mec_new_hourly_schedule_key'+day); + + var key = $key.val(); + var html = jQuery('#'+prefix+'mec_new_hourly_schedule_raw'+day).html().replace(/:i:/g, key).replace(/:d:/g, day).replace(); + var g_field_id = prefix+"-hourly_schedules-"+day+"-schedules-:i:-description"; + var field_id = prefix+"-hourly_schedules-"+day+"-schedules-"+key+"-description"; + html = html.replace(g_field_id,field_id); + html = html.replace(':k:',key); + jQuery('#'+prefix+'mec_hourly_schedules'+day).append(html); + $key.val(parseInt(key)+1); + + wp.editor.initialize("mec"+field_id,{ + tinymce: { + wpautop: true, + plugins : 'charmap colorpicker compat3x directionality fullscreen hr image lists media paste tabfocus textcolor wordpress wpautoresize wpdialogs wpeditimage wpemoji wpgallery wplink wptextpattern wpview', + toolbar1: 'bold italic underline strikethrough | bullist numlist | blockquote hr wp_more | alignleft aligncenter alignright | link unlink | fullscreen | wp_adv', + toolbar2: 'formatselect alignjustify forecolor | pastetext removeformat charmap | outdent indent | undo redo | wp_help' + }, + quicktags: true, + mediaButtons: false, + }); + }); +} + +function mec_hourly_schedule_remove(day, i, prefix) +{ + jQuery("#"+prefix+"mec_hourly_schedule_row"+day+'_'+i).remove(); +} + +function mec_hourly_schedule_day_remove(day, prefix) +{ + jQuery("#"+prefix+"mec_meta_box_hourly_schedule_day_"+day).remove(); +} + +function mec_ticket_remove(i) +{ + jQuery("#mec_ticket_row"+i).remove(); +} + +function mec_set_event_color(color) +{ + try + { + jQuery("#mec_event_color").wpColorPicker('color', '#'+color); + } + catch(e) + { + jQuery("#mec_event_color").val(color); + } +} + +function mec_remove_fee(key) +{ + jQuery("#mec_fee_row"+key).remove(); +} + +function mec_remove_ticket_variation(key, id_prefix) +{ + jQuery("#mec_"+id_prefix+"_row"+key).remove(); +} + +function add_variation_per_ticket(ticket_id) +{ + var $input = jQuery('#mec_new_variation_per_ticket_key'); + + var key = $input.val(); + var html = jQuery('#mec_new_variation_per_ticket_raw'+ticket_id).html().replace(/:v:/g, key); + + jQuery('#mec_ticket_variations_list'+ticket_id).append(html); + $input.val(parseInt(key)+1); +} + +function mec_reg_fields_option_listeners() +{ + jQuery('button.mec-reg-field-add-option').off('click').on('click', function() + { + var field_id = jQuery(this).data('field-id'); + var key = jQuery('#mec_new_reg_field_option_key_'+field_id).val(); + var html = jQuery('#mec_reg_field_option').html().replace(/:i:/g, key).replace(/:fi:/g, field_id); + + jQuery('#mec_reg_fields_'+field_id+'_options_container').append(html); + jQuery('#mec_new_reg_field_option_key_'+field_id).val(parseInt(key)+1); + }); + + if(typeof jQuery.fn.sortable !== 'undefined') + { + jQuery("#mec_reg_form_fields").sortable( + { + handle: '.mec_reg_field_sort' + }); + + jQuery(".mec_reg_fields_options_container").sortable( + { + handle: '.mec_reg_field_option_sort' + }); + + jQuery(".mec-hourly-schedule-days").sortable( + { + handle: 'h4' + }); + + jQuery(".mec-hourly-schedule-schedules").sortable({}); + } +} + +function mec_reg_fields_option_remove(field_key, key) +{ + jQuery("#mec_reg_fields_option_"+field_key+"_"+key).remove(); +} + +function mec_reg_fields_remove(key) +{ + jQuery("#mec_reg_fields_"+key).remove(); +} + +function mec_handle_add_price_date_button(e) +{ + var key = jQuery(e).data('key'); + var p = jQuery('#mec_new_ticket_price_key_'+key).val(); + var html = jQuery('#mec_new_ticket_price_raw_'+key).html().replace(/:i:/g, key).replace(/:j:/g, p); + + jQuery('#mec-ticket-price-dates-'+key).append(html); + jQuery('#mec_new_ticket_price_key_'+key).val(parseInt(p)+1); + jQuery('#mec-ticket-price-dates-'+key+' .new_added').datepicker( + { + changeYear: true, + changeMonth: true, + dateFormat: datepicker_format, + gotoCurrent: true, + yearRange: 'c-3:c+5', + }); +} + +function mec_ticket_price_remove(ticket_key, price_key) +{ + jQuery("#mec_ticket_price_raw_"+ticket_key+"_"+price_key).remove(); +} + +function mec_event_fields_option_listeners() +{ + jQuery('button.mec-event-field-add-option').off('click').on('click', function() + { + var field_id = jQuery(this).data('field-id'); + var key = jQuery('#mec_new_event_field_option_key_'+field_id).val(); + var html = jQuery('#mec_event_field_option').html().replace(/:i:/g, key).replace(/:fi:/g, field_id); + + jQuery('#mec_event_fields_'+field_id+'_options_container').append(html); + jQuery('#mec_new_event_field_option_key_'+field_id).val(parseInt(key)+1); + }); + + if(typeof jQuery.fn.sortable !== 'undefined') + { + jQuery("#mec_event_form_fields").sortable( + { + handle: '.mec_event_field_sort' + }); + + jQuery(".mec_event_fields_options_container").sortable( + { + handle: '.mec_event_field_option_sort' + }); + } +} + +function mec_event_fields_option_remove(field_key, key) +{ + jQuery("#mec_event_fields_option_"+field_key+"_"+key).remove(); +} + +function mec_event_fields_remove(key) +{ + jQuery("#mec_event_fields_"+key).remove(); +} + +function mec_bfixed_fields_option_listeners() +{ + jQuery('button.mec-bfixed-field-add-option').off('click').on('click', function() + { + var field_id = jQuery(this).data('field-id'); + var key = jQuery('#mec_new_bfixed_field_option_key_'+field_id).val(); + var html = jQuery('#mec_bfixed_field_option').html().replace(/:i:/g, key).replace(/:fi:/g, field_id); + + jQuery('#mec_bfixed_fields_'+field_id+'_options_container').append(html); + jQuery('#mec_new_bfixed_field_option_key_'+field_id).val(parseInt(key)+1); + }); + + if(typeof jQuery.fn.sortable !== 'undefined') + { + jQuery("#mec_bfixed_form_fields").sortable( + { + handle: '.mec_bfixed_field_sort' + }); + + jQuery(".mec_bfixed_fields_options_container").sortable( + { + handle: '.mec_bfixed_field_option_sort' + }); + } +} + +function mec_bfixed_fields_option_remove(field_key, key) +{ + jQuery("#mec_bfixed_fields_option_"+field_key+"_"+key).remove(); +} + +function mec_bfixed_fields_remove(key) +{ + jQuery("#mec_bfixed_fields_"+key).remove(); +} + +function mec_additional_organizers_listeners() +{ + jQuery('#mec_additional_organizers_add').off('click').on('click', function() + { + var value = jQuery('.mec-additional-organizers select').val(); + var text = jQuery('.mec-additional-organizers select option:selected').text(); + + var sortLabel = jQuery(this).data('sort-label'); + var removeLabel = jQuery(this).data('remove-label'); + + jQuery('.mec-additional-organizers-list').append('
  • '+sortLabel+' '+removeLabel+''+text+'
  • '); + + mec_additional_organizers_listeners(); + }); + + if(typeof jQuery.fn.sortable !== 'undefined') + { + jQuery(".mec-additional-organizers-list").sortable( + { + handle: '.mec-additional-organizer-sort' + }); + } +} + +function mec_additional_organizers_remove(element) +{ + jQuery(element).parent().remove(); +} + +function mec_faq_remove(key) +{ + jQuery("#mec_faq_row"+key).remove(); +} \ No newline at end of file diff --git a/assets/js/flipcount-divi.js b/assets/js/flipcount-divi.js new file mode 100755 index 0000000..2d18f23 --- /dev/null +++ b/assets/js/flipcount-divi.js @@ -0,0 +1,1954 @@ +/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */ +!function (e, t) { "use strict"; "object" == typeof module && "object" == typeof module.exports ? module.exports = e.document ? t(e, !0) : function (e) { if (!e.document) throw new Error("jQuery requires a window with a document"); return t(e) } : t(e) }("undefined" != typeof window ? window : this, function (C, e) { "use strict"; var t = [], r = Object.getPrototypeOf, s = t.slice, g = t.flat ? function (e) { return t.flat.call(e) } : function (e) { return t.concat.apply([], e) }, u = t.push, i = t.indexOf, n = {}, o = n.toString, v = n.hasOwnProperty, a = v.toString, l = a.call(Object), y = {}, m = function (e) { return "function" == typeof e && "number" != typeof e.nodeType && "function" != typeof e.item }, x = function (e) { return null != e && e === e.window }, E = C.document, c = { type: !0, src: !0, nonce: !0, noModule: !0 }; function b(e, t, n) { var r, i, o = (n = n || E).createElement("script"); if (o.text = e, t) for (r in c) (i = t[r] || t.getAttribute && t.getAttribute(r)) && o.setAttribute(r, i); n.head.appendChild(o).parentNode.removeChild(o) } function w(e) { return null == e ? e + "" : "object" == typeof e || "function" == typeof e ? n[o.call(e)] || "object" : typeof e } var f = "3.6.0", S = function (e, t) { return new S.fn.init(e, t) }; function p(e) { var t = !!e && "length" in e && e.length, n = w(e); return !m(e) && !x(e) && ("array" === n || 0 === t || "number" == typeof t && 0 < t && t - 1 in e) } S.fn = S.prototype = { jquery: f, constructor: S, length: 0, toArray: function () { return s.call(this) }, get: function (e) { return null == e ? s.call(this) : e < 0 ? this[e + this.length] : this[e] }, pushStack: function (e) { var t = S.merge(this.constructor(), e); return t.prevObject = this, t }, each: function (e) { return S.each(this, e) }, map: function (n) { return this.pushStack(S.map(this, function (e, t) { return n.call(e, t, e) })) }, slice: function () { return this.pushStack(s.apply(this, arguments)) }, first: function () { return this.eq(0) }, last: function () { return this.eq(-1) }, even: function () { return this.pushStack(S.grep(this, function (e, t) { return (t + 1) % 2 })) }, odd: function () { return this.pushStack(S.grep(this, function (e, t) { return t % 2 })) }, eq: function (e) { var t = this.length, n = +e + (e < 0 ? t : 0); return this.pushStack(0 <= n && n < t ? [this[n]] : []) }, end: function () { return this.prevObject || this.constructor() }, push: u, sort: t.sort, splice: t.splice }, S.extend = S.fn.extend = function () { var e, t, n, r, i, o, a = arguments[0] || {}, s = 1, u = arguments.length, l = !1; for ("boolean" == typeof a && (l = a, a = arguments[s] || {}, s++), "object" == typeof a || m(a) || (a = {}), s === u && (a = this, s--); s < u; s++)if (null != (e = arguments[s])) for (t in e) r = e[t], "__proto__" !== t && a !== r && (l && r && (S.isPlainObject(r) || (i = Array.isArray(r))) ? (n = a[t], o = i && !Array.isArray(n) ? [] : i || S.isPlainObject(n) ? n : {}, i = !1, a[t] = S.extend(l, o, r)) : void 0 !== r && (a[t] = r)); return a }, S.extend({ expando: "jQuery" + (f + Math.random()).replace(/\D/g, ""), isReady: !0, error: function (e) { throw new Error(e) }, noop: function () { }, isPlainObject: function (e) { var t, n; return !(!e || "[object Object]" !== o.call(e)) && (!(t = r(e)) || "function" == typeof (n = v.call(t, "constructor") && t.constructor) && a.call(n) === l) }, isEmptyObject: function (e) { var t; for (t in e) return !1; return !0 }, globalEval: function (e, t, n) { b(e, { nonce: t && t.nonce }, n) }, each: function (e, t) { var n, r = 0; if (p(e)) { for (n = e.length; r < n; r++)if (!1 === t.call(e[r], r, e[r])) break } else for (r in e) if (!1 === t.call(e[r], r, e[r])) break; return e }, makeArray: function (e, t) { var n = t || []; return null != e && (p(Object(e)) ? S.merge(n, "string" == typeof e ? [e] : e) : u.call(n, e)), n }, inArray: function (e, t, n) { return null == t ? -1 : i.call(t, e, n) }, merge: function (e, t) { for (var n = +t.length, r = 0, i = e.length; r < n; r++)e[i++] = t[r]; return e.length = i, e }, grep: function (e, t, n) { for (var r = [], i = 0, o = e.length, a = !n; i < o; i++)!t(e[i], i) !== a && r.push(e[i]); return r }, map: function (e, t, n) { var r, i, o = 0, a = []; if (p(e)) for (r = e.length; o < r; o++)null != (i = t(e[o], o, n)) && a.push(i); else for (o in e) null != (i = t(e[o], o, n)) && a.push(i); return g(a) }, guid: 1, support: y }), "function" == typeof Symbol && (S.fn[Symbol.iterator] = t[Symbol.iterator]), S.each("Boolean Number String Function Array Date RegExp Object Error Symbol".split(" "), function (e, t) { n["[object " + t + "]"] = t.toLowerCase() }); var d = function (n) { var e, d, b, o, i, h, f, g, w, u, l, T, C, a, E, v, s, c, y, S = "sizzle" + 1 * new Date, p = n.document, k = 0, r = 0, m = ue(), x = ue(), A = ue(), N = ue(), j = function (e, t) { return e === t && (l = !0), 0 }, D = {}.hasOwnProperty, t = [], q = t.pop, L = t.push, H = t.push, O = t.slice, P = function (e, t) { for (var n = 0, r = e.length; n < r; n++)if (e[n] === t) return n; return -1 }, R = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", M = "[\\x20\\t\\r\\n\\f]", I = "(?:\\\\[\\da-fA-F]{1,6}" + M + "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", W = "\\[" + M + "*(" + I + ")(?:" + M + "*([*^$|!~]?=)" + M + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + I + "))|)" + M + "*\\]", F = ":(" + I + ")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|" + W + ")*)|.*)\\)|)", B = new RegExp(M + "+", "g"), $ = new RegExp("^" + M + "+|((?:^|[^\\\\])(?:\\\\.)*)" + M + "+$", "g"), _ = new RegExp("^" + M + "*," + M + "*"), z = new RegExp("^" + M + "*([>+~]|" + M + ")" + M + "*"), U = new RegExp(M + "|>"), X = new RegExp(F), V = new RegExp("^" + I + "$"), G = { ID: new RegExp("^#(" + I + ")"), CLASS: new RegExp("^\\.(" + I + ")"), TAG: new RegExp("^(" + I + "|[*])"), ATTR: new RegExp("^" + W), PSEUDO: new RegExp("^" + F), CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + M + "*(even|odd|(([+-]|)(\\d*)n|)" + M + "*(?:([+-]|)" + M + "*(\\d+)|))" + M + "*\\)|)", "i"), bool: new RegExp("^(?:" + R + ")$", "i"), needsContext: new RegExp("^" + M + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + M + "*((?:-\\d)?\\d*)" + M + "*\\)|)(?=[^-]|$)", "i") }, Y = /HTML$/i, Q = /^(?:input|select|textarea|button)$/i, J = /^h\d$/i, K = /^[^{]+\{\s*\[native \w/, Z = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, ee = /[+~]/, te = new RegExp("\\\\[\\da-fA-F]{1,6}" + M + "?|\\\\([^\\r\\n\\f])", "g"), ne = function (e, t) { var n = "0x" + e.slice(1) - 65536; return t || (n < 0 ? String.fromCharCode(n + 65536) : String.fromCharCode(n >> 10 | 55296, 1023 & n | 56320)) }, re = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, ie = function (e, t) { return t ? "\0" === e ? "\ufffd" : e.slice(0, -1) + "\\" + e.charCodeAt(e.length - 1).toString(16) + " " : "\\" + e }, oe = function () { T() }, ae = be(function (e) { return !0 === e.disabled && "fieldset" === e.nodeName.toLowerCase() }, { dir: "parentNode", next: "legend" }); try { H.apply(t = O.call(p.childNodes), p.childNodes), t[p.childNodes.length].nodeType } catch (e) { H = { apply: t.length ? function (e, t) { L.apply(e, O.call(t)) } : function (e, t) { var n = e.length, r = 0; while (e[n++] = t[r++]); e.length = n - 1 } } } function se(t, e, n, r) { var i, o, a, s, u, l, c, f = e && e.ownerDocument, p = e ? e.nodeType : 9; if (n = n || [], "string" != typeof t || !t || 1 !== p && 9 !== p && 11 !== p) return n; if (!r && (T(e), e = e || C, E)) { if (11 !== p && (u = Z.exec(t))) if (i = u[1]) { if (9 === p) { if (!(a = e.getElementById(i))) return n; if (a.id === i) return n.push(a), n } else if (f && (a = f.getElementById(i)) && y(e, a) && a.id === i) return n.push(a), n } else { if (u[2]) return H.apply(n, e.getElementsByTagName(t)), n; if ((i = u[3]) && d.getElementsByClassName && e.getElementsByClassName) return H.apply(n, e.getElementsByClassName(i)), n } if (d.qsa && !N[t + " "] && (!v || !v.test(t)) && (1 !== p || "object" !== e.nodeName.toLowerCase())) { if (c = t, f = e, 1 === p && (U.test(t) || z.test(t))) { (f = ee.test(t) && ye(e.parentNode) || e) === e && d.scope || ((s = e.getAttribute("id")) ? s = s.replace(re, ie) : e.setAttribute("id", s = S)), o = (l = h(t)).length; while (o--) l[o] = (s ? "#" + s : ":scope") + " " + xe(l[o]); c = l.join(",") } try { return H.apply(n, f.querySelectorAll(c)), n } catch (e) { N(t, !0) } finally { s === S && e.removeAttribute("id") } } } return g(t.replace($, "$1"), e, n, r) } function ue() { var r = []; return function e(t, n) { return r.push(t + " ") > b.cacheLength && delete e[r.shift()], e[t + " "] = n } } function le(e) { return e[S] = !0, e } function ce(e) { var t = C.createElement("fieldset"); try { return !!e(t) } catch (e) { return !1 } finally { t.parentNode && t.parentNode.removeChild(t), t = null } } function fe(e, t) { var n = e.split("|"), r = n.length; while (r--) b.attrHandle[n[r]] = t } function pe(e, t) { var n = t && e, r = n && 1 === e.nodeType && 1 === t.nodeType && e.sourceIndex - t.sourceIndex; if (r) return r; if (n) while (n = n.nextSibling) if (n === t) return -1; return e ? 1 : -1 } function de(t) { return function (e) { return "input" === e.nodeName.toLowerCase() && e.type === t } } function he(n) { return function (e) { var t = e.nodeName.toLowerCase(); return ("input" === t || "button" === t) && e.type === n } } function ge(t) { return function (e) { return "form" in e ? e.parentNode && !1 === e.disabled ? "label" in e ? "label" in e.parentNode ? e.parentNode.disabled === t : e.disabled === t : e.isDisabled === t || e.isDisabled !== !t && ae(e) === t : e.disabled === t : "label" in e && e.disabled === t } } function ve(a) { return le(function (o) { return o = +o, le(function (e, t) { var n, r = a([], e.length, o), i = r.length; while (i--) e[n = r[i]] && (e[n] = !(t[n] = e[n])) }) }) } function ye(e) { return e && "undefined" != typeof e.getElementsByTagName && e } for (e in d = se.support = {}, i = se.isXML = function (e) { var t = e && e.namespaceURI, n = e && (e.ownerDocument || e).documentElement; return !Y.test(t || n && n.nodeName || "HTML") }, T = se.setDocument = function (e) { var t, n, r = e ? e.ownerDocument || e : p; return r != C && 9 === r.nodeType && r.documentElement && (a = (C = r).documentElement, E = !i(C), p != C && (n = C.defaultView) && n.top !== n && (n.addEventListener ? n.addEventListener("unload", oe, !1) : n.attachEvent && n.attachEvent("onunload", oe)), d.scope = ce(function (e) { return a.appendChild(e).appendChild(C.createElement("div")), "undefined" != typeof e.querySelectorAll && !e.querySelectorAll(":scope fieldset div").length }), d.attributes = ce(function (e) { return e.className = "i", !e.getAttribute("className") }), d.getElementsByTagName = ce(function (e) { return e.appendChild(C.createComment("")), !e.getElementsByTagName("*").length }), d.getElementsByClassName = K.test(C.getElementsByClassName), d.getById = ce(function (e) { return a.appendChild(e).id = S, !C.getElementsByName || !C.getElementsByName(S).length }), d.getById ? (b.filter.ID = function (e) { var t = e.replace(te, ne); return function (e) { return e.getAttribute("id") === t } }, b.find.ID = function (e, t) { if ("undefined" != typeof t.getElementById && E) { var n = t.getElementById(e); return n ? [n] : [] } }) : (b.filter.ID = function (e) { var n = e.replace(te, ne); return function (e) { var t = "undefined" != typeof e.getAttributeNode && e.getAttributeNode("id"); return t && t.value === n } }, b.find.ID = function (e, t) { if ("undefined" != typeof t.getElementById && E) { var n, r, i, o = t.getElementById(e); if (o) { if ((n = o.getAttributeNode("id")) && n.value === e) return [o]; i = t.getElementsByName(e), r = 0; while (o = i[r++]) if ((n = o.getAttributeNode("id")) && n.value === e) return [o] } return [] } }), b.find.TAG = d.getElementsByTagName ? function (e, t) { return "undefined" != typeof t.getElementsByTagName ? t.getElementsByTagName(e) : d.qsa ? t.querySelectorAll(e) : void 0 } : function (e, t) { var n, r = [], i = 0, o = t.getElementsByTagName(e); if ("*" === e) { while (n = o[i++]) 1 === n.nodeType && r.push(n); return r } return o }, b.find.CLASS = d.getElementsByClassName && function (e, t) { if ("undefined" != typeof t.getElementsByClassName && E) return t.getElementsByClassName(e) }, s = [], v = [], (d.qsa = K.test(C.querySelectorAll)) && (ce(function (e) { var t; a.appendChild(e).innerHTML = "", e.querySelectorAll("[msallowcapture^='']").length && v.push("[*^$]=" + M + "*(?:''|\"\")"), e.querySelectorAll("[selected]").length || v.push("\\[" + M + "*(?:value|" + R + ")"), e.querySelectorAll("[id~=" + S + "-]").length || v.push("~="), (t = C.createElement("input")).setAttribute("name", ""), e.appendChild(t), e.querySelectorAll("[name='']").length || v.push("\\[" + M + "*name" + M + "*=" + M + "*(?:''|\"\")"), e.querySelectorAll(":checked").length || v.push(":checked"), e.querySelectorAll("a#" + S + "+*").length || v.push(".#.+[+~]"), e.querySelectorAll("\\\f"), v.push("[\\r\\n\\f]") }), ce(function (e) { e.innerHTML = ""; var t = C.createElement("input"); t.setAttribute("type", "hidden"), e.appendChild(t).setAttribute("name", "D"), e.querySelectorAll("[name=d]").length && v.push("name" + M + "*[*^$|!~]?="), 2 !== e.querySelectorAll(":enabled").length && v.push(":enabled", ":disabled"), a.appendChild(e).disabled = !0, 2 !== e.querySelectorAll(":disabled").length && v.push(":enabled", ":disabled"), e.querySelectorAll("*,:x"), v.push(",.*:") })), (d.matchesSelector = K.test(c = a.matches || a.webkitMatchesSelector || a.mozMatchesSelector || a.oMatchesSelector || a.msMatchesSelector)) && ce(function (e) { d.disconnectedMatch = c.call(e, "*"), c.call(e, "[s!='']:x"), s.push("!=", F) }), v = v.length && new RegExp(v.join("|")), s = s.length && new RegExp(s.join("|")), t = K.test(a.compareDocumentPosition), y = t || K.test(a.contains) ? function (e, t) { var n = 9 === e.nodeType ? e.documentElement : e, r = t && t.parentNode; return e === r || !(!r || 1 !== r.nodeType || !(n.contains ? n.contains(r) : e.compareDocumentPosition && 16 & e.compareDocumentPosition(r))) } : function (e, t) { if (t) while (t = t.parentNode) if (t === e) return !0; return !1 }, j = t ? function (e, t) { if (e === t) return l = !0, 0; var n = !e.compareDocumentPosition - !t.compareDocumentPosition; return n || (1 & (n = (e.ownerDocument || e) == (t.ownerDocument || t) ? e.compareDocumentPosition(t) : 1) || !d.sortDetached && t.compareDocumentPosition(e) === n ? e == C || e.ownerDocument == p && y(p, e) ? -1 : t == C || t.ownerDocument == p && y(p, t) ? 1 : u ? P(u, e) - P(u, t) : 0 : 4 & n ? -1 : 1) } : function (e, t) { if (e === t) return l = !0, 0; var n, r = 0, i = e.parentNode, o = t.parentNode, a = [e], s = [t]; if (!i || !o) return e == C ? -1 : t == C ? 1 : i ? -1 : o ? 1 : u ? P(u, e) - P(u, t) : 0; if (i === o) return pe(e, t); n = e; while (n = n.parentNode) a.unshift(n); n = t; while (n = n.parentNode) s.unshift(n); while (a[r] === s[r]) r++; return r ? pe(a[r], s[r]) : a[r] == p ? -1 : s[r] == p ? 1 : 0 }), C }, se.matches = function (e, t) { return se(e, null, null, t) }, se.matchesSelector = function (e, t) { if (T(e), d.matchesSelector && E && !N[t + " "] && (!s || !s.test(t)) && (!v || !v.test(t))) try { var n = c.call(e, t); if (n || d.disconnectedMatch || e.document && 11 !== e.document.nodeType) return n } catch (e) { N(t, !0) } return 0 < se(t, C, null, [e]).length }, se.contains = function (e, t) { return (e.ownerDocument || e) != C && T(e), y(e, t) }, se.attr = function (e, t) { (e.ownerDocument || e) != C && T(e); var n = b.attrHandle[t.toLowerCase()], r = n && D.call(b.attrHandle, t.toLowerCase()) ? n(e, t, !E) : void 0; return void 0 !== r ? r : d.attributes || !E ? e.getAttribute(t) : (r = e.getAttributeNode(t)) && r.specified ? r.value : null }, se.escape = function (e) { return (e + "").replace(re, ie) }, se.error = function (e) { throw new Error("Syntax error, unrecognized expression: " + e) }, se.uniqueSort = function (e) { var t, n = [], r = 0, i = 0; if (l = !d.detectDuplicates, u = !d.sortStable && e.slice(0), e.sort(j), l) { while (t = e[i++]) t === e[i] && (r = n.push(i)); while (r--) e.splice(n[r], 1) } return u = null, e }, o = se.getText = function (e) { var t, n = "", r = 0, i = e.nodeType; if (i) { if (1 === i || 9 === i || 11 === i) { if ("string" == typeof e.textContent) return e.textContent; for (e = e.firstChild; e; e = e.nextSibling)n += o(e) } else if (3 === i || 4 === i) return e.nodeValue } else while (t = e[r++]) n += o(t); return n }, (b = se.selectors = { cacheLength: 50, createPseudo: le, match: G, attrHandle: {}, find: {}, relative: { ">": { dir: "parentNode", first: !0 }, " ": { dir: "parentNode" }, "+": { dir: "previousSibling", first: !0 }, "~": { dir: "previousSibling" } }, preFilter: { ATTR: function (e) { return e[1] = e[1].replace(te, ne), e[3] = (e[3] || e[4] || e[5] || "").replace(te, ne), "~=" === e[2] && (e[3] = " " + e[3] + " "), e.slice(0, 4) }, CHILD: function (e) { return e[1] = e[1].toLowerCase(), "nth" === e[1].slice(0, 3) ? (e[3] || se.error(e[0]), e[4] = +(e[4] ? e[5] + (e[6] || 1) : 2 * ("even" === e[3] || "odd" === e[3])), e[5] = +(e[7] + e[8] || "odd" === e[3])) : e[3] && se.error(e[0]), e }, PSEUDO: function (e) { var t, n = !e[6] && e[2]; return G.CHILD.test(e[0]) ? null : (e[3] ? e[2] = e[4] || e[5] || "" : n && X.test(n) && (t = h(n, !0)) && (t = n.indexOf(")", n.length - t) - n.length) && (e[0] = e[0].slice(0, t), e[2] = n.slice(0, t)), e.slice(0, 3)) } }, filter: { TAG: function (e) { var t = e.replace(te, ne).toLowerCase(); return "*" === e ? function () { return !0 } : function (e) { return e.nodeName && e.nodeName.toLowerCase() === t } }, CLASS: function (e) { var t = m[e + " "]; return t || (t = new RegExp("(^|" + M + ")" + e + "(" + M + "|$)")) && m(e, function (e) { return t.test("string" == typeof e.className && e.className || "undefined" != typeof e.getAttribute && e.getAttribute("class") || "") }) }, ATTR: function (n, r, i) { return function (e) { var t = se.attr(e, n); return null == t ? "!=" === r : !r || (t += "", "=" === r ? t === i : "!=" === r ? t !== i : "^=" === r ? i && 0 === t.indexOf(i) : "*=" === r ? i && -1 < t.indexOf(i) : "$=" === r ? i && t.slice(-i.length) === i : "~=" === r ? -1 < (" " + t.replace(B, " ") + " ").indexOf(i) : "|=" === r && (t === i || t.slice(0, i.length + 1) === i + "-")) } }, CHILD: function (h, e, t, g, v) { var y = "nth" !== h.slice(0, 3), m = "last" !== h.slice(-4), x = "of-type" === e; return 1 === g && 0 === v ? function (e) { return !!e.parentNode } : function (e, t, n) { var r, i, o, a, s, u, l = y !== m ? "nextSibling" : "previousSibling", c = e.parentNode, f = x && e.nodeName.toLowerCase(), p = !n && !x, d = !1; if (c) { if (y) { while (l) { a = e; while (a = a[l]) if (x ? a.nodeName.toLowerCase() === f : 1 === a.nodeType) return !1; u = l = "only" === h && !u && "nextSibling" } return !0 } if (u = [m ? c.firstChild : c.lastChild], m && p) { d = (s = (r = (i = (o = (a = c)[S] || (a[S] = {}))[a.uniqueID] || (o[a.uniqueID] = {}))[h] || [])[0] === k && r[1]) && r[2], a = s && c.childNodes[s]; while (a = ++s && a && a[l] || (d = s = 0) || u.pop()) if (1 === a.nodeType && ++d && a === e) { i[h] = [k, s, d]; break } } else if (p && (d = s = (r = (i = (o = (a = e)[S] || (a[S] = {}))[a.uniqueID] || (o[a.uniqueID] = {}))[h] || [])[0] === k && r[1]), !1 === d) while (a = ++s && a && a[l] || (d = s = 0) || u.pop()) if ((x ? a.nodeName.toLowerCase() === f : 1 === a.nodeType) && ++d && (p && ((i = (o = a[S] || (a[S] = {}))[a.uniqueID] || (o[a.uniqueID] = {}))[h] = [k, d]), a === e)) break; return (d -= v) === g || d % g == 0 && 0 <= d / g } } }, PSEUDO: function (e, o) { var t, a = b.pseudos[e] || b.setFilters[e.toLowerCase()] || se.error("unsupported pseudo: " + e); return a[S] ? a(o) : 1 < a.length ? (t = [e, e, "", o], b.setFilters.hasOwnProperty(e.toLowerCase()) ? le(function (e, t) { var n, r = a(e, o), i = r.length; while (i--) e[n = P(e, r[i])] = !(t[n] = r[i]) }) : function (e) { return a(e, 0, t) }) : a } }, pseudos: { not: le(function (e) { var r = [], i = [], s = f(e.replace($, "$1")); return s[S] ? le(function (e, t, n, r) { var i, o = s(e, null, r, []), a = e.length; while (a--) (i = o[a]) && (e[a] = !(t[a] = i)) }) : function (e, t, n) { return r[0] = e, s(r, null, n, i), r[0] = null, !i.pop() } }), has: le(function (t) { return function (e) { return 0 < se(t, e).length } }), contains: le(function (t) { return t = t.replace(te, ne), function (e) { return -1 < (e.textContent || o(e)).indexOf(t) } }), lang: le(function (n) { return V.test(n || "") || se.error("unsupported lang: " + n), n = n.replace(te, ne).toLowerCase(), function (e) { var t; do { if (t = E ? e.lang : e.getAttribute("xml:lang") || e.getAttribute("lang")) return (t = t.toLowerCase()) === n || 0 === t.indexOf(n + "-") } while ((e = e.parentNode) && 1 === e.nodeType); return !1 } }), target: function (e) { var t = n.location && n.location.hash; return t && t.slice(1) === e.id }, root: function (e) { return e === a }, focus: function (e) { return e === C.activeElement && (!C.hasFocus || C.hasFocus()) && !!(e.type || e.href || ~e.tabIndex) }, enabled: ge(!1), disabled: ge(!0), checked: function (e) { var t = e.nodeName.toLowerCase(); return "input" === t && !!e.checked || "option" === t && !!e.selected }, selected: function (e) { return e.parentNode && e.parentNode.selectedIndex, !0 === e.selected }, empty: function (e) { for (e = e.firstChild; e; e = e.nextSibling)if (e.nodeType < 6) return !1; return !0 }, parent: function (e) { return !b.pseudos.empty(e) }, header: function (e) { return J.test(e.nodeName) }, input: function (e) { return Q.test(e.nodeName) }, button: function (e) { var t = e.nodeName.toLowerCase(); return "input" === t && "button" === e.type || "button" === t }, text: function (e) { var t; return "input" === e.nodeName.toLowerCase() && "text" === e.type && (null == (t = e.getAttribute("type")) || "text" === t.toLowerCase()) }, first: ve(function () { return [0] }), last: ve(function (e, t) { return [t - 1] }), eq: ve(function (e, t, n) { return [n < 0 ? n + t : n] }), even: ve(function (e, t) { for (var n = 0; n < t; n += 2)e.push(n); return e }), odd: ve(function (e, t) { for (var n = 1; n < t; n += 2)e.push(n); return e }), lt: ve(function (e, t, n) { for (var r = n < 0 ? n + t : t < n ? t : n; 0 <= --r;)e.push(r); return e }), gt: ve(function (e, t, n) { for (var r = n < 0 ? n + t : n; ++r < t;)e.push(r); return e }) } }).pseudos.nth = b.pseudos.eq, { radio: !0, checkbox: !0, file: !0, password: !0, image: !0 }) b.pseudos[e] = de(e); for (e in { submit: !0, reset: !0 }) b.pseudos[e] = he(e); function me() { } function xe(e) { for (var t = 0, n = e.length, r = ""; t < n; t++)r += e[t].value; return r } function be(s, e, t) { var u = e.dir, l = e.next, c = l || u, f = t && "parentNode" === c, p = r++; return e.first ? function (e, t, n) { while (e = e[u]) if (1 === e.nodeType || f) return s(e, t, n); return !1 } : function (e, t, n) { var r, i, o, a = [k, p]; if (n) { while (e = e[u]) if ((1 === e.nodeType || f) && s(e, t, n)) return !0 } else while (e = e[u]) if (1 === e.nodeType || f) if (i = (o = e[S] || (e[S] = {}))[e.uniqueID] || (o[e.uniqueID] = {}), l && l === e.nodeName.toLowerCase()) e = e[u] || e; else { if ((r = i[c]) && r[0] === k && r[1] === p) return a[2] = r[2]; if ((i[c] = a)[2] = s(e, t, n)) return !0 } return !1 } } function we(i) { return 1 < i.length ? function (e, t, n) { var r = i.length; while (r--) if (!i[r](e, t, n)) return !1; return !0 } : i[0] } function Te(e, t, n, r, i) { for (var o, a = [], s = 0, u = e.length, l = null != t; s < u; s++)(o = e[s]) && (n && !n(o, r, i) || (a.push(o), l && t.push(s))); return a } function Ce(d, h, g, v, y, e) { return v && !v[S] && (v = Ce(v)), y && !y[S] && (y = Ce(y, e)), le(function (e, t, n, r) { var i, o, a, s = [], u = [], l = t.length, c = e || function (e, t, n) { for (var r = 0, i = t.length; r < i; r++)se(e, t[r], n); return n }(h || "*", n.nodeType ? [n] : n, []), f = !d || !e && h ? c : Te(c, s, d, n, r), p = g ? y || (e ? d : l || v) ? [] : t : f; if (g && g(f, p, n, r), v) { i = Te(p, u), v(i, [], n, r), o = i.length; while (o--) (a = i[o]) && (p[u[o]] = !(f[u[o]] = a)) } if (e) { if (y || d) { if (y) { i = [], o = p.length; while (o--) (a = p[o]) && i.push(f[o] = a); y(null, p = [], i, r) } o = p.length; while (o--) (a = p[o]) && -1 < (i = y ? P(e, a) : s[o]) && (e[i] = !(t[i] = a)) } } else p = Te(p === t ? p.splice(l, p.length) : p), y ? y(null, t, p, r) : H.apply(t, p) }) } function Ee(e) { for (var i, t, n, r = e.length, o = b.relative[e[0].type], a = o || b.relative[" "], s = o ? 1 : 0, u = be(function (e) { return e === i }, a, !0), l = be(function (e) { return -1 < P(i, e) }, a, !0), c = [function (e, t, n) { var r = !o && (n || t !== w) || ((i = t).nodeType ? u(e, t, n) : l(e, t, n)); return i = null, r }]; s < r; s++)if (t = b.relative[e[s].type]) c = [be(we(c), t)]; else { if ((t = b.filter[e[s].type].apply(null, e[s].matches))[S]) { for (n = ++s; n < r; n++)if (b.relative[e[n].type]) break; return Ce(1 < s && we(c), 1 < s && xe(e.slice(0, s - 1).concat({ value: " " === e[s - 2].type ? "*" : "" })).replace($, "$1"), t, s < n && Ee(e.slice(s, n)), n < r && Ee(e = e.slice(n)), n < r && xe(e)) } c.push(t) } return we(c) } return me.prototype = b.filters = b.pseudos, b.setFilters = new me, h = se.tokenize = function (e, t) { var n, r, i, o, a, s, u, l = x[e + " "]; if (l) return t ? 0 : l.slice(0); a = e, s = [], u = b.preFilter; while (a) { for (o in n && !(r = _.exec(a)) || (r && (a = a.slice(r[0].length) || a), s.push(i = [])), n = !1, (r = z.exec(a)) && (n = r.shift(), i.push({ value: n, type: r[0].replace($, " ") }), a = a.slice(n.length)), b.filter) !(r = G[o].exec(a)) || u[o] && !(r = u[o](r)) || (n = r.shift(), i.push({ value: n, type: o, matches: r }), a = a.slice(n.length)); if (!n) break } return t ? a.length : a ? se.error(e) : x(e, s).slice(0) }, f = se.compile = function (e, t) { var n, v, y, m, x, r, i = [], o = [], a = A[e + " "]; if (!a) { t || (t = h(e)), n = t.length; while (n--) (a = Ee(t[n]))[S] ? i.push(a) : o.push(a); (a = A(e, (v = o, m = 0 < (y = i).length, x = 0 < v.length, r = function (e, t, n, r, i) { var o, a, s, u = 0, l = "0", c = e && [], f = [], p = w, d = e || x && b.find.TAG("*", i), h = k += null == p ? 1 : Math.random() || .1, g = d.length; for (i && (w = t == C || t || i); l !== g && null != (o = d[l]); l++) { if (x && o) { a = 0, t || o.ownerDocument == C || (T(o), n = !E); while (s = v[a++]) if (s(o, t || C, n)) { r.push(o); break } i && (k = h) } m && ((o = !s && o) && u--, e && c.push(o)) } if (u += l, m && l !== u) { a = 0; while (s = y[a++]) s(c, f, t, n); if (e) { if (0 < u) while (l--) c[l] || f[l] || (f[l] = q.call(r)); f = Te(f) } H.apply(r, f), i && !e && 0 < f.length && 1 < u + y.length && se.uniqueSort(r) } return i && (k = h, w = p), c }, m ? le(r) : r))).selector = e } return a }, g = se.select = function (e, t, n, r) { var i, o, a, s, u, l = "function" == typeof e && e, c = !r && h(e = l.selector || e); if (n = n || [], 1 === c.length) { if (2 < (o = c[0] = c[0].slice(0)).length && "ID" === (a = o[0]).type && 9 === t.nodeType && E && b.relative[o[1].type]) { if (!(t = (b.find.ID(a.matches[0].replace(te, ne), t) || [])[0])) return n; l && (t = t.parentNode), e = e.slice(o.shift().value.length) } i = G.needsContext.test(e) ? 0 : o.length; while (i--) { if (a = o[i], b.relative[s = a.type]) break; if ((u = b.find[s]) && (r = u(a.matches[0].replace(te, ne), ee.test(o[0].type) && ye(t.parentNode) || t))) { if (o.splice(i, 1), !(e = r.length && xe(o))) return H.apply(n, r), n; break } } } return (l || f(e, c))(r, t, !E, n, !t || ee.test(e) && ye(t.parentNode) || t), n }, d.sortStable = S.split("").sort(j).join("") === S, d.detectDuplicates = !!l, T(), d.sortDetached = ce(function (e) { return 1 & e.compareDocumentPosition(C.createElement("fieldset")) }), ce(function (e) { return e.innerHTML = "", "#" === e.firstChild.getAttribute("href") }) || fe("type|href|height|width", function (e, t, n) { if (!n) return e.getAttribute(t, "type" === t.toLowerCase() ? 1 : 2) }), d.attributes && ce(function (e) { return e.innerHTML = "", e.firstChild.setAttribute("value", ""), "" === e.firstChild.getAttribute("value") }) || fe("value", function (e, t, n) { if (!n && "input" === e.nodeName.toLowerCase()) return e.defaultValue }), ce(function (e) { return null == e.getAttribute("disabled") }) || fe(R, function (e, t, n) { var r; if (!n) return !0 === e[t] ? t.toLowerCase() : (r = e.getAttributeNode(t)) && r.specified ? r.value : null }), se }(C); S.find = d, S.expr = d.selectors, S.expr[":"] = S.expr.pseudos, S.uniqueSort = S.unique = d.uniqueSort, S.text = d.getText, S.isXMLDoc = d.isXML, S.contains = d.contains, S.escapeSelector = d.escape; var h = function (e, t, n) { var r = [], i = void 0 !== n; while ((e = e[t]) && 9 !== e.nodeType) if (1 === e.nodeType) { if (i && S(e).is(n)) break; r.push(e) } return r }, T = function (e, t) { for (var n = []; e; e = e.nextSibling)1 === e.nodeType && e !== t && n.push(e); return n }, k = S.expr.match.needsContext; function A(e, t) { return e.nodeName && e.nodeName.toLowerCase() === t.toLowerCase() } var N = /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i; function j(e, n, r) { return m(n) ? S.grep(e, function (e, t) { return !!n.call(e, t, e) !== r }) : n.nodeType ? S.grep(e, function (e) { return e === n !== r }) : "string" != typeof n ? S.grep(e, function (e) { return -1 < i.call(n, e) !== r }) : S.filter(n, e, r) } S.filter = function (e, t, n) { var r = t[0]; return n && (e = ":not(" + e + ")"), 1 === t.length && 1 === r.nodeType ? S.find.matchesSelector(r, e) ? [r] : [] : S.find.matches(e, S.grep(t, function (e) { return 1 === e.nodeType })) }, S.fn.extend({ find: function (e) { var t, n, r = this.length, i = this; if ("string" != typeof e) return this.pushStack(S(e).filter(function () { for (t = 0; t < r; t++)if (S.contains(i[t], this)) return !0 })); for (n = this.pushStack([]), t = 0; t < r; t++)S.find(e, i[t], n); return 1 < r ? S.uniqueSort(n) : n }, filter: function (e) { return this.pushStack(j(this, e || [], !1)) }, not: function (e) { return this.pushStack(j(this, e || [], !0)) }, is: function (e) { return !!j(this, "string" == typeof e && k.test(e) ? S(e) : e || [], !1).length } }); var D, q = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/; (S.fn.init = function (e, t, n) { var r, i; if (!e) return this; if (n = n || D, "string" == typeof e) { if (!(r = "<" === e[0] && ">" === e[e.length - 1] && 3 <= e.length ? [null, e, null] : q.exec(e)) || !r[1] && t) return !t || t.jquery ? (t || n).find(e) : this.constructor(t).find(e); if (r[1]) { if (t = t instanceof S ? t[0] : t, S.merge(this, S.parseHTML(r[1], t && t.nodeType ? t.ownerDocument || t : E, !0)), N.test(r[1]) && S.isPlainObject(t)) for (r in t) m(this[r]) ? this[r](t[r]) : this.attr(r, t[r]); return this } return (i = E.getElementById(r[2])) && (this[0] = i, this.length = 1), this } return e.nodeType ? (this[0] = e, this.length = 1, this) : m(e) ? void 0 !== n.ready ? n.ready(e) : e(S) : S.makeArray(e, this) }).prototype = S.fn, D = S(E); var L = /^(?:parents|prev(?:Until|All))/, H = { children: !0, contents: !0, next: !0, prev: !0 }; function O(e, t) { while ((e = e[t]) && 1 !== e.nodeType); return e } S.fn.extend({ has: function (e) { var t = S(e, this), n = t.length; return this.filter(function () { for (var e = 0; e < n; e++)if (S.contains(this, t[e])) return !0 }) }, closest: function (e, t) { var n, r = 0, i = this.length, o = [], a = "string" != typeof e && S(e); if (!k.test(e)) for (; r < i; r++)for (n = this[r]; n && n !== t; n = n.parentNode)if (n.nodeType < 11 && (a ? -1 < a.index(n) : 1 === n.nodeType && S.find.matchesSelector(n, e))) { o.push(n); break } return this.pushStack(1 < o.length ? S.uniqueSort(o) : o) }, index: function (e) { return e ? "string" == typeof e ? i.call(S(e), this[0]) : i.call(this, e.jquery ? e[0] : e) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1 }, add: function (e, t) { return this.pushStack(S.uniqueSort(S.merge(this.get(), S(e, t)))) }, addBack: function (e) { return this.add(null == e ? this.prevObject : this.prevObject.filter(e)) } }), S.each({ parent: function (e) { var t = e.parentNode; return t && 11 !== t.nodeType ? t : null }, parents: function (e) { return h(e, "parentNode") }, parentsUntil: function (e, t, n) { return h(e, "parentNode", n) }, next: function (e) { return O(e, "nextSibling") }, prev: function (e) { return O(e, "previousSibling") }, nextAll: function (e) { return h(e, "nextSibling") }, prevAll: function (e) { return h(e, "previousSibling") }, nextUntil: function (e, t, n) { return h(e, "nextSibling", n) }, prevUntil: function (e, t, n) { return h(e, "previousSibling", n) }, siblings: function (e) { return T((e.parentNode || {}).firstChild, e) }, children: function (e) { return T(e.firstChild) }, contents: function (e) { return null != e.contentDocument && r(e.contentDocument) ? e.contentDocument : (A(e, "template") && (e = e.content || e), S.merge([], e.childNodes)) } }, function (r, i) { S.fn[r] = function (e, t) { var n = S.map(this, i, e); return "Until" !== r.slice(-5) && (t = e), t && "string" == typeof t && (n = S.filter(t, n)), 1 < this.length && (H[r] || S.uniqueSort(n), L.test(r) && n.reverse()), this.pushStack(n) } }); var P = /[^\x20\t\r\n\f]+/g; function R(e) { return e } function M(e) { throw e } function I(e, t, n, r) { var i; try { e && m(i = e.promise) ? i.call(e).done(t).fail(n) : e && m(i = e.then) ? i.call(e, t, n) : t.apply(void 0, [e].slice(r)) } catch (e) { n.apply(void 0, [e]) } } S.Callbacks = function (r) { var e, n; r = "string" == typeof r ? (e = r, n = {}, S.each(e.match(P) || [], function (e, t) { n[t] = !0 }), n) : S.extend({}, r); var i, t, o, a, s = [], u = [], l = -1, c = function () { for (a = a || r.once, o = i = !0; u.length; l = -1) { t = u.shift(); while (++l < s.length) !1 === s[l].apply(t[0], t[1]) && r.stopOnFalse && (l = s.length, t = !1) } r.memory || (t = !1), i = !1, a && (s = t ? [] : "") }, f = { add: function () { return s && (t && !i && (l = s.length - 1, u.push(t)), function n(e) { S.each(e, function (e, t) { m(t) ? r.unique && f.has(t) || s.push(t) : t && t.length && "string" !== w(t) && n(t) }) }(arguments), t && !i && c()), this }, remove: function () { return S.each(arguments, function (e, t) { var n; while (-1 < (n = S.inArray(t, s, n))) s.splice(n, 1), n <= l && l-- }), this }, has: function (e) { return e ? -1 < S.inArray(e, s) : 0 < s.length }, empty: function () { return s && (s = []), this }, disable: function () { return a = u = [], s = t = "", this }, disabled: function () { return !s }, lock: function () { return a = u = [], t || i || (s = t = ""), this }, locked: function () { return !!a }, fireWith: function (e, t) { return a || (t = [e, (t = t || []).slice ? t.slice() : t], u.push(t), i || c()), this }, fire: function () { return f.fireWith(this, arguments), this }, fired: function () { return !!o } }; return f }, S.extend({ Deferred: function (e) { var o = [["notify", "progress", S.Callbacks("memory"), S.Callbacks("memory"), 2], ["resolve", "done", S.Callbacks("once memory"), S.Callbacks("once memory"), 0, "resolved"], ["reject", "fail", S.Callbacks("once memory"), S.Callbacks("once memory"), 1, "rejected"]], i = "pending", a = { state: function () { return i }, always: function () { return s.done(arguments).fail(arguments), this }, "catch": function (e) { return a.then(null, e) }, pipe: function () { var i = arguments; return S.Deferred(function (r) { S.each(o, function (e, t) { var n = m(i[t[4]]) && i[t[4]]; s[t[1]](function () { var e = n && n.apply(this, arguments); e && m(e.promise) ? e.promise().progress(r.notify).done(r.resolve).fail(r.reject) : r[t[0] + "With"](this, n ? [e] : arguments) }) }), i = null }).promise() }, then: function (t, n, r) { var u = 0; function l(i, o, a, s) { return function () { var n = this, r = arguments, e = function () { var e, t; if (!(i < u)) { if ((e = a.apply(n, r)) === o.promise()) throw new TypeError("Thenable self-resolution"); t = e && ("object" == typeof e || "function" == typeof e) && e.then, m(t) ? s ? t.call(e, l(u, o, R, s), l(u, o, M, s)) : (u++, t.call(e, l(u, o, R, s), l(u, o, M, s), l(u, o, R, o.notifyWith))) : (a !== R && (n = void 0, r = [e]), (s || o.resolveWith)(n, r)) } }, t = s ? e : function () { try { e() } catch (e) { S.Deferred.exceptionHook && S.Deferred.exceptionHook(e, t.stackTrace), u <= i + 1 && (a !== M && (n = void 0, r = [e]), o.rejectWith(n, r)) } }; i ? t() : (S.Deferred.getStackHook && (t.stackTrace = S.Deferred.getStackHook()), C.setTimeout(t)) } } return S.Deferred(function (e) { o[0][3].add(l(0, e, m(r) ? r : R, e.notifyWith)), o[1][3].add(l(0, e, m(t) ? t : R)), o[2][3].add(l(0, e, m(n) ? n : M)) }).promise() }, promise: function (e) { return null != e ? S.extend(e, a) : a } }, s = {}; return S.each(o, function (e, t) { var n = t[2], r = t[5]; a[t[1]] = n.add, r && n.add(function () { i = r }, o[3 - e][2].disable, o[3 - e][3].disable, o[0][2].lock, o[0][3].lock), n.add(t[3].fire), s[t[0]] = function () { return s[t[0] + "With"](this === s ? void 0 : this, arguments), this }, s[t[0] + "With"] = n.fireWith }), a.promise(s), e && e.call(s, s), s }, when: function (e) { var n = arguments.length, t = n, r = Array(t), i = s.call(arguments), o = S.Deferred(), a = function (t) { return function (e) { r[t] = this, i[t] = 1 < arguments.length ? s.call(arguments) : e, --n || o.resolveWith(r, i) } }; if (n <= 1 && (I(e, o.done(a(t)).resolve, o.reject, !n), "pending" === o.state() || m(i[t] && i[t].then))) return o.then(); while (t--) I(i[t], a(t), o.reject); return o.promise() } }); var W = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; S.Deferred.exceptionHook = function (e, t) { C.console && C.console.warn && e && W.test(e.name) && C.console.warn("jQuery.Deferred exception: " + e.message, e.stack, t) }, S.readyException = function (e) { C.setTimeout(function () { throw e }) }; var F = S.Deferred(); function B() { E.removeEventListener("DOMContentLoaded", B), C.removeEventListener("load", B), S.ready() } S.fn.ready = function (e) { return F.then(e)["catch"](function (e) { S.readyException(e) }), this }, S.extend({ isReady: !1, readyWait: 1, ready: function (e) { (!0 === e ? --S.readyWait : S.isReady) || (S.isReady = !0) !== e && 0 < --S.readyWait || F.resolveWith(E, [S]) } }), S.ready.then = F.then, "complete" === E.readyState || "loading" !== E.readyState && !E.documentElement.doScroll ? C.setTimeout(S.ready) : (E.addEventListener("DOMContentLoaded", B), C.addEventListener("load", B)); var $ = function (e, t, n, r, i, o, a) { var s = 0, u = e.length, l = null == n; if ("object" === w(n)) for (s in i = !0, n) $(e, t, s, n[s], !0, o, a); else if (void 0 !== r && (i = !0, m(r) || (a = !0), l && (a ? (t.call(e, r), t = null) : (l = t, t = function (e, t, n) { return l.call(S(e), n) })), t)) for (; s < u; s++)t(e[s], n, a ? r : r.call(e[s], s, t(e[s], n))); return i ? e : l ? t.call(e) : u ? t(e[0], n) : o }, _ = /^-ms-/, z = /-([a-z])/g; function U(e, t) { return t.toUpperCase() } function X(e) { return e.replace(_, "ms-").replace(z, U) } var V = function (e) { return 1 === e.nodeType || 9 === e.nodeType || !+e.nodeType }; function G() { this.expando = S.expando + G.uid++ } G.uid = 1, G.prototype = { cache: function (e) { var t = e[this.expando]; return t || (t = {}, V(e) && (e.nodeType ? e[this.expando] = t : Object.defineProperty(e, this.expando, { value: t, configurable: !0 }))), t }, set: function (e, t, n) { var r, i = this.cache(e); if ("string" == typeof t) i[X(t)] = n; else for (r in t) i[X(r)] = t[r]; return i }, get: function (e, t) { return void 0 === t ? this.cache(e) : e[this.expando] && e[this.expando][X(t)] }, access: function (e, t, n) { return void 0 === t || t && "string" == typeof t && void 0 === n ? this.get(e, t) : (this.set(e, t, n), void 0 !== n ? n : t) }, remove: function (e, t) { var n, r = e[this.expando]; if (void 0 !== r) { if (void 0 !== t) { n = (t = Array.isArray(t) ? t.map(X) : (t = X(t)) in r ? [t] : t.match(P) || []).length; while (n--) delete r[t[n]] } (void 0 === t || S.isEmptyObject(r)) && (e.nodeType ? e[this.expando] = void 0 : delete e[this.expando]) } }, hasData: function (e) { var t = e[this.expando]; return void 0 !== t && !S.isEmptyObject(t) } }; var Y = new G, Q = new G, J = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, K = /[A-Z]/g; function Z(e, t, n) { var r, i; if (void 0 === n && 1 === e.nodeType) if (r = "data-" + t.replace(K, "-$&").toLowerCase(), "string" == typeof (n = e.getAttribute(r))) { try { n = "true" === (i = n) || "false" !== i && ("null" === i ? null : i === +i + "" ? +i : J.test(i) ? JSON.parse(i) : i) } catch (e) { } Q.set(e, t, n) } else n = void 0; return n } S.extend({ hasData: function (e) { return Q.hasData(e) || Y.hasData(e) }, data: function (e, t, n) { return Q.access(e, t, n) }, removeData: function (e, t) { Q.remove(e, t) }, _data: function (e, t, n) { return Y.access(e, t, n) }, _removeData: function (e, t) { Y.remove(e, t) } }), S.fn.extend({ data: function (n, e) { var t, r, i, o = this[0], a = o && o.attributes; if (void 0 === n) { if (this.length && (i = Q.get(o), 1 === o.nodeType && !Y.get(o, "hasDataAttrs"))) { t = a.length; while (t--) a[t] && 0 === (r = a[t].name).indexOf("data-") && (r = X(r.slice(5)), Z(o, r, i[r])); Y.set(o, "hasDataAttrs", !0) } return i } return "object" == typeof n ? this.each(function () { Q.set(this, n) }) : $(this, function (e) { var t; if (o && void 0 === e) return void 0 !== (t = Q.get(o, n)) ? t : void 0 !== (t = Z(o, n)) ? t : void 0; this.each(function () { Q.set(this, n, e) }) }, null, e, 1 < arguments.length, null, !0) }, removeData: function (e) { return this.each(function () { Q.remove(this, e) }) } }), S.extend({ queue: function (e, t, n) { var r; if (e) return t = (t || "fx") + "queue", r = Y.get(e, t), n && (!r || Array.isArray(n) ? r = Y.access(e, t, S.makeArray(n)) : r.push(n)), r || [] }, dequeue: function (e, t) { t = t || "fx"; var n = S.queue(e, t), r = n.length, i = n.shift(), o = S._queueHooks(e, t); "inprogress" === i && (i = n.shift(), r--), i && ("fx" === t && n.unshift("inprogress"), delete o.stop, i.call(e, function () { S.dequeue(e, t) }, o)), !r && o && o.empty.fire() }, _queueHooks: function (e, t) { var n = t + "queueHooks"; return Y.get(e, n) || Y.access(e, n, { empty: S.Callbacks("once memory").add(function () { Y.remove(e, [t + "queue", n]) }) }) } }), S.fn.extend({ queue: function (t, n) { var e = 2; return "string" != typeof t && (n = t, t = "fx", e--), arguments.length < e ? S.queue(this[0], t) : void 0 === n ? this : this.each(function () { var e = S.queue(this, t, n); S._queueHooks(this, t), "fx" === t && "inprogress" !== e[0] && S.dequeue(this, t) }) }, dequeue: function (e) { return this.each(function () { S.dequeue(this, e) }) }, clearQueue: function (e) { return this.queue(e || "fx", []) }, promise: function (e, t) { var n, r = 1, i = S.Deferred(), o = this, a = this.length, s = function () { --r || i.resolveWith(o, [o]) }; "string" != typeof e && (t = e, e = void 0), e = e || "fx"; while (a--) (n = Y.get(o[a], e + "queueHooks")) && n.empty && (r++, n.empty.add(s)); return s(), i.promise(t) } }); var ee = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, te = new RegExp("^(?:([+-])=|)(" + ee + ")([a-z%]*)$", "i"), ne = ["Top", "Right", "Bottom", "Left"], re = E.documentElement, ie = function (e) { return S.contains(e.ownerDocument, e) }, oe = { composed: !0 }; re.getRootNode && (ie = function (e) { return S.contains(e.ownerDocument, e) || e.getRootNode(oe) === e.ownerDocument }); var ae = function (e, t) { return "none" === (e = t || e).style.display || "" === e.style.display && ie(e) && "none" === S.css(e, "display") }; function se(e, t, n, r) { var i, o, a = 20, s = r ? function () { return r.cur() } : function () { return S.css(e, t, "") }, u = s(), l = n && n[3] || (S.cssNumber[t] ? "" : "px"), c = e.nodeType && (S.cssNumber[t] || "px" !== l && +u) && te.exec(S.css(e, t)); if (c && c[3] !== l) { u /= 2, l = l || c[3], c = +u || 1; while (a--) S.style(e, t, c + l), (1 - o) * (1 - (o = s() / u || .5)) <= 0 && (a = 0), c /= o; c *= 2, S.style(e, t, c + l), n = n || [] } return n && (c = +c || +u || 0, i = n[1] ? c + (n[1] + 1) * n[2] : +n[2], r && (r.unit = l, r.start = c, r.end = i)), i } var ue = {}; function le(e, t) { for (var n, r, i, o, a, s, u, l = [], c = 0, f = e.length; c < f; c++)(r = e[c]).style && (n = r.style.display, t ? ("none" === n && (l[c] = Y.get(r, "display") || null, l[c] || (r.style.display = "")), "" === r.style.display && ae(r) && (l[c] = (u = a = o = void 0, a = (i = r).ownerDocument, s = i.nodeName, (u = ue[s]) || (o = a.body.appendChild(a.createElement(s)), u = S.css(o, "display"), o.parentNode.removeChild(o), "none" === u && (u = "block"), ue[s] = u)))) : "none" !== n && (l[c] = "none", Y.set(r, "display", n))); for (c = 0; c < f; c++)null != l[c] && (e[c].style.display = l[c]); return e } S.fn.extend({ show: function () { return le(this, !0) }, hide: function () { return le(this) }, toggle: function (e) { return "boolean" == typeof e ? e ? this.show() : this.hide() : this.each(function () { ae(this) ? S(this).show() : S(this).hide() }) } }); var ce, fe, pe = /^(?:checkbox|radio)$/i, de = /<([a-z][^\/\0>\x20\t\r\n\f]*)/i, he = /^$|^module$|\/(?:java|ecma)script/i; ce = E.createDocumentFragment().appendChild(E.createElement("div")), (fe = E.createElement("input")).setAttribute("type", "radio"), fe.setAttribute("checked", "checked"), fe.setAttribute("name", "t"), ce.appendChild(fe), y.checkClone = ce.cloneNode(!0).cloneNode(!0).lastChild.checked, ce.innerHTML = "", y.noCloneChecked = !!ce.cloneNode(!0).lastChild.defaultValue, ce.innerHTML = "", y.option = !!ce.lastChild; var ge = { thead: [1, "", "
    "], col: [2, "", "
    "], tr: [2, "", "
    "], td: [3, "", "
    "], _default: [0, "", ""] }; function ve(e, t) { var n; return n = "undefined" != typeof e.getElementsByTagName ? e.getElementsByTagName(t || "*") : "undefined" != typeof e.querySelectorAll ? e.querySelectorAll(t || "*") : [], void 0 === t || t && A(e, t) ? S.merge([e], n) : n } function ye(e, t) { for (var n = 0, r = e.length; n < r; n++)Y.set(e[n], "globalEval", !t || Y.get(t[n], "globalEval")) } ge.tbody = ge.tfoot = ge.colgroup = ge.caption = ge.thead, ge.th = ge.td, y.option || (ge.optgroup = ge.option = [1, ""]); var me = /<|&#?\w+;/; function xe(e, t, n, r, i) { for (var o, a, s, u, l, c, f = t.createDocumentFragment(), p = [], d = 0, h = e.length; d < h; d++)if ((o = e[d]) || 0 === o) if ("object" === w(o)) S.merge(p, o.nodeType ? [o] : o); else if (me.test(o)) { a = a || f.appendChild(t.createElement("div")), s = (de.exec(o) || ["", ""])[1].toLowerCase(), u = ge[s] || ge._default, a.innerHTML = u[1] + S.htmlPrefilter(o) + u[2], c = u[0]; while (c--) a = a.lastChild; S.merge(p, a.childNodes), (a = f.firstChild).textContent = "" } else p.push(t.createTextNode(o)); f.textContent = "", d = 0; while (o = p[d++]) if (r && -1 < S.inArray(o, r)) i && i.push(o); else if (l = ie(o), a = ve(f.appendChild(o), "script"), l && ye(a), n) { c = 0; while (o = a[c++]) he.test(o.type || "") && n.push(o) } return f } var be = /^([^.]*)(?:\.(.+)|)/; function we() { return !0 } function Te() { return !1 } function Ce(e, t) { return e === function () { try { return E.activeElement } catch (e) { } }() == ("focus" === t) } function Ee(e, t, n, r, i, o) { var a, s; if ("object" == typeof t) { for (s in "string" != typeof n && (r = r || n, n = void 0), t) Ee(e, s, n, r, t[s], o); return e } if (null == r && null == i ? (i = n, r = n = void 0) : null == i && ("string" == typeof n ? (i = r, r = void 0) : (i = r, r = n, n = void 0)), !1 === i) i = Te; else if (!i) return e; return 1 === o && (a = i, (i = function (e) { return S().off(e), a.apply(this, arguments) }).guid = a.guid || (a.guid = S.guid++)), e.each(function () { S.event.add(this, t, i, r, n) }) } function Se(e, i, o) { o ? (Y.set(e, i, !1), S.event.add(e, i, { namespace: !1, handler: function (e) { var t, n, r = Y.get(this, i); if (1 & e.isTrigger && this[i]) { if (r.length) (S.event.special[i] || {}).delegateType && e.stopPropagation(); else if (r = s.call(arguments), Y.set(this, i, r), t = o(this, i), this[i](), r !== (n = Y.get(this, i)) || t ? Y.set(this, i, !1) : n = {}, r !== n) return e.stopImmediatePropagation(), e.preventDefault(), n && n.value } else r.length && (Y.set(this, i, { value: S.event.trigger(S.extend(r[0], S.Event.prototype), r.slice(1), this) }), e.stopImmediatePropagation()) } })) : void 0 === Y.get(e, i) && S.event.add(e, i, we) } S.event = { global: {}, add: function (t, e, n, r, i) { var o, a, s, u, l, c, f, p, d, h, g, v = Y.get(t); if (V(t)) { n.handler && (n = (o = n).handler, i = o.selector), i && S.find.matchesSelector(re, i), n.guid || (n.guid = S.guid++), (u = v.events) || (u = v.events = Object.create(null)), (a = v.handle) || (a = v.handle = function (e) { return "undefined" != typeof S && S.event.triggered !== e.type ? S.event.dispatch.apply(t, arguments) : void 0 }), l = (e = (e || "").match(P) || [""]).length; while (l--) d = g = (s = be.exec(e[l]) || [])[1], h = (s[2] || "").split(".").sort(), d && (f = S.event.special[d] || {}, d = (i ? f.delegateType : f.bindType) || d, f = S.event.special[d] || {}, c = S.extend({ type: d, origType: g, data: r, handler: n, guid: n.guid, selector: i, needsContext: i && S.expr.match.needsContext.test(i), namespace: h.join(".") }, o), (p = u[d]) || ((p = u[d] = []).delegateCount = 0, f.setup && !1 !== f.setup.call(t, r, h, a) || t.addEventListener && t.addEventListener(d, a)), f.add && (f.add.call(t, c), c.handler.guid || (c.handler.guid = n.guid)), i ? p.splice(p.delegateCount++, 0, c) : p.push(c), S.event.global[d] = !0) } }, remove: function (e, t, n, r, i) { var o, a, s, u, l, c, f, p, d, h, g, v = Y.hasData(e) && Y.get(e); if (v && (u = v.events)) { l = (t = (t || "").match(P) || [""]).length; while (l--) if (d = g = (s = be.exec(t[l]) || [])[1], h = (s[2] || "").split(".").sort(), d) { f = S.event.special[d] || {}, p = u[d = (r ? f.delegateType : f.bindType) || d] || [], s = s[2] && new RegExp("(^|\\.)" + h.join("\\.(?:.*\\.|)") + "(\\.|$)"), a = o = p.length; while (o--) c = p[o], !i && g !== c.origType || n && n.guid !== c.guid || s && !s.test(c.namespace) || r && r !== c.selector && ("**" !== r || !c.selector) || (p.splice(o, 1), c.selector && p.delegateCount--, f.remove && f.remove.call(e, c)); a && !p.length && (f.teardown && !1 !== f.teardown.call(e, h, v.handle) || S.removeEvent(e, d, v.handle), delete u[d]) } else for (d in u) S.event.remove(e, d + t[l], n, r, !0); S.isEmptyObject(u) && Y.remove(e, "handle events") } }, dispatch: function (e) { var t, n, r, i, o, a, s = new Array(arguments.length), u = S.event.fix(e), l = (Y.get(this, "events") || Object.create(null))[u.type] || [], c = S.event.special[u.type] || {}; for (s[0] = u, t = 1; t < arguments.length; t++)s[t] = arguments[t]; if (u.delegateTarget = this, !c.preDispatch || !1 !== c.preDispatch.call(this, u)) { a = S.event.handlers.call(this, u, l), t = 0; while ((i = a[t++]) && !u.isPropagationStopped()) { u.currentTarget = i.elem, n = 0; while ((o = i.handlers[n++]) && !u.isImmediatePropagationStopped()) u.rnamespace && !1 !== o.namespace && !u.rnamespace.test(o.namespace) || (u.handleObj = o, u.data = o.data, void 0 !== (r = ((S.event.special[o.origType] || {}).handle || o.handler).apply(i.elem, s)) && !1 === (u.result = r) && (u.preventDefault(), u.stopPropagation())) } return c.postDispatch && c.postDispatch.call(this, u), u.result } }, handlers: function (e, t) { var n, r, i, o, a, s = [], u = t.delegateCount, l = e.target; if (u && l.nodeType && !("click" === e.type && 1 <= e.button)) for (; l !== this; l = l.parentNode || this)if (1 === l.nodeType && ("click" !== e.type || !0 !== l.disabled)) { for (o = [], a = {}, n = 0; n < u; n++)void 0 === a[i = (r = t[n]).selector + " "] && (a[i] = r.needsContext ? -1 < S(i, this).index(l) : S.find(i, this, null, [l]).length), a[i] && o.push(r); o.length && s.push({ elem: l, handlers: o }) } return l = this, u < t.length && s.push({ elem: l, handlers: t.slice(u) }), s }, addProp: function (t, e) { Object.defineProperty(S.Event.prototype, t, { enumerable: !0, configurable: !0, get: m(e) ? function () { if (this.originalEvent) return e(this.originalEvent) } : function () { if (this.originalEvent) return this.originalEvent[t] }, set: function (e) { Object.defineProperty(this, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) } }) }, fix: function (e) { return e[S.expando] ? e : new S.Event(e) }, special: { load: { noBubble: !0 }, click: { setup: function (e) { var t = this || e; return pe.test(t.type) && t.click && A(t, "input") && Se(t, "click", we), !1 }, trigger: function (e) { var t = this || e; return pe.test(t.type) && t.click && A(t, "input") && Se(t, "click"), !0 }, _default: function (e) { var t = e.target; return pe.test(t.type) && t.click && A(t, "input") && Y.get(t, "click") || A(t, "a") } }, beforeunload: { postDispatch: function (e) { void 0 !== e.result && e.originalEvent && (e.originalEvent.returnValue = e.result) } } } }, S.removeEvent = function (e, t, n) { e.removeEventListener && e.removeEventListener(t, n) }, S.Event = function (e, t) { if (!(this instanceof S.Event)) return new S.Event(e, t); e && e.type ? (this.originalEvent = e, this.type = e.type, this.isDefaultPrevented = e.defaultPrevented || void 0 === e.defaultPrevented && !1 === e.returnValue ? we : Te, this.target = e.target && 3 === e.target.nodeType ? e.target.parentNode : e.target, this.currentTarget = e.currentTarget, this.relatedTarget = e.relatedTarget) : this.type = e, t && S.extend(this, t), this.timeStamp = e && e.timeStamp || Date.now(), this[S.expando] = !0 }, S.Event.prototype = { constructor: S.Event, isDefaultPrevented: Te, isPropagationStopped: Te, isImmediatePropagationStopped: Te, isSimulated: !1, preventDefault: function () { var e = this.originalEvent; this.isDefaultPrevented = we, e && !this.isSimulated && e.preventDefault() }, stopPropagation: function () { var e = this.originalEvent; this.isPropagationStopped = we, e && !this.isSimulated && e.stopPropagation() }, stopImmediatePropagation: function () { var e = this.originalEvent; this.isImmediatePropagationStopped = we, e && !this.isSimulated && e.stopImmediatePropagation(), this.stopPropagation() } }, S.each({ altKey: !0, bubbles: !0, cancelable: !0, changedTouches: !0, ctrlKey: !0, detail: !0, eventPhase: !0, metaKey: !0, pageX: !0, pageY: !0, shiftKey: !0, view: !0, "char": !0, code: !0, charCode: !0, key: !0, keyCode: !0, button: !0, buttons: !0, clientX: !0, clientY: !0, offsetX: !0, offsetY: !0, pointerId: !0, pointerType: !0, screenX: !0, screenY: !0, targetTouches: !0, toElement: !0, touches: !0, which: !0 }, S.event.addProp), S.each({ focus: "focusin", blur: "focusout" }, function (e, t) { S.event.special[e] = { setup: function () { return Se(this, e, Ce), !1 }, trigger: function () { return Se(this, e), !0 }, _default: function () { return !0 }, delegateType: t } }), S.each({ mouseenter: "mouseover", mouseleave: "mouseout", pointerenter: "pointerover", pointerleave: "pointerout" }, function (e, i) { S.event.special[e] = { delegateType: i, bindType: i, handle: function (e) { var t, n = e.relatedTarget, r = e.handleObj; return n && (n === this || S.contains(this, n)) || (e.type = r.origType, t = r.handler.apply(this, arguments), e.type = i), t } } }), S.fn.extend({ on: function (e, t, n, r) { return Ee(this, e, t, n, r) }, one: function (e, t, n, r) { return Ee(this, e, t, n, r, 1) }, off: function (e, t, n) { var r, i; if (e && e.preventDefault && e.handleObj) return r = e.handleObj, S(e.delegateTarget).off(r.namespace ? r.origType + "." + r.namespace : r.origType, r.selector, r.handler), this; if ("object" == typeof e) { for (i in e) this.off(i, t, e[i]); return this } return !1 !== t && "function" != typeof t || (n = t, t = void 0), !1 === n && (n = Te), this.each(function () { S.event.remove(this, e, n, t) }) } }); var ke = /\s*$/g; function je(e, t) { return A(e, "table") && A(11 !== t.nodeType ? t : t.firstChild, "tr") && S(e).children("tbody")[0] || e } function De(e) { return e.type = (null !== e.getAttribute("type")) + "/" + e.type, e } function qe(e) { return "true/" === (e.type || "").slice(0, 5) ? e.type = e.type.slice(5) : e.removeAttribute("type"), e } function Le(e, t) { var n, r, i, o, a, s; if (1 === t.nodeType) { if (Y.hasData(e) && (s = Y.get(e).events)) for (i in Y.remove(t, "handle events"), s) for (n = 0, r = s[i].length; n < r; n++)S.event.add(t, i, s[i][n]); Q.hasData(e) && (o = Q.access(e), a = S.extend({}, o), Q.set(t, a)) } } function He(n, r, i, o) { r = g(r); var e, t, a, s, u, l, c = 0, f = n.length, p = f - 1, d = r[0], h = m(d); if (h || 1 < f && "string" == typeof d && !y.checkClone && Ae.test(d)) return n.each(function (e) { var t = n.eq(e); h && (r[0] = d.call(this, e, t.html())), He(t, r, i, o) }); if (f && (t = (e = xe(r, n[0].ownerDocument, !1, n, o)).firstChild, 1 === e.childNodes.length && (e = t), t || o)) { for (s = (a = S.map(ve(e, "script"), De)).length; c < f; c++)u = e, c !== p && (u = S.clone(u, !0, !0), s && S.merge(a, ve(u, "script"))), i.call(n[c], u, c); if (s) for (l = a[a.length - 1].ownerDocument, S.map(a, qe), c = 0; c < s; c++)u = a[c], he.test(u.type || "") && !Y.access(u, "globalEval") && S.contains(l, u) && (u.src && "module" !== (u.type || "").toLowerCase() ? S._evalUrl && !u.noModule && S._evalUrl(u.src, { nonce: u.nonce || u.getAttribute("nonce") }, l) : b(u.textContent.replace(Ne, ""), u, l)) } return n } function Oe(e, t, n) { for (var r, i = t ? S.filter(t, e) : e, o = 0; null != (r = i[o]); o++)n || 1 !== r.nodeType || S.cleanData(ve(r)), r.parentNode && (n && ie(r) && ye(ve(r, "script")), r.parentNode.removeChild(r)); return e } S.extend({ htmlPrefilter: function (e) { return e }, clone: function (e, t, n) { var r, i, o, a, s, u, l, c = e.cloneNode(!0), f = ie(e); if (!(y.noCloneChecked || 1 !== e.nodeType && 11 !== e.nodeType || S.isXMLDoc(e))) for (a = ve(c), r = 0, i = (o = ve(e)).length; r < i; r++)s = o[r], u = a[r], void 0, "input" === (l = u.nodeName.toLowerCase()) && pe.test(s.type) ? u.checked = s.checked : "input" !== l && "textarea" !== l || (u.defaultValue = s.defaultValue); if (t) if (n) for (o = o || ve(e), a = a || ve(c), r = 0, i = o.length; r < i; r++)Le(o[r], a[r]); else Le(e, c); return 0 < (a = ve(c, "script")).length && ye(a, !f && ve(e, "script")), c }, cleanData: function (e) { for (var t, n, r, i = S.event.special, o = 0; void 0 !== (n = e[o]); o++)if (V(n)) { if (t = n[Y.expando]) { if (t.events) for (r in t.events) i[r] ? S.event.remove(n, r) : S.removeEvent(n, r, t.handle); n[Y.expando] = void 0 } n[Q.expando] && (n[Q.expando] = void 0) } } }), S.fn.extend({ detach: function (e) { return Oe(this, e, !0) }, remove: function (e) { return Oe(this, e) }, text: function (e) { return $(this, function (e) { return void 0 === e ? S.text(this) : this.empty().each(function () { 1 !== this.nodeType && 11 !== this.nodeType && 9 !== this.nodeType || (this.textContent = e) }) }, null, e, arguments.length) }, append: function () { return He(this, arguments, function (e) { 1 !== this.nodeType && 11 !== this.nodeType && 9 !== this.nodeType || je(this, e).appendChild(e) }) }, prepend: function () { return He(this, arguments, function (e) { if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) { var t = je(this, e); t.insertBefore(e, t.firstChild) } }) }, before: function () { return He(this, arguments, function (e) { this.parentNode && this.parentNode.insertBefore(e, this) }) }, after: function () { return He(this, arguments, function (e) { this.parentNode && this.parentNode.insertBefore(e, this.nextSibling) }) }, empty: function () { for (var e, t = 0; null != (e = this[t]); t++)1 === e.nodeType && (S.cleanData(ve(e, !1)), e.textContent = ""); return this }, clone: function (e, t) { return e = null != e && e, t = null == t ? e : t, this.map(function () { return S.clone(this, e, t) }) }, html: function (e) { return $(this, function (e) { var t = this[0] || {}, n = 0, r = this.length; if (void 0 === e && 1 === t.nodeType) return t.innerHTML; if ("string" == typeof e && !ke.test(e) && !ge[(de.exec(e) || ["", ""])[1].toLowerCase()]) { e = S.htmlPrefilter(e); try { for (; n < r; n++)1 === (t = this[n] || {}).nodeType && (S.cleanData(ve(t, !1)), t.innerHTML = e); t = 0 } catch (e) { } } t && this.empty().append(e) }, null, e, arguments.length) }, replaceWith: function () { var n = []; return He(this, arguments, function (e) { var t = this.parentNode; S.inArray(this, n) < 0 && (S.cleanData(ve(this)), t && t.replaceChild(e, this)) }, n) } }), S.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function (e, a) { S.fn[e] = function (e) { for (var t, n = [], r = S(e), i = r.length - 1, o = 0; o <= i; o++)t = o === i ? this : this.clone(!0), S(r[o])[a](t), u.apply(n, t.get()); return this.pushStack(n) } }); var Pe = new RegExp("^(" + ee + ")(?!px)[a-z%]+$", "i"), Re = function (e) { var t = e.ownerDocument.defaultView; return t && t.opener || (t = C), t.getComputedStyle(e) }, Me = function (e, t, n) { var r, i, o = {}; for (i in t) o[i] = e.style[i], e.style[i] = t[i]; for (i in r = n.call(e), t) e.style[i] = o[i]; return r }, Ie = new RegExp(ne.join("|"), "i"); function We(e, t, n) { var r, i, o, a, s = e.style; return (n = n || Re(e)) && ("" !== (a = n.getPropertyValue(t) || n[t]) || ie(e) || (a = S.style(e, t)), !y.pixelBoxStyles() && Pe.test(a) && Ie.test(t) && (r = s.width, i = s.minWidth, o = s.maxWidth, s.minWidth = s.maxWidth = s.width = a, a = n.width, s.width = r, s.minWidth = i, s.maxWidth = o)), void 0 !== a ? a + "" : a } function Fe(e, t) { return { get: function () { if (!e()) return (this.get = t).apply(this, arguments); delete this.get } } } !function () { function e() { if (l) { u.style.cssText = "position:absolute;left:-11111px;width:60px;margin-top:1px;padding:0;border:0", l.style.cssText = "position:relative;display:block;box-sizing:border-box;overflow:scroll;margin:auto;border:1px;padding:1px;width:60%;top:1%", re.appendChild(u).appendChild(l); var e = C.getComputedStyle(l); n = "1%" !== e.top, s = 12 === t(e.marginLeft), l.style.right = "60%", o = 36 === t(e.right), r = 36 === t(e.width), l.style.position = "absolute", i = 12 === t(l.offsetWidth / 3), re.removeChild(u), l = null } } function t(e) { return Math.round(parseFloat(e)) } var n, r, i, o, a, s, u = E.createElement("div"), l = E.createElement("div"); l.style && (l.style.backgroundClip = "content-box", l.cloneNode(!0).style.backgroundClip = "", y.clearCloneStyle = "content-box" === l.style.backgroundClip, S.extend(y, { boxSizingReliable: function () { return e(), r }, pixelBoxStyles: function () { return e(), o }, pixelPosition: function () { return e(), n }, reliableMarginLeft: function () { return e(), s }, scrollboxSize: function () { return e(), i }, reliableTrDimensions: function () { var e, t, n, r; return null == a && (e = E.createElement("table"), t = E.createElement("tr"), n = E.createElement("div"), e.style.cssText = "position:absolute;left:-11111px;border-collapse:separate", t.style.cssText = "border:1px solid", t.style.height = "1px", n.style.height = "9px", n.style.display = "block", re.appendChild(e).appendChild(t).appendChild(n), r = C.getComputedStyle(t), a = parseInt(r.height, 10) + parseInt(r.borderTopWidth, 10) + parseInt(r.borderBottomWidth, 10) === t.offsetHeight, re.removeChild(e)), a } })) }(); var Be = ["Webkit", "Moz", "ms"], $e = E.createElement("div").style, _e = {}; function ze(e) { var t = S.cssProps[e] || _e[e]; return t || (e in $e ? e : _e[e] = function (e) { var t = e[0].toUpperCase() + e.slice(1), n = Be.length; while (n--) if ((e = Be[n] + t) in $e) return e }(e) || e) } var Ue = /^(none|table(?!-c[ea]).+)/, Xe = /^--/, Ve = { position: "absolute", visibility: "hidden", display: "block" }, Ge = { letterSpacing: "0", fontWeight: "400" }; function Ye(e, t, n) { var r = te.exec(t); return r ? Math.max(0, r[2] - (n || 0)) + (r[3] || "px") : t } function Qe(e, t, n, r, i, o) { var a = "width" === t ? 1 : 0, s = 0, u = 0; if (n === (r ? "border" : "content")) return 0; for (; a < 4; a += 2)"margin" === n && (u += S.css(e, n + ne[a], !0, i)), r ? ("content" === n && (u -= S.css(e, "padding" + ne[a], !0, i)), "margin" !== n && (u -= S.css(e, "border" + ne[a] + "Width", !0, i))) : (u += S.css(e, "padding" + ne[a], !0, i), "padding" !== n ? u += S.css(e, "border" + ne[a] + "Width", !0, i) : s += S.css(e, "border" + ne[a] + "Width", !0, i)); return !r && 0 <= o && (u += Math.max(0, Math.ceil(e["offset" + t[0].toUpperCase() + t.slice(1)] - o - u - s - .5)) || 0), u } function Je(e, t, n) { var r = Re(e), i = (!y.boxSizingReliable() || n) && "border-box" === S.css(e, "boxSizing", !1, r), o = i, a = We(e, t, r), s = "offset" + t[0].toUpperCase() + t.slice(1); if (Pe.test(a)) { if (!n) return a; a = "auto" } return (!y.boxSizingReliable() && i || !y.reliableTrDimensions() && A(e, "tr") || "auto" === a || !parseFloat(a) && "inline" === S.css(e, "display", !1, r)) && e.getClientRects().length && (i = "border-box" === S.css(e, "boxSizing", !1, r), (o = s in e) && (a = e[s])), (a = parseFloat(a) || 0) + Qe(e, t, n || (i ? "border" : "content"), o, r, a) + "px" } function Ke(e, t, n, r, i) { return new Ke.prototype.init(e, t, n, r, i) } S.extend({ cssHooks: { opacity: { get: function (e, t) { if (t) { var n = We(e, "opacity"); return "" === n ? "1" : n } } } }, cssNumber: { animationIterationCount: !0, columnCount: !0, fillOpacity: !0, flexGrow: !0, flexShrink: !0, fontWeight: !0, gridArea: !0, gridColumn: !0, gridColumnEnd: !0, gridColumnStart: !0, gridRow: !0, gridRowEnd: !0, gridRowStart: !0, lineHeight: !0, opacity: !0, order: !0, orphans: !0, widows: !0, zIndex: !0, zoom: !0 }, cssProps: {}, style: function (e, t, n, r) { if (e && 3 !== e.nodeType && 8 !== e.nodeType && e.style) { var i, o, a, s = X(t), u = Xe.test(t), l = e.style; if (u || (t = ze(s)), a = S.cssHooks[t] || S.cssHooks[s], void 0 === n) return a && "get" in a && void 0 !== (i = a.get(e, !1, r)) ? i : l[t]; "string" === (o = typeof n) && (i = te.exec(n)) && i[1] && (n = se(e, t, i), o = "number"), null != n && n == n && ("number" !== o || u || (n += i && i[3] || (S.cssNumber[s] ? "" : "px")), y.clearCloneStyle || "" !== n || 0 !== t.indexOf("background") || (l[t] = "inherit"), a && "set" in a && void 0 === (n = a.set(e, n, r)) || (u ? l.setProperty(t, n) : l[t] = n)) } }, css: function (e, t, n, r) { var i, o, a, s = X(t); return Xe.test(t) || (t = ze(s)), (a = S.cssHooks[t] || S.cssHooks[s]) && "get" in a && (i = a.get(e, !0, n)), void 0 === i && (i = We(e, t, r)), "normal" === i && t in Ge && (i = Ge[t]), "" === n || n ? (o = parseFloat(i), !0 === n || isFinite(o) ? o || 0 : i) : i } }), S.each(["height", "width"], function (e, u) { S.cssHooks[u] = { get: function (e, t, n) { if (t) return !Ue.test(S.css(e, "display")) || e.getClientRects().length && e.getBoundingClientRect().width ? Je(e, u, n) : Me(e, Ve, function () { return Je(e, u, n) }) }, set: function (e, t, n) { var r, i = Re(e), o = !y.scrollboxSize() && "absolute" === i.position, a = (o || n) && "border-box" === S.css(e, "boxSizing", !1, i), s = n ? Qe(e, u, n, a, i) : 0; return a && o && (s -= Math.ceil(e["offset" + u[0].toUpperCase() + u.slice(1)] - parseFloat(i[u]) - Qe(e, u, "border", !1, i) - .5)), s && (r = te.exec(t)) && "px" !== (r[3] || "px") && (e.style[u] = t, t = S.css(e, u)), Ye(0, t, s) } } }), S.cssHooks.marginLeft = Fe(y.reliableMarginLeft, function (e, t) { if (t) return (parseFloat(We(e, "marginLeft")) || e.getBoundingClientRect().left - Me(e, { marginLeft: 0 }, function () { return e.getBoundingClientRect().left })) + "px" }), S.each({ margin: "", padding: "", border: "Width" }, function (i, o) { S.cssHooks[i + o] = { expand: function (e) { for (var t = 0, n = {}, r = "string" == typeof e ? e.split(" ") : [e]; t < 4; t++)n[i + ne[t] + o] = r[t] || r[t - 2] || r[0]; return n } }, "margin" !== i && (S.cssHooks[i + o].set = Ye) }), S.fn.extend({ css: function (e, t) { return $(this, function (e, t, n) { var r, i, o = {}, a = 0; if (Array.isArray(t)) { for (r = Re(e), i = t.length; a < i; a++)o[t[a]] = S.css(e, t[a], !1, r); return o } return void 0 !== n ? S.style(e, t, n) : S.css(e, t) }, e, t, 1 < arguments.length) } }), ((S.Tween = Ke).prototype = { constructor: Ke, init: function (e, t, n, r, i, o) { this.elem = e, this.prop = n, this.easing = i || S.easing._default, this.options = t, this.start = this.now = this.cur(), this.end = r, this.unit = o || (S.cssNumber[n] ? "" : "px") }, cur: function () { var e = Ke.propHooks[this.prop]; return e && e.get ? e.get(this) : Ke.propHooks._default.get(this) }, run: function (e) { var t, n = Ke.propHooks[this.prop]; return this.options.duration ? this.pos = t = S.easing[this.easing](e, this.options.duration * e, 0, 1, this.options.duration) : this.pos = t = e, this.now = (this.end - this.start) * t + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), n && n.set ? n.set(this) : Ke.propHooks._default.set(this), this } }).init.prototype = Ke.prototype, (Ke.propHooks = { _default: { get: function (e) { var t; return 1 !== e.elem.nodeType || null != e.elem[e.prop] && null == e.elem.style[e.prop] ? e.elem[e.prop] : (t = S.css(e.elem, e.prop, "")) && "auto" !== t ? t : 0 }, set: function (e) { S.fx.step[e.prop] ? S.fx.step[e.prop](e) : 1 !== e.elem.nodeType || !S.cssHooks[e.prop] && null == e.elem.style[ze(e.prop)] ? e.elem[e.prop] = e.now : S.style(e.elem, e.prop, e.now + e.unit) } } }).scrollTop = Ke.propHooks.scrollLeft = { set: function (e) { e.elem.nodeType && e.elem.parentNode && (e.elem[e.prop] = e.now) } }, S.easing = { linear: function (e) { return e }, swing: function (e) { return .5 - Math.cos(e * Math.PI) / 2 }, _default: "swing" }, S.fx = Ke.prototype.init, S.fx.step = {}; var Ze, et, tt, nt, rt = /^(?:toggle|show|hide)$/, it = /queueHooks$/; function ot() { et && (!1 === E.hidden && C.requestAnimationFrame ? C.requestAnimationFrame(ot) : C.setTimeout(ot, S.fx.interval), S.fx.tick()) } function at() { return C.setTimeout(function () { Ze = void 0 }), Ze = Date.now() } function st(e, t) { var n, r = 0, i = { height: e }; for (t = t ? 1 : 0; r < 4; r += 2 - t)i["margin" + (n = ne[r])] = i["padding" + n] = e; return t && (i.opacity = i.width = e), i } function ut(e, t, n) { for (var r, i = (lt.tweeners[t] || []).concat(lt.tweeners["*"]), o = 0, a = i.length; o < a; o++)if (r = i[o].call(n, t, e)) return r } function lt(o, e, t) { var n, a, r = 0, i = lt.prefilters.length, s = S.Deferred().always(function () { delete u.elem }), u = function () { if (a) return !1; for (var e = Ze || at(), t = Math.max(0, l.startTime + l.duration - e), n = 1 - (t / l.duration || 0), r = 0, i = l.tweens.length; r < i; r++)l.tweens[r].run(n); return s.notifyWith(o, [l, n, t]), n < 1 && i ? t : (i || s.notifyWith(o, [l, 1, 0]), s.resolveWith(o, [l]), !1) }, l = s.promise({ elem: o, props: S.extend({}, e), opts: S.extend(!0, { specialEasing: {}, easing: S.easing._default }, t), originalProperties: e, originalOptions: t, startTime: Ze || at(), duration: t.duration, tweens: [], createTween: function (e, t) { var n = S.Tween(o, l.opts, e, t, l.opts.specialEasing[e] || l.opts.easing); return l.tweens.push(n), n }, stop: function (e) { var t = 0, n = e ? l.tweens.length : 0; if (a) return this; for (a = !0; t < n; t++)l.tweens[t].run(1); return e ? (s.notifyWith(o, [l, 1, 0]), s.resolveWith(o, [l, e])) : s.rejectWith(o, [l, e]), this } }), c = l.props; for (!function (e, t) { var n, r, i, o, a; for (n in e) if (i = t[r = X(n)], o = e[n], Array.isArray(o) && (i = o[1], o = e[n] = o[0]), n !== r && (e[r] = o, delete e[n]), (a = S.cssHooks[r]) && "expand" in a) for (n in o = a.expand(o), delete e[r], o) n in e || (e[n] = o[n], t[n] = i); else t[r] = i }(c, l.opts.specialEasing); r < i; r++)if (n = lt.prefilters[r].call(l, o, c, l.opts)) return m(n.stop) && (S._queueHooks(l.elem, l.opts.queue).stop = n.stop.bind(n)), n; return S.map(c, ut, l), m(l.opts.start) && l.opts.start.call(o, l), l.progress(l.opts.progress).done(l.opts.done, l.opts.complete).fail(l.opts.fail).always(l.opts.always), S.fx.timer(S.extend(u, { elem: o, anim: l, queue: l.opts.queue })), l } S.Animation = S.extend(lt, { tweeners: { "*": [function (e, t) { var n = this.createTween(e, t); return se(n.elem, e, te.exec(t), n), n }] }, tweener: function (e, t) { m(e) ? (t = e, e = ["*"]) : e = e.match(P); for (var n, r = 0, i = e.length; r < i; r++)n = e[r], lt.tweeners[n] = lt.tweeners[n] || [], lt.tweeners[n].unshift(t) }, prefilters: [function (e, t, n) { var r, i, o, a, s, u, l, c, f = "width" in t || "height" in t, p = this, d = {}, h = e.style, g = e.nodeType && ae(e), v = Y.get(e, "fxshow"); for (r in n.queue || (null == (a = S._queueHooks(e, "fx")).unqueued && (a.unqueued = 0, s = a.empty.fire, a.empty.fire = function () { a.unqueued || s() }), a.unqueued++, p.always(function () { p.always(function () { a.unqueued--, S.queue(e, "fx").length || a.empty.fire() }) })), t) if (i = t[r], rt.test(i)) { if (delete t[r], o = o || "toggle" === i, i === (g ? "hide" : "show")) { if ("show" !== i || !v || void 0 === v[r]) continue; g = !0 } d[r] = v && v[r] || S.style(e, r) } if ((u = !S.isEmptyObject(t)) || !S.isEmptyObject(d)) for (r in f && 1 === e.nodeType && (n.overflow = [h.overflow, h.overflowX, h.overflowY], null == (l = v && v.display) && (l = Y.get(e, "display")), "none" === (c = S.css(e, "display")) && (l ? c = l : (le([e], !0), l = e.style.display || l, c = S.css(e, "display"), le([e]))), ("inline" === c || "inline-block" === c && null != l) && "none" === S.css(e, "float") && (u || (p.done(function () { h.display = l }), null == l && (c = h.display, l = "none" === c ? "" : c)), h.display = "inline-block")), n.overflow && (h.overflow = "hidden", p.always(function () { h.overflow = n.overflow[0], h.overflowX = n.overflow[1], h.overflowY = n.overflow[2] })), u = !1, d) u || (v ? "hidden" in v && (g = v.hidden) : v = Y.access(e, "fxshow", { display: l }), o && (v.hidden = !g), g && le([e], !0), p.done(function () { for (r in g || le([e]), Y.remove(e, "fxshow"), d) S.style(e, r, d[r]) })), u = ut(g ? v[r] : 0, r, p), r in v || (v[r] = u.start, g && (u.end = u.start, u.start = 0)) }], prefilter: function (e, t) { t ? lt.prefilters.unshift(e) : lt.prefilters.push(e) } }), S.speed = function (e, t, n) { var r = e && "object" == typeof e ? S.extend({}, e) : { complete: n || !n && t || m(e) && e, duration: e, easing: n && t || t && !m(t) && t }; return S.fx.off ? r.duration = 0 : "number" != typeof r.duration && (r.duration in S.fx.speeds ? r.duration = S.fx.speeds[r.duration] : r.duration = S.fx.speeds._default), null != r.queue && !0 !== r.queue || (r.queue = "fx"), r.old = r.complete, r.complete = function () { m(r.old) && r.old.call(this), r.queue && S.dequeue(this, r.queue) }, r }, S.fn.extend({ fadeTo: function (e, t, n, r) { return this.filter(ae).css("opacity", 0).show().end().animate({ opacity: t }, e, n, r) }, animate: function (t, e, n, r) { var i = S.isEmptyObject(t), o = S.speed(e, n, r), a = function () { var e = lt(this, S.extend({}, t), o); (i || Y.get(this, "finish")) && e.stop(!0) }; return a.finish = a, i || !1 === o.queue ? this.each(a) : this.queue(o.queue, a) }, stop: function (i, e, o) { var a = function (e) { var t = e.stop; delete e.stop, t(o) }; return "string" != typeof i && (o = e, e = i, i = void 0), e && this.queue(i || "fx", []), this.each(function () { var e = !0, t = null != i && i + "queueHooks", n = S.timers, r = Y.get(this); if (t) r[t] && r[t].stop && a(r[t]); else for (t in r) r[t] && r[t].stop && it.test(t) && a(r[t]); for (t = n.length; t--;)n[t].elem !== this || null != i && n[t].queue !== i || (n[t].anim.stop(o), e = !1, n.splice(t, 1)); !e && o || S.dequeue(this, i) }) }, finish: function (a) { return !1 !== a && (a = a || "fx"), this.each(function () { var e, t = Y.get(this), n = t[a + "queue"], r = t[a + "queueHooks"], i = S.timers, o = n ? n.length : 0; for (t.finish = !0, S.queue(this, a, []), r && r.stop && r.stop.call(this, !0), e = i.length; e--;)i[e].elem === this && i[e].queue === a && (i[e].anim.stop(!0), i.splice(e, 1)); for (e = 0; e < o; e++)n[e] && n[e].finish && n[e].finish.call(this); delete t.finish }) } }), S.each(["toggle", "show", "hide"], function (e, r) { var i = S.fn[r]; S.fn[r] = function (e, t, n) { return null == e || "boolean" == typeof e ? i.apply(this, arguments) : this.animate(st(r, !0), e, t, n) } }), S.each({ slideDown: st("show"), slideUp: st("hide"), slideToggle: st("toggle"), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } }, function (e, r) { S.fn[e] = function (e, t, n) { return this.animate(r, e, t, n) } }), S.timers = [], S.fx.tick = function () { var e, t = 0, n = S.timers; for (Ze = Date.now(); t < n.length; t++)(e = n[t])() || n[t] !== e || n.splice(t--, 1); n.length || S.fx.stop(), Ze = void 0 }, S.fx.timer = function (e) { S.timers.push(e), S.fx.start() }, S.fx.interval = 13, S.fx.start = function () { et || (et = !0, ot()) }, S.fx.stop = function () { et = null }, S.fx.speeds = { slow: 600, fast: 200, _default: 400 }, S.fn.delay = function (r, e) { return r = S.fx && S.fx.speeds[r] || r, e = e || "fx", this.queue(e, function (e, t) { var n = C.setTimeout(e, r); t.stop = function () { C.clearTimeout(n) } }) }, tt = E.createElement("input"), nt = E.createElement("select").appendChild(E.createElement("option")), tt.type = "checkbox", y.checkOn = "" !== tt.value, y.optSelected = nt.selected, (tt = E.createElement("input")).value = "t", tt.type = "radio", y.radioValue = "t" === tt.value; var ct, ft = S.expr.attrHandle; S.fn.extend({ attr: function (e, t) { return $(this, S.attr, e, t, 1 < arguments.length) }, removeAttr: function (e) { return this.each(function () { S.removeAttr(this, e) }) } }), S.extend({ attr: function (e, t, n) { var r, i, o = e.nodeType; if (3 !== o && 8 !== o && 2 !== o) return "undefined" == typeof e.getAttribute ? S.prop(e, t, n) : (1 === o && S.isXMLDoc(e) || (i = S.attrHooks[t.toLowerCase()] || (S.expr.match.bool.test(t) ? ct : void 0)), void 0 !== n ? null === n ? void S.removeAttr(e, t) : i && "set" in i && void 0 !== (r = i.set(e, n, t)) ? r : (e.setAttribute(t, n + ""), n) : i && "get" in i && null !== (r = i.get(e, t)) ? r : null == (r = S.find.attr(e, t)) ? void 0 : r) }, attrHooks: { type: { set: function (e, t) { if (!y.radioValue && "radio" === t && A(e, "input")) { var n = e.value; return e.setAttribute("type", t), n && (e.value = n), t } } } }, removeAttr: function (e, t) { var n, r = 0, i = t && t.match(P); if (i && 1 === e.nodeType) while (n = i[r++]) e.removeAttribute(n) } }), ct = { set: function (e, t, n) { return !1 === t ? S.removeAttr(e, n) : e.setAttribute(n, n), n } }, S.each(S.expr.match.bool.source.match(/\w+/g), function (e, t) { var a = ft[t] || S.find.attr; ft[t] = function (e, t, n) { var r, i, o = t.toLowerCase(); return n || (i = ft[o], ft[o] = r, r = null != a(e, t, n) ? o : null, ft[o] = i), r } }); var pt = /^(?:input|select|textarea|button)$/i, dt = /^(?:a|area)$/i; function ht(e) { return (e.match(P) || []).join(" ") } function gt(e) { return e.getAttribute && e.getAttribute("class") || "" } function vt(e) { return Array.isArray(e) ? e : "string" == typeof e && e.match(P) || [] } S.fn.extend({ prop: function (e, t) { return $(this, S.prop, e, t, 1 < arguments.length) }, removeProp: function (e) { return this.each(function () { delete this[S.propFix[e] || e] }) } }), S.extend({ prop: function (e, t, n) { var r, i, o = e.nodeType; if (3 !== o && 8 !== o && 2 !== o) return 1 === o && S.isXMLDoc(e) || (t = S.propFix[t] || t, i = S.propHooks[t]), void 0 !== n ? i && "set" in i && void 0 !== (r = i.set(e, n, t)) ? r : e[t] = n : i && "get" in i && null !== (r = i.get(e, t)) ? r : e[t] }, propHooks: { tabIndex: { get: function (e) { var t = S.find.attr(e, "tabindex"); return t ? parseInt(t, 10) : pt.test(e.nodeName) || dt.test(e.nodeName) && e.href ? 0 : -1 } } }, propFix: { "for": "htmlFor", "class": "className" } }), y.optSelected || (S.propHooks.selected = { get: function (e) { var t = e.parentNode; return t && t.parentNode && t.parentNode.selectedIndex, null }, set: function (e) { var t = e.parentNode; t && (t.selectedIndex, t.parentNode && t.parentNode.selectedIndex) } }), S.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function () { S.propFix[this.toLowerCase()] = this }), S.fn.extend({ addClass: function (t) { var e, n, r, i, o, a, s, u = 0; if (m(t)) return this.each(function (e) { S(this).addClass(t.call(this, e, gt(this))) }); if ((e = vt(t)).length) while (n = this[u++]) if (i = gt(n), r = 1 === n.nodeType && " " + ht(i) + " ") { a = 0; while (o = e[a++]) r.indexOf(" " + o + " ") < 0 && (r += o + " "); i !== (s = ht(r)) && n.setAttribute("class", s) } return this }, removeClass: function (t) { var e, n, r, i, o, a, s, u = 0; if (m(t)) return this.each(function (e) { S(this).removeClass(t.call(this, e, gt(this))) }); if (!arguments.length) return this.attr("class", ""); if ((e = vt(t)).length) while (n = this[u++]) if (i = gt(n), r = 1 === n.nodeType && " " + ht(i) + " ") { a = 0; while (o = e[a++]) while (-1 < r.indexOf(" " + o + " ")) r = r.replace(" " + o + " ", " "); i !== (s = ht(r)) && n.setAttribute("class", s) } return this }, toggleClass: function (i, t) { var o = typeof i, a = "string" === o || Array.isArray(i); return "boolean" == typeof t && a ? t ? this.addClass(i) : this.removeClass(i) : m(i) ? this.each(function (e) { S(this).toggleClass(i.call(this, e, gt(this), t), t) }) : this.each(function () { var e, t, n, r; if (a) { t = 0, n = S(this), r = vt(i); while (e = r[t++]) n.hasClass(e) ? n.removeClass(e) : n.addClass(e) } else void 0 !== i && "boolean" !== o || ((e = gt(this)) && Y.set(this, "__className__", e), this.setAttribute && this.setAttribute("class", e || !1 === i ? "" : Y.get(this, "__className__") || "")) }) }, hasClass: function (e) { var t, n, r = 0; t = " " + e + " "; while (n = this[r++]) if (1 === n.nodeType && -1 < (" " + ht(gt(n)) + " ").indexOf(t)) return !0; return !1 } }); var yt = /\r/g; S.fn.extend({ val: function (n) { var r, e, i, t = this[0]; return arguments.length ? (i = m(n), this.each(function (e) { var t; 1 === this.nodeType && (null == (t = i ? n.call(this, e, S(this).val()) : n) ? t = "" : "number" == typeof t ? t += "" : Array.isArray(t) && (t = S.map(t, function (e) { return null == e ? "" : e + "" })), (r = S.valHooks[this.type] || S.valHooks[this.nodeName.toLowerCase()]) && "set" in r && void 0 !== r.set(this, t, "value") || (this.value = t)) })) : t ? (r = S.valHooks[t.type] || S.valHooks[t.nodeName.toLowerCase()]) && "get" in r && void 0 !== (e = r.get(t, "value")) ? e : "string" == typeof (e = t.value) ? e.replace(yt, "") : null == e ? "" : e : void 0 } }), S.extend({ valHooks: { option: { get: function (e) { var t = S.find.attr(e, "value"); return null != t ? t : ht(S.text(e)) } }, select: { get: function (e) { var t, n, r, i = e.options, o = e.selectedIndex, a = "select-one" === e.type, s = a ? null : [], u = a ? o + 1 : i.length; for (r = o < 0 ? u : a ? o : 0; r < u; r++)if (((n = i[r]).selected || r === o) && !n.disabled && (!n.parentNode.disabled || !A(n.parentNode, "optgroup"))) { if (t = S(n).val(), a) return t; s.push(t) } return s }, set: function (e, t) { var n, r, i = e.options, o = S.makeArray(t), a = i.length; while (a--) ((r = i[a]).selected = -1 < S.inArray(S.valHooks.option.get(r), o)) && (n = !0); return n || (e.selectedIndex = -1), o } } } }), S.each(["radio", "checkbox"], function () { S.valHooks[this] = { set: function (e, t) { if (Array.isArray(t)) return e.checked = -1 < S.inArray(S(e).val(), t) } }, y.checkOn || (S.valHooks[this].get = function (e) { return null === e.getAttribute("value") ? "on" : e.value }) }), y.focusin = "onfocusin" in C; var mt = /^(?:focusinfocus|focusoutblur)$/, xt = function (e) { e.stopPropagation() }; S.extend(S.event, { trigger: function (e, t, n, r) { var i, o, a, s, u, l, c, f, p = [n || E], d = v.call(e, "type") ? e.type : e, h = v.call(e, "namespace") ? e.namespace.split(".") : []; if (o = f = a = n = n || E, 3 !== n.nodeType && 8 !== n.nodeType && !mt.test(d + S.event.triggered) && (-1 < d.indexOf(".") && (d = (h = d.split(".")).shift(), h.sort()), u = d.indexOf(":") < 0 && "on" + d, (e = e[S.expando] ? e : new S.Event(d, "object" == typeof e && e)).isTrigger = r ? 2 : 3, e.namespace = h.join("."), e.rnamespace = e.namespace ? new RegExp("(^|\\.)" + h.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, e.result = void 0, e.target || (e.target = n), t = null == t ? [e] : S.makeArray(t, [e]), c = S.event.special[d] || {}, r || !c.trigger || !1 !== c.trigger.apply(n, t))) { if (!r && !c.noBubble && !x(n)) { for (s = c.delegateType || d, mt.test(s + d) || (o = o.parentNode); o; o = o.parentNode)p.push(o), a = o; a === (n.ownerDocument || E) && p.push(a.defaultView || a.parentWindow || C) } i = 0; while ((o = p[i++]) && !e.isPropagationStopped()) f = o, e.type = 1 < i ? s : c.bindType || d, (l = (Y.get(o, "events") || Object.create(null))[e.type] && Y.get(o, "handle")) && l.apply(o, t), (l = u && o[u]) && l.apply && V(o) && (e.result = l.apply(o, t), !1 === e.result && e.preventDefault()); return e.type = d, r || e.isDefaultPrevented() || c._default && !1 !== c._default.apply(p.pop(), t) || !V(n) || u && m(n[d]) && !x(n) && ((a = n[u]) && (n[u] = null), S.event.triggered = d, e.isPropagationStopped() && f.addEventListener(d, xt), n[d](), e.isPropagationStopped() && f.removeEventListener(d, xt), S.event.triggered = void 0, a && (n[u] = a)), e.result } }, simulate: function (e, t, n) { var r = S.extend(new S.Event, n, { type: e, isSimulated: !0 }); S.event.trigger(r, null, t) } }), S.fn.extend({ trigger: function (e, t) { return this.each(function () { S.event.trigger(e, t, this) }) }, triggerHandler: function (e, t) { var n = this[0]; if (n) return S.event.trigger(e, t, n, !0) } }), y.focusin || S.each({ focus: "focusin", blur: "focusout" }, function (n, r) { var i = function (e) { S.event.simulate(r, e.target, S.event.fix(e)) }; S.event.special[r] = { setup: function () { var e = this.ownerDocument || this.document || this, t = Y.access(e, r); t || e.addEventListener(n, i, !0), Y.access(e, r, (t || 0) + 1) }, teardown: function () { var e = this.ownerDocument || this.document || this, t = Y.access(e, r) - 1; t ? Y.access(e, r, t) : (e.removeEventListener(n, i, !0), Y.remove(e, r)) } } }); var bt = C.location, wt = { guid: Date.now() }, Tt = /\?/; S.parseXML = function (e) { var t, n; if (!e || "string" != typeof e) return null; try { t = (new C.DOMParser).parseFromString(e, "text/xml") } catch (e) { } return n = t && t.getElementsByTagName("parsererror")[0], t && !n || S.error("Invalid XML: " + (n ? S.map(n.childNodes, function (e) { return e.textContent }).join("\n") : e)), t }; var Ct = /\[\]$/, Et = /\r?\n/g, St = /^(?:submit|button|image|reset|file)$/i, kt = /^(?:input|select|textarea|keygen)/i; function At(n, e, r, i) { var t; if (Array.isArray(e)) S.each(e, function (e, t) { r || Ct.test(n) ? i(n, t) : At(n + "[" + ("object" == typeof t && null != t ? e : "") + "]", t, r, i) }); else if (r || "object" !== w(e)) i(n, e); else for (t in e) At(n + "[" + t + "]", e[t], r, i) } S.param = function (e, t) { var n, r = [], i = function (e, t) { var n = m(t) ? t() : t; r[r.length] = encodeURIComponent(e) + "=" + encodeURIComponent(null == n ? "" : n) }; if (null == e) return ""; if (Array.isArray(e) || e.jquery && !S.isPlainObject(e)) S.each(e, function () { i(this.name, this.value) }); else for (n in e) At(n, e[n], t, i); return r.join("&") }, S.fn.extend({ serialize: function () { return S.param(this.serializeArray()) }, serializeArray: function () { return this.map(function () { var e = S.prop(this, "elements"); return e ? S.makeArray(e) : this }).filter(function () { var e = this.type; return this.name && !S(this).is(":disabled") && kt.test(this.nodeName) && !St.test(e) && (this.checked || !pe.test(e)) }).map(function (e, t) { var n = S(this).val(); return null == n ? null : Array.isArray(n) ? S.map(n, function (e) { return { name: t.name, value: e.replace(Et, "\r\n") } }) : { name: t.name, value: n.replace(Et, "\r\n") } }).get() } }); var Nt = /%20/g, jt = /#.*$/, Dt = /([?&])_=[^&]*/, qt = /^(.*?):[ \t]*([^\r\n]*)$/gm, Lt = /^(?:GET|HEAD)$/, Ht = /^\/\//, Ot = {}, Pt = {}, Rt = "*/".concat("*"), Mt = E.createElement("a"); function It(o) { return function (e, t) { "string" != typeof e && (t = e, e = "*"); var n, r = 0, i = e.toLowerCase().match(P) || []; if (m(t)) while (n = i[r++]) "+" === n[0] ? (n = n.slice(1) || "*", (o[n] = o[n] || []).unshift(t)) : (o[n] = o[n] || []).push(t) } } function Wt(t, i, o, a) { var s = {}, u = t === Pt; function l(e) { var r; return s[e] = !0, S.each(t[e] || [], function (e, t) { var n = t(i, o, a); return "string" != typeof n || u || s[n] ? u ? !(r = n) : void 0 : (i.dataTypes.unshift(n), l(n), !1) }), r } return l(i.dataTypes[0]) || !s["*"] && l("*") } function Ft(e, t) { var n, r, i = S.ajaxSettings.flatOptions || {}; for (n in t) void 0 !== t[n] && ((i[n] ? e : r || (r = {}))[n] = t[n]); return r && S.extend(!0, e, r), e } Mt.href = bt.href, S.extend({ active: 0, lastModified: {}, etag: {}, ajaxSettings: { url: bt.href, type: "GET", isLocal: /^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(bt.protocol), global: !0, processData: !0, async: !0, contentType: "application/x-www-form-urlencoded; charset=UTF-8", accepts: { "*": Rt, text: "text/plain", html: "text/html", xml: "application/xml, text/xml", json: "application/json, text/javascript" }, contents: { xml: /\bxml\b/, html: /\bhtml/, json: /\bjson\b/ }, responseFields: { xml: "responseXML", text: "responseText", json: "responseJSON" }, converters: { "* text": String, "text html": !0, "text json": JSON.parse, "text xml": S.parseXML }, flatOptions: { url: !0, context: !0 } }, ajaxSetup: function (e, t) { return t ? Ft(Ft(e, S.ajaxSettings), t) : Ft(S.ajaxSettings, e) }, ajaxPrefilter: It(Ot), ajaxTransport: It(Pt), ajax: function (e, t) { "object" == typeof e && (t = e, e = void 0), t = t || {}; var c, f, p, n, d, r, h, g, i, o, v = S.ajaxSetup({}, t), y = v.context || v, m = v.context && (y.nodeType || y.jquery) ? S(y) : S.event, x = S.Deferred(), b = S.Callbacks("once memory"), w = v.statusCode || {}, a = {}, s = {}, u = "canceled", T = { readyState: 0, getResponseHeader: function (e) { var t; if (h) { if (!n) { n = {}; while (t = qt.exec(p)) n[t[1].toLowerCase() + " "] = (n[t[1].toLowerCase() + " "] || []).concat(t[2]) } t = n[e.toLowerCase() + " "] } return null == t ? null : t.join(", ") }, getAllResponseHeaders: function () { return h ? p : null }, setRequestHeader: function (e, t) { return null == h && (e = s[e.toLowerCase()] = s[e.toLowerCase()] || e, a[e] = t), this }, overrideMimeType: function (e) { return null == h && (v.mimeType = e), this }, statusCode: function (e) { var t; if (e) if (h) T.always(e[T.status]); else for (t in e) w[t] = [w[t], e[t]]; return this }, abort: function (e) { var t = e || u; return c && c.abort(t), l(0, t), this } }; if (x.promise(T), v.url = ((e || v.url || bt.href) + "").replace(Ht, bt.protocol + "//"), v.type = t.method || t.type || v.method || v.type, v.dataTypes = (v.dataType || "*").toLowerCase().match(P) || [""], null == v.crossDomain) { r = E.createElement("a"); try { r.href = v.url, r.href = r.href, v.crossDomain = Mt.protocol + "//" + Mt.host != r.protocol + "//" + r.host } catch (e) { v.crossDomain = !0 } } if (v.data && v.processData && "string" != typeof v.data && (v.data = S.param(v.data, v.traditional)), Wt(Ot, v, t, T), h) return T; for (i in (g = S.event && v.global) && 0 == S.active++ && S.event.trigger("ajaxStart"), v.type = v.type.toUpperCase(), v.hasContent = !Lt.test(v.type), f = v.url.replace(jt, ""), v.hasContent ? v.data && v.processData && 0 === (v.contentType || "").indexOf("application/x-www-form-urlencoded") && (v.data = v.data.replace(Nt, "+")) : (o = v.url.slice(f.length), v.data && (v.processData || "string" == typeof v.data) && (f += (Tt.test(f) ? "&" : "?") + v.data, delete v.data), !1 === v.cache && (f = f.replace(Dt, "$1"), o = (Tt.test(f) ? "&" : "?") + "_=" + wt.guid++ + o), v.url = f + o), v.ifModified && (S.lastModified[f] && T.setRequestHeader("If-Modified-Since", S.lastModified[f]), S.etag[f] && T.setRequestHeader("If-None-Match", S.etag[f])), (v.data && v.hasContent && !1 !== v.contentType || t.contentType) && T.setRequestHeader("Content-Type", v.contentType), T.setRequestHeader("Accept", v.dataTypes[0] && v.accepts[v.dataTypes[0]] ? v.accepts[v.dataTypes[0]] + ("*" !== v.dataTypes[0] ? ", " + Rt + "; q=0.01" : "") : v.accepts["*"]), v.headers) T.setRequestHeader(i, v.headers[i]); if (v.beforeSend && (!1 === v.beforeSend.call(y, T, v) || h)) return T.abort(); if (u = "abort", b.add(v.complete), T.done(v.success), T.fail(v.error), c = Wt(Pt, v, t, T)) { if (T.readyState = 1, g && m.trigger("ajaxSend", [T, v]), h) return T; v.async && 0 < v.timeout && (d = C.setTimeout(function () { T.abort("timeout") }, v.timeout)); try { h = !1, c.send(a, l) } catch (e) { if (h) throw e; l(-1, e) } } else l(-1, "No Transport"); function l(e, t, n, r) { var i, o, a, s, u, l = t; h || (h = !0, d && C.clearTimeout(d), c = void 0, p = r || "", T.readyState = 0 < e ? 4 : 0, i = 200 <= e && e < 300 || 304 === e, n && (s = function (e, t, n) { var r, i, o, a, s = e.contents, u = e.dataTypes; while ("*" === u[0]) u.shift(), void 0 === r && (r = e.mimeType || t.getResponseHeader("Content-Type")); if (r) for (i in s) if (s[i] && s[i].test(r)) { u.unshift(i); break } if (u[0] in n) o = u[0]; else { for (i in n) { if (!u[0] || e.converters[i + " " + u[0]]) { o = i; break } a || (a = i) } o = o || a } if (o) return o !== u[0] && u.unshift(o), n[o] }(v, T, n)), !i && -1 < S.inArray("script", v.dataTypes) && S.inArray("json", v.dataTypes) < 0 && (v.converters["text script"] = function () { }), s = function (e, t, n, r) { var i, o, a, s, u, l = {}, c = e.dataTypes.slice(); if (c[1]) for (a in e.converters) l[a.toLowerCase()] = e.converters[a]; o = c.shift(); while (o) if (e.responseFields[o] && (n[e.responseFields[o]] = t), !u && r && e.dataFilter && (t = e.dataFilter(t, e.dataType)), u = o, o = c.shift()) if ("*" === o) o = u; else if ("*" !== u && u !== o) { if (!(a = l[u + " " + o] || l["* " + o])) for (i in l) if ((s = i.split(" "))[1] === o && (a = l[u + " " + s[0]] || l["* " + s[0]])) { !0 === a ? a = l[i] : !0 !== l[i] && (o = s[0], c.unshift(s[1])); break } if (!0 !== a) if (a && e["throws"]) t = a(t); else try { t = a(t) } catch (e) { return { state: "parsererror", error: a ? e : "No conversion from " + u + " to " + o } } } return { state: "success", data: t } }(v, s, T, i), i ? (v.ifModified && ((u = T.getResponseHeader("Last-Modified")) && (S.lastModified[f] = u), (u = T.getResponseHeader("etag")) && (S.etag[f] = u)), 204 === e || "HEAD" === v.type ? l = "nocontent" : 304 === e ? l = "notmodified" : (l = s.state, o = s.data, i = !(a = s.error))) : (a = l, !e && l || (l = "error", e < 0 && (e = 0))), T.status = e, T.statusText = (t || l) + "", i ? x.resolveWith(y, [o, l, T]) : x.rejectWith(y, [T, l, a]), T.statusCode(w), w = void 0, g && m.trigger(i ? "ajaxSuccess" : "ajaxError", [T, v, i ? o : a]), b.fireWith(y, [T, l]), g && (m.trigger("ajaxComplete", [T, v]), --S.active || S.event.trigger("ajaxStop"))) } return T }, getJSON: function (e, t, n) { return S.get(e, t, n, "json") }, getScript: function (e, t) { return S.get(e, void 0, t, "script") } }), S.each(["get", "post"], function (e, i) { S[i] = function (e, t, n, r) { return m(t) && (r = r || n, n = t, t = void 0), S.ajax(S.extend({ url: e, type: i, dataType: r, data: t, success: n }, S.isPlainObject(e) && e)) } }), S.ajaxPrefilter(function (e) { var t; for (t in e.headers) "content-type" === t.toLowerCase() && (e.contentType = e.headers[t] || "") }), S._evalUrl = function (e, t, n) { return S.ajax({ url: e, type: "GET", dataType: "script", cache: !0, async: !1, global: !1, converters: { "text script": function () { } }, dataFilter: function (e) { S.globalEval(e, t, n) } }) }, S.fn.extend({ wrapAll: function (e) { var t; return this[0] && (m(e) && (e = e.call(this[0])), t = S(e, this[0].ownerDocument).eq(0).clone(!0), this[0].parentNode && t.insertBefore(this[0]), t.map(function () { var e = this; while (e.firstElementChild) e = e.firstElementChild; return e }).append(this)), this }, wrapInner: function (n) { return m(n) ? this.each(function (e) { S(this).wrapInner(n.call(this, e)) }) : this.each(function () { var e = S(this), t = e.contents(); t.length ? t.wrapAll(n) : e.append(n) }) }, wrap: function (t) { var n = m(t); return this.each(function (e) { S(this).wrapAll(n ? t.call(this, e) : t) }) }, unwrap: function (e) { return this.parent(e).not("body").each(function () { S(this).replaceWith(this.childNodes) }), this } }), S.expr.pseudos.hidden = function (e) { return !S.expr.pseudos.visible(e) }, S.expr.pseudos.visible = function (e) { return !!(e.offsetWidth || e.offsetHeight || e.getClientRects().length) }, S.ajaxSettings.xhr = function () { try { return new C.XMLHttpRequest } catch (e) { } }; var Bt = { 0: 200, 1223: 204 }, $t = S.ajaxSettings.xhr(); y.cors = !!$t && "withCredentials" in $t, y.ajax = $t = !!$t, S.ajaxTransport(function (i) { var o, a; if (y.cors || $t && !i.crossDomain) return { send: function (e, t) { var n, r = i.xhr(); if (r.open(i.type, i.url, i.async, i.username, i.password), i.xhrFields) for (n in i.xhrFields) r[n] = i.xhrFields[n]; for (n in i.mimeType && r.overrideMimeType && r.overrideMimeType(i.mimeType), i.crossDomain || e["X-Requested-With"] || (e["X-Requested-With"] = "XMLHttpRequest"), e) r.setRequestHeader(n, e[n]); o = function (e) { return function () { o && (o = a = r.onload = r.onerror = r.onabort = r.ontimeout = r.onreadystatechange = null, "abort" === e ? r.abort() : "error" === e ? "number" != typeof r.status ? t(0, "error") : t(r.status, r.statusText) : t(Bt[r.status] || r.status, r.statusText, "text" !== (r.responseType || "text") || "string" != typeof r.responseText ? { binary: r.response } : { text: r.responseText }, r.getAllResponseHeaders())) } }, r.onload = o(), a = r.onerror = r.ontimeout = o("error"), void 0 !== r.onabort ? r.onabort = a : r.onreadystatechange = function () { 4 === r.readyState && C.setTimeout(function () { o && a() }) }, o = o("abort"); try { r.send(i.hasContent && i.data || null) } catch (e) { if (o) throw e } }, abort: function () { o && o() } } }), S.ajaxPrefilter(function (e) { e.crossDomain && (e.contents.script = !1) }), S.ajaxSetup({ accepts: { script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" }, contents: { script: /\b(?:java|ecma)script\b/ }, converters: { "text script": function (e) { return S.globalEval(e), e } } }), S.ajaxPrefilter("script", function (e) { void 0 === e.cache && (e.cache = !1), e.crossDomain && (e.type = "GET") }), S.ajaxTransport("script", function (n) { var r, i; if (n.crossDomain || n.scriptAttrs) return { send: function (e, t) { r = S("